From 1cd618ab5d4395e8d72dad8adc31eb15964d2ca4 Mon Sep 17 00:00:00 2001 From: Andrea Amorese Date: Mon, 22 Nov 2021 15:36:16 +0100 Subject: [PATCH] Built motion from commit 64323aab.|2.5.38 --- apidoc/api_project.js | 2 +- apidoc/api_project.json | 2 +- server/api/action/action.attributes.js | 2 +- server/api/action/action.controller.js | 2 +- server/api/action/action.model.js | 2 +- server/api/action/action.rpc.js | 2 +- server/api/action/index.js | 2 +- .../analyticCustomReport.attributes.js | 2 +- .../analyticCustomReport.controller.js | 2 +- .../analyticCustomReport.model.js | 2 +- .../analyticCustomReport.rpc.js | 2 +- server/api/analyticCustomReport/index.js | 2 +- .../analyticDefaultReport.attributes.js | 2 +- .../analyticDefaultReport.controller.js | 2 +- .../analyticDefaultReport.model.js | 2 +- .../analyticDefaultReport.rpc.js | 2 +- server/api/analyticDefaultReport/index.js | 2 +- .../analyticExtractedReport.attributes.js | 2 +- .../analyticExtractedReport.controller.js | 2 +- .../analyticExtractedReport.model.js | 2 +- .../analyticExtractedReport.rpc.js | 2 +- server/api/analyticExtractedReport/index.js | 2 +- .../analyticFieldReport.attributes.js | 2 +- .../analyticFieldReport.controller.js | 2 +- .../analyticFieldReport.model.js | 2 +- .../analyticFieldReport/analyticFieldReport.rpc.js | 2 +- server/api/analyticFieldReport/index.js | 2 +- .../analyticMetric/analyticMetric.attributes.js | 2 +- .../analyticMetric/analyticMetric.controller.js | 2 +- server/api/analyticMetric/analyticMetric.model.js | 2 +- server/api/analyticMetric/analyticMetric.rpc.js | 2 +- server/api/analyticMetric/index.js | 2 +- .../analyticTreeReport.attributes.js | 2 +- .../analyticTreeReport.controller.js | 2 +- .../analyticTreeReport/analyticTreeReport.model.js | 2 +- .../analyticTreeReport/analyticTreeReport.rpc.js | 2 +- server/api/analyticTreeReport/index.js | 2 +- server/api/attachment/attachment.attributes.js | 2 +- server/api/attachment/attachment.controller.js | 2 +- server/api/attachment/attachment.model.js | 2 +- server/api/attachment/attachment.rpc.js | 2 +- server/api/attachment/index.js | 2 +- .../authActiveDirectory.controller.js | 2 +- server/api/authActiveDirectory/index.js | 2 +- server/api/authGoogle/authGoogle.controller.js | 2 +- server/api/authGoogle/index.js | 2 +- server/api/authLocal/authLocal.controller.js | 2 +- server/api/authLocal/index.js | 2 +- server/api/automation/automation.attributes.js | 2 +- server/api/automation/automation.controller.js | 2 +- server/api/automation/automation.model.js | 2 +- server/api/automation/automation.rpc.js | 2 +- server/api/automation/index.js | 2 +- server/api/campaign/campaign.attributes.js | 2 +- server/api/campaign/campaign.controller.js | 2 +- server/api/campaign/campaign.model.js | 2 +- server/api/campaign/campaign.rpc.js | 2 +- server/api/campaign/index.js | 2 +- server/api/cannedAnswer/cannedAnswer.attributes.js | 2 +- server/api/cannedAnswer/cannedAnswer.controller.js | 2 +- server/api/cannedAnswer/cannedAnswer.model.js | 2 +- server/api/cannedAnswer/cannedAnswer.rpc.js | 2 +- server/api/cannedAnswer/index.js | 2 +- server/api/cdr/cdr.attributes.js | 2 +- server/api/cdr/cdr.controller.js | 2 +- server/api/cdr/cdr.model.js | 2 +- server/api/cdr/cdr.rpc.js | 2 +- server/api/cdr/index.js | 2 +- .../chatApplication/chatApplication.attributes.js | 2 +- .../chatApplication/chatApplication.controller.js | 2 +- .../api/chatApplication/chatApplication.model.js | 2 +- server/api/chatApplication/chatApplication.rpc.js | 2 +- server/api/chatApplication/index.js | 2 +- server/api/chatGroup/chatGroup.attributes.js | 2 +- server/api/chatGroup/chatGroup.controller.js | 2 +- server/api/chatGroup/chatGroup.events.js | 2 +- server/api/chatGroup/chatGroup.model.js | 2 +- server/api/chatGroup/chatGroup.rpc.js | 2 +- server/api/chatGroup/chatGroup.socket.js | 2 +- server/api/chatGroup/index.js | 2 +- .../chatInteraction/chatInteraction.attributes.js | 2 +- .../chatInteraction/chatInteraction.controller.js | 2 +- .../api/chatInteraction/chatInteraction.events.js | 2 +- .../api/chatInteraction/chatInteraction.model.js | 2 +- server/api/chatInteraction/chatInteraction.rpc.js | 2 +- .../api/chatInteraction/chatInteraction.socket.js | 2 +- server/api/chatInteraction/index.js | 2 +- .../chatInternalMessage.attributes.js | 2 +- .../chatInternalMessage.controller.js | 2 +- .../chatInternalMessage.events.js | 2 +- .../chatInternalMessage.model.js | 2 +- .../chatInternalMessage/chatInternalMessage.rpc.js | 2 +- .../chatInternalMessage.socket.js | 2 +- server/api/chatInternalMessage/index.js | 2 +- server/api/chatMessage/chatMessage.attributes.js | 2 +- server/api/chatMessage/chatMessage.controller.js | 2 +- server/api/chatMessage/chatMessage.events.js | 2 +- server/api/chatMessage/chatMessage.model.js | 2 +- server/api/chatMessage/chatMessage.rpc.js | 2 +- server/api/chatMessage/chatMessage.socket.js | 2 +- server/api/chatMessage/index.js | 2 +- .../chatOfflineMessage.attributes.js | 2 +- .../chatOfflineMessage.controller.js | 2 +- .../chatOfflineMessage/chatOfflineMessage.model.js | 2 +- .../chatOfflineMessage/chatOfflineMessage.rpc.js | 2 +- server/api/chatOfflineMessage/index.js | 2 +- .../chatProactiveAction.attributes.js | 2 +- .../chatProactiveAction.controller.js | 2 +- .../chatProactiveAction.model.js | 2 +- .../chatProactiveAction/chatProactiveAction.rpc.js | 2 +- server/api/chatProactiveAction/index.js | 2 +- server/api/chatQueue/chatQueue.attributes.js | 2 +- server/api/chatQueue/chatQueue.controller.js | 2 +- server/api/chatQueue/chatQueue.events.js | 2 +- server/api/chatQueue/chatQueue.model.js | 2 +- server/api/chatQueue/chatQueue.rpc.js | 2 +- server/api/chatQueue/chatQueue.socket.js | 2 +- server/api/chatQueue/index.js | 2 +- .../chatQueueReport/chatQueueReport.attributes.js | 2 +- .../chatQueueReport/chatQueueReport.controller.js | 2 +- .../api/chatQueueReport/chatQueueReport.model.js | 2 +- server/api/chatQueueReport/chatQueueReport.rpc.js | 2 +- server/api/chatQueueReport/index.js | 2 +- .../chatTransferReport.attributes.js | 2 +- .../chatTransferReport.controller.js | 2 +- .../chatTransferReport/chatTransferReport.model.js | 2 +- .../chatTransferReport/chatTransferReport.rpc.js | 2 +- server/api/chatTransferReport/index.js | 2 +- server/api/chatWebsite/chatWebsite.attributes.js | 2 +- server/api/chatWebsite/chatWebsite.controller.js | 2 +- server/api/chatWebsite/chatWebsite.events.js | 2 +- server/api/chatWebsite/chatWebsite.model.js | 2 +- server/api/chatWebsite/chatWebsite.rpc.js | 2 +- server/api/chatWebsite/chatWebsite.socket.js | 2 +- server/api/chatWebsite/index.js | 2 +- .../api/cloudProvider/cloudProvider.attributes.js | 2 +- .../api/cloudProvider/cloudProvider.controller.js | 2 +- server/api/cloudProvider/cloudProvider.model.js | 2 +- server/api/cloudProvider/cloudProvider.rpc.js | 2 +- server/api/cloudProvider/index.js | 2 +- server/api/cmCompany/cmCompany.attributes.js | 2 +- server/api/cmCompany/cmCompany.controller.js | 2 +- server/api/cmCompany/cmCompany.model.js | 2 +- server/api/cmCompany/cmCompany.rpc.js | 2 +- server/api/cmCompany/index.js | 2 +- server/api/cmContact/cmContact.attributes.js | 2 +- server/api/cmContact/cmContact.controller.js | 2 +- server/api/cmContact/cmContact.events.js | 2 +- server/api/cmContact/cmContact.model.js | 2 +- server/api/cmContact/cmContact.rpc.js | 2 +- server/api/cmContact/cmContact.socket.js | 2 +- server/api/cmContact/index.js | 2 +- .../api/cmCustomField/cmCustomField.attributes.js | 2 +- .../api/cmCustomField/cmCustomField.controller.js | 2 +- server/api/cmCustomField/cmCustomField.model.js | 2 +- server/api/cmCustomField/cmCustomField.rpc.js | 2 +- server/api/cmCustomField/index.js | 2 +- server/api/cmHopper/cmHopper.attributes.js | 2 +- server/api/cmHopper/cmHopper.controller.js | 2 +- server/api/cmHopper/cmHopper.model.js | 2 +- server/api/cmHopper/cmHopper.rpc.js | 2 +- server/api/cmHopper/index.js | 2 +- .../api/cmHopperBlack/cmHopperBlack.attributes.js | 2 +- .../api/cmHopperBlack/cmHopperBlack.controller.js | 2 +- server/api/cmHopperBlack/cmHopperBlack.model.js | 2 +- server/api/cmHopperBlack/cmHopperBlack.rpc.js | 2 +- server/api/cmHopperBlack/index.js | 2 +- .../api/cmHopperFinal/cmHopperFinal.attributes.js | 2 +- .../api/cmHopperFinal/cmHopperFinal.controller.js | 2 +- server/api/cmHopperFinal/cmHopperFinal.model.js | 2 +- server/api/cmHopperFinal/cmHopperFinal.rpc.js | 2 +- server/api/cmHopperFinal/index.js | 2 +- .../cmHopperHistory/cmHopperHistory.attributes.js | 2 +- .../cmHopperHistory/cmHopperHistory.controller.js | 2 +- .../api/cmHopperHistory/cmHopperHistory.model.js | 2 +- server/api/cmHopperHistory/cmHopperHistory.rpc.js | 2 +- server/api/cmHopperHistory/index.js | 2 +- server/api/cmList/cmList.attributes.js | 2 +- server/api/cmList/cmList.controller.js | 2 +- server/api/cmList/cmList.events.js | 2 +- server/api/cmList/cmList.model.js | 2 +- server/api/cmList/cmList.rpc.js | 2 +- server/api/cmList/cmList.socket.js | 2 +- server/api/cmList/index.js | 2 +- server/api/condition/condition.attributes.js | 2 +- server/api/condition/condition.controller.js | 2 +- server/api/condition/condition.model.js | 2 +- server/api/condition/condition.rpc.js | 2 +- server/api/condition/index.js | 2 +- server/api/dashboard/dashboard.attributes.js | 2 +- server/api/dashboard/dashboard.controller.js | 2 +- server/api/dashboard/dashboard.events.js | 2 +- server/api/dashboard/dashboard.model.js | 2 +- server/api/dashboard/dashboard.rpc.js | 2 +- server/api/dashboard/dashboard.socket.js | 2 +- server/api/dashboard/index.js | 2 +- .../api/dashboardItem/dashboardItem.attributes.js | 2 +- .../api/dashboardItem/dashboardItem.controller.js | 2 +- server/api/dashboardItem/dashboardItem.events.js | 2 +- server/api/dashboardItem/dashboardItem.model.js | 2 +- server/api/dashboardItem/dashboardItem.rpc.js | 2 +- server/api/dashboardItem/dashboardItem.socket.js | 2 +- server/api/dashboardItem/index.js | 2 +- server/api/disposition/disposition.attributes.js | 2 +- server/api/disposition/disposition.controller.js | 2 +- server/api/disposition/disposition.model.js | 2 +- server/api/disposition/disposition.rpc.js | 2 +- server/api/disposition/index.js | 2 +- server/api/faxAccount/faxAccount.attributes.js | 2 +- server/api/faxAccount/faxAccount.controller.js | 2 +- server/api/faxAccount/faxAccount.events.js | 2 +- server/api/faxAccount/faxAccount.model.js | 2 +- server/api/faxAccount/faxAccount.rpc.js | 2 +- server/api/faxAccount/faxAccount.socket.js | 2 +- server/api/faxAccount/index.js | 2 +- .../faxApplication/faxApplication.attributes.js | 2 +- .../faxApplication/faxApplication.controller.js | 2 +- server/api/faxApplication/faxApplication.model.js | 2 +- server/api/faxApplication/faxApplication.rpc.js | 2 +- server/api/faxApplication/index.js | 2 +- .../faxInteraction/faxInteraction.attributes.js | 2 +- .../faxInteraction/faxInteraction.controller.js | 2 +- server/api/faxInteraction/faxInteraction.events.js | 2 +- server/api/faxInteraction/faxInteraction.model.js | 2 +- server/api/faxInteraction/faxInteraction.rpc.js | 2 +- server/api/faxInteraction/faxInteraction.socket.js | 2 +- server/api/faxInteraction/index.js | 2 +- server/api/faxMessage/faxMessage.attributes.js | 2 +- server/api/faxMessage/faxMessage.controller.js | 2 +- server/api/faxMessage/faxMessage.events.js | 2 +- server/api/faxMessage/faxMessage.model.js | 2 +- server/api/faxMessage/faxMessage.rpc.js | 2 +- server/api/faxMessage/faxMessage.socket.js | 2 +- server/api/faxMessage/index.js | 2 +- server/api/faxQueue/faxQueue.attributes.js | 2 +- server/api/faxQueue/faxQueue.controller.js | 2 +- server/api/faxQueue/faxQueue.events.js | 2 +- server/api/faxQueue/faxQueue.model.js | 2 +- server/api/faxQueue/faxQueue.rpc.js | 2 +- server/api/faxQueue/faxQueue.socket.js | 2 +- server/api/faxQueue/index.js | 2 +- .../faxQueueReport/faxQueueReport.attributes.js | 2 +- .../faxQueueReport/faxQueueReport.controller.js | 2 +- server/api/faxQueueReport/faxQueueReport.model.js | 2 +- server/api/faxQueueReport/faxQueueReport.rpc.js | 2 +- server/api/faxQueueReport/index.js | 2 +- .../faxTransferReport.attributes.js | 2 +- .../faxTransferReport.controller.js | 2 +- .../faxTransferReport/faxTransferReport.model.js | 2 +- .../api/faxTransferReport/faxTransferReport.rpc.js | 2 +- server/api/faxTransferReport/index.js | 2 +- server/api/intDeskAccount/index.js | 2 +- .../intDeskAccount/intDeskAccount.attributes.js | 2 +- .../intDeskAccount/intDeskAccount.controller.js | 2 +- server/api/intDeskAccount/intDeskAccount.model.js | 2 +- server/api/intDeskAccount/intDeskAccount.rpc.js | 2 +- server/api/intDeskConfiguration/index.js | 2 +- .../intDeskConfiguration.attributes.js | 2 +- .../intDeskConfiguration.controller.js | 2 +- .../intDeskConfiguration.model.js | 2 +- .../intDeskConfiguration.rpc.js | 2 +- server/api/intDeskField/index.js | 2 +- server/api/intDeskField/intDeskField.attributes.js | 2 +- server/api/intDeskField/intDeskField.controller.js | 2 +- server/api/intDeskField/intDeskField.model.js | 2 +- server/api/intDeskField/intDeskField.rpc.js | 2 +- server/api/intDynamics365Account/index.js | 2 +- .../intDynamics365Account.attributes.js | 2 +- .../intDynamics365Account.controller.js | 2 +- .../intDynamics365Account.model.js | 2 +- .../intDynamics365Account.rpc.js | 2 +- server/api/intDynamics365Configuration/index.js | 2 +- .../intDynamics365Configuration.attributes.js | 2 +- .../intDynamics365Configuration.controller.js | 2 +- .../intDynamics365Configuration.model.js | 2 +- .../intDynamics365Configuration.rpc.js | 2 +- server/api/intDynamics365Field/index.js | 2 +- .../intDynamics365Field.attributes.js | 2 +- .../intDynamics365Field.controller.js | 2 +- .../intDynamics365Field.model.js | 2 +- .../intDynamics365Field/intDynamics365Field.rpc.js | 2 +- server/api/intFreshdeskAccount/index.js | 2 +- .../intFreshdeskAccount.attributes.js | 2 +- .../intFreshdeskAccount.controller.js | 2 +- .../intFreshdeskAccount.model.js | 2 +- .../intFreshdeskAccount/intFreshdeskAccount.rpc.js | 2 +- server/api/intFreshdeskConfiguration/index.js | 2 +- .../intFreshdeskConfiguration.attributes.js | 2 +- .../intFreshdeskConfiguration.controller.js | 2 +- .../intFreshdeskConfiguration.model.js | 2 +- .../intFreshdeskConfiguration.rpc.js | 2 +- server/api/intFreshdeskField/index.js | 2 +- .../intFreshdeskField.attributes.js | 2 +- .../intFreshdeskField.controller.js | 2 +- .../intFreshdeskField/intFreshdeskField.model.js | 2 +- .../api/intFreshdeskField/intFreshdeskField.rpc.js | 2 +- server/api/intFreshsalesAccount/index.js | 2 +- .../intFreshsalesAccount.attributes.js | 2 +- .../intFreshsalesAccount.controller.js | 2 +- .../intFreshsalesAccount.model.js | 2 +- .../intFreshsalesAccount.rpc.js | 2 +- server/api/intFreshsalesConfiguration/index.js | 2 +- .../intFreshsalesConfiguration.attributes.js | 2 +- .../intFreshsalesConfiguration.controller.js | 2 +- .../intFreshsalesConfiguration.model.js | 2 +- .../intFreshsalesConfiguration.rpc.js | 2 +- server/api/intFreshsalesField/index.js | 2 +- .../intFreshsalesField.attributes.js | 2 +- .../intFreshsalesField.controller.js | 2 +- .../intFreshsalesField/intFreshsalesField.model.js | 2 +- .../intFreshsalesField/intFreshsalesField.rpc.js | 2 +- server/api/intSalesforceAccount/index.js | 2 +- .../intSalesforceAccount.attributes.js | 2 +- .../intSalesforceAccount.controller.js | 2 +- .../intSalesforceAccount.model.js | 2 +- .../intSalesforceAccount.rpc.js | 2 +- server/api/intSalesforceConfiguration/index.js | 2 +- .../intSalesforceConfiguration.attributes.js | 2 +- .../intSalesforceConfiguration.controller.js | 2 +- .../intSalesforceConfiguration.model.js | 2 +- .../intSalesforceConfiguration.rpc.js | 2 +- server/api/intSalesforceField/index.js | 2 +- .../intSalesforceField.attributes.js | 2 +- .../intSalesforceField.controller.js | 2 +- .../intSalesforceField/intSalesforceField.model.js | 2 +- .../intSalesforceField/intSalesforceField.rpc.js | 2 +- server/api/intServicenowAccount/index.js | 2 +- .../intServicenowAccount.attributes.js | 2 +- .../intServicenowAccount.controller.js | 2 +- .../intServicenowAccount.model.js | 2 +- .../intServicenowAccount.rpc.js | 2 +- server/api/intServicenowConfiguration/index.js | 2 +- .../intServicenowConfiguration.attributes.js | 2 +- .../intServicenowConfiguration.controller.js | 2 +- .../intServicenowConfiguration.model.js | 2 +- .../intServicenowConfiguration.rpc.js | 2 +- server/api/intServicenowField/index.js | 2 +- .../intServicenowField.attributes.js | 2 +- .../intServicenowField.controller.js | 2 +- .../intServicenowField/intServicenowField.model.js | 2 +- .../intServicenowField/intServicenowField.rpc.js | 2 +- server/api/intSugarcrmAccount/index.js | 2 +- .../intSugarcrmAccount.attributes.js | 2 +- .../intSugarcrmAccount.controller.js | 2 +- .../intSugarcrmAccount/intSugarcrmAccount.model.js | 2 +- .../intSugarcrmAccount/intSugarcrmAccount.rpc.js | 2 +- server/api/intSugarcrmConfiguration/index.js | 2 +- .../intSugarcrmConfiguration.attributes.js | 2 +- .../intSugarcrmConfiguration.controller.js | 2 +- .../intSugarcrmConfiguration.model.js | 2 +- .../intSugarcrmConfiguration.rpc.js | 2 +- server/api/intSugarcrmField/index.js | 2 +- .../intSugarcrmField.attributes.js | 2 +- .../intSugarcrmField.controller.js | 2 +- .../api/intSugarcrmField/intSugarcrmField.model.js | 2 +- .../api/intSugarcrmField/intSugarcrmField.rpc.js | 2 +- server/api/intVtigerAccount/index.js | 2 +- .../intVtigerAccount.attributes.js | 2 +- .../intVtigerAccount.controller.js | 2 +- .../api/intVtigerAccount/intVtigerAccount.model.js | 2 +- .../api/intVtigerAccount/intVtigerAccount.rpc.js | 2 +- server/api/intVtigerConfiguration/index.js | 2 +- .../intVtigerConfiguration.attributes.js | 2 +- .../intVtigerConfiguration.controller.js | 2 +- .../intVtigerConfiguration.model.js | 2 +- .../intVtigerConfiguration.rpc.js | 2 +- server/api/intVtigerField/index.js | 2 +- .../intVtigerField/intVtigerField.attributes.js | 2 +- .../intVtigerField/intVtigerField.controller.js | 2 +- server/api/intVtigerField/intVtigerField.model.js | 2 +- server/api/intVtigerField/intVtigerField.rpc.js | 2 +- server/api/intZendeskAccount/index.js | 2 +- .../intZendeskAccount.attributes.js | 2 +- .../intZendeskAccount.controller.js | 2 +- .../intZendeskAccount/intZendeskAccount.model.js | 2 +- .../api/intZendeskAccount/intZendeskAccount.rpc.js | 2 +- server/api/intZendeskConfiguration/index.js | 2 +- .../intZendeskConfiguration.attributes.js | 2 +- .../intZendeskConfiguration.controller.js | 2 +- .../intZendeskConfiguration.model.js | 2 +- .../intZendeskConfiguration.rpc.js | 2 +- server/api/intZendeskField/index.js | 2 +- .../intZendeskField/intZendeskField.attributes.js | 2 +- .../intZendeskField/intZendeskField.controller.js | 2 +- .../api/intZendeskField/intZendeskField.model.js | 2 +- server/api/intZendeskField/intZendeskField.rpc.js | 2 +- server/api/intZohoAccount/index.js | 2 +- .../intZohoAccount/intZohoAccount.attributes.js | 2 +- .../intZohoAccount/intZohoAccount.controller.js | 2 +- server/api/intZohoAccount/intZohoAccount.model.js | 2 +- server/api/intZohoAccount/intZohoAccount.rpc.js | 2 +- server/api/intZohoConfiguration/index.js | 2 +- .../intZohoConfiguration.attributes.js | 2 +- .../intZohoConfiguration.controller.js | 2 +- .../intZohoConfiguration.model.js | 2 +- .../intZohoConfiguration.rpc.js | 2 +- server/api/intZohoField/index.js | 2 +- server/api/intZohoField/intZohoField.attributes.js | 2 +- server/api/intZohoField/intZohoField.controller.js | 2 +- server/api/intZohoField/intZohoField.model.js | 2 +- server/api/intZohoField/intZohoField.rpc.js | 2 +- server/api/integration/index.js | 2 +- server/api/integration/integration.attributes.js | 2 +- server/api/integration/integration.controller.js | 2 +- server/api/integration/integration.model.js | 2 +- server/api/integration/integration.rpc.js | 2 +- server/api/integrationReport/index.js | 2 +- .../integrationReport.attributes.js | 2 +- .../integrationReport.controller.js | 2 +- .../integrationReport/integrationReport.model.js | 2 +- .../api/integrationReport/integrationReport.rpc.js | 2 +- server/api/interval/index.js | 2 +- server/api/interval/interval.attributes.js | 2 +- server/api/interval/interval.controller.js | 2 +- server/api/interval/interval.model.js | 2 +- server/api/interval/interval.rpc.js | 2 +- server/api/jira/index.js | 2 +- server/api/jira/jira.controller.js | 2 +- server/api/jscriptyAnswerReport/index.js | 2 +- .../jscriptyAnswerReport.attributes.js | 2 +- .../jscriptyAnswerReport.controller.js | 2 +- .../jscriptyAnswerReport.model.js | 2 +- .../jscriptyAnswerReport.rpc.js | 2 +- server/api/jscriptyProject/index.js | 2 +- .../jscriptyProject/jscriptyProject.attributes.js | 2 +- .../jscriptyProject/jscriptyProject.controller.js | 2 +- .../api/jscriptyProject/jscriptyProject.model.js | 2 +- server/api/jscriptyProject/jscriptyProject.rpc.js | 2 +- server/api/jscriptyQuestionReport/index.js | 2 +- .../jscriptyQuestionReport.attributes.js | 2 +- .../jscriptyQuestionReport.controller.js | 2 +- .../jscriptyQuestionReport.model.js | 2 +- .../jscriptyQuestionReport.rpc.js | 2 +- server/api/jscriptySessionReport/index.js | 2 +- .../jscriptySessionReport.attributes.js | 2 +- .../jscriptySessionReport.controller.js | 2 +- .../jscriptySessionReport.model.js | 2 +- .../jscriptySessionReport.rpc.js | 2 +- server/api/license/index.js | 2 +- server/api/license/license.attributes.js | 2 +- server/api/license/license.controller.js | 2 +- server/api/license/license.model.js | 2 +- server/api/license/license.rpc.js | 2 +- server/api/mailAccount/index.js | 2 +- server/api/mailAccount/mailAccount.attributes.js | 2 +- server/api/mailAccount/mailAccount.controller.js | 2 +- server/api/mailAccount/mailAccount.events.js | 2 +- server/api/mailAccount/mailAccount.model.js | 2 +- server/api/mailAccount/mailAccount.rpc.js | 2 +- server/api/mailAccount/mailAccount.socket.js | 2 +- server/api/mailApplication/index.js | 2 +- .../mailApplication/mailApplication.attributes.js | 2 +- .../mailApplication/mailApplication.controller.js | 2 +- .../api/mailApplication/mailApplication.model.js | 2 +- server/api/mailApplication/mailApplication.rpc.js | 2 +- server/api/mailInteraction/index.js | 2 +- .../mailInteraction/mailInteraction.attributes.js | 2 +- .../mailInteraction/mailInteraction.controller.js | 2 +- .../api/mailInteraction/mailInteraction.events.js | 2 +- .../api/mailInteraction/mailInteraction.model.js | 2 +- server/api/mailInteraction/mailInteraction.rpc.js | 2 +- .../api/mailInteraction/mailInteraction.socket.js | 2 +- server/api/mailMessage/index.js | 2 +- server/api/mailMessage/mailMessage.attributes.js | 2 +- server/api/mailMessage/mailMessage.controller.js | 2 +- server/api/mailMessage/mailMessage.events.js | 2 +- server/api/mailMessage/mailMessage.model.js | 2 +- server/api/mailMessage/mailMessage.rpc.js | 2 +- server/api/mailMessage/mailMessage.socket.js | 2 +- server/api/mailQueue/index.js | 2 +- server/api/mailQueue/mailQueue.attributes.js | 2 +- server/api/mailQueue/mailQueue.controller.js | 2 +- server/api/mailQueue/mailQueue.events.js | 2 +- server/api/mailQueue/mailQueue.model.js | 2 +- server/api/mailQueue/mailQueue.rpc.js | 2 +- server/api/mailQueue/mailQueue.socket.js | 2 +- server/api/mailQueueReport/index.js | 2 +- .../mailQueueReport/mailQueueReport.attributes.js | 2 +- .../mailQueueReport/mailQueueReport.controller.js | 2 +- .../api/mailQueueReport/mailQueueReport.model.js | 2 +- server/api/mailQueueReport/mailQueueReport.rpc.js | 2 +- server/api/mailServerIn/index.js | 2 +- server/api/mailServerIn/mailServerIn.attributes.js | 2 +- server/api/mailServerIn/mailServerIn.model.js | 2 +- server/api/mailServerIn/mailServerIn.rpc.js | 2 +- server/api/mailServerOut/index.js | 2 +- .../api/mailServerOut/mailServerOut.attributes.js | 2 +- .../api/mailServerOut/mailServerOut.controller.js | 2 +- server/api/mailServerOut/mailServerOut.model.js | 2 +- server/api/mailServerOut/mailServerOut.rpc.js | 2 +- server/api/mailSubstatus/index.js | 2 +- .../api/mailSubstatus/mailSubstatus.attributes.js | 2 +- .../api/mailSubstatus/mailSubstatus.controller.js | 2 +- server/api/mailSubstatus/mailSubstatus.events.js | 2 +- server/api/mailSubstatus/mailSubstatus.model.js | 2 +- server/api/mailSubstatus/mailSubstatus.rpc.js | 2 +- server/api/mailTransferReport/index.js | 2 +- .../mailTransferReport.attributes.js | 2 +- .../mailTransferReport.controller.js | 2 +- .../mailTransferReport/mailTransferReport.model.js | 2 +- .../mailTransferReport/mailTransferReport.rpc.js | 2 +- server/api/memberReport/index.js | 2 +- server/api/memberReport/memberReport.attributes.js | 2 +- server/api/memberReport/memberReport.controller.js | 2 +- server/api/memberReport/memberReport.model.js | 2 +- server/api/memberReport/memberReport.rpc.js | 2 +- server/api/migration/index.js | 2 +- server/api/migration/migration.attributes.js | 2 +- server/api/migration/migration.controller.js | 2 +- server/api/migration/migration.model.js | 2 +- server/api/migration/migration.rpc.js | 2 +- server/api/network/index.js | 2 +- server/api/network/network.attributes.js | 2 +- server/api/network/network.controller.js | 2 +- server/api/network/network.model.js | 2 +- server/api/network/network.rpc.js | 2 +- server/api/openchannelAccount/index.js | 2 +- .../openchannelAccount.attributes.js | 2 +- .../openchannelAccount.controller.js | 2 +- .../openchannelAccount.events.js | 2 +- .../openchannelAccount/openchannelAccount.model.js | 2 +- .../openchannelAccount/openchannelAccount.rpc.js | 2 +- .../openchannelAccount.socket.js | 2 +- server/api/openchannelApplication/index.js | 2 +- .../openchannelApplication.attributes.js | 2 +- .../openchannelApplication.controller.js | 2 +- .../openchannelApplication.model.js | 2 +- .../openchannelApplication.rpc.js | 2 +- server/api/openchannelInteraction/index.js | 2 +- .../openchannelInteraction.attributes.js | 2 +- .../openchannelInteraction.controller.js | 2 +- .../openchannelInteraction.events.js | 2 +- .../openchannelInteraction.model.js | 2 +- .../openchannelInteraction.rpc.js | 2 +- .../openchannelInteraction.socket.js | 2 +- server/api/openchannelMessage/index.js | 2 +- .../openchannelMessage.attributes.js | 2 +- .../openchannelMessage.controller.js | 2 +- .../openchannelMessage.events.js | 2 +- .../openchannelMessage/openchannelMessage.model.js | 2 +- .../openchannelMessage/openchannelMessage.rpc.js | 2 +- .../openchannelMessage.socket.js | 2 +- server/api/openchannelQueue/index.js | 2 +- .../openchannelQueue.attributes.js | 2 +- .../openchannelQueue.controller.js | 2 +- .../openchannelQueue/openchannelQueue.events.js | 2 +- .../api/openchannelQueue/openchannelQueue.model.js | 2 +- .../api/openchannelQueue/openchannelQueue.rpc.js | 2 +- .../openchannelQueue/openchannelQueue.socket.js | 2 +- server/api/openchannelQueueReport/index.js | 2 +- .../openchannelQueueReport.attributes.js | 2 +- .../openchannelQueueReport.controller.js | 2 +- .../openchannelQueueReport.model.js | 2 +- .../openchannelQueueReport.rpc.js | 2 +- server/api/openchannelTransferReport/index.js | 2 +- .../openchannelTransferReport.attributes.js | 2 +- .../openchannelTransferReport.controller.js | 2 +- .../openchannelTransferReport.model.js | 2 +- .../openchannelTransferReport.rpc.js | 2 +- server/api/pause/index.js | 2 +- server/api/pause/pause.attributes.js | 2 +- server/api/pause/pause.controller.js | 2 +- server/api/pause/pause.model.js | 2 +- server/api/pause/pause.rpc.js | 2 +- server/api/plugin/index.js | 2 +- server/api/plugin/plugin.attributes.js | 2 +- server/api/plugin/plugin.controller.js | 2 +- server/api/plugin/plugin.events.js | 2 +- server/api/plugin/plugin.model.js | 2 +- server/api/plugin/plugin.rpc.js | 2 +- server/api/plugin/plugin.socket.js | 2 +- server/api/pm2/index.js | 2 +- server/api/pm2/pm2.controller.js | 2 +- server/api/realtime/index.js | 2 +- server/api/realtime/realtime.controller.js | 2 +- server/api/reportAgentPreview/index.js | 2 +- .../reportAgentPreview.attributes.js | 2 +- .../reportAgentPreview/reportAgentPreview.model.js | 2 +- .../reportAgentPreview/reportAgentPreview.rpc.js | 2 +- server/api/rpc/index.js | 2 +- server/api/rpc/rpc.controller.js | 2 +- server/api/schedule/index.js | 2 +- server/api/schedule/schedule.attributes.js | 2 +- server/api/schedule/schedule.controller.js | 2 +- server/api/schedule/schedule.model.js | 2 +- server/api/schedule/schedule.rpc.js | 2 +- server/api/screenRecording/index.js | 2 +- .../screenRecording/screenRecording.attributes.js | 2 +- .../screenRecording/screenRecording.controller.js | 2 +- .../api/screenRecording/screenRecording.model.js | 2 +- server/api/screenRecording/screenRecording.rpc.js | 2 +- server/api/setting/index.js | 2 +- server/api/setting/setting.attributes.js | 2 +- server/api/setting/setting.controller.js | 2 +- server/api/setting/setting.model.js | 2 +- server/api/setting/setting.rpc.js | 2 +- server/api/smsAccount/index.js | 2 +- server/api/smsAccount/smsAccount.attributes.js | 2 +- server/api/smsAccount/smsAccount.controller.js | 2 +- server/api/smsAccount/smsAccount.events.js | 2 +- server/api/smsAccount/smsAccount.model.js | 2 +- server/api/smsAccount/smsAccount.rpc.js | 2 +- server/api/smsAccount/smsAccount.socket.js | 2 +- server/api/smsApplication/index.js | 2 +- .../smsApplication/smsApplication.attributes.js | 2 +- .../smsApplication/smsApplication.controller.js | 2 +- server/api/smsApplication/smsApplication.model.js | 2 +- server/api/smsApplication/smsApplication.rpc.js | 2 +- server/api/smsInteraction/index.js | 2 +- .../smsInteraction/smsInteraction.attributes.js | 2 +- .../smsInteraction/smsInteraction.controller.js | 2 +- server/api/smsInteraction/smsInteraction.events.js | 2 +- server/api/smsInteraction/smsInteraction.model.js | 2 +- server/api/smsInteraction/smsInteraction.rpc.js | 2 +- server/api/smsInteraction/smsInteraction.socket.js | 2 +- server/api/smsMessage/index.js | 2 +- server/api/smsMessage/smsMessage.attributes.js | 2 +- server/api/smsMessage/smsMessage.controller.js | 2 +- server/api/smsMessage/smsMessage.events.js | 2 +- server/api/smsMessage/smsMessage.model.js | 2 +- server/api/smsMessage/smsMessage.rpc.js | 2 +- server/api/smsMessage/smsMessage.socket.js | 2 +- server/api/smsQueue/index.js | 2 +- server/api/smsQueue/smsQueue.attributes.js | 2 +- server/api/smsQueue/smsQueue.controller.js | 2 +- server/api/smsQueue/smsQueue.events.js | 2 +- server/api/smsQueue/smsQueue.model.js | 2 +- server/api/smsQueue/smsQueue.rpc.js | 2 +- server/api/smsQueue/smsQueue.socket.js | 2 +- server/api/smsQueueReport/index.js | 2 +- .../smsQueueReport/smsQueueReport.attributes.js | 2 +- .../smsQueueReport/smsQueueReport.controller.js | 2 +- server/api/smsQueueReport/smsQueueReport.model.js | 2 +- server/api/smsQueueReport/smsQueueReport.rpc.js | 2 +- server/api/smsTransferReport/index.js | 2 +- .../smsTransferReport.attributes.js | 2 +- .../smsTransferReport.controller.js | 2 +- .../smsTransferReport/smsTransferReport.model.js | 2 +- .../api/smsTransferReport/smsTransferReport.rpc.js | 2 +- server/api/sound/index.js | 2 +- server/api/sound/sound.attributes.js | 2 +- server/api/sound/sound.controller.js | 2 +- server/api/sound/sound.model.js | 2 +- server/api/sound/sound.rpc.js | 2 +- server/api/squareMessage/index.js | 2 +- .../api/squareMessage/squareMessage.attributes.js | 2 +- .../api/squareMessage/squareMessage.controller.js | 2 +- server/api/squareMessage/squareMessage.model.js | 2 +- server/api/squareMessage/squareMessage.rpc.js | 2 +- server/api/squareOdbc/index.js | 2 +- server/api/squareOdbc/squareOdbc.attributes.js | 2 +- server/api/squareOdbc/squareOdbc.controller.js | 2 +- server/api/squareOdbc/squareOdbc.model.js | 2 +- server/api/squareOdbc/squareOdbc.rpc.js | 2 +- server/api/squareProject/index.js | 2 +- .../api/squareProject/squareProject.attributes.js | 2 +- .../api/squareProject/squareProject.controller.js | 2 +- server/api/squareProject/squareProject.events.js | 2 +- server/api/squareProject/squareProject.model.js | 2 +- server/api/squareProject/squareProject.rpc.js | 2 +- server/api/squareProject/squareProject.socket.js | 2 +- server/api/squareRecording/index.js | 2 +- .../squareRecording/squareRecording.attributes.js | 2 +- .../squareRecording/squareRecording.controller.js | 2 +- .../api/squareRecording/squareRecording.model.js | 2 +- server/api/squareRecording/squareRecording.rpc.js | 2 +- server/api/squareReport/index.js | 2 +- server/api/squareReport/squareReport.attributes.js | 2 +- server/api/squareReport/squareReport.controller.js | 2 +- server/api/squareReport/squareReport.model.js | 2 +- server/api/squareReport/squareReport.rpc.js | 2 +- server/api/squareReportDetail/index.js | 2 +- .../squareReportDetail.attributes.js | 2 +- .../squareReportDetail.controller.js | 2 +- .../squareReportDetail/squareReportDetail.model.js | 2 +- .../squareReportDetail/squareReportDetail.rpc.js | 2 +- server/api/system/index.js | 2 +- server/api/system/system.controller.js | 2 +- server/api/tag/index.js | 2 +- server/api/tag/tag.attributes.js | 2 +- server/api/tag/tag.controller.js | 2 +- server/api/tag/tag.model.js | 2 +- server/api/tag/tag.rpc.js | 2 +- server/api/team/index.js | 2 +- server/api/team/team.attributes.js | 2 +- server/api/team/team.controller.js | 2 +- server/api/team/team.events.js | 2 +- server/api/team/team.model.js | 2 +- server/api/team/team.rpc.js | 2 +- server/api/team/team.socket.js | 2 +- .../teamVoicePrefix/teamVoicePrefix.attributes.js | 2 +- .../api/teamVoicePrefix/teamVoicePrefix.model.js | 2 +- server/api/teamVoiceQueue/index.js | 2 +- .../teamVoiceQueue/teamVoiceQueue.attributes.js | 2 +- server/api/teamVoiceQueue/teamVoiceQueue.model.js | 2 +- server/api/teamVoiceQueue/teamVoiceQueue.rpc.js | 2 +- server/api/template/index.js | 2 +- server/api/template/template.attributes.js | 2 +- server/api/template/template.controller.js | 2 +- server/api/template/template.model.js | 2 +- server/api/template/template.rpc.js | 2 +- server/api/trigger/index.js | 2 +- server/api/trigger/trigger.attributes.js | 2 +- server/api/trigger/trigger.controller.js | 2 +- server/api/trigger/trigger.model.js | 2 +- server/api/trigger/trigger.rpc.js | 2 +- server/api/trunk/index.js | 2 +- server/api/trunk/trunk.attributes.js | 2 +- server/api/trunk/trunk.controller.js | 2 +- server/api/trunk/trunk.model.js | 2 +- server/api/trunk/trunk.rpc.js | 2 +- server/api/user/index.js | 2 +- server/api/user/user.attributes.js | 2 +- server/api/user/user.controller.js | 2 +- server/api/user/user.events.js | 2 +- server/api/user/user.model.js | 2 +- server/api/user/user.rpc.js | 2 +- server/api/user/user.socket.js | 2 +- server/api/userChatQueue/index.js | 2 +- .../api/userChatQueue/userChatQueue.attributes.js | 2 +- server/api/userChatQueue/userChatQueue.model.js | 2 +- server/api/userChatQueue/userChatQueue.rpc.js | 2 +- server/api/userFaxQueue/index.js | 2 +- server/api/userFaxQueue/userFaxQueue.attributes.js | 2 +- server/api/userFaxQueue/userFaxQueue.model.js | 2 +- server/api/userFaxQueue/userFaxQueue.rpc.js | 2 +- server/api/userMailQueue/index.js | 2 +- .../api/userMailQueue/userMailQueue.attributes.js | 2 +- server/api/userMailQueue/userMailQueue.model.js | 2 +- server/api/userMailQueue/userMailQueue.rpc.js | 2 +- server/api/userNotification/index.js | 2 +- .../userNotification.attributes.js | 2 +- .../userNotification.controller.js | 2 +- .../userNotification/userNotification.events.js | 2 +- .../api/userNotification/userNotification.model.js | 2 +- .../api/userNotification/userNotification.rpc.js | 2 +- .../userNotification/userNotification.socket.js | 2 +- server/api/userOpenchannelQueue/index.js | 2 +- .../userOpenchannelQueue.attributes.js | 2 +- .../userOpenchannelQueue.model.js | 2 +- .../userOpenchannelQueue.rpc.js | 2 +- server/api/userProfile/index.js | 2 +- server/api/userProfile/userProfile.attributes.js | 2 +- server/api/userProfile/userProfile.controller.js | 2 +- server/api/userProfile/userProfile.events.js | 2 +- server/api/userProfile/userProfile.model.js | 2 +- server/api/userProfile/userProfile.rpc.js | 2 +- server/api/userProfile/userProfile.socket.js | 2 +- server/api/userProfileResource/index.js | 2 +- .../userProfileResource.attributes.js | 2 +- .../userProfileResource.controller.js | 2 +- .../userProfileResource.model.js | 2 +- .../userProfileResource/userProfileResource.rpc.js | 2 +- server/api/userProfileSection/index.js | 2 +- .../userProfileSection.attributes.js | 2 +- .../userProfileSection.controller.js | 2 +- .../userProfileSection/userProfileSection.model.js | 2 +- .../userProfileSection/userProfileSection.rpc.js | 2 +- server/api/userSmsQueue/index.js | 2 +- server/api/userSmsQueue/userSmsQueue.attributes.js | 2 +- server/api/userSmsQueue/userSmsQueue.model.js | 2 +- server/api/userSmsQueue/userSmsQueue.rpc.js | 2 +- .../userVoicePrefix/userVoicePrefix.attributes.js | 2 +- .../api/userVoicePrefix/userVoicePrefix.model.js | 2 +- server/api/userVoiceQueue/index.js | 2 +- .../userVoiceQueue/userVoiceQueue.attributes.js | 2 +- server/api/userVoiceQueue/userVoiceQueue.model.js | 2 +- server/api/userVoiceQueue/userVoiceQueue.rpc.js | 2 +- server/api/userVoiceQueueRt/index.js | 2 +- .../userVoiceQueueRt.attributes.js | 2 +- .../userVoiceQueueRt/userVoiceQueueRt.events.js | 2 +- .../api/userVoiceQueueRt/userVoiceQueueRt.model.js | 2 +- .../api/userVoiceQueueRt/userVoiceQueueRt.rpc.js | 2 +- .../userVoiceQueueRt/userVoiceQueueRt.socket.js | 2 +- server/api/userWhatsappQueue/index.js | 2 +- .../userWhatsappQueue.attributes.js | 2 +- .../userWhatsappQueue/userWhatsappQueue.model.js | 2 +- .../api/userWhatsappQueue/userWhatsappQueue.rpc.js | 2 +- server/api/variable/index.js | 2 +- server/api/variable/variable.attributes.js | 2 +- server/api/variable/variable.controller.js | 2 +- server/api/variable/variable.model.js | 2 +- server/api/variable/variable.rpc.js | 2 +- server/api/version/index.js | 2 +- server/api/version/version.controller.js | 2 +- server/api/voiceAgentReport/index.js | 2 +- .../voiceAgentReport.attributes.js | 2 +- .../voiceAgentReport.controller.js | 2 +- .../api/voiceAgentReport/voiceAgentReport.model.js | 2 +- .../api/voiceAgentReport/voiceAgentReport.rpc.js | 2 +- server/api/voiceCallReport/index.js | 2 +- .../voiceCallReport/voiceCallReport.attributes.js | 2 +- .../voiceCallReport/voiceCallReport.controller.js | 2 +- .../api/voiceCallReport/voiceCallReport.model.js | 2 +- server/api/voiceCallReport/voiceCallReport.rpc.js | 2 +- server/api/voiceChanSpy/index.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.attributes.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.controller.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.model.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.rpc.js | 2 +- server/api/voiceContext/index.js | 2 +- server/api/voiceContext/voiceContext.attributes.js | 2 +- server/api/voiceContext/voiceContext.controller.js | 2 +- server/api/voiceContext/voiceContext.model.js | 2 +- server/api/voiceContext/voiceContext.rpc.js | 2 +- server/api/voiceDialReport/index.js | 2 +- .../voiceDialReport/voiceDialReport.attributes.js | 2 +- .../voiceDialReport/voiceDialReport.controller.js | 2 +- .../api/voiceDialReport/voiceDialReport.model.js | 2 +- server/api/voiceDialReport/voiceDialReport.rpc.js | 2 +- server/api/voiceExtension/index.js | 2 +- .../voiceExtension/voiceExtension.attributes.js | 2 +- .../voiceExtension/voiceExtension.controller.js | 2 +- server/api/voiceExtension/voiceExtension.events.js | 2 +- server/api/voiceExtension/voiceExtension.model.js | 2 +- server/api/voiceExtension/voiceExtension.rpc.js | 2 +- server/api/voiceExtension/voiceExtension.socket.js | 2 +- server/api/voiceMail/index.js | 2 +- server/api/voiceMail/voiceMail.attributes.js | 2 +- server/api/voiceMail/voiceMail.controller.js | 2 +- server/api/voiceMail/voiceMail.model.js | 2 +- server/api/voiceMail/voiceMail.rpc.js | 2 +- server/api/voiceMailMessage/index.js | 2 +- .../voiceMailMessage.attributes.js | 2 +- .../voiceMailMessage.controller.js | 2 +- .../api/voiceMailMessage/voiceMailMessage.model.js | 2 +- .../api/voiceMailMessage/voiceMailMessage.rpc.js | 2 +- server/api/voiceMusicOnHold/index.js | 2 +- .../voiceMusicOnHold.attributes.js | 2 +- .../voiceMusicOnHold.controller.js | 2 +- .../api/voiceMusicOnHold/voiceMusicOnHold.model.js | 2 +- .../api/voiceMusicOnHold/voiceMusicOnHold.rpc.js | 2 +- server/api/voicePrefix/index.js | 2 +- server/api/voicePrefix/voicePrefix.attributes.js | 2 +- server/api/voicePrefix/voicePrefix.controller.js | 2 +- server/api/voicePrefix/voicePrefix.events.js | 2 +- server/api/voicePrefix/voicePrefix.model.js | 2 +- server/api/voicePrefix/voicePrefix.rpc.js | 2 +- server/api/voicePrefix/voicePrefix.socket.js | 2 +- server/api/voiceQueue/index.js | 2 +- server/api/voiceQueue/voiceQueue.attributes.js | 2 +- server/api/voiceQueue/voiceQueue.controller.js | 2 +- server/api/voiceQueue/voiceQueue.events.js | 2 +- server/api/voiceQueue/voiceQueue.model.js | 2 +- server/api/voiceQueue/voiceQueue.rpc.js | 2 +- server/api/voiceQueue/voiceQueue.socket.js | 2 +- server/api/voiceQueueReport/index.js | 2 +- .../voiceQueueReport.attributes.js | 2 +- .../voiceQueueReport.controller.js | 2 +- .../voiceQueueReport/voiceQueueReport.events.js | 2 +- .../api/voiceQueueReport/voiceQueueReport.model.js | 2 +- .../api/voiceQueueReport/voiceQueueReport.rpc.js | 2 +- .../voiceQueueReport/voiceQueueReport.socket.js | 2 +- server/api/voiceQueuesLog/index.js | 2 +- .../voiceQueuesLog/voiceQueuesLog.attributes.js | 2 +- .../voiceQueuesLog/voiceQueuesLog.controller.js | 2 +- server/api/voiceQueuesLog/voiceQueuesLog.model.js | 2 +- server/api/voiceQueuesLog/voiceQueuesLog.rpc.js | 2 +- server/api/voiceRecording/index.js | 2 +- .../voiceRecording/voiceRecording.attributes.js | 2 +- .../voiceRecording/voiceRecording.controller.js | 2 +- server/api/voiceRecording/voiceRecording.model.js | 2 +- server/api/voiceRecording/voiceRecording.rpc.js | 2 +- server/api/voiceTransferReport/index.js | 2 +- .../voiceTransferReport.attributes.js | 2 +- .../voiceTransferReport.controller.js | 2 +- .../voiceTransferReport.model.js | 2 +- .../voiceTransferReport/voiceTransferReport.rpc.js | 2 +- server/api/webbar/index.js | 2 +- server/api/webbar/webbar.controller.js | 2 +- server/api/whatsappAccount/index.js | 2 +- .../whatsappAccount/whatsappAccount.attributes.js | 2 +- .../whatsappAccount/whatsappAccount.controller.js | 2 +- .../api/whatsappAccount/whatsappAccount.events.js | 2 +- .../api/whatsappAccount/whatsappAccount.model.js | 2 +- server/api/whatsappAccount/whatsappAccount.rpc.js | 2 +- .../api/whatsappAccount/whatsappAccount.socket.js | 2 +- server/api/whatsappApplication/index.js | 2 +- .../whatsappApplication.attributes.js | 2 +- .../whatsappApplication.controller.js | 2 +- .../whatsappApplication.model.js | 2 +- .../whatsappApplication/whatsappApplication.rpc.js | 2 +- server/api/whatsappInteraction/index.js | 2 +- .../whatsappInteraction.attributes.js | 2 +- .../whatsappInteraction.controller.js | 2 +- .../whatsappInteraction.events.js | 2 +- .../whatsappInteraction.model.js | 2 +- .../whatsappInteraction/whatsappInteraction.rpc.js | 2 +- .../whatsappInteraction.socket.js | 2 +- server/api/whatsappMessage/index.js | 2 +- .../whatsappMessage/whatsappMessage.attributes.js | 2 +- .../whatsappMessage/whatsappMessage.controller.js | 2 +- .../api/whatsappMessage/whatsappMessage.events.js | 2 +- .../api/whatsappMessage/whatsappMessage.model.js | 2 +- server/api/whatsappMessage/whatsappMessage.rpc.js | 2 +- .../api/whatsappMessage/whatsappMessage.socket.js | 2 +- server/api/whatsappQueue/index.js | 2 +- .../api/whatsappQueue/whatsappQueue.attributes.js | 2 +- .../api/whatsappQueue/whatsappQueue.controller.js | 2 +- server/api/whatsappQueue/whatsappQueue.events.js | 2 +- server/api/whatsappQueue/whatsappQueue.model.js | 2 +- server/api/whatsappQueue/whatsappQueue.rpc.js | 2 +- server/api/whatsappQueue/whatsappQueue.socket.js | 2 +- server/api/whatsappQueueReport/index.js | 2 +- .../whatsappQueueReport.attributes.js | 2 +- .../whatsappQueueReport.controller.js | 2 +- .../whatsappQueueReport.model.js | 2 +- .../whatsappQueueReport/whatsappQueueReport.rpc.js | 2 +- server/api/whatsappTransferReport/index.js | 2 +- .../whatsappTransferReport.attributes.js | 2 +- .../whatsappTransferReport.controller.js | 2 +- .../whatsappTransferReport.model.js | 2 +- .../whatsappTransferReport.rpc.js | 2 +- server/app.js | 2 +- server/components/auth/service.js | 2 +- server/components/encryptor/index.js | 2 +- server/components/export/csv.js | 2 +- server/components/export/pdf.js | 2 +- server/components/export/xlsx.js | 2 +- server/components/extensions/rewrite.js | 2 +- server/components/import/cm/csv.js | 2 +- server/components/import/cm/csv2.js | 2 +- server/components/integrations/configuration.js | 2 +- server/components/interaction/service.js | 2 +- server/components/license/service.js | 2 +- server/components/parsers/advancedSearch.js | 2 +- server/components/parsers/qs.js | 2 +- server/config/express.js | 2 +- server/config/license/hardware.js | 2 +- server/config/license/index.js | 2 +- server/config/license/util.js | 2 +- server/config/local.env.js | 2 +- server/config/logger.js | 2 +- server/config/pm2/config.js | 2 +- server/config/pm2/index.js | 2 +- server/config/schedule/chat.js | 2 +- server/config/schedule/index.js | 2 +- server/config/schedule/transcribe.js | 2 +- server/config/schedule/whatsapp.js | 2 +- server/config/seedContact.js | 2 +- server/config/seedUsers.js | 2 +- server/config/socketio.js | 2 +- server/config/triggers/index.js | 2 +- server/config/utils.js | 2 +- server/errors/index.js | 2 +- server/migrations/2.5.39.js | 12 ++++++++++++ server/mysqldb/index.js | 2 +- server/routes.js | 2 +- server/rpc/index.js | 2 +- server/safe-template.js | 2 +- server/services/agi/channel.js | 2 +- server/services/agi/error.js | 2 +- server/services/agi/graph/index.js | 2 +- server/services/agi/index.js | 2 +- server/services/agi/mailRpc/index.js | 2 +- server/services/agi/reply.js | 2 +- server/services/agi/rpc/index.js | 2 +- server/services/agi/scripts/aws/index.js | 2 +- server/services/agi/scripts/aws/lex/index.js | 2 +- server/services/agi/scripts/aws/lex/lib/api.js | 2 +- server/services/agi/scripts/aws/polly/index.js | 2 +- server/services/agi/scripts/aws/polly/lib/api.js | 2 +- server/services/agi/scripts/google/asr/index.js | 2 +- server/services/agi/scripts/google/asr/lib/api.js | 2 +- server/services/agi/scripts/google/index.js | 2 +- server/services/agi/scripts/index.js | 2 +- server/services/agi/scripts/sestek/index.js | 2 +- server/services/agi/scripts/sestek/nda/index.js | 2 +- server/services/agi/scripts/tilde/asr/index.js | 2 +- server/services/agi/scripts/tilde/asr/lib/api.js | 2 +- server/services/agi/scripts/tilde/index.js | 2 +- server/services/agi/server.js | 2 +- server/services/agi/vertices.js | 2 +- server/services/ami/acw/index.js | 2 +- server/services/ami/ami.js | 2 +- server/services/ami/client.js | 2 +- server/services/ami/dialer/action.js | 2 +- server/services/ami/dialer/agentComplete.js | 2 +- server/services/ami/dialer/final.js | 2 +- server/services/ami/dialer/hangup.js | 2 +- server/services/ami/dialer/history.js | 2 +- server/services/ami/dialer/index.js | 2 +- server/services/ami/dialer/queueCallerAbandon.js | 2 +- server/services/ami/fax/action.js | 2 +- server/services/ami/fax/index.js | 2 +- server/services/ami/fax/rpcDb.js | 2 +- server/services/ami/fax/util/gs.js | 2 +- server/services/ami/fax/util/util.js | 2 +- server/services/ami/index.js | 2 +- server/services/ami/model/agent.js | 2 +- server/services/ami/model/campaign.js | 2 +- server/services/ami/model/channel.js | 2 +- server/services/ami/model/deskAccount.js | 2 +- server/services/ami/model/dynamics365Account.js | 2 +- server/services/ami/model/faxAccount.js | 2 +- server/services/ami/model/freshdeskAccount.js | 2 +- server/services/ami/model/freshsalesAccount.js | 2 +- server/services/ami/model/queueReport.js | 2 +- server/services/ami/model/salesforceAccount.js | 2 +- server/services/ami/model/servicenowAccount.js | 2 +- server/services/ami/model/sugarcrmAccount.js | 2 +- server/services/ami/model/telephone.js | 2 +- server/services/ami/model/template.js | 2 +- server/services/ami/model/trigger.js | 2 +- server/services/ami/model/trunk.js | 2 +- server/services/ami/model/voiceExtension.js | 2 +- server/services/ami/model/voiceQueue.js | 2 +- server/services/ami/model/vtigerAccount.js | 2 +- server/services/ami/model/zendeskAccount.js | 2 +- server/services/ami/model/zohoAccount.js | 2 +- server/services/ami/preview/action.js | 2 +- server/services/ami/preview/index.js | 2 +- server/services/ami/preview/rpcDb.js | 2 +- server/services/ami/preview/util/util.js | 2 +- server/services/ami/properties.js | 2 +- server/services/ami/realtime/index.js | 2 +- server/services/ami/report/index.js | 2 +- server/services/ami/report/userReport.js | 2 +- server/services/ami/report/voiceAgentReport.js | 2 +- server/services/ami/report/voiceCallReport.js | 2 +- server/services/ami/report/voiceDialReport.js | 2 +- server/services/ami/report/voiceQueueReport.js | 2 +- server/services/ami/rpc/agentReportPreview.js | 2 +- server/services/ami/rpc/attachment.js | 2 +- server/services/ami/rpc/campaign.js | 2 +- server/services/ami/rpc/cmContact.js | 2 +- server/services/ami/rpc/cmHopper.js | 2 +- server/services/ami/rpc/cmHopperBlack.js | 2 +- server/services/ami/rpc/cmHopperFinal.js | 2 +- server/services/ami/rpc/cmHopperHistory.js | 2 +- server/services/ami/rpc/faxAccount.js | 2 +- server/services/ami/rpc/faxMessage.js | 2 +- server/services/ami/rpc/integrations/desk.js | 2 +- .../services/ami/rpc/integrations/dynamics365.js | 2 +- server/services/ami/rpc/integrations/freshdesk.js | 2 +- server/services/ami/rpc/integrations/freshsales.js | 2 +- server/services/ami/rpc/integrations/salesforce.js | 2 +- server/services/ami/rpc/integrations/servicenow.js | 2 +- server/services/ami/rpc/integrations/sugarcrm.js | 2 +- server/services/ami/rpc/integrations/vtiger.js | 2 +- server/services/ami/rpc/integrations/zendesk.js | 2 +- server/services/ami/rpc/integrations/zoho.js | 2 +- server/services/ami/rpc/memberReport.js | 2 +- server/services/ami/rpc/setting.js | 2 +- server/services/ami/rpc/template.js | 2 +- server/services/ami/rpc/trigger.js | 2 +- server/services/ami/rpc/trunk.js | 2 +- server/services/ami/rpc/user.js | 2 +- server/services/ami/rpc/voiceAgentReport.js | 2 +- server/services/ami/rpc/voiceCallReport.js | 2 +- server/services/ami/rpc/voiceDialReport.js | 2 +- server/services/ami/rpc/voiceExtension.js | 2 +- server/services/ami/rpc/voiceQueue.js | 2 +- server/services/ami/rpc/voiceQueueReport.js | 2 +- server/services/ami/rpc/voiceQueueRt.js | 2 +- server/services/ami/rpc/voiceRecording.js | 2 +- server/services/ami/rpc/voiceTransferReport.js | 2 +- server/services/ami/server/index.js | 2 +- server/services/ami/trigger/cmContact/index.js | 2 +- server/services/ami/trigger/index.js | 2 +- server/services/ami/trigger/integration/desk.js | 2 +- .../ami/trigger/integration/dynamics365.js | 2 +- .../services/ami/trigger/integration/freshdesk.js | 2 +- .../services/ami/trigger/integration/freshsales.js | 2 +- server/services/ami/trigger/integration/index.js | 2 +- .../services/ami/trigger/integration/salesforce.js | 2 +- .../services/ami/trigger/integration/servicenow.js | 2 +- .../services/ami/trigger/integration/sugarcrm.js | 2 +- server/services/ami/trigger/integration/util.js | 2 +- server/services/ami/trigger/integration/vtiger.js | 2 +- server/services/ami/trigger/integration/zendesk.js | 2 +- server/services/ami/trigger/integration/zoho.js | 2 +- server/services/ami/trigger/script/index.js | 2 +- server/services/ami/trigger/urlforward/index.js | 2 +- server/services/email/client.js | 2 +- server/services/email/index.js | 2 +- server/services/email/lib/email.js | 2 +- server/services/email/lib/imap.js | 2 +- server/services/email/lib/smtp.js | 2 +- server/services/email/lib/utils.js | 2 +- server/services/email/model/mailAccount.js | 2 +- server/services/email/realtime/index.js | 2 +- server/services/email/rpc/mailAccount.js | 2 +- server/services/email/rpc/setting.js | 2 +- server/services/email/server/index.js | 2 +- server/services/express/index.js | 2 +- server/services/routing/client.js | 2 +- server/services/routing/index.js | 2 +- server/services/routing/lib/rule-engine.js | 2 +- server/services/routing/mailRpc/index.js | 2 +- server/services/routing/model/agent.js | 2 +- server/services/routing/model/chatQueue.js | 2 +- server/services/routing/model/faxQueue.js | 2 +- server/services/routing/model/interval.js | 2 +- server/services/routing/model/mailQueue.js | 2 +- server/services/routing/model/openchannelQueue.js | 2 +- server/services/routing/model/smsQueue.js | 2 +- server/services/routing/model/whatsappQueue.js | 2 +- server/services/routing/realtime/index.js | 2 +- server/services/routing/rpc/chatInteraction.js | 2 +- server/services/routing/rpc/chatMessage.js | 2 +- server/services/routing/rpc/chatQueue.js | 2 +- server/services/routing/rpc/chatQueueReport.js | 2 +- server/services/routing/rpc/faxInteraction.js | 2 +- server/services/routing/rpc/faxMessage.js | 2 +- server/services/routing/rpc/faxQueue.js | 2 +- server/services/routing/rpc/faxQueueReport.js | 2 +- server/services/routing/rpc/interval.js | 2 +- server/services/routing/rpc/mailInteraction.js | 2 +- server/services/routing/rpc/mailMessage.js | 2 +- server/services/routing/rpc/mailQueue.js | 2 +- server/services/routing/rpc/mailQueueReport.js | 2 +- .../services/routing/rpc/openchannelInteraction.js | 2 +- server/services/routing/rpc/openchannelMessage.js | 2 +- server/services/routing/rpc/openchannelQueue.js | 2 +- .../services/routing/rpc/openchannelQueueReport.js | 2 +- server/services/routing/rpc/smsInteraction.js | 2 +- server/services/routing/rpc/smsMessage.js | 2 +- server/services/routing/rpc/smsQueue.js | 2 +- server/services/routing/rpc/smsQueueReport.js | 2 +- server/services/routing/rpc/user.js | 2 +- server/services/routing/rpc/whatsappInteraction.js | 2 +- server/services/routing/rpc/whatsappMessage.js | 2 +- server/services/routing/rpc/whatsappQueue.js | 2 +- server/services/routing/rpc/whatsappQueueReport.js | 2 +- .../services/routing/server/applications/agent.js | 2 +- .../routing/server/applications/amazonlex.js | 2 +- .../routing/server/applications/autoreply.js | 2 +- .../services/routing/server/applications/close.js | 2 +- .../routing/server/applications/dialogflow.js | 2 +- .../routing/server/applications/dialogflowV2.js | 2 +- .../services/routing/server/applications/gotoif.js | 2 +- .../services/routing/server/applications/gotop.js | 2 +- .../routing/server/applications/message.js | 2 +- .../services/routing/server/applications/noop.js | 2 +- .../services/routing/server/applications/queue.js | 2 +- .../routing/server/applications/strategy/agent.js | 2 +- .../server/applications/strategy/beepall.js | 2 +- .../routing/server/applications/strategy/index.js | 2 +- .../server/applications/strategy/rrmemory.js | 2 +- .../routing/server/applications/strategy/util.js | 2 +- .../services/routing/server/applications/system.js | 2 +- server/services/routing/server/applications/tag.js | 2 +- .../services/routing/server/applications/tvox.js | 2 +- .../services/routing/server/applications/utils.js | 2 +- server/services/routing/server/index.js | 2 +- server/services/routing/server/interval.js | 2 +- server/services/xdr/agents.controller.js | 2 +- server/services/xdr/calls.controller.js | 2 +- server/services/xdr/core.controller.js | 2 +- server/services/xdr/dials.controller.js | 2 +- server/services/xdr/index.js | 2 +- server/services/xdr/members.controller.js | 2 +- server/services/xdr/queues.controller.js | 2 +- server/services/xdr/recordings.controller.js | 2 +- server/services/xdr/transfers.controller.js | 2 +- server/services/xdr/utils.js | 2 +- 1157 files changed, 1168 insertions(+), 1156 deletions(-) diff --git a/apidoc/api_project.js b/apidoc/api_project.js index f34fee4..020a099 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-11-22T12:49:48.545Z", + "time": "2021-11-22T14:20:52.554Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 3bf2f6b..23a943e 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-11-22T12:49:48.545Z", + "time": "2021-11-22T14:20:52.554Z", "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 d236744..1104b22 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 _0xf227=['sequelize','exports','VIRTUAL','STRING','contactManager','integration','motionbar','jscripty','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','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],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]'];(function(_0x4b704c,_0x29d011){var _0x4c6b36=function(_0x56b21d){while(--_0x56b21d){_0x4b704c['push'](_0x4b704c['shift']());}};_0x4c6b36(++_0x29d011);}(_0xf227,0x18f));var _0x7f22=function(_0x52b74e,_0x116323){_0x52b74e=_0x52b74e-0x0;var _0x341f43=_0xf227[_0x52b74e];return _0x341f43;};'use strict';var Sequelize=require(_0x7f22('0x0'));module[_0x7f22('0x1')]={'name':{'type':Sequelize[_0x7f22('0x2')],'get':function(_0x38de14){return this['getDataValue']('action');}},'action':{'type':Sequelize[_0x7f22('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x7f22('0x4'),_0x7f22('0x5'),_0x7f22('0x6'),_0x7f22('0x7'),'urlForward',_0x7f22('0x8'),'bot',_0x7f22('0x9')]],'msg':_0x7f22('0xa')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x7f22('0x3')](0x1000),'comment':_0x7f22('0xb')},'data2':{'type':Sequelize[_0x7f22('0x3')](0x1000),'comment':_0x7f22('0xc')},'data3':{'type':Sequelize[_0x7f22('0x3')](0x1000),'comment':_0x7f22('0xd')},'data4':{'type':Sequelize[_0x7f22('0x3')](0x1000),'comments':_0x7f22('0xe')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x7f22('0xf')},'data6':{'type':Sequelize[_0x7f22('0x3')],'comments':_0x7f22('0x10')},'data7':{'type':Sequelize[_0x7f22('0x11')],'comments':_0x7f22('0x12')}}; \ No newline at end of file +var _0x60ed=['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],\x20contactManager[ignoreDialerContactId]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action','contactManager','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING'];(function(_0x335727,_0x21b693){var _0x54692e=function(_0x55a6a2){while(--_0x55a6a2){_0x335727['push'](_0x335727['shift']());}};_0x54692e(++_0x21b693);}(_0x60ed,0x73));var _0xd60e=function(_0x2e1b45,_0x236edf){_0x2e1b45=_0x2e1b45-0x0;var _0x479a04=_0x60ed[_0x2e1b45];return _0x479a04;};'use strict';var Sequelize=require(_0xd60e('0x0'));module[_0xd60e('0x1')]={'name':{'type':Sequelize[_0xd60e('0x2')],'get':function(_0x2f38f6){return this[_0xd60e('0x3')](_0xd60e('0x4'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0xd60e('0x5'),'integration','motionbar','jscripty','urlForward',_0xd60e('0x6'),_0xd60e('0x7'),_0xd60e('0x8')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xd60e('0x9')},'data1':{'type':Sequelize[_0xd60e('0xa')](0x1000),'comment':_0xd60e('0xb')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0xd60e('0xc')},'data3':{'type':Sequelize[_0xd60e('0xa')](0x1000),'comment':_0xd60e('0xd')},'data4':{'type':Sequelize[_0xd60e('0xa')](0x1000),'comments':_0xd60e('0xe')},'data5':{'type':Sequelize[_0xd60e('0xa')](0x1000),'comments':_0xd60e('0xf')},'data6':{'type':Sequelize[_0xd60e('0xa')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0xd60e('0x10')],'comments':_0xd60e('0x11')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 056e6ea..4de386a 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 _0x21d6=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','limit','undefined','count','status','set','reject','save','update','then','destroy','error','name','body','Action','find','params','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','desk.js','querystring','papaparse'];(function(_0x514a51,_0x1931e4){var _0x4b39d1=function(_0x56d7dc){while(--_0x56d7dc){_0x514a51['push'](_0x514a51['shift']());}};_0x4b39d1(++_0x1931e4);}(_0x21d6,0xff));var _0x621d=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x21d6[_0x46e363];return _0x3fb059;};'use strict';var emlformat=require(_0x621d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x621d('0x1'));var jsonpatch=require(_0x621d('0x2'));var rp=require(_0x621d('0x3'));var moment=require(_0x621d('0x4'));var BPromise=require(_0x621d('0x5'));var Mustache=require(_0x621d('0x6'));var util=require(_0x621d('0x7'));var path=require(_0x621d('0x8'));var sox=require(_0x621d('0x9'));var csv=require(_0x621d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x621d('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x621d('0xc'));var toCsv=require(_0x621d('0xa'));var querystring=require(_0x621d('0xd'));var Papa=require(_0x621d('0xe'));var Redis=require(_0x621d('0xf'));var authService=require(_0x621d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x621d('0x11'));var hardwareService=require(_0x621d('0x12'));var logger=require(_0x621d('0x13'))(_0x621d('0x14'));var utils=require(_0x621d('0x15'));var config=require(_0x621d('0x16'));var licenseUtil=require(_0x621d('0x17'));var db=require(_0x621d('0x18'))['db'];function respondWithStatusCode(_0x1be5c1,_0x10f191){_0x10f191=_0x10f191||0xcc;return function(_0x428237){if(_0x428237){return _0x1be5c1[_0x621d('0x19')](_0x10f191);}return _0x1be5c1['status'](_0x10f191)[_0x621d('0x1a')]();};}function respondWithResult(_0x520795,_0x59612f){_0x59612f=_0x59612f||0xc8;return function(_0x32a060){if(_0x32a060){return _0x520795['status'](_0x59612f)['json'](_0x32a060);}};}function respondWithFilteredResult(_0x1466ed,_0x48009d){return function(_0x3de694){if(_0x3de694){var _0x1d1eee=typeof _0x48009d[_0x621d('0x1b')]==='undefined'&&typeof _0x48009d[_0x621d('0x1c')]===_0x621d('0x1d');var _0x510e95=_0x3de694[_0x621d('0x1e')];var _0x51e001=_0x1d1eee?0x0:_0x48009d[_0x621d('0x1b')];var _0x245b8b=_0x1d1eee?_0x3de694[_0x621d('0x1e')]:_0x48009d['offset']+_0x48009d['limit'];var _0x6133b5;if(_0x245b8b>=_0x510e95){_0x245b8b=_0x510e95;_0x6133b5=0xc8;}else{_0x6133b5=0xce;}_0x1466ed[_0x621d('0x1f')](_0x6133b5);return _0x1466ed[_0x621d('0x20')]('Content-Range',_0x51e001+'-'+_0x245b8b+'/'+_0x510e95)['json'](_0x3de694);}return null;};}function patchUpdates(_0x4c38bd){return function(_0x2406e9){try{jsonpatch['apply'](_0x2406e9,_0x4c38bd,!![]);}catch(_0x15eda2){return BPromise[_0x621d('0x21')](_0x15eda2);}return _0x2406e9[_0x621d('0x22')]();};}function saveUpdates(_0x11dd8f,_0x10eaa1){return function(_0x2b4786){if(_0x2b4786){return _0x2b4786[_0x621d('0x23')](_0x11dd8f)[_0x621d('0x24')](function(_0x5b64f9){return _0x5b64f9;});}return null;};}function removeEntity(_0x4d8a2f,_0x3e6c73){return function(_0x5da701){if(_0x5da701){return _0x5da701[_0x621d('0x25')]()[_0x621d('0x24')](function(){_0x4d8a2f[_0x621d('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa1f2f3,_0x21a19f){return function(_0x517f88){if(!_0x517f88){_0xa1f2f3['sendStatus'](0x194);}return _0x517f88;};}function handleError(_0x35a48e,_0x2a53fa){_0x2a53fa=_0x2a53fa||0x1f4;return function(_0x318d46){logger[_0x621d('0x26')](_0x318d46['stack']);if(_0x318d46[_0x621d('0x27')]){delete _0x318d46[_0x621d('0x27')];}_0x35a48e[_0x621d('0x1f')](_0x2a53fa)['send'](_0x318d46);};}exports[_0x621d('0x23')]=function(_0x509c01,_0x43f03a){if(_0x509c01[_0x621d('0x28')]['id']){delete _0x509c01[_0x621d('0x28')]['id'];}return db[_0x621d('0x29')][_0x621d('0x2a')]({'where':{'id':_0x509c01[_0x621d('0x2b')]['id']}})[_0x621d('0x24')](handleEntityNotFound(_0x43f03a,null))[_0x621d('0x24')](saveUpdates(_0x509c01[_0x621d('0x28')],null))['then'](respondWithResult(_0x43f03a,null))[_0x621d('0x2c')](handleError(_0x43f03a,null));};exports[_0x621d('0x25')]=function(_0x19c6d7,_0x3a1c6c){return db[_0x621d('0x29')][_0x621d('0x2a')]({'where':{'id':_0x19c6d7[_0x621d('0x2b')]['id']}})[_0x621d('0x24')](handleEntityNotFound(_0x3a1c6c,null))['then'](removeEntity(_0x3a1c6c,null))[_0x621d('0x2c')](handleError(_0x3a1c6c,null));}; \ No newline at end of file +var _0x7b5f=['json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','end','error','stack','name','update','body','Action','find','params','destroy','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x10f77c,_0x5cc257){var _0x262e22=function(_0x5c8e00){while(--_0x5c8e00){_0x10f77c['push'](_0x10f77c['shift']());}};_0x262e22(++_0x5cc257);}(_0x7b5f,0x7e));var _0xf7b5=function(_0x4fe2dd,_0x564590){_0x4fe2dd=_0x4fe2dd-0x0;var _0x48ef25=_0x7b5f[_0x4fe2dd];return _0x48ef25;};'use strict';var emlformat=require(_0xf7b5('0x0'));var rimraf=require(_0xf7b5('0x1'));var zipdir=require(_0xf7b5('0x2'));var jsonpatch=require(_0xf7b5('0x3'));var rp=require(_0xf7b5('0x4'));var moment=require(_0xf7b5('0x5'));var BPromise=require(_0xf7b5('0x6'));var Mustache=require('mustache');var util=require(_0xf7b5('0x7'));var path=require(_0xf7b5('0x8'));var sox=require(_0xf7b5('0x9'));var csv=require(_0xf7b5('0xa'));var ejs=require(_0xf7b5('0xb'));var fs=require('fs');var fs_extra=require(_0xf7b5('0xc'));var _=require('lodash');var squel=require(_0xf7b5('0xd'));var crypto=require(_0xf7b5('0xe'));var jsforce=require(_0xf7b5('0xf'));var deskjs=require(_0xf7b5('0x10'));var toCsv=require('to-csv');var querystring=require(_0xf7b5('0x11'));var Papa=require(_0xf7b5('0x12'));var Redis=require(_0xf7b5('0x13'));var authService=require(_0xf7b5('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xf7b5('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf7b5('0x16'))(_0xf7b5('0x17'));var utils=require(_0xf7b5('0x18'));var config=require(_0xf7b5('0x19'));var licenseUtil=require(_0xf7b5('0x1a'));var db=require(_0xf7b5('0x1b'))['db'];function respondWithStatusCode(_0x14e01d,_0x590eec){_0x590eec=_0x590eec||0xcc;return function(_0x46badc){if(_0x46badc){return _0x14e01d[_0xf7b5('0x1c')](_0x590eec);}return _0x14e01d[_0xf7b5('0x1d')](_0x590eec)['end']();};}function respondWithResult(_0x8c35a9,_0x1caff9){_0x1caff9=_0x1caff9||0xc8;return function(_0x4a9ce7){if(_0x4a9ce7){return _0x8c35a9[_0xf7b5('0x1d')](_0x1caff9)[_0xf7b5('0x1e')](_0x4a9ce7);}};}function respondWithFilteredResult(_0x3a58a0,_0x44c546){return function(_0x5d1997){if(_0x5d1997){var _0x4d0a11=typeof _0x44c546[_0xf7b5('0x1f')]===_0xf7b5('0x20')&&typeof _0x44c546['limit']===_0xf7b5('0x20');var _0x278e84=_0x5d1997[_0xf7b5('0x21')];var _0x4cdf30=_0x4d0a11?0x0:_0x44c546['offset'];var _0x36094b=_0x4d0a11?_0x5d1997[_0xf7b5('0x21')]:_0x44c546[_0xf7b5('0x1f')]+_0x44c546[_0xf7b5('0x22')];var _0x1d5cee;if(_0x36094b>=_0x278e84){_0x36094b=_0x278e84;_0x1d5cee=0xc8;}else{_0x1d5cee=0xce;}_0x3a58a0[_0xf7b5('0x1d')](_0x1d5cee);return _0x3a58a0[_0xf7b5('0x23')](_0xf7b5('0x24'),_0x4cdf30+'-'+_0x36094b+'/'+_0x278e84)[_0xf7b5('0x1e')](_0x5d1997);}return null;};}function patchUpdates(_0x41147a){return function(_0x402154){try{jsonpatch[_0xf7b5('0x25')](_0x402154,_0x41147a,!![]);}catch(_0x25d17a){return BPromise[_0xf7b5('0x26')](_0x25d17a);}return _0x402154[_0xf7b5('0x27')]();};}function saveUpdates(_0xa597ea,_0xc137b0){return function(_0x31c550){if(_0x31c550){return _0x31c550['update'](_0xa597ea)[_0xf7b5('0x28')](function(_0x12aa97){return _0x12aa97;});}return null;};}function removeEntity(_0x5150cc,_0x41223d){return function(_0x50d372){if(_0x50d372){return _0x50d372['destroy']()[_0xf7b5('0x28')](function(){_0x5150cc[_0xf7b5('0x1d')](0xcc)[_0xf7b5('0x29')]();});}};}function handleEntityNotFound(_0x2f521d,_0x377028){return function(_0x33de99){if(!_0x33de99){_0x2f521d[_0xf7b5('0x1c')](0x194);}return _0x33de99;};}function handleError(_0x176447,_0x1164ab){_0x1164ab=_0x1164ab||0x1f4;return function(_0xd6a3d3){logger[_0xf7b5('0x2a')](_0xd6a3d3[_0xf7b5('0x2b')]);if(_0xd6a3d3[_0xf7b5('0x2c')]){delete _0xd6a3d3[_0xf7b5('0x2c')];}_0x176447[_0xf7b5('0x1d')](_0x1164ab)['send'](_0xd6a3d3);};}exports[_0xf7b5('0x2d')]=function(_0x4f2b64,_0x13dc92){if(_0x4f2b64[_0xf7b5('0x2e')]['id']){delete _0x4f2b64['body']['id'];}return db[_0xf7b5('0x2f')][_0xf7b5('0x30')]({'where':{'id':_0x4f2b64[_0xf7b5('0x31')]['id']}})[_0xf7b5('0x28')](handleEntityNotFound(_0x13dc92,null))[_0xf7b5('0x28')](saveUpdates(_0x4f2b64[_0xf7b5('0x2e')],null))[_0xf7b5('0x28')](respondWithResult(_0x13dc92,null))['catch'](handleError(_0x13dc92,null));};exports[_0xf7b5('0x32')]=function(_0x4c8c67,_0x31cf75){return db[_0xf7b5('0x2f')][_0xf7b5('0x30')]({'where':{'id':_0x4c8c67[_0xf7b5('0x31')]['id']}})[_0xf7b5('0x28')](handleEntityNotFound(_0x31cf75,null))[_0xf7b5('0x28')](removeEntity(_0x31cf75,null))[_0xf7b5('0x33')](handleError(_0x31cf75,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 91d3435..9e99c27 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 _0x8937=['bluebird','request-promise','../../config/environment','./action.attributes','define','../../config/logger','api','moment'];(function(_0x99ff94,_0x47a1b1){var _0x1b5bc0=function(_0x25821f){while(--_0x25821f){_0x99ff94['push'](_0x99ff94['shift']());}};_0x1b5bc0(++_0x47a1b1);}(_0x8937,0xd5));var _0x7893=function(_0x500cb5,_0x5d31ed){_0x500cb5=_0x500cb5-0x0;var _0x2c3663=_0x8937[_0x500cb5];return _0x2c3663;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7893('0x0'))(_0x7893('0x1'));var moment=require(_0x7893('0x2'));var BPromise=require(_0x7893('0x3'));var rp=require(_0x7893('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7893('0x5'));var attributes=require(_0x7893('0x6'));module['exports']=function(_0x426003,_0x4aeef3){return _0x426003[_0x7893('0x7')]('Action',attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x00c2=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','define','Action','tools_actions'];(function(_0x5b2096,_0x213141){var _0x198357=function(_0x5afe77){while(--_0x5afe77){_0x5b2096['push'](_0x5b2096['shift']());}};_0x198357(++_0x213141);}(_0x00c2,0x79));var _0x200c=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x00c2[_0x432682];return _0x463d05;};'use strict';var _=require(_0x200c('0x0'));var util=require(_0x200c('0x1'));var logger=require('../../config/logger')(_0x200c('0x2'));var moment=require(_0x200c('0x3'));var BPromise=require(_0x200c('0x4'));var rp=require(_0x200c('0x5'));var fs=require('fs');var path=require(_0x200c('0x6'));var rimraf=require('rimraf');var config=require(_0x200c('0x7'));var attributes=require('./action.attributes');module['exports']=function(_0x22ee78,_0x4a10ff){return _0x22ee78[_0x200c('0x8')](_0x200c('0x9'),attributes,{'tableName':_0x200c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index 326c654..6683f56 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 _0x7a54=['info','Action,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x7a54,0x106));var _0x47a5=function(_0x42c469,_0x47e42d){_0x42c469=_0x42c469-0x0;var _0x4d0d0d=_0x7a54[_0x42c469];return _0x4d0d0d;};'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')]('Action,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x7fbe=['request','then','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5883a9,_0xec68fb){var _0x1dad51=function(_0x5844b5){while(--_0x5844b5){_0x5883a9['push'](_0x5883a9['shift']());}};_0x1dad51(++_0xec68fb);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x3a7fe5,_0x371426){_0x3a7fe5=_0x3a7fe5-0x0;var _0x18ed66=_0x7fbe[_0x3a7fe5];return _0x18ed66;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 88af9f7..a0c599f 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 _0x651b=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','/:id','isAuthenticated','update','delete','destroy','exports','multer'];(function(_0x4e25f8,_0xbc6a91){var _0x59b0f8=function(_0x5eb590){while(--_0x5eb590){_0x4e25f8['push'](_0x4e25f8['shift']());}};_0x59b0f8(++_0xbc6a91);}(_0x651b,0x1b2));var _0xb651=function(_0x4b9bcc,_0x1eee90){_0x4b9bcc=_0x4b9bcc-0x0;var _0x35182a=_0x651b[_0x4b9bcc];return _0x35182a;};'use strict';var multer=require(_0xb651('0x0'));var util=require('util');var path=require(_0xb651('0x1'));var timeout=require('connect-timeout');var express=require(_0xb651('0x2'));var router=express[_0xb651('0x3')]();var fs_extra=require(_0xb651('0x4'));var auth=require(_0xb651('0x5'));var interaction=require(_0xb651('0x6'));var config=require(_0xb651('0x7'));var controller=require(_0xb651('0x8'));router['put'](_0xb651('0x9'),auth[_0xb651('0xa')](),controller[_0xb651('0xb')]);router[_0xb651('0xc')](_0xb651('0x9'),auth['isAuthenticated'](),controller[_0xb651('0xd')]);module[_0xb651('0xe')]=router; \ No newline at end of file +var _0xba06=['isAuthenticated','update','delete','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id'];(function(_0x512120,_0x1bd7ca){var _0x20b2e3=function(_0x3ac4b6){while(--_0x3ac4b6){_0x512120['push'](_0x512120['shift']());}};_0x20b2e3(++_0x1bd7ca);}(_0xba06,0x1b8));var _0x6ba0=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0xba06[_0x47fd36];return _0x21a0fc;};'use strict';var multer=require(_0x6ba0('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6ba0('0x1'));var express=require(_0x6ba0('0x2'));var router=express['Router']();var fs_extra=require(_0x6ba0('0x3'));var auth=require(_0x6ba0('0x4'));var interaction=require(_0x6ba0('0x5'));var config=require(_0x6ba0('0x6'));var controller=require(_0x6ba0('0x7'));router[_0x6ba0('0x8')](_0x6ba0('0x9'),auth[_0x6ba0('0xa')](),controller[_0x6ba0('0xb')]);router[_0x6ba0('0xc')]('/:id',auth[_0x6ba0('0xa')](),controller[_0x6ba0('0xd')]);module[_0x6ba0('0xe')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 88ad75a..8a38ce0 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 _0xeda8=['sequelize','exports','STRING','TEXT'];(function(_0x50fc40,_0x490b06){var _0x3e4693=function(_0x251541){while(--_0x251541){_0x50fc40['push'](_0x50fc40['shift']());}};_0x3e4693(++_0x490b06);}(_0xeda8,0x104));var _0x8eda=function(_0x2d27c4,_0xd85997){_0x2d27c4=_0x2d27c4-0x0;var _0x3388ce=_0xeda8[_0x2d27c4];return _0x3388ce;};'use strict';var Sequelize=require(_0x8eda('0x0'));module[_0x8eda('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8eda('0x2')]},'parent':{'type':Sequelize[_0x8eda('0x2')]},'table':{'type':Sequelize[_0x8eda('0x2')]},'conditions':{'type':Sequelize[_0x8eda('0x3')]},'joins':{'type':Sequelize[_0x8eda('0x3')]}}; \ No newline at end of file +var _0xc4aa=['STRING','sequelize','exports'];(function(_0x2152ba,_0x2c6738){var _0x5a97cc=function(_0x45d812){while(--_0x45d812){_0x2152ba['push'](_0x2152ba['shift']());}};_0x5a97cc(++_0x2c6738);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0xc4aa[_0x1b2ff7];return _0x31656a;};'use strict';var Sequelize=require(_0xac4a('0x0'));module[_0xac4a('0x1')]={'name':{'type':Sequelize[_0xac4a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xac4a('0x2')]},'parent':{'type':Sequelize[_0xac4a('0x2')]},'table':{'type':Sequelize[_0xac4a('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index daef462..b8438bc 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 _0x887a=['COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','HOUR(%s)','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','operator','rules','group','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','table','MetricId','metric','field','function','replace','format','groupBy','orderBy','DESC','alias','joins','type','parentKey','foreignTable','foreignKey','parse','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','GROUP_CONCAT(%s)','DATE(%s)','includes','condition','getFields','%s.%s\x20=\x20%s.%s','conditions','clone','output','web','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','fork','../../components/export/','savename','countTable','COUNT(*)','run','COUNT(%s)','SEC_TO_TIME(%s)','IS\x20NOT\x20NULL','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','CustomReports','destroy','error','name','map','AnalyticCustomReport','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','merge','where','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','preview','join','left_join','right_join','cross_join','SUM(%s)'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x887a,0x186));var _0xa887=function(_0x2a4039,_0x72762f){_0x2a4039=_0x2a4039-0x0;var _0x3f774f=_0x887a[_0x2a4039];return _0x3f774f;};'use strict';var emlformat=require(_0xa887('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa887('0x1'));var jsonpatch=require(_0xa887('0x2'));var rp=require(_0xa887('0x3'));var moment=require(_0xa887('0x4'));var BPromise=require(_0xa887('0x5'));var Mustache=require(_0xa887('0x6'));var util=require(_0xa887('0x7'));var path=require(_0xa887('0x8'));var sox=require(_0xa887('0x9'));var csv=require(_0xa887('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa887('0xb'));var _=require(_0xa887('0xc'));var squel=require('squel');var crypto=require(_0xa887('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa887('0xe'));var toCsv=require(_0xa887('0xa'));var querystring=require(_0xa887('0xf'));var Papa=require(_0xa887('0x10'));var Redis=require(_0xa887('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa887('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa887('0x13'))('api');var utils=require(_0xa887('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa887('0x15'))['db'];var dbH=require(_0xa887('0x15'))['dbH'];function respondWithStatusCode(_0x20cdcc,_0x1fbf03){_0x1fbf03=_0x1fbf03||0xcc;return function(_0x1d643b){if(_0x1d643b){return _0x20cdcc[_0xa887('0x16')](_0x1fbf03);}return _0x20cdcc[_0xa887('0x17')](_0x1fbf03)[_0xa887('0x18')]();};}function respondWithResult(_0x298d82,_0x4a3132){_0x4a3132=_0x4a3132||0xc8;return function(_0x256188){if(_0x256188){return _0x298d82['status'](_0x4a3132)[_0xa887('0x19')](_0x256188);}};}function respondWithFilteredResult(_0x3e6b17,_0x17a284){return function(_0x5d11b5){if(_0x5d11b5){var _0x121849=typeof _0x17a284[_0xa887('0x1a')]===_0xa887('0x1b')&&typeof _0x17a284[_0xa887('0x1c')]===_0xa887('0x1b');var _0x1aac3f=_0x5d11b5['count'];var _0x2fabc4=_0x121849?0x0:_0x17a284[_0xa887('0x1a')];var _0x28bc8f=_0x121849?_0x5d11b5[_0xa887('0x1d')]:_0x17a284[_0xa887('0x1a')]+_0x17a284[_0xa887('0x1c')];var _0x5a2bd9;if(_0x28bc8f>=_0x1aac3f){_0x28bc8f=_0x1aac3f;_0x5a2bd9=0xc8;}else{_0x5a2bd9=0xce;}_0x3e6b17['status'](_0x5a2bd9);return _0x3e6b17[_0xa887('0x1e')](_0xa887('0x1f'),_0x2fabc4+'-'+_0x28bc8f+'/'+_0x1aac3f)['json'](_0x5d11b5);}return null;};}function patchUpdates(_0x51a6df){return function(_0x50f865){try{jsonpatch[_0xa887('0x20')](_0x50f865,_0x51a6df,!![]);}catch(_0x181a6f){return BPromise[_0xa887('0x21')](_0x181a6f);}return _0x50f865[_0xa887('0x22')]();};}function saveUpdates(_0x1618b0,_0x4971e9){return function(_0x57cdd3){if(_0x57cdd3){return _0x57cdd3[_0xa887('0x23')](_0x1618b0)[_0xa887('0x24')](function(_0x18d08b){return _0x18d08b;});}return null;};}function removeEntity(_0x67bae,_0x2ce227){return function(_0x21bdf8){if(_0x21bdf8){return _0x21bdf8['destroy']()['then'](function(){var _0x32d9c4=_0x21bdf8[_0xa887('0x25')]({'plain':!![]});var _0x195f8b=_0xa887('0x26');return db['UserProfileResource'][_0xa887('0x27')]({'where':{'type':_0x195f8b,'resourceId':_0x32d9c4['id']}})[_0xa887('0x24')](function(){return _0x21bdf8;});})[_0xa887('0x24')](function(){_0x67bae[_0xa887('0x17')](0xcc)[_0xa887('0x18')]();});}};}function handleEntityNotFound(_0x1941f9,_0x14aeca){return function(_0x31f054){if(!_0x31f054){_0x1941f9[_0xa887('0x16')](0x194);}return _0x31f054;};}function handleError(_0x3c04d2,_0x3f0ece){_0x3f0ece=_0x3f0ece||0x1f4;return function(_0x1ea461){logger[_0xa887('0x28')](_0x1ea461['stack']);if(_0x1ea461[_0xa887('0x29')]){delete _0x1ea461['name'];}_0x3c04d2[_0xa887('0x17')](_0x3f0ece)['send'](_0x1ea461);};}exports['index']=function(_0x187919,_0x2ec197){var _0x3f8cb9={},_0x3f9b8e={},_0x5ea122={'count':0x0,'rows':[]};var _0x16d7dd=_[_0xa887('0x2a')](db[_0xa887('0x2b')][_0xa887('0x2c')],function(_0x1eda51){return{'name':_0x1eda51[_0xa887('0x2d')],'type':_0x1eda51['type']['key']};});_0x3f9b8e[_0xa887('0x2e')]=_[_0xa887('0x2a')](_0x16d7dd,_0xa887('0x29'));_0x3f9b8e['query']=_[_0xa887('0x2f')](_0x187919[_0xa887('0x30')]);_0x3f9b8e[_0xa887('0x31')]=_[_0xa887('0x32')](_0x3f9b8e[_0xa887('0x2e')],_0x3f9b8e[_0xa887('0x30')]);_0x3f8cb9['attributes']=_['intersection'](_0x3f9b8e['model'],qs[_0xa887('0x33')](_0x187919[_0xa887('0x30')]['fields']));_0x3f8cb9[_0xa887('0x34')]=_0x3f8cb9[_0xa887('0x34')][_0xa887('0x35')]?_0x3f8cb9[_0xa887('0x34')]:_0x3f9b8e[_0xa887('0x2e')];if(!_0x187919[_0xa887('0x30')][_0xa887('0x36')]('nolimit')){_0x3f8cb9[_0xa887('0x1c')]=qs[_0xa887('0x1c')](_0x187919['query']['limit']);_0x3f8cb9['offset']=qs[_0xa887('0x1a')](_0x187919[_0xa887('0x30')]['offset']);}_0x3f8cb9[_0xa887('0x37')]=qs[_0xa887('0x38')](_0x187919[_0xa887('0x30')][_0xa887('0x38')]);_0x3f8cb9['where']=qs['filters'](_['pick'](_0x187919[_0xa887('0x30')],_0x3f9b8e['filters']),_0x16d7dd);if(_0x187919['query']['filter']){_0x3f8cb9['where']=_[_0xa887('0x39')](_0x3f8cb9[_0xa887('0x3a')],{'$or':_[_0xa887('0x2a')](_0x16d7dd,function(_0x5b9f41){if(_0x5b9f41['type']!==_0xa887('0x3b')){var _0x22ea22={};_0x22ea22[_0x5b9f41[_0xa887('0x29')]]={'$like':'%'+_0x187919[_0xa887('0x30')][_0xa887('0x3c')]+'%'};return _0x22ea22;}})});}_0x3f8cb9=_['merge']({},_0x3f8cb9,_0x187919[_0xa887('0x3d')]);var _0x506f3a={'where':_0x3f8cb9[_0xa887('0x3a')]};return db['AnalyticCustomReport']['count'](_0x506f3a)[_0xa887('0x24')](function(_0x1825c3){_0x5ea122['count']=_0x1825c3;if(_0x187919[_0xa887('0x30')][_0xa887('0x3e')]){_0x3f8cb9[_0xa887('0x3f')]=[{'all':!![]}];}return db['AnalyticCustomReport']['findAll'](_0x3f8cb9);})['then'](function(_0x5476d3){_0x5ea122[_0xa887('0x40')]=_0x5476d3;return _0x5ea122;})[_0xa887('0x24')](respondWithFilteredResult(_0x2ec197,_0x3f8cb9))[_0xa887('0x41')](handleError(_0x2ec197,null));};exports[_0xa887('0x42')]=function(_0x3b4308,_0x267dd7){var _0x194aa9={'raw':![],'where':{'id':_0x3b4308[_0xa887('0x43')]['id']}},_0x41431d={};_0x41431d[_0xa887('0x2e')]=_[_0xa887('0x2f')](db[_0xa887('0x2b')][_0xa887('0x2c')]);_0x41431d[_0xa887('0x30')]=_[_0xa887('0x2f')](_0x3b4308['query']);_0x41431d['filters']=_['intersection'](_0x41431d[_0xa887('0x2e')],_0x41431d[_0xa887('0x30')]);_0x194aa9[_0xa887('0x34')]=_[_0xa887('0x32')](_0x41431d[_0xa887('0x2e')],qs[_0xa887('0x33')](_0x3b4308[_0xa887('0x30')]['fields']));_0x194aa9[_0xa887('0x34')]=_0x194aa9[_0xa887('0x34')][_0xa887('0x35')]?_0x194aa9[_0xa887('0x34')]:_0x41431d['model'];if(_0x3b4308[_0xa887('0x30')][_0xa887('0x3e')]){_0x194aa9[_0xa887('0x3f')]=[{'all':!![]}];}_0x194aa9=_[_0xa887('0x39')]({},_0x194aa9,_0x3b4308[_0xa887('0x3d')]);return db[_0xa887('0x2b')][_0xa887('0x44')](_0x194aa9)[_0xa887('0x24')](handleEntityNotFound(_0x267dd7,null))[_0xa887('0x24')](respondWithResult(_0x267dd7,null))[_0xa887('0x41')](handleError(_0x267dd7,null));};exports[_0xa887('0x45')]=function(_0x1ff077,_0x45b302){return db['AnalyticCustomReport']['create'](_0x1ff077[_0xa887('0x46')],{})[_0xa887('0x24')](function(_0x511c7a){var _0x4dc8ac=_0x1ff077[_0xa887('0x47')][_0xa887('0x25')]({'plain':!![]});if(!_0x4dc8ac)throw new Error(_0xa887('0x48'));if(_0x4dc8ac['role']===_0xa887('0x47')){var _0x27b01f=_0x511c7a[_0xa887('0x25')]({'plain':!![]});var _0x209a37=_0xa887('0x49');return db[_0xa887('0x4a')][_0xa887('0x44')]({'where':{'name':_0x209a37,'userProfileId':_0x4dc8ac[_0xa887('0x4b')]},'raw':!![]})['then'](function(_0x25d932){if(_0x25d932&&_0x25d932[_0xa887('0x4c')]===0x0){return db[_0xa887('0x4d')]['create']({'name':_0x27b01f[_0xa887('0x29')],'resourceId':_0x27b01f['id'],'type':_0xa887('0x26'),'sectionId':_0x25d932['id']},{})[_0xa887('0x24')](function(){return _0x511c7a;});}else{return _0x511c7a;}})[_0xa887('0x41')](function(_0x447d11){logger[_0xa887('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x447d11);throw _0x447d11;});}return _0x511c7a;})[_0xa887('0x24')](respondWithResult(_0x45b302,0xc9))['catch'](handleError(_0x45b302,null));};exports[_0xa887('0x23')]=function(_0x2fe0b7,_0x5b4d39){if(_0x2fe0b7[_0xa887('0x46')]['id']){delete _0x2fe0b7[_0xa887('0x46')]['id'];}return db['AnalyticCustomReport']['find']({'where':{'id':_0x2fe0b7[_0xa887('0x43')]['id']}})[_0xa887('0x24')](handleEntityNotFound(_0x5b4d39,null))[_0xa887('0x24')](saveUpdates(_0x2fe0b7['body'],null))['then'](respondWithResult(_0x5b4d39,null))[_0xa887('0x41')](handleError(_0x5b4d39,null));};exports[_0xa887('0x27')]=function(_0x4ecef0,_0x2f8e12){return db[_0xa887('0x2b')]['find']({'where':{'id':_0x4ecef0[_0xa887('0x43')]['id']}})[_0xa887('0x24')](handleEntityNotFound(_0x2f8e12,null))[_0xa887('0x24')](removeEntity(_0x2f8e12,null))['catch'](handleError(_0x2f8e12,null));};exports[_0xa887('0x4e')]=function(_0x55a841,_0x4f0b74){var _0x4d7805=0xa;var _0x5bdb06=[_0xa887('0x4f'),_0xa887('0x50'),_0xa887('0x51'),_0xa887('0x52')];var _0x50c169={'SUM':_0xa887('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xa887('0x54'),'MAX':_0xa887('0x55'),'MIN':_0xa887('0x56'),'AVG':_0xa887('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xa887('0x58'),'GROUP_CONCAT DESC':_0xa887('0x59')};var _0x33db00={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xa887('0x5a'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x55a0c6=function(_0x52e438){return!_['includes']([_0xa887('0x5b'),'IS\x20NOT\x20NULL',_0xa887('0x5c'),_0xa887('0x5d')],_0x52e438);};var _0x375391=function(_0x2c7eab){if(!_0x2c7eab||!_0x2c7eab['rules'][_0xa887('0x35')]){return'';}for(var _0x5eb6ca='(',_0x4f954c=0x0;_0x4f954c<_0x2c7eab['rules'][_0xa887('0x35')];_0x4f954c+=0x1){_0x4f954c>0x0&&(_0x5eb6ca+='\x20'+_0x2c7eab[_0xa887('0x5e')]+'\x20');_0x5eb6ca+=_0x2c7eab[_0xa887('0x5f')][_0x4f954c][_0xa887('0x60')]?_0x375391(_0x2c7eab[_0xa887('0x5f')][_0x4f954c][_0xa887('0x60')]):_0x2c7eab[_0xa887('0x5f')][_0x4f954c]['field']+'\x20'+_0x2c7eab[_0xa887('0x5f')][_0x4f954c]['condition']+(_0x55a0c6(_0x2c7eab[_0xa887('0x5f')][_0x4f954c]['condition'])?'\x20'+_0x2c7eab['rules'][_0x4f954c][_0xa887('0x61')]:'');}return _0x5eb6ca+')';};var _0x29e7a8={'where':{'id':_0x55a841['params']['id']}},_0x6f2f5c,_0x4a414a,_0x136b39,_0x2b8f88,_0x387367;_0x29e7a8=_[_0xa887('0x39')]({},_0x29e7a8,_0x55a841['options']);return db[_0xa887('0x2b')]['find'](_0x29e7a8)['then'](function(_0x6f2d52){if(_0x6f2d52){_0x6f2f5c=_0x6f2d52;return _0x6f2d52['getFields']();}return null;})[_0xa887('0x24')](function(_0x57c7ab){if(_0x57c7ab){if(!_0x57c7ab[_0xa887('0x35')]){throw new db[(_0xa887('0x62'))][(_0xa887('0x63'))](_0xa887('0x64'),0x193);}_0x4a414a=_0x57c7ab;return db[_0xa887('0x65')][_0xa887('0x66')]({'raw':!![]});}return null;})['then'](function(_0x5609d1){if(_0x5609d1){_0x136b39=_[_0xa887('0x67')](_0x5609d1,'id');var _0x3435b1;var _0x106fc1=squel[_0xa887('0x68')]();_0x106fc1[_0xa887('0x69')](_0x6f2f5c[_0xa887('0x6a')]);for(var _0x5a1a0a=0x0;_0x5a1a0a<_0x4a414a[_0xa887('0x35')];_0x5a1a0a+=0x1){_0x3435b1=_0x4a414a[_0x5a1a0a][_0xa887('0x6b')]?_0x136b39[_0x4a414a[_0x5a1a0a][_0xa887('0x6b')]][_0xa887('0x6c')]:_0x4a414a[_0x5a1a0a][_0xa887('0x6d')];_0x3435b1=_0x4a414a[_0x5a1a0a][_0xa887('0x6e')]?_[_0xa887('0x6f')](_0x50c169[_0x4a414a[_0x5a1a0a][_0xa887('0x6e')]],'%s',_0x3435b1):_0x3435b1;_0x3435b1=_0x4a414a[_0x5a1a0a][_0xa887('0x70')]?_[_0xa887('0x6f')](_0x33db00[_0x4a414a[_0x5a1a0a][_0xa887('0x70')]],'%s',_0x3435b1):_0x3435b1;if(_0x4a414a[_0x5a1a0a][_0xa887('0x71')]){_0x106fc1[_0xa887('0x60')](_0x3435b1);}_0x4a414a[_0x5a1a0a]['orderBy']&&_0x106fc1[_0xa887('0x37')](_0x3435b1,_0x4a414a[_0x5a1a0a][_0xa887('0x72')]===_0xa887('0x73')?![]:!![]);_0x106fc1[_0xa887('0x6d')](_0x3435b1,_0x4a414a[_0x5a1a0a][_0xa887('0x74')]||_0x3435b1);}if(_0x6f2f5c[_0xa887('0x75')]){_0x6f2f5c[_0xa887('0x75')]=JSON['parse'](_0x6f2f5c[_0xa887('0x75')]);for(var _0x552083=0x0;_0x552083<_0x6f2f5c[_0xa887('0x75')]['length'];_0x552083+=0x1){if(_0x6f2f5c[_0xa887('0x75')][_0x552083][_0xa887('0x76')]&&_['includes'](_0x5bdb06,_0x6f2f5c['joins'][_0x552083][_0xa887('0x76')])&&_0x6f2f5c[_0xa887('0x75')][_0x552083][_0xa887('0x77')]&&_0x6f2f5c['joins'][_0x552083]['foreignTable']&&_0x6f2f5c[_0xa887('0x75')][_0x552083]['foreignKey']){_0x106fc1[_0x6f2f5c[_0xa887('0x75')][_0x552083][_0xa887('0x76')]](_0x6f2f5c[_0xa887('0x75')][_0x552083][_0xa887('0x78')],null,util[_0xa887('0x70')]('%s.%s\x20=\x20%s.%s',_0x6f2f5c[_0xa887('0x6a')],_0x6f2f5c[_0xa887('0x75')][_0x552083][_0xa887('0x77')],_0x6f2f5c[_0xa887('0x75')][_0x552083]['foreignTable'],_0x6f2f5c[_0xa887('0x75')][_0x552083][_0xa887('0x79')]));}}}if(_0x6f2f5c['conditions']){_0x6f2f5c['conditions']=JSON[_0xa887('0x7a')](_0x6f2f5c['conditions']);_0x106fc1[_0xa887('0x3a')](_0x375391(_0x6f2f5c['conditions'][_0xa887('0x60')]));}_0x387367=_0x106fc1['clone']();_0x106fc1['limit'](_0x4d7805);_0x106fc1['offset'](0x0);logger[_0xa887('0x7b')](_0xa887('0x7c'),_0x106fc1[_0xa887('0x7d')]());return dbH[_0xa887('0x7e')][_0xa887('0x30')](_0x106fc1[_0xa887('0x7d')](),{'type':dbH[_0xa887('0x7e')][_0xa887('0x7f')][_0xa887('0x80')]});}})[_0xa887('0x24')](respondWithResult(_0x4f0b74,null))['catch'](handleError(_0x4f0b74,null));};function runReport(_0x578cd9,_0x244d97,_0x3bd92c){var _0x34775a=_0x244d97[_0xa887('0x29')];var _0x2d384e=0xa;var _0x4aba27=[_0xa887('0x4f'),_0xa887('0x50'),_0xa887('0x51'),_0xa887('0x52')];var _0x604e7e={'SUM':_0xa887('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xa887('0x54'),'MAX':_0xa887('0x55'),'MIN':_0xa887('0x56'),'AVG':_0xa887('0x57'),'GROUP_CONCAT':_0xa887('0x81'),'GROUP_CONCAT ASC':_0xa887('0x58'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5035af={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xa887('0x82'),'HOUR':_0xa887('0x5a'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x48f3cb=function(_0x1edcef){return!_[_0xa887('0x83')]([_0xa887('0x5b'),'IS\x20NOT\x20NULL',_0xa887('0x5c'),_0xa887('0x5d')],_0x1edcef);};var _0x21477a=function(_0x1e7af7){if(!_0x1e7af7||!_0x1e7af7[_0xa887('0x5f')][_0xa887('0x35')]){return'';}for(var _0x4fbf02='(',_0x4709f3=0x0;_0x4709f3<_0x1e7af7['rules'][_0xa887('0x35')];_0x4709f3+=0x1){_0x4709f3>0x0&&(_0x4fbf02+='\x20'+_0x1e7af7['operator']+'\x20');_0x4fbf02+=_0x1e7af7[_0xa887('0x5f')][_0x4709f3][_0xa887('0x60')]?_0x21477a(_0x1e7af7[_0xa887('0x5f')][_0x4709f3]['group']):_0x1e7af7[_0xa887('0x5f')][_0x4709f3][_0xa887('0x6d')]+'\x20'+_0x1e7af7[_0xa887('0x5f')][_0x4709f3][_0xa887('0x84')]+(_0x48f3cb(_0x1e7af7[_0xa887('0x5f')][_0x4709f3][_0xa887('0x84')])?'\x20'+_0x1e7af7[_0xa887('0x5f')][_0x4709f3]['value']:'');}return _0x4fbf02+')';};var _0x5531e8={'where':{'id':_0x578cd9['id']}},_0xb0d7f,_0x392907,_0x117593,_0x71e459,_0x577ffa;_0x5531e8=_[_0xa887('0x39')]({},_0x5531e8,_0x3bd92c);return db[_0xa887('0x2b')][_0xa887('0x44')](_0x5531e8)[_0xa887('0x24')](function(_0x4acccb){if(_0x4acccb){_0xb0d7f=_0x4acccb;return _0x4acccb[_0xa887('0x85')]();}return null;})['then'](function(_0x2c3c1f){if(_0x2c3c1f){if(!_0x2c3c1f[_0xa887('0x35')]){throw new db[(_0xa887('0x62'))][(_0xa887('0x63'))](_0xa887('0x64'),0x193);}_0x392907=_0x2c3c1f;return db[_0xa887('0x65')][_0xa887('0x66')]({'raw':!![]});}return null;})[_0xa887('0x24')](function(_0x30448e){if(_0x30448e){_0x117593=_[_0xa887('0x67')](_0x30448e,'id');var _0x11bf09;var _0x3e90e=squel[_0xa887('0x68')]();_0x3e90e['from'](_0xb0d7f[_0xa887('0x6a')]);for(var _0x246721=0x0;_0x246721<_0x392907[_0xa887('0x35')];_0x246721+=0x1){_0x11bf09=_0x392907[_0x246721]['MetricId']?_0x117593[_0x392907[_0x246721][_0xa887('0x6b')]][_0xa887('0x6c')]:_0x392907[_0x246721][_0xa887('0x6d')];_0x11bf09=_0x392907[_0x246721]['function']?_[_0xa887('0x6f')](_0x604e7e[_0x392907[_0x246721]['function']],'%s',_0x11bf09):_0x11bf09;_0x11bf09=_0x392907[_0x246721][_0xa887('0x70')]?_[_0xa887('0x6f')](_0x5035af[_0x392907[_0x246721][_0xa887('0x70')]],'%s',_0x11bf09):_0x11bf09;if(_0x392907[_0x246721][_0xa887('0x71')]){_0x3e90e[_0xa887('0x60')](_0x11bf09);}_0x392907[_0x246721]['orderBy']&&_0x3e90e[_0xa887('0x37')](_0x11bf09,_0x392907[_0x246721][_0xa887('0x72')]===_0xa887('0x73')?![]:!![]);_0x3e90e[_0xa887('0x6d')](_0x11bf09,_0x392907[_0x246721][_0xa887('0x74')]||_0x11bf09);}if(_0xb0d7f['joins']){_0xb0d7f[_0xa887('0x75')]=JSON[_0xa887('0x7a')](_0xb0d7f[_0xa887('0x75')]);for(var _0x31e93d=0x0;_0x31e93d<_0xb0d7f['joins'][_0xa887('0x35')];_0x31e93d+=0x1){if(_0xb0d7f[_0xa887('0x75')][_0x31e93d][_0xa887('0x76')]&&_[_0xa887('0x83')](_0x4aba27,_0xb0d7f[_0xa887('0x75')][_0x31e93d][_0xa887('0x76')])&&_0xb0d7f[_0xa887('0x75')][_0x31e93d][_0xa887('0x77')]&&_0xb0d7f['joins'][_0x31e93d]['foreignTable']&&_0xb0d7f[_0xa887('0x75')][_0x31e93d][_0xa887('0x79')]){_0x3e90e[_0xb0d7f[_0xa887('0x75')][_0x31e93d][_0xa887('0x76')]](_0xb0d7f[_0xa887('0x75')][_0x31e93d][_0xa887('0x78')],null,util[_0xa887('0x70')](_0xa887('0x86'),_0xb0d7f[_0xa887('0x6a')],_0xb0d7f[_0xa887('0x75')][_0x31e93d]['parentKey'],_0xb0d7f[_0xa887('0x75')][_0x31e93d][_0xa887('0x78')],_0xb0d7f['joins'][_0x31e93d][_0xa887('0x79')]));}}}if(_0xb0d7f[_0xa887('0x87')]){_0xb0d7f[_0xa887('0x87')]=JSON[_0xa887('0x7a')](_0xb0d7f[_0xa887('0x87')]);_0x3e90e[_0xa887('0x3a')](_0x21477a(_0xb0d7f['conditions']['group']));}_0x577ffa=_0x3e90e[_0xa887('0x88')]();_0x3e90e['limit'](_0x2d384e);_0x3e90e[_0xa887('0x1a')](0x0);return;}})[_0xa887('0x24')](function(){if(_0x244d97[_0xa887('0x89')]===_0xa887('0x8a')){return null;}var _0x330340=_[_0xa887('0x39')](_0x244d97,{'name':_0x244d97['fullPath']||_0x244d97[_0xa887('0x29')]||_0xb0d7f['name'],'basename':_0x34775a,'savename':util['format']('%s-%s.%s',_0x244d97[_0xa887('0x29')]||_0xb0d7f[_0xa887('0x29')],require(_0xa887('0x8b'))[_0xa887('0x8c')](0x4),_0x244d97[_0xa887('0x89')]||_0xa887('0x8d')),'reportId':_0xb0d7f['id'],'reportType':_0xa887('0x8e')});return db[_0xa887('0x8f')][_0xa887('0x45')](_0x330340,{'raw':!![]});})['then'](function(_0x7a352e){if(_0xb0d7f[_0xa887('0x6a')]===_0xa887('0x90')){_0x577ffa[_0xa887('0x3a')](_0xb0d7f[_0xa887('0x6a')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x244d97[_0xa887('0x91')],_0x244d97[_0xa887('0x92')]);}else{_0x577ffa[_0xa887('0x3a')](_0xb0d7f['table']+_0xa887('0x93'),_0x244d97[_0xa887('0x91')],_0x244d97[_0xa887('0x92')]);}if(_0x7a352e){logger[_0xa887('0x94')]('Run\x20Query:',_0x577ffa[_0xa887('0x7d')]());require('child_process')[_0xa887('0x95')](path[_0xa887('0x4f')](__dirname,_0xa887('0x96'),_0x7a352e[_0xa887('0x89')]),[_0x7a352e['id'],_0x577ffa[_0xa887('0x7d')](),path['join'](__dirname,'../../files/reports',_0x7a352e[_0xa887('0x97')]),_0x34775a]);return _0x7a352e;}else{var _0x5bf7e5=squel[_0xa887('0x68')]();_0x5bf7e5[_0xa887('0x69')]('('+_0x577ffa['toString']()+')',_0xa887('0x98'));_0x5bf7e5['field'](_0xa887('0x99'),_0xa887('0x1d'));_0x577ffa[_0xa887('0x1c')](_0x244d97[_0xa887('0x1c')]||_0x2d384e);_0x577ffa[_0xa887('0x1a')](_0x244d97[_0xa887('0x1a')]||0x0);return dbH[_0xa887('0x7e')]['query'](_0x5bf7e5['toString'](),{'type':dbH[_0xa887('0x7e')][_0xa887('0x7f')]['SELECT']})['then'](function(_0x496bef){if(!_0x496bef[_0xa887('0x35')]){_0x71e459=0x0;}else{_0x71e459=_0x496bef[0x0]['count']||0x0;}return dbH[_0xa887('0x7e')][_0xa887('0x30')](_0x577ffa[_0xa887('0x7d')](),{'type':dbH['sequelize'][_0xa887('0x7f')]['SELECT']});})[_0xa887('0x24')](function(_0x115a08){return{'rows':_0x115a08||[],'count':_0x71e459};});}});}exports[_0xa887('0x9a')]=function(_0x4b629e,_0x380ce9){return runReport(_0x4b629e[_0xa887('0x43')],_0x4b629e['query'],_0x4b629e['options'])[_0xa887('0x24')](respondWithResult(_0x380ce9,null))['catch'](handleError(_0x380ce9,null));};exports['runReport']=runReport;exports[_0xa887('0x30')]=function(_0x4d1772,_0x431c92){var _0x2eddff=0xa;var _0x437ce8=[_0xa887('0x4f'),_0xa887('0x50'),_0xa887('0x51'),'cross_join'];var _0x372c42={'SUM':_0xa887('0x53'),'COUNT':_0xa887('0x9b'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xa887('0x55'),'MIN':'MIN(%s)','AVG':_0xa887('0x57'),'GROUP_CONCAT':_0xa887('0x81'),'GROUP_CONCAT ASC':_0xa887('0x58'),'GROUP_CONCAT DESC':_0xa887('0x59')};var _0x5094f5={'SEC_TO_TIME':_0xa887('0x9c'),'DATE':_0xa887('0x82'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x45912e=function(_0x141edc){return!_[_0xa887('0x83')](['IS\x20NULL',_0xa887('0x9d'),_0xa887('0x5c'),'IS\x20NOT\x20EMPTY'],_0x141edc);};var _0xa7b7c0=function(_0x3e23df){if(!_0x3e23df||!_0x3e23df[_0xa887('0x5f')][_0xa887('0x35')]){return'';}for(var _0x157156='(',_0x1476e2=0x0;_0x1476e2<_0x3e23df[_0xa887('0x5f')][_0xa887('0x35')];_0x1476e2+=0x1){_0x1476e2>0x0&&(_0x157156+='\x20'+_0x3e23df['operator']+'\x20');_0x157156+=_0x3e23df[_0xa887('0x5f')][_0x1476e2][_0xa887('0x60')]?_0xa7b7c0(_0x3e23df[_0xa887('0x5f')][_0x1476e2]['group']):_0x3e23df['rules'][_0x1476e2][_0xa887('0x6d')]+'\x20'+_0x3e23df['rules'][_0x1476e2][_0xa887('0x84')]+(_0x45912e(_0x3e23df[_0xa887('0x5f')][_0x1476e2][_0xa887('0x84')])?'\x20'+_0x3e23df[_0xa887('0x5f')][_0x1476e2][_0xa887('0x61')]:'');}return _0x157156+')';};var _0x46f6e0={'where':{'id':_0x4d1772[_0xa887('0x43')]['id']}},_0x510892,_0x1b8947,_0x45fa69,_0x4a7010,_0x15f459;_0x46f6e0=_['merge']({},_0x46f6e0,_0x4d1772['options']);return db[_0xa887('0x2b')][_0xa887('0x44')](_0x46f6e0)['then'](function(_0xa3a61e){if(_0xa3a61e){_0x510892=_0xa3a61e;return _0xa3a61e[_0xa887('0x85')]();}return null;})[_0xa887('0x24')](function(_0x4db40d){if(_0x4db40d){if(!_0x4db40d[_0xa887('0x35')]){throw new db[(_0xa887('0x62'))][(_0xa887('0x63'))](_0xa887('0x64'),0x193);}_0x1b8947=_0x4db40d;return db[_0xa887('0x65')][_0xa887('0x66')]({'raw':!![]});}return null;})[_0xa887('0x24')](function(_0x56c213){if(_0x56c213){_0x45fa69=_[_0xa887('0x67')](_0x56c213,'id');var _0x139e3d;var _0x246143=squel[_0xa887('0x68')]();_0x246143[_0xa887('0x69')](_0x510892[_0xa887('0x6a')]);for(var _0x2a1097=0x0;_0x2a1097<_0x1b8947[_0xa887('0x35')];_0x2a1097+=0x1){_0x139e3d=_0x1b8947[_0x2a1097][_0xa887('0x6b')]?_0x45fa69[_0x1b8947[_0x2a1097]['MetricId']][_0xa887('0x6c')]:_0x1b8947[_0x2a1097][_0xa887('0x6d')];_0x139e3d=_0x1b8947[_0x2a1097][_0xa887('0x6e')]?_[_0xa887('0x6f')](_0x372c42[_0x1b8947[_0x2a1097][_0xa887('0x6e')]],'%s',_0x139e3d):_0x139e3d;_0x139e3d=_0x1b8947[_0x2a1097][_0xa887('0x70')]?_['replace'](_0x5094f5[_0x1b8947[_0x2a1097][_0xa887('0x70')]],'%s',_0x139e3d):_0x139e3d;if(_0x1b8947[_0x2a1097][_0xa887('0x71')]){_0x246143['group'](_0x139e3d);}_0x1b8947[_0x2a1097][_0xa887('0x72')]&&_0x246143['order'](_0x139e3d,_0x1b8947[_0x2a1097][_0xa887('0x72')]==='DESC'?![]:!![]);_0x246143[_0xa887('0x6d')](_0x139e3d,_0x1b8947[_0x2a1097][_0xa887('0x74')]||_0x139e3d);}if(_0x510892[_0xa887('0x75')]){_0x510892[_0xa887('0x75')]=JSON[_0xa887('0x7a')](_0x510892[_0xa887('0x75')]);for(var _0x755943=0x0;_0x755943<_0x510892[_0xa887('0x75')]['length'];_0x755943+=0x1){if(_0x510892[_0xa887('0x75')][_0x755943][_0xa887('0x76')]&&_['includes'](_0x437ce8,_0x510892[_0xa887('0x75')][_0x755943][_0xa887('0x76')])&&_0x510892['joins'][_0x755943]['parentKey']&&_0x510892['joins'][_0x755943][_0xa887('0x78')]&&_0x510892[_0xa887('0x75')][_0x755943][_0xa887('0x79')]){_0x246143[_0x510892[_0xa887('0x75')][_0x755943][_0xa887('0x76')]](_0x510892[_0xa887('0x75')][_0x755943][_0xa887('0x78')],null,util[_0xa887('0x70')](_0xa887('0x86'),_0x510892['table'],_0x510892[_0xa887('0x75')][_0x755943]['parentKey'],_0x510892['joins'][_0x755943]['foreignTable'],_0x510892['joins'][_0x755943][_0xa887('0x79')]));}}}if(_0x510892[_0xa887('0x87')]){_0x510892['conditions']=JSON[_0xa887('0x7a')](_0x510892['conditions']);_0x246143[_0xa887('0x3a')](_0xa7b7c0(_0x510892[_0xa887('0x87')][_0xa887('0x60')]));}_0x15f459=_0x246143[_0xa887('0x88')]();_0x246143[_0xa887('0x1c')](_0x2eddff);_0x246143[_0xa887('0x1a')](0x0);logger[_0xa887('0x7b')](_0xa887('0x7c'),_0x246143[_0xa887('0x7d')]());return dbH['sequelize'][_0xa887('0x30')](_0x246143[_0xa887('0x7d')](),{'type':dbH['sequelize'][_0xa887('0x7f')][_0xa887('0x80')]});}})[_0xa887('0x24')](function(){return{'sql':_0x15f459['toString']()};})[_0xa887('0x24')](respondWithResult(_0x431c92,null))[_0xa887('0x41')](handleError(_0x431c92,null));}; \ No newline at end of file +var _0x8588=['findAll','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','order','DESC','joins','parse','includes','parentKey','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','cross_join','SUM(%s)','SEC_TO_TIME(%s)','IS\x20NULL','groupBy','alias','foreignTable','web','%s-%s.%s','randomstring','generate','output','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','QueryTypes','runReport','MIN(%s)','IS\x20NOT\x20NULL','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','destroy','CustomReports','UserProfileResource','error','stack','name','index','map','AnalyticCustomReport','rawAttributes','fieldName','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','includeAll','rows','catch','show','params','include','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','join','left_join','right_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric'];(function(_0x1b5d75,_0x2ca173){var _0x510b64=function(_0x437cc8){while(--_0x437cc8){_0x1b5d75['push'](_0x1b5d75['shift']());}};_0x510b64(++_0x2ca173);}(_0x8588,0x185));var _0x8858=function(_0x3032ee,_0xbc5fb4){_0x3032ee=_0x3032ee-0x0;var _0x322ab0=_0x8588[_0x3032ee];return _0x322ab0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8858('0x0'));var zipdir=require(_0x8858('0x1'));var jsonpatch=require(_0x8858('0x2'));var rp=require(_0x8858('0x3'));var moment=require('moment');var BPromise=require(_0x8858('0x4'));var Mustache=require(_0x8858('0x5'));var util=require(_0x8858('0x6'));var path=require('path');var sox=require(_0x8858('0x7'));var csv=require(_0x8858('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8858('0x9'));var _=require(_0x8858('0xa'));var squel=require(_0x8858('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8858('0x8'));var querystring=require('querystring');var Papa=require(_0x8858('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8858('0xd'));var as=require(_0x8858('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8858('0xf'));var utils=require(_0x8858('0x10'));var config=require(_0x8858('0x11'));var licenseUtil=require(_0x8858('0x12'));var db=require(_0x8858('0x13'))['db'];var dbH=require(_0x8858('0x13'))[_0x8858('0x14')];function respondWithStatusCode(_0x3ebff2,_0x25504b){_0x25504b=_0x25504b||0xcc;return function(_0x268387){if(_0x268387){return _0x3ebff2[_0x8858('0x15')](_0x25504b);}return _0x3ebff2[_0x8858('0x16')](_0x25504b)[_0x8858('0x17')]();};}function respondWithResult(_0x424f1d,_0x1b7b6a){_0x1b7b6a=_0x1b7b6a||0xc8;return function(_0x4a9d43){if(_0x4a9d43){return _0x424f1d[_0x8858('0x16')](_0x1b7b6a)['json'](_0x4a9d43);}};}function respondWithFilteredResult(_0x26c0bd,_0x22b356){return function(_0x1cab6a){if(_0x1cab6a){var _0x3b7d14=typeof _0x22b356[_0x8858('0x18')]===_0x8858('0x19')&&typeof _0x22b356[_0x8858('0x1a')]===_0x8858('0x19');var _0x159aab=_0x1cab6a[_0x8858('0x1b')];var _0x5b0880=_0x3b7d14?0x0:_0x22b356[_0x8858('0x18')];var _0x83f44e=_0x3b7d14?_0x1cab6a[_0x8858('0x1b')]:_0x22b356[_0x8858('0x18')]+_0x22b356[_0x8858('0x1a')];var _0x1b8208;if(_0x83f44e>=_0x159aab){_0x83f44e=_0x159aab;_0x1b8208=0xc8;}else{_0x1b8208=0xce;}_0x26c0bd[_0x8858('0x16')](_0x1b8208);return _0x26c0bd[_0x8858('0x1c')](_0x8858('0x1d'),_0x5b0880+'-'+_0x83f44e+'/'+_0x159aab)[_0x8858('0x1e')](_0x1cab6a);}return null;};}function patchUpdates(_0x2b3786){return function(_0x30f607){try{jsonpatch[_0x8858('0x1f')](_0x30f607,_0x2b3786,!![]);}catch(_0x169487){return BPromise['reject'](_0x169487);}return _0x30f607['save']();};}function saveUpdates(_0x1e7ee,_0x48e402){return function(_0x147d9b){if(_0x147d9b){return _0x147d9b[_0x8858('0x20')](_0x1e7ee)[_0x8858('0x21')](function(_0x580fcb){return _0x580fcb;});}return null;};}function removeEntity(_0x4d7267,_0x4caccb){return function(_0x1a6672){if(_0x1a6672){return _0x1a6672[_0x8858('0x22')]()[_0x8858('0x21')](function(){var _0x11e03d=_0x1a6672['get']({'plain':!![]});var _0x113e0c=_0x8858('0x23');return db[_0x8858('0x24')][_0x8858('0x22')]({'where':{'type':_0x113e0c,'resourceId':_0x11e03d['id']}})[_0x8858('0x21')](function(){return _0x1a6672;});})[_0x8858('0x21')](function(){_0x4d7267[_0x8858('0x16')](0xcc)[_0x8858('0x17')]();});}};}function handleEntityNotFound(_0x341685,_0x1520d3){return function(_0x539596){if(!_0x539596){_0x341685[_0x8858('0x15')](0x194);}return _0x539596;};}function handleError(_0x4e2459,_0x3f9191){_0x3f9191=_0x3f9191||0x1f4;return function(_0x2fa4f9){logger[_0x8858('0x25')](_0x2fa4f9[_0x8858('0x26')]);if(_0x2fa4f9[_0x8858('0x27')]){delete _0x2fa4f9['name'];}_0x4e2459[_0x8858('0x16')](_0x3f9191)['send'](_0x2fa4f9);};}exports[_0x8858('0x28')]=function(_0x48fff3,_0x642830){var _0x4f00f8={},_0x4a0ea1={},_0x2cb8d7={'count':0x0,'rows':[]};var _0x48b09b=_[_0x8858('0x29')](db[_0x8858('0x2a')][_0x8858('0x2b')],function(_0x23ef02){return{'name':_0x23ef02[_0x8858('0x2c')],'type':_0x23ef02['type'][_0x8858('0x2d')]};});_0x4a0ea1['model']=_['map'](_0x48b09b,_0x8858('0x27'));_0x4a0ea1[_0x8858('0x2e')]=_[_0x8858('0x2f')](_0x48fff3[_0x8858('0x2e')]);_0x4a0ea1['filters']=_[_0x8858('0x30')](_0x4a0ea1[_0x8858('0x31')],_0x4a0ea1[_0x8858('0x2e')]);_0x4f00f8[_0x8858('0x32')]=_[_0x8858('0x30')](_0x4a0ea1[_0x8858('0x31')],qs[_0x8858('0x33')](_0x48fff3[_0x8858('0x2e')][_0x8858('0x33')]));_0x4f00f8[_0x8858('0x32')]=_0x4f00f8[_0x8858('0x32')][_0x8858('0x34')]?_0x4f00f8[_0x8858('0x32')]:_0x4a0ea1[_0x8858('0x31')];if(!_0x48fff3[_0x8858('0x2e')][_0x8858('0x35')](_0x8858('0x36'))){_0x4f00f8['limit']=qs['limit'](_0x48fff3[_0x8858('0x2e')][_0x8858('0x1a')]);_0x4f00f8['offset']=qs[_0x8858('0x18')](_0x48fff3[_0x8858('0x2e')][_0x8858('0x18')]);}_0x4f00f8['order']=qs['sort'](_0x48fff3['query'][_0x8858('0x37')]);_0x4f00f8[_0x8858('0x38')]=qs[_0x8858('0x39')](_[_0x8858('0x3a')](_0x48fff3['query'],_0x4a0ea1[_0x8858('0x39')]),_0x48b09b);if(_0x48fff3[_0x8858('0x2e')][_0x8858('0x3b')]){_0x4f00f8[_0x8858('0x38')]=_['merge'](_0x4f00f8[_0x8858('0x38')],{'$or':_[_0x8858('0x29')](_0x48b09b,function(_0x395e07){if(_0x395e07[_0x8858('0x3c')]!==_0x8858('0x3d')){var _0x5b9049={};_0x5b9049[_0x395e07[_0x8858('0x27')]]={'$like':'%'+_0x48fff3[_0x8858('0x2e')][_0x8858('0x3b')]+'%'};return _0x5b9049;}})});}_0x4f00f8=_[_0x8858('0x3e')]({},_0x4f00f8,_0x48fff3[_0x8858('0x3f')]);var _0x1dc20b={'where':_0x4f00f8[_0x8858('0x38')]};return db[_0x8858('0x2a')][_0x8858('0x1b')](_0x1dc20b)['then'](function(_0x3e8e06){_0x2cb8d7[_0x8858('0x1b')]=_0x3e8e06;if(_0x48fff3[_0x8858('0x2e')][_0x8858('0x40')]){_0x4f00f8['include']=[{'all':!![]}];}return db[_0x8858('0x2a')]['findAll'](_0x4f00f8);})['then'](function(_0x40e7a8){_0x2cb8d7[_0x8858('0x41')]=_0x40e7a8;return _0x2cb8d7;})[_0x8858('0x21')](respondWithFilteredResult(_0x642830,_0x4f00f8))[_0x8858('0x42')](handleError(_0x642830,null));};exports[_0x8858('0x43')]=function(_0x578757,_0x1fe047){var _0x4b42b8={'raw':![],'where':{'id':_0x578757[_0x8858('0x44')]['id']}},_0x4d4be3={};_0x4d4be3[_0x8858('0x31')]=_[_0x8858('0x2f')](db[_0x8858('0x2a')][_0x8858('0x2b')]);_0x4d4be3[_0x8858('0x2e')]=_[_0x8858('0x2f')](_0x578757[_0x8858('0x2e')]);_0x4d4be3[_0x8858('0x39')]=_[_0x8858('0x30')](_0x4d4be3[_0x8858('0x31')],_0x4d4be3[_0x8858('0x2e')]);_0x4b42b8[_0x8858('0x32')]=_[_0x8858('0x30')](_0x4d4be3[_0x8858('0x31')],qs[_0x8858('0x33')](_0x578757[_0x8858('0x2e')]['fields']));_0x4b42b8[_0x8858('0x32')]=_0x4b42b8[_0x8858('0x32')]['length']?_0x4b42b8[_0x8858('0x32')]:_0x4d4be3['model'];if(_0x578757[_0x8858('0x2e')][_0x8858('0x40')]){_0x4b42b8[_0x8858('0x45')]=[{'all':!![]}];}_0x4b42b8=_['merge']({},_0x4b42b8,_0x578757[_0x8858('0x3f')]);return db['AnalyticCustomReport']['find'](_0x4b42b8)[_0x8858('0x21')](handleEntityNotFound(_0x1fe047,null))[_0x8858('0x21')](respondWithResult(_0x1fe047,null))[_0x8858('0x42')](handleError(_0x1fe047,null));};exports[_0x8858('0x46')]=function(_0x5156c1,_0x435140){return db[_0x8858('0x2a')][_0x8858('0x46')](_0x5156c1['body'],{})['then'](function(_0x4143b2){var _0x15d86f=_0x5156c1[_0x8858('0x47')][_0x8858('0x48')]({'plain':!![]});if(!_0x15d86f)throw new Error(_0x8858('0x49'));if(_0x15d86f['role']===_0x8858('0x47')){var _0x5ebd23=_0x4143b2[_0x8858('0x48')]({'plain':!![]});var _0x3a25c5=_0x8858('0x4a');return db[_0x8858('0x4b')][_0x8858('0x4c')]({'where':{'name':_0x3a25c5,'userProfileId':_0x15d86f[_0x8858('0x4d')]},'raw':!![]})[_0x8858('0x21')](function(_0x44684b){if(_0x44684b&&_0x44684b[_0x8858('0x4e')]===0x0){return db[_0x8858('0x24')][_0x8858('0x46')]({'name':_0x5ebd23[_0x8858('0x27')],'resourceId':_0x5ebd23['id'],'type':'CustomReports','sectionId':_0x44684b['id']},{})[_0x8858('0x21')](function(){return _0x4143b2;});}else{return _0x4143b2;}})[_0x8858('0x42')](function(_0x575fda){logger[_0x8858('0x25')](_0x8858('0x4f'),_0x575fda);throw _0x575fda;});}return _0x4143b2;})[_0x8858('0x21')](respondWithResult(_0x435140,0xc9))[_0x8858('0x42')](handleError(_0x435140,null));};exports[_0x8858('0x20')]=function(_0x4515cf,_0x188f2e){if(_0x4515cf[_0x8858('0x50')]['id']){delete _0x4515cf[_0x8858('0x50')]['id'];}return db[_0x8858('0x2a')][_0x8858('0x4c')]({'where':{'id':_0x4515cf[_0x8858('0x44')]['id']}})[_0x8858('0x21')](handleEntityNotFound(_0x188f2e,null))[_0x8858('0x21')](saveUpdates(_0x4515cf[_0x8858('0x50')],null))[_0x8858('0x21')](respondWithResult(_0x188f2e,null))['catch'](handleError(_0x188f2e,null));};exports[_0x8858('0x22')]=function(_0xe47b4d,_0x439e55){return db['AnalyticCustomReport'][_0x8858('0x4c')]({'where':{'id':_0xe47b4d[_0x8858('0x44')]['id']}})[_0x8858('0x21')](handleEntityNotFound(_0x439e55,null))[_0x8858('0x21')](removeEntity(_0x439e55,null))[_0x8858('0x42')](handleError(_0x439e55,null));};exports[_0x8858('0x51')]=function(_0x4a5f86,_0x33d00a){var _0x251970=0xa;var _0x21a9ec=[_0x8858('0x52'),_0x8858('0x53'),_0x8858('0x54'),'cross_join'];var _0x11dfcd={'SUM':'SUM(%s)','COUNT':_0x8858('0x55'),'COUNT DISTINCT':_0x8858('0x56'),'MAX':_0x8858('0x57'),'MIN':'MIN(%s)','AVG':_0x8858('0x58'),'GROUP_CONCAT':_0x8858('0x59'),'GROUP_CONCAT ASC':_0x8858('0x5a'),'GROUP_CONCAT DESC':_0x8858('0x5b')};var _0x33ce08={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x8858('0x5c'),'HOUR':_0x8858('0x5d'),'ROUND':_0x8858('0x5e'),'UNIX_TIMESTAMP':_0x8858('0x5f')};var _0x28bfae=function(_0x9f66c2){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL',_0x8858('0x60'),_0x8858('0x61')],_0x9f66c2);};var _0x2abac8=function(_0x239e73){if(!_0x239e73||!_0x239e73['rules']['length']){return'';}for(var _0x59137d='(',_0x410c73=0x0;_0x410c73<_0x239e73[_0x8858('0x62')]['length'];_0x410c73+=0x1){_0x410c73>0x0&&(_0x59137d+='\x20'+_0x239e73[_0x8858('0x63')]+'\x20');_0x59137d+=_0x239e73[_0x8858('0x62')][_0x410c73][_0x8858('0x64')]?_0x2abac8(_0x239e73[_0x8858('0x62')][_0x410c73][_0x8858('0x64')]):_0x239e73['rules'][_0x410c73][_0x8858('0x65')]+'\x20'+_0x239e73['rules'][_0x410c73][_0x8858('0x66')]+(_0x28bfae(_0x239e73['rules'][_0x410c73][_0x8858('0x66')])?'\x20'+_0x239e73[_0x8858('0x62')][_0x410c73][_0x8858('0x67')]:'');}return _0x59137d+')';};var _0xab7b6={'where':{'id':_0x4a5f86['params']['id']}},_0x225a27,_0x37b71c,_0x429d4e,_0x313575,_0x46d689;_0xab7b6=_['merge']({},_0xab7b6,_0x4a5f86['options']);return db['AnalyticCustomReport'][_0x8858('0x4c')](_0xab7b6)[_0x8858('0x21')](function(_0x24593a){if(_0x24593a){_0x225a27=_0x24593a;return _0x24593a[_0x8858('0x68')]();}return null;})[_0x8858('0x21')](function(_0x21b10b){if(_0x21b10b){if(!_0x21b10b[_0x8858('0x34')]){throw new db[(_0x8858('0x69'))][(_0x8858('0x6a'))](_0x8858('0x6b'),0x193);}_0x37b71c=_0x21b10b;return db[_0x8858('0x6c')][_0x8858('0x6d')]({'raw':!![]});}return null;})[_0x8858('0x21')](function(_0x4dbe59){if(_0x4dbe59){_0x429d4e=_[_0x8858('0x6e')](_0x4dbe59,'id');var _0x183d52;var _0x3af3c9=squel[_0x8858('0x6f')]();_0x3af3c9[_0x8858('0x70')](_0x225a27[_0x8858('0x71')]);for(var _0x3b391f=0x0;_0x3b391f<_0x37b71c['length'];_0x3b391f+=0x1){_0x183d52=_0x37b71c[_0x3b391f][_0x8858('0x72')]?_0x429d4e[_0x37b71c[_0x3b391f][_0x8858('0x72')]][_0x8858('0x73')]:_0x37b71c[_0x3b391f][_0x8858('0x65')];_0x183d52=_0x37b71c[_0x3b391f][_0x8858('0x74')]?_[_0x8858('0x75')](_0x11dfcd[_0x37b71c[_0x3b391f][_0x8858('0x74')]],'%s',_0x183d52):_0x183d52;_0x183d52=_0x37b71c[_0x3b391f][_0x8858('0x76')]?_[_0x8858('0x75')](_0x33ce08[_0x37b71c[_0x3b391f]['format']],'%s',_0x183d52):_0x183d52;if(_0x37b71c[_0x3b391f]['groupBy']){_0x3af3c9['group'](_0x183d52);}_0x37b71c[_0x3b391f][_0x8858('0x77')]&&_0x3af3c9[_0x8858('0x78')](_0x183d52,_0x37b71c[_0x3b391f]['orderBy']===_0x8858('0x79')?![]:!![]);_0x3af3c9['field'](_0x183d52,_0x37b71c[_0x3b391f]['alias']||_0x183d52);}if(_0x225a27[_0x8858('0x7a')]){_0x225a27['joins']=JSON[_0x8858('0x7b')](_0x225a27['joins']);for(var _0x11ffe5=0x0;_0x11ffe5<_0x225a27[_0x8858('0x7a')]['length'];_0x11ffe5+=0x1){if(_0x225a27['joins'][_0x11ffe5][_0x8858('0x3c')]&&_[_0x8858('0x7c')](_0x21a9ec,_0x225a27[_0x8858('0x7a')][_0x11ffe5][_0x8858('0x3c')])&&_0x225a27[_0x8858('0x7a')][_0x11ffe5][_0x8858('0x7d')]&&_0x225a27['joins'][_0x11ffe5]['foreignTable']&&_0x225a27[_0x8858('0x7a')][_0x11ffe5][_0x8858('0x7e')]){_0x3af3c9[_0x225a27[_0x8858('0x7a')][_0x11ffe5][_0x8858('0x3c')]](_0x225a27[_0x8858('0x7a')][_0x11ffe5]['foreignTable'],null,util[_0x8858('0x76')](_0x8858('0x7f'),_0x225a27['table'],_0x225a27[_0x8858('0x7a')][_0x11ffe5][_0x8858('0x7d')],_0x225a27[_0x8858('0x7a')][_0x11ffe5]['foreignTable'],_0x225a27[_0x8858('0x7a')][_0x11ffe5][_0x8858('0x7e')]));}}}if(_0x225a27['conditions']){_0x225a27[_0x8858('0x80')]=JSON[_0x8858('0x7b')](_0x225a27[_0x8858('0x80')]);_0x3af3c9[_0x8858('0x38')](_0x2abac8(_0x225a27['conditions']['group']));}_0x46d689=_0x3af3c9[_0x8858('0x81')]();_0x3af3c9['limit'](_0x251970);_0x3af3c9['offset'](0x0);logger[_0x8858('0x82')](_0x8858('0x83'),_0x3af3c9[_0x8858('0x84')]());return dbH[_0x8858('0x85')]['query'](_0x3af3c9[_0x8858('0x84')](),{'type':dbH[_0x8858('0x85')]['QueryTypes'][_0x8858('0x86')]});}})[_0x8858('0x21')](respondWithResult(_0x33d00a,null))[_0x8858('0x42')](handleError(_0x33d00a,null));};function runReport(_0x35f0b1,_0x15bb94,_0x49cbd6){var _0x1a2abe=_0x15bb94['name'];var _0x11c9ba=0xa;var _0x537a3c=[_0x8858('0x52'),_0x8858('0x53'),'right_join',_0x8858('0x87')];var _0x3f37c2={'SUM':_0x8858('0x88'),'COUNT':_0x8858('0x55'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x8858('0x57'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x8858('0x59'),'GROUP_CONCAT ASC':_0x8858('0x5a'),'GROUP_CONCAT DESC':_0x8858('0x5b')};var _0x8286de={'SEC_TO_TIME':_0x8858('0x89'),'DATE':_0x8858('0x5c'),'HOUR':_0x8858('0x5d'),'ROUND':_0x8858('0x5e'),'UNIX_TIMESTAMP':_0x8858('0x5f')};var _0x53da63=function(_0x10ed5f){return!_[_0x8858('0x7c')]([_0x8858('0x8a'),'IS\x20NOT\x20NULL',_0x8858('0x60'),_0x8858('0x61')],_0x10ed5f);};var _0x49b73f=function(_0x162f5d){if(!_0x162f5d||!_0x162f5d[_0x8858('0x62')][_0x8858('0x34')]){return'';}for(var _0x4c6a3b='(',_0x57ad82=0x0;_0x57ad82<_0x162f5d[_0x8858('0x62')][_0x8858('0x34')];_0x57ad82+=0x1){_0x57ad82>0x0&&(_0x4c6a3b+='\x20'+_0x162f5d[_0x8858('0x63')]+'\x20');_0x4c6a3b+=_0x162f5d[_0x8858('0x62')][_0x57ad82][_0x8858('0x64')]?_0x49b73f(_0x162f5d[_0x8858('0x62')][_0x57ad82][_0x8858('0x64')]):_0x162f5d['rules'][_0x57ad82]['field']+'\x20'+_0x162f5d[_0x8858('0x62')][_0x57ad82][_0x8858('0x66')]+(_0x53da63(_0x162f5d[_0x8858('0x62')][_0x57ad82][_0x8858('0x66')])?'\x20'+_0x162f5d[_0x8858('0x62')][_0x57ad82][_0x8858('0x67')]:'');}return _0x4c6a3b+')';};var _0xda3d62={'where':{'id':_0x35f0b1['id']}},_0x42dfe2,_0x4cc804,_0x11ff22,_0x1b0d75,_0x4661e8;_0xda3d62=_[_0x8858('0x3e')]({},_0xda3d62,_0x49cbd6);return db[_0x8858('0x2a')][_0x8858('0x4c')](_0xda3d62)[_0x8858('0x21')](function(_0x50185b){if(_0x50185b){_0x42dfe2=_0x50185b;return _0x50185b['getFields']();}return null;})[_0x8858('0x21')](function(_0x4970a2){if(_0x4970a2){if(!_0x4970a2[_0x8858('0x34')]){throw new db[(_0x8858('0x69'))]['ValidationErrorItem'](_0x8858('0x6b'),0x193);}_0x4cc804=_0x4970a2;return db['AnalyticMetric'][_0x8858('0x6d')]({'raw':!![]});}return null;})[_0x8858('0x21')](function(_0x1853f7){if(_0x1853f7){_0x11ff22=_['keyBy'](_0x1853f7,'id');var _0x21d1e2;var _0x463303=squel[_0x8858('0x6f')]();_0x463303[_0x8858('0x70')](_0x42dfe2[_0x8858('0x71')]);for(var _0x4aac5d=0x0;_0x4aac5d<_0x4cc804[_0x8858('0x34')];_0x4aac5d+=0x1){_0x21d1e2=_0x4cc804[_0x4aac5d][_0x8858('0x72')]?_0x11ff22[_0x4cc804[_0x4aac5d][_0x8858('0x72')]][_0x8858('0x73')]:_0x4cc804[_0x4aac5d][_0x8858('0x65')];_0x21d1e2=_0x4cc804[_0x4aac5d][_0x8858('0x74')]?_[_0x8858('0x75')](_0x3f37c2[_0x4cc804[_0x4aac5d][_0x8858('0x74')]],'%s',_0x21d1e2):_0x21d1e2;_0x21d1e2=_0x4cc804[_0x4aac5d][_0x8858('0x76')]?_[_0x8858('0x75')](_0x8286de[_0x4cc804[_0x4aac5d][_0x8858('0x76')]],'%s',_0x21d1e2):_0x21d1e2;if(_0x4cc804[_0x4aac5d][_0x8858('0x8b')]){_0x463303[_0x8858('0x64')](_0x21d1e2);}_0x4cc804[_0x4aac5d][_0x8858('0x77')]&&_0x463303[_0x8858('0x78')](_0x21d1e2,_0x4cc804[_0x4aac5d][_0x8858('0x77')]===_0x8858('0x79')?![]:!![]);_0x463303[_0x8858('0x65')](_0x21d1e2,_0x4cc804[_0x4aac5d][_0x8858('0x8c')]||_0x21d1e2);}if(_0x42dfe2[_0x8858('0x7a')]){_0x42dfe2['joins']=JSON['parse'](_0x42dfe2['joins']);for(var _0x4283e0=0x0;_0x4283e0<_0x42dfe2[_0x8858('0x7a')][_0x8858('0x34')];_0x4283e0+=0x1){if(_0x42dfe2['joins'][_0x4283e0][_0x8858('0x3c')]&&_[_0x8858('0x7c')](_0x537a3c,_0x42dfe2[_0x8858('0x7a')][_0x4283e0][_0x8858('0x3c')])&&_0x42dfe2['joins'][_0x4283e0][_0x8858('0x7d')]&&_0x42dfe2[_0x8858('0x7a')][_0x4283e0][_0x8858('0x8d')]&&_0x42dfe2[_0x8858('0x7a')][_0x4283e0][_0x8858('0x7e')]){_0x463303[_0x42dfe2[_0x8858('0x7a')][_0x4283e0][_0x8858('0x3c')]](_0x42dfe2[_0x8858('0x7a')][_0x4283e0][_0x8858('0x8d')],null,util[_0x8858('0x76')]('%s.%s\x20=\x20%s.%s',_0x42dfe2[_0x8858('0x71')],_0x42dfe2[_0x8858('0x7a')][_0x4283e0]['parentKey'],_0x42dfe2[_0x8858('0x7a')][_0x4283e0][_0x8858('0x8d')],_0x42dfe2['joins'][_0x4283e0][_0x8858('0x7e')]));}}}if(_0x42dfe2[_0x8858('0x80')]){_0x42dfe2[_0x8858('0x80')]=JSON[_0x8858('0x7b')](_0x42dfe2[_0x8858('0x80')]);_0x463303[_0x8858('0x38')](_0x49b73f(_0x42dfe2[_0x8858('0x80')]['group']));}_0x4661e8=_0x463303[_0x8858('0x81')]();_0x463303[_0x8858('0x1a')](_0x11c9ba);_0x463303['offset'](0x0);return;}})[_0x8858('0x21')](function(){if(_0x15bb94['output']===_0x8858('0x8e')){return null;}var _0x50f0be=_[_0x8858('0x3e')](_0x15bb94,{'name':_0x15bb94['fullPath']||_0x15bb94[_0x8858('0x27')]||_0x42dfe2[_0x8858('0x27')],'basename':_0x1a2abe,'savename':util['format'](_0x8858('0x8f'),_0x15bb94['name']||_0x42dfe2[_0x8858('0x27')],require(_0x8858('0x90'))[_0x8858('0x91')](0x4),_0x15bb94[_0x8858('0x92')]||_0x8858('0x93')),'reportId':_0x42dfe2['id'],'reportType':'custom'});return db[_0x8858('0x94')][_0x8858('0x46')](_0x50f0be,{'raw':!![]});})[_0x8858('0x21')](function(_0x52cc8e){if(_0x42dfe2[_0x8858('0x71')]===_0x8858('0x95')){_0x4661e8[_0x8858('0x38')](_0x42dfe2[_0x8858('0x71')]+_0x8858('0x96'),_0x15bb94[_0x8858('0x97')],_0x15bb94[_0x8858('0x98')]);}else{_0x4661e8[_0x8858('0x38')](_0x42dfe2[_0x8858('0x71')]+_0x8858('0x99'),_0x15bb94[_0x8858('0x97')],_0x15bb94['endDate']);}if(_0x52cc8e){logger[_0x8858('0x9a')](_0x8858('0x9b'),_0x4661e8[_0x8858('0x84')]());require(_0x8858('0x9c'))['fork'](path[_0x8858('0x52')](__dirname,_0x8858('0x9d'),_0x52cc8e[_0x8858('0x92')]),[_0x52cc8e['id'],_0x4661e8[_0x8858('0x84')](),path['join'](__dirname,_0x8858('0x9e'),_0x52cc8e[_0x8858('0x9f')]),_0x1a2abe]);return _0x52cc8e;}else{var _0x2f0e31=squel[_0x8858('0x6f')]();_0x2f0e31[_0x8858('0x70')]('('+_0x4661e8[_0x8858('0x84')]()+')',_0x8858('0xa0'));_0x2f0e31[_0x8858('0x65')](_0x8858('0xa1'),_0x8858('0x1b'));_0x4661e8['limit'](_0x15bb94[_0x8858('0x1a')]||_0x11c9ba);_0x4661e8[_0x8858('0x18')](_0x15bb94['offset']||0x0);return dbH[_0x8858('0x85')]['query'](_0x2f0e31[_0x8858('0x84')](),{'type':dbH[_0x8858('0x85')][_0x8858('0xa2')][_0x8858('0x86')]})[_0x8858('0x21')](function(_0x512265){if(!_0x512265['length']){_0x1b0d75=0x0;}else{_0x1b0d75=_0x512265[0x0]['count']||0x0;}return dbH['sequelize'][_0x8858('0x2e')](_0x4661e8[_0x8858('0x84')](),{'type':dbH[_0x8858('0x85')][_0x8858('0xa2')][_0x8858('0x86')]});})['then'](function(_0xc1c3c4){return{'rows':_0xc1c3c4||[],'count':_0x1b0d75};});}});}exports['run']=function(_0x3fca7b,_0x24c820){return runReport(_0x3fca7b[_0x8858('0x44')],_0x3fca7b[_0x8858('0x2e')],_0x3fca7b['options'])[_0x8858('0x21')](respondWithResult(_0x24c820,null))['catch'](handleError(_0x24c820,null));};exports[_0x8858('0xa3')]=runReport;exports[_0x8858('0x2e')]=function(_0x27d9de,_0x32e1b0){var _0x488611=0xa;var _0x169e36=[_0x8858('0x52'),_0x8858('0x53'),'right_join',_0x8858('0x87')];var _0xb165f0={'SUM':'SUM(%s)','COUNT':_0x8858('0x55'),'COUNT DISTINCT':_0x8858('0x56'),'MAX':_0x8858('0x57'),'MIN':_0x8858('0xa4'),'AVG':_0x8858('0x58'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x8858('0x5b')};var _0x50e8bc={'SEC_TO_TIME':_0x8858('0x89'),'DATE':_0x8858('0x5c'),'HOUR':_0x8858('0x5d'),'ROUND':_0x8858('0x5e'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1aea97=function(_0x12cae1){return!_['includes']([_0x8858('0x8a'),_0x8858('0xa5'),_0x8858('0x60'),_0x8858('0x61')],_0x12cae1);};var _0x2eb95e=function(_0x2f3a38){if(!_0x2f3a38||!_0x2f3a38[_0x8858('0x62')][_0x8858('0x34')]){return'';}for(var _0x127fcd='(',_0x50a06b=0x0;_0x50a06b<_0x2f3a38[_0x8858('0x62')][_0x8858('0x34')];_0x50a06b+=0x1){_0x50a06b>0x0&&(_0x127fcd+='\x20'+_0x2f3a38[_0x8858('0x63')]+'\x20');_0x127fcd+=_0x2f3a38[_0x8858('0x62')][_0x50a06b][_0x8858('0x64')]?_0x2eb95e(_0x2f3a38[_0x8858('0x62')][_0x50a06b][_0x8858('0x64')]):_0x2f3a38[_0x8858('0x62')][_0x50a06b][_0x8858('0x65')]+'\x20'+_0x2f3a38['rules'][_0x50a06b][_0x8858('0x66')]+(_0x1aea97(_0x2f3a38['rules'][_0x50a06b][_0x8858('0x66')])?'\x20'+_0x2f3a38[_0x8858('0x62')][_0x50a06b][_0x8858('0x67')]:'');}return _0x127fcd+')';};var _0x94cec0={'where':{'id':_0x27d9de[_0x8858('0x44')]['id']}},_0x1ee78b,_0x587766,_0x3b65a8,_0x4c21d7,_0x5e8cd7;_0x94cec0=_[_0x8858('0x3e')]({},_0x94cec0,_0x27d9de['options']);return db['AnalyticCustomReport'][_0x8858('0x4c')](_0x94cec0)[_0x8858('0x21')](function(_0x29159a){if(_0x29159a){_0x1ee78b=_0x29159a;return _0x29159a[_0x8858('0x68')]();}return null;})[_0x8858('0x21')](function(_0x1a51fa){if(_0x1a51fa){if(!_0x1a51fa[_0x8858('0x34')]){throw new db[(_0x8858('0x69'))]['ValidationErrorItem'](_0x8858('0x6b'),0x193);}_0x587766=_0x1a51fa;return db[_0x8858('0x6c')]['findAll']({'raw':!![]});}return null;})[_0x8858('0x21')](function(_0x3734e0){if(_0x3734e0){_0x3b65a8=_['keyBy'](_0x3734e0,'id');var _0xefc581;var _0x4dbcc8=squel[_0x8858('0x6f')]();_0x4dbcc8[_0x8858('0x70')](_0x1ee78b[_0x8858('0x71')]);for(var _0x4fbf18=0x0;_0x4fbf18<_0x587766[_0x8858('0x34')];_0x4fbf18+=0x1){_0xefc581=_0x587766[_0x4fbf18][_0x8858('0x72')]?_0x3b65a8[_0x587766[_0x4fbf18][_0x8858('0x72')]][_0x8858('0x73')]:_0x587766[_0x4fbf18][_0x8858('0x65')];_0xefc581=_0x587766[_0x4fbf18][_0x8858('0x74')]?_[_0x8858('0x75')](_0xb165f0[_0x587766[_0x4fbf18][_0x8858('0x74')]],'%s',_0xefc581):_0xefc581;_0xefc581=_0x587766[_0x4fbf18][_0x8858('0x76')]?_['replace'](_0x50e8bc[_0x587766[_0x4fbf18][_0x8858('0x76')]],'%s',_0xefc581):_0xefc581;if(_0x587766[_0x4fbf18][_0x8858('0x8b')]){_0x4dbcc8[_0x8858('0x64')](_0xefc581);}_0x587766[_0x4fbf18][_0x8858('0x77')]&&_0x4dbcc8[_0x8858('0x78')](_0xefc581,_0x587766[_0x4fbf18][_0x8858('0x77')]===_0x8858('0x79')?![]:!![]);_0x4dbcc8[_0x8858('0x65')](_0xefc581,_0x587766[_0x4fbf18]['alias']||_0xefc581);}if(_0x1ee78b[_0x8858('0x7a')]){_0x1ee78b[_0x8858('0x7a')]=JSON[_0x8858('0x7b')](_0x1ee78b[_0x8858('0x7a')]);for(var _0x309311=0x0;_0x309311<_0x1ee78b['joins'][_0x8858('0x34')];_0x309311+=0x1){if(_0x1ee78b[_0x8858('0x7a')][_0x309311][_0x8858('0x3c')]&&_['includes'](_0x169e36,_0x1ee78b[_0x8858('0x7a')][_0x309311][_0x8858('0x3c')])&&_0x1ee78b['joins'][_0x309311][_0x8858('0x7d')]&&_0x1ee78b['joins'][_0x309311][_0x8858('0x8d')]&&_0x1ee78b[_0x8858('0x7a')][_0x309311]['foreignKey']){_0x4dbcc8[_0x1ee78b[_0x8858('0x7a')][_0x309311][_0x8858('0x3c')]](_0x1ee78b[_0x8858('0x7a')][_0x309311][_0x8858('0x8d')],null,util[_0x8858('0x76')]('%s.%s\x20=\x20%s.%s',_0x1ee78b['table'],_0x1ee78b[_0x8858('0x7a')][_0x309311][_0x8858('0x7d')],_0x1ee78b[_0x8858('0x7a')][_0x309311][_0x8858('0x8d')],_0x1ee78b['joins'][_0x309311][_0x8858('0x7e')]));}}}if(_0x1ee78b[_0x8858('0x80')]){_0x1ee78b[_0x8858('0x80')]=JSON[_0x8858('0x7b')](_0x1ee78b[_0x8858('0x80')]);_0x4dbcc8[_0x8858('0x38')](_0x2eb95e(_0x1ee78b[_0x8858('0x80')]['group']));}_0x5e8cd7=_0x4dbcc8[_0x8858('0x81')]();_0x4dbcc8[_0x8858('0x1a')](_0x488611);_0x4dbcc8[_0x8858('0x18')](0x0);logger[_0x8858('0x82')]('Limited\x20Query:',_0x4dbcc8['toString']());return dbH[_0x8858('0x85')]['query'](_0x4dbcc8[_0x8858('0x84')](),{'type':dbH['sequelize'][_0x8858('0xa2')][_0x8858('0x86')]});}})[_0x8858('0x21')](function(){return{'sql':_0x5e8cd7[_0x8858('0x84')]()};})[_0x8858('0x21')](respondWithResult(_0x32e1b0,null))['catch'](handleError(_0x32e1b0,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 84837ea..ca38cfd 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 _0x3f73=['./analyticCustomReport.attributes','define','AnalyticCustomReport','analytics_custom_reports','lodash','../../config/logger','moment','request-promise','rimraf'];(function(_0x134db1,_0x255174){var _0x1b807d=function(_0xfe3ce1){while(--_0xfe3ce1){_0x134db1['push'](_0x134db1['shift']());}};_0x1b807d(++_0x255174);}(_0x3f73,0xdc));var _0x33f7=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3f73[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x33f7('0x0'));var util=require('util');var logger=require(_0x33f7('0x1'))('api');var moment=require(_0x33f7('0x2'));var BPromise=require('bluebird');var rp=require(_0x33f7('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x33f7('0x4'));var config=require('../../config/environment');var attributes=require(_0x33f7('0x5'));module['exports']=function(_0x3eccea,_0x4efecf){return _0x3eccea[_0x33f7('0x6')](_0x33f7('0x7'),attributes,{'tableName':_0x33f7('0x8'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9ea5=['path','rimraf','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','../../config/logger','moment','bluebird','request-promise'];(function(_0x30bbd4,_0x5c703e){var _0x559cb2=function(_0x54b3fe){while(--_0x54b3fe){_0x30bbd4['push'](_0x30bbd4['shift']());}};_0x559cb2(++_0x5c703e);}(_0x9ea5,0x100));var _0x59ea=function(_0xd13772,_0x5636d1){_0xd13772=_0xd13772-0x0;var _0x2d80f1=_0x9ea5[_0xd13772];return _0x2d80f1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x59ea('0x0'))('api');var moment=require(_0x59ea('0x1'));var BPromise=require(_0x59ea('0x2'));var rp=require(_0x59ea('0x3'));var fs=require('fs');var path=require(_0x59ea('0x4'));var rimraf=require(_0x59ea('0x5'));var config=require('../../config/environment');var attributes=require(_0x59ea('0x6'));module[_0x59ea('0x7')]=function(_0x49e534,_0x12fda9){return _0x49e534[_0x59ea('0x8')](_0x59ea('0x9'),attributes,{'tableName':'analytics_custom_reports','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 b59e84b..d189d47 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 _0x8418=['result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x1a1872,_0x409461){var _0x5d0ad9=function(_0x524070){while(--_0x524070){_0x1a1872['push'](_0x1a1872['shift']());}};_0x5d0ad9(++_0x409461);}(_0x8418,0x6a));var _0x8841=function(_0x542da8,_0x509c26){_0x542da8=_0x542da8-0x0;var _0x533d7e=_0x8418[_0x542da8];return _0x533d7e;};'use strict';var _=require('lodash');var util=require(_0x8841('0x0'));var moment=require(_0x8841('0x1'));var BPromise=require(_0x8841('0x2'));var rs=require(_0x8841('0x3'));var fs=require('fs');var Redis=require(_0x8841('0x4'));var db=require(_0x8841('0x5'))['db'];var utils=require(_0x8841('0x6'));var logger=require(_0x8841('0x7'))(_0x8841('0x8'));var config=require(_0x8841('0x9'));var jayson=require(_0x8841('0xa'));var client=jayson['client'][_0x8841('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x175b68,_0x41eeab,_0x421ca9){return new BPromise(function(_0x2a49c7,_0x2fd58a){return client['request'](_0x175b68,_0x421ca9)[_0x8841('0xc')](function(_0xa9253){logger['info'](_0x8841('0xd'),_0x41eeab,_0x8841('0xe'));logger[_0x8841('0xf')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x41eeab,_0x8841('0xe'),JSON[_0x8841('0x10')](_0xa9253));if(_0xa9253[_0x8841('0x11')]){if(_0xa9253[_0x8841('0x11')][_0x8841('0x12')]===0x1f4){logger[_0x8841('0x11')](_0x8841('0xd'),_0x41eeab,_0xa9253[_0x8841('0x11')][_0x8841('0x13')]);return _0x2fd58a(_0xa9253['error']['message']);}logger[_0x8841('0x11')](_0x8841('0xd'),_0x41eeab,_0xa9253[_0x8841('0x11')][_0x8841('0x13')]);return _0x2a49c7(_0xa9253[_0x8841('0x11')][_0x8841('0x13')]);}else{logger['info'](_0x8841('0xd'),_0x41eeab,_0x8841('0xe'));_0x2a49c7(_0xa9253[_0x8841('0x14')][_0x8841('0x13')]);}})['catch'](function(_0x25d65e){logger['error'](_0x8841('0xd'),_0x41eeab,_0x25d65e);_0x2fd58a(_0x25d65e);});});} \ No newline at end of file +var _0x23aa=['debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s'];(function(_0x967959,_0x53c5c1){var _0x5c4489=function(_0x1ae5c6){while(--_0x1ae5c6){_0x967959['push'](_0x967959['shift']());}};_0x5c4489(++_0x53c5c1);}(_0x23aa,0x179));var _0xa23a=function(_0x53485a,_0x587f3f){_0x53485a=_0x53485a-0x0;var _0x448d36=_0x23aa[_0x53485a];return _0x448d36;};'use strict';var _=require(_0xa23a('0x0'));var util=require('util');var moment=require(_0xa23a('0x1'));var BPromise=require(_0xa23a('0x2'));var rs=require(_0xa23a('0x3'));var fs=require('fs');var Redis=require(_0xa23a('0x4'));var db=require(_0xa23a('0x5'))['db'];var utils=require(_0xa23a('0x6'));var logger=require(_0xa23a('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa23a('0x8')][_0xa23a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d8f6d,_0x5400d3,_0x56cec7){return new BPromise(function(_0x3685ec,_0x4763e1){return client[_0xa23a('0xa')](_0x3d8f6d,_0x56cec7)[_0xa23a('0xb')](function(_0x262cf1){logger[_0xa23a('0xc')](_0xa23a('0xd'),_0x5400d3,'request\x20sent');logger[_0xa23a('0xe')](_0xa23a('0xf'),_0x5400d3,_0xa23a('0x10'),JSON[_0xa23a('0x11')](_0x262cf1));if(_0x262cf1[_0xa23a('0x12')]){if(_0x262cf1[_0xa23a('0x12')][_0xa23a('0x13')]===0x1f4){logger[_0xa23a('0x12')](_0xa23a('0xd'),_0x5400d3,_0x262cf1[_0xa23a('0x12')][_0xa23a('0x14')]);return _0x4763e1(_0x262cf1[_0xa23a('0x12')][_0xa23a('0x14')]);}logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x5400d3,_0x262cf1[_0xa23a('0x12')][_0xa23a('0x14')]);return _0x3685ec(_0x262cf1[_0xa23a('0x12')]['message']);}else{logger[_0xa23a('0xc')](_0xa23a('0xd'),_0x5400d3,_0xa23a('0x10'));_0x3685ec(_0x262cf1[_0xa23a('0x15')][_0xa23a('0x14')]);}})[_0xa23a('0x16')](function(_0x271604){logger[_0xa23a('0x12')](_0xa23a('0xd'),_0x5400d3,_0x271604);_0x4763e1(_0x271604);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index be4c755..e94e9ae 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 _0x7909=['isAuthenticated','index','/:id','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','get'];(function(_0x23bd94,_0x208837){var _0xb1791b=function(_0x2f6b64){while(--_0x2f6b64){_0x23bd94['push'](_0x23bd94['shift']());}};_0xb1791b(++_0x208837);}(_0x7909,0x10a));var _0x9790=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x7909[_0x178e48];return _0x440d7e;};'use strict';var multer=require(_0x9790('0x0'));var util=require(_0x9790('0x1'));var path=require(_0x9790('0x2'));var timeout=require(_0x9790('0x3'));var express=require(_0x9790('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9790('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9790('0x6'));var controller=require(_0x9790('0x7'));router[_0x9790('0x8')]('/',auth[_0x9790('0x9')](),controller[_0x9790('0xa')]);router['get'](_0x9790('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x9790('0x8')](_0x9790('0xc'),auth[_0x9790('0x9')](),controller[_0x9790('0xd')]);router['get'](_0x9790('0xe'),auth[_0x9790('0x9')](),controller[_0x9790('0xf')]);router[_0x9790('0x8')](_0x9790('0x10'),auth['isAuthenticated'](),controller[_0x9790('0x11')]);router[_0x9790('0x12')]('/',auth[_0x9790('0x9')](),controller[_0x9790('0x13')]);router[_0x9790('0x14')](_0x9790('0xb'),auth['isAuthenticated'](),controller[_0x9790('0x15')]);router[_0x9790('0x16')](_0x9790('0xb'),auth[_0x9790('0x9')](),controller[_0x9790('0x17')]);module[_0x9790('0x18')]=router; \ No newline at end of file +var _0xf523=['post','create','put','/:id','update','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','show','/:id/preview','/:id/run','run','/:id/query','query'];(function(_0xf962f1,_0x129190){var _0x3418c3=function(_0x32825c){while(--_0x32825c){_0xf962f1['push'](_0xf962f1['shift']());}};_0x3418c3(++_0x129190);}(_0xf523,0x196));var _0x3f52=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf523[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x3f52('0x0'));var path=require('path');var timeout=require(_0x3f52('0x1'));var express=require('express');var router=express[_0x3f52('0x2')]();var fs_extra=require(_0x3f52('0x3'));var auth=require(_0x3f52('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3f52('0x5'));var controller=require('./analyticCustomReport.controller');router[_0x3f52('0x6')]('/',auth[_0x3f52('0x7')](),controller['index']);router[_0x3f52('0x6')]('/:id',auth[_0x3f52('0x7')](),controller[_0x3f52('0x8')]);router[_0x3f52('0x6')](_0x3f52('0x9'),auth[_0x3f52('0x7')](),controller['preview']);router[_0x3f52('0x6')](_0x3f52('0xa'),auth[_0x3f52('0x7')](),controller[_0x3f52('0xb')]);router[_0x3f52('0x6')](_0x3f52('0xc'),auth[_0x3f52('0x7')](),controller[_0x3f52('0xd')]);router[_0x3f52('0xe')]('/',auth[_0x3f52('0x7')](),controller[_0x3f52('0xf')]);router[_0x3f52('0x10')](_0x3f52('0x11'),auth['isAuthenticated'](),controller[_0x3f52('0x12')]);router['delete'](_0x3f52('0x11'),auth[_0x3f52('0x7')](),controller[_0x3f52('0x13')]);module[_0x3f52('0x14')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index c71e0ad..822b93b 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 _0x98a8=['sequelize','exports','STRING','TEXT'];(function(_0x20f7d1,_0x15897f){var _0x12ba03=function(_0x1bc254){while(--_0x1bc254){_0x20f7d1['push'](_0x20f7d1['shift']());}};_0x12ba03(++_0x15897f);}(_0x98a8,0x12c));var _0x898a=function(_0x5a7720,_0x49c410){_0x5a7720=_0x5a7720-0x0;var _0x3ff48a=_0x98a8[_0x5a7720];return _0x3ff48a;};'use strict';var Sequelize=require(_0x898a('0x0'));module[_0x898a('0x1')]={'name':{'type':Sequelize[_0x898a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x898a('0x2')]},'parent':{'type':Sequelize[_0x898a('0x2')]},'table':{'type':Sequelize[_0x898a('0x2')]},'conditions':{'type':Sequelize[_0x898a('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x3f8a=['TEXT','sequelize','exports','STRING'];(function(_0x21e857,_0x319366){var _0x3ed3ef=function(_0x17370c){while(--_0x17370c){_0x21e857['push'](_0x21e857['shift']());}};_0x3ed3ef(++_0x319366);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x4adff1,_0x4a8cbe){_0x4adff1=_0x4adff1-0x0;var _0x318759=_0x3f8a[_0x4adff1];return _0x318759;};'use strict';var Sequelize=require(_0xa3f8('0x0'));module[_0xa3f8('0x1')]={'name':{'type':Sequelize[_0xa3f8('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa3f8('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xa3f8('0x2')]},'conditions':{'type':Sequelize[_0xa3f8('0x3')]},'joins':{'type':Sequelize[_0xa3f8('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 79f84fc..798f0a0 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 _0x0295=['default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','fork','../../files/reports','COUNT(*)','SELECT','run','runReport','MAX(%s)','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','get','UserProfileResource','destroy','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','autoAssociation','DefaultReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','field','condition','value','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','from','table','MetricId','metric','function','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','group','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20EMPTY','operator','getFields','findAll','select','replace','output','web','%s-%s.%s','randomstring','generate','csv'];(function(_0x1ae283,_0x25d017){var _0xf8240b=function(_0x59c270){while(--_0x59c270){_0x1ae283['push'](_0x1ae283['shift']());}};_0xf8240b(++_0x25d017);}(_0x0295,0x1f0));var _0x5029=function(_0x3b95e2,_0x3d2dfb){_0x3b95e2=_0x3b95e2-0x0;var _0x1191c4=_0x0295[_0x3b95e2];return _0x1191c4;};'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'];var dbH=require(_0x5029('0x14'))['dbH'];function respondWithStatusCode(_0x4fa22d,_0x49f836){_0x49f836=_0x49f836||0xcc;return function(_0x4aebb6){if(_0x4aebb6){return _0x4fa22d[_0x5029('0x15')](_0x49f836);}return _0x4fa22d[_0x5029('0x16')](_0x49f836)[_0x5029('0x17')]();};}function respondWithResult(_0x434630,_0x2c0b33){_0x2c0b33=_0x2c0b33||0xc8;return function(_0x11c24b){if(_0x11c24b){return _0x434630[_0x5029('0x16')](_0x2c0b33)[_0x5029('0x18')](_0x11c24b);}};}function respondWithFilteredResult(_0x10bf55,_0x326923){return function(_0x457c73){if(_0x457c73){var _0x353cba=typeof _0x326923[_0x5029('0x19')]===_0x5029('0x1a')&&typeof _0x326923[_0x5029('0x1b')]==='undefined';var _0x1ed567=_0x457c73[_0x5029('0x1c')];var _0x35de81=_0x353cba?0x0:_0x326923[_0x5029('0x19')];var _0x8cea01=_0x353cba?_0x457c73[_0x5029('0x1c')]:_0x326923[_0x5029('0x19')]+_0x326923['limit'];var _0x226a5c;if(_0x8cea01>=_0x1ed567){_0x8cea01=_0x1ed567;_0x226a5c=0xc8;}else{_0x226a5c=0xce;}_0x10bf55['status'](_0x226a5c);return _0x10bf55[_0x5029('0x1d')](_0x5029('0x1e'),_0x35de81+'-'+_0x8cea01+'/'+_0x1ed567)[_0x5029('0x18')](_0x457c73);}return null;};}function patchUpdates(_0x3cf0fb){return function(_0x4b5854){try{jsonpatch['apply'](_0x4b5854,_0x3cf0fb,!![]);}catch(_0x4c9184){return BPromise['reject'](_0x4c9184);}return _0x4b5854[_0x5029('0x1f')]();};}function saveUpdates(_0x853a34,_0x1eb228){return function(_0x2bbbcb){if(_0x2bbbcb){return _0x2bbbcb[_0x5029('0x20')](_0x853a34)[_0x5029('0x21')](function(_0x125c26){return _0x125c26;});}return null;};}function removeEntity(_0x356dac,_0x3e857d){return function(_0x4ceaae){if(_0x4ceaae){return _0x4ceaae['destroy']()['then'](function(){var _0x588d90=_0x4ceaae[_0x5029('0x22')]({'plain':!![]});var _0x51093c='DefaultReports';return db[_0x5029('0x23')][_0x5029('0x24')]({'where':{'type':_0x51093c,'resourceId':_0x588d90['id']}})[_0x5029('0x21')](function(){return _0x4ceaae;});})['then'](function(){_0x356dac[_0x5029('0x16')](0xcc)[_0x5029('0x17')]();});}};}function handleEntityNotFound(_0x5e45c4,_0x2b6d99){return function(_0x31f0a0){if(!_0x31f0a0){_0x5e45c4[_0x5029('0x15')](0x194);}return _0x31f0a0;};}function handleError(_0x4a24b9,_0x32da06){_0x32da06=_0x32da06||0x1f4;return function(_0x251f99){logger[_0x5029('0x25')](_0x251f99['stack']);if(_0x251f99[_0x5029('0x26')]){delete _0x251f99[_0x5029('0x26')];}_0x4a24b9['status'](_0x32da06)[_0x5029('0x27')](_0x251f99);};}exports[_0x5029('0x28')]=function(_0x4434ff,_0x1c3dd9){var _0x196830={},_0x2a1ed6={},_0x44255a={'count':0x0,'rows':[]};var _0x465153=_[_0x5029('0x29')](db[_0x5029('0x2a')][_0x5029('0x2b')],function(_0x4519c8){return{'name':_0x4519c8['fieldName'],'type':_0x4519c8[_0x5029('0x2c')]['key']};});_0x2a1ed6[_0x5029('0x2d')]=_['map'](_0x465153,'name');_0x2a1ed6[_0x5029('0x2e')]=_[_0x5029('0x2f')](_0x4434ff[_0x5029('0x2e')]);_0x2a1ed6['filters']=_[_0x5029('0x30')](_0x2a1ed6[_0x5029('0x2d')],_0x2a1ed6[_0x5029('0x2e')]);_0x196830[_0x5029('0x31')]=_[_0x5029('0x30')](_0x2a1ed6[_0x5029('0x2d')],qs[_0x5029('0x32')](_0x4434ff[_0x5029('0x2e')][_0x5029('0x32')]));_0x196830['attributes']=_0x196830[_0x5029('0x31')][_0x5029('0x33')]?_0x196830[_0x5029('0x31')]:_0x2a1ed6[_0x5029('0x2d')];if(!_0x4434ff['query'][_0x5029('0x34')](_0x5029('0x35'))){_0x196830[_0x5029('0x1b')]=qs['limit'](_0x4434ff['query'][_0x5029('0x1b')]);_0x196830[_0x5029('0x19')]=qs['offset'](_0x4434ff['query'][_0x5029('0x19')]);}_0x196830[_0x5029('0x36')]=qs[_0x5029('0x37')](_0x4434ff[_0x5029('0x2e')][_0x5029('0x37')]);_0x196830[_0x5029('0x38')]=qs[_0x5029('0x39')](_[_0x5029('0x3a')](_0x4434ff[_0x5029('0x2e')],_0x2a1ed6[_0x5029('0x39')]),_0x465153);if(_0x4434ff[_0x5029('0x2e')][_0x5029('0x3b')]){_0x196830[_0x5029('0x38')]=_[_0x5029('0x3c')](_0x196830['where'],{'$or':_['map'](_0x465153,function(_0x73797c){if(_0x73797c[_0x5029('0x2c')]!==_0x5029('0x3d')){var _0x48c9eb={};_0x48c9eb[_0x73797c[_0x5029('0x26')]]={'$like':'%'+_0x4434ff[_0x5029('0x2e')]['filter']+'%'};return _0x48c9eb;}})});}_0x196830=_[_0x5029('0x3c')]({},_0x196830,_0x4434ff['options']);var _0x506f0d={'where':_0x196830['where']};return db[_0x5029('0x2a')][_0x5029('0x1c')](_0x506f0d)[_0x5029('0x21')](function(_0x78768){_0x44255a[_0x5029('0x1c')]=_0x78768;if(_0x4434ff[_0x5029('0x2e')][_0x5029('0x3e')]){_0x196830[_0x5029('0x3f')]=[{'all':!![]}];}return db[_0x5029('0x2a')]['findAll'](_0x196830);})[_0x5029('0x21')](function(_0x236455){_0x44255a[_0x5029('0x40')]=_0x236455;return _0x44255a;})[_0x5029('0x21')](respondWithFilteredResult(_0x1c3dd9,_0x196830))[_0x5029('0x41')](handleError(_0x1c3dd9,null));};exports[_0x5029('0x42')]=function(_0x5658a7,_0x259db8){var _0xa1580a={'raw':!![],'where':{'id':_0x5658a7[_0x5029('0x43')]['id']}},_0x9434ed={};_0x9434ed[_0x5029('0x2d')]=_['keys'](db[_0x5029('0x2a')][_0x5029('0x2b')]);_0x9434ed[_0x5029('0x2e')]=_[_0x5029('0x2f')](_0x5658a7[_0x5029('0x2e')]);_0x9434ed[_0x5029('0x39')]=_[_0x5029('0x30')](_0x9434ed[_0x5029('0x2d')],_0x9434ed[_0x5029('0x2e')]);_0xa1580a['attributes']=_[_0x5029('0x30')](_0x9434ed[_0x5029('0x2d')],qs[_0x5029('0x32')](_0x5658a7[_0x5029('0x2e')]['fields']));_0xa1580a['attributes']=_0xa1580a[_0x5029('0x31')][_0x5029('0x33')]?_0xa1580a[_0x5029('0x31')]:_0x9434ed[_0x5029('0x2d')];if(_0x5658a7[_0x5029('0x2e')][_0x5029('0x3e')]){_0xa1580a[_0x5029('0x3f')]=[{'all':!![]}];}_0xa1580a=_[_0x5029('0x3c')]({},_0xa1580a,_0x5658a7[_0x5029('0x44')]);return db[_0x5029('0x2a')][_0x5029('0x45')](_0xa1580a)[_0x5029('0x21')](handleEntityNotFound(_0x259db8,null))[_0x5029('0x21')](respondWithResult(_0x259db8,null))[_0x5029('0x41')](handleError(_0x259db8,null));};exports[_0x5029('0x46')]=function(_0x175cc0,_0x10fc07){return db[_0x5029('0x2a')][_0x5029('0x46')](_0x175cc0[_0x5029('0x47')],{})[_0x5029('0x21')](function(_0x489457){var _0x1069c4=_0x175cc0['user'][_0x5029('0x22')]({'plain':!![]});if(!_0x1069c4)throw new Error(_0x5029('0x48'));if(_0x1069c4['role']==='user'){var _0x319bff=_0x489457['get']({'plain':!![]});var _0x4aaa43=_0x5029('0x49');return db[_0x5029('0x4a')][_0x5029('0x45')]({'where':{'name':_0x4aaa43,'userProfileId':_0x1069c4['userProfileId']},'raw':!![]})['then'](function(_0x1510bb){if(_0x1510bb&&_0x1510bb[_0x5029('0x4b')]===0x0){return db['UserProfileResource'][_0x5029('0x46')]({'name':_0x319bff['name'],'resourceId':_0x319bff['id'],'type':_0x5029('0x4c'),'sectionId':_0x1510bb['id']},{})['then'](function(){return _0x489457;});}else{return _0x489457;}})[_0x5029('0x41')](function(_0x27e1c0){logger[_0x5029('0x25')](_0x5029('0x4d'),_0x27e1c0);throw _0x27e1c0;});}return _0x489457;})[_0x5029('0x21')](respondWithResult(_0x10fc07,0xc9))[_0x5029('0x41')](handleError(_0x10fc07,null));};exports[_0x5029('0x20')]=function(_0xa25013,_0x586936){if(_0xa25013[_0x5029('0x47')]['id']){delete _0xa25013['body']['id'];}return db[_0x5029('0x2a')][_0x5029('0x45')]({'where':{'id':_0xa25013['params']['id']}})[_0x5029('0x21')](handleEntityNotFound(_0x586936,null))['then'](saveUpdates(_0xa25013['body'],null))['then'](respondWithResult(_0x586936,null))[_0x5029('0x41')](handleError(_0x586936,null));};exports['destroy']=function(_0x49d1db,_0x353ae4){return db[_0x5029('0x2a')]['find']({'where':{'id':_0x49d1db[_0x5029('0x43')]['id']}})['then'](handleEntityNotFound(_0x353ae4,null))['then'](removeEntity(_0x353ae4,null))[_0x5029('0x41')](handleError(_0x353ae4,null));};exports[_0x5029('0x4e')]=function(_0x81e39c,_0x448273){var _0x164179=0xa;var _0x4e8d9f=[_0x5029('0x4f'),_0x5029('0x50'),_0x5029('0x51'),_0x5029('0x52')];var _0x4dca54={'SUM':_0x5029('0x53'),'COUNT':_0x5029('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x5029('0x55'),'AVG':_0x5029('0x56'),'GROUP_CONCAT':_0x5029('0x57'),'GROUP_CONCAT ASC':_0x5029('0x58'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4208ab={'SEC_TO_TIME':_0x5029('0x59'),'DATE':_0x5029('0x5a'),'HOUR':_0x5029('0x5b'),'ROUND':_0x5029('0x5c'),'UNIX_TIMESTAMP':_0x5029('0x5d')};var _0x59a718=function(_0x560324){return!_[_0x5029('0x5e')]([_0x5029('0x5f'),_0x5029('0x60'),'IS\x20EMPTY',_0x5029('0x61')],_0x560324);};var _0x2d439a=function(_0x105638){if(!_0x105638||!_0x105638[_0x5029('0x62')][_0x5029('0x33')]){return'';}for(var _0x5264c6='(',_0x2ec5d0=0x0;_0x2ec5d0<_0x105638[_0x5029('0x62')][_0x5029('0x33')];_0x2ec5d0+=0x1){_0x2ec5d0>0x0&&(_0x5264c6+='\x20'+_0x105638['operator']+'\x20');_0x5264c6+=_0x105638[_0x5029('0x62')][_0x2ec5d0]['group']?_0x2d439a(_0x105638[_0x5029('0x62')][_0x2ec5d0]['group']):_0x105638[_0x5029('0x62')][_0x2ec5d0][_0x5029('0x63')]+'\x20'+_0x105638[_0x5029('0x62')][_0x2ec5d0][_0x5029('0x64')]+(_0x59a718(_0x105638[_0x5029('0x62')][_0x2ec5d0][_0x5029('0x64')])?'\x20'+_0x105638['rules'][_0x2ec5d0][_0x5029('0x65')]:'');}return _0x5264c6+')';};var _0x19220d={'where':{'id':_0x81e39c['params']['id']}},_0x1ff8df,_0x151562,_0x389700,_0x506f74,_0x13ca47;_0x19220d=_[_0x5029('0x3c')]({},_0x19220d,_0x81e39c['options']);return db[_0x5029('0x2a')]['find'](_0x19220d)[_0x5029('0x21')](function(_0x54daf9){if(_0x54daf9){_0x1ff8df=_0x54daf9;return _0x54daf9['getFields']();}return null;})[_0x5029('0x21')](function(_0x575f09){if(_0x575f09){if(!_0x575f09[_0x5029('0x33')]){throw new db[(_0x5029('0x66'))][(_0x5029('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x151562=_0x575f09;return db[_0x5029('0x68')]['findAll']({'raw':!![]});}return null;})[_0x5029('0x21')](function(_0x255dfb){if(_0x255dfb){_0x389700=_[_0x5029('0x69')](_0x255dfb,'id');var _0x1cca02;var _0x1deed7=squel['select']();_0x1deed7[_0x5029('0x6a')](_0x1ff8df[_0x5029('0x6b')]);for(var _0x5890ac=0x0;_0x5890ac<_0x151562[_0x5029('0x33')];_0x5890ac+=0x1){_0x1cca02=_0x151562[_0x5890ac][_0x5029('0x6c')]?_0x389700[_0x151562[_0x5890ac][_0x5029('0x6c')]][_0x5029('0x6d')]:_0x151562[_0x5890ac][_0x5029('0x63')];_0x1cca02=_0x151562[_0x5890ac][_0x5029('0x6e')]?_['replace'](_0x4dca54[_0x151562[_0x5890ac]['function']],'%s',_0x1cca02):_0x1cca02;_0x1cca02=_0x151562[_0x5890ac][_0x5029('0x6f')]?_['replace'](_0x4208ab[_0x151562[_0x5890ac][_0x5029('0x6f')]],'%s',_0x1cca02):_0x1cca02;if(_0x151562[_0x5890ac][_0x5029('0x70')]){_0x1deed7['group'](_0x1cca02);}_0x151562[_0x5890ac][_0x5029('0x71')]&&_0x1deed7['order'](_0x1cca02,_0x151562[_0x5890ac]['orderBy']===_0x5029('0x72')?![]:!![]);_0x1deed7[_0x5029('0x63')](_0x1cca02,_0x151562[_0x5890ac][_0x5029('0x73')]||_0x1cca02);}if(_0x1ff8df[_0x5029('0x74')]){_0x1ff8df['joins']=JSON[_0x5029('0x75')](_0x1ff8df[_0x5029('0x74')]);for(var _0x4a2ce8=0x0;_0x4a2ce8<_0x1ff8df[_0x5029('0x74')][_0x5029('0x33')];_0x4a2ce8+=0x1){if(_0x1ff8df['joins'][_0x4a2ce8]['type']&&_['includes'](_0x4e8d9f,_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x2c')])&&_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x76')]&&_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x77')]&&_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x78')]){_0x1deed7[_0x1ff8df[_0x5029('0x74')][_0x4a2ce8]['type']](_0x1ff8df['joins'][_0x4a2ce8][_0x5029('0x77')],null,util[_0x5029('0x6f')](_0x5029('0x79'),_0x1ff8df[_0x5029('0x6b')],_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x76')],_0x1ff8df[_0x5029('0x74')][_0x4a2ce8]['foreignTable'],_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x78')]));}}}if(_0x1ff8df[_0x5029('0x7a')]){_0x1ff8df['conditions']=JSON[_0x5029('0x75')](_0x1ff8df[_0x5029('0x7a')]);_0x1deed7[_0x5029('0x38')](_0x2d439a(_0x1ff8df['conditions'][_0x5029('0x7b')]));}_0x13ca47=_0x1deed7[_0x5029('0x7c')]();_0x1deed7[_0x5029('0x1b')](_0x164179);_0x1deed7['offset'](0x0);logger[_0x5029('0x7d')](_0x5029('0x7e'),_0x1deed7['toString']());return dbH[_0x5029('0x7f')][_0x5029('0x2e')](_0x1deed7[_0x5029('0x80')](),{'type':dbH[_0x5029('0x7f')][_0x5029('0x81')]['SELECT']});}})[_0x5029('0x21')](respondWithResult(_0x448273,null))[_0x5029('0x41')](handleError(_0x448273,null));};function runReport(_0x426d70,_0xe6ac28,_0x153cdc){var _0x5e7f50=_0xe6ac28[_0x5029('0x26')];var _0x202c51=0xa;var _0x344203=['join',_0x5029('0x50'),_0x5029('0x51'),_0x5029('0x52')];var _0x3e47bd={'SUM':_0x5029('0x53'),'COUNT':_0x5029('0x54'),'COUNT DISTINCT':_0x5029('0x82'),'MAX':'MAX(%s)','MIN':_0x5029('0x55'),'AVG':_0x5029('0x56'),'GROUP_CONCAT':_0x5029('0x57'),'GROUP_CONCAT ASC':_0x5029('0x58'),'GROUP_CONCAT DESC':_0x5029('0x83')};var _0x4c40d1={'SEC_TO_TIME':_0x5029('0x59'),'DATE':_0x5029('0x5a'),'HOUR':_0x5029('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x5029('0x5d')};var _0x41e2d8=function(_0x51098a){return!_['includes'](['IS\x20NULL',_0x5029('0x60'),_0x5029('0x84'),_0x5029('0x61')],_0x51098a);};var _0x4007c8=function(_0x3dc05a){if(!_0x3dc05a||!_0x3dc05a['rules'][_0x5029('0x33')]){return'';}for(var _0x2e4782='(',_0x2c0540=0x0;_0x2c0540<_0x3dc05a['rules']['length'];_0x2c0540+=0x1){_0x2c0540>0x0&&(_0x2e4782+='\x20'+_0x3dc05a[_0x5029('0x85')]+'\x20');_0x2e4782+=_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x7b')]?_0x4007c8(_0x3dc05a[_0x5029('0x62')][_0x2c0540]['group']):_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x63')]+'\x20'+_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x64')]+(_0x41e2d8(_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x64')])?'\x20'+_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x65')]:'');}return _0x2e4782+')';};var _0x5aecc2={'where':{'id':_0x426d70['id']}},_0x159450,_0x556c7a,_0x48bbe2,_0x3e3150,_0x533ee2;_0x5aecc2=_[_0x5029('0x3c')]({},_0x5aecc2,_0x153cdc);return db[_0x5029('0x2a')][_0x5029('0x45')](_0x5aecc2)[_0x5029('0x21')](function(_0x1b6f4c){if(_0x1b6f4c){_0x159450=_0x1b6f4c;return _0x1b6f4c[_0x5029('0x86')]();}return null;})[_0x5029('0x21')](function(_0x1d6092){if(_0x1d6092){if(!_0x1d6092['length']){throw new db['Sequelize'][(_0x5029('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x556c7a=_0x1d6092;return db['AnalyticMetric'][_0x5029('0x87')]({'raw':!![]});}return null;})['then'](function(_0x4b25ed){if(_0x4b25ed){_0x48bbe2=_[_0x5029('0x69')](_0x4b25ed,'id');var _0xb8da0b;var _0x13e07e=squel[_0x5029('0x88')]();_0x13e07e[_0x5029('0x6a')](_0x159450['table']);for(var _0x38c02a=0x0;_0x38c02a<_0x556c7a[_0x5029('0x33')];_0x38c02a+=0x1){_0xb8da0b=_0x556c7a[_0x38c02a][_0x5029('0x6c')]?_0x48bbe2[_0x556c7a[_0x38c02a]['MetricId']][_0x5029('0x6d')]:_0x556c7a[_0x38c02a][_0x5029('0x63')];_0xb8da0b=_0x556c7a[_0x38c02a][_0x5029('0x6e')]?_[_0x5029('0x89')](_0x3e47bd[_0x556c7a[_0x38c02a][_0x5029('0x6e')]],'%s',_0xb8da0b):_0xb8da0b;_0xb8da0b=_0x556c7a[_0x38c02a]['format']?_['replace'](_0x4c40d1[_0x556c7a[_0x38c02a][_0x5029('0x6f')]],'%s',_0xb8da0b):_0xb8da0b;if(_0x556c7a[_0x38c02a][_0x5029('0x70')]){_0x13e07e['group'](_0xb8da0b);}_0x556c7a[_0x38c02a][_0x5029('0x71')]&&_0x13e07e[_0x5029('0x36')](_0xb8da0b,_0x556c7a[_0x38c02a][_0x5029('0x71')]===_0x5029('0x72')?![]:!![]);_0x13e07e[_0x5029('0x63')](_0xb8da0b,_0x556c7a[_0x38c02a][_0x5029('0x73')]||_0xb8da0b);}if(_0x159450[_0x5029('0x74')]){_0x159450[_0x5029('0x74')]=JSON['parse'](_0x159450['joins']);for(var _0x4243c3=0x0;_0x4243c3<_0x159450['joins'][_0x5029('0x33')];_0x4243c3+=0x1){if(_0x159450['joins'][_0x4243c3][_0x5029('0x2c')]&&_[_0x5029('0x5e')](_0x344203,_0x159450[_0x5029('0x74')][_0x4243c3]['type'])&&_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x76')]&&_0x159450[_0x5029('0x74')][_0x4243c3]['foreignTable']&&_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x78')]){_0x13e07e[_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x2c')]](_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x77')],null,util[_0x5029('0x6f')](_0x5029('0x79'),_0x159450[_0x5029('0x6b')],_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x76')],_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x77')],_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x78')]));}}}if(_0x159450[_0x5029('0x7a')]){_0x159450[_0x5029('0x7a')]=JSON[_0x5029('0x75')](_0x159450['conditions']);_0x13e07e[_0x5029('0x38')](_0x4007c8(_0x159450[_0x5029('0x7a')][_0x5029('0x7b')]));}_0x533ee2=_0x13e07e[_0x5029('0x7c')]();_0x13e07e[_0x5029('0x1b')](_0x202c51);_0x13e07e['offset'](0x0);return;}})[_0x5029('0x21')](function(){if(_0xe6ac28[_0x5029('0x8a')]===_0x5029('0x8b')){return null;}var _0xf7729c=_[_0x5029('0x3c')](_0xe6ac28,{'name':_0xe6ac28['fullPath']||_0xe6ac28[_0x5029('0x26')]||_0x159450[_0x5029('0x26')],'basename':_0x5e7f50,'savename':util[_0x5029('0x6f')](_0x5029('0x8c'),_0xe6ac28[_0x5029('0x26')]||_0x159450['name'],require(_0x5029('0x8d'))[_0x5029('0x8e')](0x4),_0xe6ac28[_0x5029('0x8a')]||_0x5029('0x8f')),'reportId':_0x159450['id'],'reportType':_0x5029('0x90')});return db[_0x5029('0x91')][_0x5029('0x46')](_0xf7729c,{'raw':!![]});})[_0x5029('0x21')](function(_0x4a7535){if(_0x159450['table']===_0x5029('0x92')){_0x533ee2[_0x5029('0x38')](_0x159450[_0x5029('0x6b')]+_0x5029('0x93'),_0xe6ac28[_0x5029('0x94')],_0xe6ac28['endDate']);}else{_0x533ee2[_0x5029('0x38')](_0x159450['table']+_0x5029('0x95'),_0xe6ac28[_0x5029('0x94')],_0xe6ac28[_0x5029('0x96')]);}if(_0x4a7535){logger[_0x5029('0x97')](_0x5029('0x98'),_0x533ee2[_0x5029('0x80')]());require('child_process')[_0x5029('0x99')](path[_0x5029('0x4f')](__dirname,'../../components/export/',_0x4a7535[_0x5029('0x8a')]),[_0x4a7535['id'],_0x533ee2[_0x5029('0x80')](),path['join'](__dirname,_0x5029('0x9a'),_0x4a7535['savename']),_0x5e7f50]);return _0x4a7535;}else{var _0x54c0f3=squel['select']();_0x54c0f3['from']('('+_0x533ee2[_0x5029('0x80')]()+')','countTable');_0x54c0f3[_0x5029('0x63')](_0x5029('0x9b'),'count');_0x533ee2[_0x5029('0x1b')](_0xe6ac28[_0x5029('0x1b')]||_0x202c51);_0x533ee2['offset'](_0xe6ac28[_0x5029('0x19')]||0x0);return dbH[_0x5029('0x7f')]['query'](_0x54c0f3[_0x5029('0x80')](),{'type':dbH[_0x5029('0x7f')]['QueryTypes'][_0x5029('0x9c')]})[_0x5029('0x21')](function(_0x17c755){if(!_0x17c755[_0x5029('0x33')]){_0x3e3150=0x0;}else{_0x3e3150=_0x17c755[0x0][_0x5029('0x1c')]||0x0;}return dbH[_0x5029('0x7f')]['query'](_0x533ee2[_0x5029('0x80')](),{'type':dbH['sequelize'][_0x5029('0x81')][_0x5029('0x9c')]});})[_0x5029('0x21')](function(_0x3ebe00){return{'rows':_0x3ebe00||[],'count':_0x3e3150};});}});}exports[_0x5029('0x9d')]=function(_0x2138cc,_0x331af8){return runReport(_0x2138cc[_0x5029('0x43')],_0x2138cc[_0x5029('0x2e')],_0x2138cc[_0x5029('0x44')])[_0x5029('0x21')](respondWithResult(_0x331af8,null))[_0x5029('0x41')](handleError(_0x331af8,null));};exports[_0x5029('0x9e')]=runReport;exports[_0x5029('0x2e')]=function(_0x9de076,_0x2ac88e){var _0x55ee4f=0xa;var _0x1fa9eb=[_0x5029('0x4f'),_0x5029('0x50'),_0x5029('0x51'),_0x5029('0x52')];var _0x405d47={'SUM':'SUM(%s)','COUNT':_0x5029('0x54'),'COUNT DISTINCT':_0x5029('0x82'),'MAX':_0x5029('0x9f'),'MIN':_0x5029('0x55'),'AVG':_0x5029('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x5029('0x58'),'GROUP_CONCAT DESC':_0x5029('0x83')};var _0x29c3a2={'SEC_TO_TIME':_0x5029('0x59'),'DATE':_0x5029('0x5a'),'HOUR':_0x5029('0x5b'),'ROUND':_0x5029('0x5c'),'UNIX_TIMESTAMP':_0x5029('0x5d')};var _0xb39e9d=function(_0x124c5e){return!_['includes']([_0x5029('0x5f'),'IS\x20NOT\x20NULL',_0x5029('0x84'),_0x5029('0x61')],_0x124c5e);};var _0x120acc=function(_0x21bb22){if(!_0x21bb22||!_0x21bb22['rules'][_0x5029('0x33')]){return'';}for(var _0x339112='(',_0x5d7c1a=0x0;_0x5d7c1a<_0x21bb22[_0x5029('0x62')][_0x5029('0x33')];_0x5d7c1a+=0x1){_0x5d7c1a>0x0&&(_0x339112+='\x20'+_0x21bb22['operator']+'\x20');_0x339112+=_0x21bb22[_0x5029('0x62')][_0x5d7c1a][_0x5029('0x7b')]?_0x120acc(_0x21bb22['rules'][_0x5d7c1a]['group']):_0x21bb22[_0x5029('0x62')][_0x5d7c1a]['field']+'\x20'+_0x21bb22['rules'][_0x5d7c1a][_0x5029('0x64')]+(_0xb39e9d(_0x21bb22['rules'][_0x5d7c1a][_0x5029('0x64')])?'\x20'+_0x21bb22[_0x5029('0x62')][_0x5d7c1a]['value']:'');}return _0x339112+')';};var _0x327299={'where':{'id':_0x9de076['params']['id']}},_0x3463cc,_0x590cc2,_0x3ac39a,_0x37c47b,_0x62e4af;_0x327299=_[_0x5029('0x3c')]({},_0x327299,_0x9de076['options']);return db[_0x5029('0x2a')][_0x5029('0x45')](_0x327299)[_0x5029('0x21')](function(_0x5e7ec8){if(_0x5e7ec8){_0x3463cc=_0x5e7ec8;return _0x5e7ec8[_0x5029('0x86')]();}return null;})[_0x5029('0x21')](function(_0x5aa480){if(_0x5aa480){if(!_0x5aa480[_0x5029('0x33')]){throw new db[(_0x5029('0x66'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x590cc2=_0x5aa480;return db[_0x5029('0x68')][_0x5029('0x87')]({'raw':!![]});}return null;})['then'](function(_0x5842a5){if(_0x5842a5){_0x3ac39a=_['keyBy'](_0x5842a5,'id');var _0x313bdb;var _0x1d38e0=squel[_0x5029('0x88')]();_0x1d38e0['from'](_0x3463cc[_0x5029('0x6b')]);for(var _0x581237=0x0;_0x581237<_0x590cc2[_0x5029('0x33')];_0x581237+=0x1){_0x313bdb=_0x590cc2[_0x581237]['MetricId']?_0x3ac39a[_0x590cc2[_0x581237]['MetricId']]['metric']:_0x590cc2[_0x581237]['field'];_0x313bdb=_0x590cc2[_0x581237][_0x5029('0x6e')]?_[_0x5029('0x89')](_0x405d47[_0x590cc2[_0x581237][_0x5029('0x6e')]],'%s',_0x313bdb):_0x313bdb;_0x313bdb=_0x590cc2[_0x581237][_0x5029('0x6f')]?_[_0x5029('0x89')](_0x29c3a2[_0x590cc2[_0x581237]['format']],'%s',_0x313bdb):_0x313bdb;if(_0x590cc2[_0x581237][_0x5029('0x70')]){_0x1d38e0[_0x5029('0x7b')](_0x313bdb);}_0x590cc2[_0x581237][_0x5029('0x71')]&&_0x1d38e0[_0x5029('0x36')](_0x313bdb,_0x590cc2[_0x581237][_0x5029('0x71')]===_0x5029('0x72')?![]:!![]);_0x1d38e0['field'](_0x313bdb,_0x590cc2[_0x581237][_0x5029('0x73')]||_0x313bdb);}if(_0x3463cc[_0x5029('0x74')]){_0x3463cc[_0x5029('0x74')]=JSON['parse'](_0x3463cc['joins']);for(var _0xd05bc9=0x0;_0xd05bc9<_0x3463cc[_0x5029('0x74')][_0x5029('0x33')];_0xd05bc9+=0x1){if(_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x2c')]&&_[_0x5029('0x5e')](_0x1fa9eb,_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x2c')])&&_0x3463cc['joins'][_0xd05bc9][_0x5029('0x76')]&&_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x77')]&&_0x3463cc['joins'][_0xd05bc9][_0x5029('0x78')]){_0x1d38e0[_0x3463cc['joins'][_0xd05bc9][_0x5029('0x2c')]](_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x77')],null,util[_0x5029('0x6f')](_0x5029('0x79'),_0x3463cc[_0x5029('0x6b')],_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x76')],_0x3463cc['joins'][_0xd05bc9]['foreignTable'],_0x3463cc['joins'][_0xd05bc9][_0x5029('0x78')]));}}}if(_0x3463cc[_0x5029('0x7a')]){_0x3463cc[_0x5029('0x7a')]=JSON[_0x5029('0x75')](_0x3463cc[_0x5029('0x7a')]);_0x1d38e0['where'](_0x120acc(_0x3463cc[_0x5029('0x7a')][_0x5029('0x7b')]));}_0x62e4af=_0x1d38e0[_0x5029('0x7c')]();_0x1d38e0[_0x5029('0x1b')](_0x55ee4f);_0x1d38e0[_0x5029('0x19')](0x0);logger['debug'](_0x5029('0x7e'),_0x1d38e0[_0x5029('0x80')]());return dbH[_0x5029('0x7f')][_0x5029('0x2e')](_0x1d38e0[_0x5029('0x80')](),{'type':dbH[_0x5029('0x7f')][_0x5029('0x81')][_0x5029('0x9c')]});}})[_0x5029('0x21')](function(){return{'sql':_0x62e4af[_0x5029('0x80')]()};})[_0x5029('0x21')](respondWithResult(_0x2ac88e,null))[_0x5029('0x41')](handleError(_0x2ac88e,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(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x6d38,0x1ef));var _0x86d3=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x6d38[_0x484e36];return _0xafc85d;};'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 bca4bab..913eb62 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 _0x24cb=['util','api','moment','bluebird','request-promise','path','../../config/environment','./analyticDefaultReport.attributes','exports','AnalyticDefaultReport','analytics_default_reports'];(function(_0x263fbe,_0x114996){var _0x2378c3=function(_0x45b3ef){while(--_0x45b3ef){_0x263fbe['push'](_0x263fbe['shift']());}};_0x2378c3(++_0x114996);}(_0x24cb,0x1ad));var _0xb24c=function(_0x55ff3e,_0x41077f){_0x55ff3e=_0x55ff3e-0x0;var _0x2709eb=_0x24cb[_0x55ff3e];return _0x2709eb;};'use strict';var _=require('lodash');var util=require(_0xb24c('0x0'));var logger=require('../../config/logger')(_0xb24c('0x1'));var moment=require(_0xb24c('0x2'));var BPromise=require(_0xb24c('0x3'));var rp=require(_0xb24c('0x4'));var fs=require('fs');var path=require(_0xb24c('0x5'));var rimraf=require('rimraf');var config=require(_0xb24c('0x6'));var attributes=require(_0xb24c('0x7'));module[_0xb24c('0x8')]=function(_0x22a50b,_0x40aaf7){return _0x22a50b['define'](_0xb24c('0x9'),attributes,{'tableName':_0xb24c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xda83=['./analyticDefaultReport.attributes','exports','AnalyticDefaultReport','analytics_default_reports','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x33b985,_0x4ac6e0){var _0x12f944=function(_0x307bac){while(--_0x307bac){_0x33b985['push'](_0x33b985['shift']());}};_0x12f944(++_0x4ac6e0);}(_0xda83,0x70));var _0x3da8=function(_0x2674ec,_0x58c37e){_0x2674ec=_0x2674ec-0x0;var _0x3845d5=_0xda83[_0x2674ec];return _0x3845d5;};'use strict';var _=require('lodash');var util=require(_0x3da8('0x0'));var logger=require(_0x3da8('0x1'))(_0x3da8('0x2'));var moment=require('moment');var BPromise=require(_0x3da8('0x3'));var rp=require(_0x3da8('0x4'));var fs=require('fs');var path=require(_0x3da8('0x5'));var rimraf=require(_0x3da8('0x6'));var config=require(_0x3da8('0x7'));var attributes=require(_0x3da8('0x8'));module[_0x3da8('0x9')]=function(_0x4c5000,_0xfc93f){return _0x4c5000['define'](_0x3da8('0xa'),attributes,{'tableName':_0x3da8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index 819546c..9a7bdae 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 _0x96f2=['rpc','jayson/promise','http','request','then','info','request\x20sent','stringify','error','message','AnalyticDefaultReport,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x37d3e0,_0x51d1f4){var _0x5512a3=function(_0x496e6b){while(--_0x496e6b){_0x37d3e0['push'](_0x37d3e0['shift']());}};_0x5512a3(++_0x51d1f4);}(_0x96f2,0x15d));var _0x296f=function(_0x24b1c8,_0xce9387){_0x24b1c8=_0x24b1c8-0x0;var _0x1a1419=_0x96f2[_0x24b1c8];return _0x1a1419;};'use strict';var _=require(_0x296f('0x0'));var util=require(_0x296f('0x1'));var moment=require(_0x296f('0x2'));var BPromise=require(_0x296f('0x3'));var rs=require(_0x296f('0x4'));var fs=require('fs');var Redis=require(_0x296f('0x5'));var db=require(_0x296f('0x6'))['db'];var utils=require(_0x296f('0x7'));var logger=require('../../config/logger')(_0x296f('0x8'));var config=require('../../config/environment');var jayson=require(_0x296f('0x9'));var client=jayson['client'][_0x296f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x443152,_0x2dd104,_0x51282c){return new BPromise(function(_0x460470,_0x577005){return client[_0x296f('0xb')](_0x443152,_0x51282c)[_0x296f('0xc')](function(_0x1aab71){logger[_0x296f('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x2dd104,_0x296f('0xe'));logger['debug']('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x2dd104,_0x296f('0xe'),JSON[_0x296f('0xf')](_0x1aab71));if(_0x1aab71[_0x296f('0x10')]){if(_0x1aab71[_0x296f('0x10')]['code']===0x1f4){logger[_0x296f('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x2dd104,_0x1aab71[_0x296f('0x10')][_0x296f('0x11')]);return _0x577005(_0x1aab71[_0x296f('0x10')][_0x296f('0x11')]);}logger[_0x296f('0x10')](_0x296f('0x12'),_0x2dd104,_0x1aab71[_0x296f('0x10')][_0x296f('0x11')]);return _0x460470(_0x1aab71[_0x296f('0x10')][_0x296f('0x11')]);}else{logger['info'](_0x296f('0x12'),_0x2dd104,_0x296f('0xe'));_0x460470(_0x1aab71[_0x296f('0x13')]['message']);}})[_0x296f('0x14')](function(_0x5141b4){logger['error'](_0x296f('0x12'),_0x2dd104,_0x5141b4);_0x577005(_0x5141b4);});});} \ No newline at end of file +var _0x44a3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment'];(function(_0x2163f6,_0x176963){var _0x577407=function(_0x329c0c){while(--_0x329c0c){_0x2163f6['push'](_0x2163f6['shift']());}};_0x577407(++_0x176963);}(_0x44a3,0x166));var _0x344a=function(_0xd4ae3f,_0x410d0f){_0xd4ae3f=_0xd4ae3f-0x0;var _0x52e69b=_0x44a3[_0xd4ae3f];return _0x52e69b;};'use strict';var _=require(_0x344a('0x0'));var util=require('util');var moment=require(_0x344a('0x1'));var BPromise=require(_0x344a('0x2'));var rs=require(_0x344a('0x3'));var fs=require('fs');var Redis=require(_0x344a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x344a('0x5'));var logger=require(_0x344a('0x6'))(_0x344a('0x7'));var config=require(_0x344a('0x8'));var jayson=require(_0x344a('0x9'));var client=jayson[_0x344a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x369c64,_0x14ff88,_0x51fbf9){return new BPromise(function(_0x2887ba,_0x47aa59){return client[_0x344a('0xb')](_0x369c64,_0x51fbf9)[_0x344a('0xc')](function(_0x7b7261){logger[_0x344a('0xd')](_0x344a('0xe'),_0x14ff88,_0x344a('0xf'));logger[_0x344a('0x10')](_0x344a('0x11'),_0x14ff88,_0x344a('0xf'),JSON[_0x344a('0x12')](_0x7b7261));if(_0x7b7261[_0x344a('0x13')]){if(_0x7b7261[_0x344a('0x13')][_0x344a('0x14')]===0x1f4){logger[_0x344a('0x13')](_0x344a('0xe'),_0x14ff88,_0x7b7261[_0x344a('0x13')][_0x344a('0x15')]);return _0x47aa59(_0x7b7261['error'][_0x344a('0x15')]);}logger[_0x344a('0x13')](_0x344a('0xe'),_0x14ff88,_0x7b7261['error'][_0x344a('0x15')]);return _0x2887ba(_0x7b7261[_0x344a('0x13')][_0x344a('0x15')]);}else{logger[_0x344a('0xd')](_0x344a('0xe'),_0x14ff88,_0x344a('0xf'));_0x2887ba(_0x7b7261[_0x344a('0x16')][_0x344a('0x15')]);}})[_0x344a('0x17')](function(_0x102cc8){logger[_0x344a('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x14ff88,_0x102cc8);_0x47aa59(_0x102cc8);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index dfb2712..fcdfa72 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 _0x5a45=['destroy','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','run','/:id/query','query','post','create','put','update','delete'];(function(_0x4bb2b9,_0x459c78){var _0x40e2a2=function(_0x19a26c){while(--_0x19a26c){_0x4bb2b9['push'](_0x4bb2b9['shift']());}};_0x40e2a2(++_0x459c78);}(_0x5a45,0x143));var _0x55a4=function(_0x5bfe8c,_0x930013){_0x5bfe8c=_0x5bfe8c-0x0;var _0x56f443=_0x5a45[_0x5bfe8c];return _0x56f443;};'use strict';var multer=require('multer');var util=require(_0x55a4('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x55a4('0x1'));var router=express[_0x55a4('0x2')]();var fs_extra=require(_0x55a4('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x55a4('0x4'));var config=require(_0x55a4('0x5'));var controller=require(_0x55a4('0x6'));router[_0x55a4('0x7')]('/',auth[_0x55a4('0x8')](),controller[_0x55a4('0x9')]);router['get'](_0x55a4('0xa'),auth[_0x55a4('0x8')](),controller[_0x55a4('0xb')]);router[_0x55a4('0x7')](_0x55a4('0xc'),auth[_0x55a4('0x8')](),controller[_0x55a4('0xd')]);router[_0x55a4('0x7')]('/:id/run',auth[_0x55a4('0x8')](),controller[_0x55a4('0xe')]);router[_0x55a4('0x7')](_0x55a4('0xf'),auth[_0x55a4('0x8')](),controller[_0x55a4('0x10')]);router[_0x55a4('0x11')]('/',auth[_0x55a4('0x8')](),controller[_0x55a4('0x12')]);router[_0x55a4('0x13')](_0x55a4('0xa'),auth['isAuthenticated'](),controller[_0x55a4('0x14')]);router[_0x55a4('0x15')](_0x55a4('0xa'),auth[_0x55a4('0x8')](),controller[_0x55a4('0x16')]);module['exports']=router; \ No newline at end of file +var _0x9258=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','/:id','isAuthenticated','show','preview','/:id/run','run','/:id/query','query','post','create','put','update','delete','destroy','exports'];(function(_0x2f904d,_0x3302b3){var _0x175c13=function(_0x43d876){while(--_0x43d876){_0x2f904d['push'](_0x2f904d['shift']());}};_0x175c13(++_0x3302b3);}(_0x9258,0x1a0));var _0x8925=function(_0x62d6fe,_0x5a27b2){_0x62d6fe=_0x62d6fe-0x0;var _0x1b00b8=_0x9258[_0x62d6fe];return _0x1b00b8;};'use strict';var multer=require(_0x8925('0x0'));var util=require(_0x8925('0x1'));var path=require(_0x8925('0x2'));var timeout=require(_0x8925('0x3'));var express=require(_0x8925('0x4'));var router=express['Router']();var fs_extra=require(_0x8925('0x5'));var auth=require(_0x8925('0x6'));var interaction=require(_0x8925('0x7'));var config=require(_0x8925('0x8'));var controller=require(_0x8925('0x9'));router[_0x8925('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8925('0xa')](_0x8925('0xb'),auth[_0x8925('0xc')](),controller[_0x8925('0xd')]);router['get']('/:id/preview',auth[_0x8925('0xc')](),controller[_0x8925('0xe')]);router[_0x8925('0xa')](_0x8925('0xf'),auth[_0x8925('0xc')](),controller[_0x8925('0x10')]);router[_0x8925('0xa')](_0x8925('0x11'),auth[_0x8925('0xc')](),controller[_0x8925('0x12')]);router[_0x8925('0x13')]('/',auth[_0x8925('0xc')](),controller[_0x8925('0x14')]);router[_0x8925('0x15')](_0x8925('0xb'),auth['isAuthenticated'](),controller[_0x8925('0x16')]);router[_0x8925('0x17')]('/:id',auth[_0x8925('0xc')](),controller[_0x8925('0x18')]);module[_0x8925('0x19')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index dcab5ac..8a14aa2 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 _0xedb8=['xlsx','csv','DATE','Loading','manual','scheduled','UNSIGNED','sequelize','moment','exports','STRING','ENUM','pdf'];(function(_0x1c7889,_0x24cd26){var _0x2f14e5=function(_0x9ae1b1){while(--_0x9ae1b1){_0x1c7889['push'](_0x1c7889['shift']());}};_0x2f14e5(++_0x24cd26);}(_0xedb8,0x1db));var _0x8edb=function(_0x1726e1,_0x1cc1f4){_0x1726e1=_0x1726e1-0x0;var _0x44eccc=_0xedb8[_0x1726e1];return _0x44eccc;};'use strict';var Sequelize=require(_0x8edb('0x0'));var moment=require(_0x8edb('0x1'));module[_0x8edb('0x2')]={'name':{'type':Sequelize[_0x8edb('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x8edb('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x8edb('0x4')]('csv',_0x8edb('0x5'),_0x8edb('0x6')),'allowNull':![],'defaultValue':_0x8edb('0x7')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x8edb('0x8')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x8edb('0x3')],'defaultValue':_0x8edb('0x9')},'type':{'type':Sequelize[_0x8edb('0x4')](_0x8edb('0xa'),_0x8edb('0xb')),'allowNull':![],'defaultValue':_0x8edb('0xa')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x8edb('0xc')]},'reportType':{'type':Sequelize[_0x8edb('0x3')]}}; \ No newline at end of file +var _0x5ce5=['exports','STRING','csv','pdf','xlsx','DATE','ENUM','manual','scheduled','UNSIGNED','moment'];(function(_0x1f37af,_0x238de4){var _0x243cad=function(_0x4e971f){while(--_0x4e971f){_0x1f37af['push'](_0x1f37af['shift']());}};_0x243cad(++_0x238de4);}(_0x5ce5,0x1cd));var _0x55ce=function(_0x564945,_0x5d97f7){_0x564945=_0x564945-0x0;var _0x224f00=_0x5ce5[_0x564945];return _0x224f00;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x55ce('0x0'));module[_0x55ce('0x1')]={'name':{'type':Sequelize[_0x55ce('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x55ce('0x2')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x55ce('0x3'),_0x55ce('0x4'),_0x55ce('0x5')),'allowNull':![],'defaultValue':_0x55ce('0x3')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x55ce('0x6')]},'endDate':{'type':Sequelize[_0x55ce('0x6')]},'status':{'type':Sequelize[_0x55ce('0x2')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x55ce('0x7')](_0x55ce('0x8'),_0x55ce('0x9')),'allowNull':![],'defaultValue':_0x55ce('0x8')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x55ce('0xa')]},'reportType':{'type':Sequelize[_0x55ce('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 7cd8fcc..f480949 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 _0xde88=['Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','savename','%s.%s','basename','output','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','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','status','end','undefined','limit','count','offset','set','json','apply','save','update','then','get','ExtractedReports','destroy','sendStatus','error','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','key','query','filters','intersection','model','fields','attributes','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','body','download','join','root','server/files/reports'];(function(_0xd341b,_0x3100ba){var _0x86bd5a=function(_0x325140){while(--_0x325140){_0xd341b['push'](_0xd341b['shift']());}};_0x86bd5a(++_0x3100ba);}(_0xde88,0x1e3));var _0x8de8=function(_0x54bac5,_0x8d3a16){_0x54bac5=_0x54bac5-0x0;var _0xc15971=_0xde88[_0x54bac5];return _0xc15971;};'use strict';var emlformat=require(_0x8de8('0x0'));var rimraf=require(_0x8de8('0x1'));var zipdir=require(_0x8de8('0x2'));var jsonpatch=require(_0x8de8('0x3'));var rp=require(_0x8de8('0x4'));var moment=require(_0x8de8('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8de8('0x6'));var util=require(_0x8de8('0x7'));var path=require(_0x8de8('0x8'));var sox=require(_0x8de8('0x9'));var csv=require(_0x8de8('0xa'));var ejs=require(_0x8de8('0xb'));var fs=require('fs');var fs_extra=require(_0x8de8('0xc'));var _=require(_0x8de8('0xd'));var squel=require(_0x8de8('0xe'));var crypto=require(_0x8de8('0xf'));var jsforce=require(_0x8de8('0x10'));var deskjs=require(_0x8de8('0x11'));var toCsv=require('to-csv');var querystring=require(_0x8de8('0x12'));var Papa=require('papaparse');var Redis=require(_0x8de8('0x13'));var authService=require(_0x8de8('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x8de8('0x15'));var hardwareService=require(_0x8de8('0x16'));var logger=require(_0x8de8('0x17'))(_0x8de8('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8de8('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4ad726,_0x205d6a){_0x205d6a=_0x205d6a||0xcc;return function(_0x1ecdf6){if(_0x1ecdf6){return _0x4ad726['sendStatus'](_0x205d6a);}return _0x4ad726[_0x8de8('0x1a')](_0x205d6a)[_0x8de8('0x1b')]();};}function respondWithResult(_0x1f52c1,_0x4b6ea2){_0x4b6ea2=_0x4b6ea2||0xc8;return function(_0x44227d){if(_0x44227d){return _0x1f52c1['status'](_0x4b6ea2)['json'](_0x44227d);}};}function respondWithFilteredResult(_0x915d5c,_0x40eddf){return function(_0x31d608){if(_0x31d608){var _0x419b0b=typeof _0x40eddf['offset']===_0x8de8('0x1c')&&typeof _0x40eddf[_0x8de8('0x1d')]===_0x8de8('0x1c');var _0x51dc72=_0x31d608[_0x8de8('0x1e')];var _0xd6f94a=_0x419b0b?0x0:_0x40eddf[_0x8de8('0x1f')];var _0xb986ab=_0x419b0b?_0x31d608[_0x8de8('0x1e')]:_0x40eddf['offset']+_0x40eddf[_0x8de8('0x1d')];var _0x1c0d94;if(_0xb986ab>=_0x51dc72){_0xb986ab=_0x51dc72;_0x1c0d94=0xc8;}else{_0x1c0d94=0xce;}_0x915d5c[_0x8de8('0x1a')](_0x1c0d94);return _0x915d5c[_0x8de8('0x20')]('Content-Range',_0xd6f94a+'-'+_0xb986ab+'/'+_0x51dc72)[_0x8de8('0x21')](_0x31d608);}return null;};}function patchUpdates(_0x2c3bc4){return function(_0x147792){try{jsonpatch[_0x8de8('0x22')](_0x147792,_0x2c3bc4,!![]);}catch(_0x4f1926){return BPromise['reject'](_0x4f1926);}return _0x147792[_0x8de8('0x23')]();};}function saveUpdates(_0x42fcce,_0x1eb477){return function(_0x2d150e){if(_0x2d150e){return _0x2d150e[_0x8de8('0x24')](_0x42fcce)[_0x8de8('0x25')](function(_0x3be0e7){return _0x3be0e7;});}return null;};}function removeEntity(_0x2adc40,_0x477988){return function(_0xb075e8){if(_0xb075e8){return _0xb075e8['destroy']()[_0x8de8('0x25')](function(){var _0x217cf8=_0xb075e8[_0x8de8('0x26')]({'plain':!![]});var _0x1b2dec=_0x8de8('0x27');return db['UserProfileResource'][_0x8de8('0x28')]({'where':{'type':_0x1b2dec,'resourceId':_0x217cf8['id']}})[_0x8de8('0x25')](function(){return _0xb075e8;});})['then'](function(){_0x2adc40[_0x8de8('0x1a')](0xcc)[_0x8de8('0x1b')]();});}};}function handleEntityNotFound(_0x29d8aa,_0x2a7eaf){return function(_0x747e22){if(!_0x747e22){_0x29d8aa[_0x8de8('0x29')](0x194);}return _0x747e22;};}function handleError(_0x4320d8,_0x5b778b){_0x5b778b=_0x5b778b||0x1f4;return function(_0xf5af7b){logger[_0x8de8('0x2a')](_0xf5af7b['stack']);if(_0xf5af7b[_0x8de8('0x2b')]){delete _0xf5af7b['name'];}_0x4320d8['status'](_0x5b778b)[_0x8de8('0x2c')](_0xf5af7b);};}exports[_0x8de8('0x2d')]=function(_0x25da65,_0x17905c){var _0x53cc26={},_0x31153d={},_0x5bbd90={'count':0x0,'rows':[]};var _0x4b08af=_[_0x8de8('0x2e')](db[_0x8de8('0x2f')][_0x8de8('0x30')],function(_0x40dd2c){return{'name':_0x40dd2c[_0x8de8('0x31')],'type':_0x40dd2c['type'][_0x8de8('0x32')]};});_0x31153d['model']=_['map'](_0x4b08af,_0x8de8('0x2b'));_0x31153d['query']=_['keys'](_0x25da65[_0x8de8('0x33')]);_0x31153d[_0x8de8('0x34')]=_[_0x8de8('0x35')](_0x31153d[_0x8de8('0x36')],_0x31153d[_0x8de8('0x33')]);_0x53cc26['attributes']=_['intersection'](_0x31153d['model'],qs[_0x8de8('0x37')](_0x25da65[_0x8de8('0x33')][_0x8de8('0x37')]));_0x53cc26[_0x8de8('0x38')]=_0x53cc26['attributes'][_0x8de8('0x39')]?_0x53cc26[_0x8de8('0x38')]:_0x31153d[_0x8de8('0x36')];if(!_0x25da65[_0x8de8('0x33')]['hasOwnProperty'](_0x8de8('0x3a'))){_0x53cc26[_0x8de8('0x1d')]=qs['limit'](_0x25da65[_0x8de8('0x33')][_0x8de8('0x1d')]);_0x53cc26[_0x8de8('0x1f')]=qs['offset'](_0x25da65[_0x8de8('0x33')][_0x8de8('0x1f')]);}_0x53cc26['order']=qs[_0x8de8('0x3b')](_0x25da65['query'][_0x8de8('0x3b')]);_0x53cc26[_0x8de8('0x3c')]=qs[_0x8de8('0x34')](_[_0x8de8('0x3d')](_0x25da65['query'],_0x31153d[_0x8de8('0x34')]),_0x4b08af);if(_0x25da65['query'][_0x8de8('0x3e')]){_0x53cc26[_0x8de8('0x3c')]=_['merge'](_0x53cc26['where'],{'$or':_[_0x8de8('0x2e')](_0x4b08af,function(_0xcfd118){if(_0xcfd118['type']!==_0x8de8('0x3f')){var _0x476664={};_0x476664[_0xcfd118[_0x8de8('0x2b')]]={'$like':'%'+_0x25da65['query'][_0x8de8('0x3e')]+'%'};return _0x476664;}})});}_0x53cc26=_[_0x8de8('0x40')]({},_0x53cc26,_0x25da65[_0x8de8('0x41')]);var _0x41e296={'where':_0x53cc26['where']};return db[_0x8de8('0x2f')][_0x8de8('0x1e')](_0x41e296)[_0x8de8('0x25')](function(_0x22b7c4){_0x5bbd90[_0x8de8('0x1e')]=_0x22b7c4;if(_0x25da65[_0x8de8('0x33')][_0x8de8('0x42')]){_0x53cc26[_0x8de8('0x43')]=[{'all':!![]}];}return db[_0x8de8('0x2f')][_0x8de8('0x44')](_0x53cc26);})[_0x8de8('0x25')](function(_0x16ac71){_0x5bbd90[_0x8de8('0x45')]=_0x16ac71;return _0x5bbd90;})[_0x8de8('0x25')](respondWithFilteredResult(_0x17905c,_0x53cc26))['catch'](handleError(_0x17905c,null));};exports[_0x8de8('0x46')]=function(_0x1e6c80,_0x4106b6){var _0x3a9de0={'raw':!![],'where':{'id':_0x1e6c80[_0x8de8('0x47')]['id']}},_0x2c3465={};_0x2c3465['model']=_['keys'](db['AnalyticExtractedReport']['rawAttributes']);_0x2c3465[_0x8de8('0x33')]=_[_0x8de8('0x48')](_0x1e6c80[_0x8de8('0x33')]);_0x2c3465['filters']=_[_0x8de8('0x35')](_0x2c3465['model'],_0x2c3465['query']);_0x3a9de0[_0x8de8('0x38')]=_[_0x8de8('0x35')](_0x2c3465[_0x8de8('0x36')],qs[_0x8de8('0x37')](_0x1e6c80[_0x8de8('0x33')][_0x8de8('0x37')]));_0x3a9de0[_0x8de8('0x38')]=_0x3a9de0[_0x8de8('0x38')][_0x8de8('0x39')]?_0x3a9de0['attributes']:_0x2c3465['model'];if(_0x1e6c80[_0x8de8('0x33')][_0x8de8('0x42')]){_0x3a9de0[_0x8de8('0x43')]=[{'all':!![]}];}_0x3a9de0=_['merge']({},_0x3a9de0,_0x1e6c80[_0x8de8('0x41')]);return db['AnalyticExtractedReport'][_0x8de8('0x49')](_0x3a9de0)[_0x8de8('0x25')](handleEntityNotFound(_0x4106b6,null))[_0x8de8('0x25')](respondWithResult(_0x4106b6,null))[_0x8de8('0x4a')](handleError(_0x4106b6,null));};exports['create']=function(_0x4fec72,_0x2d7eea){return db['AnalyticExtractedReport'][_0x8de8('0x4b')](_0x4fec72['body'],{})[_0x8de8('0x25')](function(_0xa2c45f){var _0x5b6650=_0x4fec72[_0x8de8('0x4c')][_0x8de8('0x26')]({'plain':!![]});if(!_0x5b6650)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5b6650[_0x8de8('0x4d')]===_0x8de8('0x4c')){var _0x4da1bc=_0xa2c45f[_0x8de8('0x26')]({'plain':!![]});var _0x269e09=_0x8de8('0x27');return db[_0x8de8('0x4e')][_0x8de8('0x49')]({'where':{'name':_0x269e09,'userProfileId':_0x5b6650[_0x8de8('0x4f')]},'raw':!![]})[_0x8de8('0x25')](function(_0x2f515f){if(_0x2f515f&&_0x2f515f[_0x8de8('0x50')]===0x0){return db[_0x8de8('0x51')]['create']({'name':_0x4da1bc[_0x8de8('0x2b')],'resourceId':_0x4da1bc['id'],'type':_0x2f515f[_0x8de8('0x2b')],'sectionId':_0x2f515f['id']},{})[_0x8de8('0x25')](function(){return _0xa2c45f;});}else{return _0xa2c45f;}})[_0x8de8('0x4a')](function(_0x400f50){logger[_0x8de8('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x400f50);throw _0x400f50;});}return _0xa2c45f;})[_0x8de8('0x25')](respondWithResult(_0x2d7eea,0xc9))[_0x8de8('0x4a')](handleError(_0x2d7eea,null));};exports['update']=function(_0x572c57,_0x40184e){if(_0x572c57[_0x8de8('0x52')]['id']){delete _0x572c57['body']['id'];}return db[_0x8de8('0x2f')][_0x8de8('0x49')]({'where':{'id':_0x572c57[_0x8de8('0x47')]['id']}})['then'](handleEntityNotFound(_0x40184e,null))[_0x8de8('0x25')](saveUpdates(_0x572c57[_0x8de8('0x52')],null))[_0x8de8('0x25')](respondWithResult(_0x40184e,null))[_0x8de8('0x4a')](handleError(_0x40184e,null));};exports[_0x8de8('0x28')]=function(_0x95d6b5,_0x5011b3){return db[_0x8de8('0x2f')][_0x8de8('0x49')]({'where':{'id':_0x95d6b5[_0x8de8('0x47')]['id']}})[_0x8de8('0x25')](handleEntityNotFound(_0x5011b3,null))[_0x8de8('0x25')](removeEntity(_0x5011b3,null))[_0x8de8('0x4a')](handleError(_0x5011b3,null));};exports[_0x8de8('0x53')]=function(_0xe9de92,_0xd2908d,_0x17c900){return db[_0x8de8('0x2f')][_0x8de8('0x49')]({'where':{'id':_0xe9de92[_0x8de8('0x47')]['id']},'attributes':[_0x8de8('0x2b'),'basename','savename','output'],'raw':!![]})['then'](handleEntityNotFound(_0xd2908d,null))[_0x8de8('0x25')](function(_0x5a60a8){if(_0x5a60a8){if(!fs['existsSync'](path[_0x8de8('0x54')](config[_0x8de8('0x55')],_0x8de8('0x56'),_0x5a60a8['savename']))){throw new db[(_0x8de8('0x57'))][(_0x8de8('0x58'))](_0x8de8('0x59'));}if(_0xe9de92[_0x8de8('0x33')][_0x8de8('0x5a')]){return _0xd2908d['sendStatus'](0xc8);}return _0xd2908d['download'](path[_0x8de8('0x54')](config[_0x8de8('0x55')],'server/files/reports',_0x5a60a8[_0x8de8('0x5b')]),util['format'](_0x8de8('0x5c'),_0x5a60a8[_0x8de8('0x5d')]||_0x5a60a8['name'],_0x5a60a8[_0x8de8('0x5e')]['toLowerCase']()));}})[_0x8de8('0x4a')](handleError(_0xd2908d,null));}; \ No newline at end of file +var _0x3124=['order','sort','filters','pick','filter','where','type','VIRTUAL','merge','options','AnalyticExtractedReport','includeAll','findAll','rows','params','include','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','find','download','basename','savename','output','existsSync','join','root','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','format','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','save','then','get','ExtractedReports','UserProfileResource','destroy','error','stack','name','index','map','fieldName','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0xe8c799,_0x2a176f){var _0x2695b3=function(_0x37c371){while(--_0x37c371){_0xe8c799['push'](_0xe8c799['shift']());}};_0x2695b3(++_0x2a176f);}(_0x3124,0x13e));var _0x4312=function(_0x15ea49,_0x4eff65){_0x15ea49=_0x15ea49-0x0;var _0x58e4d0=_0x3124[_0x15ea49];return _0x58e4d0;};'use strict';var emlformat=require(_0x4312('0x0'));var rimraf=require(_0x4312('0x1'));var zipdir=require(_0x4312('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4312('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4312('0x4'));var util=require(_0x4312('0x5'));var path=require(_0x4312('0x6'));var sox=require(_0x4312('0x7'));var csv=require(_0x4312('0x8'));var ejs=require(_0x4312('0x9'));var fs=require('fs');var fs_extra=require(_0x4312('0xa'));var _=require(_0x4312('0xb'));var squel=require(_0x4312('0xc'));var crypto=require(_0x4312('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4312('0xe'));var toCsv=require('to-csv');var querystring=require(_0x4312('0xf'));var Papa=require(_0x4312('0x10'));var Redis=require(_0x4312('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4312('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4312('0x13'))(_0x4312('0x14'));var utils=require(_0x4312('0x15'));var config=require(_0x4312('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3b12c8,_0x5b96f2){_0x5b96f2=_0x5b96f2||0xcc;return function(_0x3700aa){if(_0x3700aa){return _0x3b12c8[_0x4312('0x17')](_0x5b96f2);}return _0x3b12c8[_0x4312('0x18')](_0x5b96f2)[_0x4312('0x19')]();};}function respondWithResult(_0x2829e7,_0x1b7b91){_0x1b7b91=_0x1b7b91||0xc8;return function(_0x48cc6d){if(_0x48cc6d){return _0x2829e7[_0x4312('0x18')](_0x1b7b91)['json'](_0x48cc6d);}};}function respondWithFilteredResult(_0x37d402,_0x517e1f){return function(_0x44b74c){if(_0x44b74c){var _0x45a0ff=typeof _0x517e1f[_0x4312('0x1a')]===_0x4312('0x1b')&&typeof _0x517e1f['limit']===_0x4312('0x1b');var _0x4574d6=_0x44b74c['count'];var _0x137ba7=_0x45a0ff?0x0:_0x517e1f[_0x4312('0x1a')];var _0x17bd83=_0x45a0ff?_0x44b74c[_0x4312('0x1c')]:_0x517e1f[_0x4312('0x1a')]+_0x517e1f[_0x4312('0x1d')];var _0xb87959;if(_0x17bd83>=_0x4574d6){_0x17bd83=_0x4574d6;_0xb87959=0xc8;}else{_0xb87959=0xce;}_0x37d402[_0x4312('0x18')](_0xb87959);return _0x37d402[_0x4312('0x1e')](_0x4312('0x1f'),_0x137ba7+'-'+_0x17bd83+'/'+_0x4574d6)['json'](_0x44b74c);}return null;};}function patchUpdates(_0x2a1549){return function(_0x3c96bc){try{jsonpatch[_0x4312('0x20')](_0x3c96bc,_0x2a1549,!![]);}catch(_0x13fd11){return BPromise['reject'](_0x13fd11);}return _0x3c96bc[_0x4312('0x21')]();};}function saveUpdates(_0x403422,_0x5e6df4){return function(_0x46b4fb){if(_0x46b4fb){return _0x46b4fb['update'](_0x403422)[_0x4312('0x22')](function(_0x2d3b55){return _0x2d3b55;});}return null;};}function removeEntity(_0x30d22b,_0x23eb4a){return function(_0x407c74){if(_0x407c74){return _0x407c74['destroy']()['then'](function(){var _0x58b63b=_0x407c74[_0x4312('0x23')]({'plain':!![]});var _0xca89b=_0x4312('0x24');return db[_0x4312('0x25')][_0x4312('0x26')]({'where':{'type':_0xca89b,'resourceId':_0x58b63b['id']}})[_0x4312('0x22')](function(){return _0x407c74;});})['then'](function(){_0x30d22b[_0x4312('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b4db7,_0x374b18){return function(_0x7fe247){if(!_0x7fe247){_0x2b4db7[_0x4312('0x17')](0x194);}return _0x7fe247;};}function handleError(_0xa17345,_0x437478){_0x437478=_0x437478||0x1f4;return function(_0x349dbc){logger[_0x4312('0x27')](_0x349dbc[_0x4312('0x28')]);if(_0x349dbc[_0x4312('0x29')]){delete _0x349dbc[_0x4312('0x29')];}_0xa17345['status'](_0x437478)['send'](_0x349dbc);};}exports[_0x4312('0x2a')]=function(_0xaf42e9,_0x2c29d4){var _0x28775a={},_0x4c6116={},_0x1cb6cb={'count':0x0,'rows':[]};var _0x4a4c67=_[_0x4312('0x2b')](db['AnalyticExtractedReport']['rawAttributes'],function(_0x28965a){return{'name':_0x28965a[_0x4312('0x2c')],'type':_0x28965a['type']['key']};});_0x4c6116[_0x4312('0x2d')]=_[_0x4312('0x2b')](_0x4a4c67,'name');_0x4c6116[_0x4312('0x2e')]=_[_0x4312('0x2f')](_0xaf42e9[_0x4312('0x2e')]);_0x4c6116['filters']=_[_0x4312('0x30')](_0x4c6116[_0x4312('0x2d')],_0x4c6116[_0x4312('0x2e')]);_0x28775a[_0x4312('0x31')]=_['intersection'](_0x4c6116[_0x4312('0x2d')],qs[_0x4312('0x32')](_0xaf42e9[_0x4312('0x2e')][_0x4312('0x32')]));_0x28775a[_0x4312('0x31')]=_0x28775a[_0x4312('0x31')][_0x4312('0x33')]?_0x28775a[_0x4312('0x31')]:_0x4c6116['model'];if(!_0xaf42e9[_0x4312('0x2e')][_0x4312('0x34')](_0x4312('0x35'))){_0x28775a[_0x4312('0x1d')]=qs[_0x4312('0x1d')](_0xaf42e9[_0x4312('0x2e')][_0x4312('0x1d')]);_0x28775a[_0x4312('0x1a')]=qs['offset'](_0xaf42e9[_0x4312('0x2e')]['offset']);}_0x28775a[_0x4312('0x36')]=qs[_0x4312('0x37')](_0xaf42e9[_0x4312('0x2e')][_0x4312('0x37')]);_0x28775a['where']=qs[_0x4312('0x38')](_[_0x4312('0x39')](_0xaf42e9['query'],_0x4c6116[_0x4312('0x38')]),_0x4a4c67);if(_0xaf42e9[_0x4312('0x2e')][_0x4312('0x3a')]){_0x28775a[_0x4312('0x3b')]=_['merge'](_0x28775a['where'],{'$or':_[_0x4312('0x2b')](_0x4a4c67,function(_0x484217){if(_0x484217[_0x4312('0x3c')]!==_0x4312('0x3d')){var _0x1ec80e={};_0x1ec80e[_0x484217[_0x4312('0x29')]]={'$like':'%'+_0xaf42e9[_0x4312('0x2e')][_0x4312('0x3a')]+'%'};return _0x1ec80e;}})});}_0x28775a=_[_0x4312('0x3e')]({},_0x28775a,_0xaf42e9[_0x4312('0x3f')]);var _0x23716c={'where':_0x28775a[_0x4312('0x3b')]};return db[_0x4312('0x40')][_0x4312('0x1c')](_0x23716c)['then'](function(_0x4e1c32){_0x1cb6cb[_0x4312('0x1c')]=_0x4e1c32;if(_0xaf42e9[_0x4312('0x2e')][_0x4312('0x41')]){_0x28775a['include']=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x4312('0x42')](_0x28775a);})[_0x4312('0x22')](function(_0x1e73d8){_0x1cb6cb[_0x4312('0x43')]=_0x1e73d8;return _0x1cb6cb;})['then'](respondWithFilteredResult(_0x2c29d4,_0x28775a))['catch'](handleError(_0x2c29d4,null));};exports['show']=function(_0x455a9c,_0x2cc29e){var _0x111c36={'raw':!![],'where':{'id':_0x455a9c[_0x4312('0x44')]['id']}},_0x3733e7={};_0x3733e7[_0x4312('0x2d')]=_[_0x4312('0x2f')](db[_0x4312('0x40')]['rawAttributes']);_0x3733e7[_0x4312('0x2e')]=_[_0x4312('0x2f')](_0x455a9c[_0x4312('0x2e')]);_0x3733e7[_0x4312('0x38')]=_['intersection'](_0x3733e7['model'],_0x3733e7['query']);_0x111c36[_0x4312('0x31')]=_[_0x4312('0x30')](_0x3733e7[_0x4312('0x2d')],qs[_0x4312('0x32')](_0x455a9c[_0x4312('0x2e')][_0x4312('0x32')]));_0x111c36[_0x4312('0x31')]=_0x111c36[_0x4312('0x31')]['length']?_0x111c36[_0x4312('0x31')]:_0x3733e7[_0x4312('0x2d')];if(_0x455a9c[_0x4312('0x2e')][_0x4312('0x41')]){_0x111c36[_0x4312('0x45')]=[{'all':!![]}];}_0x111c36=_['merge']({},_0x111c36,_0x455a9c[_0x4312('0x3f')]);return db['AnalyticExtractedReport']['find'](_0x111c36)['then'](handleEntityNotFound(_0x2cc29e,null))[_0x4312('0x22')](respondWithResult(_0x2cc29e,null))[_0x4312('0x46')](handleError(_0x2cc29e,null));};exports['create']=function(_0x9196f0,_0x322d59){return db['AnalyticExtractedReport'][_0x4312('0x47')](_0x9196f0['body'],{})[_0x4312('0x22')](function(_0x3aa16d){var _0x3fec3a=_0x9196f0['user'][_0x4312('0x23')]({'plain':!![]});if(!_0x3fec3a)throw new Error(_0x4312('0x48'));if(_0x3fec3a[_0x4312('0x49')]===_0x4312('0x4a')){var _0x2acbfe=_0x3aa16d[_0x4312('0x23')]({'plain':!![]});var _0x296762='ExtractedReports';return db[_0x4312('0x4b')]['find']({'where':{'name':_0x296762,'userProfileId':_0x3fec3a[_0x4312('0x4c')]},'raw':!![]})['then'](function(_0x5282f7){if(_0x5282f7&&_0x5282f7[_0x4312('0x4d')]===0x0){return db[_0x4312('0x25')][_0x4312('0x47')]({'name':_0x2acbfe[_0x4312('0x29')],'resourceId':_0x2acbfe['id'],'type':_0x5282f7[_0x4312('0x29')],'sectionId':_0x5282f7['id']},{})[_0x4312('0x22')](function(){return _0x3aa16d;});}else{return _0x3aa16d;}})[_0x4312('0x46')](function(_0x266245){logger['error'](_0x4312('0x4e'),_0x266245);throw _0x266245;});}return _0x3aa16d;})[_0x4312('0x22')](respondWithResult(_0x322d59,0xc9))['catch'](handleError(_0x322d59,null));};exports[_0x4312('0x4f')]=function(_0x4f991d,_0x4dc8f4){if(_0x4f991d[_0x4312('0x50')]['id']){delete _0x4f991d[_0x4312('0x50')]['id'];}return db[_0x4312('0x40')][_0x4312('0x51')]({'where':{'id':_0x4f991d[_0x4312('0x44')]['id']}})[_0x4312('0x22')](handleEntityNotFound(_0x4dc8f4,null))['then'](saveUpdates(_0x4f991d[_0x4312('0x50')],null))['then'](respondWithResult(_0x4dc8f4,null))[_0x4312('0x46')](handleError(_0x4dc8f4,null));};exports[_0x4312('0x26')]=function(_0x5e3622,_0x68d1ee){return db[_0x4312('0x40')][_0x4312('0x51')]({'where':{'id':_0x5e3622[_0x4312('0x44')]['id']}})['then'](handleEntityNotFound(_0x68d1ee,null))[_0x4312('0x22')](removeEntity(_0x68d1ee,null))[_0x4312('0x46')](handleError(_0x68d1ee,null));};exports[_0x4312('0x52')]=function(_0x12f9e5,_0x485bc9,_0x1e353c){return db[_0x4312('0x40')]['find']({'where':{'id':_0x12f9e5[_0x4312('0x44')]['id']},'attributes':['name',_0x4312('0x53'),_0x4312('0x54'),_0x4312('0x55')],'raw':!![]})[_0x4312('0x22')](handleEntityNotFound(_0x485bc9,null))[_0x4312('0x22')](function(_0x583699){if(_0x583699){if(!fs[_0x4312('0x56')](path[_0x4312('0x57')](config[_0x4312('0x58')],_0x4312('0x59'),_0x583699[_0x4312('0x54')]))){throw new db['Sequelize'][(_0x4312('0x5a'))](_0x4312('0x5b'));}if(_0x12f9e5['query']['exists']){return _0x485bc9[_0x4312('0x17')](0xc8);}return _0x485bc9[_0x4312('0x52')](path[_0x4312('0x57')](config[_0x4312('0x58')],'server/files/reports',_0x583699['savename']),util[_0x4312('0x5c')]('%s.%s',_0x583699['basename']||_0x583699['name'],_0x583699[_0x4312('0x55')]['toLowerCase']()));}})[_0x4312('0x46')](handleError(_0x485bc9,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index cb09877..a2cf7c4 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 _0xa01b=['../../config/logger','api','path','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util'];(function(_0x5a30fb,_0x206270){var _0x3b86aa=function(_0x67ea17){while(--_0x67ea17){_0x5a30fb['push'](_0x5a30fb['shift']());}};_0x3b86aa(++_0x206270);}(_0xa01b,0x1ca));var _0xba01=function(_0x3d5f84,_0x6201a5){_0x3d5f84=_0x3d5f84-0x0;var _0x56b6c1=_0xa01b[_0x3d5f84];return _0x56b6c1;};'use strict';var _=require(_0xba01('0x0'));var util=require(_0xba01('0x1'));var logger=require(_0xba01('0x2'))(_0xba01('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xba01('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xba01('0x5'));module[_0xba01('0x6')]=function(_0x2d4cdc,_0x457b62){return _0x2d4cdc[_0xba01('0x7')](_0xba01('0x8'),attributes,{'tableName':_0xba01('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbd1f=['analytics_extracted_reports','lodash','util','api','moment','bluebird','path','./analyticExtractedReport.attributes','exports','AnalyticExtractedReport'];(function(_0x1fee29,_0x1aa1b5){var _0x2d2c2b=function(_0x1db2d2){while(--_0x1db2d2){_0x1fee29['push'](_0x1fee29['shift']());}};_0x2d2c2b(++_0x1aa1b5);}(_0xbd1f,0xb5));var _0xfbd1=function(_0x29d6f1,_0x4465c0){_0x29d6f1=_0x29d6f1-0x0;var _0x3cd8b8=_0xbd1f[_0x29d6f1];return _0x3cd8b8;};'use strict';var _=require(_0xfbd1('0x0'));var util=require(_0xfbd1('0x1'));var logger=require('../../config/logger')(_0xfbd1('0x2'));var moment=require(_0xfbd1('0x3'));var BPromise=require(_0xfbd1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfbd1('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xfbd1('0x6'));module[_0xfbd1('0x7')]=function(_0x378055,_0x3ee268){return _0x378055['define'](_0xfbd1('0x8'),attributes,{'tableName':_0xfbd1('0x9'),'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 3070c7c..42f537b 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 _0x54bb=['info','request\x20sent','debug','stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x54bb,0xb2));var _0xb54b=function(_0x20c290,_0x47e736){_0x20c290=_0x20c290-0x0;var _0x3d7b3b=_0x54bb[_0x20c290];return _0x3d7b3b;};'use strict';var _=require(_0xb54b('0x0'));var util=require(_0xb54b('0x1'));var moment=require(_0xb54b('0x2'));var BPromise=require(_0xb54b('0x3'));var rs=require(_0xb54b('0x4'));var fs=require('fs');var Redis=require(_0xb54b('0x5'));var db=require(_0xb54b('0x6'))['db'];var utils=require(_0xb54b('0x7'));var logger=require(_0xb54b('0x8'))('rpc');var config=require(_0xb54b('0x9'));var jayson=require(_0xb54b('0xa'));var client=jayson[_0xb54b('0xb')][_0xb54b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2e06a2,_0x523e87,_0x13e3b0){return new BPromise(function(_0x4dc3e9,_0x56de1f){return client['request'](_0x2e06a2,_0x13e3b0)[_0xb54b('0xd')](function(_0x3a075d){logger[_0xb54b('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x523e87,_0xb54b('0xf'));logger[_0xb54b('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x523e87,_0xb54b('0xf'),JSON[_0xb54b('0x11')](_0x3a075d));if(_0x3a075d['error']){if(_0x3a075d[_0xb54b('0x12')][_0xb54b('0x13')]===0x1f4){logger[_0xb54b('0x12')](_0xb54b('0x14'),_0x523e87,_0x3a075d[_0xb54b('0x12')]['message']);return _0x56de1f(_0x3a075d[_0xb54b('0x12')][_0xb54b('0x15')]);}logger[_0xb54b('0x12')](_0xb54b('0x14'),_0x523e87,_0x3a075d[_0xb54b('0x12')][_0xb54b('0x15')]);return _0x4dc3e9(_0x3a075d[_0xb54b('0x12')][_0xb54b('0x15')]);}else{logger[_0xb54b('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x523e87,'request\x20sent');_0x4dc3e9(_0x3a075d[_0xb54b('0x16')][_0xb54b('0x15')]);}})[_0xb54b('0x17')](function(_0x59e75f){logger[_0xb54b('0x12')](_0xb54b('0x14'),_0x523e87,_0x59e75f);_0x56de1f(_0x59e75f);});});} \ No newline at end of file +var _0xb2af=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xb2af,0xd2));var _0xfb2a=function(_0x430b76,_0x4f73b7){_0x430b76=_0x430b76-0x0;var _0x4dad15=_0xb2af[_0x430b76];return _0x4dad15;};'use strict';var _=require(_0xfb2a('0x0'));var util=require(_0xfb2a('0x1'));var moment=require(_0xfb2a('0x2'));var BPromise=require(_0xfb2a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfb2a('0x4'));var db=require(_0xfb2a('0x5'))['db'];var utils=require(_0xfb2a('0x6'));var logger=require(_0xfb2a('0x7'))(_0xfb2a('0x8'));var config=require('../../config/environment');var jayson=require(_0xfb2a('0x9'));var client=jayson[_0xfb2a('0xa')][_0xfb2a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x55cf25,_0x715404,_0x3e20de){return new BPromise(function(_0x1f3315,_0x55bb4e){return client[_0xfb2a('0xc')](_0x55cf25,_0x3e20de)[_0xfb2a('0xd')](function(_0x3d3333){logger[_0xfb2a('0xe')](_0xfb2a('0xf'),_0x715404,_0xfb2a('0x10'));logger[_0xfb2a('0x11')](_0xfb2a('0x12'),_0x715404,_0xfb2a('0x10'),JSON[_0xfb2a('0x13')](_0x3d3333));if(_0x3d3333[_0xfb2a('0x14')]){if(_0x3d3333[_0xfb2a('0x14')]['code']===0x1f4){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x715404,_0x3d3333[_0xfb2a('0x14')][_0xfb2a('0x15')]);return _0x55bb4e(_0x3d3333[_0xfb2a('0x14')][_0xfb2a('0x15')]);}logger['error'](_0xfb2a('0xf'),_0x715404,_0x3d3333['error']['message']);return _0x1f3315(_0x3d3333[_0xfb2a('0x14')]['message']);}else{logger['info'](_0xfb2a('0xf'),_0x715404,_0xfb2a('0x10'));_0x1f3315(_0x3d3333[_0xfb2a('0x16')][_0xfb2a('0x15')]);}})[_0xfb2a('0x17')](function(_0xc85abf){logger[_0xfb2a('0x14')](_0xfb2a('0xf'),_0x715404,_0xc85abf);_0x55bb4e(_0xc85abf);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 1ae6754..e1014dd 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 _0xcdf7=['fs-extra','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','/:id','/:id/download','download','post','create','put','update','delete','multer','util','connect-timeout','express','Router'];(function(_0x3b037b,_0x1be37a){var _0x4ece31=function(_0x229ef3){while(--_0x229ef3){_0x3b037b['push'](_0x3b037b['shift']());}};_0x4ece31(++_0x1be37a);}(_0xcdf7,0xf2));var _0x7cdf=function(_0x18ed30,_0x530c12){_0x18ed30=_0x18ed30-0x0;var _0x42bdd5=_0xcdf7[_0x18ed30];return _0x42bdd5;};'use strict';var multer=require(_0x7cdf('0x0'));var util=require(_0x7cdf('0x1'));var path=require('path');var timeout=require(_0x7cdf('0x2'));var express=require(_0x7cdf('0x3'));var router=express[_0x7cdf('0x4')]();var fs_extra=require(_0x7cdf('0x5'));var auth=require(_0x7cdf('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7cdf('0x7'));var controller=require(_0x7cdf('0x8'));router[_0x7cdf('0x9')]('/',auth[_0x7cdf('0xa')](),controller['index']);router[_0x7cdf('0x9')](_0x7cdf('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x7cdf('0x9')](_0x7cdf('0xc'),auth[_0x7cdf('0xa')](),controller[_0x7cdf('0xd')]);router[_0x7cdf('0xe')]('/',auth[_0x7cdf('0xa')](),controller[_0x7cdf('0xf')]);router[_0x7cdf('0x10')](_0x7cdf('0xb'),auth[_0x7cdf('0xa')](),controller[_0x7cdf('0x11')]);router[_0x7cdf('0x12')](_0x7cdf('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x9e58=['express','Router','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','get','index','show','/:id/download','isAuthenticated','create','put','/:id','update','delete','multer','path','connect-timeout'];(function(_0x2e0dfa,_0x3f6cf3){var _0x781fe=function(_0x48be6e){while(--_0x48be6e){_0x2e0dfa['push'](_0x2e0dfa['shift']());}};_0x781fe(++_0x3f6cf3);}(_0x9e58,0x11d));var _0x89e5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9e58[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x89e5('0x0'));var util=require('util');var path=require(_0x89e5('0x1'));var timeout=require(_0x89e5('0x2'));var express=require(_0x89e5('0x3'));var router=express[_0x89e5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x89e5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x89e5('0x6'));var controller=require(_0x89e5('0x7'));router[_0x89e5('0x8')]('/',auth['isAuthenticated'](),controller[_0x89e5('0x9')]);router[_0x89e5('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x89e5('0xa')]);router[_0x89e5('0x8')](_0x89e5('0xb'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0x89e5('0xc')](),controller[_0x89e5('0xd')]);router[_0x89e5('0xe')](_0x89e5('0xf'),auth['isAuthenticated'](),controller[_0x89e5('0x10')]);router[_0x89e5('0x11')]('/:id',auth[_0x89e5('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 0c46c0d..10ec583 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 _0xde20=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x4098c4,_0x329d52){var _0x7d233c=function(_0x182ed0){while(--_0x182ed0){_0x4098c4['push'](_0x4098c4['shift']());}};_0x7d233c(++_0x329d52);}(_0xde20,0x1f3));var _0x0de2=function(_0x1dfbd9,_0x5a52f5){_0x1dfbd9=_0x1dfbd9-0x0;var _0x5ad355=_0xde20[_0x1dfbd9];return _0x5ad355;};'use strict';var Sequelize=require(_0x0de2('0x0'));module[_0x0de2('0x1')]={'field':{'type':Sequelize[_0x0de2('0x2')]},'alias':{'type':Sequelize[_0x0de2('0x3')]},'function':{'type':Sequelize[_0x0de2('0x3')]},'format':{'type':Sequelize[_0x0de2('0x3')]},'groupBy':{'type':Sequelize[_0x0de2('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x0de2('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x6516=['TEXT','STRING','BOOLEAN','sequelize'];(function(_0x22218b,_0x53d871){var _0x14e54b=function(_0x207a76){while(--_0x207a76){_0x22218b['push'](_0x22218b['shift']());}};_0x14e54b(++_0x53d871);}(_0x6516,0xcf));var _0x6651=function(_0x46f385,_0x4e9de2){_0x46f385=_0x46f385-0x0;var _0x27b7fc=_0x6516[_0x46f385];return _0x27b7fc;};'use strict';var Sequelize=require(_0x6651('0x0'));module['exports']={'field':{'type':Sequelize[_0x6651('0x1')]},'alias':{'type':Sequelize[_0x6651('0x2')]},'function':{'type':Sequelize[_0x6651('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x6651('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x6651('0x2')]},'custom':{'type':Sequelize[_0x6651('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 a284751..f1c193d 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 _0x30af=['rows','catch','show','params','find','create','body','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','CustomReportId','bulkCreate','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','send','index','map','AnalyticFieldReport','rawAttributes','type','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x30af,0x102));var _0xf30a=function(_0x24e91e,_0x38b947){_0x24e91e=_0x24e91e-0x0;var _0x51252c=_0x30af[_0x24e91e];return _0x51252c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf30a('0x0'));var rp=require(_0xf30a('0x1'));var moment=require(_0xf30a('0x2'));var BPromise=require(_0xf30a('0x3'));var Mustache=require('mustache');var util=require(_0xf30a('0x4'));var path=require(_0xf30a('0x5'));var sox=require(_0xf30a('0x6'));var csv=require(_0xf30a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf30a('0x8'));var _=require(_0xf30a('0x9'));var squel=require(_0xf30a('0xa'));var crypto=require(_0xf30a('0xb'));var jsforce=require(_0xf30a('0xc'));var deskjs=require(_0xf30a('0xd'));var toCsv=require(_0xf30a('0x7'));var querystring=require(_0xf30a('0xe'));var Papa=require('papaparse');var Redis=require(_0xf30a('0xf'));var authService=require(_0xf30a('0x10'));var qs=require(_0xf30a('0x11'));var as=require(_0xf30a('0x12'));var hardwareService=require(_0xf30a('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xf30a('0x14'));var config=require(_0xf30a('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x557735,_0x3c2f43){_0x3c2f43=_0x3c2f43||0xcc;return function(_0x3f3832){if(_0x3f3832){return _0x557735[_0xf30a('0x16')](_0x3c2f43);}return _0x557735[_0xf30a('0x17')](_0x3c2f43)[_0xf30a('0x18')]();};}function respondWithResult(_0x93754d,_0x3d8439){_0x3d8439=_0x3d8439||0xc8;return function(_0x11161b){if(_0x11161b){return _0x93754d['status'](_0x3d8439)[_0xf30a('0x19')](_0x11161b);}};}function respondWithFilteredResult(_0x29323f,_0x1886d5){return function(_0x42806a){if(_0x42806a){var _0x236ab0=typeof _0x1886d5[_0xf30a('0x1a')]===_0xf30a('0x1b')&&typeof _0x1886d5[_0xf30a('0x1c')]===_0xf30a('0x1b');var _0x119e56=_0x42806a[_0xf30a('0x1d')];var _0x5b8a4b=_0x236ab0?0x0:_0x1886d5[_0xf30a('0x1a')];var _0x4e1a09=_0x236ab0?_0x42806a[_0xf30a('0x1d')]:_0x1886d5[_0xf30a('0x1a')]+_0x1886d5[_0xf30a('0x1c')];var _0x5b2178;if(_0x4e1a09>=_0x119e56){_0x4e1a09=_0x119e56;_0x5b2178=0xc8;}else{_0x5b2178=0xce;}_0x29323f[_0xf30a('0x17')](_0x5b2178);return _0x29323f[_0xf30a('0x1e')](_0xf30a('0x1f'),_0x5b8a4b+'-'+_0x4e1a09+'/'+_0x119e56)[_0xf30a('0x19')](_0x42806a);}return null;};}function patchUpdates(_0x396935){return function(_0x2fc04f){try{jsonpatch[_0xf30a('0x20')](_0x2fc04f,_0x396935,!![]);}catch(_0x4d6305){return BPromise[_0xf30a('0x21')](_0x4d6305);}return _0x2fc04f[_0xf30a('0x22')]();};}function saveUpdates(_0x5845c1,_0x371b03){return function(_0x1e8928){if(_0x1e8928){return _0x1e8928[_0xf30a('0x23')](_0x5845c1)[_0xf30a('0x24')](function(_0x28fe59){return _0x28fe59;});}return null;};}function removeEntity(_0x4fe5b7,_0x5e185a){return function(_0x3b7f56){if(_0x3b7f56){return _0x3b7f56[_0xf30a('0x25')]()[_0xf30a('0x24')](function(){_0x4fe5b7[_0xf30a('0x17')](0xcc)[_0xf30a('0x18')]();});}};}function handleEntityNotFound(_0x4f5f1b,_0x2957ab){return function(_0x431e68){if(!_0x431e68){_0x4f5f1b[_0xf30a('0x16')](0x194);}return _0x431e68;};}function handleError(_0x29066d,_0x51abfb){_0x51abfb=_0x51abfb||0x1f4;return function(_0x4b425f){logger[_0xf30a('0x26')](_0x4b425f['stack']);if(_0x4b425f['name']){delete _0x4b425f['name'];}_0x29066d['status'](_0x51abfb)[_0xf30a('0x27')](_0x4b425f);};}exports[_0xf30a('0x28')]=function(_0x459940,_0x354b07){var _0xc293ed={},_0x5b2846={},_0x45c883={'count':0x0,'rows':[]};var _0x42bc08=_[_0xf30a('0x29')](db[_0xf30a('0x2a')][_0xf30a('0x2b')],function(_0x335335){return{'name':_0x335335['fieldName'],'type':_0x335335[_0xf30a('0x2c')]['key']};});_0x5b2846[_0xf30a('0x2d')]=_[_0xf30a('0x29')](_0x42bc08,_0xf30a('0x2e'));_0x5b2846[_0xf30a('0x2f')]=_[_0xf30a('0x30')](_0x459940[_0xf30a('0x2f')]);_0x5b2846[_0xf30a('0x31')]=_[_0xf30a('0x32')](_0x5b2846[_0xf30a('0x2d')],_0x5b2846[_0xf30a('0x2f')]);_0xc293ed[_0xf30a('0x33')]=_['intersection'](_0x5b2846[_0xf30a('0x2d')],qs['fields'](_0x459940[_0xf30a('0x2f')][_0xf30a('0x34')]));_0xc293ed[_0xf30a('0x33')]=_0xc293ed[_0xf30a('0x33')][_0xf30a('0x35')]?_0xc293ed[_0xf30a('0x33')]:_0x5b2846[_0xf30a('0x2d')];if(!_0x459940[_0xf30a('0x2f')][_0xf30a('0x36')](_0xf30a('0x37'))){_0xc293ed[_0xf30a('0x1c')]=qs[_0xf30a('0x1c')](_0x459940[_0xf30a('0x2f')][_0xf30a('0x1c')]);_0xc293ed[_0xf30a('0x1a')]=qs[_0xf30a('0x1a')](_0x459940['query']['offset']);}_0xc293ed['order']=qs[_0xf30a('0x38')](_0x459940[_0xf30a('0x2f')]['sort']);_0xc293ed['where']=qs['filters'](_[_0xf30a('0x39')](_0x459940[_0xf30a('0x2f')],_0x5b2846[_0xf30a('0x31')]),_0x42bc08);if(_0x459940['query'][_0xf30a('0x3a')]){_0xc293ed[_0xf30a('0x3b')]=_[_0xf30a('0x3c')](_0xc293ed[_0xf30a('0x3b')],{'$or':_[_0xf30a('0x29')](_0x42bc08,function(_0x2f3814){if(_0x2f3814[_0xf30a('0x2c')]!==_0xf30a('0x3d')){var _0x3c32ea={};_0x3c32ea[_0x2f3814['name']]={'$like':'%'+_0x459940['query'][_0xf30a('0x3a')]+'%'};return _0x3c32ea;}})});}_0xc293ed=_[_0xf30a('0x3c')]({},_0xc293ed,_0x459940[_0xf30a('0x3e')]);var _0x5cf0a7={'where':_0xc293ed[_0xf30a('0x3b')]};return db[_0xf30a('0x2a')][_0xf30a('0x1d')](_0x5cf0a7)['then'](function(_0xfd5fe3){_0x45c883['count']=_0xfd5fe3;if(_0x459940[_0xf30a('0x2f')][_0xf30a('0x3f')]){_0xc293ed[_0xf30a('0x40')]=[{'all':!![]}];}return db[_0xf30a('0x2a')][_0xf30a('0x41')](_0xc293ed);})[_0xf30a('0x24')](function(_0x489892){_0x45c883[_0xf30a('0x42')]=_0x489892;return _0x45c883;})[_0xf30a('0x24')](respondWithFilteredResult(_0x354b07,_0xc293ed))[_0xf30a('0x43')](handleError(_0x354b07,null));};exports[_0xf30a('0x44')]=function(_0x435157,_0x19e963){var _0x35469c={'raw':![],'where':{'id':_0x435157[_0xf30a('0x45')]['id']}},_0x119477={};_0x119477[_0xf30a('0x2d')]=_[_0xf30a('0x30')](db['AnalyticFieldReport'][_0xf30a('0x2b')]);_0x119477[_0xf30a('0x2f')]=_['keys'](_0x435157[_0xf30a('0x2f')]);_0x119477[_0xf30a('0x31')]=_[_0xf30a('0x32')](_0x119477[_0xf30a('0x2d')],_0x119477[_0xf30a('0x2f')]);_0x35469c[_0xf30a('0x33')]=_[_0xf30a('0x32')](_0x119477['model'],qs[_0xf30a('0x34')](_0x435157['query']['fields']));_0x35469c[_0xf30a('0x33')]=_0x35469c[_0xf30a('0x33')][_0xf30a('0x35')]?_0x35469c[_0xf30a('0x33')]:_0x119477[_0xf30a('0x2d')];if(_0x435157['query'][_0xf30a('0x3f')]){_0x35469c[_0xf30a('0x40')]=[{'all':!![]}];}_0x35469c=_[_0xf30a('0x3c')]({},_0x35469c,_0x435157[_0xf30a('0x3e')]);return db['AnalyticFieldReport'][_0xf30a('0x46')](_0x35469c)[_0xf30a('0x24')](handleEntityNotFound(_0x19e963,null))['then'](respondWithResult(_0x19e963,null))[_0xf30a('0x43')](handleError(_0x19e963,null));};exports[_0xf30a('0x47')]=function(_0x32ed63,_0x117254){return db[_0xf30a('0x2a')][_0xf30a('0x47')](_0x32ed63[_0xf30a('0x48')],{})[_0xf30a('0x24')](respondWithResult(_0x117254,0xc9))[_0xf30a('0x43')](handleError(_0x117254,null));};exports['bulkCreate']=function(_0x1af356,_0x41a2d0){return db[_0xf30a('0x2a')]['bulkCreate'](_0x1af356[_0xf30a('0x48')],{'raw':![],'individualHooks':!![]})[_0xf30a('0x24')](respondWithResult(_0x41a2d0,0xc9))[_0xf30a('0x43')](handleError(_0x41a2d0,null));};exports[_0xf30a('0x23')]=function(_0x486441,_0x171624){if(_0x486441[_0xf30a('0x48')]['id']){delete _0x486441[_0xf30a('0x48')]['id'];}return db[_0xf30a('0x2a')][_0xf30a('0x46')]({'where':{'id':_0x486441[_0xf30a('0x45')]['id']}})[_0xf30a('0x24')](handleEntityNotFound(_0x171624,null))[_0xf30a('0x24')](saveUpdates(_0x486441[_0xf30a('0x48')],null))['then'](respondWithResult(_0x171624,null))[_0xf30a('0x43')](handleError(_0x171624,null));};exports[_0xf30a('0x25')]=function(_0x3a80de,_0x79ab9a){return db[_0xf30a('0x2a')]['find']({'where':{'id':_0x3a80de['params']['id']}})[_0xf30a('0x24')](handleEntityNotFound(_0x79ab9a,null))[_0xf30a('0x24')](removeEntity(_0x79ab9a,null))[_0xf30a('0x43')](handleError(_0x79ab9a,null));};exports[_0xf30a('0x49')]=function(_0xd4e359,_0x4a7602){return db['AnalyticFieldReport']['destroy']({'where':{'id':_0xd4e359[_0xf30a('0x2f')][_0xf30a('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0xf30a('0x24')](respondWithResult(_0x4a7602,0xcc))[_0xf30a('0x43')](handleError(_0x4a7602,null));};exports[_0xf30a('0x4b')]=function(_0x45d2df,_0x7992ce,_0x52f50d){return db[_0xf30a('0x4c')][_0xf30a('0x4d')]({'where':{'id':_0x45d2df[_0xf30a('0x45')]['id']}})[_0xf30a('0x24')](handleEntityNotFound(_0x7992ce,null))['then'](function(_0x4190a7){if(_0x4190a7){return db[_0xf30a('0x4e')]['transaction'](function(_0x24ee41){return db[_0xf30a('0x2a')][_0xf30a('0x25')]({'where':{'CustomReportId':_0x45d2df[_0xf30a('0x45')]['id']},'transaction':_0x24ee41})[_0xf30a('0x24')](function(_0x36a23b){var _0x4c80e8=_['map'](_0x45d2df[_0xf30a('0x48')],function(_0x4b37af){delete _0x4b37af['id'];_0x4b37af[_0xf30a('0x4f')]=_0x45d2df[_0xf30a('0x45')]['id'];return _0x4b37af;});return db[_0xf30a('0x2a')][_0xf30a('0x50')](_0x4c80e8,{'transaction':_0x24ee41});});})[_0xf30a('0x24')](function(){return db['AnalyticFieldReport'][_0xf30a('0x41')]({'where':{'CustomReportId':_0x45d2df['params']['id']}});});}})[_0xf30a('0x24')](respondWithResult(_0x7992ce,null))[_0xf30a('0x43')](handleError(_0x7992ce,null));}; \ No newline at end of file +var _0xb6a8=['where','type','VIRTUAL','merge','options','AnalyticFieldReport','includeAll','include','findAll','rows','show','keys','rawAttributes','find','catch','create','body','bulkCreate','params','addFields','AnalyticCustomReport','findOne','transaction','CustomReportId','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','then','error','stack','name','key','model','map','query','filters','intersection','attributes','fields','length','nolimit','sort','pick','filter'];(function(_0x5112ae,_0x3aebce){var _0x13c388=function(_0x16a9c4){while(--_0x16a9c4){_0x5112ae['push'](_0x5112ae['shift']());}};_0x13c388(++_0x3aebce);}(_0xb6a8,0x160));var _0x8b6a=function(_0x3340f5,_0x1b62c7){_0x3340f5=_0x3340f5-0x0;var _0x447105=_0xb6a8[_0x3340f5];return _0x447105;};'use strict';var emlformat=require(_0x8b6a('0x0'));var rimraf=require(_0x8b6a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8b6a('0x2'));var rp=require(_0x8b6a('0x3'));var moment=require('moment');var BPromise=require(_0x8b6a('0x4'));var Mustache=require(_0x8b6a('0x5'));var util=require(_0x8b6a('0x6'));var path=require(_0x8b6a('0x7'));var sox=require(_0x8b6a('0x8'));var csv=require(_0x8b6a('0x9'));var ejs=require(_0x8b6a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8b6a('0xb'));var squel=require(_0x8b6a('0xc'));var crypto=require('crypto');var jsforce=require(_0x8b6a('0xd'));var deskjs=require(_0x8b6a('0xe'));var toCsv=require(_0x8b6a('0x9'));var querystring=require(_0x8b6a('0xf'));var Papa=require(_0x8b6a('0x10'));var Redis=require(_0x8b6a('0x11'));var authService=require(_0x8b6a('0x12'));var qs=require(_0x8b6a('0x13'));var as=require(_0x8b6a('0x14'));var hardwareService=require(_0x8b6a('0x15'));var logger=require(_0x8b6a('0x16'))(_0x8b6a('0x17'));var utils=require(_0x8b6a('0x18'));var config=require(_0x8b6a('0x19'));var licenseUtil=require(_0x8b6a('0x1a'));var db=require(_0x8b6a('0x1b'))['db'];function respondWithStatusCode(_0x4f9ab3,_0x4df8be){_0x4df8be=_0x4df8be||0xcc;return function(_0x5895a9){if(_0x5895a9){return _0x4f9ab3[_0x8b6a('0x1c')](_0x4df8be);}return _0x4f9ab3[_0x8b6a('0x1d')](_0x4df8be)[_0x8b6a('0x1e')]();};}function respondWithResult(_0x87614b,_0x4871b7){_0x4871b7=_0x4871b7||0xc8;return function(_0xb9f719){if(_0xb9f719){return _0x87614b[_0x8b6a('0x1d')](_0x4871b7)[_0x8b6a('0x1f')](_0xb9f719);}};}function respondWithFilteredResult(_0x2c232f,_0x507c7b){return function(_0x5c38ff){if(_0x5c38ff){var _0x3a88d3=typeof _0x507c7b[_0x8b6a('0x20')]===_0x8b6a('0x21')&&typeof _0x507c7b[_0x8b6a('0x22')]===_0x8b6a('0x21');var _0x5132f7=_0x5c38ff[_0x8b6a('0x23')];var _0x36f1ed=_0x3a88d3?0x0:_0x507c7b[_0x8b6a('0x20')];var _0x448069=_0x3a88d3?_0x5c38ff[_0x8b6a('0x23')]:_0x507c7b[_0x8b6a('0x20')]+_0x507c7b[_0x8b6a('0x22')];var _0xf7852c;if(_0x448069>=_0x5132f7){_0x448069=_0x5132f7;_0xf7852c=0xc8;}else{_0xf7852c=0xce;}_0x2c232f[_0x8b6a('0x1d')](_0xf7852c);return _0x2c232f['set'](_0x8b6a('0x24'),_0x36f1ed+'-'+_0x448069+'/'+_0x5132f7)[_0x8b6a('0x1f')](_0x5c38ff);}return null;};}function patchUpdates(_0x83176e){return function(_0x4e6109){try{jsonpatch[_0x8b6a('0x25')](_0x4e6109,_0x83176e,!![]);}catch(_0xa5083a){return BPromise['reject'](_0xa5083a);}return _0x4e6109[_0x8b6a('0x26')]();};}function saveUpdates(_0x233032,_0x5603d1){return function(_0x4ac68c){if(_0x4ac68c){return _0x4ac68c[_0x8b6a('0x27')](_0x233032)['then'](function(_0x3d1c7c){return _0x3d1c7c;});}return null;};}function removeEntity(_0x1a6f4a,_0x56285e){return function(_0x5b8375){if(_0x5b8375){return _0x5b8375[_0x8b6a('0x28')]()[_0x8b6a('0x29')](function(){_0x1a6f4a['status'](0xcc)[_0x8b6a('0x1e')]();});}};}function handleEntityNotFound(_0x17bd2f,_0x3805ad){return function(_0x1a80c0){if(!_0x1a80c0){_0x17bd2f[_0x8b6a('0x1c')](0x194);}return _0x1a80c0;};}function handleError(_0x18b6c5,_0x4c7878){_0x4c7878=_0x4c7878||0x1f4;return function(_0x4fec25){logger[_0x8b6a('0x2a')](_0x4fec25[_0x8b6a('0x2b')]);if(_0x4fec25[_0x8b6a('0x2c')]){delete _0x4fec25[_0x8b6a('0x2c')];}_0x18b6c5[_0x8b6a('0x1d')](_0x4c7878)['send'](_0x4fec25);};}exports['index']=function(_0x6472eb,_0x418dbf){var _0x4c1e7c={},_0x355885={},_0x182b6e={'count':0x0,'rows':[]};var _0x4a31e2=_['map'](db['AnalyticFieldReport']['rawAttributes'],function(_0x5a4221){return{'name':_0x5a4221['fieldName'],'type':_0x5a4221['type'][_0x8b6a('0x2d')]};});_0x355885[_0x8b6a('0x2e')]=_[_0x8b6a('0x2f')](_0x4a31e2,'name');_0x355885[_0x8b6a('0x30')]=_['keys'](_0x6472eb[_0x8b6a('0x30')]);_0x355885[_0x8b6a('0x31')]=_[_0x8b6a('0x32')](_0x355885[_0x8b6a('0x2e')],_0x355885[_0x8b6a('0x30')]);_0x4c1e7c[_0x8b6a('0x33')]=_['intersection'](_0x355885['model'],qs[_0x8b6a('0x34')](_0x6472eb['query'][_0x8b6a('0x34')]));_0x4c1e7c[_0x8b6a('0x33')]=_0x4c1e7c[_0x8b6a('0x33')][_0x8b6a('0x35')]?_0x4c1e7c[_0x8b6a('0x33')]:_0x355885['model'];if(!_0x6472eb[_0x8b6a('0x30')]['hasOwnProperty'](_0x8b6a('0x36'))){_0x4c1e7c[_0x8b6a('0x22')]=qs[_0x8b6a('0x22')](_0x6472eb[_0x8b6a('0x30')]['limit']);_0x4c1e7c[_0x8b6a('0x20')]=qs['offset'](_0x6472eb['query'][_0x8b6a('0x20')]);}_0x4c1e7c['order']=qs[_0x8b6a('0x37')](_0x6472eb['query'][_0x8b6a('0x37')]);_0x4c1e7c['where']=qs['filters'](_[_0x8b6a('0x38')](_0x6472eb['query'],_0x355885['filters']),_0x4a31e2);if(_0x6472eb[_0x8b6a('0x30')][_0x8b6a('0x39')]){_0x4c1e7c[_0x8b6a('0x3a')]=_['merge'](_0x4c1e7c[_0x8b6a('0x3a')],{'$or':_[_0x8b6a('0x2f')](_0x4a31e2,function(_0x3485b1){if(_0x3485b1[_0x8b6a('0x3b')]!==_0x8b6a('0x3c')){var _0x38f99a={};_0x38f99a[_0x3485b1[_0x8b6a('0x2c')]]={'$like':'%'+_0x6472eb[_0x8b6a('0x30')][_0x8b6a('0x39')]+'%'};return _0x38f99a;}})});}_0x4c1e7c=_[_0x8b6a('0x3d')]({},_0x4c1e7c,_0x6472eb[_0x8b6a('0x3e')]);var _0x4747f3={'where':_0x4c1e7c[_0x8b6a('0x3a')]};return db[_0x8b6a('0x3f')][_0x8b6a('0x23')](_0x4747f3)['then'](function(_0x247702){_0x182b6e[_0x8b6a('0x23')]=_0x247702;if(_0x6472eb[_0x8b6a('0x30')][_0x8b6a('0x40')]){_0x4c1e7c[_0x8b6a('0x41')]=[{'all':!![]}];}return db[_0x8b6a('0x3f')][_0x8b6a('0x42')](_0x4c1e7c);})[_0x8b6a('0x29')](function(_0x578920){_0x182b6e[_0x8b6a('0x43')]=_0x578920;return _0x182b6e;})[_0x8b6a('0x29')](respondWithFilteredResult(_0x418dbf,_0x4c1e7c))['catch'](handleError(_0x418dbf,null));};exports[_0x8b6a('0x44')]=function(_0x39470c,_0x263ed1){var _0x45122f={'raw':![],'where':{'id':_0x39470c['params']['id']}},_0x49fa6d={};_0x49fa6d[_0x8b6a('0x2e')]=_[_0x8b6a('0x45')](db['AnalyticFieldReport'][_0x8b6a('0x46')]);_0x49fa6d[_0x8b6a('0x30')]=_[_0x8b6a('0x45')](_0x39470c[_0x8b6a('0x30')]);_0x49fa6d[_0x8b6a('0x31')]=_[_0x8b6a('0x32')](_0x49fa6d[_0x8b6a('0x2e')],_0x49fa6d[_0x8b6a('0x30')]);_0x45122f[_0x8b6a('0x33')]=_[_0x8b6a('0x32')](_0x49fa6d['model'],qs['fields'](_0x39470c['query'][_0x8b6a('0x34')]));_0x45122f['attributes']=_0x45122f[_0x8b6a('0x33')]['length']?_0x45122f[_0x8b6a('0x33')]:_0x49fa6d[_0x8b6a('0x2e')];if(_0x39470c[_0x8b6a('0x30')][_0x8b6a('0x40')]){_0x45122f[_0x8b6a('0x41')]=[{'all':!![]}];}_0x45122f=_['merge']({},_0x45122f,_0x39470c['options']);return db[_0x8b6a('0x3f')][_0x8b6a('0x47')](_0x45122f)[_0x8b6a('0x29')](handleEntityNotFound(_0x263ed1,null))[_0x8b6a('0x29')](respondWithResult(_0x263ed1,null))[_0x8b6a('0x48')](handleError(_0x263ed1,null));};exports[_0x8b6a('0x49')]=function(_0x447a9d,_0x33a2e5){return db['AnalyticFieldReport'][_0x8b6a('0x49')](_0x447a9d[_0x8b6a('0x4a')],{})[_0x8b6a('0x29')](respondWithResult(_0x33a2e5,0xc9))['catch'](handleError(_0x33a2e5,null));};exports[_0x8b6a('0x4b')]=function(_0x3bbc11,_0x36ec6c){return db[_0x8b6a('0x3f')][_0x8b6a('0x4b')](_0x3bbc11[_0x8b6a('0x4a')],{'raw':![],'individualHooks':!![]})[_0x8b6a('0x29')](respondWithResult(_0x36ec6c,0xc9))[_0x8b6a('0x48')](handleError(_0x36ec6c,null));};exports['update']=function(_0x4b8f8c,_0x45e051){if(_0x4b8f8c['body']['id']){delete _0x4b8f8c[_0x8b6a('0x4a')]['id'];}return db['AnalyticFieldReport'][_0x8b6a('0x47')]({'where':{'id':_0x4b8f8c[_0x8b6a('0x4c')]['id']}})[_0x8b6a('0x29')](handleEntityNotFound(_0x45e051,null))[_0x8b6a('0x29')](saveUpdates(_0x4b8f8c[_0x8b6a('0x4a')],null))[_0x8b6a('0x29')](respondWithResult(_0x45e051,null))[_0x8b6a('0x48')](handleError(_0x45e051,null));};exports['destroy']=function(_0x420712,_0x39fba6){return db['AnalyticFieldReport'][_0x8b6a('0x47')]({'where':{'id':_0x420712[_0x8b6a('0x4c')]['id']}})[_0x8b6a('0x29')](handleEntityNotFound(_0x39fba6,null))[_0x8b6a('0x29')](removeEntity(_0x39fba6,null))[_0x8b6a('0x48')](handleError(_0x39fba6,null));};exports['bulkDestroy']=function(_0x2f0dcd,_0x45f4d4){return db[_0x8b6a('0x3f')]['destroy']({'where':{'id':_0x2f0dcd[_0x8b6a('0x30')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0x8b6a('0x29')](respondWithResult(_0x45f4d4,0xcc))[_0x8b6a('0x48')](handleError(_0x45f4d4,null));};exports[_0x8b6a('0x4d')]=function(_0x489b6c,_0x2f85a7,_0x1f9804){return db[_0x8b6a('0x4e')][_0x8b6a('0x4f')]({'where':{'id':_0x489b6c[_0x8b6a('0x4c')]['id']}})[_0x8b6a('0x29')](handleEntityNotFound(_0x2f85a7,null))[_0x8b6a('0x29')](function(_0x5c1c87){if(_0x5c1c87){return db['sequelize'][_0x8b6a('0x50')](function(_0x4cd4e9){return db[_0x8b6a('0x3f')][_0x8b6a('0x28')]({'where':{'CustomReportId':_0x489b6c[_0x8b6a('0x4c')]['id']},'transaction':_0x4cd4e9})['then'](function(_0x2d0a73){var _0x59235f=_[_0x8b6a('0x2f')](_0x489b6c[_0x8b6a('0x4a')],function(_0x463380){delete _0x463380['id'];_0x463380[_0x8b6a('0x51')]=_0x489b6c[_0x8b6a('0x4c')]['id'];return _0x463380;});return db[_0x8b6a('0x3f')][_0x8b6a('0x4b')](_0x59235f,{'transaction':_0x4cd4e9});});})[_0x8b6a('0x29')](function(){return db[_0x8b6a('0x3f')]['findAll']({'where':{'CustomReportId':_0x489b6c[_0x8b6a('0x4c')]['id']}});});}})[_0x8b6a('0x29')](respondWithResult(_0x2f85a7,null))[_0x8b6a('0x48')](handleError(_0x2f85a7,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 29b84be..ab4e895 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 _0xcb5c=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','api'];(function(_0x92c259,_0x34d06f){var _0x5524fb=function(_0x1edd98){while(--_0x1edd98){_0x92c259['push'](_0x92c259['shift']());}};_0x5524fb(++_0x34d06f);}(_0xcb5c,0xda));var _0xccb5=function(_0x251475,_0x12d5ec){_0x251475=_0x251475-0x0;var _0x255daa=_0xcb5c[_0x251475];return _0x255daa;};'use strict';var _=require(_0xccb5('0x0'));var util=require(_0xccb5('0x1'));var logger=require('../../config/logger')(_0xccb5('0x2'));var moment=require(_0xccb5('0x3'));var BPromise=require(_0xccb5('0x4'));var rp=require(_0xccb5('0x5'));var fs=require('fs');var path=require(_0xccb5('0x6'));var rimraf=require(_0xccb5('0x7'));var config=require(_0xccb5('0x8'));var attributes=require('./analyticFieldReport.attributes');module[_0xccb5('0x9')]=function(_0x35171c,_0x53ccac){return _0x35171c[_0xccb5('0xa')](_0xccb5('0xb'),attributes,{'tableName':_0xccb5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5579=['moment','request-promise','path','define','AnalyticFieldReport','analytics_report_fields','util','../../config/logger','api'];(function(_0x29d994,_0x74c530){var _0x304d4a=function(_0x4a2b14){while(--_0x4a2b14){_0x29d994['push'](_0x29d994['shift']());}};_0x304d4a(++_0x74c530);}(_0x5579,0x192));var _0x9557=function(_0x42f1e9,_0x5d1d83){_0x42f1e9=_0x42f1e9-0x0;var _0x56e8b6=_0x5579[_0x42f1e9];return _0x56e8b6;};'use strict';var _=require('lodash');var util=require(_0x9557('0x0'));var logger=require(_0x9557('0x1'))(_0x9557('0x2'));var moment=require(_0x9557('0x3'));var BPromise=require('bluebird');var rp=require(_0x9557('0x4'));var fs=require('fs');var path=require(_0x9557('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./analyticFieldReport.attributes');module['exports']=function(_0xa6e2fa,_0x1d8a64){return _0xa6e2fa[_0x9557('0x6')](_0x9557('0x7'),attributes,{'tableName':_0x9557('0x8'),'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 0f2b5d2..4c429fd 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 _0x5f7a=['request','info','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code','message','AnalyticFieldReport,\x20%s,\x20%s','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x57895d,_0xf85da7){var _0x1449f6=function(_0x608070){while(--_0x608070){_0x57895d['push'](_0x57895d['shift']());}};_0x1449f6(++_0xf85da7);}(_0x5f7a,0x186));var _0xa5f7=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x5f7a[_0xdea41a];return _0x15d0d8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa5f7('0x0'));var BPromise=require(_0xa5f7('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa5f7('0x2'));var db=require(_0xa5f7('0x3'))['db'];var utils=require(_0xa5f7('0x4'));var logger=require(_0xa5f7('0x5'))(_0xa5f7('0x6'));var config=require(_0xa5f7('0x7'));var jayson=require(_0xa5f7('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5aa6c5,_0x52c989,_0x30bdb2){return new BPromise(function(_0x213aa4,_0x209e78){return client[_0xa5f7('0x9')](_0x5aa6c5,_0x30bdb2)['then'](function(_0x438f75){logger[_0xa5f7('0xa')]('AnalyticFieldReport,\x20%s,\x20%s',_0x52c989,_0xa5f7('0xb'));logger['debug'](_0xa5f7('0xc'),_0x52c989,_0xa5f7('0xb'),JSON['stringify'](_0x438f75));if(_0x438f75['error']){if(_0x438f75[_0xa5f7('0xd')][_0xa5f7('0xe')]===0x1f4){logger[_0xa5f7('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x52c989,_0x438f75['error'][_0xa5f7('0xf')]);return _0x209e78(_0x438f75[_0xa5f7('0xd')][_0xa5f7('0xf')]);}logger['error'](_0xa5f7('0x10'),_0x52c989,_0x438f75[_0xa5f7('0xd')][_0xa5f7('0xf')]);return _0x213aa4(_0x438f75[_0xa5f7('0xd')][_0xa5f7('0xf')]);}else{logger[_0xa5f7('0xa')](_0xa5f7('0x10'),_0x52c989,'request\x20sent');_0x213aa4(_0x438f75[_0xa5f7('0x11')][_0xa5f7('0xf')]);}})[_0xa5f7('0x12')](function(_0x4147f5){logger['error'](_0xa5f7('0x10'),_0x52c989,_0x4147f5);_0x209e78(_0x4147f5);});});} \ No newline at end of file +var _0x433e=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code','message','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','result'];(function(_0x4cf7fe,_0x3e89ba){var _0x3d4aec=function(_0x298e60){while(--_0x298e60){_0x4cf7fe['push'](_0x4cf7fe['shift']());}};_0x3d4aec(++_0x3e89ba);}(_0x433e,0x7e));var _0xe433=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x433e[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xe433('0x0'));var util=require(_0xe433('0x1'));var moment=require(_0xe433('0x2'));var BPromise=require('bluebird');var rs=require(_0xe433('0x3'));var fs=require('fs');var Redis=require(_0xe433('0x4'));var db=require(_0xe433('0x5'))['db'];var utils=require(_0xe433('0x6'));var logger=require('../../config/logger')(_0xe433('0x7'));var config=require(_0xe433('0x8'));var jayson=require(_0xe433('0x9'));var client=jayson[_0xe433('0xa')][_0xe433('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x35e266,_0x2dbc41,_0x188acd){return new BPromise(function(_0x5bf118,_0x599c52){return client[_0xe433('0xc')](_0x35e266,_0x188acd)['then'](function(_0x348947){logger[_0xe433('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x2dbc41,'request\x20sent');logger['debug'](_0xe433('0xe'),_0x2dbc41,'request\x20sent',JSON['stringify'](_0x348947));if(_0x348947[_0xe433('0xf')]){if(_0x348947[_0xe433('0xf')][_0xe433('0x10')]===0x1f4){logger[_0xe433('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x2dbc41,_0x348947[_0xe433('0xf')][_0xe433('0x11')]);return _0x599c52(_0x348947[_0xe433('0xf')][_0xe433('0x11')]);}logger[_0xe433('0xf')](_0xe433('0x12'),_0x2dbc41,_0x348947['error'][_0xe433('0x11')]);return _0x5bf118(_0x348947['error'][_0xe433('0x11')]);}else{logger[_0xe433('0xd')](_0xe433('0x12'),_0x2dbc41,_0xe433('0x13'));_0x5bf118(_0x348947[_0xe433('0x14')][_0xe433('0x11')]);}})['catch'](function(_0x145c3b){logger['error'](_0xe433('0x12'),_0x2dbc41,_0x145c3b);_0x599c52(_0x145c3b);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 507c7e6..e1d55c1 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(_0x5be4d5,_0x50c2cf){var _0x3c45ee=function(_0x245fdb){while(--_0x245fdb){_0x5be4d5['push'](_0x5be4d5['shift']());}};_0x3c45ee(++_0x50c2cf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'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(_0x206775,_0x1e32cd){var _0x257898=function(_0x58e971){while(--_0x58e971){_0x206775['push'](_0x206775['shift']());}};_0x257898(++_0x1e32cd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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 594131d..3a5ac17 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 _0xd4dc=['STRING','name','TEXT','sequelize'];(function(_0x18b314,_0x1129e5){var _0x4b0acb=function(_0x1caa96){while(--_0x1caa96){_0x18b314['push'](_0x18b314['shift']());}};_0x4b0acb(++_0x1129e5);}(_0xd4dc,0xff));var _0xcd4d=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0xd4dc[_0x1ccdf7];return _0x52a0ae;};'use strict';var Sequelize=require(_0xcd4d('0x0'));module['exports']={'name':{'type':Sequelize[_0xcd4d('0x1')],'allowNull':![],'unique':_0xcd4d('0x2')},'table':{'type':Sequelize[_0xcd4d('0x1')]},'metric':{'type':Sequelize[_0xcd4d('0x3')]},'description':{'type':Sequelize[_0xcd4d('0x1')]}}; \ No newline at end of file +var _0xbc8b=['name','STRING','TEXT','exports'];(function(_0x54edc9,_0x345f01){var _0x2ae7a9=function(_0x24a545){while(--_0x24a545){_0x54edc9['push'](_0x54edc9['shift']());}};_0x2ae7a9(++_0x345f01);}(_0xbc8b,0x16b));var _0xbbc8=function(_0x1428d9,_0xded63c){_0x1428d9=_0x1428d9-0x0;var _0x438019=_0xbc8b[_0x1428d9];return _0x438019;};'use strict';var Sequelize=require('sequelize');module[_0xbbc8('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xbbc8('0x1')},'table':{'type':Sequelize[_0xbbc8('0x2')]},'metric':{'type':Sequelize[_0xbbc8('0x3')]},'description':{'type':Sequelize[_0xbbc8('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 6390d8a..3142add 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 _0x425d=['VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','filters','pick','where','merge'];(function(_0x1ce5ee,_0x1c1cd6){var _0x32668f=function(_0x1852eb){while(--_0x1852eb){_0x1ce5ee['push'](_0x1ce5ee['shift']());}};_0x32668f(++_0x1c1cd6);}(_0x425d,0x1e0));var _0xd425=function(_0x2d9f26,_0x10e8dd){_0x2d9f26=_0x2d9f26-0x0;var _0x5c7562=_0x425d[_0x2d9f26];return _0x5c7562;};'use strict';var emlformat=require(_0xd425('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd425('0x1'));var jsonpatch=require(_0xd425('0x2'));var rp=require(_0xd425('0x3'));var moment=require(_0xd425('0x4'));var BPromise=require(_0xd425('0x5'));var Mustache=require(_0xd425('0x6'));var util=require(_0xd425('0x7'));var path=require('path');var sox=require(_0xd425('0x8'));var csv=require(_0xd425('0x9'));var ejs=require(_0xd425('0xa'));var fs=require('fs');var fs_extra=require(_0xd425('0xb'));var _=require(_0xd425('0xc'));var squel=require(_0xd425('0xd'));var crypto=require('crypto');var jsforce=require(_0xd425('0xe'));var deskjs=require(_0xd425('0xf'));var toCsv=require(_0xd425('0x9'));var querystring=require(_0xd425('0x10'));var Papa=require(_0xd425('0x11'));var Redis=require(_0xd425('0x12'));var authService=require(_0xd425('0x13'));var qs=require(_0xd425('0x14'));var as=require(_0xd425('0x15'));var hardwareService=require(_0xd425('0x16'));var logger=require(_0xd425('0x17'))(_0xd425('0x18'));var utils=require(_0xd425('0x19'));var config=require(_0xd425('0x1a'));var licenseUtil=require(_0xd425('0x1b'));var db=require(_0xd425('0x1c'))['db'];function respondWithStatusCode(_0x9bb611,_0x3cacf7){_0x3cacf7=_0x3cacf7||0xcc;return function(_0x3b5de8){if(_0x3b5de8){return _0x9bb611[_0xd425('0x1d')](_0x3cacf7);}return _0x9bb611['status'](_0x3cacf7)[_0xd425('0x1e')]();};}function respondWithResult(_0x17a498,_0x336dc3){_0x336dc3=_0x336dc3||0xc8;return function(_0x5d3d60){if(_0x5d3d60){return _0x17a498[_0xd425('0x1f')](_0x336dc3)[_0xd425('0x20')](_0x5d3d60);}};}function respondWithFilteredResult(_0x643fd2,_0x41f34d){return function(_0x1fc822){if(_0x1fc822){var _0x538a0a=typeof _0x41f34d[_0xd425('0x21')]===_0xd425('0x22')&&typeof _0x41f34d[_0xd425('0x23')]===_0xd425('0x22');var _0x5d6585=_0x1fc822[_0xd425('0x24')];var _0x434d97=_0x538a0a?0x0:_0x41f34d[_0xd425('0x21')];var _0x1155bc=_0x538a0a?_0x1fc822['count']:_0x41f34d['offset']+_0x41f34d['limit'];var _0x4b293a;if(_0x1155bc>=_0x5d6585){_0x1155bc=_0x5d6585;_0x4b293a=0xc8;}else{_0x4b293a=0xce;}_0x643fd2[_0xd425('0x1f')](_0x4b293a);return _0x643fd2[_0xd425('0x25')](_0xd425('0x26'),_0x434d97+'-'+_0x1155bc+'/'+_0x5d6585)['json'](_0x1fc822);}return null;};}function patchUpdates(_0x355af0){return function(_0x7e982e){try{jsonpatch['apply'](_0x7e982e,_0x355af0,!![]);}catch(_0x2e1ec4){return BPromise[_0xd425('0x27')](_0x2e1ec4);}return _0x7e982e[_0xd425('0x28')]();};}function saveUpdates(_0x1d3fc0,_0x3e93db){return function(_0xb240c4){if(_0xb240c4){return _0xb240c4[_0xd425('0x29')](_0x1d3fc0)[_0xd425('0x2a')](function(_0x314201){return _0x314201;});}return null;};}function removeEntity(_0x2b030b,_0x151ad9){return function(_0x40e84b){if(_0x40e84b){return _0x40e84b['destroy']()[_0xd425('0x2a')](function(){var _0x264b0e=_0x40e84b[_0xd425('0x2b')]({'plain':!![]});var _0x1908a5=_0xd425('0x2c');return db[_0xd425('0x2d')][_0xd425('0x2e')]({'where':{'type':_0x1908a5,'resourceId':_0x264b0e['id']}})['then'](function(){return _0x40e84b;});})[_0xd425('0x2a')](function(){_0x2b030b[_0xd425('0x1f')](0xcc)[_0xd425('0x1e')]();});}};}function handleEntityNotFound(_0x57c950,_0x27ef8a){return function(_0x3ad9bd){if(!_0x3ad9bd){_0x57c950[_0xd425('0x1d')](0x194);}return _0x3ad9bd;};}function handleError(_0x999fb9,_0x27d29a){_0x27d29a=_0x27d29a||0x1f4;return function(_0x185d7e){logger[_0xd425('0x2f')](_0x185d7e[_0xd425('0x30')]);if(_0x185d7e[_0xd425('0x31')]){delete _0x185d7e[_0xd425('0x31')];}_0x999fb9['status'](_0x27d29a)[_0xd425('0x32')](_0x185d7e);};}exports[_0xd425('0x33')]=function(_0x298602,_0x3695dd){var _0x3275b1={},_0x1abf33={},_0x47405f={'count':0x0,'rows':[]};var _0x40c392=_[_0xd425('0x34')](db[_0xd425('0x35')][_0xd425('0x36')],function(_0x5f3dab){return{'name':_0x5f3dab[_0xd425('0x37')],'type':_0x5f3dab[_0xd425('0x38')][_0xd425('0x39')]};});_0x1abf33[_0xd425('0x3a')]=_[_0xd425('0x34')](_0x40c392,'name');_0x1abf33[_0xd425('0x3b')]=_[_0xd425('0x3c')](_0x298602['query']);_0x1abf33['filters']=_['intersection'](_0x1abf33[_0xd425('0x3a')],_0x1abf33[_0xd425('0x3b')]);_0x3275b1[_0xd425('0x3d')]=_[_0xd425('0x3e')](_0x1abf33['model'],qs[_0xd425('0x3f')](_0x298602[_0xd425('0x3b')][_0xd425('0x3f')]));_0x3275b1[_0xd425('0x3d')]=_0x3275b1[_0xd425('0x3d')][_0xd425('0x40')]?_0x3275b1[_0xd425('0x3d')]:_0x1abf33['model'];if(!_0x298602[_0xd425('0x3b')]['hasOwnProperty'](_0xd425('0x41'))){_0x3275b1[_0xd425('0x23')]=qs[_0xd425('0x23')](_0x298602['query'][_0xd425('0x23')]);_0x3275b1[_0xd425('0x21')]=qs[_0xd425('0x21')](_0x298602[_0xd425('0x3b')]['offset']);}_0x3275b1[_0xd425('0x42')]=qs[_0xd425('0x43')](_0x298602['query']['sort']);_0x3275b1['where']=qs[_0xd425('0x44')](_[_0xd425('0x45')](_0x298602[_0xd425('0x3b')],_0x1abf33['filters']),_0x40c392);if(_0x298602['query']['filter']){_0x3275b1[_0xd425('0x46')]=_[_0xd425('0x47')](_0x3275b1[_0xd425('0x46')],{'$or':_[_0xd425('0x34')](_0x40c392,function(_0xa9fd7c){if(_0xa9fd7c[_0xd425('0x38')]!==_0xd425('0x48')){var _0x4b922f={};_0x4b922f[_0xa9fd7c[_0xd425('0x31')]]={'$like':'%'+_0x298602[_0xd425('0x3b')][_0xd425('0x49')]+'%'};return _0x4b922f;}})});}_0x3275b1=_['merge']({},_0x3275b1,_0x298602[_0xd425('0x4a')]);var _0x2dffc7={'where':_0x3275b1[_0xd425('0x46')]};return db['AnalyticMetric'][_0xd425('0x24')](_0x2dffc7)[_0xd425('0x2a')](function(_0x1c5ba6){_0x47405f[_0xd425('0x24')]=_0x1c5ba6;if(_0x298602['query'][_0xd425('0x4b')]){_0x3275b1[_0xd425('0x4c')]=[{'all':!![]}];}return db[_0xd425('0x35')][_0xd425('0x4d')](_0x3275b1);})[_0xd425('0x2a')](function(_0x2f6bf7){_0x47405f[_0xd425('0x4e')]=_0x2f6bf7;return _0x47405f;})['then'](respondWithFilteredResult(_0x3695dd,_0x3275b1))[_0xd425('0x4f')](handleError(_0x3695dd,null));};exports[_0xd425('0x50')]=function(_0x5b65fe,_0x1a44a8){var _0x491c51={'raw':!![],'where':{'id':_0x5b65fe[_0xd425('0x51')]['id']}},_0x5e12bf={};_0x5e12bf['model']=_[_0xd425('0x3c')](db['AnalyticMetric'][_0xd425('0x36')]);_0x5e12bf[_0xd425('0x3b')]=_[_0xd425('0x3c')](_0x5b65fe[_0xd425('0x3b')]);_0x5e12bf[_0xd425('0x44')]=_['intersection'](_0x5e12bf[_0xd425('0x3a')],_0x5e12bf['query']);_0x491c51[_0xd425('0x3d')]=_['intersection'](_0x5e12bf[_0xd425('0x3a')],qs[_0xd425('0x3f')](_0x5b65fe[_0xd425('0x3b')][_0xd425('0x3f')]));_0x491c51[_0xd425('0x3d')]=_0x491c51['attributes'][_0xd425('0x40')]?_0x491c51[_0xd425('0x3d')]:_0x5e12bf[_0xd425('0x3a')];if(_0x5b65fe[_0xd425('0x3b')][_0xd425('0x4b')]){_0x491c51['include']=[{'all':!![]}];}_0x491c51=_[_0xd425('0x47')]({},_0x491c51,_0x5b65fe[_0xd425('0x4a')]);return db[_0xd425('0x35')][_0xd425('0x52')](_0x491c51)[_0xd425('0x2a')](handleEntityNotFound(_0x1a44a8,null))[_0xd425('0x2a')](respondWithResult(_0x1a44a8,null))['catch'](handleError(_0x1a44a8,null));};exports[_0xd425('0x53')]=function(_0x128cb3,_0x5bfac6){return db[_0xd425('0x35')][_0xd425('0x53')](_0x128cb3[_0xd425('0x54')],{})[_0xd425('0x2a')](function(_0x5c0219){var _0x54f1d=_0x128cb3[_0xd425('0x55')][_0xd425('0x2b')]({'plain':!![]});if(!_0x54f1d)throw new Error(_0xd425('0x56'));if(_0x54f1d[_0xd425('0x57')]==='user'){var _0x4be6fa=_0x5c0219[_0xd425('0x2b')]({'plain':!![]});var _0x5496d8=_0xd425('0x2c');return db[_0xd425('0x58')]['find']({'where':{'name':_0x5496d8,'userProfileId':_0x54f1d[_0xd425('0x59')]},'raw':!![]})['then'](function(_0x48d5b8){if(_0x48d5b8&&_0x48d5b8[_0xd425('0x5a')]===0x0){return db[_0xd425('0x2d')][_0xd425('0x53')]({'name':_0x4be6fa[_0xd425('0x31')],'resourceId':_0x4be6fa['id'],'type':_0x48d5b8[_0xd425('0x31')],'sectionId':_0x48d5b8['id']},{})[_0xd425('0x2a')](function(){return _0x5c0219;});}else{return _0x5c0219;}})[_0xd425('0x4f')](function(_0x4118fe){logger['error'](_0xd425('0x5b'),_0x4118fe);throw _0x4118fe;});}return _0x5c0219;})[_0xd425('0x2a')](respondWithResult(_0x5bfac6,0xc9))[_0xd425('0x4f')](handleError(_0x5bfac6,null));};exports[_0xd425('0x29')]=function(_0x7b1080,_0x1c80c2){if(_0x7b1080[_0xd425('0x54')]['id']){delete _0x7b1080[_0xd425('0x54')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0x7b1080['params']['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x1c80c2,null))[_0xd425('0x2a')](saveUpdates(_0x7b1080[_0xd425('0x54')],null))[_0xd425('0x2a')](respondWithResult(_0x1c80c2,null))['catch'](handleError(_0x1c80c2,null));};exports['destroy']=function(_0x499a60,_0x5e1294){return db[_0xd425('0x35')][_0xd425('0x52')]({'where':{'id':_0x499a60['params']['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x5e1294,null))[_0xd425('0x2a')](removeEntity(_0x5e1294,null))[_0xd425('0x4f')](handleError(_0x5e1294,null));}; \ No newline at end of file +var _0x8d0e=['then','get','Metrics','UserProfileResource','end','sendStatus','error','stack','name','send','AnalyticMetric','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','fields','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','offset','count','set','apply','reject','save','update','destroy'];(function(_0x61bb05,_0x47421f){var _0x3ceb3e=function(_0x54b8f7){while(--_0x54b8f7){_0x61bb05['push'](_0x61bb05['shift']());}};_0x3ceb3e(++_0x47421f);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x6a9ed1,_0x185493){_0x6a9ed1=_0x6a9ed1-0x0;var _0x2d0535=_0x8d0e[_0x6a9ed1];return _0x2d0535;};'use strict';var emlformat=require(_0xe8d0('0x0'));var rimraf=require(_0xe8d0('0x1'));var zipdir=require(_0xe8d0('0x2'));var jsonpatch=require(_0xe8d0('0x3'));var rp=require(_0xe8d0('0x4'));var moment=require(_0xe8d0('0x5'));var BPromise=require(_0xe8d0('0x6'));var Mustache=require(_0xe8d0('0x7'));var util=require(_0xe8d0('0x8'));var path=require('path');var sox=require(_0xe8d0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8d0('0xa'));var _=require(_0xe8d0('0xb'));var squel=require(_0xe8d0('0xc'));var crypto=require(_0xe8d0('0xd'));var jsforce=require(_0xe8d0('0xe'));var deskjs=require(_0xe8d0('0xf'));var toCsv=require(_0xe8d0('0x10'));var querystring=require(_0xe8d0('0x11'));var Papa=require('papaparse');var Redis=require(_0xe8d0('0x12'));var authService=require(_0xe8d0('0x13'));var qs=require(_0xe8d0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe8d0('0x15'))(_0xe8d0('0x16'));var utils=require(_0xe8d0('0x17'));var config=require(_0xe8d0('0x18'));var licenseUtil=require(_0xe8d0('0x19'));var db=require(_0xe8d0('0x1a'))['db'];function respondWithStatusCode(_0x5934b2,_0x38fac0){_0x38fac0=_0x38fac0||0xcc;return function(_0x15b9e5){if(_0x15b9e5){return _0x5934b2['sendStatus'](_0x38fac0);}return _0x5934b2[_0xe8d0('0x1b')](_0x38fac0)['end']();};}function respondWithResult(_0x59b4b7,_0x90a1ea){_0x90a1ea=_0x90a1ea||0xc8;return function(_0x2aa906){if(_0x2aa906){return _0x59b4b7[_0xe8d0('0x1b')](_0x90a1ea)[_0xe8d0('0x1c')](_0x2aa906);}};}function respondWithFilteredResult(_0x15d3a1,_0x7151c6){return function(_0x52818a){if(_0x52818a){var _0x6ccffa=typeof _0x7151c6['offset']===_0xe8d0('0x1d')&&typeof _0x7151c6[_0xe8d0('0x1e')]===_0xe8d0('0x1d');var _0x4d1db4=_0x52818a['count'];var _0x47c67a=_0x6ccffa?0x0:_0x7151c6[_0xe8d0('0x1f')];var _0x384854=_0x6ccffa?_0x52818a[_0xe8d0('0x20')]:_0x7151c6[_0xe8d0('0x1f')]+_0x7151c6[_0xe8d0('0x1e')];var _0x588133;if(_0x384854>=_0x4d1db4){_0x384854=_0x4d1db4;_0x588133=0xc8;}else{_0x588133=0xce;}_0x15d3a1[_0xe8d0('0x1b')](_0x588133);return _0x15d3a1[_0xe8d0('0x21')]('Content-Range',_0x47c67a+'-'+_0x384854+'/'+_0x4d1db4)['json'](_0x52818a);}return null;};}function patchUpdates(_0x554402){return function(_0x384a60){try{jsonpatch[_0xe8d0('0x22')](_0x384a60,_0x554402,!![]);}catch(_0x25363b){return BPromise[_0xe8d0('0x23')](_0x25363b);}return _0x384a60[_0xe8d0('0x24')]();};}function saveUpdates(_0x23a945,_0x1bd25c){return function(_0x28a6b5){if(_0x28a6b5){return _0x28a6b5[_0xe8d0('0x25')](_0x23a945)['then'](function(_0xed8f2e){return _0xed8f2e;});}return null;};}function removeEntity(_0x9f747,_0x572c25){return function(_0x106614){if(_0x106614){return _0x106614[_0xe8d0('0x26')]()[_0xe8d0('0x27')](function(){var _0xd86c76=_0x106614[_0xe8d0('0x28')]({'plain':!![]});var _0x149dfd=_0xe8d0('0x29');return db[_0xe8d0('0x2a')][_0xe8d0('0x26')]({'where':{'type':_0x149dfd,'resourceId':_0xd86c76['id']}})[_0xe8d0('0x27')](function(){return _0x106614;});})[_0xe8d0('0x27')](function(){_0x9f747['status'](0xcc)[_0xe8d0('0x2b')]();});}};}function handleEntityNotFound(_0x26dd52,_0x10dec2){return function(_0x486f49){if(!_0x486f49){_0x26dd52[_0xe8d0('0x2c')](0x194);}return _0x486f49;};}function handleError(_0x343b08,_0x526240){_0x526240=_0x526240||0x1f4;return function(_0x1519e2){logger[_0xe8d0('0x2d')](_0x1519e2[_0xe8d0('0x2e')]);if(_0x1519e2[_0xe8d0('0x2f')]){delete _0x1519e2[_0xe8d0('0x2f')];}_0x343b08['status'](_0x526240)[_0xe8d0('0x30')](_0x1519e2);};}exports['index']=function(_0x5d3276,_0x50ad3c){var _0x547a2b={},_0x13cd4c={},_0x36ccec={'count':0x0,'rows':[]};var _0x5151fa=_['map'](db[_0xe8d0('0x31')]['rawAttributes'],function(_0x3b5d31){return{'name':_0x3b5d31[_0xe8d0('0x32')],'type':_0x3b5d31[_0xe8d0('0x33')][_0xe8d0('0x34')]};});_0x13cd4c[_0xe8d0('0x35')]=_['map'](_0x5151fa,_0xe8d0('0x2f'));_0x13cd4c[_0xe8d0('0x36')]=_[_0xe8d0('0x37')](_0x5d3276[_0xe8d0('0x36')]);_0x13cd4c['filters']=_[_0xe8d0('0x38')](_0x13cd4c[_0xe8d0('0x35')],_0x13cd4c['query']);_0x547a2b[_0xe8d0('0x39')]=_['intersection'](_0x13cd4c[_0xe8d0('0x35')],qs['fields'](_0x5d3276[_0xe8d0('0x36')]['fields']));_0x547a2b[_0xe8d0('0x39')]=_0x547a2b[_0xe8d0('0x39')][_0xe8d0('0x3a')]?_0x547a2b[_0xe8d0('0x39')]:_0x13cd4c['model'];if(!_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x3b')](_0xe8d0('0x3c'))){_0x547a2b['limit']=qs[_0xe8d0('0x1e')](_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x1e')]);_0x547a2b[_0xe8d0('0x1f')]=qs[_0xe8d0('0x1f')](_0x5d3276['query'][_0xe8d0('0x1f')]);}_0x547a2b[_0xe8d0('0x3d')]=qs[_0xe8d0('0x3e')](_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x3e')]);_0x547a2b[_0xe8d0('0x3f')]=qs[_0xe8d0('0x40')](_[_0xe8d0('0x41')](_0x5d3276['query'],_0x13cd4c['filters']),_0x5151fa);if(_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x42')]){_0x547a2b[_0xe8d0('0x3f')]=_[_0xe8d0('0x43')](_0x547a2b[_0xe8d0('0x3f')],{'$or':_['map'](_0x5151fa,function(_0x2e4362){if(_0x2e4362['type']!==_0xe8d0('0x44')){var _0x458294={};_0x458294[_0x2e4362[_0xe8d0('0x2f')]]={'$like':'%'+_0x5d3276['query'][_0xe8d0('0x42')]+'%'};return _0x458294;}})});}_0x547a2b=_[_0xe8d0('0x43')]({},_0x547a2b,_0x5d3276[_0xe8d0('0x45')]);var _0x230a90={'where':_0x547a2b[_0xe8d0('0x3f')]};return db['AnalyticMetric']['count'](_0x230a90)['then'](function(_0x4cf0da){_0x36ccec[_0xe8d0('0x20')]=_0x4cf0da;if(_0x5d3276['query'][_0xe8d0('0x46')]){_0x547a2b[_0xe8d0('0x47')]=[{'all':!![]}];}return db[_0xe8d0('0x31')][_0xe8d0('0x48')](_0x547a2b);})[_0xe8d0('0x27')](function(_0x1156da){_0x36ccec[_0xe8d0('0x49')]=_0x1156da;return _0x36ccec;})[_0xe8d0('0x27')](respondWithFilteredResult(_0x50ad3c,_0x547a2b))['catch'](handleError(_0x50ad3c,null));};exports[_0xe8d0('0x4a')]=function(_0x1da8b2,_0x4a3740){var _0x4bcdff={'raw':!![],'where':{'id':_0x1da8b2[_0xe8d0('0x4b')]['id']}},_0x3825a1={};_0x3825a1[_0xe8d0('0x35')]=_['keys'](db[_0xe8d0('0x31')][_0xe8d0('0x4c')]);_0x3825a1['query']=_[_0xe8d0('0x37')](_0x1da8b2[_0xe8d0('0x36')]);_0x3825a1['filters']=_[_0xe8d0('0x38')](_0x3825a1[_0xe8d0('0x35')],_0x3825a1[_0xe8d0('0x36')]);_0x4bcdff[_0xe8d0('0x39')]=_[_0xe8d0('0x38')](_0x3825a1[_0xe8d0('0x35')],qs[_0xe8d0('0x4d')](_0x1da8b2[_0xe8d0('0x36')]['fields']));_0x4bcdff[_0xe8d0('0x39')]=_0x4bcdff[_0xe8d0('0x39')][_0xe8d0('0x3a')]?_0x4bcdff[_0xe8d0('0x39')]:_0x3825a1[_0xe8d0('0x35')];if(_0x1da8b2[_0xe8d0('0x36')][_0xe8d0('0x46')]){_0x4bcdff[_0xe8d0('0x47')]=[{'all':!![]}];}_0x4bcdff=_[_0xe8d0('0x43')]({},_0x4bcdff,_0x1da8b2[_0xe8d0('0x45')]);return db[_0xe8d0('0x31')][_0xe8d0('0x4e')](_0x4bcdff)['then'](handleEntityNotFound(_0x4a3740,null))[_0xe8d0('0x27')](respondWithResult(_0x4a3740,null))[_0xe8d0('0x4f')](handleError(_0x4a3740,null));};exports[_0xe8d0('0x50')]=function(_0xad7d94,_0x34047c){return db[_0xe8d0('0x31')][_0xe8d0('0x50')](_0xad7d94['body'],{})[_0xe8d0('0x27')](function(_0x424764){var _0x151cf4=_0xad7d94[_0xe8d0('0x51')]['get']({'plain':!![]});if(!_0x151cf4)throw new Error(_0xe8d0('0x52'));if(_0x151cf4['role']===_0xe8d0('0x51')){var _0x382ae9=_0x424764[_0xe8d0('0x28')]({'plain':!![]});var _0x158d24=_0xe8d0('0x29');return db[_0xe8d0('0x53')][_0xe8d0('0x4e')]({'where':{'name':_0x158d24,'userProfileId':_0x151cf4['userProfileId']},'raw':!![]})[_0xe8d0('0x27')](function(_0x55f93d){if(_0x55f93d&&_0x55f93d['autoAssociation']===0x0){return db[_0xe8d0('0x2a')]['create']({'name':_0x382ae9[_0xe8d0('0x2f')],'resourceId':_0x382ae9['id'],'type':_0x55f93d['name'],'sectionId':_0x55f93d['id']},{})[_0xe8d0('0x27')](function(){return _0x424764;});}else{return _0x424764;}})[_0xe8d0('0x4f')](function(_0x13713c){logger[_0xe8d0('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13713c);throw _0x13713c;});}return _0x424764;})[_0xe8d0('0x27')](respondWithResult(_0x34047c,0xc9))[_0xe8d0('0x4f')](handleError(_0x34047c,null));};exports[_0xe8d0('0x25')]=function(_0x2e3f1d,_0x18cc14){if(_0x2e3f1d['body']['id']){delete _0x2e3f1d[_0xe8d0('0x54')]['id'];}return db[_0xe8d0('0x31')][_0xe8d0('0x4e')]({'where':{'id':_0x2e3f1d['params']['id']}})[_0xe8d0('0x27')](handleEntityNotFound(_0x18cc14,null))['then'](saveUpdates(_0x2e3f1d['body'],null))[_0xe8d0('0x27')](respondWithResult(_0x18cc14,null))[_0xe8d0('0x4f')](handleError(_0x18cc14,null));};exports['destroy']=function(_0xcb6ce2,_0x3a8074){return db['AnalyticMetric'][_0xe8d0('0x4e')]({'where':{'id':_0xcb6ce2[_0xe8d0('0x4b')]['id']}})[_0xe8d0('0x27')](handleEntityNotFound(_0x3a8074,null))[_0xe8d0('0x27')](removeEntity(_0x3a8074,null))['catch'](handleError(_0x3a8074,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 473d40f..bb2da9e 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 _0x01db=['api','moment','bluebird','path','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash'];(function(_0xc67528,_0x24e2fb){var _0x38e26d=function(_0x1b0efe){while(--_0x1b0efe){_0xc67528['push'](_0xc67528['shift']());}};_0x38e26d(++_0x24e2fb);}(_0x01db,0x171));var _0xb01d=function(_0x46ea2e,_0x1fc30b){_0x46ea2e=_0x46ea2e-0x0;var _0x2a5669=_0x01db[_0x46ea2e];return _0x2a5669;};'use strict';var _=require(_0xb01d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb01d('0x1'));var moment=require(_0xb01d('0x2'));var BPromise=require(_0xb01d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb01d('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb01d('0x5'));module[_0xb01d('0x6')]=function(_0x30bddd,_0x30f6b5){return _0x30bddd[_0xb01d('0x7')](_0xb01d('0x8'),attributes,{'tableName':_0xb01d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x74f3=['bluebird','request-promise','path','../../config/environment','./analyticMetric.attributes','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','moment'];(function(_0xfaef7a,_0x375c7a){var _0x3eb65f=function(_0x5143f9){while(--_0x5143f9){_0xfaef7a['push'](_0xfaef7a['shift']());}};_0x3eb65f(++_0x375c7a);}(_0x74f3,0x164));var _0x374f=function(_0xa681dc,_0x3100aa){_0xa681dc=_0xa681dc-0x0;var _0x422441=_0x74f3[_0xa681dc];return _0x422441;};'use strict';var _=require(_0x374f('0x0'));var util=require(_0x374f('0x1'));var logger=require(_0x374f('0x2'))('api');var moment=require(_0x374f('0x3'));var BPromise=require(_0x374f('0x4'));var rp=require(_0x374f('0x5'));var fs=require('fs');var path=require(_0x374f('0x6'));var rimraf=require('rimraf');var config=require(_0x374f('0x7'));var attributes=require(_0x374f('0x8'));module['exports']=function(_0x1292f2,_0x1eb333){return _0x1292f2[_0x374f('0x9')](_0x374f('0xa'),attributes,{'tableName':_0x374f('0xb'),'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 48e0d15..4b67397 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 _0x2d17=['AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x462f33,_0x45533e){var _0x1e9e7a=function(_0x5d44de){while(--_0x5d44de){_0x462f33['push'](_0x462f33['shift']());}};_0x1e9e7a(++_0x45533e);}(_0x2d17,0x195));var _0x72d1=function(_0x3cb56b,_0x12512e){_0x3cb56b=_0x3cb56b-0x0;var _0x1a6b7d=_0x2d17[_0x3cb56b];return _0x1a6b7d;};'use strict';var _=require('lodash');var util=require(_0x72d1('0x0'));var moment=require(_0x72d1('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x72d1('0x2'));var db=require(_0x72d1('0x3'))['db'];var utils=require(_0x72d1('0x4'));var logger=require(_0x72d1('0x5'))('rpc');var config=require(_0x72d1('0x6'));var jayson=require(_0x72d1('0x7'));var client=jayson[_0x72d1('0x8')][_0x72d1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xeecf65,_0x78a459,_0x6f7b4e){return new BPromise(function(_0x2ab59c,_0x2352b9){return client[_0x72d1('0xa')](_0xeecf65,_0x6f7b4e)[_0x72d1('0xb')](function(_0x172e0e){logger['info'](_0x72d1('0xc'),_0x78a459,_0x72d1('0xd'));logger[_0x72d1('0xe')](_0x72d1('0xf'),_0x78a459,'request\x20sent',JSON[_0x72d1('0x10')](_0x172e0e));if(_0x172e0e[_0x72d1('0x11')]){if(_0x172e0e[_0x72d1('0x11')]['code']===0x1f4){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x78a459,_0x172e0e[_0x72d1('0x11')]['message']);return _0x2352b9(_0x172e0e[_0x72d1('0x11')][_0x72d1('0x12')]);}logger[_0x72d1('0x11')](_0x72d1('0xc'),_0x78a459,_0x172e0e[_0x72d1('0x11')][_0x72d1('0x12')]);return _0x2ab59c(_0x172e0e['error'][_0x72d1('0x12')]);}else{logger[_0x72d1('0x13')](_0x72d1('0xc'),_0x78a459,_0x72d1('0xd'));_0x2ab59c(_0x172e0e['result'][_0x72d1('0x12')]);}})[_0x72d1('0x14')](function(_0x5ad95e){logger[_0x72d1('0x11')](_0x72d1('0xc'),_0x78a459,_0x5ad95e);_0x2352b9(_0x5ad95e);});});} \ No newline at end of file +var _0x3a85=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util'];(function(_0x441644,_0x5a8f34){var _0x4326d9=function(_0x58f63f){while(--_0x58f63f){_0x441644['push'](_0x441644['shift']());}};_0x4326d9(++_0x5a8f34);}(_0x3a85,0x1cd));var _0x53a8=function(_0x1f20ef,_0x3cf650){_0x1f20ef=_0x1f20ef-0x0;var _0x170f61=_0x3a85[_0x1f20ef];return _0x170f61;};'use strict';var _=require('lodash');var util=require(_0x53a8('0x0'));var moment=require('moment');var BPromise=require(_0x53a8('0x1'));var rs=require(_0x53a8('0x2'));var fs=require('fs');var Redis=require(_0x53a8('0x3'));var db=require(_0x53a8('0x4'))['db'];var utils=require(_0x53a8('0x5'));var logger=require(_0x53a8('0x6'))(_0x53a8('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x53a8('0x8')][_0x53a8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a17e1,_0x222092,_0x3ee33d){return new BPromise(function(_0x4845b6,_0x3d525a){return client[_0x53a8('0xa')](_0x4a17e1,_0x3ee33d)['then'](function(_0x3f6d4a){logger[_0x53a8('0xb')](_0x53a8('0xc'),_0x222092,_0x53a8('0xd'));logger[_0x53a8('0xe')](_0x53a8('0xf'),_0x222092,_0x53a8('0xd'),JSON[_0x53a8('0x10')](_0x3f6d4a));if(_0x3f6d4a[_0x53a8('0x11')]){if(_0x3f6d4a['error'][_0x53a8('0x12')]===0x1f4){logger[_0x53a8('0x11')](_0x53a8('0xc'),_0x222092,_0x3f6d4a[_0x53a8('0x11')]['message']);return _0x3d525a(_0x3f6d4a[_0x53a8('0x11')]['message']);}logger[_0x53a8('0x11')](_0x53a8('0xc'),_0x222092,_0x3f6d4a['error'][_0x53a8('0x13')]);return _0x4845b6(_0x3f6d4a[_0x53a8('0x11')]['message']);}else{logger[_0x53a8('0xb')](_0x53a8('0xc'),_0x222092,'request\x20sent');_0x4845b6(_0x3f6d4a[_0x53a8('0x14')][_0x53a8('0x13')]);}})[_0x53a8('0x15')](function(_0x4a7c8d){logger[_0x53a8('0x11')](_0x53a8('0xc'),_0x222092,_0x4a7c8d);_0x3d525a(_0x4a7c8d);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index f4b17d6..42c8a6f 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 _0x644f=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','post','create','/:id','update','delete','destroy','util','path','connect-timeout','express','Router'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x644f,0x177));var _0xf644=function(_0x5c3ae9,_0x450f9a){_0x5c3ae9=_0x5c3ae9-0x0;var _0x3f5950=_0x644f[_0x5c3ae9];return _0x3f5950;};'use strict';var multer=require('multer');var util=require(_0xf644('0x0'));var path=require(_0xf644('0x1'));var timeout=require(_0xf644('0x2'));var express=require(_0xf644('0x3'));var router=express[_0xf644('0x4')]();var fs_extra=require(_0xf644('0x5'));var auth=require(_0xf644('0x6'));var interaction=require(_0xf644('0x7'));var config=require(_0xf644('0x8'));var controller=require('./analyticMetric.controller');router['get']('/',auth[_0xf644('0x9')](),controller[_0xf644('0xa')]);router[_0xf644('0xb')]('/:id',auth[_0xf644('0x9')](),controller[_0xf644('0xc')]);router[_0xf644('0xd')]('/',auth[_0xf644('0x9')](),controller[_0xf644('0xe')]);router['put'](_0xf644('0xf'),auth[_0xf644('0x9')](),controller[_0xf644('0x10')]);router[_0xf644('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xf644('0x12')]);module['exports']=router; \ No newline at end of file +var _0x3e9d=['put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','./analyticMetric.controller','get','isAuthenticated','/:id','show','post','create'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x3e9d,0x1ba));var _0xd3e9=function(_0x3287e1,_0x229d40){_0x3287e1=_0x3287e1-0x0;var _0x15916f=_0x3e9d[_0x3287e1];return _0x15916f;};'use strict';var multer=require(_0xd3e9('0x0'));var util=require(_0xd3e9('0x1'));var path=require('path');var timeout=require(_0xd3e9('0x2'));var express=require(_0xd3e9('0x3'));var router=express[_0xd3e9('0x4')]();var fs_extra=require(_0xd3e9('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd3e9('0x6'));var controller=require(_0xd3e9('0x7'));router[_0xd3e9('0x8')]('/',auth[_0xd3e9('0x9')](),controller['index']);router['get'](_0xd3e9('0xa'),auth[_0xd3e9('0x9')](),controller[_0xd3e9('0xb')]);router[_0xd3e9('0xc')]('/',auth[_0xd3e9('0x9')](),controller[_0xd3e9('0xd')]);router[_0xd3e9('0xe')]('/:id',auth[_0xd3e9('0x9')](),controller[_0xd3e9('0xf')]);router[_0xd3e9('0x10')](_0xd3e9('0xa'),auth[_0xd3e9('0x9')](),controller[_0xd3e9('0x11')]);module[_0xd3e9('0x12')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 09a44fc..164b18f 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 _0x7187=['sequelize','exports','TEXT'];(function(_0x405779,_0x240a35){var _0x4b0a63=function(_0xf8372f){while(--_0xf8372f){_0x405779['push'](_0x405779['shift']());}};_0x4b0a63(++_0x240a35);}(_0x7187,0xc0));var _0x7718=function(_0x4f85d4,_0x1755c5){_0x4f85d4=_0x4f85d4-0x0;var _0x4556bf=_0x7187[_0x4f85d4];return _0x4556bf;};'use strict';var Sequelize=require(_0x7718('0x0'));module[_0x7718('0x1')]={'tree':{'type':Sequelize[_0x7718('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x5eed=['exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5eed,0x145));var _0xd5ee=function(_0x349876,_0x5675a6){_0x349876=_0x349876-0x0;var _0x228824=_0x5eed[_0x349876];return _0x228824;};'use strict';var Sequelize=require('sequelize');module[_0xd5ee('0x0')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index bf05bcd..3b4ee3e 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 _0x9590=['name','send','index','map','type','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','AnalyticTreeReport','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','reject','update','then','destroy','error','stack'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x9590,0x14c));var _0x0959=function(_0x283bc2,_0x2699d4){_0x283bc2=_0x283bc2-0x0;var _0x2927e6=_0x9590[_0x283bc2];return _0x2927e6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0959('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0959('0x1'));var moment=require(_0x0959('0x2'));var BPromise=require(_0x0959('0x3'));var Mustache=require(_0x0959('0x4'));var util=require(_0x0959('0x5'));var path=require(_0x0959('0x6'));var sox=require(_0x0959('0x7'));var csv=require(_0x0959('0x8'));var ejs=require(_0x0959('0x9'));var fs=require('fs');var fs_extra=require(_0x0959('0xa'));var _=require('lodash');var squel=require(_0x0959('0xb'));var crypto=require('crypto');var jsforce=require(_0x0959('0xc'));var deskjs=require(_0x0959('0xd'));var toCsv=require(_0x0959('0x8'));var querystring=require(_0x0959('0xe'));var Papa=require('papaparse');var Redis=require(_0x0959('0xf'));var authService=require(_0x0959('0x10'));var qs=require(_0x0959('0x11'));var as=require(_0x0959('0x12'));var hardwareService=require(_0x0959('0x13'));var logger=require(_0x0959('0x14'))(_0x0959('0x15'));var utils=require('../../config/utils');var config=require(_0x0959('0x16'));var licenseUtil=require(_0x0959('0x17'));var db=require(_0x0959('0x18'))['db'];function respondWithStatusCode(_0x335fdd,_0x54e078){_0x54e078=_0x54e078||0xcc;return function(_0x4bde8d){if(_0x4bde8d){return _0x335fdd[_0x0959('0x19')](_0x54e078);}return _0x335fdd[_0x0959('0x1a')](_0x54e078)[_0x0959('0x1b')]();};}function respondWithResult(_0x511b24,_0xdf0749){_0xdf0749=_0xdf0749||0xc8;return function(_0x27721e){if(_0x27721e){return _0x511b24[_0x0959('0x1a')](_0xdf0749)[_0x0959('0x1c')](_0x27721e);}};}function respondWithFilteredResult(_0x1defa9,_0x5b5342){return function(_0x4fc96e){if(_0x4fc96e){var _0x230822=typeof _0x5b5342[_0x0959('0x1d')]===_0x0959('0x1e')&&typeof _0x5b5342['limit']===_0x0959('0x1e');var _0x1e45f4=_0x4fc96e[_0x0959('0x1f')];var _0x3ad8ce=_0x230822?0x0:_0x5b5342[_0x0959('0x1d')];var _0x256941=_0x230822?_0x4fc96e[_0x0959('0x1f')]:_0x5b5342[_0x0959('0x1d')]+_0x5b5342['limit'];var _0x365264;if(_0x256941>=_0x1e45f4){_0x256941=_0x1e45f4;_0x365264=0xc8;}else{_0x365264=0xce;}_0x1defa9[_0x0959('0x1a')](_0x365264);return _0x1defa9['set']('Content-Range',_0x3ad8ce+'-'+_0x256941+'/'+_0x1e45f4)[_0x0959('0x1c')](_0x4fc96e);}return null;};}function patchUpdates(_0x34205b){return function(_0x2f211d){try{jsonpatch['apply'](_0x2f211d,_0x34205b,!![]);}catch(_0x2cdc9e){return BPromise[_0x0959('0x20')](_0x2cdc9e);}return _0x2f211d['save']();};}function saveUpdates(_0x53e535,_0x1f4725){return function(_0x390ce9){if(_0x390ce9){return _0x390ce9[_0x0959('0x21')](_0x53e535)[_0x0959('0x22')](function(_0x2e4153){return _0x2e4153;});}return null;};}function removeEntity(_0x443f55,_0x564559){return function(_0x267623){if(_0x267623){return _0x267623[_0x0959('0x23')]()[_0x0959('0x22')](function(){_0x443f55[_0x0959('0x1a')](0xcc)[_0x0959('0x1b')]();});}};}function handleEntityNotFound(_0x108614,_0x21c104){return function(_0x5a9a92){if(!_0x5a9a92){_0x108614[_0x0959('0x19')](0x194);}return _0x5a9a92;};}function handleError(_0x14347a,_0xbd6d40){_0xbd6d40=_0xbd6d40||0x1f4;return function(_0x2a2368){logger[_0x0959('0x24')](_0x2a2368[_0x0959('0x25')]);if(_0x2a2368[_0x0959('0x26')]){delete _0x2a2368['name'];}_0x14347a['status'](_0xbd6d40)[_0x0959('0x27')](_0x2a2368);};}exports[_0x0959('0x28')]=function(_0x51a970,_0x1212f4){var _0x1cfdf0={},_0xa5f64d={},_0x45e40e={'count':0x0,'rows':[]};var _0x32c994=_[_0x0959('0x29')](db['AnalyticTreeReport']['rawAttributes'],function(_0x3cfe95){return{'name':_0x3cfe95['fieldName'],'type':_0x3cfe95[_0x0959('0x2a')]['key']};});_0xa5f64d['model']=_['map'](_0x32c994,_0x0959('0x26'));_0xa5f64d[_0x0959('0x2b')]=_[_0x0959('0x2c')](_0x51a970[_0x0959('0x2b')]);_0xa5f64d[_0x0959('0x2d')]=_[_0x0959('0x2e')](_0xa5f64d['model'],_0xa5f64d[_0x0959('0x2b')]);_0x1cfdf0[_0x0959('0x2f')]=_[_0x0959('0x2e')](_0xa5f64d[_0x0959('0x30')],qs[_0x0959('0x31')](_0x51a970[_0x0959('0x2b')]['fields']));_0x1cfdf0['attributes']=_0x1cfdf0[_0x0959('0x2f')]['length']?_0x1cfdf0['attributes']:_0xa5f64d[_0x0959('0x30')];if(!_0x51a970['query'][_0x0959('0x32')](_0x0959('0x33'))){_0x1cfdf0[_0x0959('0x34')]=qs[_0x0959('0x34')](_0x51a970['query']['limit']);_0x1cfdf0['offset']=qs['offset'](_0x51a970[_0x0959('0x2b')][_0x0959('0x1d')]);}_0x1cfdf0[_0x0959('0x35')]=qs['sort'](_0x51a970[_0x0959('0x2b')][_0x0959('0x36')]);_0x1cfdf0[_0x0959('0x37')]=qs['filters'](_[_0x0959('0x38')](_0x51a970[_0x0959('0x2b')],_0xa5f64d[_0x0959('0x2d')]),_0x32c994);if(_0x51a970[_0x0959('0x2b')][_0x0959('0x39')]){_0x1cfdf0['where']=_[_0x0959('0x3a')](_0x1cfdf0[_0x0959('0x37')],{'$or':_[_0x0959('0x29')](_0x32c994,function(_0xa031be){if(_0xa031be['type']!==_0x0959('0x3b')){var _0x36991e={};_0x36991e[_0xa031be['name']]={'$like':'%'+_0x51a970[_0x0959('0x2b')][_0x0959('0x39')]+'%'};return _0x36991e;}})});}_0x1cfdf0=_[_0x0959('0x3a')]({},_0x1cfdf0,_0x51a970[_0x0959('0x3c')]);var _0x442692={'where':_0x1cfdf0[_0x0959('0x37')]};return db[_0x0959('0x3d')][_0x0959('0x1f')](_0x442692)[_0x0959('0x22')](function(_0xf71fff){_0x45e40e[_0x0959('0x1f')]=_0xf71fff;if(_0x51a970[_0x0959('0x2b')][_0x0959('0x3e')]){_0x1cfdf0[_0x0959('0x3f')]=[{'all':!![]}];}return db[_0x0959('0x3d')][_0x0959('0x40')](_0x1cfdf0);})[_0x0959('0x22')](function(_0x176f82){_0x45e40e[_0x0959('0x41')]=_0x176f82;return _0x45e40e;})['then'](respondWithFilteredResult(_0x1212f4,_0x1cfdf0))[_0x0959('0x42')](handleError(_0x1212f4,null));};exports[_0x0959('0x43')]=function(_0x5e26de,_0x1b3e47){var _0x21c005={'raw':!![],'where':{'id':_0x5e26de[_0x0959('0x44')]['id']}},_0x2c8991={};_0x2c8991[_0x0959('0x30')]=_[_0x0959('0x2c')](db[_0x0959('0x3d')][_0x0959('0x45')]);_0x2c8991['query']=_[_0x0959('0x2c')](_0x5e26de[_0x0959('0x2b')]);_0x2c8991[_0x0959('0x2d')]=_[_0x0959('0x2e')](_0x2c8991[_0x0959('0x30')],_0x2c8991[_0x0959('0x2b')]);_0x21c005[_0x0959('0x2f')]=_[_0x0959('0x2e')](_0x2c8991[_0x0959('0x30')],qs[_0x0959('0x31')](_0x5e26de[_0x0959('0x2b')][_0x0959('0x31')]));_0x21c005['attributes']=_0x21c005['attributes'][_0x0959('0x46')]?_0x21c005[_0x0959('0x2f')]:_0x2c8991[_0x0959('0x30')];if(_0x5e26de[_0x0959('0x2b')][_0x0959('0x3e')]){_0x21c005[_0x0959('0x3f')]=[{'all':!![]}];}_0x21c005=_[_0x0959('0x3a')]({},_0x21c005,_0x5e26de[_0x0959('0x3c')]);return db[_0x0959('0x3d')][_0x0959('0x47')](_0x21c005)['then'](handleEntityNotFound(_0x1b3e47,null))[_0x0959('0x22')](respondWithResult(_0x1b3e47,null))[_0x0959('0x42')](handleError(_0x1b3e47,null));};exports[_0x0959('0x48')]=function(_0x207cad,_0x202aca){return db[_0x0959('0x3d')][_0x0959('0x48')](_0x207cad['body'],{})[_0x0959('0x22')](respondWithResult(_0x202aca,0xc9))[_0x0959('0x42')](handleError(_0x202aca,null));};exports[_0x0959('0x21')]=function(_0x34d541,_0x48324b){if(_0x34d541[_0x0959('0x49')]['id']){delete _0x34d541[_0x0959('0x49')]['id'];}return db['AnalyticTreeReport'][_0x0959('0x47')]({'where':{'id':_0x34d541['params']['id']}})[_0x0959('0x22')](handleEntityNotFound(_0x48324b,null))[_0x0959('0x22')](saveUpdates(_0x34d541['body'],null))[_0x0959('0x22')](respondWithResult(_0x48324b,null))[_0x0959('0x42')](handleError(_0x48324b,null));};exports[_0x0959('0x23')]=function(_0x210be9,_0x131f3c){return db[_0x0959('0x3d')][_0x0959('0x47')]({'where':{'id':_0x210be9[_0x0959('0x44')]['id']}})[_0x0959('0x22')](handleEntityNotFound(_0x131f3c,null))[_0x0959('0x22')](removeEntity(_0x131f3c,null))[_0x0959('0x42')](handleError(_0x131f3c,null));}; \ No newline at end of file +var _0x62e6=['util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','order','sort','pick','where','merge','include','rows','catch','keys','options','find','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x3adb98,_0x29935f){var _0x4dbaef=function(_0x226afb){while(--_0x226afb){_0x3adb98['push'](_0x3adb98['shift']());}};_0x4dbaef(++_0x29935f);}(_0x62e6,0xd5));var _0x662e=function(_0x46c9cc,_0xd27dca){_0x46c9cc=_0x46c9cc-0x0;var _0x21b46e=_0x62e6[_0x46c9cc];return _0x21b46e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x662e('0x0'));var zipdir=require(_0x662e('0x1'));var jsonpatch=require(_0x662e('0x2'));var rp=require(_0x662e('0x3'));var moment=require(_0x662e('0x4'));var BPromise=require(_0x662e('0x5'));var Mustache=require('mustache');var util=require(_0x662e('0x6'));var path=require(_0x662e('0x7'));var sox=require(_0x662e('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x662e('0x9'));var _=require(_0x662e('0xa'));var squel=require('squel');var crypto=require(_0x662e('0xb'));var jsforce=require(_0x662e('0xc'));var deskjs=require(_0x662e('0xd'));var toCsv=require(_0x662e('0xe'));var querystring=require(_0x662e('0xf'));var Papa=require(_0x662e('0x10'));var Redis=require(_0x662e('0x11'));var authService=require(_0x662e('0x12'));var qs=require(_0x662e('0x13'));var as=require(_0x662e('0x14'));var hardwareService=require(_0x662e('0x15'));var logger=require(_0x662e('0x16'))(_0x662e('0x17'));var utils=require(_0x662e('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x662e('0x19'));var db=require(_0x662e('0x1a'))['db'];function respondWithStatusCode(_0x3e94ef,_0x549995){_0x549995=_0x549995||0xcc;return function(_0x1766ac){if(_0x1766ac){return _0x3e94ef['sendStatus'](_0x549995);}return _0x3e94ef[_0x662e('0x1b')](_0x549995)[_0x662e('0x1c')]();};}function respondWithResult(_0xd17212,_0x5aa8dc){_0x5aa8dc=_0x5aa8dc||0xc8;return function(_0x2db8da){if(_0x2db8da){return _0xd17212[_0x662e('0x1b')](_0x5aa8dc)[_0x662e('0x1d')](_0x2db8da);}};}function respondWithFilteredResult(_0x580848,_0x14741f){return function(_0x1ad8df){if(_0x1ad8df){var _0xa08d55=typeof _0x14741f[_0x662e('0x1e')]===_0x662e('0x1f')&&typeof _0x14741f['limit']==='undefined';var _0x3d4e8f=_0x1ad8df[_0x662e('0x20')];var _0x243128=_0xa08d55?0x0:_0x14741f[_0x662e('0x1e')];var _0x30f22b=_0xa08d55?_0x1ad8df['count']:_0x14741f[_0x662e('0x1e')]+_0x14741f[_0x662e('0x21')];var _0x59dd65;if(_0x30f22b>=_0x3d4e8f){_0x30f22b=_0x3d4e8f;_0x59dd65=0xc8;}else{_0x59dd65=0xce;}_0x580848['status'](_0x59dd65);return _0x580848[_0x662e('0x22')]('Content-Range',_0x243128+'-'+_0x30f22b+'/'+_0x3d4e8f)['json'](_0x1ad8df);}return null;};}function patchUpdates(_0x5c0741){return function(_0x2e8571){try{jsonpatch[_0x662e('0x23')](_0x2e8571,_0x5c0741,!![]);}catch(_0x1197b3){return BPromise[_0x662e('0x24')](_0x1197b3);}return _0x2e8571[_0x662e('0x25')]();};}function saveUpdates(_0x33f390,_0x2a6672){return function(_0x12da54){if(_0x12da54){return _0x12da54[_0x662e('0x26')](_0x33f390)[_0x662e('0x27')](function(_0x366900){return _0x366900;});}return null;};}function removeEntity(_0x38c02e,_0x1c1c91){return function(_0x3fb270){if(_0x3fb270){return _0x3fb270[_0x662e('0x28')]()[_0x662e('0x27')](function(){_0x38c02e[_0x662e('0x1b')](0xcc)[_0x662e('0x1c')]();});}};}function handleEntityNotFound(_0x4f4a32,_0x1c556a){return function(_0x20d0c9){if(!_0x20d0c9){_0x4f4a32[_0x662e('0x29')](0x194);}return _0x20d0c9;};}function handleError(_0x3d6447,_0x156811){_0x156811=_0x156811||0x1f4;return function(_0xff3e06){logger[_0x662e('0x2a')](_0xff3e06[_0x662e('0x2b')]);if(_0xff3e06['name']){delete _0xff3e06[_0x662e('0x2c')];}_0x3d6447[_0x662e('0x1b')](_0x156811)[_0x662e('0x2d')](_0xff3e06);};}exports[_0x662e('0x2e')]=function(_0xbe4da5,_0x541df3){var _0x486135={},_0x35de49={},_0x4320fb={'count':0x0,'rows':[]};var _0x2a3b35=_[_0x662e('0x2f')](db[_0x662e('0x30')][_0x662e('0x31')],function(_0x2f920f){return{'name':_0x2f920f[_0x662e('0x32')],'type':_0x2f920f[_0x662e('0x33')][_0x662e('0x34')]};});_0x35de49['model']=_[_0x662e('0x2f')](_0x2a3b35,'name');_0x35de49[_0x662e('0x35')]=_['keys'](_0xbe4da5['query']);_0x35de49[_0x662e('0x36')]=_[_0x662e('0x37')](_0x35de49[_0x662e('0x38')],_0x35de49[_0x662e('0x35')]);_0x486135['attributes']=_['intersection'](_0x35de49[_0x662e('0x38')],qs['fields'](_0xbe4da5[_0x662e('0x35')][_0x662e('0x39')]));_0x486135['attributes']=_0x486135[_0x662e('0x3a')]['length']?_0x486135[_0x662e('0x3a')]:_0x35de49[_0x662e('0x38')];if(!_0xbe4da5[_0x662e('0x35')]['hasOwnProperty']('nolimit')){_0x486135[_0x662e('0x21')]=qs[_0x662e('0x21')](_0xbe4da5[_0x662e('0x35')][_0x662e('0x21')]);_0x486135[_0x662e('0x1e')]=qs[_0x662e('0x1e')](_0xbe4da5[_0x662e('0x35')][_0x662e('0x1e')]);}_0x486135[_0x662e('0x3b')]=qs[_0x662e('0x3c')](_0xbe4da5['query'][_0x662e('0x3c')]);_0x486135['where']=qs[_0x662e('0x36')](_[_0x662e('0x3d')](_0xbe4da5[_0x662e('0x35')],_0x35de49[_0x662e('0x36')]),_0x2a3b35);if(_0xbe4da5[_0x662e('0x35')]['filter']){_0x486135[_0x662e('0x3e')]=_[_0x662e('0x3f')](_0x486135[_0x662e('0x3e')],{'$or':_[_0x662e('0x2f')](_0x2a3b35,function(_0xc3ba27){if(_0xc3ba27[_0x662e('0x33')]!=='VIRTUAL'){var _0x206bb8={};_0x206bb8[_0xc3ba27[_0x662e('0x2c')]]={'$like':'%'+_0xbe4da5[_0x662e('0x35')]['filter']+'%'};return _0x206bb8;}})});}_0x486135=_[_0x662e('0x3f')]({},_0x486135,_0xbe4da5['options']);var _0x5c06fe={'where':_0x486135[_0x662e('0x3e')]};return db[_0x662e('0x30')][_0x662e('0x20')](_0x5c06fe)[_0x662e('0x27')](function(_0x226f92){_0x4320fb[_0x662e('0x20')]=_0x226f92;if(_0xbe4da5[_0x662e('0x35')]['includeAll']){_0x486135[_0x662e('0x40')]=[{'all':!![]}];}return db[_0x662e('0x30')]['findAll'](_0x486135);})[_0x662e('0x27')](function(_0x319070){_0x4320fb[_0x662e('0x41')]=_0x319070;return _0x4320fb;})[_0x662e('0x27')](respondWithFilteredResult(_0x541df3,_0x486135))[_0x662e('0x42')](handleError(_0x541df3,null));};exports['show']=function(_0x5e1df7,_0x469fac){var _0x555c69={'raw':!![],'where':{'id':_0x5e1df7['params']['id']}},_0x263f4e={};_0x263f4e[_0x662e('0x38')]=_[_0x662e('0x43')](db[_0x662e('0x30')][_0x662e('0x31')]);_0x263f4e['query']=_[_0x662e('0x43')](_0x5e1df7[_0x662e('0x35')]);_0x263f4e[_0x662e('0x36')]=_[_0x662e('0x37')](_0x263f4e[_0x662e('0x38')],_0x263f4e[_0x662e('0x35')]);_0x555c69[_0x662e('0x3a')]=_[_0x662e('0x37')](_0x263f4e[_0x662e('0x38')],qs['fields'](_0x5e1df7['query'][_0x662e('0x39')]));_0x555c69[_0x662e('0x3a')]=_0x555c69[_0x662e('0x3a')]['length']?_0x555c69[_0x662e('0x3a')]:_0x263f4e[_0x662e('0x38')];if(_0x5e1df7[_0x662e('0x35')]['includeAll']){_0x555c69[_0x662e('0x40')]=[{'all':!![]}];}_0x555c69=_[_0x662e('0x3f')]({},_0x555c69,_0x5e1df7[_0x662e('0x44')]);return db['AnalyticTreeReport'][_0x662e('0x45')](_0x555c69)['then'](handleEntityNotFound(_0x469fac,null))[_0x662e('0x27')](respondWithResult(_0x469fac,null))[_0x662e('0x42')](handleError(_0x469fac,null));};exports[_0x662e('0x46')]=function(_0x575a79,_0x3338ce){return db[_0x662e('0x30')][_0x662e('0x46')](_0x575a79[_0x662e('0x47')],{})[_0x662e('0x27')](respondWithResult(_0x3338ce,0xc9))['catch'](handleError(_0x3338ce,null));};exports[_0x662e('0x26')]=function(_0x11ccf1,_0x2e8cc9){if(_0x11ccf1[_0x662e('0x47')]['id']){delete _0x11ccf1[_0x662e('0x47')]['id'];}return db[_0x662e('0x30')][_0x662e('0x45')]({'where':{'id':_0x11ccf1[_0x662e('0x48')]['id']}})[_0x662e('0x27')](handleEntityNotFound(_0x2e8cc9,null))[_0x662e('0x27')](saveUpdates(_0x11ccf1[_0x662e('0x47')],null))[_0x662e('0x27')](respondWithResult(_0x2e8cc9,null))[_0x662e('0x42')](handleError(_0x2e8cc9,null));};exports[_0x662e('0x28')]=function(_0x4e9d52,_0x60b828){return db[_0x662e('0x30')][_0x662e('0x45')]({'where':{'id':_0x4e9d52['params']['id']}})['then'](handleEntityNotFound(_0x60b828,null))['then'](removeEntity(_0x60b828,null))[_0x662e('0x42')](handleError(_0x60b828,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index e5cb447..9f7f4ec 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 _0x88b5=['./analyticTreeReport.attributes','define','analytics_report_trees','util','request-promise','path','rimraf','../../config/environment'];(function(_0x2355ea,_0x3a3090){var _0x30af6d=function(_0x3bff5f){while(--_0x3bff5f){_0x2355ea['push'](_0x2355ea['shift']());}};_0x30af6d(++_0x3a3090);}(_0x88b5,0x143));var _0x588b=function(_0x15de8c,_0x196308){_0x15de8c=_0x15de8c-0x0;var _0x1d4009=_0x88b5[_0x15de8c];return _0x1d4009;};'use strict';var _=require('lodash');var util=require(_0x588b('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x588b('0x1'));var fs=require('fs');var path=require(_0x588b('0x2'));var rimraf=require(_0x588b('0x3'));var config=require(_0x588b('0x4'));var attributes=require(_0x588b('0x5'));module['exports']=function(_0xc8aeb7,_0x20dda9){return _0xc8aeb7[_0x588b('0x6')]('AnalyticTreeReport',attributes,{'tableName':_0x588b('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x471c=['./analyticTreeReport.attributes','exports','define','analytics_report_trees','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0x471c,0xad));var _0xc471=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x471c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc471('0x0'));var util=require(_0xc471('0x1'));var logger=require(_0xc471('0x2'))('api');var moment=require(_0xc471('0x3'));var BPromise=require(_0xc471('0x4'));var rp=require(_0xc471('0x5'));var fs=require('fs');var path=require(_0xc471('0x6'));var rimraf=require(_0xc471('0x7'));var config=require(_0xc471('0x8'));var attributes=require(_0xc471('0x9'));module[_0xc471('0xa')]=function(_0x1ed31e,_0x4b738e){return _0x1ed31e[_0xc471('0xb')]('AnalyticTreeReport',attributes,{'tableName':_0xc471('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 e3e3de9..a5c9fae 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(_0x2066e2,_0x46279e){var _0xfc938d=function(_0x3a507c){while(--_0x3a507c){_0x2066e2['push'](_0x2066e2['shift']());}};_0xfc938d(++_0x46279e);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0xc4aa[_0x3511d3];return _0x5d6321;};'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(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x5ca7d6,_0x192729){_0x5ca7d6=_0x5ca7d6-0x0;var _0x3bdf92=_0x7a54[_0x5ca7d6];return _0x3bdf92;};'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 6390487..10041f5 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 _0x6cf7=['show','post','create','put','/:id','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','get','isAuthenticated','index'];(function(_0x51ac09,_0x383098){var _0x3f827d=function(_0x2d8d0f){while(--_0x2d8d0f){_0x51ac09['push'](_0x51ac09['shift']());}};_0x3f827d(++_0x383098);}(_0x6cf7,0x1e7));var _0x76cf=function(_0x2f48e9,_0x1bd1b4){_0x2f48e9=_0x2f48e9-0x0;var _0x34d5bb=_0x6cf7[_0x2f48e9];return _0x34d5bb;};'use strict';var multer=require(_0x76cf('0x0'));var util=require(_0x76cf('0x1'));var path=require(_0x76cf('0x2'));var timeout=require(_0x76cf('0x3'));var express=require('express');var router=express[_0x76cf('0x4')]();var fs_extra=require(_0x76cf('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticTreeReport.controller');router[_0x76cf('0x6')]('/',auth[_0x76cf('0x7')](),controller[_0x76cf('0x8')]);router[_0x76cf('0x6')]('/:id',auth[_0x76cf('0x7')](),controller[_0x76cf('0x9')]);router[_0x76cf('0xa')]('/',auth['isAuthenticated'](),controller[_0x76cf('0xb')]);router[_0x76cf('0xc')](_0x76cf('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x76cf('0xe')](_0x76cf('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x76cf('0xf')]=router; \ No newline at end of file +var _0x2478=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','update','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x21a8a4,_0x2d5e00){var _0x21cc22=function(_0x2ab59d){while(--_0x2ab59d){_0x21a8a4['push'](_0x21a8a4['shift']());}};_0x21cc22(++_0x2d5e00);}(_0x2478,0xf7));var _0x8247=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x2478[_0x9cd4c3];return _0x4c9025;};'use strict';var multer=require(_0x8247('0x0'));var util=require('util');var path=require(_0x8247('0x1'));var timeout=require(_0x8247('0x2'));var express=require(_0x8247('0x3'));var router=express[_0x8247('0x4')]();var fs_extra=require(_0x8247('0x5'));var auth=require(_0x8247('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8247('0x7'));var controller=require('./analyticTreeReport.controller');router[_0x8247('0x8')]('/',auth[_0x8247('0x9')](),controller[_0x8247('0xa')]);router[_0x8247('0x8')](_0x8247('0xb'),auth[_0x8247('0x9')](),controller[_0x8247('0xc')]);router[_0x8247('0xd')]('/',auth[_0x8247('0x9')](),controller[_0x8247('0xe')]);router['put']('/:id',auth[_0x8247('0x9')](),controller[_0x8247('0xf')]);router['delete']('/:id',auth[_0x8247('0x9')](),controller[_0x8247('0x10')]);module[_0x8247('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 6498c6a..27ad72b 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 _0x0cd6=['exports','STRING','sequelize'];(function(_0x139c24,_0x562ba1){var _0xed1b28=function(_0x3d0f24){while(--_0x3d0f24){_0x139c24['push'](_0x139c24['shift']());}};_0xed1b28(++_0x562ba1);}(_0x0cd6,0x113));var _0x60cd=function(_0x1cec84,_0x101ec2){_0x1cec84=_0x1cec84-0x0;var _0x12b7d3=_0x0cd6[_0x1cec84];return _0x12b7d3;};'use strict';var Sequelize=require(_0x60cd('0x0'));module[_0x60cd('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0x60cd('0x2')]},'type':{'type':Sequelize[_0x60cd('0x2')]}}; \ No newline at end of file +var _0x0328=['STRING','sequelize','exports'];(function(_0x54cc03,_0xe6c22b){var _0x133344=function(_0x2063d7){while(--_0x2063d7){_0x54cc03['push'](_0x54cc03['shift']());}};_0x133344(++_0xe6c22b);}(_0x0328,0x172));var _0x8032=function(_0x31eac8,_0x2bc0f4){_0x31eac8=_0x31eac8-0x0;var _0x37bb59=_0x0328[_0x31eac8];return _0x37bb59;};'use strict';var Sequelize=require(_0x8032('0x0'));module[_0x8032('0x1')]={'name':{'type':Sequelize[_0x8032('0x2')]},'basename':{'type':Sequelize[_0x8032('0x2')]},'type':{'type':Sequelize[_0x8032('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index e5041f9..11c949b 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 _0xe795=['sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','error','stack','name','send','index','map','Attachment','rawAttributes','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','fields','omit','createdAt','updatedAt','body','create','update','file','originalname','basename','filename','download','join','root','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0xe795,0x9e));var _0x5e79=function(_0x28d109,_0x33d022){_0x28d109=_0x28d109-0x0;var _0x3d6d28=_0xe795[_0x28d109];return _0x3d6d28;};'use strict';var emlformat=require(_0x5e79('0x0'));var rimraf=require(_0x5e79('0x1'));var zipdir=require(_0x5e79('0x2'));var jsonpatch=require(_0x5e79('0x3'));var rp=require(_0x5e79('0x4'));var moment=require(_0x5e79('0x5'));var BPromise=require(_0x5e79('0x6'));var Mustache=require(_0x5e79('0x7'));var util=require(_0x5e79('0x8'));var path=require(_0x5e79('0x9'));var sox=require(_0x5e79('0xa'));var csv=require(_0x5e79('0xb'));var ejs=require(_0x5e79('0xc'));var fs=require('fs');var fs_extra=require(_0x5e79('0xd'));var _=require(_0x5e79('0xe'));var squel=require('squel');var crypto=require(_0x5e79('0xf'));var jsforce=require(_0x5e79('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x5e79('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5e79('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5e79('0x12'));var as=require(_0x5e79('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x5e79('0x14'));var config=require(_0x5e79('0x15'));var licenseUtil=require(_0x5e79('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x435565,_0x41e1d6){_0x41e1d6=_0x41e1d6||0xcc;return function(_0x23bed6){if(_0x23bed6){return _0x435565[_0x5e79('0x17')](_0x41e1d6);}return _0x435565[_0x5e79('0x18')](_0x41e1d6)[_0x5e79('0x19')]();};}function respondWithResult(_0x37a90d,_0x1bba85){_0x1bba85=_0x1bba85||0xc8;return function(_0x1c1d68){if(_0x1c1d68){return _0x37a90d[_0x5e79('0x18')](_0x1bba85)[_0x5e79('0x1a')](_0x1c1d68);}};}function respondWithFilteredResult(_0x52e409,_0x121509){return function(_0x19f481){if(_0x19f481){var _0x375967=typeof _0x121509[_0x5e79('0x1b')]===_0x5e79('0x1c')&&typeof _0x121509[_0x5e79('0x1d')]===_0x5e79('0x1c');var _0x594c64=_0x19f481['count'];var _0x5c0d57=_0x375967?0x0:_0x121509[_0x5e79('0x1b')];var _0x32573e=_0x375967?_0x19f481[_0x5e79('0x1e')]:_0x121509[_0x5e79('0x1b')]+_0x121509[_0x5e79('0x1d')];var _0x4206ab;if(_0x32573e>=_0x594c64){_0x32573e=_0x594c64;_0x4206ab=0xc8;}else{_0x4206ab=0xce;}_0x52e409['status'](_0x4206ab);return _0x52e409[_0x5e79('0x1f')](_0x5e79('0x20'),_0x5c0d57+'-'+_0x32573e+'/'+_0x594c64)[_0x5e79('0x1a')](_0x19f481);}return null;};}function patchUpdates(_0x23fa17){return function(_0x1e9a09){try{jsonpatch[_0x5e79('0x21')](_0x1e9a09,_0x23fa17,!![]);}catch(_0x1a9beb){return BPromise['reject'](_0x1a9beb);}return _0x1e9a09[_0x5e79('0x22')]();};}function saveUpdates(_0xfb3c01,_0x40fa2d){return function(_0x3ee581){if(_0x3ee581){return _0x3ee581['update'](_0xfb3c01)[_0x5e79('0x23')](function(_0x114784){return _0x114784;});}return null;};}function removeEntity(_0x5a5dcd,_0x3c7233){return function(_0x5465ce){if(_0x5465ce){return _0x5465ce[_0x5e79('0x24')]()[_0x5e79('0x23')](function(){_0x5a5dcd[_0x5e79('0x18')](0xcc)[_0x5e79('0x19')]();});}};}function handleEntityNotFound(_0x526d47,_0x315f5f){return function(_0x13b680){if(!_0x13b680){_0x526d47[_0x5e79('0x17')](0x194);}return _0x13b680;};}function handleError(_0x30ec68,_0x59e2e3){_0x59e2e3=_0x59e2e3||0x1f4;return function(_0x36b8c9){logger[_0x5e79('0x25')](_0x36b8c9[_0x5e79('0x26')]);if(_0x36b8c9[_0x5e79('0x27')]){delete _0x36b8c9['name'];}_0x30ec68[_0x5e79('0x18')](_0x59e2e3)[_0x5e79('0x28')](_0x36b8c9);};}exports[_0x5e79('0x29')]=function(_0x304eae,_0x500b7b){var _0xe16c2a={},_0x222f39={},_0x3a2601={'count':0x0,'rows':[]};var _0x5ca9af=_[_0x5e79('0x2a')](db[_0x5e79('0x2b')][_0x5e79('0x2c')],function(_0x2409a1){return{'name':_0x2409a1['fieldName'],'type':_0x2409a1[_0x5e79('0x2d')]['key']};});_0x222f39[_0x5e79('0x2e')]=_[_0x5e79('0x2a')](_0x5ca9af,_0x5e79('0x27'));_0x222f39[_0x5e79('0x2f')]=_[_0x5e79('0x30')](_0x304eae[_0x5e79('0x2f')]);_0x222f39[_0x5e79('0x31')]=_[_0x5e79('0x32')](_0x222f39['model'],_0x222f39['query']);_0xe16c2a[_0x5e79('0x33')]=_[_0x5e79('0x32')](_0x222f39[_0x5e79('0x2e')],qs['fields'](_0x304eae[_0x5e79('0x2f')]['fields']));_0xe16c2a['attributes']=_0xe16c2a[_0x5e79('0x33')][_0x5e79('0x34')]?_0xe16c2a[_0x5e79('0x33')]:_0x222f39[_0x5e79('0x2e')];if(!_0x304eae[_0x5e79('0x2f')][_0x5e79('0x35')](_0x5e79('0x36'))){_0xe16c2a[_0x5e79('0x1d')]=qs['limit'](_0x304eae['query'][_0x5e79('0x1d')]);_0xe16c2a['offset']=qs[_0x5e79('0x1b')](_0x304eae['query']['offset']);}_0xe16c2a[_0x5e79('0x37')]=qs['sort'](_0x304eae['query'][_0x5e79('0x38')]);_0xe16c2a[_0x5e79('0x39')]=qs['filters'](_[_0x5e79('0x3a')](_0x304eae[_0x5e79('0x2f')],_0x222f39[_0x5e79('0x31')]),_0x5ca9af);if(_0x304eae[_0x5e79('0x2f')][_0x5e79('0x3b')]){_0xe16c2a[_0x5e79('0x39')]=_[_0x5e79('0x3c')](_0xe16c2a[_0x5e79('0x39')],{'$or':_[_0x5e79('0x2a')](_0x5ca9af,function(_0x2d074d){if(_0x2d074d[_0x5e79('0x2d')]!=='VIRTUAL'){var _0x5d0ff7={};_0x5d0ff7[_0x2d074d[_0x5e79('0x27')]]={'$like':'%'+_0x304eae[_0x5e79('0x2f')][_0x5e79('0x3b')]+'%'};return _0x5d0ff7;}})});}_0xe16c2a=_[_0x5e79('0x3c')]({},_0xe16c2a,_0x304eae[_0x5e79('0x3d')]);var _0x16dfd7={'where':_0xe16c2a[_0x5e79('0x39')]};return db[_0x5e79('0x2b')][_0x5e79('0x1e')](_0x16dfd7)['then'](function(_0xf02b8d){_0x3a2601[_0x5e79('0x1e')]=_0xf02b8d;if(_0x304eae[_0x5e79('0x2f')][_0x5e79('0x3e')]){_0xe16c2a[_0x5e79('0x3f')]=[{'all':!![]}];}return db[_0x5e79('0x2b')][_0x5e79('0x40')](_0xe16c2a);})['then'](function(_0x52eda7){_0x3a2601[_0x5e79('0x41')]=_0x52eda7;return _0x3a2601;})[_0x5e79('0x23')](respondWithFilteredResult(_0x500b7b,_0xe16c2a))[_0x5e79('0x42')](handleError(_0x500b7b,null));};exports[_0x5e79('0x43')]=function(_0x1d2233,_0x459415){var _0x407fb9={'raw':!![],'where':{'id':_0x1d2233[_0x5e79('0x44')]['id']}},_0x4ea6cc={};_0x4ea6cc[_0x5e79('0x2e')]=_[_0x5e79('0x30')](db[_0x5e79('0x2b')]['rawAttributes']);_0x4ea6cc['query']=_[_0x5e79('0x30')](_0x1d2233[_0x5e79('0x2f')]);_0x4ea6cc[_0x5e79('0x31')]=_[_0x5e79('0x32')](_0x4ea6cc['model'],_0x4ea6cc[_0x5e79('0x2f')]);_0x407fb9[_0x5e79('0x33')]=_[_0x5e79('0x32')](_0x4ea6cc['model'],qs['fields'](_0x1d2233['query']['fields']));_0x407fb9[_0x5e79('0x33')]=_0x407fb9[_0x5e79('0x33')]['length']?_0x407fb9[_0x5e79('0x33')]:_0x4ea6cc[_0x5e79('0x2e')];if(_0x1d2233[_0x5e79('0x2f')][_0x5e79('0x3e')]){_0x407fb9[_0x5e79('0x3f')]=[{'all':!![]}];}_0x407fb9=_[_0x5e79('0x3c')]({},_0x407fb9,_0x1d2233[_0x5e79('0x3d')]);return db[_0x5e79('0x2b')][_0x5e79('0x45')](_0x407fb9)['then'](handleEntityNotFound(_0x459415,null))['then'](respondWithResult(_0x459415,null))[_0x5e79('0x42')](handleError(_0x459415,null));};exports['clone']=function(_0x4313f6,_0xab0f00){var _0x1a776d={'where':{'id':_0x4313f6['params']['id']}},_0xa8092d={};_0xa8092d['model']=_[_0x5e79('0x30')](db['Attachment']['rawAttributes']);_0x1a776d[_0x5e79('0x33')]=_[_0x5e79('0x32')](_0xa8092d[_0x5e79('0x2e')],qs[_0x5e79('0x46')](_0x4313f6[_0x5e79('0x2f')][_0x5e79('0x46')]));_0x1a776d[_0x5e79('0x33')]=_0x1a776d['attributes'][_0x5e79('0x34')]?_0x1a776d[_0x5e79('0x33')]:_0xa8092d['model'];if(_0x4313f6[_0x5e79('0x2f')][_0x5e79('0x3e')]){_0x1a776d[_0x5e79('0x3f')]=[{'all':!![]}];}_0x1a776d=_[_0x5e79('0x3c')]({},_0x1a776d,_0x4313f6[_0x5e79('0x3d')]);return db['Attachment'][_0x5e79('0x45')](_0x1a776d)['then'](handleEntityNotFound(_0xab0f00,null))[_0x5e79('0x23')](function(_0x105e5b){if(_0x105e5b){var _0x44d670=_0x105e5b['get']({'plain':!![]});_0x44d670=qs[_0x5e79('0x47')](_0x44d670,['id',_0x5e79('0x48'),_0x5e79('0x49')]);_0x4313f6[_0x5e79('0x4a')]=_[_0x5e79('0x47')](_0x4313f6['body'],['id','createdAt','updatedAt']);return db['Attachment'][_0x5e79('0x4b')](_[_0x5e79('0x3c')](_0x44d670,_0x4313f6[_0x5e79('0x4a')]),{'include':_0x4313f6[_0x5e79('0x2f')][_0x5e79('0x3e')]?[{'all':!![]}]:undefined});}})[_0x5e79('0x23')](respondWithResult(_0xab0f00,0xc9))[_0x5e79('0x42')](handleError(_0xab0f00,null));};exports[_0x5e79('0x4c')]=function(_0x479827,_0x3b15b1){if(_0x479827[_0x5e79('0x4a')]['id']){delete _0x479827[_0x5e79('0x4a')]['id'];}return db['Attachment']['find']({'where':{'id':_0x479827[_0x5e79('0x44')]['id']}})[_0x5e79('0x23')](handleEntityNotFound(_0x3b15b1,null))[_0x5e79('0x23')](saveUpdates(_0x479827[_0x5e79('0x4a')],null))[_0x5e79('0x23')](respondWithResult(_0x3b15b1,null))[_0x5e79('0x42')](handleError(_0x3b15b1,null));};exports[_0x5e79('0x24')]=function(_0x534d76,_0x3388f0){return db[_0x5e79('0x2b')]['find']({'where':{'id':_0x534d76[_0x5e79('0x44')]['id']}})[_0x5e79('0x23')](handleEntityNotFound(_0x3388f0,null))[_0x5e79('0x23')](removeEntity(_0x3388f0,null))[_0x5e79('0x42')](handleError(_0x3388f0,null));};exports[_0x5e79('0x4b')]=function(_0x3b6aca,_0x45323f,_0x5fd723){_0x3b6aca[_0x5e79('0x4a')]['name']=_0x3b6aca[_0x5e79('0x4d')][_0x5e79('0x4e')];_0x3b6aca[_0x5e79('0x4a')][_0x5e79('0x4f')]=_0x3b6aca[_0x5e79('0x4d')][_0x5e79('0x50')];_0x3b6aca[_0x5e79('0x4a')][_0x5e79('0x2d')]=_0x3b6aca[_0x5e79('0x4d')]['mimetype'];return db[_0x5e79('0x2b')][_0x5e79('0x4b')](_0x3b6aca[_0x5e79('0x4a')])[_0x5e79('0x23')](respondWithResult(_0x45323f,0xc9))[_0x5e79('0x42')](handleError(_0x45323f,null));};exports[_0x5e79('0x51')]=function(_0x3268d4,_0x50b652,_0xea2410){return db['Attachment']['findOne']({'where':{'id':_0x3268d4[_0x5e79('0x44')]['id']},'raw':!![]})[_0x5e79('0x23')](handleEntityNotFound(_0x50b652,null))[_0x5e79('0x23')](function(_0x18413c){if(_0x18413c){var _0x12ad94=_0x18413c['ChatOfflineMessageId']!==null;var _0x2a5dcb=path[_0x5e79('0x52')](config[_0x5e79('0x53')],'server/files/attachments/');if(_0x12ad94){_0x2a5dcb=path[_0x5e79('0x52')](_0x2a5dcb,'offline-chat/');}var _0x4f0e63=path[_0x5e79('0x52')](_0x2a5dcb,_0x18413c[_0x5e79('0x4f')]);return _0x50b652[_0x5e79('0x51')](_0x4f0e63);}})[_0x5e79('0x42')](handleError(_0x50b652,null));}; \ No newline at end of file +var _0x9299=['update','destroy','then','error','name','send','index','map','Attachment','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','filter','options','findAll','rows','catch','show','params','includeAll','include','find','get','omit','createdAt','updatedAt','body','create','originalname','basename','file','mimetype','download','findOne','ChatOfflineMessageId','join','server/files/attachments/','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','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','end','json','offset','undefined','count','limit','set','apply','reject','save'];(function(_0x915de9,_0xabf9e5){var _0x274129=function(_0x27fd79){while(--_0x27fd79){_0x915de9['push'](_0x915de9['shift']());}};_0x274129(++_0xabf9e5);}(_0x9299,0x139));var _0x9929=function(_0x3f0e54,_0x549b1d){_0x3f0e54=_0x3f0e54-0x0;var _0x2e8036=_0x9299[_0x3f0e54];return _0x2e8036;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9929('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9929('0x1'));var rp=require('request-promise');var moment=require(_0x9929('0x2'));var BPromise=require(_0x9929('0x3'));var Mustache=require(_0x9929('0x4'));var util=require(_0x9929('0x5'));var path=require(_0x9929('0x6'));var sox=require('sox');var csv=require(_0x9929('0x7'));var ejs=require(_0x9929('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9929('0x9'));var squel=require(_0x9929('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9929('0xb'));var toCsv=require('to-csv');var querystring=require(_0x9929('0xc'));var Papa=require(_0x9929('0xd'));var Redis=require(_0x9929('0xe'));var authService=require(_0x9929('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x9929('0x10'));var hardwareService=require(_0x9929('0x11'));var logger=require('../../config/logger')(_0x9929('0x12'));var utils=require(_0x9929('0x13'));var config=require(_0x9929('0x14'));var licenseUtil=require(_0x9929('0x15'));var db=require(_0x9929('0x16'))['db'];function respondWithStatusCode(_0x28a7a5,_0x1d2565){_0x1d2565=_0x1d2565||0xcc;return function(_0x45c8be){if(_0x45c8be){return _0x28a7a5[_0x9929('0x17')](_0x1d2565);}return _0x28a7a5[_0x9929('0x18')](_0x1d2565)[_0x9929('0x19')]();};}function respondWithResult(_0x39b999,_0x37ae0b){_0x37ae0b=_0x37ae0b||0xc8;return function(_0xcfc6c4){if(_0xcfc6c4){return _0x39b999[_0x9929('0x18')](_0x37ae0b)[_0x9929('0x1a')](_0xcfc6c4);}};}function respondWithFilteredResult(_0x5d41e5,_0x2266c){return function(_0x2dffb8){if(_0x2dffb8){var _0xc1300=typeof _0x2266c[_0x9929('0x1b')]===_0x9929('0x1c')&&typeof _0x2266c['limit']===_0x9929('0x1c');var _0x2ffd4b=_0x2dffb8[_0x9929('0x1d')];var _0x280c7b=_0xc1300?0x0:_0x2266c[_0x9929('0x1b')];var _0x254847=_0xc1300?_0x2dffb8[_0x9929('0x1d')]:_0x2266c[_0x9929('0x1b')]+_0x2266c[_0x9929('0x1e')];var _0x3c31fc;if(_0x254847>=_0x2ffd4b){_0x254847=_0x2ffd4b;_0x3c31fc=0xc8;}else{_0x3c31fc=0xce;}_0x5d41e5[_0x9929('0x18')](_0x3c31fc);return _0x5d41e5[_0x9929('0x1f')]('Content-Range',_0x280c7b+'-'+_0x254847+'/'+_0x2ffd4b)[_0x9929('0x1a')](_0x2dffb8);}return null;};}function patchUpdates(_0x545d05){return function(_0xb148f5){try{jsonpatch[_0x9929('0x20')](_0xb148f5,_0x545d05,!![]);}catch(_0x4446f1){return BPromise[_0x9929('0x21')](_0x4446f1);}return _0xb148f5[_0x9929('0x22')]();};}function saveUpdates(_0xf34dc6,_0x451082){return function(_0x46c830){if(_0x46c830){return _0x46c830[_0x9929('0x23')](_0xf34dc6)['then'](function(_0x36a9ee){return _0x36a9ee;});}return null;};}function removeEntity(_0x5a8dee,_0x3e3941){return function(_0x34952c){if(_0x34952c){return _0x34952c[_0x9929('0x24')]()[_0x9929('0x25')](function(){_0x5a8dee[_0x9929('0x18')](0xcc)[_0x9929('0x19')]();});}};}function handleEntityNotFound(_0x131547,_0x180b05){return function(_0x1439d9){if(!_0x1439d9){_0x131547[_0x9929('0x17')](0x194);}return _0x1439d9;};}function handleError(_0x53cc8f,_0x42e449){_0x42e449=_0x42e449||0x1f4;return function(_0x762727){logger[_0x9929('0x26')](_0x762727['stack']);if(_0x762727['name']){delete _0x762727[_0x9929('0x27')];}_0x53cc8f['status'](_0x42e449)[_0x9929('0x28')](_0x762727);};}exports[_0x9929('0x29')]=function(_0x2e878f,_0x3c3fbb){var _0x16dd9f={},_0x54cebe={},_0x5dc8a4={'count':0x0,'rows':[]};var _0x27bfcb=_[_0x9929('0x2a')](db[_0x9929('0x2b')][_0x9929('0x2c')],function(_0x2b339b){return{'name':_0x2b339b[_0x9929('0x2d')],'type':_0x2b339b[_0x9929('0x2e')][_0x9929('0x2f')]};});_0x54cebe[_0x9929('0x30')]=_['map'](_0x27bfcb,_0x9929('0x27'));_0x54cebe[_0x9929('0x31')]=_[_0x9929('0x32')](_0x2e878f[_0x9929('0x31')]);_0x54cebe['filters']=_[_0x9929('0x33')](_0x54cebe[_0x9929('0x30')],_0x54cebe[_0x9929('0x31')]);_0x16dd9f[_0x9929('0x34')]=_[_0x9929('0x33')](_0x54cebe[_0x9929('0x30')],qs[_0x9929('0x35')](_0x2e878f[_0x9929('0x31')]['fields']));_0x16dd9f[_0x9929('0x34')]=_0x16dd9f[_0x9929('0x34')][_0x9929('0x36')]?_0x16dd9f[_0x9929('0x34')]:_0x54cebe['model'];if(!_0x2e878f[_0x9929('0x31')][_0x9929('0x37')](_0x9929('0x38'))){_0x16dd9f['limit']=qs['limit'](_0x2e878f['query'][_0x9929('0x1e')]);_0x16dd9f[_0x9929('0x1b')]=qs['offset'](_0x2e878f[_0x9929('0x31')][_0x9929('0x1b')]);}_0x16dd9f[_0x9929('0x39')]=qs[_0x9929('0x3a')](_0x2e878f[_0x9929('0x31')][_0x9929('0x3a')]);_0x16dd9f[_0x9929('0x3b')]=qs[_0x9929('0x3c')](_['pick'](_0x2e878f[_0x9929('0x31')],_0x54cebe[_0x9929('0x3c')]),_0x27bfcb);if(_0x2e878f[_0x9929('0x31')]['filter']){_0x16dd9f[_0x9929('0x3b')]=_[_0x9929('0x3d')](_0x16dd9f[_0x9929('0x3b')],{'$or':_[_0x9929('0x2a')](_0x27bfcb,function(_0x50d358){if(_0x50d358['type']!=='VIRTUAL'){var _0x59cbd6={};_0x59cbd6[_0x50d358['name']]={'$like':'%'+_0x2e878f[_0x9929('0x31')][_0x9929('0x3e')]+'%'};return _0x59cbd6;}})});}_0x16dd9f=_[_0x9929('0x3d')]({},_0x16dd9f,_0x2e878f[_0x9929('0x3f')]);var _0x3cb8fb={'where':_0x16dd9f[_0x9929('0x3b')]};return db['Attachment'][_0x9929('0x1d')](_0x3cb8fb)['then'](function(_0x1d4f33){_0x5dc8a4[_0x9929('0x1d')]=_0x1d4f33;if(_0x2e878f[_0x9929('0x31')]['includeAll']){_0x16dd9f['include']=[{'all':!![]}];}return db[_0x9929('0x2b')][_0x9929('0x40')](_0x16dd9f);})[_0x9929('0x25')](function(_0x4bddc8){_0x5dc8a4[_0x9929('0x41')]=_0x4bddc8;return _0x5dc8a4;})[_0x9929('0x25')](respondWithFilteredResult(_0x3c3fbb,_0x16dd9f))[_0x9929('0x42')](handleError(_0x3c3fbb,null));};exports[_0x9929('0x43')]=function(_0x2ea689,_0x40ae53){var _0x21d7ed={'raw':!![],'where':{'id':_0x2ea689[_0x9929('0x44')]['id']}},_0x244e03={};_0x244e03[_0x9929('0x30')]=_[_0x9929('0x32')](db['Attachment'][_0x9929('0x2c')]);_0x244e03[_0x9929('0x31')]=_[_0x9929('0x32')](_0x2ea689['query']);_0x244e03[_0x9929('0x3c')]=_[_0x9929('0x33')](_0x244e03[_0x9929('0x30')],_0x244e03[_0x9929('0x31')]);_0x21d7ed[_0x9929('0x34')]=_[_0x9929('0x33')](_0x244e03[_0x9929('0x30')],qs[_0x9929('0x35')](_0x2ea689[_0x9929('0x31')][_0x9929('0x35')]));_0x21d7ed[_0x9929('0x34')]=_0x21d7ed[_0x9929('0x34')][_0x9929('0x36')]?_0x21d7ed[_0x9929('0x34')]:_0x244e03[_0x9929('0x30')];if(_0x2ea689[_0x9929('0x31')][_0x9929('0x45')]){_0x21d7ed[_0x9929('0x46')]=[{'all':!![]}];}_0x21d7ed=_[_0x9929('0x3d')]({},_0x21d7ed,_0x2ea689[_0x9929('0x3f')]);return db[_0x9929('0x2b')][_0x9929('0x47')](_0x21d7ed)[_0x9929('0x25')](handleEntityNotFound(_0x40ae53,null))[_0x9929('0x25')](respondWithResult(_0x40ae53,null))['catch'](handleError(_0x40ae53,null));};exports['clone']=function(_0x2c223f,_0x15a2ba){var _0x98fae1={'where':{'id':_0x2c223f[_0x9929('0x44')]['id']}},_0x2f352b={};_0x2f352b[_0x9929('0x30')]=_['keys'](db['Attachment'][_0x9929('0x2c')]);_0x98fae1[_0x9929('0x34')]=_[_0x9929('0x33')](_0x2f352b[_0x9929('0x30')],qs[_0x9929('0x35')](_0x2c223f[_0x9929('0x31')][_0x9929('0x35')]));_0x98fae1['attributes']=_0x98fae1[_0x9929('0x34')][_0x9929('0x36')]?_0x98fae1[_0x9929('0x34')]:_0x2f352b[_0x9929('0x30')];if(_0x2c223f[_0x9929('0x31')][_0x9929('0x45')]){_0x98fae1['include']=[{'all':!![]}];}_0x98fae1=_[_0x9929('0x3d')]({},_0x98fae1,_0x2c223f[_0x9929('0x3f')]);return db[_0x9929('0x2b')]['find'](_0x98fae1)[_0x9929('0x25')](handleEntityNotFound(_0x15a2ba,null))['then'](function(_0x2c8d3e){if(_0x2c8d3e){var _0x587b78=_0x2c8d3e[_0x9929('0x48')]({'plain':!![]});_0x587b78=qs[_0x9929('0x49')](_0x587b78,['id',_0x9929('0x4a'),_0x9929('0x4b')]);_0x2c223f[_0x9929('0x4c')]=_['omit'](_0x2c223f[_0x9929('0x4c')],['id',_0x9929('0x4a'),'updatedAt']);return db[_0x9929('0x2b')]['create'](_['merge'](_0x587b78,_0x2c223f['body']),{'include':_0x2c223f[_0x9929('0x31')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x9929('0x25')](respondWithResult(_0x15a2ba,0xc9))[_0x9929('0x42')](handleError(_0x15a2ba,null));};exports[_0x9929('0x23')]=function(_0x1f9974,_0x2423c3){if(_0x1f9974[_0x9929('0x4c')]['id']){delete _0x1f9974[_0x9929('0x4c')]['id'];}return db[_0x9929('0x2b')][_0x9929('0x47')]({'where':{'id':_0x1f9974[_0x9929('0x44')]['id']}})[_0x9929('0x25')](handleEntityNotFound(_0x2423c3,null))[_0x9929('0x25')](saveUpdates(_0x1f9974['body'],null))[_0x9929('0x25')](respondWithResult(_0x2423c3,null))[_0x9929('0x42')](handleError(_0x2423c3,null));};exports['destroy']=function(_0x491c75,_0x20c283){return db['Attachment']['find']({'where':{'id':_0x491c75[_0x9929('0x44')]['id']}})[_0x9929('0x25')](handleEntityNotFound(_0x20c283,null))[_0x9929('0x25')](removeEntity(_0x20c283,null))[_0x9929('0x42')](handleError(_0x20c283,null));};exports[_0x9929('0x4d')]=function(_0xcd6fa9,_0x569eaf,_0x1dd8b2){_0xcd6fa9['body'][_0x9929('0x27')]=_0xcd6fa9['file'][_0x9929('0x4e')];_0xcd6fa9[_0x9929('0x4c')][_0x9929('0x4f')]=_0xcd6fa9[_0x9929('0x50')]['filename'];_0xcd6fa9['body'][_0x9929('0x2e')]=_0xcd6fa9[_0x9929('0x50')][_0x9929('0x51')];return db[_0x9929('0x2b')]['create'](_0xcd6fa9[_0x9929('0x4c')])['then'](respondWithResult(_0x569eaf,0xc9))['catch'](handleError(_0x569eaf,null));};exports[_0x9929('0x52')]=function(_0x1330a9,_0x3a236c,_0x5a0600){return db[_0x9929('0x2b')][_0x9929('0x53')]({'where':{'id':_0x1330a9[_0x9929('0x44')]['id']},'raw':!![]})[_0x9929('0x25')](handleEntityNotFound(_0x3a236c,null))[_0x9929('0x25')](function(_0xc1b10a){if(_0xc1b10a){var _0x465201=_0xc1b10a[_0x9929('0x54')]!==null;var _0x3f031b=path[_0x9929('0x55')](config['root'],_0x9929('0x56'));if(_0x465201){_0x3f031b=path['join'](_0x3f031b,'offline-chat/');}var _0x49581f=path[_0x9929('0x55')](_0x3f031b,_0xc1b10a[_0x9929('0x4f')]);return _0x3a236c[_0x9929('0x52')](_0x49581f);}})['catch'](handleError(_0x3a236c,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index b83a0bc..fcdaa0f 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 _0x2173=['exports','define','Attachment','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment','./attachment.attributes'];(function(_0x5509de,_0x17aefa){var _0x44a07c=function(_0x123ad1){while(--_0x123ad1){_0x5509de['push'](_0x5509de['shift']());}};_0x44a07c(++_0x17aefa);}(_0x2173,0xea));var _0x3217=function(_0x4bc4d1,_0x3cfc27){_0x4bc4d1=_0x4bc4d1-0x0;var _0x4dc5a8=_0x2173[_0x4bc4d1];return _0x4dc5a8;};'use strict';var _=require(_0x3217('0x0'));var util=require(_0x3217('0x1'));var logger=require(_0x3217('0x2'))(_0x3217('0x3'));var moment=require(_0x3217('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3217('0x5'));var config=require(_0x3217('0x6'));var attributes=require(_0x3217('0x7'));module[_0x3217('0x8')]=function(_0xa4cd6a,_0x3e168d){return _0xa4cd6a[_0x3217('0x9')](_0x3217('0xa'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb88d=['./attachment.attributes','exports','define','Attachment','attachments','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x3dbf5a,_0x4613fc){var _0x5e83a8=function(_0x523916){while(--_0x523916){_0x3dbf5a['push'](_0x3dbf5a['shift']());}};_0x5e83a8(++_0x4613fc);}(_0xb88d,0x101));var _0xdb88=function(_0x57e05f,_0x318b8d){_0x57e05f=_0x57e05f-0x0;var _0x435e54=_0xb88d[_0x57e05f];return _0x435e54;};'use strict';var _=require('lodash');var util=require(_0xdb88('0x0'));var logger=require(_0xdb88('0x1'))(_0xdb88('0x2'));var moment=require(_0xdb88('0x3'));var BPromise=require(_0xdb88('0x4'));var rp=require(_0xdb88('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xdb88('0x6'));var attributes=require(_0xdb88('0x7'));module[_0xdb88('0x8')]=function(_0x265c6f,_0x5439c8){return _0x265c6f[_0xdb88('0x9')](_0xdb88('0xa'),attributes,{'tableName':_0xdb88('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 693b129..e75caaf 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 _0xe205=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','CreateAttachment','Attachment','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x22959f,_0x38b2ab){var _0xa24fce=function(_0x5297ef){while(--_0x5297ef){_0x22959f['push'](_0x22959f['shift']());}};_0xa24fce(++_0x38b2ab);}(_0xe205,0xa7));var _0x5e20=function(_0x1eb3b0,_0x84bc40){_0x1eb3b0=_0x1eb3b0-0x0;var _0xbecd61=_0xe205[_0x1eb3b0];return _0xbecd61;};'use strict';var _=require(_0x5e20('0x0'));var util=require(_0x5e20('0x1'));var moment=require(_0x5e20('0x2'));var BPromise=require(_0x5e20('0x3'));var rs=require(_0x5e20('0x4'));var fs=require('fs');var Redis=require(_0x5e20('0x5'));var db=require(_0x5e20('0x6'))['db'];var utils=require(_0x5e20('0x7'));var logger=require(_0x5e20('0x8'))('rpc');var config=require(_0x5e20('0x9'));var jayson=require(_0x5e20('0xa'));var client=jayson[_0x5e20('0xb')][_0x5e20('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5eca5c,_0x4cc88d,_0x3a382f){return new BPromise(function(_0x4c9332,_0x533e18){return client[_0x5e20('0xd')](_0x5eca5c,_0x3a382f)[_0x5e20('0xe')](function(_0x5c1eee){logger[_0x5e20('0xf')](_0x5e20('0x10'),_0x4cc88d,_0x5e20('0x11'));logger[_0x5e20('0x12')]('Attachment,\x20%s,\x20%s,\x20%s',_0x4cc88d,_0x5e20('0x11'),JSON[_0x5e20('0x13')](_0x5c1eee));if(_0x5c1eee[_0x5e20('0x14')]){if(_0x5c1eee[_0x5e20('0x14')][_0x5e20('0x15')]===0x1f4){logger[_0x5e20('0x14')]('Attachment,\x20%s,\x20%s',_0x4cc88d,_0x5c1eee[_0x5e20('0x14')][_0x5e20('0x16')]);return _0x533e18(_0x5c1eee[_0x5e20('0x14')]['message']);}logger[_0x5e20('0x14')]('Attachment,\x20%s,\x20%s',_0x4cc88d,_0x5c1eee[_0x5e20('0x14')]['message']);return _0x4c9332(_0x5c1eee[_0x5e20('0x14')][_0x5e20('0x16')]);}else{logger[_0x5e20('0xf')](_0x5e20('0x10'),_0x4cc88d,_0x5e20('0x11'));_0x4c9332(_0x5c1eee['result'][_0x5e20('0x16')]);}})[_0x5e20('0x17')](function(_0x166ffd){logger[_0x5e20('0x14')](_0x5e20('0x10'),_0x4cc88d,_0x166ffd);_0x533e18(_0x166ffd);});});}exports[_0x5e20('0x18')]=function(_0x1cc706){var _0xf3488f=this;return new Promise(function(_0x4d3e4a,_0x434686){return db[_0x5e20('0x19')]['create'](_0x1cc706[_0x5e20('0x1a')],{'raw':_0x1cc706[_0x5e20('0x1b')]?_0x1cc706[_0x5e20('0x1b')][_0x5e20('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x2954fc){logger['info']('CreateAttachment',_0x1cc706);logger['debug']('CreateAttachment',_0x1cc706,JSON[_0x5e20('0x13')](_0x2954fc));_0x4d3e4a(_0x2954fc);})['catch'](function(_0x3d89e4){logger[_0x5e20('0x14')](_0x5e20('0x18'),_0x3d89e4[_0x5e20('0x16')],_0x1cc706);_0x434686(_0xf3488f[_0x5e20('0x14')](0x1f4,_0x3d89e4[_0x5e20('0x16')]));});});}; \ No newline at end of file +var _0x89e8=['then','debug','stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateAttachment','Attachment','create','options'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x89e8,0x74));var _0x889e=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x89e8[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x889e('0x0'));var util=require(_0x889e('0x1'));var moment=require(_0x889e('0x2'));var BPromise=require(_0x889e('0x3'));var rs=require(_0x889e('0x4'));var fs=require('fs');var Redis=require(_0x889e('0x5'));var db=require(_0x889e('0x6'))['db'];var utils=require(_0x889e('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x889e('0x8'));var client=jayson[_0x889e('0x9')][_0x889e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ed85f,_0x38eeae,_0x54f734){return new BPromise(function(_0x2bfae4,_0x42be62){return client[_0x889e('0xb')](_0x5ed85f,_0x54f734)['then'](function(_0x21c1d9){logger[_0x889e('0xc')](_0x889e('0xd'),_0x38eeae,_0x889e('0xe'));logger['debug'](_0x889e('0xf'),_0x38eeae,_0x889e('0xe'),JSON['stringify'](_0x21c1d9));if(_0x21c1d9[_0x889e('0x10')]){if(_0x21c1d9[_0x889e('0x10')][_0x889e('0x11')]===0x1f4){logger[_0x889e('0x10')]('Attachment,\x20%s,\x20%s',_0x38eeae,_0x21c1d9[_0x889e('0x10')][_0x889e('0x12')]);return _0x42be62(_0x21c1d9[_0x889e('0x10')]['message']);}logger[_0x889e('0x10')](_0x889e('0xd'),_0x38eeae,_0x21c1d9[_0x889e('0x10')][_0x889e('0x12')]);return _0x2bfae4(_0x21c1d9[_0x889e('0x10')]['message']);}else{logger['info'](_0x889e('0xd'),_0x38eeae,_0x889e('0xe'));_0x2bfae4(_0x21c1d9[_0x889e('0x13')][_0x889e('0x12')]);}})['catch'](function(_0x22fbf6){logger[_0x889e('0x10')]('Attachment,\x20%s,\x20%s',_0x38eeae,_0x22fbf6);_0x42be62(_0x22fbf6);});});}exports[_0x889e('0x14')]=function(_0x4f9b2c){var _0x75e219=this;return new Promise(function(_0x168fed,_0x232452){return db[_0x889e('0x15')][_0x889e('0x16')](_0x4f9b2c['body'],{'raw':_0x4f9b2c[_0x889e('0x17')]?_0x4f9b2c[_0x889e('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x889e('0x18')](function(_0x11abba){logger[_0x889e('0xc')]('CreateAttachment',_0x4f9b2c);logger[_0x889e('0x19')](_0x889e('0x14'),_0x4f9b2c,JSON[_0x889e('0x1a')](_0x11abba));_0x168fed(_0x11abba);})[_0x889e('0x1b')](function(_0x590b6f){logger['error'](_0x889e('0x14'),_0x590b6f[_0x889e('0x12')],_0x4f9b2c);_0x232452(_0x75e219[_0x889e('0x10')](0x1f4,_0x590b6f['message']));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index a056e19..1896395 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 _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xdb28,0x106));var _0x8db2=function(_0x3d3eb2,_0x37ef20){_0x3d3eb2=_0x3d3eb2-0x0;var _0x2d91e4=_0xdb28[_0x3d3eb2];return _0x2d91e4;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router; \ No newline at end of file +var _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0x7ee7cd,_0x436001){var _0x3fe015=function(_0x1ded3c){while(--_0x1ded3c){_0x7ee7cd['push'](_0x7ee7cd['shift']());}};_0x3fe015(++_0x436001);}(_0xadb5,0xad));var _0x5adb=function(_0x5afa4a,_0x457160){_0x5afa4a=_0x5afa4a-0x0;var _0x1bfb61=_0xadb5[_0x5afa4a];return _0x1bfb61;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./attachment.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index f90dcb4..550d07e 100644 --- a/server/api/authActiveDirectory/authActiveDirectory.controller.js +++ b/server/api/authActiveDirectory/authActiveDirectory.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['salt','role','disabled','blocked','admin','user','then','minutes','clearBlockUser','getLicense','catch','status','message','login','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','use','User','passport','passport-local','Strategy','bluebird','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','activedirectory','baseDN','domain','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','blockDuration','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'use strict';var passport=require(_0x0a9e('0x0'));var LocalStrategy=require(_0x0a9e('0x1'))[_0x0a9e('0x2')];var moment=require('moment');var ActiveDirectory=require('activedirectory2');var BPromise=require(_0x0a9e('0x3'));var util=require('util');var db=require(_0x0a9e('0x4'))['db'];var authService=require(_0x0a9e('0x5'));var utils=require(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var logger=require(_0x0a9e('0x8'))('api');function isActiveDirectoryConfigured(_0x219af0){var _0x441e3a=![];if(typeof _0x219af0[_0x0a9e('0x9')]!=='undefined'){_0x441e3a=_0x219af0['activedirectory'][_0x0a9e('0xa')]&&_0x219af0['activedirectory']['url']&&_0x219af0[_0x0a9e('0x9')][_0x0a9e('0xb')];}return _0x441e3a;}function adAuthenticate(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){try{var _0x50dfb2=new ActiveDirectory(_0x307b3e);_0x50dfb2['authenticate'](_0x3ab53f,_0xfeb75b,function(_0x4cfe67,_0x273d4d){if(_0x4cfe67){logger[_0x0a9e('0xc')](_0x0a9e('0xd'),_0x3ab53f,util[_0x0a9e('0xe')](_0x4cfe67,{'showHidden':![],'depth':null}));_0x4a4c56(_0x0a9e('0xf'));}else if(!_0x273d4d){logger[_0x0a9e('0xc')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x3ab53f);_0x4a4c56(_0x0a9e('0xf'));}else{_0xbd1168(_0x273d4d);}});}catch(_0x239b12){_0x4a4c56(_0x239b12);}});}function ActiveDirectoryAuthenticate(_0x2b4227,_0x281129,_0x44dcfd,_0x4d5611){var _0x52a03d,_0x22dccb;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x0a9e('0x10'),_0x281129);return _0x4d5611(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x0a9e('0x11')][_0x0a9e('0x12')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x0a9e('0x13')],'raw':!![]})['then'](function(_0x459eb1){_0x52a03d=_0x459eb1;if(!_0x52a03d[_0x0a9e('0x14')]){logger[_0x0a9e('0xc')](_0x0a9e('0x15'),_0x281129);throw new Error(_0x0a9e('0xf'));}return _0x2b4227[_0x0a9e('0x12')]({'logging':!![],'attributes':['id',_0x0a9e('0x16'),_0x0a9e('0x17'),_0x0a9e('0x18'),_0x0a9e('0x19'),_0x0a9e('0x1a'),_0x0a9e('0x1b'),'blockedAt'],'where':{'name':_0x281129,'role':{'$or':[_0x0a9e('0x1c'),_0x0a9e('0x1d'),'agent']},'adSsoEnabled':!![]}});})[_0x0a9e('0x1e')](function(_0x5a09ef){if(!_0x5a09ef||_0x5a09ef&&_0x5a09ef['name']!==_0x281129){throw new Error(_0x0a9e('0xf'));}_0x22dccb=_0x5a09ef;var _0x432e56=_0x22dccb[_0x0a9e('0x16')]+'@'+config[_0x0a9e('0x9')]['domain'];return adAuthenticate(config[_0x0a9e('0x9')],_0x432e56,_0x44dcfd);})[_0x0a9e('0x1e')](function(_0x3b45bc){if(_0x22dccb[_0x0a9e('0x1a')]){throw new Error(_0x0a9e('0xf'));}if(_0x52a03d[_0x0a9e('0x13')]>0x0){if(_0x22dccb[_0x0a9e('0x1b')]){if(moment(_0x22dccb['blockedAt'])['add'](_0x52a03d[_0x0a9e('0x13')],_0x0a9e('0x1f'))>moment()){throw new Error(_0x0a9e('0xf'));}return utils[_0x0a9e('0x20')](_0x22dccb,0x0,![],null)['then'](function(){return utils[_0x0a9e('0x21')](_0x22dccb);})['then'](function(){return _0x4d5611(null,_0x22dccb);});}else{return utils[_0x0a9e('0x21')](_0x22dccb)['then'](function(){return _0x4d5611(null,_0x22dccb);});}}else{return utils[_0x0a9e('0x21')](_0x22dccb)[_0x0a9e('0x1e')](function(){return _0x4d5611(null,_0x22dccb);});}})[_0x0a9e('0x22')](function(_0x14433c){return _0x4d5611(null,![],_0x14433c);});}function handleError(_0x140511,_0x1538a4,_0x11c3b6){return _0x140511[_0x0a9e('0x23')](_0x1538a4||0x1f4)['send']({'message':_0x11c3b6?_0x11c3b6[_0x0a9e('0x24')]||_0x11c3b6:''});}exports[_0x0a9e('0x25')]=function(_0x2b1f27,_0x2ec755,_0x5c877d){passport[_0x0a9e('0x26')](_0x0a9e('0x27'),function(_0x1843b2,_0x824a4f,_0x58b06f){var _0x563b45=_0x1843b2||_0x58b06f;if(_0x563b45){return handleError(_0x2ec755,0x191,_0x563b45);}if(!_0x824a4f){return handleError(_0x2ec755,0x194,{'message':_0x0a9e('0x28')});}else{var _0x2e8759={'payload':{'id':_0x824a4f['id'],'role':_0x824a4f[_0x0a9e('0x19')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x2e8759)[_0x0a9e('0x1e')](function(_0x5d1e0e){_0x2ec755[_0x0a9e('0x29')]({'id':_0x824a4f['id'],'token':_0x5d1e0e,'statusCall':'','isAlreadyLogged':_0x824a4f[_0x0a9e('0x2a')]});});}})(_0x2b1f27,_0x2ec755,_0x5c877d);};passport[_0x0a9e('0x2b')](_0x0a9e('0x27'),new LocalStrategy({'usernameField':_0x0a9e('0x16'),'passwordField':'password'},function(_0x66c1d2,_0x46f0a5,_0x40cb85){return ActiveDirectoryAuthenticate(db[_0x0a9e('0x2c')],_0x66c1d2,_0x46f0a5,_0x40cb85);})); \ No newline at end of file +var _0xa9e0=['salt','role','disabled','blocked','admin','user','then','minutes','clearBlockUser','getLicense','catch','status','message','login','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','use','User','passport','passport-local','Strategy','bluebird','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','activedirectory','baseDN','domain','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','blockDuration','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'use strict';var passport=require(_0x0a9e('0x0'));var LocalStrategy=require(_0x0a9e('0x1'))[_0x0a9e('0x2')];var moment=require('moment');var ActiveDirectory=require('activedirectory2');var BPromise=require(_0x0a9e('0x3'));var util=require('util');var db=require(_0x0a9e('0x4'))['db'];var authService=require(_0x0a9e('0x5'));var utils=require(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var logger=require(_0x0a9e('0x8'))('api');function isActiveDirectoryConfigured(_0x219af0){var _0x441e3a=![];if(typeof _0x219af0[_0x0a9e('0x9')]!=='undefined'){_0x441e3a=_0x219af0['activedirectory'][_0x0a9e('0xa')]&&_0x219af0['activedirectory']['url']&&_0x219af0[_0x0a9e('0x9')][_0x0a9e('0xb')];}return _0x441e3a;}function adAuthenticate(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){try{var _0x50dfb2=new ActiveDirectory(_0x307b3e);_0x50dfb2['authenticate'](_0x3ab53f,_0xfeb75b,function(_0x4cfe67,_0x273d4d){if(_0x4cfe67){logger[_0x0a9e('0xc')](_0x0a9e('0xd'),_0x3ab53f,util[_0x0a9e('0xe')](_0x4cfe67,{'showHidden':![],'depth':null}));_0x4a4c56(_0x0a9e('0xf'));}else if(!_0x273d4d){logger[_0x0a9e('0xc')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x3ab53f);_0x4a4c56(_0x0a9e('0xf'));}else{_0xbd1168(_0x273d4d);}});}catch(_0x239b12){_0x4a4c56(_0x239b12);}});}function ActiveDirectoryAuthenticate(_0x2b4227,_0x281129,_0x44dcfd,_0x4d5611){var _0x52a03d,_0x22dccb;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x0a9e('0x10'),_0x281129);return _0x4d5611(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x0a9e('0x11')][_0x0a9e('0x12')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x0a9e('0x13')],'raw':!![]})['then'](function(_0x459eb1){_0x52a03d=_0x459eb1;if(!_0x52a03d[_0x0a9e('0x14')]){logger[_0x0a9e('0xc')](_0x0a9e('0x15'),_0x281129);throw new Error(_0x0a9e('0xf'));}return _0x2b4227[_0x0a9e('0x12')]({'logging':!![],'attributes':['id',_0x0a9e('0x16'),_0x0a9e('0x17'),_0x0a9e('0x18'),_0x0a9e('0x19'),_0x0a9e('0x1a'),_0x0a9e('0x1b'),'blockedAt'],'where':{'name':_0x281129,'role':{'$or':[_0x0a9e('0x1c'),_0x0a9e('0x1d'),'agent']},'adSsoEnabled':!![]}});})[_0x0a9e('0x1e')](function(_0x5a09ef){if(!_0x5a09ef||_0x5a09ef&&_0x5a09ef['name']!==_0x281129){throw new Error(_0x0a9e('0xf'));}_0x22dccb=_0x5a09ef;var _0x432e56=_0x22dccb[_0x0a9e('0x16')]+'@'+config[_0x0a9e('0x9')]['domain'];return adAuthenticate(config[_0x0a9e('0x9')],_0x432e56,_0x44dcfd);})[_0x0a9e('0x1e')](function(_0x3b45bc){if(_0x22dccb[_0x0a9e('0x1a')]){throw new Error(_0x0a9e('0xf'));}if(_0x52a03d[_0x0a9e('0x13')]>0x0){if(_0x22dccb[_0x0a9e('0x1b')]){if(moment(_0x22dccb['blockedAt'])['add'](_0x52a03d[_0x0a9e('0x13')],_0x0a9e('0x1f'))>moment()){throw new Error(_0x0a9e('0xf'));}return utils[_0x0a9e('0x20')](_0x22dccb,0x0,![],null)['then'](function(){return utils[_0x0a9e('0x21')](_0x22dccb);})['then'](function(){return _0x4d5611(null,_0x22dccb);});}else{return utils[_0x0a9e('0x21')](_0x22dccb)['then'](function(){return _0x4d5611(null,_0x22dccb);});}}else{return utils[_0x0a9e('0x21')](_0x22dccb)[_0x0a9e('0x1e')](function(){return _0x4d5611(null,_0x22dccb);});}})[_0x0a9e('0x22')](function(_0x14433c){return _0x4d5611(null,![],_0x14433c);});}function handleError(_0x140511,_0x1538a4,_0x11c3b6){return _0x140511[_0x0a9e('0x23')](_0x1538a4||0x1f4)['send']({'message':_0x11c3b6?_0x11c3b6[_0x0a9e('0x24')]||_0x11c3b6:''});}exports[_0x0a9e('0x25')]=function(_0x2b1f27,_0x2ec755,_0x5c877d){passport[_0x0a9e('0x26')](_0x0a9e('0x27'),function(_0x1843b2,_0x824a4f,_0x58b06f){var _0x563b45=_0x1843b2||_0x58b06f;if(_0x563b45){return handleError(_0x2ec755,0x191,_0x563b45);}if(!_0x824a4f){return handleError(_0x2ec755,0x194,{'message':_0x0a9e('0x28')});}else{var _0x2e8759={'payload':{'id':_0x824a4f['id'],'role':_0x824a4f[_0x0a9e('0x19')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x2e8759)[_0x0a9e('0x1e')](function(_0x5d1e0e){_0x2ec755[_0x0a9e('0x29')]({'id':_0x824a4f['id'],'token':_0x5d1e0e,'statusCall':'','isAlreadyLogged':_0x824a4f[_0x0a9e('0x2a')]});});}})(_0x2b1f27,_0x2ec755,_0x5c877d);};passport[_0x0a9e('0x2b')](_0x0a9e('0x27'),new LocalStrategy({'usernameField':_0x0a9e('0x16'),'passwordField':'password'},function(_0x66c1d2,_0x46f0a5,_0x40cb85){return ActiveDirectoryAuthenticate(db[_0x0a9e('0x2c')],_0x66c1d2,_0x46f0a5,_0x40cb85);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 13c88c1..3459af4 100644 --- a/server/api/authActiveDirectory/index.js +++ b/server/api/authActiveDirectory/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x54ce=['./authActiveDirectory.controller','post','login','exports','express','Router'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x54ce,0x1c0));var _0xe54c=function(_0x412096,_0x419054){_0x412096=_0x412096-0x0;var _0xb19fdd=_0x54ce[_0x412096];return _0xb19fdd;};'use strict';var express=require(_0xe54c('0x0'));var router=express[_0xe54c('0x1')]();var controller=require(_0xe54c('0x2'));router[_0xe54c('0x3')]('/',controller[_0xe54c('0x4')]);module[_0xe54c('0x5')]=router; \ No newline at end of file +var _0x8e9e=['express','Router','post','login','exports'];(function(_0x54872b,_0x3eee62){var _0x45219b=function(_0x296ba6){while(--_0x296ba6){_0x54872b['push'](_0x54872b['shift']());}};_0x45219b(++_0x3eee62);}(_0x8e9e,0x10e));var _0xe8e9=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0x8e9e[_0x2f3848];return _0x102668;};'use strict';var express=require(_0xe8e9('0x0'));var router=express[_0xe8e9('0x1')]();var controller=require('./authActiveDirectory.controller');router[_0xe8e9('0x2')]('/',controller[_0xe8e9('0x3')]);module[_0xe8e9('0x4')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 44fb2b2..d5ba1bb 100644 --- a/server/api/authGoogle/authGoogle.controller.js +++ b/server/api/authGoogle/authGoogle.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x7a54,0x106));var _0x47a5=function(_0x5e2669,_0x4af8cc){_0x5e2669=_0x5e2669-0x0;var _0x37525d=_0x7a54[_0x5e2669];return _0x37525d;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file +var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x296904,_0x3fd4d6){var _0x361105=function(_0x4ee20f){while(--_0x4ee20f){_0x296904['push'](_0x296904['shift']());}};_0x361105(++_0x3fd4d6);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 2556df5..b412242 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 _0x64c4=['./authGoogle.controller','../user/user.controller.js','get','login','callback','isMiddleware','setTokenCookie','exports','passport'];(function(_0x535f6a,_0x129fa3){var _0x5c54e8=function(_0x387a4f){while(--_0x387a4f){_0x535f6a['push'](_0x535f6a['shift']());}};_0x5c54e8(++_0x129fa3);}(_0x64c4,0x13a));var _0x464c=function(_0x400cf6,_0x682017){_0x400cf6=_0x400cf6-0x0;var _0x2a11cb=_0x64c4[_0x400cf6];return _0x2a11cb;};'use strict';var express=require('express');var passport=require(_0x464c('0x0'));var router=express['Router']();var controller=require(_0x464c('0x1'));var userController=require(_0x464c('0x2'));var authService=require('../../components/auth/service');router[_0x464c('0x3')]('/',controller[_0x464c('0x4')]);router[_0x464c('0x3')]('/callback',controller[_0x464c('0x5')],authService[_0x464c('0x6')],userController[_0x464c('0x4')],authService[_0x464c('0x7')]);module[_0x464c('0x8')]=router; \ No newline at end of file +var _0x6537=['./authGoogle.controller','../user/user.controller.js','/callback','callback','login','exports','express'];(function(_0x189347,_0x5b1eaa){var _0x5aee9a=function(_0x194c32){while(--_0x194c32){_0x189347['push'](_0x189347['shift']());}};_0x5aee9a(++_0x5b1eaa);}(_0x6537,0x1e2));var _0x7653=function(_0xe2a994,_0x40aa67){_0xe2a994=_0xe2a994-0x0;var _0x528ce0=_0x6537[_0xe2a994];return _0x528ce0;};'use strict';var express=require(_0x7653('0x0'));var passport=require('passport');var router=express['Router']();var controller=require(_0x7653('0x1'));var userController=require(_0x7653('0x2'));var authService=require('../../components/auth/service');router['get']('/',controller['login']);router['get'](_0x7653('0x3'),controller[_0x7653('0x4')],authService['isMiddleware'],userController[_0x7653('0x5')],authService['setTokenCookie']);module[_0x7653('0x6')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index f38f917..53485a7 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 _0x5af0=['status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','securePassword','enforcePasswordHistory','validatePasswordPattern','previousPasswords','validatePasswordHistory','passwordHistoryLimit','resetPasswordToken','save','passport','passport-local','Strategy','lodash','randomstring','moment','../../components/auth/service','../../config/utils','client','http','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','clearBlockUser','minutes','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','user','pass','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message'];(function(_0x4a023a,_0x108875){var _0x3af368=function(_0x2a89aa){while(--_0x2a89aa){_0x4a023a['push'](_0x4a023a['shift']());}};_0x3af368(++_0x108875);}(_0x5af0,0xda));var _0x05af=function(_0x3429a6,_0x4d26f7){_0x3429a6=_0x3429a6-0x0;var _0x580725=_0x5af0[_0x3429a6];return _0x580725;};'use strict';var util=require('util');var passport=require(_0x05af('0x0'));var LocalStrategy=require(_0x05af('0x1'))[_0x05af('0x2')];var jayson=require('jayson/promise');var _=require(_0x05af('0x3'));var rs=require(_0x05af('0x4'));var moment=require(_0x05af('0x5'));var db=require('../../mysqldb')['db'];var authService=require(_0x05af('0x6'));var utils=require(_0x05af('0x7'));var client=jayson[_0x05af('0x8')][_0x05af('0x9')]({'port':0x232b});function localAuthenticate(_0x1ce43a,_0x55859f,_0x56e2e6,_0xa48be8){var _0xe37ed8,_0x1c9c60;return db['Setting'][_0x05af('0xa')]({'where':{'id':0x1},'attributes':[_0x05af('0xb'),_0x05af('0xc')],'raw':!![]})[_0x05af('0xd')](function(_0x14b5d6){_0xe37ed8=_0x14b5d6;return _0x1ce43a[_0x05af('0xa')]({'attributes':['id',_0x05af('0xe'),_0x05af('0xf'),_0x05af('0x10'),_0x05af('0x11'),_0x05af('0x12'),_0x05af('0x13'),_0x05af('0x14'),_0x05af('0x15')],'where':{'name':_0x55859f,'role':{'$or':[_0x05af('0x16'),'user',_0x05af('0x17')]}}});})[_0x05af('0xd')](function(_0x3698a5){if(!_0x3698a5||_0x3698a5&&_0x3698a5[_0x05af('0xe')]!==_0x55859f){throw new Error(_0x05af('0x18'));}else{_0x1c9c60=_0x3698a5;return _0x1c9c60;}})[_0x05af('0xd')](function(){_0x1c9c60[_0x05af('0x19')](_0x56e2e6,function(_0x4f39d6,_0x4e3d01){var _0x343364=_0x1c9c60[_0x05af('0x15')]+0x1;if(_0x4f39d6){return _0xa48be8(_0x4f39d6);}else if(!_0x4e3d01){if(_0x1c9c60[_0x05af('0x12')]){return _0xa48be8(null,![],{'message':_0x05af('0x18')});}else if(_0xe37ed8[_0x05af('0xb')]>0x0){if(_0x1c9c60[_0x05af('0x13')]){if(_0xe37ed8['blockDuration']>0x0){if(moment(_0x1c9c60[_0x05af('0x14')])[_0x05af('0x1a')](_0xe37ed8[_0x05af('0xc')],'minutes')>moment()){return _0xa48be8(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x05af('0x1b')](_0x1c9c60,_0x343364,![],null)['then'](function(){return _0xa48be8(null,![],{'message':_0x05af('0x18')});});}}else{return _0xa48be8(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x343364>=_0xe37ed8['allowedLoginAttempts']){return utils[_0x05af('0x1b')](_0x1c9c60,0x0,!![],moment())[_0x05af('0xd')](function(){return _0xa48be8(null,![],{'message':_0x05af('0x18')});});}else{return utils[_0x05af('0x1b')](_0x1c9c60,_0x343364,![],null)[_0x05af('0xd')](function(){return _0xa48be8(null,![],{'message':_0x05af('0x18')});});}}}else{return _0xa48be8(null,![],{'message':_0x05af('0x18')});}}else{if(_0x1c9c60[_0x05af('0x12')]){return _0xa48be8(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0xe37ed8[_0x05af('0xb')]>0x0){if(_0x1c9c60[_0x05af('0x13')]){if(_0xe37ed8[_0x05af('0xc')]>0x0){if(moment(_0x1c9c60[_0x05af('0x14')])['add'](_0xe37ed8['blockDuration'],_0x05af('0x1c'))>moment()){return _0xa48be8(null,![],{'message':_0x05af('0x18')});}else{return utils[_0x05af('0x1b')](_0x1c9c60,0x0,![],null)['then'](function(){return utils[_0x05af('0x1d')](_0x1c9c60);})[_0x05af('0xd')](function(){return _0xa48be8(null,_0x1c9c60);});}}else{return _0xa48be8(null,![],{'message':_0x05af('0x18')});}}else{return utils[_0x05af('0x1b')](_0x1c9c60,0x0,![],null)[_0x05af('0xd')](function(){return utils[_0x05af('0x1d')](_0x1c9c60);})[_0x05af('0xd')](function(){return _0xa48be8(null,_0x1c9c60);})['catch'](function(_0x2c0ff3){return _0xa48be8(null,![],_0x2c0ff3);});}}else{if(_0x1c9c60[_0x05af('0x13')]){return _0xa48be8(null,![],{'message':_0x05af('0x18')});}else{return utils['getLicense'](_0x1c9c60)[_0x05af('0xd')](function(){return _0xa48be8(null,_0x1c9c60);});}}}});})[_0x05af('0x1e')](function(_0x361666){return _0xa48be8(null,![],_0x361666);});}function sendServiceMail(_0x56e651){return db[_0x05af('0x1f')][_0x05af('0x20')]({'where':{'service':!![]},'attributes':['id',_0x05af('0xe'),_0x05af('0x21')],'include':[{'model':db[_0x05af('0x22')],'as':_0x05af('0x23')}]})[_0x05af('0xd')](function(_0x210e81){if(!_0x210e81){throw new Error(_0x05af('0x24'));}var _0x203d92={'tls':{'rejectUnauthorized':![]}};if(_0x210e81[_0x05af('0x23')][_0x05af('0x25')]){_0x203d92[_0x05af('0x25')]=_0x210e81[_0x05af('0x23')][_0x05af('0x25')];}else{_0x203d92['host']=_0x210e81[_0x05af('0x23')][_0x05af('0x26')];_0x203d92[_0x05af('0x27')]=_0x210e81[_0x05af('0x23')][_0x05af('0x27')];_0x203d92[_0x05af('0x28')]=_0x210e81[_0x05af('0x23')]['secure'];}if(_0x210e81[_0x05af('0x23')][_0x05af('0x29')]){_0x203d92['auth']={'user':_0x210e81[_0x05af('0x23')][_0x05af('0x2a')],'pass':_0x210e81[_0x05af('0x23')][_0x05af('0x2b')]};}var _0x5b29dd={'account':_0x203d92,'message':_[_0x05af('0x2c')]({'from':util[_0x05af('0x2d')](_0x05af('0x2e'),_0x210e81['name'],_0x210e81[_0x05af('0x21')]||_0x210e81['Smtp']['user'])},_0x56e651)};return client[_0x05af('0x2f')](_0x05af('0x30'),_0x5b29dd);})['then'](function(_0x26c2d4){if(_0x26c2d4[_0x05af('0x31')]){throw new Error(util[_0x05af('0x2d')](_0x05af('0x32'),_0x26c2d4['error'][_0x05af('0x33')]||JSON['stringify'](_0x26c2d4[_0x05af('0x31')])));}return!![];});}function handleError(_0x289f04,_0x57d20b,_0x1ac152){return _0x289f04[_0x05af('0x34')](_0x57d20b||0x1f4)[_0x05af('0x35')]({'message':_0x1ac152?_0x1ac152['message']||_0x1ac152:''});}exports[_0x05af('0x36')]=function(_0x58f7e9,_0x293ee7,_0x41a3d0){passport[_0x05af('0x19')](_0x05af('0x37'),function(_0x57ebb0,_0x41d62e,_0x40db6a){var _0x341c0e=_0x57ebb0||_0x40db6a;if(_0x341c0e){return handleError(_0x293ee7,0x191,_0x341c0e);}if(!_0x41d62e){return handleError(_0x293ee7,0x194,{'message':_0x05af('0x38')});}else{var _0x16b176={'payload':{'id':_0x41d62e['id'],'role':_0x41d62e[_0x05af('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0x05af('0x39')](_0x16b176)['then'](function(_0x4637d0){_0x293ee7[_0x05af('0x3a')]({'id':_0x41d62e['id'],'token':_0x4637d0,'statusCall':'','isAlreadyLogged':_0x41d62e[_0x05af('0x3b')]});});}})(_0x58f7e9,_0x293ee7,_0x41a3d0);};exports[_0x05af('0x3c')]=function(_0x52464b,_0x24f298,_0x3e33ea){if(!_0x52464b[_0x05af('0x3d')][_0x05af('0x21')]){return handleError(_0x24f298,0x1f4,{'message':_0x05af('0x3e')});}var _0x24eab6=rs[_0x05af('0x3f')]();_0x52464b[_0x05af('0x3d')][_0x05af('0x21')]=_0x52464b[_0x05af('0x3d')][_0x05af('0x21')][_0x05af('0x40')]()[_0x05af('0x41')]();var _0xb8dab0;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0x05af('0xb'),_0x05af('0xc')],'raw':!![]})['then'](function(_0x555c56){_0xb8dab0=_0x555c56;return db[_0x05af('0x42')][_0x05af('0x20')]({'where':{'email':_0x52464b['body'][_0x05af('0x21')]}});})[_0x05af('0xd')](function(_0x359c13){if(!_0x359c13){throw new Error(_0x05af('0x43'));}if(_0x359c13[_0x05af('0x12')]){throw new Error(_0x05af('0x44'));}if(_0x359c13[_0x05af('0x13')]){if(moment(_0x359c13[_0x05af('0x14')])['add'](_0xb8dab0['blockDuration'],_0x05af('0x1c'))>moment()){throw new Error(_0x05af('0x45'));}else{_0x359c13['blocked']=![];_0x359c13[_0x05af('0x14')]=null;}}_0x359c13['resetPasswordToken']=_0x24eab6;_0x359c13[_0x05af('0x46')]=Date[_0x05af('0x47')]()+0x36ee80;return _0x359c13['save']();})[_0x05af('0xd')](function(){return sendServiceMail({'to':_0x52464b['body'][_0x05af('0x21')],'subject':_0x05af('0x48'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x05af('0x49')+_0x05af('0x4a')+_0x52464b[_0x05af('0x4b')]['host']+_0x05af('0x4c')+_0x24eab6+'\x0a\x0a'+_0x05af('0x4d')});})[_0x05af('0xd')](function(){_0x24f298[_0x05af('0x34')](0xc8)[_0x05af('0x35')]({'message':_0x05af('0x4e')});})[_0x05af('0x1e')](function(_0x5ab3d7){return handleError(_0x24f298,0x1f4,_0x5ab3d7);});};exports[_0x05af('0x4f')]=function(_0x48c826,_0x578e22,_0x379091){return db['User'][_0x05af('0x20')]({'where':{'resetPasswordToken':_0x48c826[_0x05af('0x50')][_0x05af('0x51')],'resetPasswordExpires':{'$gt':Date[_0x05af('0x47')]()}}})[_0x05af('0xd')](function(_0x143621){if(!_0x143621){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting'][_0x05af('0xa')]({'attributes':['id',_0x05af('0x52'),_0x05af('0x53'),'passwordHistoryLimit']})[_0x05af('0xd')](function(_0x562f5d){if(_0x562f5d[_0x05af('0x52')])authService[_0x05af('0x54')](_0x48c826['body'][_0x05af('0xf')]);if(!_0x562f5d[_0x05af('0x53')]||!_0x143621[_0x05af('0x55')])return _0x143621;authService[_0x05af('0x56')](_0x48c826[_0x05af('0x3d')][_0x05af('0xf')],_0x143621[_0x05af('0x55')],_0x562f5d[_0x05af('0x57')]);return _0x143621;})[_0x05af('0xd')](function(){_0x143621[_0x05af('0xf')]=_0x48c826[_0x05af('0x3d')][_0x05af('0xf')];_0x143621[_0x05af('0x58')]=null;_0x143621[_0x05af('0x46')]=null;return _0x143621[_0x05af('0x59')]();});})['then'](function(){_0x578e22[_0x05af('0x34')](0xc8)[_0x05af('0x35')]({'message':'Password\x20reset!'});})[_0x05af('0x1e')](function(_0x3a7bb8){return handleError(_0x578e22,0x1f4,_0x3a7bb8);});};passport['use'](_0x05af('0x37'),new LocalStrategy({'usernameField':_0x05af('0xe'),'passwordField':_0x05af('0xf')},function(_0x333b70,_0x7d9b48,_0x2670e7){return localAuthenticate(db['User'],_0x333b70,_0x7d9b48,_0x2670e7);})); \ No newline at end of file +var _0x05f8=['service','Smtp','host','port','secure','authentication','auth','pass','merge','format','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local-login','signToken','json','online','forgot','Email\x20parameter\x20is\x20missing','generate','body','toLowerCase','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','validatePasswordHistory','passwordHistoryLimit','Password\x20reset!','use','passport','Strategy','lodash','../../mysqldb','../../config/utils','client','http','Setting','findOne','blockDuration','then','password','role','disabled','blocked','loginAttempts','admin','user','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','allowedLoginAttempts','add','minutes','clearBlockUser','blockedAt','getLicense','catch','MailAccount','find','email','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x05f8,0x170));var _0x805f=function(_0x5e76a0,_0x5ed0ba){_0x5e76a0=_0x5e76a0-0x0;var _0x283938=_0x05f8[_0x5e76a0];return _0x283938;};'use strict';var util=require('util');var passport=require(_0x805f('0x0'));var LocalStrategy=require('passport-local')[_0x805f('0x1')];var jayson=require('jayson/promise');var _=require(_0x805f('0x2'));var rs=require('randomstring');var moment=require('moment');var db=require(_0x805f('0x3'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x805f('0x4'));var client=jayson[_0x805f('0x5')][_0x805f('0x6')]({'port':0x232b});function localAuthenticate(_0x471dc5,_0xe3af32,_0x27a289,_0x38423c){var _0x2e40a5,_0x387b57;return db[_0x805f('0x7')][_0x805f('0x8')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x805f('0x9')],'raw':!![]})[_0x805f('0xa')](function(_0x463e09){_0x2e40a5=_0x463e09;return _0x471dc5[_0x805f('0x8')]({'attributes':['id','name',_0x805f('0xb'),'salt',_0x805f('0xc'),_0x805f('0xd'),_0x805f('0xe'),'blockedAt',_0x805f('0xf')],'where':{'name':_0xe3af32,'role':{'$or':[_0x805f('0x10'),_0x805f('0x11'),'agent']}}});})[_0x805f('0xa')](function(_0x2b937d){if(!_0x2b937d||_0x2b937d&&_0x2b937d[_0x805f('0x12')]!==_0xe3af32){throw new Error(_0x805f('0x13'));}else{_0x387b57=_0x2b937d;return _0x387b57;}})[_0x805f('0xa')](function(){_0x387b57[_0x805f('0x14')](_0x27a289,function(_0x232b34,_0x2b3ce4){var _0x1bf1c9=_0x387b57[_0x805f('0xf')]+0x1;if(_0x232b34){return _0x38423c(_0x232b34);}else if(!_0x2b3ce4){if(_0x387b57[_0x805f('0xd')]){return _0x38423c(null,![],{'message':_0x805f('0x13')});}else if(_0x2e40a5[_0x805f('0x15')]>0x0){if(_0x387b57['blocked']){if(_0x2e40a5[_0x805f('0x9')]>0x0){if(moment(_0x387b57['blockedAt'])[_0x805f('0x16')](_0x2e40a5['blockDuration'],_0x805f('0x17'))>moment()){return _0x38423c(null,![],{'message':_0x805f('0x13')});}else{return utils[_0x805f('0x18')](_0x387b57,_0x1bf1c9,![],null)['then'](function(){return _0x38423c(null,![],{'message':_0x805f('0x13')});});}}else{return _0x38423c(null,![],{'message':_0x805f('0x13')});}}else{if(_0x1bf1c9>=_0x2e40a5['allowedLoginAttempts']){return utils[_0x805f('0x18')](_0x387b57,0x0,!![],moment())[_0x805f('0xa')](function(){return _0x38423c(null,![],{'message':_0x805f('0x13')});});}else{return utils[_0x805f('0x18')](_0x387b57,_0x1bf1c9,![],null)[_0x805f('0xa')](function(){return _0x38423c(null,![],{'message':_0x805f('0x13')});});}}}else{return _0x38423c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x387b57[_0x805f('0xd')]){return _0x38423c(null,![],{'message':_0x805f('0x13')});}else if(_0x2e40a5[_0x805f('0x15')]>0x0){if(_0x387b57['blocked']){if(_0x2e40a5[_0x805f('0x9')]>0x0){if(moment(_0x387b57[_0x805f('0x19')])[_0x805f('0x16')](_0x2e40a5[_0x805f('0x9')],_0x805f('0x17'))>moment()){return _0x38423c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x805f('0x18')](_0x387b57,0x0,![],null)[_0x805f('0xa')](function(){return utils[_0x805f('0x1a')](_0x387b57);})[_0x805f('0xa')](function(){return _0x38423c(null,_0x387b57);});}}else{return _0x38423c(null,![],{'message':_0x805f('0x13')});}}else{return utils[_0x805f('0x18')](_0x387b57,0x0,![],null)['then'](function(){return utils['getLicense'](_0x387b57);})['then'](function(){return _0x38423c(null,_0x387b57);})[_0x805f('0x1b')](function(_0xb501ba){return _0x38423c(null,![],_0xb501ba);});}}else{if(_0x387b57[_0x805f('0xe')]){return _0x38423c(null,![],{'message':_0x805f('0x13')});}else{return utils[_0x805f('0x1a')](_0x387b57)[_0x805f('0xa')](function(){return _0x38423c(null,_0x387b57);});}}}});})[_0x805f('0x1b')](function(_0x40511d){return _0x38423c(null,![],_0x40511d);});}function sendServiceMail(_0x2e7eff){return db[_0x805f('0x1c')][_0x805f('0x1d')]({'where':{'service':!![]},'attributes':['id','name',_0x805f('0x1e')],'include':[{'model':db['MailServerOut'],'as':'Smtp'}]})['then'](function(_0x5c2b1a){if(!_0x5c2b1a){throw new Error(_0x805f('0x1f'));}var _0x4a05ab={'tls':{'rejectUnauthorized':![]}};if(_0x5c2b1a['Smtp'][_0x805f('0x20')]){_0x4a05ab['service']=_0x5c2b1a[_0x805f('0x21')]['service'];}else{_0x4a05ab[_0x805f('0x22')]=_0x5c2b1a[_0x805f('0x21')]['host'];_0x4a05ab[_0x805f('0x23')]=_0x5c2b1a[_0x805f('0x21')][_0x805f('0x23')];_0x4a05ab['secure']=_0x5c2b1a['Smtp'][_0x805f('0x24')];}if(_0x5c2b1a[_0x805f('0x21')][_0x805f('0x25')]){_0x4a05ab[_0x805f('0x26')]={'user':_0x5c2b1a[_0x805f('0x21')][_0x805f('0x11')],'pass':_0x5c2b1a[_0x805f('0x21')][_0x805f('0x27')]};}var _0x3f60ab={'account':_0x4a05ab,'message':_[_0x805f('0x28')]({'from':util[_0x805f('0x29')]('\x22%s\x22\x20<%s>',_0x5c2b1a[_0x805f('0x12')],_0x5c2b1a[_0x805f('0x1e')]||_0x5c2b1a[_0x805f('0x21')][_0x805f('0x11')])},_0x2e7eff)};return client['request'](_0x805f('0x2a'),_0x3f60ab);})['then'](function(_0x32342a){if(_0x32342a[_0x805f('0x2b')]){throw new Error(util[_0x805f('0x29')](_0x805f('0x2c'),_0x32342a['error'][_0x805f('0x2d')]||JSON[_0x805f('0x2e')](_0x32342a['error'])));}return!![];});}function handleError(_0x34378d,_0x21b6a0,_0x1130fb){return _0x34378d[_0x805f('0x2f')](_0x21b6a0||0x1f4)[_0x805f('0x30')]({'message':_0x1130fb?_0x1130fb[_0x805f('0x2d')]||_0x1130fb:''});}exports[_0x805f('0x31')]=function(_0x196889,_0x49ef8e,_0x345c27){passport[_0x805f('0x14')](_0x805f('0x32'),function(_0x57c169,_0x7507e3,_0x4024ff){var _0x1a0016=_0x57c169||_0x4024ff;if(_0x1a0016){return handleError(_0x49ef8e,0x191,_0x1a0016);}if(!_0x7507e3){return handleError(_0x49ef8e,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0xbd7e55={'payload':{'id':_0x7507e3['id'],'role':_0x7507e3[_0x805f('0xc')]},'options':{'expiresIn':0x15180}};return authService[_0x805f('0x33')](_0xbd7e55)['then'](function(_0x55cd55){_0x49ef8e[_0x805f('0x34')]({'id':_0x7507e3['id'],'token':_0x55cd55,'statusCall':'','isAlreadyLogged':_0x7507e3[_0x805f('0x35')]});});}})(_0x196889,_0x49ef8e,_0x345c27);};exports[_0x805f('0x36')]=function(_0xddadc4,_0x4b9d8a,_0xed8d7f){if(!_0xddadc4['body']['email']){return handleError(_0x4b9d8a,0x1f4,{'message':_0x805f('0x37')});}var _0x418a52=rs[_0x805f('0x38')]();_0xddadc4[_0x805f('0x39')]['email']=_0xddadc4[_0x805f('0x39')][_0x805f('0x1e')]['trim']()[_0x805f('0x3a')]();var _0x1cd89d;return db[_0x805f('0x7')][_0x805f('0x8')]({'where':{'id':0x1},'attributes':[_0x805f('0x15'),_0x805f('0x9')],'raw':!![]})['then'](function(_0x1d3bda){_0x1cd89d=_0x1d3bda;return db['User']['find']({'where':{'email':_0xddadc4[_0x805f('0x39')][_0x805f('0x1e')]}});})[_0x805f('0xa')](function(_0x3b8016){if(!_0x3b8016){throw new Error(_0x805f('0x3b'));}if(_0x3b8016[_0x805f('0xd')]){throw new Error(_0x805f('0x3c'));}if(_0x3b8016[_0x805f('0xe')]){if(moment(_0x3b8016[_0x805f('0x19')])['add'](_0x1cd89d[_0x805f('0x9')],'minutes')>moment()){throw new Error(_0x805f('0x3d'));}else{_0x3b8016[_0x805f('0xe')]=![];_0x3b8016[_0x805f('0x19')]=null;}}_0x3b8016[_0x805f('0x3e')]=_0x418a52;_0x3b8016[_0x805f('0x3f')]=Date[_0x805f('0x40')]()+0x36ee80;return _0x3b8016[_0x805f('0x41')]();})[_0x805f('0xa')](function(){return sendServiceMail({'to':_0xddadc4['body'][_0x805f('0x1e')],'subject':_0x805f('0x42'),'text':_0x805f('0x43')+_0x805f('0x44')+_0x805f('0x45')+_0xddadc4['headers'][_0x805f('0x22')]+_0x805f('0x46')+_0x418a52+'\x0a\x0a'+_0x805f('0x47')});})[_0x805f('0xa')](function(){_0x4b9d8a[_0x805f('0x2f')](0xc8)['send']({'message':'Reset\x20Email\x20sent!'});})['catch'](function(_0x36af8f){return handleError(_0x4b9d8a,0x1f4,_0x36af8f);});};exports['reset']=function(_0x265c4a,_0x4b771e,_0x403619){return db['User']['find']({'where':{'resetPasswordToken':_0x265c4a['params'][_0x805f('0x48')],'resetPasswordExpires':{'$gt':Date[_0x805f('0x40')]()}}})[_0x805f('0xa')](function(_0x5c17b0){if(!_0x5c17b0){throw new Error(_0x805f('0x49'));}return db[_0x805f('0x7')][_0x805f('0x8')]({'attributes':['id','securePassword','enforcePasswordHistory','passwordHistoryLimit']})[_0x805f('0xa')](function(_0x4845c3){if(_0x4845c3[_0x805f('0x4a')])authService['validatePasswordPattern'](_0x265c4a['body'][_0x805f('0xb')]);if(!_0x4845c3[_0x805f('0x4b')]||!_0x5c17b0['previousPasswords'])return _0x5c17b0;authService[_0x805f('0x4c')](_0x265c4a[_0x805f('0x39')]['password'],_0x5c17b0['previousPasswords'],_0x4845c3[_0x805f('0x4d')]);return _0x5c17b0;})[_0x805f('0xa')](function(){_0x5c17b0['password']=_0x265c4a[_0x805f('0x39')][_0x805f('0xb')];_0x5c17b0['resetPasswordToken']=null;_0x5c17b0[_0x805f('0x3f')]=null;return _0x5c17b0[_0x805f('0x41')]();});})[_0x805f('0xa')](function(){_0x4b771e[_0x805f('0x2f')](0xc8)[_0x805f('0x30')]({'message':_0x805f('0x4e')});})['catch'](function(_0x4a2185){return handleError(_0x4b771e,0x1f4,_0x4a2185);});};passport[_0x805f('0x4f')]('local-login',new LocalStrategy({'usernameField':'name','passwordField':_0x805f('0xb')},function(_0x6c6216,_0x420df2,_0x4b1fa4){return localAuthenticate(db['User'],_0x6c6216,_0x420df2,_0x4b1fa4);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index a8766db..1c12ca8 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 _0x0a89=['/forgot','forgot','/reset/:token','reset','exports','Router','./authLocal.controller','post','login'];(function(_0x1529a3,_0x529f63){var _0x1a0d4b=function(_0x6f1058){while(--_0x6f1058){_0x1529a3['push'](_0x1529a3['shift']());}};_0x1a0d4b(++_0x529f63);}(_0x0a89,0x9e));var _0x90a8=function(_0x165a7e,_0xe72ff0){_0x165a7e=_0x165a7e-0x0;var _0x3a1b02=_0x0a89[_0x165a7e];return _0x3a1b02;};'use strict';var express=require('express');var router=express[_0x90a8('0x0')]();var controller=require(_0x90a8('0x1'));router[_0x90a8('0x2')]('/',controller[_0x90a8('0x3')]);router[_0x90a8('0x2')](_0x90a8('0x4'),controller[_0x90a8('0x5')]);router[_0x90a8('0x2')](_0x90a8('0x6'),controller[_0x90a8('0x7')]);module[_0x90a8('0x8')]=router; \ No newline at end of file +var _0x5ee2=['Router','./authLocal.controller','post','login','forgot'];(function(_0x3fb8f7,_0x5363d9){var _0x4b0e88=function(_0x56fd5a){while(--_0x56fd5a){_0x3fb8f7['push'](_0x3fb8f7['shift']());}};_0x4b0e88(++_0x5363d9);}(_0x5ee2,0x11d));var _0x25ee=function(_0x42b3d0,_0x1578a4){_0x42b3d0=_0x42b3d0-0x0;var _0x2dc411=_0x5ee2[_0x42b3d0];return _0x2dc411;};'use strict';var express=require('express');var router=express[_0x25ee('0x0')]();var controller=require(_0x25ee('0x1'));router[_0x25ee('0x2')]('/',controller[_0x25ee('0x3')]);router[_0x25ee('0x2')]('/forgot',controller[_0x25ee('0x4')]);router[_0x25ee('0x2')]('/reset/:token',controller['reset']);module['exports']=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 85b47b6..b3193ea 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 _0x6b5d=['INTEGER','sequelize','exports','STRING'];(function(_0x5366c2,_0x3eafa7){var _0xd676ba=function(_0x58e961){while(--_0x58e961){_0x5366c2['push'](_0x5366c2['shift']());}};_0xd676ba(++_0x3eafa7);}(_0x6b5d,0x111));var _0xd6b5=function(_0xccfafd,_0x5c590a){_0xccfafd=_0xccfafd-0x0;var _0x113270=_0x6b5d[_0xccfafd];return _0x113270;};'use strict';var Sequelize=require(_0xd6b5('0x0'));module[_0xd6b5('0x1')]={'name':{'type':Sequelize[_0xd6b5('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd6b5('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xd6b5('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0xd9dc=['INTEGER','sequelize','STRING','BOOLEAN'];(function(_0x3176a4,_0x2049fd){var _0x38d9bc=function(_0x30a9aa){while(--_0x30a9aa){_0x3176a4['push'](_0x3176a4['shift']());}};_0x38d9bc(++_0x2049fd);}(_0xd9dc,0x1c1));var _0xcd9d=function(_0x19069d,_0x46921e){_0x19069d=_0x19069d-0x0;var _0x39463a=_0xd9dc[_0x19069d];return _0x39463a;};'use strict';var Sequelize=require(_0xcd9d('0x0'));module['exports']={'name':{'type':Sequelize[_0xcd9d('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0xcd9d('0x1')]},'description':{'type':Sequelize[_0xcd9d('0x1')]},'status':{'type':Sequelize[_0xcd9d('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xcd9d('0x3')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index 2a34ca4..cbbc1bb 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 _0x4b86=['merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','addConditions','ids','getConditions','findOne','Condition','filter','Action','addActions','omit','getActions','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','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','Automation','rawAttributes','fieldName','type','key','map','query','keys','filters','model','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x1dc01f,_0x157a75){var _0x298041=function(_0x47fce1){while(--_0x47fce1){_0x1dc01f['push'](_0x1dc01f['shift']());}};_0x298041(++_0x157a75);}(_0x4b86,0x1df));var _0x64b8=function(_0xb03f9,_0x588391){_0xb03f9=_0xb03f9-0x0;var _0x3ec30a=_0x4b86[_0xb03f9];return _0x3ec30a;};'use strict';var emlformat=require(_0x64b8('0x0'));var rimraf=require(_0x64b8('0x1'));var zipdir=require(_0x64b8('0x2'));var jsonpatch=require(_0x64b8('0x3'));var rp=require(_0x64b8('0x4'));var moment=require(_0x64b8('0x5'));var BPromise=require(_0x64b8('0x6'));var Mustache=require(_0x64b8('0x7'));var util=require(_0x64b8('0x8'));var path=require(_0x64b8('0x9'));var sox=require('sox');var csv=require(_0x64b8('0xa'));var ejs=require(_0x64b8('0xb'));var fs=require('fs');var fs_extra=require(_0x64b8('0xc'));var _=require('lodash');var squel=require(_0x64b8('0xd'));var crypto=require(_0x64b8('0xe'));var jsforce=require(_0x64b8('0xf'));var deskjs=require(_0x64b8('0x10'));var toCsv=require(_0x64b8('0xa'));var querystring=require(_0x64b8('0x11'));var Papa=require(_0x64b8('0x12'));var Redis=require(_0x64b8('0x13'));var authService=require(_0x64b8('0x14'));var qs=require(_0x64b8('0x15'));var as=require(_0x64b8('0x16'));var hardwareService=require(_0x64b8('0x17'));var logger=require(_0x64b8('0x18'))(_0x64b8('0x19'));var utils=require(_0x64b8('0x1a'));var config=require(_0x64b8('0x1b'));var licenseUtil=require(_0x64b8('0x1c'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ec240,_0x32dd93){_0x32dd93=_0x32dd93||0xcc;return function(_0x5244aa){if(_0x5244aa){return _0x5ec240[_0x64b8('0x1d')](_0x32dd93);}return _0x5ec240['status'](_0x32dd93)[_0x64b8('0x1e')]();};}function respondWithResult(_0x10493e,_0x1d17b6){_0x1d17b6=_0x1d17b6||0xc8;return function(_0xc89f09){if(_0xc89f09){return _0x10493e[_0x64b8('0x1f')](_0x1d17b6)[_0x64b8('0x20')](_0xc89f09);}};}function respondWithFilteredResult(_0x3544d8,_0xf372a0){return function(_0x28ef7f){if(_0x28ef7f){var _0x465d9b=typeof _0xf372a0[_0x64b8('0x21')]===_0x64b8('0x22')&&typeof _0xf372a0['limit']==='undefined';var _0x39273e=_0x28ef7f['count'];var _0x1fe316=_0x465d9b?0x0:_0xf372a0[_0x64b8('0x21')];var _0x5eeb7a=_0x465d9b?_0x28ef7f[_0x64b8('0x23')]:_0xf372a0[_0x64b8('0x21')]+_0xf372a0[_0x64b8('0x24')];var _0x4b52ce;if(_0x5eeb7a>=_0x39273e){_0x5eeb7a=_0x39273e;_0x4b52ce=0xc8;}else{_0x4b52ce=0xce;}_0x3544d8[_0x64b8('0x1f')](_0x4b52ce);return _0x3544d8[_0x64b8('0x25')](_0x64b8('0x26'),_0x1fe316+'-'+_0x5eeb7a+'/'+_0x39273e)[_0x64b8('0x20')](_0x28ef7f);}return null;};}function patchUpdates(_0x5b25aa){return function(_0x5e6474){try{jsonpatch[_0x64b8('0x27')](_0x5e6474,_0x5b25aa,!![]);}catch(_0x17e662){return BPromise[_0x64b8('0x28')](_0x17e662);}return _0x5e6474[_0x64b8('0x29')]();};}function saveUpdates(_0x4b5aea,_0x408566){return function(_0x53f0b4){if(_0x53f0b4){return _0x53f0b4[_0x64b8('0x2a')](_0x4b5aea)[_0x64b8('0x2b')](function(_0x4e1573){return _0x4e1573;});}return null;};}function removeEntity(_0x2ae57b,_0x5f9674){return function(_0x183dcf){if(_0x183dcf){return _0x183dcf[_0x64b8('0x2c')]()[_0x64b8('0x2b')](function(){_0x2ae57b[_0x64b8('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9cd470,_0x5a0ccb){return function(_0x191e1f){if(!_0x191e1f){_0x9cd470[_0x64b8('0x1d')](0x194);}return _0x191e1f;};}function handleError(_0x590621,_0x54fa90){_0x54fa90=_0x54fa90||0x1f4;return function(_0x2ae39f){logger['error'](_0x2ae39f[_0x64b8('0x2d')]);if(_0x2ae39f[_0x64b8('0x2e')]){delete _0x2ae39f[_0x64b8('0x2e')];}_0x590621[_0x64b8('0x1f')](_0x54fa90)['send'](_0x2ae39f);};}exports[_0x64b8('0x2f')]=function(_0x31e0ae,_0x141710){var _0x2f5408={},_0x5a2245={},_0xd75a0={'count':0x0,'rows':[]};var _0x395bf4=_['map'](db[_0x64b8('0x30')][_0x64b8('0x31')],function(_0x583d14){return{'name':_0x583d14[_0x64b8('0x32')],'type':_0x583d14[_0x64b8('0x33')][_0x64b8('0x34')]};});_0x5a2245['model']=_[_0x64b8('0x35')](_0x395bf4,_0x64b8('0x2e'));_0x5a2245[_0x64b8('0x36')]=_[_0x64b8('0x37')](_0x31e0ae[_0x64b8('0x36')]);_0x5a2245[_0x64b8('0x38')]=_['intersection'](_0x5a2245[_0x64b8('0x39')],_0x5a2245[_0x64b8('0x36')]);_0x2f5408['attributes']=_[_0x64b8('0x3a')](_0x5a2245[_0x64b8('0x39')],qs['fields'](_0x31e0ae[_0x64b8('0x36')][_0x64b8('0x3b')]));_0x2f5408[_0x64b8('0x3c')]=_0x2f5408[_0x64b8('0x3c')]['length']?_0x2f5408[_0x64b8('0x3c')]:_0x5a2245[_0x64b8('0x39')];if(!_0x31e0ae[_0x64b8('0x36')][_0x64b8('0x3d')](_0x64b8('0x3e'))){_0x2f5408['limit']=qs[_0x64b8('0x24')](_0x31e0ae['query'][_0x64b8('0x24')]);_0x2f5408[_0x64b8('0x21')]=qs['offset'](_0x31e0ae[_0x64b8('0x36')][_0x64b8('0x21')]);}_0x2f5408[_0x64b8('0x3f')]=qs[_0x64b8('0x40')](_0x31e0ae[_0x64b8('0x36')]['sort']);_0x2f5408[_0x64b8('0x41')]=qs['filters'](_[_0x64b8('0x42')](_0x31e0ae[_0x64b8('0x36')],_0x5a2245[_0x64b8('0x38')]),_0x395bf4);if(_0x31e0ae[_0x64b8('0x36')]['filter']){_0x2f5408['where']=_[_0x64b8('0x43')](_0x2f5408[_0x64b8('0x41')],{'$or':_[_0x64b8('0x35')](_0x395bf4,function(_0xb9ead){if(_0xb9ead[_0x64b8('0x33')]!==_0x64b8('0x44')){var _0x2c5465={};_0x2c5465[_0xb9ead['name']]={'$like':'%'+_0x31e0ae[_0x64b8('0x36')]['filter']+'%'};return _0x2c5465;}})});}_0x2f5408=_[_0x64b8('0x43')]({},_0x2f5408,_0x31e0ae['options']);var _0xf2c18={'where':_0x2f5408[_0x64b8('0x41')]};return db['Automation'][_0x64b8('0x23')](_0xf2c18)[_0x64b8('0x2b')](function(_0x4e3730){_0xd75a0[_0x64b8('0x23')]=_0x4e3730;if(_0x31e0ae['query'][_0x64b8('0x45')]){_0x2f5408[_0x64b8('0x46')]=[{'all':!![]}];}return db[_0x64b8('0x30')][_0x64b8('0x47')](_0x2f5408);})['then'](function(_0x5ae2d9){_0xd75a0[_0x64b8('0x48')]=_0x5ae2d9;return _0xd75a0;})[_0x64b8('0x2b')](respondWithFilteredResult(_0x141710,_0x2f5408))[_0x64b8('0x49')](handleError(_0x141710,null));};exports[_0x64b8('0x4a')]=function(_0x545976,_0x4e1538){var _0x1c6c21={'raw':![],'where':{'id':_0x545976[_0x64b8('0x4b')]['id']}},_0x57ca14={};_0x57ca14[_0x64b8('0x39')]=_[_0x64b8('0x37')](db[_0x64b8('0x30')][_0x64b8('0x31')]);_0x57ca14[_0x64b8('0x36')]=_['keys'](_0x545976['query']);_0x57ca14[_0x64b8('0x38')]=_[_0x64b8('0x3a')](_0x57ca14[_0x64b8('0x39')],_0x57ca14[_0x64b8('0x36')]);_0x1c6c21[_0x64b8('0x3c')]=_['intersection'](_0x57ca14['model'],qs['fields'](_0x545976[_0x64b8('0x36')][_0x64b8('0x3b')]));_0x1c6c21[_0x64b8('0x3c')]=_0x1c6c21[_0x64b8('0x3c')][_0x64b8('0x4c')]?_0x1c6c21[_0x64b8('0x3c')]:_0x57ca14['model'];if(_0x545976[_0x64b8('0x36')]['includeAll']){_0x1c6c21[_0x64b8('0x46')]=[{'all':!![]}];}_0x1c6c21=_[_0x64b8('0x43')]({},_0x1c6c21,_0x545976[_0x64b8('0x4d')]);return db[_0x64b8('0x30')][_0x64b8('0x4e')](_0x1c6c21)[_0x64b8('0x2b')](handleEntityNotFound(_0x4e1538,null))[_0x64b8('0x2b')](respondWithResult(_0x4e1538,null))[_0x64b8('0x49')](handleError(_0x4e1538,null));};exports[_0x64b8('0x4f')]=function(_0x4c9a44,_0x206f5e){return db[_0x64b8('0x30')][_0x64b8('0x4f')](_0x4c9a44[_0x64b8('0x50')],{})[_0x64b8('0x2b')](respondWithResult(_0x206f5e,0xc9))[_0x64b8('0x49')](handleError(_0x206f5e,null));};exports[_0x64b8('0x2a')]=function(_0x157968,_0x1e5974){if(_0x157968[_0x64b8('0x50')]['id']){delete _0x157968[_0x64b8('0x50')]['id'];}return db[_0x64b8('0x30')]['find']({'where':{'id':_0x157968[_0x64b8('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1e5974,null))[_0x64b8('0x2b')](saveUpdates(_0x157968[_0x64b8('0x50')],null))[_0x64b8('0x2b')](respondWithResult(_0x1e5974,null))[_0x64b8('0x49')](handleError(_0x1e5974,null));};exports[_0x64b8('0x2c')]=function(_0x4555d0,_0x12d0e9){return db[_0x64b8('0x30')][_0x64b8('0x4e')]({'where':{'id':_0x4555d0[_0x64b8('0x4b')]['id']}})['then'](handleEntityNotFound(_0x12d0e9,null))[_0x64b8('0x2b')](removeEntity(_0x12d0e9,null))[_0x64b8('0x49')](handleError(_0x12d0e9,null));};exports[_0x64b8('0x51')]=function(_0x5ba30a,_0x31e960,_0x23a70b){return db['Condition']['find']({'where':{'id':_0x5ba30a[_0x64b8('0x4b')]['id']}})[_0x64b8('0x2b')](handleEntityNotFound(_0x31e960,null))[_0x64b8('0x2b')](function(_0x130d25){if(_0x130d25){return _0x130d25[_0x64b8('0x51')](_0x5ba30a[_0x64b8('0x50')][_0x64b8('0x52')],_['omit'](_0x5ba30a[_0x64b8('0x50')],[_0x64b8('0x52'),'id'])||{});}})[_0x64b8('0x2b')](respondWithResult(_0x31e960,null))[_0x64b8('0x49')](handleError(_0x31e960,null));};exports[_0x64b8('0x53')]=function(_0x1e36bf,_0x3f5f67,_0x15e622){var _0x4d5163={};var _0x16bed0={};var _0x274011;var _0x92e89c;return db['Automation'][_0x64b8('0x54')]({'where':{'id':_0x1e36bf['params']['id']}})[_0x64b8('0x2b')](handleEntityNotFound(_0x3f5f67,null))[_0x64b8('0x2b')](function(_0x4e66ca){if(_0x4e66ca){_0x274011=_0x4e66ca;_0x16bed0[_0x64b8('0x39')]=_[_0x64b8('0x37')](db[_0x64b8('0x55')][_0x64b8('0x31')]);_0x16bed0['query']=_[_0x64b8('0x37')](_0x1e36bf[_0x64b8('0x36')]);_0x16bed0[_0x64b8('0x38')]=_[_0x64b8('0x3a')](_0x16bed0[_0x64b8('0x39')],_0x16bed0[_0x64b8('0x36')]);_0x4d5163[_0x64b8('0x3c')]=_[_0x64b8('0x3a')](_0x16bed0[_0x64b8('0x39')],qs[_0x64b8('0x3b')](_0x1e36bf['query'][_0x64b8('0x3b')]));_0x4d5163[_0x64b8('0x3c')]=_0x4d5163[_0x64b8('0x3c')][_0x64b8('0x4c')]?_0x4d5163[_0x64b8('0x3c')]:_0x16bed0[_0x64b8('0x39')];_0x4d5163[_0x64b8('0x3f')]=qs['sort'](_0x1e36bf[_0x64b8('0x36')]['sort']);_0x4d5163[_0x64b8('0x41')]=qs['filters'](_[_0x64b8('0x42')](_0x1e36bf['query'],_0x16bed0[_0x64b8('0x38')]));if(_0x1e36bf[_0x64b8('0x36')][_0x64b8('0x56')]){_0x4d5163['where']=_[_0x64b8('0x43')](_0x4d5163[_0x64b8('0x41')],{'$or':_['map'](_0x4d5163['attributes'],function(_0x1d87cc){var _0x298ffb={};_0x298ffb[_0x1d87cc]={'$like':'%'+_0x1e36bf[_0x64b8('0x36')][_0x64b8('0x56')]+'%'};return _0x298ffb;})});}_0x4d5163=_[_0x64b8('0x43')]({},_0x4d5163,_0x1e36bf[_0x64b8('0x4d')]);return _0x274011[_0x64b8('0x53')](_0x4d5163);}})['then'](function(_0x16fe04){if(_0x16fe04){_0x92e89c=_0x16fe04[_0x64b8('0x4c')];if(!_0x1e36bf[_0x64b8('0x36')][_0x64b8('0x3d')]('nolimit')){_0x4d5163['limit']=qs[_0x64b8('0x24')](_0x1e36bf[_0x64b8('0x36')]['limit']);_0x4d5163[_0x64b8('0x21')]=qs[_0x64b8('0x21')](_0x1e36bf[_0x64b8('0x36')][_0x64b8('0x21')]);}return _0x274011[_0x64b8('0x53')](_0x4d5163);}})['then'](function(_0x594496){if(_0x594496){return _0x594496?{'count':_0x92e89c,'rows':_0x594496}:null;}})['then'](respondWithResult(_0x3f5f67,null))[_0x64b8('0x49')](handleError(_0x3f5f67,null));};exports['addActions']=function(_0x39ef6e,_0x229500,_0x19f4ed){return db[_0x64b8('0x57')]['find']({'where':{'id':_0x39ef6e[_0x64b8('0x4b')]['id']}})[_0x64b8('0x2b')](handleEntityNotFound(_0x229500,null))[_0x64b8('0x2b')](function(_0x155142){if(_0x155142){return _0x155142[_0x64b8('0x58')](_0x39ef6e[_0x64b8('0x50')][_0x64b8('0x52')],_[_0x64b8('0x59')](_0x39ef6e[_0x64b8('0x50')],[_0x64b8('0x52'),'id'])||{});}})[_0x64b8('0x2b')](respondWithResult(_0x229500,null))[_0x64b8('0x49')](handleError(_0x229500,null));};exports[_0x64b8('0x5a')]=function(_0x532b50,_0x145ebd,_0x53887d){var _0x37338c={};var _0xadb21f={};var _0x51d47f;var _0x163e8e;return db[_0x64b8('0x30')]['findOne']({'where':{'id':_0x532b50['params']['id']}})[_0x64b8('0x2b')](handleEntityNotFound(_0x145ebd,null))['then'](function(_0x5b6dac){if(_0x5b6dac){_0x51d47f=_0x5b6dac;_0xadb21f['model']=_[_0x64b8('0x37')](db[_0x64b8('0x57')][_0x64b8('0x31')]);_0xadb21f[_0x64b8('0x36')]=_[_0x64b8('0x37')](_0x532b50[_0x64b8('0x36')]);_0xadb21f[_0x64b8('0x38')]=_['intersection'](_0xadb21f[_0x64b8('0x39')],_0xadb21f[_0x64b8('0x36')]);_0x37338c[_0x64b8('0x3c')]=_[_0x64b8('0x3a')](_0xadb21f[_0x64b8('0x39')],qs[_0x64b8('0x3b')](_0x532b50['query'][_0x64b8('0x3b')]));_0x37338c['attributes']=_0x37338c[_0x64b8('0x3c')][_0x64b8('0x4c')]?_0x37338c[_0x64b8('0x3c')]:_0xadb21f[_0x64b8('0x39')];_0x37338c[_0x64b8('0x3f')]=qs[_0x64b8('0x40')](_0x532b50['query'][_0x64b8('0x40')]);_0x37338c[_0x64b8('0x41')]=qs['filters'](_['pick'](_0x532b50['query'],_0xadb21f['filters']));if(_0x532b50[_0x64b8('0x36')][_0x64b8('0x56')]){_0x37338c[_0x64b8('0x41')]=_[_0x64b8('0x43')](_0x37338c[_0x64b8('0x41')],{'$or':_[_0x64b8('0x35')](_0x37338c['attributes'],function(_0xff4a50){var _0x16bb61={};_0x16bb61[_0xff4a50]={'$like':'%'+_0x532b50[_0x64b8('0x36')][_0x64b8('0x56')]+'%'};return _0x16bb61;})});}_0x37338c=_[_0x64b8('0x43')]({},_0x37338c,_0x532b50['options']);return _0x51d47f[_0x64b8('0x5a')](_0x37338c);}})[_0x64b8('0x2b')](function(_0x4910d9){if(_0x4910d9){_0x163e8e=_0x4910d9['length'];if(!_0x532b50[_0x64b8('0x36')][_0x64b8('0x3d')]('nolimit')){_0x37338c[_0x64b8('0x24')]=qs[_0x64b8('0x24')](_0x532b50['query'][_0x64b8('0x24')]);_0x37338c['offset']=qs[_0x64b8('0x21')](_0x532b50[_0x64b8('0x36')][_0x64b8('0x21')]);}return _0x51d47f[_0x64b8('0x5a')](_0x37338c);}})[_0x64b8('0x2b')](function(_0x778093){if(_0x778093){return _0x778093?{'count':_0x163e8e,'rows':_0x778093}:null;}})[_0x64b8('0x2b')](respondWithResult(_0x145ebd,null))[_0x64b8('0x49')](handleError(_0x145ebd,null));}; \ No newline at end of file +var _0x130c=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','save','update','destroy','error','stack','name','send','index','Automation','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','sort','where','filters','pick','merge','map','VIRTUAL','filter','options','then','includeAll','include','rows','show','params','length','create','body','catch','find','addConditions','getConditions','findOne','Condition','order','nolimit','addActions','ids','getActions','rimraf','zip-dir'];(function(_0x1057ee,_0x3e665b){var _0x10fbac=function(_0x2b4818){while(--_0x2b4818){_0x1057ee['push'](_0x1057ee['shift']());}};_0x10fbac(++_0x3e665b);}(_0x130c,0xa2));var _0xc130=function(_0x2c9d27,_0x1b5ead){_0x2c9d27=_0x2c9d27-0x0;var _0x1b73d0=_0x130c[_0x2c9d27];return _0x1b73d0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc130('0x0'));var zipdir=require(_0xc130('0x1'));var jsonpatch=require(_0xc130('0x2'));var rp=require(_0xc130('0x3'));var moment=require(_0xc130('0x4'));var BPromise=require(_0xc130('0x5'));var Mustache=require(_0xc130('0x6'));var util=require(_0xc130('0x7'));var path=require(_0xc130('0x8'));var sox=require(_0xc130('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc130('0xa'));var _=require(_0xc130('0xb'));var squel=require('squel');var crypto=require(_0xc130('0xc'));var jsforce=require(_0xc130('0xd'));var deskjs=require(_0xc130('0xe'));var toCsv=require(_0xc130('0xf'));var querystring=require('querystring');var Papa=require(_0xc130('0x10'));var Redis=require(_0xc130('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xc130('0x12'));var as=require(_0xc130('0x13'));var hardwareService=require(_0xc130('0x14'));var logger=require(_0xc130('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xc130('0x16'));var licenseUtil=require(_0xc130('0x17'));var db=require(_0xc130('0x18'))['db'];function respondWithStatusCode(_0x250d44,_0x5b6162){_0x5b6162=_0x5b6162||0xcc;return function(_0x125627){if(_0x125627){return _0x250d44[_0xc130('0x19')](_0x5b6162);}return _0x250d44[_0xc130('0x1a')](_0x5b6162)['end']();};}function respondWithResult(_0x2a7017,_0x57098e){_0x57098e=_0x57098e||0xc8;return function(_0x1fefd4){if(_0x1fefd4){return _0x2a7017[_0xc130('0x1a')](_0x57098e)[_0xc130('0x1b')](_0x1fefd4);}};}function respondWithFilteredResult(_0xb41905,_0x329e39){return function(_0x22e9b6){if(_0x22e9b6){var _0x2c52a9=typeof _0x329e39[_0xc130('0x1c')]===_0xc130('0x1d')&&typeof _0x329e39['limit']===_0xc130('0x1d');var _0x16afb9=_0x22e9b6[_0xc130('0x1e')];var _0x5d1d22=_0x2c52a9?0x0:_0x329e39[_0xc130('0x1c')];var _0x34da11=_0x2c52a9?_0x22e9b6[_0xc130('0x1e')]:_0x329e39[_0xc130('0x1c')]+_0x329e39[_0xc130('0x1f')];var _0x1cea72;if(_0x34da11>=_0x16afb9){_0x34da11=_0x16afb9;_0x1cea72=0xc8;}else{_0x1cea72=0xce;}_0xb41905[_0xc130('0x1a')](_0x1cea72);return _0xb41905[_0xc130('0x20')](_0xc130('0x21'),_0x5d1d22+'-'+_0x34da11+'/'+_0x16afb9)[_0xc130('0x1b')](_0x22e9b6);}return null;};}function patchUpdates(_0x4e7255){return function(_0x4a9e52){try{jsonpatch['apply'](_0x4a9e52,_0x4e7255,!![]);}catch(_0x6dfe20){return BPromise['reject'](_0x6dfe20);}return _0x4a9e52[_0xc130('0x22')]();};}function saveUpdates(_0x39e132,_0x26a4a9){return function(_0x1971c3){if(_0x1971c3){return _0x1971c3[_0xc130('0x23')](_0x39e132)['then'](function(_0x439983){return _0x439983;});}return null;};}function removeEntity(_0x24050f,_0x4b3159){return function(_0x2e8323){if(_0x2e8323){return _0x2e8323[_0xc130('0x24')]()['then'](function(){_0x24050f[_0xc130('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f9c84,_0x4f72ce){return function(_0x204f03){if(!_0x204f03){_0x1f9c84[_0xc130('0x19')](0x194);}return _0x204f03;};}function handleError(_0x7419ef,_0x638c24){_0x638c24=_0x638c24||0x1f4;return function(_0x22932e){logger[_0xc130('0x25')](_0x22932e[_0xc130('0x26')]);if(_0x22932e[_0xc130('0x27')]){delete _0x22932e[_0xc130('0x27')];}_0x7419ef['status'](_0x638c24)[_0xc130('0x28')](_0x22932e);};}exports[_0xc130('0x29')]=function(_0x4950e7,_0x383635){var _0x21f66c={},_0x209690={},_0x1107cc={'count':0x0,'rows':[]};var _0x2843e6=_['map'](db[_0xc130('0x2a')][_0xc130('0x2b')],function(_0x1e95df){return{'name':_0x1e95df['fieldName'],'type':_0x1e95df[_0xc130('0x2c')][_0xc130('0x2d')]};});_0x209690[_0xc130('0x2e')]=_['map'](_0x2843e6,_0xc130('0x27'));_0x209690[_0xc130('0x2f')]=_[_0xc130('0x30')](_0x4950e7[_0xc130('0x2f')]);_0x209690['filters']=_[_0xc130('0x31')](_0x209690[_0xc130('0x2e')],_0x209690[_0xc130('0x2f')]);_0x21f66c[_0xc130('0x32')]=_['intersection'](_0x209690[_0xc130('0x2e')],qs[_0xc130('0x33')](_0x4950e7['query']['fields']));_0x21f66c[_0xc130('0x32')]=_0x21f66c[_0xc130('0x32')]['length']?_0x21f66c[_0xc130('0x32')]:_0x209690['model'];if(!_0x4950e7['query'][_0xc130('0x34')]('nolimit')){_0x21f66c[_0xc130('0x1f')]=qs[_0xc130('0x1f')](_0x4950e7['query'][_0xc130('0x1f')]);_0x21f66c[_0xc130('0x1c')]=qs[_0xc130('0x1c')](_0x4950e7[_0xc130('0x2f')][_0xc130('0x1c')]);}_0x21f66c['order']=qs[_0xc130('0x35')](_0x4950e7[_0xc130('0x2f')][_0xc130('0x35')]);_0x21f66c[_0xc130('0x36')]=qs[_0xc130('0x37')](_[_0xc130('0x38')](_0x4950e7['query'],_0x209690[_0xc130('0x37')]),_0x2843e6);if(_0x4950e7[_0xc130('0x2f')]['filter']){_0x21f66c[_0xc130('0x36')]=_[_0xc130('0x39')](_0x21f66c[_0xc130('0x36')],{'$or':_[_0xc130('0x3a')](_0x2843e6,function(_0x53b22b){if(_0x53b22b['type']!==_0xc130('0x3b')){var _0xc2bb69={};_0xc2bb69[_0x53b22b[_0xc130('0x27')]]={'$like':'%'+_0x4950e7[_0xc130('0x2f')][_0xc130('0x3c')]+'%'};return _0xc2bb69;}})});}_0x21f66c=_[_0xc130('0x39')]({},_0x21f66c,_0x4950e7[_0xc130('0x3d')]);var _0x2a2f74={'where':_0x21f66c['where']};return db[_0xc130('0x2a')][_0xc130('0x1e')](_0x2a2f74)[_0xc130('0x3e')](function(_0x11e283){_0x1107cc[_0xc130('0x1e')]=_0x11e283;if(_0x4950e7[_0xc130('0x2f')][_0xc130('0x3f')]){_0x21f66c[_0xc130('0x40')]=[{'all':!![]}];}return db[_0xc130('0x2a')]['findAll'](_0x21f66c);})[_0xc130('0x3e')](function(_0x4b3caf){_0x1107cc[_0xc130('0x41')]=_0x4b3caf;return _0x1107cc;})['then'](respondWithFilteredResult(_0x383635,_0x21f66c))['catch'](handleError(_0x383635,null));};exports[_0xc130('0x42')]=function(_0x2fb2ad,_0x356bd8){var _0x2289b8={'raw':![],'where':{'id':_0x2fb2ad[_0xc130('0x43')]['id']}},_0x2fea5e={};_0x2fea5e[_0xc130('0x2e')]=_[_0xc130('0x30')](db[_0xc130('0x2a')]['rawAttributes']);_0x2fea5e['query']=_[_0xc130('0x30')](_0x2fb2ad['query']);_0x2fea5e[_0xc130('0x37')]=_[_0xc130('0x31')](_0x2fea5e[_0xc130('0x2e')],_0x2fea5e[_0xc130('0x2f')]);_0x2289b8[_0xc130('0x32')]=_['intersection'](_0x2fea5e[_0xc130('0x2e')],qs['fields'](_0x2fb2ad[_0xc130('0x2f')][_0xc130('0x33')]));_0x2289b8['attributes']=_0x2289b8[_0xc130('0x32')][_0xc130('0x44')]?_0x2289b8['attributes']:_0x2fea5e[_0xc130('0x2e')];if(_0x2fb2ad[_0xc130('0x2f')][_0xc130('0x3f')]){_0x2289b8[_0xc130('0x40')]=[{'all':!![]}];}_0x2289b8=_['merge']({},_0x2289b8,_0x2fb2ad[_0xc130('0x3d')]);return db['Automation']['find'](_0x2289b8)[_0xc130('0x3e')](handleEntityNotFound(_0x356bd8,null))['then'](respondWithResult(_0x356bd8,null))['catch'](handleError(_0x356bd8,null));};exports[_0xc130('0x45')]=function(_0x46fd0f,_0x1bee65){return db[_0xc130('0x2a')][_0xc130('0x45')](_0x46fd0f[_0xc130('0x46')],{})['then'](respondWithResult(_0x1bee65,0xc9))[_0xc130('0x47')](handleError(_0x1bee65,null));};exports[_0xc130('0x23')]=function(_0x252660,_0x9570d0){if(_0x252660[_0xc130('0x46')]['id']){delete _0x252660['body']['id'];}return db[_0xc130('0x2a')][_0xc130('0x48')]({'where':{'id':_0x252660[_0xc130('0x43')]['id']}})[_0xc130('0x3e')](handleEntityNotFound(_0x9570d0,null))['then'](saveUpdates(_0x252660[_0xc130('0x46')],null))[_0xc130('0x3e')](respondWithResult(_0x9570d0,null))[_0xc130('0x47')](handleError(_0x9570d0,null));};exports[_0xc130('0x24')]=function(_0x1fc37e,_0x2fcca7){return db[_0xc130('0x2a')]['find']({'where':{'id':_0x1fc37e[_0xc130('0x43')]['id']}})[_0xc130('0x3e')](handleEntityNotFound(_0x2fcca7,null))[_0xc130('0x3e')](removeEntity(_0x2fcca7,null))[_0xc130('0x47')](handleError(_0x2fcca7,null));};exports[_0xc130('0x49')]=function(_0x29d8e6,_0x38d577,_0x2616f9){return db['Condition']['find']({'where':{'id':_0x29d8e6[_0xc130('0x43')]['id']}})[_0xc130('0x3e')](handleEntityNotFound(_0x38d577,null))[_0xc130('0x3e')](function(_0x1f82d1){if(_0x1f82d1){return _0x1f82d1[_0xc130('0x49')](_0x29d8e6['body']['ids'],_['omit'](_0x29d8e6[_0xc130('0x46')],['ids','id'])||{});}})[_0xc130('0x3e')](respondWithResult(_0x38d577,null))['catch'](handleError(_0x38d577,null));};exports[_0xc130('0x4a')]=function(_0x5d3dea,_0x2ee647,_0x90f986){var _0x279060={};var _0x1e9e6f={};var _0x36a8ff;var _0x44ac4f;return db[_0xc130('0x2a')][_0xc130('0x4b')]({'where':{'id':_0x5d3dea[_0xc130('0x43')]['id']}})[_0xc130('0x3e')](handleEntityNotFound(_0x2ee647,null))[_0xc130('0x3e')](function(_0x224563){if(_0x224563){_0x36a8ff=_0x224563;_0x1e9e6f[_0xc130('0x2e')]=_[_0xc130('0x30')](db[_0xc130('0x4c')][_0xc130('0x2b')]);_0x1e9e6f[_0xc130('0x2f')]=_['keys'](_0x5d3dea[_0xc130('0x2f')]);_0x1e9e6f[_0xc130('0x37')]=_['intersection'](_0x1e9e6f['model'],_0x1e9e6f['query']);_0x279060[_0xc130('0x32')]=_['intersection'](_0x1e9e6f[_0xc130('0x2e')],qs[_0xc130('0x33')](_0x5d3dea['query'][_0xc130('0x33')]));_0x279060[_0xc130('0x32')]=_0x279060[_0xc130('0x32')][_0xc130('0x44')]?_0x279060[_0xc130('0x32')]:_0x1e9e6f['model'];_0x279060[_0xc130('0x4d')]=qs[_0xc130('0x35')](_0x5d3dea[_0xc130('0x2f')][_0xc130('0x35')]);_0x279060[_0xc130('0x36')]=qs['filters'](_['pick'](_0x5d3dea[_0xc130('0x2f')],_0x1e9e6f[_0xc130('0x37')]));if(_0x5d3dea[_0xc130('0x2f')][_0xc130('0x3c')]){_0x279060['where']=_['merge'](_0x279060[_0xc130('0x36')],{'$or':_[_0xc130('0x3a')](_0x279060[_0xc130('0x32')],function(_0x39e68c){var _0x29697b={};_0x29697b[_0x39e68c]={'$like':'%'+_0x5d3dea[_0xc130('0x2f')]['filter']+'%'};return _0x29697b;})});}_0x279060=_[_0xc130('0x39')]({},_0x279060,_0x5d3dea[_0xc130('0x3d')]);return _0x36a8ff['getConditions'](_0x279060);}})[_0xc130('0x3e')](function(_0x31e430){if(_0x31e430){_0x44ac4f=_0x31e430[_0xc130('0x44')];if(!_0x5d3dea[_0xc130('0x2f')][_0xc130('0x34')](_0xc130('0x4e'))){_0x279060[_0xc130('0x1f')]=qs[_0xc130('0x1f')](_0x5d3dea[_0xc130('0x2f')][_0xc130('0x1f')]);_0x279060[_0xc130('0x1c')]=qs['offset'](_0x5d3dea['query'][_0xc130('0x1c')]);}return _0x36a8ff[_0xc130('0x4a')](_0x279060);}})['then'](function(_0x26a379){if(_0x26a379){return _0x26a379?{'count':_0x44ac4f,'rows':_0x26a379}:null;}})['then'](respondWithResult(_0x2ee647,null))['catch'](handleError(_0x2ee647,null));};exports[_0xc130('0x4f')]=function(_0x3bc5ac,_0x292a67,_0x4daaae){return db['Action'][_0xc130('0x48')]({'where':{'id':_0x3bc5ac['params']['id']}})[_0xc130('0x3e')](handleEntityNotFound(_0x292a67,null))[_0xc130('0x3e')](function(_0x3309f9){if(_0x3309f9){return _0x3309f9[_0xc130('0x4f')](_0x3bc5ac[_0xc130('0x46')][_0xc130('0x50')],_['omit'](_0x3bc5ac['body'],[_0xc130('0x50'),'id'])||{});}})[_0xc130('0x3e')](respondWithResult(_0x292a67,null))[_0xc130('0x47')](handleError(_0x292a67,null));};exports[_0xc130('0x51')]=function(_0x2a275c,_0x27d298,_0x3df9dc){var _0x4e1c4a={};var _0x2d9dc2={};var _0x5cce9a;var _0x1c6863;return db[_0xc130('0x2a')][_0xc130('0x4b')]({'where':{'id':_0x2a275c['params']['id']}})['then'](handleEntityNotFound(_0x27d298,null))['then'](function(_0x1f2bc7){if(_0x1f2bc7){_0x5cce9a=_0x1f2bc7;_0x2d9dc2['model']=_[_0xc130('0x30')](db['Action']['rawAttributes']);_0x2d9dc2[_0xc130('0x2f')]=_[_0xc130('0x30')](_0x2a275c[_0xc130('0x2f')]);_0x2d9dc2[_0xc130('0x37')]=_['intersection'](_0x2d9dc2['model'],_0x2d9dc2['query']);_0x4e1c4a[_0xc130('0x32')]=_[_0xc130('0x31')](_0x2d9dc2[_0xc130('0x2e')],qs[_0xc130('0x33')](_0x2a275c['query'][_0xc130('0x33')]));_0x4e1c4a[_0xc130('0x32')]=_0x4e1c4a[_0xc130('0x32')]['length']?_0x4e1c4a['attributes']:_0x2d9dc2['model'];_0x4e1c4a['order']=qs['sort'](_0x2a275c[_0xc130('0x2f')][_0xc130('0x35')]);_0x4e1c4a[_0xc130('0x36')]=qs[_0xc130('0x37')](_[_0xc130('0x38')](_0x2a275c[_0xc130('0x2f')],_0x2d9dc2[_0xc130('0x37')]));if(_0x2a275c[_0xc130('0x2f')][_0xc130('0x3c')]){_0x4e1c4a[_0xc130('0x36')]=_[_0xc130('0x39')](_0x4e1c4a[_0xc130('0x36')],{'$or':_[_0xc130('0x3a')](_0x4e1c4a['attributes'],function(_0x4f4cee){var _0x993470={};_0x993470[_0x4f4cee]={'$like':'%'+_0x2a275c[_0xc130('0x2f')]['filter']+'%'};return _0x993470;})});}_0x4e1c4a=_[_0xc130('0x39')]({},_0x4e1c4a,_0x2a275c[_0xc130('0x3d')]);return _0x5cce9a['getActions'](_0x4e1c4a);}})['then'](function(_0x3742b5){if(_0x3742b5){_0x1c6863=_0x3742b5[_0xc130('0x44')];if(!_0x2a275c[_0xc130('0x2f')][_0xc130('0x34')]('nolimit')){_0x4e1c4a['limit']=qs['limit'](_0x2a275c[_0xc130('0x2f')][_0xc130('0x1f')]);_0x4e1c4a['offset']=qs[_0xc130('0x1c')](_0x2a275c[_0xc130('0x2f')][_0xc130('0x1c')]);}return _0x5cce9a['getActions'](_0x4e1c4a);}})[_0xc130('0x3e')](function(_0x1ded5e){if(_0x1ded5e){return _0x1ded5e?{'count':_0x1c6863,'rows':_0x1ded5e}:null;}})[_0xc130('0x3e')](respondWithResult(_0x27d298,null))[_0xc130('0x47')](handleError(_0x27d298,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index a5f1114..31e7cef 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 _0x12a8=['../../config/environment','./automation.attributes','exports','define','tools_automations','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x199429,_0x1ead07){var _0x1d0b7d=function(_0x572d41){while(--_0x572d41){_0x199429['push'](_0x199429['shift']());}};_0x1d0b7d(++_0x1ead07);}(_0x12a8,0x95));var _0x812a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x12a8[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x812a('0x0'));var util=require(_0x812a('0x1'));var logger=require(_0x812a('0x2'))(_0x812a('0x3'));var moment=require('moment');var BPromise=require(_0x812a('0x4'));var rp=require(_0x812a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x812a('0x6'));var config=require(_0x812a('0x7'));var attributes=require(_0x812a('0x8'));module[_0x812a('0x9')]=function(_0x12330d,_0x43829e){return _0x12330d[_0x812a('0xa')]('Automation',attributes,{'tableName':_0x812a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa252=['exports','define','Automation','tools_automations','util','moment','path','rimraf','./automation.attributes'];(function(_0xfb8e9c,_0x4bfaec){var _0x432968=function(_0x574cce){while(--_0x574cce){_0xfb8e9c['push'](_0xfb8e9c['shift']());}};_0x432968(++_0x4bfaec);}(_0xa252,0x1d8));var _0x2a25=function(_0x366c03,_0x137ce6){_0x366c03=_0x366c03-0x0;var _0x48c619=_0xa252[_0x366c03];return _0x48c619;};'use strict';var _=require('lodash');var util=require(_0x2a25('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x2a25('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2a25('0x2'));var rimraf=require(_0x2a25('0x3'));var config=require('../../config/environment');var attributes=require(_0x2a25('0x4'));module[_0x2a25('0x5')]=function(_0xa46b4c,_0xa36adb){return _0xa46b4c[_0x2a25('0x6')](_0x2a25('0x7'),attributes,{'tableName':_0x2a25('0x8'),'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 265005b..28313af 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 _0xac35=['request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Automation,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x7ac1d6,_0x101230){var _0x52c77e=function(_0x5f2eff){while(--_0x5f2eff){_0x7ac1d6['push'](_0x7ac1d6['shift']());}};_0x52c77e(++_0x101230);}(_0xac35,0x141));var _0x5ac3=function(_0x2de56a,_0x2a0373){_0x2de56a=_0x2de56a-0x0;var _0x39cfab=_0xac35[_0x2de56a];return _0x39cfab;};'use strict';var _=require(_0x5ac3('0x0'));var util=require(_0x5ac3('0x1'));var moment=require(_0x5ac3('0x2'));var BPromise=require(_0x5ac3('0x3'));var rs=require(_0x5ac3('0x4'));var fs=require('fs');var Redis=require(_0x5ac3('0x5'));var db=require(_0x5ac3('0x6'))['db'];var utils=require(_0x5ac3('0x7'));var logger=require(_0x5ac3('0x8'))(_0x5ac3('0x9'));var config=require(_0x5ac3('0xa'));var jayson=require(_0x5ac3('0xb'));var client=jayson[_0x5ac3('0xc')][_0x5ac3('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4c9a16,_0x77dc9f,_0x5e96cb){return new BPromise(function(_0x2a19b9,_0x1754d2){return client[_0x5ac3('0xe')](_0x4c9a16,_0x5e96cb)[_0x5ac3('0xf')](function(_0x378900){logger[_0x5ac3('0x10')]('Automation,\x20%s,\x20%s',_0x77dc9f,_0x5ac3('0x11'));logger['debug'](_0x5ac3('0x12'),_0x77dc9f,_0x5ac3('0x11'),JSON[_0x5ac3('0x13')](_0x378900));if(_0x378900[_0x5ac3('0x14')]){if(_0x378900[_0x5ac3('0x14')][_0x5ac3('0x15')]===0x1f4){logger[_0x5ac3('0x14')]('Automation,\x20%s,\x20%s',_0x77dc9f,_0x378900[_0x5ac3('0x14')][_0x5ac3('0x16')]);return _0x1754d2(_0x378900[_0x5ac3('0x14')][_0x5ac3('0x16')]);}logger[_0x5ac3('0x14')](_0x5ac3('0x17'),_0x77dc9f,_0x378900[_0x5ac3('0x14')][_0x5ac3('0x16')]);return _0x2a19b9(_0x378900['error']['message']);}else{logger[_0x5ac3('0x10')](_0x5ac3('0x17'),_0x77dc9f,'request\x20sent');_0x2a19b9(_0x378900[_0x5ac3('0x18')]['message']);}})[_0x5ac3('0x19')](function(_0x18cad4){logger[_0x5ac3('0x14')]('Automation,\x20%s,\x20%s',_0x77dc9f,_0x18cad4);_0x1754d2(_0x18cad4);});});} \ No newline at end of file +var _0x8322=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','Automation,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x23c2c3,_0x27ecc8){var _0x41e09f=function(_0x5e6873){while(--_0x5e6873){_0x23c2c3['push'](_0x23c2c3['shift']());}};_0x41e09f(++_0x27ecc8);}(_0x8322,0x186));var _0x2832=function(_0x242a98,_0x13988e){_0x242a98=_0x242a98-0x0;var _0x580999=_0x8322[_0x242a98];return _0x580999;};'use strict';var _=require(_0x2832('0x0'));var util=require(_0x2832('0x1'));var moment=require(_0x2832('0x2'));var BPromise=require(_0x2832('0x3'));var rs=require(_0x2832('0x4'));var fs=require('fs');var Redis=require(_0x2832('0x5'));var db=require(_0x2832('0x6'))['db'];var utils=require(_0x2832('0x7'));var logger=require(_0x2832('0x8'))(_0x2832('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2832('0xa')][_0x2832('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xab2c39,_0x29a788,_0x1488df){return new BPromise(function(_0x4b0ca8,_0xb57a3c){return client[_0x2832('0xc')](_0xab2c39,_0x1488df)[_0x2832('0xd')](function(_0xb1f005){logger['info'](_0x2832('0xe'),_0x29a788,_0x2832('0xf'));logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0x29a788,_0x2832('0xf'),JSON['stringify'](_0xb1f005));if(_0xb1f005['error']){if(_0xb1f005[_0x2832('0x10')][_0x2832('0x11')]===0x1f4){logger[_0x2832('0x10')](_0x2832('0xe'),_0x29a788,_0xb1f005['error'][_0x2832('0x12')]);return _0xb57a3c(_0xb1f005[_0x2832('0x10')]['message']);}logger[_0x2832('0x10')](_0x2832('0xe'),_0x29a788,_0xb1f005[_0x2832('0x10')][_0x2832('0x12')]);return _0x4b0ca8(_0xb1f005[_0x2832('0x10')][_0x2832('0x12')]);}else{logger[_0x2832('0x13')]('Automation,\x20%s,\x20%s',_0x29a788,_0x2832('0xf'));_0x4b0ca8(_0xb1f005[_0x2832('0x14')]['message']);}})[_0x2832('0x15')](function(_0x56d1e6){logger[_0x2832('0x10')]('Automation,\x20%s,\x20%s',_0x29a788,_0x56d1e6);_0xb57a3c(_0x56d1e6);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index b2b6188..0cc365d 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 _0xefe5=['/:id','update','delete','exports','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./automation.controller','get','isAuthenticated','index','show','/:id/conditions','getConditions','/:id/actions','post','create','addActions','put'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0xefe5,0xf6));var _0x5efe=function(_0x7c15f1,_0x9aba97){_0x7c15f1=_0x7c15f1-0x0;var _0xbdb9c1=_0xefe5[_0x7c15f1];return _0xbdb9c1;};'use strict';var multer=require(_0x5efe('0x0'));var util=require('util');var path=require(_0x5efe('0x1'));var timeout=require(_0x5efe('0x2'));var express=require('express');var router=express[_0x5efe('0x3')]();var fs_extra=require(_0x5efe('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5efe('0x5'));var config=require('../../config/environment');var controller=require(_0x5efe('0x6'));router[_0x5efe('0x7')]('/',auth[_0x5efe('0x8')](),controller[_0x5efe('0x9')]);router[_0x5efe('0x7')]('/:id',auth[_0x5efe('0x8')](),controller[_0x5efe('0xa')]);router[_0x5efe('0x7')](_0x5efe('0xb'),auth[_0x5efe('0x8')](),controller[_0x5efe('0xc')]);router[_0x5efe('0x7')](_0x5efe('0xd'),auth[_0x5efe('0x8')](),controller['getActions']);router[_0x5efe('0xe')]('/',auth[_0x5efe('0x8')](),controller[_0x5efe('0xf')]);router[_0x5efe('0xe')]('/:id/conditions',auth['isAuthenticated'](),controller['addConditions']);router[_0x5efe('0xe')](_0x5efe('0xd'),auth[_0x5efe('0x8')](),controller[_0x5efe('0x10')]);router[_0x5efe('0x11')](_0x5efe('0x12'),auth[_0x5efe('0x8')](),controller[_0x5efe('0x13')]);router[_0x5efe('0x14')](_0x5efe('0x12'),auth[_0x5efe('0x8')](),controller['destroy']);module[_0x5efe('0x15')]=router; \ No newline at end of file +var _0x33ed=['post','create','addConditions','/:id/actions','addActions','put','update','delete','destroy','exports','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','show','get','/:id/conditions','getConditions','getActions'];(function(_0x162902,_0x4b317a){var _0x1ee9b3=function(_0x57e390){while(--_0x57e390){_0x162902['push'](_0x162902['shift']());}};_0x1ee9b3(++_0x4b317a);}(_0x33ed,0x66));var _0xd33e=function(_0x644ecd,_0x397f36){_0x644ecd=_0x644ecd-0x0;var _0x1c66ce=_0x33ed[_0x644ecd];return _0x1c66ce;};'use strict';var multer=require('multer');var util=require(_0xd33e('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd33e('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd33e('0x2'));var interaction=require(_0xd33e('0x3'));var config=require(_0xd33e('0x4'));var controller=require('./automation.controller');router['get']('/',auth[_0xd33e('0x5')](),controller[_0xd33e('0x6')]);router['get'](_0xd33e('0x7'),auth[_0xd33e('0x5')](),controller[_0xd33e('0x8')]);router[_0xd33e('0x9')](_0xd33e('0xa'),auth[_0xd33e('0x5')](),controller[_0xd33e('0xb')]);router[_0xd33e('0x9')]('/:id/actions',auth[_0xd33e('0x5')](),controller[_0xd33e('0xc')]);router[_0xd33e('0xd')]('/',auth[_0xd33e('0x5')](),controller[_0xd33e('0xe')]);router[_0xd33e('0xd')](_0xd33e('0xa'),auth[_0xd33e('0x5')](),controller[_0xd33e('0xf')]);router[_0xd33e('0xd')](_0xd33e('0x10'),auth[_0xd33e('0x5')](),controller[_0xd33e('0x11')]);router[_0xd33e('0x12')](_0xd33e('0x7'),auth['isAuthenticated'](),controller[_0xd33e('0x13')]);router[_0xd33e('0x14')](_0xd33e('0x7'),auth[_0xd33e('0x5')](),controller[_0xd33e('0x15')]);module[_0xd33e('0x16')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 8b8a0bd..d814803 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 _0xc651=['Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC'];(function(_0x160d40,_0x252284){var _0x33f9cf=function(_0x2f9bad){while(--_0x2f9bad){_0x160d40['push'](_0x160d40['shift']());}};_0x33f9cf(++_0x252284);}(_0xc651,0xb4));var _0x1c65=function(_0x3499d6,_0x2cb419){_0x3499d6=_0x3499d6-0x0;var _0x1afc7a=_0xc651[_0x3499d6];return _0x1afc7a;};'use strict';var Sequelize=require(_0x1c65('0x0'));module[_0x1c65('0x1')]={'name':{'type':Sequelize[_0x1c65('0x2')],'unique':_0x1c65('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x1c65('0x4')](_0x1c65('0x5')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x1c65('0x2')]},'active':{'type':Sequelize[_0x1c65('0x6')],'defaultValue':0x0,'comment':_0x1c65('0x7')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x1c65('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x1c65('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0x1c65('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x1c65('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x1c65('0xa')](0x3)[_0x1c65('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1c65('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x1c65('0xa')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1c65('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x1c65('0xa')](0x3)[_0x1c65('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1c65('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0x1c65('0xa')](0x5)[_0x1c65('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1c65('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x1c65('0xa')](0x3)[_0x1c65('0x8')],'defaultValue':0x3,'comment':_0x1c65('0xf')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1c65('0xa')](0x5)[_0x1c65('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1c65('0x10')},'dialGlobalMaxRetry':{'type':Sequelize[_0x1c65('0xa')](0x3)[_0x1c65('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x1c65('0x11')},'dialTimezone':{'type':Sequelize[_0x1c65('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x1c65('0x2')],'defaultValue':_0x1c65('0x12')},'dialCheckDuplicateType':{'type':Sequelize[_0x1c65('0x4')](_0x1c65('0x13'),'never',_0x1c65('0x14')),'defaultValue':_0x1c65('0x13')},'dialAMDActive':{'type':Sequelize[_0x1c65('0x6')],'defaultValue':0x0,'comment':_0x1c65('0x15')},'dialAMDInitialSilence':{'type':Sequelize[_0x1c65('0xa')](0x9)[_0x1c65('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x1c65('0x16')},'dialAMDGreeting':{'type':Sequelize[_0x1c65('0xa')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x1c65('0x17')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x1c65('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1c65('0x18')},'dialAMDMinWordLength':{'type':Sequelize[_0x1c65('0xa')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x1c65('0x19')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1c65('0xa')](0x9)[_0x1c65('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x1c65('0x1a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x1c65('0xa')](0x9)[_0x1c65('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x1c65('0x1b')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x1c65('0xa')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x1c65('0xa')](0x9)[_0x1c65('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1c65('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x1c65('0x1d'),'ASC'),'defaultValue':_0x1c65('0x1d')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x1c65('0xa')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1c65('0x1e')},'dialCutDigit':{'type':Sequelize[_0x1c65('0xa')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1c65('0x1f')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x1c65('0xa')](0x3)[_0x1c65('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1c65('0x20')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x1c65('0xa')](0x5)[_0x1c65('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1c65('0x21')},'dialDropMaxRetry':{'type':Sequelize[_0x1c65('0xa')](0x3)[_0x1c65('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1c65('0x22')},'dialDropRetryFrequency':{'type':Sequelize[_0x1c65('0xa')](0x5)[_0x1c65('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1c65('0x23')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x1c65('0xa')](0x3)[_0x1c65('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1c65('0x24')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x1c65('0xa')](0x5)[_0x1c65('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1c65('0x25')},'dialMachineMaxRetry':{'type':Sequelize[_0x1c65('0xa')](0x3)[_0x1c65('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1c65('0x26')},'dialMachineRetryFrequency':{'type':Sequelize[_0x1c65('0xa')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1c65('0x27')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x1c65('0xa')](0x3)[_0x1c65('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1c65('0x28')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1c65('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1c65('0x29')}}; \ No newline at end of file +var _0x9550=['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)','exports','STRING','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','#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)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)'];(function(_0x3206ab,_0x55af3b){var _0x17afc4=function(_0x4a3cfe){while(--_0x4a3cfe){_0x3206ab['push'](_0x3206ab['shift']());}};_0x17afc4(++_0x55af3b);}(_0x9550,0x1cc));var _0x0955=function(_0x32d226,_0x1ee2dc){_0x32d226=_0x32d226-0x0;var _0x4acf5f=_0x9550[_0x32d226];return _0x4acf5f;};'use strict';var Sequelize=require('sequelize');module[_0x0955('0x0')]={'name':{'type':Sequelize[_0x0955('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x0955('0x2')](_0x0955('0x3')),'allowNull':![],'defaultValue':_0x0955('0x3')},'description':{'type':Sequelize[_0x0955('0x1')]},'active':{'type':Sequelize[_0x0955('0x4')],'defaultValue':0x0,'comment':_0x0955('0x5')},'limitCalls':{'type':Sequelize[_0x0955('0x6')](0x4)[_0x0955('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x0955('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x0955('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x0955('0x6')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x0955('0x6')](0x3)[_0x0955('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0955('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x0955('0x6')](0x5)[_0x0955('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0955('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x0955('0x6')](0x3)[_0x0955('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0955('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x0955('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0955('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0955('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0955('0x6')](0x5)[_0x0955('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x0955('0x6')](0x3)[_0x0955('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0955('0xd')},'dialTimezone':{'type':Sequelize[_0x0955('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0955('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x0955('0x2')](_0x0955('0xe'),_0x0955('0xf'),_0x0955('0x10')),'defaultValue':_0x0955('0xe')},'dialAMDActive':{'type':Sequelize[_0x0955('0x4')],'defaultValue':0x0,'comment':_0x0955('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0x0955('0x6')](0x9)[_0x0955('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0955('0x12')},'dialAMDGreeting':{'type':Sequelize[_0x0955('0x6')](0x9)[_0x0955('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0955('0x6')](0x9)[_0x0955('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0955('0x13')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0955('0x6')](0x9)[_0x0955('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0955('0x14')},'dialAMDMinWordLength':{'type':Sequelize[_0x0955('0x6')](0x9)[_0x0955('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x0955('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x0955('0x15')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0955('0x6')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x0955('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0955('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0955('0x17')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x0955('0x18'),_0x0955('0x19')),'defaultValue':_0x0955('0x18')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x0955('0x6')](0x3)[_0x0955('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0955('0x1a')},'dialCutDigit':{'type':Sequelize[_0x0955('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0955('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0955('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0955('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x0955('0x6')](0x5)[_0x0955('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0955('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0955('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x0955('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0955('0x1d')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0955('0x6')](0x5)[_0x0955('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0955('0x1e')},'dialMachineMaxRetry':{'type':Sequelize[_0x0955('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0955('0x1f')},'dialMachineRetryFrequency':{'type':Sequelize[_0x0955('0x6')](0x5)[_0x0955('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0955('0x20')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0955('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0955('0x21')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0955('0x6')](0x5)[_0x0955('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0955('0x22')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 525afdc..a1eb206 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 _0x1ff8=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','get','IvrCampaigns','then','stack','name','index','map','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','Campaign','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileResource','findOne','CmHopper','nolimit','CmHopperHistory','CampaignId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','ContactId','select','field','scheduledAt','CmListId','toString','ListId','NOW()','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','from','onlyIfOpen','cm_contacts','insert','phone\x20IS\x20NOT\x20NULL','push','sequelize','all','removeLists','getBlackLists','addBlackLists','removeBlackLists','eml-format','rimraf'];(function(_0x57db49,_0x288094){var _0xd0636f=function(_0x227787){while(--_0x227787){_0x57db49['push'](_0x57db49['shift']());}};_0xd0636f(++_0x288094);}(_0x1ff8,0x10e));var _0x81ff=function(_0x4ffafb,_0x20171a){_0x4ffafb=_0x4ffafb-0x0;var _0x4ab472=_0x1ff8[_0x4ffafb];return _0x4ab472;};'use strict';var emlformat=require(_0x81ff('0x0'));var rimraf=require(_0x81ff('0x1'));var zipdir=require(_0x81ff('0x2'));var jsonpatch=require(_0x81ff('0x3'));var rp=require(_0x81ff('0x4'));var moment=require(_0x81ff('0x5'));var BPromise=require(_0x81ff('0x6'));var Mustache=require(_0x81ff('0x7'));var util=require('util');var path=require(_0x81ff('0x8'));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(_0x81ff('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x81ff('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x81ff('0xb'));var querystring=require(_0x81ff('0xc'));var Papa=require(_0x81ff('0xd'));var Redis=require(_0x81ff('0xe'));var authService=require(_0x81ff('0xf'));var qs=require(_0x81ff('0x10'));var as=require(_0x81ff('0x11'));var hardwareService=require(_0x81ff('0x12'));var logger=require(_0x81ff('0x13'))(_0x81ff('0x14'));var utils=require(_0x81ff('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x81ff('0x16'));var db=require(_0x81ff('0x17'))['db'];function respondWithStatusCode(_0x3ed67f,_0x2dd108){_0x2dd108=_0x2dd108||0xcc;return function(_0x2a10ac){if(_0x2a10ac){return _0x3ed67f[_0x81ff('0x18')](_0x2dd108);}return _0x3ed67f[_0x81ff('0x19')](_0x2dd108)[_0x81ff('0x1a')]();};}function respondWithResult(_0x1f6449,_0x12b9c1){_0x12b9c1=_0x12b9c1||0xc8;return function(_0x29f3bd){if(_0x29f3bd){return _0x1f6449[_0x81ff('0x19')](_0x12b9c1)[_0x81ff('0x1b')](_0x29f3bd);}};}function respondWithFilteredResult(_0x36f5fe,_0x1e6a52){return function(_0x337f53){if(_0x337f53){var _0x57fd94=typeof _0x1e6a52[_0x81ff('0x1c')]===_0x81ff('0x1d')&&typeof _0x1e6a52[_0x81ff('0x1e')]===_0x81ff('0x1d');var _0x47f27a=_0x337f53[_0x81ff('0x1f')];var _0x2f2545=_0x57fd94?0x0:_0x1e6a52[_0x81ff('0x1c')];var _0xdcf221=_0x57fd94?_0x337f53[_0x81ff('0x1f')]:_0x1e6a52[_0x81ff('0x1c')]+_0x1e6a52[_0x81ff('0x1e')];var _0x25dbed;if(_0xdcf221>=_0x47f27a){_0xdcf221=_0x47f27a;_0x25dbed=0xc8;}else{_0x25dbed=0xce;}_0x36f5fe[_0x81ff('0x19')](_0x25dbed);return _0x36f5fe['set'](_0x81ff('0x20'),_0x2f2545+'-'+_0xdcf221+'/'+_0x47f27a)['json'](_0x337f53);}return null;};}function patchUpdates(_0x28e86f){return function(_0x96c7e3){try{jsonpatch[_0x81ff('0x21')](_0x96c7e3,_0x28e86f,!![]);}catch(_0x516f04){return BPromise[_0x81ff('0x22')](_0x516f04);}return _0x96c7e3[_0x81ff('0x23')]();};}function saveUpdates(_0x38971b,_0x3825d7){return function(_0x443e77){if(_0x443e77){return _0x443e77[_0x81ff('0x24')](_0x38971b)['then'](function(_0x3f1bb7){return _0x3f1bb7;});}return null;};}function removeEntity(_0x58dce4,_0x9abbfc){return function(_0x587aa9){if(_0x587aa9){return _0x587aa9[_0x81ff('0x25')]()['then'](function(){var _0x32a96f=_0x587aa9[_0x81ff('0x26')]({'plain':!![]});var _0x15b93d=_0x81ff('0x27');return db['UserProfileResource'][_0x81ff('0x25')]({'where':{'type':_0x15b93d,'resourceId':_0x32a96f['id']}})['then'](function(){return _0x587aa9;});})[_0x81ff('0x28')](function(){_0x58dce4[_0x81ff('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12a997,_0x393e7a){return function(_0x2f0673){if(!_0x2f0673){_0x12a997[_0x81ff('0x18')](0x194);}return _0x2f0673;};}function handleError(_0x31e903,_0x2bd0a7){_0x2bd0a7=_0x2bd0a7||0x1f4;return function(_0x2e49be){logger['error'](_0x2e49be[_0x81ff('0x29')]);if(_0x2e49be[_0x81ff('0x2a')]){delete _0x2e49be[_0x81ff('0x2a')];}_0x31e903[_0x81ff('0x19')](_0x2bd0a7)['send'](_0x2e49be);};}exports[_0x81ff('0x2b')]=function(_0x18da8f,_0x13f6e0){var _0x19a27a={},_0x3f3b5b={},_0x3b4759={'count':0x0,'rows':[]};var _0x242601=_[_0x81ff('0x2c')](db['Campaign'][_0x81ff('0x2d')],function(_0x2f70f6){return{'name':_0x2f70f6['fieldName'],'type':_0x2f70f6['type'][_0x81ff('0x2e')]};});_0x3f3b5b[_0x81ff('0x2f')]=_[_0x81ff('0x2c')](_0x242601,'name');_0x3f3b5b[_0x81ff('0x30')]=_['keys'](_0x18da8f[_0x81ff('0x30')]);_0x3f3b5b[_0x81ff('0x31')]=_[_0x81ff('0x32')](_0x3f3b5b[_0x81ff('0x2f')],_0x3f3b5b[_0x81ff('0x30')]);_0x19a27a[_0x81ff('0x33')]=_[_0x81ff('0x32')](_0x3f3b5b[_0x81ff('0x2f')],qs[_0x81ff('0x34')](_0x18da8f[_0x81ff('0x30')][_0x81ff('0x34')]));_0x19a27a[_0x81ff('0x33')]=_0x19a27a[_0x81ff('0x33')][_0x81ff('0x35')]?_0x19a27a[_0x81ff('0x33')]:_0x3f3b5b['model'];if(!_0x18da8f[_0x81ff('0x30')][_0x81ff('0x36')]('nolimit')){_0x19a27a['limit']=qs[_0x81ff('0x1e')](_0x18da8f[_0x81ff('0x30')]['limit']);_0x19a27a['offset']=qs[_0x81ff('0x1c')](_0x18da8f[_0x81ff('0x30')][_0x81ff('0x1c')]);}_0x19a27a[_0x81ff('0x37')]=qs[_0x81ff('0x38')](_0x18da8f[_0x81ff('0x30')][_0x81ff('0x38')]);_0x19a27a[_0x81ff('0x39')]=qs[_0x81ff('0x31')](_[_0x81ff('0x3a')](_0x18da8f[_0x81ff('0x30')],_0x3f3b5b[_0x81ff('0x31')]),_0x242601);if(_0x18da8f[_0x81ff('0x30')][_0x81ff('0x3b')]){_0x19a27a[_0x81ff('0x39')]=_[_0x81ff('0x3c')](_0x19a27a[_0x81ff('0x39')],{'$or':_['map'](_0x242601,function(_0x469600){if(_0x469600[_0x81ff('0x3d')]!==_0x81ff('0x3e')){var _0xac7933={};_0xac7933[_0x469600[_0x81ff('0x2a')]]={'$like':'%'+_0x18da8f['query'][_0x81ff('0x3b')]+'%'};return _0xac7933;}})});}_0x19a27a=_[_0x81ff('0x3c')]({},_0x19a27a,_0x18da8f[_0x81ff('0x3f')]);var _0x4e0a80={'where':_0x19a27a['where']};return db[_0x81ff('0x40')][_0x81ff('0x1f')](_0x4e0a80)['then'](function(_0x5a389e){_0x3b4759[_0x81ff('0x1f')]=_0x5a389e;if(_0x18da8f['query'][_0x81ff('0x41')]){_0x19a27a[_0x81ff('0x42')]=[{'all':!![]}];}return db[_0x81ff('0x40')][_0x81ff('0x43')](_0x19a27a);})[_0x81ff('0x28')](function(_0x419fed){_0x3b4759[_0x81ff('0x44')]=_0x419fed;return _0x3b4759;})[_0x81ff('0x28')](respondWithFilteredResult(_0x13f6e0,_0x19a27a))[_0x81ff('0x45')](handleError(_0x13f6e0,null));};exports[_0x81ff('0x46')]=function(_0x30b03a,_0x11f1d3){var _0xc358b1={'raw':![],'where':{'id':_0x30b03a[_0x81ff('0x47')]['id']}},_0xc97eec={};_0xc97eec[_0x81ff('0x2f')]=_['keys'](db[_0x81ff('0x40')]['rawAttributes']);_0xc97eec['query']=_[_0x81ff('0x48')](_0x30b03a[_0x81ff('0x30')]);_0xc97eec[_0x81ff('0x31')]=_['intersection'](_0xc97eec['model'],_0xc97eec['query']);_0xc358b1[_0x81ff('0x33')]=_[_0x81ff('0x32')](_0xc97eec[_0x81ff('0x2f')],qs[_0x81ff('0x34')](_0x30b03a['query'][_0x81ff('0x34')]));_0xc358b1[_0x81ff('0x33')]=_0xc358b1[_0x81ff('0x33')][_0x81ff('0x35')]?_0xc358b1[_0x81ff('0x33')]:_0xc97eec[_0x81ff('0x2f')];if(_0x30b03a[_0x81ff('0x30')]['includeAll']){_0xc358b1[_0x81ff('0x42')]=[{'all':!![]}];}_0xc358b1=_[_0x81ff('0x3c')]({},_0xc358b1,_0x30b03a[_0x81ff('0x3f')]);return db[_0x81ff('0x40')][_0x81ff('0x49')](_0xc358b1)[_0x81ff('0x28')](handleEntityNotFound(_0x11f1d3,null))[_0x81ff('0x28')](respondWithResult(_0x11f1d3,null))['catch'](handleError(_0x11f1d3,null));};exports[_0x81ff('0x4a')]=function(_0x598fdf,_0x55b8b6){return db[_0x81ff('0x40')][_0x81ff('0x4a')](_0x598fdf[_0x81ff('0x4b')],{})[_0x81ff('0x28')](function(_0x40b78e){var _0x587b58=_0x598fdf[_0x81ff('0x4c')][_0x81ff('0x26')]({'plain':!![]});if(!_0x587b58)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x587b58[_0x81ff('0x4d')]==='user'){var _0x1f3c53=_0x40b78e[_0x81ff('0x26')]({'plain':!![]});var _0x3d12f6='IvrCampaigns';return db[_0x81ff('0x4e')][_0x81ff('0x49')]({'where':{'name':_0x3d12f6,'userProfileId':_0x587b58[_0x81ff('0x4f')]},'raw':!![]})['then'](function(_0x336062){if(_0x336062&&_0x336062[_0x81ff('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x1f3c53[_0x81ff('0x2a')],'resourceId':_0x1f3c53['id'],'type':_0x336062[_0x81ff('0x2a')],'sectionId':_0x336062['id']},{})[_0x81ff('0x28')](function(){return _0x40b78e;});}else{return _0x40b78e;}})['catch'](function(_0x42c534){logger[_0x81ff('0x51')](_0x81ff('0x52'),_0x42c534);throw _0x42c534;});}return _0x40b78e;})['then'](respondWithResult(_0x55b8b6,0xc9))[_0x81ff('0x45')](handleError(_0x55b8b6,null));};exports[_0x81ff('0x53')]=function(_0x216a06,_0x40d477){var _0x2bc1cb={'where':{'id':_0x216a06[_0x81ff('0x47')]['id']}},_0x43e9d5={};_0x43e9d5['model']=_['keys'](db[_0x81ff('0x40')]['rawAttributes']);_0x2bc1cb[_0x81ff('0x33')]=_[_0x81ff('0x32')](_0x43e9d5['model'],qs[_0x81ff('0x34')](_0x216a06['query'][_0x81ff('0x34')]));_0x2bc1cb[_0x81ff('0x33')]=_0x2bc1cb[_0x81ff('0x33')][_0x81ff('0x35')]?_0x2bc1cb[_0x81ff('0x33')]:_0x43e9d5[_0x81ff('0x2f')];if(_0x216a06[_0x81ff('0x30')][_0x81ff('0x41')]){_0x2bc1cb['include']=[{'all':!![]}];}_0x2bc1cb=_[_0x81ff('0x3c')]({},_0x2bc1cb,_0x216a06['options']);return db[_0x81ff('0x40')][_0x81ff('0x49')](_0x2bc1cb)[_0x81ff('0x28')](handleEntityNotFound(_0x40d477,null))[_0x81ff('0x28')](function(_0xcde352){if(_0xcde352){var _0x4c2efa=_0xcde352[_0x81ff('0x26')]({'plain':!![]});_0x4c2efa=qs[_0x81ff('0x54')](_0x4c2efa,['id',_0x81ff('0x55'),_0x81ff('0x56')]);_0x216a06[_0x81ff('0x4b')]=_[_0x81ff('0x54')](_0x216a06[_0x81ff('0x4b')],['id',_0x81ff('0x55'),_0x81ff('0x56')]);return db[_0x81ff('0x40')][_0x81ff('0x4a')](_[_0x81ff('0x3c')](_0x4c2efa,_0x216a06[_0x81ff('0x4b')]),{'include':_0x216a06[_0x81ff('0x30')][_0x81ff('0x41')]?[{'all':!![]}]:undefined})[_0x81ff('0x28')](function(_0x28a01d){var _0x2162a6=_0x216a06['user'][_0x81ff('0x26')]({'plain':!![]});if(!_0x2162a6)throw new Error(_0x81ff('0x57'));if(_0x2162a6[_0x81ff('0x4d')]===_0x81ff('0x4c')){var _0x5278cb=_0x28a01d[_0x81ff('0x26')]({'plain':!![]});var _0x2eb6c1=_0x81ff('0x27');return db['UserProfileSection'][_0x81ff('0x49')]({'where':{'name':_0x2eb6c1,'userProfileId':_0x2162a6[_0x81ff('0x4f')]},'raw':!![]})[_0x81ff('0x28')](function(_0x5f18ef){if(_0x5f18ef&&_0x5f18ef['autoAssociation']===0x0){return db[_0x81ff('0x58')]['create']({'name':_0x5278cb['name'],'resourceId':_0x5278cb['id'],'type':_0x5f18ef[_0x81ff('0x2a')],'sectionId':_0x5f18ef['id']},{})['then'](function(){return _0x28a01d;});}else{return _0x28a01d;}})[_0x81ff('0x45')](function(_0x5640ab){logger['error'](_0x81ff('0x52'),_0x5640ab);throw _0x5640ab;});}return _0x28a01d;});}})[_0x81ff('0x28')](respondWithResult(_0x40d477,0xc9))[_0x81ff('0x45')](handleError(_0x40d477,null));};exports['update']=function(_0x3f2537,_0x5e3a7a){if(_0x3f2537[_0x81ff('0x4b')]['id']){delete _0x3f2537[_0x81ff('0x4b')]['id'];}return db[_0x81ff('0x40')]['find']({'where':{'id':_0x3f2537['params']['id']}})[_0x81ff('0x28')](handleEntityNotFound(_0x5e3a7a,null))['then'](saveUpdates(_0x3f2537['body'],null))['then'](respondWithResult(_0x5e3a7a,null))[_0x81ff('0x45')](handleError(_0x5e3a7a,null));};exports[_0x81ff('0x25')]=function(_0xb1d91c,_0xe26791){return db['Campaign']['find']({'where':{'id':_0xb1d91c[_0x81ff('0x47')]['id']}})['then'](handleEntityNotFound(_0xe26791,null))['then'](removeEntity(_0xe26791,null))[_0x81ff('0x45')](handleError(_0xe26791,null));};exports['getHoppers']=function(_0x3f6188,_0x154993,_0x1af581){var _0x116f01={'raw':!![],'where':{}};var _0x1f1a73={};var _0x17e477={'count':0x0,'rows':[]};return db[_0x81ff('0x40')][_0x81ff('0x59')]({'where':{'id':_0x3f6188['params']['id']}})[_0x81ff('0x28')](handleEntityNotFound(_0x154993,null))[_0x81ff('0x28')](function(_0x372c53){if(_0x372c53){_0x1f1a73[_0x81ff('0x2f')]=_[_0x81ff('0x48')](db[_0x81ff('0x5a')][_0x81ff('0x2d')]);_0x1f1a73[_0x81ff('0x30')]=_[_0x81ff('0x48')](_0x3f6188[_0x81ff('0x30')]);_0x1f1a73[_0x81ff('0x31')]=_[_0x81ff('0x32')](_0x1f1a73['model'],_0x1f1a73[_0x81ff('0x30')]);_0x116f01[_0x81ff('0x33')]=_['intersection'](_0x1f1a73['model'],qs['fields'](_0x3f6188[_0x81ff('0x30')]['fields']));_0x116f01[_0x81ff('0x33')]=_0x116f01[_0x81ff('0x33')]['length']?_0x116f01['attributes']:_0x1f1a73[_0x81ff('0x2f')];if(!_0x3f6188[_0x81ff('0x30')][_0x81ff('0x36')](_0x81ff('0x5b'))){_0x116f01[_0x81ff('0x1e')]=qs[_0x81ff('0x1e')](_0x3f6188[_0x81ff('0x30')]['limit']);_0x116f01[_0x81ff('0x1c')]=qs[_0x81ff('0x1c')](_0x3f6188[_0x81ff('0x30')][_0x81ff('0x1c')]);}_0x116f01[_0x81ff('0x37')]=qs[_0x81ff('0x38')](_0x3f6188[_0x81ff('0x30')][_0x81ff('0x38')]);_0x116f01[_0x81ff('0x39')]=qs['filters'](_[_0x81ff('0x3a')](_0x3f6188['query'],_0x1f1a73[_0x81ff('0x31')]));_0x116f01[_0x81ff('0x39')]['CampaignId']=_0x372c53['id'];if(_0x3f6188[_0x81ff('0x30')]['filter']){_0x116f01[_0x81ff('0x39')]=_['merge'](_0x116f01[_0x81ff('0x39')],{'$or':_[_0x81ff('0x2c')](_0x116f01[_0x81ff('0x33')],function(_0x2bb14b){var _0x30a5b2={};_0x30a5b2[_0x2bb14b]={'$like':'%'+_0x3f6188[_0x81ff('0x30')][_0x81ff('0x3b')]+'%'};return _0x30a5b2;})});}_0x116f01=_[_0x81ff('0x3c')]({},_0x116f01,_0x3f6188[_0x81ff('0x3f')]);return db['CmHopper'][_0x81ff('0x1f')]({'where':_0x116f01[_0x81ff('0x39')]})['then'](function(_0x4ff438){_0x17e477[_0x81ff('0x1f')]=_0x4ff438;if(_0x3f6188[_0x81ff('0x30')][_0x81ff('0x41')]){_0x116f01['include']=[{'all':!![]}];}return db[_0x81ff('0x5a')][_0x81ff('0x43')](_0x116f01);})[_0x81ff('0x28')](function(_0x476fbb){_0x17e477[_0x81ff('0x44')]=_0x476fbb;return _0x17e477;});}})[_0x81ff('0x28')](respondWithFilteredResult(_0x154993,_0x116f01))['catch'](handleError(_0x154993,null));};exports['getHopperHistories']=function(_0x29fb69,_0x3233eb,_0x2db057){var _0xb47fcf={'raw':!![],'where':{}};var _0xe5d091={};var _0x2dacc0={'count':0x0,'rows':[]};return db['Campaign'][_0x81ff('0x59')]({'where':{'id':_0x29fb69['params']['id']}})[_0x81ff('0x28')](handleEntityNotFound(_0x3233eb,null))[_0x81ff('0x28')](function(_0xa4d0fe){if(_0xa4d0fe){_0xe5d091[_0x81ff('0x2f')]=_['keys'](db[_0x81ff('0x5c')][_0x81ff('0x2d')]);_0xe5d091[_0x81ff('0x30')]=_['keys'](_0x29fb69[_0x81ff('0x30')]);_0xe5d091['filters']=_['intersection'](_0xe5d091['model'],_0xe5d091['query']);_0xb47fcf['attributes']=_['intersection'](_0xe5d091[_0x81ff('0x2f')],qs[_0x81ff('0x34')](_0x29fb69[_0x81ff('0x30')][_0x81ff('0x34')]));_0xb47fcf[_0x81ff('0x33')]=_0xb47fcf[_0x81ff('0x33')][_0x81ff('0x35')]?_0xb47fcf[_0x81ff('0x33')]:_0xe5d091[_0x81ff('0x2f')];if(!_0x29fb69[_0x81ff('0x30')][_0x81ff('0x36')](_0x81ff('0x5b'))){_0xb47fcf[_0x81ff('0x1e')]=qs[_0x81ff('0x1e')](_0x29fb69[_0x81ff('0x30')]['limit']);_0xb47fcf[_0x81ff('0x1c')]=qs[_0x81ff('0x1c')](_0x29fb69[_0x81ff('0x30')][_0x81ff('0x1c')]);}_0xb47fcf['order']=qs[_0x81ff('0x38')](_0x29fb69[_0x81ff('0x30')][_0x81ff('0x38')]);_0xb47fcf[_0x81ff('0x39')]=qs[_0x81ff('0x31')](_[_0x81ff('0x3a')](_0x29fb69[_0x81ff('0x30')],_0xe5d091[_0x81ff('0x31')]));_0xb47fcf[_0x81ff('0x39')][_0x81ff('0x5d')]=_0xa4d0fe['id'];if(_0x29fb69[_0x81ff('0x30')]['filter']){_0xb47fcf[_0x81ff('0x39')]=_['merge'](_0xb47fcf[_0x81ff('0x39')],{'$or':_[_0x81ff('0x2c')](_0xb47fcf[_0x81ff('0x33')],function(_0xeabd7){var _0x3d060d={};_0x3d060d[_0xeabd7]={'$like':'%'+_0x29fb69[_0x81ff('0x30')][_0x81ff('0x3b')]+'%'};return _0x3d060d;})});}_0xb47fcf=_['merge']({},_0xb47fcf,_0x29fb69[_0x81ff('0x3f')]);return db[_0x81ff('0x5c')][_0x81ff('0x1f')]({'where':_0xb47fcf[_0x81ff('0x39')]})[_0x81ff('0x28')](function(_0x24b915){_0x2dacc0[_0x81ff('0x1f')]=_0x24b915;if(_0x29fb69[_0x81ff('0x30')][_0x81ff('0x41')]){_0xb47fcf[_0x81ff('0x42')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0xb47fcf);})[_0x81ff('0x28')](function(_0x43def8){_0x2dacc0[_0x81ff('0x44')]=_0x43def8;return _0x2dacc0;});}})['then'](respondWithFilteredResult(_0x3233eb,_0xb47fcf))[_0x81ff('0x45')](handleError(_0x3233eb,null));};exports[_0x81ff('0x5e')]=function(_0x53cd81,_0x48bdda,_0x4da769){var _0x3532a8={'raw':!![],'where':{}};var _0x51f5cf={};var _0x26adcb={'count':0x0,'rows':[]};return db['Campaign'][_0x81ff('0x59')]({'where':{'id':_0x53cd81['params']['id']}})[_0x81ff('0x28')](handleEntityNotFound(_0x48bdda,null))[_0x81ff('0x28')](function(_0x5b0e0b){if(_0x5b0e0b){_0x51f5cf[_0x81ff('0x2f')]=_['keys'](db['CmHopperFinal'][_0x81ff('0x2d')]);_0x51f5cf[_0x81ff('0x30')]=_[_0x81ff('0x48')](_0x53cd81[_0x81ff('0x30')]);_0x51f5cf[_0x81ff('0x31')]=_['intersection'](_0x51f5cf['model'],_0x51f5cf[_0x81ff('0x30')]);_0x3532a8[_0x81ff('0x33')]=_[_0x81ff('0x32')](_0x51f5cf[_0x81ff('0x2f')],qs['fields'](_0x53cd81['query'][_0x81ff('0x34')]));_0x3532a8[_0x81ff('0x33')]=_0x3532a8['attributes'][_0x81ff('0x35')]?_0x3532a8[_0x81ff('0x33')]:_0x51f5cf[_0x81ff('0x2f')];if(!_0x53cd81[_0x81ff('0x30')][_0x81ff('0x36')](_0x81ff('0x5b'))){_0x3532a8[_0x81ff('0x1e')]=qs[_0x81ff('0x1e')](_0x53cd81[_0x81ff('0x30')][_0x81ff('0x1e')]);_0x3532a8['offset']=qs[_0x81ff('0x1c')](_0x53cd81['query'][_0x81ff('0x1c')]);}_0x3532a8[_0x81ff('0x37')]=qs[_0x81ff('0x38')](_0x53cd81['query'][_0x81ff('0x38')]);_0x3532a8['where']=qs[_0x81ff('0x31')](_[_0x81ff('0x3a')](_0x53cd81['query'],_0x51f5cf[_0x81ff('0x31')]));_0x3532a8[_0x81ff('0x39')]['CampaignId']=_0x5b0e0b['id'];if(_0x53cd81['query'][_0x81ff('0x3b')]){_0x3532a8[_0x81ff('0x39')]=_[_0x81ff('0x3c')](_0x3532a8[_0x81ff('0x39')],{'$or':_[_0x81ff('0x2c')](_0x3532a8['attributes'],function(_0x157e9a){var _0x571004={};_0x571004[_0x157e9a]={'$like':'%'+_0x53cd81[_0x81ff('0x30')][_0x81ff('0x3b')]+'%'};return _0x571004;})});}_0x3532a8=_['merge']({},_0x3532a8,_0x53cd81[_0x81ff('0x3f')]);return db[_0x81ff('0x5f')]['count']({'where':_0x3532a8[_0x81ff('0x39')]})[_0x81ff('0x28')](function(_0x21518d){_0x26adcb[_0x81ff('0x1f')]=_0x21518d;if(_0x53cd81[_0x81ff('0x30')][_0x81ff('0x41')]){_0x3532a8[_0x81ff('0x42')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x81ff('0x43')](_0x3532a8);})[_0x81ff('0x28')](function(_0x5101c2){_0x26adcb[_0x81ff('0x44')]=_0x5101c2;return _0x26adcb;});}})['then'](respondWithFilteredResult(_0x48bdda,_0x3532a8))['catch'](handleError(_0x48bdda,null));};exports[_0x81ff('0x60')]=function(_0x565bb4,_0x33edac,_0x452260){var _0x5a4e69={'raw':!![],'where':{}};var _0x31fa1d={};var _0xcc7f3d={'count':0x0,'rows':[]};return db[_0x81ff('0x40')]['findOne']({'where':{'id':_0x565bb4[_0x81ff('0x47')]['id']}})['then'](handleEntityNotFound(_0x33edac,null))[_0x81ff('0x28')](function(_0xc68b65){if(_0xc68b65){_0x31fa1d[_0x81ff('0x2f')]=_[_0x81ff('0x48')](db['CmHopperBlack']['rawAttributes']);_0x31fa1d[_0x81ff('0x30')]=_[_0x81ff('0x48')](_0x565bb4[_0x81ff('0x30')]);_0x31fa1d[_0x81ff('0x31')]=_[_0x81ff('0x32')](_0x31fa1d[_0x81ff('0x2f')],_0x31fa1d[_0x81ff('0x30')]);_0x5a4e69[_0x81ff('0x33')]=_['intersection'](_0x31fa1d['model'],qs[_0x81ff('0x34')](_0x565bb4[_0x81ff('0x30')][_0x81ff('0x34')]));_0x5a4e69[_0x81ff('0x33')]=_0x5a4e69[_0x81ff('0x33')][_0x81ff('0x35')]?_0x5a4e69[_0x81ff('0x33')]:_0x31fa1d[_0x81ff('0x2f')];if(!_0x565bb4['query'][_0x81ff('0x36')](_0x81ff('0x5b'))){_0x5a4e69[_0x81ff('0x1e')]=qs['limit'](_0x565bb4[_0x81ff('0x30')]['limit']);_0x5a4e69['offset']=qs['offset'](_0x565bb4['query'][_0x81ff('0x1c')]);}_0x5a4e69[_0x81ff('0x37')]=qs[_0x81ff('0x38')](_0x565bb4[_0x81ff('0x30')][_0x81ff('0x38')]);_0x5a4e69[_0x81ff('0x39')]=qs['filters'](_[_0x81ff('0x3a')](_0x565bb4[_0x81ff('0x30')],_0x31fa1d['filters']));_0x5a4e69['where'][_0x81ff('0x5d')]=_0xc68b65['id'];if(_0x565bb4['query'][_0x81ff('0x3b')]){_0x5a4e69[_0x81ff('0x39')]=_[_0x81ff('0x3c')](_0x5a4e69[_0x81ff('0x39')],{'$or':_[_0x81ff('0x2c')](_0x5a4e69[_0x81ff('0x33')],function(_0x4abb98){var _0x331154={};_0x331154[_0x4abb98]={'$like':'%'+_0x565bb4[_0x81ff('0x30')][_0x81ff('0x3b')]+'%'};return _0x331154;})});}_0x5a4e69=_['merge']({},_0x5a4e69,_0x565bb4[_0x81ff('0x3f')]);return db[_0x81ff('0x61')][_0x81ff('0x1f')]({'where':_0x5a4e69['where']})[_0x81ff('0x28')](function(_0x11c6e6){_0xcc7f3d[_0x81ff('0x1f')]=_0x11c6e6;if(_0x565bb4[_0x81ff('0x30')][_0x81ff('0x41')]){_0x5a4e69[_0x81ff('0x42')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x81ff('0x43')](_0x5a4e69);})['then'](function(_0x3425c6){_0xcc7f3d['rows']=_0x3425c6;return _0xcc7f3d;});}})['then'](respondWithFilteredResult(_0x33edac,_0x5a4e69))[_0x81ff('0x45')](handleError(_0x33edac,null));};exports[_0x81ff('0x62')]=function(_0x378ee7,_0x5be860,_0x3f0201){var _0x32f280={};var _0x725863={};var _0x50a992;var _0x281c87;return db[_0x81ff('0x40')]['findOne']({'where':{'id':_0x378ee7[_0x81ff('0x47')]['id']}})[_0x81ff('0x28')](handleEntityNotFound(_0x5be860,null))[_0x81ff('0x28')](function(_0x181147){if(_0x181147){_0x50a992=_0x181147;_0x725863[_0x81ff('0x2f')]=_[_0x81ff('0x48')](db[_0x81ff('0x63')][_0x81ff('0x2d')]);_0x725863[_0x81ff('0x30')]=_[_0x81ff('0x48')](_0x378ee7[_0x81ff('0x30')]);_0x725863['filters']=_[_0x81ff('0x32')](_0x725863[_0x81ff('0x2f')],_0x725863['query']);_0x32f280[_0x81ff('0x33')]=_[_0x81ff('0x32')](_0x725863[_0x81ff('0x2f')],qs['fields'](_0x378ee7['query'][_0x81ff('0x34')]));_0x32f280[_0x81ff('0x33')]=_0x32f280['attributes'][_0x81ff('0x35')]?_0x32f280[_0x81ff('0x33')]:_0x725863[_0x81ff('0x2f')];_0x32f280[_0x81ff('0x37')]=qs[_0x81ff('0x38')](_0x378ee7['query'][_0x81ff('0x38')]);_0x32f280[_0x81ff('0x39')]=qs['filters'](_[_0x81ff('0x3a')](_0x378ee7[_0x81ff('0x30')],_0x725863[_0x81ff('0x31')]));if(_0x378ee7[_0x81ff('0x30')][_0x81ff('0x3b')]){_0x32f280['where']=_[_0x81ff('0x3c')](_0x32f280[_0x81ff('0x39')],{'$or':_[_0x81ff('0x2c')](_0x32f280[_0x81ff('0x33')],function(_0x308a47){var _0x35738d={};_0x35738d[_0x308a47]={'$like':'%'+_0x378ee7[_0x81ff('0x30')][_0x81ff('0x3b')]+'%'};return _0x35738d;})});}_0x32f280=_['merge']({},_0x32f280,_0x378ee7['options']);return _0x50a992[_0x81ff('0x62')](_0x32f280);}})[_0x81ff('0x28')](function(_0x3cb63c){if(_0x3cb63c){_0x281c87=_0x3cb63c[_0x81ff('0x35')];if(!_0x378ee7[_0x81ff('0x30')][_0x81ff('0x36')]('nolimit')){_0x32f280[_0x81ff('0x1e')]=qs[_0x81ff('0x1e')](_0x378ee7['query'][_0x81ff('0x1e')]);_0x32f280[_0x81ff('0x1c')]=qs[_0x81ff('0x1c')](_0x378ee7[_0x81ff('0x30')]['offset']);}return _0x50a992['getLists'](_0x32f280);}})[_0x81ff('0x28')](function(_0x1a6abb){if(_0x1a6abb){return _0x1a6abb?{'count':_0x281c87,'rows':_0x1a6abb}:null;}})['then'](respondWithResult(_0x5be860,null))['catch'](handleError(_0x5be860,null));};exports[_0x81ff('0x64')]=function(_0x67e35c,_0x406a3e,_0x13d2d5){var _0x44777c,_0x2a05ae;return db[_0x81ff('0x40')][_0x81ff('0x49')]({'where':{'id':_0x67e35c['params']['id']}})[_0x81ff('0x28')](handleEntityNotFound(_0x406a3e,null))[_0x81ff('0x28')](function(_0xe8a8ff){if(_0xe8a8ff){_0x2a05ae=_0xe8a8ff;return _0xe8a8ff[_0x81ff('0x64')](_0x67e35c[_0x81ff('0x4b')][_0x81ff('0x65')],_['omit'](_0x67e35c['body'],[_0x81ff('0x65'),'id'])||{});}return null;})[_0x81ff('0x66')](function(_0x4a95e2){var _0x274ba0;_0x44777c=_0x4a95e2||[];var _0x3a22b0=[];if(_0x4a95e2){for(var _0x167ecd=0x0;_0x167ecd<_0x4a95e2[_0x81ff('0x35')];_0x167ecd+=0x1){var _0xd0cbfb=_0x4a95e2[_0x167ecd][_0x81ff('0x26')]({'plain':!![]});_0x2a05ae[_0x81ff('0x67')]=_0x67e35c[_0x81ff('0x4b')][_0x81ff('0x67')]?_0x67e35c[_0x81ff('0x4b')][_0x81ff('0x67')]:_0x2a05ae[_0x81ff('0x67')];switch(_0x2a05ae[_0x81ff('0x67')]){case _0x81ff('0x68'):_0x274ba0=squel['insert']()[_0x81ff('0x69')](_0x81ff('0x6a'))[_0x81ff('0x6b')]([_0x81ff('0x6c'),'scheduledAt',_0x81ff('0x6d'),'ListId','CampaignId',_0x81ff('0x55'),'updatedAt'],squel[_0x81ff('0x6e')]()[_0x81ff('0x6f')](_0x81ff('0x6c'),_0x81ff('0x6c'))[_0x81ff('0x6f')]('NOW()',_0x81ff('0x70'))[_0x81ff('0x6f')]('id',_0x81ff('0x6d'))['field'](_0xd0cbfb[_0x81ff('0x71')][_0x81ff('0x72')](),_0x81ff('0x73'))[_0x81ff('0x6f')](_0x67e35c[_0x81ff('0x47')]['id']['toString'](),'CampaignId')[_0x81ff('0x6f')]('NOW()',_0x81ff('0x55'))['field'](_0x81ff('0x74'),_0x81ff('0x56'))['from']('cm_contacts')[_0x81ff('0x39')](_0x81ff('0x75'))[_0x81ff('0x39')](_0x81ff('0x76'),_0xd0cbfb[_0x81ff('0x71')]['toString']())['where']('phone\x20IS\x20NOT\x20NULL')[_0x81ff('0x39')](_0x81ff('0x77'),squel[_0x81ff('0x6e')]()[_0x81ff('0x6f')](_0x81ff('0x78'))['from'](_0x81ff('0x79'))['where'](_0x81ff('0x7a'),_0x67e35c[_0x81ff('0x47')]['id']['toString']()))[_0x81ff('0x39')](_0x81ff('0x77'),squel[_0x81ff('0x6e')]()[_0x81ff('0x6f')](_0x81ff('0x7b'))[_0x81ff('0x7c')]('cm_hopper')[_0x81ff('0x39')]('CampaignId\x20=\x20?',_0x67e35c[_0x81ff('0x47')]['id'][_0x81ff('0x72')]())))['toString']();break;case _0x81ff('0x7d'):_0x274ba0=squel['insert']()[_0x81ff('0x69')](_0x81ff('0x6a'))['fromQuery']([_0x81ff('0x6c'),_0x81ff('0x70'),'ContactId','ListId',_0x81ff('0x5d'),'createdAt',_0x81ff('0x56')],squel[_0x81ff('0x6e')]()[_0x81ff('0x6f')]('phone',_0x81ff('0x6c'))[_0x81ff('0x6f')](_0x81ff('0x74'),_0x81ff('0x70'))['field']('id',_0x81ff('0x6d'))[_0x81ff('0x6f')](_0xd0cbfb[_0x81ff('0x71')][_0x81ff('0x72')](),'ListId')[_0x81ff('0x6f')](_0x67e35c['params']['id'][_0x81ff('0x72')](),_0x81ff('0x5d'))[_0x81ff('0x6f')](_0x81ff('0x74'),_0x81ff('0x55'))[_0x81ff('0x6f')](_0x81ff('0x74'),_0x81ff('0x56'))[_0x81ff('0x7c')](_0x81ff('0x7e'))[_0x81ff('0x39')](_0x81ff('0x75'))['where']('ListId\x20=\x20?',_0xd0cbfb[_0x81ff('0x71')][_0x81ff('0x72')]())[_0x81ff('0x39')]('phone\x20IS\x20NOT\x20NULL')[_0x81ff('0x39')](_0x81ff('0x77'),squel[_0x81ff('0x6e')]()[_0x81ff('0x6f')](_0x81ff('0x7b'))[_0x81ff('0x7c')]('cm_hopper')[_0x81ff('0x39')](_0x81ff('0x7a'),_0x67e35c[_0x81ff('0x47')]['id'][_0x81ff('0x72')]())))[_0x81ff('0x72')]();break;default:_0x274ba0=squel[_0x81ff('0x7f')]()['into'](_0x81ff('0x6a'))['fromQuery']([_0x81ff('0x6c'),_0x81ff('0x70'),'ContactId',_0x81ff('0x73'),'CampaignId','createdAt',_0x81ff('0x56')],squel['select']()['field'](_0x81ff('0x6c'),'phone')[_0x81ff('0x6f')]('NOW()','scheduledAt')[_0x81ff('0x6f')]('id',_0x81ff('0x6d'))[_0x81ff('0x6f')](_0xd0cbfb[_0x81ff('0x71')][_0x81ff('0x72')](),_0x81ff('0x73'))[_0x81ff('0x6f')](_0x67e35c[_0x81ff('0x47')]['id'][_0x81ff('0x72')](),'CampaignId')[_0x81ff('0x6f')](_0x81ff('0x74'),_0x81ff('0x55'))[_0x81ff('0x6f')]('NOW()',_0x81ff('0x56'))['from'](_0x81ff('0x7e'))['where']('deletedAt\x20IS\x20NULL')[_0x81ff('0x39')](_0x81ff('0x76'),_0xd0cbfb[_0x81ff('0x71')]['toString']())['where'](_0x81ff('0x80')))[_0x81ff('0x72')]();}_0x3a22b0[_0x81ff('0x81')](db[_0x81ff('0x82')][_0x81ff('0x30')](_0x274ba0));}return BPromise[_0x81ff('0x83')](_0x3a22b0);}})[_0x81ff('0x28')](function(){return _0x44777c;})['then'](respondWithResult(_0x406a3e,null))[_0x81ff('0x45')](handleError(_0x406a3e,null));};exports['removeLists']=function(_0x4d1592,_0x3e13f2,_0x413f40){return db[_0x81ff('0x40')][_0x81ff('0x49')]({'where':{'id':_0x4d1592[_0x81ff('0x47')]['id']}})[_0x81ff('0x28')](handleEntityNotFound(_0x3e13f2,null))[_0x81ff('0x28')](function(_0x454dce){if(_0x454dce){return _0x454dce[_0x81ff('0x84')](_0x4d1592[_0x81ff('0x30')][_0x81ff('0x65')]);}})[_0x81ff('0x28')](function(_0x1afcf2){if(_0x1afcf2){return db[_0x81ff('0x5a')][_0x81ff('0x25')]({'where':{'ListId':_0x4d1592['query']['ids'],'CampaignId':_0x4d1592[_0x81ff('0x47')]['id']}})[_0x81ff('0x28')](function(){return _0x1afcf2;});}})['then'](respondWithStatusCode(_0x3e13f2,null))['catch'](handleError(_0x3e13f2,null));};exports[_0x81ff('0x85')]=function(_0x1be4aa,_0x72af27,_0x5978ce){var _0x1e9b90={};var _0x48490a={};var _0x118168;var _0xa59037;return db[_0x81ff('0x40')]['findOne']({'where':{'id':_0x1be4aa[_0x81ff('0x47')]['id']}})['then'](handleEntityNotFound(_0x72af27,null))['then'](function(_0x49846d){if(_0x49846d){_0x118168=_0x49846d;_0x48490a[_0x81ff('0x2f')]=_[_0x81ff('0x48')](db[_0x81ff('0x63')]['rawAttributes']);_0x48490a[_0x81ff('0x30')]=_[_0x81ff('0x48')](_0x1be4aa[_0x81ff('0x30')]);_0x48490a[_0x81ff('0x31')]=_[_0x81ff('0x32')](_0x48490a[_0x81ff('0x2f')],_0x48490a['query']);_0x1e9b90[_0x81ff('0x33')]=_[_0x81ff('0x32')](_0x48490a[_0x81ff('0x2f')],qs[_0x81ff('0x34')](_0x1be4aa[_0x81ff('0x30')][_0x81ff('0x34')]));_0x1e9b90[_0x81ff('0x33')]=_0x1e9b90[_0x81ff('0x33')][_0x81ff('0x35')]?_0x1e9b90[_0x81ff('0x33')]:_0x48490a[_0x81ff('0x2f')];_0x1e9b90['order']=qs[_0x81ff('0x38')](_0x1be4aa[_0x81ff('0x30')][_0x81ff('0x38')]);_0x1e9b90[_0x81ff('0x39')]=qs[_0x81ff('0x31')](_[_0x81ff('0x3a')](_0x1be4aa['query'],_0x48490a[_0x81ff('0x31')]));if(_0x1be4aa[_0x81ff('0x30')][_0x81ff('0x3b')]){_0x1e9b90[_0x81ff('0x39')]=_[_0x81ff('0x3c')](_0x1e9b90[_0x81ff('0x39')],{'$or':_[_0x81ff('0x2c')](_0x1e9b90[_0x81ff('0x33')],function(_0xf82452){var _0x2640ef={};_0x2640ef[_0xf82452]={'$like':'%'+_0x1be4aa[_0x81ff('0x30')][_0x81ff('0x3b')]+'%'};return _0x2640ef;})});}_0x1e9b90=_[_0x81ff('0x3c')]({},_0x1e9b90,_0x1be4aa['options']);return _0x118168[_0x81ff('0x85')](_0x1e9b90);}})['then'](function(_0x12e5ab){if(_0x12e5ab){_0xa59037=_0x12e5ab[_0x81ff('0x35')];if(!_0x1be4aa[_0x81ff('0x30')][_0x81ff('0x36')](_0x81ff('0x5b'))){_0x1e9b90[_0x81ff('0x1e')]=qs[_0x81ff('0x1e')](_0x1be4aa[_0x81ff('0x30')][_0x81ff('0x1e')]);_0x1e9b90[_0x81ff('0x1c')]=qs['offset'](_0x1be4aa[_0x81ff('0x30')][_0x81ff('0x1c')]);}return _0x118168[_0x81ff('0x85')](_0x1e9b90);}})['then'](function(_0x272adf){if(_0x272adf){return _0x272adf?{'count':_0xa59037,'rows':_0x272adf}:null;}})[_0x81ff('0x28')](respondWithResult(_0x72af27,null))[_0x81ff('0x45')](handleError(_0x72af27,null));};exports[_0x81ff('0x86')]=function(_0x568a56,_0x535b22,_0x4c457d){var _0x5b0ae5,_0x4a4a72;return db['Campaign'][_0x81ff('0x49')]({'where':{'id':_0x568a56[_0x81ff('0x47')]['id']}})['then'](handleEntityNotFound(_0x535b22,null))[_0x81ff('0x28')](function(_0x48d0a6){if(_0x48d0a6){_0x4a4a72=_0x48d0a6;return _0x48d0a6['addBlackLists'](_0x568a56[_0x81ff('0x4b')][_0x81ff('0x65')],_[_0x81ff('0x54')](_0x568a56[_0x81ff('0x4b')],['ids','id'])||{});}return null;})[_0x81ff('0x66')](function(_0x133406){var _0x447b5f;_0x5b0ae5=_0x133406||[];var _0x130cbd=[];if(_0x133406){for(var _0x311345=0x0;_0x311345<_0x133406[_0x81ff('0x35')];_0x311345+=0x1){var _0x21d154=_0x133406[_0x311345][_0x81ff('0x26')]({'plain':!![]});_0x447b5f=squel[_0x81ff('0x7f')]()['into']('cm_hopper_black')[_0x81ff('0x6b')]([_0x81ff('0x6c'),_0x81ff('0x6d'),_0x81ff('0x73'),'CampaignId',_0x81ff('0x55'),_0x81ff('0x56')],squel[_0x81ff('0x6e')]()[_0x81ff('0x6f')](_0x81ff('0x6c'),_0x81ff('0x6c'))[_0x81ff('0x6f')]('id',_0x81ff('0x6d'))[_0x81ff('0x6f')](_0x21d154[_0x81ff('0x71')][_0x81ff('0x72')](),_0x81ff('0x73'))[_0x81ff('0x6f')](_0x568a56[_0x81ff('0x47')]['id'][_0x81ff('0x72')](),'CampaignId')['field'](_0x81ff('0x74'),_0x81ff('0x55'))[_0x81ff('0x6f')](_0x81ff('0x74'),_0x81ff('0x56'))[_0x81ff('0x7c')](_0x81ff('0x7e'))['where'](_0x81ff('0x75'))[_0x81ff('0x39')](_0x81ff('0x76'),_0x21d154[_0x81ff('0x71')][_0x81ff('0x72')]())[_0x81ff('0x39')](_0x81ff('0x80')))['toString']();_0x130cbd[_0x81ff('0x81')](db[_0x81ff('0x82')][_0x81ff('0x30')](_0x447b5f));}return BPromise['all'](_0x130cbd);}})['then'](function(){return _0x5b0ae5;})[_0x81ff('0x28')](respondWithResult(_0x535b22,null))[_0x81ff('0x45')](handleError(_0x535b22,null));};exports[_0x81ff('0x87')]=function(_0x59df34,_0x60a55a,_0x33ddf9){return db[_0x81ff('0x40')][_0x81ff('0x49')]({'where':{'id':_0x59df34['params']['id']}})[_0x81ff('0x28')](handleEntityNotFound(_0x60a55a,null))[_0x81ff('0x28')](function(_0x3647cd){if(_0x3647cd){return _0x3647cd['removeBlackLists'](_0x59df34['query']['ids']);}})[_0x81ff('0x28')](function(_0x9b562){if(_0x9b562){return db['CmHopperBlack'][_0x81ff('0x25')]({'where':{'ListId':_0x59df34[_0x81ff('0x30')][_0x81ff('0x65')],'CampaignId':_0x59df34[_0x81ff('0x47')]['id']}})['then'](function(){return _0x9b562;});}})[_0x81ff('0x28')](respondWithStatusCode(_0x60a55a,null))[_0x81ff('0x45')](handleError(_0x60a55a,null));}; \ No newline at end of file +var _0xd8d0=['userProfileId','getHoppers','findOne','CmHopper','CampaignId','rows','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','ContactId','ListId','select','scheduledAt','field','CmListId','toString','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','sequelize','all','removeLists','getBlackLists','cm_hopper_black','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','get','UserProfileResource','destroy','end','name','send','index','map','Campaign','fieldName','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','include','findAll','catch','show','params','keys','includeAll','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','IvrCampaigns','UserProfileSection','find','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rawAttributes','omit','createdAt','updatedAt','role'];(function(_0xa9671b,_0x11378d){var _0x205591=function(_0x5dc88d){while(--_0x5dc88d){_0xa9671b['push'](_0xa9671b['shift']());}};_0x205591(++_0x11378d);}(_0xd8d0,0x1c0));var _0x0d8d=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0xd8d0[_0x403c20];return _0x2b271a;};'use strict';var emlformat=require(_0x0d8d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0d8d('0x1'));var jsonpatch=require(_0x0d8d('0x2'));var rp=require(_0x0d8d('0x3'));var moment=require(_0x0d8d('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0d8d('0x5'));var path=require(_0x0d8d('0x6'));var sox=require('sox');var csv=require(_0x0d8d('0x7'));var ejs=require(_0x0d8d('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0d8d('0x9'));var squel=require(_0x0d8d('0xa'));var crypto=require('crypto');var jsforce=require(_0x0d8d('0xb'));var deskjs=require(_0x0d8d('0xc'));var toCsv=require('to-csv');var querystring=require(_0x0d8d('0xd'));var Papa=require(_0x0d8d('0xe'));var Redis=require(_0x0d8d('0xf'));var authService=require(_0x0d8d('0x10'));var qs=require(_0x0d8d('0x11'));var as=require(_0x0d8d('0x12'));var hardwareService=require(_0x0d8d('0x13'));var logger=require(_0x0d8d('0x14'))(_0x0d8d('0x15'));var utils=require(_0x0d8d('0x16'));var config=require(_0x0d8d('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x25973a,_0x11864a){_0x11864a=_0x11864a||0xcc;return function(_0x4d53b3){if(_0x4d53b3){return _0x25973a[_0x0d8d('0x18')](_0x11864a);}return _0x25973a[_0x0d8d('0x19')](_0x11864a)['end']();};}function respondWithResult(_0x4e6be5,_0x3f8e82){_0x3f8e82=_0x3f8e82||0xc8;return function(_0x4a1502){if(_0x4a1502){return _0x4e6be5['status'](_0x3f8e82)['json'](_0x4a1502);}};}function respondWithFilteredResult(_0x56c18b,_0x20d7c2){return function(_0x405f36){if(_0x405f36){var _0x2ae99d=typeof _0x20d7c2[_0x0d8d('0x1a')]===_0x0d8d('0x1b')&&typeof _0x20d7c2[_0x0d8d('0x1c')]==='undefined';var _0x56d582=_0x405f36[_0x0d8d('0x1d')];var _0x3a74e6=_0x2ae99d?0x0:_0x20d7c2[_0x0d8d('0x1a')];var _0x56c07e=_0x2ae99d?_0x405f36['count']:_0x20d7c2[_0x0d8d('0x1a')]+_0x20d7c2[_0x0d8d('0x1c')];var _0x106c7e;if(_0x56c07e>=_0x56d582){_0x56c07e=_0x56d582;_0x106c7e=0xc8;}else{_0x106c7e=0xce;}_0x56c18b[_0x0d8d('0x19')](_0x106c7e);return _0x56c18b[_0x0d8d('0x1e')](_0x0d8d('0x1f'),_0x3a74e6+'-'+_0x56c07e+'/'+_0x56d582)[_0x0d8d('0x20')](_0x405f36);}return null;};}function patchUpdates(_0x2379f9){return function(_0x2f6bcc){try{jsonpatch[_0x0d8d('0x21')](_0x2f6bcc,_0x2379f9,!![]);}catch(_0x511cba){return BPromise[_0x0d8d('0x22')](_0x511cba);}return _0x2f6bcc[_0x0d8d('0x23')]();};}function saveUpdates(_0x4106fa,_0x3bcd44){return function(_0x199c84){if(_0x199c84){return _0x199c84[_0x0d8d('0x24')](_0x4106fa)[_0x0d8d('0x25')](function(_0xa28bcb){return _0xa28bcb;});}return null;};}function removeEntity(_0x1940ff,_0x266b4e){return function(_0x47c1d9){if(_0x47c1d9){return _0x47c1d9['destroy']()[_0x0d8d('0x25')](function(){var _0x343e47=_0x47c1d9[_0x0d8d('0x26')]({'plain':!![]});var _0xce2cdd='IvrCampaigns';return db[_0x0d8d('0x27')][_0x0d8d('0x28')]({'where':{'type':_0xce2cdd,'resourceId':_0x343e47['id']}})[_0x0d8d('0x25')](function(){return _0x47c1d9;});})[_0x0d8d('0x25')](function(){_0x1940ff['status'](0xcc)[_0x0d8d('0x29')]();});}};}function handleEntityNotFound(_0x5ea510,_0xf984c4){return function(_0x5d297e){if(!_0x5d297e){_0x5ea510[_0x0d8d('0x18')](0x194);}return _0x5d297e;};}function handleError(_0x5adb10,_0x2febe5){_0x2febe5=_0x2febe5||0x1f4;return function(_0x4610b5){logger['error'](_0x4610b5['stack']);if(_0x4610b5[_0x0d8d('0x2a')]){delete _0x4610b5['name'];}_0x5adb10[_0x0d8d('0x19')](_0x2febe5)[_0x0d8d('0x2b')](_0x4610b5);};}exports[_0x0d8d('0x2c')]=function(_0x52cfb3,_0x5c8b6c){var _0x4413bc={},_0x32ca9a={},_0x3ecaff={'count':0x0,'rows':[]};var _0x87de94=_[_0x0d8d('0x2d')](db[_0x0d8d('0x2e')]['rawAttributes'],function(_0x297435){return{'name':_0x297435[_0x0d8d('0x2f')],'type':_0x297435[_0x0d8d('0x30')]['key']};});_0x32ca9a[_0x0d8d('0x31')]=_[_0x0d8d('0x2d')](_0x87de94,_0x0d8d('0x2a'));_0x32ca9a[_0x0d8d('0x32')]=_['keys'](_0x52cfb3[_0x0d8d('0x32')]);_0x32ca9a[_0x0d8d('0x33')]=_['intersection'](_0x32ca9a[_0x0d8d('0x31')],_0x32ca9a[_0x0d8d('0x32')]);_0x4413bc[_0x0d8d('0x34')]=_[_0x0d8d('0x35')](_0x32ca9a[_0x0d8d('0x31')],qs['fields'](_0x52cfb3['query'][_0x0d8d('0x36')]));_0x4413bc[_0x0d8d('0x34')]=_0x4413bc['attributes'][_0x0d8d('0x37')]?_0x4413bc[_0x0d8d('0x34')]:_0x32ca9a['model'];if(!_0x52cfb3[_0x0d8d('0x32')][_0x0d8d('0x38')](_0x0d8d('0x39'))){_0x4413bc[_0x0d8d('0x1c')]=qs[_0x0d8d('0x1c')](_0x52cfb3[_0x0d8d('0x32')][_0x0d8d('0x1c')]);_0x4413bc[_0x0d8d('0x1a')]=qs['offset'](_0x52cfb3[_0x0d8d('0x32')][_0x0d8d('0x1a')]);}_0x4413bc[_0x0d8d('0x3a')]=qs[_0x0d8d('0x3b')](_0x52cfb3[_0x0d8d('0x32')][_0x0d8d('0x3b')]);_0x4413bc['where']=qs[_0x0d8d('0x33')](_[_0x0d8d('0x3c')](_0x52cfb3['query'],_0x32ca9a[_0x0d8d('0x33')]),_0x87de94);if(_0x52cfb3[_0x0d8d('0x32')][_0x0d8d('0x3d')]){_0x4413bc[_0x0d8d('0x3e')]=_['merge'](_0x4413bc[_0x0d8d('0x3e')],{'$or':_[_0x0d8d('0x2d')](_0x87de94,function(_0x289fc7){if(_0x289fc7[_0x0d8d('0x30')]!==_0x0d8d('0x3f')){var _0x21da3e={};_0x21da3e[_0x289fc7[_0x0d8d('0x2a')]]={'$like':'%'+_0x52cfb3[_0x0d8d('0x32')][_0x0d8d('0x3d')]+'%'};return _0x21da3e;}})});}_0x4413bc=_[_0x0d8d('0x40')]({},_0x4413bc,_0x52cfb3[_0x0d8d('0x41')]);var _0x29a2d7={'where':_0x4413bc[_0x0d8d('0x3e')]};return db[_0x0d8d('0x2e')]['count'](_0x29a2d7)[_0x0d8d('0x25')](function(_0x81152c){_0x3ecaff['count']=_0x81152c;if(_0x52cfb3['query']['includeAll']){_0x4413bc[_0x0d8d('0x42')]=[{'all':!![]}];}return db[_0x0d8d('0x2e')][_0x0d8d('0x43')](_0x4413bc);})[_0x0d8d('0x25')](function(_0x309cb6){_0x3ecaff['rows']=_0x309cb6;return _0x3ecaff;})[_0x0d8d('0x25')](respondWithFilteredResult(_0x5c8b6c,_0x4413bc))[_0x0d8d('0x44')](handleError(_0x5c8b6c,null));};exports[_0x0d8d('0x45')]=function(_0x597404,_0x3b5d27){var _0x47cf5b={'raw':![],'where':{'id':_0x597404[_0x0d8d('0x46')]['id']}},_0x4bbaaa={};_0x4bbaaa[_0x0d8d('0x31')]=_[_0x0d8d('0x47')](db[_0x0d8d('0x2e')]['rawAttributes']);_0x4bbaaa[_0x0d8d('0x32')]=_[_0x0d8d('0x47')](_0x597404['query']);_0x4bbaaa[_0x0d8d('0x33')]=_['intersection'](_0x4bbaaa[_0x0d8d('0x31')],_0x4bbaaa[_0x0d8d('0x32')]);_0x47cf5b[_0x0d8d('0x34')]=_[_0x0d8d('0x35')](_0x4bbaaa[_0x0d8d('0x31')],qs[_0x0d8d('0x36')](_0x597404[_0x0d8d('0x32')][_0x0d8d('0x36')]));_0x47cf5b[_0x0d8d('0x34')]=_0x47cf5b[_0x0d8d('0x34')][_0x0d8d('0x37')]?_0x47cf5b[_0x0d8d('0x34')]:_0x4bbaaa['model'];if(_0x597404['query'][_0x0d8d('0x48')]){_0x47cf5b[_0x0d8d('0x42')]=[{'all':!![]}];}_0x47cf5b=_['merge']({},_0x47cf5b,_0x597404[_0x0d8d('0x41')]);return db[_0x0d8d('0x2e')]['find'](_0x47cf5b)[_0x0d8d('0x25')](handleEntityNotFound(_0x3b5d27,null))['then'](respondWithResult(_0x3b5d27,null))['catch'](handleError(_0x3b5d27,null));};exports[_0x0d8d('0x49')]=function(_0x378ceb,_0x30b125){return db[_0x0d8d('0x2e')][_0x0d8d('0x49')](_0x378ceb[_0x0d8d('0x4a')],{})[_0x0d8d('0x25')](function(_0xa3ccbc){var _0xeef66e=_0x378ceb['user'][_0x0d8d('0x26')]({'plain':!![]});if(!_0xeef66e)throw new Error(_0x0d8d('0x4b'));if(_0xeef66e['role']===_0x0d8d('0x4c')){var _0x4c6fe8=_0xa3ccbc[_0x0d8d('0x26')]({'plain':!![]});var _0x2eeccc=_0x0d8d('0x4d');return db[_0x0d8d('0x4e')][_0x0d8d('0x4f')]({'where':{'name':_0x2eeccc,'userProfileId':_0xeef66e['userProfileId']},'raw':!![]})['then'](function(_0x3e9a46){if(_0x3e9a46&&_0x3e9a46[_0x0d8d('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x4c6fe8[_0x0d8d('0x2a')],'resourceId':_0x4c6fe8['id'],'type':_0x3e9a46[_0x0d8d('0x2a')],'sectionId':_0x3e9a46['id']},{})[_0x0d8d('0x25')](function(){return _0xa3ccbc;});}else{return _0xa3ccbc;}})[_0x0d8d('0x44')](function(_0x5fb565){logger[_0x0d8d('0x51')](_0x0d8d('0x52'),_0x5fb565);throw _0x5fb565;});}return _0xa3ccbc;})[_0x0d8d('0x25')](respondWithResult(_0x30b125,0xc9))[_0x0d8d('0x44')](handleError(_0x30b125,null));};exports['clone']=function(_0x4266a3,_0x2bfada){var _0x1b0ec8={'where':{'id':_0x4266a3[_0x0d8d('0x46')]['id']}},_0x10434c={};_0x10434c[_0x0d8d('0x31')]=_[_0x0d8d('0x47')](db[_0x0d8d('0x2e')][_0x0d8d('0x53')]);_0x1b0ec8[_0x0d8d('0x34')]=_['intersection'](_0x10434c['model'],qs[_0x0d8d('0x36')](_0x4266a3[_0x0d8d('0x32')][_0x0d8d('0x36')]));_0x1b0ec8['attributes']=_0x1b0ec8[_0x0d8d('0x34')]['length']?_0x1b0ec8[_0x0d8d('0x34')]:_0x10434c[_0x0d8d('0x31')];if(_0x4266a3['query'][_0x0d8d('0x48')]){_0x1b0ec8[_0x0d8d('0x42')]=[{'all':!![]}];}_0x1b0ec8=_[_0x0d8d('0x40')]({},_0x1b0ec8,_0x4266a3['options']);return db['Campaign'][_0x0d8d('0x4f')](_0x1b0ec8)[_0x0d8d('0x25')](handleEntityNotFound(_0x2bfada,null))[_0x0d8d('0x25')](function(_0x63d94c){if(_0x63d94c){var _0x2956d4=_0x63d94c[_0x0d8d('0x26')]({'plain':!![]});_0x2956d4=qs[_0x0d8d('0x54')](_0x2956d4,['id',_0x0d8d('0x55'),_0x0d8d('0x56')]);_0x4266a3['body']=_[_0x0d8d('0x54')](_0x4266a3[_0x0d8d('0x4a')],['id',_0x0d8d('0x55'),_0x0d8d('0x56')]);return db['Campaign'][_0x0d8d('0x49')](_['merge'](_0x2956d4,_0x4266a3['body']),{'include':_0x4266a3[_0x0d8d('0x32')][_0x0d8d('0x48')]?[{'all':!![]}]:undefined})['then'](function(_0x1113bc){var _0x22afb9=_0x4266a3[_0x0d8d('0x4c')][_0x0d8d('0x26')]({'plain':!![]});if(!_0x22afb9)throw new Error(_0x0d8d('0x4b'));if(_0x22afb9[_0x0d8d('0x57')]===_0x0d8d('0x4c')){var _0x4582af=_0x1113bc[_0x0d8d('0x26')]({'plain':!![]});var _0x548f29=_0x0d8d('0x4d');return db[_0x0d8d('0x4e')][_0x0d8d('0x4f')]({'where':{'name':_0x548f29,'userProfileId':_0x22afb9[_0x0d8d('0x58')]},'raw':!![]})[_0x0d8d('0x25')](function(_0x4745da){if(_0x4745da&&_0x4745da[_0x0d8d('0x50')]===0x0){return db[_0x0d8d('0x27')][_0x0d8d('0x49')]({'name':_0x4582af[_0x0d8d('0x2a')],'resourceId':_0x4582af['id'],'type':_0x4745da[_0x0d8d('0x2a')],'sectionId':_0x4745da['id']},{})[_0x0d8d('0x25')](function(){return _0x1113bc;});}else{return _0x1113bc;}})[_0x0d8d('0x44')](function(_0x4ba180){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4ba180);throw _0x4ba180;});}return _0x1113bc;});}})[_0x0d8d('0x25')](respondWithResult(_0x2bfada,0xc9))[_0x0d8d('0x44')](handleError(_0x2bfada,null));};exports[_0x0d8d('0x24')]=function(_0x302fc2,_0x2822c7){if(_0x302fc2['body']['id']){delete _0x302fc2[_0x0d8d('0x4a')]['id'];}return db['Campaign'][_0x0d8d('0x4f')]({'where':{'id':_0x302fc2['params']['id']}})[_0x0d8d('0x25')](handleEntityNotFound(_0x2822c7,null))[_0x0d8d('0x25')](saveUpdates(_0x302fc2[_0x0d8d('0x4a')],null))[_0x0d8d('0x25')](respondWithResult(_0x2822c7,null))[_0x0d8d('0x44')](handleError(_0x2822c7,null));};exports[_0x0d8d('0x28')]=function(_0x77845e,_0x3a3f2f){return db[_0x0d8d('0x2e')][_0x0d8d('0x4f')]({'where':{'id':_0x77845e['params']['id']}})[_0x0d8d('0x25')](handleEntityNotFound(_0x3a3f2f,null))[_0x0d8d('0x25')](removeEntity(_0x3a3f2f,null))[_0x0d8d('0x44')](handleError(_0x3a3f2f,null));};exports[_0x0d8d('0x59')]=function(_0x574a88,_0x32ba3c,_0x187b05){var _0xd46635={'raw':!![],'where':{}};var _0x28e9d9={};var _0x5ccbc3={'count':0x0,'rows':[]};return db['Campaign'][_0x0d8d('0x5a')]({'where':{'id':_0x574a88['params']['id']}})[_0x0d8d('0x25')](handleEntityNotFound(_0x32ba3c,null))[_0x0d8d('0x25')](function(_0x28ae7b){if(_0x28ae7b){_0x28e9d9[_0x0d8d('0x31')]=_[_0x0d8d('0x47')](db[_0x0d8d('0x5b')][_0x0d8d('0x53')]);_0x28e9d9[_0x0d8d('0x32')]=_['keys'](_0x574a88[_0x0d8d('0x32')]);_0x28e9d9['filters']=_[_0x0d8d('0x35')](_0x28e9d9[_0x0d8d('0x31')],_0x28e9d9[_0x0d8d('0x32')]);_0xd46635[_0x0d8d('0x34')]=_[_0x0d8d('0x35')](_0x28e9d9['model'],qs[_0x0d8d('0x36')](_0x574a88[_0x0d8d('0x32')]['fields']));_0xd46635[_0x0d8d('0x34')]=_0xd46635[_0x0d8d('0x34')][_0x0d8d('0x37')]?_0xd46635['attributes']:_0x28e9d9[_0x0d8d('0x31')];if(!_0x574a88[_0x0d8d('0x32')][_0x0d8d('0x38')](_0x0d8d('0x39'))){_0xd46635['limit']=qs[_0x0d8d('0x1c')](_0x574a88[_0x0d8d('0x32')][_0x0d8d('0x1c')]);_0xd46635['offset']=qs[_0x0d8d('0x1a')](_0x574a88[_0x0d8d('0x32')][_0x0d8d('0x1a')]);}_0xd46635[_0x0d8d('0x3a')]=qs[_0x0d8d('0x3b')](_0x574a88[_0x0d8d('0x32')][_0x0d8d('0x3b')]);_0xd46635[_0x0d8d('0x3e')]=qs[_0x0d8d('0x33')](_[_0x0d8d('0x3c')](_0x574a88[_0x0d8d('0x32')],_0x28e9d9['filters']));_0xd46635[_0x0d8d('0x3e')][_0x0d8d('0x5c')]=_0x28ae7b['id'];if(_0x574a88[_0x0d8d('0x32')][_0x0d8d('0x3d')]){_0xd46635[_0x0d8d('0x3e')]=_[_0x0d8d('0x40')](_0xd46635['where'],{'$or':_[_0x0d8d('0x2d')](_0xd46635[_0x0d8d('0x34')],function(_0x565c87){var _0x36d28a={};_0x36d28a[_0x565c87]={'$like':'%'+_0x574a88[_0x0d8d('0x32')]['filter']+'%'};return _0x36d28a;})});}_0xd46635=_[_0x0d8d('0x40')]({},_0xd46635,_0x574a88[_0x0d8d('0x41')]);return db[_0x0d8d('0x5b')][_0x0d8d('0x1d')]({'where':_0xd46635[_0x0d8d('0x3e')]})[_0x0d8d('0x25')](function(_0x179741){_0x5ccbc3[_0x0d8d('0x1d')]=_0x179741;if(_0x574a88['query'][_0x0d8d('0x48')]){_0xd46635[_0x0d8d('0x42')]=[{'all':!![]}];}return db['CmHopper'][_0x0d8d('0x43')](_0xd46635);})['then'](function(_0xc37307){_0x5ccbc3[_0x0d8d('0x5d')]=_0xc37307;return _0x5ccbc3;});}})[_0x0d8d('0x25')](respondWithFilteredResult(_0x32ba3c,_0xd46635))[_0x0d8d('0x44')](handleError(_0x32ba3c,null));};exports['getHopperHistories']=function(_0xf2899d,_0x497bcb,_0x2f4473){var _0x47b719={'raw':!![],'where':{}};var _0xcbcec7={};var _0x35886e={'count':0x0,'rows':[]};return db[_0x0d8d('0x2e')][_0x0d8d('0x5a')]({'where':{'id':_0xf2899d[_0x0d8d('0x46')]['id']}})[_0x0d8d('0x25')](handleEntityNotFound(_0x497bcb,null))[_0x0d8d('0x25')](function(_0xa61073){if(_0xa61073){_0xcbcec7['model']=_['keys'](db['CmHopperHistory']['rawAttributes']);_0xcbcec7['query']=_[_0x0d8d('0x47')](_0xf2899d['query']);_0xcbcec7[_0x0d8d('0x33')]=_[_0x0d8d('0x35')](_0xcbcec7['model'],_0xcbcec7[_0x0d8d('0x32')]);_0x47b719['attributes']=_['intersection'](_0xcbcec7['model'],qs[_0x0d8d('0x36')](_0xf2899d[_0x0d8d('0x32')][_0x0d8d('0x36')]));_0x47b719['attributes']=_0x47b719[_0x0d8d('0x34')]['length']?_0x47b719[_0x0d8d('0x34')]:_0xcbcec7[_0x0d8d('0x31')];if(!_0xf2899d[_0x0d8d('0x32')][_0x0d8d('0x38')](_0x0d8d('0x39'))){_0x47b719['limit']=qs['limit'](_0xf2899d[_0x0d8d('0x32')][_0x0d8d('0x1c')]);_0x47b719['offset']=qs[_0x0d8d('0x1a')](_0xf2899d[_0x0d8d('0x32')][_0x0d8d('0x1a')]);}_0x47b719[_0x0d8d('0x3a')]=qs[_0x0d8d('0x3b')](_0xf2899d[_0x0d8d('0x32')][_0x0d8d('0x3b')]);_0x47b719[_0x0d8d('0x3e')]=qs[_0x0d8d('0x33')](_['pick'](_0xf2899d[_0x0d8d('0x32')],_0xcbcec7['filters']));_0x47b719[_0x0d8d('0x3e')][_0x0d8d('0x5c')]=_0xa61073['id'];if(_0xf2899d['query'][_0x0d8d('0x3d')]){_0x47b719[_0x0d8d('0x3e')]=_[_0x0d8d('0x40')](_0x47b719[_0x0d8d('0x3e')],{'$or':_[_0x0d8d('0x2d')](_0x47b719['attributes'],function(_0x7e2fa1){var _0x43a4dd={};_0x43a4dd[_0x7e2fa1]={'$like':'%'+_0xf2899d[_0x0d8d('0x32')][_0x0d8d('0x3d')]+'%'};return _0x43a4dd;})});}_0x47b719=_[_0x0d8d('0x40')]({},_0x47b719,_0xf2899d[_0x0d8d('0x41')]);return db[_0x0d8d('0x5e')][_0x0d8d('0x1d')]({'where':_0x47b719['where']})[_0x0d8d('0x25')](function(_0x25b485){_0x35886e[_0x0d8d('0x1d')]=_0x25b485;if(_0xf2899d[_0x0d8d('0x32')][_0x0d8d('0x48')]){_0x47b719[_0x0d8d('0x42')]=[{'all':!![]}];}return db[_0x0d8d('0x5e')]['findAll'](_0x47b719);})['then'](function(_0x50bf26){_0x35886e[_0x0d8d('0x5d')]=_0x50bf26;return _0x35886e;});}})['then'](respondWithFilteredResult(_0x497bcb,_0x47b719))[_0x0d8d('0x44')](handleError(_0x497bcb,null));};exports[_0x0d8d('0x5f')]=function(_0xf50d6c,_0x48f451,_0x29efba){var _0x14e2c={'raw':!![],'where':{}};var _0x356192={};var _0x2d3994={'count':0x0,'rows':[]};return db[_0x0d8d('0x2e')][_0x0d8d('0x5a')]({'where':{'id':_0xf50d6c[_0x0d8d('0x46')]['id']}})[_0x0d8d('0x25')](handleEntityNotFound(_0x48f451,null))['then'](function(_0x4b96cf){if(_0x4b96cf){_0x356192[_0x0d8d('0x31')]=_[_0x0d8d('0x47')](db[_0x0d8d('0x60')][_0x0d8d('0x53')]);_0x356192['query']=_[_0x0d8d('0x47')](_0xf50d6c[_0x0d8d('0x32')]);_0x356192[_0x0d8d('0x33')]=_[_0x0d8d('0x35')](_0x356192[_0x0d8d('0x31')],_0x356192[_0x0d8d('0x32')]);_0x14e2c[_0x0d8d('0x34')]=_[_0x0d8d('0x35')](_0x356192[_0x0d8d('0x31')],qs[_0x0d8d('0x36')](_0xf50d6c[_0x0d8d('0x32')][_0x0d8d('0x36')]));_0x14e2c[_0x0d8d('0x34')]=_0x14e2c[_0x0d8d('0x34')][_0x0d8d('0x37')]?_0x14e2c[_0x0d8d('0x34')]:_0x356192[_0x0d8d('0x31')];if(!_0xf50d6c[_0x0d8d('0x32')][_0x0d8d('0x38')](_0x0d8d('0x39'))){_0x14e2c[_0x0d8d('0x1c')]=qs[_0x0d8d('0x1c')](_0xf50d6c[_0x0d8d('0x32')][_0x0d8d('0x1c')]);_0x14e2c[_0x0d8d('0x1a')]=qs[_0x0d8d('0x1a')](_0xf50d6c[_0x0d8d('0x32')][_0x0d8d('0x1a')]);}_0x14e2c[_0x0d8d('0x3a')]=qs[_0x0d8d('0x3b')](_0xf50d6c['query']['sort']);_0x14e2c['where']=qs[_0x0d8d('0x33')](_[_0x0d8d('0x3c')](_0xf50d6c['query'],_0x356192[_0x0d8d('0x33')]));_0x14e2c[_0x0d8d('0x3e')][_0x0d8d('0x5c')]=_0x4b96cf['id'];if(_0xf50d6c[_0x0d8d('0x32')][_0x0d8d('0x3d')]){_0x14e2c[_0x0d8d('0x3e')]=_['merge'](_0x14e2c[_0x0d8d('0x3e')],{'$or':_[_0x0d8d('0x2d')](_0x14e2c[_0x0d8d('0x34')],function(_0x2ff75e){var _0x671d02={};_0x671d02[_0x2ff75e]={'$like':'%'+_0xf50d6c[_0x0d8d('0x32')][_0x0d8d('0x3d')]+'%'};return _0x671d02;})});}_0x14e2c=_[_0x0d8d('0x40')]({},_0x14e2c,_0xf50d6c[_0x0d8d('0x41')]);return db[_0x0d8d('0x60')][_0x0d8d('0x1d')]({'where':_0x14e2c[_0x0d8d('0x3e')]})[_0x0d8d('0x25')](function(_0x3caed1){_0x2d3994[_0x0d8d('0x1d')]=_0x3caed1;if(_0xf50d6c[_0x0d8d('0x32')][_0x0d8d('0x48')]){_0x14e2c[_0x0d8d('0x42')]=[{'all':!![]}];}return db[_0x0d8d('0x60')][_0x0d8d('0x43')](_0x14e2c);})['then'](function(_0x2572b2){_0x2d3994['rows']=_0x2572b2;return _0x2d3994;});}})['then'](respondWithFilteredResult(_0x48f451,_0x14e2c))[_0x0d8d('0x44')](handleError(_0x48f451,null));};exports['getHopperBlacks']=function(_0x855fc3,_0x4d772e,_0x46c756){var _0x32b03a={'raw':!![],'where':{}};var _0xade583={};var _0x1064cd={'count':0x0,'rows':[]};return db[_0x0d8d('0x2e')]['findOne']({'where':{'id':_0x855fc3[_0x0d8d('0x46')]['id']}})[_0x0d8d('0x25')](handleEntityNotFound(_0x4d772e,null))['then'](function(_0x51c637){if(_0x51c637){_0xade583[_0x0d8d('0x31')]=_[_0x0d8d('0x47')](db[_0x0d8d('0x61')][_0x0d8d('0x53')]);_0xade583['query']=_[_0x0d8d('0x47')](_0x855fc3['query']);_0xade583[_0x0d8d('0x33')]=_[_0x0d8d('0x35')](_0xade583[_0x0d8d('0x31')],_0xade583['query']);_0x32b03a[_0x0d8d('0x34')]=_[_0x0d8d('0x35')](_0xade583['model'],qs[_0x0d8d('0x36')](_0x855fc3[_0x0d8d('0x32')]['fields']));_0x32b03a['attributes']=_0x32b03a[_0x0d8d('0x34')][_0x0d8d('0x37')]?_0x32b03a[_0x0d8d('0x34')]:_0xade583[_0x0d8d('0x31')];if(!_0x855fc3[_0x0d8d('0x32')][_0x0d8d('0x38')]('nolimit')){_0x32b03a[_0x0d8d('0x1c')]=qs[_0x0d8d('0x1c')](_0x855fc3[_0x0d8d('0x32')][_0x0d8d('0x1c')]);_0x32b03a[_0x0d8d('0x1a')]=qs[_0x0d8d('0x1a')](_0x855fc3[_0x0d8d('0x32')][_0x0d8d('0x1a')]);}_0x32b03a[_0x0d8d('0x3a')]=qs['sort'](_0x855fc3[_0x0d8d('0x32')][_0x0d8d('0x3b')]);_0x32b03a[_0x0d8d('0x3e')]=qs['filters'](_[_0x0d8d('0x3c')](_0x855fc3[_0x0d8d('0x32')],_0xade583[_0x0d8d('0x33')]));_0x32b03a[_0x0d8d('0x3e')][_0x0d8d('0x5c')]=_0x51c637['id'];if(_0x855fc3[_0x0d8d('0x32')]['filter']){_0x32b03a['where']=_[_0x0d8d('0x40')](_0x32b03a[_0x0d8d('0x3e')],{'$or':_[_0x0d8d('0x2d')](_0x32b03a[_0x0d8d('0x34')],function(_0x5ec140){var _0x4ab10f={};_0x4ab10f[_0x5ec140]={'$like':'%'+_0x855fc3['query'][_0x0d8d('0x3d')]+'%'};return _0x4ab10f;})});}_0x32b03a=_[_0x0d8d('0x40')]({},_0x32b03a,_0x855fc3[_0x0d8d('0x41')]);return db['CmHopperBlack']['count']({'where':_0x32b03a['where']})['then'](function(_0x585652){_0x1064cd[_0x0d8d('0x1d')]=_0x585652;if(_0x855fc3['query'][_0x0d8d('0x48')]){_0x32b03a['include']=[{'all':!![]}];}return db[_0x0d8d('0x61')]['findAll'](_0x32b03a);})[_0x0d8d('0x25')](function(_0x333fb5){_0x1064cd['rows']=_0x333fb5;return _0x1064cd;});}})[_0x0d8d('0x25')](respondWithFilteredResult(_0x4d772e,_0x32b03a))[_0x0d8d('0x44')](handleError(_0x4d772e,null));};exports[_0x0d8d('0x62')]=function(_0x161c4f,_0x23f0e1,_0x411eab){var _0x1111ad={};var _0x3ced3e={};var _0x1ed82a;var _0x478c33;return db[_0x0d8d('0x2e')][_0x0d8d('0x5a')]({'where':{'id':_0x161c4f[_0x0d8d('0x46')]['id']}})['then'](handleEntityNotFound(_0x23f0e1,null))[_0x0d8d('0x25')](function(_0x432049){if(_0x432049){_0x1ed82a=_0x432049;_0x3ced3e[_0x0d8d('0x31')]=_['keys'](db[_0x0d8d('0x63')][_0x0d8d('0x53')]);_0x3ced3e[_0x0d8d('0x32')]=_[_0x0d8d('0x47')](_0x161c4f[_0x0d8d('0x32')]);_0x3ced3e[_0x0d8d('0x33')]=_[_0x0d8d('0x35')](_0x3ced3e[_0x0d8d('0x31')],_0x3ced3e[_0x0d8d('0x32')]);_0x1111ad[_0x0d8d('0x34')]=_[_0x0d8d('0x35')](_0x3ced3e[_0x0d8d('0x31')],qs[_0x0d8d('0x36')](_0x161c4f['query'][_0x0d8d('0x36')]));_0x1111ad[_0x0d8d('0x34')]=_0x1111ad[_0x0d8d('0x34')][_0x0d8d('0x37')]?_0x1111ad[_0x0d8d('0x34')]:_0x3ced3e[_0x0d8d('0x31')];_0x1111ad[_0x0d8d('0x3a')]=qs[_0x0d8d('0x3b')](_0x161c4f['query'][_0x0d8d('0x3b')]);_0x1111ad[_0x0d8d('0x3e')]=qs[_0x0d8d('0x33')](_['pick'](_0x161c4f[_0x0d8d('0x32')],_0x3ced3e['filters']));if(_0x161c4f[_0x0d8d('0x32')][_0x0d8d('0x3d')]){_0x1111ad[_0x0d8d('0x3e')]=_[_0x0d8d('0x40')](_0x1111ad['where'],{'$or':_[_0x0d8d('0x2d')](_0x1111ad[_0x0d8d('0x34')],function(_0x5f1f92){var _0x11c4fc={};_0x11c4fc[_0x5f1f92]={'$like':'%'+_0x161c4f[_0x0d8d('0x32')][_0x0d8d('0x3d')]+'%'};return _0x11c4fc;})});}_0x1111ad=_[_0x0d8d('0x40')]({},_0x1111ad,_0x161c4f['options']);return _0x1ed82a[_0x0d8d('0x62')](_0x1111ad);}})[_0x0d8d('0x25')](function(_0x5d2257){if(_0x5d2257){_0x478c33=_0x5d2257[_0x0d8d('0x37')];if(!_0x161c4f[_0x0d8d('0x32')][_0x0d8d('0x38')](_0x0d8d('0x39'))){_0x1111ad['limit']=qs[_0x0d8d('0x1c')](_0x161c4f[_0x0d8d('0x32')][_0x0d8d('0x1c')]);_0x1111ad[_0x0d8d('0x1a')]=qs[_0x0d8d('0x1a')](_0x161c4f[_0x0d8d('0x32')][_0x0d8d('0x1a')]);}return _0x1ed82a[_0x0d8d('0x62')](_0x1111ad);}})[_0x0d8d('0x25')](function(_0x3e9c5a){if(_0x3e9c5a){return _0x3e9c5a?{'count':_0x478c33,'rows':_0x3e9c5a}:null;}})['then'](respondWithResult(_0x23f0e1,null))['catch'](handleError(_0x23f0e1,null));};exports['addLists']=function(_0xcc84de,_0x45392c,_0x4b0934){var _0x31cdbe,_0x1fc834;return db[_0x0d8d('0x2e')][_0x0d8d('0x4f')]({'where':{'id':_0xcc84de[_0x0d8d('0x46')]['id']}})[_0x0d8d('0x25')](handleEntityNotFound(_0x45392c,null))[_0x0d8d('0x25')](function(_0x1722cb){if(_0x1722cb){_0x1fc834=_0x1722cb;return _0x1722cb[_0x0d8d('0x64')](_0xcc84de[_0x0d8d('0x4a')][_0x0d8d('0x65')],_[_0x0d8d('0x54')](_0xcc84de[_0x0d8d('0x4a')],[_0x0d8d('0x65'),'id'])||{});}return null;})[_0x0d8d('0x66')](function(_0x39a865){var _0x8b1514;_0x31cdbe=_0x39a865||[];var _0x17d30a=[];if(_0x39a865){for(var _0x1fa1ce=0x0;_0x1fa1ce<_0x39a865['length'];_0x1fa1ce+=0x1){var _0x2d473c=_0x39a865[_0x1fa1ce][_0x0d8d('0x26')]({'plain':!![]});_0x1fc834[_0x0d8d('0x67')]=_0xcc84de[_0x0d8d('0x4a')]['dialCheckDuplicateType']?_0xcc84de[_0x0d8d('0x4a')][_0x0d8d('0x67')]:_0x1fc834[_0x0d8d('0x67')];switch(_0x1fc834[_0x0d8d('0x67')]){case _0x0d8d('0x68'):_0x8b1514=squel['insert']()[_0x0d8d('0x69')](_0x0d8d('0x6a'))[_0x0d8d('0x6b')]([_0x0d8d('0x6c'),'scheduledAt',_0x0d8d('0x6d'),_0x0d8d('0x6e'),_0x0d8d('0x5c'),'createdAt','updatedAt'],squel[_0x0d8d('0x6f')]()['field'](_0x0d8d('0x6c'),_0x0d8d('0x6c'))['field']('NOW()',_0x0d8d('0x70'))[_0x0d8d('0x71')]('id','ContactId')[_0x0d8d('0x71')](_0x2d473c[_0x0d8d('0x72')][_0x0d8d('0x73')](),_0x0d8d('0x6e'))['field'](_0xcc84de[_0x0d8d('0x46')]['id'][_0x0d8d('0x73')](),_0x0d8d('0x5c'))[_0x0d8d('0x71')](_0x0d8d('0x74'),_0x0d8d('0x55'))[_0x0d8d('0x71')](_0x0d8d('0x74'),_0x0d8d('0x56'))[_0x0d8d('0x75')](_0x0d8d('0x76'))[_0x0d8d('0x3e')](_0x0d8d('0x77'))[_0x0d8d('0x3e')](_0x0d8d('0x78'),_0x2d473c[_0x0d8d('0x72')]['toString']())[_0x0d8d('0x3e')](_0x0d8d('0x79'))[_0x0d8d('0x3e')](_0x0d8d('0x7a'),squel['select']()[_0x0d8d('0x71')]('COALESCE(calleridnum,\x27\x27)')[_0x0d8d('0x75')](_0x0d8d('0x7b'))['where'](_0x0d8d('0x7c'),_0xcc84de[_0x0d8d('0x46')]['id'][_0x0d8d('0x73')]()))[_0x0d8d('0x3e')](_0x0d8d('0x7a'),squel[_0x0d8d('0x6f')]()['field'](_0x0d8d('0x7d'))[_0x0d8d('0x75')](_0x0d8d('0x6a'))[_0x0d8d('0x3e')](_0x0d8d('0x7c'),_0xcc84de['params']['id']['toString']())))[_0x0d8d('0x73')]();break;case _0x0d8d('0x7e'):_0x8b1514=squel[_0x0d8d('0x7f')]()[_0x0d8d('0x69')](_0x0d8d('0x6a'))[_0x0d8d('0x6b')]([_0x0d8d('0x6c'),'scheduledAt','ContactId','ListId',_0x0d8d('0x5c'),_0x0d8d('0x55'),_0x0d8d('0x56')],squel[_0x0d8d('0x6f')]()[_0x0d8d('0x71')](_0x0d8d('0x6c'),'phone')[_0x0d8d('0x71')](_0x0d8d('0x74'),_0x0d8d('0x70'))[_0x0d8d('0x71')]('id',_0x0d8d('0x6d'))['field'](_0x2d473c[_0x0d8d('0x72')][_0x0d8d('0x73')](),_0x0d8d('0x6e'))[_0x0d8d('0x71')](_0xcc84de[_0x0d8d('0x46')]['id'][_0x0d8d('0x73')](),_0x0d8d('0x5c'))[_0x0d8d('0x71')]('NOW()','createdAt')[_0x0d8d('0x71')](_0x0d8d('0x74'),_0x0d8d('0x56'))[_0x0d8d('0x75')](_0x0d8d('0x76'))[_0x0d8d('0x3e')](_0x0d8d('0x77'))['where'](_0x0d8d('0x78'),_0x2d473c[_0x0d8d('0x72')][_0x0d8d('0x73')]())['where'](_0x0d8d('0x79'))['where'](_0x0d8d('0x7a'),squel['select']()[_0x0d8d('0x71')](_0x0d8d('0x7d'))['from'](_0x0d8d('0x6a'))['where'](_0x0d8d('0x7c'),_0xcc84de['params']['id']['toString']())))['toString']();break;default:_0x8b1514=squel['insert']()['into'](_0x0d8d('0x6a'))[_0x0d8d('0x6b')](['phone',_0x0d8d('0x70'),_0x0d8d('0x6d'),_0x0d8d('0x6e'),'CampaignId',_0x0d8d('0x55'),_0x0d8d('0x56')],squel['select']()[_0x0d8d('0x71')]('phone','phone')[_0x0d8d('0x71')](_0x0d8d('0x74'),_0x0d8d('0x70'))[_0x0d8d('0x71')]('id',_0x0d8d('0x6d'))['field'](_0x2d473c[_0x0d8d('0x72')][_0x0d8d('0x73')](),'ListId')[_0x0d8d('0x71')](_0xcc84de[_0x0d8d('0x46')]['id'][_0x0d8d('0x73')](),_0x0d8d('0x5c'))[_0x0d8d('0x71')](_0x0d8d('0x74'),_0x0d8d('0x55'))[_0x0d8d('0x71')](_0x0d8d('0x74'),'updatedAt')[_0x0d8d('0x75')](_0x0d8d('0x76'))[_0x0d8d('0x3e')](_0x0d8d('0x77'))[_0x0d8d('0x3e')]('ListId\x20=\x20?',_0x2d473c[_0x0d8d('0x72')][_0x0d8d('0x73')]())[_0x0d8d('0x3e')](_0x0d8d('0x79')))['toString']();}_0x17d30a['push'](db[_0x0d8d('0x80')][_0x0d8d('0x32')](_0x8b1514));}return BPromise[_0x0d8d('0x81')](_0x17d30a);}})['then'](function(){return _0x31cdbe;})[_0x0d8d('0x25')](respondWithResult(_0x45392c,null))['catch'](handleError(_0x45392c,null));};exports[_0x0d8d('0x82')]=function(_0x2e453e,_0x357e32,_0x3bcb31){return db[_0x0d8d('0x2e')][_0x0d8d('0x4f')]({'where':{'id':_0x2e453e[_0x0d8d('0x46')]['id']}})['then'](handleEntityNotFound(_0x357e32,null))[_0x0d8d('0x25')](function(_0x1b1564){if(_0x1b1564){return _0x1b1564[_0x0d8d('0x82')](_0x2e453e[_0x0d8d('0x32')][_0x0d8d('0x65')]);}})[_0x0d8d('0x25')](function(_0x328fb1){if(_0x328fb1){return db['CmHopper'][_0x0d8d('0x28')]({'where':{'ListId':_0x2e453e['query'][_0x0d8d('0x65')],'CampaignId':_0x2e453e[_0x0d8d('0x46')]['id']}})[_0x0d8d('0x25')](function(){return _0x328fb1;});}})[_0x0d8d('0x25')](respondWithStatusCode(_0x357e32,null))[_0x0d8d('0x44')](handleError(_0x357e32,null));};exports['getBlackLists']=function(_0x52d9a6,_0x602a8d,_0x347cf6){var _0x1abddb={};var _0x24fa1e={};var _0x79b4d4;var _0x89e5f7;return db['Campaign'][_0x0d8d('0x5a')]({'where':{'id':_0x52d9a6[_0x0d8d('0x46')]['id']}})[_0x0d8d('0x25')](handleEntityNotFound(_0x602a8d,null))[_0x0d8d('0x25')](function(_0x2a079b){if(_0x2a079b){_0x79b4d4=_0x2a079b;_0x24fa1e[_0x0d8d('0x31')]=_[_0x0d8d('0x47')](db[_0x0d8d('0x63')][_0x0d8d('0x53')]);_0x24fa1e[_0x0d8d('0x32')]=_[_0x0d8d('0x47')](_0x52d9a6[_0x0d8d('0x32')]);_0x24fa1e[_0x0d8d('0x33')]=_[_0x0d8d('0x35')](_0x24fa1e['model'],_0x24fa1e[_0x0d8d('0x32')]);_0x1abddb[_0x0d8d('0x34')]=_[_0x0d8d('0x35')](_0x24fa1e['model'],qs['fields'](_0x52d9a6[_0x0d8d('0x32')]['fields']));_0x1abddb['attributes']=_0x1abddb[_0x0d8d('0x34')][_0x0d8d('0x37')]?_0x1abddb[_0x0d8d('0x34')]:_0x24fa1e[_0x0d8d('0x31')];_0x1abddb['order']=qs[_0x0d8d('0x3b')](_0x52d9a6[_0x0d8d('0x32')][_0x0d8d('0x3b')]);_0x1abddb[_0x0d8d('0x3e')]=qs['filters'](_['pick'](_0x52d9a6['query'],_0x24fa1e[_0x0d8d('0x33')]));if(_0x52d9a6[_0x0d8d('0x32')]['filter']){_0x1abddb[_0x0d8d('0x3e')]=_[_0x0d8d('0x40')](_0x1abddb[_0x0d8d('0x3e')],{'$or':_[_0x0d8d('0x2d')](_0x1abddb[_0x0d8d('0x34')],function(_0x3182bb){var _0x396564={};_0x396564[_0x3182bb]={'$like':'%'+_0x52d9a6[_0x0d8d('0x32')][_0x0d8d('0x3d')]+'%'};return _0x396564;})});}_0x1abddb=_[_0x0d8d('0x40')]({},_0x1abddb,_0x52d9a6['options']);return _0x79b4d4['getBlackLists'](_0x1abddb);}})['then'](function(_0x1524cd){if(_0x1524cd){_0x89e5f7=_0x1524cd['length'];if(!_0x52d9a6[_0x0d8d('0x32')]['hasOwnProperty'](_0x0d8d('0x39'))){_0x1abddb[_0x0d8d('0x1c')]=qs['limit'](_0x52d9a6['query'][_0x0d8d('0x1c')]);_0x1abddb[_0x0d8d('0x1a')]=qs['offset'](_0x52d9a6['query']['offset']);}return _0x79b4d4[_0x0d8d('0x83')](_0x1abddb);}})['then'](function(_0x21d3fd){if(_0x21d3fd){return _0x21d3fd?{'count':_0x89e5f7,'rows':_0x21d3fd}:null;}})['then'](respondWithResult(_0x602a8d,null))[_0x0d8d('0x44')](handleError(_0x602a8d,null));};exports['addBlackLists']=function(_0xa9dd3f,_0x7fd298,_0x17db23){var _0x5f5e0a,_0x1dcf0e;return db[_0x0d8d('0x2e')][_0x0d8d('0x4f')]({'where':{'id':_0xa9dd3f[_0x0d8d('0x46')]['id']}})[_0x0d8d('0x25')](handleEntityNotFound(_0x7fd298,null))[_0x0d8d('0x25')](function(_0x4ccf74){if(_0x4ccf74){_0x1dcf0e=_0x4ccf74;return _0x4ccf74['addBlackLists'](_0xa9dd3f['body']['ids'],_[_0x0d8d('0x54')](_0xa9dd3f[_0x0d8d('0x4a')],[_0x0d8d('0x65'),'id'])||{});}return null;})['spread'](function(_0x524774){var _0x33521d;_0x5f5e0a=_0x524774||[];var _0x5c2add=[];if(_0x524774){for(var _0x16d123=0x0;_0x16d123<_0x524774[_0x0d8d('0x37')];_0x16d123+=0x1){var _0x188a1e=_0x524774[_0x16d123]['get']({'plain':!![]});_0x33521d=squel[_0x0d8d('0x7f')]()[_0x0d8d('0x69')](_0x0d8d('0x84'))['fromQuery']([_0x0d8d('0x6c'),_0x0d8d('0x6d'),_0x0d8d('0x6e'),'CampaignId','createdAt',_0x0d8d('0x56')],squel[_0x0d8d('0x6f')]()[_0x0d8d('0x71')]('phone',_0x0d8d('0x6c'))[_0x0d8d('0x71')]('id',_0x0d8d('0x6d'))[_0x0d8d('0x71')](_0x188a1e['CmListId'][_0x0d8d('0x73')](),_0x0d8d('0x6e'))[_0x0d8d('0x71')](_0xa9dd3f[_0x0d8d('0x46')]['id'][_0x0d8d('0x73')](),_0x0d8d('0x5c'))[_0x0d8d('0x71')]('NOW()',_0x0d8d('0x55'))[_0x0d8d('0x71')](_0x0d8d('0x74'),_0x0d8d('0x56'))['from'](_0x0d8d('0x76'))[_0x0d8d('0x3e')]('deletedAt\x20IS\x20NULL')[_0x0d8d('0x3e')](_0x0d8d('0x78'),_0x188a1e[_0x0d8d('0x72')][_0x0d8d('0x73')]())[_0x0d8d('0x3e')](_0x0d8d('0x79')))['toString']();_0x5c2add['push'](db[_0x0d8d('0x80')][_0x0d8d('0x32')](_0x33521d));}return BPromise[_0x0d8d('0x81')](_0x5c2add);}})[_0x0d8d('0x25')](function(){return _0x5f5e0a;})[_0x0d8d('0x25')](respondWithResult(_0x7fd298,null))['catch'](handleError(_0x7fd298,null));};exports[_0x0d8d('0x85')]=function(_0xaba573,_0x48eaac,_0x1dfb48){return db[_0x0d8d('0x2e')][_0x0d8d('0x4f')]({'where':{'id':_0xaba573['params']['id']}})[_0x0d8d('0x25')](handleEntityNotFound(_0x48eaac,null))[_0x0d8d('0x25')](function(_0x480f5a){if(_0x480f5a){return _0x480f5a['removeBlackLists'](_0xaba573['query']['ids']);}})[_0x0d8d('0x25')](function(_0x4b34c8){if(_0x4b34c8){return db[_0x0d8d('0x61')][_0x0d8d('0x28')]({'where':{'ListId':_0xaba573[_0x0d8d('0x32')][_0x0d8d('0x65')],'CampaignId':_0xaba573[_0x0d8d('0x46')]['id']}})[_0x0d8d('0x25')](function(){return _0x4b34c8;});}})[_0x0d8d('0x25')](respondWithStatusCode(_0x48eaac,null))['catch'](handleError(_0x48eaac,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 58f1e08..2b6e6cc 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(_0x531e85,_0x4c5f38){var _0x197b70=function(_0x3feb49){while(--_0x3feb49){_0x531e85['push'](_0x531e85['shift']());}};_0x197b70(++_0x4c5f38);}(_0x7a54,0x106));var _0x47a5=function(_0xc8c0,_0x419e14){_0xc8c0=_0xc8c0-0x0;var _0x287333=_0x7a54[_0xc8c0];return _0x287333;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_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 logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index cb3510c..52417b7 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 _0x8b29=['GetCampaign','findAll','options','raw','where','attributes','map','include','model','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x5393e2,_0x34ec81){var _0x26bc87=function(_0x4cecd8){while(--_0x4cecd8){_0x5393e2['push'](_0x5393e2['shift']());}};_0x26bc87(++_0x34ec81);}(_0x8b29,0xbe));var _0x98b2=function(_0xf00138,_0x3cf18a){_0xf00138=_0xf00138-0x0;var _0x338a3c=_0x8b29[_0xf00138];return _0x338a3c;};'use strict';var _=require(_0x98b2('0x0'));var util=require('util');var moment=require(_0x98b2('0x1'));var BPromise=require(_0x98b2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x98b2('0x3'))['db'];var utils=require(_0x98b2('0x4'));var logger=require('../../config/logger')(_0x98b2('0x5'));var config=require('../../config/environment');var jayson=require(_0x98b2('0x6'));var client=jayson[_0x98b2('0x7')][_0x98b2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3e7ef5,_0x221cee,_0x2cd0cb){return new BPromise(function(_0x417ca6,_0x388827){return client[_0x98b2('0x9')](_0x3e7ef5,_0x2cd0cb)[_0x98b2('0xa')](function(_0x501b51){logger['info'](_0x98b2('0xb'),_0x221cee,_0x98b2('0xc'));logger[_0x98b2('0xd')](_0x98b2('0xe'),_0x221cee,_0x98b2('0xc'),JSON[_0x98b2('0xf')](_0x501b51));if(_0x501b51['error']){if(_0x501b51[_0x98b2('0x10')][_0x98b2('0x11')]===0x1f4){logger['error'](_0x98b2('0xb'),_0x221cee,_0x501b51[_0x98b2('0x10')][_0x98b2('0x12')]);return _0x388827(_0x501b51['error']['message']);}logger[_0x98b2('0x10')]('Campaign,\x20%s,\x20%s',_0x221cee,_0x501b51[_0x98b2('0x10')]['message']);return _0x417ca6(_0x501b51['error']['message']);}else{logger[_0x98b2('0x13')](_0x98b2('0xb'),_0x221cee,_0x98b2('0xc'));_0x417ca6(_0x501b51['result']['message']);}})['catch'](function(_0x389d22){logger[_0x98b2('0x10')](_0x98b2('0xb'),_0x221cee,_0x389d22);_0x388827(_0x389d22);});});}exports[_0x98b2('0x14')]=function(_0x4b9f2c){var _0x1cd8c6=this;return new Promise(function(_0x588837,_0x989082){return db['Campaign'][_0x98b2('0x15')]({'raw':_0x4b9f2c[_0x98b2('0x16')]?_0x4b9f2c[_0x98b2('0x16')][_0x98b2('0x17')]===undefined?!![]:![]:!![],'where':_0x4b9f2c['options']?_0x4b9f2c[_0x98b2('0x16')][_0x98b2('0x18')]||null:null,'attributes':_0x4b9f2c['options']?_0x4b9f2c['options'][_0x98b2('0x19')]||null:null,'limit':_0x4b9f2c[_0x98b2('0x16')]?_0x4b9f2c['options']['limit']||null:null,'include':_0x4b9f2c[_0x98b2('0x16')]?_0x4b9f2c[_0x98b2('0x16')]['include']?_[_0x98b2('0x1a')](_0x4b9f2c[_0x98b2('0x16')][_0x98b2('0x1b')],function(_0x4f33d8){return{'model':db[_0x4f33d8[_0x98b2('0x1c')]],'as':_0x4f33d8['as'],'attributes':_0x4f33d8['attributes'],'include':_0x4f33d8[_0x98b2('0x1b')]?_['map'](_0x4f33d8['include'],function(_0x7b6ebc){return{'model':db[_0x7b6ebc[_0x98b2('0x1c')]],'as':_0x7b6ebc['as'],'attributes':_0x7b6ebc[_0x98b2('0x19')],'include':_0x7b6ebc['include']?_['map'](_0x7b6ebc['include'],function(_0x11c6aa){return{'model':db[_0x11c6aa[_0x98b2('0x1c')]],'as':_0x11c6aa['as'],'attributes':_0x11c6aa['attributes']};}):[]};}):[]};}):[]:[]})[_0x98b2('0xa')](function(_0x28db65){logger[_0x98b2('0x13')]('GetCampaign',_0x4b9f2c);logger[_0x98b2('0xd')](_0x98b2('0x14'),_0x4b9f2c,JSON[_0x98b2('0xf')](_0x28db65));_0x588837(_0x28db65);})[_0x98b2('0x1d')](function(_0x25393d){logger['error'](_0x98b2('0x14'),_0x25393d['message'],_0x4b9f2c);_0x989082(_0x1cd8c6[_0x98b2('0x10')](0x1f4,_0x25393d[_0x98b2('0x12')]));});});}; \ No newline at end of file +var _0x9ff4=['options','raw','where','attributes','limit','include','model','map','then','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetCampaign','Campaign','findAll'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9ff4,0x196));var _0x49ff=function(_0x51c1f0,_0x4b8675){_0x51c1f0=_0x51c1f0-0x0;var _0xa8547b=_0x9ff4[_0x51c1f0];return _0xa8547b;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x49ff('0x0'));var rs=require(_0x49ff('0x1'));var fs=require('fs');var Redis=require(_0x49ff('0x2'));var db=require(_0x49ff('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x49ff('0x4'))(_0x49ff('0x5'));var config=require(_0x49ff('0x6'));var jayson=require(_0x49ff('0x7'));var client=jayson[_0x49ff('0x8')][_0x49ff('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xe967d3,_0xd87903,_0x50f784){return new BPromise(function(_0x5478a6,_0x304f83){return client[_0x49ff('0xa')](_0xe967d3,_0x50f784)['then'](function(_0x4e845a){logger[_0x49ff('0xb')](_0x49ff('0xc'),_0xd87903,_0x49ff('0xd'));logger[_0x49ff('0xe')](_0x49ff('0xf'),_0xd87903,_0x49ff('0xd'),JSON[_0x49ff('0x10')](_0x4e845a));if(_0x4e845a[_0x49ff('0x11')]){if(_0x4e845a['error']['code']===0x1f4){logger['error'](_0x49ff('0xc'),_0xd87903,_0x4e845a[_0x49ff('0x11')]['message']);return _0x304f83(_0x4e845a[_0x49ff('0x11')]['message']);}logger['error'](_0x49ff('0xc'),_0xd87903,_0x4e845a['error'][_0x49ff('0x12')]);return _0x5478a6(_0x4e845a[_0x49ff('0x11')][_0x49ff('0x12')]);}else{logger[_0x49ff('0xb')](_0x49ff('0xc'),_0xd87903,_0x49ff('0xd'));_0x5478a6(_0x4e845a[_0x49ff('0x13')][_0x49ff('0x12')]);}})['catch'](function(_0x29fb22){logger['error'](_0x49ff('0xc'),_0xd87903,_0x29fb22);_0x304f83(_0x29fb22);});});}exports[_0x49ff('0x14')]=function(_0x1a0f17){var _0x29c5d9=this;return new Promise(function(_0x255229,_0x90480f){return db[_0x49ff('0x15')][_0x49ff('0x16')]({'raw':_0x1a0f17[_0x49ff('0x17')]?_0x1a0f17['options'][_0x49ff('0x18')]===undefined?!![]:![]:!![],'where':_0x1a0f17['options']?_0x1a0f17[_0x49ff('0x17')][_0x49ff('0x19')]||null:null,'attributes':_0x1a0f17['options']?_0x1a0f17[_0x49ff('0x17')][_0x49ff('0x1a')]||null:null,'limit':_0x1a0f17['options']?_0x1a0f17['options'][_0x49ff('0x1b')]||null:null,'include':_0x1a0f17[_0x49ff('0x17')]?_0x1a0f17['options'][_0x49ff('0x1c')]?_['map'](_0x1a0f17[_0x49ff('0x17')][_0x49ff('0x1c')],function(_0xb1088){return{'model':db[_0xb1088[_0x49ff('0x1d')]],'as':_0xb1088['as'],'attributes':_0xb1088[_0x49ff('0x1a')],'include':_0xb1088[_0x49ff('0x1c')]?_[_0x49ff('0x1e')](_0xb1088[_0x49ff('0x1c')],function(_0x3c214b){return{'model':db[_0x3c214b[_0x49ff('0x1d')]],'as':_0x3c214b['as'],'attributes':_0x3c214b[_0x49ff('0x1a')],'include':_0x3c214b[_0x49ff('0x1c')]?_[_0x49ff('0x1e')](_0x3c214b['include'],function(_0x203853){return{'model':db[_0x203853[_0x49ff('0x1d')]],'as':_0x203853['as'],'attributes':_0x203853['attributes']};}):[]};}):[]};}):[]:[]})[_0x49ff('0x1f')](function(_0x1f651a){logger[_0x49ff('0xb')]('GetCampaign',_0x1a0f17);logger[_0x49ff('0xe')](_0x49ff('0x14'),_0x1a0f17,JSON[_0x49ff('0x10')](_0x1f651a));_0x255229(_0x1f651a);})[_0x49ff('0x20')](function(_0xf380ba){logger[_0x49ff('0x11')](_0x49ff('0x14'),_0xf380ba[_0x49ff('0x12')],_0x1a0f17);_0x90480f(_0x29c5d9[_0x49ff('0x11')](0x1f4,_0xf380ba[_0x49ff('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 734d7c6..9f960ca 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 _0x3620=['/:id/lists','getLists','/:id/blacklists','getBlackLists','post','/:id/clone','clone','addLists','addBlackLists','update','delete','/:id','removeLists','removeBlackLists','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks'];(function(_0x1e3682,_0x33bbb7){var _0x2a6f34=function(_0x35128b){while(--_0x35128b){_0x1e3682['push'](_0x1e3682['shift']());}};_0x2a6f34(++_0x33bbb7);}(_0x3620,0xcf));var _0x0362=function(_0x1c2e66,_0x93bc1f){_0x1c2e66=_0x1c2e66-0x0;var _0x1a655e=_0x3620[_0x1c2e66];return _0x1a655e;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x0362('0x0'));var express=require(_0x0362('0x1'));var router=express[_0x0362('0x2')]();var fs_extra=require(_0x0362('0x3'));var auth=require(_0x0362('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x0362('0x5'));var controller=require(_0x0362('0x6'));router[_0x0362('0x7')]('/',auth[_0x0362('0x8')](),controller[_0x0362('0x9')]);router[_0x0362('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x0362('0x7')](_0x0362('0xa'),auth['isAuthenticated'](),controller['getHoppers']);router[_0x0362('0x7')](_0x0362('0xb'),auth[_0x0362('0x8')](),controller[_0x0362('0xc')]);router[_0x0362('0x7')](_0x0362('0xd'),auth[_0x0362('0x8')](),controller[_0x0362('0xe')]);router[_0x0362('0x7')](_0x0362('0xf'),auth['isAuthenticated'](),controller[_0x0362('0x10')]);router[_0x0362('0x7')](_0x0362('0x11'),auth[_0x0362('0x8')](),controller[_0x0362('0x12')]);router[_0x0362('0x7')](_0x0362('0x13'),auth[_0x0362('0x8')](),controller[_0x0362('0x14')]);router[_0x0362('0x15')]('/',auth[_0x0362('0x8')](),controller['create']);router[_0x0362('0x15')](_0x0362('0x16'),auth[_0x0362('0x8')](),controller[_0x0362('0x17')]);router['post']('/:id/lists',auth[_0x0362('0x8')](),controller[_0x0362('0x18')]);router['post'](_0x0362('0x13'),auth['isAuthenticated'](),controller[_0x0362('0x19')]);router['put']('/:id',auth[_0x0362('0x8')](),controller[_0x0362('0x1a')]);router[_0x0362('0x1b')](_0x0362('0x1c'),auth[_0x0362('0x8')](),controller['destroy']);router[_0x0362('0x1b')]('/:id/lists',auth[_0x0362('0x8')](),controller[_0x0362('0x1d')]);router[_0x0362('0x1b')]('/:id/blacklists',auth[_0x0362('0x8')](),controller[_0x0362('0x1e')]);module[_0x0362('0x1f')]=router; \ No newline at end of file +var _0x0f24=['removeBlackLists','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','put','update','delete','destroy'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x0f24,0xac));var _0x40f2=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0f24[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0x40f2('0x0'));var path=require(_0x40f2('0x1'));var timeout=require(_0x40f2('0x2'));var express=require(_0x40f2('0x3'));var router=express[_0x40f2('0x4')]();var fs_extra=require(_0x40f2('0x5'));var auth=require(_0x40f2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x40f2('0x7'));var controller=require('./campaign.controller');router['get']('/',auth[_0x40f2('0x8')](),controller[_0x40f2('0x9')]);router[_0x40f2('0xa')](_0x40f2('0xb'),auth['isAuthenticated'](),controller[_0x40f2('0xc')]);router[_0x40f2('0xa')](_0x40f2('0xd'),auth['isAuthenticated'](),controller[_0x40f2('0xe')]);router[_0x40f2('0xa')](_0x40f2('0xf'),auth[_0x40f2('0x8')](),controller[_0x40f2('0x10')]);router[_0x40f2('0xa')]('/:id/hopper_finals',auth['isAuthenticated'](),controller[_0x40f2('0x11')]);router['get']('/:id/hopper_black',auth['isAuthenticated'](),controller['getHopperBlacks']);router[_0x40f2('0xa')](_0x40f2('0x12'),auth[_0x40f2('0x8')](),controller[_0x40f2('0x13')]);router[_0x40f2('0xa')](_0x40f2('0x14'),auth[_0x40f2('0x8')](),controller[_0x40f2('0x15')]);router[_0x40f2('0x16')]('/',auth[_0x40f2('0x8')](),controller[_0x40f2('0x17')]);router[_0x40f2('0x16')](_0x40f2('0x18'),auth[_0x40f2('0x8')](),controller[_0x40f2('0x19')]);router[_0x40f2('0x16')](_0x40f2('0x12'),auth['isAuthenticated'](),controller[_0x40f2('0x1a')]);router[_0x40f2('0x16')](_0x40f2('0x14'),auth['isAuthenticated'](),controller[_0x40f2('0x1b')]);router[_0x40f2('0x1c')](_0x40f2('0xb'),auth[_0x40f2('0x8')](),controller[_0x40f2('0x1d')]);router[_0x40f2('0x1e')](_0x40f2('0xb'),auth['isAuthenticated'](),controller[_0x40f2('0x1f')]);router[_0x40f2('0x1e')]('/:id/lists',auth[_0x40f2('0x8')](),controller['removeLists']);router['delete']('/:id/blacklists',auth[_0x40f2('0x8')](),controller[_0x40f2('0x20')]);module[_0x40f2('0x21')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 3a2b52f..643da8e 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 _0xd0aa=['exports','STRING','VIRTUAL','getDataValue','key'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0xd0aa,0xff));var _0xad0a=function(_0x3e90b0,_0x583071){_0x3e90b0=_0x3e90b0-0x0;var _0xe5bc46=_0xd0aa[_0x3e90b0];return _0xe5bc46;};'use strict';var Sequelize=require('sequelize');module[_0xad0a('0x0')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0xad0a('0x1')]},'name':{'type':Sequelize[_0xad0a('0x2')],'get':function(){return this[_0xad0a('0x3')](_0xad0a('0x4'));}}}; \ No newline at end of file +var _0x3198=['sequelize','exports','STRING','VIRTUAL','getDataValue'];(function(_0x3f2f56,_0x27e1b8){var _0x26a4a7=function(_0x3d993d){while(--_0x3d993d){_0x3f2f56['push'](_0x3f2f56['shift']());}};_0x26a4a7(++_0x27e1b8);}(_0x3198,0x1f4));var _0x8319=function(_0x42d74c,_0x7be041){_0x42d74c=_0x42d74c-0x0;var _0xb1f9f9=_0x3198[_0x42d74c];return _0xb1f9f9;};'use strict';var Sequelize=require(_0x8319('0x0'));module[_0x8319('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x8319('0x2')]},'name':{'type':Sequelize[_0x8319('0x3')],'get':function(){return this[_0x8319('0x4')]('key');}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 4c50be1..9bf55cc 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 _0xe7ed=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','CannedAnswers','UserProfileResource','error','stack','name','send','index','map','CannedAnswer','rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.'];(function(_0x6e07d2,_0x21d2df){var _0x4b6bb2=function(_0x51eb0c){while(--_0x51eb0c){_0x6e07d2['push'](_0x6e07d2['shift']());}};_0x4b6bb2(++_0x21d2df);}(_0xe7ed,0xb6));var _0xde7e=function(_0x259bcb,_0x3d6dbe){_0x259bcb=_0x259bcb-0x0;var _0x14d4e5=_0xe7ed[_0x259bcb];return _0x14d4e5;};'use strict';var emlformat=require(_0xde7e('0x0'));var rimraf=require(_0xde7e('0x1'));var zipdir=require(_0xde7e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xde7e('0x3'));var BPromise=require(_0xde7e('0x4'));var Mustache=require(_0xde7e('0x5'));var util=require('util');var path=require(_0xde7e('0x6'));var sox=require(_0xde7e('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xde7e('0x8'));var _=require(_0xde7e('0x9'));var squel=require(_0xde7e('0xa'));var crypto=require('crypto');var jsforce=require(_0xde7e('0xb'));var deskjs=require(_0xde7e('0xc'));var toCsv=require(_0xde7e('0xd'));var querystring=require(_0xde7e('0xe'));var Papa=require(_0xde7e('0xf'));var Redis=require(_0xde7e('0x10'));var authService=require(_0xde7e('0x11'));var qs=require(_0xde7e('0x12'));var as=require(_0xde7e('0x13'));var hardwareService=require(_0xde7e('0x14'));var logger=require(_0xde7e('0x15'))(_0xde7e('0x16'));var utils=require('../../config/utils');var config=require(_0xde7e('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2109a6,_0x52ed60){_0x52ed60=_0x52ed60||0xcc;return function(_0x3b8e6b){if(_0x3b8e6b){return _0x2109a6[_0xde7e('0x18')](_0x52ed60);}return _0x2109a6[_0xde7e('0x19')](_0x52ed60)[_0xde7e('0x1a')]();};}function respondWithResult(_0x62d978,_0x4e17ad){_0x4e17ad=_0x4e17ad||0xc8;return function(_0x526025){if(_0x526025){return _0x62d978[_0xde7e('0x19')](_0x4e17ad)[_0xde7e('0x1b')](_0x526025);}};}function respondWithFilteredResult(_0x45ec9d,_0x524bb6){return function(_0x3962c3){if(_0x3962c3){var _0x550094=typeof _0x524bb6[_0xde7e('0x1c')]===_0xde7e('0x1d')&&typeof _0x524bb6[_0xde7e('0x1e')]==='undefined';var _0x591acb=_0x3962c3[_0xde7e('0x1f')];var _0x359a7c=_0x550094?0x0:_0x524bb6[_0xde7e('0x1c')];var _0x60d64a=_0x550094?_0x3962c3[_0xde7e('0x1f')]:_0x524bb6[_0xde7e('0x1c')]+_0x524bb6[_0xde7e('0x1e')];var _0x29dd29;if(_0x60d64a>=_0x591acb){_0x60d64a=_0x591acb;_0x29dd29=0xc8;}else{_0x29dd29=0xce;}_0x45ec9d[_0xde7e('0x19')](_0x29dd29);return _0x45ec9d['set']('Content-Range',_0x359a7c+'-'+_0x60d64a+'/'+_0x591acb)['json'](_0x3962c3);}return null;};}function patchUpdates(_0xb8db81){return function(_0x2d7227){try{jsonpatch[_0xde7e('0x20')](_0x2d7227,_0xb8db81,!![]);}catch(_0x48cf97){return BPromise[_0xde7e('0x21')](_0x48cf97);}return _0x2d7227[_0xde7e('0x22')]();};}function saveUpdates(_0xae673e,_0x3d889d){return function(_0x2c0ee1){if(_0x2c0ee1){return _0x2c0ee1[_0xde7e('0x23')](_0xae673e)[_0xde7e('0x24')](function(_0x31cd9b){return _0x31cd9b;});}return null;};}function removeEntity(_0x1b2fe3,_0xa6afd3){return function(_0x163c31){if(_0x163c31){return _0x163c31[_0xde7e('0x25')]()['then'](function(){var _0xf1d9b2=_0x163c31['get']({'plain':!![]});var _0x386662=_0xde7e('0x26');return db[_0xde7e('0x27')][_0xde7e('0x25')]({'where':{'type':_0x386662,'resourceId':_0xf1d9b2['id']}})[_0xde7e('0x24')](function(){return _0x163c31;});})['then'](function(){_0x1b2fe3[_0xde7e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a91ea,_0x11b991){return function(_0x53008d){if(!_0x53008d){_0x5a91ea[_0xde7e('0x18')](0x194);}return _0x53008d;};}function handleError(_0x1a8031,_0x142ecd){_0x142ecd=_0x142ecd||0x1f4;return function(_0x3e2223){logger[_0xde7e('0x28')](_0x3e2223[_0xde7e('0x29')]);if(_0x3e2223['name']){delete _0x3e2223[_0xde7e('0x2a')];}_0x1a8031['status'](_0x142ecd)[_0xde7e('0x2b')](_0x3e2223);};}exports[_0xde7e('0x2c')]=function(_0x1e4376,_0x346a6f){var _0x3e090c={},_0x57850a={},_0x51c6ed={'count':0x0,'rows':[]};var _0x6725de=_[_0xde7e('0x2d')](db[_0xde7e('0x2e')][_0xde7e('0x2f')],function(_0x4f3500){return{'name':_0x4f3500['fieldName'],'type':_0x4f3500['type']['key']};});_0x57850a[_0xde7e('0x30')]=_[_0xde7e('0x2d')](_0x6725de,_0xde7e('0x2a'));_0x57850a[_0xde7e('0x31')]=_[_0xde7e('0x32')](_0x1e4376[_0xde7e('0x31')]);_0x57850a[_0xde7e('0x33')]=_[_0xde7e('0x34')](_0x57850a['model'],_0x57850a[_0xde7e('0x31')]);_0x3e090c['attributes']=_[_0xde7e('0x34')](_0x57850a['model'],qs[_0xde7e('0x35')](_0x1e4376[_0xde7e('0x31')]['fields']));_0x3e090c['attributes']=_0x3e090c[_0xde7e('0x36')][_0xde7e('0x37')]?_0x3e090c['attributes']:_0x57850a['model'];if(!_0x1e4376['query'][_0xde7e('0x38')](_0xde7e('0x39'))){_0x3e090c[_0xde7e('0x1e')]=qs[_0xde7e('0x1e')](_0x1e4376[_0xde7e('0x31')][_0xde7e('0x1e')]);_0x3e090c[_0xde7e('0x1c')]=qs[_0xde7e('0x1c')](_0x1e4376['query'][_0xde7e('0x1c')]);}_0x3e090c[_0xde7e('0x3a')]=qs[_0xde7e('0x3b')](_0x1e4376[_0xde7e('0x31')][_0xde7e('0x3b')]);_0x3e090c[_0xde7e('0x3c')]=qs[_0xde7e('0x33')](_[_0xde7e('0x3d')](_0x1e4376[_0xde7e('0x31')],_0x57850a[_0xde7e('0x33')]),_0x6725de);if(_0x1e4376['query'][_0xde7e('0x3e')]){_0x3e090c[_0xde7e('0x3c')]=_[_0xde7e('0x3f')](_0x3e090c[_0xde7e('0x3c')],{'$or':[{'key':{'$like':'%'+_0x1e4376[_0xde7e('0x31')]['filter']+'%'}},{'value':{'$like':'%'+_0x1e4376[_0xde7e('0x31')][_0xde7e('0x3e')]+'%'}}]});}_0x3e090c=_['merge']({},_0x3e090c,_0x1e4376[_0xde7e('0x40')]);var _0x40a23e={'where':_0x3e090c[_0xde7e('0x3c')]};return db[_0xde7e('0x2e')][_0xde7e('0x1f')](_0x40a23e)[_0xde7e('0x24')](function(_0x21da83){_0x51c6ed[_0xde7e('0x1f')]=_0x21da83;if(_0x1e4376['query'][_0xde7e('0x41')]){_0x3e090c[_0xde7e('0x42')]=[{'all':!![]}];}return db[_0xde7e('0x2e')][_0xde7e('0x43')](_0x3e090c);})['then'](function(_0x3ea782){_0x51c6ed[_0xde7e('0x44')]=_0x3ea782;return _0x51c6ed;})[_0xde7e('0x24')](respondWithFilteredResult(_0x346a6f,_0x3e090c))[_0xde7e('0x45')](handleError(_0x346a6f,null));};exports[_0xde7e('0x46')]=function(_0x3c2c64,_0x2303a7){var _0x5c66b1={'raw':!![],'where':{'id':_0x3c2c64[_0xde7e('0x47')]['id']}},_0x13262d={};_0x13262d[_0xde7e('0x30')]=_[_0xde7e('0x32')](db[_0xde7e('0x2e')][_0xde7e('0x2f')]);_0x13262d[_0xde7e('0x31')]=_[_0xde7e('0x32')](_0x3c2c64[_0xde7e('0x31')]);_0x13262d[_0xde7e('0x33')]=_[_0xde7e('0x34')](_0x13262d[_0xde7e('0x30')],_0x13262d[_0xde7e('0x31')]);_0x5c66b1[_0xde7e('0x36')]=_[_0xde7e('0x34')](_0x13262d['model'],qs[_0xde7e('0x35')](_0x3c2c64[_0xde7e('0x31')][_0xde7e('0x35')]));_0x5c66b1[_0xde7e('0x36')]=_0x5c66b1['attributes'][_0xde7e('0x37')]?_0x5c66b1[_0xde7e('0x36')]:_0x13262d[_0xde7e('0x30')];if(_0x3c2c64[_0xde7e('0x31')][_0xde7e('0x41')]){_0x5c66b1[_0xde7e('0x42')]=[{'all':!![]}];}_0x5c66b1=_['merge']({},_0x5c66b1,_0x3c2c64[_0xde7e('0x40')]);return db['CannedAnswer']['find'](_0x5c66b1)[_0xde7e('0x24')](handleEntityNotFound(_0x2303a7,null))[_0xde7e('0x24')](respondWithResult(_0x2303a7,null))[_0xde7e('0x45')](handleError(_0x2303a7,null));};exports['update']=function(_0x5bfa69,_0x5986dd){if(_0x5bfa69[_0xde7e('0x48')]['id']){delete _0x5bfa69[_0xde7e('0x48')]['id'];}return db[_0xde7e('0x2e')][_0xde7e('0x49')]({'where':{'id':_0x5bfa69[_0xde7e('0x47')]['id']}})[_0xde7e('0x24')](handleEntityNotFound(_0x5986dd,null))[_0xde7e('0x24')](saveUpdates(_0x5bfa69['body'],null))[_0xde7e('0x24')](respondWithResult(_0x5986dd,null))[_0xde7e('0x45')](handleError(_0x5986dd,null));};exports['destroy']=function(_0x546fb1,_0x20323e){return db[_0xde7e('0x2e')]['find']({'where':{'id':_0x546fb1['params']['id']}})[_0xde7e('0x24')](handleEntityNotFound(_0x20323e,null))[_0xde7e('0x24')](removeEntity(_0x20323e,null))['catch'](handleError(_0x20323e,null));};exports[_0xde7e('0x4a')]=function(_0x20c011,_0x321491){var _0x570bee={'key':_0x20c011[_0xde7e('0x48')]['key']};if(_0x20c011[_0xde7e('0x48')][_0xde7e('0x4b')]){_0x570bee[_0xde7e('0x4b')]=_0x20c011[_0xde7e('0x48')]['MailAccountId'];}else if(_0x20c011[_0xde7e('0x48')]['SmsAccountId']){_0x570bee[_0xde7e('0x4c')]=_0x20c011['body']['SmsAccountId'];}else if(_0x20c011[_0xde7e('0x48')][_0xde7e('0x4d')]){_0x570bee['OpenchannelAccountId']=_0x20c011['body']['OpenchannelAccountId'];}else if(_0x20c011['body']['ChatWebsiteId']){_0x570bee[_0xde7e('0x4e')]=_0x20c011[_0xde7e('0x48')][_0xde7e('0x4e')];}return db[_0xde7e('0x2e')][_0xde7e('0x49')]({'where':_0x570bee})[_0xde7e('0x24')](function(_0x772409){if(_0x772409){throw new db[(_0xde7e('0x4f'))][(_0xde7e('0x50'))](_0xde7e('0x51'));}return db[_0xde7e('0x2e')][_0xde7e('0x4a')](_0x20c011[_0xde7e('0x48')]);})[_0xde7e('0x24')](function(_0x4cf632){var _0x398762=_0x20c011[_0xde7e('0x52')]['get']({'plain':!![]});if(!_0x398762)throw new Error(_0xde7e('0x53'));if(_0x398762[_0xde7e('0x54')]===_0xde7e('0x52')){var _0x3b14ce=_0x4cf632[_0xde7e('0x55')]({'plain':!![]});return db['UserProfileSection'][_0xde7e('0x49')]({'where':{'name':_0xde7e('0x26'),'userProfileId':_0x398762[_0xde7e('0x56')]},'raw':!![]})[_0xde7e('0x24')](function(_0x115798){if(_0x115798&&_0x115798['autoAssociation']===0x0){return db[_0xde7e('0x27')]['create']({'name':_0x3b14ce[_0xde7e('0x2a')],'resourceId':_0x3b14ce['id'],'type':_0x115798[_0xde7e('0x2a')],'sectionId':_0x115798['id']},{})['then'](function(){return _0x4cf632;});}else{return _0x4cf632;}})[_0xde7e('0x45')](function(_0x396ac2){logger[_0xde7e('0x28')](_0xde7e('0x57'),_0x396ac2);throw _0x396ac2;});}return _0x4cf632;})[_0xde7e('0x24')](respondWithResult(_0x321491,0xc9))[_0xde7e('0x45')](handleError(_0x321491,null));}; \ No newline at end of file +var _0x9bcf=['name','index','map','CannedAnswer','rawAttributes','fieldName','type','query','keys','filters','model','fields','attributes','hasOwnProperty','order','sort','filter','where','merge','options','includeAll','findAll','rows','catch','show','params','intersection','length','include','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','end','error','stack'];(function(_0x9d3f71,_0x2111e0){var _0x4e692c=function(_0x48508f){while(--_0x48508f){_0x9d3f71['push'](_0x9d3f71['shift']());}};_0x4e692c(++_0x2111e0);}(_0x9bcf,0x12d));var _0xf9bc=function(_0x3bfdcd,_0x3e260e){_0x3bfdcd=_0x3bfdcd-0x0;var _0x1089ae=_0x9bcf[_0x3bfdcd];return _0x1089ae;};'use strict';var emlformat=require(_0xf9bc('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf9bc('0x1'));var moment=require(_0xf9bc('0x2'));var BPromise=require(_0xf9bc('0x3'));var Mustache=require('mustache');var util=require(_0xf9bc('0x4'));var path=require(_0xf9bc('0x5'));var sox=require('sox');var csv=require(_0xf9bc('0x6'));var ejs=require(_0xf9bc('0x7'));var fs=require('fs');var fs_extra=require(_0xf9bc('0x8'));var _=require(_0xf9bc('0x9'));var squel=require(_0xf9bc('0xa'));var crypto=require(_0xf9bc('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf9bc('0x6'));var querystring=require(_0xf9bc('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf9bc('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xf9bc('0xe'));var hardwareService=require(_0xf9bc('0xf'));var logger=require(_0xf9bc('0x10'))(_0xf9bc('0x11'));var utils=require(_0xf9bc('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xf9bc('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1458b8,_0x557256){_0x557256=_0x557256||0xcc;return function(_0x536dbe){if(_0x536dbe){return _0x1458b8[_0xf9bc('0x14')](_0x557256);}return _0x1458b8[_0xf9bc('0x15')](_0x557256)['end']();};}function respondWithResult(_0x1d5813,_0x50788d){_0x50788d=_0x50788d||0xc8;return function(_0x170d8e){if(_0x170d8e){return _0x1d5813['status'](_0x50788d)[_0xf9bc('0x16')](_0x170d8e);}};}function respondWithFilteredResult(_0x5cae6b,_0x205606){return function(_0x271167){if(_0x271167){var _0x24f081=typeof _0x205606[_0xf9bc('0x17')]===_0xf9bc('0x18')&&typeof _0x205606[_0xf9bc('0x19')]===_0xf9bc('0x18');var _0x3ddefb=_0x271167['count'];var _0x17963e=_0x24f081?0x0:_0x205606[_0xf9bc('0x17')];var _0x1e68f6=_0x24f081?_0x271167[_0xf9bc('0x1a')]:_0x205606[_0xf9bc('0x17')]+_0x205606[_0xf9bc('0x19')];var _0x5859b7;if(_0x1e68f6>=_0x3ddefb){_0x1e68f6=_0x3ddefb;_0x5859b7=0xc8;}else{_0x5859b7=0xce;}_0x5cae6b['status'](_0x5859b7);return _0x5cae6b[_0xf9bc('0x1b')](_0xf9bc('0x1c'),_0x17963e+'-'+_0x1e68f6+'/'+_0x3ddefb)[_0xf9bc('0x16')](_0x271167);}return null;};}function patchUpdates(_0x58985e){return function(_0x60a3ce){try{jsonpatch[_0xf9bc('0x1d')](_0x60a3ce,_0x58985e,!![]);}catch(_0xb2fdc8){return BPromise['reject'](_0xb2fdc8);}return _0x60a3ce[_0xf9bc('0x1e')]();};}function saveUpdates(_0xa934bc,_0x5d353b){return function(_0x271bfc){if(_0x271bfc){return _0x271bfc[_0xf9bc('0x1f')](_0xa934bc)[_0xf9bc('0x20')](function(_0x369990){return _0x369990;});}return null;};}function removeEntity(_0x4effce,_0x2ecec0){return function(_0x36d60b){if(_0x36d60b){return _0x36d60b[_0xf9bc('0x21')]()[_0xf9bc('0x20')](function(){var _0x421cdf=_0x36d60b[_0xf9bc('0x22')]({'plain':!![]});var _0x5d07b9='CannedAnswers';return db[_0xf9bc('0x23')][_0xf9bc('0x21')]({'where':{'type':_0x5d07b9,'resourceId':_0x421cdf['id']}})[_0xf9bc('0x20')](function(){return _0x36d60b;});})[_0xf9bc('0x20')](function(){_0x4effce['status'](0xcc)[_0xf9bc('0x24')]();});}};}function handleEntityNotFound(_0x3512a2,_0xaafe5a){return function(_0x3b7fb7){if(!_0x3b7fb7){_0x3512a2[_0xf9bc('0x14')](0x194);}return _0x3b7fb7;};}function handleError(_0x847e2d,_0x30dc11){_0x30dc11=_0x30dc11||0x1f4;return function(_0x27df31){logger[_0xf9bc('0x25')](_0x27df31[_0xf9bc('0x26')]);if(_0x27df31[_0xf9bc('0x27')]){delete _0x27df31[_0xf9bc('0x27')];}_0x847e2d[_0xf9bc('0x15')](_0x30dc11)['send'](_0x27df31);};}exports[_0xf9bc('0x28')]=function(_0x591276,_0x41773a){var _0x3c286c={},_0x5598d5={},_0x2a53a8={'count':0x0,'rows':[]};var _0x4b5f4a=_[_0xf9bc('0x29')](db[_0xf9bc('0x2a')][_0xf9bc('0x2b')],function(_0x741ba6){return{'name':_0x741ba6[_0xf9bc('0x2c')],'type':_0x741ba6[_0xf9bc('0x2d')]['key']};});_0x5598d5['model']=_[_0xf9bc('0x29')](_0x4b5f4a,'name');_0x5598d5[_0xf9bc('0x2e')]=_[_0xf9bc('0x2f')](_0x591276[_0xf9bc('0x2e')]);_0x5598d5[_0xf9bc('0x30')]=_['intersection'](_0x5598d5[_0xf9bc('0x31')],_0x5598d5[_0xf9bc('0x2e')]);_0x3c286c['attributes']=_['intersection'](_0x5598d5[_0xf9bc('0x31')],qs[_0xf9bc('0x32')](_0x591276[_0xf9bc('0x2e')]['fields']));_0x3c286c['attributes']=_0x3c286c[_0xf9bc('0x33')]['length']?_0x3c286c[_0xf9bc('0x33')]:_0x5598d5['model'];if(!_0x591276[_0xf9bc('0x2e')][_0xf9bc('0x34')]('nolimit')){_0x3c286c[_0xf9bc('0x19')]=qs[_0xf9bc('0x19')](_0x591276[_0xf9bc('0x2e')]['limit']);_0x3c286c['offset']=qs[_0xf9bc('0x17')](_0x591276['query'][_0xf9bc('0x17')]);}_0x3c286c[_0xf9bc('0x35')]=qs[_0xf9bc('0x36')](_0x591276[_0xf9bc('0x2e')][_0xf9bc('0x36')]);_0x3c286c['where']=qs[_0xf9bc('0x30')](_['pick'](_0x591276[_0xf9bc('0x2e')],_0x5598d5['filters']),_0x4b5f4a);if(_0x591276[_0xf9bc('0x2e')][_0xf9bc('0x37')]){_0x3c286c[_0xf9bc('0x38')]=_[_0xf9bc('0x39')](_0x3c286c['where'],{'$or':[{'key':{'$like':'%'+_0x591276[_0xf9bc('0x2e')][_0xf9bc('0x37')]+'%'}},{'value':{'$like':'%'+_0x591276[_0xf9bc('0x2e')][_0xf9bc('0x37')]+'%'}}]});}_0x3c286c=_[_0xf9bc('0x39')]({},_0x3c286c,_0x591276[_0xf9bc('0x3a')]);var _0x9396af={'where':_0x3c286c[_0xf9bc('0x38')]};return db[_0xf9bc('0x2a')]['count'](_0x9396af)['then'](function(_0x2c7640){_0x2a53a8[_0xf9bc('0x1a')]=_0x2c7640;if(_0x591276['query'][_0xf9bc('0x3b')]){_0x3c286c['include']=[{'all':!![]}];}return db[_0xf9bc('0x2a')][_0xf9bc('0x3c')](_0x3c286c);})[_0xf9bc('0x20')](function(_0x3d4ec7){_0x2a53a8[_0xf9bc('0x3d')]=_0x3d4ec7;return _0x2a53a8;})[_0xf9bc('0x20')](respondWithFilteredResult(_0x41773a,_0x3c286c))[_0xf9bc('0x3e')](handleError(_0x41773a,null));};exports[_0xf9bc('0x3f')]=function(_0x44e473,_0x5ec570){var _0x4295c0={'raw':!![],'where':{'id':_0x44e473[_0xf9bc('0x40')]['id']}},_0x359d78={};_0x359d78[_0xf9bc('0x31')]=_[_0xf9bc('0x2f')](db['CannedAnswer'][_0xf9bc('0x2b')]);_0x359d78[_0xf9bc('0x2e')]=_[_0xf9bc('0x2f')](_0x44e473[_0xf9bc('0x2e')]);_0x359d78[_0xf9bc('0x30')]=_[_0xf9bc('0x41')](_0x359d78[_0xf9bc('0x31')],_0x359d78[_0xf9bc('0x2e')]);_0x4295c0[_0xf9bc('0x33')]=_[_0xf9bc('0x41')](_0x359d78[_0xf9bc('0x31')],qs[_0xf9bc('0x32')](_0x44e473[_0xf9bc('0x2e')][_0xf9bc('0x32')]));_0x4295c0[_0xf9bc('0x33')]=_0x4295c0[_0xf9bc('0x33')][_0xf9bc('0x42')]?_0x4295c0['attributes']:_0x359d78[_0xf9bc('0x31')];if(_0x44e473['query']['includeAll']){_0x4295c0[_0xf9bc('0x43')]=[{'all':!![]}];}_0x4295c0=_[_0xf9bc('0x39')]({},_0x4295c0,_0x44e473[_0xf9bc('0x3a')]);return db[_0xf9bc('0x2a')][_0xf9bc('0x44')](_0x4295c0)['then'](handleEntityNotFound(_0x5ec570,null))[_0xf9bc('0x20')](respondWithResult(_0x5ec570,null))[_0xf9bc('0x3e')](handleError(_0x5ec570,null));};exports[_0xf9bc('0x1f')]=function(_0x11e849,_0x3810eb){if(_0x11e849[_0xf9bc('0x45')]['id']){delete _0x11e849[_0xf9bc('0x45')]['id'];}return db[_0xf9bc('0x2a')][_0xf9bc('0x44')]({'where':{'id':_0x11e849[_0xf9bc('0x40')]['id']}})[_0xf9bc('0x20')](handleEntityNotFound(_0x3810eb,null))[_0xf9bc('0x20')](saveUpdates(_0x11e849['body'],null))[_0xf9bc('0x20')](respondWithResult(_0x3810eb,null))[_0xf9bc('0x3e')](handleError(_0x3810eb,null));};exports[_0xf9bc('0x21')]=function(_0x3e58cc,_0x234b42){return db[_0xf9bc('0x2a')][_0xf9bc('0x44')]({'where':{'id':_0x3e58cc[_0xf9bc('0x40')]['id']}})['then'](handleEntityNotFound(_0x234b42,null))['then'](removeEntity(_0x234b42,null))['catch'](handleError(_0x234b42,null));};exports[_0xf9bc('0x46')]=function(_0x23d929,_0x28b021){var _0xd1cd58={'key':_0x23d929[_0xf9bc('0x45')]['key']};if(_0x23d929[_0xf9bc('0x45')][_0xf9bc('0x47')]){_0xd1cd58[_0xf9bc('0x47')]=_0x23d929[_0xf9bc('0x45')][_0xf9bc('0x47')];}else if(_0x23d929['body'][_0xf9bc('0x48')]){_0xd1cd58[_0xf9bc('0x48')]=_0x23d929[_0xf9bc('0x45')][_0xf9bc('0x48')];}else if(_0x23d929['body']['OpenchannelAccountId']){_0xd1cd58[_0xf9bc('0x49')]=_0x23d929[_0xf9bc('0x45')][_0xf9bc('0x49')];}else if(_0x23d929[_0xf9bc('0x45')][_0xf9bc('0x4a')]){_0xd1cd58[_0xf9bc('0x4a')]=_0x23d929[_0xf9bc('0x45')][_0xf9bc('0x4a')];}return db[_0xf9bc('0x2a')]['find']({'where':_0xd1cd58})[_0xf9bc('0x20')](function(_0x3f792b){if(_0x3f792b){throw new db[(_0xf9bc('0x4b'))][(_0xf9bc('0x4c'))](_0xf9bc('0x4d'));}return db[_0xf9bc('0x2a')][_0xf9bc('0x46')](_0x23d929['body']);})[_0xf9bc('0x20')](function(_0x4c5ab5){var _0x1e6712=_0x23d929['user']['get']({'plain':!![]});if(!_0x1e6712)throw new Error(_0xf9bc('0x4e'));if(_0x1e6712[_0xf9bc('0x4f')]===_0xf9bc('0x50')){var _0x47d6db=_0x4c5ab5[_0xf9bc('0x22')]({'plain':!![]});return db[_0xf9bc('0x51')]['find']({'where':{'name':'CannedAnswers','userProfileId':_0x1e6712[_0xf9bc('0x52')]},'raw':!![]})[_0xf9bc('0x20')](function(_0x30e40b){if(_0x30e40b&&_0x30e40b[_0xf9bc('0x53')]===0x0){return db[_0xf9bc('0x23')][_0xf9bc('0x46')]({'name':_0x47d6db[_0xf9bc('0x27')],'resourceId':_0x47d6db['id'],'type':_0x30e40b[_0xf9bc('0x27')],'sectionId':_0x30e40b['id']},{})[_0xf9bc('0x20')](function(){return _0x4c5ab5;});}else{return _0x4c5ab5;}})['catch'](function(_0x575573){logger[_0xf9bc('0x25')](_0xf9bc('0x54'),_0x575573);throw _0x575573;});}return _0x4c5ab5;})[_0xf9bc('0x20')](respondWithResult(_0x28b021,0xc9))[_0xf9bc('0x3e')](handleError(_0x28b021,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 193a1ce..59104bc 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 _0x9a48=['lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./cannedAnswer.attributes','exports','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci'];(function(_0x38b14f,_0xd08fa8){var _0x22a324=function(_0x4bbb05){while(--_0x4bbb05){_0x38b14f['push'](_0x38b14f['shift']());}};_0x22a324(++_0xd08fa8);}(_0x9a48,0xc3));var _0x89a4=function(_0x22d7bb,_0x4c158e){_0x22d7bb=_0x22d7bb-0x0;var _0x40a737=_0x9a48[_0x22d7bb];return _0x40a737;};'use strict';var _=require(_0x89a4('0x0'));var util=require(_0x89a4('0x1'));var logger=require(_0x89a4('0x2'))(_0x89a4('0x3'));var moment=require('moment');var BPromise=require(_0x89a4('0x4'));var rp=require(_0x89a4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x89a4('0x6'));var config=require(_0x89a4('0x7'));var attributes=require(_0x89a4('0x8'));module[_0x89a4('0x9')]=function(_0x298135,_0x58c536){return _0x298135['define'](_0x89a4('0xa'),attributes,{'tableName':_0x89a4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x89a4('0xc')});}; \ No newline at end of file +var _0xca0a=['../../config/environment','./cannedAnswer.attributes','exports','CannedAnswer','tools_canned_answers','lodash','api','moment','request-promise','path'];(function(_0x592774,_0x19f692){var _0x2ba6fb=function(_0x5f5849){while(--_0x5f5849){_0x592774['push'](_0x592774['shift']());}};_0x2ba6fb(++_0x19f692);}(_0xca0a,0xf5));var _0xaca0=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0xca0a[_0xd1d19a];return _0x52a79d;};'use strict';var _=require(_0xaca0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xaca0('0x1'));var moment=require(_0xaca0('0x2'));var BPromise=require('bluebird');var rp=require(_0xaca0('0x3'));var fs=require('fs');var path=require(_0xaca0('0x4'));var rimraf=require('rimraf');var config=require(_0xaca0('0x5'));var attributes=require(_0xaca0('0x6'));module[_0xaca0('0x7')]=function(_0x56541f,_0x1f8510){return _0x56541f['define'](_0xaca0('0x8'),attributes,{'tableName':_0xaca0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 5c774a4..1e9757c 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(_0x3e1cdd,_0x4388c5){var _0x2318a3=function(_0x230693){while(--_0x230693){_0x3e1cdd['push'](_0x3e1cdd['shift']());}};_0x2318a3(++_0x4388c5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0xa9e0=['http','info','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(_0x59a7b7,_0x4d5f8d){var _0x167fc1=function(_0x58ac5a){while(--_0x58ac5a){_0x59a7b7['push'](_0x59a7b7['shift']());}};_0x167fc1(++_0x4d5f8d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'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 a659972..4e70c9a 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 _0xb407=['delete','/:id','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','isAuthenticated','index','get','show','create','put','update'];(function(_0xb1cf84,_0x813740){var _0x4bad2e=function(_0x53e6f2){while(--_0x53e6f2){_0xb1cf84['push'](_0xb1cf84['shift']());}};_0x4bad2e(++_0x813740);}(_0xb407,0x122));var _0x7b40=function(_0x49927a,_0x41f965){_0x49927a=_0x49927a-0x0;var _0x3692cb=_0xb407[_0x49927a];return _0x3692cb;};'use strict';var multer=require(_0x7b40('0x0'));var util=require(_0x7b40('0x1'));var path=require('path');var timeout=require(_0x7b40('0x2'));var express=require(_0x7b40('0x3'));var router=express['Router']();var fs_extra=require(_0x7b40('0x4'));var auth=require(_0x7b40('0x5'));var interaction=require(_0x7b40('0x6'));var config=require(_0x7b40('0x7'));var controller=require(_0x7b40('0x8'));router['get']('/',auth[_0x7b40('0x9')](),controller[_0x7b40('0xa')]);router[_0x7b40('0xb')]('/:id',auth[_0x7b40('0x9')](),controller[_0x7b40('0xc')]);router['post']('/',auth[_0x7b40('0x9')](),controller[_0x7b40('0xd')]);router[_0x7b40('0xe')]('/:id',auth[_0x7b40('0x9')](),controller[_0x7b40('0xf')]);router[_0x7b40('0x10')](_0x7b40('0x11'),auth[_0x7b40('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xe1dd=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','post','create','put','update','/:id','destroy','exports'];(function(_0xfc4ee7,_0x89427a){var _0x22dd89=function(_0xe01e3b){while(--_0xe01e3b){_0xfc4ee7['push'](_0xfc4ee7['shift']());}};_0x22dd89(++_0x89427a);}(_0xe1dd,0x1c2));var _0xde1d=function(_0x287bd5,_0x47a4eb){_0x287bd5=_0x287bd5-0x0;var _0x4b1605=_0xe1dd[_0x287bd5];return _0x4b1605;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xde1d('0x0'));var timeout=require(_0xde1d('0x1'));var express=require(_0xde1d('0x2'));var router=express[_0xde1d('0x3')]();var fs_extra=require(_0xde1d('0x4'));var auth=require(_0xde1d('0x5'));var interaction=require(_0xde1d('0x6'));var config=require(_0xde1d('0x7'));var controller=require('./cannedAnswer.controller');router[_0xde1d('0x8')]('/',auth[_0xde1d('0x9')](),controller[_0xde1d('0xa')]);router[_0xde1d('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xde1d('0xb')]('/',auth[_0xde1d('0x9')](),controller[_0xde1d('0xc')]);router[_0xde1d('0xd')]('/:id',auth[_0xde1d('0x9')](),controller[_0xde1d('0xe')]);router['delete'](_0xde1d('0xf'),auth[_0xde1d('0x9')](),controller[_0xde1d('0x10')]);module[_0xde1d('0x11')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index b0044e3..4973b82 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 _0x475d=['sequelize','exports','STRING','INTEGER'];(function(_0x1884c3,_0x3db8ba){var _0x2ccfb6=function(_0xf87f32){while(--_0xf87f32){_0x1884c3['push'](_0x1884c3['shift']());}};_0x2ccfb6(++_0x3db8ba);}(_0x475d,0x110));var _0xd475=function(_0x912d27,_0x28e0e3){_0x912d27=_0x912d27-0x0;var _0x31b918=_0x475d[_0x912d27];return _0x31b918;};'use strict';var Sequelize=require(_0xd475('0x0'));module[_0xd475('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0xd475('0x2')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0xd475('0x2')]},'channel':{'type':Sequelize[_0xd475('0x2')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0xd475('0x2')]},'lastdata':{'type':Sequelize[_0xd475('0x2')]},'duration':{'type':Sequelize[_0xd475('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xd475('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xd475('0x2')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xd475('0x2')]},'uniqueid':{'type':Sequelize[_0xd475('0x2')]},'linkedid':{'type':Sequelize[_0xd475('0x2')]},'sequence':{'type':Sequelize[_0xd475('0x2')]},'peeraccount':{'type':Sequelize[_0xd475('0x2')]},'type':{'type':Sequelize[_0xd475('0x2')]},'tag':{'type':Sequelize[_0xd475('0x2')]}}; \ No newline at end of file +var _0x7b37=['STRING','INTEGER','sequelize','exports','1970-01-01\x2000:00:01'];(function(_0x1d1a9c,_0x2274db){var _0x3e0c65=function(_0x2c41c5){while(--_0x2c41c5){_0x1d1a9c['push'](_0x1d1a9c['shift']());}};_0x3e0c65(++_0x2274db);}(_0x7b37,0xd9));var _0x77b3=function(_0x4112f5,_0x304bfe){_0x4112f5=_0x4112f5-0x0;var _0x44b7e6=_0x7b37[_0x4112f5];return _0x44b7e6;};'use strict';var Sequelize=require(_0x77b3('0x0'));module[_0x77b3('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x77b3('0x2')},'clid':{'type':Sequelize[_0x77b3('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x77b3('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x77b3('0x3')]},'dstchannel':{'type':Sequelize[_0x77b3('0x3')]},'lastapp':{'type':Sequelize[_0x77b3('0x3')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x77b3('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x77b3('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x77b3('0x3')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x77b3('0x3')]},'linkedid':{'type':Sequelize[_0x77b3('0x3')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x77b3('0x3')]},'type':{'type':Sequelize[_0x77b3('0x3')]},'tag':{'type':Sequelize[_0x77b3('0x3')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 3f03c44..eca32d4 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 _0x24ca=['squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','destroy','then','error','send','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','name','merge','options','includeAll','include','findAll','show','params','length','find','catch','create','update','body','describe','eml-format','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv'];(function(_0x28ddbc,_0x22c1ac){var _0x320180=function(_0x196fdb){while(--_0x196fdb){_0x28ddbc['push'](_0x28ddbc['shift']());}};_0x320180(++_0x22c1ac);}(_0x24ca,0x8c));var _0xa24c=function(_0x506d2f,_0x5ab76e){_0x506d2f=_0x506d2f-0x0;var _0x101255=_0x24ca[_0x506d2f];return _0x101255;};'use strict';var emlformat=require(_0xa24c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa24c('0x1'));var rp=require('request-promise');var moment=require(_0xa24c('0x2'));var BPromise=require(_0xa24c('0x3'));var Mustache=require(_0xa24c('0x4'));var util=require('util');var path=require(_0xa24c('0x5'));var sox=require(_0xa24c('0x6'));var csv=require(_0xa24c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa24c('0x8'));var crypto=require(_0xa24c('0x9'));var jsforce=require(_0xa24c('0xa'));var deskjs=require(_0xa24c('0xb'));var toCsv=require(_0xa24c('0x7'));var querystring=require(_0xa24c('0xc'));var Papa=require('papaparse');var Redis=require(_0xa24c('0xd'));var authService=require(_0xa24c('0xe'));var qs=require(_0xa24c('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa24c('0x10'))(_0xa24c('0x11'));var utils=require(_0xa24c('0x12'));var config=require(_0xa24c('0x13'));var licenseUtil=require(_0xa24c('0x14'));var db=require(_0xa24c('0x15'))['db'];function respondWithStatusCode(_0x566313,_0x5bb631){_0x5bb631=_0x5bb631||0xcc;return function(_0x4907f6){if(_0x4907f6){return _0x566313[_0xa24c('0x16')](_0x5bb631);}return _0x566313[_0xa24c('0x17')](_0x5bb631)[_0xa24c('0x18')]();};}function respondWithResult(_0x9fe9e3,_0x4351a8){_0x4351a8=_0x4351a8||0xc8;return function(_0x4971af){if(_0x4971af){return _0x9fe9e3[_0xa24c('0x17')](_0x4351a8)['json'](_0x4971af);}};}function respondWithFilteredResult(_0x493bcb,_0x588acf){return function(_0x2e8dc9){if(_0x2e8dc9){var _0x2a4270=typeof _0x588acf[_0xa24c('0x19')]===_0xa24c('0x1a')&&typeof _0x588acf[_0xa24c('0x1b')]===_0xa24c('0x1a');var _0x2197da=_0x2e8dc9[_0xa24c('0x1c')];var _0x14f0aa=_0x2a4270?0x0:_0x588acf[_0xa24c('0x19')];var _0x1970fc=_0x2a4270?_0x2e8dc9[_0xa24c('0x1c')]:_0x588acf[_0xa24c('0x19')]+_0x588acf[_0xa24c('0x1b')];var _0x5276b6;if(_0x1970fc>=_0x2197da){_0x1970fc=_0x2197da;_0x5276b6=0xc8;}else{_0x5276b6=0xce;}_0x493bcb[_0xa24c('0x17')](_0x5276b6);return _0x493bcb['set'](_0xa24c('0x1d'),_0x14f0aa+'-'+_0x1970fc+'/'+_0x2197da)[_0xa24c('0x1e')](_0x2e8dc9);}return null;};}function patchUpdates(_0x8c3949){return function(_0x37e20e){try{jsonpatch[_0xa24c('0x1f')](_0x37e20e,_0x8c3949,!![]);}catch(_0x416dea){return BPromise[_0xa24c('0x20')](_0x416dea);}return _0x37e20e[_0xa24c('0x21')]();};}function saveUpdates(_0xba710,_0x2ec5ad){return function(_0x2b471a){if(_0x2b471a){return _0x2b471a['update'](_0xba710)['then'](function(_0x10fa25){return _0x10fa25;});}return null;};}function removeEntity(_0xdd32a8,_0x316a68){return function(_0x1a04ff){if(_0x1a04ff){return _0x1a04ff[_0xa24c('0x22')]()[_0xa24c('0x23')](function(){_0xdd32a8[_0xa24c('0x17')](0xcc)[_0xa24c('0x18')]();});}};}function handleEntityNotFound(_0x304d6c,_0x4dc3dc){return function(_0x2290e1){if(!_0x2290e1){_0x304d6c['sendStatus'](0x194);}return _0x2290e1;};}function handleError(_0x1f347b,_0x256fbc){_0x256fbc=_0x256fbc||0x1f4;return function(_0x471421){logger[_0xa24c('0x24')](_0x471421['stack']);if(_0x471421['name']){delete _0x471421['name'];}_0x1f347b['status'](_0x256fbc)[_0xa24c('0x25')](_0x471421);};}exports[_0xa24c('0x26')]=function(_0xab6197,_0x1cdee4){var _0x37cbd3={},_0x5361d4={},_0x5c8113={'count':0x0,'rows':[]};var _0x33c208=_[_0xa24c('0x27')](db[_0xa24c('0x28')][_0xa24c('0x29')],function(_0x4566dc){return{'name':_0x4566dc[_0xa24c('0x2a')],'type':_0x4566dc[_0xa24c('0x2b')][_0xa24c('0x2c')]};});_0x5361d4[_0xa24c('0x2d')]=_[_0xa24c('0x27')](_0x33c208,'name');_0x5361d4[_0xa24c('0x2e')]=_[_0xa24c('0x2f')](_0xab6197['query']);_0x5361d4[_0xa24c('0x30')]=_[_0xa24c('0x31')](_0x5361d4[_0xa24c('0x2d')],_0x5361d4[_0xa24c('0x2e')]);_0x37cbd3[_0xa24c('0x32')]=_[_0xa24c('0x31')](_0x5361d4[_0xa24c('0x2d')],qs[_0xa24c('0x33')](_0xab6197[_0xa24c('0x2e')][_0xa24c('0x33')]));_0x37cbd3['attributes']=_0x37cbd3['attributes']['length']?_0x37cbd3[_0xa24c('0x32')]:_0x5361d4['model'];if(!_0xab6197[_0xa24c('0x2e')][_0xa24c('0x34')](_0xa24c('0x35'))){_0x37cbd3['limit']=qs[_0xa24c('0x1b')](_0xab6197[_0xa24c('0x2e')][_0xa24c('0x1b')]);_0x37cbd3['offset']=qs[_0xa24c('0x19')](_0xab6197[_0xa24c('0x2e')]['offset']);}_0x37cbd3[_0xa24c('0x36')]=qs[_0xa24c('0x37')](_0xab6197[_0xa24c('0x2e')]['sort']);_0x37cbd3[_0xa24c('0x38')]=qs[_0xa24c('0x30')](_[_0xa24c('0x39')](_0xab6197[_0xa24c('0x2e')],_0x5361d4[_0xa24c('0x30')]),_0x33c208);if(_0xab6197['query'][_0xa24c('0x3a')]){_0x37cbd3[_0xa24c('0x38')]=_['merge'](_0x37cbd3[_0xa24c('0x38')],{'$or':_[_0xa24c('0x27')](_0x33c208,function(_0x2417d9){if(_0x2417d9['type']!=='VIRTUAL'){var _0x1f7535={};_0x1f7535[_0x2417d9[_0xa24c('0x3b')]]={'$like':'%'+_0xab6197[_0xa24c('0x2e')][_0xa24c('0x3a')]+'%'};return _0x1f7535;}})});}_0x37cbd3=_[_0xa24c('0x3c')]({},_0x37cbd3,_0xab6197[_0xa24c('0x3d')]);var _0x54ea40={'where':_0x37cbd3[_0xa24c('0x38')]};return db[_0xa24c('0x28')][_0xa24c('0x1c')](_0x54ea40)[_0xa24c('0x23')](function(_0x5f3cd4){_0x5c8113[_0xa24c('0x1c')]=_0x5f3cd4;if(_0xab6197[_0xa24c('0x2e')][_0xa24c('0x3e')]){_0x37cbd3[_0xa24c('0x3f')]=[{'all':!![]}];}return db[_0xa24c('0x28')][_0xa24c('0x40')](_0x37cbd3);})[_0xa24c('0x23')](function(_0x54939b){_0x5c8113['rows']=_0x54939b;return _0x5c8113;})[_0xa24c('0x23')](respondWithFilteredResult(_0x1cdee4,_0x37cbd3))['catch'](handleError(_0x1cdee4,null));};exports[_0xa24c('0x41')]=function(_0x4fae76,_0x32e151){var _0x214627={'raw':!![],'where':{'id':_0x4fae76[_0xa24c('0x42')]['id']}},_0x37372d={};_0x37372d[_0xa24c('0x2d')]=_[_0xa24c('0x2f')](db[_0xa24c('0x28')][_0xa24c('0x29')]);_0x37372d[_0xa24c('0x2e')]=_[_0xa24c('0x2f')](_0x4fae76[_0xa24c('0x2e')]);_0x37372d[_0xa24c('0x30')]=_[_0xa24c('0x31')](_0x37372d[_0xa24c('0x2d')],_0x37372d[_0xa24c('0x2e')]);_0x214627[_0xa24c('0x32')]=_['intersection'](_0x37372d[_0xa24c('0x2d')],qs[_0xa24c('0x33')](_0x4fae76[_0xa24c('0x2e')]['fields']));_0x214627[_0xa24c('0x32')]=_0x214627[_0xa24c('0x32')][_0xa24c('0x43')]?_0x214627[_0xa24c('0x32')]:_0x37372d['model'];if(_0x4fae76[_0xa24c('0x2e')][_0xa24c('0x3e')]){_0x214627[_0xa24c('0x3f')]=[{'all':!![]}];}_0x214627=_[_0xa24c('0x3c')]({},_0x214627,_0x4fae76[_0xa24c('0x3d')]);return db[_0xa24c('0x28')][_0xa24c('0x44')](_0x214627)[_0xa24c('0x23')](handleEntityNotFound(_0x32e151,null))[_0xa24c('0x23')](respondWithResult(_0x32e151,null))[_0xa24c('0x45')](handleError(_0x32e151,null));};exports[_0xa24c('0x46')]=function(_0xeac74f,_0x261c41){return db['Cdr'][_0xa24c('0x46')](_0xeac74f['body'],{})[_0xa24c('0x23')](respondWithResult(_0x261c41,0xc9))[_0xa24c('0x45')](handleError(_0x261c41,null));};exports[_0xa24c('0x47')]=function(_0x1641b8,_0xd4761e){if(_0x1641b8[_0xa24c('0x48')]['id']){delete _0x1641b8[_0xa24c('0x48')]['id'];}return db[_0xa24c('0x28')][_0xa24c('0x44')]({'where':{'id':_0x1641b8[_0xa24c('0x42')]['id']}})[_0xa24c('0x23')](handleEntityNotFound(_0xd4761e,null))[_0xa24c('0x23')](saveUpdates(_0x1641b8[_0xa24c('0x48')],null))['then'](respondWithResult(_0xd4761e,null))[_0xa24c('0x45')](handleError(_0xd4761e,null));};exports[_0xa24c('0x22')]=function(_0x3875fb,_0x456181){return db['Cdr'][_0xa24c('0x44')]({'where':{'id':_0x3875fb[_0xa24c('0x42')]['id']}})[_0xa24c('0x23')](handleEntityNotFound(_0x456181,null))['then'](removeEntity(_0x456181,null))['catch'](handleError(_0x456181,null));};exports[_0xa24c('0x49')]=function(_0x1c8980,_0x4992ee){return db[_0xa24c('0x28')][_0xa24c('0x49')]()['then'](respondWithResult(_0x4992ee,null))[_0xa24c('0x45')](handleError(_0x4992ee,null));}; \ No newline at end of file +var _0xae30=['offset','apply','reject','end','sendStatus','error','name','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','findAll','then','rows','catch','show','params','includeAll','include','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','status','json','undefined','limit','count'];(function(_0x470b0a,_0x2889d6){var _0x4463f6=function(_0x2b5f0e){while(--_0x2b5f0e){_0x470b0a['push'](_0x470b0a['shift']());}};_0x4463f6(++_0x2889d6);}(_0xae30,0x10a));var _0x0ae3=function(_0x2c2f35,_0x20cda1){_0x2c2f35=_0x2c2f35-0x0;var _0x543b7e=_0xae30[_0x2c2f35];return _0x543b7e;};'use strict';var emlformat=require(_0x0ae3('0x0'));var rimraf=require(_0x0ae3('0x1'));var zipdir=require(_0x0ae3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0ae3('0x3'));var moment=require(_0x0ae3('0x4'));var BPromise=require(_0x0ae3('0x5'));var Mustache=require(_0x0ae3('0x6'));var util=require('util');var path=require(_0x0ae3('0x7'));var sox=require(_0x0ae3('0x8'));var csv=require(_0x0ae3('0x9'));var ejs=require(_0x0ae3('0xa'));var fs=require('fs');var fs_extra=require(_0x0ae3('0xb'));var _=require(_0x0ae3('0xc'));var squel=require(_0x0ae3('0xd'));var crypto=require(_0x0ae3('0xe'));var jsforce=require(_0x0ae3('0xf'));var deskjs=require(_0x0ae3('0x10'));var toCsv=require(_0x0ae3('0x9'));var querystring=require(_0x0ae3('0x11'));var Papa=require(_0x0ae3('0x12'));var Redis=require('ioredis');var authService=require(_0x0ae3('0x13'));var qs=require(_0x0ae3('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0ae3('0x15'))(_0x0ae3('0x16'));var utils=require(_0x0ae3('0x17'));var config=require(_0x0ae3('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x245ac0,_0x45242d){_0x45242d=_0x45242d||0xcc;return function(_0x50cee6){if(_0x50cee6){return _0x245ac0['sendStatus'](_0x45242d);}return _0x245ac0[_0x0ae3('0x19')](_0x45242d)['end']();};}function respondWithResult(_0x1b1e46,_0x450000){_0x450000=_0x450000||0xc8;return function(_0x1a6c69){if(_0x1a6c69){return _0x1b1e46[_0x0ae3('0x19')](_0x450000)[_0x0ae3('0x1a')](_0x1a6c69);}};}function respondWithFilteredResult(_0x1600bc,_0x28b547){return function(_0x5af348){if(_0x5af348){var _0x17f280=typeof _0x28b547['offset']===_0x0ae3('0x1b')&&typeof _0x28b547[_0x0ae3('0x1c')]===_0x0ae3('0x1b');var _0x59d0de=_0x5af348[_0x0ae3('0x1d')];var _0x40edc6=_0x17f280?0x0:_0x28b547[_0x0ae3('0x1e')];var _0x1bf406=_0x17f280?_0x5af348[_0x0ae3('0x1d')]:_0x28b547['offset']+_0x28b547[_0x0ae3('0x1c')];var _0x4b8949;if(_0x1bf406>=_0x59d0de){_0x1bf406=_0x59d0de;_0x4b8949=0xc8;}else{_0x4b8949=0xce;}_0x1600bc['status'](_0x4b8949);return _0x1600bc['set']('Content-Range',_0x40edc6+'-'+_0x1bf406+'/'+_0x59d0de)['json'](_0x5af348);}return null;};}function patchUpdates(_0x4e8135){return function(_0x4d1385){try{jsonpatch[_0x0ae3('0x1f')](_0x4d1385,_0x4e8135,!![]);}catch(_0x1fd946){return BPromise[_0x0ae3('0x20')](_0x1fd946);}return _0x4d1385['save']();};}function saveUpdates(_0x1cdd85,_0x5ecc45){return function(_0xfcf4a8){if(_0xfcf4a8){return _0xfcf4a8['update'](_0x1cdd85)['then'](function(_0x5ab18d){return _0x5ab18d;});}return null;};}function removeEntity(_0x281adf,_0x3b49a0){return function(_0x51e7d1){if(_0x51e7d1){return _0x51e7d1['destroy']()['then'](function(){_0x281adf[_0x0ae3('0x19')](0xcc)[_0x0ae3('0x21')]();});}};}function handleEntityNotFound(_0x5a76e5,_0x36ce4e){return function(_0x1613c3){if(!_0x1613c3){_0x5a76e5[_0x0ae3('0x22')](0x194);}return _0x1613c3;};}function handleError(_0x5b0117,_0x2f8134){_0x2f8134=_0x2f8134||0x1f4;return function(_0x1f9cde){logger[_0x0ae3('0x23')](_0x1f9cde['stack']);if(_0x1f9cde[_0x0ae3('0x24')]){delete _0x1f9cde[_0x0ae3('0x24')];}_0x5b0117[_0x0ae3('0x19')](_0x2f8134)['send'](_0x1f9cde);};}exports[_0x0ae3('0x25')]=function(_0x247623,_0xf0e310){var _0x152876={},_0x1f8f61={},_0x10a7bd={'count':0x0,'rows':[]};var _0x5e8979=_[_0x0ae3('0x26')](db[_0x0ae3('0x27')][_0x0ae3('0x28')],function(_0x4032f4){return{'name':_0x4032f4[_0x0ae3('0x29')],'type':_0x4032f4[_0x0ae3('0x2a')][_0x0ae3('0x2b')]};});_0x1f8f61[_0x0ae3('0x2c')]=_['map'](_0x5e8979,_0x0ae3('0x24'));_0x1f8f61[_0x0ae3('0x2d')]=_[_0x0ae3('0x2e')](_0x247623[_0x0ae3('0x2d')]);_0x1f8f61['filters']=_[_0x0ae3('0x2f')](_0x1f8f61[_0x0ae3('0x2c')],_0x1f8f61[_0x0ae3('0x2d')]);_0x152876[_0x0ae3('0x30')]=_[_0x0ae3('0x2f')](_0x1f8f61[_0x0ae3('0x2c')],qs['fields'](_0x247623[_0x0ae3('0x2d')][_0x0ae3('0x31')]));_0x152876[_0x0ae3('0x30')]=_0x152876[_0x0ae3('0x30')][_0x0ae3('0x32')]?_0x152876[_0x0ae3('0x30')]:_0x1f8f61[_0x0ae3('0x2c')];if(!_0x247623['query']['hasOwnProperty'](_0x0ae3('0x33'))){_0x152876[_0x0ae3('0x1c')]=qs[_0x0ae3('0x1c')](_0x247623['query']['limit']);_0x152876[_0x0ae3('0x1e')]=qs[_0x0ae3('0x1e')](_0x247623[_0x0ae3('0x2d')][_0x0ae3('0x1e')]);}_0x152876[_0x0ae3('0x34')]=qs[_0x0ae3('0x35')](_0x247623[_0x0ae3('0x2d')]['sort']);_0x152876[_0x0ae3('0x36')]=qs[_0x0ae3('0x37')](_[_0x0ae3('0x38')](_0x247623['query'],_0x1f8f61['filters']),_0x5e8979);if(_0x247623['query'][_0x0ae3('0x39')]){_0x152876[_0x0ae3('0x36')]=_['merge'](_0x152876[_0x0ae3('0x36')],{'$or':_[_0x0ae3('0x26')](_0x5e8979,function(_0x3ee862){if(_0x3ee862['type']!==_0x0ae3('0x3a')){var _0x5dd8d7={};_0x5dd8d7[_0x3ee862[_0x0ae3('0x24')]]={'$like':'%'+_0x247623[_0x0ae3('0x2d')]['filter']+'%'};return _0x5dd8d7;}})});}_0x152876=_[_0x0ae3('0x3b')]({},_0x152876,_0x247623[_0x0ae3('0x3c')]);var _0xfa6c7f={'where':_0x152876[_0x0ae3('0x36')]};return db[_0x0ae3('0x27')]['count'](_0xfa6c7f)['then'](function(_0x2e95e5){_0x10a7bd[_0x0ae3('0x1d')]=_0x2e95e5;if(_0x247623['query']['includeAll']){_0x152876['include']=[{'all':!![]}];}return db['Cdr'][_0x0ae3('0x3d')](_0x152876);})[_0x0ae3('0x3e')](function(_0x325153){_0x10a7bd[_0x0ae3('0x3f')]=_0x325153;return _0x10a7bd;})[_0x0ae3('0x3e')](respondWithFilteredResult(_0xf0e310,_0x152876))[_0x0ae3('0x40')](handleError(_0xf0e310,null));};exports[_0x0ae3('0x41')]=function(_0x3166af,_0x2cfc16){var _0x1230c9={'raw':!![],'where':{'id':_0x3166af[_0x0ae3('0x42')]['id']}},_0x5a0e74={};_0x5a0e74[_0x0ae3('0x2c')]=_['keys'](db[_0x0ae3('0x27')][_0x0ae3('0x28')]);_0x5a0e74[_0x0ae3('0x2d')]=_[_0x0ae3('0x2e')](_0x3166af[_0x0ae3('0x2d')]);_0x5a0e74['filters']=_[_0x0ae3('0x2f')](_0x5a0e74[_0x0ae3('0x2c')],_0x5a0e74[_0x0ae3('0x2d')]);_0x1230c9[_0x0ae3('0x30')]=_['intersection'](_0x5a0e74[_0x0ae3('0x2c')],qs[_0x0ae3('0x31')](_0x3166af['query'][_0x0ae3('0x31')]));_0x1230c9[_0x0ae3('0x30')]=_0x1230c9['attributes']['length']?_0x1230c9[_0x0ae3('0x30')]:_0x5a0e74[_0x0ae3('0x2c')];if(_0x3166af[_0x0ae3('0x2d')][_0x0ae3('0x43')]){_0x1230c9[_0x0ae3('0x44')]=[{'all':!![]}];}_0x1230c9=_['merge']({},_0x1230c9,_0x3166af['options']);return db[_0x0ae3('0x27')]['find'](_0x1230c9)[_0x0ae3('0x3e')](handleEntityNotFound(_0x2cfc16,null))[_0x0ae3('0x3e')](respondWithResult(_0x2cfc16,null))['catch'](handleError(_0x2cfc16,null));};exports[_0x0ae3('0x45')]=function(_0x3e4bfb,_0x53e018){return db[_0x0ae3('0x27')][_0x0ae3('0x45')](_0x3e4bfb[_0x0ae3('0x46')],{})[_0x0ae3('0x3e')](respondWithResult(_0x53e018,0xc9))[_0x0ae3('0x40')](handleError(_0x53e018,null));};exports['update']=function(_0x3ad6b3,_0x53393b){if(_0x3ad6b3[_0x0ae3('0x46')]['id']){delete _0x3ad6b3[_0x0ae3('0x46')]['id'];}return db[_0x0ae3('0x27')][_0x0ae3('0x47')]({'where':{'id':_0x3ad6b3[_0x0ae3('0x42')]['id']}})[_0x0ae3('0x3e')](handleEntityNotFound(_0x53393b,null))[_0x0ae3('0x3e')](saveUpdates(_0x3ad6b3[_0x0ae3('0x46')],null))['then'](respondWithResult(_0x53393b,null))[_0x0ae3('0x40')](handleError(_0x53393b,null));};exports[_0x0ae3('0x48')]=function(_0x29479f,_0x12ea03){return db[_0x0ae3('0x27')][_0x0ae3('0x47')]({'where':{'id':_0x29479f[_0x0ae3('0x42')]['id']}})[_0x0ae3('0x3e')](handleEntityNotFound(_0x12ea03,null))[_0x0ae3('0x3e')](removeEntity(_0x12ea03,null))[_0x0ae3('0x40')](handleError(_0x12ea03,null));};exports[_0x0ae3('0x49')]=function(_0x572166,_0x256dc5){return db['Cdr'][_0x0ae3('0x49')]()[_0x0ae3('0x3e')](respondWithResult(_0x256dc5,null))[_0x0ae3('0x40')](handleError(_0x256dc5,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index b16b715..42fb32d 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x2e9c7d,_0x379775){var _0x440303=function(_0x2433fa){while(--_0x2433fa){_0x2e9c7d['push'](_0x2e9c7d['shift']());}};_0x440303(++_0x379775);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x5c45b6,_0x186363){var _0x7e295f=function(_0x129495){while(--_0x129495){_0x5c45b6['push'](_0x5c45b6['shift']());}};_0x7e295f(++_0x186363);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'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 6c1fb5c..d921ef0 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 _0x1bd9=['Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2708b1,_0x57728c){var _0x4446a2=function(_0x5ea1f9){while(--_0x5ea1f9){_0x2708b1['push'](_0x2708b1['shift']());}};_0x4446a2(++_0x57728c);}(_0x1bd9,0xe1));var _0x91bd=function(_0xb134ee,_0x367cfa){_0xb134ee=_0xb134ee-0x0;var _0x846ff=_0x1bd9[_0xb134ee];return _0x846ff;};'use strict';var _=require('lodash');var util=require(_0x91bd('0x0'));var moment=require(_0x91bd('0x1'));var BPromise=require(_0x91bd('0x2'));var rs=require(_0x91bd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x91bd('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x91bd('0x5'))(_0x91bd('0x6'));var config=require(_0x91bd('0x7'));var jayson=require(_0x91bd('0x8'));var client=jayson[_0x91bd('0x9')][_0x91bd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x39c3b1,_0x2b6e54,_0x5e0ed4){return new BPromise(function(_0x24a08d,_0x2277ad){return client[_0x91bd('0xb')](_0x39c3b1,_0x5e0ed4)[_0x91bd('0xc')](function(_0x36c517){logger[_0x91bd('0xd')](_0x91bd('0xe'),_0x2b6e54,_0x91bd('0xf'));logger[_0x91bd('0x10')](_0x91bd('0x11'),_0x2b6e54,'request\x20sent',JSON[_0x91bd('0x12')](_0x36c517));if(_0x36c517[_0x91bd('0x13')]){if(_0x36c517[_0x91bd('0x13')]['code']===0x1f4){logger[_0x91bd('0x13')](_0x91bd('0xe'),_0x2b6e54,_0x36c517[_0x91bd('0x13')][_0x91bd('0x14')]);return _0x2277ad(_0x36c517[_0x91bd('0x13')][_0x91bd('0x14')]);}logger[_0x91bd('0x13')](_0x91bd('0xe'),_0x2b6e54,_0x36c517[_0x91bd('0x13')][_0x91bd('0x14')]);return _0x24a08d(_0x36c517['error'][_0x91bd('0x14')]);}else{logger[_0x91bd('0xd')]('Cdr,\x20%s,\x20%s',_0x2b6e54,_0x91bd('0xf'));_0x24a08d(_0x36c517['result'][_0x91bd('0x14')]);}})[_0x91bd('0x15')](function(_0x28f598){logger[_0x91bd('0x13')](_0x91bd('0xe'),_0x2b6e54,_0x28f598);_0x2277ad(_0x28f598);});});} \ No newline at end of file +var _0x57ca=['info','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x57ca,0x14a));var _0xa57c=function(_0x25af68,_0x4d205a){_0x25af68=_0x25af68-0x0;var _0x3b3491=_0x57ca[_0x25af68];return _0x3b3491;};'use strict';var _=require(_0xa57c('0x0'));var util=require(_0xa57c('0x1'));var moment=require('moment');var BPromise=require(_0xa57c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa57c('0x3'))['db'];var utils=require(_0xa57c('0x4'));var logger=require(_0xa57c('0x5'))('rpc');var config=require(_0xa57c('0x6'));var jayson=require(_0xa57c('0x7'));var client=jayson['client'][_0xa57c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1c82f4,_0x10711c,_0x1bd548){return new BPromise(function(_0x4a5264,_0x16e8fb){return client['request'](_0x1c82f4,_0x1bd548)[_0xa57c('0x9')](function(_0x4ca7ad){logger[_0xa57c('0xa')](_0xa57c('0xb'),_0x10711c,'request\x20sent');logger[_0xa57c('0xc')](_0xa57c('0xd'),_0x10711c,_0xa57c('0xe'),JSON[_0xa57c('0xf')](_0x4ca7ad));if(_0x4ca7ad[_0xa57c('0x10')]){if(_0x4ca7ad[_0xa57c('0x10')]['code']===0x1f4){logger['error'](_0xa57c('0xb'),_0x10711c,_0x4ca7ad['error'][_0xa57c('0x11')]);return _0x16e8fb(_0x4ca7ad[_0xa57c('0x10')][_0xa57c('0x11')]);}logger[_0xa57c('0x10')](_0xa57c('0xb'),_0x10711c,_0x4ca7ad[_0xa57c('0x10')][_0xa57c('0x11')]);return _0x4a5264(_0x4ca7ad[_0xa57c('0x10')]['message']);}else{logger[_0xa57c('0xa')](_0xa57c('0xb'),_0x10711c,'request\x20sent');_0x4a5264(_0x4ca7ad[_0xa57c('0x12')][_0xa57c('0x11')]);}})[_0xa57c('0x13')](function(_0x7a939a){logger['error'](_0xa57c('0xb'),_0x10711c,_0x7a939a);_0x16e8fb(_0x7a939a);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index c24ef64..f4900a1 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 _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x435a26,_0x2c35c2){var _0x2f604a=function(_0x3c9ec9){while(--_0x3c9ec9){_0x435a26['push'](_0x435a26['shift']());}};_0x2f604a(++_0x2c35c2);}(_0xb10b,0x12a));var _0xbb10=function(_0x35dadd,_0x3ed50f){_0x35dadd=_0x35dadd-0x0;var _0x2728ed=_0xb10b[_0x35dadd];return _0x2728ed;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router; \ No newline at end of file +var _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(_0x20a573,_0x3328b4){var _0x399adf=function(_0x2196a1){while(--_0x2196a1){_0x20a573['push'](_0x20a573['shift']());}};_0x399adf(++_0x3328b4);}(_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 d7fdd7f..b58f327 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 _0xde83=['*,*,*,*','sequelize','INTEGER','STRING','noop','TEXT'];(function(_0x369a41,_0x5ed95c){var _0x16807d=function(_0x189d9f){while(--_0x189d9f){_0x369a41['push'](_0x369a41['shift']());}};_0x16807d(++_0x5ed95c);}(_0xde83,0x1e1));var _0x3de8=function(_0x51b661,_0x566ef8){_0x51b661=_0x51b661-0x0;var _0x5d1971=_0xde83[_0x51b661];return _0x5d1971;};'use strict';var Sequelize=require(_0x3de8('0x0'));module['exports']={'priority':{'type':Sequelize[_0x3de8('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x3de8('0x2')],'allowNull':![],'defaultValue':_0x3de8('0x3')},'appdata':{'type':Sequelize[_0x3de8('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x3de8('0x2')],'defaultValue':_0x3de8('0x5')}}; \ No newline at end of file +var _0xca11=['exports','STRING','noop','*,*,*,*'];(function(_0x2f7f56,_0x389de3){var _0x49a05b=function(_0x3a89d6){while(--_0x3a89d6){_0x2f7f56['push'](_0x2f7f56['shift']());}};_0x49a05b(++_0x389de3);}(_0xca11,0x150));var _0x1ca1=function(_0x2fa703,_0x4fcbdc){_0x2fa703=_0x2fa703-0x0;var _0x3789ab=_0xca11[_0x2fa703];return _0x3789ab;};'use strict';var Sequelize=require('sequelize');module[_0x1ca1('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x1ca1('0x1')],'allowNull':![],'defaultValue':_0x1ca1('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x1ca1('0x1')]},'interval':{'type':Sequelize[_0x1ca1('0x1')],'defaultValue':_0x1ca1('0x3')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 4a021fb..171dbc8 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 _0x9c2c=['send','params','model','keys','rawAttributes','query','intersection','attributes','fields','length','includeAll','merge','ChatApplication','find','catch','body','eml-format','rimraf','moment','mustache','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','stack','name'];(function(_0x496c76,_0x2a0695){var _0x2a9b1e=function(_0x440b20){while(--_0x440b20){_0x496c76['push'](_0x496c76['shift']());}};_0x2a9b1e(++_0x2a0695);}(_0x9c2c,0x1c0));var _0xc9c2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c2c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xc9c2('0x0'));var rimraf=require(_0xc9c2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc9c2('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xc9c2('0x3'));var util=require(_0xc9c2('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0xc9c2('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc9c2('0x6'));var _=require(_0xc9c2('0x7'));var squel=require(_0xc9c2('0x8'));var crypto=require(_0xc9c2('0x9'));var jsforce=require(_0xc9c2('0xa'));var deskjs=require(_0xc9c2('0xb'));var toCsv=require(_0xc9c2('0x5'));var querystring=require(_0xc9c2('0xc'));var Papa=require(_0xc9c2('0xd'));var Redis=require('ioredis');var authService=require(_0xc9c2('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xc9c2('0xf'));var hardwareService=require(_0xc9c2('0x10'));var logger=require(_0xc9c2('0x11'))(_0xc9c2('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc9c2('0x13'));var db=require(_0xc9c2('0x14'))['db'];function respondWithStatusCode(_0x568f69,_0x7ec780){_0x7ec780=_0x7ec780||0xcc;return function(_0x1f08a7){if(_0x1f08a7){return _0x568f69[_0xc9c2('0x15')](_0x7ec780);}return _0x568f69[_0xc9c2('0x16')](_0x7ec780)[_0xc9c2('0x17')]();};}function respondWithResult(_0x3b0058,_0x33b288){_0x33b288=_0x33b288||0xc8;return function(_0x132702){if(_0x132702){return _0x3b0058[_0xc9c2('0x16')](_0x33b288)[_0xc9c2('0x18')](_0x132702);}};}function respondWithFilteredResult(_0xf94209,_0x383667){return function(_0x480d7c){if(_0x480d7c){var _0x27840d=typeof _0x383667[_0xc9c2('0x19')]===_0xc9c2('0x1a')&&typeof _0x383667[_0xc9c2('0x1b')]===_0xc9c2('0x1a');var _0x49413b=_0x480d7c[_0xc9c2('0x1c')];var _0x37c027=_0x27840d?0x0:_0x383667[_0xc9c2('0x19')];var _0x4e4ded=_0x27840d?_0x480d7c[_0xc9c2('0x1c')]:_0x383667[_0xc9c2('0x19')]+_0x383667[_0xc9c2('0x1b')];var _0x484ca3;if(_0x4e4ded>=_0x49413b){_0x4e4ded=_0x49413b;_0x484ca3=0xc8;}else{_0x484ca3=0xce;}_0xf94209[_0xc9c2('0x16')](_0x484ca3);return _0xf94209[_0xc9c2('0x1d')]('Content-Range',_0x37c027+'-'+_0x4e4ded+'/'+_0x49413b)['json'](_0x480d7c);}return null;};}function patchUpdates(_0x37e3){return function(_0x50f280){try{jsonpatch[_0xc9c2('0x1e')](_0x50f280,_0x37e3,!![]);}catch(_0x140c8a){return BPromise[_0xc9c2('0x1f')](_0x140c8a);}return _0x50f280[_0xc9c2('0x20')]();};}function saveUpdates(_0x3e1774,_0x53c460){return function(_0x1fbac4){if(_0x1fbac4){return _0x1fbac4[_0xc9c2('0x21')](_0x3e1774)[_0xc9c2('0x22')](function(_0x11cc07){return _0x11cc07;});}return null;};}function removeEntity(_0x32c372,_0x385030){return function(_0x56e515){if(_0x56e515){return _0x56e515[_0xc9c2('0x23')]()[_0xc9c2('0x22')](function(){_0x32c372['status'](0xcc)[_0xc9c2('0x17')]();});}};}function handleEntityNotFound(_0x4b3b97,_0xa18b32){return function(_0xd803e9){if(!_0xd803e9){_0x4b3b97[_0xc9c2('0x15')](0x194);}return _0xd803e9;};}function handleError(_0x2222e4,_0x484d55){_0x484d55=_0x484d55||0x1f4;return function(_0x2073ef){logger['error'](_0x2073ef[_0xc9c2('0x24')]);if(_0x2073ef[_0xc9c2('0x25')]){delete _0x2073ef[_0xc9c2('0x25')];}_0x2222e4[_0xc9c2('0x16')](_0x484d55)[_0xc9c2('0x26')](_0x2073ef);};}exports['show']=function(_0x3cedb5,_0xe2f93b){var _0x40033a={'raw':!![],'where':{'id':_0x3cedb5[_0xc9c2('0x27')]['id']}},_0x1554ae={};_0x1554ae[_0xc9c2('0x28')]=_[_0xc9c2('0x29')](db['ChatApplication'][_0xc9c2('0x2a')]);_0x1554ae['query']=_[_0xc9c2('0x29')](_0x3cedb5[_0xc9c2('0x2b')]);_0x1554ae['filters']=_[_0xc9c2('0x2c')](_0x1554ae[_0xc9c2('0x28')],_0x1554ae[_0xc9c2('0x2b')]);_0x40033a[_0xc9c2('0x2d')]=_['intersection'](_0x1554ae[_0xc9c2('0x28')],qs[_0xc9c2('0x2e')](_0x3cedb5['query']['fields']));_0x40033a[_0xc9c2('0x2d')]=_0x40033a[_0xc9c2('0x2d')][_0xc9c2('0x2f')]?_0x40033a['attributes']:_0x1554ae['model'];if(_0x3cedb5[_0xc9c2('0x2b')][_0xc9c2('0x30')]){_0x40033a['include']=[{'all':!![]}];}_0x40033a=_[_0xc9c2('0x31')]({},_0x40033a,_0x3cedb5['options']);return db[_0xc9c2('0x32')][_0xc9c2('0x33')](_0x40033a)[_0xc9c2('0x22')](handleEntityNotFound(_0xe2f93b,null))[_0xc9c2('0x22')](respondWithResult(_0xe2f93b,null))[_0xc9c2('0x34')](handleError(_0xe2f93b,null));};exports[_0xc9c2('0x21')]=function(_0x2f26c5,_0x1cd2f3){if(_0x2f26c5[_0xc9c2('0x35')]['id']){delete _0x2f26c5['body']['id'];}return db[_0xc9c2('0x32')]['find']({'where':{'id':_0x2f26c5[_0xc9c2('0x27')]['id']}})[_0xc9c2('0x22')](handleEntityNotFound(_0x1cd2f3,null))['then'](saveUpdates(_0x2f26c5[_0xc9c2('0x35')],null))[_0xc9c2('0x22')](respondWithResult(_0x1cd2f3,null))['catch'](handleError(_0x1cd2f3,null));};exports[_0xc9c2('0x23')]=function(_0x22a935,_0x264fd7){return db['ChatApplication'][_0xc9c2('0x33')]({'where':{'id':_0x22a935['params']['id']}})[_0xc9c2('0x22')](handleEntityNotFound(_0x264fd7,null))[_0xc9c2('0x22')](removeEntity(_0x264fd7,null))['catch'](handleError(_0x264fd7,null));}; \ No newline at end of file +var _0xdca3=['../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','update','then','destroy','error','stack','name','send','show','params','model','keys','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','include','merge','ChatApplication','find','body','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xdca3,0x64));var _0x3dca=function(_0x2a9772,_0x22c9c6){_0x2a9772=_0x2a9772-0x0;var _0x51f364=_0xdca3[_0x2a9772];return _0x51f364;};'use strict';var emlformat=require(_0x3dca('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3dca('0x1'));var jsonpatch=require(_0x3dca('0x2'));var rp=require(_0x3dca('0x3'));var moment=require(_0x3dca('0x4'));var BPromise=require(_0x3dca('0x5'));var Mustache=require(_0x3dca('0x6'));var util=require(_0x3dca('0x7'));var path=require(_0x3dca('0x8'));var sox=require(_0x3dca('0x9'));var csv=require(_0x3dca('0xa'));var ejs=require(_0x3dca('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3dca('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3dca('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3dca('0xa'));var querystring=require(_0x3dca('0xe'));var Papa=require(_0x3dca('0xf'));var Redis=require(_0x3dca('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3dca('0x11'));var as=require(_0x3dca('0x12'));var hardwareService=require(_0x3dca('0x13'));var logger=require(_0x3dca('0x14'))(_0x3dca('0x15'));var utils=require(_0x3dca('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x3dca('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5bfeda,_0x24c6c9){_0x24c6c9=_0x24c6c9||0xcc;return function(_0x11f54e){if(_0x11f54e){return _0x5bfeda[_0x3dca('0x18')](_0x24c6c9);}return _0x5bfeda[_0x3dca('0x19')](_0x24c6c9)[_0x3dca('0x1a')]();};}function respondWithResult(_0x344892,_0xa4149a){_0xa4149a=_0xa4149a||0xc8;return function(_0xf1350d){if(_0xf1350d){return _0x344892[_0x3dca('0x19')](_0xa4149a)[_0x3dca('0x1b')](_0xf1350d);}};}function respondWithFilteredResult(_0x3d1154,_0x911042){return function(_0x1b5906){if(_0x1b5906){var _0x5dc428=typeof _0x911042['offset']===_0x3dca('0x1c')&&typeof _0x911042[_0x3dca('0x1d')]===_0x3dca('0x1c');var _0x1a4ee=_0x1b5906[_0x3dca('0x1e')];var _0x8c046c=_0x5dc428?0x0:_0x911042['offset'];var _0x3a16b4=_0x5dc428?_0x1b5906[_0x3dca('0x1e')]:_0x911042[_0x3dca('0x1f')]+_0x911042[_0x3dca('0x1d')];var _0x4a3cd1;if(_0x3a16b4>=_0x1a4ee){_0x3a16b4=_0x1a4ee;_0x4a3cd1=0xc8;}else{_0x4a3cd1=0xce;}_0x3d1154[_0x3dca('0x19')](_0x4a3cd1);return _0x3d1154[_0x3dca('0x20')](_0x3dca('0x21'),_0x8c046c+'-'+_0x3a16b4+'/'+_0x1a4ee)['json'](_0x1b5906);}return null;};}function patchUpdates(_0x501201){return function(_0x4399ba){try{jsonpatch['apply'](_0x4399ba,_0x501201,!![]);}catch(_0x5f1ad3){return BPromise[_0x3dca('0x22')](_0x5f1ad3);}return _0x4399ba['save']();};}function saveUpdates(_0x4316b7,_0x592459){return function(_0x5b0dee){if(_0x5b0dee){return _0x5b0dee[_0x3dca('0x23')](_0x4316b7)[_0x3dca('0x24')](function(_0x439b6a){return _0x439b6a;});}return null;};}function removeEntity(_0x25f8e7,_0x59be49){return function(_0x18a452){if(_0x18a452){return _0x18a452[_0x3dca('0x25')]()[_0x3dca('0x24')](function(){_0x25f8e7['status'](0xcc)[_0x3dca('0x1a')]();});}};}function handleEntityNotFound(_0x3148ce,_0x4c2dd2){return function(_0x26a21b){if(!_0x26a21b){_0x3148ce[_0x3dca('0x18')](0x194);}return _0x26a21b;};}function handleError(_0x372b1e,_0x2580f6){_0x2580f6=_0x2580f6||0x1f4;return function(_0x3fd367){logger[_0x3dca('0x26')](_0x3fd367[_0x3dca('0x27')]);if(_0x3fd367[_0x3dca('0x28')]){delete _0x3fd367[_0x3dca('0x28')];}_0x372b1e[_0x3dca('0x19')](_0x2580f6)[_0x3dca('0x29')](_0x3fd367);};}exports[_0x3dca('0x2a')]=function(_0xa14500,_0x12560e){var _0x3d13f9={'raw':!![],'where':{'id':_0xa14500[_0x3dca('0x2b')]['id']}},_0x377c6e={};_0x377c6e[_0x3dca('0x2c')]=_[_0x3dca('0x2d')](db['ChatApplication'][_0x3dca('0x2e')]);_0x377c6e[_0x3dca('0x2f')]=_[_0x3dca('0x2d')](_0xa14500[_0x3dca('0x2f')]);_0x377c6e[_0x3dca('0x30')]=_[_0x3dca('0x31')](_0x377c6e[_0x3dca('0x2c')],_0x377c6e['query']);_0x3d13f9['attributes']=_['intersection'](_0x377c6e[_0x3dca('0x2c')],qs['fields'](_0xa14500[_0x3dca('0x2f')][_0x3dca('0x32')]));_0x3d13f9[_0x3dca('0x33')]=_0x3d13f9[_0x3dca('0x33')][_0x3dca('0x34')]?_0x3d13f9[_0x3dca('0x33')]:_0x377c6e[_0x3dca('0x2c')];if(_0xa14500[_0x3dca('0x2f')][_0x3dca('0x35')]){_0x3d13f9[_0x3dca('0x36')]=[{'all':!![]}];}_0x3d13f9=_[_0x3dca('0x37')]({},_0x3d13f9,_0xa14500['options']);return db[_0x3dca('0x38')][_0x3dca('0x39')](_0x3d13f9)[_0x3dca('0x24')](handleEntityNotFound(_0x12560e,null))[_0x3dca('0x24')](respondWithResult(_0x12560e,null))['catch'](handleError(_0x12560e,null));};exports[_0x3dca('0x23')]=function(_0x4fb281,_0x5713d9){if(_0x4fb281[_0x3dca('0x3a')]['id']){delete _0x4fb281[_0x3dca('0x3a')]['id'];}return db[_0x3dca('0x38')][_0x3dca('0x39')]({'where':{'id':_0x4fb281[_0x3dca('0x2b')]['id']}})[_0x3dca('0x24')](handleEntityNotFound(_0x5713d9,null))['then'](saveUpdates(_0x4fb281[_0x3dca('0x3a')],null))[_0x3dca('0x24')](respondWithResult(_0x5713d9,null))[_0x3dca('0x3b')](handleError(_0x5713d9,null));};exports[_0x3dca('0x25')]=function(_0x430dc3,_0x4147d6){return db['ChatApplication'][_0x3dca('0x39')]({'where':{'id':_0x430dc3[_0x3dca('0x2b')]['id']}})[_0x3dca('0x24')](handleEntityNotFound(_0x4147d6,null))[_0x3dca('0x24')](removeEntity(_0x4147d6,null))[_0x3dca('0x3b')](handleError(_0x4147d6,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index c39bd73..e2f1188 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 _0xffdf=['./chatApplication.attributes','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','../../config/environment'];(function(_0x2be1ab,_0x2fe1fc){var _0x4c616d=function(_0x16dfc8){while(--_0x16dfc8){_0x2be1ab['push'](_0x2be1ab['shift']());}};_0x4c616d(++_0x2fe1fc);}(_0xffdf,0x7e));var _0xfffd=function(_0x723d04,_0x45db46){_0x723d04=_0x723d04-0x0;var _0x51a640=_0xffdf[_0x723d04];return _0x51a640;};'use strict';var _=require(_0xfffd('0x0'));var util=require(_0xfffd('0x1'));var logger=require(_0xfffd('0x2'))('api');var moment=require(_0xfffd('0x3'));var BPromise=require(_0xfffd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xfffd('0x5'));var attributes=require(_0xfffd('0x6'));module['exports']=function(_0x5d58c0,_0x38d2c4){return _0x5d58c0['define'](_0xfffd('0x7'),attributes,{'tableName':_0xfffd('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfffd('0x9'),'collate':_0xfffd('0xa')});}; \ No newline at end of file +var _0x625b=['bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','lodash','util','../../config/logger','api','moment'];(function(_0x216b8a,_0x459a11){var _0x344626=function(_0x27c690){while(--_0x27c690){_0x216b8a['push'](_0x216b8a['shift']());}};_0x344626(++_0x459a11);}(_0x625b,0x121));var _0xb625=function(_0x5a3d77,_0x1e1898){_0x5a3d77=_0x5a3d77-0x0;var _0x40e312=_0x625b[_0x5a3d77];return _0x40e312;};'use strict';var _=require(_0xb625('0x0'));var util=require(_0xb625('0x1'));var logger=require(_0xb625('0x2'))(_0xb625('0x3'));var moment=require(_0xb625('0x4'));var BPromise=require(_0xb625('0x5'));var rp=require(_0xb625('0x6'));var fs=require('fs');var path=require(_0xb625('0x7'));var rimraf=require(_0xb625('0x8'));var config=require(_0xb625('0x9'));var attributes=require(_0xb625('0xa'));module[_0xb625('0xb')]=function(_0x98fac0,_0x1a67d9){return _0x98fac0[_0xb625('0xc')](_0xb625('0xd'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','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 c6dc634..1fa8952 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 _0x0cfe=['rpc','../../config/environment','jayson/promise','http','request','then','info','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ChatApplication,\x20%s,\x20%s','result','catch','lodash','randomstring','../../mysqldb','../../config/utils'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0x0cfe,0x1ca));var _0xe0cf=function(_0x527cae,_0x476036){_0x527cae=_0x527cae-0x0;var _0x10bd2c=_0x0cfe[_0x527cae];return _0x10bd2c;};'use strict';var _=require(_0xe0cf('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe0cf('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe0cf('0x2'))['db'];var utils=require(_0xe0cf('0x3'));var logger=require('../../config/logger')(_0xe0cf('0x4'));var config=require(_0xe0cf('0x5'));var jayson=require(_0xe0cf('0x6'));var client=jayson['client'][_0xe0cf('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x596389,_0x1a62c8,_0x143d66){return new BPromise(function(_0x25d89e,_0x51503a){return client[_0xe0cf('0x8')](_0x596389,_0x143d66)[_0xe0cf('0x9')](function(_0x156dec){logger[_0xe0cf('0xa')]('ChatApplication,\x20%s,\x20%s',_0x1a62c8,'request\x20sent');logger[_0xe0cf('0xb')](_0xe0cf('0xc'),_0x1a62c8,_0xe0cf('0xd'),JSON[_0xe0cf('0xe')](_0x156dec));if(_0x156dec[_0xe0cf('0xf')]){if(_0x156dec[_0xe0cf('0xf')][_0xe0cf('0x10')]===0x1f4){logger[_0xe0cf('0xf')]('ChatApplication,\x20%s,\x20%s',_0x1a62c8,_0x156dec['error'][_0xe0cf('0x11')]);return _0x51503a(_0x156dec[_0xe0cf('0xf')][_0xe0cf('0x11')]);}logger[_0xe0cf('0xf')](_0xe0cf('0x12'),_0x1a62c8,_0x156dec[_0xe0cf('0xf')][_0xe0cf('0x11')]);return _0x25d89e(_0x156dec[_0xe0cf('0xf')]['message']);}else{logger[_0xe0cf('0xa')](_0xe0cf('0x12'),_0x1a62c8,_0xe0cf('0xd'));_0x25d89e(_0x156dec[_0xe0cf('0x13')][_0xe0cf('0x11')]);}})[_0xe0cf('0x14')](function(_0x1bbbf3){logger[_0xe0cf('0xf')](_0xe0cf('0x12'),_0x1a62c8,_0x1bbbf3);_0x51503a(_0x1bbbf3);});});} \ No newline at end of file +var _0x2047=['rpc','../../config/environment','jayson/promise','http','request','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1019d9,_0x24c81f){var _0x403e4e=function(_0x5ab52e){while(--_0x5ab52e){_0x1019d9['push'](_0x1019d9['shift']());}};_0x403e4e(++_0x24c81f);}(_0x2047,0x81));var _0x7204=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x2047[_0xd1d19a];return _0x52a79d;};'use strict';var _=require(_0x7204('0x0'));var util=require(_0x7204('0x1'));var moment=require(_0x7204('0x2'));var BPromise=require(_0x7204('0x3'));var rs=require(_0x7204('0x4'));var fs=require('fs');var Redis=require(_0x7204('0x5'));var db=require(_0x7204('0x6'))['db'];var utils=require(_0x7204('0x7'));var logger=require(_0x7204('0x8'))(_0x7204('0x9'));var config=require(_0x7204('0xa'));var jayson=require(_0x7204('0xb'));var client=jayson['client'][_0x7204('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x10545a,_0x2e8875,_0x44dbc9){return new BPromise(function(_0x4ca6c5,_0x473399){return client[_0x7204('0xd')](_0x10545a,_0x44dbc9)['then'](function(_0x2fa61a){logger[_0x7204('0xe')](_0x7204('0xf'),_0x2e8875,_0x7204('0x10'));logger[_0x7204('0x11')](_0x7204('0x12'),_0x2e8875,_0x7204('0x10'),JSON['stringify'](_0x2fa61a));if(_0x2fa61a[_0x7204('0x13')]){if(_0x2fa61a[_0x7204('0x13')][_0x7204('0x14')]===0x1f4){logger['error'](_0x7204('0xf'),_0x2e8875,_0x2fa61a[_0x7204('0x13')][_0x7204('0x15')]);return _0x473399(_0x2fa61a['error'][_0x7204('0x15')]);}logger[_0x7204('0x13')](_0x7204('0xf'),_0x2e8875,_0x2fa61a[_0x7204('0x13')][_0x7204('0x15')]);return _0x4ca6c5(_0x2fa61a[_0x7204('0x13')][_0x7204('0x15')]);}else{logger[_0x7204('0xe')](_0x7204('0xf'),_0x2e8875,'request\x20sent');_0x4ca6c5(_0x2fa61a['result'][_0x7204('0x15')]);}})[_0x7204('0x16')](function(_0x382e6e){logger[_0x7204('0x13')](_0x7204('0xf'),_0x2e8875,_0x382e6e);_0x473399(_0x382e6e);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 39edaa0..3d20ea2 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 _0x9569=['delete','destroy','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatApplication.controller','/:id','isAuthenticated','show'];(function(_0x14f635,_0x170c15){var _0x306f19=function(_0x4fa66e){while(--_0x4fa66e){_0x14f635['push'](_0x14f635['shift']());}};_0x306f19(++_0x170c15);}(_0x9569,0x17c));var _0x9956=function(_0x56605b,_0x2409fb){_0x56605b=_0x56605b-0x0;var _0x175447=_0x9569[_0x56605b];return _0x175447;};'use strict';var multer=require(_0x9956('0x0'));var util=require(_0x9956('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9956('0x2'));var router=express['Router']();var fs_extra=require(_0x9956('0x3'));var auth=require(_0x9956('0x4'));var interaction=require(_0x9956('0x5'));var config=require('../../config/environment');var controller=require(_0x9956('0x6'));router['get'](_0x9956('0x7'),auth[_0x9956('0x8')](),controller[_0x9956('0x9')]);router['put'](_0x9956('0x7'),auth[_0x9956('0x8')](),controller['update']);router[_0x9956('0xa')](_0x9956('0x7'),auth[_0x9956('0x8')](),controller[_0x9956('0xb')]);module[_0x9956('0xc')]=router; \ No newline at end of file +var _0x97d0=['./chatApplication.controller','/:id','isAuthenticated','show','put','update','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x45bfa1,_0x479201){var _0x32c4ae=function(_0x49ba26){while(--_0x49ba26){_0x45bfa1['push'](_0x45bfa1['shift']());}};_0x32c4ae(++_0x479201);}(_0x97d0,0xb7));var _0x097d=function(_0x1c6f0e,_0x16838a){_0x1c6f0e=_0x1c6f0e-0x0;var _0x34b778=_0x97d0[_0x1c6f0e];return _0x34b778;};'use strict';var multer=require(_0x097d('0x0'));var util=require(_0x097d('0x1'));var path=require('path');var timeout=require(_0x097d('0x2'));var express=require(_0x097d('0x3'));var router=express[_0x097d('0x4')]();var fs_extra=require(_0x097d('0x5'));var auth=require(_0x097d('0x6'));var interaction=require(_0x097d('0x7'));var config=require(_0x097d('0x8'));var controller=require(_0x097d('0x9'));router['get'](_0x097d('0xa'),auth[_0x097d('0xb')](),controller[_0x097d('0xc')]);router[_0x097d('0xd')]('/:id',auth[_0x097d('0xb')](),controller[_0x097d('0xe')]);router['delete'](_0x097d('0xa'),auth[_0x097d('0xb')](),controller[_0x097d('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 87450ad..c54fed1 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 _0x84cd=['BOOLEAN','sequelize','STRING'];(function(_0x601a66,_0x395e65){var _0x3d610b=function(_0x43adcc){while(--_0x43adcc){_0x601a66['push'](_0x601a66['shift']());}};_0x3d610b(++_0x395e65);}(_0x84cd,0xb2));var _0xd84c=function(_0x29b9bf,_0x59e269){_0x29b9bf=_0x29b9bf-0x0;var _0x99908a=_0x84cd[_0x29b9bf];return _0x99908a;};'use strict';var Sequelize=require(_0xd84c('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xd84c('0x1')]},'write':{'type':Sequelize[_0xd84c('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x4c6a=['sequelize','exports','STRING'];(function(_0x12d812,_0x496bb7){var _0x3711ab=function(_0x3259da){while(--_0x3259da){_0x12d812['push'](_0x12d812['shift']());}};_0x3711ab(++_0x496bb7);}(_0x4c6a,0xb4));var _0xa4c6=function(_0x428042,_0x52a4f2){_0x428042=_0x428042-0x0;var _0x81c7b9=_0x4c6a[_0x428042];return _0x81c7b9;};'use strict';var Sequelize=require(_0xa4c6('0x0'));module[_0xa4c6('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xa4c6('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 198036e..19ef54e 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 _0xcfbf=['../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','index','map','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','count','includeAll','include','catch','show','params','ChatGroup','keys','find','create','body','describe','getUnread','ChatInternalMessage','addMembers','ids','omit','getMembers','findOne','User','rawAttributes','removeMembers','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','nolimit','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x5ac81b,_0x4acfe7){var _0x29ba2a=function(_0x14e49f){while(--_0x14e49f){_0x5ac81b['push'](_0x5ac81b['shift']());}};_0x29ba2a(++_0x4acfe7);}(_0xcfbf,0x103));var _0xfcfb=function(_0x47e890,_0x3b99d5){_0x47e890=_0x47e890-0x0;var _0x434f6d=_0xcfbf[_0x47e890];return _0x434f6d;};'use strict';var emlformat=require(_0xfcfb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfcfb('0x1'));var jsonpatch=require(_0xfcfb('0x2'));var rp=require('request-promise');var moment=require(_0xfcfb('0x3'));var BPromise=require(_0xfcfb('0x4'));var Mustache=require(_0xfcfb('0x5'));var util=require(_0xfcfb('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xfcfb('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfcfb('0x8'));var _=require(_0xfcfb('0x9'));var squel=require(_0xfcfb('0xa'));var crypto=require('crypto');var jsforce=require(_0xfcfb('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xfcfb('0x7'));var querystring=require(_0xfcfb('0xc'));var Papa=require(_0xfcfb('0xd'));var Redis=require(_0xfcfb('0xe'));var authService=require(_0xfcfb('0xf'));var qs=require(_0xfcfb('0x10'));var as=require(_0xfcfb('0x11'));var hardwareService=require(_0xfcfb('0x12'));var logger=require(_0xfcfb('0x13'))(_0xfcfb('0x14'));var utils=require(_0xfcfb('0x15'));var config=require(_0xfcfb('0x16'));var licenseUtil=require(_0xfcfb('0x17'));var db=require(_0xfcfb('0x18'))['db'];config[_0xfcfb('0x19')]=_['defaults'](config[_0xfcfb('0x19')],{'host':_0xfcfb('0x1a'),'port':0x18eb});var socket=require(_0xfcfb('0x1b'))(new Redis(config[_0xfcfb('0x19')]));require('./chatGroup.socket')[_0xfcfb('0x1c')](socket);function respondWithStatusCode(_0x235f3f,_0x573c9a){_0x573c9a=_0x573c9a||0xcc;return function(_0x390aea){if(_0x390aea){return _0x235f3f[_0xfcfb('0x1d')](_0x573c9a);}return _0x235f3f[_0xfcfb('0x1e')](_0x573c9a)[_0xfcfb('0x1f')]();};}function respondWithResult(_0x41a374,_0x68ca66){_0x68ca66=_0x68ca66||0xc8;return function(_0x229d4){if(_0x229d4){return _0x41a374['status'](_0x68ca66)['json'](_0x229d4);}};}function respondWithFilteredResult(_0x2362b9,_0x2cf5be){return function(_0x46b4eb){if(_0x46b4eb){var _0x43b86c=typeof _0x2cf5be[_0xfcfb('0x20')]===_0xfcfb('0x21')&&typeof _0x2cf5be[_0xfcfb('0x22')]===_0xfcfb('0x21');var _0x37a2d8=_0x46b4eb['count'];var _0x5c3f9a=_0x43b86c?0x0:_0x2cf5be[_0xfcfb('0x20')];var _0x8e63b3=_0x43b86c?_0x46b4eb['count']:_0x2cf5be[_0xfcfb('0x20')]+_0x2cf5be[_0xfcfb('0x22')];var _0x145fd4;if(_0x8e63b3>=_0x37a2d8){_0x8e63b3=_0x37a2d8;_0x145fd4=0xc8;}else{_0x145fd4=0xce;}_0x2362b9[_0xfcfb('0x1e')](_0x145fd4);return _0x2362b9[_0xfcfb('0x23')](_0xfcfb('0x24'),_0x5c3f9a+'-'+_0x8e63b3+'/'+_0x37a2d8)[_0xfcfb('0x25')](_0x46b4eb);}return null;};}function patchUpdates(_0x2c0d34){return function(_0xca1434){try{jsonpatch[_0xfcfb('0x26')](_0xca1434,_0x2c0d34,!![]);}catch(_0x24a1a0){return BPromise[_0xfcfb('0x27')](_0x24a1a0);}return _0xca1434['save']();};}function saveUpdates(_0x4535fc,_0x468361){return function(_0x430860){if(_0x430860){return _0x430860[_0xfcfb('0x28')](_0x4535fc)[_0xfcfb('0x29')](function(_0x323fd9){return _0x323fd9;});}return null;};}function removeEntity(_0x4ae15d,_0x50b83c){return function(_0x283deb){if(_0x283deb){return _0x283deb[_0xfcfb('0x2a')]()['then'](function(){_0x4ae15d[_0xfcfb('0x1e')](0xcc)[_0xfcfb('0x1f')]();});}};}function handleEntityNotFound(_0x25bbe5,_0x59fd5f){return function(_0x3758fe){if(!_0x3758fe){_0x25bbe5[_0xfcfb('0x1d')](0x194);}return _0x3758fe;};}function handleError(_0x32fbd2,_0x1aa784){_0x1aa784=_0x1aa784||0x1f4;return function(_0x582894){logger[_0xfcfb('0x2b')](_0x582894[_0xfcfb('0x2c')]);if(_0x582894[_0xfcfb('0x2d')]){delete _0x582894[_0xfcfb('0x2d')];}_0x32fbd2[_0xfcfb('0x1e')](_0x1aa784)['send'](_0x582894);};}exports[_0xfcfb('0x2e')]=function(_0x576b62,_0x42b465){var _0x3aea16={},_0x4039f3={},_0x4aa693={'count':0x0,'rows':[]};var _0x52ef60=_[_0xfcfb('0x2f')](db['ChatGroup']['rawAttributes'],function(_0x39e208){return{'name':_0x39e208['fieldName'],'type':_0x39e208[_0xfcfb('0x30')][_0xfcfb('0x31')]};});_0x4039f3[_0xfcfb('0x32')]=_[_0xfcfb('0x2f')](_0x52ef60,_0xfcfb('0x2d'));_0x4039f3[_0xfcfb('0x33')]=_['keys'](_0x576b62['query']);_0x4039f3[_0xfcfb('0x34')]=_[_0xfcfb('0x35')](_0x4039f3[_0xfcfb('0x32')],_0x4039f3[_0xfcfb('0x33')]);_0x3aea16[_0xfcfb('0x36')]=_[_0xfcfb('0x35')](_0x4039f3[_0xfcfb('0x32')],qs[_0xfcfb('0x37')](_0x576b62[_0xfcfb('0x33')][_0xfcfb('0x37')]));_0x3aea16[_0xfcfb('0x36')]=_0x3aea16[_0xfcfb('0x36')][_0xfcfb('0x38')]?_0x3aea16[_0xfcfb('0x36')]:_0x4039f3[_0xfcfb('0x32')];if(!_0x576b62[_0xfcfb('0x33')][_0xfcfb('0x39')]('nolimit')){_0x3aea16[_0xfcfb('0x22')]=qs[_0xfcfb('0x22')](_0x576b62['query'][_0xfcfb('0x22')]);_0x3aea16[_0xfcfb('0x20')]=qs[_0xfcfb('0x20')](_0x576b62['query']['offset']);}_0x3aea16[_0xfcfb('0x3a')]=qs[_0xfcfb('0x3b')](_0x576b62[_0xfcfb('0x33')][_0xfcfb('0x3b')]);_0x3aea16['where']=qs['filters'](_[_0xfcfb('0x3c')](_0x576b62[_0xfcfb('0x33')],_0x4039f3[_0xfcfb('0x34')]),_0x52ef60);if(_0x576b62[_0xfcfb('0x33')][_0xfcfb('0x3d')]){_0x3aea16[_0xfcfb('0x3e')]=_[_0xfcfb('0x3f')](_0x3aea16[_0xfcfb('0x3e')],{'$or':_[_0xfcfb('0x2f')](_0x52ef60,function(_0x3562ba){if(_0x3562ba[_0xfcfb('0x30')]!=='VIRTUAL'){var _0x28b5c0={};_0x28b5c0[_0x3562ba[_0xfcfb('0x2d')]]={'$like':'%'+_0x576b62[_0xfcfb('0x33')][_0xfcfb('0x3d')]+'%'};return _0x28b5c0;}})});}_0x3aea16=_['merge']({},_0x3aea16,_0x576b62[_0xfcfb('0x40')]);var _0x4dd59c={'where':_0x3aea16[_0xfcfb('0x3e')]};return db['ChatGroup']['count'](_0x4dd59c)[_0xfcfb('0x29')](function(_0x6b4e49){_0x4aa693[_0xfcfb('0x41')]=_0x6b4e49;if(_0x576b62['query'][_0xfcfb('0x42')]){_0x3aea16[_0xfcfb('0x43')]=[{'all':!![]}];}return db['ChatGroup']['findAll'](_0x3aea16);})[_0xfcfb('0x29')](function(_0x3bb809){_0x4aa693['rows']=_0x3bb809;return _0x4aa693;})['then'](respondWithFilteredResult(_0x42b465,_0x3aea16))[_0xfcfb('0x44')](handleError(_0x42b465,null));};exports[_0xfcfb('0x45')]=function(_0x35b2ff,_0x5b5002){var _0x301ef2={'raw':!![],'where':{'id':_0x35b2ff[_0xfcfb('0x46')]['id']}},_0x38a88e={};_0x38a88e[_0xfcfb('0x32')]=_['keys'](db[_0xfcfb('0x47')]['rawAttributes']);_0x38a88e[_0xfcfb('0x33')]=_[_0xfcfb('0x48')](_0x35b2ff[_0xfcfb('0x33')]);_0x38a88e[_0xfcfb('0x34')]=_['intersection'](_0x38a88e[_0xfcfb('0x32')],_0x38a88e[_0xfcfb('0x33')]);_0x301ef2[_0xfcfb('0x36')]=_['intersection'](_0x38a88e[_0xfcfb('0x32')],qs[_0xfcfb('0x37')](_0x35b2ff[_0xfcfb('0x33')]['fields']));_0x301ef2['attributes']=_0x301ef2[_0xfcfb('0x36')]['length']?_0x301ef2[_0xfcfb('0x36')]:_0x38a88e['model'];if(_0x35b2ff['query'][_0xfcfb('0x42')]){_0x301ef2['include']=[{'all':!![]}];}_0x301ef2=_[_0xfcfb('0x3f')]({},_0x301ef2,_0x35b2ff['options']);return db[_0xfcfb('0x47')][_0xfcfb('0x49')](_0x301ef2)['then'](handleEntityNotFound(_0x5b5002,null))['then'](respondWithResult(_0x5b5002,null))['catch'](handleError(_0x5b5002,null));};exports[_0xfcfb('0x4a')]=function(_0x51c722,_0x95dd22){return db[_0xfcfb('0x47')][_0xfcfb('0x4a')](_0x51c722[_0xfcfb('0x4b')],{})[_0xfcfb('0x29')](respondWithResult(_0x95dd22,0xc9))[_0xfcfb('0x44')](handleError(_0x95dd22,null));};exports[_0xfcfb('0x28')]=function(_0x5f2678,_0x58d6bc){if(_0x5f2678['body']['id']){delete _0x5f2678['body']['id'];}return db['ChatGroup']['find']({'where':{'id':_0x5f2678[_0xfcfb('0x46')]['id']}})[_0xfcfb('0x29')](handleEntityNotFound(_0x58d6bc,null))[_0xfcfb('0x29')](saveUpdates(_0x5f2678[_0xfcfb('0x4b')],null))[_0xfcfb('0x29')](respondWithResult(_0x58d6bc,null))[_0xfcfb('0x44')](handleError(_0x58d6bc,null));};exports['destroy']=function(_0x5e1d8e,_0x324776){return db[_0xfcfb('0x47')][_0xfcfb('0x49')]({'where':{'id':_0x5e1d8e[_0xfcfb('0x46')]['id']}})['then'](handleEntityNotFound(_0x324776,null))[_0xfcfb('0x29')](removeEntity(_0x324776,null))[_0xfcfb('0x44')](handleError(_0x324776,null));};exports[_0xfcfb('0x4c')]=function(_0x3415b6,_0x5666b1){return db['ChatGroup']['describe']()['then'](respondWithResult(_0x5666b1,null))[_0xfcfb('0x44')](handleError(_0x5666b1,null));};exports[_0xfcfb('0x4d')]=function(_0x1bdc10,_0xfc342d,_0x4ccfe4){return db[_0xfcfb('0x4e')][_0xfcfb('0x41')]({'where':{'ChatGroupId':_0x1bdc10[_0xfcfb('0x46')]['id'],'ToId':_0x1bdc10['user']['id'],'read':![]}})['then'](function(_0x515092){return{'id':_['toInteger'](_0x1bdc10['params']['id']),'count':_0x515092};})[_0xfcfb('0x29')](respondWithResult(_0xfc342d,null))[_0xfcfb('0x44')](handleError(_0xfc342d,null));};exports[_0xfcfb('0x4f')]=function(_0x2920db,_0x4d15e6,_0x39a76e){return db['ChatGroup'][_0xfcfb('0x49')]({'where':{'id':_0x2920db[_0xfcfb('0x46')]['id']}})[_0xfcfb('0x29')](handleEntityNotFound(_0x4d15e6,null))[_0xfcfb('0x29')](function(_0x38fd47){if(_0x38fd47){return _0x38fd47['addMembers'](_0x2920db[_0xfcfb('0x4b')][_0xfcfb('0x50')],_[_0xfcfb('0x51')](_0x2920db['body'],[_0xfcfb('0x50'),'id'])||{});}})['then'](respondWithResult(_0x4d15e6,null))[_0xfcfb('0x44')](handleError(_0x4d15e6,null));};exports[_0xfcfb('0x52')]=function(_0x179a95,_0x456530,_0x35dab7){var _0x3cad54={};var _0x12fa7d={};var _0x2b5897;var _0x66296;return db[_0xfcfb('0x47')][_0xfcfb('0x53')]({'where':{'id':_0x179a95[_0xfcfb('0x46')]['id']}})[_0xfcfb('0x29')](handleEntityNotFound(_0x456530,null))[_0xfcfb('0x29')](function(_0x4312d0){if(_0x4312d0){_0x2b5897=_0x4312d0;_0x12fa7d[_0xfcfb('0x32')]=_[_0xfcfb('0x48')](db[_0xfcfb('0x54')][_0xfcfb('0x55')]);_0x12fa7d[_0xfcfb('0x33')]=_[_0xfcfb('0x48')](_0x179a95[_0xfcfb('0x33')]);_0x12fa7d[_0xfcfb('0x34')]=_[_0xfcfb('0x35')](_0x12fa7d['model'],_0x12fa7d[_0xfcfb('0x33')]);_0x3cad54[_0xfcfb('0x36')]=_[_0xfcfb('0x35')](_0x12fa7d[_0xfcfb('0x32')],qs[_0xfcfb('0x37')](_0x179a95[_0xfcfb('0x33')][_0xfcfb('0x37')]));_0x3cad54[_0xfcfb('0x36')]=_0x3cad54[_0xfcfb('0x36')][_0xfcfb('0x38')]?_0x3cad54[_0xfcfb('0x36')]:_0x12fa7d[_0xfcfb('0x32')];_0x3cad54[_0xfcfb('0x3a')]=qs['sort'](_0x179a95[_0xfcfb('0x33')][_0xfcfb('0x3b')]);_0x3cad54[_0xfcfb('0x3e')]=qs[_0xfcfb('0x34')](_[_0xfcfb('0x3c')](_0x179a95[_0xfcfb('0x33')],_0x12fa7d[_0xfcfb('0x34')]));if(_0x179a95[_0xfcfb('0x33')]['filter']){_0x3cad54['where']=_[_0xfcfb('0x3f')](_0x3cad54['where'],{'$or':_[_0xfcfb('0x2f')](_0x3cad54['attributes'],function(_0x1fe158){var _0x195a90={};_0x195a90[_0x1fe158]={'$like':'%'+_0x179a95[_0xfcfb('0x33')][_0xfcfb('0x3d')]+'%'};return _0x195a90;})});}_0x3cad54=_[_0xfcfb('0x3f')]({},_0x3cad54,_0x179a95[_0xfcfb('0x40')]);return _0x2b5897['getMembers'](_0x3cad54);}})['then'](function(_0xd1d913){if(_0xd1d913){_0x66296=_0xd1d913[_0xfcfb('0x38')];if(!_0x179a95[_0xfcfb('0x33')][_0xfcfb('0x39')]('nolimit')){_0x3cad54[_0xfcfb('0x22')]=qs['limit'](_0x179a95[_0xfcfb('0x33')][_0xfcfb('0x22')]);_0x3cad54[_0xfcfb('0x20')]=qs[_0xfcfb('0x20')](_0x179a95[_0xfcfb('0x33')][_0xfcfb('0x20')]);}return _0x2b5897[_0xfcfb('0x52')](_0x3cad54);}})[_0xfcfb('0x29')](function(_0x42a66d){if(_0x42a66d){return _0x42a66d?{'count':_0x66296,'rows':_0x42a66d}:null;}})[_0xfcfb('0x29')](respondWithResult(_0x456530,null))['catch'](handleError(_0x456530,null));};exports[_0xfcfb('0x56')]=function(_0x39dc14,_0x1995ff,_0x3c3150){return db[_0xfcfb('0x47')][_0xfcfb('0x49')]({'where':{'id':_0x39dc14[_0xfcfb('0x46')]['id']}})['then'](handleEntityNotFound(_0x1995ff,null))[_0xfcfb('0x29')](function(_0x44e3cd){if(_0x44e3cd){return _0x44e3cd[_0xfcfb('0x56')](_0x39dc14['query'][_0xfcfb('0x50')]);}})[_0xfcfb('0x29')](respondWithStatusCode(_0x1995ff,null))['catch'](handleError(_0x1995ff,null));};exports['addMessage']=function(_0x530f91,_0x1a4096,_0x4822c7){if(_0x530f91[_0xfcfb('0x4b')]['id']){delete _0x530f91[_0xfcfb('0x4b')]['id'];}return db[_0xfcfb('0x47')][_0xfcfb('0x49')]({'where':{'id':_0x530f91[_0xfcfb('0x46')]['id']}})[_0xfcfb('0x29')](handleEntityNotFound(_0x1a4096,null))['then'](function(_0x4bdafa){if(_0x4bdafa){_0x530f91['body'][_0xfcfb('0x57')]=_0x4bdafa['id'];return db[_0xfcfb('0x4e')][_0xfcfb('0x4a')](_0x530f91[_0xfcfb('0x4b')]);}})[_0xfcfb('0x29')](respondWithResult(_0x1a4096,null))[_0xfcfb('0x44')](handleError(_0x1a4096,null));};exports[_0xfcfb('0x58')]=function(_0x418527,_0x22d014,_0x25a028){var _0x73539c={};var _0x36000f={};var _0x3c0fa4;var _0x5681e8;return db[_0xfcfb('0x47')][_0xfcfb('0x53')]({'where':{'id':_0x418527[_0xfcfb('0x46')]['id']}})['then'](handleEntityNotFound(_0x22d014,null))[_0xfcfb('0x29')](function(_0x2fba42){if(_0x2fba42){_0x3c0fa4=_0x2fba42;_0x36000f[_0xfcfb('0x32')]=_[_0xfcfb('0x48')](db['ChatInternalMessage'][_0xfcfb('0x55')]);_0x36000f['query']=_[_0xfcfb('0x48')](_0x418527[_0xfcfb('0x33')]);_0x36000f[_0xfcfb('0x34')]=_[_0xfcfb('0x35')](_0x36000f['model'],_0x36000f[_0xfcfb('0x33')]);_0x73539c[_0xfcfb('0x36')]=_[_0xfcfb('0x35')](_0x36000f[_0xfcfb('0x32')],qs[_0xfcfb('0x37')](_0x418527[_0xfcfb('0x33')]['fields']));_0x73539c[_0xfcfb('0x36')]=_0x73539c[_0xfcfb('0x36')][_0xfcfb('0x38')]?_0x73539c[_0xfcfb('0x36')]:_0x36000f[_0xfcfb('0x32')];_0x73539c[_0xfcfb('0x3a')]=qs['sort'](_0x418527['query']['sort']);_0x73539c[_0xfcfb('0x3e')]=qs[_0xfcfb('0x34')](_[_0xfcfb('0x3c')](_0x418527[_0xfcfb('0x33')],_0x36000f[_0xfcfb('0x34')]));if(_0x418527[_0xfcfb('0x33')][_0xfcfb('0x3d')]){_0x73539c[_0xfcfb('0x3e')]=_[_0xfcfb('0x3f')](_0x73539c[_0xfcfb('0x3e')],{'$or':_[_0xfcfb('0x2f')](_0x73539c[_0xfcfb('0x36')],function(_0x1e505d){var _0xe79db8={};_0xe79db8[_0x1e505d]={'$like':'%'+_0x418527['query'][_0xfcfb('0x3d')]+'%'};return _0xe79db8;})});}if(_0x418527['query'][_0xfcfb('0x59')]){var _0x1816c3=_0x418527['query']['$gte'][_0xfcfb('0x5a')](',');var _0x2e6c44={};_0x2e6c44[_0x1816c3[0x0]]={'$gte':moment(_0x1816c3[0x1])[_0xfcfb('0x5b')](_0xfcfb('0x5c'))};_0x73539c['where']=_[_0xfcfb('0x3f')](_0x73539c['where'],_0x2e6c44);}_0x73539c=_['merge']({},_0x73539c,_0x418527[_0xfcfb('0x40')]);return _0x3c0fa4[_0xfcfb('0x58')](_0x73539c);}})[_0xfcfb('0x29')](function(_0x42ee48){if(_0x42ee48){_0x5681e8=_0x42ee48['length'];if(!_0x418527[_0xfcfb('0x33')]['hasOwnProperty'](_0xfcfb('0x5d'))){_0x73539c[_0xfcfb('0x22')]=qs[_0xfcfb('0x22')](_0x418527[_0xfcfb('0x33')][_0xfcfb('0x22')]);_0x73539c[_0xfcfb('0x20')]=qs['offset'](_0x418527[_0xfcfb('0x33')][_0xfcfb('0x20')]);}return _0x3c0fa4[_0xfcfb('0x58')](_0x73539c);}})['then'](function(_0x15904b){if(_0x15904b){return _0x15904b?{'count':_0x5681e8,'rows':_0x15904b}:null;}})[_0xfcfb('0x29')](respondWithResult(_0x22d014,null))[_0xfcfb('0x44')](handleError(_0x22d014,null));}; \ No newline at end of file +var _0x8f64=['error','name','send','index','map','ChatGroup','rawAttributes','fieldName','key','model','keys','query','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','options','include','rows','catch','show','params','includeAll','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','omit','ids','getMembers','findOne','User','filter','hasOwnProperty','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','localhost','./chatGroup.socket','register','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus'];(function(_0x2ec3b9,_0x30d14a){var _0x30a43f=function(_0x51bd25){while(--_0x51bd25){_0x2ec3b9['push'](_0x2ec3b9['shift']());}};_0x30a43f(++_0x30d14a);}(_0x8f64,0x1be));var _0x48f6=function(_0x30e1ab,_0x1caf0f){_0x30e1ab=_0x30e1ab-0x0;var _0x40deaa=_0x8f64[_0x30e1ab];return _0x40deaa;};'use strict';var emlformat=require(_0x48f6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x48f6('0x1'));var jsonpatch=require(_0x48f6('0x2'));var rp=require(_0x48f6('0x3'));var moment=require(_0x48f6('0x4'));var BPromise=require(_0x48f6('0x5'));var Mustache=require(_0x48f6('0x6'));var util=require(_0x48f6('0x7'));var path=require(_0x48f6('0x8'));var sox=require(_0x48f6('0x9'));var csv=require(_0x48f6('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x48f6('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x48f6('0xc'));var jsforce=require(_0x48f6('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x48f6('0xe'));var Papa=require(_0x48f6('0xf'));var Redis=require(_0x48f6('0x10'));var authService=require(_0x48f6('0x11'));var qs=require(_0x48f6('0x12'));var as=require(_0x48f6('0x13'));var hardwareService=require(_0x48f6('0x14'));var logger=require('../../config/logger')(_0x48f6('0x15'));var utils=require(_0x48f6('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x48f6('0x17'))['db'];config[_0x48f6('0x18')]=_['defaults'](config[_0x48f6('0x18')],{'host':_0x48f6('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x48f6('0x18')]));require(_0x48f6('0x1a'))[_0x48f6('0x1b')](socket);function respondWithStatusCode(_0x34f926,_0x2086b2){_0x2086b2=_0x2086b2||0xcc;return function(_0x69e8fb){if(_0x69e8fb){return _0x34f926['sendStatus'](_0x2086b2);}return _0x34f926[_0x48f6('0x1c')](_0x2086b2)[_0x48f6('0x1d')]();};}function respondWithResult(_0x569d24,_0x31a2d8){_0x31a2d8=_0x31a2d8||0xc8;return function(_0x179596){if(_0x179596){return _0x569d24['status'](_0x31a2d8)['json'](_0x179596);}};}function respondWithFilteredResult(_0x39bfaf,_0x17b2b6){return function(_0x5ce8c4){if(_0x5ce8c4){var _0x3d4e3c=typeof _0x17b2b6[_0x48f6('0x1e')]===_0x48f6('0x1f')&&typeof _0x17b2b6[_0x48f6('0x20')]==='undefined';var _0x235ee2=_0x5ce8c4[_0x48f6('0x21')];var _0x50671a=_0x3d4e3c?0x0:_0x17b2b6[_0x48f6('0x1e')];var _0x411d7b=_0x3d4e3c?_0x5ce8c4[_0x48f6('0x21')]:_0x17b2b6['offset']+_0x17b2b6[_0x48f6('0x20')];var _0x560131;if(_0x411d7b>=_0x235ee2){_0x411d7b=_0x235ee2;_0x560131=0xc8;}else{_0x560131=0xce;}_0x39bfaf[_0x48f6('0x1c')](_0x560131);return _0x39bfaf[_0x48f6('0x22')](_0x48f6('0x23'),_0x50671a+'-'+_0x411d7b+'/'+_0x235ee2)[_0x48f6('0x24')](_0x5ce8c4);}return null;};}function patchUpdates(_0x9b356b){return function(_0x1805b7){try{jsonpatch[_0x48f6('0x25')](_0x1805b7,_0x9b356b,!![]);}catch(_0x3ec460){return BPromise[_0x48f6('0x26')](_0x3ec460);}return _0x1805b7[_0x48f6('0x27')]();};}function saveUpdates(_0x596d43,_0x3627b9){return function(_0xb9b66a){if(_0xb9b66a){return _0xb9b66a[_0x48f6('0x28')](_0x596d43)[_0x48f6('0x29')](function(_0x2381ba){return _0x2381ba;});}return null;};}function removeEntity(_0x3064c2,_0x40b064){return function(_0x2e70cd){if(_0x2e70cd){return _0x2e70cd[_0x48f6('0x2a')]()[_0x48f6('0x29')](function(){_0x3064c2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a93b9,_0x2bcf42){return function(_0x513d15){if(!_0x513d15){_0x3a93b9[_0x48f6('0x2b')](0x194);}return _0x513d15;};}function handleError(_0x5b8a0d,_0x11d062){_0x11d062=_0x11d062||0x1f4;return function(_0x567354){logger[_0x48f6('0x2c')](_0x567354['stack']);if(_0x567354[_0x48f6('0x2d')]){delete _0x567354[_0x48f6('0x2d')];}_0x5b8a0d['status'](_0x11d062)[_0x48f6('0x2e')](_0x567354);};}exports[_0x48f6('0x2f')]=function(_0x2cc040,_0x3ad2fd){var _0x42c76b={},_0xcd82a6={},_0x30024f={'count':0x0,'rows':[]};var _0x359ecf=_[_0x48f6('0x30')](db[_0x48f6('0x31')][_0x48f6('0x32')],function(_0x58f5fa){return{'name':_0x58f5fa[_0x48f6('0x33')],'type':_0x58f5fa['type'][_0x48f6('0x34')]};});_0xcd82a6[_0x48f6('0x35')]=_[_0x48f6('0x30')](_0x359ecf,_0x48f6('0x2d'));_0xcd82a6['query']=_[_0x48f6('0x36')](_0x2cc040[_0x48f6('0x37')]);_0xcd82a6['filters']=_[_0x48f6('0x38')](_0xcd82a6['model'],_0xcd82a6[_0x48f6('0x37')]);_0x42c76b['attributes']=_[_0x48f6('0x38')](_0xcd82a6['model'],qs[_0x48f6('0x39')](_0x2cc040[_0x48f6('0x37')]['fields']));_0x42c76b[_0x48f6('0x3a')]=_0x42c76b['attributes'][_0x48f6('0x3b')]?_0x42c76b['attributes']:_0xcd82a6['model'];if(!_0x2cc040[_0x48f6('0x37')]['hasOwnProperty'](_0x48f6('0x3c'))){_0x42c76b[_0x48f6('0x20')]=qs[_0x48f6('0x20')](_0x2cc040[_0x48f6('0x37')][_0x48f6('0x20')]);_0x42c76b[_0x48f6('0x1e')]=qs['offset'](_0x2cc040[_0x48f6('0x37')][_0x48f6('0x1e')]);}_0x42c76b[_0x48f6('0x3d')]=qs[_0x48f6('0x3e')](_0x2cc040['query'][_0x48f6('0x3e')]);_0x42c76b[_0x48f6('0x3f')]=qs[_0x48f6('0x40')](_[_0x48f6('0x41')](_0x2cc040[_0x48f6('0x37')],_0xcd82a6['filters']),_0x359ecf);if(_0x2cc040['query']['filter']){_0x42c76b[_0x48f6('0x3f')]=_[_0x48f6('0x42')](_0x42c76b[_0x48f6('0x3f')],{'$or':_['map'](_0x359ecf,function(_0x4ea97a){if(_0x4ea97a[_0x48f6('0x43')]!==_0x48f6('0x44')){var _0x4aa905={};_0x4aa905[_0x4ea97a['name']]={'$like':'%'+_0x2cc040[_0x48f6('0x37')]['filter']+'%'};return _0x4aa905;}})});}_0x42c76b=_[_0x48f6('0x42')]({},_0x42c76b,_0x2cc040[_0x48f6('0x45')]);var _0x531915={'where':_0x42c76b[_0x48f6('0x3f')]};return db['ChatGroup']['count'](_0x531915)['then'](function(_0x5741cf){_0x30024f[_0x48f6('0x21')]=_0x5741cf;if(_0x2cc040[_0x48f6('0x37')]['includeAll']){_0x42c76b[_0x48f6('0x46')]=[{'all':!![]}];}return db['ChatGroup']['findAll'](_0x42c76b);})[_0x48f6('0x29')](function(_0x6c7651){_0x30024f[_0x48f6('0x47')]=_0x6c7651;return _0x30024f;})['then'](respondWithFilteredResult(_0x3ad2fd,_0x42c76b))[_0x48f6('0x48')](handleError(_0x3ad2fd,null));};exports[_0x48f6('0x49')]=function(_0x1d5d8a,_0x3f2b63){var _0x4e2a8c={'raw':!![],'where':{'id':_0x1d5d8a[_0x48f6('0x4a')]['id']}},_0x43a52a={};_0x43a52a[_0x48f6('0x35')]=_[_0x48f6('0x36')](db[_0x48f6('0x31')][_0x48f6('0x32')]);_0x43a52a[_0x48f6('0x37')]=_[_0x48f6('0x36')](_0x1d5d8a[_0x48f6('0x37')]);_0x43a52a['filters']=_[_0x48f6('0x38')](_0x43a52a[_0x48f6('0x35')],_0x43a52a[_0x48f6('0x37')]);_0x4e2a8c[_0x48f6('0x3a')]=_[_0x48f6('0x38')](_0x43a52a[_0x48f6('0x35')],qs[_0x48f6('0x39')](_0x1d5d8a[_0x48f6('0x37')]['fields']));_0x4e2a8c['attributes']=_0x4e2a8c[_0x48f6('0x3a')][_0x48f6('0x3b')]?_0x4e2a8c[_0x48f6('0x3a')]:_0x43a52a[_0x48f6('0x35')];if(_0x1d5d8a['query'][_0x48f6('0x4b')]){_0x4e2a8c[_0x48f6('0x46')]=[{'all':!![]}];}_0x4e2a8c=_['merge']({},_0x4e2a8c,_0x1d5d8a['options']);return db[_0x48f6('0x31')][_0x48f6('0x4c')](_0x4e2a8c)[_0x48f6('0x29')](handleEntityNotFound(_0x3f2b63,null))[_0x48f6('0x29')](respondWithResult(_0x3f2b63,null))[_0x48f6('0x48')](handleError(_0x3f2b63,null));};exports[_0x48f6('0x4d')]=function(_0x43655b,_0x322013){return db['ChatGroup'][_0x48f6('0x4d')](_0x43655b[_0x48f6('0x4e')],{})[_0x48f6('0x29')](respondWithResult(_0x322013,0xc9))[_0x48f6('0x48')](handleError(_0x322013,null));};exports[_0x48f6('0x28')]=function(_0x61d642,_0x31ff62){if(_0x61d642[_0x48f6('0x4e')]['id']){delete _0x61d642['body']['id'];}return db['ChatGroup'][_0x48f6('0x4c')]({'where':{'id':_0x61d642[_0x48f6('0x4a')]['id']}})[_0x48f6('0x29')](handleEntityNotFound(_0x31ff62,null))[_0x48f6('0x29')](saveUpdates(_0x61d642[_0x48f6('0x4e')],null))[_0x48f6('0x29')](respondWithResult(_0x31ff62,null))[_0x48f6('0x48')](handleError(_0x31ff62,null));};exports['destroy']=function(_0x4af4f8,_0x285e32){return db['ChatGroup']['find']({'where':{'id':_0x4af4f8[_0x48f6('0x4a')]['id']}})[_0x48f6('0x29')](handleEntityNotFound(_0x285e32,null))[_0x48f6('0x29')](removeEntity(_0x285e32,null))['catch'](handleError(_0x285e32,null));};exports[_0x48f6('0x4f')]=function(_0x4949b7,_0x1bfa35){return db['ChatGroup']['describe']()['then'](respondWithResult(_0x1bfa35,null))[_0x48f6('0x48')](handleError(_0x1bfa35,null));};exports[_0x48f6('0x50')]=function(_0x558407,_0x408012,_0x4ffb60){return db[_0x48f6('0x51')][_0x48f6('0x21')]({'where':{'ChatGroupId':_0x558407['params']['id'],'ToId':_0x558407[_0x48f6('0x52')]['id'],'read':![]}})[_0x48f6('0x29')](function(_0x2cae28){return{'id':_[_0x48f6('0x53')](_0x558407[_0x48f6('0x4a')]['id']),'count':_0x2cae28};})[_0x48f6('0x29')](respondWithResult(_0x408012,null))['catch'](handleError(_0x408012,null));};exports['addMembers']=function(_0x448d71,_0x2927e3,_0x5ef4b1){return db['ChatGroup'][_0x48f6('0x4c')]({'where':{'id':_0x448d71['params']['id']}})[_0x48f6('0x29')](handleEntityNotFound(_0x2927e3,null))['then'](function(_0x1c2b86){if(_0x1c2b86){return _0x1c2b86['addMembers'](_0x448d71[_0x48f6('0x4e')]['ids'],_[_0x48f6('0x54')](_0x448d71[_0x48f6('0x4e')],[_0x48f6('0x55'),'id'])||{});}})[_0x48f6('0x29')](respondWithResult(_0x2927e3,null))[_0x48f6('0x48')](handleError(_0x2927e3,null));};exports[_0x48f6('0x56')]=function(_0xb678bf,_0x5e3eb9,_0x586d5a){var _0x5ecebb={};var _0x47a882={};var _0x45daee;var _0x150d78;return db[_0x48f6('0x31')][_0x48f6('0x57')]({'where':{'id':_0xb678bf[_0x48f6('0x4a')]['id']}})[_0x48f6('0x29')](handleEntityNotFound(_0x5e3eb9,null))['then'](function(_0x202a96){if(_0x202a96){_0x45daee=_0x202a96;_0x47a882['model']=_['keys'](db[_0x48f6('0x58')][_0x48f6('0x32')]);_0x47a882[_0x48f6('0x37')]=_[_0x48f6('0x36')](_0xb678bf['query']);_0x47a882[_0x48f6('0x40')]=_[_0x48f6('0x38')](_0x47a882['model'],_0x47a882[_0x48f6('0x37')]);_0x5ecebb[_0x48f6('0x3a')]=_[_0x48f6('0x38')](_0x47a882[_0x48f6('0x35')],qs[_0x48f6('0x39')](_0xb678bf[_0x48f6('0x37')][_0x48f6('0x39')]));_0x5ecebb[_0x48f6('0x3a')]=_0x5ecebb['attributes']['length']?_0x5ecebb['attributes']:_0x47a882['model'];_0x5ecebb[_0x48f6('0x3d')]=qs[_0x48f6('0x3e')](_0xb678bf['query'][_0x48f6('0x3e')]);_0x5ecebb[_0x48f6('0x3f')]=qs[_0x48f6('0x40')](_[_0x48f6('0x41')](_0xb678bf[_0x48f6('0x37')],_0x47a882[_0x48f6('0x40')]));if(_0xb678bf[_0x48f6('0x37')][_0x48f6('0x59')]){_0x5ecebb['where']=_['merge'](_0x5ecebb[_0x48f6('0x3f')],{'$or':_['map'](_0x5ecebb[_0x48f6('0x3a')],function(_0x2a38ce){var _0x559527={};_0x559527[_0x2a38ce]={'$like':'%'+_0xb678bf['query']['filter']+'%'};return _0x559527;})});}_0x5ecebb=_[_0x48f6('0x42')]({},_0x5ecebb,_0xb678bf[_0x48f6('0x45')]);return _0x45daee[_0x48f6('0x56')](_0x5ecebb);}})[_0x48f6('0x29')](function(_0x1ec7f1){if(_0x1ec7f1){_0x150d78=_0x1ec7f1[_0x48f6('0x3b')];if(!_0xb678bf[_0x48f6('0x37')][_0x48f6('0x5a')](_0x48f6('0x3c'))){_0x5ecebb[_0x48f6('0x20')]=qs[_0x48f6('0x20')](_0xb678bf[_0x48f6('0x37')][_0x48f6('0x20')]);_0x5ecebb['offset']=qs['offset'](_0xb678bf[_0x48f6('0x37')][_0x48f6('0x1e')]);}return _0x45daee[_0x48f6('0x56')](_0x5ecebb);}})[_0x48f6('0x29')](function(_0x59af26){if(_0x59af26){return _0x59af26?{'count':_0x150d78,'rows':_0x59af26}:null;}})[_0x48f6('0x29')](respondWithResult(_0x5e3eb9,null))['catch'](handleError(_0x5e3eb9,null));};exports[_0x48f6('0x5b')]=function(_0x1ad747,_0x1fe954,_0x4e1678){return db[_0x48f6('0x31')][_0x48f6('0x4c')]({'where':{'id':_0x1ad747[_0x48f6('0x4a')]['id']}})[_0x48f6('0x29')](handleEntityNotFound(_0x1fe954,null))['then'](function(_0x27dae5){if(_0x27dae5){return _0x27dae5[_0x48f6('0x5b')](_0x1ad747[_0x48f6('0x37')][_0x48f6('0x55')]);}})['then'](respondWithStatusCode(_0x1fe954,null))[_0x48f6('0x48')](handleError(_0x1fe954,null));};exports[_0x48f6('0x5c')]=function(_0x1b6e36,_0x549231,_0x43eb0c){if(_0x1b6e36[_0x48f6('0x4e')]['id']){delete _0x1b6e36[_0x48f6('0x4e')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x1b6e36[_0x48f6('0x4a')]['id']}})[_0x48f6('0x29')](handleEntityNotFound(_0x549231,null))[_0x48f6('0x29')](function(_0x328819){if(_0x328819){_0x1b6e36['body'][_0x48f6('0x5d')]=_0x328819['id'];return db[_0x48f6('0x51')][_0x48f6('0x4d')](_0x1b6e36[_0x48f6('0x4e')]);}})[_0x48f6('0x29')](respondWithResult(_0x549231,null))[_0x48f6('0x48')](handleError(_0x549231,null));};exports[_0x48f6('0x5e')]=function(_0x3e780d,_0xb0e0fb,_0x5e3eb0){var _0x241e96={};var _0x57dbd7={};var _0x19d731;var _0x3a9fb8;return db[_0x48f6('0x31')][_0x48f6('0x57')]({'where':{'id':_0x3e780d[_0x48f6('0x4a')]['id']}})[_0x48f6('0x29')](handleEntityNotFound(_0xb0e0fb,null))[_0x48f6('0x29')](function(_0x16f551){if(_0x16f551){_0x19d731=_0x16f551;_0x57dbd7[_0x48f6('0x35')]=_[_0x48f6('0x36')](db[_0x48f6('0x51')][_0x48f6('0x32')]);_0x57dbd7[_0x48f6('0x37')]=_['keys'](_0x3e780d['query']);_0x57dbd7[_0x48f6('0x40')]=_[_0x48f6('0x38')](_0x57dbd7[_0x48f6('0x35')],_0x57dbd7[_0x48f6('0x37')]);_0x241e96['attributes']=_[_0x48f6('0x38')](_0x57dbd7[_0x48f6('0x35')],qs['fields'](_0x3e780d[_0x48f6('0x37')]['fields']));_0x241e96['attributes']=_0x241e96[_0x48f6('0x3a')][_0x48f6('0x3b')]?_0x241e96['attributes']:_0x57dbd7['model'];_0x241e96[_0x48f6('0x3d')]=qs[_0x48f6('0x3e')](_0x3e780d[_0x48f6('0x37')][_0x48f6('0x3e')]);_0x241e96[_0x48f6('0x3f')]=qs[_0x48f6('0x40')](_[_0x48f6('0x41')](_0x3e780d[_0x48f6('0x37')],_0x57dbd7['filters']));if(_0x3e780d[_0x48f6('0x37')][_0x48f6('0x59')]){_0x241e96['where']=_[_0x48f6('0x42')](_0x241e96[_0x48f6('0x3f')],{'$or':_[_0x48f6('0x30')](_0x241e96['attributes'],function(_0x2b933d){var _0x1b046c={};_0x1b046c[_0x2b933d]={'$like':'%'+_0x3e780d[_0x48f6('0x37')]['filter']+'%'};return _0x1b046c;})});}if(_0x3e780d[_0x48f6('0x37')]['$gte']){var _0x488a63=_0x3e780d[_0x48f6('0x37')][_0x48f6('0x5f')][_0x48f6('0x60')](',');var _0x414381={};_0x414381[_0x488a63[0x0]]={'$gte':moment(_0x488a63[0x1])[_0x48f6('0x61')]('YYYY-MM-DD\x20HH:mm:ss')};_0x241e96[_0x48f6('0x3f')]=_[_0x48f6('0x42')](_0x241e96[_0x48f6('0x3f')],_0x414381);}_0x241e96=_[_0x48f6('0x42')]({},_0x241e96,_0x3e780d[_0x48f6('0x45')]);return _0x19d731[_0x48f6('0x5e')](_0x241e96);}})[_0x48f6('0x29')](function(_0x337ab1){if(_0x337ab1){_0x3a9fb8=_0x337ab1[_0x48f6('0x3b')];if(!_0x3e780d[_0x48f6('0x37')][_0x48f6('0x5a')](_0x48f6('0x3c'))){_0x241e96[_0x48f6('0x20')]=qs['limit'](_0x3e780d[_0x48f6('0x37')][_0x48f6('0x20')]);_0x241e96[_0x48f6('0x1e')]=qs[_0x48f6('0x1e')](_0x3e780d[_0x48f6('0x37')][_0x48f6('0x1e')]);}return _0x19d731['getMessages'](_0x241e96);}})['then'](function(_0x37e995){if(_0x37e995){return _0x37e995?{'count':_0x3a9fb8,'rows':_0x37e995}:null;}})['then'](respondWithResult(_0xb0e0fb,null))['catch'](handleError(_0xb0e0fb,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 3b4dde2..7ddbd26 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 _0xae24=['update','remove','emit','hasOwnProperty','hook','exports','ChatGroup','setMaxListeners','save'];(function(_0x47e3ef,_0x551b2c){var _0x502417=function(_0x500211){while(--_0x500211){_0x47e3ef['push'](_0x47e3ef['shift']());}};_0x502417(++_0x551b2c);}(_0xae24,0x180));var _0x4ae2=function(_0xb877b3,_0x1b5983){_0xb877b3=_0xb877b3-0x0;var _0x4ee4df=_0xae24[_0xb877b3];return _0x4ee4df;};'use strict';var EventEmitter=require('events');var ChatGroup=require('../../mysqldb')['db'][_0x4ae2('0x0')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x4ae2('0x1')](0x0);var events={'afterCreate':_0x4ae2('0x2'),'afterUpdate':_0x4ae2('0x3'),'afterDestroy':_0x4ae2('0x4')};function emitEvent(_0x239088){return function(_0x3987a2,_0x53713e,_0x1d88d0){ChatGroupEvents[_0x4ae2('0x5')](_0x239088+':'+_0x3987a2['id'],_0x3987a2);ChatGroupEvents['emit'](_0x239088,_0x3987a2);_0x1d88d0(null);};}for(var e in events){if(events[_0x4ae2('0x6')](e)){var event=events[e];ChatGroup[_0x4ae2('0x7')](e,emitEvent(event));}}module[_0x4ae2('0x8')]=ChatGroupEvents; \ No newline at end of file +var _0xbca0=['../../mysqldb','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x5a68ac,_0x55cf4f){var _0xe7d5db=function(_0x53ebe2){while(--_0x53ebe2){_0x5a68ac['push'](_0x5a68ac['shift']());}};_0xe7d5db(++_0x55cf4f);}(_0xbca0,0x8b));var _0x0bca=function(_0x12f9e9,_0x2c05b7){_0x12f9e9=_0x12f9e9-0x0;var _0x31cae9=_0xbca0[_0x12f9e9];return _0x31cae9;};'use strict';var EventEmitter=require(_0x0bca('0x0'));var ChatGroup=require(_0x0bca('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0bca('0x2'),'afterDestroy':_0x0bca('0x3')};function emitEvent(_0x3ce28e){return function(_0x1a6cb5,_0x595711,_0x494f51){ChatGroupEvents[_0x0bca('0x4')](_0x3ce28e+':'+_0x1a6cb5['id'],_0x1a6cb5);ChatGroupEvents[_0x0bca('0x4')](_0x3ce28e,_0x1a6cb5);_0x494f51(null);};}for(var e in events){if(events[_0x0bca('0x5')](e)){var event=events[e];ChatGroup[_0x0bca('0x6')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index ad35c9e..4b28c8d 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 _0x90f8=['../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x21f16b,_0x286e51){var _0xcf99d9=function(_0xaee82){while(--_0xaee82){_0x21f16b['push'](_0x21f16b['shift']());}};_0xcf99d9(++_0x286e51);}(_0x90f8,0x1b2));var _0x890f=function(_0x201ac7,_0x5a0ffd){_0x201ac7=_0x201ac7-0x0;var _0xddd62b=_0x90f8[_0x201ac7];return _0xddd62b;};'use strict';var _=require(_0x890f('0x0'));var util=require(_0x890f('0x1'));var logger=require('../../config/logger')(_0x890f('0x2'));var moment=require(_0x890f('0x3'));var BPromise=require(_0x890f('0x4'));var rp=require(_0x890f('0x5'));var fs=require('fs');var path=require(_0x890f('0x6'));var rimraf=require(_0x890f('0x7'));var config=require(_0x890f('0x8'));var attributes=require(_0x890f('0x9'));module[_0x890f('0xa')]=function(_0x33700d,_0x51d3c6){return _0x33700d[_0x890f('0xb')](_0x890f('0xc'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5cfa=['define','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4f096e,_0x30d3c3){var _0x4a33ce=function(_0x107ba6){while(--_0x107ba6){_0x4f096e['push'](_0x4f096e['shift']());}};_0x4a33ce(++_0x30d3c3);}(_0x5cfa,0xd9));var _0xa5cf=function(_0x2de4cb,_0xe3bc3b){_0x2de4cb=_0x2de4cb-0x0;var _0x668608=_0x5cfa[_0x2de4cb];return _0x668608;};'use strict';var _=require('lodash');var util=require(_0xa5cf('0x0'));var logger=require(_0xa5cf('0x1'))('api');var moment=require(_0xa5cf('0x2'));var BPromise=require(_0xa5cf('0x3'));var rp=require(_0xa5cf('0x4'));var fs=require('fs');var path=require(_0xa5cf('0x5'));var rimraf=require(_0xa5cf('0x6'));var config=require(_0xa5cf('0x7'));var attributes=require('./chatGroup.attributes');module['exports']=function(_0x1261ec,_0x26d544){return _0x1261ec[_0xa5cf('0x8')]('ChatGroup',attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index 16bc65f..f856622 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 _0xc01b=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x1034ee,_0x12998c){var _0x2922af=function(_0x13715a){while(--_0x13715a){_0x1034ee['push'](_0x1034ee['shift']());}};_0x2922af(++_0x12998c);}(_0xc01b,0x65));var _0xbc01=function(_0x120caa,_0x5e4c35){_0x120caa=_0x120caa-0x0;var _0x128aaa=_0xc01b[_0x120caa];return _0x128aaa;};'use strict';var _=require(_0xbc01('0x0'));var util=require(_0xbc01('0x1'));var moment=require(_0xbc01('0x2'));var BPromise=require(_0xbc01('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbc01('0x4'));var db=require(_0xbc01('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xbc01('0x6'));var jayson=require(_0xbc01('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0xbc01('0x8')]=_[_0xbc01('0x9')](config[_0xbc01('0x8')],{'host':_0xbc01('0xa'),'port':0x18eb});var socket=require(_0xbc01('0xb'))(new Redis(config[_0xbc01('0x8')]));require(_0xbc01('0xc'))['register'](socket);function respondWithRpcPromise(_0x46f01c,_0x3cc11e,_0x3b7f4d){return new BPromise(function(_0x1d84e8,_0xa0d0b1){return client[_0xbc01('0xd')](_0x46f01c,_0x3b7f4d)[_0xbc01('0xe')](function(_0x28067a){logger[_0xbc01('0xf')](_0xbc01('0x10'),_0x3cc11e,_0xbc01('0x11'));logger[_0xbc01('0x12')](_0xbc01('0x13'),_0x3cc11e,_0xbc01('0x11'),JSON['stringify'](_0x28067a));if(_0x28067a[_0xbc01('0x14')]){if(_0x28067a[_0xbc01('0x14')][_0xbc01('0x15')]===0x1f4){logger['error'](_0xbc01('0x10'),_0x3cc11e,_0x28067a[_0xbc01('0x14')]['message']);return _0xa0d0b1(_0x28067a[_0xbc01('0x14')][_0xbc01('0x16')]);}logger[_0xbc01('0x14')](_0xbc01('0x10'),_0x3cc11e,_0x28067a['error']['message']);return _0x1d84e8(_0x28067a[_0xbc01('0x14')][_0xbc01('0x16')]);}else{logger['info'](_0xbc01('0x10'),_0x3cc11e,'request\x20sent');_0x1d84e8(_0x28067a[_0xbc01('0x17')][_0xbc01('0x16')]);}})[_0xbc01('0x18')](function(_0x1e79d0){logger['error'](_0xbc01('0x10'),_0x3cc11e,_0x1e79d0);_0xa0d0b1(_0x1e79d0);});});} \ No newline at end of file +var _0xd0a4=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','http','redis','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird'];(function(_0xb1c41,_0x1bfbc6){var _0x3478a4=function(_0x3f9273){while(--_0x3f9273){_0xb1c41['push'](_0xb1c41['shift']());}};_0x3478a4(++_0x1bfbc6);}(_0xd0a4,0x13e));var _0x4d0a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd0a4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4d0a('0x0'));var util=require(_0x4d0a('0x1'));var moment=require(_0x4d0a('0x2'));var BPromise=require(_0x4d0a('0x3'));var rs=require(_0x4d0a('0x4'));var fs=require('fs');var Redis=require(_0x4d0a('0x5'));var db=require(_0x4d0a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4d0a('0x7'))(_0x4d0a('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x4d0a('0x9')]({'port':0x232a});config[_0x4d0a('0xa')]=_['defaults'](config[_0x4d0a('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4d0a('0xa')]));require(_0x4d0a('0xb'))[_0x4d0a('0xc')](socket);function respondWithRpcPromise(_0x4adc33,_0x10b7c7,_0x1b05da){return new BPromise(function(_0x29d5ff,_0x3be4ea){return client[_0x4d0a('0xd')](_0x4adc33,_0x1b05da)[_0x4d0a('0xe')](function(_0x1b7c41){logger[_0x4d0a('0xf')](_0x4d0a('0x10'),_0x10b7c7,_0x4d0a('0x11'));logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x10b7c7,_0x4d0a('0x11'),JSON[_0x4d0a('0x12')](_0x1b7c41));if(_0x1b7c41[_0x4d0a('0x13')]){if(_0x1b7c41[_0x4d0a('0x13')][_0x4d0a('0x14')]===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x10b7c7,_0x1b7c41[_0x4d0a('0x13')]['message']);return _0x3be4ea(_0x1b7c41[_0x4d0a('0x13')][_0x4d0a('0x15')]);}logger[_0x4d0a('0x13')](_0x4d0a('0x10'),_0x10b7c7,_0x1b7c41[_0x4d0a('0x13')][_0x4d0a('0x15')]);return _0x29d5ff(_0x1b7c41[_0x4d0a('0x13')][_0x4d0a('0x15')]);}else{logger[_0x4d0a('0xf')]('ChatGroup,\x20%s,\x20%s',_0x10b7c7,_0x4d0a('0x11'));_0x29d5ff(_0x1b7c41['result']['message']);}})[_0x4d0a('0x16')](function(_0x3aa85b){logger[_0x4d0a('0x13')]('ChatGroup,\x20%s,\x20%s',_0x10b7c7,_0x3aa85b);_0x3be4ea(_0x3aa85b);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 884bbf8..186569a 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 _0x4f7c=['save','remove','update','emit','removeListener','length','chatGroup:','./chatGroup.events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4f7c,0x1e7));var _0xc4f7=function(_0x5e4f9f,_0x18b477){_0x5e4f9f=_0x5e4f9f-0x0;var _0x3d131c=_0x4f7c[_0x5e4f9f];return _0x3d131c;};'use strict';var ChatGroupEvents=require(_0xc4f7('0x0'));var events=[_0xc4f7('0x1'),_0xc4f7('0x2'),_0xc4f7('0x3')];function createListener(_0xa3d370,_0x434313){return function(_0x56e1b5){_0x434313[_0xc4f7('0x4')](_0xa3d370,_0x56e1b5);};}function removeListener(_0x482463,_0x372e07){return function(){ChatGroupEvents[_0xc4f7('0x5')](_0x482463,_0x372e07);};}exports['register']=function(_0x41b917){for(var _0x522da1=0x0,_0x37e1f5=events[_0xc4f7('0x6')];_0x522da1<_0x37e1f5;_0x522da1++){var _0xc70ba7=events[_0x522da1];var _0x2d6301=createListener(_0xc4f7('0x7')+_0xc70ba7,_0x41b917);ChatGroupEvents['on'](_0xc70ba7,_0x2d6301);}}; \ No newline at end of file +var _0x4326=['remove','removeListener','length'];(function(_0x53b3b3,_0x2f3a6f){var _0x3bdc9f=function(_0x5282bd){while(--_0x5282bd){_0x53b3b3['push'](_0x53b3b3['shift']());}};_0x3bdc9f(++_0x2f3a6f);}(_0x4326,0x15c));var _0x6432=function(_0x36b088,_0x1871a6){_0x36b088=_0x36b088-0x0;var _0x233f74=_0x4326[_0x36b088];return _0x233f74;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=['save',_0x6432('0x0'),'update'];function createListener(_0x2bcce7,_0x5d54a3){return function(_0x1fd123){_0x5d54a3['emit'](_0x2bcce7,_0x1fd123);};}function removeListener(_0x2d397c,_0x535e2f){return function(){ChatGroupEvents[_0x6432('0x1')](_0x2d397c,_0x535e2f);};}exports['register']=function(_0x11f4f0){for(var _0x5a3312=0x0,_0x471104=events[_0x6432('0x2')];_0x5a3312<_0x471104;_0x5a3312++){var _0xb252a8=events[_0x5a3312];var _0x54039b=createListener('chatGroup:'+_0xb252a8,_0x11f4f0);ChatGroupEvents['on'](_0xb252a8,_0x54039b);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 0559497..59554d5 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 _0x1e1f=['removeMembers','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','/describe','isAuthenticated','describe','getUnread','getMembers','/:id/messages','getMessages','post','/:id/members','addMembers','addMessage','put','update','delete','/:id','destroy'];(function(_0x5c5095,_0x4e7925){var _0x5d67fb=function(_0x4a1f27){while(--_0x4a1f27){_0x5c5095['push'](_0x5c5095['shift']());}};_0x5d67fb(++_0x4e7925);}(_0x1e1f,0x18a));var _0xf1e1=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x1e1f[_0x1035c1];return _0x308d67;};'use strict';var multer=require(_0xf1e1('0x0'));var util=require('util');var path=require(_0xf1e1('0x1'));var timeout=require(_0xf1e1('0x2'));var express=require(_0xf1e1('0x3'));var router=express[_0xf1e1('0x4')]();var fs_extra=require(_0xf1e1('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf1e1('0x6'));var config=require(_0xf1e1('0x7'));var controller=require(_0xf1e1('0x8'));router[_0xf1e1('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf1e1('0x9')](_0xf1e1('0xa'),auth[_0xf1e1('0xb')](),controller[_0xf1e1('0xc')]);router[_0xf1e1('0x9')]('/:id',auth[_0xf1e1('0xb')](),controller['show']);router[_0xf1e1('0x9')]('/:id/unread',auth['isAuthenticated'](),controller[_0xf1e1('0xd')]);router[_0xf1e1('0x9')]('/:id/members',auth[_0xf1e1('0xb')](),controller[_0xf1e1('0xe')]);router[_0xf1e1('0x9')](_0xf1e1('0xf'),auth[_0xf1e1('0xb')](),controller[_0xf1e1('0x10')]);router[_0xf1e1('0x11')]('/',auth[_0xf1e1('0xb')](),controller['create']);router[_0xf1e1('0x11')](_0xf1e1('0x12'),auth[_0xf1e1('0xb')](),controller[_0xf1e1('0x13')]);router['post'](_0xf1e1('0xf'),auth[_0xf1e1('0xb')](),controller[_0xf1e1('0x14')]);router[_0xf1e1('0x15')]('/:id',auth[_0xf1e1('0xb')](),controller[_0xf1e1('0x16')]);router[_0xf1e1('0x17')](_0xf1e1('0x18'),auth['isAuthenticated'](),controller[_0xf1e1('0x19')]);router[_0xf1e1('0x17')](_0xf1e1('0x12'),auth[_0xf1e1('0xb')](),controller[_0xf1e1('0x1a')]);module[_0xf1e1('0x1b')]=router; \ No newline at end of file +var _0xe7fb=['destroy','removeMembers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./chatGroup.controller','isAuthenticated','index','get','/describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','post','create','addMembers','put','update','delete'];(function(_0x458c6e,_0x228cf1){var _0x3f38ad=function(_0x2c2b49){while(--_0x2c2b49){_0x458c6e['push'](_0x458c6e['shift']());}};_0x3f38ad(++_0x228cf1);}(_0xe7fb,0xb1));var _0xbe7f=function(_0x45a082,_0x3a5f85){_0x45a082=_0x45a082-0x0;var _0x71276=_0xe7fb[_0x45a082];return _0x71276;};'use strict';var multer=require(_0xbe7f('0x0'));var util=require(_0xbe7f('0x1'));var path=require(_0xbe7f('0x2'));var timeout=require(_0xbe7f('0x3'));var express=require(_0xbe7f('0x4'));var router=express[_0xbe7f('0x5')]();var fs_extra=require(_0xbe7f('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xbe7f('0x7'));var config=require('../../config/environment');var controller=require(_0xbe7f('0x8'));router['get']('/',auth[_0xbe7f('0x9')](),controller[_0xbe7f('0xa')]);router[_0xbe7f('0xb')](_0xbe7f('0xc'),auth[_0xbe7f('0x9')](),controller['describe']);router[_0xbe7f('0xb')](_0xbe7f('0xd'),auth[_0xbe7f('0x9')](),controller[_0xbe7f('0xe')]);router[_0xbe7f('0xb')](_0xbe7f('0xf'),auth['isAuthenticated'](),controller[_0xbe7f('0x10')]);router[_0xbe7f('0xb')](_0xbe7f('0x11'),auth[_0xbe7f('0x9')](),controller[_0xbe7f('0x12')]);router['get'](_0xbe7f('0x13'),auth[_0xbe7f('0x9')](),controller['getMessages']);router[_0xbe7f('0x14')]('/',auth['isAuthenticated'](),controller[_0xbe7f('0x15')]);router[_0xbe7f('0x14')]('/:id/members',auth[_0xbe7f('0x9')](),controller[_0xbe7f('0x16')]);router['post'](_0xbe7f('0x13'),auth[_0xbe7f('0x9')](),controller['addMessage']);router[_0xbe7f('0x17')]('/:id',auth[_0xbe7f('0x9')](),controller[_0xbe7f('0x18')]);router[_0xbe7f('0x19')](_0xbe7f('0xd'),auth[_0xbe7f('0x9')](),controller[_0xbe7f('0x1a')]);router[_0xbe7f('0x19')](_0xbe7f('0x11'),auth['isAuthenticated'](),controller[_0xbe7f('0x1b')]);module[_0xbe7f('0x1c')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 9fd7cbd..9dd61a1 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 _0xceb0=['out','BOOLEAN','ENUM','thumb','star','TEXT','DATE','STRING','long'];(function(_0xb0f253,_0x476cc1){var _0x25dbbe=function(_0x52a034){while(--_0x52a034){_0xb0f253['push'](_0xb0f253['shift']());}};_0x25dbbe(++_0x476cc1);}(_0xceb0,0x173));var _0x0ceb=function(_0x1f0a82,_0x5e5880){_0x1f0a82=_0x1f0a82-0x0;var _0x432397=_0xceb0[_0x1f0a82];return _0x432397;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x0ceb('0x0')]('star',_0x0ceb('0x1')),'defaultValue':_0x0ceb('0x2')},'ratingMessage':{'type':Sequelize[_0x0ceb('0x3')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x0ceb('0x4')]},'disposition':{'type':Sequelize[_0x0ceb('0x5')]},'secondDisposition':{'type':Sequelize[_0x0ceb('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x0ceb('0x5')]},'browserName':{'type':Sequelize[_0x0ceb('0x5')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x0ceb('0x5')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x0ceb('0x5')]},'deviceVendor':{'type':Sequelize[_0x0ceb('0x5')]},'deviceType':{'type':Sequelize[_0x0ceb('0x5')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x0ceb('0x3')](_0x0ceb('0x6'))},'read1stAt':{'type':Sequelize[_0x0ceb('0x4')]},'lastMsgAt':{'type':Sequelize[_0x0ceb('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x0ceb('0x0')]('in',_0x0ceb('0x7')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x0ceb('0x5')]},'vidaooSessionId':{'type':Sequelize[_0x0ceb('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x0ceb('0x8')],'defaultValue':![]}}; \ No newline at end of file +var _0x57f8=['out','exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','long'];(function(_0x142900,_0x2c1ea4){var _0x1c5a43=function(_0xce427f){while(--_0xce427f){_0x142900['push'](_0x142900['shift']());}};_0x1c5a43(++_0x2c1ea4);}(_0x57f8,0x198));var _0x857f=function(_0x1fa469,_0x5e19b1){_0x1fa469=_0x1fa469-0x0;var _0x22cc36=_0x57f8[_0x1fa469];return _0x22cc36;};'use strict';var Sequelize=require('sequelize');module[_0x857f('0x0')]={'closed':{'type':Sequelize[_0x857f('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x857f('0x2')]},'ratingType':{'type':Sequelize[_0x857f('0x3')](_0x857f('0x4'),_0x857f('0x5')),'defaultValue':_0x857f('0x4')},'ratingMessage':{'type':Sequelize[_0x857f('0x6')]},'pathTranscript':{'type':Sequelize[_0x857f('0x6')]},'mailTranscript':{'type':Sequelize[_0x857f('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x857f('0x8')]},'disposition':{'type':Sequelize[_0x857f('0x7')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x857f('0x7')]},'note':{'type':Sequelize[_0x857f('0x7')]},'browserName':{'type':Sequelize[_0x857f('0x7')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x857f('0x7')]},'osVersion':{'type':Sequelize[_0x857f('0x7')]},'deviceModel':{'type':Sequelize[_0x857f('0x7')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x857f('0x7')]},'referer':{'type':Sequelize[_0x857f('0x6')]},'customerIp':{'type':Sequelize[_0x857f('0x7')]},'formData':{'type':Sequelize['TEXT'](_0x857f('0x9'))},'read1stAt':{'type':Sequelize[_0x857f('0x8')]},'lastMsgAt':{'type':Sequelize[_0x857f('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x857f('0x3')]('in',_0x857f('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x857f('0x7')]},'customerPort':{'type':Sequelize[_0x857f('0x7')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x857f('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 4bedfc8..2b22916 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 _0x2e7c=['\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','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.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','i.ChatWebsiteId\x20IS\x20NULL','toString','sequelize','keyBy','unreadMessages','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','push','all','rows','show','params','rawAttributes','include','merge','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','email','contact','isNull','follow','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Sequelize','join_url','out','updateAttributes','customUpdate','CmContact','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','AbandonInteraction','attachmentUpload','filename','mimetype','Attachment','attachmentDownload','attachId','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','download','close','mailTranscript','root','server/files/chat/upload/','format','now','pathTranscript','ChatMessage','Messages','%s%d','customer','agentIdentifier','website_alias','System','alias','agent_fullname','agentAlias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','secure','authentication','auth','pass','sendMail','\x22%s\x22\x20<%s>','addMessage','omit','ids','nolimit','pick','ChatInteractionId','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','findAll','getMyMessages','hasOwnProperty','includeAgent','addTags','setTags','spread','emit','chatInteractionTags:save','removeTags','unix','server','files','tmp','attachments','transcript-%d-%s.zip','lastName','Owner','get','mkdirSync','Chat','Account','N.A.','closedAt','browserName','osName','customerIp','customerPort','tail','basename','existsSync','createReadStream','pipe','createWriteStream','renderFile','views','downloadInteraction.ejs','.pdf','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','socket.io-emitter','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','destroy','name','render','body','agent','interaction','account','map','fullname','TagIds','Tags','split','talking','unmanaged','abandoned','closed','waiting','UserId','disposition','total','ChatInteraction','fieldName','type','key','query','keys','intersection','attributes','model','fields','length','order','sort','filters','select','field','color','tools_tags','u.id','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','a.id\x20=\x20i.ChatWebsiteId','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','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','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','start','isEmpty','ChatWebsiteId','where','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','\x20IS\x20NULL'];(function(_0x35452,_0x56058a){var _0x5deb02=function(_0x937500){while(--_0x937500){_0x35452['push'](_0x35452['shift']());}};_0x5deb02(++_0x56058a);}(_0x2e7c,0xae));var _0xc2e7=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0x2e7c[_0x2f1762];return _0x8ab21;};'use strict';var emlformat=require(_0xc2e7('0x0'));var rimraf=require(_0xc2e7('0x1'));var zipdir=require(_0xc2e7('0x2'));var jsonpatch=require(_0xc2e7('0x3'));var rp=require(_0xc2e7('0x4'));var moment=require(_0xc2e7('0x5'));var BPromise=require(_0xc2e7('0x6'));var Mustache=require('mustache');var util=require(_0xc2e7('0x7'));var path=require(_0xc2e7('0x8'));var sox=require(_0xc2e7('0x9'));var csv=require(_0xc2e7('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc2e7('0xb'));var squel=require('squel');var crypto=require(_0xc2e7('0xc'));var jsforce=require(_0xc2e7('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc2e7('0xa'));var querystring=require(_0xc2e7('0xe'));var Papa=require(_0xc2e7('0xf'));var Redis=require(_0xc2e7('0x10'));var authService=require(_0xc2e7('0x11'));var qs=require(_0xc2e7('0x12'));var as=require(_0xc2e7('0x13'));var pdf=require(_0xc2e7('0x14'));var hardwareService=require(_0xc2e7('0x15'));var logger=require(_0xc2e7('0x16'))(_0xc2e7('0x17'));var utils=require(_0xc2e7('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xc2e7('0x19'));var db=require(_0xc2e7('0x1a'))['db'];config[_0xc2e7('0x1b')]=_['defaults'](config[_0xc2e7('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xc2e7('0x1c'))(new Redis(config[_0xc2e7('0x1b')]));require('./chatInteraction.socket')['register'](socket);var jayson=require(_0xc2e7('0x1d'));var client=jayson[_0xc2e7('0x1e')][_0xc2e7('0x1f')]({'port':0x232b});var client9004=jayson[_0xc2e7('0x1e')][_0xc2e7('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x587887,_0x7e7349,_0x1c60ab,_0x3a863d){return new BPromise(function(_0x43b1af,_0x40cd3e){var _0xc2b79f=_0x3a863d||client;return _0xc2b79f[_0xc2e7('0x20')](_0x587887,_0x1c60ab)[_0xc2e7('0x21')](function(_0x40b8cf){logger[_0xc2e7('0x22')](_0xc2e7('0x23'),_0x7e7349,_0xc2e7('0x24'));logger[_0xc2e7('0x25')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x7e7349,_0xc2e7('0x24'),JSON[_0xc2e7('0x26')](_0x40b8cf));if(_0x40b8cf[_0xc2e7('0x27')]){if(_0x40b8cf[_0xc2e7('0x27')][_0xc2e7('0x28')]===0x1f4){logger[_0xc2e7('0x27')](_0xc2e7('0x23'),_0x7e7349,_0x40b8cf[_0xc2e7('0x27')][_0xc2e7('0x29')]);return _0x40cd3e(_0x40b8cf[_0xc2e7('0x27')]['message']);}logger[_0xc2e7('0x27')]('ChatInteraction,\x20%s,\x20%s',_0x7e7349,_0x40b8cf[_0xc2e7('0x27')][_0xc2e7('0x29')]);return _0x43b1af(_0x40b8cf[_0xc2e7('0x27')]['message']);}else{logger[_0xc2e7('0x22')]('ChatInteraction,\x20%s,\x20%s',_0x7e7349,_0xc2e7('0x24'));_0x43b1af(_0x40b8cf['result']['message']);}})[_0xc2e7('0x2a')](function(_0x110fd6){logger['error'](_0xc2e7('0x23'),_0x7e7349,_0x110fd6);_0x40cd3e(_0x110fd6);});});}function respondWithStatusCode(_0x49aff3,_0x3e9056){_0x3e9056=_0x3e9056||0xcc;return function(_0x5b9455){if(_0x5b9455){return _0x49aff3[_0xc2e7('0x2b')](_0x3e9056);}return _0x49aff3[_0xc2e7('0x2c')](_0x3e9056)[_0xc2e7('0x2d')]();};}function respondWithResult(_0x2d840b,_0x6a74a2){_0x6a74a2=_0x6a74a2||0xc8;return function(_0x3e12fa){if(_0x3e12fa){return _0x2d840b[_0xc2e7('0x2c')](_0x6a74a2)['json'](_0x3e12fa);}};}function respondWithFilteredResult(_0x376783,_0x1e8fcc){return function(_0x333aa9){if(_0x333aa9){var _0x3ce008=typeof _0x1e8fcc[_0xc2e7('0x2e')]===_0xc2e7('0x2f')&&typeof _0x1e8fcc['limit']===_0xc2e7('0x2f');var _0x1d5c48=_0x333aa9[_0xc2e7('0x30')];var _0x3755e5=_0x3ce008?0x0:_0x1e8fcc[_0xc2e7('0x2e')];var _0x3e86a3=_0x3ce008?_0x333aa9[_0xc2e7('0x30')]:_0x1e8fcc[_0xc2e7('0x2e')]+_0x1e8fcc[_0xc2e7('0x31')];var _0x53c520;if(_0x3e86a3>=_0x1d5c48){_0x3e86a3=_0x1d5c48;_0x53c520=0xc8;}else{_0x53c520=0xce;}_0x376783['status'](_0x53c520);return _0x376783[_0xc2e7('0x32')](_0xc2e7('0x33'),_0x3755e5+'-'+_0x3e86a3+'/'+_0x1d5c48)[_0xc2e7('0x34')](_0x333aa9);}return null;};}function patchUpdates(_0x4ee5cd){return function(_0x2ecc09){try{jsonpatch[_0xc2e7('0x35')](_0x2ecc09,_0x4ee5cd,!![]);}catch(_0x4603d9){return BPromise[_0xc2e7('0x36')](_0x4603d9);}return _0x2ecc09[_0xc2e7('0x37')]();};}function saveUpdates(_0x21570b,_0x28497b){return function(_0x507b83){if(_0x507b83){return _0x507b83[_0xc2e7('0x38')](_0x21570b)[_0xc2e7('0x21')](function(_0x5735a1){return _0x5735a1;});}return null;};}function removeEntity(_0x137794,_0x43d2e5){return function(_0x4222aa){if(_0x4222aa){return _0x4222aa[_0xc2e7('0x39')]()[_0xc2e7('0x21')](function(){_0x137794[_0xc2e7('0x2c')](0xcc)[_0xc2e7('0x2d')]();});}};}function handleEntityNotFound(_0x67b807,_0x50aa65){return function(_0x42621a){if(!_0x42621a){_0x67b807[_0xc2e7('0x2b')](0x194);}return _0x42621a;};}function handleError(_0x4dee8e,_0x13a667){_0x13a667=_0x13a667||0x1f4;return function(_0x7b0bfb){logger[_0xc2e7('0x27')](_0x7b0bfb['stack']);if(_0x7b0bfb[_0xc2e7('0x3a')]){delete _0x7b0bfb[_0xc2e7('0x3a')];}_0x4dee8e[_0xc2e7('0x2c')](_0x13a667)['send'](_0x7b0bfb);};}function getMustacheRender(_0x366a50,_0x4d96ca){return Mustache[_0xc2e7('0x3b')](_0x366a50,_['merge'](_0x4d96ca[_0xc2e7('0x3c')],{'contact':_0x4d96ca['contact'],'message':_0x4d96ca[_0xc2e7('0x29')],'agent':_0x4d96ca[_0xc2e7('0x3d')],'interaction':_0x4d96ca[_0xc2e7('0x3e')],'account':_0x4d96ca[_0xc2e7('0x3f')]}))||'';}function getInteractionUsers(_0x24930a,_0x28b03e){return new BPromise(function(_0x5a231c,_0x2386d0){try{if(_0x28b03e[_0x24930a['id']]){_0x24930a['Users']=_[_0xc2e7('0x40')](_0x28b03e[_0x24930a['id']],function(_0xdd3645){return{'id':_0xdd3645['id'],'fullname':_0xdd3645[_0xc2e7('0x41')]};});}}catch(_0x290bae){_0x2386d0(_0x290bae);}_0x5a231c(_0x24930a);});}function getInteractionTags(_0x6f1d0f,_0x346c69){return new BPromise(function(_0x332572,_0x40adb3){try{if(_0x6f1d0f[_0xc2e7('0x42')]){_0x6f1d0f[_0xc2e7('0x43')]=[];_0x6f1d0f['TagIds'][_0xc2e7('0x44')](',')['forEach'](function(_0x436ea5){_0x6f1d0f[_0xc2e7('0x43')]['push'](_0x346c69[_0x436ea5]);});}delete _0x6f1d0f['TagIds'];}catch(_0x2cdd17){_0x40adb3(_0x2cdd17);}_0x332572(_0x6f1d0f);});}function updateChatInteraction(_0x3f5d3e,_0xa3eb2b,_0x3d1596){return new BPromise(function(_0x3c143f,_0x1b806f){return getInteractionUsers(_0x3f5d3e,_0x3d1596)[_0xc2e7('0x21')](function(_0x216418){return getInteractionTags(_0x216418,_0xa3eb2b);})['then'](function(_0x47d3ec){return getStateInteraction(_0x47d3ec);})[_0xc2e7('0x21')](function(_0x58ddcd){_0x3c143f(_0x58ddcd);})['catch'](function(_0x411f0c){_0x1b806f(_0x411f0c);});});}function getStateInteraction(_0x4a87e4){return new BPromise(function(_0x422c66){_0x4a87e4['waiting']=0x0;_0x4a87e4[_0xc2e7('0x45')]=0x0;_0x4a87e4['answered']=0x0;_0x4a87e4[_0xc2e7('0x46')]=0x0;_0x4a87e4[_0xc2e7('0x47')]=0x0;_0x4a87e4['total']=0x0;if(!_0x4a87e4[_0xc2e7('0x48')]&&!_0x4a87e4['UserId']){_0x4a87e4[_0xc2e7('0x49')]+=0x1;}if(!_0x4a87e4[_0xc2e7('0x48')]&&_0x4a87e4[_0xc2e7('0x4a')]){_0x4a87e4[_0xc2e7('0x45')]+=0x1;if(_0x4a87e4[_0xc2e7('0x49')]){_0x4a87e4[_0xc2e7('0x49')]-=0x1;}}if(_0x4a87e4[_0xc2e7('0x48')]&&_0x4a87e4[_0xc2e7('0x4b')]===_0xc2e7('0x47')){_0x4a87e4[_0xc2e7('0x47')]+=0x1;if(_0x4a87e4[_0xc2e7('0x49')]){_0x4a87e4[_0xc2e7('0x49')]-=0x1;}}else if(_0x4a87e4[_0xc2e7('0x48')]&&!_0x4a87e4[_0xc2e7('0x4a')]&&_0x4a87e4[_0xc2e7('0x4b')]){_0x4a87e4[_0xc2e7('0x46')]+=0x1;if(_0x4a87e4['waiting']){_0x4a87e4[_0xc2e7('0x49')]-=0x1;}}else if(_0x4a87e4['closed']&&_0x4a87e4[_0xc2e7('0x4a')]){_0x4a87e4['answered']+=0x1;if(_0x4a87e4[_0xc2e7('0x45')]){_0x4a87e4['talking']-=0x1;}}_0x4a87e4[_0xc2e7('0x4c')]+=0x1;_0x422c66(_0x4a87e4);});}exports['index']=function(_0x4a5184,_0x4009ce){var _0x197f8f={},_0x2d49e3={},_0x2e8f58={'count':0x0,'rows':[]};var _0x2862b7=_[_0xc2e7('0x40')](db[_0xc2e7('0x4d')]['rawAttributes'],function(_0x4b8fb6){return{'name':_0x4b8fb6[_0xc2e7('0x4e')],'type':_0x4b8fb6[_0xc2e7('0x4f')][_0xc2e7('0x50')]};});_0x2d49e3['model']=_[_0xc2e7('0x40')](_0x2862b7,_0xc2e7('0x3a'));_0x2d49e3[_0xc2e7('0x51')]=_[_0xc2e7('0x52')](_0x4a5184[_0xc2e7('0x51')]);_0x2d49e3['filters']=_[_0xc2e7('0x53')](_0x2d49e3['model'],_0x2d49e3[_0xc2e7('0x51')]);_0x197f8f[_0xc2e7('0x54')]=_[_0xc2e7('0x53')](_0x2d49e3[_0xc2e7('0x55')],qs[_0xc2e7('0x56')](_0x4a5184['query'][_0xc2e7('0x56')]));_0x197f8f[_0xc2e7('0x54')]=_0x197f8f['attributes'][_0xc2e7('0x57')]?_0x197f8f[_0xc2e7('0x54')]:_0x2d49e3[_0xc2e7('0x55')];if(!_0x4a5184[_0xc2e7('0x51')]['hasOwnProperty']('nolimit')){_0x197f8f['limit']=qs[_0xc2e7('0x31')](_0x4a5184[_0xc2e7('0x51')][_0xc2e7('0x31')]);_0x197f8f['offset']=qs['offset'](_0x4a5184[_0xc2e7('0x51')][_0xc2e7('0x2e')]);}_0x197f8f[_0xc2e7('0x58')]=qs[_0xc2e7('0x59')](_0x4a5184['query'][_0xc2e7('0x59')]);_0x197f8f['where']=qs[_0xc2e7('0x5a')](_['pick'](_0x4a5184[_0xc2e7('0x51')],_0x2d49e3[_0xc2e7('0x5a')]),_0x2862b7);var _0x342521=[];var _0x28440d=squel[_0xc2e7('0x5b')]()[_0xc2e7('0x5c')]('id')[_0xc2e7('0x5c')](_0xc2e7('0x3a'))[_0xc2e7('0x5c')](_0xc2e7('0x5d'))['from'](_0xc2e7('0x5e'));var _0x448b1b=squel[_0xc2e7('0x5b')]()[_0xc2e7('0x5c')](_0xc2e7('0x5f'))['field']('u.fullname')[_0xc2e7('0x5c')](_0xc2e7('0x60'))[_0xc2e7('0x61')](_0xc2e7('0x62'),'ui')[_0xc2e7('0x63')](_0xc2e7('0x64'),'u',_0xc2e7('0x65'));var _0x38fb47=squel[_0xc2e7('0x5b')]()[_0xc2e7('0x61')](_0xc2e7('0x66'),'i')[_0xc2e7('0x63')](_0xc2e7('0x67'),'c',_0xc2e7('0x68'))['left_join'](_0xc2e7('0x64'),'o','o.id\x20=\x20i.UserId')[_0xc2e7('0x63')]('chat_websites','a',_0xc2e7('0x69'))[_0xc2e7('0x63')]('chat_messages','me','me.ChatInteractionId\x20=\x20i.id')[_0xc2e7('0x63')](_0xc2e7('0x6a'),'it',_0xc2e7('0x6b'))[_0xc2e7('0x63')](_0xc2e7('0x5e'),'t',_0xc2e7('0x6c'));var _0x35610f=squel['expr']();var _0x26aa2b=[];var _0x2b11ae=squel[_0xc2e7('0x6d')]();var _0xfa1590;if(_0x4a5184[_0xc2e7('0x51')][_0xc2e7('0x6e')]){_0xfa1590=as[_0xc2e7('0x6f')](_0x4a5184[_0xc2e7('0x51')][_0xc2e7('0x6e')]);var _0x97ea4a=_0xfa1590[_0xc2e7('0x70')];for(var _0x3d7192=0x0;_0x3d7192<_0xfa1590['conditions'][_0xc2e7('0x57')];_0x3d7192++){var _0x5e0e84=_0xfa1590[_0xc2e7('0x71')][_0x3d7192];var _0x4c3442='i';var _0x16c990=_[_0xc2e7('0x72')](_0x2862b7,[_0xc2e7('0x3a'),_0x5e0e84['field']]);if(!_0x16c990){switch(_0x5e0e84['field']){case'unreadMessages':if(_0x5e0e84[_0xc2e7('0x73')]==0x1){_0x38fb47[_0xc2e7('0x74')]('`'+_0x5e0e84[_0xc2e7('0x5c')]+_0xc2e7('0x75'));}else{_0x38fb47[_0xc2e7('0x74')]('`'+_0x5e0e84['field']+_0xc2e7('0x76'));}break;case _0xc2e7('0x77'):if(_0x5e0e84[_0xc2e7('0x78')]===_0xc2e7('0x79')){if(_0x5e0e84[_0xc2e7('0x73')][_0xc2e7('0x44')]('\x20')[_0xc2e7('0x57')]>0x1){_0x35610f[_0x97ea4a]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xc2e7('0x7a')](_0x5e0e84[_0xc2e7('0x73')]),null);}else{var _0x4b2542='%'+_0x5e0e84['value']+'%';_0x35610f[_0x97ea4a](_0xc2e7('0x7b'),_0x4b2542,_0x4b2542,_0x4b2542);}}else{_0x16c990=_[_0xc2e7('0x72')](_0x2862b7,[_0xc2e7('0x3a'),_0xc2e7('0x7c')]);_0x5e0e84[_0xc2e7('0x5c')]='ContactId';_0xdc00e4=as[_0xc2e7('0x7d')](_0x4c3442,_0x16c990[_0xc2e7('0x4f')],_0x5e0e84);_0x35610f[_0x97ea4a](_0xdc00e4[_0xc2e7('0x7e')],_0xdc00e4['value']['start'],_0xdc00e4['value'][_0xc2e7('0x2d')]);}break;case'Tag':var _0x359af8=_0x5e0e84[_0xc2e7('0x73')][_0xc2e7('0x44')](',')[_0xc2e7('0x40')](function(_0x4e6a98){return Number(_0x4e6a98);});_0x359af8[_0xc2e7('0x7f')](function(_0x3fc532){_0x2b11ae['or'](_0xc2e7('0x80'),'%,'+_0x3fc532+',%');});_0x26aa2b=_[_0xc2e7('0x81')](_0x26aa2b,_0x359af8);break;case _0xc2e7('0x82'):if(_0x5e0e84[_0xc2e7('0x78')]==='$substring'){_0x35610f[_0x97ea4a](_0xc2e7('0x83'),'%'+_0x5e0e84[_0xc2e7('0x73')]+'%',null);}else{_0x16c990=_[_0xc2e7('0x72')](_0x2862b7,[_0xc2e7('0x3a'),_0xc2e7('0x4a')]);_0x5e0e84[_0xc2e7('0x5c')]=_0xc2e7('0x4a');_0xdc00e4=as['buildExpression'](_0x4c3442,_0x16c990[_0xc2e7('0x4f')],_0x5e0e84);_0x35610f[_0x97ea4a](_0xdc00e4[_0xc2e7('0x7e')],_0xdc00e4[_0xc2e7('0x73')][_0xc2e7('0x84')],_0xdc00e4[_0xc2e7('0x73')][_0xc2e7('0x2d')]);}break;case'body':_0xdc00e4=as[_0xc2e7('0x7d')]('me',null,_0x5e0e84);_0x35610f[_0x97ea4a](_0xdc00e4['text'],_0xdc00e4['value'][_0xc2e7('0x84')],_0xdc00e4['value'][_0xc2e7('0x2d')]);break;}}else{var _0xdc00e4=as['buildExpression'](_0x4c3442,_0x16c990[_0xc2e7('0x4f')],_0x5e0e84);_0x35610f[_0x97ea4a](_0xdc00e4[_0xc2e7('0x7e')],_0xdc00e4[_0xc2e7('0x73')][_0xc2e7('0x84')],_0xdc00e4[_0xc2e7('0x73')][_0xc2e7('0x2d')]);}}}else{var _0x37ed4f=_(_0x4a5184[_0xc2e7('0x51')])['keys']()[_0xc2e7('0x40')](function(_0x1cb1fb){return _['some'](_0x2862b7,['name',_0x1cb1fb])?_0x1cb1fb:undefined;})['compact']()[_0xc2e7('0x73')]();if(!_[_0xc2e7('0x85')](_0x37ed4f)){_0x37ed4f[_0xc2e7('0x7f')](function(_0x2a984c){if(_0x2a984c===_0xc2e7('0x86')){_0x38fb47[_0xc2e7('0x87')](_0xc2e7('0x88'),[][_0xc2e7('0x89')](_0x4a5184[_0xc2e7('0x51')][_0x2a984c]));}else if(_0x2a984c===_0xc2e7('0x8a')){var _0x5beb2c=JSON[_0xc2e7('0x8b')](_0x4a5184['query'][_0x2a984c])[_0xc2e7('0x8c')];var _0x364ec5=JSON[_0xc2e7('0x8b')](_0x4a5184[_0xc2e7('0x51')][_0x2a984c])[_0xc2e7('0x8d')];_0x38fb47['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5beb2c,_0x364ec5);}else{if(_0x4a5184[_0xc2e7('0x51')][_0x2a984c]==='null'){_0x38fb47[_0xc2e7('0x87')]('i.'+_0x2a984c+_0xc2e7('0x8e'));}else{_0x38fb47[_0xc2e7('0x87')]('i.'+_0x2a984c+_0xc2e7('0x8f'),_0x4a5184[_0xc2e7('0x51')][_0x2a984c]);}}});}if(_0x4a5184['query'][_0xc2e7('0x90')]){if(_0x4a5184[_0xc2e7('0x51')][_0xc2e7('0x90')]==0x1){_0x38fb47[_0xc2e7('0x74')](_0xc2e7('0x91'));}else{_0x38fb47[_0xc2e7('0x74')](_0xc2e7('0x92'));}}if(_0x4a5184[_0xc2e7('0x51')]['tag']){_0x26aa2b=_['isArray'](_0x4a5184[_0xc2e7('0x51')]['tag'])?_0x4a5184[_0xc2e7('0x51')][_0xc2e7('0x93')]:new Array(_0x4a5184[_0xc2e7('0x51')]['tag']);_0x26aa2b[_0xc2e7('0x7f')](function(_0x3f73da){_0x2b11ae['or'](_0xc2e7('0x80'),'%,'+_0x3f73da+',%');});}if(_0x4a5184[_0xc2e7('0x51')]['filter']){var _0x9856b0=_0x4a5184['query'][_0xc2e7('0x94')][_0xc2e7('0x95')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xc2e7('0x96')](_0x9856b0)){_0x35610f['or'](_0xc2e7('0x97'),_0x9856b0+'%');}else{_0x35610f['or'](_0xc2e7('0x98'),qs[_0xc2e7('0x7a')](_0x9856b0))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x9856b0+'%');}}}_0x38fb47[_0xc2e7('0x87')](_0x35610f);_0x38fb47[_0xc2e7('0x99')](_0xc2e7('0x9a'));var _0x4e4cfd={'type':db['Sequelize'][_0xc2e7('0x9b')][_0xc2e7('0x9c')],'raw':!![]};var _0x58bc7a=_0x38fb47['clone']();_0x58bc7a[_0xc2e7('0x5c')]('i.id');_0x58bc7a['field'](_0xc2e7('0x9d'),'unreadMessages');if(_0x197f8f['order']){_0x197f8f[_0xc2e7('0x58')][_0xc2e7('0x7f')](function(_0x172e08){var _0xe1e7a=_0x172e08[0x0]===_0xc2e7('0x9e')?_0x172e08[0x0]:'i.'+_0x172e08[0x0];_0x38fb47['order'](_0xe1e7a,_0x172e08[0x1]===_0xc2e7('0x9f')?![]:!![]);});}if(!_[_0xc2e7('0x85')](_0x26aa2b)){_0x38fb47[_0xc2e7('0x74')](_0x2b11ae);_0x58bc7a[_0xc2e7('0x87')](_0xc2e7('0xa0'),_0x26aa2b);}BPromise[_0xc2e7('0xa1')]()[_0xc2e7('0x21')](function(){if(!_0xfa1590){if(_0x4a5184[_0xc2e7('0x51')][_0xc2e7('0x86')])return;_0x58bc7a[_0xc2e7('0x87')](_0xc2e7('0xa2'));_0x38fb47[_0xc2e7('0x87')](_0xc2e7('0xa2'));return;}if(_0x4a5184[_0xc2e7('0xa3')][_0xc2e7('0xa4')]!==_0xc2e7('0x3d'))return;return _0x4a5184['user']['getChatWebsites']({'attributes':['id'],'raw':!![]})[_0xc2e7('0x21')](function(_0x2d554f){if(_[_0xc2e7('0x85')](_0x2d554f)){_0x58bc7a['where'](_0xc2e7('0xa5'));_0x38fb47['where']('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x58bc7a[_0xc2e7('0x87')]('i.ChatWebsiteId\x20IN\x20?',_['map'](_0x2d554f,'id'));_0x38fb47[_0xc2e7('0x87')](_0xc2e7('0x88'),_['map'](_0x2d554f,'id'));}});})[_0xc2e7('0x21')](function(){if(_0x4a5184[_0xc2e7('0xa3')][_0xc2e7('0xa4')]===_0xc2e7('0x3d')&&!_0xfa1590&&!_0x4a5184['query'][_0xc2e7('0x86')])return[];return db['sequelize'][_0xc2e7('0x51')](_0x58bc7a[_0xc2e7('0xa6')](),_0x4e4cfd);})['then'](function(_0x35323e){_0x2e8f58[_0xc2e7('0x30')]=_0x35323e[_0xc2e7('0x57')];if(_0x2e8f58['count']===0x0)return[];return db[_0xc2e7('0xa7')]['query'](_0x28440d[_0xc2e7('0xa6')](),_0x4e4cfd)[_0xc2e7('0x21')](function(_0x2b622b){_0x342521=_[_0xc2e7('0xa8')](_0x2b622b,'id');_0x4e4cfd=_['merge'](_0x4e4cfd,{'model':db[_0xc2e7('0x4d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4a5184[_0xc2e7('0x51')][_0xc2e7('0x56')]){_0x197f8f['attributes'][_0xc2e7('0x7f')](function(_0x308884){_0x38fb47['field']('i.'+_0x308884);});}else{_0x38fb47['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xc2e7('0xa9'));_0x38fb47[_0xc2e7('0x5c')](_0xc2e7('0xaa'),_0xc2e7('0xab'));_0x38fb47['field'](_0xc2e7('0xac'),_0xc2e7('0xad'));_0x38fb47['field']('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',_0xc2e7('0x9e'));_0x38fb47[_0xc2e7('0x5c')](_0xc2e7('0xae'));_0x38fb47[_0xc2e7('0x5c')]('c.firstName',_0xc2e7('0xaf'));_0x38fb47['field']('c.lastName',_0xc2e7('0xb0'));_0x38fb47['field'](_0xc2e7('0xb1'),_0xc2e7('0xb2'));_0x38fb47[_0xc2e7('0x5c')](_0xc2e7('0xb3'),_0xc2e7('0xb4'));_0x38fb47['field'](_0xc2e7('0xb5'),'Contact.mobile');_0x38fb47[_0xc2e7('0x5c')](_0xc2e7('0xb6'),_0xc2e7('0xb7'));_0x38fb47[_0xc2e7('0x5c')](_0xc2e7('0xb8'),_0xc2e7('0xb9'));_0x38fb47[_0xc2e7('0x5c')](_0xc2e7('0xba'),'Owner.internal');_0x38fb47['field'](_0xc2e7('0xbb'),'TagIds');}if(_0x197f8f['limit'])_0x38fb47[_0xc2e7('0x31')](_0x197f8f[_0xc2e7('0x31')]);if(_0x197f8f['offset'])_0x38fb47[_0xc2e7('0x2e')](_0x197f8f[_0xc2e7('0x2e')]);return db[_0xc2e7('0xa7')][_0xc2e7('0x51')](_0x38fb47[_0xc2e7('0xa6')](),_0x4e4cfd);})[_0xc2e7('0x21')](function(_0x433a7d){if(_0x433a7d[_0xc2e7('0x57')]>0x0)_0x448b1b[_0xc2e7('0x87')]('ui.ChatInteractionId\x20IN\x20?',_['map'](_0x433a7d,'id'));return db[_0xc2e7('0xa7')][_0xc2e7('0x51')](_0x448b1b[_0xc2e7('0xa6')](),_0x4e4cfd)['then'](function(_0x2027d4){var _0x303970=_[_0xc2e7('0xbc')](_0x2027d4,'ChatInteractionId');var _0x2d1d75=[];_0x433a7d[_0xc2e7('0x7f')](function(_0x40b8eb){_0x2d1d75[_0xc2e7('0xbd')](updateChatInteraction(_0x40b8eb,_0x342521,_0x303970));});return BPromise[_0xc2e7('0xbe')](_0x2d1d75);});});})[_0xc2e7('0x21')](function(_0x3be5b3){_0x2e8f58[_0xc2e7('0xbf')]=_0x3be5b3;return _0x2e8f58;})[_0xc2e7('0x21')](respondWithFilteredResult(_0x4009ce,_0x197f8f))['catch'](handleError(_0x4009ce,null));};exports[_0xc2e7('0xc0')]=function(_0x4bf10b,_0x57d2ee){var _0x323000={'raw':![],'where':{'id':_0x4bf10b[_0xc2e7('0xc1')]['id']}},_0x2c569e={};_0x2c569e['model']=_[_0xc2e7('0x52')](db['ChatInteraction'][_0xc2e7('0xc2')]);_0x2c569e[_0xc2e7('0x51')]=_[_0xc2e7('0x52')](_0x4bf10b['query']);_0x2c569e['filters']=_[_0xc2e7('0x53')](_0x2c569e[_0xc2e7('0x55')],_0x2c569e[_0xc2e7('0x51')]);_0x323000['attributes']=_['intersection'](_0x2c569e[_0xc2e7('0x55')],qs['fields'](_0x4bf10b[_0xc2e7('0x51')][_0xc2e7('0x56')]));_0x323000['attributes']=_0x323000[_0xc2e7('0x54')]['length']?_0x323000['attributes']:_0x2c569e['model'];if(_0x4bf10b['query']['includeAll']){_0x323000[_0xc2e7('0xc3')]=[{'all':!![]}];}_0x323000=_[_0xc2e7('0xc4')]({},_0x323000,_0x4bf10b['options']);return db[_0xc2e7('0x4d')][_0xc2e7('0x72')](_0x323000)[_0xc2e7('0x21')](handleEntityNotFound(_0x57d2ee,null))[_0xc2e7('0x21')](respondWithResult(_0x57d2ee,null))[_0xc2e7('0x2a')](handleError(_0x57d2ee,null));};exports[_0xc2e7('0xc5')]=function(_0x1ab6ce,_0x5350d5){return db[_0xc2e7('0x4d')][_0xc2e7('0xc5')](_0x1ab6ce['body'],{})[_0xc2e7('0x21')](respondWithResult(_0x5350d5,0xc9))[_0xc2e7('0x2a')](handleError(_0x5350d5,null));};exports[_0xc2e7('0x38')]=function(_0x198e9f,_0x5ce258){if(_0x198e9f['body']['id']){delete _0x198e9f[_0xc2e7('0x3c')]['id'];}return db[_0xc2e7('0x4d')]['find']({'where':{'id':_0x198e9f[_0xc2e7('0xc1')]['id']}})[_0xc2e7('0x21')](handleEntityNotFound(_0x5ce258,null))['then'](saveUpdates(_0x198e9f['body'],null))[_0xc2e7('0x21')](respondWithResult(_0x5ce258,null))[_0xc2e7('0x2a')](handleError(_0x5ce258,null));};exports['destroy']=function(_0x3cc5b0,_0x4faa88){return db[_0xc2e7('0x4d')]['find']({'where':{'id':_0x3cc5b0[_0xc2e7('0xc1')]['id']}})['then'](handleEntityNotFound(_0x4faa88,null))[_0xc2e7('0x21')](removeEntity(_0x4faa88,null))['catch'](handleError(_0x4faa88,null));};exports[_0xc2e7('0xc6')]=function(_0x12ece6,_0x51ad5d){return db['ChatInteraction'][_0xc2e7('0xc6')]()[_0xc2e7('0x21')](respondWithResult(_0x51ad5d,null))[_0xc2e7('0x2a')](handleError(_0x51ad5d,null));};exports[_0xc2e7('0xc7')]=function(_0x3e3d8b,_0xd5e987){var _0x11b6ab=_0x3e3d8b[_0xc2e7('0xc1')]['id'];var _0x143f4b;var _0x5c6c80;var _0x39dad5;return db[_0xc2e7('0x4d')][_0xc2e7('0xc8')]({'where':{'id':_0x11b6ab}})[_0xc2e7('0x21')](function(_0x3fefd1){_0x143f4b=_0x3fefd1;return db[_0xc2e7('0xc9')]['findOne']({'where':{'id':_0x3fefd1[_0xc2e7('0x86')]},'attributes':['id','vidaooApiKey',_0xc2e7('0xca'),_0xc2e7('0xcb'),_0xc2e7('0xcc'),_0xc2e7('0xcd')],'raw':!![]});})[_0xc2e7('0x21')](function(_0x5dfa71){if(_0x5dfa71&&_0x5dfa71['vidaooApiKey']&&_0x5dfa71[_0xc2e7('0xca')]){_0x5c6c80=_0x5dfa71;var _0x1f4c64={'interaction':{'id':_0x11b6ab},'agent':{'id':_0x3e3d8b[_0xc2e7('0xa3')]['id'],'name':_0x3e3d8b['user'][_0xc2e7('0x3a')],'fullname':_0x3e3d8b[_0xc2e7('0xa3')]['fullname'],'email':_0x3e3d8b[_0xc2e7('0xa3')][_0xc2e7('0xce')]},'contact':_0x3e3d8b[_0xc2e7('0x3c')][_0xc2e7('0xcf')],'account':_0x3e3d8b[_0xc2e7('0x3c')][_0xc2e7('0x3f')]};var _0x2aa285={'rejectUnauthorized':![],'method':'POST','url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x5dfa71['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x3e3d8b[_0xc2e7('0xa3')][_0xc2e7('0xce')]],'buttons':null,'topic':_0x5c6c80[_0xc2e7('0xcb')],'note':_[_0xc2e7('0xd0')](_0x5c6c80[_0xc2e7('0xcc')])?null:getMustacheRender(_0x5c6c80[_0xc2e7('0xcc')],_0x1f4c64),'metadata':null},'redirect':_0xc2e7('0xd1'),'json':!![]};try{if(!_['isNull'](_0x5c6c80['vidaooMetadata'])){var _0x39a244=getMustacheRender(_0x5c6c80[_0xc2e7('0xcd')],_0x1f4c64);var _0x1cec17=JSON[_0xc2e7('0x8b')](_0x39a244);_0x2aa285['body'][_0xc2e7('0xd2')]=_0x1cec17;}}catch(_0x2d277a){throw new db['Sequelize'][(_0xc2e7('0xd3'))](_0xc2e7('0xd4'));}return rp(_0x2aa285);}else{throw new db[(_0xc2e7('0xd5'))][(_0xc2e7('0xd3'))]('Error\x20in\x20Vidaoo\x20configuration');}})['then'](function(_0x141623){_0x39dad5=_0x141623;if(_0x39dad5['id']){var _0x9e815f={'body':_0x39dad5[_0xc2e7('0xd6')],'ChatWebsiteId':_0x5c6c80['id'],'ChatInteractionId':_0x143f4b['id'],'direction':_0xc2e7('0xd7'),'UserId':_0x3e3d8b[_0xc2e7('0xa3')]['id']};return db['ChatMessage'][_0xc2e7('0xc5')](_0x9e815f,{});}else{throw new db['Sequelize']['ValidationError']('Unable\x20to\x20create\x20Vidaoo\x20session');}})['then'](function(){return _0x143f4b[_0xc2e7('0xd8')]({'vidaooSessionId':_0x39dad5['id']});})[_0xc2e7('0x21')](respondWithResult(_0xd5e987,null))[_0xc2e7('0x2a')](handleError(_0xd5e987,null));};exports[_0xc2e7('0xd9')]=function(_0x44f558,_0xcaf494){if(_0x44f558[_0xc2e7('0x3c')]['id']){delete _0x44f558[_0xc2e7('0x3c')]['id'];}return db['ChatInteraction'][_0xc2e7('0x72')]({'where':{'id':_0x44f558[_0xc2e7('0xc1')]['id']},'include':[{'model':db[_0xc2e7('0xda')],'as':'Contact'}]})[_0xc2e7('0x21')](handleEntityNotFound(_0xcaf494,null))['then'](saveUpdates(_0x44f558[_0xc2e7('0x3c')],null))['then'](respondWithResult(_0xcaf494,null))[_0xc2e7('0x2a')](handleError(_0xcaf494,null));};exports[_0xc2e7('0xdb')]=function(_0x4b0594,_0x45f669,_0x4a0978){if(_0x4b0594[_0xc2e7('0x3c')]['id']){delete _0x4b0594['body']['id'];}return db[_0xc2e7('0x4d')]['find']({'where':{'id':_0x4b0594['params']['id']}})[_0xc2e7('0x21')](function(_0x2dca60){if(!_0x2dca60){logger[_0xc2e7('0x27')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xc2e7('0xdb'),0x194,_0xc2e7('0xdc'));_0x45f669[_0xc2e7('0x2b')](0x194);}else{if(_0x2dca60[_0xc2e7('0x4a')]){throw new db[(_0xc2e7('0xd5'))][(_0xc2e7('0xd3'))](_0xc2e7('0xdd'));}}return _0x2dca60;})[_0xc2e7('0x21')](function(_0xb1a8b1){if(_0xb1a8b1){return _0xb1a8b1['update']({'closed':_0x4b0594[_0xc2e7('0x3c')][_0xc2e7('0x48')],'disposition':_0x4b0594[_0xc2e7('0x3c')][_0xc2e7('0x4b')]})[_0xc2e7('0x21')](function(_0x1c378c){return _0x1c378c;});}})[_0xc2e7('0x21')](function(_0x264993){return respondWithRpcPromise(_0xc2e7('0xde'),'abandon',_0x4b0594[_0xc2e7('0x3c')],client9004);})[_0xc2e7('0x21')](respondWithResult(_0x45f669,null))['catch'](handleError(_0x45f669,null));};exports[_0xc2e7('0xdf')]=function(_0x15f25a,_0x290811,_0x58a530){_0x15f25a[_0xc2e7('0x3c')][_0xc2e7('0x3a')]=_0x15f25a['file']['originalname'];_0x15f25a[_0xc2e7('0x3c')]['basename']=_0x15f25a['file'][_0xc2e7('0xe0')];_0x15f25a[_0xc2e7('0x3c')][_0xc2e7('0x4f')]=_0x15f25a['file'][_0xc2e7('0xe1')];return db[_0xc2e7('0xe2')]['create'](_0x15f25a[_0xc2e7('0x3c')])[_0xc2e7('0x21')](respondWithResult(_0x290811,0xc9))[_0xc2e7('0x2a')](handleError(_0x290811,null));};exports[_0xc2e7('0xe3')]=function(_0x164a02,_0x5dc164,_0x1fe1bb){return db[_0xc2e7('0x4d')][_0xc2e7('0xc8')]({'where':{'id':_0x164a02[_0xc2e7('0xc1')]['id']},'raw':!![]})[_0xc2e7('0x21')](handleEntityNotFound(_0x5dc164,null))[_0xc2e7('0x21')](function(_0x25f0e7){if(_0x25f0e7){if(_0x25f0e7[_0xc2e7('0x48')]){return _0x5dc164[_0xc2e7('0x2c')](0x193)['json']({'status':0x193,'message':'Unauthorized'});}return db[_0xc2e7('0xe2')]['findOne']({'where':{'id':_0x164a02[_0xc2e7('0x51')][_0xc2e7('0xe4')]},'raw':!![]})[_0xc2e7('0x21')](handleEntityNotFound(_0x5dc164,null));}})['then'](function(_0x27aeca){if(_0x27aeca){var _0x512a58=_0x27aeca[_0xc2e7('0xe5')]!==null;var _0x10c2f6=path[_0xc2e7('0xe6')](config['root'],_0xc2e7('0xe7'));if(_0x512a58){_0x10c2f6=path[_0xc2e7('0xe6')](_0x10c2f6,_0xc2e7('0xe8'));}var _0x4090d7=path[_0xc2e7('0xe6')](_0x10c2f6,_0x27aeca['basename']);return _0x5dc164[_0xc2e7('0xe9')](_0x4090d7);}})[_0xc2e7('0x2a')](handleError(_0x5dc164,null));};exports[_0xc2e7('0xea')]=function(_0x21a156,_0x2bb514){var _0x1f60fa=null;var _0x5d49b3=null;var _0x32fb1e=null;var _0x99afd0=null;if(_0x21a156[_0xc2e7('0x3c')]['id']){delete _0x21a156[_0xc2e7('0x3c')]['id'];}if(_0x21a156[_0xc2e7('0x3c')][_0xc2e7('0xeb')]){_0x99afd0=path[_0xc2e7('0xe6')](config[_0xc2e7('0xec')],_0xc2e7('0xed'),util[_0xc2e7('0xee')]('transcript-%s.txt',Date[_0xc2e7('0xef')]()));_0x21a156[_0xc2e7('0x3c')][_0xc2e7('0xf0')]=_0x99afd0;}return db[_0xc2e7('0x4d')][_0xc2e7('0x72')]({'where':{'id':_0x21a156['params']['id']},'include':[{'model':db[_0xc2e7('0xf1')],'as':'Messages','include':[{'model':db['User'],'as':'User'}]}]})[_0xc2e7('0x21')](handleEntityNotFound(_0x2bb514,null))[_0xc2e7('0x21')](saveUpdates(_0x21a156['body'],null))[_0xc2e7('0x21')](function(_0x304158){if(_0x304158){_0x1f60fa=_0x304158;return db[_0xc2e7('0xc9')][_0xc2e7('0x72')]({'where':{'id':_0x1f60fa['ChatWebsiteId']}});}})[_0xc2e7('0x21')](function(_0x5decd2){if(_0x5decd2){_0x32fb1e=_0x5decd2;return db[_0xc2e7('0xda')][_0xc2e7('0x72')]({'where':{'id':_0x1f60fa[_0xc2e7('0x7c')]}});}})[_0xc2e7('0x21')](function(_0xd47c1b){if(_0xd47c1b){_0x5d49b3=_0xd47c1b;if(_0x99afd0){var _0x1ee8f9=null;for(var _0xceff97=0x1;_0xceff97<_0x1f60fa[_0xc2e7('0xf2')][_0xc2e7('0x57')];++_0xceff97){_0x1ee8f9=_0x1f60fa[_0xc2e7('0xf2')][_0xceff97];var _0x44d418=_0x1ee8f9[_0xc2e7('0x4a')]?util[_0xc2e7('0xee')](_0xc2e7('0xf3'),_0x32fb1e['agentAlias'],_0x1ee8f9['UserId']):'System';var _0x1432ee=_0x21a156[_0xc2e7('0x3c')][_0xc2e7('0xf4')]||util[_0xc2e7('0xee')](_0xc2e7('0xf3'),'Visitor',_0x1ee8f9[_0xc2e7('0x7c')]);switch(_0x32fb1e[_0xc2e7('0xf5')]){case _0xc2e7('0xf6'):_0x44d418=_0x1ee8f9['UserId']?util['format']('%s%d',_0x32fb1e['agentAlias'],_0x1ee8f9['UserId']):_0xc2e7('0xf7');break;case'agent_alias':_0x44d418=_0x1ee8f9['UserId']?_0x1ee8f9[_0xc2e7('0x82')][_0xc2e7('0xf8')]||_0x1ee8f9[_0xc2e7('0x82')]['fullname']:_0xc2e7('0xf7');break;case _0xc2e7('0xf9'):_0x44d418=_0x1ee8f9[_0xc2e7('0x4a')]?_0x1ee8f9[_0xc2e7('0x82')][_0xc2e7('0x41')]:_0xc2e7('0xf7');break;default:_0x44d418=_0x1ee8f9[_0xc2e7('0x4a')]?util[_0xc2e7('0xee')](_0xc2e7('0xf3'),_0x32fb1e[_0xc2e7('0xfa')],_0x1ee8f9['UserId']):'System';}var _0x10f28e=util[_0xc2e7('0xee')](_0xc2e7('0xfb'),moment(_0x1ee8f9[_0xc2e7('0x8a')])[_0xc2e7('0xee')](_0xc2e7('0xfc')),_0x1ee8f9[_0xc2e7('0xfd')]==='in'?_0x1432ee:_0x44d418,_0x1ee8f9[_0xc2e7('0x3c')]);if(!_0x1ee8f9[_0xc2e7('0xfe')]){fs[_0xc2e7('0xff')](_0x99afd0,_0x10f28e);}}return db[_0xc2e7('0x100')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xc2e7('0x101')],'as':_0xc2e7('0x102'),'raw':!![]}]});}}})['then'](function(_0x1bb095){if(_0x1bb095&&_0x1bb095['Smtp']&&_0x21a156[_0xc2e7('0x3c')]){var _0x2e0a31={'tls':{'rejectUnauthorized':![]}};if(_0x1bb095[_0xc2e7('0x102')]['service']){_0x2e0a31[_0xc2e7('0x103')]=_0x1bb095[_0xc2e7('0x102')][_0xc2e7('0x103')];}else{_0x2e0a31[_0xc2e7('0x104')]=_0x1bb095['Smtp'][_0xc2e7('0x104')];_0x2e0a31['port']=_0x1bb095[_0xc2e7('0x102')]['port'];_0x2e0a31[_0xc2e7('0x105')]=_0x1bb095[_0xc2e7('0x102')][_0xc2e7('0x105')];}if(_0x1bb095[_0xc2e7('0x102')][_0xc2e7('0x106')]){_0x2e0a31[_0xc2e7('0x107')]={'user':_0x1bb095['Smtp'][_0xc2e7('0xa3')],'pass':_0x1bb095[_0xc2e7('0x102')][_0xc2e7('0x108')]};}return respondWithRpcPromise('SendMail',_0xc2e7('0x109'),{'account':_0x2e0a31,'message':{'from':util[_0xc2e7('0xee')](_0xc2e7('0x10a'),_0x1bb095[_0xc2e7('0x3a')],_0x1bb095[_0xc2e7('0xce')]||_0x1bb095[_0xc2e7('0x102')][_0xc2e7('0xa3')]),'to':_0x21a156[_0xc2e7('0x3c')][_0xc2e7('0xeb')],'subject':'Mail\x20Transcript','text':util[_0xc2e7('0xee')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x21a156['body'][_0xc2e7('0xeb')]),'attachments':[{'path':_0x99afd0}]}})[_0xc2e7('0x21')](function(){return _0x1f60fa;})['catch'](function(_0x433b9a){console[_0xc2e7('0x27')](_0x433b9a);});}else{return _0x1f60fa;}})['then'](respondWithStatusCode(_0x2bb514,0xc8))['catch'](handleError(_0x2bb514,null));};exports[_0xc2e7('0x10b')]=function(_0x37a427,_0x1f9062,_0x3bfd12){return db[_0xc2e7('0xf1')][_0xc2e7('0x72')]({'where':{'id':_0x37a427[_0xc2e7('0xc1')]['id']}})[_0xc2e7('0x21')](handleEntityNotFound(_0x1f9062,null))[_0xc2e7('0x21')](function(_0x459460){if(_0x459460){return _0x459460[_0xc2e7('0x10b')](_0x37a427[_0xc2e7('0x3c')]['ids'],_[_0xc2e7('0x10c')](_0x37a427[_0xc2e7('0x3c')],[_0xc2e7('0x10d'),'id'])||{});}})['then'](respondWithResult(_0x1f9062,null))[_0xc2e7('0x2a')](handleError(_0x1f9062,null));};exports['getMessages']=function(_0x1c70f5,_0x4b0ae4,_0x448cac){var _0x134f25={'raw':![],'where':{}};var _0x1f48d3={};var _0x1f74d6={'count':0x0,'rows':[]};return db[_0xc2e7('0x4d')]['findOne']({'where':{'id':_0x1c70f5['params']['id']}})['then'](handleEntityNotFound(_0x4b0ae4,null))[_0xc2e7('0x21')](function(_0x5c79e4){if(_0x5c79e4){_0x1f48d3[_0xc2e7('0x55')]=_[_0xc2e7('0x52')](db[_0xc2e7('0xf1')][_0xc2e7('0xc2')]);_0x1f48d3[_0xc2e7('0x51')]=_[_0xc2e7('0x52')](_0x1c70f5[_0xc2e7('0x51')]);_0x1f48d3[_0xc2e7('0x5a')]=_[_0xc2e7('0x53')](_0x1f48d3['model'],_0x1f48d3[_0xc2e7('0x51')]);_0x134f25['attributes']=_[_0xc2e7('0x53')](_0x1f48d3['model'],qs['fields'](_0x1c70f5['query'][_0xc2e7('0x56')]));_0x134f25['attributes']=_0x134f25[_0xc2e7('0x54')][_0xc2e7('0x57')]?_0x134f25['attributes']:_0x1f48d3['model'];if(!_0x1c70f5['query']['hasOwnProperty'](_0xc2e7('0x10e'))){_0x134f25[_0xc2e7('0x31')]=qs[_0xc2e7('0x31')](_0x1c70f5[_0xc2e7('0x51')][_0xc2e7('0x31')]);_0x134f25[_0xc2e7('0x2e')]=qs[_0xc2e7('0x2e')](_0x1c70f5['query'][_0xc2e7('0x2e')]);}_0x134f25['order']=qs[_0xc2e7('0x59')](_0x1c70f5[_0xc2e7('0x51')][_0xc2e7('0x59')]);_0x134f25[_0xc2e7('0x87')]=qs[_0xc2e7('0x5a')](_[_0xc2e7('0x10f')](_0x1c70f5[_0xc2e7('0x51')],_0x1f48d3[_0xc2e7('0x5a')]));_0x134f25['where'][_0xc2e7('0x110')]=_0x5c79e4['id'];if(_0x1c70f5[_0xc2e7('0x51')][_0xc2e7('0x94')]){_0x134f25[_0xc2e7('0x87')]=_[_0xc2e7('0xc4')](_0x134f25[_0xc2e7('0x87')],{'$or':_[_0xc2e7('0x40')](_0x134f25[_0xc2e7('0x54')],function(_0x3e1d95){var _0x4ab1ac={};_0x4ab1ac[_0x3e1d95]={'$like':'%'+_0x1c70f5[_0xc2e7('0x51')][_0xc2e7('0x94')]+'%'};return _0x4ab1ac;})});}if(_0x1c70f5[_0xc2e7('0x51')][_0xc2e7('0x8c')]){var _0x783f52=_0x1c70f5['query'][_0xc2e7('0x8c')][_0xc2e7('0x44')](',');var _0x5a15be={};_0x5a15be[_0x783f52[0x0]]={'$gte':moment(_0x783f52[0x1])[_0xc2e7('0xee')](_0xc2e7('0x111'))};_0x134f25[_0xc2e7('0x87')]=_[_0xc2e7('0xc4')](_0x134f25[_0xc2e7('0x87')],_0x5a15be);}_0x134f25=_['merge']({},_0x134f25,_0x1c70f5[_0xc2e7('0x112')]);return db[_0xc2e7('0xf1')][_0xc2e7('0x30')]({'where':_0x134f25['where']})[_0xc2e7('0x21')](function(_0x69f86){_0x1f74d6[_0xc2e7('0x30')]=_0x69f86;if(_0x1c70f5[_0xc2e7('0x51')][_0xc2e7('0x113')]){_0x134f25[_0xc2e7('0xc3')]=[{'all':!![]}];}return db['ChatMessage'][_0xc2e7('0x114')](_0x134f25);})[_0xc2e7('0x21')](function(_0x5844d0){_0x1f74d6['rows']=_0x5844d0;return _0x1f74d6;});}})[_0xc2e7('0x21')](respondWithFilteredResult(_0x4b0ae4,_0x134f25))['catch'](handleError(_0x4b0ae4,null));};exports[_0xc2e7('0x115')]=function(_0x13aaa5,_0x2b4ae8,_0x3d188b){var _0xb4dda3={'where':{}},_0x3850dd={},_0x43824b={'count':0x0,'rows':[]};return db[_0xc2e7('0x4d')][_0xc2e7('0xc8')]({'where':{'id':_0x13aaa5['params']['id']}})[_0xc2e7('0x21')](handleEntityNotFound(_0x2b4ae8,null))[_0xc2e7('0x21')](function(_0x3313a0){if(_0x3313a0){_0x3850dd[_0xc2e7('0x55')]=_['keys'](db[_0xc2e7('0xf1')]['rawAttributes']);_0x3850dd['query']=_[_0xc2e7('0x52')](_0x13aaa5[_0xc2e7('0x51')]);_0x3850dd[_0xc2e7('0x5a')]=_[_0xc2e7('0x53')](_0x3850dd[_0xc2e7('0x55')],_0x3850dd['query']);_0xb4dda3['attributes']=_[_0xc2e7('0x53')](_0x3850dd[_0xc2e7('0x55')],qs[_0xc2e7('0x56')](_0x13aaa5['query']['fields']));_0xb4dda3[_0xc2e7('0x54')]=_0xb4dda3[_0xc2e7('0x54')][_0xc2e7('0x57')]?_0xb4dda3['attributes']:_0x3850dd[_0xc2e7('0x55')];if(!_0x13aaa5['query'][_0xc2e7('0x116')]('nolimit')){_0xb4dda3[_0xc2e7('0x31')]=qs['limit'](_0x13aaa5['query'][_0xc2e7('0x31')]);_0xb4dda3[_0xc2e7('0x2e')]=qs['offset'](_0x13aaa5[_0xc2e7('0x51')]['offset']);}_0xb4dda3[_0xc2e7('0x58')]=qs[_0xc2e7('0x59')](_0x13aaa5[_0xc2e7('0x51')][_0xc2e7('0x59')]);_0xb4dda3['where']=qs[_0xc2e7('0x5a')](_[_0xc2e7('0x10f')](_0x13aaa5[_0xc2e7('0x51')],_0x3850dd[_0xc2e7('0x5a')]));_0xb4dda3[_0xc2e7('0x87')][_0xc2e7('0x110')]=_0x3313a0['id'];if(_0x13aaa5['query'][_0xc2e7('0x94')]){_0xb4dda3[_0xc2e7('0x87')]=_['merge'](_0xb4dda3['where'],{'$or':_['map'](_0xb4dda3['attributes'],function(_0x302033){var _0xd4f640={};_0xd4f640[_0x302033]={'$like':'%'+_0x13aaa5[_0xc2e7('0x51')]['filter']+'%'};return _0xd4f640;})});}_0xb4dda3[_0xc2e7('0x87')][_0xc2e7('0xfe')]=![];if(_0x13aaa5['query']['id']){_0xb4dda3[_0xc2e7('0x87')]['id']={'$gt':_0x13aaa5[_0xc2e7('0x51')]['id']};}_0xb4dda3=_[_0xc2e7('0xc4')]({},_0xb4dda3,_0x13aaa5[_0xc2e7('0x112')]);return db[_0xc2e7('0xf1')]['count']({'where':_0xb4dda3[_0xc2e7('0x87')]})[_0xc2e7('0x21')](function(_0xd231ce){_0x43824b['count']=_0xd231ce;_0xb4dda3[_0xc2e7('0xc3')]=[];if(_0x13aaa5['query'][_0xc2e7('0x117')]){_0xb4dda3[_0xc2e7('0xc3')]['push']({'model':db[_0xc2e7('0x82')],'as':_0xc2e7('0x82'),'attributes':['id',_0xc2e7('0x41'),_0xc2e7('0xf8')]});}if(_0x13aaa5['query']['includeAll']){_0xb4dda3['include']=[{'all':!![]}];}return db[_0xc2e7('0xf1')][_0xc2e7('0x114')](_0xb4dda3);})[_0xc2e7('0x21')](function(_0x30eccc){_0x43824b[_0xc2e7('0xbf')]=_0x30eccc;return _0x43824b;});}})[_0xc2e7('0x21')](respondWithFilteredResult(_0x2b4ae8,_0xb4dda3))[_0xc2e7('0x2a')](handleError(_0x2b4ae8,null));};exports[_0xc2e7('0x118')]=function(_0x11649a,_0x164307,_0x4d71dc){return db[_0xc2e7('0x4d')][_0xc2e7('0x72')]({'where':{'id':_0x11649a[_0xc2e7('0xc1')]['id']}})[_0xc2e7('0x21')](handleEntityNotFound(_0x164307,null))[_0xc2e7('0x21')](function(_0x26c874){if(_0x26c874){return _0x26c874[_0xc2e7('0x119')](_0x11649a[_0xc2e7('0x3c')][_0xc2e7('0x10d')],_[_0xc2e7('0x10c')](_0x11649a[_0xc2e7('0x3c')],[_0xc2e7('0x10d'),'id'])||{})[_0xc2e7('0x11a')](function(){return db['Tag']['findAll']({'attributes':['id',_0xc2e7('0x3a'),_0xc2e7('0x5d')],'where':{'id':_0x11649a['body'][_0xc2e7('0x10d')]}});})[_0xc2e7('0x21')](function(_0x1de34b){socket[_0xc2e7('0x11b')](_0xc2e7('0x11c'),{'id':Number(_0x11649a[_0xc2e7('0xc1')]['id']),'tags':_0x1de34b||[]});return{'id':Number(_0x11649a[_0xc2e7('0xc1')]['id']),'tags':_0x1de34b||[]};});}})['then'](respondWithResult(_0x164307,null))['catch'](handleError(_0x164307,null));};exports[_0xc2e7('0x11d')]=function(_0x1199eb,_0x44e23b,_0x22b0e2){return db['ChatInteraction'][_0xc2e7('0x72')]({'where':{'id':_0x1199eb['params']['id']}})[_0xc2e7('0x21')](handleEntityNotFound(_0x44e23b,null))['then'](function(_0x28d258){if(_0x28d258){return _0x28d258[_0xc2e7('0x11d')](_0x1199eb[_0xc2e7('0x51')][_0xc2e7('0x10d')]);}})['then'](respondWithStatusCode(_0x44e23b,null))['catch'](handleError(_0x44e23b,null));};exports['download']=function(_0x154e18,_0xdd7db4){var _0x1011f8=moment()[_0xc2e7('0x11e')]()[_0xc2e7('0xa6')]();var _0x549847=path[_0xc2e7('0xe6')](config[_0xc2e7('0xec')],_0xc2e7('0x11f'),_0xc2e7('0x120'),_0xc2e7('0x121'));var _0x384ac7=path[_0xc2e7('0xe6')](config['root'],_0xc2e7('0x11f'),_0xc2e7('0x120'),_0xc2e7('0x122'));var _0x2e2b92=path[_0xc2e7('0xe6')](_0x549847,_0x1011f8);var _0x43996d=util[_0xc2e7('0xee')](_0xc2e7('0x123'),_0x154e18[_0xc2e7('0xc1')]['id'],_0x1011f8);var _0x3501c9=path[_0xc2e7('0xe6')](_0x549847,_0x43996d);var _0x2cf0f8=[];_0x2cf0f8[_0xc2e7('0xbd')]({'model':db['User'],'as':_0xc2e7('0x82'),'attributes':['id',_0xc2e7('0x41')],'raw':!![]});_0x2cf0f8[_0xc2e7('0xbd')]({'model':db[_0xc2e7('0xda')],'as':'Contact','attributes':['id','firstName',_0xc2e7('0x124')],'raw':!![]});if(_0x154e18['query'][_0xc2e7('0x122')]){_0x2cf0f8[_0xc2e7('0xbd')]({'model':db[_0xc2e7('0xe2')],'as':'Attachment','raw':!![]});}var _0x47201b=[{'model':db[_0xc2e7('0xf1')],'as':_0xc2e7('0xf2'),'attributes':['id',_0xc2e7('0x3c'),_0xc2e7('0x8a'),'direction',_0xc2e7('0xfe'),_0xc2e7('0x90')],'include':_0x2cf0f8}];_0x47201b[_0xc2e7('0xbd')]({'model':db[_0xc2e7('0xc9')],'as':'Account','attributes':['id','name']});_0x47201b[_0xc2e7('0xbd')]({'model':db[_0xc2e7('0x82')],'as':_0xc2e7('0x125'),'attributes':['id',_0xc2e7('0x41')]});return db['ChatInteraction'][_0xc2e7('0x72')]({'where':{'id':_0x154e18['params']['id']},'include':_0x47201b})['then'](handleEntityNotFound(_0xdd7db4,null))[_0xc2e7('0x21')](function(_0x5a8c42){if(_0x5a8c42){var _0x2bbb2e=_0x5a8c42[_0xc2e7('0x126')]({'plain':!![]});fs[_0xc2e7('0x127')](_0x2e2b92);var _0x597a66={'channel':_0xc2e7('0x128'),'account':_0x2bbb2e[_0xc2e7('0x129')]['name'],'agent':_0x2bbb2e[_0xc2e7('0x125')]?_0x2bbb2e[_0xc2e7('0x125')][_0xc2e7('0x41')]:_0xc2e7('0x12a'),'createdAt':moment(_0x2bbb2e[_0xc2e7('0x8a')])[_0xc2e7('0xee')](_0xc2e7('0x111'))['toString'](),'closedAt':_0x2bbb2e[_0xc2e7('0x48')]?moment(_0x2bbb2e[_0xc2e7('0x12b')])['format'](_0xc2e7('0x111'))['toString']():'','disposition':_0x2bbb2e[_0xc2e7('0x4b')],'chatInfo':{'browser':_0x2bbb2e[_0xc2e7('0x12c')],'os':_0x2bbb2e[_0xc2e7('0x12d')],'referer':_0x2bbb2e['referer'],'customerIp':_0x2bbb2e[_0xc2e7('0x12e')],'customerPort':_0x2bbb2e[_0xc2e7('0x12f')]?_0x2bbb2e[_0xc2e7('0x12f')]:_0xc2e7('0x12a')},'messages':_(_0x2bbb2e['Messages'])[_0xc2e7('0x130')]()[_0xc2e7('0x94')]({'secret':![]})[_0xc2e7('0x40')](function(_0x20c684){if(_0x20c684['Attachment']){var _0x5f3ef4=path[_0xc2e7('0xe6')](_0x384ac7,_0x20c684['Attachment'][_0xc2e7('0x131')]);if(fs[_0xc2e7('0x132')](_0x5f3ef4)){fs[_0xc2e7('0x133')](_0x5f3ef4)[_0xc2e7('0x134')](fs[_0xc2e7('0x135')](path[_0xc2e7('0xe6')](_0x2e2b92,_0x20c684['Attachment'][_0xc2e7('0x131')])));}}return{'date':moment(_0x20c684[_0xc2e7('0x8a')])[_0xc2e7('0xee')](_0xc2e7('0x111'))[_0xc2e7('0xa6')](),'sender':_0x20c684[_0xc2e7('0xfd')]===_0xc2e7('0xd7')?_0x20c684['User']?_0x20c684['User'][_0xc2e7('0x41')]:_0xc2e7('0xf7'):_0x20c684[_0xc2e7('0x77')]['firstName']+(_0x20c684[_0xc2e7('0x77')][_0xc2e7('0x124')]?'\x20'+_0x20c684[_0xc2e7('0x77')]['lastName']:''),'body':_0x20c684[_0xc2e7('0xe2')]?_0x20c684[_0xc2e7('0xe2')][_0xc2e7('0x131')]:_0x20c684['body'],'direction':_0x20c684[_0xc2e7('0xfd')]==='out'?'A':'C','secret':_0x20c684[_0xc2e7('0xfe')],'read':_0x20c684[_0xc2e7('0x90')],'attachment':_0x20c684[_0xc2e7('0xe2')]};})[_0xc2e7('0x73')]()};return ejs[_0xc2e7('0x136')](path[_0xc2e7('0xe6')](config[_0xc2e7('0xec')],'server',_0xc2e7('0x137'),_0xc2e7('0x138')),{'interaction':_0x597a66})[_0xc2e7('0x21')](function(_0xf840e2){var _0xc48871=path[_0xc2e7('0xe6')](_0x2e2b92,'transcript-'+_0x2bbb2e['id']+'-'+_0x1011f8+_0xc2e7('0x139'));var _0x3eb7dc={'path':_0xc48871,'channel':_0xc2e7('0x128'),'interactionId':_0x2bbb2e['id']};return pdf['createPdfFromHTML'](_0xf840e2,_0x3eb7dc);})['then'](function(){return new BPromise(function(_0x51f802,_0x1ae2ec){zipdir(_0x2e2b92,{'saveTo':_0x3501c9},function(_0x1b05f8,_0x364d96){if(_0x1b05f8)return _0x1ae2ec(_0x1b05f8);return _0x51f802(_0x364d96);});})[_0xc2e7('0x21')](function(){return new BPromise(function(_0x3aa354,_0x5f4188){rimraf(_0x2e2b92,function(_0x213cad){if(_0x213cad)_0x5f4188(_0x213cad);return _0x3aa354();});});})['then'](function(){return _0xdd7db4['download'](_0x3501c9,_0x43996d,function(_0x2089e3){if(_0x2089e3){console[_0xc2e7('0x13a')](_0xc2e7('0x13b'),_0x2089e3);}else{fs[_0xc2e7('0x13c')](_0x3501c9);}});});});}else{return _0xdd7db4[_0xc2e7('0x2b')](0xc8);}})[_0xc2e7('0x2a')](handleError(_0xdd7db4,null));}; \ No newline at end of file +var _0xdd25=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','./chatInteraction.socket','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','end','status','json','offset','undefined','limit','count','set','reject','save','update','name','send','merge','body','contact','interaction','Users','map','fullname','TagIds','Tags','split','forEach','talking','answered','unmanaged','abandoned','total','closed','UserId','waiting','index','ChatInteraction','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','select','field','color','from','tools_tags','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','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','expr','search','sqlOperator','length','find','unreadMessages','value','having','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','some','compact','isEmpty','ChatWebsiteId','where','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','filter','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','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','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','push','all','rows','show','params','includeAll','include','destroy','describe','createVidaooSession','findOne','ChatWebsite','vidaooEscalation','vidaooTopic','vidaooMetadata','vidaooApiKey','email','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooNote','follow','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','out','ChatMessage','create','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','sendStatus','Interaction\x20already\x20assigned','disposition','AbandonInteraction','attachmentUpload','file','basename','filename','mimetype','Unauthorized','Attachment','attachId','join','root','server/files/attachments/','offline-chat/','download','close','server/files/chat/upload/','transcript-%s.txt','pathTranscript','User','CmContact','Messages','%s%d','System','format','Visitor','website_alias','agentAlias','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','YYYY-MM-DD\x20HH:mm:ss','options','getMyMessages','includeAgent','findAll','addTags','setTags','spread','emit','removeTags','unix','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','Owner','mkdirSync','Chat','Account','closedAt','browserName','osName','customerIp','customerPort','tail','existsSync','createReadStream','pipe','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf'];(function(_0x3543e7,_0x501fcf){var _0x42df23=function(_0x467049){while(--_0x467049){_0x3543e7['push'](_0x3543e7['shift']());}};_0x42df23(++_0x501fcf);}(_0xdd25,0x13a));var _0x5dd2=function(_0xdca105,_0x1f91ce){_0xdca105=_0xdca105-0x0;var _0x34a61c=_0xdd25[_0xdca105];return _0x34a61c;};'use strict';var emlformat=require(_0x5dd2('0x0'));var rimraf=require(_0x5dd2('0x1'));var zipdir=require(_0x5dd2('0x2'));var jsonpatch=require(_0x5dd2('0x3'));var rp=require(_0x5dd2('0x4'));var moment=require(_0x5dd2('0x5'));var BPromise=require(_0x5dd2('0x6'));var Mustache=require(_0x5dd2('0x7'));var util=require(_0x5dd2('0x8'));var path=require(_0x5dd2('0x9'));var sox=require(_0x5dd2('0xa'));var csv=require(_0x5dd2('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5dd2('0xc'));var squel=require(_0x5dd2('0xd'));var crypto=require(_0x5dd2('0xe'));var jsforce=require(_0x5dd2('0xf'));var deskjs=require(_0x5dd2('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5dd2('0x11'));var Redis=require(_0x5dd2('0x12'));var authService=require(_0x5dd2('0x13'));var qs=require(_0x5dd2('0x14'));var as=require(_0x5dd2('0x15'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x5dd2('0x16'));var logger=require(_0x5dd2('0x17'))('api');var utils=require(_0x5dd2('0x18'));var config=require(_0x5dd2('0x19'));var licenseUtil=require(_0x5dd2('0x1a'));var db=require('../../mysqldb')['db'];config[_0x5dd2('0x1b')]=_[_0x5dd2('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5dd2('0x1b')]));require(_0x5dd2('0x1d'))['register'](socket);var jayson=require(_0x5dd2('0x1e'));var client=jayson[_0x5dd2('0x1f')][_0x5dd2('0x20')]({'port':0x232b});var client9004=jayson[_0x5dd2('0x1f')][_0x5dd2('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x31c324,_0x124288,_0x126f76,_0x4d96f3){return new BPromise(function(_0xff930b,_0x307367){var _0x46339f=_0x4d96f3||client;return _0x46339f[_0x5dd2('0x21')](_0x31c324,_0x126f76)[_0x5dd2('0x22')](function(_0x1bddde){logger[_0x5dd2('0x23')](_0x5dd2('0x24'),_0x124288,_0x5dd2('0x25'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x124288,_0x5dd2('0x25'),JSON[_0x5dd2('0x26')](_0x1bddde));if(_0x1bddde[_0x5dd2('0x27')]){if(_0x1bddde[_0x5dd2('0x27')]['code']===0x1f4){logger[_0x5dd2('0x27')](_0x5dd2('0x24'),_0x124288,_0x1bddde[_0x5dd2('0x27')][_0x5dd2('0x28')]);return _0x307367(_0x1bddde[_0x5dd2('0x27')][_0x5dd2('0x28')]);}logger['error'](_0x5dd2('0x24'),_0x124288,_0x1bddde[_0x5dd2('0x27')]['message']);return _0xff930b(_0x1bddde[_0x5dd2('0x27')][_0x5dd2('0x28')]);}else{logger[_0x5dd2('0x23')](_0x5dd2('0x24'),_0x124288,_0x5dd2('0x25'));_0xff930b(_0x1bddde[_0x5dd2('0x29')][_0x5dd2('0x28')]);}})[_0x5dd2('0x2a')](function(_0x2df995){logger[_0x5dd2('0x27')](_0x5dd2('0x24'),_0x124288,_0x2df995);_0x307367(_0x2df995);});});}function respondWithStatusCode(_0x7d7c7f,_0x171d82){_0x171d82=_0x171d82||0xcc;return function(_0x374971){if(_0x374971){return _0x7d7c7f['sendStatus'](_0x171d82);}return _0x7d7c7f['status'](_0x171d82)[_0x5dd2('0x2b')]();};}function respondWithResult(_0x50236c,_0x3f6c82){_0x3f6c82=_0x3f6c82||0xc8;return function(_0x3f3b1b){if(_0x3f3b1b){return _0x50236c[_0x5dd2('0x2c')](_0x3f6c82)[_0x5dd2('0x2d')](_0x3f3b1b);}};}function respondWithFilteredResult(_0x3e09de,_0x252db4){return function(_0x48e367){if(_0x48e367){var _0x4be3bc=typeof _0x252db4[_0x5dd2('0x2e')]===_0x5dd2('0x2f')&&typeof _0x252db4[_0x5dd2('0x30')]===_0x5dd2('0x2f');var _0x3cc4ec=_0x48e367[_0x5dd2('0x31')];var _0x5e87da=_0x4be3bc?0x0:_0x252db4[_0x5dd2('0x2e')];var _0x338884=_0x4be3bc?_0x48e367['count']:_0x252db4[_0x5dd2('0x2e')]+_0x252db4[_0x5dd2('0x30')];var _0x491081;if(_0x338884>=_0x3cc4ec){_0x338884=_0x3cc4ec;_0x491081=0xc8;}else{_0x491081=0xce;}_0x3e09de['status'](_0x491081);return _0x3e09de[_0x5dd2('0x32')]('Content-Range',_0x5e87da+'-'+_0x338884+'/'+_0x3cc4ec)[_0x5dd2('0x2d')](_0x48e367);}return null;};}function patchUpdates(_0x2341c7){return function(_0x3156e7){try{jsonpatch['apply'](_0x3156e7,_0x2341c7,!![]);}catch(_0x4923b3){return BPromise[_0x5dd2('0x33')](_0x4923b3);}return _0x3156e7[_0x5dd2('0x34')]();};}function saveUpdates(_0x26df28,_0x4c5496){return function(_0x8e2131){if(_0x8e2131){return _0x8e2131[_0x5dd2('0x35')](_0x26df28)[_0x5dd2('0x22')](function(_0x4188ff){return _0x4188ff;});}return null;};}function removeEntity(_0x3ccf40,_0xe11ba6){return function(_0x2c0545){if(_0x2c0545){return _0x2c0545['destroy']()[_0x5dd2('0x22')](function(){_0x3ccf40[_0x5dd2('0x2c')](0xcc)[_0x5dd2('0x2b')]();});}};}function handleEntityNotFound(_0x393adc,_0x307996){return function(_0x1c4522){if(!_0x1c4522){_0x393adc['sendStatus'](0x194);}return _0x1c4522;};}function handleError(_0xb9dfad,_0x3a9ff){_0x3a9ff=_0x3a9ff||0x1f4;return function(_0x380d33){logger[_0x5dd2('0x27')](_0x380d33['stack']);if(_0x380d33['name']){delete _0x380d33[_0x5dd2('0x36')];}_0xb9dfad[_0x5dd2('0x2c')](_0x3a9ff)[_0x5dd2('0x37')](_0x380d33);};}function getMustacheRender(_0x1c2700,_0xc6b25b){return Mustache['render'](_0x1c2700,_[_0x5dd2('0x38')](_0xc6b25b[_0x5dd2('0x39')],{'contact':_0xc6b25b[_0x5dd2('0x3a')],'message':_0xc6b25b[_0x5dd2('0x28')],'agent':_0xc6b25b['agent'],'interaction':_0xc6b25b[_0x5dd2('0x3b')],'account':_0xc6b25b['account']}))||'';}function getInteractionUsers(_0x1405a8,_0x16f73d){return new BPromise(function(_0x11e34c,_0xb18576){try{if(_0x16f73d[_0x1405a8['id']]){_0x1405a8[_0x5dd2('0x3c')]=_[_0x5dd2('0x3d')](_0x16f73d[_0x1405a8['id']],function(_0x489700){return{'id':_0x489700['id'],'fullname':_0x489700[_0x5dd2('0x3e')]};});}}catch(_0x5e4fb1){_0xb18576(_0x5e4fb1);}_0x11e34c(_0x1405a8);});}function getInteractionTags(_0x488c64,_0x108d77){return new BPromise(function(_0x11e5e7,_0x29fef5){try{if(_0x488c64[_0x5dd2('0x3f')]){_0x488c64[_0x5dd2('0x40')]=[];_0x488c64[_0x5dd2('0x3f')][_0x5dd2('0x41')](',')[_0x5dd2('0x42')](function(_0x13e89f){_0x488c64[_0x5dd2('0x40')]['push'](_0x108d77[_0x13e89f]);});}delete _0x488c64[_0x5dd2('0x3f')];}catch(_0xe163ed){_0x29fef5(_0xe163ed);}_0x11e5e7(_0x488c64);});}function updateChatInteraction(_0x298ea3,_0xc3aa2c,_0x19ccff){return new BPromise(function(_0x15adaf,_0x151b57){return getInteractionUsers(_0x298ea3,_0x19ccff)[_0x5dd2('0x22')](function(_0x1decdf){return getInteractionTags(_0x1decdf,_0xc3aa2c);})[_0x5dd2('0x22')](function(_0x1f970b){return getStateInteraction(_0x1f970b);})['then'](function(_0x58318b){_0x15adaf(_0x58318b);})[_0x5dd2('0x2a')](function(_0x24c163){_0x151b57(_0x24c163);});});}function getStateInteraction(_0x1e85b1){return new BPromise(function(_0x37e5ca){_0x1e85b1['waiting']=0x0;_0x1e85b1[_0x5dd2('0x43')]=0x0;_0x1e85b1[_0x5dd2('0x44')]=0x0;_0x1e85b1[_0x5dd2('0x45')]=0x0;_0x1e85b1[_0x5dd2('0x46')]=0x0;_0x1e85b1[_0x5dd2('0x47')]=0x0;if(!_0x1e85b1[_0x5dd2('0x48')]&&!_0x1e85b1[_0x5dd2('0x49')]){_0x1e85b1['waiting']+=0x1;}if(!_0x1e85b1[_0x5dd2('0x48')]&&_0x1e85b1[_0x5dd2('0x49')]){_0x1e85b1[_0x5dd2('0x43')]+=0x1;if(_0x1e85b1[_0x5dd2('0x4a')]){_0x1e85b1[_0x5dd2('0x4a')]-=0x1;}}if(_0x1e85b1[_0x5dd2('0x48')]&&_0x1e85b1['disposition']===_0x5dd2('0x46')){_0x1e85b1['abandoned']+=0x1;if(_0x1e85b1['waiting']){_0x1e85b1['waiting']-=0x1;}}else if(_0x1e85b1[_0x5dd2('0x48')]&&!_0x1e85b1[_0x5dd2('0x49')]&&_0x1e85b1['disposition']){_0x1e85b1[_0x5dd2('0x45')]+=0x1;if(_0x1e85b1[_0x5dd2('0x4a')]){_0x1e85b1['waiting']-=0x1;}}else if(_0x1e85b1[_0x5dd2('0x48')]&&_0x1e85b1[_0x5dd2('0x49')]){_0x1e85b1[_0x5dd2('0x44')]+=0x1;if(_0x1e85b1[_0x5dd2('0x43')]){_0x1e85b1[_0x5dd2('0x43')]-=0x1;}}_0x1e85b1[_0x5dd2('0x47')]+=0x1;_0x37e5ca(_0x1e85b1);});}exports[_0x5dd2('0x4b')]=function(_0x370a41,_0x312f96){var _0x10fe4b={},_0x5653e3={},_0x178848={'count':0x0,'rows':[]};var _0x1d4334=_[_0x5dd2('0x3d')](db[_0x5dd2('0x4c')][_0x5dd2('0x4d')],function(_0x4e6159){return{'name':_0x4e6159[_0x5dd2('0x4e')],'type':_0x4e6159[_0x5dd2('0x4f')]['key']};});_0x5653e3[_0x5dd2('0x50')]=_[_0x5dd2('0x3d')](_0x1d4334,_0x5dd2('0x36'));_0x5653e3[_0x5dd2('0x51')]=_[_0x5dd2('0x52')](_0x370a41[_0x5dd2('0x51')]);_0x5653e3[_0x5dd2('0x53')]=_[_0x5dd2('0x54')](_0x5653e3[_0x5dd2('0x50')],_0x5653e3['query']);_0x10fe4b[_0x5dd2('0x55')]=_[_0x5dd2('0x54')](_0x5653e3[_0x5dd2('0x50')],qs['fields'](_0x370a41[_0x5dd2('0x51')][_0x5dd2('0x56')]));_0x10fe4b['attributes']=_0x10fe4b[_0x5dd2('0x55')]['length']?_0x10fe4b['attributes']:_0x5653e3[_0x5dd2('0x50')];if(!_0x370a41[_0x5dd2('0x51')][_0x5dd2('0x57')](_0x5dd2('0x58'))){_0x10fe4b[_0x5dd2('0x30')]=qs['limit'](_0x370a41[_0x5dd2('0x51')][_0x5dd2('0x30')]);_0x10fe4b[_0x5dd2('0x2e')]=qs[_0x5dd2('0x2e')](_0x370a41[_0x5dd2('0x51')][_0x5dd2('0x2e')]);}_0x10fe4b[_0x5dd2('0x59')]=qs[_0x5dd2('0x5a')](_0x370a41[_0x5dd2('0x51')]['sort']);_0x10fe4b['where']=qs['filters'](_[_0x5dd2('0x5b')](_0x370a41[_0x5dd2('0x51')],_0x5653e3[_0x5dd2('0x53')]),_0x1d4334);var _0x199c07=[];var _0x273092=squel[_0x5dd2('0x5c')]()[_0x5dd2('0x5d')]('id')[_0x5dd2('0x5d')]('name')[_0x5dd2('0x5d')](_0x5dd2('0x5e'))[_0x5dd2('0x5f')](_0x5dd2('0x60'));var _0x3fd77d=squel[_0x5dd2('0x5c')]()[_0x5dd2('0x5d')]('u.id')['field']('u.fullname')['field'](_0x5dd2('0x61'))[_0x5dd2('0x5f')](_0x5dd2('0x62'),'ui')[_0x5dd2('0x63')](_0x5dd2('0x64'),'u',_0x5dd2('0x65'));var _0x55e347=squel[_0x5dd2('0x5c')]()[_0x5dd2('0x5f')](_0x5dd2('0x66'),'i')[_0x5dd2('0x63')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x5dd2('0x63')](_0x5dd2('0x64'),'o',_0x5dd2('0x67'))[_0x5dd2('0x63')]('chat_websites','a',_0x5dd2('0x68'))[_0x5dd2('0x63')](_0x5dd2('0x69'),'me',_0x5dd2('0x6a'))[_0x5dd2('0x63')](_0x5dd2('0x6b'),'it',_0x5dd2('0x6c'))[_0x5dd2('0x63')]('tools_tags','t','t.id\x20=\x20it.TagId');var _0x3a7ac8=squel[_0x5dd2('0x6d')]();var _0x3a5abd=[];var _0x35524a=squel['expr']();var _0x3e9b35;if(_0x370a41[_0x5dd2('0x51')]['search']){_0x3e9b35=as['parseSearch'](_0x370a41[_0x5dd2('0x51')][_0x5dd2('0x6e')]);var _0x218f94=_0x3e9b35[_0x5dd2('0x6f')];for(var _0x2ca3d3=0x0;_0x2ca3d3<_0x3e9b35['conditions'][_0x5dd2('0x70')];_0x2ca3d3++){var _0x4e0a74=_0x3e9b35['conditions'][_0x2ca3d3];var _0x5b8301='i';var _0x2d8229=_[_0x5dd2('0x71')](_0x1d4334,[_0x5dd2('0x36'),_0x4e0a74['field']]);if(!_0x2d8229){switch(_0x4e0a74['field']){case _0x5dd2('0x72'):if(_0x4e0a74[_0x5dd2('0x73')]==0x1){_0x55e347[_0x5dd2('0x74')]('`'+_0x4e0a74[_0x5dd2('0x5d')]+'`\x20=\x200');}else{_0x55e347['having']('`'+_0x4e0a74[_0x5dd2('0x5d')]+'`\x20>\x200');}break;case _0x5dd2('0x75'):if(_0x4e0a74['operator']===_0x5dd2('0x76')){if(_0x4e0a74[_0x5dd2('0x73')][_0x5dd2('0x41')]('\x20')['length']>0x1){_0x3a7ac8[_0x218f94](_0x5dd2('0x77'),qs[_0x5dd2('0x78')](_0x4e0a74[_0x5dd2('0x73')]),null);}else{var _0x5af19c='%'+_0x4e0a74[_0x5dd2('0x73')]+'%';_0x3a7ac8[_0x218f94]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x5af19c,_0x5af19c,_0x5af19c);}}else{_0x2d8229=_[_0x5dd2('0x71')](_0x1d4334,[_0x5dd2('0x36'),_0x5dd2('0x79')]);_0x4e0a74[_0x5dd2('0x5d')]=_0x5dd2('0x79');_0x297ba2=as['buildExpression'](_0x5b8301,_0x2d8229[_0x5dd2('0x4f')],_0x4e0a74);_0x3a7ac8[_0x218f94](_0x297ba2[_0x5dd2('0x7a')],_0x297ba2[_0x5dd2('0x73')][_0x5dd2('0x7b')],_0x297ba2[_0x5dd2('0x73')][_0x5dd2('0x2b')]);}break;case _0x5dd2('0x7c'):var _0x3ee73b=_0x4e0a74['value'][_0x5dd2('0x41')](',')[_0x5dd2('0x3d')](function(_0x568143){return Number(_0x568143);});_0x3ee73b['forEach'](function(_0x225568){_0x35524a['or'](_0x5dd2('0x7d'),'%,'+_0x225568+',%');});_0x3a5abd=_[_0x5dd2('0x7e')](_0x3a5abd,_0x3ee73b);break;case'User':if(_0x4e0a74['operator']===_0x5dd2('0x76')){_0x3a7ac8[_0x218f94](_0x5dd2('0x7f'),'%'+_0x4e0a74[_0x5dd2('0x73')]+'%',null);}else{_0x2d8229=_[_0x5dd2('0x71')](_0x1d4334,[_0x5dd2('0x36'),_0x5dd2('0x49')]);_0x4e0a74['field']=_0x5dd2('0x49');_0x297ba2=as[_0x5dd2('0x80')](_0x5b8301,_0x2d8229[_0x5dd2('0x4f')],_0x4e0a74);_0x3a7ac8[_0x218f94](_0x297ba2[_0x5dd2('0x7a')],_0x297ba2[_0x5dd2('0x73')][_0x5dd2('0x7b')],_0x297ba2[_0x5dd2('0x73')][_0x5dd2('0x2b')]);}break;case _0x5dd2('0x39'):_0x297ba2=as['buildExpression']('me',null,_0x4e0a74);_0x3a7ac8[_0x218f94](_0x297ba2[_0x5dd2('0x7a')],_0x297ba2[_0x5dd2('0x73')][_0x5dd2('0x7b')],_0x297ba2[_0x5dd2('0x73')][_0x5dd2('0x2b')]);break;}}else{var _0x297ba2=as[_0x5dd2('0x80')](_0x5b8301,_0x2d8229[_0x5dd2('0x4f')],_0x4e0a74);_0x3a7ac8[_0x218f94](_0x297ba2['text'],_0x297ba2[_0x5dd2('0x73')][_0x5dd2('0x7b')],_0x297ba2[_0x5dd2('0x73')]['end']);}}}else{var _0x264a8e=_(_0x370a41[_0x5dd2('0x51')])[_0x5dd2('0x52')]()['map'](function(_0x409702){return _[_0x5dd2('0x81')](_0x1d4334,[_0x5dd2('0x36'),_0x409702])?_0x409702:undefined;})[_0x5dd2('0x82')]()[_0x5dd2('0x73')]();if(!_[_0x5dd2('0x83')](_0x264a8e)){_0x264a8e[_0x5dd2('0x42')](function(_0x445034){if(_0x445034===_0x5dd2('0x84')){_0x55e347[_0x5dd2('0x85')](_0x5dd2('0x86'),[][_0x5dd2('0x87')](_0x370a41[_0x5dd2('0x51')][_0x445034]));}else if(_0x445034===_0x5dd2('0x88')){var _0x30ef10=JSON[_0x5dd2('0x89')](_0x370a41[_0x5dd2('0x51')][_0x445034])[_0x5dd2('0x8a')];var _0x228089=JSON[_0x5dd2('0x89')](_0x370a41[_0x5dd2('0x51')][_0x445034])['$lte'];_0x55e347[_0x5dd2('0x85')](_0x5dd2('0x8b'),_0x30ef10,_0x228089);}else{if(_0x370a41[_0x5dd2('0x51')][_0x445034]===_0x5dd2('0x8c')){_0x55e347[_0x5dd2('0x85')]('i.'+_0x445034+_0x5dd2('0x8d'));}else{_0x55e347['where']('i.'+_0x445034+_0x5dd2('0x8e'),_0x370a41[_0x5dd2('0x51')][_0x445034]);}}});}if(_0x370a41[_0x5dd2('0x51')][_0x5dd2('0x8f')]){if(_0x370a41['query'][_0x5dd2('0x8f')]==0x1){_0x55e347[_0x5dd2('0x74')](_0x5dd2('0x90'));}else{_0x55e347[_0x5dd2('0x74')]('`unreadMessages`\x20>\x200');}}if(_0x370a41[_0x5dd2('0x51')]['tag']){_0x3a5abd=_['isArray'](_0x370a41[_0x5dd2('0x51')][_0x5dd2('0x91')])?_0x370a41['query'][_0x5dd2('0x91')]:new Array(_0x370a41[_0x5dd2('0x51')]['tag']);_0x3a5abd[_0x5dd2('0x42')](function(_0x48b7b8){_0x35524a['or'](_0x5dd2('0x7d'),'%,'+_0x48b7b8+',%');});}if(_0x370a41['query'][_0x5dd2('0x92')]){var _0x16ca90=_0x370a41[_0x5dd2('0x51')]['filter'][_0x5dd2('0x93')]('\x5c','\x5c\x5c')[_0x5dd2('0x93')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x16ca90)){_0x3a7ac8['or'](_0x5dd2('0x94'),_0x16ca90+'%');}else{_0x3a7ac8['or'](_0x5dd2('0x95'),qs['getFullTextValue'](_0x16ca90))['or'](_0x5dd2('0x96'),_0x16ca90+'%');}}}_0x55e347['where'](_0x3a7ac8);_0x55e347[_0x5dd2('0x97')](_0x5dd2('0x98'));var _0x13b469={'type':db[_0x5dd2('0x99')][_0x5dd2('0x9a')]['SELECT'],'raw':!![]};var _0x893d45=_0x55e347[_0x5dd2('0x9b')]();_0x893d45[_0x5dd2('0x5d')](_0x5dd2('0x98'));_0x893d45['field'](_0x5dd2('0x9c'),_0x5dd2('0x72'));if(_0x10fe4b[_0x5dd2('0x59')]){_0x10fe4b[_0x5dd2('0x59')][_0x5dd2('0x42')](function(_0x397f2d){var _0x14c34e=_0x397f2d[0x0]===_0x5dd2('0x9d')?_0x397f2d[0x0]:'i.'+_0x397f2d[0x0];_0x55e347[_0x5dd2('0x59')](_0x14c34e,_0x397f2d[0x1]===_0x5dd2('0x9e')?![]:!![]);});}if(!_[_0x5dd2('0x83')](_0x3a5abd)){_0x55e347[_0x5dd2('0x74')](_0x35524a);_0x893d45['where'](_0x5dd2('0x9f'),_0x3a5abd);}BPromise['resolve']()[_0x5dd2('0x22')](function(){if(!_0x3e9b35){if(_0x370a41[_0x5dd2('0x51')][_0x5dd2('0x84')])return;_0x893d45[_0x5dd2('0x85')](_0x5dd2('0xa0'));_0x55e347['where'](_0x5dd2('0xa0'));return;}if(_0x370a41[_0x5dd2('0xa1')][_0x5dd2('0xa2')]!==_0x5dd2('0xa3'))return;return _0x370a41['user'][_0x5dd2('0xa4')]({'attributes':['id'],'raw':!![]})['then'](function(_0x31a1ac){if(_['isEmpty'](_0x31a1ac)){_0x893d45[_0x5dd2('0x85')]('i.ChatWebsiteId\x20IS\x20NULL');_0x55e347[_0x5dd2('0x85')](_0x5dd2('0xa5'));}else{_0x893d45[_0x5dd2('0x85')](_0x5dd2('0x86'),_[_0x5dd2('0x3d')](_0x31a1ac,'id'));_0x55e347['where']('i.ChatWebsiteId\x20IN\x20?',_[_0x5dd2('0x3d')](_0x31a1ac,'id'));}});})['then'](function(){if(_0x370a41[_0x5dd2('0xa1')]['role']===_0x5dd2('0xa3')&&!_0x3e9b35&&!_0x370a41[_0x5dd2('0x51')][_0x5dd2('0x84')])return[];return db[_0x5dd2('0xa6')][_0x5dd2('0x51')](_0x893d45[_0x5dd2('0xa7')](),_0x13b469);})['then'](function(_0x100158){_0x178848[_0x5dd2('0x31')]=_0x100158[_0x5dd2('0x70')];if(_0x178848[_0x5dd2('0x31')]===0x0)return[];return db[_0x5dd2('0xa6')][_0x5dd2('0x51')](_0x273092[_0x5dd2('0xa7')](),_0x13b469)[_0x5dd2('0x22')](function(_0x40a821){_0x199c07=_['keyBy'](_0x40a821,'id');_0x13b469=_[_0x5dd2('0x38')](_0x13b469,{'model':db[_0x5dd2('0x4c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x370a41[_0x5dd2('0x51')][_0x5dd2('0x56')]){_0x10fe4b[_0x5dd2('0x55')]['forEach'](function(_0x58b3d1){_0x55e347['field']('i.'+_0x58b3d1);});}else{_0x55e347[_0x5dd2('0x5d')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x5dd2('0x72'));_0x55e347[_0x5dd2('0x5d')](_0x5dd2('0xa8'),_0x5dd2('0xa9'));_0x55e347[_0x5dd2('0x5d')](_0x5dd2('0xaa'),_0x5dd2('0xab'));_0x55e347[_0x5dd2('0x5d')](_0x5dd2('0xac'),_0x5dd2('0x9d'));_0x55e347[_0x5dd2('0x5d')](_0x5dd2('0xad'));_0x55e347[_0x5dd2('0x5d')](_0x5dd2('0xae'),_0x5dd2('0xaf'));_0x55e347[_0x5dd2('0x5d')](_0x5dd2('0xb0'),_0x5dd2('0xb1'));_0x55e347[_0x5dd2('0x5d')]('c.email','Contact.email');_0x55e347[_0x5dd2('0x5d')](_0x5dd2('0xb2'),_0x5dd2('0xb3'));_0x55e347[_0x5dd2('0x5d')](_0x5dd2('0xb4'),_0x5dd2('0xb5'));_0x55e347['field'](_0x5dd2('0xb6'),_0x5dd2('0xb7'));_0x55e347['field'](_0x5dd2('0xb8'),_0x5dd2('0xb9'));_0x55e347[_0x5dd2('0x5d')](_0x5dd2('0xba'),'Owner.internal');_0x55e347[_0x5dd2('0x5d')](_0x5dd2('0xbb'),_0x5dd2('0x3f'));}if(_0x10fe4b['limit'])_0x55e347['limit'](_0x10fe4b['limit']);if(_0x10fe4b[_0x5dd2('0x2e')])_0x55e347[_0x5dd2('0x2e')](_0x10fe4b[_0x5dd2('0x2e')]);return db[_0x5dd2('0xa6')][_0x5dd2('0x51')](_0x55e347[_0x5dd2('0xa7')](),_0x13b469);})[_0x5dd2('0x22')](function(_0x2bbcf3){if(_0x2bbcf3[_0x5dd2('0x70')]>0x0)_0x3fd77d[_0x5dd2('0x85')](_0x5dd2('0xbc'),_[_0x5dd2('0x3d')](_0x2bbcf3,'id'));return db[_0x5dd2('0xa6')]['query'](_0x3fd77d[_0x5dd2('0xa7')](),_0x13b469)[_0x5dd2('0x22')](function(_0x50bf84){var _0x55e0c2=_['groupBy'](_0x50bf84,_0x5dd2('0xbd'));var _0x461162=[];_0x2bbcf3[_0x5dd2('0x42')](function(_0x9303e9){_0x461162[_0x5dd2('0xbe')](updateChatInteraction(_0x9303e9,_0x199c07,_0x55e0c2));});return BPromise[_0x5dd2('0xbf')](_0x461162);});});})[_0x5dd2('0x22')](function(_0x1be4ba){_0x178848[_0x5dd2('0xc0')]=_0x1be4ba;return _0x178848;})[_0x5dd2('0x22')](respondWithFilteredResult(_0x312f96,_0x10fe4b))[_0x5dd2('0x2a')](handleError(_0x312f96,null));};exports[_0x5dd2('0xc1')]=function(_0x8b320a,_0x248b5c){var _0x50448d={'raw':![],'where':{'id':_0x8b320a[_0x5dd2('0xc2')]['id']}},_0x2304bf={};_0x2304bf[_0x5dd2('0x50')]=_[_0x5dd2('0x52')](db[_0x5dd2('0x4c')][_0x5dd2('0x4d')]);_0x2304bf['query']=_[_0x5dd2('0x52')](_0x8b320a['query']);_0x2304bf[_0x5dd2('0x53')]=_[_0x5dd2('0x54')](_0x2304bf['model'],_0x2304bf[_0x5dd2('0x51')]);_0x50448d[_0x5dd2('0x55')]=_[_0x5dd2('0x54')](_0x2304bf[_0x5dd2('0x50')],qs['fields'](_0x8b320a[_0x5dd2('0x51')][_0x5dd2('0x56')]));_0x50448d[_0x5dd2('0x55')]=_0x50448d[_0x5dd2('0x55')]['length']?_0x50448d[_0x5dd2('0x55')]:_0x2304bf[_0x5dd2('0x50')];if(_0x8b320a[_0x5dd2('0x51')][_0x5dd2('0xc3')]){_0x50448d[_0x5dd2('0xc4')]=[{'all':!![]}];}_0x50448d=_[_0x5dd2('0x38')]({},_0x50448d,_0x8b320a['options']);return db[_0x5dd2('0x4c')][_0x5dd2('0x71')](_0x50448d)[_0x5dd2('0x22')](handleEntityNotFound(_0x248b5c,null))[_0x5dd2('0x22')](respondWithResult(_0x248b5c,null))[_0x5dd2('0x2a')](handleError(_0x248b5c,null));};exports['create']=function(_0x3d970e,_0x1e05e0){return db[_0x5dd2('0x4c')]['create'](_0x3d970e[_0x5dd2('0x39')],{})[_0x5dd2('0x22')](respondWithResult(_0x1e05e0,0xc9))[_0x5dd2('0x2a')](handleError(_0x1e05e0,null));};exports[_0x5dd2('0x35')]=function(_0x7dd3f3,_0x27ad08){if(_0x7dd3f3[_0x5dd2('0x39')]['id']){delete _0x7dd3f3[_0x5dd2('0x39')]['id'];}return db[_0x5dd2('0x4c')][_0x5dd2('0x71')]({'where':{'id':_0x7dd3f3[_0x5dd2('0xc2')]['id']}})[_0x5dd2('0x22')](handleEntityNotFound(_0x27ad08,null))[_0x5dd2('0x22')](saveUpdates(_0x7dd3f3[_0x5dd2('0x39')],null))['then'](respondWithResult(_0x27ad08,null))[_0x5dd2('0x2a')](handleError(_0x27ad08,null));};exports[_0x5dd2('0xc5')]=function(_0x4f1f41,_0x3667bb){return db[_0x5dd2('0x4c')][_0x5dd2('0x71')]({'where':{'id':_0x4f1f41[_0x5dd2('0xc2')]['id']}})[_0x5dd2('0x22')](handleEntityNotFound(_0x3667bb,null))[_0x5dd2('0x22')](removeEntity(_0x3667bb,null))['catch'](handleError(_0x3667bb,null));};exports[_0x5dd2('0xc6')]=function(_0x1f5324,_0x76d7f3){return db[_0x5dd2('0x4c')]['describe']()['then'](respondWithResult(_0x76d7f3,null))[_0x5dd2('0x2a')](handleError(_0x76d7f3,null));};exports[_0x5dd2('0xc7')]=function(_0x4511e6,_0x2d2756){var _0x5b5211=_0x4511e6[_0x5dd2('0xc2')]['id'];var _0xcea6;var _0x2395e2;var _0x216a7a;return db[_0x5dd2('0x4c')][_0x5dd2('0xc8')]({'where':{'id':_0x5b5211}})[_0x5dd2('0x22')](function(_0x34dd3d){_0xcea6=_0x34dd3d;return db[_0x5dd2('0xc9')]['findOne']({'where':{'id':_0x34dd3d['ChatWebsiteId']},'attributes':['id','vidaooApiKey',_0x5dd2('0xca'),_0x5dd2('0xcb'),'vidaooNote',_0x5dd2('0xcc')],'raw':!![]});})[_0x5dd2('0x22')](function(_0x42edcc){if(_0x42edcc&&_0x42edcc[_0x5dd2('0xcd')]&&_0x42edcc[_0x5dd2('0xca')]){_0x2395e2=_0x42edcc;var _0x57b07a={'interaction':{'id':_0x5b5211},'agent':{'id':_0x4511e6[_0x5dd2('0xa1')]['id'],'name':_0x4511e6[_0x5dd2('0xa1')][_0x5dd2('0x36')],'fullname':_0x4511e6[_0x5dd2('0xa1')][_0x5dd2('0x3e')],'email':_0x4511e6[_0x5dd2('0xa1')][_0x5dd2('0xce')]},'contact':_0x4511e6[_0x5dd2('0x39')][_0x5dd2('0x3a')],'account':_0x4511e6['body']['account']};var _0x90345={'rejectUnauthorized':![],'method':'POST','url':_0x5dd2('0xcf'),'headers':{'X-APIKEY':_0x42edcc[_0x5dd2('0xcd')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4511e6[_0x5dd2('0xa1')][_0x5dd2('0xce')]],'buttons':null,'topic':_0x2395e2['vidaooTopic'],'note':_[_0x5dd2('0xd0')](_0x2395e2['vidaooNote'])?null:getMustacheRender(_0x2395e2[_0x5dd2('0xd1')],_0x57b07a),'metadata':null},'redirect':_0x5dd2('0xd2'),'json':!![]};try{if(!_['isNull'](_0x2395e2[_0x5dd2('0xcc')])){var _0x18cf98=getMustacheRender(_0x2395e2[_0x5dd2('0xcc')],_0x57b07a);var _0x2898b2=JSON['parse'](_0x18cf98);_0x90345['body']['metadata']=_0x2898b2;}}catch(_0x321249){throw new db['Sequelize'][(_0x5dd2('0xd3'))](_0x5dd2('0xd4'));}return rp(_0x90345);}else{throw new db[(_0x5dd2('0x99'))]['ValidationError']('Error\x20in\x20Vidaoo\x20configuration');}})[_0x5dd2('0x22')](function(_0x29ebe2){_0x216a7a=_0x29ebe2;if(_0x216a7a['id']){var _0x5b1485={'body':_0x216a7a['join_url'],'ChatWebsiteId':_0x2395e2['id'],'ChatInteractionId':_0xcea6['id'],'direction':_0x5dd2('0xd5'),'UserId':_0x4511e6[_0x5dd2('0xa1')]['id']};return db[_0x5dd2('0xd6')][_0x5dd2('0xd7')](_0x5b1485,{});}else{throw new db[(_0x5dd2('0x99'))]['ValidationError'](_0x5dd2('0xd8'));}})[_0x5dd2('0x22')](function(){return _0xcea6[_0x5dd2('0xd9')]({'vidaooSessionId':_0x216a7a['id']});})[_0x5dd2('0x22')](respondWithResult(_0x2d2756,null))[_0x5dd2('0x2a')](handleError(_0x2d2756,null));};exports[_0x5dd2('0xda')]=function(_0x3f53ee,_0x2c81e5){if(_0x3f53ee[_0x5dd2('0x39')]['id']){delete _0x3f53ee[_0x5dd2('0x39')]['id'];}return db[_0x5dd2('0x4c')][_0x5dd2('0x71')]({'where':{'id':_0x3f53ee[_0x5dd2('0xc2')]['id']},'include':[{'model':db['CmContact'],'as':_0x5dd2('0x75')}]})['then'](handleEntityNotFound(_0x2c81e5,null))['then'](saveUpdates(_0x3f53ee[_0x5dd2('0x39')],null))[_0x5dd2('0x22')](respondWithResult(_0x2c81e5,null))[_0x5dd2('0x2a')](handleError(_0x2c81e5,null));};exports[_0x5dd2('0xdb')]=function(_0x3c42fb,_0x504c61,_0x896c39){if(_0x3c42fb[_0x5dd2('0x39')]['id']){delete _0x3c42fb[_0x5dd2('0x39')]['id'];}return db[_0x5dd2('0x4c')][_0x5dd2('0x71')]({'where':{'id':_0x3c42fb['params']['id']}})[_0x5dd2('0x22')](function(_0x178911){if(!_0x178911){logger[_0x5dd2('0x27')](_0x5dd2('0xdc'),_0x5dd2('0xdb'),0x194,_0x5dd2('0xdd'));_0x504c61[_0x5dd2('0xde')](0x194);}else{if(_0x178911['UserId']){throw new db[(_0x5dd2('0x99'))][(_0x5dd2('0xd3'))](_0x5dd2('0xdf'));}}return _0x178911;})['then'](function(_0x4c0e71){if(_0x4c0e71){return _0x4c0e71['update']({'closed':_0x3c42fb[_0x5dd2('0x39')]['closed'],'disposition':_0x3c42fb[_0x5dd2('0x39')][_0x5dd2('0xe0')]})[_0x5dd2('0x22')](function(_0x1e8e35){return _0x1e8e35;});}})[_0x5dd2('0x22')](function(_0x54053d){return respondWithRpcPromise(_0x5dd2('0xe1'),_0x5dd2('0xdb'),_0x3c42fb[_0x5dd2('0x39')],client9004);})[_0x5dd2('0x22')](respondWithResult(_0x504c61,null))[_0x5dd2('0x2a')](handleError(_0x504c61,null));};exports[_0x5dd2('0xe2')]=function(_0x2825fe,_0x3219cf,_0x5b4028){_0x2825fe[_0x5dd2('0x39')]['name']=_0x2825fe[_0x5dd2('0xe3')]['originalname'];_0x2825fe[_0x5dd2('0x39')][_0x5dd2('0xe4')]=_0x2825fe[_0x5dd2('0xe3')][_0x5dd2('0xe5')];_0x2825fe[_0x5dd2('0x39')][_0x5dd2('0x4f')]=_0x2825fe['file'][_0x5dd2('0xe6')];return db['Attachment']['create'](_0x2825fe['body'])[_0x5dd2('0x22')](respondWithResult(_0x3219cf,0xc9))[_0x5dd2('0x2a')](handleError(_0x3219cf,null));};exports['attachmentDownload']=function(_0x135bea,_0xe8fb54,_0x2b26cd){return db[_0x5dd2('0x4c')][_0x5dd2('0xc8')]({'where':{'id':_0x135bea[_0x5dd2('0xc2')]['id']},'raw':!![]})[_0x5dd2('0x22')](handleEntityNotFound(_0xe8fb54,null))[_0x5dd2('0x22')](function(_0x73a02e){if(_0x73a02e){if(_0x73a02e[_0x5dd2('0x48')]){return _0xe8fb54[_0x5dd2('0x2c')](0x193)[_0x5dd2('0x2d')]({'status':0x193,'message':_0x5dd2('0xe7')});}return db[_0x5dd2('0xe8')][_0x5dd2('0xc8')]({'where':{'id':_0x135bea['query'][_0x5dd2('0xe9')]},'raw':!![]})[_0x5dd2('0x22')](handleEntityNotFound(_0xe8fb54,null));}})[_0x5dd2('0x22')](function(_0x346cd4){if(_0x346cd4){var _0x53918e=_0x346cd4['ChatOfflineMessageId']!==null;var _0x3288c1=path[_0x5dd2('0xea')](config[_0x5dd2('0xeb')],_0x5dd2('0xec'));if(_0x53918e){_0x3288c1=path[_0x5dd2('0xea')](_0x3288c1,_0x5dd2('0xed'));}var _0x3f4ff1=path[_0x5dd2('0xea')](_0x3288c1,_0x346cd4[_0x5dd2('0xe4')]);return _0xe8fb54[_0x5dd2('0xee')](_0x3f4ff1);}})[_0x5dd2('0x2a')](handleError(_0xe8fb54,null));};exports[_0x5dd2('0xef')]=function(_0x2f6749,_0x4c5b2e){var _0x3be791=null;var _0x32b2a2=null;var _0x1875bd=null;var _0x57bd4a=null;if(_0x2f6749[_0x5dd2('0x39')]['id']){delete _0x2f6749['body']['id'];}if(_0x2f6749[_0x5dd2('0x39')]['mailTranscript']){_0x57bd4a=path[_0x5dd2('0xea')](config['root'],_0x5dd2('0xf0'),util['format'](_0x5dd2('0xf1'),Date['now']()));_0x2f6749['body'][_0x5dd2('0xf2')]=_0x57bd4a;}return db[_0x5dd2('0x4c')][_0x5dd2('0x71')]({'where':{'id':_0x2f6749['params']['id']},'include':[{'model':db['ChatMessage'],'as':'Messages','include':[{'model':db[_0x5dd2('0xf3')],'as':_0x5dd2('0xf3')}]}]})['then'](handleEntityNotFound(_0x4c5b2e,null))['then'](saveUpdates(_0x2f6749[_0x5dd2('0x39')],null))['then'](function(_0x12ac41){if(_0x12ac41){_0x3be791=_0x12ac41;return db[_0x5dd2('0xc9')][_0x5dd2('0x71')]({'where':{'id':_0x3be791[_0x5dd2('0x84')]}});}})[_0x5dd2('0x22')](function(_0x5d8bfc){if(_0x5d8bfc){_0x1875bd=_0x5d8bfc;return db[_0x5dd2('0xf4')]['find']({'where':{'id':_0x3be791['ContactId']}});}})[_0x5dd2('0x22')](function(_0x1a6eb6){if(_0x1a6eb6){_0x32b2a2=_0x1a6eb6;if(_0x57bd4a){var _0x1108f3=null;for(var _0x27e05c=0x1;_0x27e05c<_0x3be791[_0x5dd2('0xf5')][_0x5dd2('0x70')];++_0x27e05c){_0x1108f3=_0x3be791[_0x5dd2('0xf5')][_0x27e05c];var _0x4ef7b5=_0x1108f3[_0x5dd2('0x49')]?util['format'](_0x5dd2('0xf6'),_0x1875bd['agentAlias'],_0x1108f3[_0x5dd2('0x49')]):_0x5dd2('0xf7');var _0x3a598c=_0x2f6749[_0x5dd2('0x39')]['customer']||util[_0x5dd2('0xf8')](_0x5dd2('0xf6'),_0x5dd2('0xf9'),_0x1108f3[_0x5dd2('0x79')]);switch(_0x1875bd['agentIdentifier']){case _0x5dd2('0xfa'):_0x4ef7b5=_0x1108f3[_0x5dd2('0x49')]?util[_0x5dd2('0xf8')](_0x5dd2('0xf6'),_0x1875bd[_0x5dd2('0xfb')],_0x1108f3[_0x5dd2('0x49')]):'System';break;case _0x5dd2('0xfc'):_0x4ef7b5=_0x1108f3[_0x5dd2('0x49')]?_0x1108f3[_0x5dd2('0xf3')][_0x5dd2('0xfd')]||_0x1108f3['User'][_0x5dd2('0x3e')]:_0x5dd2('0xf7');break;case'agent_fullname':_0x4ef7b5=_0x1108f3['UserId']?_0x1108f3['User']['fullname']:_0x5dd2('0xf7');break;default:_0x4ef7b5=_0x1108f3['UserId']?util[_0x5dd2('0xf8')](_0x5dd2('0xf6'),_0x1875bd[_0x5dd2('0xfb')],_0x1108f3[_0x5dd2('0x49')]):_0x5dd2('0xf7');}var _0xa24829=util['format'](_0x5dd2('0xfe'),moment(_0x1108f3[_0x5dd2('0x88')])[_0x5dd2('0xf8')](_0x5dd2('0xff')),_0x1108f3[_0x5dd2('0x100')]==='in'?_0x3a598c:_0x4ef7b5,_0x1108f3[_0x5dd2('0x39')]);if(!_0x1108f3[_0x5dd2('0x101')]){fs['appendFileSync'](_0x57bd4a,_0xa24829);}}return db[_0x5dd2('0x102')][_0x5dd2('0xc8')]({'where':{'service':!![]},'include':[{'model':db[_0x5dd2('0x103')],'as':_0x5dd2('0x104'),'raw':!![]}]});}}})[_0x5dd2('0x22')](function(_0x27a8bf){if(_0x27a8bf&&_0x27a8bf['Smtp']&&_0x2f6749['body']){var _0x13bf01={'tls':{'rejectUnauthorized':![]}};if(_0x27a8bf[_0x5dd2('0x104')][_0x5dd2('0x105')]){_0x13bf01[_0x5dd2('0x105')]=_0x27a8bf[_0x5dd2('0x104')][_0x5dd2('0x105')];}else{_0x13bf01[_0x5dd2('0x106')]=_0x27a8bf[_0x5dd2('0x104')][_0x5dd2('0x106')];_0x13bf01[_0x5dd2('0x107')]=_0x27a8bf[_0x5dd2('0x104')]['port'];_0x13bf01['secure']=_0x27a8bf['Smtp'][_0x5dd2('0x108')];}if(_0x27a8bf[_0x5dd2('0x104')][_0x5dd2('0x109')]){_0x13bf01['auth']={'user':_0x27a8bf[_0x5dd2('0x104')][_0x5dd2('0xa1')],'pass':_0x27a8bf[_0x5dd2('0x104')][_0x5dd2('0x10a')]};}return respondWithRpcPromise(_0x5dd2('0x10b'),_0x5dd2('0x10c'),{'account':_0x13bf01,'message':{'from':util[_0x5dd2('0xf8')](_0x5dd2('0x10d'),_0x27a8bf['name'],_0x27a8bf[_0x5dd2('0xce')]||_0x27a8bf[_0x5dd2('0x104')][_0x5dd2('0xa1')]),'to':_0x2f6749['body'][_0x5dd2('0x10e')],'subject':_0x5dd2('0x10f'),'text':util[_0x5dd2('0xf8')](_0x5dd2('0x110'),_0x2f6749[_0x5dd2('0x39')]['mailTranscript']),'attachments':[{'path':_0x57bd4a}]}})[_0x5dd2('0x22')](function(){return _0x3be791;})[_0x5dd2('0x2a')](function(_0x47b58b){console[_0x5dd2('0x27')](_0x47b58b);});}else{return _0x3be791;}})[_0x5dd2('0x22')](respondWithStatusCode(_0x4c5b2e,0xc8))['catch'](handleError(_0x4c5b2e,null));};exports[_0x5dd2('0x111')]=function(_0x24f937,_0x3c3403,_0x5da91c){return db[_0x5dd2('0xd6')][_0x5dd2('0x71')]({'where':{'id':_0x24f937[_0x5dd2('0xc2')]['id']}})[_0x5dd2('0x22')](handleEntityNotFound(_0x3c3403,null))[_0x5dd2('0x22')](function(_0x40afcc){if(_0x40afcc){return _0x40afcc[_0x5dd2('0x111')](_0x24f937[_0x5dd2('0x39')][_0x5dd2('0x112')],_[_0x5dd2('0x113')](_0x24f937[_0x5dd2('0x39')],[_0x5dd2('0x112'),'id'])||{});}})[_0x5dd2('0x22')](respondWithResult(_0x3c3403,null))[_0x5dd2('0x2a')](handleError(_0x3c3403,null));};exports[_0x5dd2('0x114')]=function(_0x2917a3,_0x12879a,_0x548792){var _0x52b1ec={'raw':![],'where':{}};var _0x2a7e97={};var _0x2ec2b3={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x5dd2('0xc8')]({'where':{'id':_0x2917a3[_0x5dd2('0xc2')]['id']}})[_0x5dd2('0x22')](handleEntityNotFound(_0x12879a,null))['then'](function(_0x49544c){if(_0x49544c){_0x2a7e97[_0x5dd2('0x50')]=_[_0x5dd2('0x52')](db[_0x5dd2('0xd6')]['rawAttributes']);_0x2a7e97[_0x5dd2('0x51')]=_[_0x5dd2('0x52')](_0x2917a3[_0x5dd2('0x51')]);_0x2a7e97[_0x5dd2('0x53')]=_['intersection'](_0x2a7e97['model'],_0x2a7e97['query']);_0x52b1ec[_0x5dd2('0x55')]=_['intersection'](_0x2a7e97['model'],qs[_0x5dd2('0x56')](_0x2917a3['query'][_0x5dd2('0x56')]));_0x52b1ec[_0x5dd2('0x55')]=_0x52b1ec[_0x5dd2('0x55')]['length']?_0x52b1ec[_0x5dd2('0x55')]:_0x2a7e97['model'];if(!_0x2917a3['query'][_0x5dd2('0x57')](_0x5dd2('0x58'))){_0x52b1ec[_0x5dd2('0x30')]=qs[_0x5dd2('0x30')](_0x2917a3[_0x5dd2('0x51')]['limit']);_0x52b1ec[_0x5dd2('0x2e')]=qs[_0x5dd2('0x2e')](_0x2917a3[_0x5dd2('0x51')][_0x5dd2('0x2e')]);}_0x52b1ec[_0x5dd2('0x59')]=qs[_0x5dd2('0x5a')](_0x2917a3[_0x5dd2('0x51')]['sort']);_0x52b1ec[_0x5dd2('0x85')]=qs['filters'](_[_0x5dd2('0x5b')](_0x2917a3['query'],_0x2a7e97[_0x5dd2('0x53')]));_0x52b1ec[_0x5dd2('0x85')][_0x5dd2('0xbd')]=_0x49544c['id'];if(_0x2917a3[_0x5dd2('0x51')][_0x5dd2('0x92')]){_0x52b1ec[_0x5dd2('0x85')]=_[_0x5dd2('0x38')](_0x52b1ec[_0x5dd2('0x85')],{'$or':_[_0x5dd2('0x3d')](_0x52b1ec['attributes'],function(_0x2b8efe){var _0x50bb6b={};_0x50bb6b[_0x2b8efe]={'$like':'%'+_0x2917a3[_0x5dd2('0x51')][_0x5dd2('0x92')]+'%'};return _0x50bb6b;})});}if(_0x2917a3[_0x5dd2('0x51')][_0x5dd2('0x8a')]){var _0x25d352=_0x2917a3[_0x5dd2('0x51')]['$gte'][_0x5dd2('0x41')](',');var _0xec3c15={};_0xec3c15[_0x25d352[0x0]]={'$gte':moment(_0x25d352[0x1])[_0x5dd2('0xf8')](_0x5dd2('0x115'))};_0x52b1ec[_0x5dd2('0x85')]=_[_0x5dd2('0x38')](_0x52b1ec[_0x5dd2('0x85')],_0xec3c15);}_0x52b1ec=_[_0x5dd2('0x38')]({},_0x52b1ec,_0x2917a3[_0x5dd2('0x116')]);return db[_0x5dd2('0xd6')][_0x5dd2('0x31')]({'where':_0x52b1ec[_0x5dd2('0x85')]})['then'](function(_0x590f8e){_0x2ec2b3[_0x5dd2('0x31')]=_0x590f8e;if(_0x2917a3[_0x5dd2('0x51')]['includeAll']){_0x52b1ec['include']=[{'all':!![]}];}return db[_0x5dd2('0xd6')]['findAll'](_0x52b1ec);})[_0x5dd2('0x22')](function(_0x440924){_0x2ec2b3[_0x5dd2('0xc0')]=_0x440924;return _0x2ec2b3;});}})['then'](respondWithFilteredResult(_0x12879a,_0x52b1ec))[_0x5dd2('0x2a')](handleError(_0x12879a,null));};exports[_0x5dd2('0x117')]=function(_0x3a3633,_0x12f6ec,_0x52c8b1){var _0x14914b={'where':{}},_0x5d6514={},_0x393065={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x5dd2('0xc8')]({'where':{'id':_0x3a3633[_0x5dd2('0xc2')]['id']}})[_0x5dd2('0x22')](handleEntityNotFound(_0x12f6ec,null))[_0x5dd2('0x22')](function(_0xf869b9){if(_0xf869b9){_0x5d6514['model']=_['keys'](db[_0x5dd2('0xd6')]['rawAttributes']);_0x5d6514['query']=_[_0x5dd2('0x52')](_0x3a3633[_0x5dd2('0x51')]);_0x5d6514[_0x5dd2('0x53')]=_[_0x5dd2('0x54')](_0x5d6514[_0x5dd2('0x50')],_0x5d6514['query']);_0x14914b[_0x5dd2('0x55')]=_[_0x5dd2('0x54')](_0x5d6514[_0x5dd2('0x50')],qs[_0x5dd2('0x56')](_0x3a3633[_0x5dd2('0x51')][_0x5dd2('0x56')]));_0x14914b[_0x5dd2('0x55')]=_0x14914b[_0x5dd2('0x55')]['length']?_0x14914b['attributes']:_0x5d6514[_0x5dd2('0x50')];if(!_0x3a3633['query'][_0x5dd2('0x57')](_0x5dd2('0x58'))){_0x14914b[_0x5dd2('0x30')]=qs['limit'](_0x3a3633[_0x5dd2('0x51')]['limit']);_0x14914b['offset']=qs[_0x5dd2('0x2e')](_0x3a3633[_0x5dd2('0x51')][_0x5dd2('0x2e')]);}_0x14914b['order']=qs[_0x5dd2('0x5a')](_0x3a3633[_0x5dd2('0x51')][_0x5dd2('0x5a')]);_0x14914b[_0x5dd2('0x85')]=qs[_0x5dd2('0x53')](_[_0x5dd2('0x5b')](_0x3a3633[_0x5dd2('0x51')],_0x5d6514[_0x5dd2('0x53')]));_0x14914b[_0x5dd2('0x85')][_0x5dd2('0xbd')]=_0xf869b9['id'];if(_0x3a3633[_0x5dd2('0x51')][_0x5dd2('0x92')]){_0x14914b[_0x5dd2('0x85')]=_[_0x5dd2('0x38')](_0x14914b['where'],{'$or':_[_0x5dd2('0x3d')](_0x14914b[_0x5dd2('0x55')],function(_0x46d372){var _0x5d4ff6={};_0x5d4ff6[_0x46d372]={'$like':'%'+_0x3a3633[_0x5dd2('0x51')][_0x5dd2('0x92')]+'%'};return _0x5d4ff6;})});}_0x14914b[_0x5dd2('0x85')]['secret']=![];if(_0x3a3633[_0x5dd2('0x51')]['id']){_0x14914b['where']['id']={'$gt':_0x3a3633[_0x5dd2('0x51')]['id']};}_0x14914b=_[_0x5dd2('0x38')]({},_0x14914b,_0x3a3633[_0x5dd2('0x116')]);return db[_0x5dd2('0xd6')][_0x5dd2('0x31')]({'where':_0x14914b['where']})[_0x5dd2('0x22')](function(_0x750e94){_0x393065[_0x5dd2('0x31')]=_0x750e94;_0x14914b[_0x5dd2('0xc4')]=[];if(_0x3a3633['query'][_0x5dd2('0x118')]){_0x14914b['include'][_0x5dd2('0xbe')]({'model':db['User'],'as':_0x5dd2('0xf3'),'attributes':['id',_0x5dd2('0x3e'),_0x5dd2('0xfd')]});}if(_0x3a3633['query'][_0x5dd2('0xc3')]){_0x14914b['include']=[{'all':!![]}];}return db[_0x5dd2('0xd6')][_0x5dd2('0x119')](_0x14914b);})[_0x5dd2('0x22')](function(_0x1d8ee4){_0x393065[_0x5dd2('0xc0')]=_0x1d8ee4;return _0x393065;});}})[_0x5dd2('0x22')](respondWithFilteredResult(_0x12f6ec,_0x14914b))['catch'](handleError(_0x12f6ec,null));};exports[_0x5dd2('0x11a')]=function(_0x2acb5d,_0x3c306c,_0x3c1864){return db[_0x5dd2('0x4c')][_0x5dd2('0x71')]({'where':{'id':_0x2acb5d[_0x5dd2('0xc2')]['id']}})[_0x5dd2('0x22')](handleEntityNotFound(_0x3c306c,null))[_0x5dd2('0x22')](function(_0x3520b9){if(_0x3520b9){return _0x3520b9[_0x5dd2('0x11b')](_0x2acb5d['body']['ids'],_[_0x5dd2('0x113')](_0x2acb5d[_0x5dd2('0x39')],[_0x5dd2('0x112'),'id'])||{})[_0x5dd2('0x11c')](function(){return db[_0x5dd2('0x7c')][_0x5dd2('0x119')]({'attributes':['id',_0x5dd2('0x36'),_0x5dd2('0x5e')],'where':{'id':_0x2acb5d[_0x5dd2('0x39')][_0x5dd2('0x112')]}});})[_0x5dd2('0x22')](function(_0x5e4a53){socket[_0x5dd2('0x11d')]('chatInteractionTags:save',{'id':Number(_0x2acb5d['params']['id']),'tags':_0x5e4a53||[]});return{'id':Number(_0x2acb5d['params']['id']),'tags':_0x5e4a53||[]};});}})['then'](respondWithResult(_0x3c306c,null))['catch'](handleError(_0x3c306c,null));};exports['removeTags']=function(_0x2c64b4,_0x563b70,_0x1f62d4){return db[_0x5dd2('0x4c')][_0x5dd2('0x71')]({'where':{'id':_0x2c64b4['params']['id']}})[_0x5dd2('0x22')](handleEntityNotFound(_0x563b70,null))[_0x5dd2('0x22')](function(_0x5bf732){if(_0x5bf732){return _0x5bf732[_0x5dd2('0x11e')](_0x2c64b4['query'][_0x5dd2('0x112')]);}})[_0x5dd2('0x22')](respondWithStatusCode(_0x563b70,null))[_0x5dd2('0x2a')](handleError(_0x563b70,null));};exports[_0x5dd2('0xee')]=function(_0x296593,_0x42ffe8){var _0x49a7fe=moment()[_0x5dd2('0x11f')]()[_0x5dd2('0xa7')]();var _0x3c80b1=path[_0x5dd2('0xea')](config[_0x5dd2('0xeb')],_0x5dd2('0x120'),_0x5dd2('0x121'),_0x5dd2('0x122'));var _0xde7b58=path[_0x5dd2('0xea')](config[_0x5dd2('0xeb')],_0x5dd2('0x120'),'files',_0x5dd2('0x123'));var _0x214f31=path['join'](_0x3c80b1,_0x49a7fe);var _0x5e3baa=util[_0x5dd2('0xf8')](_0x5dd2('0x124'),_0x296593[_0x5dd2('0xc2')]['id'],_0x49a7fe);var _0x329b77=path['join'](_0x3c80b1,_0x5e3baa);var _0x58149d=[];_0x58149d[_0x5dd2('0xbe')]({'model':db[_0x5dd2('0xf3')],'as':_0x5dd2('0xf3'),'attributes':['id',_0x5dd2('0x3e')],'raw':!![]});_0x58149d[_0x5dd2('0xbe')]({'model':db[_0x5dd2('0xf4')],'as':_0x5dd2('0x75'),'attributes':['id',_0x5dd2('0x125'),_0x5dd2('0x126')],'raw':!![]});if(_0x296593['query'][_0x5dd2('0x123')]){_0x58149d['push']({'model':db[_0x5dd2('0xe8')],'as':'Attachment','raw':!![]});}var _0x1b6456=[{'model':db[_0x5dd2('0xd6')],'as':_0x5dd2('0xf5'),'attributes':['id',_0x5dd2('0x39'),_0x5dd2('0x88'),_0x5dd2('0x100'),'secret','read'],'include':_0x58149d}];_0x1b6456[_0x5dd2('0xbe')]({'model':db[_0x5dd2('0xc9')],'as':'Account','attributes':['id',_0x5dd2('0x36')]});_0x1b6456[_0x5dd2('0xbe')]({'model':db[_0x5dd2('0xf3')],'as':_0x5dd2('0x127'),'attributes':['id',_0x5dd2('0x3e')]});return db[_0x5dd2('0x4c')][_0x5dd2('0x71')]({'where':{'id':_0x296593[_0x5dd2('0xc2')]['id']},'include':_0x1b6456})[_0x5dd2('0x22')](handleEntityNotFound(_0x42ffe8,null))[_0x5dd2('0x22')](function(_0x5dd43f){if(_0x5dd43f){var _0x3adb02=_0x5dd43f['get']({'plain':!![]});fs[_0x5dd2('0x128')](_0x214f31);var _0x5ee73d={'channel':_0x5dd2('0x129'),'account':_0x3adb02[_0x5dd2('0x12a')]['name'],'agent':_0x3adb02['Owner']?_0x3adb02['Owner'][_0x5dd2('0x3e')]:'N.A.','createdAt':moment(_0x3adb02['createdAt'])['format'](_0x5dd2('0x115'))[_0x5dd2('0xa7')](),'closedAt':_0x3adb02[_0x5dd2('0x48')]?moment(_0x3adb02[_0x5dd2('0x12b')])[_0x5dd2('0xf8')](_0x5dd2('0x115'))['toString']():'','disposition':_0x3adb02['disposition'],'chatInfo':{'browser':_0x3adb02[_0x5dd2('0x12c')],'os':_0x3adb02[_0x5dd2('0x12d')],'referer':_0x3adb02['referer'],'customerIp':_0x3adb02[_0x5dd2('0x12e')],'customerPort':_0x3adb02[_0x5dd2('0x12f')]?_0x3adb02['customerPort']:'N.A.'},'messages':_(_0x3adb02[_0x5dd2('0xf5')])[_0x5dd2('0x130')]()[_0x5dd2('0x92')]({'secret':![]})[_0x5dd2('0x3d')](function(_0x4ba4cd){if(_0x4ba4cd[_0x5dd2('0xe8')]){var _0x4d2d3f=path[_0x5dd2('0xea')](_0xde7b58,_0x4ba4cd[_0x5dd2('0xe8')]['basename']);if(fs[_0x5dd2('0x131')](_0x4d2d3f)){fs[_0x5dd2('0x132')](_0x4d2d3f)[_0x5dd2('0x133')](fs['createWriteStream'](path['join'](_0x214f31,_0x4ba4cd['Attachment']['basename'])));}}return{'date':moment(_0x4ba4cd[_0x5dd2('0x88')])[_0x5dd2('0xf8')]('YYYY-MM-DD\x20HH:mm:ss')[_0x5dd2('0xa7')](),'sender':_0x4ba4cd[_0x5dd2('0x100')]==='out'?_0x4ba4cd[_0x5dd2('0xf3')]?_0x4ba4cd[_0x5dd2('0xf3')]['fullname']:_0x5dd2('0xf7'):_0x4ba4cd[_0x5dd2('0x75')]['firstName']+(_0x4ba4cd[_0x5dd2('0x75')]['lastName']?'\x20'+_0x4ba4cd['Contact']['lastName']:''),'body':_0x4ba4cd[_0x5dd2('0xe8')]?_0x4ba4cd[_0x5dd2('0xe8')][_0x5dd2('0xe4')]:_0x4ba4cd[_0x5dd2('0x39')],'direction':_0x4ba4cd[_0x5dd2('0x100')]===_0x5dd2('0xd5')?'A':'C','secret':_0x4ba4cd[_0x5dd2('0x101')],'read':_0x4ba4cd[_0x5dd2('0x8f')],'attachment':_0x4ba4cd[_0x5dd2('0xe8')]};})[_0x5dd2('0x73')]()};return ejs[_0x5dd2('0x134')](path['join'](config[_0x5dd2('0xeb')],_0x5dd2('0x120'),'views',_0x5dd2('0x135')),{'interaction':_0x5ee73d})[_0x5dd2('0x22')](function(_0x442117){var _0x4b5a4d=path[_0x5dd2('0xea')](_0x214f31,_0x5dd2('0x136')+_0x3adb02['id']+'-'+_0x49a7fe+_0x5dd2('0x137'));var _0x4dc376={'path':_0x4b5a4d,'channel':_0x5dd2('0x129'),'interactionId':_0x3adb02['id']};return pdf[_0x5dd2('0x138')](_0x442117,_0x4dc376);})[_0x5dd2('0x22')](function(){return new BPromise(function(_0x2b011b,_0xcc8314){zipdir(_0x214f31,{'saveTo':_0x329b77},function(_0xadd498,_0x406d2a){if(_0xadd498)return _0xcc8314(_0xadd498);return _0x2b011b(_0x406d2a);});})[_0x5dd2('0x22')](function(){return new BPromise(function(_0x479e35,_0x2ae2de){rimraf(_0x214f31,function(_0x9ae52e){if(_0x9ae52e)_0x2ae2de(_0x9ae52e);return _0x479e35();});});})[_0x5dd2('0x22')](function(){return _0x42ffe8[_0x5dd2('0xee')](_0x329b77,_0x5e3baa,function(_0x2505a7){if(_0x2505a7){console[_0x5dd2('0x139')](_0x5dd2('0x13a'),_0x2505a7);}else{fs[_0x5dd2('0x13b')](_0x329b77);}});});});}else{return _0x42ffe8['sendStatus'](0xc8);}})[_0x5dd2('0x2a')](handleError(_0x42ffe8,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 927a395..ecacff4 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 _0x24b4=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','setMaxListeners','save','remove','map','then','setDataValue','emit','catch'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x24b4,0xb9));var _0x424b=function(_0x2f69f0,_0x143ea2){_0x2f69f0=_0x2f69f0-0x0;var _0x4317bd=_0x24b4[_0x2f69f0];return _0x4317bd;};'use strict';var EventEmitter=require(_0x424b('0x0'));var ChatInteraction=require(_0x424b('0x1'))['db'][_0x424b('0x2')];var ChatMessage=require(_0x424b('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x424b('0x3')](0x0);var events={'afterCreate':_0x424b('0x4'),'afterUpdate':'update','afterDestroy':_0x424b('0x5')};function emitEvent(_0x2c5503){return function(_0x2c9a1c,_0x15ed6d,_0xed75a5){_0x2c9a1c['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x32a1bc){_0x2c9a1c['setDataValue']('Users',_0x32a1bc[_0x424b('0x6')](function(_0x14ecc5){return{'id':_0x14ecc5['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x2c9a1c['id'],'direction':'in','read':![]},'raw':!![]});})[_0x424b('0x7')](function(_0x3b07ff){_0x2c9a1c[_0x424b('0x8')]('unreadMessages',_0x3b07ff['length']);ChatInteractionEvents[_0x424b('0x9')](_0x2c5503+':'+_0x2c9a1c['id'],_0x2c9a1c);ChatInteractionEvents['emit'](_0x2c5503,_0x2c9a1c);_0xed75a5(null);})[_0x424b('0xa')](_0xed75a5(null));};}for(var e in events){if(events[_0x424b('0xb')](e)){var event=events[e];ChatInteraction[_0x424b('0xc')](e,emitEvent(event));}}module[_0x424b('0xd')]=ChatInteractionEvents; \ No newline at end of file +var _0xffcd=['then','setDataValue','Users','map','findAll','unreadMessages','emit','hook','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','getUsers'];(function(_0x3cb004,_0x25d5d1){var _0x343ec2=function(_0xb9ac0e){while(--_0xb9ac0e){_0x3cb004['push'](_0x3cb004['shift']());}};_0x343ec2(++_0x25d5d1);}(_0xffcd,0x138));var _0xdffc=function(_0x1d0ad7,_0x440ad3){_0x1d0ad7=_0x1d0ad7-0x0;var _0x21425d=_0xffcd[_0x1d0ad7];return _0x21425d;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0xdffc('0x0'))['db'][_0xdffc('0x1')];var ChatMessage=require(_0xdffc('0x0'))['db'][_0xdffc('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xdffc('0x3')](0x0);var events={'afterCreate':_0xdffc('0x4'),'afterUpdate':_0xdffc('0x5'),'afterDestroy':_0xdffc('0x6')};function emitEvent(_0x5677e8){return function(_0x12ecd0,_0x44bef5,_0x18e814){_0x12ecd0[_0xdffc('0x7')]({'attributes':['id'],'raw':!![]})[_0xdffc('0x8')](function(_0x555665){_0x12ecd0[_0xdffc('0x9')](_0xdffc('0xa'),_0x555665[_0xdffc('0xb')](function(_0xa549c7){return{'id':_0xa549c7['id']};}));return ChatMessage[_0xdffc('0xc')]({'where':{'ChatInteractionId':_0x12ecd0['id'],'direction':'in','read':![]},'raw':!![]});})[_0xdffc('0x8')](function(_0x5c8347){_0x12ecd0['setDataValue'](_0xdffc('0xd'),_0x5c8347['length']);ChatInteractionEvents[_0xdffc('0xe')](_0x5677e8+':'+_0x12ecd0['id'],_0x12ecd0);ChatInteractionEvents[_0xdffc('0xe')](_0x5677e8,_0x12ecd0);_0x18e814(null);})['catch'](_0x18e814(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0xdffc('0xf')](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 8ea5e8b..735e34f 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 _0xa430=['request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','changed','closed','closedAt','format','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird'];(function(_0x41b626,_0x2e1659){var _0x4ec324=function(_0x7d48f6){while(--_0x7d48f6){_0x41b626['push'](_0x41b626['shift']());}};_0x4ec324(++_0x2e1659);}(_0xa430,0x1d6));var _0x0a43=function(_0x2a4c5f,_0x808752){_0x2a4c5f=_0x2a4c5f-0x0;var _0x508e16=_0xa430[_0x2a4c5f];return _0x508e16;};'use strict';var _=require(_0x0a43('0x0'));var util=require(_0x0a43('0x1'));var logger=require(_0x0a43('0x2'))('api');var moment=require(_0x0a43('0x3'));var BPromise=require(_0x0a43('0x4'));var rp=require(_0x0a43('0x5'));var fs=require('fs');var path=require(_0x0a43('0x6'));var rimraf=require(_0x0a43('0x7'));var config=require(_0x0a43('0x8'));var attributes=require(_0x0a43('0x9'));module[_0x0a43('0xa')]=function(_0x5147b3,_0x1aefd1){return _0x5147b3[_0x0a43('0xb')](_0x0a43('0xc'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x280f7a,_0x2cf8e0,_0x235f56){if(_0x280f7a[_0x0a43('0xd')](_0x0a43('0xe'))){_0x280f7a[_0x0a43('0xf')]=moment()[_0x0a43('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0x235f56(null,_0x280f7a);}},'charset':_0x0a43('0x11'),'collate':_0x0a43('0x12')});}; \ No newline at end of file +var _0x24ea=['rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x24ea,0x99));var _0xa24e=function(_0x341cbf,_0x52be4a){_0x341cbf=_0x341cbf-0x0;var _0x3ebf74=_0x24ea[_0x341cbf];return _0x3ebf74;};'use strict';var _=require(_0xa24e('0x0'));var util=require(_0xa24e('0x1'));var logger=require(_0xa24e('0x2'))(_0xa24e('0x3'));var moment=require(_0xa24e('0x4'));var BPromise=require(_0xa24e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa24e('0x6'));var rimraf=require(_0xa24e('0x7'));var config=require(_0xa24e('0x8'));var attributes=require(_0xa24e('0x9'));module[_0xa24e('0xa')]=function(_0x6f4b70,_0x9bfe6b){return _0x6f4b70[_0xa24e('0xb')](_0xa24e('0xc'),attributes,{'tableName':_0xa24e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x39392c,_0x74a671,_0x31f826){if(_0x39392c[_0xa24e('0xe')](_0xa24e('0xf'))){_0x39392c[_0xa24e('0x10')]=moment()[_0xa24e('0x11')]('YYYY-MM-DD\x20HH:mm:ss');}_0x31f826(null,_0x39392c);}},'charset':_0xa24e('0x12'),'collate':_0xa24e('0x13')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index f97505a..cff61d4 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 _0xd613=['message','info','result','UpdateChatInteraction','update','body','options','raw','where','attributes','limit','then','debug','stringify','catch','AddTagsToChatInteraction','ChatInteraction','addTags','omit','ids','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./chatInteraction.socket','ChatInteraction,\x20%s,\x20%s','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x4aba0e,_0x3cca89){var _0x240301=function(_0x376410){while(--_0x376410){_0x4aba0e['push'](_0x4aba0e['shift']());}};_0x240301(++_0x3cca89);}(_0xd613,0x112));var _0x3d61=function(_0x4dbbef,_0xd6961d){_0x4dbbef=_0x4dbbef-0x0;var _0x4e0602=_0xd613[_0x4dbbef];return _0x4e0602;};'use strict';var _=require(_0x3d61('0x0'));var util=require(_0x3d61('0x1'));var moment=require('moment');var BPromise=require(_0x3d61('0x2'));var rs=require(_0x3d61('0x3'));var fs=require('fs');var Redis=require(_0x3d61('0x4'));var db=require(_0x3d61('0x5'))['db'];var utils=require(_0x3d61('0x6'));var logger=require('../../config/logger')(_0x3d61('0x7'));var config=require(_0x3d61('0x8'));var jayson=require(_0x3d61('0x9'));var client=jayson[_0x3d61('0xa')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x3d61('0xb')],{'host':_0x3d61('0xc'),'port':0x18eb});var socket=require(_0x3d61('0xd'))(new Redis(config[_0x3d61('0xb')]));require(_0x3d61('0xe'))['register'](socket);function respondWithRpcPromise(_0x1bcf66,_0x490bb1,_0x4553e0){return new BPromise(function(_0x4de632,_0x54444a){return client['request'](_0x1bcf66,_0x4553e0)['then'](function(_0x3c2a7c){logger['info'](_0x3d61('0xf'),_0x490bb1,'request\x20sent');logger['debug'](_0x3d61('0x10'),_0x490bb1,_0x3d61('0x11'),JSON['stringify'](_0x3c2a7c));if(_0x3c2a7c[_0x3d61('0x12')]){if(_0x3c2a7c['error'][_0x3d61('0x13')]===0x1f4){logger[_0x3d61('0x12')](_0x3d61('0xf'),_0x490bb1,_0x3c2a7c['error']['message']);return _0x54444a(_0x3c2a7c[_0x3d61('0x12')][_0x3d61('0x14')]);}logger['error'](_0x3d61('0xf'),_0x490bb1,_0x3c2a7c[_0x3d61('0x12')][_0x3d61('0x14')]);return _0x4de632(_0x3c2a7c[_0x3d61('0x12')][_0x3d61('0x14')]);}else{logger[_0x3d61('0x15')](_0x3d61('0xf'),_0x490bb1,_0x3d61('0x11'));_0x4de632(_0x3c2a7c[_0x3d61('0x16')]['message']);}})['catch'](function(_0x5181cc){logger['error'](_0x3d61('0xf'),_0x490bb1,_0x5181cc);_0x54444a(_0x5181cc);});});}exports[_0x3d61('0x17')]=function(_0x5a641c){var _0x556e30=this;return new Promise(function(_0x1a536e,_0x227b74){return db['ChatInteraction'][_0x3d61('0x18')](_0x5a641c[_0x3d61('0x19')],{'raw':_0x5a641c[_0x3d61('0x1a')]?_0x5a641c[_0x3d61('0x1a')][_0x3d61('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a641c[_0x3d61('0x1a')]?_0x5a641c[_0x3d61('0x1a')][_0x3d61('0x1c')]||null:null,'attributes':_0x5a641c[_0x3d61('0x1a')]?_0x5a641c[_0x3d61('0x1a')][_0x3d61('0x1d')]||null:null,'limit':_0x5a641c[_0x3d61('0x1a')]?_0x5a641c['options'][_0x3d61('0x1e')]||null:null})[_0x3d61('0x1f')](function(_0x5a712e){logger[_0x3d61('0x15')]('UpdateChatInteraction',_0x5a641c);logger[_0x3d61('0x20')](_0x3d61('0x17'),_0x5a641c,JSON[_0x3d61('0x21')](_0x5a712e));_0x1a536e(_0x5a712e);})[_0x3d61('0x22')](function(_0x4abb4c){logger[_0x3d61('0x12')](_0x3d61('0x17'),_0x4abb4c[_0x3d61('0x14')],_0x5a641c);_0x227b74(_0x556e30['error'](0x1f4,_0x4abb4c[_0x3d61('0x14')]));});});};exports[_0x3d61('0x23')]=function(_0x43d9c6){return new Promise(function(_0x49060e,_0x4a4128){return db[_0x3d61('0x24')]['find']({'where':_0x43d9c6['options']?_0x43d9c6[_0x3d61('0x1a')][_0x3d61('0x1c')]||null:null})['then'](function(_0x4d7b8d){if(_0x4d7b8d){return _0x4d7b8d[_0x3d61('0x25')](_0x43d9c6[_0x3d61('0x19')]['ids'],_[_0x3d61('0x26')](_0x43d9c6[_0x3d61('0x19')],[_0x3d61('0x27'),'id'])||{});}})[_0x3d61('0x28')](function(_0x1593ea){logger['info']('AddTags',_0x43d9c6);logger[_0x3d61('0x20')](_0x3d61('0x29'),_0x43d9c6,JSON[_0x3d61('0x21')](_0x1593ea));_0x49060e(_0x1593ea);})[_0x3d61('0x22')](function(_0x107eaf){logger['error'](_0x3d61('0x29'),_0x107eaf[_0x3d61('0x14')],_0x43d9c6);_0x4a4128(_this[_0x3d61('0x12')](0x1f4,_0x107eaf[_0x3d61('0x14')]));});});}; \ No newline at end of file +var _0x1109=['request','info','ChatInteraction,\x20%s,\x20%s','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','body','options','raw','where','attributes','then','UpdateChatInteraction','debug','AddTagsToChatInteraction','ChatInteraction','addTags','ids','AddTags','lodash','util','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','socket.io-emitter','./chatInteraction.socket','register'];(function(_0x8276f3,_0x21ad5a){var _0x5330a8=function(_0x29c418){while(--_0x29c418){_0x8276f3['push'](_0x8276f3['shift']());}};_0x5330a8(++_0x21ad5a);}(_0x1109,0x140));var _0x9110=function(_0x424357,_0x9ebe3e){_0x424357=_0x424357-0x0;var _0x29c68e=_0x1109[_0x424357];return _0x29c68e;};'use strict';var _=require(_0x9110('0x0'));var util=require(_0x9110('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9110('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x9110('0x3'));var logger=require(_0x9110('0x4'))(_0x9110('0x5'));var config=require(_0x9110('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x9110('0x7')][_0x9110('0x8')]({'port':0x232a});config['redis']=_['defaults'](config[_0x9110('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x9110('0xa'))(new Redis(config[_0x9110('0x9')]));require(_0x9110('0xb'))[_0x9110('0xc')](socket);function respondWithRpcPromise(_0xeda9e2,_0x54ed1f,_0x229203){return new BPromise(function(_0x57925d,_0x4e53a7){return client[_0x9110('0xd')](_0xeda9e2,_0x229203)['then'](function(_0x1200ce){logger[_0x9110('0xe')](_0x9110('0xf'),_0x54ed1f,'request\x20sent');logger['debug'](_0x9110('0x10'),_0x54ed1f,'request\x20sent',JSON[_0x9110('0x11')](_0x1200ce));if(_0x1200ce['error']){if(_0x1200ce[_0x9110('0x12')][_0x9110('0x13')]===0x1f4){logger[_0x9110('0x12')](_0x9110('0xf'),_0x54ed1f,_0x1200ce[_0x9110('0x12')][_0x9110('0x14')]);return _0x4e53a7(_0x1200ce['error'][_0x9110('0x14')]);}logger[_0x9110('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x54ed1f,_0x1200ce[_0x9110('0x12')][_0x9110('0x14')]);return _0x57925d(_0x1200ce[_0x9110('0x12')][_0x9110('0x14')]);}else{logger[_0x9110('0xe')](_0x9110('0xf'),_0x54ed1f,_0x9110('0x15'));_0x57925d(_0x1200ce[_0x9110('0x16')][_0x9110('0x14')]);}})[_0x9110('0x17')](function(_0x356d1a){logger[_0x9110('0x12')](_0x9110('0xf'),_0x54ed1f,_0x356d1a);_0x4e53a7(_0x356d1a);});});}exports['UpdateChatInteraction']=function(_0x517551){var _0x992e95=this;return new Promise(function(_0x565247,_0x475449){return db['ChatInteraction']['update'](_0x517551[_0x9110('0x18')],{'raw':_0x517551['options']?_0x517551[_0x9110('0x19')][_0x9110('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x517551[_0x9110('0x19')]?_0x517551['options'][_0x9110('0x1b')]||null:null,'attributes':_0x517551['options']?_0x517551[_0x9110('0x19')][_0x9110('0x1c')]||null:null,'limit':_0x517551[_0x9110('0x19')]?_0x517551['options']['limit']||null:null})[_0x9110('0x1d')](function(_0x24476b){logger[_0x9110('0xe')](_0x9110('0x1e'),_0x517551);logger[_0x9110('0x1f')](_0x9110('0x1e'),_0x517551,JSON['stringify'](_0x24476b));_0x565247(_0x24476b);})[_0x9110('0x17')](function(_0x45376c){logger[_0x9110('0x12')](_0x9110('0x1e'),_0x45376c[_0x9110('0x14')],_0x517551);_0x475449(_0x992e95[_0x9110('0x12')](0x1f4,_0x45376c[_0x9110('0x14')]));});});};exports[_0x9110('0x20')]=function(_0x4fae06){return new Promise(function(_0x5f7adf,_0x1bb905){return db[_0x9110('0x21')]['find']({'where':_0x4fae06[_0x9110('0x19')]?_0x4fae06[_0x9110('0x19')]['where']||null:null})[_0x9110('0x1d')](function(_0x497f61){if(_0x497f61){return _0x497f61[_0x9110('0x22')](_0x4fae06['body']['ids'],_['omit'](_0x4fae06['body'],[_0x9110('0x23'),'id'])||{});}})['spread'](function(_0x5164c2){logger[_0x9110('0xe')](_0x9110('0x24'),_0x4fae06);logger[_0x9110('0x1f')](_0x9110('0x24'),_0x4fae06,JSON[_0x9110('0x11')](_0x5164c2));_0x5f7adf(_0x5164c2);})[_0x9110('0x17')](function(_0x5d99dd){logger[_0x9110('0x12')]('AddTags',_0x5d99dd[_0x9110('0x14')],_0x4fae06);_0x1bb905(_this[_0x9110('0x12')](0x1f4,_0x5d99dd[_0x9110('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index d740cbe..c329d26 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 _0xaf8f=['remove','update','emit','register'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0xaf8f,0x104));var _0xfaf8=function(_0x1e3dee,_0x28dcff){_0x1e3dee=_0x1e3dee-0x0;var _0x3a743d=_0xaf8f[_0x1e3dee];return _0x3a743d;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=['save',_0xfaf8('0x0'),_0xfaf8('0x1')];function createListener(_0x311104,_0x1badb5){return function(_0x3f8f4b){_0x1badb5[_0xfaf8('0x2')](_0x311104,_0x3f8f4b);};}function removeListener(_0x4af539,_0x53f296){return function(){ChatInteractionEvents['removeListener'](_0x4af539,_0x53f296);};}exports[_0xfaf8('0x3')]=function(_0x8afbc6){for(var _0x17e017=0x0,_0x55d36e=events['length'];_0x17e017<_0x55d36e;_0x17e017++){var _0x462705=events[_0x17e017];var _0x4ba245=createListener('chatInteraction:'+_0x462705,_0x8afbc6);ChatInteractionEvents['on'](_0x462705,_0x4ba245);}}; \ No newline at end of file +var _0x498a=['save','update','emit','register','./chatInteraction.events'];(function(_0x3b557a,_0x2decdc){var _0x53fdbb=function(_0x49b177){while(--_0x49b177){_0x3b557a['push'](_0x3b557a['shift']());}};_0x53fdbb(++_0x2decdc);}(_0x498a,0x1bc));var _0xa498=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x498a[_0x5b644e];return _0x49c6bf;};'use strict';var ChatInteractionEvents=require(_0xa498('0x0'));var events=[_0xa498('0x1'),'remove',_0xa498('0x2')];function createListener(_0x4e3bd6,_0x4c8a4c){return function(_0x3967e6){_0x4c8a4c[_0xa498('0x3')](_0x4e3bd6,_0x3967e6);};}function removeListener(_0x459775,_0x2adfef){return function(){ChatInteractionEvents['removeListener'](_0x459775,_0x2adfef);};}exports[_0xa498('0x4')]=function(_0x4a8acb){for(var _0x7d2d8b=0x0,_0x346d01=events['length'];_0x7d2d8b<_0x346d01;_0x7d2d8b++){var _0xe38dd=events[_0x7d2d8b];var _0x703b=createListener('chatInteraction:'+_0xe38dd,_0x4a8acb);ChatInteractionEvents['on'](_0xe38dd,_0x703b);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 100e498..9dacbfa 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 _0xe4e3=['fs-extra','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','now','originalname','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','chat','chatinteraction:addtags','addTags','put','tracked','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x1d3a5a,_0x21277d){var _0x2632e4=function(_0x48658e){while(--_0x48658e){_0x1d3a5a['push'](_0x1d3a5a['shift']());}};_0x2632e4(++_0x21277d);}(_0xe4e3,0x6e));var _0x3e4e=function(_0x19ff08,_0x595454){_0x19ff08=_0x19ff08-0x0;var _0x1a0f1c=_0xe4e3[_0x19ff08];return _0x1a0f1c;};'use strict';var multer=require(_0x3e4e('0x0'));var util=require(_0x3e4e('0x1'));var path=require(_0x3e4e('0x2'));var timeout=require(_0x3e4e('0x3'));var express=require(_0x3e4e('0x4'));var router=express[_0x3e4e('0x5')]();var fs_extra=require(_0x3e4e('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3e4e('0x7'));var config=require(_0x3e4e('0x8'));var controller=require(_0x3e4e('0x9'));router[_0x3e4e('0xa')]('/',auth['isAuthenticated'](),controller[_0x3e4e('0xb')]);router[_0x3e4e('0xa')](_0x3e4e('0xc'),auth[_0x3e4e('0xd')](),controller[_0x3e4e('0xe')]);router[_0x3e4e('0xa')](_0x3e4e('0xf'),auth['isChatInteractionAuthorized'](),controller[_0x3e4e('0x10')]);router['get'](_0x3e4e('0x11'),auth[_0x3e4e('0x12')](),controller[_0x3e4e('0x13')]);router[_0x3e4e('0xa')](_0x3e4e('0x14'),auth[_0x3e4e('0xd')](),controller[_0x3e4e('0x15')]);router[_0x3e4e('0xa')]('/:id/my_messages',auth[_0x3e4e('0x12')](),controller[_0x3e4e('0x16')]);router[_0x3e4e('0xa')](_0x3e4e('0x17'),auth[_0x3e4e('0xd')](),controller[_0x3e4e('0x18')]);router[_0x3e4e('0x19')]('/',auth[_0x3e4e('0xd')](),controller[_0x3e4e('0x1a')]);router['post'](_0x3e4e('0x1b'),auth[_0x3e4e('0xd')](),controller[_0x3e4e('0x1c')]);var upload=multer({'storage':multer[_0x3e4e('0x1d')]({'destination':function(_0xd8c6ce,_0x2c9b59,_0x34e22e){_0x34e22e(null,path[_0x3e4e('0x1e')](config[_0x3e4e('0x1f')],_0x3e4e('0x20')));},'filename':function(_0x546ba9,_0x469aa5,_0x2615f8){_0x2615f8(null,util[_0x3e4e('0x21')]('%s-%s',Date[_0x3e4e('0x22')](),_0x469aa5[_0x3e4e('0x23')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x3e4e('0x19')](_0x3e4e('0x24'),upload[_0x3e4e('0x25')](_0x3e4e('0x26')),controller[_0x3e4e('0x27')]);router[_0x3e4e('0x19')](_0x3e4e('0x14'),auth[_0x3e4e('0x12')](),controller[_0x3e4e('0x28')]);router[_0x3e4e('0x19')](_0x3e4e('0x29'),auth[_0x3e4e('0xd')](),interaction['tracked'](_0x3e4e('0x2a'),_0x3e4e('0x2b')),controller[_0x3e4e('0x2c')]);router[_0x3e4e('0x2d')]('/:id',auth[_0x3e4e('0xd')](),interaction[_0x3e4e('0x2e')](_0x3e4e('0x2a'),'chatinteraction:update'),controller[_0x3e4e('0x2f')]);router[_0x3e4e('0x2d')](_0x3e4e('0x30'),controller[_0x3e4e('0x31')]);router[_0x3e4e('0x2d')](_0x3e4e('0x32'),auth[_0x3e4e('0x12')](),controller[_0x3e4e('0x33')]);router[_0x3e4e('0x2d')](_0x3e4e('0x34'),controller['close']);router[_0x3e4e('0x35')](_0x3e4e('0xf'),auth['isAuthenticated'](),interaction[_0x3e4e('0x2e')](_0x3e4e('0x2a'),_0x3e4e('0x36')),controller[_0x3e4e('0x37')]);router[_0x3e4e('0x35')](_0x3e4e('0x29'),auth[_0x3e4e('0xd')](),controller[_0x3e4e('0x38')]);module[_0x3e4e('0x39')]=router; \ No newline at end of file +var _0xc815=['file','attachmentUpload','tracked','chat','chatinteraction:addtags','put','chatinteraction:update','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','/:id/messages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','/:id/attachment_upload','single'];(function(_0x360f8e,_0x1c2b20){var _0x23589e=function(_0x2c0a71){while(--_0x2c0a71){_0x360f8e['push'](_0x360f8e['shift']());}};_0x23589e(++_0x1c2b20);}(_0xc815,0x1a7));var _0x5c81=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0xc815[_0x36884e];return _0x1cc367;};'use strict';var multer=require(_0x5c81('0x0'));var util=require(_0x5c81('0x1'));var path=require('path');var timeout=require(_0x5c81('0x2'));var express=require(_0x5c81('0x3'));var router=express[_0x5c81('0x4')]();var fs_extra=require(_0x5c81('0x5'));var auth=require(_0x5c81('0x6'));var interaction=require(_0x5c81('0x7'));var config=require(_0x5c81('0x8'));var controller=require(_0x5c81('0x9'));router[_0x5c81('0xa')]('/',auth[_0x5c81('0xb')](),controller['index']);router['get'](_0x5c81('0xc'),auth[_0x5c81('0xb')](),controller[_0x5c81('0xd')]);router['get'](_0x5c81('0xe'),auth[_0x5c81('0xf')](),controller[_0x5c81('0x10')]);router[_0x5c81('0xa')](_0x5c81('0x11'),auth[_0x5c81('0xf')](),controller['attachmentDownload']);router[_0x5c81('0xa')](_0x5c81('0x12'),auth[_0x5c81('0xb')](),controller['getMessages']);router[_0x5c81('0xa')](_0x5c81('0x13'),auth[_0x5c81('0xf')](),controller[_0x5c81('0x14')]);router[_0x5c81('0xa')](_0x5c81('0x15'),auth[_0x5c81('0xb')](),controller[_0x5c81('0x16')]);router[_0x5c81('0x17')]('/',auth[_0x5c81('0xb')](),controller[_0x5c81('0x18')]);router[_0x5c81('0x17')](_0x5c81('0x19'),auth[_0x5c81('0xb')](),controller[_0x5c81('0x1a')]);var upload=multer({'storage':multer[_0x5c81('0x1b')]({'destination':function(_0x4355fd,_0x228247,_0xc8dfdb){_0xc8dfdb(null,path[_0x5c81('0x1c')](config[_0x5c81('0x1d')],_0x5c81('0x1e')));},'filename':function(_0x3c0242,_0x583391,_0x4baafc){_0x4baafc(null,util[_0x5c81('0x1f')](_0x5c81('0x20'),Date[_0x5c81('0x21')](),_0x583391['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5c81('0x17')](_0x5c81('0x22'),upload[_0x5c81('0x23')](_0x5c81('0x24')),controller[_0x5c81('0x25')]);router['post'](_0x5c81('0x12'),auth[_0x5c81('0xf')](),controller['addMessage']);router[_0x5c81('0x17')]('/:id/tags',auth[_0x5c81('0xb')](),interaction[_0x5c81('0x26')](_0x5c81('0x27'),_0x5c81('0x28')),controller['addTags']);router[_0x5c81('0x29')](_0x5c81('0xe'),auth[_0x5c81('0xb')](),interaction['tracked'](_0x5c81('0x27'),_0x5c81('0x2a')),controller['update']);router[_0x5c81('0x29')]('/:id/custom_update',controller['customUpdate']);router[_0x5c81('0x29')](_0x5c81('0x2b'),auth[_0x5c81('0xf')](),controller[_0x5c81('0x2c')]);router['put'](_0x5c81('0x2d'),controller[_0x5c81('0x2e')]);router[_0x5c81('0x2f')](_0x5c81('0xe'),auth['isAuthenticated'](),interaction['tracked'](_0x5c81('0x27'),_0x5c81('0x30')),controller[_0x5c81('0x31')]);router[_0x5c81('0x2f')]('/:id/tags',auth['isAuthenticated'](),controller[_0x5c81('0x32')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index db90d85..36769ac 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 _0x5c48=['sequelize','exports','TEXT','BOOLEAN','INTEGER'];(function(_0x286bfb,_0x46ac3c){var _0x52b683=function(_0x3e7fb1){while(--_0x3e7fb1){_0x286bfb['push'](_0x286bfb['shift']());}};_0x52b683(++_0x46ac3c);}(_0x5c48,0x82));var _0x85c4=function(_0x4d0c8a,_0x8cccb5){_0x4d0c8a=_0x4d0c8a-0x0;var _0x3e756d=_0x5c48[_0x4d0c8a];return _0x3e756d;};'use strict';var Sequelize=require(_0x85c4('0x0'));module[_0x85c4('0x1')]={'body':{'type':Sequelize[_0x85c4('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x85c4('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x85c4('0x4')]}}; \ No newline at end of file +var _0x6f59=['TEXT','sequelize','exports'];(function(_0x392c8d,_0x4f947a){var _0x53adda=function(_0x1a55fa){while(--_0x1a55fa){_0x392c8d['push'](_0x392c8d['shift']());}};_0x53adda(++_0x4f947a);}(_0x6f59,0x145));var _0x96f5=function(_0x16585a,_0x5b0829){_0x16585a=_0x16585a-0x0;var _0x447482=_0x6f59[_0x16585a];return _0x447482;};'use strict';var Sequelize=require(_0x96f5('0x0'));module[_0x96f5('0x1')]={'body':{'type':Sequelize[_0x96f5('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'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 48e02e3..b0f7d01 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 _0xbe35=['describe','get','messages','lastMessageAt','createdAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','sort','-online','VoiceQueues','type','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','findAll','isEmpty','resourceId','push','ToId','read','all','request-promise','moment','bluebird','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','stack','name','send','index','map','ChatInternalMessage','rawAttributes','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filters','filter','merge','VIRTUAL','options','include','rows','catch','show','includeAll','find','create','body','destroy'];(function(_0x390fef,_0x420500){var _0x5ebfe8=function(_0x3237b6){while(--_0x3237b6){_0x390fef['push'](_0x390fef['shift']());}};_0x5ebfe8(++_0x420500);}(_0xbe35,0xf1));var _0x5be3=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0xbe35[_0x5cb1af];return _0x8d7940;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5be3('0x0'));var moment=require(_0x5be3('0x1'));var BPromise=require(_0x5be3('0x2'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5be3('0x3'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5be3('0x4'));var squel=require('squel');var crypto=require(_0x5be3('0x5'));var jsforce=require(_0x5be3('0x6'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5be3('0x7'));var Papa=require(_0x5be3('0x8'));var Redis=require(_0x5be3('0x9'));var authService=require(_0x5be3('0xa'));var qs=require('../../components/parsers/qs');var as=require(_0x5be3('0xb'));var hardwareService=require(_0x5be3('0xc'));var logger=require('../../config/logger')(_0x5be3('0xd'));var utils=require(_0x5be3('0xe'));var config=require(_0x5be3('0xf'));var licenseUtil=require(_0x5be3('0x10'));var db=require(_0x5be3('0x11'))['db'];config[_0x5be3('0x12')]=_['defaults'](config[_0x5be3('0x12')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5be3('0x12')]));require(_0x5be3('0x13'))[_0x5be3('0x14')](socket);function respondWithStatusCode(_0x238f7b,_0x58f164){_0x58f164=_0x58f164||0xcc;return function(_0x17576e){if(_0x17576e){return _0x238f7b[_0x5be3('0x15')](_0x58f164);}return _0x238f7b[_0x5be3('0x16')](_0x58f164)[_0x5be3('0x17')]();};}function respondWithResult(_0x28cf2e,_0x3f123a){_0x3f123a=_0x3f123a||0xc8;return function(_0x40ced0){if(_0x40ced0){return _0x28cf2e[_0x5be3('0x16')](_0x3f123a)[_0x5be3('0x18')](_0x40ced0);}};}function respondWithFilteredResult(_0x33d397,_0x4985bb){return function(_0x376156){if(_0x376156){var _0x1d1522=typeof _0x4985bb[_0x5be3('0x19')]===_0x5be3('0x1a')&&typeof _0x4985bb[_0x5be3('0x1b')]==='undefined';var _0xfbf28e=_0x376156[_0x5be3('0x1c')];var _0x2d67a2=_0x1d1522?0x0:_0x4985bb[_0x5be3('0x19')];var _0x56fa76=_0x1d1522?_0x376156['count']:_0x4985bb['offset']+_0x4985bb[_0x5be3('0x1b')];var _0x548eff;if(_0x56fa76>=_0xfbf28e){_0x56fa76=_0xfbf28e;_0x548eff=0xc8;}else{_0x548eff=0xce;}_0x33d397[_0x5be3('0x16')](_0x548eff);return _0x33d397[_0x5be3('0x1d')]('Content-Range',_0x2d67a2+'-'+_0x56fa76+'/'+_0xfbf28e)[_0x5be3('0x18')](_0x376156);}return null;};}function patchUpdates(_0x55fb74){return function(_0x55c82a){try{jsonpatch[_0x5be3('0x1e')](_0x55c82a,_0x55fb74,!![]);}catch(_0xa1a9c6){return BPromise[_0x5be3('0x1f')](_0xa1a9c6);}return _0x55c82a[_0x5be3('0x20')]();};}function saveUpdates(_0x335940,_0x337a3f){return function(_0x141823){if(_0x141823){return _0x141823[_0x5be3('0x21')](_0x335940)[_0x5be3('0x22')](function(_0x4d70bb){return _0x4d70bb;});}return null;};}function removeEntity(_0x2a6085,_0x18f485){return function(_0x5e2124){if(_0x5e2124){return _0x5e2124['destroy']()[_0x5be3('0x22')](function(){_0x2a6085[_0x5be3('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x493064,_0x31e68c){return function(_0x5eda45){if(!_0x5eda45){_0x493064[_0x5be3('0x15')](0x194);}return _0x5eda45;};}function handleError(_0x598b63,_0x1ce540){_0x1ce540=_0x1ce540||0x1f4;return function(_0x4c061f){logger['error'](_0x4c061f[_0x5be3('0x23')]);if(_0x4c061f[_0x5be3('0x24')]){delete _0x4c061f[_0x5be3('0x24')];}_0x598b63['status'](_0x1ce540)[_0x5be3('0x25')](_0x4c061f);};}exports[_0x5be3('0x26')]=function(_0x171d85,_0x4bf6bf){var _0x3fe359={},_0x16fecb={},_0x359231={'count':0x0,'rows':[]};var _0x559663=_[_0x5be3('0x27')](db[_0x5be3('0x28')][_0x5be3('0x29')],function(_0x49d007){return{'name':_0x49d007['fieldName'],'type':_0x49d007['type']['key']};});_0x16fecb[_0x5be3('0x2a')]=_['map'](_0x559663,_0x5be3('0x24'));_0x16fecb[_0x5be3('0x2b')]=_[_0x5be3('0x2c')](_0x171d85[_0x5be3('0x2b')]);_0x16fecb['filters']=_[_0x5be3('0x2d')](_0x16fecb[_0x5be3('0x2a')],_0x16fecb[_0x5be3('0x2b')]);_0x3fe359[_0x5be3('0x2e')]=_[_0x5be3('0x2d')](_0x16fecb['model'],qs['fields'](_0x171d85[_0x5be3('0x2b')][_0x5be3('0x2f')]));_0x3fe359[_0x5be3('0x2e')]=_0x3fe359['attributes'][_0x5be3('0x30')]?_0x3fe359[_0x5be3('0x2e')]:_0x16fecb[_0x5be3('0x2a')];if(!_0x171d85[_0x5be3('0x2b')][_0x5be3('0x31')](_0x5be3('0x32'))){_0x3fe359[_0x5be3('0x1b')]=qs[_0x5be3('0x1b')](_0x171d85['query'][_0x5be3('0x1b')]);_0x3fe359[_0x5be3('0x19')]=qs[_0x5be3('0x19')](_0x171d85[_0x5be3('0x2b')][_0x5be3('0x19')]);}_0x3fe359[_0x5be3('0x33')]=qs['sort'](_0x171d85[_0x5be3('0x2b')]['sort']);_0x3fe359[_0x5be3('0x34')]=qs['filters'](_[_0x5be3('0x35')](_0x171d85[_0x5be3('0x2b')],_0x16fecb[_0x5be3('0x36')]),_0x559663);if(_0x171d85[_0x5be3('0x2b')][_0x5be3('0x37')]){_0x3fe359[_0x5be3('0x34')]=_[_0x5be3('0x38')](_0x3fe359[_0x5be3('0x34')],{'$or':_[_0x5be3('0x27')](_0x559663,function(_0x2422f7){if(_0x2422f7['type']!==_0x5be3('0x39')){var _0x2d4b6c={};_0x2d4b6c[_0x2422f7[_0x5be3('0x24')]]={'$like':'%'+_0x171d85[_0x5be3('0x2b')][_0x5be3('0x37')]+'%'};return _0x2d4b6c;}})});}_0x3fe359=_[_0x5be3('0x38')]({},_0x3fe359,_0x171d85[_0x5be3('0x3a')]);var _0xa34a77={'where':_0x3fe359[_0x5be3('0x34')]};return db[_0x5be3('0x28')]['count'](_0xa34a77)[_0x5be3('0x22')](function(_0x56f9b6){_0x359231['count']=_0x56f9b6;if(_0x171d85[_0x5be3('0x2b')]['includeAll']){_0x3fe359[_0x5be3('0x3b')]=[{'all':!![]}];}return db['ChatInternalMessage']['findAll'](_0x3fe359);})[_0x5be3('0x22')](function(_0x55438c){_0x359231[_0x5be3('0x3c')]=_0x55438c;return _0x359231;})[_0x5be3('0x22')](respondWithFilteredResult(_0x4bf6bf,_0x3fe359))[_0x5be3('0x3d')](handleError(_0x4bf6bf,null));};exports[_0x5be3('0x3e')]=function(_0x110fab,_0x357a7a){var _0x3e0db0={'raw':!![],'where':{'id':_0x110fab['params']['id']}},_0x21368a={};_0x21368a['model']=_['keys'](db['ChatInternalMessage'][_0x5be3('0x29')]);_0x21368a['query']=_['keys'](_0x110fab[_0x5be3('0x2b')]);_0x21368a[_0x5be3('0x36')]=_[_0x5be3('0x2d')](_0x21368a[_0x5be3('0x2a')],_0x21368a[_0x5be3('0x2b')]);_0x3e0db0['attributes']=_[_0x5be3('0x2d')](_0x21368a[_0x5be3('0x2a')],qs['fields'](_0x110fab[_0x5be3('0x2b')][_0x5be3('0x2f')]));_0x3e0db0[_0x5be3('0x2e')]=_0x3e0db0[_0x5be3('0x2e')][_0x5be3('0x30')]?_0x3e0db0[_0x5be3('0x2e')]:_0x21368a[_0x5be3('0x2a')];if(_0x110fab['query'][_0x5be3('0x3f')]){_0x3e0db0[_0x5be3('0x3b')]=[{'all':!![]}];}_0x3e0db0=_[_0x5be3('0x38')]({},_0x3e0db0,_0x110fab[_0x5be3('0x3a')]);return db['ChatInternalMessage'][_0x5be3('0x40')](_0x3e0db0)[_0x5be3('0x22')](handleEntityNotFound(_0x357a7a,null))['then'](respondWithResult(_0x357a7a,null))[_0x5be3('0x3d')](handleError(_0x357a7a,null));};exports['create']=function(_0x2ddf76,_0x144649){return db[_0x5be3('0x28')][_0x5be3('0x41')](_0x2ddf76[_0x5be3('0x42')],{})['then'](respondWithResult(_0x144649,0xc9))[_0x5be3('0x3d')](handleError(_0x144649,null));};exports[_0x5be3('0x21')]=function(_0x51ee01,_0x1b9e1b){if(_0x51ee01[_0x5be3('0x42')]['id']){delete _0x51ee01[_0x5be3('0x42')]['id'];}return db[_0x5be3('0x28')][_0x5be3('0x40')]({'where':{'id':_0x51ee01['params']['id']}})[_0x5be3('0x22')](handleEntityNotFound(_0x1b9e1b,null))[_0x5be3('0x22')](saveUpdates(_0x51ee01[_0x5be3('0x42')],null))[_0x5be3('0x22')](respondWithResult(_0x1b9e1b,null))[_0x5be3('0x3d')](handleError(_0x1b9e1b,null));};exports[_0x5be3('0x43')]=function(_0xcd73c9,_0x1bc429){return db[_0x5be3('0x28')]['find']({'where':{'id':_0xcd73c9['params']['id']}})[_0x5be3('0x22')](handleEntityNotFound(_0x1bc429,null))[_0x5be3('0x22')](removeEntity(_0x1bc429,null))['catch'](handleError(_0x1bc429,null));};exports['describe']=function(_0x3c0162,_0x2711fa){return db[_0x5be3('0x28')][_0x5be3('0x44')]()[_0x5be3('0x22')](respondWithResult(_0x2711fa,null))['catch'](handleError(_0x2711fa,null));};function wrapUser(_0xb841f){return function(_0x5d9773){var _0x509d65=_0xb841f[_0x5be3('0x45')]({'plain':!![]});_0x509d65[_0x5be3('0x46')]=[];if(_0x5d9773){_0x509d65[_0x5be3('0x47')]=_0x5d9773[_0x5be3('0x48')];_0x509d65[_0x5be3('0x49')]=_0x5d9773;}else{_0x509d65[_0x5be3('0x47')]=moment(0x0)['format'](_0x5be3('0x4a'));_0x509d65[_0x5be3('0x49')]={};}return _0x509d65;};}exports[_0x5be3('0x4b')]=function(_0xbee6c2,_0x52a8f9,_0x29618e){var _0x371930=[];return db[_0x5be3('0x4c')]['findAll']({'where':{'role':[_0x5be3('0x4d'),_0x5be3('0x4e'),_0x5be3('0x4f')]},'attributes':['id',_0x5be3('0x50'),_0x5be3('0x24'),_0x5be3('0x51'),_0x5be3('0x52'),_0x5be3('0x53'),_0x5be3('0x54'),_0x5be3('0x55'),_0x5be3('0x56'),'showWebBar'],'order':qs[_0x5be3('0x57')](_0x5be3('0x58')),'include':[{'model':db['VoiceQueue'],'as':_0x5be3('0x59'),'attributes':['id',_0x5be3('0x24'),_0x5be3('0x5a')],'through':{'attributes':[]}}]})[_0x5be3('0x22')](function(_0xbc2156){if(_0xbc2156){var _0x1d814e=_0xbee6c2[_0x5be3('0x4f')]['get']({'plain':!![]});if(!_0x1d814e)throw new Error(_0x5be3('0x5b'));if(_0x1d814e['role']===_0x5be3('0x4f')){return db[_0x5be3('0x5c')][_0x5be3('0x40')]({'where':{'name':'Agents','userProfileId':_0x1d814e[_0x5be3('0x5d')]},'raw':!![]})[_0x5be3('0x22')](function(_0x1fd16a){if(_0x1fd16a){if(_0x1fd16a[_0x5be3('0x5e')]===0x0){return db[_0x5be3('0x5f')][_0x5be3('0x60')]({'where':{'sectionId':_0x1fd16a['id']},'raw':!![]})[_0x5be3('0x22')](function(_0x392b93){var _0x1e266f=[];if(_[_0x5be3('0x61')](_0x392b93)){_0x1e266f=_['filter'](_0xbc2156,function(_0x1dd5e9){if(_0x1dd5e9[_0x5be3('0x51')]!==_0x5be3('0x4d')){return _0x1dd5e9;}});return _0x1e266f;}else{for(var _0x26d664=0x0;_0x26d664<_0xbc2156[_0x5be3('0x30')];_0x26d664++){var _0x17c6e1=_0xbc2156[_0x26d664];if(_0x17c6e1[_0x5be3('0x51')]===_0x5be3('0x4d')){var _0x479e47=_[_0x5be3('0x40')](_0x392b93,function(_0x36f4c6){return _0x36f4c6[_0x5be3('0x62')]===_0x17c6e1['id'];});if(_0x479e47)_0x1e266f['push'](_0x17c6e1);}else{_0x1e266f[_0x5be3('0x63')](_0x17c6e1);}}return _0x1e266f;}});}else{return _0xbc2156;}}else{var _0x54f05e=_['filter'](_0xbc2156,function(_0x3e2c77){if(_0x3e2c77[_0x5be3('0x51')]!=='agent'){return _0x3e2c77;}});return _0x54f05e;}});}else{return _0xbc2156;}}})[_0x5be3('0x22')](function(_0x28c236){var _0x2aa5dc=[];if(_0x28c236){_0x371930=_0x28c236;for(var _0x5bb945=0x0;_0x5bb945<_0x28c236[_0x5be3('0x30')];_0x5bb945+=0x1){_0x371930[_0x5bb945][_0x5be3('0x46')]=[];_0x2aa5dc[_0x5be3('0x63')](db[_0x5be3('0x28')][_0x5be3('0x40')]({'where':{'FromId':[_0xbee6c2[_0x5be3('0x4f')]['id'],_0x28c236[_0x5bb945]['id']],'ToId':[_0xbee6c2['user']['id'],_0x28c236[_0x5bb945]['id']],'ChatGroupId':null},'attributes':['id',_0x5be3('0x48'),'FromId',_0x5be3('0x64'),_0x5be3('0x65'),'body'],'order':qs[_0x5be3('0x57')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x28c236[_0x5bb945])));}return BPromise[_0x5be3('0x66')](_0x2aa5dc);}return[];})['then'](function(_0x4e2ac1){return{'rows':_0x4e2ac1,'count':_0x4e2ac1[_0x5be3('0x30')]};})[_0x5be3('0x22')](respondWithResult(_0x52a8f9,null))[_0x5be3('0x3d')](handleError(_0x52a8f9,null));}; \ No newline at end of file +var _0x0ccd=['get','messages','lastMessageAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','admin','user','fullname','role','userpic','online','showWebBar','-online','VoiceQueue','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','agent','resourceId','push','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','ChatInternalMessage','includeAll','findAll','show','keys','include','options','find','catch','create','body','params','describe'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x0ccd,0x90));var _0xd0cc=function(_0x5bff9e,_0x39ea3a){_0x5bff9e=_0x5bff9e-0x0;var _0x7f42ef=_0x0ccd[_0x5bff9e];return _0x7f42ef;};'use strict';var emlformat=require(_0xd0cc('0x0'));var rimraf=require(_0xd0cc('0x1'));var zipdir=require(_0xd0cc('0x2'));var jsonpatch=require(_0xd0cc('0x3'));var rp=require(_0xd0cc('0x4'));var moment=require(_0xd0cc('0x5'));var BPromise=require(_0xd0cc('0x6'));var Mustache=require(_0xd0cc('0x7'));var util=require(_0xd0cc('0x8'));var path=require(_0xd0cc('0x9'));var sox=require(_0xd0cc('0xa'));var csv=require(_0xd0cc('0xb'));var ejs=require(_0xd0cc('0xc'));var fs=require('fs');var fs_extra=require(_0xd0cc('0xd'));var _=require(_0xd0cc('0xe'));var squel=require(_0xd0cc('0xf'));var crypto=require(_0xd0cc('0x10'));var jsforce=require(_0xd0cc('0x11'));var deskjs=require('desk.js');var toCsv=require(_0xd0cc('0xb'));var querystring=require(_0xd0cc('0x12'));var Papa=require(_0xd0cc('0x13'));var Redis=require(_0xd0cc('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xd0cc('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd0cc('0x16'));var logger=require(_0xd0cc('0x17'))(_0xd0cc('0x18'));var utils=require(_0xd0cc('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0xd0cc('0x1a')](config[_0xd0cc('0x1b')],{'host':_0xd0cc('0x1c'),'port':0x18eb});var socket=require(_0xd0cc('0x1d'))(new Redis(config[_0xd0cc('0x1b')]));require(_0xd0cc('0x1e'))[_0xd0cc('0x1f')](socket);function respondWithStatusCode(_0x289d8c,_0x222a66){_0x222a66=_0x222a66||0xcc;return function(_0x277c0d){if(_0x277c0d){return _0x289d8c[_0xd0cc('0x20')](_0x222a66);}return _0x289d8c[_0xd0cc('0x21')](_0x222a66)[_0xd0cc('0x22')]();};}function respondWithResult(_0x39f14c,_0x377284){_0x377284=_0x377284||0xc8;return function(_0x496c32){if(_0x496c32){return _0x39f14c[_0xd0cc('0x21')](_0x377284)[_0xd0cc('0x23')](_0x496c32);}};}function respondWithFilteredResult(_0x209806,_0x37e2a0){return function(_0x4dc4aa){if(_0x4dc4aa){var _0x407a75=typeof _0x37e2a0[_0xd0cc('0x24')]===_0xd0cc('0x25')&&typeof _0x37e2a0[_0xd0cc('0x26')]==='undefined';var _0x3ebf21=_0x4dc4aa[_0xd0cc('0x27')];var _0x5bbfa9=_0x407a75?0x0:_0x37e2a0[_0xd0cc('0x24')];var _0x43eeb7=_0x407a75?_0x4dc4aa[_0xd0cc('0x27')]:_0x37e2a0[_0xd0cc('0x24')]+_0x37e2a0[_0xd0cc('0x26')];var _0x173a65;if(_0x43eeb7>=_0x3ebf21){_0x43eeb7=_0x3ebf21;_0x173a65=0xc8;}else{_0x173a65=0xce;}_0x209806[_0xd0cc('0x21')](_0x173a65);return _0x209806[_0xd0cc('0x28')]('Content-Range',_0x5bbfa9+'-'+_0x43eeb7+'/'+_0x3ebf21)[_0xd0cc('0x23')](_0x4dc4aa);}return null;};}function patchUpdates(_0x434d98){return function(_0x32bacd){try{jsonpatch[_0xd0cc('0x29')](_0x32bacd,_0x434d98,!![]);}catch(_0x55ec1a){return BPromise['reject'](_0x55ec1a);}return _0x32bacd[_0xd0cc('0x2a')]();};}function saveUpdates(_0x1549f0,_0x299940){return function(_0x71d8ad){if(_0x71d8ad){return _0x71d8ad[_0xd0cc('0x2b')](_0x1549f0)[_0xd0cc('0x2c')](function(_0x3d6af8){return _0x3d6af8;});}return null;};}function removeEntity(_0x3e7cd5,_0x385bdc){return function(_0x2e0c40){if(_0x2e0c40){return _0x2e0c40[_0xd0cc('0x2d')]()[_0xd0cc('0x2c')](function(){_0x3e7cd5[_0xd0cc('0x21')](0xcc)[_0xd0cc('0x22')]();});}};}function handleEntityNotFound(_0x52316f,_0x1a37a7){return function(_0x534d87){if(!_0x534d87){_0x52316f[_0xd0cc('0x20')](0x194);}return _0x534d87;};}function handleError(_0x23d5ca,_0x59b1b1){_0x59b1b1=_0x59b1b1||0x1f4;return function(_0x148904){logger[_0xd0cc('0x2e')](_0x148904[_0xd0cc('0x2f')]);if(_0x148904[_0xd0cc('0x30')]){delete _0x148904['name'];}_0x23d5ca['status'](_0x59b1b1)['send'](_0x148904);};}exports[_0xd0cc('0x31')]=function(_0x33c4c9,_0x49ff7b){var _0x531204={},_0x5e9a18={},_0x308acf={'count':0x0,'rows':[]};var _0x434e43=_[_0xd0cc('0x32')](db['ChatInternalMessage'][_0xd0cc('0x33')],function(_0x57adcb){return{'name':_0x57adcb[_0xd0cc('0x34')],'type':_0x57adcb[_0xd0cc('0x35')]['key']};});_0x5e9a18[_0xd0cc('0x36')]=_['map'](_0x434e43,_0xd0cc('0x30'));_0x5e9a18[_0xd0cc('0x37')]=_['keys'](_0x33c4c9['query']);_0x5e9a18[_0xd0cc('0x38')]=_[_0xd0cc('0x39')](_0x5e9a18[_0xd0cc('0x36')],_0x5e9a18[_0xd0cc('0x37')]);_0x531204[_0xd0cc('0x3a')]=_[_0xd0cc('0x39')](_0x5e9a18[_0xd0cc('0x36')],qs[_0xd0cc('0x3b')](_0x33c4c9[_0xd0cc('0x37')]['fields']));_0x531204[_0xd0cc('0x3a')]=_0x531204[_0xd0cc('0x3a')][_0xd0cc('0x3c')]?_0x531204[_0xd0cc('0x3a')]:_0x5e9a18[_0xd0cc('0x36')];if(!_0x33c4c9[_0xd0cc('0x37')][_0xd0cc('0x3d')](_0xd0cc('0x3e'))){_0x531204[_0xd0cc('0x26')]=qs[_0xd0cc('0x26')](_0x33c4c9[_0xd0cc('0x37')][_0xd0cc('0x26')]);_0x531204[_0xd0cc('0x24')]=qs['offset'](_0x33c4c9[_0xd0cc('0x37')][_0xd0cc('0x24')]);}_0x531204['order']=qs[_0xd0cc('0x3f')](_0x33c4c9[_0xd0cc('0x37')][_0xd0cc('0x3f')]);_0x531204[_0xd0cc('0x40')]=qs[_0xd0cc('0x38')](_[_0xd0cc('0x41')](_0x33c4c9[_0xd0cc('0x37')],_0x5e9a18[_0xd0cc('0x38')]),_0x434e43);if(_0x33c4c9[_0xd0cc('0x37')][_0xd0cc('0x42')]){_0x531204[_0xd0cc('0x40')]=_[_0xd0cc('0x43')](_0x531204[_0xd0cc('0x40')],{'$or':_['map'](_0x434e43,function(_0xf72fd0){if(_0xf72fd0[_0xd0cc('0x35')]!==_0xd0cc('0x44')){var _0x5cd6d4={};_0x5cd6d4[_0xf72fd0[_0xd0cc('0x30')]]={'$like':'%'+_0x33c4c9[_0xd0cc('0x37')]['filter']+'%'};return _0x5cd6d4;}})});}_0x531204=_[_0xd0cc('0x43')]({},_0x531204,_0x33c4c9['options']);var _0x3c2205={'where':_0x531204[_0xd0cc('0x40')]};return db[_0xd0cc('0x45')]['count'](_0x3c2205)[_0xd0cc('0x2c')](function(_0x3fbd75){_0x308acf[_0xd0cc('0x27')]=_0x3fbd75;if(_0x33c4c9[_0xd0cc('0x37')][_0xd0cc('0x46')]){_0x531204['include']=[{'all':!![]}];}return db[_0xd0cc('0x45')][_0xd0cc('0x47')](_0x531204);})[_0xd0cc('0x2c')](function(_0x2c5e4a){_0x308acf['rows']=_0x2c5e4a;return _0x308acf;})[_0xd0cc('0x2c')](respondWithFilteredResult(_0x49ff7b,_0x531204))['catch'](handleError(_0x49ff7b,null));};exports[_0xd0cc('0x48')]=function(_0x496667,_0x27fafe){var _0x18a397={'raw':!![],'where':{'id':_0x496667['params']['id']}},_0x2d2788={};_0x2d2788[_0xd0cc('0x36')]=_[_0xd0cc('0x49')](db['ChatInternalMessage']['rawAttributes']);_0x2d2788[_0xd0cc('0x37')]=_[_0xd0cc('0x49')](_0x496667['query']);_0x2d2788[_0xd0cc('0x38')]=_[_0xd0cc('0x39')](_0x2d2788[_0xd0cc('0x36')],_0x2d2788[_0xd0cc('0x37')]);_0x18a397['attributes']=_[_0xd0cc('0x39')](_0x2d2788[_0xd0cc('0x36')],qs['fields'](_0x496667[_0xd0cc('0x37')][_0xd0cc('0x3b')]));_0x18a397['attributes']=_0x18a397['attributes']['length']?_0x18a397[_0xd0cc('0x3a')]:_0x2d2788['model'];if(_0x496667[_0xd0cc('0x37')][_0xd0cc('0x46')]){_0x18a397[_0xd0cc('0x4a')]=[{'all':!![]}];}_0x18a397=_[_0xd0cc('0x43')]({},_0x18a397,_0x496667[_0xd0cc('0x4b')]);return db[_0xd0cc('0x45')][_0xd0cc('0x4c')](_0x18a397)[_0xd0cc('0x2c')](handleEntityNotFound(_0x27fafe,null))['then'](respondWithResult(_0x27fafe,null))[_0xd0cc('0x4d')](handleError(_0x27fafe,null));};exports[_0xd0cc('0x4e')]=function(_0x25e8dc,_0x528806){return db[_0xd0cc('0x45')][_0xd0cc('0x4e')](_0x25e8dc[_0xd0cc('0x4f')],{})[_0xd0cc('0x2c')](respondWithResult(_0x528806,0xc9))[_0xd0cc('0x4d')](handleError(_0x528806,null));};exports[_0xd0cc('0x2b')]=function(_0x89861,_0x1469b4){if(_0x89861[_0xd0cc('0x4f')]['id']){delete _0x89861['body']['id'];}return db[_0xd0cc('0x45')][_0xd0cc('0x4c')]({'where':{'id':_0x89861[_0xd0cc('0x50')]['id']}})['then'](handleEntityNotFound(_0x1469b4,null))[_0xd0cc('0x2c')](saveUpdates(_0x89861[_0xd0cc('0x4f')],null))[_0xd0cc('0x2c')](respondWithResult(_0x1469b4,null))[_0xd0cc('0x4d')](handleError(_0x1469b4,null));};exports[_0xd0cc('0x2d')]=function(_0x2ebe0f,_0x4dccc4){return db[_0xd0cc('0x45')]['find']({'where':{'id':_0x2ebe0f[_0xd0cc('0x50')]['id']}})[_0xd0cc('0x2c')](handleEntityNotFound(_0x4dccc4,null))[_0xd0cc('0x2c')](removeEntity(_0x4dccc4,null))[_0xd0cc('0x4d')](handleError(_0x4dccc4,null));};exports[_0xd0cc('0x51')]=function(_0x1a5f99,_0x567ff4){return db['ChatInternalMessage'][_0xd0cc('0x51')]()['then'](respondWithResult(_0x567ff4,null))['catch'](handleError(_0x567ff4,null));};function wrapUser(_0x918966){return function(_0x57eef6){var _0x9e5866=_0x918966[_0xd0cc('0x52')]({'plain':!![]});_0x9e5866[_0xd0cc('0x53')]=[];if(_0x57eef6){_0x9e5866[_0xd0cc('0x54')]=_0x57eef6['createdAt'];_0x9e5866[_0xd0cc('0x55')]=_0x57eef6;}else{_0x9e5866['lastMessageAt']=moment(0x0)['format'](_0xd0cc('0x56'));_0x9e5866[_0xd0cc('0x55')]={};}return _0x9e5866;};}exports[_0xd0cc('0x57')]=function(_0x7430ac,_0x4a3e07,_0x3a3390){var _0x1e2d88=[];return db[_0xd0cc('0x58')][_0xd0cc('0x47')]({'where':{'role':['agent',_0xd0cc('0x59'),_0xd0cc('0x5a')]},'attributes':['id',_0xd0cc('0x5b'),_0xd0cc('0x30'),_0xd0cc('0x5c'),_0xd0cc('0x5d'),'internal',_0xd0cc('0x5e'),'lastLoginAt','allowmessenger',_0xd0cc('0x5f')],'order':qs['sort'](_0xd0cc('0x60')),'include':[{'model':db[_0xd0cc('0x61')],'as':'VoiceQueues','attributes':['id',_0xd0cc('0x30'),_0xd0cc('0x35')],'through':{'attributes':[]}}]})[_0xd0cc('0x2c')](function(_0x4d2628){if(_0x4d2628){var _0x236358=_0x7430ac['user']['get']({'plain':!![]});if(!_0x236358)throw new Error(_0xd0cc('0x62'));if(_0x236358['role']===_0xd0cc('0x5a')){return db[_0xd0cc('0x63')][_0xd0cc('0x4c')]({'where':{'name':_0xd0cc('0x64'),'userProfileId':_0x236358[_0xd0cc('0x65')]},'raw':!![]})['then'](function(_0x2e9b0d){if(_0x2e9b0d){if(_0x2e9b0d[_0xd0cc('0x66')]===0x0){return db[_0xd0cc('0x67')][_0xd0cc('0x47')]({'where':{'sectionId':_0x2e9b0d['id']},'raw':!![]})[_0xd0cc('0x2c')](function(_0x3d8190){var _0x31d75c=[];if(_[_0xd0cc('0x68')](_0x3d8190)){_0x31d75c=_[_0xd0cc('0x42')](_0x4d2628,function(_0x170468){if(_0x170468[_0xd0cc('0x5c')]!==_0xd0cc('0x69')){return _0x170468;}});return _0x31d75c;}else{for(var _0x21355f=0x0;_0x21355f<_0x4d2628['length'];_0x21355f++){var _0xda4b34=_0x4d2628[_0x21355f];if(_0xda4b34['role']===_0xd0cc('0x69')){var _0x15abec=_[_0xd0cc('0x4c')](_0x3d8190,function(_0x16a24d){return _0x16a24d[_0xd0cc('0x6a')]===_0xda4b34['id'];});if(_0x15abec)_0x31d75c[_0xd0cc('0x6b')](_0xda4b34);}else{_0x31d75c[_0xd0cc('0x6b')](_0xda4b34);}}return _0x31d75c;}});}else{return _0x4d2628;}}else{var _0x566504=_[_0xd0cc('0x42')](_0x4d2628,function(_0x3d225f){if(_0x3d225f[_0xd0cc('0x5c')]!==_0xd0cc('0x69')){return _0x3d225f;}});return _0x566504;}});}else{return _0x4d2628;}}})[_0xd0cc('0x2c')](function(_0x36df6e){var _0x212a7=[];if(_0x36df6e){_0x1e2d88=_0x36df6e;for(var _0x319403=0x0;_0x319403<_0x36df6e['length'];_0x319403+=0x1){_0x1e2d88[_0x319403]['messages']=[];_0x212a7['push'](db[_0xd0cc('0x45')][_0xd0cc('0x4c')]({'where':{'FromId':[_0x7430ac[_0xd0cc('0x5a')]['id'],_0x36df6e[_0x319403]['id']],'ToId':[_0x7430ac[_0xd0cc('0x5a')]['id'],_0x36df6e[_0x319403]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0xd0cc('0x6c'),_0xd0cc('0x6d'),_0xd0cc('0x6e'),'body'],'order':qs[_0xd0cc('0x3f')](_0xd0cc('0x6f')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xd0cc('0x2c')](wrapUser(_0x36df6e[_0x319403])));}return BPromise[_0xd0cc('0x70')](_0x212a7);}return[];})[_0xd0cc('0x2c')](function(_0x2be743){return{'rows':_0x2be743,'count':_0x2be743[_0xd0cc('0x3c')]};})[_0xd0cc('0x2c')](respondWithResult(_0x4a3e07,null))[_0xd0cc('0x4d')](handleError(_0x4a3e07,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index eb3a332..5fe660a 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 _0xdcc1=['exports','events','ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x34b678,_0x13b7fa){var _0x463d62=function(_0x45271b){while(--_0x45271b){_0x34b678['push'](_0x34b678['shift']());}};_0x463d62(++_0x13b7fa);}(_0xdcc1,0x15f));var _0x1dcc=function(_0x138847,_0x45327e){_0x138847=_0x138847-0x0;var _0x295bad=_0xdcc1[_0x138847];return _0x295bad;};'use strict';var EventEmitter=require(_0x1dcc('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x1dcc('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x1dcc('0x2')](0x0);var events={'afterCreate':_0x1dcc('0x3'),'afterUpdate':_0x1dcc('0x4'),'afterDestroy':_0x1dcc('0x5')};function emitEvent(_0x3fe5ef){return function(_0x4186f6,_0x1cc4ce,_0x31f70c){ChatInternalMessageEvents[_0x1dcc('0x6')](_0x3fe5ef+':'+_0x4186f6['id'],_0x4186f6);ChatInternalMessageEvents[_0x1dcc('0x6')](_0x3fe5ef,_0x4186f6);_0x31f70c(null);};}for(var e in events){if(events[_0x1dcc('0x7')](e)){var event=events[e];ChatInternalMessage[_0x1dcc('0x8')](e,emitEvent(event));}}module[_0x1dcc('0x9')]=ChatInternalMessageEvents; \ No newline at end of file +var _0xf701=['emit','hasOwnProperty','hook','../../mysqldb','ChatInternalMessage','setMaxListeners','update'];(function(_0x1e6659,_0x1f860c){var _0x4d16e4=function(_0x21c05a){while(--_0x21c05a){_0x1e6659['push'](_0x1e6659['shift']());}};_0x4d16e4(++_0x1f860c);}(_0xf701,0x15a));var _0x1f70=function(_0x441637,_0x3b0a6d){_0x441637=_0x441637-0x0;var _0x413474=_0xf701[_0x441637];return _0x413474;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x1f70('0x0'))['db'][_0x1f70('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x1f70('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1f70('0x3'),'afterDestroy':'remove'};function emitEvent(_0x1f9505){return function(_0x35eb5f,_0x5937bf,_0x4a0b68){ChatInternalMessageEvents[_0x1f70('0x4')](_0x1f9505+':'+_0x35eb5f['id'],_0x35eb5f);ChatInternalMessageEvents[_0x1f70('0x4')](_0x1f9505,_0x35eb5f);_0x4a0b68(null);};}for(var e in events){if(events[_0x1f70('0x5')](e)){var event=events[e];ChatInternalMessage[_0x1f70('0x6')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 4aa950c..ed83b10 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 _0x9e67=['moment','bluebird','request-promise','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9e67,0x13e));var _0x79e6=function(_0x5916ae,_0x3b8e58){_0x5916ae=_0x5916ae-0x0;var _0x134540=_0x9e67[_0x5916ae];return _0x134540;};'use strict';var _=require(_0x79e6('0x0'));var util=require(_0x79e6('0x1'));var logger=require(_0x79e6('0x2'))(_0x79e6('0x3'));var moment=require(_0x79e6('0x4'));var BPromise=require(_0x79e6('0x5'));var rp=require(_0x79e6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x79e6('0x7'));var attributes=require(_0x79e6('0x8'));module[_0x79e6('0x9')]=function(_0x53233f,_0x32d6c5){return _0x53233f[_0x79e6('0xa')](_0x79e6('0xb'),attributes,{'tableName':_0x79e6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x79e6('0xd')});}; \ No newline at end of file +var _0x600f=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x220a04,_0x43e822){var _0xb558fa=function(_0x1f1f2f){while(--_0x1f1f2f){_0x220a04['push'](_0x220a04['shift']());}};_0xb558fa(++_0x43e822);}(_0x600f,0x11c));var _0xf600=function(_0x4cc280,_0x3b77f3){_0x4cc280=_0x4cc280-0x0;var _0x16ed24=_0x600f[_0x4cc280];return _0x16ed24;};'use strict';var _=require('lodash');var util=require(_0xf600('0x0'));var logger=require(_0xf600('0x1'))(_0xf600('0x2'));var moment=require(_0xf600('0x3'));var BPromise=require(_0xf600('0x4'));var rp=require(_0xf600('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf600('0x6'));var config=require(_0xf600('0x7'));var attributes=require(_0xf600('0x8'));module['exports']=function(_0xa8e17e,_0x262955){return _0xa8e17e['define'](_0xf600('0x9'),attributes,{'tableName':_0xf600('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf600('0xb'),'collate':_0xf600('0xc')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index fbebdad..70f696b 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 _0x521c=['message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','request','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x521c,0x6b));var _0xc521=function(_0x2c403b,_0x280192){_0x2c403b=_0x2c403b-0x0;var _0x2b6f8c=_0x521c[_0x2c403b];return _0x2b6f8c;};'use strict';var _=require('lodash');var util=require(_0xc521('0x0'));var moment=require(_0xc521('0x1'));var BPromise=require(_0xc521('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc521('0x3'));var db=require(_0xc521('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc521('0x5'));var config=require(_0xc521('0x6'));var jayson=require(_0xc521('0x7'));var client=jayson[_0xc521('0x8')][_0xc521('0x9')]({'port':0x232a});config[_0xc521('0xa')]=_[_0xc521('0xb')](config['redis'],{'host':_0xc521('0xc'),'port':0x18eb});var socket=require(_0xc521('0xd'))(new Redis(config[_0xc521('0xa')]));require(_0xc521('0xe'))['register'](socket);function respondWithRpcPromise(_0x4ac6a2,_0x3ed24a,_0x15e427){return new BPromise(function(_0x375ea1,_0x2935a7){return client[_0xc521('0xf')](_0x4ac6a2,_0x15e427)['then'](function(_0x265769){logger[_0xc521('0x10')](_0xc521('0x11'),_0x3ed24a,'request\x20sent');logger[_0xc521('0x12')](_0xc521('0x13'),_0x3ed24a,_0xc521('0x14'),JSON[_0xc521('0x15')](_0x265769));if(_0x265769[_0xc521('0x16')]){if(_0x265769[_0xc521('0x16')]['code']===0x1f4){logger[_0xc521('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x3ed24a,_0x265769[_0xc521('0x16')][_0xc521('0x17')]);return _0x2935a7(_0x265769[_0xc521('0x16')][_0xc521('0x17')]);}logger[_0xc521('0x16')](_0xc521('0x11'),_0x3ed24a,_0x265769[_0xc521('0x16')]['message']);return _0x375ea1(_0x265769[_0xc521('0x16')][_0xc521('0x17')]);}else{logger[_0xc521('0x10')](_0xc521('0x11'),_0x3ed24a,_0xc521('0x14'));_0x375ea1(_0x265769[_0xc521('0x18')][_0xc521('0x17')]);}})[_0xc521('0x19')](function(_0x885082){logger[_0xc521('0x16')](_0xc521('0x11'),_0x3ed24a,_0x885082);_0x2935a7(_0x885082);});});} \ No newline at end of file +var _0xd0b1=['result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','ChatInternalMessage,\x20%s,\x20%s','message'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xd0b1,0x16e));var _0x1d0b=function(_0xe8a9c6,_0x315a90){_0xe8a9c6=_0xe8a9c6-0x0;var _0x3d150c=_0xd0b1[_0xe8a9c6];return _0x3d150c;};'use strict';var _=require(_0x1d0b('0x0'));var util=require(_0x1d0b('0x1'));var moment=require('moment');var BPromise=require(_0x1d0b('0x2'));var rs=require(_0x1d0b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1d0b('0x4'))['db'];var utils=require(_0x1d0b('0x5'));var logger=require(_0x1d0b('0x6'))(_0x1d0b('0x7'));var config=require(_0x1d0b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1d0b('0x9')][_0x1d0b('0xa')]({'port':0x232a});config[_0x1d0b('0xb')]=_[_0x1d0b('0xc')](config[_0x1d0b('0xb')],{'host':_0x1d0b('0xd'),'port':0x18eb});var socket=require(_0x1d0b('0xe'))(new Redis(config['redis']));require(_0x1d0b('0xf'))[_0x1d0b('0x10')](socket);function respondWithRpcPromise(_0x3a5369,_0x4b136e,_0x1b520a){return new BPromise(function(_0x5ef099,_0x196c3b){return client[_0x1d0b('0x11')](_0x3a5369,_0x1b520a)['then'](function(_0x529c76){logger[_0x1d0b('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0x4b136e,_0x1d0b('0x13'));logger[_0x1d0b('0x14')](_0x1d0b('0x15'),_0x4b136e,_0x1d0b('0x13'),JSON[_0x1d0b('0x16')](_0x529c76));if(_0x529c76['error']){if(_0x529c76[_0x1d0b('0x17')]['code']===0x1f4){logger[_0x1d0b('0x17')](_0x1d0b('0x18'),_0x4b136e,_0x529c76[_0x1d0b('0x17')][_0x1d0b('0x19')]);return _0x196c3b(_0x529c76[_0x1d0b('0x17')][_0x1d0b('0x19')]);}logger[_0x1d0b('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x4b136e,_0x529c76[_0x1d0b('0x17')][_0x1d0b('0x19')]);return _0x5ef099(_0x529c76['error'][_0x1d0b('0x19')]);}else{logger[_0x1d0b('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0x4b136e,_0x1d0b('0x13'));_0x5ef099(_0x529c76[_0x1d0b('0x1a')]['message']);}})[_0x1d0b('0x1b')](function(_0x1f874){logger[_0x1d0b('0x17')](_0x1d0b('0x18'),_0x4b136e,_0x1f874);_0x196c3b(_0x1f874);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 01151b2..4dbdfe1 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 _0xb3f8=['update','emit','removeListener','register','length','./chatInternalMessage.events','remove'];(function(_0x3c5d2b,_0x2ddb64){var _0x4269ec=function(_0x2de4e1){while(--_0x2de4e1){_0x3c5d2b['push'](_0x3c5d2b['shift']());}};_0x4269ec(++_0x2ddb64);}(_0xb3f8,0x83));var _0x8b3f=function(_0x4206f5,_0x21f338){_0x4206f5=_0x4206f5-0x0;var _0xa29cf3=_0xb3f8[_0x4206f5];return _0xa29cf3;};'use strict';var ChatInternalMessageEvents=require(_0x8b3f('0x0'));var events=['save',_0x8b3f('0x1'),_0x8b3f('0x2')];function createListener(_0x5c8bf4,_0x5ed22a){return function(_0x39b8d3){_0x5ed22a[_0x8b3f('0x3')](_0x5c8bf4,_0x39b8d3);};}function removeListener(_0x2ea4fa,_0x2d4e26){return function(){ChatInternalMessageEvents[_0x8b3f('0x4')](_0x2ea4fa,_0x2d4e26);};}exports[_0x8b3f('0x5')]=function(_0x481d7e){for(var _0x522529=0x0,_0x29d849=events[_0x8b3f('0x6')];_0x522529<_0x29d849;_0x522529++){var _0xa09de8=events[_0x522529];var _0x5058da=createListener('chatInternalMessage:'+_0xa09de8,_0x481d7e);ChatInternalMessageEvents['on'](_0xa09de8,_0x5058da);}}; \ No newline at end of file +var _0x4cd2=['removeListener','length','chatInternalMessage:','./chatInternalMessage.events','save','remove','update','emit'];(function(_0x3eddb3,_0x4c7b89){var _0x2c7497=function(_0x17dfb9){while(--_0x17dfb9){_0x3eddb3['push'](_0x3eddb3['shift']());}};_0x2c7497(++_0x4c7b89);}(_0x4cd2,0x193));var _0x24cd=function(_0x412cee,_0x3bd66a){_0x412cee=_0x412cee-0x0;var _0x553f36=_0x4cd2[_0x412cee];return _0x553f36;};'use strict';var ChatInternalMessageEvents=require(_0x24cd('0x0'));var events=[_0x24cd('0x1'),_0x24cd('0x2'),_0x24cd('0x3')];function createListener(_0xf41b1e,_0x330cb0){return function(_0x46474b){_0x330cb0[_0x24cd('0x4')](_0xf41b1e,_0x46474b);};}function removeListener(_0x533a33,_0x3739e0){return function(){ChatInternalMessageEvents[_0x24cd('0x5')](_0x533a33,_0x3739e0);};}exports['register']=function(_0xe1ccf8){for(var _0xb6ae30=0x0,_0x41bc6d=events[_0x24cd('0x6')];_0xb6ae30<_0x41bc6d;_0xb6ae30++){var _0x53cbe3=events[_0xb6ae30];var _0x546488=createListener(_0x24cd('0x7')+_0x53cbe3,_0xe1ccf8);ChatInternalMessageEvents['on'](_0x53cbe3,_0x546488);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 201138c..604adc5 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 _0xa5d1=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','describe','getUsers','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x25d386,_0x108d0d){var _0x857f4a=function(_0x3eb98d){while(--_0x3eb98d){_0x25d386['push'](_0x25d386['shift']());}};_0x857f4a(++_0x108d0d);}(_0xa5d1,0x181));var _0x1a5d=function(_0x5de780,_0xe3c39a){_0x5de780=_0x5de780-0x0;var _0x13514c=_0xa5d1[_0x5de780];return _0x13514c;};'use strict';var multer=require(_0x1a5d('0x0'));var util=require(_0x1a5d('0x1'));var path=require(_0x1a5d('0x2'));var timeout=require(_0x1a5d('0x3'));var express=require(_0x1a5d('0x4'));var router=express[_0x1a5d('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1a5d('0x6'));var interaction=require(_0x1a5d('0x7'));var config=require(_0x1a5d('0x8'));var controller=require(_0x1a5d('0x9'));router[_0x1a5d('0xa')]('/',auth[_0x1a5d('0xb')](),controller[_0x1a5d('0xc')]);router[_0x1a5d('0xa')]('/describe',auth[_0x1a5d('0xb')](),controller[_0x1a5d('0xd')]);router[_0x1a5d('0xa')]('/users',auth[_0x1a5d('0xb')](),controller[_0x1a5d('0xe')]);router[_0x1a5d('0xa')](_0x1a5d('0xf'),auth[_0x1a5d('0xb')](),controller[_0x1a5d('0x10')]);router[_0x1a5d('0x11')]('/',auth[_0x1a5d('0xb')](),controller[_0x1a5d('0x12')]);router[_0x1a5d('0x13')](_0x1a5d('0xf'),controller['update']);router[_0x1a5d('0x14')](_0x1a5d('0xf'),auth[_0x1a5d('0xb')](),controller[_0x1a5d('0x15')]);module[_0x1a5d('0x16')]=router; \ No newline at end of file +var _0x1c24=['/users','getUsers','/:id','show','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated'];(function(_0x17d703,_0x2266eb){var _0x4fd652=function(_0x4147ad){while(--_0x4147ad){_0x17d703['push'](_0x17d703['shift']());}};_0x4fd652(++_0x2266eb);}(_0x1c24,0x1ac));var _0x41c2=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x1c24[_0x4c12ec];return _0x3ae42c;};'use strict';var multer=require(_0x41c2('0x0'));var util=require(_0x41c2('0x1'));var path=require('path');var timeout=require(_0x41c2('0x2'));var express=require(_0x41c2('0x3'));var router=express[_0x41c2('0x4')]();var fs_extra=require(_0x41c2('0x5'));var auth=require(_0x41c2('0x6'));var interaction=require(_0x41c2('0x7'));var config=require(_0x41c2('0x8'));var controller=require(_0x41c2('0x9'));router[_0x41c2('0xa')]('/',auth[_0x41c2('0xb')](),controller['index']);router[_0x41c2('0xa')]('/describe',auth[_0x41c2('0xb')](),controller['describe']);router['get'](_0x41c2('0xc'),auth[_0x41c2('0xb')](),controller[_0x41c2('0xd')]);router[_0x41c2('0xa')](_0x41c2('0xe'),auth[_0x41c2('0xb')](),controller[_0x41c2('0xf')]);router[_0x41c2('0x10')]('/',auth[_0x41c2('0xb')](),controller[_0x41c2('0x11')]);router[_0x41c2('0x12')](_0x41c2('0xe'),controller[_0x41c2('0x13')]);router[_0x41c2('0x14')](_0x41c2('0xe'),auth[_0x41c2('0xb')](),controller[_0x41c2('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index d22216d..96f1fd7 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 _0xdd4f=['DATE','TEXT','sequelize','BOOLEAN','out'];(function(_0x3f5293,_0xf86f3){var _0x14366c=function(_0x4412ff){while(--_0x4412ff){_0x3f5293['push'](_0x3f5293['shift']());}};_0x14366c(++_0xf86f3);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x3e4c49,_0x1fdf6f){_0x3e4c49=_0x3e4c49-0x0;var _0x45f354=_0xdd4f[_0x3e4c49];return _0x45f354;};'use strict';var Sequelize=require(_0xfdd4('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xfdd4('0x1')],'defaultValue':![]},'secret':{'type':Sequelize[_0xfdd4('0x1')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xfdd4('0x2')),'defaultValue':_0xfdd4('0x2'),'allowNull':![]},'readAt':{'type':Sequelize[_0xfdd4('0x3')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xfdd4('0x4')]}}; \ No newline at end of file +var _0x97e6=['out','DATE','sequelize','TEXT','medium','BOOLEAN','ENUM'];(function(_0xab36ea,_0xb838df){var _0x27e12d=function(_0x3d31ed){while(--_0x3d31ed){_0xab36ea['push'](_0xab36ea['shift']());}};_0x27e12d(++_0xb838df);}(_0x97e6,0x159));var _0x697e=function(_0x2812c2,_0x2b382d){_0x2812c2=_0x2812c2-0x0;var _0x218ac9=_0x97e6[_0x2812c2];return _0x218ac9;};'use strict';var Sequelize=require(_0x697e('0x0'));module['exports']={'body':{'type':Sequelize[_0x697e('0x1')](_0x697e('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x697e('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x697e('0x4')]('in',_0x697e('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x697e('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x697e('0x1')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 43d28db..625bb7a 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 _0x0344=['pick','filter','merge','VIRTUAL','options','ChatMessage','rows','show','params','includeAll','find','create','body','describe','accept','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','get','ChatInteraction','ChatInteractionId','isNil','interaction','info','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','internal','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','chat-interactions','chat','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','email','interface','rejectmessage','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','nolimit','sort','where'];(function(_0x38decd,_0x9ac4e3){var _0x11a3d9=function(_0x29500b){while(--_0x29500b){_0x38decd['push'](_0x38decd['shift']());}};_0x11a3d9(++_0x9ac4e3);}(_0x0344,0x14b));var _0x4034=function(_0x310d4a,_0x272aa0){_0x310d4a=_0x310d4a-0x0;var _0xa9e651=_0x0344[_0x310d4a];return _0xa9e651;};'use strict';var emlformat=require(_0x4034('0x0'));var rimraf=require(_0x4034('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4034('0x2'));var rp=require(_0x4034('0x3'));var moment=require(_0x4034('0x4'));var BPromise=require(_0x4034('0x5'));var Mustache=require('mustache');var util=require(_0x4034('0x6'));var path=require('path');var sox=require(_0x4034('0x7'));var csv=require(_0x4034('0x8'));var ejs=require(_0x4034('0x9'));var fs=require('fs');var fs_extra=require(_0x4034('0xa'));var _=require(_0x4034('0xb'));var squel=require(_0x4034('0xc'));var crypto=require('crypto');var jsforce=require(_0x4034('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x4034('0x8'));var querystring=require(_0x4034('0xe'));var Papa=require(_0x4034('0xf'));var Redis=require(_0x4034('0x10'));var authService=require(_0x4034('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4034('0x12'));var hardwareService=require(_0x4034('0x13'));var logger=require(_0x4034('0x14'))(_0x4034('0x15'));var utils=require(_0x4034('0x16'));var config=require(_0x4034('0x17'));var licenseUtil=require(_0x4034('0x18'));var db=require(_0x4034('0x19'))['db'];config[_0x4034('0x1a')]=_[_0x4034('0x1b')](config[_0x4034('0x1a')],{'host':_0x4034('0x1c'),'port':0x18eb});var socket=require(_0x4034('0x1d'))(new Redis(config[_0x4034('0x1a')]));require(_0x4034('0x1e'))[_0x4034('0x1f')](socket);var jayson=require(_0x4034('0x20'));var client=jayson[_0x4034('0x21')][_0x4034('0x22')]({'port':0x232c});var client9002=jayson[_0x4034('0x21')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5197c0,_0x1feeb2,_0xdc75b4,_0x152ece){return new BPromise(function(_0x380d82,_0x559ade){var _0x18e70d=_0x152ece||client;return _0x18e70d[_0x4034('0x23')](_0x5197c0,_0xdc75b4)[_0x4034('0x24')](function(_0x35d057){logger['info'](_0x4034('0x25'),_0x1feeb2,_0x4034('0x26'));logger[_0x4034('0x27')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x1feeb2,'request\x20sent',JSON[_0x4034('0x28')](_0x35d057));if(_0x35d057[_0x4034('0x29')]){if(_0x35d057[_0x4034('0x29')][_0x4034('0x2a')]===0x1f4){logger[_0x4034('0x29')](_0x4034('0x25'),_0x1feeb2,_0x35d057[_0x4034('0x29')][_0x4034('0x2b')]);return _0x559ade(_0x35d057[_0x4034('0x29')][_0x4034('0x2b')]);}logger[_0x4034('0x29')](_0x4034('0x25'),_0x1feeb2,_0x35d057[_0x4034('0x29')][_0x4034('0x2b')]);return _0x380d82(_0x35d057['error'][_0x4034('0x2b')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x1feeb2,_0x4034('0x26'));_0x380d82(_0x35d057[_0x4034('0x2c')][_0x4034('0x2b')]);}})[_0x4034('0x2d')](function(_0x19dcf7){logger['error'](_0x4034('0x25'),_0x1feeb2,_0x19dcf7);_0x559ade(_0x19dcf7);});});}function respondWithStatusCode(_0x599b31,_0x43e156){_0x43e156=_0x43e156||0xcc;return function(_0x25cb8a){if(_0x25cb8a){return _0x599b31[_0x4034('0x2e')](_0x43e156);}return _0x599b31['status'](_0x43e156)[_0x4034('0x2f')]();};}function respondWithResult(_0x12bbe0,_0x2973d8){_0x2973d8=_0x2973d8||0xc8;return function(_0x4e26cc){if(_0x4e26cc){return _0x12bbe0[_0x4034('0x30')](_0x2973d8)[_0x4034('0x31')](_0x4e26cc);}};}function respondWithFilteredResult(_0x1604f8,_0x4f027c){return function(_0x55ba21){if(_0x55ba21){var _0x35edc5=typeof _0x4f027c[_0x4034('0x32')]===_0x4034('0x33')&&typeof _0x4f027c['limit']===_0x4034('0x33');var _0x239191=_0x55ba21['count'];var _0x3ef446=_0x35edc5?0x0:_0x4f027c[_0x4034('0x32')];var _0x11b90e=_0x35edc5?_0x55ba21[_0x4034('0x34')]:_0x4f027c[_0x4034('0x32')]+_0x4f027c[_0x4034('0x35')];var _0x55336b;if(_0x11b90e>=_0x239191){_0x11b90e=_0x239191;_0x55336b=0xc8;}else{_0x55336b=0xce;}_0x1604f8[_0x4034('0x30')](_0x55336b);return _0x1604f8[_0x4034('0x36')](_0x4034('0x37'),_0x3ef446+'-'+_0x11b90e+'/'+_0x239191)['json'](_0x55ba21);}return null;};}function patchUpdates(_0x59b2fe){return function(_0xb2bf07){try{jsonpatch[_0x4034('0x38')](_0xb2bf07,_0x59b2fe,!![]);}catch(_0x4bbef0){return BPromise[_0x4034('0x39')](_0x4bbef0);}return _0xb2bf07[_0x4034('0x3a')]();};}function saveUpdates(_0x4783c5,_0x50bf3e){return function(_0x5efbf9){if(_0x5efbf9){return _0x5efbf9[_0x4034('0x3b')](_0x4783c5)[_0x4034('0x24')](function(_0x597941){return _0x597941;});}return null;};}function removeEntity(_0x1034c8,_0x52754b){return function(_0x7a9fb8){if(_0x7a9fb8){return _0x7a9fb8[_0x4034('0x3c')]()[_0x4034('0x24')](function(){_0x1034c8[_0x4034('0x30')](0xcc)[_0x4034('0x2f')]();});}};}function handleEntityNotFound(_0x46c9e3,_0x531e5b){return function(_0x4ebf79){if(!_0x4ebf79){_0x46c9e3['sendStatus'](0x194);}return _0x4ebf79;};}function handleError(_0x41803c,_0x57ebd1){_0x57ebd1=_0x57ebd1||0x1f4;return function(_0x25803e){logger[_0x4034('0x29')](_0x25803e[_0x4034('0x3d')]);if(_0x25803e[_0x4034('0x3e')]){delete _0x25803e[_0x4034('0x3e')];}_0x41803c[_0x4034('0x30')](_0x57ebd1)[_0x4034('0x3f')](_0x25803e);};}exports[_0x4034('0x40')]=function(_0x6893f,_0x37b4cd){var _0x165c6f={},_0x55ba16={},_0x4b880b={'count':0x0,'rows':[]};var _0x56c994=_[_0x4034('0x41')](db['ChatMessage'][_0x4034('0x42')],function(_0x254bdb){return{'name':_0x254bdb[_0x4034('0x43')],'type':_0x254bdb[_0x4034('0x44')][_0x4034('0x45')]};});_0x55ba16['model']=_[_0x4034('0x41')](_0x56c994,_0x4034('0x3e'));_0x55ba16[_0x4034('0x46')]=_[_0x4034('0x47')](_0x6893f[_0x4034('0x46')]);_0x55ba16[_0x4034('0x48')]=_[_0x4034('0x49')](_0x55ba16[_0x4034('0x4a')],_0x55ba16[_0x4034('0x46')]);_0x165c6f[_0x4034('0x4b')]=_[_0x4034('0x49')](_0x55ba16[_0x4034('0x4a')],qs[_0x4034('0x4c')](_0x6893f[_0x4034('0x46')][_0x4034('0x4c')]));_0x165c6f['attributes']=_0x165c6f[_0x4034('0x4b')]['length']?_0x165c6f[_0x4034('0x4b')]:_0x55ba16[_0x4034('0x4a')];if(!_0x6893f[_0x4034('0x46')]['hasOwnProperty'](_0x4034('0x4d'))){_0x165c6f[_0x4034('0x35')]=qs['limit'](_0x6893f[_0x4034('0x46')][_0x4034('0x35')]);_0x165c6f[_0x4034('0x32')]=qs[_0x4034('0x32')](_0x6893f[_0x4034('0x46')][_0x4034('0x32')]);}_0x165c6f['order']=qs[_0x4034('0x4e')](_0x6893f[_0x4034('0x46')][_0x4034('0x4e')]);_0x165c6f[_0x4034('0x4f')]=qs[_0x4034('0x48')](_[_0x4034('0x50')](_0x6893f[_0x4034('0x46')],_0x55ba16[_0x4034('0x48')]),_0x56c994);if(_0x6893f[_0x4034('0x46')][_0x4034('0x51')]){_0x165c6f[_0x4034('0x4f')]=_[_0x4034('0x52')](_0x165c6f[_0x4034('0x4f')],{'$or':_[_0x4034('0x41')](_0x56c994,function(_0x1637bc){if(_0x1637bc['type']!==_0x4034('0x53')){var _0x1e7293={};_0x1e7293[_0x1637bc[_0x4034('0x3e')]]={'$like':'%'+_0x6893f[_0x4034('0x46')][_0x4034('0x51')]+'%'};return _0x1e7293;}})});}_0x165c6f=_[_0x4034('0x52')]({},_0x165c6f,_0x6893f[_0x4034('0x54')]);var _0x4a1b14={'where':_0x165c6f[_0x4034('0x4f')]};return db[_0x4034('0x55')][_0x4034('0x34')](_0x4a1b14)['then'](function(_0xa93fed){_0x4b880b[_0x4034('0x34')]=_0xa93fed;if(_0x6893f[_0x4034('0x46')]['includeAll']){_0x165c6f['include']=[{'all':!![]}];}return db[_0x4034('0x55')]['findAll'](_0x165c6f);})['then'](function(_0x52f43b){_0x4b880b[_0x4034('0x56')]=_0x52f43b;return _0x4b880b;})[_0x4034('0x24')](respondWithFilteredResult(_0x37b4cd,_0x165c6f))[_0x4034('0x2d')](handleError(_0x37b4cd,null));};exports[_0x4034('0x57')]=function(_0x3a59a8,_0x34ce2b){var _0x520005={'raw':!![],'where':{'id':_0x3a59a8[_0x4034('0x58')]['id']}},_0x15fd76={};_0x15fd76[_0x4034('0x4a')]=_['keys'](db[_0x4034('0x55')][_0x4034('0x42')]);_0x15fd76['query']=_[_0x4034('0x47')](_0x3a59a8['query']);_0x15fd76[_0x4034('0x48')]=_['intersection'](_0x15fd76[_0x4034('0x4a')],_0x15fd76[_0x4034('0x46')]);_0x520005['attributes']=_[_0x4034('0x49')](_0x15fd76[_0x4034('0x4a')],qs['fields'](_0x3a59a8[_0x4034('0x46')]['fields']));_0x520005['attributes']=_0x520005[_0x4034('0x4b')]['length']?_0x520005[_0x4034('0x4b')]:_0x15fd76[_0x4034('0x4a')];if(_0x3a59a8[_0x4034('0x46')][_0x4034('0x59')]){_0x520005['include']=[{'all':!![]}];}_0x520005=_[_0x4034('0x52')]({},_0x520005,_0x3a59a8['options']);return db[_0x4034('0x55')][_0x4034('0x5a')](_0x520005)[_0x4034('0x24')](handleEntityNotFound(_0x34ce2b,null))[_0x4034('0x24')](respondWithResult(_0x34ce2b,null))[_0x4034('0x2d')](handleError(_0x34ce2b,null));};exports['create']=function(_0x279797,_0x1fce51){return db[_0x4034('0x55')][_0x4034('0x5b')](_0x279797[_0x4034('0x5c')],{})[_0x4034('0x24')](respondWithResult(_0x1fce51,0xc9))['catch'](handleError(_0x1fce51,null));};exports[_0x4034('0x3b')]=function(_0x505982,_0x437c61){if(_0x505982['body']['id']){delete _0x505982[_0x4034('0x5c')]['id'];}return db[_0x4034('0x55')][_0x4034('0x5a')]({'where':{'id':_0x505982[_0x4034('0x58')]['id']}})[_0x4034('0x24')](handleEntityNotFound(_0x437c61,null))[_0x4034('0x24')](saveUpdates(_0x505982['body'],null))['then'](respondWithResult(_0x437c61,null))['catch'](handleError(_0x437c61,null));};exports['destroy']=function(_0x442145,_0x35aee5){return db['ChatMessage'][_0x4034('0x5a')]({'where':{'id':_0x442145[_0x4034('0x58')]['id']}})[_0x4034('0x24')](handleEntityNotFound(_0x35aee5,null))[_0x4034('0x24')](removeEntity(_0x35aee5,null))[_0x4034('0x2d')](handleError(_0x35aee5,null));};exports[_0x4034('0x5d')]=function(_0x1cc3de,_0x45f36e){return db[_0x4034('0x55')][_0x4034('0x5d')]()[_0x4034('0x24')](respondWithResult(_0x45f36e,null))['catch'](handleError(_0x45f36e,null));};var interaction_log=require(_0x4034('0x14'))('chat-interactions');exports[_0x4034('0x5e')]=function(_0x2f4992,_0x166e46,_0xaf61c6){var _0x55207d={'agent':{},'channel':'chat'};if(_0x2f4992[_0x4034('0x5c')]['id']){delete _0x2f4992[_0x4034('0x5c')]['id'];}_0x2f4992[_0x4034('0x5c')][_0x4034('0x5f')]=!![];_0x2f4992[_0x4034('0x5c')]['readAt']=moment()[_0x4034('0x60')](_0x4034('0x61'));_0x2f4992[_0x4034('0x5c')][_0x4034('0x62')]=_0x2f4992['body'][_0x4034('0x62')]||_0x2f4992['user']['id'];_0x55207d['agent']['id']=_0x2f4992[_0x4034('0x5c')][_0x4034('0x62')];return db[_0x4034('0x55')][_0x4034('0x5a')]({'where':{'id':_0x2f4992[_0x4034('0x58')]['id'],'UserId':null}})[_0x4034('0x24')](handleEntityNotFound(_0x166e46,null))['then'](saveUpdates(_0x2f4992[_0x4034('0x5c')],null))[_0x4034('0x24')](function(_0x424f77){if(_0x424f77){_0x55207d[_0x4034('0x2b')]=_0x424f77[_0x4034('0x63')]({'plain':!![]});return db[_0x4034('0x64')]['find']({'where':{'id':_0x424f77[_0x4034('0x65')]}});}return null;})[_0x4034('0x24')](handleEntityNotFound(_0x166e46,null))[_0x4034('0x24')](function(_0xe190e1){if(_0xe190e1){return _0xe190e1[_0x4034('0x3b')]({'UserId':_0x2f4992[_0x4034('0x5c')][_0x4034('0x62')],'read1stAt':_[_0x4034('0x66')](_0xe190e1['read1stAt'])?moment()[_0x4034('0x60')](_0x4034('0x61')):undefined});}return null;})['then'](function(_0x392138){if(_0x392138){_0x55207d[_0x4034('0x67')]=_0x392138['get']({'plain':!![]});interaction_log[_0x4034('0x68')](_0x4034('0x69'),_0x2f4992[_0x4034('0x6a')]['id'],_0x2f4992[_0x4034('0x6a')]['name'],_0x2f4992[_0x4034('0x6a')][_0x4034('0x6b')],_0x55207d[_0x4034('0x67')]['id'],_0x2f4992[_0x4034('0x5c')]?JSON[_0x4034('0x28')](_0x2f4992[_0x4034('0x5c')]):_0x4034('0x6c'));return respondWithRpcPromise('AcceptMessage',_0x4034('0x6d'),_0x55207d);}return null;})[_0x4034('0x24')](function(_0x2c3bca){var _0x238044=_0x4034('0x6e')+_0x2c3bca['message'][_0x4034('0x6f')];return db[_0x4034('0x70')][_0x4034('0x46')](_0x238044,{'type':db[_0x4034('0x71')][_0x4034('0x72')][_0x4034('0x73')],'raw':!![]})[_0x4034('0x24')](function(_0x4fc2f1){return _0x4fc2f1;});})['then'](function(_0x2eda65){if(_0x2eda65){_0x55207d[_0x4034('0x2b')][_0x4034('0x74')]=_0x2eda65[0x0];if(!_0x2f4992['body'][_0x4034('0x62')])return;return db[_0x4034('0x75')][_0x4034('0x5a')]({'where':{'id':_0x2f4992[_0x4034('0x5c')][_0x4034('0x62')],'role':_0x4034('0x76')},'attributes':['id',_0x4034('0x3e'),_0x4034('0x77'),'email',_0x4034('0x78')],'raw':!![]});}return null;})['then'](function(_0xba6ee6){if(!_0xba6ee6)return null;_0x55207d[_0x4034('0x2b')][_0x4034('0x76')]=_0xba6ee6;return _0x55207d;})[_0x4034('0x24')](function(_0x480987){if(_0x480987){if(_0x2f4992['body']['manual']){_0x55207d[_0x4034('0x2b')]['interface']=util[_0x4034('0x60')](_0x4034('0x79'),_0x2f4992[_0x4034('0x6a')]['name']);_0x55207d[_0x4034('0x2b')][_0x4034('0x7a')]=_0x55207d[_0x4034('0x7a')];_0x55207d[_0x4034('0x2b')][_0x4034('0x7b')]=_0x55207d[_0x4034('0x7a')];_0x55207d[_0x4034('0x2b')][_0x4034('0x7c')]=_0x4034('0x5e');return respondWithRpcPromise(_0x4034('0x7d'),_0x4034('0x7d'),{'event':_0x4034('0x7e'),'message':_[_0x4034('0x52')](_0x55207d[_0x4034('0x2b')],JSON[_0x4034('0x7f')](_0x55207d['interaction'][_0x4034('0x80')]))},client9002)['then'](function(){return _0x55207d;});}return _0x55207d;}return null;})['then'](respondWithResult(_0x166e46,null))[_0x4034('0x2d')](handleError(_0x166e46,null));};var interaction_log=require(_0x4034('0x14'))(_0x4034('0x81'));exports[_0x4034('0x39')]=function(_0x5c174a,_0x5a8f39,_0x34eea4){var _0x5c5d48={'agent':{},'channel':_0x4034('0x82')};if(_0x5c174a[_0x4034('0x5c')]['id']){delete _0x5c174a[_0x4034('0x5c')]['id'];}_0x5c174a[_0x4034('0x5c')]['UserId']=_0x5c174a[_0x4034('0x5c')]['UserId']||_0x5c174a['user']['id'];_0x5c5d48[_0x4034('0x76')]['id']=_0x5c174a[_0x4034('0x5c')][_0x4034('0x62')];return db['ChatMessage']['find']({'where':{'id':_0x5c174a[_0x4034('0x58')]['id'],'UserId':null}})[_0x4034('0x24')](handleEntityNotFound(_0x5a8f39,null))['then'](function(_0xb5cf2b){if(_0xb5cf2b){_0x5c5d48[_0x4034('0x2b')]=_0xb5cf2b[_0x4034('0x63')]({'plain':!![]});return db[_0x4034('0x64')][_0x4034('0x5a')]({'where':{'id':_0xb5cf2b[_0x4034('0x65')]}});}return null;})[_0x4034('0x24')](handleEntityNotFound(_0x5a8f39,null))[_0x4034('0x24')](function(_0x2c0cbf){if(_0x2c0cbf){_0x5c5d48[_0x4034('0x67')]=_0x2c0cbf['get']({'plain':!![]});interaction_log['info'](_0x4034('0x83'),_0x5c174a[_0x4034('0x6a')]['id'],_0x5c174a[_0x4034('0x6a')]['name'],_0x5c174a[_0x4034('0x6a')]['role'],_0x5c5d48[_0x4034('0x67')]['id'],_0x5c174a[_0x4034('0x5c')]?JSON[_0x4034('0x28')](_0x5c174a[_0x4034('0x5c')]):'null');return respondWithRpcPromise(_0x4034('0x84'),_0x4034('0x85'),_0x5c5d48);}return null;})['then'](function(_0x577581){var _0x870706=_0x4034('0x6e')+_0x577581[_0x4034('0x2b')][_0x4034('0x6f')];return db['sequelize'][_0x4034('0x46')](_0x870706,{'type':db[_0x4034('0x71')]['QueryTypes']['SELECT'],'raw':!![]})[_0x4034('0x24')](function(_0x9b9d74){return _0x9b9d74;});})[_0x4034('0x24')](function(_0x540a26){if(_0x540a26){_0x5c5d48[_0x4034('0x2b')][_0x4034('0x74')]=_0x540a26[0x0];if(!_0x5c174a[_0x4034('0x5c')][_0x4034('0x62')])return;return db[_0x4034('0x75')]['find']({'where':{'id':_0x5c174a[_0x4034('0x5c')][_0x4034('0x62')],'role':_0x4034('0x76')},'attributes':['id',_0x4034('0x3e'),_0x4034('0x77'),_0x4034('0x86'),_0x4034('0x78')],'raw':!![]});}return null;})[_0x4034('0x24')](function(_0x4192bf){if(!_0x4192bf)return null;_0x5c5d48[_0x4034('0x2b')]['agent']=_0x4192bf;return _0x5c5d48;})[_0x4034('0x24')](function(_0x395598){if(_0x395598){_0x395598[_0x4034('0x2b')][_0x4034('0x87')]=util[_0x4034('0x60')](_0x4034('0x79'),_0x5c174a[_0x4034('0x6a')]['name']);_0x395598[_0x4034('0x2b')]['channel']=_0x5c5d48[_0x4034('0x7a')];_0x395598[_0x4034('0x2b')][_0x4034('0x7b')]=_0x5c5d48[_0x4034('0x7a')];_0x395598[_0x4034('0x2b')][_0x4034('0x7c')]=_0x4034('0x39');respondWithRpcPromise(_0x4034('0x7d'),_0x4034('0x7d'),{'event':_0x4034('0x88'),'message':_[_0x4034('0x52')](_0x5c5d48[_0x4034('0x2b')],JSON[_0x4034('0x7f')](_0x5c5d48[_0x4034('0x67')][_0x4034('0x80')]))},client9002);return _0x5c5d48;}return null;})['then'](respondWithResult(_0x5a8f39,null))[_0x4034('0x2d')](handleError(_0x5a8f39,null));}; \ No newline at end of file +var _0x5b34=['attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','ChatMessage','include','rows','show','params','length','includeAll','create','body','find','describe','../../config/logger','chat','read','UserId','user','agent','get','format','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','email','internal','manual','interface','channel','motionChannel','event','accept','EventManager','acceptmessage','parse','formData','chat-interactions','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','fullname','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','end','sendStatus','name','send','map','rawAttributes','fieldName','key','model','keys','query','intersection'];(function(_0x3f85b0,_0x88efeb){var _0x2489e2=function(_0x26397a){while(--_0x26397a){_0x3f85b0['push'](_0x3f85b0['shift']());}};_0x2489e2(++_0x88efeb);}(_0x5b34,0x13a));var _0x45b3=function(_0x5056f8,_0x37ec78){_0x5056f8=_0x5056f8-0x0;var _0x3f4532=_0x5b34[_0x5056f8];return _0x3f4532;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x45b3('0x0'));var zipdir=require(_0x45b3('0x1'));var jsonpatch=require(_0x45b3('0x2'));var rp=require(_0x45b3('0x3'));var moment=require('moment');var BPromise=require(_0x45b3('0x4'));var Mustache=require(_0x45b3('0x5'));var util=require('util');var path=require(_0x45b3('0x6'));var sox=require(_0x45b3('0x7'));var csv=require(_0x45b3('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x45b3('0x9'));var _=require(_0x45b3('0xa'));var squel=require(_0x45b3('0xb'));var crypto=require(_0x45b3('0xc'));var jsforce=require(_0x45b3('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x45b3('0x8'));var querystring=require(_0x45b3('0xe'));var Papa=require('papaparse');var Redis=require(_0x45b3('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x45b3('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x45b3('0x11'));var logger=require('../../config/logger')(_0x45b3('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x45b3('0x13'));var db=require(_0x45b3('0x14'))['db'];config[_0x45b3('0x15')]=_[_0x45b3('0x16')](config[_0x45b3('0x15')],{'host':_0x45b3('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x45b3('0x15')]));require(_0x45b3('0x18'))[_0x45b3('0x19')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36d0e7,_0x382c1d,_0x39e20c,_0x2f6ec8){return new BPromise(function(_0x92e3f3,_0xfdaacc){var _0x14d495=_0x2f6ec8||client;return _0x14d495[_0x45b3('0x1a')](_0x36d0e7,_0x39e20c)[_0x45b3('0x1b')](function(_0x5dd6e7){logger[_0x45b3('0x1c')](_0x45b3('0x1d'),_0x382c1d,_0x45b3('0x1e'));logger[_0x45b3('0x1f')](_0x45b3('0x20'),_0x382c1d,_0x45b3('0x1e'),JSON[_0x45b3('0x21')](_0x5dd6e7));if(_0x5dd6e7[_0x45b3('0x22')]){if(_0x5dd6e7[_0x45b3('0x22')][_0x45b3('0x23')]===0x1f4){logger[_0x45b3('0x22')](_0x45b3('0x1d'),_0x382c1d,_0x5dd6e7['error'][_0x45b3('0x24')]);return _0xfdaacc(_0x5dd6e7[_0x45b3('0x22')][_0x45b3('0x24')]);}logger[_0x45b3('0x22')]('ChatMessage,\x20%s,\x20%s',_0x382c1d,_0x5dd6e7['error'][_0x45b3('0x24')]);return _0x92e3f3(_0x5dd6e7[_0x45b3('0x22')]['message']);}else{logger[_0x45b3('0x1c')](_0x45b3('0x1d'),_0x382c1d,_0x45b3('0x1e'));_0x92e3f3(_0x5dd6e7[_0x45b3('0x25')]['message']);}})[_0x45b3('0x26')](function(_0x461486){logger[_0x45b3('0x22')](_0x45b3('0x1d'),_0x382c1d,_0x461486);_0xfdaacc(_0x461486);});});}function respondWithStatusCode(_0x5d6aae,_0x1eff45){_0x1eff45=_0x1eff45||0xcc;return function(_0x2c4d7a){if(_0x2c4d7a){return _0x5d6aae['sendStatus'](_0x1eff45);}return _0x5d6aae[_0x45b3('0x27')](_0x1eff45)['end']();};}function respondWithResult(_0x4de542,_0x3d7d41){_0x3d7d41=_0x3d7d41||0xc8;return function(_0x17be4c){if(_0x17be4c){return _0x4de542[_0x45b3('0x27')](_0x3d7d41)['json'](_0x17be4c);}};}function respondWithFilteredResult(_0x33ad21,_0x1ebce2){return function(_0x4534db){if(_0x4534db){var _0x2ab7d4=typeof _0x1ebce2[_0x45b3('0x28')]===_0x45b3('0x29')&&typeof _0x1ebce2[_0x45b3('0x2a')]==='undefined';var _0x35e866=_0x4534db[_0x45b3('0x2b')];var _0x1857c9=_0x2ab7d4?0x0:_0x1ebce2[_0x45b3('0x28')];var _0xde9172=_0x2ab7d4?_0x4534db['count']:_0x1ebce2[_0x45b3('0x28')]+_0x1ebce2[_0x45b3('0x2a')];var _0x2fc0fe;if(_0xde9172>=_0x35e866){_0xde9172=_0x35e866;_0x2fc0fe=0xc8;}else{_0x2fc0fe=0xce;}_0x33ad21[_0x45b3('0x27')](_0x2fc0fe);return _0x33ad21[_0x45b3('0x2c')](_0x45b3('0x2d'),_0x1857c9+'-'+_0xde9172+'/'+_0x35e866)[_0x45b3('0x2e')](_0x4534db);}return null;};}function patchUpdates(_0x29b553){return function(_0x18e8a4){try{jsonpatch[_0x45b3('0x2f')](_0x18e8a4,_0x29b553,!![]);}catch(_0x1069eb){return BPromise[_0x45b3('0x30')](_0x1069eb);}return _0x18e8a4[_0x45b3('0x31')]();};}function saveUpdates(_0xe91204,_0x4e9581){return function(_0x51bce1){if(_0x51bce1){return _0x51bce1[_0x45b3('0x32')](_0xe91204)[_0x45b3('0x1b')](function(_0x1f0d79){return _0x1f0d79;});}return null;};}function removeEntity(_0x15362f,_0x1ba5e3){return function(_0x36eb3f){if(_0x36eb3f){return _0x36eb3f[_0x45b3('0x33')]()[_0x45b3('0x1b')](function(){_0x15362f[_0x45b3('0x27')](0xcc)[_0x45b3('0x34')]();});}};}function handleEntityNotFound(_0x55a4ac,_0x263f7a){return function(_0x68ebe8){if(!_0x68ebe8){_0x55a4ac[_0x45b3('0x35')](0x194);}return _0x68ebe8;};}function handleError(_0x4005fc,_0x2d09e4){_0x2d09e4=_0x2d09e4||0x1f4;return function(_0x41778d){logger[_0x45b3('0x22')](_0x41778d['stack']);if(_0x41778d['name']){delete _0x41778d[_0x45b3('0x36')];}_0x4005fc[_0x45b3('0x27')](_0x2d09e4)[_0x45b3('0x37')](_0x41778d);};}exports['index']=function(_0x22b376,_0x247491){var _0xc776a2={},_0x208c4d={},_0x21dadc={'count':0x0,'rows':[]};var _0x5b4855=_[_0x45b3('0x38')](db['ChatMessage'][_0x45b3('0x39')],function(_0x4de599){return{'name':_0x4de599[_0x45b3('0x3a')],'type':_0x4de599['type'][_0x45b3('0x3b')]};});_0x208c4d[_0x45b3('0x3c')]=_[_0x45b3('0x38')](_0x5b4855,_0x45b3('0x36'));_0x208c4d['query']=_[_0x45b3('0x3d')](_0x22b376[_0x45b3('0x3e')]);_0x208c4d['filters']=_[_0x45b3('0x3f')](_0x208c4d[_0x45b3('0x3c')],_0x208c4d['query']);_0xc776a2[_0x45b3('0x40')]=_['intersection'](_0x208c4d[_0x45b3('0x3c')],qs[_0x45b3('0x41')](_0x22b376['query'][_0x45b3('0x41')]));_0xc776a2[_0x45b3('0x40')]=_0xc776a2[_0x45b3('0x40')]['length']?_0xc776a2[_0x45b3('0x40')]:_0x208c4d[_0x45b3('0x3c')];if(!_0x22b376['query'][_0x45b3('0x42')](_0x45b3('0x43'))){_0xc776a2[_0x45b3('0x2a')]=qs[_0x45b3('0x2a')](_0x22b376[_0x45b3('0x3e')][_0x45b3('0x2a')]);_0xc776a2[_0x45b3('0x28')]=qs[_0x45b3('0x28')](_0x22b376[_0x45b3('0x3e')][_0x45b3('0x28')]);}_0xc776a2[_0x45b3('0x44')]=qs[_0x45b3('0x45')](_0x22b376[_0x45b3('0x3e')]['sort']);_0xc776a2[_0x45b3('0x46')]=qs['filters'](_[_0x45b3('0x47')](_0x22b376['query'],_0x208c4d['filters']),_0x5b4855);if(_0x22b376[_0x45b3('0x3e')][_0x45b3('0x48')]){_0xc776a2['where']=_[_0x45b3('0x49')](_0xc776a2[_0x45b3('0x46')],{'$or':_[_0x45b3('0x38')](_0x5b4855,function(_0x5c9483){if(_0x5c9483[_0x45b3('0x4a')]!==_0x45b3('0x4b')){var _0x35bd60={};_0x35bd60[_0x5c9483[_0x45b3('0x36')]]={'$like':'%'+_0x22b376['query'][_0x45b3('0x48')]+'%'};return _0x35bd60;}})});}_0xc776a2=_['merge']({},_0xc776a2,_0x22b376[_0x45b3('0x4c')]);var _0x5a75cf={'where':_0xc776a2['where']};return db[_0x45b3('0x4d')][_0x45b3('0x2b')](_0x5a75cf)[_0x45b3('0x1b')](function(_0x3a4647){_0x21dadc['count']=_0x3a4647;if(_0x22b376[_0x45b3('0x3e')]['includeAll']){_0xc776a2[_0x45b3('0x4e')]=[{'all':!![]}];}return db[_0x45b3('0x4d')]['findAll'](_0xc776a2);})['then'](function(_0x1943fc){_0x21dadc[_0x45b3('0x4f')]=_0x1943fc;return _0x21dadc;})[_0x45b3('0x1b')](respondWithFilteredResult(_0x247491,_0xc776a2))[_0x45b3('0x26')](handleError(_0x247491,null));};exports[_0x45b3('0x50')]=function(_0x1ebae4,_0x21ff7c){var _0x15abb7={'raw':!![],'where':{'id':_0x1ebae4[_0x45b3('0x51')]['id']}},_0x5ebf38={};_0x5ebf38[_0x45b3('0x3c')]=_[_0x45b3('0x3d')](db[_0x45b3('0x4d')][_0x45b3('0x39')]);_0x5ebf38[_0x45b3('0x3e')]=_[_0x45b3('0x3d')](_0x1ebae4[_0x45b3('0x3e')]);_0x5ebf38['filters']=_[_0x45b3('0x3f')](_0x5ebf38[_0x45b3('0x3c')],_0x5ebf38[_0x45b3('0x3e')]);_0x15abb7[_0x45b3('0x40')]=_[_0x45b3('0x3f')](_0x5ebf38[_0x45b3('0x3c')],qs[_0x45b3('0x41')](_0x1ebae4['query'][_0x45b3('0x41')]));_0x15abb7[_0x45b3('0x40')]=_0x15abb7['attributes'][_0x45b3('0x52')]?_0x15abb7[_0x45b3('0x40')]:_0x5ebf38[_0x45b3('0x3c')];if(_0x1ebae4[_0x45b3('0x3e')][_0x45b3('0x53')]){_0x15abb7[_0x45b3('0x4e')]=[{'all':!![]}];}_0x15abb7=_[_0x45b3('0x49')]({},_0x15abb7,_0x1ebae4[_0x45b3('0x4c')]);return db['ChatMessage']['find'](_0x15abb7)[_0x45b3('0x1b')](handleEntityNotFound(_0x21ff7c,null))[_0x45b3('0x1b')](respondWithResult(_0x21ff7c,null))['catch'](handleError(_0x21ff7c,null));};exports[_0x45b3('0x54')]=function(_0x4f1494,_0x41aab1){return db[_0x45b3('0x4d')][_0x45b3('0x54')](_0x4f1494[_0x45b3('0x55')],{})['then'](respondWithResult(_0x41aab1,0xc9))[_0x45b3('0x26')](handleError(_0x41aab1,null));};exports[_0x45b3('0x32')]=function(_0x20b227,_0xff5b69){if(_0x20b227[_0x45b3('0x55')]['id']){delete _0x20b227[_0x45b3('0x55')]['id'];}return db[_0x45b3('0x4d')][_0x45b3('0x56')]({'where':{'id':_0x20b227[_0x45b3('0x51')]['id']}})['then'](handleEntityNotFound(_0xff5b69,null))[_0x45b3('0x1b')](saveUpdates(_0x20b227['body'],null))[_0x45b3('0x1b')](respondWithResult(_0xff5b69,null))[_0x45b3('0x26')](handleError(_0xff5b69,null));};exports[_0x45b3('0x33')]=function(_0x4b8a6c,_0x577353){return db[_0x45b3('0x4d')]['find']({'where':{'id':_0x4b8a6c[_0x45b3('0x51')]['id']}})[_0x45b3('0x1b')](handleEntityNotFound(_0x577353,null))['then'](removeEntity(_0x577353,null))[_0x45b3('0x26')](handleError(_0x577353,null));};exports[_0x45b3('0x57')]=function(_0x17bef8,_0x19efa4){return db[_0x45b3('0x4d')]['describe']()['then'](respondWithResult(_0x19efa4,null))[_0x45b3('0x26')](handleError(_0x19efa4,null));};var interaction_log=require(_0x45b3('0x58'))('chat-interactions');exports['accept']=function(_0x217569,_0x52e395,_0x27dfa5){var _0xaa77b0={'agent':{},'channel':_0x45b3('0x59')};if(_0x217569[_0x45b3('0x55')]['id']){delete _0x217569[_0x45b3('0x55')]['id'];}_0x217569['body'][_0x45b3('0x5a')]=!![];_0x217569[_0x45b3('0x55')]['readAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x217569[_0x45b3('0x55')][_0x45b3('0x5b')]=_0x217569['body'][_0x45b3('0x5b')]||_0x217569[_0x45b3('0x5c')]['id'];_0xaa77b0[_0x45b3('0x5d')]['id']=_0x217569[_0x45b3('0x55')][_0x45b3('0x5b')];return db[_0x45b3('0x4d')][_0x45b3('0x56')]({'where':{'id':_0x217569[_0x45b3('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x52e395,null))[_0x45b3('0x1b')](saveUpdates(_0x217569[_0x45b3('0x55')],null))['then'](function(_0x322010){if(_0x322010){_0xaa77b0[_0x45b3('0x24')]=_0x322010[_0x45b3('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0x45b3('0x56')]({'where':{'id':_0x322010['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x52e395,null))['then'](function(_0x4cbbb3){if(_0x4cbbb3){return _0x4cbbb3[_0x45b3('0x32')]({'UserId':_0x217569[_0x45b3('0x55')][_0x45b3('0x5b')],'read1stAt':_['isNil'](_0x4cbbb3['read1stAt'])?moment()[_0x45b3('0x5f')](_0x45b3('0x60')):undefined});}return null;})['then'](function(_0x290f72){if(_0x290f72){_0xaa77b0[_0x45b3('0x61')]=_0x290f72['get']({'plain':!![]});interaction_log['info'](_0x45b3('0x62'),_0x217569[_0x45b3('0x5c')]['id'],_0x217569[_0x45b3('0x5c')][_0x45b3('0x36')],_0x217569['user'][_0x45b3('0x63')],_0xaa77b0[_0x45b3('0x61')]['id'],_0x217569[_0x45b3('0x55')]?JSON[_0x45b3('0x21')](_0x217569[_0x45b3('0x55')]):_0x45b3('0x64'));return respondWithRpcPromise(_0x45b3('0x65'),'acceptMessage',_0xaa77b0);}return null;})[_0x45b3('0x1b')](function(_0x1f0533){var _0x3bba4d=_0x45b3('0x66')+_0x1f0533['message'][_0x45b3('0x67')];return db[_0x45b3('0x68')]['query'](_0x3bba4d,{'type':db[_0x45b3('0x69')][_0x45b3('0x6a')][_0x45b3('0x6b')],'raw':!![]})[_0x45b3('0x1b')](function(_0x2af102){return _0x2af102;});})['then'](function(_0x4c3948){if(_0x4c3948){_0xaa77b0[_0x45b3('0x24')][_0x45b3('0x6c')]=_0x4c3948[0x0];if(!_0x217569['body'][_0x45b3('0x5b')])return;return db[_0x45b3('0x6d')][_0x45b3('0x56')]({'where':{'id':_0x217569[_0x45b3('0x55')][_0x45b3('0x5b')],'role':_0x45b3('0x5d')},'attributes':['id','name','fullname',_0x45b3('0x6e'),_0x45b3('0x6f')],'raw':!![]});}return null;})[_0x45b3('0x1b')](function(_0x3d03ea){if(!_0x3d03ea)return null;_0xaa77b0['message'][_0x45b3('0x5d')]=_0x3d03ea;return _0xaa77b0;})[_0x45b3('0x1b')](function(_0x41cb61){if(_0x41cb61){if(_0x217569['body'][_0x45b3('0x70')]){_0xaa77b0[_0x45b3('0x24')][_0x45b3('0x71')]=util[_0x45b3('0x5f')]('SIP/%s',_0x217569[_0x45b3('0x5c')][_0x45b3('0x36')]);_0xaa77b0['message'][_0x45b3('0x72')]=_0xaa77b0[_0x45b3('0x72')];_0xaa77b0[_0x45b3('0x24')][_0x45b3('0x73')]=_0xaa77b0['channel'];_0xaa77b0[_0x45b3('0x24')][_0x45b3('0x74')]=_0x45b3('0x75');return respondWithRpcPromise(_0x45b3('0x76'),_0x45b3('0x76'),{'event':_0x45b3('0x77'),'message':_[_0x45b3('0x49')](_0xaa77b0['message'],JSON[_0x45b3('0x78')](_0xaa77b0[_0x45b3('0x61')][_0x45b3('0x79')]))},client9002)[_0x45b3('0x1b')](function(){return _0xaa77b0;});}return _0xaa77b0;}return null;})[_0x45b3('0x1b')](respondWithResult(_0x52e395,null))[_0x45b3('0x26')](handleError(_0x52e395,null));};var interaction_log=require(_0x45b3('0x58'))(_0x45b3('0x7a'));exports[_0x45b3('0x30')]=function(_0x1658f1,_0x512d14,_0xc61ef0){var _0x5aa96b={'agent':{},'channel':_0x45b3('0x59')};if(_0x1658f1[_0x45b3('0x55')]['id']){delete _0x1658f1[_0x45b3('0x55')]['id'];}_0x1658f1[_0x45b3('0x55')][_0x45b3('0x5b')]=_0x1658f1[_0x45b3('0x55')][_0x45b3('0x5b')]||_0x1658f1['user']['id'];_0x5aa96b['agent']['id']=_0x1658f1[_0x45b3('0x55')][_0x45b3('0x5b')];return db[_0x45b3('0x4d')]['find']({'where':{'id':_0x1658f1[_0x45b3('0x51')]['id'],'UserId':null}})[_0x45b3('0x1b')](handleEntityNotFound(_0x512d14,null))[_0x45b3('0x1b')](function(_0x3b4ca3){if(_0x3b4ca3){_0x5aa96b[_0x45b3('0x24')]=_0x3b4ca3[_0x45b3('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0x45b3('0x56')]({'where':{'id':_0x3b4ca3[_0x45b3('0x7b')]}});}return null;})[_0x45b3('0x1b')](handleEntityNotFound(_0x512d14,null))[_0x45b3('0x1b')](function(_0x32ec45){if(_0x32ec45){_0x5aa96b[_0x45b3('0x61')]=_0x32ec45[_0x45b3('0x5e')]({'plain':!![]});interaction_log[_0x45b3('0x1c')](_0x45b3('0x7c'),_0x1658f1['user']['id'],_0x1658f1[_0x45b3('0x5c')][_0x45b3('0x36')],_0x1658f1[_0x45b3('0x5c')][_0x45b3('0x63')],_0x5aa96b[_0x45b3('0x61')]['id'],_0x1658f1[_0x45b3('0x55')]?JSON[_0x45b3('0x21')](_0x1658f1['body']):_0x45b3('0x64'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x5aa96b);}return null;})[_0x45b3('0x1b')](function(_0x50daf5){var _0x2f3e1e=_0x45b3('0x66')+_0x50daf5[_0x45b3('0x24')][_0x45b3('0x67')];return db[_0x45b3('0x68')]['query'](_0x2f3e1e,{'type':db[_0x45b3('0x69')][_0x45b3('0x6a')][_0x45b3('0x6b')],'raw':!![]})[_0x45b3('0x1b')](function(_0x4aa05a){return _0x4aa05a;});})[_0x45b3('0x1b')](function(_0x21af2e){if(_0x21af2e){_0x5aa96b['message'][_0x45b3('0x6c')]=_0x21af2e[0x0];if(!_0x1658f1[_0x45b3('0x55')][_0x45b3('0x5b')])return;return db[_0x45b3('0x6d')][_0x45b3('0x56')]({'where':{'id':_0x1658f1['body'][_0x45b3('0x5b')],'role':_0x45b3('0x5d')},'attributes':['id',_0x45b3('0x36'),_0x45b3('0x7d'),'email',_0x45b3('0x6f')],'raw':!![]});}return null;})[_0x45b3('0x1b')](function(_0x520298){if(!_0x520298)return null;_0x5aa96b[_0x45b3('0x24')][_0x45b3('0x5d')]=_0x520298;return _0x5aa96b;})[_0x45b3('0x1b')](function(_0xf9d58b){if(_0xf9d58b){_0xf9d58b[_0x45b3('0x24')]['interface']=util['format']('SIP/%s',_0x1658f1[_0x45b3('0x5c')][_0x45b3('0x36')]);_0xf9d58b['message']['channel']=_0x5aa96b[_0x45b3('0x72')];_0xf9d58b['message']['motionChannel']=_0x5aa96b[_0x45b3('0x72')];_0xf9d58b[_0x45b3('0x24')][_0x45b3('0x74')]='reject';respondWithRpcPromise('EventManager',_0x45b3('0x76'),{'event':'rejectmessage','message':_[_0x45b3('0x49')](_0x5aa96b[_0x45b3('0x24')],JSON[_0x45b3('0x78')](_0x5aa96b['interaction'][_0x45b3('0x79')]))},client9002);return _0x5aa96b;}return null;})['then'](respondWithResult(_0x512d14,null))[_0x45b3('0x26')](handleError(_0x512d14,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 0b37ab4..727f5f0 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 _0xa328=['exports','events','../../mysqldb','setMaxListeners','update','remove','emit'];(function(_0x4745d9,_0x411b00){var _0x38f2ac=function(_0x436be3){while(--_0x436be3){_0x4745d9['push'](_0x4745d9['shift']());}};_0x38f2ac(++_0x411b00);}(_0xa328,0x17b));var _0x8a32=function(_0x173465,_0x3e4f73){_0x173465=_0x173465-0x0;var _0x5d3808=_0xa328[_0x173465];return _0x5d3808;};'use strict';var EventEmitter=require(_0x8a32('0x0'));var ChatMessage=require(_0x8a32('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x8a32('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8a32('0x3'),'afterDestroy':_0x8a32('0x4')};function emitEvent(_0x400f09){return function(_0x332807,_0x3d455f,_0x41d4de){ChatMessageEvents['emit'](_0x400f09+':'+_0x332807['id'],_0x332807);ChatMessageEvents[_0x8a32('0x5')](_0x400f09,_0x332807);_0x41d4de(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x8a32('0x6')]=ChatMessageEvents; \ No newline at end of file +var _0x4f69=['exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','update','emit','hook'];(function(_0x27650e,_0x278f7a){var _0x28fe08=function(_0x476eee){while(--_0x476eee){_0x27650e['push'](_0x27650e['shift']());}};_0x28fe08(++_0x278f7a);}(_0x4f69,0x91));var _0x94f6=function(_0x3dc85,_0x4f2d39){_0x3dc85=_0x3dc85-0x0;var _0x3e938e=_0x4f69[_0x3dc85];return _0x3e938e;};'use strict';var EventEmitter=require(_0x94f6('0x0'));var ChatMessage=require(_0x94f6('0x1'))['db'][_0x94f6('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x94f6('0x3')](0x0);var events={'afterCreate':_0x94f6('0x4'),'afterUpdate':_0x94f6('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1277f8){return function(_0x2f96d3,_0x44c6bf,_0x252df9){ChatMessageEvents[_0x94f6('0x6')](_0x1277f8+':'+_0x2f96d3['id'],_0x2f96d3);ChatMessageEvents[_0x94f6('0x6')](_0x1277f8,_0x2f96d3);_0x252df9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x94f6('0x7')](e,emitEvent(event));}}module[_0x94f6('0x8')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index ef66af2..d1e586c 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 _0xc99c=['../../config/environment','exports','define','chat_messages','fti_chat_messages','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','ChatInteractionId','then','createdAt','catch','error','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','path'];(function(_0xffd8b0,_0x12c51f){var _0x301ba0=function(_0x103c05){while(--_0x103c05){_0xffd8b0['push'](_0xffd8b0['shift']());}};_0x301ba0(++_0x12c51f);}(_0xc99c,0x166));var _0xcc99=function(_0x54f0e5,_0x243493){_0x54f0e5=_0x54f0e5-0x0;var _0x34f19c=_0xc99c[_0x54f0e5];return _0x34f19c;};'use strict';var _=require('lodash');var util=require(_0xcc99('0x0'));var logger=require('../../config/logger')(_0xcc99('0x1'));var moment=require(_0xcc99('0x2'));var BPromise=require(_0xcc99('0x3'));var rp=require(_0xcc99('0x4'));var fs=require('fs');var path=require(_0xcc99('0x5'));var rimraf=require('rimraf');var config=require(_0xcc99('0x6'));var attributes=require('./chatMessage.attributes');module[_0xcc99('0x7')]=function(_0x1b1941,_0x912de3){return _0x1b1941[_0xcc99('0x8')]('ChatMessage',attributes,{'tableName':_0xcc99('0x9'),'paranoid':![],'indexes':[{'name':_0xcc99('0xa'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2753a6,_0x2472a7,_0x2b9945){var _0x336c8e=_0x1b1941[_0xcc99('0xb')];var _0x2313ce=_0x2753a6[_0xcc99('0xc')]({'plain':!![]});if(_0x2313ce[_0xcc99('0xd')]['toLowerCase']()==='in'||_0x2313ce[_0xcc99('0xd')][_0xcc99('0xe')]()===_0xcc99('0xf')&&!_0x2313ce[_0xcc99('0x10')]&&!_[_0xcc99('0x11')](_0x2313ce[_0xcc99('0x12')])){_0x336c8e['ChatInteraction'][_0xcc99('0x13')]({'where':{'id':_0x2313ce[_0xcc99('0x14')]}})[_0xcc99('0x15')](function(_0x5170cd){if(_0x5170cd){_0x5170cd['update']({'lastMsgAt':_0x2313ce[_0xcc99('0x16')],'lastMsgDirection':_0x2313ce[_0xcc99('0xd')][_0xcc99('0xe')]()});}})[_0xcc99('0x17')](function(_0x5900af){console[_0xcc99('0x18')](_0x5900af);});}_0x2b9945();}},'charset':'utf8mb4','collate':_0xcc99('0x19')});}; \ No newline at end of file +var _0xb15c=['direction','toLowerCase','out','secret','UserId','ChatInteraction','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','./chatMessage.attributes','define','ChatMessage','fti_chat_messages','body','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb15c,0x15e));var _0xcb15=function(_0x973c93,_0x394bd6){_0x973c93=_0x973c93-0x0;var _0xbadd17=_0xb15c[_0x973c93];return _0xbadd17;};'use strict';var _=require('lodash');var util=require(_0xcb15('0x0'));var logger=require('../../config/logger')(_0xcb15('0x1'));var moment=require(_0xcb15('0x2'));var BPromise=require(_0xcb15('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(_0xcb15('0x4'));module['exports']=function(_0x2db3a3,_0x33ddc1){return _0x2db3a3[_0xcb15('0x5')](_0xcb15('0x6'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0xcb15('0x7'),'fields':[_0xcb15('0x8')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x49e226,_0x27bcce,_0x2b696c){var _0x38a96c=_0x2db3a3['models'];var _0x51b482=_0x49e226[_0xcb15('0x9')]({'plain':!![]});if(_0x51b482[_0xcb15('0xa')][_0xcb15('0xb')]()==='in'||_0x51b482[_0xcb15('0xa')]['toLowerCase']()===_0xcb15('0xc')&&!_0x51b482[_0xcb15('0xd')]&&!_['isNil'](_0x51b482[_0xcb15('0xe')])){_0x38a96c[_0xcb15('0xf')]['findOne']({'where':{'id':_0x51b482[_0xcb15('0x10')]}})[_0xcb15('0x11')](function(_0xd2daab){if(_0xd2daab){_0xd2daab[_0xcb15('0x12')]({'lastMsgAt':_0x51b482[_0xcb15('0x13')],'lastMsgDirection':_0x51b482[_0xcb15('0xa')]['toLowerCase']()});}})[_0xcb15('0x14')](function(_0x15ad37){console[_0xcb15('0x15')](_0x15ad37);});}_0x2b696c();}},'charset':_0xcb15('0x16'),'collate':_0xcb15('0x17')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 62f5123..4f51240 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 _0x6bb0=['stringify','error','code','message','info','result','CreateChatMessage','ChatMessage','create','options','raw','catch','lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x50798b,_0x22ccf8){var _0x4b1d26=function(_0x26107f){while(--_0x26107f){_0x50798b['push'](_0x50798b['shift']());}};_0x4b1d26(++_0x22ccf8);}(_0x6bb0,0x6f));var _0x06bb=function(_0x5012a0,_0x25c11b){_0x5012a0=_0x5012a0-0x0;var _0x37839d=_0x6bb0[_0x5012a0];return _0x37839d;};'use strict';var _=require(_0x06bb('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x06bb('0x1'));var db=require(_0x06bb('0x2'))['db'];var utils=require(_0x06bb('0x3'));var logger=require(_0x06bb('0x4'))(_0x06bb('0x5'));var config=require(_0x06bb('0x6'));var jayson=require(_0x06bb('0x7'));var client=jayson[_0x06bb('0x8')][_0x06bb('0x9')]({'port':0x232a});config[_0x06bb('0xa')]=_[_0x06bb('0xb')](config['redis'],{'host':_0x06bb('0xc'),'port':0x18eb});var socket=require(_0x06bb('0xd'))(new Redis(config[_0x06bb('0xa')]));require(_0x06bb('0xe'))[_0x06bb('0xf')](socket);function respondWithRpcPromise(_0x50459a,_0xdc19b0,_0x2eafd2){return new BPromise(function(_0x27d805,_0x306f37){return client[_0x06bb('0x10')](_0x50459a,_0x2eafd2)[_0x06bb('0x11')](function(_0x457d2f){logger['info'](_0x06bb('0x12'),_0xdc19b0,_0x06bb('0x13'));logger[_0x06bb('0x14')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0xdc19b0,_0x06bb('0x13'),JSON[_0x06bb('0x15')](_0x457d2f));if(_0x457d2f['error']){if(_0x457d2f[_0x06bb('0x16')][_0x06bb('0x17')]===0x1f4){logger[_0x06bb('0x16')]('ChatMessage,\x20%s,\x20%s',_0xdc19b0,_0x457d2f[_0x06bb('0x16')][_0x06bb('0x18')]);return _0x306f37(_0x457d2f[_0x06bb('0x16')]['message']);}logger[_0x06bb('0x16')](_0x06bb('0x12'),_0xdc19b0,_0x457d2f[_0x06bb('0x16')][_0x06bb('0x18')]);return _0x27d805(_0x457d2f['error'][_0x06bb('0x18')]);}else{logger[_0x06bb('0x19')]('ChatMessage,\x20%s,\x20%s',_0xdc19b0,'request\x20sent');_0x27d805(_0x457d2f[_0x06bb('0x1a')][_0x06bb('0x18')]);}})['catch'](function(_0x422043){logger[_0x06bb('0x16')](_0x06bb('0x12'),_0xdc19b0,_0x422043);_0x306f37(_0x422043);});});}exports[_0x06bb('0x1b')]=function(_0x4e0014){var _0x2306cf=this;return new Promise(function(_0x3c1d54,_0x527523){return db[_0x06bb('0x1c')][_0x06bb('0x1d')](_0x4e0014['body'],{'raw':_0x4e0014[_0x06bb('0x1e')]?_0x4e0014[_0x06bb('0x1e')][_0x06bb('0x1f')]===undefined?!![]:![]:!![]})[_0x06bb('0x11')](function(_0xcacf9a){logger[_0x06bb('0x19')](_0x06bb('0x1b'),_0x4e0014);logger[_0x06bb('0x14')](_0x06bb('0x1b'),_0x4e0014,JSON['stringify'](_0xcacf9a));_0x3c1d54(_0xcacf9a);})[_0x06bb('0x20')](function(_0x5d2e78){logger[_0x06bb('0x16')](_0x06bb('0x1b'),_0x5d2e78[_0x06bb('0x18')],_0x4e0014);_0x527523(_0x2306cf[_0x06bb('0x16')](0x1f4,_0x5d2e78['message']));});});}; \ No newline at end of file +var _0x7344=['localhost','./chatMessage.socket','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CreateChatMessage','ChatMessage','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x3f66bb,_0x14961e){var _0x28f493=function(_0x5482a5){while(--_0x5482a5){_0x3f66bb['push'](_0x3f66bb['shift']());}};_0x28f493(++_0x14961e);}(_0x7344,0xbd));var _0x4734=function(_0x45d0ac,_0x2ca746){_0x45d0ac=_0x45d0ac-0x0;var _0x445ee0=_0x7344[_0x45d0ac];return _0x445ee0;};'use strict';var _=require(_0x4734('0x0'));var util=require(_0x4734('0x1'));var moment=require(_0x4734('0x2'));var BPromise=require(_0x4734('0x3'));var rs=require(_0x4734('0x4'));var fs=require('fs');var Redis=require(_0x4734('0x5'));var db=require(_0x4734('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4734('0x7'))(_0x4734('0x8'));var config=require(_0x4734('0x9'));var jayson=require(_0x4734('0xa'));var client=jayson[_0x4734('0xb')][_0x4734('0xc')]({'port':0x232a});config[_0x4734('0xd')]=_[_0x4734('0xe')](config[_0x4734('0xd')],{'host':_0x4734('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4734('0xd')]));require(_0x4734('0x10'))['register'](socket);function respondWithRpcPromise(_0x214341,_0x65d939,_0x3211a3){return new BPromise(function(_0x23d59b,_0x19eff1){return client['request'](_0x214341,_0x3211a3)[_0x4734('0x11')](function(_0x479842){logger['info'](_0x4734('0x12'),_0x65d939,_0x4734('0x13'));logger[_0x4734('0x14')](_0x4734('0x15'),_0x65d939,'request\x20sent',JSON[_0x4734('0x16')](_0x479842));if(_0x479842[_0x4734('0x17')]){if(_0x479842[_0x4734('0x17')][_0x4734('0x18')]===0x1f4){logger['error'](_0x4734('0x12'),_0x65d939,_0x479842[_0x4734('0x17')][_0x4734('0x19')]);return _0x19eff1(_0x479842['error'][_0x4734('0x19')]);}logger[_0x4734('0x17')](_0x4734('0x12'),_0x65d939,_0x479842['error'][_0x4734('0x19')]);return _0x23d59b(_0x479842['error']['message']);}else{logger[_0x4734('0x1a')](_0x4734('0x12'),_0x65d939,'request\x20sent');_0x23d59b(_0x479842['result'][_0x4734('0x19')]);}})[_0x4734('0x1b')](function(_0x3a9b89){logger[_0x4734('0x17')](_0x4734('0x12'),_0x65d939,_0x3a9b89);_0x19eff1(_0x3a9b89);});});}exports[_0x4734('0x1c')]=function(_0x59d61b){var _0x12dbf2=this;return new Promise(function(_0x58a9f9,_0x425f4a){return db[_0x4734('0x1d')][_0x4734('0x1e')](_0x59d61b[_0x4734('0x1f')],{'raw':_0x59d61b[_0x4734('0x20')]?_0x59d61b[_0x4734('0x20')][_0x4734('0x21')]===undefined?!![]:![]:!![]})[_0x4734('0x11')](function(_0x51bebd){logger['info'](_0x4734('0x1c'),_0x59d61b);logger[_0x4734('0x14')](_0x4734('0x1c'),_0x59d61b,JSON[_0x4734('0x16')](_0x51bebd));_0x58a9f9(_0x51bebd);})['catch'](function(_0x5cd07f){logger[_0x4734('0x17')]('CreateChatMessage',_0x5cd07f[_0x4734('0x19')],_0x59d61b);_0x425f4a(_0x12dbf2['error'](0x1f4,_0x5cd07f[_0x4734('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 645f769..36f10d3 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 _0xf9d5=['length','chatMessage:','save','remove','emit','removeListener'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xf9d5,0x122));var _0x5f9d=function(_0x8a3327,_0xcec090){_0x8a3327=_0x8a3327-0x0;var _0x444e06=_0xf9d5[_0x8a3327];return _0x444e06;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x5f9d('0x0'),_0x5f9d('0x1'),'update'];function createListener(_0x1b4d74,_0xe4b9ee){return function(_0x21d986){_0xe4b9ee[_0x5f9d('0x2')](_0x1b4d74,_0x21d986);};}function removeListener(_0x25fa8c,_0xdd68fd){return function(){ChatMessageEvents[_0x5f9d('0x3')](_0x25fa8c,_0xdd68fd);};}exports['register']=function(_0x1fc74c){for(var _0x59027b=0x0,_0x24999e=events[_0x5f9d('0x4')];_0x59027b<_0x24999e;_0x59027b++){var _0x4fb9f7=events[_0x59027b];var _0x3420b2=createListener(_0x5f9d('0x5')+_0x4fb9f7,_0x1fc74c);ChatMessageEvents['on'](_0x4fb9f7,_0x3420b2);}}; \ No newline at end of file +var _0x919e=['save','remove','emit','removeListener','register','length','chatMessage:','./chatMessage.events'];(function(_0x2f42f4,_0x5bddce){var _0x3c1c51=function(_0x292f14){while(--_0x292f14){_0x2f42f4['push'](_0x2f42f4['shift']());}};_0x3c1c51(++_0x5bddce);}(_0x919e,0x1d7));var _0xe919=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x919e[_0x3dd15e];return _0x231fd0;};'use strict';var ChatMessageEvents=require(_0xe919('0x0'));var events=[_0xe919('0x1'),_0xe919('0x2'),'update'];function createListener(_0x115b01,_0x55cc54){return function(_0x4f9fcd){_0x55cc54[_0xe919('0x3')](_0x115b01,_0x4f9fcd);};}function removeListener(_0x3a1192,_0x2bf552){return function(){ChatMessageEvents[_0xe919('0x4')](_0x3a1192,_0x2bf552);};}exports[_0xe919('0x5')]=function(_0x5a27ad){for(var _0x1225a5=0x0,_0x493b47=events[_0xe919('0x6')];_0x1225a5<_0x493b47;_0x1225a5++){var _0x2ceb41=events[_0x1225a5];var _0x57c3fe=createListener(_0xe919('0x7')+_0x2ceb41,_0x5a27ad);ChatMessageEvents['on'](_0x2ceb41,_0x57c3fe);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index eae6bc8..5311fd4 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 _0xedc9=['get','isAuthenticated','/describe','/:id','show','tracked','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./chatMessage.controller'];(function(_0x11a6a5,_0x5bba23){var _0x4250de=function(_0x5df2b1){while(--_0x5df2b1){_0x11a6a5['push'](_0x11a6a5['shift']());}};_0x4250de(++_0x5bba23);}(_0xedc9,0x148));var _0x9edc=function(_0x593f03,_0x4af84a){_0x593f03=_0x593f03-0x0;var _0x178299=_0xedc9[_0x593f03];return _0x178299;};'use strict';var multer=require(_0x9edc('0x0'));var util=require(_0x9edc('0x1'));var path=require('path');var timeout=require(_0x9edc('0x2'));var express=require(_0x9edc('0x3'));var router=express['Router']();var fs_extra=require(_0x9edc('0x4'));var auth=require(_0x9edc('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9edc('0x6'));var controller=require(_0x9edc('0x7'));router[_0x9edc('0x8')]('/',auth[_0x9edc('0x9')](),controller['index']);router[_0x9edc('0x8')](_0x9edc('0xa'),auth[_0x9edc('0x9')](),controller['describe']);router[_0x9edc('0x8')](_0x9edc('0xb'),auth[_0x9edc('0x9')](),controller[_0x9edc('0xc')]);router['post']('/',auth[_0x9edc('0x9')](),interaction[_0x9edc('0xd')]('chat',_0x9edc('0xe')),controller[_0x9edc('0xf')]);router[_0x9edc('0x10')](_0x9edc('0xb'),controller[_0x9edc('0x11')]);router[_0x9edc('0x10')](_0x9edc('0x12'),auth[_0x9edc('0x9')](),controller[_0x9edc('0x13')]);router[_0x9edc('0x10')](_0x9edc('0x14'),auth['isAuthenticated'](),controller[_0x9edc('0x15')]);router[_0x9edc('0x16')](_0x9edc('0xb'),auth[_0x9edc('0x9')](),controller['destroy']);module[_0x9edc('0x17')]=router; \ No newline at end of file +var _0xef09=['show','post','chat','chatmessage:create','create','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0xc74264,_0x5a41e9){var _0x238107=function(_0x49ad5c){while(--_0x49ad5c){_0xc74264['push'](_0xc74264['shift']());}};_0x238107(++_0x5a41e9);}(_0xef09,0x11a));var _0x9ef0=function(_0x1962c2,_0x5a098e){_0x1962c2=_0x1962c2-0x0;var _0x50aa8e=_0xef09[_0x1962c2];return _0x50aa8e;};'use strict';var multer=require('multer');var util=require(_0x9ef0('0x0'));var path=require(_0x9ef0('0x1'));var timeout=require(_0x9ef0('0x2'));var express=require(_0x9ef0('0x3'));var router=express[_0x9ef0('0x4')]();var fs_extra=require(_0x9ef0('0x5'));var auth=require(_0x9ef0('0x6'));var interaction=require(_0x9ef0('0x7'));var config=require(_0x9ef0('0x8'));var controller=require('./chatMessage.controller');router[_0x9ef0('0x9')]('/',auth[_0x9ef0('0xa')](),controller[_0x9ef0('0xb')]);router[_0x9ef0('0x9')](_0x9ef0('0xc'),auth[_0x9ef0('0xa')](),controller[_0x9ef0('0xd')]);router[_0x9ef0('0x9')](_0x9ef0('0xe'),auth[_0x9ef0('0xa')](),controller[_0x9ef0('0xf')]);router[_0x9ef0('0x10')]('/',auth[_0x9ef0('0xa')](),interaction['tracked'](_0x9ef0('0x11'),_0x9ef0('0x12')),controller[_0x9ef0('0x13')]);router[_0x9ef0('0x14')](_0x9ef0('0xe'),controller['update']);router[_0x9ef0('0x14')](_0x9ef0('0x15'),auth[_0x9ef0('0xa')](),controller[_0x9ef0('0x16')]);router[_0x9ef0('0x14')](_0x9ef0('0x17'),auth[_0x9ef0('0xa')](),controller[_0x9ef0('0x18')]);router[_0x9ef0('0x19')](_0x9ef0('0xe'),auth[_0x9ef0('0xa')](),controller[_0x9ef0('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 8892f3f..18c8bc2 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 _0x688d=['medium','sequelize','exports','TEXT'];(function(_0xbfec58,_0x5f4153){var _0x3dc84d=function(_0x498ef6){while(--_0x498ef6){_0xbfec58['push'](_0xbfec58['shift']());}};_0x3dc84d(++_0x5f4153);}(_0x688d,0xf5));var _0xd688=function(_0xe87bbd,_0x5aba00){_0xe87bbd=_0xe87bbd-0x0;var _0x25e94f=_0x688d[_0xe87bbd];return _0x25e94f;};'use strict';var Sequelize=require(_0xd688('0x0'));module[_0xd688('0x1')]={'body':{'type':Sequelize[_0xd688('0x2')](_0xd688('0x3')),'allowNull':![]}}; \ No newline at end of file +var _0xa65d=['sequelize','TEXT','medium'];(function(_0x3380bc,_0x11e0fb){var _0x540ca2=function(_0x5ef409){while(--_0x5ef409){_0x3380bc['push'](_0x3380bc['shift']());}};_0x540ca2(++_0x11e0fb);}(_0xa65d,0x111));var _0xda65=function(_0x110116,_0x26fcdc){_0x110116=_0x110116-0x0;var _0x579093=_0xa65d[_0x110116];return _0x579093;};'use strict';var Sequelize=require(_0xda65('0x0'));module['exports']={'body':{'type':Sequelize[_0xda65('0x1')](_0xda65('0x2')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index da23403..a479286 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x63b7c7,_0x328135){var _0x1ef37b=function(_0x1fd2fb){while(--_0x1fd2fb){_0x63b7c7['push'](_0x63b7c7['shift']());}};_0x1ef37b(++_0x328135);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file +var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x7a54,0x106));var _0x47a5=function(_0x32b568,_0x353b10){_0x32b568=_0x32b568-0x0;var _0x20425d=_0x7a54[_0x32b568];return _0x20425d;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 1fd37ad..d8de5cc 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 _0xcff1=['utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages'];(function(_0xe73b25,_0x176e45){var _0x6c7f68=function(_0x27d1b8){while(--_0x27d1b8){_0xe73b25['push'](_0xe73b25['shift']());}};_0x6c7f68(++_0x176e45);}(_0xcff1,0x144));var _0x1cff=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0xcff1[_0x4e9628];return _0x27bc8c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cff('0x0'))(_0x1cff('0x1'));var moment=require(_0x1cff('0x2'));var BPromise=require(_0x1cff('0x3'));var rp=require(_0x1cff('0x4'));var fs=require('fs');var path=require(_0x1cff('0x5'));var rimraf=require(_0x1cff('0x6'));var config=require('../../config/environment');var attributes=require(_0x1cff('0x7'));module[_0x1cff('0x8')]=function(_0x2babf7,_0x51daa7){return _0x2babf7[_0x1cff('0x9')](_0x1cff('0xa'),attributes,{'tableName':_0x1cff('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1cff('0xc'),'collate':_0x1cff('0xd')});}; \ No newline at end of file +var _0x3615=['lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x53102a,_0x55ecb6){var _0x96f568=function(_0x4d0abe){while(--_0x4d0abe){_0x53102a['push'](_0x53102a['shift']());}};_0x96f568(++_0x55ecb6);}(_0x3615,0x1e0));var _0x5361=function(_0xd09668,_0x1435b2){_0xd09668=_0xd09668-0x0;var _0x68726=_0x3615[_0xd09668];return _0x68726;};'use strict';var _=require(_0x5361('0x0'));var util=require(_0x5361('0x1'));var logger=require(_0x5361('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5361('0x3'));var rp=require(_0x5361('0x4'));var fs=require('fs');var path=require(_0x5361('0x5'));var rimraf=require(_0x5361('0x6'));var config=require(_0x5361('0x7'));var attributes=require(_0x5361('0x8'));module[_0x5361('0x9')]=function(_0x170aa3,_0x400914){return _0x170aa3[_0x5361('0xa')](_0x5361('0xb'),attributes,{'tableName':_0x5361('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5361('0xd'),'collate':_0x5361('0xe')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 7318708..26728e1 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 _0x044c=['request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','info','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x044c,0x1d1));var _0xc044=function(_0x3e9081,_0x6ab6f3){_0x3e9081=_0x3e9081-0x0;var _0x2b98fd=_0x044c[_0x3e9081];return _0x2b98fd;};'use strict';var _=require(_0xc044('0x0'));var util=require(_0xc044('0x1'));var moment=require(_0xc044('0x2'));var BPromise=require(_0xc044('0x3'));var rs=require(_0xc044('0x4'));var fs=require('fs');var Redis=require(_0xc044('0x5'));var db=require(_0xc044('0x6'))['db'];var utils=require(_0xc044('0x7'));var logger=require(_0xc044('0x8'))(_0xc044('0x9'));var config=require(_0xc044('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xc044('0xb')][_0xc044('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1f1194,_0x590b63,_0x2c2613){return new BPromise(function(_0x1179b7,_0x1c5169){return client[_0xc044('0xd')](_0x1f1194,_0x2c2613)[_0xc044('0xe')](function(_0x837648){logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x590b63,_0xc044('0xf'));logger[_0xc044('0x10')](_0xc044('0x11'),_0x590b63,_0xc044('0xf'),JSON[_0xc044('0x12')](_0x837648));if(_0x837648['error']){if(_0x837648[_0xc044('0x13')][_0xc044('0x14')]===0x1f4){logger[_0xc044('0x13')](_0xc044('0x15'),_0x590b63,_0x837648[_0xc044('0x13')][_0xc044('0x16')]);return _0x1c5169(_0x837648['error'][_0xc044('0x16')]);}logger[_0xc044('0x13')](_0xc044('0x15'),_0x590b63,_0x837648[_0xc044('0x13')][_0xc044('0x16')]);return _0x1179b7(_0x837648[_0xc044('0x13')][_0xc044('0x16')]);}else{logger[_0xc044('0x17')]('ChatOfflineMessage,\x20%s,\x20%s',_0x590b63,_0xc044('0xf'));_0x1179b7(_0x837648['result']['message']);}})['catch'](function(_0x5c38c4){logger[_0xc044('0x13')](_0xc044('0x15'),_0x590b63,_0x5c38c4);_0x1c5169(_0x5c38c4);});});} \ No newline at end of file +var _0xa454=['ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','info','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request\x20sent','debug'];(function(_0x8924f7,_0x2d690a){var _0x512b8e=function(_0x283696){while(--_0x283696){_0x8924f7['push'](_0x8924f7['shift']());}};_0x512b8e(++_0x2d690a);}(_0xa454,0xa3));var _0x4a45=function(_0x4b4092,_0x378b29){_0x4b4092=_0x4b4092-0x0;var _0xd447f9=_0xa454[_0x4b4092];return _0xd447f9;};'use strict';var _=require(_0x4a45('0x0'));var util=require(_0x4a45('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4a45('0x2'));var fs=require('fs');var Redis=require(_0x4a45('0x3'));var db=require(_0x4a45('0x4'))['db'];var utils=require(_0x4a45('0x5'));var logger=require('../../config/logger')(_0x4a45('0x6'));var config=require(_0x4a45('0x7'));var jayson=require(_0x4a45('0x8'));var client=jayson[_0x4a45('0x9')][_0x4a45('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4f2635,_0x5ca8c1,_0x518106){return new BPromise(function(_0x1ad34c,_0x3a43fa){return client['request'](_0x4f2635,_0x518106)['then'](function(_0x2ba9e9){logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x5ca8c1,_0x4a45('0xb'));logger[_0x4a45('0xc')](_0x4a45('0xd'),_0x5ca8c1,_0x4a45('0xb'),JSON[_0x4a45('0xe')](_0x2ba9e9));if(_0x2ba9e9[_0x4a45('0xf')]){if(_0x2ba9e9[_0x4a45('0xf')][_0x4a45('0x10')]===0x1f4){logger[_0x4a45('0xf')](_0x4a45('0x11'),_0x5ca8c1,_0x2ba9e9[_0x4a45('0xf')][_0x4a45('0x12')]);return _0x3a43fa(_0x2ba9e9[_0x4a45('0xf')][_0x4a45('0x12')]);}logger[_0x4a45('0xf')](_0x4a45('0x11'),_0x5ca8c1,_0x2ba9e9['error'][_0x4a45('0x12')]);return _0x1ad34c(_0x2ba9e9[_0x4a45('0xf')][_0x4a45('0x12')]);}else{logger[_0x4a45('0x13')](_0x4a45('0x11'),_0x5ca8c1,_0x4a45('0xb'));_0x1ad34c(_0x2ba9e9[_0x4a45('0x14')][_0x4a45('0x12')]);}})[_0x4a45('0x15')](function(_0x4b8932){logger[_0x4a45('0xf')](_0x4a45('0x11'),_0x5ca8c1,_0x4b8932);_0x3a43fa(_0x4b8932);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 919cfed..b86dc53 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 _0x855f=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','exports','multer','util','path'];(function(_0x56138f,_0x1e9ebb){var _0x1acaf7=function(_0x48690d){while(--_0x48690d){_0x56138f['push'](_0x56138f['shift']());}};_0x1acaf7(++_0x1e9ebb);}(_0x855f,0x1eb));var _0xf855=function(_0x3f71ad,_0x22f6cd){_0x3f71ad=_0x3f71ad-0x0;var _0x2eef6d=_0x855f[_0x3f71ad];return _0x2eef6d;};'use strict';var multer=require(_0xf855('0x0'));var util=require(_0xf855('0x1'));var path=require(_0xf855('0x2'));var timeout=require('connect-timeout');var express=require(_0xf855('0x3'));var router=express['Router']();var fs_extra=require(_0xf855('0x4'));var auth=require(_0xf855('0x5'));var interaction=require(_0xf855('0x6'));var config=require(_0xf855('0x7'));var controller=require(_0xf855('0x8'));router[_0xf855('0x9')]('/',auth[_0xf855('0xa')](),controller[_0xf855('0xb')]);router['get']('/describe',auth[_0xf855('0xa')](),controller['describe']);router['get'](_0xf855('0xc'),auth[_0xf855('0xa')](),controller[_0xf855('0xd')]);router[_0xf855('0xe')]('/',auth[_0xf855('0xa')](),controller[_0xf855('0xf')]);router['put'](_0xf855('0xc'),auth['isAuthenticated'](),controller[_0xf855('0x10')]);router[_0xf855('0x11')]('/:id',auth[_0xf855('0xa')](),controller['destroy']);module[_0xf855('0x12')]=router; \ No newline at end of file +var _0x6d3c=['multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','destroy','exports'];(function(_0x11511e,_0x59e6c1){var _0x441f30=function(_0x335835){while(--_0x335835){_0x11511e['push'](_0x11511e['shift']());}};_0x441f30(++_0x59e6c1);}(_0x6d3c,0x1d4));var _0xc6d3=function(_0x4891d7,_0x2b3472){_0x4891d7=_0x4891d7-0x0;var _0x4bd2a1=_0x6d3c[_0x4891d7];return _0x4bd2a1;};'use strict';var multer=require(_0xc6d3('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc6d3('0x1'));var express=require('express');var router=express[_0xc6d3('0x2')]();var fs_extra=require(_0xc6d3('0x3'));var auth=require(_0xc6d3('0x4'));var interaction=require(_0xc6d3('0x5'));var config=require(_0xc6d3('0x6'));var controller=require(_0xc6d3('0x7'));router[_0xc6d3('0x8')]('/',auth[_0xc6d3('0x9')](),controller[_0xc6d3('0xa')]);router[_0xc6d3('0x8')](_0xc6d3('0xb'),auth[_0xc6d3('0x9')](),controller[_0xc6d3('0xc')]);router[_0xc6d3('0x8')](_0xc6d3('0xd'),auth['isAuthenticated'](),controller[_0xc6d3('0xe')]);router[_0xc6d3('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xc6d3('0xd'),auth[_0xc6d3('0x9')](),controller['update']);router['delete'](_0xc6d3('0xd'),auth[_0xc6d3('0x9')](),controller[_0xc6d3('0x10')]);module[_0xc6d3('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index f7dea12..0b52c6f 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 _0xca38=['ENUM','mouseOver','timeout','exports','STRING'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xca38,0x8f));var _0x8ca3=function(_0x110a73,_0x1fe4b1){_0x110a73=_0x110a73-0x0;var _0x7ab3c7=_0xca38[_0x110a73];return _0x7ab3c7;};'use strict';var Sequelize=require('sequelize');module[_0x8ca3('0x0')]={'name':{'type':Sequelize[_0x8ca3('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x8ca3('0x2')](_0x8ca3('0x3'),_0x8ca3('0x4')),'defaultValue':_0x8ca3('0x3')},'selector':{'type':Sequelize[_0x8ca3('0x1')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xcff2=['exports','STRING','ENUM','mouseOver','timeout','INTEGER','sequelize'];(function(_0x529afe,_0x36883a){var _0xf42175=function(_0x3b9a94){while(--_0x3b9a94){_0x529afe['push'](_0x529afe['shift']());}};_0xf42175(++_0x36883a);}(_0xcff2,0x117));var _0x2cff=function(_0x1406ae,_0x292395){_0x1406ae=_0x1406ae-0x0;var _0x23a076=_0xcff2[_0x1406ae];return _0x23a076;};'use strict';var Sequelize=require(_0x2cff('0x0'));module[_0x2cff('0x1')]={'name':{'type':Sequelize[_0x2cff('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x2cff('0x3')](_0x2cff('0x4'),_0x2cff('0x5')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x2cff('0x2')]},'timeout':{'type':Sequelize[_0x2cff('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index eefb8c8..a31ac2d 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 _0xaa7c=['find','catch','create','body','eml-format','moment','bluebird','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xaa7c,0x1ec));var _0xcaa7=function(_0x3d2ab6,_0x1eeeb3){_0x3d2ab6=_0x3d2ab6-0x0;var _0x576d30=_0xaa7c[_0x3d2ab6];return _0x576d30;};'use strict';var emlformat=require(_0xcaa7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xcaa7('0x1'));var BPromise=require(_0xcaa7('0x2'));var Mustache=require('mustache');var util=require(_0xcaa7('0x3'));var path=require(_0xcaa7('0x4'));var sox=require(_0xcaa7('0x5'));var csv=require(_0xcaa7('0x6'));var ejs=require(_0xcaa7('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcaa7('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xcaa7('0x9'));var deskjs=require(_0xcaa7('0xa'));var toCsv=require(_0xcaa7('0x6'));var querystring=require('querystring');var Papa=require(_0xcaa7('0xb'));var Redis=require(_0xcaa7('0xc'));var authService=require(_0xcaa7('0xd'));var qs=require(_0xcaa7('0xe'));var as=require(_0xcaa7('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcaa7('0x10'))(_0xcaa7('0x11'));var utils=require(_0xcaa7('0x12'));var config=require(_0xcaa7('0x13'));var licenseUtil=require(_0xcaa7('0x14'));var db=require(_0xcaa7('0x15'))['db'];function respondWithStatusCode(_0x563f57,_0x24d3b0){_0x24d3b0=_0x24d3b0||0xcc;return function(_0x128cfb){if(_0x128cfb){return _0x563f57[_0xcaa7('0x16')](_0x24d3b0);}return _0x563f57[_0xcaa7('0x17')](_0x24d3b0)[_0xcaa7('0x18')]();};}function respondWithResult(_0x2eb4ff,_0x299490){_0x299490=_0x299490||0xc8;return function(_0x4a1d5a){if(_0x4a1d5a){return _0x2eb4ff['status'](_0x299490)[_0xcaa7('0x19')](_0x4a1d5a);}};}function respondWithFilteredResult(_0x1c1286,_0x1155fb){return function(_0x1b2c4f){if(_0x1b2c4f){var _0x49a218=typeof _0x1155fb[_0xcaa7('0x1a')]===_0xcaa7('0x1b')&&typeof _0x1155fb[_0xcaa7('0x1c')]===_0xcaa7('0x1b');var _0x46d9b4=_0x1b2c4f[_0xcaa7('0x1d')];var _0x20ede0=_0x49a218?0x0:_0x1155fb['offset'];var _0x53e1cb=_0x49a218?_0x1b2c4f[_0xcaa7('0x1d')]:_0x1155fb[_0xcaa7('0x1a')]+_0x1155fb[_0xcaa7('0x1c')];var _0x3bc53b;if(_0x53e1cb>=_0x46d9b4){_0x53e1cb=_0x46d9b4;_0x3bc53b=0xc8;}else{_0x3bc53b=0xce;}_0x1c1286[_0xcaa7('0x17')](_0x3bc53b);return _0x1c1286[_0xcaa7('0x1e')](_0xcaa7('0x1f'),_0x20ede0+'-'+_0x53e1cb+'/'+_0x46d9b4)['json'](_0x1b2c4f);}return null;};}function patchUpdates(_0x89e8a0){return function(_0x3650ac){try{jsonpatch[_0xcaa7('0x20')](_0x3650ac,_0x89e8a0,!![]);}catch(_0x11cbbf){return BPromise[_0xcaa7('0x21')](_0x11cbbf);}return _0x3650ac[_0xcaa7('0x22')]();};}function saveUpdates(_0x3119d5,_0x4259b7){return function(_0x2a9a79){if(_0x2a9a79){return _0x2a9a79[_0xcaa7('0x23')](_0x3119d5)[_0xcaa7('0x24')](function(_0x140c5a){return _0x140c5a;});}return null;};}function removeEntity(_0x24a18c,_0x56ee3a){return function(_0x97a507){if(_0x97a507){return _0x97a507[_0xcaa7('0x25')]()['then'](function(){_0x24a18c[_0xcaa7('0x17')](0xcc)[_0xcaa7('0x18')]();});}};}function handleEntityNotFound(_0x146e6f,_0x10b638){return function(_0x58384f){if(!_0x58384f){_0x146e6f['sendStatus'](0x194);}return _0x58384f;};}function handleError(_0x3c0b15,_0x3e1f78){_0x3e1f78=_0x3e1f78||0x1f4;return function(_0x3369f2){logger[_0xcaa7('0x26')](_0x3369f2[_0xcaa7('0x27')]);if(_0x3369f2['name']){delete _0x3369f2[_0xcaa7('0x28')];}_0x3c0b15['status'](_0x3e1f78)['send'](_0x3369f2);};}exports[_0xcaa7('0x29')]=function(_0x492362,_0x34a30d){var _0x623f17={'raw':!![],'where':{'id':_0x492362[_0xcaa7('0x2a')]['id']}},_0x748bda={};_0x748bda[_0xcaa7('0x2b')]=_[_0xcaa7('0x2c')](db[_0xcaa7('0x2d')][_0xcaa7('0x2e')]);_0x748bda['query']=_[_0xcaa7('0x2c')](_0x492362[_0xcaa7('0x2f')]);_0x748bda[_0xcaa7('0x30')]=_[_0xcaa7('0x31')](_0x748bda[_0xcaa7('0x2b')],_0x748bda['query']);_0x623f17[_0xcaa7('0x32')]=_[_0xcaa7('0x31')](_0x748bda[_0xcaa7('0x2b')],qs[_0xcaa7('0x33')](_0x492362[_0xcaa7('0x2f')]['fields']));_0x623f17[_0xcaa7('0x32')]=_0x623f17['attributes'][_0xcaa7('0x34')]?_0x623f17[_0xcaa7('0x32')]:_0x748bda[_0xcaa7('0x2b')];if(_0x492362['query'][_0xcaa7('0x35')]){_0x623f17[_0xcaa7('0x36')]=[{'all':!![]}];}_0x623f17=_[_0xcaa7('0x37')]({},_0x623f17,_0x492362[_0xcaa7('0x38')]);return db[_0xcaa7('0x2d')][_0xcaa7('0x39')](_0x623f17)['then'](handleEntityNotFound(_0x34a30d,null))[_0xcaa7('0x24')](respondWithResult(_0x34a30d,null))[_0xcaa7('0x3a')](handleError(_0x34a30d,null));};exports['create']=function(_0x455f6e,_0x43b8de){return db[_0xcaa7('0x2d')][_0xcaa7('0x3b')](_0x455f6e['body'],{})[_0xcaa7('0x24')](respondWithResult(_0x43b8de,0xc9))[_0xcaa7('0x3a')](handleError(_0x43b8de,null));};exports[_0xcaa7('0x23')]=function(_0x25bc49,_0x321e12){if(_0x25bc49[_0xcaa7('0x3c')]['id']){delete _0x25bc49[_0xcaa7('0x3c')]['id'];}return db[_0xcaa7('0x2d')][_0xcaa7('0x39')]({'where':{'id':_0x25bc49[_0xcaa7('0x2a')]['id']}})[_0xcaa7('0x24')](handleEntityNotFound(_0x321e12,null))[_0xcaa7('0x24')](saveUpdates(_0x25bc49['body'],null))[_0xcaa7('0x24')](respondWithResult(_0x321e12,null))[_0xcaa7('0x3a')](handleError(_0x321e12,null));};exports[_0xcaa7('0x25')]=function(_0x2e4262,_0x5f1028){return db['ChatProactiveAction'][_0xcaa7('0x39')]({'where':{'id':_0x2e4262[_0xcaa7('0x2a')]['id']}})[_0xcaa7('0x24')](handleEntityNotFound(_0x5f1028,null))['then'](removeEntity(_0x5f1028,null))[_0xcaa7('0x3a')](handleError(_0x5f1028,null));}; \ No newline at end of file +var _0x56a6=['util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','then','destroy','end','stack','name','send','params','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','model','fields','merge','options','find','create','body','catch','update','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache'];(function(_0x3ee4c6,_0xb63080){var _0x26956d=function(_0x5aac2d){while(--_0x5aac2d){_0x3ee4c6['push'](_0x3ee4c6['shift']());}};_0x26956d(++_0xb63080);}(_0x56a6,0x17b));var _0x656a=function(_0x4895b5,_0x8ac595){_0x4895b5=_0x4895b5-0x0;var _0x1da8da=_0x56a6[_0x4895b5];return _0x1da8da;};'use strict';var emlformat=require(_0x656a('0x0'));var rimraf=require(_0x656a('0x1'));var zipdir=require(_0x656a('0x2'));var jsonpatch=require(_0x656a('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x656a('0x4'));var Mustache=require(_0x656a('0x5'));var util=require(_0x656a('0x6'));var path=require('path');var sox=require(_0x656a('0x7'));var csv=require(_0x656a('0x8'));var ejs=require(_0x656a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x656a('0xa'));var squel=require(_0x656a('0xb'));var crypto=require(_0x656a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x656a('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x656a('0xe'));var Redis=require(_0x656a('0xf'));var authService=require(_0x656a('0x10'));var qs=require(_0x656a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x656a('0x12'));var logger=require(_0x656a('0x13'))(_0x656a('0x14'));var utils=require(_0x656a('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x16312b,_0x32a319){_0x32a319=_0x32a319||0xcc;return function(_0x2ab2d7){if(_0x2ab2d7){return _0x16312b[_0x656a('0x16')](_0x32a319);}return _0x16312b[_0x656a('0x17')](_0x32a319)['end']();};}function respondWithResult(_0x30e0ab,_0x2721cd){_0x2721cd=_0x2721cd||0xc8;return function(_0x36b24e){if(_0x36b24e){return _0x30e0ab[_0x656a('0x17')](_0x2721cd)[_0x656a('0x18')](_0x36b24e);}};}function respondWithFilteredResult(_0x29f176,_0x55ed){return function(_0x3c8d71){if(_0x3c8d71){var _0x552b5b=typeof _0x55ed[_0x656a('0x19')]===_0x656a('0x1a')&&typeof _0x55ed[_0x656a('0x1b')]===_0x656a('0x1a');var _0x3bade4=_0x3c8d71[_0x656a('0x1c')];var _0x28cd04=_0x552b5b?0x0:_0x55ed[_0x656a('0x19')];var _0x2f186f=_0x552b5b?_0x3c8d71['count']:_0x55ed[_0x656a('0x19')]+_0x55ed[_0x656a('0x1b')];var _0x36e416;if(_0x2f186f>=_0x3bade4){_0x2f186f=_0x3bade4;_0x36e416=0xc8;}else{_0x36e416=0xce;}_0x29f176[_0x656a('0x17')](_0x36e416);return _0x29f176[_0x656a('0x1d')](_0x656a('0x1e'),_0x28cd04+'-'+_0x2f186f+'/'+_0x3bade4)[_0x656a('0x18')](_0x3c8d71);}return null;};}function patchUpdates(_0x1cecf4){return function(_0x53661e){try{jsonpatch[_0x656a('0x1f')](_0x53661e,_0x1cecf4,!![]);}catch(_0x50be0e){return BPromise['reject'](_0x50be0e);}return _0x53661e['save']();};}function saveUpdates(_0x53c0b6,_0x124f76){return function(_0x404fa6){if(_0x404fa6){return _0x404fa6['update'](_0x53c0b6)[_0x656a('0x20')](function(_0x326a75){return _0x326a75;});}return null;};}function removeEntity(_0x39d148,_0x519ef3){return function(_0x37565e){if(_0x37565e){return _0x37565e[_0x656a('0x21')]()[_0x656a('0x20')](function(){_0x39d148[_0x656a('0x17')](0xcc)[_0x656a('0x22')]();});}};}function handleEntityNotFound(_0xc2860f,_0xa9ec33){return function(_0x15271f){if(!_0x15271f){_0xc2860f['sendStatus'](0x194);}return _0x15271f;};}function handleError(_0x988ef0,_0x4c79cd){_0x4c79cd=_0x4c79cd||0x1f4;return function(_0x223d67){logger['error'](_0x223d67[_0x656a('0x23')]);if(_0x223d67['name']){delete _0x223d67[_0x656a('0x24')];}_0x988ef0['status'](_0x4c79cd)[_0x656a('0x25')](_0x223d67);};}exports['show']=function(_0x55abd2,_0x47bcc0){var _0x2a00ba={'raw':!![],'where':{'id':_0x55abd2[_0x656a('0x26')]['id']}},_0x49a723={};_0x49a723['model']=_[_0x656a('0x27')](db[_0x656a('0x28')][_0x656a('0x29')]);_0x49a723[_0x656a('0x2a')]=_['keys'](_0x55abd2['query']);_0x49a723[_0x656a('0x2b')]=_[_0x656a('0x2c')](_0x49a723['model'],_0x49a723[_0x656a('0x2a')]);_0x2a00ba[_0x656a('0x2d')]=_[_0x656a('0x2c')](_0x49a723[_0x656a('0x2e')],qs['fields'](_0x55abd2['query'][_0x656a('0x2f')]));_0x2a00ba[_0x656a('0x2d')]=_0x2a00ba['attributes']['length']?_0x2a00ba[_0x656a('0x2d')]:_0x49a723[_0x656a('0x2e')];if(_0x55abd2[_0x656a('0x2a')]['includeAll']){_0x2a00ba['include']=[{'all':!![]}];}_0x2a00ba=_[_0x656a('0x30')]({},_0x2a00ba,_0x55abd2[_0x656a('0x31')]);return db[_0x656a('0x28')][_0x656a('0x32')](_0x2a00ba)[_0x656a('0x20')](handleEntityNotFound(_0x47bcc0,null))[_0x656a('0x20')](respondWithResult(_0x47bcc0,null))['catch'](handleError(_0x47bcc0,null));};exports['create']=function(_0x375b4b,_0x401b45){return db['ChatProactiveAction'][_0x656a('0x33')](_0x375b4b[_0x656a('0x34')],{})['then'](respondWithResult(_0x401b45,0xc9))[_0x656a('0x35')](handleError(_0x401b45,null));};exports[_0x656a('0x36')]=function(_0x14d074,_0x37847e){if(_0x14d074[_0x656a('0x34')]['id']){delete _0x14d074[_0x656a('0x34')]['id'];}return db[_0x656a('0x28')][_0x656a('0x32')]({'where':{'id':_0x14d074[_0x656a('0x26')]['id']}})['then'](handleEntityNotFound(_0x37847e,null))['then'](saveUpdates(_0x14d074['body'],null))[_0x656a('0x20')](respondWithResult(_0x37847e,null))['catch'](handleError(_0x37847e,null));};exports[_0x656a('0x21')]=function(_0x3c2481,_0x12b2de){return db[_0x656a('0x28')]['find']({'where':{'id':_0x3c2481[_0x656a('0x26')]['id']}})[_0x656a('0x20')](handleEntityNotFound(_0x12b2de,null))[_0x656a('0x20')](removeEntity(_0x12b2de,null))[_0x656a('0x35')](handleError(_0x12b2de,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 3f6066f..bb99a64 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 _0xb0e7=['exports','ChatProactiveAction','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x480cca,_0x33709f){var _0x22bcdb=function(_0x15ab17){while(--_0x15ab17){_0x480cca['push'](_0x480cca['shift']());}};_0x22bcdb(++_0x33709f);}(_0xb0e7,0x1c4));var _0x7b0e=function(_0x40e8b4,_0x5b9d81){_0x40e8b4=_0x40e8b4-0x0;var _0x335a50=_0xb0e7[_0x40e8b4];return _0x335a50;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x7b0e('0x0'));var moment=require(_0x7b0e('0x1'));var BPromise=require(_0x7b0e('0x2'));var rp=require(_0x7b0e('0x3'));var fs=require('fs');var path=require(_0x7b0e('0x4'));var rimraf=require(_0x7b0e('0x5'));var config=require(_0x7b0e('0x6'));var attributes=require('./chatProactiveAction.attributes');module[_0x7b0e('0x7')]=function(_0x31fa01,_0x53081a){return _0x31fa01['define'](_0x7b0e('0x8'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5781=['../../config/logger','moment','bluebird','../../config/environment','./chatProactiveAction.attributes','exports','define','chat_proactive_actions','lodash','util'];(function(_0x177b20,_0x4b396d){var _0x53d1e8=function(_0x5f91f2){while(--_0x5f91f2){_0x177b20['push'](_0x177b20['shift']());}};_0x53d1e8(++_0x4b396d);}(_0x5781,0x120));var _0x1578=function(_0xc8a63e,_0x5463f2){_0xc8a63e=_0xc8a63e-0x0;var _0x38f889=_0x5781[_0xc8a63e];return _0x38f889;};'use strict';var _=require(_0x1578('0x0'));var util=require(_0x1578('0x1'));var logger=require(_0x1578('0x2'))('api');var moment=require(_0x1578('0x3'));var BPromise=require(_0x1578('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1578('0x5'));var attributes=require(_0x1578('0x6'));module[_0x1578('0x7')]=function(_0x2bcde7,_0x3baacb){return _0x2bcde7[_0x1578('0x8')]('ChatProactiveAction',attributes,{'tableName':_0x1578('0x9'),'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 4a8cb94..0c0e2c2 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 _0xb6d2=['error','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4f3b3c,_0x4257c4){var _0x25c181=function(_0x5de512){while(--_0x5de512){_0x4f3b3c['push'](_0x4f3b3c['shift']());}};_0x25c181(++_0x4257c4);}(_0xb6d2,0x9d));var _0x2b6d=function(_0x48dfae,_0xffdc40){_0x48dfae=_0x48dfae-0x0;var _0x2f379d=_0xb6d2[_0x48dfae];return _0x2f379d;};'use strict';var _=require(_0x2b6d('0x0'));var util=require(_0x2b6d('0x1'));var moment=require('moment');var BPromise=require(_0x2b6d('0x2'));var rs=require(_0x2b6d('0x3'));var fs=require('fs');var Redis=require(_0x2b6d('0x4'));var db=require(_0x2b6d('0x5'))['db'];var utils=require(_0x2b6d('0x6'));var logger=require(_0x2b6d('0x7'))(_0x2b6d('0x8'));var config=require(_0x2b6d('0x9'));var jayson=require(_0x2b6d('0xa'));var client=jayson['client'][_0x2b6d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x55240b,_0x45ee54,_0x4cf5bb){return new BPromise(function(_0x2feecc,_0x4dd3a3){return client['request'](_0x55240b,_0x4cf5bb)[_0x2b6d('0xc')](function(_0x4b8f51){logger[_0x2b6d('0xd')](_0x2b6d('0xe'),_0x45ee54,_0x2b6d('0xf'));logger[_0x2b6d('0x10')](_0x2b6d('0x11'),_0x45ee54,_0x2b6d('0xf'),JSON[_0x2b6d('0x12')](_0x4b8f51));if(_0x4b8f51['error']){if(_0x4b8f51[_0x2b6d('0x13')]['code']===0x1f4){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x45ee54,_0x4b8f51[_0x2b6d('0x13')][_0x2b6d('0x14')]);return _0x4dd3a3(_0x4b8f51[_0x2b6d('0x13')]['message']);}logger[_0x2b6d('0x13')](_0x2b6d('0xe'),_0x45ee54,_0x4b8f51[_0x2b6d('0x13')][_0x2b6d('0x14')]);return _0x2feecc(_0x4b8f51[_0x2b6d('0x13')][_0x2b6d('0x14')]);}else{logger[_0x2b6d('0xd')](_0x2b6d('0xe'),_0x45ee54,_0x2b6d('0xf'));_0x2feecc(_0x4b8f51[_0x2b6d('0x15')][_0x2b6d('0x14')]);}})['catch'](function(_0x3992e7){logger[_0x2b6d('0x13')](_0x2b6d('0xe'),_0x45ee54,_0x3992e7);_0x4dd3a3(_0x3992e7);});});} \ No newline at end of file +var _0x98bf=['message','result','catch','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x34c300,_0x45abcc){var _0x272bb0=function(_0x5ca010){while(--_0x5ca010){_0x34c300['push'](_0x34c300['shift']());}};_0x272bb0(++_0x45abcc);}(_0x98bf,0x163));var _0xf98b=function(_0x1eead3,_0x18f32b){_0x1eead3=_0x1eead3-0x0;var _0x12a236=_0x98bf[_0x1eead3];return _0x12a236;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf98b('0x0'));var BPromise=require(_0xf98b('0x1'));var rs=require(_0xf98b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf98b('0x3'));var logger=require(_0xf98b('0x4'))(_0xf98b('0x5'));var config=require(_0xf98b('0x6'));var jayson=require(_0xf98b('0x7'));var client=jayson[_0xf98b('0x8')][_0xf98b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x10d0bf,_0x8f6a93,_0x24bac3){return new BPromise(function(_0x2223d8,_0x362444){return client[_0xf98b('0xa')](_0x10d0bf,_0x24bac3)[_0xf98b('0xb')](function(_0x480cc0){logger[_0xf98b('0xc')](_0xf98b('0xd'),_0x8f6a93,_0xf98b('0xe'));logger[_0xf98b('0xf')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x8f6a93,_0xf98b('0xe'),JSON[_0xf98b('0x10')](_0x480cc0));if(_0x480cc0['error']){if(_0x480cc0[_0xf98b('0x11')][_0xf98b('0x12')]===0x1f4){logger[_0xf98b('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x8f6a93,_0x480cc0[_0xf98b('0x11')][_0xf98b('0x13')]);return _0x362444(_0x480cc0[_0xf98b('0x11')]['message']);}logger[_0xf98b('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x8f6a93,_0x480cc0['error']['message']);return _0x2223d8(_0x480cc0['error'][_0xf98b('0x13')]);}else{logger['info'](_0xf98b('0xd'),_0x8f6a93,_0xf98b('0xe'));_0x2223d8(_0x480cc0[_0xf98b('0x14')][_0xf98b('0x13')]);}})[_0xf98b('0x15')](function(_0x9253a9){logger[_0xf98b('0x11')](_0xf98b('0xd'),_0x8f6a93,_0x9253a9);_0x362444(_0x9253a9);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index b74fe00..f4e16d1 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 _0xf494=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','create','put','update','delete','exports','multer','util'];(function(_0xadde0d,_0x542e43){var _0x3654e2=function(_0x35330c){while(--_0x35330c){_0xadde0d['push'](_0xadde0d['shift']());}};_0x3654e2(++_0x542e43);}(_0xf494,0x1c6));var _0x4f49=function(_0x2d2005,_0x4949db){_0x2d2005=_0x2d2005-0x0;var _0x45df97=_0xf494[_0x2d2005];return _0x45df97;};'use strict';var multer=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var path=require(_0x4f49('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f49('0x3'));var router=express[_0x4f49('0x4')]();var fs_extra=require(_0x4f49('0x5'));var auth=require(_0x4f49('0x6'));var interaction=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var controller=require(_0x4f49('0x9'));router[_0x4f49('0xa')](_0x4f49('0xb'),auth[_0x4f49('0xc')](),controller[_0x4f49('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4f49('0xe')]);router[_0x4f49('0xf')](_0x4f49('0xb'),auth[_0x4f49('0xc')](),controller[_0x4f49('0x10')]);router[_0x4f49('0x11')](_0x4f49('0xb'),auth[_0x4f49('0xc')](),controller['destroy']);module[_0x4f49('0x12')]=router; \ No newline at end of file +var _0xf2ca=['show','create','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated'];(function(_0x49382a,_0x55219c){var _0x25733f=function(_0x5eb8f9){while(--_0x5eb8f9){_0x49382a['push'](_0x49382a['shift']());}};_0x25733f(++_0x55219c);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x3f993e,_0x2d5757){_0x3f993e=_0x3f993e-0x0;var _0x39c135=_0xf2ca[_0x3f993e];return _0x39c135;};'use strict';var multer=require(_0xaf2c('0x0'));var util=require(_0xaf2c('0x1'));var path=require(_0xaf2c('0x2'));var timeout=require('connect-timeout');var express=require(_0xaf2c('0x3'));var router=express[_0xaf2c('0x4')]();var fs_extra=require(_0xaf2c('0x5'));var auth=require(_0xaf2c('0x6'));var interaction=require(_0xaf2c('0x7'));var config=require(_0xaf2c('0x8'));var controller=require('./chatProactiveAction.controller');router[_0xaf2c('0x9')](_0xaf2c('0xa'),auth[_0xaf2c('0xb')](),controller[_0xaf2c('0xc')]);router['post']('/',auth[_0xaf2c('0xb')](),controller[_0xaf2c('0xd')]);router['put'](_0xaf2c('0xa'),auth['isAuthenticated'](),controller[_0xaf2c('0xe')]);router['delete'](_0xaf2c('0xa'),auth[_0xaf2c('0xb')](),controller[_0xaf2c('0xf')]);module[_0xaf2c('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 8faeac0..7af76cc 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 _0xc351=['exports','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x1a786f,_0x56b6d8){var _0x12c96a=function(_0x1f86f0){while(--_0x1f86f0){_0x1a786f['push'](_0x1a786f['shift']());}};_0x12c96a(++_0x56b6d8);}(_0xc351,0xa8));var _0x1c35=function(_0x4a01f5,_0x2afa35){_0x4a01f5=_0x4a01f5-0x0;var _0x27e20e=_0xc351[_0x4a01f5];return _0x27e20e;};'use strict';var Sequelize=require('sequelize');module[_0x1c35('0x0')]={'name':{'type':Sequelize[_0x1c35('0x1')],'unique':_0x1c35('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1c35('0x1')]},'timeout':{'type':Sequelize[_0x1c35('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1c35('0x4')](_0x1c35('0x5'),_0x1c35('0x6'),_0x1c35('0x7'))}}; \ No newline at end of file +var _0xac7a=['sequelize','STRING','INTEGER','ENUM','rrmemory','roundrobin'];(function(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0xac7a,0x198));var _0xaac7=function(_0x42e350,_0x1c5490){_0x42e350=_0x42e350-0x0;var _0x36cd7b=_0xac7a[_0x42e350];return _0x36cd7b;};'use strict';var Sequelize=require(_0xaac7('0x0'));module['exports']={'name':{'type':Sequelize[_0xaac7('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xaac7('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xaac7('0x3')](_0xaac7('0x4'),'beepall',_0xaac7('0x5'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index f79bb60..3861bbb 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 _0xffcb=['stringify','error','message','result','catch','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','save','update','destroy','get','UserProfileResource','then','stack','name','index','map','ChatQueue','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','merge','options','findAll','rows','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatQueues','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','keys','pick','UserChatQueue','User','UserId','agent','updatedAt','createdAt','%s/%s','SIP','chatPause','getTeams','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','forEach','emit','removeTeams','Team','select','field','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','all','union','compact','value','removeAgents','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','isArray','getAgents','zip-dir','request-promise','moment','bluebird','mustache','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','redis','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x48ca37,_0x5519d7){var _0x3fc45c=function(_0x399324){while(--_0x399324){_0x48ca37['push'](_0x48ca37['shift']());}};_0x3fc45c(++_0x5519d7);}(_0xffcb,0x107));var _0xbffc=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xffcb[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xbffc('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbffc('0x1'));var moment=require(_0xbffc('0x2'));var BPromise=require(_0xbffc('0x3'));var Mustache=require(_0xbffc('0x4'));var util=require('util');var path=require('path');var sox=require(_0xbffc('0x5'));var csv=require(_0xbffc('0x6'));var ejs=require(_0xbffc('0x7'));var fs=require('fs');var fs_extra=require(_0xbffc('0x8'));var _=require(_0xbffc('0x9'));var squel=require(_0xbffc('0xa'));var crypto=require(_0xbffc('0xb'));var jsforce=require(_0xbffc('0xc'));var deskjs=require(_0xbffc('0xd'));var toCsv=require('to-csv');var querystring=require(_0xbffc('0xe'));var Papa=require(_0xbffc('0xf'));var Redis=require(_0xbffc('0x10'));var authService=require(_0xbffc('0x11'));var qs=require(_0xbffc('0x12'));var as=require(_0xbffc('0x13'));var hardwareService=require(_0xbffc('0x14'));var logger=require(_0xbffc('0x15'))('api');var utils=require(_0xbffc('0x16'));var config=require(_0xbffc('0x17'));var licenseUtil=require(_0xbffc('0x18'));var db=require('../../mysqldb')['db'];config[_0xbffc('0x19')]=_['defaults'](config[_0xbffc('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xbffc('0x1a'))(new Redis(config['redis']));require(_0xbffc('0x1b'))[_0xbffc('0x1c')](socket);var jayson=require(_0xbffc('0x1d'));var client=jayson[_0xbffc('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1999bf,_0x1aa4bc,_0x500f66,_0x52f7f7){return new BPromise(function(_0x454b17,_0xdd1e64){var _0x416414=_0x52f7f7||client;return _0x416414[_0xbffc('0x1f')](_0x1999bf,_0x500f66)['then'](function(_0x439dd5){logger[_0xbffc('0x20')](_0xbffc('0x21'),_0x1aa4bc,_0xbffc('0x22'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x1aa4bc,_0xbffc('0x22'),JSON[_0xbffc('0x23')](_0x439dd5));if(_0x439dd5[_0xbffc('0x24')]){if(_0x439dd5[_0xbffc('0x24')]['code']===0x1f4){logger['error'](_0xbffc('0x21'),_0x1aa4bc,_0x439dd5['error'][_0xbffc('0x25')]);return _0xdd1e64(_0x439dd5[_0xbffc('0x24')][_0xbffc('0x25')]);}logger[_0xbffc('0x24')](_0xbffc('0x21'),_0x1aa4bc,_0x439dd5[_0xbffc('0x24')][_0xbffc('0x25')]);return _0x454b17(_0x439dd5[_0xbffc('0x24')][_0xbffc('0x25')]);}else{logger[_0xbffc('0x20')](_0xbffc('0x21'),_0x1aa4bc,_0xbffc('0x22'));_0x454b17(_0x439dd5[_0xbffc('0x26')]['message']);}})[_0xbffc('0x27')](function(_0x158a48){logger[_0xbffc('0x24')](_0xbffc('0x21'),_0x1aa4bc,_0x158a48);_0xdd1e64(_0x158a48);});});}function respondWithStatusCode(_0x411268,_0x49a705){_0x49a705=_0x49a705||0xcc;return function(_0x224bec){if(_0x224bec){return _0x411268[_0xbffc('0x28')](_0x49a705);}return _0x411268[_0xbffc('0x29')](_0x49a705)[_0xbffc('0x2a')]();};}function respondWithResult(_0x5e9c55,_0x49384a){_0x49384a=_0x49384a||0xc8;return function(_0x2061d0){if(_0x2061d0){return _0x5e9c55[_0xbffc('0x29')](_0x49384a)[_0xbffc('0x2b')](_0x2061d0);}};}function respondWithFilteredResult(_0x459bd1,_0x444daa){return function(_0x59cc92){if(_0x59cc92){var _0x4b8ac6=typeof _0x444daa['offset']==='undefined'&&typeof _0x444daa[_0xbffc('0x2c')]==='undefined';var _0x16450c=_0x59cc92['count'];var _0x354d78=_0x4b8ac6?0x0:_0x444daa['offset'];var _0x37f222=_0x4b8ac6?_0x59cc92[_0xbffc('0x2d')]:_0x444daa[_0xbffc('0x2e')]+_0x444daa['limit'];var _0x445d51;if(_0x37f222>=_0x16450c){_0x37f222=_0x16450c;_0x445d51=0xc8;}else{_0x445d51=0xce;}_0x459bd1[_0xbffc('0x29')](_0x445d51);return _0x459bd1[_0xbffc('0x2f')](_0xbffc('0x30'),_0x354d78+'-'+_0x37f222+'/'+_0x16450c)[_0xbffc('0x2b')](_0x59cc92);}return null;};}function patchUpdates(_0x3dbc16){return function(_0x37c5f6){try{jsonpatch[_0xbffc('0x31')](_0x37c5f6,_0x3dbc16,!![]);}catch(_0x10d876){return BPromise['reject'](_0x10d876);}return _0x37c5f6[_0xbffc('0x32')]();};}function saveUpdates(_0x170541,_0x15b6a3){return function(_0x4e768d){if(_0x4e768d){return _0x4e768d[_0xbffc('0x33')](_0x170541)['then'](function(_0x4d54b5){return _0x4d54b5;});}return null;};}function removeEntity(_0x1a136f,_0xf6a31c){return function(_0x32985c){if(_0x32985c){return _0x32985c[_0xbffc('0x34')]()['then'](function(){var _0x4d87d8=_0x32985c[_0xbffc('0x35')]({'plain':!![]});var _0x189883='ChatQueues';return db[_0xbffc('0x36')][_0xbffc('0x34')]({'where':{'type':_0x189883,'resourceId':_0x4d87d8['id']}})[_0xbffc('0x37')](function(){return _0x32985c;});})[_0xbffc('0x37')](function(){_0x1a136f[_0xbffc('0x29')](0xcc)[_0xbffc('0x2a')]();});}};}function handleEntityNotFound(_0x574d31,_0x16eb5e){return function(_0x3b4e96){if(!_0x3b4e96){_0x574d31[_0xbffc('0x28')](0x194);}return _0x3b4e96;};}function handleError(_0x2ccb9d,_0x2fb110){_0x2fb110=_0x2fb110||0x1f4;return function(_0x148de3){logger['error'](_0x148de3[_0xbffc('0x38')]);if(_0x148de3[_0xbffc('0x39')]){delete _0x148de3[_0xbffc('0x39')];}_0x2ccb9d[_0xbffc('0x29')](_0x2fb110)['send'](_0x148de3);};}exports[_0xbffc('0x3a')]=function(_0x187181,_0x558916){var _0x426e19={},_0x31f2c3={},_0x3a87a4={'count':0x0,'rows':[]};var _0x278362=_[_0xbffc('0x3b')](db[_0xbffc('0x3c')][_0xbffc('0x3d')],function(_0x2b2c53){return{'name':_0x2b2c53['fieldName'],'type':_0x2b2c53[_0xbffc('0x3e')][_0xbffc('0x3f')]};});_0x31f2c3[_0xbffc('0x40')]=_['map'](_0x278362,_0xbffc('0x39'));_0x31f2c3['query']=_['keys'](_0x187181[_0xbffc('0x41')]);_0x31f2c3[_0xbffc('0x42')]=_[_0xbffc('0x43')](_0x31f2c3['model'],_0x31f2c3[_0xbffc('0x41')]);_0x426e19['attributes']=_[_0xbffc('0x43')](_0x31f2c3['model'],qs[_0xbffc('0x44')](_0x187181[_0xbffc('0x41')]['fields']));_0x426e19[_0xbffc('0x45')]=_0x426e19[_0xbffc('0x45')][_0xbffc('0x46')]?_0x426e19[_0xbffc('0x45')]:_0x31f2c3[_0xbffc('0x40')];if(!_0x187181[_0xbffc('0x41')][_0xbffc('0x47')](_0xbffc('0x48'))){_0x426e19[_0xbffc('0x2c')]=qs[_0xbffc('0x2c')](_0x187181[_0xbffc('0x41')][_0xbffc('0x2c')]);_0x426e19[_0xbffc('0x2e')]=qs[_0xbffc('0x2e')](_0x187181[_0xbffc('0x41')][_0xbffc('0x2e')]);}_0x426e19[_0xbffc('0x49')]=qs[_0xbffc('0x4a')](_0x187181[_0xbffc('0x41')][_0xbffc('0x4a')]);_0x426e19['where']=qs[_0xbffc('0x42')](_['pick'](_0x187181['query'],_0x31f2c3['filters']),_0x278362);if(_0x187181['query'][_0xbffc('0x4b')]){_0x426e19[_0xbffc('0x4c')]=_['merge'](_0x426e19['where'],{'$or':_['map'](_0x278362,function(_0x4d0e91){if(_0x4d0e91[_0xbffc('0x3e')]!==_0xbffc('0x4d')){var _0x2a41a3={};_0x2a41a3[_0x4d0e91[_0xbffc('0x39')]]={'$like':'%'+_0x187181['query'][_0xbffc('0x4b')]+'%'};return _0x2a41a3;}})});}_0x426e19=_[_0xbffc('0x4e')]({},_0x426e19,_0x187181[_0xbffc('0x4f')]);var _0x375e36={'where':_0x426e19[_0xbffc('0x4c')]};return db['ChatQueue']['count'](_0x375e36)[_0xbffc('0x37')](function(_0x35a80a){_0x3a87a4[_0xbffc('0x2d')]=_0x35a80a;if(_0x187181[_0xbffc('0x41')]['includeAll']){_0x426e19['include']=[{'all':!![]}];}return db[_0xbffc('0x3c')][_0xbffc('0x50')](_0x426e19);})[_0xbffc('0x37')](function(_0x22b037){_0x3a87a4[_0xbffc('0x51')]=_0x22b037;return _0x3a87a4;})[_0xbffc('0x37')](respondWithFilteredResult(_0x558916,_0x426e19))[_0xbffc('0x27')](handleError(_0x558916,null));};exports[_0xbffc('0x52')]=function(_0x4bcc8f,_0x48db90){var _0x43b1a0={'raw':!![],'where':{'id':_0x4bcc8f[_0xbffc('0x53')]['id']}},_0x328c14={};_0x328c14[_0xbffc('0x40')]=_['keys'](db[_0xbffc('0x3c')][_0xbffc('0x3d')]);_0x328c14[_0xbffc('0x41')]=_['keys'](_0x4bcc8f[_0xbffc('0x41')]);_0x328c14['filters']=_[_0xbffc('0x43')](_0x328c14[_0xbffc('0x40')],_0x328c14[_0xbffc('0x41')]);_0x43b1a0['attributes']=_[_0xbffc('0x43')](_0x328c14[_0xbffc('0x40')],qs[_0xbffc('0x44')](_0x4bcc8f[_0xbffc('0x41')][_0xbffc('0x44')]));_0x43b1a0[_0xbffc('0x45')]=_0x43b1a0[_0xbffc('0x45')][_0xbffc('0x46')]?_0x43b1a0['attributes']:_0x328c14[_0xbffc('0x40')];if(_0x4bcc8f['query']['includeAll']){_0x43b1a0[_0xbffc('0x54')]=[{'all':!![]}];}_0x43b1a0=_[_0xbffc('0x4e')]({},_0x43b1a0,_0x4bcc8f[_0xbffc('0x4f')]);return db[_0xbffc('0x3c')][_0xbffc('0x55')](_0x43b1a0)['then'](handleEntityNotFound(_0x48db90,null))[_0xbffc('0x37')](respondWithResult(_0x48db90,null))[_0xbffc('0x27')](handleError(_0x48db90,null));};exports[_0xbffc('0x56')]=function(_0x33baf0,_0x18a9e8){return db['ChatQueue'][_0xbffc('0x56')](_0x33baf0[_0xbffc('0x57')],{})['then'](function(_0x26f181){var _0x1e9447=_0x33baf0[_0xbffc('0x58')]['get']({'plain':!![]});if(!_0x1e9447)throw new Error(_0xbffc('0x59'));if(_0x1e9447[_0xbffc('0x5a')]===_0xbffc('0x58')){var _0xb2e52c=_0x26f181[_0xbffc('0x35')]({'plain':!![]});var _0x598405=_0xbffc('0x5b');return db['UserProfileSection'][_0xbffc('0x55')]({'where':{'name':_0x598405,'userProfileId':_0x1e9447[_0xbffc('0x5c')]},'raw':!![]})[_0xbffc('0x37')](function(_0xd903){if(_0xd903&&_0xd903['autoAssociation']===0x0){return db[_0xbffc('0x36')]['create']({'name':_0xb2e52c[_0xbffc('0x39')],'resourceId':_0xb2e52c['id'],'type':_0xd903[_0xbffc('0x39')],'sectionId':_0xd903['id']},{})[_0xbffc('0x37')](function(){return _0x26f181;});}else{return _0x26f181;}})['catch'](function(_0x55ce55){logger[_0xbffc('0x24')](_0xbffc('0x5d'),_0x55ce55);throw _0x55ce55;});}return _0x26f181;})[_0xbffc('0x37')](respondWithResult(_0x18a9e8,0xc9))[_0xbffc('0x27')](handleError(_0x18a9e8,null));};exports[_0xbffc('0x33')]=function(_0xa19353,_0x384aab){if(_0xa19353['body']['id']){delete _0xa19353['body']['id'];}return db[_0xbffc('0x3c')][_0xbffc('0x55')]({'where':{'id':_0xa19353[_0xbffc('0x53')]['id']}})[_0xbffc('0x37')](handleEntityNotFound(_0x384aab,null))['then'](saveUpdates(_0xa19353[_0xbffc('0x57')],null))['then'](respondWithResult(_0x384aab,null))[_0xbffc('0x27')](handleError(_0x384aab,null));};exports[_0xbffc('0x34')]=function(_0x1544e0,_0x16ff7e){return db[_0xbffc('0x3c')][_0xbffc('0x55')]({'where':{'id':_0x1544e0[_0xbffc('0x53')]['id']}})[_0xbffc('0x37')](handleEntityNotFound(_0x16ff7e,null))['then'](removeEntity(_0x16ff7e,null))[_0xbffc('0x27')](handleError(_0x16ff7e,null));};exports['describe']=function(_0x16407b,_0x4f8f83){return db[_0xbffc('0x3c')][_0xbffc('0x5e')]()[_0xbffc('0x37')](respondWithResult(_0x4f8f83,null))[_0xbffc('0x27')](handleError(_0x4f8f83,null));};exports[_0xbffc('0x5f')]=function(_0x49283c,_0x7d7531,_0x5755cd){var _0x38408e={'raw':!![],'where':{}},_0x20f232={},_0x5303ea;return db['ChatQueue'][_0xbffc('0x60')]({'where':{'id':_0x49283c['params']['id']}})[_0xbffc('0x37')](handleEntityNotFound(_0x7d7531,null))[_0xbffc('0x37')](function(_0x480c6b){if(_0x480c6b){_0x5303ea=_0x480c6b[_0xbffc('0x35')]({'plain':!![]});_0x20f232[_0xbffc('0x40')]=_[_0xbffc('0x61')](db['UserChatQueue'][_0xbffc('0x3d')]);_0x20f232[_0xbffc('0x41')]=_[_0xbffc('0x61')](_0x49283c[_0xbffc('0x41')]);_0x20f232[_0xbffc('0x42')]=_['intersection'](_0x20f232['model'],_0x20f232[_0xbffc('0x41')]);_0x38408e[_0xbffc('0x45')]=_[_0xbffc('0x43')](_0x20f232[_0xbffc('0x40')],qs[_0xbffc('0x44')](_0x49283c[_0xbffc('0x41')][_0xbffc('0x44')]));_0x38408e[_0xbffc('0x45')]=_0x38408e['attributes']['length']?_0x38408e[_0xbffc('0x45')]:_0x20f232[_0xbffc('0x40')];if(!_0x49283c['query']['hasOwnProperty']('nolimit')){_0x38408e[_0xbffc('0x2c')]=qs[_0xbffc('0x2c')](_0x49283c[_0xbffc('0x41')]['limit']);_0x38408e[_0xbffc('0x2e')]=qs[_0xbffc('0x2e')](_0x49283c[_0xbffc('0x41')][_0xbffc('0x2e')]);}_0x38408e[_0xbffc('0x49')]=qs[_0xbffc('0x4a')](_0x49283c[_0xbffc('0x41')][_0xbffc('0x4a')]);_0x38408e[_0xbffc('0x4c')]=qs['filters'](_[_0xbffc('0x62')](_0x49283c[_0xbffc('0x41')],_0x20f232['filters']));_0x38408e['where']['ChatQueueId']=_0x480c6b['id'];if(_0x49283c[_0xbffc('0x41')][_0xbffc('0x4b')]){_0x38408e['where']=_[_0xbffc('0x4e')](_0x38408e['where'],{'$or':_['map'](_0x38408e[_0xbffc('0x45')],function(_0xfa3a58){var _0x222a3c={};_0x222a3c[_0xfa3a58]={'$like':'%'+_0x49283c[_0xbffc('0x41')][_0xbffc('0x4b')]+'%'};return _0x222a3c;})});}_0x38408e=_['merge']({},_0x38408e,_0x49283c[_0xbffc('0x4f')]);return db[_0xbffc('0x63')]['findAll'](_0x38408e);}})['then'](function(_0x41e1ec){if(_0x41e1ec){return db[_0xbffc('0x64')]['findAndCountAll']({'where':{'id':_[_0xbffc('0x3b')](_0x41e1ec,_0xbffc('0x65')),'role':_0xbffc('0x66')},'attributes':['id',_0xbffc('0x39'),'chatPause',_0xbffc('0x67'),_0xbffc('0x68')]});}})[_0xbffc('0x37')](function(_0x3b8064){if(_0x3b8064){return{'count':_0x3b8064[_0xbffc('0x2d')],'rows':_[_0xbffc('0x3b')](_0x3b8064[_0xbffc('0x51')],function(_0x4f5b61){return{'membername':_0x4f5b61[_0xbffc('0x39')],'UserId':_0x4f5b61['id'],'queue_name':_0x5303ea['name'],'ChatQueueId':_0x5303ea['id'],'interface':util['format'](_0xbffc('0x69'),_0xbffc('0x6a'),_0x4f5b61['name']),'penalty':0x0,'paused':_0x4f5b61[_0xbffc('0x6b')],'createdAt':_0x4f5b61[_0xbffc('0x68')],'updatedAt':_0x4f5b61[_0xbffc('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x7d7531,_0x38408e))[_0xbffc('0x27')](handleError(_0x7d7531,null));};exports['getTeams']=function(_0xec59b0,_0x32d288,_0x2d94ba){var _0x15bc6c={};var _0x1e3ebb={};var _0x5cb2a7;var _0xc05232;return db['ChatQueue']['findOne']({'where':{'id':_0xec59b0[_0xbffc('0x53')]['id']}})[_0xbffc('0x37')](handleEntityNotFound(_0x32d288,null))[_0xbffc('0x37')](function(_0x454f08){if(_0x454f08){_0x5cb2a7=_0x454f08;_0x1e3ebb[_0xbffc('0x40')]=_[_0xbffc('0x61')](db['Team']['rawAttributes']);_0x1e3ebb['query']=_[_0xbffc('0x61')](_0xec59b0[_0xbffc('0x41')]);_0x1e3ebb[_0xbffc('0x42')]=_[_0xbffc('0x43')](_0x1e3ebb[_0xbffc('0x40')],_0x1e3ebb[_0xbffc('0x41')]);_0x15bc6c['attributes']=_[_0xbffc('0x43')](_0x1e3ebb['model'],qs[_0xbffc('0x44')](_0xec59b0[_0xbffc('0x41')]['fields']));_0x15bc6c[_0xbffc('0x45')]=_0x15bc6c[_0xbffc('0x45')][_0xbffc('0x46')]?_0x15bc6c[_0xbffc('0x45')]:_0x1e3ebb[_0xbffc('0x40')];_0x15bc6c[_0xbffc('0x49')]=qs[_0xbffc('0x4a')](_0xec59b0['query'][_0xbffc('0x4a')]);_0x15bc6c[_0xbffc('0x4c')]=qs[_0xbffc('0x42')](_['pick'](_0xec59b0[_0xbffc('0x41')],_0x1e3ebb[_0xbffc('0x42')]));if(_0xec59b0['query']['filter']){_0x15bc6c[_0xbffc('0x4c')]=_['merge'](_0x15bc6c[_0xbffc('0x4c')],{'$or':_['map'](_0x15bc6c[_0xbffc('0x45')],function(_0xe4cdf9){var _0x1869b4={};_0x1869b4[_0xe4cdf9]={'$like':'%'+_0xec59b0['query'][_0xbffc('0x4b')]+'%'};return _0x1869b4;})});}_0x15bc6c=_[_0xbffc('0x4e')]({},_0x15bc6c,_0xec59b0['options']);return _0x5cb2a7[_0xbffc('0x6c')](_0x15bc6c);}})[_0xbffc('0x37')](function(_0x10875b){if(_0x10875b){_0xc05232=_0x10875b[_0xbffc('0x46')];if(!_0xec59b0[_0xbffc('0x41')][_0xbffc('0x47')](_0xbffc('0x48'))){_0x15bc6c[_0xbffc('0x2c')]=qs[_0xbffc('0x2c')](_0xec59b0['query'][_0xbffc('0x2c')]);_0x15bc6c[_0xbffc('0x2e')]=qs[_0xbffc('0x2e')](_0xec59b0['query'][_0xbffc('0x2e')]);}return _0x5cb2a7[_0xbffc('0x6c')](_0x15bc6c);}})['then'](function(_0x745f40){if(_0x745f40){return _0x745f40?{'count':_0xc05232,'rows':_0x745f40}:null;}})[_0xbffc('0x37')](respondWithResult(_0x32d288,null))['catch'](handleError(_0x32d288,null));};exports[_0xbffc('0x6d')]=function(_0x31d8ff,_0x43be62,_0x4d7d2c){var _0x4bbf25=_0x31d8ff['body'][_0xbffc('0x6e')];return db['Team']['findAll']({'where':{'id':_0x4bbf25},'attributes':['id'],'include':[{'model':db[_0xbffc('0x64')],'as':_0xbffc('0x6f'),'attributes':['id',_0xbffc('0x39'),_0xbffc('0x70'),_0xbffc('0x71'),_0xbffc('0x72')],'raw':!![]}]})[_0xbffc('0x37')](function(_0x3baffc){if(_0x3baffc){var _0x22bfb6=_[_0xbffc('0x73')](_0x3baffc,function(_0x5ccf95){var _0x3161fc=_0x5ccf95[_0xbffc('0x35')]({'plain':!![]});return _0x3161fc['Agents'];});return db[_0xbffc('0x3c')][_0xbffc('0x55')]({'where':{'id':_0x31d8ff['params']['id']}})[_0xbffc('0x37')](function(_0x3775f5){return db[_0xbffc('0x74')][_0xbffc('0x75')](function(_0x2a6b2a){return _0x3775f5['addTeams'](_0x4bbf25,{'transaction':_0x2a6b2a})[_0xbffc('0x37')](function(){return BPromise[_0xbffc('0x76')](_0x22bfb6,function(_0x2d0432){return db['UserChatQueue']['findOrCreate']({'where':{'UserId':_0x2d0432['id'],'ChatQueueId':_0x31d8ff[_0xbffc('0x53')]['id']},'transaction':_0x2a6b2a});});})[_0xbffc('0x37')](function(){_0x22bfb6[_0xbffc('0x77')](function(_0x19148f){socket[_0xbffc('0x78')]('userChatQueue:save',{'UserId':_0x19148f['id'],'ChatQueueId':_0x3775f5['id']});});});});});}})[_0xbffc('0x37')](respondWithStatusCode(_0x43be62,null))[_0xbffc('0x27')](handleError(_0x43be62,null));};exports[_0xbffc('0x79')]=function(_0x1de61e,_0x1624ce,_0x460e46){return db[_0xbffc('0x7a')]['findAll']({'where':{'id':_0x1de61e[_0xbffc('0x41')][_0xbffc('0x6e')]},'attributes':['id'],'include':[{'model':db[_0xbffc('0x64')],'as':_0xbffc('0x6f'),'attributes':['id'],'raw':!![]}]})[_0xbffc('0x37')](handleEntityNotFound(_0x1624ce,null))[_0xbffc('0x37')](function(_0x1d80d0){var _0x23cbb6=_[_0xbffc('0x3b')](_0x1d80d0,'id');var _0x179341=[];var _0x370c6c=[];var _0x5d5144=squel[_0xbffc('0x7b')]();_0x5d5144[_0xbffc('0x7c')]('tq.TeamId')[_0xbffc('0x7d')](_0xbffc('0x7e'),'tq')[_0xbffc('0x7f')]('user_has_teams','ut',_0xbffc('0x80'))[_0xbffc('0x4c')](_0xbffc('0x81'),_0x1de61e[_0xbffc('0x53')]['id']);for(var _0x53a088=0x0;_0x53a088<_0x1d80d0['length'];_0x53a088+=0x1){let _0x529ffd=_0x1d80d0[_0x53a088];for(var _0x4adb35=0x0;_0x4adb35<_0x529ffd['Agents']['length'];_0x4adb35+=0x1){let _0x3efa82=_0x529ffd[_0xbffc('0x6f')][_0x4adb35];var _0x5c131a=_0x5d5144[_0xbffc('0x82')]();_0x5c131a[_0xbffc('0x4c')](_0xbffc('0x83'),_0x3efa82['id']);_0x370c6c[_0xbffc('0x84')](db[_0xbffc('0x74')][_0xbffc('0x41')](_0x5c131a['toString'](),{'type':db['sequelize'][_0xbffc('0x85')][_0xbffc('0x86')]})[_0xbffc('0x37')](function(_0xc0df87){if(_0xc0df87[_0xbffc('0x46')]===0x1){return _0x3efa82['id'];}else{var _0x58fee6=_[_0xbffc('0x87')](_[_0xbffc('0x3b')](_0xc0df87,_0xbffc('0x88')),function(_0xeed923){return _['includes'](_0x23cbb6,_0xeed923);});if(_0x58fee6){return _0x3efa82['id'];}}}));}}return BPromise[_0xbffc('0x89')](_0x370c6c)[_0xbffc('0x37')](function(_0x33ef07){_0x179341=_(_0x179341)[_0xbffc('0x8a')](_0x33ef07)[_0xbffc('0x8b')]()[_0xbffc('0x8c')]();return db[_0xbffc('0x3c')][_0xbffc('0x55')]({'where':{'id':_0x1de61e[_0xbffc('0x53')]['id']}})[_0xbffc('0x37')](function(_0x5f0b49){return db['sequelize']['transaction'](function(_0x579429){return _0x5f0b49[_0xbffc('0x79')](_0x1de61e[_0xbffc('0x41')][_0xbffc('0x6e')],{'transaction':_0x579429})[_0xbffc('0x37')](function(){if(!_['isEmpty'](_0x179341)){return _0x5f0b49[_0xbffc('0x8d')](_0x179341,{'transaction':_0x579429});}})[_0xbffc('0x37')](function(){_0x179341[_0xbffc('0x77')](function(_0x158b72){socket[_0xbffc('0x78')](_0xbffc('0x8e'),{'UserId':_0x158b72,'ChatQueueId':_0x5f0b49['id']});});});});});});})[_0xbffc('0x37')](respondWithStatusCode(_0x1624ce,null))[_0xbffc('0x27')](handleError(_0x1624ce,null));};exports[_0xbffc('0x8f')]=function(_0x4666a8,_0x165874,_0x496fde){return db[_0xbffc('0x3c')][_0xbffc('0x55')]({'where':{'id':_0x4666a8[_0xbffc('0x53')]['id']}})[_0xbffc('0x37')](handleEntityNotFound(_0x165874,null))[_0xbffc('0x37')](function(_0x4bb134){if(_0x4bb134){return _0x4bb134[_0xbffc('0x8f')](_0x4666a8[_0xbffc('0x57')][_0xbffc('0x6e')],_[_0xbffc('0x90')](_0x4666a8[_0xbffc('0x57')],[_0xbffc('0x6e'),'id'])||{})[_0xbffc('0x91')](function(_0x43e8a8){for(var _0x3c1023=0x0;_0x3c1023<_0x4666a8['body'][_0xbffc('0x6e')][_0xbffc('0x46')];_0x3c1023+=0x1){socket[_0xbffc('0x78')](_0xbffc('0x92'),{'UserId':Number(_0x4666a8[_0xbffc('0x57')][_0xbffc('0x6e')][_0x3c1023]),'ChatQueueId':Number(_0x4666a8[_0xbffc('0x53')]['id'])});}return _0x43e8a8;});}})[_0xbffc('0x37')](respondWithResult(_0x165874,null))[_0xbffc('0x27')](handleError(_0x165874,null));};exports[_0xbffc('0x8d')]=function(_0x515d05,_0x1ffc7b,_0x28b0d4){return db[_0xbffc('0x3c')][_0xbffc('0x55')]({'where':{'id':_0x515d05[_0xbffc('0x53')]['id']}})[_0xbffc('0x37')](handleEntityNotFound(_0x1ffc7b,null))[_0xbffc('0x37')](function(_0x38cde3){if(_0x38cde3){return _0x38cde3[_0xbffc('0x8d')](_0x515d05['query'][_0xbffc('0x6e')])[_0xbffc('0x37')](function(){if(_[_0xbffc('0x93')](_0x515d05['query'][_0xbffc('0x6e')])){for(var _0x31bd54=0x0;_0x31bd54<_0x515d05[_0xbffc('0x41')][_0xbffc('0x6e')][_0xbffc('0x46')];_0x31bd54+=0x1){socket['emit'](_0xbffc('0x8e'),{'UserId':Number(_0x515d05[_0xbffc('0x41')][_0xbffc('0x6e')][_0x31bd54]),'ChatQueueId':Number(_0x515d05[_0xbffc('0x53')]['id'])});}}else{socket[_0xbffc('0x78')](_0xbffc('0x8e'),{'UserId':Number(_0x515d05[_0xbffc('0x41')][_0xbffc('0x6e')]),'ChatQueueId':Number(_0x515d05[_0xbffc('0x53')]['id'])});}});}})[_0xbffc('0x37')](respondWithStatusCode(_0x1ffc7b,null))[_0xbffc('0x27')](handleError(_0x1ffc7b,null));};exports[_0xbffc('0x94')]=function(_0x115bd1,_0x4bf44e,_0x5e3d76){var _0x39f16e={};var _0x30b52f={};var _0x278ab9;var _0x4ed986;return db[_0xbffc('0x3c')][_0xbffc('0x60')]({'where':{'id':_0x115bd1[_0xbffc('0x53')]['id']}})[_0xbffc('0x37')](handleEntityNotFound(_0x4bf44e,null))[_0xbffc('0x37')](function(_0x1d02af){if(_0x1d02af){_0x278ab9=_0x1d02af;_0x30b52f[_0xbffc('0x40')]=_['keys'](db[_0xbffc('0x64')][_0xbffc('0x3d')]);_0x30b52f[_0xbffc('0x41')]=_['keys'](_0x115bd1[_0xbffc('0x41')]);_0x30b52f[_0xbffc('0x42')]=_[_0xbffc('0x43')](_0x30b52f['model'],_0x30b52f['query']);_0x39f16e[_0xbffc('0x45')]=_[_0xbffc('0x43')](_0x30b52f[_0xbffc('0x40')],qs[_0xbffc('0x44')](_0x115bd1['query'][_0xbffc('0x44')]));_0x39f16e[_0xbffc('0x45')]=_0x39f16e[_0xbffc('0x45')]['length']?_0x39f16e[_0xbffc('0x45')]:_0x30b52f[_0xbffc('0x40')];_0x39f16e[_0xbffc('0x49')]=qs[_0xbffc('0x4a')](_0x115bd1[_0xbffc('0x41')]['sort']);_0x39f16e[_0xbffc('0x4c')]=qs[_0xbffc('0x42')](_[_0xbffc('0x62')](_0x115bd1[_0xbffc('0x41')],_0x30b52f[_0xbffc('0x42')]));if(_0x115bd1[_0xbffc('0x41')][_0xbffc('0x4b')]){_0x39f16e['where']=_[_0xbffc('0x4e')](_0x39f16e['where'],{'$or':_[_0xbffc('0x3b')](_0x39f16e['attributes'],function(_0x59e71f){var _0x364f8f={};_0x364f8f[_0x59e71f]={'$like':'%'+_0x115bd1[_0xbffc('0x41')][_0xbffc('0x4b')]+'%'};return _0x364f8f;})});}_0x39f16e=_[_0xbffc('0x4e')]({},_0x39f16e,_0x115bd1['options']);return _0x278ab9[_0xbffc('0x94')](_0x39f16e);}})[_0xbffc('0x37')](function(_0x52ec04){if(_0x52ec04){_0x4ed986=_0x52ec04[_0xbffc('0x46')];if(!_0x115bd1[_0xbffc('0x41')]['hasOwnProperty'](_0xbffc('0x48'))){_0x39f16e['limit']=qs[_0xbffc('0x2c')](_0x115bd1['query'][_0xbffc('0x2c')]);_0x39f16e[_0xbffc('0x2e')]=qs[_0xbffc('0x2e')](_0x115bd1[_0xbffc('0x41')][_0xbffc('0x2e')]);}return _0x278ab9[_0xbffc('0x94')](_0x39f16e);}})['then'](function(_0x14bc4a){if(_0x14bc4a){return _0x14bc4a?{'count':_0x4ed986,'rows':_0x14bc4a}:null;}})[_0xbffc('0x37')](respondWithResult(_0x4bf44e,null))[_0xbffc('0x27')](handleError(_0x4bf44e,null));}; \ No newline at end of file +var _0x1aa0=['each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','TeamId','all','union','compact','value','transaction','addAgents','omit','spread','removeAgents','isArray','userChatQueue:remove','findOne','getAgents','eml-format','rimraf','zip-dir','moment','bluebird','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','localhost','redis','register','jayson/promise','client','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','end','status','offset','count','limit','set','Content-Range','json','reject','save','destroy','get','ChatQueues','UserProfileResource','stack','name','send','index','map','ChatQueue','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','UserChatQueue','ChatQueueId','User','agent','chatPause','updatedAt','%s/%s','SIP','createdAt','Team','getTeams','addTeams','ids','Agents','voicePause','interface','flatMap','sequelize'];(function(_0x27ede2,_0x41b067){var _0x4a174d=function(_0x16f954){while(--_0x16f954){_0x27ede2['push'](_0x27ede2['shift']());}};_0x4a174d(++_0x41b067);}(_0x1aa0,0x141));var _0x01aa=function(_0x2bc3f4,_0x470b26){_0x2bc3f4=_0x2bc3f4-0x0;var _0x14ac53=_0x1aa0[_0x2bc3f4];return _0x14ac53;};'use strict';var emlformat=require(_0x01aa('0x0'));var rimraf=require(_0x01aa('0x1'));var zipdir=require(_0x01aa('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x01aa('0x3'));var BPromise=require(_0x01aa('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x01aa('0x5'));var sox=require(_0x01aa('0x6'));var csv=require(_0x01aa('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x01aa('0x8'));var _=require(_0x01aa('0x9'));var squel=require('squel');var crypto=require(_0x01aa('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x01aa('0xb'));var toCsv=require(_0x01aa('0x7'));var querystring=require('querystring');var Papa=require(_0x01aa('0xc'));var Redis=require('ioredis');var authService=require(_0x01aa('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x01aa('0xe'));var hardwareService=require(_0x01aa('0xf'));var logger=require(_0x01aa('0x10'))(_0x01aa('0x11'));var utils=require(_0x01aa('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x01aa('0x13'))['db'];config['redis']=_[_0x01aa('0x14')](config['redis'],{'host':_0x01aa('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x01aa('0x16')]));require('./chatQueue.socket')[_0x01aa('0x17')](socket);var jayson=require(_0x01aa('0x18'));var client=jayson[_0x01aa('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5f091c,_0x116167,_0x4dc23b,_0x18fc88){return new BPromise(function(_0x4d5256,_0x2df5cc){var _0x121bf5=_0x18fc88||client;return _0x121bf5['request'](_0x5f091c,_0x4dc23b)[_0x01aa('0x1a')](function(_0x384b3d){logger[_0x01aa('0x1b')](_0x01aa('0x1c'),_0x116167,_0x01aa('0x1d'));logger['debug'](_0x01aa('0x1e'),_0x116167,'request\x20sent',JSON[_0x01aa('0x1f')](_0x384b3d));if(_0x384b3d[_0x01aa('0x20')]){if(_0x384b3d[_0x01aa('0x20')][_0x01aa('0x21')]===0x1f4){logger[_0x01aa('0x20')](_0x01aa('0x1c'),_0x116167,_0x384b3d[_0x01aa('0x20')][_0x01aa('0x22')]);return _0x2df5cc(_0x384b3d[_0x01aa('0x20')][_0x01aa('0x22')]);}logger[_0x01aa('0x20')](_0x01aa('0x1c'),_0x116167,_0x384b3d['error']['message']);return _0x4d5256(_0x384b3d[_0x01aa('0x20')][_0x01aa('0x22')]);}else{logger['info'](_0x01aa('0x1c'),_0x116167,_0x01aa('0x1d'));_0x4d5256(_0x384b3d[_0x01aa('0x23')][_0x01aa('0x22')]);}})['catch'](function(_0x286020){logger[_0x01aa('0x20')](_0x01aa('0x1c'),_0x116167,_0x286020);_0x2df5cc(_0x286020);});});}function respondWithStatusCode(_0x522819,_0x4ff459){_0x4ff459=_0x4ff459||0xcc;return function(_0x56f48b){if(_0x56f48b){return _0x522819[_0x01aa('0x24')](_0x4ff459);}return _0x522819['status'](_0x4ff459)[_0x01aa('0x25')]();};}function respondWithResult(_0x170fe3,_0x50a51c){_0x50a51c=_0x50a51c||0xc8;return function(_0x500a0e){if(_0x500a0e){return _0x170fe3[_0x01aa('0x26')](_0x50a51c)['json'](_0x500a0e);}};}function respondWithFilteredResult(_0x4abc2b,_0x255922){return function(_0x437015){if(_0x437015){var _0x161ce1=typeof _0x255922[_0x01aa('0x27')]==='undefined'&&typeof _0x255922['limit']==='undefined';var _0x2606d3=_0x437015[_0x01aa('0x28')];var _0x24611d=_0x161ce1?0x0:_0x255922[_0x01aa('0x27')];var _0x1e01e1=_0x161ce1?_0x437015[_0x01aa('0x28')]:_0x255922[_0x01aa('0x27')]+_0x255922[_0x01aa('0x29')];var _0x268ba7;if(_0x1e01e1>=_0x2606d3){_0x1e01e1=_0x2606d3;_0x268ba7=0xc8;}else{_0x268ba7=0xce;}_0x4abc2b[_0x01aa('0x26')](_0x268ba7);return _0x4abc2b[_0x01aa('0x2a')](_0x01aa('0x2b'),_0x24611d+'-'+_0x1e01e1+'/'+_0x2606d3)[_0x01aa('0x2c')](_0x437015);}return null;};}function patchUpdates(_0x15a0e6){return function(_0x59158e){try{jsonpatch['apply'](_0x59158e,_0x15a0e6,!![]);}catch(_0x4fc34e){return BPromise[_0x01aa('0x2d')](_0x4fc34e);}return _0x59158e[_0x01aa('0x2e')]();};}function saveUpdates(_0xa94747,_0x484cb0){return function(_0x20d46d){if(_0x20d46d){return _0x20d46d['update'](_0xa94747)[_0x01aa('0x1a')](function(_0x22bd21){return _0x22bd21;});}return null;};}function removeEntity(_0x2975e3,_0x5aabfe){return function(_0x24a457){if(_0x24a457){return _0x24a457[_0x01aa('0x2f')]()['then'](function(){var _0x4e55db=_0x24a457[_0x01aa('0x30')]({'plain':!![]});var _0xbf2c83=_0x01aa('0x31');return db[_0x01aa('0x32')][_0x01aa('0x2f')]({'where':{'type':_0xbf2c83,'resourceId':_0x4e55db['id']}})[_0x01aa('0x1a')](function(){return _0x24a457;});})[_0x01aa('0x1a')](function(){_0x2975e3[_0x01aa('0x26')](0xcc)[_0x01aa('0x25')]();});}};}function handleEntityNotFound(_0x314da5,_0x2d1e78){return function(_0x348807){if(!_0x348807){_0x314da5[_0x01aa('0x24')](0x194);}return _0x348807;};}function handleError(_0x566583,_0x53c837){_0x53c837=_0x53c837||0x1f4;return function(_0x52075b){logger[_0x01aa('0x20')](_0x52075b[_0x01aa('0x33')]);if(_0x52075b[_0x01aa('0x34')]){delete _0x52075b['name'];}_0x566583[_0x01aa('0x26')](_0x53c837)[_0x01aa('0x35')](_0x52075b);};}exports[_0x01aa('0x36')]=function(_0x23bd68,_0x29412c){var _0x1be690={},_0x389a94={},_0x3f1fcd={'count':0x0,'rows':[]};var _0xf6e691=_[_0x01aa('0x37')](db[_0x01aa('0x38')][_0x01aa('0x39')],function(_0x4994ca){return{'name':_0x4994ca['fieldName'],'type':_0x4994ca[_0x01aa('0x3a')][_0x01aa('0x3b')]};});_0x389a94[_0x01aa('0x3c')]=_[_0x01aa('0x37')](_0xf6e691,'name');_0x389a94[_0x01aa('0x3d')]=_[_0x01aa('0x3e')](_0x23bd68['query']);_0x389a94[_0x01aa('0x3f')]=_[_0x01aa('0x40')](_0x389a94[_0x01aa('0x3c')],_0x389a94[_0x01aa('0x3d')]);_0x1be690['attributes']=_[_0x01aa('0x40')](_0x389a94[_0x01aa('0x3c')],qs[_0x01aa('0x41')](_0x23bd68[_0x01aa('0x3d')][_0x01aa('0x41')]));_0x1be690['attributes']=_0x1be690[_0x01aa('0x42')][_0x01aa('0x43')]?_0x1be690[_0x01aa('0x42')]:_0x389a94[_0x01aa('0x3c')];if(!_0x23bd68[_0x01aa('0x3d')][_0x01aa('0x44')](_0x01aa('0x45'))){_0x1be690[_0x01aa('0x29')]=qs[_0x01aa('0x29')](_0x23bd68[_0x01aa('0x3d')][_0x01aa('0x29')]);_0x1be690[_0x01aa('0x27')]=qs[_0x01aa('0x27')](_0x23bd68[_0x01aa('0x3d')][_0x01aa('0x27')]);}_0x1be690[_0x01aa('0x46')]=qs[_0x01aa('0x47')](_0x23bd68[_0x01aa('0x3d')][_0x01aa('0x47')]);_0x1be690[_0x01aa('0x48')]=qs['filters'](_[_0x01aa('0x49')](_0x23bd68[_0x01aa('0x3d')],_0x389a94[_0x01aa('0x3f')]),_0xf6e691);if(_0x23bd68[_0x01aa('0x3d')][_0x01aa('0x4a')]){_0x1be690[_0x01aa('0x48')]=_[_0x01aa('0x4b')](_0x1be690[_0x01aa('0x48')],{'$or':_[_0x01aa('0x37')](_0xf6e691,function(_0x55c300){if(_0x55c300[_0x01aa('0x3a')]!==_0x01aa('0x4c')){var _0x53e329={};_0x53e329[_0x55c300['name']]={'$like':'%'+_0x23bd68[_0x01aa('0x3d')][_0x01aa('0x4a')]+'%'};return _0x53e329;}})});}_0x1be690=_[_0x01aa('0x4b')]({},_0x1be690,_0x23bd68[_0x01aa('0x4d')]);var _0x4eb380={'where':_0x1be690[_0x01aa('0x48')]};return db[_0x01aa('0x38')][_0x01aa('0x28')](_0x4eb380)['then'](function(_0x431fd1){_0x3f1fcd[_0x01aa('0x28')]=_0x431fd1;if(_0x23bd68[_0x01aa('0x3d')][_0x01aa('0x4e')]){_0x1be690[_0x01aa('0x4f')]=[{'all':!![]}];}return db[_0x01aa('0x38')][_0x01aa('0x50')](_0x1be690);})[_0x01aa('0x1a')](function(_0x16d6e8){_0x3f1fcd[_0x01aa('0x51')]=_0x16d6e8;return _0x3f1fcd;})[_0x01aa('0x1a')](respondWithFilteredResult(_0x29412c,_0x1be690))[_0x01aa('0x52')](handleError(_0x29412c,null));};exports['show']=function(_0x4540a5,_0x1237de){var _0x47634f={'raw':!![],'where':{'id':_0x4540a5['params']['id']}},_0x24a294={};_0x24a294[_0x01aa('0x3c')]=_[_0x01aa('0x3e')](db[_0x01aa('0x38')][_0x01aa('0x39')]);_0x24a294['query']=_[_0x01aa('0x3e')](_0x4540a5[_0x01aa('0x3d')]);_0x24a294[_0x01aa('0x3f')]=_[_0x01aa('0x40')](_0x24a294[_0x01aa('0x3c')],_0x24a294[_0x01aa('0x3d')]);_0x47634f[_0x01aa('0x42')]=_[_0x01aa('0x40')](_0x24a294[_0x01aa('0x3c')],qs[_0x01aa('0x41')](_0x4540a5[_0x01aa('0x3d')][_0x01aa('0x41')]));_0x47634f[_0x01aa('0x42')]=_0x47634f[_0x01aa('0x42')][_0x01aa('0x43')]?_0x47634f[_0x01aa('0x42')]:_0x24a294[_0x01aa('0x3c')];if(_0x4540a5[_0x01aa('0x3d')][_0x01aa('0x4e')]){_0x47634f[_0x01aa('0x4f')]=[{'all':!![]}];}_0x47634f=_[_0x01aa('0x4b')]({},_0x47634f,_0x4540a5[_0x01aa('0x4d')]);return db[_0x01aa('0x38')][_0x01aa('0x53')](_0x47634f)[_0x01aa('0x1a')](handleEntityNotFound(_0x1237de,null))['then'](respondWithResult(_0x1237de,null))[_0x01aa('0x52')](handleError(_0x1237de,null));};exports[_0x01aa('0x54')]=function(_0xb12ecd,_0x2ae64e){return db[_0x01aa('0x38')]['create'](_0xb12ecd[_0x01aa('0x55')],{})[_0x01aa('0x1a')](function(_0xa68aa2){var _0x45dd44=_0xb12ecd['user'][_0x01aa('0x30')]({'plain':!![]});if(!_0x45dd44)throw new Error(_0x01aa('0x56'));if(_0x45dd44['role']===_0x01aa('0x57')){var _0x58c0f0=_0xa68aa2[_0x01aa('0x30')]({'plain':!![]});var _0x4875b5=_0x01aa('0x31');return db['UserProfileSection'][_0x01aa('0x53')]({'where':{'name':_0x4875b5,'userProfileId':_0x45dd44['userProfileId']},'raw':!![]})[_0x01aa('0x1a')](function(_0x53f412){if(_0x53f412&&_0x53f412[_0x01aa('0x58')]===0x0){return db[_0x01aa('0x32')]['create']({'name':_0x58c0f0[_0x01aa('0x34')],'resourceId':_0x58c0f0['id'],'type':_0x53f412['name'],'sectionId':_0x53f412['id']},{})['then'](function(){return _0xa68aa2;});}else{return _0xa68aa2;}})[_0x01aa('0x52')](function(_0x15b01e){logger[_0x01aa('0x20')](_0x01aa('0x59'),_0x15b01e);throw _0x15b01e;});}return _0xa68aa2;})[_0x01aa('0x1a')](respondWithResult(_0x2ae64e,0xc9))['catch'](handleError(_0x2ae64e,null));};exports[_0x01aa('0x5a')]=function(_0x5706bc,_0x3bfad4){if(_0x5706bc['body']['id']){delete _0x5706bc[_0x01aa('0x55')]['id'];}return db[_0x01aa('0x38')][_0x01aa('0x53')]({'where':{'id':_0x5706bc[_0x01aa('0x5b')]['id']}})[_0x01aa('0x1a')](handleEntityNotFound(_0x3bfad4,null))[_0x01aa('0x1a')](saveUpdates(_0x5706bc[_0x01aa('0x55')],null))['then'](respondWithResult(_0x3bfad4,null))[_0x01aa('0x52')](handleError(_0x3bfad4,null));};exports[_0x01aa('0x2f')]=function(_0x1da9f6,_0x59a992){return db['ChatQueue']['find']({'where':{'id':_0x1da9f6[_0x01aa('0x5b')]['id']}})['then'](handleEntityNotFound(_0x59a992,null))[_0x01aa('0x1a')](removeEntity(_0x59a992,null))['catch'](handleError(_0x59a992,null));};exports[_0x01aa('0x5c')]=function(_0x487ce6,_0x10a3a0){return db[_0x01aa('0x38')]['describe']()[_0x01aa('0x1a')](respondWithResult(_0x10a3a0,null))[_0x01aa('0x52')](handleError(_0x10a3a0,null));};exports['getMembers']=function(_0x4cf2d3,_0x413680,_0x784692){var _0x166ff9={'raw':!![],'where':{}},_0x2f74b8={},_0x1c45b7;return db['ChatQueue']['findOne']({'where':{'id':_0x4cf2d3['params']['id']}})[_0x01aa('0x1a')](handleEntityNotFound(_0x413680,null))[_0x01aa('0x1a')](function(_0x3c0934){if(_0x3c0934){_0x1c45b7=_0x3c0934['get']({'plain':!![]});_0x2f74b8[_0x01aa('0x3c')]=_[_0x01aa('0x3e')](db[_0x01aa('0x5d')]['rawAttributes']);_0x2f74b8[_0x01aa('0x3d')]=_['keys'](_0x4cf2d3[_0x01aa('0x3d')]);_0x2f74b8[_0x01aa('0x3f')]=_[_0x01aa('0x40')](_0x2f74b8[_0x01aa('0x3c')],_0x2f74b8[_0x01aa('0x3d')]);_0x166ff9[_0x01aa('0x42')]=_[_0x01aa('0x40')](_0x2f74b8[_0x01aa('0x3c')],qs[_0x01aa('0x41')](_0x4cf2d3[_0x01aa('0x3d')][_0x01aa('0x41')]));_0x166ff9[_0x01aa('0x42')]=_0x166ff9['attributes'][_0x01aa('0x43')]?_0x166ff9[_0x01aa('0x42')]:_0x2f74b8[_0x01aa('0x3c')];if(!_0x4cf2d3[_0x01aa('0x3d')]['hasOwnProperty']('nolimit')){_0x166ff9[_0x01aa('0x29')]=qs['limit'](_0x4cf2d3[_0x01aa('0x3d')][_0x01aa('0x29')]);_0x166ff9[_0x01aa('0x27')]=qs[_0x01aa('0x27')](_0x4cf2d3['query'][_0x01aa('0x27')]);}_0x166ff9[_0x01aa('0x46')]=qs[_0x01aa('0x47')](_0x4cf2d3[_0x01aa('0x3d')][_0x01aa('0x47')]);_0x166ff9[_0x01aa('0x48')]=qs[_0x01aa('0x3f')](_[_0x01aa('0x49')](_0x4cf2d3[_0x01aa('0x3d')],_0x2f74b8[_0x01aa('0x3f')]));_0x166ff9[_0x01aa('0x48')][_0x01aa('0x5e')]=_0x3c0934['id'];if(_0x4cf2d3[_0x01aa('0x3d')][_0x01aa('0x4a')]){_0x166ff9[_0x01aa('0x48')]=_[_0x01aa('0x4b')](_0x166ff9[_0x01aa('0x48')],{'$or':_[_0x01aa('0x37')](_0x166ff9[_0x01aa('0x42')],function(_0x41f337){var _0x59f009={};_0x59f009[_0x41f337]={'$like':'%'+_0x4cf2d3['query'][_0x01aa('0x4a')]+'%'};return _0x59f009;})});}_0x166ff9=_[_0x01aa('0x4b')]({},_0x166ff9,_0x4cf2d3[_0x01aa('0x4d')]);return db[_0x01aa('0x5d')][_0x01aa('0x50')](_0x166ff9);}})[_0x01aa('0x1a')](function(_0x1041df){if(_0x1041df){return db[_0x01aa('0x5f')]['findAndCountAll']({'where':{'id':_[_0x01aa('0x37')](_0x1041df,'UserId'),'role':_0x01aa('0x60')},'attributes':['id','name',_0x01aa('0x61'),_0x01aa('0x62'),'createdAt']});}})['then'](function(_0x4cf2fa){if(_0x4cf2fa){return{'count':_0x4cf2fa[_0x01aa('0x28')],'rows':_[_0x01aa('0x37')](_0x4cf2fa[_0x01aa('0x51')],function(_0x5491ad){return{'membername':_0x5491ad['name'],'UserId':_0x5491ad['id'],'queue_name':_0x1c45b7[_0x01aa('0x34')],'ChatQueueId':_0x1c45b7['id'],'interface':util['format'](_0x01aa('0x63'),_0x01aa('0x64'),_0x5491ad[_0x01aa('0x34')]),'penalty':0x0,'paused':_0x5491ad[_0x01aa('0x61')],'createdAt':_0x5491ad[_0x01aa('0x65')],'updatedAt':_0x5491ad[_0x01aa('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x01aa('0x1a')](respondWithFilteredResult(_0x413680,_0x166ff9))[_0x01aa('0x52')](handleError(_0x413680,null));};exports['getTeams']=function(_0x1ddda5,_0x44a119,_0x19449c){var _0x3e6662={};var _0x28b5fb={};var _0x416834;var _0x3d59b9;return db[_0x01aa('0x38')]['findOne']({'where':{'id':_0x1ddda5[_0x01aa('0x5b')]['id']}})['then'](handleEntityNotFound(_0x44a119,null))[_0x01aa('0x1a')](function(_0x288554){if(_0x288554){_0x416834=_0x288554;_0x28b5fb['model']=_[_0x01aa('0x3e')](db[_0x01aa('0x66')][_0x01aa('0x39')]);_0x28b5fb['query']=_[_0x01aa('0x3e')](_0x1ddda5[_0x01aa('0x3d')]);_0x28b5fb['filters']=_[_0x01aa('0x40')](_0x28b5fb['model'],_0x28b5fb[_0x01aa('0x3d')]);_0x3e6662['attributes']=_[_0x01aa('0x40')](_0x28b5fb[_0x01aa('0x3c')],qs[_0x01aa('0x41')](_0x1ddda5[_0x01aa('0x3d')][_0x01aa('0x41')]));_0x3e6662[_0x01aa('0x42')]=_0x3e6662['attributes']['length']?_0x3e6662['attributes']:_0x28b5fb[_0x01aa('0x3c')];_0x3e6662[_0x01aa('0x46')]=qs[_0x01aa('0x47')](_0x1ddda5[_0x01aa('0x3d')]['sort']);_0x3e6662[_0x01aa('0x48')]=qs[_0x01aa('0x3f')](_[_0x01aa('0x49')](_0x1ddda5['query'],_0x28b5fb[_0x01aa('0x3f')]));if(_0x1ddda5[_0x01aa('0x3d')][_0x01aa('0x4a')]){_0x3e6662[_0x01aa('0x48')]=_[_0x01aa('0x4b')](_0x3e6662['where'],{'$or':_[_0x01aa('0x37')](_0x3e6662['attributes'],function(_0x4a62c1){var _0x38635e={};_0x38635e[_0x4a62c1]={'$like':'%'+_0x1ddda5['query'][_0x01aa('0x4a')]+'%'};return _0x38635e;})});}_0x3e6662=_[_0x01aa('0x4b')]({},_0x3e6662,_0x1ddda5[_0x01aa('0x4d')]);return _0x416834[_0x01aa('0x67')](_0x3e6662);}})[_0x01aa('0x1a')](function(_0xd18522){if(_0xd18522){_0x3d59b9=_0xd18522[_0x01aa('0x43')];if(!_0x1ddda5[_0x01aa('0x3d')][_0x01aa('0x44')](_0x01aa('0x45'))){_0x3e6662[_0x01aa('0x29')]=qs[_0x01aa('0x29')](_0x1ddda5[_0x01aa('0x3d')][_0x01aa('0x29')]);_0x3e6662[_0x01aa('0x27')]=qs[_0x01aa('0x27')](_0x1ddda5[_0x01aa('0x3d')][_0x01aa('0x27')]);}return _0x416834[_0x01aa('0x67')](_0x3e6662);}})[_0x01aa('0x1a')](function(_0x34bb05){if(_0x34bb05){return _0x34bb05?{'count':_0x3d59b9,'rows':_0x34bb05}:null;}})[_0x01aa('0x1a')](respondWithResult(_0x44a119,null))[_0x01aa('0x52')](handleError(_0x44a119,null));};exports[_0x01aa('0x68')]=function(_0x363b53,_0x14544d,_0x287ab0){var _0x4705f3=_0x363b53[_0x01aa('0x55')][_0x01aa('0x69')];return db[_0x01aa('0x66')][_0x01aa('0x50')]({'where':{'id':_0x4705f3},'attributes':['id'],'include':[{'model':db[_0x01aa('0x5f')],'as':_0x01aa('0x6a'),'attributes':['id','name','online',_0x01aa('0x6b'),_0x01aa('0x6c')],'raw':!![]}]})[_0x01aa('0x1a')](function(_0x4b0400){if(_0x4b0400){var _0x410c99=_[_0x01aa('0x6d')](_0x4b0400,function(_0x32ff60){var _0xa5f0e0=_0x32ff60[_0x01aa('0x30')]({'plain':!![]});return _0xa5f0e0[_0x01aa('0x6a')];});return db['ChatQueue']['find']({'where':{'id':_0x363b53[_0x01aa('0x5b')]['id']}})['then'](function(_0x4ee739){return db[_0x01aa('0x6e')]['transaction'](function(_0x7a9583){return _0x4ee739['addTeams'](_0x4705f3,{'transaction':_0x7a9583})[_0x01aa('0x1a')](function(){return BPromise[_0x01aa('0x6f')](_0x410c99,function(_0x10b13c){return db['UserChatQueue'][_0x01aa('0x70')]({'where':{'UserId':_0x10b13c['id'],'ChatQueueId':_0x363b53[_0x01aa('0x5b')]['id']},'transaction':_0x7a9583});});})[_0x01aa('0x1a')](function(){_0x410c99[_0x01aa('0x71')](function(_0x4e1c43){socket[_0x01aa('0x72')]('userChatQueue:save',{'UserId':_0x4e1c43['id'],'ChatQueueId':_0x4ee739['id']});});});});});}})[_0x01aa('0x1a')](respondWithStatusCode(_0x14544d,null))[_0x01aa('0x52')](handleError(_0x14544d,null));};exports[_0x01aa('0x73')]=function(_0x4bfcd3,_0x3ea135,_0x2d8c57){return db[_0x01aa('0x66')][_0x01aa('0x50')]({'where':{'id':_0x4bfcd3['query'][_0x01aa('0x69')]},'attributes':['id'],'include':[{'model':db[_0x01aa('0x5f')],'as':_0x01aa('0x6a'),'attributes':['id'],'raw':!![]}]})[_0x01aa('0x1a')](handleEntityNotFound(_0x3ea135,null))[_0x01aa('0x1a')](function(_0x2cdd18){var _0x23cc54=_[_0x01aa('0x37')](_0x2cdd18,'id');var _0x3b66=[];var _0x4b60b8=[];var _0x964d8d=squel[_0x01aa('0x74')]();_0x964d8d[_0x01aa('0x75')](_0x01aa('0x76'))[_0x01aa('0x77')](_0x01aa('0x78'),'tq')[_0x01aa('0x79')](_0x01aa('0x7a'),'ut',_0x01aa('0x7b'))[_0x01aa('0x48')](_0x01aa('0x7c'),_0x4bfcd3[_0x01aa('0x5b')]['id']);for(var _0x5c7d22=0x0;_0x5c7d22<_0x2cdd18[_0x01aa('0x43')];_0x5c7d22+=0x1){let _0xdf8b96=_0x2cdd18[_0x5c7d22];for(var _0x45ea04=0x0;_0x45ea04<_0xdf8b96['Agents'][_0x01aa('0x43')];_0x45ea04+=0x1){let _0x4a1eba=_0xdf8b96[_0x01aa('0x6a')][_0x45ea04];var _0x150d43=_0x964d8d[_0x01aa('0x7d')]();_0x150d43[_0x01aa('0x48')](_0x01aa('0x7e'),_0x4a1eba['id']);_0x4b60b8[_0x01aa('0x7f')](db[_0x01aa('0x6e')][_0x01aa('0x3d')](_0x150d43[_0x01aa('0x80')](),{'type':db[_0x01aa('0x6e')]['QueryTypes'][_0x01aa('0x81')]})[_0x01aa('0x1a')](function(_0x3fb0dd){if(_0x3fb0dd[_0x01aa('0x43')]===0x1){return _0x4a1eba['id'];}else{var _0x485bc3=_['every'](_[_0x01aa('0x37')](_0x3fb0dd,_0x01aa('0x82')),function(_0x2a6ab8){return _['includes'](_0x23cc54,_0x2a6ab8);});if(_0x485bc3){return _0x4a1eba['id'];}}}));}}return BPromise[_0x01aa('0x83')](_0x4b60b8)[_0x01aa('0x1a')](function(_0x1d67a7){_0x3b66=_(_0x3b66)[_0x01aa('0x84')](_0x1d67a7)[_0x01aa('0x85')]()[_0x01aa('0x86')]();return db[_0x01aa('0x38')][_0x01aa('0x53')]({'where':{'id':_0x4bfcd3['params']['id']}})[_0x01aa('0x1a')](function(_0x17fb27){return db[_0x01aa('0x6e')][_0x01aa('0x87')](function(_0x448d18){return _0x17fb27['removeTeams'](_0x4bfcd3[_0x01aa('0x3d')][_0x01aa('0x69')],{'transaction':_0x448d18})[_0x01aa('0x1a')](function(){if(!_['isEmpty'](_0x3b66)){return _0x17fb27['removeAgents'](_0x3b66,{'transaction':_0x448d18});}})['then'](function(){_0x3b66['forEach'](function(_0x5eb2de){socket['emit']('userChatQueue:remove',{'UserId':_0x5eb2de,'ChatQueueId':_0x17fb27['id']});});});});});});})[_0x01aa('0x1a')](respondWithStatusCode(_0x3ea135,null))[_0x01aa('0x52')](handleError(_0x3ea135,null));};exports[_0x01aa('0x88')]=function(_0x3b3f06,_0x33b3cb,_0x3ca2ea){return db[_0x01aa('0x38')][_0x01aa('0x53')]({'where':{'id':_0x3b3f06['params']['id']}})[_0x01aa('0x1a')](handleEntityNotFound(_0x33b3cb,null))[_0x01aa('0x1a')](function(_0x5b6df7){if(_0x5b6df7){return _0x5b6df7[_0x01aa('0x88')](_0x3b3f06[_0x01aa('0x55')]['ids'],_[_0x01aa('0x89')](_0x3b3f06[_0x01aa('0x55')],[_0x01aa('0x69'),'id'])||{})[_0x01aa('0x8a')](function(_0xb62470){for(var _0x5800e0=0x0;_0x5800e0<_0x3b3f06[_0x01aa('0x55')][_0x01aa('0x69')][_0x01aa('0x43')];_0x5800e0+=0x1){socket[_0x01aa('0x72')]('userChatQueue:save',{'UserId':Number(_0x3b3f06[_0x01aa('0x55')][_0x01aa('0x69')][_0x5800e0]),'ChatQueueId':Number(_0x3b3f06[_0x01aa('0x5b')]['id'])});}return _0xb62470;});}})['then'](respondWithResult(_0x33b3cb,null))[_0x01aa('0x52')](handleError(_0x33b3cb,null));};exports[_0x01aa('0x8b')]=function(_0xb48995,_0x3bd998,_0x4f75f0){return db[_0x01aa('0x38')]['find']({'where':{'id':_0xb48995[_0x01aa('0x5b')]['id']}})[_0x01aa('0x1a')](handleEntityNotFound(_0x3bd998,null))[_0x01aa('0x1a')](function(_0x173c71){if(_0x173c71){return _0x173c71[_0x01aa('0x8b')](_0xb48995[_0x01aa('0x3d')][_0x01aa('0x69')])['then'](function(){if(_[_0x01aa('0x8c')](_0xb48995[_0x01aa('0x3d')][_0x01aa('0x69')])){for(var _0x5a55ba=0x0;_0x5a55ba<_0xb48995[_0x01aa('0x3d')][_0x01aa('0x69')]['length'];_0x5a55ba+=0x1){socket[_0x01aa('0x72')](_0x01aa('0x8d'),{'UserId':Number(_0xb48995[_0x01aa('0x3d')][_0x01aa('0x69')][_0x5a55ba]),'ChatQueueId':Number(_0xb48995[_0x01aa('0x5b')]['id'])});}}else{socket[_0x01aa('0x72')](_0x01aa('0x8d'),{'UserId':Number(_0xb48995[_0x01aa('0x3d')]['ids']),'ChatQueueId':Number(_0xb48995[_0x01aa('0x5b')]['id'])});}});}})[_0x01aa('0x1a')](respondWithStatusCode(_0x3bd998,null))[_0x01aa('0x52')](handleError(_0x3bd998,null));};exports['getAgents']=function(_0x51572c,_0x3aa29f,_0x12710f){var _0x1650c8={};var _0x3d5634={};var _0x23abc6;var _0x4484b7;return db[_0x01aa('0x38')][_0x01aa('0x8e')]({'where':{'id':_0x51572c[_0x01aa('0x5b')]['id']}})[_0x01aa('0x1a')](handleEntityNotFound(_0x3aa29f,null))['then'](function(_0x2b0fe5){if(_0x2b0fe5){_0x23abc6=_0x2b0fe5;_0x3d5634[_0x01aa('0x3c')]=_['keys'](db[_0x01aa('0x5f')][_0x01aa('0x39')]);_0x3d5634['query']=_[_0x01aa('0x3e')](_0x51572c[_0x01aa('0x3d')]);_0x3d5634['filters']=_[_0x01aa('0x40')](_0x3d5634[_0x01aa('0x3c')],_0x3d5634[_0x01aa('0x3d')]);_0x1650c8['attributes']=_[_0x01aa('0x40')](_0x3d5634[_0x01aa('0x3c')],qs['fields'](_0x51572c[_0x01aa('0x3d')][_0x01aa('0x41')]));_0x1650c8['attributes']=_0x1650c8[_0x01aa('0x42')][_0x01aa('0x43')]?_0x1650c8[_0x01aa('0x42')]:_0x3d5634['model'];_0x1650c8[_0x01aa('0x46')]=qs['sort'](_0x51572c['query'][_0x01aa('0x47')]);_0x1650c8['where']=qs[_0x01aa('0x3f')](_[_0x01aa('0x49')](_0x51572c[_0x01aa('0x3d')],_0x3d5634[_0x01aa('0x3f')]));if(_0x51572c[_0x01aa('0x3d')][_0x01aa('0x4a')]){_0x1650c8[_0x01aa('0x48')]=_[_0x01aa('0x4b')](_0x1650c8[_0x01aa('0x48')],{'$or':_[_0x01aa('0x37')](_0x1650c8['attributes'],function(_0x95893a){var _0x1cbe1f={};_0x1cbe1f[_0x95893a]={'$like':'%'+_0x51572c[_0x01aa('0x3d')][_0x01aa('0x4a')]+'%'};return _0x1cbe1f;})});}_0x1650c8=_['merge']({},_0x1650c8,_0x51572c[_0x01aa('0x4d')]);return _0x23abc6[_0x01aa('0x8f')](_0x1650c8);}})['then'](function(_0x7e781){if(_0x7e781){_0x4484b7=_0x7e781[_0x01aa('0x43')];if(!_0x51572c[_0x01aa('0x3d')][_0x01aa('0x44')](_0x01aa('0x45'))){_0x1650c8['limit']=qs[_0x01aa('0x29')](_0x51572c['query']['limit']);_0x1650c8[_0x01aa('0x27')]=qs[_0x01aa('0x27')](_0x51572c[_0x01aa('0x3d')][_0x01aa('0x27')]);}return _0x23abc6[_0x01aa('0x8f')](_0x1650c8);}})[_0x01aa('0x1a')](function(_0x62c57b){if(_0x62c57b){return _0x62c57b?{'count':_0x4484b7,'rows':_0x62c57b}:null;}})['then'](respondWithResult(_0x3aa29f,null))[_0x01aa('0x52')](handleError(_0x3aa29f,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 2535fae..ddcca7e 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 _0x5ffc=['save','update','remove','emit','hook','exports','events','ChatQueue','setMaxListeners'];(function(_0x505211,_0xf16511){var _0x346a67=function(_0x25e539){while(--_0x25e539){_0x505211['push'](_0x505211['shift']());}};_0x346a67(++_0xf16511);}(_0x5ffc,0x16e));var _0xc5ff=function(_0x590ef3,_0x3b2dd2){_0x590ef3=_0x590ef3-0x0;var _0x4502be=_0x5ffc[_0x590ef3];return _0x4502be;};'use strict';var EventEmitter=require(_0xc5ff('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xc5ff('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xc5ff('0x2')](0x0);var events={'afterCreate':_0xc5ff('0x3'),'afterUpdate':_0xc5ff('0x4'),'afterDestroy':_0xc5ff('0x5')};function emitEvent(_0x239431){return function(_0x18f072,_0x327947,_0x5902dc){ChatQueueEvents[_0xc5ff('0x6')](_0x239431+':'+_0x18f072['id'],_0x18f072);ChatQueueEvents[_0xc5ff('0x6')](_0x239431,_0x18f072);_0x5902dc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0xc5ff('0x7')](e,emitEvent(event));}}module[_0xc5ff('0x8')]=ChatQueueEvents; \ No newline at end of file +var _0x4085=['emit','events','../../mysqldb','ChatQueue','setMaxListeners','save'];(function(_0x3cf1b1,_0x445a0a){var _0x347602=function(_0x19c0a1){while(--_0x19c0a1){_0x3cf1b1['push'](_0x3cf1b1['shift']());}};_0x347602(++_0x445a0a);}(_0x4085,0x199));var _0x5408=function(_0x18dce0,_0x338691){_0x18dce0=_0x18dce0-0x0;var _0x71da89=_0x4085[_0x18dce0];return _0x71da89;};'use strict';var EventEmitter=require(_0x5408('0x0'));var ChatQueue=require(_0x5408('0x1'))['db'][_0x5408('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x5408('0x3')](0x0);var events={'afterCreate':_0x5408('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x444a73){return function(_0x554074,_0x13a8e9,_0x3337ea){ChatQueueEvents[_0x5408('0x5')](_0x444a73+':'+_0x554074['id'],_0x554074);ChatQueueEvents[_0x5408('0x5')](_0x444a73,_0x554074);_0x3337ea(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue['hook'](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 3303cb8..0b39542 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 _0x1f44=['ChatQueue','chat_queues','lodash','util','../../config/logger','bluebird','request-promise','../../config/environment','./chatQueue.attributes','exports','define'];(function(_0x295431,_0x275830){var _0xe571d9=function(_0x31a5d8){while(--_0x31a5d8){_0x295431['push'](_0x295431['shift']());}};_0xe571d9(++_0x275830);}(_0x1f44,0x14c));var _0x41f4=function(_0x123e0b,_0x2ad94c){_0x123e0b=_0x123e0b-0x0;var _0x3248cb=_0x1f44[_0x123e0b];return _0x3248cb;};'use strict';var _=require(_0x41f4('0x0'));var util=require(_0x41f4('0x1'));var logger=require(_0x41f4('0x2'))('api');var moment=require('moment');var BPromise=require(_0x41f4('0x3'));var rp=require(_0x41f4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x41f4('0x5'));var attributes=require(_0x41f4('0x6'));module[_0x41f4('0x7')]=function(_0x19b755,_0x59cfe0){return _0x19b755[_0x41f4('0x8')](_0x41f4('0x9'),attributes,{'tableName':_0x41f4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x99e6=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash'];(function(_0x35c8f5,_0x399f44){var _0xb5c718=function(_0x50450c){while(--_0x50450c){_0x35c8f5['push'](_0x35c8f5['shift']());}};_0xb5c718(++_0x399f44);}(_0x99e6,0x86));var _0x699e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x99e6[_0x31e29a];return _0x32d892;};'use strict';var _=require(_0x699e('0x0'));var util=require(_0x699e('0x1'));var logger=require(_0x699e('0x2'))(_0x699e('0x3'));var moment=require(_0x699e('0x4'));var BPromise=require(_0x699e('0x5'));var rp=require(_0x699e('0x6'));var fs=require('fs');var path=require(_0x699e('0x7'));var rimraf=require(_0x699e('0x8'));var config=require(_0x699e('0x9'));var attributes=require(_0x699e('0xa'));module[_0x699e('0xb')]=function(_0x955609,_0x22dfff){return _0x955609[_0x699e('0xc')](_0x699e('0xd'),attributes,{'tableName':_0x699e('0xe'),'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 fa3ccd9..a7efcf9 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 _0x30d6=['ChatQueue','options','raw','attributes','limit','map','include','model','GetChatQueue','stringify','ShowChatQueue','find','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','redis','defaults','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch'];(function(_0x2a24d6,_0x719138){var _0x46d4c2=function(_0x4b72ab){while(--_0x4b72ab){_0x2a24d6['push'](_0x2a24d6['shift']());}};_0x46d4c2(++_0x719138);}(_0x30d6,0x1b0));var _0x630d=function(_0x3c5a41,_0x558b2c){_0x3c5a41=_0x3c5a41-0x0;var _0x5389f5=_0x30d6[_0x3c5a41];return _0x5389f5;};'use strict';var _=require(_0x630d('0x0'));var util=require(_0x630d('0x1'));var moment=require('moment');var BPromise=require(_0x630d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x630d('0x3'));var db=require(_0x630d('0x4'))['db'];var utils=require(_0x630d('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x630d('0x6'));var jayson=require(_0x630d('0x7'));var client=jayson[_0x630d('0x8')]['http']({'port':0x232a});config[_0x630d('0x9')]=_[_0x630d('0xa')](config[_0x630d('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x630d('0x9')]));require(_0x630d('0xb'))[_0x630d('0xc')](socket);function respondWithRpcPromise(_0x382760,_0x4d4f13,_0xc5bc63){return new BPromise(function(_0x43ea98,_0x2f88fb){return client[_0x630d('0xd')](_0x382760,_0xc5bc63)[_0x630d('0xe')](function(_0x4294d0){logger[_0x630d('0xf')](_0x630d('0x10'),_0x4d4f13,_0x630d('0x11'));logger[_0x630d('0x12')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x4d4f13,_0x630d('0x11'),JSON['stringify'](_0x4294d0));if(_0x4294d0[_0x630d('0x13')]){if(_0x4294d0[_0x630d('0x13')]['code']===0x1f4){logger[_0x630d('0x13')](_0x630d('0x10'),_0x4d4f13,_0x4294d0[_0x630d('0x13')][_0x630d('0x14')]);return _0x2f88fb(_0x4294d0[_0x630d('0x13')][_0x630d('0x14')]);}logger[_0x630d('0x13')](_0x630d('0x10'),_0x4d4f13,_0x4294d0['error'][_0x630d('0x14')]);return _0x43ea98(_0x4294d0['error'][_0x630d('0x14')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x4d4f13,_0x630d('0x11'));_0x43ea98(_0x4294d0[_0x630d('0x15')]['message']);}})[_0x630d('0x16')](function(_0x18e685){logger['error'](_0x630d('0x10'),_0x4d4f13,_0x18e685);_0x2f88fb(_0x18e685);});});}exports['GetChatQueue']=function(_0x4df27f){var _0x456b07=this;return new Promise(function(_0x53498b,_0x2d960f){return db[_0x630d('0x17')]['findAll']({'raw':_0x4df27f[_0x630d('0x18')]?_0x4df27f[_0x630d('0x18')][_0x630d('0x19')]===undefined?!![]:![]:!![],'where':_0x4df27f[_0x630d('0x18')]?_0x4df27f['options']['where']||null:null,'attributes':_0x4df27f[_0x630d('0x18')]?_0x4df27f[_0x630d('0x18')][_0x630d('0x1a')]||null:null,'limit':_0x4df27f['options']?_0x4df27f[_0x630d('0x18')][_0x630d('0x1b')]||null:null,'include':_0x4df27f[_0x630d('0x18')]?_0x4df27f[_0x630d('0x18')]['include']?_[_0x630d('0x1c')](_0x4df27f[_0x630d('0x18')][_0x630d('0x1d')],function(_0x2ba2c9){return{'model':db[_0x2ba2c9[_0x630d('0x1e')]],'as':_0x2ba2c9['as'],'attributes':_0x2ba2c9[_0x630d('0x1a')],'include':_0x2ba2c9[_0x630d('0x1d')]?_['map'](_0x2ba2c9[_0x630d('0x1d')],function(_0x5c5d36){return{'model':db[_0x5c5d36[_0x630d('0x1e')]],'as':_0x5c5d36['as'],'attributes':_0x5c5d36['attributes'],'include':_0x5c5d36['include']?_[_0x630d('0x1c')](_0x5c5d36[_0x630d('0x1d')],function(_0x3d62dd){return{'model':db[_0x3d62dd['model']],'as':_0x3d62dd['as'],'attributes':_0x3d62dd[_0x630d('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2bed85){logger[_0x630d('0xf')](_0x630d('0x1f'),_0x4df27f);logger[_0x630d('0x12')](_0x630d('0x1f'),_0x4df27f,JSON[_0x630d('0x20')](_0x2bed85));_0x53498b(_0x2bed85);})[_0x630d('0x16')](function(_0x2d6d26){logger[_0x630d('0x13')](_0x630d('0x1f'),_0x2d6d26['message'],_0x4df27f);_0x2d960f(_0x456b07[_0x630d('0x13')](0x1f4,_0x2d6d26[_0x630d('0x14')]));});});};exports[_0x630d('0x21')]=function(_0x789005){var _0x25cf85=this;return new Promise(function(_0x18c8a2,_0x58e392){return db[_0x630d('0x17')][_0x630d('0x22')]({'raw':_0x789005[_0x630d('0x18')]?_0x789005[_0x630d('0x18')][_0x630d('0x19')]===undefined?!![]:![]:!![],'where':_0x789005['options']?_0x789005[_0x630d('0x18')]['where']||null:null,'attributes':_0x789005[_0x630d('0x18')]?_0x789005[_0x630d('0x18')][_0x630d('0x1a')]||null:null,'include':_0x789005[_0x630d('0x18')]?_0x789005['options'][_0x630d('0x1d')]?_['map'](_0x789005[_0x630d('0x18')][_0x630d('0x1d')],function(_0x63c194){return{'model':db[_0x63c194[_0x630d('0x1e')]],'as':_0x63c194['as'],'attributes':_0x63c194['attributes'],'include':_0x63c194[_0x630d('0x1d')]?_[_0x630d('0x1c')](_0x63c194['include'],function(_0xa10a79){return{'model':db[_0xa10a79[_0x630d('0x1e')]],'as':_0xa10a79['as'],'attributes':_0xa10a79[_0x630d('0x1a')],'include':_0xa10a79['include']?_[_0x630d('0x1c')](_0xa10a79[_0x630d('0x1d')],function(_0x22ae2c){return{'model':db[_0x22ae2c['model']],'as':_0x22ae2c['as'],'attributes':_0x22ae2c[_0x630d('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x630d('0xe')](function(_0x598a60){logger[_0x630d('0xf')](_0x630d('0x21'),_0x789005);logger[_0x630d('0x12')](_0x630d('0x21'),_0x789005,JSON[_0x630d('0x20')](_0x598a60));_0x18c8a2(_0x598a60);})[_0x630d('0x16')](function(_0x4609ce){logger[_0x630d('0x13')](_0x630d('0x21'),_0x4609ce['message'],_0x789005);_0x58e392(_0x25cf85[_0x630d('0x13')](0x1f4,_0x4609ce['message']));});});}; \ No newline at end of file +var _0xf29d=['include','map','model','ShowChatQueue','where','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','defaults','redis','localhost','./chatQueue.socket','register','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','attributes','limit'];(function(_0x51f3d6,_0x572b62){var _0x2f0dfa=function(_0x102852){while(--_0x102852){_0x51f3d6['push'](_0x51f3d6['shift']());}};_0x2f0dfa(++_0x572b62);}(_0xf29d,0xc4));var _0xdf29=function(_0x1406c3,_0x1390de){_0x1406c3=_0x1406c3-0x0;var _0x3a9f8f=_0xf29d[_0x1406c3];return _0x3a9f8f;};'use strict';var _=require(_0xdf29('0x0'));var util=require(_0xdf29('0x1'));var moment=require('moment');var BPromise=require(_0xdf29('0x2'));var rs=require(_0xdf29('0x3'));var fs=require('fs');var Redis=require(_0xdf29('0x4'));var db=require(_0xdf29('0x5'))['db'];var utils=require(_0xdf29('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xdf29('0x7'));var client=jayson[_0xdf29('0x8')][_0xdf29('0x9')]({'port':0x232a});config['redis']=_[_0xdf29('0xa')](config[_0xdf29('0xb')],{'host':_0xdf29('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdf29('0xb')]));require(_0xdf29('0xd'))[_0xdf29('0xe')](socket);function respondWithRpcPromise(_0x298dbb,_0x517d89,_0x5503f0){return new BPromise(function(_0x3e1865,_0x14b4ec){return client['request'](_0x298dbb,_0x5503f0)[_0xdf29('0xf')](function(_0x26b212){logger[_0xdf29('0x10')](_0xdf29('0x11'),_0x517d89,_0xdf29('0x12'));logger['debug'](_0xdf29('0x13'),_0x517d89,'request\x20sent',JSON[_0xdf29('0x14')](_0x26b212));if(_0x26b212[_0xdf29('0x15')]){if(_0x26b212[_0xdf29('0x15')]['code']===0x1f4){logger[_0xdf29('0x15')](_0xdf29('0x11'),_0x517d89,_0x26b212['error'][_0xdf29('0x16')]);return _0x14b4ec(_0x26b212[_0xdf29('0x15')][_0xdf29('0x16')]);}logger['error'](_0xdf29('0x11'),_0x517d89,_0x26b212['error']['message']);return _0x3e1865(_0x26b212[_0xdf29('0x15')][_0xdf29('0x16')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x517d89,_0xdf29('0x12'));_0x3e1865(_0x26b212[_0xdf29('0x17')]['message']);}})[_0xdf29('0x18')](function(_0xf56cfa){logger[_0xdf29('0x15')](_0xdf29('0x11'),_0x517d89,_0xf56cfa);_0x14b4ec(_0xf56cfa);});});}exports[_0xdf29('0x19')]=function(_0x407f30){var _0x3cc6d7=this;return new Promise(function(_0x2f1f7d,_0x15501e){return db[_0xdf29('0x1a')][_0xdf29('0x1b')]({'raw':_0x407f30[_0xdf29('0x1c')]?_0x407f30[_0xdf29('0x1c')][_0xdf29('0x1d')]===undefined?!![]:![]:!![],'where':_0x407f30[_0xdf29('0x1c')]?_0x407f30[_0xdf29('0x1c')]['where']||null:null,'attributes':_0x407f30['options']?_0x407f30[_0xdf29('0x1c')][_0xdf29('0x1e')]||null:null,'limit':_0x407f30[_0xdf29('0x1c')]?_0x407f30[_0xdf29('0x1c')][_0xdf29('0x1f')]||null:null,'include':_0x407f30['options']?_0x407f30[_0xdf29('0x1c')][_0xdf29('0x20')]?_[_0xdf29('0x21')](_0x407f30[_0xdf29('0x1c')]['include'],function(_0x29d3a1){return{'model':db[_0x29d3a1['model']],'as':_0x29d3a1['as'],'attributes':_0x29d3a1['attributes'],'include':_0x29d3a1['include']?_['map'](_0x29d3a1['include'],function(_0x3ba001){return{'model':db[_0x3ba001['model']],'as':_0x3ba001['as'],'attributes':_0x3ba001[_0xdf29('0x1e')],'include':_0x3ba001['include']?_['map'](_0x3ba001['include'],function(_0x3f5a96){return{'model':db[_0x3f5a96[_0xdf29('0x22')]],'as':_0x3f5a96['as'],'attributes':_0x3f5a96[_0xdf29('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xdf29('0xf')](function(_0x37ca23){logger[_0xdf29('0x10')]('GetChatQueue',_0x407f30);logger['debug'](_0xdf29('0x19'),_0x407f30,JSON[_0xdf29('0x14')](_0x37ca23));_0x2f1f7d(_0x37ca23);})[_0xdf29('0x18')](function(_0x240777){logger[_0xdf29('0x15')](_0xdf29('0x19'),_0x240777[_0xdf29('0x16')],_0x407f30);_0x15501e(_0x3cc6d7[_0xdf29('0x15')](0x1f4,_0x240777[_0xdf29('0x16')]));});});};exports[_0xdf29('0x23')]=function(_0x1bb3ce){var _0x38ad0d=this;return new Promise(function(_0x15141e,_0x1a4c24){return db[_0xdf29('0x1a')]['find']({'raw':_0x1bb3ce[_0xdf29('0x1c')]?_0x1bb3ce[_0xdf29('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x1bb3ce[_0xdf29('0x1c')]?_0x1bb3ce[_0xdf29('0x1c')][_0xdf29('0x24')]||null:null,'attributes':_0x1bb3ce['options']?_0x1bb3ce[_0xdf29('0x1c')][_0xdf29('0x1e')]||null:null,'include':_0x1bb3ce[_0xdf29('0x1c')]?_0x1bb3ce[_0xdf29('0x1c')]['include']?_[_0xdf29('0x21')](_0x1bb3ce[_0xdf29('0x1c')]['include'],function(_0x36eac3){return{'model':db[_0x36eac3['model']],'as':_0x36eac3['as'],'attributes':_0x36eac3[_0xdf29('0x1e')],'include':_0x36eac3[_0xdf29('0x20')]?_[_0xdf29('0x21')](_0x36eac3[_0xdf29('0x20')],function(_0x174c9e){return{'model':db[_0x174c9e[_0xdf29('0x22')]],'as':_0x174c9e['as'],'attributes':_0x174c9e[_0xdf29('0x1e')],'include':_0x174c9e[_0xdf29('0x20')]?_[_0xdf29('0x21')](_0x174c9e['include'],function(_0x1868ef){return{'model':db[_0x1868ef[_0xdf29('0x22')]],'as':_0x1868ef['as'],'attributes':_0x1868ef[_0xdf29('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xdf29('0xf')](function(_0x1bab4f){logger[_0xdf29('0x10')](_0xdf29('0x23'),_0x1bb3ce);logger[_0xdf29('0x25')]('ShowChatQueue',_0x1bb3ce,JSON['stringify'](_0x1bab4f));_0x15141e(_0x1bab4f);})[_0xdf29('0x18')](function(_0x53e82b){logger[_0xdf29('0x15')](_0xdf29('0x23'),_0x53e82b[_0xdf29('0x16')],_0x1bb3ce);_0x1a4c24(_0x38ad0d[_0xdf29('0x15')](0x1f4,_0x53e82b[_0xdf29('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index ef197be..ea0a0bd 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 _0x668b=['./chatQueue.events','save','update','removeListener','length'];(function(_0x5b1a5a,_0x53b1f2){var _0x5ad202=function(_0x189146){while(--_0x189146){_0x5b1a5a['push'](_0x5b1a5a['shift']());}};_0x5ad202(++_0x53b1f2);}(_0x668b,0x140));var _0xb668=function(_0x1c0991,_0x4f22d2){_0x1c0991=_0x1c0991-0x0;var _0x5034de=_0x668b[_0x1c0991];return _0x5034de;};'use strict';var ChatQueueEvents=require(_0xb668('0x0'));var events=[_0xb668('0x1'),'remove',_0xb668('0x2')];function createListener(_0x2c30c1,_0x49a53b){return function(_0x336ba4){_0x49a53b['emit'](_0x2c30c1,_0x336ba4);};}function removeListener(_0x2fab11,_0x4092a6){return function(){ChatQueueEvents[_0xb668('0x3')](_0x2fab11,_0x4092a6);};}exports['register']=function(_0x9b99a8){for(var _0x296fa9=0x0,_0x3be92e=events[_0xb668('0x4')];_0x296fa9<_0x3be92e;_0x296fa9++){var _0x20b749=events[_0x296fa9];var _0x3f01bc=createListener('chatQueue:'+_0x20b749,_0x9b99a8);ChatQueueEvents['on'](_0x20b749,_0x3f01bc);}}; \ No newline at end of file +var _0x2dae=['remove','update','removeListener','register','length','chatQueue:','./chatQueue.events'];(function(_0x493876,_0x17ac7c){var _0xa96f38=function(_0x38d42d){while(--_0x38d42d){_0x493876['push'](_0x493876['shift']());}};_0xa96f38(++_0x17ac7c);}(_0x2dae,0xc3));var _0xe2da=function(_0x1e175d,_0x41ff45){_0x1e175d=_0x1e175d-0x0;var _0x3a3ce5=_0x2dae[_0x1e175d];return _0x3a3ce5;};'use strict';var ChatQueueEvents=require(_0xe2da('0x0'));var events=['save',_0xe2da('0x1'),_0xe2da('0x2')];function createListener(_0xcd0055,_0x167432){return function(_0x99b46f){_0x167432['emit'](_0xcd0055,_0x99b46f);};}function removeListener(_0x25b9f2,_0x439b5d){return function(){ChatQueueEvents[_0xe2da('0x3')](_0x25b9f2,_0x439b5d);};}exports[_0xe2da('0x4')]=function(_0x523c60){for(var _0x3e3e25=0x0,_0x89c70b=events[_0xe2da('0x5')];_0x3e3e25<_0x89c70b;_0x3e3e25++){var _0x2efbd8=events[_0x3e3e25];var _0x238da3=createListener(_0xe2da('0x6')+_0x2efbd8,_0x523c60);ChatQueueEvents['on'](_0x2efbd8,_0x238da3);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 3fc6504..88e590e 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 _0x814b=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x26f31c,_0x55689a){var _0x2a27d1=function(_0x2b6fe9){while(--_0x2b6fe9){_0x26f31c['push'](_0x26f31c['shift']());}};_0x2a27d1(++_0x55689a);}(_0x814b,0x1a2));var _0xb814=function(_0x4e9d3c,_0x1f4b98){_0x4e9d3c=_0x4e9d3c-0x0;var _0x2d0825=_0x814b[_0x4e9d3c];return _0x2d0825;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0x16')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0x16')](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x18')]);router[_0xb814('0x16')](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x19')]);router[_0xb814('0x1a')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller['destroy']);router[_0xb814('0x1c')]('/:id/teams',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xb814('0x1e')]);module['exports']=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(_0x11ce7c,_0x11906f){var _0x21fc8b=function(_0x47bb26){while(--_0x47bb26){_0x11ce7c['push'](_0x11ce7c['shift']());}};_0x21fc8b(++_0x11906f);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('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 e93a85e..4be8d87 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 _0xbe67=['exports','STRING','DATE','moment','sequelize'];(function(_0xcf0d77,_0x2195aa){var _0x13b05f=function(_0x2e798b){while(--_0x2e798b){_0xcf0d77['push'](_0xcf0d77['shift']());}};_0x13b05f(++_0x2195aa);}(_0xbe67,0x1d4));var _0x7be6=function(_0x21294c,_0x8ba24e){_0x21294c=_0x21294c-0x0;var _0x8f9f88=_0xbe67[_0x21294c];return _0x8f9f88;};'use strict';var moment=require(_0x7be6('0x0'));var Sequelize=require(_0x7be6('0x1'));module[_0x7be6('0x2')]={'uniqueid':{'type':Sequelize[_0x7be6('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x7be6('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x7be6('0x4')]},'exitAt':{'type':Sequelize[_0x7be6('0x4')]},'reason':{'type':Sequelize[_0x7be6('0x3')]}}; \ No newline at end of file +var _0x2e0a=['exports','STRING','DATE','moment','sequelize'];(function(_0x4a9961,_0x261ff8){var _0x3211b5=function(_0x123840){while(--_0x123840){_0x4a9961['push'](_0x4a9961['shift']());}};_0x3211b5(++_0x261ff8);}(_0x2e0a,0xa3));var _0xa2e0=function(_0x55a496,_0x12a0a3){_0x55a496=_0x55a496-0x0;var _0x57fb12=_0x2e0a[_0x55a496];return _0x57fb12;};'use strict';var moment=require(_0xa2e0('0x0'));var Sequelize=require(_0xa2e0('0x1'));module[_0xa2e0('0x2')]={'uniqueid':{'type':Sequelize[_0xa2e0('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xa2e0('0x3')]},'joinAt':{'type':Sequelize[_0xa2e0('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xa2e0('0x4')]},'exitAt':{'type':Sequelize[_0xa2e0('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 8519c87..6d1cd2f 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 _0x9120=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','ChatQueueReport','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','nolimit','limit','sort','where','pick','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','keys','length','merge','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x9120,0x1b3));var _0x0912=function(_0x157db2,_0x1a0008){_0x157db2=_0x157db2-0x0;var _0x4d008a=_0x9120[_0x157db2];return _0x4d008a;};'use strict';var emlformat=require(_0x0912('0x0'));var rimraf=require(_0x0912('0x1'));var zipdir=require(_0x0912('0x2'));var jsonpatch=require(_0x0912('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0912('0x4'));var Mustache=require(_0x0912('0x5'));var util=require(_0x0912('0x6'));var path=require(_0x0912('0x7'));var sox=require(_0x0912('0x8'));var csv=require(_0x0912('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0912('0xa'));var _=require(_0x0912('0xb'));var squel=require(_0x0912('0xc'));var crypto=require('crypto');var jsforce=require(_0x0912('0xd'));var deskjs=require(_0x0912('0xe'));var toCsv=require(_0x0912('0x9'));var querystring=require(_0x0912('0xf'));var Papa=require(_0x0912('0x10'));var Redis=require('ioredis');var authService=require(_0x0912('0x11'));var qs=require(_0x0912('0x12'));var as=require(_0x0912('0x13'));var hardwareService=require(_0x0912('0x14'));var logger=require('../../config/logger')(_0x0912('0x15'));var utils=require('../../config/utils');var config=require(_0x0912('0x16'));var licenseUtil=require(_0x0912('0x17'));var db=require(_0x0912('0x18'))['db'];function respondWithStatusCode(_0xc7af62,_0x22752b){_0x22752b=_0x22752b||0xcc;return function(_0x10faac){if(_0x10faac){return _0xc7af62[_0x0912('0x19')](_0x22752b);}return _0xc7af62[_0x0912('0x1a')](_0x22752b)[_0x0912('0x1b')]();};}function respondWithResult(_0x102468,_0x17f22d){_0x17f22d=_0x17f22d||0xc8;return function(_0x350d6b){if(_0x350d6b){return _0x102468[_0x0912('0x1a')](_0x17f22d)[_0x0912('0x1c')](_0x350d6b);}};}function respondWithFilteredResult(_0x247612,_0x5eb1c9){return function(_0x4d00fd){if(_0x4d00fd){var _0x1ed3e8=typeof _0x5eb1c9['offset']===_0x0912('0x1d')&&typeof _0x5eb1c9['limit']===_0x0912('0x1d');var _0x49b581=_0x4d00fd[_0x0912('0x1e')];var _0x5eace1=_0x1ed3e8?0x0:_0x5eb1c9[_0x0912('0x1f')];var _0x5357db=_0x1ed3e8?_0x4d00fd[_0x0912('0x1e')]:_0x5eb1c9['offset']+_0x5eb1c9['limit'];var _0x3377af;if(_0x5357db>=_0x49b581){_0x5357db=_0x49b581;_0x3377af=0xc8;}else{_0x3377af=0xce;}_0x247612['status'](_0x3377af);return _0x247612[_0x0912('0x20')](_0x0912('0x21'),_0x5eace1+'-'+_0x5357db+'/'+_0x49b581)['json'](_0x4d00fd);}return null;};}function patchUpdates(_0x106008){return function(_0xb1af32){try{jsonpatch[_0x0912('0x22')](_0xb1af32,_0x106008,!![]);}catch(_0x5927d2){return BPromise['reject'](_0x5927d2);}return _0xb1af32[_0x0912('0x23')]();};}function saveUpdates(_0x626428,_0x1f04a1){return function(_0x30b7cc){if(_0x30b7cc){return _0x30b7cc[_0x0912('0x24')](_0x626428)[_0x0912('0x25')](function(_0x6c4902){return _0x6c4902;});}return null;};}function removeEntity(_0x2a3e70,_0xca7f8b){return function(_0x572d12){if(_0x572d12){return _0x572d12[_0x0912('0x26')]()[_0x0912('0x25')](function(){_0x2a3e70[_0x0912('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a938e,_0x21d65b){return function(_0x53d673){if(!_0x53d673){_0x4a938e['sendStatus'](0x194);}return _0x53d673;};}function handleError(_0x39462e,_0x39e96b){_0x39e96b=_0x39e96b||0x1f4;return function(_0x4d45d2){logger[_0x0912('0x27')](_0x4d45d2[_0x0912('0x28')]);if(_0x4d45d2[_0x0912('0x29')]){delete _0x4d45d2[_0x0912('0x29')];}_0x39462e[_0x0912('0x1a')](_0x39e96b)['send'](_0x4d45d2);};}exports[_0x0912('0x2a')]=function(_0x1d6c87,_0x4ac024){var _0x2b1653={},_0x3428a9={},_0x2ce714={'count':0x0,'rows':[]};var _0x5b3956=_[_0x0912('0x2b')](db[_0x0912('0x2c')][_0x0912('0x2d')],function(_0x176529){return{'name':_0x176529['fieldName'],'type':_0x176529[_0x0912('0x2e')][_0x0912('0x2f')]};});_0x3428a9[_0x0912('0x30')]=_[_0x0912('0x2b')](_0x5b3956,_0x0912('0x29'));_0x3428a9[_0x0912('0x31')]=_['keys'](_0x1d6c87['query']);_0x3428a9[_0x0912('0x32')]=_[_0x0912('0x33')](_0x3428a9['model'],_0x3428a9['query']);_0x2b1653[_0x0912('0x34')]=_[_0x0912('0x33')](_0x3428a9[_0x0912('0x30')],qs[_0x0912('0x35')](_0x1d6c87[_0x0912('0x31')][_0x0912('0x35')]));_0x2b1653[_0x0912('0x34')]=_0x2b1653[_0x0912('0x34')]['length']?_0x2b1653['attributes']:_0x3428a9[_0x0912('0x30')];if(!_0x1d6c87[_0x0912('0x31')]['hasOwnProperty'](_0x0912('0x36'))){_0x2b1653[_0x0912('0x37')]=qs[_0x0912('0x37')](_0x1d6c87[_0x0912('0x31')][_0x0912('0x37')]);_0x2b1653[_0x0912('0x1f')]=qs[_0x0912('0x1f')](_0x1d6c87[_0x0912('0x31')][_0x0912('0x1f')]);}_0x2b1653['order']=qs[_0x0912('0x38')](_0x1d6c87[_0x0912('0x31')][_0x0912('0x38')]);_0x2b1653[_0x0912('0x39')]=qs[_0x0912('0x32')](_[_0x0912('0x3a')](_0x1d6c87[_0x0912('0x31')],_0x3428a9['filters']),_0x5b3956);if(_0x1d6c87[_0x0912('0x31')]['filter']){_0x2b1653['where']=_['merge'](_0x2b1653[_0x0912('0x39')],{'$or':_[_0x0912('0x2b')](_0x5b3956,function(_0x5db5f9){if(_0x5db5f9[_0x0912('0x2e')]!==_0x0912('0x3b')){var _0xfdf81c={};_0xfdf81c[_0x5db5f9['name']]={'$like':'%'+_0x1d6c87[_0x0912('0x31')][_0x0912('0x3c')]+'%'};return _0xfdf81c;}})});}_0x2b1653=_['merge']({},_0x2b1653,_0x1d6c87[_0x0912('0x3d')]);var _0x40de57={'where':_0x2b1653[_0x0912('0x39')]};return db[_0x0912('0x2c')][_0x0912('0x1e')](_0x40de57)[_0x0912('0x25')](function(_0x4eb359){_0x2ce714[_0x0912('0x1e')]=_0x4eb359;if(_0x1d6c87[_0x0912('0x31')][_0x0912('0x3e')]){_0x2b1653[_0x0912('0x3f')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x0912('0x40')](_0x2b1653);})[_0x0912('0x25')](function(_0x10040b){_0x2ce714['rows']=_0x10040b;return _0x2ce714;})[_0x0912('0x25')](respondWithFilteredResult(_0x4ac024,_0x2b1653))[_0x0912('0x41')](handleError(_0x4ac024,null));};exports[_0x0912('0x42')]=function(_0x19839e,_0x1c5158){var _0x320f98={'raw':!![],'where':{'id':_0x19839e[_0x0912('0x43')]['id']}},_0x15e23b={};_0x15e23b['model']=_[_0x0912('0x44')](db['ChatQueueReport'][_0x0912('0x2d')]);_0x15e23b[_0x0912('0x31')]=_[_0x0912('0x44')](_0x19839e[_0x0912('0x31')]);_0x15e23b[_0x0912('0x32')]=_[_0x0912('0x33')](_0x15e23b[_0x0912('0x30')],_0x15e23b[_0x0912('0x31')]);_0x320f98['attributes']=_[_0x0912('0x33')](_0x15e23b[_0x0912('0x30')],qs[_0x0912('0x35')](_0x19839e['query'][_0x0912('0x35')]));_0x320f98[_0x0912('0x34')]=_0x320f98[_0x0912('0x34')][_0x0912('0x45')]?_0x320f98[_0x0912('0x34')]:_0x15e23b[_0x0912('0x30')];if(_0x19839e[_0x0912('0x31')][_0x0912('0x3e')]){_0x320f98[_0x0912('0x3f')]=[{'all':!![]}];}_0x320f98=_[_0x0912('0x46')]({},_0x320f98,_0x19839e[_0x0912('0x3d')]);return db[_0x0912('0x2c')][_0x0912('0x47')](_0x320f98)[_0x0912('0x25')](handleEntityNotFound(_0x1c5158,null))[_0x0912('0x25')](respondWithResult(_0x1c5158,null))[_0x0912('0x41')](handleError(_0x1c5158,null));};exports[_0x0912('0x48')]=function(_0x255ee5,_0x3b0548){return db[_0x0912('0x2c')][_0x0912('0x48')](_0x255ee5[_0x0912('0x49')],{})[_0x0912('0x25')](respondWithResult(_0x3b0548,0xc9))['catch'](handleError(_0x3b0548,null));};exports[_0x0912('0x24')]=function(_0x3b94cc,_0x591c83){if(_0x3b94cc[_0x0912('0x49')]['id']){delete _0x3b94cc[_0x0912('0x49')]['id'];}return db[_0x0912('0x2c')][_0x0912('0x47')]({'where':{'id':_0x3b94cc[_0x0912('0x43')]['id']}})[_0x0912('0x25')](handleEntityNotFound(_0x591c83,null))['then'](saveUpdates(_0x3b94cc[_0x0912('0x49')],null))[_0x0912('0x25')](respondWithResult(_0x591c83,null))[_0x0912('0x41')](handleError(_0x591c83,null));};exports['destroy']=function(_0x11364e,_0x3ce4bf){return db[_0x0912('0x2c')][_0x0912('0x47')]({'where':{'id':_0x11364e[_0x0912('0x43')]['id']}})[_0x0912('0x25')](handleEntityNotFound(_0x3ce4bf,null))[_0x0912('0x25')](removeEntity(_0x3ce4bf,null))[_0x0912('0x41')](handleError(_0x3ce4bf,null));};exports['describe']=function(_0x91bb1a,_0x360313){return db[_0x0912('0x2c')][_0x0912('0x4a')]()[_0x0912('0x25')](respondWithResult(_0x360313,null))['catch'](handleError(_0x360313,null));}; \ No newline at end of file +var _0x814b=['undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','options','ChatQueueReport','includeAll','include','findAll','catch','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x4bdd47,_0x24dd3e){var _0x2e7cf6=function(_0x5b7a5a){while(--_0x5b7a5a){_0x4bdd47['push'](_0x4bdd47['shift']());}};_0x2e7cf6(++_0x24dd3e);}(_0x814b,0x1a2));var _0xb814=function(_0x451735,_0x391a76){_0x451735=_0x451735-0x0;var _0x41d1e2=_0x814b[_0x451735];return _0x41d1e2;};'use strict';var emlformat=require(_0xb814('0x0'));var rimraf=require(_0xb814('0x1'));var zipdir=require(_0xb814('0x2'));var jsonpatch=require(_0xb814('0x3'));var rp=require(_0xb814('0x4'));var moment=require(_0xb814('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb814('0x6'));var util=require(_0xb814('0x7'));var path=require(_0xb814('0x8'));var sox=require(_0xb814('0x9'));var csv=require(_0xb814('0xa'));var ejs=require(_0xb814('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xa'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb814('0x19'));var db=require(_0xb814('0x1a'))['db'];function respondWithStatusCode(_0x35b10d,_0x2cc46b){_0x2cc46b=_0x2cc46b||0xcc;return function(_0x2ce718){if(_0x2ce718){return _0x35b10d[_0xb814('0x1b')](_0x2cc46b);}return _0x35b10d[_0xb814('0x1c')](_0x2cc46b)[_0xb814('0x1d')]();};}function respondWithResult(_0xa0a2e5,_0x2ab627){_0x2ab627=_0x2ab627||0xc8;return function(_0x3f4881){if(_0x3f4881){return _0xa0a2e5[_0xb814('0x1c')](_0x2ab627)[_0xb814('0x1e')](_0x3f4881);}};}function respondWithFilteredResult(_0x39bfcf,_0x303aca){return function(_0x3a71d6){if(_0x3a71d6){var _0x45e0d0=typeof _0x303aca[_0xb814('0x1f')]===_0xb814('0x20')&&typeof _0x303aca[_0xb814('0x21')]===_0xb814('0x20');var _0x48c9df=_0x3a71d6[_0xb814('0x22')];var _0x55ba16=_0x45e0d0?0x0:_0x303aca[_0xb814('0x1f')];var _0xfac75b=_0x45e0d0?_0x3a71d6['count']:_0x303aca['offset']+_0x303aca['limit'];var _0x399b43;if(_0xfac75b>=_0x48c9df){_0xfac75b=_0x48c9df;_0x399b43=0xc8;}else{_0x399b43=0xce;}_0x39bfcf['status'](_0x399b43);return _0x39bfcf['set'](_0xb814('0x23'),_0x55ba16+'-'+_0xfac75b+'/'+_0x48c9df)[_0xb814('0x1e')](_0x3a71d6);}return null;};}function patchUpdates(_0x25b6b6){return function(_0x4e139e){try{jsonpatch[_0xb814('0x24')](_0x4e139e,_0x25b6b6,!![]);}catch(_0x531032){return BPromise[_0xb814('0x25')](_0x531032);}return _0x4e139e[_0xb814('0x26')]();};}function saveUpdates(_0x3b267e,_0x470e81){return function(_0x27352e){if(_0x27352e){return _0x27352e[_0xb814('0x27')](_0x3b267e)[_0xb814('0x28')](function(_0x594470){return _0x594470;});}return null;};}function removeEntity(_0x2ead86,_0x52b7a3){return function(_0x3f81d0){if(_0x3f81d0){return _0x3f81d0[_0xb814('0x29')]()[_0xb814('0x28')](function(){_0x2ead86[_0xb814('0x1c')](0xcc)[_0xb814('0x1d')]();});}};}function handleEntityNotFound(_0xb9e57d,_0x3d836c){return function(_0x5755ea){if(!_0x5755ea){_0xb9e57d[_0xb814('0x1b')](0x194);}return _0x5755ea;};}function handleError(_0xc0ef66,_0x1c2625){_0x1c2625=_0x1c2625||0x1f4;return function(_0x349394){logger[_0xb814('0x2a')](_0x349394[_0xb814('0x2b')]);if(_0x349394[_0xb814('0x2c')]){delete _0x349394[_0xb814('0x2c')];}_0xc0ef66['status'](_0x1c2625)[_0xb814('0x2d')](_0x349394);};}exports[_0xb814('0x2e')]=function(_0x52ed64,_0x9008b2){var _0x37d24d={},_0x530744={},_0x499f22={'count':0x0,'rows':[]};var _0x20577b=_[_0xb814('0x2f')](db['ChatQueueReport'][_0xb814('0x30')],function(_0x526610){return{'name':_0x526610[_0xb814('0x31')],'type':_0x526610['type']['key']};});_0x530744[_0xb814('0x32')]=_['map'](_0x20577b,_0xb814('0x2c'));_0x530744[_0xb814('0x33')]=_[_0xb814('0x34')](_0x52ed64['query']);_0x530744['filters']=_[_0xb814('0x35')](_0x530744[_0xb814('0x32')],_0x530744['query']);_0x37d24d[_0xb814('0x36')]=_[_0xb814('0x35')](_0x530744[_0xb814('0x32')],qs[_0xb814('0x37')](_0x52ed64[_0xb814('0x33')][_0xb814('0x37')]));_0x37d24d[_0xb814('0x36')]=_0x37d24d['attributes'][_0xb814('0x38')]?_0x37d24d[_0xb814('0x36')]:_0x530744[_0xb814('0x32')];if(!_0x52ed64[_0xb814('0x33')][_0xb814('0x39')]('nolimit')){_0x37d24d[_0xb814('0x21')]=qs['limit'](_0x52ed64[_0xb814('0x33')][_0xb814('0x21')]);_0x37d24d[_0xb814('0x1f')]=qs['offset'](_0x52ed64[_0xb814('0x33')][_0xb814('0x1f')]);}_0x37d24d['order']=qs[_0xb814('0x3a')](_0x52ed64[_0xb814('0x33')][_0xb814('0x3a')]);_0x37d24d[_0xb814('0x3b')]=qs[_0xb814('0x3c')](_[_0xb814('0x3d')](_0x52ed64['query'],_0x530744[_0xb814('0x3c')]),_0x20577b);if(_0x52ed64['query'][_0xb814('0x3e')]){_0x37d24d['where']=_[_0xb814('0x3f')](_0x37d24d['where'],{'$or':_[_0xb814('0x2f')](_0x20577b,function(_0x26675a){if(_0x26675a['type']!=='VIRTUAL'){var _0x5dd6bc={};_0x5dd6bc[_0x26675a['name']]={'$like':'%'+_0x52ed64[_0xb814('0x33')][_0xb814('0x3e')]+'%'};return _0x5dd6bc;}})});}_0x37d24d=_[_0xb814('0x3f')]({},_0x37d24d,_0x52ed64[_0xb814('0x40')]);var _0x51cdba={'where':_0x37d24d['where']};return db[_0xb814('0x41')]['count'](_0x51cdba)[_0xb814('0x28')](function(_0x1098eb){_0x499f22[_0xb814('0x22')]=_0x1098eb;if(_0x52ed64[_0xb814('0x33')][_0xb814('0x42')]){_0x37d24d[_0xb814('0x43')]=[{'all':!![]}];}return db[_0xb814('0x41')][_0xb814('0x44')](_0x37d24d);})[_0xb814('0x28')](function(_0x4b6ff8){_0x499f22['rows']=_0x4b6ff8;return _0x499f22;})['then'](respondWithFilteredResult(_0x9008b2,_0x37d24d))[_0xb814('0x45')](handleError(_0x9008b2,null));};exports['show']=function(_0x29416a,_0x580171){var _0x411723={'raw':!![],'where':{'id':_0x29416a[_0xb814('0x46')]['id']}},_0x44ff56={};_0x44ff56[_0xb814('0x32')]=_['keys'](db[_0xb814('0x41')][_0xb814('0x30')]);_0x44ff56[_0xb814('0x33')]=_[_0xb814('0x34')](_0x29416a[_0xb814('0x33')]);_0x44ff56[_0xb814('0x3c')]=_['intersection'](_0x44ff56[_0xb814('0x32')],_0x44ff56[_0xb814('0x33')]);_0x411723[_0xb814('0x36')]=_[_0xb814('0x35')](_0x44ff56[_0xb814('0x32')],qs[_0xb814('0x37')](_0x29416a[_0xb814('0x33')]['fields']));_0x411723['attributes']=_0x411723[_0xb814('0x36')][_0xb814('0x38')]?_0x411723[_0xb814('0x36')]:_0x44ff56[_0xb814('0x32')];if(_0x29416a[_0xb814('0x33')][_0xb814('0x42')]){_0x411723[_0xb814('0x43')]=[{'all':!![]}];}_0x411723=_[_0xb814('0x3f')]({},_0x411723,_0x29416a[_0xb814('0x40')]);return db[_0xb814('0x41')][_0xb814('0x47')](_0x411723)['then'](handleEntityNotFound(_0x580171,null))[_0xb814('0x28')](respondWithResult(_0x580171,null))[_0xb814('0x45')](handleError(_0x580171,null));};exports['create']=function(_0x338e80,_0x55234d){return db[_0xb814('0x41')][_0xb814('0x48')](_0x338e80[_0xb814('0x49')],{})[_0xb814('0x28')](respondWithResult(_0x55234d,0xc9))[_0xb814('0x45')](handleError(_0x55234d,null));};exports[_0xb814('0x27')]=function(_0x2cc806,_0x45480e){if(_0x2cc806[_0xb814('0x49')]['id']){delete _0x2cc806[_0xb814('0x49')]['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x2cc806[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x45480e,null))[_0xb814('0x28')](saveUpdates(_0x2cc806[_0xb814('0x49')],null))[_0xb814('0x28')](respondWithResult(_0x45480e,null))[_0xb814('0x45')](handleError(_0x45480e,null));};exports[_0xb814('0x29')]=function(_0x4a4f9a,_0x26fd0b){return db[_0xb814('0x41')][_0xb814('0x47')]({'where':{'id':_0x4a4f9a['params']['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x26fd0b,null))['then'](removeEntity(_0x26fd0b,null))[_0xb814('0x45')](handleError(_0x26fd0b,null));};exports['describe']=function(_0x403872,_0x3cf8f8){return db['ChatQueueReport'][_0xb814('0x4a')]()[_0xb814('0x28')](respondWithResult(_0x3cf8f8,null))[_0xb814('0x45')](handleError(_0x3cf8f8,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 8d29d12..3967553 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 _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x505bfb,_0xe48938){var _0x3bca12=function(_0x1fb16f){while(--_0x1fb16f){_0x505bfb['push'](_0x505bfb['shift']());}};_0x3bca12(++_0xe48938);}(_0xb7e7,0x121));var _0x7b7e=function(_0x369151,_0x179f72){_0x369151=_0x369151-0x0;var _0x4292d5=_0xb7e7[_0x369151];return _0x4292d5;};'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_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x30321d,_0x1a6b9c){var _0x411788=function(_0x1f8756){while(--_0x1f8756){_0x30321d['push'](_0x30321d['shift']());}};_0x411788(++_0x1a6b9c);}(_0x757a,0xde));var _0xa757=function(_0x4c4c4b,_0x27b4c0){_0x4c4c4b=_0x4c4c4b-0x0;var _0x4ecc32=_0x757a[_0x4c4c4b];return _0x4ecc32;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 83366cc..f893ed6 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 _0x4b1b=['result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','update','then','UpdateChatQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','http','request','info','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message'];(function(_0x4b8856,_0x530d7a){var _0x97f799=function(_0x40d345){while(--_0x40d345){_0x4b8856['push'](_0x4b8856['shift']());}};_0x97f799(++_0x530d7a);}(_0x4b1b,0x17f));var _0xb4b1=function(_0x35e51a,_0xb84938){_0x35e51a=_0x35e51a-0x0;var _0x5214d1=_0x4b1b[_0x35e51a];return _0x5214d1;};'use strict';var _=require(_0xb4b1('0x0'));var util=require(_0xb4b1('0x1'));var moment=require(_0xb4b1('0x2'));var BPromise=require(_0xb4b1('0x3'));var rs=require(_0xb4b1('0x4'));var fs=require('fs');var Redis=require(_0xb4b1('0x5'));var db=require(_0xb4b1('0x6'))['db'];var utils=require(_0xb4b1('0x7'));var logger=require(_0xb4b1('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xb4b1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x7d6283,_0x34272c,_0xfeb13a){return new BPromise(function(_0x2903d3,_0x289b18){return client[_0xb4b1('0xa')](_0x7d6283,_0xfeb13a)['then'](function(_0x3a7811){logger[_0xb4b1('0xb')]('ChatQueueReport,\x20%s,\x20%s',_0x34272c,_0xb4b1('0xc'));logger[_0xb4b1('0xd')](_0xb4b1('0xe'),_0x34272c,_0xb4b1('0xc'),JSON[_0xb4b1('0xf')](_0x3a7811));if(_0x3a7811['error']){if(_0x3a7811[_0xb4b1('0x10')][_0xb4b1('0x11')]===0x1f4){logger[_0xb4b1('0x10')](_0xb4b1('0x12'),_0x34272c,_0x3a7811[_0xb4b1('0x10')][_0xb4b1('0x13')]);return _0x289b18(_0x3a7811[_0xb4b1('0x10')][_0xb4b1('0x13')]);}logger[_0xb4b1('0x10')](_0xb4b1('0x12'),_0x34272c,_0x3a7811['error'][_0xb4b1('0x13')]);return _0x2903d3(_0x3a7811[_0xb4b1('0x10')][_0xb4b1('0x13')]);}else{logger['info'](_0xb4b1('0x12'),_0x34272c,_0xb4b1('0xc'));_0x2903d3(_0x3a7811[_0xb4b1('0x14')][_0xb4b1('0x13')]);}})[_0xb4b1('0x15')](function(_0x3a3c42){logger['error'](_0xb4b1('0x12'),_0x34272c,_0x3a3c42);_0x289b18(_0x3a3c42);});});}exports[_0xb4b1('0x16')]=function(_0x25b284){var _0x544f52=this;return new Promise(function(_0x30f27d,_0x36075d){return db[_0xb4b1('0x17')][_0xb4b1('0x18')](_0x25b284[_0xb4b1('0x19')],{'raw':_0x25b284[_0xb4b1('0x1a')]?_0x25b284[_0xb4b1('0x1a')][_0xb4b1('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x3112e3){logger[_0xb4b1('0xb')]('CreateChatQueueReport',_0x25b284);logger[_0xb4b1('0xd')]('CreateChatQueueReport',_0x25b284,JSON['stringify'](_0x3112e3));_0x30f27d(_0x3112e3);})[_0xb4b1('0x15')](function(_0x274b85){logger[_0xb4b1('0x10')](_0xb4b1('0x16'),_0x274b85[_0xb4b1('0x13')],_0x25b284);_0x36075d(_0x544f52[_0xb4b1('0x10')](0x1f4,_0x274b85[_0xb4b1('0x13')]));});});};exports['UpdateChatQueueReport']=function(_0x50b0a6){var _0x38897e=this;return new Promise(function(_0x3d0965,_0x22b8e8){return db['ChatQueueReport'][_0xb4b1('0x1c')](_0x50b0a6[_0xb4b1('0x19')],{'raw':_0x50b0a6[_0xb4b1('0x1a')]?_0x50b0a6[_0xb4b1('0x1a')][_0xb4b1('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50b0a6[_0xb4b1('0x1a')]?_0x50b0a6['options']['where']||null:null,'attributes':_0x50b0a6['options']?_0x50b0a6['options']['attributes']||null:null,'limit':_0x50b0a6[_0xb4b1('0x1a')]?_0x50b0a6[_0xb4b1('0x1a')]['limit']||null:null})[_0xb4b1('0x1d')](function(_0x4c639f){logger[_0xb4b1('0xb')](_0xb4b1('0x1e'),_0x50b0a6);logger[_0xb4b1('0xd')](_0xb4b1('0x1e'),_0x50b0a6,JSON[_0xb4b1('0xf')](_0x4c639f));_0x3d0965(_0x4c639f);})[_0xb4b1('0x15')](function(_0x28321f){logger[_0xb4b1('0x10')](_0xb4b1('0x1e'),_0x28321f['message'],_0x50b0a6);_0x22b8e8(_0x38897e[_0xb4b1('0x10')](0x1f4,_0x28321f[_0xb4b1('0x13')]));});});}; \ No newline at end of file +var _0xd0eb=['debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','then','UpdateChatQueueReport','update','attributes','limit','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd0eb,0x11b));var _0xbd0e=function(_0x36909d,_0x2795f1){_0x36909d=_0x36909d-0x0;var _0x1fd29d=_0xd0eb[_0x36909d];return _0x1fd29d;};'use strict';var _=require(_0xbd0e('0x0'));var util=require(_0xbd0e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbd0e('0x2'));var fs=require('fs');var Redis=require(_0xbd0e('0x3'));var db=require(_0xbd0e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbd0e('0x5'))('rpc');var config=require(_0xbd0e('0x6'));var jayson=require(_0xbd0e('0x7'));var client=jayson[_0xbd0e('0x8')][_0xbd0e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4fb2a5,_0x5837e4,_0x301345){return new BPromise(function(_0x2aa462,_0x23051c){return client[_0xbd0e('0xa')](_0x4fb2a5,_0x301345)['then'](function(_0x300daa){logger[_0xbd0e('0xb')](_0xbd0e('0xc'),_0x5837e4,_0xbd0e('0xd'));logger[_0xbd0e('0xe')](_0xbd0e('0xf'),_0x5837e4,'request\x20sent',JSON[_0xbd0e('0x10')](_0x300daa));if(_0x300daa[_0xbd0e('0x11')]){if(_0x300daa[_0xbd0e('0x11')][_0xbd0e('0x12')]===0x1f4){logger[_0xbd0e('0x11')](_0xbd0e('0xc'),_0x5837e4,_0x300daa[_0xbd0e('0x11')][_0xbd0e('0x13')]);return _0x23051c(_0x300daa['error'][_0xbd0e('0x13')]);}logger[_0xbd0e('0x11')](_0xbd0e('0xc'),_0x5837e4,_0x300daa['error']['message']);return _0x2aa462(_0x300daa['error'][_0xbd0e('0x13')]);}else{logger[_0xbd0e('0xb')]('ChatQueueReport,\x20%s,\x20%s',_0x5837e4,_0xbd0e('0xd'));_0x2aa462(_0x300daa[_0xbd0e('0x14')][_0xbd0e('0x13')]);}})[_0xbd0e('0x15')](function(_0x583422){logger[_0xbd0e('0x11')](_0xbd0e('0xc'),_0x5837e4,_0x583422);_0x23051c(_0x583422);});});}exports[_0xbd0e('0x16')]=function(_0x16ecf2){var _0x53e1c3=this;return new Promise(function(_0xd93d7c,_0x48ec26){return db[_0xbd0e('0x17')][_0xbd0e('0x18')](_0x16ecf2[_0xbd0e('0x19')],{'raw':_0x16ecf2[_0xbd0e('0x1a')]?_0x16ecf2[_0xbd0e('0x1a')][_0xbd0e('0x1b')]===undefined?!![]:![]:!![]})[_0xbd0e('0x1c')](function(_0xf8790){logger[_0xbd0e('0xb')](_0xbd0e('0x16'),_0x16ecf2);logger['debug'](_0xbd0e('0x16'),_0x16ecf2,JSON[_0xbd0e('0x10')](_0xf8790));_0xd93d7c(_0xf8790);})[_0xbd0e('0x15')](function(_0x571a7b){logger[_0xbd0e('0x11')]('CreateChatQueueReport',_0x571a7b[_0xbd0e('0x13')],_0x16ecf2);_0x48ec26(_0x53e1c3[_0xbd0e('0x11')](0x1f4,_0x571a7b[_0xbd0e('0x13')]));});});};exports[_0xbd0e('0x1d')]=function(_0x166d8a){var _0x493b67=this;return new Promise(function(_0x18bd27,_0x377907){return db[_0xbd0e('0x17')][_0xbd0e('0x1e')](_0x166d8a['body'],{'raw':_0x166d8a[_0xbd0e('0x1a')]?_0x166d8a[_0xbd0e('0x1a')][_0xbd0e('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x166d8a[_0xbd0e('0x1a')]?_0x166d8a[_0xbd0e('0x1a')]['where']||null:null,'attributes':_0x166d8a[_0xbd0e('0x1a')]?_0x166d8a['options'][_0xbd0e('0x1f')]||null:null,'limit':_0x166d8a['options']?_0x166d8a['options'][_0xbd0e('0x20')]||null:null})[_0xbd0e('0x1c')](function(_0x3cf29c){logger[_0xbd0e('0xb')](_0xbd0e('0x1d'),_0x166d8a);logger[_0xbd0e('0xe')](_0xbd0e('0x1d'),_0x166d8a,JSON[_0xbd0e('0x10')](_0x3cf29c));_0x18bd27(_0x3cf29c);})[_0xbd0e('0x15')](function(_0x502cac){logger['error'](_0xbd0e('0x1d'),_0x502cac[_0xbd0e('0x13')],_0x166d8a);_0x377907(_0x493b67['error'](0x1f4,_0x502cac['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index a27854e..d516564 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 _0x6328=['post','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show'];(function(_0x4c7201,_0x149744){var _0x2e4329=function(_0x3424f8){while(--_0x3424f8){_0x4c7201['push'](_0x4c7201['shift']());}};_0x2e4329(++_0x149744);}(_0x6328,0x1d3));var _0x8632=function(_0x2dc7c9,_0x3a15f8){_0x2dc7c9=_0x2dc7c9-0x0;var _0x3e6536=_0x6328[_0x2dc7c9];return _0x3e6536;};'use strict';var multer=require(_0x8632('0x0'));var util=require(_0x8632('0x1'));var path=require(_0x8632('0x2'));var timeout=require(_0x8632('0x3'));var express=require('express');var router=express[_0x8632('0x4')]();var fs_extra=require(_0x8632('0x5'));var auth=require(_0x8632('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8632('0x7'));var controller=require(_0x8632('0x8'));router['get']('/',auth[_0x8632('0x9')](),controller[_0x8632('0xa')]);router[_0x8632('0xb')](_0x8632('0xc'),auth[_0x8632('0x9')](),controller[_0x8632('0xd')]);router[_0x8632('0xb')](_0x8632('0xe'),auth[_0x8632('0x9')](),controller[_0x8632('0xf')]);router[_0x8632('0x10')]('/',auth[_0x8632('0x9')](),controller['create']);router[_0x8632('0x11')](_0x8632('0xe'),auth[_0x8632('0x9')](),controller[_0x8632('0x12')]);router['delete'](_0x8632('0xe'),auth['isAuthenticated'](),controller[_0x8632('0x13')]);module[_0x8632('0x14')]=router; \ No newline at end of file +var _0xbf76=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./chatQueueReport.controller','index','get','/describe','describe','/:id','isAuthenticated','show','post','create'];(function(_0x2ee360,_0x48442d){var _0x47d4ff=function(_0x2afdcc){while(--_0x2afdcc){_0x2ee360['push'](_0x2ee360['shift']());}};_0x47d4ff(++_0x48442d);}(_0xbf76,0x14f));var _0x6bf7=function(_0x5c91f1,_0x5d27ef){_0x5c91f1=_0x5c91f1-0x0;var _0x4b4652=_0xbf76[_0x5c91f1];return _0x4b4652;};'use strict';var multer=require(_0x6bf7('0x0'));var util=require(_0x6bf7('0x1'));var path=require(_0x6bf7('0x2'));var timeout=require(_0x6bf7('0x3'));var express=require(_0x6bf7('0x4'));var router=express[_0x6bf7('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6bf7('0x6'));var config=require('../../config/environment');var controller=require(_0x6bf7('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x6bf7('0x8')]);router[_0x6bf7('0x9')](_0x6bf7('0xa'),auth['isAuthenticated'](),controller[_0x6bf7('0xb')]);router[_0x6bf7('0x9')](_0x6bf7('0xc'),auth[_0x6bf7('0xd')](),controller[_0x6bf7('0xe')]);router[_0x6bf7('0xf')]('/',auth[_0x6bf7('0xd')](),controller[_0x6bf7('0x10')]);router[_0x6bf7('0x11')](_0x6bf7('0xc'),auth['isAuthenticated'](),controller[_0x6bf7('0x12')]);router[_0x6bf7('0x13')](_0x6bf7('0xc'),auth[_0x6bf7('0xd')](),controller[_0x6bf7('0x14')]);module[_0x6bf7('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index d89f213..7a83fee 100644 --- a/server/api/chatTransferReport/chatTransferReport.attributes.js +++ b/server/api/chatTransferReport/chatTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x154abc,_0x4d10d5){var _0x4d702=function(_0x2f9e56){while(--_0x2f9e56){_0x154abc['push'](_0x154abc['shift']());}};_0x4d702(++_0x4d10d5);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x33f1f1,_0x3f2a10){_0x33f1f1=_0x33f1f1-0x0;var _0x3052d4=_0xf3cd[_0x33f1f1];return _0x3052d4;};'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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x3d2ea4,_0xbbfa1d){var _0x2c4a59=function(_0x1ee70f){while(--_0x1ee70f){_0x3d2ea4['push'](_0x3d2ea4['shift']());}};_0x2c4a59(++_0xbbfa1d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index cacfd59..68a384a 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 _0xf632=['includeAll','find','create','catch','body','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','error','name','send','index','map','ChatTransferReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','where','merge','filter','options','include','findAll','rows','show','params','length'];(function(_0x254abd,_0x1ab7f0){var _0x31bf1b=function(_0x447fd8){while(--_0x447fd8){_0x254abd['push'](_0x254abd['shift']());}};_0x31bf1b(++_0x1ab7f0);}(_0xf632,0x1c2));var _0x2f63=function(_0x2e3457,_0x550d7c){_0x2e3457=_0x2e3457-0x0;var _0x59d404=_0xf632[_0x2e3457];return _0x59d404;};'use strict';var emlformat=require(_0x2f63('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2f63('0x1'));var rp=require(_0x2f63('0x2'));var moment=require(_0x2f63('0x3'));var BPromise=require(_0x2f63('0x4'));var Mustache=require(_0x2f63('0x5'));var util=require(_0x2f63('0x6'));var path=require(_0x2f63('0x7'));var sox=require(_0x2f63('0x8'));var csv=require(_0x2f63('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2f63('0xa'));var _=require(_0x2f63('0xb'));var squel=require(_0x2f63('0xc'));var crypto=require('crypto');var jsforce=require(_0x2f63('0xd'));var deskjs=require(_0x2f63('0xe'));var toCsv=require(_0x2f63('0x9'));var querystring=require(_0x2f63('0xf'));var Papa=require('papaparse');var Redis=require(_0x2f63('0x10'));var authService=require(_0x2f63('0x11'));var qs=require(_0x2f63('0x12'));var as=require(_0x2f63('0x13'));var hardwareService=require(_0x2f63('0x14'));var logger=require(_0x2f63('0x15'))(_0x2f63('0x16'));var utils=require(_0x2f63('0x17'));var config=require(_0x2f63('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x2f63('0x19'))['db'];function respondWithStatusCode(_0x4887a9,_0x177421){_0x177421=_0x177421||0xcc;return function(_0x4f6dc1){if(_0x4f6dc1){return _0x4887a9[_0x2f63('0x1a')](_0x177421);}return _0x4887a9[_0x2f63('0x1b')](_0x177421)[_0x2f63('0x1c')]();};}function respondWithResult(_0x5860b9,_0x521ae9){_0x521ae9=_0x521ae9||0xc8;return function(_0xb1e2e6){if(_0xb1e2e6){return _0x5860b9['status'](_0x521ae9)[_0x2f63('0x1d')](_0xb1e2e6);}};}function respondWithFilteredResult(_0x5bb716,_0x3d88a8){return function(_0x3da9b6){if(_0x3da9b6){var _0x4a9aad=typeof _0x3d88a8[_0x2f63('0x1e')]===_0x2f63('0x1f')&&typeof _0x3d88a8['limit']===_0x2f63('0x1f');var _0xa2ebc3=_0x3da9b6['count'];var _0x1fa5e9=_0x4a9aad?0x0:_0x3d88a8[_0x2f63('0x1e')];var _0x16a83b=_0x4a9aad?_0x3da9b6[_0x2f63('0x20')]:_0x3d88a8[_0x2f63('0x1e')]+_0x3d88a8[_0x2f63('0x21')];var _0x2d3c02;if(_0x16a83b>=_0xa2ebc3){_0x16a83b=_0xa2ebc3;_0x2d3c02=0xc8;}else{_0x2d3c02=0xce;}_0x5bb716[_0x2f63('0x1b')](_0x2d3c02);return _0x5bb716[_0x2f63('0x22')](_0x2f63('0x23'),_0x1fa5e9+'-'+_0x16a83b+'/'+_0xa2ebc3)[_0x2f63('0x1d')](_0x3da9b6);}return null;};}function patchUpdates(_0x2f94f5){return function(_0x4804e3){try{jsonpatch[_0x2f63('0x24')](_0x4804e3,_0x2f94f5,!![]);}catch(_0x14c0cf){return BPromise[_0x2f63('0x25')](_0x14c0cf);}return _0x4804e3['save']();};}function saveUpdates(_0x20aeec,_0xa78b9a){return function(_0x52af76){if(_0x52af76){return _0x52af76[_0x2f63('0x26')](_0x20aeec)['then'](function(_0xe62e72){return _0xe62e72;});}return null;};}function removeEntity(_0x110417,_0x3ee8e2){return function(_0x54dda4){if(_0x54dda4){return _0x54dda4['destroy']()[_0x2f63('0x27')](function(){_0x110417[_0x2f63('0x1b')](0xcc)[_0x2f63('0x1c')]();});}};}function handleEntityNotFound(_0x1b75f3,_0x38b626){return function(_0x46794e){if(!_0x46794e){_0x1b75f3[_0x2f63('0x1a')](0x194);}return _0x46794e;};}function handleError(_0x3358fa,_0x2298e5){_0x2298e5=_0x2298e5||0x1f4;return function(_0x3eb1f4){logger[_0x2f63('0x28')](_0x3eb1f4['stack']);if(_0x3eb1f4[_0x2f63('0x29')]){delete _0x3eb1f4['name'];}_0x3358fa[_0x2f63('0x1b')](_0x2298e5)[_0x2f63('0x2a')](_0x3eb1f4);};}exports[_0x2f63('0x2b')]=function(_0xf63465,_0x25a3db){var _0x27c5b1={},_0x46004a={},_0x13de37={'count':0x0,'rows':[]};var _0x4666bd=_[_0x2f63('0x2c')](db[_0x2f63('0x2d')][_0x2f63('0x2e')],function(_0x53faad){return{'name':_0x53faad['fieldName'],'type':_0x53faad[_0x2f63('0x2f')][_0x2f63('0x30')]};});_0x46004a[_0x2f63('0x31')]=_[_0x2f63('0x2c')](_0x4666bd,_0x2f63('0x29'));_0x46004a[_0x2f63('0x32')]=_[_0x2f63('0x33')](_0xf63465[_0x2f63('0x32')]);_0x46004a[_0x2f63('0x34')]=_[_0x2f63('0x35')](_0x46004a[_0x2f63('0x31')],_0x46004a[_0x2f63('0x32')]);_0x27c5b1[_0x2f63('0x36')]=_[_0x2f63('0x35')](_0x46004a[_0x2f63('0x31')],qs[_0x2f63('0x37')](_0xf63465[_0x2f63('0x32')][_0x2f63('0x37')]));_0x27c5b1[_0x2f63('0x36')]=_0x27c5b1['attributes']['length']?_0x27c5b1[_0x2f63('0x36')]:_0x46004a['model'];if(!_0xf63465[_0x2f63('0x32')][_0x2f63('0x38')]('nolimit')){_0x27c5b1[_0x2f63('0x21')]=qs[_0x2f63('0x21')](_0xf63465['query'][_0x2f63('0x21')]);_0x27c5b1[_0x2f63('0x1e')]=qs[_0x2f63('0x1e')](_0xf63465[_0x2f63('0x32')][_0x2f63('0x1e')]);}_0x27c5b1[_0x2f63('0x39')]=qs['sort'](_0xf63465[_0x2f63('0x32')]['sort']);_0x27c5b1['where']=qs[_0x2f63('0x34')](_['pick'](_0xf63465[_0x2f63('0x32')],_0x46004a['filters']),_0x4666bd);if(_0xf63465[_0x2f63('0x32')]['filter']){_0x27c5b1[_0x2f63('0x3a')]=_[_0x2f63('0x3b')](_0x27c5b1[_0x2f63('0x3a')],{'$or':_[_0x2f63('0x2c')](_0x4666bd,function(_0x30419e){if(_0x30419e['type']!=='VIRTUAL'){var _0xf97f1b={};_0xf97f1b[_0x30419e['name']]={'$like':'%'+_0xf63465['query'][_0x2f63('0x3c')]+'%'};return _0xf97f1b;}})});}_0x27c5b1=_['merge']({},_0x27c5b1,_0xf63465[_0x2f63('0x3d')]);var _0x374a45={'where':_0x27c5b1[_0x2f63('0x3a')]};return db[_0x2f63('0x2d')][_0x2f63('0x20')](_0x374a45)['then'](function(_0x398c2c){_0x13de37['count']=_0x398c2c;if(_0xf63465['query']['includeAll']){_0x27c5b1[_0x2f63('0x3e')]=[{'all':!![]}];}return db[_0x2f63('0x2d')][_0x2f63('0x3f')](_0x27c5b1);})[_0x2f63('0x27')](function(_0x4870c7){_0x13de37[_0x2f63('0x40')]=_0x4870c7;return _0x13de37;})['then'](respondWithFilteredResult(_0x25a3db,_0x27c5b1))['catch'](handleError(_0x25a3db,null));};exports[_0x2f63('0x41')]=function(_0x3c2b87,_0x349bbc){var _0x466558={'raw':!![],'where':{'id':_0x3c2b87[_0x2f63('0x42')]['id']}},_0x134d43={};_0x134d43[_0x2f63('0x31')]=_[_0x2f63('0x33')](db[_0x2f63('0x2d')]['rawAttributes']);_0x134d43[_0x2f63('0x32')]=_[_0x2f63('0x33')](_0x3c2b87[_0x2f63('0x32')]);_0x134d43[_0x2f63('0x34')]=_['intersection'](_0x134d43['model'],_0x134d43['query']);_0x466558[_0x2f63('0x36')]=_[_0x2f63('0x35')](_0x134d43['model'],qs[_0x2f63('0x37')](_0x3c2b87[_0x2f63('0x32')][_0x2f63('0x37')]));_0x466558[_0x2f63('0x36')]=_0x466558[_0x2f63('0x36')][_0x2f63('0x43')]?_0x466558[_0x2f63('0x36')]:_0x134d43[_0x2f63('0x31')];if(_0x3c2b87['query'][_0x2f63('0x44')]){_0x466558['include']=[{'all':!![]}];}_0x466558=_['merge']({},_0x466558,_0x3c2b87[_0x2f63('0x3d')]);return db['ChatTransferReport'][_0x2f63('0x45')](_0x466558)[_0x2f63('0x27')](handleEntityNotFound(_0x349bbc,null))['then'](respondWithResult(_0x349bbc,null))['catch'](handleError(_0x349bbc,null));};exports[_0x2f63('0x46')]=function(_0xac2b5f,_0x4d13e8){return db['ChatTransferReport']['create'](_0xac2b5f['body'],{})[_0x2f63('0x27')](respondWithResult(_0x4d13e8,0xc9))[_0x2f63('0x47')](handleError(_0x4d13e8,null));};exports[_0x2f63('0x26')]=function(_0x453ce3,_0x7033f0){if(_0x453ce3[_0x2f63('0x48')]['id']){delete _0x453ce3[_0x2f63('0x48')]['id'];}return db['ChatTransferReport'][_0x2f63('0x45')]({'where':{'id':_0x453ce3[_0x2f63('0x42')]['id']}})['then'](handleEntityNotFound(_0x7033f0,null))[_0x2f63('0x27')](saveUpdates(_0x453ce3['body'],null))[_0x2f63('0x27')](respondWithResult(_0x7033f0,null))[_0x2f63('0x47')](handleError(_0x7033f0,null));};exports['destroy']=function(_0x21adc9,_0x4f7af7){return db[_0x2f63('0x2d')][_0x2f63('0x45')]({'where':{'id':_0x21adc9[_0x2f63('0x42')]['id']}})[_0x2f63('0x27')](handleEntityNotFound(_0x4f7af7,null))[_0x2f63('0x27')](removeEntity(_0x4f7af7,null))['catch'](handleError(_0x4f7af7,null));};exports[_0x2f63('0x49')]=function(_0x3768a6,_0xed7d4){return db[_0x2f63('0x2d')][_0x2f63('0x49')]()[_0x2f63('0x27')](respondWithResult(_0xed7d4,null))[_0x2f63('0x47')](handleError(_0xed7d4,null));}; \ No newline at end of file +var _0xfa8f=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','json','apply','reject','save','update','then','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','query','keys','intersection','attributes','fields','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','findAll','show','model','length','include','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x424501,_0x42096d){var _0xb719af=function(_0x37adcf){while(--_0x37adcf){_0x424501['push'](_0x424501['shift']());}};_0xb719af(++_0x42096d);}(_0xfa8f,0x15e));var _0xffa8=function(_0x517b20,_0x1155af){_0x517b20=_0x517b20-0x0;var _0x2b083b=_0xfa8f[_0x517b20];return _0x2b083b;};'use strict';var emlformat=require(_0xffa8('0x0'));var rimraf=require(_0xffa8('0x1'));var zipdir=require(_0xffa8('0x2'));var jsonpatch=require(_0xffa8('0x3'));var rp=require('request-promise');var moment=require(_0xffa8('0x4'));var BPromise=require(_0xffa8('0x5'));var Mustache=require(_0xffa8('0x6'));var util=require(_0xffa8('0x7'));var path=require('path');var sox=require(_0xffa8('0x8'));var csv=require(_0xffa8('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xffa8('0xa'));var squel=require(_0xffa8('0xb'));var crypto=require(_0xffa8('0xc'));var jsforce=require(_0xffa8('0xd'));var deskjs=require(_0xffa8('0xe'));var toCsv=require(_0xffa8('0x9'));var querystring=require('querystring');var Papa=require(_0xffa8('0xf'));var Redis=require('ioredis');var authService=require(_0xffa8('0x10'));var qs=require(_0xffa8('0x11'));var as=require(_0xffa8('0x12'));var hardwareService=require(_0xffa8('0x13'));var logger=require(_0xffa8('0x14'))(_0xffa8('0x15'));var utils=require(_0xffa8('0x16'));var config=require(_0xffa8('0x17'));var licenseUtil=require(_0xffa8('0x18'));var db=require(_0xffa8('0x19'))['db'];function respondWithStatusCode(_0x1c6a89,_0x57ee43){_0x57ee43=_0x57ee43||0xcc;return function(_0x544574){if(_0x544574){return _0x1c6a89[_0xffa8('0x1a')](_0x57ee43);}return _0x1c6a89[_0xffa8('0x1b')](_0x57ee43)[_0xffa8('0x1c')]();};}function respondWithResult(_0x58e67e,_0x17e355){_0x17e355=_0x17e355||0xc8;return function(_0x5d9b49){if(_0x5d9b49){return _0x58e67e[_0xffa8('0x1b')](_0x17e355)['json'](_0x5d9b49);}};}function respondWithFilteredResult(_0x546f5c,_0x2a60f6){return function(_0xd1b092){if(_0xd1b092){var _0x38039e=typeof _0x2a60f6['offset']===_0xffa8('0x1d')&&typeof _0x2a60f6[_0xffa8('0x1e')]===_0xffa8('0x1d');var _0x52b6b5=_0xd1b092[_0xffa8('0x1f')];var _0x3e11b0=_0x38039e?0x0:_0x2a60f6[_0xffa8('0x20')];var _0x329559=_0x38039e?_0xd1b092[_0xffa8('0x1f')]:_0x2a60f6[_0xffa8('0x20')]+_0x2a60f6[_0xffa8('0x1e')];var _0xa0ec7;if(_0x329559>=_0x52b6b5){_0x329559=_0x52b6b5;_0xa0ec7=0xc8;}else{_0xa0ec7=0xce;}_0x546f5c[_0xffa8('0x1b')](_0xa0ec7);return _0x546f5c['set']('Content-Range',_0x3e11b0+'-'+_0x329559+'/'+_0x52b6b5)[_0xffa8('0x21')](_0xd1b092);}return null;};}function patchUpdates(_0x13d3d3){return function(_0x5dce53){try{jsonpatch[_0xffa8('0x22')](_0x5dce53,_0x13d3d3,!![]);}catch(_0x738e0e){return BPromise[_0xffa8('0x23')](_0x738e0e);}return _0x5dce53[_0xffa8('0x24')]();};}function saveUpdates(_0x2be6d4,_0x214ff7){return function(_0x499427){if(_0x499427){return _0x499427[_0xffa8('0x25')](_0x2be6d4)[_0xffa8('0x26')](function(_0x16b0f7){return _0x16b0f7;});}return null;};}function removeEntity(_0x48d7be,_0x3aef02){return function(_0x23ae48){if(_0x23ae48){return _0x23ae48['destroy']()[_0xffa8('0x26')](function(){_0x48d7be[_0xffa8('0x1b')](0xcc)[_0xffa8('0x1c')]();});}};}function handleEntityNotFound(_0x56d140,_0xa666){return function(_0x3fa102){if(!_0x3fa102){_0x56d140['sendStatus'](0x194);}return _0x3fa102;};}function handleError(_0x5e0fe2,_0x51a250){_0x51a250=_0x51a250||0x1f4;return function(_0x291282){logger['error'](_0x291282[_0xffa8('0x27')]);if(_0x291282[_0xffa8('0x28')]){delete _0x291282[_0xffa8('0x28')];}_0x5e0fe2['status'](_0x51a250)[_0xffa8('0x29')](_0x291282);};}exports[_0xffa8('0x2a')]=function(_0x216d4a,_0x45f0b4){var _0x55e1c0={},_0x5a97ec={},_0xc957fa={'count':0x0,'rows':[]};var _0x3a3745=_[_0xffa8('0x2b')](db[_0xffa8('0x2c')][_0xffa8('0x2d')],function(_0x1fe2c9){return{'name':_0x1fe2c9[_0xffa8('0x2e')],'type':_0x1fe2c9[_0xffa8('0x2f')][_0xffa8('0x30')]};});_0x5a97ec['model']=_['map'](_0x3a3745,_0xffa8('0x28'));_0x5a97ec[_0xffa8('0x31')]=_[_0xffa8('0x32')](_0x216d4a[_0xffa8('0x31')]);_0x5a97ec['filters']=_[_0xffa8('0x33')](_0x5a97ec['model'],_0x5a97ec['query']);_0x55e1c0[_0xffa8('0x34')]=_[_0xffa8('0x33')](_0x5a97ec['model'],qs[_0xffa8('0x35')](_0x216d4a[_0xffa8('0x31')][_0xffa8('0x35')]));_0x55e1c0[_0xffa8('0x34')]=_0x55e1c0[_0xffa8('0x34')]['length']?_0x55e1c0[_0xffa8('0x34')]:_0x5a97ec['model'];if(!_0x216d4a[_0xffa8('0x31')]['hasOwnProperty'](_0xffa8('0x36'))){_0x55e1c0[_0xffa8('0x1e')]=qs[_0xffa8('0x1e')](_0x216d4a[_0xffa8('0x31')][_0xffa8('0x1e')]);_0x55e1c0[_0xffa8('0x20')]=qs['offset'](_0x216d4a[_0xffa8('0x31')][_0xffa8('0x20')]);}_0x55e1c0['order']=qs[_0xffa8('0x37')](_0x216d4a[_0xffa8('0x31')][_0xffa8('0x37')]);_0x55e1c0[_0xffa8('0x38')]=qs[_0xffa8('0x39')](_[_0xffa8('0x3a')](_0x216d4a[_0xffa8('0x31')],_0x5a97ec['filters']),_0x3a3745);if(_0x216d4a[_0xffa8('0x31')][_0xffa8('0x3b')]){_0x55e1c0[_0xffa8('0x38')]=_['merge'](_0x55e1c0[_0xffa8('0x38')],{'$or':_[_0xffa8('0x2b')](_0x3a3745,function(_0x2413c2){if(_0x2413c2['type']!=='VIRTUAL'){var _0x543492={};_0x543492[_0x2413c2[_0xffa8('0x28')]]={'$like':'%'+_0x216d4a['query']['filter']+'%'};return _0x543492;}})});}_0x55e1c0=_[_0xffa8('0x3c')]({},_0x55e1c0,_0x216d4a[_0xffa8('0x3d')]);var _0x513a44={'where':_0x55e1c0[_0xffa8('0x38')]};return db['ChatTransferReport']['count'](_0x513a44)['then'](function(_0x9a4b94){_0xc957fa[_0xffa8('0x1f')]=_0x9a4b94;if(_0x216d4a[_0xffa8('0x31')][_0xffa8('0x3e')]){_0x55e1c0['include']=[{'all':!![]}];}return db[_0xffa8('0x2c')][_0xffa8('0x3f')](_0x55e1c0);})[_0xffa8('0x26')](function(_0x2ce7ce){_0xc957fa['rows']=_0x2ce7ce;return _0xc957fa;})[_0xffa8('0x26')](respondWithFilteredResult(_0x45f0b4,_0x55e1c0))['catch'](handleError(_0x45f0b4,null));};exports[_0xffa8('0x40')]=function(_0x3546aa,_0x462c4e){var _0xb29e4a={'raw':!![],'where':{'id':_0x3546aa['params']['id']}},_0x3aa9ab={};_0x3aa9ab[_0xffa8('0x41')]=_[_0xffa8('0x32')](db[_0xffa8('0x2c')]['rawAttributes']);_0x3aa9ab[_0xffa8('0x31')]=_[_0xffa8('0x32')](_0x3546aa[_0xffa8('0x31')]);_0x3aa9ab['filters']=_['intersection'](_0x3aa9ab[_0xffa8('0x41')],_0x3aa9ab[_0xffa8('0x31')]);_0xb29e4a['attributes']=_[_0xffa8('0x33')](_0x3aa9ab['model'],qs[_0xffa8('0x35')](_0x3546aa['query'][_0xffa8('0x35')]));_0xb29e4a[_0xffa8('0x34')]=_0xb29e4a['attributes'][_0xffa8('0x42')]?_0xb29e4a[_0xffa8('0x34')]:_0x3aa9ab[_0xffa8('0x41')];if(_0x3546aa[_0xffa8('0x31')][_0xffa8('0x3e')]){_0xb29e4a[_0xffa8('0x43')]=[{'all':!![]}];}_0xb29e4a=_[_0xffa8('0x3c')]({},_0xb29e4a,_0x3546aa['options']);return db[_0xffa8('0x2c')][_0xffa8('0x44')](_0xb29e4a)[_0xffa8('0x26')](handleEntityNotFound(_0x462c4e,null))['then'](respondWithResult(_0x462c4e,null))[_0xffa8('0x45')](handleError(_0x462c4e,null));};exports[_0xffa8('0x46')]=function(_0x3d856d,_0x3ff3ef){return db[_0xffa8('0x2c')][_0xffa8('0x46')](_0x3d856d[_0xffa8('0x47')],{})[_0xffa8('0x26')](respondWithResult(_0x3ff3ef,0xc9))[_0xffa8('0x45')](handleError(_0x3ff3ef,null));};exports[_0xffa8('0x25')]=function(_0x203d77,_0x470047){if(_0x203d77['body']['id']){delete _0x203d77['body']['id'];}return db[_0xffa8('0x2c')][_0xffa8('0x44')]({'where':{'id':_0x203d77['params']['id']}})['then'](handleEntityNotFound(_0x470047,null))[_0xffa8('0x26')](saveUpdates(_0x203d77[_0xffa8('0x47')],null))[_0xffa8('0x26')](respondWithResult(_0x470047,null))[_0xffa8('0x45')](handleError(_0x470047,null));};exports['destroy']=function(_0x45886a,_0x386312){return db[_0xffa8('0x2c')][_0xffa8('0x44')]({'where':{'id':_0x45886a[_0xffa8('0x48')]['id']}})[_0xffa8('0x26')](handleEntityNotFound(_0x386312,null))[_0xffa8('0x26')](removeEntity(_0x386312,null))[_0xffa8('0x45')](handleError(_0x386312,null));};exports['describe']=function(_0x337745,_0x331a3c){return db[_0xffa8('0x2c')][_0xffa8('0x49')]()['then'](respondWithResult(_0x331a3c,null))[_0xffa8('0x45')](handleError(_0x331a3c,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index b005438..dc859ec 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 _0xd7a8=['path','../../config/environment','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird'];(function(_0x26a619,_0x1d78eb){var _0x2a0102=function(_0x2bc7a0){while(--_0x2bc7a0){_0x26a619['push'](_0x26a619['shift']());}};_0x2a0102(++_0x1d78eb);}(_0xd7a8,0x10e));var _0x8d7a=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xd7a8[_0x4154a6];return _0x3b2786;};'use strict';var _=require(_0x8d7a('0x0'));var util=require('util');var logger=require(_0x8d7a('0x1'))(_0x8d7a('0x2'));var moment=require(_0x8d7a('0x3'));var BPromise=require(_0x8d7a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8d7a('0x5'));var rimraf=require('rimraf');var config=require(_0x8d7a('0x6'));var attributes=require('./chatTransferReport.attributes');module['exports']=function(_0x2a5b42,_0x3e175f){return _0x2a5b42[_0x8d7a('0x7')](_0x8d7a('0x8'),attributes,{'tableName':_0x8d7a('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x8d7a('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd87f=['lodash','util','api','moment','request-promise','path','rimraf','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer'];(function(_0x3ea698,_0x2dd8a7){var _0x19a411=function(_0x2ea112){while(--_0x2ea112){_0x3ea698['push'](_0x3ea698['shift']());}};_0x19a411(++_0x2dd8a7);}(_0xd87f,0x12c));var _0xfd87=function(_0x4f4965,_0x2de5c5){_0x4f4965=_0x4f4965-0x0;var _0x19e5d9=_0xd87f[_0x4f4965];return _0x19e5d9;};'use strict';var _=require(_0xfd87('0x0'));var util=require(_0xfd87('0x1'));var logger=require('../../config/logger')(_0xfd87('0x2'));var moment=require(_0xfd87('0x3'));var BPromise=require('bluebird');var rp=require(_0xfd87('0x4'));var fs=require('fs');var path=require(_0xfd87('0x5'));var rimraf=require(_0xfd87('0x6'));var config=require('../../config/environment');var attributes=require(_0xfd87('0x7'));module[_0xfd87('0x8')]=function(_0xd42ae0,_0x5e4003){return _0xd42ae0[_0xfd87('0x9')](_0xfd87('0xa'),attributes,{'tableName':_0xfd87('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','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 86a03e2..a22c861 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 _0x5363=['then','request\x20sent','debug','error','code','ChatTransferReport,\x20%s,\x20%s','message','info','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x3eb98e,_0x379d16){var _0x257c52=function(_0x58b67a){while(--_0x58b67a){_0x3eb98e['push'](_0x3eb98e['shift']());}};_0x257c52(++_0x379d16);}(_0x5363,0x6c));var _0x3536=function(_0x42266a,_0x3b878c){_0x42266a=_0x42266a-0x0;var _0x5e2346=_0x5363[_0x42266a];return _0x5e2346;};'use strict';var _=require(_0x3536('0x0'));var util=require('util');var moment=require(_0x3536('0x1'));var BPromise=require(_0x3536('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3536('0x3'));var db=require(_0x3536('0x4'))['db'];var utils=require(_0x3536('0x5'));var logger=require(_0x3536('0x6'))(_0x3536('0x7'));var config=require(_0x3536('0x8'));var jayson=require(_0x3536('0x9'));var client=jayson[_0x3536('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2395f1,_0x59b1c4,_0x55188e){return new BPromise(function(_0x369bfe,_0x866c7f){return client[_0x3536('0xb')](_0x2395f1,_0x55188e)[_0x3536('0xc')](function(_0x378394){logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x59b1c4,_0x3536('0xd'));logger[_0x3536('0xe')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x59b1c4,_0x3536('0xd'),JSON['stringify'](_0x378394));if(_0x378394[_0x3536('0xf')]){if(_0x378394[_0x3536('0xf')][_0x3536('0x10')]===0x1f4){logger['error'](_0x3536('0x11'),_0x59b1c4,_0x378394['error'][_0x3536('0x12')]);return _0x866c7f(_0x378394[_0x3536('0xf')][_0x3536('0x12')]);}logger[_0x3536('0xf')](_0x3536('0x11'),_0x59b1c4,_0x378394[_0x3536('0xf')][_0x3536('0x12')]);return _0x369bfe(_0x378394['error'][_0x3536('0x12')]);}else{logger[_0x3536('0x13')](_0x3536('0x11'),_0x59b1c4,_0x3536('0xd'));_0x369bfe(_0x378394['result']['message']);}})['catch'](function(_0x1ce9b7){logger[_0x3536('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x59b1c4,_0x1ce9b7);_0x866c7f(_0x1ce9b7);});});} \ No newline at end of file +var _0xb92c=['util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','lodash'];(function(_0x48f60a,_0x5914b7){var _0x13829b=function(_0x3f1da5){while(--_0x3f1da5){_0x48f60a['push'](_0x48f60a['shift']());}};_0x13829b(++_0x5914b7);}(_0xb92c,0x175));var _0xcb92=function(_0x2e99a6,_0x423933){_0x2e99a6=_0x2e99a6-0x0;var _0x3cf5b4=_0xb92c[_0x2e99a6];return _0x3cf5b4;};'use strict';var _=require(_0xcb92('0x0'));var util=require(_0xcb92('0x1'));var moment=require(_0xcb92('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcb92('0x3'));var db=require(_0xcb92('0x4'))['db'];var utils=require(_0xcb92('0x5'));var logger=require('../../config/logger')(_0xcb92('0x6'));var config=require(_0xcb92('0x7'));var jayson=require(_0xcb92('0x8'));var client=jayson[_0xcb92('0x9')][_0xcb92('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf0b2b1,_0x36b0f0,_0x167288){return new BPromise(function(_0x1da49a,_0x84d276){return client[_0xcb92('0xb')](_0xf0b2b1,_0x167288)[_0xcb92('0xc')](function(_0x416217){logger['info'](_0xcb92('0xd'),_0x36b0f0,_0xcb92('0xe'));logger[_0xcb92('0xf')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x36b0f0,_0xcb92('0xe'),JSON[_0xcb92('0x10')](_0x416217));if(_0x416217['error']){if(_0x416217[_0xcb92('0x11')][_0xcb92('0x12')]===0x1f4){logger[_0xcb92('0x11')](_0xcb92('0xd'),_0x36b0f0,_0x416217[_0xcb92('0x11')][_0xcb92('0x13')]);return _0x84d276(_0x416217[_0xcb92('0x11')][_0xcb92('0x13')]);}logger[_0xcb92('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x36b0f0,_0x416217[_0xcb92('0x11')]['message']);return _0x1da49a(_0x416217[_0xcb92('0x11')]['message']);}else{logger[_0xcb92('0x14')](_0xcb92('0xd'),_0x36b0f0,_0xcb92('0xe'));_0x1da49a(_0x416217[_0xcb92('0x15')][_0xcb92('0x13')]);}})['catch'](function(_0x103839){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x36b0f0,_0x103839);_0x84d276(_0x103839);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 6377b7b..6b6951e 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 _0x007b=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id','post','put','update','delete','destroy','util'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0x007b,0xbd));var _0xb007=function(_0x10e4a9,_0x2bb443){_0x10e4a9=_0x10e4a9-0x0;var _0x24c782=_0x007b[_0x10e4a9];return _0x24c782;};'use strict';var multer=require('multer');var util=require(_0xb007('0x0'));var path=require(_0xb007('0x1'));var timeout=require(_0xb007('0x2'));var express=require(_0xb007('0x3'));var router=express[_0xb007('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb007('0x5'));var interaction=require(_0xb007('0x6'));var config=require('../../config/environment');var controller=require(_0xb007('0x7'));router['get']('/',auth[_0xb007('0x8')](),controller[_0xb007('0x9')]);router[_0xb007('0xa')](_0xb007('0xb'),auth[_0xb007('0x8')](),controller[_0xb007('0xc')]);router[_0xb007('0xa')](_0xb007('0xd'),auth[_0xb007('0x8')](),controller['show']);router[_0xb007('0xe')]('/',auth[_0xb007('0x8')](),controller['create']);router[_0xb007('0xf')](_0xb007('0xd'),auth[_0xb007('0x8')](),controller[_0xb007('0x10')]);router[_0xb007('0x11')](_0xb007('0xd'),auth['isAuthenticated'](),controller[_0xb007('0x12')]);module['exports']=router; \ No newline at end of file +var _0x0aeb=['../../components/interaction/service','./chatTransferReport.controller','get','index','/describe','describe','isAuthenticated','show','post','put','/:id','delete','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x3bb24b,_0x3af77a){var _0x34c437=function(_0x218a3a){while(--_0x218a3a){_0x3bb24b['push'](_0x3bb24b['shift']());}};_0x34c437(++_0x3af77a);}(_0x0aeb,0x94));var _0xb0ae=function(_0xa01255,_0x38166e){_0xa01255=_0xa01255-0x0;var _0xa06916=_0x0aeb[_0xa01255];return _0xa06916;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xb0ae('0x0'));var express=require(_0xb0ae('0x1'));var router=express[_0xb0ae('0x2')]();var fs_extra=require(_0xb0ae('0x3'));var auth=require(_0xb0ae('0x4'));var interaction=require(_0xb0ae('0x5'));var config=require('../../config/environment');var controller=require(_0xb0ae('0x6'));router[_0xb0ae('0x7')]('/',auth['isAuthenticated'](),controller[_0xb0ae('0x8')]);router['get'](_0xb0ae('0x9'),auth['isAuthenticated'](),controller[_0xb0ae('0xa')]);router['get']('/:id',auth[_0xb0ae('0xb')](),controller[_0xb0ae('0xc')]);router[_0xb0ae('0xd')]('/',auth[_0xb0ae('0xb')](),controller['create']);router[_0xb0ae('0xe')](_0xb0ae('0xf'),auth[_0xb0ae('0xb')](),controller['update']);router[_0xb0ae('0x10')]('/:id',auth[_0xb0ae('0xb')](),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 2f92ea8..b2c70e6 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 _0x423b=['mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','STRING','address','email','Agent','#011F6A','INTEGER','BOOLEAN','ENUM','squared','rounded','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','thumb','star','stringify','text','input','onlineForm','getDataValue','Comments','Leave\x20your\x20comments','parse','setDataValue','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:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x5b8310,_0x77ea6f){var _0xd3ebc1=function(_0x9dfb29){while(--_0x9dfb29){_0x5b8310['push'](_0x5b8310['shift']());}};_0xd3ebc1(++_0x77ea6f);}(_0x423b,0xd3));var _0xb423=function(_0x44946b,_0xf874ec){_0x44946b=_0x44946b-0x0;var _0x249bc4=_0x423b[_0x44946b];return _0x249bc4;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xb423('0x0'));module[_0xb423('0x1')]={'name':{'type':Sequelize[_0xb423('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xb423('0x2')],'allowNull':![],'unique':_0xb423('0x3')},'description':{'type':Sequelize[_0xb423('0x2')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xb423('0x4')},'mapKeyOffline':{'type':Sequelize[_0xb423('0x2')],'defaultValue':_0xb423('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xb423('0x2')],'defaultValue':_0xb423('0x5')},'customerAlias':{'type':Sequelize[_0xb423('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xb423('0x2')],'allowNull':![],'defaultValue':_0xb423('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xb423('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xb423('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xb423('0x2')]},'animation':{'type':Sequelize[_0xb423('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xb423('0x9')]('rounded',_0xb423('0xa')),'defaultValue':_0xb423('0xb')},'header_online':{'type':Sequelize[_0xb423('0x2')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0xb423('0x2')],'defaultValue':_0xb423('0xc')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xb423('0xd')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xb423('0xe')},'download_transcript':{'type':Sequelize[_0xb423('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xb423('0x2')],'defaultValue':_0xb423('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0xb423('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xb423('0x10')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xb423('0x2')],'defaultValue':_0xb423('0x11')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0xb423('0x12')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0xb423('0x13')},'placeholderMessage':{'type':Sequelize[_0xb423('0x2')],'defaultValue':_0xb423('0x14')},'closingMessage':{'type':Sequelize[_0xb423('0x2')],'defaultValue':_0xb423('0x15')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xb423('0xd')},'skipMessageButton':{'type':Sequelize[_0xb423('0x2')],'defaultValue':_0xb423('0x16')},'conditionAgreement':{'type':Sequelize[_0xb423('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xb423('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xb423('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xb423('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xb423('0x2')],'defaultValue':_0xb423('0x17')},'ratingType':{'type':Sequelize[_0xb423('0x9')]('star',_0xb423('0x18')),'defaultValue':_0xb423('0x19')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xb423('0x10')],'defaultValue':function(){return JSON[_0xb423('0x1a')]({'items':[{'type':'input','variable':null,'config':{'placeholder':'name','type':_0xb423('0x1b'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0xb423('0x1c'),'props':{'title':_0xb423('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xb423('0x4'),'type':_0xb423('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0xb423('0x1d'))?JSON['parse'](this[_0xb423('0x1e')](_0xb423('0x1d'))):{};},'set':function(_0x4d127a){return this['setDataValue'](_0xb423('0x1d'),JSON['stringify'](_0x4d127a));}},'offlineForm':{'type':Sequelize[_0xb423('0x10')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','props':{'title':_0xb423('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xb423('0x4'),'type':_0xb423('0x4')},'variable':null},{'type':'textarea','config':{'placeholder':_0xb423('0x1f')},'props':{'title':'Comments','helpText':_0xb423('0x20')}}],'fromKey':0x0});},'get':function(){return this['getDataValue']('offlineForm')?JSON[_0xb423('0x21')](this[_0xb423('0x1e')]('offlineForm')):{};},'set':function(_0x55b934){return this[_0xb423('0x22')](_0xb423('0x23'),JSON[_0xb423('0x1a')](_0x55b934));}},'token':{'type':Sequelize[_0xb423('0x2')],'defaultValue':function(){return rs[_0xb423('0x24')]();}},'autoclose':{'type':Sequelize[_0xb423('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xb423('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xb423('0x2')]},'forwardOffline':{'type':Sequelize[_0xb423('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xb423('0x2')]},'waitingTitle':{'type':Sequelize[_0xb423('0x2')],'defaultValue':_0xb423('0x25')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xb423('0x26')},'offlineMessageSubject':{'type':Sequelize[_0xb423('0x2')],'defaultValue':_0xb423('0x27')},'offlineMessageBody':{'type':Sequelize[_0xb423('0x2')],'defaultValue':_0xb423('0x28')},'enableUnmanagedNote':{'type':Sequelize[_0xb423('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xb423('0x2')],'defaultValue':_0xb423('0x29')},'skipUnmanaged':{'type':Sequelize[_0xb423('0x2')],'defaultValue':_0xb423('0x16')},'sendUnmanaged':{'type':Sequelize[_0xb423('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0xb423('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xb423('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xb423('0x10')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0xb423('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xb423('0x2a');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb423('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xb423('0x2')],'defaultValue':_0xb423('0x2b')},'verticalAlignment':{'type':Sequelize[_0xb423('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0xb423('0x2c')},'messagesAlignment':{'type':Sequelize[_0xb423('0x2')],'defaultValue':_0xb423('0x2d')},'defaultTitle':{'type':Sequelize[_0xb423('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xb423('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb423('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb423('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb423('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xb423('0x2')],'defaultValue':_0xb423('0x2e')},'systemAvatar':{'type':Sequelize[_0xb423('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb423('0x7')],'comment':_0xb423('0x2f')},'mandatoryDisposition':{'type':Sequelize[_0xb423('0x8')],'defaultValue':![],'comment':_0xb423('0x30'),'set':function(_0x930a2f){if(!_0x930a2f)this[_0xb423('0x22')]('mandatoryDispositionPauseId',null);this[_0xb423('0x22')](_0xb423('0x31'),_0x930a2f);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb423('0x32')},'vidaooNote':{'type':Sequelize[_0xb423('0x2')],'defaultValue':function(){return _0xb423('0x33');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xb423('0x10')]}}; \ No newline at end of file +var _0x854f=['#fafafa','System','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','STRING','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Send','Skip','Feedback','star','thumb','input','getDataValue','onlineForm','setDataValue','stringify','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','bottom_right','CHAT','alternate'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x854f,0x188));var _0xf854=function(_0x1b859a,_0x1ab2d4){_0x1b859a=_0x1b859a-0x0;var _0x5ce5cd=_0x854f[_0x1b859a];return _0x5ce5cd;};'use strict';var Sequelize=require(_0xf854('0x0'));var rs=require(_0xf854('0x1'));module['exports']={'name':{'type':Sequelize[_0xf854('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xf854('0x2')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0xf854('0x2')]},'mapKey':{'type':Sequelize[_0xf854('0x2')],'defaultValue':_0xf854('0x3')},'mapKeyOffline':{'type':Sequelize[_0xf854('0x2')],'defaultValue':_0xf854('0x3')},'key':{'type':Sequelize[_0xf854('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xf854('0x4')},'customerAlias':{'type':Sequelize[_0xf854('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xf854('0x2')],'allowNull':![],'defaultValue':_0xf854('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xf854('0x2')],'allowNull':![],'defaultValue':_0xf854('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xf854('0x2')],'allowNull':![],'defaultValue':_0xf854('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xf854('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xf854('0x2')]},'animation':{'type':Sequelize[_0xf854('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xf854('0x9')](_0xf854('0xa'),_0xf854('0xb')),'defaultValue':_0xf854('0xa')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xf854('0xc')},'start_chat_button':{'type':Sequelize[_0xf854('0x2')],'defaultValue':_0xf854('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Send'},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xf854('0xe')},'download_transcript':{'type':Sequelize[_0xf854('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xf854('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xf854('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xf854('0xf')]},'closingQuestion':{'type':Sequelize[_0xf854('0x2')],'defaultValue':_0xf854('0x10')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0xf854('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0xf854('0x2')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0xf854('0x2')],'defaultValue':_0xf854('0x12')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xf854('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xf854('0x2')],'defaultValue':_0xf854('0x13')},'skipMessageButton':{'type':Sequelize[_0xf854('0x2')],'defaultValue':_0xf854('0x14')},'conditionAgreement':{'type':Sequelize[_0xf854('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xf854('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xf854('0x2')],'defaultValue':_0xf854('0x15')},'ratingType':{'type':Sequelize[_0xf854('0x9')](_0xf854('0x16'),_0xf854('0x17')),'defaultValue':_0xf854('0x16')},'ratingStarsNumber':{'type':Sequelize[_0xf854('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xf854('0xf')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xf854('0x18'),'variable':null,'config':{'placeholder':'name','type':'text','required':!![]},'props':{'title':'name','helpText':''}},{'type':'input','props':{'title':_0xf854('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xf854('0x3'),'type':_0xf854('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xf854('0x19')](_0xf854('0x1a'))?JSON['parse'](this['getDataValue'](_0xf854('0x1a'))):{};},'set':function(_0x1f0e81){return this[_0xf854('0x1b')](_0xf854('0x1a'),JSON[_0xf854('0x1c')](_0x1f0e81));}},'offlineForm':{'type':Sequelize[_0xf854('0xf')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xf854('0x18'),'props':{'title':_0xf854('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xf854('0x3'),'type':_0xf854('0x3')},'variable':null},{'type':'textarea','config':{'placeholder':_0xf854('0x1d')},'props':{'title':_0xf854('0x1d'),'helpText':_0xf854('0x1e')}}],'fromKey':0x0});},'get':function(){return this[_0xf854('0x19')](_0xf854('0x1f'))?JSON['parse'](this[_0xf854('0x19')](_0xf854('0x1f'))):{};},'set':function(_0x56a3c5){return this['setDataValue'](_0xf854('0x1f'),JSON[_0xf854('0x1c')](_0x56a3c5));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xf854('0x20')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xf854('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xf854('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xf854('0x2')]},'forwardOffline':{'type':Sequelize[_0xf854('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xf854('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xf854('0x21')},'waitingMessage':{'type':Sequelize[_0xf854('0x2')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0xf854('0x2')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xf854('0x2')],'defaultValue':_0xf854('0x22')},'enableUnmanagedNote':{'type':Sequelize[_0xf854('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xf854('0x2')],'defaultValue':_0xf854('0x14')},'sendUnmanaged':{'type':Sequelize[_0xf854('0x2')],'defaultValue':_0xf854('0x13')},'enableCustomerAttachment':{'type':Sequelize[_0xf854('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xf854('0xf')]},'showAgentAvatar':{'type':Sequelize[_0xf854('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xf854('0x2')]},'notificationTemplate':{'type':Sequelize[_0xf854('0xf')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xf854('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf854('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xf854('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xf854('0x2')],'defaultValue':_0xf854('0x23')},'verticalAlignment':{'type':Sequelize[_0xf854('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xf854('0x2')],'defaultValue':_0xf854('0x24')},'messagesAlignment':{'type':Sequelize[_0xf854('0x2')],'defaultValue':_0xf854('0x25')},'defaultTitle':{'type':Sequelize[_0xf854('0x2')]},'customerAvatar':{'type':Sequelize[_0xf854('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0xf854('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xf854('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xf854('0x2')],'allowNull':![],'defaultValue':_0xf854('0x26'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xf854('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf854('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf854('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf854('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xf854('0x2')],'defaultValue':_0xf854('0x27')},'systemAvatar':{'type':Sequelize[_0xf854('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xf854('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0xb520a2){if(!_0xb520a2)this[_0xf854('0x1b')](_0xf854('0x28'),null);this[_0xf854('0x1b')](_0xf854('0x29'),_0xb520a2);}},'vidaooEscalation':{'type':Sequelize[_0xf854('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xf854('0x2')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0xf854('0x2')],'defaultValue':function(){return _0xf854('0x2a');}},'vidaooMetadata':{'type':Sequelize[_0xf854('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xf854('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index ed6151e..aa198aa 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 _0xd9cc=['getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','difference','updatedAt','CompanyId','ListId','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','account','list','applications','orderBy','asc','contact','customerIp','x-forwarded-for','first','firstName','lastName','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','update','created','autoclose','push','close','unmanaged','*,*,*,*','UserId','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','no\x20available\x20attributes','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','defaults','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','ChatOfflineMessage','originalname','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','mimetype','subjectOffline','toPairsIn','mapValues','offlineMessageSubject','MailAccountId','NotifyMailAccount','notifyMail','remove','addInteraction','omit','getInteractions','User','Owner','internal','Tags','color','tag','Command','iftime\x20%s,%s','timezone','iftime\x20%s','interval','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','inspect','getSnippet','Interval','Intervals','getProactiveActions','virtual','chatLicenseExceeded','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','replace','alignment','verticalAlignment','labelText','textColor','color_button','backgroundColor','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','priority','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','items','fromKey','getOfflineMessages','Attachments','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','mustache','util','path','ejs','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','./chatWebsite.socket','register','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','get','ChatWebsites','UserProfileResource','destroy','stack','name','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','show','params','length','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','describe','addDisposition','Disposition','getDispositions','findOne','ChatWebsiteId','findAll','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addLogo','file','filename','addAvatar','agentAvatar','addCustomerAvatar','systemAvatar','root','sitepic','../../config/license/util','custom','existsSync','join','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','isNil','server/files/images/avatars/'];(function(_0xfc0976,_0x33776f){var _0x23579f=function(_0x4143d9){while(--_0x4143d9){_0xfc0976['push'](_0xfc0976['shift']());}};_0x23579f(++_0x33776f);}(_0xd9cc,0xb4));var _0xcd9c=function(_0x112a0a,_0x3fc551){_0x112a0a=_0x112a0a-0x0;var _0x54b93f=_0xd9cc[_0x112a0a];return _0x54b93f;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0xcd9c('0x0'));var util=require(_0xcd9c('0x1'));var path=require(_0xcd9c('0x2'));var ejs=require(_0xcd9c('0x3'));var fs=require('fs');var fs_extra=require(_0xcd9c('0x4'));var _=require(_0xcd9c('0x5'));var querystring=require(_0xcd9c('0x6'));var Redis=require(_0xcd9c('0x7'));var qs=require(_0xcd9c('0x8'));var logger=require(_0xcd9c('0x9'))(_0xcd9c('0xa'));var config=require(_0xcd9c('0xb'));var db=require(_0xcd9c('0xc'))['db'];config[_0xcd9c('0xd')]=_['defaults'](config[_0xcd9c('0xd')],{'host':_0xcd9c('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xcd9c('0xf'))[_0xcd9c('0x10')](socket);var jayson=require(_0xcd9c('0x11'));var client=jayson[_0xcd9c('0x12')][_0xcd9c('0x13')]({'port':0x232c});var client9002=jayson['client'][_0xcd9c('0x13')]({'port':0x232a});var client9003=jayson[_0xcd9c('0x12')][_0xcd9c('0x13')]({'port':0x232b});var client9001=jayson[_0xcd9c('0x12')][_0xcd9c('0x13')]({'port':0x2329});function respondWithRpcPromise(_0x25068d,_0x43d41e,_0x3975cc,_0x37f330){return new BPromise(function(_0x2d0364,_0x4b0466){var _0xc694da=_0x37f330||client;return _0xc694da[_0xcd9c('0x14')](_0x25068d,_0x3975cc)[_0xcd9c('0x15')](function(_0x576494){logger[_0xcd9c('0x16')](_0xcd9c('0x17'),_0x43d41e,_0xcd9c('0x18'));logger[_0xcd9c('0x19')](_0xcd9c('0x1a'),_0x43d41e,_0xcd9c('0x18'),JSON['stringify'](_0x576494));if(_0x576494[_0xcd9c('0x1b')]){if(_0x576494[_0xcd9c('0x1b')][_0xcd9c('0x1c')]===0x1f4){logger[_0xcd9c('0x1b')](_0xcd9c('0x17'),_0x43d41e,_0x576494[_0xcd9c('0x1b')][_0xcd9c('0x1d')]);return _0x4b0466(_0x576494[_0xcd9c('0x1b')][_0xcd9c('0x1d')]);}logger[_0xcd9c('0x1b')](_0xcd9c('0x17'),_0x43d41e,_0x576494[_0xcd9c('0x1b')][_0xcd9c('0x1d')]);return _0x2d0364(_0x576494[_0xcd9c('0x1b')][_0xcd9c('0x1d')]);}else{logger[_0xcd9c('0x16')](_0xcd9c('0x17'),_0x43d41e,_0xcd9c('0x18'));_0x2d0364(_0x576494['result'][_0xcd9c('0x1d')]);}})[_0xcd9c('0x1e')](function(_0x3d3e68){logger[_0xcd9c('0x1b')](_0xcd9c('0x17'),_0x43d41e,_0x3d3e68);_0x4b0466(_0x3d3e68);});});}function respondWithStatusCode(_0x114d05,_0x2e2dc5){_0x2e2dc5=_0x2e2dc5||0xcc;return function(_0xa6522d){if(_0xa6522d){return _0x114d05[_0xcd9c('0x1f')](_0x2e2dc5);}return _0x114d05[_0xcd9c('0x20')](_0x2e2dc5)[_0xcd9c('0x21')]();};}function respondWithResult(_0x5122d5,_0x13b9ac){_0x13b9ac=_0x13b9ac||0xc8;return function(_0x1f6e06){if(_0x1f6e06){return _0x5122d5[_0xcd9c('0x20')](_0x13b9ac)[_0xcd9c('0x22')](_0x1f6e06);}};}function respondWithFilteredResult(_0x27849f,_0x31c8fc){return function(_0x1d5e0a){if(_0x1d5e0a){var _0x19b4d2=typeof _0x31c8fc[_0xcd9c('0x23')]===_0xcd9c('0x24')&&typeof _0x31c8fc[_0xcd9c('0x25')]==='undefined';var _0x2f54b3=_0x1d5e0a[_0xcd9c('0x26')];var _0x4a597a=_0x19b4d2?0x0:_0x31c8fc[_0xcd9c('0x23')];var _0x11a3e8=_0x19b4d2?_0x1d5e0a[_0xcd9c('0x26')]:_0x31c8fc[_0xcd9c('0x23')]+_0x31c8fc[_0xcd9c('0x25')];var _0x14aed7;if(_0x11a3e8>=_0x2f54b3){_0x11a3e8=_0x2f54b3;_0x14aed7=0xc8;}else{_0x14aed7=0xce;}_0x27849f[_0xcd9c('0x20')](_0x14aed7);return _0x27849f[_0xcd9c('0x27')](_0xcd9c('0x28'),_0x4a597a+'-'+_0x11a3e8+'/'+_0x2f54b3)[_0xcd9c('0x22')](_0x1d5e0a);}return null;};}function saveUpdates(_0x97bdb3){return function(_0x5f02aa){if(_0x5f02aa){return _0x5f02aa['update'](_0x97bdb3)['then'](function(_0x2a0681){return _0x2a0681;});}return null;};}function removeEntity(_0x304dc9){return function(_0x3e84f9){if(_0x3e84f9){return _0x3e84f9['destroy']()['then'](function(){var _0x322afe=_0x3e84f9[_0xcd9c('0x29')]({'plain':!![]});var _0x5b27e0=_0xcd9c('0x2a');return db[_0xcd9c('0x2b')][_0xcd9c('0x2c')]({'where':{'type':_0x5b27e0,'resourceId':_0x322afe['id']}})[_0xcd9c('0x15')](function(){return _0x3e84f9;});})[_0xcd9c('0x15')](function(){_0x304dc9[_0xcd9c('0x20')](0xcc)[_0xcd9c('0x21')]();});}};}function handleEntityNotFound(_0x139e0a){return function(_0x5817b2){if(!_0x5817b2){_0x139e0a[_0xcd9c('0x1f')](0x194);}return _0x5817b2;};}function handleError(_0x30e214,_0x239dc4){_0x239dc4=_0x239dc4||0x1f4;return function(_0x580442){logger['error'](_0x580442[_0xcd9c('0x2d')]);if(_0x580442[_0xcd9c('0x2e')]){delete _0x580442[_0xcd9c('0x2e')];}_0x30e214[_0xcd9c('0x20')](_0x239dc4)['send'](_0x580442);};}exports[_0xcd9c('0x2f')]=function(_0x5d42d8,_0x1cf9f6){var _0x1b1ccf={'include':[{'model':db[_0xcd9c('0x30')],'as':_0xcd9c('0x31')}]},_0x2b4c02={},_0x1fb78d={'count':0x0,'rows':[]};var _0x2f486e=_[_0xcd9c('0x32')](db[_0xcd9c('0x33')][_0xcd9c('0x34')],function(_0x21cd5f){return{'name':_0x21cd5f[_0xcd9c('0x35')],'type':_0x21cd5f['type']['key']};});_0x2b4c02[_0xcd9c('0x36')]=_['map'](_0x2f486e,_0xcd9c('0x2e'));_0x2b4c02['query']=_[_0xcd9c('0x37')](_0x5d42d8[_0xcd9c('0x38')]);_0x2b4c02['filters']=_[_0xcd9c('0x39')](_0x2b4c02[_0xcd9c('0x36')],_0x2b4c02[_0xcd9c('0x38')]);_0x1b1ccf[_0xcd9c('0x3a')]=_[_0xcd9c('0x39')](_0x2b4c02['model'],qs[_0xcd9c('0x3b')](_0x5d42d8[_0xcd9c('0x38')]['fields']));_0x1b1ccf[_0xcd9c('0x3a')]=_0x1b1ccf[_0xcd9c('0x3a')]['length']?_0x1b1ccf[_0xcd9c('0x3a')]:_0x2b4c02[_0xcd9c('0x36')];if(!_0x5d42d8['query'][_0xcd9c('0x3c')](_0xcd9c('0x3d'))){_0x1b1ccf[_0xcd9c('0x25')]=qs['limit'](_0x5d42d8[_0xcd9c('0x38')][_0xcd9c('0x25')]);_0x1b1ccf[_0xcd9c('0x23')]=qs[_0xcd9c('0x23')](_0x5d42d8[_0xcd9c('0x38')][_0xcd9c('0x23')]);}_0x1b1ccf[_0xcd9c('0x3e')]=qs[_0xcd9c('0x3f')](_0x5d42d8[_0xcd9c('0x38')][_0xcd9c('0x3f')]);_0x1b1ccf[_0xcd9c('0x40')]=qs[_0xcd9c('0x41')](_[_0xcd9c('0x42')](_0x5d42d8[_0xcd9c('0x38')],_0x2b4c02[_0xcd9c('0x41')]),_0x2f486e);if(_0x5d42d8[_0xcd9c('0x38')][_0xcd9c('0x43')]){_0x1b1ccf['where']=_[_0xcd9c('0x44')](_0x1b1ccf['where'],{'$or':_[_0xcd9c('0x32')](_0x2f486e,function(_0x2ff86c){if(_0x2ff86c[_0xcd9c('0x45')]!==_0xcd9c('0x46')){var _0x29ccb2={};_0x29ccb2[_0x2ff86c[_0xcd9c('0x2e')]]={'$like':'%'+_0x5d42d8[_0xcd9c('0x38')][_0xcd9c('0x43')]+'%'};return _0x29ccb2;}})});}_0x1b1ccf=_[_0xcd9c('0x44')]({},_0x1b1ccf,_0x5d42d8[_0xcd9c('0x47')]);var _0x20bde7={'where':_0x1b1ccf[_0xcd9c('0x40')]};return db[_0xcd9c('0x33')]['count'](_0x20bde7)[_0xcd9c('0x15')](function(_0x527bed){_0x1fb78d['count']=_0x527bed;if(_0x5d42d8[_0xcd9c('0x38')][_0xcd9c('0x48')]){_0x1b1ccf[_0xcd9c('0x49')]=[{'all':!![]}];}return db[_0xcd9c('0x33')]['findAll'](_0x1b1ccf);})['then'](function(_0x786dc5){_0x1fb78d[_0xcd9c('0x4a')]=_0x786dc5;return _0x1fb78d;})['then'](respondWithFilteredResult(_0x1cf9f6,_0x1b1ccf))[_0xcd9c('0x1e')](handleError(_0x1cf9f6,null));};exports[_0xcd9c('0x4b')]=function(_0x7ad590,_0x83352){var _0x585aad={'raw':![],'where':{'id':_0x7ad590[_0xcd9c('0x4c')]['id']},'include':[{'model':db['Pause'],'as':_0xcd9c('0x31')}]},_0x908b3b={};_0x908b3b[_0xcd9c('0x36')]=_['keys'](db[_0xcd9c('0x33')][_0xcd9c('0x34')]);_0x908b3b[_0xcd9c('0x38')]=_[_0xcd9c('0x37')](_0x7ad590['query']);_0x908b3b['filters']=_[_0xcd9c('0x39')](_0x908b3b[_0xcd9c('0x36')],_0x908b3b[_0xcd9c('0x38')]);_0x585aad['attributes']=_[_0xcd9c('0x39')](_0x908b3b[_0xcd9c('0x36')],qs[_0xcd9c('0x3b')](_0x7ad590[_0xcd9c('0x38')][_0xcd9c('0x3b')]));_0x585aad[_0xcd9c('0x3a')]=_0x585aad[_0xcd9c('0x3a')][_0xcd9c('0x4d')]?_0x585aad[_0xcd9c('0x3a')]:_0x908b3b[_0xcd9c('0x36')];if(_0x7ad590['query'][_0xcd9c('0x48')]){_0x585aad[_0xcd9c('0x49')]=[{'all':!![]}];}_0x585aad=_[_0xcd9c('0x44')]({},_0x585aad,_0x7ad590[_0xcd9c('0x47')]);return db[_0xcd9c('0x33')]['find'](_0x585aad)[_0xcd9c('0x15')](handleEntityNotFound(_0x83352,null))[_0xcd9c('0x15')](respondWithResult(_0x83352,null))[_0xcd9c('0x1e')](handleError(_0x83352,null));};exports['create']=function(_0x5e854f,_0x174f07){return db['ChatWebsite'][_0xcd9c('0x4e')](_0x5e854f['body'],{})[_0xcd9c('0x15')](function(_0x19b5a6){var _0x33c6cf=_0x5e854f[_0xcd9c('0x4f')][_0xcd9c('0x29')]({'plain':!![]});if(!_0x33c6cf)throw new Error(_0xcd9c('0x50'));if(_0x33c6cf[_0xcd9c('0x51')]==='user'){var _0x2227b5=_0x19b5a6[_0xcd9c('0x29')]({'plain':!![]});var _0x3a198d=_0xcd9c('0x2a');return db[_0xcd9c('0x52')]['find']({'where':{'name':_0x3a198d,'userProfileId':_0x33c6cf[_0xcd9c('0x53')]},'raw':!![]})[_0xcd9c('0x15')](function(_0x4b65c8){if(_0x4b65c8&&_0x4b65c8['autoAssociation']===0x0){return db[_0xcd9c('0x2b')][_0xcd9c('0x4e')]({'name':_0x2227b5[_0xcd9c('0x2e')],'resourceId':_0x2227b5['id'],'type':_0x4b65c8['name'],'sectionId':_0x4b65c8['id']},{})[_0xcd9c('0x15')](function(){return _0x19b5a6;});}else{return _0x19b5a6;}})[_0xcd9c('0x1e')](function(_0x3ad0f2){logger[_0xcd9c('0x1b')](_0xcd9c('0x54'),_0x3ad0f2);throw _0x3ad0f2;});}return _0x19b5a6;})[_0xcd9c('0x15')](respondWithResult(_0x174f07,0xc9))[_0xcd9c('0x1e')](handleError(_0x174f07,null));};exports['update']=function(_0x3f2a77,_0x24df20){if(_0x3f2a77[_0xcd9c('0x55')]['id']){delete _0x3f2a77['body']['id'];}return db[_0xcd9c('0x33')][_0xcd9c('0x56')]({'where':{'id':_0x3f2a77[_0xcd9c('0x4c')]['id']},'include':[{'model':db[_0xcd9c('0x30')],'as':'mandatoryDispositionPause'}]})[_0xcd9c('0x15')](handleEntityNotFound(_0x24df20,null))['then'](saveUpdates(_0x3f2a77[_0xcd9c('0x55')],null))[_0xcd9c('0x15')](respondWithResult(_0x24df20,null))[_0xcd9c('0x1e')](handleError(_0x24df20,null));};exports[_0xcd9c('0x2c')]=function(_0xb46d32,_0x62a914){return db[_0xcd9c('0x33')][_0xcd9c('0x56')]({'where':{'id':_0xb46d32['params']['id']}})['then'](handleEntityNotFound(_0x62a914,null))['then'](removeEntity(_0x62a914,null))['catch'](handleError(_0x62a914,null));};exports['describe']=function(_0x2b42c6,_0x5b4bd3){return db[_0xcd9c('0x33')][_0xcd9c('0x57')]()[_0xcd9c('0x15')](respondWithResult(_0x5b4bd3,null))[_0xcd9c('0x1e')](handleError(_0x5b4bd3,null));};exports[_0xcd9c('0x58')]=function(_0x11103d,_0x1fdd5a){if(_0x11103d[_0xcd9c('0x55')]['id']){delete _0x11103d[_0xcd9c('0x55')]['id'];}return db[_0xcd9c('0x33')][_0xcd9c('0x56')]({'where':{'id':_0x11103d[_0xcd9c('0x4c')]['id']}})[_0xcd9c('0x15')](handleEntityNotFound(_0x1fdd5a,null))[_0xcd9c('0x15')](function(_0x2e0f77){if(_0x2e0f77){_0x11103d[_0xcd9c('0x55')]['ChatWebsiteId']=_0x2e0f77['id'];return db[_0xcd9c('0x59')]['create'](_0x11103d[_0xcd9c('0x55')]);}})[_0xcd9c('0x15')](respondWithResult(_0x1fdd5a,null))[_0xcd9c('0x1e')](handleError(_0x1fdd5a,null));};exports[_0xcd9c('0x5a')]=function(_0x3a16fc,_0x1308b4){var _0x2fd7a6={'raw':![],'where':{}};var _0x13df84={};var _0x47e4dc={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xcd9c('0x5b')]({'where':{'id':_0x3a16fc[_0xcd9c('0x4c')]['id']}})[_0xcd9c('0x15')](handleEntityNotFound(_0x1308b4,null))['then'](function(_0x4610bc){if(_0x4610bc){_0x13df84[_0xcd9c('0x36')]=_[_0xcd9c('0x37')](db[_0xcd9c('0x59')]['rawAttributes']);_0x13df84[_0xcd9c('0x38')]=_[_0xcd9c('0x37')](_0x3a16fc[_0xcd9c('0x38')]);_0x13df84[_0xcd9c('0x41')]=_['intersection'](_0x13df84[_0xcd9c('0x36')],_0x13df84[_0xcd9c('0x38')]);_0x2fd7a6[_0xcd9c('0x3a')]=_[_0xcd9c('0x39')](_0x13df84[_0xcd9c('0x36')],qs[_0xcd9c('0x3b')](_0x3a16fc[_0xcd9c('0x38')][_0xcd9c('0x3b')]));_0x2fd7a6[_0xcd9c('0x3a')]=_0x2fd7a6[_0xcd9c('0x3a')]['length']?_0x2fd7a6[_0xcd9c('0x3a')]:_0x13df84[_0xcd9c('0x36')];if(!_0x3a16fc[_0xcd9c('0x38')][_0xcd9c('0x3c')](_0xcd9c('0x3d'))){_0x2fd7a6[_0xcd9c('0x25')]=qs[_0xcd9c('0x25')](_0x3a16fc[_0xcd9c('0x38')]['limit']);_0x2fd7a6[_0xcd9c('0x23')]=qs[_0xcd9c('0x23')](_0x3a16fc[_0xcd9c('0x38')][_0xcd9c('0x23')]);}_0x2fd7a6['order']=qs[_0xcd9c('0x3f')](_0x3a16fc[_0xcd9c('0x38')][_0xcd9c('0x3f')]);_0x2fd7a6[_0xcd9c('0x40')]=qs[_0xcd9c('0x41')](_['pick'](_0x3a16fc[_0xcd9c('0x38')],_0x13df84[_0xcd9c('0x41')]));_0x2fd7a6[_0xcd9c('0x40')][_0xcd9c('0x5c')]=_0x4610bc['id'];if(_0x3a16fc['query'][_0xcd9c('0x43')]){_0x2fd7a6[_0xcd9c('0x40')]=_['merge'](_0x2fd7a6[_0xcd9c('0x40')],{'$or':_[_0xcd9c('0x32')](_0x2fd7a6['attributes'],function(_0x5c85b5){var _0x59bb5a={};_0x59bb5a[_0x5c85b5]={'$like':'%'+_0x3a16fc[_0xcd9c('0x38')]['filter']+'%'};return _0x59bb5a;})});}_0x2fd7a6=_[_0xcd9c('0x44')]({},_0x2fd7a6,_0x3a16fc[_0xcd9c('0x47')]);return db[_0xcd9c('0x59')][_0xcd9c('0x26')]({'where':_0x2fd7a6[_0xcd9c('0x40')]})['then'](function(_0x50ae42){_0x47e4dc[_0xcd9c('0x26')]=_0x50ae42;if(_0x3a16fc[_0xcd9c('0x38')]['includeAll']){_0x2fd7a6[_0xcd9c('0x49')]=[{'all':!![]}];}return db['Disposition'][_0xcd9c('0x5d')](_0x2fd7a6);})[_0xcd9c('0x15')](function(_0x2dd973){_0x47e4dc[_0xcd9c('0x4a')]=_0x2dd973;return _0x47e4dc;});}})[_0xcd9c('0x15')](respondWithFilteredResult(_0x1308b4,_0x2fd7a6))['catch'](handleError(_0x1308b4,null));};exports['removeDispositions']=function(_0x3e99b1,_0x39ff89){return db[_0xcd9c('0x33')][_0xcd9c('0x56')]({'where':{'id':_0x3e99b1[_0xcd9c('0x4c')]['id']}})[_0xcd9c('0x15')](handleEntityNotFound(_0x39ff89,null))[_0xcd9c('0x15')](function(_0x4babbb){if(_0x4babbb){return _0x4babbb[_0xcd9c('0x5e')](_0x3e99b1[_0xcd9c('0x38')][_0xcd9c('0x5f')]);}})[_0xcd9c('0x15')](respondWithStatusCode(_0x39ff89,null))[_0xcd9c('0x1e')](handleError(_0x39ff89,null));};exports[_0xcd9c('0x60')]=function(_0x26028b,_0x12b632){if(_0x26028b['body']['id']){delete _0x26028b['body']['id'];}return db[_0xcd9c('0x33')][_0xcd9c('0x56')]({'where':{'id':_0x26028b[_0xcd9c('0x4c')]['id']}})[_0xcd9c('0x15')](handleEntityNotFound(_0x12b632,null))['then'](function(_0x525a45){if(_0x525a45){_0x26028b['body'][_0xcd9c('0x5c')]=_0x525a45['id'];return db[_0xcd9c('0x61')][_0xcd9c('0x4e')](_0x26028b[_0xcd9c('0x55')]);}})[_0xcd9c('0x15')](respondWithResult(_0x12b632,null))[_0xcd9c('0x1e')](handleError(_0x12b632,null));};exports['getAnswers']=function(_0x59c642,_0x4f44ad){var _0x436eef={'raw':![],'where':{}};var _0x27a6b1={};var _0x2dc01c={'count':0x0,'rows':[]};return db[_0xcd9c('0x33')][_0xcd9c('0x5b')]({'where':{'id':_0x59c642[_0xcd9c('0x4c')]['id']}})[_0xcd9c('0x15')](handleEntityNotFound(_0x4f44ad,null))[_0xcd9c('0x15')](function(_0x2f51a4){if(_0x2f51a4){_0x27a6b1[_0xcd9c('0x36')]=_[_0xcd9c('0x37')](db[_0xcd9c('0x61')][_0xcd9c('0x34')]);_0x27a6b1[_0xcd9c('0x38')]=_['keys'](_0x59c642['query']);_0x27a6b1[_0xcd9c('0x41')]=_['intersection'](_0x27a6b1['model'],_0x27a6b1[_0xcd9c('0x38')]);_0x436eef[_0xcd9c('0x3a')]=_[_0xcd9c('0x39')](_0x27a6b1[_0xcd9c('0x36')],qs[_0xcd9c('0x3b')](_0x59c642[_0xcd9c('0x38')][_0xcd9c('0x3b')]));_0x436eef[_0xcd9c('0x3a')]=_0x436eef[_0xcd9c('0x3a')][_0xcd9c('0x4d')]?_0x436eef[_0xcd9c('0x3a')]:_0x27a6b1[_0xcd9c('0x36')];if(!_0x59c642[_0xcd9c('0x38')][_0xcd9c('0x3c')](_0xcd9c('0x3d'))){_0x436eef[_0xcd9c('0x25')]=qs[_0xcd9c('0x25')](_0x59c642[_0xcd9c('0x38')][_0xcd9c('0x25')]);_0x436eef[_0xcd9c('0x23')]=qs[_0xcd9c('0x23')](_0x59c642[_0xcd9c('0x38')][_0xcd9c('0x23')]);}_0x436eef[_0xcd9c('0x3e')]=qs[_0xcd9c('0x3f')](_0x59c642['query'][_0xcd9c('0x3f')]);_0x436eef[_0xcd9c('0x40')]=qs[_0xcd9c('0x41')](_[_0xcd9c('0x42')](_0x59c642[_0xcd9c('0x38')],_0x27a6b1[_0xcd9c('0x41')]));_0x436eef[_0xcd9c('0x40')]['ChatWebsiteId']=_0x2f51a4['id'];if(_0x59c642[_0xcd9c('0x38')][_0xcd9c('0x43')]){_0x436eef[_0xcd9c('0x40')]=_[_0xcd9c('0x44')](_0x436eef['where'],{'$or':_['map'](_0x436eef[_0xcd9c('0x3a')],function(_0x2f49cf){var _0x5d04b2={};_0x5d04b2[_0x2f49cf]={'$like':'%'+_0x59c642[_0xcd9c('0x38')][_0xcd9c('0x43')]+'%'};return _0x5d04b2;})});}_0x436eef=_[_0xcd9c('0x44')]({},_0x436eef,_0x59c642[_0xcd9c('0x47')]);return db[_0xcd9c('0x61')][_0xcd9c('0x26')]({'where':_0x436eef[_0xcd9c('0x40')]})[_0xcd9c('0x15')](function(_0x447b82){_0x2dc01c[_0xcd9c('0x26')]=_0x447b82;if(_0x59c642[_0xcd9c('0x38')][_0xcd9c('0x48')]){_0x436eef[_0xcd9c('0x49')]=[{'all':!![]}];}return db[_0xcd9c('0x61')][_0xcd9c('0x5d')](_0x436eef);})[_0xcd9c('0x15')](function(_0x2031ff){_0x2dc01c['rows']=_0x2031ff;return _0x2dc01c;});}})['then'](respondWithFilteredResult(_0x4f44ad,_0x436eef))['catch'](handleError(_0x4f44ad,null));};exports[_0xcd9c('0x62')]=function(_0x1c8802,_0x4acefc){return db[_0xcd9c('0x33')][_0xcd9c('0x56')]({'where':{'id':_0x1c8802[_0xcd9c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4acefc,null))['then'](function(_0x51e038){if(_0x51e038){return _0x51e038[_0xcd9c('0x62')](_0x1c8802[_0xcd9c('0x38')]['ids']);}})['then'](respondWithStatusCode(_0x4acefc,null))['catch'](handleError(_0x4acefc,null));};exports[_0xcd9c('0x63')]=function(_0x2852d6,_0x25bf3c){_0x2852d6[_0xcd9c('0x55')]['sitepic']=_0x2852d6[_0xcd9c('0x64')][_0xcd9c('0x65')];return db['ChatWebsite']['find']({'where':{'id':_0x2852d6[_0xcd9c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x25bf3c,null))['then'](saveUpdates(_0x2852d6[_0xcd9c('0x55')],null))[_0xcd9c('0x15')](respondWithResult(_0x25bf3c,null))[_0xcd9c('0x1e')](handleError(_0x25bf3c,null));};exports[_0xcd9c('0x66')]=function(_0x403c73,_0x152283){_0x403c73['body'][_0xcd9c('0x67')]=_0x403c73[_0xcd9c('0x64')]['filename'];return db[_0xcd9c('0x33')][_0xcd9c('0x56')]({'where':{'id':_0x403c73['params']['id']}})[_0xcd9c('0x15')](handleEntityNotFound(_0x152283,null))[_0xcd9c('0x15')](saveUpdates(_0x403c73[_0xcd9c('0x55')],null))['then'](respondWithResult(_0x152283,null))[_0xcd9c('0x1e')](handleError(_0x152283,null));};exports[_0xcd9c('0x68')]=function(_0x21388d,_0x5df1ff){_0x21388d[_0xcd9c('0x55')]['customerAvatar']=_0x21388d[_0xcd9c('0x64')][_0xcd9c('0x65')];return db[_0xcd9c('0x33')][_0xcd9c('0x56')]({'where':{'id':_0x21388d['params']['id']}})[_0xcd9c('0x15')](handleEntityNotFound(_0x5df1ff,null))['then'](saveUpdates(_0x21388d[_0xcd9c('0x55')],null))[_0xcd9c('0x15')](respondWithResult(_0x5df1ff,null))[_0xcd9c('0x1e')](handleError(_0x5df1ff,null));};exports['addSystemAvatar']=function(_0x2f47d5,_0x3279a3){_0x2f47d5[_0xcd9c('0x55')][_0xcd9c('0x69')]=_0x2f47d5[_0xcd9c('0x64')]['filename'];return db['ChatWebsite']['find']({'where':{'id':_0x2f47d5[_0xcd9c('0x4c')]['id']}})[_0xcd9c('0x15')](handleEntityNotFound(_0x3279a3,null))[_0xcd9c('0x15')](saveUpdates(_0x2f47d5['body'],null))[_0xcd9c('0x15')](respondWithResult(_0x3279a3,null))['catch'](handleError(_0x3279a3,null));};exports['getLogo']=function(_0xa9137f,_0x1b0c52){var _0x52da76=path['join'](config[_0xcd9c('0x6a')],'server/files/images/logos/default_logo.svg');var _0x44e1df={'where':{'id':_0xa9137f[_0xcd9c('0x4c')]['id']},'attributes':['id',_0xcd9c('0x6b')],'raw':!![]};var _0x5cf774=![];return require(_0xcd9c('0x6c'))['getLicense']()[_0xcd9c('0x15')](function(_0x2eb0aa){if(_0x2eb0aa){_0x5cf774=_0x2eb0aa[_0xcd9c('0x6d')];}})['then'](function(){return db['ChatWebsite'][_0xcd9c('0x56')](_0x44e1df);})[_0xcd9c('0x15')](handleEntityNotFound(_0x1b0c52,null))['then'](function(_0x4bb72b){if(_0x4bb72b){if(!_['isNil'](_0x4bb72b[_0xcd9c('0x6b')])){if(fs[_0xcd9c('0x6e')](path[_0xcd9c('0x6f')](config[_0xcd9c('0x6a')],_0xcd9c('0x70'),_0x4bb72b['sitepic']))&&_0x5cf774){_0x52da76=path[_0xcd9c('0x6f')](config[_0xcd9c('0x6a')],_0xcd9c('0x70'),_0x4bb72b[_0xcd9c('0x6b')]);}}return _0x1b0c52[_0xcd9c('0x71')](_0x52da76);}})[_0xcd9c('0x1e')](handleError(_0x1b0c52,null));};exports[_0xcd9c('0x72')]=function(_0x259c56,_0x1cb905){var _0x30064e=path['join'](config[_0xcd9c('0x6a')],_0xcd9c('0x73'));var _0x76801b={'where':{'id':_0x259c56[_0xcd9c('0x4c')]['id']},'attributes':['id',_0xcd9c('0x67')],'raw':!![]};return db[_0xcd9c('0x33')][_0xcd9c('0x56')](_0x76801b)[_0xcd9c('0x15')](handleEntityNotFound(_0x1cb905,null))[_0xcd9c('0x15')](function(_0x24e307){if(_0x24e307){if(!_[_0xcd9c('0x74')](_0x24e307['agentAvatar'])){if(fs[_0xcd9c('0x6e')](path[_0xcd9c('0x6f')](config['root'],_0xcd9c('0x75'),_0x24e307[_0xcd9c('0x67')]))){_0x30064e=path[_0xcd9c('0x6f')](config[_0xcd9c('0x6a')],_0xcd9c('0x75'),_0x24e307['agentAvatar']);}}return _0x1cb905[_0xcd9c('0x71')](_0x30064e);}})[_0xcd9c('0x1e')](handleError(_0x1cb905,null));};exports[_0xcd9c('0x76')]=function(_0x36a7e3,_0x3e6659){var _0x3ddc46=path[_0xcd9c('0x6f')](config[_0xcd9c('0x6a')],_0xcd9c('0x77'));var _0x115ee0={'where':{'id':_0x36a7e3[_0xcd9c('0x4c')]['id']},'attributes':['id',_0xcd9c('0x78'),_0xcd9c('0x79')],'raw':!![]};return db['ChatWebsite'][_0xcd9c('0x56')](_0x115ee0)[_0xcd9c('0x15')](handleEntityNotFound(_0x3e6659,null))[_0xcd9c('0x15')](function(_0x18aabf){if(_0x18aabf){if(!_[_0xcd9c('0x74')](_0x18aabf[_0xcd9c('0x78')])){if(fs[_0xcd9c('0x6e')](path[_0xcd9c('0x6f')](config['root'],_0xcd9c('0x75'),_0x18aabf[_0xcd9c('0x78')]))&&_0x18aabf[_0xcd9c('0x79')]){_0x3ddc46=path[_0xcd9c('0x6f')](config['root'],_0xcd9c('0x75'),_0x18aabf['customerAvatar']);}}return _0x3e6659[_0xcd9c('0x71')](_0x3ddc46);}})['catch'](handleError(_0x3e6659,null));};exports[_0xcd9c('0x7a')]=function(_0x126cd5,_0x53b44c){var _0x22bf31=path['join'](config[_0xcd9c('0x6a')],_0xcd9c('0x7b'));var _0x463f9e={'where':{'id':_0x126cd5[_0xcd9c('0x4c')]['id']},'attributes':['id',_0xcd9c('0x69')],'raw':!![]};return db[_0xcd9c('0x33')][_0xcd9c('0x56')](_0x463f9e)[_0xcd9c('0x15')](handleEntityNotFound(_0x53b44c,null))[_0xcd9c('0x15')](function(_0x350b0d){if(_0x350b0d){if(!_[_0xcd9c('0x74')](_0x350b0d[_0xcd9c('0x69')])){if(fs[_0xcd9c('0x6e')](path[_0xcd9c('0x6f')](config[_0xcd9c('0x6a')],_0xcd9c('0x75'),_0x350b0d['systemAvatar']))){_0x22bf31=path[_0xcd9c('0x6f')](config['root'],_0xcd9c('0x75'),_0x350b0d[_0xcd9c('0x69')]);}}return _0x53b44c[_0xcd9c('0x71')](_0x22bf31);}})[_0xcd9c('0x1e')](handleError(_0x53b44c,null));};exports[_0xcd9c('0x7c')]=function(_0x4a5eab,_0x46b140){var _0x5c3b65=require('user-agent-parser');var _0x490acf=new _0x5c3b65();var _0x3d5f46=_0x490acf['setUA'](_0x4a5eab[_0xcd9c('0x7d')][_0xcd9c('0x7e')])[_0xcd9c('0x7f')]();var _0x3a12f7={'body':_0x4a5eab[_0xcd9c('0x55')],'channel':_0xcd9c('0x80')};var _0x1c958c=[];var _0x196837=[];var _0x55dd0b={};var _0x11081a=![];return db[_0xcd9c('0x81')]['describe']()[_0xcd9c('0x15')](function(_0x301e44){if(!_0x301e44){throw new db[(_0xcd9c('0x82'))][(_0xcd9c('0x83'))]('no\x20available\x20attributes');}_0x1c958c=_[_0xcd9c('0x84')](_[_0xcd9c('0x37')](_0x301e44),['createdAt',_0xcd9c('0x85')]);_0x196837=_[_0xcd9c('0x84')](_['keys'](_0x301e44),['createdAt',_0xcd9c('0x85'),_0xcd9c('0x86'),_0xcd9c('0x87')]);if(_0x4a5eab[_0xcd9c('0x55')]['id']){delete _0x4a5eab[_0xcd9c('0x55')]['id'];}if(_[_0xcd9c('0x74')](_0x4a5eab[_0xcd9c('0x55')][_0xcd9c('0x88')])){throw new db[(_0xcd9c('0x82'))][(_0xcd9c('0x83'))]('from\x20is\x20mandatory');}if(_[_0xcd9c('0x74')](_0x4a5eab[_0xcd9c('0x55')][_0xcd9c('0x55')])||_0x4a5eab[_0xcd9c('0x55')][_0xcd9c('0x55')]===''){throw new db[(_0xcd9c('0x82'))][(_0xcd9c('0x83'))](_0xcd9c('0x89'));}if(_[_0xcd9c('0x74')](_0x4a5eab['body'][_0xcd9c('0x8a')])){throw new db['Sequelize']['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x196837);}if(!_[_0xcd9c('0x8b')](_0x196837,_0x4a5eab['body'][_0xcd9c('0x8a')])){throw new db['Sequelize'][(_0xcd9c('0x83'))](_0xcd9c('0x8c')+_0x196837);}_0x55dd0b[_0x4a5eab[_0xcd9c('0x55')][_0xcd9c('0x8a')]]=_0x4a5eab[_0xcd9c('0x55')][_0xcd9c('0x88')];})[_0xcd9c('0x15')](function(){return db[_0xcd9c('0x33')][_0xcd9c('0x56')]({'where':{'id':_0x4a5eab[_0xcd9c('0x4c')]['id']},'include':[{'model':db[_0xcd9c('0x8d')],'as':_0xcd9c('0x8e'),'include':[{'model':db[_0xcd9c('0x81')],'as':_0xcd9c('0x8f'),'where':_0x55dd0b,'limit':0x1,'order':[['updatedAt',_0xcd9c('0x90')]]}]},{'model':db[_0xcd9c('0x91')],'as':_0xcd9c('0x92')}]});})[_0xcd9c('0x15')](handleEntityNotFound(_0x46b140,null))[_0xcd9c('0x15')](function(_0x1958f4){if(_0x1958f4&&_0x1958f4[_0xcd9c('0x8e')]){_0x3a12f7[_0xcd9c('0x93')]=_0x1958f4;_0x3a12f7['applications']=_0x1958f4[_0xcd9c('0x92')];_0x3a12f7[_0xcd9c('0x94')]=_0x1958f4[_0xcd9c('0x8e')];_0x3a12f7[_0xcd9c('0x95')]=_[_0xcd9c('0x96')](_0x3a12f7['applications'],['priority'],[_0xcd9c('0x97')]);if(_0x3a12f7['account']['Applications']){delete _0x3a12f7[_0xcd9c('0x93')][_0xcd9c('0x92')];}if(_0x3a12f7[_0xcd9c('0x93')][_0xcd9c('0x8e')]&&_0x3a12f7[_0xcd9c('0x93')][_0xcd9c('0x8e')][_0xcd9c('0x8f')][_0xcd9c('0x4d')]){return _0x3a12f7[_0xcd9c('0x93')][_0xcd9c('0x8e')][_0xcd9c('0x8f')][0x0];}var _0x25cfcd=_['defaults'](_0x4a5eab[_0xcd9c('0x55')],{'firstName':_0x4a5eab[_0xcd9c('0x55')][_0xcd9c('0x88')],'ListId':_0x1958f4[_0xcd9c('0x87')]});_0x25cfcd[_0x4a5eab[_0xcd9c('0x55')]['mapKey']]=_0x4a5eab[_0xcd9c('0x55')]['from'];return db[_0xcd9c('0x81')][_0xcd9c('0x4e')](_0x25cfcd,{'fields':_0x1c958c,'raw':!![]});}})['then'](handleEntityNotFound(_0x46b140,null))[_0xcd9c('0x15')](function(_0x32548a){_0x3a12f7[_0xcd9c('0x98')]=_0x32548a;var _0x59723e=_0x4a5eab[_0xcd9c('0x55')][_0xcd9c('0x99')];if(_0x4a5eab[_0xcd9c('0x7d')]['cf-connecting-ip']){_0x59723e=_0x4a5eab[_0xcd9c('0x7d')]['cf-connecting-ip'];}else if(_0x4a5eab[_0xcd9c('0x7d')][_0xcd9c('0x9a')]){_0x59723e=_[_0xcd9c('0x9b')](_0x4a5eab[_0xcd9c('0x7d')][_0xcd9c('0x9a')]['split'](','));}if(_0x32548a){var _0x12aa50={'ContactId':_0x32548a['id'],'ChatWebsiteId':_0x4a5eab[_0xcd9c('0x4c')]['id'],'from':(_0x32548a[_0xcd9c('0x9c')]||'')+'\x20'+(_0x32548a[_0xcd9c('0x9d')]||''),'customerIp':_0x59723e,'customerPort':_0x4a5eab[_0xcd9c('0x7d')][_0xcd9c('0x9e')]?_0x4a5eab[_0xcd9c('0x7d')]['x-real-port']:null,'referer':_0x4a5eab[_0xcd9c('0x55')][_0xcd9c('0x9f')],'browserName':_0x3d5f46['browser'][_0xcd9c('0x2e')]&&_0x3d5f46[_0xcd9c('0xa0')][_0xcd9c('0xa1')]?util[_0xcd9c('0xa2')](_0xcd9c('0xa3'),_0x3d5f46[_0xcd9c('0xa0')][_0xcd9c('0x2e')],_0x3d5f46[_0xcd9c('0xa0')][_0xcd9c('0xa1')]):'unknown','browserVersion':_0x3d5f46[_0xcd9c('0xa0')][_0xcd9c('0xa1')]||_0xcd9c('0xa4'),'osName':util[_0xcd9c('0xa2')](_0xcd9c('0xa3'),_0x3d5f46['os'][_0xcd9c('0x2e')],_0x3d5f46['os'][_0xcd9c('0xa1')]),'osVersion':_0x3d5f46['os'][_0xcd9c('0xa1')],'deviceModel':_0x3d5f46[_0xcd9c('0xa5')]['model']&&_0x3d5f46['device'][_0xcd9c('0xa6')]?util[_0xcd9c('0xa2')](_0xcd9c('0xa7'),_0x3d5f46[_0xcd9c('0xa5')][_0xcd9c('0x36')],_0x3d5f46[_0xcd9c('0xa5')][_0xcd9c('0xa6')],_0x3d5f46[_0xcd9c('0xa5')][_0xcd9c('0x45')]):null,'deviceVendor':_0x3d5f46[_0xcd9c('0xa5')][_0xcd9c('0xa6')],'deviceType':_0x3d5f46[_0xcd9c('0xa5')][_0xcd9c('0x45')],'formData':JSON['stringify'](_0x4a5eab[_0xcd9c('0x55')])};var _0x217881={'ChatWebsiteId':_0x4a5eab[_0xcd9c('0x4c')]['id'],'closed':![]};if(_0x4a5eab[_0xcd9c('0x55')][_0xcd9c('0xa8')]){_0x217881['threadId']=_0x4a5eab[_0xcd9c('0x55')][_0xcd9c('0xa8')];return db[_0xcd9c('0xa9')]['find']({'where':_0x217881})['then'](function(_0x2eb92b){if(_0x2eb92b){return[_0x2eb92b,![]];}_0x12aa50[_0xcd9c('0xa8')]=_0x4a5eab[_0xcd9c('0x55')]['threadId'];_0x12aa50[_0xcd9c('0xaa')]=_0x4a5eab['body']['externalUrl'];return db['ChatInteraction'][_0xcd9c('0x4e')](_0x12aa50)['then'](function(_0x1be6af){return[_0x1be6af,!![]];});});}_0x217881[_0xcd9c('0xab')]=_0x32548a['id'];if(_0x4a5eab[_0xcd9c('0x55')][_0xcd9c('0xac')]&&_0x4a5eab[_0xcd9c('0x55')][_0xcd9c('0xac')]['id']){_0x217881['id']=_0x4a5eab[_0xcd9c('0x55')][_0xcd9c('0xac')]['id'];return db[_0xcd9c('0xa9')]['find']({'where':_0x217881})[_0xcd9c('0x15')](function(_0x3b67cb){if(_0x3b67cb){return[_0x3b67cb,![]];}return db[_0xcd9c('0xa9')][_0xcd9c('0x4e')](_0x12aa50)[_0xcd9c('0x15')](function(_0x13fe26){return[_0x13fe26,!![]];});});}return db[_0xcd9c('0xa9')][_0xcd9c('0x4e')](_0x12aa50)['then'](function(_0x3f23e7){return[_0x3f23e7,!![]];});}})[_0xcd9c('0xad')](function(_0x12fbca,_0x184cfe){if(_0x12fbca){_0x11081a=_0x184cfe;if(!_0x184cfe){var _0x19f6b2={'from':(_0x3a12f7[_0xcd9c('0x98')][_0xcd9c('0x9c')]||'')+'\x20'+(_0x3a12f7['contact']['lastName']||'')};if(_0x4a5eab[_0xcd9c('0x55')][_0xcd9c('0xa8')]&&_0x4a5eab[_0xcd9c('0x55')]['messageId']&&_0x4a5eab['body']['threadId']!=_0x4a5eab['body'][_0xcd9c('0xae')]){_0x19f6b2['threadId']=_0x4a5eab[_0xcd9c('0x55')][_0xcd9c('0xae')];}return _0x12fbca[_0xcd9c('0xaf')](_0x19f6b2);}else{return _0x12fbca;}}})[_0xcd9c('0x15')](function(_0x42301f){_0x3a12f7[_0xcd9c('0xac')]=_0x42301f[_0xcd9c('0x29')]({'plain':!![]});_0x3a12f7[_0xcd9c('0xac')][_0xcd9c('0xb0')]=_0x11081a;if(_0x3a12f7[_0xcd9c('0xac')][_0xcd9c('0xb0')]){if(_0x3a12f7[_0xcd9c('0x93')][_0xcd9c('0xb1')]){_0x3a12f7[_0xcd9c('0x95')][_0xcd9c('0xb2')]({'id':0x0,'priority':_0x3a12f7['applications']['length']+0x1,'app':_0xcd9c('0xb3'),'appdata':_0xcd9c('0xb4'),'interval':_0xcd9c('0xb5')});}}return db['ChatMessage'][_0xcd9c('0x4e')]({'body':_0x4a5eab[_0xcd9c('0x55')]['body'],'ChatWebsiteId':_0x4a5eab['params']['id'],'ChatInteractionId':_0x42301f['id'],'direction':'in','ContactId':_0x3a12f7['contact']['id'],'AttachmentId':_0x4a5eab[_0xcd9c('0x55')]['AttachmentId']});})[_0xcd9c('0x15')](function(_0x17c436){_0x3a12f7['message']=_0x17c436;if(_0x3a12f7['interaction']['UserId']){return db['User'][_0xcd9c('0x56')]({'attributes':['id',_0xcd9c('0x2e')],'where':{'id':_0x3a12f7[_0xcd9c('0xac')][_0xcd9c('0xb6')]}})['then'](function(_0x4fe0c1){if(_0x4fe0c1){_0x3a12f7[_0xcd9c('0x95')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4fe0c1[_0xcd9c('0x2e')]+','+(_0x3a12f7[_0xcd9c('0x93')][_0xcd9c('0xb7')]||0xa),'interval':_0xcd9c('0xb5')});_0x3a12f7[_0xcd9c('0xb8')]=!![];}return respondWithRpcPromise(_0xcd9c('0xb9'),_0xcd9c('0xba'),_0x3a12f7);});}return respondWithRpcPromise(_0xcd9c('0xb9'),_0xcd9c('0xba'),_0x3a12f7);})['then'](function(_0x383e33){respondWithRpcPromise(_0xcd9c('0xbb'),_0xcd9c('0xbb'),{'event':_0xcd9c('0x7c'),'message':_0x383e33},client9002);return _0x383e33;})[_0xcd9c('0x15')](respondWithResult(_0x46b140,null))[_0xcd9c('0x1e')](handleError(_0x46b140,null));};exports[_0xcd9c('0xbc')]=function(_0x1f9b1e,_0x124240){var _0x34c10e,_0x266f0e,_0x294735;var _0x1ea727=[];var _0x5b6382={};var _0x4fb6ef=_0x1f9b1e[_0xcd9c('0xbd')]||[];var _0x470a0c=[];var _0x659b54;return db[_0xcd9c('0x81')][_0xcd9c('0x57')]()[_0xcd9c('0x15')](function(_0x161601){if(!_0x161601){throw new db[(_0xcd9c('0x82'))][(_0xcd9c('0x83'))](_0xcd9c('0xbe'));}_0x1ea727=_[_0xcd9c('0x84')](_[_0xcd9c('0x37')](_0x161601),['createdAt',_0xcd9c('0x85'),_0xcd9c('0x86'),_0xcd9c('0x87')]);if(_0x1f9b1e[_0xcd9c('0x55')]['id']){delete _0x1f9b1e[_0xcd9c('0x55')]['id'];}if(_[_0xcd9c('0x74')](_0x1f9b1e[_0xcd9c('0x55')][_0xcd9c('0x88')])){throw _0x124240['status'](0x1f4)[_0xcd9c('0xbf')](new db['Sequelize']['ValidationError']('from\x20is\x20mandatory'));}if(_[_0xcd9c('0x74')](_0x1f9b1e[_0xcd9c('0x55')][_0xcd9c('0x55')])||_0x1f9b1e[_0xcd9c('0x55')][_0xcd9c('0x55')]===''){throw _0x124240[_0xcd9c('0x20')](0x1f4)[_0xcd9c('0xbf')](new db[(_0xcd9c('0x82'))][(_0xcd9c('0x83'))](_0xcd9c('0x89')));}if(_[_0xcd9c('0x74')](_0x1f9b1e['body'][_0xcd9c('0xc0')])){throw _0x124240['status'](0x1f4)[_0xcd9c('0xbf')](new db[(_0xcd9c('0x82'))][(_0xcd9c('0x83'))](_0xcd9c('0xc1')+_0x1ea727));}if(!_[_0xcd9c('0x8b')](_0x1ea727,_0x1f9b1e['body']['mapKeyOffline'])){throw _0x124240[_0xcd9c('0x20')](0x1f4)['send'](new db[(_0xcd9c('0x82'))][(_0xcd9c('0x83'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1ea727));}_0x5b6382[_0x1f9b1e[_0xcd9c('0x55')][_0xcd9c('0xc0')]]=_0x1f9b1e[_0xcd9c('0x55')][_0xcd9c('0x88')];})[_0xcd9c('0x15')](function(){return db[_0xcd9c('0x33')][_0xcd9c('0x56')]({'where':{'id':_0x1f9b1e[_0xcd9c('0x4c')]['id']},'include':[{'model':db[_0xcd9c('0x8d')],'as':_0xcd9c('0x8e')},{'model':db[_0xcd9c('0xc2')],'as':'MailAccount'}]});})[_0xcd9c('0x15')](handleEntityNotFound(_0x124240,null))[_0xcd9c('0x15')](function(_0x382c9c){if(_0x382c9c&&_0x382c9c['List']){_0x266f0e=_0x382c9c;var _0x505f83=_[_0xcd9c('0xc3')](_0x1f9b1e[_0xcd9c('0x55')],{'firstName':_0x1f9b1e[_0xcd9c('0x55')]['from'],'phone':_0x1f9b1e['body']['from'],'ListId':_0x382c9c[_0xcd9c('0x87')]});_0x505f83[_0x1f9b1e[_0xcd9c('0x55')][_0xcd9c('0xc0')]]=_0x1f9b1e[_0xcd9c('0x55')][_0xcd9c('0x88')];return db[_0xcd9c('0x81')][_0xcd9c('0xc4')]({'where':_0x5b6382,'defaults':_0x505f83});}})[_0xcd9c('0xad')](function(_0x205afb){if(_0x205afb){_0x294735=_0x205afb;var _0x274e12=fs[_0xcd9c('0xc5')](path['join'](config[_0xcd9c('0x6a')],_0xcd9c('0xc6')),_0xcd9c('0xc7'));var _0x5f4127=ejs[_0xcd9c('0xc8')](_0x274e12,{'body':_[_0xcd9c('0xc9')](_0x1f9b1e[_0xcd9c('0x55')][_0xcd9c('0x55')]),'bodyTitle':_0x266f0e['offlineMessageBody']});return db[_0xcd9c('0xca')]['create']({'body':_0x5f4127,'ContactId':_0x205afb['id'],'ChatWebsiteId':_0x266f0e['id']});}})['then'](function(_0x3c2d1a){_0x659b54=_0x3c2d1a;if(_0x4fb6ef['length']){var _0x4ae774=_0x4fb6ef[_0xcd9c('0x32')](function(_0x587b48){return{'name':_0x587b48[_0xcd9c('0xcb')],'basename':_0x587b48['filename'],'type':_0x587b48['mimetype'],'ChatOfflineMessageId':_0x3c2d1a['id']};});_0x470a0c=_0x4ae774['map'](_0x5434ab=>{var _0x18f6a9={'filename':_0x5434ab[_0xcd9c('0x2e')],'path':path[_0xcd9c('0x6f')](config[_0xcd9c('0x6a')],_0xcd9c('0xcc'),_0xcd9c('0xbd'),_0xcd9c('0xcd'),_0xcd9c('0xce'),_0x5434ab[_0xcd9c('0xcf')])};return _0x18f6a9;});if(!_0x266f0e[_0xcd9c('0xd0')]){return db[_0xcd9c('0xd1')][_0xcd9c('0xd2')](function(_0x2ce876){return db[_0xcd9c('0xd3')][_0xcd9c('0xd4')](_0x4ae774,{'transaction':_0x2ce876});});}}})[_0xcd9c('0x15')](function(){if(_0x659b54){_0x34c10e=_0x659b54;return db['MailAccount'][_0xcd9c('0x5b')]({'where':{'active':!![]},'include':[{'model':db[_0xcd9c('0xd5')],'as':'Smtp','raw':!![]}]});}})['then'](function(_0x76fdbc){if(_0x76fdbc&&_0x76fdbc[_0xcd9c('0xd6')]&&_0x266f0e[_0xcd9c('0xd7')]&&_0x266f0e['forwardOfflineAddress']){var _0xfed480={'tls':{'rejectUnauthorized':![]}};if(_0x76fdbc[_0xcd9c('0xd6')][_0xcd9c('0xd8')]){_0xfed480[_0xcd9c('0xd8')]=_0x76fdbc[_0xcd9c('0xd6')][_0xcd9c('0xd8')];}else{_0xfed480[_0xcd9c('0xd9')]=_0x76fdbc[_0xcd9c('0xd6')][_0xcd9c('0xd9')];_0xfed480[_0xcd9c('0xda')]=_0x76fdbc[_0xcd9c('0xd6')][_0xcd9c('0xda')];_0xfed480[_0xcd9c('0xdb')]=_0x76fdbc[_0xcd9c('0xd6')][_0xcd9c('0xdb')];}if(_0x76fdbc[_0xcd9c('0xd6')][_0xcd9c('0xdc')]){_0xfed480[_0xcd9c('0xdd')]={'user':_0x76fdbc['Smtp'][_0xcd9c('0x4f')],'pass':_0x76fdbc[_0xcd9c('0xd6')][_0xcd9c('0xde')]};}return respondWithRpcPromise(_0xcd9c('0xdf'),_0xcd9c('0xe0'),{'account':_0xfed480,'message':{'from':util[_0xcd9c('0xa2')](_0xcd9c('0xe1'),_0x76fdbc[_0xcd9c('0x2e')],_0x76fdbc[_0xcd9c('0xe2')]||_0x76fdbc['Smtp']['user']),'to':_0x266f0e['forwardOfflineAddress'],'subject':_0x266f0e['offlineMessageSubject'],'html':_0x34c10e[_0xcd9c('0x55')],'attachments':_0x470a0c}},client9003)[_0xcd9c('0x15')](function(){return _0x34c10e;})[_0xcd9c('0x1e')](function(_0xb69db5){console[_0xcd9c('0x1b')](_0xb69db5);});}})[_0xcd9c('0x15')](function(){if(_0x266f0e&&_0x266f0e['openNewInteraction']&&_0x266f0e['MailAccountId']){var _0x2a7dd1=[];if(_0x4fb6ef[_0xcd9c('0x4d')]){_0x2a7dd1=_0x4fb6ef[_0xcd9c('0x32')](function(_0x3e18d7){return{'name':_0x3e18d7[_0xcd9c('0xcb')],'basename':_0x3e18d7['filename'],'type':_0x3e18d7[_0xcd9c('0xe3')],'ChatOfflineMessageId':_0x659b54['id']};});}var _0x2c5982;if(!_[_0xcd9c('0x74')](_0x266f0e[_0xcd9c('0xe4')])){var _0x3f6140=_['map'](_0x1f9b1e[_0xcd9c('0x55')],function(_0x365fee){return _0x365fee;});var _0x3f8590=_[_0xcd9c('0xe5')](_0x3f6140)[0x0];var _0x84dfc9=_[_0xcd9c('0xe6')](_0x3f8590,function(_0x1ed0d1){return _0x1ed0d1;});_0x2c5982=_0x84dfc9[0x1][_0x266f0e[_0xcd9c('0xe4')]];}var _0x160a5f={'from':_0x294735['email'],'firstName':_0x294735[_0xcd9c('0x9c')],'lastName':_0x294735[_0xcd9c('0x9d')],'mapKey':_0xcd9c('0xe2'),'message':{'from':_0x294735['email'],'to':_0x266f0e['MailAccount'][_0xcd9c('0xe2')],'cc':'','subject':_[_0xcd9c('0x74')](_0x2c5982)?_0x266f0e[_0xcd9c('0xe7')]:_0x2c5982,'messageId':'','sentAt':new Date(),'attach':_0x2a7dd1[_0xcd9c('0x4d')],'attachments':_0x2a7dd1,'originChannel':'Chat','ChatWebsiteId':_0x266f0e['id'],'ChatOfflineMessageId':_0x34c10e['id'],'originTo':_0x266f0e['MailAccount']['email']},'body':_0x34c10e[_0xcd9c('0x55')]};var _0x1032cc={'account':{'id':_0x266f0e[_0xcd9c('0xe8')]},'body':_0x160a5f,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0xcd9c('0xe9'),_0xcd9c('0xea'),_0x1032cc,client9001)[_0xcd9c('0x15')](function(){return _0x34c10e;})['catch'](function(_0x3bbc76){console['error'](_0x3bbc76);});}return;})[_0xcd9c('0x15')](function(){if(_0x34c10e){return _0x34c10e;}})[_0xcd9c('0x15')](respondWithResult(_0x124240,null))[_0xcd9c('0x1e')](function(_0x247304){console[_0xcd9c('0x1b')](_0xcd9c('0x1e'),_0x247304);for(var _0x4e74fd of _0x4fb6ef){var _0x1ed10f=path[_0xcd9c('0x6f')](config['root'],_0xcd9c('0xcc'),'files',_0xcd9c('0xcd'),_0xcd9c('0xce'),_0x4e74fd['filename']);fs_extra[_0xcd9c('0xeb')](_0x1ed10f)[_0xcd9c('0x1e')](function(_0x3e4ab7){console[_0xcd9c('0x1b')]('Could\x20not\x20remove\x20attachment\x20file',_0x1ed10f,_0x3e4ab7);});}});};exports[_0xcd9c('0xec')]=function(_0x1f262e,_0x5771f7){return db['ChatInteraction'][_0xcd9c('0x56')]({'where':{'id':_0x1f262e[_0xcd9c('0x4c')]['id']}})[_0xcd9c('0x15')](handleEntityNotFound(_0x5771f7,null))[_0xcd9c('0x15')](function(_0x37a492){if(_0x37a492){return _0x37a492[_0xcd9c('0xec')](_0x1f262e[_0xcd9c('0x55')]['ids'],_[_0xcd9c('0xed')](_0x1f262e['body'],['ids','id'])||{});}})[_0xcd9c('0x15')](respondWithResult(_0x5771f7,null))[_0xcd9c('0x1e')](handleError(_0x5771f7,null));};exports[_0xcd9c('0xee')]=function(_0x25e5b9,_0x5d1d0c){var _0x550fd3={'raw':![],'where':{}};var _0x10af07={};var _0x1f5bf2={'count':0x0,'rows':[]};return db[_0xcd9c('0x33')]['findOne']({'where':{'id':_0x25e5b9['params']['id']}})['then'](handleEntityNotFound(_0x5d1d0c,null))[_0xcd9c('0x15')](function(_0x15c977){if(_0x15c977){_0x10af07[_0xcd9c('0x36')]=_[_0xcd9c('0x37')](db['ChatInteraction'][_0xcd9c('0x34')]);_0x10af07[_0xcd9c('0x38')]=_[_0xcd9c('0x37')](_0x25e5b9['query']);_0x10af07[_0xcd9c('0x41')]=_[_0xcd9c('0x39')](_0x10af07['model'],_0x10af07['query']);_0x550fd3[_0xcd9c('0x3a')]=_['intersection'](_0x10af07[_0xcd9c('0x36')],qs[_0xcd9c('0x3b')](_0x25e5b9['query']['fields']));_0x550fd3['attributes']=_0x550fd3[_0xcd9c('0x3a')][_0xcd9c('0x4d')]?_0x550fd3[_0xcd9c('0x3a')]:_0x10af07[_0xcd9c('0x36')];if(!_0x25e5b9['query'][_0xcd9c('0x3c')]('nolimit')){_0x550fd3['limit']=qs['limit'](_0x25e5b9[_0xcd9c('0x38')][_0xcd9c('0x25')]);_0x550fd3[_0xcd9c('0x23')]=qs[_0xcd9c('0x23')](_0x25e5b9['query'][_0xcd9c('0x23')]);}_0x550fd3[_0xcd9c('0x3e')]=qs[_0xcd9c('0x3f')](_0x25e5b9[_0xcd9c('0x38')][_0xcd9c('0x3f')]);_0x550fd3['where']=qs[_0xcd9c('0x41')](_[_0xcd9c('0x42')](_0x25e5b9[_0xcd9c('0x38')],_0x10af07['filters']));_0x550fd3[_0xcd9c('0x40')][_0xcd9c('0x5c')]=_0x15c977['id'];if(_0x25e5b9[_0xcd9c('0x38')][_0xcd9c('0x43')]){_0x550fd3[_0xcd9c('0x40')]=_['merge'](_0x550fd3[_0xcd9c('0x40')],{'$or':_[_0xcd9c('0x32')](_0x550fd3['attributes'],function(_0x51040d){var _0x268fb2={};_0x268fb2[_0x51040d]={'$like':'%'+_0x25e5b9[_0xcd9c('0x38')][_0xcd9c('0x43')]+'%'};return _0x268fb2;})});}_0x550fd3=_[_0xcd9c('0x44')]({},_0x550fd3,_0x25e5b9[_0xcd9c('0x47')]);return db[_0xcd9c('0xa9')][_0xcd9c('0x26')]({'where':_0x550fd3[_0xcd9c('0x40')]})[_0xcd9c('0x15')](function(_0x45fc86){_0x1f5bf2[_0xcd9c('0x26')]=_0x45fc86;if(_0x25e5b9['query'][_0xcd9c('0x48')]){_0x550fd3['include']=[{'model':db[_0xcd9c('0x81')],'as':'Contact','required':![]},{'model':db[_0xcd9c('0xef')],'as':_0xcd9c('0xf0'),'attributes':[_0xcd9c('0x2e'),'fullname',_0xcd9c('0xf1')],'required':![]},{'model':db['Tag'],'as':_0xcd9c('0xf2'),'attributes':['id',_0xcd9c('0x2e'),_0xcd9c('0xf3')],'where':_0x25e5b9[_0xcd9c('0x38')][_0xcd9c('0xf4')]?{'id':_0x25e5b9[_0xcd9c('0x38')]['tag']}:undefined,'required':_0x25e5b9[_0xcd9c('0x38')][_0xcd9c('0xf4')]?!![]:![]}];}return db[_0xcd9c('0xa9')][_0xcd9c('0x5d')](_0x550fd3);})[_0xcd9c('0x15')](function(_0x59513c){_0x1f5bf2['rows']=_0x59513c;return _0x1f5bf2;});}})[_0xcd9c('0x15')](respondWithFilteredResult(_0x5d1d0c,_0x550fd3))[_0xcd9c('0x1e')](handleError(_0x5d1d0c,null));};function iftimePromise(_0x464770,_0x2fd730){return respondWithRpcPromise(_0xcd9c('0xf5'),'getSnippet',{'command':_0x2fd730['timezone']?util[_0xcd9c('0xa2')](_0xcd9c('0xf6'),_0x464770['interval'],_0x2fd730[_0xcd9c('0xf7')]):util[_0xcd9c('0xa2')](_0xcd9c('0xf8'),_0x464770[_0xcd9c('0xf9')])},client9002)[_0xcd9c('0x15')](function(_0x4ae860){var _0x4f3c27=_0x4ae860&&_0x4ae860[_0xcd9c('0xfa')]('true')>=0x0?!![]:![];logger[_0xcd9c('0x16')](_0xcd9c('0xfb'),_0x2fd730['id'],_0x464770['id'],_0x464770[_0xcd9c('0xf9')],_0x4f3c27?_0xcd9c('0xfc'):'OFFLINE',_0x2fd730[_0xcd9c('0xf7')]?_0x2fd730[_0xcd9c('0xf7')]:_0xcd9c('0xfd'));return _0x4f3c27;})['catch'](function(_0x29c79a){logger[_0xcd9c('0x1b')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x2fd730['id'],_0x464770['id'],_0x464770[_0xcd9c('0xf9')],util[_0xcd9c('0xfe')](_0x29c79a,{'showHidden':![],'depth':null}),_0x2fd730[_0xcd9c('0xf7')]?_0x2fd730[_0xcd9c('0xf7')]:_0xcd9c('0xfd'));return![];});}exports[_0xcd9c('0xff')]=function(_0x49cecc,_0x541cc3){var _0x4b12ad=0x0;var _0xebaa80=0x0;var _0x573cff=![];var _0x3bb141;var _0x2f19a5;return db[_0xcd9c('0x33')][_0xcd9c('0x56')]({'where':{'id':_0x49cecc[_0xcd9c('0x4c')]['id']},'include':[{'model':db[_0xcd9c('0x100')],'as':'Interval','include':[{'model':db['Interval'],'as':_0xcd9c('0x101'),'attributes':['id','interval'],'raw':!![]}]}]})[_0xcd9c('0x15')](handleEntityNotFound(_0x541cc3,null))['then'](function(_0x5827e0){if(_0x5827e0){_0x3bb141=_0x5827e0;return _0x5827e0[_0xcd9c('0x102')]({'raw':!![]});}})[_0xcd9c('0x15')](function(_0x5a0132){if(_0x3bb141){if(_0x5a0132){_0x2f19a5=_0x5a0132;}}return require(_0xcd9c('0x6c'))['getLicense']();})['then'](function(_0x1367f2){if(_0x1367f2){_0xebaa80=_0x1367f2[_0xcd9c('0x103')];_0x573cff=_0x1367f2[_0xcd9c('0x6d')];}})[_0xcd9c('0x15')](function(){return db[_0xcd9c('0xa9')][_0xcd9c('0x26')]({'where':{'closed':![]}});})['then'](function(_0x40df52){_0x4b12ad=_0x40df52;if(_0xebaa80&&_0x40df52>_0xebaa80){return db['License'][_0xcd9c('0x5b')]({'where':{'id':0x1}})[_0xcd9c('0x15')](function(_0x52c0e5){if(_0x52c0e5){_0x52c0e5['increment'](_0xcd9c('0x104'));}});}})[_0xcd9c('0x15')](function(){if(_0x3bb141[_0xcd9c('0x100')]&&_0x3bb141[_0xcd9c('0x100')][_0xcd9c('0x101')]){var _0xe93b59=[];for(var _0x4fcfa4=0x0;_0x4fcfa4<_0x3bb141[_0xcd9c('0x100')][_0xcd9c('0x101')][_0xcd9c('0x4d')];_0x4fcfa4++){var _0x42bb7e=_0x3bb141[_0xcd9c('0x100')][_0xcd9c('0x101')][_0x4fcfa4]['get']({'plain':!![]});_0xe93b59[_0xcd9c('0xb2')](iftimePromise(_0x42bb7e,_0x3bb141));}return BPromise['all'](_0xe93b59)[_0xcd9c('0x15')](function(_0x2dc0d4){return _[_0xcd9c('0x105')](_0x2dc0d4);});}else{return!![];}})[_0xcd9c('0x15')](function(_0x3827fb){var _0x8b1dc6=fs[_0xcd9c('0xc5')](path[_0xcd9c('0x6f')](config['root'],_0xcd9c('0x106')),_0xcd9c('0xc7'));var _0x5c5ee6={'remote':_0x3bb141[_0xcd9c('0x107')],'query':querystring['stringify'](_[_0xcd9c('0x44')](_0x3bb141[_0xcd9c('0x29')]({'plain':!![]}),{'customerIp':_0x49cecc[_0xcd9c('0x7d')]['x-forwarded-for']||_0x49cecc['headers'][_0xcd9c('0x108')]||_0x49cecc[_0xcd9c('0x109')][_0xcd9c('0x10a')]||_0x49cecc['ip'],'referer':_0x49cecc['headers'][_0xcd9c('0x9f')],'openedInteractions':_0x4b12ad,'maxInteractions':_0xebaa80,'virtual':_0x573cff['virtual'],'online':_0x3827fb,'custom':_0x573cff}))[_0xcd9c('0x10b')](/'/g,'\x5c\x27')};_0x541cc3[_0xcd9c('0xbf')](ejs[_0xcd9c('0xc8')](Mustache[_0xcd9c('0xc8')](_0x8b1dc6,_0x5c5ee6),{'proactiveActions':_0x2f19a5,'alignment':_0x3bb141[_0xcd9c('0x10c')],'verticalAlignment':_0x3bb141[_0xcd9c('0x10d')],'div_color':_0x3bb141['color'],'labelText':_0x3bb141[_0xcd9c('0x10e')],'text_color':_0x3bb141[_0xcd9c('0x10f')],'button_color':_0x3bb141[_0xcd9c('0x110')],'background_color':_0x3bb141[_0xcd9c('0x111')]}));})[_0xcd9c('0x1e')](handleError(_0x541cc3,null));};exports[_0xcd9c('0x112')]=function(_0x54405a,_0x9fe5fa){var _0x2e6eec=_0x54405a[_0xcd9c('0x4c')]['id'];var _0x5f943e=_0x54405a[_0xcd9c('0x55')];var _0x14395f=0xc8;var _0x4b4e0e=null;return db[_0xcd9c('0xd1')][_0xcd9c('0xd2')]({'isolationLevel':db['sequelize'][_0xcd9c('0x113')][_0xcd9c('0x114')][_0xcd9c('0x115')]},function(_0x4c5472){return db[_0xcd9c('0x33')][_0xcd9c('0x5b')]({'where':{'id':_0x2e6eec},'transaction':_0x4c5472})[_0xcd9c('0x15')](function(_0x4aec7d){if(_0x4aec7d){return db[_0xcd9c('0x91')]['destroy']({'where':{'ChatWebsiteId':_0x2e6eec},'transaction':_0x4c5472})[_0xcd9c('0x15')](function(){var _0x1821df=_['map'](_0x5f943e,function(_0x8d384){_0x8d384['ChatWebsiteId']=_0x2e6eec;return _0x8d384;});return db[_0xcd9c('0x91')][_0xcd9c('0xd4')](_0x1821df,{'transaction':_0x4c5472});});}else{_0x14395f=0x194;_0x4b4e0e=[];}});})[_0xcd9c('0x15')](function(){if(_0x14395f!==0x194){return db[_0xcd9c('0x91')][_0xcd9c('0x116')]({'where':{'ChatWebsiteId':_0x2e6eec},'order':_0xcd9c('0x117')})[_0xcd9c('0x15')](function(_0x407307){_0x4b4e0e=_0x407307;});}})['catch'](function(_0x55cdcf){_0x14395f=0x1f4;logger['error'](_0x55cdcf[_0xcd9c('0x2d')]);if(_0x55cdcf[_0xcd9c('0x2e')]){delete _0x55cdcf['name'];}_0x4b4e0e=_0x55cdcf;})[_0xcd9c('0x118')](function(){if(_0x4b4e0e===null){_0x9fe5fa[_0xcd9c('0x1f')](_0x14395f);}else{if(_0x14395f===0x1f4){_0x9fe5fa['status'](_0x14395f)[_0xcd9c('0xbf')](_0x4b4e0e);}else{_0x9fe5fa[_0xcd9c('0x20')](_0x14395f)[_0xcd9c('0x22')](_0x4b4e0e);}}});};exports[_0xcd9c('0x119')]=function(_0x45e434,_0x5badca){var _0xfad1f1={};var _0x2de06e={};var _0x737a11;var _0x155312;return db['ChatWebsite'][_0xcd9c('0x5b')]({'where':{'id':_0x45e434['params']['id']}})[_0xcd9c('0x15')](handleEntityNotFound(_0x5badca,null))['then'](function(_0x13f498){if(_0x13f498){_0x737a11=_0x13f498;_0x2de06e[_0xcd9c('0x36')]=_[_0xcd9c('0x37')](db[_0xcd9c('0x91')]['rawAttributes']);_0x2de06e[_0xcd9c('0x38')]=_[_0xcd9c('0x37')](_0x45e434[_0xcd9c('0x38')]);_0x2de06e[_0xcd9c('0x41')]=_[_0xcd9c('0x39')](_0x2de06e[_0xcd9c('0x36')],_0x2de06e[_0xcd9c('0x38')]);_0xfad1f1[_0xcd9c('0x3a')]=_[_0xcd9c('0x39')](_0x2de06e[_0xcd9c('0x36')],qs[_0xcd9c('0x3b')](_0x45e434['query'][_0xcd9c('0x3b')]));_0xfad1f1['attributes']=_0xfad1f1[_0xcd9c('0x3a')][_0xcd9c('0x4d')]?_0xfad1f1[_0xcd9c('0x3a')]:_0x2de06e['model'];_0xfad1f1[_0xcd9c('0x3e')]=qs[_0xcd9c('0x3f')](_0x45e434[_0xcd9c('0x38')]['sort']);_0xfad1f1['where']=qs[_0xcd9c('0x41')](_[_0xcd9c('0x42')](_0x45e434[_0xcd9c('0x38')],_0x2de06e[_0xcd9c('0x41')]));if(_0x45e434['query'][_0xcd9c('0x43')]){_0xfad1f1[_0xcd9c('0x40')]=_[_0xcd9c('0x44')](_0xfad1f1[_0xcd9c('0x40')],{'$or':_[_0xcd9c('0x32')](_0xfad1f1[_0xcd9c('0x3a')],function(_0x5707b3){var _0x4e3e15={};_0x4e3e15[_0x5707b3]={'$like':'%'+_0x45e434[_0xcd9c('0x38')][_0xcd9c('0x43')]+'%'};return _0x4e3e15;})});}_0xfad1f1=_[_0xcd9c('0x44')]({},_0xfad1f1,_0x45e434['options']);return _0x737a11[_0xcd9c('0x119')](_0xfad1f1);}})[_0xcd9c('0x15')](function(_0xd92738){if(_0xd92738){_0x155312=_0xd92738[_0xcd9c('0x4d')];if(!_0x45e434['query'][_0xcd9c('0x3c')](_0xcd9c('0x3d'))){_0xfad1f1['limit']=qs[_0xcd9c('0x25')](_0x45e434['query'][_0xcd9c('0x25')]);_0xfad1f1[_0xcd9c('0x23')]=qs[_0xcd9c('0x23')](_0x45e434[_0xcd9c('0x38')][_0xcd9c('0x23')]);}return _0x737a11[_0xcd9c('0x119')](_0xfad1f1);}})[_0xcd9c('0x15')](function(_0xcd82d9){if(_0xcd82d9){return _0xcd82d9?{'count':_0x155312,'rows':_0xcd82d9}:null;}})[_0xcd9c('0x15')](respondWithResult(_0x5badca,null))['catch'](handleError(_0x5badca,null));};exports[_0xcd9c('0x11a')]=function(_0xaf29fb,_0x16e382){return db[_0xcd9c('0x11b')][_0xcd9c('0x56')]({'where':{'id':_0xaf29fb[_0xcd9c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x16e382,null))[_0xcd9c('0x15')](function(_0x78497b){if(_0x78497b){return _0x78497b['addProactiveActions'](_0xaf29fb[_0xcd9c('0x55')]['ids'],_['omit'](_0xaf29fb[_0xcd9c('0x55')],[_0xcd9c('0x5f'),'id'])||{});}})['then'](respondWithResult(_0x16e382,null))[_0xcd9c('0x1e')](handleError(_0x16e382,null));};exports['getProactiveActions']=function(_0x158cfe,_0x270877){var _0x2d1f97={};var _0x5f3c70={};var _0x5ca369;var _0x143687;return db[_0xcd9c('0x33')][_0xcd9c('0x5b')]({'where':{'id':_0x158cfe[_0xcd9c('0x4c')]['id']}})[_0xcd9c('0x15')](handleEntityNotFound(_0x270877,null))['then'](function(_0x46d19f){if(_0x46d19f){_0x5ca369=_0x46d19f;_0x5f3c70[_0xcd9c('0x36')]=_['keys'](db[_0xcd9c('0x11c')][_0xcd9c('0x34')]);_0x5f3c70['query']=_[_0xcd9c('0x37')](_0x158cfe['query']);_0x5f3c70[_0xcd9c('0x41')]=_[_0xcd9c('0x39')](_0x5f3c70[_0xcd9c('0x36')],_0x5f3c70[_0xcd9c('0x38')]);_0x2d1f97[_0xcd9c('0x3a')]=_['intersection'](_0x5f3c70[_0xcd9c('0x36')],qs[_0xcd9c('0x3b')](_0x158cfe[_0xcd9c('0x38')][_0xcd9c('0x3b')]));_0x2d1f97['attributes']=_0x2d1f97['attributes'][_0xcd9c('0x4d')]?_0x2d1f97[_0xcd9c('0x3a')]:_0x5f3c70[_0xcd9c('0x36')];_0x2d1f97[_0xcd9c('0x3e')]=qs['sort'](_0x158cfe['query'][_0xcd9c('0x3f')]);_0x2d1f97[_0xcd9c('0x40')]=qs[_0xcd9c('0x41')](_[_0xcd9c('0x42')](_0x158cfe[_0xcd9c('0x38')],_0x5f3c70[_0xcd9c('0x41')]));if(_0x158cfe[_0xcd9c('0x38')]['filter']){_0x2d1f97[_0xcd9c('0x40')]=_['merge'](_0x2d1f97[_0xcd9c('0x40')],{'$or':_[_0xcd9c('0x32')](_0x2d1f97[_0xcd9c('0x3a')],function(_0x1d0f94){var _0x29a17f={};_0x29a17f[_0x1d0f94]={'$like':'%'+_0x158cfe[_0xcd9c('0x38')][_0xcd9c('0x43')]+'%'};return _0x29a17f;})});}_0x2d1f97=_[_0xcd9c('0x44')]({},_0x2d1f97,_0x158cfe['options']);return _0x5ca369[_0xcd9c('0x102')](_0x2d1f97);}})[_0xcd9c('0x15')](function(_0x27e663){if(_0x27e663){_0x143687=_0x27e663[_0xcd9c('0x4d')];if(!_0x158cfe[_0xcd9c('0x38')][_0xcd9c('0x3c')](_0xcd9c('0x3d'))){_0x2d1f97[_0xcd9c('0x25')]=qs[_0xcd9c('0x25')](_0x158cfe[_0xcd9c('0x38')]['limit']);_0x2d1f97[_0xcd9c('0x23')]=qs['offset'](_0x158cfe['query'][_0xcd9c('0x23')]);}return _0x5ca369[_0xcd9c('0x102')](_0x2d1f97);}})[_0xcd9c('0x15')](function(_0x367dfa){if(_0x367dfa){return _0x367dfa?{'count':_0x143687,'rows':_0x367dfa}:null;}})[_0xcd9c('0x15')](respondWithResult(_0x270877,null))[_0xcd9c('0x1e')](handleError(_0x270877,null));};exports[_0xcd9c('0x11d')]=function(_0x1dd11c,_0x422fe6){var _0xe618fd=_0x1dd11c[_0xcd9c('0x38')][_0xcd9c('0x11e')]===_0xcd9c('0x11f')?_0xcd9c('0x120'):'onlineForm';return db[_0xcd9c('0x33')]['find']({'attributes':['id',_0xe618fd],'where':{'id':_0x1dd11c[_0xcd9c('0x4c')]['id']}})[_0xcd9c('0x15')](handleEntityNotFound(_0x422fe6,null))[_0xcd9c('0x15')](function(_0x42f53c){if(_0x42f53c){var _0x1e5341=_0x42f53c[_0xe618fd];var _0x18eff5=_0x1e5341&&_0x1e5341[_0xcd9c('0x121')]?_0x1e5341['items']:[];_0x422fe6[_0xcd9c('0xbf')]({'fromKey':_['isNil'](_0x1e5341[_0xcd9c('0x122')])?undefined:_0x1e5341['fromKey'],'count':_0x18eff5[_0xcd9c('0x4d')],'rows':_0x18eff5});}})[_0xcd9c('0x1e')](handleError(_0x422fe6,null));};exports[_0xcd9c('0x123')]=function(_0x48c0b1,_0x46caa9){var _0x4905f0={'raw':![],'where':{}};var _0x120644={};var _0x127c7a={'count':0x0,'rows':[]};return db[_0xcd9c('0x33')][_0xcd9c('0x5b')]({'where':{'id':_0x48c0b1[_0xcd9c('0x4c')]['id']}})[_0xcd9c('0x15')](handleEntityNotFound(_0x46caa9,null))[_0xcd9c('0x15')](function(_0x28d664){if(_0x28d664){_0x120644[_0xcd9c('0x36')]=_[_0xcd9c('0x37')](db[_0xcd9c('0xca')]['rawAttributes']);_0x120644['query']=_[_0xcd9c('0x37')](_0x48c0b1['query']);_0x120644[_0xcd9c('0x41')]=_[_0xcd9c('0x39')](_0x120644[_0xcd9c('0x36')],_0x120644[_0xcd9c('0x38')]);_0x4905f0[_0xcd9c('0x3a')]=_['intersection'](_0x120644[_0xcd9c('0x36')],qs[_0xcd9c('0x3b')](_0x48c0b1['query']['fields']));_0x4905f0[_0xcd9c('0x3a')]=_0x4905f0[_0xcd9c('0x3a')]['length']?_0x4905f0[_0xcd9c('0x3a')]:_0x120644[_0xcd9c('0x36')];if(!_0x48c0b1['query'][_0xcd9c('0x3c')]('nolimit')){_0x4905f0[_0xcd9c('0x25')]=qs[_0xcd9c('0x25')](_0x48c0b1[_0xcd9c('0x38')][_0xcd9c('0x25')]);_0x4905f0[_0xcd9c('0x23')]=qs[_0xcd9c('0x23')](_0x48c0b1[_0xcd9c('0x38')][_0xcd9c('0x23')]);}_0x4905f0[_0xcd9c('0x3e')]=qs[_0xcd9c('0x3f')](_0x48c0b1[_0xcd9c('0x38')]['sort']);_0x4905f0[_0xcd9c('0x40')]=qs[_0xcd9c('0x41')](_[_0xcd9c('0x42')](_0x48c0b1[_0xcd9c('0x38')],_0x120644[_0xcd9c('0x41')]));_0x4905f0[_0xcd9c('0x40')][_0xcd9c('0x5c')]=_0x28d664['id'];if(_0x48c0b1['query'][_0xcd9c('0x43')]){_0x4905f0[_0xcd9c('0x40')]=_[_0xcd9c('0x44')](_0x4905f0[_0xcd9c('0x40')],{'$or':_[_0xcd9c('0x32')](_0x4905f0['attributes'],function(_0x3f0fd2){var _0xf10f25={};_0xf10f25[_0x3f0fd2]={'$like':'%'+_0x48c0b1['query']['filter']+'%'};return _0xf10f25;})});}_0x4905f0=_[_0xcd9c('0x44')]({},_0x4905f0,_0x48c0b1[_0xcd9c('0x47')]);return db[_0xcd9c('0xca')][_0xcd9c('0x26')]({'where':_0x4905f0[_0xcd9c('0x40')]})[_0xcd9c('0x15')](function(_0xf8e8ba){_0x127c7a[_0xcd9c('0x26')]=_0xf8e8ba;if(_0x48c0b1[_0xcd9c('0x38')][_0xcd9c('0x48')]){_0x4905f0[_0xcd9c('0x49')]=[{'all':!![]}];}else{_0x4905f0[_0xcd9c('0x49')]=[{'model':db[_0xcd9c('0x81')],'as':'Contact','required':![]},{'model':db[_0xcd9c('0xd3')],'as':_0xcd9c('0x124'),'required':![]}];}return db['ChatOfflineMessage']['findAll'](_0x4905f0);})[_0xcd9c('0x15')](function(_0x203af4){_0x127c7a['rows']=_0x203af4;return _0x127c7a;});}})[_0xcd9c('0x15')](respondWithFilteredResult(_0x46caa9,_0x4905f0))[_0xcd9c('0x1e')](handleError(_0x46caa9,null));};exports['addAgents']=function(_0x5bca0b,_0x3fdd58){return db[_0xcd9c('0x33')][_0xcd9c('0x56')]({'where':{'id':_0x5bca0b[_0xcd9c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3fdd58,null))['then'](function(_0x15a4e8){if(_0x15a4e8){return _0x15a4e8['addAgents'](_0x5bca0b[_0xcd9c('0x55')]['ids'],_['omit'](_0x5bca0b[_0xcd9c('0x55')],['ids','id'])||{})[_0xcd9c('0xad')](function(_0x5a5939){for(var _0x5a2280=0x0;_0x5a2280<_0x5bca0b['body'][_0xcd9c('0x5f')][_0xcd9c('0x4d')];_0x5a2280+=0x1){socket[_0xcd9c('0x125')](_0xcd9c('0x126'),{'UserId':Number(_0x5bca0b[_0xcd9c('0x55')][_0xcd9c('0x5f')][_0x5a2280]),'ChatWebsiteId':Number(_0x5bca0b[_0xcd9c('0x4c')]['id'])});}return _0x5a5939;});}})[_0xcd9c('0x15')](respondWithResult(_0x3fdd58,null))[_0xcd9c('0x1e')](handleError(_0x3fdd58,null));};exports[_0xcd9c('0x127')]=function(_0x178cc5,_0x3a27b0){return db[_0xcd9c('0x33')]['find']({'where':{'id':_0x178cc5['params']['id']}})[_0xcd9c('0x15')](handleEntityNotFound(_0x3a27b0,null))[_0xcd9c('0x15')](function(_0x3aac5a){if(_0x3aac5a){return _0x3aac5a[_0xcd9c('0x127')](_0x178cc5[_0xcd9c('0x38')][_0xcd9c('0x5f')])['then'](function(){if(_['isArray'](_0x178cc5[_0xcd9c('0x38')][_0xcd9c('0x5f')])){for(var _0x32b820=0x0;_0x32b820<_0x178cc5[_0xcd9c('0x38')][_0xcd9c('0x5f')][_0xcd9c('0x4d')];_0x32b820+=0x1){socket['emit'](_0xcd9c('0x128'),{'UserId':Number(_0x178cc5['query'][_0xcd9c('0x5f')][_0x32b820]),'ChatWebsiteId':Number(_0x178cc5['params']['id'])});}}else{socket[_0xcd9c('0x125')]('userChatWebsite:remove',{'UserId':Number(_0x178cc5[_0xcd9c('0x38')]['ids']),'ChatWebsiteId':Number(_0x178cc5[_0xcd9c('0x4c')]['id'])});}});}})[_0xcd9c('0x15')](respondWithStatusCode(_0x3a27b0,null))['catch'](handleError(_0x3a27b0,null));};exports['getAgents']=function(_0x9b1e13,_0x3ba639){var _0x419065={};var _0x166b3a={};var _0x2d7413;var _0x50ace4;return db[_0xcd9c('0x33')][_0xcd9c('0x5b')]({'where':{'id':_0x9b1e13['params']['id']}})[_0xcd9c('0x15')](handleEntityNotFound(_0x3ba639,null))['then'](function(_0x4f3d84){if(_0x4f3d84){_0x2d7413=_0x4f3d84;_0x166b3a[_0xcd9c('0x36')]=_[_0xcd9c('0x37')](db[_0xcd9c('0xef')]['rawAttributes']);_0x166b3a[_0xcd9c('0x38')]=_[_0xcd9c('0x37')](_0x9b1e13[_0xcd9c('0x38')]);_0x166b3a[_0xcd9c('0x41')]=_['intersection'](_0x166b3a['model'],_0x166b3a[_0xcd9c('0x38')]);_0x419065[_0xcd9c('0x3a')]=_[_0xcd9c('0x39')](_0x166b3a[_0xcd9c('0x36')],qs[_0xcd9c('0x3b')](_0x9b1e13[_0xcd9c('0x38')]['fields']));_0x419065[_0xcd9c('0x3a')]=_0x419065[_0xcd9c('0x3a')][_0xcd9c('0x4d')]?_0x419065[_0xcd9c('0x3a')]:_0x166b3a[_0xcd9c('0x36')];_0x419065['order']=qs[_0xcd9c('0x3f')](_0x9b1e13[_0xcd9c('0x38')]['sort']);_0x419065[_0xcd9c('0x40')]=qs['filters'](_[_0xcd9c('0x42')](_0x9b1e13[_0xcd9c('0x38')],_0x166b3a['filters']));if(_0x9b1e13[_0xcd9c('0x38')][_0xcd9c('0x43')]){_0x419065[_0xcd9c('0x40')]=_[_0xcd9c('0x44')](_0x419065[_0xcd9c('0x40')],{'$or':_[_0xcd9c('0x32')](_0x419065[_0xcd9c('0x3a')],function(_0x17d7c7){var _0x3b36e3={};_0x3b36e3[_0x17d7c7]={'$like':'%'+_0x9b1e13[_0xcd9c('0x38')][_0xcd9c('0x43')]+'%'};return _0x3b36e3;})});}_0x419065=_[_0xcd9c('0x44')]({},_0x419065,_0x9b1e13[_0xcd9c('0x47')]);return _0x2d7413[_0xcd9c('0x129')](_0x419065);}})[_0xcd9c('0x15')](function(_0x52491e){if(_0x52491e){_0x50ace4=_0x52491e[_0xcd9c('0x4d')];if(!_0x9b1e13['query'][_0xcd9c('0x3c')](_0xcd9c('0x3d'))){_0x419065[_0xcd9c('0x25')]=qs[_0xcd9c('0x25')](_0x9b1e13[_0xcd9c('0x38')][_0xcd9c('0x25')]);_0x419065[_0xcd9c('0x23')]=qs['offset'](_0x9b1e13[_0xcd9c('0x38')][_0xcd9c('0x23')]);}return _0x2d7413[_0xcd9c('0x129')](_0x419065);}})[_0xcd9c('0x15')](function(_0x312b00){if(_0x312b00){return _0x312b00?{'count':_0x50ace4,'rows':_0x312b00}:null;}})['then'](respondWithResult(_0x3ba639,null))[_0xcd9c('0x1e')](handleError(_0x3ba639,null));}; \ No newline at end of file +var _0xeb60=['Applications','contact','customerIp','cf-connecting-ip','x-forwarded-for','firstName','lastName','x-real-port','browser','version','unknown','format','%s\x20%s','device','vendor','%s\x20%s\x20%s','threadId','externalUrl','ChatInteraction','ContactId','interaction','messageId','created','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','Start','startRouting','EventManager','offline','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','offline-chat','sequelize','transaction','MailServerOut','forwardOffline','Smtp','service','host','port','authentication','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','openNewInteraction','MailAccountId','toPairsIn','mapValues','subjectOffline','Chat','NotifyMailAccount','notifyMail','attachments','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','internal','Tag','Tags','color','tag','Command','getSnippet','iftime\x20%s,%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','timezone','No\x20timezone','interval','inspect','Interval','Intervals','getProactiveActions','virtual','increment','chatLicenseExceeded','push','all','some','server/files/chat/iframe.ejs','utf8','remote','referer','alignment','verticalAlignment','textColor','color_button','backgroundColor','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','finally','sendStatus','json','getApplications','addProactiveActions','chatProactiveAction','omit','ChatProactiveAction','getFields','false','offlineForm','items','fromKey','getOfflineMessages','Attachment','Attachments','addAgents','spread','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','mustache','util','path','ejs','fs-extra','querystring','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','http','client','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','end','status','offset','undefined','count','limit','set','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','index','mandatoryDispositionPause','ChatWebsite','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','include','show','Pause','rawAttributes','find','create','body','user','role','userProfileId','params','describe','ChatWebsiteId','Disposition','findOne','includeAll','findAll','rows','removeDispositions','ids','addAnswer','CannedAnswer','order','removeAnswers','addLogo','sitepic','file','filename','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','existsSync','join','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','isNil','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','DESC','ChatApplication','applications','list','orderBy','priority','asc','account'];(function(_0x4d471b,_0x281167){var _0x54fd9b=function(_0x4d85b0){while(--_0x4d85b0){_0x4d471b['push'](_0x4d471b['shift']());}};_0x54fd9b(++_0x281167);}(_0xeb60,0x91));var _0x0eb6=function(_0x2c667e,_0x33d24b){_0x2c667e=_0x2c667e-0x0;var _0xf74e6f=_0xeb60[_0x2c667e];return _0xf74e6f;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0x0eb6('0x0'));var util=require(_0x0eb6('0x1'));var path=require(_0x0eb6('0x2'));var ejs=require(_0x0eb6('0x3'));var fs=require('fs');var fs_extra=require(_0x0eb6('0x4'));var _=require('lodash');var querystring=require(_0x0eb6('0x5'));var Redis=require('ioredis');var qs=require(_0x0eb6('0x6'));var logger=require(_0x0eb6('0x7'))(_0x0eb6('0x8'));var config=require(_0x0eb6('0x9'));var db=require(_0x0eb6('0xa'))['db'];config[_0x0eb6('0xb')]=_[_0x0eb6('0xc')](config[_0x0eb6('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x0eb6('0xd'))(new Redis(config['redis']));require(_0x0eb6('0xe'))[_0x0eb6('0xf')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x0eb6('0x10')]({'port':0x232c});var client9002=jayson[_0x0eb6('0x11')][_0x0eb6('0x10')]({'port':0x232a});var client9003=jayson[_0x0eb6('0x11')][_0x0eb6('0x10')]({'port':0x232b});var client9001=jayson[_0x0eb6('0x11')][_0x0eb6('0x10')]({'port':0x2329});function respondWithRpcPromise(_0x271dbe,_0x20ee06,_0x1f869a,_0x3a7dff){return new BPromise(function(_0x28e97f,_0x334598){var _0x20dfaa=_0x3a7dff||client;return _0x20dfaa[_0x0eb6('0x12')](_0x271dbe,_0x1f869a)[_0x0eb6('0x13')](function(_0xae6eb4){logger[_0x0eb6('0x14')](_0x0eb6('0x15'),_0x20ee06,_0x0eb6('0x16'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x20ee06,_0x0eb6('0x16'),JSON[_0x0eb6('0x17')](_0xae6eb4));if(_0xae6eb4[_0x0eb6('0x18')]){if(_0xae6eb4[_0x0eb6('0x18')][_0x0eb6('0x19')]===0x1f4){logger[_0x0eb6('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x20ee06,_0xae6eb4['error'][_0x0eb6('0x1a')]);return _0x334598(_0xae6eb4[_0x0eb6('0x18')][_0x0eb6('0x1a')]);}logger[_0x0eb6('0x18')](_0x0eb6('0x15'),_0x20ee06,_0xae6eb4[_0x0eb6('0x18')][_0x0eb6('0x1a')]);return _0x28e97f(_0xae6eb4[_0x0eb6('0x18')][_0x0eb6('0x1a')]);}else{logger[_0x0eb6('0x14')](_0x0eb6('0x15'),_0x20ee06,_0x0eb6('0x16'));_0x28e97f(_0xae6eb4[_0x0eb6('0x1b')][_0x0eb6('0x1a')]);}})[_0x0eb6('0x1c')](function(_0x5aa9fe){logger[_0x0eb6('0x18')](_0x0eb6('0x15'),_0x20ee06,_0x5aa9fe);_0x334598(_0x5aa9fe);});});}function respondWithStatusCode(_0xed0d89,_0x157f0a){_0x157f0a=_0x157f0a||0xcc;return function(_0x7e665f){if(_0x7e665f){return _0xed0d89['sendStatus'](_0x157f0a);}return _0xed0d89['status'](_0x157f0a)[_0x0eb6('0x1d')]();};}function respondWithResult(_0x24fb08,_0x15d0c5){_0x15d0c5=_0x15d0c5||0xc8;return function(_0xb46291){if(_0xb46291){return _0x24fb08[_0x0eb6('0x1e')](_0x15d0c5)['json'](_0xb46291);}};}function respondWithFilteredResult(_0xe61e9a,_0xd4175d){return function(_0x2ab0c8){if(_0x2ab0c8){var _0x22b41c=typeof _0xd4175d[_0x0eb6('0x1f')]===_0x0eb6('0x20')&&typeof _0xd4175d['limit']===_0x0eb6('0x20');var _0x450321=_0x2ab0c8[_0x0eb6('0x21')];var _0x432f7e=_0x22b41c?0x0:_0xd4175d[_0x0eb6('0x1f')];var _0x4999ec=_0x22b41c?_0x2ab0c8[_0x0eb6('0x21')]:_0xd4175d[_0x0eb6('0x1f')]+_0xd4175d[_0x0eb6('0x22')];var _0x3c40bd;if(_0x4999ec>=_0x450321){_0x4999ec=_0x450321;_0x3c40bd=0xc8;}else{_0x3c40bd=0xce;}_0xe61e9a[_0x0eb6('0x1e')](_0x3c40bd);return _0xe61e9a[_0x0eb6('0x23')]('Content-Range',_0x432f7e+'-'+_0x4999ec+'/'+_0x450321)['json'](_0x2ab0c8);}return null;};}function saveUpdates(_0x11bec4){return function(_0x240384){if(_0x240384){return _0x240384[_0x0eb6('0x24')](_0x11bec4)['then'](function(_0x563b52){return _0x563b52;});}return null;};}function removeEntity(_0x3cee47){return function(_0xd9e3e6){if(_0xd9e3e6){return _0xd9e3e6[_0x0eb6('0x25')]()[_0x0eb6('0x13')](function(){var _0x410f4b=_0xd9e3e6[_0x0eb6('0x26')]({'plain':!![]});var _0x3791b9=_0x0eb6('0x27');return db[_0x0eb6('0x28')][_0x0eb6('0x25')]({'where':{'type':_0x3791b9,'resourceId':_0x410f4b['id']}})[_0x0eb6('0x13')](function(){return _0xd9e3e6;});})[_0x0eb6('0x13')](function(){_0x3cee47[_0x0eb6('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1dec85){return function(_0x4808d9){if(!_0x4808d9){_0x1dec85['sendStatus'](0x194);}return _0x4808d9;};}function handleError(_0x38a084,_0x52da8){_0x52da8=_0x52da8||0x1f4;return function(_0x5a23c2){logger[_0x0eb6('0x18')](_0x5a23c2[_0x0eb6('0x29')]);if(_0x5a23c2[_0x0eb6('0x2a')]){delete _0x5a23c2[_0x0eb6('0x2a')];}_0x38a084[_0x0eb6('0x1e')](_0x52da8)[_0x0eb6('0x2b')](_0x5a23c2);};}exports[_0x0eb6('0x2c')]=function(_0xc9b02f,_0x442d09){var _0x1aee95={'include':[{'model':db['Pause'],'as':_0x0eb6('0x2d')}]},_0x16f0da={},_0x2d78ce={'count':0x0,'rows':[]};var _0x1fea21=_['map'](db[_0x0eb6('0x2e')]['rawAttributes'],function(_0x408df9){return{'name':_0x408df9['fieldName'],'type':_0x408df9[_0x0eb6('0x2f')][_0x0eb6('0x30')]};});_0x16f0da[_0x0eb6('0x31')]=_[_0x0eb6('0x32')](_0x1fea21,_0x0eb6('0x2a'));_0x16f0da[_0x0eb6('0x33')]=_[_0x0eb6('0x34')](_0xc9b02f[_0x0eb6('0x33')]);_0x16f0da[_0x0eb6('0x35')]=_[_0x0eb6('0x36')](_0x16f0da[_0x0eb6('0x31')],_0x16f0da[_0x0eb6('0x33')]);_0x1aee95[_0x0eb6('0x37')]=_[_0x0eb6('0x36')](_0x16f0da[_0x0eb6('0x31')],qs[_0x0eb6('0x38')](_0xc9b02f[_0x0eb6('0x33')]['fields']));_0x1aee95[_0x0eb6('0x37')]=_0x1aee95[_0x0eb6('0x37')][_0x0eb6('0x39')]?_0x1aee95[_0x0eb6('0x37')]:_0x16f0da['model'];if(!_0xc9b02f[_0x0eb6('0x33')][_0x0eb6('0x3a')](_0x0eb6('0x3b'))){_0x1aee95[_0x0eb6('0x22')]=qs[_0x0eb6('0x22')](_0xc9b02f[_0x0eb6('0x33')][_0x0eb6('0x22')]);_0x1aee95[_0x0eb6('0x1f')]=qs[_0x0eb6('0x1f')](_0xc9b02f['query']['offset']);}_0x1aee95['order']=qs[_0x0eb6('0x3c')](_0xc9b02f['query'][_0x0eb6('0x3c')]);_0x1aee95['where']=qs[_0x0eb6('0x35')](_[_0x0eb6('0x3d')](_0xc9b02f[_0x0eb6('0x33')],_0x16f0da[_0x0eb6('0x35')]),_0x1fea21);if(_0xc9b02f[_0x0eb6('0x33')][_0x0eb6('0x3e')]){_0x1aee95[_0x0eb6('0x3f')]=_[_0x0eb6('0x40')](_0x1aee95['where'],{'$or':_['map'](_0x1fea21,function(_0x1c4a49){if(_0x1c4a49[_0x0eb6('0x2f')]!=='VIRTUAL'){var _0xaa87b3={};_0xaa87b3[_0x1c4a49[_0x0eb6('0x2a')]]={'$like':'%'+_0xc9b02f[_0x0eb6('0x33')]['filter']+'%'};return _0xaa87b3;}})});}_0x1aee95=_[_0x0eb6('0x40')]({},_0x1aee95,_0xc9b02f[_0x0eb6('0x41')]);var _0x2b6b1f={'where':_0x1aee95[_0x0eb6('0x3f')]};return db[_0x0eb6('0x2e')][_0x0eb6('0x21')](_0x2b6b1f)[_0x0eb6('0x13')](function(_0x29130b){_0x2d78ce[_0x0eb6('0x21')]=_0x29130b;if(_0xc9b02f[_0x0eb6('0x33')]['includeAll']){_0x1aee95[_0x0eb6('0x42')]=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0x1aee95);})[_0x0eb6('0x13')](function(_0x658ab8){_0x2d78ce['rows']=_0x658ab8;return _0x2d78ce;})[_0x0eb6('0x13')](respondWithFilteredResult(_0x442d09,_0x1aee95))[_0x0eb6('0x1c')](handleError(_0x442d09,null));};exports[_0x0eb6('0x43')]=function(_0x1ec909,_0x524878){var _0x2ee996={'raw':![],'where':{'id':_0x1ec909['params']['id']},'include':[{'model':db[_0x0eb6('0x44')],'as':_0x0eb6('0x2d')}]},_0x103415={};_0x103415[_0x0eb6('0x31')]=_[_0x0eb6('0x34')](db[_0x0eb6('0x2e')][_0x0eb6('0x45')]);_0x103415[_0x0eb6('0x33')]=_[_0x0eb6('0x34')](_0x1ec909[_0x0eb6('0x33')]);_0x103415['filters']=_[_0x0eb6('0x36')](_0x103415[_0x0eb6('0x31')],_0x103415['query']);_0x2ee996['attributes']=_[_0x0eb6('0x36')](_0x103415['model'],qs[_0x0eb6('0x38')](_0x1ec909[_0x0eb6('0x33')][_0x0eb6('0x38')]));_0x2ee996[_0x0eb6('0x37')]=_0x2ee996[_0x0eb6('0x37')]['length']?_0x2ee996[_0x0eb6('0x37')]:_0x103415[_0x0eb6('0x31')];if(_0x1ec909[_0x0eb6('0x33')]['includeAll']){_0x2ee996[_0x0eb6('0x42')]=[{'all':!![]}];}_0x2ee996=_[_0x0eb6('0x40')]({},_0x2ee996,_0x1ec909[_0x0eb6('0x41')]);return db[_0x0eb6('0x2e')][_0x0eb6('0x46')](_0x2ee996)[_0x0eb6('0x13')](handleEntityNotFound(_0x524878,null))['then'](respondWithResult(_0x524878,null))[_0x0eb6('0x1c')](handleError(_0x524878,null));};exports[_0x0eb6('0x47')]=function(_0x2ba18f,_0x329f2e){return db[_0x0eb6('0x2e')][_0x0eb6('0x47')](_0x2ba18f[_0x0eb6('0x48')],{})[_0x0eb6('0x13')](function(_0x2a58a6){var _0x20edfc=_0x2ba18f[_0x0eb6('0x49')][_0x0eb6('0x26')]({'plain':!![]});if(!_0x20edfc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x20edfc[_0x0eb6('0x4a')]===_0x0eb6('0x49')){var _0x1807c4=_0x2a58a6[_0x0eb6('0x26')]({'plain':!![]});var _0x152e26=_0x0eb6('0x27');return db['UserProfileSection'][_0x0eb6('0x46')]({'where':{'name':_0x152e26,'userProfileId':_0x20edfc[_0x0eb6('0x4b')]},'raw':!![]})[_0x0eb6('0x13')](function(_0x2864b1){if(_0x2864b1&&_0x2864b1['autoAssociation']===0x0){return db[_0x0eb6('0x28')]['create']({'name':_0x1807c4['name'],'resourceId':_0x1807c4['id'],'type':_0x2864b1['name'],'sectionId':_0x2864b1['id']},{})[_0x0eb6('0x13')](function(){return _0x2a58a6;});}else{return _0x2a58a6;}})[_0x0eb6('0x1c')](function(_0xd69927){logger[_0x0eb6('0x18')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xd69927);throw _0xd69927;});}return _0x2a58a6;})['then'](respondWithResult(_0x329f2e,0xc9))[_0x0eb6('0x1c')](handleError(_0x329f2e,null));};exports[_0x0eb6('0x24')]=function(_0x2768fc,_0x16c07b){if(_0x2768fc[_0x0eb6('0x48')]['id']){delete _0x2768fc[_0x0eb6('0x48')]['id'];}return db['ChatWebsite'][_0x0eb6('0x46')]({'where':{'id':_0x2768fc[_0x0eb6('0x4c')]['id']},'include':[{'model':db[_0x0eb6('0x44')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x16c07b,null))[_0x0eb6('0x13')](saveUpdates(_0x2768fc[_0x0eb6('0x48')],null))[_0x0eb6('0x13')](respondWithResult(_0x16c07b,null))[_0x0eb6('0x1c')](handleError(_0x16c07b,null));};exports[_0x0eb6('0x25')]=function(_0x584bd4,_0x21d1f7){return db['ChatWebsite'][_0x0eb6('0x46')]({'where':{'id':_0x584bd4[_0x0eb6('0x4c')]['id']}})[_0x0eb6('0x13')](handleEntityNotFound(_0x21d1f7,null))[_0x0eb6('0x13')](removeEntity(_0x21d1f7,null))[_0x0eb6('0x1c')](handleError(_0x21d1f7,null));};exports[_0x0eb6('0x4d')]=function(_0x176de5,_0x15cc0d){return db[_0x0eb6('0x2e')][_0x0eb6('0x4d')]()[_0x0eb6('0x13')](respondWithResult(_0x15cc0d,null))['catch'](handleError(_0x15cc0d,null));};exports['addDisposition']=function(_0x4b068e,_0x59af17){if(_0x4b068e[_0x0eb6('0x48')]['id']){delete _0x4b068e['body']['id'];}return db[_0x0eb6('0x2e')][_0x0eb6('0x46')]({'where':{'id':_0x4b068e[_0x0eb6('0x4c')]['id']}})[_0x0eb6('0x13')](handleEntityNotFound(_0x59af17,null))[_0x0eb6('0x13')](function(_0x18a646){if(_0x18a646){_0x4b068e['body'][_0x0eb6('0x4e')]=_0x18a646['id'];return db[_0x0eb6('0x4f')][_0x0eb6('0x47')](_0x4b068e[_0x0eb6('0x48')]);}})[_0x0eb6('0x13')](respondWithResult(_0x59af17,null))['catch'](handleError(_0x59af17,null));};exports['getDispositions']=function(_0x4ee7de,_0x1199e1){var _0x3ba92e={'raw':![],'where':{}};var _0x170069={};var _0x43f3eb={'count':0x0,'rows':[]};return db[_0x0eb6('0x2e')][_0x0eb6('0x50')]({'where':{'id':_0x4ee7de[_0x0eb6('0x4c')]['id']}})[_0x0eb6('0x13')](handleEntityNotFound(_0x1199e1,null))[_0x0eb6('0x13')](function(_0x72094d){if(_0x72094d){_0x170069[_0x0eb6('0x31')]=_['keys'](db[_0x0eb6('0x4f')][_0x0eb6('0x45')]);_0x170069['query']=_[_0x0eb6('0x34')](_0x4ee7de[_0x0eb6('0x33')]);_0x170069[_0x0eb6('0x35')]=_[_0x0eb6('0x36')](_0x170069[_0x0eb6('0x31')],_0x170069['query']);_0x3ba92e['attributes']=_[_0x0eb6('0x36')](_0x170069[_0x0eb6('0x31')],qs[_0x0eb6('0x38')](_0x4ee7de[_0x0eb6('0x33')]['fields']));_0x3ba92e['attributes']=_0x3ba92e['attributes'][_0x0eb6('0x39')]?_0x3ba92e[_0x0eb6('0x37')]:_0x170069[_0x0eb6('0x31')];if(!_0x4ee7de[_0x0eb6('0x33')][_0x0eb6('0x3a')]('nolimit')){_0x3ba92e['limit']=qs[_0x0eb6('0x22')](_0x4ee7de['query'][_0x0eb6('0x22')]);_0x3ba92e['offset']=qs['offset'](_0x4ee7de[_0x0eb6('0x33')][_0x0eb6('0x1f')]);}_0x3ba92e['order']=qs['sort'](_0x4ee7de[_0x0eb6('0x33')]['sort']);_0x3ba92e[_0x0eb6('0x3f')]=qs[_0x0eb6('0x35')](_['pick'](_0x4ee7de[_0x0eb6('0x33')],_0x170069['filters']));_0x3ba92e[_0x0eb6('0x3f')]['ChatWebsiteId']=_0x72094d['id'];if(_0x4ee7de['query'][_0x0eb6('0x3e')]){_0x3ba92e[_0x0eb6('0x3f')]=_['merge'](_0x3ba92e[_0x0eb6('0x3f')],{'$or':_['map'](_0x3ba92e[_0x0eb6('0x37')],function(_0x4ed1c8){var _0x12f43a={};_0x12f43a[_0x4ed1c8]={'$like':'%'+_0x4ee7de['query']['filter']+'%'};return _0x12f43a;})});}_0x3ba92e=_[_0x0eb6('0x40')]({},_0x3ba92e,_0x4ee7de[_0x0eb6('0x41')]);return db[_0x0eb6('0x4f')][_0x0eb6('0x21')]({'where':_0x3ba92e[_0x0eb6('0x3f')]})[_0x0eb6('0x13')](function(_0x15ed2a){_0x43f3eb[_0x0eb6('0x21')]=_0x15ed2a;if(_0x4ee7de[_0x0eb6('0x33')][_0x0eb6('0x51')]){_0x3ba92e[_0x0eb6('0x42')]=[{'all':!![]}];}return db['Disposition'][_0x0eb6('0x52')](_0x3ba92e);})[_0x0eb6('0x13')](function(_0x59ccc4){_0x43f3eb[_0x0eb6('0x53')]=_0x59ccc4;return _0x43f3eb;});}})[_0x0eb6('0x13')](respondWithFilteredResult(_0x1199e1,_0x3ba92e))['catch'](handleError(_0x1199e1,null));};exports[_0x0eb6('0x54')]=function(_0x103ab6,_0x204983){return db[_0x0eb6('0x2e')][_0x0eb6('0x46')]({'where':{'id':_0x103ab6['params']['id']}})[_0x0eb6('0x13')](handleEntityNotFound(_0x204983,null))['then'](function(_0x34c865){if(_0x34c865){return _0x34c865[_0x0eb6('0x54')](_0x103ab6['query'][_0x0eb6('0x55')]);}})[_0x0eb6('0x13')](respondWithStatusCode(_0x204983,null))[_0x0eb6('0x1c')](handleError(_0x204983,null));};exports[_0x0eb6('0x56')]=function(_0x58ad1a,_0x1e1439){if(_0x58ad1a[_0x0eb6('0x48')]['id']){delete _0x58ad1a['body']['id'];}return db[_0x0eb6('0x2e')][_0x0eb6('0x46')]({'where':{'id':_0x58ad1a['params']['id']}})[_0x0eb6('0x13')](handleEntityNotFound(_0x1e1439,null))[_0x0eb6('0x13')](function(_0x880a43){if(_0x880a43){_0x58ad1a[_0x0eb6('0x48')][_0x0eb6('0x4e')]=_0x880a43['id'];return db[_0x0eb6('0x57')][_0x0eb6('0x47')](_0x58ad1a[_0x0eb6('0x48')]);}})[_0x0eb6('0x13')](respondWithResult(_0x1e1439,null))['catch'](handleError(_0x1e1439,null));};exports['getAnswers']=function(_0x407b5c,_0x4907a0){var _0x2e057c={'raw':![],'where':{}};var _0x4c5e38={};var _0x1e8fc7={'count':0x0,'rows':[]};return db[_0x0eb6('0x2e')][_0x0eb6('0x50')]({'where':{'id':_0x407b5c[_0x0eb6('0x4c')]['id']}})[_0x0eb6('0x13')](handleEntityNotFound(_0x4907a0,null))['then'](function(_0x529e4f){if(_0x529e4f){_0x4c5e38['model']=_[_0x0eb6('0x34')](db[_0x0eb6('0x57')][_0x0eb6('0x45')]);_0x4c5e38[_0x0eb6('0x33')]=_[_0x0eb6('0x34')](_0x407b5c[_0x0eb6('0x33')]);_0x4c5e38[_0x0eb6('0x35')]=_[_0x0eb6('0x36')](_0x4c5e38[_0x0eb6('0x31')],_0x4c5e38[_0x0eb6('0x33')]);_0x2e057c[_0x0eb6('0x37')]=_[_0x0eb6('0x36')](_0x4c5e38[_0x0eb6('0x31')],qs['fields'](_0x407b5c[_0x0eb6('0x33')][_0x0eb6('0x38')]));_0x2e057c['attributes']=_0x2e057c[_0x0eb6('0x37')][_0x0eb6('0x39')]?_0x2e057c[_0x0eb6('0x37')]:_0x4c5e38[_0x0eb6('0x31')];if(!_0x407b5c[_0x0eb6('0x33')][_0x0eb6('0x3a')](_0x0eb6('0x3b'))){_0x2e057c[_0x0eb6('0x22')]=qs['limit'](_0x407b5c[_0x0eb6('0x33')][_0x0eb6('0x22')]);_0x2e057c[_0x0eb6('0x1f')]=qs[_0x0eb6('0x1f')](_0x407b5c[_0x0eb6('0x33')]['offset']);}_0x2e057c[_0x0eb6('0x58')]=qs[_0x0eb6('0x3c')](_0x407b5c['query'][_0x0eb6('0x3c')]);_0x2e057c['where']=qs[_0x0eb6('0x35')](_[_0x0eb6('0x3d')](_0x407b5c[_0x0eb6('0x33')],_0x4c5e38[_0x0eb6('0x35')]));_0x2e057c['where'][_0x0eb6('0x4e')]=_0x529e4f['id'];if(_0x407b5c['query'][_0x0eb6('0x3e')]){_0x2e057c['where']=_[_0x0eb6('0x40')](_0x2e057c['where'],{'$or':_[_0x0eb6('0x32')](_0x2e057c[_0x0eb6('0x37')],function(_0x1c5b54){var _0x3033ed={};_0x3033ed[_0x1c5b54]={'$like':'%'+_0x407b5c['query']['filter']+'%'};return _0x3033ed;})});}_0x2e057c=_['merge']({},_0x2e057c,_0x407b5c[_0x0eb6('0x41')]);return db['CannedAnswer'][_0x0eb6('0x21')]({'where':_0x2e057c[_0x0eb6('0x3f')]})[_0x0eb6('0x13')](function(_0x3515d2){_0x1e8fc7[_0x0eb6('0x21')]=_0x3515d2;if(_0x407b5c[_0x0eb6('0x33')][_0x0eb6('0x51')]){_0x2e057c[_0x0eb6('0x42')]=[{'all':!![]}];}return db[_0x0eb6('0x57')]['findAll'](_0x2e057c);})[_0x0eb6('0x13')](function(_0x3f8c9f){_0x1e8fc7[_0x0eb6('0x53')]=_0x3f8c9f;return _0x1e8fc7;});}})[_0x0eb6('0x13')](respondWithFilteredResult(_0x4907a0,_0x2e057c))['catch'](handleError(_0x4907a0,null));};exports[_0x0eb6('0x59')]=function(_0x547bcd,_0x2b663a){return db[_0x0eb6('0x2e')]['find']({'where':{'id':_0x547bcd[_0x0eb6('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2b663a,null))['then'](function(_0x395341){if(_0x395341){return _0x395341[_0x0eb6('0x59')](_0x547bcd[_0x0eb6('0x33')][_0x0eb6('0x55')]);}})[_0x0eb6('0x13')](respondWithStatusCode(_0x2b663a,null))[_0x0eb6('0x1c')](handleError(_0x2b663a,null));};exports[_0x0eb6('0x5a')]=function(_0x518da9,_0x534a34){_0x518da9['body'][_0x0eb6('0x5b')]=_0x518da9[_0x0eb6('0x5c')][_0x0eb6('0x5d')];return db[_0x0eb6('0x2e')][_0x0eb6('0x46')]({'where':{'id':_0x518da9[_0x0eb6('0x4c')]['id']}})[_0x0eb6('0x13')](handleEntityNotFound(_0x534a34,null))[_0x0eb6('0x13')](saveUpdates(_0x518da9[_0x0eb6('0x48')],null))[_0x0eb6('0x13')](respondWithResult(_0x534a34,null))[_0x0eb6('0x1c')](handleError(_0x534a34,null));};exports['addAvatar']=function(_0x31b16f,_0x209eb7){_0x31b16f['body'][_0x0eb6('0x5e')]=_0x31b16f[_0x0eb6('0x5c')][_0x0eb6('0x5d')];return db['ChatWebsite'][_0x0eb6('0x46')]({'where':{'id':_0x31b16f['params']['id']}})[_0x0eb6('0x13')](handleEntityNotFound(_0x209eb7,null))['then'](saveUpdates(_0x31b16f[_0x0eb6('0x48')],null))['then'](respondWithResult(_0x209eb7,null))['catch'](handleError(_0x209eb7,null));};exports[_0x0eb6('0x5f')]=function(_0x16cd1d,_0x49d1cd){_0x16cd1d['body'][_0x0eb6('0x60')]=_0x16cd1d['file']['filename'];return db[_0x0eb6('0x2e')][_0x0eb6('0x46')]({'where':{'id':_0x16cd1d[_0x0eb6('0x4c')]['id']}})['then'](handleEntityNotFound(_0x49d1cd,null))[_0x0eb6('0x13')](saveUpdates(_0x16cd1d[_0x0eb6('0x48')],null))[_0x0eb6('0x13')](respondWithResult(_0x49d1cd,null))['catch'](handleError(_0x49d1cd,null));};exports[_0x0eb6('0x61')]=function(_0x46be2f,_0x3b8677){_0x46be2f[_0x0eb6('0x48')]['systemAvatar']=_0x46be2f[_0x0eb6('0x5c')][_0x0eb6('0x5d')];return db[_0x0eb6('0x2e')][_0x0eb6('0x46')]({'where':{'id':_0x46be2f[_0x0eb6('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3b8677,null))[_0x0eb6('0x13')](saveUpdates(_0x46be2f[_0x0eb6('0x48')],null))[_0x0eb6('0x13')](respondWithResult(_0x3b8677,null))[_0x0eb6('0x1c')](handleError(_0x3b8677,null));};exports[_0x0eb6('0x62')]=function(_0x340963,_0x5115aa){var _0x43b76d=path['join'](config[_0x0eb6('0x63')],_0x0eb6('0x64'));var _0x1c4370={'where':{'id':_0x340963['params']['id']},'attributes':['id',_0x0eb6('0x5b')],'raw':!![]};var _0x262a44=![];return require(_0x0eb6('0x65'))[_0x0eb6('0x66')]()[_0x0eb6('0x13')](function(_0xddc839){if(_0xddc839){_0x262a44=_0xddc839[_0x0eb6('0x67')];}})['then'](function(){return db[_0x0eb6('0x2e')]['find'](_0x1c4370);})[_0x0eb6('0x13')](handleEntityNotFound(_0x5115aa,null))['then'](function(_0x1e1205){if(_0x1e1205){if(!_['isNil'](_0x1e1205[_0x0eb6('0x5b')])){if(fs[_0x0eb6('0x68')](path[_0x0eb6('0x69')](config[_0x0eb6('0x63')],_0x0eb6('0x6a'),_0x1e1205[_0x0eb6('0x5b')]))&&_0x262a44){_0x43b76d=path['join'](config[_0x0eb6('0x63')],'server/files/images/logos/',_0x1e1205[_0x0eb6('0x5b')]);}}return _0x5115aa[_0x0eb6('0x6b')](_0x43b76d);}})[_0x0eb6('0x1c')](handleError(_0x5115aa,null));};exports[_0x0eb6('0x6c')]=function(_0x26755a,_0x341e23){var _0x259adf=path[_0x0eb6('0x69')](config['root'],_0x0eb6('0x6d'));var _0x2259c8={'where':{'id':_0x26755a[_0x0eb6('0x4c')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x0eb6('0x2e')][_0x0eb6('0x46')](_0x2259c8)[_0x0eb6('0x13')](handleEntityNotFound(_0x341e23,null))['then'](function(_0x3fe773){if(_0x3fe773){if(!_[_0x0eb6('0x6e')](_0x3fe773['agentAvatar'])){if(fs[_0x0eb6('0x68')](path[_0x0eb6('0x69')](config['root'],_0x0eb6('0x6f'),_0x3fe773['agentAvatar']))){_0x259adf=path[_0x0eb6('0x69')](config[_0x0eb6('0x63')],_0x0eb6('0x6f'),_0x3fe773[_0x0eb6('0x5e')]);}}return _0x341e23[_0x0eb6('0x6b')](_0x259adf);}})[_0x0eb6('0x1c')](handleError(_0x341e23,null));};exports[_0x0eb6('0x70')]=function(_0x20f149,_0xe248b8){var _0x56990a=path[_0x0eb6('0x69')](config['root'],_0x0eb6('0x71'));var _0x1bc55f={'where':{'id':_0x20f149[_0x0eb6('0x4c')]['id']},'attributes':['id',_0x0eb6('0x60'),_0x0eb6('0x72')],'raw':!![]};return db[_0x0eb6('0x2e')][_0x0eb6('0x46')](_0x1bc55f)['then'](handleEntityNotFound(_0xe248b8,null))[_0x0eb6('0x13')](function(_0x2b5971){if(_0x2b5971){if(!_[_0x0eb6('0x6e')](_0x2b5971[_0x0eb6('0x60')])){if(fs[_0x0eb6('0x68')](path[_0x0eb6('0x69')](config[_0x0eb6('0x63')],_0x0eb6('0x6f'),_0x2b5971[_0x0eb6('0x60')]))&&_0x2b5971['showCustomerAvatar']){_0x56990a=path['join'](config['root'],_0x0eb6('0x6f'),_0x2b5971[_0x0eb6('0x60')]);}}return _0xe248b8[_0x0eb6('0x6b')](_0x56990a);}})[_0x0eb6('0x1c')](handleError(_0xe248b8,null));};exports[_0x0eb6('0x73')]=function(_0x3849bd,_0xe774ca){var _0x583a29=path['join'](config['root'],_0x0eb6('0x74'));var _0x330531={'where':{'id':_0x3849bd[_0x0eb6('0x4c')]['id']},'attributes':['id',_0x0eb6('0x75')],'raw':!![]};return db['ChatWebsite'][_0x0eb6('0x46')](_0x330531)[_0x0eb6('0x13')](handleEntityNotFound(_0xe774ca,null))[_0x0eb6('0x13')](function(_0x4b69dc){if(_0x4b69dc){if(!_[_0x0eb6('0x6e')](_0x4b69dc[_0x0eb6('0x75')])){if(fs[_0x0eb6('0x68')](path[_0x0eb6('0x69')](config[_0x0eb6('0x63')],'server/files/images/avatars/',_0x4b69dc[_0x0eb6('0x75')]))){_0x583a29=path[_0x0eb6('0x69')](config['root'],_0x0eb6('0x6f'),_0x4b69dc[_0x0eb6('0x75')]);}}return _0xe774ca[_0x0eb6('0x6b')](_0x583a29);}})['catch'](handleError(_0xe774ca,null));};exports[_0x0eb6('0x76')]=function(_0x5dab6e,_0x2827c0){var _0x5787a3=require(_0x0eb6('0x77'));var _0x1db7c6=new _0x5787a3();var _0x3aeeb6=_0x1db7c6[_0x0eb6('0x78')](_0x5dab6e[_0x0eb6('0x79')][_0x0eb6('0x7a')])[_0x0eb6('0x7b')]();var _0x120843={'body':_0x5dab6e['body'],'channel':_0x0eb6('0x7c')};var _0x1551ce=[];var _0x2f46ac=[];var _0x3e856e={};var _0x40582c=![];return db[_0x0eb6('0x7d')][_0x0eb6('0x4d')]()[_0x0eb6('0x13')](function(_0x4d8e29){if(!_0x4d8e29){throw new db['Sequelize'][(_0x0eb6('0x7e'))](_0x0eb6('0x7f'));}_0x1551ce=_[_0x0eb6('0x80')](_[_0x0eb6('0x34')](_0x4d8e29),[_0x0eb6('0x81'),'updatedAt']);_0x2f46ac=_['difference'](_[_0x0eb6('0x34')](_0x4d8e29),[_0x0eb6('0x81'),_0x0eb6('0x82'),_0x0eb6('0x83'),_0x0eb6('0x84')]);if(_0x5dab6e[_0x0eb6('0x48')]['id']){delete _0x5dab6e[_0x0eb6('0x48')]['id'];}if(_['isNil'](_0x5dab6e['body'][_0x0eb6('0x85')])){throw new db[(_0x0eb6('0x86'))][(_0x0eb6('0x7e'))](_0x0eb6('0x87'));}if(_[_0x0eb6('0x6e')](_0x5dab6e[_0x0eb6('0x48')][_0x0eb6('0x48')])||_0x5dab6e[_0x0eb6('0x48')]['body']===''){throw new db['Sequelize'][(_0x0eb6('0x7e'))](_0x0eb6('0x88'));}if(_[_0x0eb6('0x6e')](_0x5dab6e[_0x0eb6('0x48')][_0x0eb6('0x89')])){throw new db['Sequelize'][(_0x0eb6('0x7e'))](_0x0eb6('0x8a')+_0x2f46ac);}if(!_[_0x0eb6('0x8b')](_0x2f46ac,_0x5dab6e['body']['mapKey'])){throw new db[(_0x0eb6('0x86'))][(_0x0eb6('0x7e'))](_0x0eb6('0x8c')+_0x2f46ac);}_0x3e856e[_0x5dab6e[_0x0eb6('0x48')][_0x0eb6('0x89')]]=_0x5dab6e[_0x0eb6('0x48')][_0x0eb6('0x85')];})[_0x0eb6('0x13')](function(){return db[_0x0eb6('0x2e')][_0x0eb6('0x46')]({'where':{'id':_0x5dab6e[_0x0eb6('0x4c')]['id']},'include':[{'model':db['CmList'],'as':_0x0eb6('0x8d'),'include':[{'model':db['CmContact'],'as':_0x0eb6('0x8e'),'where':_0x3e856e,'limit':0x1,'order':[[_0x0eb6('0x82'),_0x0eb6('0x8f')]]}]},{'model':db[_0x0eb6('0x90')],'as':'Applications'}]});})[_0x0eb6('0x13')](handleEntityNotFound(_0x2827c0,null))[_0x0eb6('0x13')](function(_0x93e277){if(_0x93e277&&_0x93e277[_0x0eb6('0x8d')]){_0x120843['account']=_0x93e277;_0x120843[_0x0eb6('0x91')]=_0x93e277['Applications'];_0x120843[_0x0eb6('0x92')]=_0x93e277[_0x0eb6('0x8d')];_0x120843[_0x0eb6('0x91')]=_[_0x0eb6('0x93')](_0x120843[_0x0eb6('0x91')],[_0x0eb6('0x94')],[_0x0eb6('0x95')]);if(_0x120843[_0x0eb6('0x96')][_0x0eb6('0x97')]){delete _0x120843[_0x0eb6('0x96')]['Applications'];}if(_0x120843[_0x0eb6('0x96')][_0x0eb6('0x8d')]&&_0x120843[_0x0eb6('0x96')][_0x0eb6('0x8d')][_0x0eb6('0x8e')][_0x0eb6('0x39')]){return _0x120843[_0x0eb6('0x96')][_0x0eb6('0x8d')][_0x0eb6('0x8e')][0x0];}var _0x1906af=_[_0x0eb6('0xc')](_0x5dab6e['body'],{'firstName':_0x5dab6e[_0x0eb6('0x48')]['from'],'ListId':_0x93e277[_0x0eb6('0x84')]});_0x1906af[_0x5dab6e[_0x0eb6('0x48')]['mapKey']]=_0x5dab6e[_0x0eb6('0x48')]['from'];return db['CmContact'][_0x0eb6('0x47')](_0x1906af,{'fields':_0x1551ce,'raw':!![]});}})['then'](handleEntityNotFound(_0x2827c0,null))[_0x0eb6('0x13')](function(_0x38d771){_0x120843[_0x0eb6('0x98')]=_0x38d771;var _0x2c92ea=_0x5dab6e['body'][_0x0eb6('0x99')];if(_0x5dab6e[_0x0eb6('0x79')][_0x0eb6('0x9a')]){_0x2c92ea=_0x5dab6e[_0x0eb6('0x79')][_0x0eb6('0x9a')];}else if(_0x5dab6e[_0x0eb6('0x79')][_0x0eb6('0x9b')]){_0x2c92ea=_['first'](_0x5dab6e[_0x0eb6('0x79')]['x-forwarded-for']['split'](','));}if(_0x38d771){var _0x506aee={'ContactId':_0x38d771['id'],'ChatWebsiteId':_0x5dab6e[_0x0eb6('0x4c')]['id'],'from':(_0x38d771[_0x0eb6('0x9c')]||'')+'\x20'+(_0x38d771[_0x0eb6('0x9d')]||''),'customerIp':_0x2c92ea,'customerPort':_0x5dab6e[_0x0eb6('0x79')]['x-real-port']?_0x5dab6e[_0x0eb6('0x79')][_0x0eb6('0x9e')]:null,'referer':_0x5dab6e[_0x0eb6('0x48')]['referer'],'browserName':_0x3aeeb6[_0x0eb6('0x9f')][_0x0eb6('0x2a')]&&_0x3aeeb6[_0x0eb6('0x9f')][_0x0eb6('0xa0')]?util['format']('%s\x20%s',_0x3aeeb6['browser']['name'],_0x3aeeb6['browser'][_0x0eb6('0xa0')]):_0x0eb6('0xa1'),'browserVersion':_0x3aeeb6[_0x0eb6('0x9f')]['version']||_0x0eb6('0xa1'),'osName':util[_0x0eb6('0xa2')](_0x0eb6('0xa3'),_0x3aeeb6['os']['name'],_0x3aeeb6['os'][_0x0eb6('0xa0')]),'osVersion':_0x3aeeb6['os'][_0x0eb6('0xa0')],'deviceModel':_0x3aeeb6[_0x0eb6('0xa4')][_0x0eb6('0x31')]&&_0x3aeeb6[_0x0eb6('0xa4')][_0x0eb6('0xa5')]?util[_0x0eb6('0xa2')](_0x0eb6('0xa6'),_0x3aeeb6[_0x0eb6('0xa4')][_0x0eb6('0x31')],_0x3aeeb6[_0x0eb6('0xa4')]['vendor'],_0x3aeeb6[_0x0eb6('0xa4')][_0x0eb6('0x2f')]):null,'deviceVendor':_0x3aeeb6[_0x0eb6('0xa4')][_0x0eb6('0xa5')],'deviceType':_0x3aeeb6[_0x0eb6('0xa4')][_0x0eb6('0x2f')],'formData':JSON['stringify'](_0x5dab6e['body'])};var _0xbcbee3={'ChatWebsiteId':_0x5dab6e[_0x0eb6('0x4c')]['id'],'closed':![]};if(_0x5dab6e[_0x0eb6('0x48')][_0x0eb6('0xa7')]){_0xbcbee3['threadId']=_0x5dab6e['body'][_0x0eb6('0xa7')];return db['ChatInteraction'][_0x0eb6('0x46')]({'where':_0xbcbee3})[_0x0eb6('0x13')](function(_0x2228dc){if(_0x2228dc){return[_0x2228dc,![]];}_0x506aee[_0x0eb6('0xa7')]=_0x5dab6e[_0x0eb6('0x48')][_0x0eb6('0xa7')];_0x506aee[_0x0eb6('0xa8')]=_0x5dab6e['body'][_0x0eb6('0xa8')];return db[_0x0eb6('0xa9')][_0x0eb6('0x47')](_0x506aee)[_0x0eb6('0x13')](function(_0x316c96){return[_0x316c96,!![]];});});}_0xbcbee3[_0x0eb6('0xaa')]=_0x38d771['id'];if(_0x5dab6e[_0x0eb6('0x48')]['interaction']&&_0x5dab6e['body'][_0x0eb6('0xab')]['id']){_0xbcbee3['id']=_0x5dab6e[_0x0eb6('0x48')][_0x0eb6('0xab')]['id'];return db[_0x0eb6('0xa9')][_0x0eb6('0x46')]({'where':_0xbcbee3})[_0x0eb6('0x13')](function(_0x2066e2){if(_0x2066e2){return[_0x2066e2,![]];}return db['ChatInteraction'][_0x0eb6('0x47')](_0x506aee)[_0x0eb6('0x13')](function(_0x15becb){return[_0x15becb,!![]];});});}return db['ChatInteraction']['create'](_0x506aee)[_0x0eb6('0x13')](function(_0xe73e24){return[_0xe73e24,!![]];});}})['spread'](function(_0x15317d,_0x8e72cf){if(_0x15317d){_0x40582c=_0x8e72cf;if(!_0x8e72cf){var _0x418d2e={'from':(_0x120843['contact'][_0x0eb6('0x9c')]||'')+'\x20'+(_0x120843[_0x0eb6('0x98')]['lastName']||'')};if(_0x5dab6e[_0x0eb6('0x48')]['threadId']&&_0x5dab6e[_0x0eb6('0x48')][_0x0eb6('0xac')]&&_0x5dab6e[_0x0eb6('0x48')][_0x0eb6('0xa7')]!=_0x5dab6e[_0x0eb6('0x48')][_0x0eb6('0xac')]){_0x418d2e[_0x0eb6('0xa7')]=_0x5dab6e[_0x0eb6('0x48')][_0x0eb6('0xac')];}return _0x15317d[_0x0eb6('0x24')](_0x418d2e);}else{return _0x15317d;}}})[_0x0eb6('0x13')](function(_0x457671){_0x120843[_0x0eb6('0xab')]=_0x457671[_0x0eb6('0x26')]({'plain':!![]});_0x120843[_0x0eb6('0xab')][_0x0eb6('0xad')]=_0x40582c;if(_0x120843['interaction'][_0x0eb6('0xad')]){if(_0x120843['account']['autoclose']){_0x120843[_0x0eb6('0x91')]['push']({'id':0x0,'priority':_0x120843['applications'][_0x0eb6('0x39')]+0x1,'app':_0x0eb6('0xae'),'appdata':_0x0eb6('0xaf'),'interval':_0x0eb6('0xb0')});}}return db[_0x0eb6('0xb1')][_0x0eb6('0x47')]({'body':_0x5dab6e[_0x0eb6('0x48')][_0x0eb6('0x48')],'ChatWebsiteId':_0x5dab6e[_0x0eb6('0x4c')]['id'],'ChatInteractionId':_0x457671['id'],'direction':'in','ContactId':_0x120843[_0x0eb6('0x98')]['id'],'AttachmentId':_0x5dab6e[_0x0eb6('0x48')][_0x0eb6('0xb2')]});})[_0x0eb6('0x13')](function(_0x14b7f6){_0x120843[_0x0eb6('0x1a')]=_0x14b7f6;if(_0x120843[_0x0eb6('0xab')][_0x0eb6('0xb3')]){return db[_0x0eb6('0xb4')][_0x0eb6('0x46')]({'attributes':['id',_0x0eb6('0x2a')],'where':{'id':_0x120843['interaction']['UserId']}})[_0x0eb6('0x13')](function(_0x5df035){if(_0x5df035){_0x120843['applications'][_0x0eb6('0xb5')]({'id':0x0,'priority':0x0,'app':_0x0eb6('0xb6'),'appdata':_0x5df035[_0x0eb6('0x2a')]+','+(_0x120843[_0x0eb6('0x96')]['waitForTheAssignedAgent']||0xa),'interval':_0x0eb6('0xb0')});_0x120843['forcedOwnership']=!![];}return respondWithRpcPromise(_0x0eb6('0xb7'),_0x0eb6('0xb8'),_0x120843);});}return respondWithRpcPromise('Start',_0x0eb6('0xb8'),_0x120843);})[_0x0eb6('0x13')](function(_0xfaa49){respondWithRpcPromise(_0x0eb6('0xb9'),'EventManager',{'event':_0x0eb6('0x76'),'message':_0xfaa49},client9002);return _0xfaa49;})[_0x0eb6('0x13')](respondWithResult(_0x2827c0,null))[_0x0eb6('0x1c')](handleError(_0x2827c0,null));};exports[_0x0eb6('0xba')]=function(_0x51f686,_0x24055a){var _0x52f407,_0x29ffab,_0x3562c4;var _0x3513fc=[];var _0x2135a8={};var _0x312322=_0x51f686[_0x0eb6('0xbb')]||[];var _0xf4aae4=[];var _0x178968;return db[_0x0eb6('0x7d')][_0x0eb6('0x4d')]()['then'](function(_0x188494){if(!_0x188494){throw new db[(_0x0eb6('0x86'))][(_0x0eb6('0x7e'))](_0x0eb6('0x7f'));}_0x3513fc=_['difference'](_[_0x0eb6('0x34')](_0x188494),[_0x0eb6('0x81'),'updatedAt',_0x0eb6('0x83'),_0x0eb6('0x84')]);if(_0x51f686['body']['id']){delete _0x51f686['body']['id'];}if(_[_0x0eb6('0x6e')](_0x51f686[_0x0eb6('0x48')][_0x0eb6('0x85')])){throw _0x24055a[_0x0eb6('0x1e')](0x1f4)['send'](new db[(_0x0eb6('0x86'))][(_0x0eb6('0x7e'))](_0x0eb6('0x87')));}if(_['isNil'](_0x51f686[_0x0eb6('0x48')]['body'])||_0x51f686[_0x0eb6('0x48')]['body']===''){throw _0x24055a[_0x0eb6('0x1e')](0x1f4)[_0x0eb6('0x2b')](new db[(_0x0eb6('0x86'))][(_0x0eb6('0x7e'))](_0x0eb6('0x88')));}if(_[_0x0eb6('0x6e')](_0x51f686['body'][_0x0eb6('0xbc')])){throw _0x24055a['status'](0x1f4)[_0x0eb6('0x2b')](new db['Sequelize']['ValidationError'](_0x0eb6('0xbd')+_0x3513fc));}if(!_['includes'](_0x3513fc,_0x51f686[_0x0eb6('0x48')][_0x0eb6('0xbc')])){throw _0x24055a[_0x0eb6('0x1e')](0x1f4)[_0x0eb6('0x2b')](new db[(_0x0eb6('0x86'))][(_0x0eb6('0x7e'))](_0x0eb6('0xbe')+_0x3513fc));}_0x2135a8[_0x51f686['body'][_0x0eb6('0xbc')]]=_0x51f686['body'][_0x0eb6('0x85')];})[_0x0eb6('0x13')](function(){return db[_0x0eb6('0x2e')][_0x0eb6('0x46')]({'where':{'id':_0x51f686[_0x0eb6('0x4c')]['id']},'include':[{'model':db[_0x0eb6('0xbf')],'as':_0x0eb6('0x8d')},{'model':db['MailAccount'],'as':_0x0eb6('0xc0')}]});})[_0x0eb6('0x13')](handleEntityNotFound(_0x24055a,null))[_0x0eb6('0x13')](function(_0xa641cb){if(_0xa641cb&&_0xa641cb[_0x0eb6('0x8d')]){_0x29ffab=_0xa641cb;var _0xd5b127=_[_0x0eb6('0xc')](_0x51f686[_0x0eb6('0x48')],{'firstName':_0x51f686[_0x0eb6('0x48')][_0x0eb6('0x85')],'phone':_0x51f686[_0x0eb6('0x48')][_0x0eb6('0x85')],'ListId':_0xa641cb[_0x0eb6('0x84')]});_0xd5b127[_0x51f686[_0x0eb6('0x48')]['mapKeyOffline']]=_0x51f686[_0x0eb6('0x48')][_0x0eb6('0x85')];return db[_0x0eb6('0x7d')][_0x0eb6('0xc1')]({'where':_0x2135a8,'defaults':_0xd5b127});}})['spread'](function(_0x2055e5){if(_0x2055e5){_0x3562c4=_0x2055e5;var _0x185fcf=fs[_0x0eb6('0xc2')](path[_0x0eb6('0x69')](config['root'],_0x0eb6('0xc3')),'utf8');var _0x19f990=ejs[_0x0eb6('0xc4')](_0x185fcf,{'body':_[_0x0eb6('0xc5')](_0x51f686[_0x0eb6('0x48')][_0x0eb6('0x48')]),'bodyTitle':_0x29ffab[_0x0eb6('0xc6')]});return db[_0x0eb6('0xc7')][_0x0eb6('0x47')]({'body':_0x19f990,'ContactId':_0x2055e5['id'],'ChatWebsiteId':_0x29ffab['id']});}})[_0x0eb6('0x13')](function(_0x48428d){_0x178968=_0x48428d;if(_0x312322['length']){var _0x5bbe6a=_0x312322[_0x0eb6('0x32')](function(_0x27af42){return{'name':_0x27af42[_0x0eb6('0xc8')],'basename':_0x27af42[_0x0eb6('0x5d')],'type':_0x27af42[_0x0eb6('0xc9')],'ChatOfflineMessageId':_0x48428d['id']};});_0xf4aae4=_0x5bbe6a['map'](_0x486d83=>{var _0x473995={'filename':_0x486d83[_0x0eb6('0x2a')],'path':path[_0x0eb6('0x69')](config['root'],_0x0eb6('0xca'),_0x0eb6('0xbb'),'attachments',_0x0eb6('0xcb'),_0x486d83['basename'])};return _0x473995;});if(!_0x29ffab['openNewInteraction']){return db[_0x0eb6('0xcc')][_0x0eb6('0xcd')](function(_0x5d3667){return db['Attachment']['bulkCreate'](_0x5bbe6a,{'transaction':_0x5d3667});});}}})['then'](function(){if(_0x178968){_0x52f407=_0x178968;return db[_0x0eb6('0xc0')][_0x0eb6('0x50')]({'where':{'active':!![]},'include':[{'model':db[_0x0eb6('0xce')],'as':'Smtp','raw':!![]}]});}})['then'](function(_0x220def){if(_0x220def&&_0x220def['Smtp']&&_0x29ffab[_0x0eb6('0xcf')]&&_0x29ffab['forwardOfflineAddress']){var _0x2a476d={'tls':{'rejectUnauthorized':![]}};if(_0x220def[_0x0eb6('0xd0')][_0x0eb6('0xd1')]){_0x2a476d[_0x0eb6('0xd1')]=_0x220def[_0x0eb6('0xd0')][_0x0eb6('0xd1')];}else{_0x2a476d[_0x0eb6('0xd2')]=_0x220def[_0x0eb6('0xd0')]['host'];_0x2a476d['port']=_0x220def[_0x0eb6('0xd0')][_0x0eb6('0xd3')];_0x2a476d['secure']=_0x220def[_0x0eb6('0xd0')]['secure'];}if(_0x220def[_0x0eb6('0xd0')][_0x0eb6('0xd4')]){_0x2a476d['auth']={'user':_0x220def[_0x0eb6('0xd0')]['user'],'pass':_0x220def['Smtp'][_0x0eb6('0xd5')]};}return respondWithRpcPromise(_0x0eb6('0xd6'),_0x0eb6('0xd7'),{'account':_0x2a476d,'message':{'from':util[_0x0eb6('0xa2')](_0x0eb6('0xd8'),_0x220def[_0x0eb6('0x2a')],_0x220def[_0x0eb6('0xd9')]||_0x220def[_0x0eb6('0xd0')][_0x0eb6('0x49')]),'to':_0x29ffab[_0x0eb6('0xda')],'subject':_0x29ffab[_0x0eb6('0xdb')],'html':_0x52f407['body'],'attachments':_0xf4aae4}},client9003)[_0x0eb6('0x13')](function(){return _0x52f407;})['catch'](function(_0x54f5e5){console[_0x0eb6('0x18')](_0x54f5e5);});}})[_0x0eb6('0x13')](function(){if(_0x29ffab&&_0x29ffab[_0x0eb6('0xdc')]&&_0x29ffab[_0x0eb6('0xdd')]){var _0x4c9be1=[];if(_0x312322[_0x0eb6('0x39')]){_0x4c9be1=_0x312322['map'](function(_0x32e415){return{'name':_0x32e415[_0x0eb6('0xc8')],'basename':_0x32e415[_0x0eb6('0x5d')],'type':_0x32e415[_0x0eb6('0xc9')],'ChatOfflineMessageId':_0x178968['id']};});}var _0x441674;if(!_[_0x0eb6('0x6e')](_0x29ffab['subjectOffline'])){var _0x12bd3a=_[_0x0eb6('0x32')](_0x51f686[_0x0eb6('0x48')],function(_0x45e5a5){return _0x45e5a5;});var _0x498978=_[_0x0eb6('0xde')](_0x12bd3a)[0x0];var _0x13ff17=_[_0x0eb6('0xdf')](_0x498978,function(_0x6eda9){return _0x6eda9;});_0x441674=_0x13ff17[0x1][_0x29ffab[_0x0eb6('0xe0')]];}var _0x4590fb={'from':_0x3562c4[_0x0eb6('0xd9')],'firstName':_0x3562c4[_0x0eb6('0x9c')],'lastName':_0x3562c4['lastName'],'mapKey':'email','message':{'from':_0x3562c4['email'],'to':_0x29ffab['MailAccount'][_0x0eb6('0xd9')],'cc':'','subject':_['isNil'](_0x441674)?_0x29ffab['offlineMessageSubject']:_0x441674,'messageId':'','sentAt':new Date(),'attach':_0x4c9be1[_0x0eb6('0x39')],'attachments':_0x4c9be1,'originChannel':_0x0eb6('0xe1'),'ChatWebsiteId':_0x29ffab['id'],'ChatOfflineMessageId':_0x52f407['id'],'originTo':_0x29ffab[_0x0eb6('0xc0')][_0x0eb6('0xd9')]},'body':_0x52f407[_0x0eb6('0x48')]};var _0x23a36f={'account':{'id':_0x29ffab[_0x0eb6('0xdd')]},'body':_0x4590fb,'log':_0x0eb6('0xe2')};return respondWithRpcPromise(_0x0eb6('0xe2'),_0x0eb6('0xe3'),_0x23a36f,client9001)[_0x0eb6('0x13')](function(){return _0x52f407;})[_0x0eb6('0x1c')](function(_0x35f11d){console[_0x0eb6('0x18')](_0x35f11d);});}return;})[_0x0eb6('0x13')](function(){if(_0x52f407){return _0x52f407;}})[_0x0eb6('0x13')](respondWithResult(_0x24055a,null))[_0x0eb6('0x1c')](function(_0x1b06be){console[_0x0eb6('0x18')](_0x0eb6('0x1c'),_0x1b06be);for(var _0x399acc of _0x312322){var _0x2703bb=path[_0x0eb6('0x69')](config['root'],_0x0eb6('0xca'),'files',_0x0eb6('0xe4'),'offline-chat',_0x399acc[_0x0eb6('0x5d')]);fs_extra[_0x0eb6('0xe5')](_0x2703bb)[_0x0eb6('0x1c')](function(_0x19bded){console[_0x0eb6('0x18')](_0x0eb6('0xe6'),_0x2703bb,_0x19bded);});}});};exports[_0x0eb6('0xe7')]=function(_0x1f46d8,_0x250f62){return db[_0x0eb6('0xa9')][_0x0eb6('0x46')]({'where':{'id':_0x1f46d8[_0x0eb6('0x4c')]['id']}})['then'](handleEntityNotFound(_0x250f62,null))[_0x0eb6('0x13')](function(_0x3b6e2c){if(_0x3b6e2c){return _0x3b6e2c[_0x0eb6('0xe7')](_0x1f46d8['body'][_0x0eb6('0x55')],_['omit'](_0x1f46d8[_0x0eb6('0x48')],[_0x0eb6('0x55'),'id'])||{});}})[_0x0eb6('0x13')](respondWithResult(_0x250f62,null))[_0x0eb6('0x1c')](handleError(_0x250f62,null));};exports['getInteractions']=function(_0x39e8e5,_0x599b9d){var _0x4dc738={'raw':![],'where':{}};var _0x3a7803={};var _0x2961b4={'count':0x0,'rows':[]};return db[_0x0eb6('0x2e')]['findOne']({'where':{'id':_0x39e8e5['params']['id']}})[_0x0eb6('0x13')](handleEntityNotFound(_0x599b9d,null))[_0x0eb6('0x13')](function(_0x8689ac){if(_0x8689ac){_0x3a7803['model']=_[_0x0eb6('0x34')](db['ChatInteraction'][_0x0eb6('0x45')]);_0x3a7803[_0x0eb6('0x33')]=_[_0x0eb6('0x34')](_0x39e8e5[_0x0eb6('0x33')]);_0x3a7803[_0x0eb6('0x35')]=_[_0x0eb6('0x36')](_0x3a7803[_0x0eb6('0x31')],_0x3a7803[_0x0eb6('0x33')]);_0x4dc738[_0x0eb6('0x37')]=_['intersection'](_0x3a7803[_0x0eb6('0x31')],qs[_0x0eb6('0x38')](_0x39e8e5[_0x0eb6('0x33')]['fields']));_0x4dc738[_0x0eb6('0x37')]=_0x4dc738[_0x0eb6('0x37')][_0x0eb6('0x39')]?_0x4dc738['attributes']:_0x3a7803[_0x0eb6('0x31')];if(!_0x39e8e5['query']['hasOwnProperty'](_0x0eb6('0x3b'))){_0x4dc738[_0x0eb6('0x22')]=qs[_0x0eb6('0x22')](_0x39e8e5['query'][_0x0eb6('0x22')]);_0x4dc738[_0x0eb6('0x1f')]=qs['offset'](_0x39e8e5[_0x0eb6('0x33')][_0x0eb6('0x1f')]);}_0x4dc738['order']=qs[_0x0eb6('0x3c')](_0x39e8e5[_0x0eb6('0x33')][_0x0eb6('0x3c')]);_0x4dc738[_0x0eb6('0x3f')]=qs[_0x0eb6('0x35')](_[_0x0eb6('0x3d')](_0x39e8e5['query'],_0x3a7803[_0x0eb6('0x35')]));_0x4dc738[_0x0eb6('0x3f')]['ChatWebsiteId']=_0x8689ac['id'];if(_0x39e8e5[_0x0eb6('0x33')]['filter']){_0x4dc738[_0x0eb6('0x3f')]=_[_0x0eb6('0x40')](_0x4dc738[_0x0eb6('0x3f')],{'$or':_[_0x0eb6('0x32')](_0x4dc738['attributes'],function(_0xde4714){var _0x13246a={};_0x13246a[_0xde4714]={'$like':'%'+_0x39e8e5[_0x0eb6('0x33')]['filter']+'%'};return _0x13246a;})});}_0x4dc738=_['merge']({},_0x4dc738,_0x39e8e5[_0x0eb6('0x41')]);return db['ChatInteraction']['count']({'where':_0x4dc738[_0x0eb6('0x3f')]})[_0x0eb6('0x13')](function(_0x52b8e0){_0x2961b4[_0x0eb6('0x21')]=_0x52b8e0;if(_0x39e8e5[_0x0eb6('0x33')][_0x0eb6('0x51')]){_0x4dc738['include']=[{'model':db[_0x0eb6('0x7d')],'as':'Contact','required':![]},{'model':db[_0x0eb6('0xb4')],'as':'Owner','attributes':[_0x0eb6('0x2a'),'fullname',_0x0eb6('0xe8')],'required':![]},{'model':db[_0x0eb6('0xe9')],'as':_0x0eb6('0xea'),'attributes':['id','name',_0x0eb6('0xeb')],'where':_0x39e8e5[_0x0eb6('0x33')][_0x0eb6('0xec')]?{'id':_0x39e8e5['query'][_0x0eb6('0xec')]}:undefined,'required':_0x39e8e5[_0x0eb6('0x33')][_0x0eb6('0xec')]?!![]:![]}];}return db['ChatInteraction'][_0x0eb6('0x52')](_0x4dc738);})['then'](function(_0xfe3c7a){_0x2961b4[_0x0eb6('0x53')]=_0xfe3c7a;return _0x2961b4;});}})[_0x0eb6('0x13')](respondWithFilteredResult(_0x599b9d,_0x4dc738))['catch'](handleError(_0x599b9d,null));};function iftimePromise(_0x54204c,_0x5b5881){return respondWithRpcPromise(_0x0eb6('0xed'),_0x0eb6('0xee'),{'command':_0x5b5881['timezone']?util['format'](_0x0eb6('0xef'),_0x54204c['interval'],_0x5b5881['timezone']):util[_0x0eb6('0xa2')]('iftime\x20%s',_0x54204c['interval'])},client9002)[_0x0eb6('0x13')](function(_0x517da7){var _0x3bf1ea=_0x517da7&&_0x517da7[_0x0eb6('0xf0')](_0x0eb6('0xf1'))>=0x0?!![]:![];logger[_0x0eb6('0x14')](_0x0eb6('0xf2'),_0x5b5881['id'],_0x54204c['id'],_0x54204c['interval'],_0x3bf1ea?_0x0eb6('0xf3'):_0x0eb6('0xf4'),_0x5b5881[_0x0eb6('0xf5')]?_0x5b5881[_0x0eb6('0xf5')]:_0x0eb6('0xf6'));return _0x3bf1ea;})[_0x0eb6('0x1c')](function(_0xed400){logger[_0x0eb6('0x18')](_0x0eb6('0xf2'),_0x5b5881['id'],_0x54204c['id'],_0x54204c[_0x0eb6('0xf7')],util[_0x0eb6('0xf8')](_0xed400,{'showHidden':![],'depth':null}),_0x5b5881['timezone']?_0x5b5881['timezone']:_0x0eb6('0xf6'));return![];});}exports['getSnippet']=function(_0x3a140e,_0x54b58a){var _0x552d99=0x0;var _0x3349e0=0x0;var _0x5165fc=![];var _0x65a91e;var _0x488941;return db[_0x0eb6('0x2e')][_0x0eb6('0x46')]({'where':{'id':_0x3a140e[_0x0eb6('0x4c')]['id']},'include':[{'model':db['Interval'],'as':_0x0eb6('0xf9'),'include':[{'model':db[_0x0eb6('0xf9')],'as':_0x0eb6('0xfa'),'attributes':['id',_0x0eb6('0xf7')],'raw':!![]}]}]})[_0x0eb6('0x13')](handleEntityNotFound(_0x54b58a,null))[_0x0eb6('0x13')](function(_0x43a456){if(_0x43a456){_0x65a91e=_0x43a456;return _0x43a456[_0x0eb6('0xfb')]({'raw':!![]});}})[_0x0eb6('0x13')](function(_0xd4161b){if(_0x65a91e){if(_0xd4161b){_0x488941=_0xd4161b;}}return require(_0x0eb6('0x65'))[_0x0eb6('0x66')]();})[_0x0eb6('0x13')](function(_0x29c06c){if(_0x29c06c){_0x3349e0=_0x29c06c[_0x0eb6('0xfc')];_0x5165fc=_0x29c06c[_0x0eb6('0x67')];}})[_0x0eb6('0x13')](function(){return db[_0x0eb6('0xa9')][_0x0eb6('0x21')]({'where':{'closed':![]}});})[_0x0eb6('0x13')](function(_0x34c650){_0x552d99=_0x34c650;if(_0x3349e0&&_0x34c650>_0x3349e0){return db['License'][_0x0eb6('0x50')]({'where':{'id':0x1}})['then'](function(_0x185bf1){if(_0x185bf1){_0x185bf1[_0x0eb6('0xfd')](_0x0eb6('0xfe'));}});}})['then'](function(){if(_0x65a91e[_0x0eb6('0xf9')]&&_0x65a91e[_0x0eb6('0xf9')][_0x0eb6('0xfa')]){var _0x18c2ed=[];for(var _0x4c7e2f=0x0;_0x4c7e2f<_0x65a91e[_0x0eb6('0xf9')][_0x0eb6('0xfa')][_0x0eb6('0x39')];_0x4c7e2f++){var _0x270a3f=_0x65a91e[_0x0eb6('0xf9')]['Intervals'][_0x4c7e2f][_0x0eb6('0x26')]({'plain':!![]});_0x18c2ed[_0x0eb6('0xff')](iftimePromise(_0x270a3f,_0x65a91e));}return BPromise[_0x0eb6('0x100')](_0x18c2ed)[_0x0eb6('0x13')](function(_0x327d88){return _[_0x0eb6('0x101')](_0x327d88);});}else{return!![];}})[_0x0eb6('0x13')](function(_0x5a9888){var _0x47189b=fs['readFileSync'](path[_0x0eb6('0x69')](config['root'],_0x0eb6('0x102')),_0x0eb6('0x103'));var _0x2f43e5={'remote':_0x65a91e[_0x0eb6('0x104')],'query':querystring[_0x0eb6('0x17')](_[_0x0eb6('0x40')](_0x65a91e[_0x0eb6('0x26')]({'plain':!![]}),{'customerIp':_0x3a140e[_0x0eb6('0x79')][_0x0eb6('0x9b')]||_0x3a140e[_0x0eb6('0x79')]['x-real-ip']||_0x3a140e['connection']['remoteAddress']||_0x3a140e['ip'],'referer':_0x3a140e['headers'][_0x0eb6('0x105')],'openedInteractions':_0x552d99,'maxInteractions':_0x3349e0,'virtual':_0x5165fc[_0x0eb6('0xfc')],'online':_0x5a9888,'custom':_0x5165fc}))['replace'](/'/g,'\x5c\x27')};_0x54b58a[_0x0eb6('0x2b')](ejs[_0x0eb6('0xc4')](Mustache['render'](_0x47189b,_0x2f43e5),{'proactiveActions':_0x488941,'alignment':_0x65a91e[_0x0eb6('0x106')],'verticalAlignment':_0x65a91e[_0x0eb6('0x107')],'div_color':_0x65a91e[_0x0eb6('0xeb')],'labelText':_0x65a91e['labelText'],'text_color':_0x65a91e[_0x0eb6('0x108')],'button_color':_0x65a91e[_0x0eb6('0x109')],'background_color':_0x65a91e[_0x0eb6('0x10a')]}));})[_0x0eb6('0x1c')](handleError(_0x54b58a,null));};exports[_0x0eb6('0x10b')]=function(_0xc64b06,_0x3e1c5a){var _0x5d2c58=_0xc64b06[_0x0eb6('0x4c')]['id'];var _0x445d5a=_0xc64b06[_0x0eb6('0x48')];var _0x39c4fc=0xc8;var _0xfe5cdf=null;return db['sequelize'][_0x0eb6('0xcd')]({'isolationLevel':db[_0x0eb6('0xcc')][_0x0eb6('0x10c')][_0x0eb6('0x10d')][_0x0eb6('0x10e')]},function(_0xc7d897){return db[_0x0eb6('0x2e')][_0x0eb6('0x50')]({'where':{'id':_0x5d2c58},'transaction':_0xc7d897})[_0x0eb6('0x13')](function(_0x4b7405){if(_0x4b7405){return db[_0x0eb6('0x90')][_0x0eb6('0x25')]({'where':{'ChatWebsiteId':_0x5d2c58},'transaction':_0xc7d897})[_0x0eb6('0x13')](function(){var _0x1d079a=_['map'](_0x445d5a,function(_0x4ecf7d){_0x4ecf7d['ChatWebsiteId']=_0x5d2c58;return _0x4ecf7d;});return db[_0x0eb6('0x90')][_0x0eb6('0x10f')](_0x1d079a,{'transaction':_0xc7d897});});}else{_0x39c4fc=0x194;_0xfe5cdf=[];}});})[_0x0eb6('0x13')](function(){if(_0x39c4fc!==0x194){return db[_0x0eb6('0x90')][_0x0eb6('0x110')]({'where':{'ChatWebsiteId':_0x5d2c58},'order':_0x0eb6('0x94')})['then'](function(_0x13ec7e){_0xfe5cdf=_0x13ec7e;});}})[_0x0eb6('0x1c')](function(_0x31f0d8){_0x39c4fc=0x1f4;logger[_0x0eb6('0x18')](_0x31f0d8[_0x0eb6('0x29')]);if(_0x31f0d8[_0x0eb6('0x2a')]){delete _0x31f0d8[_0x0eb6('0x2a')];}_0xfe5cdf=_0x31f0d8;})[_0x0eb6('0x111')](function(){if(_0xfe5cdf===null){_0x3e1c5a[_0x0eb6('0x112')](_0x39c4fc);}else{if(_0x39c4fc===0x1f4){_0x3e1c5a['status'](_0x39c4fc)['send'](_0xfe5cdf);}else{_0x3e1c5a[_0x0eb6('0x1e')](_0x39c4fc)[_0x0eb6('0x113')](_0xfe5cdf);}}});};exports[_0x0eb6('0x114')]=function(_0x5e7645,_0x4c2e8e){var _0x1a2c5b={};var _0x4ee294={};var _0x1fea5d;var _0x1909e9;return db[_0x0eb6('0x2e')][_0x0eb6('0x50')]({'where':{'id':_0x5e7645['params']['id']}})[_0x0eb6('0x13')](handleEntityNotFound(_0x4c2e8e,null))[_0x0eb6('0x13')](function(_0x3ffa36){if(_0x3ffa36){_0x1fea5d=_0x3ffa36;_0x4ee294['model']=_['keys'](db[_0x0eb6('0x90')][_0x0eb6('0x45')]);_0x4ee294[_0x0eb6('0x33')]=_[_0x0eb6('0x34')](_0x5e7645[_0x0eb6('0x33')]);_0x4ee294[_0x0eb6('0x35')]=_['intersection'](_0x4ee294[_0x0eb6('0x31')],_0x4ee294[_0x0eb6('0x33')]);_0x1a2c5b[_0x0eb6('0x37')]=_[_0x0eb6('0x36')](_0x4ee294[_0x0eb6('0x31')],qs[_0x0eb6('0x38')](_0x5e7645[_0x0eb6('0x33')][_0x0eb6('0x38')]));_0x1a2c5b[_0x0eb6('0x37')]=_0x1a2c5b[_0x0eb6('0x37')]['length']?_0x1a2c5b[_0x0eb6('0x37')]:_0x4ee294[_0x0eb6('0x31')];_0x1a2c5b['order']=qs[_0x0eb6('0x3c')](_0x5e7645[_0x0eb6('0x33')][_0x0eb6('0x3c')]);_0x1a2c5b[_0x0eb6('0x3f')]=qs[_0x0eb6('0x35')](_[_0x0eb6('0x3d')](_0x5e7645[_0x0eb6('0x33')],_0x4ee294['filters']));if(_0x5e7645['query']['filter']){_0x1a2c5b[_0x0eb6('0x3f')]=_[_0x0eb6('0x40')](_0x1a2c5b[_0x0eb6('0x3f')],{'$or':_[_0x0eb6('0x32')](_0x1a2c5b[_0x0eb6('0x37')],function(_0x306db1){var _0x528cca={};_0x528cca[_0x306db1]={'$like':'%'+_0x5e7645[_0x0eb6('0x33')][_0x0eb6('0x3e')]+'%'};return _0x528cca;})});}_0x1a2c5b=_[_0x0eb6('0x40')]({},_0x1a2c5b,_0x5e7645[_0x0eb6('0x41')]);return _0x1fea5d['getApplications'](_0x1a2c5b);}})[_0x0eb6('0x13')](function(_0x3869ef){if(_0x3869ef){_0x1909e9=_0x3869ef[_0x0eb6('0x39')];if(!_0x5e7645['query']['hasOwnProperty'](_0x0eb6('0x3b'))){_0x1a2c5b['limit']=qs[_0x0eb6('0x22')](_0x5e7645[_0x0eb6('0x33')][_0x0eb6('0x22')]);_0x1a2c5b[_0x0eb6('0x1f')]=qs[_0x0eb6('0x1f')](_0x5e7645[_0x0eb6('0x33')]['offset']);}return _0x1fea5d['getApplications'](_0x1a2c5b);}})[_0x0eb6('0x13')](function(_0x5c4171){if(_0x5c4171){return _0x5c4171?{'count':_0x1909e9,'rows':_0x5c4171}:null;}})['then'](respondWithResult(_0x4c2e8e,null))[_0x0eb6('0x1c')](handleError(_0x4c2e8e,null));};exports[_0x0eb6('0x115')]=function(_0x54df33,_0x50a73c){return db[_0x0eb6('0x116')]['find']({'where':{'id':_0x54df33['params']['id']}})[_0x0eb6('0x13')](handleEntityNotFound(_0x50a73c,null))[_0x0eb6('0x13')](function(_0x4ad502){if(_0x4ad502){return _0x4ad502[_0x0eb6('0x115')](_0x54df33[_0x0eb6('0x48')]['ids'],_[_0x0eb6('0x117')](_0x54df33[_0x0eb6('0x48')],[_0x0eb6('0x55'),'id'])||{});}})['then'](respondWithResult(_0x50a73c,null))[_0x0eb6('0x1c')](handleError(_0x50a73c,null));};exports['getProactiveActions']=function(_0x49a403,_0x2a33ff){var _0x3a5c26={};var _0x3a4e03={};var _0x1b1838;var _0x491555;return db[_0x0eb6('0x2e')][_0x0eb6('0x50')]({'where':{'id':_0x49a403[_0x0eb6('0x4c')]['id']}})[_0x0eb6('0x13')](handleEntityNotFound(_0x2a33ff,null))[_0x0eb6('0x13')](function(_0x13a0aa){if(_0x13a0aa){_0x1b1838=_0x13a0aa;_0x3a4e03[_0x0eb6('0x31')]=_[_0x0eb6('0x34')](db[_0x0eb6('0x118')][_0x0eb6('0x45')]);_0x3a4e03[_0x0eb6('0x33')]=_[_0x0eb6('0x34')](_0x49a403[_0x0eb6('0x33')]);_0x3a4e03[_0x0eb6('0x35')]=_['intersection'](_0x3a4e03[_0x0eb6('0x31')],_0x3a4e03[_0x0eb6('0x33')]);_0x3a5c26[_0x0eb6('0x37')]=_[_0x0eb6('0x36')](_0x3a4e03[_0x0eb6('0x31')],qs[_0x0eb6('0x38')](_0x49a403['query'][_0x0eb6('0x38')]));_0x3a5c26[_0x0eb6('0x37')]=_0x3a5c26[_0x0eb6('0x37')][_0x0eb6('0x39')]?_0x3a5c26[_0x0eb6('0x37')]:_0x3a4e03['model'];_0x3a5c26[_0x0eb6('0x58')]=qs['sort'](_0x49a403[_0x0eb6('0x33')][_0x0eb6('0x3c')]);_0x3a5c26[_0x0eb6('0x3f')]=qs[_0x0eb6('0x35')](_[_0x0eb6('0x3d')](_0x49a403['query'],_0x3a4e03['filters']));if(_0x49a403['query']['filter']){_0x3a5c26[_0x0eb6('0x3f')]=_['merge'](_0x3a5c26['where'],{'$or':_['map'](_0x3a5c26[_0x0eb6('0x37')],function(_0xf971f5){var _0x243fac={};_0x243fac[_0xf971f5]={'$like':'%'+_0x49a403[_0x0eb6('0x33')]['filter']+'%'};return _0x243fac;})});}_0x3a5c26=_[_0x0eb6('0x40')]({},_0x3a5c26,_0x49a403[_0x0eb6('0x41')]);return _0x1b1838[_0x0eb6('0xfb')](_0x3a5c26);}})[_0x0eb6('0x13')](function(_0x5ad5d0){if(_0x5ad5d0){_0x491555=_0x5ad5d0[_0x0eb6('0x39')];if(!_0x49a403[_0x0eb6('0x33')][_0x0eb6('0x3a')](_0x0eb6('0x3b'))){_0x3a5c26[_0x0eb6('0x22')]=qs[_0x0eb6('0x22')](_0x49a403['query']['limit']);_0x3a5c26[_0x0eb6('0x1f')]=qs[_0x0eb6('0x1f')](_0x49a403[_0x0eb6('0x33')]['offset']);}return _0x1b1838['getProactiveActions'](_0x3a5c26);}})[_0x0eb6('0x13')](function(_0x528914){if(_0x528914){return _0x528914?{'count':_0x491555,'rows':_0x528914}:null;}})[_0x0eb6('0x13')](respondWithResult(_0x2a33ff,null))[_0x0eb6('0x1c')](handleError(_0x2a33ff,null));};exports[_0x0eb6('0x119')]=function(_0x283a1d,_0x1a3824){var _0x423581=_0x283a1d['query']['online']===_0x0eb6('0x11a')?_0x0eb6('0x11b'):'onlineForm';return db[_0x0eb6('0x2e')][_0x0eb6('0x46')]({'attributes':['id',_0x423581],'where':{'id':_0x283a1d[_0x0eb6('0x4c')]['id']}})[_0x0eb6('0x13')](handleEntityNotFound(_0x1a3824,null))[_0x0eb6('0x13')](function(_0x3ce015){if(_0x3ce015){var _0x121d55=_0x3ce015[_0x423581];var _0x10518e=_0x121d55&&_0x121d55[_0x0eb6('0x11c')]?_0x121d55[_0x0eb6('0x11c')]:[];_0x1a3824[_0x0eb6('0x2b')]({'fromKey':_['isNil'](_0x121d55[_0x0eb6('0x11d')])?undefined:_0x121d55['fromKey'],'count':_0x10518e[_0x0eb6('0x39')],'rows':_0x10518e});}})[_0x0eb6('0x1c')](handleError(_0x1a3824,null));};exports[_0x0eb6('0x11e')]=function(_0x219d95,_0x31322e){var _0x1c6ff9={'raw':![],'where':{}};var _0x5804b6={};var _0x1d8923={'count':0x0,'rows':[]};return db[_0x0eb6('0x2e')][_0x0eb6('0x50')]({'where':{'id':_0x219d95[_0x0eb6('0x4c')]['id']}})[_0x0eb6('0x13')](handleEntityNotFound(_0x31322e,null))[_0x0eb6('0x13')](function(_0x478b75){if(_0x478b75){_0x5804b6['model']=_['keys'](db[_0x0eb6('0xc7')]['rawAttributes']);_0x5804b6[_0x0eb6('0x33')]=_[_0x0eb6('0x34')](_0x219d95[_0x0eb6('0x33')]);_0x5804b6[_0x0eb6('0x35')]=_[_0x0eb6('0x36')](_0x5804b6[_0x0eb6('0x31')],_0x5804b6[_0x0eb6('0x33')]);_0x1c6ff9[_0x0eb6('0x37')]=_[_0x0eb6('0x36')](_0x5804b6[_0x0eb6('0x31')],qs[_0x0eb6('0x38')](_0x219d95[_0x0eb6('0x33')][_0x0eb6('0x38')]));_0x1c6ff9[_0x0eb6('0x37')]=_0x1c6ff9[_0x0eb6('0x37')][_0x0eb6('0x39')]?_0x1c6ff9[_0x0eb6('0x37')]:_0x5804b6['model'];if(!_0x219d95[_0x0eb6('0x33')][_0x0eb6('0x3a')](_0x0eb6('0x3b'))){_0x1c6ff9[_0x0eb6('0x22')]=qs[_0x0eb6('0x22')](_0x219d95[_0x0eb6('0x33')][_0x0eb6('0x22')]);_0x1c6ff9['offset']=qs[_0x0eb6('0x1f')](_0x219d95[_0x0eb6('0x33')][_0x0eb6('0x1f')]);}_0x1c6ff9[_0x0eb6('0x58')]=qs[_0x0eb6('0x3c')](_0x219d95[_0x0eb6('0x33')][_0x0eb6('0x3c')]);_0x1c6ff9[_0x0eb6('0x3f')]=qs[_0x0eb6('0x35')](_[_0x0eb6('0x3d')](_0x219d95[_0x0eb6('0x33')],_0x5804b6['filters']));_0x1c6ff9[_0x0eb6('0x3f')][_0x0eb6('0x4e')]=_0x478b75['id'];if(_0x219d95[_0x0eb6('0x33')][_0x0eb6('0x3e')]){_0x1c6ff9['where']=_[_0x0eb6('0x40')](_0x1c6ff9['where'],{'$or':_[_0x0eb6('0x32')](_0x1c6ff9['attributes'],function(_0x21347c){var _0x1c04b1={};_0x1c04b1[_0x21347c]={'$like':'%'+_0x219d95[_0x0eb6('0x33')][_0x0eb6('0x3e')]+'%'};return _0x1c04b1;})});}_0x1c6ff9=_[_0x0eb6('0x40')]({},_0x1c6ff9,_0x219d95[_0x0eb6('0x41')]);return db[_0x0eb6('0xc7')]['count']({'where':_0x1c6ff9[_0x0eb6('0x3f')]})['then'](function(_0x7abfc9){_0x1d8923[_0x0eb6('0x21')]=_0x7abfc9;if(_0x219d95[_0x0eb6('0x33')][_0x0eb6('0x51')]){_0x1c6ff9['include']=[{'all':!![]}];}else{_0x1c6ff9['include']=[{'model':db[_0x0eb6('0x7d')],'as':'Contact','required':![]},{'model':db[_0x0eb6('0x11f')],'as':_0x0eb6('0x120'),'required':![]}];}return db[_0x0eb6('0xc7')][_0x0eb6('0x52')](_0x1c6ff9);})['then'](function(_0x3df815){_0x1d8923[_0x0eb6('0x53')]=_0x3df815;return _0x1d8923;});}})[_0x0eb6('0x13')](respondWithFilteredResult(_0x31322e,_0x1c6ff9))[_0x0eb6('0x1c')](handleError(_0x31322e,null));};exports[_0x0eb6('0x121')]=function(_0x3c8734,_0x251738){return db[_0x0eb6('0x2e')]['find']({'where':{'id':_0x3c8734[_0x0eb6('0x4c')]['id']}})[_0x0eb6('0x13')](handleEntityNotFound(_0x251738,null))[_0x0eb6('0x13')](function(_0xc4976e){if(_0xc4976e){return _0xc4976e[_0x0eb6('0x121')](_0x3c8734[_0x0eb6('0x48')]['ids'],_[_0x0eb6('0x117')](_0x3c8734[_0x0eb6('0x48')],[_0x0eb6('0x55'),'id'])||{})[_0x0eb6('0x122')](function(_0x3fee27){for(var _0x2f6c37=0x0;_0x2f6c37<_0x3c8734[_0x0eb6('0x48')][_0x0eb6('0x55')][_0x0eb6('0x39')];_0x2f6c37+=0x1){socket[_0x0eb6('0x123')](_0x0eb6('0x124'),{'UserId':Number(_0x3c8734['body'][_0x0eb6('0x55')][_0x2f6c37]),'ChatWebsiteId':Number(_0x3c8734[_0x0eb6('0x4c')]['id'])});}return _0x3fee27;});}})[_0x0eb6('0x13')](respondWithResult(_0x251738,null))[_0x0eb6('0x1c')](handleError(_0x251738,null));};exports[_0x0eb6('0x125')]=function(_0x4887a6,_0x28eaf2){return db['ChatWebsite']['find']({'where':{'id':_0x4887a6[_0x0eb6('0x4c')]['id']}})[_0x0eb6('0x13')](handleEntityNotFound(_0x28eaf2,null))['then'](function(_0x341ea3){if(_0x341ea3){return _0x341ea3[_0x0eb6('0x125')](_0x4887a6[_0x0eb6('0x33')][_0x0eb6('0x55')])[_0x0eb6('0x13')](function(){if(_['isArray'](_0x4887a6[_0x0eb6('0x33')]['ids'])){for(var _0x20cb9e=0x0;_0x20cb9e<_0x4887a6[_0x0eb6('0x33')][_0x0eb6('0x55')][_0x0eb6('0x39')];_0x20cb9e+=0x1){socket[_0x0eb6('0x123')](_0x0eb6('0x126'),{'UserId':Number(_0x4887a6['query']['ids'][_0x20cb9e]),'ChatWebsiteId':Number(_0x4887a6[_0x0eb6('0x4c')]['id'])});}}else{socket['emit'](_0x0eb6('0x126'),{'UserId':Number(_0x4887a6[_0x0eb6('0x33')]['ids']),'ChatWebsiteId':Number(_0x4887a6['params']['id'])});}});}})['then'](respondWithStatusCode(_0x28eaf2,null))['catch'](handleError(_0x28eaf2,null));};exports[_0x0eb6('0x127')]=function(_0x4d6562,_0x3e1bea){var _0x58c4fa={};var _0x253b26={};var _0x13418a;var _0x53f113;return db['ChatWebsite'][_0x0eb6('0x50')]({'where':{'id':_0x4d6562[_0x0eb6('0x4c')]['id']}})[_0x0eb6('0x13')](handleEntityNotFound(_0x3e1bea,null))[_0x0eb6('0x13')](function(_0x5d48cf){if(_0x5d48cf){_0x13418a=_0x5d48cf;_0x253b26[_0x0eb6('0x31')]=_['keys'](db[_0x0eb6('0xb4')][_0x0eb6('0x45')]);_0x253b26[_0x0eb6('0x33')]=_[_0x0eb6('0x34')](_0x4d6562[_0x0eb6('0x33')]);_0x253b26[_0x0eb6('0x35')]=_['intersection'](_0x253b26['model'],_0x253b26[_0x0eb6('0x33')]);_0x58c4fa[_0x0eb6('0x37')]=_[_0x0eb6('0x36')](_0x253b26['model'],qs['fields'](_0x4d6562['query'][_0x0eb6('0x38')]));_0x58c4fa[_0x0eb6('0x37')]=_0x58c4fa[_0x0eb6('0x37')][_0x0eb6('0x39')]?_0x58c4fa['attributes']:_0x253b26[_0x0eb6('0x31')];_0x58c4fa[_0x0eb6('0x58')]=qs[_0x0eb6('0x3c')](_0x4d6562[_0x0eb6('0x33')][_0x0eb6('0x3c')]);_0x58c4fa[_0x0eb6('0x3f')]=qs[_0x0eb6('0x35')](_[_0x0eb6('0x3d')](_0x4d6562['query'],_0x253b26['filters']));if(_0x4d6562[_0x0eb6('0x33')]['filter']){_0x58c4fa[_0x0eb6('0x3f')]=_[_0x0eb6('0x40')](_0x58c4fa[_0x0eb6('0x3f')],{'$or':_['map'](_0x58c4fa[_0x0eb6('0x37')],function(_0x17897f){var _0x2f08d3={};_0x2f08d3[_0x17897f]={'$like':'%'+_0x4d6562[_0x0eb6('0x33')][_0x0eb6('0x3e')]+'%'};return _0x2f08d3;})});}_0x58c4fa=_[_0x0eb6('0x40')]({},_0x58c4fa,_0x4d6562['options']);return _0x13418a[_0x0eb6('0x127')](_0x58c4fa);}})[_0x0eb6('0x13')](function(_0x44b9e7){if(_0x44b9e7){_0x53f113=_0x44b9e7[_0x0eb6('0x39')];if(!_0x4d6562[_0x0eb6('0x33')][_0x0eb6('0x3a')](_0x0eb6('0x3b'))){_0x58c4fa['limit']=qs[_0x0eb6('0x22')](_0x4d6562[_0x0eb6('0x33')][_0x0eb6('0x22')]);_0x58c4fa[_0x0eb6('0x1f')]=qs[_0x0eb6('0x1f')](_0x4d6562['query'][_0x0eb6('0x1f')]);}return _0x13418a[_0x0eb6('0x127')](_0x58c4fa);}})[_0x0eb6('0x13')](function(_0x1380ec){if(_0x1380ec){return _0x1380ec?{'count':_0x53f113,'rows':_0x1380ec}:null;}})['then'](respondWithResult(_0x3e1bea,null))[_0x0eb6('0x1c')](handleError(_0x3e1bea,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 1c8cdc8..81726b2 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 _0x447b=['update','remove','emit','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x51a945,_0x2d809c){var _0x50f0bd=function(_0x87fba5){while(--_0x87fba5){_0x51a945['push'](_0x51a945['shift']());}};_0x50f0bd(++_0x2d809c);}(_0x447b,0xe4));var _0xb447=function(_0x5139f6,_0x33c8b7){_0x5139f6=_0x5139f6-0x0;var _0x36b77f=_0x447b[_0x5139f6];return _0x36b77f;};'use strict';var EventEmitter=require(_0xb447('0x0'));var ChatWebsite=require(_0xb447('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xb447('0x2')](0x0);var events={'afterCreate':_0xb447('0x3'),'afterUpdate':_0xb447('0x4'),'afterDestroy':_0xb447('0x5')};function emitEvent(_0xf3dd0a){return function(_0xf8a88b,_0x161c5d,_0x4161c2){ChatWebsiteEvents[_0xb447('0x6')](_0xf3dd0a+':'+_0xf8a88b['id'],_0xf8a88b);ChatWebsiteEvents[_0xb447('0x6')](_0xf3dd0a,_0xf8a88b);_0x4161c2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0xb447('0x7')]=ChatWebsiteEvents; \ No newline at end of file +var _0x6b4e=['emit','hasOwnProperty','hook','exports','../../mysqldb','remove'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x6b4e,0x1a8));var _0xe6b4=function(_0x2c4eb4,_0x42bc84){_0x2c4eb4=_0x2c4eb4-0x0;var _0x2f711c=_0x6b4e[_0x2c4eb4];return _0x2f711c;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0xe6b4('0x0'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xe6b4('0x1')};function emitEvent(_0x3be9b1){return function(_0x1aedc5,_0x344db1,_0x436fc0){ChatWebsiteEvents[_0xe6b4('0x2')](_0x3be9b1+':'+_0x1aedc5['id'],_0x1aedc5);ChatWebsiteEvents['emit'](_0x3be9b1,_0x1aedc5);_0x436fc0(null);};}for(var e in events){if(events[_0xe6b4('0x3')](e)){var event=events[e];ChatWebsite[_0xe6b4('0x4')](e,emitEvent(event));}}module[_0xe6b4('0x5')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index e8c0ad0..0f1256a 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 _0xd032=['ChatWebsite','chat_websites','util','../../config/logger','request-promise','rimraf','./chatWebsite.attributes','exports','define'];(function(_0x33e4f4,_0x17055c){var _0xf5684c=function(_0x5152df){while(--_0x5152df){_0x33e4f4['push'](_0x33e4f4['shift']());}};_0xf5684c(++_0x17055c);}(_0xd032,0x146));var _0x2d03=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0xd032[_0x5cb1af];return _0x8d7940;};'use strict';var _=require('lodash');var util=require(_0x2d03('0x0'));var logger=require(_0x2d03('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2d03('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2d03('0x3'));var config=require('../../config/environment');var attributes=require(_0x2d03('0x4'));module[_0x2d03('0x5')]=function(_0x28eca2,_0x31b93e){return _0x28eca2[_0x2d03('0x6')](_0x2d03('0x7'),attributes,{'tableName':_0x2d03('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe07e=['path','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','util','../../config/logger','api','moment','request-promise'];(function(_0x579dca,_0x31321c){var _0x200848=function(_0x17d9e3){while(--_0x17d9e3){_0x579dca['push'](_0x579dca['shift']());}};_0x200848(++_0x31321c);}(_0xe07e,0x127));var _0xee07=function(_0x2b45b5,_0x474458){_0x2b45b5=_0x2b45b5-0x0;var _0x1d9c06=_0xe07e[_0x2b45b5];return _0x1d9c06;};'use strict';var _=require('lodash');var util=require(_0xee07('0x0'));var logger=require(_0xee07('0x1'))(_0xee07('0x2'));var moment=require(_0xee07('0x3'));var BPromise=require('bluebird');var rp=require(_0xee07('0x4'));var fs=require('fs');var path=require(_0xee07('0x5'));var rimraf=require('rimraf');var config=require(_0xee07('0x6'));var attributes=require(_0xee07('0x7'));module[_0xee07('0x8')]=function(_0x3f8c95,_0x915313){return _0x3f8c95[_0xee07('0x9')](_0xee07('0xa'),attributes,{'tableName':_0xee07('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index 6d2b0b1..fd31c58 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 _0x9975=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','./chatWebsite.socket','request','then','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','ChatWebsite,\x20%s,\x20%s','message','info'];(function(_0x483ab9,_0x419148){var _0x35043b=function(_0x3453a3){while(--_0x3453a3){_0x483ab9['push'](_0x483ab9['shift']());}};_0x35043b(++_0x419148);}(_0x9975,0x65));var _0x5997=function(_0x347f2b,_0x449c7f){_0x347f2b=_0x347f2b-0x0;var _0x12e3e7=_0x9975[_0x347f2b];return _0x12e3e7;};'use strict';var _=require(_0x5997('0x0'));var util=require(_0x5997('0x1'));var moment=require(_0x5997('0x2'));var BPromise=require(_0x5997('0x3'));var rs=require(_0x5997('0x4'));var fs=require('fs');var Redis=require(_0x5997('0x5'));var db=require(_0x5997('0x6'))['db'];var utils=require(_0x5997('0x7'));var logger=require('../../config/logger')(_0x5997('0x8'));var config=require('../../config/environment');var jayson=require(_0x5997('0x9'));var client=jayson[_0x5997('0xa')][_0x5997('0xb')]({'port':0x232a});config[_0x5997('0xc')]=_[_0x5997('0xd')](config[_0x5997('0xc')],{'host':_0x5997('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5997('0xc')]));require(_0x5997('0xf'))['register'](socket);function respondWithRpcPromise(_0x5c769a,_0x5a47ed,_0x24ed9e){return new BPromise(function(_0x1e88ed,_0xf5a6ba){return client[_0x5997('0x10')](_0x5c769a,_0x24ed9e)[_0x5997('0x11')](function(_0x5accb7){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x5a47ed,'request\x20sent');logger['debug'](_0x5997('0x12'),_0x5a47ed,_0x5997('0x13'),JSON['stringify'](_0x5accb7));if(_0x5accb7[_0x5997('0x14')]){if(_0x5accb7[_0x5997('0x14')]['code']===0x1f4){logger[_0x5997('0x14')](_0x5997('0x15'),_0x5a47ed,_0x5accb7['error']['message']);return _0xf5a6ba(_0x5accb7[_0x5997('0x14')][_0x5997('0x16')]);}logger[_0x5997('0x14')](_0x5997('0x15'),_0x5a47ed,_0x5accb7[_0x5997('0x14')]['message']);return _0x1e88ed(_0x5accb7[_0x5997('0x14')][_0x5997('0x16')]);}else{logger[_0x5997('0x17')](_0x5997('0x15'),_0x5a47ed,_0x5997('0x13'));_0x1e88ed(_0x5accb7[_0x5997('0x18')]['message']);}})['catch'](function(_0x3b998a){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x5a47ed,_0x3b998a);_0xf5a6ba(_0x3b998a);});});} \ No newline at end of file +var _0x4567=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','http','redis','localhost','socket.io-emitter','./chatWebsite.socket','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x1c1f82,_0x5ec1b8){var _0x58e07f=function(_0x4e4cf4){while(--_0x4e4cf4){_0x1c1f82['push'](_0x1c1f82['shift']());}};_0x58e07f(++_0x5ec1b8);}(_0x4567,0x1b2));var _0x7456=function(_0x14a340,_0xb96778){_0x14a340=_0x14a340-0x0;var _0x48d1f0=_0x4567[_0x14a340];return _0x48d1f0;};'use strict';var _=require(_0x7456('0x0'));var util=require(_0x7456('0x1'));var moment=require('moment');var BPromise=require(_0x7456('0x2'));var rs=require(_0x7456('0x3'));var fs=require('fs');var Redis=require(_0x7456('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7456('0x5'));var logger=require(_0x7456('0x6'))(_0x7456('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x7456('0x8')]({'port':0x232a});config['redis']=_['defaults'](config[_0x7456('0x9')],{'host':_0x7456('0xa'),'port':0x18eb});var socket=require(_0x7456('0xb'))(new Redis(config['redis']));require(_0x7456('0xc'))['register'](socket);function respondWithRpcPromise(_0xfe7422,_0x2a388a,_0x2beff8){return new BPromise(function(_0x2e7ef3,_0x7b7129){return client[_0x7456('0xd')](_0xfe7422,_0x2beff8)['then'](function(_0x2d0b6d){logger[_0x7456('0xe')](_0x7456('0xf'),_0x2a388a,_0x7456('0x10'));logger[_0x7456('0x11')](_0x7456('0x12'),_0x2a388a,_0x7456('0x10'),JSON['stringify'](_0x2d0b6d));if(_0x2d0b6d[_0x7456('0x13')]){if(_0x2d0b6d['error'][_0x7456('0x14')]===0x1f4){logger['error'](_0x7456('0xf'),_0x2a388a,_0x2d0b6d[_0x7456('0x13')]['message']);return _0x7b7129(_0x2d0b6d[_0x7456('0x13')][_0x7456('0x15')]);}logger[_0x7456('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x2a388a,_0x2d0b6d['error']['message']);return _0x2e7ef3(_0x2d0b6d[_0x7456('0x13')]['message']);}else{logger[_0x7456('0xe')](_0x7456('0xf'),_0x2a388a,_0x7456('0x10'));_0x2e7ef3(_0x2d0b6d[_0x7456('0x16')][_0x7456('0x15')]);}})[_0x7456('0x17')](function(_0x80f93){logger[_0x7456('0x13')](_0x7456('0xf'),_0x2a388a,_0x80f93);_0x7b7129(_0x80f93);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 60e85db..fa5fa82 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 _0x152d=['./chatWebsite.events','save','remove','emit','removeListener','length','chatWebsite:'];(function(_0x2882a0,_0x42711b){var _0x5ecb65=function(_0x44633b){while(--_0x44633b){_0x2882a0['push'](_0x2882a0['shift']());}};_0x5ecb65(++_0x42711b);}(_0x152d,0x11f));var _0xd152=function(_0x270c3c,_0x4f3db9){_0x270c3c=_0x270c3c-0x0;var _0x39c75e=_0x152d[_0x270c3c];return _0x39c75e;};'use strict';var ChatWebsiteEvents=require(_0xd152('0x0'));var events=[_0xd152('0x1'),_0xd152('0x2'),'update'];function createListener(_0x50907a,_0x4a11a9){return function(_0x20111b){_0x4a11a9[_0xd152('0x3')](_0x50907a,_0x20111b);};}function removeListener(_0x2014d0,_0x36afb4){return function(){ChatWebsiteEvents[_0xd152('0x4')](_0x2014d0,_0x36afb4);};}exports['register']=function(_0x5fe8c4){for(var _0x43bab9=0x0,_0x37ca66=events[_0xd152('0x5')];_0x43bab9<_0x37ca66;_0x43bab9++){var _0x19a7e4=events[_0x43bab9];var _0x5b8e49=createListener(_0xd152('0x6')+_0x19a7e4,_0x5fe8c4);ChatWebsiteEvents['on'](_0x19a7e4,_0x5b8e49);}}; \ No newline at end of file +var _0x8686=['removeListener','register','length','./chatWebsite.events','save','remove','update','emit'];(function(_0x5af522,_0x2b3022){var _0x2eec5f=function(_0xd2780f){while(--_0xd2780f){_0x5af522['push'](_0x5af522['shift']());}};_0x2eec5f(++_0x2b3022);}(_0x8686,0x7b));var _0x6868=function(_0x2afbb0,_0x44f16d){_0x2afbb0=_0x2afbb0-0x0;var _0x411ff2=_0x8686[_0x2afbb0];return _0x411ff2;};'use strict';var ChatWebsiteEvents=require(_0x6868('0x0'));var events=[_0x6868('0x1'),_0x6868('0x2'),_0x6868('0x3')];function createListener(_0x38f9df,_0x4bfb5e){return function(_0x4bdb37){_0x4bfb5e[_0x6868('0x4')](_0x38f9df,_0x4bdb37);};}function removeListener(_0x556b13,_0x383aab){return function(){ChatWebsiteEvents[_0x6868('0x5')](_0x556b13,_0x383aab);};}exports[_0x6868('0x6')]=function(_0x3fcd8c){for(var _0x200737=0x0,_0x53da50=events[_0x6868('0x7')];_0x200737<_0x53da50;_0x200737++){var _0x58298b=events[_0x200737];var _0x9556e1=createListener('chatWebsite:'+_0x58298b,_0x3fcd8c);ChatWebsiteEvents['on'](_0x58298b,_0x9556e1);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 7d3259f..1b17ffd 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 _0xe83c=['notify','server/files','attachments','offline-chat','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','addAgents','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','/:id','/:id/dispositions','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','/:id/users','create','post','/:id/canned_answers','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','file','addLogo','addAvatar','server/files/images/avatars/','single','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify'];(function(_0x34ee23,_0x524647){var _0x226c2a=function(_0x37c737){while(--_0x37c737){_0x34ee23['push'](_0x34ee23['shift']());}};_0x226c2a(++_0x524647);}(_0xe83c,0x181));var _0xce83=function(_0x2f35a2,_0x9c1ac){_0x2f35a2=_0x2f35a2-0x0;var _0x503004=_0xe83c[_0x2f35a2];return _0x503004;};'use strict';var multer=require('multer');var util=require(_0xce83('0x0'));var path=require(_0xce83('0x1'));var timeout=require(_0xce83('0x2'));var express=require(_0xce83('0x3'));var router=express[_0xce83('0x4')]();var fs_extra=require(_0xce83('0x5'));var auth=require(_0xce83('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xce83('0x7'));var controller=require('./chatWebsite.controller');router[_0xce83('0x8')]('/',auth[_0xce83('0x9')](),controller[_0xce83('0xa')]);router[_0xce83('0x8')]('/describe',auth[_0xce83('0x9')](),controller[_0xce83('0xb')]);router[_0xce83('0x8')](_0xce83('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xce83('0x8')](_0xce83('0xd'),auth[_0xce83('0x9')](),controller['getDispositions']);router[_0xce83('0x8')]('/:id/canned_answers',auth[_0xce83('0x9')](),controller[_0xce83('0xe')]);router[_0xce83('0x8')](_0xce83('0xf'),controller[_0xce83('0x10')]);router['get'](_0xce83('0x11'),controller[_0xce83('0x12')]);router[_0xce83('0x8')](_0xce83('0x13'),controller['getCustomerAvatar']);router['get']('/:id/system_avatar',controller[_0xce83('0x14')]);router[_0xce83('0x8')](_0xce83('0x15'),auth[_0xce83('0x9')](),controller[_0xce83('0x16')]);router[_0xce83('0x8')](_0xce83('0x17'),controller[_0xce83('0x18')]);router[_0xce83('0x8')](_0xce83('0x19'),auth[_0xce83('0x9')](),controller[_0xce83('0x1a')]);router['get'](_0xce83('0x1b'),auth[_0xce83('0x9')](),controller[_0xce83('0x1c')]);router['get'](_0xce83('0x1d'),controller[_0xce83('0x1e')]);router[_0xce83('0x8')]('/:id/offline_messages',auth['isAuthenticated'](),controller[_0xce83('0x1f')]);router[_0xce83('0x8')](_0xce83('0x20'),auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth[_0xce83('0x9')](),controller[_0xce83('0x21')]);router[_0xce83('0x22')]('/:id/dispositions',auth[_0xce83('0x9')](),controller['addDisposition']);router['post'](_0xce83('0x23'),auth[_0xce83('0x9')](),controller['addAnswer']);var upload=multer({'storage':multer[_0xce83('0x24')]({'destination':function(_0xd18ce9,_0x348b97,_0x2a8d2a){_0x2a8d2a(null,path[_0xce83('0x25')](config[_0xce83('0x26')],_0xce83('0x27')));},'filename':function(_0x3fdc9d,_0x5bf3c6,_0x3dc64a){_0x3dc64a(null,util[_0xce83('0x28')](_0xce83('0x29'),Date[_0xce83('0x2a')](),_0x5bf3c6[_0xce83('0x2b')]));}})});router['post'](_0xce83('0xf'),upload['single'](_0xce83('0x2c')),controller[_0xce83('0x2d')]);var upload=multer({'storage':multer[_0xce83('0x24')]({'destination':function(_0x4f6070,_0x40355c,_0x327b9a){_0x327b9a(null,path['join'](config[_0xce83('0x26')],'server/files/images/avatars/'));},'filename':function(_0x359d40,_0x1df26b,_0x443d2c){_0x443d2c(null,util[_0xce83('0x28')](_0xce83('0x29'),Date[_0xce83('0x2a')](),_0x1df26b['originalname']));}})});router[_0xce83('0x22')](_0xce83('0x11'),upload['single']('file'),controller[_0xce83('0x2e')]);var upload=multer({'storage':multer[_0xce83('0x24')]({'destination':function(_0x5ed628,_0x5d7173,_0x564659){_0x564659(null,path['join'](config[_0xce83('0x26')],_0xce83('0x2f')));},'filename':function(_0x38ba57,_0x114c8a,_0x5ec511){_0x5ec511(null,util['format'](_0xce83('0x29'),Date['now'](),_0x114c8a[_0xce83('0x2b')]));}})});router[_0xce83('0x22')](_0xce83('0x13'),upload[_0xce83('0x30')](_0xce83('0x2c')),controller[_0xce83('0x31')]);var upload=multer({'storage':multer[_0xce83('0x24')]({'destination':function(_0x10153b,_0x389166,_0xbaf38c){_0xbaf38c(null,path['join'](config[_0xce83('0x26')],_0xce83('0x2f')));},'filename':function(_0x40efef,_0x1d8301,_0x3a283f){_0x3a283f(null,util[_0xce83('0x28')](_0xce83('0x29'),Date[_0xce83('0x2a')](),_0x1d8301[_0xce83('0x2b')]));}})});router[_0xce83('0x22')](_0xce83('0x32'),upload[_0xce83('0x30')](_0xce83('0x2c')),controller[_0xce83('0x33')]);router[_0xce83('0x22')](_0xce83('0x34'),controller[_0xce83('0x35')]);const offlineUploadMulter=multer({'storage':multer[_0xce83('0x24')]({'destination':function(_0x44a5ad,_0x3970f9,_0x3921dd){const _0x204e62=path[_0xce83('0x25')](config['root'],_0xce83('0x36'),_0xce83('0x37'),_0xce83('0x38'));fs_extra['ensureDir'](_0x204e62,function(){_0x3921dd(null,_0x204e62);});},'filename':function(_0x4d5b3e,_0x41d3a6,_0xe129f2){const _0x129cb6=_0x41d3a6[_0xce83('0x2b')][_0xce83('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x3fecae=path[_0xce83('0x3a')](_0x129cb6);const _0x17804b=Date['now']()+'-'+_0x129cb6[_0xce83('0x39')](_0x3fecae,'')+_0x3fecae;_0xe129f2(null,_0x17804b);}})});router[_0xce83('0x22')](_0xce83('0x3b'),offlineUploadMulter[_0xce83('0x3c')](),controller[_0xce83('0x3d')]);router[_0xce83('0x22')](_0xce83('0x15'),auth[_0xce83('0x9')](),controller[_0xce83('0x3e')]);router['post'](_0xce83('0x19'),auth[_0xce83('0x9')](),controller[_0xce83('0x3f')]);router['post']('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0xce83('0x40')]);router['post'](_0xce83('0x20'),auth[_0xce83('0x9')](),controller[_0xce83('0x41')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xce83('0x42')]);router['delete'](_0xce83('0xc'),auth[_0xce83('0x9')](),controller[_0xce83('0x43')]);router[_0xce83('0x44')](_0xce83('0xd'),auth[_0xce83('0x9')](),controller[_0xce83('0x45')]);router[_0xce83('0x44')]('/:id/canned_answers',auth[_0xce83('0x9')](),controller[_0xce83('0x46')]);router[_0xce83('0x44')](_0xce83('0x20'),auth[_0xce83('0x9')](),controller[_0xce83('0x47')]);module[_0xce83('0x48')]=router; \ No newline at end of file +var _0xce61=['/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','create','post','addDisposition','/:id/canned_answers','addAnswer','join','format','now','originalname','addLogo','diskStorage','root','server/files/images/avatars/','/:id/avatar','single','addAvatar','%s-%s','file','addSystemAvatar','/:id/notify','notify','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','addAgents','put','update','delete','/:id','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications'];(function(_0x5275b8,_0x51e5dd){var _0x568a9b=function(_0x583a71){while(--_0x583a71){_0x5275b8['push'](_0x5275b8['shift']());}};_0x568a9b(++_0x51e5dd);}(_0xce61,0xd6));var _0x1ce6=function(_0x21a3a6,_0x30957e){_0x21a3a6=_0x21a3a6-0x0;var _0x17c8a3=_0xce61[_0x21a3a6];return _0x17c8a3;};'use strict';var multer=require(_0x1ce6('0x0'));var util=require(_0x1ce6('0x1'));var path=require(_0x1ce6('0x2'));var timeout=require(_0x1ce6('0x3'));var express=require(_0x1ce6('0x4'));var router=express[_0x1ce6('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1ce6('0x6'));var interaction=require(_0x1ce6('0x7'));var config=require(_0x1ce6('0x8'));var controller=require(_0x1ce6('0x9'));router[_0x1ce6('0xa')]('/',auth[_0x1ce6('0xb')](),controller[_0x1ce6('0xc')]);router[_0x1ce6('0xa')](_0x1ce6('0xd'),auth[_0x1ce6('0xb')](),controller[_0x1ce6('0xe')]);router[_0x1ce6('0xa')]('/:id',auth[_0x1ce6('0xb')](),controller[_0x1ce6('0xf')]);router['get'](_0x1ce6('0x10'),auth['isAuthenticated'](),controller[_0x1ce6('0x11')]);router[_0x1ce6('0xa')]('/:id/canned_answers',auth[_0x1ce6('0xb')](),controller[_0x1ce6('0x12')]);router['get'](_0x1ce6('0x13'),controller[_0x1ce6('0x14')]);router['get']('/:id/avatar',controller[_0x1ce6('0x15')]);router[_0x1ce6('0xa')](_0x1ce6('0x16'),controller[_0x1ce6('0x17')]);router[_0x1ce6('0xa')](_0x1ce6('0x18'),controller[_0x1ce6('0x19')]);router['get'](_0x1ce6('0x1a'),auth[_0x1ce6('0xb')](),controller[_0x1ce6('0x1b')]);router['get'](_0x1ce6('0x1c'),controller[_0x1ce6('0x1d')]);router[_0x1ce6('0xa')](_0x1ce6('0x1e'),auth[_0x1ce6('0xb')](),controller[_0x1ce6('0x1f')]);router[_0x1ce6('0xa')](_0x1ce6('0x20'),auth[_0x1ce6('0xb')](),controller[_0x1ce6('0x21')]);router[_0x1ce6('0xa')](_0x1ce6('0x22'),controller[_0x1ce6('0x23')]);router['get'](_0x1ce6('0x24'),auth[_0x1ce6('0xb')](),controller[_0x1ce6('0x25')]);router[_0x1ce6('0xa')](_0x1ce6('0x26'),auth['isAuthenticated'](),controller[_0x1ce6('0x27')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1ce6('0x28')]);router[_0x1ce6('0x29')](_0x1ce6('0x10'),auth[_0x1ce6('0xb')](),controller[_0x1ce6('0x2a')]);router[_0x1ce6('0x29')](_0x1ce6('0x2b'),auth['isAuthenticated'](),controller[_0x1ce6('0x2c')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1dc9b9,_0xc47d96,_0x2d7fa9){_0x2d7fa9(null,path[_0x1ce6('0x2d')](config['root'],'server/files/images/logos/'));},'filename':function(_0x1f5c53,_0x2cf7e0,_0x69d5af){_0x69d5af(null,util[_0x1ce6('0x2e')]('%s-%s',Date[_0x1ce6('0x2f')](),_0x2cf7e0[_0x1ce6('0x30')]));}})});router[_0x1ce6('0x29')](_0x1ce6('0x13'),upload['single']('file'),controller[_0x1ce6('0x31')]);var upload=multer({'storage':multer[_0x1ce6('0x32')]({'destination':function(_0x11c296,_0x4a58b5,_0x10c741){_0x10c741(null,path[_0x1ce6('0x2d')](config[_0x1ce6('0x33')],_0x1ce6('0x34')));},'filename':function(_0x875683,_0x300fd4,_0x165607){_0x165607(null,util[_0x1ce6('0x2e')]('%s-%s',Date[_0x1ce6('0x2f')](),_0x300fd4[_0x1ce6('0x30')]));}})});router[_0x1ce6('0x29')](_0x1ce6('0x35'),upload[_0x1ce6('0x36')]('file'),controller[_0x1ce6('0x37')]);var upload=multer({'storage':multer[_0x1ce6('0x32')]({'destination':function(_0x34faf4,_0x1a7815,_0x33954a){_0x33954a(null,path[_0x1ce6('0x2d')](config[_0x1ce6('0x33')],'server/files/images/avatars/'));},'filename':function(_0x11dde5,_0x268a4e,_0x297fec){_0x297fec(null,util[_0x1ce6('0x2e')](_0x1ce6('0x38'),Date[_0x1ce6('0x2f')](),_0x268a4e[_0x1ce6('0x30')]));}})});router['post'](_0x1ce6('0x16'),upload[_0x1ce6('0x36')](_0x1ce6('0x39')),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a5612,_0x562ac7,_0x5e7001){_0x5e7001(null,path[_0x1ce6('0x2d')](config[_0x1ce6('0x33')],_0x1ce6('0x34')));},'filename':function(_0x55cc98,_0x3bb436,_0x866d13){_0x866d13(null,util['format'](_0x1ce6('0x38'),Date['now'](),_0x3bb436[_0x1ce6('0x30')]));}})});router[_0x1ce6('0x29')](_0x1ce6('0x18'),upload[_0x1ce6('0x36')](_0x1ce6('0x39')),controller[_0x1ce6('0x3a')]);router[_0x1ce6('0x29')](_0x1ce6('0x3b'),controller[_0x1ce6('0x3c')]);const offlineUploadMulter=multer({'storage':multer[_0x1ce6('0x32')]({'destination':function(_0x472342,_0x570535,_0x3d99d1){const _0x418178=path[_0x1ce6('0x2d')](config[_0x1ce6('0x33')],'server/files',_0x1ce6('0x3d'),_0x1ce6('0x3e'));fs_extra[_0x1ce6('0x3f')](_0x418178,function(){_0x3d99d1(null,_0x418178);});},'filename':function(_0x4874b3,_0x383bbf,_0xb4da77){const _0x520b2f=_0x383bbf['originalname'][_0x1ce6('0x40')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x70b620=path[_0x1ce6('0x41')](_0x520b2f);const _0x19ae90=Date[_0x1ce6('0x2f')]()+'-'+_0x520b2f['replace'](_0x70b620,'')+_0x70b620;_0xb4da77(null,_0x19ae90);}})});router[_0x1ce6('0x29')](_0x1ce6('0x42'),offlineUploadMulter[_0x1ce6('0x43')](),controller[_0x1ce6('0x44')]);router[_0x1ce6('0x29')](_0x1ce6('0x1a'),auth['isAuthenticated'](),controller[_0x1ce6('0x45')]);router[_0x1ce6('0x29')](_0x1ce6('0x1e'),auth[_0x1ce6('0xb')](),controller[_0x1ce6('0x46')]);router[_0x1ce6('0x29')]('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0x1ce6('0x47')]);router[_0x1ce6('0x29')](_0x1ce6('0x26'),auth[_0x1ce6('0xb')](),controller[_0x1ce6('0x48')]);router[_0x1ce6('0x49')]('/:id',auth[_0x1ce6('0xb')](),controller[_0x1ce6('0x4a')]);router[_0x1ce6('0x4b')](_0x1ce6('0x4c'),auth[_0x1ce6('0xb')](),controller[_0x1ce6('0x4d')]);router[_0x1ce6('0x4b')]('/:id/dispositions',auth[_0x1ce6('0xb')](),controller[_0x1ce6('0x4e')]);router['delete']('/:id/canned_answers',auth[_0x1ce6('0xb')](),controller[_0x1ce6('0x4f')]);router[_0x1ce6('0x4b')](_0x1ce6('0x26'),auth[_0x1ce6('0xb')](),controller[_0x1ce6('0x50')]);module[_0x1ce6('0x51')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 1a5481d..dea8542 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 _0x2eda=['Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','sequelize','exports','STRING','ENUM','AmazonAWS','MicrosoftAzure','Outlook365'];(function(_0x3578ac,_0x31e6fa){var _0x21f362=function(_0x5c6ce6){while(--_0x5c6ce6){_0x3578ac['push'](_0x3578ac['shift']());}};_0x21f362(++_0x31e6fa);}(_0x2eda,0x1f1));var _0xa2ed=function(_0x57e812,_0x4ad10f){_0x57e812=_0x57e812-0x0;var _0x17e557=_0x2eda[_0x57e812];return _0x17e557;};'use strict';var Sequelize=require(_0xa2ed('0x0'));module[_0xa2ed('0x1')]={'name':{'type':Sequelize[_0xa2ed('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xa2ed('0x3')](_0xa2ed('0x4'),'Google',_0xa2ed('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xa2ed('0x3')](_0xa2ed('0x6'),_0xa2ed('0x7'))},'data1':{'type':Sequelize[_0xa2ed('0x2')],'comment':_0xa2ed('0x8')},'data2':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0xa2ed('0x2')],'comment':_0xa2ed('0x9')},'data4':{'type':Sequelize['STRING'],'comment':_0xa2ed('0xa')},'data5':{'type':Sequelize[_0xa2ed('0xb')],'comment':_0xa2ed('0xc')},'data6':{'type':Sequelize[_0xa2ed('0xb')],'comment':_0xa2ed('0xd')}}; \ No newline at end of file +var _0xb61a=['Dynamics365','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','TEXT','MicrosoftAzure\x20=>\x20refresh_token','sequelize','STRING','ENUM'];(function(_0x2a6073,_0x5c42d3){var _0x6b34dc=function(_0x35bf07){while(--_0x35bf07){_0x2a6073['push'](_0x2a6073['shift']());}};_0x6b34dc(++_0x5c42d3);}(_0xb61a,0x165));var _0xab61=function(_0x3695a8,_0x364266){_0x3695a8=_0x3695a8-0x0;var _0x463e61=_0xb61a[_0x3695a8];return _0x463e61;};'use strict';var Sequelize=require(_0xab61('0x0'));module['exports']={'name':{'type':Sequelize[_0xab61('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xab61('0x2')]('AmazonAWS','Google','MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xab61('0x2')]('Outlook365',_0xab61('0x3'))},'data1':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0xab61('0x1')],'comment':_0xab61('0x4')},'data3':{'type':Sequelize['STRING'],'comment':_0xab61('0x5')},'data4':{'type':Sequelize[_0xab61('0x1')],'comment':_0xab61('0x6')},'data5':{'type':Sequelize['TEXT'],'comment':_0xab61('0x7')},'data6':{'type':Sequelize[_0xab61('0x8')],'comment':_0xab61('0x9')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index ee6d1ee..6a6933a 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 _0x8ed5=['ascii','Unable\x20to\x20validate\x20id_token','del','data5','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s','lodash','moment','ioredis','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','update','then','destroy','stack','name','send','index','map','CloudProvider','rawAttributes','fieldName','key','filters','intersection','model','query','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','catch','show','keys','fields','length','include','find','create','body','params','replace','{TENANT_ID}','data2','code','id_token','from','stringify','toString','base64','hex','client_id','data1','response_type','join','redirect_uri','data4','form_post','scope','type','state','prompt','value','oauth2Claims','decode','payload','issuer','aud','audience','nonce','isAfter','unix','exp','refresh_token','data6','data3','access_token','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s','authorization_code','POST','oauth2MicrosoftAuthorize','parse'];(function(_0x13d1a2,_0x5f4d55){var _0x50175a=function(_0x5839fc){while(--_0x5839fc){_0x13d1a2['push'](_0x13d1a2['shift']());}};_0x50175a(++_0x5f4d55);}(_0x8ed5,0x15f));var _0x58ed=function(_0x5352b2,_0x5bf778){_0x5352b2=_0x5352b2-0x0;var _0x4a63c4=_0x8ed5[_0x5352b2];return _0x4a63c4;};'use strict';var rp=require('request-promise');var _=require(_0x58ed('0x0'));var moment=require(_0x58ed('0x1'));var crypto=require('crypto');var jwt=require('jsonwebtoken');var Redis=require(_0x58ed('0x2'));var qs=require('../../components/parsers/qs');var config=require(_0x58ed('0x3'));var logger=require('../../config/logger')('api');var db=require(_0x58ed('0x4'))['db'];config[_0x58ed('0x5')]=_['defaults'](config[_0x58ed('0x5')],{'host':_0x58ed('0x6'),'port':0x18eb});var socket=require(_0x58ed('0x7'))(new Redis(config[_0x58ed('0x5')]));var redis=new Redis(config[_0x58ed('0x5')]);var MICROSOFT_AUTH_URL=_0x58ed('0x8');var AZURE_AUTH_SCOPES={'Outlook365':[_0x58ed('0x9'),_0x58ed('0xa'),'email',_0x58ed('0xb'),_0x58ed('0xc'),_0x58ed('0xd'),_0x58ed('0xe')],'Dynamics365':[_0x58ed('0x9'),_0x58ed('0xb')]};var AZURE_TOKEN_SCOPES={'Outlook365':_0x58ed('0xc'),'Dynamics365':''};var MICROSOFT_AUTH_ENDPOINT=_0x58ed('0xf');var MICROSOFT_TOKEN_ENDPOINT='/token';function respondWithStatusCode(_0x46836e,_0x50690c){_0x50690c=_0x50690c||0xcc;return function(_0x1ba269){if(_0x1ba269){return _0x46836e[_0x58ed('0x10')](_0x50690c);}return _0x46836e[_0x58ed('0x11')](_0x50690c)[_0x58ed('0x12')]();};}function respondWithResult(_0x418b59,_0x4c86b3){_0x4c86b3=_0x4c86b3||0xc8;return function(_0x394d02){if(_0x394d02){return _0x418b59[_0x58ed('0x11')](_0x4c86b3)[_0x58ed('0x13')](_0x394d02);}};}function respondWithFilteredResult(_0x284068,_0x57a867){return function(_0x58dc4e){if(_0x58dc4e){var _0x5ce1be=typeof _0x57a867[_0x58ed('0x14')]==='undefined'&&typeof _0x57a867[_0x58ed('0x15')]===_0x58ed('0x16');var _0x50aae4=_0x58dc4e['count'];var _0x1886b2=_0x5ce1be?0x0:_0x57a867['offset'];var _0x5be03e=_0x5ce1be?_0x58dc4e[_0x58ed('0x17')]:_0x57a867[_0x58ed('0x14')]+_0x57a867['limit'];var _0x4ef9f6;if(_0x5be03e>=_0x50aae4){_0x5be03e=_0x50aae4;_0x4ef9f6=0xc8;}else{_0x4ef9f6=0xce;}_0x284068['status'](_0x4ef9f6);return _0x284068['set'](_0x58ed('0x18'),_0x1886b2+'-'+_0x5be03e+'/'+_0x50aae4)['json'](_0x58dc4e);}return null;};}function saveUpdates(_0xcd808a){return function(_0x1d681f){if(_0x1d681f){return _0x1d681f[_0x58ed('0x19')](_0xcd808a)[_0x58ed('0x1a')](function(_0x52678a){return _0x52678a;});}return null;};}function removeEntity(_0x2ef447){return function(_0x3e80c0){if(_0x3e80c0){return _0x3e80c0[_0x58ed('0x1b')]()[_0x58ed('0x1a')](function(){_0x2ef447['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x192963){return function(_0x33e7bd){if(!_0x33e7bd){_0x192963[_0x58ed('0x10')](0x194);}return _0x33e7bd;};}function handleError(_0x95cbba,_0x515932){_0x515932=_0x515932||0x1f4;return function(_0x286090){logger['error'](_0x286090[_0x58ed('0x1c')]);if(_0x286090[_0x58ed('0x1d')]){delete _0x286090['name'];}_0x95cbba[_0x58ed('0x11')](_0x515932)[_0x58ed('0x1e')](_0x286090);};}exports[_0x58ed('0x1f')]=function(_0x38d109,_0xb4a585){var _0x2f1cd9={},_0x5421a7={},_0x1ae646={'count':0x0,'rows':[]};var _0x525397=_[_0x58ed('0x20')](db[_0x58ed('0x21')][_0x58ed('0x22')],function(_0x340796){return{'name':_0x340796[_0x58ed('0x23')],'type':_0x340796['type'][_0x58ed('0x24')]};});_0x5421a7['model']=_[_0x58ed('0x20')](_0x525397,_0x58ed('0x1d'));_0x5421a7['query']=_['keys'](_0x38d109['query']);_0x5421a7[_0x58ed('0x25')]=_[_0x58ed('0x26')](_0x5421a7[_0x58ed('0x27')],_0x5421a7[_0x58ed('0x28')]);_0x2f1cd9[_0x58ed('0x29')]=_[_0x58ed('0x26')](_0x5421a7['model'],qs['fields'](_0x38d109[_0x58ed('0x28')]['fields']));_0x2f1cd9[_0x58ed('0x29')]=_0x2f1cd9[_0x58ed('0x29')]['length']?_0x2f1cd9[_0x58ed('0x29')]:_0x5421a7['model'];if(!_0x38d109['query'][_0x58ed('0x2a')](_0x58ed('0x2b'))){_0x2f1cd9['limit']=qs['limit'](_0x38d109[_0x58ed('0x28')][_0x58ed('0x15')]);_0x2f1cd9[_0x58ed('0x14')]=qs['offset'](_0x38d109[_0x58ed('0x28')][_0x58ed('0x14')]);}_0x2f1cd9[_0x58ed('0x2c')]=qs['sort'](_0x38d109[_0x58ed('0x28')][_0x58ed('0x2d')]);_0x2f1cd9[_0x58ed('0x2e')]=qs[_0x58ed('0x25')](_[_0x58ed('0x2f')](_0x38d109[_0x58ed('0x28')],_0x5421a7[_0x58ed('0x25')]),_0x525397);if(_0x38d109['query'][_0x58ed('0x30')]){_0x2f1cd9['where']=_[_0x58ed('0x31')](_0x2f1cd9['where'],{'$or':_[_0x58ed('0x20')](_0x525397,function(_0x1dbc12){if(_0x1dbc12['type']!==_0x58ed('0x32')){var _0x2c4a34={};_0x2c4a34[_0x1dbc12[_0x58ed('0x1d')]]={'$like':'%'+_0x38d109[_0x58ed('0x28')]['filter']+'%'};return _0x2c4a34;}})});}_0x2f1cd9=_[_0x58ed('0x31')]({},_0x2f1cd9,_0x38d109[_0x58ed('0x33')]);var _0x23a85a={'where':_0x2f1cd9['where']};return db[_0x58ed('0x21')][_0x58ed('0x17')](_0x23a85a)[_0x58ed('0x1a')](function(_0x556f05){_0x1ae646['count']=_0x556f05;if(_0x38d109[_0x58ed('0x28')][_0x58ed('0x34')]){_0x2f1cd9['include']=[{'all':!![]}];}return db['CloudProvider']['findAll'](_0x2f1cd9);})[_0x58ed('0x1a')](function(_0x2c36ad){_0x1ae646['rows']=_0x2c36ad;return _0x1ae646;})['then'](respondWithFilteredResult(_0xb4a585,_0x2f1cd9))[_0x58ed('0x35')](handleError(_0xb4a585,null));};exports[_0x58ed('0x36')]=function(_0x5c5de1,_0x4055e3){var _0x23d0ca={'raw':!![],'where':{'id':_0x5c5de1['params']['id']}},_0x4d55cd={};_0x4d55cd[_0x58ed('0x27')]=_['keys'](db[_0x58ed('0x21')][_0x58ed('0x22')]);_0x4d55cd[_0x58ed('0x28')]=_[_0x58ed('0x37')](_0x5c5de1[_0x58ed('0x28')]);_0x4d55cd[_0x58ed('0x25')]=_['intersection'](_0x4d55cd[_0x58ed('0x27')],_0x4d55cd['query']);_0x23d0ca[_0x58ed('0x29')]=_[_0x58ed('0x26')](_0x4d55cd['model'],qs['fields'](_0x5c5de1[_0x58ed('0x28')][_0x58ed('0x38')]));_0x23d0ca[_0x58ed('0x29')]=_0x23d0ca[_0x58ed('0x29')][_0x58ed('0x39')]?_0x23d0ca[_0x58ed('0x29')]:_0x4d55cd['model'];if(_0x5c5de1[_0x58ed('0x28')][_0x58ed('0x34')]){_0x23d0ca[_0x58ed('0x3a')]=[{'all':!![]}];}_0x23d0ca=_['merge']({},_0x23d0ca,_0x5c5de1[_0x58ed('0x33')]);return db[_0x58ed('0x21')][_0x58ed('0x3b')](_0x23d0ca)[_0x58ed('0x1a')](handleEntityNotFound(_0x4055e3,null))['then'](respondWithResult(_0x4055e3,null))[_0x58ed('0x35')](handleError(_0x4055e3,null));};exports[_0x58ed('0x3c')]=function(_0x4e46b3,_0x53f917){return db['CloudProvider']['create'](_0x4e46b3[_0x58ed('0x3d')],{})['then'](respondWithResult(_0x53f917,0xc9))['catch'](handleError(_0x53f917,null));};exports[_0x58ed('0x19')]=function(_0x2b76c2,_0x3b5878){if(_0x2b76c2[_0x58ed('0x3d')]['id']){delete _0x2b76c2[_0x58ed('0x3d')]['id'];}return db[_0x58ed('0x21')][_0x58ed('0x3b')]({'where':{'id':_0x2b76c2['params']['id']}})[_0x58ed('0x1a')](handleEntityNotFound(_0x3b5878,null))['then'](saveUpdates(_0x2b76c2[_0x58ed('0x3d')],null))[_0x58ed('0x1a')](respondWithResult(_0x3b5878,null))[_0x58ed('0x35')](handleError(_0x3b5878,null));};exports['destroy']=function(_0x538ad0,_0x113c87){return db['CloudProvider'][_0x58ed('0x3b')]({'where':{'id':_0x538ad0[_0x58ed('0x3e')]['id']}})[_0x58ed('0x1a')](handleEntityNotFound(_0x113c87,null))['then'](removeEntity(_0x113c87,null))['catch'](handleError(_0x113c87,null));};function generateMicrosoftAuthorizationUrl(_0x598df7,_0x27271e){var _0x3ec8f9=MICROSOFT_AUTH_URL[_0x58ed('0x3f')](_0x58ed('0x40'),_0x598df7[_0x58ed('0x41')]);var _0x1a5bb8=[_0x58ed('0x42'),_0x58ed('0x43')];var _0x762dea=Buffer[_0x58ed('0x44')](JSON[_0x58ed('0x45')]({'id':_0x27271e}))[_0x58ed('0x46')](_0x58ed('0x47'));var _0x3ae1b1=crypto['randomBytes'](0x10)['toString'](_0x58ed('0x48'));var _0x14081e=[{'key':_0x58ed('0x49'),'value':_0x598df7[_0x58ed('0x4a')]},{'key':_0x58ed('0x4b'),'value':encodeURIComponent(_0x1a5bb8[_0x58ed('0x4c')]('\x20'))},{'key':_0x58ed('0x4d'),'value':_0x598df7[_0x58ed('0x4e')]},{'key':'response_mode','value':_0x58ed('0x4f')},{'key':_0x58ed('0x50'),'value':encodeURIComponent(AZURE_AUTH_SCOPES[_0x598df7[_0x58ed('0x51')]][_0x58ed('0x4c')]('\x20'))},{'key':_0x58ed('0x52'),'value':_0x762dea},{'key':'nonce','value':_0x3ae1b1},{'key':_0x58ed('0x53'),'value':'login'}];var _0x40e71b=_0x3ec8f9+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x58ed('0x20')](_0x14081e,function(_0x1b9049){return _0x1b9049[_0x58ed('0x24')]+'='+_0x1b9049[_0x58ed('0x54')];})[_0x58ed('0x4c')]('&');_0x598df7[_0x58ed('0x55')]={'issuer':_0x3ec8f9[_0x58ed('0x3f')]('oauth2/',''),'audience':_0x598df7[_0x58ed('0x4a')],'state':_0x762dea,'nonce':_0x3ae1b1};redis['set'](_0x762dea,JSON['stringify'](_0x598df7));return _0x40e71b;}function isValidIdToken(_0x2ea79c,_0x24eff0){try{var _0x92f594=jwt[_0x58ed('0x56')](_0x2ea79c,{'complete':!![]});var _0xaf59bd=_0x92f594[_0x58ed('0x57')];if(_0xaf59bd['iss']!==_0x24eff0[_0x58ed('0x58')])return![];if(_0xaf59bd[_0x58ed('0x59')]!==_0x24eff0[_0x58ed('0x5a')])return![];if(_0xaf59bd[_0x58ed('0x5b')]!==_0x24eff0[_0x58ed('0x5b')])return![];if(moment()[_0x58ed('0x5c')](moment[_0x58ed('0x5d')](_0xaf59bd[_0x58ed('0x5e')])))return![];return!![];}catch(_0x4dded7){throw _0x4dded7;}}function refreshOauth2MicrosoftAccessToken(_0x5b21f1){var _0x1ac215={'grant_type':_0x58ed('0x5f'),'refresh_token':_0x5b21f1[_0x58ed('0x60')],'scope':AZURE_TOKEN_SCOPES[_0x5b21f1['type']],'redirect_uri':_0x5b21f1['data4'],'client_id':_0x5b21f1[_0x58ed('0x4a')],'client_secret':_0x5b21f1[_0x58ed('0x61')]};var _0x1ad8fb={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x58ed('0x3f')](_0x58ed('0x40'),_0x5b21f1[_0x58ed('0x41')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1ac215,'json':!![]};return rp(_0x1ad8fb)[_0x58ed('0x1a')](function(_0x461f41){return db[_0x58ed('0x21')][_0x58ed('0x19')]({'data5':_0x461f41[_0x58ed('0x62')],'data6':_0x461f41['refresh_token']},{'where':{'id':_0x5b21f1['id']}});})[_0x58ed('0x35')](function(_0x4c825f){logger[_0x58ed('0x63')](_0x58ed('0x64'),_0x5b21f1['id'],_0x4c825f);});}function getOauth2MicrosoftAccessToken(_0x295824,_0x331961){var _0x1c16fb={'grant_type':_0x58ed('0x65'),'code':_0x295824,'scope':AZURE_TOKEN_SCOPES[_0x331961[_0x58ed('0x51')]],'redirect_uri':_0x331961[_0x58ed('0x4e')],'client_id':_0x331961[_0x58ed('0x4a')],'client_secret':_0x331961[_0x58ed('0x61')]};var _0x58089c={'method':_0x58ed('0x66'),'uri':MICROSOFT_AUTH_URL[_0x58ed('0x3f')](_0x58ed('0x40'),_0x331961[_0x58ed('0x41')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1c16fb,'json':!![]};return rp(_0x58089c);}exports[_0x58ed('0x67')]=function(_0x588e2a,_0x17141b){return db[_0x58ed('0x21')]['findOne']({'where':{'id':_0x588e2a[_0x58ed('0x3e')]['id']},'raw':!![]})[_0x58ed('0x1a')](function(_0x176efa){if(!_0x176efa)return _0x17141b[_0x58ed('0x10')](0x194);return{'url':generateMicrosoftAuthorizationUrl(_0x176efa,_0x588e2a['user']['id'])};})[_0x58ed('0x1a')](respondWithResult(_0x17141b,null))[_0x58ed('0x35')](handleError(_0x17141b,null));};exports['oauth2MicrosoftCallback']=function(_0x67b4a8,_0x4c1b96){var _0x3a1746=_0x67b4a8[_0x58ed('0x3d')];var _0x24c5f5;var _0x48d75e;if(_0x3a1746[_0x58ed('0x63')])throw _0x3a1746;redis['get'](_0x3a1746[_0x58ed('0x52')])[_0x58ed('0x1a')](function(_0x5bae66){if(!_0x5bae66)throw new Error('Invalid\x20state\x20parameter');_0x24c5f5=JSON[_0x58ed('0x68')](_0x5bae66);var _0x4268f8=Buffer[_0x58ed('0x44')](_0x3a1746[_0x58ed('0x52')],'base64')[_0x58ed('0x46')](_0x58ed('0x69'));_0x48d75e=JSON[_0x58ed('0x68')](_0x4268f8);if(!isValidIdToken(_0x3a1746[_0x58ed('0x43')],_0x24c5f5[_0x58ed('0x55')]))throw new Error(_0x58ed('0x6a'));redis[_0x58ed('0x6b')](_0x3a1746[_0x58ed('0x52')]);return getOauth2MicrosoftAccessToken(_0x3a1746['code'],_0x24c5f5);})[_0x58ed('0x1a')](function(_0x3cba08){_0x24c5f5['data5']=_0x3cba08[_0x58ed('0x62')];_0x24c5f5[_0x58ed('0x60')]=_0x3cba08[_0x58ed('0x5f')];return db[_0x58ed('0x21')][_0x58ed('0x19')]({'data5':_0x24c5f5[_0x58ed('0x6c')],'data6':_0x24c5f5[_0x58ed('0x60')]},{'where':{'id':_0x24c5f5['id']}});})[_0x58ed('0x1a')](function(){setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,_0x24c5f5),0xfa*0x3e8);socket['emit']('microsoftAuthorization:success',{'id':_0x48d75e['id']});return;})['then'](respondWithStatusCode(_0x4c1b96,null))[_0x58ed('0x35')](function(_0x5c46cb){if(_0x48d75e){socket[_0x58ed('0x6d')](_0x58ed('0x6e'),{'id':_0x48d75e['id']});}if(!_0x24c5f5){logger[_0x58ed('0x63')](_0x58ed('0x6f'),_0x5c46cb);return _0x4c1b96[_0x58ed('0x11')](0x1f4)[_0x58ed('0x1e')](_0x5c46cb[_0x58ed('0x70')]);}logger['error'](_0x58ed('0x71'),_0x24c5f5['id'],_0x5c46cb);});}; \ No newline at end of file +var _0x079b=['openid','profile','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','offline_access','/authorize','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','then','destroy','error','stack','name','send','map','CloudProvider','rawAttributes','fieldName','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','merge','where','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','replace','{TENANT_ID}','data2','code','id_token','stringify','toString','base64','hex','client_id','response_type','join','redirect_uri','data4','response_mode','form_post','scope','nonce','prompt','login','oauth2Claims','oauth2/','data1','decode','payload','iss','issuer','aud','audience','isAfter','unix','exp','refresh_token','data6','POST','access_token','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s','authorization_code','oauth2MicrosoftAuthorize','user','oauth2MicrosoftCallback','state','Invalid\x20state\x20parameter','parse','from','ascii','del','data5','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s','request-promise','lodash','moment','crypto','jsonwebtoken','../../config/environment','../../config/logger','../../mysqldb','redis','localhost','socket.io-emitter','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x079b,0x165));var _0xb079=function(_0x391e9c,_0x3b4958){_0x391e9c=_0x391e9c-0x0;var _0x1807da=_0x079b[_0x391e9c];return _0x1807da;};'use strict';var rp=require(_0xb079('0x0'));var _=require(_0xb079('0x1'));var moment=require(_0xb079('0x2'));var crypto=require(_0xb079('0x3'));var jwt=require(_0xb079('0x4'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var config=require(_0xb079('0x5'));var logger=require(_0xb079('0x6'))('api');var db=require(_0xb079('0x7'))['db'];config[_0xb079('0x8')]=_['defaults'](config[_0xb079('0x8')],{'host':_0xb079('0x9'),'port':0x18eb});var socket=require(_0xb079('0xa'))(new Redis(config[_0xb079('0x8')]));var redis=new Redis(config[_0xb079('0x8')]);var MICROSOFT_AUTH_URL=_0xb079('0xb');var AZURE_AUTH_SCOPES={'Outlook365':[_0xb079('0xc'),_0xb079('0xd'),_0xb079('0xe'),'offline_access',_0xb079('0xf'),_0xb079('0x10'),_0xb079('0x11')],'Dynamics365':['openid',_0xb079('0x12')]};var AZURE_TOKEN_SCOPES={'Outlook365':_0xb079('0xf'),'Dynamics365':''};var MICROSOFT_AUTH_ENDPOINT=_0xb079('0x13');var MICROSOFT_TOKEN_ENDPOINT='/token';function respondWithStatusCode(_0x74e4a8,_0x575290){_0x575290=_0x575290||0xcc;return function(_0x3544f5){if(_0x3544f5){return _0x74e4a8[_0xb079('0x14')](_0x575290);}return _0x74e4a8['status'](_0x575290)[_0xb079('0x15')]();};}function respondWithResult(_0x56419c,_0x3c675e){_0x3c675e=_0x3c675e||0xc8;return function(_0x4ddc5f){if(_0x4ddc5f){return _0x56419c[_0xb079('0x16')](_0x3c675e)[_0xb079('0x17')](_0x4ddc5f);}};}function respondWithFilteredResult(_0x117ec5,_0x2b7d6f){return function(_0x4845ec){if(_0x4845ec){var _0x422110=typeof _0x2b7d6f[_0xb079('0x18')]===_0xb079('0x19')&&typeof _0x2b7d6f['limit']==='undefined';var _0x4872eb=_0x4845ec[_0xb079('0x1a')];var _0x13dd18=_0x422110?0x0:_0x2b7d6f[_0xb079('0x18')];var _0x2406db=_0x422110?_0x4845ec['count']:_0x2b7d6f[_0xb079('0x18')]+_0x2b7d6f[_0xb079('0x1b')];var _0x336629;if(_0x2406db>=_0x4872eb){_0x2406db=_0x4872eb;_0x336629=0xc8;}else{_0x336629=0xce;}_0x117ec5[_0xb079('0x16')](_0x336629);return _0x117ec5[_0xb079('0x1c')](_0xb079('0x1d'),_0x13dd18+'-'+_0x2406db+'/'+_0x4872eb)['json'](_0x4845ec);}return null;};}function saveUpdates(_0xd55d08){return function(_0x9a535b){if(_0x9a535b){return _0x9a535b['update'](_0xd55d08)[_0xb079('0x1e')](function(_0x53059a){return _0x53059a;});}return null;};}function removeEntity(_0x6b7eb4){return function(_0x42cb57){if(_0x42cb57){return _0x42cb57[_0xb079('0x1f')]()[_0xb079('0x1e')](function(){_0x6b7eb4[_0xb079('0x16')](0xcc)[_0xb079('0x15')]();});}};}function handleEntityNotFound(_0xfe9698){return function(_0x309b26){if(!_0x309b26){_0xfe9698[_0xb079('0x14')](0x194);}return _0x309b26;};}function handleError(_0x2a837f,_0x27d885){_0x27d885=_0x27d885||0x1f4;return function(_0x465625){logger[_0xb079('0x20')](_0x465625[_0xb079('0x21')]);if(_0x465625[_0xb079('0x22')]){delete _0x465625[_0xb079('0x22')];}_0x2a837f[_0xb079('0x16')](_0x27d885)[_0xb079('0x23')](_0x465625);};}exports['index']=function(_0x13f0cf,_0x3041e5){var _0x5ef466={},_0x43eae2={},_0x57f45a={'count':0x0,'rows':[]};var _0x4d627c=_[_0xb079('0x24')](db[_0xb079('0x25')][_0xb079('0x26')],function(_0xd68eda){return{'name':_0xd68eda[_0xb079('0x27')],'type':_0xd68eda['type'][_0xb079('0x28')]};});_0x43eae2['model']=_[_0xb079('0x24')](_0x4d627c,_0xb079('0x22'));_0x43eae2[_0xb079('0x29')]=_[_0xb079('0x2a')](_0x13f0cf['query']);_0x43eae2[_0xb079('0x2b')]=_['intersection'](_0x43eae2[_0xb079('0x2c')],_0x43eae2[_0xb079('0x29')]);_0x5ef466[_0xb079('0x2d')]=_[_0xb079('0x2e')](_0x43eae2[_0xb079('0x2c')],qs[_0xb079('0x2f')](_0x13f0cf[_0xb079('0x29')][_0xb079('0x2f')]));_0x5ef466['attributes']=_0x5ef466['attributes'][_0xb079('0x30')]?_0x5ef466[_0xb079('0x2d')]:_0x43eae2[_0xb079('0x2c')];if(!_0x13f0cf[_0xb079('0x29')][_0xb079('0x31')]('nolimit')){_0x5ef466['limit']=qs[_0xb079('0x1b')](_0x13f0cf[_0xb079('0x29')]['limit']);_0x5ef466[_0xb079('0x18')]=qs[_0xb079('0x18')](_0x13f0cf['query']['offset']);}_0x5ef466[_0xb079('0x32')]=qs[_0xb079('0x33')](_0x13f0cf[_0xb079('0x29')][_0xb079('0x33')]);_0x5ef466['where']=qs[_0xb079('0x2b')](_[_0xb079('0x34')](_0x13f0cf[_0xb079('0x29')],_0x43eae2[_0xb079('0x2b')]),_0x4d627c);if(_0x13f0cf[_0xb079('0x29')]['filter']){_0x5ef466['where']=_[_0xb079('0x35')](_0x5ef466[_0xb079('0x36')],{'$or':_[_0xb079('0x24')](_0x4d627c,function(_0x41256a){if(_0x41256a[_0xb079('0x37')]!==_0xb079('0x38')){var _0x213112={};_0x213112[_0x41256a[_0xb079('0x22')]]={'$like':'%'+_0x13f0cf[_0xb079('0x29')][_0xb079('0x39')]+'%'};return _0x213112;}})});}_0x5ef466=_['merge']({},_0x5ef466,_0x13f0cf[_0xb079('0x3a')]);var _0x230108={'where':_0x5ef466[_0xb079('0x36')]};return db[_0xb079('0x25')][_0xb079('0x1a')](_0x230108)[_0xb079('0x1e')](function(_0x430deb){_0x57f45a[_0xb079('0x1a')]=_0x430deb;if(_0x13f0cf[_0xb079('0x29')][_0xb079('0x3b')]){_0x5ef466[_0xb079('0x3c')]=[{'all':!![]}];}return db[_0xb079('0x25')][_0xb079('0x3d')](_0x5ef466);})[_0xb079('0x1e')](function(_0xbaf9d7){_0x57f45a[_0xb079('0x3e')]=_0xbaf9d7;return _0x57f45a;})[_0xb079('0x1e')](respondWithFilteredResult(_0x3041e5,_0x5ef466))[_0xb079('0x3f')](handleError(_0x3041e5,null));};exports[_0xb079('0x40')]=function(_0x447365,_0xc5e1a5){var _0x335b90={'raw':!![],'where':{'id':_0x447365[_0xb079('0x41')]['id']}},_0x314233={};_0x314233[_0xb079('0x2c')]=_[_0xb079('0x2a')](db[_0xb079('0x25')][_0xb079('0x26')]);_0x314233[_0xb079('0x29')]=_['keys'](_0x447365['query']);_0x314233[_0xb079('0x2b')]=_[_0xb079('0x2e')](_0x314233['model'],_0x314233[_0xb079('0x29')]);_0x335b90[_0xb079('0x2d')]=_['intersection'](_0x314233[_0xb079('0x2c')],qs[_0xb079('0x2f')](_0x447365['query']['fields']));_0x335b90[_0xb079('0x2d')]=_0x335b90['attributes'][_0xb079('0x30')]?_0x335b90[_0xb079('0x2d')]:_0x314233[_0xb079('0x2c')];if(_0x447365[_0xb079('0x29')]['includeAll']){_0x335b90[_0xb079('0x3c')]=[{'all':!![]}];}_0x335b90=_[_0xb079('0x35')]({},_0x335b90,_0x447365[_0xb079('0x3a')]);return db[_0xb079('0x25')][_0xb079('0x42')](_0x335b90)['then'](handleEntityNotFound(_0xc5e1a5,null))[_0xb079('0x1e')](respondWithResult(_0xc5e1a5,null))[_0xb079('0x3f')](handleError(_0xc5e1a5,null));};exports['create']=function(_0x214489,_0x432e1d){return db['CloudProvider'][_0xb079('0x43')](_0x214489[_0xb079('0x44')],{})[_0xb079('0x1e')](respondWithResult(_0x432e1d,0xc9))['catch'](handleError(_0x432e1d,null));};exports[_0xb079('0x45')]=function(_0x5f3257,_0x7b3bc4){if(_0x5f3257['body']['id']){delete _0x5f3257[_0xb079('0x44')]['id'];}return db[_0xb079('0x25')]['find']({'where':{'id':_0x5f3257[_0xb079('0x41')]['id']}})[_0xb079('0x1e')](handleEntityNotFound(_0x7b3bc4,null))['then'](saveUpdates(_0x5f3257[_0xb079('0x44')],null))['then'](respondWithResult(_0x7b3bc4,null))[_0xb079('0x3f')](handleError(_0x7b3bc4,null));};exports['destroy']=function(_0x478e1f,_0x4a1e60){return db[_0xb079('0x25')][_0xb079('0x42')]({'where':{'id':_0x478e1f[_0xb079('0x41')]['id']}})[_0xb079('0x1e')](handleEntityNotFound(_0x4a1e60,null))[_0xb079('0x1e')](removeEntity(_0x4a1e60,null))[_0xb079('0x3f')](handleError(_0x4a1e60,null));};function generateMicrosoftAuthorizationUrl(_0x566d1c,_0x317df4){var _0x2a1236=MICROSOFT_AUTH_URL[_0xb079('0x46')](_0xb079('0x47'),_0x566d1c[_0xb079('0x48')]);var _0x460123=[_0xb079('0x49'),_0xb079('0x4a')];var _0x349120=Buffer['from'](JSON[_0xb079('0x4b')]({'id':_0x317df4}))[_0xb079('0x4c')](_0xb079('0x4d'));var _0x27efcd=crypto['randomBytes'](0x10)[_0xb079('0x4c')](_0xb079('0x4e'));var _0x43b784=[{'key':_0xb079('0x4f'),'value':_0x566d1c['data1']},{'key':_0xb079('0x50'),'value':encodeURIComponent(_0x460123[_0xb079('0x51')]('\x20'))},{'key':_0xb079('0x52'),'value':_0x566d1c[_0xb079('0x53')]},{'key':_0xb079('0x54'),'value':_0xb079('0x55')},{'key':_0xb079('0x56'),'value':encodeURIComponent(AZURE_AUTH_SCOPES[_0x566d1c[_0xb079('0x37')]][_0xb079('0x51')]('\x20'))},{'key':'state','value':_0x349120},{'key':_0xb079('0x57'),'value':_0x27efcd},{'key':_0xb079('0x58'),'value':_0xb079('0x59')}];var _0x55decc=_0x2a1236+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xb079('0x24')](_0x43b784,function(_0x417caf){return _0x417caf[_0xb079('0x28')]+'='+_0x417caf['value'];})['join']('&');_0x566d1c[_0xb079('0x5a')]={'issuer':_0x2a1236[_0xb079('0x46')](_0xb079('0x5b'),''),'audience':_0x566d1c[_0xb079('0x5c')],'state':_0x349120,'nonce':_0x27efcd};redis[_0xb079('0x1c')](_0x349120,JSON[_0xb079('0x4b')](_0x566d1c));return _0x55decc;}function isValidIdToken(_0x423e58,_0x412a31){try{var _0x4e3eac=jwt[_0xb079('0x5d')](_0x423e58,{'complete':!![]});var _0x8c53bd=_0x4e3eac[_0xb079('0x5e')];if(_0x8c53bd[_0xb079('0x5f')]!==_0x412a31[_0xb079('0x60')])return![];if(_0x8c53bd[_0xb079('0x61')]!==_0x412a31[_0xb079('0x62')])return![];if(_0x8c53bd[_0xb079('0x57')]!==_0x412a31['nonce'])return![];if(moment()[_0xb079('0x63')](moment[_0xb079('0x64')](_0x8c53bd[_0xb079('0x65')])))return![];return!![];}catch(_0x199d88){throw _0x199d88;}}function refreshOauth2MicrosoftAccessToken(_0x26fd76){var _0x472201={'grant_type':_0xb079('0x66'),'refresh_token':_0x26fd76[_0xb079('0x67')],'scope':AZURE_TOKEN_SCOPES[_0x26fd76['type']],'redirect_uri':_0x26fd76[_0xb079('0x53')],'client_id':_0x26fd76[_0xb079('0x5c')],'client_secret':_0x26fd76['data3']};var _0x295492={'method':_0xb079('0x68'),'uri':MICROSOFT_AUTH_URL['replace'](_0xb079('0x47'),_0x26fd76['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x472201,'json':!![]};return rp(_0x295492)[_0xb079('0x1e')](function(_0x52eae0){return db[_0xb079('0x25')][_0xb079('0x45')]({'data5':_0x52eae0[_0xb079('0x69')],'data6':_0x52eae0[_0xb079('0x66')]},{'where':{'id':_0x26fd76['id']}});})[_0xb079('0x3f')](function(_0x916fb7){logger[_0xb079('0x20')](_0xb079('0x6a'),_0x26fd76['id'],_0x916fb7);});}function getOauth2MicrosoftAccessToken(_0x192fde,_0x41e3a9){var _0x4b2cbd={'grant_type':_0xb079('0x6b'),'code':_0x192fde,'scope':AZURE_TOKEN_SCOPES[_0x41e3a9[_0xb079('0x37')]],'redirect_uri':_0x41e3a9[_0xb079('0x53')],'client_id':_0x41e3a9[_0xb079('0x5c')],'client_secret':_0x41e3a9['data3']};var _0x3f2ec6={'method':_0xb079('0x68'),'uri':MICROSOFT_AUTH_URL[_0xb079('0x46')](_0xb079('0x47'),_0x41e3a9['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4b2cbd,'json':!![]};return rp(_0x3f2ec6);}exports[_0xb079('0x6c')]=function(_0xd0ca2e,_0x335089){return db['CloudProvider']['findOne']({'where':{'id':_0xd0ca2e[_0xb079('0x41')]['id']},'raw':!![]})[_0xb079('0x1e')](function(_0x14e54f){if(!_0x14e54f)return _0x335089[_0xb079('0x14')](0x194);return{'url':generateMicrosoftAuthorizationUrl(_0x14e54f,_0xd0ca2e[_0xb079('0x6d')]['id'])};})[_0xb079('0x1e')](respondWithResult(_0x335089,null))[_0xb079('0x3f')](handleError(_0x335089,null));};exports[_0xb079('0x6e')]=function(_0x15ee26,_0x59ca30){var _0x2bfa0f=_0x15ee26[_0xb079('0x44')];var _0x1d9b24;var _0x254a42;if(_0x2bfa0f['error'])throw _0x2bfa0f;redis['get'](_0x2bfa0f[_0xb079('0x6f')])[_0xb079('0x1e')](function(_0x155501){if(!_0x155501)throw new Error(_0xb079('0x70'));_0x1d9b24=JSON[_0xb079('0x71')](_0x155501);var _0x318c0c=Buffer[_0xb079('0x72')](_0x2bfa0f['state'],'base64')[_0xb079('0x4c')](_0xb079('0x73'));_0x254a42=JSON['parse'](_0x318c0c);if(!isValidIdToken(_0x2bfa0f[_0xb079('0x4a')],_0x1d9b24[_0xb079('0x5a')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0xb079('0x74')](_0x2bfa0f['state']);return getOauth2MicrosoftAccessToken(_0x2bfa0f[_0xb079('0x49')],_0x1d9b24);})['then'](function(_0x25db05){_0x1d9b24[_0xb079('0x75')]=_0x25db05[_0xb079('0x69')];_0x1d9b24[_0xb079('0x67')]=_0x25db05['refresh_token'];return db[_0xb079('0x25')]['update']({'data5':_0x1d9b24[_0xb079('0x75')],'data6':_0x1d9b24[_0xb079('0x67')]},{'where':{'id':_0x1d9b24['id']}});})[_0xb079('0x1e')](function(){setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,_0x1d9b24),0xfa*0x3e8);socket[_0xb079('0x76')](_0xb079('0x77'),{'id':_0x254a42['id']});return;})[_0xb079('0x1e')](respondWithStatusCode(_0x59ca30,null))[_0xb079('0x3f')](function(_0x72e08f){if(_0x254a42){socket[_0xb079('0x76')](_0xb079('0x78'),{'id':_0x254a42['id']});}if(!_0x1d9b24){logger[_0xb079('0x20')](_0xb079('0x79'),_0x72e08f);return _0x59ca30[_0xb079('0x16')](0x1f4)[_0xb079('0x23')](_0x72e08f['message']);}logger[_0xb079('0x20')](_0xb079('0x7a'),_0x1d9b24['id'],_0x72e08f);});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 5803ec7..3b7be31 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 _0x0d6a=['bluebird','request-promise','path','../../config/environment','exports','CloudProvider','lodash','util','../../config/logger','moment'];(function(_0x79d88c,_0x48b19d){var _0x5116a5=function(_0x2597c7){while(--_0x2597c7){_0x79d88c['push'](_0x79d88c['shift']());}};_0x5116a5(++_0x48b19d);}(_0x0d6a,0xa6));var _0xa0d6=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0x0d6a[_0x5834bc];return _0x3e183a;};'use strict';var _=require(_0xa0d6('0x0'));var util=require(_0xa0d6('0x1'));var logger=require(_0xa0d6('0x2'))('api');var moment=require(_0xa0d6('0x3'));var BPromise=require(_0xa0d6('0x4'));var rp=require(_0xa0d6('0x5'));var fs=require('fs');var path=require(_0xa0d6('0x6'));var rimraf=require('rimraf');var config=require(_0xa0d6('0x7'));var attributes=require('./cloudProvider.attributes');module[_0xa0d6('0x8')]=function(_0x1313bf,_0x36f6cd){return _0x1313bf['define'](_0xa0d6('0x9'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf644=['api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','CloudProvider','lodash','util','../../config/logger'];(function(_0x56086c,_0x4506c1){var _0x393b7e=function(_0x549c17){while(--_0x549c17){_0x56086c['push'](_0x56086c['shift']());}};_0x393b7e(++_0x4506c1);}(_0xf644,0xf9));var _0x4f64=function(_0x567026,_0x44fdee){_0x567026=_0x567026-0x0;var _0x324935=_0xf644[_0x567026];return _0x324935;};'use strict';var _=require(_0x4f64('0x0'));var util=require(_0x4f64('0x1'));var logger=require(_0x4f64('0x2'))(_0x4f64('0x3'));var moment=require('moment');var BPromise=require(_0x4f64('0x4'));var rp=require(_0x4f64('0x5'));var fs=require('fs');var path=require(_0x4f64('0x6'));var rimraf=require(_0x4f64('0x7'));var config=require(_0x4f64('0x8'));var attributes=require('./cloudProvider.attributes');module[_0x4f64('0x9')]=function(_0x1aa313,_0x136071){return _0x1aa313[_0x4f64('0xa')](_0x4f64('0xb'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index d30aa02..1853777 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 _0x2581=['request','then','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','error','code','message','CloudProvider,\x20%s,\x20%s','info','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5ec1e6,_0x4b2896){var _0x7324fb=function(_0x1ab168){while(--_0x1ab168){_0x5ec1e6['push'](_0x5ec1e6['shift']());}};_0x7324fb(++_0x4b2896);}(_0x2581,0xcb));var _0x1258=function(_0x5c29d9,_0x4a49df){_0x5c29d9=_0x5c29d9-0x0;var _0x1c77ba=_0x2581[_0x5c29d9];return _0x1c77ba;};'use strict';var _=require(_0x1258('0x0'));var util=require(_0x1258('0x1'));var moment=require(_0x1258('0x2'));var BPromise=require(_0x1258('0x3'));var rs=require(_0x1258('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1258('0x5'))['db'];var utils=require(_0x1258('0x6'));var logger=require(_0x1258('0x7'))(_0x1258('0x8'));var config=require(_0x1258('0x9'));var jayson=require(_0x1258('0xa'));var client=jayson[_0x1258('0xb')][_0x1258('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x582ed7,_0x3e1044,_0x21cd98){return new BPromise(function(_0x468494,_0x18bbac){return client[_0x1258('0xd')](_0x582ed7,_0x21cd98)[_0x1258('0xe')](function(_0x429efc){logger['info']('CloudProvider,\x20%s,\x20%s',_0x3e1044,_0x1258('0xf'));logger[_0x1258('0x10')](_0x1258('0x11'),_0x3e1044,_0x1258('0xf'),JSON['stringify'](_0x429efc));if(_0x429efc[_0x1258('0x12')]){if(_0x429efc[_0x1258('0x12')][_0x1258('0x13')]===0x1f4){logger[_0x1258('0x12')]('CloudProvider,\x20%s,\x20%s',_0x3e1044,_0x429efc[_0x1258('0x12')][_0x1258('0x14')]);return _0x18bbac(_0x429efc[_0x1258('0x12')][_0x1258('0x14')]);}logger[_0x1258('0x12')](_0x1258('0x15'),_0x3e1044,_0x429efc[_0x1258('0x12')]['message']);return _0x468494(_0x429efc[_0x1258('0x12')]['message']);}else{logger[_0x1258('0x16')](_0x1258('0x15'),_0x3e1044,_0x1258('0xf'));_0x468494(_0x429efc[_0x1258('0x17')][_0x1258('0x14')]);}})['catch'](function(_0x1645a6){logger[_0x1258('0x12')](_0x1258('0x15'),_0x3e1044,_0x1645a6);_0x18bbac(_0x1645a6);});});} \ No newline at end of file +var _0x5430=['ioredis','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','CloudProvider,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x5430,0x10c));var _0x0543=function(_0x51744a,_0x5ae592){_0x51744a=_0x51744a-0x0;var _0x24316a=_0x5430[_0x51744a];return _0x24316a;};'use strict';var _=require(_0x0543('0x0'));var util=require(_0x0543('0x1'));var moment=require(_0x0543('0x2'));var BPromise=require(_0x0543('0x3'));var rs=require(_0x0543('0x4'));var fs=require('fs');var Redis=require(_0x0543('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0543('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0543('0x7'));var client=jayson[_0x0543('0x8')][_0x0543('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x319568,_0x46bca7,_0x5ac352){return new BPromise(function(_0x372974,_0x7b8280){return client[_0x0543('0xa')](_0x319568,_0x5ac352)[_0x0543('0xb')](function(_0x2fb723){logger[_0x0543('0xc')]('CloudProvider,\x20%s,\x20%s',_0x46bca7,_0x0543('0xd'));logger[_0x0543('0xe')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x46bca7,_0x0543('0xd'),JSON[_0x0543('0xf')](_0x2fb723));if(_0x2fb723[_0x0543('0x10')]){if(_0x2fb723[_0x0543('0x10')][_0x0543('0x11')]===0x1f4){logger[_0x0543('0x10')](_0x0543('0x12'),_0x46bca7,_0x2fb723[_0x0543('0x10')][_0x0543('0x13')]);return _0x7b8280(_0x2fb723[_0x0543('0x10')][_0x0543('0x13')]);}logger[_0x0543('0x10')]('CloudProvider,\x20%s,\x20%s',_0x46bca7,_0x2fb723[_0x0543('0x10')][_0x0543('0x13')]);return _0x372974(_0x2fb723['error']['message']);}else{logger[_0x0543('0xc')](_0x0543('0x12'),_0x46bca7,_0x0543('0xd'));_0x372974(_0x2fb723[_0x0543('0x14')][_0x0543('0x13')]);}})['catch'](function(_0xe69a3d){logger[_0x0543('0x10')](_0x0543('0x12'),_0x46bca7,_0xe69a3d);_0x7b8280(_0xe69a3d);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 506fb3d..ce3d33b 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 _0xadb5=['put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','Router','./cloudProvider.controller','get','isAuthenticated','/:id','post','create'];(function(_0xe21f43,_0x394110){var _0x364719=function(_0x8497cf){while(--_0x8497cf){_0xe21f43['push'](_0xe21f43['shift']());}};_0x364719(++_0x394110);}(_0xadb5,0xad));var _0x5adb=function(_0x465e78,_0x469bae){_0x465e78=_0x465e78-0x0;var _0x2fdaea=_0xadb5[_0x465e78];return _0x2fdaea;};'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['index']);router[_0x5adb('0x2')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller['show']);router[_0x5adb('0x5')]('/',auth[_0x5adb('0x3')](),controller[_0x5adb('0x6')]);router[_0x5adb('0x7')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0x8')]);router[_0x5adb('0x9')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0xa')]);router[_0x5adb('0x2')](_0x5adb('0xb'),auth[_0x5adb('0x3')](),controller['oauth2MicrosoftAuthorize']);router['post'](_0x5adb('0xc'),controller[_0x5adb('0xd')]);module[_0x5adb('0xe')]=router; \ No newline at end of file +var _0xc4aa=['put','/:id','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','show','post','create'];(function(_0x1a6278,_0x298782){var _0x557688=function(_0x23149c){while(--_0x23149c){_0x1a6278['push'](_0x1a6278['shift']());}};_0x557688(++_0x298782);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xc4aa[_0x1d1779];return _0x2377e9;};'use strict';var express=require(_0xac4a('0x0'));var router=express[_0xac4a('0x1')]();var auth=require(_0xac4a('0x2'));var controller=require(_0xac4a('0x3'));router[_0xac4a('0x4')]('/',auth[_0xac4a('0x5')](),controller['index']);router['get']('/:id',auth[_0xac4a('0x5')](),controller[_0xac4a('0x6')]);router[_0xac4a('0x7')]('/',auth[_0xac4a('0x5')](),controller[_0xac4a('0x8')]);router[_0xac4a('0x9')](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller['update']);router['delete'](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xb')]);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xd')]);router['post'](_0xac4a('0xe'),controller['oauth2MicrosoftCallback']);module[_0xac4a('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 4597d33..4f7eb33 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 _0xfe62=['STRING','name','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfe62,0x76));var _0x2fe6=function(_0x565b81,_0x1344f2){_0x565b81=_0x565b81-0x0;var _0x18bbd1=_0xfe62[_0x565b81];return _0x18bbd1;};'use strict';var Sequelize=require(_0x2fe6('0x0'));module[_0x2fe6('0x1')]={'name':{'type':Sequelize[_0x2fe6('0x2')],'unique':_0x2fe6('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x2fe6('0x2')]},'companyId':{'type':Sequelize[_0x2fe6('0x2')]},'website':{'type':Sequelize[_0x2fe6('0x2')]},'phone':{'type':Sequelize[_0x2fe6('0x2')]},'fax':{'type':Sequelize[_0x2fe6('0x2')]},'type':{'type':Sequelize[_0x2fe6('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x2fe6('0x2')]},'city':{'type':Sequelize[_0x2fe6('0x2')]},'country':{'type':Sequelize[_0x2fe6('0x2')]},'email':{'type':Sequelize[_0x2fe6('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x2fe6('0x2')]},'sStreet':{'type':Sequelize[_0x2fe6('0x2')]},'sPostalCode':{'type':Sequelize[_0x2fe6('0x2')]},'sCity':{'type':Sequelize[_0x2fe6('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2fe6('0x2')]}}; \ No newline at end of file +var _0x245e=['exports','name','STRING','sequelize'];(function(_0x3b1b23,_0x21bccd){var _0x1efc85=function(_0x102a95){while(--_0x102a95){_0x3b1b23['push'](_0x3b1b23['shift']());}};_0x1efc85(++_0x21bccd);}(_0x245e,0x15f));var _0xe245=function(_0x2e86b6,_0x47d704){_0x2e86b6=_0x2e86b6-0x0;var _0x5c767b=_0x245e[_0x2e86b6];return _0x5c767b;};'use strict';var Sequelize=require(_0xe245('0x0'));module[_0xe245('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xe245('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xe245('0x3')]},'companyId':{'type':Sequelize[_0xe245('0x3')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xe245('0x3')]},'fax':{'type':Sequelize[_0xe245('0x3')]},'type':{'type':Sequelize[_0xe245('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xe245('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xe245('0x3')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xe245('0x3')]},'sStreet':{'type':Sequelize[_0xe245('0x3')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xe245('0x3')]},'sCountry':{'type':Sequelize[_0xe245('0x3')]},'description':{'type':Sequelize[_0xe245('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 650a61d..1f32b82 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 _0x357b=['where','filters','pick','filter','merge','options','includeAll','include','findAll','catch','show','rawAttributes','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addContacts','ids','findOne','CmContact','order','map','getContacts','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','limit','undefined','count','status','set','Content-Range','apply','reject','save','destroy','then','get','Companies','sendStatus','error','stack','name','send','index','CmCompany','describe','model','keys','query','intersection','attributes','fields','nolimit','sort'];(function(_0x277b55,_0x8ba28){var _0xff0d15=function(_0x1beefc){while(--_0x1beefc){_0x277b55['push'](_0x277b55['shift']());}};_0xff0d15(++_0x8ba28);}(_0x357b,0x74));var _0xb357=function(_0x10bf41,_0x544170){_0x10bf41=_0x10bf41-0x0;var _0x7b6ea9=_0x357b[_0x10bf41];return _0x7b6ea9;};'use strict';var emlformat=require(_0xb357('0x0'));var rimraf=require(_0xb357('0x1'));var zipdir=require(_0xb357('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb357('0x3'));var moment=require('moment');var BPromise=require(_0xb357('0x4'));var Mustache=require(_0xb357('0x5'));var util=require(_0xb357('0x6'));var path=require(_0xb357('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb357('0x8'));var fs=require('fs');var fs_extra=require(_0xb357('0x9'));var _=require(_0xb357('0xa'));var squel=require(_0xb357('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb357('0xc'));var Papa=require(_0xb357('0xd'));var Redis=require(_0xb357('0xe'));var authService=require(_0xb357('0xf'));var qs=require(_0xb357('0x10'));var as=require(_0xb357('0x11'));var hardwareService=require(_0xb357('0x12'));var logger=require(_0xb357('0x13'))('api');var utils=require(_0xb357('0x14'));var config=require(_0xb357('0x15'));var licenseUtil=require(_0xb357('0x16'));var db=require(_0xb357('0x17'))['db'];function respondWithStatusCode(_0x333918,_0x1f8a8c){_0x1f8a8c=_0x1f8a8c||0xcc;return function(_0x1cc8b6){if(_0x1cc8b6){return _0x333918['sendStatus'](_0x1f8a8c);}return _0x333918['status'](_0x1f8a8c)[_0xb357('0x18')]();};}function respondWithResult(_0x1a16a6,_0x38d5ea){_0x38d5ea=_0x38d5ea||0xc8;return function(_0x3cd7b3){if(_0x3cd7b3){return _0x1a16a6['status'](_0x38d5ea)[_0xb357('0x19')](_0x3cd7b3);}};}function respondWithFilteredResult(_0x5c2205,_0x2782db){return function(_0x545367){if(_0x545367){var _0x465bec=typeof _0x2782db[_0xb357('0x1a')]==='undefined'&&typeof _0x2782db[_0xb357('0x1b')]===_0xb357('0x1c');var _0x4aa032=_0x545367[_0xb357('0x1d')];var _0x4db2c5=_0x465bec?0x0:_0x2782db['offset'];var _0x2334db=_0x465bec?_0x545367['count']:_0x2782db['offset']+_0x2782db[_0xb357('0x1b')];var _0x3b0efe;if(_0x2334db>=_0x4aa032){_0x2334db=_0x4aa032;_0x3b0efe=0xc8;}else{_0x3b0efe=0xce;}_0x5c2205[_0xb357('0x1e')](_0x3b0efe);return _0x5c2205[_0xb357('0x1f')](_0xb357('0x20'),_0x4db2c5+'-'+_0x2334db+'/'+_0x4aa032)[_0xb357('0x19')](_0x545367);}return null;};}function patchUpdates(_0x36422e){return function(_0x5179f7){try{jsonpatch[_0xb357('0x21')](_0x5179f7,_0x36422e,!![]);}catch(_0xb5e0c7){return BPromise[_0xb357('0x22')](_0xb5e0c7);}return _0x5179f7[_0xb357('0x23')]();};}function saveUpdates(_0x59b36e,_0x2d7268){return function(_0x4dd8b3){if(_0x4dd8b3){return _0x4dd8b3['update'](_0x59b36e)['then'](function(_0x22aad8){return _0x22aad8;});}return null;};}function removeEntity(_0x558c3e,_0x43403f){return function(_0x54e861){if(_0x54e861){return _0x54e861[_0xb357('0x24')]()[_0xb357('0x25')](function(){var _0x25ec03=_0x54e861[_0xb357('0x26')]({'plain':!![]});var _0x3f961c=_0xb357('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x3f961c,'resourceId':_0x25ec03['id']}})[_0xb357('0x25')](function(){return _0x54e861;});})['then'](function(){_0x558c3e[_0xb357('0x1e')](0xcc)[_0xb357('0x18')]();});}};}function handleEntityNotFound(_0x4fa31b,_0x3fea57){return function(_0x5dd2a4){if(!_0x5dd2a4){_0x4fa31b[_0xb357('0x28')](0x194);}return _0x5dd2a4;};}function handleError(_0x4c9fd6,_0x3d5705){_0x3d5705=_0x3d5705||0x1f4;return function(_0x2356dc){logger[_0xb357('0x29')](_0x2356dc[_0xb357('0x2a')]);if(_0x2356dc[_0xb357('0x2b')]){delete _0x2356dc['name'];}_0x4c9fd6[_0xb357('0x1e')](_0x3d5705)[_0xb357('0x2c')](_0x2356dc);};}exports[_0xb357('0x2d')]=function(_0x2ab1ed,_0x36c9ee){var _0x40ad2d={},_0x351a3f={},_0x5ea0d1={'count':0x0,'rows':[]};return db[_0xb357('0x2e')][_0xb357('0x2f')]()['then'](function(_0x45271f){_0x351a3f[_0xb357('0x30')]=_[_0xb357('0x31')](_0x45271f);_0x351a3f[_0xb357('0x32')]=_[_0xb357('0x31')](_0x2ab1ed[_0xb357('0x32')]);_0x351a3f['filters']=_[_0xb357('0x33')](_0x351a3f[_0xb357('0x30')],_0x351a3f[_0xb357('0x32')]);_0x40ad2d[_0xb357('0x34')]=_[_0xb357('0x33')](_0x351a3f[_0xb357('0x30')],qs[_0xb357('0x35')](_0x2ab1ed[_0xb357('0x32')][_0xb357('0x35')]));_0x40ad2d[_0xb357('0x34')]=_0x40ad2d[_0xb357('0x34')]['length']?_0x40ad2d['attributes']:_0x351a3f[_0xb357('0x30')];if(!_0x2ab1ed[_0xb357('0x32')]['hasOwnProperty'](_0xb357('0x36'))){_0x40ad2d[_0xb357('0x1b')]=qs[_0xb357('0x1b')](_0x2ab1ed[_0xb357('0x32')]['limit']);_0x40ad2d[_0xb357('0x1a')]=qs[_0xb357('0x1a')](_0x2ab1ed['query'][_0xb357('0x1a')]);}_0x40ad2d['order']=qs[_0xb357('0x37')](_0x2ab1ed[_0xb357('0x32')]['sort']);_0x40ad2d[_0xb357('0x38')]=qs[_0xb357('0x39')](_[_0xb357('0x3a')](_0x2ab1ed[_0xb357('0x32')],_0x351a3f[_0xb357('0x39')]),_0x45271f);if(_0x2ab1ed[_0xb357('0x32')][_0xb357('0x3b')]){_0x40ad2d['where']=_[_0xb357('0x3c')](_0x40ad2d[_0xb357('0x38')],{'$or':_['map'](_0x40ad2d[_0xb357('0x34')],function(_0x11d861){var _0x493e12={};_0x493e12[_0x11d861]={'$like':'%'+_0x2ab1ed[_0xb357('0x32')][_0xb357('0x3b')]+'%'};return _0x493e12;})});}_0x40ad2d=_[_0xb357('0x3c')]({},_0x40ad2d,_0x2ab1ed[_0xb357('0x3d')]);var _0x38ce02={'where':_0x40ad2d[_0xb357('0x38')]};return db[_0xb357('0x2e')][_0xb357('0x1d')](_0x38ce02)[_0xb357('0x25')](function(_0x5f0d90){_0x5ea0d1[_0xb357('0x1d')]=_0x5f0d90;if(_0x2ab1ed[_0xb357('0x32')][_0xb357('0x3e')]){_0x40ad2d[_0xb357('0x3f')]=[{'all':!![]}];}return db[_0xb357('0x2e')][_0xb357('0x40')](_0x40ad2d);})[_0xb357('0x25')](function(_0x53b64b){_0x5ea0d1['rows']=_0x53b64b;return _0x5ea0d1;})[_0xb357('0x25')](respondWithFilteredResult(_0x36c9ee,_0x40ad2d))[_0xb357('0x41')](handleError(_0x36c9ee,null));})[_0xb357('0x41')](handleError(_0x36c9ee,null));};exports[_0xb357('0x42')]=function(_0x1ba1f0,_0x4c5ff6){var _0x24d73b={'raw':![],'where':{'id':_0x1ba1f0['params']['id']}},_0x2b5e2c={};_0x2b5e2c[_0xb357('0x30')]=_[_0xb357('0x31')](db['CmCompany'][_0xb357('0x43')]);_0x2b5e2c['query']=_[_0xb357('0x31')](_0x1ba1f0[_0xb357('0x32')]);_0x2b5e2c[_0xb357('0x39')]=_['intersection'](_0x2b5e2c['model'],_0x2b5e2c[_0xb357('0x32')]);_0x24d73b[_0xb357('0x34')]=_[_0xb357('0x33')](_0x2b5e2c[_0xb357('0x30')],qs[_0xb357('0x35')](_0x1ba1f0[_0xb357('0x32')][_0xb357('0x35')]));_0x24d73b['attributes']=_0x24d73b[_0xb357('0x34')][_0xb357('0x44')]?_0x24d73b[_0xb357('0x34')]:_0x2b5e2c[_0xb357('0x30')];if(_0x1ba1f0[_0xb357('0x32')][_0xb357('0x3e')]){_0x24d73b[_0xb357('0x3f')]=[{'all':!![]}];}_0x24d73b=_[_0xb357('0x3c')]({},_0x24d73b,_0x1ba1f0[_0xb357('0x3d')]);return db[_0xb357('0x2e')][_0xb357('0x45')](_0x24d73b)[_0xb357('0x25')](handleEntityNotFound(_0x4c5ff6,null))[_0xb357('0x25')](respondWithResult(_0x4c5ff6,null))[_0xb357('0x41')](handleError(_0x4c5ff6,null));};exports['create']=function(_0x56cd0c,_0x203923){return db[_0xb357('0x2e')][_0xb357('0x46')](_0x56cd0c[_0xb357('0x47')],{})[_0xb357('0x25')](function(_0x2b534a){var _0x4a68c2=_0x56cd0c['user'][_0xb357('0x26')]({'plain':!![]});if(!_0x4a68c2)throw new Error(_0xb357('0x48'));if(_0x4a68c2['role']===_0xb357('0x49')){var _0x5632c=_0x2b534a[_0xb357('0x26')]({'plain':!![]});var _0x2d5e19='Companies';return db['UserProfileSection'][_0xb357('0x45')]({'where':{'name':_0x2d5e19,'userProfileId':_0x4a68c2[_0xb357('0x4a')]},'raw':!![]})['then'](function(_0x364ff6){if(_0x364ff6&&_0x364ff6[_0xb357('0x4b')]===0x0){return db[_0xb357('0x4c')][_0xb357('0x46')]({'name':_0x5632c['name'],'resourceId':_0x5632c['id'],'type':_0x364ff6[_0xb357('0x2b')],'sectionId':_0x364ff6['id']},{})['then'](function(){return _0x2b534a;});}else{return _0x2b534a;}})[_0xb357('0x41')](function(_0x1af72d){logger[_0xb357('0x29')](_0xb357('0x4d'),_0x1af72d);throw _0x1af72d;});}return _0x2b534a;})[_0xb357('0x25')](respondWithResult(_0x203923,0xc9))['catch'](handleError(_0x203923,null));};exports['update']=function(_0x2b3bad,_0x4db31f){if(_0x2b3bad[_0xb357('0x47')]['id']){delete _0x2b3bad[_0xb357('0x47')]['id'];}return db['CmCompany']['find']({'where':{'id':_0x2b3bad[_0xb357('0x4e')]['id']}})[_0xb357('0x25')](handleEntityNotFound(_0x4db31f,null))[_0xb357('0x25')](saveUpdates(_0x2b3bad[_0xb357('0x47')],null))[_0xb357('0x25')](respondWithResult(_0x4db31f,null))[_0xb357('0x41')](handleError(_0x4db31f,null));};exports['destroy']=function(_0x3c15cc,_0x38bcd5){return db[_0xb357('0x2e')][_0xb357('0x45')]({'where':{'id':_0x3c15cc[_0xb357('0x4e')]['id']}})[_0xb357('0x25')](handleEntityNotFound(_0x38bcd5,null))[_0xb357('0x25')](removeEntity(_0x38bcd5,null))[_0xb357('0x41')](handleError(_0x38bcd5,null));};exports[_0xb357('0x2f')]=function(_0x2ce74e,_0x4fd662){return db[_0xb357('0x2e')][_0xb357('0x2f')]()[_0xb357('0x25')](respondWithResult(_0x4fd662,null))[_0xb357('0x41')](handleError(_0x4fd662,null));};exports[_0xb357('0x4f')]=function(_0x478263,_0x1f0982,_0x3241fe){return db['CmContact'][_0xb357('0x45')]({'where':{'id':_0x478263[_0xb357('0x4e')]['id']}})[_0xb357('0x25')](handleEntityNotFound(_0x1f0982,null))['then'](function(_0x386c90){if(_0x386c90){return _0x386c90[_0xb357('0x4f')](_0x478263['body'][_0xb357('0x50')],_['omit'](_0x478263[_0xb357('0x47')],[_0xb357('0x50'),'id'])||{});}})['then'](respondWithResult(_0x1f0982,null))[_0xb357('0x41')](handleError(_0x1f0982,null));};exports['getContacts']=function(_0x5002f8,_0x52fb7e,_0x29cec9){var _0x342a66={};var _0x3547f3={};var _0x3c2d5a;var _0x371179;return db[_0xb357('0x2e')][_0xb357('0x51')]({'where':{'id':_0x5002f8[_0xb357('0x4e')]['id']}})[_0xb357('0x25')](handleEntityNotFound(_0x52fb7e,null))[_0xb357('0x25')](function(_0x1cf232){if(_0x1cf232){_0x3c2d5a=_0x1cf232;_0x3547f3[_0xb357('0x30')]=_['keys'](db[_0xb357('0x52')][_0xb357('0x43')]);_0x3547f3['query']=_[_0xb357('0x31')](_0x5002f8['query']);_0x3547f3[_0xb357('0x39')]=_['intersection'](_0x3547f3[_0xb357('0x30')],_0x3547f3[_0xb357('0x32')]);_0x342a66['attributes']=_[_0xb357('0x33')](_0x3547f3[_0xb357('0x30')],qs[_0xb357('0x35')](_0x5002f8['query'][_0xb357('0x35')]));_0x342a66[_0xb357('0x34')]=_0x342a66['attributes'][_0xb357('0x44')]?_0x342a66['attributes']:_0x3547f3[_0xb357('0x30')];_0x342a66[_0xb357('0x53')]=qs[_0xb357('0x37')](_0x5002f8[_0xb357('0x32')]['sort']);_0x342a66[_0xb357('0x38')]=qs['filters'](_['pick'](_0x5002f8[_0xb357('0x32')],_0x3547f3[_0xb357('0x39')]));if(_0x5002f8[_0xb357('0x32')][_0xb357('0x3b')]){_0x342a66[_0xb357('0x38')]=_[_0xb357('0x3c')](_0x342a66['where'],{'$or':_[_0xb357('0x54')](_0x342a66['attributes'],function(_0x23e1f0){var _0x54c8fa={};_0x54c8fa[_0x23e1f0]={'$like':'%'+_0x5002f8[_0xb357('0x32')][_0xb357('0x3b')]+'%'};return _0x54c8fa;})});}_0x342a66=_['merge']({},_0x342a66,_0x5002f8['options']);return _0x3c2d5a[_0xb357('0x55')](_0x342a66);}})[_0xb357('0x25')](function(_0xf3260c){if(_0xf3260c){_0x371179=_0xf3260c[_0xb357('0x44')];if(!_0x5002f8['query']['hasOwnProperty'](_0xb357('0x36'))){_0x342a66[_0xb357('0x1b')]=qs['limit'](_0x5002f8[_0xb357('0x32')][_0xb357('0x1b')]);_0x342a66[_0xb357('0x1a')]=qs[_0xb357('0x1a')](_0x5002f8[_0xb357('0x32')][_0xb357('0x1a')]);}return _0x3c2d5a[_0xb357('0x55')](_0x342a66);}})[_0xb357('0x25')](function(_0x324493){if(_0x324493){return _0x324493?{'count':_0x371179,'rows':_0x324493}:null;}})[_0xb357('0x25')](respondWithResult(_0x52fb7e,null))[_0xb357('0x41')](handleError(_0x52fb7e,null));}; \ No newline at end of file +var _0x272b=['fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','CmCompany','includeAll','include','findAll','rows','catch','show','params','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','destroy','addContacts','CmContact','ids','getContacts','findOne','rawAttributes','order','map','eml-format','rimraf','zip-dir','request-promise','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','Companies','UserProfileResource','end','error','stack','name','send','describe','model','query','keys','filters','intersection'];(function(_0x33ffb2,_0x4987d3){var _0x19f512=function(_0x5832d7){while(--_0x5832d7){_0x33ffb2['push'](_0x33ffb2['shift']());}};_0x19f512(++_0x4987d3);}(_0x272b,0xd8));var _0xb272=function(_0xf9c82d,_0x375263){_0xf9c82d=_0xf9c82d-0x0;var _0x39c593=_0x272b[_0xf9c82d];return _0x39c593;};'use strict';var emlformat=require(_0xb272('0x0'));var rimraf=require(_0xb272('0x1'));var zipdir=require(_0xb272('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb272('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb272('0x4'));var util=require('util');var path=require(_0xb272('0x5'));var sox=require(_0xb272('0x6'));var csv=require('to-csv');var ejs=require(_0xb272('0x7'));var fs=require('fs');var fs_extra=require(_0xb272('0x8'));var _=require(_0xb272('0x9'));var squel=require(_0xb272('0xa'));var crypto=require(_0xb272('0xb'));var jsforce=require(_0xb272('0xc'));var deskjs=require(_0xb272('0xd'));var toCsv=require(_0xb272('0xe'));var querystring=require(_0xb272('0xf'));var Papa=require(_0xb272('0x10'));var Redis=require(_0xb272('0x11'));var authService=require(_0xb272('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb272('0x13'));var hardwareService=require(_0xb272('0x14'));var logger=require('../../config/logger')(_0xb272('0x15'));var utils=require('../../config/utils');var config=require(_0xb272('0x16'));var licenseUtil=require(_0xb272('0x17'));var db=require(_0xb272('0x18'))['db'];function respondWithStatusCode(_0x3c964e,_0x52c4ee){_0x52c4ee=_0x52c4ee||0xcc;return function(_0x5ef719){if(_0x5ef719){return _0x3c964e[_0xb272('0x19')](_0x52c4ee);}return _0x3c964e[_0xb272('0x1a')](_0x52c4ee)['end']();};}function respondWithResult(_0x5b253c,_0xf0d570){_0xf0d570=_0xf0d570||0xc8;return function(_0x14779d){if(_0x14779d){return _0x5b253c[_0xb272('0x1a')](_0xf0d570)[_0xb272('0x1b')](_0x14779d);}};}function respondWithFilteredResult(_0x175df9,_0x12b531){return function(_0x220ba9){if(_0x220ba9){var _0x4ebfe0=typeof _0x12b531['offset']===_0xb272('0x1c')&&typeof _0x12b531[_0xb272('0x1d')]==='undefined';var _0x493893=_0x220ba9[_0xb272('0x1e')];var _0x2c1774=_0x4ebfe0?0x0:_0x12b531['offset'];var _0x4477d8=_0x4ebfe0?_0x220ba9['count']:_0x12b531[_0xb272('0x1f')]+_0x12b531['limit'];var _0x12da43;if(_0x4477d8>=_0x493893){_0x4477d8=_0x493893;_0x12da43=0xc8;}else{_0x12da43=0xce;}_0x175df9[_0xb272('0x1a')](_0x12da43);return _0x175df9['set'](_0xb272('0x20'),_0x2c1774+'-'+_0x4477d8+'/'+_0x493893)[_0xb272('0x1b')](_0x220ba9);}return null;};}function patchUpdates(_0x3435bc){return function(_0x22d244){try{jsonpatch[_0xb272('0x21')](_0x22d244,_0x3435bc,!![]);}catch(_0x6c961e){return BPromise[_0xb272('0x22')](_0x6c961e);}return _0x22d244[_0xb272('0x23')]();};}function saveUpdates(_0x3557cd,_0x1dea93){return function(_0x49d6dc){if(_0x49d6dc){return _0x49d6dc[_0xb272('0x24')](_0x3557cd)[_0xb272('0x25')](function(_0x25a68e){return _0x25a68e;});}return null;};}function removeEntity(_0x2a8282,_0x131cf7){return function(_0x53d495){if(_0x53d495){return _0x53d495['destroy']()[_0xb272('0x25')](function(){var _0x1846dd=_0x53d495['get']({'plain':!![]});var _0xf23781=_0xb272('0x26');return db[_0xb272('0x27')]['destroy']({'where':{'type':_0xf23781,'resourceId':_0x1846dd['id']}})[_0xb272('0x25')](function(){return _0x53d495;});})[_0xb272('0x25')](function(){_0x2a8282[_0xb272('0x1a')](0xcc)[_0xb272('0x28')]();});}};}function handleEntityNotFound(_0x2fc6c4,_0x193e27){return function(_0x39ffa8){if(!_0x39ffa8){_0x2fc6c4[_0xb272('0x19')](0x194);}return _0x39ffa8;};}function handleError(_0x2547b4,_0x30477f){_0x30477f=_0x30477f||0x1f4;return function(_0x300101){logger[_0xb272('0x29')](_0x300101[_0xb272('0x2a')]);if(_0x300101['name']){delete _0x300101[_0xb272('0x2b')];}_0x2547b4[_0xb272('0x1a')](_0x30477f)[_0xb272('0x2c')](_0x300101);};}exports['index']=function(_0x5b8640,_0xbc0c6a){var _0x5d0afc={},_0x1f52f3={},_0x5acc55={'count':0x0,'rows':[]};return db['CmCompany'][_0xb272('0x2d')]()[_0xb272('0x25')](function(_0x13b026){_0x1f52f3[_0xb272('0x2e')]=_['keys'](_0x13b026);_0x1f52f3[_0xb272('0x2f')]=_[_0xb272('0x30')](_0x5b8640[_0xb272('0x2f')]);_0x1f52f3[_0xb272('0x31')]=_[_0xb272('0x32')](_0x1f52f3[_0xb272('0x2e')],_0x1f52f3[_0xb272('0x2f')]);_0x5d0afc['attributes']=_[_0xb272('0x32')](_0x1f52f3['model'],qs[_0xb272('0x33')](_0x5b8640[_0xb272('0x2f')]['fields']));_0x5d0afc[_0xb272('0x34')]=_0x5d0afc[_0xb272('0x34')][_0xb272('0x35')]?_0x5d0afc[_0xb272('0x34')]:_0x1f52f3[_0xb272('0x2e')];if(!_0x5b8640['query'][_0xb272('0x36')](_0xb272('0x37'))){_0x5d0afc[_0xb272('0x1d')]=qs[_0xb272('0x1d')](_0x5b8640['query'][_0xb272('0x1d')]);_0x5d0afc[_0xb272('0x1f')]=qs[_0xb272('0x1f')](_0x5b8640['query'][_0xb272('0x1f')]);}_0x5d0afc['order']=qs[_0xb272('0x38')](_0x5b8640[_0xb272('0x2f')][_0xb272('0x38')]);_0x5d0afc['where']=qs['filters'](_[_0xb272('0x39')](_0x5b8640[_0xb272('0x2f')],_0x1f52f3['filters']),_0x13b026);if(_0x5b8640['query'][_0xb272('0x3a')]){_0x5d0afc[_0xb272('0x3b')]=_[_0xb272('0x3c')](_0x5d0afc[_0xb272('0x3b')],{'$or':_['map'](_0x5d0afc[_0xb272('0x34')],function(_0x203175){var _0x22c9e1={};_0x22c9e1[_0x203175]={'$like':'%'+_0x5b8640[_0xb272('0x2f')][_0xb272('0x3a')]+'%'};return _0x22c9e1;})});}_0x5d0afc=_['merge']({},_0x5d0afc,_0x5b8640['options']);var _0x442c92={'where':_0x5d0afc[_0xb272('0x3b')]};return db[_0xb272('0x3d')][_0xb272('0x1e')](_0x442c92)['then'](function(_0x692df5){_0x5acc55[_0xb272('0x1e')]=_0x692df5;if(_0x5b8640['query'][_0xb272('0x3e')]){_0x5d0afc[_0xb272('0x3f')]=[{'all':!![]}];}return db[_0xb272('0x3d')][_0xb272('0x40')](_0x5d0afc);})[_0xb272('0x25')](function(_0xdc8f1a){_0x5acc55[_0xb272('0x41')]=_0xdc8f1a;return _0x5acc55;})[_0xb272('0x25')](respondWithFilteredResult(_0xbc0c6a,_0x5d0afc))[_0xb272('0x42')](handleError(_0xbc0c6a,null));})[_0xb272('0x42')](handleError(_0xbc0c6a,null));};exports[_0xb272('0x43')]=function(_0x3e4dfd,_0x2d0b4a){var _0x3dc31e={'raw':![],'where':{'id':_0x3e4dfd[_0xb272('0x44')]['id']}},_0x43cfc1={};_0x43cfc1['model']=_[_0xb272('0x30')](db[_0xb272('0x3d')]['rawAttributes']);_0x43cfc1[_0xb272('0x2f')]=_['keys'](_0x3e4dfd[_0xb272('0x2f')]);_0x43cfc1[_0xb272('0x31')]=_[_0xb272('0x32')](_0x43cfc1[_0xb272('0x2e')],_0x43cfc1['query']);_0x3dc31e[_0xb272('0x34')]=_[_0xb272('0x32')](_0x43cfc1[_0xb272('0x2e')],qs['fields'](_0x3e4dfd['query']['fields']));_0x3dc31e['attributes']=_0x3dc31e[_0xb272('0x34')][_0xb272('0x35')]?_0x3dc31e[_0xb272('0x34')]:_0x43cfc1[_0xb272('0x2e')];if(_0x3e4dfd[_0xb272('0x2f')][_0xb272('0x3e')]){_0x3dc31e[_0xb272('0x3f')]=[{'all':!![]}];}_0x3dc31e=_[_0xb272('0x3c')]({},_0x3dc31e,_0x3e4dfd[_0xb272('0x45')]);return db[_0xb272('0x3d')]['find'](_0x3dc31e)[_0xb272('0x25')](handleEntityNotFound(_0x2d0b4a,null))[_0xb272('0x25')](respondWithResult(_0x2d0b4a,null))[_0xb272('0x42')](handleError(_0x2d0b4a,null));};exports[_0xb272('0x46')]=function(_0x503568,_0x407b95){return db['CmCompany']['create'](_0x503568[_0xb272('0x47')],{})['then'](function(_0x256bbb){var _0x3c21ed=_0x503568[_0xb272('0x48')][_0xb272('0x49')]({'plain':!![]});if(!_0x3c21ed)throw new Error(_0xb272('0x4a'));if(_0x3c21ed[_0xb272('0x4b')]===_0xb272('0x48')){var _0x3a7039=_0x256bbb[_0xb272('0x49')]({'plain':!![]});var _0x185e1c=_0xb272('0x26');return db[_0xb272('0x4c')]['find']({'where':{'name':_0x185e1c,'userProfileId':_0x3c21ed[_0xb272('0x4d')]},'raw':!![]})[_0xb272('0x25')](function(_0x6b6490){if(_0x6b6490&&_0x6b6490['autoAssociation']===0x0){return db[_0xb272('0x27')]['create']({'name':_0x3a7039[_0xb272('0x2b')],'resourceId':_0x3a7039['id'],'type':_0x6b6490['name'],'sectionId':_0x6b6490['id']},{})[_0xb272('0x25')](function(){return _0x256bbb;});}else{return _0x256bbb;}})[_0xb272('0x42')](function(_0x50f32c){logger[_0xb272('0x29')](_0xb272('0x4e'),_0x50f32c);throw _0x50f32c;});}return _0x256bbb;})[_0xb272('0x25')](respondWithResult(_0x407b95,0xc9))[_0xb272('0x42')](handleError(_0x407b95,null));};exports[_0xb272('0x24')]=function(_0xd02a44,_0x52009c){if(_0xd02a44[_0xb272('0x47')]['id']){delete _0xd02a44['body']['id'];}return db[_0xb272('0x3d')][_0xb272('0x4f')]({'where':{'id':_0xd02a44[_0xb272('0x44')]['id']}})[_0xb272('0x25')](handleEntityNotFound(_0x52009c,null))[_0xb272('0x25')](saveUpdates(_0xd02a44[_0xb272('0x47')],null))[_0xb272('0x25')](respondWithResult(_0x52009c,null))[_0xb272('0x42')](handleError(_0x52009c,null));};exports[_0xb272('0x50')]=function(_0x247185,_0x43bb2a){return db[_0xb272('0x3d')][_0xb272('0x4f')]({'where':{'id':_0x247185['params']['id']}})[_0xb272('0x25')](handleEntityNotFound(_0x43bb2a,null))[_0xb272('0x25')](removeEntity(_0x43bb2a,null))[_0xb272('0x42')](handleError(_0x43bb2a,null));};exports['describe']=function(_0x2fc535,_0x5e048d){return db['CmCompany'][_0xb272('0x2d')]()[_0xb272('0x25')](respondWithResult(_0x5e048d,null))[_0xb272('0x42')](handleError(_0x5e048d,null));};exports[_0xb272('0x51')]=function(_0x156af4,_0x10a81e,_0x40f4d0){return db[_0xb272('0x52')][_0xb272('0x4f')]({'where':{'id':_0x156af4[_0xb272('0x44')]['id']}})[_0xb272('0x25')](handleEntityNotFound(_0x10a81e,null))['then'](function(_0x1a6c1f){if(_0x1a6c1f){return _0x1a6c1f[_0xb272('0x51')](_0x156af4[_0xb272('0x47')][_0xb272('0x53')],_['omit'](_0x156af4[_0xb272('0x47')],['ids','id'])||{});}})[_0xb272('0x25')](respondWithResult(_0x10a81e,null))[_0xb272('0x42')](handleError(_0x10a81e,null));};exports[_0xb272('0x54')]=function(_0x5ef715,_0x34866d,_0x2f7872){var _0x3fade5={};var _0x38c93c={};var _0x1ef88d;var _0x160a76;return db['CmCompany'][_0xb272('0x55')]({'where':{'id':_0x5ef715[_0xb272('0x44')]['id']}})[_0xb272('0x25')](handleEntityNotFound(_0x34866d,null))[_0xb272('0x25')](function(_0x356627){if(_0x356627){_0x1ef88d=_0x356627;_0x38c93c[_0xb272('0x2e')]=_['keys'](db[_0xb272('0x52')][_0xb272('0x56')]);_0x38c93c[_0xb272('0x2f')]=_[_0xb272('0x30')](_0x5ef715[_0xb272('0x2f')]);_0x38c93c[_0xb272('0x31')]=_[_0xb272('0x32')](_0x38c93c['model'],_0x38c93c['query']);_0x3fade5['attributes']=_[_0xb272('0x32')](_0x38c93c[_0xb272('0x2e')],qs['fields'](_0x5ef715[_0xb272('0x2f')][_0xb272('0x33')]));_0x3fade5[_0xb272('0x34')]=_0x3fade5[_0xb272('0x34')][_0xb272('0x35')]?_0x3fade5[_0xb272('0x34')]:_0x38c93c[_0xb272('0x2e')];_0x3fade5[_0xb272('0x57')]=qs[_0xb272('0x38')](_0x5ef715[_0xb272('0x2f')][_0xb272('0x38')]);_0x3fade5['where']=qs[_0xb272('0x31')](_[_0xb272('0x39')](_0x5ef715[_0xb272('0x2f')],_0x38c93c[_0xb272('0x31')]));if(_0x5ef715[_0xb272('0x2f')][_0xb272('0x3a')]){_0x3fade5[_0xb272('0x3b')]=_[_0xb272('0x3c')](_0x3fade5[_0xb272('0x3b')],{'$or':_[_0xb272('0x58')](_0x3fade5[_0xb272('0x34')],function(_0x2403e3){var _0x3b1527={};_0x3b1527[_0x2403e3]={'$like':'%'+_0x5ef715[_0xb272('0x2f')][_0xb272('0x3a')]+'%'};return _0x3b1527;})});}_0x3fade5=_[_0xb272('0x3c')]({},_0x3fade5,_0x5ef715['options']);return _0x1ef88d[_0xb272('0x54')](_0x3fade5);}})[_0xb272('0x25')](function(_0x5f06c2){if(_0x5f06c2){_0x160a76=_0x5f06c2['length'];if(!_0x5ef715[_0xb272('0x2f')][_0xb272('0x36')](_0xb272('0x37'))){_0x3fade5[_0xb272('0x1d')]=qs[_0xb272('0x1d')](_0x5ef715['query'][_0xb272('0x1d')]);_0x3fade5[_0xb272('0x1f')]=qs[_0xb272('0x1f')](_0x5ef715[_0xb272('0x2f')][_0xb272('0x1f')]);}return _0x1ef88d[_0xb272('0x54')](_0x3fade5);}})[_0xb272('0x25')](function(_0x2c5724){if(_0x2c5724){return _0x2c5724?{'count':_0x160a76,'rows':_0x2c5724}:null;}})[_0xb272('0x25')](respondWithResult(_0x34866d,null))['catch'](handleError(_0x34866d,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index e129c3b..c3d01f0 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 _0x07a6=['moment','request-promise','path','rimraf','./cmCompany.attributes','exports','CmCompany','cm_companies','lodash','../../config/logger','api'];(function(_0x48baec,_0x3f9c47){var _0x4454ac=function(_0xfc751){while(--_0xfc751){_0x48baec['push'](_0x48baec['shift']());}};_0x4454ac(++_0x3f9c47);}(_0x07a6,0x17e));var _0x607a=function(_0x1a7f7d,_0x3cedf0){_0x1a7f7d=_0x1a7f7d-0x0;var _0x2a1453=_0x07a6[_0x1a7f7d];return _0x2a1453;};'use strict';var _=require(_0x607a('0x0'));var util=require('util');var logger=require(_0x607a('0x1'))(_0x607a('0x2'));var moment=require(_0x607a('0x3'));var BPromise=require('bluebird');var rp=require(_0x607a('0x4'));var fs=require('fs');var path=require(_0x607a('0x5'));var rimraf=require(_0x607a('0x6'));var config=require('../../config/environment');var attributes=require(_0x607a('0x7'));module[_0x607a('0x8')]=function(_0x11ddf9,_0x36b9e4){return _0x11ddf9['define'](_0x607a('0x9'),attributes,{'tableName':_0x607a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5c40=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','CmCompany','cm_companies','lodash','util'];(function(_0x4e11e7,_0x42d0b6){var _0x1d7d39=function(_0x416030){while(--_0x416030){_0x4e11e7['push'](_0x4e11e7['shift']());}};_0x1d7d39(++_0x42d0b6);}(_0x5c40,0x11c));var _0x05c4=function(_0x53e1c4,_0x11347f){_0x53e1c4=_0x53e1c4-0x0;var _0xaa2da3=_0x5c40[_0x53e1c4];return _0xaa2da3;};'use strict';var _=require(_0x05c4('0x0'));var util=require(_0x05c4('0x1'));var logger=require(_0x05c4('0x2'))(_0x05c4('0x3'));var moment=require(_0x05c4('0x4'));var BPromise=require(_0x05c4('0x5'));var rp=require(_0x05c4('0x6'));var fs=require('fs');var path=require(_0x05c4('0x7'));var rimraf=require('rimraf');var config=require(_0x05c4('0x8'));var attributes=require('./cmCompany.attributes');module[_0x05c4('0x9')]=function(_0x36383d,_0x2f3852){return _0x36383d[_0x05c4('0xa')](_0x05c4('0xb'),attributes,{'tableName':_0x05c4('0xc'),'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 c3ac4d2..bd1f116 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 _0x33d0=['info','debug','request\x20sent','stringify','error','code','CmCompany,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x33d0,0xc9));var _0x033d=function(_0x329a4c,_0x4a124f){_0x329a4c=_0x329a4c-0x0;var _0x4b4197=_0x33d0[_0x329a4c];return _0x4b4197;};'use strict';var _=require(_0x033d('0x0'));var util=require(_0x033d('0x1'));var moment=require(_0x033d('0x2'));var BPromise=require(_0x033d('0x3'));var rs=require(_0x033d('0x4'));var fs=require('fs');var Redis=require(_0x033d('0x5'));var db=require(_0x033d('0x6'))['db'];var utils=require(_0x033d('0x7'));var logger=require(_0x033d('0x8'))(_0x033d('0x9'));var config=require(_0x033d('0xa'));var jayson=require(_0x033d('0xb'));var client=jayson['client'][_0x033d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x229c68,_0x20e750,_0x4e4c68){return new BPromise(function(_0x29984f,_0x4ee2de){return client[_0x033d('0xd')](_0x229c68,_0x4e4c68)[_0x033d('0xe')](function(_0x34993d){logger[_0x033d('0xf')]('CmCompany,\x20%s,\x20%s',_0x20e750,'request\x20sent');logger[_0x033d('0x10')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x20e750,_0x033d('0x11'),JSON[_0x033d('0x12')](_0x34993d));if(_0x34993d[_0x033d('0x13')]){if(_0x34993d['error'][_0x033d('0x14')]===0x1f4){logger[_0x033d('0x13')](_0x033d('0x15'),_0x20e750,_0x34993d[_0x033d('0x13')]['message']);return _0x4ee2de(_0x34993d['error'][_0x033d('0x16')]);}logger[_0x033d('0x13')]('CmCompany,\x20%s,\x20%s',_0x20e750,_0x34993d[_0x033d('0x13')]['message']);return _0x29984f(_0x34993d[_0x033d('0x13')]['message']);}else{logger[_0x033d('0xf')](_0x033d('0x15'),_0x20e750,_0x033d('0x11'));_0x29984f(_0x34993d['result'][_0x033d('0x16')]);}})[_0x033d('0x17')](function(_0x3c2ce8){logger[_0x033d('0x13')]('CmCompany,\x20%s,\x20%s',_0x20e750,_0x3c2ce8);_0x4ee2de(_0x3c2ce8);});});} \ No newline at end of file +var _0x6178=['CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then'];(function(_0x4dd441,_0x4a0ea0){var _0x492067=function(_0x310ab8){while(--_0x310ab8){_0x4dd441['push'](_0x4dd441['shift']());}};_0x492067(++_0x4a0ea0);}(_0x6178,0x8e));var _0x8617=function(_0x275560,_0xead495){_0x275560=_0x275560-0x0;var _0x3dcabc=_0x6178[_0x275560];return _0x3dcabc;};'use strict';var _=require(_0x8617('0x0'));var util=require(_0x8617('0x1'));var moment=require(_0x8617('0x2'));var BPromise=require(_0x8617('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8617('0x4'));var db=require(_0x8617('0x5'))['db'];var utils=require(_0x8617('0x6'));var logger=require('../../config/logger')(_0x8617('0x7'));var config=require(_0x8617('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8617('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f6318,_0x5e6380,_0x185e85){return new BPromise(function(_0x2582e9,_0x470bcc){return client[_0x8617('0xa')](_0x1f6318,_0x185e85)[_0x8617('0xb')](function(_0x383555){logger['info'](_0x8617('0xc'),_0x5e6380,_0x8617('0xd'));logger[_0x8617('0xe')](_0x8617('0xf'),_0x5e6380,'request\x20sent',JSON[_0x8617('0x10')](_0x383555));if(_0x383555[_0x8617('0x11')]){if(_0x383555[_0x8617('0x11')][_0x8617('0x12')]===0x1f4){logger[_0x8617('0x11')](_0x8617('0xc'),_0x5e6380,_0x383555['error'][_0x8617('0x13')]);return _0x470bcc(_0x383555['error'][_0x8617('0x13')]);}logger['error'](_0x8617('0xc'),_0x5e6380,_0x383555[_0x8617('0x11')][_0x8617('0x13')]);return _0x2582e9(_0x383555[_0x8617('0x11')][_0x8617('0x13')]);}else{logger[_0x8617('0x14')](_0x8617('0xc'),_0x5e6380,_0x8617('0xd'));_0x2582e9(_0x383555['result']['message']);}})[_0x8617('0x15')](function(_0x5c6ec1){logger['error'](_0x8617('0xc'),_0x5e6380,_0x5c6ec1);_0x470bcc(_0x5c6ec1);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 91b9b2a..3e58b2a 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 _0x57ac=['/describe','describe','show','/:id/contacts','getContacts','post','create','addContacts','put','update','/:id','destroy','exports','multer','express','../../components/auth/service','./cmCompany.controller','get','isAuthenticated','index'];(function(_0x3d618f,_0x3bfd66){var _0x51a32b=function(_0x3f9e15){while(--_0x3f9e15){_0x3d618f['push'](_0x3d618f['shift']());}};_0x51a32b(++_0x3bfd66);}(_0x57ac,0x71));var _0xc57a=function(_0x81bb9b,_0x3d47b5){_0x81bb9b=_0x81bb9b-0x0;var _0x28cd0e=_0x57ac[_0x81bb9b];return _0x28cd0e;};'use strict';var multer=require(_0xc57a('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc57a('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc57a('0x2'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc57a('0x3'));router[_0xc57a('0x4')]('/',auth[_0xc57a('0x5')](),controller[_0xc57a('0x6')]);router[_0xc57a('0x4')](_0xc57a('0x7'),auth['isAuthenticated'](),controller[_0xc57a('0x8')]);router[_0xc57a('0x4')]('/:id',auth[_0xc57a('0x5')](),controller[_0xc57a('0x9')]);router[_0xc57a('0x4')](_0xc57a('0xa'),auth[_0xc57a('0x5')](),controller[_0xc57a('0xb')]);router[_0xc57a('0xc')]('/',auth[_0xc57a('0x5')](),controller[_0xc57a('0xd')]);router['post'](_0xc57a('0xa'),auth[_0xc57a('0x5')](),controller[_0xc57a('0xe')]);router[_0xc57a('0xf')]('/:id',auth[_0xc57a('0x5')](),controller[_0xc57a('0x10')]);router['delete'](_0xc57a('0x11'),auth[_0xc57a('0x5')](),controller[_0xc57a('0x12')]);module[_0xc57a('0x13')]=router; \ No newline at end of file +var _0x5def=['express','Router','fs-extra','../../components/auth/service','./cmCompany.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/contacts','post','addContacts','put','delete','destroy','exports','multer','util','path'];(function(_0x47412e,_0x1acf84){var _0x398524=function(_0x2d358c){while(--_0x2d358c){_0x47412e['push'](_0x47412e['shift']());}};_0x398524(++_0x1acf84);}(_0x5def,0x162));var _0xf5de=function(_0x3614f2,_0x1bb103){_0x3614f2=_0x3614f2-0x0;var _0x5dc391=_0x5def[_0x3614f2];return _0x5dc391;};'use strict';var multer=require(_0xf5de('0x0'));var util=require(_0xf5de('0x1'));var path=require(_0xf5de('0x2'));var timeout=require('connect-timeout');var express=require(_0xf5de('0x3'));var router=express[_0xf5de('0x4')]();var fs_extra=require(_0xf5de('0x5'));var auth=require(_0xf5de('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5de('0x7'));router[_0xf5de('0x8')]('/',auth[_0xf5de('0x9')](),controller['index']);router[_0xf5de('0x8')](_0xf5de('0xa'),auth[_0xf5de('0x9')](),controller[_0xf5de('0xb')]);router['get'](_0xf5de('0xc'),auth['isAuthenticated'](),controller[_0xf5de('0xd')]);router[_0xf5de('0x8')](_0xf5de('0xe'),auth[_0xf5de('0x9')](),controller['getContacts']);router[_0xf5de('0xf')]('/',auth[_0xf5de('0x9')](),controller['create']);router[_0xf5de('0xf')](_0xf5de('0xe'),auth[_0xf5de('0x9')](),controller[_0xf5de('0x10')]);router[_0xf5de('0x11')]('/:id',auth[_0xf5de('0x9')](),controller['update']);router[_0xf5de('0x12')](_0xf5de('0xc'),auth['isAuthenticated'](),controller[_0xf5de('0x13')]);module[_0xf5de('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index fd9642a..05ad743 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 _0x003c=['INTEGER','lodash','sequelize','exports','STRING','TEXT'];(function(_0x3edddc,_0xe5c487){var _0x512473=function(_0x2ae0d4){while(--_0x2ae0d4){_0x3edddc['push'](_0x3edddc['shift']());}};_0x512473(++_0xe5c487);}(_0x003c,0x8b));var _0xc003=function(_0x1b4166,_0x422c86){_0x1b4166=_0x1b4166-0x0;var _0x35df01=_0x003c[_0x1b4166];return _0x35df01;};'use strict';var _=require(_0xc003('0x0'));var Sequelize=require(_0xc003('0x1'));module[_0xc003('0x2')]={'firstName':{'type':Sequelize[_0xc003('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xc003('0x3')]},'street':{'type':Sequelize[_0xc003('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xc003('0x3')]},'country':{'type':Sequelize[_0xc003('0x3')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc003('0x4')]},'phone':{'type':Sequelize[_0xc003('0x3')]},'mobile':{'type':Sequelize[_0xc003('0x3')]},'fax':{'type':Sequelize[_0xc003('0x3')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xc003('0x3')]},'fb_data':{'type':Sequelize[_0xc003('0x3')]},'twitter':{'type':Sequelize[_0xc003('0x3')]},'skype':{'type':Sequelize[_0xc003('0x3')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0xc003('0x3')]},'line':{'type':Sequelize[_0xc003('0x3')]},'wechat':{'type':Sequelize[_0xc003('0x3')]},'telegram':{'type':Sequelize[_0xc003('0x3')]},'UserId':{'type':Sequelize[_0xc003('0x5')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x631f=['lodash','sequelize','STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x631f,0x198));var _0xf631=function(_0x5a8aa3,_0x2294d5){_0x5a8aa3=_0x5a8aa3-0x0;var _0x5d0458=_0x631f[_0x5a8aa3];return _0x5d0458;};'use strict';var _=require(_0xf631('0x0'));var Sequelize=require(_0xf631('0x1'));module['exports']={'firstName':{'type':Sequelize[_0xf631('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xf631('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xf631('0x2')]},'country':{'type':Sequelize[_0xf631('0x2')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf631('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xf631('0x2')]},'fax':{'type':Sequelize[_0xf631('0x2')]},'email':{'type':Sequelize[_0xf631('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xf631('0x2')]},'fb_data':{'type':Sequelize[_0xf631('0x2')]},'twitter':{'type':Sequelize[_0xf631('0x2')]},'skype':{'type':Sequelize[_0xf631('0x2')]},'teams':{'type':Sequelize[_0xf631('0x2')]},'viber':{'type':Sequelize[_0xf631('0x2')]},'line':{'type':Sequelize[_0xf631('0x2')]},'wechat':{'type':Sequelize[_0xf631('0x2')]},'telegram':{'type':Sequelize[_0xf631('0x2')]},'UserId':{'type':Sequelize[_0xf631('0x4')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xf631('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xf631('0x6')],'defaultValue':Sequelize[_0xf631('0x7')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 6274205..1a8c9ca 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 _0x38fd=['then','end','stack','name','send','index','CmContact','keys','length','startsWith','push','CmCustomField','findOne','trimStart','fieldType','type','query','filters','intersection','model','attributes','fields','nolimit','sort','where','pick','field','color','from','tools_tags','select','left_join','cm_user_has_contacts','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','expr','search','parseSearch','sqlOperator','conditions','Tag','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','uc.UserId\x20=\x20?','value','dateOfBirth','datetime','DATE','text','start','hasOwnProperty','filter','Contact','ListId','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','clone','order','DESC','isEmpty','having','t.id\x20IN\x20?','some','user','getLists','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','role','agent','toString','sequelize','keyBy','merge','c.firstName','c.phone','c.mobile','c.fax','c.email','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','TagIds','Tags','rows','catch','describe','tags','cf_','displayName','findAll','columnName','alias','custom','values','body','get','mergeWith','isArray','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','create','join','bulkCreate','duplicates','$or','findOrCreate','spread','show','find','params','isNil','$and','omit','format','cf_%d','pickBy','table','cm_contacts','setFields','toParam','phone','getTags','rawAttributes','options','setTags','ContactId','includeAll','include','getHopperHistories','getHopperFinals','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','No\x20association\x20values\x20specified!','socket_timestamp','binding_values','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','root','server/files/tmp','file','chmodSync','0777','fork','../../components/import/cm/csv','pid','upload','parse','meta','import','binding','firstName','No\x20firstName\x20column\x20specified','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','stringify','exit','getJourney','mail','chat','sms','openchannel','fax','voice','channel','includes','Invalid\x20channel','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','destination','endtime','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','findAndCountAll','Website','closed','closedAt','disposition','secondDisposition','key','Owner','customerIp','customerPort','deviceModel','ratingMessage','ratingType','referer','subject','substatus','startCase','Interaction','all','sortBy','reverse','slice','moment','bluebird','util','squel','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./cmContact.socket','register','offset','count','limit','status','set','Content-Range','json','update','destroy'];(function(_0x1fc0f3,_0x4e92c7){var _0x50dde9=function(_0x2773e7){while(--_0x2773e7){_0x1fc0f3['push'](_0x1fc0f3['shift']());}};_0x50dde9(++_0x4e92c7);}(_0x38fd,0x100));var _0xd38f=function(_0x1e0806,_0x365bc5){_0x1e0806=_0x1e0806-0x0;var _0x2ac21d=_0x38fd[_0x1e0806];return _0x2ac21d;};'use strict';var moment=require(_0xd38f('0x0'));var BPromise=require(_0xd38f('0x1'));var util=require(_0xd38f('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0xd38f('0x3'));var Papa=require(_0xd38f('0x4'));var Redis=require(_0xd38f('0x5'));var qs=require(_0xd38f('0x6'));var as=require(_0xd38f('0x7'));var logger=require(_0xd38f('0x8'))(_0xd38f('0x9'));var config=require(_0xd38f('0xa'));var db=require(_0xd38f('0xb'))['db'];config[_0xd38f('0xc')]=_[_0xd38f('0xd')](config[_0xd38f('0xc')],{'host':_0xd38f('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd38f('0xc')]));require(_0xd38f('0xf'))[_0xd38f('0x10')](socket);function respondWithResult(_0xd4cc94,_0x217157){_0x217157=_0x217157||0xc8;return function(_0x3c2afe){if(_0x3c2afe){return _0xd4cc94['status'](_0x217157)['json'](_0x3c2afe);}};}function respondWithFilteredResult(_0x2f52b2,_0x5cd68c){return function(_0x9f473b){if(_0x9f473b){var _0x5f1cde=typeof _0x5cd68c[_0xd38f('0x11')]==='undefined'&&typeof _0x5cd68c['limit']==='undefined';var _0x5b6651=_0x9f473b[_0xd38f('0x12')];var _0x299e04=_0x5f1cde?0x0:_0x5cd68c[_0xd38f('0x11')];var _0x2f978b=_0x5f1cde?_0x9f473b[_0xd38f('0x12')]:_0x5cd68c['offset']+_0x5cd68c[_0xd38f('0x13')];var _0x238af6;if(_0x2f978b>=_0x5b6651){_0x2f978b=_0x5b6651;_0x238af6=0xc8;}else{_0x238af6=0xce;}_0x2f52b2[_0xd38f('0x14')](_0x238af6);return _0x2f52b2[_0xd38f('0x15')](_0xd38f('0x16'),_0x299e04+'-'+_0x2f978b+'/'+_0x5b6651)[_0xd38f('0x17')](_0x9f473b);}return null;};}function saveUpdates(_0x39b1f1){return function(_0x48f1b7){if(_0x48f1b7){return _0x48f1b7[_0xd38f('0x18')](_0x39b1f1)['then'](function(_0x424aa3){return _0x424aa3;});}return null;};}function removeEntity(_0x338f4c){return function(_0x7c897d){if(_0x7c897d){return _0x7c897d[_0xd38f('0x19')]()[_0xd38f('0x1a')](function(){_0x338f4c[_0xd38f('0x14')](0xcc)[_0xd38f('0x1b')]();});}};}function handleEntityNotFound(_0x15e3df){return function(_0x2c02bf){if(!_0x2c02bf){_0x15e3df['sendStatus'](0x194);}return _0x2c02bf;};}function handleError(_0x8bc840,_0x4c821f){_0x4c821f=_0x4c821f||0x1f4;return function(_0xba723b){logger['error'](_0xba723b[_0xd38f('0x1c')]);if(_0xba723b[_0xd38f('0x1d')]){delete _0xba723b[_0xd38f('0x1d')];}_0x8bc840[_0xd38f('0x14')](_0x4c821f)[_0xd38f('0x1e')](_0xba723b);};}exports[_0xd38f('0x1f')]=function(_0x1d02cc,_0x49bc03){var _0x158095={},_0x5dbce4={},_0x5dbea0={'count':0x0,'rows':[]};return db[_0xd38f('0x20')]['describe']()['then'](function(_0x11f9c1){var _0xd726db=[];for(var _0x33302a=0x0;_0x33302a0x1){_0x28d5a5['or'](_0xd38f('0x5b'),qs[_0xd38f('0x5c')](_0x2fda7f),null);}else{if(qs[_0xd38f('0x5d')](_0x2fda7f)){_0x28d5a5['or'](_0xd38f('0x5e'),_0x2fda7f+'%');_0x28d5a5['or']('c.phone\x20LIKE\x20?',_0x2fda7f+'%');_0x28d5a5['or'](_0xd38f('0x5f'),_0x2fda7f+'%');_0x28d5a5['or'](_0xd38f('0x60'),_0x2fda7f+'%');}else if(qs[_0xd38f('0x61')](_0x2fda7f)){_0x28d5a5['or'](_0xd38f('0x62'),_0x2fda7f+'%');}else{_0x28d5a5['or'](_0xd38f('0x63'),'%'+_0x2fda7f+'%');_0x28d5a5['or'](_0xd38f('0x64'),'%'+_0x2fda7f+'%');_0x28d5a5['or'](_0xd38f('0x62'),'%'+_0x2fda7f+'%');}}}}_0x3ee8da[_0xd38f('0x32')](_0x28d5a5);_0x3ee8da[_0xd38f('0x65')](_0xd38f('0x66'));var _0x61e8fd={'type':db[_0xd38f('0x67')][_0xd38f('0x68')][_0xd38f('0x69')],'raw':!![]};var _0x15d98f=_0x3ee8da[_0xd38f('0x6a')]()[_0xd38f('0x34')](_0xd38f('0x66'));if(_0x158095['order']){_0x158095['order'][_0xd38f('0x46')](function(_0x5dc6e5){_0x3ee8da[_0xd38f('0x6b')]('c.'+_0x5dc6e5[0x0],_0x5dc6e5[0x1]===_0xd38f('0x6c')?![]:!![]);});}if(!_[_0xd38f('0x6d')](_0x4eab67)){_0x3ee8da[_0xd38f('0x6e')](_0x48b40e);_0x15d98f[_0xd38f('0x32')](_0xd38f('0x6f'),_0x4eab67);}BPromise['resolve']()[_0xd38f('0x1a')](function(){if(!_0x31e6)return;if(_0x1d02cc['user']['role']!=='agent')return;if(!_[_0xd38f('0x70')](_0x31e6[_0xd38f('0x42')],[_0xd38f('0x34'),_0xd38f('0x49')])){return _0x1d02cc[_0xd38f('0x71')][_0xd38f('0x72')]({'attributes':['id'],'raw':!![]})[_0xd38f('0x1a')](function(_0x275d87){if(_['isEmpty'](_0x275d87)){_0x15d98f['where'](_0xd38f('0x73'));_0x3ee8da[_0xd38f('0x32')](_0xd38f('0x73'));}else{_0x15d98f[_0xd38f('0x32')](_0xd38f('0x74'),_[_0xd38f('0x45')](_0x275d87,'id'));_0x3ee8da[_0xd38f('0x32')](_0xd38f('0x74'),_['map'](_0x275d87,'id'));}});}})['then'](function(){if(_0x1d02cc[_0xd38f('0x71')][_0xd38f('0x75')]===_0xd38f('0x76')&&!_0x31e6&&!_0x1d02cc[_0xd38f('0x2a')][_0xd38f('0x55')])return[];return db['sequelize'][_0xd38f('0x2a')](_0x15d98f[_0xd38f('0x77')](),_0x61e8fd);})[_0xd38f('0x1a')](function(_0x4cdc09){_0x5dbea0[_0xd38f('0x12')]=_0x4cdc09[_0xd38f('0x22')];if(_0x5dbea0[_0xd38f('0x12')]===0x0)return[];return db[_0xd38f('0x78')][_0xd38f('0x2a')](_0x1c7605[_0xd38f('0x77')](),_0x61e8fd)[_0xd38f('0x1a')](function(_0x29251e){_0x295416=_[_0xd38f('0x79')](_0x29251e,'id');_0x61e8fd=_[_0xd38f('0x7a')](_0x61e8fd,{'model':db[_0xd38f('0x20')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1d02cc[_0xd38f('0x2a')][_0xd38f('0x2f')]){_0x158095[_0xd38f('0x2e')][_0xd38f('0x46')](function(_0x48d58f){_0x3ee8da[_0xd38f('0x34')]('c.'+_0x48d58f);});}else{_0x3ee8da[_0xd38f('0x34')](_0xd38f('0x66'));_0x3ee8da['field'](_0xd38f('0x7b'));_0x3ee8da[_0xd38f('0x34')]('c.lastName');_0x3ee8da[_0xd38f('0x34')](_0xd38f('0x7c'));_0x3ee8da[_0xd38f('0x34')](_0xd38f('0x7d'));_0x3ee8da[_0xd38f('0x34')](_0xd38f('0x7e'));_0x3ee8da[_0xd38f('0x34')](_0xd38f('0x7f'));_0x3ee8da['field'](_0xd38f('0x80'));_0x3ee8da[_0xd38f('0x34')](_0xd38f('0x81'));_0x3ee8da[_0xd38f('0x34')](_0xd38f('0x82'));_0x3ee8da[_0xd38f('0x34')](_0xd38f('0x83'));_0x3ee8da[_0xd38f('0x34')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xd38f('0x84'));}if(_0x158095[_0xd38f('0x13')])_0x3ee8da[_0xd38f('0x13')](_0x158095[_0xd38f('0x13')]);if(_0x158095[_0xd38f('0x11')])_0x3ee8da[_0xd38f('0x11')](_0x158095[_0xd38f('0x11')]);return db['sequelize'][_0xd38f('0x2a')](_0x3ee8da['toString'](),_0x61e8fd);});})['then'](function(_0x3f5d17){_0x3f5d17['forEach'](function(_0x27eaea){if(_0x27eaea['TagIds']){_0x27eaea[_0xd38f('0x85')]=[];_0x27eaea[_0xd38f('0x84')][_0xd38f('0x44')](',')[_0xd38f('0x46')](function(_0x3897e2){_0x27eaea[_0xd38f('0x85')][_0xd38f('0x24')](_0x295416[_0x3897e2]);});}delete _0x27eaea[_0xd38f('0x84')];});_0x5dbea0[_0xd38f('0x86')]=_0x3f5d17;return _0x5dbea0;})[_0xd38f('0x1a')](respondWithFilteredResult(_0x49bc03,_0x158095));})[_0xd38f('0x87')](handleError(_0x49bc03,null));};exports['destroy']=function(_0xf38c79,_0x2936ae){return db[_0xd38f('0x20')]['find']({'where':{'id':_0xf38c79['params']['id']}})[_0xd38f('0x1a')](handleEntityNotFound(_0x2936ae,null))[_0xd38f('0x1a')](removeEntity(_0x2936ae,null))[_0xd38f('0x87')](handleError(_0x2936ae,null));};exports[_0xd38f('0x88')]=function(_0x598bc8,_0x2d680d){return db[_0xd38f('0x20')]['describe']()[_0xd38f('0x1a')](function(_0x3e7772){delete _0x3e7772[_0xd38f('0x89')];for(var _0x5b4f05=0x0;_0x5b4f05=_0x2a9492){_0x485496=_0x2a9492;_0x5373bc=0xc8;}else{_0x5373bc=0xce;}_0x242717[_0x2208('0xf')](_0x5373bc);return _0x242717['set'](_0x2208('0x14'),_0x3b7f23+'-'+_0x485496+'/'+_0x2a9492)[_0x2208('0x10')](_0xf557ec);}return null;};}function saveUpdates(_0x12a701){return function(_0x1dde6a){if(_0x1dde6a){return _0x1dde6a[_0x2208('0x15')](_0x12a701)[_0x2208('0x16')](function(_0x51f03a){return _0x51f03a;});}return null;};}function removeEntity(_0x6b27ee){return function(_0x2a3450){if(_0x2a3450){return _0x2a3450[_0x2208('0x17')]()[_0x2208('0x16')](function(){_0x6b27ee[_0x2208('0xf')](0xcc)[_0x2208('0x18')]();});}};}function handleEntityNotFound(_0x3e7733){return function(_0xda6614){if(!_0xda6614){_0x3e7733[_0x2208('0x19')](0x194);}return _0xda6614;};}function handleError(_0x289c0c,_0x46a1e5){_0x46a1e5=_0x46a1e5||0x1f4;return function(_0x3092c3){logger[_0x2208('0x1a')](_0x3092c3['stack']);if(_0x3092c3[_0x2208('0x1b')]){delete _0x3092c3[_0x2208('0x1b')];}_0x289c0c[_0x2208('0xf')](_0x46a1e5)[_0x2208('0x1c')](_0x3092c3);};}exports[_0x2208('0x1d')]=function(_0x43e350,_0x246706){var _0x274276={},_0x3970af={},_0x5b85e7={'count':0x0,'rows':[]};return db[_0x2208('0x1e')][_0x2208('0x1f')]()['then'](function(_0x5303f3){var _0x5b412b=[];for(var _0x331bba=0x0;_0x331bba0x1){_0x11096d['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x2208('0x60')](_0x27e48d),null);}else{if(qs['isNumeric'](_0x27e48d)){_0x11096d['or']('c.id\x20LIKE\x20?',_0x27e48d+'%');_0x11096d['or'](_0x2208('0x61'),_0x27e48d+'%');_0x11096d['or']('c.mobile\x20LIKE\x20?',_0x27e48d+'%');_0x11096d['or']('c.fax\x20LIKE\x20?',_0x27e48d+'%');}else if(qs['isEmail'](_0x27e48d)){_0x11096d['or'](_0x2208('0x62'),_0x27e48d+'%');}else{_0x11096d['or']('c.firstName\x20LIKE\x20?','%'+_0x27e48d+'%');_0x11096d['or'](_0x2208('0x63'),'%'+_0x27e48d+'%');_0x11096d['or'](_0x2208('0x62'),'%'+_0x27e48d+'%');}}}}_0x10e47f[_0x2208('0x33')](_0x11096d);_0x10e47f[_0x2208('0x64')](_0x2208('0x65'));var _0x468a43={'type':db[_0x2208('0x66')]['QueryTypes']['SELECT'],'raw':!![]};var _0x37669a=_0x10e47f['clone']()[_0x2208('0x35')](_0x2208('0x65'));if(_0x274276[_0x2208('0x31')]){_0x274276[_0x2208('0x31')]['forEach'](function(_0x5d7e98){_0x10e47f['order']('c.'+_0x5d7e98[0x0],_0x5d7e98[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x2bb1a5)){_0x10e47f[_0x2208('0x67')](_0x58ef2f);_0x37669a[_0x2208('0x33')](_0x2208('0x68'),_0x2bb1a5);}BPromise[_0x2208('0x69')]()[_0x2208('0x16')](function(){if(!_0x38117a)return;if(_0x43e350[_0x2208('0x6a')]['role']!==_0x2208('0x6b'))return;if(!_[_0x2208('0x6c')](_0x38117a[_0x2208('0x43')],[_0x2208('0x35'),'User'])){return _0x43e350[_0x2208('0x6a')][_0x2208('0x6d')]({'attributes':['id'],'raw':!![]})['then'](function(_0x103bac){if(_[_0x2208('0x56')](_0x103bac)){_0x37669a['where'](_0x2208('0x6e'));_0x10e47f[_0x2208('0x33')](_0x2208('0x6e'));}else{_0x37669a[_0x2208('0x33')](_0x2208('0x59'),_[_0x2208('0x48')](_0x103bac,'id'));_0x10e47f[_0x2208('0x33')]('c.ListId\x20IN\x20?',_[_0x2208('0x48')](_0x103bac,'id'));}});}})[_0x2208('0x16')](function(){if(_0x43e350[_0x2208('0x6a')][_0x2208('0x6f')]===_0x2208('0x6b')&&!_0x38117a&&!_0x43e350[_0x2208('0x29')]['ListId'])return[];return db[_0x2208('0x70')]['query'](_0x37669a[_0x2208('0x71')](),_0x468a43);})[_0x2208('0x16')](function(_0x5d83bb){_0x5b85e7['count']=_0x5d83bb[_0x2208('0x21')];if(_0x5b85e7[_0x2208('0x13')]===0x0)return[];return db[_0x2208('0x70')]['query'](_0x1fc29f[_0x2208('0x71')](),_0x468a43)[_0x2208('0x16')](function(_0x25ed5f){_0x365be8=_[_0x2208('0x72')](_0x25ed5f,'id');_0x468a43=_['merge'](_0x468a43,{'model':db[_0x2208('0x1e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x43e350[_0x2208('0x29')][_0x2208('0x2d')]){_0x274276[_0x2208('0x2b')]['forEach'](function(_0x210084){_0x10e47f[_0x2208('0x35')]('c.'+_0x210084);});}else{_0x10e47f['field']('c.id');_0x10e47f[_0x2208('0x35')](_0x2208('0x73'));_0x10e47f[_0x2208('0x35')](_0x2208('0x74'));_0x10e47f['field'](_0x2208('0x75'));_0x10e47f[_0x2208('0x35')](_0x2208('0x76'));_0x10e47f[_0x2208('0x35')]('c.fax');_0x10e47f[_0x2208('0x35')]('c.email');_0x10e47f['field'](_0x2208('0x77'));_0x10e47f[_0x2208('0x35')](_0x2208('0x78'));_0x10e47f[_0x2208('0x35')](_0x2208('0x79'));_0x10e47f[_0x2208('0x35')](_0x2208('0x7a'));_0x10e47f[_0x2208('0x35')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x2208('0x7b'));}if(_0x274276[_0x2208('0x12')])_0x10e47f['limit'](_0x274276['limit']);if(_0x274276['offset'])_0x10e47f[_0x2208('0x30')](_0x274276[_0x2208('0x30')]);return db[_0x2208('0x70')][_0x2208('0x29')](_0x10e47f[_0x2208('0x71')](),_0x468a43);});})[_0x2208('0x16')](function(_0x254d52){_0x254d52[_0x2208('0x57')](function(_0x22e51b){if(_0x22e51b[_0x2208('0x7b')]){_0x22e51b[_0x2208('0x7c')]=[];_0x22e51b['TagIds'][_0x2208('0x47')](',')['forEach'](function(_0xf0f07a){_0x22e51b['Tags'][_0x2208('0x24')](_0x365be8[_0xf0f07a]);});}delete _0x22e51b[_0x2208('0x7b')];});_0x5b85e7[_0x2208('0x7d')]=_0x254d52;return _0x5b85e7;})['then'](respondWithFilteredResult(_0x246706,_0x274276));})['catch'](handleError(_0x246706,null));};exports[_0x2208('0x17')]=function(_0xf4f436,_0x467f45){return db[_0x2208('0x1e')][_0x2208('0x44')]({'where':{'id':_0xf4f436[_0x2208('0x7e')]['id']}})[_0x2208('0x16')](handleEntityNotFound(_0x467f45,null))[_0x2208('0x16')](removeEntity(_0x467f45,null))[_0x2208('0x7f')](handleError(_0x467f45,null));};exports['describe']=function(_0x59db23,_0x314292){return db['CmContact'][_0x2208('0x1f')]()[_0x2208('0x16')](function(_0x5101ce){delete _0x5101ce['tags'];for(var _0x5b8888=0x0;_0x5b8888{}\s\\|]/g,'-');_0x5709cf(null,util[_0x2a7f('0x24')](_0x2a7f('0x25'),path[_0x2a7f('0x26')](_0x2f1be9[_0x2a7f('0x22')],path['extname'](_0x2f1be9['originalname'])),Date[_0x2a7f('0x27')](),path['extname'](_0x2f1be9[_0x2a7f('0x22')])));}})});router[_0x2a7f('0x1b')]('/csv',upload[_0x2a7f('0x28')](_0x2a7f('0x29')),controller['uploadCsv']);var upload=multer({'storage':multer[_0x2a7f('0x2a')]({'destination':function(_0x1ab178,_0x425e58,_0x5824fa){_0x5824fa(null,path[_0x2a7f('0x20')](config[_0x2a7f('0x21')],_0x2a7f('0x2b')));},'filename':function(_0x575b2a,_0xb15cec,_0x3cb9a3){_0xb15cec[_0x2a7f('0x22')]=_0xb15cec['originalname'][_0x2a7f('0x23')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3cb9a3(null,util[_0x2a7f('0x24')](_0x2a7f('0x25'),path[_0x2a7f('0x26')](_0xb15cec[_0x2a7f('0x22')],path[_0x2a7f('0x2c')](_0xb15cec[_0x2a7f('0x22')])),Date[_0x2a7f('0x27')](),path[_0x2a7f('0x2c')](_0xb15cec[_0x2a7f('0x22')])));}})});router['post'](_0x2a7f('0x2d'),upload[_0x2a7f('0x28')]('file'),controller[_0x2a7f('0x2e')]);router[_0x2a7f('0x1b')]('/upload/:id',auth[_0x2a7f('0x9')](),controller[_0x2a7f('0x2f')]);router['put']('/:id',auth[_0x2a7f('0x9')](),controller[_0x2a7f('0x30')]);router['delete']('/:id',auth[_0x2a7f('0x9')](),controller[_0x2a7f('0x31')]);module[_0x2a7f('0x32')]=router; \ No newline at end of file +var _0x8746=['/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/jscripty_sessions','getJscriptySessions','getJourney','post','/merge','merge','create','setTags','diskStorage','join','root','server/files/tmp','originalname','replace','format','%s-%s%s','basename','extname','now','single','file','uploadCsv','/upload','upload','/upload/:id','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/tags','getTags'];(function(_0x17ca16,_0x34ac15){var _0x224d85=function(_0x3d5a1b){while(--_0x3d5a1b){_0x17ca16['push'](_0x17ca16['shift']());}};_0x224d85(++_0x34ac15);}(_0x8746,0xb0));var _0x6874=function(_0x5df061,_0x400a05){_0x5df061=_0x5df061-0x0;var _0x5a4ef6=_0x8746[_0x5df061];return _0x5a4ef6;};'use strict';var multer=require(_0x6874('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6874('0x1'));var express=require(_0x6874('0x2'));var router=express[_0x6874('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6874('0x4'));var interaction=require(_0x6874('0x5'));var config=require(_0x6874('0x6'));var controller=require(_0x6874('0x7'));router['get']('/',auth[_0x6874('0x8')](),controller['index']);router[_0x6874('0x9')](_0x6874('0xa'),auth[_0x6874('0x8')](),controller[_0x6874('0xb')]);router[_0x6874('0x9')](_0x6874('0xc'),auth[_0x6874('0x8')](),controller[_0x6874('0xd')]);router[_0x6874('0x9')](_0x6874('0xe'),auth['isAuthenticated'](),controller[_0x6874('0xf')]);router['get'](_0x6874('0x10'),auth[_0x6874('0x8')](),controller['getHoppers']);router[_0x6874('0x9')](_0x6874('0x11'),auth[_0x6874('0x8')](),controller[_0x6874('0x12')]);router[_0x6874('0x9')]('/:id/hopper_finals',auth[_0x6874('0x8')](),controller['getHopperFinals']);router[_0x6874('0x9')](_0x6874('0x13'),auth[_0x6874('0x8')](),controller[_0x6874('0x14')]);router[_0x6874('0x9')]('/:id/journey',auth[_0x6874('0x8')](),controller[_0x6874('0x15')]);router[_0x6874('0x16')](_0x6874('0x17'),auth['isAuthenticated'](),controller[_0x6874('0x18')]);router[_0x6874('0x16')]('/',auth[_0x6874('0x8')](),controller[_0x6874('0x19')]);router[_0x6874('0x16')]('/create_many',auth[_0x6874('0x8')](),controller['bulkCreate']);router['post'](_0x6874('0xe'),auth[_0x6874('0x8')](),controller[_0x6874('0x1a')]);var upload=multer({'storage':multer[_0x6874('0x1b')]({'destination':function(_0x448cb6,_0x26f70f,_0x1de152){_0x1de152(null,path[_0x6874('0x1c')](config[_0x6874('0x1d')],_0x6874('0x1e')));},'filename':function(_0x11682c,_0x25d51d,_0x5c53dd){_0x25d51d[_0x6874('0x1f')]=_0x25d51d[_0x6874('0x1f')][_0x6874('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5c53dd(null,util[_0x6874('0x21')](_0x6874('0x22'),path[_0x6874('0x23')](_0x25d51d[_0x6874('0x1f')],path[_0x6874('0x24')](_0x25d51d[_0x6874('0x1f')])),Date[_0x6874('0x25')](),path[_0x6874('0x24')](_0x25d51d[_0x6874('0x1f')])));}})});router['post']('/csv',upload[_0x6874('0x26')](_0x6874('0x27')),controller[_0x6874('0x28')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5a7cf1,_0x412fb0,_0x45d530){_0x45d530(null,path[_0x6874('0x1c')](config[_0x6874('0x1d')],_0x6874('0x1e')));},'filename':function(_0x12c0ce,_0x43a8e0,_0x4fb547){_0x43a8e0[_0x6874('0x1f')]=_0x43a8e0[_0x6874('0x1f')][_0x6874('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4fb547(null,util[_0x6874('0x21')]('%s-%s%s',path['basename'](_0x43a8e0['originalname'],path[_0x6874('0x24')](_0x43a8e0[_0x6874('0x1f')])),Date['now'](),path[_0x6874('0x24')](_0x43a8e0[_0x6874('0x1f')])));}})});router[_0x6874('0x16')](_0x6874('0x29'),upload['single'](_0x6874('0x27')),controller[_0x6874('0x2a')]);router['post'](_0x6874('0x2b'),auth[_0x6874('0x8')](),controller['import']);router['put']('/:id',auth[_0x6874('0x8')](),controller[_0x6874('0x2c')]);router[_0x6874('0x2d')]('/:id',auth[_0x6874('0x8')](),controller[_0x6874('0x2e')]);module[_0x6874('0x2f')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 756ec0c..41f1c24 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 _0xc7cb=['isArray','values','stringify','BOOLEAN','ENUM','voice','sequelize','lodash','exports','VIRTUAL','STRING','setDataValue','alias','getDataValue','name','TEXT','long','type','parse'];(function(_0xaf3230,_0x3cc36c){var _0xf96c02=function(_0x1ddccf){while(--_0x1ddccf){_0xaf3230['push'](_0xaf3230['shift']());}};_0xf96c02(++_0x3cc36c);}(_0xc7cb,0x1e1));var _0xbc7c=function(_0x463304,_0x2a29ae){_0x463304=_0x463304-0x0;var _0x3ee5f6=_0xc7cb[_0x463304];return _0x3ee5f6;};'use strict';var Sequelize=require(_0xbc7c('0x0'));var _=require(_0xbc7c('0x1'));module[_0xbc7c('0x2')]={'name':{'type':Sequelize[_0xbc7c('0x3')],'get':function(_0x1f56c3){return this['getDataValue']('alias');}},'alias':{'type':Sequelize[_0xbc7c('0x4')],'allowNull':![],'set':function(_0x3b7ad8){this[_0xbc7c('0x5')](_0xbc7c('0x6'),_0x3b7ad8?_0x3b7ad8:this[_0xbc7c('0x7')](_0xbc7c('0x8')));}},'type':{'type':Sequelize[_0xbc7c('0x4')],'allowNull':![]},'values':{'type':Sequelize[_0xbc7c('0x9')](_0xbc7c('0xa')),'get':function(){if(this[_0xbc7c('0x7')](_0xbc7c('0xb'))==='select'){return JSON[_0xbc7c('0xc')](this[_0xbc7c('0x7')]('values'));}else{return this[_0xbc7c('0x7')]('values');}},'set':function(_0x549023){if(Array[_0xbc7c('0xd')](_0x549023)){this['setDataValue'](_0xbc7c('0xe'),JSON[_0xbc7c('0xf')](_0x549023));}else{this[_0xbc7c('0x5')](_0xbc7c('0xe'),_0x549023);}}},'required':{'type':Sequelize[_0xbc7c('0x10')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xbc7c('0x10')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xbc7c('0x11')](_0xbc7c('0x12'))}}; \ No newline at end of file +var _0x57da=['STRING','TEXT','getDataValue','type','select','parse','values','isArray','BOOLEAN','ENUM','voice','sequelize','lodash','exports','VIRTUAL','setDataValue','name'];(function(_0x20ca39,_0x54c173){var _0x542705=function(_0x1f3224){while(--_0x1f3224){_0x20ca39['push'](_0x20ca39['shift']());}};_0x542705(++_0x54c173);}(_0x57da,0x170));var _0xa57d=function(_0x512bdc,_0x2fcdcb){_0x512bdc=_0x512bdc-0x0;var _0x51a7f0=_0x57da[_0x512bdc];return _0x51a7f0;};'use strict';var Sequelize=require(_0xa57d('0x0'));var _=require(_0xa57d('0x1'));module[_0xa57d('0x2')]={'name':{'type':Sequelize[_0xa57d('0x3')],'get':function(_0x4e9157){return this['getDataValue']('alias');}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x4308c0){this[_0xa57d('0x4')]('alias',_0x4308c0?_0x4308c0:this['getDataValue'](_0xa57d('0x5')));}},'type':{'type':Sequelize[_0xa57d('0x6')],'allowNull':![]},'values':{'type':Sequelize[_0xa57d('0x7')]('long'),'get':function(){if(this[_0xa57d('0x8')](_0xa57d('0x9'))===_0xa57d('0xa')){return JSON[_0xa57d('0xb')](this[_0xa57d('0x8')](_0xa57d('0xc')));}else{return this['getDataValue']('values');}},'set':function(_0x36ce44){if(Array[_0xa57d('0xd')](_0x36ce44)){this[_0xa57d('0x4')](_0xa57d('0xc'),JSON['stringify'](_0x36ce44));}else{this[_0xa57d('0x4')](_0xa57d('0xc'),_0x36ce44);}}},'required':{'type':Sequelize[_0xa57d('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xa57d('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xa57d('0xf')](_0xa57d('0x10'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 6e8217d..9219b04 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 _0xd076=['pick','merge','type','filter','options','then','includeAll','include','findAll','catch','show','params','keys','find','body','create','transaction','Sequelize','TEXT','text','switch','defaultValue','sequelize','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','end','error','name','send','index','map','CmCustomField','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where'];(function(_0x807c9b,_0x488022){var _0x4c338b=function(_0x4e4089){while(--_0x4e4089){_0x807c9b['push'](_0x807c9b['shift']());}};_0x4c338b(++_0x488022);}(_0xd076,0x11b));var _0x6d07=function(_0x3ec623,_0x3923b5){_0x3ec623=_0x3ec623-0x0;var _0xc846e7=_0xd076[_0x3ec623];return _0xc846e7;};'use strict';var emlformat=require(_0x6d07('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6d07('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6d07('0x2'));var moment=require(_0x6d07('0x3'));var BPromise=require(_0x6d07('0x4'));var Mustache=require(_0x6d07('0x5'));var util=require('util');var path=require(_0x6d07('0x6'));var sox=require(_0x6d07('0x7'));var csv=require('to-csv');var ejs=require(_0x6d07('0x8'));var fs=require('fs');var fs_extra=require(_0x6d07('0x9'));var _=require('lodash');var squel=require(_0x6d07('0xa'));var crypto=require(_0x6d07('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6d07('0xc'));var Papa=require(_0x6d07('0xd'));var Redis=require('ioredis');var authService=require(_0x6d07('0xe'));var qs=require(_0x6d07('0xf'));var as=require(_0x6d07('0x10'));var hardwareService=require(_0x6d07('0x11'));var logger=require(_0x6d07('0x12'))(_0x6d07('0x13'));var utils=require(_0x6d07('0x14'));var config=require(_0x6d07('0x15'));var licenseUtil=require(_0x6d07('0x16'));var db=require(_0x6d07('0x17'))['db'];function respondWithStatusCode(_0x3f58cc,_0x1c1a43){_0x1c1a43=_0x1c1a43||0xcc;return function(_0x2d7ee2){if(_0x2d7ee2){return _0x3f58cc[_0x6d07('0x18')](_0x1c1a43);}return _0x3f58cc[_0x6d07('0x19')](_0x1c1a43)['end']();};}function respondWithResult(_0x39a44c,_0x4bb371){_0x4bb371=_0x4bb371||0xc8;return function(_0x4dedf9){if(_0x4dedf9){return _0x39a44c[_0x6d07('0x19')](_0x4bb371)[_0x6d07('0x1a')](_0x4dedf9);}};}function respondWithFilteredResult(_0xaaa69a,_0x25dea1){return function(_0x36bc88){if(_0x36bc88){var _0x127292=typeof _0x25dea1[_0x6d07('0x1b')]===_0x6d07('0x1c')&&typeof _0x25dea1[_0x6d07('0x1d')]===_0x6d07('0x1c');var _0x1c7f27=_0x36bc88['count'];var _0x120881=_0x127292?0x0:_0x25dea1['offset'];var _0x10bbc5=_0x127292?_0x36bc88[_0x6d07('0x1e')]:_0x25dea1[_0x6d07('0x1b')]+_0x25dea1[_0x6d07('0x1d')];var _0x2c87b0;if(_0x10bbc5>=_0x1c7f27){_0x10bbc5=_0x1c7f27;_0x2c87b0=0xc8;}else{_0x2c87b0=0xce;}_0xaaa69a['status'](_0x2c87b0);return _0xaaa69a['set'](_0x6d07('0x1f'),_0x120881+'-'+_0x10bbc5+'/'+_0x1c7f27)[_0x6d07('0x1a')](_0x36bc88);}return null;};}function patchUpdates(_0xdaef57){return function(_0x44be03){try{jsonpatch[_0x6d07('0x20')](_0x44be03,_0xdaef57,!![]);}catch(_0x28c6dc){return BPromise[_0x6d07('0x21')](_0x28c6dc);}return _0x44be03[_0x6d07('0x22')]();};}function saveUpdates(_0xce9ae8,_0x106815){return function(_0x4c7de7){if(_0x4c7de7){return _0x4c7de7[_0x6d07('0x23')](_0xce9ae8)['then'](function(_0x17885e){return _0x17885e;});}return null;};}function removeEntity(_0x50aad3,_0x30137a){return function(_0x7539d){if(_0x7539d){return _0x7539d[_0x6d07('0x24')]()['then'](function(){_0x50aad3['status'](0xcc)[_0x6d07('0x25')]();});}};}function handleEntityNotFound(_0x278625,_0x9dce24){return function(_0x58f363){if(!_0x58f363){_0x278625[_0x6d07('0x18')](0x194);}return _0x58f363;};}function handleError(_0xdd091,_0x1e911e){_0x1e911e=_0x1e911e||0x1f4;return function(_0x1bd050){logger[_0x6d07('0x26')](_0x1bd050['stack']);if(_0x1bd050[_0x6d07('0x27')]){delete _0x1bd050[_0x6d07('0x27')];}_0xdd091[_0x6d07('0x19')](_0x1e911e)[_0x6d07('0x28')](_0x1bd050);};}exports[_0x6d07('0x29')]=function(_0x2fab82,_0x2b88bb){var _0x10bc0e={},_0x5049b5={},_0x5abfcc={'count':0x0,'rows':[]};var _0x508fff=_[_0x6d07('0x2a')](db[_0x6d07('0x2b')][_0x6d07('0x2c')],function(_0xcf0057){return{'name':_0xcf0057['fieldName'],'type':_0xcf0057['type'][_0x6d07('0x2d')]};});_0x5049b5[_0x6d07('0x2e')]=_['differenceBy'](_[_0x6d07('0x2a')](_0x508fff,_0x6d07('0x27')),[_0x6d07('0x27')]);_0x5049b5['query']=_['keys'](_0x2fab82[_0x6d07('0x2f')]);_0x5049b5[_0x6d07('0x30')]=_[_0x6d07('0x31')](_0x5049b5[_0x6d07('0x2e')],_0x5049b5[_0x6d07('0x2f')]);_0x10bc0e[_0x6d07('0x32')]=_[_0x6d07('0x31')](_0x5049b5['model'],qs[_0x6d07('0x33')](_0x2fab82[_0x6d07('0x2f')][_0x6d07('0x33')]));_0x10bc0e['attributes']=_0x10bc0e[_0x6d07('0x32')][_0x6d07('0x34')]?_0x10bc0e[_0x6d07('0x32')]:_0x5049b5[_0x6d07('0x2e')];if(!_0x2fab82['query'][_0x6d07('0x35')](_0x6d07('0x36'))){_0x10bc0e['limit']=qs['limit'](_0x2fab82[_0x6d07('0x2f')][_0x6d07('0x1d')]);_0x10bc0e[_0x6d07('0x1b')]=qs[_0x6d07('0x1b')](_0x2fab82[_0x6d07('0x2f')][_0x6d07('0x1b')]);}_0x10bc0e[_0x6d07('0x37')]=qs['sort'](_0x2fab82[_0x6d07('0x2f')]['sort']);_0x10bc0e[_0x6d07('0x38')]=qs[_0x6d07('0x30')](_[_0x6d07('0x39')](_0x2fab82[_0x6d07('0x2f')],_0x5049b5['filters']),_0x508fff);if(_0x2fab82[_0x6d07('0x2f')]['filter']){_0x10bc0e[_0x6d07('0x38')]=_[_0x6d07('0x3a')](_0x10bc0e[_0x6d07('0x38')],{'$or':_['map'](_0x508fff,function(_0x35925f){if(_0x35925f[_0x6d07('0x3b')]!=='VIRTUAL'){var _0x4b7756={};_0x4b7756[_0x35925f[_0x6d07('0x27')]]={'$like':'%'+_0x2fab82[_0x6d07('0x2f')][_0x6d07('0x3c')]+'%'};return _0x4b7756;}})});}_0x10bc0e=_[_0x6d07('0x3a')]({},_0x10bc0e,_0x2fab82[_0x6d07('0x3d')]);var _0x7924ab={'where':_0x10bc0e[_0x6d07('0x38')]};return db[_0x6d07('0x2b')][_0x6d07('0x1e')](_0x7924ab)[_0x6d07('0x3e')](function(_0x374c13){_0x5abfcc[_0x6d07('0x1e')]=_0x374c13;if(_0x2fab82[_0x6d07('0x2f')][_0x6d07('0x3f')]){_0x10bc0e[_0x6d07('0x40')]=[{'all':!![]}];}return db[_0x6d07('0x2b')][_0x6d07('0x41')](_0x10bc0e);})[_0x6d07('0x3e')](function(_0x653411){_0x5abfcc['rows']=_0x653411;return _0x5abfcc;})[_0x6d07('0x3e')](respondWithFilteredResult(_0x2b88bb,_0x10bc0e))[_0x6d07('0x42')](handleError(_0x2b88bb,null));};exports[_0x6d07('0x43')]=function(_0x1059a2,_0x36822a){var _0x1427c7={'raw':!![],'where':{'id':_0x1059a2[_0x6d07('0x44')]['id']}},_0x21084a={};_0x21084a[_0x6d07('0x2e')]=_[_0x6d07('0x45')](db[_0x6d07('0x2b')][_0x6d07('0x2c')]);_0x21084a[_0x6d07('0x2f')]=_[_0x6d07('0x45')](_0x1059a2[_0x6d07('0x2f')]);_0x21084a[_0x6d07('0x30')]=_[_0x6d07('0x31')](_0x21084a['model'],_0x21084a[_0x6d07('0x2f')]);_0x1427c7[_0x6d07('0x32')]=_[_0x6d07('0x31')](_0x21084a[_0x6d07('0x2e')],qs[_0x6d07('0x33')](_0x1059a2[_0x6d07('0x2f')][_0x6d07('0x33')]));_0x1427c7[_0x6d07('0x32')]=_0x1427c7[_0x6d07('0x32')][_0x6d07('0x34')]?_0x1427c7[_0x6d07('0x32')]:_0x21084a[_0x6d07('0x2e')];if(_0x1059a2[_0x6d07('0x2f')][_0x6d07('0x3f')]){_0x1427c7['include']=[{'all':!![]}];}_0x1427c7=_[_0x6d07('0x3a')]({},_0x1427c7,_0x1059a2['options']);return db[_0x6d07('0x2b')][_0x6d07('0x46')](_0x1427c7)[_0x6d07('0x3e')](handleEntityNotFound(_0x36822a,null))[_0x6d07('0x3e')](respondWithResult(_0x36822a,null))[_0x6d07('0x42')](handleError(_0x36822a,null));};exports['update']=function(_0x4c6263,_0x8c69fd){if(_0x4c6263[_0x6d07('0x47')]['id']){delete _0x4c6263[_0x6d07('0x47')]['id'];}return db['CmCustomField'][_0x6d07('0x46')]({'where':{'id':_0x4c6263[_0x6d07('0x44')]['id']}})['then'](handleEntityNotFound(_0x8c69fd,null))[_0x6d07('0x3e')](saveUpdates(_0x4c6263[_0x6d07('0x47')],null))[_0x6d07('0x3e')](respondWithResult(_0x8c69fd,null))[_0x6d07('0x42')](handleError(_0x8c69fd,null));};exports['destroy']=function(_0x5e82ed,_0x599277){return db[_0x6d07('0x2b')][_0x6d07('0x46')]({'where':{'id':_0x5e82ed['params']['id']}})[_0x6d07('0x3e')](handleEntityNotFound(_0x599277,null))[_0x6d07('0x3e')](removeEntity(_0x599277,null))['catch'](handleError(_0x599277,null));};exports[_0x6d07('0x48')]=function(_0x1cf3ad,_0x5f2ec8){var _0xd0828a;return db['sequelize'][_0x6d07('0x49')](function(_0x883707){return db[_0x6d07('0x2b')][_0x6d07('0x48')](_0x1cf3ad['body'],{'transaction':_0x883707})[_0x6d07('0x3e')](function(_0x577bcf){_0xd0828a=_0x577bcf;var _0x239c56={'type':db[_0x6d07('0x4a')][_0x6d07('0x4b')],'transaction':_0x883707};switch(_0x1cf3ad[_0x6d07('0x47')][_0x6d07('0x3b')]){case _0x6d07('0x4c'):_0x239c56[_0x6d07('0x3b')]=db[_0x6d07('0x4a')][_0x6d07('0x4b')];break;case'number':_0x239c56[_0x6d07('0x3b')]=db[_0x6d07('0x4a')]['INTEGER'];break;case _0x6d07('0x4d'):_0x239c56[_0x6d07('0x3b')]=db[_0x6d07('0x4a')]['BOOLEAN'];_0x239c56[_0x6d07('0x4e')]=![];break;default:}return db[_0x6d07('0x4f')][_0x6d07('0x50')][_0x6d07('0x51')](_0x6d07('0x52'),util[_0x6d07('0x53')](_0x6d07('0x54'),_0xd0828a['id']),_0x239c56);})['then'](function(){return _0xd0828a;});})[_0x6d07('0x3e')](respondWithResult(_0x5f2ec8,0xc9))[_0x6d07('0x42')](handleError(_0x5f2ec8,null));}; \ No newline at end of file +var _0x6319=['status','json','offset','undefined','count','set','Content-Range','apply','then','destroy','end','sendStatus','error','stack','name','send','index','CmCustomField','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','attributes','fields','nolimit','limit','order','sort','where','filter','merge','options','includeAll','include','rows','catch','show','params','find','update','body','sequelize','transaction','create','Sequelize','TEXT','text','number','INTEGER','switch','addColumn','format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x1a0fbc,_0x5917d0){var _0x1df78d=function(_0x5b877a){while(--_0x5b877a){_0x1a0fbc['push'](_0x1a0fbc['shift']());}};_0x1df78d(++_0x5917d0);}(_0x6319,0xdb));var _0x9631=function(_0x41e495,_0x2bf45d){_0x41e495=_0x41e495-0x0;var _0x421aa6=_0x6319[_0x41e495];return _0x421aa6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9631('0x0'));var zipdir=require(_0x9631('0x1'));var jsonpatch=require(_0x9631('0x2'));var rp=require('request-promise');var moment=require(_0x9631('0x3'));var BPromise=require(_0x9631('0x4'));var Mustache=require(_0x9631('0x5'));var util=require(_0x9631('0x6'));var path=require('path');var sox=require(_0x9631('0x7'));var csv=require(_0x9631('0x8'));var ejs=require(_0x9631('0x9'));var fs=require('fs');var fs_extra=require(_0x9631('0xa'));var _=require(_0x9631('0xb'));var squel=require('squel');var crypto=require(_0x9631('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9631('0x8'));var querystring=require(_0x9631('0xd'));var Papa=require(_0x9631('0xe'));var Redis=require(_0x9631('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9631('0x10'));var as=require(_0x9631('0x11'));var hardwareService=require(_0x9631('0x12'));var logger=require(_0x9631('0x13'))(_0x9631('0x14'));var utils=require('../../config/utils');var config=require(_0x9631('0x15'));var licenseUtil=require(_0x9631('0x16'));var db=require(_0x9631('0x17'))['db'];function respondWithStatusCode(_0x5354b8,_0x52bc79){_0x52bc79=_0x52bc79||0xcc;return function(_0x57d375){if(_0x57d375){return _0x5354b8['sendStatus'](_0x52bc79);}return _0x5354b8[_0x9631('0x18')](_0x52bc79)['end']();};}function respondWithResult(_0x382ffc,_0x30df22){_0x30df22=_0x30df22||0xc8;return function(_0x584816){if(_0x584816){return _0x382ffc[_0x9631('0x18')](_0x30df22)[_0x9631('0x19')](_0x584816);}};}function respondWithFilteredResult(_0x2a147b,_0x5e7c3e){return function(_0x55027a){if(_0x55027a){var _0x5e6839=typeof _0x5e7c3e[_0x9631('0x1a')]==='undefined'&&typeof _0x5e7c3e['limit']===_0x9631('0x1b');var _0x3aaef9=_0x55027a[_0x9631('0x1c')];var _0x405ed7=_0x5e6839?0x0:_0x5e7c3e['offset'];var _0x3bfa23=_0x5e6839?_0x55027a['count']:_0x5e7c3e['offset']+_0x5e7c3e['limit'];var _0x5e542b;if(_0x3bfa23>=_0x3aaef9){_0x3bfa23=_0x3aaef9;_0x5e542b=0xc8;}else{_0x5e542b=0xce;}_0x2a147b[_0x9631('0x18')](_0x5e542b);return _0x2a147b[_0x9631('0x1d')](_0x9631('0x1e'),_0x405ed7+'-'+_0x3bfa23+'/'+_0x3aaef9)[_0x9631('0x19')](_0x55027a);}return null;};}function patchUpdates(_0x1d89d5){return function(_0xc9cd8){try{jsonpatch[_0x9631('0x1f')](_0xc9cd8,_0x1d89d5,!![]);}catch(_0x5d0723){return BPromise['reject'](_0x5d0723);}return _0xc9cd8['save']();};}function saveUpdates(_0x43cb74,_0x404a45){return function(_0x2c21a8){if(_0x2c21a8){return _0x2c21a8['update'](_0x43cb74)[_0x9631('0x20')](function(_0x1e69fb){return _0x1e69fb;});}return null;};}function removeEntity(_0x59d48a,_0x20ab33){return function(_0x5f3f63){if(_0x5f3f63){return _0x5f3f63[_0x9631('0x21')]()[_0x9631('0x20')](function(){_0x59d48a[_0x9631('0x18')](0xcc)[_0x9631('0x22')]();});}};}function handleEntityNotFound(_0x2d08f4,_0x1e73eb){return function(_0x181954){if(!_0x181954){_0x2d08f4[_0x9631('0x23')](0x194);}return _0x181954;};}function handleError(_0x1e213c,_0x4bfe67){_0x4bfe67=_0x4bfe67||0x1f4;return function(_0x5d3553){logger[_0x9631('0x24')](_0x5d3553[_0x9631('0x25')]);if(_0x5d3553[_0x9631('0x26')]){delete _0x5d3553['name'];}_0x1e213c[_0x9631('0x18')](_0x4bfe67)[_0x9631('0x27')](_0x5d3553);};}exports[_0x9631('0x28')]=function(_0x2b5f62,_0x2ebac6){var _0x58131b={},_0x4a8b8d={},_0xf43d88={'count':0x0,'rows':[]};var _0xe32506=_['map'](db[_0x9631('0x29')][_0x9631('0x2a')],function(_0x2402dc){return{'name':_0x2402dc[_0x9631('0x2b')],'type':_0x2402dc[_0x9631('0x2c')]['key']};});_0x4a8b8d[_0x9631('0x2d')]=_['differenceBy'](_[_0x9631('0x2e')](_0xe32506,_0x9631('0x26')),['name']);_0x4a8b8d['query']=_[_0x9631('0x2f')](_0x2b5f62[_0x9631('0x30')]);_0x4a8b8d[_0x9631('0x31')]=_[_0x9631('0x32')](_0x4a8b8d[_0x9631('0x2d')],_0x4a8b8d[_0x9631('0x30')]);_0x58131b[_0x9631('0x33')]=_[_0x9631('0x32')](_0x4a8b8d['model'],qs[_0x9631('0x34')](_0x2b5f62[_0x9631('0x30')][_0x9631('0x34')]));_0x58131b[_0x9631('0x33')]=_0x58131b[_0x9631('0x33')]['length']?_0x58131b[_0x9631('0x33')]:_0x4a8b8d['model'];if(!_0x2b5f62[_0x9631('0x30')]['hasOwnProperty'](_0x9631('0x35'))){_0x58131b[_0x9631('0x36')]=qs[_0x9631('0x36')](_0x2b5f62['query']['limit']);_0x58131b[_0x9631('0x1a')]=qs[_0x9631('0x1a')](_0x2b5f62[_0x9631('0x30')][_0x9631('0x1a')]);}_0x58131b[_0x9631('0x37')]=qs['sort'](_0x2b5f62[_0x9631('0x30')][_0x9631('0x38')]);_0x58131b[_0x9631('0x39')]=qs['filters'](_['pick'](_0x2b5f62[_0x9631('0x30')],_0x4a8b8d[_0x9631('0x31')]),_0xe32506);if(_0x2b5f62[_0x9631('0x30')][_0x9631('0x3a')]){_0x58131b[_0x9631('0x39')]=_[_0x9631('0x3b')](_0x58131b['where'],{'$or':_[_0x9631('0x2e')](_0xe32506,function(_0xebff8e){if(_0xebff8e[_0x9631('0x2c')]!=='VIRTUAL'){var _0x3add0c={};_0x3add0c[_0xebff8e[_0x9631('0x26')]]={'$like':'%'+_0x2b5f62[_0x9631('0x30')][_0x9631('0x3a')]+'%'};return _0x3add0c;}})});}_0x58131b=_['merge']({},_0x58131b,_0x2b5f62[_0x9631('0x3c')]);var _0x5515a1={'where':_0x58131b[_0x9631('0x39')]};return db['CmCustomField'][_0x9631('0x1c')](_0x5515a1)[_0x9631('0x20')](function(_0x5452b1){_0xf43d88[_0x9631('0x1c')]=_0x5452b1;if(_0x2b5f62[_0x9631('0x30')][_0x9631('0x3d')]){_0x58131b[_0x9631('0x3e')]=[{'all':!![]}];}return db['CmCustomField']['findAll'](_0x58131b);})[_0x9631('0x20')](function(_0x107278){_0xf43d88[_0x9631('0x3f')]=_0x107278;return _0xf43d88;})[_0x9631('0x20')](respondWithFilteredResult(_0x2ebac6,_0x58131b))[_0x9631('0x40')](handleError(_0x2ebac6,null));};exports[_0x9631('0x41')]=function(_0x5f4646,_0x185b6a){var _0x2f8ab9={'raw':!![],'where':{'id':_0x5f4646[_0x9631('0x42')]['id']}},_0x473aba={};_0x473aba[_0x9631('0x2d')]=_[_0x9631('0x2f')](db[_0x9631('0x29')][_0x9631('0x2a')]);_0x473aba[_0x9631('0x30')]=_['keys'](_0x5f4646[_0x9631('0x30')]);_0x473aba[_0x9631('0x31')]=_[_0x9631('0x32')](_0x473aba[_0x9631('0x2d')],_0x473aba['query']);_0x2f8ab9[_0x9631('0x33')]=_['intersection'](_0x473aba[_0x9631('0x2d')],qs['fields'](_0x5f4646[_0x9631('0x30')][_0x9631('0x34')]));_0x2f8ab9['attributes']=_0x2f8ab9[_0x9631('0x33')]['length']?_0x2f8ab9[_0x9631('0x33')]:_0x473aba['model'];if(_0x5f4646[_0x9631('0x30')][_0x9631('0x3d')]){_0x2f8ab9[_0x9631('0x3e')]=[{'all':!![]}];}_0x2f8ab9=_[_0x9631('0x3b')]({},_0x2f8ab9,_0x5f4646[_0x9631('0x3c')]);return db[_0x9631('0x29')][_0x9631('0x43')](_0x2f8ab9)[_0x9631('0x20')](handleEntityNotFound(_0x185b6a,null))['then'](respondWithResult(_0x185b6a,null))[_0x9631('0x40')](handleError(_0x185b6a,null));};exports[_0x9631('0x44')]=function(_0x4bc86e,_0x10a613){if(_0x4bc86e['body']['id']){delete _0x4bc86e[_0x9631('0x45')]['id'];}return db[_0x9631('0x29')][_0x9631('0x43')]({'where':{'id':_0x4bc86e['params']['id']}})[_0x9631('0x20')](handleEntityNotFound(_0x10a613,null))['then'](saveUpdates(_0x4bc86e[_0x9631('0x45')],null))[_0x9631('0x20')](respondWithResult(_0x10a613,null))['catch'](handleError(_0x10a613,null));};exports[_0x9631('0x21')]=function(_0x282ede,_0xec572a){return db['CmCustomField'][_0x9631('0x43')]({'where':{'id':_0x282ede[_0x9631('0x42')]['id']}})['then'](handleEntityNotFound(_0xec572a,null))[_0x9631('0x20')](removeEntity(_0xec572a,null))[_0x9631('0x40')](handleError(_0xec572a,null));};exports['create']=function(_0x19ac0d,_0x55caaa){var _0x42696e;return db[_0x9631('0x46')][_0x9631('0x47')](function(_0x260738){return db[_0x9631('0x29')][_0x9631('0x48')](_0x19ac0d['body'],{'transaction':_0x260738})[_0x9631('0x20')](function(_0x7bcb6b){_0x42696e=_0x7bcb6b;var _0x37b06d={'type':db[_0x9631('0x49')][_0x9631('0x4a')],'transaction':_0x260738};switch(_0x19ac0d[_0x9631('0x45')][_0x9631('0x2c')]){case _0x9631('0x4b'):_0x37b06d[_0x9631('0x2c')]=db[_0x9631('0x49')][_0x9631('0x4a')];break;case _0x9631('0x4c'):_0x37b06d[_0x9631('0x2c')]=db[_0x9631('0x49')][_0x9631('0x4d')];break;case _0x9631('0x4e'):_0x37b06d['type']=db[_0x9631('0x49')]['BOOLEAN'];_0x37b06d['defaultValue']=![];break;default:}return db[_0x9631('0x46')]['queryInterface'][_0x9631('0x4f')]('cm_contacts',util[_0x9631('0x50')]('cf_%d',_0x42696e['id']),_0x37b06d);})[_0x9631('0x20')](function(){return _0x42696e;});})['then'](respondWithResult(_0x55caaa,0xc9))[_0x9631('0x40')](handleError(_0x55caaa,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 8a2e772..d77f76d 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 _0x7c0c=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','lodash','util','../../config/logger','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7c0c,0x75));var _0xc7c0=function(_0x51e1d5,_0x399588){_0x51e1d5=_0x51e1d5-0x0;var _0x105666=_0x7c0c[_0x51e1d5];return _0x105666;};'use strict';var _=require(_0xc7c0('0x0'));var util=require(_0xc7c0('0x1'));var logger=require(_0xc7c0('0x2'))(_0xc7c0('0x3'));var moment=require(_0xc7c0('0x4'));var BPromise=require(_0xc7c0('0x5'));var rp=require(_0xc7c0('0x6'));var fs=require('fs');var path=require(_0xc7c0('0x7'));var rimraf=require(_0xc7c0('0x8'));var config=require(_0xc7c0('0x9'));var attributes=require('./cmCustomField.attributes');module[_0xc7c0('0xa')]=function(_0x40c768,_0x2133eb){return _0x40c768['define']('CmCustomField',attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb911=['rimraf','../../config/environment','./cmCustomField.attributes','exports','define','cm_custom_fields','lodash','util','api','request-promise','path'];(function(_0x288ada,_0xf7d134){var _0x58250d=function(_0x225255){while(--_0x225255){_0x288ada['push'](_0x288ada['shift']());}};_0x58250d(++_0xf7d134);}(_0xb911,0x17c));var _0x1b91=function(_0x3dffb5,_0x1964ac){_0x3dffb5=_0x3dffb5-0x0;var _0x252404=_0xb911[_0x3dffb5];return _0x252404;};'use strict';var _=require(_0x1b91('0x0'));var util=require(_0x1b91('0x1'));var logger=require('../../config/logger')(_0x1b91('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1b91('0x3'));var fs=require('fs');var path=require(_0x1b91('0x4'));var rimraf=require(_0x1b91('0x5'));var config=require(_0x1b91('0x6'));var attributes=require(_0x1b91('0x7'));module[_0x1b91('0x8')]=function(_0x1c3256,_0x4cb287){return _0x1c3256[_0x1b91('0x9')]('CmCustomField',attributes,{'tableName':_0x1b91('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index 3746d9d..e8b2b3f 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 _0xb1e0=['info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x65c50e,_0x1aa926){var _0x4573e7=function(_0x5bc049){while(--_0x5bc049){_0x65c50e['push'](_0x65c50e['shift']());}};_0x4573e7(++_0x1aa926);}(_0xb1e0,0x12a));var _0x0b1e=function(_0x15ad40,_0x57d226){_0x15ad40=_0x15ad40-0x0;var _0x355bc3=_0xb1e0[_0x15ad40];return _0x355bc3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0b1e('0x0'));var BPromise=require(_0x0b1e('0x1'));var rs=require(_0x0b1e('0x2'));var fs=require('fs');var Redis=require(_0x0b1e('0x3'));var db=require(_0x0b1e('0x4'))['db'];var utils=require(_0x0b1e('0x5'));var logger=require(_0x0b1e('0x6'))(_0x0b1e('0x7'));var config=require(_0x0b1e('0x8'));var jayson=require(_0x0b1e('0x9'));var client=jayson[_0x0b1e('0xa')][_0x0b1e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5a7778,_0x3ad934,_0x4ea5ef){return new BPromise(function(_0x1c1e3f,_0x587e95){return client[_0x0b1e('0xc')](_0x5a7778,_0x4ea5ef)[_0x0b1e('0xd')](function(_0x4f8d73){logger[_0x0b1e('0xe')](_0x0b1e('0xf'),_0x3ad934,_0x0b1e('0x10'));logger[_0x0b1e('0x11')](_0x0b1e('0x12'),_0x3ad934,_0x0b1e('0x10'),JSON[_0x0b1e('0x13')](_0x4f8d73));if(_0x4f8d73['error']){if(_0x4f8d73[_0x0b1e('0x14')][_0x0b1e('0x15')]===0x1f4){logger[_0x0b1e('0x14')]('CmCustomField,\x20%s,\x20%s',_0x3ad934,_0x4f8d73[_0x0b1e('0x14')][_0x0b1e('0x16')]);return _0x587e95(_0x4f8d73[_0x0b1e('0x14')]['message']);}logger[_0x0b1e('0x14')](_0x0b1e('0xf'),_0x3ad934,_0x4f8d73['error'][_0x0b1e('0x16')]);return _0x1c1e3f(_0x4f8d73[_0x0b1e('0x14')][_0x0b1e('0x16')]);}else{logger[_0x0b1e('0xe')]('CmCustomField,\x20%s,\x20%s',_0x3ad934,_0x0b1e('0x10'));_0x1c1e3f(_0x4f8d73['result']['message']);}})[_0x0b1e('0x17')](function(_0x3aac57){logger[_0x0b1e('0x14')](_0x0b1e('0xf'),_0x3ad934,_0x3aac57);_0x587e95(_0x3aac57);});});} \ No newline at end of file +var _0x045b=['CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x8a217e,_0x450bfc){var _0x3fc350=function(_0x55ed99){while(--_0x55ed99){_0x8a217e['push'](_0x8a217e['shift']());}};_0x3fc350(++_0x450bfc);}(_0x045b,0x17e));var _0xb045=function(_0x2ed7d1,_0x363741){_0x2ed7d1=_0x2ed7d1-0x0;var _0x38ae3c=_0x045b[_0x2ed7d1];return _0x38ae3c;};'use strict';var _=require(_0xb045('0x0'));var util=require(_0xb045('0x1'));var moment=require(_0xb045('0x2'));var BPromise=require(_0xb045('0x3'));var rs=require(_0xb045('0x4'));var fs=require('fs');var Redis=require(_0xb045('0x5'));var db=require(_0xb045('0x6'))['db'];var utils=require(_0xb045('0x7'));var logger=require(_0xb045('0x8'))(_0xb045('0x9'));var config=require(_0xb045('0xa'));var jayson=require(_0xb045('0xb'));var client=jayson[_0xb045('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3029b5,_0x5dc744,_0xf96808){return new BPromise(function(_0x2fac45,_0x19d24a){return client['request'](_0x3029b5,_0xf96808)[_0xb045('0xd')](function(_0x12f124){logger[_0xb045('0xe')](_0xb045('0xf'),_0x5dc744,_0xb045('0x10'));logger[_0xb045('0x11')](_0xb045('0x12'),_0x5dc744,_0xb045('0x10'),JSON[_0xb045('0x13')](_0x12f124));if(_0x12f124[_0xb045('0x14')]){if(_0x12f124[_0xb045('0x14')][_0xb045('0x15')]===0x1f4){logger[_0xb045('0x14')](_0xb045('0xf'),_0x5dc744,_0x12f124[_0xb045('0x14')][_0xb045('0x16')]);return _0x19d24a(_0x12f124['error'][_0xb045('0x16')]);}logger[_0xb045('0x14')](_0xb045('0xf'),_0x5dc744,_0x12f124[_0xb045('0x14')]['message']);return _0x2fac45(_0x12f124['error'][_0xb045('0x16')]);}else{logger['info'](_0xb045('0xf'),_0x5dc744,_0xb045('0x10'));_0x2fac45(_0x12f124[_0xb045('0x17')][_0xb045('0x16')]);}})[_0xb045('0x18')](function(_0x2820bc){logger[_0xb045('0x14')](_0xb045('0xf'),_0x5dc744,_0x2820bc);_0x19d24a(_0x2820bc);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 1e88036..b74df6c 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 _0x5aa1=['destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','/:id','show','post','put','update'];(function(_0x393d6a,_0x472591){var _0x3954de=function(_0x4cfed8){while(--_0x4cfed8){_0x393d6a['push'](_0x393d6a['shift']());}};_0x3954de(++_0x472591);}(_0x5aa1,0x158));var _0x15aa=function(_0x3658af,_0x37aaf7){_0x3658af=_0x3658af-0x0;var _0x5441f0=_0x5aa1[_0x3658af];return _0x5441f0;};'use strict';var multer=require(_0x15aa('0x0'));var util=require(_0x15aa('0x1'));var path=require(_0x15aa('0x2'));var timeout=require(_0x15aa('0x3'));var express=require(_0x15aa('0x4'));var router=express['Router']();var fs_extra=require(_0x15aa('0x5'));var auth=require(_0x15aa('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x15aa('0x7'));var controller=require(_0x15aa('0x8'));router[_0x15aa('0x9')]('/',auth[_0x15aa('0xa')](),controller['index']);router[_0x15aa('0x9')](_0x15aa('0xb'),auth['isAuthenticated'](),controller[_0x15aa('0xc')]);router[_0x15aa('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x15aa('0xe')](_0x15aa('0xb'),auth[_0x15aa('0xa')](),controller[_0x15aa('0xf')]);router['delete'](_0x15aa('0xb'),auth[_0x15aa('0xa')](),controller[_0x15aa('0x10')]);module[_0x15aa('0x11')]=router; \ No newline at end of file +var _0xfa5d=['Router','../../components/interaction/service','./cmCustomField.controller','get','index','/:id','isAuthenticated','post','create','put','update','delete','destroy','exports','multer','express'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xfa5d,0x19e));var _0xdfa5=function(_0x15ce19,_0x5cde84){_0x15ce19=_0x15ce19-0x0;var _0x54e308=_0xfa5d[_0x15ce19];return _0x54e308;};'use strict';var multer=require(_0xdfa5('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xdfa5('0x1'));var router=express[_0xdfa5('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xdfa5('0x3'));var config=require('../../config/environment');var controller=require(_0xdfa5('0x4'));router[_0xdfa5('0x5')]('/',auth['isAuthenticated'](),controller[_0xdfa5('0x6')]);router['get'](_0xdfa5('0x7'),auth[_0xdfa5('0x8')](),controller['show']);router[_0xdfa5('0x9')]('/',auth['isAuthenticated'](),controller[_0xdfa5('0xa')]);router[_0xdfa5('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xdfa5('0xc')]);router[_0xdfa5('0xd')](_0xdfa5('0x7'),auth[_0xdfa5('0x8')](),controller[_0xdfa5('0xe')]);module[_0xdfa5('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index b2dfff3..39d633a 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 _0xca54=['YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment','sequelize','exports','STRING','BOOLEAN','format'];(function(_0x416aed,_0x556c97){var _0x2cbadc=function(_0x36cd40){while(--_0x36cd40){_0x416aed['push'](_0x416aed['shift']());}};_0x2cbadc(++_0x556c97);}(_0xca54,0xb8));var _0x4ca5=function(_0x2674e1,_0x1267fc){_0x2674e1=_0x2674e1-0x0;var _0x59b679=_0xca54[_0x2674e1];return _0x59b679;};'use strict';var moment=require(_0x4ca5('0x0'));var Sequelize=require(_0x4ca5('0x1'));module[_0x4ca5('0x2')]={'phone':{'type':Sequelize[_0x4ca5('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x4ca5('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x4ca5('0x5')](_0x4ca5('0x6'))},'countbusyretry':{'type':Sequelize[_0x4ca5('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x4ca5('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0x4ca5('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x4ca5('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0x4ca5('0x7')](0x2)[_0x4ca5('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x4ca5('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x4ca5('0x7')],'unique':_0x4ca5('0x9')},'ListId':{'type':Sequelize[_0x4ca5('0x7')],'unique':_0x4ca5('0x9')},'UserId':{'type':Sequelize[_0x4ca5('0x7')]},'VoiceQueueId':{'type':Sequelize[_0x4ca5('0x7')],'unique':_0x4ca5('0x9')},'CampaignId':{'type':Sequelize[_0x4ca5('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0x4ca5('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x4ca5('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x4ca5('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x4ca5('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x4ca5('0x7')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7376=['exports','STRING','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment','sequelize'];(function(_0x49ae75,_0x5fc190){var _0x5692d5=function(_0x456ec1){while(--_0x456ec1){_0x49ae75['push'](_0x49ae75['shift']());}};_0x5692d5(++_0x5fc190);}(_0x7376,0x111));var _0x6737=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x7376[_0x178e48];return _0x440d7e;};'use strict';var moment=require(_0x6737('0x0'));var Sequelize=require(_0x6737('0x1'));module[_0x6737('0x2')]={'phone':{'type':Sequelize[_0x6737('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x6737('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x6737('0x5')],'defaultValue':moment()[_0x6737('0x6')](_0x6737('0x7'))},'countbusyretry':{'type':Sequelize[_0x6737('0x8')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x6737('0x8')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x6737('0x8')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x6737('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x6737('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x6737('0x9')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x6737('0x8')],'unique':_0x6737('0xa')},'ListId':{'type':Sequelize[_0x6737('0x8')],'unique':_0x6737('0xa')},'UserId':{'type':Sequelize[_0x6737('0x8')]},'VoiceQueueId':{'type':Sequelize[_0x6737('0x8')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0x6737('0x8')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x6737('0x8')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x6737('0x8')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index c7bcdfa..2c609c1 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 _0xeecb=['moment','bluebird','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','count','Content-Range','apply','reject','save','update','then','error','name','index','map','CmHopper','fieldName','key','model','query','filters','concat','$and','$or','$gte','$lt','$lte','$ne','$eq','$not','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$any','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','find','create','body','params','describe','destroy','CampaignId','VoiceQueueId','VoiceQueue','omit','dataValues','createdAt','updatedAt','state','deleted','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','CmContact','ContactId','firstName','lastName','isNil','calleridname','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','sequelize','transaction','dialPreviewAutoRecallMe','direction','isEmpty','hopperIds','scheduledAt','ASC','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','recallme','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','Queue','dialActive','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x250365,_0x6b6b9f){var _0x3de996=function(_0x2ac708){while(--_0x2ac708){_0x250365['push'](_0x250365['shift']());}};_0x3de996(++_0x6b6b9f);}(_0xeecb,0x11e));var _0xbeec=function(_0x1f9bc0,_0x1edaaf){_0x1f9bc0=_0x1f9bc0-0x0;var _0x40de7a=_0xeecb[_0x1f9bc0];return _0x40de7a;};'use strict';var emlformat=require(_0xbeec('0x0'));var rimraf=require(_0xbeec('0x1'));var zipdir=require(_0xbeec('0x2'));var jsonpatch=require(_0xbeec('0x3'));var rp=require('request-promise');var moment=require(_0xbeec('0x4'));var BPromise=require(_0xbeec('0x5'));var Mustache=require('mustache');var util=require(_0xbeec('0x6'));var path=require(_0xbeec('0x7'));var sox=require('sox');var csv=require(_0xbeec('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbeec('0x9'));var _=require(_0xbeec('0xa'));var squel=require(_0xbeec('0xb'));var crypto=require(_0xbeec('0xc'));var jsforce=require(_0xbeec('0xd'));var deskjs=require(_0xbeec('0xe'));var toCsv=require('to-csv');var querystring=require(_0xbeec('0xf'));var Papa=require(_0xbeec('0x10'));var Redis=require(_0xbeec('0x11'));var authService=require(_0xbeec('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xbeec('0x13'));var hardwareService=require(_0xbeec('0x14'));var logger=require(_0xbeec('0x15'))(_0xbeec('0x16'));var utils=require('../../config/utils');var config=require(_0xbeec('0x17'));var licenseUtil=require(_0xbeec('0x18'));var db=require(_0xbeec('0x19'))['db'];function respondWithStatusCode(_0x120ad8,_0x707645){_0x707645=_0x707645||0xcc;return function(_0x17098c){if(_0x17098c){return _0x120ad8[_0xbeec('0x1a')](_0x707645);}return _0x120ad8[_0xbeec('0x1b')](_0x707645)[_0xbeec('0x1c')]();};}function respondWithResult(_0x47f5ab,_0x30d8a7){_0x30d8a7=_0x30d8a7||0xc8;return function(_0x4be5b7){if(_0x4be5b7){return _0x47f5ab[_0xbeec('0x1b')](_0x30d8a7)[_0xbeec('0x1d')](_0x4be5b7);}};}function respondWithFilteredResult(_0x31cb2a,_0x373e3e){return function(_0x3b1bce){if(_0x3b1bce){var _0x350636=typeof _0x373e3e['offset']==='undefined'&&typeof _0x373e3e[_0xbeec('0x1e')]===_0xbeec('0x1f');var _0x33a909=_0x3b1bce['count'];var _0x5da083=_0x350636?0x0:_0x373e3e[_0xbeec('0x20')];var _0x420215=_0x350636?_0x3b1bce[_0xbeec('0x21')]:_0x373e3e[_0xbeec('0x20')]+_0x373e3e[_0xbeec('0x1e')];var _0x2c6eb1;if(_0x420215>=_0x33a909){_0x420215=_0x33a909;_0x2c6eb1=0xc8;}else{_0x2c6eb1=0xce;}_0x31cb2a[_0xbeec('0x1b')](_0x2c6eb1);return _0x31cb2a['set'](_0xbeec('0x22'),_0x5da083+'-'+_0x420215+'/'+_0x33a909)[_0xbeec('0x1d')](_0x3b1bce);}return null;};}function patchUpdates(_0x5bfe46){return function(_0x207563){try{jsonpatch[_0xbeec('0x23')](_0x207563,_0x5bfe46,!![]);}catch(_0x274738){return BPromise[_0xbeec('0x24')](_0x274738);}return _0x207563[_0xbeec('0x25')]();};}function saveUpdates(_0x3e19eb,_0x1f3ccb){return function(_0x5b3bb1){if(_0x5b3bb1){return _0x5b3bb1[_0xbeec('0x26')](_0x3e19eb)[_0xbeec('0x27')](function(_0x6488bf){return _0x6488bf;});}return null;};}function removeEntity(_0x25901e,_0xa23b46){return function(_0x10cdca){if(_0x10cdca){return _0x10cdca['destroy']()[_0xbeec('0x27')](function(){_0x25901e[_0xbeec('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25a926,_0x5c662e){return function(_0x156f35){if(!_0x156f35){_0x25a926[_0xbeec('0x1a')](0x194);}return _0x156f35;};}function handleError(_0x4d69b8,_0x2ade63){_0x2ade63=_0x2ade63||0x1f4;return function(_0x23125d){logger[_0xbeec('0x28')](_0x23125d['stack']);if(_0x23125d['name']){delete _0x23125d[_0xbeec('0x29')];}_0x4d69b8['status'](_0x2ade63)['send'](_0x23125d);};}exports[_0xbeec('0x2a')]=function(_0xfff6e3,_0x140aab){var _0x5584ed={},_0x4fda78={},_0x41c122={'count':0x0,'rows':[]};var _0x598ef9=_[_0xbeec('0x2b')](db[_0xbeec('0x2c')]['rawAttributes'],function(_0x109f3f){return{'name':_0x109f3f[_0xbeec('0x2d')],'type':_0x109f3f['type'][_0xbeec('0x2e')]};});_0x4fda78[_0xbeec('0x2f')]=_[_0xbeec('0x2b')](_0x598ef9,_0xbeec('0x29'));_0x4fda78[_0xbeec('0x30')]=_['keys'](_0xfff6e3[_0xbeec('0x30')]);_0x4fda78[_0xbeec('0x31')]=_['intersection'](_0x4fda78[_0xbeec('0x2f')],_0x4fda78[_0xbeec('0x30')]);_0x4fda78[_0xbeec('0x31')]=_[_0xbeec('0x32')](_0x4fda78[_0xbeec('0x31')],[_0xbeec('0x33'),_0xbeec('0x34'),'$gt',_0xbeec('0x35'),_0xbeec('0x36'),_0xbeec('0x37'),_0xbeec('0x38'),_0xbeec('0x39'),_0xbeec('0x3a'),'$between','$notBetween',_0xbeec('0x3b'),_0xbeec('0x3c'),_0xbeec('0x3d'),_0xbeec('0x3e'),_0xbeec('0x3f'),_0xbeec('0x40'),_0xbeec('0x3d'),_0xbeec('0x41'),_0xbeec('0x42'),'$contained',_0xbeec('0x43')]);_0x5584ed[_0xbeec('0x44')]=_[_0xbeec('0x45')](_0x4fda78[_0xbeec('0x2f')],qs['fields'](_0xfff6e3[_0xbeec('0x30')][_0xbeec('0x46')]));_0x5584ed[_0xbeec('0x44')]=_0x5584ed[_0xbeec('0x44')][_0xbeec('0x47')]?_0x5584ed[_0xbeec('0x44')]:_0x4fda78[_0xbeec('0x2f')];if(!_0xfff6e3[_0xbeec('0x30')][_0xbeec('0x48')]('nolimit')){_0x5584ed[_0xbeec('0x1e')]=qs['limit'](_0xfff6e3['query'][_0xbeec('0x1e')]);_0x5584ed[_0xbeec('0x20')]=qs[_0xbeec('0x20')](_0xfff6e3[_0xbeec('0x30')][_0xbeec('0x20')]);}_0x5584ed[_0xbeec('0x49')]=qs[_0xbeec('0x4a')](_0xfff6e3[_0xbeec('0x30')][_0xbeec('0x4a')]);_0x5584ed[_0xbeec('0x4b')]=qs[_0xbeec('0x31')](_[_0xbeec('0x4c')](_0xfff6e3['query'],_0x4fda78['filters']),_0x598ef9);if(_0xfff6e3[_0xbeec('0x30')]['filter']){_0x5584ed[_0xbeec('0x4b')]=_[_0xbeec('0x4d')](_0x5584ed[_0xbeec('0x4b')],{'$or':_['map'](_0x598ef9,function(_0x1d5aed){if(_0x1d5aed[_0xbeec('0x4e')]!==_0xbeec('0x4f')){var _0x48ecee={};_0x48ecee[_0x1d5aed['name']]={'$like':'%'+_0xfff6e3[_0xbeec('0x30')]['filter']+'%'};return _0x48ecee;}})});}_0x5584ed=_[_0xbeec('0x4d')]({},_0x5584ed,_0xfff6e3[_0xbeec('0x50')]);var _0x521224={'where':_0x5584ed[_0xbeec('0x4b')]};return db[_0xbeec('0x2c')][_0xbeec('0x21')](_0x521224)[_0xbeec('0x27')](function(_0x154247){_0x41c122['count']=_0x154247;if(_0xfff6e3[_0xbeec('0x30')][_0xbeec('0x51')]){_0x5584ed[_0xbeec('0x52')]=[{'all':!![]}];}return db[_0xbeec('0x2c')][_0xbeec('0x53')](_0x5584ed);})[_0xbeec('0x27')](function(_0x1f072b){_0x41c122[_0xbeec('0x54')]=_0x1f072b;return _0x41c122;})[_0xbeec('0x27')](respondWithFilteredResult(_0x140aab,_0x5584ed))[_0xbeec('0x55')](handleError(_0x140aab,null));};exports[_0xbeec('0x56')]=function(_0x567ee9,_0x42412f){var _0x1c2dd8={'raw':!![],'where':{'id':_0x567ee9['params']['id']}},_0x3fcf9d={};_0x3fcf9d[_0xbeec('0x2f')]=_[_0xbeec('0x57')](db['CmHopper'][_0xbeec('0x58')]);_0x3fcf9d[_0xbeec('0x30')]=_['keys'](_0x567ee9[_0xbeec('0x30')]);_0x3fcf9d['filters']=_[_0xbeec('0x45')](_0x3fcf9d[_0xbeec('0x2f')],_0x3fcf9d[_0xbeec('0x30')]);_0x1c2dd8['attributes']=_[_0xbeec('0x45')](_0x3fcf9d[_0xbeec('0x2f')],qs[_0xbeec('0x46')](_0x567ee9[_0xbeec('0x30')][_0xbeec('0x46')]));_0x1c2dd8['attributes']=_0x1c2dd8['attributes'][_0xbeec('0x47')]?_0x1c2dd8[_0xbeec('0x44')]:_0x3fcf9d[_0xbeec('0x2f')];if(_0x567ee9['query'][_0xbeec('0x51')]){_0x1c2dd8[_0xbeec('0x52')]=[{'all':!![]}];}_0x1c2dd8=_[_0xbeec('0x4d')]({},_0x1c2dd8,_0x567ee9[_0xbeec('0x50')]);return db[_0xbeec('0x2c')][_0xbeec('0x59')](_0x1c2dd8)[_0xbeec('0x27')](handleEntityNotFound(_0x42412f,null))[_0xbeec('0x27')](respondWithResult(_0x42412f,null))[_0xbeec('0x55')](handleError(_0x42412f,null));};exports[_0xbeec('0x5a')]=function(_0x43c914,_0x4a8826){return db[_0xbeec('0x2c')][_0xbeec('0x5a')](_0x43c914[_0xbeec('0x5b')],{})['then'](respondWithResult(_0x4a8826,0xc9))[_0xbeec('0x55')](handleError(_0x4a8826,null));};exports[_0xbeec('0x26')]=function(_0x426691,_0x14a96c){if(_0x426691[_0xbeec('0x5b')]['id']){delete _0x426691['body']['id'];}return db['CmHopper']['find']({'where':{'id':_0x426691[_0xbeec('0x5c')]['id']}})[_0xbeec('0x27')](handleEntityNotFound(_0x14a96c,null))['then'](saveUpdates(_0x426691[_0xbeec('0x5b')],null))['then'](respondWithResult(_0x14a96c,null))[_0xbeec('0x55')](handleError(_0x14a96c,null));};exports[_0xbeec('0x5d')]=function(_0x58ff21,_0x3624b3){return db['CmHopper'][_0xbeec('0x5d')]()[_0xbeec('0x27')](respondWithResult(_0x3624b3,null))['catch'](handleError(_0x3624b3,null));};exports[_0xbeec('0x5e')]=function(_0x42922a,_0x3a9a23){var _0x11a89b;return db[_0xbeec('0x2c')][_0xbeec('0x59')]({'where':{'id':_0x42922a[_0xbeec('0x5c')]['id']}})[_0xbeec('0x27')](handleEntityNotFound(_0x3a9a23,null))[_0xbeec('0x27')](function(_0x43480a){if(_0x43480a){return _0x43480a['destroy']()[_0xbeec('0x27')](function(_0x5c2456){return _0x5c2456;});}})[_0xbeec('0x27')](function(_0x3c4061){_0x11a89b=_0x3c4061;if(_0x3c4061){if(_0x3c4061['VoiceQueueId']||_0x3c4061[_0xbeec('0x5f')]){return db[_0x3c4061[_0xbeec('0x60')]?_0xbeec('0x61'):'Campaign'][_0xbeec('0x59')]({'where':{'id':_0x3c4061['VoiceQueueId']?_0x3c4061[_0xbeec('0x60')]:_0x3c4061['CampaignId']},'attributes':['id',_0xbeec('0x29')],'raw':!![]});}}})[_0xbeec('0x27')](function(_0x713ff8){var _0x4ed7c0={};if(_0x713ff8){_[_0xbeec('0x4d')](_0x4ed7c0,_[_0xbeec('0x62')](_0x11a89b[_0xbeec('0x63')],[_0xbeec('0x64'),_0xbeec('0x65'),'id']));_0x4ed7c0[_0xbeec('0x66')]=0x15;_0x4ed7c0['statedesc']=_0xbeec('0x67');_0x4ed7c0['campaign']=_0x713ff8[_0xbeec('0x29')];_0x4ed7c0[_0xbeec('0x68')]=_0x42922a[_0xbeec('0x69')][_0xbeec('0x29')];_0x4ed7c0[_0xbeec('0x6a')]=_0x42922a[_0xbeec('0x69')]['id'];_0x4ed7c0['deleted']=!![];_0x4ed7c0[_0xbeec('0x6b')]=moment()[_0xbeec('0x6c')](_0xbeec('0x6d'));_0x4ed7c0['calleridnum']=_0x11a89b['phone'];_0x4ed7c0['campaigntype']=_0x11a89b[_0xbeec('0x60')]?'queue':'ivr';return db[_0xbeec('0x6e')]['find']({'where':{'id':_0x4ed7c0[_0xbeec('0x6f')]},'attributes':[_0xbeec('0x70'),_0xbeec('0x71')]})[_0xbeec('0x27')](function(_0x36638f){if(!_[_0xbeec('0x72')](_0x3a9a23)&&!_[_0xbeec('0x72')](_0x36638f['firstName'])){_0x4ed7c0[_0xbeec('0x73')]=_0x36638f[_0xbeec('0x70')];if(!_['isNil'](_0x36638f[_0xbeec('0x71')])){_0x4ed7c0[_0xbeec('0x73')]+='\x20'+_0x36638f[_0xbeec('0x71')];}}})['finally'](function(){return db['CmHopperFinal'][_0xbeec('0x5a')](_0x4ed7c0);});}})[_0xbeec('0x27')](function(){return _0x3a9a23['status'](0xcc)[_0xbeec('0x1c')]();})[_0xbeec('0x55')](handleError(_0x3a9a23,null));};exports['getPreview']=function(_0x5f1e68,_0x430d97,_0x35e276){var _0x5f296b=[];return db['CmContact'][_0xbeec('0x5d')]()[_0xbeec('0x27')](function(_0x2fa24e){_0x5f296b=_[_0xbeec('0x57')](_0x2fa24e);return _0x5f1e68[_0xbeec('0x69')][_0xbeec('0x74')]({'where':{'type':_0xbeec('0x75'),'dialActive':!![],'dialMethod':_0xbeec('0x76')},'attributes':['id',_0xbeec('0x77'),'dialPreviewAutoRecallMe'],'raw':!![]});})['then'](function(_0xf124cd){if(_0xf124cd&&_0xf124cd[_0xbeec('0x47')]){return db[_0xbeec('0x78')][_0xbeec('0x79')](function(_0x3cf6fc){var _0x1db235={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xbeec('0x6c')](_0xbeec('0x6d'))},'VoiceQueueId':{'$in':_[_0xbeec('0x2b')](_0xf124cd,'id')},'$or':[{'UserId':null},{'UserId':_0x5f1e68[_0xbeec('0x69')]['id']}]};var _0x458d98={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0xf124cd)['filter']([_0xbeec('0x7a'),0x0])[_0xbeec('0x2b')]('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x5f1e68[_0xbeec('0x69')]['id']}]};var _0x3a7103={'$or':[_0x1db235,_0x458d98]};var _0x5ad74f=[];if(_0x5f1e68[_0xbeec('0x5b')][_0xbeec('0x7b')]&&_0x5f1e68[_0xbeec('0x5b')][_0xbeec('0x7b')]==='prev'){if(!_[_0xbeec('0x7c')](_0x5f1e68[_0xbeec('0x5b')][_0xbeec('0x7d')])){_0x3a7103['id']={'$in':_0x5f1e68[_0xbeec('0x5b')][_0xbeec('0x7d')]};}_0x5ad74f=[['priority','ASC'],[_0xbeec('0x7e'),_0xf124cd[0x0]['dialOrderByScheduledAt']===_0xbeec('0x7f')?_0xbeec('0x80'):_0xbeec('0x7f')],db[_0xbeec('0x78')][_0xbeec('0x81')](_0xbeec('0x82')),['id','DESC']];}else{if(!_[_0xbeec('0x7c')](_0x5f1e68[_0xbeec('0x5b')][_0xbeec('0x7d')])){_0x3a7103['id']={'$notIn':_0x5f1e68[_0xbeec('0x5b')]['hopperIds']};}_0x5ad74f=[['priority',_0xbeec('0x80')],['scheduledAt',_0xf124cd[0x0][_0xbeec('0x77')]],db['sequelize'][_0xbeec('0x81')](_0xbeec('0x83')),['id',_0xbeec('0x7f')]];}return db[_0xbeec('0x2c')][_0xbeec('0x84')]({'attributes':['id','scheduledat',_0xbeec('0x85')],'where':_0x3a7103,'order':_0x5ad74f,'transaction':_0x3cf6fc,'lock':_0x3cf6fc[_0xbeec('0x86')][_0xbeec('0x87')],'include':[{'model':db['CmContact'],'as':_0xbeec('0x88'),'attributes':_0x5f296b,'include':[{'model':db[_0xbeec('0x89')],'as':_0xbeec('0x8a'),'attributes':['id',_0xbeec('0x29')]}]},{'model':db[_0xbeec('0x8b')],'as':_0xbeec('0x8c'),'attributes':['id',_0xbeec('0x29')]},{'model':db['VoiceQueue'],'as':_0xbeec('0x8d'),'attributes':['id',_0xbeec('0x29'),_0xbeec('0x8e')]}]})[_0xbeec('0x27')](function(_0x3d01a6){if(_0x3d01a6){return _0x3d01a6[_0xbeec('0x26')]({'UserId':_0x5f1e68[_0xbeec('0x69')]['id']},{'transaction':_0x3cf6fc});}});});}})[_0xbeec('0x27')](handleEntityNotFound(_0x430d97,null))[_0xbeec('0x27')](respondWithResult(_0x430d97,null))[_0xbeec('0x55')](handleError(_0x430d97,null));};exports['getOpenContacts']=function(_0x16beb7,_0x36cd6c,_0x11aba5){return _0x16beb7[_0xbeec('0x69')][_0xbeec('0x74')]({'where':{'type':_0xbeec('0x75'),'dialActive':!![],'dialMethod':_0xbeec('0x76')},'attributes':['id'],'raw':!![]})[_0xbeec('0x27')](function(_0x5c8b38){if(_0x5c8b38&&_0x5c8b38[_0xbeec('0x47')]){return db['CmHopper'][_0xbeec('0x21')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xbeec('0x6c')](_0xbeec('0x6d'))},'VoiceQueueId':{'$in':_[_0xbeec('0x2b')](_0x5c8b38,'id')},'$or':[{'UserId':null},{'UserId':_0x16beb7[_0xbeec('0x69')]['id']}]}});}return 0x0;})[_0xbeec('0x27')](function(_0x116fbc){if(!_[_0xbeec('0x72')](_0x116fbc)&&_['isNumber'](_0x116fbc)){return _0x36cd6c[_0xbeec('0x1b')](0xc8)[_0xbeec('0x1d')]({'contacts':_0x116fbc});}else{logger['error'](_0xbeec('0x8f'),_0xbeec('0x90'),0x194,'entity\x20not\x20found');_0x36cd6c[_0xbeec('0x1a')](0x194);}})[_0xbeec('0x55')](handleError(_0x36cd6c,null));}; \ No newline at end of file +var _0x05c6=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','offset','limit','count','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','map','CmHopper','rawAttributes','key','model','query','filters','intersection','concat','$and','$or','$gt','$lt','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$notLike','$iLike','$notILike','$like','$overlap','$contains','$contained','$any','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','findAll','catch','show','params','keys','includeAll','options','find','create','body','describe','CampaignId','VoiceQueueId','VoiceQueue','dataValues','updatedAt','state','statedesc','deleted','campaign','membername','user','UserId','deletedat','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','CmContact','ContactId','isNil','firstName','calleridname','lastName','finally','CmHopperFinal','getPreview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','value','direction','prev','isEmpty','hopperIds','ASC','literal','DESC','priority','scheduledAt','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','LOCK','UPDATE','Contact','CmCompany','CmList','List','Queue','dialActive','getOpenContacts','getVoiceQueues','outbound','preview','format','isNumber','json','CmHopper,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','squel'];(function(_0x810025,_0x34bb04){var _0x4dbc81=function(_0x2c3907){while(--_0x2c3907){_0x810025['push'](_0x810025['shift']());}};_0x4dbc81(++_0x34bb04);}(_0x05c6,0x125));var _0x605c=function(_0x2119e5,_0x439455){_0x2119e5=_0x2119e5-0x0;var _0x321ccb=_0x05c6[_0x2119e5];return _0x321ccb;};'use strict';var emlformat=require(_0x605c('0x0'));var rimraf=require(_0x605c('0x1'));var zipdir=require(_0x605c('0x2'));var jsonpatch=require(_0x605c('0x3'));var rp=require(_0x605c('0x4'));var moment=require(_0x605c('0x5'));var BPromise=require(_0x605c('0x6'));var Mustache=require(_0x605c('0x7'));var util=require(_0x605c('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x605c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x605c('0xa'));var _=require(_0x605c('0xb'));var squel=require(_0x605c('0xc'));var crypto=require(_0x605c('0xd'));var jsforce=require(_0x605c('0xe'));var deskjs=require(_0x605c('0xf'));var toCsv=require(_0x605c('0x9'));var querystring=require(_0x605c('0x10'));var Papa=require(_0x605c('0x11'));var Redis=require(_0x605c('0x12'));var authService=require(_0x605c('0x13'));var qs=require(_0x605c('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x605c('0x15'));var logger=require(_0x605c('0x16'))('api');var utils=require(_0x605c('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x605c('0x18'))['db'];function respondWithStatusCode(_0x32994c,_0x5c64a9){_0x5c64a9=_0x5c64a9||0xcc;return function(_0x31d198){if(_0x31d198){return _0x32994c[_0x605c('0x19')](_0x5c64a9);}return _0x32994c[_0x605c('0x1a')](_0x5c64a9)[_0x605c('0x1b')]();};}function respondWithResult(_0x4ca699,_0x3414c8){_0x3414c8=_0x3414c8||0xc8;return function(_0x4e9761){if(_0x4e9761){return _0x4ca699[_0x605c('0x1a')](_0x3414c8)['json'](_0x4e9761);}};}function respondWithFilteredResult(_0x5e4b3c,_0x1659e2){return function(_0x487986){if(_0x487986){var _0x183dbd=typeof _0x1659e2[_0x605c('0x1c')]==='undefined'&&typeof _0x1659e2[_0x605c('0x1d')]==='undefined';var _0x33af6e=_0x487986[_0x605c('0x1e')];var _0x209aab=_0x183dbd?0x0:_0x1659e2[_0x605c('0x1c')];var _0x5f10ea=_0x183dbd?_0x487986[_0x605c('0x1e')]:_0x1659e2['offset']+_0x1659e2[_0x605c('0x1d')];var _0x3f662a;if(_0x5f10ea>=_0x33af6e){_0x5f10ea=_0x33af6e;_0x3f662a=0xc8;}else{_0x3f662a=0xce;}_0x5e4b3c[_0x605c('0x1a')](_0x3f662a);return _0x5e4b3c[_0x605c('0x1f')](_0x605c('0x20'),_0x209aab+'-'+_0x5f10ea+'/'+_0x33af6e)['json'](_0x487986);}return null;};}function patchUpdates(_0x171c4c){return function(_0x414200){try{jsonpatch[_0x605c('0x21')](_0x414200,_0x171c4c,!![]);}catch(_0x13f9cc){return BPromise[_0x605c('0x22')](_0x13f9cc);}return _0x414200['save']();};}function saveUpdates(_0x579e37,_0x5f401b){return function(_0x2e8674){if(_0x2e8674){return _0x2e8674[_0x605c('0x23')](_0x579e37)['then'](function(_0x494342){return _0x494342;});}return null;};}function removeEntity(_0x5a68d3,_0x4de77e){return function(_0x1ae034){if(_0x1ae034){return _0x1ae034[_0x605c('0x24')]()[_0x605c('0x25')](function(){_0x5a68d3[_0x605c('0x1a')](0xcc)[_0x605c('0x1b')]();});}};}function handleEntityNotFound(_0x5bcd7a,_0x2cf7e0){return function(_0x285f88){if(!_0x285f88){_0x5bcd7a[_0x605c('0x19')](0x194);}return _0x285f88;};}function handleError(_0x538106,_0x4c193e){_0x4c193e=_0x4c193e||0x1f4;return function(_0x904aca){logger[_0x605c('0x26')](_0x904aca[_0x605c('0x27')]);if(_0x904aca[_0x605c('0x28')]){delete _0x904aca[_0x605c('0x28')];}_0x538106[_0x605c('0x1a')](_0x4c193e)[_0x605c('0x29')](_0x904aca);};}exports['index']=function(_0x158fe4,_0x294f25){var _0x1a911d={},_0x167970={},_0xf2197={'count':0x0,'rows':[]};var _0x41fa4c=_[_0x605c('0x2a')](db[_0x605c('0x2b')][_0x605c('0x2c')],function(_0x38ae19){return{'name':_0x38ae19['fieldName'],'type':_0x38ae19['type'][_0x605c('0x2d')]};});_0x167970[_0x605c('0x2e')]=_[_0x605c('0x2a')](_0x41fa4c,_0x605c('0x28'));_0x167970[_0x605c('0x2f')]=_['keys'](_0x158fe4['query']);_0x167970[_0x605c('0x30')]=_[_0x605c('0x31')](_0x167970[_0x605c('0x2e')],_0x167970['query']);_0x167970[_0x605c('0x30')]=_[_0x605c('0x32')](_0x167970['filters'],[_0x605c('0x33'),_0x605c('0x34'),_0x605c('0x35'),'$gte',_0x605c('0x36'),'$lte',_0x605c('0x37'),_0x605c('0x38'),_0x605c('0x39'),_0x605c('0x3a'),_0x605c('0x3b'),_0x605c('0x3c'),_0x605c('0x3d'),'$like',_0x605c('0x3e'),_0x605c('0x3f'),_0x605c('0x40'),_0x605c('0x41'),_0x605c('0x42'),_0x605c('0x43'),_0x605c('0x44'),_0x605c('0x45')]);_0x1a911d['attributes']=_[_0x605c('0x31')](_0x167970[_0x605c('0x2e')],qs[_0x605c('0x46')](_0x158fe4[_0x605c('0x2f')][_0x605c('0x46')]));_0x1a911d[_0x605c('0x47')]=_0x1a911d[_0x605c('0x47')][_0x605c('0x48')]?_0x1a911d['attributes']:_0x167970[_0x605c('0x2e')];if(!_0x158fe4[_0x605c('0x2f')][_0x605c('0x49')](_0x605c('0x4a'))){_0x1a911d['limit']=qs[_0x605c('0x1d')](_0x158fe4[_0x605c('0x2f')]['limit']);_0x1a911d[_0x605c('0x1c')]=qs['offset'](_0x158fe4['query'][_0x605c('0x1c')]);}_0x1a911d[_0x605c('0x4b')]=qs[_0x605c('0x4c')](_0x158fe4[_0x605c('0x2f')][_0x605c('0x4c')]);_0x1a911d[_0x605c('0x4d')]=qs[_0x605c('0x30')](_['pick'](_0x158fe4[_0x605c('0x2f')],_0x167970['filters']),_0x41fa4c);if(_0x158fe4['query'][_0x605c('0x4e')]){_0x1a911d[_0x605c('0x4d')]=_[_0x605c('0x4f')](_0x1a911d[_0x605c('0x4d')],{'$or':_[_0x605c('0x2a')](_0x41fa4c,function(_0x210f0b){if(_0x210f0b['type']!=='VIRTUAL'){var _0x4977f3={};_0x4977f3[_0x210f0b[_0x605c('0x28')]]={'$like':'%'+_0x158fe4[_0x605c('0x2f')][_0x605c('0x4e')]+'%'};return _0x4977f3;}})});}_0x1a911d=_[_0x605c('0x4f')]({},_0x1a911d,_0x158fe4['options']);var _0x5e34a2={'where':_0x1a911d[_0x605c('0x4d')]};return db['CmHopper']['count'](_0x5e34a2)['then'](function(_0xd5ff81){_0xf2197[_0x605c('0x1e')]=_0xd5ff81;if(_0x158fe4[_0x605c('0x2f')]['includeAll']){_0x1a911d['include']=[{'all':!![]}];}return db[_0x605c('0x2b')][_0x605c('0x50')](_0x1a911d);})[_0x605c('0x25')](function(_0x214ab5){_0xf2197['rows']=_0x214ab5;return _0xf2197;})[_0x605c('0x25')](respondWithFilteredResult(_0x294f25,_0x1a911d))[_0x605c('0x51')](handleError(_0x294f25,null));};exports[_0x605c('0x52')]=function(_0x3304bf,_0x47146b){var _0x5423c7={'raw':!![],'where':{'id':_0x3304bf[_0x605c('0x53')]['id']}},_0x1bea4a={};_0x1bea4a[_0x605c('0x2e')]=_[_0x605c('0x54')](db[_0x605c('0x2b')][_0x605c('0x2c')]);_0x1bea4a[_0x605c('0x2f')]=_[_0x605c('0x54')](_0x3304bf[_0x605c('0x2f')]);_0x1bea4a[_0x605c('0x30')]=_['intersection'](_0x1bea4a[_0x605c('0x2e')],_0x1bea4a[_0x605c('0x2f')]);_0x5423c7[_0x605c('0x47')]=_[_0x605c('0x31')](_0x1bea4a[_0x605c('0x2e')],qs[_0x605c('0x46')](_0x3304bf[_0x605c('0x2f')][_0x605c('0x46')]));_0x5423c7[_0x605c('0x47')]=_0x5423c7[_0x605c('0x47')][_0x605c('0x48')]?_0x5423c7['attributes']:_0x1bea4a[_0x605c('0x2e')];if(_0x3304bf[_0x605c('0x2f')][_0x605c('0x55')]){_0x5423c7['include']=[{'all':!![]}];}_0x5423c7=_[_0x605c('0x4f')]({},_0x5423c7,_0x3304bf[_0x605c('0x56')]);return db[_0x605c('0x2b')][_0x605c('0x57')](_0x5423c7)[_0x605c('0x25')](handleEntityNotFound(_0x47146b,null))['then'](respondWithResult(_0x47146b,null))[_0x605c('0x51')](handleError(_0x47146b,null));};exports['create']=function(_0x2cb650,_0x49ee78){return db[_0x605c('0x2b')][_0x605c('0x58')](_0x2cb650[_0x605c('0x59')],{})[_0x605c('0x25')](respondWithResult(_0x49ee78,0xc9))[_0x605c('0x51')](handleError(_0x49ee78,null));};exports[_0x605c('0x23')]=function(_0x3675cc,_0x5174e5){if(_0x3675cc[_0x605c('0x59')]['id']){delete _0x3675cc['body']['id'];}return db['CmHopper']['find']({'where':{'id':_0x3675cc[_0x605c('0x53')]['id']}})[_0x605c('0x25')](handleEntityNotFound(_0x5174e5,null))[_0x605c('0x25')](saveUpdates(_0x3675cc[_0x605c('0x59')],null))[_0x605c('0x25')](respondWithResult(_0x5174e5,null))[_0x605c('0x51')](handleError(_0x5174e5,null));};exports[_0x605c('0x5a')]=function(_0x3b6e86,_0x26a386){return db[_0x605c('0x2b')]['describe']()[_0x605c('0x25')](respondWithResult(_0x26a386,null))[_0x605c('0x51')](handleError(_0x26a386,null));};exports['destroy']=function(_0x49b8a1,_0x18a897){var _0xf61e14;return db[_0x605c('0x2b')][_0x605c('0x57')]({'where':{'id':_0x49b8a1[_0x605c('0x53')]['id']}})[_0x605c('0x25')](handleEntityNotFound(_0x18a897,null))['then'](function(_0x14020c){if(_0x14020c){return _0x14020c[_0x605c('0x24')]()[_0x605c('0x25')](function(_0x4c0c3d){return _0x4c0c3d;});}})[_0x605c('0x25')](function(_0x1c6d86){_0xf61e14=_0x1c6d86;if(_0x1c6d86){if(_0x1c6d86['VoiceQueueId']||_0x1c6d86[_0x605c('0x5b')]){return db[_0x1c6d86[_0x605c('0x5c')]?_0x605c('0x5d'):'Campaign'][_0x605c('0x57')]({'where':{'id':_0x1c6d86[_0x605c('0x5c')]?_0x1c6d86[_0x605c('0x5c')]:_0x1c6d86['CampaignId']},'attributes':['id',_0x605c('0x28')],'raw':!![]});}}})[_0x605c('0x25')](function(_0x294124){var _0x25d12d={};if(_0x294124){_[_0x605c('0x4f')](_0x25d12d,_['omit'](_0xf61e14[_0x605c('0x5e')],['createdAt',_0x605c('0x5f'),'id']));_0x25d12d[_0x605c('0x60')]=0x15;_0x25d12d[_0x605c('0x61')]=_0x605c('0x62');_0x25d12d[_0x605c('0x63')]=_0x294124[_0x605c('0x28')];_0x25d12d[_0x605c('0x64')]=_0x49b8a1[_0x605c('0x65')][_0x605c('0x28')];_0x25d12d[_0x605c('0x66')]=_0x49b8a1[_0x605c('0x65')]['id'];_0x25d12d[_0x605c('0x62')]=!![];_0x25d12d[_0x605c('0x67')]=moment()['format'](_0x605c('0x68'));_0x25d12d[_0x605c('0x69')]=_0xf61e14[_0x605c('0x6a')];_0x25d12d[_0x605c('0x6b')]=_0xf61e14[_0x605c('0x5c')]?_0x605c('0x6c'):_0x605c('0x6d');return db[_0x605c('0x6e')][_0x605c('0x57')]({'where':{'id':_0x25d12d[_0x605c('0x6f')]},'attributes':['firstName','lastName']})[_0x605c('0x25')](function(_0x51ae6b){if(!_[_0x605c('0x70')](_0x18a897)&&!_[_0x605c('0x70')](_0x51ae6b[_0x605c('0x71')])){_0x25d12d[_0x605c('0x72')]=_0x51ae6b['firstName'];if(!_[_0x605c('0x70')](_0x51ae6b[_0x605c('0x73')])){_0x25d12d['calleridname']+='\x20'+_0x51ae6b['lastName'];}}})[_0x605c('0x74')](function(){return db[_0x605c('0x75')][_0x605c('0x58')](_0x25d12d);});}})['then'](function(){return _0x18a897['status'](0xcc)['end']();})[_0x605c('0x51')](handleError(_0x18a897,null));};exports[_0x605c('0x76')]=function(_0x23de7b,_0xa9277f,_0x5bd0c1){var _0x456231=[];return db[_0x605c('0x6e')][_0x605c('0x5a')]()[_0x605c('0x25')](function(_0x3345ff){_0x456231=_[_0x605c('0x54')](_0x3345ff);return _0x23de7b[_0x605c('0x65')]['getVoiceQueues']({'where':{'type':'outbound','dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x605c('0x77'),_0x605c('0x78')],'raw':!![]});})['then'](function(_0x462f04){if(_0x462f04&&_0x462f04[_0x605c('0x48')]){return db[_0x605c('0x79')][_0x605c('0x7a')](function(_0x3049b1){var _0x56c8f5={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x605c('0x68'))},'VoiceQueueId':{'$in':_[_0x605c('0x2a')](_0x462f04,'id')},'$or':[{'UserId':null},{'UserId':_0x23de7b[_0x605c('0x65')]['id']}]};var _0x2d0e5e={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x462f04)[_0x605c('0x4e')]([_0x605c('0x78'),0x0])[_0x605c('0x2a')]('id')[_0x605c('0x7b')]()},'$or':[{'UserId':null},{'UserId':_0x23de7b[_0x605c('0x65')]['id']}]};var _0x4c6c4b={'$or':[_0x56c8f5,_0x2d0e5e]};var _0x2e550d=[];if(_0x23de7b[_0x605c('0x59')][_0x605c('0x7c')]&&_0x23de7b['body'][_0x605c('0x7c')]===_0x605c('0x7d')){if(!_[_0x605c('0x7e')](_0x23de7b[_0x605c('0x59')]['hopperIds'])){_0x4c6c4b['id']={'$in':_0x23de7b['body'][_0x605c('0x7f')]};}_0x2e550d=[['priority','ASC'],['scheduledAt',_0x462f04[0x0][_0x605c('0x77')]===_0x605c('0x80')?'DESC':'ASC'],db['sequelize'][_0x605c('0x81')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0x605c('0x82')]];}else{if(!_[_0x605c('0x7e')](_0x23de7b[_0x605c('0x59')][_0x605c('0x7f')])){_0x4c6c4b['id']={'$notIn':_0x23de7b[_0x605c('0x59')][_0x605c('0x7f')]};}_0x2e550d=[[_0x605c('0x83'),_0x605c('0x82')],[_0x605c('0x84'),_0x462f04[0x0]['dialOrderByScheduledAt']],db[_0x605c('0x79')]['literal'](_0x605c('0x85')),['id',_0x605c('0x80')]];}return db['CmHopper'][_0x605c('0x86')]({'attributes':['id',_0x605c('0x87'),_0x605c('0x88')],'where':_0x4c6c4b,'order':_0x2e550d,'transaction':_0x3049b1,'lock':_0x3049b1[_0x605c('0x89')][_0x605c('0x8a')],'include':[{'model':db[_0x605c('0x6e')],'as':_0x605c('0x8b'),'attributes':_0x456231,'include':[{'model':db[_0x605c('0x8c')],'as':'Company','attributes':['id',_0x605c('0x28')]}]},{'model':db[_0x605c('0x8d')],'as':_0x605c('0x8e'),'attributes':['id',_0x605c('0x28')]},{'model':db[_0x605c('0x5d')],'as':_0x605c('0x8f'),'attributes':['id',_0x605c('0x28'),_0x605c('0x90')]}]})[_0x605c('0x25')](function(_0x567628){if(_0x567628){return _0x567628[_0x605c('0x23')]({'UserId':_0x23de7b['user']['id']},{'transaction':_0x3049b1});}});});}})[_0x605c('0x25')](handleEntityNotFound(_0xa9277f,null))[_0x605c('0x25')](respondWithResult(_0xa9277f,null))['catch'](handleError(_0xa9277f,null));};exports[_0x605c('0x91')]=function(_0x57b603,_0x356a,_0x2f66c){return _0x57b603[_0x605c('0x65')][_0x605c('0x92')]({'where':{'type':_0x605c('0x93'),'dialActive':!![],'dialMethod':_0x605c('0x94')},'attributes':['id'],'raw':!![]})[_0x605c('0x25')](function(_0x4fffbf){if(_0x4fffbf&&_0x4fffbf[_0x605c('0x48')]){return db['CmHopper'][_0x605c('0x1e')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x605c('0x95')](_0x605c('0x68'))},'VoiceQueueId':{'$in':_[_0x605c('0x2a')](_0x4fffbf,'id')},'$or':[{'UserId':null},{'UserId':_0x57b603[_0x605c('0x65')]['id']}]}});}return 0x0;})[_0x605c('0x25')](function(_0x3828cb){if(!_[_0x605c('0x70')](_0x3828cb)&&_[_0x605c('0x96')](_0x3828cb)){return _0x356a[_0x605c('0x1a')](0xc8)[_0x605c('0x97')]({'contacts':_0x3828cb});}else{logger[_0x605c('0x26')](_0x605c('0x98'),_0x605c('0x91'),0x194,'entity\x20not\x20found');_0x356a['sendStatus'](0x194);}})['catch'](handleError(_0x356a,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index fc039ae..0877243 100644 --- a/server/api/cmHopper/cmHopper.model.js +++ b/server/api/cmHopper/cmHopper.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfdbd=['path','rimraf','./cmHopper.attributes','scheduledat','phone','priority','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4172be,_0x1b1786){var _0x2d6e5d=function(_0x3d7873){while(--_0x3d7873){_0x4172be['push'](_0x4172be['shift']());}};_0x2d6e5d(++_0x1b1786);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x564821,_0x4d037e){_0x564821=_0x564821-0x0;var _0x2b604d=_0xfdbd[_0x564821];return _0x2b604d;};'use strict';var _=require(_0xdfdb('0x0'));var util=require(_0xdfdb('0x1'));var logger=require(_0xdfdb('0x2'))(_0xdfdb('0x3'));var moment=require(_0xdfdb('0x4'));var BPromise=require(_0xdfdb('0x5'));var rp=require(_0xdfdb('0x6'));var fs=require('fs');var path=require(_0xdfdb('0x7'));var rimraf=require(_0xdfdb('0x8'));var config=require('../../config/environment');var attributes=require(_0xdfdb('0x9'));module['exports']=function(_0x453ef6,_0x41bd5e){return _0x453ef6['define']('CmHopper',attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0xdfdb('0xa'),'fields':[_0xdfdb('0xa')]},{'name':'phone','fields':[_0xdfdb('0xb')]},{'name':_0xdfdb('0xc'),'fields':[_0xdfdb('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc6ac=['./cmHopper.attributes','exports','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x2bb52b,_0x3d9bc6){_0x2bb52b=_0x2bb52b-0x0;var _0x11ade2=_0xc6ac[_0x2bb52b];return _0x11ade2;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var logger=require(_0xcc6a('0x2'))(_0xcc6a('0x3'));var moment=require(_0xcc6a('0x4'));var BPromise=require(_0xcc6a('0x5'));var rp=require(_0xcc6a('0x6'));var fs=require('fs');var path=require(_0xcc6a('0x7'));var rimraf=require(_0xcc6a('0x8'));var config=require(_0xcc6a('0x9'));var attributes=require(_0xcc6a('0xa'));module[_0xcc6a('0xb')]=function(_0x12330e,_0x197bd7){return _0x12330e['define'](_0xcc6a('0xc'),attributes,{'tableName':_0xcc6a('0xd'),'paranoid':![],'indexes':[{'name':_0xcc6a('0xe'),'fields':['scheduledat']},{'name':_0xcc6a('0xf'),'fields':[_0xcc6a('0xf')]},{'name':_0xcc6a('0x10'),'fields':[_0xcc6a('0x10')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index bd492d5..1ffd7bd 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 _0x8872=['jayson/promise','client','request','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetCmHopper','CmHopper','options','where','attributes','map','include','model','debug','find','raw','ShowCmHopper','CreateCmHopper','create','body','UpdateCmHopper','update','limit','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','GetContactDialer','CmContact','describe','transaction','findAll','order','LOCK','Contact','keys','User','Agent','name','voicePause','UserId','push','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','sequelize','destroy','MoveContactManagedDialer','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','GetContactRecallMe','length','ResetActiveCalls','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x1b33e2,_0xbcf80b){var _0x32be0d=function(_0x28953d){while(--_0x28953d){_0x1b33e2['push'](_0x1b33e2['shift']());}};_0x32be0d(++_0xbcf80b);}(_0x8872,0xd5));var _0x2887=function(_0xfabbb2,_0x535215){_0xfabbb2=_0xfabbb2-0x0;var _0x4a4a51=_0x8872[_0xfabbb2];return _0x4a4a51;};'use strict';var _=require(_0x2887('0x0'));var util=require(_0x2887('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2887('0x2'));var fs=require('fs');var Redis=require(_0x2887('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2887('0x4'));var logger=require(_0x2887('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2887('0x6'));var client=jayson[_0x2887('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f4ad3,_0xc2d559,_0x2e4a5b){return new BPromise(function(_0x28598b,_0x551f16){return client[_0x2887('0x8')](_0x4f4ad3,_0x2e4a5b)[_0x2887('0x9')](function(_0x1db2d1){logger[_0x2887('0xa')](_0x2887('0xb'),_0xc2d559,'request\x20sent');logger['debug']('CmHopper,\x20%s,\x20%s,\x20%s',_0xc2d559,_0x2887('0xc'),JSON[_0x2887('0xd')](_0x1db2d1));if(_0x1db2d1[_0x2887('0xe')]){if(_0x1db2d1[_0x2887('0xe')][_0x2887('0xf')]===0x1f4){logger['error'](_0x2887('0xb'),_0xc2d559,_0x1db2d1[_0x2887('0xe')][_0x2887('0x10')]);return _0x551f16(_0x1db2d1[_0x2887('0xe')][_0x2887('0x10')]);}logger['error'](_0x2887('0xb'),_0xc2d559,_0x1db2d1[_0x2887('0xe')][_0x2887('0x10')]);return _0x28598b(_0x1db2d1[_0x2887('0xe')][_0x2887('0x10')]);}else{logger[_0x2887('0xa')](_0x2887('0xb'),_0xc2d559,_0x2887('0xc'));_0x28598b(_0x1db2d1[_0x2887('0x11')]['message']);}})[_0x2887('0x12')](function(_0x10eca8){logger['error'](_0x2887('0xb'),_0xc2d559,_0x10eca8);_0x551f16(_0x10eca8);});});}exports[_0x2887('0x13')]=function(_0x1c89f0){var _0x26671e=this;return new Promise(function(_0x1f85f9,_0x4a4e3e){return db[_0x2887('0x14')]['findAll']({'raw':_0x1c89f0['options']?_0x1c89f0['options']['raw']===undefined?!![]:![]:!![],'where':_0x1c89f0[_0x2887('0x15')]?_0x1c89f0[_0x2887('0x15')][_0x2887('0x16')]||null:null,'attributes':_0x1c89f0['options']?_0x1c89f0[_0x2887('0x15')][_0x2887('0x17')]||null:null,'limit':_0x1c89f0[_0x2887('0x15')]?_0x1c89f0[_0x2887('0x15')]['limit']||null:null,'include':_0x1c89f0[_0x2887('0x15')]?_0x1c89f0[_0x2887('0x15')]['include']?_[_0x2887('0x18')](_0x1c89f0[_0x2887('0x15')][_0x2887('0x19')],function(_0x317670){return{'model':db[_0x317670[_0x2887('0x1a')]],'as':_0x317670['as'],'attributes':_0x317670[_0x2887('0x17')],'include':_0x317670[_0x2887('0x19')]?_[_0x2887('0x18')](_0x317670[_0x2887('0x19')],function(_0x114911){return{'model':db[_0x114911[_0x2887('0x1a')]],'as':_0x114911['as'],'attributes':_0x114911[_0x2887('0x17')],'include':_0x114911[_0x2887('0x19')]?_[_0x2887('0x18')](_0x114911[_0x2887('0x19')],function(_0x1a2b4e){return{'model':db[_0x1a2b4e[_0x2887('0x1a')]],'as':_0x1a2b4e['as'],'attributes':_0x1a2b4e[_0x2887('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xe7d80){logger['info'](_0x2887('0x13'),_0x1c89f0);logger[_0x2887('0x1b')](_0x2887('0x13'),_0x1c89f0,JSON[_0x2887('0xd')](_0xe7d80));_0x1f85f9(_0xe7d80);})['catch'](function(_0x140db9){logger[_0x2887('0xe')]('GetCmHopper',_0x140db9[_0x2887('0x10')],_0x1c89f0);_0x4a4e3e(_0x26671e[_0x2887('0xe')](0x1f4,_0x140db9[_0x2887('0x10')]));});});};exports['ShowCmHopper']=function(_0x5aa00c){var _0x4738bd=this;return new Promise(function(_0x50848a,_0x530b44){return db[_0x2887('0x14')][_0x2887('0x1c')]({'raw':_0x5aa00c[_0x2887('0x15')]?_0x5aa00c['options'][_0x2887('0x1d')]===undefined?!![]:![]:!![],'where':_0x5aa00c[_0x2887('0x15')]?_0x5aa00c['options'][_0x2887('0x16')]||null:null,'attributes':_0x5aa00c[_0x2887('0x15')]?_0x5aa00c[_0x2887('0x15')][_0x2887('0x17')]||null:null,'include':_0x5aa00c[_0x2887('0x15')]?_0x5aa00c['options'][_0x2887('0x19')]?_['map'](_0x5aa00c[_0x2887('0x15')]['include'],function(_0xb22043){return{'model':db[_0xb22043[_0x2887('0x1a')]],'as':_0xb22043['as'],'attributes':_0xb22043[_0x2887('0x17')],'include':_0xb22043[_0x2887('0x19')]?_[_0x2887('0x18')](_0xb22043['include'],function(_0x543af1){return{'model':db[_0x543af1[_0x2887('0x1a')]],'as':_0x543af1['as'],'attributes':_0x543af1[_0x2887('0x17')],'include':_0x543af1[_0x2887('0x19')]?_['map'](_0x543af1[_0x2887('0x19')],function(_0x3c579e){return{'model':db[_0x3c579e[_0x2887('0x1a')]],'as':_0x3c579e['as'],'attributes':_0x3c579e[_0x2887('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3725b3){logger[_0x2887('0xa')](_0x2887('0x1e'),_0x5aa00c);logger[_0x2887('0x1b')]('ShowCmHopper',_0x5aa00c,JSON['stringify'](_0x3725b3));_0x50848a(_0x3725b3);})[_0x2887('0x12')](function(_0x12c684){logger[_0x2887('0xe')]('ShowCmHopper',_0x12c684['message'],_0x5aa00c);_0x530b44(_0x4738bd[_0x2887('0xe')](0x1f4,_0x12c684[_0x2887('0x10')]));});});};exports[_0x2887('0x1f')]=function(_0x1a38a0){var _0x193e57=this;return new Promise(function(_0x3b584b,_0x14a26f){return db['CmHopper'][_0x2887('0x20')](_0x1a38a0[_0x2887('0x21')],{'raw':_0x1a38a0[_0x2887('0x15')]?_0x1a38a0['options'][_0x2887('0x1d')]===undefined?!![]:![]:!![]})[_0x2887('0x9')](function(_0x455aba){logger[_0x2887('0xa')](_0x2887('0x1f'),_0x1a38a0);logger['debug'](_0x2887('0x1f'),_0x1a38a0,JSON[_0x2887('0xd')](_0x455aba));_0x3b584b(_0x455aba);})['catch'](function(_0x321cd0){logger['error'](_0x2887('0x1f'),_0x321cd0[_0x2887('0x10')],_0x1a38a0);_0x14a26f(_0x193e57[_0x2887('0xe')](0x1f4,_0x321cd0['message']));});});};exports[_0x2887('0x22')]=function(_0x4dd413){var _0x54974c=this;return new Promise(function(_0x4981d3,_0x50ba8a){return db[_0x2887('0x14')][_0x2887('0x23')](_0x4dd413[_0x2887('0x21')],{'raw':_0x4dd413['options']?_0x4dd413[_0x2887('0x15')][_0x2887('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4dd413['options']?_0x4dd413[_0x2887('0x15')]['where']||null:null,'attributes':_0x4dd413[_0x2887('0x15')]?_0x4dd413[_0x2887('0x15')]['attributes']||null:null,'limit':_0x4dd413['options']?_0x4dd413[_0x2887('0x15')][_0x2887('0x24')]||null:null})['then'](function(_0x1c5dc9){logger['info'](_0x2887('0x22'),_0x4dd413);logger[_0x2887('0xa')](_0x2887('0x25'),JSON[_0x2887('0xd')](_0x4dd413[_0x2887('0x15')]['where']),_0x4dd413[_0x2887('0x21')][_0x2887('0x26')]);logger[_0x2887('0x1b')](_0x2887('0x22'),_0x4dd413,JSON[_0x2887('0xd')](_0x1c5dc9));_0x4981d3(_0x1c5dc9);})[_0x2887('0x12')](function(_0x31ece3){logger['error'](_0x2887('0x22'),_0x31ece3[_0x2887('0x10')],_0x4dd413);_0x50ba8a(_0x54974c[_0x2887('0xe')](0x1f4,_0x31ece3[_0x2887('0x10')]));});});};exports[_0x2887('0x27')]=function(_0x4467e8){var _0x4c0c15=this;return new Promise(function(_0x5e2f95,_0x474283){return db['CmHopper']['destroy']({'where':_0x4467e8[_0x2887('0x15')]?_0x4467e8[_0x2887('0x15')][_0x2887('0x16')]||null:null})[_0x2887('0x9')](function(_0x155345){logger[_0x2887('0xa')](_0x2887('0x27'),_0x4467e8);logger['debug']('DestroyCmHopper',_0x4467e8,JSON['stringify'](_0x155345));_0x5e2f95(_0x155345);})[_0x2887('0x12')](function(_0x445d6b){logger['error'](_0x2887('0x27'),_0x445d6b[_0x2887('0x10')],_0x4467e8);_0x474283(_0x4c0c15[_0x2887('0xe')](0x1f4,_0x445d6b[_0x2887('0x10')]));});});};exports[_0x2887('0x28')]=function(_0x15e978){var _0x2e2ca4=this;return new Promise(function(_0x2603bc,_0x373a22){return db[_0x2887('0x29')][_0x2887('0x2a')]()[_0x2887('0x9')](function(_0x1010ea){return db['sequelize'][_0x2887('0x2b')](function(_0x39e6d5){return db[_0x2887('0x14')][_0x2887('0x2c')]({'where':_0x15e978[_0x2887('0x15')]?_0x15e978[_0x2887('0x15')][_0x2887('0x16')]||null:null,'attributes':_0x15e978[_0x2887('0x15')]?_0x15e978['options'][_0x2887('0x17')]||null:null,'limit':_0x15e978[_0x2887('0x15')]?_0x15e978[_0x2887('0x15')][_0x2887('0x24')]||null:null,'order':_0x15e978[_0x2887('0x15')]?_0x15e978['options'][_0x2887('0x2d')]||null:null,'transaction':_0x39e6d5,'lock':_0x39e6d5[_0x2887('0x2e')]['UPDATE'],'include':[{'model':db[_0x2887('0x29')],'as':_0x2887('0x2f'),'attributes':_[_0x2887('0x30')](_0x1010ea)},{'model':db[_0x2887('0x31')],'as':_0x2887('0x32'),'attributes':['id',_0x2887('0x33'),_0x2887('0x34')]}]})['then'](function(_0xf4e6a6){var _0x496c4c=[];var _0x430bcb=[];for(var _0x3e9808=0x0;_0x3e9808<_0xf4e6a6['length'];_0x3e9808+=0x1){var _0x1544b4=_0xf4e6a6[_0x3e9808][_0x2887('0x35')];if(_0x1544b4===null){_0x496c4c['push'](_0xf4e6a6[_0x3e9808][_0x2887('0x23')](_0x15e978[_0x2887('0x21')],{'transaction':_0x39e6d5}));}else if(!_0x430bcb['includes'](_0x1544b4)){_0x430bcb[_0x2887('0x36')](_0x1544b4);_0x496c4c[_0x2887('0x36')](_0xf4e6a6[_0x3e9808]['update'](_0x15e978[_0x2887('0x21')],{'transaction':_0x39e6d5}));}}return BPromise[_0x2887('0x37')](_0x496c4c);});})[_0x2887('0x9')](function(_0x5b68db){logger['info']('GetContactDialer',_0x15e978);if(_0x5b68db['length']>0x0){logger[_0x2887('0xa')](_0x2887('0x38'),_0x5b68db[0x0][_0x2887('0x39')]['id'],_0x5b68db[0x0]['dataValues'][_0x2887('0x3a')],_0x5b68db[0x0][_0x2887('0x39')][_0x2887('0x26')]);}logger['debug'](_0x2887('0x28'),_0x15e978,JSON[_0x2887('0xd')](_0x5b68db));_0x2603bc(_0x5b68db);})[_0x2887('0x12')](function(_0x3a49c7){logger[_0x2887('0xe')]('GetContactDialer',_0x3a49c7[_0x2887('0x10')],_0x15e978);_0x373a22(_0x2e2ca4['error'](0x1f4,_0x3a49c7[_0x2887('0x10')]));});});});};exports['MoveContactManagedDialer']=function(_0xe814c6){var _0x29fcd4=this;return new Promise(function(_0xf597d6,_0x4323ab){return db[_0x2887('0x3b')][_0x2887('0x2b')](function(_0x1aea4f){return db['CmHopperFinal'][_0x2887('0x20')](_0xe814c6[_0x2887('0x21')],{'raw':_0xe814c6[_0x2887('0x15')]?_0xe814c6[_0x2887('0x15')][_0x2887('0x1d')]===undefined?!![]:![]:!![],'transaction':_0x1aea4f})[_0x2887('0x9')](function(){logger[_0x2887('0xa')]('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0x2887('0xd')](_0xe814c6[_0x2887('0x15')]['where']),_0xe814c6['options'][_0x2887('0x16')][_0x2887('0x26')]);return db[_0x2887('0x14')][_0x2887('0x3c')]({'where':_0xe814c6[_0x2887('0x15')]?_0xe814c6[_0x2887('0x15')][_0x2887('0x16')]||null:null,'transaction':_0x1aea4f});});})[_0x2887('0x9')](function(_0x65937b){logger[_0x2887('0xa')](_0x2887('0x3d'),_0xe814c6);logger[_0x2887('0x1b')](_0x2887('0x3d'),_0xe814c6,JSON['stringify'](_0x65937b));_0xf597d6(_0x65937b);})[_0x2887('0x12')](function(_0x2dfa1b){logger[_0x2887('0xe')](_0x2887('0x3d'),_0x2dfa1b[_0x2887('0x10')],_0xe814c6);_0x4323ab(_0x29fcd4['error'](0x1f4,_0x2dfa1b[_0x2887('0x10')]));});});};exports[_0x2887('0x3e')]=function(_0x1dd00e){var _0x3eeefc=this;return new Promise(function(_0x9a49c1,_0x6d5fd9){return db['CmHopper']['findAll']({'raw':_0x1dd00e['options']?_0x1dd00e['options'][_0x2887('0x1d')]===undefined?!![]:![]:!![],'where':_0x1dd00e[_0x2887('0x15')]?_0x1dd00e[_0x2887('0x15')][_0x2887('0x16')]||null:null,'attributes':[[db[_0x2887('0x3b')]['fn'](_0x2887('0x3f'),db[_0x2887('0x3b')]['fn']('IF',db[_0x2887('0x3b')][_0x2887('0x40')](_0x2887('0x41')+util[_0x2887('0x42')](_0x2887('0x43'),moment()['format'](_0x2887('0x44')))+_0x2887('0x45')))),'contactsRescheduled']]})[_0x2887('0x9')](function(_0x5e4588){logger[_0x2887('0xa')](_0x2887('0x3e'),_0x1dd00e);logger['debug']('CountReScheduled',_0x1dd00e,JSON[_0x2887('0xd')](_0x5e4588));_0x9a49c1(_0x5e4588);})[_0x2887('0x12')](function(_0x4836cd){logger[_0x2887('0xe')]('CountReScheduled',_0x4836cd[_0x2887('0x10')],_0x1dd00e);_0x6d5fd9(_0x3eeefc['error'](0x1f4,_0x4836cd['message']));});});};exports[_0x2887('0x46')]=function(_0x37a7b8){var _0x5abb15=this;return new Promise(function(_0x3cdcd9,_0x535059){return db[_0x2887('0x29')][_0x2887('0x2a')]()[_0x2887('0x9')](function(_0x13c170){return db[_0x2887('0x3b')][_0x2887('0x2b')](function(_0xe26b99){return db['CmHopper'][_0x2887('0x2c')]({'where':_0x37a7b8['options']?_0x37a7b8['options'][_0x2887('0x16')]||null:null,'attributes':_0x37a7b8['options']?_0x37a7b8[_0x2887('0x15')][_0x2887('0x17')]||null:null,'limit':0x1,'order':_0x37a7b8[_0x2887('0x15')]?_0x37a7b8[_0x2887('0x15')]['order']||null:null,'group':db[_0x2887('0x14')][_0x2887('0x35')],'transaction':_0xe26b99,'lock':_0xe26b99[_0x2887('0x2e')]['UPDATE'],'include':_0x37a7b8[_0x2887('0x15')]?_0x37a7b8[_0x2887('0x15')][_0x2887('0x19')]?_[_0x2887('0x18')](_0x37a7b8[_0x2887('0x15')][_0x2887('0x19')],function(_0x1d347f){return{'model':db[_0x1d347f['model']],'as':_0x1d347f['as'],'attributes':_0x1d347f[_0x2887('0x17')],'include':_0x1d347f[_0x2887('0x19')]?_[_0x2887('0x18')](_0x1d347f[_0x2887('0x19')],function(_0x30ea6e){return{'model':db[_0x30ea6e[_0x2887('0x1a')]],'as':_0x30ea6e['as'],'attributes':_0x30ea6e[_0x2887('0x17')],'include':_0x30ea6e[_0x2887('0x19')]?_[_0x2887('0x18')](_0x30ea6e[_0x2887('0x19')],function(_0x3743b6){return{'model':db[_0x3743b6[_0x2887('0x1a')]],'as':_0x3743b6['as'],'attributes':_0x3743b6[_0x2887('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x540991){var _0x3f0209=[];for(var _0x218780=0x0;_0x218780<_0x540991[_0x2887('0x47')];_0x218780+=0x1){_0x3f0209[_0x2887('0x36')](_0x540991[_0x218780][_0x2887('0x23')](_0x37a7b8[_0x2887('0x21')],{'transaction':_0xe26b99}));}return BPromise[_0x2887('0x37')](_0x3f0209);});})[_0x2887('0x9')](function(_0x158e6c){logger[_0x2887('0xa')](_0x2887('0x46'),_0x37a7b8);logger[_0x2887('0x1b')]('GetContactRecallMe',_0x37a7b8,JSON[_0x2887('0xd')](_0x158e6c));_0x3cdcd9(_0x158e6c);})[_0x2887('0x12')](function(_0x384557){logger[_0x2887('0xe')]('GetContactRecallMe',_0x384557[_0x2887('0x10')],_0x37a7b8);_0x535059(_0x5abb15[_0x2887('0xe')](0x1f4,_0x384557[_0x2887('0x10')]));});});});};exports['GetCmHopperPreview']=function(_0x45d960){var _0x4afb90=this;return new Promise(function(_0xe9cc9a,_0x15f004){db['CmContact']['describe']()[_0x2887('0x9')](function(_0x52cab2){return db[_0x2887('0x14')][_0x2887('0x2c')]({'raw':_0x45d960[_0x2887('0x15')]?_0x45d960['options'][_0x2887('0x1d')]===undefined?!![]:![]:!![],'where':_0x45d960[_0x2887('0x15')]?_0x45d960['options']['where']||null:null,'attributes':_0x45d960['options']?_0x45d960[_0x2887('0x15')][_0x2887('0x17')]||null:null,'limit':_0x45d960[_0x2887('0x15')]?_0x45d960['options'][_0x2887('0x24')]||null:null,'include':_0x45d960[_0x2887('0x15')]?_0x45d960[_0x2887('0x15')][_0x2887('0x19')]?_['map'](_0x45d960[_0x2887('0x15')]['include'],function(_0x3beb34){return{'model':db[_0x3beb34['model']],'as':_0x3beb34['as'],'attributes':_0x3beb34['as']===_0x2887('0x2f')?_['keys'](_0x52cab2):_0x3beb34[_0x2887('0x17')],'include':_0x3beb34[_0x2887('0x19')]?_['map'](_0x3beb34['include'],function(_0x1f75bc){return{'model':db[_0x1f75bc[_0x2887('0x1a')]],'as':_0x1f75bc['as'],'attributes':_0x1f75bc[_0x2887('0x17')],'include':_0x1f75bc[_0x2887('0x19')]?_[_0x2887('0x18')](_0x1f75bc[_0x2887('0x19')],function(_0x7dab0){return{'model':db[_0x7dab0['model']],'as':_0x7dab0['as'],'attributes':_0x7dab0['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x247df5){logger[_0x2887('0xa')](_0x2887('0x13'),_0x45d960);logger[_0x2887('0x1b')](_0x2887('0x13'),_0x45d960,JSON[_0x2887('0xd')](_0x247df5));_0xe9cc9a(_0x247df5);})[_0x2887('0x12')](function(_0x1bec51){logger[_0x2887('0xe')](_0x2887('0x13'),_0x1bec51[_0x2887('0x10')],_0x45d960);_0x15f004(_0x4afb90[_0x2887('0xe')](0x1f4,_0x1bec51[_0x2887('0x10')]));});});});};exports['ResetActiveCalls']=function(_0x1291ce){var _0x17fe8c=this;return new Promise(function(_0x26e350,_0x8dcaba){return db[_0x2887('0x3b')]['transaction'](function(_0x4d8c90){return db[_0x2887('0x14')][_0x2887('0x23')]({'active':![]},{'where':{},'transaction':_0x4d8c90})[_0x2887('0x9')](function(_0x27f239){logger[_0x2887('0xa')]('ResetActiveCalls',_0x1291ce);logger['debug'](_0x2887('0x48'),_0x1291ce,JSON[_0x2887('0xd')](_0x27f239));_0x26e350(_0x27f239);})[_0x2887('0x12')](function(_0x560101){logger[_0x2887('0xe')](_0x2887('0x48'),_0x560101[_0x2887('0x10')],_0x1291ce);_0x8dcaba(_0x17fe8c[_0x2887('0xe')](0x1f4,_0x560101[_0x2887('0x10')]));});});});}; \ No newline at end of file +var _0x1471=['../../config/environment','client','http','request','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','limit','include','map','then','stringify','find','model','ShowCmHopper','CreateCmHopper','create','body','update','UpdateCmHopper','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','transaction','LOCK','UPDATE','Contact','keys','User','Agent','name','voicePause','length','UserId','includes','push','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','active','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','MoveContactManagedDialer','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','order','GetCmHopperPreview','ResetActiveCalls','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x541b80,_0x4717d1){var _0x339d0=function(_0x2fe210){while(--_0x2fe210){_0x541b80['push'](_0x541b80['shift']());}};_0x339d0(++_0x4717d1);}(_0x1471,0x13f));var _0x1147=function(_0x2bdc88,_0x4ce1c9){_0x2bdc88=_0x2bdc88-0x0;var _0x631da0=_0x1471[_0x2bdc88];return _0x631da0;};'use strict';var _=require(_0x1147('0x0'));var util=require(_0x1147('0x1'));var moment=require(_0x1147('0x2'));var BPromise=require(_0x1147('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1147('0x4'));var db=require(_0x1147('0x5'))['db'];var utils=require(_0x1147('0x6'));var logger=require(_0x1147('0x7'))(_0x1147('0x8'));var config=require(_0x1147('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1147('0xa')][_0x1147('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x22a2f3,_0x10ff0b,_0x11c344){return new BPromise(function(_0x43902f,_0x19941e){return client[_0x1147('0xc')](_0x22a2f3,_0x11c344)['then'](function(_0x4ba5ab){logger[_0x1147('0xd')](_0x1147('0xe'),_0x10ff0b,_0x1147('0xf'));logger[_0x1147('0x10')](_0x1147('0x11'),_0x10ff0b,_0x1147('0xf'),JSON['stringify'](_0x4ba5ab));if(_0x4ba5ab[_0x1147('0x12')]){if(_0x4ba5ab[_0x1147('0x12')][_0x1147('0x13')]===0x1f4){logger[_0x1147('0x12')](_0x1147('0xe'),_0x10ff0b,_0x4ba5ab[_0x1147('0x12')][_0x1147('0x14')]);return _0x19941e(_0x4ba5ab[_0x1147('0x12')][_0x1147('0x14')]);}logger[_0x1147('0x12')]('CmHopper,\x20%s,\x20%s',_0x10ff0b,_0x4ba5ab[_0x1147('0x12')]['message']);return _0x43902f(_0x4ba5ab[_0x1147('0x12')][_0x1147('0x14')]);}else{logger[_0x1147('0xd')](_0x1147('0xe'),_0x10ff0b,_0x1147('0xf'));_0x43902f(_0x4ba5ab[_0x1147('0x15')]['message']);}})[_0x1147('0x16')](function(_0x4d0851){logger[_0x1147('0x12')](_0x1147('0xe'),_0x10ff0b,_0x4d0851);_0x19941e(_0x4d0851);});});}exports[_0x1147('0x17')]=function(_0x1d4171){var _0xc7c888=this;return new Promise(function(_0x1aa392,_0x4680a1){return db[_0x1147('0x18')][_0x1147('0x19')]({'raw':_0x1d4171[_0x1147('0x1a')]?_0x1d4171[_0x1147('0x1a')][_0x1147('0x1b')]===undefined?!![]:![]:!![],'where':_0x1d4171[_0x1147('0x1a')]?_0x1d4171[_0x1147('0x1a')][_0x1147('0x1c')]||null:null,'attributes':_0x1d4171[_0x1147('0x1a')]?_0x1d4171[_0x1147('0x1a')][_0x1147('0x1d')]||null:null,'limit':_0x1d4171['options']?_0x1d4171[_0x1147('0x1a')][_0x1147('0x1e')]||null:null,'include':_0x1d4171[_0x1147('0x1a')]?_0x1d4171[_0x1147('0x1a')][_0x1147('0x1f')]?_[_0x1147('0x20')](_0x1d4171['options'][_0x1147('0x1f')],function(_0x36d472){return{'model':db[_0x36d472['model']],'as':_0x36d472['as'],'attributes':_0x36d472['attributes'],'include':_0x36d472['include']?_[_0x1147('0x20')](_0x36d472['include'],function(_0x5e165a){return{'model':db[_0x5e165a['model']],'as':_0x5e165a['as'],'attributes':_0x5e165a[_0x1147('0x1d')],'include':_0x5e165a['include']?_[_0x1147('0x20')](_0x5e165a[_0x1147('0x1f')],function(_0x58a19d){return{'model':db[_0x58a19d['model']],'as':_0x58a19d['as'],'attributes':_0x58a19d[_0x1147('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1147('0x21')](function(_0xaafc2c){logger[_0x1147('0xd')](_0x1147('0x17'),_0x1d4171);logger[_0x1147('0x10')]('GetCmHopper',_0x1d4171,JSON[_0x1147('0x22')](_0xaafc2c));_0x1aa392(_0xaafc2c);})[_0x1147('0x16')](function(_0x4b9a05){logger[_0x1147('0x12')](_0x1147('0x17'),_0x4b9a05[_0x1147('0x14')],_0x1d4171);_0x4680a1(_0xc7c888[_0x1147('0x12')](0x1f4,_0x4b9a05['message']));});});};exports['ShowCmHopper']=function(_0x186fc5){var _0x362127=this;return new Promise(function(_0x469bbf,_0x484cd4){return db[_0x1147('0x18')][_0x1147('0x23')]({'raw':_0x186fc5['options']?_0x186fc5[_0x1147('0x1a')][_0x1147('0x1b')]===undefined?!![]:![]:!![],'where':_0x186fc5['options']?_0x186fc5[_0x1147('0x1a')][_0x1147('0x1c')]||null:null,'attributes':_0x186fc5[_0x1147('0x1a')]?_0x186fc5[_0x1147('0x1a')]['attributes']||null:null,'include':_0x186fc5[_0x1147('0x1a')]?_0x186fc5[_0x1147('0x1a')][_0x1147('0x1f')]?_[_0x1147('0x20')](_0x186fc5[_0x1147('0x1a')][_0x1147('0x1f')],function(_0x4177c1){return{'model':db[_0x4177c1[_0x1147('0x24')]],'as':_0x4177c1['as'],'attributes':_0x4177c1[_0x1147('0x1d')],'include':_0x4177c1[_0x1147('0x1f')]?_[_0x1147('0x20')](_0x4177c1[_0x1147('0x1f')],function(_0x3d088f){return{'model':db[_0x3d088f[_0x1147('0x24')]],'as':_0x3d088f['as'],'attributes':_0x3d088f[_0x1147('0x1d')],'include':_0x3d088f[_0x1147('0x1f')]?_[_0x1147('0x20')](_0x3d088f[_0x1147('0x1f')],function(_0x5ca610){return{'model':db[_0x5ca610[_0x1147('0x24')]],'as':_0x5ca610['as'],'attributes':_0x5ca610[_0x1147('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1147('0x21')](function(_0x142a93){logger['info'](_0x1147('0x25'),_0x186fc5);logger[_0x1147('0x10')](_0x1147('0x25'),_0x186fc5,JSON['stringify'](_0x142a93));_0x469bbf(_0x142a93);})[_0x1147('0x16')](function(_0x2f3977){logger[_0x1147('0x12')]('ShowCmHopper',_0x2f3977[_0x1147('0x14')],_0x186fc5);_0x484cd4(_0x362127[_0x1147('0x12')](0x1f4,_0x2f3977['message']));});});};exports[_0x1147('0x26')]=function(_0x13b732){var _0x5b5138=this;return new Promise(function(_0x3957a6,_0x47d93b){return db[_0x1147('0x18')][_0x1147('0x27')](_0x13b732[_0x1147('0x28')],{'raw':_0x13b732[_0x1147('0x1a')]?_0x13b732[_0x1147('0x1a')][_0x1147('0x1b')]===undefined?!![]:![]:!![]})[_0x1147('0x21')](function(_0x20e15e){logger[_0x1147('0xd')]('CreateCmHopper',_0x13b732);logger[_0x1147('0x10')](_0x1147('0x26'),_0x13b732,JSON[_0x1147('0x22')](_0x20e15e));_0x3957a6(_0x20e15e);})[_0x1147('0x16')](function(_0x575049){logger[_0x1147('0x12')](_0x1147('0x26'),_0x575049[_0x1147('0x14')],_0x13b732);_0x47d93b(_0x5b5138[_0x1147('0x12')](0x1f4,_0x575049[_0x1147('0x14')]));});});};exports['UpdateCmHopper']=function(_0x5d7ccb){var _0x5e0be4=this;return new Promise(function(_0x229530,_0x1562ef){return db['CmHopper'][_0x1147('0x29')](_0x5d7ccb[_0x1147('0x28')],{'raw':_0x5d7ccb['options']?_0x5d7ccb[_0x1147('0x1a')][_0x1147('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d7ccb[_0x1147('0x1a')]?_0x5d7ccb[_0x1147('0x1a')][_0x1147('0x1c')]||null:null,'attributes':_0x5d7ccb[_0x1147('0x1a')]?_0x5d7ccb['options'][_0x1147('0x1d')]||null:null,'limit':_0x5d7ccb[_0x1147('0x1a')]?_0x5d7ccb[_0x1147('0x1a')][_0x1147('0x1e')]||null:null})['then'](function(_0x53bc0b){logger['info'](_0x1147('0x2a'),_0x5d7ccb);logger['info']('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0x1147('0x22')](_0x5d7ccb['options'][_0x1147('0x1c')]),_0x5d7ccb['body']['active']);logger[_0x1147('0x10')](_0x1147('0x2a'),_0x5d7ccb,JSON[_0x1147('0x22')](_0x53bc0b));_0x229530(_0x53bc0b);})[_0x1147('0x16')](function(_0x6364c8){logger[_0x1147('0x12')](_0x1147('0x2a'),_0x6364c8[_0x1147('0x14')],_0x5d7ccb);_0x1562ef(_0x5e0be4[_0x1147('0x12')](0x1f4,_0x6364c8[_0x1147('0x14')]));});});};exports[_0x1147('0x2b')]=function(_0x44bb98){var _0x1db377=this;return new Promise(function(_0x2cd220,_0x578d8d){return db[_0x1147('0x18')][_0x1147('0x2c')]({'where':_0x44bb98[_0x1147('0x1a')]?_0x44bb98[_0x1147('0x1a')]['where']||null:null})[_0x1147('0x21')](function(_0x4e2fd7){logger[_0x1147('0xd')](_0x1147('0x2b'),_0x44bb98);logger[_0x1147('0x10')](_0x1147('0x2b'),_0x44bb98,JSON[_0x1147('0x22')](_0x4e2fd7));_0x2cd220(_0x4e2fd7);})[_0x1147('0x16')](function(_0x1d5bcd){logger[_0x1147('0x12')](_0x1147('0x2b'),_0x1d5bcd[_0x1147('0x14')],_0x44bb98);_0x578d8d(_0x1db377[_0x1147('0x12')](0x1f4,_0x1d5bcd['message']));});});};exports[_0x1147('0x2d')]=function(_0xabd3e5){var _0xa185a9=this;return new Promise(function(_0x2951ba,_0x4963af){return db[_0x1147('0x2e')][_0x1147('0x2f')]()[_0x1147('0x21')](function(_0x2947de){return db[_0x1147('0x30')][_0x1147('0x31')](function(_0x5cab40){return db['CmHopper'][_0x1147('0x19')]({'where':_0xabd3e5[_0x1147('0x1a')]?_0xabd3e5[_0x1147('0x1a')][_0x1147('0x1c')]||null:null,'attributes':_0xabd3e5[_0x1147('0x1a')]?_0xabd3e5['options'][_0x1147('0x1d')]||null:null,'limit':_0xabd3e5['options']?_0xabd3e5[_0x1147('0x1a')]['limit']||null:null,'order':_0xabd3e5[_0x1147('0x1a')]?_0xabd3e5['options']['order']||null:null,'transaction':_0x5cab40,'lock':_0x5cab40[_0x1147('0x32')][_0x1147('0x33')],'include':[{'model':db['CmContact'],'as':_0x1147('0x34'),'attributes':_[_0x1147('0x35')](_0x2947de)},{'model':db[_0x1147('0x36')],'as':_0x1147('0x37'),'attributes':['id',_0x1147('0x38'),_0x1147('0x39')]}]})[_0x1147('0x21')](function(_0x2cca79){var _0x5911bb=[];var _0x3c33c8=[];for(var _0x4e4388=0x0;_0x4e4388<_0x2cca79[_0x1147('0x3a')];_0x4e4388+=0x1){var _0x329ea8=_0x2cca79[_0x4e4388][_0x1147('0x3b')];if(_0x329ea8===null){_0x5911bb['push'](_0x2cca79[_0x4e4388][_0x1147('0x29')](_0xabd3e5[_0x1147('0x28')],{'transaction':_0x5cab40}));}else if(!_0x3c33c8[_0x1147('0x3c')](_0x329ea8)){_0x3c33c8[_0x1147('0x3d')](_0x329ea8);_0x5911bb[_0x1147('0x3d')](_0x2cca79[_0x4e4388][_0x1147('0x29')](_0xabd3e5[_0x1147('0x28')],{'transaction':_0x5cab40}));}}return BPromise['all'](_0x5911bb);});})[_0x1147('0x21')](function(_0x59c51b){logger[_0x1147('0xd')](_0x1147('0x2d'),_0xabd3e5);if(_0x59c51b[_0x1147('0x3a')]>0x0){logger[_0x1147('0xd')](_0x1147('0x3e'),_0x59c51b[0x0][_0x1147('0x3f')]['id'],_0x59c51b[0x0]['dataValues'][_0x1147('0x40')],_0x59c51b[0x0][_0x1147('0x3f')][_0x1147('0x41')]);}logger['debug'](_0x1147('0x2d'),_0xabd3e5,JSON[_0x1147('0x22')](_0x59c51b));_0x2951ba(_0x59c51b);})[_0x1147('0x16')](function(_0x321861){logger[_0x1147('0x12')](_0x1147('0x2d'),_0x321861['message'],_0xabd3e5);_0x4963af(_0xa185a9[_0x1147('0x12')](0x1f4,_0x321861[_0x1147('0x14')]));});});});};exports['MoveContactManagedDialer']=function(_0x46825e){var _0x2f1a22=this;return new Promise(function(_0x2794cf,_0x2b0da3){return db['sequelize'][_0x1147('0x31')](function(_0x4bd1e8){return db[_0x1147('0x42')][_0x1147('0x27')](_0x46825e[_0x1147('0x28')],{'raw':_0x46825e[_0x1147('0x1a')]?_0x46825e['options'][_0x1147('0x1b')]===undefined?!![]:![]:!![],'transaction':_0x4bd1e8})['then'](function(){logger[_0x1147('0xd')](_0x1147('0x43'),JSON['stringify'](_0x46825e[_0x1147('0x1a')][_0x1147('0x1c')]),_0x46825e[_0x1147('0x1a')]['where']['active']);return db[_0x1147('0x18')][_0x1147('0x2c')]({'where':_0x46825e[_0x1147('0x1a')]?_0x46825e['options'][_0x1147('0x1c')]||null:null,'transaction':_0x4bd1e8});});})['then'](function(_0x1c21e1){logger['info'](_0x1147('0x44'),_0x46825e);logger[_0x1147('0x10')](_0x1147('0x44'),_0x46825e,JSON[_0x1147('0x22')](_0x1c21e1));_0x2794cf(_0x1c21e1);})[_0x1147('0x16')](function(_0x4a6065){logger['error'](_0x1147('0x44'),_0x4a6065[_0x1147('0x14')],_0x46825e);_0x2b0da3(_0x2f1a22['error'](0x1f4,_0x4a6065[_0x1147('0x14')]));});});};exports[_0x1147('0x45')]=function(_0x45998e){var _0x28613f=this;return new Promise(function(_0xc08b3d,_0x1d547b){return db[_0x1147('0x18')][_0x1147('0x19')]({'raw':_0x45998e['options']?_0x45998e['options'][_0x1147('0x1b')]===undefined?!![]:![]:!![],'where':_0x45998e['options']?_0x45998e['options'][_0x1147('0x1c')]||null:null,'attributes':[[db[_0x1147('0x30')]['fn'](_0x1147('0x46'),db[_0x1147('0x30')]['fn']('IF',db[_0x1147('0x30')][_0x1147('0x47')](_0x1147('0x48')+util[_0x1147('0x49')](_0x1147('0x4a'),moment()[_0x1147('0x49')](_0x1147('0x4b')))+_0x1147('0x4c')))),_0x1147('0x4d')]]})[_0x1147('0x21')](function(_0x592c2b){logger['info'](_0x1147('0x45'),_0x45998e);logger[_0x1147('0x10')](_0x1147('0x45'),_0x45998e,JSON[_0x1147('0x22')](_0x592c2b));_0xc08b3d(_0x592c2b);})['catch'](function(_0x3e49ab){logger[_0x1147('0x12')](_0x1147('0x45'),_0x3e49ab['message'],_0x45998e);_0x1d547b(_0x28613f[_0x1147('0x12')](0x1f4,_0x3e49ab[_0x1147('0x14')]));});});};exports[_0x1147('0x4e')]=function(_0x17853f){var _0x5f59ca=this;return new Promise(function(_0x489584,_0x199e64){return db[_0x1147('0x2e')]['describe']()[_0x1147('0x21')](function(_0x4363f4){return db[_0x1147('0x30')]['transaction'](function(_0x1ca25c){return db['CmHopper'][_0x1147('0x19')]({'where':_0x17853f[_0x1147('0x1a')]?_0x17853f[_0x1147('0x1a')][_0x1147('0x1c')]||null:null,'attributes':_0x17853f['options']?_0x17853f['options']['attributes']||null:null,'limit':0x1,'order':_0x17853f[_0x1147('0x1a')]?_0x17853f[_0x1147('0x1a')][_0x1147('0x4f')]||null:null,'group':db[_0x1147('0x18')][_0x1147('0x3b')],'transaction':_0x1ca25c,'lock':_0x1ca25c[_0x1147('0x32')][_0x1147('0x33')],'include':_0x17853f[_0x1147('0x1a')]?_0x17853f[_0x1147('0x1a')]['include']?_[_0x1147('0x20')](_0x17853f[_0x1147('0x1a')][_0x1147('0x1f')],function(_0x407a63){return{'model':db[_0x407a63[_0x1147('0x24')]],'as':_0x407a63['as'],'attributes':_0x407a63['attributes'],'include':_0x407a63['include']?_['map'](_0x407a63[_0x1147('0x1f')],function(_0xd5d24d){return{'model':db[_0xd5d24d[_0x1147('0x24')]],'as':_0xd5d24d['as'],'attributes':_0xd5d24d[_0x1147('0x1d')],'include':_0xd5d24d[_0x1147('0x1f')]?_[_0x1147('0x20')](_0xd5d24d[_0x1147('0x1f')],function(_0x3b2597){return{'model':db[_0x3b2597[_0x1147('0x24')]],'as':_0x3b2597['as'],'attributes':_0x3b2597[_0x1147('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1147('0x21')](function(_0x487faa){var _0x505e81=[];for(var _0x3695e5=0x0;_0x3695e5<_0x487faa[_0x1147('0x3a')];_0x3695e5+=0x1){_0x505e81[_0x1147('0x3d')](_0x487faa[_0x3695e5][_0x1147('0x29')](_0x17853f['body'],{'transaction':_0x1ca25c}));}return BPromise['all'](_0x505e81);});})['then'](function(_0x131c71){logger[_0x1147('0xd')]('GetContactRecallMe',_0x17853f);logger['debug'](_0x1147('0x4e'),_0x17853f,JSON[_0x1147('0x22')](_0x131c71));_0x489584(_0x131c71);})[_0x1147('0x16')](function(_0x32cea2){logger[_0x1147('0x12')](_0x1147('0x4e'),_0x32cea2[_0x1147('0x14')],_0x17853f);_0x199e64(_0x5f59ca[_0x1147('0x12')](0x1f4,_0x32cea2[_0x1147('0x14')]));});});});};exports[_0x1147('0x50')]=function(_0x1962d0){var _0x151af6=this;return new Promise(function(_0x4561a5,_0xa37bb4){db['CmContact'][_0x1147('0x2f')]()[_0x1147('0x21')](function(_0x5421f1){return db[_0x1147('0x18')][_0x1147('0x19')]({'raw':_0x1962d0[_0x1147('0x1a')]?_0x1962d0[_0x1147('0x1a')][_0x1147('0x1b')]===undefined?!![]:![]:!![],'where':_0x1962d0[_0x1147('0x1a')]?_0x1962d0['options'][_0x1147('0x1c')]||null:null,'attributes':_0x1962d0[_0x1147('0x1a')]?_0x1962d0['options'][_0x1147('0x1d')]||null:null,'limit':_0x1962d0[_0x1147('0x1a')]?_0x1962d0[_0x1147('0x1a')][_0x1147('0x1e')]||null:null,'include':_0x1962d0[_0x1147('0x1a')]?_0x1962d0[_0x1147('0x1a')][_0x1147('0x1f')]?_[_0x1147('0x20')](_0x1962d0[_0x1147('0x1a')][_0x1147('0x1f')],function(_0x4fba32){return{'model':db[_0x4fba32[_0x1147('0x24')]],'as':_0x4fba32['as'],'attributes':_0x4fba32['as']===_0x1147('0x34')?_[_0x1147('0x35')](_0x5421f1):_0x4fba32['attributes'],'include':_0x4fba32[_0x1147('0x1f')]?_[_0x1147('0x20')](_0x4fba32['include'],function(_0x42e492){return{'model':db[_0x42e492['model']],'as':_0x42e492['as'],'attributes':_0x42e492[_0x1147('0x1d')],'include':_0x42e492[_0x1147('0x1f')]?_[_0x1147('0x20')](_0x42e492[_0x1147('0x1f')],function(_0x2a0cd8){return{'model':db[_0x2a0cd8[_0x1147('0x24')]],'as':_0x2a0cd8['as'],'attributes':_0x2a0cd8[_0x1147('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1147('0x21')](function(_0x10c372){logger[_0x1147('0xd')]('GetCmHopper',_0x1962d0);logger[_0x1147('0x10')](_0x1147('0x17'),_0x1962d0,JSON[_0x1147('0x22')](_0x10c372));_0x4561a5(_0x10c372);})['catch'](function(_0xf1f1db){logger['error'](_0x1147('0x17'),_0xf1f1db[_0x1147('0x14')],_0x1962d0);_0xa37bb4(_0x151af6[_0x1147('0x12')](0x1f4,_0xf1f1db[_0x1147('0x14')]));});});});};exports[_0x1147('0x51')]=function(_0x501391){var _0x1db2b3=this;return new Promise(function(_0x514e29,_0x21d03b){return db[_0x1147('0x30')][_0x1147('0x31')](function(_0x1f52de){return db[_0x1147('0x18')][_0x1147('0x29')]({'active':![]},{'where':{},'transaction':_0x1f52de})[_0x1147('0x21')](function(_0x53abf3){logger[_0x1147('0xd')](_0x1147('0x51'),_0x501391);logger[_0x1147('0x10')](_0x1147('0x51'),_0x501391,JSON[_0x1147('0x22')](_0x53abf3));_0x514e29(_0x53abf3);})[_0x1147('0x16')](function(_0x224c56){logger[_0x1147('0x12')](_0x1147('0x51'),_0x224c56[_0x1147('0x14')],_0x501391);_0x21d03b(_0x1db2b3[_0x1147('0x12')](0x1f4,_0x224c56[_0x1147('0x14')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 94dc998..9eff6d3 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 _0x4732=['multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./cmHopper.controller','index','get','/describe','isAuthenticated','describe','/opencontacts','getOpenContacts','/:id','post','create','/preview','put','update','delete','exports'];(function(_0x35d045,_0x4b71bc){var _0x4b8943=function(_0x31a890){while(--_0x31a890){_0x35d045['push'](_0x35d045['shift']());}};_0x4b8943(++_0x4b71bc);}(_0x4732,0xa8));var _0x2473=function(_0x3dfa3e,_0x293558){_0x3dfa3e=_0x3dfa3e-0x0;var _0x3ff9ed=_0x4732[_0x3dfa3e];return _0x3ff9ed;};'use strict';var multer=require(_0x2473('0x0'));var util=require(_0x2473('0x1'));var path=require(_0x2473('0x2'));var timeout=require(_0x2473('0x3'));var express=require(_0x2473('0x4'));var router=express[_0x2473('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2473('0x6'));var config=require(_0x2473('0x7'));var controller=require(_0x2473('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x2473('0x9')]);router[_0x2473('0xa')](_0x2473('0xb'),auth[_0x2473('0xc')](),controller[_0x2473('0xd')]);router[_0x2473('0xa')](_0x2473('0xe'),auth[_0x2473('0xc')](),controller[_0x2473('0xf')]);router[_0x2473('0xa')](_0x2473('0x10'),auth['isAuthenticated'](),controller['show']);router[_0x2473('0x11')]('/',auth['isAuthenticated'](),controller[_0x2473('0x12')]);router[_0x2473('0x11')](_0x2473('0x13'),auth[_0x2473('0xc')](),controller['getPreview']);router[_0x2473('0x14')](_0x2473('0x10'),auth[_0x2473('0xc')](),controller[_0x2473('0x15')]);router[_0x2473('0x16')](_0x2473('0x10'),auth[_0x2473('0xc')](),controller['destroy']);module[_0x2473('0x17')]=router; \ No newline at end of file +var _0x23b2=['getOpenContacts','post','create','/preview','put','/:id','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','./cmHopper.controller','get','isAuthenticated','index','/describe','describe','/opencontacts'];(function(_0x21c9fa,_0x3877c1){var _0xd2aa9a=function(_0x276efe){while(--_0x276efe){_0x21c9fa['push'](_0x21c9fa['shift']());}};_0xd2aa9a(++_0x3877c1);}(_0x23b2,0x1d6));var _0x223b=function(_0x530bb1,_0xfadb4){_0x530bb1=_0x530bb1-0x0;var _0x6999d5=_0x23b2[_0x530bb1];return _0x6999d5;};'use strict';var multer=require(_0x223b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x223b('0x1'));var express=require(_0x223b('0x2'));var router=express[_0x223b('0x3')]();var fs_extra=require(_0x223b('0x4'));var auth=require(_0x223b('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x223b('0x6'));router[_0x223b('0x7')]('/',auth[_0x223b('0x8')](),controller[_0x223b('0x9')]);router['get'](_0x223b('0xa'),auth[_0x223b('0x8')](),controller[_0x223b('0xb')]);router[_0x223b('0x7')](_0x223b('0xc'),auth[_0x223b('0x8')](),controller[_0x223b('0xd')]);router[_0x223b('0x7')]('/:id',auth[_0x223b('0x8')](),controller['show']);router[_0x223b('0xe')]('/',auth[_0x223b('0x8')](),controller[_0x223b('0xf')]);router[_0x223b('0xe')](_0x223b('0x10'),auth[_0x223b('0x8')](),controller['getPreview']);router[_0x223b('0x11')](_0x223b('0x12'),auth[_0x223b('0x8')](),controller[_0x223b('0x13')]);router[_0x223b('0x14')](_0x223b('0x12'),auth[_0x223b('0x8')](),controller[_0x223b('0x15')]);module[_0x223b('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index e7b19ab..f55cd2a 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 _0x81d4=['exports','INTEGER','contactListQueue','sequelize'];(function(_0x5cb508,_0x2cb3bd){var _0x44d4f5=function(_0x51502f){while(--_0x51502f){_0x5cb508['push'](_0x5cb508['shift']());}};_0x44d4f5(++_0x2cb3bd);}(_0x81d4,0x197));var _0x481d=function(_0x3863ce,_0x243549){_0x3863ce=_0x3863ce-0x0;var _0xc4c829=_0x81d4[_0x3863ce];return _0xc4c829;};'use strict';var moment=require('moment');var Sequelize=require(_0x481d('0x0'));module[_0x481d('0x1')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x481d('0x2')],'unique':_0x481d('0x3')},'ListId':{'type':Sequelize[_0x481d('0x2')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x481d('0x3')}}; \ No newline at end of file +var _0x7556=['INTEGER','contactListQueue','STRING'];(function(_0x20643c,_0x143832){var _0x3a43f1=function(_0x4ba4ab){while(--_0x4ba4ab){_0x20643c['push'](_0x20643c['shift']());}};_0x3a43f1(++_0x143832);}(_0x7556,0x188));var _0x6755=function(_0x57dfc3,_0x10b9ba){_0x57dfc3=_0x57dfc3-0x0;var _0x329aad=_0x7556[_0x57dfc3];return _0x329aad;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'phone':{'type':Sequelize[_0x6755('0x0')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x6755('0x1')],'unique':_0x6755('0x2')},'ListId':{'type':Sequelize[_0x6755('0x1')],'unique':_0x6755('0x2')},'VoiceQueueId':{'type':Sequelize[_0x6755('0x1')],'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 d3df147..f153230 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 _0xf6b1=['includeAll','include','findAll','catch','show','params','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','Content-Range','json','apply','reject','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','CmHopperBlack','count'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xf6b1,0xa1));var _0x1f6b=function(_0x12c128,_0xf602f){_0x12c128=_0x12c128-0x0;var _0xbecf13=_0xf6b1[_0x12c128];return _0xbecf13;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1f6b('0x0'));var zipdir=require(_0x1f6b('0x1'));var jsonpatch=require(_0x1f6b('0x2'));var rp=require(_0x1f6b('0x3'));var moment=require(_0x1f6b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1f6b('0x5'));var util=require(_0x1f6b('0x6'));var path=require(_0x1f6b('0x7'));var sox=require(_0x1f6b('0x8'));var csv=require('to-csv');var ejs=require(_0x1f6b('0x9'));var fs=require('fs');var fs_extra=require(_0x1f6b('0xa'));var _=require(_0x1f6b('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1f6b('0xc'));var deskjs=require(_0x1f6b('0xd'));var toCsv=require(_0x1f6b('0xe'));var querystring=require('querystring');var Papa=require(_0x1f6b('0xf'));var Redis=require(_0x1f6b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x1f6b('0x11'));var as=require(_0x1f6b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1f6b('0x13'))(_0x1f6b('0x14'));var utils=require(_0x1f6b('0x15'));var config=require(_0x1f6b('0x16'));var licenseUtil=require(_0x1f6b('0x17'));var db=require(_0x1f6b('0x18'))['db'];function respondWithStatusCode(_0x17e6a0,_0x4eec3c){_0x4eec3c=_0x4eec3c||0xcc;return function(_0x4e7fbd){if(_0x4e7fbd){return _0x17e6a0[_0x1f6b('0x19')](_0x4eec3c);}return _0x17e6a0[_0x1f6b('0x1a')](_0x4eec3c)[_0x1f6b('0x1b')]();};}function respondWithResult(_0x28cf8e,_0x599cd1){_0x599cd1=_0x599cd1||0xc8;return function(_0x3415ef){if(_0x3415ef){return _0x28cf8e['status'](_0x599cd1)['json'](_0x3415ef);}};}function respondWithFilteredResult(_0x283233,_0x468815){return function(_0xfda1ca){if(_0xfda1ca){var _0x3035c8=typeof _0x468815[_0x1f6b('0x1c')]===_0x1f6b('0x1d')&&typeof _0x468815[_0x1f6b('0x1e')]===_0x1f6b('0x1d');var _0x2a28b4=_0xfda1ca['count'];var _0x4f05b8=_0x3035c8?0x0:_0x468815[_0x1f6b('0x1c')];var _0x3cc6b3=_0x3035c8?_0xfda1ca['count']:_0x468815[_0x1f6b('0x1c')]+_0x468815['limit'];var _0x3af093;if(_0x3cc6b3>=_0x2a28b4){_0x3cc6b3=_0x2a28b4;_0x3af093=0xc8;}else{_0x3af093=0xce;}_0x283233[_0x1f6b('0x1a')](_0x3af093);return _0x283233['set'](_0x1f6b('0x1f'),_0x4f05b8+'-'+_0x3cc6b3+'/'+_0x2a28b4)[_0x1f6b('0x20')](_0xfda1ca);}return null;};}function patchUpdates(_0x2b7a2d){return function(_0x15a458){try{jsonpatch[_0x1f6b('0x21')](_0x15a458,_0x2b7a2d,!![]);}catch(_0x43d0cb){return BPromise[_0x1f6b('0x22')](_0x43d0cb);}return _0x15a458['save']();};}function saveUpdates(_0x3516f8,_0x3dcff2){return function(_0x500252){if(_0x500252){return _0x500252[_0x1f6b('0x23')](_0x3516f8)['then'](function(_0x1cf11b){return _0x1cf11b;});}return null;};}function removeEntity(_0x51ce74,_0x29464b){return function(_0x413a02){if(_0x413a02){return _0x413a02[_0x1f6b('0x24')]()[_0x1f6b('0x25')](function(){_0x51ce74[_0x1f6b('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x196647,_0x46b712){return function(_0x49aedd){if(!_0x49aedd){_0x196647[_0x1f6b('0x19')](0x194);}return _0x49aedd;};}function handleError(_0xe74376,_0x1f3b9e){_0x1f3b9e=_0x1f3b9e||0x1f4;return function(_0x4b5255){logger[_0x1f6b('0x26')](_0x4b5255[_0x1f6b('0x27')]);if(_0x4b5255[_0x1f6b('0x28')]){delete _0x4b5255[_0x1f6b('0x28')];}_0xe74376[_0x1f6b('0x1a')](_0x1f3b9e)[_0x1f6b('0x29')](_0x4b5255);};}exports[_0x1f6b('0x2a')]=function(_0x1ee9d4,_0x1af35b){var _0x473a08={},_0x50b75c={},_0x3f2763={'count':0x0,'rows':[]};var _0x30ead8=_[_0x1f6b('0x2b')](db['CmHopperBlack'][_0x1f6b('0x2c')],function(_0x1ba7f6){return{'name':_0x1ba7f6[_0x1f6b('0x2d')],'type':_0x1ba7f6['type'][_0x1f6b('0x2e')]};});_0x50b75c[_0x1f6b('0x2f')]=_[_0x1f6b('0x2b')](_0x30ead8,_0x1f6b('0x28'));_0x50b75c['query']=_[_0x1f6b('0x30')](_0x1ee9d4[_0x1f6b('0x31')]);_0x50b75c[_0x1f6b('0x32')]=_[_0x1f6b('0x33')](_0x50b75c[_0x1f6b('0x2f')],_0x50b75c[_0x1f6b('0x31')]);_0x473a08[_0x1f6b('0x34')]=_[_0x1f6b('0x33')](_0x50b75c[_0x1f6b('0x2f')],qs[_0x1f6b('0x35')](_0x1ee9d4['query'][_0x1f6b('0x35')]));_0x473a08[_0x1f6b('0x34')]=_0x473a08[_0x1f6b('0x34')][_0x1f6b('0x36')]?_0x473a08[_0x1f6b('0x34')]:_0x50b75c['model'];if(!_0x1ee9d4[_0x1f6b('0x31')]['hasOwnProperty'](_0x1f6b('0x37'))){_0x473a08[_0x1f6b('0x1e')]=qs[_0x1f6b('0x1e')](_0x1ee9d4['query'][_0x1f6b('0x1e')]);_0x473a08[_0x1f6b('0x1c')]=qs[_0x1f6b('0x1c')](_0x1ee9d4[_0x1f6b('0x31')][_0x1f6b('0x1c')]);}_0x473a08[_0x1f6b('0x38')]=qs[_0x1f6b('0x39')](_0x1ee9d4[_0x1f6b('0x31')]['sort']);_0x473a08[_0x1f6b('0x3a')]=qs[_0x1f6b('0x32')](_[_0x1f6b('0x3b')](_0x1ee9d4[_0x1f6b('0x31')],_0x50b75c[_0x1f6b('0x32')]),_0x30ead8);if(_0x1ee9d4[_0x1f6b('0x31')][_0x1f6b('0x3c')]){_0x473a08[_0x1f6b('0x3a')]=_[_0x1f6b('0x3d')](_0x473a08[_0x1f6b('0x3a')],{'$or':_['map'](_0x30ead8,function(_0x415e97){if(_0x415e97[_0x1f6b('0x3e')]!==_0x1f6b('0x3f')){var _0x47d057={};_0x47d057[_0x415e97[_0x1f6b('0x28')]]={'$like':'%'+_0x1ee9d4[_0x1f6b('0x31')][_0x1f6b('0x3c')]+'%'};return _0x47d057;}})});}_0x473a08=_['merge']({},_0x473a08,_0x1ee9d4[_0x1f6b('0x40')]);var _0x441743={'where':_0x473a08['where']};return db[_0x1f6b('0x41')]['count'](_0x441743)[_0x1f6b('0x25')](function(_0x47e409){_0x3f2763[_0x1f6b('0x42')]=_0x47e409;if(_0x1ee9d4['query'][_0x1f6b('0x43')]){_0x473a08[_0x1f6b('0x44')]=[{'all':!![]}];}return db[_0x1f6b('0x41')][_0x1f6b('0x45')](_0x473a08);})[_0x1f6b('0x25')](function(_0xce8800){_0x3f2763['rows']=_0xce8800;return _0x3f2763;})[_0x1f6b('0x25')](respondWithFilteredResult(_0x1af35b,_0x473a08))[_0x1f6b('0x46')](handleError(_0x1af35b,null));};exports[_0x1f6b('0x47')]=function(_0xea7c55,_0xaa1edd){var _0x4be257={'raw':!![],'where':{'id':_0xea7c55[_0x1f6b('0x48')]['id']}},_0x3ed9f6={};_0x3ed9f6[_0x1f6b('0x2f')]=_[_0x1f6b('0x30')](db[_0x1f6b('0x41')][_0x1f6b('0x2c')]);_0x3ed9f6['query']=_[_0x1f6b('0x30')](_0xea7c55['query']);_0x3ed9f6[_0x1f6b('0x32')]=_[_0x1f6b('0x33')](_0x3ed9f6[_0x1f6b('0x2f')],_0x3ed9f6[_0x1f6b('0x31')]);_0x4be257[_0x1f6b('0x34')]=_['intersection'](_0x3ed9f6['model'],qs[_0x1f6b('0x35')](_0xea7c55[_0x1f6b('0x31')]['fields']));_0x4be257['attributes']=_0x4be257[_0x1f6b('0x34')][_0x1f6b('0x36')]?_0x4be257[_0x1f6b('0x34')]:_0x3ed9f6[_0x1f6b('0x2f')];if(_0xea7c55[_0x1f6b('0x31')][_0x1f6b('0x43')]){_0x4be257[_0x1f6b('0x44')]=[{'all':!![]}];}_0x4be257=_[_0x1f6b('0x3d')]({},_0x4be257,_0xea7c55['options']);return db['CmHopperBlack']['find'](_0x4be257)['then'](handleEntityNotFound(_0xaa1edd,null))[_0x1f6b('0x25')](respondWithResult(_0xaa1edd,null))[_0x1f6b('0x46')](handleError(_0xaa1edd,null));};exports['update']=function(_0x25a908,_0x2ca5a8){if(_0x25a908[_0x1f6b('0x49')]['id']){delete _0x25a908[_0x1f6b('0x49')]['id'];}return db[_0x1f6b('0x41')][_0x1f6b('0x4a')]({'where':{'id':_0x25a908[_0x1f6b('0x48')]['id']}})[_0x1f6b('0x25')](handleEntityNotFound(_0x2ca5a8,null))[_0x1f6b('0x25')](saveUpdates(_0x25a908[_0x1f6b('0x49')],null))[_0x1f6b('0x25')](respondWithResult(_0x2ca5a8,null))[_0x1f6b('0x46')](handleError(_0x2ca5a8,null));};exports[_0x1f6b('0x24')]=function(_0x8d032e,_0xf6c508){return db['CmHopperBlack']['find']({'where':{'id':_0x8d032e[_0x1f6b('0x48')]['id']}})[_0x1f6b('0x25')](handleEntityNotFound(_0xf6c508,null))['then'](removeEntity(_0xf6c508,null))[_0x1f6b('0x46')](handleError(_0xf6c508,null));};exports[_0x1f6b('0x4b')]=function(_0x53cd55,_0x37307c){return db[_0x1f6b('0x41')][_0x1f6b('0x4b')]()['then'](respondWithResult(_0x37307c,null))['catch'](handleError(_0x37307c,null));}; \ No newline at end of file +var _0x1900=['set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','CmHopperBlack','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','body','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count'];(function(_0x194cf8,_0x536123){var _0x17444f=function(_0x20be73){while(--_0x20be73){_0x194cf8['push'](_0x194cf8['shift']());}};_0x17444f(++_0x536123);}(_0x1900,0x76));var _0x0190=function(_0x3e60b1,_0x265bc7){_0x3e60b1=_0x3e60b1-0x0;var _0x9263e2=_0x1900[_0x3e60b1];return _0x9263e2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0190('0x0'));var zipdir=require(_0x0190('0x1'));var jsonpatch=require(_0x0190('0x2'));var rp=require('request-promise');var moment=require(_0x0190('0x3'));var BPromise=require(_0x0190('0x4'));var Mustache=require('mustache');var util=require(_0x0190('0x5'));var path=require(_0x0190('0x6'));var sox=require(_0x0190('0x7'));var csv=require(_0x0190('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0190('0x9'));var _=require(_0x0190('0xa'));var squel=require(_0x0190('0xb'));var crypto=require(_0x0190('0xc'));var jsforce=require(_0x0190('0xd'));var deskjs=require(_0x0190('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0190('0xf'));var Redis=require(_0x0190('0x10'));var authService=require(_0x0190('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0190('0x12'));var logger=require(_0x0190('0x13'))(_0x0190('0x14'));var utils=require(_0x0190('0x15'));var config=require(_0x0190('0x16'));var licenseUtil=require(_0x0190('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4098b5,_0x3f7765){_0x3f7765=_0x3f7765||0xcc;return function(_0x18e133){if(_0x18e133){return _0x4098b5[_0x0190('0x18')](_0x3f7765);}return _0x4098b5[_0x0190('0x19')](_0x3f7765)[_0x0190('0x1a')]();};}function respondWithResult(_0x51af9b,_0x50f6d9){_0x50f6d9=_0x50f6d9||0xc8;return function(_0x48d419){if(_0x48d419){return _0x51af9b[_0x0190('0x19')](_0x50f6d9)[_0x0190('0x1b')](_0x48d419);}};}function respondWithFilteredResult(_0xeab56a,_0xeb69ad){return function(_0x3acf38){if(_0x3acf38){var _0x5be263=typeof _0xeb69ad[_0x0190('0x1c')]===_0x0190('0x1d')&&typeof _0xeb69ad[_0x0190('0x1e')]===_0x0190('0x1d');var _0x550e3a=_0x3acf38['count'];var _0x1755f8=_0x5be263?0x0:_0xeb69ad[_0x0190('0x1c')];var _0x375e75=_0x5be263?_0x3acf38[_0x0190('0x1f')]:_0xeb69ad[_0x0190('0x1c')]+_0xeb69ad[_0x0190('0x1e')];var _0x4c5367;if(_0x375e75>=_0x550e3a){_0x375e75=_0x550e3a;_0x4c5367=0xc8;}else{_0x4c5367=0xce;}_0xeab56a[_0x0190('0x19')](_0x4c5367);return _0xeab56a[_0x0190('0x20')](_0x0190('0x21'),_0x1755f8+'-'+_0x375e75+'/'+_0x550e3a)[_0x0190('0x1b')](_0x3acf38);}return null;};}function patchUpdates(_0xcc67c0){return function(_0x128c0a){try{jsonpatch[_0x0190('0x22')](_0x128c0a,_0xcc67c0,!![]);}catch(_0x2b3467){return BPromise[_0x0190('0x23')](_0x2b3467);}return _0x128c0a[_0x0190('0x24')]();};}function saveUpdates(_0x1a50dd,_0x11736f){return function(_0x1ccca5){if(_0x1ccca5){return _0x1ccca5[_0x0190('0x25')](_0x1a50dd)[_0x0190('0x26')](function(_0x28ba0d){return _0x28ba0d;});}return null;};}function removeEntity(_0xe3f042,_0x4b2505){return function(_0x580869){if(_0x580869){return _0x580869[_0x0190('0x27')]()[_0x0190('0x26')](function(){_0xe3f042[_0x0190('0x19')](0xcc)[_0x0190('0x1a')]();});}};}function handleEntityNotFound(_0x418957,_0x33b801){return function(_0xe43b92){if(!_0xe43b92){_0x418957[_0x0190('0x18')](0x194);}return _0xe43b92;};}function handleError(_0x2ee78d,_0x211197){_0x211197=_0x211197||0x1f4;return function(_0x3a4944){logger[_0x0190('0x28')](_0x3a4944[_0x0190('0x29')]);if(_0x3a4944['name']){delete _0x3a4944[_0x0190('0x2a')];}_0x2ee78d[_0x0190('0x19')](_0x211197)['send'](_0x3a4944);};}exports[_0x0190('0x2b')]=function(_0x1007b1,_0x1ea5d5){var _0x1673a9={},_0x4ed879={},_0x11b214={'count':0x0,'rows':[]};var _0x289ff5=_[_0x0190('0x2c')](db['CmHopperBlack']['rawAttributes'],function(_0x1f6981){return{'name':_0x1f6981[_0x0190('0x2d')],'type':_0x1f6981[_0x0190('0x2e')]['key']};});_0x4ed879[_0x0190('0x2f')]=_[_0x0190('0x2c')](_0x289ff5,_0x0190('0x2a'));_0x4ed879[_0x0190('0x30')]=_[_0x0190('0x31')](_0x1007b1[_0x0190('0x30')]);_0x4ed879[_0x0190('0x32')]=_[_0x0190('0x33')](_0x4ed879[_0x0190('0x2f')],_0x4ed879[_0x0190('0x30')]);_0x1673a9[_0x0190('0x34')]=_[_0x0190('0x33')](_0x4ed879[_0x0190('0x2f')],qs[_0x0190('0x35')](_0x1007b1[_0x0190('0x30')][_0x0190('0x35')]));_0x1673a9[_0x0190('0x34')]=_0x1673a9[_0x0190('0x34')][_0x0190('0x36')]?_0x1673a9[_0x0190('0x34')]:_0x4ed879[_0x0190('0x2f')];if(!_0x1007b1['query'][_0x0190('0x37')](_0x0190('0x38'))){_0x1673a9[_0x0190('0x1e')]=qs[_0x0190('0x1e')](_0x1007b1[_0x0190('0x30')][_0x0190('0x1e')]);_0x1673a9[_0x0190('0x1c')]=qs[_0x0190('0x1c')](_0x1007b1['query']['offset']);}_0x1673a9['order']=qs[_0x0190('0x39')](_0x1007b1[_0x0190('0x30')]['sort']);_0x1673a9['where']=qs[_0x0190('0x32')](_[_0x0190('0x3a')](_0x1007b1['query'],_0x4ed879[_0x0190('0x32')]),_0x289ff5);if(_0x1007b1[_0x0190('0x30')][_0x0190('0x3b')]){_0x1673a9['where']=_[_0x0190('0x3c')](_0x1673a9['where'],{'$or':_[_0x0190('0x2c')](_0x289ff5,function(_0x515c19){if(_0x515c19[_0x0190('0x2e')]!=='VIRTUAL'){var _0x4a953a={};_0x4a953a[_0x515c19[_0x0190('0x2a')]]={'$like':'%'+_0x1007b1[_0x0190('0x30')]['filter']+'%'};return _0x4a953a;}})});}_0x1673a9=_['merge']({},_0x1673a9,_0x1007b1['options']);var _0x47025e={'where':_0x1673a9[_0x0190('0x3d')]};return db[_0x0190('0x3e')][_0x0190('0x1f')](_0x47025e)[_0x0190('0x26')](function(_0x584809){_0x11b214[_0x0190('0x1f')]=_0x584809;if(_0x1007b1[_0x0190('0x30')][_0x0190('0x3f')]){_0x1673a9[_0x0190('0x40')]=[{'all':!![]}];}return db[_0x0190('0x3e')][_0x0190('0x41')](_0x1673a9);})['then'](function(_0x2051af){_0x11b214[_0x0190('0x42')]=_0x2051af;return _0x11b214;})[_0x0190('0x26')](respondWithFilteredResult(_0x1ea5d5,_0x1673a9))[_0x0190('0x43')](handleError(_0x1ea5d5,null));};exports[_0x0190('0x44')]=function(_0x4d1d6d,_0x3ccaab){var _0x2acdd4={'raw':!![],'where':{'id':_0x4d1d6d[_0x0190('0x45')]['id']}},_0x25c9f2={};_0x25c9f2['model']=_[_0x0190('0x31')](db[_0x0190('0x3e')][_0x0190('0x46')]);_0x25c9f2[_0x0190('0x30')]=_[_0x0190('0x31')](_0x4d1d6d[_0x0190('0x30')]);_0x25c9f2[_0x0190('0x32')]=_['intersection'](_0x25c9f2[_0x0190('0x2f')],_0x25c9f2[_0x0190('0x30')]);_0x2acdd4[_0x0190('0x34')]=_[_0x0190('0x33')](_0x25c9f2[_0x0190('0x2f')],qs['fields'](_0x4d1d6d[_0x0190('0x30')][_0x0190('0x35')]));_0x2acdd4[_0x0190('0x34')]=_0x2acdd4[_0x0190('0x34')]['length']?_0x2acdd4[_0x0190('0x34')]:_0x25c9f2[_0x0190('0x2f')];if(_0x4d1d6d['query'][_0x0190('0x3f')]){_0x2acdd4[_0x0190('0x40')]=[{'all':!![]}];}_0x2acdd4=_[_0x0190('0x3c')]({},_0x2acdd4,_0x4d1d6d[_0x0190('0x47')]);return db[_0x0190('0x3e')][_0x0190('0x48')](_0x2acdd4)[_0x0190('0x26')](handleEntityNotFound(_0x3ccaab,null))['then'](respondWithResult(_0x3ccaab,null))[_0x0190('0x43')](handleError(_0x3ccaab,null));};exports['update']=function(_0x4b57c2,_0x27a845){if(_0x4b57c2[_0x0190('0x49')]['id']){delete _0x4b57c2[_0x0190('0x49')]['id'];}return db[_0x0190('0x3e')][_0x0190('0x48')]({'where':{'id':_0x4b57c2[_0x0190('0x45')]['id']}})[_0x0190('0x26')](handleEntityNotFound(_0x27a845,null))['then'](saveUpdates(_0x4b57c2[_0x0190('0x49')],null))[_0x0190('0x26')](respondWithResult(_0x27a845,null))[_0x0190('0x43')](handleError(_0x27a845,null));};exports['destroy']=function(_0x1a224f,_0x1c18fc){return db[_0x0190('0x3e')][_0x0190('0x48')]({'where':{'id':_0x1a224f[_0x0190('0x45')]['id']}})[_0x0190('0x26')](handleEntityNotFound(_0x1c18fc,null))['then'](removeEntity(_0x1c18fc,null))['catch'](handleError(_0x1c18fc,null));};exports[_0x0190('0x4a')]=function(_0x2f308e,_0x519383){return db[_0x0190('0x3e')][_0x0190('0x4a')]()['then'](respondWithResult(_0x519383,null))[_0x0190('0x43')](handleError(_0x519383,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index e867fb6..c1c1968 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 _0xaaa2=['rimraf','../../config/environment','exports','define','CmHopperBlack','cm_hopper_black','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x19e87f,_0x520e3f){var _0x1e772f=function(_0x38fd70){while(--_0x38fd70){_0x19e87f['push'](_0x19e87f['shift']());}};_0x1e772f(++_0x520e3f);}(_0xaaa2,0xde));var _0x2aaa=function(_0x231df4,_0x4a78d5){_0x231df4=_0x231df4-0x0;var _0x4b4789=_0xaaa2[_0x231df4];return _0x4b4789;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2aaa('0x0'))(_0x2aaa('0x1'));var moment=require(_0x2aaa('0x2'));var BPromise=require(_0x2aaa('0x3'));var rp=require(_0x2aaa('0x4'));var fs=require('fs');var path=require(_0x2aaa('0x5'));var rimraf=require(_0x2aaa('0x6'));var config=require(_0x2aaa('0x7'));var attributes=require('./cmHopperBlack.attributes');module[_0x2aaa('0x8')]=function(_0x32b1cf,_0x700fe3){return _0x32b1cf[_0x2aaa('0x9')](_0x2aaa('0xa'),attributes,{'tableName':_0x2aaa('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xee05=['../../config/environment','exports','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xee05,0x16c));var _0x5ee0=function(_0xdc1e87,_0x485810){_0xdc1e87=_0xdc1e87-0x0;var _0x31d90f=_0xee05[_0xdc1e87];return _0x31d90f;};'use strict';var _=require(_0x5ee0('0x0'));var util=require(_0x5ee0('0x1'));var logger=require(_0x5ee0('0x2'))(_0x5ee0('0x3'));var moment=require('moment');var BPromise=require(_0x5ee0('0x4'));var rp=require(_0x5ee0('0x5'));var fs=require('fs');var path=require(_0x5ee0('0x6'));var rimraf=require(_0x5ee0('0x7'));var config=require(_0x5ee0('0x8'));var attributes=require('./cmHopperBlack.attributes');module[_0x5ee0('0x9')]=function(_0x10cd92,_0x1290eb){return _0x10cd92['define'](_0x5ee0('0xa'),attributes,{'tableName':_0x5ee0('0xb'),'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 b2c26ac..680e1bf 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 _0xad79=['raw','debug','DestroyCmHopperBlack','destroy','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','CmHopperBlack,\x20%s,\x20%s','CmHopperBlack,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','where','attributes','include','map','model','UpdateCmHopperBlack','update','body'];(function(_0x55f00f,_0x3932a1){var _0x430a2e=function(_0x25fc29){while(--_0x25fc29){_0x55f00f['push'](_0x55f00f['shift']());}};_0x430a2e(++_0x3932a1);}(_0xad79,0x15a));var _0x9ad7=function(_0x146979,_0x4dfc32){_0x146979=_0x146979-0x0;var _0x103856=_0xad79[_0x146979];return _0x103856;};'use strict';var _=require(_0x9ad7('0x0'));var util=require(_0x9ad7('0x1'));var moment=require(_0x9ad7('0x2'));var BPromise=require(_0x9ad7('0x3'));var rs=require(_0x9ad7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9ad7('0x5'))['db'];var utils=require(_0x9ad7('0x6'));var logger=require(_0x9ad7('0x7'))(_0x9ad7('0x8'));var config=require(_0x9ad7('0x9'));var jayson=require(_0x9ad7('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x29a658,_0x34155a,_0x43105a){return new BPromise(function(_0xde653,_0x4a392b){return client[_0x9ad7('0xb')](_0x29a658,_0x43105a)[_0x9ad7('0xc')](function(_0x538893){logger[_0x9ad7('0xd')](_0x9ad7('0xe'),_0x34155a,'request\x20sent');logger['debug'](_0x9ad7('0xf'),_0x34155a,_0x9ad7('0x10'),JSON[_0x9ad7('0x11')](_0x538893));if(_0x538893['error']){if(_0x538893['error']['code']===0x1f4){logger[_0x9ad7('0x12')]('CmHopperBlack,\x20%s,\x20%s',_0x34155a,_0x538893[_0x9ad7('0x12')][_0x9ad7('0x13')]);return _0x4a392b(_0x538893[_0x9ad7('0x12')][_0x9ad7('0x13')]);}logger[_0x9ad7('0x12')](_0x9ad7('0xe'),_0x34155a,_0x538893[_0x9ad7('0x12')][_0x9ad7('0x13')]);return _0xde653(_0x538893[_0x9ad7('0x12')][_0x9ad7('0x13')]);}else{logger['info'](_0x9ad7('0xe'),_0x34155a,'request\x20sent');_0xde653(_0x538893[_0x9ad7('0x14')][_0x9ad7('0x13')]);}})[_0x9ad7('0x15')](function(_0x2ce413){logger['error'](_0x9ad7('0xe'),_0x34155a,_0x2ce413);_0x4a392b(_0x2ce413);});});}exports[_0x9ad7('0x16')]=function(_0x57b141){var _0x378d5d=this;return new Promise(function(_0xca330b,_0x21c385){return db[_0x9ad7('0x17')][_0x9ad7('0x18')]({'raw':_0x57b141['options']?_0x57b141[_0x9ad7('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x57b141[_0x9ad7('0x19')]?_0x57b141[_0x9ad7('0x19')][_0x9ad7('0x1a')]||null:null,'attributes':_0x57b141[_0x9ad7('0x19')]?_0x57b141['options'][_0x9ad7('0x1b')]||null:null,'limit':_0x57b141[_0x9ad7('0x19')]?_0x57b141[_0x9ad7('0x19')]['limit']||null:null,'include':_0x57b141['options']?_0x57b141[_0x9ad7('0x19')][_0x9ad7('0x1c')]?_[_0x9ad7('0x1d')](_0x57b141[_0x9ad7('0x19')][_0x9ad7('0x1c')],function(_0x41b0e6){return{'model':db[_0x41b0e6[_0x9ad7('0x1e')]],'as':_0x41b0e6['as'],'attributes':_0x41b0e6[_0x9ad7('0x1b')],'include':_0x41b0e6[_0x9ad7('0x1c')]?_['map'](_0x41b0e6[_0x9ad7('0x1c')],function(_0x1c2a21){return{'model':db[_0x1c2a21[_0x9ad7('0x1e')]],'as':_0x1c2a21['as'],'attributes':_0x1c2a21['attributes'],'include':_0x1c2a21[_0x9ad7('0x1c')]?_['map'](_0x1c2a21['include'],function(_0x143a08){return{'model':db[_0x143a08[_0x9ad7('0x1e')]],'as':_0x143a08['as'],'attributes':_0x143a08[_0x9ad7('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x9ad7('0xc')](function(_0x263389){logger[_0x9ad7('0xd')](_0x9ad7('0x16'),_0x57b141);logger['debug'](_0x9ad7('0x16'),_0x57b141,JSON[_0x9ad7('0x11')](_0x263389));_0xca330b(_0x263389);})[_0x9ad7('0x15')](function(_0x2c2ba8){logger['error'](_0x9ad7('0x16'),_0x2c2ba8['message'],_0x57b141);_0x21c385(_0x378d5d[_0x9ad7('0x12')](0x1f4,_0x2c2ba8[_0x9ad7('0x13')]));});});};exports[_0x9ad7('0x1f')]=function(_0x5e7631){var _0x403aff=this;return new Promise(function(_0x2ea933,_0x527720){return db[_0x9ad7('0x17')][_0x9ad7('0x20')](_0x5e7631[_0x9ad7('0x21')],{'raw':_0x5e7631['options']?_0x5e7631['options'][_0x9ad7('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e7631[_0x9ad7('0x19')]?_0x5e7631['options'][_0x9ad7('0x1a')]||null:null,'attributes':_0x5e7631['options']?_0x5e7631[_0x9ad7('0x19')][_0x9ad7('0x1b')]||null:null,'limit':_0x5e7631[_0x9ad7('0x19')]?_0x5e7631['options']['limit']||null:null})['then'](function(_0x21470c){logger[_0x9ad7('0xd')](_0x9ad7('0x1f'),_0x5e7631);logger[_0x9ad7('0x23')](_0x9ad7('0x1f'),_0x5e7631,JSON[_0x9ad7('0x11')](_0x21470c));_0x2ea933(_0x21470c);})[_0x9ad7('0x15')](function(_0x151d69){logger[_0x9ad7('0x12')]('UpdateCmHopperBlack',_0x151d69['message'],_0x5e7631);_0x527720(_0x403aff[_0x9ad7('0x12')](0x1f4,_0x151d69['message']));});});};exports[_0x9ad7('0x24')]=function(_0x34c12f){var _0x3fa620=this;return new Promise(function(_0x390657,_0x3c7e8d){return db[_0x9ad7('0x17')][_0x9ad7('0x25')]({'where':_0x34c12f[_0x9ad7('0x19')]?_0x34c12f['options']['where']||null:null})[_0x9ad7('0xc')](function(_0x770c6){logger['info']('DestroyCmHopperBlack',_0x34c12f);logger[_0x9ad7('0x23')](_0x9ad7('0x24'),_0x34c12f,JSON[_0x9ad7('0x11')](_0x770c6));_0x390657(_0x770c6);})['catch'](function(_0x3aeb1e){logger['error']('DestroyCmHopperBlack',_0x3aeb1e[_0x9ad7('0x13')],_0x34c12f);_0x3c7e8d(_0x3fa620[_0x9ad7('0x12')](0x1f4,_0x3aeb1e[_0x9ad7('0x13')]));});});}; \ No newline at end of file +var _0x2d88=['update','body','limit','DestroyCmHopperBlack','destroy','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','CmHopperBlack,\x20%s,\x20%s','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','GetCmHopperBlack','findAll','options','raw','where','attributes','include','map','model','catch','UpdateCmHopperBlack'];(function(_0x1366e8,_0x2d1f28){var _0x34f0e7=function(_0x1ae564){while(--_0x1ae564){_0x1366e8['push'](_0x1366e8['shift']());}};_0x34f0e7(++_0x2d1f28);}(_0x2d88,0xa1));var _0x82d8=function(_0x194969,_0x2d191a){_0x194969=_0x194969-0x0;var _0x2119cb=_0x2d88[_0x194969];return _0x2119cb;};'use strict';var _=require(_0x82d8('0x0'));var util=require(_0x82d8('0x1'));var moment=require(_0x82d8('0x2'));var BPromise=require(_0x82d8('0x3'));var rs=require(_0x82d8('0x4'));var fs=require('fs');var Redis=require(_0x82d8('0x5'));var db=require(_0x82d8('0x6'))['db'];var utils=require(_0x82d8('0x7'));var logger=require('../../config/logger')(_0x82d8('0x8'));var config=require(_0x82d8('0x9'));var jayson=require(_0x82d8('0xa'));var client=jayson[_0x82d8('0xb')][_0x82d8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x16f30f,_0x1ca124,_0x52086a){return new BPromise(function(_0x557b22,_0x31acef){return client['request'](_0x16f30f,_0x52086a)[_0x82d8('0xd')](function(_0x38bfe9){logger[_0x82d8('0xe')](_0x82d8('0xf'),_0x1ca124,'request\x20sent');logger[_0x82d8('0x10')](_0x82d8('0x11'),_0x1ca124,_0x82d8('0x12'),JSON[_0x82d8('0x13')](_0x38bfe9));if(_0x38bfe9[_0x82d8('0x14')]){if(_0x38bfe9['error'][_0x82d8('0x15')]===0x1f4){logger[_0x82d8('0x14')]('CmHopperBlack,\x20%s,\x20%s',_0x1ca124,_0x38bfe9[_0x82d8('0x14')]['message']);return _0x31acef(_0x38bfe9[_0x82d8('0x14')][_0x82d8('0x16')]);}logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x1ca124,_0x38bfe9[_0x82d8('0x14')][_0x82d8('0x16')]);return _0x557b22(_0x38bfe9[_0x82d8('0x14')][_0x82d8('0x16')]);}else{logger[_0x82d8('0xe')](_0x82d8('0xf'),_0x1ca124,_0x82d8('0x12'));_0x557b22(_0x38bfe9['result'][_0x82d8('0x16')]);}})['catch'](function(_0x209767){logger['error'](_0x82d8('0xf'),_0x1ca124,_0x209767);_0x31acef(_0x209767);});});}exports[_0x82d8('0x17')]=function(_0x3658e0){var _0x71810=this;return new Promise(function(_0x46c591,_0x59f50c){return db['CmHopperBlack'][_0x82d8('0x18')]({'raw':_0x3658e0[_0x82d8('0x19')]?_0x3658e0['options'][_0x82d8('0x1a')]===undefined?!![]:![]:!![],'where':_0x3658e0[_0x82d8('0x19')]?_0x3658e0['options'][_0x82d8('0x1b')]||null:null,'attributes':_0x3658e0[_0x82d8('0x19')]?_0x3658e0['options'][_0x82d8('0x1c')]||null:null,'limit':_0x3658e0[_0x82d8('0x19')]?_0x3658e0[_0x82d8('0x19')]['limit']||null:null,'include':_0x3658e0['options']?_0x3658e0[_0x82d8('0x19')][_0x82d8('0x1d')]?_[_0x82d8('0x1e')](_0x3658e0[_0x82d8('0x19')][_0x82d8('0x1d')],function(_0x462510){return{'model':db[_0x462510[_0x82d8('0x1f')]],'as':_0x462510['as'],'attributes':_0x462510[_0x82d8('0x1c')],'include':_0x462510[_0x82d8('0x1d')]?_['map'](_0x462510[_0x82d8('0x1d')],function(_0x75d02a){return{'model':db[_0x75d02a[_0x82d8('0x1f')]],'as':_0x75d02a['as'],'attributes':_0x75d02a[_0x82d8('0x1c')],'include':_0x75d02a[_0x82d8('0x1d')]?_[_0x82d8('0x1e')](_0x75d02a[_0x82d8('0x1d')],function(_0x47e5ae){return{'model':db[_0x47e5ae[_0x82d8('0x1f')]],'as':_0x47e5ae['as'],'attributes':_0x47e5ae[_0x82d8('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x82d8('0xd')](function(_0x4f8c86){logger['info'](_0x82d8('0x17'),_0x3658e0);logger[_0x82d8('0x10')](_0x82d8('0x17'),_0x3658e0,JSON[_0x82d8('0x13')](_0x4f8c86));_0x46c591(_0x4f8c86);})[_0x82d8('0x20')](function(_0x332aca){logger[_0x82d8('0x14')](_0x82d8('0x17'),_0x332aca['message'],_0x3658e0);_0x59f50c(_0x71810[_0x82d8('0x14')](0x1f4,_0x332aca[_0x82d8('0x16')]));});});};exports[_0x82d8('0x21')]=function(_0x55c30){var _0x14e8e8=this;return new Promise(function(_0x587213,_0x448223){return db['CmHopperBlack'][_0x82d8('0x22')](_0x55c30[_0x82d8('0x23')],{'raw':_0x55c30['options']?_0x55c30[_0x82d8('0x19')][_0x82d8('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55c30[_0x82d8('0x19')]?_0x55c30['options'][_0x82d8('0x1b')]||null:null,'attributes':_0x55c30['options']?_0x55c30[_0x82d8('0x19')]['attributes']||null:null,'limit':_0x55c30[_0x82d8('0x19')]?_0x55c30[_0x82d8('0x19')][_0x82d8('0x24')]||null:null})[_0x82d8('0xd')](function(_0x4e9c1c){logger[_0x82d8('0xe')](_0x82d8('0x21'),_0x55c30);logger[_0x82d8('0x10')]('UpdateCmHopperBlack',_0x55c30,JSON[_0x82d8('0x13')](_0x4e9c1c));_0x587213(_0x4e9c1c);})[_0x82d8('0x20')](function(_0x5c9f68){logger['error']('UpdateCmHopperBlack',_0x5c9f68['message'],_0x55c30);_0x448223(_0x14e8e8['error'](0x1f4,_0x5c9f68[_0x82d8('0x16')]));});});};exports[_0x82d8('0x25')]=function(_0x16fb83){var _0x17430d=this;return new Promise(function(_0xa510b9,_0x430256){return db['CmHopperBlack'][_0x82d8('0x26')]({'where':_0x16fb83[_0x82d8('0x19')]?_0x16fb83[_0x82d8('0x19')][_0x82d8('0x1b')]||null:null})[_0x82d8('0xd')](function(_0xc162b7){logger[_0x82d8('0xe')](_0x82d8('0x25'),_0x16fb83);logger[_0x82d8('0x10')]('DestroyCmHopperBlack',_0x16fb83,JSON[_0x82d8('0x13')](_0xc162b7));_0xa510b9(_0xc162b7);})['catch'](function(_0xa1a2bb){logger[_0x82d8('0x14')](_0x82d8('0x25'),_0xa1a2bb[_0x82d8('0x16')],_0x16fb83);_0x430256(_0x17430d[_0x82d8('0x14')](0x1f4,_0xa1a2bb[_0x82d8('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index bb10822..715d19a 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 _0x7ee1=['Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','index','isAuthenticated','/:id','delete','destroy','multer','express'];(function(_0x2e09eb,_0x37ceca){var _0x4621c0=function(_0x23dfa3){while(--_0x23dfa3){_0x2e09eb['push'](_0x2e09eb['shift']());}};_0x4621c0(++_0x37ceca);}(_0x7ee1,0x8d));var _0x17ee=function(_0x3f4efe,_0x48cbfa){_0x3f4efe=_0x3f4efe-0x0;var _0x473e0e=_0x7ee1[_0x3f4efe];return _0x473e0e;};'use strict';var multer=require(_0x17ee('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x17ee('0x1'));var router=express[_0x17ee('0x2')]();var fs_extra=require(_0x17ee('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x17ee('0x4'));var config=require(_0x17ee('0x5'));var controller=require(_0x17ee('0x6'));router[_0x17ee('0x7')]('/',auth['isAuthenticated'](),controller[_0x17ee('0x8')]);router[_0x17ee('0x7')]('/describe',auth[_0x17ee('0x9')](),controller['describe']);router[_0x17ee('0x7')](_0x17ee('0xa'),auth[_0x17ee('0x9')](),controller['show']);router['put']('/:id',auth[_0x17ee('0x9')](),controller['update']);router[_0x17ee('0xb')](_0x17ee('0xa'),auth[_0x17ee('0x9')](),controller[_0x17ee('0xc')]);module['exports']=router; \ No newline at end of file +var _0xb145=['update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put'];(function(_0x3cd21c,_0x3dff3c){var _0x326d87=function(_0x20c758){while(--_0x20c758){_0x3cd21c['push'](_0x3cd21c['shift']());}};_0x326d87(++_0x3dff3c);}(_0xb145,0xa3));var _0x5b14=function(_0x3a7490,_0x5c7a3d){_0x3a7490=_0x3a7490-0x0;var _0x195eac=_0xb145[_0x3a7490];return _0x195eac;};'use strict';var multer=require('multer');var util=require(_0x5b14('0x0'));var path=require(_0x5b14('0x1'));var timeout=require(_0x5b14('0x2'));var express=require(_0x5b14('0x3'));var router=express[_0x5b14('0x4')]();var fs_extra=require(_0x5b14('0x5'));var auth=require(_0x5b14('0x6'));var interaction=require(_0x5b14('0x7'));var config=require('../../config/environment');var controller=require(_0x5b14('0x8'));router[_0x5b14('0x9')]('/',auth[_0x5b14('0xa')](),controller[_0x5b14('0xb')]);router['get'](_0x5b14('0xc'),auth[_0x5b14('0xa')](),controller[_0x5b14('0xd')]);router[_0x5b14('0x9')](_0x5b14('0xe'),auth['isAuthenticated'](),controller[_0x5b14('0xf')]);router[_0x5b14('0x10')]('/:id',auth[_0x5b14('0xa')](),controller[_0x5b14('0x11')]);router[_0x5b14('0x12')](_0x5b14('0xe'),auth[_0x5b14('0xa')](),controller['destroy']);module[_0x5b14('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index ba7584e..8936f8c 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 _0xaa20=['INTEGER','DATE','endtime','setDataValue','followuptime','diff','seconds','dispositionat','BOOLEAN','exports','STRING'];(function(_0x4df28d,_0x298667){var _0x3d4765=function(_0x184327){while(--_0x184327){_0x4df28d['push'](_0x4df28d['shift']());}};_0x3d4765(++_0x298667);}(_0xaa20,0x1b6));var _0x0aa2=function(_0x5f1ca8,_0x1be412){_0x5f1ca8=_0x5f1ca8-0x0;var _0x23f6b6=_0xaa20[_0x5f1ca8];return _0x23f6b6;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x0aa2('0x0')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x0aa2('0x1')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x0aa2('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x0aa2('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x0aa2('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x0aa2('0x1')]},'originatecalleridnum':{'type':Sequelize[_0x0aa2('0x1')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x0aa2('0x1')]},'calleridname':{'type':Sequelize[_0x0aa2('0x1')]},'starttime':{'type':Sequelize[_0x0aa2('0x3')]},'responsetime':{'type':Sequelize[_0x0aa2('0x3')]},'answertime':{'type':Sequelize[_0x0aa2('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x0aa2('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x0aa2('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x0aa2('0x1')]},'campaign':{'type':Sequelize[_0x0aa2('0x1')]},'campaigntype':{'type':Sequelize[_0x0aa2('0x1')]},'membername':{'type':Sequelize[_0x0aa2('0x1')]},'reason':{'type':Sequelize[_0x0aa2('0x1')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x0aa2('0x1')]},'thirdDisposition':{'type':Sequelize[_0x0aa2('0x1')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x5ea6c4){var _0x367e00=this['getDataValue'](_0x0aa2('0x4'));if(_0x367e00&&_0x5ea6c4){this[_0x0aa2('0x5')](_0x0aa2('0x6'),moment(_0x5ea6c4)[_0x0aa2('0x7')](moment(_0x367e00),_0x0aa2('0x8')));}return this['setDataValue'](_0x0aa2('0x9'),_0x5ea6c4);}},'amd':{'type':Sequelize[_0x0aa2('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0x0aa2('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x0aa2('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x0aa2('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x0aa2('0x3')]},'callback':{'type':Sequelize[_0x0aa2('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x0aa2('0x3')]},'deleted':{'type':Sequelize[_0x0aa2('0x1')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x0aa2('0x3')]},'recallme':{'type':Sequelize[_0x0aa2('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x0aa2('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x0aa2('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x0aa2('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x0aa2('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x544f=['sequelize','moment','exports','INTEGER','STRING','DATE','endtime','followuptime','diff','seconds','BOOLEAN'];(function(_0x1fd3dd,_0x89682a){var _0x2461e0=function(_0x1cef7d){while(--_0x1cef7d){_0x1fd3dd['push'](_0x1fd3dd['shift']());}};_0x2461e0(++_0x89682a);}(_0x544f,0x9a));var _0xf544=function(_0x5a6644,_0x45d612){_0x5a6644=_0x5a6644-0x0;var _0x3a2a5d=_0x544f[_0x5a6644];return _0x3a2a5d;};'use strict';var Sequelize=require(_0xf544('0x0'));var moment=require(_0xf544('0x1'));module[_0xf544('0x2')]={'state':{'type':Sequelize[_0xf544('0x3')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xf544('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xf544('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xf544('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xf544('0x4')]},'originatecalleridnum':{'type':Sequelize[_0xf544('0x4')]},'originatecalleridname':{'type':Sequelize[_0xf544('0x4')]},'calleridnum':{'type':Sequelize[_0xf544('0x4')]},'calleridname':{'type':Sequelize[_0xf544('0x4')]},'starttime':{'type':Sequelize[_0xf544('0x5')]},'responsetime':{'type':Sequelize[_0xf544('0x5')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xf544('0x5')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xf544('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xf544('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xf544('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xf544('0x4')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xf544('0x4')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0xf544('0x4')]},'secondDisposition':{'type':Sequelize[_0xf544('0x4')]},'thirdDisposition':{'type':Sequelize[_0xf544('0x4')]},'dispositionat':{'type':Sequelize[_0xf544('0x5')],'set':function(_0x41eb28){var _0x3001ab=this['getDataValue'](_0xf544('0x6'));if(_0x3001ab&&_0x41eb28){this['setDataValue'](_0xf544('0x7'),moment(_0x41eb28)[_0xf544('0x8')](moment(_0x3001ab),_0xf544('0x9')));}return this['setDataValue']('dispositionat',_0x41eb28);}},'amd':{'type':Sequelize[_0xf544('0xa')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xf544('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xf544('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xf544('0x5')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xf544('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xf544('0x5')]},'deleted':{'type':Sequelize[_0xf544('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xf544('0x5')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xf544('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0xf544('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xf544('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xf544('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xf544('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xf544('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 89d042f..facb71b 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.controller.js +++ b/server/api/cmHopperFinal/cmHopperFinal.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd117=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/license/util','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','CmHopperFinal','fieldName','type','map','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','findAll','rows','catch','show','params','rawAttributes','includeAll','find','describe','update','body','uniqueid','countContactsQueueCampaignHopperFinal','COUNT','sequelize','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','ANY_VALUE(calleridnum)','field','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','insert','CampaignId','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','state\x20=\x20?','checkContactHopper','CmHopper','findOne','eml-format'];(function(_0x3a2a8c,_0x2b7986){var _0x55d70c=function(_0x5dd518){while(--_0x5dd518){_0x3a2a8c['push'](_0x3a2a8c['shift']());}};_0x55d70c(++_0x2b7986);}(_0xd117,0x182));var _0x7d11=function(_0x2f62aa,_0x108e95){_0x2f62aa=_0x2f62aa-0x0;var _0x1a341f=_0xd117[_0x2f62aa];return _0x1a341f;};'use strict';var emlformat=require(_0x7d11('0x0'));var rimraf=require(_0x7d11('0x1'));var zipdir=require(_0x7d11('0x2'));var jsonpatch=require(_0x7d11('0x3'));var rp=require(_0x7d11('0x4'));var moment=require(_0x7d11('0x5'));var BPromise=require(_0x7d11('0x6'));var Mustache=require(_0x7d11('0x7'));var util=require(_0x7d11('0x8'));var path=require(_0x7d11('0x9'));var sox=require(_0x7d11('0xa'));var csv=require(_0x7d11('0xb'));var ejs=require(_0x7d11('0xc'));var fs=require('fs');var fs_extra=require(_0x7d11('0xd'));var _=require(_0x7d11('0xe'));var squel=require(_0x7d11('0xf'));var crypto=require('crypto');var jsforce=require(_0x7d11('0x10'));var deskjs=require(_0x7d11('0x11'));var toCsv=require(_0x7d11('0xb'));var querystring=require('querystring');var Papa=require(_0x7d11('0x12'));var Redis=require(_0x7d11('0x13'));var authService=require(_0x7d11('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x7d11('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7d11('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7d11('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4767d5,_0x471f46){_0x471f46=_0x471f46||0xcc;return function(_0x5ee572){if(_0x5ee572){return _0x4767d5[_0x7d11('0x18')](_0x471f46);}return _0x4767d5[_0x7d11('0x19')](_0x471f46)['end']();};}function respondWithResult(_0x324de5,_0x16949d){_0x16949d=_0x16949d||0xc8;return function(_0x20a2df){if(_0x20a2df){return _0x324de5[_0x7d11('0x19')](_0x16949d)[_0x7d11('0x1a')](_0x20a2df);}};}function respondWithFilteredResult(_0xeae744,_0x2a269e){return function(_0xb1669e){if(_0xb1669e){var _0x4aa795=typeof _0x2a269e[_0x7d11('0x1b')]===_0x7d11('0x1c')&&typeof _0x2a269e[_0x7d11('0x1d')]===_0x7d11('0x1c');var _0x45f916=_0xb1669e['count'];var _0x456cb9=_0x4aa795?0x0:_0x2a269e[_0x7d11('0x1b')];var _0x4d1306=_0x4aa795?_0xb1669e['count']:_0x2a269e[_0x7d11('0x1b')]+_0x2a269e['limit'];var _0x1f9990;if(_0x4d1306>=_0x45f916){_0x4d1306=_0x45f916;_0x1f9990=0xc8;}else{_0x1f9990=0xce;}_0xeae744['status'](_0x1f9990);return _0xeae744[_0x7d11('0x1e')](_0x7d11('0x1f'),_0x456cb9+'-'+_0x4d1306+'/'+_0x45f916)[_0x7d11('0x1a')](_0xb1669e);}return null;};}function patchUpdates(_0x46f662){return function(_0x30df70){try{jsonpatch[_0x7d11('0x20')](_0x30df70,_0x46f662,!![]);}catch(_0x4297f8){return BPromise[_0x7d11('0x21')](_0x4297f8);}return _0x30df70['save']();};}function saveUpdates(_0x441917,_0x4a34f4){return function(_0x58455b){if(_0x58455b){return _0x58455b['update'](_0x441917)[_0x7d11('0x22')](function(_0x3545dc){return _0x3545dc;});}return null;};}function removeEntity(_0x44476c,_0x1a7853){return function(_0x355d14){if(_0x355d14){return _0x355d14[_0x7d11('0x23')]()[_0x7d11('0x22')](function(){_0x44476c[_0x7d11('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36c2b4,_0x577ca9){return function(_0x4bfa76){if(!_0x4bfa76){_0x36c2b4['sendStatus'](0x194);}return _0x4bfa76;};}function handleError(_0x3ba092,_0x59cdba){_0x59cdba=_0x59cdba||0x1f4;return function(_0x180e1e){logger[_0x7d11('0x24')](_0x180e1e[_0x7d11('0x25')]);if(_0x180e1e['name']){delete _0x180e1e[_0x7d11('0x26')];}_0x3ba092[_0x7d11('0x19')](_0x59cdba)[_0x7d11('0x27')](_0x180e1e);};}exports['index']=function(_0x601650,_0x35a789){var _0x18c049={},_0x38f1be={},_0x4c7d6a={'count':0x0,'rows':[]};var _0x1a7745=_['map'](db[_0x7d11('0x28')]['rawAttributes'],function(_0x31866d){return{'name':_0x31866d[_0x7d11('0x29')],'type':_0x31866d[_0x7d11('0x2a')]['key']};});_0x38f1be['model']=_[_0x7d11('0x2b')](_0x1a7745,_0x7d11('0x26'));_0x38f1be['query']=_[_0x7d11('0x2c')](_0x601650[_0x7d11('0x2d')]);_0x38f1be[_0x7d11('0x2e')]=_['intersection'](_0x38f1be[_0x7d11('0x2f')],_0x38f1be['query']);_0x18c049['attributes']=_[_0x7d11('0x30')](_0x38f1be['model'],qs[_0x7d11('0x31')](_0x601650[_0x7d11('0x2d')][_0x7d11('0x31')]));_0x18c049[_0x7d11('0x32')]=_0x18c049['attributes'][_0x7d11('0x33')]?_0x18c049[_0x7d11('0x32')]:_0x38f1be['model'];if(!_0x601650['query'][_0x7d11('0x34')](_0x7d11('0x35'))){_0x18c049['limit']=qs[_0x7d11('0x1d')](_0x601650['query']['limit']);_0x18c049[_0x7d11('0x1b')]=qs['offset'](_0x601650['query'][_0x7d11('0x1b')]);}_0x18c049[_0x7d11('0x36')]=qs[_0x7d11('0x37')](_0x601650[_0x7d11('0x2d')][_0x7d11('0x37')]);_0x18c049[_0x7d11('0x38')]=qs[_0x7d11('0x2e')](_[_0x7d11('0x39')](_0x601650[_0x7d11('0x2d')],_0x38f1be[_0x7d11('0x2e')]),_0x1a7745);if(_0x601650[_0x7d11('0x2d')][_0x7d11('0x3a')]){_0x18c049['where']=_[_0x7d11('0x3b')](_0x18c049['where'],{'$or':_[_0x7d11('0x2b')](_0x1a7745,function(_0x111e26){if(_0x111e26[_0x7d11('0x2a')]!==_0x7d11('0x3c')){var _0x4f8fd2={};_0x4f8fd2[_0x111e26[_0x7d11('0x26')]]={'$like':'%'+_0x601650[_0x7d11('0x2d')][_0x7d11('0x3a')]+'%'};return _0x4f8fd2;}})});}_0x18c049=_[_0x7d11('0x3b')]({},_0x18c049,_0x601650['options']);var _0x22730e={'where':_0x18c049['where']};return db[_0x7d11('0x28')]['count'](_0x22730e)[_0x7d11('0x22')](function(_0x622725){_0x4c7d6a[_0x7d11('0x3d')]=_0x622725;if(_0x601650[_0x7d11('0x2d')]['includeAll']){_0x18c049['include']=[{'all':!![]}];}return db[_0x7d11('0x28')][_0x7d11('0x3e')](_0x18c049);})['then'](function(_0x1caef9){_0x4c7d6a[_0x7d11('0x3f')]=_0x1caef9;return _0x4c7d6a;})[_0x7d11('0x22')](respondWithFilteredResult(_0x35a789,_0x18c049))[_0x7d11('0x40')](handleError(_0x35a789,null));};exports[_0x7d11('0x41')]=function(_0x2e1647,_0x47e968){var _0x25b73b={'raw':!![],'where':{'id':_0x2e1647[_0x7d11('0x42')]['id']}},_0x5cf6a6={};_0x5cf6a6[_0x7d11('0x2f')]=_[_0x7d11('0x2c')](db[_0x7d11('0x28')][_0x7d11('0x43')]);_0x5cf6a6[_0x7d11('0x2d')]=_['keys'](_0x2e1647['query']);_0x5cf6a6['filters']=_[_0x7d11('0x30')](_0x5cf6a6[_0x7d11('0x2f')],_0x5cf6a6[_0x7d11('0x2d')]);_0x25b73b[_0x7d11('0x32')]=_[_0x7d11('0x30')](_0x5cf6a6['model'],qs[_0x7d11('0x31')](_0x2e1647[_0x7d11('0x2d')]['fields']));_0x25b73b[_0x7d11('0x32')]=_0x25b73b[_0x7d11('0x32')][_0x7d11('0x33')]?_0x25b73b['attributes']:_0x5cf6a6[_0x7d11('0x2f')];if(_0x2e1647[_0x7d11('0x2d')][_0x7d11('0x44')]){_0x25b73b['include']=[{'all':!![]}];}_0x25b73b=_[_0x7d11('0x3b')]({},_0x25b73b,_0x2e1647['options']);return db[_0x7d11('0x28')][_0x7d11('0x45')](_0x25b73b)[_0x7d11('0x22')](handleEntityNotFound(_0x47e968,null))[_0x7d11('0x22')](respondWithResult(_0x47e968,null))[_0x7d11('0x40')](handleError(_0x47e968,null));};exports[_0x7d11('0x46')]=function(_0x161213,_0x193631){return db[_0x7d11('0x28')]['describe']()['then'](respondWithResult(_0x193631,null))['catch'](handleError(_0x193631,null));};exports[_0x7d11('0x47')]=function(_0x1e5bb5,_0x20297a){if(_0x1e5bb5[_0x7d11('0x48')][_0x7d11('0x49')]){delete _0x1e5bb5[_0x7d11('0x48')][_0x7d11('0x49')];}return db[_0x7d11('0x28')][_0x7d11('0x45')]({'where':{'uniqueid':_0x1e5bb5[_0x7d11('0x42')]['id']}})[_0x7d11('0x22')](handleEntityNotFound(_0x20297a,null))[_0x7d11('0x22')](saveUpdates(_0x1e5bb5['body'],null))[_0x7d11('0x22')](respondWithResult(_0x20297a,null))[_0x7d11('0x40')](handleError(_0x20297a,null));};exports[_0x7d11('0x4a')]=function(_0x553a03,_0x503ebc,_0x14db1c){return db[_0x7d11('0x28')][_0x7d11('0x3e')]({'raw':![],'where':{'VoiceQueueId':_0x553a03['params']['id']},'attributes':[[db['sequelize']['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db['sequelize'][_0x7d11('0x4d')](_0x7d11('0x4e')))),_0x7d11('0x4f')],[db[_0x7d11('0x4c')]['fn']('COUNT',db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')]('`state`\x20=\x203,\x201,\x20null'))),'noAnswerContacts'],[db[_0x7d11('0x4c')]['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')]('`state`\x20=\x205,\x201,\x20null'))),_0x7d11('0x50')],[db[_0x7d11('0x4c')]['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db['sequelize']['literal'](_0x7d11('0x51')))),_0x7d11('0x52')],[db[_0x7d11('0x4c')]['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')](_0x7d11('0x53')))),_0x7d11('0x54')],[db[_0x7d11('0x4c')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x7d11('0x4d')](_0x7d11('0x55')))),_0x7d11('0x56')],[db['sequelize']['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')](_0x7d11('0x57')))),_0x7d11('0x58')],[db['sequelize']['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')]['literal']('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})['then'](handleEntityNotFound(_0x503ebc,null))[_0x7d11('0x22')](respondWithResult(_0x503ebc,null))['catch'](handleError(_0x503ebc,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x52d62d,_0x32c551,_0x12f05b){return db[_0x7d11('0x28')][_0x7d11('0x3e')]({'raw':![],'where':{'CampaignId':_0x52d62d[_0x7d11('0x42')]['id']},'attributes':[[db[_0x7d11('0x4c')]['fn']('COUNT',db[_0x7d11('0x4c')]['fn']('IF',db['sequelize'][_0x7d11('0x4d')]('`state`\x20=\x200,\x201,\x20null'))),_0x7d11('0x4f')],[db[_0x7d11('0x4c')]['fn']('COUNT',db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')](_0x7d11('0x59')))),'noAnswerContacts'],[db['sequelize']['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')](_0x7d11('0x5a')))),'busyContacts'],[db[_0x7d11('0x4c')]['fn']('COUNT',db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')](_0x7d11('0x51')))),'congestionContacts'],[db[_0x7d11('0x4c')]['fn']('COUNT',db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')](_0x7d11('0x53')))),_0x7d11('0x54')],[db[_0x7d11('0x4c')]['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')](_0x7d11('0x55')))),_0x7d11('0x56')],[db[_0x7d11('0x4c')]['fn'](_0x7d11('0x4b'),db['sequelize']['fn']('IF',db[_0x7d11('0x4c')]['literal'](_0x7d11('0x57')))),'reCallContacts'],[db[_0x7d11('0x4c')]['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')]['literal']('`state`\x20=\x2019,\x201,\x20null'))),_0x7d11('0x5b')]]})[_0x7d11('0x22')](handleEntityNotFound(_0x32c551,null))[_0x7d11('0x22')](respondWithResult(_0x32c551,null))['catch'](handleError(_0x32c551,null));};exports[_0x7d11('0x5c')]=function(_0x3c656b,_0x31cb39,_0x1b89de){return db[_0x7d11('0x5d')][_0x7d11('0x45')]({'where':{'id':_0x3c656b['params']['id']}})[_0x7d11('0x22')](handleEntityNotFound(_0x31cb39,null))['then'](function(_0x1fd598){var _0x4c88c6;if(_0x1fd598){_0x4c88c6=squel['insert']()[_0x7d11('0x5e')](_0x7d11('0x5f'))[_0x7d11('0x60')]([_0x7d11('0x61'),_0x7d11('0x62'),_0x7d11('0x63'),_0x7d11('0x64'),_0x7d11('0x65'),_0x7d11('0x66'),_0x7d11('0x67')],squel[_0x7d11('0x68')]()['field'](_0x7d11('0x69'),'phone')[_0x7d11('0x6a')](_0x7d11('0x6b'),_0x7d11('0x62'))[_0x7d11('0x6a')](_0x7d11('0x6c'),_0x7d11('0x63'))[_0x7d11('0x6a')]('ANY_VALUE(ListId)','ListId')[_0x7d11('0x6a')](_0x7d11('0x6d'),_0x7d11('0x65'))[_0x7d11('0x6a')](_0x7d11('0x6b'),'createdAt')[_0x7d11('0x6a')]('NOW()',_0x7d11('0x67'))[_0x7d11('0x6e')](_0x7d11('0x6f'))[_0x7d11('0x38')](_0x7d11('0x70'),_0x3c656b[_0x7d11('0x42')]['id'][_0x7d11('0x71')]())[_0x7d11('0x38')]('state\x20=\x20?',_0x3c656b['body'][_0x7d11('0x72')][_0x7d11('0x71')]())[_0x7d11('0x38')]('calleridnum\x20IS\x20NOT\x20NULL')['where'](_0x7d11('0x73'),squel['select']()[_0x7d11('0x6a')](_0x7d11('0x61'))[_0x7d11('0x6e')](_0x7d11('0x5f'))['where'](_0x7d11('0x70'),_0x3c656b[_0x7d11('0x42')]['id'][_0x7d11('0x71')]()))[_0x7d11('0x38')](_0x7d11('0x73'),squel[_0x7d11('0x68')]()[_0x7d11('0x6a')](_0x7d11('0x74'))['from'](_0x7d11('0x6f'))[_0x7d11('0x38')](_0x7d11('0x70'),_0x3c656b[_0x7d11('0x42')]['id'][_0x7d11('0x71')]())['where'](_0x7d11('0x75')))[_0x7d11('0x76')](_0x7d11('0x63')))[_0x7d11('0x71')]();return db[_0x7d11('0x4c')]['query'](_0x4c88c6);}return[];})['then'](respondWithResult(_0x31cb39,null))['catch'](handleError(_0x31cb39,null));};exports[_0x7d11('0x77')]=function(_0x4c15e9,_0x2a9e92,_0x5459d1){return db['Campaign'][_0x7d11('0x45')]({'where':{'id':_0x4c15e9[_0x7d11('0x42')]['id']}})[_0x7d11('0x22')](handleEntityNotFound(_0x2a9e92,null))[_0x7d11('0x22')](function(_0x345fb3){var _0x32a17a;if(_0x345fb3){_0x32a17a=squel[_0x7d11('0x78')]()[_0x7d11('0x5e')](_0x7d11('0x5f'))[_0x7d11('0x60')](['phone',_0x7d11('0x62'),_0x7d11('0x63'),'ListId',_0x7d11('0x79'),_0x7d11('0x66'),_0x7d11('0x67')],squel[_0x7d11('0x68')]()['field']('ANY_VALUE(calleridnum)',_0x7d11('0x61'))['field'](_0x7d11('0x6b'),_0x7d11('0x62'))[_0x7d11('0x6a')](_0x7d11('0x6c'),_0x7d11('0x63'))[_0x7d11('0x6a')](_0x7d11('0x7a'),'ListId')[_0x7d11('0x6a')](_0x7d11('0x7b'),_0x7d11('0x79'))[_0x7d11('0x6a')]('NOW()',_0x7d11('0x66'))[_0x7d11('0x6a')]('NOW()',_0x7d11('0x67'))[_0x7d11('0x6e')](_0x7d11('0x6f'))['where'](_0x7d11('0x7c'),_0x4c15e9[_0x7d11('0x42')]['id']['toString']())[_0x7d11('0x38')](_0x7d11('0x7d'),_0x4c15e9['body'][_0x7d11('0x72')]['toString']())['where']('calleridnum\x20IS\x20NOT\x20NULL')['where'](_0x7d11('0x73'),squel[_0x7d11('0x68')]()[_0x7d11('0x6a')](_0x7d11('0x61'))[_0x7d11('0x6e')](_0x7d11('0x5f'))[_0x7d11('0x38')](_0x7d11('0x7c'),_0x4c15e9[_0x7d11('0x42')]['id'][_0x7d11('0x71')]()))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x7d11('0x68')]()[_0x7d11('0x6a')]('calleridnum')['from'](_0x7d11('0x6f'))[_0x7d11('0x38')](_0x7d11('0x7c'),_0x4c15e9[_0x7d11('0x42')]['id']['toString']())['where']('state\x20=\x204'))[_0x7d11('0x76')](_0x7d11('0x63')))[_0x7d11('0x71')]();return db['sequelize'][_0x7d11('0x2d')](_0x32a17a);}return[];})[_0x7d11('0x22')](respondWithResult(_0x2a9e92,null))['catch'](handleError(_0x2a9e92,null));};exports[_0x7d11('0x7e')]=function(_0x1cb457,_0x59f0db,_0x5e5faf){return db[_0x7d11('0x7f')][_0x7d11('0x80')]({'where':{'VoiceQueueId':_0x1cb457['body']['VoiceQueueId'],'CampaignId':_0x1cb457[_0x7d11('0x48')][_0x7d11('0x79')],'ContactId':_0x1cb457[_0x7d11('0x48')][_0x7d11('0x63')]}})['then'](handleEntityNotFound(_0x59f0db,null))[_0x7d11('0x22')](function(_0x2cfa77){if(_0x2cfa77){return _0x2cfa77;}return null;})[_0x7d11('0x22')](respondWithResult(_0x59f0db,null))[_0x7d11('0x40')](handleError(_0x59f0db,null));}; \ No newline at end of file +var _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(_0x42f212,_0x5f2207){var _0x1c6f63=function(_0x364c0a){while(--_0x364c0a){_0x42f212['push'](_0x42f212['shift']());}};_0x1c6f63(++_0x5f2207);}(_0x0295,0x1f0));var _0x5029=function(_0x3f239d,_0x1e4675){_0x3f239d=_0x3f239d-0x0;var _0x46f035=_0x0295[_0x3f239d];return _0x46f035;};'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 0492cba..7a8971d 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 _0x3c4f=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x3c4f,0x9e));var _0xf3c4=function(_0x1b6e9f,_0x3ba66d){_0x1b6e9f=_0x1b6e9f-0x0;var _0x106df7=_0x3c4f[_0x1b6e9f];return _0x106df7;};'use strict';var _=require(_0xf3c4('0x0'));var util=require(_0xf3c4('0x1'));var logger=require(_0xf3c4('0x2'))(_0xf3c4('0x3'));var moment=require(_0xf3c4('0x4'));var BPromise=require(_0xf3c4('0x5'));var rp=require(_0xf3c4('0x6'));var fs=require('fs');var path=require(_0xf3c4('0x7'));var rimraf=require(_0xf3c4('0x8'));var config=require(_0xf3c4('0x9'));var attributes=require(_0xf3c4('0xa'));module['exports']=function(_0x5868b9,_0x364f81){return _0x5868b9[_0xf3c4('0xb')](_0xf3c4('0xc'),attributes,{'tableName':_0xf3c4('0xd'),'paranoid':![],'indexes':[{'name':_0xf3c4('0xe'),'fields':['calleridnum']},{'name':'uniqueid','fields':[_0xf3c4('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5da3=['../../config/environment','./cmHopperFinal.attributes','define','CmHopperFinal','calleridnum','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x55d82c,_0x56dafb){var _0x3820ab=function(_0x265cc1){while(--_0x265cc1){_0x55d82c['push'](_0x55d82c['shift']());}};_0x3820ab(++_0x56dafb);}(_0x5da3,0x1b3));var _0x35da=function(_0x54a529,_0x14374b){_0x54a529=_0x54a529-0x0;var _0x2a9bb1=_0x5da3[_0x54a529];return _0x2a9bb1;};'use strict';var _=require(_0x35da('0x0'));var util=require(_0x35da('0x1'));var logger=require(_0x35da('0x2'))(_0x35da('0x3'));var moment=require('moment');var BPromise=require(_0x35da('0x4'));var rp=require(_0x35da('0x5'));var fs=require('fs');var path=require(_0x35da('0x6'));var rimraf=require('rimraf');var config=require(_0x35da('0x7'));var attributes=require(_0x35da('0x8'));module['exports']=function(_0x5e4a24,_0x42a13f){return _0x5e4a24[_0x35da('0x9')](_0x35da('0xa'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0x35da('0xb'),'fields':[_0x35da('0xb')]},{'name':_0x35da('0xc'),'fields':[_0x35da('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 94239cf..8b01cde 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x5aeab1,_0x180a07){var _0x3ed227=function(_0x105fcf){while(--_0x105fcf){_0x5aeab1['push'](_0x5aeab1['shift']());}};_0x3ed227(++_0x180a07);}(_0x7a54,0x106));var _0x47a5=function(_0x19259f,_0x3541bf){_0x19259f=_0x19259f-0x0;var _0x18ccaa=_0x7a54[_0x19259f];return _0x18ccaa;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x52ab94,_0x4d3f94){var _0xb7284c=function(_0x1aa207){while(--_0x1aa207){_0x52ab94['push'](_0x52ab94['shift']());}};_0xb7284c(++_0x4d3f94);}(_0xb10b,0x12a));var _0xbb10=function(_0x25979f,_0x32a3eb){_0x25979f=_0x25979f-0x0;var _0x4de4e7=_0xb10b[_0x25979f];return _0x4de4e7;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 9a944d4..17dc1a9 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 _0xc50c=['moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/voice/queue/countAttributes/:id','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0xc50c,0x11d));var _0xcc50=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0xc50c[_0x599f41];return _0x2e4d58;};'use strict';var multer=require(_0xcc50('0x0'));var util=require(_0xcc50('0x1'));var path=require(_0xcc50('0x2'));var timeout=require(_0xcc50('0x3'));var express=require(_0xcc50('0x4'));var router=express[_0xcc50('0x5')]();var fs_extra=require(_0xcc50('0x6'));var auth=require(_0xcc50('0x7'));var interaction=require(_0xcc50('0x8'));var config=require(_0xcc50('0x9'));var controller=require(_0xcc50('0xa'));router[_0xcc50('0xb')]('/',auth['isAuthenticated'](),controller[_0xcc50('0xc')]);router[_0xcc50('0xb')](_0xcc50('0xd'),auth[_0xcc50('0xe')](),controller[_0xcc50('0xf')]);router['get'](_0xcc50('0x10'),auth[_0xcc50('0xe')](),controller[_0xcc50('0x11')]);router[_0xcc50('0xb')](_0xcc50('0x12'),auth[_0xcc50('0xe')](),controller['countContactsQueueCampaignHopperFinal']);router[_0xcc50('0xb')](_0xcc50('0x13'),auth[_0xcc50('0xe')](),controller[_0xcc50('0x14')]);router[_0xcc50('0x15')](_0xcc50('0x16'),auth[_0xcc50('0xe')](),controller[_0xcc50('0x17')]);router[_0xcc50('0x15')](_0xcc50('0x18'),auth[_0xcc50('0xe')](),controller[_0xcc50('0x19')]);router[_0xcc50('0x15')](_0xcc50('0x1a'),auth['isAuthenticated'](),controller[_0xcc50('0x1b')]);router[_0xcc50('0x1c')](_0xcc50('0x10'),auth[_0xcc50('0xe')](),controller[_0xcc50('0x1d')]);module[_0xcc50('0x1e')]=router; \ No newline at end of file +var _0x269b=['checkContactHopper','put','/:id','update','multer','path','connect-timeout','express','Router','../../components/auth/service','get','isAuthenticated','index','/describe','describe','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper'];(function(_0x5bb818,_0x57780a){var _0xc56b13=function(_0x3de0a8){while(--_0x3de0a8){_0x5bb818['push'](_0x5bb818['shift']());}};_0xc56b13(++_0x57780a);}(_0x269b,0x9a));var _0xb269=function(_0xffa65c,_0x3aa2f3){_0xffa65c=_0xffa65c-0x0;var _0x2157ad=_0x269b[_0xffa65c];return _0x2157ad;};'use strict';var multer=require(_0xb269('0x0'));var util=require('util');var path=require(_0xb269('0x1'));var timeout=require(_0xb269('0x2'));var express=require(_0xb269('0x3'));var router=express[_0xb269('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb269('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmHopperFinal.controller');router[_0xb269('0x6')]('/',auth[_0xb269('0x7')](),controller[_0xb269('0x8')]);router[_0xb269('0x6')](_0xb269('0x9'),auth[_0xb269('0x7')](),controller[_0xb269('0xa')]);router['get']('/:id',auth[_0xb269('0x7')](),controller[_0xb269('0xb')]);router[_0xb269('0x6')](_0xb269('0xc'),auth[_0xb269('0x7')](),controller[_0xb269('0xd')]);router[_0xb269('0x6')](_0xb269('0xe'),auth[_0xb269('0x7')](),controller[_0xb269('0xf')]);router[_0xb269('0x10')](_0xb269('0x11'),auth[_0xb269('0x7')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0xb269('0x10')](_0xb269('0x12'),auth[_0xb269('0x7')](),controller[_0xb269('0x13')]);router[_0xb269('0x10')](_0xb269('0x14'),auth['isAuthenticated'](),controller[_0xb269('0x15')]);router[_0xb269('0x16')](_0xb269('0x17'),auth[_0xb269('0x7')](),controller[_0xb269('0x18')]);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 0134604..2eef9f0 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 _0x6c41=['BOOLEAN','sequelize','exports','INTEGER','STRING','DATE'];(function(_0x2f0580,_0x25404f){var _0x1a3a28=function(_0x1af248){while(--_0x1af248){_0x2f0580['push'](_0x2f0580['shift']());}};_0x1a3a28(++_0x25404f);}(_0x6c41,0x10f));var _0x16c4=function(_0x260b48,_0x117977){_0x260b48=_0x260b48-0x0;var _0x3f730b=_0x6c41[_0x260b48];return _0x3f730b;};'use strict';var Sequelize=require(_0x16c4('0x0'));module[_0x16c4('0x1')]={'state':{'type':Sequelize[_0x16c4('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x16c4('0x3')]},'scheduledat':{'type':Sequelize[_0x16c4('0x4')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x16c4('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x16c4('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x16c4('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x16c4('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x16c4('0x3')]},'originatecalleridname':{'type':Sequelize[_0x16c4('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x16c4('0x3')]},'starttime':{'type':Sequelize[_0x16c4('0x4')]},'responsetime':{'type':Sequelize[_0x16c4('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x16c4('0x4')]},'endtime':{'type':Sequelize[_0x16c4('0x4')]},'ringtime':{'type':Sequelize[_0x16c4('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x16c4('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x16c4('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x16c4('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x16c4('0x3')]},'campaign':{'type':Sequelize[_0x16c4('0x3')]},'campaigntype':{'type':Sequelize[_0x16c4('0x3')]},'membername':{'type':Sequelize[_0x16c4('0x3')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x16c4('0x5')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x16c4('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x16c4('0x4')]},'recallme':{'type':Sequelize[_0x16c4('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0x16c4('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x16c4('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x16c4('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x16c4('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x16c4('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x16c4('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2f9a=['STRING','DATE','BOOLEAN','sequelize','exports','INTEGER'];(function(_0x32b449,_0x2afed0){var _0x24c3dc=function(_0x2216e0){while(--_0x2216e0){_0x32b449['push'](_0x32b449['shift']());}};_0x24c3dc(++_0x2afed0);}(_0x2f9a,0x75));var _0xa2f9=function(_0x1415ef,_0x5c219e){_0x1415ef=_0x1415ef-0x0;var _0x234acc=_0x2f9a[_0x1415ef];return _0x234acc;};'use strict';var Sequelize=require(_0xa2f9('0x0'));module[_0xa2f9('0x1')]={'state':{'type':Sequelize[_0xa2f9('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xa2f9('0x3')]},'scheduledat':{'type':Sequelize[_0xa2f9('0x4')]},'countbusyretry':{'type':Sequelize[_0xa2f9('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xa2f9('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xa2f9('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xa2f9('0x3')]},'originatecalleridnum':{'type':Sequelize[_0xa2f9('0x3')]},'originatecalleridname':{'type':Sequelize[_0xa2f9('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xa2f9('0x3')]},'starttime':{'type':Sequelize[_0xa2f9('0x4')]},'responsetime':{'type':Sequelize[_0xa2f9('0x4')]},'answertime':{'type':Sequelize[_0xa2f9('0x4')]},'droptime':{'type':Sequelize[_0xa2f9('0x4')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xa2f9('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xa2f9('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xa2f9('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xa2f9('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xa2f9('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xa2f9('0x3')]},'membername':{'type':Sequelize[_0xa2f9('0x3')]},'reason':{'type':Sequelize[_0xa2f9('0x3')]},'amd':{'type':Sequelize[_0xa2f9('0x5')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xa2f9('0x4')]},'recallme':{'type':Sequelize[_0xa2f9('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xa2f9('0x4')]},'edited':{'type':Sequelize[_0xa2f9('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xa2f9('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xa2f9('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xa2f9('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xa2f9('0x2')],'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 e9cec3a..c1d2bdf 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 _0x21dc=['desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','apply','reject','save','then','destroy','end','error','stack','name','send','map','CmHopperHistory','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','sox','ejs','lodash','squel','crypto','jsforce'];(function(_0x272638,_0x53c9ea){var _0x5a5739=function(_0xb23dde){while(--_0xb23dde){_0x272638['push'](_0x272638['shift']());}};_0x5a5739(++_0x53c9ea);}(_0x21dc,0x114));var _0xc21d=function(_0x1f0c75,_0x34aa4b){_0x1f0c75=_0x1f0c75-0x0;var _0x3e1fc0=_0x21dc[_0x1f0c75];return _0x3e1fc0;};'use strict';var emlformat=require(_0xc21d('0x0'));var rimraf=require(_0xc21d('0x1'));var zipdir=require(_0xc21d('0x2'));var jsonpatch=require(_0xc21d('0x3'));var rp=require(_0xc21d('0x4'));var moment=require('moment');var BPromise=require(_0xc21d('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xc21d('0x6'));var csv=require('to-csv');var ejs=require(_0xc21d('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc21d('0x8'));var squel=require(_0xc21d('0x9'));var crypto=require(_0xc21d('0xa'));var jsforce=require(_0xc21d('0xb'));var deskjs=require(_0xc21d('0xc'));var toCsv=require(_0xc21d('0xd'));var querystring=require(_0xc21d('0xe'));var Papa=require('papaparse');var Redis=require(_0xc21d('0xf'));var authService=require(_0xc21d('0x10'));var qs=require(_0xc21d('0x11'));var as=require(_0xc21d('0x12'));var hardwareService=require(_0xc21d('0x13'));var logger=require(_0xc21d('0x14'))(_0xc21d('0x15'));var utils=require(_0xc21d('0x16'));var config=require(_0xc21d('0x17'));var licenseUtil=require(_0xc21d('0x18'));var db=require(_0xc21d('0x19'))['db'];function respondWithStatusCode(_0xfc31c6,_0x55f204){_0x55f204=_0x55f204||0xcc;return function(_0x167fd1){if(_0x167fd1){return _0xfc31c6[_0xc21d('0x1a')](_0x55f204);}return _0xfc31c6[_0xc21d('0x1b')](_0x55f204)['end']();};}function respondWithResult(_0x25e004,_0x34bba6){_0x34bba6=_0x34bba6||0xc8;return function(_0x10b32e){if(_0x10b32e){return _0x25e004[_0xc21d('0x1b')](_0x34bba6)[_0xc21d('0x1c')](_0x10b32e);}};}function respondWithFilteredResult(_0x12c710,_0x39e3ab){return function(_0x11efaa){if(_0x11efaa){var _0x55201e=typeof _0x39e3ab[_0xc21d('0x1d')]===_0xc21d('0x1e')&&typeof _0x39e3ab[_0xc21d('0x1f')]==='undefined';var _0x4dbb8e=_0x11efaa[_0xc21d('0x20')];var _0x47d681=_0x55201e?0x0:_0x39e3ab[_0xc21d('0x1d')];var _0x20adb3=_0x55201e?_0x11efaa['count']:_0x39e3ab[_0xc21d('0x1d')]+_0x39e3ab[_0xc21d('0x1f')];var _0x501fc7;if(_0x20adb3>=_0x4dbb8e){_0x20adb3=_0x4dbb8e;_0x501fc7=0xc8;}else{_0x501fc7=0xce;}_0x12c710[_0xc21d('0x1b')](_0x501fc7);return _0x12c710['set']('Content-Range',_0x47d681+'-'+_0x20adb3+'/'+_0x4dbb8e)[_0xc21d('0x1c')](_0x11efaa);}return null;};}function patchUpdates(_0x9d7cd){return function(_0x57dd13){try{jsonpatch[_0xc21d('0x21')](_0x57dd13,_0x9d7cd,!![]);}catch(_0x1f2b38){return BPromise[_0xc21d('0x22')](_0x1f2b38);}return _0x57dd13[_0xc21d('0x23')]();};}function saveUpdates(_0x57c653,_0x49bceb){return function(_0x3f58e0){if(_0x3f58e0){return _0x3f58e0['update'](_0x57c653)[_0xc21d('0x24')](function(_0x4185c3){return _0x4185c3;});}return null;};}function removeEntity(_0x507a24,_0x39f961){return function(_0x3e2d10){if(_0x3e2d10){return _0x3e2d10[_0xc21d('0x25')]()[_0xc21d('0x24')](function(){_0x507a24[_0xc21d('0x1b')](0xcc)[_0xc21d('0x26')]();});}};}function handleEntityNotFound(_0xae45d3,_0x1bcf5b){return function(_0x4ca444){if(!_0x4ca444){_0xae45d3[_0xc21d('0x1a')](0x194);}return _0x4ca444;};}function handleError(_0x401fbe,_0x418ef4){_0x418ef4=_0x418ef4||0x1f4;return function(_0x25d3f9){logger[_0xc21d('0x27')](_0x25d3f9[_0xc21d('0x28')]);if(_0x25d3f9['name']){delete _0x25d3f9[_0xc21d('0x29')];}_0x401fbe['status'](_0x418ef4)[_0xc21d('0x2a')](_0x25d3f9);};}exports['index']=function(_0x544ba6,_0x2f142f){var _0x27ca0e={},_0xd9a1bb={},_0x1589b1={'count':0x0,'rows':[]};var _0x3c1622=_[_0xc21d('0x2b')](db[_0xc21d('0x2c')]['rawAttributes'],function(_0x355bdd){return{'name':_0x355bdd['fieldName'],'type':_0x355bdd[_0xc21d('0x2d')][_0xc21d('0x2e')]};});_0xd9a1bb[_0xc21d('0x2f')]=_[_0xc21d('0x2b')](_0x3c1622,_0xc21d('0x29'));_0xd9a1bb[_0xc21d('0x30')]=_[_0xc21d('0x31')](_0x544ba6[_0xc21d('0x30')]);_0xd9a1bb['filters']=_['intersection'](_0xd9a1bb[_0xc21d('0x2f')],_0xd9a1bb[_0xc21d('0x30')]);_0x27ca0e[_0xc21d('0x32')]=_[_0xc21d('0x33')](_0xd9a1bb[_0xc21d('0x2f')],qs[_0xc21d('0x34')](_0x544ba6[_0xc21d('0x30')]['fields']));_0x27ca0e['attributes']=_0x27ca0e[_0xc21d('0x32')]['length']?_0x27ca0e[_0xc21d('0x32')]:_0xd9a1bb[_0xc21d('0x2f')];if(!_0x544ba6[_0xc21d('0x30')][_0xc21d('0x35')](_0xc21d('0x36'))){_0x27ca0e[_0xc21d('0x1f')]=qs[_0xc21d('0x1f')](_0x544ba6[_0xc21d('0x30')][_0xc21d('0x1f')]);_0x27ca0e[_0xc21d('0x1d')]=qs['offset'](_0x544ba6[_0xc21d('0x30')][_0xc21d('0x1d')]);}_0x27ca0e[_0xc21d('0x37')]=qs[_0xc21d('0x38')](_0x544ba6['query'][_0xc21d('0x38')]);_0x27ca0e[_0xc21d('0x39')]=qs[_0xc21d('0x3a')](_['pick'](_0x544ba6[_0xc21d('0x30')],_0xd9a1bb[_0xc21d('0x3a')]),_0x3c1622);if(_0x544ba6['query'][_0xc21d('0x3b')]){_0x27ca0e[_0xc21d('0x39')]=_[_0xc21d('0x3c')](_0x27ca0e['where'],{'$or':_[_0xc21d('0x2b')](_0x3c1622,function(_0x59e7a2){if(_0x59e7a2[_0xc21d('0x2d')]!==_0xc21d('0x3d')){var _0x272bff={};_0x272bff[_0x59e7a2[_0xc21d('0x29')]]={'$like':'%'+_0x544ba6[_0xc21d('0x30')][_0xc21d('0x3b')]+'%'};return _0x272bff;}})});}_0x27ca0e=_[_0xc21d('0x3c')]({},_0x27ca0e,_0x544ba6[_0xc21d('0x3e')]);var _0x348a0c={'where':_0x27ca0e[_0xc21d('0x39')]};return db['CmHopperHistory'][_0xc21d('0x20')](_0x348a0c)[_0xc21d('0x24')](function(_0x168352){_0x1589b1[_0xc21d('0x20')]=_0x168352;if(_0x544ba6[_0xc21d('0x30')][_0xc21d('0x3f')]){_0x27ca0e[_0xc21d('0x40')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x27ca0e);})[_0xc21d('0x24')](function(_0x19680b){_0x1589b1['rows']=_0x19680b;return _0x1589b1;})[_0xc21d('0x24')](respondWithFilteredResult(_0x2f142f,_0x27ca0e))[_0xc21d('0x41')](handleError(_0x2f142f,null));};exports[_0xc21d('0x42')]=function(_0x408b0a,_0x56abcc){var _0x58cbab={'raw':!![],'where':{'id':_0x408b0a[_0xc21d('0x43')]['id']}},_0x2f4b55={};_0x2f4b55['model']=_[_0xc21d('0x31')](db[_0xc21d('0x2c')]['rawAttributes']);_0x2f4b55[_0xc21d('0x30')]=_[_0xc21d('0x31')](_0x408b0a[_0xc21d('0x30')]);_0x2f4b55[_0xc21d('0x3a')]=_[_0xc21d('0x33')](_0x2f4b55[_0xc21d('0x2f')],_0x2f4b55[_0xc21d('0x30')]);_0x58cbab[_0xc21d('0x32')]=_[_0xc21d('0x33')](_0x2f4b55[_0xc21d('0x2f')],qs[_0xc21d('0x34')](_0x408b0a[_0xc21d('0x30')]['fields']));_0x58cbab['attributes']=_0x58cbab['attributes']['length']?_0x58cbab[_0xc21d('0x32')]:_0x2f4b55[_0xc21d('0x2f')];if(_0x408b0a['query'][_0xc21d('0x3f')]){_0x58cbab[_0xc21d('0x40')]=[{'all':!![]}];}_0x58cbab=_[_0xc21d('0x3c')]({},_0x58cbab,_0x408b0a[_0xc21d('0x3e')]);return db[_0xc21d('0x2c')][_0xc21d('0x44')](_0x58cbab)[_0xc21d('0x24')](handleEntityNotFound(_0x56abcc,null))[_0xc21d('0x24')](respondWithResult(_0x56abcc,null))[_0xc21d('0x41')](handleError(_0x56abcc,null));};exports[_0xc21d('0x45')]=function(_0x29a79f,_0x156e94){return db[_0xc21d('0x2c')][_0xc21d('0x45')](_0x29a79f[_0xc21d('0x46')],{})[_0xc21d('0x24')](respondWithResult(_0x156e94,0xc9))['catch'](handleError(_0x156e94,null));};exports['describe']=function(_0xa65b,_0x52b1b7){return db[_0xc21d('0x2c')]['describe']()[_0xc21d('0x24')](respondWithResult(_0x52b1b7,null))[_0xc21d('0x41')](handleError(_0x52b1b7,null));};exports['update']=function(_0x42a070,_0x31c521){if(_0x42a070[_0xc21d('0x46')][_0xc21d('0x47')]){delete _0x42a070[_0xc21d('0x46')]['uniqueid'];}return db[_0xc21d('0x2c')][_0xc21d('0x44')]({'where':{'uniqueid':_0x42a070[_0xc21d('0x43')]['id']}})[_0xc21d('0x24')](handleEntityNotFound(_0x31c521,null))[_0xc21d('0x24')](saveUpdates(_0x42a070[_0xc21d('0x46')],null))[_0xc21d('0x24')](respondWithResult(_0x31c521,null))[_0xc21d('0x41')](handleError(_0x31c521,null));}; \ No newline at end of file +var _0x1b8c=['bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','then','error','stack','name','index','map','CmHopperHistory','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','create','body','describe','update','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','moment'];(function(_0x59c590,_0x5d31d8){var _0x20d222=function(_0x277d34){while(--_0x277d34){_0x59c590['push'](_0x59c590['shift']());}};_0x20d222(++_0x5d31d8);}(_0x1b8c,0x97));var _0xc1b8=function(_0x4e2f7f,_0x501e5b){_0x4e2f7f=_0x4e2f7f-0x0;var _0xf0060=_0x1b8c[_0x4e2f7f];return _0xf0060;};'use strict';var emlformat=require(_0xc1b8('0x0'));var rimraf=require(_0xc1b8('0x1'));var zipdir=require(_0xc1b8('0x2'));var jsonpatch=require(_0xc1b8('0x3'));var rp=require('request-promise');var moment=require(_0xc1b8('0x4'));var BPromise=require(_0xc1b8('0x5'));var Mustache=require('mustache');var util=require(_0xc1b8('0x6'));var path=require('path');var sox=require(_0xc1b8('0x7'));var csv=require(_0xc1b8('0x8'));var ejs=require(_0xc1b8('0x9'));var fs=require('fs');var fs_extra=require(_0xc1b8('0xa'));var _=require(_0xc1b8('0xb'));var squel=require(_0xc1b8('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc1b8('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc1b8('0xe'));var Papa=require(_0xc1b8('0xf'));var Redis=require(_0xc1b8('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xc1b8('0x11'));var as=require(_0xc1b8('0x12'));var hardwareService=require(_0xc1b8('0x13'));var logger=require('../../config/logger')(_0xc1b8('0x14'));var utils=require(_0xc1b8('0x15'));var config=require(_0xc1b8('0x16'));var licenseUtil=require(_0xc1b8('0x17'));var db=require(_0xc1b8('0x18'))['db'];function respondWithStatusCode(_0x325214,_0xeb1926){_0xeb1926=_0xeb1926||0xcc;return function(_0x5965ba){if(_0x5965ba){return _0x325214[_0xc1b8('0x19')](_0xeb1926);}return _0x325214['status'](_0xeb1926)[_0xc1b8('0x1a')]();};}function respondWithResult(_0x40bc5e,_0x9f34a1){_0x9f34a1=_0x9f34a1||0xc8;return function(_0x5ddda3){if(_0x5ddda3){return _0x40bc5e[_0xc1b8('0x1b')](_0x9f34a1)[_0xc1b8('0x1c')](_0x5ddda3);}};}function respondWithFilteredResult(_0x382b2f,_0x12d528){return function(_0x4fca87){if(_0x4fca87){var _0x389556=typeof _0x12d528[_0xc1b8('0x1d')]===_0xc1b8('0x1e')&&typeof _0x12d528[_0xc1b8('0x1f')]===_0xc1b8('0x1e');var _0x1f774b=_0x4fca87[_0xc1b8('0x20')];var _0x5c5cc0=_0x389556?0x0:_0x12d528[_0xc1b8('0x1d')];var _0x491024=_0x389556?_0x4fca87['count']:_0x12d528[_0xc1b8('0x1d')]+_0x12d528[_0xc1b8('0x1f')];var _0xa234af;if(_0x491024>=_0x1f774b){_0x491024=_0x1f774b;_0xa234af=0xc8;}else{_0xa234af=0xce;}_0x382b2f[_0xc1b8('0x1b')](_0xa234af);return _0x382b2f[_0xc1b8('0x21')]('Content-Range',_0x5c5cc0+'-'+_0x491024+'/'+_0x1f774b)[_0xc1b8('0x1c')](_0x4fca87);}return null;};}function patchUpdates(_0x47fcc9){return function(_0x364d){try{jsonpatch[_0xc1b8('0x22')](_0x364d,_0x47fcc9,!![]);}catch(_0x58f35f){return BPromise[_0xc1b8('0x23')](_0x58f35f);}return _0x364d[_0xc1b8('0x24')]();};}function saveUpdates(_0xbc34c5,_0xc3d4d4){return function(_0x246a8d){if(_0x246a8d){return _0x246a8d['update'](_0xbc34c5)[_0xc1b8('0x25')](function(_0x184c01){return _0x184c01;});}return null;};}function removeEntity(_0x584e02,_0x2970fb){return function(_0x546f01){if(_0x546f01){return _0x546f01['destroy']()[_0xc1b8('0x25')](function(){_0x584e02[_0xc1b8('0x1b')](0xcc)[_0xc1b8('0x1a')]();});}};}function handleEntityNotFound(_0xc845bc,_0x4ac343){return function(_0x89683d){if(!_0x89683d){_0xc845bc[_0xc1b8('0x19')](0x194);}return _0x89683d;};}function handleError(_0x519792,_0x488690){_0x488690=_0x488690||0x1f4;return function(_0x1cbb64){logger[_0xc1b8('0x26')](_0x1cbb64[_0xc1b8('0x27')]);if(_0x1cbb64[_0xc1b8('0x28')]){delete _0x1cbb64['name'];}_0x519792[_0xc1b8('0x1b')](_0x488690)['send'](_0x1cbb64);};}exports[_0xc1b8('0x29')]=function(_0x251a20,_0x24ce0a){var _0x146db5={},_0x11ac6c={},_0x3a47f3={'count':0x0,'rows':[]};var _0x5330c3=_[_0xc1b8('0x2a')](db[_0xc1b8('0x2b')][_0xc1b8('0x2c')],function(_0x153371){return{'name':_0x153371[_0xc1b8('0x2d')],'type':_0x153371[_0xc1b8('0x2e')][_0xc1b8('0x2f')]};});_0x11ac6c[_0xc1b8('0x30')]=_[_0xc1b8('0x2a')](_0x5330c3,_0xc1b8('0x28'));_0x11ac6c['query']=_[_0xc1b8('0x31')](_0x251a20[_0xc1b8('0x32')]);_0x11ac6c[_0xc1b8('0x33')]=_[_0xc1b8('0x34')](_0x11ac6c[_0xc1b8('0x30')],_0x11ac6c[_0xc1b8('0x32')]);_0x146db5[_0xc1b8('0x35')]=_[_0xc1b8('0x34')](_0x11ac6c[_0xc1b8('0x30')],qs[_0xc1b8('0x36')](_0x251a20['query'][_0xc1b8('0x36')]));_0x146db5[_0xc1b8('0x35')]=_0x146db5[_0xc1b8('0x35')][_0xc1b8('0x37')]?_0x146db5[_0xc1b8('0x35')]:_0x11ac6c[_0xc1b8('0x30')];if(!_0x251a20[_0xc1b8('0x32')][_0xc1b8('0x38')](_0xc1b8('0x39'))){_0x146db5[_0xc1b8('0x1f')]=qs[_0xc1b8('0x1f')](_0x251a20[_0xc1b8('0x32')][_0xc1b8('0x1f')]);_0x146db5[_0xc1b8('0x1d')]=qs['offset'](_0x251a20[_0xc1b8('0x32')]['offset']);}_0x146db5[_0xc1b8('0x3a')]=qs[_0xc1b8('0x3b')](_0x251a20[_0xc1b8('0x32')][_0xc1b8('0x3b')]);_0x146db5[_0xc1b8('0x3c')]=qs[_0xc1b8('0x33')](_[_0xc1b8('0x3d')](_0x251a20[_0xc1b8('0x32')],_0x11ac6c[_0xc1b8('0x33')]),_0x5330c3);if(_0x251a20['query'][_0xc1b8('0x3e')]){_0x146db5[_0xc1b8('0x3c')]=_[_0xc1b8('0x3f')](_0x146db5[_0xc1b8('0x3c')],{'$or':_['map'](_0x5330c3,function(_0x2a4ceb){if(_0x2a4ceb[_0xc1b8('0x2e')]!==_0xc1b8('0x40')){var _0x4d7cfe={};_0x4d7cfe[_0x2a4ceb[_0xc1b8('0x28')]]={'$like':'%'+_0x251a20['query'][_0xc1b8('0x3e')]+'%'};return _0x4d7cfe;}})});}_0x146db5=_['merge']({},_0x146db5,_0x251a20[_0xc1b8('0x41')]);var _0x2e0d7e={'where':_0x146db5[_0xc1b8('0x3c')]};return db[_0xc1b8('0x2b')][_0xc1b8('0x20')](_0x2e0d7e)[_0xc1b8('0x25')](function(_0x3fe4c9){_0x3a47f3[_0xc1b8('0x20')]=_0x3fe4c9;if(_0x251a20[_0xc1b8('0x32')][_0xc1b8('0x42')]){_0x146db5[_0xc1b8('0x43')]=[{'all':!![]}];}return db[_0xc1b8('0x2b')][_0xc1b8('0x44')](_0x146db5);})[_0xc1b8('0x25')](function(_0x5849d0){_0x3a47f3['rows']=_0x5849d0;return _0x3a47f3;})['then'](respondWithFilteredResult(_0x24ce0a,_0x146db5))['catch'](handleError(_0x24ce0a,null));};exports[_0xc1b8('0x45')]=function(_0x2e28ec,_0x4c59b7){var _0x37cf5f={'raw':!![],'where':{'id':_0x2e28ec[_0xc1b8('0x46')]['id']}},_0x36efd6={};_0x36efd6['model']=_[_0xc1b8('0x31')](db[_0xc1b8('0x2b')][_0xc1b8('0x2c')]);_0x36efd6['query']=_['keys'](_0x2e28ec[_0xc1b8('0x32')]);_0x36efd6[_0xc1b8('0x33')]=_['intersection'](_0x36efd6[_0xc1b8('0x30')],_0x36efd6[_0xc1b8('0x32')]);_0x37cf5f[_0xc1b8('0x35')]=_[_0xc1b8('0x34')](_0x36efd6['model'],qs[_0xc1b8('0x36')](_0x2e28ec[_0xc1b8('0x32')][_0xc1b8('0x36')]));_0x37cf5f[_0xc1b8('0x35')]=_0x37cf5f[_0xc1b8('0x35')]['length']?_0x37cf5f[_0xc1b8('0x35')]:_0x36efd6['model'];if(_0x2e28ec[_0xc1b8('0x32')][_0xc1b8('0x42')]){_0x37cf5f['include']=[{'all':!![]}];}_0x37cf5f=_[_0xc1b8('0x3f')]({},_0x37cf5f,_0x2e28ec[_0xc1b8('0x41')]);return db[_0xc1b8('0x2b')][_0xc1b8('0x47')](_0x37cf5f)[_0xc1b8('0x25')](handleEntityNotFound(_0x4c59b7,null))[_0xc1b8('0x25')](respondWithResult(_0x4c59b7,null))[_0xc1b8('0x48')](handleError(_0x4c59b7,null));};exports['create']=function(_0x5f5267,_0x13af00){return db[_0xc1b8('0x2b')][_0xc1b8('0x49')](_0x5f5267[_0xc1b8('0x4a')],{})[_0xc1b8('0x25')](respondWithResult(_0x13af00,0xc9))[_0xc1b8('0x48')](handleError(_0x13af00,null));};exports['describe']=function(_0x460d61,_0x4a3af8){return db[_0xc1b8('0x2b')][_0xc1b8('0x4b')]()[_0xc1b8('0x25')](respondWithResult(_0x4a3af8,null))[_0xc1b8('0x48')](handleError(_0x4a3af8,null));};exports[_0xc1b8('0x4c')]=function(_0x452138,_0x28f98d){if(_0x452138[_0xc1b8('0x4a')][_0xc1b8('0x4d')]){delete _0x452138[_0xc1b8('0x4a')][_0xc1b8('0x4d')];}return db[_0xc1b8('0x2b')][_0xc1b8('0x47')]({'where':{'uniqueid':_0x452138['params']['id']}})['then'](handleEntityNotFound(_0x28f98d,null))[_0xc1b8('0x25')](saveUpdates(_0x452138[_0xc1b8('0x4a')],null))[_0xc1b8('0x25')](respondWithResult(_0x28f98d,null))[_0xc1b8('0x48')](handleError(_0x28f98d,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 75c3a96..26930eb 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 _0xd232=['request-promise','../../config/environment','define','cm_hopper_history','endtime','uniqueid','lodash','../../config/logger','api','moment','bluebird'];(function(_0x19e57f,_0x4ae750){var _0x469556=function(_0xf6968b){while(--_0xf6968b){_0x19e57f['push'](_0x19e57f['shift']());}};_0x469556(++_0x4ae750);}(_0xd232,0x74));var _0x2d23=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd232[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2d23('0x0'));var util=require('util');var logger=require(_0x2d23('0x1'))(_0x2d23('0x2'));var moment=require(_0x2d23('0x3'));var BPromise=require(_0x2d23('0x4'));var rp=require(_0x2d23('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2d23('0x6'));var attributes=require('./cmHopperHistory.attributes');module['exports']=function(_0x1ddf08,_0x1662f2){return _0x1ddf08[_0x2d23('0x7')]('CmHopperHistory',attributes,{'tableName':_0x2d23('0x8'),'paranoid':![],'indexes':[{'name':'endtime','fields':[_0x2d23('0x9')]},{'name':_0x2d23('0xa'),'fields':[_0x2d23('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5324=['define','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports'];(function(_0x535c01,_0x547181){var _0x462ba5=function(_0x5b4797){while(--_0x5b4797){_0x535c01['push'](_0x535c01['shift']());}};_0x462ba5(++_0x547181);}(_0x5324,0x154));var _0x4532=function(_0x1d8245,_0x581db2){_0x1d8245=_0x1d8245-0x0;var _0x43e0f4=_0x5324[_0x1d8245];return _0x43e0f4;};'use strict';var _=require(_0x4532('0x0'));var util=require(_0x4532('0x1'));var logger=require(_0x4532('0x2'))(_0x4532('0x3'));var moment=require('moment');var BPromise=require(_0x4532('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4532('0x5'));var rimraf=require(_0x4532('0x6'));var config=require(_0x4532('0x7'));var attributes=require(_0x4532('0x8'));module[_0x4532('0x9')]=function(_0x3f68e2,_0x2672ec){return _0x3f68e2[_0x4532('0xa')]('CmHopperHistory',attributes,{'tableName':_0x4532('0xb'),'paranoid':![],'indexes':[{'name':_0x4532('0xc'),'fields':[_0x4532('0xc')]},{'name':_0x4532('0xd'),'fields':[_0x4532('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index f3a74bd..b121977 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 _0xdeb3=['outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','outboundReCallsDay','campaign','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','message','result','catch','CmHopperHistory','create','body','options','raw','CreateCmHopperHistory','stringify','AvgHandleTime','findAll','where','sequelize','COUNT','col','literal','`state`\x20=\x204,\x201,\x20null','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','name','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null'];(function(_0x2514a0,_0x45e3aa){var _0xfb63cf=function(_0x2be31e){while(--_0x2be31e){_0x2514a0['push'](_0x2514a0['shift']());}};_0xfb63cf(++_0x45e3aa);}(_0xdeb3,0xeb));var _0x3deb=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xdeb3[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x3deb('0x0'));var util=require(_0x3deb('0x1'));var moment=require(_0x3deb('0x2'));var BPromise=require(_0x3deb('0x3'));var rs=require(_0x3deb('0x4'));var fs=require('fs');var Redis=require(_0x3deb('0x5'));var db=require(_0x3deb('0x6'))['db'];var utils=require(_0x3deb('0x7'));var logger=require(_0x3deb('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3deb('0x9')][_0x3deb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c8e43,_0x14846f,_0xcaaef7){return new BPromise(function(_0x5ecf47,_0x571adc){return client[_0x3deb('0xb')](_0x3c8e43,_0xcaaef7)[_0x3deb('0xc')](function(_0x30bb01){logger[_0x3deb('0xd')](_0x3deb('0xe'),_0x14846f,_0x3deb('0xf'));logger[_0x3deb('0x10')](_0x3deb('0x11'),_0x14846f,'request\x20sent',JSON['stringify'](_0x30bb01));if(_0x30bb01['error']){if(_0x30bb01[_0x3deb('0x12')]['code']===0x1f4){logger[_0x3deb('0x12')](_0x3deb('0xe'),_0x14846f,_0x30bb01[_0x3deb('0x12')][_0x3deb('0x13')]);return _0x571adc(_0x30bb01['error'][_0x3deb('0x13')]);}logger[_0x3deb('0x12')](_0x3deb('0xe'),_0x14846f,_0x30bb01[_0x3deb('0x12')][_0x3deb('0x13')]);return _0x5ecf47(_0x30bb01[_0x3deb('0x12')][_0x3deb('0x13')]);}else{logger[_0x3deb('0xd')]('CmHopperHistory,\x20%s,\x20%s',_0x14846f,_0x3deb('0xf'));_0x5ecf47(_0x30bb01[_0x3deb('0x14')]['message']);}})[_0x3deb('0x15')](function(_0x35923e){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x14846f,_0x35923e);_0x571adc(_0x35923e);});});}exports['CreateCmHopperHistory']=function(_0x2a8ec4){var _0x2d8263=this;return new Promise(function(_0x4adbaa,_0x51e2b1){return db[_0x3deb('0x16')][_0x3deb('0x17')](_0x2a8ec4[_0x3deb('0x18')],{'raw':_0x2a8ec4[_0x3deb('0x19')]?_0x2a8ec4['options'][_0x3deb('0x1a')]===undefined?!![]:![]:!![]})[_0x3deb('0xc')](function(_0xbd82de){logger['info'](_0x3deb('0x1b'),_0x2a8ec4);logger[_0x3deb('0x10')](_0x3deb('0x1b'),_0x2a8ec4,JSON[_0x3deb('0x1c')](_0xbd82de));_0x4adbaa(_0xbd82de);})[_0x3deb('0x15')](function(_0x543014){logger[_0x3deb('0x12')](_0x3deb('0x1b'),_0x543014[_0x3deb('0x13')],_0x2a8ec4);_0x51e2b1(_0x2d8263[_0x3deb('0x12')](0x1f4,_0x543014[_0x3deb('0x13')]));});});};exports[_0x3deb('0x1d')]=function(_0x3f3d52){var _0x451ce6=this;return new Promise(function(_0x4de8ed,_0xd42d62){return db[_0x3deb('0x16')][_0x3deb('0x1e')]({'raw':_0x3f3d52[_0x3deb('0x19')]?_0x3f3d52[_0x3deb('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x3f3d52[_0x3deb('0x19')]?_0x3f3d52[_0x3deb('0x19')][_0x3deb('0x1f')]||null:null,'attributes':[[db[_0x3deb('0x20')]['fn'](_0x3deb('0x21'),db[_0x3deb('0x20')][_0x3deb('0x22')]('id')),'predictiveIntervalTotalCalls'],[db['sequelize']['fn'](_0x3deb('0x21'),db['sequelize']['fn']('IF',db[_0x3deb('0x20')][_0x3deb('0x23')](_0x3deb('0x24')))),'predictiveIntervalAnsweredCalls'],[db[_0x3deb('0x20')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x3deb('0x20')][_0x3deb('0x23')](_0x3deb('0x25')))),_0x3deb('0x26')],[db['sequelize']['fn']('COUNT',db[_0x3deb('0x20')]['fn']('IF',db[_0x3deb('0x20')]['literal']('`state`\x20=\x2011,\x201,\x20null'))),_0x3deb('0x27')],[db[_0x3deb('0x20')]['fn'](_0x3deb('0x28'),db['sequelize']['fn']('IF',db[_0x3deb('0x20')]['literal'](_0x3deb('0x29')))),_0x3deb('0x2a')],[db[_0x3deb('0x20')]['fn'](_0x3deb('0x28'),db[_0x3deb('0x20')]['fn']('IF',db[_0x3deb('0x20')][_0x3deb('0x23')](_0x3deb('0x2b')))),_0x3deb('0x2c')]]})[_0x3deb('0xc')](function(_0x5e5e33){logger[_0x3deb('0xd')](_0x3deb('0x1d'),_0x3f3d52);logger[_0x3deb('0x10')](_0x3deb('0x1d'),_0x3f3d52,JSON[_0x3deb('0x1c')](_0x5e5e33));_0x4de8ed(_0x5e5e33);})[_0x3deb('0x15')](function(_0x4854e7){logger[_0x3deb('0x12')](_0x3deb('0x1d'),_0x4854e7[_0x3deb('0x13')],_0x3f3d52);_0xd42d62(_0x451ce6[_0x3deb('0x12')](0x1f4,_0x4854e7[_0x3deb('0x13')]));});});};exports[_0x3deb('0x2d')]=function(_0x2828de){var _0x14e406=this;return new Promise(function(_0x3ecbcb,_0x4e0d5e){return db['CmHopperHistory'][_0x3deb('0x1e')]({'raw':_0x2828de[_0x3deb('0x19')]?_0x2828de[_0x3deb('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x2828de[_0x3deb('0x19')]?_0x2828de['options'][_0x3deb('0x1f')]||null:null,'attributes':[['campaign',_0x3deb('0x2e')],[db['sequelize']['fn'](_0x3deb('0x21'),db[_0x3deb('0x20')]['fn']('IF',db[_0x3deb('0x20')][_0x3deb('0x23')]('`state`\x20=\x200,\x201,\x20null'))),_0x3deb('0x2f')],[db['sequelize']['fn'](_0x3deb('0x21'),db[_0x3deb('0x20')]['fn']('IF',db[_0x3deb('0x20')][_0x3deb('0x23')](_0x3deb('0x30')))),_0x3deb('0x31')],[db[_0x3deb('0x20')]['fn'](_0x3deb('0x21'),db['sequelize']['fn']('IF',db[_0x3deb('0x20')]['literal']('`state`\x20=\x204,\x201,\x20null'))),'outboundAnswerCallsDay'],[db[_0x3deb('0x20')]['fn'](_0x3deb('0x21'),db[_0x3deb('0x20')]['fn']('IF',db[_0x3deb('0x20')][_0x3deb('0x23')](_0x3deb('0x32')))),_0x3deb('0x33')],[db['sequelize']['fn']('COUNT',db[_0x3deb('0x20')]['fn']('IF',db[_0x3deb('0x20')][_0x3deb('0x23')](_0x3deb('0x34')))),_0x3deb('0x35')],[db['sequelize']['fn'](_0x3deb('0x21'),db[_0x3deb('0x20')]['fn']('IF',db[_0x3deb('0x20')]['literal'](_0x3deb('0x36')))),_0x3deb('0x37')],[db[_0x3deb('0x20')]['fn'](_0x3deb('0x21'),db[_0x3deb('0x20')]['fn']('IF',db['sequelize'][_0x3deb('0x23')](_0x3deb('0x38')))),_0x3deb('0x39')],[db['sequelize']['fn']('COUNT',db[_0x3deb('0x20')]['fn']('IF',db[_0x3deb('0x20')][_0x3deb('0x23')](_0x3deb('0x3a')))),_0x3deb('0x3b')],[db['sequelize']['fn'](_0x3deb('0x21'),db[_0x3deb('0x20')]['fn']('IF',db[_0x3deb('0x20')][_0x3deb('0x23')](_0x3deb('0x3c')))),_0x3deb('0x3d')],[db[_0x3deb('0x20')]['fn'](_0x3deb('0x21'),db[_0x3deb('0x20')]['fn']('IF',db['sequelize'][_0x3deb('0x23')](_0x3deb('0x3e')))),_0x3deb('0x3f')],[db[_0x3deb('0x20')]['fn'](_0x3deb('0x21'),db['sequelize']['fn']('IF',db[_0x3deb('0x20')][_0x3deb('0x23')]('`state`\x20=\x2018,\x201,\x20null'))),'outboundRejectCallsDay'],[db['sequelize']['fn'](_0x3deb('0x21'),db[_0x3deb('0x20')]['fn']('IF',db['sequelize']['literal'](_0x3deb('0x40')))),_0x3deb('0x41')],[db[_0x3deb('0x20')]['fn'](_0x3deb('0x21'),db['sequelize']['fn']('IF',db[_0x3deb('0x20')][_0x3deb('0x23')](_0x3deb('0x42')))),_0x3deb('0x43')],[db[_0x3deb('0x20')]['fn'](_0x3deb('0x21'),db[_0x3deb('0x20')]['fn']('IF',db[_0x3deb('0x20')]['literal']('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0x3deb('0x44')]],'group':[_0x3deb('0x45')]})[_0x3deb('0xc')](function(_0x46a180){logger[_0x3deb('0xd')](_0x3deb('0x2d'),_0x2828de);logger[_0x3deb('0x10')](_0x3deb('0x2d'),_0x2828de,JSON[_0x3deb('0x1c')](_0x46a180));_0x3ecbcb(_0x46a180);})[_0x3deb('0x15')](function(_0x2111e0){logger[_0x3deb('0x12')](_0x3deb('0x2d'),_0x2111e0[_0x3deb('0x13')],_0x2828de);_0x4e0d5e(_0x14e406['error'](0x1f4,_0x2111e0['message']));});});};exports[_0x3deb('0x46')]=function(_0x4ba7c5){var _0x5e7ec8=this;return new Promise(function(_0x2007bd,_0x47357a){return db[_0x3deb('0x16')][_0x3deb('0x1e')]({'raw':_0x4ba7c5['options']?_0x4ba7c5[_0x3deb('0x19')][_0x3deb('0x1a')]===undefined?!![]:![]:!![],'where':_0x4ba7c5[_0x3deb('0x19')]?_0x4ba7c5[_0x3deb('0x19')][_0x3deb('0x1f')]||null:null,'attributes':[[_0x3deb('0x45'),_0x3deb('0x2e')],[db[_0x3deb('0x20')]['fn'](_0x3deb('0x21'),db[_0x3deb('0x20')][_0x3deb('0x22')]('id')),_0x3deb('0x47')],[db[_0x3deb('0x20')]['fn'](_0x3deb('0x21'),db[_0x3deb('0x20')]['fn']('IF',db[_0x3deb('0x20')]['literal'](_0x3deb('0x24')))),_0x3deb('0x48')]],'group':[_0x3deb('0x45')]})[_0x3deb('0xc')](function(_0x1ff1b9){logger['info'](_0x3deb('0x46'),_0x4ba7c5);logger['debug'](_0x3deb('0x46'),_0x4ba7c5,JSON[_0x3deb('0x1c')](_0x1ff1b9));_0x2007bd(_0x1ff1b9);})[_0x3deb('0x15')](function(_0x35e7ec){logger[_0x3deb('0x12')](_0x3deb('0x46'),_0x35e7ec['message'],_0x4ba7c5);_0x47357a(_0x5e7ec8[_0x3deb('0x12')](0x1f4,_0x35e7ec[_0x3deb('0x13')]));});});}; \ No newline at end of file +var _0x6931=['predictiveIntervalAnsweredCalls','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','COUNT','AVG','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','AvgHandleTime','GetVoiceQueueHopperHistory','where','campaign','name','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundAnswerAgiCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','findAll','sequelize','col','predictiveIntervalTotalCalls','`state`\x20=\x204,\x201,\x20null'];(function(_0xaa7629,_0x219723){var _0x487c07=function(_0x36959c){while(--_0x36959c){_0xaa7629['push'](_0xaa7629['shift']());}};_0x487c07(++_0x219723);}(_0x6931,0xa5));var _0x1693=function(_0x191dea,_0x4d46a9){_0x191dea=_0x191dea-0x0;var _0x2c5674=_0x6931[_0x191dea];return _0x2c5674;};'use strict';var _=require(_0x1693('0x0'));var util=require(_0x1693('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1693('0x2'));var fs=require('fs');var Redis=require(_0x1693('0x3'));var db=require(_0x1693('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1693('0x5'))(_0x1693('0x6'));var config=require(_0x1693('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1693('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3594e0,_0x45aa35,_0x328cfc){return new BPromise(function(_0x2ab0a0,_0x31bff8){return client[_0x1693('0x9')](_0x3594e0,_0x328cfc)[_0x1693('0xa')](function(_0x391134){logger[_0x1693('0xb')](_0x1693('0xc'),_0x45aa35,_0x1693('0xd'));logger[_0x1693('0xe')](_0x1693('0xf'),_0x45aa35,_0x1693('0xd'),JSON[_0x1693('0x10')](_0x391134));if(_0x391134[_0x1693('0x11')]){if(_0x391134['error'][_0x1693('0x12')]===0x1f4){logger['error'](_0x1693('0xc'),_0x45aa35,_0x391134[_0x1693('0x11')]['message']);return _0x31bff8(_0x391134[_0x1693('0x11')][_0x1693('0x13')]);}logger[_0x1693('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0x45aa35,_0x391134[_0x1693('0x11')][_0x1693('0x13')]);return _0x2ab0a0(_0x391134[_0x1693('0x11')][_0x1693('0x13')]);}else{logger[_0x1693('0xb')](_0x1693('0xc'),_0x45aa35,_0x1693('0xd'));_0x2ab0a0(_0x391134[_0x1693('0x14')][_0x1693('0x13')]);}})[_0x1693('0x15')](function(_0x59cbff){logger[_0x1693('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0x45aa35,_0x59cbff);_0x31bff8(_0x59cbff);});});}exports[_0x1693('0x16')]=function(_0x20906b){var _0x2ffa86=this;return new Promise(function(_0x410c3b,_0x3f5287){return db[_0x1693('0x17')][_0x1693('0x18')](_0x20906b[_0x1693('0x19')],{'raw':_0x20906b[_0x1693('0x1a')]?_0x20906b[_0x1693('0x1a')][_0x1693('0x1b')]===undefined?!![]:![]:!![]})[_0x1693('0xa')](function(_0x17c613){logger[_0x1693('0xb')](_0x1693('0x16'),_0x20906b);logger[_0x1693('0xe')]('CreateCmHopperHistory',_0x20906b,JSON[_0x1693('0x10')](_0x17c613));_0x410c3b(_0x17c613);})[_0x1693('0x15')](function(_0x5332ae){logger[_0x1693('0x11')](_0x1693('0x16'),_0x5332ae[_0x1693('0x13')],_0x20906b);_0x3f5287(_0x2ffa86[_0x1693('0x11')](0x1f4,_0x5332ae[_0x1693('0x13')]));});});};exports['AvgHandleTime']=function(_0x28749b){var _0x46311f=this;return new Promise(function(_0x400edc,_0x4e5d82){return db[_0x1693('0x17')][_0x1693('0x1c')]({'raw':_0x28749b['options']?_0x28749b[_0x1693('0x1a')][_0x1693('0x1b')]===undefined?!![]:![]:!![],'where':_0x28749b['options']?_0x28749b['options']['where']||null:null,'attributes':[[db[_0x1693('0x1d')]['fn']('COUNT',db[_0x1693('0x1d')][_0x1693('0x1e')]('id')),_0x1693('0x1f')],[db[_0x1693('0x1d')]['fn']('COUNT',db[_0x1693('0x1d')]['fn']('IF',db[_0x1693('0x1d')]['literal'](_0x1693('0x20')))),_0x1693('0x21')],[db[_0x1693('0x1d')]['fn']('COUNT',db[_0x1693('0x1d')]['fn']('IF',db[_0x1693('0x1d')][_0x1693('0x22')](_0x1693('0x23')))),_0x1693('0x24')],[db[_0x1693('0x1d')]['fn'](_0x1693('0x25'),db[_0x1693('0x1d')]['fn']('IF',db[_0x1693('0x1d')]['literal']('`state`\x20=\x2011,\x201,\x20null'))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0x1693('0x1d')]['fn'](_0x1693('0x26'),db['sequelize']['fn']('IF',db[_0x1693('0x1d')][_0x1693('0x22')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0x1693('0x27')],[db[_0x1693('0x1d')]['fn'](_0x1693('0x26'),db[_0x1693('0x1d')]['fn']('IF',db['sequelize'][_0x1693('0x22')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0x1693('0x28')]]})[_0x1693('0xa')](function(_0x4af172){logger[_0x1693('0xb')]('AvgHandleTime',_0x28749b);logger['debug']('AvgHandleTime',_0x28749b,JSON['stringify'](_0x4af172));_0x400edc(_0x4af172);})['catch'](function(_0x402f19){logger[_0x1693('0x11')](_0x1693('0x29'),_0x402f19['message'],_0x28749b);_0x4e5d82(_0x46311f[_0x1693('0x11')](0x1f4,_0x402f19[_0x1693('0x13')]));});});};exports[_0x1693('0x2a')]=function(_0x2b9744){var _0x29dabc=this;return new Promise(function(_0x3c15b9,_0x4b872e){return db[_0x1693('0x17')][_0x1693('0x1c')]({'raw':_0x2b9744[_0x1693('0x1a')]?_0x2b9744[_0x1693('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x2b9744[_0x1693('0x1a')]?_0x2b9744['options'][_0x1693('0x2b')]||null:null,'attributes':[[_0x1693('0x2c'),_0x1693('0x2d')],[db[_0x1693('0x1d')]['fn'](_0x1693('0x25'),db[_0x1693('0x1d')]['fn']('IF',db[_0x1693('0x1d')][_0x1693('0x22')]('`state`\x20=\x200,\x201,\x20null'))),'outboundNoSuchCallsDay'],[db[_0x1693('0x1d')]['fn'](_0x1693('0x25'),db['sequelize']['fn']('IF',db[_0x1693('0x1d')][_0x1693('0x22')](_0x1693('0x2e')))),_0x1693('0x2f')],[db[_0x1693('0x1d')]['fn']('COUNT',db[_0x1693('0x1d')]['fn']('IF',db[_0x1693('0x1d')]['literal'](_0x1693('0x20')))),_0x1693('0x30')],[db[_0x1693('0x1d')]['fn'](_0x1693('0x25'),db[_0x1693('0x1d')]['fn']('IF',db['sequelize'][_0x1693('0x22')](_0x1693('0x31')))),_0x1693('0x32')],[db[_0x1693('0x1d')]['fn'](_0x1693('0x25'),db[_0x1693('0x1d')]['fn']('IF',db['sequelize'][_0x1693('0x22')](_0x1693('0x33')))),_0x1693('0x34')],[db[_0x1693('0x1d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x1693('0x1d')][_0x1693('0x22')](_0x1693('0x35')))),'outboundDropCallsDayTimeout'],[db[_0x1693('0x1d')]['fn'](_0x1693('0x25'),db[_0x1693('0x1d')]['fn']('IF',db[_0x1693('0x1d')][_0x1693('0x22')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x1693('0x36')],[db[_0x1693('0x1d')]['fn']('COUNT',db[_0x1693('0x1d')]['fn']('IF',db[_0x1693('0x1d')][_0x1693('0x22')](_0x1693('0x37')))),_0x1693('0x38')],[db['sequelize']['fn'](_0x1693('0x25'),db['sequelize']['fn']('IF',db[_0x1693('0x1d')][_0x1693('0x22')](_0x1693('0x39')))),_0x1693('0x3a')],[db[_0x1693('0x1d')]['fn'](_0x1693('0x25'),db[_0x1693('0x1d')]['fn']('IF',db[_0x1693('0x1d')][_0x1693('0x22')]('`state`\x20=\x2014,\x201,\x20null'))),'outboundOriginateFailureCallsDay'],[db['sequelize']['fn'](_0x1693('0x25'),db[_0x1693('0x1d')]['fn']('IF',db['sequelize'][_0x1693('0x22')]('`state`\x20=\x2018,\x201,\x20null'))),_0x1693('0x3b')],[db[_0x1693('0x1d')]['fn'](_0x1693('0x25'),db[_0x1693('0x1d')]['fn']('IF',db[_0x1693('0x1d')][_0x1693('0x22')]('`state`\x20=\x2016,\x201,\x20null'))),_0x1693('0x3c')],[db[_0x1693('0x1d')]['fn']('COUNT',db[_0x1693('0x1d')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2020,\x201,\x20null'))),_0x1693('0x3b')],[db[_0x1693('0x1d')]['fn'](_0x1693('0x25'),db[_0x1693('0x1d')]['fn']('IF',db['sequelize'][_0x1693('0x22')](_0x1693('0x3d')))),_0x1693('0x3e')]],'group':['campaign']})[_0x1693('0xa')](function(_0x460e39){logger[_0x1693('0xb')](_0x1693('0x2a'),_0x2b9744);logger[_0x1693('0xe')](_0x1693('0x2a'),_0x2b9744,JSON[_0x1693('0x10')](_0x460e39));_0x3c15b9(_0x460e39);})[_0x1693('0x15')](function(_0x53c73b){logger[_0x1693('0x11')](_0x1693('0x2a'),_0x53c73b['message'],_0x2b9744);_0x4b872e(_0x29dabc[_0x1693('0x11')](0x1f4,_0x53c73b[_0x1693('0x13')]));});});};exports[_0x1693('0x3f')]=function(_0xdc35d){var _0x13406d=this;return new Promise(function(_0x300543,_0x135362){return db[_0x1693('0x17')]['findAll']({'raw':_0xdc35d[_0x1693('0x1a')]?_0xdc35d[_0x1693('0x1a')][_0x1693('0x1b')]===undefined?!![]:![]:!![],'where':_0xdc35d[_0x1693('0x1a')]?_0xdc35d[_0x1693('0x1a')][_0x1693('0x2b')]||null:null,'attributes':[[_0x1693('0x2c'),_0x1693('0x2d')],[db[_0x1693('0x1d')]['fn'](_0x1693('0x25'),db[_0x1693('0x1d')][_0x1693('0x1e')]('id')),_0x1693('0x40')],[db[_0x1693('0x1d')]['fn']('COUNT',db[_0x1693('0x1d')]['fn']('IF',db[_0x1693('0x1d')][_0x1693('0x22')](_0x1693('0x20')))),_0x1693('0x41')]],'group':['campaign']})[_0x1693('0xa')](function(_0x58ab2f){logger[_0x1693('0xb')](_0x1693('0x3f'),_0xdc35d);logger[_0x1693('0xe')](_0x1693('0x3f'),_0xdc35d,JSON[_0x1693('0x10')](_0x58ab2f));_0x300543(_0x58ab2f);})[_0x1693('0x15')](function(_0x431c0e){logger[_0x1693('0x11')]('GetCampaignHopperHistory',_0x431c0e[_0x1693('0x13')],_0xdc35d);_0x135362(_0x13406d['error'](0x1f4,_0x431c0e[_0x1693('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 53467f4..a38f6ba 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 _0x8b06=['multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./cmHopperHistory.controller','get','isAuthenticated','index','/describe','describe','/:id','post','exports'];(function(_0xe5c56f,_0x594d78){var _0x1481fd=function(_0x10535e){while(--_0x10535e){_0xe5c56f['push'](_0xe5c56f['shift']());}};_0x1481fd(++_0x594d78);}(_0x8b06,0x1f0));var _0x68b0=function(_0x50ba15,_0x2ae44f){_0x50ba15=_0x50ba15-0x0;var _0x4955dd=_0x8b06[_0x50ba15];return _0x4955dd;};'use strict';var multer=require(_0x68b0('0x0'));var util=require(_0x68b0('0x1'));var path=require(_0x68b0('0x2'));var timeout=require(_0x68b0('0x3'));var express=require(_0x68b0('0x4'));var router=express['Router']();var fs_extra=require(_0x68b0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x68b0('0x6'));var config=require('../../config/environment');var controller=require(_0x68b0('0x7'));router[_0x68b0('0x8')]('/',auth[_0x68b0('0x9')](),controller[_0x68b0('0xa')]);router[_0x68b0('0x8')](_0x68b0('0xb'),auth[_0x68b0('0x9')](),controller[_0x68b0('0xc')]);router[_0x68b0('0x8')](_0x68b0('0xd'),auth[_0x68b0('0x9')](),controller['show']);router[_0x68b0('0xe')]('/',auth[_0x68b0('0x9')](),controller['create']);router['put']('/:id',auth[_0x68b0('0x9')](),controller['update']);module[_0x68b0('0xf')]=router; \ No newline at end of file +var _0x128c=['isAuthenticated','index','describe','show','post','create','put','/:id','update','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get'];(function(_0x4d515d,_0x108c96){var _0x58fe07=function(_0x2e18bf){while(--_0x2e18bf){_0x4d515d['push'](_0x4d515d['shift']());}};_0x58fe07(++_0x108c96);}(_0x128c,0x122));var _0xc128=function(_0x560120,_0x21f47b){_0x560120=_0x560120-0x0;var _0x363af0=_0x128c[_0x560120];return _0x363af0;};'use strict';var multer=require(_0xc128('0x0'));var util=require('util');var path=require(_0xc128('0x1'));var timeout=require('connect-timeout');var express=require(_0xc128('0x2'));var router=express[_0xc128('0x3')]();var fs_extra=require(_0xc128('0x4'));var auth=require(_0xc128('0x5'));var interaction=require(_0xc128('0x6'));var config=require(_0xc128('0x7'));var controller=require(_0xc128('0x8'));router[_0xc128('0x9')]('/',auth[_0xc128('0xa')](),controller[_0xc128('0xb')]);router[_0xc128('0x9')]('/describe',auth[_0xc128('0xa')](),controller[_0xc128('0xc')]);router[_0xc128('0x9')]('/:id',auth[_0xc128('0xa')](),controller[_0xc128('0xd')]);router[_0xc128('0xe')]('/',auth[_0xc128('0xa')](),controller[_0xc128('0xf')]);router[_0xc128('0x10')](_0xc128('0x11'),auth[_0xc128('0xa')](),controller[_0xc128('0x12')]);module[_0xc128('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 3f13936..bc59850 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 _0xca9e=['STRING','name','sequelize','exports'];(function(_0x589de4,_0x2e0e8c){var _0x37efc2=function(_0x234663){while(--_0x234663){_0x589de4['push'](_0x589de4['shift']());}};_0x37efc2(++_0x2e0e8c);}(_0xca9e,0x136));var _0xeca9=function(_0x1a3ad0,_0x4763a3){_0x1a3ad0=_0x1a3ad0-0x0;var _0x322279=_0xca9e[_0x1a3ad0];return _0x322279;};'use strict';var Sequelize=require(_0xeca9('0x0'));module[_0xeca9('0x1')]={'name':{'type':Sequelize[_0xeca9('0x2')],'unique':_0xeca9('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xeca9('0x2')]},'dialPrefix':{'type':Sequelize[_0xeca9('0x2')]}}; \ No newline at end of file +var _0xc3b5=['name','STRING'];(function(_0x29aca7,_0x21c650){var _0x1db0a0=function(_0x45b5ea){while(--_0x45b5ea){_0x29aca7['push'](_0x29aca7['shift']());}};_0x1db0a0(++_0x21c650);}(_0xc3b5,0x6f));var _0x5c3b=function(_0x4eb36b,_0x8b797a){_0x4eb36b=_0x4eb36b-0x0;var _0x2fc06f=_0xc3b5[_0x4eb36b];return _0x2fc06f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x5c3b('0x0')],'unique':_0x5c3b('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x5c3b('0x0')]},'dialPrefix':{'type':Sequelize[_0x5c3b('0x0')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 56e0d0d..ca7b7f5 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 _0xe5f7=['sendStatus','stack','name','send','index','map','CmList','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','describe','addDisposition','ListId','Disposition','findOne','rows','removeDispositions','CmContact','tags','isArray','join','each','omit','ids','push','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','concat','CustomFields','format','getContactsCsv','raw','now','writeFileSync','setHeader','list_%d_%s.csv','Content-type','text/csv','download','/tmp/list_%d_%s.csv','addCustomField','transaction','Sequelize','TEXT','number','switch','BOOLEAN','queryInterface','addColumn','cf_%s','findAndCountAll','addAgents','emit','userCmList:save','removeAgents','userCmList:remove','User','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','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','defaults','redis','localhost','socket.io-emitter','./cmList.socket','register','status','end','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','get','Lists','UserProfileResource'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xe5f7,0x178));var _0x7e5f=function(_0xb7396c,_0x469969){_0xb7396c=_0xb7396c-0x0;var _0x15b14e=_0xe5f7[_0xb7396c];return _0x15b14e;};'use strict';var emlformat=require(_0x7e5f('0x0'));var rimraf=require(_0x7e5f('0x1'));var zipdir=require(_0x7e5f('0x2'));var jsonpatch=require(_0x7e5f('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7e5f('0x4'));var Mustache=require(_0x7e5f('0x5'));var util=require(_0x7e5f('0x6'));var path=require('path');var sox=require(_0x7e5f('0x7'));var csv=require(_0x7e5f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7e5f('0x9'));var _=require(_0x7e5f('0xa'));var squel=require(_0x7e5f('0xb'));var crypto=require(_0x7e5f('0xc'));var jsforce=require(_0x7e5f('0xd'));var deskjs=require(_0x7e5f('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7e5f('0xf'));var Redis=require(_0x7e5f('0x10'));var authService=require(_0x7e5f('0x11'));var qs=require(_0x7e5f('0x12'));var as=require(_0x7e5f('0x13'));var hardwareService=require(_0x7e5f('0x14'));var logger=require(_0x7e5f('0x15'))(_0x7e5f('0x16'));var utils=require(_0x7e5f('0x17'));var config=require(_0x7e5f('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x7e5f('0x19'))['db'];config['redis']=_[_0x7e5f('0x1a')](config[_0x7e5f('0x1b')],{'host':_0x7e5f('0x1c'),'port':0x18eb});var socket=require(_0x7e5f('0x1d'))(new Redis(config[_0x7e5f('0x1b')]));require(_0x7e5f('0x1e'))[_0x7e5f('0x1f')](socket);function respondWithStatusCode(_0x2ca1ae,_0x171d31){_0x171d31=_0x171d31||0xcc;return function(_0x199712){if(_0x199712){return _0x2ca1ae['sendStatus'](_0x171d31);}return _0x2ca1ae[_0x7e5f('0x20')](_0x171d31)[_0x7e5f('0x21')]();};}function respondWithResult(_0x25448c,_0x62cdf5){_0x62cdf5=_0x62cdf5||0xc8;return function(_0x5a0c96){if(_0x5a0c96){return _0x25448c['status'](_0x62cdf5)['json'](_0x5a0c96);}};}function respondWithFilteredResult(_0x44e284,_0x432d2d){return function(_0x563db9){if(_0x563db9){var _0x22a05a=typeof _0x432d2d[_0x7e5f('0x22')]===_0x7e5f('0x23')&&typeof _0x432d2d[_0x7e5f('0x24')]===_0x7e5f('0x23');var _0x3f7940=_0x563db9[_0x7e5f('0x25')];var _0x5481c7=_0x22a05a?0x0:_0x432d2d[_0x7e5f('0x22')];var _0x5a2624=_0x22a05a?_0x563db9[_0x7e5f('0x25')]:_0x432d2d[_0x7e5f('0x22')]+_0x432d2d['limit'];var _0x892c6f;if(_0x5a2624>=_0x3f7940){_0x5a2624=_0x3f7940;_0x892c6f=0xc8;}else{_0x892c6f=0xce;}_0x44e284['status'](_0x892c6f);return _0x44e284['set'](_0x7e5f('0x26'),_0x5481c7+'-'+_0x5a2624+'/'+_0x3f7940)['json'](_0x563db9);}return null;};}function patchUpdates(_0x196d5b){return function(_0x50d36a){try{jsonpatch[_0x7e5f('0x27')](_0x50d36a,_0x196d5b,!![]);}catch(_0x361566){return BPromise[_0x7e5f('0x28')](_0x361566);}return _0x50d36a['save']();};}function saveUpdates(_0x5137a6,_0x4ab084){return function(_0x33b4f6){if(_0x33b4f6){return _0x33b4f6[_0x7e5f('0x29')](_0x5137a6)[_0x7e5f('0x2a')](function(_0x2f250d){return _0x2f250d;});}return null;};}function removeEntity(_0x161991,_0x126fac){return function(_0x1028b1){if(_0x1028b1){return _0x1028b1[_0x7e5f('0x2b')]()['then'](function(){var _0x52aec7=_0x1028b1[_0x7e5f('0x2c')]({'plain':!![]});var _0x455071=_0x7e5f('0x2d');return db[_0x7e5f('0x2e')][_0x7e5f('0x2b')]({'where':{'type':_0x455071,'resourceId':_0x52aec7['id']}})[_0x7e5f('0x2a')](function(){return _0x1028b1;});})[_0x7e5f('0x2a')](function(){_0x161991[_0x7e5f('0x20')](0xcc)[_0x7e5f('0x21')]();});}};}function handleEntityNotFound(_0x3b73c6,_0x142134){return function(_0x69cd03){if(!_0x69cd03){_0x3b73c6[_0x7e5f('0x2f')](0x194);}return _0x69cd03;};}function handleError(_0x6977c0,_0x24be24){_0x24be24=_0x24be24||0x1f4;return function(_0x44abdb){logger['error'](_0x44abdb[_0x7e5f('0x30')]);if(_0x44abdb[_0x7e5f('0x31')]){delete _0x44abdb[_0x7e5f('0x31')];}_0x6977c0[_0x7e5f('0x20')](_0x24be24)[_0x7e5f('0x32')](_0x44abdb);};}exports[_0x7e5f('0x33')]=function(_0x572416,_0x5ac174){var _0x3d57da={},_0x1bbfdc={},_0xb4503a={'count':0x0,'rows':[]};var _0x4fdf12=_[_0x7e5f('0x34')](db[_0x7e5f('0x35')][_0x7e5f('0x36')],function(_0x3e3a97){return{'name':_0x3e3a97['fieldName'],'type':_0x3e3a97[_0x7e5f('0x37')][_0x7e5f('0x38')]};});_0x1bbfdc[_0x7e5f('0x39')]=_[_0x7e5f('0x34')](_0x4fdf12,_0x7e5f('0x31'));_0x1bbfdc[_0x7e5f('0x3a')]=_[_0x7e5f('0x3b')](_0x572416[_0x7e5f('0x3a')]);_0x1bbfdc[_0x7e5f('0x3c')]=_[_0x7e5f('0x3d')](_0x1bbfdc[_0x7e5f('0x39')],_0x1bbfdc[_0x7e5f('0x3a')]);_0x3d57da['attributes']=_[_0x7e5f('0x3d')](_0x1bbfdc['model'],qs[_0x7e5f('0x3e')](_0x572416[_0x7e5f('0x3a')][_0x7e5f('0x3e')]));_0x3d57da[_0x7e5f('0x3f')]=_0x3d57da[_0x7e5f('0x3f')][_0x7e5f('0x40')]?_0x3d57da[_0x7e5f('0x3f')]:_0x1bbfdc[_0x7e5f('0x39')];if(!_0x572416[_0x7e5f('0x3a')][_0x7e5f('0x41')](_0x7e5f('0x42'))){_0x3d57da[_0x7e5f('0x24')]=qs['limit'](_0x572416[_0x7e5f('0x3a')][_0x7e5f('0x24')]);_0x3d57da[_0x7e5f('0x22')]=qs[_0x7e5f('0x22')](_0x572416['query']['offset']);}_0x3d57da[_0x7e5f('0x43')]=qs[_0x7e5f('0x44')](_0x572416[_0x7e5f('0x3a')][_0x7e5f('0x44')]);_0x3d57da[_0x7e5f('0x45')]=qs[_0x7e5f('0x3c')](_[_0x7e5f('0x46')](_0x572416[_0x7e5f('0x3a')],_0x1bbfdc[_0x7e5f('0x3c')]),_0x4fdf12);if(_0x572416[_0x7e5f('0x3a')][_0x7e5f('0x47')]){_0x3d57da[_0x7e5f('0x45')]=_[_0x7e5f('0x48')](_0x3d57da['where'],{'$or':_[_0x7e5f('0x34')](_0x4fdf12,function(_0xef42f4){if(_0xef42f4[_0x7e5f('0x37')]!==_0x7e5f('0x49')){var _0x4c8631={};_0x4c8631[_0xef42f4[_0x7e5f('0x31')]]={'$like':'%'+_0x572416['query'][_0x7e5f('0x47')]+'%'};return _0x4c8631;}})});}_0x3d57da=_[_0x7e5f('0x48')]({},_0x3d57da,_0x572416[_0x7e5f('0x4a')]);var _0x2ae097={'where':_0x3d57da[_0x7e5f('0x45')]};return db['CmList'][_0x7e5f('0x25')](_0x2ae097)[_0x7e5f('0x2a')](function(_0x326309){_0xb4503a[_0x7e5f('0x25')]=_0x326309;if(_0x572416['query'][_0x7e5f('0x4b')]){_0x3d57da[_0x7e5f('0x4c')]=[{'all':!![]}];}return db[_0x7e5f('0x35')][_0x7e5f('0x4d')](_0x3d57da);})['then'](function(_0x37bf6a){_0xb4503a['rows']=_0x37bf6a;return _0xb4503a;})[_0x7e5f('0x2a')](respondWithFilteredResult(_0x5ac174,_0x3d57da))['catch'](handleError(_0x5ac174,null));};exports[_0x7e5f('0x4e')]=function(_0xce449a,_0x330a7c){var _0x4beb43={'raw':![],'where':{'id':_0xce449a[_0x7e5f('0x4f')]['id']}},_0x365ac8={};_0x365ac8[_0x7e5f('0x39')]=_[_0x7e5f('0x3b')](db[_0x7e5f('0x35')][_0x7e5f('0x36')]);_0x365ac8[_0x7e5f('0x3a')]=_[_0x7e5f('0x3b')](_0xce449a['query']);_0x365ac8[_0x7e5f('0x3c')]=_['intersection'](_0x365ac8[_0x7e5f('0x39')],_0x365ac8[_0x7e5f('0x3a')]);_0x4beb43[_0x7e5f('0x3f')]=_[_0x7e5f('0x3d')](_0x365ac8[_0x7e5f('0x39')],qs[_0x7e5f('0x3e')](_0xce449a[_0x7e5f('0x3a')]['fields']));_0x4beb43[_0x7e5f('0x3f')]=_0x4beb43[_0x7e5f('0x3f')]['length']?_0x4beb43[_0x7e5f('0x3f')]:_0x365ac8[_0x7e5f('0x39')];if(_0xce449a[_0x7e5f('0x3a')][_0x7e5f('0x4b')]){_0x4beb43[_0x7e5f('0x4c')]=[{'all':!![]}];}_0x4beb43=_[_0x7e5f('0x48')]({},_0x4beb43,_0xce449a[_0x7e5f('0x4a')]);return db[_0x7e5f('0x35')]['find'](_0x4beb43)['then'](handleEntityNotFound(_0x330a7c,null))['then'](respondWithResult(_0x330a7c,null))[_0x7e5f('0x50')](handleError(_0x330a7c,null));};exports['create']=function(_0x3bc603,_0x11fc78){return db['CmList'][_0x7e5f('0x51')](_0x3bc603[_0x7e5f('0x52')],{})['then'](function(_0xd9d282){var _0x37206c=_0x3bc603[_0x7e5f('0x53')]['get']({'plain':!![]});if(!_0x37206c)throw new Error(_0x7e5f('0x54'));if(_0x37206c[_0x7e5f('0x55')]==='user'){var _0x2a2726=_0xd9d282[_0x7e5f('0x2c')]({'plain':!![]});var _0x4b662c=_0x7e5f('0x2d');return db[_0x7e5f('0x56')][_0x7e5f('0x57')]({'where':{'name':_0x4b662c,'userProfileId':_0x37206c['userProfileId']},'raw':!![]})[_0x7e5f('0x2a')](function(_0x520163){if(_0x520163&&_0x520163[_0x7e5f('0x58')]===0x0){return db[_0x7e5f('0x2e')][_0x7e5f('0x51')]({'name':_0x2a2726[_0x7e5f('0x31')],'resourceId':_0x2a2726['id'],'type':_0x520163['name'],'sectionId':_0x520163['id']},{})[_0x7e5f('0x2a')](function(){return _0xd9d282;});}else{return _0xd9d282;}})[_0x7e5f('0x50')](function(_0x13eefb){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13eefb);throw _0x13eefb;});}return _0xd9d282;})[_0x7e5f('0x2a')](respondWithResult(_0x11fc78,0xc9))[_0x7e5f('0x50')](handleError(_0x11fc78,null));};exports['update']=function(_0x436806,_0x13a216){if(_0x436806[_0x7e5f('0x52')]['id']){delete _0x436806['body']['id'];}return db['CmList'][_0x7e5f('0x57')]({'where':{'id':_0x436806['params']['id']}})['then'](handleEntityNotFound(_0x13a216,null))[_0x7e5f('0x2a')](saveUpdates(_0x436806[_0x7e5f('0x52')],null))[_0x7e5f('0x2a')](respondWithResult(_0x13a216,null))['catch'](handleError(_0x13a216,null));};exports[_0x7e5f('0x2b')]=function(_0x41074f,_0x2f06de){return db[_0x7e5f('0x35')][_0x7e5f('0x57')]({'where':{'id':_0x41074f[_0x7e5f('0x4f')]['id']}})[_0x7e5f('0x2a')](handleEntityNotFound(_0x2f06de,null))['then'](removeEntity(_0x2f06de,null))[_0x7e5f('0x50')](handleError(_0x2f06de,null));};exports[_0x7e5f('0x59')]=function(_0x3adc96,_0x3a3584){return db[_0x7e5f('0x35')][_0x7e5f('0x59')]()[_0x7e5f('0x2a')](respondWithResult(_0x3a3584,null))[_0x7e5f('0x50')](handleError(_0x3a3584,null));};exports[_0x7e5f('0x5a')]=function(_0x1a01d9,_0x4b5d22,_0x373dde){if(_0x1a01d9[_0x7e5f('0x52')]['id']){delete _0x1a01d9['body']['id'];}return db[_0x7e5f('0x35')]['find']({'where':{'id':_0x1a01d9[_0x7e5f('0x4f')]['id']}})[_0x7e5f('0x2a')](handleEntityNotFound(_0x4b5d22,null))['then'](function(_0x56f4ea){if(_0x56f4ea){_0x1a01d9[_0x7e5f('0x52')][_0x7e5f('0x5b')]=_0x56f4ea['id'];return db[_0x7e5f('0x5c')]['create'](_0x1a01d9['body']);}})[_0x7e5f('0x2a')](respondWithResult(_0x4b5d22,null))[_0x7e5f('0x50')](handleError(_0x4b5d22,null));};exports['getDispositions']=function(_0x2c79b5,_0xc3907f,_0x5d05a5){var _0x1185f7={'raw':![],'where':{}};var _0x59c07e={};var _0x23eda1={'count':0x0,'rows':[]};return db[_0x7e5f('0x35')][_0x7e5f('0x5d')]({'where':{'id':_0x2c79b5['params']['id']}})[_0x7e5f('0x2a')](handleEntityNotFound(_0xc3907f,null))['then'](function(_0x59a9ff){if(_0x59a9ff){_0x59c07e[_0x7e5f('0x39')]=_[_0x7e5f('0x3b')](db[_0x7e5f('0x5c')][_0x7e5f('0x36')]);_0x59c07e['query']=_['keys'](_0x2c79b5['query']);_0x59c07e[_0x7e5f('0x3c')]=_['intersection'](_0x59c07e[_0x7e5f('0x39')],_0x59c07e[_0x7e5f('0x3a')]);_0x1185f7[_0x7e5f('0x3f')]=_[_0x7e5f('0x3d')](_0x59c07e['model'],qs[_0x7e5f('0x3e')](_0x2c79b5[_0x7e5f('0x3a')][_0x7e5f('0x3e')]));_0x1185f7['attributes']=_0x1185f7['attributes'][_0x7e5f('0x40')]?_0x1185f7[_0x7e5f('0x3f')]:_0x59c07e[_0x7e5f('0x39')];if(!_0x2c79b5[_0x7e5f('0x3a')]['hasOwnProperty'](_0x7e5f('0x42'))){_0x1185f7['limit']=qs[_0x7e5f('0x24')](_0x2c79b5[_0x7e5f('0x3a')][_0x7e5f('0x24')]);_0x1185f7[_0x7e5f('0x22')]=qs['offset'](_0x2c79b5[_0x7e5f('0x3a')][_0x7e5f('0x22')]);}_0x1185f7[_0x7e5f('0x43')]=qs['sort'](_0x2c79b5[_0x7e5f('0x3a')][_0x7e5f('0x44')]);_0x1185f7['where']=qs[_0x7e5f('0x3c')](_[_0x7e5f('0x46')](_0x2c79b5[_0x7e5f('0x3a')],_0x59c07e[_0x7e5f('0x3c')]));_0x1185f7[_0x7e5f('0x45')][_0x7e5f('0x5b')]=_0x59a9ff['id'];if(_0x2c79b5[_0x7e5f('0x3a')][_0x7e5f('0x47')]){_0x1185f7[_0x7e5f('0x45')]=_['merge'](_0x1185f7['where'],{'$or':_[_0x7e5f('0x34')](_0x1185f7['attributes'],function(_0x313c62){var _0x4966ec={};_0x4966ec[_0x313c62]={'$like':'%'+_0x2c79b5[_0x7e5f('0x3a')][_0x7e5f('0x47')]+'%'};return _0x4966ec;})});}_0x1185f7=_['merge']({},_0x1185f7,_0x2c79b5[_0x7e5f('0x4a')]);return db[_0x7e5f('0x5c')][_0x7e5f('0x25')]({'where':_0x1185f7['where']})['then'](function(_0x13f467){_0x23eda1['count']=_0x13f467;if(_0x2c79b5[_0x7e5f('0x3a')]['includeAll']){_0x1185f7[_0x7e5f('0x4c')]=[{'all':!![]}];}return db[_0x7e5f('0x5c')][_0x7e5f('0x4d')](_0x1185f7);})['then'](function(_0xbd355e){_0x23eda1[_0x7e5f('0x5e')]=_0xbd355e;return _0x23eda1;});}})[_0x7e5f('0x2a')](respondWithFilteredResult(_0xc3907f,_0x1185f7))[_0x7e5f('0x50')](handleError(_0xc3907f,null));};exports[_0x7e5f('0x5f')]=function(_0x4576c9,_0x500a32,_0x40a213){return db[_0x7e5f('0x35')][_0x7e5f('0x57')]({'where':{'id':_0x4576c9[_0x7e5f('0x4f')]['id']}})['then'](handleEntityNotFound(_0x500a32,null))['then'](function(_0x3a42ef){if(_0x3a42ef){return _0x3a42ef[_0x7e5f('0x5f')](_0x4576c9['query']['ids']);}})[_0x7e5f('0x2a')](respondWithStatusCode(_0x500a32,null))[_0x7e5f('0x50')](handleError(_0x500a32,null));};exports['addContacts']=function(_0x3926fc,_0x585820,_0x5290db){return db[_0x7e5f('0x35')][_0x7e5f('0x57')]({'where':{'id':_0x3926fc[_0x7e5f('0x4f')]['id']}})[_0x7e5f('0x2a')](handleEntityNotFound(_0x585820,null))[_0x7e5f('0x2a')](function(_0x4a8351){if(_0x4a8351){var _0x2d8f12=[];var _0x9b53ca={'success':[],'errors':[]};return db[_0x7e5f('0x60')]['describe']()['then'](function(_0x3b03dd){if(_0x3926fc['body'][_0x7e5f('0x61')]&&_[_0x7e5f('0x62')](_0x3926fc['body']['tags'])){if(_0x3926fc[_0x7e5f('0x52')][_0x7e5f('0x61')][_0x7e5f('0x40')]){_0x3926fc[_0x7e5f('0x52')][_0x7e5f('0x61')]=_0x3926fc[_0x7e5f('0x52')]['tags'][_0x7e5f('0x63')](';')+';';}else{_0x3926fc[_0x7e5f('0x52')]['tags']=null;}}else{_0x3926fc[_0x7e5f('0x52')][_0x7e5f('0x61')]=null;}if(_0x3926fc[_0x7e5f('0x52')]&&_['isArray'](_0x3926fc['body'])){for(var _0x2100ea=0x0;_0x2100ea<_0x3926fc['body'][_0x7e5f('0x40')];_0x2100ea+=0x1){_0x3926fc[_0x7e5f('0x52')][_0x2100ea]['ListId']=_0x3926fc[_0x7e5f('0x4f')]['id'];_0x2d8f12['push'](_0x3926fc['body'][_0x2100ea]);}return BPromise[_0x7e5f('0x64')](_0x2d8f12,function(_0xc1abde){return db[_0x7e5f('0x60')][_0x7e5f('0x51')](_[_0x7e5f('0x65')](_0xc1abde,[_0x7e5f('0x66'),'id'])||{},{'fields':_[_0x7e5f('0x3b')](_0x3b03dd),'raw':!![]})[_0x7e5f('0x2a')](function(_0x395b54){_0x9b53ca['success'][_0x7e5f('0x67')](_0x395b54[_0x7e5f('0x68')]);})[_0x7e5f('0x50')](function(_0x76a61d){_0x9b53ca[_0x7e5f('0x69')][_0x7e5f('0x67')]({'data':_0xc1abde,'error':_0x76a61d[_0x7e5f('0x6a')]});});})[_0x7e5f('0x2a')](function(_0x1bf318){return _0x9b53ca;})['catch'](function(_0x409d0c){return _0x409d0c;});}else{_0x585820[_0x7e5f('0x20')](0x190)['json']({'message':_0x7e5f('0x6b')});}});}})[_0x7e5f('0x2a')](respondWithResult(_0x585820,null))[_0x7e5f('0x50')](handleError(_0x585820,null));};exports[_0x7e5f('0x6c')]=function(_0x1253d4,_0x8c75fe,_0x47015d){var _0x125fc8;return db[_0x7e5f('0x35')]['find']({'where':{'id':_0x1253d4['params']['id']},'include':[{'model':db[_0x7e5f('0x6d')],'as':'CustomFields'}]})['then'](handleEntityNotFound(_0x8c75fe,null))[_0x7e5f('0x2a')](function(_0x362767){if(_0x362767){_0x125fc8=_0x362767;return db['CmContact']['rawAttributes'];}})['then'](function(_0x4ec457){if(_0x4ec457){var _0x210ca2={};var _0x12dcb8={};_0x12dcb8[_0x7e5f('0x39')]=_[_0x7e5f('0x6e')](_['keys'](_0x4ec457),_[_0x7e5f('0x34')](_0x125fc8[_0x7e5f('0x6f')],function(_0xc699e){return util[_0x7e5f('0x70')]('cf_%d',_0xc699e['id']);}));_0x12dcb8[_0x7e5f('0x3a')]=_['keys'](_0x1253d4['query']);_0x12dcb8['filters']=_['intersection'](_0x12dcb8[_0x7e5f('0x39')],_0x12dcb8[_0x7e5f('0x3a')]);_0x210ca2[_0x7e5f('0x3f')]=_[_0x7e5f('0x3d')](_0x12dcb8['model'],qs[_0x7e5f('0x3e')](_0x1253d4['query'][_0x7e5f('0x3e')]));_0x210ca2[_0x7e5f('0x3f')]=_0x210ca2[_0x7e5f('0x3f')][_0x7e5f('0x40')]?_0x210ca2[_0x7e5f('0x3f')]:_0x12dcb8[_0x7e5f('0x39')];if(!_0x1253d4['query'][_0x7e5f('0x41')](_0x7e5f('0x42'))){_0x210ca2['limit']=qs[_0x7e5f('0x24')](_0x1253d4['query'][_0x7e5f('0x24')]);_0x210ca2[_0x7e5f('0x22')]=qs[_0x7e5f('0x22')](_0x1253d4['query'][_0x7e5f('0x22')]);}_0x210ca2[_0x7e5f('0x43')]=qs[_0x7e5f('0x44')](_0x1253d4[_0x7e5f('0x3a')]['sort']);_0x210ca2[_0x7e5f('0x45')]=qs[_0x7e5f('0x3c')](_[_0x7e5f('0x46')](_0x1253d4[_0x7e5f('0x3a')],_0x12dcb8[_0x7e5f('0x3c')]));_0x210ca2['raw']=!![];if(_0x1253d4['query'][_0x7e5f('0x47')]){_0x210ca2['where']=_[_0x7e5f('0x48')](_0x210ca2[_0x7e5f('0x45')],{'$or':_[_0x7e5f('0x34')](_0x210ca2[_0x7e5f('0x3f')],function(_0x552182){var _0x2294a2={};_0x2294a2[_0x552182]={'$like':'%'+_0x1253d4[_0x7e5f('0x3a')][_0x7e5f('0x47')]+'%'};return _0x2294a2;})});}_0x210ca2=_[_0x7e5f('0x48')]({},_0x210ca2,_0x1253d4[_0x7e5f('0x4a')]);return _0x125fc8['getContacts'](_0x210ca2);}})['then'](respondWithResult(_0x8c75fe,null))[_0x7e5f('0x50')](handleError(_0x8c75fe,null));};exports[_0x7e5f('0x71')]=function(_0x1ae34c,_0xd60eec,_0x40fdc6){var _0x138c9a;return db[_0x7e5f('0x35')][_0x7e5f('0x57')]({'where':{'id':_0x1ae34c[_0x7e5f('0x4f')]['id']},'include':[{'model':db['CmCustomField'],'as':_0x7e5f('0x6f')}]})[_0x7e5f('0x2a')](handleEntityNotFound(_0xd60eec,null))[_0x7e5f('0x2a')](function(_0x2cfd5a){if(_0x2cfd5a){_0x138c9a=_0x2cfd5a;return db[_0x7e5f('0x60')][_0x7e5f('0x36')];}})['then'](function(_0x2af377){if(_0x2af377){var _0xc99f55={};var _0x435396={};_0x435396[_0x7e5f('0x39')]=_[_0x7e5f('0x6e')](_[_0x7e5f('0x3b')](_0x2af377),_[_0x7e5f('0x34')](_0x138c9a[_0x7e5f('0x6f')],function(_0x5db9c4){return util[_0x7e5f('0x70')]('cf_%d',_0x5db9c4['id']);}));_0x435396['query']=_['keys'](_0x1ae34c[_0x7e5f('0x3a')]);_0x435396[_0x7e5f('0x3c')]=_[_0x7e5f('0x3d')](_0x435396['model'],_0x435396[_0x7e5f('0x3a')]);_0xc99f55[_0x7e5f('0x3f')]=_[_0x7e5f('0x3d')](_0x435396['model'],qs[_0x7e5f('0x3e')](_0x1ae34c[_0x7e5f('0x3a')][_0x7e5f('0x3e')]));_0xc99f55['attributes']=_0xc99f55[_0x7e5f('0x3f')][_0x7e5f('0x40')]?_0xc99f55[_0x7e5f('0x3f')]:_0x435396[_0x7e5f('0x39')];if(!_0x1ae34c[_0x7e5f('0x3a')][_0x7e5f('0x41')](_0x7e5f('0x42'))){_0xc99f55[_0x7e5f('0x24')]=qs[_0x7e5f('0x24')](_0x1ae34c['query'][_0x7e5f('0x24')]);_0xc99f55['offset']=qs['offset'](_0x1ae34c[_0x7e5f('0x3a')][_0x7e5f('0x22')]);}_0xc99f55[_0x7e5f('0x43')]=qs[_0x7e5f('0x44')](_0x1ae34c['query'][_0x7e5f('0x44')]);_0xc99f55[_0x7e5f('0x45')]=qs[_0x7e5f('0x3c')](_[_0x7e5f('0x46')](_0x1ae34c[_0x7e5f('0x3a')],_0x435396['filters']));_0xc99f55[_0x7e5f('0x72')]=!![];if(_0x1ae34c[_0x7e5f('0x3a')][_0x7e5f('0x47')]){_0xc99f55['where']=_['merge'](_0xc99f55[_0x7e5f('0x45')],{'$or':_[_0x7e5f('0x34')](_0xc99f55[_0x7e5f('0x3f')],function(_0x33c40b){var _0x19c5a8={};_0x19c5a8[_0x33c40b]={'$like':'%'+_0x1ae34c[_0x7e5f('0x3a')][_0x7e5f('0x47')]+'%'};return _0x19c5a8;})});}_0xc99f55=_['merge']({},_0xc99f55,_0x1ae34c['options']);return _0x138c9a[_0x7e5f('0x6c')](_0xc99f55);}})[_0x7e5f('0x2a')](function(_0xe9e43c){if(!_['isEmpty'](_0xe9e43c)){var _0x53d7a7=toCsv(_0xe9e43c);var _0x2cf6c2=Date[_0x7e5f('0x73')]();fs[_0x7e5f('0x74')](util[_0x7e5f('0x70')]('/tmp/list_%d_%s.csv',_0x138c9a['id'],_0x2cf6c2),_0x53d7a7);_0xd60eec[_0x7e5f('0x75')]('Content-disposition','attachment;\x20filename='+util['format'](_0x7e5f('0x76'),_0x138c9a['id'],_0x2cf6c2));_0xd60eec[_0x7e5f('0x75')](_0x7e5f('0x77'),_0x7e5f('0x78'));return _0xd60eec[_0x7e5f('0x79')](util[_0x7e5f('0x70')](_0x7e5f('0x7a'),_0x138c9a['id'],_0x2cf6c2));}else{return _0xd60eec[_0x7e5f('0x2f')](0xcc);}})[_0x7e5f('0x50')](handleError(_0xd60eec,null));};exports[_0x7e5f('0x7b')]=function(_0xecf4a1,_0x4eca49,_0x1487e4){var _0x20637c;delete _0xecf4a1[_0x7e5f('0x52')]['id'];return db['CmList'][_0x7e5f('0x5d')]({'where':{'id':_0xecf4a1[_0x7e5f('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4eca49,null))[_0x7e5f('0x2a')](function(_0x4e92d2){if(_0x4e92d2){return db['sequelize'][_0x7e5f('0x7c')](function(_0xf5dea6){return db['CmCustomField']['create'](_0xecf4a1[_0x7e5f('0x52')],{'transaction':_0xf5dea6})['then'](function(_0x4242f3){_0x20637c=_0x4242f3;return _0x4e92d2['addCustomFields'](_0x4242f3,{'transaction':_0xf5dea6});})[_0x7e5f('0x2a')](function(){var _0x116792={'type':db[_0x7e5f('0x7d')][_0x7e5f('0x7e')],'transaction':_0xf5dea6};switch(_0xecf4a1['body']['type']){case'text':_0x116792[_0x7e5f('0x37')]=db['Sequelize'][_0x7e5f('0x7e')];break;case _0x7e5f('0x7f'):_0x116792['type']=db[_0x7e5f('0x7d')]['INTEGER'];break;case _0x7e5f('0x80'):_0x116792[_0x7e5f('0x37')]=db['Sequelize'][_0x7e5f('0x81')];_0x116792['defaultValue']=![];break;default:}return db['sequelize'][_0x7e5f('0x82')][_0x7e5f('0x83')]('cm_contacts',util[_0x7e5f('0x70')](_0x7e5f('0x84'),_0x20637c['id']),_0x116792);})['then'](function(){return _0x20637c;});});}})[_0x7e5f('0x2a')](respondWithResult(_0x4eca49,null))[_0x7e5f('0x50')](handleError(_0x4eca49,null));};exports['getCustomFields']=function(_0x34342a,_0x3f5841,_0x26b760){var _0x561cae={};var _0x214903={};var _0x4d9523;var _0x15c5f1;return db[_0x7e5f('0x35')][_0x7e5f('0x5d')]({'where':{'id':_0x34342a[_0x7e5f('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3f5841,null))[_0x7e5f('0x2a')](function(_0xd08c0a){if(_0xd08c0a){_0x4d9523=_0xd08c0a;_0x214903['model']=_[_0x7e5f('0x3b')](db['CmCustomField'][_0x7e5f('0x36')]);_0x214903[_0x7e5f('0x3a')]=_[_0x7e5f('0x3b')](_0x34342a[_0x7e5f('0x3a')]);_0x214903[_0x7e5f('0x3c')]=_['intersection'](_0x214903['model'],_0x214903[_0x7e5f('0x3a')]);_0x561cae[_0x7e5f('0x3f')]=_['intersection'](_0x214903[_0x7e5f('0x39')],qs[_0x7e5f('0x3e')](_0x34342a[_0x7e5f('0x3a')]['fields']));_0x561cae['attributes']=_0x561cae[_0x7e5f('0x3f')][_0x7e5f('0x40')]?_0x561cae[_0x7e5f('0x3f')]:_0x214903['model'];_0x561cae['order']=qs[_0x7e5f('0x44')](_0x34342a[_0x7e5f('0x3a')][_0x7e5f('0x44')]);_0x561cae['where']=qs[_0x7e5f('0x3c')](_['pick'](_0x34342a[_0x7e5f('0x3a')],_0x214903[_0x7e5f('0x3c')]));_0x561cae['where']=_[_0x7e5f('0x48')](_0x561cae[_0x7e5f('0x45')],{'$or':[{'ListId':_0xd08c0a['id']},{'ListId':null}]});if(_0x34342a['query'][_0x7e5f('0x47')]){_0x561cae[_0x7e5f('0x45')]=_[_0x7e5f('0x48')](_0x561cae[_0x7e5f('0x45')],{'$or':_[_0x7e5f('0x34')](_0x561cae[_0x7e5f('0x3f')],function(_0xcd8a8e){var _0x34f2d2={};_0x34f2d2[_0xcd8a8e]={'$like':'%'+_0x34342a[_0x7e5f('0x3a')][_0x7e5f('0x47')]+'%'};return _0x34f2d2;})});}_0x561cae=_[_0x7e5f('0x48')]({},_0x561cae,_0x34342a[_0x7e5f('0x4a')]);return db['CmCustomField'][_0x7e5f('0x85')](_0x561cae);}})[_0x7e5f('0x2a')](respondWithResult(_0x3f5841,null))[_0x7e5f('0x50')](handleError(_0x3f5841,null));};exports[_0x7e5f('0x86')]=function(_0x1275c7,_0x223d65,_0x25e050){return db[_0x7e5f('0x35')][_0x7e5f('0x57')]({'where':{'id':_0x1275c7[_0x7e5f('0x4f')]['id']}})[_0x7e5f('0x2a')](handleEntityNotFound(_0x223d65,null))[_0x7e5f('0x2a')](function(_0x8d127e){if(_0x8d127e){return _0x8d127e[_0x7e5f('0x86')](_0x1275c7[_0x7e5f('0x52')][_0x7e5f('0x66')],_[_0x7e5f('0x65')](_0x1275c7[_0x7e5f('0x52')],[_0x7e5f('0x66'),'id'])||{})['spread'](function(_0x1f3d8e){for(var _0x53ce3c=0x0;_0x53ce3c<_0x1275c7['body'][_0x7e5f('0x66')][_0x7e5f('0x40')];_0x53ce3c+=0x1){socket[_0x7e5f('0x87')](_0x7e5f('0x88'),{'UserId':Number(_0x1275c7[_0x7e5f('0x52')][_0x7e5f('0x66')][_0x53ce3c]),'CmListId':Number(_0x1275c7['params']['id'])});}return _0x1f3d8e;});}})[_0x7e5f('0x2a')](respondWithResult(_0x223d65,null))[_0x7e5f('0x50')](handleError(_0x223d65,null));};exports[_0x7e5f('0x89')]=function(_0x2ca09e,_0x2ac009,_0x3a10e4){return db[_0x7e5f('0x35')]['find']({'where':{'id':_0x2ca09e[_0x7e5f('0x4f')]['id']}})[_0x7e5f('0x2a')](handleEntityNotFound(_0x2ac009,null))['then'](function(_0x1062bf){if(_0x1062bf){return _0x1062bf[_0x7e5f('0x89')](_0x2ca09e[_0x7e5f('0x3a')]['ids'])['then'](function(){if(_[_0x7e5f('0x62')](_0x2ca09e[_0x7e5f('0x3a')][_0x7e5f('0x66')])){for(var _0x379b03=0x0;_0x379b03<_0x2ca09e['query'][_0x7e5f('0x66')][_0x7e5f('0x40')];_0x379b03+=0x1){socket[_0x7e5f('0x87')](_0x7e5f('0x8a'),{'UserId':Number(_0x2ca09e['query'][_0x7e5f('0x66')][_0x379b03]),'CmListId':Number(_0x2ca09e[_0x7e5f('0x4f')]['id'])});}}else{socket[_0x7e5f('0x87')]('userCmList:remove',{'UserId':Number(_0x2ca09e[_0x7e5f('0x3a')][_0x7e5f('0x66')]),'CmListId':Number(_0x2ca09e[_0x7e5f('0x4f')]['id'])});}});}})['then'](respondWithStatusCode(_0x2ac009,null))['catch'](handleError(_0x2ac009,null));};exports['getAgents']=function(_0x3a0a23,_0x191a89,_0x4d5597){var _0x347192={};var _0x17c2ec={};var _0x1e9fd1;var _0x325c89;return db['CmList'][_0x7e5f('0x5d')]({'where':{'id':_0x3a0a23[_0x7e5f('0x4f')]['id']}})[_0x7e5f('0x2a')](handleEntityNotFound(_0x191a89,null))[_0x7e5f('0x2a')](function(_0x24f71a){if(_0x24f71a){_0x1e9fd1=_0x24f71a;_0x17c2ec[_0x7e5f('0x39')]=_['keys'](db[_0x7e5f('0x8b')][_0x7e5f('0x36')]);_0x17c2ec[_0x7e5f('0x3a')]=_[_0x7e5f('0x3b')](_0x3a0a23[_0x7e5f('0x3a')]);_0x17c2ec[_0x7e5f('0x3c')]=_[_0x7e5f('0x3d')](_0x17c2ec['model'],_0x17c2ec[_0x7e5f('0x3a')]);_0x347192['attributes']=_[_0x7e5f('0x3d')](_0x17c2ec['model'],qs[_0x7e5f('0x3e')](_0x3a0a23[_0x7e5f('0x3a')][_0x7e5f('0x3e')]));_0x347192['attributes']=_0x347192[_0x7e5f('0x3f')][_0x7e5f('0x40')]?_0x347192['attributes']:_0x17c2ec[_0x7e5f('0x39')];_0x347192['order']=qs[_0x7e5f('0x44')](_0x3a0a23['query'][_0x7e5f('0x44')]);_0x347192[_0x7e5f('0x45')]=qs[_0x7e5f('0x3c')](_[_0x7e5f('0x46')](_0x3a0a23[_0x7e5f('0x3a')],_0x17c2ec[_0x7e5f('0x3c')]));if(_0x3a0a23[_0x7e5f('0x3a')][_0x7e5f('0x47')]){_0x347192[_0x7e5f('0x45')]=_[_0x7e5f('0x48')](_0x347192[_0x7e5f('0x45')],{'$or':_[_0x7e5f('0x34')](_0x347192[_0x7e5f('0x3f')],function(_0x32c793){var _0x5e945b={};_0x5e945b[_0x32c793]={'$like':'%'+_0x3a0a23['query'][_0x7e5f('0x47')]+'%'};return _0x5e945b;})});}_0x347192=_[_0x7e5f('0x48')]({},_0x347192,_0x3a0a23['options']);return _0x1e9fd1[_0x7e5f('0x8c')](_0x347192);}})[_0x7e5f('0x2a')](function(_0x5563fb){if(_0x5563fb){_0x325c89=_0x5563fb[_0x7e5f('0x40')];if(!_0x3a0a23[_0x7e5f('0x3a')][_0x7e5f('0x41')](_0x7e5f('0x42'))){_0x347192[_0x7e5f('0x24')]=qs[_0x7e5f('0x24')](_0x3a0a23[_0x7e5f('0x3a')][_0x7e5f('0x24')]);_0x347192[_0x7e5f('0x22')]=qs['offset'](_0x3a0a23[_0x7e5f('0x3a')][_0x7e5f('0x22')]);}return _0x1e9fd1[_0x7e5f('0x8c')](_0x347192);}})[_0x7e5f('0x2a')](function(_0x439007){if(_0x439007){return _0x439007?{'count':_0x325c89,'rows':_0x439007}:null;}})[_0x7e5f('0x2a')](respondWithResult(_0x191a89,null))[_0x7e5f('0x50')](handleError(_0x191a89,null));}; \ No newline at end of file +var _0x7cf5=['sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','reject','update','then','get','Lists','UserProfileResource','destroy','error','name','index','map','CmList','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','getDispositions','findOne','removeDispositions','ids','tags','isArray','join','push','each','success','errors','message','CmContact','concat','CustomFields','cf_%d','length','hasOwnProperty','nolimit','raw','getContacts','CmCustomField','format','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','addCustomFields','TEXT','text','Sequelize','INTEGER','switch','defaultValue','sequelize','queryInterface','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','omit','spread','userCmList:save','removeAgents','emit','userCmList:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./cmList.socket','register'];(function(_0x502cf2,_0x3478fb){var _0x3515af=function(_0x2978bb){while(--_0x2978bb){_0x502cf2['push'](_0x502cf2['shift']());}};_0x3515af(++_0x3478fb);}(_0x7cf5,0x75));var _0x57cf=function(_0x564782,_0x4f0b92){_0x564782=_0x564782-0x0;var _0x3d2a1d=_0x7cf5[_0x564782];return _0x3d2a1d;};'use strict';var emlformat=require(_0x57cf('0x0'));var rimraf=require(_0x57cf('0x1'));var zipdir=require(_0x57cf('0x2'));var jsonpatch=require(_0x57cf('0x3'));var rp=require(_0x57cf('0x4'));var moment=require(_0x57cf('0x5'));var BPromise=require(_0x57cf('0x6'));var Mustache=require(_0x57cf('0x7'));var util=require(_0x57cf('0x8'));var path=require(_0x57cf('0x9'));var sox=require(_0x57cf('0xa'));var csv=require(_0x57cf('0xb'));var ejs=require(_0x57cf('0xc'));var fs=require('fs');var fs_extra=require(_0x57cf('0xd'));var _=require(_0x57cf('0xe'));var squel=require(_0x57cf('0xf'));var crypto=require(_0x57cf('0x10'));var jsforce=require(_0x57cf('0x11'));var deskjs=require(_0x57cf('0x12'));var toCsv=require('to-csv');var querystring=require(_0x57cf('0x13'));var Papa=require(_0x57cf('0x14'));var Redis=require(_0x57cf('0x15'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x57cf('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x57cf('0x17'));var utils=require('../../config/utils');var config=require(_0x57cf('0x18'));var licenseUtil=require(_0x57cf('0x19'));var db=require(_0x57cf('0x1a'))['db'];config['redis']=_['defaults'](config[_0x57cf('0x1b')],{'host':_0x57cf('0x1c'),'port':0x18eb});var socket=require(_0x57cf('0x1d'))(new Redis(config[_0x57cf('0x1b')]));require(_0x57cf('0x1e'))[_0x57cf('0x1f')](socket);function respondWithStatusCode(_0x28e18b,_0x4cb84b){_0x4cb84b=_0x4cb84b||0xcc;return function(_0x1b0f8a){if(_0x1b0f8a){return _0x28e18b[_0x57cf('0x20')](_0x4cb84b);}return _0x28e18b[_0x57cf('0x21')](_0x4cb84b)[_0x57cf('0x22')]();};}function respondWithResult(_0x3af0c0,_0x8e743e){_0x8e743e=_0x8e743e||0xc8;return function(_0x3d12d8){if(_0x3d12d8){return _0x3af0c0['status'](_0x8e743e)[_0x57cf('0x23')](_0x3d12d8);}};}function respondWithFilteredResult(_0x253f30,_0x1f0c29){return function(_0x2f616b){if(_0x2f616b){var _0x5e2911=typeof _0x1f0c29[_0x57cf('0x24')]==='undefined'&&typeof _0x1f0c29['limit']===_0x57cf('0x25');var _0x24d2f3=_0x2f616b[_0x57cf('0x26')];var _0x552484=_0x5e2911?0x0:_0x1f0c29[_0x57cf('0x24')];var _0x44e006=_0x5e2911?_0x2f616b[_0x57cf('0x26')]:_0x1f0c29[_0x57cf('0x24')]+_0x1f0c29['limit'];var _0x362643;if(_0x44e006>=_0x24d2f3){_0x44e006=_0x24d2f3;_0x362643=0xc8;}else{_0x362643=0xce;}_0x253f30[_0x57cf('0x21')](_0x362643);return _0x253f30['set'](_0x57cf('0x27'),_0x552484+'-'+_0x44e006+'/'+_0x24d2f3)[_0x57cf('0x23')](_0x2f616b);}return null;};}function patchUpdates(_0x337135){return function(_0xa1a670){try{jsonpatch[_0x57cf('0x28')](_0xa1a670,_0x337135,!![]);}catch(_0x2c13a7){return BPromise[_0x57cf('0x29')](_0x2c13a7);}return _0xa1a670['save']();};}function saveUpdates(_0x4f96ec,_0x182b0a){return function(_0xe8fa63){if(_0xe8fa63){return _0xe8fa63[_0x57cf('0x2a')](_0x4f96ec)[_0x57cf('0x2b')](function(_0x56dbc5){return _0x56dbc5;});}return null;};}function removeEntity(_0x2cace8,_0x1c5454){return function(_0x1785d5){if(_0x1785d5){return _0x1785d5['destroy']()[_0x57cf('0x2b')](function(){var _0x18362c=_0x1785d5[_0x57cf('0x2c')]({'plain':!![]});var _0x4ce4af=_0x57cf('0x2d');return db[_0x57cf('0x2e')][_0x57cf('0x2f')]({'where':{'type':_0x4ce4af,'resourceId':_0x18362c['id']}})[_0x57cf('0x2b')](function(){return _0x1785d5;});})[_0x57cf('0x2b')](function(){_0x2cace8[_0x57cf('0x21')](0xcc)[_0x57cf('0x22')]();});}};}function handleEntityNotFound(_0x4a0b3b,_0x517200){return function(_0x24be9d){if(!_0x24be9d){_0x4a0b3b[_0x57cf('0x20')](0x194);}return _0x24be9d;};}function handleError(_0x3a2f3c,_0x410421){_0x410421=_0x410421||0x1f4;return function(_0x3bb3f4){logger[_0x57cf('0x30')](_0x3bb3f4['stack']);if(_0x3bb3f4[_0x57cf('0x31')]){delete _0x3bb3f4[_0x57cf('0x31')];}_0x3a2f3c['status'](_0x410421)['send'](_0x3bb3f4);};}exports[_0x57cf('0x32')]=function(_0x199226,_0x5cad1f){var _0x315ed6={},_0x4fb313={},_0x5b758d={'count':0x0,'rows':[]};var _0x2616fe=_[_0x57cf('0x33')](db[_0x57cf('0x34')][_0x57cf('0x35')],function(_0x3bd913){return{'name':_0x3bd913[_0x57cf('0x36')],'type':_0x3bd913[_0x57cf('0x37')]['key']};});_0x4fb313['model']=_[_0x57cf('0x33')](_0x2616fe,_0x57cf('0x31'));_0x4fb313[_0x57cf('0x38')]=_[_0x57cf('0x39')](_0x199226[_0x57cf('0x38')]);_0x4fb313['filters']=_[_0x57cf('0x3a')](_0x4fb313[_0x57cf('0x3b')],_0x4fb313[_0x57cf('0x38')]);_0x315ed6[_0x57cf('0x3c')]=_['intersection'](_0x4fb313[_0x57cf('0x3b')],qs[_0x57cf('0x3d')](_0x199226[_0x57cf('0x38')][_0x57cf('0x3d')]));_0x315ed6[_0x57cf('0x3c')]=_0x315ed6['attributes']['length']?_0x315ed6['attributes']:_0x4fb313[_0x57cf('0x3b')];if(!_0x199226[_0x57cf('0x38')]['hasOwnProperty']('nolimit')){_0x315ed6[_0x57cf('0x3e')]=qs[_0x57cf('0x3e')](_0x199226[_0x57cf('0x38')][_0x57cf('0x3e')]);_0x315ed6[_0x57cf('0x24')]=qs[_0x57cf('0x24')](_0x199226['query']['offset']);}_0x315ed6[_0x57cf('0x3f')]=qs[_0x57cf('0x40')](_0x199226[_0x57cf('0x38')][_0x57cf('0x40')]);_0x315ed6[_0x57cf('0x41')]=qs[_0x57cf('0x42')](_[_0x57cf('0x43')](_0x199226['query'],_0x4fb313['filters']),_0x2616fe);if(_0x199226[_0x57cf('0x38')][_0x57cf('0x44')]){_0x315ed6[_0x57cf('0x41')]=_[_0x57cf('0x45')](_0x315ed6[_0x57cf('0x41')],{'$or':_['map'](_0x2616fe,function(_0x261494){if(_0x261494[_0x57cf('0x37')]!==_0x57cf('0x46')){var _0x16a853={};_0x16a853[_0x261494[_0x57cf('0x31')]]={'$like':'%'+_0x199226[_0x57cf('0x38')]['filter']+'%'};return _0x16a853;}})});}_0x315ed6=_[_0x57cf('0x45')]({},_0x315ed6,_0x199226[_0x57cf('0x47')]);var _0x595708={'where':_0x315ed6[_0x57cf('0x41')]};return db[_0x57cf('0x34')][_0x57cf('0x26')](_0x595708)[_0x57cf('0x2b')](function(_0x38b516){_0x5b758d[_0x57cf('0x26')]=_0x38b516;if(_0x199226[_0x57cf('0x38')][_0x57cf('0x48')]){_0x315ed6[_0x57cf('0x49')]=[{'all':!![]}];}return db[_0x57cf('0x34')][_0x57cf('0x4a')](_0x315ed6);})['then'](function(_0x7b081){_0x5b758d[_0x57cf('0x4b')]=_0x7b081;return _0x5b758d;})['then'](respondWithFilteredResult(_0x5cad1f,_0x315ed6))[_0x57cf('0x4c')](handleError(_0x5cad1f,null));};exports['show']=function(_0x174ad4,_0x685d1e){var _0x3a52c0={'raw':![],'where':{'id':_0x174ad4[_0x57cf('0x4d')]['id']}},_0x2ee93d={};_0x2ee93d[_0x57cf('0x3b')]=_[_0x57cf('0x39')](db[_0x57cf('0x34')][_0x57cf('0x35')]);_0x2ee93d['query']=_[_0x57cf('0x39')](_0x174ad4[_0x57cf('0x38')]);_0x2ee93d[_0x57cf('0x42')]=_[_0x57cf('0x3a')](_0x2ee93d['model'],_0x2ee93d[_0x57cf('0x38')]);_0x3a52c0[_0x57cf('0x3c')]=_[_0x57cf('0x3a')](_0x2ee93d[_0x57cf('0x3b')],qs[_0x57cf('0x3d')](_0x174ad4['query'][_0x57cf('0x3d')]));_0x3a52c0[_0x57cf('0x3c')]=_0x3a52c0['attributes']['length']?_0x3a52c0[_0x57cf('0x3c')]:_0x2ee93d[_0x57cf('0x3b')];if(_0x174ad4['query'][_0x57cf('0x48')]){_0x3a52c0['include']=[{'all':!![]}];}_0x3a52c0=_[_0x57cf('0x45')]({},_0x3a52c0,_0x174ad4[_0x57cf('0x47')]);return db[_0x57cf('0x34')][_0x57cf('0x4e')](_0x3a52c0)['then'](handleEntityNotFound(_0x685d1e,null))['then'](respondWithResult(_0x685d1e,null))[_0x57cf('0x4c')](handleError(_0x685d1e,null));};exports[_0x57cf('0x4f')]=function(_0x600b58,_0x22d55a){return db[_0x57cf('0x34')]['create'](_0x600b58[_0x57cf('0x50')],{})[_0x57cf('0x2b')](function(_0x411072){var _0x5b27aa=_0x600b58[_0x57cf('0x51')][_0x57cf('0x2c')]({'plain':!![]});if(!_0x5b27aa)throw new Error(_0x57cf('0x52'));if(_0x5b27aa[_0x57cf('0x53')]===_0x57cf('0x51')){var _0x4c81ce=_0x411072[_0x57cf('0x2c')]({'plain':!![]});var _0x285c89=_0x57cf('0x2d');return db[_0x57cf('0x54')][_0x57cf('0x4e')]({'where':{'name':_0x285c89,'userProfileId':_0x5b27aa[_0x57cf('0x55')]},'raw':!![]})[_0x57cf('0x2b')](function(_0x4c7e87){if(_0x4c7e87&&_0x4c7e87[_0x57cf('0x56')]===0x0){return db[_0x57cf('0x2e')]['create']({'name':_0x4c81ce[_0x57cf('0x31')],'resourceId':_0x4c81ce['id'],'type':_0x4c7e87[_0x57cf('0x31')],'sectionId':_0x4c7e87['id']},{})[_0x57cf('0x2b')](function(){return _0x411072;});}else{return _0x411072;}})['catch'](function(_0x182608){logger[_0x57cf('0x30')](_0x57cf('0x57'),_0x182608);throw _0x182608;});}return _0x411072;})[_0x57cf('0x2b')](respondWithResult(_0x22d55a,0xc9))[_0x57cf('0x4c')](handleError(_0x22d55a,null));};exports[_0x57cf('0x2a')]=function(_0x3b7de0,_0x1dbe5f){if(_0x3b7de0[_0x57cf('0x50')]['id']){delete _0x3b7de0['body']['id'];}return db['CmList'][_0x57cf('0x4e')]({'where':{'id':_0x3b7de0[_0x57cf('0x4d')]['id']}})[_0x57cf('0x2b')](handleEntityNotFound(_0x1dbe5f,null))[_0x57cf('0x2b')](saveUpdates(_0x3b7de0['body'],null))[_0x57cf('0x2b')](respondWithResult(_0x1dbe5f,null))[_0x57cf('0x4c')](handleError(_0x1dbe5f,null));};exports[_0x57cf('0x2f')]=function(_0x1fa7d5,_0x30003e){return db[_0x57cf('0x34')][_0x57cf('0x4e')]({'where':{'id':_0x1fa7d5['params']['id']}})[_0x57cf('0x2b')](handleEntityNotFound(_0x30003e,null))[_0x57cf('0x2b')](removeEntity(_0x30003e,null))['catch'](handleError(_0x30003e,null));};exports[_0x57cf('0x58')]=function(_0x59935b,_0x7bb108){return db[_0x57cf('0x34')][_0x57cf('0x58')]()['then'](respondWithResult(_0x7bb108,null))[_0x57cf('0x4c')](handleError(_0x7bb108,null));};exports[_0x57cf('0x59')]=function(_0x392f5a,_0x12e80e,_0x2425d6){if(_0x392f5a[_0x57cf('0x50')]['id']){delete _0x392f5a[_0x57cf('0x50')]['id'];}return db[_0x57cf('0x34')]['find']({'where':{'id':_0x392f5a[_0x57cf('0x4d')]['id']}})[_0x57cf('0x2b')](handleEntityNotFound(_0x12e80e,null))['then'](function(_0x4b707e){if(_0x4b707e){_0x392f5a[_0x57cf('0x50')][_0x57cf('0x5a')]=_0x4b707e['id'];return db[_0x57cf('0x5b')]['create'](_0x392f5a[_0x57cf('0x50')]);}})[_0x57cf('0x2b')](respondWithResult(_0x12e80e,null))[_0x57cf('0x4c')](handleError(_0x12e80e,null));};exports[_0x57cf('0x5c')]=function(_0x1f0dfd,_0x2a4baf,_0x488995){var _0x48c55c={'raw':![],'where':{}};var _0x19d4c7={};var _0x506f47={'count':0x0,'rows':[]};return db[_0x57cf('0x34')][_0x57cf('0x5d')]({'where':{'id':_0x1f0dfd[_0x57cf('0x4d')]['id']}})[_0x57cf('0x2b')](handleEntityNotFound(_0x2a4baf,null))[_0x57cf('0x2b')](function(_0x4f3956){if(_0x4f3956){_0x19d4c7[_0x57cf('0x3b')]=_[_0x57cf('0x39')](db[_0x57cf('0x5b')][_0x57cf('0x35')]);_0x19d4c7[_0x57cf('0x38')]=_[_0x57cf('0x39')](_0x1f0dfd[_0x57cf('0x38')]);_0x19d4c7[_0x57cf('0x42')]=_['intersection'](_0x19d4c7[_0x57cf('0x3b')],_0x19d4c7[_0x57cf('0x38')]);_0x48c55c[_0x57cf('0x3c')]=_[_0x57cf('0x3a')](_0x19d4c7[_0x57cf('0x3b')],qs[_0x57cf('0x3d')](_0x1f0dfd['query'][_0x57cf('0x3d')]));_0x48c55c[_0x57cf('0x3c')]=_0x48c55c[_0x57cf('0x3c')]['length']?_0x48c55c[_0x57cf('0x3c')]:_0x19d4c7[_0x57cf('0x3b')];if(!_0x1f0dfd[_0x57cf('0x38')]['hasOwnProperty']('nolimit')){_0x48c55c['limit']=qs['limit'](_0x1f0dfd[_0x57cf('0x38')][_0x57cf('0x3e')]);_0x48c55c['offset']=qs[_0x57cf('0x24')](_0x1f0dfd[_0x57cf('0x38')][_0x57cf('0x24')]);}_0x48c55c[_0x57cf('0x3f')]=qs[_0x57cf('0x40')](_0x1f0dfd[_0x57cf('0x38')][_0x57cf('0x40')]);_0x48c55c[_0x57cf('0x41')]=qs[_0x57cf('0x42')](_[_0x57cf('0x43')](_0x1f0dfd[_0x57cf('0x38')],_0x19d4c7[_0x57cf('0x42')]));_0x48c55c[_0x57cf('0x41')][_0x57cf('0x5a')]=_0x4f3956['id'];if(_0x1f0dfd['query']['filter']){_0x48c55c[_0x57cf('0x41')]=_[_0x57cf('0x45')](_0x48c55c[_0x57cf('0x41')],{'$or':_[_0x57cf('0x33')](_0x48c55c['attributes'],function(_0x4911e9){var _0x25889b={};_0x25889b[_0x4911e9]={'$like':'%'+_0x1f0dfd['query'][_0x57cf('0x44')]+'%'};return _0x25889b;})});}_0x48c55c=_[_0x57cf('0x45')]({},_0x48c55c,_0x1f0dfd['options']);return db[_0x57cf('0x5b')][_0x57cf('0x26')]({'where':_0x48c55c[_0x57cf('0x41')]})[_0x57cf('0x2b')](function(_0x3b9732){_0x506f47[_0x57cf('0x26')]=_0x3b9732;if(_0x1f0dfd[_0x57cf('0x38')][_0x57cf('0x48')]){_0x48c55c[_0x57cf('0x49')]=[{'all':!![]}];}return db['Disposition'][_0x57cf('0x4a')](_0x48c55c);})[_0x57cf('0x2b')](function(_0x59cf6f){_0x506f47[_0x57cf('0x4b')]=_0x59cf6f;return _0x506f47;});}})['then'](respondWithFilteredResult(_0x2a4baf,_0x48c55c))['catch'](handleError(_0x2a4baf,null));};exports[_0x57cf('0x5e')]=function(_0x3ab0a6,_0x34276f,_0x46953c){return db[_0x57cf('0x34')][_0x57cf('0x4e')]({'where':{'id':_0x3ab0a6[_0x57cf('0x4d')]['id']}})[_0x57cf('0x2b')](handleEntityNotFound(_0x34276f,null))['then'](function(_0x5ebf45){if(_0x5ebf45){return _0x5ebf45['removeDispositions'](_0x3ab0a6['query'][_0x57cf('0x5f')]);}})[_0x57cf('0x2b')](respondWithStatusCode(_0x34276f,null))['catch'](handleError(_0x34276f,null));};exports['addContacts']=function(_0x2c0060,_0x3d91d5,_0x330997){return db[_0x57cf('0x34')][_0x57cf('0x4e')]({'where':{'id':_0x2c0060[_0x57cf('0x4d')]['id']}})[_0x57cf('0x2b')](handleEntityNotFound(_0x3d91d5,null))[_0x57cf('0x2b')](function(_0x38afe1){if(_0x38afe1){var _0x57b872=[];var _0x517229={'success':[],'errors':[]};return db['CmContact']['describe']()['then'](function(_0x4c2792){if(_0x2c0060['body'][_0x57cf('0x60')]&&_[_0x57cf('0x61')](_0x2c0060[_0x57cf('0x50')][_0x57cf('0x60')])){if(_0x2c0060[_0x57cf('0x50')][_0x57cf('0x60')]['length']){_0x2c0060[_0x57cf('0x50')]['tags']=_0x2c0060[_0x57cf('0x50')][_0x57cf('0x60')][_0x57cf('0x62')](';')+';';}else{_0x2c0060['body'][_0x57cf('0x60')]=null;}}else{_0x2c0060[_0x57cf('0x50')][_0x57cf('0x60')]=null;}if(_0x2c0060[_0x57cf('0x50')]&&_[_0x57cf('0x61')](_0x2c0060[_0x57cf('0x50')])){for(var _0x5791a3=0x0;_0x5791a3<_0x2c0060[_0x57cf('0x50')]['length'];_0x5791a3+=0x1){_0x2c0060[_0x57cf('0x50')][_0x5791a3][_0x57cf('0x5a')]=_0x2c0060[_0x57cf('0x4d')]['id'];_0x57b872[_0x57cf('0x63')](_0x2c0060['body'][_0x5791a3]);}return BPromise[_0x57cf('0x64')](_0x57b872,function(_0x16e9a6){return db['CmContact'][_0x57cf('0x4f')](_['omit'](_0x16e9a6,[_0x57cf('0x5f'),'id'])||{},{'fields':_[_0x57cf('0x39')](_0x4c2792),'raw':!![]})[_0x57cf('0x2b')](function(_0x540ed1){_0x517229[_0x57cf('0x65')][_0x57cf('0x63')](_0x540ed1['dataValues']);})['catch'](function(_0x3eb60a){_0x517229[_0x57cf('0x66')][_0x57cf('0x63')]({'data':_0x16e9a6,'error':_0x3eb60a[_0x57cf('0x67')]});});})[_0x57cf('0x2b')](function(_0x455f8a){return _0x517229;})[_0x57cf('0x4c')](function(_0x12fcd5){return _0x12fcd5;});}else{_0x3d91d5['status'](0x190)[_0x57cf('0x23')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0x57cf('0x2b')](respondWithResult(_0x3d91d5,null))[_0x57cf('0x4c')](handleError(_0x3d91d5,null));};exports['getContacts']=function(_0x2e566a,_0x45b63d,_0x1006a7){var _0x37b1b4;return db['CmList'][_0x57cf('0x4e')]({'where':{'id':_0x2e566a[_0x57cf('0x4d')]['id']},'include':[{'model':db['CmCustomField'],'as':'CustomFields'}]})[_0x57cf('0x2b')](handleEntityNotFound(_0x45b63d,null))[_0x57cf('0x2b')](function(_0x3ae255){if(_0x3ae255){_0x37b1b4=_0x3ae255;return db[_0x57cf('0x68')][_0x57cf('0x35')];}})[_0x57cf('0x2b')](function(_0x5693ff){if(_0x5693ff){var _0x56af6e={};var _0x4b9e66={};_0x4b9e66[_0x57cf('0x3b')]=_[_0x57cf('0x69')](_[_0x57cf('0x39')](_0x5693ff),_[_0x57cf('0x33')](_0x37b1b4[_0x57cf('0x6a')],function(_0x34041d){return util['format'](_0x57cf('0x6b'),_0x34041d['id']);}));_0x4b9e66[_0x57cf('0x38')]=_['keys'](_0x2e566a[_0x57cf('0x38')]);_0x4b9e66[_0x57cf('0x42')]=_[_0x57cf('0x3a')](_0x4b9e66[_0x57cf('0x3b')],_0x4b9e66['query']);_0x56af6e['attributes']=_[_0x57cf('0x3a')](_0x4b9e66[_0x57cf('0x3b')],qs['fields'](_0x2e566a[_0x57cf('0x38')][_0x57cf('0x3d')]));_0x56af6e[_0x57cf('0x3c')]=_0x56af6e['attributes'][_0x57cf('0x6c')]?_0x56af6e['attributes']:_0x4b9e66[_0x57cf('0x3b')];if(!_0x2e566a[_0x57cf('0x38')][_0x57cf('0x6d')](_0x57cf('0x6e'))){_0x56af6e[_0x57cf('0x3e')]=qs[_0x57cf('0x3e')](_0x2e566a['query'][_0x57cf('0x3e')]);_0x56af6e[_0x57cf('0x24')]=qs[_0x57cf('0x24')](_0x2e566a[_0x57cf('0x38')][_0x57cf('0x24')]);}_0x56af6e['order']=qs[_0x57cf('0x40')](_0x2e566a[_0x57cf('0x38')][_0x57cf('0x40')]);_0x56af6e[_0x57cf('0x41')]=qs[_0x57cf('0x42')](_[_0x57cf('0x43')](_0x2e566a[_0x57cf('0x38')],_0x4b9e66[_0x57cf('0x42')]));_0x56af6e[_0x57cf('0x6f')]=!![];if(_0x2e566a[_0x57cf('0x38')][_0x57cf('0x44')]){_0x56af6e[_0x57cf('0x41')]=_[_0x57cf('0x45')](_0x56af6e[_0x57cf('0x41')],{'$or':_[_0x57cf('0x33')](_0x56af6e[_0x57cf('0x3c')],function(_0x3c5d67){var _0x37238d={};_0x37238d[_0x3c5d67]={'$like':'%'+_0x2e566a['query'][_0x57cf('0x44')]+'%'};return _0x37238d;})});}_0x56af6e=_[_0x57cf('0x45')]({},_0x56af6e,_0x2e566a[_0x57cf('0x47')]);return _0x37b1b4[_0x57cf('0x70')](_0x56af6e);}})[_0x57cf('0x2b')](respondWithResult(_0x45b63d,null))[_0x57cf('0x4c')](handleError(_0x45b63d,null));};exports['getContactsCsv']=function(_0x52545e,_0x81047c,_0x2a2d17){var _0x565589;return db['CmList'][_0x57cf('0x4e')]({'where':{'id':_0x52545e[_0x57cf('0x4d')]['id']},'include':[{'model':db[_0x57cf('0x71')],'as':_0x57cf('0x6a')}]})[_0x57cf('0x2b')](handleEntityNotFound(_0x81047c,null))[_0x57cf('0x2b')](function(_0x1b3cc9){if(_0x1b3cc9){_0x565589=_0x1b3cc9;return db[_0x57cf('0x68')][_0x57cf('0x35')];}})[_0x57cf('0x2b')](function(_0x562a09){if(_0x562a09){var _0x518713={};var _0x28c3ba={};_0x28c3ba[_0x57cf('0x3b')]=_[_0x57cf('0x69')](_[_0x57cf('0x39')](_0x562a09),_[_0x57cf('0x33')](_0x565589[_0x57cf('0x6a')],function(_0x301414){return util[_0x57cf('0x72')](_0x57cf('0x6b'),_0x301414['id']);}));_0x28c3ba[_0x57cf('0x38')]=_[_0x57cf('0x39')](_0x52545e['query']);_0x28c3ba[_0x57cf('0x42')]=_[_0x57cf('0x3a')](_0x28c3ba[_0x57cf('0x3b')],_0x28c3ba[_0x57cf('0x38')]);_0x518713['attributes']=_[_0x57cf('0x3a')](_0x28c3ba['model'],qs[_0x57cf('0x3d')](_0x52545e[_0x57cf('0x38')]['fields']));_0x518713[_0x57cf('0x3c')]=_0x518713[_0x57cf('0x3c')]['length']?_0x518713[_0x57cf('0x3c')]:_0x28c3ba[_0x57cf('0x3b')];if(!_0x52545e[_0x57cf('0x38')][_0x57cf('0x6d')](_0x57cf('0x6e'))){_0x518713[_0x57cf('0x3e')]=qs[_0x57cf('0x3e')](_0x52545e['query'][_0x57cf('0x3e')]);_0x518713[_0x57cf('0x24')]=qs[_0x57cf('0x24')](_0x52545e[_0x57cf('0x38')]['offset']);}_0x518713['order']=qs['sort'](_0x52545e[_0x57cf('0x38')]['sort']);_0x518713[_0x57cf('0x41')]=qs[_0x57cf('0x42')](_['pick'](_0x52545e['query'],_0x28c3ba['filters']));_0x518713[_0x57cf('0x6f')]=!![];if(_0x52545e[_0x57cf('0x38')]['filter']){_0x518713[_0x57cf('0x41')]=_[_0x57cf('0x45')](_0x518713[_0x57cf('0x41')],{'$or':_[_0x57cf('0x33')](_0x518713[_0x57cf('0x3c')],function(_0xf86adc){var _0x482c87={};_0x482c87[_0xf86adc]={'$like':'%'+_0x52545e[_0x57cf('0x38')][_0x57cf('0x44')]+'%'};return _0x482c87;})});}_0x518713=_[_0x57cf('0x45')]({},_0x518713,_0x52545e['options']);return _0x565589[_0x57cf('0x70')](_0x518713);}})[_0x57cf('0x2b')](function(_0x1d9c1a){if(!_[_0x57cf('0x73')](_0x1d9c1a)){var _0x411edf=toCsv(_0x1d9c1a);var _0x1a72db=Date[_0x57cf('0x74')]();fs[_0x57cf('0x75')](util[_0x57cf('0x72')](_0x57cf('0x76'),_0x565589['id'],_0x1a72db),_0x411edf);_0x81047c[_0x57cf('0x77')](_0x57cf('0x78'),_0x57cf('0x79')+util[_0x57cf('0x72')](_0x57cf('0x7a'),_0x565589['id'],_0x1a72db));_0x81047c[_0x57cf('0x77')](_0x57cf('0x7b'),_0x57cf('0x7c'));return _0x81047c[_0x57cf('0x7d')](util[_0x57cf('0x72')]('/tmp/list_%d_%s.csv',_0x565589['id'],_0x1a72db));}else{return _0x81047c['sendStatus'](0xcc);}})[_0x57cf('0x4c')](handleError(_0x81047c,null));};exports[_0x57cf('0x7e')]=function(_0x5f45b1,_0x40b48b,_0x7598bd){var _0x5151e2;delete _0x5f45b1[_0x57cf('0x50')]['id'];return db[_0x57cf('0x34')]['findOne']({'where':{'id':_0x5f45b1[_0x57cf('0x4d')]['id']}})[_0x57cf('0x2b')](handleEntityNotFound(_0x40b48b,null))[_0x57cf('0x2b')](function(_0x116240){if(_0x116240){return db['sequelize']['transaction'](function(_0x67ee85){return db['CmCustomField'][_0x57cf('0x4f')](_0x5f45b1['body'],{'transaction':_0x67ee85})[_0x57cf('0x2b')](function(_0x511d3c){_0x5151e2=_0x511d3c;return _0x116240[_0x57cf('0x7f')](_0x511d3c,{'transaction':_0x67ee85});})[_0x57cf('0x2b')](function(){var _0x3b9e08={'type':db['Sequelize'][_0x57cf('0x80')],'transaction':_0x67ee85};switch(_0x5f45b1[_0x57cf('0x50')]['type']){case _0x57cf('0x81'):_0x3b9e08[_0x57cf('0x37')]=db[_0x57cf('0x82')]['TEXT'];break;case'number':_0x3b9e08['type']=db[_0x57cf('0x82')][_0x57cf('0x83')];break;case _0x57cf('0x84'):_0x3b9e08[_0x57cf('0x37')]=db[_0x57cf('0x82')]['BOOLEAN'];_0x3b9e08[_0x57cf('0x85')]=![];break;default:}return db[_0x57cf('0x86')][_0x57cf('0x87')]['addColumn'](_0x57cf('0x88'),util[_0x57cf('0x72')](_0x57cf('0x89'),_0x5151e2['id']),_0x3b9e08);})[_0x57cf('0x2b')](function(){return _0x5151e2;});});}})[_0x57cf('0x2b')](respondWithResult(_0x40b48b,null))[_0x57cf('0x4c')](handleError(_0x40b48b,null));};exports[_0x57cf('0x8a')]=function(_0x109512,_0x5709ae,_0x229dfc){var _0x4a3463={};var _0x3842a8={};var _0x4c3fee;var _0x4d5d73;return db[_0x57cf('0x34')]['findOne']({'where':{'id':_0x109512[_0x57cf('0x4d')]['id']}})[_0x57cf('0x2b')](handleEntityNotFound(_0x5709ae,null))[_0x57cf('0x2b')](function(_0x3bdb04){if(_0x3bdb04){_0x4c3fee=_0x3bdb04;_0x3842a8[_0x57cf('0x3b')]=_[_0x57cf('0x39')](db[_0x57cf('0x71')][_0x57cf('0x35')]);_0x3842a8[_0x57cf('0x38')]=_['keys'](_0x109512['query']);_0x3842a8['filters']=_[_0x57cf('0x3a')](_0x3842a8[_0x57cf('0x3b')],_0x3842a8[_0x57cf('0x38')]);_0x4a3463[_0x57cf('0x3c')]=_[_0x57cf('0x3a')](_0x3842a8[_0x57cf('0x3b')],qs[_0x57cf('0x3d')](_0x109512[_0x57cf('0x38')][_0x57cf('0x3d')]));_0x4a3463[_0x57cf('0x3c')]=_0x4a3463[_0x57cf('0x3c')][_0x57cf('0x6c')]?_0x4a3463[_0x57cf('0x3c')]:_0x3842a8['model'];_0x4a3463[_0x57cf('0x3f')]=qs[_0x57cf('0x40')](_0x109512[_0x57cf('0x38')][_0x57cf('0x40')]);_0x4a3463['where']=qs[_0x57cf('0x42')](_[_0x57cf('0x43')](_0x109512[_0x57cf('0x38')],_0x3842a8[_0x57cf('0x42')]));_0x4a3463[_0x57cf('0x41')]=_[_0x57cf('0x45')](_0x4a3463['where'],{'$or':[{'ListId':_0x3bdb04['id']},{'ListId':null}]});if(_0x109512['query'][_0x57cf('0x44')]){_0x4a3463[_0x57cf('0x41')]=_[_0x57cf('0x45')](_0x4a3463[_0x57cf('0x41')],{'$or':_[_0x57cf('0x33')](_0x4a3463[_0x57cf('0x3c')],function(_0x16e404){var _0x559e1d={};_0x559e1d[_0x16e404]={'$like':'%'+_0x109512[_0x57cf('0x38')]['filter']+'%'};return _0x559e1d;})});}_0x4a3463=_[_0x57cf('0x45')]({},_0x4a3463,_0x109512[_0x57cf('0x47')]);return db[_0x57cf('0x71')][_0x57cf('0x8b')](_0x4a3463);}})['then'](respondWithResult(_0x5709ae,null))[_0x57cf('0x4c')](handleError(_0x5709ae,null));};exports[_0x57cf('0x8c')]=function(_0x3beae4,_0x4e8a31,_0x4cdcfb){return db[_0x57cf('0x34')][_0x57cf('0x4e')]({'where':{'id':_0x3beae4[_0x57cf('0x4d')]['id']}})[_0x57cf('0x2b')](handleEntityNotFound(_0x4e8a31,null))[_0x57cf('0x2b')](function(_0x3b186d){if(_0x3b186d){return _0x3b186d[_0x57cf('0x8c')](_0x3beae4[_0x57cf('0x50')]['ids'],_[_0x57cf('0x8d')](_0x3beae4[_0x57cf('0x50')],[_0x57cf('0x5f'),'id'])||{})[_0x57cf('0x8e')](function(_0x5a4969){for(var _0x4bb256=0x0;_0x4bb256<_0x3beae4[_0x57cf('0x50')][_0x57cf('0x5f')][_0x57cf('0x6c')];_0x4bb256+=0x1){socket['emit'](_0x57cf('0x8f'),{'UserId':Number(_0x3beae4[_0x57cf('0x50')][_0x57cf('0x5f')][_0x4bb256]),'CmListId':Number(_0x3beae4[_0x57cf('0x4d')]['id'])});}return _0x5a4969;});}})[_0x57cf('0x2b')](respondWithResult(_0x4e8a31,null))[_0x57cf('0x4c')](handleError(_0x4e8a31,null));};exports[_0x57cf('0x90')]=function(_0x1293cc,_0x59da1b,_0x367c39){return db['CmList'][_0x57cf('0x4e')]({'where':{'id':_0x1293cc[_0x57cf('0x4d')]['id']}})[_0x57cf('0x2b')](handleEntityNotFound(_0x59da1b,null))['then'](function(_0x54f521){if(_0x54f521){return _0x54f521['removeAgents'](_0x1293cc[_0x57cf('0x38')][_0x57cf('0x5f')])['then'](function(){if(_[_0x57cf('0x61')](_0x1293cc[_0x57cf('0x38')][_0x57cf('0x5f')])){for(var _0x1f9409=0x0;_0x1f9409<_0x1293cc[_0x57cf('0x38')]['ids'][_0x57cf('0x6c')];_0x1f9409+=0x1){socket[_0x57cf('0x91')](_0x57cf('0x92'),{'UserId':Number(_0x1293cc['query'][_0x57cf('0x5f')][_0x1f9409]),'CmListId':Number(_0x1293cc[_0x57cf('0x4d')]['id'])});}}else{socket[_0x57cf('0x91')](_0x57cf('0x92'),{'UserId':Number(_0x1293cc[_0x57cf('0x38')][_0x57cf('0x5f')]),'CmListId':Number(_0x1293cc[_0x57cf('0x4d')]['id'])});}});}})['then'](respondWithStatusCode(_0x59da1b,null))[_0x57cf('0x4c')](handleError(_0x59da1b,null));};exports[_0x57cf('0x93')]=function(_0x212177,_0x5ed0d0,_0x5d62d3){var _0x456dc8={};var _0x13795d={};var _0x1ceaec;var _0x5f3f11;return db[_0x57cf('0x34')]['findOne']({'where':{'id':_0x212177['params']['id']}})['then'](handleEntityNotFound(_0x5ed0d0,null))['then'](function(_0x203bdf){if(_0x203bdf){_0x1ceaec=_0x203bdf;_0x13795d[_0x57cf('0x3b')]=_[_0x57cf('0x39')](db[_0x57cf('0x94')][_0x57cf('0x35')]);_0x13795d['query']=_[_0x57cf('0x39')](_0x212177[_0x57cf('0x38')]);_0x13795d[_0x57cf('0x42')]=_[_0x57cf('0x3a')](_0x13795d[_0x57cf('0x3b')],_0x13795d[_0x57cf('0x38')]);_0x456dc8[_0x57cf('0x3c')]=_[_0x57cf('0x3a')](_0x13795d['model'],qs[_0x57cf('0x3d')](_0x212177['query'][_0x57cf('0x3d')]));_0x456dc8[_0x57cf('0x3c')]=_0x456dc8[_0x57cf('0x3c')][_0x57cf('0x6c')]?_0x456dc8[_0x57cf('0x3c')]:_0x13795d[_0x57cf('0x3b')];_0x456dc8[_0x57cf('0x3f')]=qs['sort'](_0x212177[_0x57cf('0x38')][_0x57cf('0x40')]);_0x456dc8[_0x57cf('0x41')]=qs['filters'](_[_0x57cf('0x43')](_0x212177[_0x57cf('0x38')],_0x13795d[_0x57cf('0x42')]));if(_0x212177[_0x57cf('0x38')][_0x57cf('0x44')]){_0x456dc8[_0x57cf('0x41')]=_[_0x57cf('0x45')](_0x456dc8[_0x57cf('0x41')],{'$or':_['map'](_0x456dc8[_0x57cf('0x3c')],function(_0x25bb62){var _0x2bbde6={};_0x2bbde6[_0x25bb62]={'$like':'%'+_0x212177[_0x57cf('0x38')][_0x57cf('0x44')]+'%'};return _0x2bbde6;})});}_0x456dc8=_[_0x57cf('0x45')]({},_0x456dc8,_0x212177[_0x57cf('0x47')]);return _0x1ceaec[_0x57cf('0x93')](_0x456dc8);}})[_0x57cf('0x2b')](function(_0x2ec716){if(_0x2ec716){_0x5f3f11=_0x2ec716[_0x57cf('0x6c')];if(!_0x212177[_0x57cf('0x38')][_0x57cf('0x6d')](_0x57cf('0x6e'))){_0x456dc8['limit']=qs[_0x57cf('0x3e')](_0x212177[_0x57cf('0x38')][_0x57cf('0x3e')]);_0x456dc8['offset']=qs[_0x57cf('0x24')](_0x212177[_0x57cf('0x38')]['offset']);}return _0x1ceaec[_0x57cf('0x93')](_0x456dc8);}})[_0x57cf('0x2b')](function(_0x11a7d3){if(_0x11a7d3){return _0x11a7d3?{'count':_0x5f3f11,'rows':_0x11a7d3}:null;}})[_0x57cf('0x2b')](respondWithResult(_0x5ed0d0,null))['catch'](handleError(_0x5ed0d0,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 56d0ae8..2add7b0 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(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x326f,0xd1));var _0xf326=function(_0x5b1168,_0x4a0ad8){_0x5b1168=_0x5b1168-0x0;var _0x234f72=_0x326f[_0x5b1168];return _0x234f72;};'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 _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(_0x4f5c99,_0x11508f){_0x4f5c99=_0x4f5c99-0x0;var _0x41493d=_0x326f[_0x4f5c99];return _0x41493d;};'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 diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index ca3447c..e3e8796 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 _0xb58b=['CmList','cm_lists','util','../../config/logger','api','bluebird','request-promise','rimraf','./cmList.attributes','exports','define'];(function(_0xe7d24e,_0x235022){var _0x42c6e3=function(_0x7fe642){while(--_0x7fe642){_0xe7d24e['push'](_0xe7d24e['shift']());}};_0x42c6e3(++_0x235022);}(_0xb58b,0x1f1));var _0xbb58=function(_0x3f77ce,_0x21f9af){_0x3f77ce=_0x3f77ce-0x0;var _0x46e096=_0xb58b[_0x3f77ce];return _0x46e096;};'use strict';var _=require('lodash');var util=require(_0xbb58('0x0'));var logger=require(_0xbb58('0x1'))(_0xbb58('0x2'));var moment=require('moment');var BPromise=require(_0xbb58('0x3'));var rp=require(_0xbb58('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbb58('0x5'));var config=require('../../config/environment');var attributes=require(_0xbb58('0x6'));module[_0xbb58('0x7')]=function(_0x33fe85,_0x5cf8b1){return _0x33fe85[_0xbb58('0x8')](_0xbb58('0x9'),attributes,{'tableName':_0xbb58('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf109=['CmList','cm_lists','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports','define'];(function(_0x19d828,_0x2439ce){var _0x25b133=function(_0x5214a8){while(--_0x5214a8){_0x19d828['push'](_0x19d828['shift']());}};_0x25b133(++_0x2439ce);}(_0xf109,0xce));var _0x9f10=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0xf109[_0x22b68a];return _0x1ac67a;};'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 diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index f006416..4fe8ef5 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 _0x06b8=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0x4d07cc,_0x587613){var _0x42de3b=function(_0x201f78){while(--_0x201f78){_0x4d07cc['push'](_0x4d07cc['shift']());}};_0x42de3b(++_0x587613);}(_0x06b8,0x13f));var _0x806b=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x06b8[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x806b('0x0'));var util=require(_0x806b('0x1'));var moment=require(_0x806b('0x2'));var BPromise=require(_0x806b('0x3'));var rs=require(_0x806b('0x4'));var fs=require('fs');var Redis=require(_0x806b('0x5'));var db=require(_0x806b('0x6'))['db'];var utils=require(_0x806b('0x7'));var logger=require(_0x806b('0x8'))(_0x806b('0x9'));var config=require(_0x806b('0xa'));var jayson=require(_0x806b('0xb'));var client=jayson[_0x806b('0xc')][_0x806b('0xd')]({'port':0x232a});config[_0x806b('0xe')]=_[_0x806b('0xf')](config[_0x806b('0xe')],{'host':_0x806b('0x10'),'port':0x18eb});var socket=require(_0x806b('0x11'))(new Redis(config[_0x806b('0xe')]));require(_0x806b('0x12'))[_0x806b('0x13')](socket);function respondWithRpcPromise(_0x59fdbd,_0x147fb2,_0x2b8adf){return new BPromise(function(_0x2a0d2e,_0x2a0fef){return client[_0x806b('0x14')](_0x59fdbd,_0x2b8adf)[_0x806b('0x15')](function(_0x103be7){logger[_0x806b('0x16')](_0x806b('0x17'),_0x147fb2,_0x806b('0x18'));logger[_0x806b('0x19')](_0x806b('0x1a'),_0x147fb2,_0x806b('0x18'),JSON['stringify'](_0x103be7));if(_0x103be7[_0x806b('0x1b')]){if(_0x103be7[_0x806b('0x1b')][_0x806b('0x1c')]===0x1f4){logger[_0x806b('0x1b')](_0x806b('0x17'),_0x147fb2,_0x103be7[_0x806b('0x1b')][_0x806b('0x1d')]);return _0x2a0fef(_0x103be7[_0x806b('0x1b')][_0x806b('0x1d')]);}logger['error'](_0x806b('0x17'),_0x147fb2,_0x103be7['error']['message']);return _0x2a0d2e(_0x103be7['error']['message']);}else{logger['info'](_0x806b('0x17'),_0x147fb2,'request\x20sent');_0x2a0d2e(_0x103be7[_0x806b('0x1e')]['message']);}})[_0x806b('0x1f')](function(_0x5acf41){logger['error'](_0x806b('0x17'),_0x147fb2,_0x5acf41);_0x2a0fef(_0x5acf41);});});} \ No newline at end of file +var _0x497a=['socket.io-emitter','./cmList.socket','register','request','then','request\x20sent','debug','error','code','CmList,\x20%s,\x20%s','message','info','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost'];(function(_0x4e3abe,_0x23d12a){var _0x26409c=function(_0x64f205){while(--_0x64f205){_0x4e3abe['push'](_0x4e3abe['shift']());}};_0x26409c(++_0x23d12a);}(_0x497a,0x1ce));var _0xa497=function(_0x46d0c9,_0x526bfa){_0x46d0c9=_0x46d0c9-0x0;var _0x174506=_0x497a[_0x46d0c9];return _0x174506;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa497('0x0'));var BPromise=require(_0xa497('0x1'));var rs=require(_0xa497('0x2'));var fs=require('fs');var Redis=require(_0xa497('0x3'));var db=require(_0xa497('0x4'))['db'];var utils=require(_0xa497('0x5'));var logger=require(_0xa497('0x6'))(_0xa497('0x7'));var config=require(_0xa497('0x8'));var jayson=require(_0xa497('0x9'));var client=jayson[_0xa497('0xa')]['http']({'port':0x232a});config['redis']=_[_0xa497('0xb')](config[_0xa497('0xc')],{'host':_0xa497('0xd'),'port':0x18eb});var socket=require(_0xa497('0xe'))(new Redis(config[_0xa497('0xc')]));require(_0xa497('0xf'))[_0xa497('0x10')](socket);function respondWithRpcPromise(_0x20df50,_0x131acb,_0x19db26){return new BPromise(function(_0x4c8826,_0x1ac92a){return client[_0xa497('0x11')](_0x20df50,_0x19db26)[_0xa497('0x12')](function(_0x28b08c){logger['info']('CmList,\x20%s,\x20%s',_0x131acb,_0xa497('0x13'));logger[_0xa497('0x14')]('CmList,\x20%s,\x20%s,\x20%s',_0x131acb,'request\x20sent',JSON['stringify'](_0x28b08c));if(_0x28b08c[_0xa497('0x15')]){if(_0x28b08c['error'][_0xa497('0x16')]===0x1f4){logger[_0xa497('0x15')](_0xa497('0x17'),_0x131acb,_0x28b08c[_0xa497('0x15')][_0xa497('0x18')]);return _0x1ac92a(_0x28b08c[_0xa497('0x15')][_0xa497('0x18')]);}logger['error'](_0xa497('0x17'),_0x131acb,_0x28b08c['error'][_0xa497('0x18')]);return _0x4c8826(_0x28b08c['error'][_0xa497('0x18')]);}else{logger[_0xa497('0x19')](_0xa497('0x17'),_0x131acb,'request\x20sent');_0x4c8826(_0x28b08c[_0xa497('0x1a')][_0xa497('0x18')]);}})[_0xa497('0x1b')](function(_0x3a0126){logger[_0xa497('0x15')](_0xa497('0x17'),_0x131acb,_0x3a0126);_0x1ac92a(_0x3a0126);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 2cc3bca..4280eec 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 _0x60dc=['./cmList.events','save','update','removeListener','register','length'];(function(_0x2a9d4d,_0x37e68c){var _0xe32c68=function(_0x39bf87){while(--_0x39bf87){_0x2a9d4d['push'](_0x2a9d4d['shift']());}};_0xe32c68(++_0x37e68c);}(_0x60dc,0x1f2));var _0xc60d=function(_0x2619e6,_0x22d45e){_0x2619e6=_0x2619e6-0x0;var _0x3eaec7=_0x60dc[_0x2619e6];return _0x3eaec7;};'use strict';var CmListEvents=require(_0xc60d('0x0'));var events=[_0xc60d('0x1'),'remove',_0xc60d('0x2')];function createListener(_0x45735a,_0x523504){return function(_0x1035a2){_0x523504['emit'](_0x45735a,_0x1035a2);};}function removeListener(_0x188108,_0x1b70db){return function(){CmListEvents[_0xc60d('0x3')](_0x188108,_0x1b70db);};}exports[_0xc60d('0x4')]=function(_0x3c0de0){for(var _0x34e910=0x0,_0x3a8c6b=events[_0xc60d('0x5')];_0x34e910<_0x3a8c6b;_0x34e910++){var _0x51f00b=events[_0x34e910];var _0x11a9fa=createListener('cmList:'+_0x51f00b,_0x3c0de0);CmListEvents['on'](_0x51f00b,_0x11a9fa);}}; \ No newline at end of file +var _0xebca=['register','length','cmList:','./cmList.events','save','emit'];(function(_0x43d79c,_0x531a55){var _0x4866b0=function(_0x847a){while(--_0x847a){_0x43d79c['push'](_0x43d79c['shift']());}};_0x4866b0(++_0x531a55);}(_0xebca,0x1bf));var _0xaebc=function(_0xfe26da,_0x5ac1b7){_0xfe26da=_0xfe26da-0x0;var _0x2abe6e=_0xebca[_0xfe26da];return _0x2abe6e;};'use strict';var CmListEvents=require(_0xaebc('0x0'));var events=[_0xaebc('0x1'),'remove','update'];function createListener(_0x1da0e8,_0x12ce9e){return function(_0x322694){_0x12ce9e[_0xaebc('0x2')](_0x1da0e8,_0x322694);};}function removeListener(_0x49ce9b,_0x33a13a){return function(){CmListEvents['removeListener'](_0x49ce9b,_0x33a13a);};}exports[_0xaebc('0x3')]=function(_0x27a518){for(var _0x8ab3f5=0x0,_0x35398d=events[_0xaebc('0x4')];_0x8ab3f5<_0x35398d;_0x8ab3f5++){var _0x5b00f6=events[_0x8ab3f5];var _0x4cd55c=createListener(_0xaebc('0x5')+_0x5b00f6,_0x27a518);CmListEvents['on'](_0x5b00f6,_0x4cd55c);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 84fa65c..9d3c81e 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 _0x9b4e=['../../components/auth/service','../../components/interaction/service','./cmList.controller','isAuthenticated','index','get','describe','/:id','show','getDispositions','/:id/contacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','create','post','/:id/dispositions','addContacts','addAgents','put','update','delete','destroy','/:id/users','removeAgents','path','connect-timeout','Router','fs-extra'];(function(_0x587d2d,_0x57c114){var _0x537bd8=function(_0xf5c2bb){while(--_0xf5c2bb){_0x587d2d['push'](_0x587d2d['shift']());}};_0x537bd8(++_0x57c114);}(_0x9b4e,0x1be));var _0xe9b4=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9b4e[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe9b4('0x0'));var timeout=require(_0xe9b4('0x1'));var express=require('express');var router=express[_0xe9b4('0x2')]();var fs_extra=require(_0xe9b4('0x3'));var auth=require(_0xe9b4('0x4'));var interaction=require(_0xe9b4('0x5'));var config=require('../../config/environment');var controller=require(_0xe9b4('0x6'));router['get']('/',auth[_0xe9b4('0x7')](),controller[_0xe9b4('0x8')]);router[_0xe9b4('0x9')]('/describe',auth[_0xe9b4('0x7')](),controller[_0xe9b4('0xa')]);router[_0xe9b4('0x9')](_0xe9b4('0xb'),auth[_0xe9b4('0x7')](),controller[_0xe9b4('0xc')]);router[_0xe9b4('0x9')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xe9b4('0xd')]);router['get'](_0xe9b4('0xe'),auth[_0xe9b4('0x7')](),controller['getContacts']);router[_0xe9b4('0x9')](_0xe9b4('0xf'),auth[_0xe9b4('0x7')](),controller[_0xe9b4('0x10')]);router[_0xe9b4('0x9')](_0xe9b4('0x11'),auth[_0xe9b4('0x7')](),controller[_0xe9b4('0x12')]);router['get']('/:id/users',auth[_0xe9b4('0x7')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0xe9b4('0x13')]);router[_0xe9b4('0x14')](_0xe9b4('0x15'),auth[_0xe9b4('0x7')](),controller['addDisposition']);router['post'](_0xe9b4('0xe'),auth[_0xe9b4('0x7')](),controller[_0xe9b4('0x16')]);router[_0xe9b4('0x14')](_0xe9b4('0x11'),auth[_0xe9b4('0x7')](),controller['addCustomField']);router[_0xe9b4('0x14')]('/:id/users',auth[_0xe9b4('0x7')](),controller[_0xe9b4('0x17')]);router[_0xe9b4('0x18')]('/:id',auth[_0xe9b4('0x7')](),controller[_0xe9b4('0x19')]);router[_0xe9b4('0x1a')](_0xe9b4('0xb'),auth[_0xe9b4('0x7')](),controller[_0xe9b4('0x1b')]);router['delete']('/:id/dispositions',auth[_0xe9b4('0x7')](),controller['removeDispositions']);router[_0xe9b4('0x1a')](_0xe9b4('0x1c'),auth[_0xe9b4('0x7')](),controller[_0xe9b4('0x1d')]);module['exports']=router; \ No newline at end of file +var _0x7335=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmList.controller','index','get','describe','/:id','isAuthenticated','show','/:id/dispositions','/:id/contacts','getContacts','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','addDisposition','addCustomField','addAgents','put','update','delete','removeDispositions','removeAgents'];(function(_0xf1b354,_0x32048c){var _0x405d3a=function(_0x2e1dbc){while(--_0x2e1dbc){_0xf1b354['push'](_0xf1b354['shift']());}};_0x405d3a(++_0x32048c);}(_0x7335,0xef));var _0x5733=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x7335[_0x45d3f0];return _0x314b79;};'use strict';var multer=require(_0x5733('0x0'));var util=require('util');var path=require(_0x5733('0x1'));var timeout=require(_0x5733('0x2'));var express=require(_0x5733('0x3'));var router=express[_0x5733('0x4')]();var fs_extra=require(_0x5733('0x5'));var auth=require(_0x5733('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5733('0x7'));var controller=require(_0x5733('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x5733('0x9')]);router[_0x5733('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x5733('0xb')]);router[_0x5733('0xa')](_0x5733('0xc'),auth[_0x5733('0xd')](),controller[_0x5733('0xe')]);router[_0x5733('0xa')](_0x5733('0xf'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x5733('0xa')](_0x5733('0x10'),auth[_0x5733('0xd')](),controller[_0x5733('0x11')]);router[_0x5733('0xa')]('/:id/contacts/csv',auth['isAuthenticated'](),controller[_0x5733('0x12')]);router[_0x5733('0xa')](_0x5733('0x13'),auth[_0x5733('0xd')](),controller[_0x5733('0x14')]);router[_0x5733('0xa')](_0x5733('0x15'),auth[_0x5733('0xd')](),controller[_0x5733('0x16')]);router[_0x5733('0x17')]('/',auth['isAuthenticated'](),controller[_0x5733('0x18')]);router['post'](_0x5733('0xf'),auth[_0x5733('0xd')](),controller[_0x5733('0x19')]);router['post'](_0x5733('0x10'),auth[_0x5733('0xd')](),controller['addContacts']);router[_0x5733('0x17')](_0x5733('0x13'),auth['isAuthenticated'](),controller[_0x5733('0x1a')]);router[_0x5733('0x17')](_0x5733('0x15'),auth[_0x5733('0xd')](),controller[_0x5733('0x1b')]);router[_0x5733('0x1c')](_0x5733('0xc'),auth[_0x5733('0xd')](),controller[_0x5733('0x1d')]);router['delete'](_0x5733('0xc'),auth[_0x5733('0xd')](),controller['destroy']);router[_0x5733('0x1e')](_0x5733('0xf'),auth['isAuthenticated'](),controller[_0x5733('0x1f')]);router[_0x5733('0x1e')](_0x5733('0x15'),auth['isAuthenticated'](),controller[_0x5733('0x20')]);module[_0x5733('0x21')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index d968791..e33bec1 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 _0x3d08=['VIRTUAL','getDataValue','field','STRING','exports'];(function(_0x37c26a,_0x5d9ad7){var _0x142388=function(_0x367edc){while(--_0x367edc){_0x37c26a['push'](_0x37c26a['shift']());}};_0x142388(++_0x5d9ad7);}(_0x3d08,0x158));var _0x83d0=function(_0x217b85,_0x50e436){_0x217b85=_0x217b85-0x0;var _0x2c1617=_0x3d08[_0x217b85];return _0x2c1617;};'use strict';var Sequelize=require('sequelize');module[_0x83d0('0x0')]={'name':{'type':Sequelize[_0x83d0('0x1')],'get':function(_0x410b6e){return this[_0x83d0('0x2')](_0x83d0('0x3'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x83d0('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0xfc28=['exports','getDataValue','STRING','sequelize'];(function(_0x2c896c,_0x422261){var _0x553990=function(_0x14118e){while(--_0x14118e){_0x2c896c['push'](_0x2c896c['shift']());}};_0x553990(++_0x422261);}(_0xfc28,0x1ef));var _0x8fc2=function(_0x115f1b,_0x58e1b2){_0x115f1b=_0x115f1b-0x0;var _0xc3393a=_0xfc28[_0x115f1b];return _0xc3393a;};'use strict';var Sequelize=require(_0x8fc2('0x0'));module[_0x8fc2('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x3da768){return this[_0x8fc2('0x2')]('field');}},'field':{'type':Sequelize[_0x8fc2('0x3')],'allowNull':![]},'operator':{'type':Sequelize[_0x8fc2('0x3')],'allowNull':![]},'value':{'type':Sequelize[_0x8fc2('0x3')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index e329b2a..f8a1992 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x216c0c,_0x291a14){var _0x26d5a1=function(_0x35a3bf){while(--_0x35a3bf){_0x216c0c['push'](_0x216c0c['shift']());}};_0x26d5a1(++_0x291a14);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file +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(_0x39f0b0,_0x88ba80){var _0x462831=function(_0x431f8c){while(--_0x431f8c){_0x39f0b0['push'](_0x39f0b0['shift']());}};_0x462831(++_0x88ba80);}(_0x7a54,0x106));var _0x47a5=function(_0x5a44a4,_0x5935d6){_0x5a44a4=_0x5a44a4-0x0;var _0xcf1317=_0x7a54[_0x5a44a4];return _0xcf1317;};'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 99e0588..aaa8de4 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 _0x91cf=['rimraf','../../config/environment','./condition.attributes','exports','define','Condition','tools_conditions','lodash','../../config/logger','moment','bluebird','request-promise','path'];(function(_0xc686ed,_0x20386b){var _0x32f6c1=function(_0xff37d4){while(--_0xff37d4){_0xc686ed['push'](_0xc686ed['shift']());}};_0x32f6c1(++_0x20386b);}(_0x91cf,0xbd));var _0xf91c=function(_0x32d6f0,_0x20bd82){_0x32d6f0=_0x32d6f0-0x0;var _0x48540f=_0x91cf[_0x32d6f0];return _0x48540f;};'use strict';var _=require(_0xf91c('0x0'));var util=require('util');var logger=require(_0xf91c('0x1'))('api');var moment=require(_0xf91c('0x2'));var BPromise=require(_0xf91c('0x3'));var rp=require(_0xf91c('0x4'));var fs=require('fs');var path=require(_0xf91c('0x5'));var rimraf=require(_0xf91c('0x6'));var config=require(_0xf91c('0x7'));var attributes=require(_0xf91c('0x8'));module[_0xf91c('0x9')]=function(_0x53feb2,_0x578678){return _0x53feb2[_0xf91c('0xa')](_0xf91c('0xb'),attributes,{'tableName':_0xf91c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb87b=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./condition.attributes','exports','define','Condition','lodash','util'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xb87b,0xb2));var _0xbb87=function(_0x190b91,_0x2f4cfe){_0x190b91=_0x190b91-0x0;var _0x2db823=_0xb87b[_0x190b91];return _0x2db823;};'use strict';var _=require(_0xbb87('0x0'));var util=require(_0xbb87('0x1'));var logger=require(_0xbb87('0x2'))('api');var moment=require(_0xbb87('0x3'));var BPromise=require(_0xbb87('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbb87('0x5'));var rimraf=require(_0xbb87('0x6'));var config=require(_0xbb87('0x7'));var attributes=require(_0xbb87('0x8'));module[_0xbb87('0x9')]=function(_0x3e9a16,_0x374b6d){return _0x3e9a16[_0xbb87('0xa')](_0xbb87('0xb'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index 6712001..3ffc373 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 _0x048c=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','Condition,\x20%s,\x20%s','request\x20sent','Condition,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x048c,0x164));var _0xc048=function(_0x1e51aa,_0x1a1169){_0x1e51aa=_0x1e51aa-0x0;var _0x41affe=_0x048c[_0x1e51aa];return _0x41affe;};'use strict';var _=require(_0xc048('0x0'));var util=require('util');var moment=require(_0xc048('0x1'));var BPromise=require(_0xc048('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc048('0x3'));var db=require(_0xc048('0x4'))['db'];var utils=require(_0xc048('0x5'));var logger=require(_0xc048('0x6'))(_0xc048('0x7'));var config=require('../../config/environment');var jayson=require(_0xc048('0x8'));var client=jayson[_0xc048('0x9')][_0xc048('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x21962c,_0x3c9176,_0x53ec65){return new BPromise(function(_0xe7bb47,_0x2c5de5){return client[_0xc048('0xb')](_0x21962c,_0x53ec65)['then'](function(_0x4459ac){logger['info'](_0xc048('0xc'),_0x3c9176,_0xc048('0xd'));logger['debug'](_0xc048('0xe'),_0x3c9176,_0xc048('0xd'),JSON['stringify'](_0x4459ac));if(_0x4459ac['error']){if(_0x4459ac[_0xc048('0xf')][_0xc048('0x10')]===0x1f4){logger[_0xc048('0xf')](_0xc048('0xc'),_0x3c9176,_0x4459ac['error'][_0xc048('0x11')]);return _0x2c5de5(_0x4459ac['error'][_0xc048('0x11')]);}logger['error'](_0xc048('0xc'),_0x3c9176,_0x4459ac[_0xc048('0xf')][_0xc048('0x11')]);return _0xe7bb47(_0x4459ac[_0xc048('0xf')][_0xc048('0x11')]);}else{logger[_0xc048('0x12')](_0xc048('0xc'),_0x3c9176,_0xc048('0xd'));_0xe7bb47(_0x4459ac[_0xc048('0x13')]['message']);}})[_0xc048('0x14')](function(_0x8e2501){logger[_0xc048('0xf')](_0xc048('0xc'),_0x3c9176,_0x8e2501);_0x2c5de5(_0x8e2501);});});} \ No newline at end of file +var _0x1959=['../../config/utils','../../config/logger','../../config/environment','client','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','randomstring','../../mysqldb'];(function(_0x547ff4,_0x416fa1){var _0xe41057=function(_0x1afe63){while(--_0x1afe63){_0x547ff4['push'](_0x547ff4['shift']());}};_0xe41057(++_0x416fa1);}(_0x1959,0x121));var _0x9195=function(_0x3d27a,_0x31311d){_0x3d27a=_0x3d27a-0x0;var _0x314fd7=_0x1959[_0x3d27a];return _0x314fd7;};'use strict';var _=require(_0x9195('0x0'));var util=require(_0x9195('0x1'));var moment=require(_0x9195('0x2'));var BPromise=require('bluebird');var rs=require(_0x9195('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9195('0x4'))['db'];var utils=require(_0x9195('0x5'));var logger=require(_0x9195('0x6'))('rpc');var config=require(_0x9195('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9195('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x305a24,_0xbba445,_0x1720b6){return new BPromise(function(_0x5e4aae,_0x511f23){return client[_0x9195('0x9')](_0x305a24,_0x1720b6)[_0x9195('0xa')](function(_0x3686e3){logger[_0x9195('0xb')](_0x9195('0xc'),_0xbba445,_0x9195('0xd'));logger[_0x9195('0xe')](_0x9195('0xf'),_0xbba445,_0x9195('0xd'),JSON[_0x9195('0x10')](_0x3686e3));if(_0x3686e3[_0x9195('0x11')]){if(_0x3686e3[_0x9195('0x11')][_0x9195('0x12')]===0x1f4){logger[_0x9195('0x11')](_0x9195('0xc'),_0xbba445,_0x3686e3['error'][_0x9195('0x13')]);return _0x511f23(_0x3686e3['error'][_0x9195('0x13')]);}logger[_0x9195('0x11')](_0x9195('0xc'),_0xbba445,_0x3686e3[_0x9195('0x11')]['message']);return _0x5e4aae(_0x3686e3[_0x9195('0x11')][_0x9195('0x13')]);}else{logger[_0x9195('0xb')]('Condition,\x20%s,\x20%s',_0xbba445,_0x9195('0xd'));_0x5e4aae(_0x3686e3[_0x9195('0x14')]['message']);}})['catch'](function(_0x2483b5){logger['error'](_0x9195('0xc'),_0xbba445,_0x2483b5);_0x511f23(_0x2483b5);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 09b9674..1cb04b4 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 _0xa283=['Router','fs-extra','../../components/interaction/service','../../config/environment','./condition.controller','put','isAuthenticated','update','delete','/:id','destroy','exports','path','connect-timeout'];(function(_0x261e29,_0x10fffd){var _0x25ef43=function(_0x21b8e7){while(--_0x21b8e7){_0x261e29['push'](_0x261e29['shift']());}};_0x25ef43(++_0x10fffd);}(_0xa283,0x1b0));var _0x3a28=function(_0x94339d,_0x38378d){_0x94339d=_0x94339d-0x0;var _0x5cabdb=_0xa283[_0x94339d];return _0x5cabdb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3a28('0x0'));var timeout=require(_0x3a28('0x1'));var express=require('express');var router=express[_0x3a28('0x2')]();var fs_extra=require(_0x3a28('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x3a28('0x4'));var config=require(_0x3a28('0x5'));var controller=require(_0x3a28('0x6'));router[_0x3a28('0x7')]('/:id',auth[_0x3a28('0x8')](),controller[_0x3a28('0x9')]);router[_0x3a28('0xa')](_0x3a28('0xb'),auth[_0x3a28('0x8')](),controller[_0x3a28('0xc')]);module[_0x3a28('0xd')]=router; \ No newline at end of file +var _0x4b6d=['../../components/interaction/service','put','/:id','isAuthenticated','update','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x2d4065,_0x38dc95){var _0xef6016=function(_0x195cee){while(--_0x195cee){_0x2d4065['push'](_0x2d4065['shift']());}};_0xef6016(++_0x38dc95);}(_0x4b6d,0xff));var _0xd4b6=function(_0x487780,_0x50efd9){_0x487780=_0x487780-0x0;var _0x40328c=_0x4b6d[_0x487780];return _0x40328c;};'use strict';var multer=require(_0xd4b6('0x0'));var util=require(_0xd4b6('0x1'));var path=require('path');var timeout=require(_0xd4b6('0x2'));var express=require(_0xd4b6('0x3'));var router=express[_0xd4b6('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd4b6('0x5'));var config=require('../../config/environment');var controller=require('./condition.controller');router[_0xd4b6('0x6')](_0xd4b6('0x7'),auth[_0xd4b6('0x8')](),controller[_0xd4b6('0x9')]);router[_0xd4b6('0xa')](_0xd4b6('0x7'),auth[_0xd4b6('0x8')](),controller[_0xd4b6('0xb')]);module[_0xd4b6('0xc')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 86c7ec2..1a0517a 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 _0x757a=['exports','STRING'];(function(_0x4954c0,_0x3e8838){var _0x27a38f=function(_0x278f1f){while(--_0x278f1f){_0x4954c0['push'](_0x4954c0['shift']());}};_0x27a38f(++_0x3e8838);}(_0x757a,0xde));var _0xa757=function(_0x4b7e0a,_0x9b5f59){_0x4b7e0a=_0x4b7e0a-0x0;var _0x2db2e5=_0x757a[_0x4b7e0a];return _0x2db2e5;};'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(_0xd0b415,_0x149675){var _0x2bdf2c=function(_0x59fbfa){while(--_0x59fbfa){_0xd0b415['push'](_0xd0b415['shift']());}};_0x2bdf2c(++_0x149675);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1fc122,_0x5e2c17){_0x1fc122=_0x1fc122-0x0;var _0xa2cb13=_0xb7e7[_0x1fc122];return _0xa2cb13;};'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/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 56d13b2..84edf01 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 _0x4448=['DashboardId','DashboardItem','getItems','findOne','eml-format','fast-json-patch','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./dashboard.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','apply','reject','update','then','destroy','get','UserProfileResource','send','index','Dashboard','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','type','VIRTUAL','name','includeAll','include','findAll','rows','catch','params','length','find','create','body','role','CustomDashboards','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','options','omit','createdAt','updatedAt','user','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie2','attrSerie3','attrReport','attrRefresh','widgetAttributes:\x20%s'];(function(_0x58176f,_0x55a4e5){var _0x14ccb0=function(_0x3d373b){while(--_0x3d373b){_0x58176f['push'](_0x58176f['shift']());}};_0x14ccb0(++_0x55a4e5);}(_0x4448,0x84));var _0x8444=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x4448[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x8444('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8444('0x1'));var rp=require('request-promise');var moment=require(_0x8444('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8444('0x3'));var path=require(_0x8444('0x4'));var sox=require(_0x8444('0x5'));var csv=require(_0x8444('0x6'));var ejs=require(_0x8444('0x7'));var fs=require('fs');var fs_extra=require(_0x8444('0x8'));var _=require(_0x8444('0x9'));var squel=require('squel');var crypto=require(_0x8444('0xa'));var jsforce=require(_0x8444('0xb'));var deskjs=require(_0x8444('0xc'));var toCsv=require(_0x8444('0x6'));var querystring=require(_0x8444('0xd'));var Papa=require(_0x8444('0xe'));var Redis=require(_0x8444('0xf'));var authService=require(_0x8444('0x10'));var qs=require(_0x8444('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8444('0x12'));var logger=require(_0x8444('0x13'))(_0x8444('0x14'));var utils=require(_0x8444('0x15'));var config=require(_0x8444('0x16'));var licenseUtil=require(_0x8444('0x17'));var db=require(_0x8444('0x18'))['db'];config[_0x8444('0x19')]=_[_0x8444('0x1a')](config[_0x8444('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x8444('0x1b'))(new Redis(config[_0x8444('0x19')]));require(_0x8444('0x1c'))[_0x8444('0x1d')](socket);function respondWithStatusCode(_0x54d4b3,_0x4e5ffb){_0x4e5ffb=_0x4e5ffb||0xcc;return function(_0x5adf2c){if(_0x5adf2c){return _0x54d4b3[_0x8444('0x1e')](_0x4e5ffb);}return _0x54d4b3[_0x8444('0x1f')](_0x4e5ffb)[_0x8444('0x20')]();};}function respondWithResult(_0x343561,_0x34a6c9){_0x34a6c9=_0x34a6c9||0xc8;return function(_0x293cdf){if(_0x293cdf){return _0x343561['status'](_0x34a6c9)[_0x8444('0x21')](_0x293cdf);}};}function respondWithFilteredResult(_0x509321,_0xed943f){return function(_0x389eaf){if(_0x389eaf){var _0x5c1d6a=typeof _0xed943f[_0x8444('0x22')]==='undefined'&&typeof _0xed943f[_0x8444('0x23')]===_0x8444('0x24');var _0x5df6da=_0x389eaf['count'];var _0x13ab16=_0x5c1d6a?0x0:_0xed943f[_0x8444('0x22')];var _0xa4027=_0x5c1d6a?_0x389eaf[_0x8444('0x25')]:_0xed943f[_0x8444('0x22')]+_0xed943f[_0x8444('0x23')];var _0x278259;if(_0xa4027>=_0x5df6da){_0xa4027=_0x5df6da;_0x278259=0xc8;}else{_0x278259=0xce;}_0x509321[_0x8444('0x1f')](_0x278259);return _0x509321['set']('Content-Range',_0x13ab16+'-'+_0xa4027+'/'+_0x5df6da)[_0x8444('0x21')](_0x389eaf);}return null;};}function patchUpdates(_0x2d77ef){return function(_0x5e48ab){try{jsonpatch[_0x8444('0x26')](_0x5e48ab,_0x2d77ef,!![]);}catch(_0x122fcb){return BPromise[_0x8444('0x27')](_0x122fcb);}return _0x5e48ab['save']();};}function saveUpdates(_0x51a4bc,_0x11e362){return function(_0x4e3c97){if(_0x4e3c97){return _0x4e3c97[_0x8444('0x28')](_0x51a4bc)[_0x8444('0x29')](function(_0xa3461a){return _0xa3461a;});}return null;};}function removeEntity(_0x49c1e8,_0x59201d){return function(_0x3936c6){if(_0x3936c6){return _0x3936c6[_0x8444('0x2a')]()[_0x8444('0x29')](function(){var _0x489c73=_0x3936c6[_0x8444('0x2b')]({'plain':!![]});var _0x2b6914='CustomDashboards';return db[_0x8444('0x2c')]['destroy']({'where':{'type':_0x2b6914,'resourceId':_0x489c73['id']}})['then'](function(){return _0x3936c6;});})[_0x8444('0x29')](function(){_0x49c1e8[_0x8444('0x1f')](0xcc)[_0x8444('0x20')]();});}};}function handleEntityNotFound(_0x109f3b,_0x4b5422){return function(_0x5f09be){if(!_0x5f09be){_0x109f3b[_0x8444('0x1e')](0x194);}return _0x5f09be;};}function handleError(_0x2f15ae,_0x49504b){_0x49504b=_0x49504b||0x1f4;return function(_0x39e95a){logger['error'](_0x39e95a['stack']);if(_0x39e95a['name']){delete _0x39e95a['name'];}_0x2f15ae[_0x8444('0x1f')](_0x49504b)[_0x8444('0x2d')](_0x39e95a);};}exports[_0x8444('0x2e')]=function(_0x4791bd,_0x1d1d33){var _0x3ff164={},_0x4f9e7e={},_0xaba749={'count':0x0,'rows':[]};var _0x42bdc2=_['map'](db[_0x8444('0x2f')][_0x8444('0x30')],function(_0x448d0b){return{'name':_0x448d0b[_0x8444('0x31')],'type':_0x448d0b['type'][_0x8444('0x32')]};});_0x4f9e7e[_0x8444('0x33')]=_['map'](_0x42bdc2,'name');_0x4f9e7e[_0x8444('0x34')]=_[_0x8444('0x35')](_0x4791bd[_0x8444('0x34')]);_0x4f9e7e['filters']=_[_0x8444('0x36')](_0x4f9e7e[_0x8444('0x33')],_0x4f9e7e[_0x8444('0x34')]);_0x3ff164[_0x8444('0x37')]=_[_0x8444('0x36')](_0x4f9e7e[_0x8444('0x33')],qs[_0x8444('0x38')](_0x4791bd[_0x8444('0x34')][_0x8444('0x38')]));_0x3ff164[_0x8444('0x37')]=_0x3ff164[_0x8444('0x37')]['length']?_0x3ff164[_0x8444('0x37')]:_0x4f9e7e[_0x8444('0x33')];if(!_0x4791bd[_0x8444('0x34')][_0x8444('0x39')](_0x8444('0x3a'))){_0x3ff164[_0x8444('0x23')]=qs[_0x8444('0x23')](_0x4791bd[_0x8444('0x34')][_0x8444('0x23')]);_0x3ff164[_0x8444('0x22')]=qs[_0x8444('0x22')](_0x4791bd['query'][_0x8444('0x22')]);}_0x3ff164[_0x8444('0x3b')]=qs[_0x8444('0x3c')](_0x4791bd[_0x8444('0x34')][_0x8444('0x3c')]);_0x3ff164[_0x8444('0x3d')]=qs[_0x8444('0x3e')](_[_0x8444('0x3f')](_0x4791bd[_0x8444('0x34')],_0x4f9e7e[_0x8444('0x3e')]),_0x42bdc2);if(_0x4791bd['query'][_0x8444('0x40')]){_0x3ff164['where']=_[_0x8444('0x41')](_0x3ff164[_0x8444('0x3d')],{'$or':_[_0x8444('0x42')](_0x42bdc2,function(_0x569779){if(_0x569779[_0x8444('0x43')]!==_0x8444('0x44')){var _0xdd2db5={};_0xdd2db5[_0x569779[_0x8444('0x45')]]={'$like':'%'+_0x4791bd['query'][_0x8444('0x40')]+'%'};return _0xdd2db5;}})});}_0x3ff164=_[_0x8444('0x41')]({},_0x3ff164,_0x4791bd['options']);var _0x58c9e2={'where':_0x3ff164['where']};return db[_0x8444('0x2f')][_0x8444('0x25')](_0x58c9e2)['then'](function(_0xad7f66){_0xaba749[_0x8444('0x25')]=_0xad7f66;if(_0x4791bd[_0x8444('0x34')][_0x8444('0x46')]){_0x3ff164[_0x8444('0x47')]=[{'all':!![]}];}return db['Dashboard'][_0x8444('0x48')](_0x3ff164);})[_0x8444('0x29')](function(_0x1ffa6c){_0xaba749[_0x8444('0x49')]=_0x1ffa6c;return _0xaba749;})[_0x8444('0x29')](respondWithFilteredResult(_0x1d1d33,_0x3ff164))[_0x8444('0x4a')](handleError(_0x1d1d33,null));};exports['show']=function(_0x82c46e,_0x194f48){var _0x448fa4={'raw':![],'where':{'id':_0x82c46e[_0x8444('0x4b')]['id']}},_0x56c317={};_0x56c317[_0x8444('0x33')]=_[_0x8444('0x35')](db['Dashboard'][_0x8444('0x30')]);_0x56c317[_0x8444('0x34')]=_[_0x8444('0x35')](_0x82c46e[_0x8444('0x34')]);_0x56c317[_0x8444('0x3e')]=_[_0x8444('0x36')](_0x56c317['model'],_0x56c317[_0x8444('0x34')]);_0x448fa4['attributes']=_[_0x8444('0x36')](_0x56c317[_0x8444('0x33')],qs[_0x8444('0x38')](_0x82c46e['query']['fields']));_0x448fa4['attributes']=_0x448fa4[_0x8444('0x37')][_0x8444('0x4c')]?_0x448fa4['attributes']:_0x56c317['model'];if(_0x82c46e[_0x8444('0x34')][_0x8444('0x46')]){_0x448fa4[_0x8444('0x47')]=[{'all':!![]}];}_0x448fa4=_['merge']({},_0x448fa4,_0x82c46e['options']);return db[_0x8444('0x2f')][_0x8444('0x4d')](_0x448fa4)['then'](handleEntityNotFound(_0x194f48,null))[_0x8444('0x29')](respondWithResult(_0x194f48,null))['catch'](handleError(_0x194f48,null));};exports[_0x8444('0x4e')]=function(_0x21e7fc,_0x4b3191){return db[_0x8444('0x2f')][_0x8444('0x4e')](_0x21e7fc[_0x8444('0x4f')],{})[_0x8444('0x29')](function(_0x461f57){var _0x331663=_0x21e7fc['user'][_0x8444('0x2b')]({'plain':!![]});if(!_0x331663)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x331663[_0x8444('0x50')]==='user'){var _0xf2009f=_0x461f57[_0x8444('0x2b')]({'plain':!![]});var _0x3751e1=_0x8444('0x51');return db[_0x8444('0x52')][_0x8444('0x4d')]({'where':{'name':_0x3751e1,'userProfileId':_0x331663[_0x8444('0x53')]},'raw':!![]})[_0x8444('0x29')](function(_0x3b8fad){if(_0x3b8fad&&_0x3b8fad[_0x8444('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0xf2009f[_0x8444('0x45')],'resourceId':_0xf2009f['id'],'type':_0x3b8fad[_0x8444('0x45')],'sectionId':_0x3b8fad['id']},{})[_0x8444('0x29')](function(){return _0x461f57;});}else{return _0x461f57;}})['catch'](function(_0x52a943){logger[_0x8444('0x55')](_0x8444('0x56'),_0x52a943);throw _0x52a943;});}return _0x461f57;})[_0x8444('0x29')](respondWithResult(_0x4b3191,0xc9))['catch'](handleError(_0x4b3191,null));};exports['clone']=function(_0x110e82,_0x484de6){var _0x15ee2b={'where':{'id':_0x110e82[_0x8444('0x4b')]['id']}},_0x27ae4f={};_0x27ae4f[_0x8444('0x33')]=_['keys'](db[_0x8444('0x2f')][_0x8444('0x30')]);_0x15ee2b[_0x8444('0x37')]=_[_0x8444('0x36')](_0x27ae4f[_0x8444('0x33')],qs[_0x8444('0x38')](_0x110e82['query'][_0x8444('0x38')]));_0x15ee2b[_0x8444('0x37')]=_0x15ee2b[_0x8444('0x37')]['length']?_0x15ee2b[_0x8444('0x37')]:_0x27ae4f[_0x8444('0x33')];if(_0x110e82[_0x8444('0x34')][_0x8444('0x46')]){_0x15ee2b[_0x8444('0x47')]=[{'all':!![]}];}_0x15ee2b=_[_0x8444('0x41')]({},_0x15ee2b,_0x110e82[_0x8444('0x57')]);return db['Dashboard'][_0x8444('0x4d')](_0x15ee2b)[_0x8444('0x29')](handleEntityNotFound(_0x484de6,null))[_0x8444('0x29')](function(_0x179b31){if(_0x179b31){var _0x29a613=_0x179b31['get']({'plain':!![]});_0x29a613=qs[_0x8444('0x58')](_0x29a613,['id',_0x8444('0x59'),_0x8444('0x5a')]);_0x110e82[_0x8444('0x4f')]=_[_0x8444('0x58')](_0x110e82[_0x8444('0x4f')],['id',_0x8444('0x59'),_0x8444('0x5a')]);return db[_0x8444('0x2f')][_0x8444('0x4e')](_['merge'](_0x29a613,_0x110e82[_0x8444('0x4f')]),{'include':_0x110e82['query'][_0x8444('0x46')]?[{'all':!![]}]:undefined})[_0x8444('0x29')](function(_0x1ffca0){var _0xbb5f79=_0x110e82[_0x8444('0x5b')]['get']({'plain':!![]});if(!_0xbb5f79)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xbb5f79[_0x8444('0x50')]===_0x8444('0x5b')){var _0x1671cc=_0x1ffca0[_0x8444('0x2b')]({'plain':!![]});var _0x561ece=_0x8444('0x51');return db[_0x8444('0x52')][_0x8444('0x4d')]({'where':{'name':_0x561ece,'userProfileId':_0xbb5f79['userProfileId']},'raw':!![]})[_0x8444('0x29')](function(_0x78ac54){if(_0x78ac54&&_0x78ac54[_0x8444('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x1671cc['name'],'resourceId':_0x1671cc['id'],'type':_0x78ac54[_0x8444('0x45')],'sectionId':_0x78ac54['id']},{})[_0x8444('0x29')](function(){return _0x1ffca0;});}else{return _0x1ffca0;}})[_0x8444('0x4a')](function(_0x28ed13){logger[_0x8444('0x55')](_0x8444('0x56'),_0x28ed13);throw _0x28ed13;});}return _0x1ffca0;});}})[_0x8444('0x29')](respondWithResult(_0x484de6,0xc9))[_0x8444('0x4a')](handleError(_0x484de6,null));};exports[_0x8444('0x28')]=function(_0x2701be,_0x4eb501){if(_0x2701be[_0x8444('0x4f')]['id']){delete _0x2701be['body']['id'];}return db[_0x8444('0x2f')][_0x8444('0x4d')]({'where':{'id':_0x2701be[_0x8444('0x4b')]['id']}})[_0x8444('0x29')](handleEntityNotFound(_0x4eb501,null))[_0x8444('0x29')](saveUpdates(_0x2701be[_0x8444('0x4f')],null))[_0x8444('0x29')](respondWithResult(_0x4eb501,null))[_0x8444('0x4a')](handleError(_0x4eb501,null));};exports[_0x8444('0x2a')]=function(_0x12e2e3,_0x5bdb69){return db[_0x8444('0x2f')][_0x8444('0x4d')]({'where':{'id':_0x12e2e3[_0x8444('0x4b')]['id']}})[_0x8444('0x29')](handleEntityNotFound(_0x5bdb69,null))[_0x8444('0x29')](removeEntity(_0x5bdb69,null))['catch'](handleError(_0x5bdb69,null));};function widgetAttributes(_0x394280){try{switch(_0x394280[_0x8444('0x43')]){case _0x8444('0x5c'):return[{'name':'attrUrl','value':_0x394280[_0x8444('0x5d')]||(_0x394280[_0x8444('0x5e')]&&_0x394280['attrs'][0x0]?_0x394280['attrs'][0x0][_0x8444('0x5f')]:undefined)||_0x8444('0x60')}];case _0x8444('0x61'):return[{'name':_0x8444('0x62'),'value':_0x394280[_0x8444('0x62')]||(_0x394280[_0x8444('0x5e')]&&_0x394280[_0x8444('0x5e')][0x0]?_0x394280['attrs'][0x0]['value']:undefined)||''}];case _0x8444('0x63'):return[{'name':_0x8444('0x64'),'value':_0x394280[_0x8444('0x64')]||(_0x394280[_0x8444('0x5e')]&&_0x394280[_0x8444('0x5e')][0x0]?_0x394280[_0x8444('0x5e')][0x0][_0x8444('0x5f')]:undefined)||_0x8444('0x65')},{'name':_0x8444('0x66'),'value':_0x394280[_0x8444('0x66')]||(_0x394280['attrs']&&_0x394280[_0x8444('0x5e')][0x1]?_0x394280[_0x8444('0x5e')][0x1][_0x8444('0x5f')]:undefined)||_0x8444('0x67')},{'name':_0x8444('0x68'),'value':_0x394280[_0x8444('0x68')]||(_0x394280[_0x8444('0x5e')]&&_0x394280[_0x8444('0x5e')][0x2]?_0x394280[_0x8444('0x5e')][0x2]['value']:undefined)||0xc}];case _0x8444('0x69'):return[{'name':_0x8444('0x6a'),'value':_0x394280[_0x8444('0x6a')]||(_0x394280[_0x8444('0x5e')]&&_0x394280['attrs'][0x0]?_0x394280[_0x8444('0x5e')][0x0][_0x8444('0x5f')]:undefined)||_0x8444('0x6b')},{'name':_0x8444('0x6c'),'value':_0x394280['attrVoiceQueues']||(_0x394280[_0x8444('0x5e')]&&_0x394280[_0x8444('0x5e')][0x1]?_0x394280['attrs'][0x1][_0x8444('0x5f')]:undefined)||[]},{'name':_0x8444('0x68'),'value':_0x394280[_0x8444('0x68')]||(_0x394280[_0x8444('0x5e')]&&_0x394280[_0x8444('0x5e')][0x2]?_0x394280[_0x8444('0x5e')][0x2][_0x8444('0x5f')]:undefined)||0x14},{'name':_0x8444('0x6d'),'value':_0x394280[_0x8444('0x6d')]||(_0x394280['attrs']&&_0x394280[_0x8444('0x5e')][0x3]?_0x394280[_0x8444('0x5e')][0x3][_0x8444('0x5f')]:undefined)||_0x8444('0x6e')},{'name':_0x8444('0x6f'),'value':_0x394280[_0x8444('0x6f')]||(_0x394280[_0x8444('0x5e')]&&_0x394280[_0x8444('0x5e')][0x4]?_0x394280[_0x8444('0x5e')][0x4][_0x8444('0x5f')]:undefined)||''},{'name':_0x8444('0x70'),'value':_0x394280[_0x8444('0x70')]||(_0x394280['attrs']&&_0x394280[_0x8444('0x5e')][0x5]?_0x394280[_0x8444('0x5e')][0x5][_0x8444('0x5f')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x394280[_0x8444('0x71')]||(_0x394280[_0x8444('0x5e')]&&_0x394280[_0x8444('0x5e')][0x6]?_0x394280[_0x8444('0x5e')][0x6][_0x8444('0x5f')]:undefined)||''},{'name':_0x8444('0x72'),'value':_0x394280[_0x8444('0x72')]||(_0x394280[_0x8444('0x5e')]&&_0x394280['attrs'][0x7]?_0x394280[_0x8444('0x5e')][0x7][_0x8444('0x5f')]:undefined)||''},{'name':_0x8444('0x73'),'value':_0x394280[_0x8444('0x73')]||(_0x394280[_0x8444('0x5e')]&&_0x394280['attrs'][0x8]?_0x394280[_0x8444('0x5e')][0x8]['value']:undefined)||''},{'name':_0x8444('0x74'),'value':_0x394280['attrChatWebsites']||(_0x394280['attrs']&&_0x394280[_0x8444('0x5e')][0x9]?_0x394280['attrs'][0x9]['value']:undefined)||''}];case _0x8444('0x75'):case _0x8444('0x76'):return[{'name':'attrSerie1','value':_0x394280['attrSerie1']||(_0x394280['attrs']&&_0x394280[_0x8444('0x5e')][0x0]?_0x394280[_0x8444('0x5e')][0x0][_0x8444('0x5f')]:undefined)||_0x8444('0x6b')},{'name':_0x8444('0x77'),'value':_0x394280[_0x8444('0x77')]||(_0x394280['attrs']&&_0x394280['attrs'][0x1]?_0x394280[_0x8444('0x5e')][0x1][_0x8444('0x5f')]:undefined)||null},{'name':_0x8444('0x78'),'value':_0x394280['attrSerie3']||(_0x394280[_0x8444('0x5e')]&&_0x394280[_0x8444('0x5e')][0x2]?_0x394280['attrs'][0x2][_0x8444('0x5f')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x394280[_0x8444('0x6c')]||(_0x394280[_0x8444('0x5e')]&&_0x394280[_0x8444('0x5e')][0x3]?_0x394280[_0x8444('0x5e')][0x3][_0x8444('0x5f')]:undefined)||[]},{'name':'attrChannel','value':_0x394280[_0x8444('0x6d')]||(_0x394280[_0x8444('0x5e')]&&_0x394280[_0x8444('0x5e')][0x4]?_0x394280[_0x8444('0x5e')][0x4][_0x8444('0x5f')]:undefined)||_0x8444('0x6e')},{'name':_0x8444('0x6f'),'value':_0x394280[_0x8444('0x6f')]||(_0x394280[_0x8444('0x5e')]&&_0x394280[_0x8444('0x5e')][0x5]?_0x394280[_0x8444('0x5e')][0x5][_0x8444('0x5f')]:undefined)||''},{'name':_0x8444('0x70'),'value':_0x394280[_0x8444('0x70')]||(_0x394280[_0x8444('0x5e')]&&_0x394280[_0x8444('0x5e')][0x6]?_0x394280[_0x8444('0x5e')][0x6]['value']:undefined)||''},{'name':_0x8444('0x71'),'value':_0x394280[_0x8444('0x71')]||(_0x394280[_0x8444('0x5e')]&&_0x394280[_0x8444('0x5e')][0x7]?_0x394280[_0x8444('0x5e')][0x7][_0x8444('0x5f')]:undefined)||''},{'name':_0x8444('0x72'),'value':_0x394280['attrOpenchannelAccounts']||(_0x394280[_0x8444('0x5e')]&&_0x394280[_0x8444('0x5e')][0x8]?_0x394280['attrs'][0x8][_0x8444('0x5f')]:undefined)||''},{'name':_0x8444('0x73'),'value':_0x394280[_0x8444('0x73')]||(_0x394280[_0x8444('0x5e')]&&_0x394280['attrs'][0x9]?_0x394280[_0x8444('0x5e')][0x9]['value']:undefined)||''},{'name':'attrChatWebsites','value':_0x394280[_0x8444('0x74')]||(_0x394280[_0x8444('0x5e')]&&_0x394280[_0x8444('0x5e')][0xa]?_0x394280[_0x8444('0x5e')][0xa][_0x8444('0x5f')]:undefined)||''}];case'web-report':return[{'name':_0x8444('0x79'),'type':_0x394280['reportType']||(_0x394280[_0x8444('0x5e')]&&_0x394280[_0x8444('0x5e')][0x0]?_0x394280[_0x8444('0x5e')][0x0][_0x8444('0x43')]:undefined)||null,'value':_0x394280['attrReport']||(_0x394280[_0x8444('0x5e')]&&_0x394280[_0x8444('0x5e')][0x0]?_0x394280[_0x8444('0x5e')][0x0]['value']:undefined)||null},{'name':_0x8444('0x7a'),'value':_0x394280['attrRefresh']||(_0x394280[_0x8444('0x5e')]&&_0x394280[_0x8444('0x5e')][0x1]?_0x394280[_0x8444('0x5e')][0x1][_0x8444('0x5f')]:undefined)||0x0}];default:return[];}}catch(_0xe99451){logger[_0x8444('0x55')](_0x8444('0x7b'),JSON['stringify'](_0xe99451));return[];}}exports['addItem']=function(_0x5cdff9,_0x58d915,_0x19bab3){if(_0x5cdff9[_0x8444('0x4f')]['id']){delete _0x5cdff9[_0x8444('0x4f')]['id'];}return db[_0x8444('0x2f')][_0x8444('0x4d')]({'where':{'id':_0x5cdff9[_0x8444('0x4b')]['id']}})[_0x8444('0x29')](handleEntityNotFound(_0x58d915,null))[_0x8444('0x29')](function(_0x202c2c){if(_0x202c2c){_0x5cdff9[_0x8444('0x4f')][_0x8444('0x7c')]=_0x202c2c['id'];_0x5cdff9['body'][_0x8444('0x5e')]=widgetAttributes(_0x5cdff9['body']);return db[_0x8444('0x7d')][_0x8444('0x4e')](_0x5cdff9[_0x8444('0x4f')]);}})[_0x8444('0x29')](respondWithResult(_0x58d915,null))[_0x8444('0x4a')](handleError(_0x58d915,null));};exports[_0x8444('0x7e')]=function(_0x339d7b,_0xcbf267,_0x196f62){var _0xe237b={};var _0x183344={};var _0x53772b;var _0x20328c;return db[_0x8444('0x2f')][_0x8444('0x7f')]({'where':{'id':_0x339d7b[_0x8444('0x4b')]['id']}})[_0x8444('0x29')](handleEntityNotFound(_0xcbf267,null))[_0x8444('0x29')](function(_0x232513){if(_0x232513){_0x53772b=_0x232513;_0x183344[_0x8444('0x33')]=_[_0x8444('0x35')](db[_0x8444('0x7d')][_0x8444('0x30')]);_0x183344['query']=_[_0x8444('0x35')](_0x339d7b[_0x8444('0x34')]);_0x183344[_0x8444('0x3e')]=_[_0x8444('0x36')](_0x183344[_0x8444('0x33')],_0x183344[_0x8444('0x34')]);_0xe237b[_0x8444('0x37')]=_[_0x8444('0x36')](_0x183344[_0x8444('0x33')],qs[_0x8444('0x38')](_0x339d7b['query'][_0x8444('0x38')]));_0xe237b[_0x8444('0x37')]=_0xe237b[_0x8444('0x37')][_0x8444('0x4c')]?_0xe237b[_0x8444('0x37')]:_0x183344['model'];_0xe237b[_0x8444('0x3b')]=qs[_0x8444('0x3c')](_0x339d7b[_0x8444('0x34')]['sort']);_0xe237b[_0x8444('0x3d')]=qs[_0x8444('0x3e')](_[_0x8444('0x3f')](_0x339d7b[_0x8444('0x34')],_0x183344[_0x8444('0x3e')]));if(_0x339d7b[_0x8444('0x34')][_0x8444('0x40')]){_0xe237b['where']=_[_0x8444('0x41')](_0xe237b[_0x8444('0x3d')],{'$or':_[_0x8444('0x42')](_0xe237b[_0x8444('0x37')],function(_0x3fb0b7){var _0x5cb554={};_0x5cb554[_0x3fb0b7]={'$like':'%'+_0x339d7b[_0x8444('0x34')]['filter']+'%'};return _0x5cb554;})});}_0xe237b=_[_0x8444('0x41')]({},_0xe237b,_0x339d7b[_0x8444('0x57')]);return _0x53772b['getItems'](_0xe237b);}})[_0x8444('0x29')](function(_0x186c61){if(_0x186c61){_0x20328c=_0x186c61[_0x8444('0x4c')];if(!_0x339d7b[_0x8444('0x34')][_0x8444('0x39')](_0x8444('0x3a'))){_0xe237b['limit']=qs[_0x8444('0x23')](_0x339d7b[_0x8444('0x34')][_0x8444('0x23')]);_0xe237b[_0x8444('0x22')]=qs[_0x8444('0x22')](_0x339d7b[_0x8444('0x34')][_0x8444('0x22')]);}return _0x53772b[_0x8444('0x7e')](_0xe237b);}})[_0x8444('0x29')](function(_0x26e330){if(_0x26e330){return _0x26e330?{'count':_0x20328c,'rows':_0x26e330}:null;}})[_0x8444('0x29')](respondWithResult(_0xcbf267,null))[_0x8444('0x4a')](handleError(_0xcbf267,null));}; \ No newline at end of file +var _0xd1b3=['omit','updatedAt','createdAt','iframe','attrUrl','attrs','value','https://','custom','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','voice','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','total','attrSerie3','attrEmailAccounts','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','DashboardId','getItems','findOne','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./dashboard.socket','register','status','end','offset','undefined','set','Content-Range','apply','reject','save','update','then','destroy','get','CustomDashboards','UserProfileResource','sendStatus','error','stack','name','send','index','map','Dashboard','fieldName','type','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','options','count','includeAll','findAll','rows','catch','show','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params'];(function(_0x3513ee,_0x48daa6){var _0x1660f8=function(_0x121d2c){while(--_0x121d2c){_0x3513ee['push'](_0x3513ee['shift']());}};_0x1660f8(++_0x48daa6);}(_0xd1b3,0x12c));var _0x3d1b=function(_0x1b2461,_0x1cd8cc){_0x1b2461=_0x1b2461-0x0;var _0x56b12d=_0xd1b3[_0x1b2461];return _0x56b12d;};'use strict';var emlformat=require(_0x3d1b('0x0'));var rimraf=require(_0x3d1b('0x1'));var zipdir=require(_0x3d1b('0x2'));var jsonpatch=require(_0x3d1b('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3d1b('0x4'));var Mustache=require(_0x3d1b('0x5'));var util=require('util');var path=require('path');var sox=require(_0x3d1b('0x6'));var csv=require(_0x3d1b('0x7'));var ejs=require(_0x3d1b('0x8'));var fs=require('fs');var fs_extra=require(_0x3d1b('0x9'));var _=require('lodash');var squel=require(_0x3d1b('0xa'));var crypto=require('crypto');var jsforce=require(_0x3d1b('0xb'));var deskjs=require(_0x3d1b('0xc'));var toCsv=require(_0x3d1b('0x7'));var querystring=require(_0x3d1b('0xd'));var Papa=require(_0x3d1b('0xe'));var Redis=require(_0x3d1b('0xf'));var authService=require(_0x3d1b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x3d1b('0x11'));var hardwareService=require(_0x3d1b('0x12'));var logger=require(_0x3d1b('0x13'))(_0x3d1b('0x14'));var utils=require(_0x3d1b('0x15'));var config=require(_0x3d1b('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x3d1b('0x17'))['db'];config[_0x3d1b('0x18')]=_[_0x3d1b('0x19')](config[_0x3d1b('0x18')],{'host':_0x3d1b('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3d1b('0x18')]));require(_0x3d1b('0x1b'))[_0x3d1b('0x1c')](socket);function respondWithStatusCode(_0x2be487,_0x77366){_0x77366=_0x77366||0xcc;return function(_0x4ac3a1){if(_0x4ac3a1){return _0x2be487['sendStatus'](_0x77366);}return _0x2be487[_0x3d1b('0x1d')](_0x77366)[_0x3d1b('0x1e')]();};}function respondWithResult(_0xfdca5,_0x5017ef){_0x5017ef=_0x5017ef||0xc8;return function(_0xb8022){if(_0xb8022){return _0xfdca5[_0x3d1b('0x1d')](_0x5017ef)['json'](_0xb8022);}};}function respondWithFilteredResult(_0xfe83a2,_0x55743a){return function(_0x354684){if(_0x354684){var _0x3d402f=typeof _0x55743a[_0x3d1b('0x1f')]===_0x3d1b('0x20')&&typeof _0x55743a['limit']===_0x3d1b('0x20');var _0x3826ec=_0x354684['count'];var _0x2078e1=_0x3d402f?0x0:_0x55743a['offset'];var _0x5078b4=_0x3d402f?_0x354684['count']:_0x55743a[_0x3d1b('0x1f')]+_0x55743a['limit'];var _0xa04c80;if(_0x5078b4>=_0x3826ec){_0x5078b4=_0x3826ec;_0xa04c80=0xc8;}else{_0xa04c80=0xce;}_0xfe83a2[_0x3d1b('0x1d')](_0xa04c80);return _0xfe83a2[_0x3d1b('0x21')](_0x3d1b('0x22'),_0x2078e1+'-'+_0x5078b4+'/'+_0x3826ec)['json'](_0x354684);}return null;};}function patchUpdates(_0xe46fcc){return function(_0x54ad70){try{jsonpatch[_0x3d1b('0x23')](_0x54ad70,_0xe46fcc,!![]);}catch(_0x1a3b8d){return BPromise[_0x3d1b('0x24')](_0x1a3b8d);}return _0x54ad70[_0x3d1b('0x25')]();};}function saveUpdates(_0x2ca1dd,_0x3b3cdf){return function(_0x87ac94){if(_0x87ac94){return _0x87ac94[_0x3d1b('0x26')](_0x2ca1dd)[_0x3d1b('0x27')](function(_0x43757e){return _0x43757e;});}return null;};}function removeEntity(_0x2c2dcc,_0x1d9125){return function(_0x2d85f5){if(_0x2d85f5){return _0x2d85f5[_0x3d1b('0x28')]()[_0x3d1b('0x27')](function(){var _0x4d4fc9=_0x2d85f5[_0x3d1b('0x29')]({'plain':!![]});var _0x203210=_0x3d1b('0x2a');return db[_0x3d1b('0x2b')]['destroy']({'where':{'type':_0x203210,'resourceId':_0x4d4fc9['id']}})[_0x3d1b('0x27')](function(){return _0x2d85f5;});})[_0x3d1b('0x27')](function(){_0x2c2dcc[_0x3d1b('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2bf2bb,_0x366390){return function(_0x5b410d){if(!_0x5b410d){_0x2bf2bb[_0x3d1b('0x2c')](0x194);}return _0x5b410d;};}function handleError(_0x5d3f57,_0x3dd194){_0x3dd194=_0x3dd194||0x1f4;return function(_0xb5053a){logger[_0x3d1b('0x2d')](_0xb5053a[_0x3d1b('0x2e')]);if(_0xb5053a[_0x3d1b('0x2f')]){delete _0xb5053a[_0x3d1b('0x2f')];}_0x5d3f57[_0x3d1b('0x1d')](_0x3dd194)[_0x3d1b('0x30')](_0xb5053a);};}exports[_0x3d1b('0x31')]=function(_0x351588,_0x5cde83){var _0x31dadd={},_0x3ca195={},_0x248246={'count':0x0,'rows':[]};var _0xe5d97a=_[_0x3d1b('0x32')](db[_0x3d1b('0x33')]['rawAttributes'],function(_0x472c37){return{'name':_0x472c37[_0x3d1b('0x34')],'type':_0x472c37[_0x3d1b('0x35')]['key']};});_0x3ca195['model']=_[_0x3d1b('0x32')](_0xe5d97a,'name');_0x3ca195[_0x3d1b('0x36')]=_[_0x3d1b('0x37')](_0x351588[_0x3d1b('0x36')]);_0x3ca195['filters']=_[_0x3d1b('0x38')](_0x3ca195[_0x3d1b('0x39')],_0x3ca195['query']);_0x31dadd['attributes']=_[_0x3d1b('0x38')](_0x3ca195[_0x3d1b('0x39')],qs[_0x3d1b('0x3a')](_0x351588[_0x3d1b('0x36')][_0x3d1b('0x3a')]));_0x31dadd[_0x3d1b('0x3b')]=_0x31dadd[_0x3d1b('0x3b')][_0x3d1b('0x3c')]?_0x31dadd['attributes']:_0x3ca195['model'];if(!_0x351588['query'][_0x3d1b('0x3d')](_0x3d1b('0x3e'))){_0x31dadd[_0x3d1b('0x3f')]=qs[_0x3d1b('0x3f')](_0x351588[_0x3d1b('0x36')][_0x3d1b('0x3f')]);_0x31dadd[_0x3d1b('0x1f')]=qs['offset'](_0x351588[_0x3d1b('0x36')]['offset']);}_0x31dadd[_0x3d1b('0x40')]=qs['sort'](_0x351588[_0x3d1b('0x36')][_0x3d1b('0x41')]);_0x31dadd[_0x3d1b('0x42')]=qs[_0x3d1b('0x43')](_[_0x3d1b('0x44')](_0x351588[_0x3d1b('0x36')],_0x3ca195[_0x3d1b('0x43')]),_0xe5d97a);if(_0x351588[_0x3d1b('0x36')][_0x3d1b('0x45')]){_0x31dadd[_0x3d1b('0x42')]=_[_0x3d1b('0x46')](_0x31dadd[_0x3d1b('0x42')],{'$or':_['map'](_0xe5d97a,function(_0x2cafa3){if(_0x2cafa3[_0x3d1b('0x35')]!=='VIRTUAL'){var _0x3234da={};_0x3234da[_0x2cafa3[_0x3d1b('0x2f')]]={'$like':'%'+_0x351588['query'][_0x3d1b('0x45')]+'%'};return _0x3234da;}})});}_0x31dadd=_[_0x3d1b('0x46')]({},_0x31dadd,_0x351588[_0x3d1b('0x47')]);var _0x521563={'where':_0x31dadd[_0x3d1b('0x42')]};return db['Dashboard'][_0x3d1b('0x48')](_0x521563)[_0x3d1b('0x27')](function(_0xeae6e4){_0x248246['count']=_0xeae6e4;if(_0x351588[_0x3d1b('0x36')][_0x3d1b('0x49')]){_0x31dadd['include']=[{'all':!![]}];}return db[_0x3d1b('0x33')][_0x3d1b('0x4a')](_0x31dadd);})[_0x3d1b('0x27')](function(_0x51f789){_0x248246[_0x3d1b('0x4b')]=_0x51f789;return _0x248246;})['then'](respondWithFilteredResult(_0x5cde83,_0x31dadd))[_0x3d1b('0x4c')](handleError(_0x5cde83,null));};exports[_0x3d1b('0x4d')]=function(_0x519f08,_0x1877ee){var _0x57f95b={'raw':![],'where':{'id':_0x519f08['params']['id']}},_0x4301b6={};_0x4301b6[_0x3d1b('0x39')]=_['keys'](db[_0x3d1b('0x33')][_0x3d1b('0x4e')]);_0x4301b6['query']=_['keys'](_0x519f08['query']);_0x4301b6[_0x3d1b('0x43')]=_[_0x3d1b('0x38')](_0x4301b6[_0x3d1b('0x39')],_0x4301b6[_0x3d1b('0x36')]);_0x57f95b[_0x3d1b('0x3b')]=_['intersection'](_0x4301b6[_0x3d1b('0x39')],qs[_0x3d1b('0x3a')](_0x519f08[_0x3d1b('0x36')]['fields']));_0x57f95b[_0x3d1b('0x3b')]=_0x57f95b[_0x3d1b('0x3b')]['length']?_0x57f95b[_0x3d1b('0x3b')]:_0x4301b6[_0x3d1b('0x39')];if(_0x519f08[_0x3d1b('0x36')][_0x3d1b('0x49')]){_0x57f95b['include']=[{'all':!![]}];}_0x57f95b=_['merge']({},_0x57f95b,_0x519f08[_0x3d1b('0x47')]);return db[_0x3d1b('0x33')][_0x3d1b('0x4f')](_0x57f95b)[_0x3d1b('0x27')](handleEntityNotFound(_0x1877ee,null))[_0x3d1b('0x27')](respondWithResult(_0x1877ee,null))['catch'](handleError(_0x1877ee,null));};exports['create']=function(_0x574f98,_0x4126c9){return db[_0x3d1b('0x33')][_0x3d1b('0x50')](_0x574f98[_0x3d1b('0x51')],{})['then'](function(_0x37a50e){var _0x305e09=_0x574f98[_0x3d1b('0x52')][_0x3d1b('0x29')]({'plain':!![]});if(!_0x305e09)throw new Error(_0x3d1b('0x53'));if(_0x305e09[_0x3d1b('0x54')]===_0x3d1b('0x52')){var _0x29cc76=_0x37a50e[_0x3d1b('0x29')]({'plain':!![]});var _0x4206ba='CustomDashboards';return db[_0x3d1b('0x55')]['find']({'where':{'name':_0x4206ba,'userProfileId':_0x305e09[_0x3d1b('0x56')]},'raw':!![]})[_0x3d1b('0x27')](function(_0x57f45f){if(_0x57f45f&&_0x57f45f['autoAssociation']===0x0){return db[_0x3d1b('0x2b')][_0x3d1b('0x50')]({'name':_0x29cc76[_0x3d1b('0x2f')],'resourceId':_0x29cc76['id'],'type':_0x57f45f['name'],'sectionId':_0x57f45f['id']},{})[_0x3d1b('0x27')](function(){return _0x37a50e;});}else{return _0x37a50e;}})[_0x3d1b('0x4c')](function(_0x488bfb){logger[_0x3d1b('0x2d')](_0x3d1b('0x57'),_0x488bfb);throw _0x488bfb;});}return _0x37a50e;})[_0x3d1b('0x27')](respondWithResult(_0x4126c9,0xc9))[_0x3d1b('0x4c')](handleError(_0x4126c9,null));};exports[_0x3d1b('0x58')]=function(_0x5d3682,_0x46c952){var _0x47e13a={'where':{'id':_0x5d3682[_0x3d1b('0x59')]['id']}},_0x587ca5={};_0x587ca5['model']=_[_0x3d1b('0x37')](db['Dashboard'][_0x3d1b('0x4e')]);_0x47e13a[_0x3d1b('0x3b')]=_[_0x3d1b('0x38')](_0x587ca5[_0x3d1b('0x39')],qs[_0x3d1b('0x3a')](_0x5d3682[_0x3d1b('0x36')][_0x3d1b('0x3a')]));_0x47e13a[_0x3d1b('0x3b')]=_0x47e13a['attributes'][_0x3d1b('0x3c')]?_0x47e13a[_0x3d1b('0x3b')]:_0x587ca5[_0x3d1b('0x39')];if(_0x5d3682[_0x3d1b('0x36')]['includeAll']){_0x47e13a['include']=[{'all':!![]}];}_0x47e13a=_[_0x3d1b('0x46')]({},_0x47e13a,_0x5d3682['options']);return db[_0x3d1b('0x33')][_0x3d1b('0x4f')](_0x47e13a)['then'](handleEntityNotFound(_0x46c952,null))[_0x3d1b('0x27')](function(_0x282ee8){if(_0x282ee8){var _0x83efc8=_0x282ee8[_0x3d1b('0x29')]({'plain':!![]});_0x83efc8=qs[_0x3d1b('0x5a')](_0x83efc8,['id','createdAt',_0x3d1b('0x5b')]);_0x5d3682['body']=_['omit'](_0x5d3682['body'],['id',_0x3d1b('0x5c'),_0x3d1b('0x5b')]);return db[_0x3d1b('0x33')]['create'](_[_0x3d1b('0x46')](_0x83efc8,_0x5d3682[_0x3d1b('0x51')]),{'include':_0x5d3682[_0x3d1b('0x36')][_0x3d1b('0x49')]?[{'all':!![]}]:undefined})['then'](function(_0x10e519){var _0x173dd0=_0x5d3682['user'][_0x3d1b('0x29')]({'plain':!![]});if(!_0x173dd0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x173dd0['role']===_0x3d1b('0x52')){var _0x21a7ea=_0x10e519[_0x3d1b('0x29')]({'plain':!![]});var _0x3b871c=_0x3d1b('0x2a');return db[_0x3d1b('0x55')][_0x3d1b('0x4f')]({'where':{'name':_0x3b871c,'userProfileId':_0x173dd0[_0x3d1b('0x56')]},'raw':!![]})['then'](function(_0x2db9cc){if(_0x2db9cc&&_0x2db9cc['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x21a7ea[_0x3d1b('0x2f')],'resourceId':_0x21a7ea['id'],'type':_0x2db9cc['name'],'sectionId':_0x2db9cc['id']},{})[_0x3d1b('0x27')](function(){return _0x10e519;});}else{return _0x10e519;}})[_0x3d1b('0x4c')](function(_0x123e47){logger[_0x3d1b('0x2d')](_0x3d1b('0x57'),_0x123e47);throw _0x123e47;});}return _0x10e519;});}})[_0x3d1b('0x27')](respondWithResult(_0x46c952,0xc9))[_0x3d1b('0x4c')](handleError(_0x46c952,null));};exports[_0x3d1b('0x26')]=function(_0x4a33f4,_0x431acb){if(_0x4a33f4[_0x3d1b('0x51')]['id']){delete _0x4a33f4[_0x3d1b('0x51')]['id'];}return db[_0x3d1b('0x33')][_0x3d1b('0x4f')]({'where':{'id':_0x4a33f4['params']['id']}})['then'](handleEntityNotFound(_0x431acb,null))['then'](saveUpdates(_0x4a33f4[_0x3d1b('0x51')],null))[_0x3d1b('0x27')](respondWithResult(_0x431acb,null))[_0x3d1b('0x4c')](handleError(_0x431acb,null));};exports[_0x3d1b('0x28')]=function(_0x101628,_0x5f3661){return db['Dashboard']['find']({'where':{'id':_0x101628[_0x3d1b('0x59')]['id']}})[_0x3d1b('0x27')](handleEntityNotFound(_0x5f3661,null))[_0x3d1b('0x27')](removeEntity(_0x5f3661,null))[_0x3d1b('0x4c')](handleError(_0x5f3661,null));};function widgetAttributes(_0x9ba2ac){try{switch(_0x9ba2ac[_0x3d1b('0x35')]){case _0x3d1b('0x5d'):return[{'name':_0x3d1b('0x5e'),'value':_0x9ba2ac[_0x3d1b('0x5e')]||(_0x9ba2ac['attrs']&&_0x9ba2ac[_0x3d1b('0x5f')][0x0]?_0x9ba2ac[_0x3d1b('0x5f')][0x0][_0x3d1b('0x60')]:undefined)||_0x3d1b('0x61')}];case _0x3d1b('0x62'):return[{'name':'attrPath','value':_0x9ba2ac['attrPath']||(_0x9ba2ac[_0x3d1b('0x5f')]&&_0x9ba2ac['attrs'][0x0]?_0x9ba2ac[_0x3d1b('0x5f')][0x0][_0x3d1b('0x60')]:undefined)||''}];case _0x3d1b('0x63'):return[{'name':_0x3d1b('0x64'),'value':_0x9ba2ac[_0x3d1b('0x64')]||(_0x9ba2ac[_0x3d1b('0x5f')]&&_0x9ba2ac['attrs'][0x0]?_0x9ba2ac[_0x3d1b('0x5f')][0x0][_0x3d1b('0x60')]:undefined)||_0x3d1b('0x65')},{'name':_0x3d1b('0x66'),'value':_0x9ba2ac[_0x3d1b('0x66')]||(_0x9ba2ac[_0x3d1b('0x5f')]&&_0x9ba2ac[_0x3d1b('0x5f')][0x1]?_0x9ba2ac[_0x3d1b('0x5f')][0x1][_0x3d1b('0x60')]:undefined)||_0x3d1b('0x67')},{'name':_0x3d1b('0x68'),'value':_0x9ba2ac[_0x3d1b('0x68')]||(_0x9ba2ac[_0x3d1b('0x5f')]&&_0x9ba2ac['attrs'][0x2]?_0x9ba2ac['attrs'][0x2][_0x3d1b('0x60')]:undefined)||0xc}];case _0x3d1b('0x69'):return[{'name':_0x3d1b('0x6a'),'value':_0x9ba2ac[_0x3d1b('0x6a')]||(_0x9ba2ac['attrs']&&_0x9ba2ac['attrs'][0x0]?_0x9ba2ac[_0x3d1b('0x5f')][0x0][_0x3d1b('0x60')]:undefined)||'total'},{'name':_0x3d1b('0x6b'),'value':_0x9ba2ac[_0x3d1b('0x6b')]||(_0x9ba2ac[_0x3d1b('0x5f')]&&_0x9ba2ac['attrs'][0x1]?_0x9ba2ac[_0x3d1b('0x5f')][0x1][_0x3d1b('0x60')]:undefined)||[]},{'name':'attrFontSize','value':_0x9ba2ac[_0x3d1b('0x68')]||(_0x9ba2ac[_0x3d1b('0x5f')]&&_0x9ba2ac[_0x3d1b('0x5f')][0x2]?_0x9ba2ac['attrs'][0x2]['value']:undefined)||0x14},{'name':_0x3d1b('0x6c'),'value':_0x9ba2ac[_0x3d1b('0x6c')]||(_0x9ba2ac[_0x3d1b('0x5f')]&&_0x9ba2ac['attrs'][0x3]?_0x9ba2ac['attrs'][0x3]['value']:undefined)||_0x3d1b('0x6d')},{'name':'attrEmailAccounts','value':_0x9ba2ac['attrEmailAccounts']||(_0x9ba2ac['attrs']&&_0x9ba2ac['attrs'][0x4]?_0x9ba2ac['attrs'][0x4]['value']:undefined)||''},{'name':_0x3d1b('0x6e'),'value':_0x9ba2ac[_0x3d1b('0x6e')]||(_0x9ba2ac[_0x3d1b('0x5f')]&&_0x9ba2ac['attrs'][0x5]?_0x9ba2ac[_0x3d1b('0x5f')][0x5]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x9ba2ac[_0x3d1b('0x6f')]||(_0x9ba2ac[_0x3d1b('0x5f')]&&_0x9ba2ac[_0x3d1b('0x5f')][0x6]?_0x9ba2ac[_0x3d1b('0x5f')][0x6][_0x3d1b('0x60')]:undefined)||''},{'name':_0x3d1b('0x70'),'value':_0x9ba2ac['attrOpenchannelAccounts']||(_0x9ba2ac[_0x3d1b('0x5f')]&&_0x9ba2ac[_0x3d1b('0x5f')][0x7]?_0x9ba2ac[_0x3d1b('0x5f')][0x7][_0x3d1b('0x60')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x9ba2ac[_0x3d1b('0x71')]||(_0x9ba2ac['attrs']&&_0x9ba2ac[_0x3d1b('0x5f')][0x8]?_0x9ba2ac[_0x3d1b('0x5f')][0x8][_0x3d1b('0x60')]:undefined)||''},{'name':_0x3d1b('0x72'),'value':_0x9ba2ac[_0x3d1b('0x72')]||(_0x9ba2ac['attrs']&&_0x9ba2ac['attrs'][0x9]?_0x9ba2ac[_0x3d1b('0x5f')][0x9][_0x3d1b('0x60')]:undefined)||''}];case _0x3d1b('0x73'):case _0x3d1b('0x74'):return[{'name':_0x3d1b('0x75'),'value':_0x9ba2ac['attrSerie1']||(_0x9ba2ac['attrs']&&_0x9ba2ac[_0x3d1b('0x5f')][0x0]?_0x9ba2ac[_0x3d1b('0x5f')][0x0]['value']:undefined)||_0x3d1b('0x76')},{'name':'attrSerie2','value':_0x9ba2ac['attrSerie2']||(_0x9ba2ac[_0x3d1b('0x5f')]&&_0x9ba2ac['attrs'][0x1]?_0x9ba2ac[_0x3d1b('0x5f')][0x1][_0x3d1b('0x60')]:undefined)||null},{'name':_0x3d1b('0x77'),'value':_0x9ba2ac[_0x3d1b('0x77')]||(_0x9ba2ac[_0x3d1b('0x5f')]&&_0x9ba2ac[_0x3d1b('0x5f')][0x2]?_0x9ba2ac[_0x3d1b('0x5f')][0x2]['value']:undefined)||null},{'name':_0x3d1b('0x6b'),'value':_0x9ba2ac[_0x3d1b('0x6b')]||(_0x9ba2ac[_0x3d1b('0x5f')]&&_0x9ba2ac[_0x3d1b('0x5f')][0x3]?_0x9ba2ac['attrs'][0x3][_0x3d1b('0x60')]:undefined)||[]},{'name':_0x3d1b('0x6c'),'value':_0x9ba2ac[_0x3d1b('0x6c')]||(_0x9ba2ac[_0x3d1b('0x5f')]&&_0x9ba2ac[_0x3d1b('0x5f')][0x4]?_0x9ba2ac[_0x3d1b('0x5f')][0x4][_0x3d1b('0x60')]:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0x9ba2ac[_0x3d1b('0x78')]||(_0x9ba2ac[_0x3d1b('0x5f')]&&_0x9ba2ac[_0x3d1b('0x5f')][0x5]?_0x9ba2ac[_0x3d1b('0x5f')][0x5][_0x3d1b('0x60')]:undefined)||''},{'name':_0x3d1b('0x6e'),'value':_0x9ba2ac['attrFaxAccounts']||(_0x9ba2ac['attrs']&&_0x9ba2ac['attrs'][0x6]?_0x9ba2ac[_0x3d1b('0x5f')][0x6][_0x3d1b('0x60')]:undefined)||''},{'name':_0x3d1b('0x6f'),'value':_0x9ba2ac[_0x3d1b('0x6f')]||(_0x9ba2ac[_0x3d1b('0x5f')]&&_0x9ba2ac[_0x3d1b('0x5f')][0x7]?_0x9ba2ac['attrs'][0x7][_0x3d1b('0x60')]:undefined)||''},{'name':_0x3d1b('0x70'),'value':_0x9ba2ac[_0x3d1b('0x70')]||(_0x9ba2ac[_0x3d1b('0x5f')]&&_0x9ba2ac[_0x3d1b('0x5f')][0x8]?_0x9ba2ac[_0x3d1b('0x5f')][0x8][_0x3d1b('0x60')]:undefined)||''},{'name':_0x3d1b('0x71'),'value':_0x9ba2ac[_0x3d1b('0x71')]||(_0x9ba2ac['attrs']&&_0x9ba2ac[_0x3d1b('0x5f')][0x9]?_0x9ba2ac[_0x3d1b('0x5f')][0x9][_0x3d1b('0x60')]:undefined)||''},{'name':_0x3d1b('0x72'),'value':_0x9ba2ac[_0x3d1b('0x72')]||(_0x9ba2ac[_0x3d1b('0x5f')]&&_0x9ba2ac['attrs'][0xa]?_0x9ba2ac[_0x3d1b('0x5f')][0xa][_0x3d1b('0x60')]:undefined)||''}];case _0x3d1b('0x79'):return[{'name':_0x3d1b('0x7a'),'type':_0x9ba2ac[_0x3d1b('0x7b')]||(_0x9ba2ac[_0x3d1b('0x5f')]&&_0x9ba2ac[_0x3d1b('0x5f')][0x0]?_0x9ba2ac[_0x3d1b('0x5f')][0x0][_0x3d1b('0x35')]:undefined)||null,'value':_0x9ba2ac['attrReport']||(_0x9ba2ac['attrs']&&_0x9ba2ac['attrs'][0x0]?_0x9ba2ac[_0x3d1b('0x5f')][0x0][_0x3d1b('0x60')]:undefined)||null},{'name':_0x3d1b('0x7c'),'value':_0x9ba2ac[_0x3d1b('0x7c')]||(_0x9ba2ac[_0x3d1b('0x5f')]&&_0x9ba2ac[_0x3d1b('0x5f')][0x1]?_0x9ba2ac[_0x3d1b('0x5f')][0x1][_0x3d1b('0x60')]:undefined)||0x0}];default:return[];}}catch(_0x5a5281){logger[_0x3d1b('0x2d')](_0x3d1b('0x7d'),JSON[_0x3d1b('0x7e')](_0x5a5281));return[];}}exports['addItem']=function(_0x3060de,_0x58261d,_0x9d66ac){if(_0x3060de[_0x3d1b('0x51')]['id']){delete _0x3060de[_0x3d1b('0x51')]['id'];}return db['Dashboard'][_0x3d1b('0x4f')]({'where':{'id':_0x3060de[_0x3d1b('0x59')]['id']}})[_0x3d1b('0x27')](handleEntityNotFound(_0x58261d,null))[_0x3d1b('0x27')](function(_0x10d156){if(_0x10d156){_0x3060de['body'][_0x3d1b('0x7f')]=_0x10d156['id'];_0x3060de[_0x3d1b('0x51')][_0x3d1b('0x5f')]=widgetAttributes(_0x3060de[_0x3d1b('0x51')]);return db['DashboardItem'][_0x3d1b('0x50')](_0x3060de['body']);}})[_0x3d1b('0x27')](respondWithResult(_0x58261d,null))['catch'](handleError(_0x58261d,null));};exports[_0x3d1b('0x80')]=function(_0x6e68f1,_0x1d7aa3,_0x3a4318){var _0x413091={};var _0x3bd90c={};var _0xcbaecf;var _0x59420d;return db['Dashboard'][_0x3d1b('0x81')]({'where':{'id':_0x6e68f1[_0x3d1b('0x59')]['id']}})[_0x3d1b('0x27')](handleEntityNotFound(_0x1d7aa3,null))[_0x3d1b('0x27')](function(_0x75936a){if(_0x75936a){_0xcbaecf=_0x75936a;_0x3bd90c[_0x3d1b('0x39')]=_[_0x3d1b('0x37')](db['DashboardItem'][_0x3d1b('0x4e')]);_0x3bd90c[_0x3d1b('0x36')]=_['keys'](_0x6e68f1['query']);_0x3bd90c[_0x3d1b('0x43')]=_[_0x3d1b('0x38')](_0x3bd90c[_0x3d1b('0x39')],_0x3bd90c[_0x3d1b('0x36')]);_0x413091[_0x3d1b('0x3b')]=_[_0x3d1b('0x38')](_0x3bd90c[_0x3d1b('0x39')],qs['fields'](_0x6e68f1['query']['fields']));_0x413091['attributes']=_0x413091['attributes'][_0x3d1b('0x3c')]?_0x413091[_0x3d1b('0x3b')]:_0x3bd90c['model'];_0x413091[_0x3d1b('0x40')]=qs[_0x3d1b('0x41')](_0x6e68f1['query'][_0x3d1b('0x41')]);_0x413091[_0x3d1b('0x42')]=qs[_0x3d1b('0x43')](_['pick'](_0x6e68f1[_0x3d1b('0x36')],_0x3bd90c['filters']));if(_0x6e68f1['query']['filter']){_0x413091[_0x3d1b('0x42')]=_['merge'](_0x413091[_0x3d1b('0x42')],{'$or':_[_0x3d1b('0x32')](_0x413091[_0x3d1b('0x3b')],function(_0xc427b6){var _0x44179f={};_0x44179f[_0xc427b6]={'$like':'%'+_0x6e68f1[_0x3d1b('0x36')][_0x3d1b('0x45')]+'%'};return _0x44179f;})});}_0x413091=_[_0x3d1b('0x46')]({},_0x413091,_0x6e68f1[_0x3d1b('0x47')]);return _0xcbaecf[_0x3d1b('0x80')](_0x413091);}})[_0x3d1b('0x27')](function(_0x499e5c){if(_0x499e5c){_0x59420d=_0x499e5c['length'];if(!_0x6e68f1['query'][_0x3d1b('0x3d')](_0x3d1b('0x3e'))){_0x413091[_0x3d1b('0x3f')]=qs[_0x3d1b('0x3f')](_0x6e68f1['query'][_0x3d1b('0x3f')]);_0x413091[_0x3d1b('0x1f')]=qs[_0x3d1b('0x1f')](_0x6e68f1['query'][_0x3d1b('0x1f')]);}return _0xcbaecf[_0x3d1b('0x80')](_0x413091);}})[_0x3d1b('0x27')](function(_0x52baa8){if(_0x52baa8){return _0x52baa8?{'count':_0x59420d,'rows':_0x52baa8}:null;}})[_0x3d1b('0x27')](respondWithResult(_0x1d7aa3,null))[_0x3d1b('0x4c')](handleError(_0x1d7aa3,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index c7e5bf8..d75ca83 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 _0xe1c9=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','Dashboard'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0xe1c9,0x1df));var _0x9e1c=function(_0x13b392,_0x3481f2){_0x13b392=_0x13b392-0x0;var _0x39db24=_0xe1c9[_0x13b392];return _0x39db24;};'use strict';var EventEmitter=require('events');var Dashboard=require('../../mysqldb')['db'][_0x9e1c('0x0')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x9e1c('0x1')](0x0);var events={'afterCreate':_0x9e1c('0x2'),'afterUpdate':_0x9e1c('0x3'),'afterDestroy':_0x9e1c('0x4')};function emitEvent(_0x25803d){return function(_0x2c784b,_0x16150e,_0x1bc192){DashboardEvents['emit'](_0x25803d+':'+_0x2c784b['id'],_0x2c784b);DashboardEvents[_0x9e1c('0x5')](_0x25803d,_0x2c784b);_0x1bc192(null);};}for(var e in events){if(events[_0x9e1c('0x6')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0x9e1c('0x7')]=DashboardEvents; \ No newline at end of file +var _0xb96d=['setMaxListeners','update','remove','emit','hasOwnProperty','exports','../../mysqldb','Dashboard'];(function(_0x382c73,_0x199cab){var _0x1dd0bf=function(_0x358747){while(--_0x358747){_0x382c73['push'](_0x382c73['shift']());}};_0x1dd0bf(++_0x199cab);}(_0xb96d,0x9e));var _0xdb96=function(_0x2ddfd9,_0x5877d0){_0x2ddfd9=_0x2ddfd9-0x0;var _0x2668f0=_0xb96d[_0x2ddfd9];return _0x2668f0;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0xdb96('0x0'))['db'][_0xdb96('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xdb96('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xdb96('0x3'),'afterDestroy':_0xdb96('0x4')};function emitEvent(_0x22be94){return function(_0x488b02,_0x4af3cf,_0x291c6a){DashboardEvents[_0xdb96('0x5')](_0x22be94+':'+_0x488b02['id'],_0x488b02);DashboardEvents[_0xdb96('0x5')](_0x22be94,_0x488b02);_0x291c6a(null);};}for(var e in events){if(events[_0xdb96('0x6')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0xdb96('0x7')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 484ca21..c00697a 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 _0x9bc3=['util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./dashboard.attributes','exports','define','Dashboard','dashboards','lodash'];(function(_0x4c5a9b,_0x3428bd){var _0x1fda7a=function(_0x54cc24){while(--_0x54cc24){_0x4c5a9b['push'](_0x4c5a9b['shift']());}};_0x1fda7a(++_0x3428bd);}(_0x9bc3,0x137));var _0x39bc=function(_0x40edbb,_0x4b8e85){_0x40edbb=_0x40edbb-0x0;var _0x1c34e1=_0x9bc3[_0x40edbb];return _0x1c34e1;};'use strict';var _=require(_0x39bc('0x0'));var util=require(_0x39bc('0x1'));var logger=require(_0x39bc('0x2'))('api');var moment=require(_0x39bc('0x3'));var BPromise=require(_0x39bc('0x4'));var rp=require(_0x39bc('0x5'));var fs=require('fs');var path=require(_0x39bc('0x6'));var rimraf=require('rimraf');var config=require(_0x39bc('0x7'));var attributes=require(_0x39bc('0x8'));module[_0x39bc('0x9')]=function(_0x442ec9,_0x5805da){return _0x442ec9[_0x39bc('0xa')](_0x39bc('0xb'),attributes,{'tableName':_0x39bc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbbdd=['lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports','define','Dashboard','dashboards'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xbbdd,0x120));var _0xdbbd=function(_0x599e60,_0x5b6519){_0x599e60=_0x599e60-0x0;var _0x468e19=_0xbbdd[_0x599e60];return _0x468e19;};'use strict';var _=require(_0xdbbd('0x0'));var util=require(_0xdbbd('0x1'));var logger=require(_0xdbbd('0x2'))('api');var moment=require(_0xdbbd('0x3'));var BPromise=require(_0xdbbd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdbbd('0x5'));var rimraf=require(_0xdbbd('0x6'));var config=require(_0xdbbd('0x7'));var attributes=require('./dashboard.attributes');module[_0xdbbd('0x8')]=function(_0x1b1f26,_0x4c8540){return _0x1b1f26[_0xdbbd('0x9')](_0xdbbd('0xa'),attributes,{'tableName':_0xdbbd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index cb64705..5bf54cd 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 _0xb768=['stringify','error','code','Dashboard,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','info','request\x20sent','Dashboard,\x20%s,\x20%s,\x20%s'];(function(_0x34beae,_0x267303){var _0x265e6d=function(_0x48de64){while(--_0x48de64){_0x34beae['push'](_0x34beae['shift']());}};_0x265e6d(++_0x267303);}(_0xb768,0xaf));var _0x8b76=function(_0x526a88,_0x5e5e55){_0x526a88=_0x526a88-0x0;var _0x378677=_0xb768[_0x526a88];return _0x378677;};'use strict';var _=require(_0x8b76('0x0'));var util=require(_0x8b76('0x1'));var moment=require(_0x8b76('0x2'));var BPromise=require(_0x8b76('0x3'));var rs=require(_0x8b76('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8b76('0x5'))['db'];var utils=require(_0x8b76('0x6'));var logger=require(_0x8b76('0x7'))(_0x8b76('0x8'));var config=require(_0x8b76('0x9'));var jayson=require(_0x8b76('0xa'));var client=jayson[_0x8b76('0xb')][_0x8b76('0xc')]({'port':0x232a});config[_0x8b76('0xd')]=_[_0x8b76('0xe')](config[_0x8b76('0xd')],{'host':_0x8b76('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./dashboard.socket')[_0x8b76('0x10')](socket);function respondWithRpcPromise(_0xd7a392,_0x5becde,_0x532804){return new BPromise(function(_0x29d823,_0x5894f6){return client[_0x8b76('0x11')](_0xd7a392,_0x532804)['then'](function(_0x28eca8){logger[_0x8b76('0x12')]('Dashboard,\x20%s,\x20%s',_0x5becde,_0x8b76('0x13'));logger['debug'](_0x8b76('0x14'),_0x5becde,_0x8b76('0x13'),JSON[_0x8b76('0x15')](_0x28eca8));if(_0x28eca8[_0x8b76('0x16')]){if(_0x28eca8['error'][_0x8b76('0x17')]===0x1f4){logger[_0x8b76('0x16')](_0x8b76('0x18'),_0x5becde,_0x28eca8[_0x8b76('0x16')][_0x8b76('0x19')]);return _0x5894f6(_0x28eca8[_0x8b76('0x16')]['message']);}logger[_0x8b76('0x16')]('Dashboard,\x20%s,\x20%s',_0x5becde,_0x28eca8[_0x8b76('0x16')][_0x8b76('0x19')]);return _0x29d823(_0x28eca8[_0x8b76('0x16')][_0x8b76('0x19')]);}else{logger[_0x8b76('0x12')](_0x8b76('0x18'),_0x5becde,'request\x20sent');_0x29d823(_0x28eca8[_0x8b76('0x1a')]['message']);}})[_0x8b76('0x1b')](function(_0x5d33cc){logger[_0x8b76('0x16')](_0x8b76('0x18'),_0x5becde,_0x5d33cc);_0x5894f6(_0x5d33cc);});});} \ No newline at end of file +var _0x3102=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x3102,0x119));var _0x2310=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0x3102[_0x36884e];return _0x1cc367;};'use strict';var _=require('lodash');var util=require(_0x2310('0x0'));var moment=require(_0x2310('0x1'));var BPromise=require(_0x2310('0x2'));var rs=require(_0x2310('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2310('0x4'))['db'];var utils=require(_0x2310('0x5'));var logger=require(_0x2310('0x6'))(_0x2310('0x7'));var config=require(_0x2310('0x8'));var jayson=require(_0x2310('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x2310('0xa')]=_[_0x2310('0xb')](config['redis'],{'host':_0x2310('0xc'),'port':0x18eb});var socket=require(_0x2310('0xd'))(new Redis(config[_0x2310('0xa')]));require(_0x2310('0xe'))['register'](socket);function respondWithRpcPromise(_0x3510c8,_0x15514e,_0x55ccfa){return new BPromise(function(_0x3bf547,_0x283c19){return client[_0x2310('0xf')](_0x3510c8,_0x55ccfa)[_0x2310('0x10')](function(_0x3e9d0c){logger[_0x2310('0x11')](_0x2310('0x12'),_0x15514e,_0x2310('0x13'));logger[_0x2310('0x14')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x15514e,'request\x20sent',JSON[_0x2310('0x15')](_0x3e9d0c));if(_0x3e9d0c['error']){if(_0x3e9d0c[_0x2310('0x16')]['code']===0x1f4){logger['error'](_0x2310('0x12'),_0x15514e,_0x3e9d0c[_0x2310('0x16')][_0x2310('0x17')]);return _0x283c19(_0x3e9d0c[_0x2310('0x16')][_0x2310('0x17')]);}logger['error']('Dashboard,\x20%s,\x20%s',_0x15514e,_0x3e9d0c['error']['message']);return _0x3bf547(_0x3e9d0c['error'][_0x2310('0x17')]);}else{logger['info'](_0x2310('0x12'),_0x15514e,_0x2310('0x13'));_0x3bf547(_0x3e9d0c[_0x2310('0x18')][_0x2310('0x17')]);}})[_0x2310('0x19')](function(_0x495b77){logger[_0x2310('0x16')]('Dashboard,\x20%s,\x20%s',_0x15514e,_0x495b77);_0x283c19(_0x495b77);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index d9859d1..8b83886 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 _0xccd2=['register','length','dashboard:','./dashboard.events','save','remove','update','emit'];(function(_0x442a5d,_0x2a6745){var _0x51d134=function(_0x5cae90){while(--_0x5cae90){_0x442a5d['push'](_0x442a5d['shift']());}};_0x51d134(++_0x2a6745);}(_0xccd2,0x113));var _0x2ccd=function(_0x303b77,_0x27293c){_0x303b77=_0x303b77-0x0;var _0x4eb7d6=_0xccd2[_0x303b77];return _0x4eb7d6;};'use strict';var DashboardEvents=require(_0x2ccd('0x0'));var events=[_0x2ccd('0x1'),_0x2ccd('0x2'),_0x2ccd('0x3')];function createListener(_0x5137ed,_0x44a0e7){return function(_0x6f29d9){_0x44a0e7[_0x2ccd('0x4')](_0x5137ed,_0x6f29d9);};}function removeListener(_0x583433,_0x3b63c5){return function(){DashboardEvents['removeListener'](_0x583433,_0x3b63c5);};}exports[_0x2ccd('0x5')]=function(_0x1fcffc){for(var _0x1ca7f3=0x0,_0x577338=events[_0x2ccd('0x6')];_0x1ca7f3<_0x577338;_0x1ca7f3++){var _0xadc55f=events[_0x1ca7f3];var _0x362b7a=createListener(_0x2ccd('0x7')+_0xadc55f,_0x1fcffc);DashboardEvents['on'](_0xadc55f,_0x362b7a);}}; \ No newline at end of file +var _0x7469=['removeListener','length','dashboard:','save','remove'];(function(_0x25fcd6,_0x4735e0){var _0x366629=function(_0x449059){while(--_0x449059){_0x25fcd6['push'](_0x25fcd6['shift']());}};_0x366629(++_0x4735e0);}(_0x7469,0x1ac));var _0x9746=function(_0x382556,_0x3b79cf){_0x382556=_0x382556-0x0;var _0x4b6eb8=_0x7469[_0x382556];return _0x4b6eb8;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0x9746('0x0'),_0x9746('0x1'),'update'];function createListener(_0x4e9672,_0x553fcb){return function(_0x25cbc4){_0x553fcb['emit'](_0x4e9672,_0x25cbc4);};}function removeListener(_0x2a7b60,_0x32e949){return function(){DashboardEvents[_0x9746('0x2')](_0x2a7b60,_0x32e949);};}exports['register']=function(_0x4bf1e7){for(var _0x2985eb=0x0,_0x5a6d72=events[_0x9746('0x3')];_0x2985eb<_0x5a6d72;_0x2985eb++){var _0x33e08c=events[_0x2985eb];var _0x1c1594=createListener(_0x9746('0x4')+_0x33e08c,_0x4bf1e7);DashboardEvents['on'](_0x33e08c,_0x1c1594);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index ed9a9a7..1644d89 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 _0xa9d3=['post','create','/:id/clone','clone','/:id/items','addItem','put','update','delete','destroy','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','getItems'];(function(_0x12c34e,_0x39287a){var _0x244e88=function(_0x34507b){while(--_0x34507b){_0x12c34e['push'](_0x12c34e['shift']());}};_0x244e88(++_0x39287a);}(_0xa9d3,0x108));var _0x3a9d=function(_0x35f32a,_0x1b02fb){_0x35f32a=_0x35f32a-0x0;var _0x319885=_0xa9d3[_0x35f32a];return _0x319885;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x3a9d('0x0'));var express=require(_0x3a9d('0x1'));var router=express[_0x3a9d('0x2')]();var fs_extra=require(_0x3a9d('0x3'));var auth=require(_0x3a9d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3a9d('0x5'));var controller=require(_0x3a9d('0x6'));router[_0x3a9d('0x7')]('/',auth[_0x3a9d('0x8')](),controller[_0x3a9d('0x9')]);router[_0x3a9d('0x7')](_0x3a9d('0xa'),auth[_0x3a9d('0x8')](),controller['show']);router['get']('/:id/items',auth[_0x3a9d('0x8')](),controller[_0x3a9d('0xb')]);router[_0x3a9d('0xc')]('/',auth['isAuthenticated'](),controller[_0x3a9d('0xd')]);router['post'](_0x3a9d('0xe'),auth[_0x3a9d('0x8')](),controller[_0x3a9d('0xf')]);router[_0x3a9d('0xc')](_0x3a9d('0x10'),auth[_0x3a9d('0x8')](),controller[_0x3a9d('0x11')]);router[_0x3a9d('0x12')](_0x3a9d('0xa'),auth['isAuthenticated'](),controller[_0x3a9d('0x13')]);router[_0x3a9d('0x14')](_0x3a9d('0xa'),auth[_0x3a9d('0x8')](),controller[_0x3a9d('0x15')]);module[_0x3a9d('0x16')]=router; \ No newline at end of file +var _0x3dbc=['getItems','post','create','/:id/clone','addItem','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','/:id','show','/:id/items'];(function(_0x53284b,_0x11028b){var _0x39dc7d=function(_0x2d117b){while(--_0x2d117b){_0x53284b['push'](_0x53284b['shift']());}};_0x39dc7d(++_0x11028b);}(_0x3dbc,0xd2));var _0xc3db=function(_0x3b2369,_0x4c68b9){_0x3b2369=_0x3b2369-0x0;var _0x5a1367=_0x3dbc[_0x3b2369];return _0x5a1367;};'use strict';var multer=require(_0xc3db('0x0'));var util=require(_0xc3db('0x1'));var path=require(_0xc3db('0x2'));var timeout=require(_0xc3db('0x3'));var express=require('express');var router=express[_0xc3db('0x4')]();var fs_extra=require(_0xc3db('0x5'));var auth=require(_0xc3db('0x6'));var interaction=require(_0xc3db('0x7'));var config=require(_0xc3db('0x8'));var controller=require(_0xc3db('0x9'));router[_0xc3db('0xa')]('/',auth[_0xc3db('0xb')](),controller['index']);router[_0xc3db('0xa')](_0xc3db('0xc'),auth[_0xc3db('0xb')](),controller[_0xc3db('0xd')]);router[_0xc3db('0xa')](_0xc3db('0xe'),auth[_0xc3db('0xb')](),controller[_0xc3db('0xf')]);router[_0xc3db('0x10')]('/',auth[_0xc3db('0xb')](),controller[_0xc3db('0x11')]);router[_0xc3db('0x10')](_0xc3db('0x12'),auth['isAuthenticated'](),controller['clone']);router[_0xc3db('0x10')](_0xc3db('0xe'),auth[_0xc3db('0xb')](),controller[_0xc3db('0x13')]);router[_0xc3db('0x14')](_0xc3db('0xc'),auth[_0xc3db('0xb')](),controller[_0xc3db('0x15')]);router[_0xc3db('0x16')](_0xc3db('0xc'),auth[_0xc3db('0xb')](),controller[_0xc3db('0x17')]);module[_0xc3db('0x18')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index b47b866..ea13051 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 _0x2675=['parse','attrs','setDataValue','stringify','INTEGER','sequelize','STRING','long'];(function(_0x286ee5,_0x3c880a){var _0x422e41=function(_0x1ead7a){while(--_0x1ead7a){_0x286ee5['push'](_0x286ee5['shift']());}};_0x422e41(++_0x3c880a);}(_0x2675,0x75));var _0x5267=function(_0x443e43,_0x47e772){_0x443e43=_0x443e43-0x0;var _0x5b7401=_0x2675[_0x443e43];return _0x5b7401;};'use strict';var Sequelize=require(_0x5267('0x0'));var squel=require('squel');var _=require('lodash');module['exports']={'title':{'type':Sequelize[_0x5267('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x5267('0x1')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0x5267('0x2')),'get':function(){try{return JSON[_0x5267('0x3')](this['getDataValue'](_0x5267('0x4')));}catch(_0xf2b350){return[];}},'set':function(_0x4bd042){try{this[_0x5267('0x5')](_0x5267('0x4'),JSON[_0x5267('0x6')](_0x4bd042));}catch(_0x527c16){this[_0x5267('0x5')](_0x5267('0x4'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0x5267('0x7')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x5267('0x7')]},'col':{'type':Sequelize[_0x5267('0x7')]},'background':{'type':Sequelize[_0x5267('0x1')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x5267('0x1')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x5267('0x1')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file +var _0xacf4=['lodash','exports','STRING','TEXT','long','parse','attrs','setDataValue','stringify','INTEGER','#2196f3'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xacf4,0xe7));var _0x4acf=function(_0x210e5e,_0x74bded){_0x210e5e=_0x210e5e-0x0;var _0x16375f=_0xacf4[_0x210e5e];return _0x16375f;};'use strict';var Sequelize=require('sequelize');var squel=require('squel');var _=require(_0x4acf('0x0'));module[_0x4acf('0x1')]={'title':{'type':Sequelize[_0x4acf('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x4acf('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x4acf('0x3')](_0x4acf('0x4')),'get':function(){try{return JSON[_0x4acf('0x5')](this['getDataValue'](_0x4acf('0x6')));}catch(_0x2124c8){return[];}},'set':function(_0x4e0c43){try{this[_0x4acf('0x7')](_0x4acf('0x6'),JSON[_0x4acf('0x8')](_0x4e0c43));}catch(_0x45a5a4){this[_0x4acf('0x7')]('attrs',JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0x4acf('0x9')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x4acf('0x9')]},'col':{'type':Sequelize[_0x4acf('0x9')]},'background':{'type':Sequelize[_0x4acf('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x4acf('0x2')],'allowNull':![],'defaultValue':_0x4acf('0xa'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'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 f23ee30..bf6fbea 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 _0x5e8d=['to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','then','destroy','end','error','stack','name','show','params','model','keys','DashboardItem','rawAttributes','query','intersection','attributes','fields','length','includeAll','include','merge','find','catch','type','attrUrl','attrs','value','https://','custom','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrWhatsappAccounts','reportType','attrReport','attrRefresh','widgetAttributes:\x20%s','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path'];(function(_0x30a782,_0x576d36){var _0x16f6d3=function(_0x1675fb){while(--_0x1675fb){_0x30a782['push'](_0x30a782['shift']());}};_0x16f6d3(++_0x576d36);}(_0x5e8d,0x11a));var _0xd5e8=function(_0x2d95d7,_0x80eed9){_0x2d95d7=_0x2d95d7-0x0;var _0x31a049=_0x5e8d[_0x2d95d7];return _0x31a049;};'use strict';var emlformat=require(_0xd5e8('0x0'));var rimraf=require(_0xd5e8('0x1'));var zipdir=require(_0xd5e8('0x2'));var jsonpatch=require(_0xd5e8('0x3'));var rp=require(_0xd5e8('0x4'));var moment=require(_0xd5e8('0x5'));var BPromise=require(_0xd5e8('0x6'));var Mustache=require('mustache');var util=require(_0xd5e8('0x7'));var path=require(_0xd5e8('0x8'));var sox=require('sox');var csv=require(_0xd5e8('0x9'));var ejs=require(_0xd5e8('0xa'));var fs=require('fs');var fs_extra=require(_0xd5e8('0xb'));var _=require('lodash');var squel=require(_0xd5e8('0xc'));var crypto=require(_0xd5e8('0xd'));var jsforce=require(_0xd5e8('0xe'));var deskjs=require(_0xd5e8('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd5e8('0x10'));var Redis=require(_0xd5e8('0x11'));var authService=require(_0xd5e8('0x12'));var qs=require(_0xd5e8('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd5e8('0x14'));var logger=require(_0xd5e8('0x15'))('api');var utils=require(_0xd5e8('0x16'));var config=require(_0xd5e8('0x17'));var licenseUtil=require(_0xd5e8('0x18'));var db=require(_0xd5e8('0x19'))['db'];config[_0xd5e8('0x1a')]=_[_0xd5e8('0x1b')](config[_0xd5e8('0x1a')],{'host':_0xd5e8('0x1c'),'port':0x18eb});var socket=require(_0xd5e8('0x1d'))(new Redis(config['redis']));require('./dashboardItem.socket')[_0xd5e8('0x1e')](socket);function respondWithStatusCode(_0x32de91,_0x470d94){_0x470d94=_0x470d94||0xcc;return function(_0x3ce0c5){if(_0x3ce0c5){return _0x32de91[_0xd5e8('0x1f')](_0x470d94);}return _0x32de91[_0xd5e8('0x20')](_0x470d94)['end']();};}function respondWithResult(_0x2ef357,_0x18c61f){_0x18c61f=_0x18c61f||0xc8;return function(_0x282ce2){if(_0x282ce2){return _0x2ef357[_0xd5e8('0x20')](_0x18c61f)['json'](_0x282ce2);}};}function respondWithFilteredResult(_0x3daf6a,_0x9467c3){return function(_0x529d45){if(_0x529d45){var _0x4b89e9=typeof _0x9467c3[_0xd5e8('0x21')]===_0xd5e8('0x22')&&typeof _0x9467c3[_0xd5e8('0x23')]===_0xd5e8('0x22');var _0x196648=_0x529d45[_0xd5e8('0x24')];var _0x7370d3=_0x4b89e9?0x0:_0x9467c3['offset'];var _0x36ee49=_0x4b89e9?_0x529d45[_0xd5e8('0x24')]:_0x9467c3[_0xd5e8('0x21')]+_0x9467c3[_0xd5e8('0x23')];var _0x26b187;if(_0x36ee49>=_0x196648){_0x36ee49=_0x196648;_0x26b187=0xc8;}else{_0x26b187=0xce;}_0x3daf6a[_0xd5e8('0x20')](_0x26b187);return _0x3daf6a[_0xd5e8('0x25')](_0xd5e8('0x26'),_0x7370d3+'-'+_0x36ee49+'/'+_0x196648)[_0xd5e8('0x27')](_0x529d45);}return null;};}function patchUpdates(_0x33a4ff){return function(_0x49c411){try{jsonpatch[_0xd5e8('0x28')](_0x49c411,_0x33a4ff,!![]);}catch(_0x4592e5){return BPromise['reject'](_0x4592e5);}return _0x49c411['save']();};}function saveUpdates(_0x5f177c,_0x4ca072){return function(_0x28214f){if(_0x28214f){return _0x28214f['update'](_0x5f177c)[_0xd5e8('0x29')](function(_0x3b1a69){return _0x3b1a69;});}return null;};}function removeEntity(_0x4add91,_0x4efec6){return function(_0x29d415){if(_0x29d415){return _0x29d415[_0xd5e8('0x2a')]()[_0xd5e8('0x29')](function(){_0x4add91[_0xd5e8('0x20')](0xcc)[_0xd5e8('0x2b')]();});}};}function handleEntityNotFound(_0x314352,_0x3cb0ea){return function(_0x2b7244){if(!_0x2b7244){_0x314352[_0xd5e8('0x1f')](0x194);}return _0x2b7244;};}function handleError(_0x583ea1,_0x46b78d){_0x46b78d=_0x46b78d||0x1f4;return function(_0x570e6a){logger[_0xd5e8('0x2c')](_0x570e6a[_0xd5e8('0x2d')]);if(_0x570e6a[_0xd5e8('0x2e')]){delete _0x570e6a[_0xd5e8('0x2e')];}_0x583ea1[_0xd5e8('0x20')](_0x46b78d)['send'](_0x570e6a);};}exports[_0xd5e8('0x2f')]=function(_0x3d2e7b,_0x49276c){var _0x315955={'raw':![],'where':{'id':_0x3d2e7b[_0xd5e8('0x30')]['id']}},_0x5d4b1c={};_0x5d4b1c[_0xd5e8('0x31')]=_[_0xd5e8('0x32')](db[_0xd5e8('0x33')][_0xd5e8('0x34')]);_0x5d4b1c[_0xd5e8('0x35')]=_[_0xd5e8('0x32')](_0x3d2e7b[_0xd5e8('0x35')]);_0x5d4b1c['filters']=_[_0xd5e8('0x36')](_0x5d4b1c[_0xd5e8('0x31')],_0x5d4b1c[_0xd5e8('0x35')]);_0x315955[_0xd5e8('0x37')]=_[_0xd5e8('0x36')](_0x5d4b1c[_0xd5e8('0x31')],qs[_0xd5e8('0x38')](_0x3d2e7b[_0xd5e8('0x35')]['fields']));_0x315955['attributes']=_0x315955['attributes'][_0xd5e8('0x39')]?_0x315955[_0xd5e8('0x37')]:_0x5d4b1c[_0xd5e8('0x31')];if(_0x3d2e7b[_0xd5e8('0x35')][_0xd5e8('0x3a')]){_0x315955[_0xd5e8('0x3b')]=[{'all':!![]}];}_0x315955=_[_0xd5e8('0x3c')]({},_0x315955,_0x3d2e7b['options']);return db['DashboardItem'][_0xd5e8('0x3d')](_0x315955)[_0xd5e8('0x29')](handleEntityNotFound(_0x49276c,null))[_0xd5e8('0x29')](respondWithResult(_0x49276c,null))[_0xd5e8('0x3e')](handleError(_0x49276c,null));};exports[_0xd5e8('0x2a')]=function(_0x37b5c5,_0x3b6d13){return db[_0xd5e8('0x33')][_0xd5e8('0x3d')]({'where':{'id':_0x37b5c5[_0xd5e8('0x30')]['id']}})[_0xd5e8('0x29')](handleEntityNotFound(_0x3b6d13,null))['then'](removeEntity(_0x3b6d13,null))[_0xd5e8('0x3e')](handleError(_0x3b6d13,null));};function widgetAttributes(_0x569f00){try{switch(_0x569f00[_0xd5e8('0x3f')]){case'iframe':return[{'name':_0xd5e8('0x40'),'value':_0x569f00['attrUrl']||(_0x569f00[_0xd5e8('0x41')]&&_0x569f00[_0xd5e8('0x41')][0x0]?_0x569f00[_0xd5e8('0x41')][0x0][_0xd5e8('0x42')]:undefined)||_0xd5e8('0x43')}];case _0xd5e8('0x44'):return[{'name':'attrPath','value':_0x569f00['attrPath']||(_0x569f00[_0xd5e8('0x41')]&&_0x569f00[_0xd5e8('0x41')][0x0]?_0x569f00['attrs'][0x0]['value']:undefined)||''}];case _0xd5e8('0x45'):return[{'name':_0xd5e8('0x46'),'value':_0x569f00[_0xd5e8('0x46')]||(_0x569f00[_0xd5e8('0x41')]&&_0x569f00[_0xd5e8('0x41')][0x0]?_0x569f00[_0xd5e8('0x41')][0x0]['value']:undefined)||'HH:mm:ss'},{'name':_0xd5e8('0x47'),'value':_0x569f00[_0xd5e8('0x47')]||(_0x569f00['attrs']&&_0x569f00[_0xd5e8('0x41')][0x1]?_0x569f00[_0xd5e8('0x41')][0x1][_0xd5e8('0x42')]:undefined)||_0xd5e8('0x48')},{'name':_0xd5e8('0x49'),'value':_0x569f00[_0xd5e8('0x49')]||(_0x569f00['attrs']&&_0x569f00[_0xd5e8('0x41')][0x2]?_0x569f00[_0xd5e8('0x41')][0x2]['value']:undefined)||0xc}];case'counter':return[{'name':_0xd5e8('0x4a'),'value':_0x569f00[_0xd5e8('0x4a')]||(_0x569f00[_0xd5e8('0x41')]&&_0x569f00['attrs'][0x0]?_0x569f00['attrs'][0x0][_0xd5e8('0x42')]:undefined)||_0xd5e8('0x4b')},{'name':'attrVoiceQueues','value':_0x569f00[_0xd5e8('0x4c')]||(_0x569f00[_0xd5e8('0x41')]&&_0x569f00[_0xd5e8('0x41')][0x1]?_0x569f00[_0xd5e8('0x41')][0x1][_0xd5e8('0x42')]:undefined)||[]},{'name':_0xd5e8('0x49'),'value':_0x569f00[_0xd5e8('0x49')]||(_0x569f00['attrs']&&_0x569f00[_0xd5e8('0x41')][0x2]?_0x569f00[_0xd5e8('0x41')][0x2][_0xd5e8('0x42')]:undefined)||0x14},{'name':_0xd5e8('0x4d'),'value':_0x569f00[_0xd5e8('0x4d')]||(_0x569f00[_0xd5e8('0x41')]&&_0x569f00[_0xd5e8('0x41')][0x3]?_0x569f00[_0xd5e8('0x41')][0x3]['value']:undefined)||_0xd5e8('0x4e')},{'name':_0xd5e8('0x4f'),'value':_0x569f00[_0xd5e8('0x4f')]||(_0x569f00[_0xd5e8('0x41')]&&_0x569f00[_0xd5e8('0x41')][0x4]?_0x569f00['attrs'][0x4][_0xd5e8('0x42')]:undefined)||''},{'name':_0xd5e8('0x50'),'value':_0x569f00[_0xd5e8('0x50')]||(_0x569f00[_0xd5e8('0x41')]&&_0x569f00['attrs'][0x5]?_0x569f00[_0xd5e8('0x41')][0x5][_0xd5e8('0x42')]:undefined)||''},{'name':_0xd5e8('0x51'),'value':_0x569f00['attrSmsAccounts']||(_0x569f00['attrs']&&_0x569f00['attrs'][0x6]?_0x569f00['attrs'][0x6][_0xd5e8('0x42')]:undefined)||''},{'name':_0xd5e8('0x52'),'value':_0x569f00[_0xd5e8('0x52')]||(_0x569f00['attrs']&&_0x569f00[_0xd5e8('0x41')][0x7]?_0x569f00[_0xd5e8('0x41')][0x7]['value']:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x569f00['attrWhatsappAccounts']||(_0x569f00[_0xd5e8('0x41')]&&_0x569f00[_0xd5e8('0x41')][0x8]?_0x569f00[_0xd5e8('0x41')][0x8][_0xd5e8('0x42')]:undefined)||''},{'name':'attrChatWebsites','value':_0x569f00[_0xd5e8('0x53')]||(_0x569f00[_0xd5e8('0x41')]&&_0x569f00[_0xd5e8('0x41')][0x9]?_0x569f00[_0xd5e8('0x41')][0x9][_0xd5e8('0x42')]:undefined)||''}];case _0xd5e8('0x54'):case _0xd5e8('0x55'):return[{'name':'attrSerie1','value':_0x569f00[_0xd5e8('0x56')]||(_0x569f00[_0xd5e8('0x41')]&&_0x569f00['attrs'][0x0]?_0x569f00[_0xd5e8('0x41')][0x0][_0xd5e8('0x42')]:undefined)||'total'},{'name':_0xd5e8('0x57'),'value':_0x569f00['attrSerie2']||(_0x569f00[_0xd5e8('0x41')]&&_0x569f00[_0xd5e8('0x41')][0x1]?_0x569f00['attrs'][0x1]['value']:undefined)||null},{'name':_0xd5e8('0x58'),'value':_0x569f00[_0xd5e8('0x58')]||(_0x569f00['attrs']&&_0x569f00[_0xd5e8('0x41')][0x2]?_0x569f00[_0xd5e8('0x41')][0x2]['value']:undefined)||null},{'name':_0xd5e8('0x4c'),'value':_0x569f00[_0xd5e8('0x4c')]||(_0x569f00[_0xd5e8('0x41')]&&_0x569f00[_0xd5e8('0x41')][0x3]?_0x569f00[_0xd5e8('0x41')][0x3]['value']:undefined)||[]},{'name':'attrChannel','value':_0x569f00[_0xd5e8('0x4d')]||(_0x569f00[_0xd5e8('0x41')]&&_0x569f00[_0xd5e8('0x41')][0x4]?_0x569f00[_0xd5e8('0x41')][0x4][_0xd5e8('0x42')]:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0x569f00[_0xd5e8('0x4f')]||(_0x569f00[_0xd5e8('0x41')]&&_0x569f00[_0xd5e8('0x41')][0x5]?_0x569f00[_0xd5e8('0x41')][0x5][_0xd5e8('0x42')]:undefined)||''},{'name':_0xd5e8('0x50'),'value':_0x569f00['attrFaxAccounts']||(_0x569f00[_0xd5e8('0x41')]&&_0x569f00[_0xd5e8('0x41')][0x6]?_0x569f00[_0xd5e8('0x41')][0x6][_0xd5e8('0x42')]:undefined)||''},{'name':_0xd5e8('0x51'),'value':_0x569f00[_0xd5e8('0x51')]||(_0x569f00[_0xd5e8('0x41')]&&_0x569f00[_0xd5e8('0x41')][0x7]?_0x569f00[_0xd5e8('0x41')][0x7][_0xd5e8('0x42')]:undefined)||''},{'name':_0xd5e8('0x52'),'value':_0x569f00['attrOpenchannelAccounts']||(_0x569f00[_0xd5e8('0x41')]&&_0x569f00[_0xd5e8('0x41')][0x8]?_0x569f00[_0xd5e8('0x41')][0x8][_0xd5e8('0x42')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x569f00[_0xd5e8('0x59')]||(_0x569f00['attrs']&&_0x569f00[_0xd5e8('0x41')][0x9]?_0x569f00[_0xd5e8('0x41')][0x9]['value']:undefined)||''},{'name':'attrChatWebsites','value':_0x569f00['attrChatWebsites']||(_0x569f00[_0xd5e8('0x41')]&&_0x569f00['attrs'][0xa]?_0x569f00[_0xd5e8('0x41')][0xa][_0xd5e8('0x42')]:undefined)||''}];case'web-report':return[{'name':'attrReport','type':_0x569f00[_0xd5e8('0x5a')]||(_0x569f00[_0xd5e8('0x41')]&&_0x569f00[_0xd5e8('0x41')][0x0]?_0x569f00[_0xd5e8('0x41')][0x0][_0xd5e8('0x3f')]:undefined)||null,'value':_0x569f00[_0xd5e8('0x5b')]||(_0x569f00[_0xd5e8('0x41')]&&_0x569f00[_0xd5e8('0x41')][0x0]?_0x569f00['attrs'][0x0][_0xd5e8('0x42')]:undefined)||null},{'name':_0xd5e8('0x5c'),'value':_0x569f00[_0xd5e8('0x5c')]||(_0x569f00[_0xd5e8('0x41')]&&_0x569f00[_0xd5e8('0x41')][0x1]?_0x569f00[_0xd5e8('0x41')][0x1][_0xd5e8('0x42')]:undefined)||0x0}];default:return[];}}catch(_0x4855c7){logger[_0xd5e8('0x2c')](_0xd5e8('0x5d'),JSON['stringify'](_0x4855c7));return[];}}exports[_0xd5e8('0x5e')]=function(_0x40f074,_0xf2a367){if(_0x40f074[_0xd5e8('0x5f')]){_0x40f074[_0xd5e8('0x5f')][_0xd5e8('0x41')]=widgetAttributes(_0x40f074[_0xd5e8('0x5f')]);}return db['DashboardItem'][_0xd5e8('0x5e')](_0x40f074[_0xd5e8('0x5f')],{})['then'](respondWithResult(_0xf2a367,0xc9))[_0xd5e8('0x3e')](handleError(_0xf2a367,null));};exports[_0xd5e8('0x60')]=function(_0x16eaee,_0x4233ec){if(_0x16eaee['body']['id']){delete _0x16eaee[_0xd5e8('0x5f')]['id'];}_0x16eaee[_0xd5e8('0x5f')][_0xd5e8('0x41')]=widgetAttributes(_0x16eaee[_0xd5e8('0x5f')]);return db['DashboardItem'][_0xd5e8('0x3d')]({'where':{'id':_0x16eaee['params']['id']}})[_0xd5e8('0x29')](handleEntityNotFound(_0x4233ec,null))[_0xd5e8('0x29')](saveUpdates(_0x16eaee[_0xd5e8('0x5f')],null))[_0xd5e8('0x29')](respondWithResult(_0x4233ec,null))['catch'](handleError(_0x4233ec,null));}; \ No newline at end of file +var _0xd69e=['defaults','./dashboardItem.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','update','then','destroy','error','stack','name','send','params','model','keys','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','include','find','catch','type','iframe','attrUrl','attrs','https://','attrPath','clock','attrHourFormat','value','attrTimezone','0.00','attrFontSize','counter','total','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','body','DashboardItem','create','eml-format','rimraf','zip-dir','request-promise','moment','sox','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','redis'];(function(_0x118355,_0x201311){var _0x32f7ea=function(_0x4fd55b){while(--_0x4fd55b){_0x118355['push'](_0x118355['shift']());}};_0x32f7ea(++_0x201311);}(_0xd69e,0xa0));var _0xed69=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xd69e[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require(_0xed69('0x0'));var rimraf=require(_0xed69('0x1'));var zipdir=require(_0xed69('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xed69('0x3'));var moment=require(_0xed69('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xed69('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xed69('0x6'));var _=require(_0xed69('0x7'));var squel=require(_0xed69('0x8'));var crypto=require(_0xed69('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xed69('0xa'));var toCsv=require('to-csv');var querystring=require(_0xed69('0xb'));var Papa=require(_0xed69('0xc'));var Redis=require('ioredis');var authService=require(_0xed69('0xd'));var qs=require(_0xed69('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xed69('0xf'));var logger=require('../../config/logger')(_0xed69('0x10'));var utils=require(_0xed69('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xed69('0x12'));var db=require('../../mysqldb')['db'];config[_0xed69('0x13')]=_[_0xed69('0x14')](config[_0xed69('0x13')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xed69('0x13')]));require(_0xed69('0x15'))[_0xed69('0x16')](socket);function respondWithStatusCode(_0x476524,_0x12cfd5){_0x12cfd5=_0x12cfd5||0xcc;return function(_0x5a9ffd){if(_0x5a9ffd){return _0x476524[_0xed69('0x17')](_0x12cfd5);}return _0x476524[_0xed69('0x18')](_0x12cfd5)[_0xed69('0x19')]();};}function respondWithResult(_0x118ab3,_0x35d924){_0x35d924=_0x35d924||0xc8;return function(_0x2990fa){if(_0x2990fa){return _0x118ab3[_0xed69('0x18')](_0x35d924)[_0xed69('0x1a')](_0x2990fa);}};}function respondWithFilteredResult(_0x1e7446,_0xa510c1){return function(_0x4df35e){if(_0x4df35e){var _0x4843bf=typeof _0xa510c1['offset']===_0xed69('0x1b')&&typeof _0xa510c1[_0xed69('0x1c')]===_0xed69('0x1b');var _0x576a71=_0x4df35e[_0xed69('0x1d')];var _0x11c1fc=_0x4843bf?0x0:_0xa510c1['offset'];var _0x3ed869=_0x4843bf?_0x4df35e[_0xed69('0x1d')]:_0xa510c1[_0xed69('0x1e')]+_0xa510c1[_0xed69('0x1c')];var _0x4ef2fe;if(_0x3ed869>=_0x576a71){_0x3ed869=_0x576a71;_0x4ef2fe=0xc8;}else{_0x4ef2fe=0xce;}_0x1e7446[_0xed69('0x18')](_0x4ef2fe);return _0x1e7446[_0xed69('0x1f')]('Content-Range',_0x11c1fc+'-'+_0x3ed869+'/'+_0x576a71)[_0xed69('0x1a')](_0x4df35e);}return null;};}function patchUpdates(_0x350f01){return function(_0x257550){try{jsonpatch[_0xed69('0x20')](_0x257550,_0x350f01,!![]);}catch(_0xa3486a){return BPromise[_0xed69('0x21')](_0xa3486a);}return _0x257550['save']();};}function saveUpdates(_0x35e7ec,_0x91b170){return function(_0x115558){if(_0x115558){return _0x115558[_0xed69('0x22')](_0x35e7ec)[_0xed69('0x23')](function(_0xd182bd){return _0xd182bd;});}return null;};}function removeEntity(_0x33f01f,_0x1e34c8){return function(_0x2156ad){if(_0x2156ad){return _0x2156ad[_0xed69('0x24')]()[_0xed69('0x23')](function(){_0x33f01f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x383a83,_0x228091){return function(_0x2c77d4){if(!_0x2c77d4){_0x383a83[_0xed69('0x17')](0x194);}return _0x2c77d4;};}function handleError(_0xbb7904,_0x21be83){_0x21be83=_0x21be83||0x1f4;return function(_0x5b6ee3){logger[_0xed69('0x25')](_0x5b6ee3[_0xed69('0x26')]);if(_0x5b6ee3[_0xed69('0x27')]){delete _0x5b6ee3['name'];}_0xbb7904['status'](_0x21be83)[_0xed69('0x28')](_0x5b6ee3);};}exports['show']=function(_0x379706,_0x234c8a){var _0x164316={'raw':![],'where':{'id':_0x379706[_0xed69('0x29')]['id']}},_0x1f4e54={};_0x1f4e54[_0xed69('0x2a')]=_[_0xed69('0x2b')](db['DashboardItem'][_0xed69('0x2c')]);_0x1f4e54[_0xed69('0x2d')]=_[_0xed69('0x2b')](_0x379706[_0xed69('0x2d')]);_0x1f4e54[_0xed69('0x2e')]=_[_0xed69('0x2f')](_0x1f4e54[_0xed69('0x2a')],_0x1f4e54['query']);_0x164316['attributes']=_[_0xed69('0x2f')](_0x1f4e54[_0xed69('0x2a')],qs[_0xed69('0x30')](_0x379706[_0xed69('0x2d')][_0xed69('0x30')]));_0x164316[_0xed69('0x31')]=_0x164316['attributes'][_0xed69('0x32')]?_0x164316[_0xed69('0x31')]:_0x1f4e54[_0xed69('0x2a')];if(_0x379706[_0xed69('0x2d')][_0xed69('0x33')]){_0x164316[_0xed69('0x34')]=[{'all':!![]}];}_0x164316=_['merge']({},_0x164316,_0x379706['options']);return db['DashboardItem'][_0xed69('0x35')](_0x164316)[_0xed69('0x23')](handleEntityNotFound(_0x234c8a,null))[_0xed69('0x23')](respondWithResult(_0x234c8a,null))[_0xed69('0x36')](handleError(_0x234c8a,null));};exports['destroy']=function(_0x347311,_0x338be3){return db['DashboardItem'][_0xed69('0x35')]({'where':{'id':_0x347311[_0xed69('0x29')]['id']}})[_0xed69('0x23')](handleEntityNotFound(_0x338be3,null))[_0xed69('0x23')](removeEntity(_0x338be3,null))['catch'](handleError(_0x338be3,null));};function widgetAttributes(_0x13f04c){try{switch(_0x13f04c[_0xed69('0x37')]){case _0xed69('0x38'):return[{'name':_0xed69('0x39'),'value':_0x13f04c[_0xed69('0x39')]||(_0x13f04c[_0xed69('0x3a')]&&_0x13f04c[_0xed69('0x3a')][0x0]?_0x13f04c[_0xed69('0x3a')][0x0]['value']:undefined)||_0xed69('0x3b')}];case'custom':return[{'name':_0xed69('0x3c'),'value':_0x13f04c[_0xed69('0x3c')]||(_0x13f04c[_0xed69('0x3a')]&&_0x13f04c['attrs'][0x0]?_0x13f04c[_0xed69('0x3a')][0x0]['value']:undefined)||''}];case _0xed69('0x3d'):return[{'name':_0xed69('0x3e'),'value':_0x13f04c[_0xed69('0x3e')]||(_0x13f04c[_0xed69('0x3a')]&&_0x13f04c[_0xed69('0x3a')][0x0]?_0x13f04c[_0xed69('0x3a')][0x0][_0xed69('0x3f')]:undefined)||'HH:mm:ss'},{'name':'attrTimezone','value':_0x13f04c[_0xed69('0x40')]||(_0x13f04c[_0xed69('0x3a')]&&_0x13f04c[_0xed69('0x3a')][0x1]?_0x13f04c[_0xed69('0x3a')][0x1]['value']:undefined)||_0xed69('0x41')},{'name':_0xed69('0x42'),'value':_0x13f04c[_0xed69('0x42')]||(_0x13f04c[_0xed69('0x3a')]&&_0x13f04c[_0xed69('0x3a')][0x2]?_0x13f04c[_0xed69('0x3a')][0x2][_0xed69('0x3f')]:undefined)||0xc}];case _0xed69('0x43'):return[{'name':'attrMetric','value':_0x13f04c['attrMetric']||(_0x13f04c[_0xed69('0x3a')]&&_0x13f04c[_0xed69('0x3a')][0x0]?_0x13f04c[_0xed69('0x3a')][0x0]['value']:undefined)||_0xed69('0x44')},{'name':_0xed69('0x45'),'value':_0x13f04c[_0xed69('0x45')]||(_0x13f04c[_0xed69('0x3a')]&&_0x13f04c[_0xed69('0x3a')][0x1]?_0x13f04c[_0xed69('0x3a')][0x1][_0xed69('0x3f')]:undefined)||[]},{'name':_0xed69('0x42'),'value':_0x13f04c['attrFontSize']||(_0x13f04c[_0xed69('0x3a')]&&_0x13f04c['attrs'][0x2]?_0x13f04c[_0xed69('0x3a')][0x2]['value']:undefined)||0x14},{'name':_0xed69('0x46'),'value':_0x13f04c[_0xed69('0x46')]||(_0x13f04c[_0xed69('0x3a')]&&_0x13f04c[_0xed69('0x3a')][0x3]?_0x13f04c['attrs'][0x3][_0xed69('0x3f')]:undefined)||'voice'},{'name':_0xed69('0x47'),'value':_0x13f04c[_0xed69('0x47')]||(_0x13f04c[_0xed69('0x3a')]&&_0x13f04c[_0xed69('0x3a')][0x4]?_0x13f04c[_0xed69('0x3a')][0x4][_0xed69('0x3f')]:undefined)||''},{'name':_0xed69('0x48'),'value':_0x13f04c[_0xed69('0x48')]||(_0x13f04c['attrs']&&_0x13f04c[_0xed69('0x3a')][0x5]?_0x13f04c[_0xed69('0x3a')][0x5][_0xed69('0x3f')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x13f04c[_0xed69('0x49')]||(_0x13f04c['attrs']&&_0x13f04c[_0xed69('0x3a')][0x6]?_0x13f04c[_0xed69('0x3a')][0x6][_0xed69('0x3f')]:undefined)||''},{'name':_0xed69('0x4a'),'value':_0x13f04c[_0xed69('0x4a')]||(_0x13f04c['attrs']&&_0x13f04c[_0xed69('0x3a')][0x7]?_0x13f04c[_0xed69('0x3a')][0x7]['value']:undefined)||''},{'name':_0xed69('0x4b'),'value':_0x13f04c[_0xed69('0x4b')]||(_0x13f04c[_0xed69('0x3a')]&&_0x13f04c['attrs'][0x8]?_0x13f04c['attrs'][0x8]['value']:undefined)||''},{'name':'attrChatWebsites','value':_0x13f04c[_0xed69('0x4c')]||(_0x13f04c[_0xed69('0x3a')]&&_0x13f04c[_0xed69('0x3a')][0x9]?_0x13f04c[_0xed69('0x3a')][0x9]['value']:undefined)||''}];case _0xed69('0x4d'):case'pie-chart':return[{'name':'attrSerie1','value':_0x13f04c[_0xed69('0x4e')]||(_0x13f04c[_0xed69('0x3a')]&&_0x13f04c[_0xed69('0x3a')][0x0]?_0x13f04c[_0xed69('0x3a')][0x0]['value']:undefined)||'total'},{'name':_0xed69('0x4f'),'value':_0x13f04c['attrSerie2']||(_0x13f04c[_0xed69('0x3a')]&&_0x13f04c[_0xed69('0x3a')][0x1]?_0x13f04c[_0xed69('0x3a')][0x1]['value']:undefined)||null},{'name':_0xed69('0x50'),'value':_0x13f04c[_0xed69('0x50')]||(_0x13f04c['attrs']&&_0x13f04c[_0xed69('0x3a')][0x2]?_0x13f04c[_0xed69('0x3a')][0x2][_0xed69('0x3f')]:undefined)||null},{'name':_0xed69('0x45'),'value':_0x13f04c['attrVoiceQueues']||(_0x13f04c[_0xed69('0x3a')]&&_0x13f04c['attrs'][0x3]?_0x13f04c['attrs'][0x3][_0xed69('0x3f')]:undefined)||[]},{'name':_0xed69('0x46'),'value':_0x13f04c[_0xed69('0x46')]||(_0x13f04c['attrs']&&_0x13f04c['attrs'][0x4]?_0x13f04c[_0xed69('0x3a')][0x4][_0xed69('0x3f')]:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0x13f04c[_0xed69('0x47')]||(_0x13f04c[_0xed69('0x3a')]&&_0x13f04c[_0xed69('0x3a')][0x5]?_0x13f04c[_0xed69('0x3a')][0x5][_0xed69('0x3f')]:undefined)||''},{'name':_0xed69('0x48'),'value':_0x13f04c[_0xed69('0x48')]||(_0x13f04c[_0xed69('0x3a')]&&_0x13f04c['attrs'][0x6]?_0x13f04c['attrs'][0x6][_0xed69('0x3f')]:undefined)||''},{'name':_0xed69('0x49'),'value':_0x13f04c[_0xed69('0x49')]||(_0x13f04c[_0xed69('0x3a')]&&_0x13f04c['attrs'][0x7]?_0x13f04c[_0xed69('0x3a')][0x7][_0xed69('0x3f')]:undefined)||''},{'name':_0xed69('0x4a'),'value':_0x13f04c[_0xed69('0x4a')]||(_0x13f04c[_0xed69('0x3a')]&&_0x13f04c[_0xed69('0x3a')][0x8]?_0x13f04c['attrs'][0x8][_0xed69('0x3f')]:undefined)||''},{'name':_0xed69('0x4b'),'value':_0x13f04c['attrWhatsappAccounts']||(_0x13f04c[_0xed69('0x3a')]&&_0x13f04c[_0xed69('0x3a')][0x9]?_0x13f04c[_0xed69('0x3a')][0x9][_0xed69('0x3f')]:undefined)||''},{'name':_0xed69('0x4c'),'value':_0x13f04c[_0xed69('0x4c')]||(_0x13f04c[_0xed69('0x3a')]&&_0x13f04c[_0xed69('0x3a')][0xa]?_0x13f04c[_0xed69('0x3a')][0xa][_0xed69('0x3f')]:undefined)||''}];case _0xed69('0x51'):return[{'name':_0xed69('0x52'),'type':_0x13f04c[_0xed69('0x53')]||(_0x13f04c[_0xed69('0x3a')]&&_0x13f04c[_0xed69('0x3a')][0x0]?_0x13f04c[_0xed69('0x3a')][0x0][_0xed69('0x37')]:undefined)||null,'value':_0x13f04c[_0xed69('0x52')]||(_0x13f04c['attrs']&&_0x13f04c['attrs'][0x0]?_0x13f04c[_0xed69('0x3a')][0x0][_0xed69('0x3f')]:undefined)||null},{'name':_0xed69('0x54'),'value':_0x13f04c[_0xed69('0x54')]||(_0x13f04c['attrs']&&_0x13f04c['attrs'][0x1]?_0x13f04c[_0xed69('0x3a')][0x1][_0xed69('0x3f')]:undefined)||0x0}];default:return[];}}catch(_0x3fb6b5){logger[_0xed69('0x25')](_0xed69('0x55'),JSON[_0xed69('0x56')](_0x3fb6b5));return[];}}exports['create']=function(_0x39d520,_0x271a43){if(_0x39d520[_0xed69('0x57')]){_0x39d520[_0xed69('0x57')][_0xed69('0x3a')]=widgetAttributes(_0x39d520[_0xed69('0x57')]);}return db[_0xed69('0x58')][_0xed69('0x59')](_0x39d520[_0xed69('0x57')],{})[_0xed69('0x23')](respondWithResult(_0x271a43,0xc9))['catch'](handleError(_0x271a43,null));};exports['update']=function(_0x47f006,_0x5bed4b){if(_0x47f006[_0xed69('0x57')]['id']){delete _0x47f006['body']['id'];}_0x47f006[_0xed69('0x57')][_0xed69('0x3a')]=widgetAttributes(_0x47f006[_0xed69('0x57')]);return db[_0xed69('0x58')][_0xed69('0x35')]({'where':{'id':_0x47f006[_0xed69('0x29')]['id']}})[_0xed69('0x23')](handleEntityNotFound(_0x5bed4b,null))['then'](saveUpdates(_0x47f006[_0xed69('0x57')],null))[_0xed69('0x23')](respondWithResult(_0x5bed4b,null))['catch'](handleError(_0x5bed4b,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index dbf16ff..fb6239b 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 _0xca64=['hook','exports','events','../../mysqldb','DashboardItem','save','emit','hasOwnProperty'];(function(_0x51172d,_0x200cf2){var _0x52064d=function(_0xa3008f){while(--_0xa3008f){_0x51172d['push'](_0x51172d['shift']());}};_0x52064d(++_0x200cf2);}(_0xca64,0x1ca));var _0x4ca6=function(_0x833417,_0x2ea2f9){_0x833417=_0x833417-0x0;var _0x388395=_0xca64[_0x833417];return _0x388395;};'use strict';var EventEmitter=require(_0x4ca6('0x0'));var DashboardItem=require(_0x4ca6('0x1'))['db'][_0x4ca6('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4ca6('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1d1508){return function(_0x2790b2,_0x584b48,_0x5f5537){DashboardItemEvents[_0x4ca6('0x4')](_0x1d1508+':'+_0x2790b2['id'],_0x2790b2);DashboardItemEvents[_0x4ca6('0x4')](_0x1d1508,_0x2790b2);_0x5f5537(null);};}for(var e in events){if(events[_0x4ca6('0x5')](e)){var event=events[e];DashboardItem[_0x4ca6('0x6')](e,emitEvent(event));}}module[_0x4ca6('0x7')]=DashboardItemEvents; \ No newline at end of file +var _0xe8fc=['../../mysqldb','DashboardItem','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0x1616df,_0x3e66b5){var _0x6a7d7b=function(_0x454b20){while(--_0x454b20){_0x1616df['push'](_0x1616df['shift']());}};_0x6a7d7b(++_0x3e66b5);}(_0xe8fc,0x144));var _0xce8f=function(_0x3f6c23,_0x436877){_0x3f6c23=_0x3f6c23-0x0;var _0x1fe8b1=_0xe8fc[_0x3f6c23];return _0x1fe8b1;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0xce8f('0x0'))['db'][_0xce8f('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xce8f('0x2')](0x0);var events={'afterCreate':_0xce8f('0x3'),'afterUpdate':_0xce8f('0x4'),'afterDestroy':_0xce8f('0x5')};function emitEvent(_0xf6c6fa){return function(_0x2312a9,_0x3548f2,_0x97abb2){DashboardItemEvents[_0xce8f('0x6')](_0xf6c6fa+':'+_0x2312a9['id'],_0x2312a9);DashboardItemEvents['emit'](_0xf6c6fa,_0x2312a9);_0x97abb2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0xce8f('0x7')](e,emitEvent(event));}}module[_0xce8f('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 25aadb5..d353b1d 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 _0xb73c=['path','../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x4d9e83,_0xa7f81d){var _0xde0d0c=function(_0x7c7db6){while(--_0x7c7db6){_0x4d9e83['push'](_0x4d9e83['shift']());}};_0xde0d0c(++_0xa7f81d);}(_0xb73c,0xd2));var _0xcb73=function(_0x5a2cf0,_0x2297bb){_0x5a2cf0=_0x5a2cf0-0x0;var _0x12b721=_0xb73c[_0x5a2cf0];return _0x12b721;};'use strict';var _=require(_0xcb73('0x0'));var util=require(_0xcb73('0x1'));var logger=require(_0xcb73('0x2'))(_0xcb73('0x3'));var moment=require('moment');var BPromise=require(_0xcb73('0x4'));var rp=require(_0xcb73('0x5'));var fs=require('fs');var path=require(_0xcb73('0x6'));var rimraf=require('rimraf');var config=require(_0xcb73('0x7'));var attributes=require(_0xcb73('0x8'));module[_0xcb73('0x9')]=function(_0x907cc9,_0x150ea3){return _0x907cc9[_0xcb73('0xa')](_0xcb73('0xb'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x35b5=['dashboard_items','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./dashboardItem.attributes','define'];(function(_0x4c1ecb,_0x1b5c2b){var _0x5759e4=function(_0x52c2e0){while(--_0x52c2e0){_0x4c1ecb['push'](_0x4c1ecb['shift']());}};_0x5759e4(++_0x1b5c2b);}(_0x35b5,0x1c4));var _0x535b=function(_0x14d68f,_0x3d3b93){_0x14d68f=_0x14d68f-0x0;var _0x33c4e2=_0x35b5[_0x14d68f];return _0x33c4e2;};'use strict';var _=require(_0x535b('0x0'));var util=require('util');var logger=require(_0x535b('0x1'))(_0x535b('0x2'));var moment=require(_0x535b('0x3'));var BPromise=require(_0x535b('0x4'));var rp=require(_0x535b('0x5'));var fs=require('fs');var path=require(_0x535b('0x6'));var rimraf=require('rimraf');var config=require(_0x535b('0x7'));var attributes=require(_0x535b('0x8'));module['exports']=function(_0x436b8f,_0x5ab9d7){return _0x436b8f[_0x535b('0x9')]('DashboardItem',attributes,{'tableName':_0x535b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index 68bcc09..60486be 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 _0xa1f8=['rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','request\x20sent','debug','stringify','error','code','message','DashboardItem,\x20%s,\x20%s','info','catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x2740a7,_0x1a4082){var _0x3fc4bf=function(_0x11d19){while(--_0x11d19){_0x2740a7['push'](_0x2740a7['shift']());}};_0x3fc4bf(++_0x1a4082);}(_0xa1f8,0xe4));var _0x8a1f=function(_0x296427,_0x120868){_0x296427=_0x296427-0x0;var _0x12ef4d=_0xa1f8[_0x296427];return _0x12ef4d;};'use strict';var _=require(_0x8a1f('0x0'));var util=require('util');var moment=require(_0x8a1f('0x1'));var BPromise=require('bluebird');var rs=require(_0x8a1f('0x2'));var fs=require('fs');var Redis=require(_0x8a1f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8a1f('0x4'));var logger=require(_0x8a1f('0x5'))(_0x8a1f('0x6'));var config=require('../../config/environment');var jayson=require(_0x8a1f('0x7'));var client=jayson[_0x8a1f('0x8')][_0x8a1f('0x9')]({'port':0x232a});config[_0x8a1f('0xa')]=_[_0x8a1f('0xb')](config[_0x8a1f('0xa')],{'host':_0x8a1f('0xc'),'port':0x18eb});var socket=require(_0x8a1f('0xd'))(new Redis(config['redis']));require('./dashboardItem.socket')[_0x8a1f('0xe')](socket);function respondWithRpcPromise(_0x37d84b,_0x2db913,_0x444f62){return new BPromise(function(_0x33dd75,_0x628827){return client[_0x8a1f('0xf')](_0x37d84b,_0x444f62)[_0x8a1f('0x10')](function(_0x5cf0ee){logger['info']('DashboardItem,\x20%s,\x20%s',_0x2db913,_0x8a1f('0x11'));logger[_0x8a1f('0x12')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x2db913,_0x8a1f('0x11'),JSON[_0x8a1f('0x13')](_0x5cf0ee));if(_0x5cf0ee['error']){if(_0x5cf0ee[_0x8a1f('0x14')][_0x8a1f('0x15')]===0x1f4){logger[_0x8a1f('0x14')]('DashboardItem,\x20%s,\x20%s',_0x2db913,_0x5cf0ee[_0x8a1f('0x14')][_0x8a1f('0x16')]);return _0x628827(_0x5cf0ee[_0x8a1f('0x14')][_0x8a1f('0x16')]);}logger[_0x8a1f('0x14')](_0x8a1f('0x17'),_0x2db913,_0x5cf0ee[_0x8a1f('0x14')][_0x8a1f('0x16')]);return _0x33dd75(_0x5cf0ee[_0x8a1f('0x14')][_0x8a1f('0x16')]);}else{logger[_0x8a1f('0x18')](_0x8a1f('0x17'),_0x2db913,_0x8a1f('0x11'));_0x33dd75(_0x5cf0ee['result'][_0x8a1f('0x16')]);}})[_0x8a1f('0x19')](function(_0x365f42){logger[_0x8a1f('0x14')](_0x8a1f('0x17'),_0x2db913,_0x365f42);_0x628827(_0x365f42);});});} \ No newline at end of file +var _0xd73c=['../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x51d267,_0x160ccb){var _0x3f4476=function(_0x3798bb){while(--_0x3798bb){_0x51d267['push'](_0x51d267['shift']());}};_0x3f4476(++_0x160ccb);}(_0xd73c,0x1aa));var _0xcd73=function(_0xe97a4a,_0x59fc5b){_0xe97a4a=_0xe97a4a-0x0;var _0x51add6=_0xd73c[_0xe97a4a];return _0x51add6;};'use strict';var _=require(_0xcd73('0x0'));var util=require('util');var moment=require(_0xcd73('0x1'));var BPromise=require(_0xcd73('0x2'));var rs=require(_0xcd73('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcd73('0x4'))['db'];var utils=require(_0xcd73('0x5'));var logger=require(_0xcd73('0x6'))(_0xcd73('0x7'));var config=require(_0xcd73('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xcd73('0x9')]=_[_0xcd73('0xa')](config['redis'],{'host':_0xcd73('0xb'),'port':0x18eb});var socket=require(_0xcd73('0xc'))(new Redis(config['redis']));require(_0xcd73('0xd'))[_0xcd73('0xe')](socket);function respondWithRpcPromise(_0x443991,_0x2f59f1,_0x569de5){return new BPromise(function(_0x1b10b5,_0xbbf68d){return client[_0xcd73('0xf')](_0x443991,_0x569de5)[_0xcd73('0x10')](function(_0x3555bd){logger[_0xcd73('0x11')](_0xcd73('0x12'),_0x2f59f1,_0xcd73('0x13'));logger[_0xcd73('0x14')](_0xcd73('0x15'),_0x2f59f1,_0xcd73('0x13'),JSON[_0xcd73('0x16')](_0x3555bd));if(_0x3555bd[_0xcd73('0x17')]){if(_0x3555bd[_0xcd73('0x17')][_0xcd73('0x18')]===0x1f4){logger[_0xcd73('0x17')]('DashboardItem,\x20%s,\x20%s',_0x2f59f1,_0x3555bd[_0xcd73('0x17')][_0xcd73('0x19')]);return _0xbbf68d(_0x3555bd['error'][_0xcd73('0x19')]);}logger['error'](_0xcd73('0x12'),_0x2f59f1,_0x3555bd[_0xcd73('0x17')][_0xcd73('0x19')]);return _0x1b10b5(_0x3555bd[_0xcd73('0x17')]['message']);}else{logger[_0xcd73('0x11')](_0xcd73('0x12'),_0x2f59f1,_0xcd73('0x13'));_0x1b10b5(_0x3555bd[_0xcd73('0x1a')][_0xcd73('0x19')]);}})['catch'](function(_0x3e68e8){logger['error'](_0xcd73('0x12'),_0x2f59f1,_0x3e68e8);_0xbbf68d(_0x3e68e8);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 524396b..9f90818 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 _0xd8a5=['update','emit','removeListener','register','length','dashboardItem:','save','remove'];(function(_0x1aab86,_0x48c54e){var _0x25571c=function(_0x301683){while(--_0x301683){_0x1aab86['push'](_0x1aab86['shift']());}};_0x25571c(++_0x48c54e);}(_0xd8a5,0x1b6));var _0x5d8a=function(_0x2a34ea,_0x1bfc7a){_0x2a34ea=_0x2a34ea-0x0;var _0x3ae082=_0xd8a5[_0x2a34ea];return _0x3ae082;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x5d8a('0x0'),_0x5d8a('0x1'),_0x5d8a('0x2')];function createListener(_0x5af6d0,_0x319a0e){return function(_0x1b0c67){_0x319a0e[_0x5d8a('0x3')](_0x5af6d0,_0x1b0c67);};}function removeListener(_0x3b88c2,_0x185201){return function(){DashboardItemEvents[_0x5d8a('0x4')](_0x3b88c2,_0x185201);};}exports[_0x5d8a('0x5')]=function(_0x525887){for(var _0x5d3024=0x0,_0x4171af=events[_0x5d8a('0x6')];_0x5d3024<_0x4171af;_0x5d3024++){var _0x4189b4=events[_0x5d3024];var _0x2c9e37=createListener(_0x5d8a('0x7')+_0x4189b4,_0x525887);DashboardItemEvents['on'](_0x4189b4,_0x2c9e37);}}; \ No newline at end of file +var _0xb62d=['register','dashboardItem:','./dashboardItem.events','save','remove','update','emit','removeListener'];(function(_0x3fec75,_0x523d63){var _0x1dc06=function(_0xf83a9){while(--_0xf83a9){_0x3fec75['push'](_0x3fec75['shift']());}};_0x1dc06(++_0x523d63);}(_0xb62d,0xba));var _0xdb62=function(_0x2405de,_0x548637){_0x2405de=_0x2405de-0x0;var _0xeadb6e=_0xb62d[_0x2405de];return _0xeadb6e;};'use strict';var DashboardItemEvents=require(_0xdb62('0x0'));var events=[_0xdb62('0x1'),_0xdb62('0x2'),_0xdb62('0x3')];function createListener(_0x1d0b6d,_0x28323a){return function(_0x1c52ba){_0x28323a[_0xdb62('0x4')](_0x1d0b6d,_0x1c52ba);};}function removeListener(_0x3eaf0e,_0x13db16){return function(){DashboardItemEvents[_0xdb62('0x5')](_0x3eaf0e,_0x13db16);};}exports[_0xdb62('0x6')]=function(_0x1fab55){for(var _0x2021b2=0x0,_0x3cd285=events['length'];_0x2021b2<_0x3cd285;_0x2021b2++){var _0x411aa7=events[_0x2021b2];var _0xf4622d=createListener(_0xdb62('0x7')+_0x411aa7,_0x1fab55);DashboardItemEvents['on'](_0x411aa7,_0xf4622d);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index f5ad8af..861cb65 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 _0xc3be=['../../components/interaction/service','./dashboardItem.controller','get','/:id','show','post','isAuthenticated','create','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x8acd62,_0x4c5f14){var _0x167877=function(_0x5654f7){while(--_0x5654f7){_0x8acd62['push'](_0x8acd62['shift']());}};_0x167877(++_0x4c5f14);}(_0xc3be,0x1c5));var _0xec3b=function(_0x4f76b6,_0x38b4ef){_0x4f76b6=_0x4f76b6-0x0;var _0x3a7853=_0xc3be[_0x4f76b6];return _0x3a7853;};'use strict';var multer=require('multer');var util=require(_0xec3b('0x0'));var path=require(_0xec3b('0x1'));var timeout=require(_0xec3b('0x2'));var express=require(_0xec3b('0x3'));var router=express[_0xec3b('0x4')]();var fs_extra=require(_0xec3b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xec3b('0x6'));var config=require('../../config/environment');var controller=require(_0xec3b('0x7'));router[_0xec3b('0x8')](_0xec3b('0x9'),auth['isAuthenticated'](),controller[_0xec3b('0xa')]);router[_0xec3b('0xb')]('/',auth[_0xec3b('0xc')](),controller[_0xec3b('0xd')]);router['put'](_0xec3b('0x9'),auth[_0xec3b('0xc')](),controller[_0xec3b('0xe')]);router[_0xec3b('0xf')](_0xec3b('0x9'),auth[_0xec3b('0xc')](),controller[_0xec3b('0x10')]);module['exports']=router; \ No newline at end of file +var _0xaa5d=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./dashboardItem.controller','/:id','post','isAuthenticated','create','delete','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaa5d,0x13b));var _0xdaa5=function(_0x3de4f8,_0x336c7d){_0x3de4f8=_0x3de4f8-0x0;var _0x3d81fc=_0xaa5d[_0x3de4f8];return _0x3d81fc;};'use strict';var multer=require(_0xdaa5('0x0'));var util=require(_0xdaa5('0x1'));var path=require(_0xdaa5('0x2'));var timeout=require(_0xdaa5('0x3'));var express=require(_0xdaa5('0x4'));var router=express[_0xdaa5('0x5')]();var fs_extra=require(_0xdaa5('0x6'));var auth=require(_0xdaa5('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xdaa5('0x8'));router['get'](_0xdaa5('0x9'),auth['isAuthenticated'](),controller['show']);router[_0xdaa5('0xa')]('/',auth[_0xdaa5('0xb')](),controller[_0xdaa5('0xc')]);router['put'](_0xdaa5('0x9'),auth[_0xdaa5('0xb')](),controller['update']);router[_0xdaa5('0xd')](_0xdaa5('0x9'),auth[_0xdaa5('0xb')](),controller[_0xdaa5('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 4a64590..3fc90c7 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 _0x0edb=['exports','ENUM','first','second','third','STRING','sequelize'];(function(_0x7b173,_0x539d7f){var _0x1c598c=function(_0xe1e1e0){while(--_0xe1e1e0){_0x7b173['push'](_0x7b173['shift']());}};_0x1c598c(++_0x539d7f);}(_0x0edb,0x110));var _0xb0ed=function(_0xba568,_0xe5ccb3){_0xba568=_0xba568-0x0;var _0x42abc3=_0x0edb[_0xba568];return _0x42abc3;};'use strict';var Sequelize=require(_0xb0ed('0x0'));module[_0xb0ed('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0xb0ed('0x2')](_0xb0ed('0x3'),_0xb0ed('0x4'),_0xb0ed('0x5')),'allowNull':![],'defaultValue':_0xb0ed('0x3')},'description':{'type':Sequelize[_0xb0ed('0x6')]}}; \ No newline at end of file +var _0x40a9=['ENUM','first','third','sequelize','exports','STRING'];(function(_0x44aca9,_0x392405){var _0x5c2315=function(_0x3d9997){while(--_0x3d9997){_0x44aca9['push'](_0x44aca9['shift']());}};_0x5c2315(++_0x392405);}(_0x40a9,0xf3));var _0x940a=function(_0x5a9683,_0x36cc18){_0x5a9683=_0x5a9683-0x0;var _0x3300c3=_0x40a9[_0x5a9683];return _0x3300c3;};'use strict';var Sequelize=require(_0x940a('0x0'));module[_0x940a('0x1')]={'name':{'type':Sequelize[_0x940a('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x940a('0x3')](_0x940a('0x4'),'second',_0x940a('0x5')),'allowNull':![],'defaultValue':_0x940a('0x4')},'description':{'type':Sequelize[_0x940a('0x2')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 6366644..d371cee 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 _0x08bc=['desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Dispositions','UserProfileResource','error','stack','name','send','index','map','Disposition','fieldName','type','key','query','attributes','intersection','model','hasOwnProperty','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','keys','rawAttributes','fields','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','moment','bluebird','ejs','fs-extra','lodash','squel','jsforce'];(function(_0x3aa19c,_0x38e3e1){var _0x1da822=function(_0x3fec30){while(--_0x3fec30){_0x3aa19c['push'](_0x3aa19c['shift']());}};_0x1da822(++_0x38e3e1);}(_0x08bc,0xf8));var _0xc08b=function(_0x422be2,_0x1c439e){_0x422be2=_0x422be2-0x0;var _0x1b820e=_0x08bc[_0x422be2];return _0x1b820e;};'use strict';var emlformat=require(_0xc08b('0x0'));var rimraf=require(_0xc08b('0x1'));var zipdir=require(_0xc08b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc08b('0x3'));var BPromise=require(_0xc08b('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc08b('0x5'));var fs=require('fs');var fs_extra=require(_0xc08b('0x6'));var _=require(_0xc08b('0x7'));var squel=require(_0xc08b('0x8'));var crypto=require('crypto');var jsforce=require(_0xc08b('0x9'));var deskjs=require(_0xc08b('0xa'));var toCsv=require(_0xc08b('0xb'));var querystring=require(_0xc08b('0xc'));var Papa=require(_0xc08b('0xd'));var Redis=require('ioredis');var authService=require(_0xc08b('0xe'));var qs=require(_0xc08b('0xf'));var as=require(_0xc08b('0x10'));var hardwareService=require(_0xc08b('0x11'));var logger=require(_0xc08b('0x12'))(_0xc08b('0x13'));var utils=require(_0xc08b('0x14'));var config=require(_0xc08b('0x15'));var licenseUtil=require(_0xc08b('0x16'));var db=require(_0xc08b('0x17'))['db'];function respondWithStatusCode(_0x4a96c9,_0x2ada42){_0x2ada42=_0x2ada42||0xcc;return function(_0x4a0fe3){if(_0x4a0fe3){return _0x4a96c9[_0xc08b('0x18')](_0x2ada42);}return _0x4a96c9[_0xc08b('0x19')](_0x2ada42)[_0xc08b('0x1a')]();};}function respondWithResult(_0x4d09b4,_0x5dd964){_0x5dd964=_0x5dd964||0xc8;return function(_0x5963d7){if(_0x5963d7){return _0x4d09b4[_0xc08b('0x19')](_0x5dd964)[_0xc08b('0x1b')](_0x5963d7);}};}function respondWithFilteredResult(_0x5d0e05,_0x4055cd){return function(_0x2b6b0b){if(_0x2b6b0b){var _0x4d0c87=typeof _0x4055cd['offset']===_0xc08b('0x1c')&&typeof _0x4055cd[_0xc08b('0x1d')]==='undefined';var _0x21753c=_0x2b6b0b[_0xc08b('0x1e')];var _0x191f50=_0x4d0c87?0x0:_0x4055cd['offset'];var _0xefde83=_0x4d0c87?_0x2b6b0b[_0xc08b('0x1e')]:_0x4055cd[_0xc08b('0x1f')]+_0x4055cd[_0xc08b('0x1d')];var _0x400b62;if(_0xefde83>=_0x21753c){_0xefde83=_0x21753c;_0x400b62=0xc8;}else{_0x400b62=0xce;}_0x5d0e05[_0xc08b('0x19')](_0x400b62);return _0x5d0e05[_0xc08b('0x20')](_0xc08b('0x21'),_0x191f50+'-'+_0xefde83+'/'+_0x21753c)[_0xc08b('0x1b')](_0x2b6b0b);}return null;};}function patchUpdates(_0x35c78b){return function(_0xa3ceff){try{jsonpatch[_0xc08b('0x22')](_0xa3ceff,_0x35c78b,!![]);}catch(_0x8c2ac){return BPromise[_0xc08b('0x23')](_0x8c2ac);}return _0xa3ceff[_0xc08b('0x24')]();};}function saveUpdates(_0x4f59f4,_0x4b049b){return function(_0x4ccab){if(_0x4ccab){return _0x4ccab[_0xc08b('0x25')](_0x4f59f4)[_0xc08b('0x26')](function(_0x2b6fe4){return _0x2b6fe4;});}return null;};}function removeEntity(_0x356373,_0x1d47e2){return function(_0xd41023){if(_0xd41023){return _0xd41023[_0xc08b('0x27')]()[_0xc08b('0x26')](function(){var _0x279ad6=_0xd41023[_0xc08b('0x28')]({'plain':!![]});var _0x244f0e=_0xc08b('0x29');return db[_0xc08b('0x2a')][_0xc08b('0x27')]({'where':{'type':_0x244f0e,'resourceId':_0x279ad6['id']}})[_0xc08b('0x26')](function(){return _0xd41023;});})['then'](function(){_0x356373[_0xc08b('0x19')](0xcc)[_0xc08b('0x1a')]();});}};}function handleEntityNotFound(_0x5a0788,_0x3063e0){return function(_0x2f2c4f){if(!_0x2f2c4f){_0x5a0788[_0xc08b('0x18')](0x194);}return _0x2f2c4f;};}function handleError(_0x25b3ea,_0x13dedd){_0x13dedd=_0x13dedd||0x1f4;return function(_0x5ebbe8){logger[_0xc08b('0x2b')](_0x5ebbe8[_0xc08b('0x2c')]);if(_0x5ebbe8[_0xc08b('0x2d')]){delete _0x5ebbe8[_0xc08b('0x2d')];}_0x25b3ea['status'](_0x13dedd)[_0xc08b('0x2e')](_0x5ebbe8);};}exports[_0xc08b('0x2f')]=function(_0x46b356,_0x1e52aa){var _0x21a459={},_0x5c336a={},_0x5829a5={'count':0x0,'rows':[]};var _0x2ff749=_[_0xc08b('0x30')](db[_0xc08b('0x31')]['rawAttributes'],function(_0x137802){return{'name':_0x137802[_0xc08b('0x32')],'type':_0x137802[_0xc08b('0x33')][_0xc08b('0x34')]};});_0x5c336a['model']=_[_0xc08b('0x30')](_0x2ff749,_0xc08b('0x2d'));_0x5c336a[_0xc08b('0x35')]=_['keys'](_0x46b356[_0xc08b('0x35')]);_0x5c336a['filters']=_['intersection'](_0x5c336a['model'],_0x5c336a['query']);_0x21a459[_0xc08b('0x36')]=_[_0xc08b('0x37')](_0x5c336a[_0xc08b('0x38')],qs['fields'](_0x46b356[_0xc08b('0x35')]['fields']));_0x21a459[_0xc08b('0x36')]=_0x21a459[_0xc08b('0x36')]['length']?_0x21a459[_0xc08b('0x36')]:_0x5c336a[_0xc08b('0x38')];if(!_0x46b356['query'][_0xc08b('0x39')]('nolimit')){_0x21a459[_0xc08b('0x1d')]=qs['limit'](_0x46b356['query'][_0xc08b('0x1d')]);_0x21a459[_0xc08b('0x1f')]=qs[_0xc08b('0x1f')](_0x46b356[_0xc08b('0x35')]['offset']);}_0x21a459[_0xc08b('0x3a')]=qs[_0xc08b('0x3b')](_0x46b356[_0xc08b('0x35')][_0xc08b('0x3b')]);_0x21a459[_0xc08b('0x3c')]=qs[_0xc08b('0x3d')](_[_0xc08b('0x3e')](_0x46b356[_0xc08b('0x35')],_0x5c336a['filters']),_0x2ff749);if(_0x46b356['query']['filter']){_0x21a459['where']=_[_0xc08b('0x3f')](_0x21a459[_0xc08b('0x3c')],{'$or':_[_0xc08b('0x30')](_0x2ff749,function(_0x58cd00){if(_0x58cd00[_0xc08b('0x33')]!==_0xc08b('0x40')){var _0x1da0ec={};_0x1da0ec[_0x58cd00[_0xc08b('0x2d')]]={'$like':'%'+_0x46b356['query'][_0xc08b('0x41')]+'%'};return _0x1da0ec;}})});}_0x21a459=_[_0xc08b('0x3f')]({},_0x21a459,_0x46b356[_0xc08b('0x42')]);var _0x3df59d={'where':_0x21a459[_0xc08b('0x3c')]};return db[_0xc08b('0x31')]['count'](_0x3df59d)[_0xc08b('0x26')](function(_0x5ce170){_0x5829a5['count']=_0x5ce170;if(_0x46b356[_0xc08b('0x35')][_0xc08b('0x43')]){_0x21a459[_0xc08b('0x44')]=[{'all':!![]}];}return db[_0xc08b('0x31')][_0xc08b('0x45')](_0x21a459);})[_0xc08b('0x26')](function(_0x3d1fdc){_0x5829a5['rows']=_0x3d1fdc;return _0x5829a5;})[_0xc08b('0x26')](respondWithFilteredResult(_0x1e52aa,_0x21a459))[_0xc08b('0x46')](handleError(_0x1e52aa,null));};exports[_0xc08b('0x47')]=function(_0x153fbd,_0x42f301){var _0x36ecef={'raw':!![],'where':{'id':_0x153fbd[_0xc08b('0x48')]['id']}},_0x4fd545={};_0x4fd545['model']=_[_0xc08b('0x49')](db['Disposition'][_0xc08b('0x4a')]);_0x4fd545[_0xc08b('0x35')]=_[_0xc08b('0x49')](_0x153fbd[_0xc08b('0x35')]);_0x4fd545[_0xc08b('0x3d')]=_[_0xc08b('0x37')](_0x4fd545[_0xc08b('0x38')],_0x4fd545[_0xc08b('0x35')]);_0x36ecef[_0xc08b('0x36')]=_[_0xc08b('0x37')](_0x4fd545[_0xc08b('0x38')],qs[_0xc08b('0x4b')](_0x153fbd[_0xc08b('0x35')][_0xc08b('0x4b')]));_0x36ecef[_0xc08b('0x36')]=_0x36ecef['attributes'][_0xc08b('0x4c')]?_0x36ecef[_0xc08b('0x36')]:_0x4fd545[_0xc08b('0x38')];if(_0x153fbd[_0xc08b('0x35')][_0xc08b('0x43')]){_0x36ecef[_0xc08b('0x44')]=[{'all':!![]}];}_0x36ecef=_[_0xc08b('0x3f')]({},_0x36ecef,_0x153fbd[_0xc08b('0x42')]);return db[_0xc08b('0x31')]['find'](_0x36ecef)[_0xc08b('0x26')](handleEntityNotFound(_0x42f301,null))[_0xc08b('0x26')](respondWithResult(_0x42f301,null))[_0xc08b('0x46')](handleError(_0x42f301,null));};exports[_0xc08b('0x4d')]=function(_0x172bcd,_0x281807){return db[_0xc08b('0x31')][_0xc08b('0x4d')](_0x172bcd[_0xc08b('0x4e')],{})['then'](function(_0x54a2f2){var _0x217d78=_0x172bcd[_0xc08b('0x4f')][_0xc08b('0x28')]({'plain':!![]});if(!_0x217d78)throw new Error(_0xc08b('0x50'));if(_0x217d78[_0xc08b('0x51')]===_0xc08b('0x4f')){var _0x160927=_0x54a2f2[_0xc08b('0x28')]({'plain':!![]});var _0x25b493='Dispositions';return db[_0xc08b('0x52')][_0xc08b('0x53')]({'where':{'name':_0x25b493,'userProfileId':_0x217d78[_0xc08b('0x54')]},'raw':!![]})['then'](function(_0x58f1af){if(_0x58f1af&&_0x58f1af['autoAssociation']===0x0){return db[_0xc08b('0x2a')][_0xc08b('0x4d')]({'name':_0x160927[_0xc08b('0x2d')],'resourceId':_0x160927['id'],'type':_0x58f1af[_0xc08b('0x2d')],'sectionId':_0x58f1af['id']},{})['then'](function(){return _0x54a2f2;});}else{return _0x54a2f2;}})[_0xc08b('0x46')](function(_0x2a54e6){logger[_0xc08b('0x2b')](_0xc08b('0x55'),_0x2a54e6);throw _0x2a54e6;});}return _0x54a2f2;})[_0xc08b('0x26')](respondWithResult(_0x281807,0xc9))[_0xc08b('0x46')](handleError(_0x281807,null));};exports[_0xc08b('0x25')]=function(_0x4b41e2,_0x5d1f50){if(_0x4b41e2[_0xc08b('0x4e')]['id']){delete _0x4b41e2[_0xc08b('0x4e')]['id'];}return db['Disposition'][_0xc08b('0x53')]({'where':{'id':_0x4b41e2['params']['id']}})['then'](handleEntityNotFound(_0x5d1f50,null))[_0xc08b('0x26')](saveUpdates(_0x4b41e2[_0xc08b('0x4e')],null))['then'](respondWithResult(_0x5d1f50,null))[_0xc08b('0x46')](handleError(_0x5d1f50,null));};exports[_0xc08b('0x27')]=function(_0x123b6a,_0x3a6ec9){return db['Disposition'][_0xc08b('0x53')]({'where':{'id':_0x123b6a[_0xc08b('0x48')]['id']}})['then'](handleEntityNotFound(_0x3a6ec9,null))[_0xc08b('0x26')](removeEntity(_0x3a6ec9,null))['catch'](handleError(_0x3a6ec9,null));}; \ No newline at end of file +var _0x0c01=['mustache','util','path','sox','to-csv','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','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','destroy','get','Dispositions','UserProfileResource','sendStatus','error','stack','name','send','index','map','Disposition','rawAttributes','fieldName','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','then','include','rows','catch','params','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0xef8ec,_0x2f64d9){var _0x30c59c=function(_0x169213){while(--_0x169213){_0xef8ec['push'](_0xef8ec['shift']());}};_0x30c59c(++_0x2f64d9);}(_0x0c01,0x9d));var _0x10c0=function(_0x16e4b2,_0x3e52d4){_0x16e4b2=_0x16e4b2-0x0;var _0x436b2a=_0x0c01[_0x16e4b2];return _0x436b2a;};'use strict';var emlformat=require(_0x10c0('0x0'));var rimraf=require(_0x10c0('0x1'));var zipdir=require(_0x10c0('0x2'));var jsonpatch=require(_0x10c0('0x3'));var rp=require(_0x10c0('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x10c0('0x5'));var util=require(_0x10c0('0x6'));var path=require(_0x10c0('0x7'));var sox=require(_0x10c0('0x8'));var csv=require(_0x10c0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x10c0('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x10c0('0xb'));var toCsv=require(_0x10c0('0x9'));var querystring=require(_0x10c0('0xc'));var Papa=require(_0x10c0('0xd'));var Redis=require(_0x10c0('0xe'));var authService=require(_0x10c0('0xf'));var qs=require(_0x10c0('0x10'));var as=require(_0x10c0('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x10c0('0x12'))(_0x10c0('0x13'));var utils=require(_0x10c0('0x14'));var config=require(_0x10c0('0x15'));var licenseUtil=require(_0x10c0('0x16'));var db=require(_0x10c0('0x17'))['db'];function respondWithStatusCode(_0x4adb0c,_0x467209){_0x467209=_0x467209||0xcc;return function(_0x1087e5){if(_0x1087e5){return _0x4adb0c['sendStatus'](_0x467209);}return _0x4adb0c[_0x10c0('0x18')](_0x467209)[_0x10c0('0x19')]();};}function respondWithResult(_0x456294,_0x9091f2){_0x9091f2=_0x9091f2||0xc8;return function(_0x269be2){if(_0x269be2){return _0x456294[_0x10c0('0x18')](_0x9091f2)['json'](_0x269be2);}};}function respondWithFilteredResult(_0x1d39be,_0x2d9eb7){return function(_0x234feb){if(_0x234feb){var _0x324d23=typeof _0x2d9eb7[_0x10c0('0x1a')]===_0x10c0('0x1b')&&typeof _0x2d9eb7[_0x10c0('0x1c')]===_0x10c0('0x1b');var _0x43d3b7=_0x234feb['count'];var _0x18e1bd=_0x324d23?0x0:_0x2d9eb7[_0x10c0('0x1a')];var _0xf52ff1=_0x324d23?_0x234feb[_0x10c0('0x1d')]:_0x2d9eb7[_0x10c0('0x1a')]+_0x2d9eb7[_0x10c0('0x1c')];var _0xecaebc;if(_0xf52ff1>=_0x43d3b7){_0xf52ff1=_0x43d3b7;_0xecaebc=0xc8;}else{_0xecaebc=0xce;}_0x1d39be[_0x10c0('0x18')](_0xecaebc);return _0x1d39be['set'](_0x10c0('0x1e'),_0x18e1bd+'-'+_0xf52ff1+'/'+_0x43d3b7)[_0x10c0('0x1f')](_0x234feb);}return null;};}function patchUpdates(_0x1e11c8){return function(_0x1624f5){try{jsonpatch[_0x10c0('0x20')](_0x1624f5,_0x1e11c8,!![]);}catch(_0x27c360){return BPromise[_0x10c0('0x21')](_0x27c360);}return _0x1624f5[_0x10c0('0x22')]();};}function saveUpdates(_0x342611,_0x187ae3){return function(_0xf72eb){if(_0xf72eb){return _0xf72eb[_0x10c0('0x23')](_0x342611)['then'](function(_0x2e4af7){return _0x2e4af7;});}return null;};}function removeEntity(_0x2e35c4,_0x3d3955){return function(_0x5c5972){if(_0x5c5972){return _0x5c5972[_0x10c0('0x24')]()['then'](function(){var _0xa6aaad=_0x5c5972[_0x10c0('0x25')]({'plain':!![]});var _0x239a6f=_0x10c0('0x26');return db[_0x10c0('0x27')][_0x10c0('0x24')]({'where':{'type':_0x239a6f,'resourceId':_0xa6aaad['id']}})['then'](function(){return _0x5c5972;});})['then'](function(){_0x2e35c4['status'](0xcc)[_0x10c0('0x19')]();});}};}function handleEntityNotFound(_0x4fb560,_0x23865f){return function(_0x3900e7){if(!_0x3900e7){_0x4fb560[_0x10c0('0x28')](0x194);}return _0x3900e7;};}function handleError(_0x503692,_0x488bd6){_0x488bd6=_0x488bd6||0x1f4;return function(_0x1ddb62){logger[_0x10c0('0x29')](_0x1ddb62[_0x10c0('0x2a')]);if(_0x1ddb62['name']){delete _0x1ddb62[_0x10c0('0x2b')];}_0x503692[_0x10c0('0x18')](_0x488bd6)[_0x10c0('0x2c')](_0x1ddb62);};}exports[_0x10c0('0x2d')]=function(_0x39c187,_0x6c0e24){var _0x2de0f1={},_0x243473={},_0x2fea91={'count':0x0,'rows':[]};var _0x487e94=_[_0x10c0('0x2e')](db[_0x10c0('0x2f')][_0x10c0('0x30')],function(_0x5ad0f0){return{'name':_0x5ad0f0[_0x10c0('0x31')],'type':_0x5ad0f0['type']['key']};});_0x243473['model']=_[_0x10c0('0x2e')](_0x487e94,_0x10c0('0x2b'));_0x243473[_0x10c0('0x32')]=_[_0x10c0('0x33')](_0x39c187[_0x10c0('0x32')]);_0x243473[_0x10c0('0x34')]=_['intersection'](_0x243473[_0x10c0('0x35')],_0x243473['query']);_0x2de0f1[_0x10c0('0x36')]=_[_0x10c0('0x37')](_0x243473[_0x10c0('0x35')],qs[_0x10c0('0x38')](_0x39c187[_0x10c0('0x32')][_0x10c0('0x38')]));_0x2de0f1[_0x10c0('0x36')]=_0x2de0f1[_0x10c0('0x36')][_0x10c0('0x39')]?_0x2de0f1[_0x10c0('0x36')]:_0x243473[_0x10c0('0x35')];if(!_0x39c187[_0x10c0('0x32')][_0x10c0('0x3a')](_0x10c0('0x3b'))){_0x2de0f1['limit']=qs[_0x10c0('0x1c')](_0x39c187[_0x10c0('0x32')][_0x10c0('0x1c')]);_0x2de0f1['offset']=qs[_0x10c0('0x1a')](_0x39c187[_0x10c0('0x32')][_0x10c0('0x1a')]);}_0x2de0f1['order']=qs['sort'](_0x39c187[_0x10c0('0x32')][_0x10c0('0x3c')]);_0x2de0f1[_0x10c0('0x3d')]=qs['filters'](_[_0x10c0('0x3e')](_0x39c187[_0x10c0('0x32')],_0x243473[_0x10c0('0x34')]),_0x487e94);if(_0x39c187[_0x10c0('0x32')][_0x10c0('0x3f')]){_0x2de0f1['where']=_[_0x10c0('0x40')](_0x2de0f1[_0x10c0('0x3d')],{'$or':_[_0x10c0('0x2e')](_0x487e94,function(_0x44e4d3){if(_0x44e4d3['type']!==_0x10c0('0x41')){var _0x523fc5={};_0x523fc5[_0x44e4d3[_0x10c0('0x2b')]]={'$like':'%'+_0x39c187[_0x10c0('0x32')][_0x10c0('0x3f')]+'%'};return _0x523fc5;}})});}_0x2de0f1=_['merge']({},_0x2de0f1,_0x39c187[_0x10c0('0x42')]);var _0x50b8f3={'where':_0x2de0f1['where']};return db['Disposition'][_0x10c0('0x1d')](_0x50b8f3)[_0x10c0('0x43')](function(_0x5449c3){_0x2fea91['count']=_0x5449c3;if(_0x39c187[_0x10c0('0x32')]['includeAll']){_0x2de0f1[_0x10c0('0x44')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x2de0f1);})['then'](function(_0xf3175c){_0x2fea91[_0x10c0('0x45')]=_0xf3175c;return _0x2fea91;})['then'](respondWithFilteredResult(_0x6c0e24,_0x2de0f1))[_0x10c0('0x46')](handleError(_0x6c0e24,null));};exports['show']=function(_0x485deb,_0x12b746){var _0x22fee4={'raw':!![],'where':{'id':_0x485deb[_0x10c0('0x47')]['id']}},_0x367444={};_0x367444[_0x10c0('0x35')]=_[_0x10c0('0x33')](db[_0x10c0('0x2f')][_0x10c0('0x30')]);_0x367444[_0x10c0('0x32')]=_[_0x10c0('0x33')](_0x485deb['query']);_0x367444[_0x10c0('0x34')]=_[_0x10c0('0x37')](_0x367444['model'],_0x367444[_0x10c0('0x32')]);_0x22fee4[_0x10c0('0x36')]=_[_0x10c0('0x37')](_0x367444[_0x10c0('0x35')],qs['fields'](_0x485deb['query'][_0x10c0('0x38')]));_0x22fee4[_0x10c0('0x36')]=_0x22fee4[_0x10c0('0x36')][_0x10c0('0x39')]?_0x22fee4[_0x10c0('0x36')]:_0x367444[_0x10c0('0x35')];if(_0x485deb['query'][_0x10c0('0x48')]){_0x22fee4[_0x10c0('0x44')]=[{'all':!![]}];}_0x22fee4=_[_0x10c0('0x40')]({},_0x22fee4,_0x485deb[_0x10c0('0x42')]);return db[_0x10c0('0x2f')][_0x10c0('0x49')](_0x22fee4)[_0x10c0('0x43')](handleEntityNotFound(_0x12b746,null))['then'](respondWithResult(_0x12b746,null))[_0x10c0('0x46')](handleError(_0x12b746,null));};exports['create']=function(_0x8da84f,_0x4ff5ec){return db[_0x10c0('0x2f')][_0x10c0('0x4a')](_0x8da84f[_0x10c0('0x4b')],{})[_0x10c0('0x43')](function(_0x1eae47){var _0x45576a=_0x8da84f['user'][_0x10c0('0x25')]({'plain':!![]});if(!_0x45576a)throw new Error(_0x10c0('0x4c'));if(_0x45576a[_0x10c0('0x4d')]==='user'){var _0x544c61=_0x1eae47[_0x10c0('0x25')]({'plain':!![]});var _0x50e796='Dispositions';return db['UserProfileSection'][_0x10c0('0x49')]({'where':{'name':_0x50e796,'userProfileId':_0x45576a[_0x10c0('0x4e')]},'raw':!![]})[_0x10c0('0x43')](function(_0x34fe24){if(_0x34fe24&&_0x34fe24[_0x10c0('0x4f')]===0x0){return db[_0x10c0('0x27')][_0x10c0('0x4a')]({'name':_0x544c61[_0x10c0('0x2b')],'resourceId':_0x544c61['id'],'type':_0x34fe24[_0x10c0('0x2b')],'sectionId':_0x34fe24['id']},{})['then'](function(){return _0x1eae47;});}else{return _0x1eae47;}})[_0x10c0('0x46')](function(_0x2dd2fd){logger[_0x10c0('0x29')](_0x10c0('0x50'),_0x2dd2fd);throw _0x2dd2fd;});}return _0x1eae47;})[_0x10c0('0x43')](respondWithResult(_0x4ff5ec,0xc9))[_0x10c0('0x46')](handleError(_0x4ff5ec,null));};exports[_0x10c0('0x23')]=function(_0x27e2e6,_0x241c5f){if(_0x27e2e6['body']['id']){delete _0x27e2e6[_0x10c0('0x4b')]['id'];}return db[_0x10c0('0x2f')][_0x10c0('0x49')]({'where':{'id':_0x27e2e6[_0x10c0('0x47')]['id']}})[_0x10c0('0x43')](handleEntityNotFound(_0x241c5f,null))[_0x10c0('0x43')](saveUpdates(_0x27e2e6[_0x10c0('0x4b')],null))[_0x10c0('0x43')](respondWithResult(_0x241c5f,null))['catch'](handleError(_0x241c5f,null));};exports[_0x10c0('0x24')]=function(_0x253385,_0x1e48ea){return db[_0x10c0('0x2f')][_0x10c0('0x49')]({'where':{'id':_0x253385['params']['id']}})[_0x10c0('0x43')](handleEntityNotFound(_0x1e48ea,null))[_0x10c0('0x43')](removeEntity(_0x1e48ea,null))[_0x10c0('0x46')](handleError(_0x1e48ea,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index b22fe8d..9130529 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 _0x4c78=['SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./disposition.attributes','define','tools_dispositions','name_voice','name_chat','name','name_mail','MailAccountId','name_sms'];(function(_0x30d87a,_0xf3a07f){var _0x48f64b=function(_0x2078b7){while(--_0x2078b7){_0x30d87a['push'](_0x30d87a['shift']());}};_0x48f64b(++_0xf3a07f);}(_0x4c78,0xaf));var _0x84c7=function(_0x2aa359,_0x3e8a2d){_0x2aa359=_0x2aa359-0x0;var _0x52cb8d=_0x4c78[_0x2aa359];return _0x52cb8d;};'use strict';var _=require(_0x84c7('0x0'));var util=require(_0x84c7('0x1'));var logger=require(_0x84c7('0x2'))(_0x84c7('0x3'));var moment=require(_0x84c7('0x4'));var BPromise=require(_0x84c7('0x5'));var rp=require(_0x84c7('0x6'));var fs=require('fs');var path=require(_0x84c7('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x84c7('0x8'));module['exports']=function(_0x523d89,_0x341bd3){return _0x523d89[_0x84c7('0x9')]('Disposition',attributes,{'tableName':_0x84c7('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x84c7('0xb'),'fields':['name','ListId']},{'unique':!![],'name':_0x84c7('0xc'),'fields':[_0x84c7('0xd'),'ChatWebsiteId']},{'unique':!![],'name':_0x84c7('0xe'),'fields':[_0x84c7('0xd'),_0x84c7('0xf')]},{'unique':!![],'name':_0x84c7('0x10'),'fields':[_0x84c7('0xd'),_0x84c7('0x11')]},{'unique':!![],'name':_0x84c7('0x12'),'fields':[_0x84c7('0xd'),_0x84c7('0x13')]},{'unique':!![],'name':_0x84c7('0x14'),'fields':[_0x84c7('0xd'),_0x84c7('0x15')]},{'unique':!![],'name':_0x84c7('0x16'),'fields':[_0x84c7('0xd'),_0x84c7('0x17')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7d4b=['lodash','util','../../config/logger','moment','request-promise','path','rimraf','exports','define','name_voice','ChatWebsiteId','name_mail','name','MailAccountId','name_fax','FaxAccountId','name_openchannel','name_whatsapp'];(function(_0x3bb549,_0x55e629){var _0x2c77b5=function(_0x387981){while(--_0x387981){_0x3bb549['push'](_0x3bb549['shift']());}};_0x2c77b5(++_0x55e629);}(_0x7d4b,0xb4));var _0xb7d4=function(_0x48a858,_0x75f431){_0x48a858=_0x48a858-0x0;var _0x487f2f=_0x7d4b[_0x48a858];return _0x487f2f;};'use strict';var _=require(_0xb7d4('0x0'));var util=require(_0xb7d4('0x1'));var logger=require(_0xb7d4('0x2'))('api');var moment=require(_0xb7d4('0x3'));var BPromise=require('bluebird');var rp=require(_0xb7d4('0x4'));var fs=require('fs');var path=require(_0xb7d4('0x5'));var rimraf=require(_0xb7d4('0x6'));var config=require('../../config/environment');var attributes=require('./disposition.attributes');module[_0xb7d4('0x7')]=function(_0x38b82d,_0x24bba9){return _0x38b82d[_0xb7d4('0x8')]('Disposition',attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0xb7d4('0x9'),'fields':['name','ListId']},{'unique':!![],'name':'name_chat','fields':['name',_0xb7d4('0xa')]},{'unique':!![],'name':_0xb7d4('0xb'),'fields':[_0xb7d4('0xc'),_0xb7d4('0xd')]},{'unique':!![],'name':'name_sms','fields':[_0xb7d4('0xc'),'SmsAccountId']},{'unique':!![],'name':_0xb7d4('0xe'),'fields':['name',_0xb7d4('0xf')]},{'unique':!![],'name':_0xb7d4('0x10'),'fields':[_0xb7d4('0xc'),'OpenchannelAccountId']},{'unique':!![],'name':_0xb7d4('0x11'),'fields':[_0xb7d4('0xc'),'WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 5741883..b2f6c89 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(_0x1fe749,_0x222a91){var _0x2efe96=function(_0x401cee){while(--_0x401cee){_0x1fe749['push'](_0x1fe749['shift']());}};_0x2efe96(++_0x222a91);}(_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 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(_0x131023,_0x2055da){var _0x9d357=function(_0x734abb){while(--_0x734abb){_0x131023['push'](_0x131023['shift']());}};_0x9d357(++_0x2055da);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'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 bf456e3..5b026ab 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 _0x5417=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','/:id','create','update','delete','destroy','exports','multer','util'];(function(_0x16dae0,_0x6efca1){var _0x2eb6e9=function(_0x53b78d){while(--_0x53b78d){_0x16dae0['push'](_0x16dae0['shift']());}};_0x2eb6e9(++_0x6efca1);}(_0x5417,0x19c));var _0x7541=function(_0x4b6420,_0x126201){_0x4b6420=_0x4b6420-0x0;var _0x37076f=_0x5417[_0x4b6420];return _0x37076f;};'use strict';var multer=require(_0x7541('0x0'));var util=require(_0x7541('0x1'));var path=require(_0x7541('0x2'));var timeout=require(_0x7541('0x3'));var express=require(_0x7541('0x4'));var router=express[_0x7541('0x5')]();var fs_extra=require(_0x7541('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x7541('0x7'));var config=require(_0x7541('0x8'));var controller=require(_0x7541('0x9'));router[_0x7541('0xa')]('/',auth[_0x7541('0xb')](),controller['index']);router[_0x7541('0xa')](_0x7541('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x7541('0xb')](),controller[_0x7541('0xd')]);router['put'](_0x7541('0xc'),auth[_0x7541('0xb')](),controller[_0x7541('0xe')]);router[_0x7541('0xf')](_0x7541('0xc'),auth[_0x7541('0xb')](),controller[_0x7541('0x10')]);module[_0x7541('0x11')]=router; \ No newline at end of file +var _0xa468=['./disposition.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xa468,0x1b1));var _0x8a46=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xa468[_0x160c73];return _0xd9302;};'use strict';var multer=require(_0x8a46('0x0'));var util=require(_0x8a46('0x1'));var path=require(_0x8a46('0x2'));var timeout=require(_0x8a46('0x3'));var express=require(_0x8a46('0x4'));var router=express[_0x8a46('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8a46('0x6'));var config=require(_0x8a46('0x7'));var controller=require(_0x8a46('0x8'));router[_0x8a46('0x9')]('/',auth[_0x8a46('0xa')](),controller[_0x8a46('0xb')]);router[_0x8a46('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x8a46('0xc')]);router[_0x8a46('0xd')]('/',auth['isAuthenticated'](),controller[_0x8a46('0xe')]);router[_0x8a46('0xf')](_0x8a46('0x10'),auth[_0x8a46('0xa')](),controller[_0x8a46('0x11')]);router[_0x8a46('0x12')](_0x8a46('0x10'),auth[_0x8a46('0xa')](),controller[_0x8a46('0x13')]);module[_0x8a46('0x14')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 0fd1e16..e82a34c 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 _0x7922=['BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','4800','7200','9600','12000','2400','14400','v17,v27,v29','INTEGER','SIP','IAX','DADHI','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x2136a6,_0x35af63){var _0x55b948=function(_0x288a75){while(--_0x288a75){_0x2136a6['push'](_0x2136a6['shift']());}};_0x55b948(++_0x35af63);}(_0x7922,0x15e));var _0x2792=function(_0x22b742,_0x5ad8bc){_0x22b742=_0x22b742-0x0;var _0x34e8ff=_0x7922[_0x22b742];return _0x34e8ff;};'use strict';var Sequelize=require(_0x2792('0x0'));module['exports']={'name':{'type':Sequelize[_0x2792('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x2792('0x1')]},'ecm':{'type':Sequelize[_0x2792('0x2')]('yes','no'),'defaultValue':_0x2792('0x3')},'headerinfo':{'type':Sequelize[_0x2792('0x1')],'defaultValue':_0x2792('0x4')},'localstationid':{'type':Sequelize[_0x2792('0x1')],'unique':'localstationid'},'minrate':{'type':Sequelize[_0x2792('0x2')]('2400',_0x2792('0x5'),_0x2792('0x6'),_0x2792('0x7'),_0x2792('0x8'),'14400'),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0x2792('0x2')](_0x2792('0x9'),'4800',_0x2792('0x6'),_0x2792('0x7'),_0x2792('0x8'),_0x2792('0xa')),'defaultValue':_0x2792('0xa')},'modem':{'type':Sequelize[_0x2792('0x1')],'defaultValue':_0x2792('0xb')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x2792('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x2792('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x2792('0x2')](_0x2792('0xd'),_0x2792('0xe'),_0x2792('0xf'),'KHOMP'),'defaultValue':_0x2792('0xd')},'key':{'type':Sequelize[_0x2792('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x2792('0x10')],'defaultValue':function(){return _0x2792('0x11');}},'notificationSound':{'type':Sequelize[_0x2792('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x2792('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x2792('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2792('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2792('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2792('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2792('0xc')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x2792('0x12')],'defaultValue':![],'comment':_0x2792('0x13'),'set':function(_0x14fde5){if(!_0x14fde5)this[_0x2792('0x14')](_0x2792('0x15'),null);this['setDataValue'](_0x2792('0x16'),_0x14fde5);}}}; \ No newline at end of file +var _0xde8d=['mandatoryDisposition','sequelize','exports','STRING','yes','xCALLY\x20Motion\x20Fax','localstationid','ENUM','7200','9600','14400','2400','4800','12000','v17,v27,v29','INTEGER','DADHI','KHOMP','SIP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x4a31c3,_0x3d8ebf){var _0x59fc2f=function(_0x280209){while(--_0x280209){_0x4a31c3['push'](_0x4a31c3['shift']());}};_0x59fc2f(++_0x3d8ebf);}(_0xde8d,0x1c3));var _0xdde8=function(_0x152287,_0x16fb16){_0x152287=_0x152287-0x0;var _0x466e86=_0xde8d[_0x152287];return _0x466e86;};'use strict';var Sequelize=require(_0xdde8('0x0'));module[_0xdde8('0x1')]={'name':{'type':Sequelize[_0xdde8('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize['ENUM'](_0xdde8('0x3'),'no'),'defaultValue':_0xdde8('0x3')},'headerinfo':{'type':Sequelize[_0xdde8('0x2')],'defaultValue':_0xdde8('0x4')},'localstationid':{'type':Sequelize['STRING'],'unique':_0xdde8('0x5')},'minrate':{'type':Sequelize[_0xdde8('0x6')]('2400','4800',_0xdde8('0x7'),_0xdde8('0x8'),'12000',_0xdde8('0x9')),'defaultValue':'4800'},'maxrate':{'type':Sequelize['ENUM'](_0xdde8('0xa'),_0xdde8('0xb'),_0xdde8('0x7'),_0xdde8('0x8'),_0xdde8('0xc'),'14400'),'defaultValue':_0xdde8('0x9')},'modem':{'type':Sequelize[_0xdde8('0x2')],'defaultValue':_0xdde8('0xd')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xdde8('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xdde8('0xe')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xdde8('0x6')]('SIP','IAX',_0xdde8('0xf'),_0xdde8('0x10')),'defaultValue':_0xdde8('0x11')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xdde8('0x12')],'defaultValue':function(){return _0xdde8('0x13');}},'notificationSound':{'type':Sequelize[_0xdde8('0x14')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xdde8('0x14')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xdde8('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xdde8('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xdde8('0x14')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xdde8('0x15')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xdde8('0x16'),'set':function(_0x49b072){if(!_0x49b072)this[_0xdde8('0x17')]('mandatoryDispositionPauseId',null);this[_0xdde8('0x17')](_0xdde8('0x18'),_0x49b072);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 24cc05e..fff4d9c 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 _0x43df=['CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','Send\x20Fax\x20failed','Messages','Contact\x20not\x20found','spread','out','filename','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','defaults','redis','socket.io-emitter','register','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','debug','stringify','error','message','catch','status','end','offset','undefined','limit','count','json','apply','save','update','destroy','get','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','find','create','body','user','FaxAccounts','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','FaxAccountId','Disposition','findOne','order','pick','findAll','removeDispositions','addAnswer','getAnswers','CannedAnswer','ids','addInteraction','omit','FaxInteraction','CmContact','Contact','User','internal','Tag','Tags','color','tag','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','FaxApplication','bulkCreate','priority','stack','finally','sendStatus','getApplications','context','from-voip-provider','exten','app','system','description','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','localstationid','gateway','headerinfo','minrate','modem','t38timeout','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','addAccountApplications','VoiceExtension','tech','createdAt','updatedAt','TrunkId','ListId','findById','$gte','format','FaxMessage','List','Contacts','DESC','attachments','join','root','basename'];(function(_0x129358,_0x515546){var _0x44bb28=function(_0x40357c){while(--_0x40357c){_0x129358['push'](_0x129358['shift']());}};_0x44bb28(++_0x515546);}(_0x43df,0xcf));var _0xf43d=function(_0x45f0b3,_0x20e607){_0x45f0b3=_0x45f0b3-0x0;var _0x1ab605=_0x43df[_0x45f0b3];return _0x1ab605;};'use strict';var emlformat=require(_0xf43d('0x0'));var rimraf=require(_0xf43d('0x1'));var zipdir=require(_0xf43d('0x2'));var jsonpatch=require(_0xf43d('0x3'));var rp=require(_0xf43d('0x4'));var moment=require(_0xf43d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf43d('0x6'));var util=require(_0xf43d('0x7'));var path=require(_0xf43d('0x8'));var sox=require(_0xf43d('0x9'));var csv=require(_0xf43d('0xa'));var ejs=require(_0xf43d('0xb'));var fs=require('fs');var fs_extra=require(_0xf43d('0xc'));var _=require('lodash');var squel=require(_0xf43d('0xd'));var crypto=require(_0xf43d('0xe'));var jsforce=require(_0xf43d('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf43d('0x10'));var Papa=require('papaparse');var Redis=require(_0xf43d('0x11'));var authService=require(_0xf43d('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf43d('0x13'));var logger=require(_0xf43d('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xf43d('0x15'));var licenseUtil=require(_0xf43d('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xf43d('0x17')](config[_0xf43d('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xf43d('0x19'))(new Redis(config['redis']));require('./faxAccount.socket')[_0xf43d('0x1a')](socket);var jayson=require(_0xf43d('0x1b'));var client=jayson[_0xf43d('0x1c')][_0xf43d('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0xf43d('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x1058d2,_0x5682b3,_0x3fcbdf,_0x29cf92){return new BPromise(function(_0x3c757f,_0x15932a){var _0x2d9584=_0x29cf92||client;return _0x2d9584[_0xf43d('0x1e')](_0x1058d2,_0x3fcbdf)[_0xf43d('0x1f')](function(_0x5d91bd){logger[_0xf43d('0x20')](_0xf43d('0x21'),_0x5682b3,'request\x20sent');logger[_0xf43d('0x22')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x5682b3,'request\x20sent',JSON[_0xf43d('0x23')](_0x5d91bd));if(_0x5d91bd[_0xf43d('0x24')]){if(_0x5d91bd[_0xf43d('0x24')]['code']===0x1f4){logger[_0xf43d('0x24')]('FaxAccount,\x20%s,\x20%s',_0x5682b3,_0x5d91bd[_0xf43d('0x24')][_0xf43d('0x25')]);return _0x15932a(_0x5d91bd['error']['message']);}logger[_0xf43d('0x24')]('FaxAccount,\x20%s,\x20%s',_0x5682b3,_0x5d91bd['error'][_0xf43d('0x25')]);return _0x3c757f(_0x5d91bd[_0xf43d('0x24')][_0xf43d('0x25')]);}else{logger[_0xf43d('0x20')]('FaxAccount,\x20%s,\x20%s',_0x5682b3,'request\x20sent');_0x3c757f(_0x5d91bd['result'][_0xf43d('0x25')]);}})[_0xf43d('0x26')](function(_0x4e8cae){logger[_0xf43d('0x24')](_0xf43d('0x21'),_0x5682b3,_0x4e8cae);_0x15932a(_0x4e8cae);});});}function respondWithStatusCode(_0x456832,_0x5532ad){_0x5532ad=_0x5532ad||0xcc;return function(_0x4137a8){if(_0x4137a8){return _0x456832['sendStatus'](_0x5532ad);}return _0x456832[_0xf43d('0x27')](_0x5532ad)[_0xf43d('0x28')]();};}function respondWithResult(_0x31d591,_0x2f2841){_0x2f2841=_0x2f2841||0xc8;return function(_0x4964dd){if(_0x4964dd){return _0x31d591[_0xf43d('0x27')](_0x2f2841)['json'](_0x4964dd);}};}function respondWithFilteredResult(_0x24a712,_0x3cef3e){return function(_0xff40fb){if(_0xff40fb){var _0x58d9c0=typeof _0x3cef3e[_0xf43d('0x29')]===_0xf43d('0x2a')&&typeof _0x3cef3e[_0xf43d('0x2b')]===_0xf43d('0x2a');var _0x196820=_0xff40fb['count'];var _0x4a23d5=_0x58d9c0?0x0:_0x3cef3e['offset'];var _0x53d64f=_0x58d9c0?_0xff40fb[_0xf43d('0x2c')]:_0x3cef3e['offset']+_0x3cef3e[_0xf43d('0x2b')];var _0x581e68;if(_0x53d64f>=_0x196820){_0x53d64f=_0x196820;_0x581e68=0xc8;}else{_0x581e68=0xce;}_0x24a712[_0xf43d('0x27')](_0x581e68);return _0x24a712['set']('Content-Range',_0x4a23d5+'-'+_0x53d64f+'/'+_0x196820)[_0xf43d('0x2d')](_0xff40fb);}return null;};}function patchUpdates(_0x5be4d0){return function(_0x30cc8c){try{jsonpatch[_0xf43d('0x2e')](_0x30cc8c,_0x5be4d0,!![]);}catch(_0x57a6e1){return BPromise['reject'](_0x57a6e1);}return _0x30cc8c[_0xf43d('0x2f')]();};}function saveUpdates(_0x1873e0,_0x3210e1){return function(_0x4d4c24){if(_0x4d4c24){return _0x4d4c24[_0xf43d('0x30')](_0x1873e0)['then'](function(_0x378c5c){return _0x378c5c;});}return null;};}function removeEntity(_0x2fb617,_0x56aaab){return function(_0x44eee8){if(_0x44eee8){return _0x44eee8[_0xf43d('0x31')]()[_0xf43d('0x1f')](function(){var _0x5ce16c=_0x44eee8[_0xf43d('0x32')]({'plain':!![]});var _0x4fac09='FaxAccounts';return db[_0xf43d('0x33')][_0xf43d('0x31')]({'where':{'type':_0x4fac09,'resourceId':_0x5ce16c['id']}})[_0xf43d('0x1f')](function(){return _0x44eee8;});})[_0xf43d('0x1f')](function(){_0x2fb617['status'](0xcc)[_0xf43d('0x28')]();});}};}function handleEntityNotFound(_0x2633b9,_0x389774){return function(_0x52dd11){if(!_0x52dd11){_0x2633b9['sendStatus'](0x194);}return _0x52dd11;};}function handleError(_0x190792,_0x440001){_0x440001=_0x440001||0x1f4;return function(_0x5dc053){logger['error'](_0x5dc053['stack']);if(_0x5dc053[_0xf43d('0x34')]){delete _0x5dc053[_0xf43d('0x34')];}_0x190792[_0xf43d('0x27')](_0x440001)[_0xf43d('0x35')](_0x5dc053);};}exports[_0xf43d('0x36')]=function(_0x57e026,_0x4dfdd8){var _0x4f5c29={'include':[{'model':db[_0xf43d('0x37')],'as':_0xf43d('0x38')}]},_0x56af3b={},_0x3c1752={'count':0x0,'rows':[]};var _0x7d54d7=_[_0xf43d('0x39')](db[_0xf43d('0x3a')][_0xf43d('0x3b')],function(_0x5dde1d){return{'name':_0x5dde1d[_0xf43d('0x3c')],'type':_0x5dde1d[_0xf43d('0x3d')][_0xf43d('0x3e')]};});_0x56af3b['model']=_[_0xf43d('0x39')](_0x7d54d7,'name');_0x56af3b[_0xf43d('0x3f')]=_[_0xf43d('0x40')](_0x57e026[_0xf43d('0x3f')]);_0x56af3b[_0xf43d('0x41')]=_[_0xf43d('0x42')](_0x56af3b[_0xf43d('0x43')],_0x56af3b[_0xf43d('0x3f')]);_0x4f5c29['attributes']=_[_0xf43d('0x42')](_0x56af3b['model'],qs['fields'](_0x57e026[_0xf43d('0x3f')][_0xf43d('0x44')]));_0x4f5c29[_0xf43d('0x45')]=_0x4f5c29[_0xf43d('0x45')][_0xf43d('0x46')]?_0x4f5c29[_0xf43d('0x45')]:_0x56af3b[_0xf43d('0x43')];if(!_0x57e026[_0xf43d('0x3f')][_0xf43d('0x47')](_0xf43d('0x48'))){_0x4f5c29[_0xf43d('0x2b')]=qs[_0xf43d('0x2b')](_0x57e026['query'][_0xf43d('0x2b')]);_0x4f5c29[_0xf43d('0x29')]=qs['offset'](_0x57e026[_0xf43d('0x3f')]['offset']);}_0x4f5c29['order']=qs[_0xf43d('0x49')](_0x57e026[_0xf43d('0x3f')][_0xf43d('0x49')]);_0x4f5c29[_0xf43d('0x4a')]=qs['filters'](_['pick'](_0x57e026[_0xf43d('0x3f')],_0x56af3b['filters']),_0x7d54d7);if(_0x57e026['query'][_0xf43d('0x4b')]){_0x4f5c29[_0xf43d('0x4a')]=_[_0xf43d('0x4c')](_0x4f5c29[_0xf43d('0x4a')],{'$or':_[_0xf43d('0x39')](_0x7d54d7,function(_0x597319){if(_0x597319[_0xf43d('0x3d')]!==_0xf43d('0x4d')){var _0x136a52={};_0x136a52[_0x597319[_0xf43d('0x34')]]={'$like':'%'+_0x57e026['query'][_0xf43d('0x4b')]+'%'};return _0x136a52;}})});}_0x4f5c29=_[_0xf43d('0x4c')]({},_0x4f5c29,_0x57e026[_0xf43d('0x4e')]);var _0x2c8b49={'where':_0x4f5c29[_0xf43d('0x4a')]};return db[_0xf43d('0x3a')][_0xf43d('0x2c')](_0x2c8b49)[_0xf43d('0x1f')](function(_0x5309a7){_0x3c1752[_0xf43d('0x2c')]=_0x5309a7;if(_0x57e026[_0xf43d('0x3f')][_0xf43d('0x4f')]){_0x4f5c29[_0xf43d('0x50')]=[{'all':!![]}];}return db[_0xf43d('0x3a')]['findAll'](_0x4f5c29);})['then'](function(_0x3d524f){_0x3c1752[_0xf43d('0x51')]=_0x3d524f;return _0x3c1752;})[_0xf43d('0x1f')](respondWithFilteredResult(_0x4dfdd8,_0x4f5c29))[_0xf43d('0x26')](handleError(_0x4dfdd8,null));};exports[_0xf43d('0x52')]=function(_0xd58d69,_0x4650be){var _0x121eb4={'raw':![],'where':{'id':_0xd58d69[_0xf43d('0x53')]['id']},'include':[{'model':db['Pause'],'as':_0xf43d('0x38')}]},_0x5b34f0={};_0x5b34f0[_0xf43d('0x43')]=_[_0xf43d('0x40')](db[_0xf43d('0x3a')][_0xf43d('0x3b')]);_0x5b34f0[_0xf43d('0x3f')]=_[_0xf43d('0x40')](_0xd58d69[_0xf43d('0x3f')]);_0x5b34f0['filters']=_['intersection'](_0x5b34f0[_0xf43d('0x43')],_0x5b34f0[_0xf43d('0x3f')]);_0x121eb4[_0xf43d('0x45')]=_[_0xf43d('0x42')](_0x5b34f0['model'],qs[_0xf43d('0x44')](_0xd58d69[_0xf43d('0x3f')][_0xf43d('0x44')]));_0x121eb4[_0xf43d('0x45')]=_0x121eb4[_0xf43d('0x45')]['length']?_0x121eb4[_0xf43d('0x45')]:_0x5b34f0[_0xf43d('0x43')];if(_0xd58d69[_0xf43d('0x3f')][_0xf43d('0x4f')]){_0x121eb4[_0xf43d('0x50')]=[{'all':!![]}];}_0x121eb4=_['merge']({},_0x121eb4,_0xd58d69[_0xf43d('0x4e')]);return db[_0xf43d('0x3a')][_0xf43d('0x54')](_0x121eb4)[_0xf43d('0x1f')](handleEntityNotFound(_0x4650be,null))[_0xf43d('0x1f')](respondWithResult(_0x4650be,null))['catch'](handleError(_0x4650be,null));};exports[_0xf43d('0x55')]=function(_0xc3917c,_0xd24b71){return db[_0xf43d('0x3a')][_0xf43d('0x55')](_0xc3917c[_0xf43d('0x56')],{})[_0xf43d('0x1f')](function(_0x273b7a){var _0x54822f=_0xc3917c[_0xf43d('0x57')][_0xf43d('0x32')]({'plain':!![]});if(!_0x54822f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x54822f['role']==='user'){var _0x94938e=_0x273b7a[_0xf43d('0x32')]({'plain':!![]});var _0x5e276c=_0xf43d('0x58');return db[_0xf43d('0x59')]['find']({'where':{'name':_0x5e276c,'userProfileId':_0x54822f[_0xf43d('0x5a')]},'raw':!![]})[_0xf43d('0x1f')](function(_0x4e53a9){if(_0x4e53a9&&_0x4e53a9[_0xf43d('0x5b')]===0x0){return db[_0xf43d('0x33')][_0xf43d('0x55')]({'name':_0x94938e['name'],'resourceId':_0x94938e['id'],'type':_0x4e53a9[_0xf43d('0x34')],'sectionId':_0x4e53a9['id']},{})['then'](function(){return _0x273b7a;});}else{return _0x273b7a;}})[_0xf43d('0x26')](function(_0x231b20){logger[_0xf43d('0x24')](_0xf43d('0x5c'),_0x231b20);throw _0x231b20;});}return _0x273b7a;})['then'](respondWithResult(_0xd24b71,0xc9))['catch'](handleError(_0xd24b71,null));};exports[_0xf43d('0x30')]=function(_0x489b52,_0x4f1463){if(_0x489b52[_0xf43d('0x56')]['id']){delete _0x489b52[_0xf43d('0x56')]['id'];}return db[_0xf43d('0x3a')][_0xf43d('0x54')]({'where':{'id':_0x489b52[_0xf43d('0x53')]['id']},'include':[{'model':db['Pause'],'as':_0xf43d('0x38')}]})['then'](handleEntityNotFound(_0x4f1463,null))[_0xf43d('0x1f')](saveUpdates(_0x489b52[_0xf43d('0x56')],null))[_0xf43d('0x1f')](respondWithResult(_0x4f1463,null))['catch'](handleError(_0x4f1463,null));};exports[_0xf43d('0x31')]=function(_0x2e3076,_0x4b25d){return db[_0xf43d('0x3a')][_0xf43d('0x54')]({'where':{'id':_0x2e3076['params']['id']}})[_0xf43d('0x1f')](handleEntityNotFound(_0x4b25d,null))[_0xf43d('0x1f')](removeEntity(_0x4b25d,null))[_0xf43d('0x26')](handleError(_0x4b25d,null));};exports['describe']=function(_0xe6c4a6,_0x2b21dc){return db[_0xf43d('0x3a')][_0xf43d('0x5d')]()[_0xf43d('0x1f')](respondWithResult(_0x2b21dc,null))['catch'](handleError(_0x2b21dc,null));};exports[_0xf43d('0x5e')]=function(_0x288fee,_0x57701d,_0x35dcac){if(_0x288fee[_0xf43d('0x56')]['id']){delete _0x288fee[_0xf43d('0x56')]['id'];}return db['FaxAccount'][_0xf43d('0x54')]({'where':{'id':_0x288fee[_0xf43d('0x53')]['id']}})[_0xf43d('0x1f')](handleEntityNotFound(_0x57701d,null))[_0xf43d('0x1f')](function(_0x11ada0){if(_0x11ada0){_0x288fee['body'][_0xf43d('0x5f')]=_0x11ada0['id'];return db[_0xf43d('0x60')][_0xf43d('0x55')](_0x288fee['body']);}})[_0xf43d('0x1f')](respondWithResult(_0x57701d,null))['catch'](handleError(_0x57701d,null));};exports['getDispositions']=function(_0x4e251c,_0x27169a,_0x26b76c){var _0x45e353={'raw':![],'where':{}};var _0x522fa1={};var _0xaab5c={'count':0x0,'rows':[]};return db[_0xf43d('0x3a')][_0xf43d('0x61')]({'where':{'id':_0x4e251c['params']['id']}})['then'](handleEntityNotFound(_0x27169a,null))[_0xf43d('0x1f')](function(_0x3cbb8b){if(_0x3cbb8b){_0x522fa1['model']=_['keys'](db[_0xf43d('0x60')][_0xf43d('0x3b')]);_0x522fa1['query']=_[_0xf43d('0x40')](_0x4e251c[_0xf43d('0x3f')]);_0x522fa1[_0xf43d('0x41')]=_[_0xf43d('0x42')](_0x522fa1['model'],_0x522fa1[_0xf43d('0x3f')]);_0x45e353[_0xf43d('0x45')]=_[_0xf43d('0x42')](_0x522fa1['model'],qs['fields'](_0x4e251c['query'][_0xf43d('0x44')]));_0x45e353[_0xf43d('0x45')]=_0x45e353[_0xf43d('0x45')]['length']?_0x45e353[_0xf43d('0x45')]:_0x522fa1[_0xf43d('0x43')];if(!_0x4e251c[_0xf43d('0x3f')][_0xf43d('0x47')]('nolimit')){_0x45e353[_0xf43d('0x2b')]=qs['limit'](_0x4e251c[_0xf43d('0x3f')]['limit']);_0x45e353['offset']=qs['offset'](_0x4e251c[_0xf43d('0x3f')]['offset']);}_0x45e353[_0xf43d('0x62')]=qs[_0xf43d('0x49')](_0x4e251c[_0xf43d('0x3f')][_0xf43d('0x49')]);_0x45e353[_0xf43d('0x4a')]=qs['filters'](_[_0xf43d('0x63')](_0x4e251c[_0xf43d('0x3f')],_0x522fa1['filters']));_0x45e353['where'][_0xf43d('0x5f')]=_0x3cbb8b['id'];if(_0x4e251c[_0xf43d('0x3f')]['filter']){_0x45e353[_0xf43d('0x4a')]=_['merge'](_0x45e353[_0xf43d('0x4a')],{'$or':_['map'](_0x45e353[_0xf43d('0x45')],function(_0x1b7fff){var _0x31ebdf={};_0x31ebdf[_0x1b7fff]={'$like':'%'+_0x4e251c[_0xf43d('0x3f')][_0xf43d('0x4b')]+'%'};return _0x31ebdf;})});}_0x45e353=_['merge']({},_0x45e353,_0x4e251c[_0xf43d('0x4e')]);return db['Disposition'][_0xf43d('0x2c')]({'where':_0x45e353[_0xf43d('0x4a')]})['then'](function(_0x538e04){_0xaab5c[_0xf43d('0x2c')]=_0x538e04;if(_0x4e251c[_0xf43d('0x3f')][_0xf43d('0x4f')]){_0x45e353[_0xf43d('0x50')]=[{'all':!![]}];}return db[_0xf43d('0x60')][_0xf43d('0x64')](_0x45e353);})['then'](function(_0x302e8c){_0xaab5c['rows']=_0x302e8c;return _0xaab5c;});}})['then'](respondWithFilteredResult(_0x27169a,_0x45e353))[_0xf43d('0x26')](handleError(_0x27169a,null));};exports[_0xf43d('0x65')]=function(_0x2b4aa7,_0x2c7a3a,_0x12d4a4){return db[_0xf43d('0x3a')][_0xf43d('0x54')]({'where':{'id':_0x2b4aa7[_0xf43d('0x53')]['id']}})[_0xf43d('0x1f')](handleEntityNotFound(_0x2c7a3a,null))[_0xf43d('0x1f')](function(_0x4a7b2d){if(_0x4a7b2d){return _0x4a7b2d[_0xf43d('0x65')](_0x2b4aa7['query']['ids']);}})[_0xf43d('0x1f')](respondWithStatusCode(_0x2c7a3a,null))[_0xf43d('0x26')](handleError(_0x2c7a3a,null));};exports[_0xf43d('0x66')]=function(_0x366408,_0x925366,_0x6f3bb0){if(_0x366408['body']['id']){delete _0x366408[_0xf43d('0x56')]['id'];}return db[_0xf43d('0x3a')][_0xf43d('0x54')]({'where':{'id':_0x366408[_0xf43d('0x53')]['id']}})[_0xf43d('0x1f')](handleEntityNotFound(_0x925366,null))[_0xf43d('0x1f')](function(_0x4283ed){if(_0x4283ed){_0x366408[_0xf43d('0x56')][_0xf43d('0x5f')]=_0x4283ed['id'];return db['CannedAnswer'][_0xf43d('0x55')](_0x366408[_0xf43d('0x56')]);}})[_0xf43d('0x1f')](respondWithResult(_0x925366,null))[_0xf43d('0x26')](handleError(_0x925366,null));};exports[_0xf43d('0x67')]=function(_0x57dbef,_0x1e5c23,_0xfc2bd0){var _0x5f1cb8={'raw':![],'where':{}};var _0x5398e6={};var _0x12f5a4={'count':0x0,'rows':[]};return db['FaxAccount'][_0xf43d('0x61')]({'where':{'id':_0x57dbef['params']['id']}})[_0xf43d('0x1f')](handleEntityNotFound(_0x1e5c23,null))[_0xf43d('0x1f')](function(_0x3da213){if(_0x3da213){_0x5398e6[_0xf43d('0x43')]=_['keys'](db[_0xf43d('0x68')][_0xf43d('0x3b')]);_0x5398e6['query']=_[_0xf43d('0x40')](_0x57dbef[_0xf43d('0x3f')]);_0x5398e6[_0xf43d('0x41')]=_[_0xf43d('0x42')](_0x5398e6[_0xf43d('0x43')],_0x5398e6[_0xf43d('0x3f')]);_0x5f1cb8[_0xf43d('0x45')]=_[_0xf43d('0x42')](_0x5398e6[_0xf43d('0x43')],qs[_0xf43d('0x44')](_0x57dbef[_0xf43d('0x3f')][_0xf43d('0x44')]));_0x5f1cb8['attributes']=_0x5f1cb8[_0xf43d('0x45')][_0xf43d('0x46')]?_0x5f1cb8['attributes']:_0x5398e6['model'];if(!_0x57dbef[_0xf43d('0x3f')][_0xf43d('0x47')](_0xf43d('0x48'))){_0x5f1cb8['limit']=qs[_0xf43d('0x2b')](_0x57dbef['query']['limit']);_0x5f1cb8[_0xf43d('0x29')]=qs['offset'](_0x57dbef[_0xf43d('0x3f')][_0xf43d('0x29')]);}_0x5f1cb8[_0xf43d('0x62')]=qs[_0xf43d('0x49')](_0x57dbef[_0xf43d('0x3f')][_0xf43d('0x49')]);_0x5f1cb8[_0xf43d('0x4a')]=qs[_0xf43d('0x41')](_[_0xf43d('0x63')](_0x57dbef['query'],_0x5398e6[_0xf43d('0x41')]));_0x5f1cb8['where']['FaxAccountId']=_0x3da213['id'];if(_0x57dbef[_0xf43d('0x3f')][_0xf43d('0x4b')]){_0x5f1cb8[_0xf43d('0x4a')]=_['merge'](_0x5f1cb8[_0xf43d('0x4a')],{'$or':_[_0xf43d('0x39')](_0x5f1cb8[_0xf43d('0x45')],function(_0x4ff9af){var _0x253a78={};_0x253a78[_0x4ff9af]={'$like':'%'+_0x57dbef[_0xf43d('0x3f')][_0xf43d('0x4b')]+'%'};return _0x253a78;})});}_0x5f1cb8=_['merge']({},_0x5f1cb8,_0x57dbef['options']);return db[_0xf43d('0x68')]['count']({'where':_0x5f1cb8['where']})['then'](function(_0x3c5740){_0x12f5a4['count']=_0x3c5740;if(_0x57dbef[_0xf43d('0x3f')][_0xf43d('0x4f')]){_0x5f1cb8[_0xf43d('0x50')]=[{'all':!![]}];}return db[_0xf43d('0x68')][_0xf43d('0x64')](_0x5f1cb8);})[_0xf43d('0x1f')](function(_0xad0f7c){_0x12f5a4[_0xf43d('0x51')]=_0xad0f7c;return _0x12f5a4;});}})[_0xf43d('0x1f')](respondWithFilteredResult(_0x1e5c23,_0x5f1cb8))[_0xf43d('0x26')](handleError(_0x1e5c23,null));};exports['removeAnswers']=function(_0xb9ce78,_0x1e0fa6,_0x201127){return db['FaxAccount'][_0xf43d('0x54')]({'where':{'id':_0xb9ce78[_0xf43d('0x53')]['id']}})['then'](handleEntityNotFound(_0x1e0fa6,null))[_0xf43d('0x1f')](function(_0x3237e7){if(_0x3237e7){return _0x3237e7['removeAnswers'](_0xb9ce78[_0xf43d('0x3f')][_0xf43d('0x69')]);}})[_0xf43d('0x1f')](respondWithStatusCode(_0x1e0fa6,null))[_0xf43d('0x26')](handleError(_0x1e0fa6,null));};exports['addInteraction']=function(_0x104a5d,_0x292535,_0x205bf3){return db['FaxInteraction']['find']({'where':{'id':_0x104a5d[_0xf43d('0x53')]['id']}})[_0xf43d('0x1f')](handleEntityNotFound(_0x292535,null))['then'](function(_0x435bbc){if(_0x435bbc){return _0x435bbc[_0xf43d('0x6a')](_0x104a5d[_0xf43d('0x56')]['ids'],_[_0xf43d('0x6b')](_0x104a5d[_0xf43d('0x56')],['ids','id'])||{});}})['then'](respondWithResult(_0x292535,null))['catch'](handleError(_0x292535,null));};exports['getInteractions']=function(_0x1902a0,_0x386aef,_0x21f1a4){var _0x1304f7={'raw':![],'where':{}};var _0x382924={};var _0x1122c4={'count':0x0,'rows':[]};return db['FaxAccount'][_0xf43d('0x61')]({'where':{'id':_0x1902a0[_0xf43d('0x53')]['id']}})[_0xf43d('0x1f')](handleEntityNotFound(_0x386aef,null))[_0xf43d('0x1f')](function(_0x3ecb31){if(_0x3ecb31){_0x382924[_0xf43d('0x43')]=_[_0xf43d('0x40')](db[_0xf43d('0x6c')]['rawAttributes']);_0x382924['query']=_['keys'](_0x1902a0[_0xf43d('0x3f')]);_0x382924['filters']=_[_0xf43d('0x42')](_0x382924['model'],_0x382924[_0xf43d('0x3f')]);_0x1304f7[_0xf43d('0x45')]=_[_0xf43d('0x42')](_0x382924[_0xf43d('0x43')],qs[_0xf43d('0x44')](_0x1902a0[_0xf43d('0x3f')]['fields']));_0x1304f7[_0xf43d('0x45')]=_0x1304f7[_0xf43d('0x45')][_0xf43d('0x46')]?_0x1304f7[_0xf43d('0x45')]:_0x382924[_0xf43d('0x43')];if(!_0x1902a0[_0xf43d('0x3f')][_0xf43d('0x47')](_0xf43d('0x48'))){_0x1304f7[_0xf43d('0x2b')]=qs[_0xf43d('0x2b')](_0x1902a0[_0xf43d('0x3f')][_0xf43d('0x2b')]);_0x1304f7[_0xf43d('0x29')]=qs[_0xf43d('0x29')](_0x1902a0[_0xf43d('0x3f')][_0xf43d('0x29')]);}_0x1304f7[_0xf43d('0x62')]=qs[_0xf43d('0x49')](_0x1902a0[_0xf43d('0x3f')][_0xf43d('0x49')]);_0x1304f7[_0xf43d('0x4a')]=qs['filters'](_[_0xf43d('0x63')](_0x1902a0[_0xf43d('0x3f')],_0x382924[_0xf43d('0x41')]));_0x1304f7[_0xf43d('0x4a')][_0xf43d('0x5f')]=_0x3ecb31['id'];if(_0x1902a0[_0xf43d('0x3f')][_0xf43d('0x4b')]){_0x1304f7[_0xf43d('0x4a')]=_[_0xf43d('0x4c')](_0x1304f7[_0xf43d('0x4a')],{'$or':_[_0xf43d('0x39')](_0x1304f7[_0xf43d('0x45')],function(_0x8f4350){var _0x2d168a={};_0x2d168a[_0x8f4350]={'$like':'%'+_0x1902a0[_0xf43d('0x3f')][_0xf43d('0x4b')]+'%'};return _0x2d168a;})});}_0x1304f7=_[_0xf43d('0x4c')]({},_0x1304f7,_0x1902a0[_0xf43d('0x4e')]);return db[_0xf43d('0x6c')][_0xf43d('0x2c')]({'where':_0x1304f7[_0xf43d('0x4a')]})[_0xf43d('0x1f')](function(_0x4603fd){_0x1122c4[_0xf43d('0x2c')]=_0x4603fd;if(_0x1902a0[_0xf43d('0x3f')][_0xf43d('0x4f')]){_0x1304f7[_0xf43d('0x50')]=[{'model':db[_0xf43d('0x6d')],'as':_0xf43d('0x6e'),'required':![]},{'model':db[_0xf43d('0x6f')],'as':'Owner','attributes':['name','fullname',_0xf43d('0x70')],'required':![]},{'model':db[_0xf43d('0x71')],'as':_0xf43d('0x72'),'attributes':['id',_0xf43d('0x34'),_0xf43d('0x73')],'where':_0x1902a0[_0xf43d('0x3f')][_0xf43d('0x74')]?{'id':_0x1902a0[_0xf43d('0x3f')][_0xf43d('0x74')]}:undefined,'required':_0x1902a0['query'][_0xf43d('0x74')]?!![]:![]}];}return db[_0xf43d('0x6c')]['findAll'](_0x1304f7);})['then'](function(_0x1389a4){_0x1122c4[_0xf43d('0x51')]=_0x1389a4;return _0x1122c4;});}})['then'](respondWithFilteredResult(_0x386aef,_0x1304f7))['catch'](handleError(_0x386aef,null));};exports[_0xf43d('0x75')]=function(_0x39bb5f,_0x1fbd84){var _0x2c0387=_0x39bb5f[_0xf43d('0x53')]['id'];var _0x252b45=_0x39bb5f[_0xf43d('0x56')];var _0x54ef90=0xc8;var _0x1b7888=null;return db['sequelize'][_0xf43d('0x76')]({'isolationLevel':db[_0xf43d('0x77')][_0xf43d('0x78')][_0xf43d('0x79')]['READ_COMMITTED']},function(_0x534d40){return db[_0xf43d('0x3a')][_0xf43d('0x61')]({'where':{'id':_0x2c0387},'transaction':_0x534d40})[_0xf43d('0x1f')](function(_0x16a76b){if(_0x16a76b){return db[_0xf43d('0x7a')][_0xf43d('0x31')]({'where':{'FaxAccountId':_0x2c0387},'transaction':_0x534d40})['then'](function(){var _0x4f2e8c=_['map'](_0x252b45,function(_0x566831){_0x566831[_0xf43d('0x5f')]=_0x2c0387;return _0x566831;});return db[_0xf43d('0x7a')][_0xf43d('0x7b')](_0x4f2e8c,{'transaction':_0x534d40});});}else{_0x54ef90=0x194;_0x1b7888=[];}});})[_0xf43d('0x1f')](function(){if(_0x54ef90!==0x194){return db[_0xf43d('0x7a')]['findAndCountAll']({'where':{'FaxAccountId':_0x2c0387},'order':_0xf43d('0x7c')})[_0xf43d('0x1f')](function(_0x2ca6f7){_0x1b7888=_0x2ca6f7;});}})[_0xf43d('0x26')](function(_0x2fcbdb){_0x54ef90=0x1f4;logger[_0xf43d('0x24')](_0x2fcbdb[_0xf43d('0x7d')]);if(_0x2fcbdb['name']){delete _0x2fcbdb[_0xf43d('0x34')];}_0x1b7888=_0x2fcbdb;})[_0xf43d('0x7e')](function(){if(_0x1b7888===null){_0x1fbd84[_0xf43d('0x7f')](_0x54ef90);}else{if(_0x54ef90===0x1f4){_0x1fbd84[_0xf43d('0x27')](_0x54ef90)[_0xf43d('0x35')](_0x1b7888);}else{_0x1fbd84[_0xf43d('0x27')](_0x54ef90)['json'](_0x1b7888);}}});};exports[_0xf43d('0x80')]=function(_0x35ee82,_0x497188,_0x1a8af4){var _0x561d74={};var _0x31eb7={};var _0x35d7ef;var _0x1803d9;return db[_0xf43d('0x3a')]['findOne']({'where':{'id':_0x35ee82[_0xf43d('0x53')]['id']}})[_0xf43d('0x1f')](handleEntityNotFound(_0x497188,null))['then'](function(_0x4ec089){if(_0x4ec089){_0x35d7ef=_0x4ec089;_0x31eb7[_0xf43d('0x43')]=_[_0xf43d('0x40')](db[_0xf43d('0x7a')]['rawAttributes']);_0x31eb7[_0xf43d('0x3f')]=_['keys'](_0x35ee82[_0xf43d('0x3f')]);_0x31eb7[_0xf43d('0x41')]=_[_0xf43d('0x42')](_0x31eb7[_0xf43d('0x43')],_0x31eb7[_0xf43d('0x3f')]);_0x561d74[_0xf43d('0x45')]=_[_0xf43d('0x42')](_0x31eb7[_0xf43d('0x43')],qs[_0xf43d('0x44')](_0x35ee82[_0xf43d('0x3f')]['fields']));_0x561d74[_0xf43d('0x45')]=_0x561d74['attributes'][_0xf43d('0x46')]?_0x561d74['attributes']:_0x31eb7['model'];_0x561d74[_0xf43d('0x62')]=qs[_0xf43d('0x49')](_0x35ee82[_0xf43d('0x3f')][_0xf43d('0x49')]);_0x561d74[_0xf43d('0x4a')]=qs['filters'](_[_0xf43d('0x63')](_0x35ee82[_0xf43d('0x3f')],_0x31eb7[_0xf43d('0x41')]));if(_0x35ee82['query']['filter']){_0x561d74[_0xf43d('0x4a')]=_[_0xf43d('0x4c')](_0x561d74[_0xf43d('0x4a')],{'$or':_[_0xf43d('0x39')](_0x561d74[_0xf43d('0x45')],function(_0x328444){var _0x2528ea={};_0x2528ea[_0x328444]={'$like':'%'+_0x35ee82[_0xf43d('0x3f')]['filter']+'%'};return _0x2528ea;})});}_0x561d74=_[_0xf43d('0x4c')]({},_0x561d74,_0x35ee82[_0xf43d('0x4e')]);return _0x35d7ef[_0xf43d('0x80')](_0x561d74);}})[_0xf43d('0x1f')](function(_0x2e75c2){if(_0x2e75c2){_0x1803d9=_0x2e75c2[_0xf43d('0x46')];if(!_0x35ee82[_0xf43d('0x3f')]['hasOwnProperty'](_0xf43d('0x48'))){_0x561d74[_0xf43d('0x2b')]=qs[_0xf43d('0x2b')](_0x35ee82[_0xf43d('0x3f')][_0xf43d('0x2b')]);_0x561d74['offset']=qs[_0xf43d('0x29')](_0x35ee82[_0xf43d('0x3f')][_0xf43d('0x29')]);}return _0x35d7ef[_0xf43d('0x80')](_0x561d74);}})['then'](function(_0x5e9ecb){if(_0x5e9ecb){return _0x5e9ecb?{'count':_0x1803d9,'rows':_0x5e9ecb}:null;}})[_0xf43d('0x1f')](respondWithResult(_0x497188,null))[_0xf43d('0x26')](handleError(_0x497188,null));};function Extension(_0x2ba5a2,_0x20280b,_0x5ba053,_0x21476c){this[_0xf43d('0x81')]=_0xf43d('0x82');this[_0xf43d('0x83')]=_0x2ba5a2['localstationid'];this[_0xf43d('0x84')]=_0x21476c;this[_0xf43d('0x3d')]=_0xf43d('0x85');this[_0xf43d('0x86')]=_0xf43d('0x87');this[_0xf43d('0x5f')]=_0x2ba5a2['id'];this[_0xf43d('0x7c')]=_0x20280b;this[_0xf43d('0x88')]=_0x5ba053;}function createExtensionsReciveFax(_0x57d652){var _0x22f7ba=0x1;var _0x5ee30b=[];_0x5ee30b[_0xf43d('0x89')](new Extension(_0x57d652,_0x22f7ba,'',_0xf43d('0x8a')));_0x22f7ba+=0x1;_0x5ee30b[_0xf43d('0x89')](new Extension(_0x57d652,_0x22f7ba,_0xf43d('0x8b'),_0xf43d('0x8c')));_0x22f7ba+=0x1;for(var _0x41103e in _0x57d652){if(_0x57d652[_0xf43d('0x47')](_0x41103e)&&(_0x41103e==='ecm'||_0x41103e===_0xf43d('0x8d')||_0x41103e===_0xf43d('0x8e')||_0x41103e==='faxdetect'||_0x41103e===_0xf43d('0x8f')||_0x41103e==='maxrate'||_0x41103e===_0xf43d('0x90')||_0x41103e===_0xf43d('0x91')||_0x41103e===_0xf43d('0x92'))){_0x5ee30b[_0xf43d('0x89')](new Extension(_0x57d652,_0x22f7ba,'FAXOPT('+_0x41103e+')='+_0x57d652[_0x41103e],_0xf43d('0x8c')));_0x22f7ba+=0x1;}}_0x5ee30b[_0xf43d('0x89')](new Extension(_0x57d652,_0x22f7ba,'6',_0xf43d('0x93')));_0x22f7ba+=0x1;_0x5ee30b['push'](new Extension(_0x57d652,_0x22f7ba,_0xf43d('0x94'),'ReceiveFax'));_0x22f7ba=0x0;return _0x5ee30b;}exports[_0xf43d('0x95')]=function(_0x4d49c4,_0x38dd07,_0x13c0b7){var _0x59c0fc;return db[_0xf43d('0x77')][_0xf43d('0x76')](function(_0xb032fa){return db[_0xf43d('0x3a')][_0xf43d('0x55')](_0x4d49c4['body'],{'transaction':_0xb032fa})[_0xf43d('0x1f')](function(_0x2d104f){_0x59c0fc=_0x2d104f['get']({'plain':!![]});return db[_0xf43d('0x96')]['bulkCreate'](createExtensionsReciveFax(_0x59c0fc),{'transaction':_0xb032fa});});})[_0xf43d('0x1f')](function(){return _0x59c0fc;})[_0xf43d('0x1f')](respondWithResult(_0x38dd07,null))[_0xf43d('0x26')](handleError(_0x38dd07,null));};exports['updateAccountApplications']=function(_0x49f658,_0x272898,_0x52833a){var _0x319b00;return db[_0xf43d('0x77')]['transaction'](function(_0x34bdcc){return db[_0xf43d('0x3a')][_0xf43d('0x30')](_0x49f658[_0xf43d('0x56')],{'where':{'id':_0x49f658['body']['id']},'transaction':_0x34bdcc})['then'](function(_0x23c3f6){return db[_0xf43d('0x96')][_0xf43d('0x31')]({'where':{'FaxAccountId':_0x49f658['body']['id']},'transaction':_0x34bdcc})['then'](function(_0x34243d){return db['VoiceExtension'][_0xf43d('0x7b')](createExtensionsReciveFax(_[_0xf43d('0x6b')](_0x49f658['body'],[_0xf43d('0x97'),_0xf43d('0x3e'),_0xf43d('0x98'),_0xf43d('0x99'),_0xf43d('0x9a'),_0xf43d('0x9b')])),{'transaction':_0x34bdcc});});});})[_0xf43d('0x1f')](function(){return db[_0xf43d('0x3a')][_0xf43d('0x9c')](_0x49f658[_0xf43d('0x56')]['id']);})[_0xf43d('0x1f')](respondWithResult(_0x272898,null))[_0xf43d('0x26')](handleError(_0x272898,null));};exports['getMessages']=function(_0x23f9f3,_0x1bdb76,_0x48fdf2){var _0x46a51d={'raw':!![],'where':{}};var _0x3d823f={};var _0x354c00={'count':0x0,'rows':[]};return db[_0xf43d('0x3a')][_0xf43d('0x61')]({'where':{'id':_0x23f9f3[_0xf43d('0x53')]['id']}})[_0xf43d('0x1f')](handleEntityNotFound(_0x1bdb76,null))[_0xf43d('0x1f')](function(_0x30a204){if(_0x30a204){_0x3d823f['model']=_['keys'](db['FaxMessage'][_0xf43d('0x3b')]);_0x3d823f[_0xf43d('0x3f')]=_[_0xf43d('0x40')](_0x23f9f3[_0xf43d('0x3f')]);_0x3d823f[_0xf43d('0x41')]=_[_0xf43d('0x42')](_0x3d823f[_0xf43d('0x43')],_0x3d823f[_0xf43d('0x3f')]);_0x46a51d[_0xf43d('0x45')]=_[_0xf43d('0x42')](_0x3d823f[_0xf43d('0x43')],qs['fields'](_0x23f9f3[_0xf43d('0x3f')][_0xf43d('0x44')]));_0x46a51d['attributes']=_0x46a51d[_0xf43d('0x45')][_0xf43d('0x46')]?_0x46a51d[_0xf43d('0x45')]:_0x3d823f['model'];if(!_0x23f9f3[_0xf43d('0x3f')][_0xf43d('0x47')](_0xf43d('0x48'))){_0x46a51d['limit']=qs[_0xf43d('0x2b')](_0x23f9f3['query'][_0xf43d('0x2b')]);_0x46a51d[_0xf43d('0x29')]=qs[_0xf43d('0x29')](_0x23f9f3[_0xf43d('0x3f')][_0xf43d('0x29')]);}_0x46a51d[_0xf43d('0x62')]=qs[_0xf43d('0x49')](_0x23f9f3[_0xf43d('0x3f')][_0xf43d('0x49')]);_0x46a51d[_0xf43d('0x4a')]=qs['filters'](_[_0xf43d('0x63')](_0x23f9f3[_0xf43d('0x3f')],_0x3d823f['filters']));_0x46a51d[_0xf43d('0x4a')][_0xf43d('0x5f')]=_0x30a204['id'];if(_0x23f9f3[_0xf43d('0x3f')]['filter']){_0x46a51d[_0xf43d('0x4a')]=_[_0xf43d('0x4c')](_0x46a51d[_0xf43d('0x4a')],{'$or':_['map'](_0x46a51d['attributes'],function(_0x2c7a53){var _0x3c8ac9={};_0x3c8ac9[_0x2c7a53]={'$like':'%'+_0x23f9f3[_0xf43d('0x3f')]['filter']+'%'};return _0x3c8ac9;})});}if(_0x23f9f3[_0xf43d('0x3f')][_0xf43d('0x9d')]){var _0x4636ec=_0x23f9f3[_0xf43d('0x3f')][_0xf43d('0x9d')]['split'](',');var _0x32f7ca={};_0x32f7ca[_0x4636ec[0x0]]={'$gte':moment(_0x4636ec[0x1])[_0xf43d('0x9e')]('YYYY-MM-DD\x20HH:mm:ss')};_0x46a51d[_0xf43d('0x4a')]=_[_0xf43d('0x4c')](_0x46a51d[_0xf43d('0x4a')],_0x32f7ca);}_0x46a51d=_['merge']({},_0x46a51d,_0x23f9f3['options']);return db[_0xf43d('0x9f')]['count']({'where':_0x46a51d[_0xf43d('0x4a')]})[_0xf43d('0x1f')](function(_0x2e7a3f){_0x354c00[_0xf43d('0x2c')]=_0x2e7a3f;if(_0x23f9f3[_0xf43d('0x3f')][_0xf43d('0x4f')]){_0x46a51d[_0xf43d('0x50')]=[{'all':!![]}];}return db['FaxMessage'][_0xf43d('0x64')](_0x46a51d);})[_0xf43d('0x1f')](function(_0x16d603){_0x354c00[_0xf43d('0x51')]=_0x16d603;return _0x354c00;});}})[_0xf43d('0x1f')](respondWithFilteredResult(_0x1bdb76,_0x46a51d))[_0xf43d('0x26')](handleError(_0x1bdb76,null));};exports[_0xf43d('0x35')]=function(_0x21e935,_0x4bf9e2,_0x339633){var _0x263562,_0x464922={},_0x4be526;if(_0x21e935[_0xf43d('0x56')]['to']){_0x4be526=_0x21e935[_0xf43d('0x56')]['to'][0x0];}return db[_0xf43d('0x3a')][_0xf43d('0x54')]({'where':{'id':_0x21e935[_0xf43d('0x53')]['id']},'include':[{'model':db['CmList'],'as':_0xf43d('0xa0'),'include':[{'model':db[_0xf43d('0x6d')],'as':_0xf43d('0xa1'),'where':{'fax':_0x4be526},'limit':0x1,'order':[['updatedAt',_0xf43d('0xa2')]]}]}]})[_0xf43d('0x1f')](handleEntityNotFound(_0x4bf9e2,null))[_0xf43d('0x1f')](function(_0xb84dc7){_0x263562=_0xb84dc7;if(_0x21e935[_0xf43d('0x56')][_0xf43d('0xa3')]&&_0x21e935[_0xf43d('0x56')][_0xf43d('0xa3')][_0xf43d('0x46')]){for(var _0x44322=0x0;_0x44322<_0x21e935[_0xf43d('0x56')][_0xf43d('0xa3')]['length'];_0x44322+=0x1){_0x21e935[_0xf43d('0x56')][_0xf43d('0xa3')][_0x44322]={'filename':_0x21e935[_0xf43d('0x56')][_0xf43d('0xa3')][_0x44322]['name'],'id':_0x21e935[_0xf43d('0x56')][_0xf43d('0xa3')][_0x44322]['id'],'path':path[_0xf43d('0xa4')](config[_0xf43d('0xa5')],'server/files/attachments',_0x21e935[_0xf43d('0x56')][_0xf43d('0xa3')][_0x44322][_0xf43d('0xa6')])};}}return respondWithRpcPromise(_0xf43d('0xa7'),_0xf43d('0xa7'),{'FaxAccountId':_['isNil'](_0x21e935['params']['id'])?undefined:_0x21e935[_0xf43d('0x53')]['id'],'path':_['isNil'](_0x21e935[_0xf43d('0x56')]['attachments'][0x0][_0xf43d('0x8')])?undefined:_0x21e935[_0xf43d('0x56')][_0xf43d('0xa3')][0x0][_0xf43d('0x8')],'fax':_[_0xf43d('0xa8')](_0x21e935[_0xf43d('0x56')]['to'][0x0])?undefined:_0x21e935['body']['to'][0x0]},client9002);})['then'](function(){if(_0x263562){if(_[_0xf43d('0xa8')](_0x21e935[_0xf43d('0x56')][_0xf43d('0xa9')])){_0x21e935[_0xf43d('0x56')][_0xf43d('0xa9')]=util[_0xf43d('0x9e')](_0xf43d('0xaa'),_0x263562['name'],_0x263562[_0xf43d('0xab')]);}if(_0x263562[_0xf43d('0xa0')]){if(_0x263562[_0xf43d('0xa0')][_0xf43d('0xa1')][_0xf43d('0x46')]){return _0x263562[_0xf43d('0xa0')]['Contacts'][0x0];}else{return db[_0xf43d('0x6d')][_0xf43d('0x55')](_[_0xf43d('0x17')](_0x21e935[_0xf43d('0x56')],{'firstName':_0x21e935[_0xf43d('0x56')]['to'][0x0],'phone':_0x21e935[_0xf43d('0x56')]['to'][0x0],'fax':_0x21e935[_0xf43d('0x56')]['to'][0x0],'ListId':_0x263562['ListId']}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0xf43d('0xac'));}})[_0xf43d('0x1f')](function(_0x337cce){if(_0x337cce){return db[_0xf43d('0x6c')][_0xf43d('0x54')]({'where':{'ContactId':_0x337cce['id'],'closed':![],'FaxAccountId':_0x263562['id']}})[_0xf43d('0x1f')](function(_0x606f0b){if(_0x606f0b){return[_0x606f0b,![]];}return db[_0xf43d('0x6c')][_0xf43d('0x55')]({'UserId':_0x21e935[_0xf43d('0x57')]['id'],'ContactId':_0x337cce['id'],'FaxAccountId':_0x263562['id'],'fax':_0x21e935[_0xf43d('0x56')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0xf43d('0x4c')](_0x21e935['body'],{'read':![],'body':_0x21e935[_0xf43d('0x56')][_0xf43d('0xa3')][0x0]['filename'],'FaxAccountId':_0x263562['id'],'UserId':_0x21e935[_0xf43d('0x57')]['id'],'ContactId':_0x337cce['id'],'AttachmentId':_0x21e935[_0xf43d('0x56')][_0xf43d('0xa3')][0x0]['id']})]},{'include':[{'model':db[_0xf43d('0x9f')],'as':_0xf43d('0xad')}]})[_0xf43d('0x1f')](function(_0x10205a){return[_0x10205a,!![]];});});}else{throw new Error(_0xf43d('0xae'));}})[_0xf43d('0xaf')](function(_0x36e07b,_0x4835e4){if(_0x4835e4){return _0x36e07b;}return db[_0xf43d('0x9f')][_0xf43d('0x55')]({'direction':_0xf43d('0xb0'),'read':![],'body':_0x21e935[_0xf43d('0x56')][_0xf43d('0xa3')][0x0][_0xf43d('0xb1')],'FaxAccountId':_0x263562['id'],'FaxInteractionId':_0x36e07b['id'],'UserId':_0x21e935[_0xf43d('0x57')]['id'],'ContactId':_0x36e07b[_0xf43d('0xb2')],'AttachmentId':_0x21e935[_0xf43d('0x56')][_0xf43d('0xa3')][0x0]['id']})[_0xf43d('0x1f')](function(_0x4c3bc7){_0x36e07b[_0xf43d('0xb3')]['Messages']=[];_0x36e07b[_0xf43d('0xb3')][_0xf43d('0xad')][_0xf43d('0x89')](_0x4c3bc7[_0xf43d('0xb3')]);return _0x36e07b;});})['then'](function(_0x2decf6){respondWithRpcPromise(_0xf43d('0xb4'),'SendFax',{'FaxAccountId':_[_0xf43d('0xa8')](_0x21e935[_0xf43d('0x53')]['id'])?undefined:_0x21e935[_0xf43d('0x53')]['id'],'path':_[_0xf43d('0xa8')](_0x21e935['body'][_0xf43d('0xa3')][0x0][_0xf43d('0x8')])?undefined:_0x21e935[_0xf43d('0x56')][_0xf43d('0xa3')][0x0][_0xf43d('0x8')],'fax':_[_0xf43d('0xa8')](_0x21e935['body']['to'][0x0])?undefined:_0x21e935[_0xf43d('0x56')]['to'][0x0],'AttachmentId':_0x21e935[_0xf43d('0x56')][_0xf43d('0xa3')][0x0]['id']},client9002)[_0xf43d('0x1f')](function(_0xe80bf8){logger[_0xf43d('0x20')](_0xf43d('0xb5'),_0xe80bf8);})[_0xf43d('0x26')](function(_0x10811b){logger[_0xf43d('0x20')](_0xf43d('0xb5'),_0x10811b);});return _0x2decf6;})[_0xf43d('0x1f')](respondWithResult(_0x4bf9e2,null))['catch'](handleError(_0x4bf9e2,null));};exports[_0xf43d('0xb6')]=function(_0xb77235,_0x1bc9aa,_0x34eb72){return db[_0xf43d('0x3a')][_0xf43d('0x54')]({'where':{'id':_0xb77235[_0xf43d('0x53')]['id']}})['then'](handleEntityNotFound(_0x1bc9aa,null))[_0xf43d('0x1f')](function(_0x12c939){if(_0x12c939){return _0x12c939['addAgents'](_0xb77235[_0xf43d('0x56')][_0xf43d('0x69')],_[_0xf43d('0x6b')](_0xb77235[_0xf43d('0x56')],[_0xf43d('0x69'),'id'])||{})[_0xf43d('0xaf')](function(_0x41e773){for(var _0x2a2b01=0x0;_0x2a2b01<_0xb77235[_0xf43d('0x56')][_0xf43d('0x69')]['length'];_0x2a2b01+=0x1){socket[_0xf43d('0xb7')](_0xf43d('0xb8'),{'UserId':Number(_0xb77235[_0xf43d('0x56')][_0xf43d('0x69')][_0x2a2b01]),'FaxAccountId':Number(_0xb77235[_0xf43d('0x53')]['id'])});}return _0x41e773;});}})[_0xf43d('0x1f')](respondWithResult(_0x1bc9aa,null))[_0xf43d('0x26')](handleError(_0x1bc9aa,null));};exports['removeAgents']=function(_0x4c67ad,_0x85283d,_0x52a9f4){return db[_0xf43d('0x3a')][_0xf43d('0x54')]({'where':{'id':_0x4c67ad[_0xf43d('0x53')]['id']}})[_0xf43d('0x1f')](handleEntityNotFound(_0x85283d,null))['then'](function(_0x5d41e8){if(_0x5d41e8){return _0x5d41e8['removeAgents'](_0x4c67ad['query'][_0xf43d('0x69')])[_0xf43d('0x1f')](function(){if(_['isArray'](_0x4c67ad[_0xf43d('0x3f')][_0xf43d('0x69')])){for(var _0x1fb474=0x0;_0x1fb474<_0x4c67ad[_0xf43d('0x3f')][_0xf43d('0x69')][_0xf43d('0x46')];_0x1fb474+=0x1){socket[_0xf43d('0xb7')](_0xf43d('0xb9'),{'UserId':Number(_0x4c67ad[_0xf43d('0x3f')][_0xf43d('0x69')][_0x1fb474]),'FaxAccountId':Number(_0x4c67ad[_0xf43d('0x53')]['id'])});}}else{socket[_0xf43d('0xb7')](_0xf43d('0xb9'),{'UserId':Number(_0x4c67ad[_0xf43d('0x3f')]['ids']),'FaxAccountId':Number(_0x4c67ad[_0xf43d('0x53')]['id'])});}});}})[_0xf43d('0x1f')](respondWithStatusCode(_0x85283d,null))[_0xf43d('0x26')](handleError(_0x85283d,null));};exports[_0xf43d('0xba')]=function(_0xca3e23,_0x435a9e,_0x5b2ba2){var _0x1e2191={};var _0x127a80={};var _0x5e1e72;var _0x1793f0;return db[_0xf43d('0x3a')][_0xf43d('0x61')]({'where':{'id':_0xca3e23[_0xf43d('0x53')]['id']}})[_0xf43d('0x1f')](handleEntityNotFound(_0x435a9e,null))['then'](function(_0x1d7421){if(_0x1d7421){_0x5e1e72=_0x1d7421;_0x127a80[_0xf43d('0x43')]=_[_0xf43d('0x40')](db[_0xf43d('0x6f')][_0xf43d('0x3b')]);_0x127a80[_0xf43d('0x3f')]=_[_0xf43d('0x40')](_0xca3e23['query']);_0x127a80[_0xf43d('0x41')]=_[_0xf43d('0x42')](_0x127a80[_0xf43d('0x43')],_0x127a80[_0xf43d('0x3f')]);_0x1e2191['attributes']=_[_0xf43d('0x42')](_0x127a80[_0xf43d('0x43')],qs['fields'](_0xca3e23[_0xf43d('0x3f')][_0xf43d('0x44')]));_0x1e2191[_0xf43d('0x45')]=_0x1e2191['attributes']['length']?_0x1e2191['attributes']:_0x127a80[_0xf43d('0x43')];_0x1e2191[_0xf43d('0x62')]=qs['sort'](_0xca3e23['query'][_0xf43d('0x49')]);_0x1e2191[_0xf43d('0x4a')]=qs[_0xf43d('0x41')](_['pick'](_0xca3e23[_0xf43d('0x3f')],_0x127a80['filters']));if(_0xca3e23['query']['filter']){_0x1e2191['where']=_[_0xf43d('0x4c')](_0x1e2191['where'],{'$or':_[_0xf43d('0x39')](_0x1e2191[_0xf43d('0x45')],function(_0x45d4e0){var _0x2f636b={};_0x2f636b[_0x45d4e0]={'$like':'%'+_0xca3e23['query'][_0xf43d('0x4b')]+'%'};return _0x2f636b;})});}_0x1e2191=_['merge']({},_0x1e2191,_0xca3e23['options']);return _0x5e1e72[_0xf43d('0xba')](_0x1e2191);}})[_0xf43d('0x1f')](function(_0x592cbe){if(_0x592cbe){_0x1793f0=_0x592cbe[_0xf43d('0x46')];if(!_0xca3e23[_0xf43d('0x3f')]['hasOwnProperty']('nolimit')){_0x1e2191[_0xf43d('0x2b')]=qs['limit'](_0xca3e23[_0xf43d('0x3f')][_0xf43d('0x2b')]);_0x1e2191['offset']=qs['offset'](_0xca3e23[_0xf43d('0x3f')][_0xf43d('0x29')]);}return _0x5e1e72['getAgents'](_0x1e2191);}})[_0xf43d('0x1f')](function(_0x274d13){if(_0x274d13){return _0x274d13?{'count':_0x1793f0,'rows':_0x274d13}:null;}})[_0xf43d('0x1f')](respondWithResult(_0x435a9e,null))[_0xf43d('0x26')](handleError(_0x435a9e,null));}; \ No newline at end of file +var _0xd351=['send','index','Pause','mandatoryDispositionPause','FaxAccount','type','model','map','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','params','keys','rawAttributes','length','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','autoAssociation','update','describe','addDisposition','FaxAccountId','Disposition','findOne','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','nolimit','removeAnswers','addInteraction','FaxInteraction','getInteractions','CmContact','fullname','internal','Tag','Tags','color','tag','addApplications','transaction','sequelize','Transaction','READ_COMMITTED','FaxApplication','findAndCountAll','priority','finally','getApplications','context','from-voip-provider','exten','system','description','Fax\x20Extension','appdata','Answer','push','CDR(type)=inbound-fax','Set','ecm','localstationid','gateway','faxdetect','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','bulkCreate','omit','tech','key','createdAt','updatedAt','findById','getMessages','FaxMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','format','fax','ListId','List\x20not\x20found','filename','Messages','Contact\x20not\x20found','spread','out','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','eml-format','rimraf','request-promise','moment','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','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','code','message','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','destroy','FaxAccounts','UserProfileResource','end','sendStatus','name'];(function(_0x118fbc,_0x38565e){var _0x4d7966=function(_0x133bd8){while(--_0x133bd8){_0x118fbc['push'](_0x118fbc['shift']());}};_0x4d7966(++_0x38565e);}(_0xd351,0x8b));var _0x1d35=function(_0x5f2360,_0x45b393){_0x5f2360=_0x5f2360-0x0;var _0x3df0be=_0xd351[_0x5f2360];return _0x3df0be;};'use strict';var emlformat=require(_0x1d35('0x0'));var rimraf=require(_0x1d35('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1d35('0x2'));var moment=require(_0x1d35('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1d35('0x4'));var util=require(_0x1d35('0x5'));var path=require(_0x1d35('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1d35('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1d35('0x8'));var squel=require(_0x1d35('0x9'));var crypto=require(_0x1d35('0xa'));var jsforce=require(_0x1d35('0xb'));var deskjs=require(_0x1d35('0xc'));var toCsv=require(_0x1d35('0xd'));var querystring=require(_0x1d35('0xe'));var Papa=require(_0x1d35('0xf'));var Redis=require(_0x1d35('0x10'));var authService=require(_0x1d35('0x11'));var qs=require(_0x1d35('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1d35('0x13'))('api');var utils=require(_0x1d35('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1d35('0x15'))['db'];config[_0x1d35('0x16')]=_[_0x1d35('0x17')](config[_0x1d35('0x16')],{'host':_0x1d35('0x18'),'port':0x18eb});var socket=require(_0x1d35('0x19'))(new Redis(config[_0x1d35('0x16')]));require('./faxAccount.socket')[_0x1d35('0x1a')](socket);var jayson=require(_0x1d35('0x1b'));var client=jayson[_0x1d35('0x1c')][_0x1d35('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0x1d35('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x30e8a1,_0x2c7356,_0x515141,_0x4d1bd2){return new BPromise(function(_0x34c84c,_0x4a6f9c){var _0x197aad=_0x4d1bd2||client;return _0x197aad[_0x1d35('0x1e')](_0x30e8a1,_0x515141)[_0x1d35('0x1f')](function(_0x3e57f5){logger[_0x1d35('0x20')](_0x1d35('0x21'),_0x2c7356,_0x1d35('0x22'));logger[_0x1d35('0x23')](_0x1d35('0x24'),_0x2c7356,_0x1d35('0x22'),JSON[_0x1d35('0x25')](_0x3e57f5));if(_0x3e57f5['error']){if(_0x3e57f5[_0x1d35('0x26')][_0x1d35('0x27')]===0x1f4){logger[_0x1d35('0x26')](_0x1d35('0x21'),_0x2c7356,_0x3e57f5['error']['message']);return _0x4a6f9c(_0x3e57f5[_0x1d35('0x26')][_0x1d35('0x28')]);}logger[_0x1d35('0x26')](_0x1d35('0x21'),_0x2c7356,_0x3e57f5[_0x1d35('0x26')][_0x1d35('0x28')]);return _0x34c84c(_0x3e57f5[_0x1d35('0x26')][_0x1d35('0x28')]);}else{logger[_0x1d35('0x20')](_0x1d35('0x21'),_0x2c7356,'request\x20sent');_0x34c84c(_0x3e57f5['result'][_0x1d35('0x28')]);}})['catch'](function(_0x12a079){logger[_0x1d35('0x26')](_0x1d35('0x21'),_0x2c7356,_0x12a079);_0x4a6f9c(_0x12a079);});});}function respondWithStatusCode(_0x4184a8,_0x7cf9d8){_0x7cf9d8=_0x7cf9d8||0xcc;return function(_0x1e8ce3){if(_0x1e8ce3){return _0x4184a8['sendStatus'](_0x7cf9d8);}return _0x4184a8['status'](_0x7cf9d8)['end']();};}function respondWithResult(_0x2436e3,_0x13a450){_0x13a450=_0x13a450||0xc8;return function(_0x199e0c){if(_0x199e0c){return _0x2436e3[_0x1d35('0x29')](_0x13a450)[_0x1d35('0x2a')](_0x199e0c);}};}function respondWithFilteredResult(_0x4d533e,_0x5cb2e1){return function(_0x39d4a4){if(_0x39d4a4){var _0x1707d5=typeof _0x5cb2e1[_0x1d35('0x2b')]==='undefined'&&typeof _0x5cb2e1[_0x1d35('0x2c')]===_0x1d35('0x2d');var _0xbb419b=_0x39d4a4[_0x1d35('0x2e')];var _0x3c19c7=_0x1707d5?0x0:_0x5cb2e1[_0x1d35('0x2b')];var _0x2e0624=_0x1707d5?_0x39d4a4[_0x1d35('0x2e')]:_0x5cb2e1['offset']+_0x5cb2e1[_0x1d35('0x2c')];var _0x2d819a;if(_0x2e0624>=_0xbb419b){_0x2e0624=_0xbb419b;_0x2d819a=0xc8;}else{_0x2d819a=0xce;}_0x4d533e[_0x1d35('0x29')](_0x2d819a);return _0x4d533e[_0x1d35('0x2f')](_0x1d35('0x30'),_0x3c19c7+'-'+_0x2e0624+'/'+_0xbb419b)[_0x1d35('0x2a')](_0x39d4a4);}return null;};}function patchUpdates(_0x2cb4e2){return function(_0x53c823){try{jsonpatch[_0x1d35('0x31')](_0x53c823,_0x2cb4e2,!![]);}catch(_0x50057e){return BPromise[_0x1d35('0x32')](_0x50057e);}return _0x53c823[_0x1d35('0x33')]();};}function saveUpdates(_0x39237e,_0x23168c){return function(_0x4590e8){if(_0x4590e8){return _0x4590e8['update'](_0x39237e)['then'](function(_0x49533d){return _0x49533d;});}return null;};}function removeEntity(_0x31079c,_0x22b457){return function(_0x536b50){if(_0x536b50){return _0x536b50[_0x1d35('0x34')]()[_0x1d35('0x1f')](function(){var _0x2d5887=_0x536b50['get']({'plain':!![]});var _0x4c7e30=_0x1d35('0x35');return db[_0x1d35('0x36')][_0x1d35('0x34')]({'where':{'type':_0x4c7e30,'resourceId':_0x2d5887['id']}})['then'](function(){return _0x536b50;});})[_0x1d35('0x1f')](function(){_0x31079c['status'](0xcc)[_0x1d35('0x37')]();});}};}function handleEntityNotFound(_0x1bf753,_0x56d8e1){return function(_0x7d8f66){if(!_0x7d8f66){_0x1bf753[_0x1d35('0x38')](0x194);}return _0x7d8f66;};}function handleError(_0x2e5e5d,_0xdf9f1){_0xdf9f1=_0xdf9f1||0x1f4;return function(_0x5c9d72){logger[_0x1d35('0x26')](_0x5c9d72['stack']);if(_0x5c9d72[_0x1d35('0x39')]){delete _0x5c9d72['name'];}_0x2e5e5d[_0x1d35('0x29')](_0xdf9f1)[_0x1d35('0x3a')](_0x5c9d72);};}exports[_0x1d35('0x3b')]=function(_0x153c86,_0x2c0a29){var _0xa0f74a={'include':[{'model':db[_0x1d35('0x3c')],'as':_0x1d35('0x3d')}]},_0x26ce41={},_0x52fe7e={'count':0x0,'rows':[]};var _0x3f5894=_['map'](db[_0x1d35('0x3e')]['rawAttributes'],function(_0x2eadd9){return{'name':_0x2eadd9['fieldName'],'type':_0x2eadd9[_0x1d35('0x3f')]['key']};});_0x26ce41[_0x1d35('0x40')]=_[_0x1d35('0x41')](_0x3f5894,'name');_0x26ce41[_0x1d35('0x42')]=_['keys'](_0x153c86['query']);_0x26ce41[_0x1d35('0x43')]=_['intersection'](_0x26ce41['model'],_0x26ce41[_0x1d35('0x42')]);_0xa0f74a['attributes']=_[_0x1d35('0x44')](_0x26ce41[_0x1d35('0x40')],qs['fields'](_0x153c86[_0x1d35('0x42')][_0x1d35('0x45')]));_0xa0f74a[_0x1d35('0x46')]=_0xa0f74a[_0x1d35('0x46')]['length']?_0xa0f74a[_0x1d35('0x46')]:_0x26ce41['model'];if(!_0x153c86['query'][_0x1d35('0x47')]('nolimit')){_0xa0f74a[_0x1d35('0x2c')]=qs[_0x1d35('0x2c')](_0x153c86['query'][_0x1d35('0x2c')]);_0xa0f74a['offset']=qs['offset'](_0x153c86['query'][_0x1d35('0x2b')]);}_0xa0f74a[_0x1d35('0x48')]=qs[_0x1d35('0x49')](_0x153c86[_0x1d35('0x42')][_0x1d35('0x49')]);_0xa0f74a['where']=qs['filters'](_[_0x1d35('0x4a')](_0x153c86['query'],_0x26ce41[_0x1d35('0x43')]),_0x3f5894);if(_0x153c86[_0x1d35('0x42')][_0x1d35('0x4b')]){_0xa0f74a[_0x1d35('0x4c')]=_[_0x1d35('0x4d')](_0xa0f74a[_0x1d35('0x4c')],{'$or':_[_0x1d35('0x41')](_0x3f5894,function(_0x292b86){if(_0x292b86[_0x1d35('0x3f')]!==_0x1d35('0x4e')){var _0x2c6d9d={};_0x2c6d9d[_0x292b86[_0x1d35('0x39')]]={'$like':'%'+_0x153c86[_0x1d35('0x42')][_0x1d35('0x4b')]+'%'};return _0x2c6d9d;}})});}_0xa0f74a=_['merge']({},_0xa0f74a,_0x153c86[_0x1d35('0x4f')]);var _0x18d58d={'where':_0xa0f74a[_0x1d35('0x4c')]};return db[_0x1d35('0x3e')][_0x1d35('0x2e')](_0x18d58d)[_0x1d35('0x1f')](function(_0x3ef6b3){_0x52fe7e[_0x1d35('0x2e')]=_0x3ef6b3;if(_0x153c86['query'][_0x1d35('0x50')]){_0xa0f74a[_0x1d35('0x51')]=[{'all':!![]}];}return db['FaxAccount']['findAll'](_0xa0f74a);})['then'](function(_0x30b8d3){_0x52fe7e[_0x1d35('0x52')]=_0x30b8d3;return _0x52fe7e;})[_0x1d35('0x1f')](respondWithFilteredResult(_0x2c0a29,_0xa0f74a))[_0x1d35('0x53')](handleError(_0x2c0a29,null));};exports['show']=function(_0x5c7a64,_0x5548ce){var _0x39bf61={'raw':![],'where':{'id':_0x5c7a64[_0x1d35('0x54')]['id']},'include':[{'model':db[_0x1d35('0x3c')],'as':_0x1d35('0x3d')}]},_0x479c2d={};_0x479c2d[_0x1d35('0x40')]=_[_0x1d35('0x55')](db[_0x1d35('0x3e')][_0x1d35('0x56')]);_0x479c2d[_0x1d35('0x42')]=_[_0x1d35('0x55')](_0x5c7a64[_0x1d35('0x42')]);_0x479c2d[_0x1d35('0x43')]=_['intersection'](_0x479c2d[_0x1d35('0x40')],_0x479c2d['query']);_0x39bf61[_0x1d35('0x46')]=_[_0x1d35('0x44')](_0x479c2d['model'],qs[_0x1d35('0x45')](_0x5c7a64['query']['fields']));_0x39bf61[_0x1d35('0x46')]=_0x39bf61[_0x1d35('0x46')][_0x1d35('0x57')]?_0x39bf61[_0x1d35('0x46')]:_0x479c2d[_0x1d35('0x40')];if(_0x5c7a64['query'][_0x1d35('0x50')]){_0x39bf61[_0x1d35('0x51')]=[{'all':!![]}];}_0x39bf61=_[_0x1d35('0x4d')]({},_0x39bf61,_0x5c7a64[_0x1d35('0x4f')]);return db[_0x1d35('0x3e')][_0x1d35('0x58')](_0x39bf61)['then'](handleEntityNotFound(_0x5548ce,null))[_0x1d35('0x1f')](respondWithResult(_0x5548ce,null))['catch'](handleError(_0x5548ce,null));};exports['create']=function(_0x6774d,_0x260a2b){return db[_0x1d35('0x3e')][_0x1d35('0x59')](_0x6774d[_0x1d35('0x5a')],{})['then'](function(_0x1c69b8){var _0x3abfa3=_0x6774d['user'][_0x1d35('0x5b')]({'plain':!![]});if(!_0x3abfa3)throw new Error(_0x1d35('0x5c'));if(_0x3abfa3[_0x1d35('0x5d')]===_0x1d35('0x5e')){var _0x1abded=_0x1c69b8[_0x1d35('0x5b')]({'plain':!![]});var _0x30c97c=_0x1d35('0x35');return db['UserProfileSection'][_0x1d35('0x58')]({'where':{'name':_0x30c97c,'userProfileId':_0x3abfa3['userProfileId']},'raw':!![]})[_0x1d35('0x1f')](function(_0x2c51ef){if(_0x2c51ef&&_0x2c51ef[_0x1d35('0x5f')]===0x0){return db['UserProfileResource'][_0x1d35('0x59')]({'name':_0x1abded[_0x1d35('0x39')],'resourceId':_0x1abded['id'],'type':_0x2c51ef['name'],'sectionId':_0x2c51ef['id']},{})[_0x1d35('0x1f')](function(){return _0x1c69b8;});}else{return _0x1c69b8;}})[_0x1d35('0x53')](function(_0xc83d06){logger[_0x1d35('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xc83d06);throw _0xc83d06;});}return _0x1c69b8;})[_0x1d35('0x1f')](respondWithResult(_0x260a2b,0xc9))['catch'](handleError(_0x260a2b,null));};exports[_0x1d35('0x60')]=function(_0x59bb4b,_0x3b92fe){if(_0x59bb4b[_0x1d35('0x5a')]['id']){delete _0x59bb4b['body']['id'];}return db[_0x1d35('0x3e')][_0x1d35('0x58')]({'where':{'id':_0x59bb4b[_0x1d35('0x54')]['id']},'include':[{'model':db[_0x1d35('0x3c')],'as':'mandatoryDispositionPause'}]})[_0x1d35('0x1f')](handleEntityNotFound(_0x3b92fe,null))[_0x1d35('0x1f')](saveUpdates(_0x59bb4b[_0x1d35('0x5a')],null))['then'](respondWithResult(_0x3b92fe,null))['catch'](handleError(_0x3b92fe,null));};exports[_0x1d35('0x34')]=function(_0x521f2a,_0xe7186a){return db['FaxAccount'][_0x1d35('0x58')]({'where':{'id':_0x521f2a['params']['id']}})[_0x1d35('0x1f')](handleEntityNotFound(_0xe7186a,null))[_0x1d35('0x1f')](removeEntity(_0xe7186a,null))[_0x1d35('0x53')](handleError(_0xe7186a,null));};exports[_0x1d35('0x61')]=function(_0x396bd1,_0x296e88){return db['FaxAccount'][_0x1d35('0x61')]()[_0x1d35('0x1f')](respondWithResult(_0x296e88,null))[_0x1d35('0x53')](handleError(_0x296e88,null));};exports[_0x1d35('0x62')]=function(_0x3d5f2e,_0xaf43f4,_0x3824f2){if(_0x3d5f2e[_0x1d35('0x5a')]['id']){delete _0x3d5f2e[_0x1d35('0x5a')]['id'];}return db[_0x1d35('0x3e')][_0x1d35('0x58')]({'where':{'id':_0x3d5f2e[_0x1d35('0x54')]['id']}})[_0x1d35('0x1f')](handleEntityNotFound(_0xaf43f4,null))[_0x1d35('0x1f')](function(_0xf3e195){if(_0xf3e195){_0x3d5f2e[_0x1d35('0x5a')][_0x1d35('0x63')]=_0xf3e195['id'];return db[_0x1d35('0x64')]['create'](_0x3d5f2e[_0x1d35('0x5a')]);}})[_0x1d35('0x1f')](respondWithResult(_0xaf43f4,null))[_0x1d35('0x53')](handleError(_0xaf43f4,null));};exports['getDispositions']=function(_0x1881e1,_0x478011,_0x50ddf6){var _0x1a8f8d={'raw':![],'where':{}};var _0x26677f={};var _0x55c488={'count':0x0,'rows':[]};return db['FaxAccount'][_0x1d35('0x65')]({'where':{'id':_0x1881e1[_0x1d35('0x54')]['id']}})['then'](handleEntityNotFound(_0x478011,null))[_0x1d35('0x1f')](function(_0x213814){if(_0x213814){_0x26677f['model']=_[_0x1d35('0x55')](db['Disposition']['rawAttributes']);_0x26677f[_0x1d35('0x42')]=_[_0x1d35('0x55')](_0x1881e1[_0x1d35('0x42')]);_0x26677f[_0x1d35('0x43')]=_['intersection'](_0x26677f[_0x1d35('0x40')],_0x26677f[_0x1d35('0x42')]);_0x1a8f8d['attributes']=_[_0x1d35('0x44')](_0x26677f[_0x1d35('0x40')],qs[_0x1d35('0x45')](_0x1881e1[_0x1d35('0x42')]['fields']));_0x1a8f8d[_0x1d35('0x46')]=_0x1a8f8d[_0x1d35('0x46')][_0x1d35('0x57')]?_0x1a8f8d['attributes']:_0x26677f[_0x1d35('0x40')];if(!_0x1881e1[_0x1d35('0x42')][_0x1d35('0x47')]('nolimit')){_0x1a8f8d[_0x1d35('0x2c')]=qs['limit'](_0x1881e1[_0x1d35('0x42')]['limit']);_0x1a8f8d['offset']=qs[_0x1d35('0x2b')](_0x1881e1[_0x1d35('0x42')]['offset']);}_0x1a8f8d[_0x1d35('0x48')]=qs[_0x1d35('0x49')](_0x1881e1[_0x1d35('0x42')][_0x1d35('0x49')]);_0x1a8f8d[_0x1d35('0x4c')]=qs['filters'](_[_0x1d35('0x4a')](_0x1881e1['query'],_0x26677f['filters']));_0x1a8f8d[_0x1d35('0x4c')][_0x1d35('0x63')]=_0x213814['id'];if(_0x1881e1[_0x1d35('0x42')][_0x1d35('0x4b')]){_0x1a8f8d['where']=_[_0x1d35('0x4d')](_0x1a8f8d['where'],{'$or':_[_0x1d35('0x41')](_0x1a8f8d[_0x1d35('0x46')],function(_0x3c34f9){var _0x1c923d={};_0x1c923d[_0x3c34f9]={'$like':'%'+_0x1881e1[_0x1d35('0x42')]['filter']+'%'};return _0x1c923d;})});}_0x1a8f8d=_[_0x1d35('0x4d')]({},_0x1a8f8d,_0x1881e1['options']);return db[_0x1d35('0x64')][_0x1d35('0x2e')]({'where':_0x1a8f8d['where']})[_0x1d35('0x1f')](function(_0x417b58){_0x55c488['count']=_0x417b58;if(_0x1881e1[_0x1d35('0x42')]['includeAll']){_0x1a8f8d[_0x1d35('0x51')]=[{'all':!![]}];}return db[_0x1d35('0x64')][_0x1d35('0x66')](_0x1a8f8d);})[_0x1d35('0x1f')](function(_0x106543){_0x55c488[_0x1d35('0x52')]=_0x106543;return _0x55c488;});}})[_0x1d35('0x1f')](respondWithFilteredResult(_0x478011,_0x1a8f8d))[_0x1d35('0x53')](handleError(_0x478011,null));};exports[_0x1d35('0x67')]=function(_0x5a4ba2,_0x5028b8,_0x5d5248){return db['FaxAccount'][_0x1d35('0x58')]({'where':{'id':_0x5a4ba2[_0x1d35('0x54')]['id']}})[_0x1d35('0x1f')](handleEntityNotFound(_0x5028b8,null))[_0x1d35('0x1f')](function(_0x1a82e2){if(_0x1a82e2){return _0x1a82e2[_0x1d35('0x67')](_0x5a4ba2[_0x1d35('0x42')][_0x1d35('0x68')]);}})['then'](respondWithStatusCode(_0x5028b8,null))['catch'](handleError(_0x5028b8,null));};exports[_0x1d35('0x69')]=function(_0x1010f,_0x20ad34,_0x41507f){if(_0x1010f['body']['id']){delete _0x1010f[_0x1d35('0x5a')]['id'];}return db['FaxAccount'][_0x1d35('0x58')]({'where':{'id':_0x1010f[_0x1d35('0x54')]['id']}})[_0x1d35('0x1f')](handleEntityNotFound(_0x20ad34,null))[_0x1d35('0x1f')](function(_0x1e2fc1){if(_0x1e2fc1){_0x1010f['body'][_0x1d35('0x63')]=_0x1e2fc1['id'];return db[_0x1d35('0x6a')][_0x1d35('0x59')](_0x1010f[_0x1d35('0x5a')]);}})[_0x1d35('0x1f')](respondWithResult(_0x20ad34,null))['catch'](handleError(_0x20ad34,null));};exports[_0x1d35('0x6b')]=function(_0xb784b4,_0x561d28,_0x9e29b){var _0x27a626={'raw':![],'where':{}};var _0x7a58e0={};var _0x46b7ae={'count':0x0,'rows':[]};return db['FaxAccount'][_0x1d35('0x65')]({'where':{'id':_0xb784b4['params']['id']}})[_0x1d35('0x1f')](handleEntityNotFound(_0x561d28,null))['then'](function(_0x592f27){if(_0x592f27){_0x7a58e0[_0x1d35('0x40')]=_[_0x1d35('0x55')](db[_0x1d35('0x6a')][_0x1d35('0x56')]);_0x7a58e0[_0x1d35('0x42')]=_[_0x1d35('0x55')](_0xb784b4['query']);_0x7a58e0[_0x1d35('0x43')]=_[_0x1d35('0x44')](_0x7a58e0[_0x1d35('0x40')],_0x7a58e0[_0x1d35('0x42')]);_0x27a626[_0x1d35('0x46')]=_['intersection'](_0x7a58e0[_0x1d35('0x40')],qs[_0x1d35('0x45')](_0xb784b4[_0x1d35('0x42')]['fields']));_0x27a626[_0x1d35('0x46')]=_0x27a626[_0x1d35('0x46')][_0x1d35('0x57')]?_0x27a626[_0x1d35('0x46')]:_0x7a58e0[_0x1d35('0x40')];if(!_0xb784b4[_0x1d35('0x42')][_0x1d35('0x47')](_0x1d35('0x6c'))){_0x27a626['limit']=qs[_0x1d35('0x2c')](_0xb784b4[_0x1d35('0x42')]['limit']);_0x27a626[_0x1d35('0x2b')]=qs[_0x1d35('0x2b')](_0xb784b4[_0x1d35('0x42')]['offset']);}_0x27a626[_0x1d35('0x48')]=qs[_0x1d35('0x49')](_0xb784b4[_0x1d35('0x42')][_0x1d35('0x49')]);_0x27a626[_0x1d35('0x4c')]=qs['filters'](_['pick'](_0xb784b4[_0x1d35('0x42')],_0x7a58e0[_0x1d35('0x43')]));_0x27a626[_0x1d35('0x4c')][_0x1d35('0x63')]=_0x592f27['id'];if(_0xb784b4[_0x1d35('0x42')]['filter']){_0x27a626[_0x1d35('0x4c')]=_[_0x1d35('0x4d')](_0x27a626[_0x1d35('0x4c')],{'$or':_[_0x1d35('0x41')](_0x27a626[_0x1d35('0x46')],function(_0x27bf6c){var _0x484f47={};_0x484f47[_0x27bf6c]={'$like':'%'+_0xb784b4[_0x1d35('0x42')]['filter']+'%'};return _0x484f47;})});}_0x27a626=_[_0x1d35('0x4d')]({},_0x27a626,_0xb784b4[_0x1d35('0x4f')]);return db[_0x1d35('0x6a')]['count']({'where':_0x27a626[_0x1d35('0x4c')]})[_0x1d35('0x1f')](function(_0x47b6ad){_0x46b7ae[_0x1d35('0x2e')]=_0x47b6ad;if(_0xb784b4['query'][_0x1d35('0x50')]){_0x27a626['include']=[{'all':!![]}];}return db[_0x1d35('0x6a')][_0x1d35('0x66')](_0x27a626);})[_0x1d35('0x1f')](function(_0x227a85){_0x46b7ae[_0x1d35('0x52')]=_0x227a85;return _0x46b7ae;});}})['then'](respondWithFilteredResult(_0x561d28,_0x27a626))[_0x1d35('0x53')](handleError(_0x561d28,null));};exports['removeAnswers']=function(_0x33bbf1,_0x3551cd,_0x198aed){return db[_0x1d35('0x3e')][_0x1d35('0x58')]({'where':{'id':_0x33bbf1[_0x1d35('0x54')]['id']}})[_0x1d35('0x1f')](handleEntityNotFound(_0x3551cd,null))['then'](function(_0x58ef9b){if(_0x58ef9b){return _0x58ef9b[_0x1d35('0x6d')](_0x33bbf1[_0x1d35('0x42')]['ids']);}})[_0x1d35('0x1f')](respondWithStatusCode(_0x3551cd,null))[_0x1d35('0x53')](handleError(_0x3551cd,null));};exports[_0x1d35('0x6e')]=function(_0x2eeb9d,_0x15e80f,_0x5298be){return db[_0x1d35('0x6f')][_0x1d35('0x58')]({'where':{'id':_0x2eeb9d[_0x1d35('0x54')]['id']}})[_0x1d35('0x1f')](handleEntityNotFound(_0x15e80f,null))[_0x1d35('0x1f')](function(_0x5d263f){if(_0x5d263f){return _0x5d263f['addInteraction'](_0x2eeb9d['body'][_0x1d35('0x68')],_['omit'](_0x2eeb9d['body'],[_0x1d35('0x68'),'id'])||{});}})['then'](respondWithResult(_0x15e80f,null))[_0x1d35('0x53')](handleError(_0x15e80f,null));};exports[_0x1d35('0x70')]=function(_0x1d91ed,_0x133ac5,_0x237d46){var _0x3d5c31={'raw':![],'where':{}};var _0x5b6c26={};var _0x17e6b5={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x1d91ed[_0x1d35('0x54')]['id']}})[_0x1d35('0x1f')](handleEntityNotFound(_0x133ac5,null))[_0x1d35('0x1f')](function(_0x379393){if(_0x379393){_0x5b6c26[_0x1d35('0x40')]=_[_0x1d35('0x55')](db['FaxInteraction'][_0x1d35('0x56')]);_0x5b6c26['query']=_[_0x1d35('0x55')](_0x1d91ed[_0x1d35('0x42')]);_0x5b6c26[_0x1d35('0x43')]=_[_0x1d35('0x44')](_0x5b6c26['model'],_0x5b6c26['query']);_0x3d5c31[_0x1d35('0x46')]=_[_0x1d35('0x44')](_0x5b6c26[_0x1d35('0x40')],qs['fields'](_0x1d91ed[_0x1d35('0x42')][_0x1d35('0x45')]));_0x3d5c31['attributes']=_0x3d5c31[_0x1d35('0x46')][_0x1d35('0x57')]?_0x3d5c31['attributes']:_0x5b6c26['model'];if(!_0x1d91ed[_0x1d35('0x42')]['hasOwnProperty'](_0x1d35('0x6c'))){_0x3d5c31['limit']=qs['limit'](_0x1d91ed[_0x1d35('0x42')][_0x1d35('0x2c')]);_0x3d5c31[_0x1d35('0x2b')]=qs[_0x1d35('0x2b')](_0x1d91ed[_0x1d35('0x42')][_0x1d35('0x2b')]);}_0x3d5c31['order']=qs[_0x1d35('0x49')](_0x1d91ed[_0x1d35('0x42')]['sort']);_0x3d5c31[_0x1d35('0x4c')]=qs[_0x1d35('0x43')](_[_0x1d35('0x4a')](_0x1d91ed[_0x1d35('0x42')],_0x5b6c26[_0x1d35('0x43')]));_0x3d5c31[_0x1d35('0x4c')][_0x1d35('0x63')]=_0x379393['id'];if(_0x1d91ed[_0x1d35('0x42')][_0x1d35('0x4b')]){_0x3d5c31[_0x1d35('0x4c')]=_[_0x1d35('0x4d')](_0x3d5c31[_0x1d35('0x4c')],{'$or':_[_0x1d35('0x41')](_0x3d5c31['attributes'],function(_0x8565f0){var _0x5df98b={};_0x5df98b[_0x8565f0]={'$like':'%'+_0x1d91ed[_0x1d35('0x42')][_0x1d35('0x4b')]+'%'};return _0x5df98b;})});}_0x3d5c31=_['merge']({},_0x3d5c31,_0x1d91ed[_0x1d35('0x4f')]);return db[_0x1d35('0x6f')]['count']({'where':_0x3d5c31[_0x1d35('0x4c')]})['then'](function(_0x239c4){_0x17e6b5[_0x1d35('0x2e')]=_0x239c4;if(_0x1d91ed['query'][_0x1d35('0x50')]){_0x3d5c31[_0x1d35('0x51')]=[{'model':db[_0x1d35('0x71')],'as':'Contact','required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x1d35('0x39'),_0x1d35('0x72'),_0x1d35('0x73')],'required':![]},{'model':db[_0x1d35('0x74')],'as':_0x1d35('0x75'),'attributes':['id','name',_0x1d35('0x76')],'where':_0x1d91ed[_0x1d35('0x42')][_0x1d35('0x77')]?{'id':_0x1d91ed[_0x1d35('0x42')][_0x1d35('0x77')]}:undefined,'required':_0x1d91ed['query'][_0x1d35('0x77')]?!![]:![]}];}return db[_0x1d35('0x6f')][_0x1d35('0x66')](_0x3d5c31);})['then'](function(_0x4dbce4){_0x17e6b5[_0x1d35('0x52')]=_0x4dbce4;return _0x17e6b5;});}})[_0x1d35('0x1f')](respondWithFilteredResult(_0x133ac5,_0x3d5c31))['catch'](handleError(_0x133ac5,null));};exports[_0x1d35('0x78')]=function(_0x1d1238,_0x2d9351){var _0x4b72f7=_0x1d1238[_0x1d35('0x54')]['id'];var _0x4673d5=_0x1d1238[_0x1d35('0x5a')];var _0x433710=0xc8;var _0x33da34=null;return db['sequelize'][_0x1d35('0x79')]({'isolationLevel':db[_0x1d35('0x7a')][_0x1d35('0x7b')]['ISOLATION_LEVELS'][_0x1d35('0x7c')]},function(_0x2293ab){return db[_0x1d35('0x3e')][_0x1d35('0x65')]({'where':{'id':_0x4b72f7},'transaction':_0x2293ab})[_0x1d35('0x1f')](function(_0x49f79e){if(_0x49f79e){return db[_0x1d35('0x7d')][_0x1d35('0x34')]({'where':{'FaxAccountId':_0x4b72f7},'transaction':_0x2293ab})[_0x1d35('0x1f')](function(){var _0x5455b7=_['map'](_0x4673d5,function(_0x4f2927){_0x4f2927[_0x1d35('0x63')]=_0x4b72f7;return _0x4f2927;});return db[_0x1d35('0x7d')]['bulkCreate'](_0x5455b7,{'transaction':_0x2293ab});});}else{_0x433710=0x194;_0x33da34=[];}});})[_0x1d35('0x1f')](function(){if(_0x433710!==0x194){return db[_0x1d35('0x7d')][_0x1d35('0x7e')]({'where':{'FaxAccountId':_0x4b72f7},'order':_0x1d35('0x7f')})[_0x1d35('0x1f')](function(_0x554d98){_0x33da34=_0x554d98;});}})[_0x1d35('0x53')](function(_0x391452){_0x433710=0x1f4;logger['error'](_0x391452['stack']);if(_0x391452[_0x1d35('0x39')]){delete _0x391452[_0x1d35('0x39')];}_0x33da34=_0x391452;})[_0x1d35('0x80')](function(){if(_0x33da34===null){_0x2d9351['sendStatus'](_0x433710);}else{if(_0x433710===0x1f4){_0x2d9351[_0x1d35('0x29')](_0x433710)[_0x1d35('0x3a')](_0x33da34);}else{_0x2d9351[_0x1d35('0x29')](_0x433710)[_0x1d35('0x2a')](_0x33da34);}}});};exports['getApplications']=function(_0x27e1b2,_0x28cd09,_0x35fc5d){var _0x385b46={};var _0x153afb={};var _0x15f6a6;var _0x268689;return db[_0x1d35('0x3e')][_0x1d35('0x65')]({'where':{'id':_0x27e1b2['params']['id']}})[_0x1d35('0x1f')](handleEntityNotFound(_0x28cd09,null))[_0x1d35('0x1f')](function(_0x84e3ec){if(_0x84e3ec){_0x15f6a6=_0x84e3ec;_0x153afb[_0x1d35('0x40')]=_[_0x1d35('0x55')](db[_0x1d35('0x7d')]['rawAttributes']);_0x153afb[_0x1d35('0x42')]=_[_0x1d35('0x55')](_0x27e1b2[_0x1d35('0x42')]);_0x153afb['filters']=_[_0x1d35('0x44')](_0x153afb[_0x1d35('0x40')],_0x153afb['query']);_0x385b46['attributes']=_[_0x1d35('0x44')](_0x153afb['model'],qs[_0x1d35('0x45')](_0x27e1b2[_0x1d35('0x42')]['fields']));_0x385b46[_0x1d35('0x46')]=_0x385b46[_0x1d35('0x46')]['length']?_0x385b46[_0x1d35('0x46')]:_0x153afb[_0x1d35('0x40')];_0x385b46['order']=qs['sort'](_0x27e1b2['query'][_0x1d35('0x49')]);_0x385b46[_0x1d35('0x4c')]=qs['filters'](_[_0x1d35('0x4a')](_0x27e1b2[_0x1d35('0x42')],_0x153afb[_0x1d35('0x43')]));if(_0x27e1b2[_0x1d35('0x42')]['filter']){_0x385b46[_0x1d35('0x4c')]=_[_0x1d35('0x4d')](_0x385b46[_0x1d35('0x4c')],{'$or':_['map'](_0x385b46['attributes'],function(_0x2a2498){var _0xe07614={};_0xe07614[_0x2a2498]={'$like':'%'+_0x27e1b2['query'][_0x1d35('0x4b')]+'%'};return _0xe07614;})});}_0x385b46=_['merge']({},_0x385b46,_0x27e1b2[_0x1d35('0x4f')]);return _0x15f6a6[_0x1d35('0x81')](_0x385b46);}})[_0x1d35('0x1f')](function(_0x182401){if(_0x182401){_0x268689=_0x182401[_0x1d35('0x57')];if(!_0x27e1b2[_0x1d35('0x42')][_0x1d35('0x47')]('nolimit')){_0x385b46['limit']=qs[_0x1d35('0x2c')](_0x27e1b2[_0x1d35('0x42')][_0x1d35('0x2c')]);_0x385b46[_0x1d35('0x2b')]=qs[_0x1d35('0x2b')](_0x27e1b2[_0x1d35('0x42')][_0x1d35('0x2b')]);}return _0x15f6a6[_0x1d35('0x81')](_0x385b46);}})[_0x1d35('0x1f')](function(_0x2f96d1){if(_0x2f96d1){return _0x2f96d1?{'count':_0x268689,'rows':_0x2f96d1}:null;}})[_0x1d35('0x1f')](respondWithResult(_0x28cd09,null))[_0x1d35('0x53')](handleError(_0x28cd09,null));};function Extension(_0x5d85e4,_0x26e23b,_0x2b2a64,_0x52cd49){this[_0x1d35('0x82')]=_0x1d35('0x83');this[_0x1d35('0x84')]=_0x5d85e4['localstationid'];this['app']=_0x52cd49;this[_0x1d35('0x3f')]=_0x1d35('0x85');this[_0x1d35('0x86')]=_0x1d35('0x87');this[_0x1d35('0x63')]=_0x5d85e4['id'];this[_0x1d35('0x7f')]=_0x26e23b;this[_0x1d35('0x88')]=_0x2b2a64;}function createExtensionsReciveFax(_0x57a3a6){var _0x14d504=0x1;var _0xadf987=[];_0xadf987['push'](new Extension(_0x57a3a6,_0x14d504,'',_0x1d35('0x89')));_0x14d504+=0x1;_0xadf987[_0x1d35('0x8a')](new Extension(_0x57a3a6,_0x14d504,_0x1d35('0x8b'),_0x1d35('0x8c')));_0x14d504+=0x1;for(var _0xd15e42 in _0x57a3a6){if(_0x57a3a6[_0x1d35('0x47')](_0xd15e42)&&(_0xd15e42===_0x1d35('0x8d')||_0xd15e42===_0x1d35('0x8e')||_0xd15e42===_0x1d35('0x8f')||_0xd15e42===_0x1d35('0x90')||_0xd15e42==='headerinfo'||_0xd15e42==='maxrate'||_0xd15e42===_0x1d35('0x91')||_0xd15e42===_0x1d35('0x92')||_0xd15e42===_0x1d35('0x93'))){_0xadf987[_0x1d35('0x8a')](new Extension(_0x57a3a6,_0x14d504,_0x1d35('0x94')+_0xd15e42+')='+_0x57a3a6[_0xd15e42],'Set'));_0x14d504+=0x1;}}_0xadf987[_0x1d35('0x8a')](new Extension(_0x57a3a6,_0x14d504,'6',_0x1d35('0x95')));_0x14d504+=0x1;_0xadf987[_0x1d35('0x8a')](new Extension(_0x57a3a6,_0x14d504,_0x1d35('0x96'),_0x1d35('0x97')));_0x14d504=0x0;return _0xadf987;}exports['addAccountApplications']=function(_0x312f88,_0x5b5658,_0x54e301){var _0x27965b;return db[_0x1d35('0x7a')][_0x1d35('0x79')](function(_0x445620){return db[_0x1d35('0x3e')][_0x1d35('0x59')](_0x312f88['body'],{'transaction':_0x445620})['then'](function(_0x3c7ae8){_0x27965b=_0x3c7ae8[_0x1d35('0x5b')]({'plain':!![]});return db[_0x1d35('0x98')][_0x1d35('0x99')](createExtensionsReciveFax(_0x27965b),{'transaction':_0x445620});});})[_0x1d35('0x1f')](function(){return _0x27965b;})[_0x1d35('0x1f')](respondWithResult(_0x5b5658,null))[_0x1d35('0x53')](handleError(_0x5b5658,null));};exports['updateAccountApplications']=function(_0x19926e,_0x3afe46,_0x410f45){var _0x2eebfb;return db['sequelize'][_0x1d35('0x79')](function(_0x581f8f){return db['FaxAccount'][_0x1d35('0x60')](_0x19926e[_0x1d35('0x5a')],{'where':{'id':_0x19926e['body']['id']},'transaction':_0x581f8f})[_0x1d35('0x1f')](function(_0x4b1ac){return db[_0x1d35('0x98')][_0x1d35('0x34')]({'where':{'FaxAccountId':_0x19926e[_0x1d35('0x5a')]['id']},'transaction':_0x581f8f})[_0x1d35('0x1f')](function(_0x144793){return db[_0x1d35('0x98')][_0x1d35('0x99')](createExtensionsReciveFax(_[_0x1d35('0x9a')](_0x19926e[_0x1d35('0x5a')],[_0x1d35('0x9b'),_0x1d35('0x9c'),_0x1d35('0x9d'),_0x1d35('0x9e'),'TrunkId','ListId'])),{'transaction':_0x581f8f});});});})[_0x1d35('0x1f')](function(){return db[_0x1d35('0x3e')][_0x1d35('0x9f')](_0x19926e[_0x1d35('0x5a')]['id']);})[_0x1d35('0x1f')](respondWithResult(_0x3afe46,null))['catch'](handleError(_0x3afe46,null));};exports[_0x1d35('0xa0')]=function(_0x8f02b9,_0xf5f7e6,_0x2beda1){var _0x583878={'raw':!![],'where':{}};var _0x22088d={};var _0x3ca1ee={'count':0x0,'rows':[]};return db['FaxAccount'][_0x1d35('0x65')]({'where':{'id':_0x8f02b9[_0x1d35('0x54')]['id']}})[_0x1d35('0x1f')](handleEntityNotFound(_0xf5f7e6,null))[_0x1d35('0x1f')](function(_0x212051){if(_0x212051){_0x22088d[_0x1d35('0x40')]=_['keys'](db[_0x1d35('0xa1')]['rawAttributes']);_0x22088d[_0x1d35('0x42')]=_['keys'](_0x8f02b9[_0x1d35('0x42')]);_0x22088d[_0x1d35('0x43')]=_[_0x1d35('0x44')](_0x22088d[_0x1d35('0x40')],_0x22088d[_0x1d35('0x42')]);_0x583878[_0x1d35('0x46')]=_['intersection'](_0x22088d[_0x1d35('0x40')],qs[_0x1d35('0x45')](_0x8f02b9[_0x1d35('0x42')][_0x1d35('0x45')]));_0x583878[_0x1d35('0x46')]=_0x583878[_0x1d35('0x46')][_0x1d35('0x57')]?_0x583878['attributes']:_0x22088d[_0x1d35('0x40')];if(!_0x8f02b9['query'][_0x1d35('0x47')]('nolimit')){_0x583878[_0x1d35('0x2c')]=qs[_0x1d35('0x2c')](_0x8f02b9['query']['limit']);_0x583878[_0x1d35('0x2b')]=qs[_0x1d35('0x2b')](_0x8f02b9[_0x1d35('0x42')][_0x1d35('0x2b')]);}_0x583878[_0x1d35('0x48')]=qs[_0x1d35('0x49')](_0x8f02b9['query'][_0x1d35('0x49')]);_0x583878[_0x1d35('0x4c')]=qs[_0x1d35('0x43')](_[_0x1d35('0x4a')](_0x8f02b9[_0x1d35('0x42')],_0x22088d[_0x1d35('0x43')]));_0x583878[_0x1d35('0x4c')][_0x1d35('0x63')]=_0x212051['id'];if(_0x8f02b9['query']['filter']){_0x583878[_0x1d35('0x4c')]=_[_0x1d35('0x4d')](_0x583878[_0x1d35('0x4c')],{'$or':_[_0x1d35('0x41')](_0x583878[_0x1d35('0x46')],function(_0x1c8280){var _0x1b3088={};_0x1b3088[_0x1c8280]={'$like':'%'+_0x8f02b9[_0x1d35('0x42')][_0x1d35('0x4b')]+'%'};return _0x1b3088;})});}if(_0x8f02b9[_0x1d35('0x42')][_0x1d35('0xa2')]){var _0x391b2d=_0x8f02b9[_0x1d35('0x42')][_0x1d35('0xa2')][_0x1d35('0xa3')](',');var _0x265def={};_0x265def[_0x391b2d[0x0]]={'$gte':moment(_0x391b2d[0x1])['format'](_0x1d35('0xa4'))};_0x583878[_0x1d35('0x4c')]=_['merge'](_0x583878[_0x1d35('0x4c')],_0x265def);}_0x583878=_[_0x1d35('0x4d')]({},_0x583878,_0x8f02b9[_0x1d35('0x4f')]);return db[_0x1d35('0xa1')][_0x1d35('0x2e')]({'where':_0x583878['where']})[_0x1d35('0x1f')](function(_0x4ec165){_0x3ca1ee['count']=_0x4ec165;if(_0x8f02b9[_0x1d35('0x42')]['includeAll']){_0x583878[_0x1d35('0x51')]=[{'all':!![]}];}return db[_0x1d35('0xa1')]['findAll'](_0x583878);})[_0x1d35('0x1f')](function(_0x5bf727){_0x3ca1ee['rows']=_0x5bf727;return _0x3ca1ee;});}})['then'](respondWithFilteredResult(_0xf5f7e6,_0x583878))[_0x1d35('0x53')](handleError(_0xf5f7e6,null));};exports[_0x1d35('0x3a')]=function(_0x56ff0f,_0x4a5c72,_0x152d6b){var _0x5dcd2b,_0x3282cb={},_0x5532be;if(_0x56ff0f[_0x1d35('0x5a')]['to']){_0x5532be=_0x56ff0f['body']['to'][0x0];}return db[_0x1d35('0x3e')][_0x1d35('0x58')]({'where':{'id':_0x56ff0f[_0x1d35('0x54')]['id']},'include':[{'model':db[_0x1d35('0xa5')],'as':_0x1d35('0xa6'),'include':[{'model':db[_0x1d35('0x71')],'as':_0x1d35('0xa7'),'where':{'fax':_0x5532be},'limit':0x1,'order':[['updatedAt',_0x1d35('0xa8')]]}]}]})[_0x1d35('0x1f')](handleEntityNotFound(_0x4a5c72,null))[_0x1d35('0x1f')](function(_0x57ee20){_0x5dcd2b=_0x57ee20;if(_0x56ff0f[_0x1d35('0x5a')][_0x1d35('0xa9')]&&_0x56ff0f[_0x1d35('0x5a')][_0x1d35('0xa9')][_0x1d35('0x57')]){for(var _0x4cb5bf=0x0;_0x4cb5bf<_0x56ff0f[_0x1d35('0x5a')]['attachments'][_0x1d35('0x57')];_0x4cb5bf+=0x1){_0x56ff0f['body'][_0x1d35('0xa9')][_0x4cb5bf]={'filename':_0x56ff0f[_0x1d35('0x5a')][_0x1d35('0xa9')][_0x4cb5bf][_0x1d35('0x39')],'id':_0x56ff0f[_0x1d35('0x5a')][_0x1d35('0xa9')][_0x4cb5bf]['id'],'path':path[_0x1d35('0xaa')](config[_0x1d35('0xab')],_0x1d35('0xac'),_0x56ff0f['body'][_0x1d35('0xa9')][_0x4cb5bf][_0x1d35('0xad')])};}}return respondWithRpcPromise('CheckAfterSend',_0x1d35('0xae'),{'FaxAccountId':_[_0x1d35('0xaf')](_0x56ff0f[_0x1d35('0x54')]['id'])?undefined:_0x56ff0f[_0x1d35('0x54')]['id'],'path':_[_0x1d35('0xaf')](_0x56ff0f[_0x1d35('0x5a')][_0x1d35('0xa9')][0x0][_0x1d35('0x6')])?undefined:_0x56ff0f[_0x1d35('0x5a')][_0x1d35('0xa9')][0x0][_0x1d35('0x6')],'fax':_['isNil'](_0x56ff0f['body']['to'][0x0])?undefined:_0x56ff0f[_0x1d35('0x5a')]['to'][0x0]},client9002);})[_0x1d35('0x1f')](function(){if(_0x5dcd2b){if(_[_0x1d35('0xaf')](_0x56ff0f[_0x1d35('0x5a')][_0x1d35('0xb0')])){_0x56ff0f[_0x1d35('0x5a')][_0x1d35('0xb0')]=util[_0x1d35('0xb1')]('\x22%s\x22\x20<%s>',_0x5dcd2b[_0x1d35('0x39')],_0x5dcd2b[_0x1d35('0xb2')]);}if(_0x5dcd2b[_0x1d35('0xa6')]){if(_0x5dcd2b[_0x1d35('0xa6')][_0x1d35('0xa7')][_0x1d35('0x57')]){return _0x5dcd2b[_0x1d35('0xa6')]['Contacts'][0x0];}else{return db[_0x1d35('0x71')]['create'](_[_0x1d35('0x17')](_0x56ff0f['body'],{'firstName':_0x56ff0f[_0x1d35('0x5a')]['to'][0x0],'phone':_0x56ff0f[_0x1d35('0x5a')]['to'][0x0],'fax':_0x56ff0f['body']['to'][0x0],'ListId':_0x5dcd2b[_0x1d35('0xb3')]}));}}else{throw new Error(_0x1d35('0xb4'));}}else{throw new Error('Send\x20Fax\x20failed');}})['then'](function(_0x1aa7dd){if(_0x1aa7dd){return db[_0x1d35('0x6f')][_0x1d35('0x58')]({'where':{'ContactId':_0x1aa7dd['id'],'closed':![],'FaxAccountId':_0x5dcd2b['id']}})[_0x1d35('0x1f')](function(_0x88f323){if(_0x88f323){return[_0x88f323,![]];}return db[_0x1d35('0x6f')]['create']({'UserId':_0x56ff0f[_0x1d35('0x5e')]['id'],'ContactId':_0x1aa7dd['id'],'FaxAccountId':_0x5dcd2b['id'],'fax':_0x56ff0f[_0x1d35('0x5a')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0x1d35('0x4d')](_0x56ff0f[_0x1d35('0x5a')],{'read':![],'body':_0x56ff0f[_0x1d35('0x5a')][_0x1d35('0xa9')][0x0][_0x1d35('0xb5')],'FaxAccountId':_0x5dcd2b['id'],'UserId':_0x56ff0f[_0x1d35('0x5e')]['id'],'ContactId':_0x1aa7dd['id'],'AttachmentId':_0x56ff0f[_0x1d35('0x5a')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0x1d35('0xa1')],'as':_0x1d35('0xb6')}]})[_0x1d35('0x1f')](function(_0x228c4b){return[_0x228c4b,!![]];});});}else{throw new Error(_0x1d35('0xb7'));}})[_0x1d35('0xb8')](function(_0x73c360,_0x5506f0){if(_0x5506f0){return _0x73c360;}return db[_0x1d35('0xa1')][_0x1d35('0x59')]({'direction':_0x1d35('0xb9'),'read':![],'body':_0x56ff0f[_0x1d35('0x5a')][_0x1d35('0xa9')][0x0][_0x1d35('0xb5')],'FaxAccountId':_0x5dcd2b['id'],'FaxInteractionId':_0x73c360['id'],'UserId':_0x56ff0f[_0x1d35('0x5e')]['id'],'ContactId':_0x73c360[_0x1d35('0xba')],'AttachmentId':_0x56ff0f[_0x1d35('0x5a')]['attachments'][0x0]['id']})[_0x1d35('0x1f')](function(_0x1fa47c){_0x73c360[_0x1d35('0xbb')][_0x1d35('0xb6')]=[];_0x73c360[_0x1d35('0xbb')][_0x1d35('0xb6')][_0x1d35('0x8a')](_0x1fa47c[_0x1d35('0xbb')]);return _0x73c360;});})['then'](function(_0x54f8df){respondWithRpcPromise('SendFax',_0x1d35('0xbc'),{'FaxAccountId':_[_0x1d35('0xaf')](_0x56ff0f[_0x1d35('0x54')]['id'])?undefined:_0x56ff0f['params']['id'],'path':_[_0x1d35('0xaf')](_0x56ff0f['body'][_0x1d35('0xa9')][0x0]['path'])?undefined:_0x56ff0f[_0x1d35('0x5a')][_0x1d35('0xa9')][0x0]['path'],'fax':_[_0x1d35('0xaf')](_0x56ff0f[_0x1d35('0x5a')]['to'][0x0])?undefined:_0x56ff0f[_0x1d35('0x5a')]['to'][0x0],'AttachmentId':_0x56ff0f['body'][_0x1d35('0xa9')][0x0]['id']},client9002)[_0x1d35('0x1f')](function(_0x491dc3){logger['info'](_0x1d35('0xbd'),_0x491dc3);})[_0x1d35('0x53')](function(_0x3875a5){logger['info']('SendFaxRpc,\x20%s',_0x3875a5);});return _0x54f8df;})[_0x1d35('0x1f')](respondWithResult(_0x4a5c72,null))[_0x1d35('0x53')](handleError(_0x4a5c72,null));};exports[_0x1d35('0xbe')]=function(_0x57e042,_0x36503f,_0x2eb041){return db[_0x1d35('0x3e')][_0x1d35('0x58')]({'where':{'id':_0x57e042[_0x1d35('0x54')]['id']}})['then'](handleEntityNotFound(_0x36503f,null))[_0x1d35('0x1f')](function(_0x524d17){if(_0x524d17){return _0x524d17[_0x1d35('0xbe')](_0x57e042[_0x1d35('0x5a')][_0x1d35('0x68')],_[_0x1d35('0x9a')](_0x57e042[_0x1d35('0x5a')],[_0x1d35('0x68'),'id'])||{})['spread'](function(_0x1101d8){for(var _0x1461c4=0x0;_0x1461c4<_0x57e042[_0x1d35('0x5a')]['ids'][_0x1d35('0x57')];_0x1461c4+=0x1){socket['emit'](_0x1d35('0xbf'),{'UserId':Number(_0x57e042['body']['ids'][_0x1461c4]),'FaxAccountId':Number(_0x57e042[_0x1d35('0x54')]['id'])});}return _0x1101d8;});}})[_0x1d35('0x1f')](respondWithResult(_0x36503f,null))['catch'](handleError(_0x36503f,null));};exports[_0x1d35('0xc0')]=function(_0x3bbf1b,_0x3748c2,_0x165c00){return db['FaxAccount'][_0x1d35('0x58')]({'where':{'id':_0x3bbf1b[_0x1d35('0x54')]['id']}})[_0x1d35('0x1f')](handleEntityNotFound(_0x3748c2,null))[_0x1d35('0x1f')](function(_0x119268){if(_0x119268){return _0x119268[_0x1d35('0xc0')](_0x3bbf1b['query'][_0x1d35('0x68')])[_0x1d35('0x1f')](function(){if(_[_0x1d35('0xc1')](_0x3bbf1b['query']['ids'])){for(var _0x48f14b=0x0;_0x48f14b<_0x3bbf1b[_0x1d35('0x42')][_0x1d35('0x68')][_0x1d35('0x57')];_0x48f14b+=0x1){socket[_0x1d35('0xc2')](_0x1d35('0xc3'),{'UserId':Number(_0x3bbf1b[_0x1d35('0x42')]['ids'][_0x48f14b]),'FaxAccountId':Number(_0x3bbf1b[_0x1d35('0x54')]['id'])});}}else{socket[_0x1d35('0xc2')]('userFaxAccount:remove',{'UserId':Number(_0x3bbf1b[_0x1d35('0x42')]['ids']),'FaxAccountId':Number(_0x3bbf1b['params']['id'])});}});}})[_0x1d35('0x1f')](respondWithStatusCode(_0x3748c2,null))[_0x1d35('0x53')](handleError(_0x3748c2,null));};exports[_0x1d35('0xc4')]=function(_0x262322,_0x394cf1,_0x126199){var _0xa1653e={};var _0x1be753={};var _0x3fbb95;var _0x2e1c89;return db[_0x1d35('0x3e')][_0x1d35('0x65')]({'where':{'id':_0x262322[_0x1d35('0x54')]['id']}})[_0x1d35('0x1f')](handleEntityNotFound(_0x394cf1,null))[_0x1d35('0x1f')](function(_0x2bc73d){if(_0x2bc73d){_0x3fbb95=_0x2bc73d;_0x1be753[_0x1d35('0x40')]=_[_0x1d35('0x55')](db['User'][_0x1d35('0x56')]);_0x1be753[_0x1d35('0x42')]=_['keys'](_0x262322[_0x1d35('0x42')]);_0x1be753[_0x1d35('0x43')]=_[_0x1d35('0x44')](_0x1be753[_0x1d35('0x40')],_0x1be753[_0x1d35('0x42')]);_0xa1653e[_0x1d35('0x46')]=_[_0x1d35('0x44')](_0x1be753[_0x1d35('0x40')],qs[_0x1d35('0x45')](_0x262322['query'][_0x1d35('0x45')]));_0xa1653e[_0x1d35('0x46')]=_0xa1653e['attributes'][_0x1d35('0x57')]?_0xa1653e[_0x1d35('0x46')]:_0x1be753[_0x1d35('0x40')];_0xa1653e['order']=qs[_0x1d35('0x49')](_0x262322[_0x1d35('0x42')][_0x1d35('0x49')]);_0xa1653e[_0x1d35('0x4c')]=qs[_0x1d35('0x43')](_[_0x1d35('0x4a')](_0x262322[_0x1d35('0x42')],_0x1be753[_0x1d35('0x43')]));if(_0x262322[_0x1d35('0x42')][_0x1d35('0x4b')]){_0xa1653e[_0x1d35('0x4c')]=_['merge'](_0xa1653e['where'],{'$or':_[_0x1d35('0x41')](_0xa1653e[_0x1d35('0x46')],function(_0x3e7a39){var _0x3a061e={};_0x3a061e[_0x3e7a39]={'$like':'%'+_0x262322['query'][_0x1d35('0x4b')]+'%'};return _0x3a061e;})});}_0xa1653e=_[_0x1d35('0x4d')]({},_0xa1653e,_0x262322[_0x1d35('0x4f')]);return _0x3fbb95[_0x1d35('0xc4')](_0xa1653e);}})[_0x1d35('0x1f')](function(_0xc7802a){if(_0xc7802a){_0x2e1c89=_0xc7802a[_0x1d35('0x57')];if(!_0x262322[_0x1d35('0x42')][_0x1d35('0x47')](_0x1d35('0x6c'))){_0xa1653e[_0x1d35('0x2c')]=qs[_0x1d35('0x2c')](_0x262322[_0x1d35('0x42')][_0x1d35('0x2c')]);_0xa1653e[_0x1d35('0x2b')]=qs['offset'](_0x262322[_0x1d35('0x42')][_0x1d35('0x2b')]);}return _0x3fbb95['getAgents'](_0xa1653e);}})[_0x1d35('0x1f')](function(_0x1bc380){if(_0x1bc380){return _0x1bc380?{'count':_0x2e1c89,'rows':_0x1bc380}:null;}})['then'](respondWithResult(_0x394cf1,null))[_0x1d35('0x53')](handleError(_0x394cf1,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index b3143b2..d7e7c52 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 _0x6858=['emit','hasOwnProperty','hook','events','../../mysqldb','FaxAccount','setMaxListeners','update','remove'];(function(_0x591cd2,_0x32d32d){var _0x4b5038=function(_0x53ce9b){while(--_0x53ce9b){_0x591cd2['push'](_0x591cd2['shift']());}};_0x4b5038(++_0x32d32d);}(_0x6858,0x12c));var _0x8685=function(_0x5e3b1f,_0x2522eb){_0x5e3b1f=_0x5e3b1f-0x0;var _0x2dd88c=_0x6858[_0x5e3b1f];return _0x2dd88c;};'use strict';var EventEmitter=require(_0x8685('0x0'));var FaxAccount=require(_0x8685('0x1'))['db'][_0x8685('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x8685('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8685('0x4'),'afterDestroy':_0x8685('0x5')};function emitEvent(_0x211f5f){return function(_0xa5e13f,_0x29a40c,_0x1f73a2){FaxAccountEvents[_0x8685('0x6')](_0x211f5f+':'+_0xa5e13f['id'],_0xa5e13f);FaxAccountEvents['emit'](_0x211f5f,_0xa5e13f);_0x1f73a2(null);};}for(var e in events){if(events[_0x8685('0x7')](e)){var event=events[e];FaxAccount[_0x8685('0x8')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file +var _0x50a5=['../../mysqldb','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x4d427b,_0x574a2a){var _0x5b324e=function(_0x4df23b){while(--_0x4df23b){_0x4d427b['push'](_0x4d427b['shift']());}};_0x5b324e(++_0x574a2a);}(_0x50a5,0xd1));var _0x550a=function(_0xacb855,_0x5cb963){_0xacb855=_0xacb855-0x0;var _0x4855ec=_0x50a5[_0xacb855];return _0x4855ec;};'use strict';var EventEmitter=require(_0x550a('0x0'));var FaxAccount=require(_0x550a('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x550a('0x2')};function emitEvent(_0x4827e0){return function(_0x357485,_0x2038f7,_0x45ca06){FaxAccountEvents[_0x550a('0x3')](_0x4827e0+':'+_0x357485['id'],_0x357485);FaxAccountEvents[_0x550a('0x3')](_0x4827e0,_0x357485);_0x45ca06(null);};}for(var e in events){if(events[_0x550a('0x4')](e)){var event=events[e];FaxAccount[_0x550a('0x5')](e,emitEvent(event));}}module[_0x550a('0x6')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 5305e39..115bcc2 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 _0xdf98=['../../config/logger','moment','bluebird','request-promise','path','rimraf','./faxAccount.attributes','exports','FaxAccount','lodash','util'];(function(_0x273709,_0x34aa00){var _0x1421bf=function(_0x1e7314){while(--_0x1e7314){_0x273709['push'](_0x273709['shift']());}};_0x1421bf(++_0x34aa00);}(_0xdf98,0x195));var _0x8df9=function(_0x3d1ce2,_0x2a9d26){_0x3d1ce2=_0x3d1ce2-0x0;var _0x43c682=_0xdf98[_0x3d1ce2];return _0x43c682;};'use strict';var _=require(_0x8df9('0x0'));var util=require(_0x8df9('0x1'));var logger=require(_0x8df9('0x2'))('api');var moment=require(_0x8df9('0x3'));var BPromise=require(_0x8df9('0x4'));var rp=require(_0x8df9('0x5'));var fs=require('fs');var path=require(_0x8df9('0x6'));var rimraf=require(_0x8df9('0x7'));var config=require('../../config/environment');var attributes=require(_0x8df9('0x8'));module[_0x8df9('0x9')]=function(_0x5860c1,_0x590282){return _0x5860c1['define'](_0x8df9('0xa'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc74f=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./faxAccount.attributes','exports','FaxAccount','fax_accounts','lodash'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xc74f,0x1c6));var _0xfc74=function(_0x5d1ff0,_0x3752ee){_0x5d1ff0=_0x5d1ff0-0x0;var _0x5c5b01=_0xc74f[_0x5d1ff0];return _0x5c5b01;};'use strict';var _=require(_0xfc74('0x0'));var util=require(_0xfc74('0x1'));var logger=require(_0xfc74('0x2'))(_0xfc74('0x3'));var moment=require(_0xfc74('0x4'));var BPromise=require(_0xfc74('0x5'));var rp=require(_0xfc74('0x6'));var fs=require('fs');var path=require(_0xfc74('0x7'));var rimraf=require('rimraf');var config=require(_0xfc74('0x8'));var attributes=require(_0xfc74('0x9'));module[_0xfc74('0xa')]=function(_0x355665,_0x444f99){return _0x355665['define'](_0xfc74('0xb'),attributes,{'tableName':_0xfc74('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index 641cf58..60741e2 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 _0x73fa=['raw','where','limit','map','include','attributes','model','then','info','NotifyFaxAccount','fax','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','updatedAt','createdAt','CompanyId','ListId','body','from','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','account','CmList','List','CmContact','Contacts','DESC','FaxApplication','Applications','list','applications','priority','asc','length','create','contact','FaxInteraction','find','spread','get','autoclose','push','close','*,*,*,*','created','FaxMessage','ContactId','AttachmentId','User','name','interaction','UserId','unshift','waitForTheAssignedAgent','Start','startRouting','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','register','request','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','GetFaxAccount','FaxAccount','findAll','options'];(function(_0x73d0cc,_0x51041f){var _0x5b2f2c=function(_0xfef3d4){while(--_0xfef3d4){_0x73d0cc['push'](_0x73d0cc['shift']());}};_0x5b2f2c(++_0x51041f);}(_0x73fa,0x95));var _0xa73f=function(_0x2dd615,_0x18099c){_0x2dd615=_0x2dd615-0x0;var _0x5255a4=_0x73fa[_0x2dd615];return _0x5255a4;};'use strict';var _=require(_0xa73f('0x0'));var util=require(_0xa73f('0x1'));var moment=require('moment');var BPromise=require(_0xa73f('0x2'));var rs=require(_0xa73f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa73f('0x4'))['db'];var utils=require(_0xa73f('0x5'));var logger=require(_0xa73f('0x6'))(_0xa73f('0x7'));var config=require(_0xa73f('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa73f('0x9')]({'port':0x232c});config[_0xa73f('0xa')]=_[_0xa73f('0xb')](config['redis'],{'host':_0xa73f('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxAccount.socket')[_0xa73f('0xd')](socket);function respondWithRpcPromise(_0x49e762,_0x5e8e69,_0xd4372b){return new BPromise(function(_0x14ba03,_0x37a09b){return client[_0xa73f('0xe')](_0x49e762,_0xd4372b)['then'](function(_0xf274e9){logger['info'](_0xa73f('0xf'),_0x5e8e69,_0xa73f('0x10'));logger[_0xa73f('0x11')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x5e8e69,_0xa73f('0x10'),JSON['stringify'](_0xf274e9));if(_0xf274e9['error']){if(_0xf274e9[_0xa73f('0x12')][_0xa73f('0x13')]===0x1f4){logger[_0xa73f('0x12')]('FaxAccount,\x20%s,\x20%s',_0x5e8e69,_0xf274e9['error'][_0xa73f('0x14')]);return _0x37a09b(_0xf274e9[_0xa73f('0x12')][_0xa73f('0x14')]);}logger[_0xa73f('0x12')](_0xa73f('0xf'),_0x5e8e69,_0xf274e9[_0xa73f('0x12')][_0xa73f('0x14')]);return _0x14ba03(_0xf274e9[_0xa73f('0x12')][_0xa73f('0x14')]);}else{logger['info'](_0xa73f('0xf'),_0x5e8e69,_0xa73f('0x10'));_0x14ba03(_0xf274e9['result']['message']);}})['catch'](function(_0x5237dd){logger[_0xa73f('0x12')](_0xa73f('0xf'),_0x5e8e69,_0x5237dd);_0x37a09b(_0x5237dd);});});}exports[_0xa73f('0x15')]=function(_0x3d0212){var _0x7dc93c=this;return new Promise(function(_0x5297e5,_0x5cb44f){return db[_0xa73f('0x16')][_0xa73f('0x17')]({'raw':_0x3d0212['options']?_0x3d0212[_0xa73f('0x18')][_0xa73f('0x19')]===undefined?!![]:![]:!![],'where':_0x3d0212[_0xa73f('0x18')]?_0x3d0212[_0xa73f('0x18')][_0xa73f('0x1a')]||null:null,'attributes':_0x3d0212[_0xa73f('0x18')]?_0x3d0212[_0xa73f('0x18')]['attributes']||null:null,'limit':_0x3d0212[_0xa73f('0x18')]?_0x3d0212[_0xa73f('0x18')][_0xa73f('0x1b')]||null:null,'include':_0x3d0212[_0xa73f('0x18')]?_0x3d0212[_0xa73f('0x18')]['include']?_[_0xa73f('0x1c')](_0x3d0212[_0xa73f('0x18')][_0xa73f('0x1d')],function(_0x560da2){return{'model':db[_0x560da2['model']],'as':_0x560da2['as'],'attributes':_0x560da2[_0xa73f('0x1e')],'include':_0x560da2[_0xa73f('0x1d')]?_[_0xa73f('0x1c')](_0x560da2['include'],function(_0x10aa28){return{'model':db[_0x10aa28[_0xa73f('0x1f')]],'as':_0x10aa28['as'],'attributes':_0x10aa28['attributes'],'include':_0x10aa28[_0xa73f('0x1d')]?_[_0xa73f('0x1c')](_0x10aa28[_0xa73f('0x1d')],function(_0x42c7e1){return{'model':db[_0x42c7e1[_0xa73f('0x1f')]],'as':_0x42c7e1['as'],'attributes':_0x42c7e1[_0xa73f('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xa73f('0x20')](function(_0x4bf324){logger[_0xa73f('0x21')]('GetFaxAccount',_0x3d0212);logger[_0xa73f('0x11')](_0xa73f('0x15'),_0x3d0212,JSON['stringify'](_0x4bf324));_0x5297e5(_0x4bf324);})['catch'](function(_0xa3a9e8){logger[_0xa73f('0x12')]('GetFaxAccount',_0xa3a9e8[_0xa73f('0x14')],_0x3d0212);_0x5cb44f(_0x7dc93c[_0xa73f('0x12')](0x1f4,_0xa3a9e8[_0xa73f('0x14')]));});});};exports[_0xa73f('0x22')]=function(_0x3ceaf9,_0x397dca,_0x5903dc){var _0x26152e=this;return new Promise(function(_0x15cab9,_0x17850b){var _0x14e38d={'body':_0x3ceaf9['body'],'channel':_0xa73f('0x23')};var _0x2033e8=[];var _0xe50d81=[];var _0x306182={};return db['CmContact'][_0xa73f('0x24')]()[_0xa73f('0x20')](function(_0x5a967c){if(!_0x5a967c){throw new db[(_0xa73f('0x25'))][(_0xa73f('0x26'))](_0xa73f('0x27'));}_0x2033e8=_[_0xa73f('0x28')](_[_0xa73f('0x29')](_0x5a967c),['createdAt',_0xa73f('0x2a')]);_0xe50d81=_['difference'](_['keys'](_0x5a967c),[_0xa73f('0x2b'),_0xa73f('0x2a'),_0xa73f('0x2c'),_0xa73f('0x2d')]);if(_0x3ceaf9['body']['id']){delete _0x3ceaf9['body']['id'];}if(_['isNil'](_0x3ceaf9[_0xa73f('0x2e')][_0xa73f('0x2f')])){throw new db[(_0xa73f('0x25'))][(_0xa73f('0x26'))]('from\x20is\x20mandatory');}if(_[_0xa73f('0x30')](_0x3ceaf9[_0xa73f('0x2e')][_0xa73f('0x2e')])||_0x3ceaf9[_0xa73f('0x2e')][_0xa73f('0x2e')]===''){throw new db[(_0xa73f('0x25'))][(_0xa73f('0x26'))](_0xa73f('0x31'));}if(_[_0xa73f('0x30')](_0x3ceaf9[_0xa73f('0x2e')][_0xa73f('0x32')])){throw new db['Sequelize'][(_0xa73f('0x26'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xe50d81);}if(!_['includes'](_0xe50d81,_0x3ceaf9[_0xa73f('0x2e')][_0xa73f('0x32')])){throw new db[(_0xa73f('0x25'))][(_0xa73f('0x26'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xe50d81);}_0x306182[_0x3ceaf9[_0xa73f('0x2e')][_0xa73f('0x32')]]=_0x3ceaf9[_0xa73f('0x2e')][_0xa73f('0x2f')];})[_0xa73f('0x20')](function(){return db[_0xa73f('0x16')]['find']({'where':{'id':_0x3ceaf9[_0xa73f('0x33')]['id']},'include':[{'model':db[_0xa73f('0x34')],'as':_0xa73f('0x35'),'include':[{'model':db[_0xa73f('0x36')],'as':_0xa73f('0x37'),'where':_0x306182,'limit':0x1,'order':[[_0xa73f('0x2a'),_0xa73f('0x38')]]}]},{'model':db[_0xa73f('0x39')],'as':'Applications'}]});})[_0xa73f('0x20')](function(_0x2966bb){if(_0x2966bb&&_0x2966bb['List']){var _0x20fc15=_0x2966bb['get']({'plain':!![]});_0x14e38d[_0xa73f('0x33')]=_0x20fc15;_0x14e38d['applications']=_0x20fc15[_0xa73f('0x3a')];_0x14e38d[_0xa73f('0x3b')]=_0x20fc15[_0xa73f('0x35')];_0x14e38d[_0xa73f('0x3c')]=_['orderBy'](_0x14e38d[_0xa73f('0x3c')],[_0xa73f('0x3d')],[_0xa73f('0x3e')]);if(_0x14e38d['account']['Applications']){delete _0x14e38d[_0xa73f('0x33')][_0xa73f('0x3a')];}if(_0x14e38d['account']['List']&&_0x14e38d['account'][_0xa73f('0x35')]['Contacts'][_0xa73f('0x3f')]){return _0x14e38d[_0xa73f('0x33')][_0xa73f('0x35')]['Contacts'][0x0];}var _0xf0703e=_[_0xa73f('0xb')](_0x3ceaf9[_0xa73f('0x2e')],{'firstName':_0x3ceaf9[_0xa73f('0x2e')][_0xa73f('0x2f')],'ListId':_0x20fc15[_0xa73f('0x2d')]});_0xf0703e[_0x3ceaf9[_0xa73f('0x2e')][_0xa73f('0x32')]]=_0x3ceaf9[_0xa73f('0x2e')][_0xa73f('0x2f')];return db[_0xa73f('0x36')][_0xa73f('0x40')](_0xf0703e,{'fields':_0x2033e8,'raw':!![]});}})[_0xa73f('0x20')](function(_0x8dfca4){_0x14e38d[_0xa73f('0x41')]=_0x8dfca4;if(_0x8dfca4){var _0x51395a={'ContactId':_0x8dfca4['id'],'FaxAccountId':_0x3ceaf9[_0xa73f('0x33')]['id'],'fax':_0x8dfca4[_0xa73f('0x23')]};return db[_0xa73f('0x42')][_0xa73f('0x43')]({'where':{'ContactId':_0x8dfca4['id'],'closed':![],'FaxAccountId':_0x3ceaf9[_0xa73f('0x33')]['id']}})['then'](function(_0x19f7c5){if(_0x19f7c5){return[_0x19f7c5,![]];}return db[_0xa73f('0x42')]['create'](_0x51395a)[_0xa73f('0x20')](function(_0x1d2f61){return[_0x1d2f61,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xa73f('0x44')](function(_0x30ba83,_0x45d298){var _0x6655a3=_0x30ba83[_0xa73f('0x45')]({'plain':!![]});if(_0x45d298){if(_0x14e38d['account'][_0xa73f('0x46')]){_0x14e38d[_0xa73f('0x3c')][_0xa73f('0x47')]({'id':0x0,'priority':_0x14e38d['applications']['length']+0x1,'app':_0xa73f('0x48'),'appdata':'unmanaged','interval':_0xa73f('0x49')});}_0x6655a3[_0xa73f('0x4a')]=!![];}else{_0x6655a3['created']=![];}_0x14e38d['interaction']=_0x6655a3;return db[_0xa73f('0x4b')][_0xa73f('0x40')]({'body':_0x3ceaf9[_0xa73f('0x2e')][_0xa73f('0x2e')],'FaxAccountId':_0x3ceaf9[_0xa73f('0x33')]['id'],'FaxInteractionId':_0x30ba83['id'],'direction':'in','ContactId':_0x30ba83[_0xa73f('0x4c')],'AttachmentId':_0x3ceaf9[_0xa73f('0x2e')][_0xa73f('0x4d')]});})[_0xa73f('0x20')](function(_0x53d190){_0x14e38d[_0xa73f('0x14')]=_0x53d190;if(_0x14e38d['interaction']['UserId']){return db[_0xa73f('0x4e')]['find']({'attributes':['id',_0xa73f('0x4f')],'where':{'id':_0x14e38d[_0xa73f('0x50')][_0xa73f('0x51')]}})[_0xa73f('0x20')](function(_0x15a27b){if(_0x15a27b){_0x14e38d[_0xa73f('0x3c')][_0xa73f('0x52')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x15a27b[_0xa73f('0x4f')]+','+(_0x14e38d['account'][_0xa73f('0x53')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xa73f('0x54'),_0xa73f('0x55'),_0x14e38d);});}return respondWithRpcPromise(_0xa73f('0x54'),'startRouting',_0x14e38d);})[_0xa73f('0x20')](function(_0x107e48){_0x15cab9(_0x107e48);})[_0xa73f('0x56')](function(_0x44576d){_0x17850b(_0x26152e[_0xa73f('0x12')](0x1f4,_0x44576d[_0xa73f('0x14')]));});});}; \ No newline at end of file +var _0x2a0f=['request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','findAll','options','raw','where','limit','include','map','attributes','model','GetFaxAccount','NotifyFaxAccount','fax','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','updatedAt','createdAt','CompanyId','ListId','body','from','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','CmList','List','DESC','get','account','applications','Applications','orderBy','priority','asc','length','contact','FaxInteraction','create','spread','autoclose','push','close','unmanaged','*,*,*,*','created','interaction','UserId','User','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','util','moment','bluebird','randomstring','ioredis','rpc','client','http','redis','defaults','localhost','socket.io-emitter','register'];(function(_0x4ef734,_0x5826d){var _0x33a7cb=function(_0x127a2b){while(--_0x127a2b){_0x4ef734['push'](_0x4ef734['shift']());}};_0x33a7cb(++_0x5826d);}(_0x2a0f,0x1f1));var _0xf2a0=function(_0x3f5ad7,_0x573e92){_0x3f5ad7=_0x3f5ad7-0x0;var _0x3380a0=_0x2a0f[_0x3f5ad7];return _0x3380a0;};'use strict';var _=require('lodash');var util=require(_0xf2a0('0x0'));var moment=require(_0xf2a0('0x1'));var BPromise=require(_0xf2a0('0x2'));var rs=require(_0xf2a0('0x3'));var fs=require('fs');var Redis=require(_0xf2a0('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf2a0('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf2a0('0x6')][_0xf2a0('0x7')]({'port':0x232c});config[_0xf2a0('0x8')]=_[_0xf2a0('0x9')](config[_0xf2a0('0x8')],{'host':_0xf2a0('0xa'),'port':0x18eb});var socket=require(_0xf2a0('0xb'))(new Redis(config['redis']));require('./faxAccount.socket')[_0xf2a0('0xc')](socket);function respondWithRpcPromise(_0x50478e,_0x28e655,_0x4e1c55){return new BPromise(function(_0x5e1c7e,_0x5e302f){return client[_0xf2a0('0xd')](_0x50478e,_0x4e1c55)[_0xf2a0('0xe')](function(_0x57a9f9){logger[_0xf2a0('0xf')](_0xf2a0('0x10'),_0x28e655,_0xf2a0('0x11'));logger[_0xf2a0('0x12')](_0xf2a0('0x13'),_0x28e655,'request\x20sent',JSON[_0xf2a0('0x14')](_0x57a9f9));if(_0x57a9f9['error']){if(_0x57a9f9['error']['code']===0x1f4){logger[_0xf2a0('0x15')]('FaxAccount,\x20%s,\x20%s',_0x28e655,_0x57a9f9[_0xf2a0('0x15')][_0xf2a0('0x16')]);return _0x5e302f(_0x57a9f9[_0xf2a0('0x15')][_0xf2a0('0x16')]);}logger[_0xf2a0('0x15')](_0xf2a0('0x10'),_0x28e655,_0x57a9f9[_0xf2a0('0x15')][_0xf2a0('0x16')]);return _0x5e1c7e(_0x57a9f9[_0xf2a0('0x15')]['message']);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0x28e655,_0xf2a0('0x11'));_0x5e1c7e(_0x57a9f9[_0xf2a0('0x17')]['message']);}})[_0xf2a0('0x18')](function(_0xb67c2){logger[_0xf2a0('0x15')]('FaxAccount,\x20%s,\x20%s',_0x28e655,_0xb67c2);_0x5e302f(_0xb67c2);});});}exports['GetFaxAccount']=function(_0x31b68b){var _0x1c0df1=this;return new Promise(function(_0x418c6f,_0x55ce39){return db['FaxAccount'][_0xf2a0('0x19')]({'raw':_0x31b68b[_0xf2a0('0x1a')]?_0x31b68b['options'][_0xf2a0('0x1b')]===undefined?!![]:![]:!![],'where':_0x31b68b[_0xf2a0('0x1a')]?_0x31b68b[_0xf2a0('0x1a')][_0xf2a0('0x1c')]||null:null,'attributes':_0x31b68b[_0xf2a0('0x1a')]?_0x31b68b['options']['attributes']||null:null,'limit':_0x31b68b[_0xf2a0('0x1a')]?_0x31b68b['options'][_0xf2a0('0x1d')]||null:null,'include':_0x31b68b[_0xf2a0('0x1a')]?_0x31b68b['options'][_0xf2a0('0x1e')]?_[_0xf2a0('0x1f')](_0x31b68b[_0xf2a0('0x1a')]['include'],function(_0x3baf79){return{'model':db[_0x3baf79['model']],'as':_0x3baf79['as'],'attributes':_0x3baf79[_0xf2a0('0x20')],'include':_0x3baf79[_0xf2a0('0x1e')]?_[_0xf2a0('0x1f')](_0x3baf79['include'],function(_0x2faf59){return{'model':db[_0x2faf59['model']],'as':_0x2faf59['as'],'attributes':_0x2faf59[_0xf2a0('0x20')],'include':_0x2faf59[_0xf2a0('0x1e')]?_[_0xf2a0('0x1f')](_0x2faf59[_0xf2a0('0x1e')],function(_0x55d5b0){return{'model':db[_0x55d5b0[_0xf2a0('0x21')]],'as':_0x55d5b0['as'],'attributes':_0x55d5b0['attributes']};}):[]};}):[]};}):[]:[]})[_0xf2a0('0xe')](function(_0x5a9892){logger['info'](_0xf2a0('0x22'),_0x31b68b);logger[_0xf2a0('0x12')](_0xf2a0('0x22'),_0x31b68b,JSON['stringify'](_0x5a9892));_0x418c6f(_0x5a9892);})[_0xf2a0('0x18')](function(_0x3821a5){logger[_0xf2a0('0x15')](_0xf2a0('0x22'),_0x3821a5[_0xf2a0('0x16')],_0x31b68b);_0x55ce39(_0x1c0df1[_0xf2a0('0x15')](0x1f4,_0x3821a5[_0xf2a0('0x16')]));});});};exports[_0xf2a0('0x23')]=function(_0x44c16d,_0x482347,_0x13d8ca){var _0x5e8bd7=this;return new Promise(function(_0x19404a,_0xef6adc){var _0x1e2e1c={'body':_0x44c16d['body'],'channel':_0xf2a0('0x24')};var _0x33ed78=[];var _0x8f1fca=[];var _0x5b7dc2={};return db[_0xf2a0('0x25')]['describe']()[_0xf2a0('0xe')](function(_0x344c26){if(!_0x344c26){throw new db[(_0xf2a0('0x26'))][(_0xf2a0('0x27'))](_0xf2a0('0x28'));}_0x33ed78=_[_0xf2a0('0x29')](_[_0xf2a0('0x2a')](_0x344c26),['createdAt',_0xf2a0('0x2b')]);_0x8f1fca=_[_0xf2a0('0x29')](_[_0xf2a0('0x2a')](_0x344c26),[_0xf2a0('0x2c'),_0xf2a0('0x2b'),_0xf2a0('0x2d'),_0xf2a0('0x2e')]);if(_0x44c16d[_0xf2a0('0x2f')]['id']){delete _0x44c16d[_0xf2a0('0x2f')]['id'];}if(_['isNil'](_0x44c16d[_0xf2a0('0x2f')][_0xf2a0('0x30')])){throw new db[(_0xf2a0('0x26'))][(_0xf2a0('0x27'))](_0xf2a0('0x31'));}if(_[_0xf2a0('0x32')](_0x44c16d[_0xf2a0('0x2f')][_0xf2a0('0x2f')])||_0x44c16d[_0xf2a0('0x2f')]['body']===''){throw new db['Sequelize'][(_0xf2a0('0x27'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xf2a0('0x32')](_0x44c16d[_0xf2a0('0x2f')][_0xf2a0('0x33')])){throw new db['Sequelize'][(_0xf2a0('0x27'))](_0xf2a0('0x34')+_0x8f1fca);}if(!_['includes'](_0x8f1fca,_0x44c16d[_0xf2a0('0x2f')][_0xf2a0('0x33')])){throw new db[(_0xf2a0('0x26'))][(_0xf2a0('0x27'))](_0xf2a0('0x35')+_0x8f1fca);}_0x5b7dc2[_0x44c16d[_0xf2a0('0x2f')][_0xf2a0('0x33')]]=_0x44c16d[_0xf2a0('0x2f')][_0xf2a0('0x30')];})[_0xf2a0('0xe')](function(){return db['FaxAccount'][_0xf2a0('0x36')]({'where':{'id':_0x44c16d['account']['id']},'include':[{'model':db[_0xf2a0('0x37')],'as':_0xf2a0('0x38'),'include':[{'model':db[_0xf2a0('0x25')],'as':'Contacts','where':_0x5b7dc2,'limit':0x1,'order':[[_0xf2a0('0x2b'),_0xf2a0('0x39')]]}]},{'model':db['FaxApplication'],'as':'Applications'}]});})[_0xf2a0('0xe')](function(_0x17c423){if(_0x17c423&&_0x17c423[_0xf2a0('0x38')]){var _0x3d3720=_0x17c423[_0xf2a0('0x3a')]({'plain':!![]});_0x1e2e1c[_0xf2a0('0x3b')]=_0x3d3720;_0x1e2e1c[_0xf2a0('0x3c')]=_0x3d3720[_0xf2a0('0x3d')];_0x1e2e1c['list']=_0x3d3720['List'];_0x1e2e1c[_0xf2a0('0x3c')]=_[_0xf2a0('0x3e')](_0x1e2e1c['applications'],[_0xf2a0('0x3f')],[_0xf2a0('0x40')]);if(_0x1e2e1c[_0xf2a0('0x3b')][_0xf2a0('0x3d')]){delete _0x1e2e1c[_0xf2a0('0x3b')][_0xf2a0('0x3d')];}if(_0x1e2e1c[_0xf2a0('0x3b')][_0xf2a0('0x38')]&&_0x1e2e1c[_0xf2a0('0x3b')][_0xf2a0('0x38')]['Contacts'][_0xf2a0('0x41')]){return _0x1e2e1c[_0xf2a0('0x3b')][_0xf2a0('0x38')]['Contacts'][0x0];}var _0xbdb9eb=_[_0xf2a0('0x9')](_0x44c16d[_0xf2a0('0x2f')],{'firstName':_0x44c16d['body'][_0xf2a0('0x30')],'ListId':_0x3d3720[_0xf2a0('0x2e')]});_0xbdb9eb[_0x44c16d[_0xf2a0('0x2f')][_0xf2a0('0x33')]]=_0x44c16d[_0xf2a0('0x2f')][_0xf2a0('0x30')];return db[_0xf2a0('0x25')]['create'](_0xbdb9eb,{'fields':_0x33ed78,'raw':!![]});}})[_0xf2a0('0xe')](function(_0x46e79d){_0x1e2e1c[_0xf2a0('0x42')]=_0x46e79d;if(_0x46e79d){var _0xe7d053={'ContactId':_0x46e79d['id'],'FaxAccountId':_0x44c16d[_0xf2a0('0x3b')]['id'],'fax':_0x46e79d[_0xf2a0('0x24')]};return db[_0xf2a0('0x43')][_0xf2a0('0x36')]({'where':{'ContactId':_0x46e79d['id'],'closed':![],'FaxAccountId':_0x44c16d[_0xf2a0('0x3b')]['id']}})[_0xf2a0('0xe')](function(_0x296c1c){if(_0x296c1c){return[_0x296c1c,![]];}return db[_0xf2a0('0x43')][_0xf2a0('0x44')](_0xe7d053)[_0xf2a0('0xe')](function(_0x7a8942){return[_0x7a8942,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xf2a0('0x45')](function(_0x18b2e0,_0x551903){var _0x2f5612=_0x18b2e0['get']({'plain':!![]});if(_0x551903){if(_0x1e2e1c[_0xf2a0('0x3b')][_0xf2a0('0x46')]){_0x1e2e1c[_0xf2a0('0x3c')][_0xf2a0('0x47')]({'id':0x0,'priority':_0x1e2e1c['applications'][_0xf2a0('0x41')]+0x1,'app':_0xf2a0('0x48'),'appdata':_0xf2a0('0x49'),'interval':_0xf2a0('0x4a')});}_0x2f5612['created']=!![];}else{_0x2f5612[_0xf2a0('0x4b')]=![];}_0x1e2e1c[_0xf2a0('0x4c')]=_0x2f5612;return db['FaxMessage'][_0xf2a0('0x44')]({'body':_0x44c16d[_0xf2a0('0x2f')]['body'],'FaxAccountId':_0x44c16d[_0xf2a0('0x3b')]['id'],'FaxInteractionId':_0x18b2e0['id'],'direction':'in','ContactId':_0x18b2e0['ContactId'],'AttachmentId':_0x44c16d[_0xf2a0('0x2f')]['AttachmentId']});})[_0xf2a0('0xe')](function(_0x41d3aa){_0x1e2e1c[_0xf2a0('0x16')]=_0x41d3aa;if(_0x1e2e1c[_0xf2a0('0x4c')][_0xf2a0('0x4d')]){return db[_0xf2a0('0x4e')][_0xf2a0('0x36')]({'attributes':['id',_0xf2a0('0x4f')],'where':{'id':_0x1e2e1c[_0xf2a0('0x4c')][_0xf2a0('0x4d')]}})[_0xf2a0('0xe')](function(_0x339975){if(_0x339975){_0x1e2e1c['applications'][_0xf2a0('0x50')]({'id':0x0,'priority':0x0,'app':_0xf2a0('0x51'),'appdata':_0x339975[_0xf2a0('0x4f')]+','+(_0x1e2e1c['account'][_0xf2a0('0x52')]||0xa),'interval':_0xf2a0('0x4a')});}return respondWithRpcPromise(_0xf2a0('0x53'),_0xf2a0('0x54'),_0x1e2e1c);});}return respondWithRpcPromise(_0xf2a0('0x53'),_0xf2a0('0x54'),_0x1e2e1c);})[_0xf2a0('0xe')](function(_0x1583ce){_0x19404a(_0x1583ce);})[_0xf2a0('0x18')](function(_0x311cb8){_0xef6adc(_0x5e8bd7[_0xf2a0('0x15')](0x1f4,_0x311cb8[_0xf2a0('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 027a11d..ef43c9e 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 _0xa5c1=['register','length','faxAccount:','./faxAccount.events','save','update','emit','removeListener'];(function(_0x1a7550,_0x1edace){var _0x426e22=function(_0x1c10a1){while(--_0x1c10a1){_0x1a7550['push'](_0x1a7550['shift']());}};_0x426e22(++_0x1edace);}(_0xa5c1,0x1cb));var _0x1a5c=function(_0x3fc1cd,_0x515299){_0x3fc1cd=_0x3fc1cd-0x0;var _0x1ed16f=_0xa5c1[_0x3fc1cd];return _0x1ed16f;};'use strict';var FaxAccountEvents=require(_0x1a5c('0x0'));var events=[_0x1a5c('0x1'),'remove',_0x1a5c('0x2')];function createListener(_0x394e9e,_0x48b314){return function(_0xbf51ca){_0x48b314[_0x1a5c('0x3')](_0x394e9e,_0xbf51ca);};}function removeListener(_0x455504,_0x42c507){return function(){FaxAccountEvents[_0x1a5c('0x4')](_0x455504,_0x42c507);};}exports[_0x1a5c('0x5')]=function(_0x1ab725){for(var _0x34c817=0x0,_0x1be214=events[_0x1a5c('0x6')];_0x34c817<_0x1be214;_0x34c817++){var _0x5da068=events[_0x34c817];var _0x183b33=createListener(_0x1a5c('0x7')+_0x5da068,_0x1ab725);FaxAccountEvents['on'](_0x5da068,_0x183b33);}}; \ No newline at end of file +var _0x88ac=['faxAccount:','./faxAccount.events','update','emit','removeListener','register','length'];(function(_0x15cc30,_0x1d572b){var _0x3857d9=function(_0x212449){while(--_0x212449){_0x15cc30['push'](_0x15cc30['shift']());}};_0x3857d9(++_0x1d572b);}(_0x88ac,0x16d));var _0xc88a=function(_0x455150,_0x274121){_0x455150=_0x455150-0x0;var _0x12ca9c=_0x88ac[_0x455150];return _0x12ca9c;};'use strict';var FaxAccountEvents=require(_0xc88a('0x0'));var events=['save','remove',_0xc88a('0x1')];function createListener(_0x178cd0,_0x569450){return function(_0x2102e6){_0x569450[_0xc88a('0x2')](_0x178cd0,_0x2102e6);};}function removeListener(_0x20a184,_0xb79c54){return function(){FaxAccountEvents[_0xc88a('0x3')](_0x20a184,_0xb79c54);};}exports[_0xc88a('0x4')]=function(_0x3bc893){for(var _0x573a5f=0x0,_0x23674b=events[_0xc88a('0x5')];_0x573a5f<_0x23674b;_0x573a5f++){var _0x2bb5cd=events[_0x573a5f];var _0x60a8c2=createListener(_0xc88a('0x6')+_0x2bb5cd,_0x3bc893);FaxAccountEvents['on'](_0x2bb5cd,_0x60a8c2);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 9fa098b..2b9ea6f 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(_0x58868a,_0x385638){var _0x3ce24d=function(_0x45d7ae){while(--_0x45d7ae){_0x58868a['push'](_0x58868a['shift']());}};_0x3ce24d(++_0x385638);}(_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(_0x20c59f,_0x583d0a){var _0x2b6df8=function(_0x303e11){while(--_0x303e11){_0x20c59f['push'](_0x20c59f['shift']());}};_0x2b6df8(++_0x583d0a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 bc1e074..1de6fb5 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 _0xa000=['STRING','sequelize','exports','noop'];(function(_0x3c4a4f,_0x35d200){var _0x44ba9a=function(_0xe81d66){while(--_0xe81d66){_0x3c4a4f['push'](_0x3c4a4f['shift']());}};_0x44ba9a(++_0x35d200);}(_0xa000,0xdd));var _0x0a00=function(_0x52bce0,_0x2a3a38){_0x52bce0=_0x52bce0-0x0;var _0x134020=_0xa000[_0x52bce0];return _0x134020;};'use strict';var Sequelize=require(_0x0a00('0x0'));module[_0x0a00('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0a00('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x0a00('0x3')]},'interval':{'type':Sequelize[_0x0a00('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x82d9=['noop','TEXT','exports','STRING'];(function(_0x562faa,_0x23adc7){var _0xc70f59=function(_0x2d7dec){while(--_0x2d7dec){_0x562faa['push'](_0x562faa['shift']());}};_0xc70f59(++_0x23adc7);}(_0x82d9,0x132));var _0x982d=function(_0x4da872,_0x11df87){_0x4da872=_0x4da872-0x0;var _0x27588d=_0x82d9[_0x4da872];return _0x27588d;};'use strict';var Sequelize=require('sequelize');module[_0x982d('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x982d('0x1')],'allowNull':![],'defaultValue':_0x982d('0x2')},'appdata':{'type':Sequelize[_0x982d('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x982d('0x1')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 67e8a87..3e21fb0 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 _0x90e3=['create','body','destroy','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','offset','set','json','apply','reject','save','update','then','end','error','stack','name','send','index','map','FaxApplication','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','order','sort','pick','filter','where','VIRTUAL','options','count','includeAll','include','rows','catch','show','params','keys','rawAttributes','merge','find'];(function(_0x478d93,_0x1e986e){var _0x26aef7=function(_0x4ba75d){while(--_0x4ba75d){_0x478d93['push'](_0x478d93['shift']());}};_0x26aef7(++_0x1e986e);}(_0x90e3,0x170));var _0x390e=function(_0x468dac,_0x1ffdb3){_0x468dac=_0x468dac-0x0;var _0x62391=_0x90e3[_0x468dac];return _0x62391;};'use strict';var emlformat=require(_0x390e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x390e('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x390e('0x2'));var Mustache=require(_0x390e('0x3'));var util=require(_0x390e('0x4'));var path=require(_0x390e('0x5'));var sox=require(_0x390e('0x6'));var csv=require(_0x390e('0x7'));var ejs=require(_0x390e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x390e('0x9'));var jsforce=require(_0x390e('0xa'));var deskjs=require(_0x390e('0xb'));var toCsv=require(_0x390e('0x7'));var querystring=require(_0x390e('0xc'));var Papa=require(_0x390e('0xd'));var Redis=require('ioredis');var authService=require(_0x390e('0xe'));var qs=require(_0x390e('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x390e('0x10'))(_0x390e('0x11'));var utils=require(_0x390e('0x12'));var config=require(_0x390e('0x13'));var licenseUtil=require(_0x390e('0x14'));var db=require(_0x390e('0x15'))['db'];function respondWithStatusCode(_0x5025b4,_0x52da4c){_0x52da4c=_0x52da4c||0xcc;return function(_0x17c5f9){if(_0x17c5f9){return _0x5025b4[_0x390e('0x16')](_0x52da4c);}return _0x5025b4[_0x390e('0x17')](_0x52da4c)['end']();};}function respondWithResult(_0x417f12,_0x5eefaf){_0x5eefaf=_0x5eefaf||0xc8;return function(_0x46d5c5){if(_0x46d5c5){return _0x417f12[_0x390e('0x17')](_0x5eefaf)['json'](_0x46d5c5);}};}function respondWithFilteredResult(_0x58775a,_0x10205a){return function(_0x1f5ea6){if(_0x1f5ea6){var _0x4b47da=typeof _0x10205a['offset']===_0x390e('0x18')&&typeof _0x10205a[_0x390e('0x19')]===_0x390e('0x18');var _0x58c85b=_0x1f5ea6['count'];var _0x308bec=_0x4b47da?0x0:_0x10205a[_0x390e('0x1a')];var _0x3a1c92=_0x4b47da?_0x1f5ea6['count']:_0x10205a['offset']+_0x10205a['limit'];var _0x4f7ab3;if(_0x3a1c92>=_0x58c85b){_0x3a1c92=_0x58c85b;_0x4f7ab3=0xc8;}else{_0x4f7ab3=0xce;}_0x58775a['status'](_0x4f7ab3);return _0x58775a[_0x390e('0x1b')]('Content-Range',_0x308bec+'-'+_0x3a1c92+'/'+_0x58c85b)[_0x390e('0x1c')](_0x1f5ea6);}return null;};}function patchUpdates(_0x4d895b){return function(_0x5a3c46){try{jsonpatch[_0x390e('0x1d')](_0x5a3c46,_0x4d895b,!![]);}catch(_0x4c4d27){return BPromise[_0x390e('0x1e')](_0x4c4d27);}return _0x5a3c46[_0x390e('0x1f')]();};}function saveUpdates(_0x4c88e4,_0xff336e){return function(_0x565980){if(_0x565980){return _0x565980[_0x390e('0x20')](_0x4c88e4)[_0x390e('0x21')](function(_0x4900c2){return _0x4900c2;});}return null;};}function removeEntity(_0xa7b8dc,_0x2efa24){return function(_0x26a665){if(_0x26a665){return _0x26a665['destroy']()[_0x390e('0x21')](function(){_0xa7b8dc['status'](0xcc)[_0x390e('0x22')]();});}};}function handleEntityNotFound(_0x5a3585,_0x822171){return function(_0x46988d){if(!_0x46988d){_0x5a3585[_0x390e('0x16')](0x194);}return _0x46988d;};}function handleError(_0x1c4b72,_0xae120b){_0xae120b=_0xae120b||0x1f4;return function(_0x69103a){logger[_0x390e('0x23')](_0x69103a[_0x390e('0x24')]);if(_0x69103a['name']){delete _0x69103a[_0x390e('0x25')];}_0x1c4b72[_0x390e('0x17')](_0xae120b)[_0x390e('0x26')](_0x69103a);};}exports[_0x390e('0x27')]=function(_0x32ab47,_0x96119c){var _0x1325f6={},_0x2ae597={},_0x3baea1={'count':0x0,'rows':[]};var _0x26ea67=_[_0x390e('0x28')](db[_0x390e('0x29')]['rawAttributes'],function(_0x2da483){return{'name':_0x2da483[_0x390e('0x2a')],'type':_0x2da483[_0x390e('0x2b')][_0x390e('0x2c')]};});_0x2ae597[_0x390e('0x2d')]=_['map'](_0x26ea67,_0x390e('0x25'));_0x2ae597[_0x390e('0x2e')]=_['keys'](_0x32ab47[_0x390e('0x2e')]);_0x2ae597[_0x390e('0x2f')]=_['intersection'](_0x2ae597[_0x390e('0x2d')],_0x2ae597[_0x390e('0x2e')]);_0x1325f6[_0x390e('0x30')]=_[_0x390e('0x31')](_0x2ae597[_0x390e('0x2d')],qs['fields'](_0x32ab47['query'][_0x390e('0x32')]));_0x1325f6[_0x390e('0x30')]=_0x1325f6['attributes'][_0x390e('0x33')]?_0x1325f6[_0x390e('0x30')]:_0x2ae597[_0x390e('0x2d')];if(!_0x32ab47[_0x390e('0x2e')]['hasOwnProperty']('nolimit')){_0x1325f6[_0x390e('0x19')]=qs['limit'](_0x32ab47[_0x390e('0x2e')][_0x390e('0x19')]);_0x1325f6[_0x390e('0x1a')]=qs['offset'](_0x32ab47[_0x390e('0x2e')]['offset']);}_0x1325f6[_0x390e('0x34')]=qs[_0x390e('0x35')](_0x32ab47[_0x390e('0x2e')][_0x390e('0x35')]);_0x1325f6['where']=qs[_0x390e('0x2f')](_[_0x390e('0x36')](_0x32ab47[_0x390e('0x2e')],_0x2ae597[_0x390e('0x2f')]),_0x26ea67);if(_0x32ab47[_0x390e('0x2e')][_0x390e('0x37')]){_0x1325f6[_0x390e('0x38')]=_['merge'](_0x1325f6[_0x390e('0x38')],{'$or':_['map'](_0x26ea67,function(_0x455061){if(_0x455061[_0x390e('0x2b')]!==_0x390e('0x39')){var _0x3594b8={};_0x3594b8[_0x455061['name']]={'$like':'%'+_0x32ab47['query']['filter']+'%'};return _0x3594b8;}})});}_0x1325f6=_['merge']({},_0x1325f6,_0x32ab47[_0x390e('0x3a')]);var _0x42a3b6={'where':_0x1325f6[_0x390e('0x38')]};return db[_0x390e('0x29')][_0x390e('0x3b')](_0x42a3b6)[_0x390e('0x21')](function(_0xaf1f77){_0x3baea1[_0x390e('0x3b')]=_0xaf1f77;if(_0x32ab47[_0x390e('0x2e')][_0x390e('0x3c')]){_0x1325f6[_0x390e('0x3d')]=[{'all':!![]}];}return db[_0x390e('0x29')]['findAll'](_0x1325f6);})[_0x390e('0x21')](function(_0x3b97c2){_0x3baea1[_0x390e('0x3e')]=_0x3b97c2;return _0x3baea1;})[_0x390e('0x21')](respondWithFilteredResult(_0x96119c,_0x1325f6))[_0x390e('0x3f')](handleError(_0x96119c,null));};exports[_0x390e('0x40')]=function(_0x489c26,_0x50dacb){var _0x174e3a={'raw':!![],'where':{'id':_0x489c26[_0x390e('0x41')]['id']}},_0x203c8f={};_0x203c8f[_0x390e('0x2d')]=_[_0x390e('0x42')](db['FaxApplication'][_0x390e('0x43')]);_0x203c8f[_0x390e('0x2e')]=_[_0x390e('0x42')](_0x489c26['query']);_0x203c8f[_0x390e('0x2f')]=_[_0x390e('0x31')](_0x203c8f[_0x390e('0x2d')],_0x203c8f['query']);_0x174e3a[_0x390e('0x30')]=_[_0x390e('0x31')](_0x203c8f[_0x390e('0x2d')],qs[_0x390e('0x32')](_0x489c26[_0x390e('0x2e')][_0x390e('0x32')]));_0x174e3a[_0x390e('0x30')]=_0x174e3a[_0x390e('0x30')]['length']?_0x174e3a[_0x390e('0x30')]:_0x203c8f[_0x390e('0x2d')];if(_0x489c26[_0x390e('0x2e')][_0x390e('0x3c')]){_0x174e3a['include']=[{'all':!![]}];}_0x174e3a=_[_0x390e('0x44')]({},_0x174e3a,_0x489c26['options']);return db[_0x390e('0x29')][_0x390e('0x45')](_0x174e3a)['then'](handleEntityNotFound(_0x50dacb,null))[_0x390e('0x21')](respondWithResult(_0x50dacb,null))['catch'](handleError(_0x50dacb,null));};exports['create']=function(_0x13ef5b,_0x4733ca){return db[_0x390e('0x29')][_0x390e('0x46')](_0x13ef5b[_0x390e('0x47')],{})[_0x390e('0x21')](respondWithResult(_0x4733ca,0xc9))[_0x390e('0x3f')](handleError(_0x4733ca,null));};exports[_0x390e('0x20')]=function(_0x243fcf,_0x37f1ec){if(_0x243fcf['body']['id']){delete _0x243fcf[_0x390e('0x47')]['id'];}return db[_0x390e('0x29')][_0x390e('0x45')]({'where':{'id':_0x243fcf[_0x390e('0x41')]['id']}})[_0x390e('0x21')](handleEntityNotFound(_0x37f1ec,null))[_0x390e('0x21')](saveUpdates(_0x243fcf[_0x390e('0x47')],null))['then'](respondWithResult(_0x37f1ec,null))[_0x390e('0x3f')](handleError(_0x37f1ec,null));};exports[_0x390e('0x48')]=function(_0x48a10c,_0x363cee){return db[_0x390e('0x29')][_0x390e('0x45')]({'where':{'id':_0x48a10c[_0x390e('0x41')]['id']}})['then'](handleEntityNotFound(_0x363cee,null))['then'](removeEntity(_0x363cee,null))[_0x390e('0x3f')](handleError(_0x363cee,null));}; \ No newline at end of file +var _0x648e=['params','includeAll','find','body','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','FaxApplication','rawAttributes','fieldName','key','model','map','keys','filters','intersection','attributes','query','fields','length','order','sort','pick','filter','where','merge','type','VIRTUAL','options','include','findAll','rows','catch','show'];(function(_0x54a38b,_0x110ea2){var _0x1f8837=function(_0x3bdb73){while(--_0x3bdb73){_0x54a38b['push'](_0x54a38b['shift']());}};_0x1f8837(++_0x110ea2);}(_0x648e,0x1c1));var _0xe648=function(_0x587b3e,_0x2c419f){_0x587b3e=_0x587b3e-0x0;var _0x53c66f=_0x648e[_0x587b3e];return _0x53c66f;};'use strict';var emlformat=require(_0xe648('0x0'));var rimraf=require(_0xe648('0x1'));var zipdir=require(_0xe648('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe648('0x3'));var moment=require(_0xe648('0x4'));var BPromise=require(_0xe648('0x5'));var Mustache=require(_0xe648('0x6'));var util=require(_0xe648('0x7'));var path=require(_0xe648('0x8'));var sox=require(_0xe648('0x9'));var csv=require(_0xe648('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe648('0xb'));var _=require(_0xe648('0xc'));var squel=require(_0xe648('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe648('0xa'));var querystring=require(_0xe648('0xe'));var Papa=require(_0xe648('0xf'));var Redis=require('ioredis');var authService=require(_0xe648('0x10'));var qs=require(_0xe648('0x11'));var as=require(_0xe648('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe648('0x13'))('api');var utils=require(_0xe648('0x14'));var config=require(_0xe648('0x15'));var licenseUtil=require(_0xe648('0x16'));var db=require(_0xe648('0x17'))['db'];function respondWithStatusCode(_0x46d1d2,_0xf51380){_0xf51380=_0xf51380||0xcc;return function(_0x56dfe6){if(_0x56dfe6){return _0x46d1d2[_0xe648('0x18')](_0xf51380);}return _0x46d1d2[_0xe648('0x19')](_0xf51380)['end']();};}function respondWithResult(_0x50071e,_0x40a604){_0x40a604=_0x40a604||0xc8;return function(_0x51482c){if(_0x51482c){return _0x50071e['status'](_0x40a604)[_0xe648('0x1a')](_0x51482c);}};}function respondWithFilteredResult(_0x4b0aba,_0x3eaf71){return function(_0x500867){if(_0x500867){var _0x5b6ea8=typeof _0x3eaf71[_0xe648('0x1b')]==='undefined'&&typeof _0x3eaf71[_0xe648('0x1c')]===_0xe648('0x1d');var _0x3a3887=_0x500867[_0xe648('0x1e')];var _0x257606=_0x5b6ea8?0x0:_0x3eaf71[_0xe648('0x1b')];var _0x36ecdc=_0x5b6ea8?_0x500867[_0xe648('0x1e')]:_0x3eaf71[_0xe648('0x1b')]+_0x3eaf71['limit'];var _0x243f46;if(_0x36ecdc>=_0x3a3887){_0x36ecdc=_0x3a3887;_0x243f46=0xc8;}else{_0x243f46=0xce;}_0x4b0aba[_0xe648('0x19')](_0x243f46);return _0x4b0aba[_0xe648('0x1f')](_0xe648('0x20'),_0x257606+'-'+_0x36ecdc+'/'+_0x3a3887)[_0xe648('0x1a')](_0x500867);}return null;};}function patchUpdates(_0x3c622b){return function(_0x30d327){try{jsonpatch[_0xe648('0x21')](_0x30d327,_0x3c622b,!![]);}catch(_0x342460){return BPromise[_0xe648('0x22')](_0x342460);}return _0x30d327['save']();};}function saveUpdates(_0x1f5908,_0x3da74f){return function(_0x4aac7a){if(_0x4aac7a){return _0x4aac7a[_0xe648('0x23')](_0x1f5908)[_0xe648('0x24')](function(_0x39f6b0){return _0x39f6b0;});}return null;};}function removeEntity(_0x1cc23b,_0xed8aef){return function(_0x213080){if(_0x213080){return _0x213080['destroy']()[_0xe648('0x24')](function(){_0x1cc23b[_0xe648('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1dc91b,_0xb94856){return function(_0x2c9beb){if(!_0x2c9beb){_0x1dc91b[_0xe648('0x18')](0x194);}return _0x2c9beb;};}function handleError(_0x1f41a9,_0x38a4fa){_0x38a4fa=_0x38a4fa||0x1f4;return function(_0x26b971){logger[_0xe648('0x25')](_0x26b971[_0xe648('0x26')]);if(_0x26b971[_0xe648('0x27')]){delete _0x26b971[_0xe648('0x27')];}_0x1f41a9[_0xe648('0x19')](_0x38a4fa)[_0xe648('0x28')](_0x26b971);};}exports[_0xe648('0x29')]=function(_0x18e681,_0x552ca3){var _0x6e3225={},_0xfb2d3b={},_0x196f7a={'count':0x0,'rows':[]};var _0x23c6da=_['map'](db[_0xe648('0x2a')][_0xe648('0x2b')],function(_0x3a3432){return{'name':_0x3a3432[_0xe648('0x2c')],'type':_0x3a3432['type'][_0xe648('0x2d')]};});_0xfb2d3b[_0xe648('0x2e')]=_[_0xe648('0x2f')](_0x23c6da,_0xe648('0x27'));_0xfb2d3b['query']=_[_0xe648('0x30')](_0x18e681['query']);_0xfb2d3b[_0xe648('0x31')]=_[_0xe648('0x32')](_0xfb2d3b[_0xe648('0x2e')],_0xfb2d3b['query']);_0x6e3225[_0xe648('0x33')]=_['intersection'](_0xfb2d3b[_0xe648('0x2e')],qs['fields'](_0x18e681[_0xe648('0x34')][_0xe648('0x35')]));_0x6e3225[_0xe648('0x33')]=_0x6e3225[_0xe648('0x33')][_0xe648('0x36')]?_0x6e3225[_0xe648('0x33')]:_0xfb2d3b[_0xe648('0x2e')];if(!_0x18e681[_0xe648('0x34')]['hasOwnProperty']('nolimit')){_0x6e3225[_0xe648('0x1c')]=qs[_0xe648('0x1c')](_0x18e681[_0xe648('0x34')][_0xe648('0x1c')]);_0x6e3225[_0xe648('0x1b')]=qs['offset'](_0x18e681['query'][_0xe648('0x1b')]);}_0x6e3225[_0xe648('0x37')]=qs[_0xe648('0x38')](_0x18e681[_0xe648('0x34')][_0xe648('0x38')]);_0x6e3225['where']=qs[_0xe648('0x31')](_[_0xe648('0x39')](_0x18e681['query'],_0xfb2d3b[_0xe648('0x31')]),_0x23c6da);if(_0x18e681[_0xe648('0x34')][_0xe648('0x3a')]){_0x6e3225[_0xe648('0x3b')]=_[_0xe648('0x3c')](_0x6e3225[_0xe648('0x3b')],{'$or':_[_0xe648('0x2f')](_0x23c6da,function(_0x569a79){if(_0x569a79[_0xe648('0x3d')]!==_0xe648('0x3e')){var _0x3a2621={};_0x3a2621[_0x569a79['name']]={'$like':'%'+_0x18e681[_0xe648('0x34')]['filter']+'%'};return _0x3a2621;}})});}_0x6e3225=_['merge']({},_0x6e3225,_0x18e681[_0xe648('0x3f')]);var _0x1f19db={'where':_0x6e3225[_0xe648('0x3b')]};return db['FaxApplication'][_0xe648('0x1e')](_0x1f19db)[_0xe648('0x24')](function(_0x466ac8){_0x196f7a[_0xe648('0x1e')]=_0x466ac8;if(_0x18e681[_0xe648('0x34')]['includeAll']){_0x6e3225[_0xe648('0x40')]=[{'all':!![]}];}return db[_0xe648('0x2a')][_0xe648('0x41')](_0x6e3225);})['then'](function(_0x5f509c){_0x196f7a[_0xe648('0x42')]=_0x5f509c;return _0x196f7a;})[_0xe648('0x24')](respondWithFilteredResult(_0x552ca3,_0x6e3225))[_0xe648('0x43')](handleError(_0x552ca3,null));};exports[_0xe648('0x44')]=function(_0x4ea3d2,_0x137fd1){var _0x3759ac={'raw':!![],'where':{'id':_0x4ea3d2[_0xe648('0x45')]['id']}},_0x3ce096={};_0x3ce096['model']=_[_0xe648('0x30')](db['FaxApplication'][_0xe648('0x2b')]);_0x3ce096['query']=_[_0xe648('0x30')](_0x4ea3d2[_0xe648('0x34')]);_0x3ce096[_0xe648('0x31')]=_['intersection'](_0x3ce096[_0xe648('0x2e')],_0x3ce096[_0xe648('0x34')]);_0x3759ac['attributes']=_['intersection'](_0x3ce096[_0xe648('0x2e')],qs[_0xe648('0x35')](_0x4ea3d2['query'][_0xe648('0x35')]));_0x3759ac[_0xe648('0x33')]=_0x3759ac[_0xe648('0x33')][_0xe648('0x36')]?_0x3759ac[_0xe648('0x33')]:_0x3ce096['model'];if(_0x4ea3d2[_0xe648('0x34')][_0xe648('0x46')]){_0x3759ac[_0xe648('0x40')]=[{'all':!![]}];}_0x3759ac=_['merge']({},_0x3759ac,_0x4ea3d2['options']);return db[_0xe648('0x2a')][_0xe648('0x47')](_0x3759ac)[_0xe648('0x24')](handleEntityNotFound(_0x137fd1,null))[_0xe648('0x24')](respondWithResult(_0x137fd1,null))[_0xe648('0x43')](handleError(_0x137fd1,null));};exports['create']=function(_0x17646e,_0x315b2e){return db['FaxApplication']['create'](_0x17646e['body'],{})['then'](respondWithResult(_0x315b2e,0xc9))[_0xe648('0x43')](handleError(_0x315b2e,null));};exports[_0xe648('0x23')]=function(_0x315627,_0x2ced4e){if(_0x315627[_0xe648('0x48')]['id']){delete _0x315627[_0xe648('0x48')]['id'];}return db[_0xe648('0x2a')][_0xe648('0x47')]({'where':{'id':_0x315627[_0xe648('0x45')]['id']}})['then'](handleEntityNotFound(_0x2ced4e,null))[_0xe648('0x24')](saveUpdates(_0x315627[_0xe648('0x48')],null))[_0xe648('0x24')](respondWithResult(_0x2ced4e,null))[_0xe648('0x43')](handleError(_0x2ced4e,null));};exports[_0xe648('0x49')]=function(_0x8edecf,_0x3fc987){return db['FaxApplication'][_0xe648('0x47')]({'where':{'id':_0x8edecf['params']['id']}})[_0xe648('0x24')](handleEntityNotFound(_0x3fc987,null))[_0xe648('0x24')](removeEntity(_0x3fc987,null))[_0xe648('0x43')](handleError(_0x3fc987,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index bbf5089..b7c1030 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 _0xa9d0=['FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./faxApplication.attributes','exports','define'];(function(_0x1f1db8,_0x280d89){var _0x54eb31=function(_0x4fdc61){while(--_0x4fdc61){_0x1f1db8['push'](_0x1f1db8['shift']());}};_0x54eb31(++_0x280d89);}(_0xa9d0,0xc7));var _0x0a9d=function(_0xdf048b,_0xbf0d51){_0xdf048b=_0xdf048b-0x0;var _0x13a09c=_0xa9d0[_0xdf048b];return _0x13a09c;};'use strict';var _=require(_0x0a9d('0x0'));var util=require(_0x0a9d('0x1'));var logger=require('../../config/logger')(_0x0a9d('0x2'));var moment=require(_0x0a9d('0x3'));var BPromise=require(_0x0a9d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9d('0x5'));var rimraf=require(_0x0a9d('0x6'));var config=require(_0x0a9d('0x7'));var attributes=require(_0x0a9d('0x8'));module[_0x0a9d('0x9')]=function(_0xc3bd8f,_0x3333e6){return _0xc3bd8f[_0x0a9d('0xa')](_0x0a9d('0xb'),attributes,{'tableName':_0x0a9d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0a9d('0xd'),'collate':_0x0a9d('0xe')});}; \ No newline at end of file +var _0xdfe2=['request-promise','path','../../config/environment','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1126df,_0x5d0348){var _0x13bc70=function(_0x5b6ef5){while(--_0x5b6ef5){_0x1126df['push'](_0x1126df['shift']());}};_0x13bc70(++_0x5d0348);}(_0xdfe2,0x186));var _0x2dfe=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xdfe2[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x2dfe('0x0'));var util=require(_0x2dfe('0x1'));var logger=require(_0x2dfe('0x2'))(_0x2dfe('0x3'));var moment=require(_0x2dfe('0x4'));var BPromise=require(_0x2dfe('0x5'));var rp=require(_0x2dfe('0x6'));var fs=require('fs');var path=require(_0x2dfe('0x7'));var rimraf=require('rimraf');var config=require(_0x2dfe('0x8'));var attributes=require('./faxApplication.attributes');module['exports']=function(_0x41111c,_0x2ace51){return _0x41111c['define']('FaxApplication',attributes,{'tableName':_0x2dfe('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2dfe('0xa'),'collate':_0x2dfe('0xb')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 2d1fe42..2edb4c9 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 _0x78d2=['randomstring','ioredis','../../mysqldb','../../config/logger','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateFaxApplication','FaxApplication','body','options','raw','where','attributes','lodash','util','moment','bluebird'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x78d2,0x9e));var _0x278d=function(_0x528f23,_0x213659){_0x528f23=_0x528f23-0x0;var _0x556acd=_0x78d2[_0x528f23];return _0x556acd;};'use strict';var _=require(_0x278d('0x0'));var util=require(_0x278d('0x1'));var moment=require(_0x278d('0x2'));var BPromise=require(_0x278d('0x3'));var rs=require(_0x278d('0x4'));var fs=require('fs');var Redis=require(_0x278d('0x5'));var db=require(_0x278d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x278d('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2625db,_0xc4e2ed,_0x5eeb96){return new BPromise(function(_0x956af1,_0x290ec4){return client[_0x278d('0x8')](_0x2625db,_0x5eeb96)[_0x278d('0x9')](function(_0x5200fc){logger[_0x278d('0xa')](_0x278d('0xb'),_0xc4e2ed,_0x278d('0xc'));logger[_0x278d('0xd')](_0x278d('0xe'),_0xc4e2ed,_0x278d('0xc'),JSON[_0x278d('0xf')](_0x5200fc));if(_0x5200fc[_0x278d('0x10')]){if(_0x5200fc[_0x278d('0x10')]['code']===0x1f4){logger[_0x278d('0x10')](_0x278d('0xb'),_0xc4e2ed,_0x5200fc[_0x278d('0x10')]['message']);return _0x290ec4(_0x5200fc[_0x278d('0x10')][_0x278d('0x11')]);}logger[_0x278d('0x10')](_0x278d('0xb'),_0xc4e2ed,_0x5200fc['error'][_0x278d('0x11')]);return _0x956af1(_0x5200fc[_0x278d('0x10')][_0x278d('0x11')]);}else{logger[_0x278d('0xa')](_0x278d('0xb'),_0xc4e2ed,_0x278d('0xc'));_0x956af1(_0x5200fc[_0x278d('0x12')]['message']);}})[_0x278d('0x13')](function(_0xc1622d){logger[_0x278d('0x10')](_0x278d('0xb'),_0xc4e2ed,_0xc1622d);_0x290ec4(_0xc1622d);});});}exports[_0x278d('0x14')]=function(_0x447822){var _0x54ae06=this;return new Promise(function(_0x150304,_0x4c67db){return db[_0x278d('0x15')]['update'](_0x447822[_0x278d('0x16')],{'raw':_0x447822[_0x278d('0x17')]?_0x447822['options'][_0x278d('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x447822['options']?_0x447822[_0x278d('0x17')][_0x278d('0x19')]||null:null,'attributes':_0x447822['options']?_0x447822['options'][_0x278d('0x1a')]||null:null,'limit':_0x447822[_0x278d('0x17')]?_0x447822[_0x278d('0x17')]['limit']||null:null})[_0x278d('0x9')](function(_0x308680){logger['info'](_0x278d('0x14'),_0x447822);logger[_0x278d('0xd')](_0x278d('0x14'),_0x447822,JSON[_0x278d('0xf')](_0x308680));_0x150304(_0x308680);})[_0x278d('0x13')](function(_0x533121){logger[_0x278d('0x10')](_0x278d('0x14'),_0x533121[_0x278d('0x11')],_0x447822);_0x4c67db(_0x54ae06[_0x278d('0x10')](0x1f4,_0x533121['message']));});});}; \ No newline at end of file +var _0xfcb1=['../../config/logger','../../config/environment','jayson/promise','client','http','then','FaxApplication,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','catch','FaxApplication','body','options','raw','where','attributes','limit','info','UpdateFaxApplication','util','moment','bluebird','../../mysqldb'];(function(_0xfcb5f,_0x4394af){var _0x3afaa4=function(_0x4ef84b){while(--_0x4ef84b){_0xfcb5f['push'](_0xfcb5f['shift']());}};_0x3afaa4(++_0x4394af);}(_0xfcb1,0x134));var _0x1fcb=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xfcb1[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x1fcb('0x0'));var moment=require(_0x1fcb('0x1'));var BPromise=require(_0x1fcb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1fcb('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x1fcb('0x4'))('rpc');var config=require(_0x1fcb('0x5'));var jayson=require(_0x1fcb('0x6'));var client=jayson[_0x1fcb('0x7')][_0x1fcb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5d9c12,_0x5d5e82,_0x4d25fd){return new BPromise(function(_0x23e91a,_0x5ebe1c){return client['request'](_0x5d9c12,_0x4d25fd)[_0x1fcb('0x9')](function(_0x208e10){logger['info'](_0x1fcb('0xa'),_0x5d5e82,'request\x20sent');logger[_0x1fcb('0xb')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x5d5e82,_0x1fcb('0xc'),JSON[_0x1fcb('0xd')](_0x208e10));if(_0x208e10['error']){if(_0x208e10[_0x1fcb('0xe')]['code']===0x1f4){logger[_0x1fcb('0xe')](_0x1fcb('0xa'),_0x5d5e82,_0x208e10[_0x1fcb('0xe')][_0x1fcb('0xf')]);return _0x5ebe1c(_0x208e10[_0x1fcb('0xe')][_0x1fcb('0xf')]);}logger[_0x1fcb('0xe')](_0x1fcb('0xa'),_0x5d5e82,_0x208e10[_0x1fcb('0xe')][_0x1fcb('0xf')]);return _0x23e91a(_0x208e10[_0x1fcb('0xe')][_0x1fcb('0xf')]);}else{logger['info'](_0x1fcb('0xa'),_0x5d5e82,'request\x20sent');_0x23e91a(_0x208e10['result'][_0x1fcb('0xf')]);}})[_0x1fcb('0x10')](function(_0x29850d){logger[_0x1fcb('0xe')](_0x1fcb('0xa'),_0x5d5e82,_0x29850d);_0x5ebe1c(_0x29850d);});});}exports['UpdateFaxApplication']=function(_0x1c843b){var _0x1573ab=this;return new Promise(function(_0x2472f9,_0x59eaa3){return db[_0x1fcb('0x11')]['update'](_0x1c843b[_0x1fcb('0x12')],{'raw':_0x1c843b[_0x1fcb('0x13')]?_0x1c843b[_0x1fcb('0x13')][_0x1fcb('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c843b['options']?_0x1c843b[_0x1fcb('0x13')][_0x1fcb('0x15')]||null:null,'attributes':_0x1c843b[_0x1fcb('0x13')]?_0x1c843b[_0x1fcb('0x13')][_0x1fcb('0x16')]||null:null,'limit':_0x1c843b[_0x1fcb('0x13')]?_0x1c843b[_0x1fcb('0x13')][_0x1fcb('0x17')]||null:null})['then'](function(_0x44fcd6){logger[_0x1fcb('0x18')](_0x1fcb('0x19'),_0x1c843b);logger[_0x1fcb('0xb')]('UpdateFaxApplication',_0x1c843b,JSON[_0x1fcb('0xd')](_0x44fcd6));_0x2472f9(_0x44fcd6);})[_0x1fcb('0x10')](function(_0x419863){logger['error'](_0x1fcb('0x19'),_0x419863['message'],_0x1c843b);_0x59eaa3(_0x1573ab[_0x1fcb('0xe')](0x1f4,_0x419863[_0x1fcb('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 4a5fd45..363fcf9 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 _0xbaf0=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','util','path'];(function(_0x5a8ba3,_0x31fbb2){var _0x5d03e6=function(_0xeb5ee){while(--_0xeb5ee){_0x5a8ba3['push'](_0x5a8ba3['shift']());}};_0x5d03e6(++_0x31fbb2);}(_0xbaf0,0x12a));var _0x0baf=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xbaf0[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['show']);router[_0x0baf('0xd')]('/',auth['isAuthenticated'](),controller[_0x0baf('0xe')]);router[_0x0baf('0xf')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x10')]);router[_0x0baf('0x11')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);module[_0x0baf('0x13')]=router; \ No newline at end of file +var _0xd7d1=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x21c068,_0x369d6a){var _0x5cf199=function(_0x2c0159){while(--_0x2c0159){_0x21c068['push'](_0x21c068['shift']());}};_0x5cf199(++_0x369d6a);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x521df9,_0x5e3460){_0x521df9=_0x521df9-0x0;var _0x2eddfe=_0xd7d1[_0x521df9];return _0x2eddfe;};'use strict';var multer=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var path=require(_0x1d7d('0x2'));var timeout=require(_0x1d7d('0x3'));var express=require(_0x1d7d('0x4'));var router=express[_0x1d7d('0x5')]();var fs_extra=require(_0x1d7d('0x6'));var auth=require(_0x1d7d('0x7'));var interaction=require(_0x1d7d('0x8'));var config=require(_0x1d7d('0x9'));var controller=require(_0x1d7d('0xa'));router[_0x1d7d('0xb')]('/',auth[_0x1d7d('0xc')](),controller['index']);router[_0x1d7d('0xb')](_0x1d7d('0xd'),auth[_0x1d7d('0xc')](),controller[_0x1d7d('0xe')]);router[_0x1d7d('0xf')]('/',auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x10')]);router[_0x1d7d('0x11')](_0x1d7d('0xd'),auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x12')]);router['delete'](_0x1d7d('0xd'),auth['isAuthenticated'](),controller[_0x1d7d('0x13')]);module[_0x1d7d('0x14')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index e7d36dc..c632cf5 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 _0x10d0=['DATE','STRING','out','ENUM','sequelize','exports'];(function(_0xc5775d,_0x3701ab){var _0x3b4edd=function(_0x37c3cb){while(--_0x37c3cb){_0xc5775d['push'](_0xc5775d['shift']());}};_0x3b4edd(++_0x3701ab);}(_0x10d0,0x13c));var _0x010d=function(_0x483d24,_0x434fad){_0x483d24=_0x483d24-0x0;var _0x51f7cb=_0x10d0[_0x483d24];return _0x51f7cb;};'use strict';var Sequelize=require(_0x010d('0x0'));module[_0x010d('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x010d('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x010d('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x010d('0x3')]},'read1stAt':{'type':Sequelize[_0x010d('0x2')]},'fax':{'type':Sequelize[_0x010d('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x010d('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x010d('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x010d('0x5')]('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xc772=['BOOLEAN','DATE','STRING','ENUM','out','exports'];(function(_0x1614ee,_0x45f8ca){var _0x366687=function(_0x40ae60){while(--_0x40ae60){_0x1614ee['push'](_0x1614ee['shift']());}};_0x366687(++_0x45f8ca);}(_0xc772,0xd1));var _0x2c77=function(_0x33c338,_0x33b70c){_0x33c338=_0x33c338-0x0;var _0x53b359=_0xc772[_0x33c338];return _0x53b359;};'use strict';var Sequelize=require('sequelize');module[_0x2c77('0x0')]={'closed':{'type':Sequelize[_0x2c77('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2c77('0x2')]},'disposition':{'type':Sequelize[_0x2c77('0x3')]},'secondDisposition':{'type':Sequelize[_0x2c77('0x3')]},'thirdDisposition':{'type':Sequelize[_0x2c77('0x3')]},'note':{'type':Sequelize[_0x2c77('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0x2c77('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x2c77('0x4')]('in',_0x2c77('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x2c77('0x4')]('in',_0x2c77('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index 4a93363..d519bac 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 _0x25de=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','sendStatus','error','name','send','Users','fullname','TagIds','Tags','forEach','push','catch','talking','answered','total','closed','UserId','waiting','index','FaxInteraction','rawAttributes','type','key','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','tools_tags','u.id','ui.FaxInteractionId','from','left_join','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','conditions','length','find','unreadMessages','value','having','`\x20>\x200','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','Tag','split','union','User','buildExpression','body','some','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','QueryTypes','SELECT','clone','contactName','DESC','t.id\x20IN\x20?','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getFaxAccounts','isEmpty','i.FaxAccountId\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','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','FaxInteractionId','all','rows','params','includeAll','create','describe','ids','omit','getMessages','findOne','FaxMessage','merge','format','YYYY-MM-DD\x20HH:mm:ss','options','include','findAll','addTags','spread','emit','faxInteractionTags:save','removeTags','files','tmp','join','server','transcript-%d-%s.zip','Attachment','Messages','get','mkdirSync','basename','existsSync','pipe','createWriteStream','resolve','log','err','unlinkSync','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','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x5d7227,_0x12aebe){var _0x15ac55=function(_0x58d13e){while(--_0x58d13e){_0x5d7227['push'](_0x5d7227['shift']());}};_0x15ac55(++_0x12aebe);}(_0x25de,0xc6));var _0xe25d=function(_0x2e6c19,_0x131233){_0x2e6c19=_0x2e6c19-0x0;var _0x52885d=_0x25de[_0x2e6c19];return _0x52885d;};'use strict';var emlformat=require(_0xe25d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe25d('0x1'));var rp=require(_0xe25d('0x2'));var moment=require(_0xe25d('0x3'));var BPromise=require(_0xe25d('0x4'));var Mustache=require(_0xe25d('0x5'));var util=require(_0xe25d('0x6'));var path=require(_0xe25d('0x7'));var sox=require(_0xe25d('0x8'));var csv=require(_0xe25d('0x9'));var ejs=require(_0xe25d('0xa'));var fs=require('fs');var fs_extra=require(_0xe25d('0xb'));var _=require(_0xe25d('0xc'));var squel=require(_0xe25d('0xd'));var crypto=require(_0xe25d('0xe'));var jsforce=require(_0xe25d('0xf'));var deskjs=require(_0xe25d('0x10'));var toCsv=require(_0xe25d('0x9'));var querystring=require(_0xe25d('0x11'));var Papa=require(_0xe25d('0x12'));var Redis=require('ioredis');var authService=require(_0xe25d('0x13'));var qs=require(_0xe25d('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe25d('0x15'));var logger=require(_0xe25d('0x16'))(_0xe25d('0x17'));var utils=require(_0xe25d('0x18'));var config=require(_0xe25d('0x19'));var licenseUtil=require(_0xe25d('0x1a'));var db=require(_0xe25d('0x1b'))['db'];config['redis']=_[_0xe25d('0x1c')](config[_0xe25d('0x1d')],{'host':_0xe25d('0x1e'),'port':0x18eb});var socket=require(_0xe25d('0x1f'))(new Redis(config[_0xe25d('0x1d')]));require(_0xe25d('0x20'))[_0xe25d('0x21')](socket);function respondWithStatusCode(_0x6a5da0,_0x2bec2c){_0x2bec2c=_0x2bec2c||0xcc;return function(_0x53b84f){if(_0x53b84f){return _0x6a5da0['sendStatus'](_0x2bec2c);}return _0x6a5da0[_0xe25d('0x22')](_0x2bec2c)[_0xe25d('0x23')]();};}function respondWithResult(_0x30a5a5,_0xac2498){_0xac2498=_0xac2498||0xc8;return function(_0x1a9cb1){if(_0x1a9cb1){return _0x30a5a5[_0xe25d('0x22')](_0xac2498)[_0xe25d('0x24')](_0x1a9cb1);}};}function respondWithFilteredResult(_0x1c3392,_0x3ff07b){return function(_0x4d3f19){if(_0x4d3f19){var _0x5cee58=typeof _0x3ff07b[_0xe25d('0x25')]===_0xe25d('0x26')&&typeof _0x3ff07b[_0xe25d('0x27')]==='undefined';var _0x5c525b=_0x4d3f19[_0xe25d('0x28')];var _0x5be1d3=_0x5cee58?0x0:_0x3ff07b[_0xe25d('0x25')];var _0x5a75c3=_0x5cee58?_0x4d3f19[_0xe25d('0x28')]:_0x3ff07b[_0xe25d('0x25')]+_0x3ff07b[_0xe25d('0x27')];var _0x4b933e;if(_0x5a75c3>=_0x5c525b){_0x5a75c3=_0x5c525b;_0x4b933e=0xc8;}else{_0x4b933e=0xce;}_0x1c3392[_0xe25d('0x22')](_0x4b933e);return _0x1c3392[_0xe25d('0x29')]('Content-Range',_0x5be1d3+'-'+_0x5a75c3+'/'+_0x5c525b)[_0xe25d('0x24')](_0x4d3f19);}return null;};}function patchUpdates(_0x483482){return function(_0x567e2f){try{jsonpatch[_0xe25d('0x2a')](_0x567e2f,_0x483482,!![]);}catch(_0x335441){return BPromise[_0xe25d('0x2b')](_0x335441);}return _0x567e2f[_0xe25d('0x2c')]();};}function saveUpdates(_0x4452d9,_0x2bdb0f){return function(_0x1a5c8a){if(_0x1a5c8a){return _0x1a5c8a[_0xe25d('0x2d')](_0x4452d9)[_0xe25d('0x2e')](function(_0x36b055){return _0x36b055;});}return null;};}function removeEntity(_0x6a45e2,_0x34986c){return function(_0x3ebc89){if(_0x3ebc89){return _0x3ebc89[_0xe25d('0x2f')]()[_0xe25d('0x2e')](function(){_0x6a45e2[_0xe25d('0x22')](0xcc)[_0xe25d('0x23')]();});}};}function handleEntityNotFound(_0x4452de,_0xa05eaf){return function(_0x49cdc8){if(!_0x49cdc8){_0x4452de[_0xe25d('0x30')](0x194);}return _0x49cdc8;};}function handleError(_0x80c4ea,_0x2f1530){_0x2f1530=_0x2f1530||0x1f4;return function(_0x5492ed){logger[_0xe25d('0x31')](_0x5492ed['stack']);if(_0x5492ed['name']){delete _0x5492ed[_0xe25d('0x32')];}_0x80c4ea[_0xe25d('0x22')](_0x2f1530)[_0xe25d('0x33')](_0x5492ed);};}function getInteractionUsers(_0x5579af,_0x5dfba7){return new BPromise(function(_0x4dc05b,_0x1ef582){try{if(_0x5dfba7[_0x5579af['id']]){_0x5579af[_0xe25d('0x34')]=_['map'](_0x5dfba7[_0x5579af['id']],function(_0x3d050e){return{'id':_0x3d050e['id'],'fullname':_0x3d050e[_0xe25d('0x35')]};});}}catch(_0x5586d3){_0x1ef582(_0x5586d3);}_0x4dc05b(_0x5579af);});}function getInteractionTags(_0x4f54a6,_0x58d1aa){return new BPromise(function(_0x5408e2,_0x5cf28f){try{if(_0x4f54a6[_0xe25d('0x36')]){_0x4f54a6[_0xe25d('0x37')]=[];_0x4f54a6[_0xe25d('0x36')]['split'](',')[_0xe25d('0x38')](function(_0x3e3ce6){_0x4f54a6[_0xe25d('0x37')][_0xe25d('0x39')](_0x58d1aa[_0x3e3ce6]);});}delete _0x4f54a6[_0xe25d('0x36')];}catch(_0x877494){_0x5cf28f(_0x877494);}_0x5408e2(_0x4f54a6);});}function updateFaxInteraction(_0x19b43b,_0x388f85,_0x13654a){return new BPromise(function(_0x3e012b,_0x337676){return getInteractionUsers(_0x19b43b,_0x13654a)[_0xe25d('0x2e')](function(_0x115695){return getInteractionTags(_0x115695,_0x388f85);})['then'](function(_0x481fd2){return getStateInteraction(_0x481fd2);})[_0xe25d('0x2e')](function(_0x2ea630){_0x3e012b(_0x2ea630);})[_0xe25d('0x3a')](function(_0x4dea6c){_0x337676(_0x4dea6c);});});}function getStateInteraction(_0x551204){return new BPromise(function(_0x1f2705){_0x551204['waiting']=0x0;_0x551204[_0xe25d('0x3b')]=0x0;_0x551204[_0xe25d('0x3c')]=0x0;_0x551204['unmanaged']=0x0;_0x551204[_0xe25d('0x3d')]=0x0;if(!_0x551204[_0xe25d('0x3e')]&&!_0x551204[_0xe25d('0x3f')]){_0x551204[_0xe25d('0x40')]+=0x1;}if(!_0x551204[_0xe25d('0x3e')]&&_0x551204[_0xe25d('0x3f')]){_0x551204[_0xe25d('0x3b')]+=0x1;if(_0x551204[_0xe25d('0x40')]){_0x551204[_0xe25d('0x40')]-=0x1;}}if(_0x551204[_0xe25d('0x3e')]&&_0x551204[_0xe25d('0x3f')]){_0x551204['answered']+=0x1;if(_0x551204[_0xe25d('0x3b')]){_0x551204['talking']-=0x1;}}if(_0x551204[_0xe25d('0x3e')]&&!_0x551204['UserId']){_0x551204['unmanaged']+=0x1;if(_0x551204['waiting']){_0x551204[_0xe25d('0x40')]-=0x1;}}_0x551204[_0xe25d('0x3d')]+=0x1;_0x1f2705(_0x551204);});}exports[_0xe25d('0x41')]=function(_0x1127d7,_0x13ccf5){var _0x42b5f6={},_0x5a00f9={},_0x549ebd={'count':0x0,'rows':[]};var _0x25d6ef=_['map'](db[_0xe25d('0x42')][_0xe25d('0x43')],function(_0x919a9b){return{'name':_0x919a9b['fieldName'],'type':_0x919a9b[_0xe25d('0x44')][_0xe25d('0x45')]};});_0x5a00f9['model']=_[_0xe25d('0x46')](_0x25d6ef,'name');_0x5a00f9[_0xe25d('0x47')]=_[_0xe25d('0x48')](_0x1127d7['query']);_0x5a00f9[_0xe25d('0x49')]=_[_0xe25d('0x4a')](_0x5a00f9[_0xe25d('0x4b')],_0x5a00f9[_0xe25d('0x47')]);_0x42b5f6[_0xe25d('0x4c')]=_['intersection'](_0x5a00f9[_0xe25d('0x4b')],qs[_0xe25d('0x4d')](_0x1127d7[_0xe25d('0x47')][_0xe25d('0x4d')]));_0x42b5f6['attributes']=_0x42b5f6[_0xe25d('0x4c')]['length']?_0x42b5f6[_0xe25d('0x4c')]:_0x5a00f9[_0xe25d('0x4b')];if(!_0x1127d7[_0xe25d('0x47')][_0xe25d('0x4e')](_0xe25d('0x4f'))){_0x42b5f6[_0xe25d('0x27')]=qs[_0xe25d('0x27')](_0x1127d7[_0xe25d('0x47')][_0xe25d('0x27')]);_0x42b5f6[_0xe25d('0x25')]=qs[_0xe25d('0x25')](_0x1127d7[_0xe25d('0x47')]['offset']);}_0x42b5f6[_0xe25d('0x50')]=qs[_0xe25d('0x51')](_0x1127d7[_0xe25d('0x47')]['sort']);_0x42b5f6[_0xe25d('0x52')]=qs['filters'](_[_0xe25d('0x53')](_0x1127d7[_0xe25d('0x47')],_0x5a00f9[_0xe25d('0x49')]),_0x25d6ef);var _0x238e53=[];var _0x4bd31f=squel[_0xe25d('0x54')]()[_0xe25d('0x55')]('id')['field']('name')[_0xe25d('0x55')](_0xe25d('0x56'))['from'](_0xe25d('0x57'));var _0x2b4dcb=squel[_0xe25d('0x54')]()['field'](_0xe25d('0x58'))[_0xe25d('0x55')]('u.fullname')[_0xe25d('0x55')](_0xe25d('0x59'))[_0xe25d('0x5a')]('user_has_fax_interactions','ui')[_0xe25d('0x5b')]('users','u',_0xe25d('0x5c'));var _0x74994=squel[_0xe25d('0x54')]()['from']('fax_interactions','i')[_0xe25d('0x5b')](_0xe25d('0x5d'),'c',_0xe25d('0x5e'))[_0xe25d('0x5b')]('users','o',_0xe25d('0x5f'))[_0xe25d('0x5b')](_0xe25d('0x60'),'a',_0xe25d('0x61'))['left_join']('fax_messages','me','me.FaxInteractionId\x20=\x20i.id')[_0xe25d('0x5b')](_0xe25d('0x62'),'it',_0xe25d('0x63'))[_0xe25d('0x5b')](_0xe25d('0x57'),'t',_0xe25d('0x64'));var _0x5a156d=squel[_0xe25d('0x65')]();var _0x4a643e=[];var _0x374328=squel[_0xe25d('0x65')]();var _0x363bc0;if(_0x1127d7[_0xe25d('0x47')]['search']){_0x363bc0=as[_0xe25d('0x66')](_0x1127d7[_0xe25d('0x47')][_0xe25d('0x67')]);var _0x514de3=_0x363bc0['sqlOperator'];for(var _0x311dfa=0x0;_0x311dfa<_0x363bc0[_0xe25d('0x68')][_0xe25d('0x69')];_0x311dfa++){var _0x51270a=_0x363bc0[_0xe25d('0x68')][_0x311dfa];var _0x215eea='i';var _0xd9d88f=_[_0xe25d('0x6a')](_0x25d6ef,[_0xe25d('0x32'),_0x51270a[_0xe25d('0x55')]]);if(!_0xd9d88f){switch(_0x51270a[_0xe25d('0x55')]){case _0xe25d('0x6b'):if(_0x51270a[_0xe25d('0x6c')]==0x1){_0x74994[_0xe25d('0x6d')]('`'+_0x51270a[_0xe25d('0x55')]+'`\x20=\x200');}else{_0x74994[_0xe25d('0x6d')]('`'+_0x51270a[_0xe25d('0x55')]+_0xe25d('0x6e'));}break;case'Contact':if(_0x51270a[_0xe25d('0x6f')]===_0xe25d('0x70')){if(_0x51270a['value']['split']('\x20')[_0xe25d('0x69')]>0x1){_0x5a156d[_0x514de3]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xe25d('0x71')](_0x51270a[_0xe25d('0x6c')]),null);}else{var _0x204cd8='%'+_0x51270a['value']+'%';_0x5a156d[_0x514de3](_0xe25d('0x72'),_0x204cd8,_0x204cd8,_0x204cd8);}}else{_0xd9d88f=_[_0xe25d('0x6a')](_0x25d6ef,[_0xe25d('0x32'),_0xe25d('0x73')]);_0x51270a['field']=_0xe25d('0x73');_0x41e71c=as['buildExpression'](_0x215eea,_0xd9d88f[_0xe25d('0x44')],_0x51270a);_0x5a156d[_0x514de3](_0x41e71c[_0xe25d('0x74')],_0x41e71c[_0xe25d('0x6c')][_0xe25d('0x75')],_0x41e71c[_0xe25d('0x6c')]['end']);}break;case _0xe25d('0x76'):var _0x3f0662=_0x51270a[_0xe25d('0x6c')][_0xe25d('0x77')](',')[_0xe25d('0x46')](function(_0x23b3ae){return Number(_0x23b3ae);});_0x3f0662['forEach'](function(_0x423e6e){_0x374328['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x423e6e+',%');});_0x4a643e=_[_0xe25d('0x78')](_0x4a643e,_0x3f0662);break;case _0xe25d('0x79'):if(_0x51270a[_0xe25d('0x6f')]===_0xe25d('0x70')){_0x5a156d[_0x514de3]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x51270a[_0xe25d('0x6c')]+'%',null);}else{_0xd9d88f=_[_0xe25d('0x6a')](_0x25d6ef,[_0xe25d('0x32'),_0xe25d('0x3f')]);_0x51270a[_0xe25d('0x55')]=_0xe25d('0x3f');_0x41e71c=as[_0xe25d('0x7a')](_0x215eea,_0xd9d88f[_0xe25d('0x44')],_0x51270a);_0x5a156d[_0x514de3](_0x41e71c[_0xe25d('0x74')],_0x41e71c[_0xe25d('0x6c')]['start'],_0x41e71c[_0xe25d('0x6c')][_0xe25d('0x23')]);}break;case _0xe25d('0x7b'):_0x41e71c=as['buildExpression']('me',null,_0x51270a);_0x5a156d[_0x514de3](_0x41e71c['text'],_0x41e71c[_0xe25d('0x6c')]['start'],_0x41e71c['value']['end']);break;}}else{var _0x41e71c=as[_0xe25d('0x7a')](_0x215eea,_0xd9d88f['type'],_0x51270a);_0x5a156d[_0x514de3](_0x41e71c['text'],_0x41e71c[_0xe25d('0x6c')][_0xe25d('0x75')],_0x41e71c['value'][_0xe25d('0x23')]);}}}else{var _0x37c5c9=_(_0x1127d7[_0xe25d('0x47')])[_0xe25d('0x48')]()[_0xe25d('0x46')](function(_0x549c94){return _[_0xe25d('0x7c')](_0x25d6ef,['name',_0x549c94])?_0x549c94:undefined;})['compact']()[_0xe25d('0x6c')]();if(!_['isEmpty'](_0x37c5c9)){_0x37c5c9[_0xe25d('0x38')](function(_0x3dccd3){if(_0x3dccd3===_0xe25d('0x7d')){_0x74994[_0xe25d('0x52')](_0xe25d('0x7e'),[][_0xe25d('0x7f')](_0x1127d7['query'][_0x3dccd3]));}else if(_0x3dccd3===_0xe25d('0x80')){var _0x15d914=JSON[_0xe25d('0x81')](_0x1127d7['query'][_0x3dccd3])[_0xe25d('0x82')];var _0x4e8cc0=JSON[_0xe25d('0x81')](_0x1127d7['query'][_0x3dccd3])[_0xe25d('0x83')];_0x74994['where'](_0xe25d('0x84'),_0x15d914,_0x4e8cc0);}else{if(_0x1127d7['query'][_0x3dccd3]===_0xe25d('0x85')){_0x74994['where']('i.'+_0x3dccd3+_0xe25d('0x86'));}else{_0x74994['where']('i.'+_0x3dccd3+'\x20=\x20?',_0x1127d7[_0xe25d('0x47')][_0x3dccd3]);}}});}if(_0x1127d7[_0xe25d('0x47')][_0xe25d('0x87')]){if(_0x1127d7[_0xe25d('0x47')][_0xe25d('0x87')]==0x1){_0x74994['having'](_0xe25d('0x88'));}else{_0x74994['having'](_0xe25d('0x89'));}}if(_0x1127d7[_0xe25d('0x47')][_0xe25d('0x8a')]){_0x4a643e=_[_0xe25d('0x8b')](_0x1127d7[_0xe25d('0x47')]['tag'])?_0x1127d7[_0xe25d('0x47')][_0xe25d('0x8a')]:new Array(_0x1127d7['query'][_0xe25d('0x8a')]);_0x4a643e[_0xe25d('0x38')](function(_0x7c85bb){_0x374328['or'](_0xe25d('0x8c'),'%,'+_0x7c85bb+',%');});}if(_0x1127d7[_0xe25d('0x47')][_0xe25d('0x8d')]){var _0x28d291=_0x1127d7[_0xe25d('0x47')][_0xe25d('0x8d')][_0xe25d('0x8e')]('\x5c','\x5c\x5c')[_0xe25d('0x8e')](/'/g,'\x27\x27');if(qs[_0xe25d('0x8f')](_0x28d291)){_0x5a156d['or'](_0xe25d('0x90'),_0x28d291+'%')['or']('i.fax\x20LIKE\x20?',_0x28d291+'%');}_0x5a156d['or'](_0xe25d('0x91'),_0x28d291+'%');}}_0x74994[_0xe25d('0x52')](_0x5a156d);_0x74994['group']('i.id');var _0x5d57e7={'type':db['Sequelize'][_0xe25d('0x92')][_0xe25d('0x93')],'raw':!![]};var _0x114430=_0x74994[_0xe25d('0x94')]();_0x114430['field']('i.id');_0x114430[_0xe25d('0x55')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xe25d('0x6b'));if(_0x42b5f6[_0xe25d('0x50')]){_0x42b5f6[_0xe25d('0x50')][_0xe25d('0x38')](function(_0xc0f5d1){var _0x262616=_0xc0f5d1[0x0]===_0xe25d('0x95')?_0xc0f5d1[0x0]:'i.'+_0xc0f5d1[0x0];_0x74994[_0xe25d('0x50')](_0x262616,_0xc0f5d1[0x1]===_0xe25d('0x96')?![]:!![]);});}if(!_['isEmpty'](_0x4a643e)){_0x74994['having'](_0x374328);_0x114430[_0xe25d('0x52')](_0xe25d('0x97'),_0x4a643e);}BPromise['resolve']()[_0xe25d('0x2e')](function(){if(!_0x363bc0){if(_0x1127d7['query']['FaxAccountId'])return;_0x114430['where']('i.FaxAccountId\x20IS\x20NOT\x20NULL');_0x74994[_0xe25d('0x52')](_0xe25d('0x98'));return;}if(_0x1127d7[_0xe25d('0x99')][_0xe25d('0x9a')]!==_0xe25d('0x9b'))return;return _0x1127d7[_0xe25d('0x99')][_0xe25d('0x9c')]({'attributes':['id'],'raw':!![]})[_0xe25d('0x2e')](function(_0x59770f){if(_[_0xe25d('0x9d')](_0x59770f)){_0x114430[_0xe25d('0x52')](_0xe25d('0x9e'));_0x74994['where'](_0xe25d('0x9e'));}else{_0x114430[_0xe25d('0x52')](_0xe25d('0x7e'),_[_0xe25d('0x46')](_0x59770f,'id'));_0x74994[_0xe25d('0x52')](_0xe25d('0x7e'),_[_0xe25d('0x46')](_0x59770f,'id'));}});})[_0xe25d('0x2e')](function(){if(_0x1127d7[_0xe25d('0x99')][_0xe25d('0x9a')]===_0xe25d('0x9b')&&!_0x363bc0&&!_0x1127d7[_0xe25d('0x47')]['FaxAccountId'])return[];return db[_0xe25d('0x9f')][_0xe25d('0x47')](_0x114430[_0xe25d('0xa0')](),_0x5d57e7);})['then'](function(_0x1933f5){_0x549ebd['count']=_0x1933f5[_0xe25d('0x69')];if(_0x549ebd[_0xe25d('0x28')]===0x0)return[];return db['sequelize']['query'](_0x4bd31f[_0xe25d('0xa0')](),_0x5d57e7)[_0xe25d('0x2e')](function(_0x5f5a4c){_0x238e53=_[_0xe25d('0xa1')](_0x5f5a4c,'id');_0x5d57e7=_['merge'](_0x5d57e7,{'model':db[_0xe25d('0x42')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1127d7[_0xe25d('0x47')][_0xe25d('0x4d')]){_0x42b5f6[_0xe25d('0x4c')][_0xe25d('0x38')](function(_0xb57feb){_0x74994[_0xe25d('0x55')]('i.'+_0xb57feb);});}else{_0x74994[_0xe25d('0x55')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xe25d('0x6b'));_0x74994[_0xe25d('0x55')](_0xe25d('0xa2'),_0xe25d('0xa3'));_0x74994[_0xe25d('0x55')]('a.mandatoryDisposition',_0xe25d('0xa4'));_0x74994[_0xe25d('0x55')](_0xe25d('0xa5'),_0xe25d('0x95'));_0x74994[_0xe25d('0x55')]('i.*');_0x74994['field'](_0xe25d('0xa6'),_0xe25d('0xa7'));_0x74994[_0xe25d('0x55')](_0xe25d('0xa8'),'Contact.lastName');_0x74994['field'](_0xe25d('0xa9'),_0xe25d('0xaa'));_0x74994[_0xe25d('0x55')]('c.phone',_0xe25d('0xab'));_0x74994[_0xe25d('0x55')]('c.mobile',_0xe25d('0xac'));_0x74994[_0xe25d('0x55')](_0xe25d('0xad'),_0xe25d('0xae'));_0x74994[_0xe25d('0x55')](_0xe25d('0xaf'),'Owner.fullname');_0x74994['field'](_0xe25d('0xb0'),_0xe25d('0xb1'));_0x74994[_0xe25d('0x55')](_0xe25d('0xb2'),'TagIds');}if(_0x42b5f6[_0xe25d('0x27')])_0x74994[_0xe25d('0x27')](_0x42b5f6[_0xe25d('0x27')]);if(_0x42b5f6['offset'])_0x74994['offset'](_0x42b5f6['offset']);return db[_0xe25d('0x9f')][_0xe25d('0x47')](_0x74994[_0xe25d('0xa0')](),_0x5d57e7);})[_0xe25d('0x2e')](function(_0x4dacb7){if(_0x4dacb7[_0xe25d('0x69')]>0x0)_0x2b4dcb[_0xe25d('0x52')](_0xe25d('0xb3'),_[_0xe25d('0x46')](_0x4dacb7,'id'));return db[_0xe25d('0x9f')][_0xe25d('0x47')](_0x2b4dcb[_0xe25d('0xa0')](),_0x5d57e7)['then'](function(_0x3ddb50){var _0x5e4739=_['groupBy'](_0x3ddb50,_0xe25d('0xb4'));var _0x106c61=[];_0x4dacb7[_0xe25d('0x38')](function(_0x225774){_0x106c61[_0xe25d('0x39')](updateFaxInteraction(_0x225774,_0x238e53,_0x5e4739));});return BPromise[_0xe25d('0xb5')](_0x106c61);});});})['then'](function(_0x29fccc){_0x549ebd[_0xe25d('0xb6')]=_0x29fccc;return _0x549ebd;})['then'](respondWithFilteredResult(_0x13ccf5,_0x42b5f6))['catch'](handleError(_0x13ccf5,null));};exports['show']=function(_0x57c807,_0x427a99){var _0x56a193={'raw':![],'where':{'id':_0x57c807[_0xe25d('0xb7')]['id']}},_0x19018b={};_0x19018b['model']=_[_0xe25d('0x48')](db[_0xe25d('0x42')]['rawAttributes']);_0x19018b[_0xe25d('0x47')]=_['keys'](_0x57c807[_0xe25d('0x47')]);_0x19018b['filters']=_[_0xe25d('0x4a')](_0x19018b['model'],_0x19018b[_0xe25d('0x47')]);_0x56a193[_0xe25d('0x4c')]=_[_0xe25d('0x4a')](_0x19018b[_0xe25d('0x4b')],qs[_0xe25d('0x4d')](_0x57c807[_0xe25d('0x47')]['fields']));_0x56a193['attributes']=_0x56a193[_0xe25d('0x4c')]['length']?_0x56a193[_0xe25d('0x4c')]:_0x19018b[_0xe25d('0x4b')];if(_0x57c807[_0xe25d('0x47')][_0xe25d('0xb8')]){_0x56a193['include']=[{'all':!![]}];}_0x56a193=_['merge']({},_0x56a193,_0x57c807['options']);return db['FaxInteraction'][_0xe25d('0x6a')](_0x56a193)[_0xe25d('0x2e')](handleEntityNotFound(_0x427a99,null))[_0xe25d('0x2e')](respondWithResult(_0x427a99,null))['catch'](handleError(_0x427a99,null));};exports[_0xe25d('0xb9')]=function(_0x4b6ee5,_0x4eadb4){return db['FaxInteraction'][_0xe25d('0xb9')](_0x4b6ee5[_0xe25d('0x7b')],{})[_0xe25d('0x2e')](respondWithResult(_0x4eadb4,0xc9))[_0xe25d('0x3a')](handleError(_0x4eadb4,null));};exports[_0xe25d('0x2d')]=function(_0x123c67,_0x4b6bf1){if(_0x123c67[_0xe25d('0x7b')]['id']){delete _0x123c67[_0xe25d('0x7b')]['id'];}return db[_0xe25d('0x42')][_0xe25d('0x6a')]({'where':{'id':_0x123c67[_0xe25d('0xb7')]['id']}})[_0xe25d('0x2e')](handleEntityNotFound(_0x4b6bf1,null))[_0xe25d('0x2e')](saveUpdates(_0x123c67[_0xe25d('0x7b')],null))[_0xe25d('0x2e')](respondWithResult(_0x4b6bf1,null))[_0xe25d('0x3a')](handleError(_0x4b6bf1,null));};exports[_0xe25d('0x2f')]=function(_0x1e2a95,_0xdbbf17){return db[_0xe25d('0x42')][_0xe25d('0x6a')]({'where':{'id':_0x1e2a95[_0xe25d('0xb7')]['id']}})[_0xe25d('0x2e')](handleEntityNotFound(_0xdbbf17,null))[_0xe25d('0x2e')](removeEntity(_0xdbbf17,null))[_0xe25d('0x3a')](handleError(_0xdbbf17,null));};exports[_0xe25d('0xba')]=function(_0x31e9c3,_0x2c18a7){return db[_0xe25d('0x42')][_0xe25d('0xba')]()['then'](respondWithResult(_0x2c18a7,null))[_0xe25d('0x3a')](handleError(_0x2c18a7,null));};exports['addMessage']=function(_0x4dd748,_0x5e8299,_0x3e05b8){return db['FaxMessage']['find']({'where':{'id':_0x4dd748[_0xe25d('0xb7')]['id']}})['then'](handleEntityNotFound(_0x5e8299,null))['then'](function(_0x436621){if(_0x436621){return _0x436621['addMessage'](_0x4dd748[_0xe25d('0x7b')][_0xe25d('0xbb')],_[_0xe25d('0xbc')](_0x4dd748['body'],[_0xe25d('0xbb'),'id'])||{});}})[_0xe25d('0x2e')](respondWithResult(_0x5e8299,null))[_0xe25d('0x3a')](handleError(_0x5e8299,null));};exports[_0xe25d('0xbd')]=function(_0x5899ba,_0x11cd20,_0x566269){var _0x41ab6f={'raw':![],'where':{}};var _0x3d49f2={};var _0x847836={'count':0x0,'rows':[]};return db['FaxInteraction'][_0xe25d('0xbe')]({'where':{'id':_0x5899ba['params']['id']}})[_0xe25d('0x2e')](handleEntityNotFound(_0x11cd20,null))[_0xe25d('0x2e')](function(_0x34f378){if(_0x34f378){_0x3d49f2['model']=_['keys'](db[_0xe25d('0xbf')][_0xe25d('0x43')]);_0x3d49f2[_0xe25d('0x47')]=_[_0xe25d('0x48')](_0x5899ba[_0xe25d('0x47')]);_0x3d49f2['filters']=_[_0xe25d('0x4a')](_0x3d49f2[_0xe25d('0x4b')],_0x3d49f2['query']);_0x41ab6f[_0xe25d('0x4c')]=_[_0xe25d('0x4a')](_0x3d49f2[_0xe25d('0x4b')],qs[_0xe25d('0x4d')](_0x5899ba[_0xe25d('0x47')]['fields']));_0x41ab6f[_0xe25d('0x4c')]=_0x41ab6f[_0xe25d('0x4c')][_0xe25d('0x69')]?_0x41ab6f[_0xe25d('0x4c')]:_0x3d49f2[_0xe25d('0x4b')];if(!_0x5899ba[_0xe25d('0x47')][_0xe25d('0x4e')](_0xe25d('0x4f'))){_0x41ab6f[_0xe25d('0x27')]=qs[_0xe25d('0x27')](_0x5899ba[_0xe25d('0x47')][_0xe25d('0x27')]);_0x41ab6f[_0xe25d('0x25')]=qs['offset'](_0x5899ba[_0xe25d('0x47')][_0xe25d('0x25')]);}_0x41ab6f[_0xe25d('0x50')]=qs['sort'](_0x5899ba[_0xe25d('0x47')][_0xe25d('0x51')]);_0x41ab6f[_0xe25d('0x52')]=qs['filters'](_['pick'](_0x5899ba[_0xe25d('0x47')],_0x3d49f2[_0xe25d('0x49')]));_0x41ab6f[_0xe25d('0x52')][_0xe25d('0xb4')]=_0x34f378['id'];if(_0x5899ba[_0xe25d('0x47')][_0xe25d('0x8d')]){_0x41ab6f[_0xe25d('0x52')]=_[_0xe25d('0xc0')](_0x41ab6f[_0xe25d('0x52')],{'$or':_[_0xe25d('0x46')](_0x41ab6f[_0xe25d('0x4c')],function(_0xd90831){var _0x16a5da={};_0x16a5da[_0xd90831]={'$like':'%'+_0x5899ba[_0xe25d('0x47')]['filter']+'%'};return _0x16a5da;})});}if(_0x5899ba[_0xe25d('0x47')][_0xe25d('0x82')]){var _0x3cd8a5=_0x5899ba['query'][_0xe25d('0x82')]['split'](',');var _0x4b5505={};_0x4b5505[_0x3cd8a5[0x0]]={'$gte':moment(_0x3cd8a5[0x1])[_0xe25d('0xc1')](_0xe25d('0xc2'))};_0x41ab6f[_0xe25d('0x52')]=_['merge'](_0x41ab6f[_0xe25d('0x52')],_0x4b5505);}_0x41ab6f=_[_0xe25d('0xc0')]({},_0x41ab6f,_0x5899ba[_0xe25d('0xc3')]);return db[_0xe25d('0xbf')][_0xe25d('0x28')]({'where':_0x41ab6f[_0xe25d('0x52')]})[_0xe25d('0x2e')](function(_0x4d7344){_0x847836[_0xe25d('0x28')]=_0x4d7344;if(_0x5899ba[_0xe25d('0x47')][_0xe25d('0xb8')]){_0x41ab6f[_0xe25d('0xc4')]=[{'all':!![]}];}return db['FaxMessage'][_0xe25d('0xc5')](_0x41ab6f);})['then'](function(_0x59fa00){_0x847836[_0xe25d('0xb6')]=_0x59fa00;return _0x847836;});}})['then'](respondWithFilteredResult(_0x11cd20,_0x41ab6f))[_0xe25d('0x3a')](handleError(_0x11cd20,null));};exports[_0xe25d('0xc6')]=function(_0xada094,_0x36c7d5,_0x176460){return db[_0xe25d('0x42')][_0xe25d('0x6a')]({'where':{'id':_0xada094['params']['id']}})['then'](handleEntityNotFound(_0x36c7d5,null))[_0xe25d('0x2e')](function(_0x4bbe19){if(_0x4bbe19){return _0x4bbe19['setTags'](_0xada094[_0xe25d('0x7b')][_0xe25d('0xbb')],_[_0xe25d('0xbc')](_0xada094[_0xe25d('0x7b')],[_0xe25d('0xbb'),'id'])||{})[_0xe25d('0xc7')](function(){return db[_0xe25d('0x76')][_0xe25d('0xc5')]({'attributes':['id','name','color'],'where':{'id':_0xada094['body']['ids']}});})['then'](function(_0x3f2ef7){socket[_0xe25d('0xc8')](_0xe25d('0xc9'),{'id':Number(_0xada094['params']['id']),'tags':_0x3f2ef7||[]});return{'id':Number(_0xada094[_0xe25d('0xb7')]['id']),'tags':_0x3f2ef7||[]};});}})[_0xe25d('0x2e')](respondWithResult(_0x36c7d5,null))['catch'](handleError(_0x36c7d5,null));};exports[_0xe25d('0xca')]=function(_0x387438,_0x59e1f8,_0x5ebc08){return db['FaxInteraction'][_0xe25d('0x6a')]({'where':{'id':_0x387438['params']['id']}})[_0xe25d('0x2e')](handleEntityNotFound(_0x59e1f8,null))[_0xe25d('0x2e')](function(_0x44c083){if(_0x44c083){return _0x44c083[_0xe25d('0xca')](_0x387438['query'][_0xe25d('0xbb')]);}})[_0xe25d('0x2e')](respondWithStatusCode(_0x59e1f8,null))['catch'](handleError(_0x59e1f8,null));};exports['download']=function(_0x1f64e0,_0x367442){var _0x1c6201=moment()['unix']()[_0xe25d('0xa0')]();var _0x966e28=path['join'](config['root'],'server',_0xe25d('0xcb'),_0xe25d('0xcc'));var _0x12949f=path[_0xe25d('0xcd')](config['root'],_0xe25d('0xce'),_0xe25d('0xcb'),'attachments');var _0x274329=path[_0xe25d('0xcd')](_0x966e28,_0x1c6201);var _0x185b8a=util[_0xe25d('0xc1')](_0xe25d('0xcf'),_0x1f64e0[_0xe25d('0xb7')]['id'],_0x1c6201);var _0x3eacb4=path['join'](_0x966e28,_0x185b8a);var _0x115fc5=[];_0x115fc5[_0xe25d('0x39')]({'model':db[_0xe25d('0xd0')],'as':_0xe25d('0xd0'),'raw':!![]});var _0x11321c=[{'model':db[_0xe25d('0xbf')],'as':_0xe25d('0xd1'),'attributes':['id','body',_0xe25d('0x80')],'include':_0x115fc5}];return db[_0xe25d('0x42')][_0xe25d('0x6a')]({'where':{'id':_0x1f64e0[_0xe25d('0xb7')]['id']},'include':_0x11321c})['then'](handleEntityNotFound(_0x367442,null))[_0xe25d('0x2e')](function(_0x3e6eee){if(_0x3e6eee&&_0x3e6eee[_0xe25d('0xd1')]){var _0x118520=_0x3e6eee[_0xe25d('0xd2')]({'plain':!![]});fs[_0xe25d('0xd3')](_0x274329);for(var _0x121ce1=0x0;_0x121ce1<_0x118520[_0xe25d('0xd1')][_0xe25d('0x69')];_0x121ce1++){var _0x179f3d=_0x118520[_0xe25d('0xd1')][_0x121ce1][_0xe25d('0xd0')];if(_0x179f3d){var _0x4fd09b=path[_0xe25d('0xcd')](_0x12949f,_0x179f3d[_0xe25d('0xd4')]);if(fs[_0xe25d('0xd5')](_0x4fd09b)){fs['createReadStream'](_0x4fd09b)[_0xe25d('0xd6')](fs[_0xe25d('0xd7')](path[_0xe25d('0xcd')](_0x274329,_0x179f3d[_0xe25d('0xd4')])));}}}return BPromise[_0xe25d('0xd8')]()['then'](function(){return new BPromise(function(_0x464d41,_0x2e9027){zipdir(_0x274329,{'saveTo':_0x3eacb4},function(_0x4623ef,_0x2e8beb){if(_0x4623ef)return _0x2e9027(_0x4623ef);return _0x464d41(_0x2e8beb);});})[_0xe25d('0x2e')](function(){return new BPromise(function(_0x40043c,_0x290622){rimraf(_0x274329,function(_0x4f064f){if(_0x4f064f)_0x290622(_0x4f064f);return _0x40043c();});});})[_0xe25d('0x2e')](function(){return _0x367442['download'](_0x3eacb4,_0x185b8a,function(_0x2cd858){if(_0x2cd858){console[_0xe25d('0xd9')](_0xe25d('0xda'),_0x2cd858);}else{fs[_0xe25d('0xdb')](_0x3eacb4);}});});});}else{return _0x367442[_0xe25d('0x30')](0xc8);}})[_0xe25d('0x3a')](handleError(_0x367442,null));}; \ No newline at end of file +var _0x3649=['SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','agent','sequelize','toString','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.mobile','c.fax','Contact.fax','o.internal','Owner.internal','ui.FaxInteractionId\x20IN\x20?','groupBy','all','rows','show','includeAll','options','create','update','params','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','sort','FaxInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','merge','include','findAll','addTags','setTags','spread','color','emit','faxInteractionTags:save','removeTags','download','unix','join','server','tmp','root','attachments','transcript-%d-%s.zip','Attachment','Messages','basename','existsSync','createReadStream','pipe','createWriteStream','log','err','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','register','sendStatus','status','offset','limit','count','set','Content-Range','json','apply','save','destroy','then','end','stack','name','send','Users','map','fullname','TagIds','Tags','push','catch','waiting','talking','answered','unmanaged','total','closed','UserId','index','FaxInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','select','field','from','tools_tags','u.id','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','fax_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','$substring','split','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','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','operator','body','text','some','compact','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes'];(function(_0x300e01,_0x1adf56){var _0x14e002=function(_0x3e8856){while(--_0x3e8856){_0x300e01['push'](_0x300e01['shift']());}};_0x14e002(++_0x1adf56);}(_0x3649,0x130));var _0x9364=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x3649[_0x3054be];return _0x3df150;};'use strict';var emlformat=require(_0x9364('0x0'));var rimraf=require(_0x9364('0x1'));var zipdir=require(_0x9364('0x2'));var jsonpatch=require(_0x9364('0x3'));var rp=require(_0x9364('0x4'));var moment=require(_0x9364('0x5'));var BPromise=require(_0x9364('0x6'));var Mustache=require(_0x9364('0x7'));var util=require('util');var path=require(_0x9364('0x8'));var sox=require(_0x9364('0x9'));var csv=require(_0x9364('0xa'));var ejs=require(_0x9364('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9364('0xc'));var squel=require(_0x9364('0xd'));var crypto=require(_0x9364('0xe'));var jsforce=require(_0x9364('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9364('0x10'));var Papa=require(_0x9364('0x11'));var Redis=require('ioredis');var authService=require(_0x9364('0x12'));var qs=require(_0x9364('0x13'));var as=require(_0x9364('0x14'));var hardwareService=require(_0x9364('0x15'));var logger=require(_0x9364('0x16'))(_0x9364('0x17'));var utils=require(_0x9364('0x18'));var config=require(_0x9364('0x19'));var licenseUtil=require(_0x9364('0x1a'));var db=require(_0x9364('0x1b'))['db'];config[_0x9364('0x1c')]=_['defaults'](config[_0x9364('0x1c')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9364('0x1c')]));require('./faxInteraction.socket')[_0x9364('0x1d')](socket);function respondWithStatusCode(_0x269f74,_0x305e4c){_0x305e4c=_0x305e4c||0xcc;return function(_0x18be0c){if(_0x18be0c){return _0x269f74[_0x9364('0x1e')](_0x305e4c);}return _0x269f74[_0x9364('0x1f')](_0x305e4c)['end']();};}function respondWithResult(_0x3a9cdb,_0x51c515){_0x51c515=_0x51c515||0xc8;return function(_0x7606b6){if(_0x7606b6){return _0x3a9cdb[_0x9364('0x1f')](_0x51c515)['json'](_0x7606b6);}};}function respondWithFilteredResult(_0x1fada2,_0x23a9a6){return function(_0x2b9d81){if(_0x2b9d81){var _0xd26cf1=typeof _0x23a9a6[_0x9364('0x20')]==='undefined'&&typeof _0x23a9a6[_0x9364('0x21')]==='undefined';var _0x212059=_0x2b9d81[_0x9364('0x22')];var _0x1d5d82=_0xd26cf1?0x0:_0x23a9a6[_0x9364('0x20')];var _0xbb06d4=_0xd26cf1?_0x2b9d81[_0x9364('0x22')]:_0x23a9a6['offset']+_0x23a9a6[_0x9364('0x21')];var _0x3816bf;if(_0xbb06d4>=_0x212059){_0xbb06d4=_0x212059;_0x3816bf=0xc8;}else{_0x3816bf=0xce;}_0x1fada2['status'](_0x3816bf);return _0x1fada2[_0x9364('0x23')](_0x9364('0x24'),_0x1d5d82+'-'+_0xbb06d4+'/'+_0x212059)[_0x9364('0x25')](_0x2b9d81);}return null;};}function patchUpdates(_0x491031){return function(_0x21c687){try{jsonpatch[_0x9364('0x26')](_0x21c687,_0x491031,!![]);}catch(_0x4b5d6e){return BPromise['reject'](_0x4b5d6e);}return _0x21c687[_0x9364('0x27')]();};}function saveUpdates(_0x13035e,_0x3ac8d3){return function(_0x4d67fa){if(_0x4d67fa){return _0x4d67fa['update'](_0x13035e)['then'](function(_0x49996c){return _0x49996c;});}return null;};}function removeEntity(_0x237dd1,_0x4190ff){return function(_0x10dfbb){if(_0x10dfbb){return _0x10dfbb[_0x9364('0x28')]()[_0x9364('0x29')](function(){_0x237dd1['status'](0xcc)[_0x9364('0x2a')]();});}};}function handleEntityNotFound(_0x4ea44b,_0x2f6986){return function(_0xfad4d3){if(!_0xfad4d3){_0x4ea44b[_0x9364('0x1e')](0x194);}return _0xfad4d3;};}function handleError(_0x50ec84,_0x4fdfba){_0x4fdfba=_0x4fdfba||0x1f4;return function(_0x2b2ff8){logger['error'](_0x2b2ff8[_0x9364('0x2b')]);if(_0x2b2ff8['name']){delete _0x2b2ff8[_0x9364('0x2c')];}_0x50ec84[_0x9364('0x1f')](_0x4fdfba)[_0x9364('0x2d')](_0x2b2ff8);};}function getInteractionUsers(_0x53e3b2,_0x28ee38){return new BPromise(function(_0x10609b,_0x543dde){try{if(_0x28ee38[_0x53e3b2['id']]){_0x53e3b2[_0x9364('0x2e')]=_[_0x9364('0x2f')](_0x28ee38[_0x53e3b2['id']],function(_0x3738bd){return{'id':_0x3738bd['id'],'fullname':_0x3738bd[_0x9364('0x30')]};});}}catch(_0x59fdf0){_0x543dde(_0x59fdf0);}_0x10609b(_0x53e3b2);});}function getInteractionTags(_0x598f5f,_0x207e0f){return new BPromise(function(_0x579775,_0x528d98){try{if(_0x598f5f[_0x9364('0x31')]){_0x598f5f['Tags']=[];_0x598f5f['TagIds']['split'](',')['forEach'](function(_0x53f639){_0x598f5f[_0x9364('0x32')][_0x9364('0x33')](_0x207e0f[_0x53f639]);});}delete _0x598f5f['TagIds'];}catch(_0x2df301){_0x528d98(_0x2df301);}_0x579775(_0x598f5f);});}function updateFaxInteraction(_0x3e177d,_0x502e1a,_0xeb5f8a){return new BPromise(function(_0x24612c,_0x209a0e){return getInteractionUsers(_0x3e177d,_0xeb5f8a)[_0x9364('0x29')](function(_0x34c669){return getInteractionTags(_0x34c669,_0x502e1a);})[_0x9364('0x29')](function(_0x8cf7c0){return getStateInteraction(_0x8cf7c0);})[_0x9364('0x29')](function(_0xfa4bb2){_0x24612c(_0xfa4bb2);})[_0x9364('0x34')](function(_0x32943c){_0x209a0e(_0x32943c);});});}function getStateInteraction(_0x1e2100){return new BPromise(function(_0x1f04b6){_0x1e2100[_0x9364('0x35')]=0x0;_0x1e2100[_0x9364('0x36')]=0x0;_0x1e2100[_0x9364('0x37')]=0x0;_0x1e2100[_0x9364('0x38')]=0x0;_0x1e2100[_0x9364('0x39')]=0x0;if(!_0x1e2100[_0x9364('0x3a')]&&!_0x1e2100['UserId']){_0x1e2100[_0x9364('0x35')]+=0x1;}if(!_0x1e2100[_0x9364('0x3a')]&&_0x1e2100[_0x9364('0x3b')]){_0x1e2100[_0x9364('0x36')]+=0x1;if(_0x1e2100[_0x9364('0x35')]){_0x1e2100[_0x9364('0x35')]-=0x1;}}if(_0x1e2100[_0x9364('0x3a')]&&_0x1e2100[_0x9364('0x3b')]){_0x1e2100['answered']+=0x1;if(_0x1e2100[_0x9364('0x36')]){_0x1e2100[_0x9364('0x36')]-=0x1;}}if(_0x1e2100[_0x9364('0x3a')]&&!_0x1e2100[_0x9364('0x3b')]){_0x1e2100[_0x9364('0x38')]+=0x1;if(_0x1e2100['waiting']){_0x1e2100[_0x9364('0x35')]-=0x1;}}_0x1e2100[_0x9364('0x39')]+=0x1;_0x1f04b6(_0x1e2100);});}exports[_0x9364('0x3c')]=function(_0x9f52fe,_0x4b7684){var _0x4cbe3a={},_0x531660={},_0x40833d={'count':0x0,'rows':[]};var _0x7d6e2c=_[_0x9364('0x2f')](db[_0x9364('0x3d')][_0x9364('0x3e')],function(_0x3a9f25){return{'name':_0x3a9f25[_0x9364('0x3f')],'type':_0x3a9f25[_0x9364('0x40')][_0x9364('0x41')]};});_0x531660[_0x9364('0x42')]=_[_0x9364('0x2f')](_0x7d6e2c,_0x9364('0x2c'));_0x531660[_0x9364('0x43')]=_[_0x9364('0x44')](_0x9f52fe[_0x9364('0x43')]);_0x531660[_0x9364('0x45')]=_['intersection'](_0x531660[_0x9364('0x42')],_0x531660[_0x9364('0x43')]);_0x4cbe3a[_0x9364('0x46')]=_[_0x9364('0x47')](_0x531660[_0x9364('0x42')],qs['fields'](_0x9f52fe['query'][_0x9364('0x48')]));_0x4cbe3a['attributes']=_0x4cbe3a[_0x9364('0x46')][_0x9364('0x49')]?_0x4cbe3a[_0x9364('0x46')]:_0x531660[_0x9364('0x42')];if(!_0x9f52fe[_0x9364('0x43')][_0x9364('0x4a')](_0x9364('0x4b'))){_0x4cbe3a[_0x9364('0x21')]=qs[_0x9364('0x21')](_0x9f52fe[_0x9364('0x43')][_0x9364('0x21')]);_0x4cbe3a['offset']=qs[_0x9364('0x20')](_0x9f52fe[_0x9364('0x43')]['offset']);}_0x4cbe3a[_0x9364('0x4c')]=qs['sort'](_0x9f52fe['query']['sort']);_0x4cbe3a[_0x9364('0x4d')]=qs[_0x9364('0x45')](_[_0x9364('0x4e')](_0x9f52fe['query'],_0x531660[_0x9364('0x45')]),_0x7d6e2c);var _0x1475b5=[];var _0x4ee739=squel[_0x9364('0x4f')]()['field']('id')[_0x9364('0x50')](_0x9364('0x2c'))[_0x9364('0x50')]('color')[_0x9364('0x51')](_0x9364('0x52'));var _0x48b6e5=squel['select']()['field'](_0x9364('0x53'))['field']('u.fullname')[_0x9364('0x50')](_0x9364('0x54'))[_0x9364('0x51')](_0x9364('0x55'),'ui')[_0x9364('0x56')](_0x9364('0x57'),'u',_0x9364('0x58'));var _0x5f1417=squel['select']()['from'](_0x9364('0x59'),'i')[_0x9364('0x56')]('cm_contacts','c',_0x9364('0x5a'))[_0x9364('0x56')](_0x9364('0x57'),'o','o.id\x20=\x20i.UserId')[_0x9364('0x56')](_0x9364('0x5b'),'a',_0x9364('0x5c'))[_0x9364('0x56')](_0x9364('0x5d'),'me',_0x9364('0x5e'))['left_join'](_0x9364('0x5f'),'it',_0x9364('0x60'))['left_join'](_0x9364('0x52'),'t','t.id\x20=\x20it.TagId');var _0x1b7efc=squel['expr']();var _0x59fb18=[];var _0x125801=squel[_0x9364('0x61')]();var _0x274111;if(_0x9f52fe[_0x9364('0x43')][_0x9364('0x62')]){_0x274111=as[_0x9364('0x63')](_0x9f52fe[_0x9364('0x43')]['search']);var _0x489fde=_0x274111[_0x9364('0x64')];for(var _0x3a7d46=0x0;_0x3a7d46<_0x274111[_0x9364('0x65')][_0x9364('0x49')];_0x3a7d46++){var _0x4b6e45=_0x274111['conditions'][_0x3a7d46];var _0x124da4='i';var _0x3601aa=_[_0x9364('0x66')](_0x7d6e2c,[_0x9364('0x2c'),_0x4b6e45[_0x9364('0x50')]]);if(!_0x3601aa){switch(_0x4b6e45[_0x9364('0x50')]){case _0x9364('0x67'):if(_0x4b6e45[_0x9364('0x68')]==0x1){_0x5f1417['having']('`'+_0x4b6e45['field']+_0x9364('0x69'));}else{_0x5f1417[_0x9364('0x6a')]('`'+_0x4b6e45[_0x9364('0x50')]+_0x9364('0x6b'));}break;case _0x9364('0x6c'):if(_0x4b6e45['operator']===_0x9364('0x6d')){if(_0x4b6e45[_0x9364('0x68')][_0x9364('0x6e')]('\x20')[_0x9364('0x49')]>0x1){_0x1b7efc[_0x489fde](_0x9364('0x6f'),qs['getFullTextValue'](_0x4b6e45[_0x9364('0x68')]),null);}else{var _0x544a4='%'+_0x4b6e45[_0x9364('0x68')]+'%';_0x1b7efc[_0x489fde](_0x9364('0x70'),_0x544a4,_0x544a4,_0x544a4);}}else{_0x3601aa=_['find'](_0x7d6e2c,[_0x9364('0x2c'),_0x9364('0x71')]);_0x4b6e45[_0x9364('0x50')]=_0x9364('0x71');_0x5a7366=as[_0x9364('0x72')](_0x124da4,_0x3601aa[_0x9364('0x40')],_0x4b6e45);_0x1b7efc[_0x489fde](_0x5a7366['text'],_0x5a7366[_0x9364('0x68')][_0x9364('0x73')],_0x5a7366[_0x9364('0x68')]['end']);}break;case _0x9364('0x74'):var _0x1bbc4f=_0x4b6e45[_0x9364('0x68')][_0x9364('0x6e')](',')[_0x9364('0x2f')](function(_0x474be9){return Number(_0x474be9);});_0x1bbc4f[_0x9364('0x75')](function(_0x2f6a33){_0x125801['or'](_0x9364('0x76'),'%,'+_0x2f6a33+',%');});_0x59fb18=_['union'](_0x59fb18,_0x1bbc4f);break;case _0x9364('0x77'):if(_0x4b6e45[_0x9364('0x78')]===_0x9364('0x6d')){_0x1b7efc[_0x489fde]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x4b6e45[_0x9364('0x68')]+'%',null);}else{_0x3601aa=_[_0x9364('0x66')](_0x7d6e2c,['name',_0x9364('0x3b')]);_0x4b6e45[_0x9364('0x50')]='UserId';_0x5a7366=as[_0x9364('0x72')](_0x124da4,_0x3601aa[_0x9364('0x40')],_0x4b6e45);_0x1b7efc[_0x489fde](_0x5a7366['text'],_0x5a7366[_0x9364('0x68')][_0x9364('0x73')],_0x5a7366[_0x9364('0x68')]['end']);}break;case _0x9364('0x79'):_0x5a7366=as['buildExpression']('me',null,_0x4b6e45);_0x1b7efc[_0x489fde](_0x5a7366[_0x9364('0x7a')],_0x5a7366[_0x9364('0x68')][_0x9364('0x73')],_0x5a7366['value'][_0x9364('0x2a')]);break;}}else{var _0x5a7366=as[_0x9364('0x72')](_0x124da4,_0x3601aa[_0x9364('0x40')],_0x4b6e45);_0x1b7efc[_0x489fde](_0x5a7366[_0x9364('0x7a')],_0x5a7366[_0x9364('0x68')]['start'],_0x5a7366['value'][_0x9364('0x2a')]);}}}else{var _0x23d015=_(_0x9f52fe[_0x9364('0x43')])['keys']()[_0x9364('0x2f')](function(_0x33eaf4){return _[_0x9364('0x7b')](_0x7d6e2c,['name',_0x33eaf4])?_0x33eaf4:undefined;})[_0x9364('0x7c')]()[_0x9364('0x68')]();if(!_['isEmpty'](_0x23d015)){_0x23d015['forEach'](function(_0xd49e0f){if(_0xd49e0f===_0x9364('0x7d')){_0x5f1417['where'](_0x9364('0x7e'),[][_0x9364('0x7f')](_0x9f52fe[_0x9364('0x43')][_0xd49e0f]));}else if(_0xd49e0f===_0x9364('0x80')){var _0x43e86b=JSON[_0x9364('0x81')](_0x9f52fe[_0x9364('0x43')][_0xd49e0f])[_0x9364('0x82')];var _0x15fe1a=JSON[_0x9364('0x81')](_0x9f52fe[_0x9364('0x43')][_0xd49e0f])[_0x9364('0x83')];_0x5f1417[_0x9364('0x4d')](_0x9364('0x84'),_0x43e86b,_0x15fe1a);}else{if(_0x9f52fe[_0x9364('0x43')][_0xd49e0f]===_0x9364('0x85')){_0x5f1417[_0x9364('0x4d')]('i.'+_0xd49e0f+'\x20IS\x20NULL');}else{_0x5f1417['where']('i.'+_0xd49e0f+_0x9364('0x86'),_0x9f52fe['query'][_0xd49e0f]);}}});}if(_0x9f52fe[_0x9364('0x43')][_0x9364('0x87')]){if(_0x9f52fe['query'][_0x9364('0x87')]==0x1){_0x5f1417[_0x9364('0x6a')](_0x9364('0x88'));}else{_0x5f1417[_0x9364('0x6a')]('`unreadMessages`\x20>\x200');}}if(_0x9f52fe[_0x9364('0x43')][_0x9364('0x89')]){_0x59fb18=_[_0x9364('0x8a')](_0x9f52fe[_0x9364('0x43')][_0x9364('0x89')])?_0x9f52fe[_0x9364('0x43')][_0x9364('0x89')]:new Array(_0x9f52fe[_0x9364('0x43')][_0x9364('0x89')]);_0x59fb18[_0x9364('0x75')](function(_0x5dfccb){_0x125801['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x5dfccb+',%');});}if(_0x9f52fe['query']['filter']){var _0x12b19c=_0x9f52fe[_0x9364('0x43')][_0x9364('0x8b')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x9364('0x8c')](_0x12b19c)){_0x1b7efc['or'](_0x9364('0x8d'),_0x12b19c+'%')['or'](_0x9364('0x8e'),_0x12b19c+'%');}_0x1b7efc['or'](_0x9364('0x8f'),_0x12b19c+'%');}}_0x5f1417['where'](_0x1b7efc);_0x5f1417[_0x9364('0x90')](_0x9364('0x91'));var _0x1d6353={'type':db[_0x9364('0x92')][_0x9364('0x93')][_0x9364('0x94')],'raw':!![]};var _0x138084=_0x5f1417['clone']();_0x138084[_0x9364('0x50')](_0x9364('0x91'));_0x138084['field'](_0x9364('0x95'),_0x9364('0x67'));if(_0x4cbe3a['order']){_0x4cbe3a['order'][_0x9364('0x75')](function(_0x5eba58){var _0x1f1c90=_0x5eba58[0x0]===_0x9364('0x96')?_0x5eba58[0x0]:'i.'+_0x5eba58[0x0];_0x5f1417[_0x9364('0x4c')](_0x1f1c90,_0x5eba58[0x1]===_0x9364('0x97')?![]:!![]);});}if(!_[_0x9364('0x98')](_0x59fb18)){_0x5f1417[_0x9364('0x6a')](_0x125801);_0x138084[_0x9364('0x4d')](_0x9364('0x99'),_0x59fb18);}BPromise[_0x9364('0x9a')]()[_0x9364('0x29')](function(){if(!_0x274111){if(_0x9f52fe[_0x9364('0x43')]['FaxAccountId'])return;_0x138084[_0x9364('0x4d')](_0x9364('0x9b'));_0x5f1417[_0x9364('0x4d')](_0x9364('0x9b'));return;}if(_0x9f52fe[_0x9364('0x9c')][_0x9364('0x9d')]!=='agent')return;return _0x9f52fe[_0x9364('0x9c')][_0x9364('0x9e')]({'attributes':['id'],'raw':!![]})[_0x9364('0x29')](function(_0x46afe6){if(_[_0x9364('0x98')](_0x46afe6)){_0x138084[_0x9364('0x4d')](_0x9364('0x9f'));_0x5f1417[_0x9364('0x4d')](_0x9364('0x9f'));}else{_0x138084['where'](_0x9364('0x7e'),_[_0x9364('0x2f')](_0x46afe6,'id'));_0x5f1417[_0x9364('0x4d')](_0x9364('0x7e'),_[_0x9364('0x2f')](_0x46afe6,'id'));}});})[_0x9364('0x29')](function(){if(_0x9f52fe[_0x9364('0x9c')]['role']===_0x9364('0xa0')&&!_0x274111&&!_0x9f52fe['query'][_0x9364('0x7d')])return[];return db[_0x9364('0xa1')][_0x9364('0x43')](_0x138084[_0x9364('0xa2')](),_0x1d6353);})['then'](function(_0x47ffab){_0x40833d[_0x9364('0x22')]=_0x47ffab[_0x9364('0x49')];if(_0x40833d[_0x9364('0x22')]===0x0)return[];return db[_0x9364('0xa1')][_0x9364('0x43')](_0x4ee739[_0x9364('0xa2')](),_0x1d6353)[_0x9364('0x29')](function(_0xc0403d){_0x1475b5=_['keyBy'](_0xc0403d,'id');_0x1d6353=_['merge'](_0x1d6353,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x9f52fe[_0x9364('0x43')][_0x9364('0x48')]){_0x4cbe3a[_0x9364('0x46')][_0x9364('0x75')](function(_0x1d5fbd){_0x5f1417[_0x9364('0x50')]('i.'+_0x1d5fbd);});}else{_0x5f1417[_0x9364('0x50')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x9364('0x67'));_0x5f1417['field'](_0x9364('0xa3'),_0x9364('0xa4'));_0x5f1417['field'](_0x9364('0xa5'),_0x9364('0xa6'));_0x5f1417[_0x9364('0x50')]('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',_0x9364('0x96'));_0x5f1417[_0x9364('0x50')](_0x9364('0xa7'));_0x5f1417['field']('c.firstName',_0x9364('0xa8'));_0x5f1417[_0x9364('0x50')]('c.lastName',_0x9364('0xa9'));_0x5f1417[_0x9364('0x50')](_0x9364('0xaa'),_0x9364('0xab'));_0x5f1417['field'](_0x9364('0xac'),'Contact.phone');_0x5f1417[_0x9364('0x50')]('c.mobile',_0x9364('0xad'));_0x5f1417[_0x9364('0x50')](_0x9364('0xae'),_0x9364('0xaf'));_0x5f1417[_0x9364('0x50')]('o.fullname','Owner.fullname');_0x5f1417[_0x9364('0x50')](_0x9364('0xb0'),_0x9364('0xb1'));_0x5f1417[_0x9364('0x50')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x4cbe3a[_0x9364('0x21')])_0x5f1417[_0x9364('0x21')](_0x4cbe3a[_0x9364('0x21')]);if(_0x4cbe3a[_0x9364('0x20')])_0x5f1417[_0x9364('0x20')](_0x4cbe3a[_0x9364('0x20')]);return db[_0x9364('0xa1')]['query'](_0x5f1417[_0x9364('0xa2')](),_0x1d6353);})[_0x9364('0x29')](function(_0x42a9d0){if(_0x42a9d0['length']>0x0)_0x48b6e5['where'](_0x9364('0xb2'),_[_0x9364('0x2f')](_0x42a9d0,'id'));return db[_0x9364('0xa1')][_0x9364('0x43')](_0x48b6e5[_0x9364('0xa2')](),_0x1d6353)[_0x9364('0x29')](function(_0x91a492){var _0x1878a0=_[_0x9364('0xb3')](_0x91a492,'FaxInteractionId');var _0x340e99=[];_0x42a9d0['forEach'](function(_0xac0743){_0x340e99[_0x9364('0x33')](updateFaxInteraction(_0xac0743,_0x1475b5,_0x1878a0));});return BPromise[_0x9364('0xb4')](_0x340e99);});});})[_0x9364('0x29')](function(_0x107841){_0x40833d[_0x9364('0xb5')]=_0x107841;return _0x40833d;})[_0x9364('0x29')](respondWithFilteredResult(_0x4b7684,_0x4cbe3a))[_0x9364('0x34')](handleError(_0x4b7684,null));};exports[_0x9364('0xb6')]=function(_0x14767a,_0x546338){var _0x5af4e9={'raw':![],'where':{'id':_0x14767a['params']['id']}},_0x9dbf57={};_0x9dbf57[_0x9364('0x42')]=_[_0x9364('0x44')](db[_0x9364('0x3d')][_0x9364('0x3e')]);_0x9dbf57[_0x9364('0x43')]=_[_0x9364('0x44')](_0x14767a[_0x9364('0x43')]);_0x9dbf57[_0x9364('0x45')]=_['intersection'](_0x9dbf57[_0x9364('0x42')],_0x9dbf57['query']);_0x5af4e9[_0x9364('0x46')]=_[_0x9364('0x47')](_0x9dbf57[_0x9364('0x42')],qs['fields'](_0x14767a[_0x9364('0x43')][_0x9364('0x48')]));_0x5af4e9['attributes']=_0x5af4e9[_0x9364('0x46')][_0x9364('0x49')]?_0x5af4e9[_0x9364('0x46')]:_0x9dbf57[_0x9364('0x42')];if(_0x14767a['query'][_0x9364('0xb7')]){_0x5af4e9['include']=[{'all':!![]}];}_0x5af4e9=_['merge']({},_0x5af4e9,_0x14767a[_0x9364('0xb8')]);return db[_0x9364('0x3d')][_0x9364('0x66')](_0x5af4e9)['then'](handleEntityNotFound(_0x546338,null))['then'](respondWithResult(_0x546338,null))['catch'](handleError(_0x546338,null));};exports[_0x9364('0xb9')]=function(_0x36ffbb,_0x4058ec){return db[_0x9364('0x3d')][_0x9364('0xb9')](_0x36ffbb[_0x9364('0x79')],{})[_0x9364('0x29')](respondWithResult(_0x4058ec,0xc9))['catch'](handleError(_0x4058ec,null));};exports[_0x9364('0xba')]=function(_0x4728bf,_0x974101){if(_0x4728bf[_0x9364('0x79')]['id']){delete _0x4728bf[_0x9364('0x79')]['id'];}return db['FaxInteraction'][_0x9364('0x66')]({'where':{'id':_0x4728bf['params']['id']}})['then'](handleEntityNotFound(_0x974101,null))[_0x9364('0x29')](saveUpdates(_0x4728bf[_0x9364('0x79')],null))[_0x9364('0x29')](respondWithResult(_0x974101,null))[_0x9364('0x34')](handleError(_0x974101,null));};exports['destroy']=function(_0x2d5b2d,_0x4e1e18){return db[_0x9364('0x3d')][_0x9364('0x66')]({'where':{'id':_0x2d5b2d[_0x9364('0xbb')]['id']}})[_0x9364('0x29')](handleEntityNotFound(_0x4e1e18,null))[_0x9364('0x29')](removeEntity(_0x4e1e18,null))[_0x9364('0x34')](handleError(_0x4e1e18,null));};exports[_0x9364('0xbc')]=function(_0x44a10b,_0x517cd4){return db['FaxInteraction'][_0x9364('0xbc')]()[_0x9364('0x29')](respondWithResult(_0x517cd4,null))[_0x9364('0x34')](handleError(_0x517cd4,null));};exports[_0x9364('0xbd')]=function(_0x19f14b,_0x58c21a,_0x5c989a){return db[_0x9364('0xbe')][_0x9364('0x66')]({'where':{'id':_0x19f14b['params']['id']}})[_0x9364('0x29')](handleEntityNotFound(_0x58c21a,null))['then'](function(_0x5d6783){if(_0x5d6783){return _0x5d6783['addMessage'](_0x19f14b[_0x9364('0x79')][_0x9364('0xbf')],_[_0x9364('0xc0')](_0x19f14b[_0x9364('0x79')],['ids','id'])||{});}})['then'](respondWithResult(_0x58c21a,null))[_0x9364('0x34')](handleError(_0x58c21a,null));};exports[_0x9364('0xc1')]=function(_0x210c2e,_0xcdd8c5,_0x37a2f8){var _0x334a84={'raw':![],'where':{}};var _0x561372={};var _0x11ad05={'count':0x0,'rows':[]};return db[_0x9364('0x3d')][_0x9364('0xc2')]({'where':{'id':_0x210c2e['params']['id']}})[_0x9364('0x29')](handleEntityNotFound(_0xcdd8c5,null))[_0x9364('0x29')](function(_0x24fb81){if(_0x24fb81){_0x561372[_0x9364('0x42')]=_[_0x9364('0x44')](db[_0x9364('0xbe')][_0x9364('0x3e')]);_0x561372[_0x9364('0x43')]=_[_0x9364('0x44')](_0x210c2e[_0x9364('0x43')]);_0x561372[_0x9364('0x45')]=_[_0x9364('0x47')](_0x561372[_0x9364('0x42')],_0x561372[_0x9364('0x43')]);_0x334a84[_0x9364('0x46')]=_['intersection'](_0x561372[_0x9364('0x42')],qs[_0x9364('0x48')](_0x210c2e[_0x9364('0x43')][_0x9364('0x48')]));_0x334a84[_0x9364('0x46')]=_0x334a84[_0x9364('0x46')][_0x9364('0x49')]?_0x334a84[_0x9364('0x46')]:_0x561372['model'];if(!_0x210c2e[_0x9364('0x43')][_0x9364('0x4a')]('nolimit')){_0x334a84['limit']=qs[_0x9364('0x21')](_0x210c2e[_0x9364('0x43')][_0x9364('0x21')]);_0x334a84['offset']=qs[_0x9364('0x20')](_0x210c2e[_0x9364('0x43')][_0x9364('0x20')]);}_0x334a84[_0x9364('0x4c')]=qs[_0x9364('0xc3')](_0x210c2e[_0x9364('0x43')][_0x9364('0xc3')]);_0x334a84[_0x9364('0x4d')]=qs[_0x9364('0x45')](_[_0x9364('0x4e')](_0x210c2e[_0x9364('0x43')],_0x561372[_0x9364('0x45')]));_0x334a84[_0x9364('0x4d')][_0x9364('0xc4')]=_0x24fb81['id'];if(_0x210c2e[_0x9364('0x43')][_0x9364('0x8b')]){_0x334a84[_0x9364('0x4d')]=_['merge'](_0x334a84[_0x9364('0x4d')],{'$or':_['map'](_0x334a84[_0x9364('0x46')],function(_0x5e5cbe){var _0x39771c={};_0x39771c[_0x5e5cbe]={'$like':'%'+_0x210c2e[_0x9364('0x43')][_0x9364('0x8b')]+'%'};return _0x39771c;})});}if(_0x210c2e['query'][_0x9364('0x82')]){var _0x355e96=_0x210c2e['query'][_0x9364('0x82')][_0x9364('0x6e')](',');var _0x2aaddc={};_0x2aaddc[_0x355e96[0x0]]={'$gte':moment(_0x355e96[0x1])[_0x9364('0xc5')](_0x9364('0xc6'))};_0x334a84['where']=_[_0x9364('0xc7')](_0x334a84[_0x9364('0x4d')],_0x2aaddc);}_0x334a84=_['merge']({},_0x334a84,_0x210c2e[_0x9364('0xb8')]);return db['FaxMessage'][_0x9364('0x22')]({'where':_0x334a84[_0x9364('0x4d')]})[_0x9364('0x29')](function(_0x543530){_0x11ad05[_0x9364('0x22')]=_0x543530;if(_0x210c2e[_0x9364('0x43')][_0x9364('0xb7')]){_0x334a84[_0x9364('0xc8')]=[{'all':!![]}];}return db[_0x9364('0xbe')][_0x9364('0xc9')](_0x334a84);})[_0x9364('0x29')](function(_0x4bc95a){_0x11ad05[_0x9364('0xb5')]=_0x4bc95a;return _0x11ad05;});}})[_0x9364('0x29')](respondWithFilteredResult(_0xcdd8c5,_0x334a84))['catch'](handleError(_0xcdd8c5,null));};exports[_0x9364('0xca')]=function(_0x557d81,_0xe0346b,_0x15111a){return db['FaxInteraction'][_0x9364('0x66')]({'where':{'id':_0x557d81[_0x9364('0xbb')]['id']}})[_0x9364('0x29')](handleEntityNotFound(_0xe0346b,null))[_0x9364('0x29')](function(_0x20e681){if(_0x20e681){return _0x20e681[_0x9364('0xcb')](_0x557d81[_0x9364('0x79')]['ids'],_[_0x9364('0xc0')](_0x557d81[_0x9364('0x79')],[_0x9364('0xbf'),'id'])||{})[_0x9364('0xcc')](function(){return db['Tag'][_0x9364('0xc9')]({'attributes':['id',_0x9364('0x2c'),_0x9364('0xcd')],'where':{'id':_0x557d81[_0x9364('0x79')]['ids']}});})[_0x9364('0x29')](function(_0x4960b8){socket[_0x9364('0xce')](_0x9364('0xcf'),{'id':Number(_0x557d81[_0x9364('0xbb')]['id']),'tags':_0x4960b8||[]});return{'id':Number(_0x557d81[_0x9364('0xbb')]['id']),'tags':_0x4960b8||[]};});}})[_0x9364('0x29')](respondWithResult(_0xe0346b,null))[_0x9364('0x34')](handleError(_0xe0346b,null));};exports[_0x9364('0xd0')]=function(_0x21871c,_0x1e3d15,_0x16de34){return db[_0x9364('0x3d')]['find']({'where':{'id':_0x21871c[_0x9364('0xbb')]['id']}})[_0x9364('0x29')](handleEntityNotFound(_0x1e3d15,null))['then'](function(_0x54b48f){if(_0x54b48f){return _0x54b48f[_0x9364('0xd0')](_0x21871c[_0x9364('0x43')]['ids']);}})[_0x9364('0x29')](respondWithStatusCode(_0x1e3d15,null))['catch'](handleError(_0x1e3d15,null));};exports[_0x9364('0xd1')]=function(_0x1a9bef,_0x3d62dd){var _0xe1afe8=moment()[_0x9364('0xd2')]()[_0x9364('0xa2')]();var _0x47faa9=path[_0x9364('0xd3')](config['root'],_0x9364('0xd4'),'files',_0x9364('0xd5'));var _0xd28209=path['join'](config[_0x9364('0xd6')],_0x9364('0xd4'),'files',_0x9364('0xd7'));var _0x5bf791=path[_0x9364('0xd3')](_0x47faa9,_0xe1afe8);var _0x47f918=util[_0x9364('0xc5')](_0x9364('0xd8'),_0x1a9bef[_0x9364('0xbb')]['id'],_0xe1afe8);var _0x4b6f2e=path[_0x9364('0xd3')](_0x47faa9,_0x47f918);var _0x5e95e1=[];_0x5e95e1[_0x9364('0x33')]({'model':db[_0x9364('0xd9')],'as':_0x9364('0xd9'),'raw':!![]});var _0x5ba71d=[{'model':db['FaxMessage'],'as':_0x9364('0xda'),'attributes':['id',_0x9364('0x79'),_0x9364('0x80')],'include':_0x5e95e1}];return db[_0x9364('0x3d')][_0x9364('0x66')]({'where':{'id':_0x1a9bef[_0x9364('0xbb')]['id']},'include':_0x5ba71d})[_0x9364('0x29')](handleEntityNotFound(_0x3d62dd,null))['then'](function(_0x5ad426){if(_0x5ad426&&_0x5ad426[_0x9364('0xda')]){var _0x564861=_0x5ad426['get']({'plain':!![]});fs['mkdirSync'](_0x5bf791);for(var _0x16a77c=0x0;_0x16a77c<_0x564861[_0x9364('0xda')][_0x9364('0x49')];_0x16a77c++){var _0x3a22f4=_0x564861[_0x9364('0xda')][_0x16a77c][_0x9364('0xd9')];if(_0x3a22f4){var _0xf22af3=path[_0x9364('0xd3')](_0xd28209,_0x3a22f4[_0x9364('0xdb')]);if(fs[_0x9364('0xdc')](_0xf22af3)){fs[_0x9364('0xdd')](_0xf22af3)[_0x9364('0xde')](fs[_0x9364('0xdf')](path[_0x9364('0xd3')](_0x5bf791,_0x3a22f4['basename'])));}}}return BPromise[_0x9364('0x9a')]()[_0x9364('0x29')](function(){return new BPromise(function(_0x5aea7e,_0x321b17){zipdir(_0x5bf791,{'saveTo':_0x4b6f2e},function(_0x21b0df,_0x2231c3){if(_0x21b0df)return _0x321b17(_0x21b0df);return _0x5aea7e(_0x2231c3);});})['then'](function(){return new BPromise(function(_0x29264b,_0x4794e6){rimraf(_0x5bf791,function(_0x2dd231){if(_0x2dd231)_0x4794e6(_0x2dd231);return _0x29264b();});});})[_0x9364('0x29')](function(){return _0x3d62dd['download'](_0x4b6f2e,_0x47f918,function(_0x16ebb5){if(_0x16ebb5){console[_0x9364('0xe0')](_0x9364('0xe1'),_0x16ebb5);}else{fs['unlinkSync'](_0x4b6f2e);}});});});}else{return _0x3d62dd[_0x9364('0x1e')](0xc8);}})[_0x9364('0x34')](handleError(_0x3d62dd,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index f544643..5b91db7 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 _0xfc29=['then','setDataValue','Users','map','unreadMessages','emit','catch','hasOwnProperty','events','FaxInteraction','../../mysqldb','FaxMessage','setMaxListeners','save','update','remove'];(function(_0x2ce40e,_0x24bd3d){var _0x4f547e=function(_0x1bd5fa){while(--_0x1bd5fa){_0x2ce40e['push'](_0x2ce40e['shift']());}};_0x4f547e(++_0x24bd3d);}(_0xfc29,0x118));var _0x9fc2=function(_0x4e18a8,_0x3c9a04){_0x4e18a8=_0x4e18a8-0x0;var _0x4365a5=_0xfc29[_0x4e18a8];return _0x4365a5;};'use strict';var EventEmitter=require(_0x9fc2('0x0'));var FaxInteraction=require('../../mysqldb')['db'][_0x9fc2('0x1')];var FaxMessage=require(_0x9fc2('0x2'))['db'][_0x9fc2('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x9fc2('0x4')](0x0);var events={'afterCreate':_0x9fc2('0x5'),'afterUpdate':_0x9fc2('0x6'),'afterDestroy':_0x9fc2('0x7')};function emitEvent(_0x4184f4){return function(_0x4da951,_0x1e7b45,_0x45192a){_0x4da951['getUsers']({'attributes':['id'],'raw':!![]})[_0x9fc2('0x8')](function(_0x5ed81f){_0x4da951[_0x9fc2('0x9')](_0x9fc2('0xa'),_0x5ed81f[_0x9fc2('0xb')](function(_0x4eb2c0){return{'id':_0x4eb2c0['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x4da951['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x4d7156){_0x4da951[_0x9fc2('0x9')](_0x9fc2('0xc'),_0x4d7156['length']);FaxInteractionEvents[_0x9fc2('0xd')](_0x4184f4+':'+_0x4da951['id'],_0x4da951);FaxInteractionEvents[_0x9fc2('0xd')](_0x4184f4,_0x4da951);_0x45192a(null);})[_0x9fc2('0xe')](_0x45192a(null));};}for(var e in events){if(events[_0x9fc2('0xf')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file +var _0xb0d0=['save','update','getUsers','then','findAll','setDataValue','length','emit','catch','hasOwnProperty','events','../../mysqldb','FaxMessage','setMaxListeners'];(function(_0x577077,_0x52f056){var _0x370769=function(_0x34d109){while(--_0x34d109){_0x577077['push'](_0x577077['shift']());}};_0x370769(++_0x52f056);}(_0xb0d0,0x192));var _0x0b0d=function(_0x48d3ef,_0x49641a){_0x48d3ef=_0x48d3ef-0x0;var _0xfee757=_0xb0d0[_0x48d3ef];return _0xfee757;};'use strict';var EventEmitter=require(_0x0b0d('0x0'));var FaxInteraction=require('../../mysqldb')['db']['FaxInteraction'];var FaxMessage=require(_0x0b0d('0x1'))['db'][_0x0b0d('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x0b0d('0x3')](0x0);var events={'afterCreate':_0x0b0d('0x4'),'afterUpdate':_0x0b0d('0x5'),'afterDestroy':'remove'};function emitEvent(_0x571d31){return function(_0x50baed,_0x27a617,_0x4b3dd2){_0x50baed[_0x0b0d('0x6')]({'attributes':['id'],'raw':!![]})[_0x0b0d('0x7')](function(_0x194d6b){_0x50baed['setDataValue']('Users',_0x194d6b['map'](function(_0x346ca7){return{'id':_0x346ca7['id']};}));return FaxMessage[_0x0b0d('0x8')]({'where':{'FaxInteractionId':_0x50baed['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0b0d('0x7')](function(_0x4a673b){_0x50baed[_0x0b0d('0x9')]('unreadMessages',_0x4a673b[_0x0b0d('0xa')]);FaxInteractionEvents['emit'](_0x571d31+':'+_0x50baed['id'],_0x50baed);FaxInteractionEvents[_0x0b0d('0xb')](_0x571d31,_0x50baed);_0x4b3dd2(null);})[_0x0b0d('0xc')](_0x4b3dd2(null));};}for(var e in events){if(events[_0x0b0d('0xd')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index a29e9c5..b69d71b 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 _0xd7c8=['changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','api','rimraf','./faxInteraction.attributes','exports','define','fax_interactions'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd7c8,0x17a));var _0x8d7c=function(_0x30e95c,_0x775713){_0x30e95c=_0x30e95c-0x0;var _0x1222e0=_0xd7c8[_0x30e95c];return _0x1222e0;};'use strict';var _=require(_0x8d7c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8d7c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8d7c('0x2'));var config=require('../../config/environment');var attributes=require(_0x8d7c('0x3'));module[_0x8d7c('0x4')]=function(_0x5b6933,_0x456aeb){return _0x5b6933[_0x8d7c('0x5')]('FaxInteraction',attributes,{'tableName':_0x8d7c('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xe67978,_0x2510ee,_0x355a80){if(_0xe67978[_0x8d7c('0x7')](_0x8d7c('0x8'))){_0xe67978[_0x8d7c('0x9')]=moment()['format'](_0x8d7c('0xa'));}_0x355a80(null,_0xe67978);}}});}; \ No newline at end of file +var _0x3301=['exports','define','FaxInteraction','fax_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','request-promise','path','../../config/environment'];(function(_0x41b89f,_0x27ab71){var _0x8d0936=function(_0x29c9df){while(--_0x29c9df){_0x41b89f['push'](_0x41b89f['shift']());}};_0x8d0936(++_0x27ab71);}(_0x3301,0x69));var _0x1330=function(_0x38d2a5,_0x3e4915){_0x38d2a5=_0x38d2a5-0x0;var _0x4d0941=_0x3301[_0x38d2a5];return _0x4d0941;};'use strict';var _=require(_0x1330('0x0'));var util=require(_0x1330('0x1'));var logger=require(_0x1330('0x2'))('api');var moment=require(_0x1330('0x3'));var BPromise=require('bluebird');var rp=require(_0x1330('0x4'));var fs=require('fs');var path=require(_0x1330('0x5'));var rimraf=require('rimraf');var config=require(_0x1330('0x6'));var attributes=require('./faxInteraction.attributes');module[_0x1330('0x7')]=function(_0x18ec8a,_0x299e03){return _0x18ec8a[_0x1330('0x8')](_0x1330('0x9'),attributes,{'tableName':_0x1330('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x497e13,_0x1bebe6,_0x193dee){if(_0x497e13[_0x1330('0xb')](_0x1330('0xc'))){_0x497e13[_0x1330('0xd')]=moment()[_0x1330('0xe')](_0x1330('0xf'));}_0x193dee(null,_0x497e13);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 58a61e1..8ca15be 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 _0x9164=['request','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','options','raw','where','attributes','limit','AddTagsToFaxInteraction','find','then','addTags','body','ids','omit','spread','AddTags','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','register'];(function(_0x44aac2,_0x4fc008){var _0x267b6e=function(_0x398447){while(--_0x398447){_0x44aac2['push'](_0x44aac2['shift']());}};_0x267b6e(++_0x4fc008);}(_0x9164,0x9a));var _0x4916=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9164[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x4916('0x0'));var moment=require('moment');var BPromise=require(_0x4916('0x1'));var rs=require(_0x4916('0x2'));var fs=require('fs');var Redis=require(_0x4916('0x3'));var db=require(_0x4916('0x4'))['db'];var utils=require(_0x4916('0x5'));var logger=require(_0x4916('0x6'))(_0x4916('0x7'));var config=require(_0x4916('0x8'));var jayson=require(_0x4916('0x9'));var client=jayson[_0x4916('0xa')]['http']({'port':0x232a});config[_0x4916('0xb')]=_['defaults'](config[_0x4916('0xb')],{'host':_0x4916('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4916('0xb')]));require('./faxInteraction.socket')[_0x4916('0xd')](socket);function respondWithRpcPromise(_0x24e0bc,_0x4c5a89,_0x32e498){return new BPromise(function(_0x13b9a7,_0x23aeac){return client[_0x4916('0xe')](_0x24e0bc,_0x32e498)['then'](function(_0x15dea3){logger[_0x4916('0xf')](_0x4916('0x10'),_0x4c5a89,_0x4916('0x11'));logger[_0x4916('0x12')](_0x4916('0x13'),_0x4c5a89,_0x4916('0x11'),JSON[_0x4916('0x14')](_0x15dea3));if(_0x15dea3[_0x4916('0x15')]){if(_0x15dea3[_0x4916('0x15')][_0x4916('0x16')]===0x1f4){logger['error']('FaxInteraction,\x20%s,\x20%s',_0x4c5a89,_0x15dea3[_0x4916('0x15')][_0x4916('0x17')]);return _0x23aeac(_0x15dea3[_0x4916('0x15')][_0x4916('0x17')]);}logger[_0x4916('0x15')](_0x4916('0x10'),_0x4c5a89,_0x15dea3[_0x4916('0x15')][_0x4916('0x17')]);return _0x13b9a7(_0x15dea3[_0x4916('0x15')][_0x4916('0x17')]);}else{logger[_0x4916('0xf')](_0x4916('0x10'),_0x4c5a89,_0x4916('0x11'));_0x13b9a7(_0x15dea3[_0x4916('0x18')][_0x4916('0x17')]);}})[_0x4916('0x19')](function(_0x297668){logger[_0x4916('0x15')](_0x4916('0x10'),_0x4c5a89,_0x297668);_0x23aeac(_0x297668);});});}exports[_0x4916('0x1a')]=function(_0x1938cb){var _0x13c874=this;return new Promise(function(_0x12b04b,_0x512b23){return db[_0x4916('0x1b')]['update'](_0x1938cb['body'],{'raw':_0x1938cb[_0x4916('0x1c')]?_0x1938cb[_0x4916('0x1c')][_0x4916('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1938cb[_0x4916('0x1c')]?_0x1938cb[_0x4916('0x1c')][_0x4916('0x1e')]||null:null,'attributes':_0x1938cb[_0x4916('0x1c')]?_0x1938cb['options'][_0x4916('0x1f')]||null:null,'limit':_0x1938cb[_0x4916('0x1c')]?_0x1938cb['options'][_0x4916('0x20')]||null:null})['then'](function(_0x2a19c4){logger[_0x4916('0xf')]('UpdateFaxInteraction',_0x1938cb);logger[_0x4916('0x12')]('UpdateFaxInteraction',_0x1938cb,JSON[_0x4916('0x14')](_0x2a19c4));_0x12b04b(_0x2a19c4);})[_0x4916('0x19')](function(_0x36ba08){logger[_0x4916('0x15')](_0x4916('0x1a'),_0x36ba08[_0x4916('0x17')],_0x1938cb);_0x512b23(_0x13c874[_0x4916('0x15')](0x1f4,_0x36ba08[_0x4916('0x17')]));});});};exports[_0x4916('0x21')]=function(_0x282348){return new Promise(function(_0x5e7944,_0x2802ea){return db[_0x4916('0x1b')][_0x4916('0x22')]({'where':_0x282348[_0x4916('0x1c')]?_0x282348['options'][_0x4916('0x1e')]||null:null})[_0x4916('0x23')](function(_0x58af50){if(_0x58af50){return _0x58af50[_0x4916('0x24')](_0x282348[_0x4916('0x25')][_0x4916('0x26')],_[_0x4916('0x27')](_0x282348[_0x4916('0x25')],['ids','id'])||{});}})[_0x4916('0x28')](function(_0x1aa66b){logger[_0x4916('0xf')](_0x4916('0x29'),_0x282348);logger[_0x4916('0x12')]('AddTags',_0x282348,JSON['stringify'](_0x1aa66b));_0x5e7944(_0x1aa66b);})['catch'](function(_0xfa7ca0){logger['error'](_0x4916('0x29'),_0xfa7ca0['message'],_0x282348);_0x2802ea(_this[_0x4916('0x15')](0x1f4,_0xfa7ca0[_0x4916('0x17')]));});});}; \ No newline at end of file +var _0x2f4f=['FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','AddTagsToFaxInteraction','find','where','ids','omit','spread','AddTags','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','socket.io-emitter','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4bbdfe,_0x267103){var _0x3cb5c2=function(_0x1d6bbb){while(--_0x1d6bbb){_0x4bbdfe['push'](_0x4bbdfe['shift']());}};_0x3cb5c2(++_0x267103);}(_0x2f4f,0xdb));var _0xf2f4=function(_0x1a37df,_0x3ed536){_0x1a37df=_0x1a37df-0x0;var _0x5a7d5f=_0x2f4f[_0x1a37df];return _0x5a7d5f;};'use strict';var _=require('lodash');var util=require(_0xf2f4('0x0'));var moment=require(_0xf2f4('0x1'));var BPromise=require('bluebird');var rs=require(_0xf2f4('0x2'));var fs=require('fs');var Redis=require(_0xf2f4('0x3'));var db=require(_0xf2f4('0x4'))['db'];var utils=require(_0xf2f4('0x5'));var logger=require(_0xf2f4('0x6'))(_0xf2f4('0x7'));var config=require(_0xf2f4('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf2f4('0x9')]({'port':0x232a});config[_0xf2f4('0xa')]=_[_0xf2f4('0xb')](config[_0xf2f4('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xf2f4('0xc'))(new Redis(config[_0xf2f4('0xa')]));require(_0xf2f4('0xd'))[_0xf2f4('0xe')](socket);function respondWithRpcPromise(_0xed1763,_0x21ed68,_0x11d5f8){return new BPromise(function(_0x7e2c31,_0x33378d){return client[_0xf2f4('0xf')](_0xed1763,_0x11d5f8)[_0xf2f4('0x10')](function(_0x244d41){logger[_0xf2f4('0x11')](_0xf2f4('0x12'),_0x21ed68,_0xf2f4('0x13'));logger[_0xf2f4('0x14')](_0xf2f4('0x15'),_0x21ed68,_0xf2f4('0x13'),JSON[_0xf2f4('0x16')](_0x244d41));if(_0x244d41[_0xf2f4('0x17')]){if(_0x244d41[_0xf2f4('0x17')][_0xf2f4('0x18')]===0x1f4){logger['error'](_0xf2f4('0x12'),_0x21ed68,_0x244d41['error']['message']);return _0x33378d(_0x244d41[_0xf2f4('0x17')]['message']);}logger['error']('FaxInteraction,\x20%s,\x20%s',_0x21ed68,_0x244d41[_0xf2f4('0x17')][_0xf2f4('0x19')]);return _0x7e2c31(_0x244d41[_0xf2f4('0x17')][_0xf2f4('0x19')]);}else{logger[_0xf2f4('0x11')](_0xf2f4('0x12'),_0x21ed68,_0xf2f4('0x13'));_0x7e2c31(_0x244d41['result'][_0xf2f4('0x19')]);}})[_0xf2f4('0x1a')](function(_0x3bcc37){logger['error'](_0xf2f4('0x12'),_0x21ed68,_0x3bcc37);_0x33378d(_0x3bcc37);});});}exports[_0xf2f4('0x1b')]=function(_0x17e8a4){var _0xd84ec0=this;return new Promise(function(_0x59fda2,_0x5b5dd4){return db[_0xf2f4('0x1c')][_0xf2f4('0x1d')](_0x17e8a4[_0xf2f4('0x1e')],{'raw':_0x17e8a4[_0xf2f4('0x1f')]?_0x17e8a4['options'][_0xf2f4('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17e8a4[_0xf2f4('0x1f')]?_0x17e8a4[_0xf2f4('0x1f')]['where']||null:null,'attributes':_0x17e8a4[_0xf2f4('0x1f')]?_0x17e8a4[_0xf2f4('0x1f')]['attributes']||null:null,'limit':_0x17e8a4['options']?_0x17e8a4[_0xf2f4('0x1f')]['limit']||null:null})[_0xf2f4('0x10')](function(_0x5a96ed){logger[_0xf2f4('0x11')]('UpdateFaxInteraction',_0x17e8a4);logger['debug'](_0xf2f4('0x1b'),_0x17e8a4,JSON['stringify'](_0x5a96ed));_0x59fda2(_0x5a96ed);})[_0xf2f4('0x1a')](function(_0xd312cd){logger['error'](_0xf2f4('0x1b'),_0xd312cd[_0xf2f4('0x19')],_0x17e8a4);_0x5b5dd4(_0xd84ec0[_0xf2f4('0x17')](0x1f4,_0xd312cd[_0xf2f4('0x19')]));});});};exports[_0xf2f4('0x21')]=function(_0x305972){return new Promise(function(_0x5d9402,_0x2e20e8){return db[_0xf2f4('0x1c')][_0xf2f4('0x22')]({'where':_0x305972[_0xf2f4('0x1f')]?_0x305972[_0xf2f4('0x1f')][_0xf2f4('0x23')]||null:null})[_0xf2f4('0x10')](function(_0x34ab62){if(_0x34ab62){return _0x34ab62['addTags'](_0x305972[_0xf2f4('0x1e')][_0xf2f4('0x24')],_[_0xf2f4('0x25')](_0x305972['body'],[_0xf2f4('0x24'),'id'])||{});}})[_0xf2f4('0x26')](function(_0x211960){logger[_0xf2f4('0x11')]('AddTags',_0x305972);logger[_0xf2f4('0x14')](_0xf2f4('0x27'),_0x305972,JSON[_0xf2f4('0x16')](_0x211960));_0x5d9402(_0x211960);})[_0xf2f4('0x1a')](function(_0x870c8f){logger[_0xf2f4('0x17')](_0xf2f4('0x27'),_0x870c8f[_0xf2f4('0x19')],_0x305972);_0x2e20e8(_this[_0xf2f4('0x17')](0x1f4,_0x870c8f[_0xf2f4('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 1178f9f..c0ad0be 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 _0xde58=['register','remove','emit','removeListener'];(function(_0x55d314,_0x33f3e1){var _0x508974=function(_0x4c1b86){while(--_0x4c1b86){_0x55d314['push'](_0x55d314['shift']());}};_0x508974(++_0x33f3e1);}(_0xde58,0x199));var _0x8de5=function(_0x5e7b76,_0x593a66){_0x5e7b76=_0x5e7b76-0x0;var _0x3338e0=_0xde58[_0x5e7b76];return _0x3338e0;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=['save',_0x8de5('0x0'),'update'];function createListener(_0x2f8b6c,_0x1d220a){return function(_0x3303d7){_0x1d220a[_0x8de5('0x1')](_0x2f8b6c,_0x3303d7);};}function removeListener(_0x354fd6,_0x1ec44b){return function(){FaxInteractionEvents[_0x8de5('0x2')](_0x354fd6,_0x1ec44b);};}exports[_0x8de5('0x3')]=function(_0x17de65){for(var _0x16d822=0x0,_0x4009a9=events['length'];_0x16d822<_0x4009a9;_0x16d822++){var _0xa9495=events[_0x16d822];var _0x6077e9=createListener('faxInteraction:'+_0xa9495,_0x17de65);FaxInteractionEvents['on'](_0xa9495,_0x6077e9);}}; \ No newline at end of file +var _0x30a4=['update','emit','removeListener','register','length','faxInteraction:','./faxInteraction.events','remove'];(function(_0x52a9a8,_0x4c68b4){var _0xb139cc=function(_0x48b3ef){while(--_0x48b3ef){_0x52a9a8['push'](_0x52a9a8['shift']());}};_0xb139cc(++_0x4c68b4);}(_0x30a4,0x1b6));var _0x430a=function(_0x591e16,_0x5aefc1){_0x591e16=_0x591e16-0x0;var _0x543b35=_0x30a4[_0x591e16];return _0x543b35;};'use strict';var FaxInteractionEvents=require(_0x430a('0x0'));var events=['save',_0x430a('0x1'),_0x430a('0x2')];function createListener(_0x36203d,_0x33bf30){return function(_0x3d6f48){_0x33bf30[_0x430a('0x3')](_0x36203d,_0x3d6f48);};}function removeListener(_0x600d55,_0x38a1dd){return function(){FaxInteractionEvents[_0x430a('0x4')](_0x600d55,_0x38a1dd);};}exports[_0x430a('0x5')]=function(_0x4558c8){for(var _0x4c34b1=0x0,_0x4562d1=events[_0x430a('0x6')];_0x4c34b1<_0x4562d1;_0x4c34b1++){var _0x20a2c8=events[_0x4c34b1];var _0x4a5a06=createListener(_0x430a('0x7')+_0x20a2c8,_0x4558c8);FaxInteractionEvents['on'](_0x20a2c8,_0x4a5a06);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index e344401..174da30 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 _0x2e78=['faxinteraction:destroy','destroy','removeTags','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/:id','show','/:id/messages','getMessages','/:id/download','post','addMessage','/:id/tags','tracked','faxinteraction:addtags','fax','faxinteraction:update','update','delete'];(function(_0x379380,_0x3e54e1){var _0x185c77=function(_0x203007){while(--_0x203007){_0x379380['push'](_0x379380['shift']());}};_0x185c77(++_0x3e54e1);}(_0x2e78,0xab));var _0x82e7=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x2e78[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x82e7('0x0'));var util=require(_0x82e7('0x1'));var path=require(_0x82e7('0x2'));var timeout=require('connect-timeout');var express=require(_0x82e7('0x3'));var router=express[_0x82e7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x82e7('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x82e7('0x6'));var controller=require(_0x82e7('0x7'));router[_0x82e7('0x8')]('/',auth[_0x82e7('0x9')](),controller[_0x82e7('0xa')]);router[_0x82e7('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x82e7('0x8')](_0x82e7('0xb'),auth[_0x82e7('0x9')](),controller[_0x82e7('0xc')]);router[_0x82e7('0x8')](_0x82e7('0xd'),auth['isAuthenticated'](),controller[_0x82e7('0xe')]);router['get'](_0x82e7('0xf'),auth[_0x82e7('0x9')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x82e7('0x10')](_0x82e7('0xd'),auth['isAuthenticated'](),controller[_0x82e7('0x11')]);router['post'](_0x82e7('0x12'),auth[_0x82e7('0x9')](),interaction[_0x82e7('0x13')]('fax',_0x82e7('0x14')),controller['addTags']);router['put'](_0x82e7('0xb'),auth[_0x82e7('0x9')](),interaction['tracked'](_0x82e7('0x15'),_0x82e7('0x16')),controller[_0x82e7('0x17')]);router[_0x82e7('0x18')](_0x82e7('0xb'),auth[_0x82e7('0x9')](),interaction[_0x82e7('0x13')](_0x82e7('0x15'),_0x82e7('0x19')),controller[_0x82e7('0x1a')]);router['delete'](_0x82e7('0x12'),auth[_0x82e7('0x9')](),controller[_0x82e7('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x5547=['/:id/download','download','post','create','addMessage','tracked','fax','faxinteraction:addtags','addTags','put','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','/:id/tags','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages'];(function(_0x28aea5,_0x3bb12e){var _0x6a55f9=function(_0xf6ece8){while(--_0xf6ece8){_0x28aea5['push'](_0x28aea5['shift']());}};_0x6a55f9(++_0x3bb12e);}(_0x5547,0x76));var _0x7554=function(_0x4e215b,_0x597fbc){_0x4e215b=_0x4e215b-0x0;var _0x56d77a=_0x5547[_0x4e215b];return _0x56d77a;};'use strict';var multer=require(_0x7554('0x0'));var util=require(_0x7554('0x1'));var path=require(_0x7554('0x2'));var timeout=require(_0x7554('0x3'));var express=require(_0x7554('0x4'));var router=express['Router']();var fs_extra=require(_0x7554('0x5'));var auth=require(_0x7554('0x6'));var interaction=require(_0x7554('0x7'));var config=require(_0x7554('0x8'));var controller=require(_0x7554('0x9'));router[_0x7554('0xa')]('/',auth[_0x7554('0xb')](),controller[_0x7554('0xc')]);router['get'](_0x7554('0xd'),auth[_0x7554('0xb')](),controller[_0x7554('0xe')]);router[_0x7554('0xa')](_0x7554('0xf'),auth[_0x7554('0xb')](),controller[_0x7554('0x10')]);router[_0x7554('0xa')](_0x7554('0x11'),auth[_0x7554('0xb')](),controller['getMessages']);router[_0x7554('0xa')](_0x7554('0x12'),auth['isAuthenticated'](),controller[_0x7554('0x13')]);router[_0x7554('0x14')]('/',auth['isAuthenticated'](),controller[_0x7554('0x15')]);router[_0x7554('0x14')](_0x7554('0x11'),auth[_0x7554('0xb')](),controller[_0x7554('0x16')]);router['post']('/:id/tags',auth[_0x7554('0xb')](),interaction[_0x7554('0x17')](_0x7554('0x18'),_0x7554('0x19')),controller[_0x7554('0x1a')]);router[_0x7554('0x1b')]('/:id',auth[_0x7554('0xb')](),interaction[_0x7554('0x17')](_0x7554('0x18'),_0x7554('0x1c')),controller[_0x7554('0x1d')]);router[_0x7554('0x1e')](_0x7554('0xf'),auth[_0x7554('0xb')](),interaction[_0x7554('0x17')](_0x7554('0x18'),_0x7554('0x1f')),controller[_0x7554('0x20')]);router[_0x7554('0x1e')](_0x7554('0x21'),auth['isAuthenticated'](),controller['removeTags']);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 966099e..e61b1d6 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 _0x37dc=['medium','ENUM','out','sequelize','exports','TEXT'];(function(_0x507616,_0x2fa9b0){var _0x287953=function(_0x5ddcb2){while(--_0x5ddcb2){_0x507616['push'](_0x507616['shift']());}};_0x287953(++_0x2fa9b0);}(_0x37dc,0x1e9));var _0xc37d=function(_0x319e79,_0x32e599){_0x319e79=_0x319e79-0x0;var _0x5874d6=_0x37dc[_0x319e79];return _0x5874d6;};'use strict';var Sequelize=require(_0xc37d('0x0'));module[_0xc37d('0x1')]={'body':{'type':Sequelize[_0xc37d('0x2')](_0xc37d('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xc37d('0x4')]('in','out'),'defaultValue':_0xc37d('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0xf3cd=['TEXT','medium','BOOLEAN','ENUM','out','DATE','sequelize','exports'];(function(_0x513988,_0x3566e7){var _0x2b43bc=function(_0x51e38){while(--_0x51e38){_0x513988['push'](_0x513988['shift']());}};_0x2b43bc(++_0x3566e7);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x128bef,_0xc7a0af){_0x128bef=_0x128bef-0x0;var _0x1ba862=_0xf3cd[_0x128bef];return _0x1ba862;};'use strict';var Sequelize=require(_0xdf3c('0x0'));module[_0xdf3c('0x1')]={'body':{'type':Sequelize[_0xdf3c('0x2')](_0xdf3c('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xdf3c('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xdf3c('0x5')]('in','out'),'defaultValue':_0xdf3c('0x6'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xdf3c('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0xdf3c('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index fc4c525..503988d 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 _0x1833=['channel','motionChannel','event','EventManager','acceptmessage','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','rejectmessage','create','CmContact','findOne','Attachment','SendFax','/var/opt/motion2/server/files/attachments/%s','basename','AttachmentId','download','root','server','files','attachments','join','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','request','then','request\x20sent','error','code','FaxMessage,\x20%s,\x20%s','message','info','catch','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','sendStatus','stack','index','map','FaxMessage','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','include','findAll','show','length','options','find','body','params','destroy','describe','fax-interactions','accept','fax','read','format','UserId','user','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','internal','manual','interface','SIP/%s'];(function(_0x56f7c2,_0x5d44d0){var _0x162dca=function(_0xf375a){while(--_0xf375a){_0x56f7c2['push'](_0x56f7c2['shift']());}};_0x162dca(++_0x5d44d0);}(_0x1833,0x1ce));var _0x3183=function(_0xbd4eb7,_0x527b62){_0xbd4eb7=_0xbd4eb7-0x0;var _0x1bf52c=_0x1833[_0xbd4eb7];return _0x1bf52c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3183('0x0'));var zipdir=require(_0x3183('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3183('0x2'));var moment=require(_0x3183('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3183('0x4'));var util=require(_0x3183('0x5'));var path=require(_0x3183('0x6'));var sox=require(_0x3183('0x7'));var csv=require(_0x3183('0x8'));var ejs=require(_0x3183('0x9'));var fs=require('fs');var fs_extra=require(_0x3183('0xa'));var _=require(_0x3183('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3183('0xc'));var deskjs=require(_0x3183('0xd'));var toCsv=require(_0x3183('0x8'));var querystring=require(_0x3183('0xe'));var Papa=require(_0x3183('0xf'));var Redis=require(_0x3183('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3183('0x11'));var as=require(_0x3183('0x12'));var hardwareService=require(_0x3183('0x13'));var logger=require(_0x3183('0x14'))(_0x3183('0x15'));var utils=require(_0x3183('0x16'));var config=require(_0x3183('0x17'));var licenseUtil=require(_0x3183('0x18'));var db=require(_0x3183('0x19'))['db'];config[_0x3183('0x1a')]=_[_0x3183('0x1b')](config[_0x3183('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x3183('0x1c'))(new Redis(config['redis']));require(_0x3183('0x1d'))[_0x3183('0x1e')](socket);var jayson=require(_0x3183('0x1f'));var client=jayson[_0x3183('0x20')][_0x3183('0x21')]({'port':0x232c});var client9002=jayson[_0x3183('0x20')]['http']({'port':0x232a});function respondWithRpcPromise(_0x38fb12,_0x7f3033,_0x50c74d,_0x2e19df){return new BPromise(function(_0x27799a,_0x559515){var _0x5cd807=_0x2e19df||client;return _0x5cd807[_0x3183('0x22')](_0x38fb12,_0x50c74d)[_0x3183('0x23')](function(_0x38c808){logger['info']('FaxMessage,\x20%s,\x20%s',_0x7f3033,_0x3183('0x24'));logger['debug']('FaxMessage,\x20%s,\x20%s,\x20%s',_0x7f3033,_0x3183('0x24'),JSON['stringify'](_0x38c808));if(_0x38c808['error']){if(_0x38c808[_0x3183('0x25')][_0x3183('0x26')]===0x1f4){logger[_0x3183('0x25')](_0x3183('0x27'),_0x7f3033,_0x38c808[_0x3183('0x25')][_0x3183('0x28')]);return _0x559515(_0x38c808[_0x3183('0x25')]['message']);}logger[_0x3183('0x25')]('FaxMessage,\x20%s,\x20%s',_0x7f3033,_0x38c808[_0x3183('0x25')][_0x3183('0x28')]);return _0x27799a(_0x38c808[_0x3183('0x25')][_0x3183('0x28')]);}else{logger[_0x3183('0x29')](_0x3183('0x27'),_0x7f3033,_0x3183('0x24'));_0x27799a(_0x38c808['result'][_0x3183('0x28')]);}})[_0x3183('0x2a')](function(_0x29c4f0){logger[_0x3183('0x25')](_0x3183('0x27'),_0x7f3033,_0x29c4f0);_0x559515(_0x29c4f0);});});}function respondWithStatusCode(_0x3818d1,_0x2a7f9d){_0x2a7f9d=_0x2a7f9d||0xcc;return function(_0x4e470f){if(_0x4e470f){return _0x3818d1['sendStatus'](_0x2a7f9d);}return _0x3818d1['status'](_0x2a7f9d)[_0x3183('0x2b')]();};}function respondWithResult(_0x37d880,_0x347387){_0x347387=_0x347387||0xc8;return function(_0x37f976){if(_0x37f976){return _0x37d880['status'](_0x347387)[_0x3183('0x2c')](_0x37f976);}};}function respondWithFilteredResult(_0x25e6fb,_0x944108){return function(_0x1f8b14){if(_0x1f8b14){var _0x412242=typeof _0x944108[_0x3183('0x2d')]===_0x3183('0x2e')&&typeof _0x944108[_0x3183('0x2f')]===_0x3183('0x2e');var _0x316e34=_0x1f8b14['count'];var _0x138156=_0x412242?0x0:_0x944108['offset'];var _0xa2540e=_0x412242?_0x1f8b14[_0x3183('0x30')]:_0x944108['offset']+_0x944108[_0x3183('0x2f')];var _0x1dc41a;if(_0xa2540e>=_0x316e34){_0xa2540e=_0x316e34;_0x1dc41a=0xc8;}else{_0x1dc41a=0xce;}_0x25e6fb[_0x3183('0x31')](_0x1dc41a);return _0x25e6fb[_0x3183('0x32')](_0x3183('0x33'),_0x138156+'-'+_0xa2540e+'/'+_0x316e34)[_0x3183('0x2c')](_0x1f8b14);}return null;};}function patchUpdates(_0x2a5371){return function(_0x119165){try{jsonpatch[_0x3183('0x34')](_0x119165,_0x2a5371,!![]);}catch(_0x1f7697){return BPromise[_0x3183('0x35')](_0x1f7697);}return _0x119165[_0x3183('0x36')]();};}function saveUpdates(_0x3a96f8,_0x21dd59){return function(_0x356c24){if(_0x356c24){return _0x356c24[_0x3183('0x37')](_0x3a96f8)[_0x3183('0x23')](function(_0x1c296e){return _0x1c296e;});}return null;};}function removeEntity(_0x38f281,_0x195a60){return function(_0x487373){if(_0x487373){return _0x487373['destroy']()[_0x3183('0x23')](function(){_0x38f281[_0x3183('0x31')](0xcc)[_0x3183('0x2b')]();});}};}function handleEntityNotFound(_0x27bda5,_0x495ea8){return function(_0x212b6b){if(!_0x212b6b){_0x27bda5[_0x3183('0x38')](0x194);}return _0x212b6b;};}function handleError(_0x4a78c8,_0x13aa48){_0x13aa48=_0x13aa48||0x1f4;return function(_0x4c0169){logger[_0x3183('0x25')](_0x4c0169[_0x3183('0x39')]);if(_0x4c0169['name']){delete _0x4c0169['name'];}_0x4a78c8[_0x3183('0x31')](_0x13aa48)['send'](_0x4c0169);};}exports[_0x3183('0x3a')]=function(_0x25a016,_0x940dad){var _0x90e0eb={},_0x227984={},_0x45822b={'count':0x0,'rows':[]};var _0x4e005f=_[_0x3183('0x3b')](db[_0x3183('0x3c')][_0x3183('0x3d')],function(_0x560bb6){return{'name':_0x560bb6[_0x3183('0x3e')],'type':_0x560bb6[_0x3183('0x3f')][_0x3183('0x40')]};});_0x227984[_0x3183('0x41')]=_['map'](_0x4e005f,_0x3183('0x42'));_0x227984[_0x3183('0x43')]=_[_0x3183('0x44')](_0x25a016[_0x3183('0x43')]);_0x227984[_0x3183('0x45')]=_[_0x3183('0x46')](_0x227984[_0x3183('0x41')],_0x227984[_0x3183('0x43')]);_0x90e0eb[_0x3183('0x47')]=_[_0x3183('0x46')](_0x227984[_0x3183('0x41')],qs['fields'](_0x25a016[_0x3183('0x43')][_0x3183('0x48')]));_0x90e0eb[_0x3183('0x47')]=_0x90e0eb['attributes']['length']?_0x90e0eb['attributes']:_0x227984[_0x3183('0x41')];if(!_0x25a016[_0x3183('0x43')][_0x3183('0x49')](_0x3183('0x4a'))){_0x90e0eb[_0x3183('0x2f')]=qs['limit'](_0x25a016[_0x3183('0x43')][_0x3183('0x2f')]);_0x90e0eb[_0x3183('0x2d')]=qs[_0x3183('0x2d')](_0x25a016[_0x3183('0x43')][_0x3183('0x2d')]);}_0x90e0eb[_0x3183('0x4b')]=qs[_0x3183('0x4c')](_0x25a016[_0x3183('0x43')][_0x3183('0x4c')]);_0x90e0eb[_0x3183('0x4d')]=qs[_0x3183('0x45')](_['pick'](_0x25a016[_0x3183('0x43')],_0x227984[_0x3183('0x45')]),_0x4e005f);if(_0x25a016['query']['filter']){_0x90e0eb[_0x3183('0x4d')]=_[_0x3183('0x4e')](_0x90e0eb[_0x3183('0x4d')],{'$or':_[_0x3183('0x3b')](_0x4e005f,function(_0x4ce875){if(_0x4ce875[_0x3183('0x3f')]!==_0x3183('0x4f')){var _0x64e1aa={};_0x64e1aa[_0x4ce875[_0x3183('0x42')]]={'$like':'%'+_0x25a016[_0x3183('0x43')]['filter']+'%'};return _0x64e1aa;}})});}_0x90e0eb=_[_0x3183('0x4e')]({},_0x90e0eb,_0x25a016['options']);var _0x561e3f={'where':_0x90e0eb[_0x3183('0x4d')]};return db[_0x3183('0x3c')][_0x3183('0x30')](_0x561e3f)[_0x3183('0x23')](function(_0x546684){_0x45822b[_0x3183('0x30')]=_0x546684;if(_0x25a016['query']['includeAll']){_0x90e0eb[_0x3183('0x50')]=[{'all':!![]}];}return db['FaxMessage'][_0x3183('0x51')](_0x90e0eb);})[_0x3183('0x23')](function(_0xf64b68){_0x45822b['rows']=_0xf64b68;return _0x45822b;})[_0x3183('0x23')](respondWithFilteredResult(_0x940dad,_0x90e0eb))['catch'](handleError(_0x940dad,null));};exports[_0x3183('0x52')]=function(_0x59bbd0,_0x50ac2c){var _0x41556d={'raw':!![],'where':{'id':_0x59bbd0['params']['id']}},_0x516437={};_0x516437[_0x3183('0x41')]=_[_0x3183('0x44')](db[_0x3183('0x3c')][_0x3183('0x3d')]);_0x516437[_0x3183('0x43')]=_[_0x3183('0x44')](_0x59bbd0[_0x3183('0x43')]);_0x516437[_0x3183('0x45')]=_[_0x3183('0x46')](_0x516437['model'],_0x516437[_0x3183('0x43')]);_0x41556d['attributes']=_[_0x3183('0x46')](_0x516437[_0x3183('0x41')],qs[_0x3183('0x48')](_0x59bbd0[_0x3183('0x43')][_0x3183('0x48')]));_0x41556d[_0x3183('0x47')]=_0x41556d[_0x3183('0x47')][_0x3183('0x53')]?_0x41556d[_0x3183('0x47')]:_0x516437[_0x3183('0x41')];if(_0x59bbd0['query']['includeAll']){_0x41556d[_0x3183('0x50')]=[{'all':!![]}];}_0x41556d=_[_0x3183('0x4e')]({},_0x41556d,_0x59bbd0[_0x3183('0x54')]);return db[_0x3183('0x3c')][_0x3183('0x55')](_0x41556d)[_0x3183('0x23')](handleEntityNotFound(_0x50ac2c,null))['then'](respondWithResult(_0x50ac2c,null))['catch'](handleError(_0x50ac2c,null));};exports[_0x3183('0x37')]=function(_0x39d315,_0x51cad0){if(_0x39d315[_0x3183('0x56')]['id']){delete _0x39d315['body']['id'];}return db['FaxMessage'][_0x3183('0x55')]({'where':{'id':_0x39d315[_0x3183('0x57')]['id']}})[_0x3183('0x23')](handleEntityNotFound(_0x51cad0,null))[_0x3183('0x23')](saveUpdates(_0x39d315[_0x3183('0x56')],null))[_0x3183('0x23')](respondWithResult(_0x51cad0,null))[_0x3183('0x2a')](handleError(_0x51cad0,null));};exports[_0x3183('0x58')]=function(_0xb487ba,_0x241b20){return db['FaxMessage'][_0x3183('0x55')]({'where':{'id':_0xb487ba[_0x3183('0x57')]['id']}})[_0x3183('0x23')](handleEntityNotFound(_0x241b20,null))[_0x3183('0x23')](removeEntity(_0x241b20,null))['catch'](handleError(_0x241b20,null));};exports[_0x3183('0x59')]=function(_0x11ae40,_0x4ccfbb){return db[_0x3183('0x3c')][_0x3183('0x59')]()[_0x3183('0x23')](respondWithResult(_0x4ccfbb,null))['catch'](handleError(_0x4ccfbb,null));};var interaction_log=require('../../config/logger')(_0x3183('0x5a'));exports[_0x3183('0x5b')]=function(_0x3b420b,_0x3a6a23,_0x478a57){var _0xb04887={'agent':{},'channel':_0x3183('0x5c')};if(_0x3b420b['body']['id']){delete _0x3b420b['body']['id'];}_0x3b420b[_0x3183('0x56')][_0x3183('0x5d')]=!![];_0x3b420b[_0x3183('0x56')]['readAt']=moment()[_0x3183('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');_0x3b420b[_0x3183('0x56')][_0x3183('0x5f')]=_0x3b420b[_0x3183('0x56')][_0x3183('0x5f')]||_0x3b420b[_0x3183('0x60')]['id'];_0xb04887['agent']['id']=_0x3b420b[_0x3183('0x56')][_0x3183('0x5f')];return db[_0x3183('0x3c')][_0x3183('0x55')]({'where':{'id':_0x3b420b[_0x3183('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3a6a23,null))['then'](saveUpdates(_0x3b420b[_0x3183('0x56')],null))['then'](function(_0xa7e34f){if(_0xa7e34f){_0xb04887[_0x3183('0x28')]=_0xa7e34f[_0x3183('0x61')]({'plain':!![]});return db[_0x3183('0x62')]['find']({'where':{'id':_0xa7e34f[_0x3183('0x63')]}});}return null;})[_0x3183('0x23')](handleEntityNotFound(_0x3a6a23,null))[_0x3183('0x23')](function(_0x4b2504){if(_0x4b2504){return _0x4b2504[_0x3183('0x37')]({'UserId':_0x3b420b['body']['UserId'],'read1stAt':_[_0x3183('0x64')](_0x4b2504[_0x3183('0x65')])?moment()['format'](_0x3183('0x66')):undefined});}return null;})[_0x3183('0x23')](function(_0x377b9d){if(_0x377b9d){_0xb04887[_0x3183('0x67')]=_0x377b9d['get']({'plain':!![]});interaction_log['info'](_0x3183('0x68'),_0x3b420b[_0x3183('0x60')]['id'],_0x3b420b[_0x3183('0x60')]['name'],_0x3b420b[_0x3183('0x60')][_0x3183('0x69')],_0xb04887[_0x3183('0x67')]['id'],_0x3b420b[_0x3183('0x56')]?JSON[_0x3183('0x6a')](_0x3b420b[_0x3183('0x56')]):_0x3183('0x6b'));return respondWithRpcPromise(_0x3183('0x6c'),'acceptMessage',_0xb04887);}return null;})[_0x3183('0x23')](function(_0x5caf73){var _0x3229c1='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5caf73[_0x3183('0x28')][_0x3183('0x6d')];return db[_0x3183('0x6e')][_0x3183('0x43')](_0x3229c1,{'type':db[_0x3183('0x6f')][_0x3183('0x70')][_0x3183('0x71')],'raw':!![]})[_0x3183('0x23')](function(_0x59b690){return _0x59b690;});})[_0x3183('0x23')](function(_0x1081bd){if(_0x1081bd){_0xb04887[_0x3183('0x28')][_0x3183('0x72')]=_0x1081bd[0x0];if(!_0x3b420b[_0x3183('0x56')]['UserId'])return;return db[_0x3183('0x73')][_0x3183('0x55')]({'where':{'id':_0x3b420b[_0x3183('0x56')]['UserId'],'role':_0x3183('0x74')},'attributes':['id',_0x3183('0x42'),_0x3183('0x75'),'email',_0x3183('0x76')],'raw':!![]});}return null;})[_0x3183('0x23')](function(_0x1dcb62){if(!_0x1dcb62)return null;_0xb04887[_0x3183('0x28')][_0x3183('0x74')]=_0x1dcb62;return _0xb04887;})[_0x3183('0x23')](function(_0x47943a){if(_0x47943a){if(_0x3b420b[_0x3183('0x56')][_0x3183('0x77')]){_0xb04887['message'][_0x3183('0x78')]=util[_0x3183('0x5e')](_0x3183('0x79'),_0x3b420b[_0x3183('0x60')]['name']);_0xb04887[_0x3183('0x28')]['channel']=_0xb04887[_0x3183('0x7a')];_0xb04887[_0x3183('0x28')][_0x3183('0x7b')]=_0xb04887['channel'];_0xb04887['message'][_0x3183('0x7c')]=_0x3183('0x5b');return respondWithRpcPromise(_0x3183('0x7d'),_0x3183('0x7d'),{'event':_0x3183('0x7e'),'message':_0xb04887[_0x3183('0x28')]},client9002)['then'](function(){return _0xb04887;});}return _0xb04887;}return null;})[_0x3183('0x23')](respondWithResult(_0x3a6a23,null))[_0x3183('0x2a')](handleError(_0x3a6a23,null));};var interaction_log=require('../../config/logger')(_0x3183('0x5a'));exports[_0x3183('0x35')]=function(_0x1f1aab,_0xa074c,_0x2943cf){var _0xc5fbdc={'agent':{},'channel':_0x3183('0x5c')};if(_0x1f1aab[_0x3183('0x56')]['id']){delete _0x1f1aab[_0x3183('0x56')]['id'];}_0x1f1aab['body'][_0x3183('0x5f')]=_0x1f1aab[_0x3183('0x56')][_0x3183('0x5f')]||_0x1f1aab[_0x3183('0x60')]['id'];_0xc5fbdc[_0x3183('0x74')]['id']=_0x1f1aab[_0x3183('0x56')]['UserId'];return db['FaxMessage'][_0x3183('0x55')]({'where':{'id':_0x1f1aab['params']['id'],'UserId':null}})[_0x3183('0x23')](handleEntityNotFound(_0xa074c,null))[_0x3183('0x23')](function(_0x1b6d0f){if(_0x1b6d0f){_0xc5fbdc[_0x3183('0x28')]=_0x1b6d0f[_0x3183('0x61')]({'plain':!![]});return db['FaxInteraction']['find']({'where':{'id':_0x1b6d0f[_0x3183('0x63')]}});}return null;})['then'](handleEntityNotFound(_0xa074c,null))[_0x3183('0x23')](function(_0x4d9b6e){if(_0x4d9b6e){_0xc5fbdc['interaction']=_0x4d9b6e[_0x3183('0x61')]({'plain':!![]});interaction_log[_0x3183('0x29')](_0x3183('0x7f'),_0x1f1aab[_0x3183('0x60')]['id'],_0x1f1aab[_0x3183('0x60')][_0x3183('0x42')],_0x1f1aab[_0x3183('0x60')]['role'],_0xc5fbdc['interaction']['id'],_0x1f1aab[_0x3183('0x56')]?JSON[_0x3183('0x6a')](_0x1f1aab[_0x3183('0x56')]):_0x3183('0x6b'));return respondWithRpcPromise(_0x3183('0x80'),_0x3183('0x81'),_0xc5fbdc);}return null;})[_0x3183('0x23')](function(_0xc4f43c){var _0x3340ce=_0x3183('0x82')+_0xc4f43c[_0x3183('0x28')][_0x3183('0x6d')];return db[_0x3183('0x6e')]['query'](_0x3340ce,{'type':db[_0x3183('0x6f')][_0x3183('0x70')][_0x3183('0x71')],'raw':!![]})['then'](function(_0x35ba0e){return _0x35ba0e;});})[_0x3183('0x23')](function(_0x2b3525){if(_0x2b3525){_0xc5fbdc[_0x3183('0x28')][_0x3183('0x72')]=_0x2b3525[0x0];if(!_0x1f1aab[_0x3183('0x56')][_0x3183('0x5f')])return;return db[_0x3183('0x73')][_0x3183('0x55')]({'where':{'id':_0x1f1aab[_0x3183('0x56')][_0x3183('0x5f')],'role':_0x3183('0x74')},'attributes':['id','name',_0x3183('0x75'),'email',_0x3183('0x76')],'raw':!![]});}return null;})[_0x3183('0x23')](function(_0x4bdcca){if(!_0x4bdcca)return null;_0xc5fbdc['message'][_0x3183('0x74')]=_0x4bdcca;return _0xc5fbdc;})[_0x3183('0x23')](function(_0x5dbd9c){if(_0x5dbd9c){_0x5dbd9c[_0x3183('0x28')][_0x3183('0x78')]=util[_0x3183('0x5e')](_0x3183('0x79'),_0x1f1aab[_0x3183('0x60')][_0x3183('0x42')]);_0x5dbd9c[_0x3183('0x28')][_0x3183('0x7a')]=_0xc5fbdc[_0x3183('0x7a')];_0x5dbd9c[_0x3183('0x28')]['motionChannel']=_0xc5fbdc[_0x3183('0x7a')];_0x5dbd9c[_0x3183('0x28')]['event']='reject';respondWithRpcPromise(_0x3183('0x7d'),_0x3183('0x7d'),{'event':_0x3183('0x83'),'message':_0x5dbd9c[_0x3183('0x28')]},client9002);return _0xc5fbdc;}return null;})[_0x3183('0x23')](respondWithResult(_0xa074c,null))[_0x3183('0x2a')](handleError(_0xa074c,null));};exports[_0x3183('0x84')]=function(_0x45191,_0x333350){var _0x56986c;return db[_0x3183('0x3c')][_0x3183('0x84')](_0x45191[_0x3183('0x56')],{})[_0x3183('0x23')](function(_0x1c78ef){_0x56986c=_0x1c78ef;return db[_0x3183('0x85')][_0x3183('0x86')]({'where':{'id':_0x56986c[_0x3183('0x6d')]}});})[_0x3183('0x23')](function(_0x73db8b){if(_[_0x3183('0x64')](_0x73db8b)){return;}else{_0x56986c[_0x3183('0x5c')]=_0x73db8b[_0x3183('0x5c')];return db[_0x3183('0x87')]['findOne']({'where':{'id':_0x56986c['AttachmentId']}});}})[_0x3183('0x23')](function(_0x5a0dfc){return respondWithRpcPromise(_0x3183('0x88'),'SendFax',{'FaxAccountId':_[_0x3183('0x64')](_0x45191[_0x3183('0x56')])?undefined:_0x45191['body']['FaxAccountId'],'path':_['isNil'](_0x5a0dfc)?undefined:util[_0x3183('0x5e')](_0x3183('0x89'),_0x5a0dfc[_0x3183('0x8a')]),'fax':_[_0x3183('0x64')](_0x56986c[_0x3183('0x5c')])?undefined:_0x56986c[_0x3183('0x5c')],'AttachmentId':_0x56986c[_0x3183('0x8b')]},client9002);})[_0x3183('0x23')](respondWithResult(_0x333350,0xc9))[_0x3183('0x2a')](handleError(_0x333350,null));};exports[_0x3183('0x8c')]=function(_0x361a92,_0x77eb20){var _0x362ce7=path['join'](config[_0x3183('0x8d')],_0x3183('0x8e'),_0x3183('0x8f'),_0x3183('0x90'));return db['FaxMessage']['find']({'where':{'id':_0x361a92[_0x3183('0x57')]['id']},'include':[{'model':db[_0x3183('0x87')],'as':_0x3183('0x87')}]})[_0x3183('0x23')](handleEntityNotFound(_0x77eb20,null))['then'](function(_0x254b69){if(_0x254b69){return _0x77eb20[_0x3183('0x8c')](path[_0x3183('0x91')](_0x362ce7,_0x254b69[_0x3183('0x87')][_0x3183('0x8a')]));}})['catch'](handleError(_0x77eb20,null));}; \ No newline at end of file +var _0x6e86=['debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','end','stack','name','map','FaxMessage','type','key','model','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','includeAll','include','findAll','rows','show','keys','rawAttributes','options','find','body','params','describe','accept','read','UserId','user','agent','get','FaxInteraction','isNil','format','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','manual','channel','event','EventManager','fax-interactions','fax','FaxInteractionId','RejectMessage','rejectMessage','ContactId','SIP/%s','motionChannel','create','findOne','SendFax','FaxAccountId','basename','AttachmentId','download','join','root','server','files','attachments','Attachment','eml-format','rimraf','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x1b561a,_0x25551c){var _0x4e9e58=function(_0x59b95f){while(--_0x59b95f){_0x1b561a['push'](_0x1b561a['shift']());}};_0x4e9e58(++_0x25551c);}(_0x6e86,0x183));var _0x66e8=function(_0x5de967,_0x515918){_0x5de967=_0x5de967-0x0;var _0x5b07a3=_0x6e86[_0x5de967];return _0x5b07a3;};'use strict';var emlformat=require(_0x66e8('0x0'));var rimraf=require(_0x66e8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x66e8('0x2'));var moment=require('moment');var BPromise=require(_0x66e8('0x3'));var Mustache=require(_0x66e8('0x4'));var util=require('util');var path=require('path');var sox=require(_0x66e8('0x5'));var csv=require(_0x66e8('0x6'));var ejs=require(_0x66e8('0x7'));var fs=require('fs');var fs_extra=require(_0x66e8('0x8'));var _=require(_0x66e8('0x9'));var squel=require('squel');var crypto=require(_0x66e8('0xa'));var jsforce=require(_0x66e8('0xb'));var deskjs=require(_0x66e8('0xc'));var toCsv=require(_0x66e8('0x6'));var querystring=require(_0x66e8('0xd'));var Papa=require('papaparse');var Redis=require(_0x66e8('0xe'));var authService=require(_0x66e8('0xf'));var qs=require(_0x66e8('0x10'));var as=require(_0x66e8('0x11'));var hardwareService=require(_0x66e8('0x12'));var logger=require(_0x66e8('0x13'))(_0x66e8('0x14'));var utils=require(_0x66e8('0x15'));var config=require(_0x66e8('0x16'));var licenseUtil=require(_0x66e8('0x17'));var db=require('../../mysqldb')['db'];config[_0x66e8('0x18')]=_[_0x66e8('0x19')](config[_0x66e8('0x18')],{'host':_0x66e8('0x1a'),'port':0x18eb});var socket=require(_0x66e8('0x1b'))(new Redis(config[_0x66e8('0x18')]));require(_0x66e8('0x1c'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x66e8('0x1d')][_0x66e8('0x1e')]({'port':0x232c});var client9002=jayson[_0x66e8('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1af838,_0x28c1ea,_0x366473,_0x1cf406){return new BPromise(function(_0x2f7980,_0x4378c5){var _0x14c742=_0x1cf406||client;return _0x14c742[_0x66e8('0x1f')](_0x1af838,_0x366473)[_0x66e8('0x20')](function(_0x23f1cd){logger[_0x66e8('0x21')](_0x66e8('0x22'),_0x28c1ea,_0x66e8('0x23'));logger[_0x66e8('0x24')](_0x66e8('0x25'),_0x28c1ea,_0x66e8('0x23'),JSON['stringify'](_0x23f1cd));if(_0x23f1cd[_0x66e8('0x26')]){if(_0x23f1cd['error'][_0x66e8('0x27')]===0x1f4){logger[_0x66e8('0x26')]('FaxMessage,\x20%s,\x20%s',_0x28c1ea,_0x23f1cd[_0x66e8('0x26')]['message']);return _0x4378c5(_0x23f1cd[_0x66e8('0x26')][_0x66e8('0x28')]);}logger[_0x66e8('0x26')]('FaxMessage,\x20%s,\x20%s',_0x28c1ea,_0x23f1cd[_0x66e8('0x26')]['message']);return _0x2f7980(_0x23f1cd[_0x66e8('0x26')]['message']);}else{logger[_0x66e8('0x21')](_0x66e8('0x22'),_0x28c1ea,'request\x20sent');_0x2f7980(_0x23f1cd[_0x66e8('0x29')]['message']);}})[_0x66e8('0x2a')](function(_0x999efa){logger['error'](_0x66e8('0x22'),_0x28c1ea,_0x999efa);_0x4378c5(_0x999efa);});});}function respondWithStatusCode(_0x356098,_0x1a3a5b){_0x1a3a5b=_0x1a3a5b||0xcc;return function(_0xc2bc0e){if(_0xc2bc0e){return _0x356098[_0x66e8('0x2b')](_0x1a3a5b);}return _0x356098[_0x66e8('0x2c')](_0x1a3a5b)['end']();};}function respondWithResult(_0x40de9a,_0x3dfead){_0x3dfead=_0x3dfead||0xc8;return function(_0x51979e){if(_0x51979e){return _0x40de9a[_0x66e8('0x2c')](_0x3dfead)[_0x66e8('0x2d')](_0x51979e);}};}function respondWithFilteredResult(_0x4cfec3,_0x521aac){return function(_0x8da4e){if(_0x8da4e){var _0x21643d=typeof _0x521aac[_0x66e8('0x2e')]===_0x66e8('0x2f')&&typeof _0x521aac['limit']===_0x66e8('0x2f');var _0x56385a=_0x8da4e[_0x66e8('0x30')];var _0x391200=_0x21643d?0x0:_0x521aac[_0x66e8('0x2e')];var _0x332b55=_0x21643d?_0x8da4e[_0x66e8('0x30')]:_0x521aac[_0x66e8('0x2e')]+_0x521aac[_0x66e8('0x31')];var _0x2a74ec;if(_0x332b55>=_0x56385a){_0x332b55=_0x56385a;_0x2a74ec=0xc8;}else{_0x2a74ec=0xce;}_0x4cfec3['status'](_0x2a74ec);return _0x4cfec3[_0x66e8('0x32')](_0x66e8('0x33'),_0x391200+'-'+_0x332b55+'/'+_0x56385a)[_0x66e8('0x2d')](_0x8da4e);}return null;};}function patchUpdates(_0x50246f){return function(_0x3ccd57){try{jsonpatch[_0x66e8('0x34')](_0x3ccd57,_0x50246f,!![]);}catch(_0x31559b){return BPromise[_0x66e8('0x35')](_0x31559b);}return _0x3ccd57[_0x66e8('0x36')]();};}function saveUpdates(_0xcb7eaa,_0x4e565e){return function(_0x17d49b){if(_0x17d49b){return _0x17d49b[_0x66e8('0x37')](_0xcb7eaa)['then'](function(_0x115185){return _0x115185;});}return null;};}function removeEntity(_0xa7b542,_0x4e45e5){return function(_0x56b5d6){if(_0x56b5d6){return _0x56b5d6[_0x66e8('0x38')]()[_0x66e8('0x20')](function(){_0xa7b542[_0x66e8('0x2c')](0xcc)[_0x66e8('0x39')]();});}};}function handleEntityNotFound(_0x5a5f85,_0x4236d3){return function(_0x49fa21){if(!_0x49fa21){_0x5a5f85['sendStatus'](0x194);}return _0x49fa21;};}function handleError(_0x23528a,_0x27119f){_0x27119f=_0x27119f||0x1f4;return function(_0x3fb26d){logger[_0x66e8('0x26')](_0x3fb26d[_0x66e8('0x3a')]);if(_0x3fb26d[_0x66e8('0x3b')]){delete _0x3fb26d[_0x66e8('0x3b')];}_0x23528a[_0x66e8('0x2c')](_0x27119f)['send'](_0x3fb26d);};}exports['index']=function(_0x4d7e3d,_0x285bed){var _0x386e75={},_0x22c8f6={},_0xd46b2c={'count':0x0,'rows':[]};var _0x34a777=_[_0x66e8('0x3c')](db[_0x66e8('0x3d')]['rawAttributes'],function(_0x1e0c14){return{'name':_0x1e0c14['fieldName'],'type':_0x1e0c14[_0x66e8('0x3e')][_0x66e8('0x3f')]};});_0x22c8f6[_0x66e8('0x40')]=_[_0x66e8('0x3c')](_0x34a777,_0x66e8('0x3b'));_0x22c8f6['query']=_['keys'](_0x4d7e3d['query']);_0x22c8f6['filters']=_[_0x66e8('0x41')](_0x22c8f6[_0x66e8('0x40')],_0x22c8f6[_0x66e8('0x42')]);_0x386e75[_0x66e8('0x43')]=_[_0x66e8('0x41')](_0x22c8f6[_0x66e8('0x40')],qs['fields'](_0x4d7e3d[_0x66e8('0x42')][_0x66e8('0x44')]));_0x386e75[_0x66e8('0x43')]=_0x386e75[_0x66e8('0x43')][_0x66e8('0x45')]?_0x386e75['attributes']:_0x22c8f6['model'];if(!_0x4d7e3d['query'][_0x66e8('0x46')](_0x66e8('0x47'))){_0x386e75[_0x66e8('0x31')]=qs[_0x66e8('0x31')](_0x4d7e3d[_0x66e8('0x42')]['limit']);_0x386e75[_0x66e8('0x2e')]=qs['offset'](_0x4d7e3d['query'][_0x66e8('0x2e')]);}_0x386e75[_0x66e8('0x48')]=qs[_0x66e8('0x49')](_0x4d7e3d[_0x66e8('0x42')][_0x66e8('0x49')]);_0x386e75[_0x66e8('0x4a')]=qs['filters'](_[_0x66e8('0x4b')](_0x4d7e3d[_0x66e8('0x42')],_0x22c8f6[_0x66e8('0x4c')]),_0x34a777);if(_0x4d7e3d[_0x66e8('0x42')][_0x66e8('0x4d')]){_0x386e75[_0x66e8('0x4a')]=_[_0x66e8('0x4e')](_0x386e75['where'],{'$or':_['map'](_0x34a777,function(_0x395c77){if(_0x395c77['type']!=='VIRTUAL'){var _0x563d26={};_0x563d26[_0x395c77[_0x66e8('0x3b')]]={'$like':'%'+_0x4d7e3d['query']['filter']+'%'};return _0x563d26;}})});}_0x386e75=_['merge']({},_0x386e75,_0x4d7e3d['options']);var _0x10252a={'where':_0x386e75['where']};return db[_0x66e8('0x3d')][_0x66e8('0x30')](_0x10252a)[_0x66e8('0x20')](function(_0x3ab0fb){_0xd46b2c[_0x66e8('0x30')]=_0x3ab0fb;if(_0x4d7e3d[_0x66e8('0x42')][_0x66e8('0x4f')]){_0x386e75[_0x66e8('0x50')]=[{'all':!![]}];}return db[_0x66e8('0x3d')][_0x66e8('0x51')](_0x386e75);})['then'](function(_0x3903cc){_0xd46b2c[_0x66e8('0x52')]=_0x3903cc;return _0xd46b2c;})['then'](respondWithFilteredResult(_0x285bed,_0x386e75))[_0x66e8('0x2a')](handleError(_0x285bed,null));};exports[_0x66e8('0x53')]=function(_0x3b2e41,_0xf63831){var _0x5bcb36={'raw':!![],'where':{'id':_0x3b2e41['params']['id']}},_0x59c6a1={};_0x59c6a1['model']=_[_0x66e8('0x54')](db[_0x66e8('0x3d')][_0x66e8('0x55')]);_0x59c6a1[_0x66e8('0x42')]=_[_0x66e8('0x54')](_0x3b2e41[_0x66e8('0x42')]);_0x59c6a1['filters']=_[_0x66e8('0x41')](_0x59c6a1[_0x66e8('0x40')],_0x59c6a1[_0x66e8('0x42')]);_0x5bcb36[_0x66e8('0x43')]=_[_0x66e8('0x41')](_0x59c6a1['model'],qs[_0x66e8('0x44')](_0x3b2e41[_0x66e8('0x42')][_0x66e8('0x44')]));_0x5bcb36['attributes']=_0x5bcb36['attributes'][_0x66e8('0x45')]?_0x5bcb36[_0x66e8('0x43')]:_0x59c6a1['model'];if(_0x3b2e41[_0x66e8('0x42')][_0x66e8('0x4f')]){_0x5bcb36[_0x66e8('0x50')]=[{'all':!![]}];}_0x5bcb36=_[_0x66e8('0x4e')]({},_0x5bcb36,_0x3b2e41[_0x66e8('0x56')]);return db[_0x66e8('0x3d')][_0x66e8('0x57')](_0x5bcb36)[_0x66e8('0x20')](handleEntityNotFound(_0xf63831,null))['then'](respondWithResult(_0xf63831,null))[_0x66e8('0x2a')](handleError(_0xf63831,null));};exports['update']=function(_0x551d31,_0x1d3342){if(_0x551d31[_0x66e8('0x58')]['id']){delete _0x551d31[_0x66e8('0x58')]['id'];}return db[_0x66e8('0x3d')]['find']({'where':{'id':_0x551d31[_0x66e8('0x59')]['id']}})[_0x66e8('0x20')](handleEntityNotFound(_0x1d3342,null))[_0x66e8('0x20')](saveUpdates(_0x551d31[_0x66e8('0x58')],null))[_0x66e8('0x20')](respondWithResult(_0x1d3342,null))[_0x66e8('0x2a')](handleError(_0x1d3342,null));};exports[_0x66e8('0x38')]=function(_0x32dd97,_0x401ccf){return db['FaxMessage'][_0x66e8('0x57')]({'where':{'id':_0x32dd97[_0x66e8('0x59')]['id']}})['then'](handleEntityNotFound(_0x401ccf,null))[_0x66e8('0x20')](removeEntity(_0x401ccf,null))[_0x66e8('0x2a')](handleError(_0x401ccf,null));};exports[_0x66e8('0x5a')]=function(_0x4fb97f,_0x528e4c){return db[_0x66e8('0x3d')]['describe']()[_0x66e8('0x20')](respondWithResult(_0x528e4c,null))['catch'](handleError(_0x528e4c,null));};var interaction_log=require(_0x66e8('0x13'))('fax-interactions');exports[_0x66e8('0x5b')]=function(_0x2a07a6,_0x5acd56,_0xd4c775){var _0x2248dc={'agent':{},'channel':'fax'};if(_0x2a07a6['body']['id']){delete _0x2a07a6[_0x66e8('0x58')]['id'];}_0x2a07a6[_0x66e8('0x58')][_0x66e8('0x5c')]=!![];_0x2a07a6['body']['readAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2a07a6['body']['UserId']=_0x2a07a6[_0x66e8('0x58')][_0x66e8('0x5d')]||_0x2a07a6[_0x66e8('0x5e')]['id'];_0x2248dc[_0x66e8('0x5f')]['id']=_0x2a07a6[_0x66e8('0x58')][_0x66e8('0x5d')];return db[_0x66e8('0x3d')][_0x66e8('0x57')]({'where':{'id':_0x2a07a6['params']['id'],'UserId':null}})[_0x66e8('0x20')](handleEntityNotFound(_0x5acd56,null))['then'](saveUpdates(_0x2a07a6[_0x66e8('0x58')],null))[_0x66e8('0x20')](function(_0x71bc8){if(_0x71bc8){_0x2248dc[_0x66e8('0x28')]=_0x71bc8[_0x66e8('0x60')]({'plain':!![]});return db[_0x66e8('0x61')][_0x66e8('0x57')]({'where':{'id':_0x71bc8['FaxInteractionId']}});}return null;})[_0x66e8('0x20')](handleEntityNotFound(_0x5acd56,null))['then'](function(_0x5609af){if(_0x5609af){return _0x5609af[_0x66e8('0x37')]({'UserId':_0x2a07a6[_0x66e8('0x58')]['UserId'],'read1stAt':_[_0x66e8('0x62')](_0x5609af['read1stAt'])?moment()[_0x66e8('0x63')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x66e8('0x20')](function(_0x4b9240){if(_0x4b9240){_0x2248dc['interaction']=_0x4b9240[_0x66e8('0x60')]({'plain':!![]});interaction_log[_0x66e8('0x21')](_0x66e8('0x64'),_0x2a07a6['user']['id'],_0x2a07a6[_0x66e8('0x5e')]['name'],_0x2a07a6[_0x66e8('0x5e')][_0x66e8('0x65')],_0x2248dc[_0x66e8('0x66')]['id'],_0x2a07a6[_0x66e8('0x58')]?JSON[_0x66e8('0x67')](_0x2a07a6[_0x66e8('0x58')]):_0x66e8('0x68'));return respondWithRpcPromise(_0x66e8('0x69'),_0x66e8('0x6a'),_0x2248dc);}return null;})[_0x66e8('0x20')](function(_0x572600){var _0x49f5b5=_0x66e8('0x6b')+_0x572600[_0x66e8('0x28')]['ContactId'];return db[_0x66e8('0x6c')][_0x66e8('0x42')](_0x49f5b5,{'type':db[_0x66e8('0x6d')][_0x66e8('0x6e')][_0x66e8('0x6f')],'raw':!![]})['then'](function(_0x377e73){return _0x377e73;});})[_0x66e8('0x20')](function(_0x413b69){if(_0x413b69){_0x2248dc[_0x66e8('0x28')][_0x66e8('0x70')]=_0x413b69[0x0];if(!_0x2a07a6[_0x66e8('0x58')]['UserId'])return;return db[_0x66e8('0x71')][_0x66e8('0x57')]({'where':{'id':_0x2a07a6['body']['UserId'],'role':'agent'},'attributes':['id',_0x66e8('0x3b'),_0x66e8('0x72'),_0x66e8('0x73'),'internal'],'raw':!![]});}return null;})[_0x66e8('0x20')](function(_0x56af77){if(!_0x56af77)return null;_0x2248dc[_0x66e8('0x28')][_0x66e8('0x5f')]=_0x56af77;return _0x2248dc;})[_0x66e8('0x20')](function(_0x309925){if(_0x309925){if(_0x2a07a6[_0x66e8('0x58')][_0x66e8('0x74')]){_0x2248dc[_0x66e8('0x28')]['interface']=util[_0x66e8('0x63')]('SIP/%s',_0x2a07a6['user'][_0x66e8('0x3b')]);_0x2248dc['message']['channel']=_0x2248dc['channel'];_0x2248dc['message']['motionChannel']=_0x2248dc[_0x66e8('0x75')];_0x2248dc['message'][_0x66e8('0x76')]=_0x66e8('0x5b');return respondWithRpcPromise('EventManager',_0x66e8('0x77'),{'event':'acceptmessage','message':_0x2248dc['message']},client9002)['then'](function(){return _0x2248dc;});}return _0x2248dc;}return null;})[_0x66e8('0x20')](respondWithResult(_0x5acd56,null))[_0x66e8('0x2a')](handleError(_0x5acd56,null));};var interaction_log=require('../../config/logger')(_0x66e8('0x78'));exports[_0x66e8('0x35')]=function(_0x35022f,_0x4b0003,_0xd1df11){var _0x562ca8={'agent':{},'channel':_0x66e8('0x79')};if(_0x35022f['body']['id']){delete _0x35022f['body']['id'];}_0x35022f[_0x66e8('0x58')][_0x66e8('0x5d')]=_0x35022f[_0x66e8('0x58')][_0x66e8('0x5d')]||_0x35022f[_0x66e8('0x5e')]['id'];_0x562ca8[_0x66e8('0x5f')]['id']=_0x35022f['body'][_0x66e8('0x5d')];return db['FaxMessage'][_0x66e8('0x57')]({'where':{'id':_0x35022f['params']['id'],'UserId':null}})[_0x66e8('0x20')](handleEntityNotFound(_0x4b0003,null))[_0x66e8('0x20')](function(_0x37ca18){if(_0x37ca18){_0x562ca8[_0x66e8('0x28')]=_0x37ca18[_0x66e8('0x60')]({'plain':!![]});return db['FaxInteraction'][_0x66e8('0x57')]({'where':{'id':_0x37ca18[_0x66e8('0x7a')]}});}return null;})['then'](handleEntityNotFound(_0x4b0003,null))[_0x66e8('0x20')](function(_0x2d59a0){if(_0x2d59a0){_0x562ca8[_0x66e8('0x66')]=_0x2d59a0[_0x66e8('0x60')]({'plain':!![]});interaction_log[_0x66e8('0x21')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x35022f[_0x66e8('0x5e')]['id'],_0x35022f['user'][_0x66e8('0x3b')],_0x35022f['user'][_0x66e8('0x65')],_0x562ca8[_0x66e8('0x66')]['id'],_0x35022f[_0x66e8('0x58')]?JSON[_0x66e8('0x67')](_0x35022f[_0x66e8('0x58')]):_0x66e8('0x68'));return respondWithRpcPromise(_0x66e8('0x7b'),_0x66e8('0x7c'),_0x562ca8);}return null;})[_0x66e8('0x20')](function(_0x34f2b0){var _0x19c8ff=_0x66e8('0x6b')+_0x34f2b0[_0x66e8('0x28')][_0x66e8('0x7d')];return db[_0x66e8('0x6c')][_0x66e8('0x42')](_0x19c8ff,{'type':db['Sequelize'][_0x66e8('0x6e')][_0x66e8('0x6f')],'raw':!![]})['then'](function(_0x2e0343){return _0x2e0343;});})[_0x66e8('0x20')](function(_0x23ba80){if(_0x23ba80){_0x562ca8[_0x66e8('0x28')][_0x66e8('0x70')]=_0x23ba80[0x0];if(!_0x35022f['body']['UserId'])return;return db[_0x66e8('0x71')]['find']({'where':{'id':_0x35022f[_0x66e8('0x58')][_0x66e8('0x5d')],'role':_0x66e8('0x5f')},'attributes':['id',_0x66e8('0x3b'),'fullname',_0x66e8('0x73'),'internal'],'raw':!![]});}return null;})[_0x66e8('0x20')](function(_0x589b23){if(!_0x589b23)return null;_0x562ca8['message'][_0x66e8('0x5f')]=_0x589b23;return _0x562ca8;})[_0x66e8('0x20')](function(_0x11335f){if(_0x11335f){_0x11335f[_0x66e8('0x28')]['interface']=util[_0x66e8('0x63')](_0x66e8('0x7e'),_0x35022f['user'][_0x66e8('0x3b')]);_0x11335f[_0x66e8('0x28')]['channel']=_0x562ca8[_0x66e8('0x75')];_0x11335f[_0x66e8('0x28')][_0x66e8('0x7f')]=_0x562ca8[_0x66e8('0x75')];_0x11335f[_0x66e8('0x28')]['event']=_0x66e8('0x35');respondWithRpcPromise(_0x66e8('0x77'),_0x66e8('0x77'),{'event':'rejectmessage','message':_0x11335f[_0x66e8('0x28')]},client9002);return _0x562ca8;}return null;})[_0x66e8('0x20')](respondWithResult(_0x4b0003,null))[_0x66e8('0x2a')](handleError(_0x4b0003,null));};exports[_0x66e8('0x80')]=function(_0x5d6de9,_0x2e7c08){var _0x2e556c;return db[_0x66e8('0x3d')][_0x66e8('0x80')](_0x5d6de9[_0x66e8('0x58')],{})[_0x66e8('0x20')](function(_0x3f2b60){_0x2e556c=_0x3f2b60;return db['CmContact']['findOne']({'where':{'id':_0x2e556c['ContactId']}});})[_0x66e8('0x20')](function(_0x298a5b){if(_[_0x66e8('0x62')](_0x298a5b)){return;}else{_0x2e556c['fax']=_0x298a5b['fax'];return db['Attachment'][_0x66e8('0x81')]({'where':{'id':_0x2e556c['AttachmentId']}});}})['then'](function(_0x5937b6){return respondWithRpcPromise(_0x66e8('0x82'),_0x66e8('0x82'),{'FaxAccountId':_[_0x66e8('0x62')](_0x5d6de9[_0x66e8('0x58')])?undefined:_0x5d6de9[_0x66e8('0x58')][_0x66e8('0x83')],'path':_[_0x66e8('0x62')](_0x5937b6)?undefined:util['format']('/var/opt/motion2/server/files/attachments/%s',_0x5937b6[_0x66e8('0x84')]),'fax':_[_0x66e8('0x62')](_0x2e556c[_0x66e8('0x79')])?undefined:_0x2e556c[_0x66e8('0x79')],'AttachmentId':_0x2e556c[_0x66e8('0x85')]},client9002);})[_0x66e8('0x20')](respondWithResult(_0x2e7c08,0xc9))['catch'](handleError(_0x2e7c08,null));};exports[_0x66e8('0x86')]=function(_0x436bab,_0x529efe){var _0x1de33=path[_0x66e8('0x87')](config[_0x66e8('0x88')],_0x66e8('0x89'),_0x66e8('0x8a'),_0x66e8('0x8b'));return db[_0x66e8('0x3d')]['find']({'where':{'id':_0x436bab[_0x66e8('0x59')]['id']},'include':[{'model':db[_0x66e8('0x8c')],'as':_0x66e8('0x8c')}]})['then'](handleEntityNotFound(_0x529efe,null))[_0x66e8('0x20')](function(_0xd3beda){if(_0xd3beda){return _0x529efe['download'](path['join'](_0x1de33,_0xd3beda[_0x66e8('0x8c')][_0x66e8('0x84')]));}})['catch'](handleError(_0x529efe,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 6a0d375..59d0442 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 _0x4c60=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage','setMaxListeners','update'];(function(_0x54ff84,_0x48029e){var _0x4a6623=function(_0x430fea){while(--_0x430fea){_0x54ff84['push'](_0x54ff84['shift']());}};_0x4a6623(++_0x48029e);}(_0x4c60,0xc1));var _0x04c6=function(_0x21151e,_0x22f8d2){_0x21151e=_0x21151e-0x0;var _0x11aeae=_0x4c60[_0x21151e];return _0x11aeae;};'use strict';var EventEmitter=require(_0x04c6('0x0'));var FaxMessage=require(_0x04c6('0x1'))['db'][_0x04c6('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x04c6('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x04c6('0x4'),'afterDestroy':'remove'};function emitEvent(_0x52a464){return function(_0x4ad4f1,_0x53ca7a,_0x3a9493){FaxMessageEvents[_0x04c6('0x5')](_0x52a464+':'+_0x4ad4f1['id'],_0x4ad4f1);FaxMessageEvents[_0x04c6('0x5')](_0x52a464,_0x4ad4f1);_0x3a9493(null);};}for(var e in events){if(events[_0x04c6('0x6')](e)){var event=events[e];FaxMessage[_0x04c6('0x7')](e,emitEvent(event));}}module[_0x04c6('0x8')]=FaxMessageEvents; \ No newline at end of file +var _0x39d2=['hasOwnProperty','hook','events','FaxMessage','setMaxListeners','save','update','remove','emit'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x39d2,0xf5));var _0x239d=function(_0x3e32a8,_0x255953){_0x3e32a8=_0x3e32a8-0x0;var _0x2997b0=_0x39d2[_0x3e32a8];return _0x2997b0;};'use strict';var EventEmitter=require(_0x239d('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0x239d('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x239d('0x2')](0x0);var events={'afterCreate':_0x239d('0x3'),'afterUpdate':_0x239d('0x4'),'afterDestroy':_0x239d('0x5')};function emitEvent(_0x29b3f0){return function(_0x298c6e,_0x1f5943,_0x367278){FaxMessageEvents[_0x239d('0x6')](_0x29b3f0+':'+_0x298c6e['id'],_0x298c6e);FaxMessageEvents[_0x239d('0x6')](_0x29b3f0,_0x298c6e);_0x367278(null);};}for(var e in events){if(events[_0x239d('0x7')](e)){var event=events[e];FaxMessage[_0x239d('0x8')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 4012aa0..b97ea69 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 _0xbff5=['../../config/environment','./faxMessage.attributes','exports','FaxMessage','fax_messages','fti_fax_messages','models','get','direction','toLowerCase','out','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','update','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x509ea6,_0x3678ba){var _0x41f711=function(_0x12177b){while(--_0x12177b){_0x509ea6['push'](_0x509ea6['shift']());}};_0x41f711(++_0x3678ba);}(_0xbff5,0x1e0));var _0x5bff=function(_0x23f045,_0x32740b){_0x23f045=_0x23f045-0x0;var _0x35c066=_0xbff5[_0x23f045];return _0x35c066;};'use strict';var _=require(_0x5bff('0x0'));var util=require(_0x5bff('0x1'));var logger=require(_0x5bff('0x2'))(_0x5bff('0x3'));var moment=require(_0x5bff('0x4'));var BPromise=require(_0x5bff('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5bff('0x6'));var attributes=require(_0x5bff('0x7'));module[_0x5bff('0x8')]=function(_0x2f7619,_0x240edb){return _0x2f7619['define'](_0x5bff('0x9'),attributes,{'tableName':_0x5bff('0xa'),'paranoid':![],'indexes':[{'name':_0x5bff('0xb'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x52c4f5,_0x4600f4,_0x34491e){var _0x3ab7ad=_0x2f7619[_0x5bff('0xc')];var _0xbbe46=_0x52c4f5[_0x5bff('0xd')]({'plain':!![]});if(_0xbbe46[_0x5bff('0xe')][_0x5bff('0xf')]()==='in'||_0xbbe46[_0x5bff('0xe')]['toLowerCase']()===_0x5bff('0x10')&&!_0xbbe46[_0x5bff('0x11')]&&!_[_0x5bff('0x12')](_0xbbe46[_0x5bff('0x13')])){_0x3ab7ad[_0x5bff('0x14')][_0x5bff('0x15')]({'where':{'id':_0xbbe46[_0x5bff('0x16')]}})['then'](function(_0x2c4a86){if(_0x2c4a86){_0x2c4a86[_0x5bff('0x17')]({'lastMsgAt':_0xbbe46['createdAt'],'lastMsgDirection':_0xbbe46[_0x5bff('0xe')][_0x5bff('0xf')]()});}})[_0x5bff('0x18')](function(_0x3bc462){console['error'](_0x3bc462);});}_0x34491e();}},'charset':_0x5bff('0x19'),'collate':_0x5bff('0x1a')});}; \ No newline at end of file +var _0xec10=['UserId','findOne','FaxInteractionId','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','FaxMessage','fti_fax_messages','body','FULLTEXT','models','get','direction','out','secret'];(function(_0x3bae58,_0x2a9314){var _0x228c11=function(_0x299a13){while(--_0x299a13){_0x3bae58['push'](_0x3bae58['shift']());}};_0x228c11(++_0x2a9314);}(_0xec10,0x75));var _0x0ec1=function(_0x3f3f5a,_0x18a48c){_0x3f3f5a=_0x3f3f5a-0x0;var _0x300242=_0xec10[_0x3f3f5a];return _0x300242;};'use strict';var _=require(_0x0ec1('0x0'));var util=require(_0x0ec1('0x1'));var logger=require(_0x0ec1('0x2'))(_0x0ec1('0x3'));var moment=require(_0x0ec1('0x4'));var BPromise=require('bluebird');var rp=require(_0x0ec1('0x5'));var fs=require('fs');var path=require(_0x0ec1('0x6'));var rimraf=require(_0x0ec1('0x7'));var config=require(_0x0ec1('0x8'));var attributes=require('./faxMessage.attributes');module['exports']=function(_0x28c5a4,_0x3ca7d4){return _0x28c5a4['define'](_0x0ec1('0x9'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0x0ec1('0xa'),'fields':[_0x0ec1('0xb')],'type':_0x0ec1('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x222af0,_0x20841b,_0x3cffb3){var _0x140c9f=_0x28c5a4[_0x0ec1('0xd')];var _0x3cf6c0=_0x222af0[_0x0ec1('0xe')]({'plain':!![]});if(_0x3cf6c0[_0x0ec1('0xf')]['toLowerCase']()==='in'||_0x3cf6c0[_0x0ec1('0xf')]['toLowerCase']()===_0x0ec1('0x10')&&!_0x3cf6c0[_0x0ec1('0x11')]&&!_['isNil'](_0x3cf6c0[_0x0ec1('0x12')])){_0x140c9f['FaxInteraction'][_0x0ec1('0x13')]({'where':{'id':_0x3cf6c0[_0x0ec1('0x14')]}})[_0x0ec1('0x15')](function(_0x3193b2){if(_0x3193b2){_0x3193b2[_0x0ec1('0x16')]({'lastMsgAt':_0x3cf6c0['createdAt'],'lastMsgDirection':_0x3cf6c0['direction']['toLowerCase']()});}})[_0x0ec1('0x17')](function(_0x5a7458){console[_0x0ec1('0x18')](_0x5a7458);});}_0x3cffb3();}},'charset':_0x0ec1('0x19'),'collate':_0x0ec1('0x1a')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 7dc45e4..d4299fc 100644 --- a/server/api/faxMessage/faxMessage.rpc.js +++ b/server/api/faxMessage/faxMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac31=['attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis','defaults','socket.io-emitter','./faxMessage.socket','register','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateFaxMessage','FaxMessage','create','body','options','raw','UpdateFaxMessage','update','where'];(function(_0x1f290c,_0x31e946){var _0x5106fa=function(_0x29c1d7){while(--_0x29c1d7){_0x1f290c['push'](_0x1f290c['shift']());}};_0x5106fa(++_0x31e946);}(_0xac31,0xca));var _0x1ac3=function(_0x255100,_0x13b774){_0x255100=_0x255100-0x0;var _0x261a7a=_0xac31[_0x255100];return _0x261a7a;};'use strict';var _=require(_0x1ac3('0x0'));var util=require(_0x1ac3('0x1'));var moment=require(_0x1ac3('0x2'));var BPromise=require(_0x1ac3('0x3'));var rs=require(_0x1ac3('0x4'));var fs=require('fs');var Redis=require(_0x1ac3('0x5'));var db=require(_0x1ac3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1ac3('0x7'))(_0x1ac3('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1ac3('0x9')][_0x1ac3('0xa')]({'port':0x232a});config[_0x1ac3('0xb')]=_[_0x1ac3('0xc')](config[_0x1ac3('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x1ac3('0xd'))(new Redis(config['redis']));require(_0x1ac3('0xe'))[_0x1ac3('0xf')](socket);function respondWithRpcPromise(_0x344674,_0x53500b,_0xa26c88){return new BPromise(function(_0x1e2642,_0x3e835b){return client[_0x1ac3('0x10')](_0x344674,_0xa26c88)[_0x1ac3('0x11')](function(_0x422d19){logger['info'](_0x1ac3('0x12'),_0x53500b,_0x1ac3('0x13'));logger[_0x1ac3('0x14')](_0x1ac3('0x15'),_0x53500b,'request\x20sent',JSON[_0x1ac3('0x16')](_0x422d19));if(_0x422d19[_0x1ac3('0x17')]){if(_0x422d19[_0x1ac3('0x17')][_0x1ac3('0x18')]===0x1f4){logger['error'](_0x1ac3('0x12'),_0x53500b,_0x422d19[_0x1ac3('0x17')]['message']);return _0x3e835b(_0x422d19[_0x1ac3('0x17')][_0x1ac3('0x19')]);}logger[_0x1ac3('0x17')]('FaxMessage,\x20%s,\x20%s',_0x53500b,_0x422d19[_0x1ac3('0x17')][_0x1ac3('0x19')]);return _0x1e2642(_0x422d19[_0x1ac3('0x17')]['message']);}else{logger[_0x1ac3('0x1a')]('FaxMessage,\x20%s,\x20%s',_0x53500b,_0x1ac3('0x13'));_0x1e2642(_0x422d19[_0x1ac3('0x1b')][_0x1ac3('0x19')]);}})[_0x1ac3('0x1c')](function(_0x18b985){logger['error'](_0x1ac3('0x12'),_0x53500b,_0x18b985);_0x3e835b(_0x18b985);});});}exports[_0x1ac3('0x1d')]=function(_0x296abf){var _0x257f60=this;return new Promise(function(_0x5f1918,_0x48d18a){return db[_0x1ac3('0x1e')][_0x1ac3('0x1f')](_0x296abf[_0x1ac3('0x20')],{'raw':_0x296abf[_0x1ac3('0x21')]?_0x296abf[_0x1ac3('0x21')][_0x1ac3('0x22')]===undefined?!![]:![]:!![]})[_0x1ac3('0x11')](function(_0x10912a){logger[_0x1ac3('0x1a')]('CreateFaxMessage',_0x296abf);logger[_0x1ac3('0x14')](_0x1ac3('0x1d'),_0x296abf,JSON['stringify'](_0x10912a));_0x5f1918(_0x10912a);})[_0x1ac3('0x1c')](function(_0x10f30c){logger['error'](_0x1ac3('0x1d'),_0x10f30c[_0x1ac3('0x19')],_0x296abf);_0x48d18a(_0x257f60[_0x1ac3('0x17')](0x1f4,_0x10f30c[_0x1ac3('0x19')]));});});};exports[_0x1ac3('0x23')]=function(_0x565a0f){var _0x5a2ab2=this;return new Promise(function(_0x503a64,_0x528807){return db['FaxMessage'][_0x1ac3('0x24')](_0x565a0f['body'],{'raw':_0x565a0f[_0x1ac3('0x21')]?_0x565a0f[_0x1ac3('0x21')][_0x1ac3('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x565a0f[_0x1ac3('0x21')]?_0x565a0f['options'][_0x1ac3('0x25')]||null:null,'attributes':_0x565a0f['options']?_0x565a0f[_0x1ac3('0x21')][_0x1ac3('0x26')]||null:null,'limit':_0x565a0f[_0x1ac3('0x21')]?_0x565a0f[_0x1ac3('0x21')][_0x1ac3('0x27')]||null:null})[_0x1ac3('0x11')](function(_0x9c17c2){logger['info'](_0x1ac3('0x23'),_0x565a0f);logger[_0x1ac3('0x14')](_0x1ac3('0x23'),_0x565a0f,JSON[_0x1ac3('0x16')](_0x9c17c2));_0x503a64(_0x9c17c2);})['catch'](function(_0x3591a9){logger[_0x1ac3('0x17')](_0x1ac3('0x23'),_0x3591a9[_0x1ac3('0x19')],_0x565a0f);_0x528807(_0x5a2ab2[_0x1ac3('0x17')](0x1f4,_0x3591a9['message']));});});}; \ No newline at end of file +var _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(_0x142020,_0x1f7233){var _0x40da8f=function(_0x17f0a3){while(--_0x17f0a3){_0x142020['push'](_0x142020['shift']());}};_0x40da8f(++_0x1f7233);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x1e295f,_0x2c4be0){_0x1e295f=_0x1e295f-0x0;var _0x50a8ce=_0x6f0d[_0x1e295f];return _0x50a8ce;};'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 ee6b9c2..b91051f 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 _0xb044=['length','./faxMessage.events','remove','update','removeListener','register'];(function(_0x376cc6,_0x5209bb){var _0x3fc9aa=function(_0x174f39){while(--_0x174f39){_0x376cc6['push'](_0x376cc6['shift']());}};_0x3fc9aa(++_0x5209bb);}(_0xb044,0xfd));var _0x4b04=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xb044[_0x11005e];return _0x29338f;};'use strict';var FaxMessageEvents=require(_0x4b04('0x0'));var events=['save',_0x4b04('0x1'),_0x4b04('0x2')];function createListener(_0x660aa5,_0x248a6d){return function(_0xd1d9a8){_0x248a6d['emit'](_0x660aa5,_0xd1d9a8);};}function removeListener(_0x56363b,_0x35f68c){return function(){FaxMessageEvents[_0x4b04('0x3')](_0x56363b,_0x35f68c);};}exports[_0x4b04('0x4')]=function(_0x2e3100){for(var _0x4f2e19=0x0,_0x389d79=events[_0x4b04('0x5')];_0x4f2e19<_0x389d79;_0x4f2e19++){var _0x1e06f6=events[_0x4f2e19];var _0x46b30a=createListener('faxMessage:'+_0x1e06f6,_0x2e3100);FaxMessageEvents['on'](_0x1e06f6,_0x46b30a);}}; \ No newline at end of file +var _0x747e=['update','emit','removeListener','register','length','save'];(function(_0x2e6820,_0x52d4d9){var _0xb358b1=function(_0x304aa6){while(--_0x304aa6){_0x2e6820['push'](_0x2e6820['shift']());}};_0xb358b1(++_0x52d4d9);}(_0x747e,0x161));var _0xe747=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x747e[_0xbd08b4];return _0x314f1e;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0xe747('0x0'),'remove',_0xe747('0x1')];function createListener(_0x30f3ea,_0xf0736a){return function(_0x43c338){_0xf0736a[_0xe747('0x2')](_0x30f3ea,_0x43c338);};}function removeListener(_0x5b7df5,_0x1a8e84){return function(){FaxMessageEvents[_0xe747('0x3')](_0x5b7df5,_0x1a8e84);};}exports[_0xe747('0x4')]=function(_0x57e089){for(var _0x2c8143=0x0,_0x116396=events[_0xe747('0x5')];_0x2c8143<_0x116396;_0x2c8143++){var _0x55c050=events[_0x2c8143];var _0x54f65a=createListener('faxMessage:'+_0x55c050,_0x57e089);FaxMessageEvents['on'](_0x55c050,_0x54f65a);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 26f043f..c879e9a 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 _0x22fb=['destroy','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','create','update','put','/:id/accept','accept','delete'];(function(_0x3ad7ad,_0x291a8d){var _0x225a60=function(_0xca7354){while(--_0xca7354){_0x3ad7ad['push'](_0x3ad7ad['shift']());}};_0x225a60(++_0x291a8d);}(_0x22fb,0x192));var _0xb22f=function(_0x597784,_0x288ed6){_0x597784=_0x597784-0x0;var _0x590e4d=_0x22fb[_0x597784];return _0x590e4d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb22f('0x0'));var timeout=require('connect-timeout');var express=require(_0xb22f('0x1'));var router=express[_0xb22f('0x2')]();var fs_extra=require(_0xb22f('0x3'));var auth=require(_0xb22f('0x4'));var interaction=require(_0xb22f('0x5'));var config=require('../../config/environment');var controller=require(_0xb22f('0x6'));router[_0xb22f('0x7')]('/',auth[_0xb22f('0x8')](),controller[_0xb22f('0x9')]);router[_0xb22f('0x7')](_0xb22f('0xa'),auth['isAuthenticated'](),controller[_0xb22f('0xb')]);router[_0xb22f('0x7')](_0xb22f('0xc'),auth[_0xb22f('0x8')](),controller[_0xb22f('0xd')]);router[_0xb22f('0x7')](_0xb22f('0xe'),auth[_0xb22f('0x8')](),controller[_0xb22f('0xf')]);router[_0xb22f('0x10')]('/',auth[_0xb22f('0x8')](),interaction['tracked']('fax','faxmessage:create'),controller[_0xb22f('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xb22f('0x12')]);router[_0xb22f('0x13')](_0xb22f('0x14'),auth[_0xb22f('0x8')](),controller[_0xb22f('0x15')]);router[_0xb22f('0x13')]('/:id/reject',auth[_0xb22f('0x8')](),controller['reject']);router[_0xb22f('0x16')]('/:id',auth[_0xb22f('0x8')](),controller[_0xb22f('0x17')]);module[_0xb22f('0x18')]=router; \ No newline at end of file +var _0x668b=['create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./faxMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/download','download','post','tracked','fax','faxmessage:create'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x668b,0x140));var _0xb668=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x668b[_0x433a86];return _0x23000c;};'use strict';var multer=require(_0xb668('0x0'));var util=require(_0xb668('0x1'));var path=require('path');var timeout=require(_0xb668('0x2'));var express=require(_0xb668('0x3'));var router=express['Router']();var fs_extra=require(_0xb668('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb668('0x5'));var config=require(_0xb668('0x6'));var controller=require(_0xb668('0x7'));router['get']('/',auth[_0xb668('0x8')](),controller[_0xb668('0x9')]);router[_0xb668('0xa')](_0xb668('0xb'),auth[_0xb668('0x8')](),controller[_0xb668('0xc')]);router['get'](_0xb668('0xd'),auth[_0xb668('0x8')](),controller[_0xb668('0xe')]);router[_0xb668('0xa')](_0xb668('0xf'),auth[_0xb668('0x8')](),controller[_0xb668('0x10')]);router[_0xb668('0x11')]('/',auth['isAuthenticated'](),interaction[_0xb668('0x12')](_0xb668('0x13'),_0xb668('0x14')),controller[_0xb668('0x15')]);router[_0xb668('0x16')](_0xb668('0xd'),auth[_0xb668('0x8')](),controller[_0xb668('0x17')]);router[_0xb668('0x16')](_0xb668('0x18'),auth[_0xb668('0x8')](),controller[_0xb668('0x19')]);router[_0xb668('0x16')](_0xb668('0x1a'),auth[_0xb668('0x8')](),controller[_0xb668('0x1b')]);router[_0xb668('0x1c')](_0xb668('0xd'),auth[_0xb668('0x8')](),controller[_0xb668('0x1d')]);module[_0xb668('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 e948f5f..5b18434 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 _0x2906=['sequelize','exports','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0x117821,_0xaa1933){var _0x4ae9ff=function(_0x253662){while(--_0x253662){_0x117821['push'](_0x117821['shift']());}};_0x4ae9ff(++_0xaa1933);}(_0x2906,0xe0));var _0x6290=function(_0xd63e2d,_0x37884c){_0xd63e2d=_0xd63e2d-0x0;var _0x384239=_0x2906[_0xd63e2d];return _0x384239;};'use strict';var Sequelize=require(_0x6290('0x0'));module[_0x6290('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x6290('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x6290('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6290('0x4')](_0x6290('0x5'),_0x6290('0x6'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xdf78=['ENUM','rrmemory','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x272b48,_0x72a3d7){var _0xafac03=function(_0x16a6b3){while(--_0x16a6b3){_0x272b48['push'](_0x272b48['shift']());}};_0xafac03(++_0x72a3d7);}(_0xdf78,0x143));var _0x8df7=function(_0x11bfb4,_0x4283ea){_0x11bfb4=_0x11bfb4-0x0;var _0x2ce785=_0xdf78[_0x11bfb4];return _0x2ce785;};'use strict';var Sequelize=require(_0x8df7('0x0'));module[_0x8df7('0x1')]={'name':{'type':Sequelize[_0x8df7('0x2')],'unique':_0x8df7('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x8df7('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8df7('0x5')](_0x8df7('0x6'),'beepall',_0x8df7('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x8df7('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 5f61b3f..f2e861a 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 _0x9f37=['type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','catch','show','params','rawAttributes','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','FaxQueues','UserProfileSection','userProfileId','error','describe','getMembers','findOne','UserFaxQueue','agent','faxPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','addTeams','User','Agents','online','voicePause','interface','sequelize','transaction','each','forEach','emit','userFaxQueue:save','removeTeams','ids','select','field','tq.TeamId','team_has_fax_queues','user_has_teams','FaxQueueId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','compact','value','removeAgents','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','UserProfileResource','stack','name','index','map','FaxQueue','fieldName'];(function(_0x2c2435,_0x110a99){var _0x53d09d=function(_0xb520d7){while(--_0xb520d7){_0x2c2435['push'](_0x2c2435['shift']());}};_0x53d09d(++_0x110a99);}(_0x9f37,0xdb));var _0x79f3=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0x9f37[_0x341e0f];return _0x59555a;};'use strict';var emlformat=require(_0x79f3('0x0'));var rimraf=require(_0x79f3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x79f3('0x2'));var rp=require(_0x79f3('0x3'));var moment=require(_0x79f3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x79f3('0x5'));var util=require(_0x79f3('0x6'));var path=require(_0x79f3('0x7'));var sox=require(_0x79f3('0x8'));var csv=require('to-csv');var ejs=require(_0x79f3('0x9'));var fs=require('fs');var fs_extra=require(_0x79f3('0xa'));var _=require(_0x79f3('0xb'));var squel=require(_0x79f3('0xc'));var crypto=require(_0x79f3('0xd'));var jsforce=require(_0x79f3('0xe'));var deskjs=require(_0x79f3('0xf'));var toCsv=require(_0x79f3('0x10'));var querystring=require('querystring');var Papa=require(_0x79f3('0x11'));var Redis=require(_0x79f3('0x12'));var authService=require(_0x79f3('0x13'));var qs=require(_0x79f3('0x14'));var as=require(_0x79f3('0x15'));var hardwareService=require(_0x79f3('0x16'));var logger=require('../../config/logger')(_0x79f3('0x17'));var utils=require(_0x79f3('0x18'));var config=require(_0x79f3('0x19'));var licenseUtil=require(_0x79f3('0x1a'));var db=require(_0x79f3('0x1b'))['db'];config['redis']=_[_0x79f3('0x1c')](config[_0x79f3('0x1d')],{'host':_0x79f3('0x1e'),'port':0x18eb});var socket=require(_0x79f3('0x1f'))(new Redis(config['redis']));require(_0x79f3('0x20'))[_0x79f3('0x21')](socket);function respondWithStatusCode(_0x1df51d,_0x4d12d0){_0x4d12d0=_0x4d12d0||0xcc;return function(_0x58e14e){if(_0x58e14e){return _0x1df51d[_0x79f3('0x22')](_0x4d12d0);}return _0x1df51d[_0x79f3('0x23')](_0x4d12d0)[_0x79f3('0x24')]();};}function respondWithResult(_0x19d14a,_0x4b84e1){_0x4b84e1=_0x4b84e1||0xc8;return function(_0x3772c5){if(_0x3772c5){return _0x19d14a['status'](_0x4b84e1)[_0x79f3('0x25')](_0x3772c5);}};}function respondWithFilteredResult(_0x3cb82a,_0x358cee){return function(_0xb4733f){if(_0xb4733f){var _0x1b5109=typeof _0x358cee[_0x79f3('0x26')]===_0x79f3('0x27')&&typeof _0x358cee[_0x79f3('0x28')]===_0x79f3('0x27');var _0x81da33=_0xb4733f[_0x79f3('0x29')];var _0x6116f9=_0x1b5109?0x0:_0x358cee[_0x79f3('0x26')];var _0x49e141=_0x1b5109?_0xb4733f[_0x79f3('0x29')]:_0x358cee[_0x79f3('0x26')]+_0x358cee['limit'];var _0x30e390;if(_0x49e141>=_0x81da33){_0x49e141=_0x81da33;_0x30e390=0xc8;}else{_0x30e390=0xce;}_0x3cb82a[_0x79f3('0x23')](_0x30e390);return _0x3cb82a[_0x79f3('0x2a')]('Content-Range',_0x6116f9+'-'+_0x49e141+'/'+_0x81da33)[_0x79f3('0x25')](_0xb4733f);}return null;};}function patchUpdates(_0x3b8fe2){return function(_0x1a5c5f){try{jsonpatch[_0x79f3('0x2b')](_0x1a5c5f,_0x3b8fe2,!![]);}catch(_0xea6914){return BPromise['reject'](_0xea6914);}return _0x1a5c5f[_0x79f3('0x2c')]();};}function saveUpdates(_0x49a546,_0x3f61b8){return function(_0x4c6c8d){if(_0x4c6c8d){return _0x4c6c8d[_0x79f3('0x2d')](_0x49a546)[_0x79f3('0x2e')](function(_0x46ff8d){return _0x46ff8d;});}return null;};}function removeEntity(_0x5d7266,_0x35aacd){return function(_0xe1bc9b){if(_0xe1bc9b){return _0xe1bc9b[_0x79f3('0x2f')]()['then'](function(){var _0x2e22c0=_0xe1bc9b['get']({'plain':!![]});var _0x32c13d='FaxQueues';return db[_0x79f3('0x30')]['destroy']({'where':{'type':_0x32c13d,'resourceId':_0x2e22c0['id']}})['then'](function(){return _0xe1bc9b;});})[_0x79f3('0x2e')](function(){_0x5d7266[_0x79f3('0x23')](0xcc)[_0x79f3('0x24')]();});}};}function handleEntityNotFound(_0x33b025,_0x458ab1){return function(_0x558bb7){if(!_0x558bb7){_0x33b025[_0x79f3('0x22')](0x194);}return _0x558bb7;};}function handleError(_0xf878ab,_0x238705){_0x238705=_0x238705||0x1f4;return function(_0x3b9c6d){logger['error'](_0x3b9c6d[_0x79f3('0x31')]);if(_0x3b9c6d[_0x79f3('0x32')]){delete _0x3b9c6d[_0x79f3('0x32')];}_0xf878ab[_0x79f3('0x23')](_0x238705)['send'](_0x3b9c6d);};}exports[_0x79f3('0x33')]=function(_0x2c3435,_0x389abf){var _0x44aca6={},_0x2ee4ee={},_0x4ea25e={'count':0x0,'rows':[]};var _0x854eda=_[_0x79f3('0x34')](db[_0x79f3('0x35')]['rawAttributes'],function(_0x3e1334){return{'name':_0x3e1334[_0x79f3('0x36')],'type':_0x3e1334[_0x79f3('0x37')]['key']};});_0x2ee4ee[_0x79f3('0x38')]=_[_0x79f3('0x34')](_0x854eda,'name');_0x2ee4ee[_0x79f3('0x39')]=_[_0x79f3('0x3a')](_0x2c3435['query']);_0x2ee4ee[_0x79f3('0x3b')]=_[_0x79f3('0x3c')](_0x2ee4ee[_0x79f3('0x38')],_0x2ee4ee[_0x79f3('0x39')]);_0x44aca6[_0x79f3('0x3d')]=_[_0x79f3('0x3c')](_0x2ee4ee[_0x79f3('0x38')],qs[_0x79f3('0x3e')](_0x2c3435['query'][_0x79f3('0x3e')]));_0x44aca6['attributes']=_0x44aca6['attributes'][_0x79f3('0x3f')]?_0x44aca6[_0x79f3('0x3d')]:_0x2ee4ee[_0x79f3('0x38')];if(!_0x2c3435['query']['hasOwnProperty'](_0x79f3('0x40'))){_0x44aca6[_0x79f3('0x28')]=qs[_0x79f3('0x28')](_0x2c3435[_0x79f3('0x39')][_0x79f3('0x28')]);_0x44aca6[_0x79f3('0x26')]=qs[_0x79f3('0x26')](_0x2c3435[_0x79f3('0x39')][_0x79f3('0x26')]);}_0x44aca6[_0x79f3('0x41')]=qs[_0x79f3('0x42')](_0x2c3435['query']['sort']);_0x44aca6[_0x79f3('0x43')]=qs[_0x79f3('0x3b')](_[_0x79f3('0x44')](_0x2c3435[_0x79f3('0x39')],_0x2ee4ee['filters']),_0x854eda);if(_0x2c3435[_0x79f3('0x39')]['filter']){_0x44aca6[_0x79f3('0x43')]=_['merge'](_0x44aca6[_0x79f3('0x43')],{'$or':_['map'](_0x854eda,function(_0x5628fa){if(_0x5628fa[_0x79f3('0x37')]!=='VIRTUAL'){var _0x54e5f2={};_0x54e5f2[_0x5628fa[_0x79f3('0x32')]]={'$like':'%'+_0x2c3435[_0x79f3('0x39')][_0x79f3('0x45')]+'%'};return _0x54e5f2;}})});}_0x44aca6=_[_0x79f3('0x46')]({},_0x44aca6,_0x2c3435['options']);var _0x108fc5={'where':_0x44aca6[_0x79f3('0x43')]};return db['FaxQueue']['count'](_0x108fc5)[_0x79f3('0x2e')](function(_0x4db7cf){_0x4ea25e[_0x79f3('0x29')]=_0x4db7cf;if(_0x2c3435['query'][_0x79f3('0x47')]){_0x44aca6[_0x79f3('0x48')]=[{'all':!![]}];}return db[_0x79f3('0x35')][_0x79f3('0x49')](_0x44aca6);})[_0x79f3('0x2e')](function(_0x198c28){_0x4ea25e['rows']=_0x198c28;return _0x4ea25e;})['then'](respondWithFilteredResult(_0x389abf,_0x44aca6))[_0x79f3('0x4a')](handleError(_0x389abf,null));};exports[_0x79f3('0x4b')]=function(_0x5097eb,_0x1747a6){var _0x1d304f={'raw':!![],'where':{'id':_0x5097eb[_0x79f3('0x4c')]['id']}},_0x3c2eb1={};_0x3c2eb1['model']=_[_0x79f3('0x3a')](db[_0x79f3('0x35')][_0x79f3('0x4d')]);_0x3c2eb1[_0x79f3('0x39')]=_[_0x79f3('0x3a')](_0x5097eb[_0x79f3('0x39')]);_0x3c2eb1[_0x79f3('0x3b')]=_[_0x79f3('0x3c')](_0x3c2eb1[_0x79f3('0x38')],_0x3c2eb1[_0x79f3('0x39')]);_0x1d304f[_0x79f3('0x3d')]=_[_0x79f3('0x3c')](_0x3c2eb1[_0x79f3('0x38')],qs['fields'](_0x5097eb[_0x79f3('0x39')][_0x79f3('0x3e')]));_0x1d304f[_0x79f3('0x3d')]=_0x1d304f[_0x79f3('0x3d')]['length']?_0x1d304f[_0x79f3('0x3d')]:_0x3c2eb1[_0x79f3('0x38')];if(_0x5097eb['query'][_0x79f3('0x47')]){_0x1d304f[_0x79f3('0x48')]=[{'all':!![]}];}_0x1d304f=_[_0x79f3('0x46')]({},_0x1d304f,_0x5097eb[_0x79f3('0x4e')]);return db[_0x79f3('0x35')][_0x79f3('0x4f')](_0x1d304f)['then'](handleEntityNotFound(_0x1747a6,null))[_0x79f3('0x2e')](respondWithResult(_0x1747a6,null))[_0x79f3('0x4a')](handleError(_0x1747a6,null));};exports[_0x79f3('0x50')]=function(_0x95f037,_0x510656){return db[_0x79f3('0x35')][_0x79f3('0x50')](_0x95f037[_0x79f3('0x51')],{})['then'](function(_0x4b6c5f){var _0x3ee58f=_0x95f037[_0x79f3('0x52')]['get']({'plain':!![]});if(!_0x3ee58f)throw new Error(_0x79f3('0x53'));if(_0x3ee58f['role']===_0x79f3('0x52')){var _0x301408=_0x4b6c5f[_0x79f3('0x54')]({'plain':!![]});var _0x1b22a1=_0x79f3('0x55');return db[_0x79f3('0x56')][_0x79f3('0x4f')]({'where':{'name':_0x1b22a1,'userProfileId':_0x3ee58f[_0x79f3('0x57')]},'raw':!![]})[_0x79f3('0x2e')](function(_0x4184a3){if(_0x4184a3&&_0x4184a3['autoAssociation']===0x0){return db[_0x79f3('0x30')]['create']({'name':_0x301408[_0x79f3('0x32')],'resourceId':_0x301408['id'],'type':_0x4184a3[_0x79f3('0x32')],'sectionId':_0x4184a3['id']},{})[_0x79f3('0x2e')](function(){return _0x4b6c5f;});}else{return _0x4b6c5f;}})[_0x79f3('0x4a')](function(_0x30fd8c){logger[_0x79f3('0x58')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x30fd8c);throw _0x30fd8c;});}return _0x4b6c5f;})[_0x79f3('0x2e')](respondWithResult(_0x510656,0xc9))[_0x79f3('0x4a')](handleError(_0x510656,null));};exports['update']=function(_0x1a5561,_0x460646){if(_0x1a5561[_0x79f3('0x51')]['id']){delete _0x1a5561[_0x79f3('0x51')]['id'];}return db[_0x79f3('0x35')][_0x79f3('0x4f')]({'where':{'id':_0x1a5561['params']['id']}})[_0x79f3('0x2e')](handleEntityNotFound(_0x460646,null))['then'](saveUpdates(_0x1a5561[_0x79f3('0x51')],null))[_0x79f3('0x2e')](respondWithResult(_0x460646,null))[_0x79f3('0x4a')](handleError(_0x460646,null));};exports[_0x79f3('0x2f')]=function(_0x2bb5d4,_0x449207){return db[_0x79f3('0x35')]['find']({'where':{'id':_0x2bb5d4[_0x79f3('0x4c')]['id']}})['then'](handleEntityNotFound(_0x449207,null))[_0x79f3('0x2e')](removeEntity(_0x449207,null))[_0x79f3('0x4a')](handleError(_0x449207,null));};exports[_0x79f3('0x59')]=function(_0x1f740a,_0x40322e){return db[_0x79f3('0x35')][_0x79f3('0x59')]()['then'](respondWithResult(_0x40322e,null))[_0x79f3('0x4a')](handleError(_0x40322e,null));};exports[_0x79f3('0x5a')]=function(_0x6f3f44,_0x409a09,_0x28b67d){var _0x4f4598={'raw':!![],'where':{}},_0x932180={},_0xccfc47;return db[_0x79f3('0x35')][_0x79f3('0x5b')]({'where':{'id':_0x6f3f44[_0x79f3('0x4c')]['id']}})[_0x79f3('0x2e')](handleEntityNotFound(_0x409a09,null))[_0x79f3('0x2e')](function(_0x333282){if(_0x333282){_0xccfc47=_0x333282[_0x79f3('0x54')]({'plain':!![]});_0x932180[_0x79f3('0x38')]=_[_0x79f3('0x3a')](db[_0x79f3('0x5c')]['rawAttributes']);_0x932180['query']=_['keys'](_0x6f3f44[_0x79f3('0x39')]);_0x932180[_0x79f3('0x3b')]=_[_0x79f3('0x3c')](_0x932180['model'],_0x932180[_0x79f3('0x39')]);_0x4f4598[_0x79f3('0x3d')]=_['intersection'](_0x932180[_0x79f3('0x38')],qs[_0x79f3('0x3e')](_0x6f3f44[_0x79f3('0x39')]['fields']));_0x4f4598[_0x79f3('0x3d')]=_0x4f4598[_0x79f3('0x3d')][_0x79f3('0x3f')]?_0x4f4598['attributes']:_0x932180[_0x79f3('0x38')];if(!_0x6f3f44[_0x79f3('0x39')]['hasOwnProperty']('nolimit')){_0x4f4598['limit']=qs['limit'](_0x6f3f44[_0x79f3('0x39')][_0x79f3('0x28')]);_0x4f4598[_0x79f3('0x26')]=qs[_0x79f3('0x26')](_0x6f3f44['query'][_0x79f3('0x26')]);}_0x4f4598['order']=qs[_0x79f3('0x42')](_0x6f3f44['query'][_0x79f3('0x42')]);_0x4f4598[_0x79f3('0x43')]=qs[_0x79f3('0x3b')](_[_0x79f3('0x44')](_0x6f3f44[_0x79f3('0x39')],_0x932180[_0x79f3('0x3b')]));_0x4f4598[_0x79f3('0x43')]['FaxQueueId']=_0x333282['id'];if(_0x6f3f44[_0x79f3('0x39')]['filter']){_0x4f4598[_0x79f3('0x43')]=_[_0x79f3('0x46')](_0x4f4598[_0x79f3('0x43')],{'$or':_[_0x79f3('0x34')](_0x4f4598['attributes'],function(_0x3637b4){var _0x1597e4={};_0x1597e4[_0x3637b4]={'$like':'%'+_0x6f3f44[_0x79f3('0x39')]['filter']+'%'};return _0x1597e4;})});}_0x4f4598=_[_0x79f3('0x46')]({},_0x4f4598,_0x6f3f44[_0x79f3('0x4e')]);return db['UserFaxQueue'][_0x79f3('0x49')](_0x4f4598);}})[_0x79f3('0x2e')](function(_0x1af49e){if(_0x1af49e){return db['User']['findAndCountAll']({'where':{'id':_[_0x79f3('0x34')](_0x1af49e,'UserId'),'role':_0x79f3('0x5d')},'attributes':['id','name',_0x79f3('0x5e'),_0x79f3('0x5f'),_0x79f3('0x60')]});}})[_0x79f3('0x2e')](function(_0x156f6c){if(_0x156f6c){return{'count':_0x156f6c['count'],'rows':_[_0x79f3('0x34')](_0x156f6c['rows'],function(_0x29e22a){return{'membername':_0x29e22a[_0x79f3('0x32')],'UserId':_0x29e22a['id'],'queue_name':_0xccfc47[_0x79f3('0x32')],'FaxQueueId':_0xccfc47['id'],'interface':util['format'](_0x79f3('0x61'),_0x79f3('0x62'),_0x29e22a[_0x79f3('0x32')]),'penalty':0x0,'paused':_0x29e22a[_0x79f3('0x5e')],'createdAt':_0x29e22a[_0x79f3('0x60')],'updatedAt':_0x29e22a[_0x79f3('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x79f3('0x2e')](respondWithFilteredResult(_0x409a09,_0x4f4598))['catch'](handleError(_0x409a09,null));};exports[_0x79f3('0x63')]=function(_0x58a864,_0xfcfe31,_0x2bbba5){var _0x5ccb67={};var _0x227bb2={};var _0x47a016;var _0x2ccfac;return db['FaxQueue'][_0x79f3('0x5b')]({'where':{'id':_0x58a864[_0x79f3('0x4c')]['id']}})[_0x79f3('0x2e')](handleEntityNotFound(_0xfcfe31,null))['then'](function(_0x9e206f){if(_0x9e206f){_0x47a016=_0x9e206f;_0x227bb2[_0x79f3('0x38')]=_[_0x79f3('0x3a')](db[_0x79f3('0x64')][_0x79f3('0x4d')]);_0x227bb2['query']=_[_0x79f3('0x3a')](_0x58a864['query']);_0x227bb2[_0x79f3('0x3b')]=_[_0x79f3('0x3c')](_0x227bb2[_0x79f3('0x38')],_0x227bb2[_0x79f3('0x39')]);_0x5ccb67[_0x79f3('0x3d')]=_[_0x79f3('0x3c')](_0x227bb2['model'],qs[_0x79f3('0x3e')](_0x58a864[_0x79f3('0x39')][_0x79f3('0x3e')]));_0x5ccb67[_0x79f3('0x3d')]=_0x5ccb67[_0x79f3('0x3d')][_0x79f3('0x3f')]?_0x5ccb67[_0x79f3('0x3d')]:_0x227bb2[_0x79f3('0x38')];_0x5ccb67[_0x79f3('0x41')]=qs[_0x79f3('0x42')](_0x58a864[_0x79f3('0x39')][_0x79f3('0x42')]);_0x5ccb67['where']=qs['filters'](_[_0x79f3('0x44')](_0x58a864['query'],_0x227bb2[_0x79f3('0x3b')]));if(_0x58a864[_0x79f3('0x39')][_0x79f3('0x45')]){_0x5ccb67[_0x79f3('0x43')]=_[_0x79f3('0x46')](_0x5ccb67[_0x79f3('0x43')],{'$or':_[_0x79f3('0x34')](_0x5ccb67['attributes'],function(_0x316bd7){var _0x543991={};_0x543991[_0x316bd7]={'$like':'%'+_0x58a864[_0x79f3('0x39')][_0x79f3('0x45')]+'%'};return _0x543991;})});}_0x5ccb67=_['merge']({},_0x5ccb67,_0x58a864['options']);return _0x47a016[_0x79f3('0x63')](_0x5ccb67);}})[_0x79f3('0x2e')](function(_0x3185c4){if(_0x3185c4){_0x2ccfac=_0x3185c4[_0x79f3('0x3f')];if(!_0x58a864[_0x79f3('0x39')]['hasOwnProperty'](_0x79f3('0x40'))){_0x5ccb67['limit']=qs[_0x79f3('0x28')](_0x58a864[_0x79f3('0x39')][_0x79f3('0x28')]);_0x5ccb67['offset']=qs[_0x79f3('0x26')](_0x58a864['query']['offset']);}return _0x47a016['getTeams'](_0x5ccb67);}})[_0x79f3('0x2e')](function(_0x3280c5){if(_0x3280c5){return _0x3280c5?{'count':_0x2ccfac,'rows':_0x3280c5}:null;}})[_0x79f3('0x2e')](respondWithResult(_0xfcfe31,null))['catch'](handleError(_0xfcfe31,null));};exports[_0x79f3('0x65')]=function(_0x43d048,_0x527e7a,_0x5746c3){var _0x263954=_0x43d048[_0x79f3('0x51')]['ids'];return db[_0x79f3('0x64')][_0x79f3('0x49')]({'where':{'id':_0x263954},'attributes':['id'],'include':[{'model':db[_0x79f3('0x66')],'as':_0x79f3('0x67'),'attributes':['id',_0x79f3('0x32'),_0x79f3('0x68'),_0x79f3('0x69'),_0x79f3('0x6a')],'raw':!![]}]})[_0x79f3('0x2e')](function(_0x1feaa7){if(_0x1feaa7){var _0x17b99e=_['flatMap'](_0x1feaa7,function(_0x1c03be){var _0x42865f=_0x1c03be[_0x79f3('0x54')]({'plain':!![]});return _0x42865f[_0x79f3('0x67')];});return db[_0x79f3('0x35')]['find']({'where':{'id':_0x43d048['params']['id']}})[_0x79f3('0x2e')](function(_0x36e9c3){return db[_0x79f3('0x6b')][_0x79f3('0x6c')](function(_0x30d23f){return _0x36e9c3[_0x79f3('0x65')](_0x263954,{'transaction':_0x30d23f})[_0x79f3('0x2e')](function(){return BPromise[_0x79f3('0x6d')](_0x17b99e,function(_0x4492fa){return db['UserFaxQueue']['findOrCreate']({'where':{'UserId':_0x4492fa['id'],'FaxQueueId':_0x43d048[_0x79f3('0x4c')]['id']},'transaction':_0x30d23f});});})[_0x79f3('0x2e')](function(){_0x17b99e[_0x79f3('0x6e')](function(_0x3c5e9f){socket[_0x79f3('0x6f')](_0x79f3('0x70'),{'UserId':_0x3c5e9f['id'],'FaxQueueId':_0x36e9c3['id']});});});});});}})[_0x79f3('0x2e')](respondWithStatusCode(_0x527e7a,null))[_0x79f3('0x4a')](handleError(_0x527e7a,null));};exports[_0x79f3('0x71')]=function(_0x336c1f,_0x5df7b4,_0x3b46cf){return db['Team'][_0x79f3('0x49')]({'where':{'id':_0x336c1f[_0x79f3('0x39')][_0x79f3('0x72')]},'attributes':['id'],'include':[{'model':db[_0x79f3('0x66')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x79f3('0x2e')](handleEntityNotFound(_0x5df7b4,null))[_0x79f3('0x2e')](function(_0x2cc61a){var _0x3b9670=_[_0x79f3('0x34')](_0x2cc61a,'id');var _0x292a29=[];var _0x25cac0=[];var _0x27c127=squel[_0x79f3('0x73')]();_0x27c127[_0x79f3('0x74')](_0x79f3('0x75'))['from'](_0x79f3('0x76'),'tq')['join'](_0x79f3('0x77'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x79f3('0x43')](_0x79f3('0x78'),_0x336c1f['params']['id']);for(var _0x1720a4=0x0;_0x1720a4<_0x2cc61a[_0x79f3('0x3f')];_0x1720a4+=0x1){let _0xdbe7cc=_0x2cc61a[_0x1720a4];for(var _0x1ea99b=0x0;_0x1ea99b<_0xdbe7cc[_0x79f3('0x67')][_0x79f3('0x3f')];_0x1ea99b+=0x1){let _0x2d6722=_0xdbe7cc[_0x79f3('0x67')][_0x1ea99b];var _0x16bed8=_0x27c127['clone']();_0x16bed8[_0x79f3('0x43')]('ut.UserId\x20=\x20?',_0x2d6722['id']);_0x25cac0[_0x79f3('0x79')](db[_0x79f3('0x6b')]['query'](_0x16bed8[_0x79f3('0x7a')](),{'type':db['sequelize'][_0x79f3('0x7b')][_0x79f3('0x7c')]})['then'](function(_0x4158c3){if(_0x4158c3[_0x79f3('0x3f')]===0x1){return _0x2d6722['id'];}else{var _0xe8c933=_[_0x79f3('0x7d')](_[_0x79f3('0x34')](_0x4158c3,_0x79f3('0x7e')),function(_0x2167eb){return _[_0x79f3('0x7f')](_0x3b9670,_0x2167eb);});if(_0xe8c933){return _0x2d6722['id'];}}}));}}return BPromise['all'](_0x25cac0)[_0x79f3('0x2e')](function(_0x524729){_0x292a29=_(_0x292a29)['union'](_0x524729)[_0x79f3('0x80')]()[_0x79f3('0x81')]();return db['FaxQueue'][_0x79f3('0x4f')]({'where':{'id':_0x336c1f[_0x79f3('0x4c')]['id']}})[_0x79f3('0x2e')](function(_0xaeb7ce){return db[_0x79f3('0x6b')][_0x79f3('0x6c')](function(_0x37098f){return _0xaeb7ce[_0x79f3('0x71')](_0x336c1f[_0x79f3('0x39')][_0x79f3('0x72')],{'transaction':_0x37098f})[_0x79f3('0x2e')](function(){if(!_['isEmpty'](_0x292a29)){return _0xaeb7ce[_0x79f3('0x82')](_0x292a29,{'transaction':_0x37098f});}})['then'](function(){_0x292a29[_0x79f3('0x6e')](function(_0x1b4290){socket[_0x79f3('0x6f')](_0x79f3('0x83'),{'UserId':_0x1b4290,'FaxQueueId':_0xaeb7ce['id']});});});});});});})[_0x79f3('0x2e')](respondWithStatusCode(_0x5df7b4,null))['catch'](handleError(_0x5df7b4,null));};exports[_0x79f3('0x84')]=function(_0x12e7e7,_0x1d25bc,_0x2f4ebc){return db[_0x79f3('0x35')][_0x79f3('0x4f')]({'where':{'id':_0x12e7e7[_0x79f3('0x4c')]['id']}})[_0x79f3('0x2e')](handleEntityNotFound(_0x1d25bc,null))[_0x79f3('0x2e')](function(_0x508aab){if(_0x508aab){return _0x508aab['addAgents'](_0x12e7e7[_0x79f3('0x51')][_0x79f3('0x72')],_[_0x79f3('0x85')](_0x12e7e7[_0x79f3('0x51')],[_0x79f3('0x72'),'id'])||{})[_0x79f3('0x86')](function(_0x7f12d8){for(var _0x52d9f0=0x0;_0x52d9f0<_0x12e7e7[_0x79f3('0x51')][_0x79f3('0x72')][_0x79f3('0x3f')];_0x52d9f0+=0x1){socket[_0x79f3('0x6f')](_0x79f3('0x70'),{'UserId':Number(_0x12e7e7[_0x79f3('0x51')][_0x79f3('0x72')][_0x52d9f0]),'FaxQueueId':Number(_0x12e7e7[_0x79f3('0x4c')]['id'])});}return _0x7f12d8;});}})[_0x79f3('0x2e')](respondWithResult(_0x1d25bc,null))['catch'](handleError(_0x1d25bc,null));};exports[_0x79f3('0x82')]=function(_0x195b54,_0xa87f69,_0x1c887e){return db[_0x79f3('0x35')]['find']({'where':{'id':_0x195b54[_0x79f3('0x4c')]['id']}})[_0x79f3('0x2e')](handleEntityNotFound(_0xa87f69,null))['then'](function(_0x4f638e){if(_0x4f638e){return _0x4f638e[_0x79f3('0x82')](_0x195b54[_0x79f3('0x39')][_0x79f3('0x72')])[_0x79f3('0x2e')](function(){if(_[_0x79f3('0x87')](_0x195b54[_0x79f3('0x39')][_0x79f3('0x72')])){for(var _0x52a6e2=0x0;_0x52a6e2<_0x195b54[_0x79f3('0x39')][_0x79f3('0x72')][_0x79f3('0x3f')];_0x52a6e2+=0x1){socket['emit']('userFaxQueue:remove',{'UserId':Number(_0x195b54[_0x79f3('0x39')][_0x79f3('0x72')][_0x52a6e2]),'FaxQueueId':Number(_0x195b54[_0x79f3('0x4c')]['id'])});}}else{socket[_0x79f3('0x6f')]('userFaxQueue:remove',{'UserId':Number(_0x195b54[_0x79f3('0x39')]['ids']),'FaxQueueId':Number(_0x195b54[_0x79f3('0x4c')]['id'])});}});}})[_0x79f3('0x2e')](respondWithStatusCode(_0xa87f69,null))['catch'](handleError(_0xa87f69,null));};exports['getAgents']=function(_0x43eb6b,_0x1a8a20,_0x1c131a){var _0x5e0e68={};var _0x2fb175={};var _0x5d4426;var _0x24812a;return db['FaxQueue'][_0x79f3('0x5b')]({'where':{'id':_0x43eb6b[_0x79f3('0x4c')]['id']}})[_0x79f3('0x2e')](handleEntityNotFound(_0x1a8a20,null))[_0x79f3('0x2e')](function(_0x18e9d4){if(_0x18e9d4){_0x5d4426=_0x18e9d4;_0x2fb175[_0x79f3('0x38')]=_['keys'](db['User']['rawAttributes']);_0x2fb175[_0x79f3('0x39')]=_[_0x79f3('0x3a')](_0x43eb6b['query']);_0x2fb175[_0x79f3('0x3b')]=_[_0x79f3('0x3c')](_0x2fb175[_0x79f3('0x38')],_0x2fb175['query']);_0x5e0e68[_0x79f3('0x3d')]=_[_0x79f3('0x3c')](_0x2fb175[_0x79f3('0x38')],qs[_0x79f3('0x3e')](_0x43eb6b[_0x79f3('0x39')][_0x79f3('0x3e')]));_0x5e0e68[_0x79f3('0x3d')]=_0x5e0e68[_0x79f3('0x3d')][_0x79f3('0x3f')]?_0x5e0e68[_0x79f3('0x3d')]:_0x2fb175['model'];_0x5e0e68[_0x79f3('0x41')]=qs[_0x79f3('0x42')](_0x43eb6b[_0x79f3('0x39')]['sort']);_0x5e0e68[_0x79f3('0x43')]=qs[_0x79f3('0x3b')](_[_0x79f3('0x44')](_0x43eb6b[_0x79f3('0x39')],_0x2fb175[_0x79f3('0x3b')]));if(_0x43eb6b[_0x79f3('0x39')][_0x79f3('0x45')]){_0x5e0e68[_0x79f3('0x43')]=_['merge'](_0x5e0e68[_0x79f3('0x43')],{'$or':_['map'](_0x5e0e68[_0x79f3('0x3d')],function(_0x5f3cff){var _0x220580={};_0x220580[_0x5f3cff]={'$like':'%'+_0x43eb6b['query'][_0x79f3('0x45')]+'%'};return _0x220580;})});}_0x5e0e68=_['merge']({},_0x5e0e68,_0x43eb6b[_0x79f3('0x4e')]);return _0x5d4426[_0x79f3('0x88')](_0x5e0e68);}})[_0x79f3('0x2e')](function(_0x5a3ec8){if(_0x5a3ec8){_0x24812a=_0x5a3ec8[_0x79f3('0x3f')];if(!_0x43eb6b[_0x79f3('0x39')]['hasOwnProperty'](_0x79f3('0x40'))){_0x5e0e68[_0x79f3('0x28')]=qs[_0x79f3('0x28')](_0x43eb6b[_0x79f3('0x39')][_0x79f3('0x28')]);_0x5e0e68[_0x79f3('0x26')]=qs[_0x79f3('0x26')](_0x43eb6b[_0x79f3('0x39')]['offset']);}return _0x5d4426[_0x79f3('0x88')](_0x5e0e68);}})[_0x79f3('0x2e')](function(_0x495e73){if(_0x495e73){return _0x495e73?{'count':_0x24812a,'rows':_0x495e73}:null;}})[_0x79f3('0x2e')](respondWithResult(_0x1a8a20,null))['catch'](handleError(_0x1a8a20,null));}; \ No newline at end of file +var _0x669b=['sequelize','transaction','each','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','select','field','team_has_fax_queues','join','user_has_teams','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','fast-json-patch','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./faxQueue.socket','status','end','json','offset','limit','undefined','count','apply','save','then','destroy','get','FaxQueues','UserProfileResource','sendStatus','error','stack','name','send','index','FaxQueue','fieldName','type','key','query','filters','intersection','model','length','attributes','order','sort','where','filter','merge','map','options','include','rows','catch','show','params','keys','fields','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getMembers','rawAttributes','hasOwnProperty','nolimit','pick','FaxQueueId','UserFaxQueue','findAll','User','UserId','agent','updatedAt','format','%s/%s','SIP','faxPause','createdAt','getTeams','findOne','addTeams','ids','Team','online','flatMap','Agents'];(function(_0xcb2546,_0x140505){var _0x1c175d=function(_0xa3eed3){while(--_0xa3eed3){_0xcb2546['push'](_0xcb2546['shift']());}};_0x1c175d(++_0x140505);}(_0x669b,0x1c5));var _0xb669=function(_0x3e844c,_0x114926){_0x3e844c=_0x3e844c-0x0;var _0x349373=_0x669b[_0x3e844c];return _0x349373;};'use strict';var emlformat=require(_0xb669('0x0'));var rimraf=require(_0xb669('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb669('0x2'));var rp=require('request-promise');var moment=require(_0xb669('0x3'));var BPromise=require(_0xb669('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb669('0x5'));var sox=require(_0xb669('0x6'));var csv=require('to-csv');var ejs=require(_0xb669('0x7'));var fs=require('fs');var fs_extra=require(_0xb669('0x8'));var _=require(_0xb669('0x9'));var squel=require(_0xb669('0xa'));var crypto=require(_0xb669('0xb'));var jsforce=require(_0xb669('0xc'));var deskjs=require(_0xb669('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb669('0xe'));var Papa=require('papaparse');var Redis=require(_0xb669('0xf'));var authService=require(_0xb669('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xb669('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb669('0x12'))('api');var utils=require(_0xb669('0x13'));var config=require(_0xb669('0x14'));var licenseUtil=require(_0xb669('0x15'));var db=require(_0xb669('0x16'))['db'];config['redis']=_[_0xb669('0x17')](config[_0xb669('0x18')],{'host':_0xb669('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb669('0x18')]));require(_0xb669('0x1a'))['register'](socket);function respondWithStatusCode(_0x328c70,_0x1b4381){_0x1b4381=_0x1b4381||0xcc;return function(_0x339bf1){if(_0x339bf1){return _0x328c70['sendStatus'](_0x1b4381);}return _0x328c70[_0xb669('0x1b')](_0x1b4381)[_0xb669('0x1c')]();};}function respondWithResult(_0x5982b8,_0x3df2cd){_0x3df2cd=_0x3df2cd||0xc8;return function(_0x3c0ca0){if(_0x3c0ca0){return _0x5982b8[_0xb669('0x1b')](_0x3df2cd)[_0xb669('0x1d')](_0x3c0ca0);}};}function respondWithFilteredResult(_0x34e025,_0x3adbef){return function(_0x19fe19){if(_0x19fe19){var _0xd13d83=typeof _0x3adbef[_0xb669('0x1e')]==='undefined'&&typeof _0x3adbef[_0xb669('0x1f')]===_0xb669('0x20');var _0x1a339a=_0x19fe19['count'];var _0x5e1f47=_0xd13d83?0x0:_0x3adbef[_0xb669('0x1e')];var _0x413945=_0xd13d83?_0x19fe19[_0xb669('0x21')]:_0x3adbef[_0xb669('0x1e')]+_0x3adbef[_0xb669('0x1f')];var _0x44328d;if(_0x413945>=_0x1a339a){_0x413945=_0x1a339a;_0x44328d=0xc8;}else{_0x44328d=0xce;}_0x34e025['status'](_0x44328d);return _0x34e025['set']('Content-Range',_0x5e1f47+'-'+_0x413945+'/'+_0x1a339a)['json'](_0x19fe19);}return null;};}function patchUpdates(_0x4983dc){return function(_0x385afd){try{jsonpatch[_0xb669('0x22')](_0x385afd,_0x4983dc,!![]);}catch(_0x13ea54){return BPromise['reject'](_0x13ea54);}return _0x385afd[_0xb669('0x23')]();};}function saveUpdates(_0x459abb,_0x2b3182){return function(_0x1d417f){if(_0x1d417f){return _0x1d417f['update'](_0x459abb)[_0xb669('0x24')](function(_0x233940){return _0x233940;});}return null;};}function removeEntity(_0x2a55b7,_0x26032d){return function(_0x2f4c5a){if(_0x2f4c5a){return _0x2f4c5a[_0xb669('0x25')]()[_0xb669('0x24')](function(){var _0x4523b9=_0x2f4c5a[_0xb669('0x26')]({'plain':!![]});var _0x390243=_0xb669('0x27');return db[_0xb669('0x28')][_0xb669('0x25')]({'where':{'type':_0x390243,'resourceId':_0x4523b9['id']}})[_0xb669('0x24')](function(){return _0x2f4c5a;});})[_0xb669('0x24')](function(){_0x2a55b7[_0xb669('0x1b')](0xcc)[_0xb669('0x1c')]();});}};}function handleEntityNotFound(_0x368dd6,_0x479c60){return function(_0x3d1bc1){if(!_0x3d1bc1){_0x368dd6[_0xb669('0x29')](0x194);}return _0x3d1bc1;};}function handleError(_0x169534,_0x4bffe2){_0x4bffe2=_0x4bffe2||0x1f4;return function(_0x532ac0){logger[_0xb669('0x2a')](_0x532ac0[_0xb669('0x2b')]);if(_0x532ac0[_0xb669('0x2c')]){delete _0x532ac0[_0xb669('0x2c')];}_0x169534[_0xb669('0x1b')](_0x4bffe2)[_0xb669('0x2d')](_0x532ac0);};}exports[_0xb669('0x2e')]=function(_0x63bd98,_0x220301){var _0x1d8558={},_0xb9830b={},_0x3a7ac9={'count':0x0,'rows':[]};var _0x1472b3=_['map'](db[_0xb669('0x2f')]['rawAttributes'],function(_0x2e2b9f){return{'name':_0x2e2b9f[_0xb669('0x30')],'type':_0x2e2b9f[_0xb669('0x31')][_0xb669('0x32')]};});_0xb9830b['model']=_['map'](_0x1472b3,_0xb669('0x2c'));_0xb9830b['query']=_['keys'](_0x63bd98[_0xb669('0x33')]);_0xb9830b[_0xb669('0x34')]=_[_0xb669('0x35')](_0xb9830b[_0xb669('0x36')],_0xb9830b['query']);_0x1d8558['attributes']=_['intersection'](_0xb9830b[_0xb669('0x36')],qs['fields'](_0x63bd98[_0xb669('0x33')]['fields']));_0x1d8558['attributes']=_0x1d8558['attributes'][_0xb669('0x37')]?_0x1d8558[_0xb669('0x38')]:_0xb9830b['model'];if(!_0x63bd98[_0xb669('0x33')]['hasOwnProperty']('nolimit')){_0x1d8558[_0xb669('0x1f')]=qs[_0xb669('0x1f')](_0x63bd98['query'][_0xb669('0x1f')]);_0x1d8558[_0xb669('0x1e')]=qs[_0xb669('0x1e')](_0x63bd98[_0xb669('0x33')][_0xb669('0x1e')]);}_0x1d8558[_0xb669('0x39')]=qs[_0xb669('0x3a')](_0x63bd98['query']['sort']);_0x1d8558[_0xb669('0x3b')]=qs[_0xb669('0x34')](_['pick'](_0x63bd98[_0xb669('0x33')],_0xb9830b[_0xb669('0x34')]),_0x1472b3);if(_0x63bd98[_0xb669('0x33')][_0xb669('0x3c')]){_0x1d8558[_0xb669('0x3b')]=_[_0xb669('0x3d')](_0x1d8558[_0xb669('0x3b')],{'$or':_[_0xb669('0x3e')](_0x1472b3,function(_0x4bab47){if(_0x4bab47[_0xb669('0x31')]!=='VIRTUAL'){var _0x5d4c29={};_0x5d4c29[_0x4bab47[_0xb669('0x2c')]]={'$like':'%'+_0x63bd98['query'][_0xb669('0x3c')]+'%'};return _0x5d4c29;}})});}_0x1d8558=_[_0xb669('0x3d')]({},_0x1d8558,_0x63bd98[_0xb669('0x3f')]);var _0x40827d={'where':_0x1d8558[_0xb669('0x3b')]};return db[_0xb669('0x2f')][_0xb669('0x21')](_0x40827d)[_0xb669('0x24')](function(_0x48a958){_0x3a7ac9[_0xb669('0x21')]=_0x48a958;if(_0x63bd98[_0xb669('0x33')]['includeAll']){_0x1d8558[_0xb669('0x40')]=[{'all':!![]}];}return db[_0xb669('0x2f')]['findAll'](_0x1d8558);})[_0xb669('0x24')](function(_0x45c451){_0x3a7ac9[_0xb669('0x41')]=_0x45c451;return _0x3a7ac9;})[_0xb669('0x24')](respondWithFilteredResult(_0x220301,_0x1d8558))[_0xb669('0x42')](handleError(_0x220301,null));};exports[_0xb669('0x43')]=function(_0x5b1f7d,_0xd9cdf7){var _0x4bcbe2={'raw':!![],'where':{'id':_0x5b1f7d[_0xb669('0x44')]['id']}},_0x23ade8={};_0x23ade8[_0xb669('0x36')]=_[_0xb669('0x45')](db['FaxQueue']['rawAttributes']);_0x23ade8['query']=_['keys'](_0x5b1f7d['query']);_0x23ade8[_0xb669('0x34')]=_[_0xb669('0x35')](_0x23ade8[_0xb669('0x36')],_0x23ade8[_0xb669('0x33')]);_0x4bcbe2[_0xb669('0x38')]=_[_0xb669('0x35')](_0x23ade8[_0xb669('0x36')],qs[_0xb669('0x46')](_0x5b1f7d[_0xb669('0x33')]['fields']));_0x4bcbe2[_0xb669('0x38')]=_0x4bcbe2[_0xb669('0x38')]['length']?_0x4bcbe2[_0xb669('0x38')]:_0x23ade8[_0xb669('0x36')];if(_0x5b1f7d['query'][_0xb669('0x47')]){_0x4bcbe2[_0xb669('0x40')]=[{'all':!![]}];}_0x4bcbe2=_[_0xb669('0x3d')]({},_0x4bcbe2,_0x5b1f7d[_0xb669('0x3f')]);return db[_0xb669('0x2f')]['find'](_0x4bcbe2)['then'](handleEntityNotFound(_0xd9cdf7,null))[_0xb669('0x24')](respondWithResult(_0xd9cdf7,null))[_0xb669('0x42')](handleError(_0xd9cdf7,null));};exports['create']=function(_0x4fa5c6,_0x17b8a0){return db['FaxQueue'][_0xb669('0x48')](_0x4fa5c6[_0xb669('0x49')],{})[_0xb669('0x24')](function(_0x57958f){var _0x301f23=_0x4fa5c6[_0xb669('0x4a')][_0xb669('0x26')]({'plain':!![]});if(!_0x301f23)throw new Error(_0xb669('0x4b'));if(_0x301f23[_0xb669('0x4c')]===_0xb669('0x4a')){var _0xe4ee08=_0x57958f[_0xb669('0x26')]({'plain':!![]});var _0x5b2421='FaxQueues';return db[_0xb669('0x4d')][_0xb669('0x4e')]({'where':{'name':_0x5b2421,'userProfileId':_0x301f23[_0xb669('0x4f')]},'raw':!![]})[_0xb669('0x24')](function(_0x5e7ffc){if(_0x5e7ffc&&_0x5e7ffc['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0xe4ee08[_0xb669('0x2c')],'resourceId':_0xe4ee08['id'],'type':_0x5e7ffc['name'],'sectionId':_0x5e7ffc['id']},{})[_0xb669('0x24')](function(){return _0x57958f;});}else{return _0x57958f;}})[_0xb669('0x42')](function(_0xa7e35a){logger[_0xb669('0x2a')](_0xb669('0x50'),_0xa7e35a);throw _0xa7e35a;});}return _0x57958f;})[_0xb669('0x24')](respondWithResult(_0x17b8a0,0xc9))[_0xb669('0x42')](handleError(_0x17b8a0,null));};exports[_0xb669('0x51')]=function(_0x3cc24a,_0x6336aa){if(_0x3cc24a[_0xb669('0x49')]['id']){delete _0x3cc24a['body']['id'];}return db[_0xb669('0x2f')][_0xb669('0x4e')]({'where':{'id':_0x3cc24a[_0xb669('0x44')]['id']}})[_0xb669('0x24')](handleEntityNotFound(_0x6336aa,null))[_0xb669('0x24')](saveUpdates(_0x3cc24a['body'],null))[_0xb669('0x24')](respondWithResult(_0x6336aa,null))['catch'](handleError(_0x6336aa,null));};exports[_0xb669('0x25')]=function(_0x107550,_0x1584d9){return db[_0xb669('0x2f')][_0xb669('0x4e')]({'where':{'id':_0x107550[_0xb669('0x44')]['id']}})['then'](handleEntityNotFound(_0x1584d9,null))['then'](removeEntity(_0x1584d9,null))[_0xb669('0x42')](handleError(_0x1584d9,null));};exports['describe']=function(_0x5dc0d4,_0x3a9525){return db['FaxQueue']['describe']()[_0xb669('0x24')](respondWithResult(_0x3a9525,null))[_0xb669('0x42')](handleError(_0x3a9525,null));};exports[_0xb669('0x52')]=function(_0xbf75f5,_0x56f6e8,_0x279c23){var _0x1842b0={'raw':!![],'where':{}},_0x17fe0a={},_0x4c3280;return db[_0xb669('0x2f')]['findOne']({'where':{'id':_0xbf75f5['params']['id']}})['then'](handleEntityNotFound(_0x56f6e8,null))[_0xb669('0x24')](function(_0x4a6dd1){if(_0x4a6dd1){_0x4c3280=_0x4a6dd1['get']({'plain':!![]});_0x17fe0a[_0xb669('0x36')]=_[_0xb669('0x45')](db['UserFaxQueue'][_0xb669('0x53')]);_0x17fe0a[_0xb669('0x33')]=_[_0xb669('0x45')](_0xbf75f5[_0xb669('0x33')]);_0x17fe0a[_0xb669('0x34')]=_[_0xb669('0x35')](_0x17fe0a['model'],_0x17fe0a[_0xb669('0x33')]);_0x1842b0[_0xb669('0x38')]=_['intersection'](_0x17fe0a[_0xb669('0x36')],qs['fields'](_0xbf75f5[_0xb669('0x33')][_0xb669('0x46')]));_0x1842b0[_0xb669('0x38')]=_0x1842b0[_0xb669('0x38')][_0xb669('0x37')]?_0x1842b0[_0xb669('0x38')]:_0x17fe0a['model'];if(!_0xbf75f5['query'][_0xb669('0x54')](_0xb669('0x55'))){_0x1842b0[_0xb669('0x1f')]=qs['limit'](_0xbf75f5[_0xb669('0x33')]['limit']);_0x1842b0[_0xb669('0x1e')]=qs['offset'](_0xbf75f5[_0xb669('0x33')][_0xb669('0x1e')]);}_0x1842b0[_0xb669('0x39')]=qs[_0xb669('0x3a')](_0xbf75f5[_0xb669('0x33')][_0xb669('0x3a')]);_0x1842b0[_0xb669('0x3b')]=qs[_0xb669('0x34')](_[_0xb669('0x56')](_0xbf75f5[_0xb669('0x33')],_0x17fe0a[_0xb669('0x34')]));_0x1842b0[_0xb669('0x3b')][_0xb669('0x57')]=_0x4a6dd1['id'];if(_0xbf75f5[_0xb669('0x33')][_0xb669('0x3c')]){_0x1842b0[_0xb669('0x3b')]=_[_0xb669('0x3d')](_0x1842b0[_0xb669('0x3b')],{'$or':_[_0xb669('0x3e')](_0x1842b0[_0xb669('0x38')],function(_0x3a908e){var _0x317156={};_0x317156[_0x3a908e]={'$like':'%'+_0xbf75f5[_0xb669('0x33')][_0xb669('0x3c')]+'%'};return _0x317156;})});}_0x1842b0=_[_0xb669('0x3d')]({},_0x1842b0,_0xbf75f5[_0xb669('0x3f')]);return db[_0xb669('0x58')][_0xb669('0x59')](_0x1842b0);}})['then'](function(_0x1b2c22){if(_0x1b2c22){return db[_0xb669('0x5a')]['findAndCountAll']({'where':{'id':_[_0xb669('0x3e')](_0x1b2c22,_0xb669('0x5b')),'role':_0xb669('0x5c')},'attributes':['id',_0xb669('0x2c'),'faxPause',_0xb669('0x5d'),'createdAt']});}})['then'](function(_0x5cd3c8){if(_0x5cd3c8){return{'count':_0x5cd3c8[_0xb669('0x21')],'rows':_[_0xb669('0x3e')](_0x5cd3c8[_0xb669('0x41')],function(_0xab5cc3){return{'membername':_0xab5cc3[_0xb669('0x2c')],'UserId':_0xab5cc3['id'],'queue_name':_0x4c3280['name'],'FaxQueueId':_0x4c3280['id'],'interface':util[_0xb669('0x5e')](_0xb669('0x5f'),_0xb669('0x60'),_0xab5cc3[_0xb669('0x2c')]),'penalty':0x0,'paused':_0xab5cc3[_0xb669('0x61')],'createdAt':_0xab5cc3[_0xb669('0x62')],'updatedAt':_0xab5cc3['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xb669('0x24')](respondWithFilteredResult(_0x56f6e8,_0x1842b0))[_0xb669('0x42')](handleError(_0x56f6e8,null));};exports[_0xb669('0x63')]=function(_0x16eaa7,_0x56dfde,_0x417cad){var _0xc780f8={};var _0xce0401={};var _0x5bcae4;var _0x2efe0b;return db[_0xb669('0x2f')][_0xb669('0x64')]({'where':{'id':_0x16eaa7[_0xb669('0x44')]['id']}})[_0xb669('0x24')](handleEntityNotFound(_0x56dfde,null))[_0xb669('0x24')](function(_0x5dfe93){if(_0x5dfe93){_0x5bcae4=_0x5dfe93;_0xce0401['model']=_['keys'](db['Team']['rawAttributes']);_0xce0401[_0xb669('0x33')]=_[_0xb669('0x45')](_0x16eaa7[_0xb669('0x33')]);_0xce0401['filters']=_[_0xb669('0x35')](_0xce0401['model'],_0xce0401[_0xb669('0x33')]);_0xc780f8[_0xb669('0x38')]=_[_0xb669('0x35')](_0xce0401[_0xb669('0x36')],qs[_0xb669('0x46')](_0x16eaa7[_0xb669('0x33')][_0xb669('0x46')]));_0xc780f8[_0xb669('0x38')]=_0xc780f8['attributes']['length']?_0xc780f8['attributes']:_0xce0401[_0xb669('0x36')];_0xc780f8[_0xb669('0x39')]=qs[_0xb669('0x3a')](_0x16eaa7[_0xb669('0x33')][_0xb669('0x3a')]);_0xc780f8['where']=qs[_0xb669('0x34')](_[_0xb669('0x56')](_0x16eaa7[_0xb669('0x33')],_0xce0401[_0xb669('0x34')]));if(_0x16eaa7[_0xb669('0x33')][_0xb669('0x3c')]){_0xc780f8[_0xb669('0x3b')]=_[_0xb669('0x3d')](_0xc780f8[_0xb669('0x3b')],{'$or':_[_0xb669('0x3e')](_0xc780f8['attributes'],function(_0x5e13ad){var _0x10c8e1={};_0x10c8e1[_0x5e13ad]={'$like':'%'+_0x16eaa7[_0xb669('0x33')][_0xb669('0x3c')]+'%'};return _0x10c8e1;})});}_0xc780f8=_[_0xb669('0x3d')]({},_0xc780f8,_0x16eaa7[_0xb669('0x3f')]);return _0x5bcae4['getTeams'](_0xc780f8);}})['then'](function(_0x545177){if(_0x545177){_0x2efe0b=_0x545177[_0xb669('0x37')];if(!_0x16eaa7[_0xb669('0x33')][_0xb669('0x54')](_0xb669('0x55'))){_0xc780f8[_0xb669('0x1f')]=qs[_0xb669('0x1f')](_0x16eaa7[_0xb669('0x33')][_0xb669('0x1f')]);_0xc780f8[_0xb669('0x1e')]=qs[_0xb669('0x1e')](_0x16eaa7['query'][_0xb669('0x1e')]);}return _0x5bcae4[_0xb669('0x63')](_0xc780f8);}})[_0xb669('0x24')](function(_0x41ff2d){if(_0x41ff2d){return _0x41ff2d?{'count':_0x2efe0b,'rows':_0x41ff2d}:null;}})[_0xb669('0x24')](respondWithResult(_0x56dfde,null))[_0xb669('0x42')](handleError(_0x56dfde,null));};exports[_0xb669('0x65')]=function(_0x599605,_0x203616,_0x212f3e){var _0x42b613=_0x599605[_0xb669('0x49')][_0xb669('0x66')];return db[_0xb669('0x67')][_0xb669('0x59')]({'where':{'id':_0x42b613},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xb669('0x2c'),_0xb669('0x68'),'voicePause','interface'],'raw':!![]}]})[_0xb669('0x24')](function(_0x20940d){if(_0x20940d){var _0x39f249=_[_0xb669('0x69')](_0x20940d,function(_0x482aad){var _0x193d2d=_0x482aad['get']({'plain':!![]});return _0x193d2d[_0xb669('0x6a')];});return db['FaxQueue']['find']({'where':{'id':_0x599605['params']['id']}})[_0xb669('0x24')](function(_0x58b40b){return db[_0xb669('0x6b')][_0xb669('0x6c')](function(_0x20ece8){return _0x58b40b['addTeams'](_0x42b613,{'transaction':_0x20ece8})[_0xb669('0x24')](function(){return BPromise[_0xb669('0x6d')](_0x39f249,function(_0x46c637){return db['UserFaxQueue'][_0xb669('0x6e')]({'where':{'UserId':_0x46c637['id'],'FaxQueueId':_0x599605['params']['id']},'transaction':_0x20ece8});});})[_0xb669('0x24')](function(){_0x39f249[_0xb669('0x6f')](function(_0x3f7104){socket[_0xb669('0x70')](_0xb669('0x71'),{'UserId':_0x3f7104['id'],'FaxQueueId':_0x58b40b['id']});});});});});}})[_0xb669('0x24')](respondWithStatusCode(_0x203616,null))[_0xb669('0x42')](handleError(_0x203616,null));};exports[_0xb669('0x72')]=function(_0xfde88d,_0x1bf803,_0x2d76ad){return db[_0xb669('0x67')][_0xb669('0x59')]({'where':{'id':_0xfde88d[_0xb669('0x33')]['ids']},'attributes':['id'],'include':[{'model':db[_0xb669('0x5a')],'as':_0xb669('0x6a'),'attributes':['id'],'raw':!![]}]})[_0xb669('0x24')](handleEntityNotFound(_0x1bf803,null))[_0xb669('0x24')](function(_0x293388){var _0x484b08=_[_0xb669('0x3e')](_0x293388,'id');var _0x298d81=[];var _0x8d7e53=[];var _0x5bdddc=squel[_0xb669('0x73')]();_0x5bdddc[_0xb669('0x74')]('tq.TeamId')['from'](_0xb669('0x75'),'tq')[_0xb669('0x76')](_0xb669('0x77'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xb669('0x3b')](_0xb669('0x78'),_0xfde88d[_0xb669('0x44')]['id']);for(var _0x3ac0a9=0x0;_0x3ac0a9<_0x293388[_0xb669('0x37')];_0x3ac0a9+=0x1){let _0x2f82bb=_0x293388[_0x3ac0a9];for(var _0x280d62=0x0;_0x280d62<_0x2f82bb['Agents'][_0xb669('0x37')];_0x280d62+=0x1){let _0x52a616=_0x2f82bb[_0xb669('0x6a')][_0x280d62];var _0x3e93e7=_0x5bdddc[_0xb669('0x79')]();_0x3e93e7[_0xb669('0x3b')](_0xb669('0x7a'),_0x52a616['id']);_0x8d7e53[_0xb669('0x7b')](db['sequelize'][_0xb669('0x33')](_0x3e93e7[_0xb669('0x7c')](),{'type':db['sequelize'][_0xb669('0x7d')]['SELECT']})[_0xb669('0x24')](function(_0x30cd42){if(_0x30cd42[_0xb669('0x37')]===0x1){return _0x52a616['id'];}else{var _0x320449=_[_0xb669('0x7e')](_[_0xb669('0x3e')](_0x30cd42,_0xb669('0x7f')),function(_0x2fea8a){return _[_0xb669('0x80')](_0x484b08,_0x2fea8a);});if(_0x320449){return _0x52a616['id'];}}}));}}return BPromise[_0xb669('0x81')](_0x8d7e53)[_0xb669('0x24')](function(_0x33bde1){_0x298d81=_(_0x298d81)['union'](_0x33bde1)[_0xb669('0x82')]()[_0xb669('0x83')]();return db[_0xb669('0x2f')][_0xb669('0x4e')]({'where':{'id':_0xfde88d['params']['id']}})['then'](function(_0x23706b){return db[_0xb669('0x6b')][_0xb669('0x6c')](function(_0x2979f7){return _0x23706b['removeTeams'](_0xfde88d[_0xb669('0x33')][_0xb669('0x66')],{'transaction':_0x2979f7})[_0xb669('0x24')](function(){if(!_[_0xb669('0x84')](_0x298d81)){return _0x23706b[_0xb669('0x85')](_0x298d81,{'transaction':_0x2979f7});}})[_0xb669('0x24')](function(){_0x298d81['forEach'](function(_0x31e3c0){socket[_0xb669('0x70')](_0xb669('0x86'),{'UserId':_0x31e3c0,'FaxQueueId':_0x23706b['id']});});});});});});})[_0xb669('0x24')](respondWithStatusCode(_0x1bf803,null))[_0xb669('0x42')](handleError(_0x1bf803,null));};exports[_0xb669('0x87')]=function(_0x35a95a,_0x3a4557,_0xf13c61){return db[_0xb669('0x2f')]['find']({'where':{'id':_0x35a95a[_0xb669('0x44')]['id']}})[_0xb669('0x24')](handleEntityNotFound(_0x3a4557,null))[_0xb669('0x24')](function(_0x49b0bc){if(_0x49b0bc){return _0x49b0bc[_0xb669('0x87')](_0x35a95a[_0xb669('0x49')][_0xb669('0x66')],_[_0xb669('0x88')](_0x35a95a['body'],[_0xb669('0x66'),'id'])||{})[_0xb669('0x89')](function(_0x4d0984){for(var _0x111a81=0x0;_0x111a81<_0x35a95a[_0xb669('0x49')][_0xb669('0x66')]['length'];_0x111a81+=0x1){socket['emit'](_0xb669('0x71'),{'UserId':Number(_0x35a95a['body'][_0xb669('0x66')][_0x111a81]),'FaxQueueId':Number(_0x35a95a[_0xb669('0x44')]['id'])});}return _0x4d0984;});}})[_0xb669('0x24')](respondWithResult(_0x3a4557,null))['catch'](handleError(_0x3a4557,null));};exports[_0xb669('0x85')]=function(_0x4243c5,_0xd3eead,_0x27a64e){return db[_0xb669('0x2f')][_0xb669('0x4e')]({'where':{'id':_0x4243c5[_0xb669('0x44')]['id']}})[_0xb669('0x24')](handleEntityNotFound(_0xd3eead,null))[_0xb669('0x24')](function(_0x24206f){if(_0x24206f){return _0x24206f[_0xb669('0x85')](_0x4243c5[_0xb669('0x33')][_0xb669('0x66')])['then'](function(){if(_[_0xb669('0x8a')](_0x4243c5[_0xb669('0x33')][_0xb669('0x66')])){for(var _0x7291d8=0x0;_0x7291d8<_0x4243c5[_0xb669('0x33')][_0xb669('0x66')][_0xb669('0x37')];_0x7291d8+=0x1){socket['emit'](_0xb669('0x86'),{'UserId':Number(_0x4243c5[_0xb669('0x33')][_0xb669('0x66')][_0x7291d8]),'FaxQueueId':Number(_0x4243c5['params']['id'])});}}else{socket[_0xb669('0x70')](_0xb669('0x86'),{'UserId':Number(_0x4243c5['query'][_0xb669('0x66')]),'FaxQueueId':Number(_0x4243c5[_0xb669('0x44')]['id'])});}});}})[_0xb669('0x24')](respondWithStatusCode(_0xd3eead,null))['catch'](handleError(_0xd3eead,null));};exports[_0xb669('0x8b')]=function(_0x435cef,_0x2b0244,_0x136e97){var _0x1a7a93={};var _0x2b7521={};var _0x44a003;var _0x5b8721;return db[_0xb669('0x2f')][_0xb669('0x64')]({'where':{'id':_0x435cef[_0xb669('0x44')]['id']}})[_0xb669('0x24')](handleEntityNotFound(_0x2b0244,null))[_0xb669('0x24')](function(_0x5a18b1){if(_0x5a18b1){_0x44a003=_0x5a18b1;_0x2b7521[_0xb669('0x36')]=_[_0xb669('0x45')](db[_0xb669('0x5a')]['rawAttributes']);_0x2b7521[_0xb669('0x33')]=_[_0xb669('0x45')](_0x435cef[_0xb669('0x33')]);_0x2b7521[_0xb669('0x34')]=_[_0xb669('0x35')](_0x2b7521[_0xb669('0x36')],_0x2b7521[_0xb669('0x33')]);_0x1a7a93['attributes']=_[_0xb669('0x35')](_0x2b7521[_0xb669('0x36')],qs[_0xb669('0x46')](_0x435cef[_0xb669('0x33')]['fields']));_0x1a7a93[_0xb669('0x38')]=_0x1a7a93['attributes'][_0xb669('0x37')]?_0x1a7a93[_0xb669('0x38')]:_0x2b7521['model'];_0x1a7a93[_0xb669('0x39')]=qs[_0xb669('0x3a')](_0x435cef[_0xb669('0x33')][_0xb669('0x3a')]);_0x1a7a93[_0xb669('0x3b')]=qs[_0xb669('0x34')](_[_0xb669('0x56')](_0x435cef[_0xb669('0x33')],_0x2b7521[_0xb669('0x34')]));if(_0x435cef['query'][_0xb669('0x3c')]){_0x1a7a93[_0xb669('0x3b')]=_[_0xb669('0x3d')](_0x1a7a93[_0xb669('0x3b')],{'$or':_['map'](_0x1a7a93[_0xb669('0x38')],function(_0x28425d){var _0x270588={};_0x270588[_0x28425d]={'$like':'%'+_0x435cef[_0xb669('0x33')][_0xb669('0x3c')]+'%'};return _0x270588;})});}_0x1a7a93=_[_0xb669('0x3d')]({},_0x1a7a93,_0x435cef[_0xb669('0x3f')]);return _0x44a003[_0xb669('0x8b')](_0x1a7a93);}})['then'](function(_0x4e52f8){if(_0x4e52f8){_0x5b8721=_0x4e52f8[_0xb669('0x37')];if(!_0x435cef[_0xb669('0x33')][_0xb669('0x54')]('nolimit')){_0x1a7a93[_0xb669('0x1f')]=qs['limit'](_0x435cef[_0xb669('0x33')][_0xb669('0x1f')]);_0x1a7a93[_0xb669('0x1e')]=qs[_0xb669('0x1e')](_0x435cef[_0xb669('0x33')]['offset']);}return _0x44a003[_0xb669('0x8b')](_0x1a7a93);}})['then'](function(_0x5b32d8){if(_0x5b32d8){return _0x5b32d8?{'count':_0x5b8721,'rows':_0x5b32d8}:null;}})['then'](respondWithResult(_0x2b0244,null))[_0xb669('0x42')](handleError(_0x2b0244,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index a583a32..876dfb1 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 _0x84de=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x2ceb93,_0x258a6b){var _0x263b5e=function(_0x39d4c5){while(--_0x39d4c5){_0x2ceb93['push'](_0x2ceb93['shift']());}};_0x263b5e(++_0x258a6b);}(_0x84de,0x1db));var _0xe84d=function(_0x9ba307,_0x570631){_0x9ba307=_0x9ba307-0x0;var _0x335d04=_0x84de[_0x9ba307];return _0x335d04;};'use strict';var EventEmitter=require(_0xe84d('0x0'));var FaxQueue=require(_0xe84d('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xe84d('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe84d('0x3'),'afterDestroy':_0xe84d('0x4')};function emitEvent(_0x434e6c){return function(_0x38d88c,_0xbd4532,_0x34c371){FaxQueueEvents[_0xe84d('0x5')](_0x434e6c+':'+_0x38d88c['id'],_0x38d88c);FaxQueueEvents[_0xe84d('0x5')](_0x434e6c,_0x38d88c);_0x34c371(null);};}for(var e in events){if(events[_0xe84d('0x6')](e)){var event=events[e];FaxQueue[_0xe84d('0x7')](e,emitEvent(event));}}module[_0xe84d('0x8')]=FaxQueueEvents; \ No newline at end of file +var _0xff7c=['hasOwnProperty','hook','events','../../mysqldb','FaxQueue','save','update','remove','emit'];(function(_0x399a68,_0x32b703){var _0x283d8c=function(_0x22a206){while(--_0x22a206){_0x399a68['push'](_0x399a68['shift']());}};_0x283d8c(++_0x32b703);}(_0xff7c,0xda));var _0xcff7=function(_0x2cc569,_0x4e9568){_0x2cc569=_0x2cc569-0x0;var _0x1bfc2e=_0xff7c[_0x2cc569];return _0x1bfc2e;};'use strict';var EventEmitter=require(_0xcff7('0x0'));var FaxQueue=require(_0xcff7('0x1'))['db'][_0xcff7('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcff7('0x3'),'afterUpdate':_0xcff7('0x4'),'afterDestroy':_0xcff7('0x5')};function emitEvent(_0x47328c){return function(_0x460c9a,_0x2ee664,_0x10671c){FaxQueueEvents[_0xcff7('0x6')](_0x47328c+':'+_0x460c9a['id'],_0x460c9a);FaxQueueEvents['emit'](_0x47328c,_0x460c9a);_0x10671c(null);};}for(var e in events){if(events[_0xcff7('0x7')](e)){var event=events[e];FaxQueue[_0xcff7('0x8')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 59130c6..f5e8aea 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 _0xc180=['util','api','bluebird','path','rimraf','./faxQueue.attributes','define','FaxQueue','fax_queues','lodash'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xc180,0x13f));var _0x0c18=function(_0xfcb635,_0x26a8f2){_0xfcb635=_0xfcb635-0x0;var _0x4a5e6c=_0xc180[_0xfcb635];return _0x4a5e6c;};'use strict';var _=require(_0x0c18('0x0'));var util=require(_0x0c18('0x1'));var logger=require('../../config/logger')(_0x0c18('0x2'));var moment=require('moment');var BPromise=require(_0x0c18('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0c18('0x4'));var rimraf=require(_0x0c18('0x5'));var config=require('../../config/environment');var attributes=require(_0x0c18('0x6'));module['exports']=function(_0xa0f8ac,_0x53063b){return _0xa0f8ac[_0x0c18('0x7')](_0x0c18('0x8'),attributes,{'tableName':_0x0c18('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1279=['lodash','util','api','path','rimraf','../../config/environment','./faxQueue.attributes','exports','define','fax_queues'];(function(_0x32c038,_0x5cba92){var _0x11366b=function(_0x2e4b4a){while(--_0x2e4b4a){_0x32c038['push'](_0x32c038['shift']());}};_0x11366b(++_0x5cba92);}(_0x1279,0x154));var _0x9127=function(_0x4ce8c3,_0x30c484){_0x4ce8c3=_0x4ce8c3-0x0;var _0x325f32=_0x1279[_0x4ce8c3];return _0x325f32;};'use strict';var _=require(_0x9127('0x0'));var util=require(_0x9127('0x1'));var logger=require('../../config/logger')(_0x9127('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9127('0x3'));var rimraf=require(_0x9127('0x4'));var config=require(_0x9127('0x5'));var attributes=require(_0x9127('0x6'));module[_0x9127('0x7')]=function(_0x2dbea5,_0x1794b1){return _0x2dbea5[_0x9127('0x8')]('FaxQueue',attributes,{'tableName':_0x9127('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 c4e5b1c..3d4f7ce 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 _0xcddb=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','GetFaxQueue','FaxQueue','findAll','options','attributes','map','include','model','stringify','catch','find','raw','where','ShowFaxQueue','lodash','util'];(function(_0x5890c7,_0x3e65bf){var _0x41504e=function(_0x42884e){while(--_0x42884e){_0x5890c7['push'](_0x5890c7['shift']());}};_0x41504e(++_0x3e65bf);}(_0xcddb,0x14e));var _0xbcdd=function(_0xc39300,_0x16ee26){_0xc39300=_0xc39300-0x0;var _0x501b17=_0xcddb[_0xc39300];return _0x501b17;};'use strict';var _=require(_0xbcdd('0x0'));var util=require(_0xbcdd('0x1'));var moment=require(_0xbcdd('0x2'));var BPromise=require(_0xbcdd('0x3'));var rs=require(_0xbcdd('0x4'));var fs=require('fs');var Redis=require(_0xbcdd('0x5'));var db=require(_0xbcdd('0x6'))['db'];var utils=require(_0xbcdd('0x7'));var logger=require(_0xbcdd('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbcdd('0x9'));var client=jayson['client'][_0xbcdd('0xa')]({'port':0x232a});config[_0xbcdd('0xb')]=_[_0xbcdd('0xc')](config[_0xbcdd('0xb')],{'host':_0xbcdd('0xd'),'port':0x18eb});var socket=require(_0xbcdd('0xe'))(new Redis(config[_0xbcdd('0xb')]));require(_0xbcdd('0xf'))[_0xbcdd('0x10')](socket);function respondWithRpcPromise(_0x1108ca,_0x10fa82,_0x20907b){return new BPromise(function(_0x4c17c4,_0x3ff325){return client[_0xbcdd('0x11')](_0x1108ca,_0x20907b)[_0xbcdd('0x12')](function(_0xcc9511){logger[_0xbcdd('0x13')](_0xbcdd('0x14'),_0x10fa82,_0xbcdd('0x15'));logger[_0xbcdd('0x16')](_0xbcdd('0x17'),_0x10fa82,_0xbcdd('0x15'),JSON['stringify'](_0xcc9511));if(_0xcc9511[_0xbcdd('0x18')]){if(_0xcc9511[_0xbcdd('0x18')][_0xbcdd('0x19')]===0x1f4){logger[_0xbcdd('0x18')](_0xbcdd('0x14'),_0x10fa82,_0xcc9511['error'][_0xbcdd('0x1a')]);return _0x3ff325(_0xcc9511[_0xbcdd('0x18')][_0xbcdd('0x1a')]);}logger['error'](_0xbcdd('0x14'),_0x10fa82,_0xcc9511[_0xbcdd('0x18')][_0xbcdd('0x1a')]);return _0x4c17c4(_0xcc9511['error'][_0xbcdd('0x1a')]);}else{logger[_0xbcdd('0x13')](_0xbcdd('0x14'),_0x10fa82,_0xbcdd('0x15'));_0x4c17c4(_0xcc9511[_0xbcdd('0x1b')][_0xbcdd('0x1a')]);}})['catch'](function(_0x586e88){logger[_0xbcdd('0x18')]('FaxQueue,\x20%s,\x20%s',_0x10fa82,_0x586e88);_0x3ff325(_0x586e88);});});}exports[_0xbcdd('0x1c')]=function(_0x291e3c){var _0x2e7603=this;return new Promise(function(_0x10a845,_0x5c12d5){return db[_0xbcdd('0x1d')][_0xbcdd('0x1e')]({'raw':_0x291e3c[_0xbcdd('0x1f')]?_0x291e3c[_0xbcdd('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x291e3c[_0xbcdd('0x1f')]?_0x291e3c[_0xbcdd('0x1f')]['where']||null:null,'attributes':_0x291e3c['options']?_0x291e3c[_0xbcdd('0x1f')][_0xbcdd('0x20')]||null:null,'limit':_0x291e3c[_0xbcdd('0x1f')]?_0x291e3c[_0xbcdd('0x1f')]['limit']||null:null,'include':_0x291e3c[_0xbcdd('0x1f')]?_0x291e3c[_0xbcdd('0x1f')]['include']?_[_0xbcdd('0x21')](_0x291e3c[_0xbcdd('0x1f')][_0xbcdd('0x22')],function(_0x5cbcae){return{'model':db[_0x5cbcae[_0xbcdd('0x23')]],'as':_0x5cbcae['as'],'attributes':_0x5cbcae[_0xbcdd('0x20')],'include':_0x5cbcae[_0xbcdd('0x22')]?_[_0xbcdd('0x21')](_0x5cbcae[_0xbcdd('0x22')],function(_0x34efa0){return{'model':db[_0x34efa0['model']],'as':_0x34efa0['as'],'attributes':_0x34efa0[_0xbcdd('0x20')],'include':_0x34efa0[_0xbcdd('0x22')]?_[_0xbcdd('0x21')](_0x34efa0[_0xbcdd('0x22')],function(_0x43cad5){return{'model':db[_0x43cad5[_0xbcdd('0x23')]],'as':_0x43cad5['as'],'attributes':_0x43cad5['attributes']};}):[]};}):[]};}):[]:[]})[_0xbcdd('0x12')](function(_0x34aa83){logger[_0xbcdd('0x13')]('GetFaxQueue',_0x291e3c);logger[_0xbcdd('0x16')](_0xbcdd('0x1c'),_0x291e3c,JSON[_0xbcdd('0x24')](_0x34aa83));_0x10a845(_0x34aa83);})[_0xbcdd('0x25')](function(_0x1c51b4){logger[_0xbcdd('0x18')]('GetFaxQueue',_0x1c51b4[_0xbcdd('0x1a')],_0x291e3c);_0x5c12d5(_0x2e7603[_0xbcdd('0x18')](0x1f4,_0x1c51b4[_0xbcdd('0x1a')]));});});};exports['ShowFaxQueue']=function(_0x3765fe){var _0x177785=this;return new Promise(function(_0x56fbdc,_0x35da9a){return db['FaxQueue'][_0xbcdd('0x26')]({'raw':_0x3765fe['options']?_0x3765fe['options'][_0xbcdd('0x27')]===undefined?!![]:![]:!![],'where':_0x3765fe['options']?_0x3765fe[_0xbcdd('0x1f')][_0xbcdd('0x28')]||null:null,'attributes':_0x3765fe[_0xbcdd('0x1f')]?_0x3765fe[_0xbcdd('0x1f')][_0xbcdd('0x20')]||null:null,'include':_0x3765fe[_0xbcdd('0x1f')]?_0x3765fe[_0xbcdd('0x1f')][_0xbcdd('0x22')]?_[_0xbcdd('0x21')](_0x3765fe[_0xbcdd('0x1f')]['include'],function(_0x30f898){return{'model':db[_0x30f898[_0xbcdd('0x23')]],'as':_0x30f898['as'],'attributes':_0x30f898[_0xbcdd('0x20')],'include':_0x30f898[_0xbcdd('0x22')]?_[_0xbcdd('0x21')](_0x30f898[_0xbcdd('0x22')],function(_0x2f048a){return{'model':db[_0x2f048a[_0xbcdd('0x23')]],'as':_0x2f048a['as'],'attributes':_0x2f048a[_0xbcdd('0x20')],'include':_0x2f048a[_0xbcdd('0x22')]?_[_0xbcdd('0x21')](_0x2f048a[_0xbcdd('0x22')],function(_0x13c504){return{'model':db[_0x13c504[_0xbcdd('0x23')]],'as':_0x13c504['as'],'attributes':_0x13c504[_0xbcdd('0x20')]};}):[]};}):[]};}):[]:[]})[_0xbcdd('0x12')](function(_0x4fa288){logger['info'](_0xbcdd('0x29'),_0x3765fe);logger['debug']('ShowFaxQueue',_0x3765fe,JSON[_0xbcdd('0x24')](_0x4fa288));_0x56fbdc(_0x4fa288);})[_0xbcdd('0x25')](function(_0x28961b){logger[_0xbcdd('0x18')](_0xbcdd('0x29'),_0x28961b[_0xbcdd('0x1a')],_0x3765fe);_0x35da9a(_0x177785[_0xbcdd('0x18')](0x1f4,_0x28961b[_0xbcdd('0x1a')]));});});}; \ No newline at end of file +var _0xb4d4=['map','model','then','debug','ShowFaxQueue','find','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client','redis','./faxQueue.socket','register','info','FaxQueue,\x20%s,\x20%s','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetFaxQueue','FaxQueue','findAll','options','raw','where','attributes','limit','include'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb4d4,0x70));var _0x4b4d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb4d4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4b4d('0x0'));var util=require(_0x4b4d('0x1'));var moment=require('moment');var BPromise=require(_0x4b4d('0x2'));var rs=require(_0x4b4d('0x3'));var fs=require('fs');var Redis=require(_0x4b4d('0x4'));var db=require(_0x4b4d('0x5'))['db'];var utils=require(_0x4b4d('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4b4d('0x7')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x4b4d('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4b4d('0x8')]));require(_0x4b4d('0x9'))[_0x4b4d('0xa')](socket);function respondWithRpcPromise(_0x451b08,_0x37d494,_0x4073a9){return new BPromise(function(_0x14f7af,_0x4ac8ab){return client['request'](_0x451b08,_0x4073a9)['then'](function(_0x19b816){logger[_0x4b4d('0xb')](_0x4b4d('0xc'),_0x37d494,_0x4b4d('0xd'));logger['debug'](_0x4b4d('0xe'),_0x37d494,'request\x20sent',JSON[_0x4b4d('0xf')](_0x19b816));if(_0x19b816[_0x4b4d('0x10')]){if(_0x19b816[_0x4b4d('0x10')][_0x4b4d('0x11')]===0x1f4){logger[_0x4b4d('0x10')](_0x4b4d('0xc'),_0x37d494,_0x19b816['error'][_0x4b4d('0x12')]);return _0x4ac8ab(_0x19b816['error']['message']);}logger[_0x4b4d('0x10')](_0x4b4d('0xc'),_0x37d494,_0x19b816['error']['message']);return _0x14f7af(_0x19b816[_0x4b4d('0x10')]['message']);}else{logger[_0x4b4d('0xb')](_0x4b4d('0xc'),_0x37d494,_0x4b4d('0xd'));_0x14f7af(_0x19b816['result'][_0x4b4d('0x12')]);}})['catch'](function(_0x5e3e9e){logger[_0x4b4d('0x10')](_0x4b4d('0xc'),_0x37d494,_0x5e3e9e);_0x4ac8ab(_0x5e3e9e);});});}exports[_0x4b4d('0x13')]=function(_0x395996){var _0xcec7a9=this;return new Promise(function(_0x2fe034,_0x38896d){return db[_0x4b4d('0x14')][_0x4b4d('0x15')]({'raw':_0x395996[_0x4b4d('0x16')]?_0x395996[_0x4b4d('0x16')][_0x4b4d('0x17')]===undefined?!![]:![]:!![],'where':_0x395996[_0x4b4d('0x16')]?_0x395996['options'][_0x4b4d('0x18')]||null:null,'attributes':_0x395996['options']?_0x395996[_0x4b4d('0x16')][_0x4b4d('0x19')]||null:null,'limit':_0x395996[_0x4b4d('0x16')]?_0x395996[_0x4b4d('0x16')][_0x4b4d('0x1a')]||null:null,'include':_0x395996[_0x4b4d('0x16')]?_0x395996['options'][_0x4b4d('0x1b')]?_[_0x4b4d('0x1c')](_0x395996[_0x4b4d('0x16')][_0x4b4d('0x1b')],function(_0x51a5a3){return{'model':db[_0x51a5a3[_0x4b4d('0x1d')]],'as':_0x51a5a3['as'],'attributes':_0x51a5a3[_0x4b4d('0x19')],'include':_0x51a5a3[_0x4b4d('0x1b')]?_[_0x4b4d('0x1c')](_0x51a5a3[_0x4b4d('0x1b')],function(_0x181a47){return{'model':db[_0x181a47[_0x4b4d('0x1d')]],'as':_0x181a47['as'],'attributes':_0x181a47[_0x4b4d('0x19')],'include':_0x181a47[_0x4b4d('0x1b')]?_['map'](_0x181a47['include'],function(_0x2abc63){return{'model':db[_0x2abc63[_0x4b4d('0x1d')]],'as':_0x2abc63['as'],'attributes':_0x2abc63[_0x4b4d('0x19')]};}):[]};}):[]};}):[]:[]})[_0x4b4d('0x1e')](function(_0x2fcb47){logger['info'](_0x4b4d('0x13'),_0x395996);logger[_0x4b4d('0x1f')](_0x4b4d('0x13'),_0x395996,JSON[_0x4b4d('0xf')](_0x2fcb47));_0x2fe034(_0x2fcb47);})['catch'](function(_0x29a7fc){logger[_0x4b4d('0x10')](_0x4b4d('0x13'),_0x29a7fc['message'],_0x395996);_0x38896d(_0xcec7a9[_0x4b4d('0x10')](0x1f4,_0x29a7fc[_0x4b4d('0x12')]));});});};exports[_0x4b4d('0x20')]=function(_0x1d5c46){var _0x4bc962=this;return new Promise(function(_0x3bcc47,_0x3474c7){return db[_0x4b4d('0x14')][_0x4b4d('0x21')]({'raw':_0x1d5c46['options']?_0x1d5c46[_0x4b4d('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x1d5c46[_0x4b4d('0x16')]?_0x1d5c46[_0x4b4d('0x16')][_0x4b4d('0x18')]||null:null,'attributes':_0x1d5c46[_0x4b4d('0x16')]?_0x1d5c46[_0x4b4d('0x16')][_0x4b4d('0x19')]||null:null,'include':_0x1d5c46[_0x4b4d('0x16')]?_0x1d5c46[_0x4b4d('0x16')][_0x4b4d('0x1b')]?_[_0x4b4d('0x1c')](_0x1d5c46[_0x4b4d('0x16')][_0x4b4d('0x1b')],function(_0x2ad7d9){return{'model':db[_0x2ad7d9['model']],'as':_0x2ad7d9['as'],'attributes':_0x2ad7d9['attributes'],'include':_0x2ad7d9['include']?_['map'](_0x2ad7d9[_0x4b4d('0x1b')],function(_0x13749c){return{'model':db[_0x13749c[_0x4b4d('0x1d')]],'as':_0x13749c['as'],'attributes':_0x13749c[_0x4b4d('0x19')],'include':_0x13749c[_0x4b4d('0x1b')]?_['map'](_0x13749c[_0x4b4d('0x1b')],function(_0x267bf7){return{'model':db[_0x267bf7[_0x4b4d('0x1d')]],'as':_0x267bf7['as'],'attributes':_0x267bf7['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x486b48){logger['info']('ShowFaxQueue',_0x1d5c46);logger[_0x4b4d('0x1f')](_0x4b4d('0x20'),_0x1d5c46,JSON['stringify'](_0x486b48));_0x3bcc47(_0x486b48);})[_0x4b4d('0x22')](function(_0xdbc653){logger[_0x4b4d('0x10')](_0x4b4d('0x20'),_0xdbc653[_0x4b4d('0x12')],_0x1d5c46);_0x3474c7(_0x4bc962[_0x4b4d('0x10')](0x1f4,_0xdbc653[_0x4b4d('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 83845c5..99ba4eb 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 _0x3d59=['register','length','faxQueue:','update','emit','removeListener'];(function(_0x14c661,_0x4a590f){var _0x1e2149=function(_0x1b9947){while(--_0x1b9947){_0x14c661['push'](_0x14c661['shift']());}};_0x1e2149(++_0x4a590f);}(_0x3d59,0x117));var _0x93d5=function(_0xfd50e1,_0x3919f8){_0xfd50e1=_0xfd50e1-0x0;var _0x3fd3cf=_0x3d59[_0xfd50e1];return _0x3fd3cf;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=['save','remove',_0x93d5('0x0')];function createListener(_0xc47cb7,_0x3854f6){return function(_0x3aa292){_0x3854f6[_0x93d5('0x1')](_0xc47cb7,_0x3aa292);};}function removeListener(_0x35700c,_0x9e05f1){return function(){FaxQueueEvents[_0x93d5('0x2')](_0x35700c,_0x9e05f1);};}exports[_0x93d5('0x3')]=function(_0x333e5c){for(var _0x2c1849=0x0,_0x1ce8dd=events[_0x93d5('0x4')];_0x2c1849<_0x1ce8dd;_0x2c1849++){var _0x69635d=events[_0x2c1849];var _0x3f6617=createListener(_0x93d5('0x5')+_0x69635d,_0x333e5c);FaxQueueEvents['on'](_0x69635d,_0x3f6617);}}; \ No newline at end of file +var _0x6f0d=['remove','update','removeListener','length','faxQueue:','./faxQueue.events'];(function(_0x38628f,_0x3b08d4){var _0x51c1b4=function(_0x2a47f4){while(--_0x2a47f4){_0x38628f['push'](_0x38628f['shift']());}};_0x51c1b4(++_0x3b08d4);}(_0x6f0d,0x1e5));var _0xd6f0=function(_0x1773d8,_0x551063){_0x1773d8=_0x1773d8-0x0;var _0x33914b=_0x6f0d[_0x1773d8];return _0x33914b;};'use strict';var FaxQueueEvents=require(_0xd6f0('0x0'));var events=['save',_0xd6f0('0x1'),_0xd6f0('0x2')];function createListener(_0x214284,_0x20cf0c){return function(_0x13cfe2){_0x20cf0c['emit'](_0x214284,_0x13cfe2);};}function removeListener(_0x196ec0,_0x2072dc){return function(){FaxQueueEvents[_0xd6f0('0x3')](_0x196ec0,_0x2072dc);};}exports['register']=function(_0x52c4d9){for(var _0x18a556=0x0,_0x1cf8b2=events[_0xd6f0('0x4')];_0x18a556<_0x1cf8b2;_0x18a556++){var _0x289bc6=events[_0x18a556];var _0x272022=createListener(_0xd6f0('0x5')+_0x289bc6,_0x52c4d9);FaxQueueEvents['on'](_0x289bc6,_0x272022);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 100af3e..9ac187a 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 _0xed1c=['/:id/users','post','create','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/teams','getTeams'];(function(_0x3e4820,_0x349a77){var _0x2b2719=function(_0x42d0d5){while(--_0x42d0d5){_0x3e4820['push'](_0x3e4820['shift']());}};_0x2b2719(++_0x349a77);}(_0xed1c,0xe4));var _0xced1=function(_0x29a6c7,_0x3429b5){_0x29a6c7=_0x29a6c7-0x0;var _0xbaa852=_0xed1c[_0x29a6c7];return _0xbaa852;};'use strict';var multer=require(_0xced1('0x0'));var util=require(_0xced1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xced1('0x2'));var auth=require(_0xced1('0x3'));var interaction=require(_0xced1('0x4'));var config=require('../../config/environment');var controller=require(_0xced1('0x5'));router[_0xced1('0x6')]('/',auth[_0xced1('0x7')](),controller[_0xced1('0x8')]);router['get'](_0xced1('0x9'),auth[_0xced1('0x7')](),controller[_0xced1('0xa')]);router[_0xced1('0x6')](_0xced1('0xb'),auth[_0xced1('0x7')](),controller[_0xced1('0xc')]);router[_0xced1('0x6')]('/:id/members',auth[_0xced1('0x7')](),controller['getMembers']);router[_0xced1('0x6')](_0xced1('0xd'),auth[_0xced1('0x7')](),controller[_0xced1('0xe')]);router[_0xced1('0x6')](_0xced1('0xf'),auth[_0xced1('0x7')](),controller['getAgents']);router[_0xced1('0x10')]('/',auth[_0xced1('0x7')](),controller[_0xced1('0x11')]);router[_0xced1('0x10')]('/:id/teams',auth[_0xced1('0x7')](),controller[_0xced1('0x12')]);router['post'](_0xced1('0xf'),auth[_0xced1('0x7')](),controller[_0xced1('0x13')]);router[_0xced1('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xced1('0x15')]);router[_0xced1('0x16')](_0xced1('0xb'),auth[_0xced1('0x7')](),controller[_0xced1('0x17')]);router[_0xced1('0x16')]('/:id/teams',auth['isAuthenticated'](),controller[_0xced1('0x18')]);router[_0xced1('0x16')](_0xced1('0xf'),auth['isAuthenticated'](),controller[_0xced1('0x19')]);module[_0xced1('0x1a')]=router; \ No newline at end of file +var _0xef17=['removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueue.controller','isAuthenticated','get','describe','show','/:id/members','getMembers','getTeams','getAgents','create','post','/:id/teams','addTeams','/:id/users','put','update','destroy'];(function(_0xc31458,_0x45ee76){var _0x1b4a90=function(_0x1a49b0){while(--_0x1a49b0){_0xc31458['push'](_0xc31458['shift']());}};_0x1b4a90(++_0x45ee76);}(_0xef17,0x136));var _0x7ef1=function(_0x4f952e,_0x5623f9){_0x4f952e=_0x4f952e-0x0;var _0x102bef=_0xef17[_0x4f952e];return _0x102bef;};'use strict';var multer=require(_0x7ef1('0x0'));var util=require(_0x7ef1('0x1'));var path=require(_0x7ef1('0x2'));var timeout=require(_0x7ef1('0x3'));var express=require(_0x7ef1('0x4'));var router=express[_0x7ef1('0x5')]();var fs_extra=require(_0x7ef1('0x6'));var auth=require(_0x7ef1('0x7'));var interaction=require(_0x7ef1('0x8'));var config=require('../../config/environment');var controller=require(_0x7ef1('0x9'));router['get']('/',auth[_0x7ef1('0xa')](),controller['index']);router[_0x7ef1('0xb')]('/describe',auth['isAuthenticated'](),controller[_0x7ef1('0xc')]);router[_0x7ef1('0xb')]('/:id',auth[_0x7ef1('0xa')](),controller[_0x7ef1('0xd')]);router[_0x7ef1('0xb')](_0x7ef1('0xe'),auth[_0x7ef1('0xa')](),controller[_0x7ef1('0xf')]);router[_0x7ef1('0xb')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7ef1('0x10')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0x7ef1('0x11')]);router['post']('/',auth[_0x7ef1('0xa')](),controller[_0x7ef1('0x12')]);router[_0x7ef1('0x13')](_0x7ef1('0x14'),auth[_0x7ef1('0xa')](),controller[_0x7ef1('0x15')]);router[_0x7ef1('0x13')](_0x7ef1('0x16'),auth['isAuthenticated'](),controller['addAgents']);router[_0x7ef1('0x17')]('/:id',auth[_0x7ef1('0xa')](),controller[_0x7ef1('0x18')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x7ef1('0x19')]);router['delete'](_0x7ef1('0x14'),auth['isAuthenticated'](),controller['removeTeams']);router['delete'](_0x7ef1('0x16'),auth['isAuthenticated'](),controller[_0x7ef1('0x1a')]);module[_0x7ef1('0x1b')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index a67a75e..31a94d7 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 _0xe389=['DATE','moment','sequelize','STRING'];(function(_0x3acee8,_0x5f3924){var _0x5046cc=function(_0x338def){while(--_0x338def){_0x3acee8['push'](_0x3acee8['shift']());}};_0x5046cc(++_0x5f3924);}(_0xe389,0x1b9));var _0x9e38=function(_0x170e69,_0x5908ad){_0x170e69=_0x170e69-0x0;var _0x2861ed=_0xe389[_0x170e69];return _0x2861ed;};'use strict';var moment=require(_0x9e38('0x0'));var Sequelize=require(_0x9e38('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x9e38('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x9e38('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x9e38('0x3')]},'acceptAt':{'type':Sequelize[_0x9e38('0x3')]},'exitAt':{'type':Sequelize[_0x9e38('0x3')]},'reason':{'type':Sequelize[_0x9e38('0x2')]}}; \ No newline at end of file +var _0xceb3=['moment','sequelize','exports','STRING','DATE'];(function(_0x139f36,_0x3610de){var _0x26ca27=function(_0x5ae210){while(--_0x5ae210){_0x139f36['push'](_0x139f36['shift']());}};_0x26ca27(++_0x3610de);}(_0xceb3,0xf5));var _0x3ceb=function(_0x172747,_0x1732bd){_0x172747=_0x172747-0x0;var _0x509692=_0xceb3[_0x172747];return _0x509692;};'use strict';var moment=require(_0x3ceb('0x0'));var Sequelize=require(_0x3ceb('0x1'));module[_0x3ceb('0x2')]={'uniqueid':{'type':Sequelize[_0x3ceb('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x3ceb('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x3ceb('0x4')]},'acceptAt':{'type':Sequelize[_0x3ceb('0x4')]},'exitAt':{'type':Sequelize[_0x3ceb('0x4')]},'reason':{'type':Sequelize[_0x3ceb('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 8e0925d..0fddb9d 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 _0xb945=['merge','options','count','includeAll','findAll','rows','params','include','find','create','body','catch','describe','eml-format','zip-dir','request-promise','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','set','Content-Range','json','apply','update','then','destroy','error','stack','send','index','map','FaxQueueReport','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','fields','length','order','sort','where','filters','filter','VIRTUAL'];(function(_0x57cc22,_0x2d351f){var _0x6f7bdc=function(_0x4935b5){while(--_0x4935b5){_0x57cc22['push'](_0x57cc22['shift']());}};_0x6f7bdc(++_0x2d351f);}(_0xb945,0x97));var _0x5b94=function(_0x565b23,_0x2ba1ee){_0x565b23=_0x565b23-0x0;var _0x20913c=_0xb945[_0x565b23];return _0x20913c;};'use strict';var emlformat=require(_0x5b94('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5b94('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5b94('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5b94('0x3'));var util=require(_0x5b94('0x4'));var path=require(_0x5b94('0x5'));var sox=require(_0x5b94('0x6'));var csv=require(_0x5b94('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5b94('0x8'));var squel=require(_0x5b94('0x9'));var crypto=require(_0x5b94('0xa'));var jsforce=require(_0x5b94('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x5b94('0x7'));var querystring=require('querystring');var Papa=require(_0x5b94('0xc'));var Redis=require(_0x5b94('0xd'));var authService=require(_0x5b94('0xe'));var qs=require(_0x5b94('0xf'));var as=require(_0x5b94('0x10'));var hardwareService=require(_0x5b94('0x11'));var logger=require(_0x5b94('0x12'))('api');var utils=require(_0x5b94('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x5b94('0x14'));var db=require(_0x5b94('0x15'))['db'];function respondWithStatusCode(_0x11e65c,_0x23e1d8){_0x23e1d8=_0x23e1d8||0xcc;return function(_0x32948e){if(_0x32948e){return _0x11e65c['sendStatus'](_0x23e1d8);}return _0x11e65c[_0x5b94('0x16')](_0x23e1d8)[_0x5b94('0x17')]();};}function respondWithResult(_0x3d819d,_0x1114ab){_0x1114ab=_0x1114ab||0xc8;return function(_0x51f123){if(_0x51f123){return _0x3d819d[_0x5b94('0x16')](_0x1114ab)['json'](_0x51f123);}};}function respondWithFilteredResult(_0xa8cf03,_0x34aa94){return function(_0x48914f){if(_0x48914f){var _0x40fbc7=typeof _0x34aa94[_0x5b94('0x18')]===_0x5b94('0x19')&&typeof _0x34aa94['limit']===_0x5b94('0x19');var _0x371fce=_0x48914f['count'];var _0x2bb003=_0x40fbc7?0x0:_0x34aa94[_0x5b94('0x18')];var _0x1b5874=_0x40fbc7?_0x48914f['count']:_0x34aa94[_0x5b94('0x18')]+_0x34aa94[_0x5b94('0x1a')];var _0x5b13e0;if(_0x1b5874>=_0x371fce){_0x1b5874=_0x371fce;_0x5b13e0=0xc8;}else{_0x5b13e0=0xce;}_0xa8cf03[_0x5b94('0x16')](_0x5b13e0);return _0xa8cf03[_0x5b94('0x1b')](_0x5b94('0x1c'),_0x2bb003+'-'+_0x1b5874+'/'+_0x371fce)[_0x5b94('0x1d')](_0x48914f);}return null;};}function patchUpdates(_0x1f2293){return function(_0x5d1a5a){try{jsonpatch[_0x5b94('0x1e')](_0x5d1a5a,_0x1f2293,!![]);}catch(_0x44d510){return BPromise['reject'](_0x44d510);}return _0x5d1a5a['save']();};}function saveUpdates(_0x17789b,_0xb9e5db){return function(_0x12980d){if(_0x12980d){return _0x12980d[_0x5b94('0x1f')](_0x17789b)[_0x5b94('0x20')](function(_0x30fb7a){return _0x30fb7a;});}return null;};}function removeEntity(_0x1e8236,_0x31d950){return function(_0x219486){if(_0x219486){return _0x219486[_0x5b94('0x21')]()[_0x5b94('0x20')](function(){_0x1e8236[_0x5b94('0x16')](0xcc)[_0x5b94('0x17')]();});}};}function handleEntityNotFound(_0x1c8db6,_0x439df0){return function(_0x2efe25){if(!_0x2efe25){_0x1c8db6['sendStatus'](0x194);}return _0x2efe25;};}function handleError(_0x21f36e,_0x41a4e9){_0x41a4e9=_0x41a4e9||0x1f4;return function(_0x344373){logger[_0x5b94('0x22')](_0x344373[_0x5b94('0x23')]);if(_0x344373['name']){delete _0x344373['name'];}_0x21f36e[_0x5b94('0x16')](_0x41a4e9)[_0x5b94('0x24')](_0x344373);};}exports[_0x5b94('0x25')]=function(_0x5bace6,_0x6001fd){var _0x377ac5={},_0x594aca={},_0x5dc969={'count':0x0,'rows':[]};var _0x151c6c=_[_0x5b94('0x26')](db[_0x5b94('0x27')][_0x5b94('0x28')],function(_0x67a149){return{'name':_0x67a149[_0x5b94('0x29')],'type':_0x67a149[_0x5b94('0x2a')]['key']};});_0x594aca[_0x5b94('0x2b')]=_['map'](_0x151c6c,'name');_0x594aca['query']=_[_0x5b94('0x2c')](_0x5bace6[_0x5b94('0x2d')]);_0x594aca['filters']=_[_0x5b94('0x2e')](_0x594aca[_0x5b94('0x2b')],_0x594aca[_0x5b94('0x2d')]);_0x377ac5[_0x5b94('0x2f')]=_['intersection'](_0x594aca['model'],qs[_0x5b94('0x30')](_0x5bace6[_0x5b94('0x2d')]['fields']));_0x377ac5[_0x5b94('0x2f')]=_0x377ac5[_0x5b94('0x2f')][_0x5b94('0x31')]?_0x377ac5[_0x5b94('0x2f')]:_0x594aca[_0x5b94('0x2b')];if(!_0x5bace6['query']['hasOwnProperty']('nolimit')){_0x377ac5[_0x5b94('0x1a')]=qs[_0x5b94('0x1a')](_0x5bace6['query'][_0x5b94('0x1a')]);_0x377ac5['offset']=qs['offset'](_0x5bace6[_0x5b94('0x2d')][_0x5b94('0x18')]);}_0x377ac5[_0x5b94('0x32')]=qs['sort'](_0x5bace6['query'][_0x5b94('0x33')]);_0x377ac5[_0x5b94('0x34')]=qs['filters'](_['pick'](_0x5bace6[_0x5b94('0x2d')],_0x594aca[_0x5b94('0x35')]),_0x151c6c);if(_0x5bace6[_0x5b94('0x2d')][_0x5b94('0x36')]){_0x377ac5['where']=_['merge'](_0x377ac5[_0x5b94('0x34')],{'$or':_[_0x5b94('0x26')](_0x151c6c,function(_0x38c7b6){if(_0x38c7b6[_0x5b94('0x2a')]!==_0x5b94('0x37')){var _0x504487={};_0x504487[_0x38c7b6['name']]={'$like':'%'+_0x5bace6['query'][_0x5b94('0x36')]+'%'};return _0x504487;}})});}_0x377ac5=_[_0x5b94('0x38')]({},_0x377ac5,_0x5bace6[_0x5b94('0x39')]);var _0x10f126={'where':_0x377ac5[_0x5b94('0x34')]};return db[_0x5b94('0x27')][_0x5b94('0x3a')](_0x10f126)[_0x5b94('0x20')](function(_0x371256){_0x5dc969[_0x5b94('0x3a')]=_0x371256;if(_0x5bace6[_0x5b94('0x2d')][_0x5b94('0x3b')]){_0x377ac5['include']=[{'all':!![]}];}return db[_0x5b94('0x27')][_0x5b94('0x3c')](_0x377ac5);})[_0x5b94('0x20')](function(_0x2f5353){_0x5dc969[_0x5b94('0x3d')]=_0x2f5353;return _0x5dc969;})[_0x5b94('0x20')](respondWithFilteredResult(_0x6001fd,_0x377ac5))['catch'](handleError(_0x6001fd,null));};exports['show']=function(_0x304cc3,_0x28143b){var _0x5ea6da={'raw':!![],'where':{'id':_0x304cc3[_0x5b94('0x3e')]['id']}},_0x40e32b={};_0x40e32b[_0x5b94('0x2b')]=_['keys'](db[_0x5b94('0x27')][_0x5b94('0x28')]);_0x40e32b['query']=_[_0x5b94('0x2c')](_0x304cc3[_0x5b94('0x2d')]);_0x40e32b[_0x5b94('0x35')]=_['intersection'](_0x40e32b[_0x5b94('0x2b')],_0x40e32b['query']);_0x5ea6da['attributes']=_[_0x5b94('0x2e')](_0x40e32b[_0x5b94('0x2b')],qs[_0x5b94('0x30')](_0x304cc3[_0x5b94('0x2d')]['fields']));_0x5ea6da[_0x5b94('0x2f')]=_0x5ea6da[_0x5b94('0x2f')]['length']?_0x5ea6da[_0x5b94('0x2f')]:_0x40e32b[_0x5b94('0x2b')];if(_0x304cc3[_0x5b94('0x2d')][_0x5b94('0x3b')]){_0x5ea6da[_0x5b94('0x3f')]=[{'all':!![]}];}_0x5ea6da=_[_0x5b94('0x38')]({},_0x5ea6da,_0x304cc3[_0x5b94('0x39')]);return db['FaxQueueReport'][_0x5b94('0x40')](_0x5ea6da)[_0x5b94('0x20')](handleEntityNotFound(_0x28143b,null))[_0x5b94('0x20')](respondWithResult(_0x28143b,null))['catch'](handleError(_0x28143b,null));};exports['create']=function(_0x5312c2,_0x1b7cd8){return db['FaxQueueReport'][_0x5b94('0x41')](_0x5312c2[_0x5b94('0x42')],{})['then'](respondWithResult(_0x1b7cd8,0xc9))['catch'](handleError(_0x1b7cd8,null));};exports[_0x5b94('0x1f')]=function(_0x389134,_0x157593){if(_0x389134[_0x5b94('0x42')]['id']){delete _0x389134[_0x5b94('0x42')]['id'];}return db[_0x5b94('0x27')][_0x5b94('0x40')]({'where':{'id':_0x389134[_0x5b94('0x3e')]['id']}})[_0x5b94('0x20')](handleEntityNotFound(_0x157593,null))['then'](saveUpdates(_0x389134[_0x5b94('0x42')],null))[_0x5b94('0x20')](respondWithResult(_0x157593,null))[_0x5b94('0x43')](handleError(_0x157593,null));};exports[_0x5b94('0x21')]=function(_0x17e67f,_0x51d764){return db[_0x5b94('0x27')]['find']({'where':{'id':_0x17e67f[_0x5b94('0x3e')]['id']}})['then'](handleEntityNotFound(_0x51d764,null))[_0x5b94('0x20')](removeEntity(_0x51d764,null))[_0x5b94('0x43')](handleError(_0x51d764,null));};exports[_0x5b94('0x44')]=function(_0x34a160,_0x54e838){return db[_0x5b94('0x27')][_0x5b94('0x44')]()[_0x5b94('0x20')](respondWithResult(_0x54e838,null))[_0x5b94('0x43')](handleError(_0x54e838,null));}; \ No newline at end of file +var _0x4876=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','stack','send','index','map','rawAttributes','type','key','model','name','query','keys','filters','fields','attributes','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','FaxQueueReport','findAll','rows','catch','show','params','intersection','length','find','create','body','destroy','describe','zip-dir','moment','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x2b3509,_0x662ece){var _0x11795e=function(_0x54f68f){while(--_0x54f68f){_0x2b3509['push'](_0x2b3509['shift']());}};_0x11795e(++_0x662ece);}(_0x4876,0x84));var _0x6487=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4876[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6487('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6487('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x6487('0x2'));var util=require(_0x6487('0x3'));var path=require(_0x6487('0x4'));var sox=require(_0x6487('0x5'));var csv=require('to-csv');var ejs=require(_0x6487('0x6'));var fs=require('fs');var fs_extra=require(_0x6487('0x7'));var _=require('lodash');var squel=require(_0x6487('0x8'));var crypto=require(_0x6487('0x9'));var jsforce=require(_0x6487('0xa'));var deskjs=require(_0x6487('0xb'));var toCsv=require(_0x6487('0xc'));var querystring=require(_0x6487('0xd'));var Papa=require(_0x6487('0xe'));var Redis=require(_0x6487('0xf'));var authService=require(_0x6487('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x6487('0x11'));var hardwareService=require(_0x6487('0x12'));var logger=require(_0x6487('0x13'))(_0x6487('0x14'));var utils=require(_0x6487('0x15'));var config=require(_0x6487('0x16'));var licenseUtil=require(_0x6487('0x17'));var db=require(_0x6487('0x18'))['db'];function respondWithStatusCode(_0x48e266,_0x30227d){_0x30227d=_0x30227d||0xcc;return function(_0x22596a){if(_0x22596a){return _0x48e266[_0x6487('0x19')](_0x30227d);}return _0x48e266[_0x6487('0x1a')](_0x30227d)['end']();};}function respondWithResult(_0x40a352,_0x10f2e1){_0x10f2e1=_0x10f2e1||0xc8;return function(_0x1ac263){if(_0x1ac263){return _0x40a352[_0x6487('0x1a')](_0x10f2e1)['json'](_0x1ac263);}};}function respondWithFilteredResult(_0x522154,_0x1dde46){return function(_0x552f2d){if(_0x552f2d){var _0x2fdfc3=typeof _0x1dde46['offset']===_0x6487('0x1b')&&typeof _0x1dde46[_0x6487('0x1c')]===_0x6487('0x1b');var _0x26b2f2=_0x552f2d[_0x6487('0x1d')];var _0x59514e=_0x2fdfc3?0x0:_0x1dde46['offset'];var _0x5afb4a=_0x2fdfc3?_0x552f2d[_0x6487('0x1d')]:_0x1dde46[_0x6487('0x1e')]+_0x1dde46[_0x6487('0x1c')];var _0x424ae2;if(_0x5afb4a>=_0x26b2f2){_0x5afb4a=_0x26b2f2;_0x424ae2=0xc8;}else{_0x424ae2=0xce;}_0x522154[_0x6487('0x1a')](_0x424ae2);return _0x522154[_0x6487('0x1f')](_0x6487('0x20'),_0x59514e+'-'+_0x5afb4a+'/'+_0x26b2f2)[_0x6487('0x21')](_0x552f2d);}return null;};}function patchUpdates(_0x1b99ef){return function(_0x30ed2e){try{jsonpatch[_0x6487('0x22')](_0x30ed2e,_0x1b99ef,!![]);}catch(_0x2827a3){return BPromise[_0x6487('0x23')](_0x2827a3);}return _0x30ed2e[_0x6487('0x24')]();};}function saveUpdates(_0x21b8e8,_0x21050d){return function(_0x3affe7){if(_0x3affe7){return _0x3affe7[_0x6487('0x25')](_0x21b8e8)[_0x6487('0x26')](function(_0x4d06b2){return _0x4d06b2;});}return null;};}function removeEntity(_0x58d269,_0x234485){return function(_0x4e8ec8){if(_0x4e8ec8){return _0x4e8ec8['destroy']()[_0x6487('0x26')](function(){_0x58d269[_0x6487('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x116995,_0x38ac56){return function(_0x2f4190){if(!_0x2f4190){_0x116995[_0x6487('0x19')](0x194);}return _0x2f4190;};}function handleError(_0x392e60,_0x5439f7){_0x5439f7=_0x5439f7||0x1f4;return function(_0x44bb48){logger['error'](_0x44bb48[_0x6487('0x27')]);if(_0x44bb48['name']){delete _0x44bb48['name'];}_0x392e60[_0x6487('0x1a')](_0x5439f7)[_0x6487('0x28')](_0x44bb48);};}exports[_0x6487('0x29')]=function(_0x4c424a,_0x39581d){var _0x3c4411={},_0x33085b={},_0x63ddc7={'count':0x0,'rows':[]};var _0x35b089=_[_0x6487('0x2a')](db['FaxQueueReport'][_0x6487('0x2b')],function(_0x270e6e){return{'name':_0x270e6e['fieldName'],'type':_0x270e6e[_0x6487('0x2c')][_0x6487('0x2d')]};});_0x33085b[_0x6487('0x2e')]=_[_0x6487('0x2a')](_0x35b089,_0x6487('0x2f'));_0x33085b[_0x6487('0x30')]=_[_0x6487('0x31')](_0x4c424a['query']);_0x33085b[_0x6487('0x32')]=_['intersection'](_0x33085b[_0x6487('0x2e')],_0x33085b['query']);_0x3c4411['attributes']=_['intersection'](_0x33085b['model'],qs[_0x6487('0x33')](_0x4c424a[_0x6487('0x30')][_0x6487('0x33')]));_0x3c4411['attributes']=_0x3c4411[_0x6487('0x34')]['length']?_0x3c4411[_0x6487('0x34')]:_0x33085b[_0x6487('0x2e')];if(!_0x4c424a[_0x6487('0x30')][_0x6487('0x35')](_0x6487('0x36'))){_0x3c4411['limit']=qs[_0x6487('0x1c')](_0x4c424a['query'][_0x6487('0x1c')]);_0x3c4411[_0x6487('0x1e')]=qs[_0x6487('0x1e')](_0x4c424a[_0x6487('0x30')]['offset']);}_0x3c4411[_0x6487('0x37')]=qs[_0x6487('0x38')](_0x4c424a[_0x6487('0x30')]['sort']);_0x3c4411['where']=qs[_0x6487('0x32')](_['pick'](_0x4c424a[_0x6487('0x30')],_0x33085b[_0x6487('0x32')]),_0x35b089);if(_0x4c424a[_0x6487('0x30')]['filter']){_0x3c4411[_0x6487('0x39')]=_[_0x6487('0x3a')](_0x3c4411[_0x6487('0x39')],{'$or':_[_0x6487('0x2a')](_0x35b089,function(_0x2e532d){if(_0x2e532d[_0x6487('0x2c')]!==_0x6487('0x3b')){var _0x538293={};_0x538293[_0x2e532d[_0x6487('0x2f')]]={'$like':'%'+_0x4c424a[_0x6487('0x30')][_0x6487('0x3c')]+'%'};return _0x538293;}})});}_0x3c4411=_['merge']({},_0x3c4411,_0x4c424a[_0x6487('0x3d')]);var _0x4de8c8={'where':_0x3c4411[_0x6487('0x39')]};return db['FaxQueueReport'][_0x6487('0x1d')](_0x4de8c8)['then'](function(_0x44e2e9){_0x63ddc7[_0x6487('0x1d')]=_0x44e2e9;if(_0x4c424a[_0x6487('0x30')][_0x6487('0x3e')]){_0x3c4411[_0x6487('0x3f')]=[{'all':!![]}];}return db[_0x6487('0x40')][_0x6487('0x41')](_0x3c4411);})[_0x6487('0x26')](function(_0x47b3bb){_0x63ddc7[_0x6487('0x42')]=_0x47b3bb;return _0x63ddc7;})[_0x6487('0x26')](respondWithFilteredResult(_0x39581d,_0x3c4411))[_0x6487('0x43')](handleError(_0x39581d,null));};exports[_0x6487('0x44')]=function(_0x3598c4,_0x12f7f5){var _0x594b42={'raw':!![],'where':{'id':_0x3598c4[_0x6487('0x45')]['id']}},_0x56452e={};_0x56452e['model']=_[_0x6487('0x31')](db[_0x6487('0x40')][_0x6487('0x2b')]);_0x56452e[_0x6487('0x30')]=_[_0x6487('0x31')](_0x3598c4[_0x6487('0x30')]);_0x56452e[_0x6487('0x32')]=_[_0x6487('0x46')](_0x56452e[_0x6487('0x2e')],_0x56452e['query']);_0x594b42[_0x6487('0x34')]=_[_0x6487('0x46')](_0x56452e[_0x6487('0x2e')],qs['fields'](_0x3598c4['query'][_0x6487('0x33')]));_0x594b42[_0x6487('0x34')]=_0x594b42[_0x6487('0x34')][_0x6487('0x47')]?_0x594b42[_0x6487('0x34')]:_0x56452e[_0x6487('0x2e')];if(_0x3598c4['query'][_0x6487('0x3e')]){_0x594b42['include']=[{'all':!![]}];}_0x594b42=_[_0x6487('0x3a')]({},_0x594b42,_0x3598c4[_0x6487('0x3d')]);return db[_0x6487('0x40')][_0x6487('0x48')](_0x594b42)[_0x6487('0x26')](handleEntityNotFound(_0x12f7f5,null))[_0x6487('0x26')](respondWithResult(_0x12f7f5,null))[_0x6487('0x43')](handleError(_0x12f7f5,null));};exports[_0x6487('0x49')]=function(_0x2f6b86,_0x1e8ae7){return db[_0x6487('0x40')][_0x6487('0x49')](_0x2f6b86['body'],{})[_0x6487('0x26')](respondWithResult(_0x1e8ae7,0xc9))['catch'](handleError(_0x1e8ae7,null));};exports[_0x6487('0x25')]=function(_0x2c4272,_0x46c3dd){if(_0x2c4272[_0x6487('0x4a')]['id']){delete _0x2c4272[_0x6487('0x4a')]['id'];}return db[_0x6487('0x40')][_0x6487('0x48')]({'where':{'id':_0x2c4272[_0x6487('0x45')]['id']}})[_0x6487('0x26')](handleEntityNotFound(_0x46c3dd,null))[_0x6487('0x26')](saveUpdates(_0x2c4272[_0x6487('0x4a')],null))[_0x6487('0x26')](respondWithResult(_0x46c3dd,null))[_0x6487('0x43')](handleError(_0x46c3dd,null));};exports[_0x6487('0x4b')]=function(_0x2a7715,_0x2dde3c){return db[_0x6487('0x40')][_0x6487('0x48')]({'where':{'id':_0x2a7715[_0x6487('0x45')]['id']}})['then'](handleEntityNotFound(_0x2dde3c,null))[_0x6487('0x26')](removeEntity(_0x2dde3c,null))[_0x6487('0x43')](handleError(_0x2dde3c,null));};exports['describe']=function(_0x39f822,_0x38a94b){return db[_0x6487('0x40')][_0x6487('0x4c')]()['then'](respondWithResult(_0x38a94b,null))[_0x6487('0x43')](handleError(_0x38a94b,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 00ed180..fa537ec 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 _0x5fab=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport','report_fax_queue','uniqueid','lodash','util','api'];(function(_0x16d079,_0xe8189a){var _0x1f04bc=function(_0x246690){while(--_0x246690){_0x16d079['push'](_0x16d079['shift']());}};_0x1f04bc(++_0xe8189a);}(_0x5fab,0x177));var _0xb5fa=function(_0x18ec3f,_0x7c819e){_0x18ec3f=_0x18ec3f-0x0;var _0x2dbfec=_0x5fab[_0x18ec3f];return _0x2dbfec;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));module[_0xb5fa('0xa')]=function(_0x44df89,_0x4a0249){return _0x44df89['define'](_0xb5fa('0xb'),attributes,{'tableName':_0xb5fa('0xc'),'paranoid':![],'indexes':[{'name':_0xb5fa('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['report_fax_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport'];(function(_0x19438b,_0x57bd67){var _0x135efe=function(_0x1e3d21){while(--_0x1e3d21){_0x19438b['push'](_0x19438b['shift']());}};_0x135efe(++_0x57bd67);}(_0x7a54,0x106));var _0x47a5=function(_0x294590,_0x16735f){_0x294590=_0x294590-0x0;var _0xb6492=_0x7a54[_0x294590];return _0xb6492;};'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 94536aa..39e636c 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 _0x8a0c=['rpc','../../config/environment','http','request','then','FaxQueueReport,\x20%s,\x20%s','request\x20sent','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateFaxQueueReport','FaxQueueReport','body','options','raw','debug','update','where','attributes','limit','UpdateFaxQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4caf3b,_0x44d55b){var _0x11ef8f=function(_0x3fd7c4){while(--_0x3fd7c4){_0x4caf3b['push'](_0x4caf3b['shift']());}};_0x11ef8f(++_0x44d55b);}(_0x8a0c,0x1be));var _0xc8a0=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x8a0c[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0xc8a0('0x0'));var util=require(_0xc8a0('0x1'));var moment=require(_0xc8a0('0x2'));var BPromise=require(_0xc8a0('0x3'));var rs=require(_0xc8a0('0x4'));var fs=require('fs');var Redis=require(_0xc8a0('0x5'));var db=require(_0xc8a0('0x6'))['db'];var utils=require(_0xc8a0('0x7'));var logger=require(_0xc8a0('0x8'))(_0xc8a0('0x9'));var config=require(_0xc8a0('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc8a0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x593ccd,_0x48dbe2,_0xe240e9){return new BPromise(function(_0x4ce6e1,_0x13df6e){return client[_0xc8a0('0xc')](_0x593ccd,_0xe240e9)[_0xc8a0('0xd')](function(_0x449508){logger['info'](_0xc8a0('0xe'),_0x48dbe2,_0xc8a0('0xf'));logger['debug'](_0xc8a0('0x10'),_0x48dbe2,_0xc8a0('0xf'),JSON[_0xc8a0('0x11')](_0x449508));if(_0x449508[_0xc8a0('0x12')]){if(_0x449508['error'][_0xc8a0('0x13')]===0x1f4){logger['error'](_0xc8a0('0xe'),_0x48dbe2,_0x449508[_0xc8a0('0x12')][_0xc8a0('0x14')]);return _0x13df6e(_0x449508['error'][_0xc8a0('0x14')]);}logger[_0xc8a0('0x12')]('FaxQueueReport,\x20%s,\x20%s',_0x48dbe2,_0x449508[_0xc8a0('0x12')]['message']);return _0x4ce6e1(_0x449508[_0xc8a0('0x12')]['message']);}else{logger[_0xc8a0('0x15')](_0xc8a0('0xe'),_0x48dbe2,_0xc8a0('0xf'));_0x4ce6e1(_0x449508[_0xc8a0('0x16')][_0xc8a0('0x14')]);}})[_0xc8a0('0x17')](function(_0x1fc8b7){logger[_0xc8a0('0x12')](_0xc8a0('0xe'),_0x48dbe2,_0x1fc8b7);_0x13df6e(_0x1fc8b7);});});}exports[_0xc8a0('0x18')]=function(_0x57eb12){var _0x42fd69=this;return new Promise(function(_0x222821,_0x1d0b71){return db[_0xc8a0('0x19')]['create'](_0x57eb12[_0xc8a0('0x1a')],{'raw':_0x57eb12[_0xc8a0('0x1b')]?_0x57eb12[_0xc8a0('0x1b')][_0xc8a0('0x1c')]===undefined?!![]:![]:!![]})[_0xc8a0('0xd')](function(_0x3ac2ae){logger[_0xc8a0('0x15')](_0xc8a0('0x18'),_0x57eb12);logger[_0xc8a0('0x1d')](_0xc8a0('0x18'),_0x57eb12,JSON[_0xc8a0('0x11')](_0x3ac2ae));_0x222821(_0x3ac2ae);})[_0xc8a0('0x17')](function(_0x566d7a){logger[_0xc8a0('0x12')](_0xc8a0('0x18'),_0x566d7a['message'],_0x57eb12);_0x1d0b71(_0x42fd69[_0xc8a0('0x12')](0x1f4,_0x566d7a['message']));});});};exports['UpdateFaxQueueReport']=function(_0x2d8715){var _0x5097d2=this;return new Promise(function(_0x1b9a89,_0x29951a){return db[_0xc8a0('0x19')][_0xc8a0('0x1e')](_0x2d8715[_0xc8a0('0x1a')],{'raw':_0x2d8715[_0xc8a0('0x1b')]?_0x2d8715[_0xc8a0('0x1b')][_0xc8a0('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d8715['options']?_0x2d8715['options'][_0xc8a0('0x1f')]||null:null,'attributes':_0x2d8715[_0xc8a0('0x1b')]?_0x2d8715[_0xc8a0('0x1b')][_0xc8a0('0x20')]||null:null,'limit':_0x2d8715[_0xc8a0('0x1b')]?_0x2d8715[_0xc8a0('0x1b')][_0xc8a0('0x21')]||null:null})[_0xc8a0('0xd')](function(_0x1d6a6b){logger[_0xc8a0('0x15')](_0xc8a0('0x22'),_0x2d8715);logger['debug'](_0xc8a0('0x22'),_0x2d8715,JSON[_0xc8a0('0x11')](_0x1d6a6b));_0x1b9a89(_0x1d6a6b);})[_0xc8a0('0x17')](function(_0x256f87){logger[_0xc8a0('0x12')](_0xc8a0('0x22'),_0x256f87[_0xc8a0('0x14')],_0x2d8715);_0x29951a(_0x5097d2[_0xc8a0('0x12')](0x1f4,_0x256f87[_0xc8a0('0x14')]));});});}; \ No newline at end of file +var _0x2832=['result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','UpdateFaxQueueReport','update','where','attributes','limit','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x1aed66,_0x23163e){var _0x4bfc31=function(_0x1ed23e){while(--_0x1ed23e){_0x1aed66['push'](_0x1aed66['shift']());}};_0x4bfc31(++_0x23163e);}(_0x2832,0x14c));var _0x2283=function(_0x15e650,_0x48ac06){_0x15e650=_0x15e650-0x0;var _0xffba51=_0x2832[_0x15e650];return _0xffba51;};'use strict';var _=require(_0x2283('0x0'));var util=require('util');var moment=require(_0x2283('0x1'));var BPromise=require(_0x2283('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2283('0x3'));var db=require(_0x2283('0x4'))['db'];var utils=require(_0x2283('0x5'));var logger=require('../../config/logger')(_0x2283('0x6'));var config=require(_0x2283('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2283('0x8')][_0x2283('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d746a,_0x55dbdc,_0x530557){return new BPromise(function(_0x24453b,_0x6e4024){return client[_0x2283('0xa')](_0x4d746a,_0x530557)[_0x2283('0xb')](function(_0x3e62a){logger[_0x2283('0xc')](_0x2283('0xd'),_0x55dbdc,_0x2283('0xe'));logger[_0x2283('0xf')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x55dbdc,_0x2283('0xe'),JSON[_0x2283('0x10')](_0x3e62a));if(_0x3e62a[_0x2283('0x11')]){if(_0x3e62a[_0x2283('0x11')][_0x2283('0x12')]===0x1f4){logger[_0x2283('0x11')](_0x2283('0xd'),_0x55dbdc,_0x3e62a['error'][_0x2283('0x13')]);return _0x6e4024(_0x3e62a['error'][_0x2283('0x13')]);}logger['error'](_0x2283('0xd'),_0x55dbdc,_0x3e62a[_0x2283('0x11')]['message']);return _0x24453b(_0x3e62a[_0x2283('0x11')][_0x2283('0x13')]);}else{logger[_0x2283('0xc')](_0x2283('0xd'),_0x55dbdc,_0x2283('0xe'));_0x24453b(_0x3e62a[_0x2283('0x14')][_0x2283('0x13')]);}})[_0x2283('0x15')](function(_0x151168){logger[_0x2283('0x11')](_0x2283('0xd'),_0x55dbdc,_0x151168);_0x6e4024(_0x151168);});});}exports[_0x2283('0x16')]=function(_0x516b0a){var _0x1622b8=this;return new Promise(function(_0x481dd6,_0x50bad2){return db[_0x2283('0x17')][_0x2283('0x18')](_0x516b0a[_0x2283('0x19')],{'raw':_0x516b0a[_0x2283('0x1a')]?_0x516b0a['options']['raw']===undefined?!![]:![]:!![]})[_0x2283('0xb')](function(_0x1704b1){logger[_0x2283('0xc')](_0x2283('0x16'),_0x516b0a);logger['debug']('CreateFaxQueueReport',_0x516b0a,JSON[_0x2283('0x10')](_0x1704b1));_0x481dd6(_0x1704b1);})['catch'](function(_0x30d9b2){logger[_0x2283('0x11')](_0x2283('0x16'),_0x30d9b2[_0x2283('0x13')],_0x516b0a);_0x50bad2(_0x1622b8[_0x2283('0x11')](0x1f4,_0x30d9b2[_0x2283('0x13')]));});});};exports[_0x2283('0x1b')]=function(_0x55c3b3){var _0x17e475=this;return new Promise(function(_0x4c4ae1,_0x156d3f){return db['FaxQueueReport'][_0x2283('0x1c')](_0x55c3b3[_0x2283('0x19')],{'raw':_0x55c3b3['options']?_0x55c3b3[_0x2283('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55c3b3[_0x2283('0x1a')]?_0x55c3b3[_0x2283('0x1a')][_0x2283('0x1d')]||null:null,'attributes':_0x55c3b3[_0x2283('0x1a')]?_0x55c3b3[_0x2283('0x1a')][_0x2283('0x1e')]||null:null,'limit':_0x55c3b3[_0x2283('0x1a')]?_0x55c3b3['options'][_0x2283('0x1f')]||null:null})[_0x2283('0xb')](function(_0x260538){logger[_0x2283('0xc')](_0x2283('0x1b'),_0x55c3b3);logger[_0x2283('0xf')]('UpdateFaxQueueReport',_0x55c3b3,JSON[_0x2283('0x10')](_0x260538));_0x4c4ae1(_0x260538);})[_0x2283('0x15')](function(_0x704e5c){logger['error'](_0x2283('0x1b'),_0x704e5c['message'],_0x55c3b3);_0x156d3f(_0x17e475[_0x2283('0x11')](0x1f4,_0x704e5c[_0x2283('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index de82773..a2df9dd 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 _0x6371=['delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','/:id','update'];(function(_0x4fb7b5,_0x23fa04){var _0x2261fe=function(_0x46f42b){while(--_0x46f42b){_0x4fb7b5['push'](_0x4fb7b5['shift']());}};_0x2261fe(++_0x23fa04);}(_0x6371,0x1e1));var _0x1637=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x6371[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require(_0x1637('0x0'));var util=require(_0x1637('0x1'));var path=require(_0x1637('0x2'));var timeout=require(_0x1637('0x3'));var express=require(_0x1637('0x4'));var router=express[_0x1637('0x5')]();var fs_extra=require(_0x1637('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1637('0x7'));var controller=require(_0x1637('0x8'));router[_0x1637('0x9')]('/',auth[_0x1637('0xa')](),controller[_0x1637('0xb')]);router[_0x1637('0x9')](_0x1637('0xc'),auth[_0x1637('0xa')](),controller[_0x1637('0xd')]);router[_0x1637('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x1637('0xe')]);router[_0x1637('0xf')]('/',auth[_0x1637('0xa')](),controller[_0x1637('0x10')]);router['put'](_0x1637('0x11'),auth[_0x1637('0xa')](),controller[_0x1637('0x12')]);router[_0x1637('0x13')]('/:id',auth[_0x1637('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xe700=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','describe','/:id','show','put','delete','destroy','exports','multer'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xe700,0x71));var _0x0e70=function(_0x38f004,_0x1ff34d){_0x38f004=_0x38f004-0x0;var _0x3ffd73=_0xe700[_0x38f004];return _0x3ffd73;};'use strict';var multer=require(_0x0e70('0x0'));var util=require(_0x0e70('0x1'));var path=require(_0x0e70('0x2'));var timeout=require(_0x0e70('0x3'));var express=require('express');var router=express[_0x0e70('0x4')]();var fs_extra=require(_0x0e70('0x5'));var auth=require(_0x0e70('0x6'));var interaction=require(_0x0e70('0x7'));var config=require('../../config/environment');var controller=require('./faxQueueReport.controller');router['get']('/',auth[_0x0e70('0x8')](),controller[_0x0e70('0x9')]);router[_0x0e70('0xa')](_0x0e70('0xb'),auth['isAuthenticated'](),controller[_0x0e70('0xc')]);router['get'](_0x0e70('0xd'),auth[_0x0e70('0x8')](),controller[_0x0e70('0xe')]);router['post']('/',auth[_0x0e70('0x8')](),controller['create']);router[_0x0e70('0xf')](_0x0e70('0xd'),auth[_0x0e70('0x8')](),controller['update']);router[_0x0e70('0x10')](_0x0e70('0xd'),auth[_0x0e70('0x8')](),controller[_0x0e70('0x11')]);module[_0x0e70('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index a42f8e2..493392e 100644 --- a/server/api/faxTransferReport/faxTransferReport.attributes.js +++ b/server/api/faxTransferReport/faxTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x25ebd7,_0x156add){var _0x19bc7e=function(_0x147ce1){while(--_0x147ce1){_0x25ebd7['push'](_0x25ebd7['shift']());}};_0x19bc7e(++_0x156add);}(_0xaa88,0x137));var _0x8aa8=function(_0xbf5e16,_0x146ce3){_0xbf5e16=_0xbf5e16-0x0;var _0x5975a5=_0xaa88[_0xbf5e16];return _0x5975a5;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file +var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x2deac4,_0xc27a2b){var _0x1c0bda=function(_0x1deceb){while(--_0x1deceb){_0x2deac4['push'](_0x2deac4['shift']());}};_0x1c0bda(++_0xc27a2b);}(_0x54ef,0x112));var _0xf54e=function(_0x8fabd1,_0x5038be){_0x8fabd1=_0x8fabd1-0x0;var _0x49b577=_0x54ef[_0x8fabd1];return _0x49b577;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index b36daea..17f21e2 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 _0x5fb0=['catch','show','length','includeAll','find','create','body','params','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','map','FaxTransferReport','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filters','where','merge','VIRTUAL','filter','options','rows'];(function(_0x19a293,_0x1d55b0){var _0x1ae8d6=function(_0x493696){while(--_0x493696){_0x19a293['push'](_0x19a293['shift']());}};_0x1ae8d6(++_0x1d55b0);}(_0x5fb0,0x1cc));var _0x05fb=function(_0x332195,_0x55907d){_0x332195=_0x332195-0x0;var _0x19996d=_0x5fb0[_0x332195];return _0x19996d;};'use strict';var emlformat=require(_0x05fb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x05fb('0x1'));var jsonpatch=require(_0x05fb('0x2'));var rp=require(_0x05fb('0x3'));var moment=require(_0x05fb('0x4'));var BPromise=require(_0x05fb('0x5'));var Mustache=require('mustache');var util=require(_0x05fb('0x6'));var path=require(_0x05fb('0x7'));var sox=require(_0x05fb('0x8'));var csv=require(_0x05fb('0x9'));var ejs=require(_0x05fb('0xa'));var fs=require('fs');var fs_extra=require(_0x05fb('0xb'));var _=require(_0x05fb('0xc'));var squel=require('squel');var crypto=require(_0x05fb('0xd'));var jsforce=require(_0x05fb('0xe'));var deskjs=require(_0x05fb('0xf'));var toCsv=require(_0x05fb('0x9'));var querystring=require(_0x05fb('0x10'));var Papa=require(_0x05fb('0x11'));var Redis=require(_0x05fb('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x05fb('0x13'));var as=require(_0x05fb('0x14'));var hardwareService=require(_0x05fb('0x15'));var logger=require(_0x05fb('0x16'))(_0x05fb('0x17'));var utils=require(_0x05fb('0x18'));var config=require(_0x05fb('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x448723,_0x432dca){_0x432dca=_0x432dca||0xcc;return function(_0x256933){if(_0x256933){return _0x448723[_0x05fb('0x1a')](_0x432dca);}return _0x448723[_0x05fb('0x1b')](_0x432dca)[_0x05fb('0x1c')]();};}function respondWithResult(_0x533de2,_0x1b2644){_0x1b2644=_0x1b2644||0xc8;return function(_0x10a4e3){if(_0x10a4e3){return _0x533de2[_0x05fb('0x1b')](_0x1b2644)[_0x05fb('0x1d')](_0x10a4e3);}};}function respondWithFilteredResult(_0xb9b5e7,_0x256eee){return function(_0x1552a7){if(_0x1552a7){var _0x232e82=typeof _0x256eee['offset']==='undefined'&&typeof _0x256eee[_0x05fb('0x1e')]==='undefined';var _0x49aa20=_0x1552a7[_0x05fb('0x1f')];var _0x57966e=_0x232e82?0x0:_0x256eee[_0x05fb('0x20')];var _0xf3f9ae=_0x232e82?_0x1552a7[_0x05fb('0x1f')]:_0x256eee[_0x05fb('0x20')]+_0x256eee[_0x05fb('0x1e')];var _0xb28472;if(_0xf3f9ae>=_0x49aa20){_0xf3f9ae=_0x49aa20;_0xb28472=0xc8;}else{_0xb28472=0xce;}_0xb9b5e7[_0x05fb('0x1b')](_0xb28472);return _0xb9b5e7[_0x05fb('0x21')](_0x05fb('0x22'),_0x57966e+'-'+_0xf3f9ae+'/'+_0x49aa20)[_0x05fb('0x1d')](_0x1552a7);}return null;};}function patchUpdates(_0x540932){return function(_0xe0cc4f){try{jsonpatch[_0x05fb('0x23')](_0xe0cc4f,_0x540932,!![]);}catch(_0x46d55c){return BPromise[_0x05fb('0x24')](_0x46d55c);}return _0xe0cc4f[_0x05fb('0x25')]();};}function saveUpdates(_0x3e5fd1,_0x59f87d){return function(_0x1de75d){if(_0x1de75d){return _0x1de75d[_0x05fb('0x26')](_0x3e5fd1)['then'](function(_0x36e079){return _0x36e079;});}return null;};}function removeEntity(_0x1b88f5,_0x3e6b88){return function(_0x5a40d1){if(_0x5a40d1){return _0x5a40d1['destroy']()[_0x05fb('0x27')](function(){_0x1b88f5[_0x05fb('0x1b')](0xcc)[_0x05fb('0x1c')]();});}};}function handleEntityNotFound(_0x36c79d,_0xc599d6){return function(_0xfb0dfd){if(!_0xfb0dfd){_0x36c79d[_0x05fb('0x1a')](0x194);}return _0xfb0dfd;};}function handleError(_0x47b0a9,_0x14da24){_0x14da24=_0x14da24||0x1f4;return function(_0x232aa7){logger[_0x05fb('0x28')](_0x232aa7[_0x05fb('0x29')]);if(_0x232aa7[_0x05fb('0x2a')]){delete _0x232aa7['name'];}_0x47b0a9[_0x05fb('0x1b')](_0x14da24)['send'](_0x232aa7);};}exports[_0x05fb('0x2b')]=function(_0x15d795,_0x27b6c6){var _0x44daba={},_0xd28742={},_0x520323={'count':0x0,'rows':[]};var _0x143555=_[_0x05fb('0x2c')](db[_0x05fb('0x2d')][_0x05fb('0x2e')],function(_0x1a0f86){return{'name':_0x1a0f86[_0x05fb('0x2f')],'type':_0x1a0f86[_0x05fb('0x30')]['key']};});_0xd28742[_0x05fb('0x31')]=_[_0x05fb('0x2c')](_0x143555,_0x05fb('0x2a'));_0xd28742[_0x05fb('0x32')]=_[_0x05fb('0x33')](_0x15d795['query']);_0xd28742['filters']=_[_0x05fb('0x34')](_0xd28742[_0x05fb('0x31')],_0xd28742[_0x05fb('0x32')]);_0x44daba[_0x05fb('0x35')]=_[_0x05fb('0x34')](_0xd28742['model'],qs[_0x05fb('0x36')](_0x15d795[_0x05fb('0x32')][_0x05fb('0x36')]));_0x44daba[_0x05fb('0x35')]=_0x44daba[_0x05fb('0x35')]['length']?_0x44daba[_0x05fb('0x35')]:_0xd28742[_0x05fb('0x31')];if(!_0x15d795[_0x05fb('0x32')][_0x05fb('0x37')](_0x05fb('0x38'))){_0x44daba[_0x05fb('0x1e')]=qs[_0x05fb('0x1e')](_0x15d795[_0x05fb('0x32')][_0x05fb('0x1e')]);_0x44daba[_0x05fb('0x20')]=qs[_0x05fb('0x20')](_0x15d795[_0x05fb('0x32')][_0x05fb('0x20')]);}_0x44daba['order']=qs[_0x05fb('0x39')](_0x15d795[_0x05fb('0x32')][_0x05fb('0x39')]);_0x44daba['where']=qs[_0x05fb('0x3a')](_['pick'](_0x15d795[_0x05fb('0x32')],_0xd28742[_0x05fb('0x3a')]),_0x143555);if(_0x15d795[_0x05fb('0x32')]['filter']){_0x44daba[_0x05fb('0x3b')]=_[_0x05fb('0x3c')](_0x44daba[_0x05fb('0x3b')],{'$or':_['map'](_0x143555,function(_0x903f13){if(_0x903f13[_0x05fb('0x30')]!==_0x05fb('0x3d')){var _0x3f9bc0={};_0x3f9bc0[_0x903f13['name']]={'$like':'%'+_0x15d795['query'][_0x05fb('0x3e')]+'%'};return _0x3f9bc0;}})});}_0x44daba=_[_0x05fb('0x3c')]({},_0x44daba,_0x15d795[_0x05fb('0x3f')]);var _0x49f571={'where':_0x44daba['where']};return db[_0x05fb('0x2d')][_0x05fb('0x1f')](_0x49f571)[_0x05fb('0x27')](function(_0x34888e){_0x520323[_0x05fb('0x1f')]=_0x34888e;if(_0x15d795[_0x05fb('0x32')]['includeAll']){_0x44daba['include']=[{'all':!![]}];}return db[_0x05fb('0x2d')]['findAll'](_0x44daba);})['then'](function(_0x343ab3){_0x520323[_0x05fb('0x40')]=_0x343ab3;return _0x520323;})['then'](respondWithFilteredResult(_0x27b6c6,_0x44daba))[_0x05fb('0x41')](handleError(_0x27b6c6,null));};exports[_0x05fb('0x42')]=function(_0x2c4d9f,_0x3edb62){var _0x37e632={'raw':!![],'where':{'id':_0x2c4d9f['params']['id']}},_0x11d393={};_0x11d393[_0x05fb('0x31')]=_[_0x05fb('0x33')](db[_0x05fb('0x2d')][_0x05fb('0x2e')]);_0x11d393[_0x05fb('0x32')]=_[_0x05fb('0x33')](_0x2c4d9f[_0x05fb('0x32')]);_0x11d393[_0x05fb('0x3a')]=_[_0x05fb('0x34')](_0x11d393[_0x05fb('0x31')],_0x11d393[_0x05fb('0x32')]);_0x37e632[_0x05fb('0x35')]=_['intersection'](_0x11d393['model'],qs['fields'](_0x2c4d9f[_0x05fb('0x32')][_0x05fb('0x36')]));_0x37e632[_0x05fb('0x35')]=_0x37e632[_0x05fb('0x35')][_0x05fb('0x43')]?_0x37e632[_0x05fb('0x35')]:_0x11d393[_0x05fb('0x31')];if(_0x2c4d9f['query'][_0x05fb('0x44')]){_0x37e632['include']=[{'all':!![]}];}_0x37e632=_['merge']({},_0x37e632,_0x2c4d9f['options']);return db[_0x05fb('0x2d')][_0x05fb('0x45')](_0x37e632)['then'](handleEntityNotFound(_0x3edb62,null))[_0x05fb('0x27')](respondWithResult(_0x3edb62,null))[_0x05fb('0x41')](handleError(_0x3edb62,null));};exports[_0x05fb('0x46')]=function(_0x4f8212,_0x3dba01){return db['FaxTransferReport']['create'](_0x4f8212['body'],{})[_0x05fb('0x27')](respondWithResult(_0x3dba01,0xc9))[_0x05fb('0x41')](handleError(_0x3dba01,null));};exports[_0x05fb('0x26')]=function(_0x50dceb,_0x27226c){if(_0x50dceb[_0x05fb('0x47')]['id']){delete _0x50dceb['body']['id'];}return db[_0x05fb('0x2d')][_0x05fb('0x45')]({'where':{'id':_0x50dceb[_0x05fb('0x48')]['id']}})[_0x05fb('0x27')](handleEntityNotFound(_0x27226c,null))[_0x05fb('0x27')](saveUpdates(_0x50dceb['body'],null))['then'](respondWithResult(_0x27226c,null))[_0x05fb('0x41')](handleError(_0x27226c,null));};exports[_0x05fb('0x49')]=function(_0x439fe1,_0x1df22f){return db[_0x05fb('0x2d')][_0x05fb('0x45')]({'where':{'id':_0x439fe1[_0x05fb('0x48')]['id']}})['then'](handleEntityNotFound(_0x1df22f,null))['then'](removeEntity(_0x1df22f,null))[_0x05fb('0x41')](handleError(_0x1df22f,null));};exports['describe']=function(_0x441a4f,_0x33634e){return db[_0x05fb('0x2d')][_0x05fb('0x4a')]()['then'](respondWithResult(_0x33634e,null))[_0x05fb('0x41')](handleError(_0x33634e,null));}; \ No newline at end of file +var _0x8721=['destroy','stack','name','index','map','FaxTransferReport','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','options','includeAll','findAll','catch','show','params','rawAttributes','find','create','body','describe','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','save','update','then'];(function(_0x314e0a,_0x189b9c){var _0x20dbef=function(_0x4d3f1e){while(--_0x4d3f1e){_0x314e0a['push'](_0x314e0a['shift']());}};_0x20dbef(++_0x189b9c);}(_0x8721,0x143));var _0x1872=function(_0x52085a,_0x3717ca){_0x52085a=_0x52085a-0x0;var _0x5afc1a=_0x8721[_0x52085a];return _0x5afc1a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1872('0x0'));var zipdir=require(_0x1872('0x1'));var jsonpatch=require(_0x1872('0x2'));var rp=require('request-promise');var moment=require(_0x1872('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1872('0x4'));var util=require('util');var path=require(_0x1872('0x5'));var sox=require(_0x1872('0x6'));var csv=require('to-csv');var ejs=require(_0x1872('0x7'));var fs=require('fs');var fs_extra=require(_0x1872('0x8'));var _=require(_0x1872('0x9'));var squel=require(_0x1872('0xa'));var crypto=require(_0x1872('0xb'));var jsforce=require(_0x1872('0xc'));var deskjs=require(_0x1872('0xd'));var toCsv=require(_0x1872('0xe'));var querystring=require(_0x1872('0xf'));var Papa=require(_0x1872('0x10'));var Redis=require(_0x1872('0x11'));var authService=require(_0x1872('0x12'));var qs=require(_0x1872('0x13'));var as=require(_0x1872('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1872('0x15'));var utils=require(_0x1872('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x1872('0x17'));var db=require(_0x1872('0x18'))['db'];function respondWithStatusCode(_0x1aed7b,_0x408b93){_0x408b93=_0x408b93||0xcc;return function(_0x5a3513){if(_0x5a3513){return _0x1aed7b[_0x1872('0x19')](_0x408b93);}return _0x1aed7b['status'](_0x408b93)[_0x1872('0x1a')]();};}function respondWithResult(_0x4717bb,_0x3d53d2){_0x3d53d2=_0x3d53d2||0xc8;return function(_0x4b6d7c){if(_0x4b6d7c){return _0x4717bb[_0x1872('0x1b')](_0x3d53d2)['json'](_0x4b6d7c);}};}function respondWithFilteredResult(_0x272e10,_0x339679){return function(_0x5b99de){if(_0x5b99de){var _0x3d9d08=typeof _0x339679[_0x1872('0x1c')]===_0x1872('0x1d')&&typeof _0x339679['limit']===_0x1872('0x1d');var _0x314ece=_0x5b99de[_0x1872('0x1e')];var _0x297a59=_0x3d9d08?0x0:_0x339679['offset'];var _0x2190ad=_0x3d9d08?_0x5b99de[_0x1872('0x1e')]:_0x339679[_0x1872('0x1c')]+_0x339679[_0x1872('0x1f')];var _0x6bca12;if(_0x2190ad>=_0x314ece){_0x2190ad=_0x314ece;_0x6bca12=0xc8;}else{_0x6bca12=0xce;}_0x272e10[_0x1872('0x1b')](_0x6bca12);return _0x272e10[_0x1872('0x20')](_0x1872('0x21'),_0x297a59+'-'+_0x2190ad+'/'+_0x314ece)['json'](_0x5b99de);}return null;};}function patchUpdates(_0x5ee151){return function(_0x4e8cae){try{jsonpatch['apply'](_0x4e8cae,_0x5ee151,!![]);}catch(_0x238ad1){return BPromise['reject'](_0x238ad1);}return _0x4e8cae[_0x1872('0x22')]();};}function saveUpdates(_0x82575e,_0x278e43){return function(_0x380cd1){if(_0x380cd1){return _0x380cd1[_0x1872('0x23')](_0x82575e)[_0x1872('0x24')](function(_0x542e10){return _0x542e10;});}return null;};}function removeEntity(_0x5a2a4c,_0x52399a){return function(_0x25f72){if(_0x25f72){return _0x25f72[_0x1872('0x25')]()[_0x1872('0x24')](function(){_0x5a2a4c[_0x1872('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x364841,_0x438a83){return function(_0x43a8dc){if(!_0x43a8dc){_0x364841[_0x1872('0x19')](0x194);}return _0x43a8dc;};}function handleError(_0x2fb028,_0x560ced){_0x560ced=_0x560ced||0x1f4;return function(_0x5d257a){logger['error'](_0x5d257a[_0x1872('0x26')]);if(_0x5d257a[_0x1872('0x27')]){delete _0x5d257a[_0x1872('0x27')];}_0x2fb028[_0x1872('0x1b')](_0x560ced)['send'](_0x5d257a);};}exports[_0x1872('0x28')]=function(_0x15fb22,_0x347729){var _0x1d6ca7={},_0x44a2f5={},_0x345aec={'count':0x0,'rows':[]};var _0x529f8b=_[_0x1872('0x29')](db[_0x1872('0x2a')]['rawAttributes'],function(_0x3d908c){return{'name':_0x3d908c[_0x1872('0x2b')],'type':_0x3d908c[_0x1872('0x2c')][_0x1872('0x2d')]};});_0x44a2f5[_0x1872('0x2e')]=_['map'](_0x529f8b,_0x1872('0x27'));_0x44a2f5[_0x1872('0x2f')]=_[_0x1872('0x30')](_0x15fb22[_0x1872('0x2f')]);_0x44a2f5[_0x1872('0x31')]=_[_0x1872('0x32')](_0x44a2f5[_0x1872('0x2e')],_0x44a2f5[_0x1872('0x2f')]);_0x1d6ca7['attributes']=_['intersection'](_0x44a2f5[_0x1872('0x2e')],qs[_0x1872('0x33')](_0x15fb22[_0x1872('0x2f')]['fields']));_0x1d6ca7['attributes']=_0x1d6ca7[_0x1872('0x34')][_0x1872('0x35')]?_0x1d6ca7['attributes']:_0x44a2f5[_0x1872('0x2e')];if(!_0x15fb22[_0x1872('0x2f')][_0x1872('0x36')](_0x1872('0x37'))){_0x1d6ca7[_0x1872('0x1f')]=qs[_0x1872('0x1f')](_0x15fb22[_0x1872('0x2f')][_0x1872('0x1f')]);_0x1d6ca7[_0x1872('0x1c')]=qs[_0x1872('0x1c')](_0x15fb22['query'][_0x1872('0x1c')]);}_0x1d6ca7['order']=qs[_0x1872('0x38')](_0x15fb22[_0x1872('0x2f')][_0x1872('0x38')]);_0x1d6ca7['where']=qs['filters'](_[_0x1872('0x39')](_0x15fb22[_0x1872('0x2f')],_0x44a2f5['filters']),_0x529f8b);if(_0x15fb22['query'][_0x1872('0x3a')]){_0x1d6ca7['where']=_[_0x1872('0x3b')](_0x1d6ca7[_0x1872('0x3c')],{'$or':_[_0x1872('0x29')](_0x529f8b,function(_0x6adca3){if(_0x6adca3['type']!=='VIRTUAL'){var _0x59a4ee={};_0x59a4ee[_0x6adca3[_0x1872('0x27')]]={'$like':'%'+_0x15fb22['query'][_0x1872('0x3a')]+'%'};return _0x59a4ee;}})});}_0x1d6ca7=_[_0x1872('0x3b')]({},_0x1d6ca7,_0x15fb22[_0x1872('0x3d')]);var _0x75995f={'where':_0x1d6ca7['where']};return db[_0x1872('0x2a')][_0x1872('0x1e')](_0x75995f)[_0x1872('0x24')](function(_0x2af7a3){_0x345aec[_0x1872('0x1e')]=_0x2af7a3;if(_0x15fb22[_0x1872('0x2f')][_0x1872('0x3e')]){_0x1d6ca7['include']=[{'all':!![]}];}return db[_0x1872('0x2a')][_0x1872('0x3f')](_0x1d6ca7);})[_0x1872('0x24')](function(_0x319477){_0x345aec['rows']=_0x319477;return _0x345aec;})['then'](respondWithFilteredResult(_0x347729,_0x1d6ca7))[_0x1872('0x40')](handleError(_0x347729,null));};exports[_0x1872('0x41')]=function(_0x101670,_0x2073bd){var _0x472ad5={'raw':!![],'where':{'id':_0x101670[_0x1872('0x42')]['id']}},_0x29bc1a={};_0x29bc1a['model']=_[_0x1872('0x30')](db[_0x1872('0x2a')][_0x1872('0x43')]);_0x29bc1a[_0x1872('0x2f')]=_[_0x1872('0x30')](_0x101670[_0x1872('0x2f')]);_0x29bc1a['filters']=_[_0x1872('0x32')](_0x29bc1a[_0x1872('0x2e')],_0x29bc1a['query']);_0x472ad5[_0x1872('0x34')]=_[_0x1872('0x32')](_0x29bc1a[_0x1872('0x2e')],qs[_0x1872('0x33')](_0x101670[_0x1872('0x2f')][_0x1872('0x33')]));_0x472ad5[_0x1872('0x34')]=_0x472ad5[_0x1872('0x34')][_0x1872('0x35')]?_0x472ad5['attributes']:_0x29bc1a[_0x1872('0x2e')];if(_0x101670[_0x1872('0x2f')][_0x1872('0x3e')]){_0x472ad5['include']=[{'all':!![]}];}_0x472ad5=_[_0x1872('0x3b')]({},_0x472ad5,_0x101670['options']);return db[_0x1872('0x2a')][_0x1872('0x44')](_0x472ad5)[_0x1872('0x24')](handleEntityNotFound(_0x2073bd,null))[_0x1872('0x24')](respondWithResult(_0x2073bd,null))['catch'](handleError(_0x2073bd,null));};exports[_0x1872('0x45')]=function(_0x80cefc,_0x17e895){return db[_0x1872('0x2a')]['create'](_0x80cefc[_0x1872('0x46')],{})[_0x1872('0x24')](respondWithResult(_0x17e895,0xc9))[_0x1872('0x40')](handleError(_0x17e895,null));};exports[_0x1872('0x23')]=function(_0x2da1d8,_0x561c6b){if(_0x2da1d8['body']['id']){delete _0x2da1d8[_0x1872('0x46')]['id'];}return db['FaxTransferReport'][_0x1872('0x44')]({'where':{'id':_0x2da1d8['params']['id']}})[_0x1872('0x24')](handleEntityNotFound(_0x561c6b,null))['then'](saveUpdates(_0x2da1d8['body'],null))['then'](respondWithResult(_0x561c6b,null))[_0x1872('0x40')](handleError(_0x561c6b,null));};exports[_0x1872('0x25')]=function(_0x4638f0,_0x3faf8d){return db[_0x1872('0x2a')][_0x1872('0x44')]({'where':{'id':_0x4638f0[_0x1872('0x42')]['id']}})['then'](handleEntityNotFound(_0x3faf8d,null))[_0x1872('0x24')](removeEntity(_0x3faf8d,null))[_0x1872('0x40')](handleError(_0x3faf8d,null));};exports[_0x1872('0x47')]=function(_0x4f7b60,_0x15b12c){return db[_0x1872('0x2a')][_0x1872('0x47')]()['then'](respondWithResult(_0x15b12c,null))['catch'](handleError(_0x15b12c,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 282fcb4..4f505ef 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 _0x93cc=['uniqueid','lodash','util','moment','bluebird','request-promise','path','rimraf','define','FaxTransferReport','report_fax_transfer'];(function(_0x5a9117,_0x2df310){var _0x3e5389=function(_0xd4022c){while(--_0xd4022c){_0x5a9117['push'](_0x5a9117['shift']());}};_0x3e5389(++_0x2df310);}(_0x93cc,0x90));var _0xc93c=function(_0x396f80,_0x39f500){_0x396f80=_0x396f80-0x0;var _0x152e7f=_0x93cc[_0x396f80];return _0x152e7f;};'use strict';var _=require(_0xc93c('0x0'));var util=require(_0xc93c('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xc93c('0x2'));var BPromise=require(_0xc93c('0x3'));var rp=require(_0xc93c('0x4'));var fs=require('fs');var path=require(_0xc93c('0x5'));var rimraf=require(_0xc93c('0x6'));var config=require('../../config/environment');var attributes=require('./faxTransferReport.attributes');module['exports']=function(_0x2143da,_0x106aa9){return _0x2143da[_0xc93c('0x7')](_0xc93c('0x8'),attributes,{'tableName':_0xc93c('0x9'),'paranoid':![],'indexes':[{'name':_0xc93c('0xa'),'fields':[_0xc93c('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x72a0=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./faxTransferReport.attributes','define','FaxTransferReport','report_fax_transfer'];(function(_0x43d226,_0x898195){var _0xc3159d=function(_0x186624){while(--_0x186624){_0x43d226['push'](_0x43d226['shift']());}};_0xc3159d(++_0x898195);}(_0x72a0,0x194));var _0x072a=function(_0x407e4f,_0x151647){_0x407e4f=_0x407e4f-0x0;var _0xd7c489=_0x72a0[_0x407e4f];return _0xd7c489;};'use strict';var _=require(_0x072a('0x0'));var util=require(_0x072a('0x1'));var logger=require(_0x072a('0x2'))(_0x072a('0x3'));var moment=require(_0x072a('0x4'));var BPromise=require(_0x072a('0x5'));var rp=require(_0x072a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x072a('0x7'));var config=require('../../config/environment');var attributes=require(_0x072a('0x8'));module['exports']=function(_0x23100f,_0x597fd9){return _0x23100f[_0x072a('0x9')](_0x072a('0xa'),attributes,{'tableName':_0x072a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x072a('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index f464d36..0583920 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 _0x7ee6=['then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1356dc,_0x4d67f1){var _0x2269d5=function(_0x55a2b3){while(--_0x55a2b3){_0x1356dc['push'](_0x1356dc['shift']());}};_0x2269d5(++_0x4d67f1);}(_0x7ee6,0x1ee));var _0x67ee=function(_0x4f37e0,_0x5262f9){_0x4f37e0=_0x4f37e0-0x0;var _0xa0b1fe=_0x7ee6[_0x4f37e0];return _0xa0b1fe;};'use strict';var _=require(_0x67ee('0x0'));var util=require(_0x67ee('0x1'));var moment=require(_0x67ee('0x2'));var BPromise=require(_0x67ee('0x3'));var rs=require(_0x67ee('0x4'));var fs=require('fs');var Redis=require(_0x67ee('0x5'));var db=require(_0x67ee('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x67ee('0x7'))(_0x67ee('0x8'));var config=require(_0x67ee('0x9'));var jayson=require(_0x67ee('0xa'));var client=jayson[_0x67ee('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x177c74,_0x30b93f,_0x5dac81){return new BPromise(function(_0x434d58,_0x58da79){return client['request'](_0x177c74,_0x5dac81)[_0x67ee('0xc')](function(_0x5c75a4){logger[_0x67ee('0xd')](_0x67ee('0xe'),_0x30b93f,_0x67ee('0xf'));logger[_0x67ee('0x10')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x30b93f,_0x67ee('0xf'),JSON['stringify'](_0x5c75a4));if(_0x5c75a4[_0x67ee('0x11')]){if(_0x5c75a4['error'][_0x67ee('0x12')]===0x1f4){logger[_0x67ee('0x11')](_0x67ee('0xe'),_0x30b93f,_0x5c75a4['error'][_0x67ee('0x13')]);return _0x58da79(_0x5c75a4[_0x67ee('0x11')][_0x67ee('0x13')]);}logger[_0x67ee('0x11')]('FaxTransferReport,\x20%s,\x20%s',_0x30b93f,_0x5c75a4[_0x67ee('0x11')][_0x67ee('0x13')]);return _0x434d58(_0x5c75a4[_0x67ee('0x11')]['message']);}else{logger[_0x67ee('0xd')](_0x67ee('0xe'),_0x30b93f,_0x67ee('0xf'));_0x434d58(_0x5c75a4[_0x67ee('0x14')]['message']);}})[_0x67ee('0x15')](function(_0x4dc8f8){logger[_0x67ee('0x11')](_0x67ee('0xe'),_0x30b93f,_0x4dc8f8);_0x58da79(_0x4dc8f8);});});} \ No newline at end of file +var _0x40aa=['message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x32ab87,_0x5803d0){var _0x5ae2b0=function(_0x3af5d3){while(--_0x3af5d3){_0x32ab87['push'](_0x32ab87['shift']());}};_0x5ae2b0(++_0x5803d0);}(_0x40aa,0x7b));var _0xa40a=function(_0x8b6f3,_0x94c494){_0x8b6f3=_0x8b6f3-0x0;var _0x38d34d=_0x40aa[_0x8b6f3];return _0x38d34d;};'use strict';var _=require(_0xa40a('0x0'));var util=require(_0xa40a('0x1'));var moment=require(_0xa40a('0x2'));var BPromise=require(_0xa40a('0x3'));var rs=require(_0xa40a('0x4'));var fs=require('fs');var Redis=require(_0xa40a('0x5'));var db=require(_0xa40a('0x6'))['db'];var utils=require(_0xa40a('0x7'));var logger=require(_0xa40a('0x8'))('rpc');var config=require(_0xa40a('0x9'));var jayson=require(_0xa40a('0xa'));var client=jayson[_0xa40a('0xb')][_0xa40a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x24287e,_0xcea09f,_0x344ad4){return new BPromise(function(_0x2fab90,_0x2a11e5){return client[_0xa40a('0xd')](_0x24287e,_0x344ad4)[_0xa40a('0xe')](function(_0x27f326){logger['info'](_0xa40a('0xf'),_0xcea09f,_0xa40a('0x10'));logger[_0xa40a('0x11')](_0xa40a('0x12'),_0xcea09f,_0xa40a('0x10'),JSON['stringify'](_0x27f326));if(_0x27f326[_0xa40a('0x13')]){if(_0x27f326[_0xa40a('0x13')][_0xa40a('0x14')]===0x1f4){logger[_0xa40a('0x13')](_0xa40a('0xf'),_0xcea09f,_0x27f326[_0xa40a('0x13')][_0xa40a('0x15')]);return _0x2a11e5(_0x27f326[_0xa40a('0x13')][_0xa40a('0x15')]);}logger[_0xa40a('0x13')](_0xa40a('0xf'),_0xcea09f,_0x27f326[_0xa40a('0x13')][_0xa40a('0x15')]);return _0x2fab90(_0x27f326[_0xa40a('0x13')][_0xa40a('0x15')]);}else{logger[_0xa40a('0x16')](_0xa40a('0xf'),_0xcea09f,_0xa40a('0x10'));_0x2fab90(_0x27f326[_0xa40a('0x17')][_0xa40a('0x15')]);}})['catch'](function(_0x14e383){logger['error'](_0xa40a('0xf'),_0xcea09f,_0x14e383);_0x2a11e5(_0x14e383);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 7f261f2..38f9a33 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 _0xa3d4=['show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xa3d4,0xa8));var _0x4a3d=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0xa3d4[_0x13b02f];return _0x12e9a6;};'use strict';var multer=require(_0x4a3d('0x0'));var util=require(_0x4a3d('0x1'));var path=require(_0x4a3d('0x2'));var timeout=require(_0x4a3d('0x3'));var express=require(_0x4a3d('0x4'));var router=express[_0x4a3d('0x5')]();var fs_extra=require(_0x4a3d('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x4a3d('0x7'));var config=require(_0x4a3d('0x8'));var controller=require(_0x4a3d('0x9'));router['get']('/',auth[_0x4a3d('0xa')](),controller[_0x4a3d('0xb')]);router[_0x4a3d('0xc')](_0x4a3d('0xd'),auth[_0x4a3d('0xa')](),controller[_0x4a3d('0xe')]);router[_0x4a3d('0xc')](_0x4a3d('0xf'),auth[_0x4a3d('0xa')](),controller[_0x4a3d('0x10')]);router[_0x4a3d('0x11')]('/',auth[_0x4a3d('0xa')](),controller[_0x4a3d('0x12')]);router[_0x4a3d('0x13')](_0x4a3d('0xf'),auth[_0x4a3d('0xa')](),controller[_0x4a3d('0x14')]);router[_0x4a3d('0x15')](_0x4a3d('0xf'),auth[_0x4a3d('0xa')](),controller['destroy']);module[_0x4a3d('0x16')]=router; \ No newline at end of file +var _0xc905=['./faxTransferReport.controller','isAuthenticated','index','get','describe','/:id','show','post','create','update','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x331e13,_0x124809){var _0x2e7034=function(_0x55e94c){while(--_0x55e94c){_0x331e13['push'](_0x331e13['shift']());}};_0x2e7034(++_0x124809);}(_0xc905,0x1c1));var _0x5c90=function(_0x1dd5d9,_0x1ef658){_0x1dd5d9=_0x1dd5d9-0x0;var _0x2e8fc1=_0xc905[_0x1dd5d9];return _0x2e8fc1;};'use strict';var multer=require(_0x5c90('0x0'));var util=require(_0x5c90('0x1'));var path=require(_0x5c90('0x2'));var timeout=require(_0x5c90('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5c90('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5c90('0x5'));var config=require(_0x5c90('0x6'));var controller=require(_0x5c90('0x7'));router['get']('/',auth[_0x5c90('0x8')](),controller[_0x5c90('0x9')]);router[_0x5c90('0xa')]('/describe',auth[_0x5c90('0x8')](),controller[_0x5c90('0xb')]);router[_0x5c90('0xa')](_0x5c90('0xc'),auth['isAuthenticated'](),controller[_0x5c90('0xd')]);router[_0x5c90('0xe')]('/',auth[_0x5c90('0x8')](),controller[_0x5c90('0xf')]);router['put'](_0x5c90('0xc'),auth[_0x5c90('0x8')](),controller[_0x5c90('0x10')]);router['delete'](_0x5c90('0xc'),auth[_0x5c90('0x8')](),controller[_0x5c90('0x11')]);module[_0x5c90('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 5b502f2..f58c720 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 _0xc5f7=['/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','delete','destroy','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index'];(function(_0x845277,_0x5c6369){var _0x35ac29=function(_0x409ced){while(--_0x409ced){_0x845277['push'](_0x845277['shift']());}};_0x35ac29(++_0x5c6369);}(_0xc5f7,0x184));var _0x7c5f=function(_0x5ef9da,_0x1a751f){_0x5ef9da=_0x5ef9da-0x0;var _0xb6249=_0xc5f7[_0x5ef9da];return _0xb6249;};'use strict';var multer=require('multer');var util=require(_0x7c5f('0x0'));var path=require(_0x7c5f('0x1'));var timeout=require(_0x7c5f('0x2'));var express=require('express');var router=express[_0x7c5f('0x3')]();var fs_extra=require(_0x7c5f('0x4'));var auth=require(_0x7c5f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7c5f('0x6'));var controller=require(_0x7c5f('0x7'));router[_0x7c5f('0x8')]('/',auth[_0x7c5f('0x9')](),controller[_0x7c5f('0xa')]);router['get'](_0x7c5f('0xb'),auth[_0x7c5f('0x9')](),controller[_0x7c5f('0xc')]);router[_0x7c5f('0x8')](_0x7c5f('0xd'),auth[_0x7c5f('0x9')](),controller[_0x7c5f('0xe')]);router['get'](_0x7c5f('0xf'),auth[_0x7c5f('0x9')](),controller[_0x7c5f('0x10')]);router[_0x7c5f('0x11')]('/',auth[_0x7c5f('0x9')](),controller['create']);router[_0x7c5f('0x11')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x7c5f('0x12')]);router['put'](_0x7c5f('0xb'),auth[_0x7c5f('0x9')](),controller['update']);router[_0x7c5f('0x13')](_0x7c5f('0xb'),auth[_0x7c5f('0x9')](),controller[_0x7c5f('0x14')]);module['exports']=router; \ No newline at end of file +var _0xf9b0=['getFields','post','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations'];(function(_0x256d6a,_0x2f002f){var _0x460058=function(_0x195be7){while(--_0x195be7){_0x256d6a['push'](_0x256d6a['shift']());}};_0x460058(++_0x2f002f);}(_0xf9b0,0x1e8));var _0x0f9b=function(_0x6e0ac3,_0xb0ad99){_0x6e0ac3=_0x6e0ac3-0x0;var _0x381be3=_0xf9b0[_0x6e0ac3];return _0x381be3;};'use strict';var multer=require(_0x0f9b('0x0'));var util=require(_0x0f9b('0x1'));var path=require(_0x0f9b('0x2'));var timeout=require(_0x0f9b('0x3'));var express=require(_0x0f9b('0x4'));var router=express['Router']();var fs_extra=require(_0x0f9b('0x5'));var auth=require(_0x0f9b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0f9b('0x7'));var controller=require(_0x0f9b('0x8'));router[_0x0f9b('0x9')]('/',auth[_0x0f9b('0xa')](),controller[_0x0f9b('0xb')]);router[_0x0f9b('0x9')](_0x0f9b('0xc'),auth[_0x0f9b('0xa')](),controller[_0x0f9b('0xd')]);router[_0x0f9b('0x9')](_0x0f9b('0xe'),auth[_0x0f9b('0xa')](),controller[_0x0f9b('0xf')]);router[_0x0f9b('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0x0f9b('0x10')]);router['post']('/',auth[_0x0f9b('0xa')](),controller['create']);router[_0x0f9b('0x11')](_0x0f9b('0xe'),auth['isAuthenticated'](),controller[_0x0f9b('0x12')]);router[_0x0f9b('0x13')](_0x0f9b('0xc'),auth['isAuthenticated'](),controller[_0x0f9b('0x14')]);router[_0x0f9b('0x15')](_0x0f9b('0xc'),auth[_0x0f9b('0xa')](),controller[_0x0f9b('0x16')]);module[_0x0f9b('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 9541fa4..73b5e27 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 _0x0c9f=['integrationTab','newTab','sequelize','STRING','ENUM','basic'];(function(_0x1a4cac,_0x116f47){var _0x142f2f=function(_0x4a1e47){while(--_0x4a1e47){_0x1a4cac['push'](_0x1a4cac['shift']());}};_0x142f2f(++_0x116f47);}(_0x0c9f,0x1e2));var _0xf0c9=function(_0x41102c,_0xa68f06){_0x41102c=_0x41102c-0x0;var _0x1b7cd4=_0x0c9f[_0x41102c];return _0x1b7cd4;};'use strict';var Sequelize=require(_0xf0c9('0x0'));module['exports']={'name':{'type':Sequelize[_0xf0c9('0x1')]},'description':{'type':Sequelize[_0xf0c9('0x1')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xf0c9('0x1')]},'authType':{'type':Sequelize[_0xf0c9('0x2')](_0xf0c9('0x3')),'defaultValue':_0xf0c9('0x3')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0xf0c9('0x1')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xf0c9('0x1')]},'tokenSecret':{'type':Sequelize[_0xf0c9('0x1')]},'serverUrl':{'type':Sequelize[_0xf0c9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xf0c9('0x2')](_0xf0c9('0x4'),_0xf0c9('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x0a48=['basic','newTab','integrationTab','exports','STRING','ENUM'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x0a48,0x19b));var _0x80a4=function(_0x514989,_0x2437bb){_0x514989=_0x514989-0x0;var _0x132218=_0x0a48[_0x514989];return _0x132218;};'use strict';var Sequelize=require('sequelize');module[_0x80a4('0x0')]={'name':{'type':Sequelize[_0x80a4('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x80a4('0x1')]},'remoteUri':{'type':Sequelize[_0x80a4('0x1')]},'authType':{'type':Sequelize[_0x80a4('0x2')](_0x80a4('0x3')),'defaultValue':_0x80a4('0x3')},'password':{'type':Sequelize[_0x80a4('0x1')]},'consumerKey':{'type':Sequelize[_0x80a4('0x1')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x80a4('0x1')]},'tokenSecret':{'type':Sequelize[_0x80a4('0x1')]},'serverUrl':{'type':Sequelize[_0x80a4('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('integrationTab',_0x80a4('0x4')),'defaultValue':_0x80a4('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 525279d..8413ed4 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 _0x1562=['../../config/environment','../../config/license/util','../../components/integrations/configuration','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','sendStatus','error','stack','name','send','map','DeskAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','find','create','body','getConfigurations','DeskConfiguration','filter','hasOwnProperty','AccountId','Subjects','getSubjects','channel','getDescriptions','DeskField','Descriptions','getFields','priority','findOne','remoteUri','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','slice','substring','lastIndexOf','GET','format','application/json','basic','Authorization','Basic\x20%s','toString','base64','concat','entries','label','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','eml-format','rimraf','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','../../config/logger','api'];(function(_0x354ea0,_0x7f05d5){var _0x585c27=function(_0x55cd65){while(--_0x55cd65){_0x354ea0['push'](_0x354ea0['shift']());}};_0x585c27(++_0x7f05d5);}(_0x1562,0xcf));var _0x2156=function(_0x35b18a,_0x6b2fbe){_0x35b18a=_0x35b18a-0x0;var _0x4db1bd=_0x1562[_0x35b18a];return _0x4db1bd;};'use strict';var emlformat=require(_0x2156('0x0'));var rimraf=require(_0x2156('0x1'));var zipdir=require(_0x2156('0x2'));var jsonpatch=require(_0x2156('0x3'));var rp=require(_0x2156('0x4'));var moment=require(_0x2156('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2156('0x6'));var util=require(_0x2156('0x7'));var path=require(_0x2156('0x8'));var sox=require('sox');var csv=require(_0x2156('0x9'));var ejs=require(_0x2156('0xa'));var fs=require('fs');var fs_extra=require(_0x2156('0xb'));var _=require(_0x2156('0xc'));var squel=require(_0x2156('0xd'));var crypto=require(_0x2156('0xe'));var jsforce=require(_0x2156('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2156('0x10'));var Papa=require(_0x2156('0x11'));var Redis=require(_0x2156('0x12'));var authService=require(_0x2156('0x13'));var qs=require(_0x2156('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2156('0x15'))(_0x2156('0x16'));var utils=require('../../config/utils');var config=require(_0x2156('0x17'));var licenseUtil=require(_0x2156('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0x2156('0x19'));function respondWithStatusCode(_0x117657,_0x5599b5){_0x5599b5=_0x5599b5||0xcc;return function(_0x1ff6ee){if(_0x1ff6ee){return _0x117657['sendStatus'](_0x5599b5);}return _0x117657['status'](_0x5599b5)[_0x2156('0x1a')]();};}function respondWithResult(_0x519f49,_0x9794f6){_0x9794f6=_0x9794f6||0xc8;return function(_0x1b3e9e){if(_0x1b3e9e){return _0x519f49[_0x2156('0x1b')](_0x9794f6)['json'](_0x1b3e9e);}};}function respondWithFilteredResult(_0x3a3df7,_0xde01ea){return function(_0x2ab488){if(_0x2ab488){var _0x738b2b=typeof _0xde01ea[_0x2156('0x1c')]===_0x2156('0x1d')&&typeof _0xde01ea[_0x2156('0x1e')]===_0x2156('0x1d');var _0x250cb5=_0x2ab488['count'];var _0x55c28b=_0x738b2b?0x0:_0xde01ea['offset'];var _0x44dc70=_0x738b2b?_0x2ab488[_0x2156('0x1f')]:_0xde01ea[_0x2156('0x1c')]+_0xde01ea[_0x2156('0x1e')];var _0xa49871;if(_0x44dc70>=_0x250cb5){_0x44dc70=_0x250cb5;_0xa49871=0xc8;}else{_0xa49871=0xce;}_0x3a3df7[_0x2156('0x1b')](_0xa49871);return _0x3a3df7[_0x2156('0x20')](_0x2156('0x21'),_0x55c28b+'-'+_0x44dc70+'/'+_0x250cb5)[_0x2156('0x22')](_0x2ab488);}return null;};}function patchUpdates(_0x330337){return function(_0x29bd73){try{jsonpatch[_0x2156('0x23')](_0x29bd73,_0x330337,!![]);}catch(_0x237a7c){return BPromise[_0x2156('0x24')](_0x237a7c);}return _0x29bd73['save']();};}function saveUpdates(_0x29c2db,_0x7daa0a){return function(_0x4b168f){if(_0x4b168f){return _0x4b168f[_0x2156('0x25')](_0x29c2db)[_0x2156('0x26')](function(_0x47d88c){return _0x47d88c;});}return null;};}function removeEntity(_0xb13777,_0x74cd65){return function(_0x5d28a3){if(_0x5d28a3){return _0x5d28a3['destroy']()[_0x2156('0x26')](function(){_0xb13777[_0x2156('0x1b')](0xcc)[_0x2156('0x1a')]();});}};}function handleEntityNotFound(_0x49505e,_0x57520d){return function(_0x3ac59e){if(!_0x3ac59e){_0x49505e[_0x2156('0x27')](0x194);}return _0x3ac59e;};}function handleError(_0x4f30ea,_0x1dd120){_0x1dd120=_0x1dd120||0x1f4;return function(_0x3021f9){logger[_0x2156('0x28')](_0x3021f9[_0x2156('0x29')]);if(_0x3021f9['name']){delete _0x3021f9[_0x2156('0x2a')];}_0x4f30ea[_0x2156('0x1b')](_0x1dd120)[_0x2156('0x2b')](_0x3021f9);};}exports['index']=function(_0x298ba8,_0x23ab11){var _0x29d8f9={},_0x35bfb1={},_0x31ba97={'count':0x0,'rows':[]};var _0x4e5b64=_[_0x2156('0x2c')](db[_0x2156('0x2d')][_0x2156('0x2e')],function(_0x2f8451){return{'name':_0x2f8451[_0x2156('0x2f')],'type':_0x2f8451[_0x2156('0x30')][_0x2156('0x31')]};});_0x35bfb1[_0x2156('0x32')]=_[_0x2156('0x2c')](_0x4e5b64,_0x2156('0x2a'));_0x35bfb1[_0x2156('0x33')]=_['keys'](_0x298ba8[_0x2156('0x33')]);_0x35bfb1[_0x2156('0x34')]=_[_0x2156('0x35')](_0x35bfb1['model'],_0x35bfb1[_0x2156('0x33')]);_0x29d8f9[_0x2156('0x36')]=_[_0x2156('0x35')](_0x35bfb1[_0x2156('0x32')],qs[_0x2156('0x37')](_0x298ba8[_0x2156('0x33')]['fields']));_0x29d8f9[_0x2156('0x36')]=_0x29d8f9[_0x2156('0x36')][_0x2156('0x38')]?_0x29d8f9[_0x2156('0x36')]:_0x35bfb1[_0x2156('0x32')];if(!_0x298ba8[_0x2156('0x33')]['hasOwnProperty'](_0x2156('0x39'))){_0x29d8f9[_0x2156('0x1e')]=qs[_0x2156('0x1e')](_0x298ba8[_0x2156('0x33')][_0x2156('0x1e')]);_0x29d8f9[_0x2156('0x1c')]=qs[_0x2156('0x1c')](_0x298ba8[_0x2156('0x33')][_0x2156('0x1c')]);}_0x29d8f9[_0x2156('0x3a')]=qs[_0x2156('0x3b')](_0x298ba8['query']['sort']);_0x29d8f9[_0x2156('0x3c')]=qs[_0x2156('0x34')](_[_0x2156('0x3d')](_0x298ba8['query'],_0x35bfb1['filters']),_0x4e5b64);if(_0x298ba8[_0x2156('0x33')]['filter']){_0x29d8f9['where']=_[_0x2156('0x3e')](_0x29d8f9[_0x2156('0x3c')],{'$or':_[_0x2156('0x2c')](_0x4e5b64,function(_0x2a6796){if(_0x2a6796[_0x2156('0x30')]!==_0x2156('0x3f')){var _0x2ca661={};_0x2ca661[_0x2a6796[_0x2156('0x2a')]]={'$like':'%'+_0x298ba8[_0x2156('0x33')]['filter']+'%'};return _0x2ca661;}})});}_0x29d8f9=_[_0x2156('0x3e')]({},_0x29d8f9,_0x298ba8[_0x2156('0x40')]);var _0x3cf8fe={'where':_0x29d8f9['where']};return db[_0x2156('0x2d')]['count'](_0x3cf8fe)['then'](function(_0x491042){_0x31ba97['count']=_0x491042;if(_0x298ba8[_0x2156('0x33')][_0x2156('0x41')]){_0x29d8f9['include']=[{'all':!![]}];}return db[_0x2156('0x2d')][_0x2156('0x42')](_0x29d8f9);})[_0x2156('0x26')](function(_0x5626fc){_0x31ba97[_0x2156('0x43')]=_0x5626fc;return _0x31ba97;})[_0x2156('0x26')](respondWithFilteredResult(_0x23ab11,_0x29d8f9))[_0x2156('0x44')](handleError(_0x23ab11,null));};exports[_0x2156('0x45')]=function(_0x47c882,_0x1ac391){var _0x554673={'raw':![],'where':{'id':_0x47c882[_0x2156('0x46')]['id']}},_0x42df05={};_0x42df05['model']=_[_0x2156('0x47')](db[_0x2156('0x2d')]['rawAttributes']);_0x42df05[_0x2156('0x33')]=_[_0x2156('0x47')](_0x47c882[_0x2156('0x33')]);_0x42df05[_0x2156('0x34')]=_[_0x2156('0x35')](_0x42df05[_0x2156('0x32')],_0x42df05[_0x2156('0x33')]);_0x554673[_0x2156('0x36')]=_[_0x2156('0x35')](_0x42df05[_0x2156('0x32')],qs[_0x2156('0x37')](_0x47c882[_0x2156('0x33')]['fields']));_0x554673[_0x2156('0x36')]=_0x554673[_0x2156('0x36')][_0x2156('0x38')]?_0x554673[_0x2156('0x36')]:_0x42df05['model'];if(_0x47c882[_0x2156('0x33')][_0x2156('0x41')]){_0x554673['include']=[{'all':!![]}];}_0x554673=_[_0x2156('0x3e')]({},_0x554673,_0x47c882[_0x2156('0x40')]);return db[_0x2156('0x2d')][_0x2156('0x48')](_0x554673)['then'](handleEntityNotFound(_0x1ac391,null))[_0x2156('0x26')](respondWithResult(_0x1ac391,null))['catch'](handleError(_0x1ac391,null));};exports[_0x2156('0x49')]=function(_0x4069b8,_0x5a424d){return db[_0x2156('0x2d')][_0x2156('0x49')](_0x4069b8[_0x2156('0x4a')],{})['then'](respondWithResult(_0x5a424d,0xc9))['catch'](handleError(_0x5a424d,null));};exports[_0x2156('0x25')]=function(_0x311ee9,_0x5f4f81){if(_0x311ee9[_0x2156('0x4a')]['id']){delete _0x311ee9[_0x2156('0x4a')]['id'];}return db[_0x2156('0x2d')][_0x2156('0x48')]({'where':{'id':_0x311ee9['params']['id']}})['then'](handleEntityNotFound(_0x5f4f81,null))['then'](saveUpdates(_0x311ee9['body'],null))[_0x2156('0x26')](respondWithResult(_0x5f4f81,null))['catch'](handleError(_0x5f4f81,null));};exports['destroy']=function(_0x514163,_0x169a3b){return db[_0x2156('0x2d')]['find']({'where':{'id':_0x514163['params']['id']}})[_0x2156('0x26')](handleEntityNotFound(_0x169a3b,null))[_0x2156('0x26')](removeEntity(_0x169a3b,null))[_0x2156('0x44')](handleError(_0x169a3b,null));};exports[_0x2156('0x4b')]=function(_0x5edd11,_0x5cc214,_0x3b9964){var _0x2b26df={};var _0x2a78ff={};var _0xdab023;var _0x49478a;return db[_0x2156('0x2d')]['findOne']({'where':{'id':_0x5edd11[_0x2156('0x46')]['id']}})['then'](handleEntityNotFound(_0x5cc214,null))[_0x2156('0x26')](function(_0x4a989a){if(_0x4a989a){_0xdab023=_0x4a989a;_0x2a78ff[_0x2156('0x32')]=_['keys'](db[_0x2156('0x4c')]['rawAttributes']);_0x2a78ff[_0x2156('0x33')]=_[_0x2156('0x47')](_0x5edd11[_0x2156('0x33')]);_0x2a78ff['filters']=_['intersection'](_0x2a78ff[_0x2156('0x32')],_0x2a78ff[_0x2156('0x33')]);_0x2b26df[_0x2156('0x36')]=_[_0x2156('0x35')](_0x2a78ff[_0x2156('0x32')],qs[_0x2156('0x37')](_0x5edd11[_0x2156('0x33')][_0x2156('0x37')]));_0x2b26df[_0x2156('0x36')]=_0x2b26df[_0x2156('0x36')][_0x2156('0x38')]?_0x2b26df['attributes']:_0x2a78ff[_0x2156('0x32')];_0x2b26df[_0x2156('0x3a')]=qs['sort'](_0x5edd11['query']['sort']);_0x2b26df[_0x2156('0x3c')]=qs[_0x2156('0x34')](_[_0x2156('0x3d')](_0x5edd11['query'],_0x2a78ff['filters']));if(_0x5edd11[_0x2156('0x33')]['filter']){_0x2b26df[_0x2156('0x3c')]=_[_0x2156('0x3e')](_0x2b26df['where'],{'$or':_[_0x2156('0x2c')](_0x2b26df[_0x2156('0x36')],function(_0x2f0148){var _0x24bc3f={};_0x24bc3f[_0x2f0148]={'$like':'%'+_0x5edd11['query'][_0x2156('0x4d')]+'%'};return _0x24bc3f;})});}_0x2b26df=_[_0x2156('0x3e')]({},_0x2b26df,_0x5edd11['options']);return _0xdab023[_0x2156('0x4b')](_0x2b26df);}})[_0x2156('0x26')](function(_0x4d6103){if(_0x4d6103){_0x49478a=_0x4d6103[_0x2156('0x38')];if(!_0x5edd11[_0x2156('0x33')][_0x2156('0x4e')](_0x2156('0x39'))){_0x2b26df['limit']=qs[_0x2156('0x1e')](_0x5edd11[_0x2156('0x33')]['limit']);_0x2b26df[_0x2156('0x1c')]=qs[_0x2156('0x1c')](_0x5edd11[_0x2156('0x33')][_0x2156('0x1c')]);}return _0xdab023[_0x2156('0x4b')](_0x2b26df);}})[_0x2156('0x26')](function(_0x1f9f22){if(_0x1f9f22){return _0x1f9f22?{'count':_0x49478a,'rows':_0x1f9f22}:null;}})[_0x2156('0x26')](respondWithResult(_0x5cc214,null))[_0x2156('0x44')](handleError(_0x5cc214,null));};exports['addConfiguration']=function(_0x146116,_0x34695d,_0x2d3d6d){if(_0x146116[_0x2156('0x4a')]['id']){delete _0x146116[_0x2156('0x4a')]['id'];}return db[_0x2156('0x2d')]['findOne']({'where':{'id':_0x146116[_0x2156('0x46')]['id']}})[_0x2156('0x26')](handleEntityNotFound(_0x34695d,null))[_0x2156('0x26')](function(_0x19361e){if(_0x19361e){_0x146116['body'][_0x2156('0x4f')]=_0x19361e['id'];_0x146116['body'][_0x2156('0x50')]=integrations[_0x2156('0x51')](_0x146116[_0x2156('0x4a')][_0x2156('0x52')],_0x146116[_0x2156('0x4a')][_0x2156('0x30')]);_0x146116['body']['Descriptions']=integrations[_0x2156('0x53')](_0x146116['body'][_0x2156('0x52')],_0x146116[_0x2156('0x4a')][_0x2156('0x30')]);return db[_0x2156('0x4c')][_0x2156('0x49')](_0x146116[_0x2156('0x4a')],{'include':[{'model':db[_0x2156('0x54')],'as':_0x2156('0x50')},{'model':db['DeskField'],'as':_0x2156('0x55')}]});}return null;})[_0x2156('0x26')](respondWithResult(_0x34695d,null))[_0x2156('0x44')](handleError(_0x34695d,null));};exports[_0x2156('0x56')]=function(_0x65d698,_0x1c6170,_0x3cb034){var _0x60b92e=[{'name':'priority','label':_0x2156('0x57'),'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 _0x3c8463='';return db['DeskAccount'][_0x2156('0x58')]({'where':{'id':_0x65d698[_0x2156('0x46')]['id']},'attributes':['id',_0x2156('0x59'),_0x2156('0x5a'),_0x2156('0x5b'),_0x2156('0x5c'),_0x2156('0x5d'),_0x2156('0x5e'),_0x2156('0x5f'),_0x2156('0x60')]})[_0x2156('0x26')](handleEntityNotFound(_0x1c6170,null))[_0x2156('0x26')](function(_0x1883e9){if(_0x1883e9){_0x3c8463=_0x1883e9[_0x2156('0x59')];var _0x96bccb=_0x3c8463[_0x2156('0x61')](-0x1);if(_0x96bccb==='/'){_0x3c8463=_0x3c8463[_0x2156('0x62')](0x0,_0x3c8463[_0x2156('0x63')](_0x96bccb));}var _0x527d1e={'method':_0x2156('0x64'),'uri':util[_0x2156('0x65')]('%s/custom_fields',_0x3c8463),'headers':{'Content-Type':_0x2156('0x66'),'Accept':_0x2156('0x66')},'json':!![]};if(_0x1883e9['authType']===_0x2156('0x67')){_0x527d1e['headers'][_0x2156('0x68')]=util[_0x2156('0x65')](_0x2156('0x69'),new Buffer(util[_0x2156('0x65')]('%s:%s',_0x1883e9[_0x2156('0x5b')],_0x1883e9[_0x2156('0x5c')]))[_0x2156('0x6a')](_0x2156('0x6b')));}return rp(_0x527d1e)[_0x2156('0x26')](function(_0x1224bb){return _0x60b92e[_0x2156('0x6c')](_[_0x2156('0x2c')](_0x1224bb['_embedded'][_0x2156('0x6d')],function(_0xc0041){return{'id':_0xc0041[_0x2156('0x2a')],'name':_0xc0041[_0x2156('0x2a')],'type':_0xc0041[_0x2156('0x30')],'active':_0xc0041['active'],'label':_0xc0041[_0x2156('0x6e')],'custom':!![]};}));});}})[_0x2156('0x26')](function(_0x590b79){return{'count':_0x590b79[_0x2156('0x38')],'rows':_0x590b79};})['then'](respondWithResult(_0x1c6170,null))[_0x2156('0x44')](function(_0x56ba14){var _0x2fff5a=_0x65d698[_0x2156('0x33')]['test']?0x1f4:_0x56ba14[_0x2156('0x6f')]||0x1f4;logger['error'](_0x2156('0x70'),_0x2156('0x56'),_0x2fff5a,JSON[_0x2156('0x71')](_0x56ba14));delete _0x56ba14[_0x2156('0x2a')];if(_0x2fff5a===0x191){_0x2fff5a=0x190;}_0x1c6170[_0x2156('0x1b')](_0x2fff5a)[_0x2156('0x2b')](_0x65d698[_0x2156('0x33')][_0x2156('0x72')]?{'message':'Wrong\x20credentials','statusCode':_0x56ba14[_0x2156('0x6f')]}:_0x56ba14);});}; \ No newline at end of file +var _0x01e4=['order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','rows','show','keys','find','catch','create','body','params','destroy','getConfigurations','DeskConfiguration','pick','addConfiguration','findOne','AccountId','channel','Descriptions','getDescriptions','DeskField','Subjects','getFields','priority','remoteUri','authType','username','consumerKey','consumerSecret','token','tokenSecret','slice','substring','GET','format','application/json','basic','Authorization','Basic\x20%s','%s:%s','password','toString','base64','concat','entries','active','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','DeskAccount','rawAttributes','type','model','query','intersection','attributes','fields','length','nolimit'];(function(_0x4b839d,_0x4c1a4a){var _0x1ac602=function(_0x3ee5c9){while(--_0x3ee5c9){_0x4b839d['push'](_0x4b839d['shift']());}};_0x1ac602(++_0x4c1a4a);}(_0x01e4,0x18e));var _0x401e=function(_0x1a809c,_0x199a58){_0x1a809c=_0x1a809c-0x0;var _0x533174=_0x01e4[_0x1a809c];return _0x533174;};'use strict';var emlformat=require(_0x401e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x401e('0x1'));var jsonpatch=require(_0x401e('0x2'));var rp=require('request-promise');var moment=require(_0x401e('0x3'));var BPromise=require(_0x401e('0x4'));var Mustache=require(_0x401e('0x5'));var util=require('util');var path=require(_0x401e('0x6'));var sox=require(_0x401e('0x7'));var csv=require('to-csv');var ejs=require(_0x401e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x401e('0x9'));var squel=require(_0x401e('0xa'));var crypto=require('crypto');var jsforce=require(_0x401e('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x401e('0xc'));var querystring=require(_0x401e('0xd'));var Papa=require('papaparse');var Redis=require(_0x401e('0xe'));var authService=require(_0x401e('0xf'));var qs=require(_0x401e('0x10'));var as=require(_0x401e('0x11'));var hardwareService=require(_0x401e('0x12'));var logger=require(_0x401e('0x13'))(_0x401e('0x14'));var utils=require(_0x401e('0x15'));var config=require(_0x401e('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x401e('0x17'))['db'];var integrations=require(_0x401e('0x18'));function respondWithStatusCode(_0x3f361a,_0x9ba460){_0x9ba460=_0x9ba460||0xcc;return function(_0x31ed81){if(_0x31ed81){return _0x3f361a[_0x401e('0x19')](_0x9ba460);}return _0x3f361a[_0x401e('0x1a')](_0x9ba460)['end']();};}function respondWithResult(_0x2fcd81,_0x1ad63e){_0x1ad63e=_0x1ad63e||0xc8;return function(_0x31319b){if(_0x31319b){return _0x2fcd81[_0x401e('0x1a')](_0x1ad63e)['json'](_0x31319b);}};}function respondWithFilteredResult(_0x490d4b,_0x2572b9){return function(_0x299b99){if(_0x299b99){var _0x2d4a94=typeof _0x2572b9[_0x401e('0x1b')]===_0x401e('0x1c')&&typeof _0x2572b9[_0x401e('0x1d')]===_0x401e('0x1c');var _0x1f36da=_0x299b99[_0x401e('0x1e')];var _0x358eb6=_0x2d4a94?0x0:_0x2572b9[_0x401e('0x1b')];var _0x60e764=_0x2d4a94?_0x299b99[_0x401e('0x1e')]:_0x2572b9['offset']+_0x2572b9[_0x401e('0x1d')];var _0x4d4cdc;if(_0x60e764>=_0x1f36da){_0x60e764=_0x1f36da;_0x4d4cdc=0xc8;}else{_0x4d4cdc=0xce;}_0x490d4b[_0x401e('0x1a')](_0x4d4cdc);return _0x490d4b[_0x401e('0x1f')](_0x401e('0x20'),_0x358eb6+'-'+_0x60e764+'/'+_0x1f36da)['json'](_0x299b99);}return null;};}function patchUpdates(_0x1e71e4){return function(_0x4c828a){try{jsonpatch[_0x401e('0x21')](_0x4c828a,_0x1e71e4,!![]);}catch(_0x1f16c6){return BPromise[_0x401e('0x22')](_0x1f16c6);}return _0x4c828a[_0x401e('0x23')]();};}function saveUpdates(_0x38eb2c,_0x151d5d){return function(_0x2e185c){if(_0x2e185c){return _0x2e185c[_0x401e('0x24')](_0x38eb2c)[_0x401e('0x25')](function(_0x4439c9){return _0x4439c9;});}return null;};}function removeEntity(_0x2f5938,_0x57c71f){return function(_0x52ef45){if(_0x52ef45){return _0x52ef45['destroy']()[_0x401e('0x25')](function(){_0x2f5938[_0x401e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5de87d,_0x16b0ee){return function(_0x308056){if(!_0x308056){_0x5de87d['sendStatus'](0x194);}return _0x308056;};}function handleError(_0x8581b0,_0x55579b){_0x55579b=_0x55579b||0x1f4;return function(_0x119681){logger[_0x401e('0x26')](_0x119681[_0x401e('0x27')]);if(_0x119681[_0x401e('0x28')]){delete _0x119681[_0x401e('0x28')];}_0x8581b0['status'](_0x55579b)[_0x401e('0x29')](_0x119681);};}exports[_0x401e('0x2a')]=function(_0x209a25,_0x45d82b){var _0x2d587a={},_0x361421={},_0x4ad854={'count':0x0,'rows':[]};var _0x14ddef=_[_0x401e('0x2b')](db[_0x401e('0x2c')][_0x401e('0x2d')],function(_0x51cb3e){return{'name':_0x51cb3e['fieldName'],'type':_0x51cb3e[_0x401e('0x2e')]['key']};});_0x361421[_0x401e('0x2f')]=_['map'](_0x14ddef,_0x401e('0x28'));_0x361421[_0x401e('0x30')]=_['keys'](_0x209a25[_0x401e('0x30')]);_0x361421['filters']=_[_0x401e('0x31')](_0x361421['model'],_0x361421['query']);_0x2d587a[_0x401e('0x32')]=_[_0x401e('0x31')](_0x361421['model'],qs[_0x401e('0x33')](_0x209a25['query'][_0x401e('0x33')]));_0x2d587a[_0x401e('0x32')]=_0x2d587a[_0x401e('0x32')][_0x401e('0x34')]?_0x2d587a['attributes']:_0x361421[_0x401e('0x2f')];if(!_0x209a25[_0x401e('0x30')]['hasOwnProperty'](_0x401e('0x35'))){_0x2d587a[_0x401e('0x1d')]=qs[_0x401e('0x1d')](_0x209a25[_0x401e('0x30')][_0x401e('0x1d')]);_0x2d587a[_0x401e('0x1b')]=qs[_0x401e('0x1b')](_0x209a25[_0x401e('0x30')][_0x401e('0x1b')]);}_0x2d587a[_0x401e('0x36')]=qs['sort'](_0x209a25['query'][_0x401e('0x37')]);_0x2d587a[_0x401e('0x38')]=qs[_0x401e('0x39')](_['pick'](_0x209a25['query'],_0x361421[_0x401e('0x39')]),_0x14ddef);if(_0x209a25[_0x401e('0x30')][_0x401e('0x3a')]){_0x2d587a[_0x401e('0x38')]=_[_0x401e('0x3b')](_0x2d587a[_0x401e('0x38')],{'$or':_[_0x401e('0x2b')](_0x14ddef,function(_0x12ef49){if(_0x12ef49[_0x401e('0x2e')]!==_0x401e('0x3c')){var _0x5af896={};_0x5af896[_0x12ef49[_0x401e('0x28')]]={'$like':'%'+_0x209a25[_0x401e('0x30')]['filter']+'%'};return _0x5af896;}})});}_0x2d587a=_[_0x401e('0x3b')]({},_0x2d587a,_0x209a25[_0x401e('0x3d')]);var _0x9bae3a={'where':_0x2d587a[_0x401e('0x38')]};return db[_0x401e('0x2c')]['count'](_0x9bae3a)['then'](function(_0x3fbb59){_0x4ad854[_0x401e('0x1e')]=_0x3fbb59;if(_0x209a25[_0x401e('0x30')][_0x401e('0x3e')]){_0x2d587a[_0x401e('0x3f')]=[{'all':!![]}];}return db['DeskAccount']['findAll'](_0x2d587a);})[_0x401e('0x25')](function(_0x4c0fef){_0x4ad854[_0x401e('0x40')]=_0x4c0fef;return _0x4ad854;})[_0x401e('0x25')](respondWithFilteredResult(_0x45d82b,_0x2d587a))['catch'](handleError(_0x45d82b,null));};exports[_0x401e('0x41')]=function(_0x599079,_0x5d4b3f){var _0x21505a={'raw':![],'where':{'id':_0x599079['params']['id']}},_0x331c00={};_0x331c00[_0x401e('0x2f')]=_[_0x401e('0x42')](db[_0x401e('0x2c')][_0x401e('0x2d')]);_0x331c00['query']=_[_0x401e('0x42')](_0x599079[_0x401e('0x30')]);_0x331c00[_0x401e('0x39')]=_['intersection'](_0x331c00['model'],_0x331c00[_0x401e('0x30')]);_0x21505a[_0x401e('0x32')]=_['intersection'](_0x331c00[_0x401e('0x2f')],qs['fields'](_0x599079['query']['fields']));_0x21505a[_0x401e('0x32')]=_0x21505a[_0x401e('0x32')][_0x401e('0x34')]?_0x21505a[_0x401e('0x32')]:_0x331c00[_0x401e('0x2f')];if(_0x599079[_0x401e('0x30')][_0x401e('0x3e')]){_0x21505a[_0x401e('0x3f')]=[{'all':!![]}];}_0x21505a=_[_0x401e('0x3b')]({},_0x21505a,_0x599079['options']);return db[_0x401e('0x2c')][_0x401e('0x43')](_0x21505a)['then'](handleEntityNotFound(_0x5d4b3f,null))['then'](respondWithResult(_0x5d4b3f,null))[_0x401e('0x44')](handleError(_0x5d4b3f,null));};exports['create']=function(_0x15fc73,_0x43d6fc){return db[_0x401e('0x2c')][_0x401e('0x45')](_0x15fc73[_0x401e('0x46')],{})['then'](respondWithResult(_0x43d6fc,0xc9))[_0x401e('0x44')](handleError(_0x43d6fc,null));};exports[_0x401e('0x24')]=function(_0x4d7504,_0xd838c5){if(_0x4d7504[_0x401e('0x46')]['id']){delete _0x4d7504[_0x401e('0x46')]['id'];}return db[_0x401e('0x2c')][_0x401e('0x43')]({'where':{'id':_0x4d7504[_0x401e('0x47')]['id']}})['then'](handleEntityNotFound(_0xd838c5,null))['then'](saveUpdates(_0x4d7504['body'],null))[_0x401e('0x25')](respondWithResult(_0xd838c5,null))[_0x401e('0x44')](handleError(_0xd838c5,null));};exports[_0x401e('0x48')]=function(_0x211132,_0x235058){return db[_0x401e('0x2c')][_0x401e('0x43')]({'where':{'id':_0x211132[_0x401e('0x47')]['id']}})[_0x401e('0x25')](handleEntityNotFound(_0x235058,null))[_0x401e('0x25')](removeEntity(_0x235058,null))[_0x401e('0x44')](handleError(_0x235058,null));};exports[_0x401e('0x49')]=function(_0x1eaeed,_0x57a7c5,_0x521974){var _0x458d1c={};var _0x51f1c2={};var _0x422604;var _0x512f08;return db['DeskAccount']['findOne']({'where':{'id':_0x1eaeed[_0x401e('0x47')]['id']}})['then'](handleEntityNotFound(_0x57a7c5,null))['then'](function(_0x118710){if(_0x118710){_0x422604=_0x118710;_0x51f1c2[_0x401e('0x2f')]=_['keys'](db[_0x401e('0x4a')][_0x401e('0x2d')]);_0x51f1c2['query']=_[_0x401e('0x42')](_0x1eaeed[_0x401e('0x30')]);_0x51f1c2[_0x401e('0x39')]=_[_0x401e('0x31')](_0x51f1c2[_0x401e('0x2f')],_0x51f1c2[_0x401e('0x30')]);_0x458d1c['attributes']=_[_0x401e('0x31')](_0x51f1c2[_0x401e('0x2f')],qs[_0x401e('0x33')](_0x1eaeed[_0x401e('0x30')][_0x401e('0x33')]));_0x458d1c[_0x401e('0x32')]=_0x458d1c[_0x401e('0x32')]['length']?_0x458d1c[_0x401e('0x32')]:_0x51f1c2['model'];_0x458d1c[_0x401e('0x36')]=qs[_0x401e('0x37')](_0x1eaeed[_0x401e('0x30')][_0x401e('0x37')]);_0x458d1c[_0x401e('0x38')]=qs[_0x401e('0x39')](_[_0x401e('0x4b')](_0x1eaeed['query'],_0x51f1c2[_0x401e('0x39')]));if(_0x1eaeed[_0x401e('0x30')][_0x401e('0x3a')]){_0x458d1c[_0x401e('0x38')]=_[_0x401e('0x3b')](_0x458d1c[_0x401e('0x38')],{'$or':_['map'](_0x458d1c[_0x401e('0x32')],function(_0x401598){var _0x18e53c={};_0x18e53c[_0x401598]={'$like':'%'+_0x1eaeed['query'][_0x401e('0x3a')]+'%'};return _0x18e53c;})});}_0x458d1c=_[_0x401e('0x3b')]({},_0x458d1c,_0x1eaeed['options']);return _0x422604[_0x401e('0x49')](_0x458d1c);}})[_0x401e('0x25')](function(_0x4532b8){if(_0x4532b8){_0x512f08=_0x4532b8[_0x401e('0x34')];if(!_0x1eaeed['query']['hasOwnProperty']('nolimit')){_0x458d1c['limit']=qs[_0x401e('0x1d')](_0x1eaeed[_0x401e('0x30')][_0x401e('0x1d')]);_0x458d1c[_0x401e('0x1b')]=qs[_0x401e('0x1b')](_0x1eaeed[_0x401e('0x30')][_0x401e('0x1b')]);}return _0x422604[_0x401e('0x49')](_0x458d1c);}})[_0x401e('0x25')](function(_0x107fb1){if(_0x107fb1){return _0x107fb1?{'count':_0x512f08,'rows':_0x107fb1}:null;}})[_0x401e('0x25')](respondWithResult(_0x57a7c5,null))['catch'](handleError(_0x57a7c5,null));};exports[_0x401e('0x4c')]=function(_0x45f667,_0x89991,_0x3bd33e){if(_0x45f667['body']['id']){delete _0x45f667[_0x401e('0x46')]['id'];}return db[_0x401e('0x2c')][_0x401e('0x4d')]({'where':{'id':_0x45f667['params']['id']}})['then'](handleEntityNotFound(_0x89991,null))[_0x401e('0x25')](function(_0xace752){if(_0xace752){_0x45f667[_0x401e('0x46')][_0x401e('0x4e')]=_0xace752['id'];_0x45f667[_0x401e('0x46')]['Subjects']=integrations['getSubjects'](_0x45f667[_0x401e('0x46')][_0x401e('0x4f')],_0x45f667[_0x401e('0x46')][_0x401e('0x2e')]);_0x45f667[_0x401e('0x46')][_0x401e('0x50')]=integrations[_0x401e('0x51')](_0x45f667[_0x401e('0x46')]['channel'],_0x45f667[_0x401e('0x46')][_0x401e('0x2e')]);return db[_0x401e('0x4a')][_0x401e('0x45')](_0x45f667[_0x401e('0x46')],{'include':[{'model':db[_0x401e('0x52')],'as':_0x401e('0x53')},{'model':db[_0x401e('0x52')],'as':_0x401e('0x50')}]});}return null;})['then'](respondWithResult(_0x89991,null))[_0x401e('0x44')](handleError(_0x89991,null));};exports[_0x401e('0x54')]=function(_0x4dad30,_0x1ec5c9,_0x56fb9f){var _0x512f8b=[{'name':_0x401e('0x55'),'label':_0x401e('0x55'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x444d21='';return db[_0x401e('0x2c')]['findOne']({'where':{'id':_0x4dad30[_0x401e('0x47')]['id']},'attributes':['id',_0x401e('0x56'),_0x401e('0x57'),_0x401e('0x58'),'password',_0x401e('0x59'),_0x401e('0x5a'),_0x401e('0x5b'),_0x401e('0x5c')]})['then'](handleEntityNotFound(_0x1ec5c9,null))[_0x401e('0x25')](function(_0x580642){if(_0x580642){_0x444d21=_0x580642[_0x401e('0x56')];var _0x497d9e=_0x444d21[_0x401e('0x5d')](-0x1);if(_0x497d9e==='/'){_0x444d21=_0x444d21[_0x401e('0x5e')](0x0,_0x444d21['lastIndexOf'](_0x497d9e));}var _0x24ae4f={'method':_0x401e('0x5f'),'uri':util[_0x401e('0x60')]('%s/custom_fields',_0x444d21),'headers':{'Content-Type':_0x401e('0x61'),'Accept':_0x401e('0x61')},'json':!![]};if(_0x580642['authType']===_0x401e('0x62')){_0x24ae4f['headers'][_0x401e('0x63')]=util[_0x401e('0x60')](_0x401e('0x64'),new Buffer(util[_0x401e('0x60')](_0x401e('0x65'),_0x580642[_0x401e('0x58')],_0x580642[_0x401e('0x66')]))[_0x401e('0x67')](_0x401e('0x68')));}return rp(_0x24ae4f)[_0x401e('0x25')](function(_0x5a8a17){return _0x512f8b[_0x401e('0x69')](_[_0x401e('0x2b')](_0x5a8a17['_embedded'][_0x401e('0x6a')],function(_0x118823){return{'id':_0x118823['name'],'name':_0x118823[_0x401e('0x28')],'type':_0x118823[_0x401e('0x2e')],'active':_0x118823[_0x401e('0x6b')],'label':_0x118823['label'],'custom':!![]};}));});}})[_0x401e('0x25')](function(_0x28707e){return{'count':_0x28707e[_0x401e('0x34')],'rows':_0x28707e};})[_0x401e('0x25')](respondWithResult(_0x1ec5c9,null))['catch'](function(_0x1306c7){var _0x28a3e3=_0x4dad30['query'][_0x401e('0x6c')]?0x1f4:_0x1306c7[_0x401e('0x6d')]||0x1f4;logger['error'](_0x401e('0x6e'),_0x401e('0x54'),_0x28a3e3,JSON[_0x401e('0x6f')](_0x1306c7));delete _0x1306c7[_0x401e('0x28')];if(_0x28a3e3===0x191){_0x28a3e3=0x190;}_0x1ec5c9[_0x401e('0x1a')](_0x28a3e3)[_0x401e('0x29')](_0x4dad30[_0x401e('0x30')][_0x401e('0x6c')]?{'message':_0x401e('0x70'),'statusCode':_0x1306c7[_0x401e('0x6d')]}:_0x1306c7);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 86270f1..eee8e78 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 _0x3d9e=['path','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','int_desk_accounts','../../config/logger','api','bluebird','request-promise'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x3d9e,0x6a));var _0xe3d9=function(_0x257017,_0x330627){_0x257017=_0x257017-0x0;var _0x38536d=_0x3d9e[_0x257017];return _0x38536d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe3d9('0x0'))(_0xe3d9('0x1'));var moment=require('moment');var BPromise=require(_0xe3d9('0x2'));var rp=require(_0xe3d9('0x3'));var fs=require('fs');var path=require(_0xe3d9('0x4'));var rimraf=require('rimraf');var config=require(_0xe3d9('0x5'));var attributes=require(_0xe3d9('0x6'));var integrations=require(_0xe3d9('0x7'));module[_0xe3d9('0x8')]=function(_0x51c705,_0x5342e3){return _0x51c705[_0xe3d9('0x9')]('DeskAccount',attributes,{'tableName':_0xe3d9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa0b9=['DeskAccount','int_desk_accounts','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intDeskAccount.attributes','exports','define'];(function(_0x2018ca,_0x18ffc1){var _0x23ef6d=function(_0xd2f8da){while(--_0xd2f8da){_0x2018ca['push'](_0x2018ca['shift']());}};_0x23ef6d(++_0x18ffc1);}(_0xa0b9,0xfe));var _0x9a0b=function(_0x7de56d,_0x1cb5f5){_0x7de56d=_0x7de56d-0x0;var _0x283687=_0xa0b9[_0x7de56d];return _0x283687;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9a0b('0x0'))(_0x9a0b('0x1'));var moment=require(_0x9a0b('0x2'));var BPromise=require(_0x9a0b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9a0b('0x4'));var rimraf=require(_0x9a0b('0x5'));var config=require(_0x9a0b('0x6'));var attributes=require(_0x9a0b('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x9a0b('0x8')]=function(_0x4eb66b,_0x30ede8){return _0x4eb66b[_0x9a0b('0x9')](_0x9a0b('0xa'),attributes,{'tableName':_0x9a0b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index 4b8fa89..4423424 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 _0x52ec=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','code','DeskAccount,\x20%s,\x20%s','message','result','catch','GetDeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','debug','ShowDeskAccount','find','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x52ec,0x136));var _0xc52e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x52ec[_0x2a6809];return _0x11c371;};'use strict';var _=require('lodash');var util=require(_0xc52e('0x0'));var moment=require(_0xc52e('0x1'));var BPromise=require(_0xc52e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc52e('0x3'));var db=require(_0xc52e('0x4'))['db'];var utils=require(_0xc52e('0x5'));var logger=require(_0xc52e('0x6'))('rpc');var config=require(_0xc52e('0x7'));var jayson=require(_0xc52e('0x8'));var client=jayson[_0xc52e('0x9')][_0xc52e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x497842,_0x1d550e,_0x3b1410){return new BPromise(function(_0x37bd42,_0x4c9c08){return client[_0xc52e('0xb')](_0x497842,_0x3b1410)[_0xc52e('0xc')](function(_0x2d7df4){logger[_0xc52e('0xd')]('DeskAccount,\x20%s,\x20%s',_0x1d550e,_0xc52e('0xe'));logger['debug']('DeskAccount,\x20%s,\x20%s,\x20%s',_0x1d550e,_0xc52e('0xe'),JSON[_0xc52e('0xf')](_0x2d7df4));if(_0x2d7df4[_0xc52e('0x10')]){if(_0x2d7df4[_0xc52e('0x10')][_0xc52e('0x11')]===0x1f4){logger[_0xc52e('0x10')](_0xc52e('0x12'),_0x1d550e,_0x2d7df4[_0xc52e('0x10')][_0xc52e('0x13')]);return _0x4c9c08(_0x2d7df4[_0xc52e('0x10')]['message']);}logger[_0xc52e('0x10')](_0xc52e('0x12'),_0x1d550e,_0x2d7df4['error'][_0xc52e('0x13')]);return _0x37bd42(_0x2d7df4[_0xc52e('0x10')][_0xc52e('0x13')]);}else{logger[_0xc52e('0xd')](_0xc52e('0x12'),_0x1d550e,'request\x20sent');_0x37bd42(_0x2d7df4[_0xc52e('0x14')][_0xc52e('0x13')]);}})[_0xc52e('0x15')](function(_0x1e1b7c){logger[_0xc52e('0x10')](_0xc52e('0x12'),_0x1d550e,_0x1e1b7c);_0x4c9c08(_0x1e1b7c);});});}exports[_0xc52e('0x16')]=function(_0x54dd8a){var _0x3ad20f=this;return new Promise(function(_0x4597a8,_0x239e26){return db['DeskAccount'][_0xc52e('0x17')]({'raw':_0x54dd8a[_0xc52e('0x18')]?_0x54dd8a['options'][_0xc52e('0x19')]===undefined?!![]:![]:!![],'where':_0x54dd8a[_0xc52e('0x18')]?_0x54dd8a[_0xc52e('0x18')][_0xc52e('0x1a')]||null:null,'attributes':_0x54dd8a[_0xc52e('0x18')]?_0x54dd8a[_0xc52e('0x18')][_0xc52e('0x1b')]||null:null,'limit':_0x54dd8a[_0xc52e('0x18')]?_0x54dd8a[_0xc52e('0x18')][_0xc52e('0x1c')]||null:null,'include':_0x54dd8a[_0xc52e('0x18')]?_0x54dd8a[_0xc52e('0x18')][_0xc52e('0x1d')]?_[_0xc52e('0x1e')](_0x54dd8a['options'][_0xc52e('0x1d')],function(_0x234b4a){return{'model':db[_0x234b4a[_0xc52e('0x1f')]],'as':_0x234b4a['as'],'attributes':_0x234b4a[_0xc52e('0x1b')],'include':_0x234b4a['include']?_['map'](_0x234b4a['include'],function(_0x2bcb43){return{'model':db[_0x2bcb43['model']],'as':_0x2bcb43['as'],'attributes':_0x2bcb43[_0xc52e('0x1b')],'include':_0x2bcb43[_0xc52e('0x1d')]?_[_0xc52e('0x1e')](_0x2bcb43['include'],function(_0x39d2d8){return{'model':db[_0x39d2d8[_0xc52e('0x1f')]],'as':_0x39d2d8['as'],'attributes':_0x39d2d8['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1ae054){logger[_0xc52e('0xd')](_0xc52e('0x16'),_0x54dd8a);logger[_0xc52e('0x20')](_0xc52e('0x16'),_0x54dd8a,JSON[_0xc52e('0xf')](_0x1ae054));_0x4597a8(_0x1ae054);})[_0xc52e('0x15')](function(_0x4b94ad){logger[_0xc52e('0x10')]('GetDeskAccount',_0x4b94ad['message'],_0x54dd8a);_0x239e26(_0x3ad20f[_0xc52e('0x10')](0x1f4,_0x4b94ad[_0xc52e('0x13')]));});});};exports[_0xc52e('0x21')]=function(_0x4eaebb){var _0x48e605=this;return new Promise(function(_0x5236a8,_0x5aab4){return db['DeskAccount'][_0xc52e('0x22')]({'raw':_0x4eaebb[_0xc52e('0x18')]?_0x4eaebb[_0xc52e('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4eaebb[_0xc52e('0x18')]?_0x4eaebb['options']['where']||null:null,'attributes':_0x4eaebb[_0xc52e('0x18')]?_0x4eaebb[_0xc52e('0x18')][_0xc52e('0x1b')]||null:null,'include':_0x4eaebb[_0xc52e('0x18')]?_0x4eaebb['options']['include']?_[_0xc52e('0x1e')](_0x4eaebb[_0xc52e('0x18')][_0xc52e('0x1d')],function(_0xa9959a){return{'model':db[_0xa9959a[_0xc52e('0x1f')]],'as':_0xa9959a['as'],'attributes':_0xa9959a[_0xc52e('0x1b')],'include':_0xa9959a[_0xc52e('0x1d')]?_[_0xc52e('0x1e')](_0xa9959a[_0xc52e('0x1d')],function(_0x41e5c5){return{'model':db[_0x41e5c5[_0xc52e('0x1f')]],'as':_0x41e5c5['as'],'attributes':_0x41e5c5[_0xc52e('0x1b')],'include':_0x41e5c5['include']?_['map'](_0x41e5c5[_0xc52e('0x1d')],function(_0xe13e4a){return{'model':db[_0xe13e4a['model']],'as':_0xe13e4a['as'],'attributes':_0xe13e4a[_0xc52e('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc52e('0xc')](function(_0x2580a1){logger[_0xc52e('0xd')](_0xc52e('0x21'),_0x4eaebb);logger[_0xc52e('0x20')](_0xc52e('0x21'),_0x4eaebb,JSON['stringify'](_0x2580a1));_0x5236a8(_0x2580a1);})['catch'](function(_0x5c9bf9){logger[_0xc52e('0x10')]('ShowDeskAccount',_0x5c9bf9[_0xc52e('0x13')],_0x4eaebb);_0x5aab4(_0x48e605['error'](0x1f4,_0x5c9bf9[_0xc52e('0x13')]));});});}; \ No newline at end of file +var _0x717a=['stringify','error','code','message','catch','DeskAccount','findAll','options','raw','where','attributes','map','include','model','GetDeskAccount','find','ShowDeskAccount','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s'];(function(_0x306b57,_0x13f798){var _0x5836fc=function(_0x7a50aa){while(--_0x7a50aa){_0x306b57['push'](_0x306b57['shift']());}};_0x5836fc(++_0x13f798);}(_0x717a,0x1ed));var _0xa717=function(_0x2c0be1,_0x1e88f2){_0x2c0be1=_0x2c0be1-0x0;var _0x3d4bd2=_0x717a[_0x2c0be1];return _0x3d4bd2;};'use strict';var _=require(_0xa717('0x0'));var util=require(_0xa717('0x1'));var moment=require(_0xa717('0x2'));var BPromise=require(_0xa717('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa717('0x4'));var db=require(_0xa717('0x5'))['db'];var utils=require(_0xa717('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xa717('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa717('0x8')][_0xa717('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x53f6c3,_0x524308,_0x104fe4){return new BPromise(function(_0x5448a6,_0x264aa1){return client[_0xa717('0xa')](_0x53f6c3,_0x104fe4)[_0xa717('0xb')](function(_0x15dc8a){logger[_0xa717('0xc')](_0xa717('0xd'),_0x524308,_0xa717('0xe'));logger[_0xa717('0xf')](_0xa717('0x10'),_0x524308,_0xa717('0xe'),JSON[_0xa717('0x11')](_0x15dc8a));if(_0x15dc8a[_0xa717('0x12')]){if(_0x15dc8a[_0xa717('0x12')][_0xa717('0x13')]===0x1f4){logger[_0xa717('0x12')](_0xa717('0xd'),_0x524308,_0x15dc8a[_0xa717('0x12')][_0xa717('0x14')]);return _0x264aa1(_0x15dc8a['error'][_0xa717('0x14')]);}logger['error'](_0xa717('0xd'),_0x524308,_0x15dc8a['error'][_0xa717('0x14')]);return _0x5448a6(_0x15dc8a[_0xa717('0x12')][_0xa717('0x14')]);}else{logger[_0xa717('0xc')]('DeskAccount,\x20%s,\x20%s',_0x524308,_0xa717('0xe'));_0x5448a6(_0x15dc8a['result'][_0xa717('0x14')]);}})[_0xa717('0x15')](function(_0x259069){logger[_0xa717('0x12')](_0xa717('0xd'),_0x524308,_0x259069);_0x264aa1(_0x259069);});});}exports['GetDeskAccount']=function(_0x4584f8){var _0x1f9fe5=this;return new Promise(function(_0x45e653,_0xadcda0){return db[_0xa717('0x16')][_0xa717('0x17')]({'raw':_0x4584f8[_0xa717('0x18')]?_0x4584f8[_0xa717('0x18')][_0xa717('0x19')]===undefined?!![]:![]:!![],'where':_0x4584f8[_0xa717('0x18')]?_0x4584f8[_0xa717('0x18')][_0xa717('0x1a')]||null:null,'attributes':_0x4584f8[_0xa717('0x18')]?_0x4584f8[_0xa717('0x18')][_0xa717('0x1b')]||null:null,'limit':_0x4584f8[_0xa717('0x18')]?_0x4584f8[_0xa717('0x18')]['limit']||null:null,'include':_0x4584f8[_0xa717('0x18')]?_0x4584f8[_0xa717('0x18')]['include']?_[_0xa717('0x1c')](_0x4584f8[_0xa717('0x18')][_0xa717('0x1d')],function(_0x625c8){return{'model':db[_0x625c8[_0xa717('0x1e')]],'as':_0x625c8['as'],'attributes':_0x625c8[_0xa717('0x1b')],'include':_0x625c8[_0xa717('0x1d')]?_[_0xa717('0x1c')](_0x625c8[_0xa717('0x1d')],function(_0x2cf94a){return{'model':db[_0x2cf94a[_0xa717('0x1e')]],'as':_0x2cf94a['as'],'attributes':_0x2cf94a['attributes'],'include':_0x2cf94a['include']?_['map'](_0x2cf94a[_0xa717('0x1d')],function(_0x30c522){return{'model':db[_0x30c522[_0xa717('0x1e')]],'as':_0x30c522['as'],'attributes':_0x30c522[_0xa717('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x404e84){logger[_0xa717('0xc')](_0xa717('0x1f'),_0x4584f8);logger[_0xa717('0xf')](_0xa717('0x1f'),_0x4584f8,JSON['stringify'](_0x404e84));_0x45e653(_0x404e84);})[_0xa717('0x15')](function(_0x5756d1){logger[_0xa717('0x12')](_0xa717('0x1f'),_0x5756d1[_0xa717('0x14')],_0x4584f8);_0xadcda0(_0x1f9fe5[_0xa717('0x12')](0x1f4,_0x5756d1['message']));});});};exports['ShowDeskAccount']=function(_0x3432e5){var _0x214428=this;return new Promise(function(_0x133920,_0x4e3ad4){return db[_0xa717('0x16')][_0xa717('0x20')]({'raw':_0x3432e5[_0xa717('0x18')]?_0x3432e5['options'][_0xa717('0x19')]===undefined?!![]:![]:!![],'where':_0x3432e5[_0xa717('0x18')]?_0x3432e5['options'][_0xa717('0x1a')]||null:null,'attributes':_0x3432e5[_0xa717('0x18')]?_0x3432e5['options'][_0xa717('0x1b')]||null:null,'include':_0x3432e5[_0xa717('0x18')]?_0x3432e5['options']['include']?_[_0xa717('0x1c')](_0x3432e5['options'][_0xa717('0x1d')],function(_0x3274d8){return{'model':db[_0x3274d8[_0xa717('0x1e')]],'as':_0x3274d8['as'],'attributes':_0x3274d8['attributes'],'include':_0x3274d8[_0xa717('0x1d')]?_[_0xa717('0x1c')](_0x3274d8['include'],function(_0x100623){return{'model':db[_0x100623[_0xa717('0x1e')]],'as':_0x100623['as'],'attributes':_0x100623[_0xa717('0x1b')],'include':_0x100623[_0xa717('0x1d')]?_['map'](_0x100623['include'],function(_0xd3c341){return{'model':db[_0xd3c341[_0xa717('0x1e')]],'as':_0xd3c341['as'],'attributes':_0xd3c341[_0xa717('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xa717('0xb')](function(_0x4d19d7){logger[_0xa717('0xc')](_0xa717('0x21'),_0x3432e5);logger[_0xa717('0xf')]('ShowDeskAccount',_0x3432e5,JSON[_0xa717('0x11')](_0x4d19d7));_0x133920(_0x4d19d7);})[_0xa717('0x15')](function(_0x3f0a4f){logger['error'](_0xa717('0x21'),_0x3f0a4f[_0xa717('0x14')],_0x3432e5);_0x4e3ad4(_0x214428['error'](0x1f4,_0x3f0a4f[_0xa717('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index d995f98..ea9d7ef 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 _0x9c44=['destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intDeskConfiguration.controller','isAuthenticated','index','get','/:id','/:id/fields','getFields','getSubjects','/:id/descriptions','/:id/tags','post','setTags','put','update'];(function(_0x5ab894,_0x3a95df){var _0x3781b2=function(_0x3b0262){while(--_0x3b0262){_0x5ab894['push'](_0x5ab894['shift']());}};_0x3781b2(++_0x3a95df);}(_0x9c44,0x178));var _0x49c4=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x9c44[_0x279d37];return _0x530173;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['show']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['get']('/:id/subjects',auth[_0x49c4('0x7')](),controller[_0x49c4('0xd')]);router['get'](_0x49c4('0xe'),auth[_0x49c4('0x7')](),controller['getDescriptions']);router['get'](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller['getTags']);router[_0x49c4('0x10')]('/',auth[_0x49c4('0x7')](),controller['create']);router[_0x49c4('0x10')](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x11')]);router[_0x49c4('0x12')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x13')]);router['delete'](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);module[_0x49c4('0x15')]=router; \ No newline at end of file +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(_0x155839,_0x3f679d){var _0x51d322=function(_0xf96e28){while(--_0xf96e28){_0x155839['push'](_0x155839['shift']());}};_0x51d322(++_0x3f679d);}(_0x55ca,0x126));var _0xa55c=function(_0xb011d6,_0x74d4eb){_0xb011d6=_0xb011d6-0x0;var _0x1e30f1=_0x55ca[_0xb011d6];return _0x1e30f1;};'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 diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index a4121e1..d5a5807 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 _0x54bb=['sequelize','exports'];(function(_0x34b145,_0x54aa50){var _0x28460a=function(_0x5b2d2f){while(--_0x5b2d2f){_0x34b145['push'](_0x34b145['shift']());}};_0x28460a(++_0x54aa50);}(_0x54bb,0x174));var _0xb54b=function(_0x193ddf,_0x6f30bb){_0x193ddf=_0x193ddf-0x0;var _0x5bc6df=_0x54bb[_0x193ddf];return _0x5bc6df;};'use strict';var Sequelize=require(_0xb54b('0x0'));module[_0xb54b('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6926=['exports','STRING','sequelize'];(function(_0x42e01a,_0x4585b4){var _0x40f1b7=function(_0x596bfe){while(--_0x596bfe){_0x42e01a['push'](_0x42e01a['shift']());}};_0x40f1b7(++_0x4585b4);}(_0x6926,0x185));var _0x6692=function(_0x1a7cad,_0x13be22){_0x1a7cad=_0x1a7cad-0x0;var _0x43f300=_0x6926[_0x1a7cad];return _0x43f300;};'use strict';var Sequelize=require(_0x6692('0x0'));module[_0x6692('0x1')]={'name':{'type':Sequelize[_0x6692('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 1f1c3da..c6a96f1 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 _0xa299=['length','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','options','include','findAll','show','params','rawAttributes','includeAll','catch','create','body','find','getFields','findOne','DeskField','nolimit','getSubjects','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','destroy','then','error','stack','name','map','DeskConfiguration','type','model','query','keys','filters','intersection','fields','attributes'];(function(_0x3a58f7,_0x115127){var _0x130b5d=function(_0x558c15){while(--_0x558c15){_0x3a58f7['push'](_0x3a58f7['shift']());}};_0x130b5d(++_0x115127);}(_0xa299,0x1b1));var _0x9a29=function(_0x171fb6,_0xe9a7f8){_0x171fb6=_0x171fb6-0x0;var _0x5346ad=_0xa299[_0x171fb6];return _0x5346ad;};'use strict';var emlformat=require(_0x9a29('0x0'));var rimraf=require(_0x9a29('0x1'));var zipdir=require(_0x9a29('0x2'));var jsonpatch=require(_0x9a29('0x3'));var rp=require(_0x9a29('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9a29('0x5'));var util=require(_0x9a29('0x6'));var path=require(_0x9a29('0x7'));var sox=require(_0x9a29('0x8'));var csv=require(_0x9a29('0x9'));var ejs=require(_0x9a29('0xa'));var fs=require('fs');var fs_extra=require(_0x9a29('0xb'));var _=require(_0x9a29('0xc'));var squel=require(_0x9a29('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9a29('0xe'));var toCsv=require(_0x9a29('0x9'));var querystring=require('querystring');var Papa=require(_0x9a29('0xf'));var Redis=require(_0x9a29('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9a29('0x11'));var as=require(_0x9a29('0x12'));var hardwareService=require(_0x9a29('0x13'));var logger=require(_0x9a29('0x14'))(_0x9a29('0x15'));var utils=require(_0x9a29('0x16'));var config=require(_0x9a29('0x17'));var licenseUtil=require(_0x9a29('0x18'));var db=require(_0x9a29('0x19'))['db'];function respondWithStatusCode(_0x166e7a,_0xf1d127){_0xf1d127=_0xf1d127||0xcc;return function(_0x5cfb0c){if(_0x5cfb0c){return _0x166e7a[_0x9a29('0x1a')](_0xf1d127);}return _0x166e7a[_0x9a29('0x1b')](_0xf1d127)[_0x9a29('0x1c')]();};}function respondWithResult(_0x5818ac,_0x413658){_0x413658=_0x413658||0xc8;return function(_0x4ed1f5){if(_0x4ed1f5){return _0x5818ac['status'](_0x413658)['json'](_0x4ed1f5);}};}function respondWithFilteredResult(_0x2df641,_0x3d9189){return function(_0x3f1d6f){if(_0x3f1d6f){var _0x1474fa=typeof _0x3d9189[_0x9a29('0x1d')]===_0x9a29('0x1e')&&typeof _0x3d9189[_0x9a29('0x1f')]===_0x9a29('0x1e');var _0x22be63=_0x3f1d6f[_0x9a29('0x20')];var _0x33669c=_0x1474fa?0x0:_0x3d9189[_0x9a29('0x1d')];var _0x551600=_0x1474fa?_0x3f1d6f['count']:_0x3d9189[_0x9a29('0x1d')]+_0x3d9189['limit'];var _0x4da2a7;if(_0x551600>=_0x22be63){_0x551600=_0x22be63;_0x4da2a7=0xc8;}else{_0x4da2a7=0xce;}_0x2df641[_0x9a29('0x1b')](_0x4da2a7);return _0x2df641[_0x9a29('0x21')]('Content-Range',_0x33669c+'-'+_0x551600+'/'+_0x22be63)[_0x9a29('0x22')](_0x3f1d6f);}return null;};}function patchUpdates(_0x3f7107){return function(_0x3002e4){try{jsonpatch[_0x9a29('0x23')](_0x3002e4,_0x3f7107,!![]);}catch(_0x121db8){return BPromise[_0x9a29('0x24')](_0x121db8);}return _0x3002e4[_0x9a29('0x25')]();};}function saveUpdates(_0x210d28,_0x47b875){return function(_0x5a30f8){if(_0x5a30f8){return _0x5a30f8['update'](_0x210d28)['then'](function(_0x2b6a5b){return _0x2b6a5b;});}return null;};}function removeEntity(_0x304964,_0x91c9d5){return function(_0x50fe0f){if(_0x50fe0f){return _0x50fe0f[_0x9a29('0x26')]()[_0x9a29('0x27')](function(){_0x304964[_0x9a29('0x1b')](0xcc)[_0x9a29('0x1c')]();});}};}function handleEntityNotFound(_0x3d45f7,_0xec1656){return function(_0x5e3167){if(!_0x5e3167){_0x3d45f7['sendStatus'](0x194);}return _0x5e3167;};}function handleError(_0x57fb5e,_0x464f0a){_0x464f0a=_0x464f0a||0x1f4;return function(_0x2cf538){logger[_0x9a29('0x28')](_0x2cf538[_0x9a29('0x29')]);if(_0x2cf538[_0x9a29('0x2a')]){delete _0x2cf538['name'];}_0x57fb5e[_0x9a29('0x1b')](_0x464f0a)['send'](_0x2cf538);};}exports['index']=function(_0x4a656b,_0x89dbe8){var _0xedbf5a={},_0xbd490a={},_0x1cbed6={'count':0x0,'rows':[]};var _0x14d614=_[_0x9a29('0x2b')](db[_0x9a29('0x2c')]['rawAttributes'],function(_0x15ff00){return{'name':_0x15ff00['fieldName'],'type':_0x15ff00[_0x9a29('0x2d')]['key']};});_0xbd490a[_0x9a29('0x2e')]=_['map'](_0x14d614,_0x9a29('0x2a'));_0xbd490a[_0x9a29('0x2f')]=_[_0x9a29('0x30')](_0x4a656b['query']);_0xbd490a[_0x9a29('0x31')]=_[_0x9a29('0x32')](_0xbd490a[_0x9a29('0x2e')],_0xbd490a[_0x9a29('0x2f')]);_0xedbf5a['attributes']=_['intersection'](_0xbd490a[_0x9a29('0x2e')],qs['fields'](_0x4a656b[_0x9a29('0x2f')][_0x9a29('0x33')]));_0xedbf5a[_0x9a29('0x34')]=_0xedbf5a['attributes'][_0x9a29('0x35')]?_0xedbf5a[_0x9a29('0x34')]:_0xbd490a[_0x9a29('0x2e')];if(!_0x4a656b['query'][_0x9a29('0x36')]('nolimit')){_0xedbf5a[_0x9a29('0x1f')]=qs[_0x9a29('0x1f')](_0x4a656b[_0x9a29('0x2f')][_0x9a29('0x1f')]);_0xedbf5a[_0x9a29('0x1d')]=qs[_0x9a29('0x1d')](_0x4a656b[_0x9a29('0x2f')][_0x9a29('0x1d')]);}_0xedbf5a[_0x9a29('0x37')]=qs[_0x9a29('0x38')](_0x4a656b[_0x9a29('0x2f')][_0x9a29('0x38')]);_0xedbf5a['where']=qs[_0x9a29('0x31')](_[_0x9a29('0x39')](_0x4a656b[_0x9a29('0x2f')],_0xbd490a[_0x9a29('0x31')]),_0x14d614);if(_0x4a656b[_0x9a29('0x2f')][_0x9a29('0x3a')]){_0xedbf5a['where']=_[_0x9a29('0x3b')](_0xedbf5a[_0x9a29('0x3c')],{'$or':_[_0x9a29('0x2b')](_0x14d614,function(_0x1c96b3){if(_0x1c96b3[_0x9a29('0x2d')]!==_0x9a29('0x3d')){var _0x102d00={};_0x102d00[_0x1c96b3['name']]={'$like':'%'+_0x4a656b[_0x9a29('0x2f')][_0x9a29('0x3a')]+'%'};return _0x102d00;}})});}_0xedbf5a=_[_0x9a29('0x3b')]({},_0xedbf5a,_0x4a656b[_0x9a29('0x3e')]);var _0x1007a6={'where':_0xedbf5a['where']};return db[_0x9a29('0x2c')][_0x9a29('0x20')](_0x1007a6)['then'](function(_0x513312){_0x1cbed6[_0x9a29('0x20')]=_0x513312;if(_0x4a656b[_0x9a29('0x2f')]['includeAll']){_0xedbf5a[_0x9a29('0x3f')]=[{'all':!![]}];}return db[_0x9a29('0x2c')][_0x9a29('0x40')](_0xedbf5a);})[_0x9a29('0x27')](function(_0x5306be){_0x1cbed6['rows']=_0x5306be;return _0x1cbed6;})['then'](respondWithFilteredResult(_0x89dbe8,_0xedbf5a))['catch'](handleError(_0x89dbe8,null));};exports[_0x9a29('0x41')]=function(_0x29cb14,_0x32e739){var _0x45b807={'raw':![],'where':{'id':_0x29cb14[_0x9a29('0x42')]['id']}},_0x984b82={};_0x984b82['model']=_[_0x9a29('0x30')](db['DeskConfiguration'][_0x9a29('0x43')]);_0x984b82[_0x9a29('0x2f')]=_[_0x9a29('0x30')](_0x29cb14[_0x9a29('0x2f')]);_0x984b82['filters']=_[_0x9a29('0x32')](_0x984b82['model'],_0x984b82['query']);_0x45b807['attributes']=_[_0x9a29('0x32')](_0x984b82['model'],qs[_0x9a29('0x33')](_0x29cb14[_0x9a29('0x2f')][_0x9a29('0x33')]));_0x45b807[_0x9a29('0x34')]=_0x45b807['attributes'][_0x9a29('0x35')]?_0x45b807[_0x9a29('0x34')]:_0x984b82[_0x9a29('0x2e')];if(_0x29cb14[_0x9a29('0x2f')][_0x9a29('0x44')]){_0x45b807['include']=[{'all':!![]}];}_0x45b807=_[_0x9a29('0x3b')]({},_0x45b807,_0x29cb14['options']);return db[_0x9a29('0x2c')]['find'](_0x45b807)[_0x9a29('0x27')](handleEntityNotFound(_0x32e739,null))[_0x9a29('0x27')](respondWithResult(_0x32e739,null))[_0x9a29('0x45')](handleError(_0x32e739,null));};exports[_0x9a29('0x46')]=function(_0x361dd4,_0x4bfa84){return db[_0x9a29('0x2c')][_0x9a29('0x46')](_0x361dd4[_0x9a29('0x47')],{})['then'](respondWithResult(_0x4bfa84,0xc9))[_0x9a29('0x45')](handleError(_0x4bfa84,null));};exports['update']=function(_0x55159b,_0x2ad882){if(_0x55159b[_0x9a29('0x47')]['id']){delete _0x55159b['body']['id'];}return db['DeskConfiguration'][_0x9a29('0x48')]({'where':{'id':_0x55159b['params']['id']}})['then'](handleEntityNotFound(_0x2ad882,null))[_0x9a29('0x27')](saveUpdates(_0x55159b['body'],null))[_0x9a29('0x27')](respondWithResult(_0x2ad882,null))[_0x9a29('0x45')](handleError(_0x2ad882,null));};exports[_0x9a29('0x26')]=function(_0x2d9a10,_0x2362a7){return db[_0x9a29('0x2c')][_0x9a29('0x48')]({'where':{'id':_0x2d9a10[_0x9a29('0x42')]['id']}})[_0x9a29('0x27')](handleEntityNotFound(_0x2362a7,null))['then'](removeEntity(_0x2362a7,null))[_0x9a29('0x45')](handleError(_0x2362a7,null));};exports[_0x9a29('0x49')]=function(_0x286920,_0x2c5727,_0x356eb6){var _0x2f71e9={};var _0x21430b={};var _0x372d0a;var _0x4a887f;return db[_0x9a29('0x2c')][_0x9a29('0x4a')]({'where':{'id':_0x286920[_0x9a29('0x42')]['id']}})['then'](handleEntityNotFound(_0x2c5727,null))[_0x9a29('0x27')](function(_0x47c842){if(_0x47c842){_0x372d0a=_0x47c842;_0x21430b[_0x9a29('0x2e')]=_[_0x9a29('0x30')](db[_0x9a29('0x4b')]['rawAttributes']);_0x21430b['query']=_[_0x9a29('0x30')](_0x286920['query']);_0x21430b[_0x9a29('0x31')]=_[_0x9a29('0x32')](_0x21430b['model'],_0x21430b[_0x9a29('0x2f')]);_0x2f71e9[_0x9a29('0x34')]=_['intersection'](_0x21430b['model'],qs[_0x9a29('0x33')](_0x286920['query'][_0x9a29('0x33')]));_0x2f71e9[_0x9a29('0x34')]=_0x2f71e9[_0x9a29('0x34')][_0x9a29('0x35')]?_0x2f71e9['attributes']:_0x21430b[_0x9a29('0x2e')];_0x2f71e9[_0x9a29('0x37')]=qs[_0x9a29('0x38')](_0x286920[_0x9a29('0x2f')][_0x9a29('0x38')]);_0x2f71e9[_0x9a29('0x3c')]=qs[_0x9a29('0x31')](_[_0x9a29('0x39')](_0x286920['query'],_0x21430b[_0x9a29('0x31')]));if(_0x286920[_0x9a29('0x2f')]['filter']){_0x2f71e9[_0x9a29('0x3c')]=_['merge'](_0x2f71e9[_0x9a29('0x3c')],{'$or':_['map'](_0x2f71e9['attributes'],function(_0x1d7a87){var _0x36913f={};_0x36913f[_0x1d7a87]={'$like':'%'+_0x286920[_0x9a29('0x2f')]['filter']+'%'};return _0x36913f;})});}_0x2f71e9=_[_0x9a29('0x3b')]({},_0x2f71e9,_0x286920[_0x9a29('0x3e')]);return _0x372d0a[_0x9a29('0x49')](_0x2f71e9);}})['then'](function(_0x5b5033){if(_0x5b5033){_0x4a887f=_0x5b5033[_0x9a29('0x35')];if(!_0x286920[_0x9a29('0x2f')][_0x9a29('0x36')](_0x9a29('0x4c'))){_0x2f71e9[_0x9a29('0x1f')]=qs[_0x9a29('0x1f')](_0x286920[_0x9a29('0x2f')][_0x9a29('0x1f')]);_0x2f71e9[_0x9a29('0x1d')]=qs[_0x9a29('0x1d')](_0x286920[_0x9a29('0x2f')][_0x9a29('0x1d')]);}return _0x372d0a[_0x9a29('0x49')](_0x2f71e9);}})[_0x9a29('0x27')](function(_0x224517){if(_0x224517){return _0x224517?{'count':_0x4a887f,'rows':_0x224517}:null;}})['then'](respondWithResult(_0x2c5727,null))[_0x9a29('0x45')](handleError(_0x2c5727,null));};exports['getSubjects']=function(_0x532854,_0x5b1d1c,_0xe31b4f){var _0x4a303c={};var _0x28baa2={};var _0x25a6bd;var _0x10321a;return db[_0x9a29('0x2c')][_0x9a29('0x4a')]({'where':{'id':_0x532854[_0x9a29('0x42')]['id']}})[_0x9a29('0x27')](handleEntityNotFound(_0x5b1d1c,null))['then'](function(_0x519bd2){if(_0x519bd2){_0x25a6bd=_0x519bd2;_0x28baa2[_0x9a29('0x2e')]=_[_0x9a29('0x30')](db[_0x9a29('0x4b')][_0x9a29('0x43')]);_0x28baa2['query']=_[_0x9a29('0x30')](_0x532854['query']);_0x28baa2[_0x9a29('0x31')]=_[_0x9a29('0x32')](_0x28baa2[_0x9a29('0x2e')],_0x28baa2[_0x9a29('0x2f')]);_0x4a303c['attributes']=_['intersection'](_0x28baa2['model'],qs[_0x9a29('0x33')](_0x532854[_0x9a29('0x2f')]['fields']));_0x4a303c['attributes']=_0x4a303c['attributes'][_0x9a29('0x35')]?_0x4a303c[_0x9a29('0x34')]:_0x28baa2[_0x9a29('0x2e')];_0x4a303c['order']=qs[_0x9a29('0x38')](_0x532854['query'][_0x9a29('0x38')]);_0x4a303c[_0x9a29('0x3c')]=qs[_0x9a29('0x31')](_[_0x9a29('0x39')](_0x532854[_0x9a29('0x2f')],_0x28baa2[_0x9a29('0x31')]));if(_0x532854[_0x9a29('0x2f')]['filter']){_0x4a303c[_0x9a29('0x3c')]=_[_0x9a29('0x3b')](_0x4a303c[_0x9a29('0x3c')],{'$or':_[_0x9a29('0x2b')](_0x4a303c['attributes'],function(_0x1ecb46){var _0x5f38f3={};_0x5f38f3[_0x1ecb46]={'$like':'%'+_0x532854['query'][_0x9a29('0x3a')]+'%'};return _0x5f38f3;})});}_0x4a303c=_[_0x9a29('0x3b')]({},_0x4a303c,_0x532854[_0x9a29('0x3e')]);return _0x25a6bd[_0x9a29('0x4d')](_0x4a303c);}})[_0x9a29('0x27')](function(_0x1fe1aa){if(_0x1fe1aa){_0x10321a=_0x1fe1aa[_0x9a29('0x35')];if(!_0x532854['query'][_0x9a29('0x36')](_0x9a29('0x4c'))){_0x4a303c[_0x9a29('0x1f')]=qs[_0x9a29('0x1f')](_0x532854['query'][_0x9a29('0x1f')]);_0x4a303c[_0x9a29('0x1d')]=qs[_0x9a29('0x1d')](_0x532854['query'][_0x9a29('0x1d')]);}return _0x25a6bd[_0x9a29('0x4d')](_0x4a303c);}})[_0x9a29('0x27')](function(_0x44337c){if(_0x44337c){return _0x44337c?{'count':_0x10321a,'rows':_0x44337c}:null;}})[_0x9a29('0x27')](respondWithResult(_0x5b1d1c,null))['catch'](handleError(_0x5b1d1c,null));};exports['getDescriptions']=function(_0x40f474,_0x24d611,_0x45d0fe){var _0x6877c1={};var _0x3a66c8={};var _0x3826ee;var _0x3d72c6;return db['DeskConfiguration'][_0x9a29('0x4a')]({'where':{'id':_0x40f474[_0x9a29('0x42')]['id']}})['then'](handleEntityNotFound(_0x24d611,null))['then'](function(_0x43682d){if(_0x43682d){_0x3826ee=_0x43682d;_0x3a66c8[_0x9a29('0x2e')]=_[_0x9a29('0x30')](db[_0x9a29('0x4b')][_0x9a29('0x43')]);_0x3a66c8[_0x9a29('0x2f')]=_[_0x9a29('0x30')](_0x40f474[_0x9a29('0x2f')]);_0x3a66c8[_0x9a29('0x31')]=_['intersection'](_0x3a66c8[_0x9a29('0x2e')],_0x3a66c8[_0x9a29('0x2f')]);_0x6877c1[_0x9a29('0x34')]=_[_0x9a29('0x32')](_0x3a66c8[_0x9a29('0x2e')],qs['fields'](_0x40f474[_0x9a29('0x2f')][_0x9a29('0x33')]));_0x6877c1['attributes']=_0x6877c1['attributes'][_0x9a29('0x35')]?_0x6877c1['attributes']:_0x3a66c8['model'];_0x6877c1[_0x9a29('0x37')]=qs[_0x9a29('0x38')](_0x40f474[_0x9a29('0x2f')][_0x9a29('0x38')]);_0x6877c1[_0x9a29('0x3c')]=qs[_0x9a29('0x31')](_[_0x9a29('0x39')](_0x40f474['query'],_0x3a66c8[_0x9a29('0x31')]));if(_0x40f474['query'][_0x9a29('0x3a')]){_0x6877c1[_0x9a29('0x3c')]=_[_0x9a29('0x3b')](_0x6877c1[_0x9a29('0x3c')],{'$or':_[_0x9a29('0x2b')](_0x6877c1[_0x9a29('0x34')],function(_0x5ec701){var _0x165751={};_0x165751[_0x5ec701]={'$like':'%'+_0x40f474[_0x9a29('0x2f')][_0x9a29('0x3a')]+'%'};return _0x165751;})});}_0x6877c1=_['merge']({},_0x6877c1,_0x40f474[_0x9a29('0x3e')]);return _0x3826ee['getDescriptions'](_0x6877c1);}})['then'](function(_0x5e8122){if(_0x5e8122){_0x3d72c6=_0x5e8122[_0x9a29('0x35')];if(!_0x40f474[_0x9a29('0x2f')][_0x9a29('0x36')](_0x9a29('0x4c'))){_0x6877c1[_0x9a29('0x1f')]=qs[_0x9a29('0x1f')](_0x40f474['query'][_0x9a29('0x1f')]);_0x6877c1[_0x9a29('0x1d')]=qs[_0x9a29('0x1d')](_0x40f474['query']['offset']);}return _0x3826ee['getDescriptions'](_0x6877c1);}})['then'](function(_0x11ab19){if(_0x11ab19){return _0x11ab19?{'count':_0x3d72c6,'rows':_0x11ab19}:null;}})[_0x9a29('0x27')](respondWithResult(_0x24d611,null))[_0x9a29('0x45')](handleError(_0x24d611,null));};exports[_0x9a29('0x4e')]=function(_0x1517b6,_0x3e773b,_0x19aac1){var _0x27ba91={};var _0x29c65a={};var _0x4ace8a;var _0x34f03f;return db['DeskConfiguration'][_0x9a29('0x4a')]({'where':{'id':_0x1517b6[_0x9a29('0x42')]['id']}})['then'](handleEntityNotFound(_0x3e773b,null))[_0x9a29('0x27')](function(_0x4531a1){if(_0x4531a1){_0x4ace8a=_0x4531a1;_0x29c65a[_0x9a29('0x2e')]=_[_0x9a29('0x30')](db['Tag'][_0x9a29('0x43')]);_0x29c65a[_0x9a29('0x2f')]=_[_0x9a29('0x30')](_0x1517b6[_0x9a29('0x2f')]);_0x29c65a['filters']=_[_0x9a29('0x32')](_0x29c65a[_0x9a29('0x2e')],_0x29c65a[_0x9a29('0x2f')]);_0x27ba91[_0x9a29('0x34')]=_['intersection'](_0x29c65a[_0x9a29('0x2e')],qs['fields'](_0x1517b6[_0x9a29('0x2f')][_0x9a29('0x33')]));_0x27ba91[_0x9a29('0x34')]=_0x27ba91[_0x9a29('0x34')][_0x9a29('0x35')]?_0x27ba91[_0x9a29('0x34')]:_0x29c65a[_0x9a29('0x2e')];_0x27ba91[_0x9a29('0x37')]=qs[_0x9a29('0x38')](_0x1517b6[_0x9a29('0x2f')]['sort']);_0x27ba91[_0x9a29('0x3c')]=qs['filters'](_[_0x9a29('0x39')](_0x1517b6[_0x9a29('0x2f')],_0x29c65a['filters']));if(_0x1517b6[_0x9a29('0x2f')][_0x9a29('0x3a')]){_0x27ba91[_0x9a29('0x3c')]=_[_0x9a29('0x3b')](_0x27ba91['where'],{'$or':_[_0x9a29('0x2b')](_0x27ba91[_0x9a29('0x34')],function(_0x56c7be){var _0x560e11={};_0x560e11[_0x56c7be]={'$like':'%'+_0x1517b6[_0x9a29('0x2f')]['filter']+'%'};return _0x560e11;})});}_0x27ba91=_['merge']({},_0x27ba91,_0x1517b6[_0x9a29('0x3e')]);return _0x4ace8a[_0x9a29('0x4e')](_0x27ba91);}})['then'](function(_0x2d8e8f){if(_0x2d8e8f){_0x34f03f=_0x2d8e8f['length'];if(!_0x1517b6['query'][_0x9a29('0x36')](_0x9a29('0x4c'))){_0x27ba91[_0x9a29('0x1f')]=qs[_0x9a29('0x1f')](_0x1517b6[_0x9a29('0x2f')][_0x9a29('0x1f')]);_0x27ba91['offset']=qs['offset'](_0x1517b6[_0x9a29('0x2f')][_0x9a29('0x1d')]);}return _0x4ace8a[_0x9a29('0x4e')](_0x27ba91);}})[_0x9a29('0x27')](function(_0x5c6061){if(_0x5c6061){return _0x5c6061?{'count':_0x34f03f,'rows':_0x5c6061}:null;}})[_0x9a29('0x27')](respondWithResult(_0x3e773b,null))[_0x9a29('0x45')](handleError(_0x3e773b,null));};exports['setTags']=function(_0x3d6284,_0x7b18b0,_0x4c203f){if(_0x3d6284[_0x9a29('0x47')]['id']){delete _0x3d6284[_0x9a29('0x47')]['id'];}return db[_0x9a29('0x2c')][_0x9a29('0x4a')]({'where':{'id':_0x3d6284['params']['id']}})[_0x9a29('0x27')](handleEntityNotFound(_0x7b18b0,null))[_0x9a29('0x27')](function(_0x1c43cc){if(_0x1c43cc){return _0x1c43cc[_0x9a29('0x4f')](_0x3d6284['body'][_0x9a29('0x50')]||[]);}return null;})[_0x9a29('0x27')](respondWithResult(_0x7b18b0,null))[_0x9a29('0x45')](handleError(_0x7b18b0,null));}; \ No newline at end of file +var _0xf895=['rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','DeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','options','find','create','body','getFields','findOne','hasOwnProperty','getSubjects','DeskField','getDescriptions','Tag','getTags','setTags','ids','eml-format'];(function(_0x489850,_0x23462d){var _0x3a3032=function(_0x18832b){while(--_0x18832b){_0x489850['push'](_0x489850['shift']());}};_0x3a3032(++_0x23462d);}(_0xf895,0xfe));var _0x5f89=function(_0x1e0f80,_0x1aa550){_0x1e0f80=_0x1e0f80-0x0;var _0x326085=_0xf895[_0x1e0f80];return _0x326085;};'use strict';var emlformat=require(_0x5f89('0x0'));var rimraf=require(_0x5f89('0x1'));var zipdir=require(_0x5f89('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5f89('0x3'));var BPromise=require(_0x5f89('0x4'));var Mustache=require('mustache');var util=require(_0x5f89('0x5'));var path=require(_0x5f89('0x6'));var sox=require(_0x5f89('0x7'));var csv=require(_0x5f89('0x8'));var ejs=require(_0x5f89('0x9'));var fs=require('fs');var fs_extra=require(_0x5f89('0xa'));var _=require(_0x5f89('0xb'));var squel=require(_0x5f89('0xc'));var crypto=require(_0x5f89('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5f89('0xe'));var toCsv=require(_0x5f89('0x8'));var querystring=require(_0x5f89('0xf'));var Papa=require('papaparse');var Redis=require(_0x5f89('0x10'));var authService=require(_0x5f89('0x11'));var qs=require(_0x5f89('0x12'));var as=require(_0x5f89('0x13'));var hardwareService=require(_0x5f89('0x14'));var logger=require(_0x5f89('0x15'))(_0x5f89('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x502803,_0x2baaf2){_0x2baaf2=_0x2baaf2||0xcc;return function(_0x3f2370){if(_0x3f2370){return _0x502803[_0x5f89('0x17')](_0x2baaf2);}return _0x502803[_0x5f89('0x18')](_0x2baaf2)[_0x5f89('0x19')]();};}function respondWithResult(_0x560ded,_0x2d7a4b){_0x2d7a4b=_0x2d7a4b||0xc8;return function(_0x3a89c5){if(_0x3a89c5){return _0x560ded[_0x5f89('0x18')](_0x2d7a4b)[_0x5f89('0x1a')](_0x3a89c5);}};}function respondWithFilteredResult(_0x3860fd,_0x1d3c00){return function(_0x3b055f){if(_0x3b055f){var _0x481d1c=typeof _0x1d3c00['offset']===_0x5f89('0x1b')&&typeof _0x1d3c00[_0x5f89('0x1c')]==='undefined';var _0x5f177e=_0x3b055f[_0x5f89('0x1d')];var _0x37ac53=_0x481d1c?0x0:_0x1d3c00[_0x5f89('0x1e')];var _0x187d89=_0x481d1c?_0x3b055f['count']:_0x1d3c00[_0x5f89('0x1e')]+_0x1d3c00[_0x5f89('0x1c')];var _0x4acc91;if(_0x187d89>=_0x5f177e){_0x187d89=_0x5f177e;_0x4acc91=0xc8;}else{_0x4acc91=0xce;}_0x3860fd[_0x5f89('0x18')](_0x4acc91);return _0x3860fd[_0x5f89('0x1f')]('Content-Range',_0x37ac53+'-'+_0x187d89+'/'+_0x5f177e)[_0x5f89('0x1a')](_0x3b055f);}return null;};}function patchUpdates(_0x48dead){return function(_0x89aafd){try{jsonpatch[_0x5f89('0x20')](_0x89aafd,_0x48dead,!![]);}catch(_0xd787c1){return BPromise[_0x5f89('0x21')](_0xd787c1);}return _0x89aafd[_0x5f89('0x22')]();};}function saveUpdates(_0x1117a4,_0x4169ee){return function(_0x1e1a63){if(_0x1e1a63){return _0x1e1a63[_0x5f89('0x23')](_0x1117a4)[_0x5f89('0x24')](function(_0x2ffc0d){return _0x2ffc0d;});}return null;};}function removeEntity(_0x149c76,_0x1fc0c8){return function(_0x1e64d3){if(_0x1e64d3){return _0x1e64d3[_0x5f89('0x25')]()[_0x5f89('0x24')](function(){_0x149c76[_0x5f89('0x18')](0xcc)[_0x5f89('0x19')]();});}};}function handleEntityNotFound(_0x31a8ea,_0x2a4977){return function(_0x14a266){if(!_0x14a266){_0x31a8ea[_0x5f89('0x17')](0x194);}return _0x14a266;};}function handleError(_0x6c57dd,_0x16bd0f){_0x16bd0f=_0x16bd0f||0x1f4;return function(_0x207171){logger[_0x5f89('0x26')](_0x207171[_0x5f89('0x27')]);if(_0x207171[_0x5f89('0x28')]){delete _0x207171['name'];}_0x6c57dd['status'](_0x16bd0f)[_0x5f89('0x29')](_0x207171);};}exports[_0x5f89('0x2a')]=function(_0x4d9249,_0x289569){var _0x264615={},_0x5643a8={},_0x15341a={'count':0x0,'rows':[]};var _0x2ff3f2=_[_0x5f89('0x2b')](db[_0x5f89('0x2c')][_0x5f89('0x2d')],function(_0x1bf4d1){return{'name':_0x1bf4d1[_0x5f89('0x2e')],'type':_0x1bf4d1[_0x5f89('0x2f')][_0x5f89('0x30')]};});_0x5643a8[_0x5f89('0x31')]=_['map'](_0x2ff3f2,'name');_0x5643a8[_0x5f89('0x32')]=_[_0x5f89('0x33')](_0x4d9249[_0x5f89('0x32')]);_0x5643a8[_0x5f89('0x34')]=_[_0x5f89('0x35')](_0x5643a8[_0x5f89('0x31')],_0x5643a8['query']);_0x264615['attributes']=_[_0x5f89('0x35')](_0x5643a8[_0x5f89('0x31')],qs[_0x5f89('0x36')](_0x4d9249[_0x5f89('0x32')][_0x5f89('0x36')]));_0x264615[_0x5f89('0x37')]=_0x264615[_0x5f89('0x37')][_0x5f89('0x38')]?_0x264615['attributes']:_0x5643a8[_0x5f89('0x31')];if(!_0x4d9249[_0x5f89('0x32')]['hasOwnProperty'](_0x5f89('0x39'))){_0x264615[_0x5f89('0x1c')]=qs['limit'](_0x4d9249[_0x5f89('0x32')][_0x5f89('0x1c')]);_0x264615[_0x5f89('0x1e')]=qs[_0x5f89('0x1e')](_0x4d9249[_0x5f89('0x32')][_0x5f89('0x1e')]);}_0x264615[_0x5f89('0x3a')]=qs[_0x5f89('0x3b')](_0x4d9249[_0x5f89('0x32')][_0x5f89('0x3b')]);_0x264615[_0x5f89('0x3c')]=qs[_0x5f89('0x34')](_[_0x5f89('0x3d')](_0x4d9249['query'],_0x5643a8['filters']),_0x2ff3f2);if(_0x4d9249[_0x5f89('0x32')][_0x5f89('0x3e')]){_0x264615[_0x5f89('0x3c')]=_[_0x5f89('0x3f')](_0x264615[_0x5f89('0x3c')],{'$or':_[_0x5f89('0x2b')](_0x2ff3f2,function(_0x5c516c){if(_0x5c516c[_0x5f89('0x2f')]!==_0x5f89('0x40')){var _0x3c2fec={};_0x3c2fec[_0x5c516c[_0x5f89('0x28')]]={'$like':'%'+_0x4d9249[_0x5f89('0x32')]['filter']+'%'};return _0x3c2fec;}})});}_0x264615=_[_0x5f89('0x3f')]({},_0x264615,_0x4d9249['options']);var _0x45756f={'where':_0x264615['where']};return db['DeskConfiguration'][_0x5f89('0x1d')](_0x45756f)[_0x5f89('0x24')](function(_0x3bfdcc){_0x15341a['count']=_0x3bfdcc;if(_0x4d9249[_0x5f89('0x32')][_0x5f89('0x41')]){_0x264615[_0x5f89('0x42')]=[{'all':!![]}];}return db[_0x5f89('0x2c')]['findAll'](_0x264615);})[_0x5f89('0x24')](function(_0x5c18a7){_0x15341a[_0x5f89('0x43')]=_0x5c18a7;return _0x15341a;})['then'](respondWithFilteredResult(_0x289569,_0x264615))[_0x5f89('0x44')](handleError(_0x289569,null));};exports[_0x5f89('0x45')]=function(_0x52f841,_0xa6ec8d){var _0x3e4557={'raw':![],'where':{'id':_0x52f841[_0x5f89('0x46')]['id']}},_0x35e47f={};_0x35e47f[_0x5f89('0x31')]=_[_0x5f89('0x33')](db[_0x5f89('0x2c')][_0x5f89('0x2d')]);_0x35e47f[_0x5f89('0x32')]=_['keys'](_0x52f841['query']);_0x35e47f[_0x5f89('0x34')]=_[_0x5f89('0x35')](_0x35e47f[_0x5f89('0x31')],_0x35e47f[_0x5f89('0x32')]);_0x3e4557[_0x5f89('0x37')]=_[_0x5f89('0x35')](_0x35e47f[_0x5f89('0x31')],qs['fields'](_0x52f841[_0x5f89('0x32')]['fields']));_0x3e4557['attributes']=_0x3e4557['attributes'][_0x5f89('0x38')]?_0x3e4557[_0x5f89('0x37')]:_0x35e47f[_0x5f89('0x31')];if(_0x52f841[_0x5f89('0x32')][_0x5f89('0x41')]){_0x3e4557[_0x5f89('0x42')]=[{'all':!![]}];}_0x3e4557=_[_0x5f89('0x3f')]({},_0x3e4557,_0x52f841[_0x5f89('0x47')]);return db[_0x5f89('0x2c')][_0x5f89('0x48')](_0x3e4557)[_0x5f89('0x24')](handleEntityNotFound(_0xa6ec8d,null))[_0x5f89('0x24')](respondWithResult(_0xa6ec8d,null))[_0x5f89('0x44')](handleError(_0xa6ec8d,null));};exports[_0x5f89('0x49')]=function(_0x987810,_0x43dba8){return db[_0x5f89('0x2c')][_0x5f89('0x49')](_0x987810['body'],{})[_0x5f89('0x24')](respondWithResult(_0x43dba8,0xc9))[_0x5f89('0x44')](handleError(_0x43dba8,null));};exports[_0x5f89('0x23')]=function(_0x5b961b,_0x395d9f){if(_0x5b961b['body']['id']){delete _0x5b961b[_0x5f89('0x4a')]['id'];}return db[_0x5f89('0x2c')]['find']({'where':{'id':_0x5b961b[_0x5f89('0x46')]['id']}})[_0x5f89('0x24')](handleEntityNotFound(_0x395d9f,null))[_0x5f89('0x24')](saveUpdates(_0x5b961b[_0x5f89('0x4a')],null))[_0x5f89('0x24')](respondWithResult(_0x395d9f,null))[_0x5f89('0x44')](handleError(_0x395d9f,null));};exports[_0x5f89('0x25')]=function(_0x3eba8b,_0x4ae017){return db[_0x5f89('0x2c')]['find']({'where':{'id':_0x3eba8b[_0x5f89('0x46')]['id']}})['then'](handleEntityNotFound(_0x4ae017,null))['then'](removeEntity(_0x4ae017,null))[_0x5f89('0x44')](handleError(_0x4ae017,null));};exports[_0x5f89('0x4b')]=function(_0xfed50,_0xb8b3e8,_0x478d2a){var _0x228369={};var _0x5e8e2a={};var _0x230802;var _0x591bc2;return db[_0x5f89('0x2c')][_0x5f89('0x4c')]({'where':{'id':_0xfed50[_0x5f89('0x46')]['id']}})['then'](handleEntityNotFound(_0xb8b3e8,null))[_0x5f89('0x24')](function(_0x558cb8){if(_0x558cb8){_0x230802=_0x558cb8;_0x5e8e2a[_0x5f89('0x31')]=_['keys'](db['DeskField'][_0x5f89('0x2d')]);_0x5e8e2a[_0x5f89('0x32')]=_['keys'](_0xfed50[_0x5f89('0x32')]);_0x5e8e2a['filters']=_[_0x5f89('0x35')](_0x5e8e2a[_0x5f89('0x31')],_0x5e8e2a['query']);_0x228369['attributes']=_[_0x5f89('0x35')](_0x5e8e2a[_0x5f89('0x31')],qs[_0x5f89('0x36')](_0xfed50[_0x5f89('0x32')][_0x5f89('0x36')]));_0x228369[_0x5f89('0x37')]=_0x228369[_0x5f89('0x37')][_0x5f89('0x38')]?_0x228369[_0x5f89('0x37')]:_0x5e8e2a[_0x5f89('0x31')];_0x228369[_0x5f89('0x3a')]=qs[_0x5f89('0x3b')](_0xfed50[_0x5f89('0x32')][_0x5f89('0x3b')]);_0x228369[_0x5f89('0x3c')]=qs[_0x5f89('0x34')](_[_0x5f89('0x3d')](_0xfed50['query'],_0x5e8e2a['filters']));if(_0xfed50[_0x5f89('0x32')][_0x5f89('0x3e')]){_0x228369[_0x5f89('0x3c')]=_['merge'](_0x228369['where'],{'$or':_['map'](_0x228369[_0x5f89('0x37')],function(_0x44223e){var _0x1f867b={};_0x1f867b[_0x44223e]={'$like':'%'+_0xfed50[_0x5f89('0x32')][_0x5f89('0x3e')]+'%'};return _0x1f867b;})});}_0x228369=_[_0x5f89('0x3f')]({},_0x228369,_0xfed50[_0x5f89('0x47')]);return _0x230802[_0x5f89('0x4b')](_0x228369);}})[_0x5f89('0x24')](function(_0x1c3da2){if(_0x1c3da2){_0x591bc2=_0x1c3da2[_0x5f89('0x38')];if(!_0xfed50['query'][_0x5f89('0x4d')]('nolimit')){_0x228369[_0x5f89('0x1c')]=qs[_0x5f89('0x1c')](_0xfed50['query'][_0x5f89('0x1c')]);_0x228369[_0x5f89('0x1e')]=qs[_0x5f89('0x1e')](_0xfed50[_0x5f89('0x32')][_0x5f89('0x1e')]);}return _0x230802['getFields'](_0x228369);}})[_0x5f89('0x24')](function(_0x1b5e37){if(_0x1b5e37){return _0x1b5e37?{'count':_0x591bc2,'rows':_0x1b5e37}:null;}})[_0x5f89('0x24')](respondWithResult(_0xb8b3e8,null))[_0x5f89('0x44')](handleError(_0xb8b3e8,null));};exports[_0x5f89('0x4e')]=function(_0x12cf21,_0x3135ee,_0x441382){var _0x34fb75={};var _0x103d1a={};var _0x47db76;var _0x36279e;return db[_0x5f89('0x2c')][_0x5f89('0x4c')]({'where':{'id':_0x12cf21[_0x5f89('0x46')]['id']}})['then'](handleEntityNotFound(_0x3135ee,null))[_0x5f89('0x24')](function(_0x248b9a){if(_0x248b9a){_0x47db76=_0x248b9a;_0x103d1a[_0x5f89('0x31')]=_[_0x5f89('0x33')](db[_0x5f89('0x4f')]['rawAttributes']);_0x103d1a[_0x5f89('0x32')]=_['keys'](_0x12cf21['query']);_0x103d1a[_0x5f89('0x34')]=_[_0x5f89('0x35')](_0x103d1a['model'],_0x103d1a['query']);_0x34fb75[_0x5f89('0x37')]=_['intersection'](_0x103d1a[_0x5f89('0x31')],qs[_0x5f89('0x36')](_0x12cf21['query'][_0x5f89('0x36')]));_0x34fb75[_0x5f89('0x37')]=_0x34fb75[_0x5f89('0x37')]['length']?_0x34fb75['attributes']:_0x103d1a['model'];_0x34fb75[_0x5f89('0x3a')]=qs['sort'](_0x12cf21[_0x5f89('0x32')][_0x5f89('0x3b')]);_0x34fb75[_0x5f89('0x3c')]=qs['filters'](_['pick'](_0x12cf21[_0x5f89('0x32')],_0x103d1a['filters']));if(_0x12cf21['query'][_0x5f89('0x3e')]){_0x34fb75[_0x5f89('0x3c')]=_[_0x5f89('0x3f')](_0x34fb75[_0x5f89('0x3c')],{'$or':_['map'](_0x34fb75[_0x5f89('0x37')],function(_0x150bd9){var _0x1e125c={};_0x1e125c[_0x150bd9]={'$like':'%'+_0x12cf21[_0x5f89('0x32')][_0x5f89('0x3e')]+'%'};return _0x1e125c;})});}_0x34fb75=_[_0x5f89('0x3f')]({},_0x34fb75,_0x12cf21[_0x5f89('0x47')]);return _0x47db76[_0x5f89('0x4e')](_0x34fb75);}})[_0x5f89('0x24')](function(_0x86f9e1){if(_0x86f9e1){_0x36279e=_0x86f9e1[_0x5f89('0x38')];if(!_0x12cf21[_0x5f89('0x32')][_0x5f89('0x4d')](_0x5f89('0x39'))){_0x34fb75[_0x5f89('0x1c')]=qs[_0x5f89('0x1c')](_0x12cf21[_0x5f89('0x32')][_0x5f89('0x1c')]);_0x34fb75[_0x5f89('0x1e')]=qs['offset'](_0x12cf21[_0x5f89('0x32')][_0x5f89('0x1e')]);}return _0x47db76[_0x5f89('0x4e')](_0x34fb75);}})[_0x5f89('0x24')](function(_0x1d0321){if(_0x1d0321){return _0x1d0321?{'count':_0x36279e,'rows':_0x1d0321}:null;}})['then'](respondWithResult(_0x3135ee,null))[_0x5f89('0x44')](handleError(_0x3135ee,null));};exports[_0x5f89('0x50')]=function(_0x4982e8,_0x2b11b8,_0x4e3588){var _0x2af7bb={};var _0x2a0b23={};var _0x244fb3;var _0x3714a0;return db[_0x5f89('0x2c')][_0x5f89('0x4c')]({'where':{'id':_0x4982e8[_0x5f89('0x46')]['id']}})['then'](handleEntityNotFound(_0x2b11b8,null))[_0x5f89('0x24')](function(_0x1e77f5){if(_0x1e77f5){_0x244fb3=_0x1e77f5;_0x2a0b23[_0x5f89('0x31')]=_[_0x5f89('0x33')](db[_0x5f89('0x4f')]['rawAttributes']);_0x2a0b23[_0x5f89('0x32')]=_[_0x5f89('0x33')](_0x4982e8[_0x5f89('0x32')]);_0x2a0b23[_0x5f89('0x34')]=_['intersection'](_0x2a0b23[_0x5f89('0x31')],_0x2a0b23[_0x5f89('0x32')]);_0x2af7bb[_0x5f89('0x37')]=_[_0x5f89('0x35')](_0x2a0b23[_0x5f89('0x31')],qs[_0x5f89('0x36')](_0x4982e8[_0x5f89('0x32')][_0x5f89('0x36')]));_0x2af7bb['attributes']=_0x2af7bb[_0x5f89('0x37')][_0x5f89('0x38')]?_0x2af7bb['attributes']:_0x2a0b23[_0x5f89('0x31')];_0x2af7bb[_0x5f89('0x3a')]=qs[_0x5f89('0x3b')](_0x4982e8[_0x5f89('0x32')][_0x5f89('0x3b')]);_0x2af7bb[_0x5f89('0x3c')]=qs[_0x5f89('0x34')](_[_0x5f89('0x3d')](_0x4982e8['query'],_0x2a0b23[_0x5f89('0x34')]));if(_0x4982e8[_0x5f89('0x32')][_0x5f89('0x3e')]){_0x2af7bb[_0x5f89('0x3c')]=_['merge'](_0x2af7bb[_0x5f89('0x3c')],{'$or':_[_0x5f89('0x2b')](_0x2af7bb[_0x5f89('0x37')],function(_0x5f36fc){var _0x18c008={};_0x18c008[_0x5f36fc]={'$like':'%'+_0x4982e8[_0x5f89('0x32')][_0x5f89('0x3e')]+'%'};return _0x18c008;})});}_0x2af7bb=_[_0x5f89('0x3f')]({},_0x2af7bb,_0x4982e8['options']);return _0x244fb3[_0x5f89('0x50')](_0x2af7bb);}})[_0x5f89('0x24')](function(_0x368bf7){if(_0x368bf7){_0x3714a0=_0x368bf7[_0x5f89('0x38')];if(!_0x4982e8['query']['hasOwnProperty'](_0x5f89('0x39'))){_0x2af7bb['limit']=qs[_0x5f89('0x1c')](_0x4982e8[_0x5f89('0x32')]['limit']);_0x2af7bb[_0x5f89('0x1e')]=qs[_0x5f89('0x1e')](_0x4982e8[_0x5f89('0x32')][_0x5f89('0x1e')]);}return _0x244fb3[_0x5f89('0x50')](_0x2af7bb);}})['then'](function(_0x5c7a51){if(_0x5c7a51){return _0x5c7a51?{'count':_0x3714a0,'rows':_0x5c7a51}:null;}})[_0x5f89('0x24')](respondWithResult(_0x2b11b8,null))[_0x5f89('0x44')](handleError(_0x2b11b8,null));};exports['getTags']=function(_0x463fbb,_0x1cfc9b,_0x1e3053){var _0x2f8a39={};var _0x31e63d={};var _0x542ae6;var _0x4e46e4;return db['DeskConfiguration']['findOne']({'where':{'id':_0x463fbb['params']['id']}})[_0x5f89('0x24')](handleEntityNotFound(_0x1cfc9b,null))[_0x5f89('0x24')](function(_0x368fed){if(_0x368fed){_0x542ae6=_0x368fed;_0x31e63d[_0x5f89('0x31')]=_['keys'](db[_0x5f89('0x51')][_0x5f89('0x2d')]);_0x31e63d['query']=_[_0x5f89('0x33')](_0x463fbb[_0x5f89('0x32')]);_0x31e63d[_0x5f89('0x34')]=_[_0x5f89('0x35')](_0x31e63d[_0x5f89('0x31')],_0x31e63d[_0x5f89('0x32')]);_0x2f8a39['attributes']=_['intersection'](_0x31e63d[_0x5f89('0x31')],qs['fields'](_0x463fbb[_0x5f89('0x32')][_0x5f89('0x36')]));_0x2f8a39[_0x5f89('0x37')]=_0x2f8a39[_0x5f89('0x37')][_0x5f89('0x38')]?_0x2f8a39[_0x5f89('0x37')]:_0x31e63d[_0x5f89('0x31')];_0x2f8a39['order']=qs['sort'](_0x463fbb[_0x5f89('0x32')][_0x5f89('0x3b')]);_0x2f8a39['where']=qs['filters'](_['pick'](_0x463fbb[_0x5f89('0x32')],_0x31e63d['filters']));if(_0x463fbb[_0x5f89('0x32')][_0x5f89('0x3e')]){_0x2f8a39[_0x5f89('0x3c')]=_[_0x5f89('0x3f')](_0x2f8a39[_0x5f89('0x3c')],{'$or':_['map'](_0x2f8a39[_0x5f89('0x37')],function(_0x259a2f){var _0x4385b6={};_0x4385b6[_0x259a2f]={'$like':'%'+_0x463fbb[_0x5f89('0x32')]['filter']+'%'};return _0x4385b6;})});}_0x2f8a39=_[_0x5f89('0x3f')]({},_0x2f8a39,_0x463fbb['options']);return _0x542ae6[_0x5f89('0x52')](_0x2f8a39);}})[_0x5f89('0x24')](function(_0x47eb0d){if(_0x47eb0d){_0x4e46e4=_0x47eb0d['length'];if(!_0x463fbb['query'][_0x5f89('0x4d')](_0x5f89('0x39'))){_0x2f8a39[_0x5f89('0x1c')]=qs[_0x5f89('0x1c')](_0x463fbb['query']['limit']);_0x2f8a39['offset']=qs[_0x5f89('0x1e')](_0x463fbb[_0x5f89('0x32')][_0x5f89('0x1e')]);}return _0x542ae6[_0x5f89('0x52')](_0x2f8a39);}})[_0x5f89('0x24')](function(_0x1a6d48){if(_0x1a6d48){return _0x1a6d48?{'count':_0x4e46e4,'rows':_0x1a6d48}:null;}})[_0x5f89('0x24')](respondWithResult(_0x1cfc9b,null))[_0x5f89('0x44')](handleError(_0x1cfc9b,null));};exports[_0x5f89('0x53')]=function(_0x3210ef,_0x21011c,_0x43c048){if(_0x3210ef[_0x5f89('0x4a')]['id']){delete _0x3210ef[_0x5f89('0x4a')]['id'];}return db[_0x5f89('0x2c')]['findOne']({'where':{'id':_0x3210ef[_0x5f89('0x46')]['id']}})[_0x5f89('0x24')](handleEntityNotFound(_0x21011c,null))[_0x5f89('0x24')](function(_0x5e72be){if(_0x5e72be){return _0x5e72be[_0x5f89('0x53')](_0x3210ef[_0x5f89('0x4a')][_0x5f89('0x54')]||[]);}return null;})[_0x5f89('0x24')](respondWithResult(_0x21011c,null))['catch'](handleError(_0x21011c,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 07a02a7..446ecef 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 _0x7ad8=['bluebird','../../config/environment','./intDeskConfiguration.attributes','exports','int_desk_configurations','util','../../config/logger','api','moment'];(function(_0x2f2360,_0x151089){var _0x1cc8d3=function(_0x5e356f){while(--_0x5e356f){_0x2f2360['push'](_0x2f2360['shift']());}};_0x1cc8d3(++_0x151089);}(_0x7ad8,0xb9));var _0x87ad=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0x7ad8[_0x18a79d];return _0x4f8848;};'use strict';var _=require('lodash');var util=require(_0x87ad('0x0'));var logger=require(_0x87ad('0x1'))(_0x87ad('0x2'));var moment=require(_0x87ad('0x3'));var BPromise=require(_0x87ad('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x87ad('0x5'));var attributes=require(_0x87ad('0x6'));module[_0x87ad('0x7')]=function(_0x100b41,_0x23ef78){return _0x100b41['define']('DeskConfiguration',attributes,{'tableName':_0x87ad('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe2db=['../../config/environment','./intDeskConfiguration.attributes','define','DeskConfiguration','int_desk_configurations','lodash','bluebird','path','rimraf'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe2db,0x83));var _0xbe2d=function(_0x229049,_0x5c257e){_0x229049=_0x229049-0x0;var _0x23791f=_0xe2db[_0x229049];return _0x23791f;};'use strict';var _=require(_0xbe2d('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xbe2d('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe2d('0x2'));var rimraf=require(_0xbe2d('0x3'));var config=require(_0xbe2d('0x4'));var attributes=require(_0xbe2d('0x5'));module['exports']=function(_0x5b5b4a,_0x3e6057){return _0x5b5b4a[_0xbe2d('0x6')](_0xbe2d('0x7'),attributes,{'tableName':_0xbe2d('0x8'),'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 812fa56..5f7d4eb 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 _0x6691=['message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskConfiguration,\x20%s,\x20%s'];(function(_0x205ab7,_0x378cab){var _0x259bc4=function(_0x111090){while(--_0x111090){_0x205ab7['push'](_0x205ab7['shift']());}};_0x259bc4(++_0x378cab);}(_0x6691,0x12d));var _0x1669=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x6691[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x1669('0x0'));var util=require(_0x1669('0x1'));var moment=require(_0x1669('0x2'));var BPromise=require(_0x1669('0x3'));var rs=require(_0x1669('0x4'));var fs=require('fs');var Redis=require(_0x1669('0x5'));var db=require(_0x1669('0x6'))['db'];var utils=require(_0x1669('0x7'));var logger=require(_0x1669('0x8'))(_0x1669('0x9'));var config=require('../../config/environment');var jayson=require(_0x1669('0xa'));var client=jayson[_0x1669('0xb')][_0x1669('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x348683,_0x55393c,_0x5d23fd){return new BPromise(function(_0x59d1e5,_0x3420d5){return client['request'](_0x348683,_0x5d23fd)['then'](function(_0x51f7ef){logger[_0x1669('0xd')]('DeskConfiguration,\x20%s,\x20%s',_0x55393c,_0x1669('0xe'));logger[_0x1669('0xf')](_0x1669('0x10'),_0x55393c,_0x1669('0xe'),JSON[_0x1669('0x11')](_0x51f7ef));if(_0x51f7ef[_0x1669('0x12')]){if(_0x51f7ef[_0x1669('0x12')][_0x1669('0x13')]===0x1f4){logger[_0x1669('0x12')](_0x1669('0x14'),_0x55393c,_0x51f7ef[_0x1669('0x12')][_0x1669('0x15')]);return _0x3420d5(_0x51f7ef[_0x1669('0x12')][_0x1669('0x15')]);}logger[_0x1669('0x12')](_0x1669('0x14'),_0x55393c,_0x51f7ef[_0x1669('0x12')][_0x1669('0x15')]);return _0x59d1e5(_0x51f7ef[_0x1669('0x12')][_0x1669('0x15')]);}else{logger[_0x1669('0xd')](_0x1669('0x14'),_0x55393c,_0x1669('0xe'));_0x59d1e5(_0x51f7ef['result'][_0x1669('0x15')]);}})[_0x1669('0x16')](function(_0x4281dc){logger[_0x1669('0x12')](_0x1669('0x14'),_0x55393c,_0x4281dc);_0x3420d5(_0x4281dc);});});} \ No newline at end of file +var _0x1867=['http','request','then','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x36bfeb,_0x39d784){var _0x5bde81=function(_0x19e736){while(--_0x19e736){_0x36bfeb['push'](_0x36bfeb['shift']());}};_0x5bde81(++_0x39d784);}(_0x1867,0xb5));var _0x7186=function(_0x17f254,_0x24d202){_0x17f254=_0x17f254-0x0;var _0xe81597=_0x1867[_0x17f254];return _0xe81597;};'use strict';var _=require(_0x7186('0x0'));var util=require(_0x7186('0x1'));var moment=require('moment');var BPromise=require(_0x7186('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7186('0x3'));var db=require(_0x7186('0x4'))['db'];var utils=require(_0x7186('0x5'));var logger=require(_0x7186('0x6'))(_0x7186('0x7'));var config=require(_0x7186('0x8'));var jayson=require(_0x7186('0x9'));var client=jayson[_0x7186('0xa')][_0x7186('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4bea9f,_0x45938b,_0x18c4b9){return new BPromise(function(_0x546a90,_0x350c54){return client[_0x7186('0xc')](_0x4bea9f,_0x18c4b9)[_0x7186('0xd')](function(_0xb49c4b){logger['info'](_0x7186('0xe'),_0x45938b,_0x7186('0xf'));logger[_0x7186('0x10')](_0x7186('0x11'),_0x45938b,_0x7186('0xf'),JSON['stringify'](_0xb49c4b));if(_0xb49c4b[_0x7186('0x12')]){if(_0xb49c4b[_0x7186('0x12')][_0x7186('0x13')]===0x1f4){logger[_0x7186('0x12')]('DeskConfiguration,\x20%s,\x20%s',_0x45938b,_0xb49c4b[_0x7186('0x12')][_0x7186('0x14')]);return _0x350c54(_0xb49c4b[_0x7186('0x12')][_0x7186('0x14')]);}logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x45938b,_0xb49c4b['error'][_0x7186('0x14')]);return _0x546a90(_0xb49c4b[_0x7186('0x12')][_0x7186('0x14')]);}else{logger[_0x7186('0x15')]('DeskConfiguration,\x20%s,\x20%s',_0x45938b,_0x7186('0xf'));_0x546a90(_0xb49c4b[_0x7186('0x16')][_0x7186('0x14')]);}})[_0x7186('0x17')](function(_0x6508f5){logger[_0x7186('0x12')](_0x7186('0xe'),_0x45938b,_0x6508f5);_0x350c54(_0x6508f5);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index e58d9d9..b593811 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 _0xea7c=['../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','show','post','create','/:id','update','delete','destroy','exports','path','express','fs-extra','../../components/auth/service'];(function(_0x57796e,_0x4287d6){var _0x4c8df9=function(_0x2e2de3){while(--_0x2e2de3){_0x57796e['push'](_0x57796e['shift']());}};_0x4c8df9(++_0x4287d6);}(_0xea7c,0xe6));var _0xcea7=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xea7c[_0x4565bf];return _0x5610ba;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xcea7('0x0'));var timeout=require('connect-timeout');var express=require(_0xcea7('0x1'));var router=express['Router']();var fs_extra=require(_0xcea7('0x2'));var auth=require(_0xcea7('0x3'));var interaction=require(_0xcea7('0x4'));var config=require(_0xcea7('0x5'));var controller=require(_0xcea7('0x6'));router[_0xcea7('0x7')]('/',auth[_0xcea7('0x8')](),controller[_0xcea7('0x9')]);router[_0xcea7('0x7')]('/:id',auth[_0xcea7('0x8')](),controller[_0xcea7('0xa')]);router[_0xcea7('0xb')]('/',auth[_0xcea7('0x8')](),controller[_0xcea7('0xc')]);router['put'](_0xcea7('0xd'),auth['isAuthenticated'](),controller[_0xcea7('0xe')]);router[_0xcea7('0xf')](_0xcea7('0xd'),auth[_0xcea7('0x8')](),controller[_0xcea7('0x10')]);module[_0xcea7('0x11')]=router; \ No newline at end of file +var _0x087a=['fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskField.controller','get','isAuthenticated','index','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x16f789,_0x310273){var _0x6940c3=function(_0x65e038){while(--_0x65e038){_0x16f789['push'](_0x16f789['shift']());}};_0x6940c3(++_0x310273);}(_0x087a,0x9a));var _0xa087=function(_0x5a9d7c,_0x22e7d6){_0x5a9d7c=_0x5a9d7c-0x0;var _0x2be553=_0x087a[_0x5a9d7c];return _0x2be553;};'use strict';var multer=require(_0xa087('0x0'));var util=require(_0xa087('0x1'));var path=require(_0xa087('0x2'));var timeout=require(_0xa087('0x3'));var express=require(_0xa087('0x4'));var router=express[_0xa087('0x5')]();var fs_extra=require(_0xa087('0x6'));var auth=require(_0xa087('0x7'));var interaction=require(_0xa087('0x8'));var config=require('../../config/environment');var controller=require(_0xa087('0x9'));router[_0xa087('0xa')]('/',auth[_0xa087('0xb')](),controller[_0xa087('0xc')]);router[_0xa087('0xa')]('/:id',auth[_0xa087('0xb')](),controller['show']);router['post']('/',auth[_0xa087('0xb')](),controller[_0xa087('0xd')]);router[_0xa087('0xe')](_0xa087('0xf'),auth[_0xa087('0xb')](),controller[_0xa087('0x10')]);router[_0xa087('0x11')]('/:id',auth[_0xa087('0xb')](),controller[_0xa087('0x12')]);module[_0xa087('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index d77d415..262285e 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 _0x3706=['customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','string','variable'];(function(_0x512738,_0x52ef6b){var _0x1bdb2b=function(_0x24d1ff){while(--_0x24d1ff){_0x512738['push'](_0x512738['shift']());}};_0x1bdb2b(++_0x52ef6b);}(_0x3706,0x191));var _0x6370=function(_0x50f392,_0x1d8441){_0x50f392=_0x50f392-0x0;var _0x5926f2=_0x3706[_0x50f392];return _0x5926f2;};'use strict';var Sequelize=require(_0x6370('0x0'));module[_0x6370('0x1')]={'type':{'type':Sequelize['ENUM'](_0x6370('0x2'),_0x6370('0x3'),_0x6370('0x4'),_0x6370('0x5'),_0x6370('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x6370('0x7')]},'key':{'type':Sequelize[_0x6370('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x6370('0x2'),'variable',_0x6370('0x4'))},'keyContent':{'type':Sequelize[_0x6370('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x6370('0x7')]},'customField':{'type':Sequelize[_0x6370('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6370('0x7')]}}; \ No newline at end of file +var _0x63f5=['ENUM','variable','customVariable','keyValue','picklist','string','STRING','BOOLEAN','exports'];(function(_0x3aaf01,_0x24624f){var _0x2561d5=function(_0x426137){while(--_0x426137){_0x3aaf01['push'](_0x3aaf01['shift']());}};_0x2561d5(++_0x24624f);}(_0x63f5,0x1ca));var _0x563f=function(_0x680821,_0x23e67f){_0x680821=_0x680821-0x0;var _0x3f132c=_0x63f5[_0x680821];return _0x3f132c;};'use strict';var Sequelize=require('sequelize');module[_0x563f('0x0')]={'type':{'type':Sequelize[_0x563f('0x1')]('string',_0x563f('0x2'),_0x563f('0x3'),_0x563f('0x4'),_0x563f('0x5')),'defaultValue':_0x563f('0x6')},'content':{'type':Sequelize[_0x563f('0x7')]},'key':{'type':Sequelize[_0x563f('0x7')]},'keyType':{'type':Sequelize['ENUM']('string',_0x563f('0x2'),_0x563f('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x563f('0x7')]},'nameField':{'type':Sequelize[_0x563f('0x7')]},'customField':{'type':Sequelize[_0x563f('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x563f('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 8bb9054..a4b6722 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 _0xdcd5=['send','index','map','DeskField','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','keys','rawAttributes','length','includeAll','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name'];(function(_0x1c5290,_0x4107a4){var _0xdd2fca=function(_0x33bb78){while(--_0x33bb78){_0x1c5290['push'](_0x1c5290['shift']());}};_0xdd2fca(++_0x4107a4);}(_0xdcd5,0x110));var _0x5dcd=function(_0x41d432,_0x20e878){_0x41d432=_0x41d432-0x0;var _0x1650f9=_0xdcd5[_0x41d432];return _0x1650f9;};'use strict';var emlformat=require(_0x5dcd('0x0'));var rimraf=require(_0x5dcd('0x1'));var zipdir=require(_0x5dcd('0x2'));var jsonpatch=require(_0x5dcd('0x3'));var rp=require(_0x5dcd('0x4'));var moment=require(_0x5dcd('0x5'));var BPromise=require(_0x5dcd('0x6'));var Mustache=require('mustache');var util=require(_0x5dcd('0x7'));var path=require(_0x5dcd('0x8'));var sox=require(_0x5dcd('0x9'));var csv=require(_0x5dcd('0xa'));var ejs=require(_0x5dcd('0xb'));var fs=require('fs');var fs_extra=require(_0x5dcd('0xc'));var _=require(_0x5dcd('0xd'));var squel=require(_0x5dcd('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5dcd('0xf'));var toCsv=require(_0x5dcd('0xa'));var querystring=require(_0x5dcd('0x10'));var Papa=require('papaparse');var Redis=require(_0x5dcd('0x11'));var authService=require(_0x5dcd('0x12'));var qs=require(_0x5dcd('0x13'));var as=require(_0x5dcd('0x14'));var hardwareService=require(_0x5dcd('0x15'));var logger=require(_0x5dcd('0x16'))(_0x5dcd('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5dcd('0x18'));var db=require(_0x5dcd('0x19'))['db'];function respondWithStatusCode(_0x4e213f,_0x250f9a){_0x250f9a=_0x250f9a||0xcc;return function(_0x7cf873){if(_0x7cf873){return _0x4e213f[_0x5dcd('0x1a')](_0x250f9a);}return _0x4e213f[_0x5dcd('0x1b')](_0x250f9a)[_0x5dcd('0x1c')]();};}function respondWithResult(_0x2ff0cb,_0x2b66bf){_0x2b66bf=_0x2b66bf||0xc8;return function(_0x40062e){if(_0x40062e){return _0x2ff0cb['status'](_0x2b66bf)[_0x5dcd('0x1d')](_0x40062e);}};}function respondWithFilteredResult(_0x2b61bf,_0x538be9){return function(_0x43b71f){if(_0x43b71f){var _0x537aed=typeof _0x538be9[_0x5dcd('0x1e')]===_0x5dcd('0x1f')&&typeof _0x538be9[_0x5dcd('0x20')]==='undefined';var _0x1a4643=_0x43b71f[_0x5dcd('0x21')];var _0xc7d7d7=_0x537aed?0x0:_0x538be9['offset'];var _0x3e23fa=_0x537aed?_0x43b71f[_0x5dcd('0x21')]:_0x538be9[_0x5dcd('0x1e')]+_0x538be9['limit'];var _0x1e423c;if(_0x3e23fa>=_0x1a4643){_0x3e23fa=_0x1a4643;_0x1e423c=0xc8;}else{_0x1e423c=0xce;}_0x2b61bf[_0x5dcd('0x1b')](_0x1e423c);return _0x2b61bf[_0x5dcd('0x22')](_0x5dcd('0x23'),_0xc7d7d7+'-'+_0x3e23fa+'/'+_0x1a4643)['json'](_0x43b71f);}return null;};}function patchUpdates(_0x11d296){return function(_0x4c392a){try{jsonpatch['apply'](_0x4c392a,_0x11d296,!![]);}catch(_0x557e94){return BPromise[_0x5dcd('0x24')](_0x557e94);}return _0x4c392a[_0x5dcd('0x25')]();};}function saveUpdates(_0x23a21d,_0x8a43fc){return function(_0x305466){if(_0x305466){return _0x305466[_0x5dcd('0x26')](_0x23a21d)[_0x5dcd('0x27')](function(_0x46102a){return _0x46102a;});}return null;};}function removeEntity(_0x40e847,_0x270390){return function(_0x5d3fa0){if(_0x5d3fa0){return _0x5d3fa0[_0x5dcd('0x28')]()[_0x5dcd('0x27')](function(){_0x40e847[_0x5dcd('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30fe1f,_0x4b07c7){return function(_0xc0cadb){if(!_0xc0cadb){_0x30fe1f[_0x5dcd('0x1a')](0x194);}return _0xc0cadb;};}function handleError(_0x3b2b2b,_0x5337a3){_0x5337a3=_0x5337a3||0x1f4;return function(_0xf30ac6){logger[_0x5dcd('0x29')](_0xf30ac6[_0x5dcd('0x2a')]);if(_0xf30ac6[_0x5dcd('0x2b')]){delete _0xf30ac6[_0x5dcd('0x2b')];}_0x3b2b2b['status'](_0x5337a3)[_0x5dcd('0x2c')](_0xf30ac6);};}exports[_0x5dcd('0x2d')]=function(_0x440e47,_0x28e53f){var _0x1a87a5={},_0x1ba4cf={},_0x24f91f={'count':0x0,'rows':[]};var _0x16c744=_[_0x5dcd('0x2e')](db[_0x5dcd('0x2f')]['rawAttributes'],function(_0x3bed3f){return{'name':_0x3bed3f['fieldName'],'type':_0x3bed3f['type'][_0x5dcd('0x30')]};});_0x1ba4cf[_0x5dcd('0x31')]=_['map'](_0x16c744,_0x5dcd('0x2b'));_0x1ba4cf[_0x5dcd('0x32')]=_['keys'](_0x440e47[_0x5dcd('0x32')]);_0x1ba4cf[_0x5dcd('0x33')]=_[_0x5dcd('0x34')](_0x1ba4cf[_0x5dcd('0x31')],_0x1ba4cf['query']);_0x1a87a5['attributes']=_[_0x5dcd('0x34')](_0x1ba4cf[_0x5dcd('0x31')],qs['fields'](_0x440e47['query'][_0x5dcd('0x35')]));_0x1a87a5['attributes']=_0x1a87a5[_0x5dcd('0x36')]['length']?_0x1a87a5['attributes']:_0x1ba4cf[_0x5dcd('0x31')];if(!_0x440e47[_0x5dcd('0x32')][_0x5dcd('0x37')](_0x5dcd('0x38'))){_0x1a87a5[_0x5dcd('0x20')]=qs[_0x5dcd('0x20')](_0x440e47[_0x5dcd('0x32')][_0x5dcd('0x20')]);_0x1a87a5[_0x5dcd('0x1e')]=qs[_0x5dcd('0x1e')](_0x440e47[_0x5dcd('0x32')][_0x5dcd('0x1e')]);}_0x1a87a5[_0x5dcd('0x39')]=qs[_0x5dcd('0x3a')](_0x440e47[_0x5dcd('0x32')][_0x5dcd('0x3a')]);_0x1a87a5[_0x5dcd('0x3b')]=qs[_0x5dcd('0x33')](_[_0x5dcd('0x3c')](_0x440e47['query'],_0x1ba4cf[_0x5dcd('0x33')]),_0x16c744);if(_0x440e47[_0x5dcd('0x32')]['filter']){_0x1a87a5[_0x5dcd('0x3b')]=_[_0x5dcd('0x3d')](_0x1a87a5[_0x5dcd('0x3b')],{'$or':_[_0x5dcd('0x2e')](_0x16c744,function(_0xab1e78){if(_0xab1e78[_0x5dcd('0x3e')]!==_0x5dcd('0x3f')){var _0x53df30={};_0x53df30[_0xab1e78[_0x5dcd('0x2b')]]={'$like':'%'+_0x440e47[_0x5dcd('0x32')][_0x5dcd('0x40')]+'%'};return _0x53df30;}})});}_0x1a87a5=_[_0x5dcd('0x3d')]({},_0x1a87a5,_0x440e47[_0x5dcd('0x41')]);var _0xc745a3={'where':_0x1a87a5['where']};return db['DeskField']['count'](_0xc745a3)[_0x5dcd('0x27')](function(_0x4888ae){_0x24f91f['count']=_0x4888ae;if(_0x440e47['query']['includeAll']){_0x1a87a5[_0x5dcd('0x42')]=[{'all':!![]}];}return db[_0x5dcd('0x2f')][_0x5dcd('0x43')](_0x1a87a5);})['then'](function(_0x14fdcc){_0x24f91f[_0x5dcd('0x44')]=_0x14fdcc;return _0x24f91f;})[_0x5dcd('0x27')](respondWithFilteredResult(_0x28e53f,_0x1a87a5))[_0x5dcd('0x45')](handleError(_0x28e53f,null));};exports[_0x5dcd('0x46')]=function(_0x39c46a,_0x28a5d3){var _0x419cf3={'raw':!![],'where':{'id':_0x39c46a[_0x5dcd('0x47')]['id']}},_0x3f3907={};_0x3f3907[_0x5dcd('0x31')]=_[_0x5dcd('0x48')](db[_0x5dcd('0x2f')][_0x5dcd('0x49')]);_0x3f3907['query']=_['keys'](_0x39c46a[_0x5dcd('0x32')]);_0x3f3907[_0x5dcd('0x33')]=_[_0x5dcd('0x34')](_0x3f3907[_0x5dcd('0x31')],_0x3f3907[_0x5dcd('0x32')]);_0x419cf3[_0x5dcd('0x36')]=_[_0x5dcd('0x34')](_0x3f3907['model'],qs[_0x5dcd('0x35')](_0x39c46a[_0x5dcd('0x32')][_0x5dcd('0x35')]));_0x419cf3[_0x5dcd('0x36')]=_0x419cf3[_0x5dcd('0x36')][_0x5dcd('0x4a')]?_0x419cf3[_0x5dcd('0x36')]:_0x3f3907[_0x5dcd('0x31')];if(_0x39c46a[_0x5dcd('0x32')][_0x5dcd('0x4b')]){_0x419cf3[_0x5dcd('0x42')]=[{'all':!![]}];}_0x419cf3=_[_0x5dcd('0x3d')]({},_0x419cf3,_0x39c46a[_0x5dcd('0x41')]);return db[_0x5dcd('0x2f')]['find'](_0x419cf3)[_0x5dcd('0x27')](handleEntityNotFound(_0x28a5d3,null))[_0x5dcd('0x27')](respondWithResult(_0x28a5d3,null))['catch'](handleError(_0x28a5d3,null));};exports[_0x5dcd('0x4c')]=function(_0x3caeab,_0x4bacf9){return db['DeskField'][_0x5dcd('0x4c')](_0x3caeab[_0x5dcd('0x4d')],{})[_0x5dcd('0x27')](respondWithResult(_0x4bacf9,0xc9))[_0x5dcd('0x45')](handleError(_0x4bacf9,null));};exports[_0x5dcd('0x26')]=function(_0x6105d3,_0x24caac){if(_0x6105d3['body']['id']){delete _0x6105d3[_0x5dcd('0x4d')]['id'];}return db[_0x5dcd('0x2f')][_0x5dcd('0x4e')]({'where':{'id':_0x6105d3[_0x5dcd('0x47')]['id']}})[_0x5dcd('0x27')](handleEntityNotFound(_0x24caac,null))[_0x5dcd('0x27')](saveUpdates(_0x6105d3[_0x5dcd('0x4d')],null))['then'](respondWithResult(_0x24caac,null))[_0x5dcd('0x45')](handleError(_0x24caac,null));};exports[_0x5dcd('0x28')]=function(_0x8e9b1,_0x32a25b){return db['DeskField'][_0x5dcd('0x4e')]({'where':{'id':_0x8e9b1[_0x5dcd('0x47')]['id']}})[_0x5dcd('0x27')](handleEntityNotFound(_0x32a25b,null))[_0x5dcd('0x27')](removeEntity(_0x32a25b,null))['catch'](handleError(_0x32a25b,null));}; \ No newline at end of file +var _0xefce=['ejs','fs-extra','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','name','index','map','DeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','find','create','body','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x34e747,_0x173163){var _0x200a90=function(_0x2cfb42){while(--_0x2cfb42){_0x34e747['push'](_0x34e747['shift']());}};_0x200a90(++_0x173163);}(_0xefce,0x1e8));var _0xeefc=function(_0x1ac120,_0x3e7e45){_0x1ac120=_0x1ac120-0x0;var _0x19b703=_0xefce[_0x1ac120];return _0x19b703;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeefc('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xeefc('0x1'));var moment=require(_0xeefc('0x2'));var BPromise=require(_0xeefc('0x3'));var Mustache=require(_0xeefc('0x4'));var util=require(_0xeefc('0x5'));var path=require(_0xeefc('0x6'));var sox=require(_0xeefc('0x7'));var csv=require(_0xeefc('0x8'));var ejs=require(_0xeefc('0x9'));var fs=require('fs');var fs_extra=require(_0xeefc('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xeefc('0xb'));var jsforce=require(_0xeefc('0xc'));var deskjs=require(_0xeefc('0xd'));var toCsv=require(_0xeefc('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xeefc('0xe'));var authService=require(_0xeefc('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xeefc('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeefc('0x11'))(_0xeefc('0x12'));var utils=require('../../config/utils');var config=require(_0xeefc('0x13'));var licenseUtil=require(_0xeefc('0x14'));var db=require(_0xeefc('0x15'))['db'];function respondWithStatusCode(_0x5f255a,_0x454066){_0x454066=_0x454066||0xcc;return function(_0x3e9251){if(_0x3e9251){return _0x5f255a[_0xeefc('0x16')](_0x454066);}return _0x5f255a[_0xeefc('0x17')](_0x454066)[_0xeefc('0x18')]();};}function respondWithResult(_0x405ba3,_0xa0e71a){_0xa0e71a=_0xa0e71a||0xc8;return function(_0x4537e2){if(_0x4537e2){return _0x405ba3[_0xeefc('0x17')](_0xa0e71a)[_0xeefc('0x19')](_0x4537e2);}};}function respondWithFilteredResult(_0x224d28,_0x5d728e){return function(_0x3d8489){if(_0x3d8489){var _0x5c447b=typeof _0x5d728e[_0xeefc('0x1a')]===_0xeefc('0x1b')&&typeof _0x5d728e[_0xeefc('0x1c')]===_0xeefc('0x1b');var _0x15baaa=_0x3d8489['count'];var _0x1c247e=_0x5c447b?0x0:_0x5d728e[_0xeefc('0x1a')];var _0x55c2fb=_0x5c447b?_0x3d8489[_0xeefc('0x1d')]:_0x5d728e[_0xeefc('0x1a')]+_0x5d728e[_0xeefc('0x1c')];var _0x4ba684;if(_0x55c2fb>=_0x15baaa){_0x55c2fb=_0x15baaa;_0x4ba684=0xc8;}else{_0x4ba684=0xce;}_0x224d28[_0xeefc('0x17')](_0x4ba684);return _0x224d28[_0xeefc('0x1e')]('Content-Range',_0x1c247e+'-'+_0x55c2fb+'/'+_0x15baaa)[_0xeefc('0x19')](_0x3d8489);}return null;};}function patchUpdates(_0x5b34b9){return function(_0x208959){try{jsonpatch[_0xeefc('0x1f')](_0x208959,_0x5b34b9,!![]);}catch(_0x3cebaa){return BPromise[_0xeefc('0x20')](_0x3cebaa);}return _0x208959[_0xeefc('0x21')]();};}function saveUpdates(_0x2f475e,_0x2ac6e0){return function(_0x4ec1c9){if(_0x4ec1c9){return _0x4ec1c9[_0xeefc('0x22')](_0x2f475e)[_0xeefc('0x23')](function(_0x6e690b){return _0x6e690b;});}return null;};}function removeEntity(_0xe20f0a,_0x4eea87){return function(_0x48246d){if(_0x48246d){return _0x48246d[_0xeefc('0x24')]()[_0xeefc('0x23')](function(){_0xe20f0a[_0xeefc('0x17')](0xcc)[_0xeefc('0x18')]();});}};}function handleEntityNotFound(_0x4aeaa7,_0x16e60e){return function(_0x3ea299){if(!_0x3ea299){_0x4aeaa7[_0xeefc('0x16')](0x194);}return _0x3ea299;};}function handleError(_0x4776f5,_0x5773c8){_0x5773c8=_0x5773c8||0x1f4;return function(_0x5a8736){logger[_0xeefc('0x25')](_0x5a8736['stack']);if(_0x5a8736[_0xeefc('0x26')]){delete _0x5a8736[_0xeefc('0x26')];}_0x4776f5['status'](_0x5773c8)['send'](_0x5a8736);};}exports[_0xeefc('0x27')]=function(_0x56ea84,_0x56de5f){var _0x453f6e={},_0x1079f2={},_0x4d3aec={'count':0x0,'rows':[]};var _0x47acb4=_[_0xeefc('0x28')](db[_0xeefc('0x29')][_0xeefc('0x2a')],function(_0x13a33e){return{'name':_0x13a33e[_0xeefc('0x2b')],'type':_0x13a33e[_0xeefc('0x2c')][_0xeefc('0x2d')]};});_0x1079f2[_0xeefc('0x2e')]=_[_0xeefc('0x28')](_0x47acb4,'name');_0x1079f2[_0xeefc('0x2f')]=_[_0xeefc('0x30')](_0x56ea84[_0xeefc('0x2f')]);_0x1079f2[_0xeefc('0x31')]=_[_0xeefc('0x32')](_0x1079f2[_0xeefc('0x2e')],_0x1079f2[_0xeefc('0x2f')]);_0x453f6e[_0xeefc('0x33')]=_[_0xeefc('0x32')](_0x1079f2[_0xeefc('0x2e')],qs[_0xeefc('0x34')](_0x56ea84[_0xeefc('0x2f')][_0xeefc('0x34')]));_0x453f6e['attributes']=_0x453f6e[_0xeefc('0x33')][_0xeefc('0x35')]?_0x453f6e['attributes']:_0x1079f2[_0xeefc('0x2e')];if(!_0x56ea84[_0xeefc('0x2f')]['hasOwnProperty']('nolimit')){_0x453f6e[_0xeefc('0x1c')]=qs[_0xeefc('0x1c')](_0x56ea84[_0xeefc('0x2f')][_0xeefc('0x1c')]);_0x453f6e['offset']=qs[_0xeefc('0x1a')](_0x56ea84['query'][_0xeefc('0x1a')]);}_0x453f6e[_0xeefc('0x36')]=qs['sort'](_0x56ea84[_0xeefc('0x2f')][_0xeefc('0x37')]);_0x453f6e[_0xeefc('0x38')]=qs[_0xeefc('0x31')](_[_0xeefc('0x39')](_0x56ea84[_0xeefc('0x2f')],_0x1079f2[_0xeefc('0x31')]),_0x47acb4);if(_0x56ea84[_0xeefc('0x2f')][_0xeefc('0x3a')]){_0x453f6e[_0xeefc('0x38')]=_['merge'](_0x453f6e['where'],{'$or':_['map'](_0x47acb4,function(_0x2cab08){if(_0x2cab08[_0xeefc('0x2c')]!==_0xeefc('0x3b')){var _0x463283={};_0x463283[_0x2cab08['name']]={'$like':'%'+_0x56ea84[_0xeefc('0x2f')][_0xeefc('0x3a')]+'%'};return _0x463283;}})});}_0x453f6e=_[_0xeefc('0x3c')]({},_0x453f6e,_0x56ea84[_0xeefc('0x3d')]);var _0x4ddf39={'where':_0x453f6e[_0xeefc('0x38')]};return db[_0xeefc('0x29')][_0xeefc('0x1d')](_0x4ddf39)[_0xeefc('0x23')](function(_0x26015c){_0x4d3aec[_0xeefc('0x1d')]=_0x26015c;if(_0x56ea84[_0xeefc('0x2f')][_0xeefc('0x3e')]){_0x453f6e[_0xeefc('0x3f')]=[{'all':!![]}];}return db[_0xeefc('0x29')]['findAll'](_0x453f6e);})['then'](function(_0x34786f){_0x4d3aec[_0xeefc('0x40')]=_0x34786f;return _0x4d3aec;})[_0xeefc('0x23')](respondWithFilteredResult(_0x56de5f,_0x453f6e))[_0xeefc('0x41')](handleError(_0x56de5f,null));};exports[_0xeefc('0x42')]=function(_0x44e88,_0x560d99){var _0x49b478={'raw':!![],'where':{'id':_0x44e88[_0xeefc('0x43')]['id']}},_0x28049e={};_0x28049e[_0xeefc('0x2e')]=_[_0xeefc('0x30')](db[_0xeefc('0x29')][_0xeefc('0x2a')]);_0x28049e[_0xeefc('0x2f')]=_[_0xeefc('0x30')](_0x44e88[_0xeefc('0x2f')]);_0x28049e['filters']=_[_0xeefc('0x32')](_0x28049e[_0xeefc('0x2e')],_0x28049e[_0xeefc('0x2f')]);_0x49b478[_0xeefc('0x33')]=_[_0xeefc('0x32')](_0x28049e[_0xeefc('0x2e')],qs[_0xeefc('0x34')](_0x44e88[_0xeefc('0x2f')][_0xeefc('0x34')]));_0x49b478[_0xeefc('0x33')]=_0x49b478[_0xeefc('0x33')][_0xeefc('0x35')]?_0x49b478[_0xeefc('0x33')]:_0x28049e[_0xeefc('0x2e')];if(_0x44e88[_0xeefc('0x2f')]['includeAll']){_0x49b478[_0xeefc('0x3f')]=[{'all':!![]}];}_0x49b478=_[_0xeefc('0x3c')]({},_0x49b478,_0x44e88[_0xeefc('0x3d')]);return db[_0xeefc('0x29')][_0xeefc('0x44')](_0x49b478)[_0xeefc('0x23')](handleEntityNotFound(_0x560d99,null))[_0xeefc('0x23')](respondWithResult(_0x560d99,null))[_0xeefc('0x41')](handleError(_0x560d99,null));};exports[_0xeefc('0x45')]=function(_0x2b5298,_0xaf7a14){return db[_0xeefc('0x29')][_0xeefc('0x45')](_0x2b5298[_0xeefc('0x46')],{})['then'](respondWithResult(_0xaf7a14,0xc9))[_0xeefc('0x41')](handleError(_0xaf7a14,null));};exports[_0xeefc('0x22')]=function(_0x29f739,_0x76f2fa){if(_0x29f739['body']['id']){delete _0x29f739['body']['id'];}return db[_0xeefc('0x29')][_0xeefc('0x44')]({'where':{'id':_0x29f739[_0xeefc('0x43')]['id']}})[_0xeefc('0x23')](handleEntityNotFound(_0x76f2fa,null))[_0xeefc('0x23')](saveUpdates(_0x29f739[_0xeefc('0x46')],null))[_0xeefc('0x23')](respondWithResult(_0x76f2fa,null))[_0xeefc('0x41')](handleError(_0x76f2fa,null));};exports['destroy']=function(_0x5eece6,_0x28e7e9){return db[_0xeefc('0x29')][_0xeefc('0x44')]({'where':{'id':_0x5eece6['params']['id']}})[_0xeefc('0x23')](handleEntityNotFound(_0x28e7e9,null))[_0xeefc('0x23')](removeEntity(_0x28e7e9,null))[_0xeefc('0x41')](handleError(_0x28e7e9,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 57512d4..6a13fcc 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 _0xee11=['lodash','util','../../config/logger','moment','bluebird','path','rimraf','exports','desk_unique_index','idField','FieldId'];(function(_0x48a17b,_0x15fe4b){var _0x3170db=function(_0x46bee6){while(--_0x46bee6){_0x48a17b['push'](_0x48a17b['shift']());}};_0x3170db(++_0x15fe4b);}(_0xee11,0x8f));var _0x1ee1=function(_0x35561d,_0x59a5cf){_0x35561d=_0x35561d-0x0;var _0x2ccc5b=_0xee11[_0x35561d];return _0x2ccc5b;};'use strict';var _=require(_0x1ee1('0x0'));var util=require(_0x1ee1('0x1'));var logger=require(_0x1ee1('0x2'))('api');var moment=require(_0x1ee1('0x3'));var BPromise=require(_0x1ee1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1ee1('0x5'));var rimraf=require(_0x1ee1('0x6'));var config=require('../../config/environment');var attributes=require('./intDeskField.attributes');module[_0x1ee1('0x7')]=function(_0x1c6040,_0x2dbe2e){return _0x1c6040['define']('DeskField',attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0x1ee1('0x8'),'fields':[_0x1ee1('0x9'),_0x1ee1('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x17e0=['../../config/environment','./intDeskField.attributes','exports','DeskField','int_desk_fields','desk_unique_index','FieldId','lodash','util','api','moment','bluebird'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x17e0,0x8b));var _0x017e=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x17e0[_0x13b02f];return _0x12e9a6;};'use strict';var _=require(_0x017e('0x0'));var util=require(_0x017e('0x1'));var logger=require('../../config/logger')(_0x017e('0x2'));var moment=require(_0x017e('0x3'));var BPromise=require(_0x017e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x017e('0x5'));var attributes=require(_0x017e('0x6'));module[_0x017e('0x7')]=function(_0x1b6185,_0x1fcb69){return _0x1b6185['define'](_0x017e('0x8'),attributes,{'tableName':_0x017e('0x9'),'paranoid':![],'indexes':[{'name':_0x017e('0xa'),'fields':['idField',_0x017e('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index 163c374..bb0614a 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 _0xb432=['message','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskField,\x20%s,\x20%s'];(function(_0xf47465,_0x3a9300){var _0x1bee22=function(_0x4809ff){while(--_0x4809ff){_0xf47465['push'](_0xf47465['shift']());}};_0x1bee22(++_0x3a9300);}(_0xb432,0x1b2));var _0x2b43=function(_0x401e77,_0x4b8943){_0x401e77=_0x401e77-0x0;var _0x1fe46a=_0xb432[_0x401e77];return _0x1fe46a;};'use strict';var _=require(_0x2b43('0x0'));var util=require(_0x2b43('0x1'));var moment=require(_0x2b43('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2b43('0x3'));var db=require(_0x2b43('0x4'))['db'];var utils=require(_0x2b43('0x5'));var logger=require(_0x2b43('0x6'))(_0x2b43('0x7'));var config=require(_0x2b43('0x8'));var jayson=require(_0x2b43('0x9'));var client=jayson[_0x2b43('0xa')][_0x2b43('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4719d8,_0x534baa,_0x458152){return new BPromise(function(_0x3dd60f,_0x542906){return client[_0x2b43('0xc')](_0x4719d8,_0x458152)[_0x2b43('0xd')](function(_0x5acec3){logger[_0x2b43('0xe')]('DeskField,\x20%s,\x20%s',_0x534baa,_0x2b43('0xf'));logger[_0x2b43('0x10')](_0x2b43('0x11'),_0x534baa,_0x2b43('0xf'),JSON[_0x2b43('0x12')](_0x5acec3));if(_0x5acec3[_0x2b43('0x13')]){if(_0x5acec3[_0x2b43('0x13')][_0x2b43('0x14')]===0x1f4){logger['error'](_0x2b43('0x15'),_0x534baa,_0x5acec3[_0x2b43('0x13')]['message']);return _0x542906(_0x5acec3[_0x2b43('0x13')][_0x2b43('0x16')]);}logger[_0x2b43('0x13')](_0x2b43('0x15'),_0x534baa,_0x5acec3[_0x2b43('0x13')][_0x2b43('0x16')]);return _0x3dd60f(_0x5acec3[_0x2b43('0x13')][_0x2b43('0x16')]);}else{logger[_0x2b43('0xe')]('DeskField,\x20%s,\x20%s',_0x534baa,'request\x20sent');_0x3dd60f(_0x5acec3[_0x2b43('0x17')][_0x2b43('0x16')]);}})['catch'](function(_0x391416){logger[_0x2b43('0x13')](_0x2b43('0x15'),_0x534baa,_0x391416);_0x542906(_0x391416);});});} \ No newline at end of file +var _0xef05=['moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','then','info','DeskField,\x20%s,\x20%s','request\x20sent','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xef05,0xdb));var _0x5ef0=function(_0x1e6c63,_0x1a4435){_0x1e6c63=_0x1e6c63-0x0;var _0x95fd57=_0xef05[_0x1e6c63];return _0x95fd57;};'use strict';var _=require(_0x5ef0('0x0'));var util=require('util');var moment=require(_0x5ef0('0x1'));var BPromise=require(_0x5ef0('0x2'));var rs=require(_0x5ef0('0x3'));var fs=require('fs');var Redis=require(_0x5ef0('0x4'));var db=require(_0x5ef0('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5ef0('0x6'));var config=require(_0x5ef0('0x7'));var jayson=require(_0x5ef0('0x8'));var client=jayson['client'][_0x5ef0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x349a52,_0xad5ed8,_0x18dfb9){return new BPromise(function(_0x5f30dc,_0x19c5f8){return client['request'](_0x349a52,_0x18dfb9)[_0x5ef0('0xa')](function(_0x4c0edc){logger[_0x5ef0('0xb')](_0x5ef0('0xc'),_0xad5ed8,_0x5ef0('0xd'));logger['debug'](_0x5ef0('0xe'),_0xad5ed8,_0x5ef0('0xd'),JSON[_0x5ef0('0xf')](_0x4c0edc));if(_0x4c0edc[_0x5ef0('0x10')]){if(_0x4c0edc[_0x5ef0('0x10')][_0x5ef0('0x11')]===0x1f4){logger[_0x5ef0('0x10')](_0x5ef0('0xc'),_0xad5ed8,_0x4c0edc[_0x5ef0('0x10')]['message']);return _0x19c5f8(_0x4c0edc[_0x5ef0('0x10')][_0x5ef0('0x12')]);}logger[_0x5ef0('0x10')](_0x5ef0('0xc'),_0xad5ed8,_0x4c0edc[_0x5ef0('0x10')][_0x5ef0('0x12')]);return _0x5f30dc(_0x4c0edc[_0x5ef0('0x10')][_0x5ef0('0x12')]);}else{logger[_0x5ef0('0xb')](_0x5ef0('0xc'),_0xad5ed8,_0x5ef0('0xd'));_0x5f30dc(_0x4c0edc[_0x5ef0('0x13')][_0x5ef0('0x12')]);}})['catch'](function(_0x10f27a){logger['error'](_0x5ef0('0xc'),_0xad5ed8,_0x10f27a);_0x19c5f8(_0x10f27a);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index f084a21..b783706 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 _0x4ef7=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','update','destroy','exports'];(function(_0x1a4496,_0x5c23f5){var _0x15d5ae=function(_0x139d4a){while(--_0x139d4a){_0x1a4496['push'](_0x1a4496['shift']());}};_0x15d5ae(++_0x5c23f5);}(_0x4ef7,0x180));var _0x74ef=function(_0x195046,_0x15026a){_0x195046=_0x195046-0x0;var _0x246ff8=_0x4ef7[_0x195046];return _0x246ff8;};'use strict';var multer=require('multer');var util=require(_0x74ef('0x0'));var path=require(_0x74ef('0x1'));var timeout=require(_0x74ef('0x2'));var express=require(_0x74ef('0x3'));var router=express[_0x74ef('0x4')]();var fs_extra=require(_0x74ef('0x5'));var auth=require(_0x74ef('0x6'));var interaction=require(_0x74ef('0x7'));var config=require(_0x74ef('0x8'));var controller=require(_0x74ef('0x9'));router[_0x74ef('0xa')]('/',auth[_0x74ef('0xb')](),controller[_0x74ef('0xc')]);router[_0x74ef('0xa')](_0x74ef('0xd'),auth[_0x74ef('0xb')](),controller['show']);router['get'](_0x74ef('0xe'),auth[_0x74ef('0xb')](),controller[_0x74ef('0xf')]);router[_0x74ef('0xa')](_0x74ef('0x10'),auth['isAuthenticated'](),controller[_0x74ef('0x11')]);router[_0x74ef('0x12')]('/',auth[_0x74ef('0xb')](),controller[_0x74ef('0x13')]);router[_0x74ef('0x12')](_0x74ef('0xe'),auth[_0x74ef('0xb')](),controller[_0x74ef('0x14')]);router['put'](_0x74ef('0xd'),auth['isAuthenticated'](),controller[_0x74ef('0x15')]);router['delete'](_0x74ef('0xd'),auth[_0x74ef('0xb')](),controller[_0x74ef('0x16')]);module[_0x74ef('0x17')]=router; \ No newline at end of file +var _0xe3b3=['get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intDynamics365Account.controller'];(function(_0x327d6d,_0x29c367){var _0x359a6c=function(_0x2643f2){while(--_0x2643f2){_0x327d6d['push'](_0x327d6d['shift']());}};_0x359a6c(++_0x29c367);}(_0xe3b3,0x10a));var _0x3e3b=function(_0x119a12,_0xacedaf){_0x119a12=_0x119a12-0x0;var _0x41a3b2=_0xe3b3[_0x119a12];return _0x41a3b2;};'use strict';var multer=require(_0x3e3b('0x0'));var util=require(_0x3e3b('0x1'));var path=require(_0x3e3b('0x2'));var timeout=require(_0x3e3b('0x3'));var express=require(_0x3e3b('0x4'));var router=express[_0x3e3b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x3e3b('0x6'));var interaction=require(_0x3e3b('0x7'));var config=require('../../config/environment');var controller=require(_0x3e3b('0x8'));router[_0x3e3b('0x9')]('/',auth[_0x3e3b('0xa')](),controller[_0x3e3b('0xb')]);router[_0x3e3b('0x9')](_0x3e3b('0xc'),auth[_0x3e3b('0xa')](),controller[_0x3e3b('0xd')]);router[_0x3e3b('0x9')](_0x3e3b('0xe'),auth[_0x3e3b('0xa')](),controller[_0x3e3b('0xf')]);router[_0x3e3b('0x9')](_0x3e3b('0x10'),auth[_0x3e3b('0xa')](),controller[_0x3e3b('0x11')]);router[_0x3e3b('0x12')]('/',auth['isAuthenticated'](),controller[_0x3e3b('0x13')]);router[_0x3e3b('0x12')]('/:id/configurations',auth[_0x3e3b('0xa')](),controller[_0x3e3b('0x14')]);router[_0x3e3b('0x15')](_0x3e3b('0xc'),auth[_0x3e3b('0xa')](),controller['update']);router[_0x3e3b('0x16')](_0x3e3b('0xc'),auth[_0x3e3b('0xa')](),controller[_0x3e3b('0x17')]);module[_0x3e3b('0x18')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index ad362c4..d4488a1 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 _0x9976=['exports','STRING'];(function(_0x366718,_0xca8db){var _0x5d4986=function(_0x483a93){while(--_0x483a93){_0x366718['push'](_0x366718['shift']());}};_0x5d4986(++_0xca8db);}(_0x9976,0x1dc));var _0x6997=function(_0x4ec56a,_0x43e930){_0x4ec56a=_0x4ec56a-0x0;var _0xc0cd8d=_0x9976[_0x4ec56a];return _0xc0cd8d;};'use strict';var Sequelize=require('sequelize');module[_0x6997('0x0')]={'name':{'type':Sequelize[_0x6997('0x1')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x6997('0x1')]},'remoteUri':{'type':Sequelize[_0x6997('0x1')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x6997('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x6997('0x1')]}}; \ No newline at end of file +var _0xdb84=['STRING','sequelize','exports'];(function(_0x2eb736,_0x541c0c){var _0x23c426=function(_0x46bc0a){while(--_0x46bc0a){_0x2eb736['push'](_0x2eb736['shift']());}};_0x23c426(++_0x541c0c);}(_0xdb84,0x76));var _0x4db8=function(_0x583967,_0x502dc1){_0x583967=_0x583967-0x0;var _0x2598ac=_0xdb84[_0x583967];return _0x2598ac;};'use strict';var Sequelize=require(_0x4db8('0x0'));module[_0x4db8('0x1')]={'name':{'type':Sequelize[_0x4db8('0x2')]},'username':{'type':Sequelize[_0x4db8('0x2')]},'password':{'type':Sequelize[_0x4db8('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0x4db8('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x4db8('0x2')]},'serverUrl':{'type':Sequelize[_0x4db8('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 563bd65..cd2ac73 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 _0xa049=['tenantId','slice','substring','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','password','clientSecret','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','4.0','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','remove','includes','LogicalName','@odata.type','push','forEach','isNil','lastIndexOf','BooleanAttributeMetadata','all','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','test','statusCode','error','stack','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Bearer\x20','OptionSet','Options','Label','Value','DisplayName','UserLocalizedLabel',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false','?$select=DisplayName,LogicalName','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','end','name','send','index','map','Dynamics365Account','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','merge','options','then','includeAll','include','findAll','rows','show','params','catch','create','body','find','findOne','Dynamics365Configuration','where','getConfigurations','hasOwnProperty','addConfiguration','Subjects','channel','Descriptions','Dynamics365Field','getFields','ticketType','incident','PhoneCall','title','description','customerid','caseorigincode','subject','phonenumber','directioncode','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyyominame','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','entityimage_url','firstresponsebykpiidname','followupby','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','remoteUri'];(function(_0x1e24f8,_0x52070f){var _0x5c4446=function(_0x40bf51){while(--_0x40bf51){_0x1e24f8['push'](_0x1e24f8['shift']());}};_0x5c4446(++_0x52070f);}(_0xa049,0x1db));var _0x9a04=function(_0x1db153,_0x1ab5d){_0x1db153=_0x1db153-0x0;var _0x530cbe=_0xa049[_0x1db153];return _0x530cbe;};'use strict';var emlformat=require(_0x9a04('0x0'));var rimraf=require(_0x9a04('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9a04('0x2'));var rp=require(_0x9a04('0x3'));var moment=require(_0x9a04('0x4'));var BPromise=require(_0x9a04('0x5'));var Mustache=require(_0x9a04('0x6'));var util=require(_0x9a04('0x7'));var path=require(_0x9a04('0x8'));var sox=require(_0x9a04('0x9'));var csv=require(_0x9a04('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9a04('0xb'));var _=require(_0x9a04('0xc'));var squel=require('squel');var crypto=require(_0x9a04('0xd'));var jsforce=require(_0x9a04('0xe'));var deskjs=require(_0x9a04('0xf'));var toCsv=require(_0x9a04('0xa'));var querystring=require(_0x9a04('0x10'));var Papa=require(_0x9a04('0x11'));var Redis=require('ioredis');var authService=require(_0x9a04('0x12'));var qs=require(_0x9a04('0x13'));var as=require(_0x9a04('0x14'));var hardwareService=require(_0x9a04('0x15'));var logger=require(_0x9a04('0x16'))(_0x9a04('0x17'));var utils=require('../../config/utils');var config=require(_0x9a04('0x18'));var licenseUtil=require(_0x9a04('0x19'));var db=require(_0x9a04('0x1a'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2fbfe9,_0x279d98){_0x279d98=_0x279d98||0xcc;return function(_0x228fd9){if(_0x228fd9){return _0x2fbfe9[_0x9a04('0x1b')](_0x279d98);}return _0x2fbfe9[_0x9a04('0x1c')](_0x279d98)['end']();};}function respondWithResult(_0x453104,_0x49a642){_0x49a642=_0x49a642||0xc8;return function(_0xef2ada){if(_0xef2ada){return _0x453104[_0x9a04('0x1c')](_0x49a642)['json'](_0xef2ada);}};}function respondWithFilteredResult(_0xd5159,_0x12b723){return function(_0x549aeb){if(_0x549aeb){var _0x8637bb=typeof _0x12b723[_0x9a04('0x1d')]===_0x9a04('0x1e')&&typeof _0x12b723[_0x9a04('0x1f')]===_0x9a04('0x1e');var _0x54d0c8=_0x549aeb[_0x9a04('0x20')];var _0x27e434=_0x8637bb?0x0:_0x12b723[_0x9a04('0x1d')];var _0x29fd7d=_0x8637bb?_0x549aeb[_0x9a04('0x20')]:_0x12b723[_0x9a04('0x1d')]+_0x12b723[_0x9a04('0x1f')];var _0x551347;if(_0x29fd7d>=_0x54d0c8){_0x29fd7d=_0x54d0c8;_0x551347=0xc8;}else{_0x551347=0xce;}_0xd5159['status'](_0x551347);return _0xd5159[_0x9a04('0x21')](_0x9a04('0x22'),_0x27e434+'-'+_0x29fd7d+'/'+_0x54d0c8)[_0x9a04('0x23')](_0x549aeb);}return null;};}function patchUpdates(_0x1cc722){return function(_0x8ff643){try{jsonpatch[_0x9a04('0x24')](_0x8ff643,_0x1cc722,!![]);}catch(_0x1933f1){return BPromise[_0x9a04('0x25')](_0x1933f1);}return _0x8ff643[_0x9a04('0x26')]();};}function saveUpdates(_0x46d635,_0x4c5116){return function(_0x1d8eca){if(_0x1d8eca){return _0x1d8eca[_0x9a04('0x27')](_0x46d635)['then'](function(_0x15702e){return _0x15702e;});}return null;};}function removeEntity(_0xdbeafd,_0x38c515){return function(_0x4a949c){if(_0x4a949c){return _0x4a949c[_0x9a04('0x28')]()['then'](function(){_0xdbeafd[_0x9a04('0x1c')](0xcc)[_0x9a04('0x29')]();});}};}function handleEntityNotFound(_0x53dd43,_0x119b6b){return function(_0x2d5883){if(!_0x2d5883){_0x53dd43[_0x9a04('0x1b')](0x194);}return _0x2d5883;};}function handleError(_0x2c67ea,_0x13712e){_0x13712e=_0x13712e||0x1f4;return function(_0x1c3cd1){logger['error'](_0x1c3cd1['stack']);if(_0x1c3cd1[_0x9a04('0x2a')]){delete _0x1c3cd1[_0x9a04('0x2a')];}_0x2c67ea[_0x9a04('0x1c')](_0x13712e)[_0x9a04('0x2b')](_0x1c3cd1);};}exports[_0x9a04('0x2c')]=function(_0x334637,_0x3fd094){var _0x40717e={},_0xa0354f={},_0x505432={'count':0x0,'rows':[]};var _0xce8658=_[_0x9a04('0x2d')](db[_0x9a04('0x2e')][_0x9a04('0x2f')],function(_0x236055){return{'name':_0x236055[_0x9a04('0x30')],'type':_0x236055[_0x9a04('0x31')][_0x9a04('0x32')]};});_0xa0354f[_0x9a04('0x33')]=_[_0x9a04('0x2d')](_0xce8658,_0x9a04('0x2a'));_0xa0354f[_0x9a04('0x34')]=_[_0x9a04('0x35')](_0x334637[_0x9a04('0x34')]);_0xa0354f[_0x9a04('0x36')]=_[_0x9a04('0x37')](_0xa0354f[_0x9a04('0x33')],_0xa0354f[_0x9a04('0x34')]);_0x40717e[_0x9a04('0x38')]=_[_0x9a04('0x37')](_0xa0354f[_0x9a04('0x33')],qs[_0x9a04('0x39')](_0x334637['query'][_0x9a04('0x39')]));_0x40717e[_0x9a04('0x38')]=_0x40717e[_0x9a04('0x38')][_0x9a04('0x3a')]?_0x40717e[_0x9a04('0x38')]:_0xa0354f['model'];if(!_0x334637['query']['hasOwnProperty'](_0x9a04('0x3b'))){_0x40717e[_0x9a04('0x1f')]=qs[_0x9a04('0x1f')](_0x334637[_0x9a04('0x34')][_0x9a04('0x1f')]);_0x40717e[_0x9a04('0x1d')]=qs[_0x9a04('0x1d')](_0x334637[_0x9a04('0x34')][_0x9a04('0x1d')]);}_0x40717e[_0x9a04('0x3c')]=qs[_0x9a04('0x3d')](_0x334637[_0x9a04('0x34')][_0x9a04('0x3d')]);_0x40717e['where']=qs[_0x9a04('0x36')](_[_0x9a04('0x3e')](_0x334637[_0x9a04('0x34')],_0xa0354f[_0x9a04('0x36')]),_0xce8658);if(_0x334637[_0x9a04('0x34')][_0x9a04('0x3f')]){_0x40717e['where']=_[_0x9a04('0x40')](_0x40717e['where'],{'$or':_[_0x9a04('0x2d')](_0xce8658,function(_0xb9addf){if(_0xb9addf['type']!=='VIRTUAL'){var _0x525cc2={};_0x525cc2[_0xb9addf[_0x9a04('0x2a')]]={'$like':'%'+_0x334637[_0x9a04('0x34')][_0x9a04('0x3f')]+'%'};return _0x525cc2;}})});}_0x40717e=_['merge']({},_0x40717e,_0x334637[_0x9a04('0x41')]);var _0x4908a3={'where':_0x40717e['where']};return db[_0x9a04('0x2e')][_0x9a04('0x20')](_0x4908a3)[_0x9a04('0x42')](function(_0x53958f){_0x505432[_0x9a04('0x20')]=_0x53958f;if(_0x334637[_0x9a04('0x34')][_0x9a04('0x43')]){_0x40717e[_0x9a04('0x44')]=[{'all':!![]}];}return db[_0x9a04('0x2e')][_0x9a04('0x45')](_0x40717e);})[_0x9a04('0x42')](function(_0x34520f){_0x505432[_0x9a04('0x46')]=_0x34520f;return _0x505432;})['then'](respondWithFilteredResult(_0x3fd094,_0x40717e))['catch'](handleError(_0x3fd094,null));};exports[_0x9a04('0x47')]=function(_0x324a5a,_0x579d6e){var _0x3b7866={'raw':![],'where':{'id':_0x324a5a[_0x9a04('0x48')]['id']}},_0x3daa03={};_0x3daa03[_0x9a04('0x33')]=_['keys'](db[_0x9a04('0x2e')][_0x9a04('0x2f')]);_0x3daa03[_0x9a04('0x34')]=_[_0x9a04('0x35')](_0x324a5a[_0x9a04('0x34')]);_0x3daa03[_0x9a04('0x36')]=_[_0x9a04('0x37')](_0x3daa03[_0x9a04('0x33')],_0x3daa03[_0x9a04('0x34')]);_0x3b7866['attributes']=_[_0x9a04('0x37')](_0x3daa03[_0x9a04('0x33')],qs[_0x9a04('0x39')](_0x324a5a[_0x9a04('0x34')][_0x9a04('0x39')]));_0x3b7866[_0x9a04('0x38')]=_0x3b7866['attributes'][_0x9a04('0x3a')]?_0x3b7866['attributes']:_0x3daa03['model'];if(_0x324a5a['query'][_0x9a04('0x43')]){_0x3b7866['include']=[{'all':!![]}];}_0x3b7866=_[_0x9a04('0x40')]({},_0x3b7866,_0x324a5a[_0x9a04('0x41')]);return db[_0x9a04('0x2e')]['find'](_0x3b7866)[_0x9a04('0x42')](handleEntityNotFound(_0x579d6e,null))[_0x9a04('0x42')](respondWithResult(_0x579d6e,null))[_0x9a04('0x49')](handleError(_0x579d6e,null));};exports[_0x9a04('0x4a')]=function(_0x251656,_0x4b450e){return db[_0x9a04('0x2e')]['create'](_0x251656['body'],{})['then'](respondWithResult(_0x4b450e,0xc9))['catch'](handleError(_0x4b450e,null));};exports[_0x9a04('0x27')]=function(_0x234d74,_0x313c6a){if(_0x234d74[_0x9a04('0x4b')]['id']){delete _0x234d74['body']['id'];}return db[_0x9a04('0x2e')][_0x9a04('0x4c')]({'where':{'id':_0x234d74[_0x9a04('0x48')]['id']}})[_0x9a04('0x42')](handleEntityNotFound(_0x313c6a,null))['then'](saveUpdates(_0x234d74[_0x9a04('0x4b')],null))[_0x9a04('0x42')](respondWithResult(_0x313c6a,null))[_0x9a04('0x49')](handleError(_0x313c6a,null));};exports['destroy']=function(_0x2ac0eb,_0x35c549){return db[_0x9a04('0x2e')]['find']({'where':{'id':_0x2ac0eb[_0x9a04('0x48')]['id']}})[_0x9a04('0x42')](handleEntityNotFound(_0x35c549,null))[_0x9a04('0x42')](removeEntity(_0x35c549,null))['catch'](handleError(_0x35c549,null));};exports['getConfigurations']=function(_0x416316,_0x214440,_0x578d14){var _0x21789e={};var _0x4757d0={};var _0x4c449e;var _0x42c18e;return db[_0x9a04('0x2e')][_0x9a04('0x4d')]({'where':{'id':_0x416316[_0x9a04('0x48')]['id']}})[_0x9a04('0x42')](handleEntityNotFound(_0x214440,null))[_0x9a04('0x42')](function(_0x277e71){if(_0x277e71){_0x4c449e=_0x277e71;_0x4757d0[_0x9a04('0x33')]=_[_0x9a04('0x35')](db[_0x9a04('0x4e')][_0x9a04('0x2f')]);_0x4757d0[_0x9a04('0x34')]=_['keys'](_0x416316[_0x9a04('0x34')]);_0x4757d0[_0x9a04('0x36')]=_['intersection'](_0x4757d0[_0x9a04('0x33')],_0x4757d0[_0x9a04('0x34')]);_0x21789e[_0x9a04('0x38')]=_[_0x9a04('0x37')](_0x4757d0[_0x9a04('0x33')],qs[_0x9a04('0x39')](_0x416316['query'][_0x9a04('0x39')]));_0x21789e[_0x9a04('0x38')]=_0x21789e[_0x9a04('0x38')][_0x9a04('0x3a')]?_0x21789e[_0x9a04('0x38')]:_0x4757d0[_0x9a04('0x33')];_0x21789e[_0x9a04('0x3c')]=qs[_0x9a04('0x3d')](_0x416316[_0x9a04('0x34')]['sort']);_0x21789e[_0x9a04('0x4f')]=qs['filters'](_[_0x9a04('0x3e')](_0x416316[_0x9a04('0x34')],_0x4757d0[_0x9a04('0x36')]));if(_0x416316['query'][_0x9a04('0x3f')]){_0x21789e['where']=_[_0x9a04('0x40')](_0x21789e[_0x9a04('0x4f')],{'$or':_[_0x9a04('0x2d')](_0x21789e[_0x9a04('0x38')],function(_0x464b43){var _0x3f50fe={};_0x3f50fe[_0x464b43]={'$like':'%'+_0x416316['query'][_0x9a04('0x3f')]+'%'};return _0x3f50fe;})});}_0x21789e=_['merge']({},_0x21789e,_0x416316['options']);return _0x4c449e[_0x9a04('0x50')](_0x21789e);}})['then'](function(_0x1324c5){if(_0x1324c5){_0x42c18e=_0x1324c5[_0x9a04('0x3a')];if(!_0x416316['query'][_0x9a04('0x51')](_0x9a04('0x3b'))){_0x21789e[_0x9a04('0x1f')]=qs[_0x9a04('0x1f')](_0x416316[_0x9a04('0x34')][_0x9a04('0x1f')]);_0x21789e['offset']=qs[_0x9a04('0x1d')](_0x416316['query']['offset']);}return _0x4c449e[_0x9a04('0x50')](_0x21789e);}})['then'](function(_0x17a04a){if(_0x17a04a){return _0x17a04a?{'count':_0x42c18e,'rows':_0x17a04a}:null;}})['then'](respondWithResult(_0x214440,null))[_0x9a04('0x49')](handleError(_0x214440,null));};exports[_0x9a04('0x52')]=function(_0x1e1431,_0x2934ec,_0x452e0f){if(_0x1e1431[_0x9a04('0x4b')]['id']){delete _0x1e1431[_0x9a04('0x4b')]['id'];}return db[_0x9a04('0x2e')][_0x9a04('0x4d')]({'where':{'id':_0x1e1431[_0x9a04('0x48')]['id']}})[_0x9a04('0x42')](handleEntityNotFound(_0x2934ec,null))['then'](function(_0x5e1449){if(_0x5e1449){_0x1e1431[_0x9a04('0x4b')]['AccountId']=_0x5e1449['id'];_0x1e1431[_0x9a04('0x4b')][_0x9a04('0x53')]=integrations['getSubjects'](_0x1e1431[_0x9a04('0x4b')][_0x9a04('0x54')],_0x1e1431[_0x9a04('0x4b')][_0x9a04('0x31')]);_0x1e1431[_0x9a04('0x4b')][_0x9a04('0x55')]=integrations['getDescriptions'](_0x1e1431[_0x9a04('0x4b')][_0x9a04('0x54')],_0x1e1431[_0x9a04('0x4b')][_0x9a04('0x31')]);return db[_0x9a04('0x4e')][_0x9a04('0x4a')](_0x1e1431[_0x9a04('0x4b')],{'include':[{'model':db[_0x9a04('0x56')],'as':_0x9a04('0x53')},{'model':db[_0x9a04('0x56')],'as':_0x9a04('0x55')}]});}return null;})[_0x9a04('0x42')](respondWithResult(_0x2934ec,null))[_0x9a04('0x49')](handleError(_0x2934ec,null));};exports[_0x9a04('0x57')]=function(_0x26ec03,_0x4e10e5,_0x523ddc){var _0x52520e=_0x26ec03['query'][_0x9a04('0x58')];var _0x435af5=_0x52520e===_0x9a04('0x59')?'Incident':_0x9a04('0x5a');var _0x446cbb='';var _0x21aff3='';var _0x120c7e='';var _0x4602e8='';var _0x4229d6='';var _0xf8c63c='';var _0x16fd5c='';var _0x4c8dad='';var _0x41cf8f=[_0x9a04('0x5b'),_0x9a04('0x5c'),_0x9a04('0x5d'),'ownerid',_0x9a04('0x5e'),_0x9a04('0x5f'),_0x9a04('0x60'),'regardingobjectid',_0x9a04('0x61'),'phonecall_activity_parties'];var _0x4fbd7d=[_0x9a04('0x62'),_0x9a04('0x63'),_0x9a04('0x64'),_0x9a04('0x65'),_0x9a04('0x66'),_0x9a04('0x67'),_0x9a04('0x68'),_0x9a04('0x69'),_0x9a04('0x6a'),'createdbyexternalpartyyominame','createdbyname',_0x9a04('0x6b'),'createdon','createdonbehalfbyname',_0x9a04('0x6c'),_0x9a04('0x6d'),_0x9a04('0x6e'),_0x9a04('0x6f'),'emailaddress','entitlementidname','entityimage_timestamp',_0x9a04('0x70'),'escalatedon','exchangerate',_0x9a04('0x71'),_0x9a04('0x72'),'importsequencenumber','influencescore',_0x9a04('0x73'),_0x9a04('0x74'),_0x9a04('0x75'),_0x9a04('0x76'),'modifiedbyexternalpartyyominame','modifiedbyname',_0x9a04('0x77'),_0x9a04('0x78'),_0x9a04('0x79'),_0x9a04('0x7a'),_0x9a04('0x7b'),_0x9a04('0x7c'),_0x9a04('0x7d'),_0x9a04('0x7e'),_0x9a04('0x7f'),_0x9a04('0x80'),_0x9a04('0x81'),_0x9a04('0x82'),'parentcaseidname',_0x9a04('0x83'),_0x9a04('0x84'),_0x9a04('0x85'),_0x9a04('0x86'),'productserialnumber',_0x9a04('0x87'),_0x9a04('0x88'),_0x9a04('0x89'),_0x9a04('0x8a'),_0x9a04('0x8b'),_0x9a04('0x8c'),_0x9a04('0x8d'),_0x9a04('0x8e'),_0x9a04('0x8f'),_0x9a04('0x90'),_0x9a04('0x91'),_0x9a04('0x92'),'ticketnumber',_0x9a04('0x93'),_0x9a04('0x94'),_0x9a04('0x95'),_0x9a04('0x96'),_0x9a04('0x97')];var _0x846209=_0x41cf8f[_0x9a04('0x98')](_0x4fbd7d);return db[_0x9a04('0x2e')]['findOne']({'where':{'id':_0x26ec03['params']['id']},'attributes':['id',_0x9a04('0x99'),'password',_0x9a04('0x9a'),_0x9a04('0x9b'),'clientId','clientSecret']})['then'](handleEntityNotFound(_0x4e10e5,null))[_0x9a04('0x42')](function(_0x166501){if(_0x166501){_0x4c8dad=_0x166501[_0x9a04('0x9a')];var _0x5a030a=_0x4c8dad[_0x9a04('0x9c')](-0x1);if(_0x5a030a==='/'){_0x4c8dad=_0x4c8dad[_0x9a04('0x9d')](0x0,_0x4c8dad['lastIndexOf'](_0x5a030a));}_0x16fd5c=util[_0x9a04('0x9e')](_0x9a04('0x9f'),_0x4c8dad);var _0x2b5f73={'method':_0x9a04('0xa0'),'uri':_0x9a04('0xa1')+_0x166501[_0x9a04('0x9b')]+'/oauth2/token','form':{'client_id':_0x166501['clientId'],'resource':_0x4c8dad,'username':_0x166501[_0x9a04('0x99')],'password':_0x166501[_0x9a04('0xa2')],'grant_type':'password','client_secret':_0x166501[_0x9a04('0xa3')]},'json':!![]};return rp(_0x2b5f73);}})[_0x9a04('0x42')](function(_0x20bae3){_0xf8c63c=_0x20bae3[_0x9a04('0xa4')];var _0x5af330={'method':_0x9a04('0xa5'),'uri':encodeURI(_0x16fd5c+_0x9a04('0xa6')+_0x435af5+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0xf8c63c,'If-None-Match':null,'OData-Version':_0x9a04('0xa7')},'json':!![]};return rp(_0x5af330);})['then'](function(_0x4d34f1){var _0x4a0c05=_0x4d34f1['value'][0x0];var _0x329557=_0x4a0c05[_0x9a04('0xa8')];var _0x7dfccd={'method':'GET','uri':_0x16fd5c+_0x9a04('0xa9')+_0x329557+_0x9a04('0xaa'),'headers':{'Authorization':'Bearer\x20'+_0xf8c63c,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x7dfccd);})[_0x9a04('0x42')](function(_0xf1ba74){_0x446cbb=_0xf1ba74;_0x21aff3=_0x446cbb['Attributes'];_0x21aff3=_[_0x9a04('0xab')](_0x21aff3,function(_0x3e75a3){return!_0x846209[_0x9a04('0xac')](_0x3e75a3[_0x9a04('0xad')]);});var _0x354539=[];var _0x4700da=[];_0x21aff3['forEach'](function(_0x4521f2){if(_0x4521f2['@odata.type']){var _0x1a4985=_0x4521f2['@odata.type'][_0x9a04('0x9d')](_0x4521f2[_0x9a04('0xae')]['lastIndexOf']('.')+0x1);if(_0x1a4985==='PicklistAttributeMetadata'){_0x354539[_0x9a04('0xaf')](getSelectList(_0x16fd5c,_0x52520e,_0x4700da,_0x446cbb[_0x9a04('0xa8')],_0x4521f2[_0x9a04('0xa8')],_0xf8c63c));}}});return Promise['all'](_0x354539);})[_0x9a04('0x42')](function(_0x35a3d4){_0x120c7e=_0x35a3d4[0x0];var _0x5aaf0f=[];var _0x50ad73=[];_0x21aff3[_0x9a04('0xb0')](function(_0x340f9a){if(!_[_0x9a04('0xb1')](_0x340f9a[_0x9a04('0xae')])){var _0x5db44b=_0x340f9a[_0x9a04('0xae')][_0x9a04('0x9d')](_0x340f9a['@odata.type'][_0x9a04('0xb2')]('.')+0x1);if(_0x5db44b===_0x9a04('0xb3')){_0x5aaf0f['push'](getBooleanList(_0x16fd5c,_0x52520e,_0x50ad73,_0x446cbb[_0x9a04('0xa8')],_0x340f9a[_0x9a04('0xa8')],_0xf8c63c));}}});return Promise[_0x9a04('0xb4')](_0x5aaf0f);})[_0x9a04('0x42')](function(_0x57a91f){_0x4602e8=_0x57a91f[0x0];var _0x5ee66e=[];var _0xa12768=[];_0x21aff3[_0x9a04('0xb0')](function(_0x422a69){if(_0x422a69[_0x9a04('0xae')]){var _0x52c30a=_0x422a69[_0x9a04('0xae')][_0x9a04('0x9d')](_0x422a69[_0x9a04('0xae')][_0x9a04('0xb2')]('.')+0x1);if(_0x52c30a===_0x9a04('0xb5')||_0x52c30a===_0x9a04('0xb6')||_0x52c30a===_0x9a04('0xb7')||_0x52c30a===_0x9a04('0xb8')||_0x52c30a===_0x9a04('0xb9')||_0x52c30a==='DateTimeAttributeMetadata'||_0x52c30a===_0x9a04('0xba')||_0x52c30a===_0x9a04('0xbb')||_0x52c30a==='StateAttributeMetadata'||_0x52c30a===_0x9a04('0xbc')){_0x5ee66e[_0x9a04('0xaf')](getInputList(_0x16fd5c,_0x52520e,_0x52c30a,_0xa12768,_0x446cbb['MetadataId'],_0x422a69[_0x9a04('0xa8')],_0xf8c63c));}}});return Promise[_0x9a04('0xb4')](_0x5ee66e);})[_0x9a04('0x42')](function(_0x37436e){_0x4229d6=_0x37436e[0x0];var _0x5c2549=_0x120c7e[_0x9a04('0x98')](_0x4602e8)[_0x9a04('0x98')](_0x4229d6);var _0x2dd44f={'count':_0x5c2549['length'],'rows':_0x5c2549};return _0x2dd44f;})[_0x9a04('0x42')](respondWithResult(_0x4e10e5,null))[_0x9a04('0x49')](function(_0x408f81){var _0x5345d5=_0x26ec03[_0x9a04('0x34')][_0x9a04('0xbd')]?0x1f4:_0x408f81[_0x9a04('0xbe')]||0x1f4;logger[_0x9a04('0xbf')](_0x408f81[_0x9a04('0xc0')]);delete _0x408f81['name'];if(_0x5345d5===0x191){_0x5345d5=0x190;}_0x4e10e5[_0x9a04('0x1c')](_0x5345d5)[_0x9a04('0x2b')](_0x26ec03[_0x9a04('0x34')][_0x9a04('0xbd')]?{'message':_0x9a04('0xc1'),'statusCode':_0x408f81[_0x9a04('0xbe')]}:_0x408f81);});};function getSelectList(_0x5f1dc5,_0x55d8d6,_0x1ef42c,_0x50bae2,_0x35bd81,_0x6e0e8b){var _0x32788a={'method':_0x9a04('0xa5'),'uri':_0x5f1dc5+'EntityDefinitions('+_0x50bae2+_0x9a04('0xc2')+_0x35bd81+_0x9a04('0xc3')+_0x9a04('0xc4'),'headers':{'Authorization':_0x9a04('0xc5')+_0x6e0e8b,'If-None-Match':null,'OData-Version':_0x9a04('0xa7')},'json':!![]};return rp(_0x32788a)[_0x9a04('0x42')](function(_0x1c6aed){var _0x597592=[];var _0x3b13b3=_0x1c6aed[_0x9a04('0xc6')][_0x9a04('0xc7')];_0x3b13b3[_0x9a04('0xb0')](function(_0x30dad5){_0x597592[_0x9a04('0xaf')]({'name':_0x30dad5[_0x9a04('0xc8')]['UserLocalizedLabel'][_0x9a04('0xc8')],'value':String(_0x30dad5[_0x9a04('0xc9')])});});var _0x51f5e7={'id':_0x55d8d6+'_'+_0x1c6aed[_0x9a04('0xad')],'name':_0x1c6aed[_0x9a04('0xca')][_0x9a04('0xcb')][_0x9a04('0xc8')],'custom':![],'options':_0x597592};_0x1ef42c[_0x9a04('0xaf')](_0x51f5e7);return _0x1ef42c;});}function getBooleanList(_0x438303,_0x2e1bc8,_0x2fc7b2,_0x47ec9d,_0x5b8bf8,_0x4648e0){var _0x201f71={'method':_0x9a04('0xa5'),'uri':_0x438303+_0x9a04('0xa9')+_0x47ec9d+_0x9a04('0xc2')+_0x5b8bf8+_0x9a04('0xcc'),'headers':{'Authorization':_0x9a04('0xc5')+_0x4648e0,'If-None-Match':null,'OData-Version':_0x9a04('0xa7')},'json':!![]};return rp(_0x201f71)[_0x9a04('0x42')](function(_0x2a86b3){var _0x67df82=[];_0x67df82[_0x9a04('0xaf')]({'name':_0x2a86b3[_0x9a04('0xc6')][_0x9a04('0xcd')][_0x9a04('0xc8')][_0x9a04('0xcb')]['Label'],'value':_0x9a04('0xce')},{'name':_0x2a86b3['OptionSet'][_0x9a04('0xcf')][_0x9a04('0xc8')][_0x9a04('0xcb')][_0x9a04('0xc8')],'value':_0x9a04('0xd0')});var _0x4092f={'id':_0x2e1bc8+'_'+_0x2a86b3[_0x9a04('0xad')],'name':_0x2a86b3[_0x9a04('0xca')][_0x9a04('0xcb')][_0x9a04('0xc8')],'custom':![],'options':_0x67df82};_0x2fc7b2['push'](_0x4092f);return _0x2fc7b2;});}function getInputList(_0x249ff0,_0x3f2656,_0x8ae0b2,_0xa99397,_0x19c99b,_0x27a858,_0x249cc5){var _0x15a3c8={'method':_0x9a04('0xa5'),'uri':_0x249ff0+_0x9a04('0xa9')+_0x19c99b+_0x9a04('0xc2')+_0x27a858+')/Microsoft.Dynamics.CRM.'+_0x8ae0b2+_0x9a04('0xd1'),'headers':{'Authorization':'Bearer\x20'+_0x249cc5,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x15a3c8)['then'](function(_0x19ff00){var _0x92471f={'id':_0x3f2656+'_'+_0x19ff00[_0x9a04('0xad')],'name':_0x19ff00[_0x9a04('0xca')][_0x9a04('0xcb')]?_0x19ff00[_0x9a04('0xca')][_0x9a04('0xcb')][_0x9a04('0xc8')]:_0x19ff00[_0x9a04('0xad')],'custom':![],'options':[]};_0xa99397[_0x9a04('0xaf')](_0x92471f);return _0xa99397;});} \ No newline at end of file +var _0x7868=['/oauth2/token','password','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','forEach','@odata.type','lastIndexOf','PicklistAttributeMetadata','push','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','BigIntAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','Wrong\x20credentials','statusCode','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','Label','LogicalName','DisplayName','UserLocalizedLabel',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','true','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','index','map','Dynamics365Account','type','key','model','query','keys','filters','fields','attributes','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','show','params','intersection','create','catch','body','find','getConfigurations','rawAttributes','order','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Configuration','Dynamics365Field','getFields','ticketType','PhoneCall','title','description','customerid','ownerid','subject','phonenumber','regardingobjectid','phonecall_activity_parties','accountidname','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','followupby','importsequencenumber','kbarticleidname','masteridname','modifiedbyexternalpartyyominame','modifiedonbehalfbyname','modifiedonbehalfbyyominame','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productserialnumber','resolveby','responseby','responsiblecontactidyominame','slainvokedidname','statecode','statuscode','subjectidname','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','concat','username','remoteUri','tenantId','clientId','clientSecret','slice','substring','format','%s/api/data/v9.0/','POST'];(function(_0x1f3635,_0x51b6ec){var _0x446afc=function(_0x414411){while(--_0x414411){_0x1f3635['push'](_0x1f3635['shift']());}};_0x446afc(++_0x51b6ec);}(_0x7868,0x1c0));var _0x8786=function(_0x46a01e,_0x25c0a0){_0x46a01e=_0x46a01e-0x0;var _0x210c27=_0x7868[_0x46a01e];return _0x210c27;};'use strict';var emlformat=require(_0x8786('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8786('0x1'));var jsonpatch=require(_0x8786('0x2'));var rp=require(_0x8786('0x3'));var moment=require(_0x8786('0x4'));var BPromise=require(_0x8786('0x5'));var Mustache=require('mustache');var util=require(_0x8786('0x6'));var path=require(_0x8786('0x7'));var sox=require(_0x8786('0x8'));var csv=require(_0x8786('0x9'));var ejs=require(_0x8786('0xa'));var fs=require('fs');var fs_extra=require(_0x8786('0xb'));var _=require(_0x8786('0xc'));var squel=require(_0x8786('0xd'));var crypto=require(_0x8786('0xe'));var jsforce=require(_0x8786('0xf'));var deskjs=require(_0x8786('0x10'));var toCsv=require(_0x8786('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8786('0x11'));var authService=require(_0x8786('0x12'));var qs=require(_0x8786('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8786('0x14'))('api');var utils=require(_0x8786('0x15'));var config=require(_0x8786('0x16'));var licenseUtil=require(_0x8786('0x17'));var db=require(_0x8786('0x18'))['db'];var integrations=require(_0x8786('0x19'));function respondWithStatusCode(_0x46ead4,_0x58f255){_0x58f255=_0x58f255||0xcc;return function(_0x1a0f59){if(_0x1a0f59){return _0x46ead4[_0x8786('0x1a')](_0x58f255);}return _0x46ead4['status'](_0x58f255)[_0x8786('0x1b')]();};}function respondWithResult(_0x1d3dd3,_0x5cde1d){_0x5cde1d=_0x5cde1d||0xc8;return function(_0x130f3d){if(_0x130f3d){return _0x1d3dd3[_0x8786('0x1c')](_0x5cde1d)[_0x8786('0x1d')](_0x130f3d);}};}function respondWithFilteredResult(_0x438bad,_0x5975bf){return function(_0x54d9f6){if(_0x54d9f6){var _0x4f599e=typeof _0x5975bf[_0x8786('0x1e')]===_0x8786('0x1f')&&typeof _0x5975bf[_0x8786('0x20')]===_0x8786('0x1f');var _0x4fcf1c=_0x54d9f6[_0x8786('0x21')];var _0x3b9ff1=_0x4f599e?0x0:_0x5975bf[_0x8786('0x1e')];var _0x359f68=_0x4f599e?_0x54d9f6[_0x8786('0x21')]:_0x5975bf[_0x8786('0x1e')]+_0x5975bf[_0x8786('0x20')];var _0x643c33;if(_0x359f68>=_0x4fcf1c){_0x359f68=_0x4fcf1c;_0x643c33=0xc8;}else{_0x643c33=0xce;}_0x438bad[_0x8786('0x1c')](_0x643c33);return _0x438bad['set'](_0x8786('0x22'),_0x3b9ff1+'-'+_0x359f68+'/'+_0x4fcf1c)[_0x8786('0x1d')](_0x54d9f6);}return null;};}function patchUpdates(_0x28f0b6){return function(_0x26eeba){try{jsonpatch[_0x8786('0x23')](_0x26eeba,_0x28f0b6,!![]);}catch(_0x5ca4e7){return BPromise[_0x8786('0x24')](_0x5ca4e7);}return _0x26eeba[_0x8786('0x25')]();};}function saveUpdates(_0x5de3ef,_0x13a7b0){return function(_0x1af37a){if(_0x1af37a){return _0x1af37a[_0x8786('0x26')](_0x5de3ef)['then'](function(_0x5165f7){return _0x5165f7;});}return null;};}function removeEntity(_0x529247,_0x27f85e){return function(_0x33346d){if(_0x33346d){return _0x33346d[_0x8786('0x27')]()['then'](function(){_0x529247[_0x8786('0x1c')](0xcc)[_0x8786('0x1b')]();});}};}function handleEntityNotFound(_0xcd7d9,_0x30fd5e){return function(_0x9f348e){if(!_0x9f348e){_0xcd7d9['sendStatus'](0x194);}return _0x9f348e;};}function handleError(_0x4a17f3,_0x30091c){_0x30091c=_0x30091c||0x1f4;return function(_0x78f355){logger[_0x8786('0x28')](_0x78f355[_0x8786('0x29')]);if(_0x78f355[_0x8786('0x2a')]){delete _0x78f355[_0x8786('0x2a')];}_0x4a17f3[_0x8786('0x1c')](_0x30091c)[_0x8786('0x2b')](_0x78f355);};}exports[_0x8786('0x2c')]=function(_0xd796e7,_0x49ab14){var _0x5b5af0={},_0x5966cb={},_0x26a132={'count':0x0,'rows':[]};var _0x502440=_[_0x8786('0x2d')](db[_0x8786('0x2e')]['rawAttributes'],function(_0x3dc758){return{'name':_0x3dc758['fieldName'],'type':_0x3dc758[_0x8786('0x2f')][_0x8786('0x30')]};});_0x5966cb[_0x8786('0x31')]=_['map'](_0x502440,'name');_0x5966cb[_0x8786('0x32')]=_[_0x8786('0x33')](_0xd796e7[_0x8786('0x32')]);_0x5966cb[_0x8786('0x34')]=_['intersection'](_0x5966cb[_0x8786('0x31')],_0x5966cb[_0x8786('0x32')]);_0x5b5af0['attributes']=_['intersection'](_0x5966cb[_0x8786('0x31')],qs[_0x8786('0x35')](_0xd796e7[_0x8786('0x32')][_0x8786('0x35')]));_0x5b5af0['attributes']=_0x5b5af0[_0x8786('0x36')][_0x8786('0x37')]?_0x5b5af0['attributes']:_0x5966cb[_0x8786('0x31')];if(!_0xd796e7['query']['hasOwnProperty'](_0x8786('0x38'))){_0x5b5af0[_0x8786('0x20')]=qs[_0x8786('0x20')](_0xd796e7['query'][_0x8786('0x20')]);_0x5b5af0[_0x8786('0x1e')]=qs[_0x8786('0x1e')](_0xd796e7[_0x8786('0x32')]['offset']);}_0x5b5af0['order']=qs[_0x8786('0x39')](_0xd796e7[_0x8786('0x32')][_0x8786('0x39')]);_0x5b5af0[_0x8786('0x3a')]=qs[_0x8786('0x34')](_[_0x8786('0x3b')](_0xd796e7['query'],_0x5966cb[_0x8786('0x34')]),_0x502440);if(_0xd796e7[_0x8786('0x32')][_0x8786('0x3c')]){_0x5b5af0[_0x8786('0x3a')]=_[_0x8786('0x3d')](_0x5b5af0[_0x8786('0x3a')],{'$or':_[_0x8786('0x2d')](_0x502440,function(_0x1dd281){if(_0x1dd281[_0x8786('0x2f')]!==_0x8786('0x3e')){var _0x231e45={};_0x231e45[_0x1dd281[_0x8786('0x2a')]]={'$like':'%'+_0xd796e7['query'][_0x8786('0x3c')]+'%'};return _0x231e45;}})});}_0x5b5af0=_[_0x8786('0x3d')]({},_0x5b5af0,_0xd796e7[_0x8786('0x3f')]);var _0x25a4cb={'where':_0x5b5af0[_0x8786('0x3a')]};return db[_0x8786('0x2e')]['count'](_0x25a4cb)[_0x8786('0x40')](function(_0x2bf898){_0x26a132['count']=_0x2bf898;if(_0xd796e7[_0x8786('0x32')][_0x8786('0x41')]){_0x5b5af0[_0x8786('0x42')]=[{'all':!![]}];}return db[_0x8786('0x2e')][_0x8786('0x43')](_0x5b5af0);})[_0x8786('0x40')](function(_0x3bbf38){_0x26a132[_0x8786('0x44')]=_0x3bbf38;return _0x26a132;})['then'](respondWithFilteredResult(_0x49ab14,_0x5b5af0))['catch'](handleError(_0x49ab14,null));};exports[_0x8786('0x45')]=function(_0x155861,_0x392a56){var _0x346425={'raw':![],'where':{'id':_0x155861[_0x8786('0x46')]['id']}},_0x449aa5={};_0x449aa5['model']=_[_0x8786('0x33')](db['Dynamics365Account']['rawAttributes']);_0x449aa5[_0x8786('0x32')]=_['keys'](_0x155861[_0x8786('0x32')]);_0x449aa5[_0x8786('0x34')]=_[_0x8786('0x47')](_0x449aa5[_0x8786('0x31')],_0x449aa5[_0x8786('0x32')]);_0x346425[_0x8786('0x36')]=_[_0x8786('0x47')](_0x449aa5[_0x8786('0x31')],qs[_0x8786('0x35')](_0x155861['query'][_0x8786('0x35')]));_0x346425[_0x8786('0x36')]=_0x346425[_0x8786('0x36')]['length']?_0x346425['attributes']:_0x449aa5[_0x8786('0x31')];if(_0x155861[_0x8786('0x32')]['includeAll']){_0x346425[_0x8786('0x42')]=[{'all':!![]}];}_0x346425=_['merge']({},_0x346425,_0x155861[_0x8786('0x3f')]);return db[_0x8786('0x2e')]['find'](_0x346425)[_0x8786('0x40')](handleEntityNotFound(_0x392a56,null))[_0x8786('0x40')](respondWithResult(_0x392a56,null))['catch'](handleError(_0x392a56,null));};exports['create']=function(_0x5b2614,_0x1b495f){return db['Dynamics365Account'][_0x8786('0x48')](_0x5b2614['body'],{})[_0x8786('0x40')](respondWithResult(_0x1b495f,0xc9))[_0x8786('0x49')](handleError(_0x1b495f,null));};exports[_0x8786('0x26')]=function(_0x4c6f74,_0x3866cd){if(_0x4c6f74[_0x8786('0x4a')]['id']){delete _0x4c6f74[_0x8786('0x4a')]['id'];}return db[_0x8786('0x2e')][_0x8786('0x4b')]({'where':{'id':_0x4c6f74[_0x8786('0x46')]['id']}})['then'](handleEntityNotFound(_0x3866cd,null))[_0x8786('0x40')](saveUpdates(_0x4c6f74[_0x8786('0x4a')],null))['then'](respondWithResult(_0x3866cd,null))['catch'](handleError(_0x3866cd,null));};exports[_0x8786('0x27')]=function(_0x48d71c,_0x2b08fe){return db[_0x8786('0x2e')][_0x8786('0x4b')]({'where':{'id':_0x48d71c[_0x8786('0x46')]['id']}})[_0x8786('0x40')](handleEntityNotFound(_0x2b08fe,null))[_0x8786('0x40')](removeEntity(_0x2b08fe,null))[_0x8786('0x49')](handleError(_0x2b08fe,null));};exports[_0x8786('0x4c')]=function(_0x578185,_0x386042,_0x374ebb){var _0x3c26d8={};var _0x27580f={};var _0x50f89e;var _0x430a7c;return db[_0x8786('0x2e')]['findOne']({'where':{'id':_0x578185[_0x8786('0x46')]['id']}})['then'](handleEntityNotFound(_0x386042,null))[_0x8786('0x40')](function(_0x3fa376){if(_0x3fa376){_0x50f89e=_0x3fa376;_0x27580f[_0x8786('0x31')]=_[_0x8786('0x33')](db['Dynamics365Configuration'][_0x8786('0x4d')]);_0x27580f['query']=_[_0x8786('0x33')](_0x578185[_0x8786('0x32')]);_0x27580f[_0x8786('0x34')]=_[_0x8786('0x47')](_0x27580f[_0x8786('0x31')],_0x27580f[_0x8786('0x32')]);_0x3c26d8[_0x8786('0x36')]=_[_0x8786('0x47')](_0x27580f[_0x8786('0x31')],qs[_0x8786('0x35')](_0x578185[_0x8786('0x32')][_0x8786('0x35')]));_0x3c26d8[_0x8786('0x36')]=_0x3c26d8[_0x8786('0x36')][_0x8786('0x37')]?_0x3c26d8[_0x8786('0x36')]:_0x27580f[_0x8786('0x31')];_0x3c26d8[_0x8786('0x4e')]=qs[_0x8786('0x39')](_0x578185[_0x8786('0x32')][_0x8786('0x39')]);_0x3c26d8[_0x8786('0x3a')]=qs[_0x8786('0x34')](_[_0x8786('0x3b')](_0x578185[_0x8786('0x32')],_0x27580f[_0x8786('0x34')]));if(_0x578185[_0x8786('0x32')][_0x8786('0x3c')]){_0x3c26d8['where']=_[_0x8786('0x3d')](_0x3c26d8['where'],{'$or':_['map'](_0x3c26d8[_0x8786('0x36')],function(_0x5aa7e5){var _0x306c0b={};_0x306c0b[_0x5aa7e5]={'$like':'%'+_0x578185[_0x8786('0x32')][_0x8786('0x3c')]+'%'};return _0x306c0b;})});}_0x3c26d8=_[_0x8786('0x3d')]({},_0x3c26d8,_0x578185[_0x8786('0x3f')]);return _0x50f89e[_0x8786('0x4c')](_0x3c26d8);}})[_0x8786('0x40')](function(_0x40a101){if(_0x40a101){_0x430a7c=_0x40a101[_0x8786('0x37')];if(!_0x578185['query']['hasOwnProperty']('nolimit')){_0x3c26d8['limit']=qs[_0x8786('0x20')](_0x578185[_0x8786('0x32')][_0x8786('0x20')]);_0x3c26d8[_0x8786('0x1e')]=qs[_0x8786('0x1e')](_0x578185[_0x8786('0x32')]['offset']);}return _0x50f89e[_0x8786('0x4c')](_0x3c26d8);}})[_0x8786('0x40')](function(_0x23cdf0){if(_0x23cdf0){return _0x23cdf0?{'count':_0x430a7c,'rows':_0x23cdf0}:null;}})[_0x8786('0x40')](respondWithResult(_0x386042,null))['catch'](handleError(_0x386042,null));};exports[_0x8786('0x4f')]=function(_0x2daf17,_0x4688a3,_0x33ce36){if(_0x2daf17['body']['id']){delete _0x2daf17[_0x8786('0x4a')]['id'];}return db[_0x8786('0x2e')][_0x8786('0x50')]({'where':{'id':_0x2daf17[_0x8786('0x46')]['id']}})[_0x8786('0x40')](handleEntityNotFound(_0x4688a3,null))[_0x8786('0x40')](function(_0x35e614){if(_0x35e614){_0x2daf17[_0x8786('0x4a')][_0x8786('0x51')]=_0x35e614['id'];_0x2daf17[_0x8786('0x4a')][_0x8786('0x52')]=integrations[_0x8786('0x53')](_0x2daf17[_0x8786('0x4a')][_0x8786('0x54')],_0x2daf17[_0x8786('0x4a')][_0x8786('0x2f')]);_0x2daf17[_0x8786('0x4a')][_0x8786('0x55')]=integrations[_0x8786('0x56')](_0x2daf17[_0x8786('0x4a')]['channel'],_0x2daf17[_0x8786('0x4a')][_0x8786('0x2f')]);return db[_0x8786('0x57')][_0x8786('0x48')](_0x2daf17[_0x8786('0x4a')],{'include':[{'model':db[_0x8786('0x58')],'as':'Subjects'},{'model':db[_0x8786('0x58')],'as':_0x8786('0x55')}]});}return null;})[_0x8786('0x40')](respondWithResult(_0x4688a3,null))[_0x8786('0x49')](handleError(_0x4688a3,null));};exports[_0x8786('0x59')]=function(_0x4dfca5,_0x2f2f98,_0x58e895){var _0x447366=_0x4dfca5[_0x8786('0x32')][_0x8786('0x5a')];var _0xc80d4d=_0x447366==='incident'?'Incident':_0x8786('0x5b');var _0x2e5724='';var _0x29824d='';var _0xb8a6f2='';var _0x12564c='';var _0x354545='';var _0xccf90b='';var _0x5b12bf='';var _0x1a99ca='';var _0x901fb=[_0x8786('0x5c'),_0x8786('0x5d'),_0x8786('0x5e'),_0x8786('0x5f'),'caseorigincode',_0x8786('0x60'),_0x8786('0x61'),_0x8786('0x62'),'directioncode',_0x8786('0x63')];var _0x2969e8=[_0x8786('0x64'),'accountidyominame','actualserviceunits',_0x8786('0x65'),_0x8786('0x66'),_0x8786('0x67'),_0x8786('0x68'),_0x8786('0x69'),_0x8786('0x6a'),_0x8786('0x6b'),'createdbyname',_0x8786('0x6c'),_0x8786('0x6d'),_0x8786('0x6e'),_0x8786('0x6f'),_0x8786('0x70'),_0x8786('0x71'),_0x8786('0x72'),_0x8786('0x73'),_0x8786('0x74'),_0x8786('0x75'),_0x8786('0x76'),_0x8786('0x77'),_0x8786('0x78'),'firstresponsebykpiidname',_0x8786('0x79'),_0x8786('0x7a'),'influencescore',_0x8786('0x7b'),'lastonholdtime',_0x8786('0x7c'),'modifiedbyexternalpartyname',_0x8786('0x7d'),'modifiedbyname','modifiedbyyominame','modifiedon',_0x8786('0x7e'),_0x8786('0x7f'),'msdyn_incidenttypename','msdyn_iotalertname',_0x8786('0x80'),_0x8786('0x81'),_0x8786('0x82'),_0x8786('0x83'),'owneridtype','owneridyominame',_0x8786('0x84'),_0x8786('0x85'),_0x8786('0x86'),_0x8786('0x87'),'productidname',_0x8786('0x88'),_0x8786('0x89'),'resolvebykpiidname',_0x8786('0x8a'),'responsiblecontactidname',_0x8786('0x8b'),'sentimentvalue',_0x8786('0x8c'),'slaname','socialprofileidname',_0x8786('0x8d'),_0x8786('0x8e'),_0x8786('0x8f'),'ticketnumber',_0x8786('0x90'),_0x8786('0x91'),_0x8786('0x92'),'utcconversiontimezonecode','versionnumber'];var _0x21fd80=_0x901fb[_0x8786('0x93')](_0x2969e8);return db['Dynamics365Account'][_0x8786('0x50')]({'where':{'id':_0x4dfca5['params']['id']},'attributes':['id',_0x8786('0x94'),'password',_0x8786('0x95'),_0x8786('0x96'),_0x8786('0x97'),_0x8786('0x98')]})[_0x8786('0x40')](handleEntityNotFound(_0x2f2f98,null))[_0x8786('0x40')](function(_0x449670){if(_0x449670){_0x1a99ca=_0x449670[_0x8786('0x95')];var _0x20d6a9=_0x1a99ca[_0x8786('0x99')](-0x1);if(_0x20d6a9==='/'){_0x1a99ca=_0x1a99ca[_0x8786('0x9a')](0x0,_0x1a99ca['lastIndexOf'](_0x20d6a9));}_0x5b12bf=util[_0x8786('0x9b')](_0x8786('0x9c'),_0x1a99ca);var _0x24dc6a={'method':_0x8786('0x9d'),'uri':'https://login.microsoftonline.com/'+_0x449670['tenantId']+_0x8786('0x9e'),'form':{'client_id':_0x449670[_0x8786('0x97')],'resource':_0x1a99ca,'username':_0x449670[_0x8786('0x94')],'password':_0x449670[_0x8786('0x9f')],'grant_type':_0x8786('0x9f'),'client_secret':_0x449670[_0x8786('0x98')]},'json':!![]};return rp(_0x24dc6a);}})[_0x8786('0x40')](function(_0x59114c){_0xccf90b=_0x59114c[_0x8786('0xa0')];var _0x6c93cc={'method':_0x8786('0xa1'),'uri':encodeURI(_0x5b12bf+_0x8786('0xa2')+_0xc80d4d+'\x27'),'headers':{'Authorization':_0x8786('0xa3')+_0xccf90b,'If-None-Match':null,'OData-Version':_0x8786('0xa4')},'json':!![]};return rp(_0x6c93cc);})['then'](function(_0x3ca2ab){var _0x336aab=_0x3ca2ab[_0x8786('0xa5')][0x0];var _0x5b2fe9=_0x336aab[_0x8786('0xa6')];var _0x238957={'method':'GET','uri':_0x5b12bf+_0x8786('0xa7')+_0x5b2fe9+_0x8786('0xa8'),'headers':{'Authorization':_0x8786('0xa3')+_0xccf90b,'If-None-Match':null,'OData-Version':_0x8786('0xa4')},'json':!![]};return rp(_0x238957);})[_0x8786('0x40')](function(_0x2d6561){_0x2e5724=_0x2d6561;_0x29824d=_0x2e5724[_0x8786('0xa9')];_0x29824d=_[_0x8786('0xaa')](_0x29824d,function(_0x4c88e6){return!_0x21fd80[_0x8786('0xab')](_0x4c88e6['LogicalName']);});var _0x2ec75d=[];var _0x4cee4f=[];_0x29824d[_0x8786('0xac')](function(_0x33434c){if(_0x33434c['@odata.type']){var _0x33aa5c=_0x33434c[_0x8786('0xad')]['substring'](_0x33434c['@odata.type'][_0x8786('0xae')]('.')+0x1);if(_0x33aa5c===_0x8786('0xaf')){_0x2ec75d[_0x8786('0xb0')](getSelectList(_0x5b12bf,_0x447366,_0x4cee4f,_0x2e5724[_0x8786('0xa6')],_0x33434c[_0x8786('0xa6')],_0xccf90b));}}});return Promise[_0x8786('0xb1')](_0x2ec75d);})[_0x8786('0x40')](function(_0x2064c1){_0xb8a6f2=_0x2064c1[0x0];var _0x4bec4c=[];var _0x5d6325=[];_0x29824d[_0x8786('0xac')](function(_0xc4043d){if(!_[_0x8786('0xb2')](_0xc4043d[_0x8786('0xad')])){var _0x3b5d64=_0xc4043d[_0x8786('0xad')][_0x8786('0x9a')](_0xc4043d[_0x8786('0xad')][_0x8786('0xae')]('.')+0x1);if(_0x3b5d64===_0x8786('0xb3')){_0x4bec4c[_0x8786('0xb0')](getBooleanList(_0x5b12bf,_0x447366,_0x5d6325,_0x2e5724[_0x8786('0xa6')],_0xc4043d[_0x8786('0xa6')],_0xccf90b));}}});return Promise[_0x8786('0xb1')](_0x4bec4c);})[_0x8786('0x40')](function(_0x447867){_0x12564c=_0x447867[0x0];var _0x486cdd=[];var _0x49e11f=[];_0x29824d[_0x8786('0xac')](function(_0x5f2929){if(_0x5f2929['@odata.type']){var _0x20d8b0=_0x5f2929[_0x8786('0xad')][_0x8786('0x9a')](_0x5f2929[_0x8786('0xad')][_0x8786('0xae')]('.')+0x1);if(_0x20d8b0===_0x8786('0xb4')||_0x20d8b0==='DoubleAttributeMetadata'||_0x20d8b0===_0x8786('0xb5')||_0x20d8b0==='IntegerAttributeMetadata'||_0x20d8b0===_0x8786('0xb6')||_0x20d8b0===_0x8786('0xb7')||_0x20d8b0===_0x8786('0xb8')||_0x20d8b0===_0x8786('0xb9')||_0x20d8b0===_0x8786('0xba')||_0x20d8b0===_0x8786('0xbb')){_0x486cdd[_0x8786('0xb0')](getInputList(_0x5b12bf,_0x447366,_0x20d8b0,_0x49e11f,_0x2e5724['MetadataId'],_0x5f2929[_0x8786('0xa6')],_0xccf90b));}}});return Promise[_0x8786('0xb1')](_0x486cdd);})[_0x8786('0x40')](function(_0x51adf2){_0x354545=_0x51adf2[0x0];var _0x39f81e=_0xb8a6f2[_0x8786('0x93')](_0x12564c)[_0x8786('0x93')](_0x354545);var _0x564692={'count':_0x39f81e[_0x8786('0x37')],'rows':_0x39f81e};return _0x564692;})[_0x8786('0x40')](respondWithResult(_0x2f2f98,null))[_0x8786('0x49')](function(_0x375f6f){var _0x5eefbf=_0x4dfca5[_0x8786('0x32')]['test']?0x1f4:_0x375f6f['statusCode']||0x1f4;logger['error'](_0x375f6f['stack']);delete _0x375f6f[_0x8786('0x2a')];if(_0x5eefbf===0x191){_0x5eefbf=0x190;}_0x2f2f98[_0x8786('0x1c')](_0x5eefbf)[_0x8786('0x2b')](_0x4dfca5[_0x8786('0x32')]['test']?{'message':_0x8786('0xbc'),'statusCode':_0x375f6f[_0x8786('0xbd')]}:_0x375f6f);});};function getSelectList(_0x6431b5,_0x10275e,_0x35f99c,_0x1d29a4,_0x10edc0,_0xa66f72){var _0x2d558d={'method':_0x8786('0xa1'),'uri':_0x6431b5+_0x8786('0xa7')+_0x1d29a4+')/Attributes('+_0x10edc0+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0x8786('0xbe'),'headers':{'Authorization':_0x8786('0xa3')+_0xa66f72,'If-None-Match':null,'OData-Version':_0x8786('0xa4')},'json':!![]};return rp(_0x2d558d)[_0x8786('0x40')](function(_0x17295b){var _0x40aae3=[];var _0x36c97f=_0x17295b['OptionSet'][_0x8786('0xbf')];_0x36c97f['forEach'](function(_0x2e43de){_0x40aae3[_0x8786('0xb0')]({'name':_0x2e43de[_0x8786('0xc0')]['UserLocalizedLabel'][_0x8786('0xc0')],'value':String(_0x2e43de['Value'])});});var _0xa841d7={'id':_0x10275e+'_'+_0x17295b[_0x8786('0xc1')],'name':_0x17295b[_0x8786('0xc2')][_0x8786('0xc3')][_0x8786('0xc0')],'custom':![],'options':_0x40aae3};_0x35f99c[_0x8786('0xb0')](_0xa841d7);return _0x35f99c;});}function getBooleanList(_0x67d2c4,_0x1ed2de,_0x27541d,_0xade92,_0x4fc720,_0x1369d2){var _0x2fd035={'method':_0x8786('0xa1'),'uri':_0x67d2c4+_0x8786('0xa7')+_0xade92+_0x8786('0xc4')+_0x4fc720+_0x8786('0xc5'),'headers':{'Authorization':'Bearer\x20'+_0x1369d2,'If-None-Match':null,'OData-Version':_0x8786('0xa4')},'json':!![]};return rp(_0x2fd035)['then'](function(_0x1a5d30){var _0x3e45f8=[];_0x3e45f8[_0x8786('0xb0')]({'name':_0x1a5d30['OptionSet']['TrueOption'][_0x8786('0xc0')][_0x8786('0xc3')][_0x8786('0xc0')],'value':_0x8786('0xc6')},{'name':_0x1a5d30['OptionSet']['FalseOption']['Label'][_0x8786('0xc3')][_0x8786('0xc0')],'value':_0x8786('0xc7')});var _0x31b915={'id':_0x1ed2de+'_'+_0x1a5d30['LogicalName'],'name':_0x1a5d30[_0x8786('0xc2')][_0x8786('0xc3')][_0x8786('0xc0')],'custom':![],'options':_0x3e45f8};_0x27541d['push'](_0x31b915);return _0x27541d;});}function getInputList(_0x3f2e97,_0x2f2854,_0x3cd50c,_0x1d8939,_0x5cdacd,_0x53567b,_0xdaab3d){var _0x4be10d={'method':_0x8786('0xa1'),'uri':_0x3f2e97+_0x8786('0xa7')+_0x5cdacd+_0x8786('0xc4')+_0x53567b+_0x8786('0xc8')+_0x3cd50c+_0x8786('0xc9'),'headers':{'Authorization':_0x8786('0xa3')+_0xdaab3d,'If-None-Match':null,'OData-Version':_0x8786('0xa4')},'json':!![]};return rp(_0x4be10d)['then'](function(_0xc4316){var _0x32f2cf={'id':_0x2f2854+'_'+_0xc4316[_0x8786('0xc1')],'name':_0xc4316[_0x8786('0xc2')][_0x8786('0xc3')]?_0xc4316[_0x8786('0xc2')]['UserLocalizedLabel'][_0x8786('0xc0')]:_0xc4316[_0x8786('0xc1')],'custom':![],'options':[]};_0x1d8939[_0x8786('0xb0')](_0x32f2cf);return _0x1d8939;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index fc40371..436e920 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 _0xb7e7=['int_dynamics365_accounts','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','define'];(function(_0x17127d,_0x1d9b2f){var _0x8c54bd=function(_0x5d059f){while(--_0x5d059f){_0x17127d['push'](_0x17127d['shift']());}};_0x8c54bd(++_0x1d9b2f);}(_0xb7e7,0x121));var _0x7b7e=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0xb7e7[_0x68ee8b];return _0x5148f7;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x333fa4,_0x372bde){return _0x333fa4[_0x7b7e('0x7')]('Dynamics365Account',attributes,{'tableName':_0x7b7e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','util'];(function(_0x2ce03a,_0x135af8){var _0x217100=function(_0x58c606){while(--_0x58c606){_0x2ce03a['push'](_0x2ce03a['shift']());}};_0x217100(++_0x135af8);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'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 860de8b..ea40c14 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 _0x4e5b=['lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','code','message','Dynamics365Account,\x20%s,\x20%s','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','where','attributes','limit','include','model','map','ShowDynamics365Account','find','raw','stringify'];(function(_0xc81ca7,_0xb90d5){var _0x366401=function(_0x181f0a){while(--_0x181f0a){_0xc81ca7['push'](_0xc81ca7['shift']());}};_0x366401(++_0xb90d5);}(_0x4e5b,0x69));var _0xb4e5=function(_0x2285ab,_0x2479e7){_0x2285ab=_0x2285ab-0x0;var _0x2b2191=_0x4e5b[_0x2285ab];return _0x2b2191;};'use strict';var _=require(_0xb4e5('0x0'));var util=require(_0xb4e5('0x1'));var moment=require(_0xb4e5('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb4e5('0x3'));var db=require(_0xb4e5('0x4'))['db'];var utils=require(_0xb4e5('0x5'));var logger=require(_0xb4e5('0x6'))(_0xb4e5('0x7'));var config=require(_0xb4e5('0x8'));var jayson=require(_0xb4e5('0x9'));var client=jayson[_0xb4e5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5dd40e,_0x3ea97e,_0x2aca9b){return new BPromise(function(_0x4aa176,_0x2ea542){return client['request'](_0x5dd40e,_0x2aca9b)[_0xb4e5('0xb')](function(_0x123018){logger[_0xb4e5('0xc')]('Dynamics365Account,\x20%s,\x20%s',_0x3ea97e,'request\x20sent');logger[_0xb4e5('0xd')](_0xb4e5('0xe'),_0x3ea97e,'request\x20sent',JSON['stringify'](_0x123018));if(_0x123018[_0xb4e5('0xf')]){if(_0x123018[_0xb4e5('0xf')][_0xb4e5('0x10')]===0x1f4){logger[_0xb4e5('0xf')]('Dynamics365Account,\x20%s,\x20%s',_0x3ea97e,_0x123018[_0xb4e5('0xf')][_0xb4e5('0x11')]);return _0x2ea542(_0x123018[_0xb4e5('0xf')][_0xb4e5('0x11')]);}logger[_0xb4e5('0xf')](_0xb4e5('0x12'),_0x3ea97e,_0x123018[_0xb4e5('0xf')][_0xb4e5('0x11')]);return _0x4aa176(_0x123018['error'][_0xb4e5('0x11')]);}else{logger[_0xb4e5('0xc')](_0xb4e5('0x12'),_0x3ea97e,'request\x20sent');_0x4aa176(_0x123018[_0xb4e5('0x13')][_0xb4e5('0x11')]);}})[_0xb4e5('0x14')](function(_0x42e118){logger['error'](_0xb4e5('0x12'),_0x3ea97e,_0x42e118);_0x2ea542(_0x42e118);});});}exports[_0xb4e5('0x15')]=function(_0x58294f){var _0x5386db=this;return new Promise(function(_0x45c145,_0x3ddc88){return db[_0xb4e5('0x16')][_0xb4e5('0x17')]({'raw':_0x58294f[_0xb4e5('0x18')]?_0x58294f[_0xb4e5('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x58294f[_0xb4e5('0x18')]?_0x58294f[_0xb4e5('0x18')][_0xb4e5('0x19')]||null:null,'attributes':_0x58294f['options']?_0x58294f[_0xb4e5('0x18')][_0xb4e5('0x1a')]||null:null,'limit':_0x58294f[_0xb4e5('0x18')]?_0x58294f[_0xb4e5('0x18')][_0xb4e5('0x1b')]||null:null,'include':_0x58294f[_0xb4e5('0x18')]?_0x58294f[_0xb4e5('0x18')]['include']?_['map'](_0x58294f['options'][_0xb4e5('0x1c')],function(_0x8f039c){return{'model':db[_0x8f039c[_0xb4e5('0x1d')]],'as':_0x8f039c['as'],'attributes':_0x8f039c[_0xb4e5('0x1a')],'include':_0x8f039c['include']?_[_0xb4e5('0x1e')](_0x8f039c[_0xb4e5('0x1c')],function(_0x3bef96){return{'model':db[_0x3bef96['model']],'as':_0x3bef96['as'],'attributes':_0x3bef96[_0xb4e5('0x1a')],'include':_0x3bef96['include']?_['map'](_0x3bef96[_0xb4e5('0x1c')],function(_0x13c07e){return{'model':db[_0x13c07e['model']],'as':_0x13c07e['as'],'attributes':_0x13c07e[_0xb4e5('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xb4e5('0xb')](function(_0x117253){logger[_0xb4e5('0xc')](_0xb4e5('0x15'),_0x58294f);logger[_0xb4e5('0xd')](_0xb4e5('0x15'),_0x58294f,JSON['stringify'](_0x117253));_0x45c145(_0x117253);})['catch'](function(_0x1d535b){logger[_0xb4e5('0xf')]('GetDynamics365Account',_0x1d535b[_0xb4e5('0x11')],_0x58294f);_0x3ddc88(_0x5386db[_0xb4e5('0xf')](0x1f4,_0x1d535b[_0xb4e5('0x11')]));});});};exports[_0xb4e5('0x1f')]=function(_0x328d56){var _0x365da=this;return new Promise(function(_0x3252b6,_0x38aebc){return db[_0xb4e5('0x16')][_0xb4e5('0x20')]({'raw':_0x328d56[_0xb4e5('0x18')]?_0x328d56[_0xb4e5('0x18')][_0xb4e5('0x21')]===undefined?!![]:![]:!![],'where':_0x328d56[_0xb4e5('0x18')]?_0x328d56[_0xb4e5('0x18')][_0xb4e5('0x19')]||null:null,'attributes':_0x328d56[_0xb4e5('0x18')]?_0x328d56[_0xb4e5('0x18')][_0xb4e5('0x1a')]||null:null,'include':_0x328d56[_0xb4e5('0x18')]?_0x328d56[_0xb4e5('0x18')]['include']?_[_0xb4e5('0x1e')](_0x328d56[_0xb4e5('0x18')]['include'],function(_0x101166){return{'model':db[_0x101166[_0xb4e5('0x1d')]],'as':_0x101166['as'],'attributes':_0x101166[_0xb4e5('0x1a')],'include':_0x101166[_0xb4e5('0x1c')]?_[_0xb4e5('0x1e')](_0x101166[_0xb4e5('0x1c')],function(_0x1d9e3d){return{'model':db[_0x1d9e3d['model']],'as':_0x1d9e3d['as'],'attributes':_0x1d9e3d[_0xb4e5('0x1a')],'include':_0x1d9e3d[_0xb4e5('0x1c')]?_[_0xb4e5('0x1e')](_0x1d9e3d[_0xb4e5('0x1c')],function(_0x48a2fb){return{'model':db[_0x48a2fb[_0xb4e5('0x1d')]],'as':_0x48a2fb['as'],'attributes':_0x48a2fb[_0xb4e5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xd3821){logger[_0xb4e5('0xc')](_0xb4e5('0x1f'),_0x328d56);logger[_0xb4e5('0xd')](_0xb4e5('0x1f'),_0x328d56,JSON[_0xb4e5('0x22')](_0xd3821));_0x3252b6(_0xd3821);})[_0xb4e5('0x14')](function(_0x27ae93){logger[_0xb4e5('0xf')](_0xb4e5('0x1f'),_0x27ae93[_0xb4e5('0x11')],_0x328d56);_0x38aebc(_0x365da[_0xb4e5('0xf')](0x1f4,_0x27ae93['message']));});});}; \ No newline at end of file +var _0x73d9=['GetDynamics365Account','debug','find','ShowDynamics365Account','lodash','bluebird','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Dynamics365Account','findAll','options','where','attributes','limit','include','model','map'];(function(_0x197821,_0x33b01d){var _0x25e66f=function(_0x17fe18){while(--_0x17fe18){_0x197821['push'](_0x197821['shift']());}};_0x25e66f(++_0x33b01d);}(_0x73d9,0x104));var _0x973d=function(_0x581105,_0x21efb4){_0x581105=_0x581105-0x0;var _0x6cd083=_0x73d9[_0x581105];return _0x6cd083;};'use strict';var _=require(_0x973d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x973d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x973d('0x2'))['db'];var utils=require(_0x973d('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x973d('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x973d('0x5')][_0x973d('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x523c90,_0xa4296c,_0xd75a07){return new BPromise(function(_0x95f7b2,_0x2f4f21){return client[_0x973d('0x7')](_0x523c90,_0xd75a07)[_0x973d('0x8')](function(_0x106696){logger[_0x973d('0x9')](_0x973d('0xa'),_0xa4296c,_0x973d('0xb'));logger['debug'](_0x973d('0xc'),_0xa4296c,_0x973d('0xb'),JSON[_0x973d('0xd')](_0x106696));if(_0x106696[_0x973d('0xe')]){if(_0x106696[_0x973d('0xe')][_0x973d('0xf')]===0x1f4){logger[_0x973d('0xe')](_0x973d('0xa'),_0xa4296c,_0x106696['error']['message']);return _0x2f4f21(_0x106696[_0x973d('0xe')][_0x973d('0x10')]);}logger[_0x973d('0xe')](_0x973d('0xa'),_0xa4296c,_0x106696[_0x973d('0xe')][_0x973d('0x10')]);return _0x95f7b2(_0x106696['error']['message']);}else{logger['info'](_0x973d('0xa'),_0xa4296c,_0x973d('0xb'));_0x95f7b2(_0x106696[_0x973d('0x11')][_0x973d('0x10')]);}})[_0x973d('0x12')](function(_0x3a4c23){logger['error'](_0x973d('0xa'),_0xa4296c,_0x3a4c23);_0x2f4f21(_0x3a4c23);});});}exports['GetDynamics365Account']=function(_0x2177b1){var _0x249f34=this;return new Promise(function(_0x2c53e7,_0x5e0fec){return db[_0x973d('0x13')][_0x973d('0x14')]({'raw':_0x2177b1[_0x973d('0x15')]?_0x2177b1['options']['raw']===undefined?!![]:![]:!![],'where':_0x2177b1['options']?_0x2177b1[_0x973d('0x15')][_0x973d('0x16')]||null:null,'attributes':_0x2177b1[_0x973d('0x15')]?_0x2177b1['options'][_0x973d('0x17')]||null:null,'limit':_0x2177b1[_0x973d('0x15')]?_0x2177b1[_0x973d('0x15')][_0x973d('0x18')]||null:null,'include':_0x2177b1[_0x973d('0x15')]?_0x2177b1[_0x973d('0x15')][_0x973d('0x19')]?_['map'](_0x2177b1['options']['include'],function(_0x1b8198){return{'model':db[_0x1b8198[_0x973d('0x1a')]],'as':_0x1b8198['as'],'attributes':_0x1b8198[_0x973d('0x17')],'include':_0x1b8198[_0x973d('0x19')]?_[_0x973d('0x1b')](_0x1b8198[_0x973d('0x19')],function(_0x1298de){return{'model':db[_0x1298de[_0x973d('0x1a')]],'as':_0x1298de['as'],'attributes':_0x1298de[_0x973d('0x17')],'include':_0x1298de[_0x973d('0x19')]?_[_0x973d('0x1b')](_0x1298de['include'],function(_0x131319){return{'model':db[_0x131319[_0x973d('0x1a')]],'as':_0x131319['as'],'attributes':_0x131319['attributes']};}):[]};}):[]};}):[]:[]})[_0x973d('0x8')](function(_0x5597dd){logger[_0x973d('0x9')](_0x973d('0x1c'),_0x2177b1);logger[_0x973d('0x1d')](_0x973d('0x1c'),_0x2177b1,JSON['stringify'](_0x5597dd));_0x2c53e7(_0x5597dd);})[_0x973d('0x12')](function(_0x3a916d){logger['error']('GetDynamics365Account',_0x3a916d[_0x973d('0x10')],_0x2177b1);_0x5e0fec(_0x249f34['error'](0x1f4,_0x3a916d[_0x973d('0x10')]));});});};exports['ShowDynamics365Account']=function(_0x7e569b){var _0x15280e=this;return new Promise(function(_0x5e8d2f,_0x2649f8){return db[_0x973d('0x13')][_0x973d('0x1e')]({'raw':_0x7e569b[_0x973d('0x15')]?_0x7e569b[_0x973d('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x7e569b[_0x973d('0x15')]?_0x7e569b[_0x973d('0x15')]['where']||null:null,'attributes':_0x7e569b[_0x973d('0x15')]?_0x7e569b['options'][_0x973d('0x17')]||null:null,'include':_0x7e569b[_0x973d('0x15')]?_0x7e569b[_0x973d('0x15')][_0x973d('0x19')]?_['map'](_0x7e569b[_0x973d('0x15')][_0x973d('0x19')],function(_0x1434d7){return{'model':db[_0x1434d7[_0x973d('0x1a')]],'as':_0x1434d7['as'],'attributes':_0x1434d7[_0x973d('0x17')],'include':_0x1434d7[_0x973d('0x19')]?_[_0x973d('0x1b')](_0x1434d7[_0x973d('0x19')],function(_0x2dbd55){return{'model':db[_0x2dbd55[_0x973d('0x1a')]],'as':_0x2dbd55['as'],'attributes':_0x2dbd55['attributes'],'include':_0x2dbd55[_0x973d('0x19')]?_[_0x973d('0x1b')](_0x2dbd55[_0x973d('0x19')],function(_0x53cf7b){return{'model':db[_0x53cf7b[_0x973d('0x1a')]],'as':_0x53cf7b['as'],'attributes':_0x53cf7b[_0x973d('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x59b61d){logger['info'](_0x973d('0x1f'),_0x7e569b);logger['debug']('ShowDynamics365Account',_0x7e569b,JSON['stringify'](_0x59b61d));_0x5e8d2f(_0x59b61d);})['catch'](function(_0x4724d7){logger[_0x973d('0xe')](_0x973d('0x1f'),_0x4724d7['message'],_0x7e569b);_0x2649f8(_0x15280e[_0x973d('0xe')](0x1f4,_0x4724d7[_0x973d('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index d9ff161..4fc4a75 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 _0x8ad9=['create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Configuration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','post'];(function(_0x4e10ed,_0x49fca8){var _0x560116=function(_0x434646){while(--_0x434646){_0x4e10ed['push'](_0x4e10ed['shift']());}};_0x560116(++_0x49fca8);}(_0x8ad9,0xad));var _0x98ad=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x8ad9[_0x2dadb9];return _0x2f0097;};'use strict';var multer=require(_0x98ad('0x0'));var util=require('util');var path=require(_0x98ad('0x1'));var timeout=require(_0x98ad('0x2'));var express=require(_0x98ad('0x3'));var router=express[_0x98ad('0x4')]();var fs_extra=require(_0x98ad('0x5'));var auth=require(_0x98ad('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x98ad('0x7'));var controller=require(_0x98ad('0x8'));router[_0x98ad('0x9')]('/',auth['isAuthenticated'](),controller[_0x98ad('0xa')]);router[_0x98ad('0x9')](_0x98ad('0xb'),auth[_0x98ad('0xc')](),controller[_0x98ad('0xd')]);router[_0x98ad('0x9')](_0x98ad('0xe'),auth[_0x98ad('0xc')](),controller[_0x98ad('0xf')]);router[_0x98ad('0x9')](_0x98ad('0x10'),auth[_0x98ad('0xc')](),controller['getSubjects']);router[_0x98ad('0x9')](_0x98ad('0x11'),auth[_0x98ad('0xc')](),controller['getDescriptions']);router[_0x98ad('0x12')]('/',auth[_0x98ad('0xc')](),controller[_0x98ad('0x13')]);router[_0x98ad('0x14')](_0x98ad('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x98ad('0x15')](_0x98ad('0xb'),auth[_0x98ad('0xc')](),controller[_0x98ad('0x16')]);module[_0x98ad('0x17')]=router; \ No newline at end of file +var _0xd3a0=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','update','delete'];(function(_0xf2662b,_0x4d8f41){var _0x257dc7=function(_0x46b1d1){while(--_0x46b1d1){_0xf2662b['push'](_0xf2662b['shift']());}};_0x257dc7(++_0x4d8f41);}(_0xd3a0,0xaa));var _0x0d3a=function(_0x188f29,_0x3875e6){_0x188f29=_0x188f29-0x0;var _0x4a5489=_0xd3a0[_0x188f29];return _0x4a5489;};'use strict';var multer=require(_0x0d3a('0x0'));var util=require(_0x0d3a('0x1'));var path=require(_0x0d3a('0x2'));var timeout=require(_0x0d3a('0x3'));var express=require('express');var router=express[_0x0d3a('0x4')]();var fs_extra=require(_0x0d3a('0x5'));var auth=require(_0x0d3a('0x6'));var interaction=require(_0x0d3a('0x7'));var config=require(_0x0d3a('0x8'));var controller=require('./intDynamics365Configuration.controller');router[_0x0d3a('0x9')]('/',auth[_0x0d3a('0xa')](),controller[_0x0d3a('0xb')]);router[_0x0d3a('0x9')](_0x0d3a('0xc'),auth['isAuthenticated'](),controller[_0x0d3a('0xd')]);router[_0x0d3a('0x9')](_0x0d3a('0xe'),auth[_0x0d3a('0xa')](),controller[_0x0d3a('0xf')]);router[_0x0d3a('0x9')](_0x0d3a('0x10'),auth['isAuthenticated'](),controller[_0x0d3a('0x11')]);router[_0x0d3a('0x9')]('/:id/descriptions',auth[_0x0d3a('0xa')](),controller[_0x0d3a('0x12')]);router[_0x0d3a('0x13')]('/',auth[_0x0d3a('0xa')](),controller['create']);router['put'](_0x0d3a('0xc'),auth[_0x0d3a('0xa')](),controller[_0x0d3a('0x14')]);router[_0x0d3a('0x15')](_0x0d3a('0xc'),auth[_0x0d3a('0xa')](),controller[_0x0d3a('0x16')]);module[_0x0d3a('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 8193c77..9caba06 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 _0xc342=['sequelize','exports','STRING','ENUM','nothing'];(function(_0x439ace,_0x48ff0b){var _0x106d55=function(_0xb66049){while(--_0xb66049){_0x439ace['push'](_0x439ace['shift']());}};_0x106d55(++_0x48ff0b);}(_0xc342,0x1ae));var _0x2c34=function(_0x5c4e16,_0x113035){_0x5c4e16=_0x5c4e16-0x0;var _0x36044a=_0xc342[_0x5c4e16];return _0x36044a;};'use strict';var Sequelize=require(_0x2c34('0x0'));module[_0x2c34('0x1')]={'name':{'type':Sequelize[_0x2c34('0x2')]},'description':{'type':Sequelize[_0x2c34('0x2')]},'ticketType':{'type':Sequelize[_0x2c34('0x3')]('incident','phonecall'),'defaultValue':'incident'},'moduleCreate':{'type':Sequelize[_0x2c34('0x3')]('contact',_0x2c34('0x4')),'defaultValue':'contact','allowNull':![]}}; \ No newline at end of file +var _0x5ee2=['contact','sequelize','exports','STRING','ENUM','incident','phonecall'];(function(_0x5d3dad,_0x9e4d94){var _0x2ed55c=function(_0x306f76){while(--_0x306f76){_0x5d3dad['push'](_0x5d3dad['shift']());}};_0x2ed55c(++_0x9e4d94);}(_0x5ee2,0x14a));var _0x25ee=function(_0x160e12,_0x2c91aa){_0x160e12=_0x160e12-0x0;var _0x1efbe4=_0x5ee2[_0x160e12];return _0x1efbe4;};'use strict';var Sequelize=require(_0x25ee('0x0'));module[_0x25ee('0x1')]={'name':{'type':Sequelize[_0x25ee('0x2')]},'description':{'type':Sequelize[_0x25ee('0x2')]},'ticketType':{'type':Sequelize[_0x25ee('0x3')](_0x25ee('0x4'),_0x25ee('0x5')),'defaultValue':_0x25ee('0x4')},'moduleCreate':{'type':Sequelize[_0x25ee('0x3')](_0x25ee('0x6'),'nothing'),'defaultValue':_0x25ee('0x6'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 1d256fb..7522e55 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 _0x8c23=['to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','status','end','json','undefined','limit','offset','set','Content-Range','apply','then','destroy','sendStatus','stack','name','send','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','count','includeAll','findAll','rows','params','find','create','body','catch','findOne','Dynamics365Field','getFields','getSubjects','pick','getDescriptions','eml-format','rimraf','fast-json-patch','bluebird','mustache','util'];(function(_0x4b9979,_0x6b92aa){var _0x1efc05=function(_0x2308d4){while(--_0x2308d4){_0x4b9979['push'](_0x4b9979['shift']());}};_0x1efc05(++_0x6b92aa);}(_0x8c23,0xd5));var _0x38c2=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x8c23[_0x160c73];return _0xd9302;};'use strict';var emlformat=require(_0x38c2('0x0'));var rimraf=require(_0x38c2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x38c2('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x38c2('0x3'));var Mustache=require(_0x38c2('0x4'));var util=require(_0x38c2('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x38c2('0x6'));var ejs=require(_0x38c2('0x7'));var fs=require('fs');var fs_extra=require(_0x38c2('0x8'));var _=require(_0x38c2('0x9'));var squel=require(_0x38c2('0xa'));var crypto=require(_0x38c2('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x38c2('0xc'));var toCsv=require(_0x38c2('0x6'));var querystring=require('querystring');var Papa=require(_0x38c2('0xd'));var Redis=require('ioredis');var authService=require(_0x38c2('0xe'));var qs=require(_0x38c2('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x38c2('0x10'));var logger=require('../../config/logger')(_0x38c2('0x11'));var utils=require(_0x38c2('0x12'));var config=require(_0x38c2('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x462939,_0x44cbf9){_0x44cbf9=_0x44cbf9||0xcc;return function(_0x32dfee){if(_0x32dfee){return _0x462939['sendStatus'](_0x44cbf9);}return _0x462939[_0x38c2('0x14')](_0x44cbf9)[_0x38c2('0x15')]();};}function respondWithResult(_0x2ca9e8,_0x4e178c){_0x4e178c=_0x4e178c||0xc8;return function(_0x2dc8cc){if(_0x2dc8cc){return _0x2ca9e8[_0x38c2('0x14')](_0x4e178c)[_0x38c2('0x16')](_0x2dc8cc);}};}function respondWithFilteredResult(_0x53c7eb,_0x131c25){return function(_0x448f14){if(_0x448f14){var _0x3df899=typeof _0x131c25['offset']===_0x38c2('0x17')&&typeof _0x131c25[_0x38c2('0x18')]===_0x38c2('0x17');var _0x3e1c34=_0x448f14['count'];var _0x1c47f3=_0x3df899?0x0:_0x131c25[_0x38c2('0x19')];var _0x9f1fe1=_0x3df899?_0x448f14['count']:_0x131c25[_0x38c2('0x19')]+_0x131c25[_0x38c2('0x18')];var _0x1eaa24;if(_0x9f1fe1>=_0x3e1c34){_0x9f1fe1=_0x3e1c34;_0x1eaa24=0xc8;}else{_0x1eaa24=0xce;}_0x53c7eb['status'](_0x1eaa24);return _0x53c7eb[_0x38c2('0x1a')](_0x38c2('0x1b'),_0x1c47f3+'-'+_0x9f1fe1+'/'+_0x3e1c34)[_0x38c2('0x16')](_0x448f14);}return null;};}function patchUpdates(_0x2863b3){return function(_0x5bb6f7){try{jsonpatch[_0x38c2('0x1c')](_0x5bb6f7,_0x2863b3,!![]);}catch(_0x4dc8e0){return BPromise['reject'](_0x4dc8e0);}return _0x5bb6f7['save']();};}function saveUpdates(_0x6cc8a6,_0x4ecaf1){return function(_0xd18d5d){if(_0xd18d5d){return _0xd18d5d['update'](_0x6cc8a6)[_0x38c2('0x1d')](function(_0x3a9bfe){return _0x3a9bfe;});}return null;};}function removeEntity(_0x3ba1e5,_0x247113){return function(_0x539cef){if(_0x539cef){return _0x539cef[_0x38c2('0x1e')]()[_0x38c2('0x1d')](function(){_0x3ba1e5[_0x38c2('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57de8f,_0xae002d){return function(_0xc318a){if(!_0xc318a){_0x57de8f[_0x38c2('0x1f')](0x194);}return _0xc318a;};}function handleError(_0x2c45e2,_0x5f1bee){_0x5f1bee=_0x5f1bee||0x1f4;return function(_0x1b6a9a){logger['error'](_0x1b6a9a[_0x38c2('0x20')]);if(_0x1b6a9a[_0x38c2('0x21')]){delete _0x1b6a9a[_0x38c2('0x21')];}_0x2c45e2[_0x38c2('0x14')](_0x5f1bee)[_0x38c2('0x22')](_0x1b6a9a);};}exports['index']=function(_0x168173,_0x503d49){var _0x3052fd={},_0x130e59={},_0x5d90ee={'count':0x0,'rows':[]};var _0x3a49cc=_[_0x38c2('0x23')](db[_0x38c2('0x24')][_0x38c2('0x25')],function(_0x5c85f4){return{'name':_0x5c85f4[_0x38c2('0x26')],'type':_0x5c85f4[_0x38c2('0x27')][_0x38c2('0x28')]};});_0x130e59[_0x38c2('0x29')]=_[_0x38c2('0x23')](_0x3a49cc,_0x38c2('0x21'));_0x130e59[_0x38c2('0x2a')]=_[_0x38c2('0x2b')](_0x168173[_0x38c2('0x2a')]);_0x130e59[_0x38c2('0x2c')]=_[_0x38c2('0x2d')](_0x130e59['model'],_0x130e59[_0x38c2('0x2a')]);_0x3052fd['attributes']=_[_0x38c2('0x2d')](_0x130e59[_0x38c2('0x29')],qs[_0x38c2('0x2e')](_0x168173[_0x38c2('0x2a')][_0x38c2('0x2e')]));_0x3052fd['attributes']=_0x3052fd[_0x38c2('0x2f')][_0x38c2('0x30')]?_0x3052fd[_0x38c2('0x2f')]:_0x130e59[_0x38c2('0x29')];if(!_0x168173[_0x38c2('0x2a')][_0x38c2('0x31')](_0x38c2('0x32'))){_0x3052fd[_0x38c2('0x18')]=qs[_0x38c2('0x18')](_0x168173[_0x38c2('0x2a')][_0x38c2('0x18')]);_0x3052fd[_0x38c2('0x19')]=qs[_0x38c2('0x19')](_0x168173[_0x38c2('0x2a')][_0x38c2('0x19')]);}_0x3052fd[_0x38c2('0x33')]=qs['sort'](_0x168173[_0x38c2('0x2a')][_0x38c2('0x34')]);_0x3052fd[_0x38c2('0x35')]=qs['filters'](_['pick'](_0x168173['query'],_0x130e59[_0x38c2('0x2c')]),_0x3a49cc);if(_0x168173['query'][_0x38c2('0x36')]){_0x3052fd['where']=_[_0x38c2('0x37')](_0x3052fd['where'],{'$or':_['map'](_0x3a49cc,function(_0x101afa){if(_0x101afa[_0x38c2('0x27')]!==_0x38c2('0x38')){var _0x4cfb76={};_0x4cfb76[_0x101afa['name']]={'$like':'%'+_0x168173[_0x38c2('0x2a')][_0x38c2('0x36')]+'%'};return _0x4cfb76;}})});}_0x3052fd=_[_0x38c2('0x37')]({},_0x3052fd,_0x168173[_0x38c2('0x39')]);var _0x2d13a0={'where':_0x3052fd[_0x38c2('0x35')]};return db['Dynamics365Configuration'][_0x38c2('0x3a')](_0x2d13a0)[_0x38c2('0x1d')](function(_0x17ad78){_0x5d90ee['count']=_0x17ad78;if(_0x168173[_0x38c2('0x2a')][_0x38c2('0x3b')]){_0x3052fd['include']=[{'all':!![]}];}return db[_0x38c2('0x24')][_0x38c2('0x3c')](_0x3052fd);})['then'](function(_0x574da9){_0x5d90ee[_0x38c2('0x3d')]=_0x574da9;return _0x5d90ee;})[_0x38c2('0x1d')](respondWithFilteredResult(_0x503d49,_0x3052fd))['catch'](handleError(_0x503d49,null));};exports['show']=function(_0x9d885b,_0x4f82a0){var _0x4af6b9={'raw':![],'where':{'id':_0x9d885b[_0x38c2('0x3e')]['id']}},_0xc3992={};_0xc3992[_0x38c2('0x29')]=_[_0x38c2('0x2b')](db['Dynamics365Configuration'][_0x38c2('0x25')]);_0xc3992['query']=_[_0x38c2('0x2b')](_0x9d885b[_0x38c2('0x2a')]);_0xc3992[_0x38c2('0x2c')]=_[_0x38c2('0x2d')](_0xc3992[_0x38c2('0x29')],_0xc3992[_0x38c2('0x2a')]);_0x4af6b9[_0x38c2('0x2f')]=_[_0x38c2('0x2d')](_0xc3992[_0x38c2('0x29')],qs[_0x38c2('0x2e')](_0x9d885b[_0x38c2('0x2a')][_0x38c2('0x2e')]));_0x4af6b9[_0x38c2('0x2f')]=_0x4af6b9['attributes'][_0x38c2('0x30')]?_0x4af6b9[_0x38c2('0x2f')]:_0xc3992['model'];if(_0x9d885b['query'][_0x38c2('0x3b')]){_0x4af6b9['include']=[{'all':!![]}];}_0x4af6b9=_['merge']({},_0x4af6b9,_0x9d885b['options']);return db['Dynamics365Configuration'][_0x38c2('0x3f')](_0x4af6b9)[_0x38c2('0x1d')](handleEntityNotFound(_0x4f82a0,null))[_0x38c2('0x1d')](respondWithResult(_0x4f82a0,null))['catch'](handleError(_0x4f82a0,null));};exports[_0x38c2('0x40')]=function(_0x118802,_0x40a865){return db['Dynamics365Configuration']['create'](_0x118802[_0x38c2('0x41')],{})['then'](respondWithResult(_0x40a865,0xc9))[_0x38c2('0x42')](handleError(_0x40a865,null));};exports['update']=function(_0x1bad93,_0x4c6e9f){if(_0x1bad93[_0x38c2('0x41')]['id']){delete _0x1bad93[_0x38c2('0x41')]['id'];}return db[_0x38c2('0x24')]['find']({'where':{'id':_0x1bad93['params']['id']}})[_0x38c2('0x1d')](handleEntityNotFound(_0x4c6e9f,null))[_0x38c2('0x1d')](saveUpdates(_0x1bad93['body'],null))['then'](respondWithResult(_0x4c6e9f,null))[_0x38c2('0x42')](handleError(_0x4c6e9f,null));};exports['destroy']=function(_0x492c95,_0x4b5d4d){return db[_0x38c2('0x24')][_0x38c2('0x3f')]({'where':{'id':_0x492c95[_0x38c2('0x3e')]['id']}})[_0x38c2('0x1d')](handleEntityNotFound(_0x4b5d4d,null))[_0x38c2('0x1d')](removeEntity(_0x4b5d4d,null))[_0x38c2('0x42')](handleError(_0x4b5d4d,null));};exports['getFields']=function(_0x4bc979,_0x57dcd2,_0x19842d){var _0x57a955={};var _0x38edd3={};var _0x30e894;var _0x3c9e0a;return db[_0x38c2('0x24')][_0x38c2('0x43')]({'where':{'id':_0x4bc979[_0x38c2('0x3e')]['id']}})[_0x38c2('0x1d')](handleEntityNotFound(_0x57dcd2,null))['then'](function(_0x5ae017){if(_0x5ae017){_0x30e894=_0x5ae017;_0x38edd3[_0x38c2('0x29')]=_['keys'](db[_0x38c2('0x44')][_0x38c2('0x25')]);_0x38edd3['query']=_['keys'](_0x4bc979['query']);_0x38edd3[_0x38c2('0x2c')]=_[_0x38c2('0x2d')](_0x38edd3['model'],_0x38edd3[_0x38c2('0x2a')]);_0x57a955['attributes']=_['intersection'](_0x38edd3[_0x38c2('0x29')],qs[_0x38c2('0x2e')](_0x4bc979['query'][_0x38c2('0x2e')]));_0x57a955['attributes']=_0x57a955[_0x38c2('0x2f')][_0x38c2('0x30')]?_0x57a955[_0x38c2('0x2f')]:_0x38edd3['model'];_0x57a955['order']=qs[_0x38c2('0x34')](_0x4bc979[_0x38c2('0x2a')][_0x38c2('0x34')]);_0x57a955[_0x38c2('0x35')]=qs['filters'](_['pick'](_0x4bc979[_0x38c2('0x2a')],_0x38edd3[_0x38c2('0x2c')]));if(_0x4bc979[_0x38c2('0x2a')]['filter']){_0x57a955['where']=_[_0x38c2('0x37')](_0x57a955[_0x38c2('0x35')],{'$or':_[_0x38c2('0x23')](_0x57a955[_0x38c2('0x2f')],function(_0x1c08a6){var _0x441c66={};_0x441c66[_0x1c08a6]={'$like':'%'+_0x4bc979[_0x38c2('0x2a')]['filter']+'%'};return _0x441c66;})});}_0x57a955=_['merge']({},_0x57a955,_0x4bc979[_0x38c2('0x39')]);return _0x30e894[_0x38c2('0x45')](_0x57a955);}})[_0x38c2('0x1d')](function(_0x417eb4){if(_0x417eb4){_0x3c9e0a=_0x417eb4[_0x38c2('0x30')];if(!_0x4bc979['query'][_0x38c2('0x31')](_0x38c2('0x32'))){_0x57a955[_0x38c2('0x18')]=qs[_0x38c2('0x18')](_0x4bc979[_0x38c2('0x2a')][_0x38c2('0x18')]);_0x57a955[_0x38c2('0x19')]=qs[_0x38c2('0x19')](_0x4bc979[_0x38c2('0x2a')]['offset']);}return _0x30e894[_0x38c2('0x45')](_0x57a955);}})['then'](function(_0x88dd7d){if(_0x88dd7d){return _0x88dd7d?{'count':_0x3c9e0a,'rows':_0x88dd7d}:null;}})[_0x38c2('0x1d')](respondWithResult(_0x57dcd2,null))[_0x38c2('0x42')](handleError(_0x57dcd2,null));};exports[_0x38c2('0x46')]=function(_0x168ab6,_0x4e69aa,_0x224fc0){var _0x3ba69e={};var _0x445b1d={};var _0x5a2dfc;var _0x1132dc;return db[_0x38c2('0x24')]['findOne']({'where':{'id':_0x168ab6[_0x38c2('0x3e')]['id']}})[_0x38c2('0x1d')](handleEntityNotFound(_0x4e69aa,null))[_0x38c2('0x1d')](function(_0x2e1efc){if(_0x2e1efc){_0x5a2dfc=_0x2e1efc;_0x445b1d[_0x38c2('0x29')]=_[_0x38c2('0x2b')](db[_0x38c2('0x44')][_0x38c2('0x25')]);_0x445b1d[_0x38c2('0x2a')]=_['keys'](_0x168ab6[_0x38c2('0x2a')]);_0x445b1d[_0x38c2('0x2c')]=_[_0x38c2('0x2d')](_0x445b1d['model'],_0x445b1d[_0x38c2('0x2a')]);_0x3ba69e[_0x38c2('0x2f')]=_['intersection'](_0x445b1d[_0x38c2('0x29')],qs[_0x38c2('0x2e')](_0x168ab6[_0x38c2('0x2a')]['fields']));_0x3ba69e[_0x38c2('0x2f')]=_0x3ba69e['attributes']['length']?_0x3ba69e[_0x38c2('0x2f')]:_0x445b1d[_0x38c2('0x29')];_0x3ba69e[_0x38c2('0x33')]=qs['sort'](_0x168ab6['query'][_0x38c2('0x34')]);_0x3ba69e[_0x38c2('0x35')]=qs['filters'](_[_0x38c2('0x47')](_0x168ab6[_0x38c2('0x2a')],_0x445b1d[_0x38c2('0x2c')]));if(_0x168ab6[_0x38c2('0x2a')]['filter']){_0x3ba69e[_0x38c2('0x35')]=_[_0x38c2('0x37')](_0x3ba69e[_0x38c2('0x35')],{'$or':_[_0x38c2('0x23')](_0x3ba69e[_0x38c2('0x2f')],function(_0x17ec18){var _0x457077={};_0x457077[_0x17ec18]={'$like':'%'+_0x168ab6[_0x38c2('0x2a')]['filter']+'%'};return _0x457077;})});}_0x3ba69e=_['merge']({},_0x3ba69e,_0x168ab6[_0x38c2('0x39')]);return _0x5a2dfc['getSubjects'](_0x3ba69e);}})[_0x38c2('0x1d')](function(_0x35a02b){if(_0x35a02b){_0x1132dc=_0x35a02b[_0x38c2('0x30')];if(!_0x168ab6['query'][_0x38c2('0x31')](_0x38c2('0x32'))){_0x3ba69e[_0x38c2('0x18')]=qs[_0x38c2('0x18')](_0x168ab6[_0x38c2('0x2a')]['limit']);_0x3ba69e['offset']=qs[_0x38c2('0x19')](_0x168ab6[_0x38c2('0x2a')][_0x38c2('0x19')]);}return _0x5a2dfc[_0x38c2('0x46')](_0x3ba69e);}})[_0x38c2('0x1d')](function(_0x3a60c5){if(_0x3a60c5){return _0x3a60c5?{'count':_0x1132dc,'rows':_0x3a60c5}:null;}})[_0x38c2('0x1d')](respondWithResult(_0x4e69aa,null))[_0x38c2('0x42')](handleError(_0x4e69aa,null));};exports[_0x38c2('0x48')]=function(_0x4c19e4,_0x3cace3,_0xbce2a6){var _0x4d9ce2={};var _0x590140={};var _0x3fbc6f;var _0xade999;return db[_0x38c2('0x24')][_0x38c2('0x43')]({'where':{'id':_0x4c19e4[_0x38c2('0x3e')]['id']}})[_0x38c2('0x1d')](handleEntityNotFound(_0x3cace3,null))[_0x38c2('0x1d')](function(_0x31eedf){if(_0x31eedf){_0x3fbc6f=_0x31eedf;_0x590140[_0x38c2('0x29')]=_[_0x38c2('0x2b')](db[_0x38c2('0x44')][_0x38c2('0x25')]);_0x590140[_0x38c2('0x2a')]=_['keys'](_0x4c19e4[_0x38c2('0x2a')]);_0x590140[_0x38c2('0x2c')]=_['intersection'](_0x590140[_0x38c2('0x29')],_0x590140['query']);_0x4d9ce2[_0x38c2('0x2f')]=_[_0x38c2('0x2d')](_0x590140[_0x38c2('0x29')],qs[_0x38c2('0x2e')](_0x4c19e4[_0x38c2('0x2a')]['fields']));_0x4d9ce2['attributes']=_0x4d9ce2[_0x38c2('0x2f')][_0x38c2('0x30')]?_0x4d9ce2[_0x38c2('0x2f')]:_0x590140[_0x38c2('0x29')];_0x4d9ce2['order']=qs[_0x38c2('0x34')](_0x4c19e4[_0x38c2('0x2a')][_0x38c2('0x34')]);_0x4d9ce2[_0x38c2('0x35')]=qs[_0x38c2('0x2c')](_[_0x38c2('0x47')](_0x4c19e4[_0x38c2('0x2a')],_0x590140['filters']));if(_0x4c19e4[_0x38c2('0x2a')][_0x38c2('0x36')]){_0x4d9ce2[_0x38c2('0x35')]=_[_0x38c2('0x37')](_0x4d9ce2['where'],{'$or':_[_0x38c2('0x23')](_0x4d9ce2['attributes'],function(_0x5b064c){var _0x585ce7={};_0x585ce7[_0x5b064c]={'$like':'%'+_0x4c19e4[_0x38c2('0x2a')][_0x38c2('0x36')]+'%'};return _0x585ce7;})});}_0x4d9ce2=_['merge']({},_0x4d9ce2,_0x4c19e4[_0x38c2('0x39')]);return _0x3fbc6f[_0x38c2('0x48')](_0x4d9ce2);}})[_0x38c2('0x1d')](function(_0x3693ac){if(_0x3693ac){_0xade999=_0x3693ac[_0x38c2('0x30')];if(!_0x4c19e4[_0x38c2('0x2a')][_0x38c2('0x31')](_0x38c2('0x32'))){_0x4d9ce2[_0x38c2('0x18')]=qs[_0x38c2('0x18')](_0x4c19e4[_0x38c2('0x2a')][_0x38c2('0x18')]);_0x4d9ce2[_0x38c2('0x19')]=qs[_0x38c2('0x19')](_0x4c19e4['query'][_0x38c2('0x19')]);}return _0x3fbc6f[_0x38c2('0x48')](_0x4d9ce2);}})[_0x38c2('0x1d')](function(_0x13dd59){if(_0x13dd59){return _0x13dd59?{'count':_0xade999,'rows':_0x13dd59}:null;}})[_0x38c2('0x1d')](respondWithResult(_0x3cace3,null))[_0x38c2('0x42')](handleError(_0x3cace3,null));}; \ No newline at end of file +var _0x4463=['attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','Dynamics365Configuration','includeAll','include','findAll','rows','catch','show','keys','find','create','body','params','getFields','findOne','Dynamics365Field','pick','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','sendStatus','error','stack','name','send','rawAttributes','type','map','query','filters','intersection'];(function(_0x2ac35e,_0x2802d3){var _0x58ba3b=function(_0x124df0){while(--_0x124df0){_0x2ac35e['push'](_0x2ac35e['shift']());}};_0x58ba3b(++_0x2802d3);}(_0x4463,0x10f));var _0x3446=function(_0x4094d2,_0x207209){_0x4094d2=_0x4094d2-0x0;var _0x14f6da=_0x4463[_0x4094d2];return _0x14f6da;};'use strict';var emlformat=require(_0x3446('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3446('0x1'));var jsonpatch=require(_0x3446('0x2'));var rp=require(_0x3446('0x3'));var moment=require(_0x3446('0x4'));var BPromise=require(_0x3446('0x5'));var Mustache=require(_0x3446('0x6'));var util=require('util');var path=require('path');var sox=require(_0x3446('0x7'));var csv=require(_0x3446('0x8'));var ejs=require(_0x3446('0x9'));var fs=require('fs');var fs_extra=require(_0x3446('0xa'));var _=require(_0x3446('0xb'));var squel=require(_0x3446('0xc'));var crypto=require(_0x3446('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3446('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3446('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3446('0x10'));var qs=require(_0x3446('0x11'));var as=require(_0x3446('0x12'));var hardwareService=require(_0x3446('0x13'));var logger=require(_0x3446('0x14'))(_0x3446('0x15'));var utils=require(_0x3446('0x16'));var config=require(_0x3446('0x17'));var licenseUtil=require(_0x3446('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5b29a9,_0x109f51){_0x109f51=_0x109f51||0xcc;return function(_0x48a079){if(_0x48a079){return _0x5b29a9['sendStatus'](_0x109f51);}return _0x5b29a9[_0x3446('0x19')](_0x109f51)[_0x3446('0x1a')]();};}function respondWithResult(_0x35d22d,_0x4abe30){_0x4abe30=_0x4abe30||0xc8;return function(_0x23b456){if(_0x23b456){return _0x35d22d['status'](_0x4abe30)['json'](_0x23b456);}};}function respondWithFilteredResult(_0x1bcabd,_0x5bf885){return function(_0x53fcf0){if(_0x53fcf0){var _0x208001=typeof _0x5bf885[_0x3446('0x1b')]===_0x3446('0x1c')&&typeof _0x5bf885[_0x3446('0x1d')]==='undefined';var _0x5702f3=_0x53fcf0[_0x3446('0x1e')];var _0x557ebe=_0x208001?0x0:_0x5bf885[_0x3446('0x1b')];var _0x36be28=_0x208001?_0x53fcf0[_0x3446('0x1e')]:_0x5bf885[_0x3446('0x1b')]+_0x5bf885[_0x3446('0x1d')];var _0x364cc4;if(_0x36be28>=_0x5702f3){_0x36be28=_0x5702f3;_0x364cc4=0xc8;}else{_0x364cc4=0xce;}_0x1bcabd[_0x3446('0x19')](_0x364cc4);return _0x1bcabd[_0x3446('0x1f')](_0x3446('0x20'),_0x557ebe+'-'+_0x36be28+'/'+_0x5702f3)[_0x3446('0x21')](_0x53fcf0);}return null;};}function patchUpdates(_0x10e6cc){return function(_0x2f0c90){try{jsonpatch[_0x3446('0x22')](_0x2f0c90,_0x10e6cc,!![]);}catch(_0xb8287e){return BPromise[_0x3446('0x23')](_0xb8287e);}return _0x2f0c90['save']();};}function saveUpdates(_0x748e04,_0x4e73e2){return function(_0x5dd1be){if(_0x5dd1be){return _0x5dd1be[_0x3446('0x24')](_0x748e04)[_0x3446('0x25')](function(_0x720fda){return _0x720fda;});}return null;};}function removeEntity(_0x2b0e50,_0x4c5daf){return function(_0x5ceda3){if(_0x5ceda3){return _0x5ceda3['destroy']()[_0x3446('0x25')](function(){_0x2b0e50[_0x3446('0x19')](0xcc)[_0x3446('0x1a')]();});}};}function handleEntityNotFound(_0x13b47e,_0xe244aa){return function(_0x2da8ab){if(!_0x2da8ab){_0x13b47e[_0x3446('0x26')](0x194);}return _0x2da8ab;};}function handleError(_0x92064c,_0x3abb1f){_0x3abb1f=_0x3abb1f||0x1f4;return function(_0x536257){logger[_0x3446('0x27')](_0x536257[_0x3446('0x28')]);if(_0x536257[_0x3446('0x29')]){delete _0x536257[_0x3446('0x29')];}_0x92064c[_0x3446('0x19')](_0x3abb1f)[_0x3446('0x2a')](_0x536257);};}exports['index']=function(_0x1102a4,_0x5166dc){var _0xe8061e={},_0x51c8c3={},_0x4f7dcc={'count':0x0,'rows':[]};var _0x399333=_['map'](db['Dynamics365Configuration'][_0x3446('0x2b')],function(_0x1ee79a){return{'name':_0x1ee79a['fieldName'],'type':_0x1ee79a[_0x3446('0x2c')]['key']};});_0x51c8c3['model']=_[_0x3446('0x2d')](_0x399333,_0x3446('0x29'));_0x51c8c3[_0x3446('0x2e')]=_['keys'](_0x1102a4['query']);_0x51c8c3[_0x3446('0x2f')]=_[_0x3446('0x30')](_0x51c8c3['model'],_0x51c8c3[_0x3446('0x2e')]);_0xe8061e[_0x3446('0x31')]=_[_0x3446('0x30')](_0x51c8c3[_0x3446('0x32')],qs[_0x3446('0x33')](_0x1102a4['query'][_0x3446('0x33')]));_0xe8061e[_0x3446('0x31')]=_0xe8061e[_0x3446('0x31')][_0x3446('0x34')]?_0xe8061e[_0x3446('0x31')]:_0x51c8c3[_0x3446('0x32')];if(!_0x1102a4[_0x3446('0x2e')][_0x3446('0x35')](_0x3446('0x36'))){_0xe8061e['limit']=qs[_0x3446('0x1d')](_0x1102a4[_0x3446('0x2e')]['limit']);_0xe8061e[_0x3446('0x1b')]=qs[_0x3446('0x1b')](_0x1102a4[_0x3446('0x2e')][_0x3446('0x1b')]);}_0xe8061e[_0x3446('0x37')]=qs[_0x3446('0x38')](_0x1102a4[_0x3446('0x2e')][_0x3446('0x38')]);_0xe8061e[_0x3446('0x39')]=qs[_0x3446('0x2f')](_['pick'](_0x1102a4[_0x3446('0x2e')],_0x51c8c3[_0x3446('0x2f')]),_0x399333);if(_0x1102a4[_0x3446('0x2e')][_0x3446('0x3a')]){_0xe8061e['where']=_[_0x3446('0x3b')](_0xe8061e['where'],{'$or':_[_0x3446('0x2d')](_0x399333,function(_0x347978){if(_0x347978[_0x3446('0x2c')]!==_0x3446('0x3c')){var _0x213bc4={};_0x213bc4[_0x347978['name']]={'$like':'%'+_0x1102a4['query'][_0x3446('0x3a')]+'%'};return _0x213bc4;}})});}_0xe8061e=_[_0x3446('0x3b')]({},_0xe8061e,_0x1102a4[_0x3446('0x3d')]);var _0x46a599={'where':_0xe8061e[_0x3446('0x39')]};return db[_0x3446('0x3e')][_0x3446('0x1e')](_0x46a599)[_0x3446('0x25')](function(_0x1b53a2){_0x4f7dcc[_0x3446('0x1e')]=_0x1b53a2;if(_0x1102a4[_0x3446('0x2e')][_0x3446('0x3f')]){_0xe8061e[_0x3446('0x40')]=[{'all':!![]}];}return db[_0x3446('0x3e')][_0x3446('0x41')](_0xe8061e);})[_0x3446('0x25')](function(_0x4549dd){_0x4f7dcc[_0x3446('0x42')]=_0x4549dd;return _0x4f7dcc;})[_0x3446('0x25')](respondWithFilteredResult(_0x5166dc,_0xe8061e))[_0x3446('0x43')](handleError(_0x5166dc,null));};exports[_0x3446('0x44')]=function(_0x36dc94,_0x3ff2cc){var _0x13a605={'raw':![],'where':{'id':_0x36dc94['params']['id']}},_0x21d813={};_0x21d813[_0x3446('0x32')]=_[_0x3446('0x45')](db[_0x3446('0x3e')][_0x3446('0x2b')]);_0x21d813[_0x3446('0x2e')]=_['keys'](_0x36dc94[_0x3446('0x2e')]);_0x21d813[_0x3446('0x2f')]=_[_0x3446('0x30')](_0x21d813[_0x3446('0x32')],_0x21d813[_0x3446('0x2e')]);_0x13a605[_0x3446('0x31')]=_[_0x3446('0x30')](_0x21d813[_0x3446('0x32')],qs[_0x3446('0x33')](_0x36dc94['query'][_0x3446('0x33')]));_0x13a605[_0x3446('0x31')]=_0x13a605[_0x3446('0x31')][_0x3446('0x34')]?_0x13a605[_0x3446('0x31')]:_0x21d813[_0x3446('0x32')];if(_0x36dc94[_0x3446('0x2e')][_0x3446('0x3f')]){_0x13a605[_0x3446('0x40')]=[{'all':!![]}];}_0x13a605=_[_0x3446('0x3b')]({},_0x13a605,_0x36dc94[_0x3446('0x3d')]);return db['Dynamics365Configuration'][_0x3446('0x46')](_0x13a605)[_0x3446('0x25')](handleEntityNotFound(_0x3ff2cc,null))[_0x3446('0x25')](respondWithResult(_0x3ff2cc,null))[_0x3446('0x43')](handleError(_0x3ff2cc,null));};exports[_0x3446('0x47')]=function(_0x1202a7,_0x8b4be){return db[_0x3446('0x3e')][_0x3446('0x47')](_0x1202a7[_0x3446('0x48')],{})[_0x3446('0x25')](respondWithResult(_0x8b4be,0xc9))[_0x3446('0x43')](handleError(_0x8b4be,null));};exports['update']=function(_0x2ca0a8,_0x1eb349){if(_0x2ca0a8[_0x3446('0x48')]['id']){delete _0x2ca0a8[_0x3446('0x48')]['id'];}return db['Dynamics365Configuration'][_0x3446('0x46')]({'where':{'id':_0x2ca0a8[_0x3446('0x49')]['id']}})[_0x3446('0x25')](handleEntityNotFound(_0x1eb349,null))['then'](saveUpdates(_0x2ca0a8['body'],null))[_0x3446('0x25')](respondWithResult(_0x1eb349,null))['catch'](handleError(_0x1eb349,null));};exports['destroy']=function(_0x5ef81a,_0x4764a8){return db[_0x3446('0x3e')][_0x3446('0x46')]({'where':{'id':_0x5ef81a['params']['id']}})[_0x3446('0x25')](handleEntityNotFound(_0x4764a8,null))['then'](removeEntity(_0x4764a8,null))[_0x3446('0x43')](handleError(_0x4764a8,null));};exports[_0x3446('0x4a')]=function(_0x59f364,_0x4292b0,_0x5c743d){var _0x3b691e={};var _0x1b35ef={};var _0x4c4428;var _0x80da03;return db[_0x3446('0x3e')][_0x3446('0x4b')]({'where':{'id':_0x59f364[_0x3446('0x49')]['id']}})[_0x3446('0x25')](handleEntityNotFound(_0x4292b0,null))[_0x3446('0x25')](function(_0x2cd743){if(_0x2cd743){_0x4c4428=_0x2cd743;_0x1b35ef[_0x3446('0x32')]=_[_0x3446('0x45')](db[_0x3446('0x4c')][_0x3446('0x2b')]);_0x1b35ef[_0x3446('0x2e')]=_[_0x3446('0x45')](_0x59f364[_0x3446('0x2e')]);_0x1b35ef['filters']=_['intersection'](_0x1b35ef[_0x3446('0x32')],_0x1b35ef['query']);_0x3b691e[_0x3446('0x31')]=_[_0x3446('0x30')](_0x1b35ef[_0x3446('0x32')],qs[_0x3446('0x33')](_0x59f364[_0x3446('0x2e')]['fields']));_0x3b691e[_0x3446('0x31')]=_0x3b691e[_0x3446('0x31')][_0x3446('0x34')]?_0x3b691e['attributes']:_0x1b35ef[_0x3446('0x32')];_0x3b691e[_0x3446('0x37')]=qs[_0x3446('0x38')](_0x59f364[_0x3446('0x2e')]['sort']);_0x3b691e[_0x3446('0x39')]=qs['filters'](_[_0x3446('0x4d')](_0x59f364[_0x3446('0x2e')],_0x1b35ef[_0x3446('0x2f')]));if(_0x59f364[_0x3446('0x2e')]['filter']){_0x3b691e[_0x3446('0x39')]=_[_0x3446('0x3b')](_0x3b691e[_0x3446('0x39')],{'$or':_['map'](_0x3b691e[_0x3446('0x31')],function(_0x2dbaf3){var _0x53076d={};_0x53076d[_0x2dbaf3]={'$like':'%'+_0x59f364[_0x3446('0x2e')][_0x3446('0x3a')]+'%'};return _0x53076d;})});}_0x3b691e=_[_0x3446('0x3b')]({},_0x3b691e,_0x59f364[_0x3446('0x3d')]);return _0x4c4428[_0x3446('0x4a')](_0x3b691e);}})[_0x3446('0x25')](function(_0x7eb73f){if(_0x7eb73f){_0x80da03=_0x7eb73f[_0x3446('0x34')];if(!_0x59f364[_0x3446('0x2e')]['hasOwnProperty']('nolimit')){_0x3b691e[_0x3446('0x1d')]=qs[_0x3446('0x1d')](_0x59f364[_0x3446('0x2e')][_0x3446('0x1d')]);_0x3b691e[_0x3446('0x1b')]=qs[_0x3446('0x1b')](_0x59f364[_0x3446('0x2e')][_0x3446('0x1b')]);}return _0x4c4428[_0x3446('0x4a')](_0x3b691e);}})['then'](function(_0x236575){if(_0x236575){return _0x236575?{'count':_0x80da03,'rows':_0x236575}:null;}})['then'](respondWithResult(_0x4292b0,null))['catch'](handleError(_0x4292b0,null));};exports[_0x3446('0x4e')]=function(_0x49e234,_0x575294,_0x4d28ba){var _0x44f48e={};var _0xe81856={};var _0x266207;var _0x181bf6;return db[_0x3446('0x3e')][_0x3446('0x4b')]({'where':{'id':_0x49e234[_0x3446('0x49')]['id']}})[_0x3446('0x25')](handleEntityNotFound(_0x575294,null))[_0x3446('0x25')](function(_0x1530b7){if(_0x1530b7){_0x266207=_0x1530b7;_0xe81856[_0x3446('0x32')]=_[_0x3446('0x45')](db[_0x3446('0x4c')][_0x3446('0x2b')]);_0xe81856['query']=_[_0x3446('0x45')](_0x49e234['query']);_0xe81856[_0x3446('0x2f')]=_[_0x3446('0x30')](_0xe81856[_0x3446('0x32')],_0xe81856[_0x3446('0x2e')]);_0x44f48e[_0x3446('0x31')]=_[_0x3446('0x30')](_0xe81856['model'],qs['fields'](_0x49e234['query']['fields']));_0x44f48e['attributes']=_0x44f48e[_0x3446('0x31')]['length']?_0x44f48e[_0x3446('0x31')]:_0xe81856[_0x3446('0x32')];_0x44f48e[_0x3446('0x37')]=qs['sort'](_0x49e234[_0x3446('0x2e')][_0x3446('0x38')]);_0x44f48e[_0x3446('0x39')]=qs[_0x3446('0x2f')](_[_0x3446('0x4d')](_0x49e234[_0x3446('0x2e')],_0xe81856[_0x3446('0x2f')]));if(_0x49e234[_0x3446('0x2e')]['filter']){_0x44f48e[_0x3446('0x39')]=_['merge'](_0x44f48e[_0x3446('0x39')],{'$or':_[_0x3446('0x2d')](_0x44f48e[_0x3446('0x31')],function(_0x40b721){var _0x14509c={};_0x14509c[_0x40b721]={'$like':'%'+_0x49e234[_0x3446('0x2e')][_0x3446('0x3a')]+'%'};return _0x14509c;})});}_0x44f48e=_[_0x3446('0x3b')]({},_0x44f48e,_0x49e234['options']);return _0x266207['getSubjects'](_0x44f48e);}})[_0x3446('0x25')](function(_0x5d2041){if(_0x5d2041){_0x181bf6=_0x5d2041[_0x3446('0x34')];if(!_0x49e234[_0x3446('0x2e')]['hasOwnProperty']('nolimit')){_0x44f48e[_0x3446('0x1d')]=qs[_0x3446('0x1d')](_0x49e234[_0x3446('0x2e')][_0x3446('0x1d')]);_0x44f48e[_0x3446('0x1b')]=qs[_0x3446('0x1b')](_0x49e234[_0x3446('0x2e')]['offset']);}return _0x266207[_0x3446('0x4e')](_0x44f48e);}})[_0x3446('0x25')](function(_0x2d92b3){if(_0x2d92b3){return _0x2d92b3?{'count':_0x181bf6,'rows':_0x2d92b3}:null;}})[_0x3446('0x25')](respondWithResult(_0x575294,null))[_0x3446('0x43')](handleError(_0x575294,null));};exports[_0x3446('0x4f')]=function(_0x16abfb,_0x55dbf0,_0x18a733){var _0x28376a={};var _0x5e3dae={};var _0x5837ca;var _0x2e5c43;return db['Dynamics365Configuration'][_0x3446('0x4b')]({'where':{'id':_0x16abfb[_0x3446('0x49')]['id']}})[_0x3446('0x25')](handleEntityNotFound(_0x55dbf0,null))[_0x3446('0x25')](function(_0x1b9e07){if(_0x1b9e07){_0x5837ca=_0x1b9e07;_0x5e3dae['model']=_['keys'](db[_0x3446('0x4c')][_0x3446('0x2b')]);_0x5e3dae[_0x3446('0x2e')]=_[_0x3446('0x45')](_0x16abfb[_0x3446('0x2e')]);_0x5e3dae[_0x3446('0x2f')]=_[_0x3446('0x30')](_0x5e3dae[_0x3446('0x32')],_0x5e3dae[_0x3446('0x2e')]);_0x28376a[_0x3446('0x31')]=_[_0x3446('0x30')](_0x5e3dae[_0x3446('0x32')],qs[_0x3446('0x33')](_0x16abfb[_0x3446('0x2e')][_0x3446('0x33')]));_0x28376a[_0x3446('0x31')]=_0x28376a['attributes']['length']?_0x28376a[_0x3446('0x31')]:_0x5e3dae['model'];_0x28376a['order']=qs['sort'](_0x16abfb[_0x3446('0x2e')][_0x3446('0x38')]);_0x28376a[_0x3446('0x39')]=qs[_0x3446('0x2f')](_[_0x3446('0x4d')](_0x16abfb[_0x3446('0x2e')],_0x5e3dae[_0x3446('0x2f')]));if(_0x16abfb['query']['filter']){_0x28376a['where']=_['merge'](_0x28376a[_0x3446('0x39')],{'$or':_[_0x3446('0x2d')](_0x28376a['attributes'],function(_0x9ec409){var _0x9af567={};_0x9af567[_0x9ec409]={'$like':'%'+_0x16abfb[_0x3446('0x2e')][_0x3446('0x3a')]+'%'};return _0x9af567;})});}_0x28376a=_[_0x3446('0x3b')]({},_0x28376a,_0x16abfb[_0x3446('0x3d')]);return _0x5837ca[_0x3446('0x4f')](_0x28376a);}})[_0x3446('0x25')](function(_0x14d370){if(_0x14d370){_0x2e5c43=_0x14d370[_0x3446('0x34')];if(!_0x16abfb[_0x3446('0x2e')][_0x3446('0x35')](_0x3446('0x36'))){_0x28376a[_0x3446('0x1d')]=qs[_0x3446('0x1d')](_0x16abfb[_0x3446('0x2e')][_0x3446('0x1d')]);_0x28376a[_0x3446('0x1b')]=qs[_0x3446('0x1b')](_0x16abfb['query'][_0x3446('0x1b')]);}return _0x5837ca[_0x3446('0x4f')](_0x28376a);}})[_0x3446('0x25')](function(_0x39b0c5){if(_0x39b0c5){return _0x39b0c5?{'count':_0x2e5c43,'rows':_0x39b0c5}:null;}})['then'](respondWithResult(_0x55dbf0,null))['catch'](handleError(_0x55dbf0,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 1d7fd71..1557966 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 _0x6f0d=['./intDynamics365Configuration.attributes','define','Dynamics365Configuration','int_dynamics365_configurations','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x4ae829,_0x2c842c){var _0x256b31=function(_0x34f104){while(--_0x34f104){_0x4ae829['push'](_0x4ae829['shift']());}};_0x256b31(++_0x2c842c);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x8b6cad,_0x394df1){_0x8b6cad=_0x8b6cad-0x0;var _0x1e54b3=_0x6f0d[_0x8b6cad];return _0x1e54b3;};'use strict';var _=require('lodash');var util=require(_0xd6f0('0x0'));var logger=require(_0xd6f0('0x1'))(_0xd6f0('0x2'));var moment=require(_0xd6f0('0x3'));var BPromise=require('bluebird');var rp=require(_0xd6f0('0x4'));var fs=require('fs');var path=require(_0xd6f0('0x5'));var rimraf=require(_0xd6f0('0x6'));var config=require(_0xd6f0('0x7'));var attributes=require(_0xd6f0('0x8'));module['exports']=function(_0x2d2ce6,_0x4a8b0c){return _0x2d2ce6[_0xd6f0('0x9')](_0xd6f0('0xa'),attributes,{'tableName':_0xd6f0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9bde=['request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','util','api','bluebird'];(function(_0x467929,_0x3fd971){var _0x1b28c1=function(_0x247f6f){while(--_0x247f6f){_0x467929['push'](_0x467929['shift']());}};_0x1b28c1(++_0x3fd971);}(_0x9bde,0xe1));var _0xe9bd=function(_0x3088f1,_0x5076fd){_0x3088f1=_0x3088f1-0x0;var _0x19e1f3=_0x9bde[_0x3088f1];return _0x19e1f3;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var logger=require('../../config/logger')(_0xe9bd('0x1'));var moment=require('moment');var BPromise=require(_0xe9bd('0x2'));var rp=require(_0xe9bd('0x3'));var fs=require('fs');var path=require(_0xe9bd('0x4'));var rimraf=require(_0xe9bd('0x5'));var config=require(_0xe9bd('0x6'));var attributes=require(_0xe9bd('0x7'));module[_0xe9bd('0x8')]=function(_0x4fd7b8,_0x4763e9){return _0x4fd7b8[_0xe9bd('0x9')](_0xe9bd('0xa'),attributes,{'tableName':_0xe9bd('0xb'),'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 3b32197..1ee8211 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 _0xc232=['../../config/environment','client','http','request','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x38eb5a,_0x3c7f6e){var _0x203b8a=function(_0x528112){while(--_0x528112){_0x38eb5a['push'](_0x38eb5a['shift']());}};_0x203b8a(++_0x3c7f6e);}(_0xc232,0xbf));var _0x2c23=function(_0xdc5edc,_0x155f84){_0xdc5edc=_0xdc5edc-0x0;var _0x56e5d6=_0xc232[_0xdc5edc];return _0x56e5d6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2c23('0x0'));var BPromise=require('bluebird');var rs=require(_0x2c23('0x1'));var fs=require('fs');var Redis=require(_0x2c23('0x2'));var db=require(_0x2c23('0x3'))['db'];var utils=require(_0x2c23('0x4'));var logger=require(_0x2c23('0x5'))(_0x2c23('0x6'));var config=require(_0x2c23('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2c23('0x8')][_0x2c23('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x212ca1,_0xe995d,_0x4d1461){return new BPromise(function(_0x4f7c4a,_0x464e39){return client[_0x2c23('0xa')](_0x212ca1,_0x4d1461)['then'](function(_0x4a142e){logger[_0x2c23('0xb')](_0x2c23('0xc'),_0xe995d,_0x2c23('0xd'));logger[_0x2c23('0xe')](_0x2c23('0xf'),_0xe995d,_0x2c23('0xd'),JSON[_0x2c23('0x10')](_0x4a142e));if(_0x4a142e['error']){if(_0x4a142e['error'][_0x2c23('0x11')]===0x1f4){logger[_0x2c23('0x12')]('Dynamics365Configuration,\x20%s,\x20%s',_0xe995d,_0x4a142e['error'][_0x2c23('0x13')]);return _0x464e39(_0x4a142e[_0x2c23('0x12')][_0x2c23('0x13')]);}logger[_0x2c23('0x12')](_0x2c23('0xc'),_0xe995d,_0x4a142e['error'][_0x2c23('0x13')]);return _0x4f7c4a(_0x4a142e['error'][_0x2c23('0x13')]);}else{logger[_0x2c23('0xb')]('Dynamics365Configuration,\x20%s,\x20%s',_0xe995d,_0x2c23('0xd'));_0x4f7c4a(_0x4a142e[_0x2c23('0x14')][_0x2c23('0x13')]);}})[_0x2c23('0x15')](function(_0x3a53a3){logger[_0x2c23('0x12')](_0x2c23('0xc'),_0xe995d,_0x3a53a3);_0x464e39(_0x3a53a3);});});} \ No newline at end of file +var _0xd8b7=['error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xd8b7,0xb8));var _0x7d8b=function(_0x2005c6,_0x2d4763){_0x2005c6=_0x2005c6-0x0;var _0x187368=_0xd8b7[_0x2005c6];return _0x187368;};'use strict';var _=require(_0x7d8b('0x0'));var util=require(_0x7d8b('0x1'));var moment=require(_0x7d8b('0x2'));var BPromise=require('bluebird');var rs=require(_0x7d8b('0x3'));var fs=require('fs');var Redis=require(_0x7d8b('0x4'));var db=require(_0x7d8b('0x5'))['db'];var utils=require(_0x7d8b('0x6'));var logger=require(_0x7d8b('0x7'))(_0x7d8b('0x8'));var config=require(_0x7d8b('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7d8b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2c7906,_0x1b63bd,_0x4b83c8){return new BPromise(function(_0x312f2e,_0x4e21f5){return client['request'](_0x2c7906,_0x4b83c8)['then'](function(_0x54f2ee){logger[_0x7d8b('0xb')](_0x7d8b('0xc'),_0x1b63bd,_0x7d8b('0xd'));logger['debug'](_0x7d8b('0xe'),_0x1b63bd,_0x7d8b('0xd'),JSON[_0x7d8b('0xf')](_0x54f2ee));if(_0x54f2ee[_0x7d8b('0x10')]){if(_0x54f2ee[_0x7d8b('0x10')][_0x7d8b('0x11')]===0x1f4){logger[_0x7d8b('0x10')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1b63bd,_0x54f2ee['error'][_0x7d8b('0x12')]);return _0x4e21f5(_0x54f2ee[_0x7d8b('0x10')][_0x7d8b('0x12')]);}logger[_0x7d8b('0x10')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1b63bd,_0x54f2ee[_0x7d8b('0x10')][_0x7d8b('0x12')]);return _0x312f2e(_0x54f2ee['error'][_0x7d8b('0x12')]);}else{logger['info'](_0x7d8b('0xc'),_0x1b63bd,'request\x20sent');_0x312f2e(_0x54f2ee[_0x7d8b('0x13')][_0x7d8b('0x12')]);}})['catch'](function(_0x218479){logger[_0x7d8b('0x10')](_0x7d8b('0xc'),_0x1b63bd,_0x218479);_0x4e21f5(_0x218479);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 58b39bb..77cb5c3 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 _0x14ab=['../../components/auth/service','./intDynamics365Field.controller','get','isAuthenticated','index','show','post','create','put','update','delete','/:id','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x41900b,_0x147dad){var _0x3ef84d=function(_0x1f5c77){while(--_0x1f5c77){_0x41900b['push'](_0x41900b['shift']());}};_0x3ef84d(++_0x147dad);}(_0x14ab,0x18a));var _0xb14a=function(_0x35a142,_0x4a1f3f){_0x35a142=_0x35a142-0x0;var _0x2b11d6=_0x14ab[_0x35a142];return _0x2b11d6;};'use strict';var multer=require(_0xb14a('0x0'));var util=require(_0xb14a('0x1'));var path=require('path');var timeout=require(_0xb14a('0x2'));var express=require(_0xb14a('0x3'));var router=express[_0xb14a('0x4')]();var fs_extra=require(_0xb14a('0x5'));var auth=require(_0xb14a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb14a('0x7'));router[_0xb14a('0x8')]('/',auth[_0xb14a('0x9')](),controller[_0xb14a('0xa')]);router[_0xb14a('0x8')]('/:id',auth[_0xb14a('0x9')](),controller[_0xb14a('0xb')]);router[_0xb14a('0xc')]('/',auth['isAuthenticated'](),controller[_0xb14a('0xd')]);router[_0xb14a('0xe')]('/:id',auth[_0xb14a('0x9')](),controller[_0xb14a('0xf')]);router[_0xb14a('0x10')](_0xb14a('0x11'),auth['isAuthenticated'](),controller[_0xb14a('0x12')]);module[_0xb14a('0x13')]=router; \ No newline at end of file +var _0x1c26=['../../config/environment','./intDynamics365Field.controller','isAuthenticated','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x53b72c,_0x33f3ec){var _0x43ecec=function(_0x7de2c5){while(--_0x7de2c5){_0x53b72c['push'](_0x53b72c['shift']());}};_0x43ecec(++_0x33f3ec);}(_0x1c26,0x1db));var _0x61c2=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x1c26[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0x61c2('0x0'));var util=require(_0x61c2('0x1'));var path=require(_0x61c2('0x2'));var timeout=require(_0x61c2('0x3'));var express=require('express');var router=express[_0x61c2('0x4')]();var fs_extra=require(_0x61c2('0x5'));var auth=require(_0x61c2('0x6'));var interaction=require(_0x61c2('0x7'));var config=require(_0x61c2('0x8'));var controller=require(_0x61c2('0x9'));router['get']('/',auth[_0x61c2('0xa')](),controller['index']);router[_0x61c2('0xb')](_0x61c2('0xc'),auth[_0x61c2('0xa')](),controller[_0x61c2('0xd')]);router[_0x61c2('0xe')]('/',auth['isAuthenticated'](),controller[_0x61c2('0xf')]);router[_0x61c2('0x10')](_0x61c2('0xc'),auth['isAuthenticated'](),controller[_0x61c2('0x11')]);router[_0x61c2('0x12')](_0x61c2('0xc'),auth[_0x61c2('0xa')](),controller[_0x61c2('0x13')]);module[_0x61c2('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 671fa41..c3eae01 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 _0xec91=['STRING','BOOLEAN','sequelize','exports','ENUM','variable','keyValue','picklist','string'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xec91,0xb6));var _0x1ec9=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0xec91[_0x4bb66f];return _0xf2772f;};'use strict';var Sequelize=require(_0x1ec9('0x0'));module[_0x1ec9('0x1')]={'type':{'type':Sequelize[_0x1ec9('0x2')]('string',_0x1ec9('0x3'),'customVariable',_0x1ec9('0x4'),_0x1ec9('0x5')),'defaultValue':_0x1ec9('0x6')},'content':{'type':Sequelize[_0x1ec9('0x7')]},'key':{'type':Sequelize[_0x1ec9('0x7')]},'keyType':{'type':Sequelize[_0x1ec9('0x2')](_0x1ec9('0x6'),_0x1ec9('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x1ec9('0x7')]},'idField':{'type':Sequelize[_0x1ec9('0x7')]},'nameField':{'type':Sequelize[_0x1ec9('0x7')]},'customField':{'type':Sequelize[_0x1ec9('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1ec9('0x7')]}}; \ No newline at end of file +var _0x29fb=['customVariable','keyValue','picklist','STRING','sequelize','ENUM','string','variable'];(function(_0x7d3dfe,_0x2094dc){var _0x59ae2f=function(_0x35827b){while(--_0x35827b){_0x7d3dfe['push'](_0x7d3dfe['shift']());}};_0x59ae2f(++_0x2094dc);}(_0x29fb,0x18c));var _0xb29f=function(_0x2e2755,_0xd67d7c){_0x2e2755=_0x2e2755-0x0;var _0x2afe37=_0x29fb[_0x2e2755];return _0x2afe37;};'use strict';var Sequelize=require(_0xb29f('0x0'));module['exports']={'type':{'type':Sequelize[_0xb29f('0x1')](_0xb29f('0x2'),_0xb29f('0x3'),_0xb29f('0x4'),_0xb29f('0x5'),_0xb29f('0x6')),'defaultValue':_0xb29f('0x2')},'content':{'type':Sequelize[_0xb29f('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xb29f('0x1')](_0xb29f('0x2'),'variable',_0xb29f('0x4'))},'keyContent':{'type':Sequelize[_0xb29f('0x7')]},'idField':{'type':Sequelize[_0xb29f('0x7')]},'nameField':{'type':Sequelize[_0xb29f('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb29f('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index dfbdb6e..0e490cc 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 _0xe382=['../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','create','body','find','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x3f101c,_0x21440c){var _0x2ae6e1=function(_0x55b10a){while(--_0x55b10a){_0x3f101c['push'](_0x3f101c['shift']());}};_0x2ae6e1(++_0x21440c);}(_0xe382,0xcb));var _0x2e38=function(_0x5c9307,_0x5b97e4){_0x5c9307=_0x5c9307-0x0;var _0x373e29=_0xe382[_0x5c9307];return _0x373e29;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2e38('0x0'));var zipdir=require(_0x2e38('0x1'));var jsonpatch=require(_0x2e38('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2e38('0x3'));var Mustache=require(_0x2e38('0x4'));var util=require('util');var path=require(_0x2e38('0x5'));var sox=require(_0x2e38('0x6'));var csv=require(_0x2e38('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2e38('0x8'));var _=require('lodash');var squel=require(_0x2e38('0x9'));var crypto=require(_0x2e38('0xa'));var jsforce=require(_0x2e38('0xb'));var deskjs=require(_0x2e38('0xc'));var toCsv=require(_0x2e38('0x7'));var querystring=require('querystring');var Papa=require(_0x2e38('0xd'));var Redis=require('ioredis');var authService=require(_0x2e38('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x2e38('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2e38('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x2e38('0x11'));var licenseUtil=require(_0x2e38('0x12'));var db=require(_0x2e38('0x13'))['db'];function respondWithStatusCode(_0x25c6ae,_0x5ef992){_0x5ef992=_0x5ef992||0xcc;return function(_0x551d64){if(_0x551d64){return _0x25c6ae[_0x2e38('0x14')](_0x5ef992);}return _0x25c6ae[_0x2e38('0x15')](_0x5ef992)['end']();};}function respondWithResult(_0xcc3106,_0x471215){_0x471215=_0x471215||0xc8;return function(_0x261a10){if(_0x261a10){return _0xcc3106[_0x2e38('0x15')](_0x471215)['json'](_0x261a10);}};}function respondWithFilteredResult(_0x40377e,_0x201978){return function(_0x4457d9){if(_0x4457d9){var _0x2bbc25=typeof _0x201978[_0x2e38('0x16')]===_0x2e38('0x17')&&typeof _0x201978[_0x2e38('0x18')]==='undefined';var _0x51a17f=_0x4457d9[_0x2e38('0x19')];var _0x141803=_0x2bbc25?0x0:_0x201978['offset'];var _0x3c1b9=_0x2bbc25?_0x4457d9['count']:_0x201978['offset']+_0x201978[_0x2e38('0x18')];var _0xb69280;if(_0x3c1b9>=_0x51a17f){_0x3c1b9=_0x51a17f;_0xb69280=0xc8;}else{_0xb69280=0xce;}_0x40377e[_0x2e38('0x15')](_0xb69280);return _0x40377e[_0x2e38('0x1a')](_0x2e38('0x1b'),_0x141803+'-'+_0x3c1b9+'/'+_0x51a17f)[_0x2e38('0x1c')](_0x4457d9);}return null;};}function patchUpdates(_0x202662){return function(_0x175426){try{jsonpatch[_0x2e38('0x1d')](_0x175426,_0x202662,!![]);}catch(_0x37bc15){return BPromise[_0x2e38('0x1e')](_0x37bc15);}return _0x175426[_0x2e38('0x1f')]();};}function saveUpdates(_0x3d5e45,_0x2dd4bb){return function(_0x423e8b){if(_0x423e8b){return _0x423e8b[_0x2e38('0x20')](_0x3d5e45)[_0x2e38('0x21')](function(_0x5f1866){return _0x5f1866;});}return null;};}function removeEntity(_0x156df6,_0xf2298f){return function(_0x282eac){if(_0x282eac){return _0x282eac[_0x2e38('0x22')]()['then'](function(){_0x156df6[_0x2e38('0x15')](0xcc)[_0x2e38('0x23')]();});}};}function handleEntityNotFound(_0x433ee8,_0x58b822){return function(_0x2638d1){if(!_0x2638d1){_0x433ee8[_0x2e38('0x14')](0x194);}return _0x2638d1;};}function handleError(_0x1b51bf,_0x3064e6){_0x3064e6=_0x3064e6||0x1f4;return function(_0x3f7183){logger[_0x2e38('0x24')](_0x3f7183[_0x2e38('0x25')]);if(_0x3f7183['name']){delete _0x3f7183[_0x2e38('0x26')];}_0x1b51bf[_0x2e38('0x15')](_0x3064e6)[_0x2e38('0x27')](_0x3f7183);};}exports[_0x2e38('0x28')]=function(_0xc52eec,_0x19c073){var _0x34d2a9={},_0x136083={},_0x57c312={'count':0x0,'rows':[]};var _0x46e12e=_[_0x2e38('0x29')](db[_0x2e38('0x2a')][_0x2e38('0x2b')],function(_0x1406da){return{'name':_0x1406da[_0x2e38('0x2c')],'type':_0x1406da['type'][_0x2e38('0x2d')]};});_0x136083[_0x2e38('0x2e')]=_[_0x2e38('0x29')](_0x46e12e,_0x2e38('0x26'));_0x136083[_0x2e38('0x2f')]=_[_0x2e38('0x30')](_0xc52eec[_0x2e38('0x2f')]);_0x136083[_0x2e38('0x31')]=_[_0x2e38('0x32')](_0x136083[_0x2e38('0x2e')],_0x136083[_0x2e38('0x2f')]);_0x34d2a9[_0x2e38('0x33')]=_[_0x2e38('0x32')](_0x136083[_0x2e38('0x2e')],qs[_0x2e38('0x34')](_0xc52eec[_0x2e38('0x2f')][_0x2e38('0x34')]));_0x34d2a9[_0x2e38('0x33')]=_0x34d2a9[_0x2e38('0x33')][_0x2e38('0x35')]?_0x34d2a9['attributes']:_0x136083['model'];if(!_0xc52eec[_0x2e38('0x2f')][_0x2e38('0x36')]('nolimit')){_0x34d2a9['limit']=qs[_0x2e38('0x18')](_0xc52eec[_0x2e38('0x2f')]['limit']);_0x34d2a9[_0x2e38('0x16')]=qs[_0x2e38('0x16')](_0xc52eec[_0x2e38('0x2f')][_0x2e38('0x16')]);}_0x34d2a9[_0x2e38('0x37')]=qs[_0x2e38('0x38')](_0xc52eec['query'][_0x2e38('0x38')]);_0x34d2a9[_0x2e38('0x39')]=qs['filters'](_[_0x2e38('0x3a')](_0xc52eec[_0x2e38('0x2f')],_0x136083[_0x2e38('0x31')]),_0x46e12e);if(_0xc52eec[_0x2e38('0x2f')][_0x2e38('0x3b')]){_0x34d2a9['where']=_[_0x2e38('0x3c')](_0x34d2a9[_0x2e38('0x39')],{'$or':_[_0x2e38('0x29')](_0x46e12e,function(_0x4a03ac){if(_0x4a03ac[_0x2e38('0x3d')]!==_0x2e38('0x3e')){var _0x319614={};_0x319614[_0x4a03ac[_0x2e38('0x26')]]={'$like':'%'+_0xc52eec[_0x2e38('0x2f')][_0x2e38('0x3b')]+'%'};return _0x319614;}})});}_0x34d2a9=_[_0x2e38('0x3c')]({},_0x34d2a9,_0xc52eec[_0x2e38('0x3f')]);var _0x2e680b={'where':_0x34d2a9['where']};return db[_0x2e38('0x2a')][_0x2e38('0x19')](_0x2e680b)[_0x2e38('0x21')](function(_0x24ece7){_0x57c312[_0x2e38('0x19')]=_0x24ece7;if(_0xc52eec[_0x2e38('0x2f')][_0x2e38('0x40')]){_0x34d2a9[_0x2e38('0x41')]=[{'all':!![]}];}return db[_0x2e38('0x2a')][_0x2e38('0x42')](_0x34d2a9);})[_0x2e38('0x21')](function(_0xaae97e){_0x57c312['rows']=_0xaae97e;return _0x57c312;})[_0x2e38('0x21')](respondWithFilteredResult(_0x19c073,_0x34d2a9))[_0x2e38('0x43')](handleError(_0x19c073,null));};exports[_0x2e38('0x44')]=function(_0x28a372,_0x7f1380){var _0x4978ad={'raw':!![],'where':{'id':_0x28a372[_0x2e38('0x45')]['id']}},_0x9e4861={};_0x9e4861[_0x2e38('0x2e')]=_[_0x2e38('0x30')](db[_0x2e38('0x2a')][_0x2e38('0x2b')]);_0x9e4861['query']=_[_0x2e38('0x30')](_0x28a372['query']);_0x9e4861[_0x2e38('0x31')]=_[_0x2e38('0x32')](_0x9e4861['model'],_0x9e4861['query']);_0x4978ad[_0x2e38('0x33')]=_[_0x2e38('0x32')](_0x9e4861[_0x2e38('0x2e')],qs[_0x2e38('0x34')](_0x28a372[_0x2e38('0x2f')][_0x2e38('0x34')]));_0x4978ad['attributes']=_0x4978ad[_0x2e38('0x33')][_0x2e38('0x35')]?_0x4978ad[_0x2e38('0x33')]:_0x9e4861[_0x2e38('0x2e')];if(_0x28a372[_0x2e38('0x2f')]['includeAll']){_0x4978ad[_0x2e38('0x41')]=[{'all':!![]}];}_0x4978ad=_[_0x2e38('0x3c')]({},_0x4978ad,_0x28a372[_0x2e38('0x3f')]);return db['Dynamics365Field']['find'](_0x4978ad)[_0x2e38('0x21')](handleEntityNotFound(_0x7f1380,null))[_0x2e38('0x21')](respondWithResult(_0x7f1380,null))[_0x2e38('0x43')](handleError(_0x7f1380,null));};exports[_0x2e38('0x46')]=function(_0x515b77,_0x2f9124){return db[_0x2e38('0x2a')][_0x2e38('0x46')](_0x515b77[_0x2e38('0x47')],{})[_0x2e38('0x21')](respondWithResult(_0x2f9124,0xc9))[_0x2e38('0x43')](handleError(_0x2f9124,null));};exports[_0x2e38('0x20')]=function(_0x3a66cc,_0x2574c6){if(_0x3a66cc[_0x2e38('0x47')]['id']){delete _0x3a66cc['body']['id'];}return db[_0x2e38('0x2a')][_0x2e38('0x48')]({'where':{'id':_0x3a66cc[_0x2e38('0x45')]['id']}})[_0x2e38('0x21')](handleEntityNotFound(_0x2574c6,null))['then'](saveUpdates(_0x3a66cc[_0x2e38('0x47')],null))[_0x2e38('0x21')](respondWithResult(_0x2574c6,null))[_0x2e38('0x43')](handleError(_0x2574c6,null));};exports[_0x2e38('0x22')]=function(_0x1afabf,_0x58e70d){return db['Dynamics365Field'][_0x2e38('0x48')]({'where':{'id':_0x1afabf[_0x2e38('0x45')]['id']}})[_0x2e38('0x21')](handleEntityNotFound(_0x58e70d,null))[_0x2e38('0x21')](removeEntity(_0x58e70d,null))[_0x2e38('0x43')](handleError(_0x58e70d,null));}; \ No newline at end of file +var _0x9403=['Dynamics365Field','fieldName','key','model','query','keys','attributes','intersection','length','nolimit','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','show','params','rawAttributes','fields','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','Content-Range','apply','save','update','then','destroy','error','name','send','index','map'];(function(_0x505088,_0x23a321){var _0x3eb2c9=function(_0x2fcf8d){while(--_0x2fcf8d){_0x505088['push'](_0x505088['shift']());}};_0x3eb2c9(++_0x23a321);}(_0x9403,0xa6));var _0x3940=function(_0x16f8aa,_0x4a0b8b){_0x16f8aa=_0x16f8aa-0x0;var _0x39fd18=_0x9403[_0x16f8aa];return _0x39fd18;};'use strict';var emlformat=require(_0x3940('0x0'));var rimraf=require(_0x3940('0x1'));var zipdir=require(_0x3940('0x2'));var jsonpatch=require(_0x3940('0x3'));var rp=require(_0x3940('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3940('0x5'));var util=require(_0x3940('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(_0x3940('0x7'));var _=require(_0x3940('0x8'));var squel=require(_0x3940('0x9'));var crypto=require('crypto');var jsforce=require(_0x3940('0xa'));var deskjs=require(_0x3940('0xb'));var toCsv=require('to-csv');var querystring=require(_0x3940('0xc'));var Papa=require(_0x3940('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3940('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3940('0xf'))(_0x3940('0x10'));var utils=require(_0x3940('0x11'));var config=require(_0x3940('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x3940('0x13'))['db'];function respondWithStatusCode(_0x261892,_0x2f2973){_0x2f2973=_0x2f2973||0xcc;return function(_0x9af07d){if(_0x9af07d){return _0x261892[_0x3940('0x14')](_0x2f2973);}return _0x261892[_0x3940('0x15')](_0x2f2973)[_0x3940('0x16')]();};}function respondWithResult(_0x17f9cf,_0x38ac8a){_0x38ac8a=_0x38ac8a||0xc8;return function(_0x1d4d6d){if(_0x1d4d6d){return _0x17f9cf[_0x3940('0x15')](_0x38ac8a)['json'](_0x1d4d6d);}};}function respondWithFilteredResult(_0x1ec898,_0x217da8){return function(_0x20daf2){if(_0x20daf2){var _0xa33250=typeof _0x217da8[_0x3940('0x17')]==='undefined'&&typeof _0x217da8[_0x3940('0x18')]===_0x3940('0x19');var _0x3cae8f=_0x20daf2[_0x3940('0x1a')];var _0x3cf645=_0xa33250?0x0:_0x217da8['offset'];var _0x4757db=_0xa33250?_0x20daf2[_0x3940('0x1a')]:_0x217da8[_0x3940('0x17')]+_0x217da8[_0x3940('0x18')];var _0x28ac63;if(_0x4757db>=_0x3cae8f){_0x4757db=_0x3cae8f;_0x28ac63=0xc8;}else{_0x28ac63=0xce;}_0x1ec898['status'](_0x28ac63);return _0x1ec898['set'](_0x3940('0x1b'),_0x3cf645+'-'+_0x4757db+'/'+_0x3cae8f)['json'](_0x20daf2);}return null;};}function patchUpdates(_0xed9854){return function(_0x56c5de){try{jsonpatch[_0x3940('0x1c')](_0x56c5de,_0xed9854,!![]);}catch(_0xd4a32e){return BPromise['reject'](_0xd4a32e);}return _0x56c5de[_0x3940('0x1d')]();};}function saveUpdates(_0x5506c2,_0x42b5e1){return function(_0x2479f4){if(_0x2479f4){return _0x2479f4[_0x3940('0x1e')](_0x5506c2)[_0x3940('0x1f')](function(_0x1f5ce7){return _0x1f5ce7;});}return null;};}function removeEntity(_0xe3d3b0,_0x40c7c9){return function(_0xf555c0){if(_0xf555c0){return _0xf555c0[_0x3940('0x20')]()['then'](function(){_0xe3d3b0[_0x3940('0x15')](0xcc)[_0x3940('0x16')]();});}};}function handleEntityNotFound(_0x45f571,_0x5152d2){return function(_0x53a91f){if(!_0x53a91f){_0x45f571[_0x3940('0x14')](0x194);}return _0x53a91f;};}function handleError(_0x1a27bd,_0x1dc3bf){_0x1dc3bf=_0x1dc3bf||0x1f4;return function(_0x44f2e5){logger[_0x3940('0x21')](_0x44f2e5['stack']);if(_0x44f2e5['name']){delete _0x44f2e5[_0x3940('0x22')];}_0x1a27bd[_0x3940('0x15')](_0x1dc3bf)[_0x3940('0x23')](_0x44f2e5);};}exports[_0x3940('0x24')]=function(_0x5600bc,_0x2a638f){var _0x26eb13={},_0x2ac754={},_0x1a32aa={'count':0x0,'rows':[]};var _0x3f67e9=_[_0x3940('0x25')](db[_0x3940('0x26')]['rawAttributes'],function(_0x1bdb78){return{'name':_0x1bdb78[_0x3940('0x27')],'type':_0x1bdb78['type'][_0x3940('0x28')]};});_0x2ac754[_0x3940('0x29')]=_[_0x3940('0x25')](_0x3f67e9,_0x3940('0x22'));_0x2ac754[_0x3940('0x2a')]=_[_0x3940('0x2b')](_0x5600bc[_0x3940('0x2a')]);_0x2ac754['filters']=_['intersection'](_0x2ac754[_0x3940('0x29')],_0x2ac754[_0x3940('0x2a')]);_0x26eb13[_0x3940('0x2c')]=_[_0x3940('0x2d')](_0x2ac754[_0x3940('0x29')],qs['fields'](_0x5600bc[_0x3940('0x2a')]['fields']));_0x26eb13[_0x3940('0x2c')]=_0x26eb13[_0x3940('0x2c')][_0x3940('0x2e')]?_0x26eb13[_0x3940('0x2c')]:_0x2ac754['model'];if(!_0x5600bc[_0x3940('0x2a')]['hasOwnProperty'](_0x3940('0x2f'))){_0x26eb13[_0x3940('0x18')]=qs[_0x3940('0x18')](_0x5600bc[_0x3940('0x2a')][_0x3940('0x18')]);_0x26eb13['offset']=qs['offset'](_0x5600bc[_0x3940('0x2a')]['offset']);}_0x26eb13['order']=qs[_0x3940('0x30')](_0x5600bc[_0x3940('0x2a')][_0x3940('0x30')]);_0x26eb13[_0x3940('0x31')]=qs[_0x3940('0x32')](_[_0x3940('0x33')](_0x5600bc[_0x3940('0x2a')],_0x2ac754[_0x3940('0x32')]),_0x3f67e9);if(_0x5600bc['query'][_0x3940('0x34')]){_0x26eb13['where']=_[_0x3940('0x35')](_0x26eb13['where'],{'$or':_['map'](_0x3f67e9,function(_0x2ab0ba){if(_0x2ab0ba[_0x3940('0x36')]!==_0x3940('0x37')){var _0x7bfa8c={};_0x7bfa8c[_0x2ab0ba[_0x3940('0x22')]]={'$like':'%'+_0x5600bc[_0x3940('0x2a')][_0x3940('0x34')]+'%'};return _0x7bfa8c;}})});}_0x26eb13=_[_0x3940('0x35')]({},_0x26eb13,_0x5600bc[_0x3940('0x38')]);var _0x2d6fc0={'where':_0x26eb13['where']};return db['Dynamics365Field'][_0x3940('0x1a')](_0x2d6fc0)['then'](function(_0x46c53d){_0x1a32aa['count']=_0x46c53d;if(_0x5600bc[_0x3940('0x2a')][_0x3940('0x39')]){_0x26eb13['include']=[{'all':!![]}];}return db['Dynamics365Field'][_0x3940('0x3a')](_0x26eb13);})['then'](function(_0x5d02e0){_0x1a32aa[_0x3940('0x3b')]=_0x5d02e0;return _0x1a32aa;})[_0x3940('0x1f')](respondWithFilteredResult(_0x2a638f,_0x26eb13))['catch'](handleError(_0x2a638f,null));};exports[_0x3940('0x3c')]=function(_0x2dcd10,_0x13f5aa){var _0x1fe736={'raw':!![],'where':{'id':_0x2dcd10[_0x3940('0x3d')]['id']}},_0x467352={};_0x467352['model']=_[_0x3940('0x2b')](db['Dynamics365Field'][_0x3940('0x3e')]);_0x467352['query']=_[_0x3940('0x2b')](_0x2dcd10[_0x3940('0x2a')]);_0x467352[_0x3940('0x32')]=_[_0x3940('0x2d')](_0x467352[_0x3940('0x29')],_0x467352[_0x3940('0x2a')]);_0x1fe736['attributes']=_[_0x3940('0x2d')](_0x467352[_0x3940('0x29')],qs[_0x3940('0x3f')](_0x2dcd10[_0x3940('0x2a')][_0x3940('0x3f')]));_0x1fe736[_0x3940('0x2c')]=_0x1fe736['attributes'][_0x3940('0x2e')]?_0x1fe736[_0x3940('0x2c')]:_0x467352[_0x3940('0x29')];if(_0x2dcd10[_0x3940('0x2a')][_0x3940('0x39')]){_0x1fe736['include']=[{'all':!![]}];}_0x1fe736=_[_0x3940('0x35')]({},_0x1fe736,_0x2dcd10['options']);return db[_0x3940('0x26')][_0x3940('0x40')](_0x1fe736)['then'](handleEntityNotFound(_0x13f5aa,null))['then'](respondWithResult(_0x13f5aa,null))[_0x3940('0x41')](handleError(_0x13f5aa,null));};exports[_0x3940('0x42')]=function(_0x793c5c,_0x43f90a){return db[_0x3940('0x26')]['create'](_0x793c5c[_0x3940('0x43')],{})[_0x3940('0x1f')](respondWithResult(_0x43f90a,0xc9))[_0x3940('0x41')](handleError(_0x43f90a,null));};exports[_0x3940('0x1e')]=function(_0x4eeb83,_0xed4d0e){if(_0x4eeb83[_0x3940('0x43')]['id']){delete _0x4eeb83[_0x3940('0x43')]['id'];}return db[_0x3940('0x26')][_0x3940('0x40')]({'where':{'id':_0x4eeb83[_0x3940('0x3d')]['id']}})['then'](handleEntityNotFound(_0xed4d0e,null))[_0x3940('0x1f')](saveUpdates(_0x4eeb83[_0x3940('0x43')],null))[_0x3940('0x1f')](respondWithResult(_0xed4d0e,null))[_0x3940('0x41')](handleError(_0xed4d0e,null));};exports[_0x3940('0x20')]=function(_0x3cf92a,_0x15b220){return db[_0x3940('0x26')][_0x3940('0x40')]({'where':{'id':_0x3cf92a[_0x3940('0x3d')]['id']}})['then'](handleEntityNotFound(_0x15b220,null))['then'](removeEntity(_0x15b220,null))[_0x3940('0x41')](handleError(_0x15b220,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 1b0baa3..441ff7a 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 _0x44e2=['bluebird','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','lodash','util','../../config/logger','api'];(function(_0x132558,_0x521d93){var _0x34f138=function(_0x3e3541){while(--_0x3e3541){_0x132558['push'](_0x132558['shift']());}};_0x34f138(++_0x521d93);}(_0x44e2,0x1d0));var _0x244e=function(_0x2e2030,_0x47bc22){_0x2e2030=_0x2e2030-0x0;var _0x3bec4c=_0x44e2[_0x2e2030];return _0x3bec4c;};'use strict';var _=require(_0x244e('0x0'));var util=require(_0x244e('0x1'));var logger=require(_0x244e('0x2'))(_0x244e('0x3'));var moment=require('moment');var BPromise=require(_0x244e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x244e('0x5'));var config=require(_0x244e('0x6'));var attributes=require(_0x244e('0x7'));module[_0x244e('0x8')]=function(_0x2e55ea,_0x45b1a7){return _0x2e55ea[_0x244e('0x9')](_0x244e('0xa'),attributes,{'tableName':_0x244e('0xb'),'paranoid':![],'indexes':[{'name':_0x244e('0xc'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9805=['lodash','util','api','moment','bluebird','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField'];(function(_0x25bd53,_0xdcad5c){var _0x6b405a=function(_0x3b6b24){while(--_0x3b6b24){_0x25bd53['push'](_0x25bd53['shift']());}};_0x6b405a(++_0xdcad5c);}(_0x9805,0x126));var _0x5980=function(_0x720057,_0x2bfc55){_0x720057=_0x720057-0x0;var _0x35924b=_0x9805[_0x720057];return _0x35924b;};'use strict';var _=require(_0x5980('0x0'));var util=require(_0x5980('0x1'));var logger=require('../../config/logger')(_0x5980('0x2'));var moment=require(_0x5980('0x3'));var BPromise=require(_0x5980('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5980('0x5'));var config=require(_0x5980('0x6'));var attributes=require(_0x5980('0x7'));module[_0x5980('0x8')]=function(_0x9f774f,_0x5f3001){return _0x9f774f[_0x5980('0x9')](_0x5980('0xa'),attributes,{'tableName':_0x5980('0xb'),'paranoid':![],'indexes':[{'name':_0x5980('0xc'),'fields':[_0x5980('0xd'),'FieldId'],'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 d585015..445afaf 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 _0xdf74=['message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x2aecb2,_0x343312){var _0x3ebb80=function(_0x19fab3){while(--_0x19fab3){_0x2aecb2['push'](_0x2aecb2['shift']());}};_0x3ebb80(++_0x343312);}(_0xdf74,0xfa));var _0x4df7=function(_0x11f8d3,_0x5e36f6){_0x11f8d3=_0x11f8d3-0x0;var _0x2802da=_0xdf74[_0x11f8d3];return _0x2802da;};'use strict';var _=require(_0x4df7('0x0'));var util=require(_0x4df7('0x1'));var moment=require('moment');var BPromise=require(_0x4df7('0x2'));var rs=require(_0x4df7('0x3'));var fs=require('fs');var Redis=require(_0x4df7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4df7('0x5'));var logger=require(_0x4df7('0x6'))(_0x4df7('0x7'));var config=require(_0x4df7('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4df7('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e835c,_0x49aac2,_0xe23ab4){return new BPromise(function(_0x3808bc,_0x54c69d){return client[_0x4df7('0xa')](_0x1e835c,_0xe23ab4)[_0x4df7('0xb')](function(_0x533a16){logger['info'](_0x4df7('0xc'),_0x49aac2,_0x4df7('0xd'));logger[_0x4df7('0xe')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x49aac2,_0x4df7('0xd'),JSON['stringify'](_0x533a16));if(_0x533a16[_0x4df7('0xf')]){if(_0x533a16[_0x4df7('0xf')]['code']===0x1f4){logger['error'](_0x4df7('0xc'),_0x49aac2,_0x533a16[_0x4df7('0xf')]['message']);return _0x54c69d(_0x533a16[_0x4df7('0xf')]['message']);}logger[_0x4df7('0xf')](_0x4df7('0xc'),_0x49aac2,_0x533a16[_0x4df7('0xf')][_0x4df7('0x10')]);return _0x3808bc(_0x533a16['error'][_0x4df7('0x10')]);}else{logger['info'](_0x4df7('0xc'),_0x49aac2,'request\x20sent');_0x3808bc(_0x533a16[_0x4df7('0x11')][_0x4df7('0x10')]);}})[_0x4df7('0x12')](function(_0x3c7fc2){logger[_0x4df7('0xf')]('Dynamics365Field,\x20%s,\x20%s',_0x49aac2,_0x3c7fc2);_0x54c69d(_0x3c7fc2);});});} \ No newline at end of file +var _0x9a5c=['message','request\x20sent','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Field,\x20%s,\x20%s'];(function(_0x5aa244,_0x4ea0a3){var _0x4ec98e=function(_0x182a99){while(--_0x182a99){_0x5aa244['push'](_0x5aa244['shift']());}};_0x4ec98e(++_0x4ea0a3);}(_0x9a5c,0x17d));var _0xc9a5=function(_0x2184bd,_0xfc4324){_0x2184bd=_0x2184bd-0x0;var _0x4820d5=_0x9a5c[_0x2184bd];return _0x4820d5;};'use strict';var _=require(_0xc9a5('0x0'));var util=require(_0xc9a5('0x1'));var moment=require(_0xc9a5('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc9a5('0x3'));var db=require(_0xc9a5('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc9a5('0x5'))('rpc');var config=require(_0xc9a5('0x6'));var jayson=require(_0xc9a5('0x7'));var client=jayson['client'][_0xc9a5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x245096,_0x5edbfa,_0x41ea4c){return new BPromise(function(_0x2d6eeb,_0x78ebbd){return client[_0xc9a5('0x9')](_0x245096,_0x41ea4c)[_0xc9a5('0xa')](function(_0x366f56){logger[_0xc9a5('0xb')]('Dynamics365Field,\x20%s,\x20%s',_0x5edbfa,'request\x20sent');logger[_0xc9a5('0xc')](_0xc9a5('0xd'),_0x5edbfa,'request\x20sent',JSON[_0xc9a5('0xe')](_0x366f56));if(_0x366f56[_0xc9a5('0xf')]){if(_0x366f56[_0xc9a5('0xf')][_0xc9a5('0x10')]===0x1f4){logger[_0xc9a5('0xf')](_0xc9a5('0x11'),_0x5edbfa,_0x366f56['error'][_0xc9a5('0x12')]);return _0x78ebbd(_0x366f56[_0xc9a5('0xf')]['message']);}logger['error'](_0xc9a5('0x11'),_0x5edbfa,_0x366f56['error'][_0xc9a5('0x12')]);return _0x2d6eeb(_0x366f56[_0xc9a5('0xf')][_0xc9a5('0x12')]);}else{logger['info'](_0xc9a5('0x11'),_0x5edbfa,_0xc9a5('0x13'));_0x2d6eeb(_0x366f56['result'][_0xc9a5('0x12')]);}})[_0xc9a5('0x14')](function(_0x57b147){logger['error'](_0xc9a5('0x11'),_0x5edbfa,_0x57b147);_0x78ebbd(_0x57b147);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 94aa6bc..51ecc2e 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 _0xc2e8=['getFields','post','create','addConfiguration','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x112fe3,_0x16b642){var _0x1ec903=function(_0x1539eb){while(--_0x1539eb){_0x112fe3['push'](_0x112fe3['shift']());}};_0x1ec903(++_0x16b642);}(_0xc2e8,0x172));var _0x8c2e=function(_0x45c14a,_0x3c8cc3){_0x45c14a=_0x45c14a-0x0;var _0x3979c7=_0xc2e8[_0x45c14a];return _0x3979c7;};'use strict';var multer=require(_0x8c2e('0x0'));var util=require(_0x8c2e('0x1'));var path=require(_0x8c2e('0x2'));var timeout=require(_0x8c2e('0x3'));var express=require(_0x8c2e('0x4'));var router=express['Router']();var fs_extra=require(_0x8c2e('0x5'));var auth=require(_0x8c2e('0x6'));var interaction=require(_0x8c2e('0x7'));var config=require(_0x8c2e('0x8'));var controller=require('./intFreshdeskAccount.controller');router[_0x8c2e('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8c2e('0x9')]('/:id',auth[_0x8c2e('0xa')](),controller['show']);router[_0x8c2e('0x9')](_0x8c2e('0xb'),auth['isAuthenticated'](),controller[_0x8c2e('0xc')]);router[_0x8c2e('0x9')](_0x8c2e('0xd'),auth[_0x8c2e('0xa')](),controller[_0x8c2e('0xe')]);router[_0x8c2e('0xf')]('/',auth[_0x8c2e('0xa')](),controller[_0x8c2e('0x10')]);router['post'](_0x8c2e('0xb'),auth[_0x8c2e('0xa')](),controller[_0x8c2e('0x11')]);router[_0x8c2e('0x12')](_0x8c2e('0x13'),auth[_0x8c2e('0xa')](),controller[_0x8c2e('0x14')]);router[_0x8c2e('0x15')](_0x8c2e('0x13'),auth[_0x8c2e('0xa')](),controller[_0x8c2e('0x16')]);module[_0x8c2e('0x17')]=router; \ No newline at end of file +var _0xf2b3=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','update','multer'];(function(_0x20dcce,_0x29107b){var _0x42c86a=function(_0x35cfd8){while(--_0x35cfd8){_0x20dcce['push'](_0x20dcce['shift']());}};_0x42c86a(++_0x29107b);}(_0xf2b3,0x77));var _0x3f2b=function(_0xfef2c7,_0x6ede38){_0xfef2c7=_0xfef2c7-0x0;var _0x491bca=_0xf2b3[_0xfef2c7];return _0x491bca;};'use strict';var multer=require(_0x3f2b('0x0'));var util=require('util');var path=require(_0x3f2b('0x1'));var timeout=require(_0x3f2b('0x2'));var express=require(_0x3f2b('0x3'));var router=express[_0x3f2b('0x4')]();var fs_extra=require(_0x3f2b('0x5'));var auth=require(_0x3f2b('0x6'));var interaction=require(_0x3f2b('0x7'));var config=require(_0x3f2b('0x8'));var controller=require(_0x3f2b('0x9'));router[_0x3f2b('0xa')]('/',auth[_0x3f2b('0xb')](),controller[_0x3f2b('0xc')]);router['get'](_0x3f2b('0xd'),auth[_0x3f2b('0xb')](),controller[_0x3f2b('0xe')]);router[_0x3f2b('0xa')](_0x3f2b('0xf'),auth[_0x3f2b('0xb')](),controller[_0x3f2b('0x10')]);router['get'](_0x3f2b('0x11'),auth[_0x3f2b('0xb')](),controller[_0x3f2b('0x12')]);router['post']('/',auth[_0x3f2b('0xb')](),controller[_0x3f2b('0x13')]);router[_0x3f2b('0x14')]('/:id/configurations',auth[_0x3f2b('0xb')](),controller[_0x3f2b('0x15')]);router[_0x3f2b('0x16')](_0x3f2b('0xd'),auth['isAuthenticated'](),controller[_0x3f2b('0x17')]);router['delete'](_0x3f2b('0xd'),auth[_0x3f2b('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 97ce20b..295c950 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 _0x33af=['exports','STRING','username','remoteUri'];(function(_0x34ec86,_0x40c600){var _0xf1f056=function(_0x4fd7a7){while(--_0x4fd7a7){_0x34ec86['push'](_0x34ec86['shift']());}};_0xf1f056(++_0x40c600);}(_0x33af,0xec));var _0xf33a=function(_0x43606b,_0x2f2292){_0x43606b=_0x43606b-0x0;var _0xbfd21a=_0x33af[_0x43606b];return _0xbfd21a;};'use strict';var Sequelize=require('sequelize');module[_0xf33a('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf33a('0x1')]},'username':{'type':Sequelize[_0xf33a('0x1')],'unique':_0xf33a('0x2')},'apiKey':{'type':Sequelize[_0xf33a('0x1')]},'remoteUri':{'type':Sequelize[_0xf33a('0x1')],'unique':_0xf33a('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x2ef3=['remoteUri','sequelize','exports','STRING','username'];(function(_0x368c97,_0x5dda9a){var _0x140706=function(_0x217ce2){while(--_0x217ce2){_0x368c97['push'](_0x368c97['shift']());}};_0x140706(++_0x5dda9a);}(_0x2ef3,0xba));var _0x32ef=function(_0x50947a,_0x48caf7){_0x50947a=_0x50947a-0x0;var _0x2e314c=_0x2ef3[_0x50947a];return _0x2e314c;};'use strict';var Sequelize=require(_0x32ef('0x0'));module[_0x32ef('0x1')]={'name':{'type':Sequelize[_0x32ef('0x2')]},'description':{'type':Sequelize[_0x32ef('0x2')]},'username':{'type':Sequelize[_0x32ef('0x2')],'unique':_0x32ef('0x3')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x32ef('0x2')],'unique':_0x32ef('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 57d6136..35bcb39 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 _0x9b87=['toString','base64','requester','subject','agent','description','priority','group','source','ticket_type','company','includes','default','custom_text','custom_dropdown','label','choices','capitalize','statusCode','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','index','FreshdeskAccount','rawAttributes','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','getConfigurations','findOne','addConfiguration','AccountId','Subjects','channel','Descriptions','FreshdeskConfiguration','FreshdeskField','getFields','remoteUri','slice','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','apiKey'];(function(_0x372b25,_0x28586f){var _0x144245=function(_0x2b8095){while(--_0x2b8095){_0x372b25['push'](_0x372b25['shift']());}};_0x144245(++_0x28586f);}(_0x9b87,0x8e));var _0x79b8=function(_0x3a4c6d,_0x48584a){_0x3a4c6d=_0x3a4c6d-0x0;var _0x132ef4=_0x9b87[_0x3a4c6d];return _0x132ef4;};'use strict';var emlformat=require(_0x79b8('0x0'));var rimraf=require(_0x79b8('0x1'));var zipdir=require(_0x79b8('0x2'));var jsonpatch=require(_0x79b8('0x3'));var rp=require(_0x79b8('0x4'));var moment=require(_0x79b8('0x5'));var BPromise=require(_0x79b8('0x6'));var Mustache=require(_0x79b8('0x7'));var util=require(_0x79b8('0x8'));var path=require(_0x79b8('0x9'));var sox=require(_0x79b8('0xa'));var csv=require(_0x79b8('0xb'));var ejs=require(_0x79b8('0xc'));var fs=require('fs');var fs_extra=require(_0x79b8('0xd'));var _=require(_0x79b8('0xe'));var squel=require(_0x79b8('0xf'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x79b8('0x10'));var Papa=require(_0x79b8('0x11'));var Redis=require(_0x79b8('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x79b8('0x13'));var as=require(_0x79b8('0x14'));var hardwareService=require(_0x79b8('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x79b8('0x16'));var config=require(_0x79b8('0x17'));var licenseUtil=require(_0x79b8('0x18'));var db=require(_0x79b8('0x19'))['db'];var integrations=require(_0x79b8('0x1a'));function respondWithStatusCode(_0x33227b,_0x41095c){_0x41095c=_0x41095c||0xcc;return function(_0x41927b){if(_0x41927b){return _0x33227b[_0x79b8('0x1b')](_0x41095c);}return _0x33227b[_0x79b8('0x1c')](_0x41095c)[_0x79b8('0x1d')]();};}function respondWithResult(_0x59e229,_0x150fb7){_0x150fb7=_0x150fb7||0xc8;return function(_0x4d5cd7){if(_0x4d5cd7){return _0x59e229['status'](_0x150fb7)[_0x79b8('0x1e')](_0x4d5cd7);}};}function respondWithFilteredResult(_0x21aae0,_0x57a248){return function(_0x5ddab5){if(_0x5ddab5){var _0x3e3de3=typeof _0x57a248['offset']==='undefined'&&typeof _0x57a248[_0x79b8('0x1f')]===_0x79b8('0x20');var _0x9e0342=_0x5ddab5[_0x79b8('0x21')];var _0x383a34=_0x3e3de3?0x0:_0x57a248[_0x79b8('0x22')];var _0x597f3b=_0x3e3de3?_0x5ddab5[_0x79b8('0x21')]:_0x57a248['offset']+_0x57a248['limit'];var _0x9bcb94;if(_0x597f3b>=_0x9e0342){_0x597f3b=_0x9e0342;_0x9bcb94=0xc8;}else{_0x9bcb94=0xce;}_0x21aae0[_0x79b8('0x1c')](_0x9bcb94);return _0x21aae0[_0x79b8('0x23')](_0x79b8('0x24'),_0x383a34+'-'+_0x597f3b+'/'+_0x9e0342)[_0x79b8('0x1e')](_0x5ddab5);}return null;};}function patchUpdates(_0x1e7507){return function(_0x3611c3){try{jsonpatch[_0x79b8('0x25')](_0x3611c3,_0x1e7507,!![]);}catch(_0x2e1a65){return BPromise['reject'](_0x2e1a65);}return _0x3611c3[_0x79b8('0x26')]();};}function saveUpdates(_0x255207,_0x4dbfcf){return function(_0x2622ef){if(_0x2622ef){return _0x2622ef[_0x79b8('0x27')](_0x255207)['then'](function(_0x28be4b){return _0x28be4b;});}return null;};}function removeEntity(_0x4f543f,_0x5e8228){return function(_0x257ea5){if(_0x257ea5){return _0x257ea5[_0x79b8('0x28')]()[_0x79b8('0x29')](function(){_0x4f543f[_0x79b8('0x1c')](0xcc)[_0x79b8('0x1d')]();});}};}function handleEntityNotFound(_0x4cd38b,_0x35db24){return function(_0x338a7b){if(!_0x338a7b){_0x4cd38b[_0x79b8('0x1b')](0x194);}return _0x338a7b;};}function handleError(_0x3ba5ac,_0x4bbbf8){_0x4bbbf8=_0x4bbbf8||0x1f4;return function(_0x438130){logger[_0x79b8('0x2a')](_0x438130[_0x79b8('0x2b')]);if(_0x438130['name']){delete _0x438130[_0x79b8('0x2c')];}_0x3ba5ac[_0x79b8('0x1c')](_0x4bbbf8)[_0x79b8('0x2d')](_0x438130);};}exports[_0x79b8('0x2e')]=function(_0x3662aa,_0x23483f){var _0x4f51d1={},_0x434ecd={},_0x5a24fd={'count':0x0,'rows':[]};var _0x169597=_['map'](db[_0x79b8('0x2f')][_0x79b8('0x30')],function(_0x300755){return{'name':_0x300755['fieldName'],'type':_0x300755[_0x79b8('0x31')][_0x79b8('0x32')]};});_0x434ecd[_0x79b8('0x33')]=_[_0x79b8('0x34')](_0x169597,'name');_0x434ecd[_0x79b8('0x35')]=_['keys'](_0x3662aa['query']);_0x434ecd[_0x79b8('0x36')]=_[_0x79b8('0x37')](_0x434ecd['model'],_0x434ecd[_0x79b8('0x35')]);_0x4f51d1['attributes']=_['intersection'](_0x434ecd[_0x79b8('0x33')],qs['fields'](_0x3662aa[_0x79b8('0x35')][_0x79b8('0x38')]));_0x4f51d1['attributes']=_0x4f51d1[_0x79b8('0x39')][_0x79b8('0x3a')]?_0x4f51d1[_0x79b8('0x39')]:_0x434ecd[_0x79b8('0x33')];if(!_0x3662aa[_0x79b8('0x35')][_0x79b8('0x3b')]('nolimit')){_0x4f51d1[_0x79b8('0x1f')]=qs[_0x79b8('0x1f')](_0x3662aa[_0x79b8('0x35')][_0x79b8('0x1f')]);_0x4f51d1[_0x79b8('0x22')]=qs[_0x79b8('0x22')](_0x3662aa[_0x79b8('0x35')][_0x79b8('0x22')]);}_0x4f51d1[_0x79b8('0x3c')]=qs[_0x79b8('0x3d')](_0x3662aa[_0x79b8('0x35')]['sort']);_0x4f51d1[_0x79b8('0x3e')]=qs[_0x79b8('0x36')](_[_0x79b8('0x3f')](_0x3662aa['query'],_0x434ecd[_0x79b8('0x36')]),_0x169597);if(_0x3662aa[_0x79b8('0x35')][_0x79b8('0x40')]){_0x4f51d1[_0x79b8('0x3e')]=_[_0x79b8('0x41')](_0x4f51d1[_0x79b8('0x3e')],{'$or':_['map'](_0x169597,function(_0x13d065){if(_0x13d065['type']!=='VIRTUAL'){var _0x1eeb29={};_0x1eeb29[_0x13d065['name']]={'$like':'%'+_0x3662aa['query'][_0x79b8('0x40')]+'%'};return _0x1eeb29;}})});}_0x4f51d1=_[_0x79b8('0x41')]({},_0x4f51d1,_0x3662aa[_0x79b8('0x42')]);var _0x2f25dd={'where':_0x4f51d1[_0x79b8('0x3e')]};return db[_0x79b8('0x2f')][_0x79b8('0x21')](_0x2f25dd)[_0x79b8('0x29')](function(_0x1e5e80){_0x5a24fd[_0x79b8('0x21')]=_0x1e5e80;if(_0x3662aa[_0x79b8('0x35')][_0x79b8('0x43')]){_0x4f51d1[_0x79b8('0x44')]=[{'all':!![]}];}return db['FreshdeskAccount'][_0x79b8('0x45')](_0x4f51d1);})[_0x79b8('0x29')](function(_0x4da364){_0x5a24fd[_0x79b8('0x46')]=_0x4da364;return _0x5a24fd;})[_0x79b8('0x29')](respondWithFilteredResult(_0x23483f,_0x4f51d1))['catch'](handleError(_0x23483f,null));};exports[_0x79b8('0x47')]=function(_0x62a011,_0x2ddad8){var _0x28d4e4={'raw':![],'where':{'id':_0x62a011[_0x79b8('0x48')]['id']}},_0x2e7f32={};_0x2e7f32[_0x79b8('0x33')]=_[_0x79b8('0x49')](db[_0x79b8('0x2f')][_0x79b8('0x30')]);_0x2e7f32[_0x79b8('0x35')]=_[_0x79b8('0x49')](_0x62a011['query']);_0x2e7f32['filters']=_[_0x79b8('0x37')](_0x2e7f32[_0x79b8('0x33')],_0x2e7f32[_0x79b8('0x35')]);_0x28d4e4[_0x79b8('0x39')]=_['intersection'](_0x2e7f32[_0x79b8('0x33')],qs[_0x79b8('0x38')](_0x62a011[_0x79b8('0x35')][_0x79b8('0x38')]));_0x28d4e4['attributes']=_0x28d4e4[_0x79b8('0x39')][_0x79b8('0x3a')]?_0x28d4e4[_0x79b8('0x39')]:_0x2e7f32[_0x79b8('0x33')];if(_0x62a011['query'][_0x79b8('0x43')]){_0x28d4e4[_0x79b8('0x44')]=[{'all':!![]}];}_0x28d4e4=_[_0x79b8('0x41')]({},_0x28d4e4,_0x62a011[_0x79b8('0x42')]);return db[_0x79b8('0x2f')][_0x79b8('0x4a')](_0x28d4e4)['then'](handleEntityNotFound(_0x2ddad8,null))[_0x79b8('0x29')](respondWithResult(_0x2ddad8,null))[_0x79b8('0x4b')](handleError(_0x2ddad8,null));};exports[_0x79b8('0x4c')]=function(_0xc89e93,_0x478940){return db['FreshdeskAccount'][_0x79b8('0x4c')](_0xc89e93[_0x79b8('0x4d')],{})[_0x79b8('0x29')](respondWithResult(_0x478940,0xc9))[_0x79b8('0x4b')](handleError(_0x478940,null));};exports[_0x79b8('0x27')]=function(_0x19272d,_0x1d4e87){if(_0x19272d[_0x79b8('0x4d')]['id']){delete _0x19272d[_0x79b8('0x4d')]['id'];}return db['FreshdeskAccount'][_0x79b8('0x4a')]({'where':{'id':_0x19272d[_0x79b8('0x48')]['id']}})[_0x79b8('0x29')](handleEntityNotFound(_0x1d4e87,null))['then'](saveUpdates(_0x19272d[_0x79b8('0x4d')],null))['then'](respondWithResult(_0x1d4e87,null))['catch'](handleError(_0x1d4e87,null));};exports[_0x79b8('0x28')]=function(_0x252c2c,_0x5b4d56){return db[_0x79b8('0x2f')]['find']({'where':{'id':_0x252c2c['params']['id']}})[_0x79b8('0x29')](handleEntityNotFound(_0x5b4d56,null))[_0x79b8('0x29')](removeEntity(_0x5b4d56,null))[_0x79b8('0x4b')](handleError(_0x5b4d56,null));};exports[_0x79b8('0x4e')]=function(_0x2ff973,_0xcfb9c2,_0x3f3ffc){var _0x3d1078={};var _0x26d69e={};var _0x1571cf;var _0x2455c6;return db[_0x79b8('0x2f')][_0x79b8('0x4f')]({'where':{'id':_0x2ff973[_0x79b8('0x48')]['id']}})['then'](handleEntityNotFound(_0xcfb9c2,null))[_0x79b8('0x29')](function(_0x16f272){if(_0x16f272){_0x1571cf=_0x16f272;_0x26d69e[_0x79b8('0x33')]=_[_0x79b8('0x49')](db['FreshdeskConfiguration']['rawAttributes']);_0x26d69e[_0x79b8('0x35')]=_[_0x79b8('0x49')](_0x2ff973[_0x79b8('0x35')]);_0x26d69e[_0x79b8('0x36')]=_['intersection'](_0x26d69e[_0x79b8('0x33')],_0x26d69e[_0x79b8('0x35')]);_0x3d1078['attributes']=_[_0x79b8('0x37')](_0x26d69e[_0x79b8('0x33')],qs[_0x79b8('0x38')](_0x2ff973['query'][_0x79b8('0x38')]));_0x3d1078['attributes']=_0x3d1078[_0x79b8('0x39')][_0x79b8('0x3a')]?_0x3d1078[_0x79b8('0x39')]:_0x26d69e[_0x79b8('0x33')];_0x3d1078[_0x79b8('0x3c')]=qs[_0x79b8('0x3d')](_0x2ff973[_0x79b8('0x35')][_0x79b8('0x3d')]);_0x3d1078[_0x79b8('0x3e')]=qs[_0x79b8('0x36')](_['pick'](_0x2ff973[_0x79b8('0x35')],_0x26d69e['filters']));if(_0x2ff973[_0x79b8('0x35')]['filter']){_0x3d1078[_0x79b8('0x3e')]=_[_0x79b8('0x41')](_0x3d1078[_0x79b8('0x3e')],{'$or':_[_0x79b8('0x34')](_0x3d1078[_0x79b8('0x39')],function(_0x5885a3){var _0x1d5b81={};_0x1d5b81[_0x5885a3]={'$like':'%'+_0x2ff973['query'][_0x79b8('0x40')]+'%'};return _0x1d5b81;})});}_0x3d1078=_[_0x79b8('0x41')]({},_0x3d1078,_0x2ff973[_0x79b8('0x42')]);return _0x1571cf[_0x79b8('0x4e')](_0x3d1078);}})[_0x79b8('0x29')](function(_0x3b18f9){if(_0x3b18f9){_0x2455c6=_0x3b18f9['length'];if(!_0x2ff973[_0x79b8('0x35')][_0x79b8('0x3b')]('nolimit')){_0x3d1078[_0x79b8('0x1f')]=qs['limit'](_0x2ff973[_0x79b8('0x35')][_0x79b8('0x1f')]);_0x3d1078['offset']=qs[_0x79b8('0x22')](_0x2ff973[_0x79b8('0x35')]['offset']);}return _0x1571cf[_0x79b8('0x4e')](_0x3d1078);}})['then'](function(_0x2e11a6){if(_0x2e11a6){return _0x2e11a6?{'count':_0x2455c6,'rows':_0x2e11a6}:null;}})['then'](respondWithResult(_0xcfb9c2,null))[_0x79b8('0x4b')](handleError(_0xcfb9c2,null));};exports[_0x79b8('0x50')]=function(_0x41f243,_0x26722c,_0x17a707){if(_0x41f243[_0x79b8('0x4d')]['id']){delete _0x41f243['body']['id'];}return db[_0x79b8('0x2f')][_0x79b8('0x4f')]({'where':{'id':_0x41f243['params']['id']}})['then'](handleEntityNotFound(_0x26722c,null))[_0x79b8('0x29')](function(_0x40ddfc){if(_0x40ddfc){_0x41f243['body'][_0x79b8('0x51')]=_0x40ddfc['id'];_0x41f243[_0x79b8('0x4d')][_0x79b8('0x52')]=integrations['getSubjects'](_0x41f243[_0x79b8('0x4d')][_0x79b8('0x53')],_0x41f243[_0x79b8('0x4d')][_0x79b8('0x31')]);_0x41f243[_0x79b8('0x4d')][_0x79b8('0x54')]=integrations['getDescriptions'](_0x41f243[_0x79b8('0x4d')][_0x79b8('0x53')],_0x41f243[_0x79b8('0x4d')]['type']);return db[_0x79b8('0x55')][_0x79b8('0x4c')](_0x41f243[_0x79b8('0x4d')],{'include':[{'model':db['FreshdeskField'],'as':_0x79b8('0x52')},{'model':db[_0x79b8('0x56')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x26722c,null))[_0x79b8('0x4b')](handleError(_0x26722c,null));};exports[_0x79b8('0x57')]=function(_0x172532,_0x1cba9b,_0xd39bc0){var _0x1c6ff0='';return db[_0x79b8('0x2f')][_0x79b8('0x4f')]({'where':{'id':_0x172532['params']['id']},'attributes':['id',_0x79b8('0x58'),'apiKey']})['then'](handleEntityNotFound(_0x1cba9b,null))[_0x79b8('0x29')](function(_0x54e855){if(_0x54e855){_0x1c6ff0=_0x54e855[_0x79b8('0x58')];var _0x43b067=_0x1c6ff0[_0x79b8('0x59')](-0x1);if(_0x43b067==='/'){_0x1c6ff0=_0x1c6ff0['substring'](0x0,_0x1c6ff0[_0x79b8('0x5a')](_0x43b067));}return rp({'method':_0x79b8('0x5b'),'uri':util[_0x79b8('0x5c')](_0x79b8('0x5d'),_0x1c6ff0,_0x79b8('0x5e')),'headers':{'Authorization':util[_0x79b8('0x5c')](_0x79b8('0x5f'),new Buffer(util[_0x79b8('0x5c')](_0x79b8('0x60'),_0x54e855[_0x79b8('0x61')]))[_0x79b8('0x62')](_0x79b8('0x63')))},'json':!![]});}})['then'](function(_0x2b7dac){if(_0x2b7dac){var _0x2556ad=[_0x79b8('0x64'),_0x79b8('0x65'),_0x79b8('0x66'),_0x79b8('0x67'),_0x79b8('0x1c'),_0x79b8('0x68'),_0x79b8('0x69'),_0x79b8('0x6a'),_0x79b8('0x6b'),'group',_0x79b8('0x6c')];_['remove'](_0x2b7dac,function(_0x5b785b){return _0x2556ad[_0x79b8('0x6d')](_0x5b785b[_0x79b8('0x2c')])||!_0x5b785b[_0x79b8('0x6e')]&&_0x5b785b[_0x79b8('0x31')]!==_0x79b8('0x6f')&&_0x5b785b[_0x79b8('0x31')]!==_0x79b8('0x70');});return{'count':_0x2b7dac[_0x79b8('0x3a')],'rows':_['map'](_0x2b7dac,function(_0x589712){return{'id':_0x589712['name'],'name':_0x589712[_0x79b8('0x71')],'custom':!_0x589712[_0x79b8('0x6e')],'options':_0x589712[_0x79b8('0x72')]?_[_0x79b8('0x34')](_0x589712[_0x79b8('0x72')],function(_0x1fcd5e){return{'name':_[_0x79b8('0x73')](_0x1fcd5e),'value':_0x1fcd5e};}):[]};})};}})[_0x79b8('0x29')](respondWithResult(_0x1cba9b,null))[_0x79b8('0x4b')](function(_0x5c1ca){var _0x211358=_0x172532[_0x79b8('0x35')]['test']?0x1f4:_0x5c1ca[_0x79b8('0x74')]||0x1f4;logger[_0x79b8('0x2a')]('getFields,\x20%s,\x20%s,\x20%s',_0x79b8('0x57'),_0x211358,JSON[_0x79b8('0x75')](_0x5c1ca));delete _0x5c1ca[_0x79b8('0x2c')];if(_0x211358===0x191){_0x211358=0x190;}_0x1cba9b[_0x79b8('0x1c')](_0x211358)[_0x79b8('0x2d')](_0x172532[_0x79b8('0x35')][_0x79b8('0x76')]?{'message':_0x79b8('0x77'),'statusCode':_0x5c1ca['statusCode']}:_0x5c1ca);});}; \ No newline at end of file +var _0x2d58=['FreshdeskAccount','rawAttributes','fieldName','type','key','query','filters','model','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','params','keys','options','find','create','body','getConfigurations','hasOwnProperty','findOne','AccountId','Subjects','channel','Descriptions','FreshdeskConfiguration','FreshdeskField','getFields','remoteUri','slice','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','apiKey','toString','requester','agent','priority','group','source','company','remove','custom_text','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','destroy','then','error','stack','name','send','map'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x2d58,0x186));var _0x82d5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2d58[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x82d5('0x0'));var rimraf=require(_0x82d5('0x1'));var zipdir=require(_0x82d5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x82d5('0x3'));var moment=require('moment');var BPromise=require(_0x82d5('0x4'));var Mustache=require(_0x82d5('0x5'));var util=require(_0x82d5('0x6'));var path=require(_0x82d5('0x7'));var sox=require(_0x82d5('0x8'));var csv=require(_0x82d5('0x9'));var ejs=require(_0x82d5('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x82d5('0xb'));var squel=require(_0x82d5('0xc'));var crypto=require(_0x82d5('0xd'));var jsforce=require(_0x82d5('0xe'));var deskjs=require(_0x82d5('0xf'));var toCsv=require(_0x82d5('0x9'));var querystring=require(_0x82d5('0x10'));var Papa=require(_0x82d5('0x11'));var Redis=require(_0x82d5('0x12'));var authService=require(_0x82d5('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x82d5('0x14'));var hardwareService=require(_0x82d5('0x15'));var logger=require(_0x82d5('0x16'))(_0x82d5('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x82d5('0x18'));var db=require(_0x82d5('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x14ccdc,_0x5c2d84){_0x5c2d84=_0x5c2d84||0xcc;return function(_0x2a14c4){if(_0x2a14c4){return _0x14ccdc[_0x82d5('0x1a')](_0x5c2d84);}return _0x14ccdc[_0x82d5('0x1b')](_0x5c2d84)[_0x82d5('0x1c')]();};}function respondWithResult(_0x201e56,_0x3f26ff){_0x3f26ff=_0x3f26ff||0xc8;return function(_0xa1c73e){if(_0xa1c73e){return _0x201e56[_0x82d5('0x1b')](_0x3f26ff)['json'](_0xa1c73e);}};}function respondWithFilteredResult(_0x128c42,_0x26caa1){return function(_0x5b0b6e){if(_0x5b0b6e){var _0x6ad68c=typeof _0x26caa1[_0x82d5('0x1d')]===_0x82d5('0x1e')&&typeof _0x26caa1[_0x82d5('0x1f')]===_0x82d5('0x1e');var _0x57cb4b=_0x5b0b6e[_0x82d5('0x20')];var _0x269375=_0x6ad68c?0x0:_0x26caa1[_0x82d5('0x1d')];var _0x2c1b30=_0x6ad68c?_0x5b0b6e[_0x82d5('0x20')]:_0x26caa1[_0x82d5('0x1d')]+_0x26caa1[_0x82d5('0x1f')];var _0x53fef6;if(_0x2c1b30>=_0x57cb4b){_0x2c1b30=_0x57cb4b;_0x53fef6=0xc8;}else{_0x53fef6=0xce;}_0x128c42['status'](_0x53fef6);return _0x128c42[_0x82d5('0x21')](_0x82d5('0x22'),_0x269375+'-'+_0x2c1b30+'/'+_0x57cb4b)[_0x82d5('0x23')](_0x5b0b6e);}return null;};}function patchUpdates(_0x4712db){return function(_0x32be04){try{jsonpatch[_0x82d5('0x24')](_0x32be04,_0x4712db,!![]);}catch(_0x1679eb){return BPromise[_0x82d5('0x25')](_0x1679eb);}return _0x32be04['save']();};}function saveUpdates(_0x423fe1,_0x2d22ab){return function(_0x7cf20){if(_0x7cf20){return _0x7cf20[_0x82d5('0x26')](_0x423fe1)['then'](function(_0x942fc){return _0x942fc;});}return null;};}function removeEntity(_0x59605b,_0x47736d){return function(_0x3bff15){if(_0x3bff15){return _0x3bff15[_0x82d5('0x27')]()[_0x82d5('0x28')](function(){_0x59605b[_0x82d5('0x1b')](0xcc)[_0x82d5('0x1c')]();});}};}function handleEntityNotFound(_0x485639,_0x18339a){return function(_0x47d93c){if(!_0x47d93c){_0x485639['sendStatus'](0x194);}return _0x47d93c;};}function handleError(_0x22b3cb,_0x5b659c){_0x5b659c=_0x5b659c||0x1f4;return function(_0x630b31){logger[_0x82d5('0x29')](_0x630b31[_0x82d5('0x2a')]);if(_0x630b31['name']){delete _0x630b31[_0x82d5('0x2b')];}_0x22b3cb[_0x82d5('0x1b')](_0x5b659c)[_0x82d5('0x2c')](_0x630b31);};}exports['index']=function(_0x35839b,_0x5227e0){var _0x2c9105={},_0x269619={},_0x22269a={'count':0x0,'rows':[]};var _0x5cf951=_[_0x82d5('0x2d')](db[_0x82d5('0x2e')][_0x82d5('0x2f')],function(_0x375c26){return{'name':_0x375c26[_0x82d5('0x30')],'type':_0x375c26[_0x82d5('0x31')][_0x82d5('0x32')]};});_0x269619['model']=_[_0x82d5('0x2d')](_0x5cf951,_0x82d5('0x2b'));_0x269619[_0x82d5('0x33')]=_['keys'](_0x35839b[_0x82d5('0x33')]);_0x269619[_0x82d5('0x34')]=_['intersection'](_0x269619[_0x82d5('0x35')],_0x269619[_0x82d5('0x33')]);_0x2c9105[_0x82d5('0x36')]=_[_0x82d5('0x37')](_0x269619['model'],qs[_0x82d5('0x38')](_0x35839b[_0x82d5('0x33')][_0x82d5('0x38')]));_0x2c9105[_0x82d5('0x36')]=_0x2c9105[_0x82d5('0x36')][_0x82d5('0x39')]?_0x2c9105[_0x82d5('0x36')]:_0x269619[_0x82d5('0x35')];if(!_0x35839b['query']['hasOwnProperty'](_0x82d5('0x3a'))){_0x2c9105[_0x82d5('0x1f')]=qs[_0x82d5('0x1f')](_0x35839b[_0x82d5('0x33')][_0x82d5('0x1f')]);_0x2c9105[_0x82d5('0x1d')]=qs[_0x82d5('0x1d')](_0x35839b[_0x82d5('0x33')][_0x82d5('0x1d')]);}_0x2c9105[_0x82d5('0x3b')]=qs[_0x82d5('0x3c')](_0x35839b[_0x82d5('0x33')][_0x82d5('0x3c')]);_0x2c9105[_0x82d5('0x3d')]=qs['filters'](_[_0x82d5('0x3e')](_0x35839b[_0x82d5('0x33')],_0x269619[_0x82d5('0x34')]),_0x5cf951);if(_0x35839b[_0x82d5('0x33')][_0x82d5('0x3f')]){_0x2c9105['where']=_[_0x82d5('0x40')](_0x2c9105[_0x82d5('0x3d')],{'$or':_[_0x82d5('0x2d')](_0x5cf951,function(_0x56cd6e){if(_0x56cd6e[_0x82d5('0x31')]!==_0x82d5('0x41')){var _0x40a46c={};_0x40a46c[_0x56cd6e[_0x82d5('0x2b')]]={'$like':'%'+_0x35839b[_0x82d5('0x33')][_0x82d5('0x3f')]+'%'};return _0x40a46c;}})});}_0x2c9105=_['merge']({},_0x2c9105,_0x35839b['options']);var _0x124c50={'where':_0x2c9105['where']};return db[_0x82d5('0x2e')][_0x82d5('0x20')](_0x124c50)['then'](function(_0x1b21fe){_0x22269a[_0x82d5('0x20')]=_0x1b21fe;if(_0x35839b['query'][_0x82d5('0x42')]){_0x2c9105[_0x82d5('0x43')]=[{'all':!![]}];}return db[_0x82d5('0x2e')][_0x82d5('0x44')](_0x2c9105);})['then'](function(_0x5c82cc){_0x22269a['rows']=_0x5c82cc;return _0x22269a;})[_0x82d5('0x28')](respondWithFilteredResult(_0x5227e0,_0x2c9105))[_0x82d5('0x45')](handleError(_0x5227e0,null));};exports['show']=function(_0x5315af,_0x4e1350){var _0x17113a={'raw':![],'where':{'id':_0x5315af[_0x82d5('0x46')]['id']}},_0x1253b6={};_0x1253b6[_0x82d5('0x35')]=_['keys'](db['FreshdeskAccount'][_0x82d5('0x2f')]);_0x1253b6['query']=_[_0x82d5('0x47')](_0x5315af[_0x82d5('0x33')]);_0x1253b6[_0x82d5('0x34')]=_['intersection'](_0x1253b6[_0x82d5('0x35')],_0x1253b6[_0x82d5('0x33')]);_0x17113a[_0x82d5('0x36')]=_[_0x82d5('0x37')](_0x1253b6[_0x82d5('0x35')],qs[_0x82d5('0x38')](_0x5315af[_0x82d5('0x33')]['fields']));_0x17113a[_0x82d5('0x36')]=_0x17113a['attributes'][_0x82d5('0x39')]?_0x17113a[_0x82d5('0x36')]:_0x1253b6['model'];if(_0x5315af[_0x82d5('0x33')][_0x82d5('0x42')]){_0x17113a[_0x82d5('0x43')]=[{'all':!![]}];}_0x17113a=_[_0x82d5('0x40')]({},_0x17113a,_0x5315af[_0x82d5('0x48')]);return db[_0x82d5('0x2e')][_0x82d5('0x49')](_0x17113a)['then'](handleEntityNotFound(_0x4e1350,null))['then'](respondWithResult(_0x4e1350,null))['catch'](handleError(_0x4e1350,null));};exports[_0x82d5('0x4a')]=function(_0x2778a6,_0x4f4656){return db[_0x82d5('0x2e')][_0x82d5('0x4a')](_0x2778a6['body'],{})['then'](respondWithResult(_0x4f4656,0xc9))[_0x82d5('0x45')](handleError(_0x4f4656,null));};exports[_0x82d5('0x26')]=function(_0x4db992,_0xaf6d1c){if(_0x4db992[_0x82d5('0x4b')]['id']){delete _0x4db992[_0x82d5('0x4b')]['id'];}return db[_0x82d5('0x2e')][_0x82d5('0x49')]({'where':{'id':_0x4db992['params']['id']}})[_0x82d5('0x28')](handleEntityNotFound(_0xaf6d1c,null))[_0x82d5('0x28')](saveUpdates(_0x4db992[_0x82d5('0x4b')],null))['then'](respondWithResult(_0xaf6d1c,null))[_0x82d5('0x45')](handleError(_0xaf6d1c,null));};exports[_0x82d5('0x27')]=function(_0x51e9aa,_0x472e65){return db[_0x82d5('0x2e')][_0x82d5('0x49')]({'where':{'id':_0x51e9aa[_0x82d5('0x46')]['id']}})[_0x82d5('0x28')](handleEntityNotFound(_0x472e65,null))[_0x82d5('0x28')](removeEntity(_0x472e65,null))[_0x82d5('0x45')](handleError(_0x472e65,null));};exports['getConfigurations']=function(_0xceadea,_0x51ae74,_0x4d2729){var _0x387a63={};var _0x3b57d6={};var _0x738ab8;var _0x51299f;return db[_0x82d5('0x2e')]['findOne']({'where':{'id':_0xceadea[_0x82d5('0x46')]['id']}})[_0x82d5('0x28')](handleEntityNotFound(_0x51ae74,null))[_0x82d5('0x28')](function(_0x3318bd){if(_0x3318bd){_0x738ab8=_0x3318bd;_0x3b57d6['model']=_[_0x82d5('0x47')](db['FreshdeskConfiguration'][_0x82d5('0x2f')]);_0x3b57d6[_0x82d5('0x33')]=_[_0x82d5('0x47')](_0xceadea['query']);_0x3b57d6[_0x82d5('0x34')]=_[_0x82d5('0x37')](_0x3b57d6[_0x82d5('0x35')],_0x3b57d6['query']);_0x387a63['attributes']=_['intersection'](_0x3b57d6[_0x82d5('0x35')],qs[_0x82d5('0x38')](_0xceadea[_0x82d5('0x33')][_0x82d5('0x38')]));_0x387a63[_0x82d5('0x36')]=_0x387a63[_0x82d5('0x36')][_0x82d5('0x39')]?_0x387a63[_0x82d5('0x36')]:_0x3b57d6['model'];_0x387a63[_0x82d5('0x3b')]=qs[_0x82d5('0x3c')](_0xceadea[_0x82d5('0x33')][_0x82d5('0x3c')]);_0x387a63[_0x82d5('0x3d')]=qs[_0x82d5('0x34')](_[_0x82d5('0x3e')](_0xceadea[_0x82d5('0x33')],_0x3b57d6[_0x82d5('0x34')]));if(_0xceadea[_0x82d5('0x33')][_0x82d5('0x3f')]){_0x387a63['where']=_[_0x82d5('0x40')](_0x387a63[_0x82d5('0x3d')],{'$or':_[_0x82d5('0x2d')](_0x387a63[_0x82d5('0x36')],function(_0x5b5fe0){var _0x311ceb={};_0x311ceb[_0x5b5fe0]={'$like':'%'+_0xceadea['query']['filter']+'%'};return _0x311ceb;})});}_0x387a63=_['merge']({},_0x387a63,_0xceadea[_0x82d5('0x48')]);return _0x738ab8[_0x82d5('0x4c')](_0x387a63);}})[_0x82d5('0x28')](function(_0x5daddf){if(_0x5daddf){_0x51299f=_0x5daddf[_0x82d5('0x39')];if(!_0xceadea['query'][_0x82d5('0x4d')]('nolimit')){_0x387a63[_0x82d5('0x1f')]=qs[_0x82d5('0x1f')](_0xceadea[_0x82d5('0x33')]['limit']);_0x387a63['offset']=qs[_0x82d5('0x1d')](_0xceadea[_0x82d5('0x33')]['offset']);}return _0x738ab8['getConfigurations'](_0x387a63);}})[_0x82d5('0x28')](function(_0x440629){if(_0x440629){return _0x440629?{'count':_0x51299f,'rows':_0x440629}:null;}})[_0x82d5('0x28')](respondWithResult(_0x51ae74,null))['catch'](handleError(_0x51ae74,null));};exports['addConfiguration']=function(_0x5c9556,_0x1823e8,_0x2ea849){if(_0x5c9556[_0x82d5('0x4b')]['id']){delete _0x5c9556[_0x82d5('0x4b')]['id'];}return db[_0x82d5('0x2e')][_0x82d5('0x4e')]({'where':{'id':_0x5c9556['params']['id']}})[_0x82d5('0x28')](handleEntityNotFound(_0x1823e8,null))[_0x82d5('0x28')](function(_0x25c243){if(_0x25c243){_0x5c9556[_0x82d5('0x4b')][_0x82d5('0x4f')]=_0x25c243['id'];_0x5c9556[_0x82d5('0x4b')][_0x82d5('0x50')]=integrations['getSubjects'](_0x5c9556[_0x82d5('0x4b')][_0x82d5('0x51')],_0x5c9556['body'][_0x82d5('0x31')]);_0x5c9556[_0x82d5('0x4b')][_0x82d5('0x52')]=integrations['getDescriptions'](_0x5c9556[_0x82d5('0x4b')][_0x82d5('0x51')],_0x5c9556[_0x82d5('0x4b')]['type']);return db[_0x82d5('0x53')]['create'](_0x5c9556[_0x82d5('0x4b')],{'include':[{'model':db[_0x82d5('0x54')],'as':_0x82d5('0x50')},{'model':db[_0x82d5('0x54')],'as':'Descriptions'}]});}return null;})[_0x82d5('0x28')](respondWithResult(_0x1823e8,null))['catch'](handleError(_0x1823e8,null));};exports[_0x82d5('0x55')]=function(_0x28ba24,_0x1a6411,_0x32129e){var _0x1f6156='';return db[_0x82d5('0x2e')][_0x82d5('0x4e')]({'where':{'id':_0x28ba24[_0x82d5('0x46')]['id']},'attributes':['id','remoteUri','apiKey']})['then'](handleEntityNotFound(_0x1a6411,null))[_0x82d5('0x28')](function(_0x5f3c64){if(_0x5f3c64){_0x1f6156=_0x5f3c64[_0x82d5('0x56')];var _0x52ecef=_0x1f6156[_0x82d5('0x57')](-0x1);if(_0x52ecef==='/'){_0x1f6156=_0x1f6156['substring'](0x0,_0x1f6156[_0x82d5('0x58')](_0x52ecef));}return rp({'method':_0x82d5('0x59'),'uri':util[_0x82d5('0x5a')](_0x82d5('0x5b'),_0x1f6156,_0x82d5('0x5c')),'headers':{'Authorization':util[_0x82d5('0x5a')]('Basic\x20%s',new Buffer(util[_0x82d5('0x5a')]('%s:X',_0x5f3c64[_0x82d5('0x5d')]))[_0x82d5('0x5e')]('base64'))},'json':!![]});}})[_0x82d5('0x28')](function(_0x4a0d9c){if(_0x4a0d9c){var _0x1ac38a=[_0x82d5('0x5f'),'subject',_0x82d5('0x60'),'description',_0x82d5('0x1b'),_0x82d5('0x61'),_0x82d5('0x62'),_0x82d5('0x63'),'ticket_type',_0x82d5('0x62'),_0x82d5('0x64')];_[_0x82d5('0x65')](_0x4a0d9c,function(_0x343b44){return _0x1ac38a['includes'](_0x343b44[_0x82d5('0x2b')])||!_0x343b44['default']&&_0x343b44[_0x82d5('0x31')]!==_0x82d5('0x66')&&_0x343b44[_0x82d5('0x31')]!=='custom_dropdown';});return{'count':_0x4a0d9c['length'],'rows':_[_0x82d5('0x2d')](_0x4a0d9c,function(_0x2a7ae0){return{'id':_0x2a7ae0[_0x82d5('0x2b')],'name':_0x2a7ae0[_0x82d5('0x67')],'custom':!_0x2a7ae0['default'],'options':_0x2a7ae0['choices']?_['map'](_0x2a7ae0['choices'],function(_0x2f5283){return{'name':_['capitalize'](_0x2f5283),'value':_0x2f5283};}):[]};})};}})[_0x82d5('0x28')](respondWithResult(_0x1a6411,null))[_0x82d5('0x45')](function(_0x410367){var _0x2844b5=_0x28ba24[_0x82d5('0x33')][_0x82d5('0x68')]?0x1f4:_0x410367[_0x82d5('0x69')]||0x1f4;logger['error'](_0x82d5('0x6a'),_0x82d5('0x55'),_0x2844b5,JSON[_0x82d5('0x6b')](_0x410367));delete _0x410367[_0x82d5('0x2b')];if(_0x2844b5===0x191){_0x2844b5=0x190;}_0x1a6411[_0x82d5('0x1b')](_0x2844b5)[_0x82d5('0x2c')](_0x28ba24[_0x82d5('0x33')][_0x82d5('0x68')]?{'message':_0x82d5('0x6c'),'statusCode':_0x410367[_0x82d5('0x69')]}:_0x410367);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index fd1ff49..50792ff 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 _0x0aa1=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','FreshdeskAccount','int_freshdesk_accounts','lodash','util'];(function(_0xf3a982,_0x339016){var _0x33aa66=function(_0x1f1ebf){while(--_0x1f1ebf){_0xf3a982['push'](_0xf3a982['shift']());}};_0x33aa66(++_0x339016);}(_0x0aa1,0x1e8));var _0x10aa=function(_0x2ce812,_0x5b974c){_0x2ce812=_0x2ce812-0x0;var _0x2db5e0=_0x0aa1[_0x2ce812];return _0x2db5e0;};'use strict';var _=require(_0x10aa('0x0'));var util=require(_0x10aa('0x1'));var logger=require(_0x10aa('0x2'))(_0x10aa('0x3'));var moment=require(_0x10aa('0x4'));var BPromise=require(_0x10aa('0x5'));var rp=require(_0x10aa('0x6'));var fs=require('fs');var path=require(_0x10aa('0x7'));var rimraf=require(_0x10aa('0x8'));var config=require('../../config/environment');var attributes=require(_0x10aa('0x9'));var integrations=require(_0x10aa('0xa'));module[_0x10aa('0xb')]=function(_0x5ecbf7,_0x4a913e){return _0x5ecbf7['define'](_0x10aa('0xc'),attributes,{'tableName':_0x10aa('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6d45=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','int_freshdesk_accounts','lodash','util'];(function(_0x2dec23,_0x4b5dd8){var _0x12ccee=function(_0xdd05e4){while(--_0xdd05e4){_0x2dec23['push'](_0x2dec23['shift']());}};_0x12ccee(++_0x4b5dd8);}(_0x6d45,0x1f2));var _0x56d4=function(_0x35cb56,_0x52686c){_0x35cb56=_0x35cb56-0x0;var _0x4c9fb7=_0x6d45[_0x35cb56];return _0x4c9fb7;};'use strict';var _=require(_0x56d4('0x0'));var util=require(_0x56d4('0x1'));var logger=require('../../config/logger')(_0x56d4('0x2'));var moment=require(_0x56d4('0x3'));var BPromise=require(_0x56d4('0x4'));var rp=require(_0x56d4('0x5'));var fs=require('fs');var path=require(_0x56d4('0x6'));var rimraf=require(_0x56d4('0x7'));var config=require(_0x56d4('0x8'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x4a9c19,_0x41e60d){return _0x4a9c19['define']('FreshdeskAccount',attributes,{'tableName':_0x56d4('0x9'),'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 7f5a682..f18a83e 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 _0xa794=['request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','FreshdeskAccount','options','raw','where','attributes','limit','include','model','map','then','info','GetFreshdeskAccount','ShowFreshdeskAccount','find','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','FreshdeskAccount,\x20%s,\x20%s'];(function(_0x322fe4,_0x4f706f){var _0x12dd45=function(_0x3139dc){while(--_0x3139dc){_0x322fe4['push'](_0x322fe4['shift']());}};_0x12dd45(++_0x4f706f);}(_0xa794,0x79));var _0x4a79=function(_0x3ae99f,_0x5f5a2){_0x3ae99f=_0x3ae99f-0x0;var _0x4fba4c=_0xa794[_0x3ae99f];return _0x4fba4c;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x4a79('0x0'));var rs=require(_0x4a79('0x1'));var fs=require('fs');var Redis=require(_0x4a79('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x4a79('0x3'));var logger=require(_0x4a79('0x4'))(_0x4a79('0x5'));var config=require(_0x4a79('0x6'));var jayson=require(_0x4a79('0x7'));var client=jayson['client'][_0x4a79('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3aec8f,_0xe74f00,_0x3b8827){return new BPromise(function(_0x4624a0,_0x5a4518){return client[_0x4a79('0x9')](_0x3aec8f,_0x3b8827)['then'](function(_0x5a7522){logger['info'](_0x4a79('0xa'),_0xe74f00,_0x4a79('0xb'));logger[_0x4a79('0xc')](_0x4a79('0xd'),_0xe74f00,'request\x20sent',JSON['stringify'](_0x5a7522));if(_0x5a7522['error']){if(_0x5a7522['error'][_0x4a79('0xe')]===0x1f4){logger[_0x4a79('0xf')](_0x4a79('0xa'),_0xe74f00,_0x5a7522[_0x4a79('0xf')]['message']);return _0x5a4518(_0x5a7522[_0x4a79('0xf')][_0x4a79('0x10')]);}logger[_0x4a79('0xf')](_0x4a79('0xa'),_0xe74f00,_0x5a7522['error'][_0x4a79('0x10')]);return _0x4624a0(_0x5a7522['error'][_0x4a79('0x10')]);}else{logger['info'](_0x4a79('0xa'),_0xe74f00,_0x4a79('0xb'));_0x4624a0(_0x5a7522[_0x4a79('0x11')][_0x4a79('0x10')]);}})[_0x4a79('0x12')](function(_0x2828eb){logger['error'](_0x4a79('0xa'),_0xe74f00,_0x2828eb);_0x5a4518(_0x2828eb);});});}exports['GetFreshdeskAccount']=function(_0x3c6e7e){var _0x2c9fa1=this;return new Promise(function(_0xcebe72,_0xa2ee99){return db[_0x4a79('0x13')]['findAll']({'raw':_0x3c6e7e['options']?_0x3c6e7e[_0x4a79('0x14')][_0x4a79('0x15')]===undefined?!![]:![]:!![],'where':_0x3c6e7e[_0x4a79('0x14')]?_0x3c6e7e['options'][_0x4a79('0x16')]||null:null,'attributes':_0x3c6e7e[_0x4a79('0x14')]?_0x3c6e7e[_0x4a79('0x14')][_0x4a79('0x17')]||null:null,'limit':_0x3c6e7e[_0x4a79('0x14')]?_0x3c6e7e[_0x4a79('0x14')][_0x4a79('0x18')]||null:null,'include':_0x3c6e7e[_0x4a79('0x14')]?_0x3c6e7e[_0x4a79('0x14')][_0x4a79('0x19')]?_['map'](_0x3c6e7e[_0x4a79('0x14')][_0x4a79('0x19')],function(_0x472ff4){return{'model':db[_0x472ff4[_0x4a79('0x1a')]],'as':_0x472ff4['as'],'attributes':_0x472ff4['attributes'],'include':_0x472ff4[_0x4a79('0x19')]?_['map'](_0x472ff4[_0x4a79('0x19')],function(_0x4fa38a){return{'model':db[_0x4fa38a['model']],'as':_0x4fa38a['as'],'attributes':_0x4fa38a[_0x4a79('0x17')],'include':_0x4fa38a[_0x4a79('0x19')]?_[_0x4a79('0x1b')](_0x4fa38a[_0x4a79('0x19')],function(_0x5c66f8){return{'model':db[_0x5c66f8[_0x4a79('0x1a')]],'as':_0x5c66f8['as'],'attributes':_0x5c66f8[_0x4a79('0x17')]};}):[]};}):[]};}):[]:[]})[_0x4a79('0x1c')](function(_0x2c2087){logger[_0x4a79('0x1d')](_0x4a79('0x1e'),_0x3c6e7e);logger[_0x4a79('0xc')](_0x4a79('0x1e'),_0x3c6e7e,JSON['stringify'](_0x2c2087));_0xcebe72(_0x2c2087);})[_0x4a79('0x12')](function(_0x5a607f){logger[_0x4a79('0xf')](_0x4a79('0x1e'),_0x5a607f[_0x4a79('0x10')],_0x3c6e7e);_0xa2ee99(_0x2c9fa1[_0x4a79('0xf')](0x1f4,_0x5a607f['message']));});});};exports[_0x4a79('0x1f')]=function(_0x4aa843){var _0x38e66b=this;return new Promise(function(_0x2e4f8b,_0x362a01){return db[_0x4a79('0x13')][_0x4a79('0x20')]({'raw':_0x4aa843[_0x4a79('0x14')]?_0x4aa843[_0x4a79('0x14')][_0x4a79('0x15')]===undefined?!![]:![]:!![],'where':_0x4aa843[_0x4a79('0x14')]?_0x4aa843[_0x4a79('0x14')][_0x4a79('0x16')]||null:null,'attributes':_0x4aa843[_0x4a79('0x14')]?_0x4aa843[_0x4a79('0x14')]['attributes']||null:null,'include':_0x4aa843['options']?_0x4aa843[_0x4a79('0x14')][_0x4a79('0x19')]?_[_0x4a79('0x1b')](_0x4aa843['options']['include'],function(_0x5db046){return{'model':db[_0x5db046[_0x4a79('0x1a')]],'as':_0x5db046['as'],'attributes':_0x5db046[_0x4a79('0x17')],'include':_0x5db046[_0x4a79('0x19')]?_[_0x4a79('0x1b')](_0x5db046[_0x4a79('0x19')],function(_0x3e61b7){return{'model':db[_0x3e61b7['model']],'as':_0x3e61b7['as'],'attributes':_0x3e61b7[_0x4a79('0x17')],'include':_0x3e61b7[_0x4a79('0x19')]?_['map'](_0x3e61b7['include'],function(_0x279bbf){return{'model':db[_0x279bbf['model']],'as':_0x279bbf['as'],'attributes':_0x279bbf[_0x4a79('0x17')]};}):[]};}):[]};}):[]:[]})[_0x4a79('0x1c')](function(_0x2144e5){logger['info'](_0x4a79('0x1f'),_0x4aa843);logger[_0x4a79('0xc')](_0x4a79('0x1f'),_0x4aa843,JSON['stringify'](_0x2144e5));_0x2e4f8b(_0x2144e5);})[_0x4a79('0x12')](function(_0x5c2be3){logger[_0x4a79('0xf')](_0x4a79('0x1f'),_0x5c2be3['message'],_0x4aa843);_0x362a01(_0x38e66b[_0x4a79('0xf')](0x1f4,_0x5c2be3[_0x4a79('0x10')]));});});}; \ No newline at end of file +var _0xb932=['then','info','request\x20sent','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','FreshdeskAccount,\x20%s,\x20%s','FreshdeskAccount','findAll','raw','options','where','attributes','map','include','model','GetFreshdeskAccount','debug','catch','ShowFreshdeskAccount','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2373c6,_0x4218c9){var _0xf2aaa9=function(_0x26eb3b){while(--_0x26eb3b){_0x2373c6['push'](_0x2373c6['shift']());}};_0xf2aaa9(++_0x4218c9);}(_0xb932,0xd5));var _0x2b93=function(_0x20bcb0,_0xb5cbdd){_0x20bcb0=_0x20bcb0-0x0;var _0xdc4f5b=_0xb932[_0x20bcb0];return _0xdc4f5b;};'use strict';var _=require(_0x2b93('0x0'));var util=require(_0x2b93('0x1'));var moment=require('moment');var BPromise=require(_0x2b93('0x2'));var rs=require(_0x2b93('0x3'));var fs=require('fs');var Redis=require(_0x2b93('0x4'));var db=require(_0x2b93('0x5'))['db'];var utils=require(_0x2b93('0x6'));var logger=require(_0x2b93('0x7'))(_0x2b93('0x8'));var config=require(_0x2b93('0x9'));var jayson=require(_0x2b93('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x415f20,_0x46d72e,_0x26b3eb){return new BPromise(function(_0x4a3674,_0x115e1b){return client['request'](_0x415f20,_0x26b3eb)[_0x2b93('0xb')](function(_0x44a2a0){logger[_0x2b93('0xc')]('FreshdeskAccount,\x20%s,\x20%s',_0x46d72e,_0x2b93('0xd'));logger['debug'](_0x2b93('0xe'),_0x46d72e,_0x2b93('0xd'),JSON[_0x2b93('0xf')](_0x44a2a0));if(_0x44a2a0[_0x2b93('0x10')]){if(_0x44a2a0['error']['code']===0x1f4){logger[_0x2b93('0x10')]('FreshdeskAccount,\x20%s,\x20%s',_0x46d72e,_0x44a2a0[_0x2b93('0x10')]['message']);return _0x115e1b(_0x44a2a0['error'][_0x2b93('0x11')]);}logger[_0x2b93('0x10')]('FreshdeskAccount,\x20%s,\x20%s',_0x46d72e,_0x44a2a0[_0x2b93('0x10')]['message']);return _0x4a3674(_0x44a2a0[_0x2b93('0x10')][_0x2b93('0x11')]);}else{logger[_0x2b93('0xc')](_0x2b93('0x12'),_0x46d72e,_0x2b93('0xd'));_0x4a3674(_0x44a2a0['result'][_0x2b93('0x11')]);}})['catch'](function(_0x185114){logger[_0x2b93('0x10')](_0x2b93('0x12'),_0x46d72e,_0x185114);_0x115e1b(_0x185114);});});}exports['GetFreshdeskAccount']=function(_0x52de46){var _0x304261=this;return new Promise(function(_0x314b00,_0x44e8f2){return db[_0x2b93('0x13')][_0x2b93('0x14')]({'raw':_0x52de46['options']?_0x52de46['options'][_0x2b93('0x15')]===undefined?!![]:![]:!![],'where':_0x52de46[_0x2b93('0x16')]?_0x52de46[_0x2b93('0x16')][_0x2b93('0x17')]||null:null,'attributes':_0x52de46[_0x2b93('0x16')]?_0x52de46[_0x2b93('0x16')][_0x2b93('0x18')]||null:null,'limit':_0x52de46[_0x2b93('0x16')]?_0x52de46[_0x2b93('0x16')]['limit']||null:null,'include':_0x52de46[_0x2b93('0x16')]?_0x52de46['options']['include']?_[_0x2b93('0x19')](_0x52de46[_0x2b93('0x16')][_0x2b93('0x1a')],function(_0x22a7cf){return{'model':db[_0x22a7cf[_0x2b93('0x1b')]],'as':_0x22a7cf['as'],'attributes':_0x22a7cf[_0x2b93('0x18')],'include':_0x22a7cf['include']?_['map'](_0x22a7cf['include'],function(_0x433f5f){return{'model':db[_0x433f5f['model']],'as':_0x433f5f['as'],'attributes':_0x433f5f[_0x2b93('0x18')],'include':_0x433f5f[_0x2b93('0x1a')]?_[_0x2b93('0x19')](_0x433f5f[_0x2b93('0x1a')],function(_0x51dc01){return{'model':db[_0x51dc01[_0x2b93('0x1b')]],'as':_0x51dc01['as'],'attributes':_0x51dc01[_0x2b93('0x18')]};}):[]};}):[]};}):[]:[]})[_0x2b93('0xb')](function(_0x1ac9cb){logger[_0x2b93('0xc')](_0x2b93('0x1c'),_0x52de46);logger[_0x2b93('0x1d')](_0x2b93('0x1c'),_0x52de46,JSON[_0x2b93('0xf')](_0x1ac9cb));_0x314b00(_0x1ac9cb);})[_0x2b93('0x1e')](function(_0xc12865){logger[_0x2b93('0x10')](_0x2b93('0x1c'),_0xc12865[_0x2b93('0x11')],_0x52de46);_0x44e8f2(_0x304261[_0x2b93('0x10')](0x1f4,_0xc12865[_0x2b93('0x11')]));});});};exports[_0x2b93('0x1f')]=function(_0x4a0d7a){var _0x54e763=this;return new Promise(function(_0x20d239,_0x464e40){return db['FreshdeskAccount']['find']({'raw':_0x4a0d7a[_0x2b93('0x16')]?_0x4a0d7a['options'][_0x2b93('0x15')]===undefined?!![]:![]:!![],'where':_0x4a0d7a[_0x2b93('0x16')]?_0x4a0d7a[_0x2b93('0x16')][_0x2b93('0x17')]||null:null,'attributes':_0x4a0d7a[_0x2b93('0x16')]?_0x4a0d7a[_0x2b93('0x16')]['attributes']||null:null,'include':_0x4a0d7a[_0x2b93('0x16')]?_0x4a0d7a[_0x2b93('0x16')][_0x2b93('0x1a')]?_[_0x2b93('0x19')](_0x4a0d7a[_0x2b93('0x16')][_0x2b93('0x1a')],function(_0x5e3ef5){return{'model':db[_0x5e3ef5[_0x2b93('0x1b')]],'as':_0x5e3ef5['as'],'attributes':_0x5e3ef5[_0x2b93('0x18')],'include':_0x5e3ef5[_0x2b93('0x1a')]?_[_0x2b93('0x19')](_0x5e3ef5[_0x2b93('0x1a')],function(_0xdf0001){return{'model':db[_0xdf0001[_0x2b93('0x1b')]],'as':_0xdf0001['as'],'attributes':_0xdf0001[_0x2b93('0x18')],'include':_0xdf0001[_0x2b93('0x1a')]?_[_0x2b93('0x19')](_0xdf0001['include'],function(_0x13062e){return{'model':db[_0x13062e['model']],'as':_0x13062e['as'],'attributes':_0x13062e[_0x2b93('0x18')]};}):[]};}):[]};}):[]:[]})[_0x2b93('0xb')](function(_0x1d7b4f){logger[_0x2b93('0xc')](_0x2b93('0x1f'),_0x4a0d7a);logger[_0x2b93('0x1d')](_0x2b93('0x1f'),_0x4a0d7a,JSON['stringify'](_0x1d7b4f));_0x20d239(_0x1d7b4f);})['catch'](function(_0x2f65c3){logger['error'](_0x2b93('0x1f'),_0x2f65c3['message'],_0x4a0d7a);_0x464e40(_0x54e763[_0x2b93('0x10')](0x1f4,_0x2f65c3[_0x2b93('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 29bc11b..c58af14 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 _0x6ce0=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','/:id/descriptions','getDescriptions','getTags','post','create','setTags','update','delete'];(function(_0x5c8e59,_0x518fab){var _0x585e98=function(_0x9b0655){while(--_0x9b0655){_0x5c8e59['push'](_0x5c8e59['shift']());}};_0x585e98(++_0x518fab);}(_0x6ce0,0x8c));var _0x06ce=function(_0x1d0d23,_0x43e210){_0x1d0d23=_0x1d0d23-0x0;var _0x2d295b=_0x6ce0[_0x1d0d23];return _0x2d295b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x06ce('0x0'));var timeout=require(_0x06ce('0x1'));var express=require(_0x06ce('0x2'));var router=express['Router']();var fs_extra=require(_0x06ce('0x3'));var auth=require(_0x06ce('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x06ce('0x5'));var controller=require('./intFreshdeskConfiguration.controller');router[_0x06ce('0x6')]('/',auth[_0x06ce('0x7')](),controller[_0x06ce('0x8')]);router['get']('/:id',auth[_0x06ce('0x7')](),controller[_0x06ce('0x9')]);router['get'](_0x06ce('0xa'),auth[_0x06ce('0x7')](),controller['getFields']);router[_0x06ce('0x6')](_0x06ce('0xb'),auth[_0x06ce('0x7')](),controller['getSubjects']);router['get'](_0x06ce('0xc'),auth[_0x06ce('0x7')](),controller[_0x06ce('0xd')]);router[_0x06ce('0x6')]('/:id/tags',auth[_0x06ce('0x7')](),controller[_0x06ce('0xe')]);router[_0x06ce('0xf')]('/',auth[_0x06ce('0x7')](),controller[_0x06ce('0x10')]);router[_0x06ce('0xf')]('/:id/tags',auth['isAuthenticated'](),controller[_0x06ce('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x06ce('0x12')]);router[_0x06ce('0x13')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xd7f0=['../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','isAuthenticated','get','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','getTags','post','create','setTags','update','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x2ef644,_0x2ab0ff){var _0x11f00e=function(_0x32983a){while(--_0x32983a){_0x2ef644['push'](_0x2ef644['shift']());}};_0x11f00e(++_0x2ab0ff);}(_0xd7f0,0x172));var _0x0d7f=function(_0x268dd7,_0x9390f0){_0x268dd7=_0x268dd7-0x0;var _0x4ace9f=_0xd7f0[_0x268dd7];return _0x4ace9f;};'use strict';var multer=require(_0x0d7f('0x0'));var util=require(_0x0d7f('0x1'));var path=require('path');var timeout=require(_0x0d7f('0x2'));var express=require(_0x0d7f('0x3'));var router=express[_0x0d7f('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0d7f('0x5'));var config=require(_0x0d7f('0x6'));var controller=require(_0x0d7f('0x7'));router['get']('/',auth[_0x0d7f('0x8')](),controller['index']);router[_0x0d7f('0x9')](_0x0d7f('0xa'),auth[_0x0d7f('0x8')](),controller[_0x0d7f('0xb')]);router[_0x0d7f('0x9')](_0x0d7f('0xc'),auth[_0x0d7f('0x8')](),controller[_0x0d7f('0xd')]);router[_0x0d7f('0x9')](_0x0d7f('0xe'),auth['isAuthenticated'](),controller[_0x0d7f('0xf')]);router[_0x0d7f('0x9')]('/:id/descriptions',auth[_0x0d7f('0x8')](),controller[_0x0d7f('0x10')]);router['get']('/:id/tags',auth[_0x0d7f('0x8')](),controller[_0x0d7f('0x11')]);router[_0x0d7f('0x12')]('/',auth[_0x0d7f('0x8')](),controller[_0x0d7f('0x13')]);router[_0x0d7f('0x12')]('/:id/tags',auth['isAuthenticated'](),controller[_0x0d7f('0x14')]);router['put'](_0x0d7f('0xa'),auth[_0x0d7f('0x8')](),controller[_0x0d7f('0x15')]);router[_0x0d7f('0x16')](_0x0d7f('0xa'),auth['isAuthenticated'](),controller[_0x0d7f('0x17')]);module[_0x0d7f('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 2e6ec8d..7e9e4c4 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 _0x73f6=['STRING','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x73f6,0x185));var _0x673f=function(_0x39e283,_0x247e6b){_0x39e283=_0x39e283-0x0;var _0x7de89f=_0x73f6[_0x39e283];return _0x7de89f;};'use strict';var Sequelize=require(_0x673f('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x673f('0x1')]}}; \ No newline at end of file +var _0xf8d0=['STRING','sequelize','exports'];(function(_0x114b2f,_0x5a9b64){var _0x2ed4fe=function(_0x5c5715){while(--_0x5c5715){_0x114b2f['push'](_0x114b2f['shift']());}};_0x2ed4fe(++_0x5a9b64);}(_0xf8d0,0xb2));var _0x0f8d=function(_0x5a339e,_0x2300e1){_0x5a339e=_0x5a339e-0x0;var _0x4f700f=_0xf8d0[_0x5a339e];return _0x4f700f;};'use strict';var Sequelize=require(_0x0f8d('0x0'));module[_0x0f8d('0x1')]={'name':{'type':Sequelize[_0x0f8d('0x2')]},'description':{'type':Sequelize[_0x0f8d('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 7336d82..7375e61 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 _0xeefe=['status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','name','send','index','map','FreshdeskConfiguration','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','rows','catch','show','params','fields','include','find','create','body','update','getFields','findOne','FreshdeskField','length','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','util','path','sox','to-csv','fs-extra','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end'];(function(_0x3c0c96,_0x449674){var _0x1780ec=function(_0x395465){while(--_0x395465){_0x3c0c96['push'](_0x3c0c96['shift']());}};_0x1780ec(++_0x449674);}(_0xeefe,0x1bd));var _0xeeef=function(_0x2f3ef9,_0x1ad618){_0x2f3ef9=_0x2f3ef9-0x0;var _0x300c08=_0xeefe[_0x2f3ef9];return _0x300c08;};'use strict';var emlformat=require(_0xeeef('0x0'));var rimraf=require(_0xeeef('0x1'));var zipdir=require(_0xeeef('0x2'));var jsonpatch=require(_0xeeef('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xeeef('0x4'));var path=require(_0xeeef('0x5'));var sox=require(_0xeeef('0x6'));var csv=require(_0xeeef('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xeeef('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xeeef('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xeeef('0xa'));var toCsv=require(_0xeeef('0x7'));var querystring=require(_0xeeef('0xb'));var Papa=require(_0xeeef('0xc'));var Redis=require('ioredis');var authService=require(_0xeeef('0xd'));var qs=require(_0xeeef('0xe'));var as=require(_0xeeef('0xf'));var hardwareService=require(_0xeeef('0x10'));var logger=require(_0xeeef('0x11'))(_0xeeef('0x12'));var utils=require('../../config/utils');var config=require(_0xeeef('0x13'));var licenseUtil=require(_0xeeef('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x267bc7,_0x24419f){_0x24419f=_0x24419f||0xcc;return function(_0x3fded4){if(_0x3fded4){return _0x267bc7[_0xeeef('0x15')](_0x24419f);}return _0x267bc7['status'](_0x24419f)[_0xeeef('0x16')]();};}function respondWithResult(_0x3f0de9,_0x8f8ed3){_0x8f8ed3=_0x8f8ed3||0xc8;return function(_0x516220){if(_0x516220){return _0x3f0de9[_0xeeef('0x17')](_0x8f8ed3)[_0xeeef('0x18')](_0x516220);}};}function respondWithFilteredResult(_0x696fb8,_0x420118){return function(_0x17a5b1){if(_0x17a5b1){var _0x362e05=typeof _0x420118[_0xeeef('0x19')]===_0xeeef('0x1a')&&typeof _0x420118[_0xeeef('0x1b')]===_0xeeef('0x1a');var _0xf30b74=_0x17a5b1[_0xeeef('0x1c')];var _0x56ec9a=_0x362e05?0x0:_0x420118[_0xeeef('0x19')];var _0x1dc9c7=_0x362e05?_0x17a5b1[_0xeeef('0x1c')]:_0x420118[_0xeeef('0x19')]+_0x420118[_0xeeef('0x1b')];var _0x3cb60b;if(_0x1dc9c7>=_0xf30b74){_0x1dc9c7=_0xf30b74;_0x3cb60b=0xc8;}else{_0x3cb60b=0xce;}_0x696fb8[_0xeeef('0x17')](_0x3cb60b);return _0x696fb8[_0xeeef('0x1d')](_0xeeef('0x1e'),_0x56ec9a+'-'+_0x1dc9c7+'/'+_0xf30b74)[_0xeeef('0x18')](_0x17a5b1);}return null;};}function patchUpdates(_0xe44ae4){return function(_0x17dc16){try{jsonpatch[_0xeeef('0x1f')](_0x17dc16,_0xe44ae4,!![]);}catch(_0xf99172){return BPromise[_0xeeef('0x20')](_0xf99172);}return _0x17dc16['save']();};}function saveUpdates(_0x4afc14,_0x33dd3f){return function(_0x39e20a){if(_0x39e20a){return _0x39e20a['update'](_0x4afc14)[_0xeeef('0x21')](function(_0x401010){return _0x401010;});}return null;};}function removeEntity(_0x2385f5,_0x1cf37c){return function(_0x29639d){if(_0x29639d){return _0x29639d[_0xeeef('0x22')]()[_0xeeef('0x21')](function(){_0x2385f5[_0xeeef('0x17')](0xcc)[_0xeeef('0x16')]();});}};}function handleEntityNotFound(_0x3d3870,_0x5bf4ac){return function(_0x403d38){if(!_0x403d38){_0x3d3870['sendStatus'](0x194);}return _0x403d38;};}function handleError(_0x535234,_0xebb117){_0xebb117=_0xebb117||0x1f4;return function(_0x5219da){logger['error'](_0x5219da['stack']);if(_0x5219da[_0xeeef('0x23')]){delete _0x5219da[_0xeeef('0x23')];}_0x535234[_0xeeef('0x17')](_0xebb117)[_0xeeef('0x24')](_0x5219da);};}exports[_0xeeef('0x25')]=function(_0x240ae1,_0x691458){var _0x5c62ea={},_0x132482={},_0x5ba94f={'count':0x0,'rows':[]};var _0x500587=_[_0xeeef('0x26')](db[_0xeeef('0x27')][_0xeeef('0x28')],function(_0x37c067){return{'name':_0x37c067[_0xeeef('0x29')],'type':_0x37c067['type'][_0xeeef('0x2a')]};});_0x132482[_0xeeef('0x2b')]=_[_0xeeef('0x26')](_0x500587,_0xeeef('0x23'));_0x132482[_0xeeef('0x2c')]=_[_0xeeef('0x2d')](_0x240ae1['query']);_0x132482[_0xeeef('0x2e')]=_['intersection'](_0x132482[_0xeeef('0x2b')],_0x132482[_0xeeef('0x2c')]);_0x5c62ea[_0xeeef('0x2f')]=_[_0xeeef('0x30')](_0x132482['model'],qs['fields'](_0x240ae1[_0xeeef('0x2c')]['fields']));_0x5c62ea[_0xeeef('0x2f')]=_0x5c62ea[_0xeeef('0x2f')]['length']?_0x5c62ea[_0xeeef('0x2f')]:_0x132482[_0xeeef('0x2b')];if(!_0x240ae1[_0xeeef('0x2c')][_0xeeef('0x31')](_0xeeef('0x32'))){_0x5c62ea[_0xeeef('0x1b')]=qs[_0xeeef('0x1b')](_0x240ae1[_0xeeef('0x2c')]['limit']);_0x5c62ea[_0xeeef('0x19')]=qs[_0xeeef('0x19')](_0x240ae1[_0xeeef('0x2c')][_0xeeef('0x19')]);}_0x5c62ea[_0xeeef('0x33')]=qs[_0xeeef('0x34')](_0x240ae1[_0xeeef('0x2c')][_0xeeef('0x34')]);_0x5c62ea[_0xeeef('0x35')]=qs[_0xeeef('0x2e')](_[_0xeeef('0x36')](_0x240ae1[_0xeeef('0x2c')],_0x132482[_0xeeef('0x2e')]),_0x500587);if(_0x240ae1[_0xeeef('0x2c')][_0xeeef('0x37')]){_0x5c62ea[_0xeeef('0x35')]=_[_0xeeef('0x38')](_0x5c62ea[_0xeeef('0x35')],{'$or':_[_0xeeef('0x26')](_0x500587,function(_0xaedf96){if(_0xaedf96['type']!=='VIRTUAL'){var _0x1a3862={};_0x1a3862[_0xaedf96['name']]={'$like':'%'+_0x240ae1[_0xeeef('0x2c')][_0xeeef('0x37')]+'%'};return _0x1a3862;}})});}_0x5c62ea=_[_0xeeef('0x38')]({},_0x5c62ea,_0x240ae1[_0xeeef('0x39')]);var _0x2b6ffe={'where':_0x5c62ea[_0xeeef('0x35')]};return db[_0xeeef('0x27')][_0xeeef('0x1c')](_0x2b6ffe)['then'](function(_0x5dab93){_0x5ba94f[_0xeeef('0x1c')]=_0x5dab93;if(_0x240ae1[_0xeeef('0x2c')][_0xeeef('0x3a')]){_0x5c62ea['include']=[{'all':!![]}];}return db[_0xeeef('0x27')]['findAll'](_0x5c62ea);})[_0xeeef('0x21')](function(_0x5ed91a){_0x5ba94f[_0xeeef('0x3b')]=_0x5ed91a;return _0x5ba94f;})[_0xeeef('0x21')](respondWithFilteredResult(_0x691458,_0x5c62ea))[_0xeeef('0x3c')](handleError(_0x691458,null));};exports[_0xeeef('0x3d')]=function(_0x27c3ca,_0x4f9cb8){var _0x1ef826={'raw':![],'where':{'id':_0x27c3ca[_0xeeef('0x3e')]['id']}},_0x1ebb3f={};_0x1ebb3f['model']=_['keys'](db[_0xeeef('0x27')][_0xeeef('0x28')]);_0x1ebb3f[_0xeeef('0x2c')]=_[_0xeeef('0x2d')](_0x27c3ca[_0xeeef('0x2c')]);_0x1ebb3f[_0xeeef('0x2e')]=_[_0xeeef('0x30')](_0x1ebb3f[_0xeeef('0x2b')],_0x1ebb3f[_0xeeef('0x2c')]);_0x1ef826[_0xeeef('0x2f')]=_[_0xeeef('0x30')](_0x1ebb3f[_0xeeef('0x2b')],qs['fields'](_0x27c3ca[_0xeeef('0x2c')][_0xeeef('0x3f')]));_0x1ef826['attributes']=_0x1ef826['attributes']['length']?_0x1ef826[_0xeeef('0x2f')]:_0x1ebb3f[_0xeeef('0x2b')];if(_0x27c3ca[_0xeeef('0x2c')][_0xeeef('0x3a')]){_0x1ef826[_0xeeef('0x40')]=[{'all':!![]}];}_0x1ef826=_[_0xeeef('0x38')]({},_0x1ef826,_0x27c3ca[_0xeeef('0x39')]);return db[_0xeeef('0x27')][_0xeeef('0x41')](_0x1ef826)[_0xeeef('0x21')](handleEntityNotFound(_0x4f9cb8,null))[_0xeeef('0x21')](respondWithResult(_0x4f9cb8,null))[_0xeeef('0x3c')](handleError(_0x4f9cb8,null));};exports[_0xeeef('0x42')]=function(_0x440db1,_0x14c95a){return db[_0xeeef('0x27')][_0xeeef('0x42')](_0x440db1[_0xeeef('0x43')],{})[_0xeeef('0x21')](respondWithResult(_0x14c95a,0xc9))[_0xeeef('0x3c')](handleError(_0x14c95a,null));};exports[_0xeeef('0x44')]=function(_0x4ff0fa,_0x130145){if(_0x4ff0fa['body']['id']){delete _0x4ff0fa[_0xeeef('0x43')]['id'];}return db[_0xeeef('0x27')][_0xeeef('0x41')]({'where':{'id':_0x4ff0fa[_0xeeef('0x3e')]['id']}})[_0xeeef('0x21')](handleEntityNotFound(_0x130145,null))['then'](saveUpdates(_0x4ff0fa['body'],null))[_0xeeef('0x21')](respondWithResult(_0x130145,null))[_0xeeef('0x3c')](handleError(_0x130145,null));};exports['destroy']=function(_0x1a304c,_0x53838f){return db[_0xeeef('0x27')][_0xeeef('0x41')]({'where':{'id':_0x1a304c[_0xeeef('0x3e')]['id']}})[_0xeeef('0x21')](handleEntityNotFound(_0x53838f,null))[_0xeeef('0x21')](removeEntity(_0x53838f,null))['catch'](handleError(_0x53838f,null));};exports[_0xeeef('0x45')]=function(_0x291c1f,_0x55d6a2,_0x174e46){var _0xbef9af={};var _0x3b970d={};var _0x4bff33;var _0x4cf3eb;return db['FreshdeskConfiguration'][_0xeeef('0x46')]({'where':{'id':_0x291c1f['params']['id']}})['then'](handleEntityNotFound(_0x55d6a2,null))[_0xeeef('0x21')](function(_0xe4e046){if(_0xe4e046){_0x4bff33=_0xe4e046;_0x3b970d[_0xeeef('0x2b')]=_[_0xeeef('0x2d')](db[_0xeeef('0x47')][_0xeeef('0x28')]);_0x3b970d[_0xeeef('0x2c')]=_['keys'](_0x291c1f['query']);_0x3b970d[_0xeeef('0x2e')]=_[_0xeeef('0x30')](_0x3b970d[_0xeeef('0x2b')],_0x3b970d[_0xeeef('0x2c')]);_0xbef9af[_0xeeef('0x2f')]=_[_0xeeef('0x30')](_0x3b970d[_0xeeef('0x2b')],qs[_0xeeef('0x3f')](_0x291c1f['query'][_0xeeef('0x3f')]));_0xbef9af[_0xeeef('0x2f')]=_0xbef9af[_0xeeef('0x2f')][_0xeeef('0x48')]?_0xbef9af[_0xeeef('0x2f')]:_0x3b970d[_0xeeef('0x2b')];_0xbef9af[_0xeeef('0x33')]=qs[_0xeeef('0x34')](_0x291c1f[_0xeeef('0x2c')][_0xeeef('0x34')]);_0xbef9af[_0xeeef('0x35')]=qs[_0xeeef('0x2e')](_[_0xeeef('0x36')](_0x291c1f[_0xeeef('0x2c')],_0x3b970d['filters']));if(_0x291c1f['query'][_0xeeef('0x37')]){_0xbef9af[_0xeeef('0x35')]=_[_0xeeef('0x38')](_0xbef9af[_0xeeef('0x35')],{'$or':_[_0xeeef('0x26')](_0xbef9af['attributes'],function(_0x42818e){var _0x47e54e={};_0x47e54e[_0x42818e]={'$like':'%'+_0x291c1f[_0xeeef('0x2c')][_0xeeef('0x37')]+'%'};return _0x47e54e;})});}_0xbef9af=_[_0xeeef('0x38')]({},_0xbef9af,_0x291c1f[_0xeeef('0x39')]);return _0x4bff33['getFields'](_0xbef9af);}})[_0xeeef('0x21')](function(_0x52958f){if(_0x52958f){_0x4cf3eb=_0x52958f[_0xeeef('0x48')];if(!_0x291c1f[_0xeeef('0x2c')][_0xeeef('0x31')](_0xeeef('0x32'))){_0xbef9af[_0xeeef('0x1b')]=qs['limit'](_0x291c1f[_0xeeef('0x2c')][_0xeeef('0x1b')]);_0xbef9af['offset']=qs[_0xeeef('0x19')](_0x291c1f[_0xeeef('0x2c')]['offset']);}return _0x4bff33[_0xeeef('0x45')](_0xbef9af);}})['then'](function(_0xdb5b49){if(_0xdb5b49){return _0xdb5b49?{'count':_0x4cf3eb,'rows':_0xdb5b49}:null;}})['then'](respondWithResult(_0x55d6a2,null))[_0xeeef('0x3c')](handleError(_0x55d6a2,null));};exports[_0xeeef('0x49')]=function(_0x4ef185,_0x83b080,_0x3c27b0){var _0x17460b={};var _0x3b9fed={};var _0xe0baa0;var _0x4a84c1;return db[_0xeeef('0x27')][_0xeeef('0x46')]({'where':{'id':_0x4ef185[_0xeeef('0x3e')]['id']}})[_0xeeef('0x21')](handleEntityNotFound(_0x83b080,null))[_0xeeef('0x21')](function(_0x1978b4){if(_0x1978b4){_0xe0baa0=_0x1978b4;_0x3b9fed['model']=_[_0xeeef('0x2d')](db[_0xeeef('0x47')][_0xeeef('0x28')]);_0x3b9fed['query']=_[_0xeeef('0x2d')](_0x4ef185[_0xeeef('0x2c')]);_0x3b9fed[_0xeeef('0x2e')]=_[_0xeeef('0x30')](_0x3b9fed[_0xeeef('0x2b')],_0x3b9fed[_0xeeef('0x2c')]);_0x17460b['attributes']=_[_0xeeef('0x30')](_0x3b9fed[_0xeeef('0x2b')],qs[_0xeeef('0x3f')](_0x4ef185[_0xeeef('0x2c')][_0xeeef('0x3f')]));_0x17460b[_0xeeef('0x2f')]=_0x17460b[_0xeeef('0x2f')][_0xeeef('0x48')]?_0x17460b[_0xeeef('0x2f')]:_0x3b9fed[_0xeeef('0x2b')];_0x17460b[_0xeeef('0x33')]=qs['sort'](_0x4ef185[_0xeeef('0x2c')]['sort']);_0x17460b[_0xeeef('0x35')]=qs[_0xeeef('0x2e')](_['pick'](_0x4ef185[_0xeeef('0x2c')],_0x3b9fed[_0xeeef('0x2e')]));if(_0x4ef185[_0xeeef('0x2c')][_0xeeef('0x37')]){_0x17460b[_0xeeef('0x35')]=_[_0xeeef('0x38')](_0x17460b[_0xeeef('0x35')],{'$or':_[_0xeeef('0x26')](_0x17460b['attributes'],function(_0x35be74){var _0x2d61b6={};_0x2d61b6[_0x35be74]={'$like':'%'+_0x4ef185[_0xeeef('0x2c')][_0xeeef('0x37')]+'%'};return _0x2d61b6;})});}_0x17460b=_[_0xeeef('0x38')]({},_0x17460b,_0x4ef185[_0xeeef('0x39')]);return _0xe0baa0[_0xeeef('0x49')](_0x17460b);}})[_0xeeef('0x21')](function(_0x231f69){if(_0x231f69){_0x4a84c1=_0x231f69['length'];if(!_0x4ef185[_0xeeef('0x2c')][_0xeeef('0x31')]('nolimit')){_0x17460b[_0xeeef('0x1b')]=qs['limit'](_0x4ef185[_0xeeef('0x2c')][_0xeeef('0x1b')]);_0x17460b[_0xeeef('0x19')]=qs['offset'](_0x4ef185[_0xeeef('0x2c')][_0xeeef('0x19')]);}return _0xe0baa0['getSubjects'](_0x17460b);}})[_0xeeef('0x21')](function(_0x3e882f){if(_0x3e882f){return _0x3e882f?{'count':_0x4a84c1,'rows':_0x3e882f}:null;}})[_0xeeef('0x21')](respondWithResult(_0x83b080,null))['catch'](handleError(_0x83b080,null));};exports[_0xeeef('0x4a')]=function(_0x1ac0cf,_0xe5848a,_0x534dbc){var _0x51abc3={};var _0x367e46={};var _0x1862be;var _0x53b0fb;return db['FreshdeskConfiguration'][_0xeeef('0x46')]({'where':{'id':_0x1ac0cf[_0xeeef('0x3e')]['id']}})[_0xeeef('0x21')](handleEntityNotFound(_0xe5848a,null))['then'](function(_0x3af181){if(_0x3af181){_0x1862be=_0x3af181;_0x367e46[_0xeeef('0x2b')]=_[_0xeeef('0x2d')](db['FreshdeskField'][_0xeeef('0x28')]);_0x367e46[_0xeeef('0x2c')]=_['keys'](_0x1ac0cf[_0xeeef('0x2c')]);_0x367e46['filters']=_[_0xeeef('0x30')](_0x367e46[_0xeeef('0x2b')],_0x367e46[_0xeeef('0x2c')]);_0x51abc3[_0xeeef('0x2f')]=_[_0xeeef('0x30')](_0x367e46['model'],qs[_0xeeef('0x3f')](_0x1ac0cf[_0xeeef('0x2c')]['fields']));_0x51abc3[_0xeeef('0x2f')]=_0x51abc3[_0xeeef('0x2f')][_0xeeef('0x48')]?_0x51abc3['attributes']:_0x367e46[_0xeeef('0x2b')];_0x51abc3[_0xeeef('0x33')]=qs[_0xeeef('0x34')](_0x1ac0cf[_0xeeef('0x2c')]['sort']);_0x51abc3[_0xeeef('0x35')]=qs['filters'](_[_0xeeef('0x36')](_0x1ac0cf[_0xeeef('0x2c')],_0x367e46['filters']));if(_0x1ac0cf[_0xeeef('0x2c')][_0xeeef('0x37')]){_0x51abc3[_0xeeef('0x35')]=_[_0xeeef('0x38')](_0x51abc3['where'],{'$or':_[_0xeeef('0x26')](_0x51abc3[_0xeeef('0x2f')],function(_0x1e22e3){var _0x43413f={};_0x43413f[_0x1e22e3]={'$like':'%'+_0x1ac0cf[_0xeeef('0x2c')][_0xeeef('0x37')]+'%'};return _0x43413f;})});}_0x51abc3=_[_0xeeef('0x38')]({},_0x51abc3,_0x1ac0cf['options']);return _0x1862be[_0xeeef('0x4a')](_0x51abc3);}})[_0xeeef('0x21')](function(_0x522b63){if(_0x522b63){_0x53b0fb=_0x522b63[_0xeeef('0x48')];if(!_0x1ac0cf[_0xeeef('0x2c')][_0xeeef('0x31')](_0xeeef('0x32'))){_0x51abc3[_0xeeef('0x1b')]=qs[_0xeeef('0x1b')](_0x1ac0cf[_0xeeef('0x2c')][_0xeeef('0x1b')]);_0x51abc3['offset']=qs[_0xeeef('0x19')](_0x1ac0cf[_0xeeef('0x2c')][_0xeeef('0x19')]);}return _0x1862be[_0xeeef('0x4a')](_0x51abc3);}})[_0xeeef('0x21')](function(_0x237f26){if(_0x237f26){return _0x237f26?{'count':_0x53b0fb,'rows':_0x237f26}:null;}})[_0xeeef('0x21')](respondWithResult(_0xe5848a,null))[_0xeeef('0x3c')](handleError(_0xe5848a,null));};exports[_0xeeef('0x4b')]=function(_0x197fd2,_0x478ae8,_0x5d32c8){var _0x4f3d69={};var _0x2d38e0={};var _0x94896f;var _0x1cc73d;return db[_0xeeef('0x27')][_0xeeef('0x46')]({'where':{'id':_0x197fd2[_0xeeef('0x3e')]['id']}})[_0xeeef('0x21')](handleEntityNotFound(_0x478ae8,null))[_0xeeef('0x21')](function(_0x198eef){if(_0x198eef){_0x94896f=_0x198eef;_0x2d38e0['model']=_[_0xeeef('0x2d')](db['Tag'][_0xeeef('0x28')]);_0x2d38e0[_0xeeef('0x2c')]=_['keys'](_0x197fd2[_0xeeef('0x2c')]);_0x2d38e0[_0xeeef('0x2e')]=_[_0xeeef('0x30')](_0x2d38e0['model'],_0x2d38e0[_0xeeef('0x2c')]);_0x4f3d69[_0xeeef('0x2f')]=_[_0xeeef('0x30')](_0x2d38e0[_0xeeef('0x2b')],qs[_0xeeef('0x3f')](_0x197fd2[_0xeeef('0x2c')][_0xeeef('0x3f')]));_0x4f3d69[_0xeeef('0x2f')]=_0x4f3d69[_0xeeef('0x2f')]['length']?_0x4f3d69[_0xeeef('0x2f')]:_0x2d38e0[_0xeeef('0x2b')];_0x4f3d69[_0xeeef('0x33')]=qs[_0xeeef('0x34')](_0x197fd2['query']['sort']);_0x4f3d69[_0xeeef('0x35')]=qs[_0xeeef('0x2e')](_['pick'](_0x197fd2['query'],_0x2d38e0[_0xeeef('0x2e')]));if(_0x197fd2[_0xeeef('0x2c')]['filter']){_0x4f3d69[_0xeeef('0x35')]=_['merge'](_0x4f3d69[_0xeeef('0x35')],{'$or':_['map'](_0x4f3d69[_0xeeef('0x2f')],function(_0x588ae3){var _0x2f8f17={};_0x2f8f17[_0x588ae3]={'$like':'%'+_0x197fd2['query'][_0xeeef('0x37')]+'%'};return _0x2f8f17;})});}_0x4f3d69=_[_0xeeef('0x38')]({},_0x4f3d69,_0x197fd2[_0xeeef('0x39')]);return _0x94896f[_0xeeef('0x4b')](_0x4f3d69);}})[_0xeeef('0x21')](function(_0x401d22){if(_0x401d22){_0x1cc73d=_0x401d22[_0xeeef('0x48')];if(!_0x197fd2['query'][_0xeeef('0x31')](_0xeeef('0x32'))){_0x4f3d69[_0xeeef('0x1b')]=qs[_0xeeef('0x1b')](_0x197fd2['query'][_0xeeef('0x1b')]);_0x4f3d69['offset']=qs[_0xeeef('0x19')](_0x197fd2[_0xeeef('0x2c')][_0xeeef('0x19')]);}return _0x94896f['getTags'](_0x4f3d69);}})[_0xeeef('0x21')](function(_0x5d2264){if(_0x5d2264){return _0x5d2264?{'count':_0x1cc73d,'rows':_0x5d2264}:null;}})[_0xeeef('0x21')](respondWithResult(_0x478ae8,null))[_0xeeef('0x3c')](handleError(_0x478ae8,null));};exports[_0xeeef('0x4c')]=function(_0x400b8e,_0x5d4160,_0x164165){if(_0x400b8e[_0xeeef('0x43')]['id']){delete _0x400b8e[_0xeeef('0x43')]['id'];}return db[_0xeeef('0x27')][_0xeeef('0x46')]({'where':{'id':_0x400b8e['params']['id']}})['then'](handleEntityNotFound(_0x5d4160,null))[_0xeeef('0x21')](function(_0x16c602){if(_0x16c602){return _0x16c602[_0xeeef('0x4c')](_0x400b8e['body'][_0xeeef('0x4d')]||[]);}return null;})[_0xeeef('0x21')](respondWithResult(_0x5d4160,null))['catch'](handleError(_0x5d4160,null));}; \ No newline at end of file +var _0xf3c6=['rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','name','send','index','map','FreshdeskConfiguration','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','body','destroy','getFields','findOne','FreshdeskField','pick','hasOwnProperty','getSubjects','getDescriptions','getTags','setTags','ids','eml-format'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xf3c6,0xad));var _0x6f3c=function(_0x448b32,_0x9043c2){_0x448b32=_0x448b32-0x0;var _0x2007d6=_0xf3c6[_0x448b32];return _0x2007d6;};'use strict';var emlformat=require(_0x6f3c('0x0'));var rimraf=require(_0x6f3c('0x1'));var zipdir=require(_0x6f3c('0x2'));var jsonpatch=require(_0x6f3c('0x3'));var rp=require(_0x6f3c('0x4'));var moment=require('moment');var BPromise=require(_0x6f3c('0x5'));var Mustache=require(_0x6f3c('0x6'));var util=require(_0x6f3c('0x7'));var path=require(_0x6f3c('0x8'));var sox=require(_0x6f3c('0x9'));var csv=require(_0x6f3c('0xa'));var ejs=require(_0x6f3c('0xb'));var fs=require('fs');var fs_extra=require(_0x6f3c('0xc'));var _=require('lodash');var squel=require(_0x6f3c('0xd'));var crypto=require(_0x6f3c('0xe'));var jsforce=require(_0x6f3c('0xf'));var deskjs=require(_0x6f3c('0x10'));var toCsv=require(_0x6f3c('0xa'));var querystring=require(_0x6f3c('0x11'));var Papa=require('papaparse');var Redis=require(_0x6f3c('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6f3c('0x13'));var as=require(_0x6f3c('0x14'));var hardwareService=require(_0x6f3c('0x15'));var logger=require(_0x6f3c('0x16'))(_0x6f3c('0x17'));var utils=require(_0x6f3c('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x6f3c('0x19'));var db=require(_0x6f3c('0x1a'))['db'];function respondWithStatusCode(_0x451986,_0x176e8b){_0x176e8b=_0x176e8b||0xcc;return function(_0x482d8c){if(_0x482d8c){return _0x451986[_0x6f3c('0x1b')](_0x176e8b);}return _0x451986[_0x6f3c('0x1c')](_0x176e8b)[_0x6f3c('0x1d')]();};}function respondWithResult(_0x4f1671,_0x1beebd){_0x1beebd=_0x1beebd||0xc8;return function(_0x1781a5){if(_0x1781a5){return _0x4f1671['status'](_0x1beebd)[_0x6f3c('0x1e')](_0x1781a5);}};}function respondWithFilteredResult(_0x5da9bc,_0x598bed){return function(_0xa604ac){if(_0xa604ac){var _0x217248=typeof _0x598bed[_0x6f3c('0x1f')]===_0x6f3c('0x20')&&typeof _0x598bed[_0x6f3c('0x21')]===_0x6f3c('0x20');var _0x1e205e=_0xa604ac[_0x6f3c('0x22')];var _0xd72156=_0x217248?0x0:_0x598bed[_0x6f3c('0x1f')];var _0x2322d6=_0x217248?_0xa604ac['count']:_0x598bed[_0x6f3c('0x1f')]+_0x598bed[_0x6f3c('0x21')];var _0x3df3fd;if(_0x2322d6>=_0x1e205e){_0x2322d6=_0x1e205e;_0x3df3fd=0xc8;}else{_0x3df3fd=0xce;}_0x5da9bc[_0x6f3c('0x1c')](_0x3df3fd);return _0x5da9bc[_0x6f3c('0x23')](_0x6f3c('0x24'),_0xd72156+'-'+_0x2322d6+'/'+_0x1e205e)[_0x6f3c('0x1e')](_0xa604ac);}return null;};}function patchUpdates(_0x3ff3c2){return function(_0x40eff2){try{jsonpatch['apply'](_0x40eff2,_0x3ff3c2,!![]);}catch(_0x1b5c50){return BPromise[_0x6f3c('0x25')](_0x1b5c50);}return _0x40eff2[_0x6f3c('0x26')]();};}function saveUpdates(_0x586b2b,_0x4396df){return function(_0x571440){if(_0x571440){return _0x571440[_0x6f3c('0x27')](_0x586b2b)[_0x6f3c('0x28')](function(_0xbb5889){return _0xbb5889;});}return null;};}function removeEntity(_0x37a660,_0x297210){return function(_0x439cc2){if(_0x439cc2){return _0x439cc2['destroy']()[_0x6f3c('0x28')](function(){_0x37a660['status'](0xcc)[_0x6f3c('0x1d')]();});}};}function handleEntityNotFound(_0x509c40,_0x1f88f6){return function(_0x4c92a7){if(!_0x4c92a7){_0x509c40['sendStatus'](0x194);}return _0x4c92a7;};}function handleError(_0x47ceff,_0xc024bd){_0xc024bd=_0xc024bd||0x1f4;return function(_0x461ed9){logger[_0x6f3c('0x29')](_0x461ed9['stack']);if(_0x461ed9[_0x6f3c('0x2a')]){delete _0x461ed9['name'];}_0x47ceff[_0x6f3c('0x1c')](_0xc024bd)[_0x6f3c('0x2b')](_0x461ed9);};}exports[_0x6f3c('0x2c')]=function(_0x312c2d,_0x2749da){var _0x353681={},_0x4a44a4={},_0x500570={'count':0x0,'rows':[]};var _0xe16f03=_[_0x6f3c('0x2d')](db[_0x6f3c('0x2e')][_0x6f3c('0x2f')],function(_0x558ec1){return{'name':_0x558ec1[_0x6f3c('0x30')],'type':_0x558ec1[_0x6f3c('0x31')][_0x6f3c('0x32')]};});_0x4a44a4['model']=_['map'](_0xe16f03,_0x6f3c('0x2a'));_0x4a44a4[_0x6f3c('0x33')]=_[_0x6f3c('0x34')](_0x312c2d[_0x6f3c('0x33')]);_0x4a44a4['filters']=_['intersection'](_0x4a44a4['model'],_0x4a44a4[_0x6f3c('0x33')]);_0x353681['attributes']=_[_0x6f3c('0x35')](_0x4a44a4[_0x6f3c('0x36')],qs[_0x6f3c('0x37')](_0x312c2d[_0x6f3c('0x33')][_0x6f3c('0x37')]));_0x353681[_0x6f3c('0x38')]=_0x353681[_0x6f3c('0x38')]['length']?_0x353681[_0x6f3c('0x38')]:_0x4a44a4[_0x6f3c('0x36')];if(!_0x312c2d['query']['hasOwnProperty'](_0x6f3c('0x39'))){_0x353681['limit']=qs['limit'](_0x312c2d[_0x6f3c('0x33')][_0x6f3c('0x21')]);_0x353681[_0x6f3c('0x1f')]=qs[_0x6f3c('0x1f')](_0x312c2d[_0x6f3c('0x33')]['offset']);}_0x353681[_0x6f3c('0x3a')]=qs[_0x6f3c('0x3b')](_0x312c2d[_0x6f3c('0x33')][_0x6f3c('0x3b')]);_0x353681[_0x6f3c('0x3c')]=qs[_0x6f3c('0x3d')](_['pick'](_0x312c2d[_0x6f3c('0x33')],_0x4a44a4[_0x6f3c('0x3d')]),_0xe16f03);if(_0x312c2d['query'][_0x6f3c('0x3e')]){_0x353681[_0x6f3c('0x3c')]=_[_0x6f3c('0x3f')](_0x353681[_0x6f3c('0x3c')],{'$or':_[_0x6f3c('0x2d')](_0xe16f03,function(_0x48141b){if(_0x48141b[_0x6f3c('0x31')]!==_0x6f3c('0x40')){var _0x511856={};_0x511856[_0x48141b[_0x6f3c('0x2a')]]={'$like':'%'+_0x312c2d['query'][_0x6f3c('0x3e')]+'%'};return _0x511856;}})});}_0x353681=_['merge']({},_0x353681,_0x312c2d[_0x6f3c('0x41')]);var _0x30b1dc={'where':_0x353681['where']};return db[_0x6f3c('0x2e')][_0x6f3c('0x22')](_0x30b1dc)[_0x6f3c('0x28')](function(_0x3f24e2){_0x500570[_0x6f3c('0x22')]=_0x3f24e2;if(_0x312c2d[_0x6f3c('0x33')][_0x6f3c('0x42')]){_0x353681[_0x6f3c('0x43')]=[{'all':!![]}];}return db[_0x6f3c('0x2e')][_0x6f3c('0x44')](_0x353681);})[_0x6f3c('0x28')](function(_0x5675fe){_0x500570[_0x6f3c('0x45')]=_0x5675fe;return _0x500570;})[_0x6f3c('0x28')](respondWithFilteredResult(_0x2749da,_0x353681))[_0x6f3c('0x46')](handleError(_0x2749da,null));};exports[_0x6f3c('0x47')]=function(_0x33c907,_0x1d4f8d){var _0x3c3432={'raw':![],'where':{'id':_0x33c907[_0x6f3c('0x48')]['id']}},_0x708737={};_0x708737[_0x6f3c('0x36')]=_[_0x6f3c('0x34')](db[_0x6f3c('0x2e')][_0x6f3c('0x2f')]);_0x708737[_0x6f3c('0x33')]=_[_0x6f3c('0x34')](_0x33c907[_0x6f3c('0x33')]);_0x708737[_0x6f3c('0x3d')]=_[_0x6f3c('0x35')](_0x708737['model'],_0x708737[_0x6f3c('0x33')]);_0x3c3432[_0x6f3c('0x38')]=_[_0x6f3c('0x35')](_0x708737[_0x6f3c('0x36')],qs[_0x6f3c('0x37')](_0x33c907[_0x6f3c('0x33')]['fields']));_0x3c3432[_0x6f3c('0x38')]=_0x3c3432[_0x6f3c('0x38')][_0x6f3c('0x49')]?_0x3c3432[_0x6f3c('0x38')]:_0x708737[_0x6f3c('0x36')];if(_0x33c907[_0x6f3c('0x33')][_0x6f3c('0x42')]){_0x3c3432[_0x6f3c('0x43')]=[{'all':!![]}];}_0x3c3432=_[_0x6f3c('0x3f')]({},_0x3c3432,_0x33c907[_0x6f3c('0x41')]);return db[_0x6f3c('0x2e')][_0x6f3c('0x4a')](_0x3c3432)['then'](handleEntityNotFound(_0x1d4f8d,null))[_0x6f3c('0x28')](respondWithResult(_0x1d4f8d,null))[_0x6f3c('0x46')](handleError(_0x1d4f8d,null));};exports['create']=function(_0x178720,_0x48169e){return db[_0x6f3c('0x2e')]['create'](_0x178720[_0x6f3c('0x4b')],{})['then'](respondWithResult(_0x48169e,0xc9))[_0x6f3c('0x46')](handleError(_0x48169e,null));};exports['update']=function(_0x598df6,_0x4ea1b7){if(_0x598df6[_0x6f3c('0x4b')]['id']){delete _0x598df6[_0x6f3c('0x4b')]['id'];}return db['FreshdeskConfiguration'][_0x6f3c('0x4a')]({'where':{'id':_0x598df6[_0x6f3c('0x48')]['id']}})['then'](handleEntityNotFound(_0x4ea1b7,null))[_0x6f3c('0x28')](saveUpdates(_0x598df6[_0x6f3c('0x4b')],null))[_0x6f3c('0x28')](respondWithResult(_0x4ea1b7,null))[_0x6f3c('0x46')](handleError(_0x4ea1b7,null));};exports[_0x6f3c('0x4c')]=function(_0x11ac77,_0x18b969){return db[_0x6f3c('0x2e')]['find']({'where':{'id':_0x11ac77[_0x6f3c('0x48')]['id']}})['then'](handleEntityNotFound(_0x18b969,null))[_0x6f3c('0x28')](removeEntity(_0x18b969,null))[_0x6f3c('0x46')](handleError(_0x18b969,null));};exports[_0x6f3c('0x4d')]=function(_0x387e1d,_0x21cacc,_0x5e7c99){var _0x3ef10a={};var _0x14d770={};var _0x20bd59;var _0x35ae83;return db['FreshdeskConfiguration'][_0x6f3c('0x4e')]({'where':{'id':_0x387e1d[_0x6f3c('0x48')]['id']}})[_0x6f3c('0x28')](handleEntityNotFound(_0x21cacc,null))[_0x6f3c('0x28')](function(_0x8d37e4){if(_0x8d37e4){_0x20bd59=_0x8d37e4;_0x14d770[_0x6f3c('0x36')]=_[_0x6f3c('0x34')](db[_0x6f3c('0x4f')][_0x6f3c('0x2f')]);_0x14d770[_0x6f3c('0x33')]=_[_0x6f3c('0x34')](_0x387e1d[_0x6f3c('0x33')]);_0x14d770['filters']=_[_0x6f3c('0x35')](_0x14d770[_0x6f3c('0x36')],_0x14d770['query']);_0x3ef10a[_0x6f3c('0x38')]=_['intersection'](_0x14d770[_0x6f3c('0x36')],qs[_0x6f3c('0x37')](_0x387e1d[_0x6f3c('0x33')][_0x6f3c('0x37')]));_0x3ef10a[_0x6f3c('0x38')]=_0x3ef10a[_0x6f3c('0x38')][_0x6f3c('0x49')]?_0x3ef10a['attributes']:_0x14d770[_0x6f3c('0x36')];_0x3ef10a[_0x6f3c('0x3a')]=qs['sort'](_0x387e1d[_0x6f3c('0x33')][_0x6f3c('0x3b')]);_0x3ef10a[_0x6f3c('0x3c')]=qs['filters'](_[_0x6f3c('0x50')](_0x387e1d[_0x6f3c('0x33')],_0x14d770[_0x6f3c('0x3d')]));if(_0x387e1d['query'][_0x6f3c('0x3e')]){_0x3ef10a[_0x6f3c('0x3c')]=_['merge'](_0x3ef10a[_0x6f3c('0x3c')],{'$or':_[_0x6f3c('0x2d')](_0x3ef10a[_0x6f3c('0x38')],function(_0x5d08ee){var _0x339400={};_0x339400[_0x5d08ee]={'$like':'%'+_0x387e1d[_0x6f3c('0x33')][_0x6f3c('0x3e')]+'%'};return _0x339400;})});}_0x3ef10a=_[_0x6f3c('0x3f')]({},_0x3ef10a,_0x387e1d[_0x6f3c('0x41')]);return _0x20bd59[_0x6f3c('0x4d')](_0x3ef10a);}})[_0x6f3c('0x28')](function(_0x13e310){if(_0x13e310){_0x35ae83=_0x13e310[_0x6f3c('0x49')];if(!_0x387e1d[_0x6f3c('0x33')][_0x6f3c('0x51')](_0x6f3c('0x39'))){_0x3ef10a[_0x6f3c('0x21')]=qs['limit'](_0x387e1d[_0x6f3c('0x33')][_0x6f3c('0x21')]);_0x3ef10a['offset']=qs[_0x6f3c('0x1f')](_0x387e1d[_0x6f3c('0x33')][_0x6f3c('0x1f')]);}return _0x20bd59['getFields'](_0x3ef10a);}})[_0x6f3c('0x28')](function(_0x45f598){if(_0x45f598){return _0x45f598?{'count':_0x35ae83,'rows':_0x45f598}:null;}})[_0x6f3c('0x28')](respondWithResult(_0x21cacc,null))[_0x6f3c('0x46')](handleError(_0x21cacc,null));};exports[_0x6f3c('0x52')]=function(_0x25a0d4,_0x4f374b,_0x34949b){var _0x38d19d={};var _0x3be43a={};var _0x3a17a9;var _0x3610f5;return db[_0x6f3c('0x2e')][_0x6f3c('0x4e')]({'where':{'id':_0x25a0d4['params']['id']}})[_0x6f3c('0x28')](handleEntityNotFound(_0x4f374b,null))[_0x6f3c('0x28')](function(_0x2c3d5c){if(_0x2c3d5c){_0x3a17a9=_0x2c3d5c;_0x3be43a[_0x6f3c('0x36')]=_['keys'](db[_0x6f3c('0x4f')][_0x6f3c('0x2f')]);_0x3be43a[_0x6f3c('0x33')]=_['keys'](_0x25a0d4[_0x6f3c('0x33')]);_0x3be43a['filters']=_[_0x6f3c('0x35')](_0x3be43a['model'],_0x3be43a[_0x6f3c('0x33')]);_0x38d19d['attributes']=_[_0x6f3c('0x35')](_0x3be43a[_0x6f3c('0x36')],qs['fields'](_0x25a0d4[_0x6f3c('0x33')][_0x6f3c('0x37')]));_0x38d19d[_0x6f3c('0x38')]=_0x38d19d[_0x6f3c('0x38')][_0x6f3c('0x49')]?_0x38d19d[_0x6f3c('0x38')]:_0x3be43a[_0x6f3c('0x36')];_0x38d19d[_0x6f3c('0x3a')]=qs[_0x6f3c('0x3b')](_0x25a0d4['query'][_0x6f3c('0x3b')]);_0x38d19d['where']=qs['filters'](_[_0x6f3c('0x50')](_0x25a0d4[_0x6f3c('0x33')],_0x3be43a['filters']));if(_0x25a0d4['query'][_0x6f3c('0x3e')]){_0x38d19d[_0x6f3c('0x3c')]=_[_0x6f3c('0x3f')](_0x38d19d[_0x6f3c('0x3c')],{'$or':_['map'](_0x38d19d['attributes'],function(_0x50b6a0){var _0x1fcef1={};_0x1fcef1[_0x50b6a0]={'$like':'%'+_0x25a0d4[_0x6f3c('0x33')][_0x6f3c('0x3e')]+'%'};return _0x1fcef1;})});}_0x38d19d=_[_0x6f3c('0x3f')]({},_0x38d19d,_0x25a0d4[_0x6f3c('0x41')]);return _0x3a17a9['getSubjects'](_0x38d19d);}})[_0x6f3c('0x28')](function(_0x18b55f){if(_0x18b55f){_0x3610f5=_0x18b55f[_0x6f3c('0x49')];if(!_0x25a0d4[_0x6f3c('0x33')]['hasOwnProperty']('nolimit')){_0x38d19d['limit']=qs[_0x6f3c('0x21')](_0x25a0d4[_0x6f3c('0x33')][_0x6f3c('0x21')]);_0x38d19d[_0x6f3c('0x1f')]=qs['offset'](_0x25a0d4['query'][_0x6f3c('0x1f')]);}return _0x3a17a9['getSubjects'](_0x38d19d);}})['then'](function(_0x589396){if(_0x589396){return _0x589396?{'count':_0x3610f5,'rows':_0x589396}:null;}})[_0x6f3c('0x28')](respondWithResult(_0x4f374b,null))[_0x6f3c('0x46')](handleError(_0x4f374b,null));};exports[_0x6f3c('0x53')]=function(_0x2e5093,_0x3262c9,_0x283d42){var _0x1fb4a6={};var _0x351c0e={};var _0x3d4e9a;var _0x557b12;return db[_0x6f3c('0x2e')][_0x6f3c('0x4e')]({'where':{'id':_0x2e5093['params']['id']}})[_0x6f3c('0x28')](handleEntityNotFound(_0x3262c9,null))[_0x6f3c('0x28')](function(_0x3568d4){if(_0x3568d4){_0x3d4e9a=_0x3568d4;_0x351c0e[_0x6f3c('0x36')]=_[_0x6f3c('0x34')](db[_0x6f3c('0x4f')]['rawAttributes']);_0x351c0e[_0x6f3c('0x33')]=_[_0x6f3c('0x34')](_0x2e5093[_0x6f3c('0x33')]);_0x351c0e['filters']=_[_0x6f3c('0x35')](_0x351c0e[_0x6f3c('0x36')],_0x351c0e['query']);_0x1fb4a6[_0x6f3c('0x38')]=_['intersection'](_0x351c0e[_0x6f3c('0x36')],qs[_0x6f3c('0x37')](_0x2e5093[_0x6f3c('0x33')][_0x6f3c('0x37')]));_0x1fb4a6[_0x6f3c('0x38')]=_0x1fb4a6['attributes'][_0x6f3c('0x49')]?_0x1fb4a6[_0x6f3c('0x38')]:_0x351c0e[_0x6f3c('0x36')];_0x1fb4a6['order']=qs[_0x6f3c('0x3b')](_0x2e5093[_0x6f3c('0x33')]['sort']);_0x1fb4a6[_0x6f3c('0x3c')]=qs[_0x6f3c('0x3d')](_['pick'](_0x2e5093[_0x6f3c('0x33')],_0x351c0e[_0x6f3c('0x3d')]));if(_0x2e5093[_0x6f3c('0x33')][_0x6f3c('0x3e')]){_0x1fb4a6[_0x6f3c('0x3c')]=_[_0x6f3c('0x3f')](_0x1fb4a6['where'],{'$or':_[_0x6f3c('0x2d')](_0x1fb4a6[_0x6f3c('0x38')],function(_0x2390f7){var _0x35b5c2={};_0x35b5c2[_0x2390f7]={'$like':'%'+_0x2e5093['query'][_0x6f3c('0x3e')]+'%'};return _0x35b5c2;})});}_0x1fb4a6=_[_0x6f3c('0x3f')]({},_0x1fb4a6,_0x2e5093[_0x6f3c('0x41')]);return _0x3d4e9a[_0x6f3c('0x53')](_0x1fb4a6);}})[_0x6f3c('0x28')](function(_0x4edc07){if(_0x4edc07){_0x557b12=_0x4edc07['length'];if(!_0x2e5093[_0x6f3c('0x33')]['hasOwnProperty'](_0x6f3c('0x39'))){_0x1fb4a6[_0x6f3c('0x21')]=qs[_0x6f3c('0x21')](_0x2e5093[_0x6f3c('0x33')]['limit']);_0x1fb4a6[_0x6f3c('0x1f')]=qs[_0x6f3c('0x1f')](_0x2e5093['query'][_0x6f3c('0x1f')]);}return _0x3d4e9a[_0x6f3c('0x53')](_0x1fb4a6);}})['then'](function(_0x14fda8){if(_0x14fda8){return _0x14fda8?{'count':_0x557b12,'rows':_0x14fda8}:null;}})['then'](respondWithResult(_0x3262c9,null))[_0x6f3c('0x46')](handleError(_0x3262c9,null));};exports[_0x6f3c('0x54')]=function(_0x5dacab,_0x222d7c,_0x2db8cc){var _0x49f1cc={};var _0x587401={};var _0x53a8cb;var _0x564bab;return db[_0x6f3c('0x2e')][_0x6f3c('0x4e')]({'where':{'id':_0x5dacab[_0x6f3c('0x48')]['id']}})['then'](handleEntityNotFound(_0x222d7c,null))[_0x6f3c('0x28')](function(_0x111760){if(_0x111760){_0x53a8cb=_0x111760;_0x587401['model']=_['keys'](db['Tag'][_0x6f3c('0x2f')]);_0x587401['query']=_[_0x6f3c('0x34')](_0x5dacab[_0x6f3c('0x33')]);_0x587401[_0x6f3c('0x3d')]=_['intersection'](_0x587401['model'],_0x587401[_0x6f3c('0x33')]);_0x49f1cc['attributes']=_[_0x6f3c('0x35')](_0x587401[_0x6f3c('0x36')],qs[_0x6f3c('0x37')](_0x5dacab[_0x6f3c('0x33')][_0x6f3c('0x37')]));_0x49f1cc['attributes']=_0x49f1cc[_0x6f3c('0x38')][_0x6f3c('0x49')]?_0x49f1cc['attributes']:_0x587401[_0x6f3c('0x36')];_0x49f1cc[_0x6f3c('0x3a')]=qs[_0x6f3c('0x3b')](_0x5dacab[_0x6f3c('0x33')]['sort']);_0x49f1cc[_0x6f3c('0x3c')]=qs['filters'](_[_0x6f3c('0x50')](_0x5dacab[_0x6f3c('0x33')],_0x587401[_0x6f3c('0x3d')]));if(_0x5dacab[_0x6f3c('0x33')][_0x6f3c('0x3e')]){_0x49f1cc[_0x6f3c('0x3c')]=_[_0x6f3c('0x3f')](_0x49f1cc[_0x6f3c('0x3c')],{'$or':_[_0x6f3c('0x2d')](_0x49f1cc[_0x6f3c('0x38')],function(_0x5b1409){var _0x5db73f={};_0x5db73f[_0x5b1409]={'$like':'%'+_0x5dacab[_0x6f3c('0x33')][_0x6f3c('0x3e')]+'%'};return _0x5db73f;})});}_0x49f1cc=_[_0x6f3c('0x3f')]({},_0x49f1cc,_0x5dacab['options']);return _0x53a8cb['getTags'](_0x49f1cc);}})['then'](function(_0x8fc22e){if(_0x8fc22e){_0x564bab=_0x8fc22e[_0x6f3c('0x49')];if(!_0x5dacab[_0x6f3c('0x33')][_0x6f3c('0x51')](_0x6f3c('0x39'))){_0x49f1cc[_0x6f3c('0x21')]=qs[_0x6f3c('0x21')](_0x5dacab[_0x6f3c('0x33')][_0x6f3c('0x21')]);_0x49f1cc[_0x6f3c('0x1f')]=qs[_0x6f3c('0x1f')](_0x5dacab[_0x6f3c('0x33')][_0x6f3c('0x1f')]);}return _0x53a8cb['getTags'](_0x49f1cc);}})[_0x6f3c('0x28')](function(_0x48f614){if(_0x48f614){return _0x48f614?{'count':_0x564bab,'rows':_0x48f614}:null;}})[_0x6f3c('0x28')](respondWithResult(_0x222d7c,null))['catch'](handleError(_0x222d7c,null));};exports[_0x6f3c('0x55')]=function(_0x57d3aa,_0x58e19c,_0x1a2964){if(_0x57d3aa[_0x6f3c('0x4b')]['id']){delete _0x57d3aa['body']['id'];}return db['FreshdeskConfiguration'][_0x6f3c('0x4e')]({'where':{'id':_0x57d3aa[_0x6f3c('0x48')]['id']}})[_0x6f3c('0x28')](handleEntityNotFound(_0x58e19c,null))[_0x6f3c('0x28')](function(_0x3dac2b){if(_0x3dac2b){return _0x3dac2b[_0x6f3c('0x55')](_0x57d3aa[_0x6f3c('0x4b')][_0x6f3c('0x56')]||[]);}return null;})[_0x6f3c('0x28')](respondWithResult(_0x58e19c,null))['catch'](handleError(_0x58e19c,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index dfbbb25..d599b71 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 _0xaf95=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','int_freshdesk_configurations','lodash'];(function(_0x5b5c73,_0x1a0861){var _0x57ab1f=function(_0x21a4a5){while(--_0x21a4a5){_0x5b5c73['push'](_0x5b5c73['shift']());}};_0x57ab1f(++_0x1a0861);}(_0xaf95,0x1e0));var _0x5af9=function(_0x29c023,_0x1c501d){_0x29c023=_0x29c023-0x0;var _0x6159ad=_0xaf95[_0x29c023];return _0x6159ad;};'use strict';var _=require(_0x5af9('0x0'));var util=require(_0x5af9('0x1'));var logger=require(_0x5af9('0x2'))(_0x5af9('0x3'));var moment=require(_0x5af9('0x4'));var BPromise=require(_0x5af9('0x5'));var rp=require(_0x5af9('0x6'));var fs=require('fs');var path=require(_0x5af9('0x7'));var rimraf=require(_0x5af9('0x8'));var config=require(_0x5af9('0x9'));var attributes=require(_0x5af9('0xa'));module[_0x5af9('0xb')]=function(_0x5bbb9c,_0x4f9fe4){return _0x5bbb9c['define']('FreshdeskConfiguration',attributes,{'tableName':_0x5af9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x87fb=['util','api','moment','request-promise','path','rimraf','exports','define','FreshdeskConfiguration','lodash'];(function(_0x3a94e1,_0x22e4fd){var _0x6a09d5=function(_0x2d6d1c){while(--_0x2d6d1c){_0x3a94e1['push'](_0x3a94e1['shift']());}};_0x6a09d5(++_0x22e4fd);}(_0x87fb,0x103));var _0xb87f=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x87fb[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xb87f('0x0'));var util=require(_0xb87f('0x1'));var logger=require('../../config/logger')(_0xb87f('0x2'));var moment=require(_0xb87f('0x3'));var BPromise=require('bluebird');var rp=require(_0xb87f('0x4'));var fs=require('fs');var path=require(_0xb87f('0x5'));var rimraf=require(_0xb87f('0x6'));var config=require('../../config/environment');var attributes=require('./intFreshdeskConfiguration.attributes');module[_0xb87f('0x7')]=function(_0x342f4e,_0x4d7cb7){return _0x342f4e[_0xb87f('0x8')](_0xb87f('0x9'),attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index 0f3480e..e6ee6fb 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 _0x1ad1=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x30fa5d,_0x517548){var _0x416307=function(_0x23a932){while(--_0x23a932){_0x30fa5d['push'](_0x30fa5d['shift']());}};_0x416307(++_0x517548);}(_0x1ad1,0xf8));var _0x11ad=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0x1ad1[_0x1f9f37];return _0x21c080;};'use strict';var _=require(_0x11ad('0x0'));var util=require(_0x11ad('0x1'));var moment=require('moment');var BPromise=require(_0x11ad('0x2'));var rs=require(_0x11ad('0x3'));var fs=require('fs');var Redis=require(_0x11ad('0x4'));var db=require(_0x11ad('0x5'))['db'];var utils=require(_0x11ad('0x6'));var logger=require('../../config/logger')(_0x11ad('0x7'));var config=require(_0x11ad('0x8'));var jayson=require(_0x11ad('0x9'));var client=jayson[_0x11ad('0xa')][_0x11ad('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x41993e,_0x1ca43e,_0x414b73){return new BPromise(function(_0x2c1b4c,_0x11671b){return client[_0x11ad('0xc')](_0x41993e,_0x414b73)['then'](function(_0x433f65){logger[_0x11ad('0xd')](_0x11ad('0xe'),_0x1ca43e,_0x11ad('0xf'));logger[_0x11ad('0x10')](_0x11ad('0x11'),_0x1ca43e,_0x11ad('0xf'),JSON[_0x11ad('0x12')](_0x433f65));if(_0x433f65[_0x11ad('0x13')]){if(_0x433f65[_0x11ad('0x13')][_0x11ad('0x14')]===0x1f4){logger[_0x11ad('0x13')](_0x11ad('0xe'),_0x1ca43e,_0x433f65['error'][_0x11ad('0x15')]);return _0x11671b(_0x433f65['error'][_0x11ad('0x15')]);}logger[_0x11ad('0x13')](_0x11ad('0xe'),_0x1ca43e,_0x433f65[_0x11ad('0x13')][_0x11ad('0x15')]);return _0x2c1b4c(_0x433f65['error'][_0x11ad('0x15')]);}else{logger[_0x11ad('0xd')](_0x11ad('0xe'),_0x1ca43e,_0x11ad('0xf'));_0x2c1b4c(_0x433f65['result'][_0x11ad('0x15')]);}})[_0x11ad('0x16')](function(_0xeb9f6){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x1ca43e,_0xeb9f6);_0x11671b(_0xeb9f6);});});} \ No newline at end of file +var _0x81fa=['FreshdeskConfiguration,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','debug','error','code'];(function(_0x2e1046,_0x289069){var _0x2f76a5=function(_0x371eee){while(--_0x371eee){_0x2e1046['push'](_0x2e1046['shift']());}};_0x2f76a5(++_0x289069);}(_0x81fa,0x114));var _0xa81f=function(_0x5d054e,_0x19c2e0){_0x5d054e=_0x5d054e-0x0;var _0x28db29=_0x81fa[_0x5d054e];return _0x28db29;};'use strict';var _=require('lodash');var util=require(_0xa81f('0x0'));var moment=require(_0xa81f('0x1'));var BPromise=require(_0xa81f('0x2'));var rs=require(_0xa81f('0x3'));var fs=require('fs');var Redis=require(_0xa81f('0x4'));var db=require(_0xa81f('0x5'))['db'];var utils=require(_0xa81f('0x6'));var logger=require(_0xa81f('0x7'))('rpc');var config=require(_0xa81f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa81f('0x9')][_0xa81f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5b0f4d,_0x5e1fda,_0x404a94){return new BPromise(function(_0x9705ca,_0x3be5f1){return client[_0xa81f('0xb')](_0x5b0f4d,_0x404a94)[_0xa81f('0xc')](function(_0x4f58d4){logger[_0xa81f('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x5e1fda,_0xa81f('0xe'));logger[_0xa81f('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x5e1fda,'request\x20sent',JSON['stringify'](_0x4f58d4));if(_0x4f58d4['error']){if(_0x4f58d4[_0xa81f('0x10')][_0xa81f('0x11')]===0x1f4){logger[_0xa81f('0x10')](_0xa81f('0x12'),_0x5e1fda,_0x4f58d4[_0xa81f('0x10')][_0xa81f('0x13')]);return _0x3be5f1(_0x4f58d4['error'][_0xa81f('0x13')]);}logger[_0xa81f('0x10')](_0xa81f('0x12'),_0x5e1fda,_0x4f58d4['error'][_0xa81f('0x13')]);return _0x9705ca(_0x4f58d4['error'][_0xa81f('0x13')]);}else{logger[_0xa81f('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x5e1fda,'request\x20sent');_0x9705ca(_0x4f58d4['result'][_0xa81f('0x13')]);}})[_0xa81f('0x14')](function(_0x4fac7f){logger[_0xa81f('0x10')](_0xa81f('0x12'),_0x5e1fda,_0x4fac7f);_0x3be5f1(_0x4fac7f);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 2f3ec1a..f2da255 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 _0x2011=['Router','fs-extra','../../components/auth/service','./intFreshdeskField.controller','get','/:id','isAuthenticated','show','post','create','update','delete','destroy','exports','multer','util','path','express'];(function(_0x5a6961,_0xd41ca6){var _0x4af0a6=function(_0x1201fe){while(--_0x1201fe){_0x5a6961['push'](_0x5a6961['shift']());}};_0x4af0a6(++_0xd41ca6);}(_0x2011,0x1ac));var _0x1201=function(_0x3c86ee,_0x594fc7){_0x3c86ee=_0x3c86ee-0x0;var _0x21dc37=_0x2011[_0x3c86ee];return _0x21dc37;};'use strict';var multer=require(_0x1201('0x0'));var util=require(_0x1201('0x1'));var path=require(_0x1201('0x2'));var timeout=require('connect-timeout');var express=require(_0x1201('0x3'));var router=express[_0x1201('0x4')]();var fs_extra=require(_0x1201('0x5'));var auth=require(_0x1201('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1201('0x7'));router[_0x1201('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x1201('0x9'),auth[_0x1201('0xa')](),controller[_0x1201('0xb')]);router[_0x1201('0xc')]('/',auth[_0x1201('0xa')](),controller[_0x1201('0xd')]);router['put'](_0x1201('0x9'),auth[_0x1201('0xa')](),controller[_0x1201('0xe')]);router[_0x1201('0xf')](_0x1201('0x9'),auth[_0x1201('0xa')](),controller[_0x1201('0x10')]);module[_0x1201('0x11')]=router; \ No newline at end of file +var _0xdcaa=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','update','exports','util'];(function(_0x5ecca2,_0x28f9c4){var _0x226f66=function(_0x49adee){while(--_0x49adee){_0x5ecca2['push'](_0x5ecca2['shift']());}};_0x226f66(++_0x28f9c4);}(_0xdcaa,0x87));var _0xadca=function(_0x2aa4c1,_0x1e023a){_0x2aa4c1=_0x2aa4c1-0x0;var _0x439fe3=_0xdcaa[_0x2aa4c1];return _0x439fe3;};'use strict';var multer=require('multer');var util=require(_0xadca('0x0'));var path=require(_0xadca('0x1'));var timeout=require(_0xadca('0x2'));var express=require(_0xadca('0x3'));var router=express[_0xadca('0x4')]();var fs_extra=require(_0xadca('0x5'));var auth=require(_0xadca('0x6'));var interaction=require(_0xadca('0x7'));var config=require(_0xadca('0x8'));var controller=require('./intFreshdeskField.controller');router[_0xadca('0x9')]('/',auth[_0xadca('0xa')](),controller[_0xadca('0xb')]);router[_0xadca('0x9')](_0xadca('0xc'),auth['isAuthenticated'](),controller[_0xadca('0xd')]);router[_0xadca('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xadca('0xc'),auth['isAuthenticated'](),controller[_0xadca('0xf')]);router['delete'](_0xadca('0xc'),auth[_0xadca('0xa')](),controller['destroy']);module[_0xadca('0x10')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 985ce74..231157b 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 _0x0abe=['ENUM','string','variable','customVariable','STRING','sequelize','exports'];(function(_0x89887b,_0x327445){var _0x403b36=function(_0x557979){while(--_0x557979){_0x89887b['push'](_0x89887b['shift']());}};_0x403b36(++_0x327445);}(_0x0abe,0xb4));var _0xe0ab=function(_0x15ea1b,_0x17de32){_0x15ea1b=_0x15ea1b-0x0;var _0x1ace1c=_0x0abe[_0x15ea1b];return _0x1ace1c;};'use strict';var Sequelize=require(_0xe0ab('0x0'));module[_0xe0ab('0x1')]={'type':{'type':Sequelize[_0xe0ab('0x2')](_0xe0ab('0x3'),_0xe0ab('0x4'),_0xe0ab('0x5'),'keyValue','picklist'),'defaultValue':_0xe0ab('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xe0ab('0x6')]},'keyType':{'type':Sequelize[_0xe0ab('0x2')]('string',_0xe0ab('0x4'),_0xe0ab('0x5'))},'keyContent':{'type':Sequelize[_0xe0ab('0x6')]},'idField':{'type':Sequelize[_0xe0ab('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe0ab('0x6')]}}; \ No newline at end of file +var _0xe668=['ENUM','variable','customVariable','keyValue','string','STRING','BOOLEAN','exports'];(function(_0x290a36,_0x561046){var _0xc59237=function(_0x5c0c52){while(--_0x5c0c52){_0x290a36['push'](_0x290a36['shift']());}};_0xc59237(++_0x561046);}(_0xe668,0x19f));var _0x8e66=function(_0x2c34ff,_0x1e8bee){_0x2c34ff=_0x2c34ff-0x0;var _0x476508=_0xe668[_0x2c34ff];return _0x476508;};'use strict';var Sequelize=require('sequelize');module[_0x8e66('0x0')]={'type':{'type':Sequelize[_0x8e66('0x1')]('string',_0x8e66('0x2'),_0x8e66('0x3'),_0x8e66('0x4'),'picklist'),'defaultValue':_0x8e66('0x5')},'content':{'type':Sequelize[_0x8e66('0x6')]},'key':{'type':Sequelize[_0x8e66('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x8e66('0x5'),_0x8e66('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0x8e66('0x6')]},'idField':{'type':Sequelize[_0x8e66('0x6')]},'nameField':{'type':Sequelize[_0x8e66('0x6')]},'customField':{'type':Sequelize[_0x8e66('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 346bf12..7d52ab3 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 _0x76dc=['body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','json','apply','reject','save','update','then','destroy','error','name','index','map','rawAttributes','fieldName','type','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','FreshdeskField','includeAll','include','rows','params','options','find','catch','create'];(function(_0x57e7e9,_0x2314c1){var _0x5644a1=function(_0x4ddb9b){while(--_0x4ddb9b){_0x57e7e9['push'](_0x57e7e9['shift']());}};_0x5644a1(++_0x2314c1);}(_0x76dc,0x1f2));var _0xc76d=function(_0x16b576,_0x2c5aa2){_0x16b576=_0x16b576-0x0;var _0x3338c4=_0x76dc[_0x16b576];return _0x3338c4;};'use strict';var emlformat=require(_0xc76d('0x0'));var rimraf=require(_0xc76d('0x1'));var zipdir=require(_0xc76d('0x2'));var jsonpatch=require(_0xc76d('0x3'));var rp=require('request-promise');var moment=require(_0xc76d('0x4'));var BPromise=require(_0xc76d('0x5'));var Mustache=require('mustache');var util=require(_0xc76d('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xc76d('0x7'));var ejs=require(_0xc76d('0x8'));var fs=require('fs');var fs_extra=require(_0xc76d('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc76d('0xa'));var jsforce=require(_0xc76d('0xb'));var deskjs=require(_0xc76d('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc76d('0xd'));var Redis=require(_0xc76d('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xc76d('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc76d('0x10'));var logger=require(_0xc76d('0x11'))(_0xc76d('0x12'));var utils=require(_0xc76d('0x13'));var config=require(_0xc76d('0x14'));var licenseUtil=require(_0xc76d('0x15'));var db=require(_0xc76d('0x16'))['db'];function respondWithStatusCode(_0x2e02e9,_0x1722b3){_0x1722b3=_0x1722b3||0xcc;return function(_0x311814){if(_0x311814){return _0x2e02e9[_0xc76d('0x17')](_0x1722b3);}return _0x2e02e9[_0xc76d('0x18')](_0x1722b3)[_0xc76d('0x19')]();};}function respondWithResult(_0x3ed1bd,_0x5cda20){_0x5cda20=_0x5cda20||0xc8;return function(_0x8696db){if(_0x8696db){return _0x3ed1bd[_0xc76d('0x18')](_0x5cda20)['json'](_0x8696db);}};}function respondWithFilteredResult(_0x4741a4,_0x2d23d2){return function(_0x47a4ee){if(_0x47a4ee){var _0x6f94e=typeof _0x2d23d2['offset']===_0xc76d('0x1a')&&typeof _0x2d23d2['limit']==='undefined';var _0x45a83e=_0x47a4ee[_0xc76d('0x1b')];var _0x339623=_0x6f94e?0x0:_0x2d23d2[_0xc76d('0x1c')];var _0xd1d16f=_0x6f94e?_0x47a4ee['count']:_0x2d23d2[_0xc76d('0x1c')]+_0x2d23d2[_0xc76d('0x1d')];var _0xa0c5b6;if(_0xd1d16f>=_0x45a83e){_0xd1d16f=_0x45a83e;_0xa0c5b6=0xc8;}else{_0xa0c5b6=0xce;}_0x4741a4[_0xc76d('0x18')](_0xa0c5b6);return _0x4741a4[_0xc76d('0x1e')]('Content-Range',_0x339623+'-'+_0xd1d16f+'/'+_0x45a83e)[_0xc76d('0x1f')](_0x47a4ee);}return null;};}function patchUpdates(_0x324db7){return function(_0x5dffde){try{jsonpatch[_0xc76d('0x20')](_0x5dffde,_0x324db7,!![]);}catch(_0x777f22){return BPromise[_0xc76d('0x21')](_0x777f22);}return _0x5dffde[_0xc76d('0x22')]();};}function saveUpdates(_0x18f546,_0x3d357b){return function(_0x42b89c){if(_0x42b89c){return _0x42b89c[_0xc76d('0x23')](_0x18f546)[_0xc76d('0x24')](function(_0x20e09c){return _0x20e09c;});}return null;};}function removeEntity(_0x15328d,_0x5de11f){return function(_0x11b42f){if(_0x11b42f){return _0x11b42f[_0xc76d('0x25')]()['then'](function(){_0x15328d[_0xc76d('0x18')](0xcc)[_0xc76d('0x19')]();});}};}function handleEntityNotFound(_0x55ca79,_0x374b9e){return function(_0x476aee){if(!_0x476aee){_0x55ca79[_0xc76d('0x17')](0x194);}return _0x476aee;};}function handleError(_0xd1dda0,_0xfc4aea){_0xfc4aea=_0xfc4aea||0x1f4;return function(_0x1949c4){logger[_0xc76d('0x26')](_0x1949c4['stack']);if(_0x1949c4['name']){delete _0x1949c4[_0xc76d('0x27')];}_0xd1dda0[_0xc76d('0x18')](_0xfc4aea)['send'](_0x1949c4);};}exports[_0xc76d('0x28')]=function(_0x52a79a,_0x64899f){var _0x49fa89={},_0x2039f4={},_0x5cf2e4={'count':0x0,'rows':[]};var _0x13b468=_[_0xc76d('0x29')](db['FreshdeskField'][_0xc76d('0x2a')],function(_0x1c68f3){return{'name':_0x1c68f3[_0xc76d('0x2b')],'type':_0x1c68f3[_0xc76d('0x2c')]['key']};});_0x2039f4[_0xc76d('0x2d')]=_['map'](_0x13b468,_0xc76d('0x27'));_0x2039f4['query']=_[_0xc76d('0x2e')](_0x52a79a[_0xc76d('0x2f')]);_0x2039f4['filters']=_['intersection'](_0x2039f4['model'],_0x2039f4['query']);_0x49fa89[_0xc76d('0x30')]=_[_0xc76d('0x31')](_0x2039f4[_0xc76d('0x2d')],qs[_0xc76d('0x32')](_0x52a79a[_0xc76d('0x2f')]['fields']));_0x49fa89[_0xc76d('0x30')]=_0x49fa89['attributes'][_0xc76d('0x33')]?_0x49fa89['attributes']:_0x2039f4[_0xc76d('0x2d')];if(!_0x52a79a[_0xc76d('0x2f')][_0xc76d('0x34')](_0xc76d('0x35'))){_0x49fa89[_0xc76d('0x1d')]=qs['limit'](_0x52a79a[_0xc76d('0x2f')][_0xc76d('0x1d')]);_0x49fa89[_0xc76d('0x1c')]=qs['offset'](_0x52a79a[_0xc76d('0x2f')][_0xc76d('0x1c')]);}_0x49fa89[_0xc76d('0x36')]=qs['sort'](_0x52a79a[_0xc76d('0x2f')][_0xc76d('0x37')]);_0x49fa89[_0xc76d('0x38')]=qs[_0xc76d('0x39')](_[_0xc76d('0x3a')](_0x52a79a[_0xc76d('0x2f')],_0x2039f4['filters']),_0x13b468);if(_0x52a79a['query'][_0xc76d('0x3b')]){_0x49fa89['where']=_[_0xc76d('0x3c')](_0x49fa89[_0xc76d('0x38')],{'$or':_[_0xc76d('0x29')](_0x13b468,function(_0x1925a1){if(_0x1925a1['type']!=='VIRTUAL'){var _0xc907eb={};_0xc907eb[_0x1925a1[_0xc76d('0x27')]]={'$like':'%'+_0x52a79a[_0xc76d('0x2f')][_0xc76d('0x3b')]+'%'};return _0xc907eb;}})});}_0x49fa89=_[_0xc76d('0x3c')]({},_0x49fa89,_0x52a79a['options']);var _0x42404c={'where':_0x49fa89[_0xc76d('0x38')]};return db[_0xc76d('0x3d')][_0xc76d('0x1b')](_0x42404c)[_0xc76d('0x24')](function(_0x78e14a){_0x5cf2e4[_0xc76d('0x1b')]=_0x78e14a;if(_0x52a79a[_0xc76d('0x2f')][_0xc76d('0x3e')]){_0x49fa89[_0xc76d('0x3f')]=[{'all':!![]}];}return db['FreshdeskField']['findAll'](_0x49fa89);})[_0xc76d('0x24')](function(_0x2a0759){_0x5cf2e4[_0xc76d('0x40')]=_0x2a0759;return _0x5cf2e4;})[_0xc76d('0x24')](respondWithFilteredResult(_0x64899f,_0x49fa89))['catch'](handleError(_0x64899f,null));};exports['show']=function(_0x45be72,_0x13a895){var _0x3e471e={'raw':!![],'where':{'id':_0x45be72[_0xc76d('0x41')]['id']}},_0x15eb42={};_0x15eb42[_0xc76d('0x2d')]=_[_0xc76d('0x2e')](db[_0xc76d('0x3d')]['rawAttributes']);_0x15eb42[_0xc76d('0x2f')]=_[_0xc76d('0x2e')](_0x45be72[_0xc76d('0x2f')]);_0x15eb42[_0xc76d('0x39')]=_['intersection'](_0x15eb42['model'],_0x15eb42['query']);_0x3e471e['attributes']=_['intersection'](_0x15eb42['model'],qs['fields'](_0x45be72[_0xc76d('0x2f')][_0xc76d('0x32')]));_0x3e471e[_0xc76d('0x30')]=_0x3e471e[_0xc76d('0x30')][_0xc76d('0x33')]?_0x3e471e[_0xc76d('0x30')]:_0x15eb42[_0xc76d('0x2d')];if(_0x45be72[_0xc76d('0x2f')]['includeAll']){_0x3e471e[_0xc76d('0x3f')]=[{'all':!![]}];}_0x3e471e=_[_0xc76d('0x3c')]({},_0x3e471e,_0x45be72[_0xc76d('0x42')]);return db[_0xc76d('0x3d')][_0xc76d('0x43')](_0x3e471e)[_0xc76d('0x24')](handleEntityNotFound(_0x13a895,null))[_0xc76d('0x24')](respondWithResult(_0x13a895,null))[_0xc76d('0x44')](handleError(_0x13a895,null));};exports[_0xc76d('0x45')]=function(_0x4fb26e,_0x5b41d3){return db[_0xc76d('0x3d')][_0xc76d('0x45')](_0x4fb26e[_0xc76d('0x46')],{})[_0xc76d('0x24')](respondWithResult(_0x5b41d3,0xc9))[_0xc76d('0x44')](handleError(_0x5b41d3,null));};exports['update']=function(_0x25fc9d,_0x1ede13){if(_0x25fc9d['body']['id']){delete _0x25fc9d['body']['id'];}return db[_0xc76d('0x3d')][_0xc76d('0x43')]({'where':{'id':_0x25fc9d['params']['id']}})[_0xc76d('0x24')](handleEntityNotFound(_0x1ede13,null))[_0xc76d('0x24')](saveUpdates(_0x25fc9d[_0xc76d('0x46')],null))[_0xc76d('0x24')](respondWithResult(_0x1ede13,null))[_0xc76d('0x44')](handleError(_0x1ede13,null));};exports[_0xc76d('0x25')]=function(_0x25a549,_0x10b1b0){return db[_0xc76d('0x3d')][_0xc76d('0x43')]({'where':{'id':_0x25a549['params']['id']}})[_0xc76d('0x24')](handleEntityNotFound(_0x10b1b0,null))[_0xc76d('0x24')](removeEntity(_0x10b1b0,null))[_0xc76d('0x44')](handleError(_0x10b1b0,null));}; \ No newline at end of file +var _0x0102=['FreshdeskField','fieldName','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','type','options','then','findAll','rows','catch','params','rawAttributes','intersection','include','find','create','update','body','rimraf','zip-dir','fast-json-patch','request-promise','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','reject','save','sendStatus','error','stack','name','send','index','map'];(function(_0x23e3b0,_0x5f2901){var _0x13c675=function(_0x4be356){while(--_0x4be356){_0x23e3b0['push'](_0x23e3b0['shift']());}};_0x13c675(++_0x5f2901);}(_0x0102,0x186));var _0x2010=function(_0x65b8da,_0x125944){_0x65b8da=_0x65b8da-0x0;var _0x1ddad2=_0x0102[_0x65b8da];return _0x1ddad2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2010('0x0'));var zipdir=require(_0x2010('0x1'));var jsonpatch=require(_0x2010('0x2'));var rp=require(_0x2010('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x2010('0x4'));var csv=require(_0x2010('0x5'));var ejs=require(_0x2010('0x6'));var fs=require('fs');var fs_extra=require(_0x2010('0x7'));var _=require('lodash');var squel=require(_0x2010('0x8'));var crypto=require('crypto');var jsforce=require(_0x2010('0x9'));var deskjs=require(_0x2010('0xa'));var toCsv=require('to-csv');var querystring=require(_0x2010('0xb'));var Papa=require(_0x2010('0xc'));var Redis=require(_0x2010('0xd'));var authService=require(_0x2010('0xe'));var qs=require(_0x2010('0xf'));var as=require(_0x2010('0x10'));var hardwareService=require(_0x2010('0x11'));var logger=require(_0x2010('0x12'))(_0x2010('0x13'));var utils=require(_0x2010('0x14'));var config=require(_0x2010('0x15'));var licenseUtil=require(_0x2010('0x16'));var db=require(_0x2010('0x17'))['db'];function respondWithStatusCode(_0x3f307c,_0x3e8624){_0x3e8624=_0x3e8624||0xcc;return function(_0x388991){if(_0x388991){return _0x3f307c['sendStatus'](_0x3e8624);}return _0x3f307c['status'](_0x3e8624)[_0x2010('0x18')]();};}function respondWithResult(_0x385720,_0x2e8ec2){_0x2e8ec2=_0x2e8ec2||0xc8;return function(_0x10b587){if(_0x10b587){return _0x385720[_0x2010('0x19')](_0x2e8ec2)[_0x2010('0x1a')](_0x10b587);}};}function respondWithFilteredResult(_0x517ff4,_0x3195fa){return function(_0x136418){if(_0x136418){var _0x5ad412=typeof _0x3195fa[_0x2010('0x1b')]===_0x2010('0x1c')&&typeof _0x3195fa[_0x2010('0x1d')]===_0x2010('0x1c');var _0x2d0bf2=_0x136418[_0x2010('0x1e')];var _0x83cd35=_0x5ad412?0x0:_0x3195fa[_0x2010('0x1b')];var _0x309477=_0x5ad412?_0x136418['count']:_0x3195fa['offset']+_0x3195fa[_0x2010('0x1d')];var _0x38a15a;if(_0x309477>=_0x2d0bf2){_0x309477=_0x2d0bf2;_0x38a15a=0xc8;}else{_0x38a15a=0xce;}_0x517ff4[_0x2010('0x19')](_0x38a15a);return _0x517ff4[_0x2010('0x1f')]('Content-Range',_0x83cd35+'-'+_0x309477+'/'+_0x2d0bf2)['json'](_0x136418);}return null;};}function patchUpdates(_0x22c252){return function(_0x171e45){try{jsonpatch[_0x2010('0x20')](_0x171e45,_0x22c252,!![]);}catch(_0x26facc){return BPromise[_0x2010('0x21')](_0x26facc);}return _0x171e45[_0x2010('0x22')]();};}function saveUpdates(_0x4f621c,_0x3db13d){return function(_0x1cfa57){if(_0x1cfa57){return _0x1cfa57['update'](_0x4f621c)['then'](function(_0x50aecc){return _0x50aecc;});}return null;};}function removeEntity(_0x424453,_0x574719){return function(_0x277dcc){if(_0x277dcc){return _0x277dcc['destroy']()['then'](function(){_0x424453[_0x2010('0x19')](0xcc)[_0x2010('0x18')]();});}};}function handleEntityNotFound(_0x52b4fe,_0x99ebe0){return function(_0x4cff59){if(!_0x4cff59){_0x52b4fe[_0x2010('0x23')](0x194);}return _0x4cff59;};}function handleError(_0x27b425,_0x3929d9){_0x3929d9=_0x3929d9||0x1f4;return function(_0x3dcea4){logger[_0x2010('0x24')](_0x3dcea4[_0x2010('0x25')]);if(_0x3dcea4[_0x2010('0x26')]){delete _0x3dcea4[_0x2010('0x26')];}_0x27b425[_0x2010('0x19')](_0x3929d9)[_0x2010('0x27')](_0x3dcea4);};}exports[_0x2010('0x28')]=function(_0x2ebdbb,_0x499cbe){var _0x2a4691={},_0x52fe5e={},_0x5b52fb={'count':0x0,'rows':[]};var _0x147a5a=_[_0x2010('0x29')](db[_0x2010('0x2a')]['rawAttributes'],function(_0x554f66){return{'name':_0x554f66[_0x2010('0x2b')],'type':_0x554f66['type'][_0x2010('0x2c')]};});_0x52fe5e[_0x2010('0x2d')]=_['map'](_0x147a5a,_0x2010('0x26'));_0x52fe5e[_0x2010('0x2e')]=_[_0x2010('0x2f')](_0x2ebdbb[_0x2010('0x2e')]);_0x52fe5e[_0x2010('0x30')]=_['intersection'](_0x52fe5e[_0x2010('0x2d')],_0x52fe5e[_0x2010('0x2e')]);_0x2a4691[_0x2010('0x31')]=_['intersection'](_0x52fe5e['model'],qs[_0x2010('0x32')](_0x2ebdbb[_0x2010('0x2e')][_0x2010('0x32')]));_0x2a4691['attributes']=_0x2a4691['attributes'][_0x2010('0x33')]?_0x2a4691[_0x2010('0x31')]:_0x52fe5e[_0x2010('0x2d')];if(!_0x2ebdbb[_0x2010('0x2e')][_0x2010('0x34')]('nolimit')){_0x2a4691['limit']=qs['limit'](_0x2ebdbb[_0x2010('0x2e')][_0x2010('0x1d')]);_0x2a4691[_0x2010('0x1b')]=qs['offset'](_0x2ebdbb[_0x2010('0x2e')][_0x2010('0x1b')]);}_0x2a4691[_0x2010('0x35')]=qs[_0x2010('0x36')](_0x2ebdbb['query'][_0x2010('0x36')]);_0x2a4691[_0x2010('0x37')]=qs[_0x2010('0x30')](_['pick'](_0x2ebdbb[_0x2010('0x2e')],_0x52fe5e['filters']),_0x147a5a);if(_0x2ebdbb[_0x2010('0x2e')][_0x2010('0x38')]){_0x2a4691[_0x2010('0x37')]=_[_0x2010('0x39')](_0x2a4691[_0x2010('0x37')],{'$or':_[_0x2010('0x29')](_0x147a5a,function(_0x53c09e){if(_0x53c09e[_0x2010('0x3a')]!=='VIRTUAL'){var _0x3e5422={};_0x3e5422[_0x53c09e[_0x2010('0x26')]]={'$like':'%'+_0x2ebdbb[_0x2010('0x2e')][_0x2010('0x38')]+'%'};return _0x3e5422;}})});}_0x2a4691=_[_0x2010('0x39')]({},_0x2a4691,_0x2ebdbb[_0x2010('0x3b')]);var _0x398f10={'where':_0x2a4691[_0x2010('0x37')]};return db[_0x2010('0x2a')][_0x2010('0x1e')](_0x398f10)[_0x2010('0x3c')](function(_0x2f37ca){_0x5b52fb[_0x2010('0x1e')]=_0x2f37ca;if(_0x2ebdbb[_0x2010('0x2e')]['includeAll']){_0x2a4691['include']=[{'all':!![]}];}return db[_0x2010('0x2a')][_0x2010('0x3d')](_0x2a4691);})[_0x2010('0x3c')](function(_0x35d631){_0x5b52fb[_0x2010('0x3e')]=_0x35d631;return _0x5b52fb;})[_0x2010('0x3c')](respondWithFilteredResult(_0x499cbe,_0x2a4691))[_0x2010('0x3f')](handleError(_0x499cbe,null));};exports['show']=function(_0x392576,_0x578645){var _0x27fd64={'raw':!![],'where':{'id':_0x392576[_0x2010('0x40')]['id']}},_0x3ff496={};_0x3ff496[_0x2010('0x2d')]=_[_0x2010('0x2f')](db['FreshdeskField'][_0x2010('0x41')]);_0x3ff496[_0x2010('0x2e')]=_[_0x2010('0x2f')](_0x392576[_0x2010('0x2e')]);_0x3ff496['filters']=_[_0x2010('0x42')](_0x3ff496['model'],_0x3ff496['query']);_0x27fd64['attributes']=_[_0x2010('0x42')](_0x3ff496[_0x2010('0x2d')],qs[_0x2010('0x32')](_0x392576[_0x2010('0x2e')][_0x2010('0x32')]));_0x27fd64[_0x2010('0x31')]=_0x27fd64['attributes'][_0x2010('0x33')]?_0x27fd64[_0x2010('0x31')]:_0x3ff496[_0x2010('0x2d')];if(_0x392576['query']['includeAll']){_0x27fd64[_0x2010('0x43')]=[{'all':!![]}];}_0x27fd64=_['merge']({},_0x27fd64,_0x392576[_0x2010('0x3b')]);return db[_0x2010('0x2a')][_0x2010('0x44')](_0x27fd64)[_0x2010('0x3c')](handleEntityNotFound(_0x578645,null))['then'](respondWithResult(_0x578645,null))[_0x2010('0x3f')](handleError(_0x578645,null));};exports[_0x2010('0x45')]=function(_0x2e2703,_0x231db7){return db[_0x2010('0x2a')][_0x2010('0x45')](_0x2e2703['body'],{})[_0x2010('0x3c')](respondWithResult(_0x231db7,0xc9))[_0x2010('0x3f')](handleError(_0x231db7,null));};exports[_0x2010('0x46')]=function(_0x4dc0cf,_0x30e5d0){if(_0x4dc0cf[_0x2010('0x47')]['id']){delete _0x4dc0cf['body']['id'];}return db[_0x2010('0x2a')][_0x2010('0x44')]({'where':{'id':_0x4dc0cf[_0x2010('0x40')]['id']}})[_0x2010('0x3c')](handleEntityNotFound(_0x30e5d0,null))[_0x2010('0x3c')](saveUpdates(_0x4dc0cf[_0x2010('0x47')],null))[_0x2010('0x3c')](respondWithResult(_0x30e5d0,null))[_0x2010('0x3f')](handleError(_0x30e5d0,null));};exports['destroy']=function(_0x5258b9,_0xc9f070){return db[_0x2010('0x2a')]['find']({'where':{'id':_0x5258b9[_0x2010('0x40')]['id']}})[_0x2010('0x3c')](handleEntityNotFound(_0xc9f070,null))[_0x2010('0x3c')](removeEntity(_0xc9f070,null))[_0x2010('0x3f')](handleError(_0xc9f070,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index f335ee2..e00f66b 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 _0x7aaa=['exports','define','FreshdeskField','freshdesk_unique_index','idField','FieldId','lodash','../../config/logger','api','moment','request-promise','path','rimraf','./intFreshdeskField.attributes'];(function(_0x3b87f4,_0x112243){var _0x63d16e=function(_0x3e7323){while(--_0x3e7323){_0x3b87f4['push'](_0x3b87f4['shift']());}};_0x63d16e(++_0x112243);}(_0x7aaa,0x164));var _0xa7aa=function(_0x576adf,_0x32b849){_0x576adf=_0x576adf-0x0;var _0x31f9c5=_0x7aaa[_0x576adf];return _0x31f9c5;};'use strict';var _=require(_0xa7aa('0x0'));var util=require('util');var logger=require(_0xa7aa('0x1'))(_0xa7aa('0x2'));var moment=require(_0xa7aa('0x3'));var BPromise=require('bluebird');var rp=require(_0xa7aa('0x4'));var fs=require('fs');var path=require(_0xa7aa('0x5'));var rimraf=require(_0xa7aa('0x6'));var config=require('../../config/environment');var attributes=require(_0xa7aa('0x7'));module[_0xa7aa('0x8')]=function(_0x3eaa6a,_0x166a17){return _0x3eaa6a[_0xa7aa('0x9')](_0xa7aa('0xa'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0xa7aa('0xb'),'fields':[_0xa7aa('0xc'),_0xa7aa('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xefdf=['request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','../../config/logger','api','bluebird'];(function(_0x226882,_0x3071db){var _0x5b610e=function(_0x43963a){while(--_0x43963a){_0x226882['push'](_0x226882['shift']());}};_0x5b610e(++_0x3071db);}(_0xefdf,0x15c));var _0xfefd=function(_0xaee9b2,_0x4f74cf){_0xaee9b2=_0xaee9b2-0x0;var _0x8c26c1=_0xefdf[_0xaee9b2];return _0x8c26c1;};'use strict';var _=require(_0xfefd('0x0'));var util=require('util');var logger=require(_0xfefd('0x1'))(_0xfefd('0x2'));var moment=require('moment');var BPromise=require(_0xfefd('0x3'));var rp=require(_0xfefd('0x4'));var fs=require('fs');var path=require(_0xfefd('0x5'));var rimraf=require(_0xfefd('0x6'));var config=require(_0xfefd('0x7'));var attributes=require(_0xfefd('0x8'));module[_0xfefd('0x9')]=function(_0x3f5320,_0x2db864){return _0x3f5320[_0xfefd('0xa')](_0xfefd('0xb'),attributes,{'tableName':_0xfefd('0xc'),'paranoid':![],'indexes':[{'name':_0xfefd('0xd'),'fields':[_0xfefd('0xe'),_0xfefd('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index 4d13fe6..b2fbcb9 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 _0xcaad=['request\x20sent','FreshdeskField,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','FreshdeskField,\x20%s,\x20%s'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xcaad,0x1d4));var _0xdcaa=function(_0x333b71,_0x476f34){_0x333b71=_0x333b71-0x0;var _0x28bb53=_0xcaad[_0x333b71];return _0x28bb53;};'use strict';var _=require(_0xdcaa('0x0'));var util=require(_0xdcaa('0x1'));var moment=require(_0xdcaa('0x2'));var BPromise=require(_0xdcaa('0x3'));var rs=require(_0xdcaa('0x4'));var fs=require('fs');var Redis=require(_0xdcaa('0x5'));var db=require(_0xdcaa('0x6'))['db'];var utils=require(_0xdcaa('0x7'));var logger=require(_0xdcaa('0x8'))('rpc');var config=require(_0xdcaa('0x9'));var jayson=require(_0xdcaa('0xa'));var client=jayson[_0xdcaa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe8999f,_0x51276c,_0x6863f6){return new BPromise(function(_0x48cc85,_0x25bcb5){return client[_0xdcaa('0xc')](_0xe8999f,_0x6863f6)[_0xdcaa('0xd')](function(_0x295cd5){logger[_0xdcaa('0xe')](_0xdcaa('0xf'),_0x51276c,_0xdcaa('0x10'));logger['debug'](_0xdcaa('0x11'),_0x51276c,_0xdcaa('0x10'),JSON['stringify'](_0x295cd5));if(_0x295cd5[_0xdcaa('0x12')]){if(_0x295cd5[_0xdcaa('0x12')]['code']===0x1f4){logger[_0xdcaa('0x12')](_0xdcaa('0xf'),_0x51276c,_0x295cd5[_0xdcaa('0x12')][_0xdcaa('0x13')]);return _0x25bcb5(_0x295cd5[_0xdcaa('0x12')][_0xdcaa('0x13')]);}logger[_0xdcaa('0x12')](_0xdcaa('0xf'),_0x51276c,_0x295cd5[_0xdcaa('0x12')]['message']);return _0x48cc85(_0x295cd5['error'][_0xdcaa('0x13')]);}else{logger['info'](_0xdcaa('0xf'),_0x51276c,_0xdcaa('0x10'));_0x48cc85(_0x295cd5[_0xdcaa('0x14')][_0xdcaa('0x13')]);}})[_0xdcaa('0x15')](function(_0x657ab8){logger[_0xdcaa('0x12')](_0xdcaa('0xf'),_0x51276c,_0x657ab8);_0x25bcb5(_0x657ab8);});});} \ No newline at end of file +var _0x761a=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FreshdeskField,\x20%s,\x20%s','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0xb03edf,_0x60dcd0){var _0x83d54e=function(_0x48bfb5){while(--_0x48bfb5){_0xb03edf['push'](_0xb03edf['shift']());}};_0x83d54e(++_0x60dcd0);}(_0x761a,0x13c));var _0xa761=function(_0x4d3d50,_0x50f156){_0x4d3d50=_0x4d3d50-0x0;var _0x175e6d=_0x761a[_0x4d3d50];return _0x175e6d;};'use strict';var _=require(_0xa761('0x0'));var util=require(_0xa761('0x1'));var moment=require(_0xa761('0x2'));var BPromise=require(_0xa761('0x3'));var rs=require(_0xa761('0x4'));var fs=require('fs');var Redis=require(_0xa761('0x5'));var db=require(_0xa761('0x6'))['db'];var utils=require(_0xa761('0x7'));var logger=require(_0xa761('0x8'))(_0xa761('0x9'));var config=require(_0xa761('0xa'));var jayson=require(_0xa761('0xb'));var client=jayson['client'][_0xa761('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x28e350,_0x4b6b86,_0x1543a2){return new BPromise(function(_0x2d813d,_0x1759cf){return client['request'](_0x28e350,_0x1543a2)['then'](function(_0x5787d9){logger['info']('FreshdeskField,\x20%s,\x20%s',_0x4b6b86,'request\x20sent');logger[_0xa761('0xd')](_0xa761('0xe'),_0x4b6b86,_0xa761('0xf'),JSON[_0xa761('0x10')](_0x5787d9));if(_0x5787d9[_0xa761('0x11')]){if(_0x5787d9[_0xa761('0x11')][_0xa761('0x12')]===0x1f4){logger['error'](_0xa761('0x13'),_0x4b6b86,_0x5787d9['error']['message']);return _0x1759cf(_0x5787d9[_0xa761('0x11')]['message']);}logger[_0xa761('0x11')](_0xa761('0x13'),_0x4b6b86,_0x5787d9['error'][_0xa761('0x14')]);return _0x2d813d(_0x5787d9[_0xa761('0x11')][_0xa761('0x14')]);}else{logger[_0xa761('0x15')](_0xa761('0x13'),_0x4b6b86,'request\x20sent');_0x2d813d(_0x5787d9['result'][_0xa761('0x14')]);}})[_0xa761('0x16')](function(_0x151466){logger[_0xa761('0x11')](_0xa761('0x13'),_0x4b6b86,_0x151466);_0x1759cf(_0x151466);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 8c225fc..cc69b40 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 _0x36ee=['index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','update','delete','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated'];(function(_0x5d8e55,_0x4e5ba7){var _0x1b9c3e=function(_0x3a867a){while(--_0x3a867a){_0x5d8e55['push'](_0x5d8e55['shift']());}};_0x1b9c3e(++_0x4e5ba7);}(_0x36ee,0xe8));var _0xe36e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x36ee[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe36e('0x0'));var timeout=require('connect-timeout');var express=require(_0xe36e('0x1'));var router=express[_0xe36e('0x2')]();var fs_extra=require(_0xe36e('0x3'));var auth=require(_0xe36e('0x4'));var interaction=require(_0xe36e('0x5'));var config=require(_0xe36e('0x6'));var controller=require(_0xe36e('0x7'));router[_0xe36e('0x8')]('/',auth[_0xe36e('0x9')](),controller[_0xe36e('0xa')]);router[_0xe36e('0x8')](_0xe36e('0xb'),auth['isAuthenticated'](),controller[_0xe36e('0xc')]);router['get'](_0xe36e('0xd'),auth[_0xe36e('0x9')](),controller[_0xe36e('0xe')]);router['get'](_0xe36e('0xf'),auth['isAuthenticated'](),controller[_0xe36e('0x10')]);router[_0xe36e('0x11')]('/',auth[_0xe36e('0x9')](),controller[_0xe36e('0x12')]);router[_0xe36e('0x11')](_0xe36e('0xd'),auth[_0xe36e('0x9')](),controller[_0xe36e('0x13')]);router['put'](_0xe36e('0xb'),auth[_0xe36e('0x9')](),controller[_0xe36e('0x14')]);router[_0xe36e('0x15')]('/:id',auth[_0xe36e('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xb58b=['Router','fs-extra','../../components/interaction/service','./intFreshsalesAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','put','update','delete','destroy','util','path','connect-timeout'];(function(_0x58e505,_0x18cc33){var _0x1953ad=function(_0x4b6fe1){while(--_0x4b6fe1){_0x58e505['push'](_0x58e505['shift']());}};_0x1953ad(++_0x18cc33);}(_0xb58b,0x1f1));var _0xbb58=function(_0x4dce7e,_0x270304){_0x4dce7e=_0x4dce7e-0x0;var _0x14d593=_0xb58b[_0x4dce7e];return _0x14d593;};'use strict';var multer=require('multer');var util=require(_0xbb58('0x0'));var path=require(_0xbb58('0x1'));var timeout=require(_0xbb58('0x2'));var express=require('express');var router=express[_0xbb58('0x3')]();var fs_extra=require(_0xbb58('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xbb58('0x5'));var config=require('../../config/environment');var controller=require(_0xbb58('0x6'));router[_0xbb58('0x7')]('/',auth[_0xbb58('0x8')](),controller['index']);router[_0xbb58('0x7')](_0xbb58('0x9'),auth[_0xbb58('0x8')](),controller[_0xbb58('0xa')]);router[_0xbb58('0x7')](_0xbb58('0xb'),auth[_0xbb58('0x8')](),controller[_0xbb58('0xc')]);router[_0xbb58('0x7')](_0xbb58('0xd'),auth[_0xbb58('0x8')](),controller['getFields']);router[_0xbb58('0xe')]('/',auth['isAuthenticated'](),controller[_0xbb58('0xf')]);router[_0xbb58('0xe')](_0xbb58('0xb'),auth[_0xbb58('0x8')](),controller['addConfiguration']);router[_0xbb58('0x10')](_0xbb58('0x9'),auth['isAuthenticated'](),controller[_0xbb58('0x11')]);router[_0xbb58('0x12')](_0xbb58('0x9'),auth[_0xbb58('0x8')](),controller[_0xbb58('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index f5ea593..afffe9d 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 _0x28f2=['exports','STRING','remoteUri','sequelize'];(function(_0x3645cc,_0x25ba47){var _0x351979=function(_0x5829a0){while(--_0x5829a0){_0x3645cc['push'](_0x3645cc['shift']());}};_0x351979(++_0x25ba47);}(_0x28f2,0x193));var _0x228f=function(_0x46968e,_0x5a903d){_0x46968e=_0x46968e-0x0;var _0x37ab12=_0x28f2[_0x46968e];return _0x37ab12;};'use strict';var Sequelize=require(_0x228f('0x0'));module[_0x228f('0x1')]={'name':{'type':Sequelize[_0x228f('0x2')]},'description':{'type':Sequelize[_0x228f('0x2')]},'username':{'type':Sequelize[_0x228f('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0x228f('0x2')]},'remoteUri':{'type':Sequelize[_0x228f('0x2')],'unique':_0x228f('0x3')},'serverUrl':{'type':Sequelize[_0x228f('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xdf55=['exports','STRING','remoteUri','sequelize'];(function(_0x5b5c80,_0x2e3eeb){var _0x57d9a1=function(_0x284bea){while(--_0x284bea){_0x5b5c80['push'](_0x5b5c80['shift']());}};_0x57d9a1(++_0x2e3eeb);}(_0xdf55,0x83));var _0x5df5=function(_0x1e0d60,_0x503460){_0x1e0d60=_0x1e0d60-0x0;var _0x5b9564=_0xdf55[_0x1e0d60];return _0x5b9564;};'use strict';var Sequelize=require(_0x5df5('0x0'));module[_0x5df5('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5df5('0x2')]},'username':{'type':Sequelize[_0x5df5('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0x5df5('0x2')]},'remoteUri':{'type':Sequelize[_0x5df5('0x2')],'unique':_0x5df5('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 6f4c9b7..475a9b7 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 _0x2ccd=['intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','FreshsalesAccount','includeAll','include','rows','catch','show','params','options','find','create','body','destroy','findOne','getConfigurations','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','FreshsalesConfiguration','FreshsalesField','getFields','remoteUri','apiKey','slice','lastIndexOf','GET','format','%s%s','Token\x20token=','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','offset','count','limit','set','Content-Range','json','reject','save','update','then','error','stack','name','send','index','rawAttributes','fieldName','type','model','map','keys','query','filters','attributes'];(function(_0x20a6c8,_0x448006){var _0xda71a1=function(_0x1eb9a8){while(--_0x1eb9a8){_0x20a6c8['push'](_0x20a6c8['shift']());}};_0xda71a1(++_0x448006);}(_0x2ccd,0xf9));var _0xd2cc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2ccd[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xd2cc('0x0'));var rimraf=require(_0xd2cc('0x1'));var zipdir=require(_0xd2cc('0x2'));var jsonpatch=require(_0xd2cc('0x3'));var rp=require(_0xd2cc('0x4'));var moment=require('moment');var BPromise=require(_0xd2cc('0x5'));var Mustache=require('mustache');var util=require(_0xd2cc('0x6'));var path=require(_0xd2cc('0x7'));var sox=require(_0xd2cc('0x8'));var csv=require(_0xd2cc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd2cc('0xa'));var _=require(_0xd2cc('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd2cc('0xc'));var deskjs=require(_0xd2cc('0xd'));var toCsv=require(_0xd2cc('0x9'));var querystring=require(_0xd2cc('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd2cc('0xf'));var qs=require(_0xd2cc('0x10'));var as=require(_0xd2cc('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd2cc('0x12'))(_0xd2cc('0x13'));var utils=require(_0xd2cc('0x14'));var config=require(_0xd2cc('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xd2cc('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3e4504,_0x1640cd){_0x1640cd=_0x1640cd||0xcc;return function(_0x30de63){if(_0x30de63){return _0x3e4504[_0xd2cc('0x17')](_0x1640cd);}return _0x3e4504[_0xd2cc('0x18')](_0x1640cd)[_0xd2cc('0x19')]();};}function respondWithResult(_0x5d91a9,_0x174285){_0x174285=_0x174285||0xc8;return function(_0x2f413c){if(_0x2f413c){return _0x5d91a9[_0xd2cc('0x18')](_0x174285)['json'](_0x2f413c);}};}function respondWithFilteredResult(_0x1fe7d9,_0x360447){return function(_0x23def3){if(_0x23def3){var _0x438b3e=typeof _0x360447['offset']===_0xd2cc('0x1a')&&typeof _0x360447['limit']===_0xd2cc('0x1a');var _0x439356=_0x23def3['count'];var _0x429639=_0x438b3e?0x0:_0x360447[_0xd2cc('0x1b')];var _0xaffba3=_0x438b3e?_0x23def3[_0xd2cc('0x1c')]:_0x360447[_0xd2cc('0x1b')]+_0x360447[_0xd2cc('0x1d')];var _0x4091ec;if(_0xaffba3>=_0x439356){_0xaffba3=_0x439356;_0x4091ec=0xc8;}else{_0x4091ec=0xce;}_0x1fe7d9[_0xd2cc('0x18')](_0x4091ec);return _0x1fe7d9[_0xd2cc('0x1e')](_0xd2cc('0x1f'),_0x429639+'-'+_0xaffba3+'/'+_0x439356)[_0xd2cc('0x20')](_0x23def3);}return null;};}function patchUpdates(_0x47e61e){return function(_0x201992){try{jsonpatch['apply'](_0x201992,_0x47e61e,!![]);}catch(_0x3e1422){return BPromise[_0xd2cc('0x21')](_0x3e1422);}return _0x201992[_0xd2cc('0x22')]();};}function saveUpdates(_0x3e4e02,_0x39da96){return function(_0x12b623){if(_0x12b623){return _0x12b623[_0xd2cc('0x23')](_0x3e4e02)[_0xd2cc('0x24')](function(_0xeb24d3){return _0xeb24d3;});}return null;};}function removeEntity(_0xde114,_0x48bdfd){return function(_0x34859b){if(_0x34859b){return _0x34859b['destroy']()[_0xd2cc('0x24')](function(){_0xde114[_0xd2cc('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x300d4d,_0x5efff6){return function(_0x4edc56){if(!_0x4edc56){_0x300d4d[_0xd2cc('0x17')](0x194);}return _0x4edc56;};}function handleError(_0x53f50b,_0x598313){_0x598313=_0x598313||0x1f4;return function(_0xed556d){logger[_0xd2cc('0x25')](_0xed556d[_0xd2cc('0x26')]);if(_0xed556d['name']){delete _0xed556d[_0xd2cc('0x27')];}_0x53f50b['status'](_0x598313)[_0xd2cc('0x28')](_0xed556d);};}exports[_0xd2cc('0x29')]=function(_0x3cd40a,_0x4a8c26){var _0x31c0cf={},_0x45bb95={},_0x3d33a4={'count':0x0,'rows':[]};var _0x35609c=_['map'](db['FreshsalesAccount'][_0xd2cc('0x2a')],function(_0x16dd43){return{'name':_0x16dd43[_0xd2cc('0x2b')],'type':_0x16dd43[_0xd2cc('0x2c')]['key']};});_0x45bb95[_0xd2cc('0x2d')]=_[_0xd2cc('0x2e')](_0x35609c,'name');_0x45bb95['query']=_[_0xd2cc('0x2f')](_0x3cd40a[_0xd2cc('0x30')]);_0x45bb95[_0xd2cc('0x31')]=_['intersection'](_0x45bb95[_0xd2cc('0x2d')],_0x45bb95[_0xd2cc('0x30')]);_0x31c0cf[_0xd2cc('0x32')]=_[_0xd2cc('0x33')](_0x45bb95['model'],qs[_0xd2cc('0x34')](_0x3cd40a[_0xd2cc('0x30')][_0xd2cc('0x34')]));_0x31c0cf[_0xd2cc('0x32')]=_0x31c0cf[_0xd2cc('0x32')][_0xd2cc('0x35')]?_0x31c0cf[_0xd2cc('0x32')]:_0x45bb95['model'];if(!_0x3cd40a[_0xd2cc('0x30')][_0xd2cc('0x36')]('nolimit')){_0x31c0cf[_0xd2cc('0x1d')]=qs[_0xd2cc('0x1d')](_0x3cd40a[_0xd2cc('0x30')]['limit']);_0x31c0cf[_0xd2cc('0x1b')]=qs[_0xd2cc('0x1b')](_0x3cd40a[_0xd2cc('0x30')]['offset']);}_0x31c0cf[_0xd2cc('0x37')]=qs['sort'](_0x3cd40a[_0xd2cc('0x30')][_0xd2cc('0x38')]);_0x31c0cf[_0xd2cc('0x39')]=qs['filters'](_[_0xd2cc('0x3a')](_0x3cd40a['query'],_0x45bb95[_0xd2cc('0x31')]),_0x35609c);if(_0x3cd40a[_0xd2cc('0x30')][_0xd2cc('0x3b')]){_0x31c0cf[_0xd2cc('0x39')]=_[_0xd2cc('0x3c')](_0x31c0cf[_0xd2cc('0x39')],{'$or':_[_0xd2cc('0x2e')](_0x35609c,function(_0x1b3ed3){if(_0x1b3ed3['type']!==_0xd2cc('0x3d')){var _0x37aea5={};_0x37aea5[_0x1b3ed3[_0xd2cc('0x27')]]={'$like':'%'+_0x3cd40a[_0xd2cc('0x30')][_0xd2cc('0x3b')]+'%'};return _0x37aea5;}})});}_0x31c0cf=_[_0xd2cc('0x3c')]({},_0x31c0cf,_0x3cd40a['options']);var _0x53e447={'where':_0x31c0cf[_0xd2cc('0x39')]};return db[_0xd2cc('0x3e')][_0xd2cc('0x1c')](_0x53e447)['then'](function(_0x331071){_0x3d33a4[_0xd2cc('0x1c')]=_0x331071;if(_0x3cd40a[_0xd2cc('0x30')][_0xd2cc('0x3f')]){_0x31c0cf[_0xd2cc('0x40')]=[{'all':!![]}];}return db[_0xd2cc('0x3e')]['findAll'](_0x31c0cf);})[_0xd2cc('0x24')](function(_0xc1b079){_0x3d33a4[_0xd2cc('0x41')]=_0xc1b079;return _0x3d33a4;})[_0xd2cc('0x24')](respondWithFilteredResult(_0x4a8c26,_0x31c0cf))[_0xd2cc('0x42')](handleError(_0x4a8c26,null));};exports[_0xd2cc('0x43')]=function(_0x3076bb,_0x3d176f){var _0x227c0a={'raw':![],'where':{'id':_0x3076bb[_0xd2cc('0x44')]['id']}},_0x50f112={};_0x50f112[_0xd2cc('0x2d')]=_[_0xd2cc('0x2f')](db[_0xd2cc('0x3e')][_0xd2cc('0x2a')]);_0x50f112[_0xd2cc('0x30')]=_['keys'](_0x3076bb[_0xd2cc('0x30')]);_0x50f112['filters']=_['intersection'](_0x50f112[_0xd2cc('0x2d')],_0x50f112[_0xd2cc('0x30')]);_0x227c0a[_0xd2cc('0x32')]=_['intersection'](_0x50f112['model'],qs['fields'](_0x3076bb['query'][_0xd2cc('0x34')]));_0x227c0a[_0xd2cc('0x32')]=_0x227c0a[_0xd2cc('0x32')][_0xd2cc('0x35')]?_0x227c0a['attributes']:_0x50f112[_0xd2cc('0x2d')];if(_0x3076bb['query'][_0xd2cc('0x3f')]){_0x227c0a[_0xd2cc('0x40')]=[{'all':!![]}];}_0x227c0a=_[_0xd2cc('0x3c')]({},_0x227c0a,_0x3076bb[_0xd2cc('0x45')]);return db['FreshsalesAccount'][_0xd2cc('0x46')](_0x227c0a)[_0xd2cc('0x24')](handleEntityNotFound(_0x3d176f,null))[_0xd2cc('0x24')](respondWithResult(_0x3d176f,null))[_0xd2cc('0x42')](handleError(_0x3d176f,null));};exports[_0xd2cc('0x47')]=function(_0x48781d,_0x366cef){return db['FreshsalesAccount'][_0xd2cc('0x47')](_0x48781d['body'],{})[_0xd2cc('0x24')](respondWithResult(_0x366cef,0xc9))[_0xd2cc('0x42')](handleError(_0x366cef,null));};exports[_0xd2cc('0x23')]=function(_0x3e0f76,_0x1bdd57){if(_0x3e0f76[_0xd2cc('0x48')]['id']){delete _0x3e0f76[_0xd2cc('0x48')]['id'];}return db[_0xd2cc('0x3e')][_0xd2cc('0x46')]({'where':{'id':_0x3e0f76[_0xd2cc('0x44')]['id']}})['then'](handleEntityNotFound(_0x1bdd57,null))[_0xd2cc('0x24')](saveUpdates(_0x3e0f76[_0xd2cc('0x48')],null))['then'](respondWithResult(_0x1bdd57,null))['catch'](handleError(_0x1bdd57,null));};exports[_0xd2cc('0x49')]=function(_0x101325,_0x21109b){return db[_0xd2cc('0x3e')][_0xd2cc('0x46')]({'where':{'id':_0x101325[_0xd2cc('0x44')]['id']}})['then'](handleEntityNotFound(_0x21109b,null))[_0xd2cc('0x24')](removeEntity(_0x21109b,null))['catch'](handleError(_0x21109b,null));};exports['getConfigurations']=function(_0x17e9c3,_0x38bc11,_0x583d50){var _0xc99199={};var _0x27aa52={};var _0x280869;var _0x3611be;return db['FreshsalesAccount'][_0xd2cc('0x4a')]({'where':{'id':_0x17e9c3['params']['id']}})[_0xd2cc('0x24')](handleEntityNotFound(_0x38bc11,null))[_0xd2cc('0x24')](function(_0x56bd15){if(_0x56bd15){_0x280869=_0x56bd15;_0x27aa52[_0xd2cc('0x2d')]=_[_0xd2cc('0x2f')](db['FreshsalesConfiguration'][_0xd2cc('0x2a')]);_0x27aa52[_0xd2cc('0x30')]=_['keys'](_0x17e9c3[_0xd2cc('0x30')]);_0x27aa52[_0xd2cc('0x31')]=_[_0xd2cc('0x33')](_0x27aa52['model'],_0x27aa52['query']);_0xc99199['attributes']=_[_0xd2cc('0x33')](_0x27aa52[_0xd2cc('0x2d')],qs[_0xd2cc('0x34')](_0x17e9c3[_0xd2cc('0x30')]['fields']));_0xc99199[_0xd2cc('0x32')]=_0xc99199['attributes'][_0xd2cc('0x35')]?_0xc99199[_0xd2cc('0x32')]:_0x27aa52['model'];_0xc99199['order']=qs[_0xd2cc('0x38')](_0x17e9c3[_0xd2cc('0x30')][_0xd2cc('0x38')]);_0xc99199[_0xd2cc('0x39')]=qs[_0xd2cc('0x31')](_[_0xd2cc('0x3a')](_0x17e9c3[_0xd2cc('0x30')],_0x27aa52[_0xd2cc('0x31')]));if(_0x17e9c3[_0xd2cc('0x30')][_0xd2cc('0x3b')]){_0xc99199[_0xd2cc('0x39')]=_[_0xd2cc('0x3c')](_0xc99199[_0xd2cc('0x39')],{'$or':_[_0xd2cc('0x2e')](_0xc99199[_0xd2cc('0x32')],function(_0x33debe){var _0x5ebd70={};_0x5ebd70[_0x33debe]={'$like':'%'+_0x17e9c3[_0xd2cc('0x30')][_0xd2cc('0x3b')]+'%'};return _0x5ebd70;})});}_0xc99199=_[_0xd2cc('0x3c')]({},_0xc99199,_0x17e9c3['options']);return _0x280869['getConfigurations'](_0xc99199);}})[_0xd2cc('0x24')](function(_0x75a864){if(_0x75a864){_0x3611be=_0x75a864[_0xd2cc('0x35')];if(!_0x17e9c3['query'][_0xd2cc('0x36')]('nolimit')){_0xc99199[_0xd2cc('0x1d')]=qs[_0xd2cc('0x1d')](_0x17e9c3[_0xd2cc('0x30')]['limit']);_0xc99199[_0xd2cc('0x1b')]=qs[_0xd2cc('0x1b')](_0x17e9c3[_0xd2cc('0x30')]['offset']);}return _0x280869[_0xd2cc('0x4b')](_0xc99199);}})[_0xd2cc('0x24')](function(_0xe2347c){if(_0xe2347c){return _0xe2347c?{'count':_0x3611be,'rows':_0xe2347c}:null;}})['then'](respondWithResult(_0x38bc11,null))[_0xd2cc('0x42')](handleError(_0x38bc11,null));};exports[_0xd2cc('0x4c')]=function(_0x1b78de,_0x220ff6,_0x58faa2){if(_0x1b78de['body']['id']){delete _0x1b78de['body']['id'];}return db['FreshsalesAccount'][_0xd2cc('0x4a')]({'where':{'id':_0x1b78de['params']['id']}})['then'](handleEntityNotFound(_0x220ff6,null))[_0xd2cc('0x24')](function(_0x194095){if(_0x194095){_0x1b78de[_0xd2cc('0x48')][_0xd2cc('0x4d')]=_0x194095['id'];_0x1b78de[_0xd2cc('0x48')][_0xd2cc('0x4e')]=integrations['getSubjects'](_0x1b78de[_0xd2cc('0x48')][_0xd2cc('0x4f')],_0x1b78de['body'][_0xd2cc('0x2c')]);_0x1b78de[_0xd2cc('0x48')][_0xd2cc('0x50')]=integrations[_0xd2cc('0x51')](_0x1b78de['body'][_0xd2cc('0x4f')],_0x1b78de[_0xd2cc('0x48')][_0xd2cc('0x2c')]);return db[_0xd2cc('0x52')][_0xd2cc('0x47')](_0x1b78de[_0xd2cc('0x48')],{'include':[{'model':db[_0xd2cc('0x53')],'as':_0xd2cc('0x4e')},{'model':db[_0xd2cc('0x53')],'as':_0xd2cc('0x50')}]});}return null;})[_0xd2cc('0x24')](respondWithResult(_0x220ff6,null))[_0xd2cc('0x42')](handleError(_0x220ff6,null));};exports[_0xd2cc('0x54')]=function(_0x599294,_0x36864f,_0x516c27){var _0x523fb6='';var _0x468105='';return db[_0xd2cc('0x3e')][_0xd2cc('0x4a')]({'where':{'id':_0x599294[_0xd2cc('0x44')]['id']},'attributes':['id','username',_0xd2cc('0x55'),_0xd2cc('0x56')]})[_0xd2cc('0x24')](handleEntityNotFound(_0x36864f,null))[_0xd2cc('0x24')](function(_0x5ed981){if(_0x5ed981){_0x468105=_0x5ed981['username'];_0x523fb6=_0x5ed981[_0xd2cc('0x55')];var _0x1e5e8d=_0x5ed981[_0xd2cc('0x55')][_0xd2cc('0x57')](-0x1);if(_0x1e5e8d==='/'){_0x523fb6=_0x523fb6['substring'](0x0,_0x523fb6[_0xd2cc('0x58')](_0x1e5e8d));}return rp({'method':_0xd2cc('0x59'),'uri':util[_0xd2cc('0x5a')](_0xd2cc('0x5b'),_0x523fb6,'/api/selector/owners'),'headers':{'Authorization':_0xd2cc('0x5c')+_0x5ed981[_0xd2cc('0x56')]},'json':!![]});}})[_0xd2cc('0x24')](function(_0x1b3ed5){if(_0x1b3ed5){var _0x49b7e8=_0x1b3ed5['users'];var _0x23b81c=![];var _0x1e8c15=null;for(_0x1e8c15=0x0;_0x1e8c15<_0x49b7e8[_0xd2cc('0x35')];_0x1e8c15++){if(_0x49b7e8[_0x1e8c15][_0xd2cc('0x5d')]===_0x468105){_0x23b81c=!![];}}if(_0x23b81c){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xd2cc('0x5e')});}}})[_0xd2cc('0x24')](respondWithResult(_0x36864f,null))['catch'](function(_0x4d6074){var _0x788e8e=_0x599294['query'][_0xd2cc('0x5f')]?0x1f4:_0x4d6074[_0xd2cc('0x60')]||0x1f4;logger[_0xd2cc('0x25')](_0xd2cc('0x61'),_0xd2cc('0x54'),_0x788e8e,JSON[_0xd2cc('0x62')](_0x4d6074));delete _0x4d6074[_0xd2cc('0x27')];if(_0x788e8e===0x191){_0x788e8e=0x190;}_0x36864f['status'](_0x788e8e)['send'](_0x599294['query']['test']?{'message':_0xd2cc('0x63'),'statusCode':_0x4d6074[_0xd2cc('0x60')]}:_0x4d6074);});}; \ No newline at end of file +var _0xedde=['name','send','index','map','fieldName','type','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','FreshsalesAccount','includeAll','include','findAll','rows','show','params','keys','rawAttributes','intersection','find','create','catch','body','getConfigurations','FreshsalesConfiguration','order','getSubjects','channel','Descriptions','FreshsalesField','Subjects','getFields','username','remoteUri','apiKey','slice','lastIndexOf','GET','format','%s%s','/api/selector/owners','email','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','error','stack'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xedde,0x99));var _0xeedd=function(_0x3a760c,_0x39961e){_0x3a760c=_0x3a760c-0x0;var _0x5a6e76=_0xedde[_0x3a760c];return _0x5a6e76;};'use strict';var emlformat=require(_0xeedd('0x0'));var rimraf=require(_0xeedd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xeedd('0x2'));var rp=require(_0xeedd('0x3'));var moment=require(_0xeedd('0x4'));var BPromise=require(_0xeedd('0x5'));var Mustache=require(_0xeedd('0x6'));var util=require('util');var path=require(_0xeedd('0x7'));var sox=require(_0xeedd('0x8'));var csv=require(_0xeedd('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xeedd('0xa'));var _=require('lodash');var squel=require(_0xeedd('0xb'));var crypto=require(_0xeedd('0xc'));var jsforce=require(_0xeedd('0xd'));var deskjs=require(_0xeedd('0xe'));var toCsv=require(_0xeedd('0x9'));var querystring=require(_0xeedd('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xeedd('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xeedd('0x11'))(_0xeedd('0x12'));var utils=require(_0xeedd('0x13'));var config=require(_0xeedd('0x14'));var licenseUtil=require(_0xeedd('0x15'));var db=require(_0xeedd('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x49625b,_0xdcf83a){_0xdcf83a=_0xdcf83a||0xcc;return function(_0x5f4890){if(_0x5f4890){return _0x49625b[_0xeedd('0x17')](_0xdcf83a);}return _0x49625b[_0xeedd('0x18')](_0xdcf83a)[_0xeedd('0x19')]();};}function respondWithResult(_0x79d69e,_0x3d298c){_0x3d298c=_0x3d298c||0xc8;return function(_0xe9e09a){if(_0xe9e09a){return _0x79d69e[_0xeedd('0x18')](_0x3d298c)[_0xeedd('0x1a')](_0xe9e09a);}};}function respondWithFilteredResult(_0x231fb7,_0x5b431c){return function(_0x5b236d){if(_0x5b236d){var _0x142c84=typeof _0x5b431c['offset']==='undefined'&&typeof _0x5b431c[_0xeedd('0x1b')]==='undefined';var _0x2f6702=_0x5b236d[_0xeedd('0x1c')];var _0x329052=_0x142c84?0x0:_0x5b431c[_0xeedd('0x1d')];var _0x3b7df1=_0x142c84?_0x5b236d[_0xeedd('0x1c')]:_0x5b431c[_0xeedd('0x1d')]+_0x5b431c['limit'];var _0x3c8073;if(_0x3b7df1>=_0x2f6702){_0x3b7df1=_0x2f6702;_0x3c8073=0xc8;}else{_0x3c8073=0xce;}_0x231fb7[_0xeedd('0x18')](_0x3c8073);return _0x231fb7[_0xeedd('0x1e')](_0xeedd('0x1f'),_0x329052+'-'+_0x3b7df1+'/'+_0x2f6702)[_0xeedd('0x1a')](_0x5b236d);}return null;};}function patchUpdates(_0x216605){return function(_0x2f3df2){try{jsonpatch['apply'](_0x2f3df2,_0x216605,!![]);}catch(_0x1b1b50){return BPromise[_0xeedd('0x20')](_0x1b1b50);}return _0x2f3df2[_0xeedd('0x21')]();};}function saveUpdates(_0x353ae5,_0xb4579){return function(_0x14bc9f){if(_0x14bc9f){return _0x14bc9f[_0xeedd('0x22')](_0x353ae5)[_0xeedd('0x23')](function(_0x1e7db7){return _0x1e7db7;});}return null;};}function removeEntity(_0x4bc09b,_0x5317ff){return function(_0x252d6b){if(_0x252d6b){return _0x252d6b[_0xeedd('0x24')]()['then'](function(){_0x4bc09b[_0xeedd('0x18')](0xcc)[_0xeedd('0x19')]();});}};}function handleEntityNotFound(_0x57c056,_0x5cae5a){return function(_0x475e5f){if(!_0x475e5f){_0x57c056[_0xeedd('0x17')](0x194);}return _0x475e5f;};}function handleError(_0x4dd8a2,_0x9dd2b9){_0x9dd2b9=_0x9dd2b9||0x1f4;return function(_0x1a44be){logger[_0xeedd('0x25')](_0x1a44be[_0xeedd('0x26')]);if(_0x1a44be[_0xeedd('0x27')]){delete _0x1a44be[_0xeedd('0x27')];}_0x4dd8a2[_0xeedd('0x18')](_0x9dd2b9)[_0xeedd('0x28')](_0x1a44be);};}exports[_0xeedd('0x29')]=function(_0x383ddb,_0x3c078a){var _0x2ac798={},_0x1bd0eb={},_0xb8747e={'count':0x0,'rows':[]};var _0x5e1263=_[_0xeedd('0x2a')](db['FreshsalesAccount']['rawAttributes'],function(_0x377f0b){return{'name':_0x377f0b[_0xeedd('0x2b')],'type':_0x377f0b[_0xeedd('0x2c')]['key']};});_0x1bd0eb[_0xeedd('0x2d')]=_[_0xeedd('0x2a')](_0x5e1263,_0xeedd('0x27'));_0x1bd0eb[_0xeedd('0x2e')]=_['keys'](_0x383ddb[_0xeedd('0x2e')]);_0x1bd0eb[_0xeedd('0x2f')]=_['intersection'](_0x1bd0eb[_0xeedd('0x2d')],_0x1bd0eb['query']);_0x2ac798[_0xeedd('0x30')]=_['intersection'](_0x1bd0eb[_0xeedd('0x2d')],qs[_0xeedd('0x31')](_0x383ddb[_0xeedd('0x2e')][_0xeedd('0x31')]));_0x2ac798[_0xeedd('0x30')]=_0x2ac798[_0xeedd('0x30')][_0xeedd('0x32')]?_0x2ac798[_0xeedd('0x30')]:_0x1bd0eb[_0xeedd('0x2d')];if(!_0x383ddb[_0xeedd('0x2e')][_0xeedd('0x33')](_0xeedd('0x34'))){_0x2ac798[_0xeedd('0x1b')]=qs[_0xeedd('0x1b')](_0x383ddb[_0xeedd('0x2e')][_0xeedd('0x1b')]);_0x2ac798[_0xeedd('0x1d')]=qs['offset'](_0x383ddb['query'][_0xeedd('0x1d')]);}_0x2ac798['order']=qs['sort'](_0x383ddb['query'][_0xeedd('0x35')]);_0x2ac798[_0xeedd('0x36')]=qs[_0xeedd('0x2f')](_[_0xeedd('0x37')](_0x383ddb[_0xeedd('0x2e')],_0x1bd0eb[_0xeedd('0x2f')]),_0x5e1263);if(_0x383ddb[_0xeedd('0x2e')][_0xeedd('0x38')]){_0x2ac798[_0xeedd('0x36')]=_[_0xeedd('0x39')](_0x2ac798[_0xeedd('0x36')],{'$or':_[_0xeedd('0x2a')](_0x5e1263,function(_0x41c6d9){if(_0x41c6d9[_0xeedd('0x2c')]!=='VIRTUAL'){var _0x2f2f5d={};_0x2f2f5d[_0x41c6d9[_0xeedd('0x27')]]={'$like':'%'+_0x383ddb[_0xeedd('0x2e')][_0xeedd('0x38')]+'%'};return _0x2f2f5d;}})});}_0x2ac798=_[_0xeedd('0x39')]({},_0x2ac798,_0x383ddb[_0xeedd('0x3a')]);var _0x33710f={'where':_0x2ac798['where']};return db[_0xeedd('0x3b')][_0xeedd('0x1c')](_0x33710f)['then'](function(_0x5b6a4c){_0xb8747e[_0xeedd('0x1c')]=_0x5b6a4c;if(_0x383ddb['query'][_0xeedd('0x3c')]){_0x2ac798[_0xeedd('0x3d')]=[{'all':!![]}];}return db[_0xeedd('0x3b')][_0xeedd('0x3e')](_0x2ac798);})[_0xeedd('0x23')](function(_0x4f98bc){_0xb8747e[_0xeedd('0x3f')]=_0x4f98bc;return _0xb8747e;})[_0xeedd('0x23')](respondWithFilteredResult(_0x3c078a,_0x2ac798))['catch'](handleError(_0x3c078a,null));};exports[_0xeedd('0x40')]=function(_0x47946f,_0xf1e81c){var _0x184a45={'raw':![],'where':{'id':_0x47946f[_0xeedd('0x41')]['id']}},_0x114176={};_0x114176[_0xeedd('0x2d')]=_[_0xeedd('0x42')](db[_0xeedd('0x3b')][_0xeedd('0x43')]);_0x114176['query']=_['keys'](_0x47946f['query']);_0x114176[_0xeedd('0x2f')]=_[_0xeedd('0x44')](_0x114176[_0xeedd('0x2d')],_0x114176[_0xeedd('0x2e')]);_0x184a45[_0xeedd('0x30')]=_[_0xeedd('0x44')](_0x114176[_0xeedd('0x2d')],qs['fields'](_0x47946f[_0xeedd('0x2e')]['fields']));_0x184a45[_0xeedd('0x30')]=_0x184a45[_0xeedd('0x30')][_0xeedd('0x32')]?_0x184a45[_0xeedd('0x30')]:_0x114176[_0xeedd('0x2d')];if(_0x47946f[_0xeedd('0x2e')][_0xeedd('0x3c')]){_0x184a45[_0xeedd('0x3d')]=[{'all':!![]}];}_0x184a45=_[_0xeedd('0x39')]({},_0x184a45,_0x47946f[_0xeedd('0x3a')]);return db['FreshsalesAccount'][_0xeedd('0x45')](_0x184a45)[_0xeedd('0x23')](handleEntityNotFound(_0xf1e81c,null))[_0xeedd('0x23')](respondWithResult(_0xf1e81c,null))['catch'](handleError(_0xf1e81c,null));};exports[_0xeedd('0x46')]=function(_0x13248a,_0x2326f3){return db[_0xeedd('0x3b')][_0xeedd('0x46')](_0x13248a['body'],{})['then'](respondWithResult(_0x2326f3,0xc9))[_0xeedd('0x47')](handleError(_0x2326f3,null));};exports[_0xeedd('0x22')]=function(_0x432c6a,_0xa65094){if(_0x432c6a[_0xeedd('0x48')]['id']){delete _0x432c6a[_0xeedd('0x48')]['id'];}return db[_0xeedd('0x3b')]['find']({'where':{'id':_0x432c6a[_0xeedd('0x41')]['id']}})[_0xeedd('0x23')](handleEntityNotFound(_0xa65094,null))[_0xeedd('0x23')](saveUpdates(_0x432c6a[_0xeedd('0x48')],null))[_0xeedd('0x23')](respondWithResult(_0xa65094,null))[_0xeedd('0x47')](handleError(_0xa65094,null));};exports[_0xeedd('0x24')]=function(_0x28190c,_0x18690a){return db[_0xeedd('0x3b')][_0xeedd('0x45')]({'where':{'id':_0x28190c[_0xeedd('0x41')]['id']}})[_0xeedd('0x23')](handleEntityNotFound(_0x18690a,null))[_0xeedd('0x23')](removeEntity(_0x18690a,null))[_0xeedd('0x47')](handleError(_0x18690a,null));};exports[_0xeedd('0x49')]=function(_0x93fa43,_0x436e03,_0x2d7dba){var _0x3da9df={};var _0x2e521c={};var _0x3d6485;var _0x1e6f25;return db[_0xeedd('0x3b')]['findOne']({'where':{'id':_0x93fa43[_0xeedd('0x41')]['id']}})[_0xeedd('0x23')](handleEntityNotFound(_0x436e03,null))['then'](function(_0x16fab3){if(_0x16fab3){_0x3d6485=_0x16fab3;_0x2e521c['model']=_[_0xeedd('0x42')](db[_0xeedd('0x4a')][_0xeedd('0x43')]);_0x2e521c[_0xeedd('0x2e')]=_[_0xeedd('0x42')](_0x93fa43[_0xeedd('0x2e')]);_0x2e521c['filters']=_[_0xeedd('0x44')](_0x2e521c[_0xeedd('0x2d')],_0x2e521c[_0xeedd('0x2e')]);_0x3da9df[_0xeedd('0x30')]=_['intersection'](_0x2e521c[_0xeedd('0x2d')],qs['fields'](_0x93fa43['query']['fields']));_0x3da9df[_0xeedd('0x30')]=_0x3da9df['attributes']['length']?_0x3da9df['attributes']:_0x2e521c['model'];_0x3da9df[_0xeedd('0x4b')]=qs[_0xeedd('0x35')](_0x93fa43['query'][_0xeedd('0x35')]);_0x3da9df['where']=qs[_0xeedd('0x2f')](_['pick'](_0x93fa43[_0xeedd('0x2e')],_0x2e521c[_0xeedd('0x2f')]));if(_0x93fa43[_0xeedd('0x2e')][_0xeedd('0x38')]){_0x3da9df[_0xeedd('0x36')]=_['merge'](_0x3da9df[_0xeedd('0x36')],{'$or':_[_0xeedd('0x2a')](_0x3da9df[_0xeedd('0x30')],function(_0x5e0b10){var _0x460cfa={};_0x460cfa[_0x5e0b10]={'$like':'%'+_0x93fa43[_0xeedd('0x2e')][_0xeedd('0x38')]+'%'};return _0x460cfa;})});}_0x3da9df=_[_0xeedd('0x39')]({},_0x3da9df,_0x93fa43[_0xeedd('0x3a')]);return _0x3d6485['getConfigurations'](_0x3da9df);}})[_0xeedd('0x23')](function(_0x1fcd00){if(_0x1fcd00){_0x1e6f25=_0x1fcd00[_0xeedd('0x32')];if(!_0x93fa43[_0xeedd('0x2e')][_0xeedd('0x33')](_0xeedd('0x34'))){_0x3da9df['limit']=qs[_0xeedd('0x1b')](_0x93fa43['query'][_0xeedd('0x1b')]);_0x3da9df[_0xeedd('0x1d')]=qs[_0xeedd('0x1d')](_0x93fa43[_0xeedd('0x2e')]['offset']);}return _0x3d6485[_0xeedd('0x49')](_0x3da9df);}})[_0xeedd('0x23')](function(_0x1cb642){if(_0x1cb642){return _0x1cb642?{'count':_0x1e6f25,'rows':_0x1cb642}:null;}})['then'](respondWithResult(_0x436e03,null))['catch'](handleError(_0x436e03,null));};exports['addConfiguration']=function(_0x250be8,_0x437312,_0x11763c){if(_0x250be8[_0xeedd('0x48')]['id']){delete _0x250be8[_0xeedd('0x48')]['id'];}return db[_0xeedd('0x3b')]['findOne']({'where':{'id':_0x250be8[_0xeedd('0x41')]['id']}})[_0xeedd('0x23')](handleEntityNotFound(_0x437312,null))[_0xeedd('0x23')](function(_0xde613f){if(_0xde613f){_0x250be8[_0xeedd('0x48')]['AccountId']=_0xde613f['id'];_0x250be8[_0xeedd('0x48')]['Subjects']=integrations[_0xeedd('0x4c')](_0x250be8[_0xeedd('0x48')][_0xeedd('0x4d')],_0x250be8[_0xeedd('0x48')][_0xeedd('0x2c')]);_0x250be8['body'][_0xeedd('0x4e')]=integrations['getDescriptions'](_0x250be8[_0xeedd('0x48')]['channel'],_0x250be8['body'][_0xeedd('0x2c')]);return db[_0xeedd('0x4a')][_0xeedd('0x46')](_0x250be8['body'],{'include':[{'model':db[_0xeedd('0x4f')],'as':_0xeedd('0x50')},{'model':db[_0xeedd('0x4f')],'as':_0xeedd('0x4e')}]});}return null;})[_0xeedd('0x23')](respondWithResult(_0x437312,null))[_0xeedd('0x47')](handleError(_0x437312,null));};exports[_0xeedd('0x51')]=function(_0x4b71b6,_0x3a8329,_0x22076a){var _0x300c90='';var _0x2823c9='';return db[_0xeedd('0x3b')]['findOne']({'where':{'id':_0x4b71b6[_0xeedd('0x41')]['id']},'attributes':['id',_0xeedd('0x52'),_0xeedd('0x53'),_0xeedd('0x54')]})[_0xeedd('0x23')](handleEntityNotFound(_0x3a8329,null))[_0xeedd('0x23')](function(_0x279072){if(_0x279072){_0x2823c9=_0x279072['username'];_0x300c90=_0x279072[_0xeedd('0x53')];var _0x42d8e8=_0x279072[_0xeedd('0x53')][_0xeedd('0x55')](-0x1);if(_0x42d8e8==='/'){_0x300c90=_0x300c90['substring'](0x0,_0x300c90[_0xeedd('0x56')](_0x42d8e8));}return rp({'method':_0xeedd('0x57'),'uri':util[_0xeedd('0x58')](_0xeedd('0x59'),_0x300c90,_0xeedd('0x5a')),'headers':{'Authorization':'Token\x20token='+_0x279072[_0xeedd('0x54')]},'json':!![]});}})[_0xeedd('0x23')](function(_0xe568bd){if(_0xe568bd){var _0x44dba5=_0xe568bd['users'];var _0x4ba6da=![];var _0x2534c7=null;for(_0x2534c7=0x0;_0x2534c7<_0x44dba5[_0xeedd('0x32')];_0x2534c7++){if(_0x44dba5[_0x2534c7][_0xeedd('0x5b')]===_0x2823c9){_0x4ba6da=!![];}}if(_0x4ba6da){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0xeedd('0x23')](respondWithResult(_0x3a8329,null))[_0xeedd('0x47')](function(_0x2f39bc){var _0x2c9530=_0x4b71b6['query']['test']?0x1f4:_0x2f39bc[_0xeedd('0x5c')]||0x1f4;logger['error'](_0xeedd('0x5d'),_0xeedd('0x51'),_0x2c9530,JSON[_0xeedd('0x5e')](_0x2f39bc));delete _0x2f39bc[_0xeedd('0x27')];if(_0x2c9530===0x191){_0x2c9530=0x190;}_0x3a8329['status'](_0x2c9530)['send'](_0x4b71b6['query'][_0xeedd('0x5f')]?{'message':'Wrong\x20credentials','statusCode':_0x2f39bc[_0xeedd('0x5c')]}:_0x2f39bc);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 8df2d71..06de2c6 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 _0x4991=['lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','define','FreshsalesAccount','int_freshsales_accounts'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4991,0xf7));var _0x1499=function(_0x1148af,_0x4b69cd){_0x1148af=_0x1148af-0x0;var _0xee1438=_0x4991[_0x1148af];return _0xee1438;};'use strict';var _=require(_0x1499('0x0'));var util=require('util');var logger=require(_0x1499('0x1'))('api');var moment=require(_0x1499('0x2'));var BPromise=require(_0x1499('0x3'));var rp=require(_0x1499('0x4'));var fs=require('fs');var path=require(_0x1499('0x5'));var rimraf=require(_0x1499('0x6'));var config=require(_0x1499('0x7'));var attributes=require(_0x1499('0x8'));var integrations=require(_0x1499('0x9'));module['exports']=function(_0x2a8e96,_0x1c3bd7){return _0x2a8e96[_0x1499('0xa')](_0x1499('0xb'),attributes,{'tableName':_0x1499('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4137=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','define','FreshsalesAccount','lodash','util','../../config/logger','api'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x4137,0xf8));var _0x7413=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x4137[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var logger=require(_0x7413('0x2'))(_0x7413('0x3'));var moment=require(_0x7413('0x4'));var BPromise=require(_0x7413('0x5'));var rp=require(_0x7413('0x6'));var fs=require('fs');var path=require(_0x7413('0x7'));var rimraf=require(_0x7413('0x8'));var config=require(_0x7413('0x9'));var attributes=require(_0x7413('0xa'));var integrations=require(_0x7413('0xb'));module['exports']=function(_0xc808cd,_0x188d89){return _0xc808cd[_0x7413('0xc')](_0x7413('0xd'),attributes,{'tableName':'int_freshsales_accounts','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 d1eaec0..60cf71b 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 _0xbbbc=['attributes','limit','include','map','model','stringify','ShowFreshsalesAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','debug','request\x20sent','error','message','result','catch','GetFreshsalesAccount','findAll','options','raw','where'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x5c06b,_0x20564c){_0x5c06b=_0x5c06b-0x0;var _0x34c54c=_0xbbbc[_0x5c06b];return _0x34c54c;};'use strict';var _=require(_0xcbbb('0x0'));var util=require(_0xcbbb('0x1'));var moment=require(_0xcbbb('0x2'));var BPromise=require(_0xcbbb('0x3'));var rs=require(_0xcbbb('0x4'));var fs=require('fs');var Redis=require(_0xcbbb('0x5'));var db=require(_0xcbbb('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xcbbb('0x7'))(_0xcbbb('0x8'));var config=require(_0xcbbb('0x9'));var jayson=require(_0xcbbb('0xa'));var client=jayson[_0xcbbb('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x388197,_0x1796b4,_0x32ec9c){return new BPromise(function(_0x6f4fd8,_0x356249){return client[_0xcbbb('0xc')](_0x388197,_0x32ec9c)[_0xcbbb('0xd')](function(_0x4ec90a){logger[_0xcbbb('0xe')]('FreshsalesAccount,\x20%s,\x20%s',_0x1796b4,'request\x20sent');logger[_0xcbbb('0xf')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x1796b4,_0xcbbb('0x10'),JSON['stringify'](_0x4ec90a));if(_0x4ec90a[_0xcbbb('0x11')]){if(_0x4ec90a[_0xcbbb('0x11')]['code']===0x1f4){logger[_0xcbbb('0x11')]('FreshsalesAccount,\x20%s,\x20%s',_0x1796b4,_0x4ec90a[_0xcbbb('0x11')]['message']);return _0x356249(_0x4ec90a[_0xcbbb('0x11')][_0xcbbb('0x12')]);}logger[_0xcbbb('0x11')]('FreshsalesAccount,\x20%s,\x20%s',_0x1796b4,_0x4ec90a[_0xcbbb('0x11')][_0xcbbb('0x12')]);return _0x6f4fd8(_0x4ec90a[_0xcbbb('0x11')][_0xcbbb('0x12')]);}else{logger['info']('FreshsalesAccount,\x20%s,\x20%s',_0x1796b4,_0xcbbb('0x10'));_0x6f4fd8(_0x4ec90a[_0xcbbb('0x13')][_0xcbbb('0x12')]);}})[_0xcbbb('0x14')](function(_0x5e25ca){logger[_0xcbbb('0x11')]('FreshsalesAccount,\x20%s,\x20%s',_0x1796b4,_0x5e25ca);_0x356249(_0x5e25ca);});});}exports[_0xcbbb('0x15')]=function(_0x3436af){var _0x3572bb=this;return new Promise(function(_0x5052df,_0x57c5e9){return db['FreshsalesAccount'][_0xcbbb('0x16')]({'raw':_0x3436af[_0xcbbb('0x17')]?_0x3436af[_0xcbbb('0x17')][_0xcbbb('0x18')]===undefined?!![]:![]:!![],'where':_0x3436af[_0xcbbb('0x17')]?_0x3436af[_0xcbbb('0x17')][_0xcbbb('0x19')]||null:null,'attributes':_0x3436af[_0xcbbb('0x17')]?_0x3436af[_0xcbbb('0x17')][_0xcbbb('0x1a')]||null:null,'limit':_0x3436af['options']?_0x3436af[_0xcbbb('0x17')][_0xcbbb('0x1b')]||null:null,'include':_0x3436af[_0xcbbb('0x17')]?_0x3436af[_0xcbbb('0x17')][_0xcbbb('0x1c')]?_[_0xcbbb('0x1d')](_0x3436af[_0xcbbb('0x17')][_0xcbbb('0x1c')],function(_0x3ca570){return{'model':db[_0x3ca570['model']],'as':_0x3ca570['as'],'attributes':_0x3ca570[_0xcbbb('0x1a')],'include':_0x3ca570[_0xcbbb('0x1c')]?_['map'](_0x3ca570[_0xcbbb('0x1c')],function(_0x4ffa80){return{'model':db[_0x4ffa80['model']],'as':_0x4ffa80['as'],'attributes':_0x4ffa80[_0xcbbb('0x1a')],'include':_0x4ffa80[_0xcbbb('0x1c')]?_['map'](_0x4ffa80['include'],function(_0x5499a1){return{'model':db[_0x5499a1[_0xcbbb('0x1e')]],'as':_0x5499a1['as'],'attributes':_0x5499a1['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x21e3b1){logger[_0xcbbb('0xe')](_0xcbbb('0x15'),_0x3436af);logger[_0xcbbb('0xf')](_0xcbbb('0x15'),_0x3436af,JSON[_0xcbbb('0x1f')](_0x21e3b1));_0x5052df(_0x21e3b1);})[_0xcbbb('0x14')](function(_0x1c986d){logger[_0xcbbb('0x11')](_0xcbbb('0x15'),_0x1c986d[_0xcbbb('0x12')],_0x3436af);_0x57c5e9(_0x3572bb[_0xcbbb('0x11')](0x1f4,_0x1c986d[_0xcbbb('0x12')]));});});};exports[_0xcbbb('0x20')]=function(_0x2a9639){var _0xcae72c=this;return new Promise(function(_0x117739,_0x21c560){return db['FreshsalesAccount'][_0xcbbb('0x21')]({'raw':_0x2a9639[_0xcbbb('0x17')]?_0x2a9639['options'][_0xcbbb('0x18')]===undefined?!![]:![]:!![],'where':_0x2a9639['options']?_0x2a9639[_0xcbbb('0x17')][_0xcbbb('0x19')]||null:null,'attributes':_0x2a9639[_0xcbbb('0x17')]?_0x2a9639['options'][_0xcbbb('0x1a')]||null:null,'include':_0x2a9639[_0xcbbb('0x17')]?_0x2a9639[_0xcbbb('0x17')][_0xcbbb('0x1c')]?_[_0xcbbb('0x1d')](_0x2a9639[_0xcbbb('0x17')][_0xcbbb('0x1c')],function(_0x1ac1a2){return{'model':db[_0x1ac1a2[_0xcbbb('0x1e')]],'as':_0x1ac1a2['as'],'attributes':_0x1ac1a2[_0xcbbb('0x1a')],'include':_0x1ac1a2['include']?_['map'](_0x1ac1a2['include'],function(_0x4ed7e8){return{'model':db[_0x4ed7e8[_0xcbbb('0x1e')]],'as':_0x4ed7e8['as'],'attributes':_0x4ed7e8[_0xcbbb('0x1a')],'include':_0x4ed7e8[_0xcbbb('0x1c')]?_[_0xcbbb('0x1d')](_0x4ed7e8[_0xcbbb('0x1c')],function(_0x358537){return{'model':db[_0x358537[_0xcbbb('0x1e')]],'as':_0x358537['as'],'attributes':_0x358537[_0xcbbb('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xcbbb('0xd')](function(_0x198178){logger[_0xcbbb('0xe')](_0xcbbb('0x20'),_0x2a9639);logger['debug']('ShowFreshsalesAccount',_0x2a9639,JSON[_0xcbbb('0x1f')](_0x198178));_0x117739(_0x198178);})['catch'](function(_0x4919ad){logger['error'](_0xcbbb('0x20'),_0x4919ad[_0xcbbb('0x12')],_0x2a9639);_0x21c560(_0xcae72c[_0xcbbb('0x11')](0x1f4,_0x4919ad[_0xcbbb('0x12')]));});});}; \ No newline at end of file +var _0xd943=['limit','include','map','model','attributes','debug','ShowFreshsalesAccount','find','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','then','info','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','error','code','FreshsalesAccount,\x20%s,\x20%s','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','options','raw','where'];(function(_0xfd5f37,_0x24a79c){var _0x11bd01=function(_0x4ae9bd){while(--_0x4ae9bd){_0xfd5f37['push'](_0xfd5f37['shift']());}};_0x11bd01(++_0x24a79c);}(_0xd943,0x15d));var _0x3d94=function(_0x1bcbac,_0x569cdf){_0x1bcbac=_0x1bcbac-0x0;var _0x90b699=_0xd943[_0x1bcbac];return _0x90b699;};'use strict';var _=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var moment=require(_0x3d94('0x2'));var BPromise=require(_0x3d94('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d94('0x4'));var db=require(_0x3d94('0x5'))['db'];var utils=require(_0x3d94('0x6'));var logger=require(_0x3d94('0x7'))(_0x3d94('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3d94('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54e81f,_0x4d29e7,_0x20f4d1){return new BPromise(function(_0x35d36a,_0x5244c3){return client['request'](_0x54e81f,_0x20f4d1)[_0x3d94('0xa')](function(_0x27e381){logger[_0x3d94('0xb')]('FreshsalesAccount,\x20%s,\x20%s',_0x4d29e7,_0x3d94('0xc'));logger['debug'](_0x3d94('0xd'),_0x4d29e7,_0x3d94('0xc'),JSON['stringify'](_0x27e381));if(_0x27e381[_0x3d94('0xe')]){if(_0x27e381[_0x3d94('0xe')][_0x3d94('0xf')]===0x1f4){logger[_0x3d94('0xe')](_0x3d94('0x10'),_0x4d29e7,_0x27e381['error'][_0x3d94('0x11')]);return _0x5244c3(_0x27e381[_0x3d94('0xe')][_0x3d94('0x11')]);}logger['error'](_0x3d94('0x10'),_0x4d29e7,_0x27e381[_0x3d94('0xe')][_0x3d94('0x11')]);return _0x35d36a(_0x27e381['error'][_0x3d94('0x11')]);}else{logger[_0x3d94('0xb')](_0x3d94('0x10'),_0x4d29e7,_0x3d94('0xc'));_0x35d36a(_0x27e381[_0x3d94('0x12')][_0x3d94('0x11')]);}})[_0x3d94('0x13')](function(_0x9893cb){logger['error'](_0x3d94('0x10'),_0x4d29e7,_0x9893cb);_0x5244c3(_0x9893cb);});});}exports[_0x3d94('0x14')]=function(_0x2acee3){var _0x1c35a8=this;return new Promise(function(_0x4afc92,_0x3ca0e3){return db[_0x3d94('0x15')]['findAll']({'raw':_0x2acee3[_0x3d94('0x16')]?_0x2acee3['options'][_0x3d94('0x17')]===undefined?!![]:![]:!![],'where':_0x2acee3[_0x3d94('0x16')]?_0x2acee3[_0x3d94('0x16')][_0x3d94('0x18')]||null:null,'attributes':_0x2acee3[_0x3d94('0x16')]?_0x2acee3['options']['attributes']||null:null,'limit':_0x2acee3[_0x3d94('0x16')]?_0x2acee3[_0x3d94('0x16')][_0x3d94('0x19')]||null:null,'include':_0x2acee3['options']?_0x2acee3[_0x3d94('0x16')][_0x3d94('0x1a')]?_[_0x3d94('0x1b')](_0x2acee3[_0x3d94('0x16')][_0x3d94('0x1a')],function(_0x4093a4){return{'model':db[_0x4093a4[_0x3d94('0x1c')]],'as':_0x4093a4['as'],'attributes':_0x4093a4[_0x3d94('0x1d')],'include':_0x4093a4[_0x3d94('0x1a')]?_[_0x3d94('0x1b')](_0x4093a4[_0x3d94('0x1a')],function(_0x192839){return{'model':db[_0x192839[_0x3d94('0x1c')]],'as':_0x192839['as'],'attributes':_0x192839[_0x3d94('0x1d')],'include':_0x192839[_0x3d94('0x1a')]?_['map'](_0x192839[_0x3d94('0x1a')],function(_0x558fd2){return{'model':db[_0x558fd2[_0x3d94('0x1c')]],'as':_0x558fd2['as'],'attributes':_0x558fd2[_0x3d94('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3d94('0xa')](function(_0x439173){logger[_0x3d94('0xb')](_0x3d94('0x14'),_0x2acee3);logger[_0x3d94('0x1e')]('GetFreshsalesAccount',_0x2acee3,JSON['stringify'](_0x439173));_0x4afc92(_0x439173);})[_0x3d94('0x13')](function(_0x4813e1){logger['error'](_0x3d94('0x14'),_0x4813e1['message'],_0x2acee3);_0x3ca0e3(_0x1c35a8[_0x3d94('0xe')](0x1f4,_0x4813e1[_0x3d94('0x11')]));});});};exports[_0x3d94('0x1f')]=function(_0x4cef9c){var _0x2a07b4=this;return new Promise(function(_0x4c1237,_0x3d4994){return db['FreshsalesAccount'][_0x3d94('0x20')]({'raw':_0x4cef9c[_0x3d94('0x16')]?_0x4cef9c[_0x3d94('0x16')][_0x3d94('0x17')]===undefined?!![]:![]:!![],'where':_0x4cef9c['options']?_0x4cef9c[_0x3d94('0x16')]['where']||null:null,'attributes':_0x4cef9c[_0x3d94('0x16')]?_0x4cef9c[_0x3d94('0x16')]['attributes']||null:null,'include':_0x4cef9c['options']?_0x4cef9c[_0x3d94('0x16')][_0x3d94('0x1a')]?_[_0x3d94('0x1b')](_0x4cef9c['options'][_0x3d94('0x1a')],function(_0x3d29fd){return{'model':db[_0x3d29fd['model']],'as':_0x3d29fd['as'],'attributes':_0x3d29fd[_0x3d94('0x1d')],'include':_0x3d29fd[_0x3d94('0x1a')]?_[_0x3d94('0x1b')](_0x3d29fd[_0x3d94('0x1a')],function(_0x782c1){return{'model':db[_0x782c1['model']],'as':_0x782c1['as'],'attributes':_0x782c1[_0x3d94('0x1d')],'include':_0x782c1[_0x3d94('0x1a')]?_[_0x3d94('0x1b')](_0x782c1[_0x3d94('0x1a')],function(_0xb493f1){return{'model':db[_0xb493f1[_0x3d94('0x1c')]],'as':_0xb493f1['as'],'attributes':_0xb493f1['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xfe58eb){logger[_0x3d94('0xb')](_0x3d94('0x1f'),_0x4cef9c);logger[_0x3d94('0x1e')](_0x3d94('0x1f'),_0x4cef9c,JSON[_0x3d94('0x21')](_0xfe58eb));_0x4c1237(_0xfe58eb);})[_0x3d94('0x13')](function(_0x12c01a){logger[_0x3d94('0xe')](_0x3d94('0x1f'),_0x12c01a['message'],_0x4cef9c);_0x3d4994(_0x2a07b4[_0x3d94('0xe')](0x1f4,_0x12c01a[_0x3d94('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index c6719e2..96d9586 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 _0xb79e=['update','delete','destroy','exports','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','index','get','/:id','isAuthenticated','show','getSubjects','getDescriptions','/:id/fields','getFields','post','create','put'];(function(_0xa01d2,_0x17f2c7){var _0x3f33ab=function(_0x148329){while(--_0x148329){_0xa01d2['push'](_0xa01d2['shift']());}};_0x3f33ab(++_0x17f2c7);}(_0xb79e,0xca));var _0xeb79=function(_0x1b3fac,_0x2c0dd3){_0x1b3fac=_0x1b3fac-0x0;var _0xfbc96f=_0xb79e[_0x1b3fac];return _0xfbc96f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xeb79('0x0'));var timeout=require(_0xeb79('0x1'));var express=require('express');var router=express[_0xeb79('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xeb79('0x3'));var config=require(_0xeb79('0x4'));var controller=require(_0xeb79('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xeb79('0x6')]);router[_0xeb79('0x7')](_0xeb79('0x8'),auth[_0xeb79('0x9')](),controller[_0xeb79('0xa')]);router['get']('/:id/subjects',auth[_0xeb79('0x9')](),controller[_0xeb79('0xb')]);router['get']('/:id/descriptions',auth['isAuthenticated'](),controller[_0xeb79('0xc')]);router[_0xeb79('0x7')](_0xeb79('0xd'),auth['isAuthenticated'](),controller[_0xeb79('0xe')]);router[_0xeb79('0xf')]('/',auth[_0xeb79('0x9')](),controller[_0xeb79('0x10')]);router[_0xeb79('0x11')](_0xeb79('0x8'),auth[_0xeb79('0x9')](),controller[_0xeb79('0x12')]);router[_0xeb79('0x13')](_0xeb79('0x8'),auth[_0xeb79('0x9')](),controller[_0xeb79('0x14')]);module[_0xeb79('0x15')]=router; \ No newline at end of file +var _0x1bcb=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','create','put','destroy','exports','util','path'];(function(_0x40c15b,_0x3aa0bf){var _0x3bb067=function(_0x5356b0){while(--_0x5356b0){_0x40c15b['push'](_0x40c15b['shift']());}};_0x3bb067(++_0x3aa0bf);}(_0x1bcb,0xc4));var _0xb1bc=function(_0x1d01f7,_0x24da1e){_0x1d01f7=_0x1d01f7-0x0;var _0x20609c=_0x1bcb[_0x1d01f7];return _0x20609c;};'use strict';var multer=require('multer');var util=require(_0xb1bc('0x0'));var path=require(_0xb1bc('0x1'));var timeout=require('connect-timeout');var express=require(_0xb1bc('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb1bc('0x3'));var interaction=require(_0xb1bc('0x4'));var config=require(_0xb1bc('0x5'));var controller=require(_0xb1bc('0x6'));router[_0xb1bc('0x7')]('/',auth[_0xb1bc('0x8')](),controller[_0xb1bc('0x9')]);router[_0xb1bc('0x7')](_0xb1bc('0xa'),auth[_0xb1bc('0x8')](),controller['show']);router['get'](_0xb1bc('0xb'),auth['isAuthenticated'](),controller[_0xb1bc('0xc')]);router['get'](_0xb1bc('0xd'),auth[_0xb1bc('0x8')](),controller[_0xb1bc('0xe')]);router[_0xb1bc('0x7')](_0xb1bc('0xf'),auth['isAuthenticated'](),controller[_0xb1bc('0x10')]);router[_0xb1bc('0x11')]('/',auth['isAuthenticated'](),controller[_0xb1bc('0x12')]);router[_0xb1bc('0x13')]('/:id',auth[_0xb1bc('0x8')](),controller['update']);router['delete'](_0xb1bc('0xa'),auth['isAuthenticated'](),controller[_0xb1bc('0x14')]);module[_0xb1bc('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index a4cdf82..fd53571 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 _0x7b13=['sequelize','exports'];(function(_0x280f4a,_0x2ed8d6){var _0x1bb157=function(_0x37de94){while(--_0x37de94){_0x280f4a['push'](_0x280f4a['shift']());}};_0x1bb157(++_0x2ed8d6);}(_0x7b13,0x6a));var _0x37b1=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x7b13[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require(_0x37b1('0x0'));module[_0x37b1('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc316=['STRING','sequelize','exports'];(function(_0x48ed7e,_0x5629be){var _0x56abfb=function(_0x46a46a){while(--_0x46a46a){_0x48ed7e['push'](_0x48ed7e['shift']());}};_0x56abfb(++_0x5629be);}(_0xc316,0x9a));var _0x6c31=function(_0x548003,_0x19cd0e){_0x548003=_0x548003-0x0;var _0x459a44=_0xc316[_0x548003];return _0x459a44;};'use strict';var Sequelize=require(_0x6c31('0x0'));module[_0x6c31('0x1')]={'name':{'type':Sequelize[_0x6c31('0x2')]},'description':{'type':Sequelize[_0x6c31('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index f802982..b9bed24 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 _0x614c=['undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','keys','filters','intersection','model','query','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','catch','show','params','options','find','create','body','getSubjects','FreshsalesField','nolimit','getDescriptions','findOne','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset'];(function(_0x1e7dc3,_0x402ea6){var _0x4a2804=function(_0x615f8b){while(--_0x615f8b){_0x1e7dc3['push'](_0x1e7dc3['shift']());}};_0x4a2804(++_0x402ea6);}(_0x614c,0x174));var _0xc614=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x614c[_0x3ab9ee];return _0x82ee88;};'use strict';var emlformat=require(_0xc614('0x0'));var rimraf=require(_0xc614('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc614('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc614('0x3'));var Mustache=require(_0xc614('0x4'));var util=require(_0xc614('0x5'));var path=require(_0xc614('0x6'));var sox=require(_0xc614('0x7'));var csv=require(_0xc614('0x8'));var ejs=require(_0xc614('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc614('0xa'));var crypto=require('crypto');var jsforce=require(_0xc614('0xb'));var deskjs=require(_0xc614('0xc'));var toCsv=require(_0xc614('0x8'));var querystring=require(_0xc614('0xd'));var Papa=require(_0xc614('0xe'));var Redis=require(_0xc614('0xf'));var authService=require(_0xc614('0x10'));var qs=require(_0xc614('0x11'));var as=require(_0xc614('0x12'));var hardwareService=require(_0xc614('0x13'));var logger=require('../../config/logger')(_0xc614('0x14'));var utils=require('../../config/utils');var config=require(_0xc614('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xc614('0x16'))['db'];function respondWithStatusCode(_0x3b72b1,_0xed24a){_0xed24a=_0xed24a||0xcc;return function(_0x314750){if(_0x314750){return _0x3b72b1[_0xc614('0x17')](_0xed24a);}return _0x3b72b1['status'](_0xed24a)[_0xc614('0x18')]();};}function respondWithResult(_0x10ec71,_0x4ed207){_0x4ed207=_0x4ed207||0xc8;return function(_0x5d0640){if(_0x5d0640){return _0x10ec71[_0xc614('0x19')](_0x4ed207)[_0xc614('0x1a')](_0x5d0640);}};}function respondWithFilteredResult(_0x375493,_0x5d3f74){return function(_0x43c98c){if(_0x43c98c){var _0x4243e9=typeof _0x5d3f74[_0xc614('0x1b')]===_0xc614('0x1c')&&typeof _0x5d3f74[_0xc614('0x1d')]===_0xc614('0x1c');var _0x3adf9b=_0x43c98c[_0xc614('0x1e')];var _0x52a736=_0x4243e9?0x0:_0x5d3f74[_0xc614('0x1b')];var _0x2541fb=_0x4243e9?_0x43c98c[_0xc614('0x1e')]:_0x5d3f74[_0xc614('0x1b')]+_0x5d3f74[_0xc614('0x1d')];var _0x3dcb70;if(_0x2541fb>=_0x3adf9b){_0x2541fb=_0x3adf9b;_0x3dcb70=0xc8;}else{_0x3dcb70=0xce;}_0x375493[_0xc614('0x19')](_0x3dcb70);return _0x375493[_0xc614('0x1f')](_0xc614('0x20'),_0x52a736+'-'+_0x2541fb+'/'+_0x3adf9b)['json'](_0x43c98c);}return null;};}function patchUpdates(_0x241528){return function(_0x22894f){try{jsonpatch[_0xc614('0x21')](_0x22894f,_0x241528,!![]);}catch(_0x53ad12){return BPromise[_0xc614('0x22')](_0x53ad12);}return _0x22894f[_0xc614('0x23')]();};}function saveUpdates(_0x5449a4,_0x31a3b9){return function(_0x3ddc6d){if(_0x3ddc6d){return _0x3ddc6d[_0xc614('0x24')](_0x5449a4)[_0xc614('0x25')](function(_0x3cb283){return _0x3cb283;});}return null;};}function removeEntity(_0x1c1fbb,_0x471c5c){return function(_0x2d2ebf){if(_0x2d2ebf){return _0x2d2ebf[_0xc614('0x26')]()[_0xc614('0x25')](function(){_0x1c1fbb[_0xc614('0x19')](0xcc)[_0xc614('0x18')]();});}};}function handleEntityNotFound(_0x17f829,_0x395899){return function(_0x642bba){if(!_0x642bba){_0x17f829[_0xc614('0x17')](0x194);}return _0x642bba;};}function handleError(_0x14c36c,_0x5e6d56){_0x5e6d56=_0x5e6d56||0x1f4;return function(_0x3b6229){logger[_0xc614('0x27')](_0x3b6229[_0xc614('0x28')]);if(_0x3b6229['name']){delete _0x3b6229[_0xc614('0x29')];}_0x14c36c[_0xc614('0x19')](_0x5e6d56)[_0xc614('0x2a')](_0x3b6229);};}exports[_0xc614('0x2b')]=function(_0x46febf,_0x1a55fa){var _0x814c52={},_0x3acdf9={},_0x5d4897={'count':0x0,'rows':[]};var _0x5905b9=_[_0xc614('0x2c')](db[_0xc614('0x2d')][_0xc614('0x2e')],function(_0x596e32){return{'name':_0x596e32[_0xc614('0x2f')],'type':_0x596e32[_0xc614('0x30')]['key']};});_0x3acdf9['model']=_[_0xc614('0x2c')](_0x5905b9,_0xc614('0x29'));_0x3acdf9['query']=_[_0xc614('0x31')](_0x46febf['query']);_0x3acdf9[_0xc614('0x32')]=_[_0xc614('0x33')](_0x3acdf9[_0xc614('0x34')],_0x3acdf9['query']);_0x814c52['attributes']=_[_0xc614('0x33')](_0x3acdf9[_0xc614('0x34')],qs['fields'](_0x46febf[_0xc614('0x35')][_0xc614('0x36')]));_0x814c52[_0xc614('0x37')]=_0x814c52[_0xc614('0x37')][_0xc614('0x38')]?_0x814c52['attributes']:_0x3acdf9['model'];if(!_0x46febf[_0xc614('0x35')][_0xc614('0x39')]('nolimit')){_0x814c52[_0xc614('0x1d')]=qs[_0xc614('0x1d')](_0x46febf['query'][_0xc614('0x1d')]);_0x814c52[_0xc614('0x1b')]=qs[_0xc614('0x1b')](_0x46febf[_0xc614('0x35')]['offset']);}_0x814c52[_0xc614('0x3a')]=qs[_0xc614('0x3b')](_0x46febf['query'][_0xc614('0x3b')]);_0x814c52[_0xc614('0x3c')]=qs[_0xc614('0x32')](_[_0xc614('0x3d')](_0x46febf['query'],_0x3acdf9['filters']),_0x5905b9);if(_0x46febf[_0xc614('0x35')][_0xc614('0x3e')]){_0x814c52[_0xc614('0x3c')]=_['merge'](_0x814c52[_0xc614('0x3c')],{'$or':_[_0xc614('0x2c')](_0x5905b9,function(_0x499a9d){if(_0x499a9d['type']!==_0xc614('0x3f')){var _0x577ff4={};_0x577ff4[_0x499a9d[_0xc614('0x29')]]={'$like':'%'+_0x46febf[_0xc614('0x35')][_0xc614('0x3e')]+'%'};return _0x577ff4;}})});}_0x814c52=_[_0xc614('0x40')]({},_0x814c52,_0x46febf['options']);var _0x1f59d9={'where':_0x814c52[_0xc614('0x3c')]};return db[_0xc614('0x2d')][_0xc614('0x1e')](_0x1f59d9)['then'](function(_0x229dc3){_0x5d4897[_0xc614('0x1e')]=_0x229dc3;if(_0x46febf[_0xc614('0x35')][_0xc614('0x41')]){_0x814c52[_0xc614('0x42')]=[{'all':!![]}];}return db[_0xc614('0x2d')][_0xc614('0x43')](_0x814c52);})[_0xc614('0x25')](function(_0x4008be){_0x5d4897['rows']=_0x4008be;return _0x5d4897;})[_0xc614('0x25')](respondWithFilteredResult(_0x1a55fa,_0x814c52))[_0xc614('0x44')](handleError(_0x1a55fa,null));};exports[_0xc614('0x45')]=function(_0x35c2ef,_0x448617){var _0x445530={'raw':![],'where':{'id':_0x35c2ef[_0xc614('0x46')]['id']}},_0xcbd656={};_0xcbd656['model']=_['keys'](db['FreshsalesConfiguration'][_0xc614('0x2e')]);_0xcbd656['query']=_['keys'](_0x35c2ef['query']);_0xcbd656[_0xc614('0x32')]=_[_0xc614('0x33')](_0xcbd656[_0xc614('0x34')],_0xcbd656[_0xc614('0x35')]);_0x445530[_0xc614('0x37')]=_['intersection'](_0xcbd656[_0xc614('0x34')],qs[_0xc614('0x36')](_0x35c2ef[_0xc614('0x35')][_0xc614('0x36')]));_0x445530[_0xc614('0x37')]=_0x445530['attributes'][_0xc614('0x38')]?_0x445530[_0xc614('0x37')]:_0xcbd656[_0xc614('0x34')];if(_0x35c2ef[_0xc614('0x35')][_0xc614('0x41')]){_0x445530['include']=[{'all':!![]}];}_0x445530=_[_0xc614('0x40')]({},_0x445530,_0x35c2ef[_0xc614('0x47')]);return db['FreshsalesConfiguration'][_0xc614('0x48')](_0x445530)[_0xc614('0x25')](handleEntityNotFound(_0x448617,null))[_0xc614('0x25')](respondWithResult(_0x448617,null))['catch'](handleError(_0x448617,null));};exports['create']=function(_0x257d10,_0x542afd){return db[_0xc614('0x2d')][_0xc614('0x49')](_0x257d10[_0xc614('0x4a')],{})[_0xc614('0x25')](respondWithResult(_0x542afd,0xc9))[_0xc614('0x44')](handleError(_0x542afd,null));};exports['update']=function(_0x1ab17e,_0x4f75ba){if(_0x1ab17e[_0xc614('0x4a')]['id']){delete _0x1ab17e[_0xc614('0x4a')]['id'];}return db['FreshsalesConfiguration']['find']({'where':{'id':_0x1ab17e['params']['id']}})[_0xc614('0x25')](handleEntityNotFound(_0x4f75ba,null))['then'](saveUpdates(_0x1ab17e[_0xc614('0x4a')],null))[_0xc614('0x25')](respondWithResult(_0x4f75ba,null))[_0xc614('0x44')](handleError(_0x4f75ba,null));};exports[_0xc614('0x26')]=function(_0x5371b5,_0x4cbcdb){return db['FreshsalesConfiguration'][_0xc614('0x48')]({'where':{'id':_0x5371b5[_0xc614('0x46')]['id']}})['then'](handleEntityNotFound(_0x4cbcdb,null))['then'](removeEntity(_0x4cbcdb,null))[_0xc614('0x44')](handleError(_0x4cbcdb,null));};exports[_0xc614('0x4b')]=function(_0x2fa614,_0x28a86f,_0x4d5926){var _0x5bdff1={};var _0x4217a3={};var _0x630711;var _0x35ae3c;return db[_0xc614('0x2d')]['findOne']({'where':{'id':_0x2fa614[_0xc614('0x46')]['id']}})[_0xc614('0x25')](handleEntityNotFound(_0x28a86f,null))['then'](function(_0x1102e6){if(_0x1102e6){_0x630711=_0x1102e6;_0x4217a3['model']=_[_0xc614('0x31')](db[_0xc614('0x4c')]['rawAttributes']);_0x4217a3['query']=_[_0xc614('0x31')](_0x2fa614[_0xc614('0x35')]);_0x4217a3[_0xc614('0x32')]=_[_0xc614('0x33')](_0x4217a3[_0xc614('0x34')],_0x4217a3['query']);_0x5bdff1[_0xc614('0x37')]=_[_0xc614('0x33')](_0x4217a3[_0xc614('0x34')],qs[_0xc614('0x36')](_0x2fa614[_0xc614('0x35')][_0xc614('0x36')]));_0x5bdff1[_0xc614('0x37')]=_0x5bdff1[_0xc614('0x37')]['length']?_0x5bdff1[_0xc614('0x37')]:_0x4217a3[_0xc614('0x34')];_0x5bdff1[_0xc614('0x3a')]=qs[_0xc614('0x3b')](_0x2fa614[_0xc614('0x35')][_0xc614('0x3b')]);_0x5bdff1[_0xc614('0x3c')]=qs[_0xc614('0x32')](_['pick'](_0x2fa614['query'],_0x4217a3[_0xc614('0x32')]));if(_0x2fa614[_0xc614('0x35')][_0xc614('0x3e')]){_0x5bdff1[_0xc614('0x3c')]=_[_0xc614('0x40')](_0x5bdff1[_0xc614('0x3c')],{'$or':_[_0xc614('0x2c')](_0x5bdff1['attributes'],function(_0x3ef272){var _0x8d250a={};_0x8d250a[_0x3ef272]={'$like':'%'+_0x2fa614[_0xc614('0x35')][_0xc614('0x3e')]+'%'};return _0x8d250a;})});}_0x5bdff1=_[_0xc614('0x40')]({},_0x5bdff1,_0x2fa614[_0xc614('0x47')]);return _0x630711[_0xc614('0x4b')](_0x5bdff1);}})['then'](function(_0x3e1f92){if(_0x3e1f92){_0x35ae3c=_0x3e1f92[_0xc614('0x38')];if(!_0x2fa614[_0xc614('0x35')]['hasOwnProperty'](_0xc614('0x4d'))){_0x5bdff1[_0xc614('0x1d')]=qs[_0xc614('0x1d')](_0x2fa614[_0xc614('0x35')][_0xc614('0x1d')]);_0x5bdff1[_0xc614('0x1b')]=qs[_0xc614('0x1b')](_0x2fa614['query'][_0xc614('0x1b')]);}return _0x630711['getSubjects'](_0x5bdff1);}})[_0xc614('0x25')](function(_0x56f0d6){if(_0x56f0d6){return _0x56f0d6?{'count':_0x35ae3c,'rows':_0x56f0d6}:null;}})['then'](respondWithResult(_0x28a86f,null))[_0xc614('0x44')](handleError(_0x28a86f,null));};exports[_0xc614('0x4e')]=function(_0x11dbb6,_0x461179,_0x16b115){var _0x53788e={};var _0x3c4716={};var _0x181514;var _0xc5f143;return db[_0xc614('0x2d')][_0xc614('0x4f')]({'where':{'id':_0x11dbb6[_0xc614('0x46')]['id']}})[_0xc614('0x25')](handleEntityNotFound(_0x461179,null))[_0xc614('0x25')](function(_0x2ea9bf){if(_0x2ea9bf){_0x181514=_0x2ea9bf;_0x3c4716[_0xc614('0x34')]=_['keys'](db[_0xc614('0x4c')][_0xc614('0x2e')]);_0x3c4716['query']=_['keys'](_0x11dbb6['query']);_0x3c4716[_0xc614('0x32')]=_['intersection'](_0x3c4716[_0xc614('0x34')],_0x3c4716[_0xc614('0x35')]);_0x53788e[_0xc614('0x37')]=_[_0xc614('0x33')](_0x3c4716[_0xc614('0x34')],qs[_0xc614('0x36')](_0x11dbb6[_0xc614('0x35')][_0xc614('0x36')]));_0x53788e[_0xc614('0x37')]=_0x53788e[_0xc614('0x37')][_0xc614('0x38')]?_0x53788e[_0xc614('0x37')]:_0x3c4716[_0xc614('0x34')];_0x53788e['order']=qs[_0xc614('0x3b')](_0x11dbb6[_0xc614('0x35')][_0xc614('0x3b')]);_0x53788e[_0xc614('0x3c')]=qs[_0xc614('0x32')](_[_0xc614('0x3d')](_0x11dbb6[_0xc614('0x35')],_0x3c4716[_0xc614('0x32')]));if(_0x11dbb6[_0xc614('0x35')][_0xc614('0x3e')]){_0x53788e[_0xc614('0x3c')]=_[_0xc614('0x40')](_0x53788e['where'],{'$or':_[_0xc614('0x2c')](_0x53788e[_0xc614('0x37')],function(_0x4c1541){var _0x3c7c26={};_0x3c7c26[_0x4c1541]={'$like':'%'+_0x11dbb6['query']['filter']+'%'};return _0x3c7c26;})});}_0x53788e=_[_0xc614('0x40')]({},_0x53788e,_0x11dbb6[_0xc614('0x47')]);return _0x181514[_0xc614('0x4e')](_0x53788e);}})[_0xc614('0x25')](function(_0x891229){if(_0x891229){_0xc5f143=_0x891229['length'];if(!_0x11dbb6['query'][_0xc614('0x39')](_0xc614('0x4d'))){_0x53788e[_0xc614('0x1d')]=qs['limit'](_0x11dbb6[_0xc614('0x35')][_0xc614('0x1d')]);_0x53788e[_0xc614('0x1b')]=qs['offset'](_0x11dbb6['query'][_0xc614('0x1b')]);}return _0x181514['getDescriptions'](_0x53788e);}})['then'](function(_0x481bbd){if(_0x481bbd){return _0x481bbd?{'count':_0xc5f143,'rows':_0x481bbd}:null;}})['then'](respondWithResult(_0x461179,null))['catch'](handleError(_0x461179,null));};exports['getFields']=function(_0x483e08,_0x1b2eb0,_0xcdd8d1){var _0x4db5a4={};var _0x5006cd={};var _0x41038d;var _0x2b44f7;return db['FreshsalesConfiguration'][_0xc614('0x4f')]({'where':{'id':_0x483e08[_0xc614('0x46')]['id']}})['then'](handleEntityNotFound(_0x1b2eb0,null))[_0xc614('0x25')](function(_0x3b3340){if(_0x3b3340){_0x41038d=_0x3b3340;_0x5006cd[_0xc614('0x34')]=_[_0xc614('0x31')](db[_0xc614('0x4c')]['rawAttributes']);_0x5006cd[_0xc614('0x35')]=_[_0xc614('0x31')](_0x483e08[_0xc614('0x35')]);_0x5006cd[_0xc614('0x32')]=_[_0xc614('0x33')](_0x5006cd[_0xc614('0x34')],_0x5006cd['query']);_0x4db5a4[_0xc614('0x37')]=_[_0xc614('0x33')](_0x5006cd[_0xc614('0x34')],qs[_0xc614('0x36')](_0x483e08[_0xc614('0x35')][_0xc614('0x36')]));_0x4db5a4[_0xc614('0x37')]=_0x4db5a4[_0xc614('0x37')][_0xc614('0x38')]?_0x4db5a4['attributes']:_0x5006cd[_0xc614('0x34')];_0x4db5a4['order']=qs[_0xc614('0x3b')](_0x483e08[_0xc614('0x35')]['sort']);_0x4db5a4[_0xc614('0x3c')]=qs[_0xc614('0x32')](_['pick'](_0x483e08[_0xc614('0x35')],_0x5006cd[_0xc614('0x32')]));if(_0x483e08[_0xc614('0x35')][_0xc614('0x3e')]){_0x4db5a4[_0xc614('0x3c')]=_[_0xc614('0x40')](_0x4db5a4[_0xc614('0x3c')],{'$or':_[_0xc614('0x2c')](_0x4db5a4['attributes'],function(_0x533444){var _0x55c7d7={};_0x55c7d7[_0x533444]={'$like':'%'+_0x483e08['query']['filter']+'%'};return _0x55c7d7;})});}_0x4db5a4=_[_0xc614('0x40')]({},_0x4db5a4,_0x483e08['options']);return _0x41038d['getFields'](_0x4db5a4);}})[_0xc614('0x25')](function(_0x4c5015){if(_0x4c5015){_0x2b44f7=_0x4c5015[_0xc614('0x38')];if(!_0x483e08[_0xc614('0x35')]['hasOwnProperty'](_0xc614('0x4d'))){_0x4db5a4[_0xc614('0x1d')]=qs['limit'](_0x483e08['query'][_0xc614('0x1d')]);_0x4db5a4['offset']=qs[_0xc614('0x1b')](_0x483e08['query'][_0xc614('0x1b')]);}return _0x41038d['getFields'](_0x4db5a4);}})[_0xc614('0x25')](function(_0x30f57b){if(_0x30f57b){return _0x30f57b?{'count':_0x2b44f7,'rows':_0x30f57b}:null;}})['then'](respondWithResult(_0x1b2eb0,null))[_0xc614('0x44')](handleError(_0x1b2eb0,null));}; \ No newline at end of file +var _0x4883=['../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','FreshsalesConfiguration','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','map','type','includeAll','include','rows','catch','show','params','keys','options','find','create','body','getSubjects','findOne','FreshsalesField','getDescriptions','getFields','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x19cbf4,_0x669e30){var _0x15a86e=function(_0x5f231b){while(--_0x5f231b){_0x19cbf4['push'](_0x19cbf4['shift']());}};_0x15a86e(++_0x669e30);}(_0x4883,0x138));var _0x3488=function(_0x3a9bb3,_0x204909){_0x3a9bb3=_0x3a9bb3-0x0;var _0x5169a8=_0x4883[_0x3a9bb3];return _0x5169a8;};'use strict';var emlformat=require(_0x3488('0x0'));var rimraf=require(_0x3488('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3488('0x2'));var rp=require(_0x3488('0x3'));var moment=require(_0x3488('0x4'));var BPromise=require(_0x3488('0x5'));var Mustache=require(_0x3488('0x6'));var util=require(_0x3488('0x7'));var path=require(_0x3488('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3488('0x9'));var fs=require('fs');var fs_extra=require(_0x3488('0xa'));var _=require('lodash');var squel=require(_0x3488('0xb'));var crypto=require(_0x3488('0xc'));var jsforce=require(_0x3488('0xd'));var deskjs=require(_0x3488('0xe'));var toCsv=require(_0x3488('0xf'));var querystring=require('querystring');var Papa=require(_0x3488('0x10'));var Redis=require(_0x3488('0x11'));var authService=require(_0x3488('0x12'));var qs=require(_0x3488('0x13'));var as=require(_0x3488('0x14'));var hardwareService=require(_0x3488('0x15'));var logger=require(_0x3488('0x16'))(_0x3488('0x17'));var utils=require(_0x3488('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x3488('0x19'));var db=require(_0x3488('0x1a'))['db'];function respondWithStatusCode(_0x30483c,_0x359c2a){_0x359c2a=_0x359c2a||0xcc;return function(_0x476e71){if(_0x476e71){return _0x30483c[_0x3488('0x1b')](_0x359c2a);}return _0x30483c[_0x3488('0x1c')](_0x359c2a)[_0x3488('0x1d')]();};}function respondWithResult(_0x35f443,_0xdab1ff){_0xdab1ff=_0xdab1ff||0xc8;return function(_0x3a0a1e){if(_0x3a0a1e){return _0x35f443['status'](_0xdab1ff)[_0x3488('0x1e')](_0x3a0a1e);}};}function respondWithFilteredResult(_0x346338,_0x3f86d9){return function(_0x18689a){if(_0x18689a){var _0xce0670=typeof _0x3f86d9[_0x3488('0x1f')]===_0x3488('0x20')&&typeof _0x3f86d9[_0x3488('0x21')]===_0x3488('0x20');var _0x552386=_0x18689a[_0x3488('0x22')];var _0xe39800=_0xce0670?0x0:_0x3f86d9[_0x3488('0x1f')];var _0x5d4c30=_0xce0670?_0x18689a['count']:_0x3f86d9[_0x3488('0x1f')]+_0x3f86d9[_0x3488('0x21')];var _0x3d2cf3;if(_0x5d4c30>=_0x552386){_0x5d4c30=_0x552386;_0x3d2cf3=0xc8;}else{_0x3d2cf3=0xce;}_0x346338[_0x3488('0x1c')](_0x3d2cf3);return _0x346338[_0x3488('0x23')](_0x3488('0x24'),_0xe39800+'-'+_0x5d4c30+'/'+_0x552386)[_0x3488('0x1e')](_0x18689a);}return null;};}function patchUpdates(_0x1d6bc7){return function(_0x27990e){try{jsonpatch[_0x3488('0x25')](_0x27990e,_0x1d6bc7,!![]);}catch(_0x4d75a1){return BPromise['reject'](_0x4d75a1);}return _0x27990e[_0x3488('0x26')]();};}function saveUpdates(_0x350998,_0x413588){return function(_0x3aacff){if(_0x3aacff){return _0x3aacff[_0x3488('0x27')](_0x350998)[_0x3488('0x28')](function(_0x2808ad){return _0x2808ad;});}return null;};}function removeEntity(_0x6637ff,_0x210204){return function(_0x3c543b){if(_0x3c543b){return _0x3c543b[_0x3488('0x29')]()[_0x3488('0x28')](function(){_0x6637ff['status'](0xcc)[_0x3488('0x1d')]();});}};}function handleEntityNotFound(_0x5791a6,_0xede8a7){return function(_0x493da4){if(!_0x493da4){_0x5791a6[_0x3488('0x1b')](0x194);}return _0x493da4;};}function handleError(_0x3c5949,_0x11d8c7){_0x11d8c7=_0x11d8c7||0x1f4;return function(_0x59e9c8){logger[_0x3488('0x2a')](_0x59e9c8[_0x3488('0x2b')]);if(_0x59e9c8[_0x3488('0x2c')]){delete _0x59e9c8[_0x3488('0x2c')];}_0x3c5949['status'](_0x11d8c7)[_0x3488('0x2d')](_0x59e9c8);};}exports[_0x3488('0x2e')]=function(_0x2bbb92,_0x113b4c){var _0x304d3f={},_0x43a4a7={},_0xa8ad2={'count':0x0,'rows':[]};var _0x540aed=_['map'](db[_0x3488('0x2f')][_0x3488('0x30')],function(_0x2a2610){return{'name':_0x2a2610[_0x3488('0x31')],'type':_0x2a2610['type'][_0x3488('0x32')]};});_0x43a4a7[_0x3488('0x33')]=_['map'](_0x540aed,_0x3488('0x2c'));_0x43a4a7[_0x3488('0x34')]=_['keys'](_0x2bbb92[_0x3488('0x34')]);_0x43a4a7['filters']=_[_0x3488('0x35')](_0x43a4a7[_0x3488('0x33')],_0x43a4a7[_0x3488('0x34')]);_0x304d3f[_0x3488('0x36')]=_[_0x3488('0x35')](_0x43a4a7[_0x3488('0x33')],qs[_0x3488('0x37')](_0x2bbb92[_0x3488('0x34')]['fields']));_0x304d3f[_0x3488('0x36')]=_0x304d3f[_0x3488('0x36')][_0x3488('0x38')]?_0x304d3f[_0x3488('0x36')]:_0x43a4a7[_0x3488('0x33')];if(!_0x2bbb92[_0x3488('0x34')][_0x3488('0x39')](_0x3488('0x3a'))){_0x304d3f['limit']=qs[_0x3488('0x21')](_0x2bbb92[_0x3488('0x34')]['limit']);_0x304d3f['offset']=qs[_0x3488('0x1f')](_0x2bbb92[_0x3488('0x34')]['offset']);}_0x304d3f[_0x3488('0x3b')]=qs[_0x3488('0x3c')](_0x2bbb92['query'][_0x3488('0x3c')]);_0x304d3f['where']=qs[_0x3488('0x3d')](_[_0x3488('0x3e')](_0x2bbb92[_0x3488('0x34')],_0x43a4a7[_0x3488('0x3d')]),_0x540aed);if(_0x2bbb92[_0x3488('0x34')][_0x3488('0x3f')]){_0x304d3f['where']=_[_0x3488('0x40')](_0x304d3f[_0x3488('0x41')],{'$or':_[_0x3488('0x42')](_0x540aed,function(_0x2a7a15){if(_0x2a7a15[_0x3488('0x43')]!=='VIRTUAL'){var _0x4498bd={};_0x4498bd[_0x2a7a15[_0x3488('0x2c')]]={'$like':'%'+_0x2bbb92[_0x3488('0x34')][_0x3488('0x3f')]+'%'};return _0x4498bd;}})});}_0x304d3f=_['merge']({},_0x304d3f,_0x2bbb92['options']);var _0x464bf9={'where':_0x304d3f['where']};return db[_0x3488('0x2f')]['count'](_0x464bf9)[_0x3488('0x28')](function(_0x543734){_0xa8ad2[_0x3488('0x22')]=_0x543734;if(_0x2bbb92['query'][_0x3488('0x44')]){_0x304d3f[_0x3488('0x45')]=[{'all':!![]}];}return db[_0x3488('0x2f')]['findAll'](_0x304d3f);})['then'](function(_0xc2ea10){_0xa8ad2[_0x3488('0x46')]=_0xc2ea10;return _0xa8ad2;})[_0x3488('0x28')](respondWithFilteredResult(_0x113b4c,_0x304d3f))[_0x3488('0x47')](handleError(_0x113b4c,null));};exports[_0x3488('0x48')]=function(_0x1b8dbe,_0x5adce8){var _0x39e9c3={'raw':![],'where':{'id':_0x1b8dbe[_0x3488('0x49')]['id']}},_0x7acbdb={};_0x7acbdb['model']=_['keys'](db[_0x3488('0x2f')][_0x3488('0x30')]);_0x7acbdb['query']=_[_0x3488('0x4a')](_0x1b8dbe[_0x3488('0x34')]);_0x7acbdb[_0x3488('0x3d')]=_['intersection'](_0x7acbdb[_0x3488('0x33')],_0x7acbdb[_0x3488('0x34')]);_0x39e9c3[_0x3488('0x36')]=_['intersection'](_0x7acbdb[_0x3488('0x33')],qs[_0x3488('0x37')](_0x1b8dbe[_0x3488('0x34')][_0x3488('0x37')]));_0x39e9c3['attributes']=_0x39e9c3[_0x3488('0x36')][_0x3488('0x38')]?_0x39e9c3['attributes']:_0x7acbdb[_0x3488('0x33')];if(_0x1b8dbe[_0x3488('0x34')][_0x3488('0x44')]){_0x39e9c3[_0x3488('0x45')]=[{'all':!![]}];}_0x39e9c3=_[_0x3488('0x40')]({},_0x39e9c3,_0x1b8dbe[_0x3488('0x4b')]);return db[_0x3488('0x2f')][_0x3488('0x4c')](_0x39e9c3)[_0x3488('0x28')](handleEntityNotFound(_0x5adce8,null))[_0x3488('0x28')](respondWithResult(_0x5adce8,null))[_0x3488('0x47')](handleError(_0x5adce8,null));};exports[_0x3488('0x4d')]=function(_0x4c491f,_0x1c54ff){return db['FreshsalesConfiguration'][_0x3488('0x4d')](_0x4c491f['body'],{})[_0x3488('0x28')](respondWithResult(_0x1c54ff,0xc9))['catch'](handleError(_0x1c54ff,null));};exports[_0x3488('0x27')]=function(_0x103aec,_0x524519){if(_0x103aec['body']['id']){delete _0x103aec[_0x3488('0x4e')]['id'];}return db[_0x3488('0x2f')][_0x3488('0x4c')]({'where':{'id':_0x103aec[_0x3488('0x49')]['id']}})[_0x3488('0x28')](handleEntityNotFound(_0x524519,null))[_0x3488('0x28')](saveUpdates(_0x103aec[_0x3488('0x4e')],null))[_0x3488('0x28')](respondWithResult(_0x524519,null))[_0x3488('0x47')](handleError(_0x524519,null));};exports[_0x3488('0x29')]=function(_0x354cc0,_0x3e454c){return db[_0x3488('0x2f')][_0x3488('0x4c')]({'where':{'id':_0x354cc0[_0x3488('0x49')]['id']}})[_0x3488('0x28')](handleEntityNotFound(_0x3e454c,null))[_0x3488('0x28')](removeEntity(_0x3e454c,null))[_0x3488('0x47')](handleError(_0x3e454c,null));};exports[_0x3488('0x4f')]=function(_0xb025f9,_0x39ebef,_0x3ec44b){var _0x39305c={};var _0x6c8982={};var _0xde730d;var _0x48f622;return db[_0x3488('0x2f')][_0x3488('0x50')]({'where':{'id':_0xb025f9[_0x3488('0x49')]['id']}})[_0x3488('0x28')](handleEntityNotFound(_0x39ebef,null))[_0x3488('0x28')](function(_0x1699e0){if(_0x1699e0){_0xde730d=_0x1699e0;_0x6c8982['model']=_['keys'](db[_0x3488('0x51')][_0x3488('0x30')]);_0x6c8982[_0x3488('0x34')]=_[_0x3488('0x4a')](_0xb025f9['query']);_0x6c8982[_0x3488('0x3d')]=_[_0x3488('0x35')](_0x6c8982['model'],_0x6c8982[_0x3488('0x34')]);_0x39305c[_0x3488('0x36')]=_[_0x3488('0x35')](_0x6c8982[_0x3488('0x33')],qs[_0x3488('0x37')](_0xb025f9[_0x3488('0x34')][_0x3488('0x37')]));_0x39305c[_0x3488('0x36')]=_0x39305c[_0x3488('0x36')][_0x3488('0x38')]?_0x39305c[_0x3488('0x36')]:_0x6c8982[_0x3488('0x33')];_0x39305c[_0x3488('0x3b')]=qs[_0x3488('0x3c')](_0xb025f9[_0x3488('0x34')][_0x3488('0x3c')]);_0x39305c[_0x3488('0x41')]=qs['filters'](_[_0x3488('0x3e')](_0xb025f9[_0x3488('0x34')],_0x6c8982['filters']));if(_0xb025f9[_0x3488('0x34')][_0x3488('0x3f')]){_0x39305c['where']=_[_0x3488('0x40')](_0x39305c[_0x3488('0x41')],{'$or':_[_0x3488('0x42')](_0x39305c[_0x3488('0x36')],function(_0xa5184d){var _0x435377={};_0x435377[_0xa5184d]={'$like':'%'+_0xb025f9['query'][_0x3488('0x3f')]+'%'};return _0x435377;})});}_0x39305c=_[_0x3488('0x40')]({},_0x39305c,_0xb025f9[_0x3488('0x4b')]);return _0xde730d['getSubjects'](_0x39305c);}})[_0x3488('0x28')](function(_0x1a5ff9){if(_0x1a5ff9){_0x48f622=_0x1a5ff9[_0x3488('0x38')];if(!_0xb025f9[_0x3488('0x34')][_0x3488('0x39')](_0x3488('0x3a'))){_0x39305c[_0x3488('0x21')]=qs[_0x3488('0x21')](_0xb025f9[_0x3488('0x34')]['limit']);_0x39305c[_0x3488('0x1f')]=qs[_0x3488('0x1f')](_0xb025f9[_0x3488('0x34')][_0x3488('0x1f')]);}return _0xde730d[_0x3488('0x4f')](_0x39305c);}})[_0x3488('0x28')](function(_0x4b379d){if(_0x4b379d){return _0x4b379d?{'count':_0x48f622,'rows':_0x4b379d}:null;}})[_0x3488('0x28')](respondWithResult(_0x39ebef,null))[_0x3488('0x47')](handleError(_0x39ebef,null));};exports['getDescriptions']=function(_0x3f5f48,_0x214159,_0x3b9498){var _0x8a562b={};var _0x2f7704={};var _0xd55346;var _0x55f22f;return db[_0x3488('0x2f')]['findOne']({'where':{'id':_0x3f5f48[_0x3488('0x49')]['id']}})[_0x3488('0x28')](handleEntityNotFound(_0x214159,null))['then'](function(_0x17f60d){if(_0x17f60d){_0xd55346=_0x17f60d;_0x2f7704['model']=_[_0x3488('0x4a')](db[_0x3488('0x51')]['rawAttributes']);_0x2f7704[_0x3488('0x34')]=_['keys'](_0x3f5f48[_0x3488('0x34')]);_0x2f7704[_0x3488('0x3d')]=_['intersection'](_0x2f7704[_0x3488('0x33')],_0x2f7704['query']);_0x8a562b[_0x3488('0x36')]=_[_0x3488('0x35')](_0x2f7704['model'],qs['fields'](_0x3f5f48[_0x3488('0x34')][_0x3488('0x37')]));_0x8a562b['attributes']=_0x8a562b[_0x3488('0x36')]['length']?_0x8a562b['attributes']:_0x2f7704[_0x3488('0x33')];_0x8a562b['order']=qs[_0x3488('0x3c')](_0x3f5f48[_0x3488('0x34')]['sort']);_0x8a562b[_0x3488('0x41')]=qs['filters'](_[_0x3488('0x3e')](_0x3f5f48[_0x3488('0x34')],_0x2f7704['filters']));if(_0x3f5f48[_0x3488('0x34')]['filter']){_0x8a562b[_0x3488('0x41')]=_[_0x3488('0x40')](_0x8a562b[_0x3488('0x41')],{'$or':_['map'](_0x8a562b[_0x3488('0x36')],function(_0x349127){var _0x58915e={};_0x58915e[_0x349127]={'$like':'%'+_0x3f5f48[_0x3488('0x34')][_0x3488('0x3f')]+'%'};return _0x58915e;})});}_0x8a562b=_[_0x3488('0x40')]({},_0x8a562b,_0x3f5f48[_0x3488('0x4b')]);return _0xd55346[_0x3488('0x52')](_0x8a562b);}})[_0x3488('0x28')](function(_0x28ff3c){if(_0x28ff3c){_0x55f22f=_0x28ff3c[_0x3488('0x38')];if(!_0x3f5f48[_0x3488('0x34')][_0x3488('0x39')](_0x3488('0x3a'))){_0x8a562b['limit']=qs[_0x3488('0x21')](_0x3f5f48[_0x3488('0x34')][_0x3488('0x21')]);_0x8a562b['offset']=qs['offset'](_0x3f5f48[_0x3488('0x34')]['offset']);}return _0xd55346[_0x3488('0x52')](_0x8a562b);}})[_0x3488('0x28')](function(_0x45d322){if(_0x45d322){return _0x45d322?{'count':_0x55f22f,'rows':_0x45d322}:null;}})[_0x3488('0x28')](respondWithResult(_0x214159,null))[_0x3488('0x47')](handleError(_0x214159,null));};exports[_0x3488('0x53')]=function(_0x2cfd2a,_0x57ef2d,_0x873325){var _0x36419c={};var _0x4a490d={};var _0x5bc540;var _0x44ed17;return db[_0x3488('0x2f')][_0x3488('0x50')]({'where':{'id':_0x2cfd2a[_0x3488('0x49')]['id']}})[_0x3488('0x28')](handleEntityNotFound(_0x57ef2d,null))[_0x3488('0x28')](function(_0x1baa55){if(_0x1baa55){_0x5bc540=_0x1baa55;_0x4a490d[_0x3488('0x33')]=_[_0x3488('0x4a')](db[_0x3488('0x51')][_0x3488('0x30')]);_0x4a490d[_0x3488('0x34')]=_['keys'](_0x2cfd2a[_0x3488('0x34')]);_0x4a490d['filters']=_[_0x3488('0x35')](_0x4a490d['model'],_0x4a490d[_0x3488('0x34')]);_0x36419c[_0x3488('0x36')]=_['intersection'](_0x4a490d[_0x3488('0x33')],qs['fields'](_0x2cfd2a[_0x3488('0x34')][_0x3488('0x37')]));_0x36419c['attributes']=_0x36419c[_0x3488('0x36')][_0x3488('0x38')]?_0x36419c[_0x3488('0x36')]:_0x4a490d[_0x3488('0x33')];_0x36419c[_0x3488('0x3b')]=qs[_0x3488('0x3c')](_0x2cfd2a['query'][_0x3488('0x3c')]);_0x36419c[_0x3488('0x41')]=qs[_0x3488('0x3d')](_['pick'](_0x2cfd2a['query'],_0x4a490d['filters']));if(_0x2cfd2a[_0x3488('0x34')]['filter']){_0x36419c['where']=_[_0x3488('0x40')](_0x36419c['where'],{'$or':_[_0x3488('0x42')](_0x36419c[_0x3488('0x36')],function(_0x6d25a1){var _0x186f46={};_0x186f46[_0x6d25a1]={'$like':'%'+_0x2cfd2a[_0x3488('0x34')]['filter']+'%'};return _0x186f46;})});}_0x36419c=_['merge']({},_0x36419c,_0x2cfd2a['options']);return _0x5bc540[_0x3488('0x53')](_0x36419c);}})['then'](function(_0x401478){if(_0x401478){_0x44ed17=_0x401478[_0x3488('0x38')];if(!_0x2cfd2a[_0x3488('0x34')][_0x3488('0x39')](_0x3488('0x3a'))){_0x36419c[_0x3488('0x21')]=qs[_0x3488('0x21')](_0x2cfd2a[_0x3488('0x34')][_0x3488('0x21')]);_0x36419c[_0x3488('0x1f')]=qs[_0x3488('0x1f')](_0x2cfd2a[_0x3488('0x34')]['offset']);}return _0x5bc540['getFields'](_0x36419c);}})['then'](function(_0x4fe4b2){if(_0x4fe4b2){return _0x4fe4b2?{'count':_0x44ed17,'rows':_0x4fe4b2}:null;}})[_0x3488('0x28')](respondWithResult(_0x57ef2d,null))[_0x3488('0x47')](handleError(_0x57ef2d,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 608f415..6a50819 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 _0x1596=['int_freshsales_configurations','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','FreshsalesConfiguration'];(function(_0x10894f,_0x1708b3){var _0x4cf093=function(_0x314988){while(--_0x314988){_0x10894f['push'](_0x10894f['shift']());}};_0x4cf093(++_0x1708b3);}(_0x1596,0x97));var _0x6159=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x1596[_0x46698a];return _0x356db0;};'use strict';var _=require(_0x6159('0x0'));var util=require(_0x6159('0x1'));var logger=require(_0x6159('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6159('0x3'));var rp=require(_0x6159('0x4'));var fs=require('fs');var path=require(_0x6159('0x5'));var rimraf=require(_0x6159('0x6'));var config=require(_0x6159('0x7'));var attributes=require('./intFreshsalesConfiguration.attributes');module['exports']=function(_0x58cf35,_0x4792ca){return _0x58cf35['define'](_0x6159('0x8'),attributes,{'tableName':_0x6159('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x20aa=['moment','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','define','lodash','../../config/logger'];(function(_0x4dea75,_0x55612d){var _0x3d71da=function(_0x20a802){while(--_0x20a802){_0x4dea75['push'](_0x4dea75['shift']());}};_0x3d71da(++_0x55612d);}(_0x20aa,0x1ce));var _0xa20a=function(_0x360aad,_0x24311a){_0x360aad=_0x360aad-0x0;var _0x43d98f=_0x20aa[_0x360aad];return _0x43d98f;};'use strict';var _=require(_0xa20a('0x0'));var util=require('util');var logger=require(_0xa20a('0x1'))('api');var moment=require(_0xa20a('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa20a('0x3'));var rimraf=require(_0xa20a('0x4'));var config=require(_0xa20a('0x5'));var attributes=require(_0xa20a('0x6'));module['exports']=function(_0x1d601a,_0x37891d){return _0x1d601a[_0xa20a('0x7')]('FreshsalesConfiguration',attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index e5b4e5e..21329d9 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 _0xe629=['FreshsalesConfiguration,\x20%s,\x20%s','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','ioredis','../../config/logger','rpc','jayson/promise','client','http','then','info'];(function(_0x4b8c74,_0x4a8268){var _0x30ab1f=function(_0x22a01a){while(--_0x22a01a){_0x4b8c74['push'](_0x4b8c74['shift']());}};_0x30ab1f(++_0x4a8268);}(_0xe629,0x95));var _0x9e62=function(_0x39c87f,_0x4d9143){_0x39c87f=_0x39c87f-0x0;var _0x5cf316=_0xe629[_0x39c87f];return _0x5cf316;};'use strict';var _=require(_0x9e62('0x0'));var util=require(_0x9e62('0x1'));var moment=require(_0x9e62('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9e62('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9e62('0x4'))(_0x9e62('0x5'));var config=require('../../config/environment');var jayson=require(_0x9e62('0x6'));var client=jayson[_0x9e62('0x7')][_0x9e62('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x21bf59,_0xc834c1,_0x2955ea){return new BPromise(function(_0x580155,_0xdc435a){return client['request'](_0x21bf59,_0x2955ea)[_0x9e62('0x9')](function(_0x150ed3){logger[_0x9e62('0xa')](_0x9e62('0xb'),_0xc834c1,'request\x20sent');logger[_0x9e62('0xc')](_0x9e62('0xd'),_0xc834c1,'request\x20sent',JSON[_0x9e62('0xe')](_0x150ed3));if(_0x150ed3['error']){if(_0x150ed3[_0x9e62('0xf')][_0x9e62('0x10')]===0x1f4){logger[_0x9e62('0xf')](_0x9e62('0xb'),_0xc834c1,_0x150ed3['error'][_0x9e62('0x11')]);return _0xdc435a(_0x150ed3['error'][_0x9e62('0x11')]);}logger[_0x9e62('0xf')](_0x9e62('0xb'),_0xc834c1,_0x150ed3[_0x9e62('0xf')][_0x9e62('0x11')]);return _0x580155(_0x150ed3['error']['message']);}else{logger[_0x9e62('0xa')](_0x9e62('0xb'),_0xc834c1,'request\x20sent');_0x580155(_0x150ed3[_0x9e62('0x12')][_0x9e62('0x11')]);}})[_0x9e62('0x13')](function(_0x5d89f2){logger[_0x9e62('0xf')]('FreshsalesConfiguration,\x20%s,\x20%s',_0xc834c1,_0x5d89f2);_0xdc435a(_0x5d89f2);});});} \ No newline at end of file +var _0x6809=['result','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info'];(function(_0x3022dd,_0x470d35){var _0x28647a=function(_0xff47be){while(--_0xff47be){_0x3022dd['push'](_0x3022dd['shift']());}};_0x28647a(++_0x470d35);}(_0x6809,0xe8));var _0x9680=function(_0x3c51d4,_0x36ba53){_0x3c51d4=_0x3c51d4-0x0;var _0x53c45f=_0x6809[_0x3c51d4];return _0x53c45f;};'use strict';var _=require(_0x9680('0x0'));var util=require('util');var moment=require(_0x9680('0x1'));var BPromise=require(_0x9680('0x2'));var rs=require(_0x9680('0x3'));var fs=require('fs');var Redis=require(_0x9680('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9680('0x5'));var logger=require(_0x9680('0x6'))(_0x9680('0x7'));var config=require(_0x9680('0x8'));var jayson=require(_0x9680('0x9'));var client=jayson[_0x9680('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x160449,_0xf270ec,_0x55ba2c){return new BPromise(function(_0x123137,_0x244a43){return client[_0x9680('0xb')](_0x160449,_0x55ba2c)[_0x9680('0xc')](function(_0x127e77){logger['info'](_0x9680('0xd'),_0xf270ec,_0x9680('0xe'));logger[_0x9680('0xf')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0xf270ec,_0x9680('0xe'),JSON['stringify'](_0x127e77));if(_0x127e77['error']){if(_0x127e77[_0x9680('0x10')][_0x9680('0x11')]===0x1f4){logger[_0x9680('0x10')]('FreshsalesConfiguration,\x20%s,\x20%s',_0xf270ec,_0x127e77['error'][_0x9680('0x12')]);return _0x244a43(_0x127e77[_0x9680('0x10')]['message']);}logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0xf270ec,_0x127e77[_0x9680('0x10')]['message']);return _0x123137(_0x127e77[_0x9680('0x10')][_0x9680('0x12')]);}else{logger[_0x9680('0x13')](_0x9680('0xd'),_0xf270ec,_0x9680('0xe'));_0x123137(_0x127e77[_0x9680('0x14')]['message']);}})['catch'](function(_0xb86821){logger['error'](_0x9680('0xd'),_0xf270ec,_0xb86821);_0x244a43(_0xb86821);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 493a74b..997e966 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 _0xa0bc=['exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','/:id','show','create','put','update','destroy'];(function(_0x48f7cf,_0x4baa04){var _0xc201c0=function(_0x23ff34){while(--_0x23ff34){_0x48f7cf['push'](_0x48f7cf['shift']());}};_0xc201c0(++_0x4baa04);}(_0xa0bc,0x1b6));var _0xca0b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa0bc[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xca0b('0x0'));var path=require(_0xca0b('0x1'));var timeout=require('connect-timeout');var express=require(_0xca0b('0x2'));var router=express[_0xca0b('0x3')]();var fs_extra=require(_0xca0b('0x4'));var auth=require(_0xca0b('0x5'));var interaction=require(_0xca0b('0x6'));var config=require(_0xca0b('0x7'));var controller=require(_0xca0b('0x8'));router[_0xca0b('0x9')]('/',auth[_0xca0b('0xa')](),controller[_0xca0b('0xb')]);router[_0xca0b('0x9')](_0xca0b('0xc'),auth[_0xca0b('0xa')](),controller[_0xca0b('0xd')]);router['post']('/',auth[_0xca0b('0xa')](),controller[_0xca0b('0xe')]);router[_0xca0b('0xf')](_0xca0b('0xc'),auth[_0xca0b('0xa')](),controller[_0xca0b('0x10')]);router['delete'](_0xca0b('0xc'),auth[_0xca0b('0xa')](),controller[_0xca0b('0x11')]);module[_0xca0b('0x12')]=router; \ No newline at end of file +var _0xf2c7=['isAuthenticated','/:id','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','get'];(function(_0x3e8bf8,_0x4e76d6){var _0x3391ce=function(_0x4f32d6){while(--_0x4f32d6){_0x3e8bf8['push'](_0x3e8bf8['shift']());}};_0x3391ce(++_0x4e76d6);}(_0xf2c7,0x1d8));var _0x7f2c=function(_0x31b31b,_0x5f044e){_0x31b31b=_0x31b31b-0x0;var _0x2c8fc2=_0xf2c7[_0x31b31b];return _0x2c8fc2;};'use strict';var multer=require(_0x7f2c('0x0'));var util=require(_0x7f2c('0x1'));var path=require(_0x7f2c('0x2'));var timeout=require(_0x7f2c('0x3'));var express=require('express');var router=express[_0x7f2c('0x4')]();var fs_extra=require(_0x7f2c('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7f2c('0x6'));var controller=require('./intFreshsalesField.controller');router[_0x7f2c('0x7')]('/',auth[_0x7f2c('0x8')](),controller['index']);router[_0x7f2c('0x7')](_0x7f2c('0x9'),auth[_0x7f2c('0x8')](),controller['show']);router[_0x7f2c('0xa')]('/',auth[_0x7f2c('0x8')](),controller[_0x7f2c('0xb')]);router[_0x7f2c('0xc')](_0x7f2c('0x9'),auth[_0x7f2c('0x8')](),controller['update']);router[_0x7f2c('0xd')](_0x7f2c('0x9'),auth[_0x7f2c('0x8')](),controller[_0x7f2c('0xe')]);module[_0x7f2c('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 10ade67..64c2cb1 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 _0x4bc9=['exports','ENUM','variable','customVariable','keyValue','picklist','string','STRING','BOOLEAN'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x4bc9,0x10e));var _0x94bc=function(_0x5446a9,_0x2cd655){_0x5446a9=_0x5446a9-0x0;var _0x1805c6=_0x4bc9[_0x5446a9];return _0x1805c6;};'use strict';var Sequelize=require('sequelize');module[_0x94bc('0x0')]={'type':{'type':Sequelize[_0x94bc('0x1')]('string',_0x94bc('0x2'),_0x94bc('0x3'),_0x94bc('0x4'),_0x94bc('0x5')),'defaultValue':_0x94bc('0x6')},'content':{'type':Sequelize[_0x94bc('0x7')]},'key':{'type':Sequelize[_0x94bc('0x7')]},'keyType':{'type':Sequelize[_0x94bc('0x1')](_0x94bc('0x6'),_0x94bc('0x2'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x94bc('0x7')]},'nameField':{'type':Sequelize[_0x94bc('0x7')]},'customField':{'type':Sequelize[_0x94bc('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x94bc('0x7')]}}; \ No newline at end of file +var _0xa98b=['BOOLEAN','ENUM','string','keyValue','picklist','STRING','variable','customVariable'];(function(_0x39e038,_0x25e5f5){var _0x505af8=function(_0x2ebc0f){while(--_0x2ebc0f){_0x39e038['push'](_0x39e038['shift']());}};_0x505af8(++_0x25e5f5);}(_0xa98b,0x1e1));var _0xba98=function(_0x298884,_0x1069a4){_0x298884=_0x298884-0x0;var _0x3f918f=_0xa98b[_0x298884];return _0x3f918f;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xba98('0x0')](_0xba98('0x1'),'variable','customVariable',_0xba98('0x2'),_0xba98('0x3')),'defaultValue':'string'},'content':{'type':Sequelize[_0xba98('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xba98('0x1'),_0xba98('0x5'),_0xba98('0x6'))},'keyContent':{'type':Sequelize[_0xba98('0x4')]},'idField':{'type':Sequelize[_0xba98('0x4')]},'nameField':{'type':Sequelize[_0xba98('0x4')]},'customField':{'type':Sequelize[_0xba98('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xba98('0x4')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index fbad0c1..b7b6456 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 _0x5315=['includeAll','include','findAll','then','catch','show','params','find','create','body','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','reject','update','destroy','error','stack','name','send','index','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','map','VIRTUAL','merge','options','FreshsalesField'];(function(_0x380d14,_0x385012){var _0x281039=function(_0x434aab){while(--_0x434aab){_0x380d14['push'](_0x380d14['shift']());}};_0x281039(++_0x385012);}(_0x5315,0x1b4));var _0x5531=function(_0x2322c9,_0x11ea3b){_0x2322c9=_0x2322c9-0x0;var _0x5a96c6=_0x5315[_0x2322c9];return _0x5a96c6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5531('0x0'));var rp=require(_0x5531('0x1'));var moment=require(_0x5531('0x2'));var BPromise=require(_0x5531('0x3'));var Mustache=require(_0x5531('0x4'));var util=require(_0x5531('0x5'));var path=require(_0x5531('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5531('0x7'));var fs=require('fs');var fs_extra=require(_0x5531('0x8'));var _=require(_0x5531('0x9'));var squel=require(_0x5531('0xa'));var crypto=require('crypto');var jsforce=require(_0x5531('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x5531('0xc'));var querystring=require(_0x5531('0xd'));var Papa=require(_0x5531('0xe'));var Redis=require('ioredis');var authService=require(_0x5531('0xf'));var qs=require(_0x5531('0x10'));var as=require(_0x5531('0x11'));var hardwareService=require(_0x5531('0x12'));var logger=require('../../config/logger')(_0x5531('0x13'));var utils=require(_0x5531('0x14'));var config=require(_0x5531('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x5531('0x16'))['db'];function respondWithStatusCode(_0x1f2508,_0x288897){_0x288897=_0x288897||0xcc;return function(_0x254985){if(_0x254985){return _0x1f2508[_0x5531('0x17')](_0x288897);}return _0x1f2508[_0x5531('0x18')](_0x288897)[_0x5531('0x19')]();};}function respondWithResult(_0x497097,_0x988196){_0x988196=_0x988196||0xc8;return function(_0x425c8a){if(_0x425c8a){return _0x497097[_0x5531('0x18')](_0x988196)['json'](_0x425c8a);}};}function respondWithFilteredResult(_0x42148e,_0x531ebe){return function(_0x5b0d06){if(_0x5b0d06){var _0xbc2ab4=typeof _0x531ebe[_0x5531('0x1a')]==='undefined'&&typeof _0x531ebe['limit']===_0x5531('0x1b');var _0x1cd1bf=_0x5b0d06[_0x5531('0x1c')];var _0x131804=_0xbc2ab4?0x0:_0x531ebe[_0x5531('0x1a')];var _0x257034=_0xbc2ab4?_0x5b0d06[_0x5531('0x1c')]:_0x531ebe[_0x5531('0x1a')]+_0x531ebe[_0x5531('0x1d')];var _0x3a12ae;if(_0x257034>=_0x1cd1bf){_0x257034=_0x1cd1bf;_0x3a12ae=0xc8;}else{_0x3a12ae=0xce;}_0x42148e[_0x5531('0x18')](_0x3a12ae);return _0x42148e['set'](_0x5531('0x1e'),_0x131804+'-'+_0x257034+'/'+_0x1cd1bf)[_0x5531('0x1f')](_0x5b0d06);}return null;};}function patchUpdates(_0x1c2fad){return function(_0xce025a){try{jsonpatch['apply'](_0xce025a,_0x1c2fad,!![]);}catch(_0x450dda){return BPromise[_0x5531('0x20')](_0x450dda);}return _0xce025a['save']();};}function saveUpdates(_0x25befb,_0x331c8d){return function(_0x1c53ba){if(_0x1c53ba){return _0x1c53ba[_0x5531('0x21')](_0x25befb)['then'](function(_0x28f887){return _0x28f887;});}return null;};}function removeEntity(_0x11cfe6,_0x1486c9){return function(_0x3bd898){if(_0x3bd898){return _0x3bd898[_0x5531('0x22')]()['then'](function(){_0x11cfe6['status'](0xcc)[_0x5531('0x19')]();});}};}function handleEntityNotFound(_0x37d6b6,_0x5ded30){return function(_0x1506ab){if(!_0x1506ab){_0x37d6b6[_0x5531('0x17')](0x194);}return _0x1506ab;};}function handleError(_0x155fb3,_0x567a5c){_0x567a5c=_0x567a5c||0x1f4;return function(_0x2d9cdc){logger[_0x5531('0x23')](_0x2d9cdc[_0x5531('0x24')]);if(_0x2d9cdc[_0x5531('0x25')]){delete _0x2d9cdc[_0x5531('0x25')];}_0x155fb3['status'](_0x567a5c)[_0x5531('0x26')](_0x2d9cdc);};}exports[_0x5531('0x27')]=function(_0x50d853,_0x58c602){var _0x4c4ebd={},_0x5a1332={},_0xc65b02={'count':0x0,'rows':[]};var _0x1b9360=_['map'](db['FreshsalesField'][_0x5531('0x28')],function(_0x458cc9){return{'name':_0x458cc9[_0x5531('0x29')],'type':_0x458cc9['type'][_0x5531('0x2a')]};});_0x5a1332[_0x5531('0x2b')]=_['map'](_0x1b9360,_0x5531('0x25'));_0x5a1332[_0x5531('0x2c')]=_[_0x5531('0x2d')](_0x50d853['query']);_0x5a1332[_0x5531('0x2e')]=_[_0x5531('0x2f')](_0x5a1332[_0x5531('0x2b')],_0x5a1332[_0x5531('0x2c')]);_0x4c4ebd['attributes']=_[_0x5531('0x2f')](_0x5a1332['model'],qs[_0x5531('0x30')](_0x50d853[_0x5531('0x2c')][_0x5531('0x30')]));_0x4c4ebd['attributes']=_0x4c4ebd[_0x5531('0x31')][_0x5531('0x32')]?_0x4c4ebd[_0x5531('0x31')]:_0x5a1332[_0x5531('0x2b')];if(!_0x50d853[_0x5531('0x2c')]['hasOwnProperty']('nolimit')){_0x4c4ebd[_0x5531('0x1d')]=qs[_0x5531('0x1d')](_0x50d853['query'][_0x5531('0x1d')]);_0x4c4ebd[_0x5531('0x1a')]=qs[_0x5531('0x1a')](_0x50d853[_0x5531('0x2c')]['offset']);}_0x4c4ebd[_0x5531('0x33')]=qs['sort'](_0x50d853[_0x5531('0x2c')][_0x5531('0x34')]);_0x4c4ebd[_0x5531('0x35')]=qs['filters'](_[_0x5531('0x36')](_0x50d853[_0x5531('0x2c')],_0x5a1332[_0x5531('0x2e')]),_0x1b9360);if(_0x50d853[_0x5531('0x2c')][_0x5531('0x37')]){_0x4c4ebd[_0x5531('0x35')]=_['merge'](_0x4c4ebd[_0x5531('0x35')],{'$or':_[_0x5531('0x38')](_0x1b9360,function(_0x1e8322){if(_0x1e8322['type']!==_0x5531('0x39')){var _0x4616e6={};_0x4616e6[_0x1e8322[_0x5531('0x25')]]={'$like':'%'+_0x50d853[_0x5531('0x2c')][_0x5531('0x37')]+'%'};return _0x4616e6;}})});}_0x4c4ebd=_[_0x5531('0x3a')]({},_0x4c4ebd,_0x50d853[_0x5531('0x3b')]);var _0x2759bc={'where':_0x4c4ebd[_0x5531('0x35')]};return db[_0x5531('0x3c')][_0x5531('0x1c')](_0x2759bc)['then'](function(_0x200b5a){_0xc65b02['count']=_0x200b5a;if(_0x50d853['query'][_0x5531('0x3d')]){_0x4c4ebd[_0x5531('0x3e')]=[{'all':!![]}];}return db[_0x5531('0x3c')][_0x5531('0x3f')](_0x4c4ebd);})[_0x5531('0x40')](function(_0x2207d4){_0xc65b02['rows']=_0x2207d4;return _0xc65b02;})[_0x5531('0x40')](respondWithFilteredResult(_0x58c602,_0x4c4ebd))[_0x5531('0x41')](handleError(_0x58c602,null));};exports[_0x5531('0x42')]=function(_0xe75199,_0xb13f41){var _0xb434e2={'raw':!![],'where':{'id':_0xe75199[_0x5531('0x43')]['id']}},_0x37e7b8={};_0x37e7b8[_0x5531('0x2b')]=_[_0x5531('0x2d')](db[_0x5531('0x3c')][_0x5531('0x28')]);_0x37e7b8[_0x5531('0x2c')]=_[_0x5531('0x2d')](_0xe75199[_0x5531('0x2c')]);_0x37e7b8[_0x5531('0x2e')]=_[_0x5531('0x2f')](_0x37e7b8[_0x5531('0x2b')],_0x37e7b8['query']);_0xb434e2[_0x5531('0x31')]=_[_0x5531('0x2f')](_0x37e7b8[_0x5531('0x2b')],qs[_0x5531('0x30')](_0xe75199['query'][_0x5531('0x30')]));_0xb434e2[_0x5531('0x31')]=_0xb434e2[_0x5531('0x31')][_0x5531('0x32')]?_0xb434e2[_0x5531('0x31')]:_0x37e7b8[_0x5531('0x2b')];if(_0xe75199[_0x5531('0x2c')]['includeAll']){_0xb434e2[_0x5531('0x3e')]=[{'all':!![]}];}_0xb434e2=_['merge']({},_0xb434e2,_0xe75199['options']);return db['FreshsalesField'][_0x5531('0x44')](_0xb434e2)[_0x5531('0x40')](handleEntityNotFound(_0xb13f41,null))[_0x5531('0x40')](respondWithResult(_0xb13f41,null))[_0x5531('0x41')](handleError(_0xb13f41,null));};exports[_0x5531('0x45')]=function(_0x3b84c3,_0x337014){return db[_0x5531('0x3c')][_0x5531('0x45')](_0x3b84c3[_0x5531('0x46')],{})['then'](respondWithResult(_0x337014,0xc9))[_0x5531('0x41')](handleError(_0x337014,null));};exports[_0x5531('0x21')]=function(_0x49cf32,_0x38dbe5){if(_0x49cf32['body']['id']){delete _0x49cf32[_0x5531('0x46')]['id'];}return db[_0x5531('0x3c')]['find']({'where':{'id':_0x49cf32[_0x5531('0x43')]['id']}})['then'](handleEntityNotFound(_0x38dbe5,null))[_0x5531('0x40')](saveUpdates(_0x49cf32[_0x5531('0x46')],null))['then'](respondWithResult(_0x38dbe5,null))[_0x5531('0x41')](handleError(_0x38dbe5,null));};exports['destroy']=function(_0x3c64b0,_0x4602be){return db[_0x5531('0x3c')][_0x5531('0x44')]({'where':{'id':_0x3c64b0[_0x5531('0x43')]['id']}})[_0x5531('0x40')](handleEntityNotFound(_0x4602be,null))[_0x5531('0x40')](removeEntity(_0x4602be,null))['catch'](handleError(_0x4602be,null));}; \ No newline at end of file +var _0xf402=['where','pick','merge','VIRTUAL','options','FreshsalesField','includeAll','findAll','rows','catch','show','params','include','create','body','find','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','then','destroy','sendStatus','stack','name','index','map','rawAttributes','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort'];(function(_0x5af08d,_0x1d182d){var _0x295832=function(_0x228ed6){while(--_0x228ed6){_0x5af08d['push'](_0x5af08d['shift']());}};_0x295832(++_0x1d182d);}(_0xf402,0x1cc));var _0x2f40=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xf402[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0x2f40('0x0'));var rimraf=require(_0x2f40('0x1'));var zipdir=require(_0x2f40('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2f40('0x3'));var moment=require(_0x2f40('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2f40('0x5'));var util=require(_0x2f40('0x6'));var path=require(_0x2f40('0x7'));var sox=require(_0x2f40('0x8'));var csv=require(_0x2f40('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2f40('0xa'));var _=require(_0x2f40('0xb'));var squel=require(_0x2f40('0xc'));var crypto=require(_0x2f40('0xd'));var jsforce=require(_0x2f40('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2f40('0xf'));var Papa=require(_0x2f40('0x10'));var Redis=require('ioredis');var authService=require(_0x2f40('0x11'));var qs=require(_0x2f40('0x12'));var as=require(_0x2f40('0x13'));var hardwareService=require(_0x2f40('0x14'));var logger=require(_0x2f40('0x15'))(_0x2f40('0x16'));var utils=require('../../config/utils');var config=require(_0x2f40('0x17'));var licenseUtil=require(_0x2f40('0x18'));var db=require(_0x2f40('0x19'))['db'];function respondWithStatusCode(_0xfee0f1,_0x52e4a3){_0x52e4a3=_0x52e4a3||0xcc;return function(_0x5699eb){if(_0x5699eb){return _0xfee0f1['sendStatus'](_0x52e4a3);}return _0xfee0f1[_0x2f40('0x1a')](_0x52e4a3)[_0x2f40('0x1b')]();};}function respondWithResult(_0x248c5f,_0x49626e){_0x49626e=_0x49626e||0xc8;return function(_0x39ec4c){if(_0x39ec4c){return _0x248c5f[_0x2f40('0x1a')](_0x49626e)[_0x2f40('0x1c')](_0x39ec4c);}};}function respondWithFilteredResult(_0x13ae22,_0x40eacf){return function(_0x219b07){if(_0x219b07){var _0xcfacbf=typeof _0x40eacf[_0x2f40('0x1d')]===_0x2f40('0x1e')&&typeof _0x40eacf['limit']===_0x2f40('0x1e');var _0x49d31a=_0x219b07['count'];var _0x123893=_0xcfacbf?0x0:_0x40eacf['offset'];var _0x4f6257=_0xcfacbf?_0x219b07[_0x2f40('0x1f')]:_0x40eacf[_0x2f40('0x1d')]+_0x40eacf[_0x2f40('0x20')];var _0x10b211;if(_0x4f6257>=_0x49d31a){_0x4f6257=_0x49d31a;_0x10b211=0xc8;}else{_0x10b211=0xce;}_0x13ae22[_0x2f40('0x1a')](_0x10b211);return _0x13ae22['set'](_0x2f40('0x21'),_0x123893+'-'+_0x4f6257+'/'+_0x49d31a)[_0x2f40('0x1c')](_0x219b07);}return null;};}function patchUpdates(_0x4b5a8b){return function(_0x3a8890){try{jsonpatch[_0x2f40('0x22')](_0x3a8890,_0x4b5a8b,!![]);}catch(_0x41546f){return BPromise[_0x2f40('0x23')](_0x41546f);}return _0x3a8890[_0x2f40('0x24')]();};}function saveUpdates(_0x12c20d,_0x58bd22){return function(_0x467800){if(_0x467800){return _0x467800['update'](_0x12c20d)[_0x2f40('0x25')](function(_0x3d67ea){return _0x3d67ea;});}return null;};}function removeEntity(_0x81c9ad,_0xaa42a5){return function(_0x31e133){if(_0x31e133){return _0x31e133[_0x2f40('0x26')]()[_0x2f40('0x25')](function(){_0x81c9ad[_0x2f40('0x1a')](0xcc)[_0x2f40('0x1b')]();});}};}function handleEntityNotFound(_0x272735,_0x29aa9b){return function(_0x5612fd){if(!_0x5612fd){_0x272735[_0x2f40('0x27')](0x194);}return _0x5612fd;};}function handleError(_0x567748,_0x5467af){_0x5467af=_0x5467af||0x1f4;return function(_0x42ac42){logger['error'](_0x42ac42[_0x2f40('0x28')]);if(_0x42ac42['name']){delete _0x42ac42[_0x2f40('0x29')];}_0x567748[_0x2f40('0x1a')](_0x5467af)['send'](_0x42ac42);};}exports[_0x2f40('0x2a')]=function(_0x22a3c1,_0x366379){var _0x59da16={},_0x2d845d={},_0x15d1f2={'count':0x0,'rows':[]};var _0x5e84bc=_[_0x2f40('0x2b')](db['FreshsalesField'][_0x2f40('0x2c')],function(_0x5e2958){return{'name':_0x5e2958['fieldName'],'type':_0x5e2958['type'][_0x2f40('0x2d')]};});_0x2d845d[_0x2f40('0x2e')]=_[_0x2f40('0x2b')](_0x5e84bc,'name');_0x2d845d['query']=_[_0x2f40('0x2f')](_0x22a3c1[_0x2f40('0x30')]);_0x2d845d[_0x2f40('0x31')]=_['intersection'](_0x2d845d['model'],_0x2d845d[_0x2f40('0x30')]);_0x59da16['attributes']=_[_0x2f40('0x32')](_0x2d845d[_0x2f40('0x2e')],qs[_0x2f40('0x33')](_0x22a3c1[_0x2f40('0x30')][_0x2f40('0x33')]));_0x59da16[_0x2f40('0x34')]=_0x59da16[_0x2f40('0x34')][_0x2f40('0x35')]?_0x59da16[_0x2f40('0x34')]:_0x2d845d[_0x2f40('0x2e')];if(!_0x22a3c1[_0x2f40('0x30')][_0x2f40('0x36')](_0x2f40('0x37'))){_0x59da16[_0x2f40('0x20')]=qs['limit'](_0x22a3c1[_0x2f40('0x30')][_0x2f40('0x20')]);_0x59da16[_0x2f40('0x1d')]=qs[_0x2f40('0x1d')](_0x22a3c1[_0x2f40('0x30')][_0x2f40('0x1d')]);}_0x59da16[_0x2f40('0x38')]=qs[_0x2f40('0x39')](_0x22a3c1[_0x2f40('0x30')][_0x2f40('0x39')]);_0x59da16[_0x2f40('0x3a')]=qs[_0x2f40('0x31')](_[_0x2f40('0x3b')](_0x22a3c1[_0x2f40('0x30')],_0x2d845d[_0x2f40('0x31')]),_0x5e84bc);if(_0x22a3c1[_0x2f40('0x30')]['filter']){_0x59da16[_0x2f40('0x3a')]=_[_0x2f40('0x3c')](_0x59da16['where'],{'$or':_[_0x2f40('0x2b')](_0x5e84bc,function(_0x4dc329){if(_0x4dc329['type']!==_0x2f40('0x3d')){var _0x285650={};_0x285650[_0x4dc329['name']]={'$like':'%'+_0x22a3c1[_0x2f40('0x30')]['filter']+'%'};return _0x285650;}})});}_0x59da16=_[_0x2f40('0x3c')]({},_0x59da16,_0x22a3c1[_0x2f40('0x3e')]);var _0x19083f={'where':_0x59da16[_0x2f40('0x3a')]};return db[_0x2f40('0x3f')]['count'](_0x19083f)['then'](function(_0x1248df){_0x15d1f2['count']=_0x1248df;if(_0x22a3c1['query'][_0x2f40('0x40')]){_0x59da16['include']=[{'all':!![]}];}return db[_0x2f40('0x3f')][_0x2f40('0x41')](_0x59da16);})[_0x2f40('0x25')](function(_0x1aa58d){_0x15d1f2[_0x2f40('0x42')]=_0x1aa58d;return _0x15d1f2;})['then'](respondWithFilteredResult(_0x366379,_0x59da16))[_0x2f40('0x43')](handleError(_0x366379,null));};exports[_0x2f40('0x44')]=function(_0x386664,_0x36678f){var _0x504e9b={'raw':!![],'where':{'id':_0x386664[_0x2f40('0x45')]['id']}},_0x130cba={};_0x130cba[_0x2f40('0x2e')]=_[_0x2f40('0x2f')](db[_0x2f40('0x3f')][_0x2f40('0x2c')]);_0x130cba[_0x2f40('0x30')]=_[_0x2f40('0x2f')](_0x386664['query']);_0x130cba['filters']=_[_0x2f40('0x32')](_0x130cba[_0x2f40('0x2e')],_0x130cba[_0x2f40('0x30')]);_0x504e9b[_0x2f40('0x34')]=_[_0x2f40('0x32')](_0x130cba[_0x2f40('0x2e')],qs[_0x2f40('0x33')](_0x386664[_0x2f40('0x30')]['fields']));_0x504e9b[_0x2f40('0x34')]=_0x504e9b[_0x2f40('0x34')][_0x2f40('0x35')]?_0x504e9b[_0x2f40('0x34')]:_0x130cba[_0x2f40('0x2e')];if(_0x386664[_0x2f40('0x30')][_0x2f40('0x40')]){_0x504e9b[_0x2f40('0x46')]=[{'all':!![]}];}_0x504e9b=_[_0x2f40('0x3c')]({},_0x504e9b,_0x386664[_0x2f40('0x3e')]);return db[_0x2f40('0x3f')]['find'](_0x504e9b)[_0x2f40('0x25')](handleEntityNotFound(_0x36678f,null))['then'](respondWithResult(_0x36678f,null))[_0x2f40('0x43')](handleError(_0x36678f,null));};exports['create']=function(_0xccaa05,_0x4484d2){return db[_0x2f40('0x3f')][_0x2f40('0x47')](_0xccaa05[_0x2f40('0x48')],{})[_0x2f40('0x25')](respondWithResult(_0x4484d2,0xc9))[_0x2f40('0x43')](handleError(_0x4484d2,null));};exports['update']=function(_0x1a28bd,_0x7bb417){if(_0x1a28bd['body']['id']){delete _0x1a28bd[_0x2f40('0x48')]['id'];}return db[_0x2f40('0x3f')][_0x2f40('0x49')]({'where':{'id':_0x1a28bd[_0x2f40('0x45')]['id']}})[_0x2f40('0x25')](handleEntityNotFound(_0x7bb417,null))['then'](saveUpdates(_0x1a28bd[_0x2f40('0x48')],null))[_0x2f40('0x25')](respondWithResult(_0x7bb417,null))['catch'](handleError(_0x7bb417,null));};exports['destroy']=function(_0x27c787,_0xf1281f){return db[_0x2f40('0x3f')][_0x2f40('0x49')]({'where':{'id':_0x27c787[_0x2f40('0x45')]['id']}})['then'](handleEntityNotFound(_0xf1281f,null))['then'](removeEntity(_0xf1281f,null))['catch'](handleError(_0xf1281f,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 36292fc..6dbc39b 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 _0x2ff5=['../../config/environment','exports','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','FieldId','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0xde3364,_0x5432a8){var _0x3a9f02=function(_0x2a0060){while(--_0x2a0060){_0xde3364['push'](_0xde3364['shift']());}};_0x3a9f02(++_0x5432a8);}(_0x2ff5,0x1d5));var _0x52ff=function(_0x5b6a0b,_0x5e4a4a){_0x5b6a0b=_0x5b6a0b-0x0;var _0x4d8ac5=_0x2ff5[_0x5b6a0b];return _0x4d8ac5;};'use strict';var _=require('lodash');var util=require(_0x52ff('0x0'));var logger=require(_0x52ff('0x1'))('api');var moment=require(_0x52ff('0x2'));var BPromise=require(_0x52ff('0x3'));var rp=require(_0x52ff('0x4'));var fs=require('fs');var path=require(_0x52ff('0x5'));var rimraf=require(_0x52ff('0x6'));var config=require(_0x52ff('0x7'));var attributes=require('./intFreshsalesField.attributes');module[_0x52ff('0x8')]=function(_0x285f60,_0x26906c){return _0x285f60['define'](_0x52ff('0x9'),attributes,{'tableName':_0x52ff('0xa'),'paranoid':![],'indexes':[{'name':_0x52ff('0xb'),'fields':[_0x52ff('0xc'),_0x52ff('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x45d8=['path','../../config/environment','./intFreshsalesField.attributes','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x131483,_0x43583f){var _0x46b78e=function(_0x28e9cf){while(--_0x28e9cf){_0x131483['push'](_0x131483['shift']());}};_0x46b78e(++_0x43583f);}(_0x45d8,0x174));var _0x845d=function(_0x2911e2,_0x39c3d9){_0x2911e2=_0x2911e2-0x0;var _0x111b30=_0x45d8[_0x2911e2];return _0x111b30;};'use strict';var _=require(_0x845d('0x0'));var util=require(_0x845d('0x1'));var logger=require(_0x845d('0x2'))(_0x845d('0x3'));var moment=require(_0x845d('0x4'));var BPromise=require(_0x845d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x845d('0x6'));var rimraf=require('rimraf');var config=require(_0x845d('0x7'));var attributes=require(_0x845d('0x8'));module['exports']=function(_0x4ba664,_0x312806){return _0x4ba664['define'](_0x845d('0x9'),attributes,{'tableName':_0x845d('0xa'),'paranoid':![],'indexes':[{'name':_0x845d('0xb'),'fields':[_0x845d('0xc'),_0x845d('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index 2456a56..90922e1 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 _0x814b=['info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0x814b,0x1a2));var _0xb814=function(_0x3a441a,_0x43eb56){_0x3a441a=_0x3a441a-0x0;var _0x3128a2=_0x814b[_0x3a441a];return _0x3128a2;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('FreshsalesField,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});} \ No newline at end of file +var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','FreshsalesField,\x20%s,\x20%s','FreshsalesField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x32f38b,_0x1b4fc7){var _0x15ec9b=function(_0x1331da){while(--_0x1331da){_0x32f38b['push'](_0x32f38b['shift']());}};_0x15ec9b(++_0x1b4fc7);}(_0x2ef3,0xba));var _0x32ef=function(_0x5af492,_0x5e855e){_0x5af492=_0x5af492-0x0;var _0x20797b=_0x2ef3[_0x5af492];return _0x20797b;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('FreshsalesField,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('FreshsalesField,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 03a8097..e83af6a 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(_0x264408,_0x1c4b5a){var _0xb5b8af=function(_0x2ac881){while(--_0x2ac881){_0x264408['push'](_0x264408['shift']());}};_0xb5b8af(++_0x1c4b5a);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +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(_0x515d93,_0x24d70e){var _0x24f558=function(_0x33a853){while(--_0x33a853){_0x515d93['push'](_0x515d93['shift']());}};_0x24f558(++_0x24d70e);}(_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 diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index d0c1f1c..154edfe 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 _0xab95=['sequelize','exports','STRING','username','ENUM','newTab','integrationTab'];(function(_0xde654b,_0x12cc9e){var _0x170441=function(_0x3f06e4){while(--_0x3f06e4){_0xde654b['push'](_0xde654b['shift']());}};_0x170441(++_0x12cc9e);}(_0xab95,0x1d5));var _0x5ab9=function(_0x29aa09,_0x356563){_0x29aa09=_0x29aa09-0x0;var _0x506649=_0xab95[_0x29aa09];return _0x506649;};'use strict';var Sequelize=require(_0x5ab9('0x0'));module[_0x5ab9('0x1')]={'name':{'type':Sequelize[_0x5ab9('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x5ab9('0x2')],'unique':_0x5ab9('0x3')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x5ab9('0x2')]},'clientSecret':{'type':Sequelize[_0x5ab9('0x2')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x5ab9('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x5ab9('0x4')]('integrationTab',_0x5ab9('0x5')),'defaultValue':_0x5ab9('0x6')}}; \ No newline at end of file +var _0x225b=['ENUM','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x225b,0xb1));var _0xb225=function(_0x26d3d3,_0x23c4e2){_0x26d3d3=_0x26d3d3-0x0;var _0x5ea4b5=_0x225b[_0x26d3d3];return _0x5ea4b5;};'use strict';var Sequelize=require(_0xb225('0x0'));module[_0xb225('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb225('0x2')]},'username':{'type':Sequelize[_0xb225('0x2')],'unique':'username'},'remoteUri':{'type':Sequelize[_0xb225('0x2')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xb225('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0xb225('0x2')]},'serverUrl':{'type':Sequelize[_0xb225('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xb225('0x3')](_0xb225('0x4'),_0xb225('0x5')),'defaultValue':_0xb225('0x4')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 3299a6c..e4ac0f5 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 _0xe13c=['password','securityToken','slice','substring','lastIndexOf','Connection','login','ticketType','OwnerId','Subject','Description','string','int','picklist','phone','remove','includes','label','custom','picklistValues','true','False','false','test','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','fast-json-patch','moment','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','rows','catch','include','options','find','create','body','params','getConfigurations','findOne','SalesforceConfiguration','order','addConfiguration','AccountId','Subjects','channel','getDescriptions','SalesforceField','Descriptions','getFields','remoteUri','clientId','clientSecret','username'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe13c,0x16d));var _0xce13=function(_0x280cd4,_0x8ca5df){_0x280cd4=_0x280cd4-0x0;var _0x309673=_0xe13c[_0x280cd4];return _0x309673;};'use strict';var emlformat=require(_0xce13('0x0'));var rimraf=require(_0xce13('0x1'));var zipdir=require(_0xce13('0x2'));var jsonpatch=require(_0xce13('0x3'));var rp=require('request-promise');var moment=require(_0xce13('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xce13('0x5'));var sox=require(_0xce13('0x6'));var csv=require(_0xce13('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xce13('0x8'));var _=require(_0xce13('0x9'));var squel=require(_0xce13('0xa'));var crypto=require(_0xce13('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xce13('0xc'));var toCsv=require(_0xce13('0x7'));var querystring=require(_0xce13('0xd'));var Papa=require(_0xce13('0xe'));var Redis=require(_0xce13('0xf'));var authService=require(_0xce13('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xce13('0x11'));var hardwareService=require(_0xce13('0x12'));var logger=require('../../config/logger')(_0xce13('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xce13('0x14'));var db=require('../../mysqldb')['db'];var integrations=require(_0xce13('0x15'));function respondWithStatusCode(_0x5dd89f,_0x30192e){_0x30192e=_0x30192e||0xcc;return function(_0x3c3589){if(_0x3c3589){return _0x5dd89f[_0xce13('0x16')](_0x30192e);}return _0x5dd89f[_0xce13('0x17')](_0x30192e)['end']();};}function respondWithResult(_0xb33a4c,_0x4b44b5){_0x4b44b5=_0x4b44b5||0xc8;return function(_0x17d662){if(_0x17d662){return _0xb33a4c[_0xce13('0x17')](_0x4b44b5)[_0xce13('0x18')](_0x17d662);}};}function respondWithFilteredResult(_0x1562bf,_0x4fda4c){return function(_0x3809b5){if(_0x3809b5){var _0x22567e=typeof _0x4fda4c[_0xce13('0x19')]==='undefined'&&typeof _0x4fda4c['limit']===_0xce13('0x1a');var _0x2d3395=_0x3809b5[_0xce13('0x1b')];var _0x3335d9=_0x22567e?0x0:_0x4fda4c['offset'];var _0x25db39=_0x22567e?_0x3809b5[_0xce13('0x1b')]:_0x4fda4c[_0xce13('0x19')]+_0x4fda4c[_0xce13('0x1c')];var _0xf54a9c;if(_0x25db39>=_0x2d3395){_0x25db39=_0x2d3395;_0xf54a9c=0xc8;}else{_0xf54a9c=0xce;}_0x1562bf[_0xce13('0x17')](_0xf54a9c);return _0x1562bf['set'](_0xce13('0x1d'),_0x3335d9+'-'+_0x25db39+'/'+_0x2d3395)[_0xce13('0x18')](_0x3809b5);}return null;};}function patchUpdates(_0xebc4e3){return function(_0x117a9f){try{jsonpatch[_0xce13('0x1e')](_0x117a9f,_0xebc4e3,!![]);}catch(_0xd2cc1b){return BPromise[_0xce13('0x1f')](_0xd2cc1b);}return _0x117a9f[_0xce13('0x20')]();};}function saveUpdates(_0x178e39,_0x598704){return function(_0x53874c){if(_0x53874c){return _0x53874c[_0xce13('0x21')](_0x178e39)[_0xce13('0x22')](function(_0x137a80){return _0x137a80;});}return null;};}function removeEntity(_0x5f0ef4,_0x465aa5){return function(_0x842fbd){if(_0x842fbd){return _0x842fbd[_0xce13('0x23')]()['then'](function(){_0x5f0ef4[_0xce13('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fda1b,_0x264a7f){return function(_0x5e3257){if(!_0x5e3257){_0x4fda1b[_0xce13('0x16')](0x194);}return _0x5e3257;};}function handleError(_0x23fc84,_0x5e62c4){_0x5e62c4=_0x5e62c4||0x1f4;return function(_0x2eb0b8){logger[_0xce13('0x24')](_0x2eb0b8['stack']);if(_0x2eb0b8['name']){delete _0x2eb0b8[_0xce13('0x25')];}_0x23fc84[_0xce13('0x17')](_0x5e62c4)[_0xce13('0x26')](_0x2eb0b8);};}exports[_0xce13('0x27')]=function(_0x44e28a,_0x2f4f2d){var _0x560dd3={},_0x5ae33e={},_0x2c3677={'count':0x0,'rows':[]};var _0x10d9de=_[_0xce13('0x28')](db[_0xce13('0x29')][_0xce13('0x2a')],function(_0x2b0ffc){return{'name':_0x2b0ffc[_0xce13('0x2b')],'type':_0x2b0ffc[_0xce13('0x2c')][_0xce13('0x2d')]};});_0x5ae33e['model']=_[_0xce13('0x28')](_0x10d9de,_0xce13('0x25'));_0x5ae33e[_0xce13('0x2e')]=_[_0xce13('0x2f')](_0x44e28a[_0xce13('0x2e')]);_0x5ae33e[_0xce13('0x30')]=_[_0xce13('0x31')](_0x5ae33e[_0xce13('0x32')],_0x5ae33e[_0xce13('0x2e')]);_0x560dd3[_0xce13('0x33')]=_['intersection'](_0x5ae33e[_0xce13('0x32')],qs['fields'](_0x44e28a[_0xce13('0x2e')][_0xce13('0x34')]));_0x560dd3[_0xce13('0x33')]=_0x560dd3['attributes'][_0xce13('0x35')]?_0x560dd3[_0xce13('0x33')]:_0x5ae33e['model'];if(!_0x44e28a[_0xce13('0x2e')][_0xce13('0x36')](_0xce13('0x37'))){_0x560dd3['limit']=qs[_0xce13('0x1c')](_0x44e28a['query']['limit']);_0x560dd3[_0xce13('0x19')]=qs['offset'](_0x44e28a['query'][_0xce13('0x19')]);}_0x560dd3['order']=qs[_0xce13('0x38')](_0x44e28a[_0xce13('0x2e')]['sort']);_0x560dd3[_0xce13('0x39')]=qs[_0xce13('0x30')](_[_0xce13('0x3a')](_0x44e28a['query'],_0x5ae33e['filters']),_0x10d9de);if(_0x44e28a[_0xce13('0x2e')][_0xce13('0x3b')]){_0x560dd3[_0xce13('0x39')]=_[_0xce13('0x3c')](_0x560dd3['where'],{'$or':_[_0xce13('0x28')](_0x10d9de,function(_0x2f6b2a){if(_0x2f6b2a[_0xce13('0x2c')]!==_0xce13('0x3d')){var _0x5f573e={};_0x5f573e[_0x2f6b2a['name']]={'$like':'%'+_0x44e28a[_0xce13('0x2e')][_0xce13('0x3b')]+'%'};return _0x5f573e;}})});}_0x560dd3=_[_0xce13('0x3c')]({},_0x560dd3,_0x44e28a['options']);var _0x52b359={'where':_0x560dd3[_0xce13('0x39')]};return db[_0xce13('0x29')][_0xce13('0x1b')](_0x52b359)[_0xce13('0x22')](function(_0x4085c2){_0x2c3677[_0xce13('0x1b')]=_0x4085c2;if(_0x44e28a[_0xce13('0x2e')][_0xce13('0x3e')]){_0x560dd3['include']=[{'all':!![]}];}return db[_0xce13('0x29')]['findAll'](_0x560dd3);})['then'](function(_0x31a1db){_0x2c3677[_0xce13('0x3f')]=_0x31a1db;return _0x2c3677;})[_0xce13('0x22')](respondWithFilteredResult(_0x2f4f2d,_0x560dd3))[_0xce13('0x40')](handleError(_0x2f4f2d,null));};exports['show']=function(_0x252171,_0x2cc4e5){var _0x2eefd7={'raw':![],'where':{'id':_0x252171['params']['id']}},_0x26ce49={};_0x26ce49[_0xce13('0x32')]=_[_0xce13('0x2f')](db[_0xce13('0x29')][_0xce13('0x2a')]);_0x26ce49['query']=_[_0xce13('0x2f')](_0x252171[_0xce13('0x2e')]);_0x26ce49['filters']=_[_0xce13('0x31')](_0x26ce49[_0xce13('0x32')],_0x26ce49[_0xce13('0x2e')]);_0x2eefd7['attributes']=_[_0xce13('0x31')](_0x26ce49[_0xce13('0x32')],qs[_0xce13('0x34')](_0x252171['query'][_0xce13('0x34')]));_0x2eefd7['attributes']=_0x2eefd7[_0xce13('0x33')][_0xce13('0x35')]?_0x2eefd7[_0xce13('0x33')]:_0x26ce49[_0xce13('0x32')];if(_0x252171['query'][_0xce13('0x3e')]){_0x2eefd7[_0xce13('0x41')]=[{'all':!![]}];}_0x2eefd7=_['merge']({},_0x2eefd7,_0x252171[_0xce13('0x42')]);return db[_0xce13('0x29')][_0xce13('0x43')](_0x2eefd7)['then'](handleEntityNotFound(_0x2cc4e5,null))['then'](respondWithResult(_0x2cc4e5,null))[_0xce13('0x40')](handleError(_0x2cc4e5,null));};exports[_0xce13('0x44')]=function(_0x2deb29,_0x32cb6a){return db['SalesforceAccount'][_0xce13('0x44')](_0x2deb29[_0xce13('0x45')],{})[_0xce13('0x22')](respondWithResult(_0x32cb6a,0xc9))[_0xce13('0x40')](handleError(_0x32cb6a,null));};exports['update']=function(_0x384ca1,_0x1bef27){if(_0x384ca1[_0xce13('0x45')]['id']){delete _0x384ca1['body']['id'];}return db['SalesforceAccount'][_0xce13('0x43')]({'where':{'id':_0x384ca1[_0xce13('0x46')]['id']}})['then'](handleEntityNotFound(_0x1bef27,null))[_0xce13('0x22')](saveUpdates(_0x384ca1[_0xce13('0x45')],null))[_0xce13('0x22')](respondWithResult(_0x1bef27,null))[_0xce13('0x40')](handleError(_0x1bef27,null));};exports[_0xce13('0x23')]=function(_0xecfa6a,_0x2a625d){return db[_0xce13('0x29')][_0xce13('0x43')]({'where':{'id':_0xecfa6a['params']['id']}})[_0xce13('0x22')](handleEntityNotFound(_0x2a625d,null))[_0xce13('0x22')](removeEntity(_0x2a625d,null))[_0xce13('0x40')](handleError(_0x2a625d,null));};exports[_0xce13('0x47')]=function(_0x127245,_0x4e5746,_0x3bb952){var _0x29023a={};var _0x5ce755={};var _0x483e4f;var _0x3ef668;return db['SalesforceAccount'][_0xce13('0x48')]({'where':{'id':_0x127245[_0xce13('0x46')]['id']}})[_0xce13('0x22')](handleEntityNotFound(_0x4e5746,null))[_0xce13('0x22')](function(_0x2d60ff){if(_0x2d60ff){_0x483e4f=_0x2d60ff;_0x5ce755[_0xce13('0x32')]=_[_0xce13('0x2f')](db[_0xce13('0x49')][_0xce13('0x2a')]);_0x5ce755[_0xce13('0x2e')]=_[_0xce13('0x2f')](_0x127245[_0xce13('0x2e')]);_0x5ce755['filters']=_['intersection'](_0x5ce755[_0xce13('0x32')],_0x5ce755[_0xce13('0x2e')]);_0x29023a[_0xce13('0x33')]=_['intersection'](_0x5ce755[_0xce13('0x32')],qs[_0xce13('0x34')](_0x127245[_0xce13('0x2e')]['fields']));_0x29023a['attributes']=_0x29023a[_0xce13('0x33')][_0xce13('0x35')]?_0x29023a['attributes']:_0x5ce755[_0xce13('0x32')];_0x29023a[_0xce13('0x4a')]=qs[_0xce13('0x38')](_0x127245['query'][_0xce13('0x38')]);_0x29023a[_0xce13('0x39')]=qs['filters'](_[_0xce13('0x3a')](_0x127245[_0xce13('0x2e')],_0x5ce755[_0xce13('0x30')]));if(_0x127245['query'][_0xce13('0x3b')]){_0x29023a[_0xce13('0x39')]=_[_0xce13('0x3c')](_0x29023a[_0xce13('0x39')],{'$or':_[_0xce13('0x28')](_0x29023a[_0xce13('0x33')],function(_0x1038d3){var _0x2f8c18={};_0x2f8c18[_0x1038d3]={'$like':'%'+_0x127245['query'][_0xce13('0x3b')]+'%'};return _0x2f8c18;})});}_0x29023a=_['merge']({},_0x29023a,_0x127245[_0xce13('0x42')]);return _0x483e4f[_0xce13('0x47')](_0x29023a);}})[_0xce13('0x22')](function(_0x3e2063){if(_0x3e2063){_0x3ef668=_0x3e2063['length'];if(!_0x127245[_0xce13('0x2e')][_0xce13('0x36')](_0xce13('0x37'))){_0x29023a['limit']=qs[_0xce13('0x1c')](_0x127245['query'][_0xce13('0x1c')]);_0x29023a['offset']=qs[_0xce13('0x19')](_0x127245['query']['offset']);}return _0x483e4f[_0xce13('0x47')](_0x29023a);}})[_0xce13('0x22')](function(_0x20823b){if(_0x20823b){return _0x20823b?{'count':_0x3ef668,'rows':_0x20823b}:null;}})[_0xce13('0x22')](respondWithResult(_0x4e5746,null))[_0xce13('0x40')](handleError(_0x4e5746,null));};exports[_0xce13('0x4b')]=function(_0x183b1e,_0x53d56a,_0x36d6ba){if(_0x183b1e[_0xce13('0x45')]['id']){delete _0x183b1e[_0xce13('0x45')]['id'];}return db['SalesforceAccount'][_0xce13('0x48')]({'where':{'id':_0x183b1e[_0xce13('0x46')]['id']}})[_0xce13('0x22')](handleEntityNotFound(_0x53d56a,null))[_0xce13('0x22')](function(_0x2b5060){if(_0x2b5060){_0x183b1e['body'][_0xce13('0x4c')]=_0x2b5060['id'];_0x183b1e[_0xce13('0x45')][_0xce13('0x4d')]=integrations['getSubjects'](_0x183b1e[_0xce13('0x45')][_0xce13('0x4e')],_0x183b1e[_0xce13('0x45')][_0xce13('0x2c')]);_0x183b1e[_0xce13('0x45')]['Descriptions']=integrations[_0xce13('0x4f')](_0x183b1e[_0xce13('0x45')][_0xce13('0x4e')],_0x183b1e['body'][_0xce13('0x2c')]);return db[_0xce13('0x49')][_0xce13('0x44')](_0x183b1e[_0xce13('0x45')],{'include':[{'model':db[_0xce13('0x50')],'as':_0xce13('0x4d')},{'model':db['SalesforceField'],'as':_0xce13('0x51')}]});}return null;})[_0xce13('0x22')](respondWithResult(_0x53d56a,null))[_0xce13('0x40')](handleError(_0x53d56a,null));};exports[_0xce13('0x52')]=function(_0x54e5ae,_0x403bff,_0x2c6e23){var _0x66883f;var _0x15b6b7='';var _0x1b5bef='Task';return db[_0xce13('0x29')][_0xce13('0x48')]({'where':{'id':_0x54e5ae[_0xce13('0x46')]['id']},'attributes':['id',_0xce13('0x53'),_0xce13('0x54'),_0xce13('0x55'),_0xce13('0x56'),_0xce13('0x57'),_0xce13('0x58')]})[_0xce13('0x22')](handleEntityNotFound(_0x403bff,null))[_0xce13('0x22')](function(_0x50a0e7){if(_0x50a0e7){_0x15b6b7=_0x50a0e7[_0xce13('0x53')];var _0x25fe63=_0x15b6b7[_0xce13('0x59')](-0x1);if(_0x25fe63==='/'){_0x15b6b7=_0x15b6b7[_0xce13('0x5a')](0x0,_0x15b6b7[_0xce13('0x5b')](_0x25fe63));}_0x66883f=new jsforce[(_0xce13('0x5c'))]({'oauth2':{'loginUrl':_0x15b6b7,'clientId':_0x50a0e7[_0xce13('0x54')],'clientSecret':_0x50a0e7[_0xce13('0x55')]}});return _0x66883f[_0xce13('0x5d')](_0x50a0e7['username'],_0x50a0e7[_0xce13('0x57')]['concat'](_0x50a0e7[_0xce13('0x58')]));}})[_0xce13('0x22')](function(_0x3d463b){if(_0x3d463b){if(!_['isNil'](_0x54e5ae[_0xce13('0x2e')]['ticketType'])){_0x1b5bef=_0x54e5ae[_0xce13('0x2e')][_0xce13('0x5e')];}return _0x66883f['sobject'](_0x1b5bef)['describe']();}})['then'](function(_0x3d67df){var _0x4cbc81=[_0xce13('0x5f'),'ActivityDate','IsReminderSet','IsRecurrence',_0xce13('0x60'),_0xce13('0x61')];var _0x425a7e=[_0xce13('0x62'),_0xce13('0x63'),_0xce13('0x64'),'boolean','email','textarea',_0xce13('0x65')];if(_0x3d67df){_[_0xce13('0x66')](_0x3d67df[_0xce13('0x34')],function(_0x7fa72a){return _0x4cbc81[_0xce13('0x67')](_0x7fa72a[_0xce13('0x25')])||!_0x425a7e[_0xce13('0x67')](_0x7fa72a['type']);});return{'count':_0x3d67df['fields']['length'],'rows':_[_0xce13('0x28')](_0x3d67df[_0xce13('0x34')],function(_0x158b4f){return{'id':_0x158b4f['name'],'name':_0x158b4f[_0xce13('0x68')],'custom':_0x158b4f[_0xce13('0x69')],'options':_0x158b4f[_0xce13('0x6a')][_0xce13('0x35')]>0x0?_['map'](_0x158b4f[_0xce13('0x6a')],function(_0x402011){return{'name':_0x402011[_0xce13('0x68')],'value':_0x402011['value']};}):_0x158b4f['type']=='boolean'?[{'name':'True','value':_0xce13('0x6b')},{'name':_0xce13('0x6c'),'value':_0xce13('0x6d')}]:[]};})};}})[_0xce13('0x22')](respondWithResult(_0x403bff,null))['catch'](function(_0x1ac98b){var _0x1d9813=_0x54e5ae[_0xce13('0x2e')][_0xce13('0x6e')]?0x1f4:_0x1ac98b['statusCode']||0x1f4;logger[_0xce13('0x24')](_0xce13('0x6f'),_0xce13('0x52'),_0x1d9813,JSON[_0xce13('0x70')](_0x1ac98b));delete _0x1ac98b[_0xce13('0x25')];if(_0x1d9813===0x191){_0x1d9813=0x190;}_0x403bff[_0xce13('0x17')](_0x1d9813)[_0xce13('0x26')](_0x54e5ae[_0xce13('0x2e')][_0xce13('0x6e')]?{'message':'Wrong\x20credentials','statusCode':_0x1ac98b['statusCode']}:_0x1ac98b);});}; \ No newline at end of file +var _0xf3d0=['Connection','clientId','clientSecret','login','concat','securityToken','isNil','ticketType','sobject','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','int','picklist','boolean','email','phone','remove','includes','label','custom','picklistValues','value','False','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','undefined','limit','count','offset','set','Content-Range','json','apply','then','destroy','end','error','stack','name','send','index','SalesforceAccount','rawAttributes','type','model','map','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','merge','create','body','find','getConfigurations','findOne','hasOwnProperty','addConfiguration','Subjects','getSubjects','Descriptions','SalesforceConfiguration','SalesforceField','getFields','remoteUri','username','password','slice','substring','lastIndexOf'];(function(_0x34f701,_0x37e407){var _0x3e2429=function(_0x20c0c3){while(--_0x20c0c3){_0x34f701['push'](_0x34f701['shift']());}};_0x3e2429(++_0x37e407);}(_0xf3d0,0x97));var _0x0f3d=function(_0xd3c9f8,_0x2afa85){_0xd3c9f8=_0xd3c9f8-0x0;var _0x31ebde=_0xf3d0[_0xd3c9f8];return _0x31ebde;};'use strict';var emlformat=require(_0x0f3d('0x0'));var rimraf=require(_0x0f3d('0x1'));var zipdir=require(_0x0f3d('0x2'));var jsonpatch=require(_0x0f3d('0x3'));var rp=require(_0x0f3d('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0f3d('0x5'));var util=require(_0x0f3d('0x6'));var path=require('path');var sox=require(_0x0f3d('0x7'));var csv=require('to-csv');var ejs=require(_0x0f3d('0x8'));var fs=require('fs');var fs_extra=require(_0x0f3d('0x9'));var _=require('lodash');var squel=require(_0x0f3d('0xa'));var crypto=require(_0x0f3d('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x0f3d('0xc'));var toCsv=require(_0x0f3d('0xd'));var querystring=require('querystring');var Papa=require(_0x0f3d('0xe'));var Redis=require('ioredis');var authService=require(_0x0f3d('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0f3d('0x10'));var logger=require(_0x0f3d('0x11'))(_0x0f3d('0x12'));var utils=require(_0x0f3d('0x13'));var config=require(_0x0f3d('0x14'));var licenseUtil=require(_0x0f3d('0x15'));var db=require(_0x0f3d('0x16'))['db'];var integrations=require(_0x0f3d('0x17'));function respondWithStatusCode(_0x323807,_0x1823c3){_0x1823c3=_0x1823c3||0xcc;return function(_0x445a9f){if(_0x445a9f){return _0x323807['sendStatus'](_0x1823c3);}return _0x323807[_0x0f3d('0x18')](_0x1823c3)['end']();};}function respondWithResult(_0x1f2226,_0x16d9b3){_0x16d9b3=_0x16d9b3||0xc8;return function(_0x1e4f2d){if(_0x1e4f2d){return _0x1f2226[_0x0f3d('0x18')](_0x16d9b3)['json'](_0x1e4f2d);}};}function respondWithFilteredResult(_0x58aab2,_0x2d3751){return function(_0x4d2a43){if(_0x4d2a43){var _0x55c8a0=typeof _0x2d3751['offset']===_0x0f3d('0x19')&&typeof _0x2d3751[_0x0f3d('0x1a')]==='undefined';var _0x20847d=_0x4d2a43[_0x0f3d('0x1b')];var _0x170919=_0x55c8a0?0x0:_0x2d3751[_0x0f3d('0x1c')];var _0x47a23c=_0x55c8a0?_0x4d2a43[_0x0f3d('0x1b')]:_0x2d3751[_0x0f3d('0x1c')]+_0x2d3751[_0x0f3d('0x1a')];var _0x22f14d;if(_0x47a23c>=_0x20847d){_0x47a23c=_0x20847d;_0x22f14d=0xc8;}else{_0x22f14d=0xce;}_0x58aab2[_0x0f3d('0x18')](_0x22f14d);return _0x58aab2[_0x0f3d('0x1d')](_0x0f3d('0x1e'),_0x170919+'-'+_0x47a23c+'/'+_0x20847d)[_0x0f3d('0x1f')](_0x4d2a43);}return null;};}function patchUpdates(_0x2d56f2){return function(_0x481f30){try{jsonpatch[_0x0f3d('0x20')](_0x481f30,_0x2d56f2,!![]);}catch(_0x24efab){return BPromise['reject'](_0x24efab);}return _0x481f30['save']();};}function saveUpdates(_0x1a82ac,_0x375cf5){return function(_0x3c169d){if(_0x3c169d){return _0x3c169d['update'](_0x1a82ac)[_0x0f3d('0x21')](function(_0x348c5b){return _0x348c5b;});}return null;};}function removeEntity(_0x254877,_0x5b54a9){return function(_0x577b01){if(_0x577b01){return _0x577b01[_0x0f3d('0x22')]()[_0x0f3d('0x21')](function(){_0x254877['status'](0xcc)[_0x0f3d('0x23')]();});}};}function handleEntityNotFound(_0x2139c9,_0x120c00){return function(_0x56f106){if(!_0x56f106){_0x2139c9['sendStatus'](0x194);}return _0x56f106;};}function handleError(_0x5c0f5c,_0x5d7c97){_0x5d7c97=_0x5d7c97||0x1f4;return function(_0x1e09a9){logger[_0x0f3d('0x24')](_0x1e09a9[_0x0f3d('0x25')]);if(_0x1e09a9[_0x0f3d('0x26')]){delete _0x1e09a9[_0x0f3d('0x26')];}_0x5c0f5c[_0x0f3d('0x18')](_0x5d7c97)[_0x0f3d('0x27')](_0x1e09a9);};}exports[_0x0f3d('0x28')]=function(_0x237d03,_0x818f3){var _0xcd5228={},_0x316af3={},_0x28336f={'count':0x0,'rows':[]};var _0x18e8c7=_['map'](db[_0x0f3d('0x29')][_0x0f3d('0x2a')],function(_0x1afa0e){return{'name':_0x1afa0e['fieldName'],'type':_0x1afa0e[_0x0f3d('0x2b')]['key']};});_0x316af3[_0x0f3d('0x2c')]=_[_0x0f3d('0x2d')](_0x18e8c7,_0x0f3d('0x26'));_0x316af3[_0x0f3d('0x2e')]=_['keys'](_0x237d03[_0x0f3d('0x2e')]);_0x316af3[_0x0f3d('0x2f')]=_[_0x0f3d('0x30')](_0x316af3['model'],_0x316af3[_0x0f3d('0x2e')]);_0xcd5228[_0x0f3d('0x31')]=_['intersection'](_0x316af3[_0x0f3d('0x2c')],qs[_0x0f3d('0x32')](_0x237d03['query'][_0x0f3d('0x32')]));_0xcd5228[_0x0f3d('0x31')]=_0xcd5228['attributes'][_0x0f3d('0x33')]?_0xcd5228['attributes']:_0x316af3[_0x0f3d('0x2c')];if(!_0x237d03[_0x0f3d('0x2e')]['hasOwnProperty'](_0x0f3d('0x34'))){_0xcd5228[_0x0f3d('0x1a')]=qs[_0x0f3d('0x1a')](_0x237d03[_0x0f3d('0x2e')]['limit']);_0xcd5228[_0x0f3d('0x1c')]=qs['offset'](_0x237d03[_0x0f3d('0x2e')][_0x0f3d('0x1c')]);}_0xcd5228[_0x0f3d('0x35')]=qs[_0x0f3d('0x36')](_0x237d03[_0x0f3d('0x2e')][_0x0f3d('0x36')]);_0xcd5228[_0x0f3d('0x37')]=qs[_0x0f3d('0x2f')](_[_0x0f3d('0x38')](_0x237d03[_0x0f3d('0x2e')],_0x316af3[_0x0f3d('0x2f')]),_0x18e8c7);if(_0x237d03[_0x0f3d('0x2e')][_0x0f3d('0x39')]){_0xcd5228['where']=_['merge'](_0xcd5228[_0x0f3d('0x37')],{'$or':_['map'](_0x18e8c7,function(_0x1e64a6){if(_0x1e64a6[_0x0f3d('0x2b')]!==_0x0f3d('0x3a')){var _0x2e756e={};_0x2e756e[_0x1e64a6[_0x0f3d('0x26')]]={'$like':'%'+_0x237d03[_0x0f3d('0x2e')][_0x0f3d('0x39')]+'%'};return _0x2e756e;}})});}_0xcd5228=_['merge']({},_0xcd5228,_0x237d03[_0x0f3d('0x3b')]);var _0x1fa760={'where':_0xcd5228[_0x0f3d('0x37')]};return db['SalesforceAccount'][_0x0f3d('0x1b')](_0x1fa760)['then'](function(_0x2e945b){_0x28336f[_0x0f3d('0x1b')]=_0x2e945b;if(_0x237d03[_0x0f3d('0x2e')][_0x0f3d('0x3c')]){_0xcd5228[_0x0f3d('0x3d')]=[{'all':!![]}];}return db['SalesforceAccount']['findAll'](_0xcd5228);})[_0x0f3d('0x21')](function(_0x3b5c44){_0x28336f[_0x0f3d('0x3e')]=_0x3b5c44;return _0x28336f;})[_0x0f3d('0x21')](respondWithFilteredResult(_0x818f3,_0xcd5228))[_0x0f3d('0x3f')](handleError(_0x818f3,null));};exports[_0x0f3d('0x40')]=function(_0x3d26e6,_0x1af1b8){var _0x1f3754={'raw':![],'where':{'id':_0x3d26e6[_0x0f3d('0x41')]['id']}},_0x13e3f6={};_0x13e3f6[_0x0f3d('0x2c')]=_[_0x0f3d('0x42')](db['SalesforceAccount'][_0x0f3d('0x2a')]);_0x13e3f6['query']=_[_0x0f3d('0x42')](_0x3d26e6[_0x0f3d('0x2e')]);_0x13e3f6[_0x0f3d('0x2f')]=_[_0x0f3d('0x30')](_0x13e3f6['model'],_0x13e3f6[_0x0f3d('0x2e')]);_0x1f3754[_0x0f3d('0x31')]=_['intersection'](_0x13e3f6['model'],qs['fields'](_0x3d26e6['query']['fields']));_0x1f3754[_0x0f3d('0x31')]=_0x1f3754[_0x0f3d('0x31')][_0x0f3d('0x33')]?_0x1f3754[_0x0f3d('0x31')]:_0x13e3f6['model'];if(_0x3d26e6[_0x0f3d('0x2e')][_0x0f3d('0x3c')]){_0x1f3754[_0x0f3d('0x3d')]=[{'all':!![]}];}_0x1f3754=_[_0x0f3d('0x43')]({},_0x1f3754,_0x3d26e6[_0x0f3d('0x3b')]);return db[_0x0f3d('0x29')]['find'](_0x1f3754)['then'](handleEntityNotFound(_0x1af1b8,null))['then'](respondWithResult(_0x1af1b8,null))[_0x0f3d('0x3f')](handleError(_0x1af1b8,null));};exports[_0x0f3d('0x44')]=function(_0x29d62e,_0xdc15fa){return db['SalesforceAccount'][_0x0f3d('0x44')](_0x29d62e[_0x0f3d('0x45')],{})[_0x0f3d('0x21')](respondWithResult(_0xdc15fa,0xc9))[_0x0f3d('0x3f')](handleError(_0xdc15fa,null));};exports['update']=function(_0x1e83c7,_0x1e0c11){if(_0x1e83c7[_0x0f3d('0x45')]['id']){delete _0x1e83c7[_0x0f3d('0x45')]['id'];}return db['SalesforceAccount'][_0x0f3d('0x46')]({'where':{'id':_0x1e83c7[_0x0f3d('0x41')]['id']}})[_0x0f3d('0x21')](handleEntityNotFound(_0x1e0c11,null))[_0x0f3d('0x21')](saveUpdates(_0x1e83c7[_0x0f3d('0x45')],null))[_0x0f3d('0x21')](respondWithResult(_0x1e0c11,null))['catch'](handleError(_0x1e0c11,null));};exports[_0x0f3d('0x22')]=function(_0x356d64,_0x5b2e44){return db['SalesforceAccount']['find']({'where':{'id':_0x356d64['params']['id']}})[_0x0f3d('0x21')](handleEntityNotFound(_0x5b2e44,null))[_0x0f3d('0x21')](removeEntity(_0x5b2e44,null))['catch'](handleError(_0x5b2e44,null));};exports[_0x0f3d('0x47')]=function(_0x1cdb32,_0x174ac7,_0x40a589){var _0xd0e61f={};var _0x2e0930={};var _0x44bfac;var _0x2f009d;return db[_0x0f3d('0x29')][_0x0f3d('0x48')]({'where':{'id':_0x1cdb32[_0x0f3d('0x41')]['id']}})[_0x0f3d('0x21')](handleEntityNotFound(_0x174ac7,null))[_0x0f3d('0x21')](function(_0x29f3d3){if(_0x29f3d3){_0x44bfac=_0x29f3d3;_0x2e0930['model']=_[_0x0f3d('0x42')](db['SalesforceConfiguration'][_0x0f3d('0x2a')]);_0x2e0930[_0x0f3d('0x2e')]=_[_0x0f3d('0x42')](_0x1cdb32['query']);_0x2e0930[_0x0f3d('0x2f')]=_[_0x0f3d('0x30')](_0x2e0930[_0x0f3d('0x2c')],_0x2e0930['query']);_0xd0e61f[_0x0f3d('0x31')]=_[_0x0f3d('0x30')](_0x2e0930[_0x0f3d('0x2c')],qs[_0x0f3d('0x32')](_0x1cdb32[_0x0f3d('0x2e')]['fields']));_0xd0e61f[_0x0f3d('0x31')]=_0xd0e61f['attributes'][_0x0f3d('0x33')]?_0xd0e61f[_0x0f3d('0x31')]:_0x2e0930[_0x0f3d('0x2c')];_0xd0e61f[_0x0f3d('0x35')]=qs[_0x0f3d('0x36')](_0x1cdb32[_0x0f3d('0x2e')][_0x0f3d('0x36')]);_0xd0e61f[_0x0f3d('0x37')]=qs[_0x0f3d('0x2f')](_[_0x0f3d('0x38')](_0x1cdb32[_0x0f3d('0x2e')],_0x2e0930['filters']));if(_0x1cdb32[_0x0f3d('0x2e')][_0x0f3d('0x39')]){_0xd0e61f[_0x0f3d('0x37')]=_[_0x0f3d('0x43')](_0xd0e61f[_0x0f3d('0x37')],{'$or':_[_0x0f3d('0x2d')](_0xd0e61f[_0x0f3d('0x31')],function(_0x32a93e){var _0x4ab3a6={};_0x4ab3a6[_0x32a93e]={'$like':'%'+_0x1cdb32['query'][_0x0f3d('0x39')]+'%'};return _0x4ab3a6;})});}_0xd0e61f=_['merge']({},_0xd0e61f,_0x1cdb32[_0x0f3d('0x3b')]);return _0x44bfac[_0x0f3d('0x47')](_0xd0e61f);}})[_0x0f3d('0x21')](function(_0xa2a796){if(_0xa2a796){_0x2f009d=_0xa2a796['length'];if(!_0x1cdb32['query'][_0x0f3d('0x49')]('nolimit')){_0xd0e61f[_0x0f3d('0x1a')]=qs['limit'](_0x1cdb32[_0x0f3d('0x2e')][_0x0f3d('0x1a')]);_0xd0e61f[_0x0f3d('0x1c')]=qs[_0x0f3d('0x1c')](_0x1cdb32['query']['offset']);}return _0x44bfac[_0x0f3d('0x47')](_0xd0e61f);}})[_0x0f3d('0x21')](function(_0x3e21e5){if(_0x3e21e5){return _0x3e21e5?{'count':_0x2f009d,'rows':_0x3e21e5}:null;}})[_0x0f3d('0x21')](respondWithResult(_0x174ac7,null))[_0x0f3d('0x3f')](handleError(_0x174ac7,null));};exports[_0x0f3d('0x4a')]=function(_0x5e469a,_0x3103a6,_0x7e1abb){if(_0x5e469a[_0x0f3d('0x45')]['id']){delete _0x5e469a['body']['id'];}return db[_0x0f3d('0x29')][_0x0f3d('0x48')]({'where':{'id':_0x5e469a[_0x0f3d('0x41')]['id']}})[_0x0f3d('0x21')](handleEntityNotFound(_0x3103a6,null))['then'](function(_0x4c47a5){if(_0x4c47a5){_0x5e469a['body']['AccountId']=_0x4c47a5['id'];_0x5e469a[_0x0f3d('0x45')][_0x0f3d('0x4b')]=integrations[_0x0f3d('0x4c')](_0x5e469a[_0x0f3d('0x45')]['channel'],_0x5e469a[_0x0f3d('0x45')][_0x0f3d('0x2b')]);_0x5e469a[_0x0f3d('0x45')][_0x0f3d('0x4d')]=integrations['getDescriptions'](_0x5e469a[_0x0f3d('0x45')]['channel'],_0x5e469a[_0x0f3d('0x45')][_0x0f3d('0x2b')]);return db[_0x0f3d('0x4e')][_0x0f3d('0x44')](_0x5e469a[_0x0f3d('0x45')],{'include':[{'model':db['SalesforceField'],'as':'Subjects'},{'model':db[_0x0f3d('0x4f')],'as':_0x0f3d('0x4d')}]});}return null;})[_0x0f3d('0x21')](respondWithResult(_0x3103a6,null))['catch'](handleError(_0x3103a6,null));};exports[_0x0f3d('0x50')]=function(_0x4fa99,_0x3b03d9,_0x24c4ab){var _0x58a500;var _0x4a69c9='';var _0xd26a36='Task';return db[_0x0f3d('0x29')][_0x0f3d('0x48')]({'where':{'id':_0x4fa99[_0x0f3d('0x41')]['id']},'attributes':['id',_0x0f3d('0x51'),'clientId','clientSecret',_0x0f3d('0x52'),_0x0f3d('0x53'),'securityToken']})[_0x0f3d('0x21')](handleEntityNotFound(_0x3b03d9,null))[_0x0f3d('0x21')](function(_0x5601ae){if(_0x5601ae){_0x4a69c9=_0x5601ae['remoteUri'];var _0x1d7c85=_0x4a69c9[_0x0f3d('0x54')](-0x1);if(_0x1d7c85==='/'){_0x4a69c9=_0x4a69c9[_0x0f3d('0x55')](0x0,_0x4a69c9[_0x0f3d('0x56')](_0x1d7c85));}_0x58a500=new jsforce[(_0x0f3d('0x57'))]({'oauth2':{'loginUrl':_0x4a69c9,'clientId':_0x5601ae[_0x0f3d('0x58')],'clientSecret':_0x5601ae[_0x0f3d('0x59')]}});return _0x58a500[_0x0f3d('0x5a')](_0x5601ae['username'],_0x5601ae[_0x0f3d('0x53')][_0x0f3d('0x5b')](_0x5601ae[_0x0f3d('0x5c')]));}})['then'](function(_0x3819ef){if(_0x3819ef){if(!_[_0x0f3d('0x5d')](_0x4fa99[_0x0f3d('0x2e')][_0x0f3d('0x5e')])){_0xd26a36=_0x4fa99[_0x0f3d('0x2e')][_0x0f3d('0x5e')];}return _0x58a500[_0x0f3d('0x5f')](_0xd26a36)['describe']();}})[_0x0f3d('0x21')](function(_0x41deca){var _0x35e26d=[_0x0f3d('0x60'),_0x0f3d('0x61'),_0x0f3d('0x62'),_0x0f3d('0x63'),_0x0f3d('0x64'),_0x0f3d('0x65')];var _0x5ae4ef=['string',_0x0f3d('0x66'),_0x0f3d('0x67'),_0x0f3d('0x68'),_0x0f3d('0x69'),'textarea',_0x0f3d('0x6a')];if(_0x41deca){_[_0x0f3d('0x6b')](_0x41deca[_0x0f3d('0x32')],function(_0x11b1b0){return _0x35e26d['includes'](_0x11b1b0['name'])||!_0x5ae4ef[_0x0f3d('0x6c')](_0x11b1b0[_0x0f3d('0x2b')]);});return{'count':_0x41deca[_0x0f3d('0x32')]['length'],'rows':_[_0x0f3d('0x2d')](_0x41deca['fields'],function(_0x3fc5e1){return{'id':_0x3fc5e1[_0x0f3d('0x26')],'name':_0x3fc5e1[_0x0f3d('0x6d')],'custom':_0x3fc5e1[_0x0f3d('0x6e')],'options':_0x3fc5e1[_0x0f3d('0x6f')][_0x0f3d('0x33')]>0x0?_[_0x0f3d('0x2d')](_0x3fc5e1[_0x0f3d('0x6f')],function(_0x5d88ba){return{'name':_0x5d88ba['label'],'value':_0x5d88ba[_0x0f3d('0x70')]};}):_0x3fc5e1['type']==_0x0f3d('0x68')?[{'name':'True','value':'true'},{'name':_0x0f3d('0x71'),'value':'false'}]:[]};})};}})['then'](respondWithResult(_0x3b03d9,null))['catch'](function(_0x3ab4dd){var _0x4ee79d=_0x4fa99[_0x0f3d('0x2e')][_0x0f3d('0x72')]?0x1f4:_0x3ab4dd['statusCode']||0x1f4;logger['error'](_0x0f3d('0x73'),_0x0f3d('0x50'),_0x4ee79d,JSON[_0x0f3d('0x74')](_0x3ab4dd));delete _0x3ab4dd['name'];if(_0x4ee79d===0x191){_0x4ee79d=0x190;}_0x3b03d9[_0x0f3d('0x18')](_0x4ee79d)['send'](_0x4fa99['query']['test']?{'message':_0x0f3d('0x75'),'statusCode':_0x3ab4dd[_0x0f3d('0x76')]}:_0x3ab4dd);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 32101cc..ab15644 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 _0x1928=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','define','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger'];(function(_0x4080dd,_0x5b595d){var _0x4ecf85=function(_0x5d281a){while(--_0x5d281a){_0x4080dd['push'](_0x4080dd['shift']());}};_0x4ecf85(++_0x5b595d);}(_0x1928,0x183));var _0x8192=function(_0x90e409,_0x2a3f93){_0x90e409=_0x90e409-0x0;var _0x4175c8=_0x1928[_0x90e409];return _0x4175c8;};'use strict';var _=require(_0x8192('0x0'));var util=require(_0x8192('0x1'));var logger=require(_0x8192('0x2'))(_0x8192('0x3'));var moment=require(_0x8192('0x4'));var BPromise=require(_0x8192('0x5'));var rp=require(_0x8192('0x6'));var fs=require('fs');var path=require(_0x8192('0x7'));var rimraf=require(_0x8192('0x8'));var config=require(_0x8192('0x9'));var attributes=require(_0x8192('0xa'));var integrations=require(_0x8192('0xb'));module['exports']=function(_0x4f5426,_0x266c31){return _0x4f5426[_0x8192('0xc')](_0x8192('0xd'),attributes,{'tableName':_0x8192('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x944e=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../components/integrations/configuration','exports','define','lodash'];(function(_0x22f164,_0xaa4f80){var _0x51ab95=function(_0x190b68){while(--_0x190b68){_0x22f164['push'](_0x22f164['shift']());}};_0x51ab95(++_0xaa4f80);}(_0x944e,0xba));var _0xe944=function(_0x45ac6b,_0x4489ad){_0x45ac6b=_0x45ac6b-0x0;var _0x4510a9=_0x944e[_0x45ac6b];return _0x4510a9;};'use strict';var _=require(_0xe944('0x0'));var util=require(_0xe944('0x1'));var logger=require(_0xe944('0x2'))(_0xe944('0x3'));var moment=require(_0xe944('0x4'));var BPromise=require(_0xe944('0x5'));var rp=require(_0xe944('0x6'));var fs=require('fs');var path=require(_0xe944('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0xe944('0x8'));module[_0xe944('0x9')]=function(_0x4bceaf,_0x30b59b){return _0x4bceaf[_0xe944('0xa')]('SalesforceAccount',attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index eaa9028..c38b95b 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 _0x02d4=['../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','raw','options','attributes','limit','include','map','model','stringify','where','ShowSalesforceAccount','util','moment','bluebird','ioredis'];(function(_0x5a24bd,_0x533c13){var _0x44d73d=function(_0x53f58c){while(--_0x53f58c){_0x5a24bd['push'](_0x5a24bd['shift']());}};_0x44d73d(++_0x533c13);}(_0x02d4,0x194));var _0x402d=function(_0x895193,_0x44e714){_0x895193=_0x895193-0x0;var _0x145b2d=_0x02d4[_0x895193];return _0x145b2d;};'use strict';var _=require('lodash');var util=require(_0x402d('0x0'));var moment=require(_0x402d('0x1'));var BPromise=require(_0x402d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x402d('0x3'));var db=require(_0x402d('0x4'))['db'];var utils=require(_0x402d('0x5'));var logger=require('../../config/logger')(_0x402d('0x6'));var config=require(_0x402d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x402d('0x8')][_0x402d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x569fd4,_0x295062,_0x231437){return new BPromise(function(_0x476657,_0x282691){return client[_0x402d('0xa')](_0x569fd4,_0x231437)[_0x402d('0xb')](function(_0x1fe16f){logger['info'](_0x402d('0xc'),_0x295062,_0x402d('0xd'));logger[_0x402d('0xe')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x295062,_0x402d('0xd'),JSON['stringify'](_0x1fe16f));if(_0x1fe16f[_0x402d('0xf')]){if(_0x1fe16f[_0x402d('0xf')][_0x402d('0x10')]===0x1f4){logger[_0x402d('0xf')](_0x402d('0xc'),_0x295062,_0x1fe16f[_0x402d('0xf')][_0x402d('0x11')]);return _0x282691(_0x1fe16f[_0x402d('0xf')][_0x402d('0x11')]);}logger[_0x402d('0xf')](_0x402d('0xc'),_0x295062,_0x1fe16f[_0x402d('0xf')][_0x402d('0x11')]);return _0x476657(_0x1fe16f[_0x402d('0xf')][_0x402d('0x11')]);}else{logger[_0x402d('0x12')](_0x402d('0xc'),_0x295062,_0x402d('0xd'));_0x476657(_0x1fe16f[_0x402d('0x13')]['message']);}})[_0x402d('0x14')](function(_0x4901a5){logger[_0x402d('0xf')](_0x402d('0xc'),_0x295062,_0x4901a5);_0x282691(_0x4901a5);});});}exports[_0x402d('0x15')]=function(_0x10e070){var _0x1183db=this;return new Promise(function(_0x3e27e0,_0x40ccfc){return db[_0x402d('0x16')][_0x402d('0x17')]({'raw':_0x10e070['options']?_0x10e070['options'][_0x402d('0x18')]===undefined?!![]:![]:!![],'where':_0x10e070[_0x402d('0x19')]?_0x10e070[_0x402d('0x19')]['where']||null:null,'attributes':_0x10e070[_0x402d('0x19')]?_0x10e070[_0x402d('0x19')][_0x402d('0x1a')]||null:null,'limit':_0x10e070[_0x402d('0x19')]?_0x10e070[_0x402d('0x19')][_0x402d('0x1b')]||null:null,'include':_0x10e070[_0x402d('0x19')]?_0x10e070['options'][_0x402d('0x1c')]?_[_0x402d('0x1d')](_0x10e070[_0x402d('0x19')][_0x402d('0x1c')],function(_0xa0978d){return{'model':db[_0xa0978d['model']],'as':_0xa0978d['as'],'attributes':_0xa0978d['attributes'],'include':_0xa0978d[_0x402d('0x1c')]?_[_0x402d('0x1d')](_0xa0978d['include'],function(_0x852b3e){return{'model':db[_0x852b3e[_0x402d('0x1e')]],'as':_0x852b3e['as'],'attributes':_0x852b3e[_0x402d('0x1a')],'include':_0x852b3e[_0x402d('0x1c')]?_[_0x402d('0x1d')](_0x852b3e[_0x402d('0x1c')],function(_0x4206e0){return{'model':db[_0x4206e0['model']],'as':_0x4206e0['as'],'attributes':_0x4206e0[_0x402d('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x26497b){logger[_0x402d('0x12')](_0x402d('0x15'),_0x10e070);logger['debug'](_0x402d('0x15'),_0x10e070,JSON[_0x402d('0x1f')](_0x26497b));_0x3e27e0(_0x26497b);})[_0x402d('0x14')](function(_0x1afdf5){logger['error'](_0x402d('0x15'),_0x1afdf5[_0x402d('0x11')],_0x10e070);_0x40ccfc(_0x1183db[_0x402d('0xf')](0x1f4,_0x1afdf5[_0x402d('0x11')]));});});};exports['ShowSalesforceAccount']=function(_0xb95246){var _0x2e6ef5=this;return new Promise(function(_0x2d1746,_0x2f2407){return db[_0x402d('0x16')]['find']({'raw':_0xb95246['options']?_0xb95246[_0x402d('0x19')][_0x402d('0x18')]===undefined?!![]:![]:!![],'where':_0xb95246[_0x402d('0x19')]?_0xb95246[_0x402d('0x19')][_0x402d('0x20')]||null:null,'attributes':_0xb95246[_0x402d('0x19')]?_0xb95246[_0x402d('0x19')][_0x402d('0x1a')]||null:null,'include':_0xb95246[_0x402d('0x19')]?_0xb95246['options'][_0x402d('0x1c')]?_['map'](_0xb95246['options'][_0x402d('0x1c')],function(_0x5c1f10){return{'model':db[_0x5c1f10[_0x402d('0x1e')]],'as':_0x5c1f10['as'],'attributes':_0x5c1f10['attributes'],'include':_0x5c1f10['include']?_['map'](_0x5c1f10[_0x402d('0x1c')],function(_0x1300b6){return{'model':db[_0x1300b6['model']],'as':_0x1300b6['as'],'attributes':_0x1300b6[_0x402d('0x1a')],'include':_0x1300b6[_0x402d('0x1c')]?_[_0x402d('0x1d')](_0x1300b6['include'],function(_0x5566fb){return{'model':db[_0x5566fb[_0x402d('0x1e')]],'as':_0x5566fb['as'],'attributes':_0x5566fb[_0x402d('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x402d('0xb')](function(_0x29046d){logger[_0x402d('0x12')](_0x402d('0x21'),_0xb95246);logger[_0x402d('0xe')]('ShowSalesforceAccount',_0xb95246,JSON[_0x402d('0x1f')](_0x29046d));_0x2d1746(_0x29046d);})[_0x402d('0x14')](function(_0x2690cd){logger[_0x402d('0xf')]('ShowSalesforceAccount',_0x2690cd[_0x402d('0x11')],_0xb95246);_0x2f2407(_0x2e6ef5[_0x402d('0xf')](0x1f4,_0x2690cd[_0x402d('0x11')]));});});}; \ No newline at end of file +var _0xed60=['then','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','findAll','options','where','attributes','limit','include','map','model','GetSalesforceAccount','stringify','ShowSalesforceAccount','raw','util','moment','randomstring','ioredis','../../config/logger','../../config/environment','client','http','request'];(function(_0x44dbde,_0x535682){var _0x217ff9=function(_0x556c04){while(--_0x556c04){_0x44dbde['push'](_0x44dbde['shift']());}};_0x217ff9(++_0x535682);}(_0xed60,0x77));var _0x0ed6=function(_0x39af20,_0x4cb30e){_0x39af20=_0x39af20-0x0;var _0x56c40d=_0xed60[_0x39af20];return _0x56c40d;};'use strict';var _=require('lodash');var util=require(_0x0ed6('0x0'));var moment=require(_0x0ed6('0x1'));var BPromise=require('bluebird');var rs=require(_0x0ed6('0x2'));var fs=require('fs');var Redis=require(_0x0ed6('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0ed6('0x4'))('rpc');var config=require(_0x0ed6('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x0ed6('0x6')][_0x0ed6('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1bcd2b,_0x536c1b,_0x288f59){return new BPromise(function(_0x229e11,_0x4466fb){return client[_0x0ed6('0x8')](_0x1bcd2b,_0x288f59)[_0x0ed6('0x9')](function(_0x25ae41){logger['info'](_0x0ed6('0xa'),_0x536c1b,_0x0ed6('0xb'));logger[_0x0ed6('0xc')](_0x0ed6('0xd'),_0x536c1b,'request\x20sent',JSON['stringify'](_0x25ae41));if(_0x25ae41[_0x0ed6('0xe')]){if(_0x25ae41[_0x0ed6('0xe')][_0x0ed6('0xf')]===0x1f4){logger[_0x0ed6('0xe')]('SalesforceAccount,\x20%s,\x20%s',_0x536c1b,_0x25ae41['error'][_0x0ed6('0x10')]);return _0x4466fb(_0x25ae41[_0x0ed6('0xe')][_0x0ed6('0x10')]);}logger[_0x0ed6('0xe')](_0x0ed6('0xa'),_0x536c1b,_0x25ae41[_0x0ed6('0xe')][_0x0ed6('0x10')]);return _0x229e11(_0x25ae41[_0x0ed6('0xe')][_0x0ed6('0x10')]);}else{logger[_0x0ed6('0x11')](_0x0ed6('0xa'),_0x536c1b,_0x0ed6('0xb'));_0x229e11(_0x25ae41[_0x0ed6('0x12')][_0x0ed6('0x10')]);}})[_0x0ed6('0x13')](function(_0x35f683){logger[_0x0ed6('0xe')](_0x0ed6('0xa'),_0x536c1b,_0x35f683);_0x4466fb(_0x35f683);});});}exports['GetSalesforceAccount']=function(_0x1ecea7){var _0x5f3157=this;return new Promise(function(_0x4b85a8,_0xe0087f){return db['SalesforceAccount'][_0x0ed6('0x14')]({'raw':_0x1ecea7[_0x0ed6('0x15')]?_0x1ecea7[_0x0ed6('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x1ecea7[_0x0ed6('0x15')]?_0x1ecea7[_0x0ed6('0x15')][_0x0ed6('0x16')]||null:null,'attributes':_0x1ecea7[_0x0ed6('0x15')]?_0x1ecea7['options'][_0x0ed6('0x17')]||null:null,'limit':_0x1ecea7['options']?_0x1ecea7[_0x0ed6('0x15')][_0x0ed6('0x18')]||null:null,'include':_0x1ecea7['options']?_0x1ecea7[_0x0ed6('0x15')][_0x0ed6('0x19')]?_[_0x0ed6('0x1a')](_0x1ecea7[_0x0ed6('0x15')][_0x0ed6('0x19')],function(_0x247084){return{'model':db[_0x247084['model']],'as':_0x247084['as'],'attributes':_0x247084['attributes'],'include':_0x247084[_0x0ed6('0x19')]?_[_0x0ed6('0x1a')](_0x247084[_0x0ed6('0x19')],function(_0x54b6c7){return{'model':db[_0x54b6c7[_0x0ed6('0x1b')]],'as':_0x54b6c7['as'],'attributes':_0x54b6c7[_0x0ed6('0x17')],'include':_0x54b6c7[_0x0ed6('0x19')]?_['map'](_0x54b6c7['include'],function(_0xcc99c1){return{'model':db[_0xcc99c1[_0x0ed6('0x1b')]],'as':_0xcc99c1['as'],'attributes':_0xcc99c1[_0x0ed6('0x17')]};}):[]};}):[]};}):[]:[]})[_0x0ed6('0x9')](function(_0x33d4f8){logger[_0x0ed6('0x11')](_0x0ed6('0x1c'),_0x1ecea7);logger[_0x0ed6('0xc')](_0x0ed6('0x1c'),_0x1ecea7,JSON[_0x0ed6('0x1d')](_0x33d4f8));_0x4b85a8(_0x33d4f8);})[_0x0ed6('0x13')](function(_0x28a1e7){logger[_0x0ed6('0xe')](_0x0ed6('0x1c'),_0x28a1e7[_0x0ed6('0x10')],_0x1ecea7);_0xe0087f(_0x5f3157[_0x0ed6('0xe')](0x1f4,_0x28a1e7[_0x0ed6('0x10')]));});});};exports[_0x0ed6('0x1e')]=function(_0x21a885){var _0x7996ca=this;return new Promise(function(_0x22b0f9,_0x4cde2e){return db['SalesforceAccount']['find']({'raw':_0x21a885[_0x0ed6('0x15')]?_0x21a885['options'][_0x0ed6('0x1f')]===undefined?!![]:![]:!![],'where':_0x21a885[_0x0ed6('0x15')]?_0x21a885['options'][_0x0ed6('0x16')]||null:null,'attributes':_0x21a885[_0x0ed6('0x15')]?_0x21a885[_0x0ed6('0x15')][_0x0ed6('0x17')]||null:null,'include':_0x21a885[_0x0ed6('0x15')]?_0x21a885['options'][_0x0ed6('0x19')]?_[_0x0ed6('0x1a')](_0x21a885[_0x0ed6('0x15')][_0x0ed6('0x19')],function(_0x265720){return{'model':db[_0x265720[_0x0ed6('0x1b')]],'as':_0x265720['as'],'attributes':_0x265720['attributes'],'include':_0x265720[_0x0ed6('0x19')]?_['map'](_0x265720['include'],function(_0x13d09a){return{'model':db[_0x13d09a[_0x0ed6('0x1b')]],'as':_0x13d09a['as'],'attributes':_0x13d09a[_0x0ed6('0x17')],'include':_0x13d09a[_0x0ed6('0x19')]?_[_0x0ed6('0x1a')](_0x13d09a[_0x0ed6('0x19')],function(_0x3b74a9){return{'model':db[_0x3b74a9[_0x0ed6('0x1b')]],'as':_0x3b74a9['as'],'attributes':_0x3b74a9[_0x0ed6('0x17')]};}):[]};}):[]};}):[]:[]})[_0x0ed6('0x9')](function(_0x32f866){logger[_0x0ed6('0x11')](_0x0ed6('0x1e'),_0x21a885);logger[_0x0ed6('0xc')](_0x0ed6('0x1e'),_0x21a885,JSON[_0x0ed6('0x1d')](_0x32f866));_0x22b0f9(_0x32f866);})['catch'](function(_0x13650e){logger['error'](_0x0ed6('0x1e'),_0x13650e['message'],_0x21a885);_0x4cde2e(_0x7996ca['error'](0x1f4,_0x13650e[_0x0ed6('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 4771188..2b90d46 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(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x0b0e,0x187));var _0xe0b0=function(_0x3a0ebd,_0x47f368){_0x3a0ebd=_0x3a0ebd-0x0;var _0x51a660=_0x0b0e[_0x3a0ebd];return _0x51a660;};'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 _0x5f66=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects','put','update','delete','destroy','exports','util','connect-timeout'];(function(_0x2dcc75,_0xcb07c9){var _0x176d20=function(_0x1136e0){while(--_0x1136e0){_0x2dcc75['push'](_0x2dcc75['shift']());}};_0x176d20(++_0xcb07c9);}(_0x5f66,0x1a0));var _0x65f6=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x5f66[_0x297fd3];return _0x2af381;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['getFields']);router['get'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);router[_0x65f6('0x7')]('/:id/descriptions',auth[_0x65f6('0x8')](),controller['getDescriptions']);router['post']('/',auth[_0x65f6('0x8')](),controller['create']);router[_0x65f6('0xe')]('/:id',auth[_0x65f6('0x8')](),controller[_0x65f6('0xf')]);router[_0x65f6('0x10')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x11')]);module[_0x65f6('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index f87c690..8a653a4 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 _0x316d=['lead','account_contact_lead','account','contact_lead','sequelize','STRING','ENUM','Task','contact'];(function(_0x52ee77,_0xd17188){var _0x636c1=function(_0x1f2d01){while(--_0x1f2d01){_0x52ee77['push'](_0x52ee77['shift']());}};_0x636c1(++_0xd17188);}(_0x316d,0xaf));var _0xd316=function(_0x1bc67c,_0x363206){_0x1bc67c=_0x1bc67c-0x0;var _0x20548f=_0x316d[_0x1bc67c];return _0x20548f;};'use strict';var Sequelize=require(_0xd316('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd316('0x1')]},'ticketType':{'type':Sequelize[_0xd316('0x2')](_0xd316('0x3'),'Case'),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0xd316('0x2')]('contact_lead',_0xd316('0x4'),_0xd316('0x5'),_0xd316('0x6'),_0xd316('0x7')),'defaultValue':_0xd316('0x8')},'moduleCreate':{'type':Sequelize[_0xd316('0x2')]('nothing',_0xd316('0x4'),_0xd316('0x5'),_0xd316('0x7')),'defaultValue':_0xd316('0x5')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0xd316('0x1')]},'additionalSearchContact':{'type':Sequelize[_0xd316('0x1')]},'additionalSearchLead':{'type':Sequelize[_0xd316('0x1')]}}; \ No newline at end of file +var _0xada2=['contact','lead','account_contact_lead','nothing','sequelize','STRING','ENUM','Task','Case','contact_lead'];(function(_0x547bb6,_0x2d6f27){var _0x1a9154=function(_0x18080f){while(--_0x18080f){_0x547bb6['push'](_0x547bb6['shift']());}};_0x1a9154(++_0x2d6f27);}(_0xada2,0xc2));var _0x2ada=function(_0x96c988,_0x6e060b){_0x96c988=_0x96c988-0x0;var _0x3f64d5=_0xada2[_0x96c988];return _0x3f64d5;};'use strict';var Sequelize=require(_0x2ada('0x0'));module['exports']={'name':{'type':Sequelize[_0x2ada('0x1')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x2ada('0x2')](_0x2ada('0x3'),_0x2ada('0x4')),'defaultValue':_0x2ada('0x3')},'moduleSearch':{'type':Sequelize[_0x2ada('0x2')](_0x2ada('0x5'),_0x2ada('0x6'),_0x2ada('0x7'),_0x2ada('0x8'),'account'),'defaultValue':_0x2ada('0x5')},'moduleCreate':{'type':Sequelize[_0x2ada('0x2')](_0x2ada('0x9'),_0x2ada('0x6'),_0x2ada('0x7'),'account'),'defaultValue':_0x2ada('0x7')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0x2ada('0x1')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0x2ada('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 190ad90..69011e6 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 _0x3f19=['nolimit','getSubjects','SalesforceField','hasOwnProperty','getDescriptions','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','order','sort','where','merge','VIRTUAL','filter','SalesforceConfiguration','includeAll','include','rows','show','params','options','find','catch','create','body','getFields','findOne','pick'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3f19,0x1f1));var _0x93f1=function(_0x4593e2,_0x4de5f0){_0x4593e2=_0x4593e2-0x0;var _0x8c7ce2=_0x3f19[_0x4593e2];return _0x8c7ce2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x93f1('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x93f1('0x1'));var rp=require('request-promise');var moment=require(_0x93f1('0x2'));var BPromise=require(_0x93f1('0x3'));var Mustache=require(_0x93f1('0x4'));var util=require(_0x93f1('0x5'));var path=require(_0x93f1('0x6'));var sox=require(_0x93f1('0x7'));var csv=require(_0x93f1('0x8'));var ejs=require(_0x93f1('0x9'));var fs=require('fs');var fs_extra=require(_0x93f1('0xa'));var _=require(_0x93f1('0xb'));var squel=require(_0x93f1('0xc'));var crypto=require(_0x93f1('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x93f1('0xe'));var toCsv=require('to-csv');var querystring=require(_0x93f1('0xf'));var Papa=require(_0x93f1('0x10'));var Redis=require(_0x93f1('0x11'));var authService=require(_0x93f1('0x12'));var qs=require(_0x93f1('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x93f1('0x14'))('api');var utils=require(_0x93f1('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x93f1('0x16'));var db=require(_0x93f1('0x17'))['db'];function respondWithStatusCode(_0x5b2287,_0x4561b9){_0x4561b9=_0x4561b9||0xcc;return function(_0x225182){if(_0x225182){return _0x5b2287['sendStatus'](_0x4561b9);}return _0x5b2287[_0x93f1('0x18')](_0x4561b9)[_0x93f1('0x19')]();};}function respondWithResult(_0x3c95b6,_0x219568){_0x219568=_0x219568||0xc8;return function(_0x14ed6a){if(_0x14ed6a){return _0x3c95b6[_0x93f1('0x18')](_0x219568)[_0x93f1('0x1a')](_0x14ed6a);}};}function respondWithFilteredResult(_0x469df5,_0x1108df){return function(_0x538558){if(_0x538558){var _0x4e9c61=typeof _0x1108df[_0x93f1('0x1b')]===_0x93f1('0x1c')&&typeof _0x1108df[_0x93f1('0x1d')]===_0x93f1('0x1c');var _0x2004e0=_0x538558['count'];var _0xb2d18c=_0x4e9c61?0x0:_0x1108df[_0x93f1('0x1b')];var _0x9b7256=_0x4e9c61?_0x538558[_0x93f1('0x1e')]:_0x1108df[_0x93f1('0x1b')]+_0x1108df[_0x93f1('0x1d')];var _0x29b8f3;if(_0x9b7256>=_0x2004e0){_0x9b7256=_0x2004e0;_0x29b8f3=0xc8;}else{_0x29b8f3=0xce;}_0x469df5[_0x93f1('0x18')](_0x29b8f3);return _0x469df5[_0x93f1('0x1f')]('Content-Range',_0xb2d18c+'-'+_0x9b7256+'/'+_0x2004e0)[_0x93f1('0x1a')](_0x538558);}return null;};}function patchUpdates(_0x24a446){return function(_0x8f9846){try{jsonpatch[_0x93f1('0x20')](_0x8f9846,_0x24a446,!![]);}catch(_0x1adcaf){return BPromise[_0x93f1('0x21')](_0x1adcaf);}return _0x8f9846[_0x93f1('0x22')]();};}function saveUpdates(_0x5626e2,_0x15d0fe){return function(_0x1425ef){if(_0x1425ef){return _0x1425ef[_0x93f1('0x23')](_0x5626e2)[_0x93f1('0x24')](function(_0x587c18){return _0x587c18;});}return null;};}function removeEntity(_0x4e20cb,_0xdc3727){return function(_0x11b032){if(_0x11b032){return _0x11b032[_0x93f1('0x25')]()['then'](function(){_0x4e20cb['status'](0xcc)[_0x93f1('0x19')]();});}};}function handleEntityNotFound(_0x47da52,_0x52afe8){return function(_0x46e149){if(!_0x46e149){_0x47da52[_0x93f1('0x26')](0x194);}return _0x46e149;};}function handleError(_0x2267f3,_0x1730bf){_0x1730bf=_0x1730bf||0x1f4;return function(_0x2bea13){logger[_0x93f1('0x27')](_0x2bea13[_0x93f1('0x28')]);if(_0x2bea13[_0x93f1('0x29')]){delete _0x2bea13[_0x93f1('0x29')];}_0x2267f3['status'](_0x1730bf)[_0x93f1('0x2a')](_0x2bea13);};}exports[_0x93f1('0x2b')]=function(_0x562aea,_0x367866){var _0x43be6d={},_0x337578={},_0x41729f={'count':0x0,'rows':[]};var _0x440bdb=_[_0x93f1('0x2c')](db['SalesforceConfiguration'][_0x93f1('0x2d')],function(_0xdde3f){return{'name':_0xdde3f[_0x93f1('0x2e')],'type':_0xdde3f[_0x93f1('0x2f')][_0x93f1('0x30')]};});_0x337578[_0x93f1('0x31')]=_[_0x93f1('0x2c')](_0x440bdb,_0x93f1('0x29'));_0x337578['query']=_[_0x93f1('0x32')](_0x562aea[_0x93f1('0x33')]);_0x337578[_0x93f1('0x34')]=_['intersection'](_0x337578['model'],_0x337578[_0x93f1('0x33')]);_0x43be6d[_0x93f1('0x35')]=_[_0x93f1('0x36')](_0x337578[_0x93f1('0x31')],qs[_0x93f1('0x37')](_0x562aea[_0x93f1('0x33')]['fields']));_0x43be6d[_0x93f1('0x35')]=_0x43be6d[_0x93f1('0x35')][_0x93f1('0x38')]?_0x43be6d['attributes']:_0x337578[_0x93f1('0x31')];if(!_0x562aea[_0x93f1('0x33')]['hasOwnProperty']('nolimit')){_0x43be6d['limit']=qs['limit'](_0x562aea[_0x93f1('0x33')][_0x93f1('0x1d')]);_0x43be6d[_0x93f1('0x1b')]=qs[_0x93f1('0x1b')](_0x562aea[_0x93f1('0x33')][_0x93f1('0x1b')]);}_0x43be6d[_0x93f1('0x39')]=qs['sort'](_0x562aea['query'][_0x93f1('0x3a')]);_0x43be6d[_0x93f1('0x3b')]=qs['filters'](_['pick'](_0x562aea[_0x93f1('0x33')],_0x337578[_0x93f1('0x34')]),_0x440bdb);if(_0x562aea[_0x93f1('0x33')]['filter']){_0x43be6d[_0x93f1('0x3b')]=_[_0x93f1('0x3c')](_0x43be6d[_0x93f1('0x3b')],{'$or':_['map'](_0x440bdb,function(_0xc8653b){if(_0xc8653b['type']!==_0x93f1('0x3d')){var _0x148524={};_0x148524[_0xc8653b[_0x93f1('0x29')]]={'$like':'%'+_0x562aea['query'][_0x93f1('0x3e')]+'%'};return _0x148524;}})});}_0x43be6d=_[_0x93f1('0x3c')]({},_0x43be6d,_0x562aea['options']);var _0x528586={'where':_0x43be6d[_0x93f1('0x3b')]};return db[_0x93f1('0x3f')]['count'](_0x528586)['then'](function(_0x530ccd){_0x41729f['count']=_0x530ccd;if(_0x562aea[_0x93f1('0x33')][_0x93f1('0x40')]){_0x43be6d[_0x93f1('0x41')]=[{'all':!![]}];}return db['SalesforceConfiguration']['findAll'](_0x43be6d);})[_0x93f1('0x24')](function(_0x24de29){_0x41729f[_0x93f1('0x42')]=_0x24de29;return _0x41729f;})['then'](respondWithFilteredResult(_0x367866,_0x43be6d))['catch'](handleError(_0x367866,null));};exports[_0x93f1('0x43')]=function(_0x2ff933,_0x1a7e46){var _0x2fa98a={'raw':![],'where':{'id':_0x2ff933[_0x93f1('0x44')]['id']}},_0x1640cd={};_0x1640cd[_0x93f1('0x31')]=_['keys'](db[_0x93f1('0x3f')][_0x93f1('0x2d')]);_0x1640cd[_0x93f1('0x33')]=_[_0x93f1('0x32')](_0x2ff933[_0x93f1('0x33')]);_0x1640cd[_0x93f1('0x34')]=_[_0x93f1('0x36')](_0x1640cd[_0x93f1('0x31')],_0x1640cd[_0x93f1('0x33')]);_0x2fa98a[_0x93f1('0x35')]=_['intersection'](_0x1640cd[_0x93f1('0x31')],qs[_0x93f1('0x37')](_0x2ff933[_0x93f1('0x33')][_0x93f1('0x37')]));_0x2fa98a[_0x93f1('0x35')]=_0x2fa98a['attributes'][_0x93f1('0x38')]?_0x2fa98a[_0x93f1('0x35')]:_0x1640cd['model'];if(_0x2ff933['query'][_0x93f1('0x40')]){_0x2fa98a['include']=[{'all':!![]}];}_0x2fa98a=_[_0x93f1('0x3c')]({},_0x2fa98a,_0x2ff933[_0x93f1('0x45')]);return db[_0x93f1('0x3f')][_0x93f1('0x46')](_0x2fa98a)['then'](handleEntityNotFound(_0x1a7e46,null))[_0x93f1('0x24')](respondWithResult(_0x1a7e46,null))[_0x93f1('0x47')](handleError(_0x1a7e46,null));};exports[_0x93f1('0x48')]=function(_0x2e1122,_0x4e0873){return db[_0x93f1('0x3f')][_0x93f1('0x48')](_0x2e1122[_0x93f1('0x49')],{})[_0x93f1('0x24')](respondWithResult(_0x4e0873,0xc9))[_0x93f1('0x47')](handleError(_0x4e0873,null));};exports[_0x93f1('0x23')]=function(_0x2c4be4,_0x200655){if(_0x2c4be4['body']['id']){delete _0x2c4be4['body']['id'];}return db['SalesforceConfiguration'][_0x93f1('0x46')]({'where':{'id':_0x2c4be4['params']['id']}})['then'](handleEntityNotFound(_0x200655,null))['then'](saveUpdates(_0x2c4be4[_0x93f1('0x49')],null))['then'](respondWithResult(_0x200655,null))[_0x93f1('0x47')](handleError(_0x200655,null));};exports[_0x93f1('0x25')]=function(_0x15c305,_0xdaa41a){return db['SalesforceConfiguration']['find']({'where':{'id':_0x15c305[_0x93f1('0x44')]['id']}})[_0x93f1('0x24')](handleEntityNotFound(_0xdaa41a,null))[_0x93f1('0x24')](removeEntity(_0xdaa41a,null))[_0x93f1('0x47')](handleError(_0xdaa41a,null));};exports[_0x93f1('0x4a')]=function(_0x34c9d4,_0x29bf3c,_0x366952){var _0x475cd0={};var _0x5d7563={};var _0x33db4c;var _0x40f0ef;return db[_0x93f1('0x3f')][_0x93f1('0x4b')]({'where':{'id':_0x34c9d4['params']['id']}})['then'](handleEntityNotFound(_0x29bf3c,null))[_0x93f1('0x24')](function(_0x46f09e){if(_0x46f09e){_0x33db4c=_0x46f09e;_0x5d7563['model']=_[_0x93f1('0x32')](db['SalesforceField']['rawAttributes']);_0x5d7563[_0x93f1('0x33')]=_[_0x93f1('0x32')](_0x34c9d4['query']);_0x5d7563[_0x93f1('0x34')]=_[_0x93f1('0x36')](_0x5d7563[_0x93f1('0x31')],_0x5d7563[_0x93f1('0x33')]);_0x475cd0['attributes']=_[_0x93f1('0x36')](_0x5d7563['model'],qs[_0x93f1('0x37')](_0x34c9d4[_0x93f1('0x33')][_0x93f1('0x37')]));_0x475cd0[_0x93f1('0x35')]=_0x475cd0[_0x93f1('0x35')][_0x93f1('0x38')]?_0x475cd0[_0x93f1('0x35')]:_0x5d7563['model'];_0x475cd0[_0x93f1('0x39')]=qs['sort'](_0x34c9d4[_0x93f1('0x33')][_0x93f1('0x3a')]);_0x475cd0[_0x93f1('0x3b')]=qs[_0x93f1('0x34')](_[_0x93f1('0x4c')](_0x34c9d4[_0x93f1('0x33')],_0x5d7563[_0x93f1('0x34')]));if(_0x34c9d4[_0x93f1('0x33')][_0x93f1('0x3e')]){_0x475cd0['where']=_[_0x93f1('0x3c')](_0x475cd0[_0x93f1('0x3b')],{'$or':_['map'](_0x475cd0[_0x93f1('0x35')],function(_0x355533){var _0x262510={};_0x262510[_0x355533]={'$like':'%'+_0x34c9d4['query'][_0x93f1('0x3e')]+'%'};return _0x262510;})});}_0x475cd0=_['merge']({},_0x475cd0,_0x34c9d4[_0x93f1('0x45')]);return _0x33db4c[_0x93f1('0x4a')](_0x475cd0);}})[_0x93f1('0x24')](function(_0x3b05a9){if(_0x3b05a9){_0x40f0ef=_0x3b05a9['length'];if(!_0x34c9d4[_0x93f1('0x33')]['hasOwnProperty'](_0x93f1('0x4d'))){_0x475cd0[_0x93f1('0x1d')]=qs[_0x93f1('0x1d')](_0x34c9d4['query'][_0x93f1('0x1d')]);_0x475cd0[_0x93f1('0x1b')]=qs[_0x93f1('0x1b')](_0x34c9d4[_0x93f1('0x33')][_0x93f1('0x1b')]);}return _0x33db4c['getFields'](_0x475cd0);}})[_0x93f1('0x24')](function(_0x355727){if(_0x355727){return _0x355727?{'count':_0x40f0ef,'rows':_0x355727}:null;}})[_0x93f1('0x24')](respondWithResult(_0x29bf3c,null))['catch'](handleError(_0x29bf3c,null));};exports[_0x93f1('0x4e')]=function(_0x5c1a2f,_0x2e0f84,_0x7df6b){var _0x52e105={};var _0x334b04={};var _0x4e1e28;var _0x52f276;return db[_0x93f1('0x3f')][_0x93f1('0x4b')]({'where':{'id':_0x5c1a2f[_0x93f1('0x44')]['id']}})[_0x93f1('0x24')](handleEntityNotFound(_0x2e0f84,null))[_0x93f1('0x24')](function(_0x41fc79){if(_0x41fc79){_0x4e1e28=_0x41fc79;_0x334b04[_0x93f1('0x31')]=_[_0x93f1('0x32')](db[_0x93f1('0x4f')]['rawAttributes']);_0x334b04[_0x93f1('0x33')]=_[_0x93f1('0x32')](_0x5c1a2f[_0x93f1('0x33')]);_0x334b04[_0x93f1('0x34')]=_[_0x93f1('0x36')](_0x334b04['model'],_0x334b04[_0x93f1('0x33')]);_0x52e105[_0x93f1('0x35')]=_[_0x93f1('0x36')](_0x334b04['model'],qs[_0x93f1('0x37')](_0x5c1a2f[_0x93f1('0x33')]['fields']));_0x52e105[_0x93f1('0x35')]=_0x52e105[_0x93f1('0x35')][_0x93f1('0x38')]?_0x52e105[_0x93f1('0x35')]:_0x334b04['model'];_0x52e105['order']=qs[_0x93f1('0x3a')](_0x5c1a2f[_0x93f1('0x33')][_0x93f1('0x3a')]);_0x52e105[_0x93f1('0x3b')]=qs[_0x93f1('0x34')](_[_0x93f1('0x4c')](_0x5c1a2f[_0x93f1('0x33')],_0x334b04[_0x93f1('0x34')]));if(_0x5c1a2f[_0x93f1('0x33')][_0x93f1('0x3e')]){_0x52e105[_0x93f1('0x3b')]=_['merge'](_0x52e105[_0x93f1('0x3b')],{'$or':_[_0x93f1('0x2c')](_0x52e105['attributes'],function(_0x227559){var _0x55e9f5={};_0x55e9f5[_0x227559]={'$like':'%'+_0x5c1a2f['query']['filter']+'%'};return _0x55e9f5;})});}_0x52e105=_[_0x93f1('0x3c')]({},_0x52e105,_0x5c1a2f[_0x93f1('0x45')]);return _0x4e1e28['getSubjects'](_0x52e105);}})[_0x93f1('0x24')](function(_0x4ed27f){if(_0x4ed27f){_0x52f276=_0x4ed27f[_0x93f1('0x38')];if(!_0x5c1a2f['query'][_0x93f1('0x50')](_0x93f1('0x4d'))){_0x52e105[_0x93f1('0x1d')]=qs[_0x93f1('0x1d')](_0x5c1a2f['query']['limit']);_0x52e105[_0x93f1('0x1b')]=qs[_0x93f1('0x1b')](_0x5c1a2f[_0x93f1('0x33')][_0x93f1('0x1b')]);}return _0x4e1e28[_0x93f1('0x4e')](_0x52e105);}})[_0x93f1('0x24')](function(_0x3d3a9f){if(_0x3d3a9f){return _0x3d3a9f?{'count':_0x52f276,'rows':_0x3d3a9f}:null;}})[_0x93f1('0x24')](respondWithResult(_0x2e0f84,null))[_0x93f1('0x47')](handleError(_0x2e0f84,null));};exports[_0x93f1('0x51')]=function(_0x47adec,_0x4af245,_0x2dd582){var _0x5725c9={};var _0x2e4fd6={};var _0x31036d;var _0x3e0f68;return db[_0x93f1('0x3f')][_0x93f1('0x4b')]({'where':{'id':_0x47adec['params']['id']}})[_0x93f1('0x24')](handleEntityNotFound(_0x4af245,null))[_0x93f1('0x24')](function(_0x5853fa){if(_0x5853fa){_0x31036d=_0x5853fa;_0x2e4fd6['model']=_['keys'](db[_0x93f1('0x4f')][_0x93f1('0x2d')]);_0x2e4fd6[_0x93f1('0x33')]=_['keys'](_0x47adec[_0x93f1('0x33')]);_0x2e4fd6['filters']=_[_0x93f1('0x36')](_0x2e4fd6[_0x93f1('0x31')],_0x2e4fd6[_0x93f1('0x33')]);_0x5725c9[_0x93f1('0x35')]=_[_0x93f1('0x36')](_0x2e4fd6['model'],qs['fields'](_0x47adec[_0x93f1('0x33')][_0x93f1('0x37')]));_0x5725c9[_0x93f1('0x35')]=_0x5725c9['attributes'][_0x93f1('0x38')]?_0x5725c9[_0x93f1('0x35')]:_0x2e4fd6['model'];_0x5725c9[_0x93f1('0x39')]=qs[_0x93f1('0x3a')](_0x47adec[_0x93f1('0x33')][_0x93f1('0x3a')]);_0x5725c9[_0x93f1('0x3b')]=qs[_0x93f1('0x34')](_['pick'](_0x47adec[_0x93f1('0x33')],_0x2e4fd6[_0x93f1('0x34')]));if(_0x47adec[_0x93f1('0x33')][_0x93f1('0x3e')]){_0x5725c9[_0x93f1('0x3b')]=_[_0x93f1('0x3c')](_0x5725c9[_0x93f1('0x3b')],{'$or':_[_0x93f1('0x2c')](_0x5725c9['attributes'],function(_0x4e55cc){var _0x1dc9e8={};_0x1dc9e8[_0x4e55cc]={'$like':'%'+_0x47adec[_0x93f1('0x33')][_0x93f1('0x3e')]+'%'};return _0x1dc9e8;})});}_0x5725c9=_[_0x93f1('0x3c')]({},_0x5725c9,_0x47adec[_0x93f1('0x45')]);return _0x31036d[_0x93f1('0x51')](_0x5725c9);}})[_0x93f1('0x24')](function(_0x5aaebb){if(_0x5aaebb){_0x3e0f68=_0x5aaebb[_0x93f1('0x38')];if(!_0x47adec['query']['hasOwnProperty'](_0x93f1('0x4d'))){_0x5725c9[_0x93f1('0x1d')]=qs[_0x93f1('0x1d')](_0x47adec[_0x93f1('0x33')][_0x93f1('0x1d')]);_0x5725c9['offset']=qs['offset'](_0x47adec[_0x93f1('0x33')][_0x93f1('0x1b')]);}return _0x31036d[_0x93f1('0x51')](_0x5725c9);}})[_0x93f1('0x24')](function(_0x5f0c07){if(_0x5f0c07){return _0x5f0c07?{'count':_0x3e0f68,'rows':_0x5f0c07}:null;}})[_0x93f1('0x24')](respondWithResult(_0x4af245,null))[_0x93f1('0x47')](handleError(_0x4af245,null));}; \ No newline at end of file +var _0x8767=['../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','save','update','destroy','then','error','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','keys','length','include','find','create','body','getFields','findOne','SalesforceField','order','merge','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0xf9457f,_0x31b9b2){var _0x1e2929=function(_0x1e381b){while(--_0x1e381b){_0xf9457f['push'](_0xf9457f['shift']());}};_0x1e2929(++_0x31b9b2);}(_0x8767,0x134));var _0x7876=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8767[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7876('0x0'));var zipdir=require(_0x7876('0x1'));var jsonpatch=require(_0x7876('0x2'));var rp=require(_0x7876('0x3'));var moment=require(_0x7876('0x4'));var BPromise=require(_0x7876('0x5'));var Mustache=require(_0x7876('0x6'));var util=require(_0x7876('0x7'));var path=require(_0x7876('0x8'));var sox=require(_0x7876('0x9'));var csv=require('to-csv');var ejs=require(_0x7876('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7876('0xb'));var crypto=require(_0x7876('0xc'));var jsforce=require(_0x7876('0xd'));var deskjs=require(_0x7876('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7876('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7876('0x10'));var qs=require(_0x7876('0x11'));var as=require(_0x7876('0x12'));var hardwareService=require(_0x7876('0x13'));var logger=require(_0x7876('0x14'))('api');var utils=require(_0x7876('0x15'));var config=require(_0x7876('0x16'));var licenseUtil=require(_0x7876('0x17'));var db=require(_0x7876('0x18'))['db'];function respondWithStatusCode(_0x86d11d,_0xac5e0c){_0xac5e0c=_0xac5e0c||0xcc;return function(_0xe2748a){if(_0xe2748a){return _0x86d11d[_0x7876('0x19')](_0xac5e0c);}return _0x86d11d[_0x7876('0x1a')](_0xac5e0c)[_0x7876('0x1b')]();};}function respondWithResult(_0xdf050a,_0x3fdb02){_0x3fdb02=_0x3fdb02||0xc8;return function(_0x56a96a){if(_0x56a96a){return _0xdf050a[_0x7876('0x1a')](_0x3fdb02)[_0x7876('0x1c')](_0x56a96a);}};}function respondWithFilteredResult(_0x5382a1,_0x2e5fad){return function(_0x490c3f){if(_0x490c3f){var _0x3bc7cf=typeof _0x2e5fad[_0x7876('0x1d')]===_0x7876('0x1e')&&typeof _0x2e5fad['limit']===_0x7876('0x1e');var _0x52df5b=_0x490c3f[_0x7876('0x1f')];var _0x18a301=_0x3bc7cf?0x0:_0x2e5fad['offset'];var _0xaf8a14=_0x3bc7cf?_0x490c3f[_0x7876('0x1f')]:_0x2e5fad[_0x7876('0x1d')]+_0x2e5fad[_0x7876('0x20')];var _0x4b18c6;if(_0xaf8a14>=_0x52df5b){_0xaf8a14=_0x52df5b;_0x4b18c6=0xc8;}else{_0x4b18c6=0xce;}_0x5382a1['status'](_0x4b18c6);return _0x5382a1[_0x7876('0x21')]('Content-Range',_0x18a301+'-'+_0xaf8a14+'/'+_0x52df5b)[_0x7876('0x1c')](_0x490c3f);}return null;};}function patchUpdates(_0x4ed5b2){return function(_0xc92ead){try{jsonpatch[_0x7876('0x22')](_0xc92ead,_0x4ed5b2,!![]);}catch(_0x1a1009){return BPromise['reject'](_0x1a1009);}return _0xc92ead[_0x7876('0x23')]();};}function saveUpdates(_0x2a23b9,_0x1a11e2){return function(_0x48068f){if(_0x48068f){return _0x48068f[_0x7876('0x24')](_0x2a23b9)['then'](function(_0x9b11ab){return _0x9b11ab;});}return null;};}function removeEntity(_0x2bf263,_0x140f5e){return function(_0x32c894){if(_0x32c894){return _0x32c894[_0x7876('0x25')]()[_0x7876('0x26')](function(){_0x2bf263[_0x7876('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30bfed,_0x7ae8dc){return function(_0xec0f4a){if(!_0xec0f4a){_0x30bfed[_0x7876('0x19')](0x194);}return _0xec0f4a;};}function handleError(_0x33ab68,_0x55aaa4){_0x55aaa4=_0x55aaa4||0x1f4;return function(_0x35ce2b){logger[_0x7876('0x27')](_0x35ce2b[_0x7876('0x28')]);if(_0x35ce2b[_0x7876('0x29')]){delete _0x35ce2b[_0x7876('0x29')];}_0x33ab68[_0x7876('0x1a')](_0x55aaa4)[_0x7876('0x2a')](_0x35ce2b);};}exports[_0x7876('0x2b')]=function(_0x2de4ad,_0x2709c6){var _0x3bf58b={},_0x346799={},_0x145566={'count':0x0,'rows':[]};var _0x1e43cc=_[_0x7876('0x2c')](db[_0x7876('0x2d')][_0x7876('0x2e')],function(_0x2bae0f){return{'name':_0x2bae0f[_0x7876('0x2f')],'type':_0x2bae0f[_0x7876('0x30')]['key']};});_0x346799[_0x7876('0x31')]=_[_0x7876('0x2c')](_0x1e43cc,_0x7876('0x29'));_0x346799[_0x7876('0x32')]=_['keys'](_0x2de4ad[_0x7876('0x32')]);_0x346799[_0x7876('0x33')]=_[_0x7876('0x34')](_0x346799[_0x7876('0x31')],_0x346799[_0x7876('0x32')]);_0x3bf58b['attributes']=_[_0x7876('0x34')](_0x346799[_0x7876('0x31')],qs[_0x7876('0x35')](_0x2de4ad[_0x7876('0x32')][_0x7876('0x35')]));_0x3bf58b[_0x7876('0x36')]=_0x3bf58b[_0x7876('0x36')]['length']?_0x3bf58b[_0x7876('0x36')]:_0x346799[_0x7876('0x31')];if(!_0x2de4ad['query'][_0x7876('0x37')](_0x7876('0x38'))){_0x3bf58b['limit']=qs[_0x7876('0x20')](_0x2de4ad[_0x7876('0x32')][_0x7876('0x20')]);_0x3bf58b[_0x7876('0x1d')]=qs[_0x7876('0x1d')](_0x2de4ad[_0x7876('0x32')]['offset']);}_0x3bf58b['order']=qs[_0x7876('0x39')](_0x2de4ad[_0x7876('0x32')][_0x7876('0x39')]);_0x3bf58b[_0x7876('0x3a')]=qs[_0x7876('0x33')](_[_0x7876('0x3b')](_0x2de4ad[_0x7876('0x32')],_0x346799[_0x7876('0x33')]),_0x1e43cc);if(_0x2de4ad[_0x7876('0x32')]['filter']){_0x3bf58b[_0x7876('0x3a')]=_['merge'](_0x3bf58b[_0x7876('0x3a')],{'$or':_[_0x7876('0x2c')](_0x1e43cc,function(_0x359ff1){if(_0x359ff1[_0x7876('0x30')]!==_0x7876('0x3c')){var _0x388af9={};_0x388af9[_0x359ff1[_0x7876('0x29')]]={'$like':'%'+_0x2de4ad['query'][_0x7876('0x3d')]+'%'};return _0x388af9;}})});}_0x3bf58b=_['merge']({},_0x3bf58b,_0x2de4ad[_0x7876('0x3e')]);var _0x1f377e={'where':_0x3bf58b[_0x7876('0x3a')]};return db[_0x7876('0x2d')][_0x7876('0x1f')](_0x1f377e)[_0x7876('0x26')](function(_0x1bdbbe){_0x145566[_0x7876('0x1f')]=_0x1bdbbe;if(_0x2de4ad[_0x7876('0x32')][_0x7876('0x3f')]){_0x3bf58b['include']=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x7876('0x40')](_0x3bf58b);})[_0x7876('0x26')](function(_0x5c47ba){_0x145566[_0x7876('0x41')]=_0x5c47ba;return _0x145566;})[_0x7876('0x26')](respondWithFilteredResult(_0x2709c6,_0x3bf58b))[_0x7876('0x42')](handleError(_0x2709c6,null));};exports[_0x7876('0x43')]=function(_0x21151d,_0x432c45){var _0x214c18={'raw':![],'where':{'id':_0x21151d[_0x7876('0x44')]['id']}},_0x4ebd00={};_0x4ebd00[_0x7876('0x31')]=_[_0x7876('0x45')](db['SalesforceConfiguration'][_0x7876('0x2e')]);_0x4ebd00[_0x7876('0x32')]=_[_0x7876('0x45')](_0x21151d[_0x7876('0x32')]);_0x4ebd00[_0x7876('0x33')]=_[_0x7876('0x34')](_0x4ebd00[_0x7876('0x31')],_0x4ebd00[_0x7876('0x32')]);_0x214c18[_0x7876('0x36')]=_[_0x7876('0x34')](_0x4ebd00[_0x7876('0x31')],qs[_0x7876('0x35')](_0x21151d['query']['fields']));_0x214c18[_0x7876('0x36')]=_0x214c18[_0x7876('0x36')][_0x7876('0x46')]?_0x214c18[_0x7876('0x36')]:_0x4ebd00[_0x7876('0x31')];if(_0x21151d['query'][_0x7876('0x3f')]){_0x214c18[_0x7876('0x47')]=[{'all':!![]}];}_0x214c18=_['merge']({},_0x214c18,_0x21151d[_0x7876('0x3e')]);return db['SalesforceConfiguration'][_0x7876('0x48')](_0x214c18)[_0x7876('0x26')](handleEntityNotFound(_0x432c45,null))[_0x7876('0x26')](respondWithResult(_0x432c45,null))[_0x7876('0x42')](handleError(_0x432c45,null));};exports['create']=function(_0x1b67ef,_0xa104a0){return db[_0x7876('0x2d')][_0x7876('0x49')](_0x1b67ef[_0x7876('0x4a')],{})[_0x7876('0x26')](respondWithResult(_0xa104a0,0xc9))[_0x7876('0x42')](handleError(_0xa104a0,null));};exports[_0x7876('0x24')]=function(_0x1d177b,_0x420300){if(_0x1d177b[_0x7876('0x4a')]['id']){delete _0x1d177b['body']['id'];}return db[_0x7876('0x2d')][_0x7876('0x48')]({'where':{'id':_0x1d177b['params']['id']}})[_0x7876('0x26')](handleEntityNotFound(_0x420300,null))[_0x7876('0x26')](saveUpdates(_0x1d177b[_0x7876('0x4a')],null))['then'](respondWithResult(_0x420300,null))[_0x7876('0x42')](handleError(_0x420300,null));};exports[_0x7876('0x25')]=function(_0x15d189,_0x14e07e){return db['SalesforceConfiguration'][_0x7876('0x48')]({'where':{'id':_0x15d189[_0x7876('0x44')]['id']}})[_0x7876('0x26')](handleEntityNotFound(_0x14e07e,null))[_0x7876('0x26')](removeEntity(_0x14e07e,null))['catch'](handleError(_0x14e07e,null));};exports[_0x7876('0x4b')]=function(_0x43a6eb,_0xfd322f,_0x5bd14a){var _0x5902c8={};var _0xf152c4={};var _0x2782c1;var _0x3c32a4;return db['SalesforceConfiguration'][_0x7876('0x4c')]({'where':{'id':_0x43a6eb['params']['id']}})[_0x7876('0x26')](handleEntityNotFound(_0xfd322f,null))[_0x7876('0x26')](function(_0x1af8c1){if(_0x1af8c1){_0x2782c1=_0x1af8c1;_0xf152c4['model']=_[_0x7876('0x45')](db[_0x7876('0x4d')]['rawAttributes']);_0xf152c4[_0x7876('0x32')]=_[_0x7876('0x45')](_0x43a6eb[_0x7876('0x32')]);_0xf152c4[_0x7876('0x33')]=_[_0x7876('0x34')](_0xf152c4[_0x7876('0x31')],_0xf152c4[_0x7876('0x32')]);_0x5902c8[_0x7876('0x36')]=_['intersection'](_0xf152c4[_0x7876('0x31')],qs[_0x7876('0x35')](_0x43a6eb[_0x7876('0x32')]['fields']));_0x5902c8['attributes']=_0x5902c8[_0x7876('0x36')][_0x7876('0x46')]?_0x5902c8[_0x7876('0x36')]:_0xf152c4[_0x7876('0x31')];_0x5902c8[_0x7876('0x4e')]=qs[_0x7876('0x39')](_0x43a6eb[_0x7876('0x32')]['sort']);_0x5902c8['where']=qs[_0x7876('0x33')](_['pick'](_0x43a6eb[_0x7876('0x32')],_0xf152c4[_0x7876('0x33')]));if(_0x43a6eb['query']['filter']){_0x5902c8[_0x7876('0x3a')]=_[_0x7876('0x4f')](_0x5902c8[_0x7876('0x3a')],{'$or':_['map'](_0x5902c8['attributes'],function(_0x1728f8){var _0x2b632a={};_0x2b632a[_0x1728f8]={'$like':'%'+_0x43a6eb[_0x7876('0x32')]['filter']+'%'};return _0x2b632a;})});}_0x5902c8=_[_0x7876('0x4f')]({},_0x5902c8,_0x43a6eb[_0x7876('0x3e')]);return _0x2782c1[_0x7876('0x4b')](_0x5902c8);}})['then'](function(_0x1f35cb){if(_0x1f35cb){_0x3c32a4=_0x1f35cb['length'];if(!_0x43a6eb[_0x7876('0x32')]['hasOwnProperty']('nolimit')){_0x5902c8['limit']=qs['limit'](_0x43a6eb[_0x7876('0x32')][_0x7876('0x20')]);_0x5902c8['offset']=qs['offset'](_0x43a6eb['query'][_0x7876('0x1d')]);}return _0x2782c1[_0x7876('0x4b')](_0x5902c8);}})[_0x7876('0x26')](function(_0x228117){if(_0x228117){return _0x228117?{'count':_0x3c32a4,'rows':_0x228117}:null;}})['then'](respondWithResult(_0xfd322f,null))[_0x7876('0x42')](handleError(_0xfd322f,null));};exports[_0x7876('0x50')]=function(_0x416fb5,_0x3b93d8,_0x3151d9){var _0x3c3c9b={};var _0x561753={};var _0x61df0;var _0xa944be;return db['SalesforceConfiguration'][_0x7876('0x4c')]({'where':{'id':_0x416fb5[_0x7876('0x44')]['id']}})[_0x7876('0x26')](handleEntityNotFound(_0x3b93d8,null))['then'](function(_0x2760f2){if(_0x2760f2){_0x61df0=_0x2760f2;_0x561753[_0x7876('0x31')]=_[_0x7876('0x45')](db['SalesforceField'][_0x7876('0x2e')]);_0x561753[_0x7876('0x32')]=_[_0x7876('0x45')](_0x416fb5[_0x7876('0x32')]);_0x561753['filters']=_[_0x7876('0x34')](_0x561753[_0x7876('0x31')],_0x561753[_0x7876('0x32')]);_0x3c3c9b['attributes']=_['intersection'](_0x561753[_0x7876('0x31')],qs[_0x7876('0x35')](_0x416fb5[_0x7876('0x32')][_0x7876('0x35')]));_0x3c3c9b['attributes']=_0x3c3c9b['attributes'][_0x7876('0x46')]?_0x3c3c9b[_0x7876('0x36')]:_0x561753[_0x7876('0x31')];_0x3c3c9b[_0x7876('0x4e')]=qs[_0x7876('0x39')](_0x416fb5[_0x7876('0x32')][_0x7876('0x39')]);_0x3c3c9b[_0x7876('0x3a')]=qs[_0x7876('0x33')](_[_0x7876('0x3b')](_0x416fb5[_0x7876('0x32')],_0x561753[_0x7876('0x33')]));if(_0x416fb5[_0x7876('0x32')][_0x7876('0x3d')]){_0x3c3c9b[_0x7876('0x3a')]=_[_0x7876('0x4f')](_0x3c3c9b['where'],{'$or':_['map'](_0x3c3c9b[_0x7876('0x36')],function(_0x2860cb){var _0x3ee49a={};_0x3ee49a[_0x2860cb]={'$like':'%'+_0x416fb5[_0x7876('0x32')][_0x7876('0x3d')]+'%'};return _0x3ee49a;})});}_0x3c3c9b=_['merge']({},_0x3c3c9b,_0x416fb5[_0x7876('0x3e')]);return _0x61df0[_0x7876('0x50')](_0x3c3c9b);}})[_0x7876('0x26')](function(_0x228fca){if(_0x228fca){_0xa944be=_0x228fca[_0x7876('0x46')];if(!_0x416fb5[_0x7876('0x32')][_0x7876('0x37')](_0x7876('0x38'))){_0x3c3c9b[_0x7876('0x20')]=qs['limit'](_0x416fb5['query'][_0x7876('0x20')]);_0x3c3c9b[_0x7876('0x1d')]=qs[_0x7876('0x1d')](_0x416fb5[_0x7876('0x32')][_0x7876('0x1d')]);}return _0x61df0[_0x7876('0x50')](_0x3c3c9b);}})[_0x7876('0x26')](function(_0x4c7016){if(_0x4c7016){return _0x4c7016?{'count':_0xa944be,'rows':_0x4c7016}:null;}})[_0x7876('0x26')](respondWithResult(_0x3b93d8,null))[_0x7876('0x42')](handleError(_0x3b93d8,null));};exports[_0x7876('0x51')]=function(_0x23e189,_0x3cd674,_0xca0faa){var _0x344f0c={};var _0x400a43={};var _0x3d14a7;var _0x1eff27;return db[_0x7876('0x2d')][_0x7876('0x4c')]({'where':{'id':_0x23e189[_0x7876('0x44')]['id']}})['then'](handleEntityNotFound(_0x3cd674,null))[_0x7876('0x26')](function(_0x3da36d){if(_0x3da36d){_0x3d14a7=_0x3da36d;_0x400a43[_0x7876('0x31')]=_[_0x7876('0x45')](db[_0x7876('0x4d')][_0x7876('0x2e')]);_0x400a43['query']=_[_0x7876('0x45')](_0x23e189[_0x7876('0x32')]);_0x400a43[_0x7876('0x33')]=_[_0x7876('0x34')](_0x400a43[_0x7876('0x31')],_0x400a43['query']);_0x344f0c[_0x7876('0x36')]=_[_0x7876('0x34')](_0x400a43[_0x7876('0x31')],qs[_0x7876('0x35')](_0x23e189[_0x7876('0x32')][_0x7876('0x35')]));_0x344f0c[_0x7876('0x36')]=_0x344f0c[_0x7876('0x36')][_0x7876('0x46')]?_0x344f0c[_0x7876('0x36')]:_0x400a43[_0x7876('0x31')];_0x344f0c[_0x7876('0x4e')]=qs[_0x7876('0x39')](_0x23e189[_0x7876('0x32')]['sort']);_0x344f0c[_0x7876('0x3a')]=qs[_0x7876('0x33')](_[_0x7876('0x3b')](_0x23e189[_0x7876('0x32')],_0x400a43[_0x7876('0x33')]));if(_0x23e189['query']['filter']){_0x344f0c['where']=_[_0x7876('0x4f')](_0x344f0c[_0x7876('0x3a')],{'$or':_[_0x7876('0x2c')](_0x344f0c[_0x7876('0x36')],function(_0x5c39ee){var _0x5edc66={};_0x5edc66[_0x5c39ee]={'$like':'%'+_0x23e189[_0x7876('0x32')]['filter']+'%'};return _0x5edc66;})});}_0x344f0c=_[_0x7876('0x4f')]({},_0x344f0c,_0x23e189[_0x7876('0x3e')]);return _0x3d14a7[_0x7876('0x51')](_0x344f0c);}})[_0x7876('0x26')](function(_0x24876a){if(_0x24876a){_0x1eff27=_0x24876a[_0x7876('0x46')];if(!_0x23e189['query']['hasOwnProperty']('nolimit')){_0x344f0c['limit']=qs[_0x7876('0x20')](_0x23e189[_0x7876('0x32')]['limit']);_0x344f0c[_0x7876('0x1d')]=qs['offset'](_0x23e189['query'][_0x7876('0x1d')]);}return _0x3d14a7[_0x7876('0x51')](_0x344f0c);}})[_0x7876('0x26')](function(_0xf683ac){if(_0xf683ac){return _0xf683ac?{'count':_0x1eff27,'rows':_0xf683ac}:null;}})[_0x7876('0x26')](respondWithResult(_0x3cd674,null))[_0x7876('0x42')](handleError(_0x3cd674,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 868622a..c7b950d 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 _0x7479=['path','rimraf','exports','define','SalesforceConfiguration','api','moment','request-promise'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x7479,0x85));var _0x9747=function(_0x45d699,_0x160bc5){_0x45d699=_0x45d699-0x0;var _0x47b893=_0x7479[_0x45d699];return _0x47b893;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x9747('0x0'));var moment=require(_0x9747('0x1'));var BPromise=require('bluebird');var rp=require(_0x9747('0x2'));var fs=require('fs');var path=require(_0x9747('0x3'));var rimraf=require(_0x9747('0x4'));var config=require('../../config/environment');var attributes=require('./intSalesforceConfiguration.attributes');module[_0x9747('0x5')]=function(_0x4b7167,_0x23682c){return _0x4b7167[_0x9747('0x6')](_0x9747('0x7'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x14c4=['moment','request-promise','rimraf','../../config/environment','exports','define','SalesforceConfiguration','lodash','util','../../config/logger'];(function(_0xbe796f,_0x1b280c){var _0x2f300e=function(_0x5c9f98){while(--_0x5c9f98){_0xbe796f['push'](_0xbe796f['shift']());}};_0x2f300e(++_0x1b280c);}(_0x14c4,0x16f));var _0x414c=function(_0x125106,_0x1a5f5d){_0x125106=_0x125106-0x0;var _0xc1ffd5=_0x14c4[_0x125106];return _0xc1ffd5;};'use strict';var _=require(_0x414c('0x0'));var util=require(_0x414c('0x1'));var logger=require(_0x414c('0x2'))('api');var moment=require(_0x414c('0x3'));var BPromise=require('bluebird');var rp=require(_0x414c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x414c('0x5'));var config=require(_0x414c('0x6'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0x414c('0x7')]=function(_0xcbd058,_0x4b34c3){return _0xcbd058[_0x414c('0x8')](_0x414c('0x9'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index 67c3ad5..94abc14 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 _0x6aa2=['bluebird','../../config/utils','../../config/logger','rpc','client','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x2ebac0,_0x5b41b9){var _0x3a4e75=function(_0x51b3a5){while(--_0x51b3a5){_0x2ebac0['push'](_0x2ebac0['shift']());}};_0x3a4e75(++_0x5b41b9);}(_0x6aa2,0x1a1));var _0x26aa=function(_0xbe40ad,_0x44343c){_0xbe40ad=_0xbe40ad-0x0;var _0x50fac9=_0x6aa2[_0xbe40ad];return _0x50fac9;};'use strict';var _=require(_0x26aa('0x0'));var util=require(_0x26aa('0x1'));var moment=require(_0x26aa('0x2'));var BPromise=require(_0x26aa('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x26aa('0x4'));var logger=require(_0x26aa('0x5'))(_0x26aa('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x26aa('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x466d42,_0x5182ab,_0x5a7eb4){return new BPromise(function(_0x185b1e,_0x46c62d){return client[_0x26aa('0x8')](_0x466d42,_0x5a7eb4)[_0x26aa('0x9')](function(_0x2d4204){logger[_0x26aa('0xa')](_0x26aa('0xb'),_0x5182ab,_0x26aa('0xc'));logger[_0x26aa('0xd')](_0x26aa('0xe'),_0x5182ab,_0x26aa('0xc'),JSON[_0x26aa('0xf')](_0x2d4204));if(_0x2d4204[_0x26aa('0x10')]){if(_0x2d4204[_0x26aa('0x10')][_0x26aa('0x11')]===0x1f4){logger['error'](_0x26aa('0xb'),_0x5182ab,_0x2d4204['error']['message']);return _0x46c62d(_0x2d4204[_0x26aa('0x10')][_0x26aa('0x12')]);}logger[_0x26aa('0x10')](_0x26aa('0xb'),_0x5182ab,_0x2d4204['error'][_0x26aa('0x12')]);return _0x185b1e(_0x2d4204['error'][_0x26aa('0x12')]);}else{logger[_0x26aa('0xa')]('SalesforceConfiguration,\x20%s,\x20%s',_0x5182ab,'request\x20sent');_0x185b1e(_0x2d4204['result']['message']);}})[_0x26aa('0x13')](function(_0x3af40d){logger[_0x26aa('0x10')]('SalesforceConfiguration,\x20%s,\x20%s',_0x5182ab,_0x3af40d);_0x46c62d(_0x3af40d);});});} \ No newline at end of file +var _0xb82e=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment'];(function(_0x302777,_0x41145b){var _0x2d4a16=function(_0x92dae2){while(--_0x92dae2){_0x302777['push'](_0x302777['shift']());}};_0x2d4a16(++_0x41145b);}(_0xb82e,0xc4));var _0xeb82=function(_0x191e4a,_0x5c04b5){_0x191e4a=_0x191e4a-0x0;var _0x3f5750=_0xb82e[_0x191e4a];return _0x3f5750;};'use strict';var _=require(_0xeb82('0x0'));var util=require('util');var moment=require(_0xeb82('0x1'));var BPromise=require(_0xeb82('0x2'));var rs=require(_0xeb82('0x3'));var fs=require('fs');var Redis=require(_0xeb82('0x4'));var db=require(_0xeb82('0x5'))['db'];var utils=require(_0xeb82('0x6'));var logger=require(_0xeb82('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xeb82('0x8'));var client=jayson['client'][_0xeb82('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x353603,_0x4df134,_0xd02f7f){return new BPromise(function(_0x25927f,_0xc5735){return client[_0xeb82('0xa')](_0x353603,_0xd02f7f)[_0xeb82('0xb')](function(_0x2d7d20){logger[_0xeb82('0xc')](_0xeb82('0xd'),_0x4df134,'request\x20sent');logger[_0xeb82('0xe')](_0xeb82('0xf'),_0x4df134,_0xeb82('0x10'),JSON[_0xeb82('0x11')](_0x2d7d20));if(_0x2d7d20[_0xeb82('0x12')]){if(_0x2d7d20[_0xeb82('0x12')][_0xeb82('0x13')]===0x1f4){logger[_0xeb82('0x12')]('SalesforceConfiguration,\x20%s,\x20%s',_0x4df134,_0x2d7d20['error'][_0xeb82('0x14')]);return _0xc5735(_0x2d7d20['error']['message']);}logger['error'](_0xeb82('0xd'),_0x4df134,_0x2d7d20[_0xeb82('0x12')]['message']);return _0x25927f(_0x2d7d20['error'][_0xeb82('0x14')]);}else{logger[_0xeb82('0xc')](_0xeb82('0xd'),_0x4df134,_0xeb82('0x10'));_0x25927f(_0x2d7d20['result'][_0xeb82('0x14')]);}})[_0xeb82('0x15')](function(_0x2d88cc){logger[_0xeb82('0x12')]('SalesforceConfiguration,\x20%s,\x20%s',_0x4df134,_0x2d88cc);_0xc5735(_0x2d88cc);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 8f67367..4dbbbd2 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 _0x733f=['./intSalesforceField.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x5c4274,_0x400429){var _0x582abd=function(_0x1d4ca6){while(--_0x1d4ca6){_0x5c4274['push'](_0x5c4274['shift']());}};_0x582abd(++_0x400429);}(_0x733f,0x1b4));var _0xf733=function(_0x17c53,_0x109296){_0x17c53=_0x17c53-0x0;var _0x54d0d5=_0x733f[_0x17c53];return _0x54d0d5;};'use strict';var multer=require(_0xf733('0x0'));var util=require(_0xf733('0x1'));var path=require(_0xf733('0x2'));var timeout=require(_0xf733('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf733('0x4'));var auth=require(_0xf733('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf733('0x6'));router[_0xf733('0x7')]('/',auth[_0xf733('0x8')](),controller['index']);router[_0xf733('0x7')](_0xf733('0x9'),auth[_0xf733('0x8')](),controller[_0xf733('0xa')]);router[_0xf733('0xb')]('/',auth[_0xf733('0x8')](),controller[_0xf733('0xc')]);router[_0xf733('0xd')](_0xf733('0x9'),auth[_0xf733('0x8')](),controller[_0xf733('0xe')]);router[_0xf733('0xf')]('/:id',auth[_0xf733('0x8')](),controller['destroy']);module[_0xf733('0x10')]=router; \ No newline at end of file +var _0x87bb=['create','put','update','delete','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','isAuthenticated','index','get','/:id','post'];(function(_0x56d3cb,_0x2c77c1){var _0x4ecbce=function(_0x346555){while(--_0x346555){_0x56d3cb['push'](_0x56d3cb['shift']());}};_0x4ecbce(++_0x2c77c1);}(_0x87bb,0x148));var _0xb87b=function(_0x53896d,_0x4b8282){_0x53896d=_0x53896d-0x0;var _0x50b533=_0x87bb[_0x53896d];return _0x50b533;};'use strict';var multer=require(_0xb87b('0x0'));var util=require('util');var path=require(_0xb87b('0x1'));var timeout=require('connect-timeout');var express=require(_0xb87b('0x2'));var router=express[_0xb87b('0x3')]();var fs_extra=require(_0xb87b('0x4'));var auth=require(_0xb87b('0x5'));var interaction=require(_0xb87b('0x6'));var config=require(_0xb87b('0x7'));var controller=require(_0xb87b('0x8'));router['get']('/',auth[_0xb87b('0x9')](),controller[_0xb87b('0xa')]);router[_0xb87b('0xb')](_0xb87b('0xc'),auth[_0xb87b('0x9')](),controller['show']);router[_0xb87b('0xd')]('/',auth[_0xb87b('0x9')](),controller[_0xb87b('0xe')]);router[_0xb87b('0xf')](_0xb87b('0xc'),auth[_0xb87b('0x9')](),controller[_0xb87b('0x10')]);router[_0xb87b('0x11')](_0xb87b('0xc'),auth[_0xb87b('0x9')](),controller['destroy']);module[_0xb87b('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 3304289..e0c089e 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 _0x0b49=['STRING','sequelize','exports','ENUM','string','picklist'];(function(_0x40012b,_0xa7292c){var _0x597456=function(_0x536dfd){while(--_0x536dfd){_0x40012b['push'](_0x40012b['shift']());}};_0x597456(++_0xa7292c);}(_0x0b49,0xa3));var _0x90b4=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0x0b49[_0x24259d];return _0x5a701;};'use strict';var Sequelize=require(_0x90b4('0x0'));module[_0x90b4('0x1')]={'type':{'type':Sequelize[_0x90b4('0x2')](_0x90b4('0x3'),'variable','customVariable','keyValue',_0x90b4('0x4')),'defaultValue':_0x90b4('0x3')},'content':{'type':Sequelize[_0x90b4('0x5')]},'key':{'type':Sequelize[_0x90b4('0x5')]},'keyType':{'type':Sequelize[_0x90b4('0x2')](_0x90b4('0x3'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x90b4('0x5')]},'idField':{'type':Sequelize[_0x90b4('0x5')]},'variableName':{'type':Sequelize[_0x90b4('0x5')]}}; \ No newline at end of file +var _0x6515=['exports','ENUM','string','variable','keyValue','picklist','STRING','customVariable'];(function(_0x1d7037,_0x57dd95){var _0x4d6568=function(_0x5c64c5){while(--_0x5c64c5){_0x1d7037['push'](_0x1d7037['shift']());}};_0x4d6568(++_0x57dd95);}(_0x6515,0xe0));var _0x5651=function(_0x2dfd28,_0x153b3c){_0x2dfd28=_0x2dfd28-0x0;var _0x49c016=_0x6515[_0x2dfd28];return _0x49c016;};'use strict';var Sequelize=require('sequelize');module[_0x5651('0x0')]={'type':{'type':Sequelize[_0x5651('0x1')](_0x5651('0x2'),_0x5651('0x3'),'customVariable',_0x5651('0x4'),_0x5651('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x5651('0x6')]},'key':{'type':Sequelize[_0x5651('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x5651('0x2'),_0x5651('0x3'),_0x5651('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x5651('0x6')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 2d6e708..6eae46e 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 _0x4d18=['name','send','map','SalesforceField','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','type','VIRTUAL','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','stack'];(function(_0x5cf64e,_0x32f88c){var _0x12fdfa=function(_0x45d529){while(--_0x45d529){_0x5cf64e['push'](_0x5cf64e['shift']());}};_0x12fdfa(++_0x32f88c);}(_0x4d18,0x6c));var _0x84d1=function(_0x135c02,_0x6695db){_0x135c02=_0x135c02-0x0;var _0x114a14=_0x4d18[_0x135c02];return _0x114a14;};'use strict';var emlformat=require(_0x84d1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x84d1('0x1'));var jsonpatch=require(_0x84d1('0x2'));var rp=require(_0x84d1('0x3'));var moment=require(_0x84d1('0x4'));var BPromise=require(_0x84d1('0x5'));var Mustache=require('mustache');var util=require(_0x84d1('0x6'));var path=require(_0x84d1('0x7'));var sox=require(_0x84d1('0x8'));var csv=require('to-csv');var ejs=require(_0x84d1('0x9'));var fs=require('fs');var fs_extra=require(_0x84d1('0xa'));var _=require(_0x84d1('0xb'));var squel=require('squel');var crypto=require(_0x84d1('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x84d1('0xd'));var toCsv=require(_0x84d1('0xe'));var querystring=require(_0x84d1('0xf'));var Papa=require(_0x84d1('0x10'));var Redis=require(_0x84d1('0x11'));var authService=require(_0x84d1('0x12'));var qs=require(_0x84d1('0x13'));var as=require(_0x84d1('0x14'));var hardwareService=require(_0x84d1('0x15'));var logger=require(_0x84d1('0x16'))(_0x84d1('0x17'));var utils=require(_0x84d1('0x18'));var config=require(_0x84d1('0x19'));var licenseUtil=require(_0x84d1('0x1a'));var db=require(_0x84d1('0x1b'))['db'];function respondWithStatusCode(_0x47df51,_0x425cb4){_0x425cb4=_0x425cb4||0xcc;return function(_0x3059e5){if(_0x3059e5){return _0x47df51[_0x84d1('0x1c')](_0x425cb4);}return _0x47df51[_0x84d1('0x1d')](_0x425cb4)['end']();};}function respondWithResult(_0x5d0fb2,_0x429614){_0x429614=_0x429614||0xc8;return function(_0x4b799){if(_0x4b799){return _0x5d0fb2[_0x84d1('0x1d')](_0x429614)['json'](_0x4b799);}};}function respondWithFilteredResult(_0x329658,_0x4f06ec){return function(_0x30a686){if(_0x30a686){var _0x3ce3fc=typeof _0x4f06ec[_0x84d1('0x1e')]===_0x84d1('0x1f')&&typeof _0x4f06ec[_0x84d1('0x20')]===_0x84d1('0x1f');var _0x316a04=_0x30a686[_0x84d1('0x21')];var _0x2d7463=_0x3ce3fc?0x0:_0x4f06ec[_0x84d1('0x1e')];var _0x2f2cbb=_0x3ce3fc?_0x30a686[_0x84d1('0x21')]:_0x4f06ec[_0x84d1('0x1e')]+_0x4f06ec[_0x84d1('0x20')];var _0x57dd02;if(_0x2f2cbb>=_0x316a04){_0x2f2cbb=_0x316a04;_0x57dd02=0xc8;}else{_0x57dd02=0xce;}_0x329658[_0x84d1('0x1d')](_0x57dd02);return _0x329658[_0x84d1('0x22')](_0x84d1('0x23'),_0x2d7463+'-'+_0x2f2cbb+'/'+_0x316a04)[_0x84d1('0x24')](_0x30a686);}return null;};}function patchUpdates(_0x5db0a5){return function(_0x54db5d){try{jsonpatch[_0x84d1('0x25')](_0x54db5d,_0x5db0a5,!![]);}catch(_0x180c09){return BPromise[_0x84d1('0x26')](_0x180c09);}return _0x54db5d[_0x84d1('0x27')]();};}function saveUpdates(_0x2c8245,_0x2e11f6){return function(_0x36735f){if(_0x36735f){return _0x36735f[_0x84d1('0x28')](_0x2c8245)[_0x84d1('0x29')](function(_0xb1b393){return _0xb1b393;});}return null;};}function removeEntity(_0x537381,_0x18aa1c){return function(_0x2bc81e){if(_0x2bc81e){return _0x2bc81e[_0x84d1('0x2a')]()[_0x84d1('0x29')](function(){_0x537381['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b7d10,_0x3324c0){return function(_0x18b5ea){if(!_0x18b5ea){_0x3b7d10[_0x84d1('0x1c')](0x194);}return _0x18b5ea;};}function handleError(_0x467d05,_0x1efbff){_0x1efbff=_0x1efbff||0x1f4;return function(_0x328210){logger['error'](_0x328210[_0x84d1('0x2b')]);if(_0x328210[_0x84d1('0x2c')]){delete _0x328210[_0x84d1('0x2c')];}_0x467d05[_0x84d1('0x1d')](_0x1efbff)[_0x84d1('0x2d')](_0x328210);};}exports['index']=function(_0x44bf1a,_0x58cbb0){var _0x1bf4b3={},_0x42a387={},_0x310037={'count':0x0,'rows':[]};var _0x5f170e=_[_0x84d1('0x2e')](db[_0x84d1('0x2f')]['rawAttributes'],function(_0x2db8ed){return{'name':_0x2db8ed[_0x84d1('0x30')],'type':_0x2db8ed['type'][_0x84d1('0x31')]};});_0x42a387[_0x84d1('0x32')]=_[_0x84d1('0x2e')](_0x5f170e,_0x84d1('0x2c'));_0x42a387['query']=_[_0x84d1('0x33')](_0x44bf1a[_0x84d1('0x34')]);_0x42a387[_0x84d1('0x35')]=_[_0x84d1('0x36')](_0x42a387['model'],_0x42a387['query']);_0x1bf4b3[_0x84d1('0x37')]=_['intersection'](_0x42a387[_0x84d1('0x32')],qs[_0x84d1('0x38')](_0x44bf1a[_0x84d1('0x34')][_0x84d1('0x38')]));_0x1bf4b3[_0x84d1('0x37')]=_0x1bf4b3[_0x84d1('0x37')][_0x84d1('0x39')]?_0x1bf4b3[_0x84d1('0x37')]:_0x42a387[_0x84d1('0x32')];if(!_0x44bf1a['query'][_0x84d1('0x3a')](_0x84d1('0x3b'))){_0x1bf4b3[_0x84d1('0x20')]=qs[_0x84d1('0x20')](_0x44bf1a['query'][_0x84d1('0x20')]);_0x1bf4b3[_0x84d1('0x1e')]=qs[_0x84d1('0x1e')](_0x44bf1a[_0x84d1('0x34')]['offset']);}_0x1bf4b3[_0x84d1('0x3c')]=qs['sort'](_0x44bf1a['query']['sort']);_0x1bf4b3[_0x84d1('0x3d')]=qs[_0x84d1('0x35')](_[_0x84d1('0x3e')](_0x44bf1a[_0x84d1('0x34')],_0x42a387[_0x84d1('0x35')]),_0x5f170e);if(_0x44bf1a[_0x84d1('0x34')][_0x84d1('0x3f')]){_0x1bf4b3['where']=_['merge'](_0x1bf4b3[_0x84d1('0x3d')],{'$or':_[_0x84d1('0x2e')](_0x5f170e,function(_0x22a59c){if(_0x22a59c[_0x84d1('0x40')]!==_0x84d1('0x41')){var _0x8baf00={};_0x8baf00[_0x22a59c[_0x84d1('0x2c')]]={'$like':'%'+_0x44bf1a[_0x84d1('0x34')][_0x84d1('0x3f')]+'%'};return _0x8baf00;}})});}_0x1bf4b3=_['merge']({},_0x1bf4b3,_0x44bf1a['options']);var _0x33d816={'where':_0x1bf4b3[_0x84d1('0x3d')]};return db['SalesforceField'][_0x84d1('0x21')](_0x33d816)[_0x84d1('0x29')](function(_0x11a958){_0x310037['count']=_0x11a958;if(_0x44bf1a[_0x84d1('0x34')][_0x84d1('0x42')]){_0x1bf4b3[_0x84d1('0x43')]=[{'all':!![]}];}return db['SalesforceField']['findAll'](_0x1bf4b3);})[_0x84d1('0x29')](function(_0x56ebac){_0x310037[_0x84d1('0x44')]=_0x56ebac;return _0x310037;})[_0x84d1('0x29')](respondWithFilteredResult(_0x58cbb0,_0x1bf4b3))[_0x84d1('0x45')](handleError(_0x58cbb0,null));};exports[_0x84d1('0x46')]=function(_0x354d5c,_0x16db21){var _0x528886={'raw':!![],'where':{'id':_0x354d5c[_0x84d1('0x47')]['id']}},_0x34f90e={};_0x34f90e[_0x84d1('0x32')]=_[_0x84d1('0x33')](db[_0x84d1('0x2f')][_0x84d1('0x48')]);_0x34f90e[_0x84d1('0x34')]=_[_0x84d1('0x33')](_0x354d5c[_0x84d1('0x34')]);_0x34f90e[_0x84d1('0x35')]=_[_0x84d1('0x36')](_0x34f90e[_0x84d1('0x32')],_0x34f90e['query']);_0x528886[_0x84d1('0x37')]=_[_0x84d1('0x36')](_0x34f90e[_0x84d1('0x32')],qs[_0x84d1('0x38')](_0x354d5c['query'][_0x84d1('0x38')]));_0x528886[_0x84d1('0x37')]=_0x528886[_0x84d1('0x37')][_0x84d1('0x39')]?_0x528886[_0x84d1('0x37')]:_0x34f90e['model'];if(_0x354d5c[_0x84d1('0x34')][_0x84d1('0x42')]){_0x528886['include']=[{'all':!![]}];}_0x528886=_['merge']({},_0x528886,_0x354d5c['options']);return db[_0x84d1('0x2f')][_0x84d1('0x49')](_0x528886)[_0x84d1('0x29')](handleEntityNotFound(_0x16db21,null))[_0x84d1('0x29')](respondWithResult(_0x16db21,null))['catch'](handleError(_0x16db21,null));};exports[_0x84d1('0x4a')]=function(_0x4b7274,_0x583ae5){return db[_0x84d1('0x2f')][_0x84d1('0x4a')](_0x4b7274[_0x84d1('0x4b')],{})[_0x84d1('0x29')](respondWithResult(_0x583ae5,0xc9))[_0x84d1('0x45')](handleError(_0x583ae5,null));};exports[_0x84d1('0x28')]=function(_0x48c859,_0xe7e2e4){if(_0x48c859[_0x84d1('0x4b')]['id']){delete _0x48c859[_0x84d1('0x4b')]['id'];}return db['SalesforceField']['find']({'where':{'id':_0x48c859[_0x84d1('0x47')]['id']}})[_0x84d1('0x29')](handleEntityNotFound(_0xe7e2e4,null))[_0x84d1('0x29')](saveUpdates(_0x48c859['body'],null))[_0x84d1('0x29')](respondWithResult(_0xe7e2e4,null))['catch'](handleError(_0xe7e2e4,null));};exports[_0x84d1('0x2a')]=function(_0x2626d1,_0x1a2ac2){return db['SalesforceField'][_0x84d1('0x49')]({'where':{'id':_0x2626d1[_0x84d1('0x47')]['id']}})[_0x84d1('0x29')](handleEntityNotFound(_0x1a2ac2,null))[_0x84d1('0x29')](removeEntity(_0x1a2ac2,null))[_0x84d1('0x45')](handleError(_0x1a2ac2,null));}; \ No newline at end of file +var _0x08df=['type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','params','include','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','SalesforceField','rawAttributes','fieldName'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x08df,0x18e));var _0xf08d=function(_0x1dc24d,_0x541fa4){_0x1dc24d=_0x1dc24d-0x0;var _0x5d7fb2=_0x08df[_0x1dc24d];return _0x5d7fb2;};'use strict';var emlformat=require(_0xf08d('0x0'));var rimraf=require(_0xf08d('0x1'));var zipdir=require(_0xf08d('0x2'));var jsonpatch=require(_0xf08d('0x3'));var rp=require(_0xf08d('0x4'));var moment=require(_0xf08d('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf08d('0x6'));var path=require(_0xf08d('0x7'));var sox=require('sox');var csv=require(_0xf08d('0x8'));var ejs=require(_0xf08d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf08d('0xa'));var squel=require(_0xf08d('0xb'));var crypto=require(_0xf08d('0xc'));var jsforce=require(_0xf08d('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf08d('0xe'));var Papa=require('papaparse');var Redis=require(_0xf08d('0xf'));var authService=require(_0xf08d('0x10'));var qs=require(_0xf08d('0x11'));var as=require(_0xf08d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf08d('0x13'))(_0xf08d('0x14'));var utils=require(_0xf08d('0x15'));var config=require(_0xf08d('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xf08d('0x17'))['db'];function respondWithStatusCode(_0x459d01,_0x49d781){_0x49d781=_0x49d781||0xcc;return function(_0xb3fef3){if(_0xb3fef3){return _0x459d01[_0xf08d('0x18')](_0x49d781);}return _0x459d01[_0xf08d('0x19')](_0x49d781)['end']();};}function respondWithResult(_0x187cad,_0x33b398){_0x33b398=_0x33b398||0xc8;return function(_0x2a0686){if(_0x2a0686){return _0x187cad[_0xf08d('0x19')](_0x33b398)['json'](_0x2a0686);}};}function respondWithFilteredResult(_0x2b48f9,_0x31b1fa){return function(_0x291011){if(_0x291011){var _0x183348=typeof _0x31b1fa[_0xf08d('0x1a')]===_0xf08d('0x1b')&&typeof _0x31b1fa[_0xf08d('0x1c')]===_0xf08d('0x1b');var _0x37a165=_0x291011[_0xf08d('0x1d')];var _0x10ff9e=_0x183348?0x0:_0x31b1fa[_0xf08d('0x1a')];var _0x84c0b6=_0x183348?_0x291011[_0xf08d('0x1d')]:_0x31b1fa[_0xf08d('0x1a')]+_0x31b1fa[_0xf08d('0x1c')];var _0x2c7afb;if(_0x84c0b6>=_0x37a165){_0x84c0b6=_0x37a165;_0x2c7afb=0xc8;}else{_0x2c7afb=0xce;}_0x2b48f9[_0xf08d('0x19')](_0x2c7afb);return _0x2b48f9[_0xf08d('0x1e')]('Content-Range',_0x10ff9e+'-'+_0x84c0b6+'/'+_0x37a165)['json'](_0x291011);}return null;};}function patchUpdates(_0x264abe){return function(_0x55a1e0){try{jsonpatch[_0xf08d('0x1f')](_0x55a1e0,_0x264abe,!![]);}catch(_0x2fff35){return BPromise[_0xf08d('0x20')](_0x2fff35);}return _0x55a1e0['save']();};}function saveUpdates(_0x1b0f01,_0x209fcc){return function(_0x47af1a){if(_0x47af1a){return _0x47af1a[_0xf08d('0x21')](_0x1b0f01)[_0xf08d('0x22')](function(_0xac84f7){return _0xac84f7;});}return null;};}function removeEntity(_0x3acbba,_0x1c34a0){return function(_0x7c833b){if(_0x7c833b){return _0x7c833b[_0xf08d('0x23')]()[_0xf08d('0x22')](function(){_0x3acbba[_0xf08d('0x19')](0xcc)[_0xf08d('0x24')]();});}};}function handleEntityNotFound(_0x2e9890,_0x5643a7){return function(_0x1a9a17){if(!_0x1a9a17){_0x2e9890[_0xf08d('0x18')](0x194);}return _0x1a9a17;};}function handleError(_0x305289,_0x1e0b2a){_0x1e0b2a=_0x1e0b2a||0x1f4;return function(_0x5a2289){logger[_0xf08d('0x25')](_0x5a2289[_0xf08d('0x26')]);if(_0x5a2289[_0xf08d('0x27')]){delete _0x5a2289[_0xf08d('0x27')];}_0x305289[_0xf08d('0x19')](_0x1e0b2a)[_0xf08d('0x28')](_0x5a2289);};}exports[_0xf08d('0x29')]=function(_0x41f72a,_0x3b77cc){var _0x4e4911={},_0x1d1ee7={},_0x502d71={'count':0x0,'rows':[]};var _0x56c09f=_[_0xf08d('0x2a')](db[_0xf08d('0x2b')][_0xf08d('0x2c')],function(_0x25e01a){return{'name':_0x25e01a[_0xf08d('0x2d')],'type':_0x25e01a[_0xf08d('0x2e')][_0xf08d('0x2f')]};});_0x1d1ee7['model']=_[_0xf08d('0x2a')](_0x56c09f,_0xf08d('0x27'));_0x1d1ee7[_0xf08d('0x30')]=_[_0xf08d('0x31')](_0x41f72a[_0xf08d('0x30')]);_0x1d1ee7[_0xf08d('0x32')]=_[_0xf08d('0x33')](_0x1d1ee7['model'],_0x1d1ee7[_0xf08d('0x30')]);_0x4e4911[_0xf08d('0x34')]=_[_0xf08d('0x33')](_0x1d1ee7[_0xf08d('0x35')],qs[_0xf08d('0x36')](_0x41f72a[_0xf08d('0x30')][_0xf08d('0x36')]));_0x4e4911['attributes']=_0x4e4911[_0xf08d('0x34')][_0xf08d('0x37')]?_0x4e4911[_0xf08d('0x34')]:_0x1d1ee7[_0xf08d('0x35')];if(!_0x41f72a['query'][_0xf08d('0x38')](_0xf08d('0x39'))){_0x4e4911['limit']=qs[_0xf08d('0x1c')](_0x41f72a[_0xf08d('0x30')][_0xf08d('0x1c')]);_0x4e4911[_0xf08d('0x1a')]=qs[_0xf08d('0x1a')](_0x41f72a['query'][_0xf08d('0x1a')]);}_0x4e4911[_0xf08d('0x3a')]=qs[_0xf08d('0x3b')](_0x41f72a['query']['sort']);_0x4e4911[_0xf08d('0x3c')]=qs[_0xf08d('0x32')](_[_0xf08d('0x3d')](_0x41f72a[_0xf08d('0x30')],_0x1d1ee7[_0xf08d('0x32')]),_0x56c09f);if(_0x41f72a[_0xf08d('0x30')][_0xf08d('0x3e')]){_0x4e4911[_0xf08d('0x3c')]=_[_0xf08d('0x3f')](_0x4e4911[_0xf08d('0x3c')],{'$or':_[_0xf08d('0x2a')](_0x56c09f,function(_0x406ca8){if(_0x406ca8[_0xf08d('0x2e')]!==_0xf08d('0x40')){var _0x31bac9={};_0x31bac9[_0x406ca8[_0xf08d('0x27')]]={'$like':'%'+_0x41f72a[_0xf08d('0x30')]['filter']+'%'};return _0x31bac9;}})});}_0x4e4911=_['merge']({},_0x4e4911,_0x41f72a[_0xf08d('0x41')]);var _0x299235={'where':_0x4e4911[_0xf08d('0x3c')]};return db[_0xf08d('0x2b')][_0xf08d('0x1d')](_0x299235)['then'](function(_0x56bb01){_0x502d71[_0xf08d('0x1d')]=_0x56bb01;if(_0x41f72a[_0xf08d('0x30')][_0xf08d('0x42')]){_0x4e4911['include']=[{'all':!![]}];}return db['SalesforceField'][_0xf08d('0x43')](_0x4e4911);})['then'](function(_0x3a51d1){_0x502d71['rows']=_0x3a51d1;return _0x502d71;})['then'](respondWithFilteredResult(_0x3b77cc,_0x4e4911))['catch'](handleError(_0x3b77cc,null));};exports['show']=function(_0x4f6a98,_0x36146c){var _0x1f736f={'raw':!![],'where':{'id':_0x4f6a98[_0xf08d('0x44')]['id']}},_0x344bec={};_0x344bec[_0xf08d('0x35')]=_[_0xf08d('0x31')](db[_0xf08d('0x2b')][_0xf08d('0x2c')]);_0x344bec['query']=_[_0xf08d('0x31')](_0x4f6a98[_0xf08d('0x30')]);_0x344bec['filters']=_[_0xf08d('0x33')](_0x344bec[_0xf08d('0x35')],_0x344bec[_0xf08d('0x30')]);_0x1f736f['attributes']=_[_0xf08d('0x33')](_0x344bec[_0xf08d('0x35')],qs['fields'](_0x4f6a98[_0xf08d('0x30')][_0xf08d('0x36')]));_0x1f736f[_0xf08d('0x34')]=_0x1f736f[_0xf08d('0x34')]['length']?_0x1f736f['attributes']:_0x344bec[_0xf08d('0x35')];if(_0x4f6a98['query'][_0xf08d('0x42')]){_0x1f736f[_0xf08d('0x45')]=[{'all':!![]}];}_0x1f736f=_[_0xf08d('0x3f')]({},_0x1f736f,_0x4f6a98['options']);return db['SalesforceField'][_0xf08d('0x46')](_0x1f736f)[_0xf08d('0x22')](handleEntityNotFound(_0x36146c,null))[_0xf08d('0x22')](respondWithResult(_0x36146c,null))[_0xf08d('0x47')](handleError(_0x36146c,null));};exports['create']=function(_0xe73e44,_0x43f7e8){return db['SalesforceField'][_0xf08d('0x48')](_0xe73e44[_0xf08d('0x49')],{})[_0xf08d('0x22')](respondWithResult(_0x43f7e8,0xc9))['catch'](handleError(_0x43f7e8,null));};exports[_0xf08d('0x21')]=function(_0x32e9a4,_0x1c2f9d){if(_0x32e9a4['body']['id']){delete _0x32e9a4[_0xf08d('0x49')]['id'];}return db[_0xf08d('0x2b')][_0xf08d('0x46')]({'where':{'id':_0x32e9a4[_0xf08d('0x44')]['id']}})['then'](handleEntityNotFound(_0x1c2f9d,null))[_0xf08d('0x22')](saveUpdates(_0x32e9a4[_0xf08d('0x49')],null))[_0xf08d('0x22')](respondWithResult(_0x1c2f9d,null))['catch'](handleError(_0x1c2f9d,null));};exports[_0xf08d('0x23')]=function(_0xbb0889,_0x1cc7ff){return db[_0xf08d('0x2b')][_0xf08d('0x46')]({'where':{'id':_0xbb0889[_0xf08d('0x44')]['id']}})[_0xf08d('0x22')](handleEntityNotFound(_0x1cc7ff,null))['then'](removeEntity(_0x1cc7ff,null))[_0xf08d('0x47')](handleError(_0x1cc7ff,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index c8805f1..4c16961 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 _0x0676=['bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','util','api'];(function(_0x1f74ae,_0x313a50){var _0x4bce19=function(_0x2fa4eb){while(--_0x2fa4eb){_0x1f74ae['push'](_0x1f74ae['shift']());}};_0x4bce19(++_0x313a50);}(_0x0676,0xed));var _0x6067=function(_0x5c81f9,_0x25a82f){_0x5c81f9=_0x5c81f9-0x0;var _0x3201dd=_0x0676[_0x5c81f9];return _0x3201dd;};'use strict';var _=require(_0x6067('0x0'));var util=require(_0x6067('0x1'));var logger=require('../../config/logger')(_0x6067('0x2'));var moment=require('moment');var BPromise=require(_0x6067('0x3'));var rp=require(_0x6067('0x4'));var fs=require('fs');var path=require(_0x6067('0x5'));var rimraf=require(_0x6067('0x6'));var config=require(_0x6067('0x7'));var attributes=require(_0x6067('0x8'));module['exports']=function(_0x1cf000,_0x1d3bb7){return _0x1cf000[_0x6067('0x9')](_0x6067('0xa'),attributes,{'tableName':_0x6067('0xb'),'paranoid':![],'indexes':[{'name':_0x6067('0xc'),'fields':[_0x6067('0xd'),_0x6067('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2f3e=['request-promise','rimraf','../../config/environment','./intSalesforceField.attributes','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','FieldId','lodash','api','moment','bluebird'];(function(_0xca1091,_0x539dbf){var _0xd3019c=function(_0xd629e0){while(--_0xd629e0){_0xca1091['push'](_0xca1091['shift']());}};_0xd3019c(++_0x539dbf);}(_0x2f3e,0x1b6));var _0xe2f3=function(_0x16938f,_0x35e57f){_0x16938f=_0x16938f-0x0;var _0x5c66e9=_0x2f3e[_0x16938f];return _0x5c66e9;};'use strict';var _=require(_0xe2f3('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe2f3('0x1'));var moment=require(_0xe2f3('0x2'));var BPromise=require(_0xe2f3('0x3'));var rp=require(_0xe2f3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe2f3('0x5'));var config=require(_0xe2f3('0x6'));var attributes=require(_0xe2f3('0x7'));module['exports']=function(_0x3def9a,_0x33a25b){return _0x3def9a[_0xe2f3('0x8')](_0xe2f3('0x9'),attributes,{'tableName':_0xe2f3('0xa'),'paranoid':![],'indexes':[{'name':_0xe2f3('0xb'),'fields':['idField',_0xe2f3('0xc')],'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 e91b48c..1939bf5 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 _0x138e=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x138e,0x13b));var _0xe138=function(_0x5424b9,_0x3d3d94){_0x5424b9=_0x5424b9-0x0;var _0x2b5ebc=_0x138e[_0x5424b9];return _0x2b5ebc;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe138('0x0'));var BPromise=require(_0xe138('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe138('0x2'));var db=require(_0xe138('0x3'))['db'];var utils=require(_0xe138('0x4'));var logger=require('../../config/logger')(_0xe138('0x5'));var config=require(_0xe138('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xe138('0x7')][_0xe138('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x435dec,_0x1886f9,_0x1daeef){return new BPromise(function(_0xf11453,_0x4a0059){return client[_0xe138('0x9')](_0x435dec,_0x1daeef)[_0xe138('0xa')](function(_0x79c3a0){logger[_0xe138('0xb')](_0xe138('0xc'),_0x1886f9,_0xe138('0xd'));logger[_0xe138('0xe')](_0xe138('0xf'),_0x1886f9,'request\x20sent',JSON[_0xe138('0x10')](_0x79c3a0));if(_0x79c3a0[_0xe138('0x11')]){if(_0x79c3a0[_0xe138('0x11')][_0xe138('0x12')]===0x1f4){logger['error'](_0xe138('0xc'),_0x1886f9,_0x79c3a0[_0xe138('0x11')][_0xe138('0x13')]);return _0x4a0059(_0x79c3a0[_0xe138('0x11')]['message']);}logger[_0xe138('0x11')](_0xe138('0xc'),_0x1886f9,_0x79c3a0[_0xe138('0x11')][_0xe138('0x13')]);return _0xf11453(_0x79c3a0[_0xe138('0x11')][_0xe138('0x13')]);}else{logger[_0xe138('0xb')](_0xe138('0xc'),_0x1886f9,_0xe138('0xd'));_0xf11453(_0x79c3a0['result'][_0xe138('0x13')]);}})[_0xe138('0x14')](function(_0x3c7eba){logger[_0xe138('0x11')](_0xe138('0xc'),_0x1886f9,_0x3c7eba);_0x4a0059(_0x3c7eba);});});} \ No newline at end of file +var _0xde6f=['../../config/environment','client','http','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x6ebb48,_0x53fbf3){var _0xc74302=function(_0x1a2614){while(--_0x1a2614){_0x6ebb48['push'](_0x6ebb48['shift']());}};_0xc74302(++_0x53fbf3);}(_0xde6f,0xe8));var _0xfde6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xde6f[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xfde6('0x0'));var util=require(_0xfde6('0x1'));var moment=require(_0xfde6('0x2'));var BPromise=require(_0xfde6('0x3'));var rs=require(_0xfde6('0x4'));var fs=require('fs');var Redis=require(_0xfde6('0x5'));var db=require(_0xfde6('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xfde6('0x7'))('rpc');var config=require(_0xfde6('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xfde6('0x9')][_0xfde6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x58eff6,_0x415eae,_0x17a2ab){return new BPromise(function(_0x24be29,_0x2bd32d){return client[_0xfde6('0xb')](_0x58eff6,_0x17a2ab)[_0xfde6('0xc')](function(_0x595015){logger[_0xfde6('0xd')](_0xfde6('0xe'),_0x415eae,_0xfde6('0xf'));logger[_0xfde6('0x10')](_0xfde6('0x11'),_0x415eae,_0xfde6('0xf'),JSON[_0xfde6('0x12')](_0x595015));if(_0x595015[_0xfde6('0x13')]){if(_0x595015['error'][_0xfde6('0x14')]===0x1f4){logger[_0xfde6('0x13')](_0xfde6('0xe'),_0x415eae,_0x595015[_0xfde6('0x13')][_0xfde6('0x15')]);return _0x2bd32d(_0x595015['error']['message']);}logger[_0xfde6('0x13')](_0xfde6('0xe'),_0x415eae,_0x595015[_0xfde6('0x13')][_0xfde6('0x15')]);return _0x24be29(_0x595015[_0xfde6('0x13')][_0xfde6('0x15')]);}else{logger['info'](_0xfde6('0xe'),_0x415eae,_0xfde6('0xf'));_0x24be29(_0x595015[_0xfde6('0x16')][_0xfde6('0x15')]);}})[_0xfde6('0x17')](function(_0x5d458c){logger[_0xfde6('0x13')](_0xfde6('0xe'),_0x415eae,_0x5d458c);_0x2bd32d(_0x5d458c);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index aff177e..e598bc1 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 _0x636f=['destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','index','/:id','isAuthenticated','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete'];(function(_0x3e83dc,_0x15f9c5){var _0x28018a=function(_0x5a0f65){while(--_0x5a0f65){_0x3e83dc['push'](_0x3e83dc['shift']());}};_0x28018a(++_0x15f9c5);}(_0x636f,0xa4));var _0xf636=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x636f[_0x3b380d];return _0x54502b;};'use strict';var multer=require('multer');var util=require(_0xf636('0x0'));var path=require(_0xf636('0x1'));var timeout=require(_0xf636('0x2'));var express=require(_0xf636('0x3'));var router=express[_0xf636('0x4')]();var fs_extra=require(_0xf636('0x5'));var auth=require(_0xf636('0x6'));var interaction=require(_0xf636('0x7'));var config=require(_0xf636('0x8'));var controller=require(_0xf636('0x9'));router[_0xf636('0xa')]('/',auth['isAuthenticated'](),controller[_0xf636('0xb')]);router['get'](_0xf636('0xc'),auth[_0xf636('0xd')](),controller[_0xf636('0xe')]);router['get']('/:id/configurations',auth[_0xf636('0xd')](),controller[_0xf636('0xf')]);router[_0xf636('0xa')](_0xf636('0x10'),auth[_0xf636('0xd')](),controller[_0xf636('0x11')]);router[_0xf636('0x12')]('/',auth['isAuthenticated'](),controller[_0xf636('0x13')]);router['post'](_0xf636('0x14'),auth[_0xf636('0xd')](),controller[_0xf636('0x15')]);router[_0xf636('0x16')](_0xf636('0xc'),auth[_0xf636('0xd')](),controller[_0xf636('0x17')]);router[_0xf636('0x18')]('/:id',auth[_0xf636('0xd')](),controller[_0xf636('0x19')]);module[_0xf636('0x1a')]=router; \ No newline at end of file +var _0xc9fb=['delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','index','get','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update'];(function(_0x45d982,_0x348169){var _0x387916=function(_0x3478f8){while(--_0x3478f8){_0x45d982['push'](_0x45d982['shift']());}};_0x387916(++_0x348169);}(_0xc9fb,0x148));var _0xbc9f=function(_0x383094,_0x2b054a){_0x383094=_0x383094-0x0;var _0x55800a=_0xc9fb[_0x383094];return _0x55800a;};'use strict';var multer=require(_0xbc9f('0x0'));var util=require(_0xbc9f('0x1'));var path=require(_0xbc9f('0x2'));var timeout=require('connect-timeout');var express=require(_0xbc9f('0x3'));var router=express['Router']();var fs_extra=require(_0xbc9f('0x4'));var auth=require(_0xbc9f('0x5'));var interaction=require(_0xbc9f('0x6'));var config=require(_0xbc9f('0x7'));var controller=require(_0xbc9f('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xbc9f('0x9')]);router[_0xbc9f('0xa')](_0xbc9f('0xb'),auth[_0xbc9f('0xc')](),controller[_0xbc9f('0xd')]);router[_0xbc9f('0xa')](_0xbc9f('0xe'),auth[_0xbc9f('0xc')](),controller[_0xbc9f('0xf')]);router['get'](_0xbc9f('0x10'),auth[_0xbc9f('0xc')](),controller[_0xbc9f('0x11')]);router[_0xbc9f('0x12')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xbc9f('0xe'),auth[_0xbc9f('0xc')](),controller[_0xbc9f('0x13')]);router[_0xbc9f('0x14')](_0xbc9f('0xb'),auth[_0xbc9f('0xc')](),controller[_0xbc9f('0x15')]);router[_0xbc9f('0x16')]('/:id',auth[_0xbc9f('0xc')](),controller[_0xbc9f('0x17')]);module[_0xbc9f('0x18')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 05ae56b..c0b6f9c 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 _0x8728=['username','remoteUri','sequelize','exports','STRING'];(function(_0xbb10b3,_0x5742e4){var _0x98ae28=function(_0x494a57){while(--_0x494a57){_0xbb10b3['push'](_0xbb10b3['shift']());}};_0x98ae28(++_0x5742e4);}(_0x8728,0x7f));var _0x8872=function(_0x78ec86,_0x28806f){_0x78ec86=_0x78ec86-0x0;var _0x41af29=_0x8728[_0x78ec86];return _0x41af29;};'use strict';var Sequelize=require(_0x8872('0x0'));module[_0x8872('0x1')]={'name':{'type':Sequelize[_0x8872('0x2')]},'description':{'type':Sequelize[_0x8872('0x2')]},'username':{'type':Sequelize[_0x8872('0x2')],'unique':_0x8872('0x3')},'password':{'type':Sequelize[_0x8872('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x8872('0x4')},'serverUrl':{'type':Sequelize[_0x8872('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x796a=['remoteUri','sequelize','STRING','username'];(function(_0x4e2111,_0x1d5493){var _0x1b4556=function(_0x2bd9ee){while(--_0x2bd9ee){_0x4e2111['push'](_0x4e2111['shift']());}};_0x1b4556(++_0x1d5493);}(_0x796a,0xf5));var _0xa796=function(_0x65959d,_0x4dd888){_0x65959d=_0x65959d-0x0;var _0x2d71aa=_0x796a[_0x65959d];return _0x2d71aa;};'use strict';var Sequelize=require(_0xa796('0x0'));module['exports']={'name':{'type':Sequelize[_0xa796('0x1')]},'description':{'type':Sequelize[_0xa796('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0xa796('0x2')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xa796('0x1')],'unique':_0xa796('0x3')},'serverUrl':{'type':Sequelize[_0xa796('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 7545851..e0a3cbe 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 _0x992a=['findOne','rawAttributes','length','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowConfiguration','ServicenowField','made_sla','hold_reason','notify','incident_state','severity','category','parent','caused_by','upon_reject','sys_updated_on','child_incidents','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','sys_created_by','knowledge','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','business_service','sys_domain_path','time_worked','expected_start','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','subcategory','work_notes','short_description','close_code','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','close_notes','follow_up','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','email','remoteUri','serverUrl','slice','lastIndexOf','format','%s/api/now/doc/table/schema/','username','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','forEach','internalType','label','push','all','TCL:\x20_object','concat','ServiceNow\x20error:\x20','test','statusCode','send','boolean','True','False','false','inactive','value','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','end','error','stack','name','map','ServicenowAccount','type','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','filter','options','includeAll','rows','catch','params','keys','include','find','create','body','destroy','getConfigurations'];(function(_0x54bfa9,_0x424d55){var _0x160e13=function(_0xc77cb8){while(--_0xc77cb8){_0x54bfa9['push'](_0x54bfa9['shift']());}};_0x160e13(++_0x424d55);}(_0x992a,0x6f));var _0xa992=function(_0x236d24,_0x29e80a){_0x236d24=_0x236d24-0x0;var _0x1574cf=_0x992a[_0x236d24];return _0x1574cf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa992('0x0'));var zipdir=require(_0xa992('0x1'));var jsonpatch=require(_0xa992('0x2'));var rp=require('request-promise');var moment=require(_0xa992('0x3'));var BPromise=require(_0xa992('0x4'));var Mustache=require(_0xa992('0x5'));var util=require('util');var path=require(_0xa992('0x6'));var sox=require(_0xa992('0x7'));var csv=require(_0xa992('0x8'));var ejs=require(_0xa992('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa992('0xa'));var squel=require(_0xa992('0xb'));var crypto=require(_0xa992('0xc'));var jsforce=require(_0xa992('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa992('0xe'));var Papa=require(_0xa992('0xf'));var Redis=require(_0xa992('0x10'));var authService=require(_0xa992('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xa992('0x12'));var hardwareService=require(_0xa992('0x13'));var logger=require(_0xa992('0x14'))(_0xa992('0x15'));var utils=require('../../config/utils');var config=require(_0xa992('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xa992('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5e8332,_0x21060d){_0x21060d=_0x21060d||0xcc;return function(_0x115a4c){if(_0x115a4c){return _0x5e8332[_0xa992('0x18')](_0x21060d);}return _0x5e8332[_0xa992('0x19')](_0x21060d)['end']();};}function respondWithResult(_0x4aa97c,_0x4ca29d){_0x4ca29d=_0x4ca29d||0xc8;return function(_0x2ccd3f){if(_0x2ccd3f){return _0x4aa97c['status'](_0x4ca29d)['json'](_0x2ccd3f);}};}function respondWithFilteredResult(_0x3f23ee,_0x3f48fb){return function(_0x7e45ec){if(_0x7e45ec){var _0x441fad=typeof _0x3f48fb[_0xa992('0x1a')]===_0xa992('0x1b')&&typeof _0x3f48fb[_0xa992('0x1c')]===_0xa992('0x1b');var _0x3beeea=_0x7e45ec[_0xa992('0x1d')];var _0xd0506e=_0x441fad?0x0:_0x3f48fb[_0xa992('0x1a')];var _0x34757c=_0x441fad?_0x7e45ec[_0xa992('0x1d')]:_0x3f48fb[_0xa992('0x1a')]+_0x3f48fb[_0xa992('0x1c')];var _0x12bc90;if(_0x34757c>=_0x3beeea){_0x34757c=_0x3beeea;_0x12bc90=0xc8;}else{_0x12bc90=0xce;}_0x3f23ee[_0xa992('0x19')](_0x12bc90);return _0x3f23ee[_0xa992('0x1e')](_0xa992('0x1f'),_0xd0506e+'-'+_0x34757c+'/'+_0x3beeea)[_0xa992('0x20')](_0x7e45ec);}return null;};}function patchUpdates(_0x8d3cf5){return function(_0xbb3217){try{jsonpatch[_0xa992('0x21')](_0xbb3217,_0x8d3cf5,!![]);}catch(_0x147897){return BPromise[_0xa992('0x22')](_0x147897);}return _0xbb3217[_0xa992('0x23')]();};}function saveUpdates(_0x1a33b5,_0x3e12ee){return function(_0x334482){if(_0x334482){return _0x334482[_0xa992('0x24')](_0x1a33b5)[_0xa992('0x25')](function(_0x564a95){return _0x564a95;});}return null;};}function removeEntity(_0x21ad31,_0x5a9ddd){return function(_0x1cd394){if(_0x1cd394){return _0x1cd394['destroy']()[_0xa992('0x25')](function(){_0x21ad31[_0xa992('0x19')](0xcc)[_0xa992('0x26')]();});}};}function handleEntityNotFound(_0x5c424c,_0x58f862){return function(_0x220831){if(!_0x220831){_0x5c424c[_0xa992('0x18')](0x194);}return _0x220831;};}function handleError(_0x4a328a,_0x35020c){_0x35020c=_0x35020c||0x1f4;return function(_0x39866b){logger[_0xa992('0x27')](_0x39866b[_0xa992('0x28')]);if(_0x39866b[_0xa992('0x29')]){delete _0x39866b['name'];}_0x4a328a[_0xa992('0x19')](_0x35020c)['send'](_0x39866b);};}exports['index']=function(_0x3a48db,_0x588c4e){var _0xecb0ba={},_0x467cb2={},_0x1a85fb={'count':0x0,'rows':[]};var _0x4f1263=_[_0xa992('0x2a')](db[_0xa992('0x2b')]['rawAttributes'],function(_0x21d5d8){return{'name':_0x21d5d8['fieldName'],'type':_0x21d5d8[_0xa992('0x2c')]['key']};});_0x467cb2[_0xa992('0x2d')]=_[_0xa992('0x2a')](_0x4f1263,_0xa992('0x29'));_0x467cb2[_0xa992('0x2e')]=_['keys'](_0x3a48db['query']);_0x467cb2['filters']=_[_0xa992('0x2f')](_0x467cb2[_0xa992('0x2d')],_0x467cb2['query']);_0xecb0ba['attributes']=_['intersection'](_0x467cb2[_0xa992('0x2d')],qs[_0xa992('0x30')](_0x3a48db[_0xa992('0x2e')][_0xa992('0x30')]));_0xecb0ba[_0xa992('0x31')]=_0xecb0ba[_0xa992('0x31')]['length']?_0xecb0ba[_0xa992('0x31')]:_0x467cb2['model'];if(!_0x3a48db[_0xa992('0x2e')][_0xa992('0x32')](_0xa992('0x33'))){_0xecb0ba['limit']=qs[_0xa992('0x1c')](_0x3a48db['query'][_0xa992('0x1c')]);_0xecb0ba['offset']=qs[_0xa992('0x1a')](_0x3a48db['query'][_0xa992('0x1a')]);}_0xecb0ba[_0xa992('0x34')]=qs['sort'](_0x3a48db[_0xa992('0x2e')][_0xa992('0x35')]);_0xecb0ba[_0xa992('0x36')]=qs[_0xa992('0x37')](_[_0xa992('0x38')](_0x3a48db['query'],_0x467cb2[_0xa992('0x37')]),_0x4f1263);if(_0x3a48db[_0xa992('0x2e')]['filter']){_0xecb0ba[_0xa992('0x36')]=_[_0xa992('0x39')](_0xecb0ba[_0xa992('0x36')],{'$or':_[_0xa992('0x2a')](_0x4f1263,function(_0xe2109){if(_0xe2109[_0xa992('0x2c')]!=='VIRTUAL'){var _0x1b9cf1={};_0x1b9cf1[_0xe2109['name']]={'$like':'%'+_0x3a48db[_0xa992('0x2e')][_0xa992('0x3a')]+'%'};return _0x1b9cf1;}})});}_0xecb0ba=_[_0xa992('0x39')]({},_0xecb0ba,_0x3a48db[_0xa992('0x3b')]);var _0x5565ef={'where':_0xecb0ba[_0xa992('0x36')]};return db['ServicenowAccount'][_0xa992('0x1d')](_0x5565ef)[_0xa992('0x25')](function(_0x4c2acd){_0x1a85fb[_0xa992('0x1d')]=_0x4c2acd;if(_0x3a48db[_0xa992('0x2e')][_0xa992('0x3c')]){_0xecb0ba['include']=[{'all':!![]}];}return db[_0xa992('0x2b')]['findAll'](_0xecb0ba);})['then'](function(_0x27838d){_0x1a85fb[_0xa992('0x3d')]=_0x27838d;return _0x1a85fb;})['then'](respondWithFilteredResult(_0x588c4e,_0xecb0ba))[_0xa992('0x3e')](handleError(_0x588c4e,null));};exports['show']=function(_0x5de471,_0xa76609){var _0x436793={'raw':![],'where':{'id':_0x5de471[_0xa992('0x3f')]['id']}},_0x51bfa9={};_0x51bfa9[_0xa992('0x2d')]=_['keys'](db['ServicenowAccount']['rawAttributes']);_0x51bfa9[_0xa992('0x2e')]=_[_0xa992('0x40')](_0x5de471[_0xa992('0x2e')]);_0x51bfa9[_0xa992('0x37')]=_['intersection'](_0x51bfa9['model'],_0x51bfa9[_0xa992('0x2e')]);_0x436793['attributes']=_[_0xa992('0x2f')](_0x51bfa9['model'],qs[_0xa992('0x30')](_0x5de471[_0xa992('0x2e')][_0xa992('0x30')]));_0x436793[_0xa992('0x31')]=_0x436793[_0xa992('0x31')]['length']?_0x436793[_0xa992('0x31')]:_0x51bfa9[_0xa992('0x2d')];if(_0x5de471[_0xa992('0x2e')]['includeAll']){_0x436793[_0xa992('0x41')]=[{'all':!![]}];}_0x436793=_[_0xa992('0x39')]({},_0x436793,_0x5de471[_0xa992('0x3b')]);return db[_0xa992('0x2b')][_0xa992('0x42')](_0x436793)[_0xa992('0x25')](handleEntityNotFound(_0xa76609,null))['then'](respondWithResult(_0xa76609,null))[_0xa992('0x3e')](handleError(_0xa76609,null));};exports[_0xa992('0x43')]=function(_0x4661b3,_0x436ff5){return db[_0xa992('0x2b')][_0xa992('0x43')](_0x4661b3['body'],{})['then'](respondWithResult(_0x436ff5,0xc9))['catch'](handleError(_0x436ff5,null));};exports[_0xa992('0x24')]=function(_0x124ca1,_0xad8c2f){if(_0x124ca1['body']['id']){delete _0x124ca1[_0xa992('0x44')]['id'];}return db[_0xa992('0x2b')]['find']({'where':{'id':_0x124ca1[_0xa992('0x3f')]['id']}})[_0xa992('0x25')](handleEntityNotFound(_0xad8c2f,null))[_0xa992('0x25')](saveUpdates(_0x124ca1[_0xa992('0x44')],null))['then'](respondWithResult(_0xad8c2f,null))['catch'](handleError(_0xad8c2f,null));};exports[_0xa992('0x45')]=function(_0x568eb6,_0x3c8021){return db[_0xa992('0x2b')][_0xa992('0x42')]({'where':{'id':_0x568eb6['params']['id']}})['then'](handleEntityNotFound(_0x3c8021,null))['then'](removeEntity(_0x3c8021,null))[_0xa992('0x3e')](handleError(_0x3c8021,null));};exports[_0xa992('0x46')]=function(_0x174344,_0x4bc798,_0x34635b){var _0x1002c8={};var _0x269791={};var _0x2524a2;var _0x2ec459;return db[_0xa992('0x2b')][_0xa992('0x47')]({'where':{'id':_0x174344[_0xa992('0x3f')]['id']}})[_0xa992('0x25')](handleEntityNotFound(_0x4bc798,null))[_0xa992('0x25')](function(_0x2388a6){if(_0x2388a6){_0x2524a2=_0x2388a6;_0x269791[_0xa992('0x2d')]=_[_0xa992('0x40')](db['ServicenowConfiguration'][_0xa992('0x48')]);_0x269791['query']=_['keys'](_0x174344[_0xa992('0x2e')]);_0x269791[_0xa992('0x37')]=_[_0xa992('0x2f')](_0x269791[_0xa992('0x2d')],_0x269791[_0xa992('0x2e')]);_0x1002c8[_0xa992('0x31')]=_[_0xa992('0x2f')](_0x269791[_0xa992('0x2d')],qs['fields'](_0x174344['query'][_0xa992('0x30')]));_0x1002c8[_0xa992('0x31')]=_0x1002c8[_0xa992('0x31')][_0xa992('0x49')]?_0x1002c8['attributes']:_0x269791[_0xa992('0x2d')];_0x1002c8[_0xa992('0x34')]=qs[_0xa992('0x35')](_0x174344[_0xa992('0x2e')][_0xa992('0x35')]);_0x1002c8[_0xa992('0x36')]=qs[_0xa992('0x37')](_[_0xa992('0x38')](_0x174344[_0xa992('0x2e')],_0x269791['filters']));if(_0x174344['query'][_0xa992('0x3a')]){_0x1002c8['where']=_[_0xa992('0x39')](_0x1002c8['where'],{'$or':_[_0xa992('0x2a')](_0x1002c8[_0xa992('0x31')],function(_0x1dc048){var _0x2396fa={};_0x2396fa[_0x1dc048]={'$like':'%'+_0x174344[_0xa992('0x2e')][_0xa992('0x3a')]+'%'};return _0x2396fa;})});}_0x1002c8=_[_0xa992('0x39')]({},_0x1002c8,_0x174344[_0xa992('0x3b')]);return _0x2524a2[_0xa992('0x46')](_0x1002c8);}})[_0xa992('0x25')](function(_0x340426){if(_0x340426){_0x2ec459=_0x340426[_0xa992('0x49')];if(!_0x174344[_0xa992('0x2e')][_0xa992('0x32')](_0xa992('0x33'))){_0x1002c8[_0xa992('0x1c')]=qs['limit'](_0x174344['query']['limit']);_0x1002c8['offset']=qs[_0xa992('0x1a')](_0x174344[_0xa992('0x2e')][_0xa992('0x1a')]);}return _0x2524a2[_0xa992('0x46')](_0x1002c8);}})['then'](function(_0x45ce25){if(_0x45ce25){return _0x45ce25?{'count':_0x2ec459,'rows':_0x45ce25}:null;}})['then'](respondWithResult(_0x4bc798,null))[_0xa992('0x3e')](handleError(_0x4bc798,null));};exports[_0xa992('0x4a')]=function(_0x13ebc7,_0x2f6f44,_0x5c1037){if(_0x13ebc7[_0xa992('0x44')]['id']){delete _0x13ebc7[_0xa992('0x44')]['id'];}return db[_0xa992('0x2b')][_0xa992('0x47')]({'where':{'id':_0x13ebc7[_0xa992('0x3f')]['id']}})['then'](handleEntityNotFound(_0x2f6f44,null))['then'](function(_0x304253){if(_0x304253){_0x13ebc7[_0xa992('0x44')]['AccountId']=_0x304253['id'];_0x13ebc7[_0xa992('0x44')][_0xa992('0x4b')]=integrations[_0xa992('0x4c')](_0x13ebc7[_0xa992('0x44')][_0xa992('0x4d')],_0x13ebc7[_0xa992('0x44')][_0xa992('0x2c')]);_0x13ebc7['body'][_0xa992('0x4e')]=integrations[_0xa992('0x4f')](_0x13ebc7[_0xa992('0x44')][_0xa992('0x4d')],_0x13ebc7[_0xa992('0x44')][_0xa992('0x2c')]);return db[_0xa992('0x50')]['create'](_0x13ebc7[_0xa992('0x44')],{'include':[{'model':db[_0xa992('0x51')],'as':_0xa992('0x4b')},{'model':db[_0xa992('0x51')],'as':_0xa992('0x4e')}]});}return null;})[_0xa992('0x25')](respondWithResult(_0x2f6f44,null))[_0xa992('0x3e')](handleError(_0x2f6f44,null));};exports['getFields']=function(_0x556d6a,_0xdb6330,_0x59df86){var _0xce1f62=[_0xa992('0x52'),_0xa992('0x53'),'knowledge','subcategory','close_code',_0xa992('0x54'),_0xa992('0x55'),_0xa992('0x56'),_0xa992('0x57')];var _0x2e1425=[_0xa992('0x58'),_0xa992('0x52'),_0xa992('0x59'),'watch_list',_0xa992('0x5a'),_0xa992('0x5b'),_0xa992('0x5c'),'hold_reason','approval_history',_0xa992('0x5d'),_0xa992('0x5e'),_0xa992('0x5f'),_0xa992('0x60'),_0xa992('0x61'),_0xa992('0x62'),_0xa992('0x63'),'state',_0xa992('0x64'),_0xa992('0x65'),_0xa992('0x34'),_0xa992('0x66'),_0xa992('0x67'),_0xa992('0x68'),_0xa992('0x69'),_0xa992('0x6a'),'active','work_notes_list',_0xa992('0x6b'),'priority',_0xa992('0x6c'),'rfc',_0xa992('0x6d'),_0xa992('0x6e'),'opened_at',_0xa992('0x6f'),_0xa992('0x70'),_0xa992('0x71'),_0xa992('0x72'),_0xa992('0x73'),_0xa992('0x74'),_0xa992('0x75'),_0xa992('0x76'),_0xa992('0x77'),_0xa992('0x78'),_0xa992('0x79'),'correlation_display','delivery_task',_0xa992('0x7a'),_0xa992('0x7b'),_0xa992('0x7c'),_0xa992('0x7d'),_0xa992('0x7e'),_0xa992('0x7f'),_0xa992('0x54'),'sys_class_name',_0xa992('0x80'),'closed_by',_0xa992('0x81'),_0xa992('0x82'),_0xa992('0x83'),_0xa992('0x84'),_0xa992('0x85'),'incident_state',_0xa992('0x86'),_0xa992('0x87'),_0xa992('0x88'),_0xa992('0x89'),_0xa992('0x8a'),_0xa992('0x8b'),_0xa992('0x56'),_0xa992('0x8c'),_0xa992('0x8d'),_0xa992('0x8e'),_0xa992('0x8f'),'due_date','sys_mod_count',_0xa992('0x90'),_0xa992('0x91'),_0xa992('0x92'),_0xa992('0x93'),_0xa992('0x94'),_0xa992('0x95'),_0xa992('0x57')];var _0x507483='';var _0x5ac9eb='';var _0x254b66=[];var _0x3ec1de='';var _0x1f88f6='';var _0x4d03e9=[];var _0x11484a='';var _0x440913='';var _0x1d7a29={};var _0x3d1e3e='';return db[_0xa992('0x2b')][_0xa992('0x47')]({'where':{'id':_0x556d6a[_0xa992('0x3f')]['id']},'attributes':['id','username','password',_0xa992('0x96'),_0xa992('0x97'),_0xa992('0x98')]})[_0xa992('0x25')](handleEntityNotFound(_0xdb6330,null))[_0xa992('0x25')](function(_0xf5eae2){if(_0xf5eae2){_0x3d1e3e=_0xf5eae2['remoteUri'];var _0x2bbf3c=_0x3d1e3e[_0xa992('0x99')](-0x1);if(_0x2bbf3c==='/'){_0x3d1e3e=_0x3d1e3e['substring'](0x0,_0x3d1e3e[_0xa992('0x9a')](_0x2bbf3c));}_0x440913=util[_0xa992('0x9b')](_0xa992('0x9c'),_0x3d1e3e);_0x11484a=util[_0xa992('0x9b')]('%s/api/now/table/',_0x3d1e3e);_0x1d7a29={'user':_0xf5eae2[_0xa992('0x9d')],'pass':_0xf5eae2['password']};var _0x3cc4ae={'method':_0xa992('0x9e'),'uri':_0x440913+_0xa992('0x9f'),'auth':_0x1d7a29,'json':!![]};return rp(_0x3cc4ae);}})['then'](function(_0x1340c3){if(_0x1340c3[_0xa992('0xa0')][_0xa992('0x49')]>0x0){_0x507483=_0x1340c3[_0xa992('0xa0')];}console[_0xa992('0xa1')](_0xa992('0xa2'),_0x507483);_0x4d03e9=[];_0x5ac9eb=Object[_0xa992('0xa3')]([],_0x507483);_[_0xa992('0xa4')](_0x5ac9eb,function(_0x3259ca){return!_0xce1f62['includes'](_0x3259ca[_0xa992('0x29')]);});_0x5ac9eb[_0xa992('0xa5')](function(_0x10b65a){var _0x3dbdc0=createFieldObject(_0x11484a,_0x1d7a29,_0x10b65a[_0xa992('0xa6')],_0x10b65a[_0xa992('0x29')],_0x10b65a[_0xa992('0xa7')],![]);_0x4d03e9[_0xa992('0xa8')](_0x3dbdc0);});return Promise[_0xa992('0xa9')](_0x4d03e9);})[_0xa992('0x25')](function(_0x3a7366){_0x254b66=_0x3a7366;_0x3ec1de=Object['assign']([],_0x507483);console['log'](_0xa992('0xaa'),_0x507483);_[_0xa992('0xa4')](_0x3ec1de,function(_0x603029){return _0x2e1425['includes'](_0x603029[_0xa992('0x29')]);});console[_0xa992('0xa1')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x3ec1de);_0x4d03e9=[];_0x3ec1de[_0xa992('0xa5')](function(_0x5178c5){var _0x139a2a=createFieldObject(_0x11484a,_0x1d7a29,_0x5178c5[_0xa992('0xa6')],_0x5178c5['name'],_0x5178c5[_0xa992('0xa7')],!![]);_0x4d03e9[_0xa992('0xa8')](_0x139a2a);});return Promise[_0xa992('0xa9')](_0x4d03e9);})[_0xa992('0x25')](function(_0x3faf4b){_0x1f88f6=_0x3faf4b;var _0x528d0e=_0x254b66[_0xa992('0xab')](_0x1f88f6);return{'count':_0x528d0e[_0xa992('0x49')],'rows':_0x528d0e};})['then'](respondWithResult(_0xdb6330,null))[_0xa992('0x3e')](function(_0x4e440a){console[_0xa992('0xa1')](_0xa992('0xac')+_0x4e440a);var _0x4ee07f=_0x556d6a[_0xa992('0x2e')][_0xa992('0xad')]?0x1f4:_0x4e440a[_0xa992('0xae')]||0x1f4;logger[_0xa992('0x27')](_0x4e440a[_0xa992('0x28')]);delete _0x4e440a['name'];if(_0x4ee07f===0x191){_0x4ee07f=0x190;}_0xdb6330['status'](_0x4ee07f)[_0xa992('0xaf')](_0x556d6a[_0xa992('0x2e')][_0xa992('0xad')]?{'message':'Wrong\x20credentials','statusCode':_0x4e440a['statusCode']}:_0x4e440a);});};function createFieldObject(_0x546201,_0x3fb132,_0x4b88e2,_0x470c0c,_0x16fea5,_0x26fd1f){return new Promise(function(_0x567ad3,_0x384431){var _0x5bdda7={'id':_0x470c0c,'name':_0x16fea5,'custom':_0x26fd1f};if(_0x4b88e2===_0xa992('0xb0')){_0x5bdda7[_0xa992('0x3b')]=[{'name':_0xa992('0xb1'),'value':'true'},{'name':_0xa992('0xb2'),'value':_0xa992('0xb3')}];_0x567ad3(_0x5bdda7);}else{var _0x2cd31a={'method':_0xa992('0x9e'),'uri':_0x546201+'sys_choice?sysparm_query=name=incident^element='+_0x470c0c,'auth':_0x3fb132,'json':!![]};return rp(_0x2cd31a)[_0xa992('0x25')](function(_0x4788ed){var _0x5c7c3b=[];if(_0x4788ed[_0xa992('0xa0')][_0xa992('0x49')]>0x0){_0x4788ed['result'][_0xa992('0xa5')](function(_0x532bc5){if(_0x532bc5[_0xa992('0xb4')]===_0xa992('0xb3')){var _0x1d4dab={'name':_0x532bc5[_0xa992('0xa7')],'value':_0x532bc5[_0xa992('0xb5')]};_0x5c7c3b[_0xa992('0xa8')](_0x1d4dab);}});}_0x5bdda7[_0xa992('0x3b')]=_0x5c7c3b;if(_0x5bdda7[_0xa992('0x3b')][_0xa992('0x49')]>0x0){_0x567ad3(_0x5bdda7);}else{if(_0x26fd1f==![]){_0x567ad3();}else{_0x567ad3(_0x5bdda7);}}});}});} \ No newline at end of file +var _0x547c=['password','email','remoteUri','serverUrl','slice','substring','format','GET','incident?sysparm_display_value=all','result','log','assign','includes','internalType','label','push','all','TCL:\x20_object','remove','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','concat','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','status','sendStatus','error','stack','send','index','map','ServicenowAccount','fieldName','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','find','create','body','getConfigurations','nolimit','AccountId','Subjects','channel','Descriptions','getDescriptions','type','ServicenowConfiguration','ServicenowField','getFields','knowledge','subcategory','close_code','incident_state','severity','made_sla','caused_by','upon_reject','sys_updated_on','child_incidents','approval_history','opened_by','user_input','sys_domain','sys_created_by','calendar_stc','closed_at','delivery_plan','impact','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list','work_end','resolved_at','caller_id','work_notes','short_description','correlation_display','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','notify','sys_class_name','close_notes','closed_by','follow_up','parent_incident','contact_type','problem_id','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','sys_mod_count','sys_tags','escalation','upon_approval','correlation_id','location','category','findOne','username'];(function(_0x4bb48e,_0x42d15d){var _0xcaec94=function(_0x2b6ca1){while(--_0x2b6ca1){_0x4bb48e['push'](_0x4bb48e['shift']());}};_0xcaec94(++_0x42d15d);}(_0x547c,0x198));var _0xc547=function(_0x731327,_0x5e62ea){_0x731327=_0x731327-0x0;var _0x5e1ff0=_0x547c[_0x731327];return _0x5e1ff0;};'use strict';var emlformat=require(_0xc547('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc547('0x1'));var rp=require(_0xc547('0x2'));var moment=require(_0xc547('0x3'));var BPromise=require(_0xc547('0x4'));var Mustache=require(_0xc547('0x5'));var util=require('util');var path=require(_0xc547('0x6'));var sox=require(_0xc547('0x7'));var csv=require(_0xc547('0x8'));var ejs=require(_0xc547('0x9'));var fs=require('fs');var fs_extra=require(_0xc547('0xa'));var _=require(_0xc547('0xb'));var squel=require(_0xc547('0xc'));var crypto=require('crypto');var jsforce=require(_0xc547('0xd'));var deskjs=require(_0xc547('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc547('0xf'));var Papa=require(_0xc547('0x10'));var Redis=require(_0xc547('0x11'));var authService=require(_0xc547('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc547('0x13'));var logger=require(_0xc547('0x14'))(_0xc547('0x15'));var utils=require(_0xc547('0x16'));var config=require(_0xc547('0x17'));var licenseUtil=require(_0xc547('0x18'));var db=require(_0xc547('0x19'))['db'];var integrations=require(_0xc547('0x1a'));function respondWithStatusCode(_0x4ed4c5,_0xc1dda4){_0xc1dda4=_0xc1dda4||0xcc;return function(_0x403d4f){if(_0x403d4f){return _0x4ed4c5['sendStatus'](_0xc1dda4);}return _0x4ed4c5['status'](_0xc1dda4)[_0xc547('0x1b')]();};}function respondWithResult(_0x226c7d,_0x29bd30){_0x29bd30=_0x29bd30||0xc8;return function(_0x4acdc3){if(_0x4acdc3){return _0x226c7d['status'](_0x29bd30)['json'](_0x4acdc3);}};}function respondWithFilteredResult(_0x2900f8,_0x598c42){return function(_0x1b94d0){if(_0x1b94d0){var _0x369f47=typeof _0x598c42['offset']===_0xc547('0x1c')&&typeof _0x598c42[_0xc547('0x1d')]===_0xc547('0x1c');var _0x563d46=_0x1b94d0[_0xc547('0x1e')];var _0x2183a8=_0x369f47?0x0:_0x598c42[_0xc547('0x1f')];var _0xad8a03=_0x369f47?_0x1b94d0[_0xc547('0x1e')]:_0x598c42[_0xc547('0x1f')]+_0x598c42[_0xc547('0x1d')];var _0x5dd703;if(_0xad8a03>=_0x563d46){_0xad8a03=_0x563d46;_0x5dd703=0xc8;}else{_0x5dd703=0xce;}_0x2900f8['status'](_0x5dd703);return _0x2900f8[_0xc547('0x20')](_0xc547('0x21'),_0x2183a8+'-'+_0xad8a03+'/'+_0x563d46)[_0xc547('0x22')](_0x1b94d0);}return null;};}function patchUpdates(_0x52ba84){return function(_0x574cda){try{jsonpatch[_0xc547('0x23')](_0x574cda,_0x52ba84,!![]);}catch(_0x5659d6){return BPromise[_0xc547('0x24')](_0x5659d6);}return _0x574cda[_0xc547('0x25')]();};}function saveUpdates(_0x514aad,_0x55f0a5){return function(_0x4fd0b2){if(_0x4fd0b2){return _0x4fd0b2[_0xc547('0x26')](_0x514aad)[_0xc547('0x27')](function(_0x5b9b7f){return _0x5b9b7f;});}return null;};}function removeEntity(_0x4bc4b3,_0x2f4226){return function(_0x30cc0c){if(_0x30cc0c){return _0x30cc0c[_0xc547('0x28')]()['then'](function(){_0x4bc4b3[_0xc547('0x29')](0xcc)[_0xc547('0x1b')]();});}};}function handleEntityNotFound(_0x355241,_0xdb2714){return function(_0x33de13){if(!_0x33de13){_0x355241[_0xc547('0x2a')](0x194);}return _0x33de13;};}function handleError(_0x34743b,_0x3a54d6){_0x3a54d6=_0x3a54d6||0x1f4;return function(_0x2a50a1){logger[_0xc547('0x2b')](_0x2a50a1[_0xc547('0x2c')]);if(_0x2a50a1['name']){delete _0x2a50a1['name'];}_0x34743b[_0xc547('0x29')](_0x3a54d6)[_0xc547('0x2d')](_0x2a50a1);};}exports[_0xc547('0x2e')]=function(_0x2ac5d9,_0x2f091a){var _0x1cf4e7={},_0x165c60={},_0x1ec205={'count':0x0,'rows':[]};var _0x3b8e18=_[_0xc547('0x2f')](db[_0xc547('0x30')]['rawAttributes'],function(_0x22430e){return{'name':_0x22430e[_0xc547('0x31')],'type':_0x22430e['type'][_0xc547('0x32')]};});_0x165c60[_0xc547('0x33')]=_[_0xc547('0x2f')](_0x3b8e18,_0xc547('0x34'));_0x165c60[_0xc547('0x35')]=_['keys'](_0x2ac5d9[_0xc547('0x35')]);_0x165c60[_0xc547('0x36')]=_[_0xc547('0x37')](_0x165c60[_0xc547('0x33')],_0x165c60[_0xc547('0x35')]);_0x1cf4e7[_0xc547('0x38')]=_[_0xc547('0x37')](_0x165c60[_0xc547('0x33')],qs[_0xc547('0x39')](_0x2ac5d9['query'][_0xc547('0x39')]));_0x1cf4e7[_0xc547('0x38')]=_0x1cf4e7['attributes'][_0xc547('0x3a')]?_0x1cf4e7[_0xc547('0x38')]:_0x165c60['model'];if(!_0x2ac5d9[_0xc547('0x35')][_0xc547('0x3b')]('nolimit')){_0x1cf4e7[_0xc547('0x1d')]=qs[_0xc547('0x1d')](_0x2ac5d9[_0xc547('0x35')][_0xc547('0x1d')]);_0x1cf4e7[_0xc547('0x1f')]=qs[_0xc547('0x1f')](_0x2ac5d9[_0xc547('0x35')]['offset']);}_0x1cf4e7[_0xc547('0x3c')]=qs[_0xc547('0x3d')](_0x2ac5d9['query'][_0xc547('0x3d')]);_0x1cf4e7[_0xc547('0x3e')]=qs['filters'](_[_0xc547('0x3f')](_0x2ac5d9[_0xc547('0x35')],_0x165c60[_0xc547('0x36')]),_0x3b8e18);if(_0x2ac5d9['query'][_0xc547('0x40')]){_0x1cf4e7[_0xc547('0x3e')]=_[_0xc547('0x41')](_0x1cf4e7[_0xc547('0x3e')],{'$or':_['map'](_0x3b8e18,function(_0x5c1d6b){if(_0x5c1d6b['type']!==_0xc547('0x42')){var _0x19cb87={};_0x19cb87[_0x5c1d6b[_0xc547('0x34')]]={'$like':'%'+_0x2ac5d9['query']['filter']+'%'};return _0x19cb87;}})});}_0x1cf4e7=_[_0xc547('0x41')]({},_0x1cf4e7,_0x2ac5d9[_0xc547('0x43')]);var _0x2d3384={'where':_0x1cf4e7['where']};return db['ServicenowAccount']['count'](_0x2d3384)[_0xc547('0x27')](function(_0x4e75f3){_0x1ec205['count']=_0x4e75f3;if(_0x2ac5d9[_0xc547('0x35')][_0xc547('0x44')]){_0x1cf4e7[_0xc547('0x45')]=[{'all':!![]}];}return db[_0xc547('0x30')][_0xc547('0x46')](_0x1cf4e7);})['then'](function(_0x2064ae){_0x1ec205[_0xc547('0x47')]=_0x2064ae;return _0x1ec205;})[_0xc547('0x27')](respondWithFilteredResult(_0x2f091a,_0x1cf4e7))[_0xc547('0x48')](handleError(_0x2f091a,null));};exports['show']=function(_0x4d971e,_0x1e0be9){var _0x222aab={'raw':![],'where':{'id':_0x4d971e[_0xc547('0x49')]['id']}},_0x35b462={};_0x35b462[_0xc547('0x33')]=_[_0xc547('0x4a')](db['ServicenowAccount'][_0xc547('0x4b')]);_0x35b462[_0xc547('0x35')]=_[_0xc547('0x4a')](_0x4d971e['query']);_0x35b462[_0xc547('0x36')]=_['intersection'](_0x35b462[_0xc547('0x33')],_0x35b462[_0xc547('0x35')]);_0x222aab[_0xc547('0x38')]=_[_0xc547('0x37')](_0x35b462[_0xc547('0x33')],qs[_0xc547('0x39')](_0x4d971e[_0xc547('0x35')][_0xc547('0x39')]));_0x222aab[_0xc547('0x38')]=_0x222aab[_0xc547('0x38')][_0xc547('0x3a')]?_0x222aab['attributes']:_0x35b462[_0xc547('0x33')];if(_0x4d971e['query'][_0xc547('0x44')]){_0x222aab[_0xc547('0x45')]=[{'all':!![]}];}_0x222aab=_[_0xc547('0x41')]({},_0x222aab,_0x4d971e[_0xc547('0x43')]);return db[_0xc547('0x30')][_0xc547('0x4c')](_0x222aab)[_0xc547('0x27')](handleEntityNotFound(_0x1e0be9,null))[_0xc547('0x27')](respondWithResult(_0x1e0be9,null))[_0xc547('0x48')](handleError(_0x1e0be9,null));};exports[_0xc547('0x4d')]=function(_0x443c94,_0x217dc8){return db['ServicenowAccount']['create'](_0x443c94[_0xc547('0x4e')],{})[_0xc547('0x27')](respondWithResult(_0x217dc8,0xc9))[_0xc547('0x48')](handleError(_0x217dc8,null));};exports[_0xc547('0x26')]=function(_0x388b25,_0x28f63c){if(_0x388b25[_0xc547('0x4e')]['id']){delete _0x388b25[_0xc547('0x4e')]['id'];}return db[_0xc547('0x30')][_0xc547('0x4c')]({'where':{'id':_0x388b25['params']['id']}})['then'](handleEntityNotFound(_0x28f63c,null))[_0xc547('0x27')](saveUpdates(_0x388b25[_0xc547('0x4e')],null))['then'](respondWithResult(_0x28f63c,null))['catch'](handleError(_0x28f63c,null));};exports[_0xc547('0x28')]=function(_0x55382a,_0x5bdac5){return db['ServicenowAccount'][_0xc547('0x4c')]({'where':{'id':_0x55382a[_0xc547('0x49')]['id']}})[_0xc547('0x27')](handleEntityNotFound(_0x5bdac5,null))[_0xc547('0x27')](removeEntity(_0x5bdac5,null))[_0xc547('0x48')](handleError(_0x5bdac5,null));};exports['getConfigurations']=function(_0x1f13da,_0x3a5b2c,_0x51526f){var _0x4cf6de={};var _0x1cf26a={};var _0x30a6ac;var _0x4d7969;return db[_0xc547('0x30')]['findOne']({'where':{'id':_0x1f13da[_0xc547('0x49')]['id']}})[_0xc547('0x27')](handleEntityNotFound(_0x3a5b2c,null))[_0xc547('0x27')](function(_0x575ac0){if(_0x575ac0){_0x30a6ac=_0x575ac0;_0x1cf26a[_0xc547('0x33')]=_[_0xc547('0x4a')](db['ServicenowConfiguration']['rawAttributes']);_0x1cf26a[_0xc547('0x35')]=_['keys'](_0x1f13da['query']);_0x1cf26a[_0xc547('0x36')]=_['intersection'](_0x1cf26a[_0xc547('0x33')],_0x1cf26a[_0xc547('0x35')]);_0x4cf6de[_0xc547('0x38')]=_[_0xc547('0x37')](_0x1cf26a['model'],qs['fields'](_0x1f13da[_0xc547('0x35')]['fields']));_0x4cf6de[_0xc547('0x38')]=_0x4cf6de[_0xc547('0x38')][_0xc547('0x3a')]?_0x4cf6de[_0xc547('0x38')]:_0x1cf26a['model'];_0x4cf6de[_0xc547('0x3c')]=qs[_0xc547('0x3d')](_0x1f13da['query'][_0xc547('0x3d')]);_0x4cf6de[_0xc547('0x3e')]=qs[_0xc547('0x36')](_[_0xc547('0x3f')](_0x1f13da[_0xc547('0x35')],_0x1cf26a[_0xc547('0x36')]));if(_0x1f13da['query'][_0xc547('0x40')]){_0x4cf6de[_0xc547('0x3e')]=_[_0xc547('0x41')](_0x4cf6de[_0xc547('0x3e')],{'$or':_[_0xc547('0x2f')](_0x4cf6de['attributes'],function(_0x48d325){var _0x3ff14e={};_0x3ff14e[_0x48d325]={'$like':'%'+_0x1f13da[_0xc547('0x35')][_0xc547('0x40')]+'%'};return _0x3ff14e;})});}_0x4cf6de=_[_0xc547('0x41')]({},_0x4cf6de,_0x1f13da[_0xc547('0x43')]);return _0x30a6ac[_0xc547('0x4f')](_0x4cf6de);}})['then'](function(_0x360d60){if(_0x360d60){_0x4d7969=_0x360d60[_0xc547('0x3a')];if(!_0x1f13da[_0xc547('0x35')][_0xc547('0x3b')](_0xc547('0x50'))){_0x4cf6de[_0xc547('0x1d')]=qs[_0xc547('0x1d')](_0x1f13da[_0xc547('0x35')][_0xc547('0x1d')]);_0x4cf6de[_0xc547('0x1f')]=qs[_0xc547('0x1f')](_0x1f13da[_0xc547('0x35')][_0xc547('0x1f')]);}return _0x30a6ac[_0xc547('0x4f')](_0x4cf6de);}})[_0xc547('0x27')](function(_0x522d69){if(_0x522d69){return _0x522d69?{'count':_0x4d7969,'rows':_0x522d69}:null;}})['then'](respondWithResult(_0x3a5b2c,null))[_0xc547('0x48')](handleError(_0x3a5b2c,null));};exports['addConfiguration']=function(_0x14a7d6,_0x43e00d,_0x335224){if(_0x14a7d6['body']['id']){delete _0x14a7d6[_0xc547('0x4e')]['id'];}return db[_0xc547('0x30')]['findOne']({'where':{'id':_0x14a7d6['params']['id']}})[_0xc547('0x27')](handleEntityNotFound(_0x43e00d,null))[_0xc547('0x27')](function(_0x59baa9){if(_0x59baa9){_0x14a7d6['body'][_0xc547('0x51')]=_0x59baa9['id'];_0x14a7d6[_0xc547('0x4e')][_0xc547('0x52')]=integrations['getSubjects'](_0x14a7d6[_0xc547('0x4e')][_0xc547('0x53')],_0x14a7d6[_0xc547('0x4e')]['type']);_0x14a7d6['body'][_0xc547('0x54')]=integrations[_0xc547('0x55')](_0x14a7d6[_0xc547('0x4e')][_0xc547('0x53')],_0x14a7d6[_0xc547('0x4e')][_0xc547('0x56')]);return db[_0xc547('0x57')][_0xc547('0x4d')](_0x14a7d6[_0xc547('0x4e')],{'include':[{'model':db[_0xc547('0x58')],'as':_0xc547('0x52')},{'model':db[_0xc547('0x58')],'as':_0xc547('0x54')}]});}return null;})[_0xc547('0x27')](respondWithResult(_0x43e00d,null))[_0xc547('0x48')](handleError(_0x43e00d,null));};exports[_0xc547('0x59')]=function(_0x457a06,_0x2c948e,_0x204e25){var _0x1c09d8=['made_sla','hold_reason',_0xc547('0x5a'),_0xc547('0x5b'),_0xc547('0x5c'),'notify',_0xc547('0x5d'),_0xc547('0x5e'),'category'];var _0x3d3903=['parent',_0xc547('0x5f'),_0xc547('0x60'),'watch_list',_0xc547('0x61'),_0xc547('0x62'),_0xc547('0x63'),'hold_reason',_0xc547('0x64'),'number','resolved_by','sys_updated_by',_0xc547('0x65'),_0xc547('0x66'),'sys_created_on',_0xc547('0x67'),'state',_0xc547('0x68'),_0xc547('0x5a'),_0xc547('0x3c'),_0xc547('0x69'),_0xc547('0x6a'),'cmdb_ci',_0xc547('0x6b'),_0xc547('0x6c'),'active','work_notes_list',_0xc547('0x6d'),_0xc547('0x6e'),_0xc547('0x6f'),_0xc547('0x70'),_0xc547('0x71'),_0xc547('0x72'),_0xc547('0x73'),_0xc547('0x74'),_0xc547('0x75'),_0xc547('0x76'),'reopened_time',_0xc547('0x77'),_0xc547('0x78'),'approval_set','subcategory',_0xc547('0x79'),_0xc547('0x7a'),_0xc547('0x5c'),_0xc547('0x7b'),'delivery_task','work_start',_0xc547('0x7c'),_0xc547('0x7d'),_0xc547('0x7e'),_0xc547('0x7f'),_0xc547('0x80'),_0xc547('0x81'),_0xc547('0x82'),_0xc547('0x83'),_0xc547('0x84'),_0xc547('0x85'),_0xc547('0x86'),'sys_id',_0xc547('0x87'),'reopened_by',_0xc547('0x5d'),'urgency',_0xc547('0x88'),_0xc547('0x89'),_0xc547('0x8a'),_0xc547('0x8b'),_0xc547('0x8c'),'severity',_0xc547('0x8d'),_0xc547('0x8e'),_0xc547('0x8f'),'comments_and_work_notes','due_date',_0xc547('0x90'),'reopen_count',_0xc547('0x91'),_0xc547('0x92'),_0xc547('0x93'),_0xc547('0x94'),_0xc547('0x95'),_0xc547('0x96')];var _0x4de84e='';var _0x324222='';var _0x375183=[];var _0x127dad='';var _0x42f1aa='';var _0xcfbaeb=[];var _0x55295f='';var _0x43bdfe='';var _0x950be7={};var _0x153a54='';return db['ServicenowAccount'][_0xc547('0x97')]({'where':{'id':_0x457a06[_0xc547('0x49')]['id']},'attributes':['id',_0xc547('0x98'),_0xc547('0x99'),_0xc547('0x9a'),_0xc547('0x9b'),_0xc547('0x9c')]})['then'](handleEntityNotFound(_0x2c948e,null))['then'](function(_0x3de985){if(_0x3de985){_0x153a54=_0x3de985[_0xc547('0x9b')];var _0xf325ca=_0x153a54[_0xc547('0x9d')](-0x1);if(_0xf325ca==='/'){_0x153a54=_0x153a54[_0xc547('0x9e')](0x0,_0x153a54['lastIndexOf'](_0xf325ca));}_0x43bdfe=util[_0xc547('0x9f')]('%s/api/now/doc/table/schema/',_0x153a54);_0x55295f=util[_0xc547('0x9f')]('%s/api/now/table/',_0x153a54);_0x950be7={'user':_0x3de985[_0xc547('0x98')],'pass':_0x3de985[_0xc547('0x99')]};var _0x5160cf={'method':_0xc547('0xa0'),'uri':_0x43bdfe+_0xc547('0xa1'),'auth':_0x950be7,'json':!![]};return rp(_0x5160cf);}})[_0xc547('0x27')](function(_0x293b5d){if(_0x293b5d[_0xc547('0xa2')][_0xc547('0x3a')]>0x0){_0x4de84e=_0x293b5d['result'];}console[_0xc547('0xa3')]('incident\x20table\x20objects',_0x4de84e);_0xcfbaeb=[];_0x324222=Object[_0xc547('0xa4')]([],_0x4de84e);_['remove'](_0x324222,function(_0x2c83c){return!_0x1c09d8[_0xc547('0xa5')](_0x2c83c[_0xc547('0x34')]);});_0x324222['forEach'](function(_0xeb17b3){var _0x284d5d=createFieldObject(_0x55295f,_0x950be7,_0xeb17b3[_0xc547('0xa6')],_0xeb17b3['name'],_0xeb17b3[_0xc547('0xa7')],![]);_0xcfbaeb[_0xc547('0xa8')](_0x284d5d);});return Promise[_0xc547('0xa9')](_0xcfbaeb);})[_0xc547('0x27')](function(_0x313eb9){_0x375183=_0x313eb9;_0x127dad=Object[_0xc547('0xa4')]([],_0x4de84e);console[_0xc547('0xa3')](_0xc547('0xaa'),_0x4de84e);_[_0xc547('0xab')](_0x127dad,function(_0xcb633a){return _0x3d3903['includes'](_0xcb633a['name']);});console[_0xc547('0xa3')](_0xc547('0xac'),_0x127dad);_0xcfbaeb=[];_0x127dad[_0xc547('0xad')](function(_0x1750c9){var _0xfa9df2=createFieldObject(_0x55295f,_0x950be7,_0x1750c9[_0xc547('0xa6')],_0x1750c9[_0xc547('0x34')],_0x1750c9[_0xc547('0xa7')],!![]);_0xcfbaeb[_0xc547('0xa8')](_0xfa9df2);});return Promise[_0xc547('0xa9')](_0xcfbaeb);})[_0xc547('0x27')](function(_0x21a480){_0x42f1aa=_0x21a480;var _0xc100f0=_0x375183[_0xc547('0xae')](_0x42f1aa);return{'count':_0xc100f0['length'],'rows':_0xc100f0};})[_0xc547('0x27')](respondWithResult(_0x2c948e,null))[_0xc547('0x48')](function(_0x233c7a){console['log'](_0xc547('0xaf')+_0x233c7a);var _0x162de9=_0x457a06[_0xc547('0x35')][_0xc547('0xb0')]?0x1f4:_0x233c7a[_0xc547('0xb1')]||0x1f4;logger[_0xc547('0x2b')](_0x233c7a[_0xc547('0x2c')]);delete _0x233c7a[_0xc547('0x34')];if(_0x162de9===0x191){_0x162de9=0x190;}_0x2c948e[_0xc547('0x29')](_0x162de9)[_0xc547('0x2d')](_0x457a06[_0xc547('0x35')]['test']?{'message':_0xc547('0xb2'),'statusCode':_0x233c7a[_0xc547('0xb1')]}:_0x233c7a);});};function createFieldObject(_0x253c3b,_0x184bf9,_0x276d3e,_0x5d5b35,_0x1314a5,_0x4ff6a7){return new Promise(function(_0x38f052,_0x3dd319){var _0x2dcbe5={'id':_0x5d5b35,'name':_0x1314a5,'custom':_0x4ff6a7};if(_0x276d3e===_0xc547('0xb3')){_0x2dcbe5[_0xc547('0x43')]=[{'name':_0xc547('0xb4'),'value':_0xc547('0xb5')},{'name':_0xc547('0xb6'),'value':_0xc547('0xb7')}];_0x38f052(_0x2dcbe5);}else{var _0xb6d290={'method':_0xc547('0xa0'),'uri':_0x253c3b+_0xc547('0xb8')+_0x5d5b35,'auth':_0x184bf9,'json':!![]};return rp(_0xb6d290)[_0xc547('0x27')](function(_0x493a3c){var _0x58be8b=[];if(_0x493a3c['result']['length']>0x0){_0x493a3c[_0xc547('0xa2')][_0xc547('0xad')](function(_0xb3ecd1){if(_0xb3ecd1[_0xc547('0xb9')]==='false'){var _0x43e54c={'name':_0xb3ecd1[_0xc547('0xa7')],'value':_0xb3ecd1[_0xc547('0xba')]};_0x58be8b[_0xc547('0xa8')](_0x43e54c);}});}_0x2dcbe5[_0xc547('0x43')]=_0x58be8b;if(_0x2dcbe5[_0xc547('0x43')][_0xc547('0x3a')]>0x0){_0x38f052(_0x2dcbe5);}else{if(_0x4ff6a7==![]){_0x38f052();}else{_0x38f052(_0x2dcbe5);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index c2e7ecd..1e7a61d 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 _0x3eea=['bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','int_servicenow_accounts','lodash','../../config/logger','api','moment'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x1470e1,_0x6c87c3){_0x1470e1=_0x1470e1-0x0;var _0x6445fa=_0x3eea[_0x1470e1];return _0x6445fa;};'use strict';var _=require(_0xa3ee('0x0'));var util=require('util');var logger=require(_0xa3ee('0x1'))(_0xa3ee('0x2'));var moment=require(_0xa3ee('0x3'));var BPromise=require(_0xa3ee('0x4'));var rp=require(_0xa3ee('0x5'));var fs=require('fs');var path=require(_0xa3ee('0x6'));var rimraf=require(_0xa3ee('0x7'));var config=require(_0xa3ee('0x8'));var attributes=require(_0xa3ee('0x9'));var integrations=require(_0xa3ee('0xa'));module[_0xa3ee('0xb')]=function(_0x5776bb,_0x538bf9){return _0x5776bb[_0xa3ee('0xc')]('ServicenowAccount',attributes,{'tableName':_0xa3ee('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb138=['int_servicenow_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intServicenowAccount.attributes','exports','define','ServicenowAccount'];(function(_0x16a013,_0x518fdd){var _0x5c7fdb=function(_0x635253){while(--_0x635253){_0x16a013['push'](_0x16a013['shift']());}};_0x5c7fdb(++_0x518fdd);}(_0xb138,0x1dd));var _0x8b13=function(_0x350213,_0x5d71f8){_0x350213=_0x350213-0x0;var _0x3fcae2=_0xb138[_0x350213];return _0x3fcae2;};'use strict';var _=require(_0x8b13('0x0'));var util=require(_0x8b13('0x1'));var logger=require(_0x8b13('0x2'))(_0x8b13('0x3'));var moment=require(_0x8b13('0x4'));var BPromise=require(_0x8b13('0x5'));var rp=require(_0x8b13('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b13('0x7'));var config=require(_0x8b13('0x8'));var attributes=require(_0x8b13('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x8b13('0xa')]=function(_0x13f7bd,_0x5d51b1){return _0x13f7bd[_0x8b13('0xb')](_0x8b13('0xc'),attributes,{'tableName':_0x8b13('0xd'),'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 7479ff0..bcd1350 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 _0x5f02=['include','map','model','ShowServicenowAccount','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','attributes','limit'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x5f02,0x16c));var _0x25f0=function(_0x8dc566,_0x1333bf){_0x8dc566=_0x8dc566-0x0;var _0x933a8=_0x5f02[_0x8dc566];return _0x933a8;};'use strict';var _=require(_0x25f0('0x0'));var util=require(_0x25f0('0x1'));var moment=require(_0x25f0('0x2'));var BPromise=require(_0x25f0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x25f0('0x4'));var db=require(_0x25f0('0x5'))['db'];var utils=require(_0x25f0('0x6'));var logger=require(_0x25f0('0x7'))(_0x25f0('0x8'));var config=require(_0x25f0('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x25f0('0xa')][_0x25f0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xdc9a9f,_0x2a119b,_0x22074b){return new BPromise(function(_0x292d95,_0x5062c5){return client[_0x25f0('0xc')](_0xdc9a9f,_0x22074b)[_0x25f0('0xd')](function(_0x297b63){logger[_0x25f0('0xe')](_0x25f0('0xf'),_0x2a119b,_0x25f0('0x10'));logger[_0x25f0('0x11')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x2a119b,_0x25f0('0x10'),JSON[_0x25f0('0x12')](_0x297b63));if(_0x297b63[_0x25f0('0x13')]){if(_0x297b63['error'][_0x25f0('0x14')]===0x1f4){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x2a119b,_0x297b63[_0x25f0('0x13')][_0x25f0('0x15')]);return _0x5062c5(_0x297b63['error']['message']);}logger[_0x25f0('0x13')]('ServicenowAccount,\x20%s,\x20%s',_0x2a119b,_0x297b63['error']['message']);return _0x292d95(_0x297b63[_0x25f0('0x13')]['message']);}else{logger[_0x25f0('0xe')](_0x25f0('0xf'),_0x2a119b,_0x25f0('0x10'));_0x292d95(_0x297b63[_0x25f0('0x16')][_0x25f0('0x15')]);}})[_0x25f0('0x17')](function(_0x439b46){logger[_0x25f0('0x13')]('ServicenowAccount,\x20%s,\x20%s',_0x2a119b,_0x439b46);_0x5062c5(_0x439b46);});});}exports[_0x25f0('0x18')]=function(_0xa49316){var _0xaa4dd1=this;return new Promise(function(_0x4e3e72,_0x7b5c3b){return db[_0x25f0('0x19')][_0x25f0('0x1a')]({'raw':_0xa49316['options']?_0xa49316[_0x25f0('0x1b')][_0x25f0('0x1c')]===undefined?!![]:![]:!![],'where':_0xa49316['options']?_0xa49316[_0x25f0('0x1b')][_0x25f0('0x1d')]||null:null,'attributes':_0xa49316[_0x25f0('0x1b')]?_0xa49316['options'][_0x25f0('0x1e')]||null:null,'limit':_0xa49316['options']?_0xa49316[_0x25f0('0x1b')][_0x25f0('0x1f')]||null:null,'include':_0xa49316[_0x25f0('0x1b')]?_0xa49316[_0x25f0('0x1b')][_0x25f0('0x20')]?_[_0x25f0('0x21')](_0xa49316[_0x25f0('0x1b')][_0x25f0('0x20')],function(_0x28f6d2){return{'model':db[_0x28f6d2[_0x25f0('0x22')]],'as':_0x28f6d2['as'],'attributes':_0x28f6d2[_0x25f0('0x1e')],'include':_0x28f6d2[_0x25f0('0x20')]?_['map'](_0x28f6d2[_0x25f0('0x20')],function(_0x136530){return{'model':db[_0x136530[_0x25f0('0x22')]],'as':_0x136530['as'],'attributes':_0x136530['attributes'],'include':_0x136530['include']?_[_0x25f0('0x21')](_0x136530['include'],function(_0x15981d){return{'model':db[_0x15981d[_0x25f0('0x22')]],'as':_0x15981d['as'],'attributes':_0x15981d[_0x25f0('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x25f0('0xd')](function(_0x4e478b){logger['info']('GetServicenowAccount',_0xa49316);logger[_0x25f0('0x11')](_0x25f0('0x18'),_0xa49316,JSON[_0x25f0('0x12')](_0x4e478b));_0x4e3e72(_0x4e478b);})[_0x25f0('0x17')](function(_0x577dbc){logger[_0x25f0('0x13')]('GetServicenowAccount',_0x577dbc['message'],_0xa49316);_0x7b5c3b(_0xaa4dd1['error'](0x1f4,_0x577dbc[_0x25f0('0x15')]));});});};exports['ShowServicenowAccount']=function(_0x392ba3){var _0xce0a4c=this;return new Promise(function(_0xbfc83,_0x3396bc){return db[_0x25f0('0x19')]['find']({'raw':_0x392ba3[_0x25f0('0x1b')]?_0x392ba3[_0x25f0('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x392ba3[_0x25f0('0x1b')]?_0x392ba3[_0x25f0('0x1b')][_0x25f0('0x1d')]||null:null,'attributes':_0x392ba3['options']?_0x392ba3[_0x25f0('0x1b')][_0x25f0('0x1e')]||null:null,'include':_0x392ba3[_0x25f0('0x1b')]?_0x392ba3['options'][_0x25f0('0x20')]?_[_0x25f0('0x21')](_0x392ba3[_0x25f0('0x1b')][_0x25f0('0x20')],function(_0x5be9d9){return{'model':db[_0x5be9d9[_0x25f0('0x22')]],'as':_0x5be9d9['as'],'attributes':_0x5be9d9[_0x25f0('0x1e')],'include':_0x5be9d9[_0x25f0('0x20')]?_[_0x25f0('0x21')](_0x5be9d9[_0x25f0('0x20')],function(_0x18273d){return{'model':db[_0x18273d[_0x25f0('0x22')]],'as':_0x18273d['as'],'attributes':_0x18273d['attributes'],'include':_0x18273d[_0x25f0('0x20')]?_['map'](_0x18273d[_0x25f0('0x20')],function(_0x2c9518){return{'model':db[_0x2c9518['model']],'as':_0x2c9518['as'],'attributes':_0x2c9518[_0x25f0('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x25f0('0xd')](function(_0x9d5764){logger[_0x25f0('0xe')](_0x25f0('0x23'),_0x392ba3);logger[_0x25f0('0x11')](_0x25f0('0x23'),_0x392ba3,JSON[_0x25f0('0x12')](_0x9d5764));_0xbfc83(_0x9d5764);})['catch'](function(_0x542a5d){logger[_0x25f0('0x13')](_0x25f0('0x23'),_0x542a5d[_0x25f0('0x15')],_0x392ba3);_0x3396bc(_0xce0a4c[_0x25f0('0x13')](0x1f4,_0x542a5d[_0x25f0('0x15')]));});});}; \ No newline at end of file +var _0xf48d=['stringify','error','code','message','result','ServicenowAccount','options','raw','where','attributes','map','include','model','GetServicenowAccount','catch','ShowServicenowAccount','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4b4b01,_0x5a6c91){var _0x49745e=function(_0x2013f6){while(--_0x2013f6){_0x4b4b01['push'](_0x4b4b01['shift']());}};_0x49745e(++_0x5a6c91);}(_0xf48d,0xc0));var _0xdf48=function(_0x4d45c1,_0x2beda1){_0x4d45c1=_0x4d45c1-0x0;var _0x244478=_0xf48d[_0x4d45c1];return _0x244478;};'use strict';var _=require('lodash');var util=require(_0xdf48('0x0'));var moment=require(_0xdf48('0x1'));var BPromise=require(_0xdf48('0x2'));var rs=require(_0xdf48('0x3'));var fs=require('fs');var Redis=require(_0xdf48('0x4'));var db=require(_0xdf48('0x5'))['db'];var utils=require(_0xdf48('0x6'));var logger=require('../../config/logger')(_0xdf48('0x7'));var config=require(_0xdf48('0x8'));var jayson=require(_0xdf48('0x9'));var client=jayson[_0xdf48('0xa')][_0xdf48('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3a93ba,_0x3944b0,_0x28ea63){return new BPromise(function(_0x81a6a0,_0x506699){return client[_0xdf48('0xc')](_0x3a93ba,_0x28ea63)[_0xdf48('0xd')](function(_0x375900){logger[_0xdf48('0xe')](_0xdf48('0xf'),_0x3944b0,_0xdf48('0x10'));logger[_0xdf48('0x11')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x3944b0,_0xdf48('0x10'),JSON[_0xdf48('0x12')](_0x375900));if(_0x375900[_0xdf48('0x13')]){if(_0x375900[_0xdf48('0x13')][_0xdf48('0x14')]===0x1f4){logger[_0xdf48('0x13')](_0xdf48('0xf'),_0x3944b0,_0x375900[_0xdf48('0x13')][_0xdf48('0x15')]);return _0x506699(_0x375900[_0xdf48('0x13')][_0xdf48('0x15')]);}logger[_0xdf48('0x13')](_0xdf48('0xf'),_0x3944b0,_0x375900['error'][_0xdf48('0x15')]);return _0x81a6a0(_0x375900[_0xdf48('0x13')]['message']);}else{logger[_0xdf48('0xe')](_0xdf48('0xf'),_0x3944b0,_0xdf48('0x10'));_0x81a6a0(_0x375900[_0xdf48('0x16')]['message']);}})['catch'](function(_0x2836b4){logger[_0xdf48('0x13')]('ServicenowAccount,\x20%s,\x20%s',_0x3944b0,_0x2836b4);_0x506699(_0x2836b4);});});}exports['GetServicenowAccount']=function(_0x285e68){var _0x2f676e=this;return new Promise(function(_0x2271fc,_0x1d4da4){return db[_0xdf48('0x17')]['findAll']({'raw':_0x285e68[_0xdf48('0x18')]?_0x285e68[_0xdf48('0x18')][_0xdf48('0x19')]===undefined?!![]:![]:!![],'where':_0x285e68[_0xdf48('0x18')]?_0x285e68['options'][_0xdf48('0x1a')]||null:null,'attributes':_0x285e68[_0xdf48('0x18')]?_0x285e68[_0xdf48('0x18')][_0xdf48('0x1b')]||null:null,'limit':_0x285e68['options']?_0x285e68[_0xdf48('0x18')]['limit']||null:null,'include':_0x285e68[_0xdf48('0x18')]?_0x285e68[_0xdf48('0x18')]['include']?_[_0xdf48('0x1c')](_0x285e68[_0xdf48('0x18')][_0xdf48('0x1d')],function(_0x202e59){return{'model':db[_0x202e59[_0xdf48('0x1e')]],'as':_0x202e59['as'],'attributes':_0x202e59['attributes'],'include':_0x202e59['include']?_['map'](_0x202e59['include'],function(_0x5b2c4a){return{'model':db[_0x5b2c4a['model']],'as':_0x5b2c4a['as'],'attributes':_0x5b2c4a[_0xdf48('0x1b')],'include':_0x5b2c4a[_0xdf48('0x1d')]?_[_0xdf48('0x1c')](_0x5b2c4a[_0xdf48('0x1d')],function(_0x3ccb4a){return{'model':db[_0x3ccb4a['model']],'as':_0x3ccb4a['as'],'attributes':_0x3ccb4a[_0xdf48('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x621da1){logger['info'](_0xdf48('0x1f'),_0x285e68);logger[_0xdf48('0x11')](_0xdf48('0x1f'),_0x285e68,JSON[_0xdf48('0x12')](_0x621da1));_0x2271fc(_0x621da1);})[_0xdf48('0x20')](function(_0xbf5ef0){logger[_0xdf48('0x13')](_0xdf48('0x1f'),_0xbf5ef0[_0xdf48('0x15')],_0x285e68);_0x1d4da4(_0x2f676e[_0xdf48('0x13')](0x1f4,_0xbf5ef0[_0xdf48('0x15')]));});});};exports[_0xdf48('0x21')]=function(_0x3674fe){var _0x3adff6=this;return new Promise(function(_0xf2989e,_0xe2e740){return db['ServicenowAccount'][_0xdf48('0x22')]({'raw':_0x3674fe[_0xdf48('0x18')]?_0x3674fe[_0xdf48('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x3674fe[_0xdf48('0x18')]?_0x3674fe[_0xdf48('0x18')][_0xdf48('0x1a')]||null:null,'attributes':_0x3674fe[_0xdf48('0x18')]?_0x3674fe[_0xdf48('0x18')][_0xdf48('0x1b')]||null:null,'include':_0x3674fe['options']?_0x3674fe[_0xdf48('0x18')]['include']?_['map'](_0x3674fe[_0xdf48('0x18')][_0xdf48('0x1d')],function(_0x4089c6){return{'model':db[_0x4089c6[_0xdf48('0x1e')]],'as':_0x4089c6['as'],'attributes':_0x4089c6[_0xdf48('0x1b')],'include':_0x4089c6[_0xdf48('0x1d')]?_[_0xdf48('0x1c')](_0x4089c6['include'],function(_0x49ab5c){return{'model':db[_0x49ab5c[_0xdf48('0x1e')]],'as':_0x49ab5c['as'],'attributes':_0x49ab5c[_0xdf48('0x1b')],'include':_0x49ab5c[_0xdf48('0x1d')]?_[_0xdf48('0x1c')](_0x49ab5c[_0xdf48('0x1d')],function(_0x37d503){return{'model':db[_0x37d503[_0xdf48('0x1e')]],'as':_0x37d503['as'],'attributes':_0x37d503[_0xdf48('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xdf48('0xd')](function(_0x27807f){logger[_0xdf48('0xe')](_0xdf48('0x21'),_0x3674fe);logger['debug']('ShowServicenowAccount',_0x3674fe,JSON[_0xdf48('0x12')](_0x27807f));_0xf2989e(_0x27807f);})[_0xdf48('0x20')](function(_0x209e73){logger['error'](_0xdf48('0x21'),_0x209e73[_0xdf48('0x15')],_0x3674fe);_0xe2e740(_0x3adff6[_0xdf48('0x13')](0x1f4,_0x209e73['message']));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 2235e4f..888607e 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 _0x5907=['isAuthenticated','index','/:id','/:id/subjects','getSubjects','getDescriptions','post','put','update','delete','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get'];(function(_0xa4d79,_0x22c387){var _0x505537=function(_0x2bfa8c){while(--_0x2bfa8c){_0xa4d79['push'](_0xa4d79['shift']());}};_0x505537(++_0x22c387);}(_0x5907,0x10f));var _0x7590=function(_0x12f173,_0x4d5502){_0x12f173=_0x12f173-0x0;var _0x441f77=_0x5907[_0x12f173];return _0x441f77;};'use strict';var multer=require(_0x7590('0x0'));var util=require(_0x7590('0x1'));var path=require(_0x7590('0x2'));var timeout=require('connect-timeout');var express=require(_0x7590('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7590('0x4'));var interaction=require(_0x7590('0x5'));var config=require(_0x7590('0x6'));var controller=require(_0x7590('0x7'));router[_0x7590('0x8')]('/',auth[_0x7590('0x9')](),controller[_0x7590('0xa')]);router[_0x7590('0x8')](_0x7590('0xb'),auth[_0x7590('0x9')](),controller['show']);router[_0x7590('0x8')]('/:id/fields',auth[_0x7590('0x9')](),controller['getFields']);router[_0x7590('0x8')](_0x7590('0xc'),auth[_0x7590('0x9')](),controller[_0x7590('0xd')]);router[_0x7590('0x8')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x7590('0xe')]);router[_0x7590('0xf')]('/',auth[_0x7590('0x9')](),controller['create']);router[_0x7590('0x10')]('/:id',auth[_0x7590('0x9')](),controller[_0x7590('0x11')]);router[_0x7590('0x12')](_0x7590('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x7590('0x13')]=router; \ No newline at end of file +var _0x0990=['./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4ec7f2,_0x3d92d2){var _0x118004=function(_0x1ac4fb){while(--_0x1ac4fb){_0x4ec7f2['push'](_0x4ec7f2['shift']());}};_0x118004(++_0x3d92d2);}(_0x0990,0xe7));var _0x0099=function(_0x1aba25,_0x1faed1){_0x1aba25=_0x1aba25-0x0;var _0x47d997=_0x0990[_0x1aba25];return _0x47d997;};'use strict';var multer=require(_0x0099('0x0'));var util=require(_0x0099('0x1'));var path=require(_0x0099('0x2'));var timeout=require(_0x0099('0x3'));var express=require(_0x0099('0x4'));var router=express[_0x0099('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0099('0x6'));var interaction=require(_0x0099('0x7'));var config=require(_0x0099('0x8'));var controller=require(_0x0099('0x9'));router[_0x0099('0xa')]('/',auth[_0x0099('0xb')](),controller[_0x0099('0xc')]);router[_0x0099('0xa')](_0x0099('0xd'),auth['isAuthenticated'](),controller[_0x0099('0xe')]);router['get'](_0x0099('0xf'),auth[_0x0099('0xb')](),controller[_0x0099('0x10')]);router[_0x0099('0xa')](_0x0099('0x11'),auth[_0x0099('0xb')](),controller[_0x0099('0x12')]);router['get'](_0x0099('0x13'),auth[_0x0099('0xb')](),controller['getDescriptions']);router[_0x0099('0x14')]('/',auth[_0x0099('0xb')](),controller['create']);router['put'](_0x0099('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x0099('0x15')](_0x0099('0xd'),auth[_0x0099('0xb')](),controller[_0x0099('0x16')]);module[_0x0099('0x17')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 35cf22a..e15cb34 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 _0x145e=['sequelize','STRING'];(function(_0x3a60b8,_0x47caab){var _0x4eb583=function(_0x2251b5){while(--_0x2251b5){_0x3a60b8['push'](_0x3a60b8['shift']());}};_0x4eb583(++_0x47caab);}(_0x145e,0x15a));var _0xe145=function(_0x5224b9,_0x195fcb){_0x5224b9=_0x5224b9-0x0;var _0x363bcc=_0x145e[_0x5224b9];return _0x363bcc;};'use strict';var Sequelize=require(_0xe145('0x0'));module['exports']={'name':{'type':Sequelize[_0xe145('0x1')]},'description':{'type':Sequelize[_0xe145('0x1')]}}; \ No newline at end of file +var _0x377f=['exports','STRING','sequelize'];(function(_0x295572,_0x58a177){var _0x285bef=function(_0x3d284e){while(--_0x3d284e){_0x295572['push'](_0x295572['shift']());}};_0x285bef(++_0x58a177);}(_0x377f,0x104));var _0xf377=function(_0x441373,_0x15b94){_0x441373=_0x441373-0x0;var _0x4a61b2=_0x377f[_0x441373];return _0x4a61b2;};'use strict';var Sequelize=require(_0xf377('0x0'));module[_0xf377('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf377('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 6895b2a..b12aaad 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 _0x1b9f=['fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','ServicenowConfiguration','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','rawAttributes','find','create','body','update','params','findOne','ServicenowField','getSubjects','getDescriptions','rimraf','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs'];(function(_0x3a3f77,_0x400a0a){var _0x24e317=function(_0x2b4af6){while(--_0x2b4af6){_0x3a3f77['push'](_0x3a3f77['shift']());}};_0x24e317(++_0x400a0a);}(_0x1b9f,0x138));var _0xf1b9=function(_0x1a3a03,_0x68d11d){_0x1a3a03=_0x1a3a03-0x0;var _0x147524=_0x1b9f[_0x1a3a03];return _0x147524;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf1b9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf1b9('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf1b9('0x2'));var Mustache=require(_0xf1b9('0x3'));var util=require('util');var path=require(_0xf1b9('0x4'));var sox=require(_0xf1b9('0x5'));var csv=require(_0xf1b9('0x6'));var ejs=require(_0xf1b9('0x7'));var fs=require('fs');var fs_extra=require(_0xf1b9('0x8'));var _=require('lodash');var squel=require(_0xf1b9('0x9'));var crypto=require(_0xf1b9('0xa'));var jsforce=require(_0xf1b9('0xb'));var deskjs=require(_0xf1b9('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf1b9('0xd'));var Redis=require(_0xf1b9('0xe'));var authService=require(_0xf1b9('0xf'));var qs=require(_0xf1b9('0x10'));var as=require(_0xf1b9('0x11'));var hardwareService=require(_0xf1b9('0x12'));var logger=require(_0xf1b9('0x13'))(_0xf1b9('0x14'));var utils=require('../../config/utils');var config=require(_0xf1b9('0x15'));var licenseUtil=require(_0xf1b9('0x16'));var db=require(_0xf1b9('0x17'))['db'];function respondWithStatusCode(_0x2de07d,_0x5b2ceb){_0x5b2ceb=_0x5b2ceb||0xcc;return function(_0x2b0494){if(_0x2b0494){return _0x2de07d[_0xf1b9('0x18')](_0x5b2ceb);}return _0x2de07d[_0xf1b9('0x19')](_0x5b2ceb)[_0xf1b9('0x1a')]();};}function respondWithResult(_0x4f6660,_0x22d90b){_0x22d90b=_0x22d90b||0xc8;return function(_0x123ad5){if(_0x123ad5){return _0x4f6660[_0xf1b9('0x19')](_0x22d90b)[_0xf1b9('0x1b')](_0x123ad5);}};}function respondWithFilteredResult(_0x214b0f,_0x52a3a5){return function(_0x9a0fd5){if(_0x9a0fd5){var _0x2cad40=typeof _0x52a3a5[_0xf1b9('0x1c')]==='undefined'&&typeof _0x52a3a5[_0xf1b9('0x1d')]==='undefined';var _0x3752c7=_0x9a0fd5[_0xf1b9('0x1e')];var _0x458f4b=_0x2cad40?0x0:_0x52a3a5[_0xf1b9('0x1c')];var _0x5def55=_0x2cad40?_0x9a0fd5[_0xf1b9('0x1e')]:_0x52a3a5['offset']+_0x52a3a5[_0xf1b9('0x1d')];var _0x45ac5b;if(_0x5def55>=_0x3752c7){_0x5def55=_0x3752c7;_0x45ac5b=0xc8;}else{_0x45ac5b=0xce;}_0x214b0f[_0xf1b9('0x19')](_0x45ac5b);return _0x214b0f[_0xf1b9('0x1f')](_0xf1b9('0x20'),_0x458f4b+'-'+_0x5def55+'/'+_0x3752c7)[_0xf1b9('0x1b')](_0x9a0fd5);}return null;};}function patchUpdates(_0x514664){return function(_0x14736f){try{jsonpatch[_0xf1b9('0x21')](_0x14736f,_0x514664,!![]);}catch(_0x5f361d){return BPromise[_0xf1b9('0x22')](_0x5f361d);}return _0x14736f[_0xf1b9('0x23')]();};}function saveUpdates(_0x4e4d88,_0x158ffb){return function(_0x23d425){if(_0x23d425){return _0x23d425['update'](_0x4e4d88)[_0xf1b9('0x24')](function(_0x1799b7){return _0x1799b7;});}return null;};}function removeEntity(_0x5eca74,_0xf55787){return function(_0x3f0a48){if(_0x3f0a48){return _0x3f0a48[_0xf1b9('0x25')]()[_0xf1b9('0x24')](function(){_0x5eca74[_0xf1b9('0x19')](0xcc)[_0xf1b9('0x1a')]();});}};}function handleEntityNotFound(_0x239262,_0x47f0d8){return function(_0x492ac3){if(!_0x492ac3){_0x239262[_0xf1b9('0x18')](0x194);}return _0x492ac3;};}function handleError(_0x1f1393,_0x2a31a7){_0x2a31a7=_0x2a31a7||0x1f4;return function(_0x8a994d){logger[_0xf1b9('0x26')](_0x8a994d[_0xf1b9('0x27')]);if(_0x8a994d[_0xf1b9('0x28')]){delete _0x8a994d[_0xf1b9('0x28')];}_0x1f1393['status'](_0x2a31a7)[_0xf1b9('0x29')](_0x8a994d);};}exports[_0xf1b9('0x2a')]=function(_0x434187,_0xa8ebfa){var _0x5c8e9a={},_0x2a0b46={},_0x28fc46={'count':0x0,'rows':[]};var _0x561194=_[_0xf1b9('0x2b')](db[_0xf1b9('0x2c')]['rawAttributes'],function(_0x13aac8){return{'name':_0x13aac8[_0xf1b9('0x2d')],'type':_0x13aac8[_0xf1b9('0x2e')]['key']};});_0x2a0b46['model']=_[_0xf1b9('0x2b')](_0x561194,_0xf1b9('0x28'));_0x2a0b46[_0xf1b9('0x2f')]=_[_0xf1b9('0x30')](_0x434187[_0xf1b9('0x2f')]);_0x2a0b46[_0xf1b9('0x31')]=_['intersection'](_0x2a0b46[_0xf1b9('0x32')],_0x2a0b46['query']);_0x5c8e9a[_0xf1b9('0x33')]=_[_0xf1b9('0x34')](_0x2a0b46[_0xf1b9('0x32')],qs[_0xf1b9('0x35')](_0x434187[_0xf1b9('0x2f')]['fields']));_0x5c8e9a[_0xf1b9('0x33')]=_0x5c8e9a['attributes'][_0xf1b9('0x36')]?_0x5c8e9a[_0xf1b9('0x33')]:_0x2a0b46['model'];if(!_0x434187['query'][_0xf1b9('0x37')](_0xf1b9('0x38'))){_0x5c8e9a['limit']=qs[_0xf1b9('0x1d')](_0x434187[_0xf1b9('0x2f')][_0xf1b9('0x1d')]);_0x5c8e9a[_0xf1b9('0x1c')]=qs[_0xf1b9('0x1c')](_0x434187[_0xf1b9('0x2f')][_0xf1b9('0x1c')]);}_0x5c8e9a[_0xf1b9('0x39')]=qs['sort'](_0x434187[_0xf1b9('0x2f')][_0xf1b9('0x3a')]);_0x5c8e9a[_0xf1b9('0x3b')]=qs['filters'](_[_0xf1b9('0x3c')](_0x434187[_0xf1b9('0x2f')],_0x2a0b46[_0xf1b9('0x31')]),_0x561194);if(_0x434187[_0xf1b9('0x2f')][_0xf1b9('0x3d')]){_0x5c8e9a['where']=_[_0xf1b9('0x3e')](_0x5c8e9a[_0xf1b9('0x3b')],{'$or':_[_0xf1b9('0x2b')](_0x561194,function(_0x15bf15){if(_0x15bf15[_0xf1b9('0x2e')]!==_0xf1b9('0x3f')){var _0x40dd6c={};_0x40dd6c[_0x15bf15[_0xf1b9('0x28')]]={'$like':'%'+_0x434187[_0xf1b9('0x2f')][_0xf1b9('0x3d')]+'%'};return _0x40dd6c;}})});}_0x5c8e9a=_[_0xf1b9('0x3e')]({},_0x5c8e9a,_0x434187[_0xf1b9('0x40')]);var _0x271b03={'where':_0x5c8e9a['where']};return db[_0xf1b9('0x2c')][_0xf1b9('0x1e')](_0x271b03)[_0xf1b9('0x24')](function(_0x1fdc4f){_0x28fc46['count']=_0x1fdc4f;if(_0x434187[_0xf1b9('0x2f')][_0xf1b9('0x41')]){_0x5c8e9a[_0xf1b9('0x42')]=[{'all':!![]}];}return db[_0xf1b9('0x2c')][_0xf1b9('0x43')](_0x5c8e9a);})[_0xf1b9('0x24')](function(_0x3e74bb){_0x28fc46['rows']=_0x3e74bb;return _0x28fc46;})['then'](respondWithFilteredResult(_0xa8ebfa,_0x5c8e9a))[_0xf1b9('0x44')](handleError(_0xa8ebfa,null));};exports[_0xf1b9('0x45')]=function(_0x23bb75,_0x2dce01){var _0x184ee1={'raw':![],'where':{'id':_0x23bb75['params']['id']}},_0x74c76b={};_0x74c76b['model']=_[_0xf1b9('0x30')](db[_0xf1b9('0x2c')][_0xf1b9('0x46')]);_0x74c76b[_0xf1b9('0x2f')]=_['keys'](_0x23bb75['query']);_0x74c76b[_0xf1b9('0x31')]=_[_0xf1b9('0x34')](_0x74c76b['model'],_0x74c76b[_0xf1b9('0x2f')]);_0x184ee1['attributes']=_[_0xf1b9('0x34')](_0x74c76b[_0xf1b9('0x32')],qs[_0xf1b9('0x35')](_0x23bb75[_0xf1b9('0x2f')][_0xf1b9('0x35')]));_0x184ee1[_0xf1b9('0x33')]=_0x184ee1['attributes']['length']?_0x184ee1[_0xf1b9('0x33')]:_0x74c76b[_0xf1b9('0x32')];if(_0x23bb75[_0xf1b9('0x2f')]['includeAll']){_0x184ee1[_0xf1b9('0x42')]=[{'all':!![]}];}_0x184ee1=_[_0xf1b9('0x3e')]({},_0x184ee1,_0x23bb75['options']);return db[_0xf1b9('0x2c')][_0xf1b9('0x47')](_0x184ee1)['then'](handleEntityNotFound(_0x2dce01,null))[_0xf1b9('0x24')](respondWithResult(_0x2dce01,null))[_0xf1b9('0x44')](handleError(_0x2dce01,null));};exports[_0xf1b9('0x48')]=function(_0x3ed54f,_0x5390e7){return db[_0xf1b9('0x2c')][_0xf1b9('0x48')](_0x3ed54f[_0xf1b9('0x49')],{})[_0xf1b9('0x24')](respondWithResult(_0x5390e7,0xc9))[_0xf1b9('0x44')](handleError(_0x5390e7,null));};exports[_0xf1b9('0x4a')]=function(_0x4290ba,_0x20c862){if(_0x4290ba[_0xf1b9('0x49')]['id']){delete _0x4290ba['body']['id'];}return db[_0xf1b9('0x2c')][_0xf1b9('0x47')]({'where':{'id':_0x4290ba[_0xf1b9('0x4b')]['id']}})[_0xf1b9('0x24')](handleEntityNotFound(_0x20c862,null))[_0xf1b9('0x24')](saveUpdates(_0x4290ba[_0xf1b9('0x49')],null))[_0xf1b9('0x24')](respondWithResult(_0x20c862,null))[_0xf1b9('0x44')](handleError(_0x20c862,null));};exports[_0xf1b9('0x25')]=function(_0x2dbb7c,_0x192f5c){return db['ServicenowConfiguration']['find']({'where':{'id':_0x2dbb7c[_0xf1b9('0x4b')]['id']}})[_0xf1b9('0x24')](handleEntityNotFound(_0x192f5c,null))['then'](removeEntity(_0x192f5c,null))['catch'](handleError(_0x192f5c,null));};exports['getFields']=function(_0x2a500c,_0x460dd9,_0x28aa81){var _0x584e9e={};var _0x3fc8c3={};var _0x286c96;var _0x24739c;return db[_0xf1b9('0x2c')][_0xf1b9('0x4c')]({'where':{'id':_0x2a500c['params']['id']}})[_0xf1b9('0x24')](handleEntityNotFound(_0x460dd9,null))['then'](function(_0x335ea4){if(_0x335ea4){_0x286c96=_0x335ea4;_0x3fc8c3[_0xf1b9('0x32')]=_['keys'](db[_0xf1b9('0x4d')][_0xf1b9('0x46')]);_0x3fc8c3[_0xf1b9('0x2f')]=_[_0xf1b9('0x30')](_0x2a500c[_0xf1b9('0x2f')]);_0x3fc8c3[_0xf1b9('0x31')]=_['intersection'](_0x3fc8c3['model'],_0x3fc8c3[_0xf1b9('0x2f')]);_0x584e9e[_0xf1b9('0x33')]=_[_0xf1b9('0x34')](_0x3fc8c3[_0xf1b9('0x32')],qs[_0xf1b9('0x35')](_0x2a500c[_0xf1b9('0x2f')]['fields']));_0x584e9e[_0xf1b9('0x33')]=_0x584e9e[_0xf1b9('0x33')][_0xf1b9('0x36')]?_0x584e9e[_0xf1b9('0x33')]:_0x3fc8c3[_0xf1b9('0x32')];_0x584e9e[_0xf1b9('0x39')]=qs[_0xf1b9('0x3a')](_0x2a500c['query'][_0xf1b9('0x3a')]);_0x584e9e[_0xf1b9('0x3b')]=qs['filters'](_['pick'](_0x2a500c[_0xf1b9('0x2f')],_0x3fc8c3[_0xf1b9('0x31')]));if(_0x2a500c[_0xf1b9('0x2f')]['filter']){_0x584e9e[_0xf1b9('0x3b')]=_['merge'](_0x584e9e[_0xf1b9('0x3b')],{'$or':_[_0xf1b9('0x2b')](_0x584e9e['attributes'],function(_0x62d4ae){var _0x1a9b51={};_0x1a9b51[_0x62d4ae]={'$like':'%'+_0x2a500c[_0xf1b9('0x2f')][_0xf1b9('0x3d')]+'%'};return _0x1a9b51;})});}_0x584e9e=_[_0xf1b9('0x3e')]({},_0x584e9e,_0x2a500c[_0xf1b9('0x40')]);return _0x286c96['getFields'](_0x584e9e);}})['then'](function(_0xee93c1){if(_0xee93c1){_0x24739c=_0xee93c1['length'];if(!_0x2a500c[_0xf1b9('0x2f')]['hasOwnProperty']('nolimit')){_0x584e9e[_0xf1b9('0x1d')]=qs[_0xf1b9('0x1d')](_0x2a500c[_0xf1b9('0x2f')]['limit']);_0x584e9e[_0xf1b9('0x1c')]=qs['offset'](_0x2a500c[_0xf1b9('0x2f')][_0xf1b9('0x1c')]);}return _0x286c96['getFields'](_0x584e9e);}})[_0xf1b9('0x24')](function(_0x4943ca){if(_0x4943ca){return _0x4943ca?{'count':_0x24739c,'rows':_0x4943ca}:null;}})['then'](respondWithResult(_0x460dd9,null))[_0xf1b9('0x44')](handleError(_0x460dd9,null));};exports[_0xf1b9('0x4e')]=function(_0x15f22d,_0x381690,_0x4b9c3a){var _0xc52f4={};var _0xcd7345={};var _0x435882;var _0x40b8f2;return db[_0xf1b9('0x2c')][_0xf1b9('0x4c')]({'where':{'id':_0x15f22d[_0xf1b9('0x4b')]['id']}})[_0xf1b9('0x24')](handleEntityNotFound(_0x381690,null))[_0xf1b9('0x24')](function(_0x22104b){if(_0x22104b){_0x435882=_0x22104b;_0xcd7345[_0xf1b9('0x32')]=_[_0xf1b9('0x30')](db[_0xf1b9('0x4d')][_0xf1b9('0x46')]);_0xcd7345['query']=_[_0xf1b9('0x30')](_0x15f22d['query']);_0xcd7345['filters']=_[_0xf1b9('0x34')](_0xcd7345[_0xf1b9('0x32')],_0xcd7345[_0xf1b9('0x2f')]);_0xc52f4[_0xf1b9('0x33')]=_[_0xf1b9('0x34')](_0xcd7345[_0xf1b9('0x32')],qs[_0xf1b9('0x35')](_0x15f22d['query'][_0xf1b9('0x35')]));_0xc52f4['attributes']=_0xc52f4[_0xf1b9('0x33')][_0xf1b9('0x36')]?_0xc52f4[_0xf1b9('0x33')]:_0xcd7345[_0xf1b9('0x32')];_0xc52f4['order']=qs['sort'](_0x15f22d[_0xf1b9('0x2f')][_0xf1b9('0x3a')]);_0xc52f4[_0xf1b9('0x3b')]=qs[_0xf1b9('0x31')](_[_0xf1b9('0x3c')](_0x15f22d[_0xf1b9('0x2f')],_0xcd7345[_0xf1b9('0x31')]));if(_0x15f22d['query']['filter']){_0xc52f4[_0xf1b9('0x3b')]=_['merge'](_0xc52f4[_0xf1b9('0x3b')],{'$or':_[_0xf1b9('0x2b')](_0xc52f4['attributes'],function(_0x1a173a){var _0x492ddd={};_0x492ddd[_0x1a173a]={'$like':'%'+_0x15f22d[_0xf1b9('0x2f')][_0xf1b9('0x3d')]+'%'};return _0x492ddd;})});}_0xc52f4=_[_0xf1b9('0x3e')]({},_0xc52f4,_0x15f22d['options']);return _0x435882[_0xf1b9('0x4e')](_0xc52f4);}})[_0xf1b9('0x24')](function(_0x569cd0){if(_0x569cd0){_0x40b8f2=_0x569cd0[_0xf1b9('0x36')];if(!_0x15f22d[_0xf1b9('0x2f')]['hasOwnProperty'](_0xf1b9('0x38'))){_0xc52f4[_0xf1b9('0x1d')]=qs[_0xf1b9('0x1d')](_0x15f22d[_0xf1b9('0x2f')][_0xf1b9('0x1d')]);_0xc52f4[_0xf1b9('0x1c')]=qs['offset'](_0x15f22d[_0xf1b9('0x2f')]['offset']);}return _0x435882[_0xf1b9('0x4e')](_0xc52f4);}})[_0xf1b9('0x24')](function(_0xe52718){if(_0xe52718){return _0xe52718?{'count':_0x40b8f2,'rows':_0xe52718}:null;}})[_0xf1b9('0x24')](respondWithResult(_0x381690,null))[_0xf1b9('0x44')](handleError(_0x381690,null));};exports[_0xf1b9('0x4f')]=function(_0x3d8a1a,_0x11672d,_0x2e2107){var _0x89ec7f={};var _0x3a0cd8={};var _0x347dc5;var _0xefc3b8;return db[_0xf1b9('0x2c')][_0xf1b9('0x4c')]({'where':{'id':_0x3d8a1a[_0xf1b9('0x4b')]['id']}})[_0xf1b9('0x24')](handleEntityNotFound(_0x11672d,null))[_0xf1b9('0x24')](function(_0x1bb6c4){if(_0x1bb6c4){_0x347dc5=_0x1bb6c4;_0x3a0cd8[_0xf1b9('0x32')]=_[_0xf1b9('0x30')](db[_0xf1b9('0x4d')][_0xf1b9('0x46')]);_0x3a0cd8[_0xf1b9('0x2f')]=_[_0xf1b9('0x30')](_0x3d8a1a['query']);_0x3a0cd8[_0xf1b9('0x31')]=_[_0xf1b9('0x34')](_0x3a0cd8[_0xf1b9('0x32')],_0x3a0cd8[_0xf1b9('0x2f')]);_0x89ec7f[_0xf1b9('0x33')]=_[_0xf1b9('0x34')](_0x3a0cd8[_0xf1b9('0x32')],qs[_0xf1b9('0x35')](_0x3d8a1a[_0xf1b9('0x2f')][_0xf1b9('0x35')]));_0x89ec7f['attributes']=_0x89ec7f[_0xf1b9('0x33')]['length']?_0x89ec7f[_0xf1b9('0x33')]:_0x3a0cd8['model'];_0x89ec7f['order']=qs[_0xf1b9('0x3a')](_0x3d8a1a['query']['sort']);_0x89ec7f[_0xf1b9('0x3b')]=qs[_0xf1b9('0x31')](_['pick'](_0x3d8a1a[_0xf1b9('0x2f')],_0x3a0cd8[_0xf1b9('0x31')]));if(_0x3d8a1a[_0xf1b9('0x2f')][_0xf1b9('0x3d')]){_0x89ec7f['where']=_[_0xf1b9('0x3e')](_0x89ec7f[_0xf1b9('0x3b')],{'$or':_['map'](_0x89ec7f[_0xf1b9('0x33')],function(_0x180ed7){var _0x2ab13a={};_0x2ab13a[_0x180ed7]={'$like':'%'+_0x3d8a1a[_0xf1b9('0x2f')][_0xf1b9('0x3d')]+'%'};return _0x2ab13a;})});}_0x89ec7f=_[_0xf1b9('0x3e')]({},_0x89ec7f,_0x3d8a1a[_0xf1b9('0x40')]);return _0x347dc5[_0xf1b9('0x4f')](_0x89ec7f);}})[_0xf1b9('0x24')](function(_0x2f6149){if(_0x2f6149){_0xefc3b8=_0x2f6149[_0xf1b9('0x36')];if(!_0x3d8a1a[_0xf1b9('0x2f')]['hasOwnProperty']('nolimit')){_0x89ec7f['limit']=qs[_0xf1b9('0x1d')](_0x3d8a1a[_0xf1b9('0x2f')][_0xf1b9('0x1d')]);_0x89ec7f[_0xf1b9('0x1c')]=qs[_0xf1b9('0x1c')](_0x3d8a1a[_0xf1b9('0x2f')][_0xf1b9('0x1c')]);}return _0x347dc5['getDescriptions'](_0x89ec7f);}})[_0xf1b9('0x24')](function(_0x13810f){if(_0x13810f){return _0x13810f?{'count':_0xefc3b8,'rows':_0x13810f}:null;}})[_0xf1b9('0x24')](respondWithResult(_0x11672d,null))[_0xf1b9('0x44')](handleError(_0x11672d,null));}; \ No newline at end of file +var _0x4e6d=['body','params','keys','ServicenowField','getFields','hasOwnProperty','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','ServicenowConfiguration','include','findAll','rows','catch','find','create'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0x4e6d,0xa3));var _0xd4e6=function(_0x25c92b,_0x41b368){_0x25c92b=_0x25c92b-0x0;var _0xc59d85=_0x4e6d[_0x25c92b];return _0xc59d85;};'use strict';var emlformat=require(_0xd4e6('0x0'));var rimraf=require(_0xd4e6('0x1'));var zipdir=require(_0xd4e6('0x2'));var jsonpatch=require(_0xd4e6('0x3'));var rp=require(_0xd4e6('0x4'));var moment=require('moment');var BPromise=require(_0xd4e6('0x5'));var Mustache=require(_0xd4e6('0x6'));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(_0xd4e6('0x7'));var _=require(_0xd4e6('0x8'));var squel=require('squel');var crypto=require(_0xd4e6('0x9'));var jsforce=require(_0xd4e6('0xa'));var deskjs=require(_0xd4e6('0xb'));var toCsv=require(_0xd4e6('0xc'));var querystring=require(_0xd4e6('0xd'));var Papa=require(_0xd4e6('0xe'));var Redis=require(_0xd4e6('0xf'));var authService=require(_0xd4e6('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xd4e6('0x11'));var hardwareService=require(_0xd4e6('0x12'));var logger=require(_0xd4e6('0x13'))(_0xd4e6('0x14'));var utils=require(_0xd4e6('0x15'));var config=require(_0xd4e6('0x16'));var licenseUtil=require(_0xd4e6('0x17'));var db=require(_0xd4e6('0x18'))['db'];function respondWithStatusCode(_0x4c7e28,_0x56e0a3){_0x56e0a3=_0x56e0a3||0xcc;return function(_0x2b0276){if(_0x2b0276){return _0x4c7e28['sendStatus'](_0x56e0a3);}return _0x4c7e28['status'](_0x56e0a3)[_0xd4e6('0x19')]();};}function respondWithResult(_0xebda6a,_0x319839){_0x319839=_0x319839||0xc8;return function(_0xe3c03f){if(_0xe3c03f){return _0xebda6a[_0xd4e6('0x1a')](_0x319839)[_0xd4e6('0x1b')](_0xe3c03f);}};}function respondWithFilteredResult(_0x3c0c06,_0x490208){return function(_0x12e348){if(_0x12e348){var _0xae0dd3=typeof _0x490208[_0xd4e6('0x1c')]===_0xd4e6('0x1d')&&typeof _0x490208[_0xd4e6('0x1e')]===_0xd4e6('0x1d');var _0x571327=_0x12e348[_0xd4e6('0x1f')];var _0x21dd19=_0xae0dd3?0x0:_0x490208['offset'];var _0x5eeb88=_0xae0dd3?_0x12e348['count']:_0x490208['offset']+_0x490208[_0xd4e6('0x1e')];var _0x26a5f1;if(_0x5eeb88>=_0x571327){_0x5eeb88=_0x571327;_0x26a5f1=0xc8;}else{_0x26a5f1=0xce;}_0x3c0c06[_0xd4e6('0x1a')](_0x26a5f1);return _0x3c0c06[_0xd4e6('0x20')]('Content-Range',_0x21dd19+'-'+_0x5eeb88+'/'+_0x571327)[_0xd4e6('0x1b')](_0x12e348);}return null;};}function patchUpdates(_0x254df3){return function(_0x2ddc80){try{jsonpatch['apply'](_0x2ddc80,_0x254df3,!![]);}catch(_0x2501e9){return BPromise['reject'](_0x2501e9);}return _0x2ddc80[_0xd4e6('0x21')]();};}function saveUpdates(_0x282b36,_0x5948df){return function(_0x443541){if(_0x443541){return _0x443541[_0xd4e6('0x22')](_0x282b36)[_0xd4e6('0x23')](function(_0x2b5dbb){return _0x2b5dbb;});}return null;};}function removeEntity(_0x285cbf,_0x33b9e4){return function(_0x41b1cf){if(_0x41b1cf){return _0x41b1cf[_0xd4e6('0x24')]()['then'](function(){_0x285cbf[_0xd4e6('0x1a')](0xcc)[_0xd4e6('0x19')]();});}};}function handleEntityNotFound(_0x118d6b,_0x33d0c1){return function(_0x2790c3){if(!_0x2790c3){_0x118d6b[_0xd4e6('0x25')](0x194);}return _0x2790c3;};}function handleError(_0x3b4433,_0x3f970b){_0x3f970b=_0x3f970b||0x1f4;return function(_0x6343bb){logger[_0xd4e6('0x26')](_0x6343bb[_0xd4e6('0x27')]);if(_0x6343bb[_0xd4e6('0x28')]){delete _0x6343bb['name'];}_0x3b4433['status'](_0x3f970b)[_0xd4e6('0x29')](_0x6343bb);};}exports[_0xd4e6('0x2a')]=function(_0x40467b,_0x5baca8){var _0x4a223a={},_0x3c33d2={},_0x5e9349={'count':0x0,'rows':[]};var _0x4ef26c=_[_0xd4e6('0x2b')](db['ServicenowConfiguration'][_0xd4e6('0x2c')],function(_0xe5c87e){return{'name':_0xe5c87e[_0xd4e6('0x2d')],'type':_0xe5c87e['type']['key']};});_0x3c33d2[_0xd4e6('0x2e')]=_[_0xd4e6('0x2b')](_0x4ef26c,_0xd4e6('0x28'));_0x3c33d2[_0xd4e6('0x2f')]=_['keys'](_0x40467b[_0xd4e6('0x2f')]);_0x3c33d2[_0xd4e6('0x30')]=_[_0xd4e6('0x31')](_0x3c33d2[_0xd4e6('0x2e')],_0x3c33d2[_0xd4e6('0x2f')]);_0x4a223a[_0xd4e6('0x32')]=_['intersection'](_0x3c33d2[_0xd4e6('0x2e')],qs[_0xd4e6('0x33')](_0x40467b[_0xd4e6('0x2f')][_0xd4e6('0x33')]));_0x4a223a[_0xd4e6('0x32')]=_0x4a223a[_0xd4e6('0x32')][_0xd4e6('0x34')]?_0x4a223a[_0xd4e6('0x32')]:_0x3c33d2[_0xd4e6('0x2e')];if(!_0x40467b['query']['hasOwnProperty']('nolimit')){_0x4a223a[_0xd4e6('0x1e')]=qs[_0xd4e6('0x1e')](_0x40467b[_0xd4e6('0x2f')][_0xd4e6('0x1e')]);_0x4a223a[_0xd4e6('0x1c')]=qs[_0xd4e6('0x1c')](_0x40467b[_0xd4e6('0x2f')][_0xd4e6('0x1c')]);}_0x4a223a[_0xd4e6('0x35')]=qs[_0xd4e6('0x36')](_0x40467b[_0xd4e6('0x2f')][_0xd4e6('0x36')]);_0x4a223a[_0xd4e6('0x37')]=qs[_0xd4e6('0x30')](_[_0xd4e6('0x38')](_0x40467b[_0xd4e6('0x2f')],_0x3c33d2[_0xd4e6('0x30')]),_0x4ef26c);if(_0x40467b[_0xd4e6('0x2f')][_0xd4e6('0x39')]){_0x4a223a['where']=_[_0xd4e6('0x3a')](_0x4a223a['where'],{'$or':_['map'](_0x4ef26c,function(_0x2c0a76){if(_0x2c0a76['type']!==_0xd4e6('0x3b')){var _0x5ee6ef={};_0x5ee6ef[_0x2c0a76[_0xd4e6('0x28')]]={'$like':'%'+_0x40467b['query'][_0xd4e6('0x39')]+'%'};return _0x5ee6ef;}})});}_0x4a223a=_[_0xd4e6('0x3a')]({},_0x4a223a,_0x40467b[_0xd4e6('0x3c')]);var _0x143be1={'where':_0x4a223a['where']};return db[_0xd4e6('0x3d')][_0xd4e6('0x1f')](_0x143be1)[_0xd4e6('0x23')](function(_0x454bb8){_0x5e9349[_0xd4e6('0x1f')]=_0x454bb8;if(_0x40467b[_0xd4e6('0x2f')]['includeAll']){_0x4a223a[_0xd4e6('0x3e')]=[{'all':!![]}];}return db[_0xd4e6('0x3d')][_0xd4e6('0x3f')](_0x4a223a);})[_0xd4e6('0x23')](function(_0x57dacc){_0x5e9349[_0xd4e6('0x40')]=_0x57dacc;return _0x5e9349;})[_0xd4e6('0x23')](respondWithFilteredResult(_0x5baca8,_0x4a223a))[_0xd4e6('0x41')](handleError(_0x5baca8,null));};exports['show']=function(_0x19f252,_0x40d004){var _0x313e9c={'raw':![],'where':{'id':_0x19f252['params']['id']}},_0x571777={};_0x571777[_0xd4e6('0x2e')]=_['keys'](db[_0xd4e6('0x3d')][_0xd4e6('0x2c')]);_0x571777[_0xd4e6('0x2f')]=_['keys'](_0x19f252['query']);_0x571777[_0xd4e6('0x30')]=_[_0xd4e6('0x31')](_0x571777['model'],_0x571777['query']);_0x313e9c[_0xd4e6('0x32')]=_[_0xd4e6('0x31')](_0x571777[_0xd4e6('0x2e')],qs['fields'](_0x19f252['query']['fields']));_0x313e9c[_0xd4e6('0x32')]=_0x313e9c['attributes'][_0xd4e6('0x34')]?_0x313e9c[_0xd4e6('0x32')]:_0x571777[_0xd4e6('0x2e')];if(_0x19f252[_0xd4e6('0x2f')]['includeAll']){_0x313e9c[_0xd4e6('0x3e')]=[{'all':!![]}];}_0x313e9c=_['merge']({},_0x313e9c,_0x19f252['options']);return db[_0xd4e6('0x3d')][_0xd4e6('0x42')](_0x313e9c)[_0xd4e6('0x23')](handleEntityNotFound(_0x40d004,null))['then'](respondWithResult(_0x40d004,null))['catch'](handleError(_0x40d004,null));};exports[_0xd4e6('0x43')]=function(_0x3a3ec5,_0x1cf3a2){return db[_0xd4e6('0x3d')][_0xd4e6('0x43')](_0x3a3ec5[_0xd4e6('0x44')],{})[_0xd4e6('0x23')](respondWithResult(_0x1cf3a2,0xc9))[_0xd4e6('0x41')](handleError(_0x1cf3a2,null));};exports[_0xd4e6('0x22')]=function(_0x415bdd,_0x338011){if(_0x415bdd[_0xd4e6('0x44')]['id']){delete _0x415bdd[_0xd4e6('0x44')]['id'];}return db[_0xd4e6('0x3d')][_0xd4e6('0x42')]({'where':{'id':_0x415bdd[_0xd4e6('0x45')]['id']}})[_0xd4e6('0x23')](handleEntityNotFound(_0x338011,null))[_0xd4e6('0x23')](saveUpdates(_0x415bdd['body'],null))[_0xd4e6('0x23')](respondWithResult(_0x338011,null))[_0xd4e6('0x41')](handleError(_0x338011,null));};exports[_0xd4e6('0x24')]=function(_0x3e6582,_0xfc1101){return db['ServicenowConfiguration'][_0xd4e6('0x42')]({'where':{'id':_0x3e6582[_0xd4e6('0x45')]['id']}})[_0xd4e6('0x23')](handleEntityNotFound(_0xfc1101,null))[_0xd4e6('0x23')](removeEntity(_0xfc1101,null))['catch'](handleError(_0xfc1101,null));};exports['getFields']=function(_0x5dd307,_0x82e5b6,_0x27dec1){var _0x4c8ad3={};var _0xad38d3={};var _0x582f76;var _0x4c1d7b;return db[_0xd4e6('0x3d')]['findOne']({'where':{'id':_0x5dd307[_0xd4e6('0x45')]['id']}})[_0xd4e6('0x23')](handleEntityNotFound(_0x82e5b6,null))[_0xd4e6('0x23')](function(_0xffa5c3){if(_0xffa5c3){_0x582f76=_0xffa5c3;_0xad38d3['model']=_[_0xd4e6('0x46')](db[_0xd4e6('0x47')][_0xd4e6('0x2c')]);_0xad38d3['query']=_[_0xd4e6('0x46')](_0x5dd307[_0xd4e6('0x2f')]);_0xad38d3[_0xd4e6('0x30')]=_['intersection'](_0xad38d3[_0xd4e6('0x2e')],_0xad38d3[_0xd4e6('0x2f')]);_0x4c8ad3['attributes']=_['intersection'](_0xad38d3['model'],qs[_0xd4e6('0x33')](_0x5dd307[_0xd4e6('0x2f')][_0xd4e6('0x33')]));_0x4c8ad3[_0xd4e6('0x32')]=_0x4c8ad3[_0xd4e6('0x32')][_0xd4e6('0x34')]?_0x4c8ad3['attributes']:_0xad38d3[_0xd4e6('0x2e')];_0x4c8ad3['order']=qs[_0xd4e6('0x36')](_0x5dd307['query']['sort']);_0x4c8ad3[_0xd4e6('0x37')]=qs[_0xd4e6('0x30')](_[_0xd4e6('0x38')](_0x5dd307[_0xd4e6('0x2f')],_0xad38d3[_0xd4e6('0x30')]));if(_0x5dd307[_0xd4e6('0x2f')][_0xd4e6('0x39')]){_0x4c8ad3['where']=_['merge'](_0x4c8ad3[_0xd4e6('0x37')],{'$or':_[_0xd4e6('0x2b')](_0x4c8ad3[_0xd4e6('0x32')],function(_0x40c97c){var _0x1a8834={};_0x1a8834[_0x40c97c]={'$like':'%'+_0x5dd307['query'][_0xd4e6('0x39')]+'%'};return _0x1a8834;})});}_0x4c8ad3=_[_0xd4e6('0x3a')]({},_0x4c8ad3,_0x5dd307[_0xd4e6('0x3c')]);return _0x582f76[_0xd4e6('0x48')](_0x4c8ad3);}})[_0xd4e6('0x23')](function(_0x3ca978){if(_0x3ca978){_0x4c1d7b=_0x3ca978[_0xd4e6('0x34')];if(!_0x5dd307[_0xd4e6('0x2f')][_0xd4e6('0x49')](_0xd4e6('0x4a'))){_0x4c8ad3['limit']=qs[_0xd4e6('0x1e')](_0x5dd307['query'][_0xd4e6('0x1e')]);_0x4c8ad3[_0xd4e6('0x1c')]=qs[_0xd4e6('0x1c')](_0x5dd307[_0xd4e6('0x2f')][_0xd4e6('0x1c')]);}return _0x582f76[_0xd4e6('0x48')](_0x4c8ad3);}})[_0xd4e6('0x23')](function(_0x15345d){if(_0x15345d){return _0x15345d?{'count':_0x4c1d7b,'rows':_0x15345d}:null;}})['then'](respondWithResult(_0x82e5b6,null))[_0xd4e6('0x41')](handleError(_0x82e5b6,null));};exports[_0xd4e6('0x4b')]=function(_0x20a280,_0x311024,_0x3009fd){var _0x185a05={};var _0x47c522={};var _0x334856;var _0x5192f3;return db[_0xd4e6('0x3d')]['findOne']({'where':{'id':_0x20a280[_0xd4e6('0x45')]['id']}})[_0xd4e6('0x23')](handleEntityNotFound(_0x311024,null))[_0xd4e6('0x23')](function(_0x310110){if(_0x310110){_0x334856=_0x310110;_0x47c522[_0xd4e6('0x2e')]=_['keys'](db[_0xd4e6('0x47')][_0xd4e6('0x2c')]);_0x47c522[_0xd4e6('0x2f')]=_[_0xd4e6('0x46')](_0x20a280[_0xd4e6('0x2f')]);_0x47c522['filters']=_[_0xd4e6('0x31')](_0x47c522[_0xd4e6('0x2e')],_0x47c522[_0xd4e6('0x2f')]);_0x185a05['attributes']=_[_0xd4e6('0x31')](_0x47c522[_0xd4e6('0x2e')],qs[_0xd4e6('0x33')](_0x20a280[_0xd4e6('0x2f')][_0xd4e6('0x33')]));_0x185a05[_0xd4e6('0x32')]=_0x185a05[_0xd4e6('0x32')][_0xd4e6('0x34')]?_0x185a05['attributes']:_0x47c522[_0xd4e6('0x2e')];_0x185a05[_0xd4e6('0x35')]=qs[_0xd4e6('0x36')](_0x20a280[_0xd4e6('0x2f')]['sort']);_0x185a05['where']=qs[_0xd4e6('0x30')](_[_0xd4e6('0x38')](_0x20a280['query'],_0x47c522['filters']));if(_0x20a280[_0xd4e6('0x2f')][_0xd4e6('0x39')]){_0x185a05[_0xd4e6('0x37')]=_['merge'](_0x185a05[_0xd4e6('0x37')],{'$or':_[_0xd4e6('0x2b')](_0x185a05[_0xd4e6('0x32')],function(_0x561c19){var _0x1cedee={};_0x1cedee[_0x561c19]={'$like':'%'+_0x20a280['query'][_0xd4e6('0x39')]+'%'};return _0x1cedee;})});}_0x185a05=_['merge']({},_0x185a05,_0x20a280[_0xd4e6('0x3c')]);return _0x334856[_0xd4e6('0x4b')](_0x185a05);}})[_0xd4e6('0x23')](function(_0x2aab16){if(_0x2aab16){_0x5192f3=_0x2aab16[_0xd4e6('0x34')];if(!_0x20a280['query'][_0xd4e6('0x49')](_0xd4e6('0x4a'))){_0x185a05[_0xd4e6('0x1e')]=qs[_0xd4e6('0x1e')](_0x20a280['query'][_0xd4e6('0x1e')]);_0x185a05[_0xd4e6('0x1c')]=qs[_0xd4e6('0x1c')](_0x20a280[_0xd4e6('0x2f')][_0xd4e6('0x1c')]);}return _0x334856[_0xd4e6('0x4b')](_0x185a05);}})['then'](function(_0x46933f){if(_0x46933f){return _0x46933f?{'count':_0x5192f3,'rows':_0x46933f}:null;}})[_0xd4e6('0x23')](respondWithResult(_0x311024,null))[_0xd4e6('0x41')](handleError(_0x311024,null));};exports[_0xd4e6('0x4c')]=function(_0x51ed2c,_0x1c0c2a,_0x381ae1){var _0x44318c={};var _0x59e5bd={};var _0x36920a;var _0x258528;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x51ed2c['params']['id']}})['then'](handleEntityNotFound(_0x1c0c2a,null))[_0xd4e6('0x23')](function(_0x472151){if(_0x472151){_0x36920a=_0x472151;_0x59e5bd[_0xd4e6('0x2e')]=_[_0xd4e6('0x46')](db[_0xd4e6('0x47')]['rawAttributes']);_0x59e5bd[_0xd4e6('0x2f')]=_[_0xd4e6('0x46')](_0x51ed2c[_0xd4e6('0x2f')]);_0x59e5bd['filters']=_[_0xd4e6('0x31')](_0x59e5bd[_0xd4e6('0x2e')],_0x59e5bd[_0xd4e6('0x2f')]);_0x44318c[_0xd4e6('0x32')]=_[_0xd4e6('0x31')](_0x59e5bd[_0xd4e6('0x2e')],qs[_0xd4e6('0x33')](_0x51ed2c[_0xd4e6('0x2f')][_0xd4e6('0x33')]));_0x44318c[_0xd4e6('0x32')]=_0x44318c[_0xd4e6('0x32')][_0xd4e6('0x34')]?_0x44318c[_0xd4e6('0x32')]:_0x59e5bd['model'];_0x44318c[_0xd4e6('0x35')]=qs['sort'](_0x51ed2c[_0xd4e6('0x2f')]['sort']);_0x44318c[_0xd4e6('0x37')]=qs['filters'](_[_0xd4e6('0x38')](_0x51ed2c[_0xd4e6('0x2f')],_0x59e5bd[_0xd4e6('0x30')]));if(_0x51ed2c['query'][_0xd4e6('0x39')]){_0x44318c[_0xd4e6('0x37')]=_['merge'](_0x44318c[_0xd4e6('0x37')],{'$or':_[_0xd4e6('0x2b')](_0x44318c['attributes'],function(_0x51ba82){var _0x270d1d={};_0x270d1d[_0x51ba82]={'$like':'%'+_0x51ed2c[_0xd4e6('0x2f')][_0xd4e6('0x39')]+'%'};return _0x270d1d;})});}_0x44318c=_[_0xd4e6('0x3a')]({},_0x44318c,_0x51ed2c[_0xd4e6('0x3c')]);return _0x36920a[_0xd4e6('0x4c')](_0x44318c);}})[_0xd4e6('0x23')](function(_0x1804d3){if(_0x1804d3){_0x258528=_0x1804d3[_0xd4e6('0x34')];if(!_0x51ed2c[_0xd4e6('0x2f')]['hasOwnProperty'](_0xd4e6('0x4a'))){_0x44318c[_0xd4e6('0x1e')]=qs[_0xd4e6('0x1e')](_0x51ed2c[_0xd4e6('0x2f')][_0xd4e6('0x1e')]);_0x44318c[_0xd4e6('0x1c')]=qs['offset'](_0x51ed2c[_0xd4e6('0x2f')]['offset']);}return _0x36920a['getDescriptions'](_0x44318c);}})[_0xd4e6('0x23')](function(_0x963a61){if(_0x963a61){return _0x963a61?{'count':_0x258528,'rows':_0x963a61}:null;}})['then'](respondWithResult(_0x1c0c2a,null))[_0xd4e6('0x41')](handleError(_0x1c0c2a,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 6759ca6..05359b9 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 _0xb2f3=['rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','int_servicenow_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5c0dcb,_0x16cd83){var _0x183a0e=function(_0xfb292d){while(--_0xfb292d){_0x5c0dcb['push'](_0x5c0dcb['shift']());}};_0x183a0e(++_0x16cd83);}(_0xb2f3,0xfd));var _0x3b2f=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0xb2f3[_0x4b7895];return _0x264180;};'use strict';var _=require(_0x3b2f('0x0'));var util=require(_0x3b2f('0x1'));var logger=require(_0x3b2f('0x2'))(_0x3b2f('0x3'));var moment=require(_0x3b2f('0x4'));var BPromise=require(_0x3b2f('0x5'));var rp=require(_0x3b2f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3b2f('0x7'));var config=require(_0x3b2f('0x8'));var attributes=require(_0x3b2f('0x9'));module[_0x3b2f('0xa')]=function(_0x1879cf,_0xa38042){return _0x1879cf[_0x3b2f('0xb')]('ServicenowConfiguration',attributes,{'tableName':_0x3b2f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfd6f=['rimraf','../../config/environment','exports','define','int_servicenow_configurations','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x565e4d,_0x23d683){var _0x47e665=function(_0x85d9e){while(--_0x85d9e){_0x565e4d['push'](_0x565e4d['shift']());}};_0x47e665(++_0x23d683);}(_0xfd6f,0x19d));var _0xffd6=function(_0x7e70ab,_0x4aeaf5){_0x7e70ab=_0x7e70ab-0x0;var _0x24e291=_0xfd6f[_0x7e70ab];return _0x24e291;};'use strict';var _=require(_0xffd6('0x0'));var util=require(_0xffd6('0x1'));var logger=require(_0xffd6('0x2'))(_0xffd6('0x3'));var moment=require(_0xffd6('0x4'));var BPromise=require('bluebird');var rp=require(_0xffd6('0x5'));var fs=require('fs');var path=require(_0xffd6('0x6'));var rimraf=require(_0xffd6('0x7'));var config=require(_0xffd6('0x8'));var attributes=require('./intServicenowConfiguration.attributes');module[_0xffd6('0x9')]=function(_0x380073,_0x3f3cd8){return _0x380073[_0xffd6('0xa')]('ServicenowConfiguration',attributes,{'tableName':_0xffd6('0xb'),'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 2bbd2bb..b14717a 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 _0xe45e=['debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','code','error','ServicenowConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','jayson/promise','http','then','info','request\x20sent'];(function(_0x3b0d12,_0x581b78){var _0x44eb08=function(_0x40632d){while(--_0x40632d){_0x3b0d12['push'](_0x3b0d12['shift']());}};_0x44eb08(++_0x581b78);}(_0xe45e,0x1c0));var _0xee45=function(_0x172747,_0x1732bd){_0x172747=_0x172747-0x0;var _0x509692=_0xe45e[_0x172747];return _0x509692;};'use strict';var _=require(_0xee45('0x0'));var util=require(_0xee45('0x1'));var moment=require(_0xee45('0x2'));var BPromise=require(_0xee45('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee45('0x4'));var db=require(_0xee45('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xee45('0x6'));var config=require('../../config/environment');var jayson=require(_0xee45('0x7'));var client=jayson['client'][_0xee45('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x139dad,_0x52f80b,_0x41a3db){return new BPromise(function(_0xd7488b,_0x47bb54){return client['request'](_0x139dad,_0x41a3db)[_0xee45('0x9')](function(_0x272373){logger[_0xee45('0xa')]('ServicenowConfiguration,\x20%s,\x20%s',_0x52f80b,_0xee45('0xb'));logger[_0xee45('0xc')](_0xee45('0xd'),_0x52f80b,_0xee45('0xb'),JSON['stringify'](_0x272373));if(_0x272373['error']){if(_0x272373['error'][_0xee45('0xe')]===0x1f4){logger[_0xee45('0xf')](_0xee45('0x10'),_0x52f80b,_0x272373[_0xee45('0xf')][_0xee45('0x11')]);return _0x47bb54(_0x272373['error'][_0xee45('0x11')]);}logger[_0xee45('0xf')](_0xee45('0x10'),_0x52f80b,_0x272373[_0xee45('0xf')][_0xee45('0x11')]);return _0xd7488b(_0x272373[_0xee45('0xf')][_0xee45('0x11')]);}else{logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x52f80b,'request\x20sent');_0xd7488b(_0x272373[_0xee45('0x12')][_0xee45('0x11')]);}})[_0xee45('0x13')](function(_0x465ba7){logger[_0xee45('0xf')]('ServicenowConfiguration,\x20%s,\x20%s',_0x52f80b,_0x465ba7);_0x47bb54(_0x465ba7);});});} \ No newline at end of file +var _0x4c58=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','code','message','error','result'];(function(_0x4667b2,_0x135b67){var _0x1070f2=function(_0xa72ca5){while(--_0xa72ca5){_0x4667b2['push'](_0x4667b2['shift']());}};_0x1070f2(++_0x135b67);}(_0x4c58,0x18f));var _0x84c5=function(_0x54ba9d,_0x3adcce){_0x54ba9d=_0x54ba9d-0x0;var _0x37c24e=_0x4c58[_0x54ba9d];return _0x37c24e;};'use strict';var _=require(_0x84c5('0x0'));var util=require(_0x84c5('0x1'));var moment=require(_0x84c5('0x2'));var BPromise=require(_0x84c5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x84c5('0x4'));var db=require(_0x84c5('0x5'))['db'];var utils=require(_0x84c5('0x6'));var logger=require(_0x84c5('0x7'))(_0x84c5('0x8'));var config=require(_0x84c5('0x9'));var jayson=require(_0x84c5('0xa'));var client=jayson[_0x84c5('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4eba35,_0x2bfbc7,_0x1dee32){return new BPromise(function(_0x187b1d,_0x358c72){return client[_0x84c5('0xc')](_0x4eba35,_0x1dee32)[_0x84c5('0xd')](function(_0x56868e){logger[_0x84c5('0xe')](_0x84c5('0xf'),_0x2bfbc7,'request\x20sent');logger['debug']('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x2bfbc7,_0x84c5('0x10'),JSON['stringify'](_0x56868e));if(_0x56868e['error']){if(_0x56868e['error'][_0x84c5('0x11')]===0x1f4){logger['error'](_0x84c5('0xf'),_0x2bfbc7,_0x56868e['error'][_0x84c5('0x12')]);return _0x358c72(_0x56868e[_0x84c5('0x13')]['message']);}logger[_0x84c5('0x13')]('ServicenowConfiguration,\x20%s,\x20%s',_0x2bfbc7,_0x56868e[_0x84c5('0x13')][_0x84c5('0x12')]);return _0x187b1d(_0x56868e[_0x84c5('0x13')][_0x84c5('0x12')]);}else{logger[_0x84c5('0xe')]('ServicenowConfiguration,\x20%s,\x20%s',_0x2bfbc7,_0x84c5('0x10'));_0x187b1d(_0x56868e[_0x84c5('0x14')][_0x84c5('0x12')]);}})['catch'](function(_0x5e2b95){logger[_0x84c5('0x13')](_0x84c5('0xf'),_0x2bfbc7,_0x5e2b95);_0x358c72(_0x5e2b95);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 42c1162..c721a6d 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 _0x3db3=['/:id','show','create','put','update','destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x4df33d,_0x580bd7){var _0x1705f0=function(_0x5cd5b2){while(--_0x5cd5b2){_0x4df33d['push'](_0x4df33d['shift']());}};_0x1705f0(++_0x580bd7);}(_0x3db3,0x196));var _0x33db=function(_0x52036a,_0xd14367){_0x52036a=_0x52036a-0x0;var _0x1b1ac8=_0x3db3[_0x52036a];return _0x1b1ac8;};'use strict';var multer=require('multer');var util=require(_0x33db('0x0'));var path=require('path');var timeout=require(_0x33db('0x1'));var express=require(_0x33db('0x2'));var router=express[_0x33db('0x3')]();var fs_extra=require(_0x33db('0x4'));var auth=require(_0x33db('0x5'));var interaction=require(_0x33db('0x6'));var config=require(_0x33db('0x7'));var controller=require('./intServicenowField.controller');router[_0x33db('0x8')]('/',auth[_0x33db('0x9')](),controller['index']);router['get'](_0x33db('0xa'),auth[_0x33db('0x9')](),controller[_0x33db('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x33db('0xc')]);router[_0x33db('0xd')](_0x33db('0xa'),auth['isAuthenticated'](),controller[_0x33db('0xe')]);router['delete'](_0x33db('0xa'),auth[_0x33db('0x9')](),controller[_0x33db('0xf')]);module['exports']=router; \ No newline at end of file +var _0x9181=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','/:id','show','create','update','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x5553ea,_0x38287b){var _0x50ee2c=function(_0x9d54be){while(--_0x9d54be){_0x5553ea['push'](_0x5553ea['shift']());}};_0x50ee2c(++_0x38287b);}(_0x9181,0x1f4));var _0x1918=function(_0x775736,_0x2ba67d){_0x775736=_0x775736-0x0;var _0x5b032f=_0x9181[_0x775736];return _0x5b032f;};'use strict';var multer=require('multer');var util=require(_0x1918('0x0'));var path=require(_0x1918('0x1'));var timeout=require(_0x1918('0x2'));var express=require(_0x1918('0x3'));var router=express[_0x1918('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1918('0x5'));var interaction=require(_0x1918('0x6'));var config=require(_0x1918('0x7'));var controller=require(_0x1918('0x8'));router[_0x1918('0x9')]('/',auth[_0x1918('0xa')](),controller['index']);router[_0x1918('0x9')](_0x1918('0xb'),auth['isAuthenticated'](),controller[_0x1918('0xc')]);router['post']('/',auth[_0x1918('0xa')](),controller[_0x1918('0xd')]);router['put'](_0x1918('0xb'),auth[_0x1918('0xa')](),controller[_0x1918('0xe')]);router[_0x1918('0xf')]('/:id',auth[_0x1918('0xa')](),controller[_0x1918('0x10')]);module[_0x1918('0x11')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 4012b4f..67e7ba6 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 _0xffcc=['keyValue','string','STRING','variable','sequelize','ENUM','customVariable'];(function(_0x29e35f,_0x4859ef){var _0x266b74=function(_0xc09e1){while(--_0xc09e1){_0x29e35f['push'](_0x29e35f['shift']());}};_0x266b74(++_0x4859ef);}(_0xffcc,0xf2));var _0xcffc=function(_0x490c82,_0x242972){_0x490c82=_0x490c82-0x0;var _0x43824e=_0xffcc[_0x490c82];return _0x43824e;};'use strict';var Sequelize=require(_0xcffc('0x0'));module['exports']={'type':{'type':Sequelize[_0xcffc('0x1')]('string','variable',_0xcffc('0x2'),_0xcffc('0x3'),'picklist'),'defaultValue':_0xcffc('0x4')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xcffc('0x5')]},'keyType':{'type':Sequelize[_0xcffc('0x1')](_0xcffc('0x4'),_0xcffc('0x6'),'customVariable')},'keyContent':{'type':Sequelize[_0xcffc('0x5')]},'idField':{'type':Sequelize[_0xcffc('0x5')]},'nameField':{'type':Sequelize[_0xcffc('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xcffc('0x5')]}}; \ No newline at end of file +var _0xbb19=['customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable'];(function(_0x3c10e0,_0x4e4524){var _0x4a16be=function(_0x477b19){while(--_0x477b19){_0x3c10e0['push'](_0x3c10e0['shift']());}};_0x4a16be(++_0x4e4524);}(_0xbb19,0x1d1));var _0x9bb1=function(_0x94eff1,_0x47ced5){_0x94eff1=_0x94eff1-0x0;var _0x3c2dac=_0xbb19[_0x94eff1];return _0x3c2dac;};'use strict';var Sequelize=require(_0x9bb1('0x0'));module[_0x9bb1('0x1')]={'type':{'type':Sequelize[_0x9bb1('0x2')](_0x9bb1('0x3'),_0x9bb1('0x4'),_0x9bb1('0x5'),_0x9bb1('0x6'),_0x9bb1('0x7')),'defaultValue':_0x9bb1('0x3')},'content':{'type':Sequelize[_0x9bb1('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x9bb1('0x2')](_0x9bb1('0x3'),'variable',_0x9bb1('0x5'))},'keyContent':{'type':Sequelize[_0x9bb1('0x8')]},'idField':{'type':Sequelize[_0x9bb1('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x9bb1('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9bb1('0x8')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index ec164c6..8be0b69 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 _0xb2fa=['query','filters','attributes','intersection','fields','length','hasOwnProperty','sort','filter','where','merge','VIRTUAL','options','ServicenowField','show','params','includeAll','include','find','catch','create','body','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','stack','name','send','rawAttributes','fieldName','key','model','map','keys'];(function(_0x542bd3,_0x4f2a75){var _0x13c22c=function(_0x376d4e){while(--_0x376d4e){_0x542bd3['push'](_0x542bd3['shift']());}};_0x13c22c(++_0x4f2a75);}(_0xb2fa,0x12e));var _0xab2f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb2fa[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xab2f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xab2f('0x1'));var rp=require(_0xab2f('0x2'));var moment=require(_0xab2f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xab2f('0x4'));var util=require(_0xab2f('0x5'));var path=require(_0xab2f('0x6'));var sox=require(_0xab2f('0x7'));var csv=require('to-csv');var ejs=require(_0xab2f('0x8'));var fs=require('fs');var fs_extra=require(_0xab2f('0x9'));var _=require(_0xab2f('0xa'));var squel=require(_0xab2f('0xb'));var crypto=require(_0xab2f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xab2f('0xd'));var toCsv=require('to-csv');var querystring=require(_0xab2f('0xe'));var Papa=require(_0xab2f('0xf'));var Redis=require(_0xab2f('0x10'));var authService=require(_0xab2f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xab2f('0x12'));var hardwareService=require(_0xab2f('0x13'));var logger=require(_0xab2f('0x14'))(_0xab2f('0x15'));var utils=require(_0xab2f('0x16'));var config=require(_0xab2f('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xab2f('0x18'))['db'];function respondWithStatusCode(_0x534485,_0x2c77f6){_0x2c77f6=_0x2c77f6||0xcc;return function(_0x1a5c64){if(_0x1a5c64){return _0x534485[_0xab2f('0x19')](_0x2c77f6);}return _0x534485[_0xab2f('0x1a')](_0x2c77f6)[_0xab2f('0x1b')]();};}function respondWithResult(_0x349cfd,_0x3f6e42){_0x3f6e42=_0x3f6e42||0xc8;return function(_0x2f6dad){if(_0x2f6dad){return _0x349cfd[_0xab2f('0x1a')](_0x3f6e42)[_0xab2f('0x1c')](_0x2f6dad);}};}function respondWithFilteredResult(_0x479e44,_0x53f692){return function(_0x254b32){if(_0x254b32){var _0x4d371c=typeof _0x53f692[_0xab2f('0x1d')]===_0xab2f('0x1e')&&typeof _0x53f692[_0xab2f('0x1f')]===_0xab2f('0x1e');var _0x40ca26=_0x254b32[_0xab2f('0x20')];var _0x34259c=_0x4d371c?0x0:_0x53f692[_0xab2f('0x1d')];var _0x1f112b=_0x4d371c?_0x254b32[_0xab2f('0x20')]:_0x53f692[_0xab2f('0x1d')]+_0x53f692['limit'];var _0xb20ce3;if(_0x1f112b>=_0x40ca26){_0x1f112b=_0x40ca26;_0xb20ce3=0xc8;}else{_0xb20ce3=0xce;}_0x479e44[_0xab2f('0x1a')](_0xb20ce3);return _0x479e44[_0xab2f('0x21')](_0xab2f('0x22'),_0x34259c+'-'+_0x1f112b+'/'+_0x40ca26)[_0xab2f('0x1c')](_0x254b32);}return null;};}function patchUpdates(_0x4b5253){return function(_0x2f68e0){try{jsonpatch['apply'](_0x2f68e0,_0x4b5253,!![]);}catch(_0x361a04){return BPromise[_0xab2f('0x23')](_0x361a04);}return _0x2f68e0['save']();};}function saveUpdates(_0x57d4c9,_0x431dc1){return function(_0x2d8bac){if(_0x2d8bac){return _0x2d8bac[_0xab2f('0x24')](_0x57d4c9)[_0xab2f('0x25')](function(_0x4019b6){return _0x4019b6;});}return null;};}function removeEntity(_0x136987,_0x509f18){return function(_0x3ceb09){if(_0x3ceb09){return _0x3ceb09[_0xab2f('0x26')]()[_0xab2f('0x25')](function(){_0x136987[_0xab2f('0x1a')](0xcc)[_0xab2f('0x1b')]();});}};}function handleEntityNotFound(_0x22acfe,_0x4338ae){return function(_0x9eb7c9){if(!_0x9eb7c9){_0x22acfe[_0xab2f('0x19')](0x194);}return _0x9eb7c9;};}function handleError(_0x26919f,_0x11f03d){_0x11f03d=_0x11f03d||0x1f4;return function(_0x1abb7c){logger['error'](_0x1abb7c[_0xab2f('0x27')]);if(_0x1abb7c[_0xab2f('0x28')]){delete _0x1abb7c[_0xab2f('0x28')];}_0x26919f[_0xab2f('0x1a')](_0x11f03d)[_0xab2f('0x29')](_0x1abb7c);};}exports['index']=function(_0x4f9438,_0x79bd48){var _0x4bd044={},_0x2b725d={},_0x1ef3de={'count':0x0,'rows':[]};var _0x5b9e6b=_['map'](db['ServicenowField'][_0xab2f('0x2a')],function(_0x5191a6){return{'name':_0x5191a6[_0xab2f('0x2b')],'type':_0x5191a6['type'][_0xab2f('0x2c')]};});_0x2b725d[_0xab2f('0x2d')]=_[_0xab2f('0x2e')](_0x5b9e6b,_0xab2f('0x28'));_0x2b725d['query']=_[_0xab2f('0x2f')](_0x4f9438[_0xab2f('0x30')]);_0x2b725d[_0xab2f('0x31')]=_['intersection'](_0x2b725d['model'],_0x2b725d[_0xab2f('0x30')]);_0x4bd044[_0xab2f('0x32')]=_[_0xab2f('0x33')](_0x2b725d[_0xab2f('0x2d')],qs[_0xab2f('0x34')](_0x4f9438[_0xab2f('0x30')][_0xab2f('0x34')]));_0x4bd044[_0xab2f('0x32')]=_0x4bd044[_0xab2f('0x32')][_0xab2f('0x35')]?_0x4bd044[_0xab2f('0x32')]:_0x2b725d[_0xab2f('0x2d')];if(!_0x4f9438[_0xab2f('0x30')][_0xab2f('0x36')]('nolimit')){_0x4bd044[_0xab2f('0x1f')]=qs[_0xab2f('0x1f')](_0x4f9438['query']['limit']);_0x4bd044[_0xab2f('0x1d')]=qs['offset'](_0x4f9438[_0xab2f('0x30')][_0xab2f('0x1d')]);}_0x4bd044['order']=qs[_0xab2f('0x37')](_0x4f9438['query'][_0xab2f('0x37')]);_0x4bd044['where']=qs[_0xab2f('0x31')](_['pick'](_0x4f9438[_0xab2f('0x30')],_0x2b725d[_0xab2f('0x31')]),_0x5b9e6b);if(_0x4f9438[_0xab2f('0x30')][_0xab2f('0x38')]){_0x4bd044[_0xab2f('0x39')]=_[_0xab2f('0x3a')](_0x4bd044[_0xab2f('0x39')],{'$or':_[_0xab2f('0x2e')](_0x5b9e6b,function(_0x306f78){if(_0x306f78['type']!==_0xab2f('0x3b')){var _0x462ce6={};_0x462ce6[_0x306f78[_0xab2f('0x28')]]={'$like':'%'+_0x4f9438[_0xab2f('0x30')][_0xab2f('0x38')]+'%'};return _0x462ce6;}})});}_0x4bd044=_[_0xab2f('0x3a')]({},_0x4bd044,_0x4f9438[_0xab2f('0x3c')]);var _0x1fadaf={'where':_0x4bd044[_0xab2f('0x39')]};return db[_0xab2f('0x3d')]['count'](_0x1fadaf)[_0xab2f('0x25')](function(_0x100f29){_0x1ef3de['count']=_0x100f29;if(_0x4f9438[_0xab2f('0x30')]['includeAll']){_0x4bd044['include']=[{'all':!![]}];}return db[_0xab2f('0x3d')]['findAll'](_0x4bd044);})[_0xab2f('0x25')](function(_0x130eef){_0x1ef3de['rows']=_0x130eef;return _0x1ef3de;})[_0xab2f('0x25')](respondWithFilteredResult(_0x79bd48,_0x4bd044))['catch'](handleError(_0x79bd48,null));};exports[_0xab2f('0x3e')]=function(_0x117cc2,_0x416838){var _0x12db50={'raw':!![],'where':{'id':_0x117cc2[_0xab2f('0x3f')]['id']}},_0x58dbdc={};_0x58dbdc[_0xab2f('0x2d')]=_[_0xab2f('0x2f')](db[_0xab2f('0x3d')][_0xab2f('0x2a')]);_0x58dbdc[_0xab2f('0x30')]=_['keys'](_0x117cc2['query']);_0x58dbdc['filters']=_[_0xab2f('0x33')](_0x58dbdc[_0xab2f('0x2d')],_0x58dbdc[_0xab2f('0x30')]);_0x12db50[_0xab2f('0x32')]=_['intersection'](_0x58dbdc['model'],qs[_0xab2f('0x34')](_0x117cc2[_0xab2f('0x30')][_0xab2f('0x34')]));_0x12db50['attributes']=_0x12db50[_0xab2f('0x32')][_0xab2f('0x35')]?_0x12db50['attributes']:_0x58dbdc['model'];if(_0x117cc2[_0xab2f('0x30')][_0xab2f('0x40')]){_0x12db50[_0xab2f('0x41')]=[{'all':!![]}];}_0x12db50=_[_0xab2f('0x3a')]({},_0x12db50,_0x117cc2['options']);return db[_0xab2f('0x3d')][_0xab2f('0x42')](_0x12db50)[_0xab2f('0x25')](handleEntityNotFound(_0x416838,null))[_0xab2f('0x25')](respondWithResult(_0x416838,null))[_0xab2f('0x43')](handleError(_0x416838,null));};exports[_0xab2f('0x44')]=function(_0x321f79,_0x2c773f){return db[_0xab2f('0x3d')]['create'](_0x321f79[_0xab2f('0x45')],{})['then'](respondWithResult(_0x2c773f,0xc9))[_0xab2f('0x43')](handleError(_0x2c773f,null));};exports[_0xab2f('0x24')]=function(_0x26f093,_0x29e551){if(_0x26f093[_0xab2f('0x45')]['id']){delete _0x26f093['body']['id'];}return db[_0xab2f('0x3d')][_0xab2f('0x42')]({'where':{'id':_0x26f093[_0xab2f('0x3f')]['id']}})[_0xab2f('0x25')](handleEntityNotFound(_0x29e551,null))[_0xab2f('0x25')](saveUpdates(_0x26f093[_0xab2f('0x45')],null))[_0xab2f('0x25')](respondWithResult(_0x29e551,null))[_0xab2f('0x43')](handleError(_0x29e551,null));};exports[_0xab2f('0x26')]=function(_0x170f5c,_0x34d249){return db[_0xab2f('0x3d')]['find']({'where':{'id':_0x170f5c[_0xab2f('0x3f')]['id']}})[_0xab2f('0x25')](handleEntityNotFound(_0x34d249,null))[_0xab2f('0x25')](removeEntity(_0x34d249,null))[_0xab2f('0x43')](handleError(_0x34d249,null));}; \ No newline at end of file +var _0x5d0e=['querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','fieldName','type','key','model','map','query','keys','intersection','attributes','nolimit','sort','where','pick','filters','filter','VIRTUAL','options','includeAll','include','findAll','rows','params','ServicenowField','rawAttributes','fields','length','merge','find','catch','create','body','eml-format','rimraf','fast-json-patch','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x5d0e,0x1af));var _0xe5d0=function(_0x1b06e8,_0x40463){_0x1b06e8=_0x1b06e8-0x0;var _0x219a98=_0x5d0e[_0x1b06e8];return _0x219a98;};'use strict';var emlformat=require(_0xe5d0('0x0'));var rimraf=require(_0xe5d0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe5d0('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe5d0('0x3'));var Mustache=require('mustache');var util=require(_0xe5d0('0x4'));var path=require(_0xe5d0('0x5'));var sox=require(_0xe5d0('0x6'));var csv=require('to-csv');var ejs=require(_0xe5d0('0x7'));var fs=require('fs');var fs_extra=require(_0xe5d0('0x8'));var _=require('lodash');var squel=require(_0xe5d0('0x9'));var crypto=require(_0xe5d0('0xa'));var jsforce=require(_0xe5d0('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xe5d0('0xc'));var querystring=require(_0xe5d0('0xd'));var Papa=require('papaparse');var Redis=require(_0xe5d0('0xe'));var authService=require(_0xe5d0('0xf'));var qs=require(_0xe5d0('0x10'));var as=require(_0xe5d0('0x11'));var hardwareService=require(_0xe5d0('0x12'));var logger=require(_0xe5d0('0x13'))(_0xe5d0('0x14'));var utils=require(_0xe5d0('0x15'));var config=require(_0xe5d0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe5d0('0x17'))['db'];function respondWithStatusCode(_0x880026,_0xcd8cd6){_0xcd8cd6=_0xcd8cd6||0xcc;return function(_0x39a783){if(_0x39a783){return _0x880026['sendStatus'](_0xcd8cd6);}return _0x880026['status'](_0xcd8cd6)[_0xe5d0('0x18')]();};}function respondWithResult(_0x205529,_0x405e0e){_0x405e0e=_0x405e0e||0xc8;return function(_0x57b21c){if(_0x57b21c){return _0x205529[_0xe5d0('0x19')](_0x405e0e)[_0xe5d0('0x1a')](_0x57b21c);}};}function respondWithFilteredResult(_0x34278d,_0x95900e){return function(_0x58faf5){if(_0x58faf5){var _0x5571a8=typeof _0x95900e[_0xe5d0('0x1b')]===_0xe5d0('0x1c')&&typeof _0x95900e[_0xe5d0('0x1d')]===_0xe5d0('0x1c');var _0x4f5e62=_0x58faf5[_0xe5d0('0x1e')];var _0x5e12ed=_0x5571a8?0x0:_0x95900e['offset'];var _0x167c27=_0x5571a8?_0x58faf5[_0xe5d0('0x1e')]:_0x95900e[_0xe5d0('0x1b')]+_0x95900e[_0xe5d0('0x1d')];var _0x2b5ec7;if(_0x167c27>=_0x4f5e62){_0x167c27=_0x4f5e62;_0x2b5ec7=0xc8;}else{_0x2b5ec7=0xce;}_0x34278d[_0xe5d0('0x19')](_0x2b5ec7);return _0x34278d[_0xe5d0('0x1f')]('Content-Range',_0x5e12ed+'-'+_0x167c27+'/'+_0x4f5e62)[_0xe5d0('0x1a')](_0x58faf5);}return null;};}function patchUpdates(_0x5a4e1a){return function(_0x453428){try{jsonpatch[_0xe5d0('0x20')](_0x453428,_0x5a4e1a,!![]);}catch(_0x12eda1){return BPromise[_0xe5d0('0x21')](_0x12eda1);}return _0x453428[_0xe5d0('0x22')]();};}function saveUpdates(_0x1822b1,_0x251507){return function(_0x11874d){if(_0x11874d){return _0x11874d[_0xe5d0('0x23')](_0x1822b1)[_0xe5d0('0x24')](function(_0x2075b5){return _0x2075b5;});}return null;};}function removeEntity(_0x33bebd,_0x3e04bd){return function(_0x30f0e9){if(_0x30f0e9){return _0x30f0e9[_0xe5d0('0x25')]()['then'](function(){_0x33bebd[_0xe5d0('0x19')](0xcc)[_0xe5d0('0x18')]();});}};}function handleEntityNotFound(_0x52934b,_0x3f6c5c){return function(_0x4d22bc){if(!_0x4d22bc){_0x52934b['sendStatus'](0x194);}return _0x4d22bc;};}function handleError(_0x143c34,_0x59a36f){_0x59a36f=_0x59a36f||0x1f4;return function(_0x5934bc){logger[_0xe5d0('0x26')](_0x5934bc[_0xe5d0('0x27')]);if(_0x5934bc[_0xe5d0('0x28')]){delete _0x5934bc['name'];}_0x143c34[_0xe5d0('0x19')](_0x59a36f)[_0xe5d0('0x29')](_0x5934bc);};}exports[_0xe5d0('0x2a')]=function(_0x5c250c,_0x46a53e){var _0x4da934={},_0x485d3c={},_0x238c16={'count':0x0,'rows':[]};var _0xd45184=_['map'](db['ServicenowField']['rawAttributes'],function(_0x1ebca9){return{'name':_0x1ebca9[_0xe5d0('0x2b')],'type':_0x1ebca9[_0xe5d0('0x2c')][_0xe5d0('0x2d')]};});_0x485d3c[_0xe5d0('0x2e')]=_[_0xe5d0('0x2f')](_0xd45184,'name');_0x485d3c[_0xe5d0('0x30')]=_[_0xe5d0('0x31')](_0x5c250c['query']);_0x485d3c['filters']=_[_0xe5d0('0x32')](_0x485d3c[_0xe5d0('0x2e')],_0x485d3c[_0xe5d0('0x30')]);_0x4da934[_0xe5d0('0x33')]=_[_0xe5d0('0x32')](_0x485d3c[_0xe5d0('0x2e')],qs['fields'](_0x5c250c[_0xe5d0('0x30')]['fields']));_0x4da934['attributes']=_0x4da934['attributes']['length']?_0x4da934[_0xe5d0('0x33')]:_0x485d3c[_0xe5d0('0x2e')];if(!_0x5c250c[_0xe5d0('0x30')]['hasOwnProperty'](_0xe5d0('0x34'))){_0x4da934[_0xe5d0('0x1d')]=qs[_0xe5d0('0x1d')](_0x5c250c[_0xe5d0('0x30')]['limit']);_0x4da934[_0xe5d0('0x1b')]=qs[_0xe5d0('0x1b')](_0x5c250c[_0xe5d0('0x30')][_0xe5d0('0x1b')]);}_0x4da934['order']=qs[_0xe5d0('0x35')](_0x5c250c[_0xe5d0('0x30')][_0xe5d0('0x35')]);_0x4da934[_0xe5d0('0x36')]=qs['filters'](_[_0xe5d0('0x37')](_0x5c250c[_0xe5d0('0x30')],_0x485d3c[_0xe5d0('0x38')]),_0xd45184);if(_0x5c250c[_0xe5d0('0x30')][_0xe5d0('0x39')]){_0x4da934[_0xe5d0('0x36')]=_['merge'](_0x4da934[_0xe5d0('0x36')],{'$or':_[_0xe5d0('0x2f')](_0xd45184,function(_0x1aa89c){if(_0x1aa89c[_0xe5d0('0x2c')]!==_0xe5d0('0x3a')){var _0x530228={};_0x530228[_0x1aa89c['name']]={'$like':'%'+_0x5c250c[_0xe5d0('0x30')][_0xe5d0('0x39')]+'%'};return _0x530228;}})});}_0x4da934=_['merge']({},_0x4da934,_0x5c250c[_0xe5d0('0x3b')]);var _0xf0af53={'where':_0x4da934[_0xe5d0('0x36')]};return db['ServicenowField']['count'](_0xf0af53)['then'](function(_0xf18537){_0x238c16[_0xe5d0('0x1e')]=_0xf18537;if(_0x5c250c[_0xe5d0('0x30')][_0xe5d0('0x3c')]){_0x4da934[_0xe5d0('0x3d')]=[{'all':!![]}];}return db['ServicenowField'][_0xe5d0('0x3e')](_0x4da934);})['then'](function(_0x5d552b){_0x238c16[_0xe5d0('0x3f')]=_0x5d552b;return _0x238c16;})[_0xe5d0('0x24')](respondWithFilteredResult(_0x46a53e,_0x4da934))['catch'](handleError(_0x46a53e,null));};exports['show']=function(_0x2fb4eb,_0x142066){var _0x24f1b1={'raw':!![],'where':{'id':_0x2fb4eb[_0xe5d0('0x40')]['id']}},_0x2c55dc={};_0x2c55dc[_0xe5d0('0x2e')]=_[_0xe5d0('0x31')](db[_0xe5d0('0x41')][_0xe5d0('0x42')]);_0x2c55dc['query']=_[_0xe5d0('0x31')](_0x2fb4eb[_0xe5d0('0x30')]);_0x2c55dc['filters']=_['intersection'](_0x2c55dc[_0xe5d0('0x2e')],_0x2c55dc[_0xe5d0('0x30')]);_0x24f1b1[_0xe5d0('0x33')]=_[_0xe5d0('0x32')](_0x2c55dc['model'],qs['fields'](_0x2fb4eb['query'][_0xe5d0('0x43')]));_0x24f1b1[_0xe5d0('0x33')]=_0x24f1b1[_0xe5d0('0x33')][_0xe5d0('0x44')]?_0x24f1b1[_0xe5d0('0x33')]:_0x2c55dc[_0xe5d0('0x2e')];if(_0x2fb4eb[_0xe5d0('0x30')]['includeAll']){_0x24f1b1['include']=[{'all':!![]}];}_0x24f1b1=_[_0xe5d0('0x45')]({},_0x24f1b1,_0x2fb4eb[_0xe5d0('0x3b')]);return db['ServicenowField'][_0xe5d0('0x46')](_0x24f1b1)[_0xe5d0('0x24')](handleEntityNotFound(_0x142066,null))[_0xe5d0('0x24')](respondWithResult(_0x142066,null))[_0xe5d0('0x47')](handleError(_0x142066,null));};exports[_0xe5d0('0x48')]=function(_0x4fa3b7,_0x1890a){return db[_0xe5d0('0x41')][_0xe5d0('0x48')](_0x4fa3b7[_0xe5d0('0x49')],{})[_0xe5d0('0x24')](respondWithResult(_0x1890a,0xc9))[_0xe5d0('0x47')](handleError(_0x1890a,null));};exports['update']=function(_0x551d07,_0x10e76c){if(_0x551d07[_0xe5d0('0x49')]['id']){delete _0x551d07[_0xe5d0('0x49')]['id'];}return db[_0xe5d0('0x41')][_0xe5d0('0x46')]({'where':{'id':_0x551d07[_0xe5d0('0x40')]['id']}})[_0xe5d0('0x24')](handleEntityNotFound(_0x10e76c,null))[_0xe5d0('0x24')](saveUpdates(_0x551d07['body'],null))[_0xe5d0('0x24')](respondWithResult(_0x10e76c,null))[_0xe5d0('0x47')](handleError(_0x10e76c,null));};exports['destroy']=function(_0x175fcd,_0x9e2085){return db[_0xe5d0('0x41')]['find']({'where':{'id':_0x175fcd[_0xe5d0('0x40')]['id']}})[_0xe5d0('0x24')](handleEntityNotFound(_0x9e2085,null))[_0xe5d0('0x24')](removeEntity(_0x9e2085,null))['catch'](handleError(_0x9e2085,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 22b2f2d..ed392c3 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 _0xe280=['request-promise','path','rimraf','./intServicenowField.attributes','exports','define','ServicenowField','servicenow_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird'];(function(_0x115844,_0x75e9ad){var _0xc21943=function(_0x46c5bd){while(--_0x46c5bd){_0x115844['push'](_0x115844['shift']());}};_0xc21943(++_0x75e9ad);}(_0xe280,0x109));var _0x0e28=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0xe280[_0x5f3f88];return _0xd08119;};'use strict';var _=require(_0x0e28('0x0'));var util=require(_0x0e28('0x1'));var logger=require(_0x0e28('0x2'))(_0x0e28('0x3'));var moment=require('moment');var BPromise=require(_0x0e28('0x4'));var rp=require(_0x0e28('0x5'));var fs=require('fs');var path=require(_0x0e28('0x6'));var rimraf=require(_0x0e28('0x7'));var config=require('../../config/environment');var attributes=require(_0x0e28('0x8'));module[_0x0e28('0x9')]=function(_0x13b6fc,_0x82e736){return _0x13b6fc[_0x0e28('0xa')](_0x0e28('0xb'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0x0e28('0xc'),'fields':[_0x0e28('0xd'),_0x0e28('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6dc6=['exports','define','ServicenowField','servicenow_unique_index','idField','FieldId','util','api','moment','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes'];(function(_0x3c63f3,_0x3130ac){var _0x1c1296=function(_0x15e74c){while(--_0x15e74c){_0x3c63f3['push'](_0x3c63f3['shift']());}};_0x1c1296(++_0x3130ac);}(_0x6dc6,0xd8));var _0x66dc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6dc6[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x66dc('0x0'));var logger=require('../../config/logger')(_0x66dc('0x1'));var moment=require(_0x66dc('0x2'));var BPromise=require('bluebird');var rp=require(_0x66dc('0x3'));var fs=require('fs');var path=require(_0x66dc('0x4'));var rimraf=require(_0x66dc('0x5'));var config=require(_0x66dc('0x6'));var attributes=require(_0x66dc('0x7'));module[_0x66dc('0x8')]=function(_0x484087,_0x1fe7d7){return _0x484087[_0x66dc('0x9')](_0x66dc('0xa'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0x66dc('0xb'),'fields':[_0x66dc('0xc'),_0x66dc('0xd')],'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 0510309..009e148 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 _0xa9e0=['http','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5e4dd0,_0x2478d7){var _0x17bd71=function(_0x187907){while(--_0x187907){_0x5e4dd0['push'](_0x5e4dd0['shift']());}};_0x17bd71(++_0x2478d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'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 _0xaa88=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','error','ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x46b573,_0x388f6d){var _0x3bcf35=function(_0x531d44){while(--_0x531d44){_0x46b573['push'](_0x46b573['shift']());}};_0x3bcf35(++_0x388f6d);}(_0xaa88,0x137));var _0x8aa8=function(_0x48cb1f,_0x5ca68d){_0x48cb1f=_0x48cb1f-0x0;var _0x172c4d=_0xaa88[_0x48cb1f];return _0x172c4d;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var moment=require(_0x8aa8('0x2'));var BPromise=require(_0x8aa8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8aa8('0x4'));var db=require(_0x8aa8('0x5'))['db'];var utils=require(_0x8aa8('0x6'));var logger=require(_0x8aa8('0x7'))(_0x8aa8('0x8'));var config=require(_0x8aa8('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8aa8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5264ff,_0x449d2d,_0x1ed84d){return new BPromise(function(_0x27c08d,_0x40826f){return client['request'](_0x5264ff,_0x1ed84d)[_0x8aa8('0xb')](function(_0x2d974c){logger[_0x8aa8('0xc')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0x8aa8('0xd'));logger[_0x8aa8('0xe')](_0x8aa8('0xf'),_0x449d2d,_0x8aa8('0xd'),JSON['stringify'](_0x2d974c));if(_0x2d974c[_0x8aa8('0x10')]){if(_0x2d974c[_0x8aa8('0x10')]['code']===0x1f4){logger[_0x8aa8('0x10')](_0x8aa8('0x11'),_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x40826f(_0x2d974c[_0x8aa8('0x10')][_0x8aa8('0x12')]);}logger[_0x8aa8('0x10')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x27c08d(_0x2d974c['error'][_0x8aa8('0x12')]);}else{logger[_0x8aa8('0xc')](_0x8aa8('0x11'),_0x449d2d,_0x8aa8('0xd'));_0x27c08d(_0x2d974c[_0x8aa8('0x13')][_0x8aa8('0x12')]);}})[_0x8aa8('0x14')](function(_0xd59fb8){logger[_0x8aa8('0x10')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0xd59fb8);_0x40826f(_0xd59fb8);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 244fc7b..ee7f568 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(_0x3a4157,_0x2c4248){var _0x507062=function(_0x32ac26){while(--_0x32ac26){_0x3a4157['push'](_0x3a4157['shift']());}};_0x507062(++_0x2c4248);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x46e6cc,_0x217b45){var _0x9be343=function(_0x56be01){while(--_0x56be01){_0x46e6cc['push'](_0x46e6cc['shift']());}};_0x9be343(++_0x217b45);}(_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 9227b67..515cb57 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(_0x5514c1,_0x2591c7){var _0x231c25=function(_0x31b122){while(--_0x31b122){_0x5514c1['push'](_0x5514c1['shift']());}};_0x231c25(++_0x2591c7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'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(_0x5e9d1a,_0x584217){var _0x43f617=function(_0x79b1c9){while(--_0x79b1c9){_0x5e9d1a['push'](_0x5e9d1a['shift']());}};_0x43f617(++_0x584217);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'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 bc77ce3..7b7728f 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 _0x4cc9=['undefined','count','limit','set','apply','reject','save','then','destroy','error','name','send','index','map','SugarcrmAccount','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','params','keys','length','includeAll','find','create','body','update','findOne','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmConfiguration','SugarcrmField','getFields','assigned_user_id','description','duration_hours','parent_type','password','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','login','JSON','stringify','username','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','get_module_fields','Calls','values','module_fields','remove','includes','label','endsWith','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset'];(function(_0x66272d,_0x355c1a){var _0x28dabb=function(_0x49e274){while(--_0x49e274){_0x66272d['push'](_0x66272d['shift']());}};_0x28dabb(++_0x355c1a);}(_0x4cc9,0x1ca));var _0x94cc=function(_0x15515c,_0x4061f5){_0x15515c=_0x15515c-0x0;var _0x5e8bba=_0x4cc9[_0x15515c];return _0x5e8bba;};'use strict';var emlformat=require(_0x94cc('0x0'));var rimraf=require(_0x94cc('0x1'));var zipdir=require(_0x94cc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x94cc('0x3'));var moment=require(_0x94cc('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x94cc('0x5'));var util=require(_0x94cc('0x6'));var path=require(_0x94cc('0x7'));var sox=require(_0x94cc('0x8'));var csv=require('to-csv');var ejs=require(_0x94cc('0x9'));var fs=require('fs');var fs_extra=require(_0x94cc('0xa'));var _=require(_0x94cc('0xb'));var squel=require('squel');var crypto=require(_0x94cc('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x94cc('0xd'));var Papa=require(_0x94cc('0xe'));var Redis=require(_0x94cc('0xf'));var authService=require(_0x94cc('0x10'));var qs=require(_0x94cc('0x11'));var as=require(_0x94cc('0x12'));var hardwareService=require(_0x94cc('0x13'));var logger=require(_0x94cc('0x14'))(_0x94cc('0x15'));var utils=require('../../config/utils');var config=require(_0x94cc('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x94cc('0x17'))['db'];var integrations=require(_0x94cc('0x18'));function respondWithStatusCode(_0x2b3acd,_0x4a8761){_0x4a8761=_0x4a8761||0xcc;return function(_0x3bd60b){if(_0x3bd60b){return _0x2b3acd[_0x94cc('0x19')](_0x4a8761);}return _0x2b3acd[_0x94cc('0x1a')](_0x4a8761)[_0x94cc('0x1b')]();};}function respondWithResult(_0xcd1e9f,_0x8d408a){_0x8d408a=_0x8d408a||0xc8;return function(_0x5afd27){if(_0x5afd27){return _0xcd1e9f[_0x94cc('0x1a')](_0x8d408a)[_0x94cc('0x1c')](_0x5afd27);}};}function respondWithFilteredResult(_0x3f732a,_0x5632c5){return function(_0x4a967b){if(_0x4a967b){var _0x32e801=typeof _0x5632c5[_0x94cc('0x1d')]===_0x94cc('0x1e')&&typeof _0x5632c5['limit']==='undefined';var _0x31fc6e=_0x4a967b[_0x94cc('0x1f')];var _0xc81597=_0x32e801?0x0:_0x5632c5['offset'];var _0x5d50b7=_0x32e801?_0x4a967b[_0x94cc('0x1f')]:_0x5632c5[_0x94cc('0x1d')]+_0x5632c5[_0x94cc('0x20')];var _0x659600;if(_0x5d50b7>=_0x31fc6e){_0x5d50b7=_0x31fc6e;_0x659600=0xc8;}else{_0x659600=0xce;}_0x3f732a[_0x94cc('0x1a')](_0x659600);return _0x3f732a[_0x94cc('0x21')]('Content-Range',_0xc81597+'-'+_0x5d50b7+'/'+_0x31fc6e)[_0x94cc('0x1c')](_0x4a967b);}return null;};}function patchUpdates(_0xc06792){return function(_0x4e2de5){try{jsonpatch[_0x94cc('0x22')](_0x4e2de5,_0xc06792,!![]);}catch(_0x11a82d){return BPromise[_0x94cc('0x23')](_0x11a82d);}return _0x4e2de5[_0x94cc('0x24')]();};}function saveUpdates(_0xececbf,_0x4c18f7){return function(_0x128142){if(_0x128142){return _0x128142['update'](_0xececbf)[_0x94cc('0x25')](function(_0x111021){return _0x111021;});}return null;};}function removeEntity(_0x28a773,_0x1fcd65){return function(_0x249d7a){if(_0x249d7a){return _0x249d7a[_0x94cc('0x26')]()[_0x94cc('0x25')](function(){_0x28a773[_0x94cc('0x1a')](0xcc)[_0x94cc('0x1b')]();});}};}function handleEntityNotFound(_0x1374cc,_0x10fce6){return function(_0x2dfcd8){if(!_0x2dfcd8){_0x1374cc['sendStatus'](0x194);}return _0x2dfcd8;};}function handleError(_0x40900b,_0x42aa24){_0x42aa24=_0x42aa24||0x1f4;return function(_0x2948b2){logger[_0x94cc('0x27')](_0x2948b2['stack']);if(_0x2948b2['name']){delete _0x2948b2[_0x94cc('0x28')];}_0x40900b[_0x94cc('0x1a')](_0x42aa24)[_0x94cc('0x29')](_0x2948b2);};}exports[_0x94cc('0x2a')]=function(_0x4d2acd,_0x52247b){var _0x50a9be={},_0x37e4ac={},_0x5d2618={'count':0x0,'rows':[]};var _0x4aecec=_[_0x94cc('0x2b')](db[_0x94cc('0x2c')][_0x94cc('0x2d')],function(_0x398f6f){return{'name':_0x398f6f[_0x94cc('0x2e')],'type':_0x398f6f[_0x94cc('0x2f')][_0x94cc('0x30')]};});_0x37e4ac[_0x94cc('0x31')]=_[_0x94cc('0x2b')](_0x4aecec,_0x94cc('0x28'));_0x37e4ac[_0x94cc('0x32')]=_['keys'](_0x4d2acd[_0x94cc('0x32')]);_0x37e4ac[_0x94cc('0x33')]=_['intersection'](_0x37e4ac[_0x94cc('0x31')],_0x37e4ac[_0x94cc('0x32')]);_0x50a9be[_0x94cc('0x34')]=_[_0x94cc('0x35')](_0x37e4ac[_0x94cc('0x31')],qs[_0x94cc('0x36')](_0x4d2acd[_0x94cc('0x32')][_0x94cc('0x36')]));_0x50a9be[_0x94cc('0x34')]=_0x50a9be[_0x94cc('0x34')]['length']?_0x50a9be[_0x94cc('0x34')]:_0x37e4ac[_0x94cc('0x31')];if(!_0x4d2acd['query'][_0x94cc('0x37')](_0x94cc('0x38'))){_0x50a9be['limit']=qs[_0x94cc('0x20')](_0x4d2acd[_0x94cc('0x32')][_0x94cc('0x20')]);_0x50a9be[_0x94cc('0x1d')]=qs[_0x94cc('0x1d')](_0x4d2acd[_0x94cc('0x32')][_0x94cc('0x1d')]);}_0x50a9be[_0x94cc('0x39')]=qs[_0x94cc('0x3a')](_0x4d2acd[_0x94cc('0x32')][_0x94cc('0x3a')]);_0x50a9be[_0x94cc('0x3b')]=qs['filters'](_[_0x94cc('0x3c')](_0x4d2acd[_0x94cc('0x32')],_0x37e4ac['filters']),_0x4aecec);if(_0x4d2acd[_0x94cc('0x32')][_0x94cc('0x3d')]){_0x50a9be[_0x94cc('0x3b')]=_['merge'](_0x50a9be[_0x94cc('0x3b')],{'$or':_[_0x94cc('0x2b')](_0x4aecec,function(_0x52edea){if(_0x52edea[_0x94cc('0x2f')]!==_0x94cc('0x3e')){var _0x7ef51f={};_0x7ef51f[_0x52edea[_0x94cc('0x28')]]={'$like':'%'+_0x4d2acd[_0x94cc('0x32')][_0x94cc('0x3d')]+'%'};return _0x7ef51f;}})});}_0x50a9be=_[_0x94cc('0x3f')]({},_0x50a9be,_0x4d2acd[_0x94cc('0x40')]);var _0x135da3={'where':_0x50a9be[_0x94cc('0x3b')]};return db[_0x94cc('0x2c')][_0x94cc('0x1f')](_0x135da3)[_0x94cc('0x25')](function(_0x3c41eb){_0x5d2618[_0x94cc('0x1f')]=_0x3c41eb;if(_0x4d2acd[_0x94cc('0x32')]['includeAll']){_0x50a9be[_0x94cc('0x41')]=[{'all':!![]}];}return db[_0x94cc('0x2c')][_0x94cc('0x42')](_0x50a9be);})[_0x94cc('0x25')](function(_0x400a3a){_0x5d2618[_0x94cc('0x43')]=_0x400a3a;return _0x5d2618;})[_0x94cc('0x25')](respondWithFilteredResult(_0x52247b,_0x50a9be))[_0x94cc('0x44')](handleError(_0x52247b,null));};exports['show']=function(_0x92f2e2,_0x3280f6){var _0x12a1dc={'raw':![],'where':{'id':_0x92f2e2[_0x94cc('0x45')]['id']}},_0x4ca9a1={};_0x4ca9a1[_0x94cc('0x31')]=_['keys'](db['SugarcrmAccount'][_0x94cc('0x2d')]);_0x4ca9a1[_0x94cc('0x32')]=_[_0x94cc('0x46')](_0x92f2e2[_0x94cc('0x32')]);_0x4ca9a1[_0x94cc('0x33')]=_[_0x94cc('0x35')](_0x4ca9a1[_0x94cc('0x31')],_0x4ca9a1[_0x94cc('0x32')]);_0x12a1dc[_0x94cc('0x34')]=_[_0x94cc('0x35')](_0x4ca9a1[_0x94cc('0x31')],qs[_0x94cc('0x36')](_0x92f2e2[_0x94cc('0x32')]['fields']));_0x12a1dc['attributes']=_0x12a1dc['attributes'][_0x94cc('0x47')]?_0x12a1dc['attributes']:_0x4ca9a1[_0x94cc('0x31')];if(_0x92f2e2[_0x94cc('0x32')][_0x94cc('0x48')]){_0x12a1dc[_0x94cc('0x41')]=[{'all':!![]}];}_0x12a1dc=_[_0x94cc('0x3f')]({},_0x12a1dc,_0x92f2e2['options']);return db[_0x94cc('0x2c')][_0x94cc('0x49')](_0x12a1dc)[_0x94cc('0x25')](handleEntityNotFound(_0x3280f6,null))[_0x94cc('0x25')](respondWithResult(_0x3280f6,null))['catch'](handleError(_0x3280f6,null));};exports['create']=function(_0x2f8c9d,_0x1e06fd){return db[_0x94cc('0x2c')][_0x94cc('0x4a')](_0x2f8c9d[_0x94cc('0x4b')],{})[_0x94cc('0x25')](respondWithResult(_0x1e06fd,0xc9))[_0x94cc('0x44')](handleError(_0x1e06fd,null));};exports[_0x94cc('0x4c')]=function(_0x2db00c,_0x47a734){if(_0x2db00c[_0x94cc('0x4b')]['id']){delete _0x2db00c['body']['id'];}return db[_0x94cc('0x2c')][_0x94cc('0x49')]({'where':{'id':_0x2db00c[_0x94cc('0x45')]['id']}})[_0x94cc('0x25')](handleEntityNotFound(_0x47a734,null))['then'](saveUpdates(_0x2db00c[_0x94cc('0x4b')],null))[_0x94cc('0x25')](respondWithResult(_0x47a734,null))[_0x94cc('0x44')](handleError(_0x47a734,null));};exports['destroy']=function(_0x369300,_0x2e4799){return db['SugarcrmAccount'][_0x94cc('0x49')]({'where':{'id':_0x369300[_0x94cc('0x45')]['id']}})[_0x94cc('0x25')](handleEntityNotFound(_0x2e4799,null))[_0x94cc('0x25')](removeEntity(_0x2e4799,null))[_0x94cc('0x44')](handleError(_0x2e4799,null));};exports['getConfigurations']=function(_0x575507,_0x445187,_0x47baa2){var _0x408857={};var _0x486de1={};var _0x159301;var _0x4665f7;return db['SugarcrmAccount'][_0x94cc('0x4d')]({'where':{'id':_0x575507[_0x94cc('0x45')]['id']}})['then'](handleEntityNotFound(_0x445187,null))[_0x94cc('0x25')](function(_0x145db1){if(_0x145db1){_0x159301=_0x145db1;_0x486de1[_0x94cc('0x31')]=_[_0x94cc('0x46')](db['SugarcrmConfiguration']['rawAttributes']);_0x486de1[_0x94cc('0x32')]=_[_0x94cc('0x46')](_0x575507[_0x94cc('0x32')]);_0x486de1[_0x94cc('0x33')]=_[_0x94cc('0x35')](_0x486de1[_0x94cc('0x31')],_0x486de1[_0x94cc('0x32')]);_0x408857[_0x94cc('0x34')]=_[_0x94cc('0x35')](_0x486de1[_0x94cc('0x31')],qs['fields'](_0x575507[_0x94cc('0x32')][_0x94cc('0x36')]));_0x408857['attributes']=_0x408857['attributes'][_0x94cc('0x47')]?_0x408857[_0x94cc('0x34')]:_0x486de1[_0x94cc('0x31')];_0x408857[_0x94cc('0x39')]=qs[_0x94cc('0x3a')](_0x575507['query'][_0x94cc('0x3a')]);_0x408857[_0x94cc('0x3b')]=qs['filters'](_[_0x94cc('0x3c')](_0x575507[_0x94cc('0x32')],_0x486de1[_0x94cc('0x33')]));if(_0x575507[_0x94cc('0x32')][_0x94cc('0x3d')]){_0x408857[_0x94cc('0x3b')]=_['merge'](_0x408857['where'],{'$or':_[_0x94cc('0x2b')](_0x408857[_0x94cc('0x34')],function(_0x2c5652){var _0x315d4f={};_0x315d4f[_0x2c5652]={'$like':'%'+_0x575507[_0x94cc('0x32')][_0x94cc('0x3d')]+'%'};return _0x315d4f;})});}_0x408857=_[_0x94cc('0x3f')]({},_0x408857,_0x575507[_0x94cc('0x40')]);return _0x159301[_0x94cc('0x4e')](_0x408857);}})['then'](function(_0xf8b06c){if(_0xf8b06c){_0x4665f7=_0xf8b06c[_0x94cc('0x47')];if(!_0x575507[_0x94cc('0x32')][_0x94cc('0x37')](_0x94cc('0x38'))){_0x408857[_0x94cc('0x20')]=qs['limit'](_0x575507['query']['limit']);_0x408857[_0x94cc('0x1d')]=qs[_0x94cc('0x1d')](_0x575507['query']['offset']);}return _0x159301[_0x94cc('0x4e')](_0x408857);}})[_0x94cc('0x25')](function(_0x357744){if(_0x357744){return _0x357744?{'count':_0x4665f7,'rows':_0x357744}:null;}})[_0x94cc('0x25')](respondWithResult(_0x445187,null))[_0x94cc('0x44')](handleError(_0x445187,null));};exports[_0x94cc('0x4f')]=function(_0x483c65,_0x4335e0,_0x39d004){if(_0x483c65['body']['id']){delete _0x483c65[_0x94cc('0x4b')]['id'];}return db[_0x94cc('0x2c')][_0x94cc('0x4d')]({'where':{'id':_0x483c65[_0x94cc('0x45')]['id']}})[_0x94cc('0x25')](handleEntityNotFound(_0x4335e0,null))[_0x94cc('0x25')](function(_0x38d31c){if(_0x38d31c){_0x483c65[_0x94cc('0x4b')][_0x94cc('0x50')]=_0x38d31c['id'];_0x483c65['body'][_0x94cc('0x51')]=integrations[_0x94cc('0x52')](_0x483c65['body'][_0x94cc('0x53')],_0x483c65[_0x94cc('0x4b')][_0x94cc('0x2f')]);_0x483c65['body'][_0x94cc('0x54')]=integrations[_0x94cc('0x55')](_0x483c65[_0x94cc('0x4b')][_0x94cc('0x53')],_0x483c65[_0x94cc('0x4b')][_0x94cc('0x2f')]);return db[_0x94cc('0x56')][_0x94cc('0x4a')](_0x483c65['body'],{'include':[{'model':db[_0x94cc('0x57')],'as':_0x94cc('0x51')},{'model':db[_0x94cc('0x57')],'as':_0x94cc('0x54')}]});}return null;})['then'](respondWithResult(_0x4335e0,null))[_0x94cc('0x44')](handleError(_0x4335e0,null));};exports[_0x94cc('0x58')]=function(_0x258d4c,_0x4603f5,_0x46990a){var _0x32167b='';var _0xa29b51=['id','name',_0x94cc('0x59'),'created_by',_0x94cc('0x5a'),'date_start',_0x94cc('0x5b'),'duration_minutes','parent_id',_0x94cc('0x5c'),'parent_name','direction'];return db[_0x94cc('0x2c')][_0x94cc('0x4d')]({'where':{'id':_0x258d4c['params']['id']},'attributes':['id','username',_0x94cc('0x5d'),_0x94cc('0x5e')]})[_0x94cc('0x25')](handleEntityNotFound(_0x4603f5,null))['then'](function(_0x20c8e6){if(_0x20c8e6){_0x32167b=_0x20c8e6[_0x94cc('0x5e')];var _0x2dfe65=_0x32167b[_0x94cc('0x5f')](-0x1);if(_0x2dfe65==='/'){_0x32167b=_0x32167b[_0x94cc('0x60')](0x0,_0x32167b[_0x94cc('0x61')](_0x2dfe65));}return rp({'method':_0x94cc('0x62'),'uri':util[_0x94cc('0x63')](_0x94cc('0x64'),_0x32167b,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x94cc('0x65'),'input_type':_0x94cc('0x66'),'response_type':_0x94cc('0x66'),'rest_data':JSON[_0x94cc('0x67')]({'user_auth':{'user_name':_0x20c8e6[_0x94cc('0x68')],'password':_0x20c8e6['password'],'encryption':_0x94cc('0x69')},'application':_0x94cc('0x6a')})}});}})[_0x94cc('0x25')](function(_0x1c01cf){if(_0x1c01cf&&_0x1c01cf['name']!==_0x94cc('0x6b')&&_0x1c01cf[_0x94cc('0x28')]!==_0x94cc('0x6c')){return rp({'method':_0x94cc('0x62'),'uri':util[_0x94cc('0x63')](_0x94cc('0x64'),_0x32167b,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x94cc('0x6d'),'input_type':_0x94cc('0x66'),'response_type':_0x94cc('0x66'),'rest_data':JSON[_0x94cc('0x67')]({'session':_0x1c01cf['id'],'module_name':_0x94cc('0x6e')})}})[_0x94cc('0x25')](function(_0xf0b90e){if(_0xf0b90e){var _0x262a66=_[_0x94cc('0x6f')](_0xf0b90e[_0x94cc('0x70')]);_[_0x94cc('0x71')](_0x262a66,function(_0xb18bfd){return _0xa29b51[_0x94cc('0x72')](_0xb18bfd['name']);});return{'count':_0x262a66[_0x94cc('0x47')],'rows':_['map'](_0x262a66,function(_0x1c9677){return{'id':_0x1c9677['name'],'name':_0x1c9677[_0x94cc('0x73')],'custom':_[_0x94cc('0x74')](_0x1c9677[_0x94cc('0x28')],'_c')?!![]:![],'options':_0x1c9677[_0x94cc('0x40')]?_[_0x94cc('0x2b')](_[_0x94cc('0x6f')](_0x1c9677['options']),function(_0x22bc74){return{'name':_0x22bc74[_0x94cc('0x75')],'value':_0x22bc74[_0x94cc('0x28')]};}):[]};})};}})[_0x94cc('0x25')](respondWithResult(_0x4603f5,null))[_0x94cc('0x44')](function(_0x533def){var _0xe2eb5c=_0x258d4c['query'][_0x94cc('0x76')]?0x1f4:_0x533def[_0x94cc('0x77')]||0x1f4;logger[_0x94cc('0x27')](_0x94cc('0x78'),'getFields',_0xe2eb5c,JSON[_0x94cc('0x67')](_0x533def));delete _0x533def[_0x94cc('0x28')];if(_0xe2eb5c===0x191){_0xe2eb5c=0x190;}_0x4603f5['status'](_0xe2eb5c)['send'](_0x258d4c[_0x94cc('0x32')][_0x94cc('0x76')]?{'message':_0x94cc('0x79'),'statusCode':_0x533def[_0x94cc('0x77')]}:_0x533def);});}else{var _0x455045=0x1f4;_0x4603f5[_0x94cc('0x1a')](_0x455045)[_0x94cc('0x29')]({'message':_0x94cc('0x79'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x2bdb=['username','password','remoteUri','slice','substring','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','stringify','Calls','values','module_fields','label','endsWith','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','undefined','limit','count','offset','apply','reject','save','update','then','destroy','error','stack','name','index','map','SugarcrmAccount','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','find','create','body','params','getConfigurations','findOne','SugarcrmConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','type','Descriptions','SugarcrmField','getFields','assigned_user_id','created_by','date_start','duration_minutes','parent_type','parent_name','direction'];(function(_0x20eeff,_0x532c16){var _0x7db88f=function(_0x36b56b){while(--_0x36b56b){_0x20eeff['push'](_0x20eeff['shift']());}};_0x7db88f(++_0x532c16);}(_0x2bdb,0x105));var _0xb2bd=function(_0x29a08d,_0x551eca){_0x29a08d=_0x29a08d-0x0;var _0x10fc1a=_0x2bdb[_0x29a08d];return _0x10fc1a;};'use strict';var emlformat=require(_0xb2bd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb2bd('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb2bd('0x2'));var moment=require(_0xb2bd('0x3'));var BPromise=require(_0xb2bd('0x4'));var Mustache=require('mustache');var util=require(_0xb2bd('0x5'));var path=require(_0xb2bd('0x6'));var sox=require(_0xb2bd('0x7'));var csv=require(_0xb2bd('0x8'));var ejs=require(_0xb2bd('0x9'));var fs=require('fs');var fs_extra=require(_0xb2bd('0xa'));var _=require(_0xb2bd('0xb'));var squel=require('squel');var crypto=require(_0xb2bd('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb2bd('0xd'));var toCsv=require(_0xb2bd('0x8'));var querystring=require(_0xb2bd('0xe'));var Papa=require(_0xb2bd('0xf'));var Redis=require(_0xb2bd('0x10'));var authService=require(_0xb2bd('0x11'));var qs=require(_0xb2bd('0x12'));var as=require(_0xb2bd('0x13'));var hardwareService=require(_0xb2bd('0x14'));var logger=require('../../config/logger')(_0xb2bd('0x15'));var utils=require(_0xb2bd('0x16'));var config=require(_0xb2bd('0x17'));var licenseUtil=require(_0xb2bd('0x18'));var db=require(_0xb2bd('0x19'))['db'];var integrations=require(_0xb2bd('0x1a'));function respondWithStatusCode(_0x6d2212,_0x452cd6){_0x452cd6=_0x452cd6||0xcc;return function(_0x58425a){if(_0x58425a){return _0x6d2212[_0xb2bd('0x1b')](_0x452cd6);}return _0x6d2212['status'](_0x452cd6)[_0xb2bd('0x1c')]();};}function respondWithResult(_0x2adda1,_0x17e238){_0x17e238=_0x17e238||0xc8;return function(_0x259053){if(_0x259053){return _0x2adda1[_0xb2bd('0x1d')](_0x17e238)['json'](_0x259053);}};}function respondWithFilteredResult(_0x23c440,_0x315ecc){return function(_0x2091d2){if(_0x2091d2){var _0x991fe=typeof _0x315ecc['offset']===_0xb2bd('0x1e')&&typeof _0x315ecc[_0xb2bd('0x1f')]==='undefined';var _0x1ad53e=_0x2091d2[_0xb2bd('0x20')];var _0x387897=_0x991fe?0x0:_0x315ecc[_0xb2bd('0x21')];var _0x5d848d=_0x991fe?_0x2091d2[_0xb2bd('0x20')]:_0x315ecc[_0xb2bd('0x21')]+_0x315ecc['limit'];var _0xd89760;if(_0x5d848d>=_0x1ad53e){_0x5d848d=_0x1ad53e;_0xd89760=0xc8;}else{_0xd89760=0xce;}_0x23c440[_0xb2bd('0x1d')](_0xd89760);return _0x23c440['set']('Content-Range',_0x387897+'-'+_0x5d848d+'/'+_0x1ad53e)['json'](_0x2091d2);}return null;};}function patchUpdates(_0x31a69f){return function(_0x4dfda8){try{jsonpatch[_0xb2bd('0x22')](_0x4dfda8,_0x31a69f,!![]);}catch(_0x48fc57){return BPromise[_0xb2bd('0x23')](_0x48fc57);}return _0x4dfda8[_0xb2bd('0x24')]();};}function saveUpdates(_0x505c35,_0x246f71){return function(_0x5e55f1){if(_0x5e55f1){return _0x5e55f1[_0xb2bd('0x25')](_0x505c35)[_0xb2bd('0x26')](function(_0x2d281c){return _0x2d281c;});}return null;};}function removeEntity(_0x7517de,_0x5665ae){return function(_0x44635a){if(_0x44635a){return _0x44635a[_0xb2bd('0x27')]()[_0xb2bd('0x26')](function(){_0x7517de[_0xb2bd('0x1d')](0xcc)[_0xb2bd('0x1c')]();});}};}function handleEntityNotFound(_0x284da5,_0x5fd563){return function(_0x5bc22e){if(!_0x5bc22e){_0x284da5[_0xb2bd('0x1b')](0x194);}return _0x5bc22e;};}function handleError(_0x18859a,_0xdba731){_0xdba731=_0xdba731||0x1f4;return function(_0x38a954){logger[_0xb2bd('0x28')](_0x38a954[_0xb2bd('0x29')]);if(_0x38a954[_0xb2bd('0x2a')]){delete _0x38a954['name'];}_0x18859a[_0xb2bd('0x1d')](_0xdba731)['send'](_0x38a954);};}exports[_0xb2bd('0x2b')]=function(_0x5a7a7c,_0xbfae89){var _0x41ba8f={},_0x65211d={},_0x5628c3={'count':0x0,'rows':[]};var _0x321c13=_[_0xb2bd('0x2c')](db[_0xb2bd('0x2d')][_0xb2bd('0x2e')],function(_0x2976b6){return{'name':_0x2976b6[_0xb2bd('0x2f')],'type':_0x2976b6['type']['key']};});_0x65211d[_0xb2bd('0x30')]=_['map'](_0x321c13,_0xb2bd('0x2a'));_0x65211d[_0xb2bd('0x31')]=_[_0xb2bd('0x32')](_0x5a7a7c['query']);_0x65211d[_0xb2bd('0x33')]=_[_0xb2bd('0x34')](_0x65211d[_0xb2bd('0x30')],_0x65211d[_0xb2bd('0x31')]);_0x41ba8f[_0xb2bd('0x35')]=_[_0xb2bd('0x34')](_0x65211d[_0xb2bd('0x30')],qs[_0xb2bd('0x36')](_0x5a7a7c[_0xb2bd('0x31')][_0xb2bd('0x36')]));_0x41ba8f['attributes']=_0x41ba8f[_0xb2bd('0x35')][_0xb2bd('0x37')]?_0x41ba8f[_0xb2bd('0x35')]:_0x65211d[_0xb2bd('0x30')];if(!_0x5a7a7c['query'][_0xb2bd('0x38')](_0xb2bd('0x39'))){_0x41ba8f[_0xb2bd('0x1f')]=qs[_0xb2bd('0x1f')](_0x5a7a7c[_0xb2bd('0x31')]['limit']);_0x41ba8f['offset']=qs[_0xb2bd('0x21')](_0x5a7a7c[_0xb2bd('0x31')][_0xb2bd('0x21')]);}_0x41ba8f[_0xb2bd('0x3a')]=qs[_0xb2bd('0x3b')](_0x5a7a7c['query'][_0xb2bd('0x3b')]);_0x41ba8f[_0xb2bd('0x3c')]=qs[_0xb2bd('0x33')](_[_0xb2bd('0x3d')](_0x5a7a7c[_0xb2bd('0x31')],_0x65211d[_0xb2bd('0x33')]),_0x321c13);if(_0x5a7a7c[_0xb2bd('0x31')][_0xb2bd('0x3e')]){_0x41ba8f[_0xb2bd('0x3c')]=_[_0xb2bd('0x3f')](_0x41ba8f[_0xb2bd('0x3c')],{'$or':_[_0xb2bd('0x2c')](_0x321c13,function(_0x368db7){if(_0x368db7['type']!==_0xb2bd('0x40')){var _0x2576c5={};_0x2576c5[_0x368db7[_0xb2bd('0x2a')]]={'$like':'%'+_0x5a7a7c[_0xb2bd('0x31')][_0xb2bd('0x3e')]+'%'};return _0x2576c5;}})});}_0x41ba8f=_[_0xb2bd('0x3f')]({},_0x41ba8f,_0x5a7a7c[_0xb2bd('0x41')]);var _0x3257a4={'where':_0x41ba8f['where']};return db['SugarcrmAccount'][_0xb2bd('0x20')](_0x3257a4)[_0xb2bd('0x26')](function(_0x555f4a){_0x5628c3[_0xb2bd('0x20')]=_0x555f4a;if(_0x5a7a7c[_0xb2bd('0x31')][_0xb2bd('0x42')]){_0x41ba8f[_0xb2bd('0x43')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0xb2bd('0x44')](_0x41ba8f);})[_0xb2bd('0x26')](function(_0xa2a52){_0x5628c3['rows']=_0xa2a52;return _0x5628c3;})[_0xb2bd('0x26')](respondWithFilteredResult(_0xbfae89,_0x41ba8f))[_0xb2bd('0x45')](handleError(_0xbfae89,null));};exports['show']=function(_0xbbfd15,_0x5c316f){var _0x285599={'raw':![],'where':{'id':_0xbbfd15['params']['id']}},_0x4050a5={};_0x4050a5[_0xb2bd('0x30')]=_[_0xb2bd('0x32')](db[_0xb2bd('0x2d')][_0xb2bd('0x2e')]);_0x4050a5[_0xb2bd('0x31')]=_['keys'](_0xbbfd15[_0xb2bd('0x31')]);_0x4050a5[_0xb2bd('0x33')]=_[_0xb2bd('0x34')](_0x4050a5[_0xb2bd('0x30')],_0x4050a5[_0xb2bd('0x31')]);_0x285599[_0xb2bd('0x35')]=_[_0xb2bd('0x34')](_0x4050a5[_0xb2bd('0x30')],qs[_0xb2bd('0x36')](_0xbbfd15[_0xb2bd('0x31')]['fields']));_0x285599[_0xb2bd('0x35')]=_0x285599[_0xb2bd('0x35')][_0xb2bd('0x37')]?_0x285599[_0xb2bd('0x35')]:_0x4050a5[_0xb2bd('0x30')];if(_0xbbfd15['query'][_0xb2bd('0x42')]){_0x285599[_0xb2bd('0x43')]=[{'all':!![]}];}_0x285599=_['merge']({},_0x285599,_0xbbfd15[_0xb2bd('0x41')]);return db['SugarcrmAccount'][_0xb2bd('0x46')](_0x285599)[_0xb2bd('0x26')](handleEntityNotFound(_0x5c316f,null))[_0xb2bd('0x26')](respondWithResult(_0x5c316f,null))[_0xb2bd('0x45')](handleError(_0x5c316f,null));};exports[_0xb2bd('0x47')]=function(_0x4a35f4,_0x3cef0a){return db[_0xb2bd('0x2d')]['create'](_0x4a35f4[_0xb2bd('0x48')],{})['then'](respondWithResult(_0x3cef0a,0xc9))[_0xb2bd('0x45')](handleError(_0x3cef0a,null));};exports[_0xb2bd('0x25')]=function(_0x311ab8,_0x112f45){if(_0x311ab8[_0xb2bd('0x48')]['id']){delete _0x311ab8[_0xb2bd('0x48')]['id'];}return db[_0xb2bd('0x2d')][_0xb2bd('0x46')]({'where':{'id':_0x311ab8[_0xb2bd('0x49')]['id']}})[_0xb2bd('0x26')](handleEntityNotFound(_0x112f45,null))[_0xb2bd('0x26')](saveUpdates(_0x311ab8[_0xb2bd('0x48')],null))[_0xb2bd('0x26')](respondWithResult(_0x112f45,null))[_0xb2bd('0x45')](handleError(_0x112f45,null));};exports[_0xb2bd('0x27')]=function(_0x5037d4,_0x49ebd0){return db[_0xb2bd('0x2d')]['find']({'where':{'id':_0x5037d4[_0xb2bd('0x49')]['id']}})['then'](handleEntityNotFound(_0x49ebd0,null))[_0xb2bd('0x26')](removeEntity(_0x49ebd0,null))[_0xb2bd('0x45')](handleError(_0x49ebd0,null));};exports[_0xb2bd('0x4a')]=function(_0x4b65a9,_0x5f56eb,_0x35d378){var _0xf8189a={};var _0x3a86d5={};var _0x322863;var _0x338789;return db['SugarcrmAccount'][_0xb2bd('0x4b')]({'where':{'id':_0x4b65a9[_0xb2bd('0x49')]['id']}})[_0xb2bd('0x26')](handleEntityNotFound(_0x5f56eb,null))[_0xb2bd('0x26')](function(_0x49c180){if(_0x49c180){_0x322863=_0x49c180;_0x3a86d5[_0xb2bd('0x30')]=_['keys'](db[_0xb2bd('0x4c')][_0xb2bd('0x2e')]);_0x3a86d5['query']=_[_0xb2bd('0x32')](_0x4b65a9[_0xb2bd('0x31')]);_0x3a86d5[_0xb2bd('0x33')]=_['intersection'](_0x3a86d5[_0xb2bd('0x30')],_0x3a86d5[_0xb2bd('0x31')]);_0xf8189a['attributes']=_[_0xb2bd('0x34')](_0x3a86d5[_0xb2bd('0x30')],qs[_0xb2bd('0x36')](_0x4b65a9['query']['fields']));_0xf8189a[_0xb2bd('0x35')]=_0xf8189a[_0xb2bd('0x35')][_0xb2bd('0x37')]?_0xf8189a[_0xb2bd('0x35')]:_0x3a86d5[_0xb2bd('0x30')];_0xf8189a[_0xb2bd('0x3a')]=qs[_0xb2bd('0x3b')](_0x4b65a9[_0xb2bd('0x31')]['sort']);_0xf8189a[_0xb2bd('0x3c')]=qs['filters'](_[_0xb2bd('0x3d')](_0x4b65a9[_0xb2bd('0x31')],_0x3a86d5['filters']));if(_0x4b65a9['query'][_0xb2bd('0x3e')]){_0xf8189a[_0xb2bd('0x3c')]=_['merge'](_0xf8189a['where'],{'$or':_[_0xb2bd('0x2c')](_0xf8189a['attributes'],function(_0x54d42a){var _0x481e2e={};_0x481e2e[_0x54d42a]={'$like':'%'+_0x4b65a9[_0xb2bd('0x31')]['filter']+'%'};return _0x481e2e;})});}_0xf8189a=_[_0xb2bd('0x3f')]({},_0xf8189a,_0x4b65a9['options']);return _0x322863[_0xb2bd('0x4a')](_0xf8189a);}})[_0xb2bd('0x26')](function(_0x2a7b50){if(_0x2a7b50){_0x338789=_0x2a7b50[_0xb2bd('0x37')];if(!_0x4b65a9[_0xb2bd('0x31')][_0xb2bd('0x38')](_0xb2bd('0x39'))){_0xf8189a['limit']=qs[_0xb2bd('0x1f')](_0x4b65a9[_0xb2bd('0x31')][_0xb2bd('0x1f')]);_0xf8189a[_0xb2bd('0x21')]=qs['offset'](_0x4b65a9[_0xb2bd('0x31')][_0xb2bd('0x21')]);}return _0x322863[_0xb2bd('0x4a')](_0xf8189a);}})[_0xb2bd('0x26')](function(_0xb4b5c3){if(_0xb4b5c3){return _0xb4b5c3?{'count':_0x338789,'rows':_0xb4b5c3}:null;}})[_0xb2bd('0x26')](respondWithResult(_0x5f56eb,null))['catch'](handleError(_0x5f56eb,null));};exports[_0xb2bd('0x4d')]=function(_0xb164b5,_0x4c3120,_0x2971bc){if(_0xb164b5[_0xb2bd('0x48')]['id']){delete _0xb164b5[_0xb2bd('0x48')]['id'];}return db[_0xb2bd('0x2d')]['findOne']({'where':{'id':_0xb164b5['params']['id']}})[_0xb2bd('0x26')](handleEntityNotFound(_0x4c3120,null))[_0xb2bd('0x26')](function(_0x54d736){if(_0x54d736){_0xb164b5[_0xb2bd('0x48')][_0xb2bd('0x4e')]=_0x54d736['id'];_0xb164b5[_0xb2bd('0x48')][_0xb2bd('0x4f')]=integrations[_0xb2bd('0x50')](_0xb164b5['body'][_0xb2bd('0x51')],_0xb164b5[_0xb2bd('0x48')][_0xb2bd('0x52')]);_0xb164b5['body'][_0xb2bd('0x53')]=integrations['getDescriptions'](_0xb164b5['body'][_0xb2bd('0x51')],_0xb164b5[_0xb2bd('0x48')][_0xb2bd('0x52')]);return db[_0xb2bd('0x4c')]['create'](_0xb164b5[_0xb2bd('0x48')],{'include':[{'model':db['SugarcrmField'],'as':_0xb2bd('0x4f')},{'model':db[_0xb2bd('0x54')],'as':'Descriptions'}]});}return null;})[_0xb2bd('0x26')](respondWithResult(_0x4c3120,null))[_0xb2bd('0x45')](handleError(_0x4c3120,null));};exports[_0xb2bd('0x55')]=function(_0x2cbac2,_0x1d62e4,_0x6cb1d9){var _0x5c01f3='';var _0x2165c3=['id',_0xb2bd('0x2a'),_0xb2bd('0x56'),_0xb2bd('0x57'),'description',_0xb2bd('0x58'),'duration_hours',_0xb2bd('0x59'),'parent_id',_0xb2bd('0x5a'),_0xb2bd('0x5b'),_0xb2bd('0x5c')];return db[_0xb2bd('0x2d')][_0xb2bd('0x4b')]({'where':{'id':_0x2cbac2['params']['id']},'attributes':['id',_0xb2bd('0x5d'),_0xb2bd('0x5e'),_0xb2bd('0x5f')]})[_0xb2bd('0x26')](handleEntityNotFound(_0x1d62e4,null))[_0xb2bd('0x26')](function(_0x5d5f5e){if(_0x5d5f5e){_0x5c01f3=_0x5d5f5e['remoteUri'];var _0x1dba45=_0x5c01f3[_0xb2bd('0x60')](-0x1);if(_0x1dba45==='/'){_0x5c01f3=_0x5c01f3[_0xb2bd('0x61')](0x0,_0x5c01f3['lastIndexOf'](_0x1dba45));}return rp({'method':_0xb2bd('0x62'),'uri':util[_0xb2bd('0x63')](_0xb2bd('0x64'),_0x5c01f3,_0xb2bd('0x65')),'json':!![],'form':{'method':_0xb2bd('0x66'),'input_type':'JSON','response_type':_0xb2bd('0x67'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x5d5f5e['username'],'password':_0x5d5f5e[_0xb2bd('0x5e')],'encryption':'PLAIN'},'application':_0xb2bd('0x68')})}});}})[_0xb2bd('0x26')](function(_0x2d910d){if(_0x2d910d&&_0x2d910d['name']!==_0xb2bd('0x69')&&_0x2d910d[_0xb2bd('0x2a')]!==_0xb2bd('0x6a')){return rp({'method':_0xb2bd('0x62'),'uri':util[_0xb2bd('0x63')](_0xb2bd('0x64'),_0x5c01f3,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'get_module_fields','input_type':_0xb2bd('0x67'),'response_type':'JSON','rest_data':JSON[_0xb2bd('0x6b')]({'session':_0x2d910d['id'],'module_name':_0xb2bd('0x6c')})}})['then'](function(_0x343a3f){if(_0x343a3f){var _0xe6f688=_[_0xb2bd('0x6d')](_0x343a3f[_0xb2bd('0x6e')]);_['remove'](_0xe6f688,function(_0x2be7a6){return _0x2165c3['includes'](_0x2be7a6[_0xb2bd('0x2a')]);});return{'count':_0xe6f688['length'],'rows':_[_0xb2bd('0x2c')](_0xe6f688,function(_0x4f997d){return{'id':_0x4f997d[_0xb2bd('0x2a')],'name':_0x4f997d[_0xb2bd('0x6f')],'custom':_[_0xb2bd('0x70')](_0x4f997d[_0xb2bd('0x2a')],'_c')?!![]:![],'options':_0x4f997d['options']?_[_0xb2bd('0x2c')](_[_0xb2bd('0x6d')](_0x4f997d[_0xb2bd('0x41')]),function(_0x1120ee){return{'name':_0x1120ee[_0xb2bd('0x71')],'value':_0x1120ee['name']};}):[]};})};}})[_0xb2bd('0x26')](respondWithResult(_0x1d62e4,null))[_0xb2bd('0x45')](function(_0x3bcd58){var _0x355094=_0x2cbac2['query'][_0xb2bd('0x72')]?0x1f4:_0x3bcd58[_0xb2bd('0x73')]||0x1f4;logger['error'](_0xb2bd('0x74'),_0xb2bd('0x55'),_0x355094,JSON[_0xb2bd('0x6b')](_0x3bcd58));delete _0x3bcd58['name'];if(_0x355094===0x191){_0x355094=0x190;}_0x1d62e4[_0xb2bd('0x1d')](_0x355094)[_0xb2bd('0x75')](_0x2cbac2[_0xb2bd('0x31')][_0xb2bd('0x72')]?{'message':'Wrong\x20credentials','statusCode':_0x3bcd58['statusCode']}:_0x3bcd58);});}else{var _0x1517e7=0x1f4;_0x1d62e4['status'](_0x1517e7)['send']({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js index f2cf7fa..3a8d02d 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 _0xad1b=['util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','../../components/integrations/configuration','lodash'];(function(_0x2422fc,_0x520abb){var _0x328d1e=function(_0x412896){while(--_0x412896){_0x2422fc['push'](_0x2422fc['shift']());}};_0x328d1e(++_0x520abb);}(_0xad1b,0x131));var _0xbad1=function(_0x5e2489,_0x2fd8be){_0x5e2489=_0x5e2489-0x0;var _0xa87596=_0xad1b[_0x5e2489];return _0xa87596;};'use strict';var _=require(_0xbad1('0x0'));var util=require(_0xbad1('0x1'));var logger=require(_0xbad1('0x2'))(_0xbad1('0x3'));var moment=require('moment');var BPromise=require(_0xbad1('0x4'));var rp=require(_0xbad1('0x5'));var fs=require('fs');var path=require(_0xbad1('0x6'));var rimraf=require('rimraf');var config=require(_0xbad1('0x7'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0xbad1('0x8'));module['exports']=function(_0x3abf58,_0x10fbed){return _0x3abf58['define']('SugarcrmAccount',attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaf73=['path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x25cd5d,_0x460c61){var _0x3d300c=function(_0x4f4c9c){while(--_0x4f4c9c){_0x25cd5d['push'](_0x25cd5d['shift']());}};_0x3d300c(++_0x460c61);}(_0xaf73,0x149));var _0x3af7=function(_0x5d573b,_0x2fa77d){_0x5d573b=_0x5d573b-0x0;var _0x5b87b6=_0xaf73[_0x5d573b];return _0x5b87b6;};'use strict';var _=require(_0x3af7('0x0'));var util=require(_0x3af7('0x1'));var logger=require(_0x3af7('0x2'))(_0x3af7('0x3'));var moment=require(_0x3af7('0x4'));var BPromise=require(_0x3af7('0x5'));var rp=require(_0x3af7('0x6'));var fs=require('fs');var path=require(_0x3af7('0x7'));var rimraf=require(_0x3af7('0x8'));var config=require(_0x3af7('0x9'));var attributes=require(_0x3af7('0xa'));var integrations=require(_0x3af7('0xb'));module[_0x3af7('0xc')]=function(_0x1508f0,_0x3cc0bc){return _0x1508f0[_0x3af7('0xd')]('SugarcrmAccount',attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index 1822017..f9305ec 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 _0x6d5c=['request\x20sent','stringify','error','code','message','info','result','GetSugarcrmAccount','SugarcrmAccount','findAll','options','where','include','map','attributes','model','catch','ShowSugarcrmAccount','util','bluebird','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','SugarcrmAccount,\x20%s,\x20%s','debug'];(function(_0x1cdfc5,_0x3b18bb){var _0x37ff64=function(_0x54870e){while(--_0x54870e){_0x1cdfc5['push'](_0x1cdfc5['shift']());}};_0x37ff64(++_0x3b18bb);}(_0x6d5c,0xdd));var _0xc6d5=function(_0x4480e3,_0x5cf120){_0x4480e3=_0x4480e3-0x0;var _0x4a31a6=_0x6d5c[_0x4480e3];return _0x4a31a6;};'use strict';var _=require('lodash');var util=require(_0xc6d5('0x0'));var moment=require('moment');var BPromise=require(_0xc6d5('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc6d5('0x2'));var logger=require('../../config/logger')(_0xc6d5('0x3'));var config=require(_0xc6d5('0x4'));var jayson=require(_0xc6d5('0x5'));var client=jayson['client'][_0xc6d5('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1cf433,_0x31164b,_0x5db954){return new BPromise(function(_0x1bce6d,_0x351226){return client[_0xc6d5('0x7')](_0x1cf433,_0x5db954)[_0xc6d5('0x8')](function(_0x3054c6){logger['info'](_0xc6d5('0x9'),_0x31164b,'request\x20sent');logger[_0xc6d5('0xa')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x31164b,_0xc6d5('0xb'),JSON[_0xc6d5('0xc')](_0x3054c6));if(_0x3054c6[_0xc6d5('0xd')]){if(_0x3054c6['error'][_0xc6d5('0xe')]===0x1f4){logger[_0xc6d5('0xd')](_0xc6d5('0x9'),_0x31164b,_0x3054c6['error'][_0xc6d5('0xf')]);return _0x351226(_0x3054c6[_0xc6d5('0xd')][_0xc6d5('0xf')]);}logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x31164b,_0x3054c6[_0xc6d5('0xd')]['message']);return _0x1bce6d(_0x3054c6[_0xc6d5('0xd')][_0xc6d5('0xf')]);}else{logger[_0xc6d5('0x10')](_0xc6d5('0x9'),_0x31164b,_0xc6d5('0xb'));_0x1bce6d(_0x3054c6[_0xc6d5('0x11')]['message']);}})['catch'](function(_0x5f3b36){logger[_0xc6d5('0xd')](_0xc6d5('0x9'),_0x31164b,_0x5f3b36);_0x351226(_0x5f3b36);});});}exports[_0xc6d5('0x12')]=function(_0x52c11b){var _0x26482a=this;return new Promise(function(_0x2e4e91,_0x5498db){return db[_0xc6d5('0x13')][_0xc6d5('0x14')]({'raw':_0x52c11b[_0xc6d5('0x15')]?_0x52c11b[_0xc6d5('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x52c11b[_0xc6d5('0x15')]?_0x52c11b[_0xc6d5('0x15')][_0xc6d5('0x16')]||null:null,'attributes':_0x52c11b[_0xc6d5('0x15')]?_0x52c11b[_0xc6d5('0x15')]['attributes']||null:null,'limit':_0x52c11b['options']?_0x52c11b[_0xc6d5('0x15')]['limit']||null:null,'include':_0x52c11b[_0xc6d5('0x15')]?_0x52c11b[_0xc6d5('0x15')][_0xc6d5('0x17')]?_['map'](_0x52c11b[_0xc6d5('0x15')][_0xc6d5('0x17')],function(_0x5f10a9){return{'model':db[_0x5f10a9['model']],'as':_0x5f10a9['as'],'attributes':_0x5f10a9['attributes'],'include':_0x5f10a9[_0xc6d5('0x17')]?_[_0xc6d5('0x18')](_0x5f10a9[_0xc6d5('0x17')],function(_0x129e3c){return{'model':db[_0x129e3c['model']],'as':_0x129e3c['as'],'attributes':_0x129e3c[_0xc6d5('0x19')],'include':_0x129e3c['include']?_[_0xc6d5('0x18')](_0x129e3c[_0xc6d5('0x17')],function(_0x3344c1){return{'model':db[_0x3344c1[_0xc6d5('0x1a')]],'as':_0x3344c1['as'],'attributes':_0x3344c1[_0xc6d5('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3f2bb9){logger['info'](_0xc6d5('0x12'),_0x52c11b);logger[_0xc6d5('0xa')](_0xc6d5('0x12'),_0x52c11b,JSON[_0xc6d5('0xc')](_0x3f2bb9));_0x2e4e91(_0x3f2bb9);})[_0xc6d5('0x1b')](function(_0x25544a){logger[_0xc6d5('0xd')]('GetSugarcrmAccount',_0x25544a[_0xc6d5('0xf')],_0x52c11b);_0x5498db(_0x26482a[_0xc6d5('0xd')](0x1f4,_0x25544a['message']));});});};exports[_0xc6d5('0x1c')]=function(_0x2d34a9){var _0x193f2c=this;return new Promise(function(_0x1fac30,_0x3e389f){return db[_0xc6d5('0x13')]['find']({'raw':_0x2d34a9['options']?_0x2d34a9[_0xc6d5('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x2d34a9[_0xc6d5('0x15')]?_0x2d34a9[_0xc6d5('0x15')][_0xc6d5('0x16')]||null:null,'attributes':_0x2d34a9[_0xc6d5('0x15')]?_0x2d34a9[_0xc6d5('0x15')][_0xc6d5('0x19')]||null:null,'include':_0x2d34a9[_0xc6d5('0x15')]?_0x2d34a9['options'][_0xc6d5('0x17')]?_[_0xc6d5('0x18')](_0x2d34a9[_0xc6d5('0x15')][_0xc6d5('0x17')],function(_0x1c1914){return{'model':db[_0x1c1914[_0xc6d5('0x1a')]],'as':_0x1c1914['as'],'attributes':_0x1c1914[_0xc6d5('0x19')],'include':_0x1c1914[_0xc6d5('0x17')]?_[_0xc6d5('0x18')](_0x1c1914[_0xc6d5('0x17')],function(_0x3d49e3){return{'model':db[_0x3d49e3['model']],'as':_0x3d49e3['as'],'attributes':_0x3d49e3[_0xc6d5('0x19')],'include':_0x3d49e3[_0xc6d5('0x17')]?_[_0xc6d5('0x18')](_0x3d49e3[_0xc6d5('0x17')],function(_0x34468f){return{'model':db[_0x34468f['model']],'as':_0x34468f['as'],'attributes':_0x34468f[_0xc6d5('0x19')]};}):[]};}):[]};}):[]:[]})[_0xc6d5('0x8')](function(_0x1627e4){logger[_0xc6d5('0x10')]('ShowSugarcrmAccount',_0x2d34a9);logger['debug'](_0xc6d5('0x1c'),_0x2d34a9,JSON[_0xc6d5('0xc')](_0x1627e4));_0x1fac30(_0x1627e4);})['catch'](function(_0x3fadbf){logger['error'](_0xc6d5('0x1c'),_0x3fadbf[_0xc6d5('0xf')],_0x2d34a9);_0x3e389f(_0x193f2c[_0xc6d5('0xd')](0x1f4,_0x3fadbf[_0xc6d5('0xf')]));});});}; \ No newline at end of file +var _0xd360=['request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','SugarcrmAccount','findAll','options','where','attributes','include','map','model','GetSugarcrmAccount','ShowSugarcrmAccount','raw','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','SugarcrmAccount,\x20%s,\x20%s'];(function(_0x479282,_0x580ef0){var _0x37e4cb=function(_0xdb8be8){while(--_0xdb8be8){_0x479282['push'](_0x479282['shift']());}};_0x37e4cb(++_0x580ef0);}(_0xd360,0x11d));var _0x0d36=function(_0x225828,_0x3bb4f7){_0x225828=_0x225828-0x0;var _0x5a743c=_0xd360[_0x225828];return _0x5a743c;};'use strict';var _=require('lodash');var util=require(_0x0d36('0x0'));var moment=require('moment');var BPromise=require(_0x0d36('0x1'));var rs=require(_0x0d36('0x2'));var fs=require('fs');var Redis=require(_0x0d36('0x3'));var db=require(_0x0d36('0x4'))['db'];var utils=require(_0x0d36('0x5'));var logger=require(_0x0d36('0x6'))(_0x0d36('0x7'));var config=require(_0x0d36('0x8'));var jayson=require(_0x0d36('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1210de,_0x356e27,_0x2ca3cd){return new BPromise(function(_0x24ecf7,_0x50be40){return client['request'](_0x1210de,_0x2ca3cd)[_0x0d36('0xa')](function(_0x1b0477){logger['info'](_0x0d36('0xb'),_0x356e27,_0x0d36('0xc'));logger[_0x0d36('0xd')](_0x0d36('0xe'),_0x356e27,'request\x20sent',JSON[_0x0d36('0xf')](_0x1b0477));if(_0x1b0477[_0x0d36('0x10')]){if(_0x1b0477[_0x0d36('0x10')][_0x0d36('0x11')]===0x1f4){logger['error'](_0x0d36('0xb'),_0x356e27,_0x1b0477['error'][_0x0d36('0x12')]);return _0x50be40(_0x1b0477[_0x0d36('0x10')][_0x0d36('0x12')]);}logger[_0x0d36('0x10')](_0x0d36('0xb'),_0x356e27,_0x1b0477['error'][_0x0d36('0x12')]);return _0x24ecf7(_0x1b0477[_0x0d36('0x10')][_0x0d36('0x12')]);}else{logger[_0x0d36('0x13')](_0x0d36('0xb'),_0x356e27,_0x0d36('0xc'));_0x24ecf7(_0x1b0477[_0x0d36('0x14')][_0x0d36('0x12')]);}})[_0x0d36('0x15')](function(_0x8f032a){logger[_0x0d36('0x10')](_0x0d36('0xb'),_0x356e27,_0x8f032a);_0x50be40(_0x8f032a);});});}exports['GetSugarcrmAccount']=function(_0x326570){var _0x26f4e3=this;return new Promise(function(_0x147725,_0x2a9a58){return db[_0x0d36('0x16')][_0x0d36('0x17')]({'raw':_0x326570[_0x0d36('0x18')]?_0x326570[_0x0d36('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x326570[_0x0d36('0x18')]?_0x326570[_0x0d36('0x18')][_0x0d36('0x19')]||null:null,'attributes':_0x326570[_0x0d36('0x18')]?_0x326570[_0x0d36('0x18')][_0x0d36('0x1a')]||null:null,'limit':_0x326570['options']?_0x326570['options']['limit']||null:null,'include':_0x326570[_0x0d36('0x18')]?_0x326570['options'][_0x0d36('0x1b')]?_[_0x0d36('0x1c')](_0x326570['options']['include'],function(_0x5059ea){return{'model':db[_0x5059ea[_0x0d36('0x1d')]],'as':_0x5059ea['as'],'attributes':_0x5059ea[_0x0d36('0x1a')],'include':_0x5059ea[_0x0d36('0x1b')]?_[_0x0d36('0x1c')](_0x5059ea['include'],function(_0x2983d6){return{'model':db[_0x2983d6[_0x0d36('0x1d')]],'as':_0x2983d6['as'],'attributes':_0x2983d6[_0x0d36('0x1a')],'include':_0x2983d6['include']?_[_0x0d36('0x1c')](_0x2983d6[_0x0d36('0x1b')],function(_0x5c443d){return{'model':db[_0x5c443d['model']],'as':_0x5c443d['as'],'attributes':_0x5c443d['attributes']};}):[]};}):[]};}):[]:[]})[_0x0d36('0xa')](function(_0x4187c3){logger[_0x0d36('0x13')](_0x0d36('0x1e'),_0x326570);logger[_0x0d36('0xd')]('GetSugarcrmAccount',_0x326570,JSON[_0x0d36('0xf')](_0x4187c3));_0x147725(_0x4187c3);})[_0x0d36('0x15')](function(_0xfb6087){logger[_0x0d36('0x10')]('GetSugarcrmAccount',_0xfb6087[_0x0d36('0x12')],_0x326570);_0x2a9a58(_0x26f4e3['error'](0x1f4,_0xfb6087[_0x0d36('0x12')]));});});};exports[_0x0d36('0x1f')]=function(_0x2f6479){var _0x4b143b=this;return new Promise(function(_0x3fffa0,_0x19a4ed){return db[_0x0d36('0x16')]['find']({'raw':_0x2f6479[_0x0d36('0x18')]?_0x2f6479[_0x0d36('0x18')][_0x0d36('0x20')]===undefined?!![]:![]:!![],'where':_0x2f6479[_0x0d36('0x18')]?_0x2f6479[_0x0d36('0x18')][_0x0d36('0x19')]||null:null,'attributes':_0x2f6479[_0x0d36('0x18')]?_0x2f6479[_0x0d36('0x18')][_0x0d36('0x1a')]||null:null,'include':_0x2f6479[_0x0d36('0x18')]?_0x2f6479[_0x0d36('0x18')][_0x0d36('0x1b')]?_[_0x0d36('0x1c')](_0x2f6479[_0x0d36('0x18')][_0x0d36('0x1b')],function(_0x4bcf84){return{'model':db[_0x4bcf84[_0x0d36('0x1d')]],'as':_0x4bcf84['as'],'attributes':_0x4bcf84[_0x0d36('0x1a')],'include':_0x4bcf84[_0x0d36('0x1b')]?_[_0x0d36('0x1c')](_0x4bcf84['include'],function(_0x1d1bf1){return{'model':db[_0x1d1bf1[_0x0d36('0x1d')]],'as':_0x1d1bf1['as'],'attributes':_0x1d1bf1[_0x0d36('0x1a')],'include':_0x1d1bf1[_0x0d36('0x1b')]?_[_0x0d36('0x1c')](_0x1d1bf1['include'],function(_0x45571b){return{'model':db[_0x45571b[_0x0d36('0x1d')]],'as':_0x45571b['as'],'attributes':_0x45571b[_0x0d36('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3181b7){logger[_0x0d36('0x13')]('ShowSugarcrmAccount',_0x2f6479);logger['debug']('ShowSugarcrmAccount',_0x2f6479,JSON['stringify'](_0x3181b7));_0x3fffa0(_0x3181b7);})[_0x0d36('0x15')](function(_0x1bc007){logger[_0x0d36('0x10')](_0x0d36('0x1f'),_0x1bc007[_0x0d36('0x12')],_0x2f6479);_0x19a4ed(_0x4b143b[_0x0d36('0x10')](0x1f4,_0x1bc007[_0x0d36('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index eac5ea2..917f36a 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 _0xf120=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','isAuthenticated','index','show','getFields','get','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update','delete','exports','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf120,0x15d));var _0x0f12=function(_0x2e32cf,_0x2bc295){_0x2e32cf=_0x2e32cf-0x0;var _0x35c9e2=_0xf120[_0x2e32cf];return _0x35c9e2;};'use strict';var multer=require('multer');var util=require(_0x0f12('0x0'));var path=require(_0x0f12('0x1'));var timeout=require('connect-timeout');var express=require(_0x0f12('0x2'));var router=express[_0x0f12('0x3')]();var fs_extra=require(_0x0f12('0x4'));var auth=require(_0x0f12('0x5'));var interaction=require(_0x0f12('0x6'));var config=require(_0x0f12('0x7'));var controller=require(_0x0f12('0x8'));router['get']('/',auth[_0x0f12('0x9')](),controller[_0x0f12('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x0f12('0xb')]);router['get']('/:id/fields',auth[_0x0f12('0x9')](),controller[_0x0f12('0xc')]);router[_0x0f12('0xd')](_0x0f12('0xe'),auth[_0x0f12('0x9')](),controller[_0x0f12('0xf')]);router[_0x0f12('0xd')](_0x0f12('0x10'),auth['isAuthenticated'](),controller[_0x0f12('0x11')]);router[_0x0f12('0x12')]('/',auth[_0x0f12('0x9')](),controller[_0x0f12('0x13')]);router[_0x0f12('0x14')](_0x0f12('0x15'),auth['isAuthenticated'](),controller[_0x0f12('0x16')]);router[_0x0f12('0x17')](_0x0f12('0x15'),auth['isAuthenticated'](),controller['destroy']);module[_0x0f12('0x18')]=router; \ No newline at end of file +var _0xb713=['../../components/interaction/service','./intSugarcrmConfiguration.controller','get','isAuthenticated','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x48bc67,_0x3b2b80){var _0x5f0651=function(_0x2640ed){while(--_0x2640ed){_0x48bc67['push'](_0x48bc67['shift']());}};_0x5f0651(++_0x3b2b80);}(_0xb713,0x144));var _0x3b71=function(_0x4503df,_0xfec122){_0x4503df=_0x4503df-0x0;var _0x3f1b2b=_0xb713[_0x4503df];return _0x3f1b2b;};'use strict';var multer=require(_0x3b71('0x0'));var util=require(_0x3b71('0x1'));var path=require(_0x3b71('0x2'));var timeout=require(_0x3b71('0x3'));var express=require('express');var router=express[_0x3b71('0x4')]();var fs_extra=require(_0x3b71('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3b71('0x6'));var config=require('../../config/environment');var controller=require(_0x3b71('0x7'));router[_0x3b71('0x8')]('/',auth[_0x3b71('0x9')](),controller['index']);router['get']('/:id',auth[_0x3b71('0x9')](),controller['show']);router[_0x3b71('0x8')](_0x3b71('0xa'),auth[_0x3b71('0x9')](),controller['getFields']);router['get'](_0x3b71('0xb'),auth[_0x3b71('0x9')](),controller[_0x3b71('0xc')]);router[_0x3b71('0x8')](_0x3b71('0xd'),auth['isAuthenticated'](),controller[_0x3b71('0xe')]);router[_0x3b71('0xf')]('/',auth[_0x3b71('0x9')](),controller['create']);router[_0x3b71('0x10')](_0x3b71('0x11'),auth[_0x3b71('0x9')](),controller[_0x3b71('0x12')]);router[_0x3b71('0x13')](_0x3b71('0x11'),auth[_0x3b71('0x9')](),controller[_0x3b71('0x14')]);module[_0x3b71('0x15')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 446fb4b..062002d 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 _0x297c=['sequelize','STRING'];(function(_0x3ec4d9,_0x1090e3){var _0x34df0f=function(_0x3e5444){while(--_0x3e5444){_0x3ec4d9['push'](_0x3ec4d9['shift']());}};_0x34df0f(++_0x1090e3);}(_0x297c,0x94));var _0xc297=function(_0x1ac120,_0x3e7e45){_0x1ac120=_0x1ac120-0x0;var _0x19b703=_0x297c[_0x1ac120];return _0x19b703;};'use strict';var Sequelize=require(_0xc297('0x0'));module['exports']={'name':{'type':Sequelize[_0xc297('0x1')]},'description':{'type':Sequelize[_0xc297('0x1')]}}; \ No newline at end of file +var _0xd2a3=['STRING','sequelize','exports'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xd2a3,0xa3));var _0x3d2a=function(_0x3817e2,_0x229c03){_0x3817e2=_0x3817e2-0x0;var _0x3ee4e6=_0xd2a3[_0x3817e2];return _0x3ee4e6;};'use strict';var Sequelize=require(_0x3d2a('0x0'));module[_0x3d2a('0x1')]={'name':{'type':Sequelize[_0x3d2a('0x2')]},'description':{'type':Sequelize[_0x3d2a('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index fee1bbf..1da0f5d 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 _0x798d=['type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','merge','options','includeAll','include','findAll','then','catch','params','length','create','body','find','getFields','SugarcrmField','pick','filter','nolimit','findOne','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','error','stack','name','send','index','map','SugarcrmConfiguration','rawAttributes','fieldName'];(function(_0x12191e,_0x5b2f77){var _0x212916=function(_0x71aaf0){while(--_0x71aaf0){_0x12191e['push'](_0x12191e['shift']());}};_0x212916(++_0x5b2f77);}(_0x798d,0x1b5));var _0xd798=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x798d[_0x5447fd];return _0x15b28a;};'use strict';var emlformat=require(_0xd798('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd798('0x1'));var jsonpatch=require(_0xd798('0x2'));var rp=require(_0xd798('0x3'));var moment=require(_0xd798('0x4'));var BPromise=require(_0xd798('0x5'));var Mustache=require(_0xd798('0x6'));var util=require(_0xd798('0x7'));var path=require('path');var sox=require(_0xd798('0x8'));var csv=require(_0xd798('0x9'));var ejs=require(_0xd798('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd798('0xb'));var crypto=require(_0xd798('0xc'));var jsforce=require(_0xd798('0xd'));var deskjs=require(_0xd798('0xe'));var toCsv=require(_0xd798('0x9'));var querystring=require(_0xd798('0xf'));var Papa=require('papaparse');var Redis=require(_0xd798('0x10'));var authService=require(_0xd798('0x11'));var qs=require(_0xd798('0x12'));var as=require(_0xd798('0x13'));var hardwareService=require(_0xd798('0x14'));var logger=require(_0xd798('0x15'))(_0xd798('0x16'));var utils=require(_0xd798('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xd798('0x18'));var db=require(_0xd798('0x19'))['db'];function respondWithStatusCode(_0x59f509,_0x3ca472){_0x3ca472=_0x3ca472||0xcc;return function(_0x166f02){if(_0x166f02){return _0x59f509[_0xd798('0x1a')](_0x3ca472);}return _0x59f509[_0xd798('0x1b')](_0x3ca472)[_0xd798('0x1c')]();};}function respondWithResult(_0x545ef5,_0x180487){_0x180487=_0x180487||0xc8;return function(_0x1caa4a){if(_0x1caa4a){return _0x545ef5[_0xd798('0x1b')](_0x180487)[_0xd798('0x1d')](_0x1caa4a);}};}function respondWithFilteredResult(_0x3f3f62,_0x617cc4){return function(_0x22517a){if(_0x22517a){var _0x2ed7e9=typeof _0x617cc4[_0xd798('0x1e')]===_0xd798('0x1f')&&typeof _0x617cc4[_0xd798('0x20')]===_0xd798('0x1f');var _0xe3b404=_0x22517a[_0xd798('0x21')];var _0x57201c=_0x2ed7e9?0x0:_0x617cc4['offset'];var _0x42f6cf=_0x2ed7e9?_0x22517a['count']:_0x617cc4['offset']+_0x617cc4[_0xd798('0x20')];var _0xff7acb;if(_0x42f6cf>=_0xe3b404){_0x42f6cf=_0xe3b404;_0xff7acb=0xc8;}else{_0xff7acb=0xce;}_0x3f3f62[_0xd798('0x1b')](_0xff7acb);return _0x3f3f62[_0xd798('0x22')](_0xd798('0x23'),_0x57201c+'-'+_0x42f6cf+'/'+_0xe3b404)[_0xd798('0x1d')](_0x22517a);}return null;};}function patchUpdates(_0x445c9b){return function(_0x41a88e){try{jsonpatch[_0xd798('0x24')](_0x41a88e,_0x445c9b,!![]);}catch(_0x5c798d){return BPromise[_0xd798('0x25')](_0x5c798d);}return _0x41a88e['save']();};}function saveUpdates(_0x58d11e,_0x25d6cc){return function(_0x149b51){if(_0x149b51){return _0x149b51[_0xd798('0x26')](_0x58d11e)['then'](function(_0x174fd8){return _0x174fd8;});}return null;};}function removeEntity(_0x4e6c92,_0x2f2bf6){return function(_0x471027){if(_0x471027){return _0x471027[_0xd798('0x27')]()['then'](function(){_0x4e6c92['status'](0xcc)[_0xd798('0x1c')]();});}};}function handleEntityNotFound(_0x6dea4f,_0x282dfd){return function(_0x3d8d75){if(!_0x3d8d75){_0x6dea4f[_0xd798('0x1a')](0x194);}return _0x3d8d75;};}function handleError(_0x3e14a5,_0x4c60eb){_0x4c60eb=_0x4c60eb||0x1f4;return function(_0x5c00d0){logger[_0xd798('0x28')](_0x5c00d0[_0xd798('0x29')]);if(_0x5c00d0[_0xd798('0x2a')]){delete _0x5c00d0[_0xd798('0x2a')];}_0x3e14a5[_0xd798('0x1b')](_0x4c60eb)[_0xd798('0x2b')](_0x5c00d0);};}exports[_0xd798('0x2c')]=function(_0x550c34,_0x23470b){var _0x4eb66a={},_0x32de18={},_0xed6643={'count':0x0,'rows':[]};var _0x577800=_[_0xd798('0x2d')](db[_0xd798('0x2e')][_0xd798('0x2f')],function(_0x454a21){return{'name':_0x454a21[_0xd798('0x30')],'type':_0x454a21[_0xd798('0x31')]['key']};});_0x32de18[_0xd798('0x32')]=_[_0xd798('0x2d')](_0x577800,_0xd798('0x2a'));_0x32de18[_0xd798('0x33')]=_[_0xd798('0x34')](_0x550c34[_0xd798('0x33')]);_0x32de18[_0xd798('0x35')]=_[_0xd798('0x36')](_0x32de18[_0xd798('0x32')],_0x32de18[_0xd798('0x33')]);_0x4eb66a['attributes']=_[_0xd798('0x36')](_0x32de18[_0xd798('0x32')],qs[_0xd798('0x37')](_0x550c34['query'][_0xd798('0x37')]));_0x4eb66a['attributes']=_0x4eb66a[_0xd798('0x38')]['length']?_0x4eb66a['attributes']:_0x32de18['model'];if(!_0x550c34[_0xd798('0x33')][_0xd798('0x39')]('nolimit')){_0x4eb66a['limit']=qs['limit'](_0x550c34['query'][_0xd798('0x20')]);_0x4eb66a[_0xd798('0x1e')]=qs['offset'](_0x550c34[_0xd798('0x33')][_0xd798('0x1e')]);}_0x4eb66a[_0xd798('0x3a')]=qs[_0xd798('0x3b')](_0x550c34[_0xd798('0x33')][_0xd798('0x3b')]);_0x4eb66a[_0xd798('0x3c')]=qs[_0xd798('0x35')](_['pick'](_0x550c34['query'],_0x32de18[_0xd798('0x35')]),_0x577800);if(_0x550c34['query']['filter']){_0x4eb66a['where']=_[_0xd798('0x3d')](_0x4eb66a[_0xd798('0x3c')],{'$or':_[_0xd798('0x2d')](_0x577800,function(_0x5c63d7){if(_0x5c63d7[_0xd798('0x31')]!=='VIRTUAL'){var _0x515559={};_0x515559[_0x5c63d7[_0xd798('0x2a')]]={'$like':'%'+_0x550c34[_0xd798('0x33')]['filter']+'%'};return _0x515559;}})});}_0x4eb66a=_[_0xd798('0x3d')]({},_0x4eb66a,_0x550c34[_0xd798('0x3e')]);var _0x425270={'where':_0x4eb66a[_0xd798('0x3c')]};return db[_0xd798('0x2e')]['count'](_0x425270)['then'](function(_0x208030){_0xed6643['count']=_0x208030;if(_0x550c34[_0xd798('0x33')][_0xd798('0x3f')]){_0x4eb66a[_0xd798('0x40')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0xd798('0x41')](_0x4eb66a);})[_0xd798('0x42')](function(_0x1da972){_0xed6643['rows']=_0x1da972;return _0xed6643;})[_0xd798('0x42')](respondWithFilteredResult(_0x23470b,_0x4eb66a))[_0xd798('0x43')](handleError(_0x23470b,null));};exports['show']=function(_0x5209f0,_0x36bc63){var _0x1bb0d8={'raw':![],'where':{'id':_0x5209f0[_0xd798('0x44')]['id']}},_0x3ad17c={};_0x3ad17c[_0xd798('0x32')]=_[_0xd798('0x34')](db[_0xd798('0x2e')][_0xd798('0x2f')]);_0x3ad17c[_0xd798('0x33')]=_[_0xd798('0x34')](_0x5209f0[_0xd798('0x33')]);_0x3ad17c['filters']=_[_0xd798('0x36')](_0x3ad17c[_0xd798('0x32')],_0x3ad17c[_0xd798('0x33')]);_0x1bb0d8[_0xd798('0x38')]=_[_0xd798('0x36')](_0x3ad17c[_0xd798('0x32')],qs[_0xd798('0x37')](_0x5209f0[_0xd798('0x33')][_0xd798('0x37')]));_0x1bb0d8[_0xd798('0x38')]=_0x1bb0d8[_0xd798('0x38')][_0xd798('0x45')]?_0x1bb0d8[_0xd798('0x38')]:_0x3ad17c[_0xd798('0x32')];if(_0x5209f0[_0xd798('0x33')][_0xd798('0x3f')]){_0x1bb0d8[_0xd798('0x40')]=[{'all':!![]}];}_0x1bb0d8=_[_0xd798('0x3d')]({},_0x1bb0d8,_0x5209f0['options']);return db[_0xd798('0x2e')]['find'](_0x1bb0d8)['then'](handleEntityNotFound(_0x36bc63,null))[_0xd798('0x42')](respondWithResult(_0x36bc63,null))[_0xd798('0x43')](handleError(_0x36bc63,null));};exports[_0xd798('0x46')]=function(_0x2cc3ed,_0x4c5047){return db[_0xd798('0x2e')]['create'](_0x2cc3ed[_0xd798('0x47')],{})['then'](respondWithResult(_0x4c5047,0xc9))['catch'](handleError(_0x4c5047,null));};exports[_0xd798('0x26')]=function(_0x5080d0,_0x35564d){if(_0x5080d0[_0xd798('0x47')]['id']){delete _0x5080d0[_0xd798('0x47')]['id'];}return db['SugarcrmConfiguration']['find']({'where':{'id':_0x5080d0['params']['id']}})[_0xd798('0x42')](handleEntityNotFound(_0x35564d,null))[_0xd798('0x42')](saveUpdates(_0x5080d0[_0xd798('0x47')],null))['then'](respondWithResult(_0x35564d,null))[_0xd798('0x43')](handleError(_0x35564d,null));};exports[_0xd798('0x27')]=function(_0x5dfca8,_0x45c4ba){return db[_0xd798('0x2e')][_0xd798('0x48')]({'where':{'id':_0x5dfca8[_0xd798('0x44')]['id']}})['then'](handleEntityNotFound(_0x45c4ba,null))[_0xd798('0x42')](removeEntity(_0x45c4ba,null))[_0xd798('0x43')](handleError(_0x45c4ba,null));};exports[_0xd798('0x49')]=function(_0xb369a9,_0x39b239,_0x4d593d){var _0x4ec562={};var _0x4d0829={};var _0x99c8c5;var _0x35640f;return db[_0xd798('0x2e')]['findOne']({'where':{'id':_0xb369a9[_0xd798('0x44')]['id']}})[_0xd798('0x42')](handleEntityNotFound(_0x39b239,null))[_0xd798('0x42')](function(_0x1f4be0){if(_0x1f4be0){_0x99c8c5=_0x1f4be0;_0x4d0829[_0xd798('0x32')]=_[_0xd798('0x34')](db[_0xd798('0x4a')][_0xd798('0x2f')]);_0x4d0829[_0xd798('0x33')]=_[_0xd798('0x34')](_0xb369a9['query']);_0x4d0829[_0xd798('0x35')]=_['intersection'](_0x4d0829[_0xd798('0x32')],_0x4d0829['query']);_0x4ec562['attributes']=_[_0xd798('0x36')](_0x4d0829[_0xd798('0x32')],qs['fields'](_0xb369a9['query'][_0xd798('0x37')]));_0x4ec562['attributes']=_0x4ec562[_0xd798('0x38')][_0xd798('0x45')]?_0x4ec562[_0xd798('0x38')]:_0x4d0829[_0xd798('0x32')];_0x4ec562[_0xd798('0x3a')]=qs[_0xd798('0x3b')](_0xb369a9[_0xd798('0x33')][_0xd798('0x3b')]);_0x4ec562[_0xd798('0x3c')]=qs['filters'](_[_0xd798('0x4b')](_0xb369a9[_0xd798('0x33')],_0x4d0829[_0xd798('0x35')]));if(_0xb369a9[_0xd798('0x33')]['filter']){_0x4ec562[_0xd798('0x3c')]=_['merge'](_0x4ec562[_0xd798('0x3c')],{'$or':_['map'](_0x4ec562[_0xd798('0x38')],function(_0x5b8e1d){var _0x4631a3={};_0x4631a3[_0x5b8e1d]={'$like':'%'+_0xb369a9[_0xd798('0x33')][_0xd798('0x4c')]+'%'};return _0x4631a3;})});}_0x4ec562=_[_0xd798('0x3d')]({},_0x4ec562,_0xb369a9[_0xd798('0x3e')]);return _0x99c8c5['getFields'](_0x4ec562);}})[_0xd798('0x42')](function(_0x11421f){if(_0x11421f){_0x35640f=_0x11421f[_0xd798('0x45')];if(!_0xb369a9[_0xd798('0x33')][_0xd798('0x39')](_0xd798('0x4d'))){_0x4ec562[_0xd798('0x20')]=qs[_0xd798('0x20')](_0xb369a9[_0xd798('0x33')][_0xd798('0x20')]);_0x4ec562[_0xd798('0x1e')]=qs[_0xd798('0x1e')](_0xb369a9[_0xd798('0x33')][_0xd798('0x1e')]);}return _0x99c8c5[_0xd798('0x49')](_0x4ec562);}})[_0xd798('0x42')](function(_0x43e6b2){if(_0x43e6b2){return _0x43e6b2?{'count':_0x35640f,'rows':_0x43e6b2}:null;}})[_0xd798('0x42')](respondWithResult(_0x39b239,null))[_0xd798('0x43')](handleError(_0x39b239,null));};exports['getSubjects']=function(_0x1d96e3,_0x3e1f10,_0x228daa){var _0x11c667={};var _0x4019e4={};var _0x3f0f10;var _0x3901f4;return db[_0xd798('0x2e')][_0xd798('0x4e')]({'where':{'id':_0x1d96e3[_0xd798('0x44')]['id']}})['then'](handleEntityNotFound(_0x3e1f10,null))['then'](function(_0xd97739){if(_0xd97739){_0x3f0f10=_0xd97739;_0x4019e4['model']=_[_0xd798('0x34')](db[_0xd798('0x4a')]['rawAttributes']);_0x4019e4[_0xd798('0x33')]=_[_0xd798('0x34')](_0x1d96e3['query']);_0x4019e4['filters']=_[_0xd798('0x36')](_0x4019e4[_0xd798('0x32')],_0x4019e4['query']);_0x11c667['attributes']=_[_0xd798('0x36')](_0x4019e4[_0xd798('0x32')],qs['fields'](_0x1d96e3[_0xd798('0x33')][_0xd798('0x37')]));_0x11c667['attributes']=_0x11c667[_0xd798('0x38')]['length']?_0x11c667[_0xd798('0x38')]:_0x4019e4['model'];_0x11c667['order']=qs[_0xd798('0x3b')](_0x1d96e3[_0xd798('0x33')][_0xd798('0x3b')]);_0x11c667[_0xd798('0x3c')]=qs[_0xd798('0x35')](_[_0xd798('0x4b')](_0x1d96e3[_0xd798('0x33')],_0x4019e4[_0xd798('0x35')]));if(_0x1d96e3['query']['filter']){_0x11c667['where']=_[_0xd798('0x3d')](_0x11c667[_0xd798('0x3c')],{'$or':_['map'](_0x11c667[_0xd798('0x38')],function(_0x362d37){var _0xc80b41={};_0xc80b41[_0x362d37]={'$like':'%'+_0x1d96e3[_0xd798('0x33')][_0xd798('0x4c')]+'%'};return _0xc80b41;})});}_0x11c667=_[_0xd798('0x3d')]({},_0x11c667,_0x1d96e3['options']);return _0x3f0f10['getSubjects'](_0x11c667);}})[_0xd798('0x42')](function(_0x5be3b6){if(_0x5be3b6){_0x3901f4=_0x5be3b6[_0xd798('0x45')];if(!_0x1d96e3[_0xd798('0x33')][_0xd798('0x39')](_0xd798('0x4d'))){_0x11c667['limit']=qs['limit'](_0x1d96e3[_0xd798('0x33')]['limit']);_0x11c667[_0xd798('0x1e')]=qs[_0xd798('0x1e')](_0x1d96e3[_0xd798('0x33')][_0xd798('0x1e')]);}return _0x3f0f10[_0xd798('0x4f')](_0x11c667);}})[_0xd798('0x42')](function(_0x2c70a){if(_0x2c70a){return _0x2c70a?{'count':_0x3901f4,'rows':_0x2c70a}:null;}})['then'](respondWithResult(_0x3e1f10,null))[_0xd798('0x43')](handleError(_0x3e1f10,null));};exports['getDescriptions']=function(_0x350fbd,_0x35406c,_0x7e480f){var _0x42346a={};var _0x2563b7={};var _0x262585;var _0x2c8d9f;return db[_0xd798('0x2e')][_0xd798('0x4e')]({'where':{'id':_0x350fbd[_0xd798('0x44')]['id']}})[_0xd798('0x42')](handleEntityNotFound(_0x35406c,null))['then'](function(_0x4ded25){if(_0x4ded25){_0x262585=_0x4ded25;_0x2563b7[_0xd798('0x32')]=_[_0xd798('0x34')](db[_0xd798('0x4a')]['rawAttributes']);_0x2563b7[_0xd798('0x33')]=_[_0xd798('0x34')](_0x350fbd[_0xd798('0x33')]);_0x2563b7['filters']=_['intersection'](_0x2563b7[_0xd798('0x32')],_0x2563b7[_0xd798('0x33')]);_0x42346a[_0xd798('0x38')]=_[_0xd798('0x36')](_0x2563b7[_0xd798('0x32')],qs[_0xd798('0x37')](_0x350fbd[_0xd798('0x33')]['fields']));_0x42346a[_0xd798('0x38')]=_0x42346a[_0xd798('0x38')][_0xd798('0x45')]?_0x42346a[_0xd798('0x38')]:_0x2563b7[_0xd798('0x32')];_0x42346a[_0xd798('0x3a')]=qs[_0xd798('0x3b')](_0x350fbd[_0xd798('0x33')][_0xd798('0x3b')]);_0x42346a[_0xd798('0x3c')]=qs['filters'](_[_0xd798('0x4b')](_0x350fbd[_0xd798('0x33')],_0x2563b7[_0xd798('0x35')]));if(_0x350fbd['query']['filter']){_0x42346a[_0xd798('0x3c')]=_[_0xd798('0x3d')](_0x42346a[_0xd798('0x3c')],{'$or':_[_0xd798('0x2d')](_0x42346a[_0xd798('0x38')],function(_0x3eb814){var _0x17899f={};_0x17899f[_0x3eb814]={'$like':'%'+_0x350fbd[_0xd798('0x33')]['filter']+'%'};return _0x17899f;})});}_0x42346a=_[_0xd798('0x3d')]({},_0x42346a,_0x350fbd[_0xd798('0x3e')]);return _0x262585[_0xd798('0x50')](_0x42346a);}})[_0xd798('0x42')](function(_0x210dc8){if(_0x210dc8){_0x2c8d9f=_0x210dc8[_0xd798('0x45')];if(!_0x350fbd[_0xd798('0x33')][_0xd798('0x39')](_0xd798('0x4d'))){_0x42346a[_0xd798('0x20')]=qs[_0xd798('0x20')](_0x350fbd[_0xd798('0x33')]['limit']);_0x42346a[_0xd798('0x1e')]=qs[_0xd798('0x1e')](_0x350fbd[_0xd798('0x33')][_0xd798('0x1e')]);}return _0x262585['getDescriptions'](_0x42346a);}})[_0xd798('0x42')](function(_0x665b67){if(_0x665b67){return _0x665b67?{'count':_0x2c8d9f,'rows':_0x665b67}:null;}})[_0xd798('0x42')](respondWithResult(_0x35406c,null))[_0xd798('0x43')](handleError(_0x35406c,null));}; \ No newline at end of file +var _0xe519=['eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','SugarcrmConfiguration','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','limit','sort','where','pick','merge','VIRTUAL','options','count','include','findAll','rows','catch','show','rawAttributes','find','create','body','params','getFields','findOne','SugarcrmField','order','filter','hasOwnProperty','nolimit','getSubjects','getDescriptions'];(function(_0x1cd47d,_0x55bc75){var _0x29d52f=function(_0x37737a){while(--_0x37737a){_0x1cd47d['push'](_0x1cd47d['shift']());}};_0x29d52f(++_0x55bc75);}(_0xe519,0xa4));var _0x9e51=function(_0x237703,_0x102d58){_0x237703=_0x237703-0x0;var _0x3728c4=_0xe519[_0x237703];return _0x3728c4;};'use strict';var emlformat=require(_0x9e51('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9e51('0x1'));var jsonpatch=require(_0x9e51('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9e51('0x3'));var Mustache=require(_0x9e51('0x4'));var util=require(_0x9e51('0x5'));var path=require(_0x9e51('0x6'));var sox=require('sox');var csv=require(_0x9e51('0x7'));var ejs=require(_0x9e51('0x8'));var fs=require('fs');var fs_extra=require(_0x9e51('0x9'));var _=require(_0x9e51('0xa'));var squel=require('squel');var crypto=require(_0x9e51('0xb'));var jsforce=require(_0x9e51('0xc'));var deskjs=require(_0x9e51('0xd'));var toCsv=require(_0x9e51('0x7'));var querystring=require(_0x9e51('0xe'));var Papa=require(_0x9e51('0xf'));var Redis=require(_0x9e51('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9e51('0x11'));var as=require(_0x9e51('0x12'));var hardwareService=require(_0x9e51('0x13'));var logger=require('../../config/logger')(_0x9e51('0x14'));var utils=require(_0x9e51('0x15'));var config=require(_0x9e51('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x9e51('0x17'))['db'];function respondWithStatusCode(_0x4f98d6,_0x48ff8d){_0x48ff8d=_0x48ff8d||0xcc;return function(_0x220bc4){if(_0x220bc4){return _0x4f98d6[_0x9e51('0x18')](_0x48ff8d);}return _0x4f98d6[_0x9e51('0x19')](_0x48ff8d)[_0x9e51('0x1a')]();};}function respondWithResult(_0xe90296,_0x5c3644){_0x5c3644=_0x5c3644||0xc8;return function(_0x3231c0){if(_0x3231c0){return _0xe90296[_0x9e51('0x19')](_0x5c3644)[_0x9e51('0x1b')](_0x3231c0);}};}function respondWithFilteredResult(_0x5bd4f4,_0x28e686){return function(_0x49535b){if(_0x49535b){var _0x5de61f=typeof _0x28e686[_0x9e51('0x1c')]==='undefined'&&typeof _0x28e686['limit']===_0x9e51('0x1d');var _0x5d7b9e=_0x49535b['count'];var _0x2c9fc7=_0x5de61f?0x0:_0x28e686[_0x9e51('0x1c')];var _0x1c94b5=_0x5de61f?_0x49535b['count']:_0x28e686[_0x9e51('0x1c')]+_0x28e686['limit'];var _0x12bef7;if(_0x1c94b5>=_0x5d7b9e){_0x1c94b5=_0x5d7b9e;_0x12bef7=0xc8;}else{_0x12bef7=0xce;}_0x5bd4f4[_0x9e51('0x19')](_0x12bef7);return _0x5bd4f4[_0x9e51('0x1e')](_0x9e51('0x1f'),_0x2c9fc7+'-'+_0x1c94b5+'/'+_0x5d7b9e)['json'](_0x49535b);}return null;};}function patchUpdates(_0x170eb8){return function(_0x2ecf48){try{jsonpatch[_0x9e51('0x20')](_0x2ecf48,_0x170eb8,!![]);}catch(_0x58d799){return BPromise[_0x9e51('0x21')](_0x58d799);}return _0x2ecf48[_0x9e51('0x22')]();};}function saveUpdates(_0x4feee8,_0x4fb2da){return function(_0x448ed4){if(_0x448ed4){return _0x448ed4['update'](_0x4feee8)[_0x9e51('0x23')](function(_0x5b4f32){return _0x5b4f32;});}return null;};}function removeEntity(_0x4216bc,_0x18f7e5){return function(_0x39f44e){if(_0x39f44e){return _0x39f44e[_0x9e51('0x24')]()[_0x9e51('0x23')](function(){_0x4216bc[_0x9e51('0x19')](0xcc)[_0x9e51('0x1a')]();});}};}function handleEntityNotFound(_0x47c97f,_0xa5e1a0){return function(_0x323f37){if(!_0x323f37){_0x47c97f[_0x9e51('0x18')](0x194);}return _0x323f37;};}function handleError(_0x3ca2f2,_0x34afe6){_0x34afe6=_0x34afe6||0x1f4;return function(_0x1edb85){logger[_0x9e51('0x25')](_0x1edb85[_0x9e51('0x26')]);if(_0x1edb85['name']){delete _0x1edb85[_0x9e51('0x27')];}_0x3ca2f2['status'](_0x34afe6)[_0x9e51('0x28')](_0x1edb85);};}exports[_0x9e51('0x29')]=function(_0x3ae0c2,_0x97d32d){var _0x13fa01={},_0x32f818={},_0x4f76f5={'count':0x0,'rows':[]};var _0x16afea=_[_0x9e51('0x2a')](db[_0x9e51('0x2b')]['rawAttributes'],function(_0x11894d){return{'name':_0x11894d[_0x9e51('0x2c')],'type':_0x11894d[_0x9e51('0x2d')][_0x9e51('0x2e')]};});_0x32f818['model']=_[_0x9e51('0x2a')](_0x16afea,_0x9e51('0x27'));_0x32f818[_0x9e51('0x2f')]=_[_0x9e51('0x30')](_0x3ae0c2[_0x9e51('0x2f')]);_0x32f818[_0x9e51('0x31')]=_['intersection'](_0x32f818[_0x9e51('0x32')],_0x32f818[_0x9e51('0x2f')]);_0x13fa01[_0x9e51('0x33')]=_[_0x9e51('0x34')](_0x32f818['model'],qs[_0x9e51('0x35')](_0x3ae0c2['query']['fields']));_0x13fa01[_0x9e51('0x33')]=_0x13fa01[_0x9e51('0x33')][_0x9e51('0x36')]?_0x13fa01[_0x9e51('0x33')]:_0x32f818['model'];if(!_0x3ae0c2[_0x9e51('0x2f')]['hasOwnProperty']('nolimit')){_0x13fa01[_0x9e51('0x37')]=qs[_0x9e51('0x37')](_0x3ae0c2[_0x9e51('0x2f')][_0x9e51('0x37')]);_0x13fa01[_0x9e51('0x1c')]=qs[_0x9e51('0x1c')](_0x3ae0c2[_0x9e51('0x2f')]['offset']);}_0x13fa01['order']=qs[_0x9e51('0x38')](_0x3ae0c2[_0x9e51('0x2f')][_0x9e51('0x38')]);_0x13fa01[_0x9e51('0x39')]=qs[_0x9e51('0x31')](_[_0x9e51('0x3a')](_0x3ae0c2[_0x9e51('0x2f')],_0x32f818[_0x9e51('0x31')]),_0x16afea);if(_0x3ae0c2[_0x9e51('0x2f')]['filter']){_0x13fa01[_0x9e51('0x39')]=_[_0x9e51('0x3b')](_0x13fa01['where'],{'$or':_['map'](_0x16afea,function(_0x541d40){if(_0x541d40[_0x9e51('0x2d')]!==_0x9e51('0x3c')){var _0x1dcb12={};_0x1dcb12[_0x541d40[_0x9e51('0x27')]]={'$like':'%'+_0x3ae0c2[_0x9e51('0x2f')]['filter']+'%'};return _0x1dcb12;}})});}_0x13fa01=_['merge']({},_0x13fa01,_0x3ae0c2[_0x9e51('0x3d')]);var _0x90c09e={'where':_0x13fa01[_0x9e51('0x39')]};return db[_0x9e51('0x2b')]['count'](_0x90c09e)['then'](function(_0x1ae21c){_0x4f76f5[_0x9e51('0x3e')]=_0x1ae21c;if(_0x3ae0c2[_0x9e51('0x2f')]['includeAll']){_0x13fa01[_0x9e51('0x3f')]=[{'all':!![]}];}return db[_0x9e51('0x2b')][_0x9e51('0x40')](_0x13fa01);})[_0x9e51('0x23')](function(_0x100949){_0x4f76f5[_0x9e51('0x41')]=_0x100949;return _0x4f76f5;})['then'](respondWithFilteredResult(_0x97d32d,_0x13fa01))[_0x9e51('0x42')](handleError(_0x97d32d,null));};exports[_0x9e51('0x43')]=function(_0x2c2030,_0x224344){var _0x5b77af={'raw':![],'where':{'id':_0x2c2030['params']['id']}},_0x4f9df5={};_0x4f9df5[_0x9e51('0x32')]=_[_0x9e51('0x30')](db['SugarcrmConfiguration'][_0x9e51('0x44')]);_0x4f9df5[_0x9e51('0x2f')]=_[_0x9e51('0x30')](_0x2c2030[_0x9e51('0x2f')]);_0x4f9df5['filters']=_[_0x9e51('0x34')](_0x4f9df5[_0x9e51('0x32')],_0x4f9df5[_0x9e51('0x2f')]);_0x5b77af[_0x9e51('0x33')]=_[_0x9e51('0x34')](_0x4f9df5[_0x9e51('0x32')],qs['fields'](_0x2c2030[_0x9e51('0x2f')][_0x9e51('0x35')]));_0x5b77af[_0x9e51('0x33')]=_0x5b77af[_0x9e51('0x33')][_0x9e51('0x36')]?_0x5b77af[_0x9e51('0x33')]:_0x4f9df5[_0x9e51('0x32')];if(_0x2c2030[_0x9e51('0x2f')]['includeAll']){_0x5b77af[_0x9e51('0x3f')]=[{'all':!![]}];}_0x5b77af=_['merge']({},_0x5b77af,_0x2c2030[_0x9e51('0x3d')]);return db[_0x9e51('0x2b')][_0x9e51('0x45')](_0x5b77af)['then'](handleEntityNotFound(_0x224344,null))[_0x9e51('0x23')](respondWithResult(_0x224344,null))['catch'](handleError(_0x224344,null));};exports[_0x9e51('0x46')]=function(_0x64e9f4,_0x208d29){return db[_0x9e51('0x2b')]['create'](_0x64e9f4[_0x9e51('0x47')],{})['then'](respondWithResult(_0x208d29,0xc9))[_0x9e51('0x42')](handleError(_0x208d29,null));};exports['update']=function(_0x9b964b,_0x453bc3){if(_0x9b964b[_0x9e51('0x47')]['id']){delete _0x9b964b[_0x9e51('0x47')]['id'];}return db['SugarcrmConfiguration'][_0x9e51('0x45')]({'where':{'id':_0x9b964b[_0x9e51('0x48')]['id']}})[_0x9e51('0x23')](handleEntityNotFound(_0x453bc3,null))['then'](saveUpdates(_0x9b964b[_0x9e51('0x47')],null))[_0x9e51('0x23')](respondWithResult(_0x453bc3,null))['catch'](handleError(_0x453bc3,null));};exports[_0x9e51('0x24')]=function(_0x36a1b2,_0x52407c){return db[_0x9e51('0x2b')]['find']({'where':{'id':_0x36a1b2['params']['id']}})[_0x9e51('0x23')](handleEntityNotFound(_0x52407c,null))[_0x9e51('0x23')](removeEntity(_0x52407c,null))[_0x9e51('0x42')](handleError(_0x52407c,null));};exports[_0x9e51('0x49')]=function(_0x4caf62,_0x2a0712,_0x1bdefa){var _0x3e5b47={};var _0x4cdaf6={};var _0x1af7bf;var _0x3edb67;return db[_0x9e51('0x2b')][_0x9e51('0x4a')]({'where':{'id':_0x4caf62['params']['id']}})[_0x9e51('0x23')](handleEntityNotFound(_0x2a0712,null))[_0x9e51('0x23')](function(_0x4e952a){if(_0x4e952a){_0x1af7bf=_0x4e952a;_0x4cdaf6[_0x9e51('0x32')]=_[_0x9e51('0x30')](db[_0x9e51('0x4b')][_0x9e51('0x44')]);_0x4cdaf6[_0x9e51('0x2f')]=_[_0x9e51('0x30')](_0x4caf62[_0x9e51('0x2f')]);_0x4cdaf6[_0x9e51('0x31')]=_[_0x9e51('0x34')](_0x4cdaf6['model'],_0x4cdaf6['query']);_0x3e5b47['attributes']=_[_0x9e51('0x34')](_0x4cdaf6['model'],qs[_0x9e51('0x35')](_0x4caf62['query'][_0x9e51('0x35')]));_0x3e5b47[_0x9e51('0x33')]=_0x3e5b47['attributes'][_0x9e51('0x36')]?_0x3e5b47[_0x9e51('0x33')]:_0x4cdaf6[_0x9e51('0x32')];_0x3e5b47[_0x9e51('0x4c')]=qs[_0x9e51('0x38')](_0x4caf62['query']['sort']);_0x3e5b47['where']=qs['filters'](_[_0x9e51('0x3a')](_0x4caf62['query'],_0x4cdaf6['filters']));if(_0x4caf62[_0x9e51('0x2f')][_0x9e51('0x4d')]){_0x3e5b47[_0x9e51('0x39')]=_[_0x9e51('0x3b')](_0x3e5b47[_0x9e51('0x39')],{'$or':_['map'](_0x3e5b47[_0x9e51('0x33')],function(_0x2e50e2){var _0x450498={};_0x450498[_0x2e50e2]={'$like':'%'+_0x4caf62[_0x9e51('0x2f')][_0x9e51('0x4d')]+'%'};return _0x450498;})});}_0x3e5b47=_['merge']({},_0x3e5b47,_0x4caf62[_0x9e51('0x3d')]);return _0x1af7bf[_0x9e51('0x49')](_0x3e5b47);}})['then'](function(_0x1a677a){if(_0x1a677a){_0x3edb67=_0x1a677a['length'];if(!_0x4caf62[_0x9e51('0x2f')][_0x9e51('0x4e')](_0x9e51('0x4f'))){_0x3e5b47[_0x9e51('0x37')]=qs[_0x9e51('0x37')](_0x4caf62['query'][_0x9e51('0x37')]);_0x3e5b47[_0x9e51('0x1c')]=qs[_0x9e51('0x1c')](_0x4caf62[_0x9e51('0x2f')][_0x9e51('0x1c')]);}return _0x1af7bf[_0x9e51('0x49')](_0x3e5b47);}})[_0x9e51('0x23')](function(_0x28bd01){if(_0x28bd01){return _0x28bd01?{'count':_0x3edb67,'rows':_0x28bd01}:null;}})[_0x9e51('0x23')](respondWithResult(_0x2a0712,null))[_0x9e51('0x42')](handleError(_0x2a0712,null));};exports[_0x9e51('0x50')]=function(_0x4418ef,_0x55ff26,_0x346766){var _0x2aa46c={};var _0x44f570={};var _0x4fa70f;var _0xb44cdb;return db[_0x9e51('0x2b')][_0x9e51('0x4a')]({'where':{'id':_0x4418ef[_0x9e51('0x48')]['id']}})[_0x9e51('0x23')](handleEntityNotFound(_0x55ff26,null))['then'](function(_0x598220){if(_0x598220){_0x4fa70f=_0x598220;_0x44f570['model']=_['keys'](db[_0x9e51('0x4b')][_0x9e51('0x44')]);_0x44f570[_0x9e51('0x2f')]=_[_0x9e51('0x30')](_0x4418ef[_0x9e51('0x2f')]);_0x44f570[_0x9e51('0x31')]=_[_0x9e51('0x34')](_0x44f570[_0x9e51('0x32')],_0x44f570[_0x9e51('0x2f')]);_0x2aa46c[_0x9e51('0x33')]=_[_0x9e51('0x34')](_0x44f570['model'],qs[_0x9e51('0x35')](_0x4418ef['query']['fields']));_0x2aa46c[_0x9e51('0x33')]=_0x2aa46c['attributes']['length']?_0x2aa46c[_0x9e51('0x33')]:_0x44f570[_0x9e51('0x32')];_0x2aa46c[_0x9e51('0x4c')]=qs[_0x9e51('0x38')](_0x4418ef[_0x9e51('0x2f')][_0x9e51('0x38')]);_0x2aa46c[_0x9e51('0x39')]=qs[_0x9e51('0x31')](_[_0x9e51('0x3a')](_0x4418ef[_0x9e51('0x2f')],_0x44f570['filters']));if(_0x4418ef[_0x9e51('0x2f')][_0x9e51('0x4d')]){_0x2aa46c[_0x9e51('0x39')]=_[_0x9e51('0x3b')](_0x2aa46c[_0x9e51('0x39')],{'$or':_[_0x9e51('0x2a')](_0x2aa46c[_0x9e51('0x33')],function(_0x29da5d){var _0x17c47b={};_0x17c47b[_0x29da5d]={'$like':'%'+_0x4418ef[_0x9e51('0x2f')][_0x9e51('0x4d')]+'%'};return _0x17c47b;})});}_0x2aa46c=_[_0x9e51('0x3b')]({},_0x2aa46c,_0x4418ef[_0x9e51('0x3d')]);return _0x4fa70f[_0x9e51('0x50')](_0x2aa46c);}})[_0x9e51('0x23')](function(_0x2dc504){if(_0x2dc504){_0xb44cdb=_0x2dc504[_0x9e51('0x36')];if(!_0x4418ef['query'][_0x9e51('0x4e')](_0x9e51('0x4f'))){_0x2aa46c[_0x9e51('0x37')]=qs['limit'](_0x4418ef[_0x9e51('0x2f')][_0x9e51('0x37')]);_0x2aa46c['offset']=qs[_0x9e51('0x1c')](_0x4418ef[_0x9e51('0x2f')][_0x9e51('0x1c')]);}return _0x4fa70f[_0x9e51('0x50')](_0x2aa46c);}})[_0x9e51('0x23')](function(_0x1cda8f){if(_0x1cda8f){return _0x1cda8f?{'count':_0xb44cdb,'rows':_0x1cda8f}:null;}})[_0x9e51('0x23')](respondWithResult(_0x55ff26,null))['catch'](handleError(_0x55ff26,null));};exports[_0x9e51('0x51')]=function(_0x5c9430,_0xdaf213,_0x44604d){var _0x542f24={};var _0x1a42a0={};var _0x22baf6;var _0x1f155a;return db['SugarcrmConfiguration'][_0x9e51('0x4a')]({'where':{'id':_0x5c9430[_0x9e51('0x48')]['id']}})[_0x9e51('0x23')](handleEntityNotFound(_0xdaf213,null))[_0x9e51('0x23')](function(_0x326e04){if(_0x326e04){_0x22baf6=_0x326e04;_0x1a42a0[_0x9e51('0x32')]=_[_0x9e51('0x30')](db[_0x9e51('0x4b')][_0x9e51('0x44')]);_0x1a42a0[_0x9e51('0x2f')]=_[_0x9e51('0x30')](_0x5c9430[_0x9e51('0x2f')]);_0x1a42a0['filters']=_['intersection'](_0x1a42a0[_0x9e51('0x32')],_0x1a42a0['query']);_0x542f24[_0x9e51('0x33')]=_['intersection'](_0x1a42a0['model'],qs[_0x9e51('0x35')](_0x5c9430['query']['fields']));_0x542f24[_0x9e51('0x33')]=_0x542f24[_0x9e51('0x33')][_0x9e51('0x36')]?_0x542f24[_0x9e51('0x33')]:_0x1a42a0[_0x9e51('0x32')];_0x542f24[_0x9e51('0x4c')]=qs['sort'](_0x5c9430[_0x9e51('0x2f')]['sort']);_0x542f24[_0x9e51('0x39')]=qs[_0x9e51('0x31')](_[_0x9e51('0x3a')](_0x5c9430[_0x9e51('0x2f')],_0x1a42a0[_0x9e51('0x31')]));if(_0x5c9430['query'][_0x9e51('0x4d')]){_0x542f24['where']=_[_0x9e51('0x3b')](_0x542f24[_0x9e51('0x39')],{'$or':_[_0x9e51('0x2a')](_0x542f24[_0x9e51('0x33')],function(_0x3d849a){var _0x24509f={};_0x24509f[_0x3d849a]={'$like':'%'+_0x5c9430[_0x9e51('0x2f')][_0x9e51('0x4d')]+'%'};return _0x24509f;})});}_0x542f24=_[_0x9e51('0x3b')]({},_0x542f24,_0x5c9430[_0x9e51('0x3d')]);return _0x22baf6[_0x9e51('0x51')](_0x542f24);}})[_0x9e51('0x23')](function(_0x350613){if(_0x350613){_0x1f155a=_0x350613[_0x9e51('0x36')];if(!_0x5c9430['query'][_0x9e51('0x4e')]('nolimit')){_0x542f24[_0x9e51('0x37')]=qs[_0x9e51('0x37')](_0x5c9430[_0x9e51('0x2f')][_0x9e51('0x37')]);_0x542f24[_0x9e51('0x1c')]=qs[_0x9e51('0x1c')](_0x5c9430[_0x9e51('0x2f')]['offset']);}return _0x22baf6[_0x9e51('0x51')](_0x542f24);}})[_0x9e51('0x23')](function(_0x3bd6b4){if(_0x3bd6b4){return _0x3bd6b4?{'count':_0x1f155a,'rows':_0x3bd6b4}:null;}})[_0x9e51('0x23')](respondWithResult(_0xdaf213,null))['catch'](handleError(_0xdaf213,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 098454d..ed7580f 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 _0x30a6=['int_sugarcrm_configurations','lodash','util','../../config/logger','moment','request-promise','rimraf','exports','SugarcrmConfiguration'];(function(_0x2f3be0,_0xeb3185){var _0x6f521b=function(_0x4dd448){while(--_0x4dd448){_0x2f3be0['push'](_0x2f3be0['shift']());}};_0x6f521b(++_0xeb3185);}(_0x30a6,0x1b1));var _0x630a=function(_0x4240b4,_0x465ffc){_0x4240b4=_0x4240b4-0x0;var _0x42a58b=_0x30a6[_0x4240b4];return _0x42a58b;};'use strict';var _=require(_0x630a('0x0'));var util=require(_0x630a('0x1'));var logger=require(_0x630a('0x2'))('api');var moment=require(_0x630a('0x3'));var BPromise=require('bluebird');var rp=require(_0x630a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x630a('0x5'));var config=require('../../config/environment');var attributes=require('./intSugarcrmConfiguration.attributes');module[_0x630a('0x6')]=function(_0x12c321,_0x13329e){return _0x12c321['define'](_0x630a('0x7'),attributes,{'tableName':_0x630a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5277=['path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','define','int_sugarcrm_configurations','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x597713,_0x5db9c8){var _0x248946=function(_0x547ce0){while(--_0x547ce0){_0x597713['push'](_0x597713['shift']());}};_0x248946(++_0x5db9c8);}(_0x5277,0xde));var _0x7527=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5277[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0x7527('0x0'));var logger=require(_0x7527('0x1'))(_0x7527('0x2'));var moment=require(_0x7527('0x3'));var BPromise=require(_0x7527('0x4'));var rp=require(_0x7527('0x5'));var fs=require('fs');var path=require(_0x7527('0x6'));var rimraf=require(_0x7527('0x7'));var config=require(_0x7527('0x8'));var attributes=require(_0x7527('0x9'));module['exports']=function(_0x46e0e6,_0x3e5c75){return _0x46e0e6[_0x7527('0xa')]('SugarcrmConfiguration',attributes,{'tableName':_0x7527('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 663023f..f928ac3 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 _0x9a2a=['SugarcrmConfiguration,\x20%s,\x20%s','catch','lodash','util','moment','ioredis','../../mysqldb','rpc','../../config/environment','client','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x51edaf,_0x1a704e){var _0x4ef397=function(_0x34884d){while(--_0x34884d){_0x51edaf['push'](_0x51edaf['shift']());}};_0x4ef397(++_0x1a704e);}(_0x9a2a,0xe6));var _0xa9a2=function(_0x108c5b,_0x52c0fb){_0x108c5b=_0x108c5b-0x0;var _0x2afb52=_0x9a2a[_0x108c5b];return _0x2afb52;};'use strict';var _=require(_0xa9a2('0x0'));var util=require(_0xa9a2('0x1'));var moment=require(_0xa9a2('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa9a2('0x3'));var db=require(_0xa9a2('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa9a2('0x5'));var config=require(_0xa9a2('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xa9a2('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x214bb9,_0x3976f2,_0x3bfb6e){return new BPromise(function(_0x4468e7,_0x4f3a45){return client[_0xa9a2('0x8')](_0x214bb9,_0x3bfb6e)[_0xa9a2('0x9')](function(_0x545160){logger[_0xa9a2('0xa')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x3976f2,'request\x20sent');logger['debug'](_0xa9a2('0xb'),_0x3976f2,_0xa9a2('0xc'),JSON[_0xa9a2('0xd')](_0x545160));if(_0x545160[_0xa9a2('0xe')]){if(_0x545160[_0xa9a2('0xe')][_0xa9a2('0xf')]===0x1f4){logger[_0xa9a2('0xe')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x3976f2,_0x545160[_0xa9a2('0xe')]['message']);return _0x4f3a45(_0x545160[_0xa9a2('0xe')][_0xa9a2('0x10')]);}logger['error'](_0xa9a2('0x11'),_0x3976f2,_0x545160[_0xa9a2('0xe')][_0xa9a2('0x10')]);return _0x4468e7(_0x545160['error'][_0xa9a2('0x10')]);}else{logger[_0xa9a2('0xa')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x3976f2,_0xa9a2('0xc'));_0x4468e7(_0x545160['result'][_0xa9a2('0x10')]);}})[_0xa9a2('0x12')](function(_0x3cef14){logger[_0xa9a2('0xe')](_0xa9a2('0x11'),_0x3976f2,_0x3cef14);_0x4f3a45(_0x3cef14);});});} \ No newline at end of file +var _0x9b83=['code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error'];(function(_0x245801,_0x3d8556){var _0xbbe558=function(_0x112791){while(--_0x112791){_0x245801['push'](_0x245801['shift']());}};_0xbbe558(++_0x3d8556);}(_0x9b83,0x1e6));var _0x39b8=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0x9b83[_0x2faddb];return _0x273c05;};'use strict';var _=require(_0x39b8('0x0'));var util=require(_0x39b8('0x1'));var moment=require('moment');var BPromise=require(_0x39b8('0x2'));var rs=require(_0x39b8('0x3'));var fs=require('fs');var Redis=require(_0x39b8('0x4'));var db=require(_0x39b8('0x5'))['db'];var utils=require(_0x39b8('0x6'));var logger=require(_0x39b8('0x7'))(_0x39b8('0x8'));var config=require(_0x39b8('0x9'));var jayson=require(_0x39b8('0xa'));var client=jayson[_0x39b8('0xb')][_0x39b8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x58e98c,_0x2c1d10,_0x3014f9){return new BPromise(function(_0xc7d24b,_0x579ac7){return client[_0x39b8('0xd')](_0x58e98c,_0x3014f9)['then'](function(_0x3779ec){logger[_0x39b8('0xe')](_0x39b8('0xf'),_0x2c1d10,_0x39b8('0x10'));logger[_0x39b8('0x11')](_0x39b8('0x12'),_0x2c1d10,_0x39b8('0x10'),JSON['stringify'](_0x3779ec));if(_0x3779ec[_0x39b8('0x13')]){if(_0x3779ec[_0x39b8('0x13')][_0x39b8('0x14')]===0x1f4){logger[_0x39b8('0x13')](_0x39b8('0xf'),_0x2c1d10,_0x3779ec['error'][_0x39b8('0x15')]);return _0x579ac7(_0x3779ec['error'][_0x39b8('0x15')]);}logger[_0x39b8('0x13')](_0x39b8('0xf'),_0x2c1d10,_0x3779ec[_0x39b8('0x13')][_0x39b8('0x15')]);return _0xc7d24b(_0x3779ec[_0x39b8('0x13')][_0x39b8('0x15')]);}else{logger[_0x39b8('0xe')](_0x39b8('0xf'),_0x2c1d10,_0x39b8('0x10'));_0xc7d24b(_0x3779ec[_0x39b8('0x16')][_0x39b8('0x15')]);}})['catch'](function(_0x477210){logger[_0x39b8('0x13')](_0x39b8('0xf'),_0x2c1d10,_0x477210);_0x579ac7(_0x477210);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index db82f57..ba1aebd 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 _0xb806=['../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','post','create','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1bd975,_0x38fa60){var _0x326e33=function(_0x649dbb){while(--_0x649dbb){_0x1bd975['push'](_0x1bd975['shift']());}};_0x326e33(++_0x38fa60);}(_0xb806,0x1e6));var _0x6b80=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xb806[_0x3b0731];return _0x4204d7;};'use strict';var multer=require(_0x6b80('0x0'));var util=require(_0x6b80('0x1'));var path=require(_0x6b80('0x2'));var timeout=require(_0x6b80('0x3'));var express=require('express');var router=express[_0x6b80('0x4')]();var fs_extra=require(_0x6b80('0x5'));var auth=require(_0x6b80('0x6'));var interaction=require(_0x6b80('0x7'));var config=require(_0x6b80('0x8'));var controller=require(_0x6b80('0x9'));router[_0x6b80('0xa')]('/',auth[_0x6b80('0xb')](),controller[_0x6b80('0xc')]);router[_0x6b80('0xa')](_0x6b80('0xd'),auth[_0x6b80('0xb')](),controller['show']);router[_0x6b80('0xe')]('/',auth[_0x6b80('0xb')](),controller[_0x6b80('0xf')]);router['put']('/:id',auth[_0x6b80('0xb')](),controller[_0x6b80('0x10')]);router[_0x6b80('0x11')](_0x6b80('0xd'),auth[_0x6b80('0xb')](),controller[_0x6b80('0x12')]);module['exports']=router; \ No newline at end of file +var _0xe18f=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/:id','isAuthenticated','show','create','delete','destroy','exports','multer'];(function(_0x3c8f7d,_0x2dda8b){var _0x32d77e=function(_0x4aafb0){while(--_0x4aafb0){_0x3c8f7d['push'](_0x3c8f7d['shift']());}};_0x32d77e(++_0x2dda8b);}(_0xe18f,0x176));var _0xfe18=function(_0x55e103,_0x1afde9){_0x55e103=_0x55e103-0x0;var _0x248786=_0xe18f[_0x55e103];return _0x248786;};'use strict';var multer=require(_0xfe18('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xfe18('0x1'));var express=require('express');var router=express[_0xfe18('0x2')]();var fs_extra=require(_0xfe18('0x3'));var auth=require(_0xfe18('0x4'));var interaction=require(_0xfe18('0x5'));var config=require(_0xfe18('0x6'));var controller=require('./intSugarcrmField.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xfe18('0x7')]);router['get'](_0xfe18('0x8'),auth[_0xfe18('0x9')](),controller[_0xfe18('0xa')]);router['post']('/',auth[_0xfe18('0x9')](),controller[_0xfe18('0xb')]);router['put']('/:id',auth[_0xfe18('0x9')](),controller['update']);router[_0xfe18('0xc')](_0xfe18('0x8'),auth[_0xfe18('0x9')](),controller[_0xfe18('0xd')]);module[_0xfe18('0xe')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index a60db0e..fa4d240 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 _0x2f80=['sequelize','exports','ENUM','string','variable','keyValue','picklist','STRING','customVariable'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x2f80,0x195));var _0x02f8=function(_0x1bc44,_0x5eccfd){_0x1bc44=_0x1bc44-0x0;var _0xe4cc58=_0x2f80[_0x1bc44];return _0xe4cc58;};'use strict';var Sequelize=require(_0x02f8('0x0'));module[_0x02f8('0x1')]={'type':{'type':Sequelize[_0x02f8('0x2')](_0x02f8('0x3'),_0x02f8('0x4'),'customVariable',_0x02f8('0x5'),_0x02f8('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x02f8('0x7')]},'keyType':{'type':Sequelize['ENUM']('string',_0x02f8('0x4'),_0x02f8('0x8'))},'keyContent':{'type':Sequelize[_0x02f8('0x7')]},'idField':{'type':Sequelize[_0x02f8('0x7')]},'nameField':{'type':Sequelize[_0x02f8('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x02f8('0x7')]}}; \ No newline at end of file +var _0xc525=['exports','ENUM','string','variable','customVariable','picklist','STRING','BOOLEAN','sequelize'];(function(_0xf57918,_0x5e46bc){var _0x35401a=function(_0x5813c0){while(--_0x5813c0){_0xf57918['push'](_0xf57918['shift']());}};_0x35401a(++_0x5e46bc);}(_0xc525,0x116));var _0x5c52=function(_0x9e4716,_0x41a790){_0x9e4716=_0x9e4716-0x0;var _0x53d306=_0xc525[_0x9e4716];return _0x53d306;};'use strict';var Sequelize=require(_0x5c52('0x0'));module[_0x5c52('0x1')]={'type':{'type':Sequelize[_0x5c52('0x2')](_0x5c52('0x3'),_0x5c52('0x4'),_0x5c52('0x5'),'keyValue',_0x5c52('0x6')),'defaultValue':_0x5c52('0x3')},'content':{'type':Sequelize[_0x5c52('0x7')]},'key':{'type':Sequelize[_0x5c52('0x7')]},'keyType':{'type':Sequelize[_0x5c52('0x2')]('string',_0x5c52('0x4'),_0x5c52('0x5'))},'keyContent':{'type':Sequelize[_0x5c52('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x5c52('0x7')]},'customField':{'type':Sequelize[_0x5c52('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5c52('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 2370992..0ea9f0a 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 _0xcd1b=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','limit','count','offset','status','set','Content-Range','destroy','then','stack','name','index','map','SugarcrmField','rawAttributes','fieldName','model','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','keys','create','body','find','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x3ae4bf,_0x554978){var _0x27f7dd=function(_0x406997){while(--_0x406997){_0x3ae4bf['push'](_0x3ae4bf['shift']());}};_0x27f7dd(++_0x554978);}(_0xcd1b,0x1a7));var _0xbcd1=function(_0x49a122,_0x410708){_0x49a122=_0x49a122-0x0;var _0x20e6ab=_0xcd1b[_0x49a122];return _0x20e6ab;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbcd1('0x0'));var zipdir=require(_0xbcd1('0x1'));var jsonpatch=require(_0xbcd1('0x2'));var rp=require(_0xbcd1('0x3'));var moment=require(_0xbcd1('0x4'));var BPromise=require(_0xbcd1('0x5'));var Mustache=require(_0xbcd1('0x6'));var util=require(_0xbcd1('0x7'));var path=require(_0xbcd1('0x8'));var sox=require(_0xbcd1('0x9'));var csv=require(_0xbcd1('0xa'));var ejs=require(_0xbcd1('0xb'));var fs=require('fs');var fs_extra=require(_0xbcd1('0xc'));var _=require(_0xbcd1('0xd'));var squel=require(_0xbcd1('0xe'));var crypto=require(_0xbcd1('0xf'));var jsforce=require(_0xbcd1('0x10'));var deskjs=require(_0xbcd1('0x11'));var toCsv=require('to-csv');var querystring=require(_0xbcd1('0x12'));var Papa=require(_0xbcd1('0x13'));var Redis=require('ioredis');var authService=require(_0xbcd1('0x14'));var qs=require(_0xbcd1('0x15'));var as=require(_0xbcd1('0x16'));var hardwareService=require(_0xbcd1('0x17'));var logger=require(_0xbcd1('0x18'))('api');var utils=require(_0xbcd1('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xbcd1('0x1a'));var db=require(_0xbcd1('0x1b'))['db'];function respondWithStatusCode(_0x3e6dca,_0x51c84a){_0x51c84a=_0x51c84a||0xcc;return function(_0x570631){if(_0x570631){return _0x3e6dca[_0xbcd1('0x1c')](_0x51c84a);}return _0x3e6dca['status'](_0x51c84a)[_0xbcd1('0x1d')]();};}function respondWithResult(_0x26e934,_0x50945e){_0x50945e=_0x50945e||0xc8;return function(_0x57c6c7){if(_0x57c6c7){return _0x26e934['status'](_0x50945e)[_0xbcd1('0x1e')](_0x57c6c7);}};}function respondWithFilteredResult(_0x2004fc,_0x2806ad){return function(_0x510e30){if(_0x510e30){var _0x4553c0=typeof _0x2806ad['offset']===_0xbcd1('0x1f')&&typeof _0x2806ad[_0xbcd1('0x20')]===_0xbcd1('0x1f');var _0x558d5b=_0x510e30[_0xbcd1('0x21')];var _0x51c9e3=_0x4553c0?0x0:_0x2806ad['offset'];var _0x4ad222=_0x4553c0?_0x510e30[_0xbcd1('0x21')]:_0x2806ad[_0xbcd1('0x22')]+_0x2806ad[_0xbcd1('0x20')];var _0x14f191;if(_0x4ad222>=_0x558d5b){_0x4ad222=_0x558d5b;_0x14f191=0xc8;}else{_0x14f191=0xce;}_0x2004fc[_0xbcd1('0x23')](_0x14f191);return _0x2004fc[_0xbcd1('0x24')](_0xbcd1('0x25'),_0x51c9e3+'-'+_0x4ad222+'/'+_0x558d5b)[_0xbcd1('0x1e')](_0x510e30);}return null;};}function patchUpdates(_0x2fe912){return function(_0x2f529e){try{jsonpatch['apply'](_0x2f529e,_0x2fe912,!![]);}catch(_0x3206ab){return BPromise['reject'](_0x3206ab);}return _0x2f529e['save']();};}function saveUpdates(_0x59e756,_0x4f30d5){return function(_0x3f5379){if(_0x3f5379){return _0x3f5379['update'](_0x59e756)['then'](function(_0x1f2c93){return _0x1f2c93;});}return null;};}function removeEntity(_0x3df91a,_0x123739){return function(_0x1c36cb){if(_0x1c36cb){return _0x1c36cb[_0xbcd1('0x26')]()[_0xbcd1('0x27')](function(){_0x3df91a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x8935aa,_0x433c60){return function(_0x2790c0){if(!_0x2790c0){_0x8935aa[_0xbcd1('0x1c')](0x194);}return _0x2790c0;};}function handleError(_0x1377d9,_0x51eff4){_0x51eff4=_0x51eff4||0x1f4;return function(_0x12c30e){logger['error'](_0x12c30e[_0xbcd1('0x28')]);if(_0x12c30e['name']){delete _0x12c30e[_0xbcd1('0x29')];}_0x1377d9[_0xbcd1('0x23')](_0x51eff4)['send'](_0x12c30e);};}exports[_0xbcd1('0x2a')]=function(_0x3c2264,_0x2347b3){var _0x30eb3e={},_0x204488={},_0x2eb745={'count':0x0,'rows':[]};var _0x108145=_[_0xbcd1('0x2b')](db[_0xbcd1('0x2c')][_0xbcd1('0x2d')],function(_0x42c38c){return{'name':_0x42c38c[_0xbcd1('0x2e')],'type':_0x42c38c['type']['key']};});_0x204488[_0xbcd1('0x2f')]=_[_0xbcd1('0x2b')](_0x108145,'name');_0x204488[_0xbcd1('0x30')]=_['keys'](_0x3c2264[_0xbcd1('0x30')]);_0x204488[_0xbcd1('0x31')]=_['intersection'](_0x204488[_0xbcd1('0x2f')],_0x204488['query']);_0x30eb3e[_0xbcd1('0x32')]=_[_0xbcd1('0x33')](_0x204488[_0xbcd1('0x2f')],qs[_0xbcd1('0x34')](_0x3c2264[_0xbcd1('0x30')]['fields']));_0x30eb3e[_0xbcd1('0x32')]=_0x30eb3e[_0xbcd1('0x32')][_0xbcd1('0x35')]?_0x30eb3e[_0xbcd1('0x32')]:_0x204488[_0xbcd1('0x2f')];if(!_0x3c2264['query']['hasOwnProperty'](_0xbcd1('0x36'))){_0x30eb3e['limit']=qs['limit'](_0x3c2264[_0xbcd1('0x30')]['limit']);_0x30eb3e[_0xbcd1('0x22')]=qs[_0xbcd1('0x22')](_0x3c2264[_0xbcd1('0x30')]['offset']);}_0x30eb3e[_0xbcd1('0x37')]=qs['sort'](_0x3c2264[_0xbcd1('0x30')][_0xbcd1('0x38')]);_0x30eb3e[_0xbcd1('0x39')]=qs[_0xbcd1('0x31')](_['pick'](_0x3c2264['query'],_0x204488[_0xbcd1('0x31')]),_0x108145);if(_0x3c2264[_0xbcd1('0x30')]['filter']){_0x30eb3e[_0xbcd1('0x39')]=_[_0xbcd1('0x3a')](_0x30eb3e[_0xbcd1('0x39')],{'$or':_[_0xbcd1('0x2b')](_0x108145,function(_0x1692cf){if(_0x1692cf[_0xbcd1('0x3b')]!==_0xbcd1('0x3c')){var _0x31527e={};_0x31527e[_0x1692cf[_0xbcd1('0x29')]]={'$like':'%'+_0x3c2264['query']['filter']+'%'};return _0x31527e;}})});}_0x30eb3e=_['merge']({},_0x30eb3e,_0x3c2264[_0xbcd1('0x3d')]);var _0x109156={'where':_0x30eb3e[_0xbcd1('0x39')]};return db[_0xbcd1('0x2c')]['count'](_0x109156)[_0xbcd1('0x27')](function(_0x1d633d){_0x2eb745[_0xbcd1('0x21')]=_0x1d633d;if(_0x3c2264['query'][_0xbcd1('0x3e')]){_0x30eb3e[_0xbcd1('0x3f')]=[{'all':!![]}];}return db[_0xbcd1('0x2c')]['findAll'](_0x30eb3e);})['then'](function(_0x3b5e62){_0x2eb745[_0xbcd1('0x40')]=_0x3b5e62;return _0x2eb745;})[_0xbcd1('0x27')](respondWithFilteredResult(_0x2347b3,_0x30eb3e))[_0xbcd1('0x41')](handleError(_0x2347b3,null));};exports[_0xbcd1('0x42')]=function(_0x201cf2,_0x7d9e12){var _0xdae98c={'raw':!![],'where':{'id':_0x201cf2['params']['id']}},_0x4852bb={};_0x4852bb[_0xbcd1('0x2f')]=_['keys'](db[_0xbcd1('0x2c')][_0xbcd1('0x2d')]);_0x4852bb[_0xbcd1('0x30')]=_[_0xbcd1('0x43')](_0x201cf2[_0xbcd1('0x30')]);_0x4852bb['filters']=_['intersection'](_0x4852bb[_0xbcd1('0x2f')],_0x4852bb[_0xbcd1('0x30')]);_0xdae98c[_0xbcd1('0x32')]=_[_0xbcd1('0x33')](_0x4852bb[_0xbcd1('0x2f')],qs['fields'](_0x201cf2[_0xbcd1('0x30')][_0xbcd1('0x34')]));_0xdae98c[_0xbcd1('0x32')]=_0xdae98c['attributes'][_0xbcd1('0x35')]?_0xdae98c[_0xbcd1('0x32')]:_0x4852bb[_0xbcd1('0x2f')];if(_0x201cf2[_0xbcd1('0x30')][_0xbcd1('0x3e')]){_0xdae98c['include']=[{'all':!![]}];}_0xdae98c=_[_0xbcd1('0x3a')]({},_0xdae98c,_0x201cf2[_0xbcd1('0x3d')]);return db[_0xbcd1('0x2c')]['find'](_0xdae98c)['then'](handleEntityNotFound(_0x7d9e12,null))[_0xbcd1('0x27')](respondWithResult(_0x7d9e12,null))[_0xbcd1('0x41')](handleError(_0x7d9e12,null));};exports[_0xbcd1('0x44')]=function(_0x398507,_0x4f4e5d){return db['SugarcrmField'][_0xbcd1('0x44')](_0x398507[_0xbcd1('0x45')],{})[_0xbcd1('0x27')](respondWithResult(_0x4f4e5d,0xc9))[_0xbcd1('0x41')](handleError(_0x4f4e5d,null));};exports['update']=function(_0x517fe5,_0x4a7578){if(_0x517fe5[_0xbcd1('0x45')]['id']){delete _0x517fe5[_0xbcd1('0x45')]['id'];}return db[_0xbcd1('0x2c')][_0xbcd1('0x46')]({'where':{'id':_0x517fe5[_0xbcd1('0x47')]['id']}})[_0xbcd1('0x27')](handleEntityNotFound(_0x4a7578,null))[_0xbcd1('0x27')](saveUpdates(_0x517fe5['body'],null))[_0xbcd1('0x27')](respondWithResult(_0x4a7578,null))[_0xbcd1('0x41')](handleError(_0x4a7578,null));};exports[_0xbcd1('0x26')]=function(_0x4870a7,_0x399295){return db[_0xbcd1('0x2c')][_0xbcd1('0x46')]({'where':{'id':_0x4870a7[_0xbcd1('0x47')]['id']}})['then'](handleEntityNotFound(_0x399295,null))['then'](removeEntity(_0x399295,null))[_0xbcd1('0x41')](handleError(_0x399295,null));}; \ No newline at end of file +var _0x188a=['ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','save','update','then','destroy','end','error','stack','name','send','SugarcrmField','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','findAll','rows','catch','show','keys','length','includeAll','options','find','create','body','params','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv'];(function(_0x3c904b,_0x2923b9){var _0x5d6a4e=function(_0x246a62){while(--_0x246a62){_0x3c904b['push'](_0x3c904b['shift']());}};_0x5d6a4e(++_0x2923b9);}(_0x188a,0x178));var _0xa188=function(_0x3b6b24,_0xc17156){_0x3b6b24=_0x3b6b24-0x0;var _0x477940=_0x188a[_0x3b6b24];return _0x477940;};'use strict';var emlformat=require(_0xa188('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa188('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa188('0x2'));var moment=require(_0xa188('0x3'));var BPromise=require(_0xa188('0x4'));var Mustache=require('mustache');var util=require(_0xa188('0x5'));var path=require(_0xa188('0x6'));var sox=require(_0xa188('0x7'));var csv=require(_0xa188('0x8'));var ejs=require(_0xa188('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa188('0xa'));var squel=require(_0xa188('0xb'));var crypto=require(_0xa188('0xc'));var jsforce=require(_0xa188('0xd'));var deskjs=require(_0xa188('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa188('0xf'));var Papa=require(_0xa188('0x10'));var Redis=require(_0xa188('0x11'));var authService=require(_0xa188('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa188('0x13'));var hardwareService=require(_0xa188('0x14'));var logger=require(_0xa188('0x15'))(_0xa188('0x16'));var utils=require(_0xa188('0x17'));var config=require(_0xa188('0x18'));var licenseUtil=require(_0xa188('0x19'));var db=require(_0xa188('0x1a'))['db'];function respondWithStatusCode(_0x5bf8d8,_0x3c0163){_0x3c0163=_0x3c0163||0xcc;return function(_0x5d22f3){if(_0x5d22f3){return _0x5bf8d8[_0xa188('0x1b')](_0x3c0163);}return _0x5bf8d8['status'](_0x3c0163)['end']();};}function respondWithResult(_0x36d7ae,_0x2c1dc9){_0x2c1dc9=_0x2c1dc9||0xc8;return function(_0xec2f06){if(_0xec2f06){return _0x36d7ae[_0xa188('0x1c')](_0x2c1dc9)[_0xa188('0x1d')](_0xec2f06);}};}function respondWithFilteredResult(_0x1d6616,_0x42125e){return function(_0x16efcc){if(_0x16efcc){var _0x42d741=typeof _0x42125e['offset']===_0xa188('0x1e')&&typeof _0x42125e[_0xa188('0x1f')]===_0xa188('0x1e');var _0x3068ac=_0x16efcc[_0xa188('0x20')];var _0x572ece=_0x42d741?0x0:_0x42125e[_0xa188('0x21')];var _0x13e32e=_0x42d741?_0x16efcc[_0xa188('0x20')]:_0x42125e[_0xa188('0x21')]+_0x42125e['limit'];var _0x1b9d07;if(_0x13e32e>=_0x3068ac){_0x13e32e=_0x3068ac;_0x1b9d07=0xc8;}else{_0x1b9d07=0xce;}_0x1d6616[_0xa188('0x1c')](_0x1b9d07);return _0x1d6616[_0xa188('0x22')](_0xa188('0x23'),_0x572ece+'-'+_0x13e32e+'/'+_0x3068ac)[_0xa188('0x1d')](_0x16efcc);}return null;};}function patchUpdates(_0x540c71){return function(_0x1f5b06){try{jsonpatch['apply'](_0x1f5b06,_0x540c71,!![]);}catch(_0x1f5cba){return BPromise['reject'](_0x1f5cba);}return _0x1f5b06[_0xa188('0x24')]();};}function saveUpdates(_0xcf8a1,_0x3bcddc){return function(_0x54bb35){if(_0x54bb35){return _0x54bb35[_0xa188('0x25')](_0xcf8a1)[_0xa188('0x26')](function(_0x3e8d5d){return _0x3e8d5d;});}return null;};}function removeEntity(_0x4a0260,_0xc4563c){return function(_0x3662f6){if(_0x3662f6){return _0x3662f6[_0xa188('0x27')]()[_0xa188('0x26')](function(){_0x4a0260[_0xa188('0x1c')](0xcc)[_0xa188('0x28')]();});}};}function handleEntityNotFound(_0x144695,_0x283514){return function(_0x3c7034){if(!_0x3c7034){_0x144695[_0xa188('0x1b')](0x194);}return _0x3c7034;};}function handleError(_0x224699,_0x41f36e){_0x41f36e=_0x41f36e||0x1f4;return function(_0x410ee5){logger[_0xa188('0x29')](_0x410ee5[_0xa188('0x2a')]);if(_0x410ee5[_0xa188('0x2b')]){delete _0x410ee5[_0xa188('0x2b')];}_0x224699[_0xa188('0x1c')](_0x41f36e)[_0xa188('0x2c')](_0x410ee5);};}exports['index']=function(_0x40702e,_0x4c96c2){var _0x515516={},_0x177565={},_0x4dc31d={'count':0x0,'rows':[]};var _0x17af37=_['map'](db[_0xa188('0x2d')][_0xa188('0x2e')],function(_0xcedfa4){return{'name':_0xcedfa4[_0xa188('0x2f')],'type':_0xcedfa4[_0xa188('0x30')][_0xa188('0x31')]};});_0x177565[_0xa188('0x32')]=_[_0xa188('0x33')](_0x17af37,_0xa188('0x2b'));_0x177565[_0xa188('0x34')]=_['keys'](_0x40702e[_0xa188('0x34')]);_0x177565[_0xa188('0x35')]=_['intersection'](_0x177565[_0xa188('0x32')],_0x177565[_0xa188('0x34')]);_0x515516[_0xa188('0x36')]=_[_0xa188('0x37')](_0x177565[_0xa188('0x32')],qs[_0xa188('0x38')](_0x40702e[_0xa188('0x34')][_0xa188('0x38')]));_0x515516['attributes']=_0x515516['attributes']['length']?_0x515516[_0xa188('0x36')]:_0x177565[_0xa188('0x32')];if(!_0x40702e[_0xa188('0x34')]['hasOwnProperty'](_0xa188('0x39'))){_0x515516[_0xa188('0x1f')]=qs[_0xa188('0x1f')](_0x40702e['query'][_0xa188('0x1f')]);_0x515516[_0xa188('0x21')]=qs[_0xa188('0x21')](_0x40702e[_0xa188('0x34')]['offset']);}_0x515516[_0xa188('0x3a')]=qs['sort'](_0x40702e['query'][_0xa188('0x3b')]);_0x515516[_0xa188('0x3c')]=qs[_0xa188('0x35')](_[_0xa188('0x3d')](_0x40702e['query'],_0x177565[_0xa188('0x35')]),_0x17af37);if(_0x40702e[_0xa188('0x34')][_0xa188('0x3e')]){_0x515516[_0xa188('0x3c')]=_['merge'](_0x515516[_0xa188('0x3c')],{'$or':_[_0xa188('0x33')](_0x17af37,function(_0x2e405b){if(_0x2e405b[_0xa188('0x30')]!==_0xa188('0x3f')){var _0x315098={};_0x315098[_0x2e405b[_0xa188('0x2b')]]={'$like':'%'+_0x40702e[_0xa188('0x34')][_0xa188('0x3e')]+'%'};return _0x315098;}})});}_0x515516=_[_0xa188('0x40')]({},_0x515516,_0x40702e['options']);var _0x563ace={'where':_0x515516['where']};return db[_0xa188('0x2d')][_0xa188('0x20')](_0x563ace)[_0xa188('0x26')](function(_0x920225){_0x4dc31d[_0xa188('0x20')]=_0x920225;if(_0x40702e[_0xa188('0x34')]['includeAll']){_0x515516['include']=[{'all':!![]}];}return db[_0xa188('0x2d')][_0xa188('0x41')](_0x515516);})[_0xa188('0x26')](function(_0x7da14a){_0x4dc31d[_0xa188('0x42')]=_0x7da14a;return _0x4dc31d;})[_0xa188('0x26')](respondWithFilteredResult(_0x4c96c2,_0x515516))[_0xa188('0x43')](handleError(_0x4c96c2,null));};exports[_0xa188('0x44')]=function(_0x24e50f,_0x4852bc){var _0x133e3f={'raw':!![],'where':{'id':_0x24e50f['params']['id']}},_0x311553={};_0x311553[_0xa188('0x32')]=_[_0xa188('0x45')](db[_0xa188('0x2d')][_0xa188('0x2e')]);_0x311553['query']=_[_0xa188('0x45')](_0x24e50f[_0xa188('0x34')]);_0x311553[_0xa188('0x35')]=_['intersection'](_0x311553[_0xa188('0x32')],_0x311553[_0xa188('0x34')]);_0x133e3f[_0xa188('0x36')]=_['intersection'](_0x311553[_0xa188('0x32')],qs[_0xa188('0x38')](_0x24e50f[_0xa188('0x34')][_0xa188('0x38')]));_0x133e3f[_0xa188('0x36')]=_0x133e3f['attributes'][_0xa188('0x46')]?_0x133e3f['attributes']:_0x311553[_0xa188('0x32')];if(_0x24e50f['query'][_0xa188('0x47')]){_0x133e3f['include']=[{'all':!![]}];}_0x133e3f=_[_0xa188('0x40')]({},_0x133e3f,_0x24e50f[_0xa188('0x48')]);return db[_0xa188('0x2d')][_0xa188('0x49')](_0x133e3f)[_0xa188('0x26')](handleEntityNotFound(_0x4852bc,null))['then'](respondWithResult(_0x4852bc,null))[_0xa188('0x43')](handleError(_0x4852bc,null));};exports[_0xa188('0x4a')]=function(_0x38c4ff,_0x54cad2){return db[_0xa188('0x2d')][_0xa188('0x4a')](_0x38c4ff[_0xa188('0x4b')],{})['then'](respondWithResult(_0x54cad2,0xc9))['catch'](handleError(_0x54cad2,null));};exports[_0xa188('0x25')]=function(_0x2b6807,_0x4baeae){if(_0x2b6807[_0xa188('0x4b')]['id']){delete _0x2b6807[_0xa188('0x4b')]['id'];}return db[_0xa188('0x2d')][_0xa188('0x49')]({'where':{'id':_0x2b6807[_0xa188('0x4c')]['id']}})[_0xa188('0x26')](handleEntityNotFound(_0x4baeae,null))[_0xa188('0x26')](saveUpdates(_0x2b6807[_0xa188('0x4b')],null))[_0xa188('0x26')](respondWithResult(_0x4baeae,null))[_0xa188('0x43')](handleError(_0x4baeae,null));};exports[_0xa188('0x27')]=function(_0x40b8cf,_0x4ca13a){return db[_0xa188('0x2d')][_0xa188('0x49')]({'where':{'id':_0x40b8cf['params']['id']}})[_0xa188('0x26')](handleEntityNotFound(_0x4ca13a,null))[_0xa188('0x26')](removeEntity(_0x4ca13a,null))[_0xa188('0x43')](handleError(_0x4ca13a,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 0691632..91faa3f 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 _0xdbe6=['request-promise','path','rimraf','../../config/environment','exports','define','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','util','api','moment'];(function(_0x52604d,_0x482d42){var _0x203ce2=function(_0x297deb){while(--_0x297deb){_0x52604d['push'](_0x52604d['shift']());}};_0x203ce2(++_0x482d42);}(_0xdbe6,0x176));var _0x6dbe=function(_0x4f3e74,_0x16c246){_0x4f3e74=_0x4f3e74-0x0;var _0x130544=_0xdbe6[_0x4f3e74];return _0x130544;};'use strict';var _=require(_0x6dbe('0x0'));var util=require(_0x6dbe('0x1'));var logger=require('../../config/logger')(_0x6dbe('0x2'));var moment=require(_0x6dbe('0x3'));var BPromise=require('bluebird');var rp=require(_0x6dbe('0x4'));var fs=require('fs');var path=require(_0x6dbe('0x5'));var rimraf=require(_0x6dbe('0x6'));var config=require(_0x6dbe('0x7'));var attributes=require('./intSugarcrmField.attributes');module[_0x6dbe('0x8')]=function(_0x3f349c,_0x521431){return _0x3f349c[_0x6dbe('0x9')]('SugarcrmField',attributes,{'tableName':_0x6dbe('0xa'),'paranoid':![],'indexes':[{'name':_0x6dbe('0xb'),'fields':[_0x6dbe('0xc'),_0x6dbe('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x85dd=['idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x85dd,0x9b));var _0xd85d=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x85dd[_0x2a6809];return _0x11c371;};'use strict';var _=require(_0xd85d('0x0'));var util=require(_0xd85d('0x1'));var logger=require(_0xd85d('0x2'))(_0xd85d('0x3'));var moment=require('moment');var BPromise=require(_0xd85d('0x4'));var rp=require(_0xd85d('0x5'));var fs=require('fs');var path=require(_0xd85d('0x6'));var rimraf=require(_0xd85d('0x7'));var config=require(_0xd85d('0x8'));var attributes=require(_0xd85d('0x9'));module[_0xd85d('0xa')]=function(_0x327db8,_0x396549){return _0x327db8[_0xd85d('0xb')](_0xd85d('0xc'),attributes,{'tableName':_0xd85d('0xd'),'paranoid':![],'indexes':[{'name':_0xd85d('0xe'),'fields':[_0xd85d('0xf'),_0xd85d('0x10')],'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 d184dde..9243944 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 _0x0a69=['lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x0a69,0x130));var _0x90a6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0a69[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x90a6('0x0'));var util=require(_0x90a6('0x1'));var moment=require(_0x90a6('0x2'));var BPromise=require(_0x90a6('0x3'));var rs=require(_0x90a6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x90a6('0x5'));var logger=require(_0x90a6('0x6'))(_0x90a6('0x7'));var config=require(_0x90a6('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x90a6('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25ac6d,_0x5b8b94,_0x3feaed){return new BPromise(function(_0x4c8b00,_0x10be44){return client['request'](_0x25ac6d,_0x3feaed)[_0x90a6('0xa')](function(_0xb20a61){logger[_0x90a6('0xb')](_0x90a6('0xc'),_0x5b8b94,_0x90a6('0xd'));logger[_0x90a6('0xe')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x5b8b94,_0x90a6('0xd'),JSON[_0x90a6('0xf')](_0xb20a61));if(_0xb20a61['error']){if(_0xb20a61['error']['code']===0x1f4){logger[_0x90a6('0x10')](_0x90a6('0xc'),_0x5b8b94,_0xb20a61[_0x90a6('0x10')]['message']);return _0x10be44(_0xb20a61[_0x90a6('0x10')][_0x90a6('0x11')]);}logger[_0x90a6('0x10')](_0x90a6('0xc'),_0x5b8b94,_0xb20a61[_0x90a6('0x10')]['message']);return _0x4c8b00(_0xb20a61[_0x90a6('0x10')][_0x90a6('0x11')]);}else{logger[_0x90a6('0xb')](_0x90a6('0xc'),_0x5b8b94,'request\x20sent');_0x4c8b00(_0xb20a61[_0x90a6('0x12')]['message']);}})['catch'](function(_0x1d57e7){logger['error'](_0x90a6('0xc'),_0x5b8b94,_0x1d57e7);_0x10be44(_0x1d57e7);});});} \ No newline at end of file +var _0x752e=['request','then','info','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','error','code','SugarcrmField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x167a3f,_0x3c707c){var _0x35802e=function(_0xc8435a){while(--_0xc8435a){_0x167a3f['push'](_0x167a3f['shift']());}};_0x35802e(++_0x3c707c);}(_0x752e,0xcc));var _0xe752=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x752e[_0x45d3f0];return _0x314b79;};'use strict';var _=require(_0xe752('0x0'));var util=require(_0xe752('0x1'));var moment=require(_0xe752('0x2'));var BPromise=require(_0xe752('0x3'));var rs=require(_0xe752('0x4'));var fs=require('fs');var Redis=require(_0xe752('0x5'));var db=require(_0xe752('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xe752('0x7'))(_0xe752('0x8'));var config=require(_0xe752('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe752('0xa')][_0xe752('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x272cdb,_0x5acef6,_0x31edd4){return new BPromise(function(_0x56a9f3,_0x32fced){return client[_0xe752('0xc')](_0x272cdb,_0x31edd4)[_0xe752('0xd')](function(_0x2ec341){logger[_0xe752('0xe')]('SugarcrmField,\x20%s,\x20%s',_0x5acef6,_0xe752('0xf'));logger[_0xe752('0x10')](_0xe752('0x11'),_0x5acef6,_0xe752('0xf'),JSON['stringify'](_0x2ec341));if(_0x2ec341['error']){if(_0x2ec341[_0xe752('0x12')][_0xe752('0x13')]===0x1f4){logger[_0xe752('0x12')](_0xe752('0x14'),_0x5acef6,_0x2ec341['error']['message']);return _0x32fced(_0x2ec341[_0xe752('0x12')][_0xe752('0x15')]);}logger[_0xe752('0x12')](_0xe752('0x14'),_0x5acef6,_0x2ec341[_0xe752('0x12')][_0xe752('0x15')]);return _0x56a9f3(_0x2ec341['error']['message']);}else{logger['info'](_0xe752('0x14'),_0x5acef6,_0xe752('0xf'));_0x56a9f3(_0x2ec341[_0xe752('0x16')][_0xe752('0x15')]);}})[_0xe752('0x17')](function(_0x57393c){logger[_0xe752('0x12')](_0xe752('0x14'),_0x5acef6,_0x57393c);_0x32fced(_0x57393c);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 90e87cf..50766c6 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 _0xe14d=['isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','update','delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get'];(function(_0x5ee3d3,_0x537c30){var _0x4b272f=function(_0x3dc277){while(--_0x3dc277){_0x5ee3d3['push'](_0x5ee3d3['shift']());}};_0x4b272f(++_0x537c30);}(_0xe14d,0x1ee));var _0xde14=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xe14d[_0x3ff085];return _0x2b68c3;};'use strict';var multer=require(_0xde14('0x0'));var util=require(_0xde14('0x1'));var path=require(_0xde14('0x2'));var timeout=require(_0xde14('0x3'));var express=require('express');var router=express[_0xde14('0x4')]();var fs_extra=require(_0xde14('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xde14('0x6'));var config=require(_0xde14('0x7'));var controller=require(_0xde14('0x8'));router[_0xde14('0x9')]('/',auth[_0xde14('0xa')](),controller[_0xde14('0xb')]);router['get']('/:id',auth[_0xde14('0xa')](),controller[_0xde14('0xc')]);router[_0xde14('0x9')](_0xde14('0xd'),auth[_0xde14('0xa')](),controller[_0xde14('0xe')]);router[_0xde14('0x9')](_0xde14('0xf'),auth['isAuthenticated'](),controller[_0xde14('0x10')]);router[_0xde14('0x11')]('/',auth[_0xde14('0xa')](),controller[_0xde14('0x12')]);router[_0xde14('0x11')](_0xde14('0xd'),auth[_0xde14('0xa')](),controller[_0xde14('0x13')]);router[_0xde14('0x14')](_0xde14('0x15'),auth[_0xde14('0xa')](),controller[_0xde14('0x16')]);router[_0xde14('0x17')](_0xde14('0x15'),auth[_0xde14('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xd5d3=['show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','update','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x41a025,_0x10712a){var _0x2a5245=function(_0x21a7ee){while(--_0x21a7ee){_0x41a025['push'](_0x41a025['shift']());}};_0x2a5245(++_0x10712a);}(_0xd5d3,0x113));var _0x3d5d=function(_0x566dc7,_0x4a887b){_0x566dc7=_0x566dc7-0x0;var _0x53d62b=_0xd5d3[_0x566dc7];return _0x53d62b;};'use strict';var multer=require(_0x3d5d('0x0'));var util=require(_0x3d5d('0x1'));var path=require(_0x3d5d('0x2'));var timeout=require('connect-timeout');var express=require(_0x3d5d('0x3'));var router=express[_0x3d5d('0x4')]();var fs_extra=require(_0x3d5d('0x5'));var auth=require(_0x3d5d('0x6'));var interaction=require(_0x3d5d('0x7'));var config=require(_0x3d5d('0x8'));var controller=require('./intVtigerAccount.controller');router[_0x3d5d('0x9')]('/',auth[_0x3d5d('0xa')](),controller[_0x3d5d('0xb')]);router[_0x3d5d('0x9')](_0x3d5d('0xc'),auth[_0x3d5d('0xa')](),controller[_0x3d5d('0xd')]);router[_0x3d5d('0x9')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x3d5d('0xe')]);router[_0x3d5d('0x9')](_0x3d5d('0xf'),auth[_0x3d5d('0xa')](),controller[_0x3d5d('0x10')]);router[_0x3d5d('0x11')]('/',auth['isAuthenticated'](),controller[_0x3d5d('0x12')]);router[_0x3d5d('0x11')](_0x3d5d('0x13'),auth['isAuthenticated'](),controller[_0x3d5d('0x14')]);router[_0x3d5d('0x15')](_0x3d5d('0xc'),auth[_0x3d5d('0xa')](),controller[_0x3d5d('0x16')]);router['delete'](_0x3d5d('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x3d5d('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 0fe4826..cd7fd6a 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 _0x30d3=['STRING','exports'];(function(_0xa96215,_0x5ee562){var _0x595448=function(_0x5c26ca){while(--_0x5c26ca){_0xa96215['push'](_0xa96215['shift']());}};_0x595448(++_0x5ee562);}(_0x30d3,0x6d));var _0x330d=function(_0x334f8d,_0x1c06f5){_0x334f8d=_0x334f8d-0x0;var _0x3ac587=_0x30d3[_0x334f8d];return _0x3ac587;};'use strict';var Sequelize=require('sequelize');module[_0x330d('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x330d('0x1')]},'username':{'type':Sequelize[_0x330d('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x330d('0x1')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0x330d('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x330d('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x330d('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x5e1f=['exports','STRING','HelpDesk'];(function(_0x199249,_0x3cd1b1){var _0x51119d=function(_0x5dc96e){while(--_0x5dc96e){_0x199249['push'](_0x199249['shift']());}};_0x51119d(++_0x3cd1b1);}(_0x5e1f,0x18f));var _0xf5e1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5e1f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xf5e1('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xf5e1('0x1')]},'username':{'type':Sequelize[_0xf5e1('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xf5e1('0x1')],'allowNull':![],'defaultValue':_0xf5e1('0x2')},'remoteUri':{'type':Sequelize[_0xf5e1('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xf5e1('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xf5e1('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 3b548b5..e0470ca 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 _0xb56c=['findOne','VtigerConfiguration','filter','options','addConfiguration','channel','type','Descriptions','getDescriptions','VtigerField','md5','getFields','username','moduleName','remoteUri','accessKey','slice','substring','format','%s/webservice.php','getchallenge','success','POST','login','result','token','GET','describe','autogenerated','owner','includes','remove','false','label','startsWith','cf_','picklist','picklistValues','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','VtigerAccount','rawAttributes','fieldName','key','model','map','name','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','includeAll','include','catch','show','keys','create','body','params','getConfigurations'];(function(_0x328af4,_0x440f1d){var _0x43425c=function(_0x228127){while(--_0x228127){_0x328af4['push'](_0x328af4['shift']());}};_0x43425c(++_0x440f1d);}(_0xb56c,0x9d));var _0xcb56=function(_0xf0bc07,_0x510ebf){_0xf0bc07=_0xf0bc07-0x0;var _0x1c50c2=_0xb56c[_0xf0bc07];return _0x1c50c2;};'use strict';var emlformat=require(_0xcb56('0x0'));var rimraf=require(_0xcb56('0x1'));var zipdir=require(_0xcb56('0x2'));var jsonpatch=require(_0xcb56('0x3'));var rp=require('request-promise');var moment=require(_0xcb56('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xcb56('0x5'));var util=require(_0xcb56('0x6'));var path=require(_0xcb56('0x7'));var sox=require(_0xcb56('0x8'));var csv=require(_0xcb56('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcb56('0xa'));var _=require(_0xcb56('0xb'));var squel=require(_0xcb56('0xc'));var crypto=require('crypto');var jsforce=require(_0xcb56('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xcb56('0x9'));var querystring=require(_0xcb56('0xe'));var Papa=require(_0xcb56('0xf'));var Redis=require(_0xcb56('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xcb56('0x11'));var as=require(_0xcb56('0x12'));var hardwareService=require(_0xcb56('0x13'));var logger=require('../../config/logger')(_0xcb56('0x14'));var utils=require(_0xcb56('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xcb56('0x16'))['db'];var integrations=require(_0xcb56('0x17'));function respondWithStatusCode(_0x311752,_0x32f571){_0x32f571=_0x32f571||0xcc;return function(_0x1b7e35){if(_0x1b7e35){return _0x311752[_0xcb56('0x18')](_0x32f571);}return _0x311752[_0xcb56('0x19')](_0x32f571)[_0xcb56('0x1a')]();};}function respondWithResult(_0x24ab13,_0x3dd18b){_0x3dd18b=_0x3dd18b||0xc8;return function(_0x232b7b){if(_0x232b7b){return _0x24ab13[_0xcb56('0x19')](_0x3dd18b)['json'](_0x232b7b);}};}function respondWithFilteredResult(_0x25bacb,_0x4dcbcd){return function(_0x51bab5){if(_0x51bab5){var _0x4520ab=typeof _0x4dcbcd[_0xcb56('0x1b')]===_0xcb56('0x1c')&&typeof _0x4dcbcd[_0xcb56('0x1d')]===_0xcb56('0x1c');var _0x42f26f=_0x51bab5[_0xcb56('0x1e')];var _0x324804=_0x4520ab?0x0:_0x4dcbcd[_0xcb56('0x1b')];var _0x2ea9ca=_0x4520ab?_0x51bab5[_0xcb56('0x1e')]:_0x4dcbcd[_0xcb56('0x1b')]+_0x4dcbcd[_0xcb56('0x1d')];var _0x11250f;if(_0x2ea9ca>=_0x42f26f){_0x2ea9ca=_0x42f26f;_0x11250f=0xc8;}else{_0x11250f=0xce;}_0x25bacb['status'](_0x11250f);return _0x25bacb[_0xcb56('0x1f')](_0xcb56('0x20'),_0x324804+'-'+_0x2ea9ca+'/'+_0x42f26f)['json'](_0x51bab5);}return null;};}function patchUpdates(_0x2820e2){return function(_0x5dbc0e){try{jsonpatch[_0xcb56('0x21')](_0x5dbc0e,_0x2820e2,!![]);}catch(_0x131b0c){return BPromise['reject'](_0x131b0c);}return _0x5dbc0e[_0xcb56('0x22')]();};}function saveUpdates(_0x33e96f,_0x47516a){return function(_0x40a749){if(_0x40a749){return _0x40a749[_0xcb56('0x23')](_0x33e96f)[_0xcb56('0x24')](function(_0x3990e8){return _0x3990e8;});}return null;};}function removeEntity(_0x310c11,_0x1e67c6){return function(_0x18128f){if(_0x18128f){return _0x18128f[_0xcb56('0x25')]()[_0xcb56('0x24')](function(){_0x310c11['status'](0xcc)[_0xcb56('0x1a')]();});}};}function handleEntityNotFound(_0x1cbf61,_0x4d2a5f){return function(_0x3f100d){if(!_0x3f100d){_0x1cbf61[_0xcb56('0x18')](0x194);}return _0x3f100d;};}function handleError(_0x4e3795,_0x518e1a){_0x518e1a=_0x518e1a||0x1f4;return function(_0x242ff9){logger[_0xcb56('0x26')](_0x242ff9['stack']);if(_0x242ff9['name']){delete _0x242ff9['name'];}_0x4e3795[_0xcb56('0x19')](_0x518e1a)['send'](_0x242ff9);};}exports['index']=function(_0x336f78,_0x452212){var _0x2c995e={},_0x503656={},_0x4f2669={'count':0x0,'rows':[]};var _0x4778a2=_['map'](db[_0xcb56('0x27')][_0xcb56('0x28')],function(_0xa60140){return{'name':_0xa60140[_0xcb56('0x29')],'type':_0xa60140['type'][_0xcb56('0x2a')]};});_0x503656[_0xcb56('0x2b')]=_[_0xcb56('0x2c')](_0x4778a2,_0xcb56('0x2d'));_0x503656[_0xcb56('0x2e')]=_['keys'](_0x336f78[_0xcb56('0x2e')]);_0x503656[_0xcb56('0x2f')]=_[_0xcb56('0x30')](_0x503656[_0xcb56('0x2b')],_0x503656['query']);_0x2c995e['attributes']=_[_0xcb56('0x30')](_0x503656[_0xcb56('0x2b')],qs[_0xcb56('0x31')](_0x336f78[_0xcb56('0x2e')][_0xcb56('0x31')]));_0x2c995e[_0xcb56('0x32')]=_0x2c995e[_0xcb56('0x32')][_0xcb56('0x33')]?_0x2c995e['attributes']:_0x503656[_0xcb56('0x2b')];if(!_0x336f78[_0xcb56('0x2e')][_0xcb56('0x34')]('nolimit')){_0x2c995e['limit']=qs['limit'](_0x336f78[_0xcb56('0x2e')][_0xcb56('0x1d')]);_0x2c995e[_0xcb56('0x1b')]=qs[_0xcb56('0x1b')](_0x336f78['query'][_0xcb56('0x1b')]);}_0x2c995e[_0xcb56('0x35')]=qs[_0xcb56('0x36')](_0x336f78['query'][_0xcb56('0x36')]);_0x2c995e[_0xcb56('0x37')]=qs['filters'](_[_0xcb56('0x38')](_0x336f78['query'],_0x503656[_0xcb56('0x2f')]),_0x4778a2);if(_0x336f78[_0xcb56('0x2e')]['filter']){_0x2c995e[_0xcb56('0x37')]=_['merge'](_0x2c995e[_0xcb56('0x37')],{'$or':_[_0xcb56('0x2c')](_0x4778a2,function(_0x163fb7){if(_0x163fb7['type']!=='VIRTUAL'){var _0x27270e={};_0x27270e[_0x163fb7[_0xcb56('0x2d')]]={'$like':'%'+_0x336f78[_0xcb56('0x2e')]['filter']+'%'};return _0x27270e;}})});}_0x2c995e=_[_0xcb56('0x39')]({},_0x2c995e,_0x336f78['options']);var _0x5aecfe={'where':_0x2c995e[_0xcb56('0x37')]};return db[_0xcb56('0x27')][_0xcb56('0x1e')](_0x5aecfe)['then'](function(_0x308445){_0x4f2669[_0xcb56('0x1e')]=_0x308445;if(_0x336f78['query'][_0xcb56('0x3a')]){_0x2c995e[_0xcb56('0x3b')]=[{'all':!![]}];}return db[_0xcb56('0x27')]['findAll'](_0x2c995e);})[_0xcb56('0x24')](function(_0x2a142a){_0x4f2669['rows']=_0x2a142a;return _0x4f2669;})['then'](respondWithFilteredResult(_0x452212,_0x2c995e))[_0xcb56('0x3c')](handleError(_0x452212,null));};exports[_0xcb56('0x3d')]=function(_0x52fbcd,_0x43f111){var _0x5cfba7={'raw':![],'where':{'id':_0x52fbcd['params']['id']}},_0x3fcab4={};_0x3fcab4[_0xcb56('0x2b')]=_['keys'](db[_0xcb56('0x27')][_0xcb56('0x28')]);_0x3fcab4[_0xcb56('0x2e')]=_[_0xcb56('0x3e')](_0x52fbcd[_0xcb56('0x2e')]);_0x3fcab4['filters']=_[_0xcb56('0x30')](_0x3fcab4[_0xcb56('0x2b')],_0x3fcab4[_0xcb56('0x2e')]);_0x5cfba7[_0xcb56('0x32')]=_['intersection'](_0x3fcab4[_0xcb56('0x2b')],qs[_0xcb56('0x31')](_0x52fbcd[_0xcb56('0x2e')][_0xcb56('0x31')]));_0x5cfba7[_0xcb56('0x32')]=_0x5cfba7[_0xcb56('0x32')]['length']?_0x5cfba7[_0xcb56('0x32')]:_0x3fcab4[_0xcb56('0x2b')];if(_0x52fbcd[_0xcb56('0x2e')][_0xcb56('0x3a')]){_0x5cfba7['include']=[{'all':!![]}];}_0x5cfba7=_['merge']({},_0x5cfba7,_0x52fbcd['options']);return db[_0xcb56('0x27')]['find'](_0x5cfba7)['then'](handleEntityNotFound(_0x43f111,null))[_0xcb56('0x24')](respondWithResult(_0x43f111,null))[_0xcb56('0x3c')](handleError(_0x43f111,null));};exports[_0xcb56('0x3f')]=function(_0x31d553,_0x42e303){return db[_0xcb56('0x27')][_0xcb56('0x3f')](_0x31d553[_0xcb56('0x40')],{})[_0xcb56('0x24')](respondWithResult(_0x42e303,0xc9))[_0xcb56('0x3c')](handleError(_0x42e303,null));};exports[_0xcb56('0x23')]=function(_0x4318af,_0x329268){if(_0x4318af['body']['id']){delete _0x4318af[_0xcb56('0x40')]['id'];}return db[_0xcb56('0x27')]['find']({'where':{'id':_0x4318af[_0xcb56('0x41')]['id']}})['then'](handleEntityNotFound(_0x329268,null))[_0xcb56('0x24')](saveUpdates(_0x4318af['body'],null))[_0xcb56('0x24')](respondWithResult(_0x329268,null))[_0xcb56('0x3c')](handleError(_0x329268,null));};exports[_0xcb56('0x25')]=function(_0x102253,_0x1cd9a4){return db['VtigerAccount']['find']({'where':{'id':_0x102253[_0xcb56('0x41')]['id']}})[_0xcb56('0x24')](handleEntityNotFound(_0x1cd9a4,null))[_0xcb56('0x24')](removeEntity(_0x1cd9a4,null))['catch'](handleError(_0x1cd9a4,null));};exports[_0xcb56('0x42')]=function(_0x79673d,_0xf06cb5,_0x1ccb07){var _0x16296b={};var _0x2f39a0={};var _0x45acdc;var _0x3cb36b;return db['VtigerAccount'][_0xcb56('0x43')]({'where':{'id':_0x79673d[_0xcb56('0x41')]['id']}})[_0xcb56('0x24')](handleEntityNotFound(_0xf06cb5,null))[_0xcb56('0x24')](function(_0x19648a){if(_0x19648a){_0x45acdc=_0x19648a;_0x2f39a0['model']=_[_0xcb56('0x3e')](db[_0xcb56('0x44')][_0xcb56('0x28')]);_0x2f39a0[_0xcb56('0x2e')]=_['keys'](_0x79673d[_0xcb56('0x2e')]);_0x2f39a0['filters']=_[_0xcb56('0x30')](_0x2f39a0['model'],_0x2f39a0[_0xcb56('0x2e')]);_0x16296b['attributes']=_['intersection'](_0x2f39a0[_0xcb56('0x2b')],qs['fields'](_0x79673d[_0xcb56('0x2e')][_0xcb56('0x31')]));_0x16296b[_0xcb56('0x32')]=_0x16296b['attributes']['length']?_0x16296b[_0xcb56('0x32')]:_0x2f39a0[_0xcb56('0x2b')];_0x16296b[_0xcb56('0x35')]=qs[_0xcb56('0x36')](_0x79673d[_0xcb56('0x2e')][_0xcb56('0x36')]);_0x16296b[_0xcb56('0x37')]=qs[_0xcb56('0x2f')](_[_0xcb56('0x38')](_0x79673d[_0xcb56('0x2e')],_0x2f39a0[_0xcb56('0x2f')]));if(_0x79673d['query'][_0xcb56('0x45')]){_0x16296b[_0xcb56('0x37')]=_[_0xcb56('0x39')](_0x16296b[_0xcb56('0x37')],{'$or':_[_0xcb56('0x2c')](_0x16296b[_0xcb56('0x32')],function(_0x4cd257){var _0x467d5d={};_0x467d5d[_0x4cd257]={'$like':'%'+_0x79673d[_0xcb56('0x2e')][_0xcb56('0x45')]+'%'};return _0x467d5d;})});}_0x16296b=_['merge']({},_0x16296b,_0x79673d[_0xcb56('0x46')]);return _0x45acdc[_0xcb56('0x42')](_0x16296b);}})['then'](function(_0x41f658){if(_0x41f658){_0x3cb36b=_0x41f658[_0xcb56('0x33')];if(!_0x79673d[_0xcb56('0x2e')]['hasOwnProperty']('nolimit')){_0x16296b[_0xcb56('0x1d')]=qs['limit'](_0x79673d[_0xcb56('0x2e')][_0xcb56('0x1d')]);_0x16296b[_0xcb56('0x1b')]=qs['offset'](_0x79673d[_0xcb56('0x2e')][_0xcb56('0x1b')]);}return _0x45acdc[_0xcb56('0x42')](_0x16296b);}})[_0xcb56('0x24')](function(_0x5d5da3){if(_0x5d5da3){return _0x5d5da3?{'count':_0x3cb36b,'rows':_0x5d5da3}:null;}})[_0xcb56('0x24')](respondWithResult(_0xf06cb5,null))[_0xcb56('0x3c')](handleError(_0xf06cb5,null));};exports[_0xcb56('0x47')]=function(_0x1a2979,_0x49b3be,_0x1c845e){if(_0x1a2979[_0xcb56('0x40')]['id']){delete _0x1a2979[_0xcb56('0x40')]['id'];}return db[_0xcb56('0x27')][_0xcb56('0x43')]({'where':{'id':_0x1a2979[_0xcb56('0x41')]['id']}})[_0xcb56('0x24')](handleEntityNotFound(_0x49b3be,null))[_0xcb56('0x24')](function(_0x2bde99){if(_0x2bde99){_0x1a2979[_0xcb56('0x40')]['AccountId']=_0x2bde99['id'];_0x1a2979[_0xcb56('0x40')]['Subjects']=integrations['getSubjects'](_0x1a2979['body'][_0xcb56('0x48')],_0x1a2979[_0xcb56('0x40')][_0xcb56('0x49')]);_0x1a2979[_0xcb56('0x40')][_0xcb56('0x4a')]=integrations[_0xcb56('0x4b')](_0x1a2979[_0xcb56('0x40')][_0xcb56('0x48')],_0x1a2979[_0xcb56('0x40')][_0xcb56('0x49')]);return db[_0xcb56('0x44')]['create'](_0x1a2979[_0xcb56('0x40')],{'include':[{'model':db[_0xcb56('0x4c')],'as':'Subjects'},{'model':db[_0xcb56('0x4c')],'as':_0xcb56('0x4a')}]});}return null;})['then'](respondWithResult(_0x49b3be,null))[_0xcb56('0x3c')](handleError(_0x49b3be,null));};var md5=require(_0xcb56('0x4d'));exports[_0xcb56('0x4e')]=function(_0x592887,_0x5a8953,_0x2bf3bd){var _0xdd29b9=null;var _0x248703=null;var _0xca2bc7=null;var _0x592941=null;var _0x252094='';return db['VtigerAccount']['findOne']({'where':{'id':_0x592887[_0xcb56('0x41')]['id']},'attributes':['id','name',_0xcb56('0x4f'),'description',_0xcb56('0x50'),_0xcb56('0x51'),'serverUrl',_0xcb56('0x52')]})[_0xcb56('0x24')](handleEntityNotFound(_0x5a8953,null))[_0xcb56('0x24')](function(_0x248f0b){if(_0x248f0b){_0xdd29b9=_0x248f0b[_0xcb56('0x4f')];_0x248703=_0x248f0b[_0xcb56('0x52')];_0xca2bc7=_0x248f0b[_0xcb56('0x50')];_0x252094=_0x248f0b['remoteUri'];var _0x50b46a=_0x252094[_0xcb56('0x53')](-0x1);if(_0x50b46a==='/'){_0x252094=_0x252094[_0xcb56('0x54')](0x0,_0x252094['lastIndexOf'](_0x50b46a));}_0x592941=util[_0xcb56('0x55')](_0xcb56('0x56'),_0x252094);var _0x503726={'method':'GET','uri':_0x592941,'qs':{'operation':_0xcb56('0x57'),'username':_0x248f0b['username']},'json':!![]};return rp(_0x503726);}})[_0xcb56('0x24')](function(_0x2346a9){if(_0x2346a9[_0xcb56('0x58')]){var _0x244bfd={'method':_0xcb56('0x59'),'uri':_0x592941,'form':{'operation':_0xcb56('0x5a'),'username':_0xdd29b9,'accessKey':md5(_0x2346a9[_0xcb56('0x5b')][_0xcb56('0x5c')]+_0x248703)},'json':!![]};return rp(_0x244bfd);}})[_0xcb56('0x24')](function(_0x1bfdd3){if(_0x1bfdd3[_0xcb56('0x58')]){var _0x2c01c3={'method':_0xcb56('0x5d'),'uri':_0x592941,'qs':{'operation':_0xcb56('0x5e'),'username':_0xdd29b9,'sessionName':_0x1bfdd3[_0xcb56('0x5b')]['sessionName'],'elementType':_0xca2bc7},'json':!![]};return rp(_0x2c01c3);}})[_0xcb56('0x24')](function(_0x576040){if(_0x576040[_0xcb56('0x58')]){var _0x51c248=[_0xcb56('0x5f'),'reference',_0xcb56('0x60')];_['remove'](_0x576040[_0xcb56('0x5b')][_0xcb56('0x31')],function(_0x166f8f){return _0x51c248[_0xcb56('0x61')](_0x166f8f[_0xcb56('0x49')][_0xcb56('0x2d')]);});_[_0xcb56('0x62')](_0x576040[_0xcb56('0x5b')][_0xcb56('0x31')],function(_0x5554c5){return _0x5554c5['editable']===_0xcb56('0x63');});return{'count':_0x576040[_0xcb56('0x5b')][_0xcb56('0x31')][_0xcb56('0x33')],'rows':_[_0xcb56('0x2c')](_0x576040[_0xcb56('0x5b')][_0xcb56('0x31')],function(_0x49eb0a){return{'id':_0x49eb0a[_0xcb56('0x2d')],'name':_0x49eb0a[_0xcb56('0x64')],'custom':_[_0xcb56('0x65')](_0x49eb0a[_0xcb56('0x2d')],_0xcb56('0x66'))?!![]:![],'options':_0x49eb0a[_0xcb56('0x49')][_0xcb56('0x2d')]===_0xcb56('0x67')&&_0x49eb0a[_0xcb56('0x49')][_0xcb56('0x68')]['length']>0x0?_[_0xcb56('0x2c')](_0x49eb0a['type'][_0xcb56('0x68')],function(_0x4adb1f){return{'name':_0x4adb1f['label'],'value':_0x4adb1f[_0xcb56('0x69')]};}):[]};})};}})['then'](respondWithResult(_0x5a8953,null))['catch'](function(_0x4e06e2){console['log']('vTiger\x20error:\x20'+_0x4e06e2);var _0x5b4423=_0x592887[_0xcb56('0x2e')][_0xcb56('0x6a')]?0x1f4:_0x4e06e2[_0xcb56('0x6b')]||0x1f4;logger['error'](_0xcb56('0x6c'),_0xcb56('0x4e'),_0x5b4423,JSON[_0xcb56('0x6d')](_0x4e06e2));delete _0x4e06e2[_0xcb56('0x2d')];if(_0x5b4423===0x191){_0x5b4423=0x190;}_0x5a8953[_0xcb56('0x19')](_0x5b4423)[_0xcb56('0x6e')](_0x592887[_0xcb56('0x2e')]['test']?{'message':_0xcb56('0x6f'),'statusCode':_0x4e06e2[_0xcb56('0x6b')]}:_0x4e06e2);});}; \ No newline at end of file +var _0x466b=['api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','VtigerAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','catch','show','includeAll','find','create','body','params','getConfigurations','VtigerConfiguration','order','nolimit','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','VtigerField','md5','username','description','serverUrl','accessKey','remoteUri','slice','substring','format','%s/webservice.php','GET','getchallenge','success','POST','login','result','token','describe','autogenerated','reference','remove','editable','false','label','cf_','picklistValues','value','log','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x56e904,_0x4b72e0){var _0x484505=function(_0x5e95af){while(--_0x5e95af){_0x56e904['push'](_0x56e904['shift']());}};_0x484505(++_0x4b72e0);}(_0x466b,0xe6));var _0xb466=function(_0x267b9e,_0x5249b3){_0x267b9e=_0x267b9e-0x0;var _0x2b3f61=_0x466b[_0x267b9e];return _0x2b3f61;};'use strict';var emlformat=require(_0xb466('0x0'));var rimraf=require(_0xb466('0x1'));var zipdir=require(_0xb466('0x2'));var jsonpatch=require(_0xb466('0x3'));var rp=require(_0xb466('0x4'));var moment=require(_0xb466('0x5'));var BPromise=require(_0xb466('0x6'));var Mustache=require(_0xb466('0x7'));var util=require(_0xb466('0x8'));var path=require(_0xb466('0x9'));var sox=require(_0xb466('0xa'));var csv=require(_0xb466('0xb'));var ejs=require(_0xb466('0xc'));var fs=require('fs');var fs_extra=require(_0xb466('0xd'));var _=require(_0xb466('0xe'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb466('0xf'));var toCsv=require(_0xb466('0xb'));var querystring=require(_0xb466('0x10'));var Papa=require(_0xb466('0x11'));var Redis=require('ioredis');var authService=require(_0xb466('0x12'));var qs=require(_0xb466('0x13'));var as=require(_0xb466('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb466('0x15'))(_0xb466('0x16'));var utils=require(_0xb466('0x17'));var config=require(_0xb466('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xb466('0x19'))['db'];var integrations=require(_0xb466('0x1a'));function respondWithStatusCode(_0x1651a5,_0x192e67){_0x192e67=_0x192e67||0xcc;return function(_0x1ef31c){if(_0x1ef31c){return _0x1651a5[_0xb466('0x1b')](_0x192e67);}return _0x1651a5[_0xb466('0x1c')](_0x192e67)[_0xb466('0x1d')]();};}function respondWithResult(_0x4ca733,_0x5c7072){_0x5c7072=_0x5c7072||0xc8;return function(_0x2e307f){if(_0x2e307f){return _0x4ca733['status'](_0x5c7072)[_0xb466('0x1e')](_0x2e307f);}};}function respondWithFilteredResult(_0x463658,_0x5eed74){return function(_0x2108b0){if(_0x2108b0){var _0x2adf16=typeof _0x5eed74['offset']==='undefined'&&typeof _0x5eed74['limit']===_0xb466('0x1f');var _0x3cc43f=_0x2108b0[_0xb466('0x20')];var _0x4cbf89=_0x2adf16?0x0:_0x5eed74[_0xb466('0x21')];var _0x5abcbc=_0x2adf16?_0x2108b0[_0xb466('0x20')]:_0x5eed74[_0xb466('0x21')]+_0x5eed74[_0xb466('0x22')];var _0x128d32;if(_0x5abcbc>=_0x3cc43f){_0x5abcbc=_0x3cc43f;_0x128d32=0xc8;}else{_0x128d32=0xce;}_0x463658['status'](_0x128d32);return _0x463658[_0xb466('0x23')](_0xb466('0x24'),_0x4cbf89+'-'+_0x5abcbc+'/'+_0x3cc43f)[_0xb466('0x1e')](_0x2108b0);}return null;};}function patchUpdates(_0x54e219){return function(_0x47f31a){try{jsonpatch[_0xb466('0x25')](_0x47f31a,_0x54e219,!![]);}catch(_0x4917c3){return BPromise[_0xb466('0x26')](_0x4917c3);}return _0x47f31a[_0xb466('0x27')]();};}function saveUpdates(_0x135fcd,_0x225de3){return function(_0x4a1292){if(_0x4a1292){return _0x4a1292[_0xb466('0x28')](_0x135fcd)['then'](function(_0x7282d0){return _0x7282d0;});}return null;};}function removeEntity(_0x2a9b1d,_0x5a1aa8){return function(_0x76dc05){if(_0x76dc05){return _0x76dc05[_0xb466('0x29')]()[_0xb466('0x2a')](function(){_0x2a9b1d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x587f91,_0x2e9fab){return function(_0x2705b9){if(!_0x2705b9){_0x587f91['sendStatus'](0x194);}return _0x2705b9;};}function handleError(_0x4e5206,_0x5869ce){_0x5869ce=_0x5869ce||0x1f4;return function(_0x3c8c47){logger[_0xb466('0x2b')](_0x3c8c47[_0xb466('0x2c')]);if(_0x3c8c47[_0xb466('0x2d')]){delete _0x3c8c47[_0xb466('0x2d')];}_0x4e5206['status'](_0x5869ce)[_0xb466('0x2e')](_0x3c8c47);};}exports[_0xb466('0x2f')]=function(_0x126c99,_0x959cb){var _0x57cc25={},_0x59e806={},_0x4027a4={'count':0x0,'rows':[]};var _0x5cf82b=_[_0xb466('0x30')](db[_0xb466('0x31')][_0xb466('0x32')],function(_0x4a5b7d){return{'name':_0x4a5b7d[_0xb466('0x33')],'type':_0x4a5b7d[_0xb466('0x34')][_0xb466('0x35')]};});_0x59e806[_0xb466('0x36')]=_['map'](_0x5cf82b,_0xb466('0x2d'));_0x59e806[_0xb466('0x37')]=_[_0xb466('0x38')](_0x126c99[_0xb466('0x37')]);_0x59e806[_0xb466('0x39')]=_['intersection'](_0x59e806[_0xb466('0x36')],_0x59e806[_0xb466('0x37')]);_0x57cc25[_0xb466('0x3a')]=_[_0xb466('0x3b')](_0x59e806[_0xb466('0x36')],qs[_0xb466('0x3c')](_0x126c99['query']['fields']));_0x57cc25[_0xb466('0x3a')]=_0x57cc25['attributes'][_0xb466('0x3d')]?_0x57cc25[_0xb466('0x3a')]:_0x59e806[_0xb466('0x36')];if(!_0x126c99['query'][_0xb466('0x3e')]('nolimit')){_0x57cc25[_0xb466('0x22')]=qs[_0xb466('0x22')](_0x126c99[_0xb466('0x37')][_0xb466('0x22')]);_0x57cc25['offset']=qs[_0xb466('0x21')](_0x126c99['query'][_0xb466('0x21')]);}_0x57cc25['order']=qs[_0xb466('0x3f')](_0x126c99['query'][_0xb466('0x3f')]);_0x57cc25[_0xb466('0x40')]=qs[_0xb466('0x39')](_[_0xb466('0x41')](_0x126c99[_0xb466('0x37')],_0x59e806[_0xb466('0x39')]),_0x5cf82b);if(_0x126c99[_0xb466('0x37')][_0xb466('0x42')]){_0x57cc25[_0xb466('0x40')]=_[_0xb466('0x43')](_0x57cc25['where'],{'$or':_[_0xb466('0x30')](_0x5cf82b,function(_0x2ab189){if(_0x2ab189[_0xb466('0x34')]!==_0xb466('0x44')){var _0x47714a={};_0x47714a[_0x2ab189[_0xb466('0x2d')]]={'$like':'%'+_0x126c99[_0xb466('0x37')][_0xb466('0x42')]+'%'};return _0x47714a;}})});}_0x57cc25=_[_0xb466('0x43')]({},_0x57cc25,_0x126c99[_0xb466('0x45')]);var _0x5273db={'where':_0x57cc25['where']};return db[_0xb466('0x31')]['count'](_0x5273db)['then'](function(_0x2eadea){_0x4027a4[_0xb466('0x20')]=_0x2eadea;if(_0x126c99['query']['includeAll']){_0x57cc25[_0xb466('0x46')]=[{'all':!![]}];}return db[_0xb466('0x31')]['findAll'](_0x57cc25);})[_0xb466('0x2a')](function(_0x2f1653){_0x4027a4[_0xb466('0x47')]=_0x2f1653;return _0x4027a4;})[_0xb466('0x2a')](respondWithFilteredResult(_0x959cb,_0x57cc25))[_0xb466('0x48')](handleError(_0x959cb,null));};exports[_0xb466('0x49')]=function(_0x1b85f3,_0x6827c7){var _0x58ec14={'raw':![],'where':{'id':_0x1b85f3['params']['id']}},_0x38ceed={};_0x38ceed[_0xb466('0x36')]=_[_0xb466('0x38')](db[_0xb466('0x31')][_0xb466('0x32')]);_0x38ceed['query']=_[_0xb466('0x38')](_0x1b85f3[_0xb466('0x37')]);_0x38ceed[_0xb466('0x39')]=_[_0xb466('0x3b')](_0x38ceed[_0xb466('0x36')],_0x38ceed[_0xb466('0x37')]);_0x58ec14[_0xb466('0x3a')]=_[_0xb466('0x3b')](_0x38ceed[_0xb466('0x36')],qs[_0xb466('0x3c')](_0x1b85f3[_0xb466('0x37')][_0xb466('0x3c')]));_0x58ec14[_0xb466('0x3a')]=_0x58ec14[_0xb466('0x3a')][_0xb466('0x3d')]?_0x58ec14[_0xb466('0x3a')]:_0x38ceed[_0xb466('0x36')];if(_0x1b85f3[_0xb466('0x37')][_0xb466('0x4a')]){_0x58ec14['include']=[{'all':!![]}];}_0x58ec14=_[_0xb466('0x43')]({},_0x58ec14,_0x1b85f3[_0xb466('0x45')]);return db[_0xb466('0x31')][_0xb466('0x4b')](_0x58ec14)['then'](handleEntityNotFound(_0x6827c7,null))['then'](respondWithResult(_0x6827c7,null))[_0xb466('0x48')](handleError(_0x6827c7,null));};exports['create']=function(_0x1a4938,_0x488485){return db[_0xb466('0x31')][_0xb466('0x4c')](_0x1a4938['body'],{})['then'](respondWithResult(_0x488485,0xc9))[_0xb466('0x48')](handleError(_0x488485,null));};exports[_0xb466('0x28')]=function(_0x29ca2b,_0x50c7cf){if(_0x29ca2b[_0xb466('0x4d')]['id']){delete _0x29ca2b[_0xb466('0x4d')]['id'];}return db['VtigerAccount'][_0xb466('0x4b')]({'where':{'id':_0x29ca2b['params']['id']}})['then'](handleEntityNotFound(_0x50c7cf,null))[_0xb466('0x2a')](saveUpdates(_0x29ca2b['body'],null))[_0xb466('0x2a')](respondWithResult(_0x50c7cf,null))['catch'](handleError(_0x50c7cf,null));};exports[_0xb466('0x29')]=function(_0x2f7232,_0x243cf8){return db[_0xb466('0x31')][_0xb466('0x4b')]({'where':{'id':_0x2f7232[_0xb466('0x4e')]['id']}})[_0xb466('0x2a')](handleEntityNotFound(_0x243cf8,null))[_0xb466('0x2a')](removeEntity(_0x243cf8,null))[_0xb466('0x48')](handleError(_0x243cf8,null));};exports[_0xb466('0x4f')]=function(_0x15abcb,_0x6e3375,_0x1933b4){var _0x4b75fe={};var _0x5812f4={};var _0x374103;var _0x4bd5dd;return db['VtigerAccount']['findOne']({'where':{'id':_0x15abcb[_0xb466('0x4e')]['id']}})[_0xb466('0x2a')](handleEntityNotFound(_0x6e3375,null))[_0xb466('0x2a')](function(_0x4cd9d7){if(_0x4cd9d7){_0x374103=_0x4cd9d7;_0x5812f4['model']=_['keys'](db[_0xb466('0x50')][_0xb466('0x32')]);_0x5812f4[_0xb466('0x37')]=_['keys'](_0x15abcb[_0xb466('0x37')]);_0x5812f4[_0xb466('0x39')]=_[_0xb466('0x3b')](_0x5812f4[_0xb466('0x36')],_0x5812f4['query']);_0x4b75fe[_0xb466('0x3a')]=_['intersection'](_0x5812f4['model'],qs['fields'](_0x15abcb[_0xb466('0x37')]['fields']));_0x4b75fe[_0xb466('0x3a')]=_0x4b75fe[_0xb466('0x3a')][_0xb466('0x3d')]?_0x4b75fe[_0xb466('0x3a')]:_0x5812f4[_0xb466('0x36')];_0x4b75fe[_0xb466('0x51')]=qs[_0xb466('0x3f')](_0x15abcb[_0xb466('0x37')][_0xb466('0x3f')]);_0x4b75fe[_0xb466('0x40')]=qs[_0xb466('0x39')](_[_0xb466('0x41')](_0x15abcb[_0xb466('0x37')],_0x5812f4[_0xb466('0x39')]));if(_0x15abcb[_0xb466('0x37')][_0xb466('0x42')]){_0x4b75fe[_0xb466('0x40')]=_[_0xb466('0x43')](_0x4b75fe[_0xb466('0x40')],{'$or':_[_0xb466('0x30')](_0x4b75fe[_0xb466('0x3a')],function(_0x1b2587){var _0x5032e0={};_0x5032e0[_0x1b2587]={'$like':'%'+_0x15abcb[_0xb466('0x37')][_0xb466('0x42')]+'%'};return _0x5032e0;})});}_0x4b75fe=_['merge']({},_0x4b75fe,_0x15abcb[_0xb466('0x45')]);return _0x374103[_0xb466('0x4f')](_0x4b75fe);}})[_0xb466('0x2a')](function(_0x6fed6){if(_0x6fed6){_0x4bd5dd=_0x6fed6[_0xb466('0x3d')];if(!_0x15abcb['query'][_0xb466('0x3e')](_0xb466('0x52'))){_0x4b75fe[_0xb466('0x22')]=qs[_0xb466('0x22')](_0x15abcb[_0xb466('0x37')][_0xb466('0x22')]);_0x4b75fe[_0xb466('0x21')]=qs['offset'](_0x15abcb[_0xb466('0x37')][_0xb466('0x21')]);}return _0x374103['getConfigurations'](_0x4b75fe);}})['then'](function(_0x3bb1c5){if(_0x3bb1c5){return _0x3bb1c5?{'count':_0x4bd5dd,'rows':_0x3bb1c5}:null;}})['then'](respondWithResult(_0x6e3375,null))[_0xb466('0x48')](handleError(_0x6e3375,null));};exports[_0xb466('0x53')]=function(_0x3d84f9,_0x1626fe,_0x44c65a){if(_0x3d84f9['body']['id']){delete _0x3d84f9['body']['id'];}return db[_0xb466('0x31')][_0xb466('0x54')]({'where':{'id':_0x3d84f9['params']['id']}})[_0xb466('0x2a')](handleEntityNotFound(_0x1626fe,null))['then'](function(_0x23a54b){if(_0x23a54b){_0x3d84f9[_0xb466('0x4d')][_0xb466('0x55')]=_0x23a54b['id'];_0x3d84f9[_0xb466('0x4d')][_0xb466('0x56')]=integrations[_0xb466('0x57')](_0x3d84f9[_0xb466('0x4d')][_0xb466('0x58')],_0x3d84f9[_0xb466('0x4d')][_0xb466('0x34')]);_0x3d84f9[_0xb466('0x4d')][_0xb466('0x59')]=integrations['getDescriptions'](_0x3d84f9['body'][_0xb466('0x58')],_0x3d84f9[_0xb466('0x4d')][_0xb466('0x34')]);return db[_0xb466('0x50')][_0xb466('0x4c')](_0x3d84f9[_0xb466('0x4d')],{'include':[{'model':db['VtigerField'],'as':'Subjects'},{'model':db[_0xb466('0x5a')],'as':_0xb466('0x59')}]});}return null;})[_0xb466('0x2a')](respondWithResult(_0x1626fe,null))[_0xb466('0x48')](handleError(_0x1626fe,null));};var md5=require(_0xb466('0x5b'));exports['getFields']=function(_0x44fd64,_0x272631,_0x33e098){var _0x2c64a5=null;var _0x5551bc=null;var _0x3f88d1=null;var _0x45d61a=null;var _0x45e0b1='';return db['VtigerAccount'][_0xb466('0x54')]({'where':{'id':_0x44fd64[_0xb466('0x4e')]['id']},'attributes':['id',_0xb466('0x2d'),_0xb466('0x5c'),_0xb466('0x5d'),'moduleName','remoteUri',_0xb466('0x5e'),_0xb466('0x5f')]})[_0xb466('0x2a')](handleEntityNotFound(_0x272631,null))[_0xb466('0x2a')](function(_0x2e54ab){if(_0x2e54ab){_0x2c64a5=_0x2e54ab['username'];_0x5551bc=_0x2e54ab[_0xb466('0x5f')];_0x3f88d1=_0x2e54ab['moduleName'];_0x45e0b1=_0x2e54ab[_0xb466('0x60')];var _0x52c763=_0x45e0b1[_0xb466('0x61')](-0x1);if(_0x52c763==='/'){_0x45e0b1=_0x45e0b1[_0xb466('0x62')](0x0,_0x45e0b1['lastIndexOf'](_0x52c763));}_0x45d61a=util[_0xb466('0x63')](_0xb466('0x64'),_0x45e0b1);var _0x40558b={'method':_0xb466('0x65'),'uri':_0x45d61a,'qs':{'operation':_0xb466('0x66'),'username':_0x2e54ab[_0xb466('0x5c')]},'json':!![]};return rp(_0x40558b);}})[_0xb466('0x2a')](function(_0x5783be){if(_0x5783be[_0xb466('0x67')]){var _0x57950d={'method':_0xb466('0x68'),'uri':_0x45d61a,'form':{'operation':_0xb466('0x69'),'username':_0x2c64a5,'accessKey':md5(_0x5783be[_0xb466('0x6a')][_0xb466('0x6b')]+_0x5551bc)},'json':!![]};return rp(_0x57950d);}})[_0xb466('0x2a')](function(_0x32de97){if(_0x32de97['success']){var _0x2e2c75={'method':_0xb466('0x65'),'uri':_0x45d61a,'qs':{'operation':_0xb466('0x6c'),'username':_0x2c64a5,'sessionName':_0x32de97[_0xb466('0x6a')]['sessionName'],'elementType':_0x3f88d1},'json':!![]};return rp(_0x2e2c75);}})[_0xb466('0x2a')](function(_0x3cd818){if(_0x3cd818[_0xb466('0x67')]){var _0x1f23a3=[_0xb466('0x6d'),_0xb466('0x6e'),'owner'];_[_0xb466('0x6f')](_0x3cd818[_0xb466('0x6a')][_0xb466('0x3c')],function(_0x52ec14){return _0x1f23a3['includes'](_0x52ec14[_0xb466('0x34')]['name']);});_['remove'](_0x3cd818[_0xb466('0x6a')][_0xb466('0x3c')],function(_0x59e978){return _0x59e978[_0xb466('0x70')]===_0xb466('0x71');});return{'count':_0x3cd818[_0xb466('0x6a')][_0xb466('0x3c')][_0xb466('0x3d')],'rows':_['map'](_0x3cd818[_0xb466('0x6a')][_0xb466('0x3c')],function(_0x260ecc){return{'id':_0x260ecc[_0xb466('0x2d')],'name':_0x260ecc[_0xb466('0x72')],'custom':_['startsWith'](_0x260ecc['name'],_0xb466('0x73'))?!![]:![],'options':_0x260ecc[_0xb466('0x34')][_0xb466('0x2d')]==='picklist'&&_0x260ecc['type']['picklistValues'][_0xb466('0x3d')]>0x0?_[_0xb466('0x30')](_0x260ecc['type'][_0xb466('0x74')],function(_0x281aca){return{'name':_0x281aca[_0xb466('0x72')],'value':_0x281aca[_0xb466('0x75')]};}):[]};})};}})[_0xb466('0x2a')](respondWithResult(_0x272631,null))[_0xb466('0x48')](function(_0x220647){console[_0xb466('0x76')](_0xb466('0x77')+_0x220647);var _0x5ce692=_0x44fd64['query']['test']?0x1f4:_0x220647[_0xb466('0x78')]||0x1f4;logger[_0xb466('0x2b')](_0xb466('0x79'),_0xb466('0x7a'),_0x5ce692,JSON[_0xb466('0x7b')](_0x220647));delete _0x220647[_0xb466('0x2d')];if(_0x5ce692===0x191){_0x5ce692=0x190;}_0x272631[_0xb466('0x1c')](_0x5ce692)['send'](_0x44fd64[_0xb466('0x37')][_0xb466('0x7c')]?{'message':_0xb466('0x7d'),'statusCode':_0x220647[_0xb466('0x78')]}:_0x220647);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index f52b599..debdcce 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 _0xc9a3=['int_vtiger_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','VtigerAccount'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc9a3,0x83));var _0x3c9a=function(_0x226c95,_0xaee592){_0x226c95=_0x226c95-0x0;var _0x340141=_0xc9a3[_0x226c95];return _0x340141;};'use strict';var _=require(_0x3c9a('0x0'));var util=require(_0x3c9a('0x1'));var logger=require(_0x3c9a('0x2'))('api');var moment=require(_0x3c9a('0x3'));var BPromise=require(_0x3c9a('0x4'));var rp=require(_0x3c9a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3c9a('0x6'));var config=require(_0x3c9a('0x7'));var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x3c9a('0x8'));module[_0x3c9a('0x9')]=function(_0x4d75fe,_0x347ffa){return _0x4d75fe[_0x3c9a('0xa')](_0x3c9a('0xb'),attributes,{'tableName':_0x3c9a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4135=['VtigerAccount','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x16c0b7,_0x42e87f){var _0xd16ec8=function(_0x3c175c){while(--_0x3c175c){_0x16c0b7['push'](_0x16c0b7['shift']());}};_0xd16ec8(++_0x42e87f);}(_0x4135,0x1ae));var _0x5413=function(_0x119de7,_0x3d1fbb){_0x119de7=_0x119de7-0x0;var _0x4a3ea3=_0x4135[_0x119de7];return _0x4a3ea3;};'use strict';var _=require('lodash');var util=require(_0x5413('0x0'));var logger=require(_0x5413('0x1'))(_0x5413('0x2'));var moment=require(_0x5413('0x3'));var BPromise=require('bluebird');var rp=require(_0x5413('0x4'));var fs=require('fs');var path=require(_0x5413('0x5'));var rimraf=require(_0x5413('0x6'));var config=require(_0x5413('0x7'));var attributes=require('./intVtigerAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x5413('0x8')]=function(_0x1a1fbd,_0x6b2da2){return _0x1a1fbd[_0x5413('0x9')](_0x5413('0xa'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 65200c4..962f836 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 _0x1c7c=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','where','limit','include','map','model','attributes','ShowVtigerAccount','raw','lodash','util','moment','bluebird'];(function(_0x4570f9,_0x4bc670){var _0x5099a4=function(_0x591ddd){while(--_0x591ddd){_0x4570f9['push'](_0x4570f9['shift']());}};_0x5099a4(++_0x4bc670);}(_0x1c7c,0x164));var _0xc1c7=function(_0x9ae788,_0x30402e){_0x9ae788=_0x9ae788-0x0;var _0x3b3c2a=_0x1c7c[_0x9ae788];return _0x3b3c2a;};'use strict';var _=require(_0xc1c7('0x0'));var util=require(_0xc1c7('0x1'));var moment=require(_0xc1c7('0x2'));var BPromise=require(_0xc1c7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc1c7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc1c7('0x5'));var logger=require(_0xc1c7('0x6'))(_0xc1c7('0x7'));var config=require(_0xc1c7('0x8'));var jayson=require(_0xc1c7('0x9'));var client=jayson[_0xc1c7('0xa')][_0xc1c7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x419138,_0xce5bcd,_0x3b3e9c){return new BPromise(function(_0x434a35,_0x11c7ef){return client[_0xc1c7('0xc')](_0x419138,_0x3b3e9c)[_0xc1c7('0xd')](function(_0x339649){logger[_0xc1c7('0xe')](_0xc1c7('0xf'),_0xce5bcd,'request\x20sent');logger[_0xc1c7('0x10')](_0xc1c7('0x11'),_0xce5bcd,'request\x20sent',JSON[_0xc1c7('0x12')](_0x339649));if(_0x339649[_0xc1c7('0x13')]){if(_0x339649[_0xc1c7('0x13')]['code']===0x1f4){logger[_0xc1c7('0x13')](_0xc1c7('0xf'),_0xce5bcd,_0x339649[_0xc1c7('0x13')][_0xc1c7('0x14')]);return _0x11c7ef(_0x339649[_0xc1c7('0x13')][_0xc1c7('0x14')]);}logger[_0xc1c7('0x13')](_0xc1c7('0xf'),_0xce5bcd,_0x339649[_0xc1c7('0x13')][_0xc1c7('0x14')]);return _0x434a35(_0x339649[_0xc1c7('0x13')][_0xc1c7('0x14')]);}else{logger['info'](_0xc1c7('0xf'),_0xce5bcd,_0xc1c7('0x15'));_0x434a35(_0x339649[_0xc1c7('0x16')]['message']);}})[_0xc1c7('0x17')](function(_0x3939c1){logger[_0xc1c7('0x13')](_0xc1c7('0xf'),_0xce5bcd,_0x3939c1);_0x11c7ef(_0x3939c1);});});}exports[_0xc1c7('0x18')]=function(_0xb42702){var _0x21758a=this;return new Promise(function(_0x2e93e5,_0x5d44e9){return db[_0xc1c7('0x19')][_0xc1c7('0x1a')]({'raw':_0xb42702[_0xc1c7('0x1b')]?_0xb42702[_0xc1c7('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0xb42702[_0xc1c7('0x1b')]?_0xb42702['options'][_0xc1c7('0x1c')]||null:null,'attributes':_0xb42702[_0xc1c7('0x1b')]?_0xb42702['options']['attributes']||null:null,'limit':_0xb42702[_0xc1c7('0x1b')]?_0xb42702[_0xc1c7('0x1b')][_0xc1c7('0x1d')]||null:null,'include':_0xb42702['options']?_0xb42702[_0xc1c7('0x1b')][_0xc1c7('0x1e')]?_[_0xc1c7('0x1f')](_0xb42702[_0xc1c7('0x1b')][_0xc1c7('0x1e')],function(_0x3a2483){return{'model':db[_0x3a2483[_0xc1c7('0x20')]],'as':_0x3a2483['as'],'attributes':_0x3a2483[_0xc1c7('0x21')],'include':_0x3a2483[_0xc1c7('0x1e')]?_[_0xc1c7('0x1f')](_0x3a2483[_0xc1c7('0x1e')],function(_0x363fbc){return{'model':db[_0x363fbc[_0xc1c7('0x20')]],'as':_0x363fbc['as'],'attributes':_0x363fbc[_0xc1c7('0x21')],'include':_0x363fbc[_0xc1c7('0x1e')]?_[_0xc1c7('0x1f')](_0x363fbc['include'],function(_0xf0ab9c){return{'model':db[_0xf0ab9c[_0xc1c7('0x20')]],'as':_0xf0ab9c['as'],'attributes':_0xf0ab9c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x352f24){logger['info']('GetVtigerAccount',_0xb42702);logger[_0xc1c7('0x10')](_0xc1c7('0x18'),_0xb42702,JSON[_0xc1c7('0x12')](_0x352f24));_0x2e93e5(_0x352f24);})[_0xc1c7('0x17')](function(_0x461360){logger['error']('GetVtigerAccount',_0x461360[_0xc1c7('0x14')],_0xb42702);_0x5d44e9(_0x21758a[_0xc1c7('0x13')](0x1f4,_0x461360[_0xc1c7('0x14')]));});});};exports[_0xc1c7('0x22')]=function(_0x2e35f1){var _0x4968b0=this;return new Promise(function(_0x50042f,_0x125920){return db[_0xc1c7('0x19')]['find']({'raw':_0x2e35f1[_0xc1c7('0x1b')]?_0x2e35f1[_0xc1c7('0x1b')][_0xc1c7('0x23')]===undefined?!![]:![]:!![],'where':_0x2e35f1[_0xc1c7('0x1b')]?_0x2e35f1[_0xc1c7('0x1b')][_0xc1c7('0x1c')]||null:null,'attributes':_0x2e35f1[_0xc1c7('0x1b')]?_0x2e35f1['options'][_0xc1c7('0x21')]||null:null,'include':_0x2e35f1[_0xc1c7('0x1b')]?_0x2e35f1[_0xc1c7('0x1b')][_0xc1c7('0x1e')]?_[_0xc1c7('0x1f')](_0x2e35f1[_0xc1c7('0x1b')][_0xc1c7('0x1e')],function(_0xef703f){return{'model':db[_0xef703f[_0xc1c7('0x20')]],'as':_0xef703f['as'],'attributes':_0xef703f['attributes'],'include':_0xef703f['include']?_[_0xc1c7('0x1f')](_0xef703f[_0xc1c7('0x1e')],function(_0x263900){return{'model':db[_0x263900[_0xc1c7('0x20')]],'as':_0x263900['as'],'attributes':_0x263900[_0xc1c7('0x21')],'include':_0x263900[_0xc1c7('0x1e')]?_[_0xc1c7('0x1f')](_0x263900[_0xc1c7('0x1e')],function(_0x3bd3b0){return{'model':db[_0x3bd3b0[_0xc1c7('0x20')]],'as':_0x3bd3b0['as'],'attributes':_0x3bd3b0[_0xc1c7('0x21')]};}):[]};}):[]};}):[]:[]})[_0xc1c7('0xd')](function(_0x154476){logger[_0xc1c7('0xe')](_0xc1c7('0x22'),_0x2e35f1);logger[_0xc1c7('0x10')](_0xc1c7('0x22'),_0x2e35f1,JSON[_0xc1c7('0x12')](_0x154476));_0x50042f(_0x154476);})[_0xc1c7('0x17')](function(_0x239a91){logger[_0xc1c7('0x13')]('ShowVtigerAccount',_0x239a91['message'],_0x2e35f1);_0x125920(_0x4968b0['error'](0x1f4,_0x239a91[_0xc1c7('0x14')]));});});}; \ No newline at end of file +var _0x373d=['VtigerAccount','ShowVtigerAccount','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','info','request\x20sent','debug','stringify','error','code','message','VtigerAccount,\x20%s,\x20%s','result','catch','options','raw','where','attributes','limit','include','map','model','then','GetVtigerAccount'];(function(_0xb8cfbe,_0x2e81b6){var _0x227d51=function(_0x5cb1ff){while(--_0x5cb1ff){_0xb8cfbe['push'](_0xb8cfbe['shift']());}};_0x227d51(++_0x2e81b6);}(_0x373d,0x1e2));var _0xd373=function(_0x27fdf9,_0x2ea7bd){_0x27fdf9=_0x27fdf9-0x0;var _0x13a909=_0x373d[_0x27fdf9];return _0x13a909;};'use strict';var _=require(_0xd373('0x0'));var util=require('util');var moment=require(_0xd373('0x1'));var BPromise=require(_0xd373('0x2'));var rs=require(_0xd373('0x3'));var fs=require('fs');var Redis=require(_0xd373('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd373('0x5'));var logger=require(_0xd373('0x6'))(_0xd373('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd373('0x8')][_0xd373('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x446be6,_0x4008c5,_0x48d977){return new BPromise(function(_0xe79819,_0x51c074){return client['request'](_0x446be6,_0x48d977)['then'](function(_0x14472a){logger[_0xd373('0xa')]('VtigerAccount,\x20%s,\x20%s',_0x4008c5,_0xd373('0xb'));logger[_0xd373('0xc')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x4008c5,'request\x20sent',JSON[_0xd373('0xd')](_0x14472a));if(_0x14472a[_0xd373('0xe')]){if(_0x14472a[_0xd373('0xe')][_0xd373('0xf')]===0x1f4){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x4008c5,_0x14472a['error'][_0xd373('0x10')]);return _0x51c074(_0x14472a[_0xd373('0xe')]['message']);}logger[_0xd373('0xe')](_0xd373('0x11'),_0x4008c5,_0x14472a[_0xd373('0xe')][_0xd373('0x10')]);return _0xe79819(_0x14472a[_0xd373('0xe')][_0xd373('0x10')]);}else{logger[_0xd373('0xa')](_0xd373('0x11'),_0x4008c5,_0xd373('0xb'));_0xe79819(_0x14472a[_0xd373('0x12')][_0xd373('0x10')]);}})[_0xd373('0x13')](function(_0x1921dd){logger['error'](_0xd373('0x11'),_0x4008c5,_0x1921dd);_0x51c074(_0x1921dd);});});}exports['GetVtigerAccount']=function(_0x460259){var _0x36d47a=this;return new Promise(function(_0x55c5c7,_0x1bbdbd){return db['VtigerAccount']['findAll']({'raw':_0x460259[_0xd373('0x14')]?_0x460259[_0xd373('0x14')][_0xd373('0x15')]===undefined?!![]:![]:!![],'where':_0x460259[_0xd373('0x14')]?_0x460259[_0xd373('0x14')][_0xd373('0x16')]||null:null,'attributes':_0x460259['options']?_0x460259[_0xd373('0x14')][_0xd373('0x17')]||null:null,'limit':_0x460259[_0xd373('0x14')]?_0x460259[_0xd373('0x14')][_0xd373('0x18')]||null:null,'include':_0x460259[_0xd373('0x14')]?_0x460259['options'][_0xd373('0x19')]?_[_0xd373('0x1a')](_0x460259[_0xd373('0x14')][_0xd373('0x19')],function(_0x217ee7){return{'model':db[_0x217ee7[_0xd373('0x1b')]],'as':_0x217ee7['as'],'attributes':_0x217ee7[_0xd373('0x17')],'include':_0x217ee7[_0xd373('0x19')]?_[_0xd373('0x1a')](_0x217ee7[_0xd373('0x19')],function(_0x437110){return{'model':db[_0x437110[_0xd373('0x1b')]],'as':_0x437110['as'],'attributes':_0x437110[_0xd373('0x17')],'include':_0x437110[_0xd373('0x19')]?_[_0xd373('0x1a')](_0x437110[_0xd373('0x19')],function(_0x50b987){return{'model':db[_0x50b987[_0xd373('0x1b')]],'as':_0x50b987['as'],'attributes':_0x50b987[_0xd373('0x17')]};}):[]};}):[]};}):[]:[]})[_0xd373('0x1c')](function(_0x45ee58){logger[_0xd373('0xa')](_0xd373('0x1d'),_0x460259);logger[_0xd373('0xc')](_0xd373('0x1d'),_0x460259,JSON[_0xd373('0xd')](_0x45ee58));_0x55c5c7(_0x45ee58);})[_0xd373('0x13')](function(_0xbc420b){logger[_0xd373('0xe')](_0xd373('0x1d'),_0xbc420b['message'],_0x460259);_0x1bbdbd(_0x36d47a[_0xd373('0xe')](0x1f4,_0xbc420b['message']));});});};exports['ShowVtigerAccount']=function(_0xedc8f3){var _0x15da6c=this;return new Promise(function(_0x25e016,_0x23024c){return db[_0xd373('0x1e')]['find']({'raw':_0xedc8f3[_0xd373('0x14')]?_0xedc8f3[_0xd373('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0xedc8f3[_0xd373('0x14')]?_0xedc8f3[_0xd373('0x14')][_0xd373('0x16')]||null:null,'attributes':_0xedc8f3[_0xd373('0x14')]?_0xedc8f3[_0xd373('0x14')][_0xd373('0x17')]||null:null,'include':_0xedc8f3[_0xd373('0x14')]?_0xedc8f3[_0xd373('0x14')][_0xd373('0x19')]?_['map'](_0xedc8f3[_0xd373('0x14')][_0xd373('0x19')],function(_0x420c73){return{'model':db[_0x420c73[_0xd373('0x1b')]],'as':_0x420c73['as'],'attributes':_0x420c73[_0xd373('0x17')],'include':_0x420c73[_0xd373('0x19')]?_[_0xd373('0x1a')](_0x420c73[_0xd373('0x19')],function(_0xaa62aa){return{'model':db[_0xaa62aa[_0xd373('0x1b')]],'as':_0xaa62aa['as'],'attributes':_0xaa62aa[_0xd373('0x17')],'include':_0xaa62aa[_0xd373('0x19')]?_[_0xd373('0x1a')](_0xaa62aa[_0xd373('0x19')],function(_0x22429c){return{'model':db[_0x22429c['model']],'as':_0x22429c['as'],'attributes':_0x22429c[_0xd373('0x17')]};}):[]};}):[]};}):[]:[]})[_0xd373('0x1c')](function(_0x186e39){logger[_0xd373('0xa')]('ShowVtigerAccount',_0xedc8f3);logger[_0xd373('0xc')](_0xd373('0x1f'),_0xedc8f3,JSON[_0xd373('0xd')](_0x186e39));_0x25e016(_0x186e39);})[_0xd373('0x13')](function(_0x38d8ec){logger[_0xd373('0xe')]('ShowVtigerAccount',_0x38d8ec['message'],_0xedc8f3);_0x23024c(_0x15da6c[_0xd373('0xe')](0x1f4,_0x38d8ec['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 833ee67..9ec864c 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 _0x564e=['show','getFields','/:id/subjects','getSubjects','create','put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated'];(function(_0x2025b7,_0x3368fb){var _0x371a62=function(_0x525954){while(--_0x525954){_0x2025b7['push'](_0x2025b7['shift']());}};_0x371a62(++_0x3368fb);}(_0x564e,0x11a));var _0xe564=function(_0x1fa83f,_0x56dfba){_0x1fa83f=_0x1fa83f-0x0;var _0x5902dc=_0x564e[_0x1fa83f];return _0x5902dc;};'use strict';var multer=require(_0xe564('0x0'));var util=require(_0xe564('0x1'));var path=require('path');var timeout=require(_0xe564('0x2'));var express=require(_0xe564('0x3'));var router=express[_0xe564('0x4')]();var fs_extra=require(_0xe564('0x5'));var auth=require(_0xe564('0x6'));var interaction=require(_0xe564('0x7'));var config=require(_0xe564('0x8'));var controller=require('./intVtigerConfiguration.controller');router[_0xe564('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe564('0x9')](_0xe564('0xa'),auth[_0xe564('0xb')](),controller[_0xe564('0xc')]);router[_0xe564('0x9')]('/:id/fields',auth[_0xe564('0xb')](),controller[_0xe564('0xd')]);router[_0xe564('0x9')](_0xe564('0xe'),auth['isAuthenticated'](),controller[_0xe564('0xf')]);router[_0xe564('0x9')]('/:id/descriptions',auth['isAuthenticated'](),controller['getDescriptions']);router['post']('/',auth[_0xe564('0xb')](),controller[_0xe564('0x10')]);router[_0xe564('0x11')](_0xe564('0xa'),auth['isAuthenticated'](),controller[_0xe564('0x12')]);router[_0xe564('0x13')](_0xe564('0xa'),auth[_0xe564('0xb')](),controller['destroy']);module[_0xe564('0x14')]=router; \ No newline at end of file +var _0x523c=['isAuthenticated','index','get','/:id','show','getSubjects','/:id/descriptions','post','create','put','update','delete','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller'];(function(_0x406d39,_0xd3c8f1){var _0x2eb792=function(_0x572291){while(--_0x572291){_0x406d39['push'](_0x406d39['shift']());}};_0x2eb792(++_0xd3c8f1);}(_0x523c,0x1db));var _0xc523=function(_0x225d28,_0x23c2c4){_0x225d28=_0x225d28-0x0;var _0x599ecd=_0x523c[_0x225d28];return _0x599ecd;};'use strict';var multer=require(_0xc523('0x0'));var util=require(_0xc523('0x1'));var path=require(_0xc523('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc523('0x3')]();var fs_extra=require(_0xc523('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc523('0x5'));var config=require(_0xc523('0x6'));var controller=require(_0xc523('0x7'));router['get']('/',auth[_0xc523('0x8')](),controller[_0xc523('0x9')]);router[_0xc523('0xa')](_0xc523('0xb'),auth['isAuthenticated'](),controller[_0xc523('0xc')]);router['get']('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router['get']('/:id/subjects',auth[_0xc523('0x8')](),controller[_0xc523('0xd')]);router[_0xc523('0xa')](_0xc523('0xe'),auth[_0xc523('0x8')](),controller['getDescriptions']);router[_0xc523('0xf')]('/',auth[_0xc523('0x8')](),controller[_0xc523('0x10')]);router[_0xc523('0x11')]('/:id',auth[_0xc523('0x8')](),controller[_0xc523('0x12')]);router[_0xc523('0x13')](_0xc523('0xb'),auth[_0xc523('0x8')](),controller['destroy']);module[_0xc523('0x14')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index b9ad6d4..7c23bd0 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 _0x5a39=['sequelize','STRING'];(function(_0x2f0ffe,_0x49f6cf){var _0xcc685f=function(_0x56ac17){while(--_0x56ac17){_0x2f0ffe['push'](_0x2f0ffe['shift']());}};_0xcc685f(++_0x49f6cf);}(_0x5a39,0x64));var _0x95a3=function(_0x1d8fc4,_0x331606){_0x1d8fc4=_0x1d8fc4-0x0;var _0x17cd5b=_0x5a39[_0x1d8fc4];return _0x17cd5b;};'use strict';var Sequelize=require(_0x95a3('0x0'));module['exports']={'name':{'type':Sequelize[_0x95a3('0x1')]},'description':{'type':Sequelize[_0x95a3('0x1')]}}; \ No newline at end of file +var _0xcbed=['STRING','sequelize'];(function(_0x7b7b9d,_0x2bda49){var _0x523496=function(_0x562a70){while(--_0x562a70){_0x7b7b9d['push'](_0x7b7b9d['shift']());}};_0x523496(++_0x2bda49);}(_0xcbed,0x187));var _0xdcbe=function(_0x5d49d8,_0x735b38){_0x5d49d8=_0x5d49d8-0x0;var _0x41afa6=_0xcbed[_0x5d49d8];return _0x41afa6;};'use strict';var Sequelize=require(_0xdcbe('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xdcbe('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 88d094c..c3659e1 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 _0x0bb2=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','params','find','create','body','getFields','findOne','VtigerField','getSubjects','pick','getDescriptions','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/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','limit','offset','count','status','set','Content-Range','json','reject','save','update','destroy','error','stack','name','send','index','VtigerConfiguration','rawAttributes','model','map','keys','query','filters'];(function(_0x24ef23,_0x3dd23c){var _0x155895=function(_0x56fa62){while(--_0x56fa62){_0x24ef23['push'](_0x24ef23['shift']());}};_0x155895(++_0x3dd23c);}(_0x0bb2,0x72));var _0x20bb=function(_0x7f0965,_0x158118){_0x7f0965=_0x7f0965-0x0;var _0x112b17=_0x0bb2[_0x7f0965];return _0x112b17;};'use strict';var emlformat=require(_0x20bb('0x0'));var rimraf=require(_0x20bb('0x1'));var zipdir=require(_0x20bb('0x2'));var jsonpatch=require(_0x20bb('0x3'));var rp=require(_0x20bb('0x4'));var moment=require(_0x20bb('0x5'));var BPromise=require(_0x20bb('0x6'));var Mustache=require(_0x20bb('0x7'));var util=require(_0x20bb('0x8'));var path=require(_0x20bb('0x9'));var sox=require(_0x20bb('0xa'));var csv=require(_0x20bb('0xb'));var ejs=require(_0x20bb('0xc'));var fs=require('fs');var fs_extra=require(_0x20bb('0xd'));var _=require('lodash');var squel=require(_0x20bb('0xe'));var crypto=require(_0x20bb('0xf'));var jsforce=require(_0x20bb('0x10'));var deskjs=require(_0x20bb('0x11'));var toCsv=require('to-csv');var querystring=require(_0x20bb('0x12'));var Papa=require(_0x20bb('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x20bb('0x14'));var as=require(_0x20bb('0x15'));var hardwareService=require(_0x20bb('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x20bb('0x17'));var config=require(_0x20bb('0x18'));var licenseUtil=require(_0x20bb('0x19'));var db=require(_0x20bb('0x1a'))['db'];function respondWithStatusCode(_0xc8665c,_0x44cb4e){_0x44cb4e=_0x44cb4e||0xcc;return function(_0x5e942a){if(_0x5e942a){return _0xc8665c[_0x20bb('0x1b')](_0x44cb4e);}return _0xc8665c['status'](_0x44cb4e)[_0x20bb('0x1c')]();};}function respondWithResult(_0x4911fe,_0x1fd958){_0x1fd958=_0x1fd958||0xc8;return function(_0x1ac76d){if(_0x1ac76d){return _0x4911fe['status'](_0x1fd958)['json'](_0x1ac76d);}};}function respondWithFilteredResult(_0x4f2939,_0x2a1a27){return function(_0x17f6c5){if(_0x17f6c5){var _0x3300d6=typeof _0x2a1a27['offset']==='undefined'&&typeof _0x2a1a27[_0x20bb('0x1d')]==='undefined';var _0x4369ec=_0x17f6c5['count'];var _0x197303=_0x3300d6?0x0:_0x2a1a27[_0x20bb('0x1e')];var _0x25885f=_0x3300d6?_0x17f6c5[_0x20bb('0x1f')]:_0x2a1a27['offset']+_0x2a1a27['limit'];var _0xf472cb;if(_0x25885f>=_0x4369ec){_0x25885f=_0x4369ec;_0xf472cb=0xc8;}else{_0xf472cb=0xce;}_0x4f2939[_0x20bb('0x20')](_0xf472cb);return _0x4f2939[_0x20bb('0x21')](_0x20bb('0x22'),_0x197303+'-'+_0x25885f+'/'+_0x4369ec)[_0x20bb('0x23')](_0x17f6c5);}return null;};}function patchUpdates(_0x348dce){return function(_0x4e6f46){try{jsonpatch['apply'](_0x4e6f46,_0x348dce,!![]);}catch(_0x1c9e42){return BPromise[_0x20bb('0x24')](_0x1c9e42);}return _0x4e6f46[_0x20bb('0x25')]();};}function saveUpdates(_0x48228e,_0x345f4f){return function(_0x43d4ca){if(_0x43d4ca){return _0x43d4ca[_0x20bb('0x26')](_0x48228e)['then'](function(_0xdf1bf8){return _0xdf1bf8;});}return null;};}function removeEntity(_0x12047b,_0x3d0f44){return function(_0xa19be1){if(_0xa19be1){return _0xa19be1[_0x20bb('0x27')]()['then'](function(){_0x12047b[_0x20bb('0x20')](0xcc)[_0x20bb('0x1c')]();});}};}function handleEntityNotFound(_0x5c80e0,_0xa5d820){return function(_0x378c0d){if(!_0x378c0d){_0x5c80e0[_0x20bb('0x1b')](0x194);}return _0x378c0d;};}function handleError(_0x43f71a,_0x2a37a7){_0x2a37a7=_0x2a37a7||0x1f4;return function(_0x2cee69){logger[_0x20bb('0x28')](_0x2cee69[_0x20bb('0x29')]);if(_0x2cee69[_0x20bb('0x2a')]){delete _0x2cee69['name'];}_0x43f71a['status'](_0x2a37a7)[_0x20bb('0x2b')](_0x2cee69);};}exports[_0x20bb('0x2c')]=function(_0x91483f,_0x65315f){var _0x1dc74f={},_0x106336={},_0x5bb058={'count':0x0,'rows':[]};var _0x23ab18=_['map'](db[_0x20bb('0x2d')][_0x20bb('0x2e')],function(_0x507a4d){return{'name':_0x507a4d['fieldName'],'type':_0x507a4d['type']['key']};});_0x106336[_0x20bb('0x2f')]=_[_0x20bb('0x30')](_0x23ab18,'name');_0x106336['query']=_[_0x20bb('0x31')](_0x91483f[_0x20bb('0x32')]);_0x106336[_0x20bb('0x33')]=_[_0x20bb('0x34')](_0x106336[_0x20bb('0x2f')],_0x106336['query']);_0x1dc74f[_0x20bb('0x35')]=_[_0x20bb('0x34')](_0x106336['model'],qs[_0x20bb('0x36')](_0x91483f[_0x20bb('0x32')][_0x20bb('0x36')]));_0x1dc74f['attributes']=_0x1dc74f[_0x20bb('0x35')][_0x20bb('0x37')]?_0x1dc74f['attributes']:_0x106336['model'];if(!_0x91483f['query'][_0x20bb('0x38')](_0x20bb('0x39'))){_0x1dc74f[_0x20bb('0x1d')]=qs[_0x20bb('0x1d')](_0x91483f[_0x20bb('0x32')]['limit']);_0x1dc74f[_0x20bb('0x1e')]=qs[_0x20bb('0x1e')](_0x91483f[_0x20bb('0x32')][_0x20bb('0x1e')]);}_0x1dc74f[_0x20bb('0x3a')]=qs['sort'](_0x91483f[_0x20bb('0x32')][_0x20bb('0x3b')]);_0x1dc74f[_0x20bb('0x3c')]=qs['filters'](_['pick'](_0x91483f[_0x20bb('0x32')],_0x106336[_0x20bb('0x33')]),_0x23ab18);if(_0x91483f[_0x20bb('0x32')][_0x20bb('0x3d')]){_0x1dc74f[_0x20bb('0x3c')]=_[_0x20bb('0x3e')](_0x1dc74f[_0x20bb('0x3c')],{'$or':_[_0x20bb('0x30')](_0x23ab18,function(_0x5bc946){if(_0x5bc946[_0x20bb('0x3f')]!==_0x20bb('0x40')){var _0x4c1bdc={};_0x4c1bdc[_0x5bc946[_0x20bb('0x2a')]]={'$like':'%'+_0x91483f['query'][_0x20bb('0x3d')]+'%'};return _0x4c1bdc;}})});}_0x1dc74f=_[_0x20bb('0x3e')]({},_0x1dc74f,_0x91483f[_0x20bb('0x41')]);var _0x4bfa6e={'where':_0x1dc74f[_0x20bb('0x3c')]};return db['VtigerConfiguration'][_0x20bb('0x1f')](_0x4bfa6e)[_0x20bb('0x42')](function(_0xb3f45d){_0x5bb058[_0x20bb('0x1f')]=_0xb3f45d;if(_0x91483f[_0x20bb('0x32')][_0x20bb('0x43')]){_0x1dc74f[_0x20bb('0x44')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0x20bb('0x45')](_0x1dc74f);})[_0x20bb('0x42')](function(_0x21ad26){_0x5bb058[_0x20bb('0x46')]=_0x21ad26;return _0x5bb058;})['then'](respondWithFilteredResult(_0x65315f,_0x1dc74f))[_0x20bb('0x47')](handleError(_0x65315f,null));};exports[_0x20bb('0x48')]=function(_0x23e94d,_0x56c161){var _0x170ec8={'raw':![],'where':{'id':_0x23e94d[_0x20bb('0x49')]['id']}},_0x112b78={};_0x112b78[_0x20bb('0x2f')]=_[_0x20bb('0x31')](db[_0x20bb('0x2d')]['rawAttributes']);_0x112b78[_0x20bb('0x32')]=_[_0x20bb('0x31')](_0x23e94d[_0x20bb('0x32')]);_0x112b78[_0x20bb('0x33')]=_['intersection'](_0x112b78['model'],_0x112b78[_0x20bb('0x32')]);_0x170ec8[_0x20bb('0x35')]=_[_0x20bb('0x34')](_0x112b78[_0x20bb('0x2f')],qs[_0x20bb('0x36')](_0x23e94d[_0x20bb('0x32')][_0x20bb('0x36')]));_0x170ec8['attributes']=_0x170ec8[_0x20bb('0x35')][_0x20bb('0x37')]?_0x170ec8[_0x20bb('0x35')]:_0x112b78[_0x20bb('0x2f')];if(_0x23e94d[_0x20bb('0x32')][_0x20bb('0x43')]){_0x170ec8[_0x20bb('0x44')]=[{'all':!![]}];}_0x170ec8=_[_0x20bb('0x3e')]({},_0x170ec8,_0x23e94d[_0x20bb('0x41')]);return db[_0x20bb('0x2d')][_0x20bb('0x4a')](_0x170ec8)['then'](handleEntityNotFound(_0x56c161,null))['then'](respondWithResult(_0x56c161,null))[_0x20bb('0x47')](handleError(_0x56c161,null));};exports[_0x20bb('0x4b')]=function(_0x1a677b,_0x5278f7){return db['VtigerConfiguration'][_0x20bb('0x4b')](_0x1a677b[_0x20bb('0x4c')],{})[_0x20bb('0x42')](respondWithResult(_0x5278f7,0xc9))[_0x20bb('0x47')](handleError(_0x5278f7,null));};exports['update']=function(_0x2ab1af,_0x533563){if(_0x2ab1af[_0x20bb('0x4c')]['id']){delete _0x2ab1af[_0x20bb('0x4c')]['id'];}return db['VtigerConfiguration'][_0x20bb('0x4a')]({'where':{'id':_0x2ab1af[_0x20bb('0x49')]['id']}})[_0x20bb('0x42')](handleEntityNotFound(_0x533563,null))['then'](saveUpdates(_0x2ab1af[_0x20bb('0x4c')],null))['then'](respondWithResult(_0x533563,null))[_0x20bb('0x47')](handleError(_0x533563,null));};exports[_0x20bb('0x27')]=function(_0x4c000f,_0x4f3a87){return db[_0x20bb('0x2d')]['find']({'where':{'id':_0x4c000f[_0x20bb('0x49')]['id']}})[_0x20bb('0x42')](handleEntityNotFound(_0x4f3a87,null))[_0x20bb('0x42')](removeEntity(_0x4f3a87,null))[_0x20bb('0x47')](handleError(_0x4f3a87,null));};exports[_0x20bb('0x4d')]=function(_0xbc9ac1,_0x47d564,_0x31c182){var _0x51d7cf={};var _0x367878={};var _0x9b9e8a;var _0x3402ad;return db['VtigerConfiguration'][_0x20bb('0x4e')]({'where':{'id':_0xbc9ac1[_0x20bb('0x49')]['id']}})[_0x20bb('0x42')](handleEntityNotFound(_0x47d564,null))[_0x20bb('0x42')](function(_0x324851){if(_0x324851){_0x9b9e8a=_0x324851;_0x367878[_0x20bb('0x2f')]=_[_0x20bb('0x31')](db[_0x20bb('0x4f')][_0x20bb('0x2e')]);_0x367878[_0x20bb('0x32')]=_[_0x20bb('0x31')](_0xbc9ac1[_0x20bb('0x32')]);_0x367878[_0x20bb('0x33')]=_['intersection'](_0x367878[_0x20bb('0x2f')],_0x367878[_0x20bb('0x32')]);_0x51d7cf['attributes']=_[_0x20bb('0x34')](_0x367878['model'],qs[_0x20bb('0x36')](_0xbc9ac1[_0x20bb('0x32')]['fields']));_0x51d7cf[_0x20bb('0x35')]=_0x51d7cf[_0x20bb('0x35')]['length']?_0x51d7cf[_0x20bb('0x35')]:_0x367878[_0x20bb('0x2f')];_0x51d7cf[_0x20bb('0x3a')]=qs[_0x20bb('0x3b')](_0xbc9ac1[_0x20bb('0x32')]['sort']);_0x51d7cf[_0x20bb('0x3c')]=qs['filters'](_['pick'](_0xbc9ac1['query'],_0x367878[_0x20bb('0x33')]));if(_0xbc9ac1[_0x20bb('0x32')][_0x20bb('0x3d')]){_0x51d7cf['where']=_['merge'](_0x51d7cf[_0x20bb('0x3c')],{'$or':_['map'](_0x51d7cf[_0x20bb('0x35')],function(_0x5c858b){var _0x211e83={};_0x211e83[_0x5c858b]={'$like':'%'+_0xbc9ac1[_0x20bb('0x32')][_0x20bb('0x3d')]+'%'};return _0x211e83;})});}_0x51d7cf=_[_0x20bb('0x3e')]({},_0x51d7cf,_0xbc9ac1[_0x20bb('0x41')]);return _0x9b9e8a[_0x20bb('0x4d')](_0x51d7cf);}})[_0x20bb('0x42')](function(_0x437f3e){if(_0x437f3e){_0x3402ad=_0x437f3e['length'];if(!_0xbc9ac1['query'][_0x20bb('0x38')](_0x20bb('0x39'))){_0x51d7cf['limit']=qs['limit'](_0xbc9ac1['query'][_0x20bb('0x1d')]);_0x51d7cf['offset']=qs[_0x20bb('0x1e')](_0xbc9ac1[_0x20bb('0x32')]['offset']);}return _0x9b9e8a[_0x20bb('0x4d')](_0x51d7cf);}})[_0x20bb('0x42')](function(_0x794c35){if(_0x794c35){return _0x794c35?{'count':_0x3402ad,'rows':_0x794c35}:null;}})[_0x20bb('0x42')](respondWithResult(_0x47d564,null))['catch'](handleError(_0x47d564,null));};exports[_0x20bb('0x50')]=function(_0x3d3639,_0x44eb52,_0xd91907){var _0x4fd764={};var _0x19e87b={};var _0x3ab733;var _0x1533fe;return db[_0x20bb('0x2d')][_0x20bb('0x4e')]({'where':{'id':_0x3d3639['params']['id']}})[_0x20bb('0x42')](handleEntityNotFound(_0x44eb52,null))[_0x20bb('0x42')](function(_0x310689){if(_0x310689){_0x3ab733=_0x310689;_0x19e87b['model']=_[_0x20bb('0x31')](db['VtigerField'][_0x20bb('0x2e')]);_0x19e87b[_0x20bb('0x32')]=_['keys'](_0x3d3639[_0x20bb('0x32')]);_0x19e87b[_0x20bb('0x33')]=_[_0x20bb('0x34')](_0x19e87b[_0x20bb('0x2f')],_0x19e87b[_0x20bb('0x32')]);_0x4fd764[_0x20bb('0x35')]=_[_0x20bb('0x34')](_0x19e87b['model'],qs[_0x20bb('0x36')](_0x3d3639[_0x20bb('0x32')][_0x20bb('0x36')]));_0x4fd764[_0x20bb('0x35')]=_0x4fd764[_0x20bb('0x35')][_0x20bb('0x37')]?_0x4fd764[_0x20bb('0x35')]:_0x19e87b[_0x20bb('0x2f')];_0x4fd764['order']=qs[_0x20bb('0x3b')](_0x3d3639['query']['sort']);_0x4fd764[_0x20bb('0x3c')]=qs[_0x20bb('0x33')](_[_0x20bb('0x51')](_0x3d3639[_0x20bb('0x32')],_0x19e87b[_0x20bb('0x33')]));if(_0x3d3639[_0x20bb('0x32')]['filter']){_0x4fd764[_0x20bb('0x3c')]=_['merge'](_0x4fd764[_0x20bb('0x3c')],{'$or':_[_0x20bb('0x30')](_0x4fd764[_0x20bb('0x35')],function(_0x22ae54){var _0x1e16c1={};_0x1e16c1[_0x22ae54]={'$like':'%'+_0x3d3639[_0x20bb('0x32')][_0x20bb('0x3d')]+'%'};return _0x1e16c1;})});}_0x4fd764=_['merge']({},_0x4fd764,_0x3d3639[_0x20bb('0x41')]);return _0x3ab733[_0x20bb('0x50')](_0x4fd764);}})[_0x20bb('0x42')](function(_0x3c2614){if(_0x3c2614){_0x1533fe=_0x3c2614[_0x20bb('0x37')];if(!_0x3d3639[_0x20bb('0x32')][_0x20bb('0x38')](_0x20bb('0x39'))){_0x4fd764[_0x20bb('0x1d')]=qs[_0x20bb('0x1d')](_0x3d3639[_0x20bb('0x32')]['limit']);_0x4fd764[_0x20bb('0x1e')]=qs['offset'](_0x3d3639[_0x20bb('0x32')][_0x20bb('0x1e')]);}return _0x3ab733[_0x20bb('0x50')](_0x4fd764);}})[_0x20bb('0x42')](function(_0x310efb){if(_0x310efb){return _0x310efb?{'count':_0x1533fe,'rows':_0x310efb}:null;}})[_0x20bb('0x42')](respondWithResult(_0x44eb52,null))[_0x20bb('0x47')](handleError(_0x44eb52,null));};exports[_0x20bb('0x52')]=function(_0x2dc47b,_0x1fbcc0,_0x50c505){var _0x59edc3={};var _0x10739d={};var _0x1ec9e7;var _0x37b8d9;return db[_0x20bb('0x2d')][_0x20bb('0x4e')]({'where':{'id':_0x2dc47b[_0x20bb('0x49')]['id']}})[_0x20bb('0x42')](handleEntityNotFound(_0x1fbcc0,null))['then'](function(_0x3e6202){if(_0x3e6202){_0x1ec9e7=_0x3e6202;_0x10739d[_0x20bb('0x2f')]=_['keys'](db[_0x20bb('0x4f')][_0x20bb('0x2e')]);_0x10739d[_0x20bb('0x32')]=_[_0x20bb('0x31')](_0x2dc47b[_0x20bb('0x32')]);_0x10739d[_0x20bb('0x33')]=_[_0x20bb('0x34')](_0x10739d['model'],_0x10739d[_0x20bb('0x32')]);_0x59edc3[_0x20bb('0x35')]=_[_0x20bb('0x34')](_0x10739d['model'],qs[_0x20bb('0x36')](_0x2dc47b[_0x20bb('0x32')]['fields']));_0x59edc3[_0x20bb('0x35')]=_0x59edc3['attributes'][_0x20bb('0x37')]?_0x59edc3[_0x20bb('0x35')]:_0x10739d[_0x20bb('0x2f')];_0x59edc3['order']=qs[_0x20bb('0x3b')](_0x2dc47b[_0x20bb('0x32')][_0x20bb('0x3b')]);_0x59edc3['where']=qs[_0x20bb('0x33')](_['pick'](_0x2dc47b[_0x20bb('0x32')],_0x10739d['filters']));if(_0x2dc47b[_0x20bb('0x32')]['filter']){_0x59edc3['where']=_[_0x20bb('0x3e')](_0x59edc3[_0x20bb('0x3c')],{'$or':_['map'](_0x59edc3[_0x20bb('0x35')],function(_0x35230f){var _0x7d22be={};_0x7d22be[_0x35230f]={'$like':'%'+_0x2dc47b[_0x20bb('0x32')][_0x20bb('0x3d')]+'%'};return _0x7d22be;})});}_0x59edc3=_[_0x20bb('0x3e')]({},_0x59edc3,_0x2dc47b[_0x20bb('0x41')]);return _0x1ec9e7['getDescriptions'](_0x59edc3);}})[_0x20bb('0x42')](function(_0x37a49a){if(_0x37a49a){_0x37b8d9=_0x37a49a['length'];if(!_0x2dc47b['query'][_0x20bb('0x38')](_0x20bb('0x39'))){_0x59edc3[_0x20bb('0x1d')]=qs[_0x20bb('0x1d')](_0x2dc47b[_0x20bb('0x32')][_0x20bb('0x1d')]);_0x59edc3[_0x20bb('0x1e')]=qs['offset'](_0x2dc47b[_0x20bb('0x32')][_0x20bb('0x1e')]);}return _0x1ec9e7[_0x20bb('0x52')](_0x59edc3);}})['then'](function(_0x19846a){if(_0x19846a){return _0x19846a?{'count':_0x37b8d9,'rows':_0x19846a}:null;}})[_0x20bb('0x42')](respondWithResult(_0x1fbcc0,null))[_0x20bb('0x47')](handleError(_0x1fbcc0,null));}; \ No newline at end of file +var _0x05b0=['options','includeAll','include','rows','catch','show','params','model','length','body','find','destroy','getFields','findOne','VtigerField','getSubjects','getDescriptions','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','Content-Range','json','apply','save','update','then','end','error','stack','name','send','index','map','VtigerConfiguration','rawAttributes','type','key','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x53ef6a,_0xa3df06){var _0x4749f0=function(_0x1f12df){while(--_0x1f12df){_0x53ef6a['push'](_0x53ef6a['shift']());}};_0x4749f0(++_0xa3df06);}(_0x05b0,0x188));var _0x005b=function(_0x18d864,_0x625694){_0x18d864=_0x18d864-0x0;var _0x504046=_0x05b0[_0x18d864];return _0x504046;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x005b('0x0'));var jsonpatch=require(_0x005b('0x1'));var rp=require('request-promise');var moment=require(_0x005b('0x2'));var BPromise=require(_0x005b('0x3'));var Mustache=require('mustache');var util=require(_0x005b('0x4'));var path=require(_0x005b('0x5'));var sox=require('sox');var csv=require(_0x005b('0x6'));var ejs=require(_0x005b('0x7'));var fs=require('fs');var fs_extra=require(_0x005b('0x8'));var _=require(_0x005b('0x9'));var squel=require(_0x005b('0xa'));var crypto=require(_0x005b('0xb'));var jsforce=require(_0x005b('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x005b('0x6'));var querystring=require(_0x005b('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x005b('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x005b('0xf'))(_0x005b('0x10'));var utils=require('../../config/utils');var config=require(_0x005b('0x11'));var licenseUtil=require(_0x005b('0x12'));var db=require(_0x005b('0x13'))['db'];function respondWithStatusCode(_0x10f9bb,_0xce7212){_0xce7212=_0xce7212||0xcc;return function(_0xe2674e){if(_0xe2674e){return _0x10f9bb[_0x005b('0x14')](_0xce7212);}return _0x10f9bb['status'](_0xce7212)['end']();};}function respondWithResult(_0x52ad9c,_0x309c8f){_0x309c8f=_0x309c8f||0xc8;return function(_0x50b7ce){if(_0x50b7ce){return _0x52ad9c[_0x005b('0x15')](_0x309c8f)['json'](_0x50b7ce);}};}function respondWithFilteredResult(_0x1c8eed,_0x1f7743){return function(_0x2ce01e){if(_0x2ce01e){var _0x1991e8=typeof _0x1f7743[_0x005b('0x16')]==='undefined'&&typeof _0x1f7743[_0x005b('0x17')]===_0x005b('0x18');var _0xf3cf84=_0x2ce01e['count'];var _0x206c0a=_0x1991e8?0x0:_0x1f7743[_0x005b('0x16')];var _0x50a6eb=_0x1991e8?_0x2ce01e[_0x005b('0x19')]:_0x1f7743[_0x005b('0x16')]+_0x1f7743[_0x005b('0x17')];var _0x434874;if(_0x50a6eb>=_0xf3cf84){_0x50a6eb=_0xf3cf84;_0x434874=0xc8;}else{_0x434874=0xce;}_0x1c8eed[_0x005b('0x15')](_0x434874);return _0x1c8eed['set'](_0x005b('0x1a'),_0x206c0a+'-'+_0x50a6eb+'/'+_0xf3cf84)[_0x005b('0x1b')](_0x2ce01e);}return null;};}function patchUpdates(_0x4ae164){return function(_0x24637d){try{jsonpatch[_0x005b('0x1c')](_0x24637d,_0x4ae164,!![]);}catch(_0xd97375){return BPromise['reject'](_0xd97375);}return _0x24637d[_0x005b('0x1d')]();};}function saveUpdates(_0x145c36,_0x319981){return function(_0x3521c9){if(_0x3521c9){return _0x3521c9[_0x005b('0x1e')](_0x145c36)[_0x005b('0x1f')](function(_0x4f632f){return _0x4f632f;});}return null;};}function removeEntity(_0x322229,_0x169428){return function(_0x1fef26){if(_0x1fef26){return _0x1fef26['destroy']()[_0x005b('0x1f')](function(){_0x322229['status'](0xcc)[_0x005b('0x20')]();});}};}function handleEntityNotFound(_0x527294,_0x542fa2){return function(_0x2dc341){if(!_0x2dc341){_0x527294[_0x005b('0x14')](0x194);}return _0x2dc341;};}function handleError(_0x3effd5,_0x267f10){_0x267f10=_0x267f10||0x1f4;return function(_0x6730d4){logger[_0x005b('0x21')](_0x6730d4[_0x005b('0x22')]);if(_0x6730d4[_0x005b('0x23')]){delete _0x6730d4['name'];}_0x3effd5[_0x005b('0x15')](_0x267f10)[_0x005b('0x24')](_0x6730d4);};}exports[_0x005b('0x25')]=function(_0x13e834,_0x2e92d1){var _0x1d8f93={},_0x4775a2={},_0x49561a={'count':0x0,'rows':[]};var _0xaf7c71=_[_0x005b('0x26')](db[_0x005b('0x27')][_0x005b('0x28')],function(_0x545a2b){return{'name':_0x545a2b['fieldName'],'type':_0x545a2b[_0x005b('0x29')][_0x005b('0x2a')]};});_0x4775a2['model']=_['map'](_0xaf7c71,_0x005b('0x23'));_0x4775a2['query']=_[_0x005b('0x2b')](_0x13e834[_0x005b('0x2c')]);_0x4775a2[_0x005b('0x2d')]=_['intersection'](_0x4775a2['model'],_0x4775a2[_0x005b('0x2c')]);_0x1d8f93[_0x005b('0x2e')]=_[_0x005b('0x2f')](_0x4775a2['model'],qs['fields'](_0x13e834[_0x005b('0x2c')][_0x005b('0x30')]));_0x1d8f93['attributes']=_0x1d8f93[_0x005b('0x2e')]['length']?_0x1d8f93[_0x005b('0x2e')]:_0x4775a2['model'];if(!_0x13e834['query'][_0x005b('0x31')](_0x005b('0x32'))){_0x1d8f93[_0x005b('0x17')]=qs[_0x005b('0x17')](_0x13e834[_0x005b('0x2c')]['limit']);_0x1d8f93['offset']=qs[_0x005b('0x16')](_0x13e834[_0x005b('0x2c')][_0x005b('0x16')]);}_0x1d8f93[_0x005b('0x33')]=qs[_0x005b('0x34')](_0x13e834[_0x005b('0x2c')]['sort']);_0x1d8f93[_0x005b('0x35')]=qs[_0x005b('0x2d')](_[_0x005b('0x36')](_0x13e834['query'],_0x4775a2[_0x005b('0x2d')]),_0xaf7c71);if(_0x13e834[_0x005b('0x2c')][_0x005b('0x37')]){_0x1d8f93[_0x005b('0x35')]=_[_0x005b('0x38')](_0x1d8f93[_0x005b('0x35')],{'$or':_[_0x005b('0x26')](_0xaf7c71,function(_0x9f4d6){if(_0x9f4d6[_0x005b('0x29')]!==_0x005b('0x39')){var _0x4d6064={};_0x4d6064[_0x9f4d6[_0x005b('0x23')]]={'$like':'%'+_0x13e834[_0x005b('0x2c')]['filter']+'%'};return _0x4d6064;}})});}_0x1d8f93=_[_0x005b('0x38')]({},_0x1d8f93,_0x13e834[_0x005b('0x3a')]);var _0x1f29de={'where':_0x1d8f93[_0x005b('0x35')]};return db['VtigerConfiguration'][_0x005b('0x19')](_0x1f29de)[_0x005b('0x1f')](function(_0x4b0a10){_0x49561a[_0x005b('0x19')]=_0x4b0a10;if(_0x13e834[_0x005b('0x2c')][_0x005b('0x3b')]){_0x1d8f93[_0x005b('0x3c')]=[{'all':!![]}];}return db[_0x005b('0x27')]['findAll'](_0x1d8f93);})['then'](function(_0x1dfe28){_0x49561a[_0x005b('0x3d')]=_0x1dfe28;return _0x49561a;})[_0x005b('0x1f')](respondWithFilteredResult(_0x2e92d1,_0x1d8f93))[_0x005b('0x3e')](handleError(_0x2e92d1,null));};exports[_0x005b('0x3f')]=function(_0x59fefd,_0x182e3a){var _0x14bd15={'raw':![],'where':{'id':_0x59fefd[_0x005b('0x40')]['id']}},_0x2bbb8a={};_0x2bbb8a[_0x005b('0x41')]=_[_0x005b('0x2b')](db['VtigerConfiguration'][_0x005b('0x28')]);_0x2bbb8a['query']=_[_0x005b('0x2b')](_0x59fefd[_0x005b('0x2c')]);_0x2bbb8a['filters']=_[_0x005b('0x2f')](_0x2bbb8a[_0x005b('0x41')],_0x2bbb8a[_0x005b('0x2c')]);_0x14bd15[_0x005b('0x2e')]=_['intersection'](_0x2bbb8a[_0x005b('0x41')],qs[_0x005b('0x30')](_0x59fefd[_0x005b('0x2c')][_0x005b('0x30')]));_0x14bd15[_0x005b('0x2e')]=_0x14bd15[_0x005b('0x2e')][_0x005b('0x42')]?_0x14bd15[_0x005b('0x2e')]:_0x2bbb8a[_0x005b('0x41')];if(_0x59fefd['query'][_0x005b('0x3b')]){_0x14bd15[_0x005b('0x3c')]=[{'all':!![]}];}_0x14bd15=_[_0x005b('0x38')]({},_0x14bd15,_0x59fefd[_0x005b('0x3a')]);return db[_0x005b('0x27')]['find'](_0x14bd15)[_0x005b('0x1f')](handleEntityNotFound(_0x182e3a,null))[_0x005b('0x1f')](respondWithResult(_0x182e3a,null))[_0x005b('0x3e')](handleError(_0x182e3a,null));};exports['create']=function(_0x10a141,_0x50d178){return db['VtigerConfiguration']['create'](_0x10a141['body'],{})[_0x005b('0x1f')](respondWithResult(_0x50d178,0xc9))[_0x005b('0x3e')](handleError(_0x50d178,null));};exports[_0x005b('0x1e')]=function(_0xb1898,_0x4e19cd){if(_0xb1898[_0x005b('0x43')]['id']){delete _0xb1898[_0x005b('0x43')]['id'];}return db['VtigerConfiguration'][_0x005b('0x44')]({'where':{'id':_0xb1898[_0x005b('0x40')]['id']}})[_0x005b('0x1f')](handleEntityNotFound(_0x4e19cd,null))[_0x005b('0x1f')](saveUpdates(_0xb1898[_0x005b('0x43')],null))['then'](respondWithResult(_0x4e19cd,null))[_0x005b('0x3e')](handleError(_0x4e19cd,null));};exports[_0x005b('0x45')]=function(_0x2aebe9,_0x11dc21){return db[_0x005b('0x27')][_0x005b('0x44')]({'where':{'id':_0x2aebe9['params']['id']}})[_0x005b('0x1f')](handleEntityNotFound(_0x11dc21,null))[_0x005b('0x1f')](removeEntity(_0x11dc21,null))[_0x005b('0x3e')](handleError(_0x11dc21,null));};exports[_0x005b('0x46')]=function(_0x288935,_0x1be7c2,_0x4c6eb0){var _0x2f5096={};var _0x13a680={};var _0x5cea23;var _0x5bbc78;return db[_0x005b('0x27')][_0x005b('0x47')]({'where':{'id':_0x288935[_0x005b('0x40')]['id']}})[_0x005b('0x1f')](handleEntityNotFound(_0x1be7c2,null))[_0x005b('0x1f')](function(_0x224143){if(_0x224143){_0x5cea23=_0x224143;_0x13a680[_0x005b('0x41')]=_['keys'](db[_0x005b('0x48')]['rawAttributes']);_0x13a680['query']=_[_0x005b('0x2b')](_0x288935[_0x005b('0x2c')]);_0x13a680[_0x005b('0x2d')]=_['intersection'](_0x13a680[_0x005b('0x41')],_0x13a680[_0x005b('0x2c')]);_0x2f5096[_0x005b('0x2e')]=_['intersection'](_0x13a680[_0x005b('0x41')],qs['fields'](_0x288935[_0x005b('0x2c')][_0x005b('0x30')]));_0x2f5096['attributes']=_0x2f5096[_0x005b('0x2e')][_0x005b('0x42')]?_0x2f5096[_0x005b('0x2e')]:_0x13a680[_0x005b('0x41')];_0x2f5096[_0x005b('0x33')]=qs[_0x005b('0x34')](_0x288935['query'][_0x005b('0x34')]);_0x2f5096[_0x005b('0x35')]=qs[_0x005b('0x2d')](_[_0x005b('0x36')](_0x288935[_0x005b('0x2c')],_0x13a680[_0x005b('0x2d')]));if(_0x288935['query'][_0x005b('0x37')]){_0x2f5096['where']=_[_0x005b('0x38')](_0x2f5096[_0x005b('0x35')],{'$or':_[_0x005b('0x26')](_0x2f5096[_0x005b('0x2e')],function(_0x31e6f5){var _0x2ee675={};_0x2ee675[_0x31e6f5]={'$like':'%'+_0x288935[_0x005b('0x2c')][_0x005b('0x37')]+'%'};return _0x2ee675;})});}_0x2f5096=_[_0x005b('0x38')]({},_0x2f5096,_0x288935[_0x005b('0x3a')]);return _0x5cea23[_0x005b('0x46')](_0x2f5096);}})[_0x005b('0x1f')](function(_0x303621){if(_0x303621){_0x5bbc78=_0x303621[_0x005b('0x42')];if(!_0x288935[_0x005b('0x2c')]['hasOwnProperty'](_0x005b('0x32'))){_0x2f5096[_0x005b('0x17')]=qs[_0x005b('0x17')](_0x288935[_0x005b('0x2c')][_0x005b('0x17')]);_0x2f5096[_0x005b('0x16')]=qs[_0x005b('0x16')](_0x288935['query'][_0x005b('0x16')]);}return _0x5cea23['getFields'](_0x2f5096);}})[_0x005b('0x1f')](function(_0x4bd368){if(_0x4bd368){return _0x4bd368?{'count':_0x5bbc78,'rows':_0x4bd368}:null;}})[_0x005b('0x1f')](respondWithResult(_0x1be7c2,null))[_0x005b('0x3e')](handleError(_0x1be7c2,null));};exports['getSubjects']=function(_0x30a886,_0x275094,_0x10d9d2){var _0x2b7f3e={};var _0x2d3aeb={};var _0x6fc481;var _0x4729aa;return db[_0x005b('0x27')][_0x005b('0x47')]({'where':{'id':_0x30a886[_0x005b('0x40')]['id']}})['then'](handleEntityNotFound(_0x275094,null))['then'](function(_0xb96c87){if(_0xb96c87){_0x6fc481=_0xb96c87;_0x2d3aeb[_0x005b('0x41')]=_[_0x005b('0x2b')](db[_0x005b('0x48')][_0x005b('0x28')]);_0x2d3aeb[_0x005b('0x2c')]=_[_0x005b('0x2b')](_0x30a886[_0x005b('0x2c')]);_0x2d3aeb[_0x005b('0x2d')]=_[_0x005b('0x2f')](_0x2d3aeb[_0x005b('0x41')],_0x2d3aeb[_0x005b('0x2c')]);_0x2b7f3e[_0x005b('0x2e')]=_['intersection'](_0x2d3aeb[_0x005b('0x41')],qs[_0x005b('0x30')](_0x30a886['query'][_0x005b('0x30')]));_0x2b7f3e[_0x005b('0x2e')]=_0x2b7f3e[_0x005b('0x2e')][_0x005b('0x42')]?_0x2b7f3e[_0x005b('0x2e')]:_0x2d3aeb[_0x005b('0x41')];_0x2b7f3e[_0x005b('0x33')]=qs[_0x005b('0x34')](_0x30a886[_0x005b('0x2c')]['sort']);_0x2b7f3e[_0x005b('0x35')]=qs[_0x005b('0x2d')](_[_0x005b('0x36')](_0x30a886[_0x005b('0x2c')],_0x2d3aeb[_0x005b('0x2d')]));if(_0x30a886[_0x005b('0x2c')][_0x005b('0x37')]){_0x2b7f3e[_0x005b('0x35')]=_[_0x005b('0x38')](_0x2b7f3e[_0x005b('0x35')],{'$or':_[_0x005b('0x26')](_0x2b7f3e[_0x005b('0x2e')],function(_0x287924){var _0x5f2ef1={};_0x5f2ef1[_0x287924]={'$like':'%'+_0x30a886[_0x005b('0x2c')]['filter']+'%'};return _0x5f2ef1;})});}_0x2b7f3e=_[_0x005b('0x38')]({},_0x2b7f3e,_0x30a886['options']);return _0x6fc481[_0x005b('0x49')](_0x2b7f3e);}})[_0x005b('0x1f')](function(_0x38ff2b){if(_0x38ff2b){_0x4729aa=_0x38ff2b[_0x005b('0x42')];if(!_0x30a886[_0x005b('0x2c')][_0x005b('0x31')](_0x005b('0x32'))){_0x2b7f3e['limit']=qs['limit'](_0x30a886[_0x005b('0x2c')][_0x005b('0x17')]);_0x2b7f3e['offset']=qs[_0x005b('0x16')](_0x30a886[_0x005b('0x2c')]['offset']);}return _0x6fc481[_0x005b('0x49')](_0x2b7f3e);}})['then'](function(_0x46e257){if(_0x46e257){return _0x46e257?{'count':_0x4729aa,'rows':_0x46e257}:null;}})['then'](respondWithResult(_0x275094,null))[_0x005b('0x3e')](handleError(_0x275094,null));};exports[_0x005b('0x4a')]=function(_0x4a68b6,_0x21f97a,_0x1db928){var _0x1cd0b6={};var _0x3eacfe={};var _0x1b3d90;var _0x2ac534;return db[_0x005b('0x27')]['findOne']({'where':{'id':_0x4a68b6[_0x005b('0x40')]['id']}})[_0x005b('0x1f')](handleEntityNotFound(_0x21f97a,null))[_0x005b('0x1f')](function(_0xd9eb57){if(_0xd9eb57){_0x1b3d90=_0xd9eb57;_0x3eacfe[_0x005b('0x41')]=_[_0x005b('0x2b')](db[_0x005b('0x48')][_0x005b('0x28')]);_0x3eacfe[_0x005b('0x2c')]=_[_0x005b('0x2b')](_0x4a68b6[_0x005b('0x2c')]);_0x3eacfe[_0x005b('0x2d')]=_[_0x005b('0x2f')](_0x3eacfe[_0x005b('0x41')],_0x3eacfe['query']);_0x1cd0b6['attributes']=_[_0x005b('0x2f')](_0x3eacfe[_0x005b('0x41')],qs['fields'](_0x4a68b6['query'][_0x005b('0x30')]));_0x1cd0b6[_0x005b('0x2e')]=_0x1cd0b6[_0x005b('0x2e')][_0x005b('0x42')]?_0x1cd0b6[_0x005b('0x2e')]:_0x3eacfe[_0x005b('0x41')];_0x1cd0b6[_0x005b('0x33')]=qs[_0x005b('0x34')](_0x4a68b6[_0x005b('0x2c')][_0x005b('0x34')]);_0x1cd0b6['where']=qs[_0x005b('0x2d')](_['pick'](_0x4a68b6[_0x005b('0x2c')],_0x3eacfe[_0x005b('0x2d')]));if(_0x4a68b6[_0x005b('0x2c')]['filter']){_0x1cd0b6[_0x005b('0x35')]=_[_0x005b('0x38')](_0x1cd0b6[_0x005b('0x35')],{'$or':_[_0x005b('0x26')](_0x1cd0b6[_0x005b('0x2e')],function(_0x3433f9){var _0x44dd54={};_0x44dd54[_0x3433f9]={'$like':'%'+_0x4a68b6['query'][_0x005b('0x37')]+'%'};return _0x44dd54;})});}_0x1cd0b6=_['merge']({},_0x1cd0b6,_0x4a68b6[_0x005b('0x3a')]);return _0x1b3d90[_0x005b('0x4a')](_0x1cd0b6);}})['then'](function(_0x2de5b6){if(_0x2de5b6){_0x2ac534=_0x2de5b6[_0x005b('0x42')];if(!_0x4a68b6[_0x005b('0x2c')][_0x005b('0x31')](_0x005b('0x32'))){_0x1cd0b6[_0x005b('0x17')]=qs[_0x005b('0x17')](_0x4a68b6[_0x005b('0x2c')][_0x005b('0x17')]);_0x1cd0b6[_0x005b('0x16')]=qs[_0x005b('0x16')](_0x4a68b6[_0x005b('0x2c')]['offset']);}return _0x1b3d90[_0x005b('0x4a')](_0x1cd0b6);}})[_0x005b('0x1f')](function(_0x34c2ff){if(_0x34c2ff){return _0x34c2ff?{'count':_0x2ac534,'rows':_0x34c2ff}:null;}})[_0x005b('0x1f')](respondWithResult(_0x21f97a,null))[_0x005b('0x3e')](handleError(_0x21f97a,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index fa4aa37..d4dc7d0 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 _0x04f9=['int_vtiger_configurations','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','VtigerConfiguration'];(function(_0x3dd47d,_0x46dbfc){var _0x282139=function(_0xbd39c5){while(--_0xbd39c5){_0x3dd47d['push'](_0x3dd47d['shift']());}};_0x282139(++_0x46dbfc);}(_0x04f9,0xde));var _0x904f=function(_0x445f84,_0x288ed6){_0x445f84=_0x445f84-0x0;var _0x39c105=_0x04f9[_0x445f84];return _0x39c105;};'use strict';var _=require(_0x904f('0x0'));var util=require(_0x904f('0x1'));var logger=require(_0x904f('0x2'))(_0x904f('0x3'));var moment=require(_0x904f('0x4'));var BPromise=require('bluebird');var rp=require(_0x904f('0x5'));var fs=require('fs');var path=require(_0x904f('0x6'));var rimraf=require(_0x904f('0x7'));var config=require(_0x904f('0x8'));var attributes=require(_0x904f('0x9'));module[_0x904f('0xa')]=function(_0x4dc347,_0x543aa6){return _0x4dc347['define'](_0x904f('0xb'),attributes,{'tableName':_0x904f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6221=['VtigerConfiguration','int_vtiger_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./intVtigerConfiguration.attributes','exports','define'];(function(_0x39772f,_0x5605cb){var _0xc9edbf=function(_0x106a39){while(--_0x106a39){_0x39772f['push'](_0x39772f['shift']());}};_0xc9edbf(++_0x5605cb);}(_0x6221,0x77));var _0x1622=function(_0x5ec454,_0xfcd77e){_0x5ec454=_0x5ec454-0x0;var _0x5ebf50=_0x6221[_0x5ec454];return _0x5ebf50;};'use strict';var _=require(_0x1622('0x0'));var util=require(_0x1622('0x1'));var logger=require(_0x1622('0x2'))(_0x1622('0x3'));var moment=require(_0x1622('0x4'));var BPromise=require(_0x1622('0x5'));var rp=require(_0x1622('0x6'));var fs=require('fs');var path=require(_0x1622('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1622('0x8'));module[_0x1622('0x9')]=function(_0x36bf32,_0x2699aa){return _0x36bf32[_0x1622('0xa')](_0x1622('0xb'),attributes,{'tableName':_0x1622('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index 1d90f07..81f05f7 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 _0x9482=['request','then','info','VtigerConfiguration,\x20%s,\x20%s','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http'];(function(_0x125e96,_0x593930){var _0x308729=function(_0x47f979){while(--_0x47f979){_0x125e96['push'](_0x125e96['shift']());}};_0x308729(++_0x593930);}(_0x9482,0x9e));var _0x2948=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x9482[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x2948('0x0'));var util=require(_0x2948('0x1'));var moment=require(_0x2948('0x2'));var BPromise=require('bluebird');var rs=require(_0x2948('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2948('0x4'))['db'];var utils=require(_0x2948('0x5'));var logger=require(_0x2948('0x6'))(_0x2948('0x7'));var config=require('../../config/environment');var jayson=require(_0x2948('0x8'));var client=jayson['client'][_0x2948('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3a2186,_0x30e261,_0x4ff2c0){return new BPromise(function(_0x250cf3,_0x4862ff){return client[_0x2948('0xa')](_0x3a2186,_0x4ff2c0)[_0x2948('0xb')](function(_0x2bf8c6){logger[_0x2948('0xc')](_0x2948('0xd'),_0x30e261,'request\x20sent');logger[_0x2948('0xe')](_0x2948('0xf'),_0x30e261,_0x2948('0x10'),JSON['stringify'](_0x2bf8c6));if(_0x2bf8c6[_0x2948('0x11')]){if(_0x2bf8c6[_0x2948('0x11')][_0x2948('0x12')]===0x1f4){logger[_0x2948('0x11')](_0x2948('0xd'),_0x30e261,_0x2bf8c6[_0x2948('0x11')][_0x2948('0x13')]);return _0x4862ff(_0x2bf8c6[_0x2948('0x11')]['message']);}logger[_0x2948('0x11')](_0x2948('0xd'),_0x30e261,_0x2bf8c6[_0x2948('0x11')]['message']);return _0x250cf3(_0x2bf8c6[_0x2948('0x11')]['message']);}else{logger[_0x2948('0xc')](_0x2948('0xd'),_0x30e261,_0x2948('0x10'));_0x250cf3(_0x2bf8c6[_0x2948('0x14')][_0x2948('0x13')]);}})['catch'](function(_0x1d0665){logger['error'](_0x2948('0xd'),_0x30e261,_0x1d0665);_0x4862ff(_0x1d0665);});});} \ No newline at end of file +var _0x0e6e=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x3fa451,_0x32acff){var _0x19980e=function(_0xd68c1f){while(--_0xd68c1f){_0x3fa451['push'](_0x3fa451['shift']());}};_0x19980e(++_0x32acff);}(_0x0e6e,0x19a));var _0xe0e6=function(_0x3e2513,_0x4cea28){_0x3e2513=_0x3e2513-0x0;var _0x217185=_0x0e6e[_0x3e2513];return _0x217185;};'use strict';var _=require(_0xe0e6('0x0'));var util=require(_0xe0e6('0x1'));var moment=require(_0xe0e6('0x2'));var BPromise=require(_0xe0e6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe0e6('0x4'));var db=require(_0xe0e6('0x5'))['db'];var utils=require(_0xe0e6('0x6'));var logger=require(_0xe0e6('0x7'))(_0xe0e6('0x8'));var config=require(_0xe0e6('0x9'));var jayson=require(_0xe0e6('0xa'));var client=jayson[_0xe0e6('0xb')][_0xe0e6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5f445d,_0x5c7757,_0x17204b){return new BPromise(function(_0x5071bf,_0x48fac5){return client[_0xe0e6('0xd')](_0x5f445d,_0x17204b)[_0xe0e6('0xe')](function(_0x4e2a41){logger[_0xe0e6('0xf')](_0xe0e6('0x10'),_0x5c7757,_0xe0e6('0x11'));logger[_0xe0e6('0x12')](_0xe0e6('0x13'),_0x5c7757,_0xe0e6('0x11'),JSON[_0xe0e6('0x14')](_0x4e2a41));if(_0x4e2a41[_0xe0e6('0x15')]){if(_0x4e2a41[_0xe0e6('0x15')][_0xe0e6('0x16')]===0x1f4){logger['error'](_0xe0e6('0x10'),_0x5c7757,_0x4e2a41[_0xe0e6('0x15')][_0xe0e6('0x17')]);return _0x48fac5(_0x4e2a41['error'][_0xe0e6('0x17')]);}logger[_0xe0e6('0x15')](_0xe0e6('0x10'),_0x5c7757,_0x4e2a41[_0xe0e6('0x15')][_0xe0e6('0x17')]);return _0x5071bf(_0x4e2a41[_0xe0e6('0x15')]['message']);}else{logger[_0xe0e6('0xf')](_0xe0e6('0x10'),_0x5c7757,_0xe0e6('0x11'));_0x5071bf(_0x4e2a41[_0xe0e6('0x18')][_0xe0e6('0x17')]);}})[_0xe0e6('0x19')](function(_0x372250){logger['error'](_0xe0e6('0x10'),_0x5c7757,_0x372250);_0x48fac5(_0x372250);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index e40c368..28bb7ba 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 _0xec50=['/:id','isAuthenticated','show','post','put','delete','destroy','util','path','connect-timeout','Router','../../components/auth/service','./intVtigerField.controller','index','get'];(function(_0x4d042b,_0x498451){var _0x53fdf7=function(_0x6dda36){while(--_0x6dda36){_0x4d042b['push'](_0x4d042b['shift']());}};_0x53fdf7(++_0x498451);}(_0xec50,0xd9));var _0x0ec5=function(_0x5aa17c,_0x5892b1){_0x5aa17c=_0x5aa17c-0x0;var _0x1d886b=_0xec50[_0x5aa17c];return _0x1d886b;};'use strict';var multer=require('multer');var util=require(_0x0ec5('0x0'));var path=require(_0x0ec5('0x1'));var timeout=require(_0x0ec5('0x2'));var express=require('express');var router=express[_0x0ec5('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0ec5('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0ec5('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x0ec5('0x6')]);router[_0x0ec5('0x7')](_0x0ec5('0x8'),auth[_0x0ec5('0x9')](),controller[_0x0ec5('0xa')]);router[_0x0ec5('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0ec5('0xc')](_0x0ec5('0x8'),auth[_0x0ec5('0x9')](),controller['update']);router[_0x0ec5('0xd')](_0x0ec5('0x8'),auth['isAuthenticated'](),controller[_0x0ec5('0xe')]);module['exports']=router; \ No newline at end of file +var _0x82be=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerField.controller','get','isAuthenticated','index','show','create','put','/:id','update','destroy','exports','path'];(function(_0x13ee11,_0x129ca5){var _0xfe3915=function(_0x11b6c6){while(--_0x11b6c6){_0x13ee11['push'](_0x13ee11['shift']());}};_0xfe3915(++_0x129ca5);}(_0x82be,0x10d));var _0xe82b=function(_0x27e8ff,_0x2824e7){_0x27e8ff=_0x27e8ff-0x0;var _0x5d59fc=_0x82be[_0x27e8ff];return _0x5d59fc;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe82b('0x0'));var timeout=require(_0xe82b('0x1'));var express=require(_0xe82b('0x2'));var router=express[_0xe82b('0x3')]();var fs_extra=require(_0xe82b('0x4'));var auth=require(_0xe82b('0x5'));var interaction=require(_0xe82b('0x6'));var config=require('../../config/environment');var controller=require(_0xe82b('0x7'));router[_0xe82b('0x8')]('/',auth[_0xe82b('0x9')](),controller[_0xe82b('0xa')]);router[_0xe82b('0x8')]('/:id',auth[_0xe82b('0x9')](),controller[_0xe82b('0xb')]);router['post']('/',auth[_0xe82b('0x9')](),controller[_0xe82b('0xc')]);router[_0xe82b('0xd')](_0xe82b('0xe'),auth[_0xe82b('0x9')](),controller[_0xe82b('0xf')]);router['delete'](_0xe82b('0xe'),auth[_0xe82b('0x9')](),controller[_0xe82b('0x10')]);module[_0xe82b('0x11')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index ee33ca4..254b0dc 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 _0x2d34=['exports','string','variable','keyValue','picklist','STRING','ENUM','customVariable','BOOLEAN'];(function(_0xf0bc07,_0x510ebf){var _0x1c50c2=function(_0x2e2bdf){while(--_0x2e2bdf){_0xf0bc07['push'](_0xf0bc07['shift']());}};_0x1c50c2(++_0x510ebf);}(_0x2d34,0xe1));var _0x42d3=function(_0x1d9d3f,_0x31dd65){_0x1d9d3f=_0x1d9d3f-0x0;var _0x834938=_0x2d34[_0x1d9d3f];return _0x834938;};'use strict';var Sequelize=require('sequelize');module[_0x42d3('0x0')]={'type':{'type':Sequelize['ENUM'](_0x42d3('0x1'),_0x42d3('0x2'),'customVariable',_0x42d3('0x3'),_0x42d3('0x4')),'defaultValue':_0x42d3('0x1')},'content':{'type':Sequelize[_0x42d3('0x5')]},'key':{'type':Sequelize[_0x42d3('0x5')]},'keyType':{'type':Sequelize[_0x42d3('0x6')](_0x42d3('0x1'),_0x42d3('0x2'),_0x42d3('0x7'))},'keyContent':{'type':Sequelize[_0x42d3('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x42d3('0x5')]},'customField':{'type':Sequelize[_0x42d3('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xdb95=['variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x57a50d,_0x2871f8){var _0x1b25b3=function(_0x45691e){while(--_0x45691e){_0x57a50d['push'](_0x57a50d['shift']());}};_0x1b25b3(++_0x2871f8);}(_0xdb95,0x1b4));var _0x5db9=function(_0x542de4,_0x2a6669){_0x542de4=_0x542de4-0x0;var _0x41397f=_0xdb95[_0x542de4];return _0x41397f;};'use strict';var Sequelize=require(_0x5db9('0x0'));module[_0x5db9('0x1')]={'type':{'type':Sequelize[_0x5db9('0x2')](_0x5db9('0x3'),_0x5db9('0x4'),_0x5db9('0x5'),_0x5db9('0x6'),_0x5db9('0x7')),'defaultValue':_0x5db9('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x5db9('0x8')]},'keyType':{'type':Sequelize[_0x5db9('0x2')]('string',_0x5db9('0x4'),_0x5db9('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x5db9('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5db9('0x8')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 4403007..0037a92 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 _0xf995=['send','index','map','VtigerField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','include','find','create','update','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','save','then','destroy','error','stack','name'];(function(_0x522943,_0x126cbd){var _0x1b4c7e=function(_0x2e797d){while(--_0x2e797d){_0x522943['push'](_0x522943['shift']());}};_0x1b4c7e(++_0x126cbd);}(_0xf995,0x14f));var _0x5f99=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xf995[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require(_0x5f99('0x0'));var rimraf=require(_0x5f99('0x1'));var zipdir=require(_0x5f99('0x2'));var jsonpatch=require(_0x5f99('0x3'));var rp=require(_0x5f99('0x4'));var moment=require(_0x5f99('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5f99('0x6'));var util=require('util');var path=require('path');var sox=require(_0x5f99('0x7'));var csv=require('to-csv');var ejs=require(_0x5f99('0x8'));var fs=require('fs');var fs_extra=require(_0x5f99('0x9'));var _=require(_0x5f99('0xa'));var squel=require('squel');var crypto=require(_0x5f99('0xb'));var jsforce=require(_0x5f99('0xc'));var deskjs=require(_0x5f99('0xd'));var toCsv=require(_0x5f99('0xe'));var querystring=require(_0x5f99('0xf'));var Papa=require('papaparse');var Redis=require(_0x5f99('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5f99('0x11'));var as=require(_0x5f99('0x12'));var hardwareService=require(_0x5f99('0x13'));var logger=require(_0x5f99('0x14'))(_0x5f99('0x15'));var utils=require(_0x5f99('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5f99('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1fe22e,_0x522774){_0x522774=_0x522774||0xcc;return function(_0x37460c){if(_0x37460c){return _0x1fe22e[_0x5f99('0x18')](_0x522774);}return _0x1fe22e[_0x5f99('0x19')](_0x522774)[_0x5f99('0x1a')]();};}function respondWithResult(_0x40f09a,_0x10c49d){_0x10c49d=_0x10c49d||0xc8;return function(_0x53e83b){if(_0x53e83b){return _0x40f09a[_0x5f99('0x19')](_0x10c49d)[_0x5f99('0x1b')](_0x53e83b);}};}function respondWithFilteredResult(_0x35420c,_0x327d7a){return function(_0x41634b){if(_0x41634b){var _0x415084=typeof _0x327d7a['offset']===_0x5f99('0x1c')&&typeof _0x327d7a[_0x5f99('0x1d')]===_0x5f99('0x1c');var _0x49c829=_0x41634b[_0x5f99('0x1e')];var _0x536aeb=_0x415084?0x0:_0x327d7a[_0x5f99('0x1f')];var _0x220714=_0x415084?_0x41634b[_0x5f99('0x1e')]:_0x327d7a[_0x5f99('0x1f')]+_0x327d7a[_0x5f99('0x1d')];var _0x1b17de;if(_0x220714>=_0x49c829){_0x220714=_0x49c829;_0x1b17de=0xc8;}else{_0x1b17de=0xce;}_0x35420c[_0x5f99('0x19')](_0x1b17de);return _0x35420c['set'](_0x5f99('0x20'),_0x536aeb+'-'+_0x220714+'/'+_0x49c829)[_0x5f99('0x1b')](_0x41634b);}return null;};}function patchUpdates(_0x3d6e81){return function(_0x5b6902){try{jsonpatch[_0x5f99('0x21')](_0x5b6902,_0x3d6e81,!![]);}catch(_0x2e9909){return BPromise['reject'](_0x2e9909);}return _0x5b6902[_0x5f99('0x22')]();};}function saveUpdates(_0x59bfa4,_0x174597){return function(_0x209fce){if(_0x209fce){return _0x209fce['update'](_0x59bfa4)[_0x5f99('0x23')](function(_0x46040f){return _0x46040f;});}return null;};}function removeEntity(_0x52bdf6,_0x20a5d7){return function(_0x18fdcc){if(_0x18fdcc){return _0x18fdcc[_0x5f99('0x24')]()[_0x5f99('0x23')](function(){_0x52bdf6[_0x5f99('0x19')](0xcc)[_0x5f99('0x1a')]();});}};}function handleEntityNotFound(_0x6f42ac,_0x2b4ca7){return function(_0x552a7b){if(!_0x552a7b){_0x6f42ac[_0x5f99('0x18')](0x194);}return _0x552a7b;};}function handleError(_0x298f00,_0x29a84c){_0x29a84c=_0x29a84c||0x1f4;return function(_0x36edf1){logger[_0x5f99('0x25')](_0x36edf1[_0x5f99('0x26')]);if(_0x36edf1[_0x5f99('0x27')]){delete _0x36edf1['name'];}_0x298f00[_0x5f99('0x19')](_0x29a84c)[_0x5f99('0x28')](_0x36edf1);};}exports[_0x5f99('0x29')]=function(_0x50832b,_0x423027){var _0x45c6ae={},_0x18d9a9={},_0x475691={'count':0x0,'rows':[]};var _0x4738da=_[_0x5f99('0x2a')](db[_0x5f99('0x2b')][_0x5f99('0x2c')],function(_0x27fe55){return{'name':_0x27fe55[_0x5f99('0x2d')],'type':_0x27fe55[_0x5f99('0x2e')][_0x5f99('0x2f')]};});_0x18d9a9[_0x5f99('0x30')]=_[_0x5f99('0x2a')](_0x4738da,'name');_0x18d9a9[_0x5f99('0x31')]=_[_0x5f99('0x32')](_0x50832b[_0x5f99('0x31')]);_0x18d9a9[_0x5f99('0x33')]=_[_0x5f99('0x34')](_0x18d9a9['model'],_0x18d9a9[_0x5f99('0x31')]);_0x45c6ae[_0x5f99('0x35')]=_['intersection'](_0x18d9a9[_0x5f99('0x30')],qs[_0x5f99('0x36')](_0x50832b[_0x5f99('0x31')][_0x5f99('0x36')]));_0x45c6ae[_0x5f99('0x35')]=_0x45c6ae['attributes'][_0x5f99('0x37')]?_0x45c6ae['attributes']:_0x18d9a9[_0x5f99('0x30')];if(!_0x50832b[_0x5f99('0x31')][_0x5f99('0x38')]('nolimit')){_0x45c6ae[_0x5f99('0x1d')]=qs[_0x5f99('0x1d')](_0x50832b['query'][_0x5f99('0x1d')]);_0x45c6ae[_0x5f99('0x1f')]=qs[_0x5f99('0x1f')](_0x50832b[_0x5f99('0x31')][_0x5f99('0x1f')]);}_0x45c6ae[_0x5f99('0x39')]=qs[_0x5f99('0x3a')](_0x50832b[_0x5f99('0x31')][_0x5f99('0x3a')]);_0x45c6ae[_0x5f99('0x3b')]=qs[_0x5f99('0x33')](_[_0x5f99('0x3c')](_0x50832b[_0x5f99('0x31')],_0x18d9a9[_0x5f99('0x33')]),_0x4738da);if(_0x50832b[_0x5f99('0x31')][_0x5f99('0x3d')]){_0x45c6ae[_0x5f99('0x3b')]=_[_0x5f99('0x3e')](_0x45c6ae[_0x5f99('0x3b')],{'$or':_[_0x5f99('0x2a')](_0x4738da,function(_0x1b1a5c){if(_0x1b1a5c[_0x5f99('0x2e')]!==_0x5f99('0x3f')){var _0x47ae4f={};_0x47ae4f[_0x1b1a5c[_0x5f99('0x27')]]={'$like':'%'+_0x50832b[_0x5f99('0x31')][_0x5f99('0x3d')]+'%'};return _0x47ae4f;}})});}_0x45c6ae=_['merge']({},_0x45c6ae,_0x50832b[_0x5f99('0x40')]);var _0x4ec448={'where':_0x45c6ae[_0x5f99('0x3b')]};return db[_0x5f99('0x2b')]['count'](_0x4ec448)[_0x5f99('0x23')](function(_0x893428){_0x475691[_0x5f99('0x1e')]=_0x893428;if(_0x50832b[_0x5f99('0x31')][_0x5f99('0x41')]){_0x45c6ae['include']=[{'all':!![]}];}return db[_0x5f99('0x2b')][_0x5f99('0x42')](_0x45c6ae);})[_0x5f99('0x23')](function(_0x4a6009){_0x475691[_0x5f99('0x43')]=_0x4a6009;return _0x475691;})[_0x5f99('0x23')](respondWithFilteredResult(_0x423027,_0x45c6ae))[_0x5f99('0x44')](handleError(_0x423027,null));};exports['show']=function(_0x296c9a,_0x167f3f){var _0x1996cc={'raw':!![],'where':{'id':_0x296c9a['params']['id']}},_0x4ee367={};_0x4ee367[_0x5f99('0x30')]=_[_0x5f99('0x32')](db[_0x5f99('0x2b')]['rawAttributes']);_0x4ee367[_0x5f99('0x31')]=_[_0x5f99('0x32')](_0x296c9a[_0x5f99('0x31')]);_0x4ee367[_0x5f99('0x33')]=_[_0x5f99('0x34')](_0x4ee367[_0x5f99('0x30')],_0x4ee367[_0x5f99('0x31')]);_0x1996cc['attributes']=_[_0x5f99('0x34')](_0x4ee367[_0x5f99('0x30')],qs[_0x5f99('0x36')](_0x296c9a[_0x5f99('0x31')][_0x5f99('0x36')]));_0x1996cc['attributes']=_0x1996cc[_0x5f99('0x35')][_0x5f99('0x37')]?_0x1996cc['attributes']:_0x4ee367[_0x5f99('0x30')];if(_0x296c9a[_0x5f99('0x31')][_0x5f99('0x41')]){_0x1996cc[_0x5f99('0x45')]=[{'all':!![]}];}_0x1996cc=_[_0x5f99('0x3e')]({},_0x1996cc,_0x296c9a['options']);return db[_0x5f99('0x2b')][_0x5f99('0x46')](_0x1996cc)[_0x5f99('0x23')](handleEntityNotFound(_0x167f3f,null))[_0x5f99('0x23')](respondWithResult(_0x167f3f,null))[_0x5f99('0x44')](handleError(_0x167f3f,null));};exports[_0x5f99('0x47')]=function(_0x37be2a,_0x1af590){return db['VtigerField'][_0x5f99('0x47')](_0x37be2a['body'],{})[_0x5f99('0x23')](respondWithResult(_0x1af590,0xc9))[_0x5f99('0x44')](handleError(_0x1af590,null));};exports[_0x5f99('0x48')]=function(_0x20615f,_0x2384f5){if(_0x20615f['body']['id']){delete _0x20615f[_0x5f99('0x49')]['id'];}return db['VtigerField'][_0x5f99('0x46')]({'where':{'id':_0x20615f['params']['id']}})['then'](handleEntityNotFound(_0x2384f5,null))[_0x5f99('0x23')](saveUpdates(_0x20615f[_0x5f99('0x49')],null))[_0x5f99('0x23')](respondWithResult(_0x2384f5,null))[_0x5f99('0x44')](handleError(_0x2384f5,null));};exports[_0x5f99('0x24')]=function(_0x33c705,_0x253d31){return db[_0x5f99('0x2b')][_0x5f99('0x46')]({'where':{'id':_0x33c705[_0x5f99('0x4a')]['id']}})[_0x5f99('0x23')](handleEntityNotFound(_0x253d31,null))[_0x5f99('0x23')](removeEntity(_0x253d31,null))['catch'](handleError(_0x253d31,null));}; \ No newline at end of file +var _0x5e8a=['request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','VtigerField','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x362a7b,_0x3ccd6a){var _0x272ac2=function(_0x4643d2){while(--_0x4643d2){_0x362a7b['push'](_0x362a7b['shift']());}};_0x272ac2(++_0x3ccd6a);}(_0x5e8a,0x134));var _0xa5e8=function(_0x5270a1,_0x47ece1){_0x5270a1=_0x5270a1-0x0;var _0x9c4694=_0x5e8a[_0x5270a1];return _0x9c4694;};'use strict';var emlformat=require(_0xa5e8('0x0'));var rimraf=require(_0xa5e8('0x1'));var zipdir=require(_0xa5e8('0x2'));var jsonpatch=require(_0xa5e8('0x3'));var rp=require(_0xa5e8('0x4'));var moment=require(_0xa5e8('0x5'));var BPromise=require(_0xa5e8('0x6'));var Mustache=require(_0xa5e8('0x7'));var util=require('util');var path=require(_0xa5e8('0x8'));var sox=require(_0xa5e8('0x9'));var csv=require(_0xa5e8('0xa'));var ejs=require(_0xa5e8('0xb'));var fs=require('fs');var fs_extra=require(_0xa5e8('0xc'));var _=require(_0xa5e8('0xd'));var squel=require(_0xa5e8('0xe'));var crypto=require(_0xa5e8('0xf'));var jsforce=require(_0xa5e8('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xa5e8('0xa'));var querystring=require(_0xa5e8('0x11'));var Papa=require('papaparse');var Redis=require(_0xa5e8('0x12'));var authService=require(_0xa5e8('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa5e8('0x14'));var hardwareService=require(_0xa5e8('0x15'));var logger=require(_0xa5e8('0x16'))(_0xa5e8('0x17'));var utils=require(_0xa5e8('0x18'));var config=require(_0xa5e8('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa5e8('0x1a'))['db'];function respondWithStatusCode(_0x2c9893,_0x1ba9aa){_0x1ba9aa=_0x1ba9aa||0xcc;return function(_0x2bec87){if(_0x2bec87){return _0x2c9893[_0xa5e8('0x1b')](_0x1ba9aa);}return _0x2c9893['status'](_0x1ba9aa)['end']();};}function respondWithResult(_0x33ca89,_0x3be4b2){_0x3be4b2=_0x3be4b2||0xc8;return function(_0x56d14a){if(_0x56d14a){return _0x33ca89[_0xa5e8('0x1c')](_0x3be4b2)[_0xa5e8('0x1d')](_0x56d14a);}};}function respondWithFilteredResult(_0x124b0e,_0x32274d){return function(_0x173949){if(_0x173949){var _0x12b3c2=typeof _0x32274d[_0xa5e8('0x1e')]==='undefined'&&typeof _0x32274d[_0xa5e8('0x1f')]===_0xa5e8('0x20');var _0x3476d9=_0x173949[_0xa5e8('0x21')];var _0x19cc9f=_0x12b3c2?0x0:_0x32274d[_0xa5e8('0x1e')];var _0x534965=_0x12b3c2?_0x173949['count']:_0x32274d[_0xa5e8('0x1e')]+_0x32274d['limit'];var _0x571902;if(_0x534965>=_0x3476d9){_0x534965=_0x3476d9;_0x571902=0xc8;}else{_0x571902=0xce;}_0x124b0e[_0xa5e8('0x1c')](_0x571902);return _0x124b0e['set'](_0xa5e8('0x22'),_0x19cc9f+'-'+_0x534965+'/'+_0x3476d9)['json'](_0x173949);}return null;};}function patchUpdates(_0x50f0cc){return function(_0x284534){try{jsonpatch[_0xa5e8('0x23')](_0x284534,_0x50f0cc,!![]);}catch(_0x154899){return BPromise[_0xa5e8('0x24')](_0x154899);}return _0x284534[_0xa5e8('0x25')]();};}function saveUpdates(_0x2b3b5c,_0x1ae320){return function(_0x566261){if(_0x566261){return _0x566261[_0xa5e8('0x26')](_0x2b3b5c)[_0xa5e8('0x27')](function(_0x513458){return _0x513458;});}return null;};}function removeEntity(_0x13ecf5,_0x21d20a){return function(_0x3d8aca){if(_0x3d8aca){return _0x3d8aca[_0xa5e8('0x28')]()[_0xa5e8('0x27')](function(){_0x13ecf5[_0xa5e8('0x1c')](0xcc)[_0xa5e8('0x29')]();});}};}function handleEntityNotFound(_0x2a06fb,_0x4db4f8){return function(_0x2d2771){if(!_0x2d2771){_0x2a06fb[_0xa5e8('0x1b')](0x194);}return _0x2d2771;};}function handleError(_0x504aa0,_0x277292){_0x277292=_0x277292||0x1f4;return function(_0x1c06f0){logger[_0xa5e8('0x2a')](_0x1c06f0[_0xa5e8('0x2b')]);if(_0x1c06f0[_0xa5e8('0x2c')]){delete _0x1c06f0[_0xa5e8('0x2c')];}_0x504aa0[_0xa5e8('0x1c')](_0x277292)[_0xa5e8('0x2d')](_0x1c06f0);};}exports[_0xa5e8('0x2e')]=function(_0x217848,_0x546629){var _0x6c6290={},_0x226a82={},_0x2d78ec={'count':0x0,'rows':[]};var _0x5b1688=_[_0xa5e8('0x2f')](db[_0xa5e8('0x30')][_0xa5e8('0x31')],function(_0x565ba4){return{'name':_0x565ba4[_0xa5e8('0x32')],'type':_0x565ba4[_0xa5e8('0x33')][_0xa5e8('0x34')]};});_0x226a82[_0xa5e8('0x35')]=_['map'](_0x5b1688,_0xa5e8('0x2c'));_0x226a82[_0xa5e8('0x36')]=_[_0xa5e8('0x37')](_0x217848[_0xa5e8('0x36')]);_0x226a82['filters']=_[_0xa5e8('0x38')](_0x226a82[_0xa5e8('0x35')],_0x226a82[_0xa5e8('0x36')]);_0x6c6290[_0xa5e8('0x39')]=_[_0xa5e8('0x38')](_0x226a82[_0xa5e8('0x35')],qs[_0xa5e8('0x3a')](_0x217848[_0xa5e8('0x36')]['fields']));_0x6c6290['attributes']=_0x6c6290[_0xa5e8('0x39')][_0xa5e8('0x3b')]?_0x6c6290[_0xa5e8('0x39')]:_0x226a82['model'];if(!_0x217848['query'][_0xa5e8('0x3c')]('nolimit')){_0x6c6290['limit']=qs[_0xa5e8('0x1f')](_0x217848[_0xa5e8('0x36')][_0xa5e8('0x1f')]);_0x6c6290[_0xa5e8('0x1e')]=qs[_0xa5e8('0x1e')](_0x217848[_0xa5e8('0x36')][_0xa5e8('0x1e')]);}_0x6c6290[_0xa5e8('0x3d')]=qs[_0xa5e8('0x3e')](_0x217848[_0xa5e8('0x36')][_0xa5e8('0x3e')]);_0x6c6290[_0xa5e8('0x3f')]=qs[_0xa5e8('0x40')](_[_0xa5e8('0x41')](_0x217848[_0xa5e8('0x36')],_0x226a82[_0xa5e8('0x40')]),_0x5b1688);if(_0x217848[_0xa5e8('0x36')][_0xa5e8('0x42')]){_0x6c6290[_0xa5e8('0x3f')]=_[_0xa5e8('0x43')](_0x6c6290[_0xa5e8('0x3f')],{'$or':_[_0xa5e8('0x2f')](_0x5b1688,function(_0x5a6f29){if(_0x5a6f29['type']!==_0xa5e8('0x44')){var _0x1e980d={};_0x1e980d[_0x5a6f29[_0xa5e8('0x2c')]]={'$like':'%'+_0x217848[_0xa5e8('0x36')][_0xa5e8('0x42')]+'%'};return _0x1e980d;}})});}_0x6c6290=_[_0xa5e8('0x43')]({},_0x6c6290,_0x217848[_0xa5e8('0x45')]);var _0x5a660e={'where':_0x6c6290[_0xa5e8('0x3f')]};return db['VtigerField']['count'](_0x5a660e)[_0xa5e8('0x27')](function(_0x2ddf1a){_0x2d78ec[_0xa5e8('0x21')]=_0x2ddf1a;if(_0x217848[_0xa5e8('0x36')][_0xa5e8('0x46')]){_0x6c6290[_0xa5e8('0x47')]=[{'all':!![]}];}return db[_0xa5e8('0x30')][_0xa5e8('0x48')](_0x6c6290);})[_0xa5e8('0x27')](function(_0x564d29){_0x2d78ec['rows']=_0x564d29;return _0x2d78ec;})[_0xa5e8('0x27')](respondWithFilteredResult(_0x546629,_0x6c6290))[_0xa5e8('0x49')](handleError(_0x546629,null));};exports['show']=function(_0x198610,_0x566fc6){var _0x3b7927={'raw':!![],'where':{'id':_0x198610[_0xa5e8('0x4a')]['id']}},_0x17a11d={};_0x17a11d[_0xa5e8('0x35')]=_[_0xa5e8('0x37')](db[_0xa5e8('0x30')][_0xa5e8('0x31')]);_0x17a11d['query']=_[_0xa5e8('0x37')](_0x198610[_0xa5e8('0x36')]);_0x17a11d[_0xa5e8('0x40')]=_['intersection'](_0x17a11d[_0xa5e8('0x35')],_0x17a11d[_0xa5e8('0x36')]);_0x3b7927[_0xa5e8('0x39')]=_[_0xa5e8('0x38')](_0x17a11d[_0xa5e8('0x35')],qs['fields'](_0x198610['query'][_0xa5e8('0x3a')]));_0x3b7927['attributes']=_0x3b7927['attributes']['length']?_0x3b7927[_0xa5e8('0x39')]:_0x17a11d[_0xa5e8('0x35')];if(_0x198610['query'][_0xa5e8('0x46')]){_0x3b7927[_0xa5e8('0x47')]=[{'all':!![]}];}_0x3b7927=_[_0xa5e8('0x43')]({},_0x3b7927,_0x198610['options']);return db[_0xa5e8('0x30')][_0xa5e8('0x4b')](_0x3b7927)[_0xa5e8('0x27')](handleEntityNotFound(_0x566fc6,null))['then'](respondWithResult(_0x566fc6,null))[_0xa5e8('0x49')](handleError(_0x566fc6,null));};exports[_0xa5e8('0x4c')]=function(_0x4a2345,_0x1c7a44){return db['VtigerField'][_0xa5e8('0x4c')](_0x4a2345[_0xa5e8('0x4d')],{})[_0xa5e8('0x27')](respondWithResult(_0x1c7a44,0xc9))[_0xa5e8('0x49')](handleError(_0x1c7a44,null));};exports[_0xa5e8('0x26')]=function(_0x445bc9,_0x4bdf31){if(_0x445bc9[_0xa5e8('0x4d')]['id']){delete _0x445bc9[_0xa5e8('0x4d')]['id'];}return db[_0xa5e8('0x30')]['find']({'where':{'id':_0x445bc9[_0xa5e8('0x4a')]['id']}})[_0xa5e8('0x27')](handleEntityNotFound(_0x4bdf31,null))[_0xa5e8('0x27')](saveUpdates(_0x445bc9[_0xa5e8('0x4d')],null))[_0xa5e8('0x27')](respondWithResult(_0x4bdf31,null))['catch'](handleError(_0x4bdf31,null));};exports['destroy']=function(_0x5d31a0,_0x272696){return db[_0xa5e8('0x30')]['find']({'where':{'id':_0x5d31a0[_0xa5e8('0x4a')]['id']}})[_0xa5e8('0x27')](handleEntityNotFound(_0x272696,null))[_0xa5e8('0x27')](removeEntity(_0x272696,null))[_0xa5e8('0x49')](handleError(_0x272696,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index cac4aa8..d2cca38 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 _0xf313=['VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./intVtigerField.attributes','exports'];(function(_0x4edc12,_0x244c5f){var _0x3564a7=function(_0x161218){while(--_0x161218){_0x4edc12['push'](_0x4edc12['shift']());}};_0x3564a7(++_0x244c5f);}(_0xf313,0x113));var _0x3f31=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xf313[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x3f31('0x0'));var util=require(_0x3f31('0x1'));var logger=require(_0x3f31('0x2'))('api');var moment=require(_0x3f31('0x3'));var BPromise=require(_0x3f31('0x4'));var rp=require(_0x3f31('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3f31('0x6'));var config=require(_0x3f31('0x7'));var attributes=require(_0x3f31('0x8'));module[_0x3f31('0x9')]=function(_0x243b59,_0x328dcf){return _0x243b59['define'](_0x3f31('0xa'),attributes,{'tableName':_0x3f31('0xb'),'paranoid':![],'indexes':[{'name':_0x3f31('0xc'),'fields':[_0x3f31('0xd'),_0x3f31('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1151=['path','rimraf','../../config/environment','./intVtigerField.attributes','exports','define','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2b1cd3,_0x2a3f47){var _0x1cb019=function(_0x30e479){while(--_0x30e479){_0x2b1cd3['push'](_0x2b1cd3['shift']());}};_0x1cb019(++_0x2a3f47);}(_0x1151,0x1ea));var _0x1115=function(_0x3a8dc1,_0x2f03b8){_0x3a8dc1=_0x3a8dc1-0x0;var _0x4b3595=_0x1151[_0x3a8dc1];return _0x4b3595;};'use strict';var _=require(_0x1115('0x0'));var util=require('util');var logger=require(_0x1115('0x1'))(_0x1115('0x2'));var moment=require(_0x1115('0x3'));var BPromise=require(_0x1115('0x4'));var rp=require(_0x1115('0x5'));var fs=require('fs');var path=require(_0x1115('0x6'));var rimraf=require(_0x1115('0x7'));var config=require(_0x1115('0x8'));var attributes=require(_0x1115('0x9'));module[_0x1115('0xa')]=function(_0x11c714,_0x58b8c7){return _0x11c714[_0x1115('0xb')]('VtigerField',attributes,{'tableName':_0x1115('0xc'),'paranoid':![],'indexes':[{'name':_0x1115('0xd'),'fields':[_0x1115('0xe'),_0x1115('0xf')],'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 608a005..833487f 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 _0x2e49=['error','code','message','result','catch','lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x18aaaf,_0x385db6){var _0x52d892=function(_0x1ac6da){while(--_0x1ac6da){_0x18aaaf['push'](_0x18aaaf['shift']());}};_0x52d892(++_0x385db6);}(_0x2e49,0xc2));var _0x92e4=function(_0x5c0eb0,_0x3ba21a){_0x5c0eb0=_0x5c0eb0-0x0;var _0x5693f9=_0x2e49[_0x5c0eb0];return _0x5693f9;};'use strict';var _=require(_0x92e4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x92e4('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x92e4('0x2'))['db'];var utils=require(_0x92e4('0x3'));var logger=require(_0x92e4('0x4'))(_0x92e4('0x5'));var config=require(_0x92e4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x92e4('0x7')][_0x92e4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x21d7a3,_0x3f991f,_0x4db0ca){return new BPromise(function(_0x209025,_0x151970){return client[_0x92e4('0x9')](_0x21d7a3,_0x4db0ca)['then'](function(_0x41969e){logger[_0x92e4('0xa')](_0x92e4('0xb'),_0x3f991f,_0x92e4('0xc'));logger[_0x92e4('0xd')](_0x92e4('0xe'),_0x3f991f,_0x92e4('0xc'),JSON[_0x92e4('0xf')](_0x41969e));if(_0x41969e[_0x92e4('0x10')]){if(_0x41969e[_0x92e4('0x10')][_0x92e4('0x11')]===0x1f4){logger[_0x92e4('0x10')](_0x92e4('0xb'),_0x3f991f,_0x41969e[_0x92e4('0x10')][_0x92e4('0x12')]);return _0x151970(_0x41969e[_0x92e4('0x10')]['message']);}logger[_0x92e4('0x10')](_0x92e4('0xb'),_0x3f991f,_0x41969e[_0x92e4('0x10')][_0x92e4('0x12')]);return _0x209025(_0x41969e[_0x92e4('0x10')][_0x92e4('0x12')]);}else{logger[_0x92e4('0xa')](_0x92e4('0xb'),_0x3f991f,_0x92e4('0xc'));_0x209025(_0x41969e[_0x92e4('0x13')]['message']);}})[_0x92e4('0x14')](function(_0x3c828a){logger[_0x92e4('0x10')](_0x92e4('0xb'),_0x3f991f,_0x3c828a);_0x151970(_0x3c828a);});});} \ No newline at end of file +var _0xb759=['debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','code','error','message','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','http','request','info','VtigerField,\x20%s,\x20%s','request\x20sent'];(function(_0x37682b,_0x25cba2){var _0x34173c=function(_0x5584a9){while(--_0x5584a9){_0x37682b['push'](_0x37682b['shift']());}};_0x34173c(++_0x25cba2);}(_0xb759,0x19e));var _0x9b75=function(_0x4b2c46,_0x301d59){_0x4b2c46=_0x4b2c46-0x0;var _0x439f6f=_0xb759[_0x4b2c46];return _0x439f6f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9b75('0x0'));var BPromise=require(_0x9b75('0x1'));var rs=require(_0x9b75('0x2'));var fs=require('fs');var Redis=require(_0x9b75('0x3'));var db=require(_0x9b75('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x9b75('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9b75('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5a97b4,_0x3c21c6,_0x3bde33){return new BPromise(function(_0x2ac3ce,_0x35eb3d){return client[_0x9b75('0x7')](_0x5a97b4,_0x3bde33)['then'](function(_0x4ee461){logger[_0x9b75('0x8')](_0x9b75('0x9'),_0x3c21c6,_0x9b75('0xa'));logger[_0x9b75('0xb')](_0x9b75('0xc'),_0x3c21c6,_0x9b75('0xa'),JSON[_0x9b75('0xd')](_0x4ee461));if(_0x4ee461['error']){if(_0x4ee461['error'][_0x9b75('0xe')]===0x1f4){logger[_0x9b75('0xf')](_0x9b75('0x9'),_0x3c21c6,_0x4ee461[_0x9b75('0xf')][_0x9b75('0x10')]);return _0x35eb3d(_0x4ee461[_0x9b75('0xf')][_0x9b75('0x10')]);}logger[_0x9b75('0xf')](_0x9b75('0x9'),_0x3c21c6,_0x4ee461['error']['message']);return _0x2ac3ce(_0x4ee461[_0x9b75('0xf')][_0x9b75('0x10')]);}else{logger['info'](_0x9b75('0x9'),_0x3c21c6,_0x9b75('0xa'));_0x2ac3ce(_0x4ee461['result']['message']);}})['catch'](function(_0x2446b0){logger[_0x9b75('0xf')]('VtigerField,\x20%s,\x20%s',_0x3c21c6,_0x2446b0);_0x35eb3d(_0x2446b0);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 7513437..16dd77d 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 _0x9341=['get','/:id','show','/:id/configurations','getConfigurations','post','create','addConfiguration','put','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index'];(function(_0x3cd07e,_0x135124){var _0x14d0c2=function(_0x152565){while(--_0x152565){_0x3cd07e['push'](_0x3cd07e['shift']());}};_0x14d0c2(++_0x135124);}(_0x9341,0xc8));var _0x1934=function(_0x52f608,_0x3462d7){_0x52f608=_0x52f608-0x0;var _0x4887e1=_0x9341[_0x52f608];return _0x4887e1;};'use strict';var multer=require(_0x1934('0x0'));var util=require(_0x1934('0x1'));var path=require(_0x1934('0x2'));var timeout=require(_0x1934('0x3'));var express=require('express');var router=express[_0x1934('0x4')]();var fs_extra=require(_0x1934('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1934('0x6'));var config=require(_0x1934('0x7'));var controller=require('./intZendeskAccount.controller');router['get']('/',auth[_0x1934('0x8')](),controller[_0x1934('0x9')]);router[_0x1934('0xa')](_0x1934('0xb'),auth[_0x1934('0x8')](),controller[_0x1934('0xc')]);router[_0x1934('0xa')](_0x1934('0xd'),auth[_0x1934('0x8')](),controller[_0x1934('0xe')]);router[_0x1934('0xa')]('/:id/fields',auth[_0x1934('0x8')](),controller['getFields']);router[_0x1934('0xf')]('/',auth[_0x1934('0x8')](),controller[_0x1934('0x10')]);router[_0x1934('0xf')]('/:id/configurations',auth[_0x1934('0x8')](),controller[_0x1934('0x11')]);router[_0x1934('0x12')](_0x1934('0xb'),auth[_0x1934('0x8')](),controller['update']);router[_0x1934('0x13')](_0x1934('0xb'),auth[_0x1934('0x8')](),controller[_0x1934('0x14')]);module['exports']=router; \ No newline at end of file +var _0x7ef3=['path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','post','addConfiguration','put','update','destroy','exports','multer','util'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0x7ef3,0x106));var _0x37ef=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x7ef3[_0x46e363];return _0x3fb059;};'use strict';var multer=require(_0x37ef('0x0'));var util=require(_0x37ef('0x1'));var path=require(_0x37ef('0x2'));var timeout=require(_0x37ef('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x37ef('0x4'));var interaction=require(_0x37ef('0x5'));var config=require(_0x37ef('0x6'));var controller=require(_0x37ef('0x7'));router[_0x37ef('0x8')]('/',auth[_0x37ef('0x9')](),controller[_0x37ef('0xa')]);router[_0x37ef('0x8')](_0x37ef('0xb'),auth['isAuthenticated'](),controller[_0x37ef('0xc')]);router[_0x37ef('0x8')](_0x37ef('0xd'),auth[_0x37ef('0x9')](),controller['getConfigurations']);router[_0x37ef('0x8')](_0x37ef('0xe'),auth['isAuthenticated'](),controller[_0x37ef('0xf')]);router[_0x37ef('0x10')]('/',auth[_0x37ef('0x9')](),controller['create']);router['post']('/:id/configurations',auth[_0x37ef('0x9')](),controller[_0x37ef('0x11')]);router[_0x37ef('0x12')]('/:id',auth[_0x37ef('0x9')](),controller[_0x37ef('0x13')]);router['delete'](_0x37ef('0xb'),auth[_0x37ef('0x9')](),controller[_0x37ef('0x14')]);module[_0x37ef('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index c2f265a..16bf259 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 _0x4e83=['token','ENUM','integrationTab','sequelize','STRING','username','password'];(function(_0x1c9186,_0x5eb7c3){var _0x1ee00a=function(_0x555afd){while(--_0x555afd){_0x1c9186['push'](_0x1c9186['shift']());}};_0x1ee00a(++_0x5eb7c3);}(_0x4e83,0x1ae));var _0x34e8=function(_0x3359b0,_0x13700a){_0x3359b0=_0x3359b0-0x0;var _0x2e823b=_0x4e83[_0x3359b0];return _0x2e823b;};'use strict';var Sequelize=require(_0x34e8('0x0'));module['exports']={'name':{'type':Sequelize[_0x34e8('0x1')]},'description':{'type':Sequelize[_0x34e8('0x1')]},'username':{'type':Sequelize[_0x34e8('0x1')],'unique':_0x34e8('0x2')},'password':{'type':Sequelize[_0x34e8('0x1')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'authType':{'type':Sequelize['ENUM'](_0x34e8('0x3'),_0x34e8('0x4')),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0x34e8('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x34e8('0x5')](_0x34e8('0x6'),'newTab'),'defaultValue':_0x34e8('0x6')}}; \ No newline at end of file +var _0xfd2e=['password','integrationTab','sequelize','STRING','remoteUri','ENUM'];(function(_0x2a5d7a,_0x47b143){var _0x231c09=function(_0x48a2a6){while(--_0x48a2a6){_0x2a5d7a['push'](_0x2a5d7a['shift']());}};_0x231c09(++_0x47b143);}(_0xfd2e,0x6e));var _0xefd2=function(_0x5ddb5a,_0x31972c){_0x5ddb5a=_0x5ddb5a-0x0;var _0x5dc45e=_0xfd2e[_0x5ddb5a];return _0x5dc45e;};'use strict';var Sequelize=require(_0xefd2('0x0'));module['exports']={'name':{'type':Sequelize[_0xefd2('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xefd2('0x1')],'unique':'username'},'password':{'type':Sequelize[_0xefd2('0x1')]},'token':{'type':Sequelize[_0xefd2('0x1')]},'remoteUri':{'type':Sequelize[_0xefd2('0x1')],'unique':_0xefd2('0x2')},'authType':{'type':Sequelize[_0xefd2('0x3')]('password','token'),'defaultValue':_0xefd2('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xefd2('0x5'),'newTab'),'defaultValue':_0xefd2('0x5')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 930e79b..1bf71eb 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 _0xe1e3=['assignee','remove','includes','position','title','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','end','json','undefined','count','offset','status','set','apply','save','then','destroy','name','send','ZendeskAccount','type','map','query','keys','attributes','intersection','model','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','VIRTUAL','includeAll','findAll','rows','catch','show','params','rawAttributes','merge','find','create','body','update','ZendeskConfiguration','length','getConfigurations','AccountId','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','Subjects','getFields','findOne','password','token','authType','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','Basic\x20%s','%s:%s','username','base64','headers','%s/token:%s','ValidationError','Unknown\x20authentication\x20type','subject','group'];(function(_0x1e6160,_0x337798){var _0x37bfcc=function(_0x218ca3){while(--_0x218ca3){_0x1e6160['push'](_0x1e6160['shift']());}};_0x37bfcc(++_0x337798);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x30d37e,_0x1c497b){_0x30d37e=_0x30d37e-0x0;var _0x52de74=_0xe1e3[_0x30d37e];return _0x52de74;};'use strict';var emlformat=require(_0x3e1e('0x0'));var rimraf=require(_0x3e1e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3e1e('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3e1e('0x3'));var Mustache=require('mustache');var util=require(_0x3e1e('0x4'));var path=require(_0x3e1e('0x5'));var sox=require(_0x3e1e('0x6'));var csv=require(_0x3e1e('0x7'));var ejs=require(_0x3e1e('0x8'));var fs=require('fs');var fs_extra=require(_0x3e1e('0x9'));var _=require('lodash');var squel=require(_0x3e1e('0xa'));var crypto=require(_0x3e1e('0xb'));var jsforce=require(_0x3e1e('0xc'));var deskjs=require(_0x3e1e('0xd'));var toCsv=require(_0x3e1e('0x7'));var querystring=require(_0x3e1e('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3e1e('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3e1e('0x10'));var logger=require(_0x3e1e('0x11'))(_0x3e1e('0x12'));var utils=require('../../config/utils');var config=require(_0x3e1e('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x536129,_0x5c09a2){_0x5c09a2=_0x5c09a2||0xcc;return function(_0x14ad58){if(_0x14ad58){return _0x536129['sendStatus'](_0x5c09a2);}return _0x536129['status'](_0x5c09a2)[_0x3e1e('0x14')]();};}function respondWithResult(_0x8bd4cd,_0x78ee54){_0x78ee54=_0x78ee54||0xc8;return function(_0x50f221){if(_0x50f221){return _0x8bd4cd['status'](_0x78ee54)[_0x3e1e('0x15')](_0x50f221);}};}function respondWithFilteredResult(_0x1b62e6,_0x4dca60){return function(_0x26cb35){if(_0x26cb35){var _0x1f0af9=typeof _0x4dca60['offset']===_0x3e1e('0x16')&&typeof _0x4dca60['limit']===_0x3e1e('0x16');var _0x247daa=_0x26cb35[_0x3e1e('0x17')];var _0x39eaa7=_0x1f0af9?0x0:_0x4dca60[_0x3e1e('0x18')];var _0x1c181b=_0x1f0af9?_0x26cb35['count']:_0x4dca60['offset']+_0x4dca60['limit'];var _0x428e4e;if(_0x1c181b>=_0x247daa){_0x1c181b=_0x247daa;_0x428e4e=0xc8;}else{_0x428e4e=0xce;}_0x1b62e6[_0x3e1e('0x19')](_0x428e4e);return _0x1b62e6[_0x3e1e('0x1a')]('Content-Range',_0x39eaa7+'-'+_0x1c181b+'/'+_0x247daa)[_0x3e1e('0x15')](_0x26cb35);}return null;};}function patchUpdates(_0x530815){return function(_0x228991){try{jsonpatch[_0x3e1e('0x1b')](_0x228991,_0x530815,!![]);}catch(_0x474085){return BPromise['reject'](_0x474085);}return _0x228991[_0x3e1e('0x1c')]();};}function saveUpdates(_0x96396,_0xefa098){return function(_0x55dc62){if(_0x55dc62){return _0x55dc62['update'](_0x96396)[_0x3e1e('0x1d')](function(_0x1b5097){return _0x1b5097;});}return null;};}function removeEntity(_0x488f9f,_0x60e6bc){return function(_0x56ae51){if(_0x56ae51){return _0x56ae51[_0x3e1e('0x1e')]()[_0x3e1e('0x1d')](function(){_0x488f9f[_0x3e1e('0x19')](0xcc)[_0x3e1e('0x14')]();});}};}function handleEntityNotFound(_0x43d583,_0x21c898){return function(_0x4ee2b5){if(!_0x4ee2b5){_0x43d583['sendStatus'](0x194);}return _0x4ee2b5;};}function handleError(_0x44e419,_0x541ef1){_0x541ef1=_0x541ef1||0x1f4;return function(_0x55db8f){logger['error'](_0x55db8f['stack']);if(_0x55db8f[_0x3e1e('0x1f')]){delete _0x55db8f[_0x3e1e('0x1f')];}_0x44e419['status'](_0x541ef1)[_0x3e1e('0x20')](_0x55db8f);};}exports['index']=function(_0xdfcd93,_0x176bb4){var _0x53a6ff={},_0x43e029={},_0x210a84={'count':0x0,'rows':[]};var _0x45ed0e=_['map'](db[_0x3e1e('0x21')]['rawAttributes'],function(_0x591c36){return{'name':_0x591c36['fieldName'],'type':_0x591c36[_0x3e1e('0x22')]['key']};});_0x43e029['model']=_[_0x3e1e('0x23')](_0x45ed0e,_0x3e1e('0x1f'));_0x43e029[_0x3e1e('0x24')]=_[_0x3e1e('0x25')](_0xdfcd93[_0x3e1e('0x24')]);_0x43e029['filters']=_['intersection'](_0x43e029['model'],_0x43e029['query']);_0x53a6ff[_0x3e1e('0x26')]=_[_0x3e1e('0x27')](_0x43e029[_0x3e1e('0x28')],qs[_0x3e1e('0x29')](_0xdfcd93[_0x3e1e('0x24')][_0x3e1e('0x29')]));_0x53a6ff[_0x3e1e('0x26')]=_0x53a6ff[_0x3e1e('0x26')]['length']?_0x53a6ff[_0x3e1e('0x26')]:_0x43e029[_0x3e1e('0x28')];if(!_0xdfcd93['query'][_0x3e1e('0x2a')](_0x3e1e('0x2b'))){_0x53a6ff[_0x3e1e('0x2c')]=qs[_0x3e1e('0x2c')](_0xdfcd93['query']['limit']);_0x53a6ff[_0x3e1e('0x18')]=qs[_0x3e1e('0x18')](_0xdfcd93['query'][_0x3e1e('0x18')]);}_0x53a6ff[_0x3e1e('0x2d')]=qs['sort'](_0xdfcd93[_0x3e1e('0x24')][_0x3e1e('0x2e')]);_0x53a6ff[_0x3e1e('0x2f')]=qs[_0x3e1e('0x30')](_[_0x3e1e('0x31')](_0xdfcd93['query'],_0x43e029[_0x3e1e('0x30')]),_0x45ed0e);if(_0xdfcd93[_0x3e1e('0x24')][_0x3e1e('0x32')]){_0x53a6ff[_0x3e1e('0x2f')]=_['merge'](_0x53a6ff[_0x3e1e('0x2f')],{'$or':_[_0x3e1e('0x23')](_0x45ed0e,function(_0x111da4){if(_0x111da4[_0x3e1e('0x22')]!==_0x3e1e('0x33')){var _0x25a95b={};_0x25a95b[_0x111da4[_0x3e1e('0x1f')]]={'$like':'%'+_0xdfcd93['query'][_0x3e1e('0x32')]+'%'};return _0x25a95b;}})});}_0x53a6ff=_['merge']({},_0x53a6ff,_0xdfcd93['options']);var _0x4f598e={'where':_0x53a6ff[_0x3e1e('0x2f')]};return db[_0x3e1e('0x21')]['count'](_0x4f598e)[_0x3e1e('0x1d')](function(_0xb030eb){_0x210a84['count']=_0xb030eb;if(_0xdfcd93[_0x3e1e('0x24')][_0x3e1e('0x34')]){_0x53a6ff['include']=[{'all':!![]}];}return db['ZendeskAccount'][_0x3e1e('0x35')](_0x53a6ff);})['then'](function(_0x4ff868){_0x210a84[_0x3e1e('0x36')]=_0x4ff868;return _0x210a84;})[_0x3e1e('0x1d')](respondWithFilteredResult(_0x176bb4,_0x53a6ff))[_0x3e1e('0x37')](handleError(_0x176bb4,null));};exports[_0x3e1e('0x38')]=function(_0x377a06,_0x55ea1d){var _0x5b32ad={'raw':![],'where':{'id':_0x377a06[_0x3e1e('0x39')]['id']}},_0x24b2ad={};_0x24b2ad[_0x3e1e('0x28')]=_['keys'](db[_0x3e1e('0x21')][_0x3e1e('0x3a')]);_0x24b2ad[_0x3e1e('0x24')]=_['keys'](_0x377a06[_0x3e1e('0x24')]);_0x24b2ad['filters']=_['intersection'](_0x24b2ad[_0x3e1e('0x28')],_0x24b2ad[_0x3e1e('0x24')]);_0x5b32ad[_0x3e1e('0x26')]=_[_0x3e1e('0x27')](_0x24b2ad['model'],qs['fields'](_0x377a06['query']['fields']));_0x5b32ad[_0x3e1e('0x26')]=_0x5b32ad[_0x3e1e('0x26')]['length']?_0x5b32ad['attributes']:_0x24b2ad[_0x3e1e('0x28')];if(_0x377a06[_0x3e1e('0x24')][_0x3e1e('0x34')]){_0x5b32ad['include']=[{'all':!![]}];}_0x5b32ad=_[_0x3e1e('0x3b')]({},_0x5b32ad,_0x377a06['options']);return db[_0x3e1e('0x21')][_0x3e1e('0x3c')](_0x5b32ad)[_0x3e1e('0x1d')](handleEntityNotFound(_0x55ea1d,null))[_0x3e1e('0x1d')](respondWithResult(_0x55ea1d,null))[_0x3e1e('0x37')](handleError(_0x55ea1d,null));};exports[_0x3e1e('0x3d')]=function(_0x53d32b,_0x2f14b3){return db[_0x3e1e('0x21')]['create'](_0x53d32b[_0x3e1e('0x3e')],{})[_0x3e1e('0x1d')](respondWithResult(_0x2f14b3,0xc9))['catch'](handleError(_0x2f14b3,null));};exports[_0x3e1e('0x3f')]=function(_0x347b3f,_0x2e286f){if(_0x347b3f[_0x3e1e('0x3e')]['id']){delete _0x347b3f['body']['id'];}return db[_0x3e1e('0x21')][_0x3e1e('0x3c')]({'where':{'id':_0x347b3f[_0x3e1e('0x39')]['id']}})[_0x3e1e('0x1d')](handleEntityNotFound(_0x2e286f,null))['then'](saveUpdates(_0x347b3f[_0x3e1e('0x3e')],null))[_0x3e1e('0x1d')](respondWithResult(_0x2e286f,null))[_0x3e1e('0x37')](handleError(_0x2e286f,null));};exports[_0x3e1e('0x1e')]=function(_0xe2516c,_0x1df5a8){return db[_0x3e1e('0x21')][_0x3e1e('0x3c')]({'where':{'id':_0xe2516c['params']['id']}})[_0x3e1e('0x1d')](handleEntityNotFound(_0x1df5a8,null))['then'](removeEntity(_0x1df5a8,null))['catch'](handleError(_0x1df5a8,null));};exports['getConfigurations']=function(_0x1c4269,_0x17641c,_0x5147a2){var _0x13b076={};var _0x592733={};var _0x5b2416;var _0x3eaf76;return db['ZendeskAccount']['findOne']({'where':{'id':_0x1c4269['params']['id']}})[_0x3e1e('0x1d')](handleEntityNotFound(_0x17641c,null))[_0x3e1e('0x1d')](function(_0x1334c8){if(_0x1334c8){_0x5b2416=_0x1334c8;_0x592733[_0x3e1e('0x28')]=_[_0x3e1e('0x25')](db[_0x3e1e('0x40')][_0x3e1e('0x3a')]);_0x592733['query']=_[_0x3e1e('0x25')](_0x1c4269['query']);_0x592733[_0x3e1e('0x30')]=_[_0x3e1e('0x27')](_0x592733[_0x3e1e('0x28')],_0x592733['query']);_0x13b076['attributes']=_[_0x3e1e('0x27')](_0x592733[_0x3e1e('0x28')],qs['fields'](_0x1c4269[_0x3e1e('0x24')]['fields']));_0x13b076['attributes']=_0x13b076[_0x3e1e('0x26')][_0x3e1e('0x41')]?_0x13b076['attributes']:_0x592733[_0x3e1e('0x28')];_0x13b076['order']=qs['sort'](_0x1c4269[_0x3e1e('0x24')]['sort']);_0x13b076[_0x3e1e('0x2f')]=qs['filters'](_[_0x3e1e('0x31')](_0x1c4269['query'],_0x592733[_0x3e1e('0x30')]));if(_0x1c4269[_0x3e1e('0x24')]['filter']){_0x13b076['where']=_['merge'](_0x13b076[_0x3e1e('0x2f')],{'$or':_[_0x3e1e('0x23')](_0x13b076[_0x3e1e('0x26')],function(_0x588189){var _0x1b04ce={};_0x1b04ce[_0x588189]={'$like':'%'+_0x1c4269[_0x3e1e('0x24')][_0x3e1e('0x32')]+'%'};return _0x1b04ce;})});}_0x13b076=_['merge']({},_0x13b076,_0x1c4269['options']);return _0x5b2416[_0x3e1e('0x42')](_0x13b076);}})['then'](function(_0x3b97a2){if(_0x3b97a2){_0x3eaf76=_0x3b97a2[_0x3e1e('0x41')];if(!_0x1c4269[_0x3e1e('0x24')]['hasOwnProperty'](_0x3e1e('0x2b'))){_0x13b076['limit']=qs[_0x3e1e('0x2c')](_0x1c4269[_0x3e1e('0x24')]['limit']);_0x13b076[_0x3e1e('0x18')]=qs['offset'](_0x1c4269[_0x3e1e('0x24')]['offset']);}return _0x5b2416[_0x3e1e('0x42')](_0x13b076);}})['then'](function(_0x31062e){if(_0x31062e){return _0x31062e?{'count':_0x3eaf76,'rows':_0x31062e}:null;}})[_0x3e1e('0x1d')](respondWithResult(_0x17641c,null))[_0x3e1e('0x37')](handleError(_0x17641c,null));};exports['addConfiguration']=function(_0x11cab1,_0x1fbcfc,_0x4e6957){if(_0x11cab1[_0x3e1e('0x3e')]['id']){delete _0x11cab1['body']['id'];}return db['ZendeskAccount']['findOne']({'where':{'id':_0x11cab1[_0x3e1e('0x39')]['id']}})[_0x3e1e('0x1d')](handleEntityNotFound(_0x1fbcfc,null))[_0x3e1e('0x1d')](function(_0x4b0944){if(_0x4b0944){_0x11cab1[_0x3e1e('0x3e')][_0x3e1e('0x43')]=_0x4b0944['id'];_0x11cab1[_0x3e1e('0x3e')]['Subjects']=integrations[_0x3e1e('0x44')](_0x11cab1[_0x3e1e('0x3e')][_0x3e1e('0x45')],_0x11cab1[_0x3e1e('0x3e')][_0x3e1e('0x22')]);_0x11cab1[_0x3e1e('0x3e')][_0x3e1e('0x46')]=integrations[_0x3e1e('0x47')](_0x11cab1['body']['channel'],_0x11cab1[_0x3e1e('0x3e')][_0x3e1e('0x22')]);return db[_0x3e1e('0x40')][_0x3e1e('0x3d')](_0x11cab1[_0x3e1e('0x3e')],{'include':[{'model':db[_0x3e1e('0x48')],'as':_0x3e1e('0x49')},{'model':db[_0x3e1e('0x48')],'as':_0x3e1e('0x46')}]});}return null;})[_0x3e1e('0x1d')](respondWithResult(_0x1fbcfc,null))[_0x3e1e('0x37')](handleError(_0x1fbcfc,null));};exports[_0x3e1e('0x4a')]=function(_0x5e148e,_0x5581ee,_0x20bc4d){var _0x29ddc4='';return db[_0x3e1e('0x21')][_0x3e1e('0x4b')]({'where':{'id':_0x5e148e[_0x3e1e('0x39')]['id']},'attributes':['id','username',_0x3e1e('0x4c'),_0x3e1e('0x4d'),_0x3e1e('0x4e'),_0x3e1e('0x4f')]})[_0x3e1e('0x1d')](handleEntityNotFound(_0x5581ee,null))['then'](function(_0x8b6b28){if(_0x8b6b28){_0x29ddc4=_0x8b6b28[_0x3e1e('0x4f')];var _0xc60340=_0x29ddc4[_0x3e1e('0x50')](-0x1);if(_0xc60340==='/'){_0x29ddc4=_0x29ddc4[_0x3e1e('0x51')](0x0,_0x29ddc4[_0x3e1e('0x52')](_0xc60340));}var _0x4d0854={'method':_0x3e1e('0x53'),'uri':util[_0x3e1e('0x54')](_0x3e1e('0x55'),_0x29ddc4,_0x3e1e('0x56')),'json':!![]};switch(_0x8b6b28[_0x3e1e('0x4e')]){case _0x3e1e('0x4c'):_0x4d0854['headers']={'Authorization':util[_0x3e1e('0x54')](_0x3e1e('0x57'),new Buffer(util[_0x3e1e('0x54')](_0x3e1e('0x58'),_0x8b6b28[_0x3e1e('0x59')],_0x8b6b28[_0x3e1e('0x4c')]))['toString'](_0x3e1e('0x5a')))};break;case'token':_0x4d0854[_0x3e1e('0x5b')]={'Authorization':util[_0x3e1e('0x54')]('Basic\x20%s',new Buffer(util[_0x3e1e('0x54')](_0x3e1e('0x5c'),_0x8b6b28[_0x3e1e('0x59')],_0x8b6b28[_0x3e1e('0x4d')]))['toString'](_0x3e1e('0x5a')))};break;default:throw new db['Sequelize'][(_0x3e1e('0x5d'))](_0x3e1e('0x5e'));}return rp(_0x4d0854);}})[_0x3e1e('0x1d')](function(_0x632f99){if(_0x632f99){var _0x2ef476=[_0x3e1e('0x5f'),'description',_0x3e1e('0x60'),_0x3e1e('0x61')];_[_0x3e1e('0x62')](_0x632f99[_0x3e1e('0x56')],function(_0x4b4fd4){return _0x2ef476[_0x3e1e('0x63')](_0x4b4fd4[_0x3e1e('0x22')]);});return{'count':_0x632f99[_0x3e1e('0x56')][_0x3e1e('0x41')],'rows':_['map'](_0x632f99[_0x3e1e('0x56')],function(_0x41d98f){return{'id':_0x41d98f['id'],'name':_0x41d98f[_0x3e1e('0x64')]>0x7?_0x41d98f[_0x3e1e('0x65')]:_0x41d98f[_0x3e1e('0x22')],'custom':_0x41d98f[_0x3e1e('0x64')]>0x7?!![]:![],'options':_0x41d98f['system_field_options']?_0x41d98f['system_field_options']:_0x41d98f['custom_field_options']?_0x41d98f[_0x3e1e('0x66')]:[]};})};}})['then'](respondWithResult(_0x5581ee,null))[_0x3e1e('0x37')](function(_0x5f436f){var _0x32b5ef=_0x5e148e[_0x3e1e('0x24')][_0x3e1e('0x67')]?0x1f4:_0x5f436f[_0x3e1e('0x68')]||0x1f4;logger['error'](_0x3e1e('0x69'),'getFields',_0x32b5ef,JSON[_0x3e1e('0x6a')](_0x5f436f));delete _0x5f436f['name'];if(_0x32b5ef===0x191){_0x32b5ef=0x190;}_0x5581ee[_0x3e1e('0x19')](_0x32b5ef)[_0x3e1e('0x20')](_0x5e148e['query'][_0x3e1e('0x67')]?{'message':_0x3e1e('0x6b'),'statusCode':_0x5f436f[_0x3e1e('0x68')]}:_0x5f436f);});}; \ No newline at end of file +var _0xab40=['../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','reject','save','then','destroy','error','name','rawAttributes','fieldName','type','key','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','map','VIRTUAL','merge','options','ZendeskAccount','include','findAll','rows','catch','show','params','includeAll','find','create','body','update','findOne','ZendeskConfiguration','order','getConfigurations','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','username','token','authType','remoteUri','slice','lastIndexOf','format','%s/%s','ticket_fields','password','headers','Basic\x20%s','toString','base64','Sequelize','ValidationError','Unknown\x20authentication\x20type','description','assignee','remove','includes','position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','rimraf','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util'];(function(_0x5eb874,_0x3d849f){var _0x5bbbd0=function(_0x54c86a){while(--_0x54c86a){_0x5eb874['push'](_0x5eb874['shift']());}};_0x5bbbd0(++_0x3d849f);}(_0xab40,0xcd));var _0x0ab4=function(_0x199482,_0x21c2b4){_0x199482=_0x199482-0x0;var _0x2d9637=_0xab40[_0x199482];return _0x2d9637;};'use strict';var emlformat=require(_0x0ab4('0x0'));var rimraf=require(_0x0ab4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0ab4('0x2'));var BPromise=require(_0x0ab4('0x3'));var Mustache=require(_0x0ab4('0x4'));var util=require(_0x0ab4('0x5'));var path=require(_0x0ab4('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0ab4('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0ab4('0x8'));var squel=require(_0x0ab4('0x9'));var crypto=require(_0x0ab4('0xa'));var jsforce=require(_0x0ab4('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0ab4('0xc'));var Redis=require(_0x0ab4('0xd'));var authService=require(_0x0ab4('0xe'));var qs=require(_0x0ab4('0xf'));var as=require(_0x0ab4('0x10'));var hardwareService=require(_0x0ab4('0x11'));var logger=require(_0x0ab4('0x12'))(_0x0ab4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0ab4('0x14'));var db=require('../../mysqldb')['db'];var integrations=require(_0x0ab4('0x15'));function respondWithStatusCode(_0x45e6fd,_0x1e7555){_0x1e7555=_0x1e7555||0xcc;return function(_0x1e2b56){if(_0x1e2b56){return _0x45e6fd[_0x0ab4('0x16')](_0x1e7555);}return _0x45e6fd[_0x0ab4('0x17')](_0x1e7555)[_0x0ab4('0x18')]();};}function respondWithResult(_0x2cc644,_0x3cb1df){_0x3cb1df=_0x3cb1df||0xc8;return function(_0x2033c8){if(_0x2033c8){return _0x2cc644[_0x0ab4('0x17')](_0x3cb1df)[_0x0ab4('0x19')](_0x2033c8);}};}function respondWithFilteredResult(_0x293e20,_0x45fad1){return function(_0x2a83a8){if(_0x2a83a8){var _0x2403db=typeof _0x45fad1[_0x0ab4('0x1a')]===_0x0ab4('0x1b')&&typeof _0x45fad1['limit']==='undefined';var _0x49634f=_0x2a83a8[_0x0ab4('0x1c')];var _0x30d5df=_0x2403db?0x0:_0x45fad1[_0x0ab4('0x1a')];var _0x53723c=_0x2403db?_0x2a83a8[_0x0ab4('0x1c')]:_0x45fad1[_0x0ab4('0x1a')]+_0x45fad1[_0x0ab4('0x1d')];var _0x31ee29;if(_0x53723c>=_0x49634f){_0x53723c=_0x49634f;_0x31ee29=0xc8;}else{_0x31ee29=0xce;}_0x293e20['status'](_0x31ee29);return _0x293e20['set'](_0x0ab4('0x1e'),_0x30d5df+'-'+_0x53723c+'/'+_0x49634f)['json'](_0x2a83a8);}return null;};}function patchUpdates(_0x2b0e29){return function(_0x30abff){try{jsonpatch['apply'](_0x30abff,_0x2b0e29,!![]);}catch(_0xacd68e){return BPromise[_0x0ab4('0x1f')](_0xacd68e);}return _0x30abff[_0x0ab4('0x20')]();};}function saveUpdates(_0x1d5c14,_0x12d06d){return function(_0x52d7d3){if(_0x52d7d3){return _0x52d7d3['update'](_0x1d5c14)[_0x0ab4('0x21')](function(_0x14087f){return _0x14087f;});}return null;};}function removeEntity(_0x392afe,_0x13c882){return function(_0x4e4b80){if(_0x4e4b80){return _0x4e4b80[_0x0ab4('0x22')]()[_0x0ab4('0x21')](function(){_0x392afe[_0x0ab4('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c5caf,_0x176ff1){return function(_0x1c132c){if(!_0x1c132c){_0x4c5caf[_0x0ab4('0x16')](0x194);}return _0x1c132c;};}function handleError(_0x4ae515,_0x519b23){_0x519b23=_0x519b23||0x1f4;return function(_0x49c72d){logger[_0x0ab4('0x23')](_0x49c72d['stack']);if(_0x49c72d[_0x0ab4('0x24')]){delete _0x49c72d[_0x0ab4('0x24')];}_0x4ae515['status'](_0x519b23)['send'](_0x49c72d);};}exports['index']=function(_0x3d38a4,_0x183bac){var _0x1cfdad={},_0x3f61cb={},_0x25385e={'count':0x0,'rows':[]};var _0x588e0d=_['map'](db['ZendeskAccount'][_0x0ab4('0x25')],function(_0x2b66d5){return{'name':_0x2b66d5[_0x0ab4('0x26')],'type':_0x2b66d5[_0x0ab4('0x27')][_0x0ab4('0x28')]};});_0x3f61cb['model']=_['map'](_0x588e0d,_0x0ab4('0x24'));_0x3f61cb[_0x0ab4('0x29')]=_[_0x0ab4('0x2a')](_0x3d38a4['query']);_0x3f61cb['filters']=_[_0x0ab4('0x2b')](_0x3f61cb['model'],_0x3f61cb[_0x0ab4('0x29')]);_0x1cfdad[_0x0ab4('0x2c')]=_[_0x0ab4('0x2b')](_0x3f61cb[_0x0ab4('0x2d')],qs[_0x0ab4('0x2e')](_0x3d38a4[_0x0ab4('0x29')]['fields']));_0x1cfdad[_0x0ab4('0x2c')]=_0x1cfdad[_0x0ab4('0x2c')][_0x0ab4('0x2f')]?_0x1cfdad[_0x0ab4('0x2c')]:_0x3f61cb['model'];if(!_0x3d38a4['query'][_0x0ab4('0x30')](_0x0ab4('0x31'))){_0x1cfdad[_0x0ab4('0x1d')]=qs['limit'](_0x3d38a4['query']['limit']);_0x1cfdad[_0x0ab4('0x1a')]=qs[_0x0ab4('0x1a')](_0x3d38a4[_0x0ab4('0x29')]['offset']);}_0x1cfdad['order']=qs['sort'](_0x3d38a4[_0x0ab4('0x29')][_0x0ab4('0x32')]);_0x1cfdad[_0x0ab4('0x33')]=qs[_0x0ab4('0x34')](_[_0x0ab4('0x35')](_0x3d38a4[_0x0ab4('0x29')],_0x3f61cb[_0x0ab4('0x34')]),_0x588e0d);if(_0x3d38a4[_0x0ab4('0x29')][_0x0ab4('0x36')]){_0x1cfdad[_0x0ab4('0x33')]=_['merge'](_0x1cfdad[_0x0ab4('0x33')],{'$or':_[_0x0ab4('0x37')](_0x588e0d,function(_0xb6bc6a){if(_0xb6bc6a[_0x0ab4('0x27')]!==_0x0ab4('0x38')){var _0x34c74f={};_0x34c74f[_0xb6bc6a[_0x0ab4('0x24')]]={'$like':'%'+_0x3d38a4[_0x0ab4('0x29')][_0x0ab4('0x36')]+'%'};return _0x34c74f;}})});}_0x1cfdad=_[_0x0ab4('0x39')]({},_0x1cfdad,_0x3d38a4[_0x0ab4('0x3a')]);var _0x1974ce={'where':_0x1cfdad['where']};return db[_0x0ab4('0x3b')][_0x0ab4('0x1c')](_0x1974ce)[_0x0ab4('0x21')](function(_0x3acb8d){_0x25385e['count']=_0x3acb8d;if(_0x3d38a4[_0x0ab4('0x29')]['includeAll']){_0x1cfdad[_0x0ab4('0x3c')]=[{'all':!![]}];}return db[_0x0ab4('0x3b')][_0x0ab4('0x3d')](_0x1cfdad);})[_0x0ab4('0x21')](function(_0xd2293){_0x25385e[_0x0ab4('0x3e')]=_0xd2293;return _0x25385e;})['then'](respondWithFilteredResult(_0x183bac,_0x1cfdad))[_0x0ab4('0x3f')](handleError(_0x183bac,null));};exports[_0x0ab4('0x40')]=function(_0xe3df73,_0x48029f){var _0x395e0b={'raw':![],'where':{'id':_0xe3df73[_0x0ab4('0x41')]['id']}},_0xeac8ad={};_0xeac8ad[_0x0ab4('0x2d')]=_[_0x0ab4('0x2a')](db['ZendeskAccount']['rawAttributes']);_0xeac8ad['query']=_[_0x0ab4('0x2a')](_0xe3df73[_0x0ab4('0x29')]);_0xeac8ad['filters']=_[_0x0ab4('0x2b')](_0xeac8ad['model'],_0xeac8ad[_0x0ab4('0x29')]);_0x395e0b['attributes']=_[_0x0ab4('0x2b')](_0xeac8ad[_0x0ab4('0x2d')],qs[_0x0ab4('0x2e')](_0xe3df73[_0x0ab4('0x29')][_0x0ab4('0x2e')]));_0x395e0b[_0x0ab4('0x2c')]=_0x395e0b['attributes'][_0x0ab4('0x2f')]?_0x395e0b[_0x0ab4('0x2c')]:_0xeac8ad[_0x0ab4('0x2d')];if(_0xe3df73[_0x0ab4('0x29')][_0x0ab4('0x42')]){_0x395e0b[_0x0ab4('0x3c')]=[{'all':!![]}];}_0x395e0b=_['merge']({},_0x395e0b,_0xe3df73[_0x0ab4('0x3a')]);return db['ZendeskAccount'][_0x0ab4('0x43')](_0x395e0b)[_0x0ab4('0x21')](handleEntityNotFound(_0x48029f,null))[_0x0ab4('0x21')](respondWithResult(_0x48029f,null))['catch'](handleError(_0x48029f,null));};exports[_0x0ab4('0x44')]=function(_0x1fcc3b,_0x1ce096){return db[_0x0ab4('0x3b')][_0x0ab4('0x44')](_0x1fcc3b[_0x0ab4('0x45')],{})['then'](respondWithResult(_0x1ce096,0xc9))[_0x0ab4('0x3f')](handleError(_0x1ce096,null));};exports[_0x0ab4('0x46')]=function(_0x302894,_0x2801ff){if(_0x302894[_0x0ab4('0x45')]['id']){delete _0x302894[_0x0ab4('0x45')]['id'];}return db[_0x0ab4('0x3b')][_0x0ab4('0x43')]({'where':{'id':_0x302894[_0x0ab4('0x41')]['id']}})[_0x0ab4('0x21')](handleEntityNotFound(_0x2801ff,null))[_0x0ab4('0x21')](saveUpdates(_0x302894[_0x0ab4('0x45')],null))[_0x0ab4('0x21')](respondWithResult(_0x2801ff,null))['catch'](handleError(_0x2801ff,null));};exports[_0x0ab4('0x22')]=function(_0x354bc,_0x5800cc){return db[_0x0ab4('0x3b')]['find']({'where':{'id':_0x354bc['params']['id']}})[_0x0ab4('0x21')](handleEntityNotFound(_0x5800cc,null))[_0x0ab4('0x21')](removeEntity(_0x5800cc,null))[_0x0ab4('0x3f')](handleError(_0x5800cc,null));};exports['getConfigurations']=function(_0x12a2df,_0xb3bd1e,_0xeddaa1){var _0xaed2d={};var _0x30ba95={};var _0x3f20de;var _0x1eea3b;return db['ZendeskAccount'][_0x0ab4('0x47')]({'where':{'id':_0x12a2df['params']['id']}})[_0x0ab4('0x21')](handleEntityNotFound(_0xb3bd1e,null))['then'](function(_0x2597f2){if(_0x2597f2){_0x3f20de=_0x2597f2;_0x30ba95['model']=_['keys'](db[_0x0ab4('0x48')][_0x0ab4('0x25')]);_0x30ba95[_0x0ab4('0x29')]=_[_0x0ab4('0x2a')](_0x12a2df['query']);_0x30ba95[_0x0ab4('0x34')]=_[_0x0ab4('0x2b')](_0x30ba95[_0x0ab4('0x2d')],_0x30ba95[_0x0ab4('0x29')]);_0xaed2d[_0x0ab4('0x2c')]=_[_0x0ab4('0x2b')](_0x30ba95[_0x0ab4('0x2d')],qs[_0x0ab4('0x2e')](_0x12a2df[_0x0ab4('0x29')][_0x0ab4('0x2e')]));_0xaed2d[_0x0ab4('0x2c')]=_0xaed2d[_0x0ab4('0x2c')][_0x0ab4('0x2f')]?_0xaed2d[_0x0ab4('0x2c')]:_0x30ba95[_0x0ab4('0x2d')];_0xaed2d[_0x0ab4('0x49')]=qs[_0x0ab4('0x32')](_0x12a2df[_0x0ab4('0x29')][_0x0ab4('0x32')]);_0xaed2d['where']=qs[_0x0ab4('0x34')](_[_0x0ab4('0x35')](_0x12a2df[_0x0ab4('0x29')],_0x30ba95[_0x0ab4('0x34')]));if(_0x12a2df[_0x0ab4('0x29')][_0x0ab4('0x36')]){_0xaed2d[_0x0ab4('0x33')]=_[_0x0ab4('0x39')](_0xaed2d['where'],{'$or':_[_0x0ab4('0x37')](_0xaed2d[_0x0ab4('0x2c')],function(_0x54ea92){var _0x48191f={};_0x48191f[_0x54ea92]={'$like':'%'+_0x12a2df[_0x0ab4('0x29')][_0x0ab4('0x36')]+'%'};return _0x48191f;})});}_0xaed2d=_['merge']({},_0xaed2d,_0x12a2df['options']);return _0x3f20de[_0x0ab4('0x4a')](_0xaed2d);}})['then'](function(_0x597d26){if(_0x597d26){_0x1eea3b=_0x597d26[_0x0ab4('0x2f')];if(!_0x12a2df[_0x0ab4('0x29')][_0x0ab4('0x30')](_0x0ab4('0x31'))){_0xaed2d[_0x0ab4('0x1d')]=qs[_0x0ab4('0x1d')](_0x12a2df[_0x0ab4('0x29')]['limit']);_0xaed2d[_0x0ab4('0x1a')]=qs[_0x0ab4('0x1a')](_0x12a2df[_0x0ab4('0x29')][_0x0ab4('0x1a')]);}return _0x3f20de[_0x0ab4('0x4a')](_0xaed2d);}})[_0x0ab4('0x21')](function(_0x4f1847){if(_0x4f1847){return _0x4f1847?{'count':_0x1eea3b,'rows':_0x4f1847}:null;}})[_0x0ab4('0x21')](respondWithResult(_0xb3bd1e,null))[_0x0ab4('0x3f')](handleError(_0xb3bd1e,null));};exports['addConfiguration']=function(_0x66364c,_0x5b41af,_0x410198){if(_0x66364c['body']['id']){delete _0x66364c[_0x0ab4('0x45')]['id'];}return db[_0x0ab4('0x3b')][_0x0ab4('0x47')]({'where':{'id':_0x66364c[_0x0ab4('0x41')]['id']}})['then'](handleEntityNotFound(_0x5b41af,null))['then'](function(_0x10dd5b){if(_0x10dd5b){_0x66364c[_0x0ab4('0x45')]['AccountId']=_0x10dd5b['id'];_0x66364c[_0x0ab4('0x45')][_0x0ab4('0x4b')]=integrations[_0x0ab4('0x4c')](_0x66364c['body'][_0x0ab4('0x4d')],_0x66364c[_0x0ab4('0x45')][_0x0ab4('0x27')]);_0x66364c[_0x0ab4('0x45')][_0x0ab4('0x4e')]=integrations[_0x0ab4('0x4f')](_0x66364c[_0x0ab4('0x45')][_0x0ab4('0x4d')],_0x66364c['body']['type']);return db[_0x0ab4('0x48')][_0x0ab4('0x44')](_0x66364c[_0x0ab4('0x45')],{'include':[{'model':db[_0x0ab4('0x50')],'as':'Subjects'},{'model':db[_0x0ab4('0x50')],'as':'Descriptions'}]});}return null;})[_0x0ab4('0x21')](respondWithResult(_0x5b41af,null))[_0x0ab4('0x3f')](handleError(_0x5b41af,null));};exports[_0x0ab4('0x51')]=function(_0x3e5f11,_0x340129,_0x41b65f){var _0x46a008='';return db[_0x0ab4('0x3b')][_0x0ab4('0x47')]({'where':{'id':_0x3e5f11['params']['id']},'attributes':['id',_0x0ab4('0x52'),'password',_0x0ab4('0x53'),_0x0ab4('0x54'),_0x0ab4('0x55')]})[_0x0ab4('0x21')](handleEntityNotFound(_0x340129,null))[_0x0ab4('0x21')](function(_0x32282c){if(_0x32282c){_0x46a008=_0x32282c[_0x0ab4('0x55')];var _0xa3a87c=_0x46a008[_0x0ab4('0x56')](-0x1);if(_0xa3a87c==='/'){_0x46a008=_0x46a008['substring'](0x0,_0x46a008[_0x0ab4('0x57')](_0xa3a87c));}var _0x9b1a87={'method':'GET','uri':util[_0x0ab4('0x58')](_0x0ab4('0x59'),_0x46a008,_0x0ab4('0x5a')),'json':!![]};switch(_0x32282c['authType']){case _0x0ab4('0x5b'):_0x9b1a87[_0x0ab4('0x5c')]={'Authorization':util[_0x0ab4('0x58')](_0x0ab4('0x5d'),new Buffer(util['format']('%s:%s',_0x32282c[_0x0ab4('0x52')],_0x32282c[_0x0ab4('0x5b')]))[_0x0ab4('0x5e')](_0x0ab4('0x5f')))};break;case'token':_0x9b1a87[_0x0ab4('0x5c')]={'Authorization':util[_0x0ab4('0x58')](_0x0ab4('0x5d'),new Buffer(util['format']('%s/token:%s',_0x32282c[_0x0ab4('0x52')],_0x32282c[_0x0ab4('0x53')]))[_0x0ab4('0x5e')](_0x0ab4('0x5f')))};break;default:throw new db[(_0x0ab4('0x60'))][(_0x0ab4('0x61'))](_0x0ab4('0x62'));}return rp(_0x9b1a87);}})['then'](function(_0xe18f04){if(_0xe18f04){var _0x57ed73=['subject',_0x0ab4('0x63'),'group',_0x0ab4('0x64')];_[_0x0ab4('0x65')](_0xe18f04[_0x0ab4('0x5a')],function(_0x368573){return _0x57ed73[_0x0ab4('0x66')](_0x368573['type']);});return{'count':_0xe18f04['ticket_fields'][_0x0ab4('0x2f')],'rows':_[_0x0ab4('0x37')](_0xe18f04['ticket_fields'],function(_0x550cc5){return{'id':_0x550cc5['id'],'name':_0x550cc5[_0x0ab4('0x67')]>0x7?_0x550cc5[_0x0ab4('0x68')]:_0x550cc5['type'],'custom':_0x550cc5[_0x0ab4('0x67')]>0x7?!![]:![],'options':_0x550cc5[_0x0ab4('0x69')]?_0x550cc5[_0x0ab4('0x69')]:_0x550cc5['custom_field_options']?_0x550cc5[_0x0ab4('0x6a')]:[]};})};}})[_0x0ab4('0x21')](respondWithResult(_0x340129,null))[_0x0ab4('0x3f')](function(_0x1be1b9){var _0x4f745e=_0x3e5f11[_0x0ab4('0x29')][_0x0ab4('0x6b')]?0x1f4:_0x1be1b9[_0x0ab4('0x6c')]||0x1f4;logger[_0x0ab4('0x23')](_0x0ab4('0x6d'),_0x0ab4('0x51'),_0x4f745e,JSON[_0x0ab4('0x6e')](_0x1be1b9));delete _0x1be1b9[_0x0ab4('0x24')];if(_0x4f745e===0x191){_0x4f745e=0x190;}_0x340129[_0x0ab4('0x17')](_0x4f745e)[_0x0ab4('0x6f')](_0x3e5f11['query'][_0x0ab4('0x6b')]?{'message':_0x0ab4('0x70'),'statusCode':_0x1be1b9[_0x0ab4('0x6c')]}:_0x1be1b9);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 5152f73..5d5ad98 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 _0x7fe0=['define','ZendeskAccount','int_zendesk_accounts','lodash','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x78a8f4,_0x259809){var _0x2b3291=function(_0x5e64ca){while(--_0x5e64ca){_0x78a8f4['push'](_0x78a8f4['shift']());}};_0x2b3291(++_0x259809);}(_0x7fe0,0x1b3));var _0x07fe=function(_0x4d1059,_0x2e3b93){_0x4d1059=_0x4d1059-0x0;var _0x21928d=_0x7fe0[_0x4d1059];return _0x21928d;};'use strict';var _=require(_0x07fe('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x07fe('0x1'));var rp=require(_0x07fe('0x2'));var fs=require('fs');var path=require(_0x07fe('0x3'));var rimraf=require(_0x07fe('0x4'));var config=require(_0x07fe('0x5'));var attributes=require('./intZendeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x239c2d,_0xd6d1eb){return _0x239c2d[_0x07fe('0x6')](_0x07fe('0x7'),attributes,{'tableName':_0x07fe('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3add=['../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0xcecf6d,_0x17a2cb){var _0x333654=function(_0x5b9a68){while(--_0x5b9a68){_0xcecf6d['push'](_0xcecf6d['shift']());}};_0x333654(++_0x17a2cb);}(_0x3add,0x186));var _0xd3ad=function(_0x213518,_0x51e022){_0x213518=_0x213518-0x0;var _0x1baf75=_0x3add[_0x213518];return _0x1baf75;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd3ad('0x0'))('api');var moment=require(_0xd3ad('0x1'));var BPromise=require(_0xd3ad('0x2'));var rp=require(_0xd3ad('0x3'));var fs=require('fs');var path=require(_0xd3ad('0x4'));var rimraf=require(_0xd3ad('0x5'));var config=require(_0xd3ad('0x6'));var attributes=require(_0xd3ad('0x7'));var integrations=require(_0xd3ad('0x8'));module[_0xd3ad('0x9')]=function(_0x1b96b1,_0x51749d){return _0x1b96b1[_0xd3ad('0xa')](_0xd3ad('0xb'),attributes,{'tableName':'int_zendesk_accounts','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 b284a92..1962bd5 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 _0xe436=['stringify','error','code','message','GetZendeskAccount','ZendeskAccount','options','raw','where','include','map','model','attributes','catch','ShowZendeskAccount','lodash','util','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s'];(function(_0x4c0739,_0x307f90){var _0x453eee=function(_0x57256a){while(--_0x57256a){_0x4c0739['push'](_0x4c0739['shift']());}};_0x453eee(++_0x307f90);}(_0xe436,0x1ef));var _0x6e43=function(_0x34f1c9,_0x55ec89){_0x34f1c9=_0x34f1c9-0x0;var _0x3aa3e1=_0xe436[_0x34f1c9];return _0x3aa3e1;};'use strict';var _=require(_0x6e43('0x0'));var util=require(_0x6e43('0x1'));var moment=require('moment');var BPromise=require(_0x6e43('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6e43('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6e43('0x4'))(_0x6e43('0x5'));var config=require(_0x6e43('0x6'));var jayson=require(_0x6e43('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x35d8ab,_0x15c374,_0x2a7213){return new BPromise(function(_0x2c38c9,_0x4b2181){return client[_0x6e43('0x8')](_0x35d8ab,_0x2a7213)[_0x6e43('0x9')](function(_0x124f53){logger[_0x6e43('0xa')](_0x6e43('0xb'),_0x15c374,_0x6e43('0xc'));logger[_0x6e43('0xd')](_0x6e43('0xe'),_0x15c374,_0x6e43('0xc'),JSON[_0x6e43('0xf')](_0x124f53));if(_0x124f53[_0x6e43('0x10')]){if(_0x124f53['error'][_0x6e43('0x11')]===0x1f4){logger[_0x6e43('0x10')](_0x6e43('0xb'),_0x15c374,_0x124f53[_0x6e43('0x10')][_0x6e43('0x12')]);return _0x4b2181(_0x124f53[_0x6e43('0x10')][_0x6e43('0x12')]);}logger[_0x6e43('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0x15c374,_0x124f53[_0x6e43('0x10')]['message']);return _0x2c38c9(_0x124f53[_0x6e43('0x10')][_0x6e43('0x12')]);}else{logger[_0x6e43('0xa')](_0x6e43('0xb'),_0x15c374,_0x6e43('0xc'));_0x2c38c9(_0x124f53['result'][_0x6e43('0x12')]);}})['catch'](function(_0x5110ad){logger[_0x6e43('0x10')](_0x6e43('0xb'),_0x15c374,_0x5110ad);_0x4b2181(_0x5110ad);});});}exports[_0x6e43('0x13')]=function(_0x4f4096){var _0x1e3fbe=this;return new Promise(function(_0x2cb346,_0x63f645){return db[_0x6e43('0x14')]['findAll']({'raw':_0x4f4096[_0x6e43('0x15')]?_0x4f4096[_0x6e43('0x15')][_0x6e43('0x16')]===undefined?!![]:![]:!![],'where':_0x4f4096[_0x6e43('0x15')]?_0x4f4096[_0x6e43('0x15')][_0x6e43('0x17')]||null:null,'attributes':_0x4f4096[_0x6e43('0x15')]?_0x4f4096[_0x6e43('0x15')]['attributes']||null:null,'limit':_0x4f4096['options']?_0x4f4096[_0x6e43('0x15')]['limit']||null:null,'include':_0x4f4096['options']?_0x4f4096[_0x6e43('0x15')][_0x6e43('0x18')]?_[_0x6e43('0x19')](_0x4f4096['options'][_0x6e43('0x18')],function(_0x3dcf9b){return{'model':db[_0x3dcf9b[_0x6e43('0x1a')]],'as':_0x3dcf9b['as'],'attributes':_0x3dcf9b['attributes'],'include':_0x3dcf9b['include']?_['map'](_0x3dcf9b['include'],function(_0x225208){return{'model':db[_0x225208[_0x6e43('0x1a')]],'as':_0x225208['as'],'attributes':_0x225208[_0x6e43('0x1b')],'include':_0x225208[_0x6e43('0x18')]?_[_0x6e43('0x19')](_0x225208[_0x6e43('0x18')],function(_0x2dd425){return{'model':db[_0x2dd425[_0x6e43('0x1a')]],'as':_0x2dd425['as'],'attributes':_0x2dd425['attributes']};}):[]};}):[]};}):[]:[]})[_0x6e43('0x9')](function(_0x2aa06c){logger['info']('GetZendeskAccount',_0x4f4096);logger['debug'](_0x6e43('0x13'),_0x4f4096,JSON[_0x6e43('0xf')](_0x2aa06c));_0x2cb346(_0x2aa06c);})[_0x6e43('0x1c')](function(_0x173070){logger[_0x6e43('0x10')](_0x6e43('0x13'),_0x173070[_0x6e43('0x12')],_0x4f4096);_0x63f645(_0x1e3fbe[_0x6e43('0x10')](0x1f4,_0x173070[_0x6e43('0x12')]));});});};exports[_0x6e43('0x1d')]=function(_0x5b09ec){var _0x33125f=this;return new Promise(function(_0x3008fb,_0x4790eb){return db[_0x6e43('0x14')]['find']({'raw':_0x5b09ec[_0x6e43('0x15')]?_0x5b09ec[_0x6e43('0x15')][_0x6e43('0x16')]===undefined?!![]:![]:!![],'where':_0x5b09ec[_0x6e43('0x15')]?_0x5b09ec[_0x6e43('0x15')][_0x6e43('0x17')]||null:null,'attributes':_0x5b09ec[_0x6e43('0x15')]?_0x5b09ec[_0x6e43('0x15')][_0x6e43('0x1b')]||null:null,'include':_0x5b09ec[_0x6e43('0x15')]?_0x5b09ec[_0x6e43('0x15')][_0x6e43('0x18')]?_[_0x6e43('0x19')](_0x5b09ec['options'][_0x6e43('0x18')],function(_0x4a1f58){return{'model':db[_0x4a1f58[_0x6e43('0x1a')]],'as':_0x4a1f58['as'],'attributes':_0x4a1f58['attributes'],'include':_0x4a1f58['include']?_[_0x6e43('0x19')](_0x4a1f58[_0x6e43('0x18')],function(_0xe453d3){return{'model':db[_0xe453d3[_0x6e43('0x1a')]],'as':_0xe453d3['as'],'attributes':_0xe453d3[_0x6e43('0x1b')],'include':_0xe453d3[_0x6e43('0x18')]?_[_0x6e43('0x19')](_0xe453d3[_0x6e43('0x18')],function(_0x5023e6){return{'model':db[_0x5023e6[_0x6e43('0x1a')]],'as':_0x5023e6['as'],'attributes':_0x5023e6[_0x6e43('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x6e43('0x9')](function(_0x4167c7){logger[_0x6e43('0xa')](_0x6e43('0x1d'),_0x5b09ec);logger[_0x6e43('0xd')]('ShowZendeskAccount',_0x5b09ec,JSON[_0x6e43('0xf')](_0x4167c7));_0x3008fb(_0x4167c7);})[_0x6e43('0x1c')](function(_0x139ef2){logger['error']('ShowZendeskAccount',_0x139ef2[_0x6e43('0x12')],_0x5b09ec);_0x4790eb(_0x33125f[_0x6e43('0x10')](0x1f4,_0x139ef2[_0x6e43('0x12')]));});});}; \ No newline at end of file +var _0x4670=['http','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetZendeskAccount','options','raw','where','limit','include','map','model','attributes','catch','ShowZendeskAccount','find','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3bd292,_0x5321e2){var _0x2720d0=function(_0x397e7c){while(--_0x397e7c){_0x3bd292['push'](_0x3bd292['shift']());}};_0x2720d0(++_0x5321e2);}(_0x4670,0xf0));var _0x0467=function(_0x16b46d,_0x54a2f5){_0x16b46d=_0x16b46d-0x0;var _0x516cf3=_0x4670[_0x16b46d];return _0x516cf3;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x0467('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0467('0x1'))['db'];var utils=require(_0x0467('0x2'));var logger=require(_0x0467('0x3'))(_0x0467('0x4'));var config=require(_0x0467('0x5'));var jayson=require(_0x0467('0x6'));var client=jayson[_0x0467('0x7')][_0x0467('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4a93d1,_0x48dc7d,_0x1b0367){return new BPromise(function(_0x379b8a,_0x536688){return client['request'](_0x4a93d1,_0x1b0367)[_0x0467('0x9')](function(_0x335078){logger[_0x0467('0xa')](_0x0467('0xb'),_0x48dc7d,_0x0467('0xc'));logger[_0x0467('0xd')](_0x0467('0xe'),_0x48dc7d,_0x0467('0xc'),JSON[_0x0467('0xf')](_0x335078));if(_0x335078['error']){if(_0x335078[_0x0467('0x10')][_0x0467('0x11')]===0x1f4){logger[_0x0467('0x10')](_0x0467('0xb'),_0x48dc7d,_0x335078[_0x0467('0x10')]['message']);return _0x536688(_0x335078['error']['message']);}logger[_0x0467('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0x48dc7d,_0x335078[_0x0467('0x10')][_0x0467('0x12')]);return _0x379b8a(_0x335078[_0x0467('0x10')][_0x0467('0x12')]);}else{logger['info'](_0x0467('0xb'),_0x48dc7d,_0x0467('0xc'));_0x379b8a(_0x335078['result'][_0x0467('0x12')]);}})['catch'](function(_0x5abe20){logger[_0x0467('0x10')](_0x0467('0xb'),_0x48dc7d,_0x5abe20);_0x536688(_0x5abe20);});});}exports[_0x0467('0x13')]=function(_0x530527){var _0x47dad6=this;return new Promise(function(_0x3cf613,_0x1018a8){return db['ZendeskAccount']['findAll']({'raw':_0x530527['options']?_0x530527[_0x0467('0x14')][_0x0467('0x15')]===undefined?!![]:![]:!![],'where':_0x530527[_0x0467('0x14')]?_0x530527[_0x0467('0x14')][_0x0467('0x16')]||null:null,'attributes':_0x530527[_0x0467('0x14')]?_0x530527[_0x0467('0x14')]['attributes']||null:null,'limit':_0x530527[_0x0467('0x14')]?_0x530527[_0x0467('0x14')][_0x0467('0x17')]||null:null,'include':_0x530527[_0x0467('0x14')]?_0x530527[_0x0467('0x14')][_0x0467('0x18')]?_[_0x0467('0x19')](_0x530527['options'][_0x0467('0x18')],function(_0x584747){return{'model':db[_0x584747[_0x0467('0x1a')]],'as':_0x584747['as'],'attributes':_0x584747[_0x0467('0x1b')],'include':_0x584747[_0x0467('0x18')]?_[_0x0467('0x19')](_0x584747[_0x0467('0x18')],function(_0x519de9){return{'model':db[_0x519de9[_0x0467('0x1a')]],'as':_0x519de9['as'],'attributes':_0x519de9[_0x0467('0x1b')],'include':_0x519de9['include']?_['map'](_0x519de9['include'],function(_0x263b58){return{'model':db[_0x263b58[_0x0467('0x1a')]],'as':_0x263b58['as'],'attributes':_0x263b58[_0x0467('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0467('0x9')](function(_0xc4861e){logger[_0x0467('0xa')](_0x0467('0x13'),_0x530527);logger[_0x0467('0xd')](_0x0467('0x13'),_0x530527,JSON['stringify'](_0xc4861e));_0x3cf613(_0xc4861e);})[_0x0467('0x1c')](function(_0x315267){logger[_0x0467('0x10')](_0x0467('0x13'),_0x315267[_0x0467('0x12')],_0x530527);_0x1018a8(_0x47dad6[_0x0467('0x10')](0x1f4,_0x315267[_0x0467('0x12')]));});});};exports[_0x0467('0x1d')]=function(_0x153e3e){var _0x3f13eb=this;return new Promise(function(_0xe48638,_0x43e5b2){return db['ZendeskAccount'][_0x0467('0x1e')]({'raw':_0x153e3e[_0x0467('0x14')]?_0x153e3e[_0x0467('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x153e3e[_0x0467('0x14')]?_0x153e3e[_0x0467('0x14')][_0x0467('0x16')]||null:null,'attributes':_0x153e3e[_0x0467('0x14')]?_0x153e3e[_0x0467('0x14')][_0x0467('0x1b')]||null:null,'include':_0x153e3e[_0x0467('0x14')]?_0x153e3e[_0x0467('0x14')][_0x0467('0x18')]?_['map'](_0x153e3e[_0x0467('0x14')]['include'],function(_0x14ef4e){return{'model':db[_0x14ef4e[_0x0467('0x1a')]],'as':_0x14ef4e['as'],'attributes':_0x14ef4e['attributes'],'include':_0x14ef4e[_0x0467('0x18')]?_[_0x0467('0x19')](_0x14ef4e[_0x0467('0x18')],function(_0x24b842){return{'model':db[_0x24b842[_0x0467('0x1a')]],'as':_0x24b842['as'],'attributes':_0x24b842[_0x0467('0x1b')],'include':_0x24b842[_0x0467('0x18')]?_[_0x0467('0x19')](_0x24b842[_0x0467('0x18')],function(_0x1d16b2){return{'model':db[_0x1d16b2['model']],'as':_0x1d16b2['as'],'attributes':_0x1d16b2['attributes']};}):[]};}):[]};}):[]:[]})[_0x0467('0x9')](function(_0x5b72ac){logger['info'](_0x0467('0x1d'),_0x153e3e);logger[_0x0467('0xd')](_0x0467('0x1d'),_0x153e3e,JSON[_0x0467('0xf')](_0x5b72ac));_0xe48638(_0x5b72ac);})[_0x0467('0x1c')](function(_0x356a36){logger[_0x0467('0x10')](_0x0467('0x1d'),_0x356a36[_0x0467('0x12')],_0x153e3e);_0x43e5b2(_0x3f13eb['error'](0x1f4,_0x356a36[_0x0467('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 164f719..775368b 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 _0xf4eb=['put','update','delete','/:id','destroy','exports','multer','Router','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/tags','getTags','create','post','setTags'];(function(_0x39addf,_0x4dae13){var _0x9dd124=function(_0x5caf94){while(--_0x5caf94){_0x39addf['push'](_0x39addf['shift']());}};_0x9dd124(++_0x4dae13);}(_0xf4eb,0xec));var _0xbf4e=function(_0x2b179d,_0x1be39c){_0x2b179d=_0x2b179d-0x0;var _0x11c064=_0xf4eb[_0x2b179d];return _0x11c064;};'use strict';var multer=require(_0xbf4e('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbf4e('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbf4e('0x2'));var config=require(_0xbf4e('0x3'));var controller=require(_0xbf4e('0x4'));router[_0xbf4e('0x5')]('/',auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x7')]);router[_0xbf4e('0x5')]('/:id',auth[_0xbf4e('0x6')](),controller['show']);router['get'](_0xbf4e('0x8'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x9')]);router[_0xbf4e('0x5')](_0xbf4e('0xa'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0xb')]);router['get']('/:id/descriptions',auth[_0xbf4e('0x6')](),controller['getDescriptions']);router[_0xbf4e('0x5')](_0xbf4e('0xc'),auth['isAuthenticated'](),controller[_0xbf4e('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbf4e('0xe')]);router[_0xbf4e('0xf')](_0xbf4e('0xc'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x10')]);router[_0xbf4e('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xbf4e('0x12')]);router[_0xbf4e('0x13')](_0xbf4e('0x14'),auth['isAuthenticated'](),controller[_0xbf4e('0x15')]);module[_0xbf4e('0x16')]=router; \ No newline at end of file +var _0xb7e7=['delete','destroy','exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','index','get','/:id','show','/:id/fields','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','put','update'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0xb7e7,0x121));var _0x7b7e=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0xb7e7[_0x173441];return _0x2423a8;};'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('0x8')](_0x7b7e('0xb'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0x8')](_0x7b7e('0xe'),auth['isAuthenticated'](),controller[_0x7b7e('0xf')]);router[_0x7b7e('0x8')](_0x7b7e('0x10'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x11')]);router[_0x7b7e('0x8')](_0x7b7e('0x12'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x13')]);router['post']('/',auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x14')]);router['post'](_0x7b7e('0x12'),auth['isAuthenticated'](),controller['setTags']);router[_0x7b7e('0x15')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x16')]);router[_0x7b7e('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x7b7e('0x18')]);module[_0x7b7e('0x19')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 88cb537..9ab653a 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 _0x7ab7=['exports','STRING','sequelize'];(function(_0x4a713c,_0x18c36d){var _0xc2dd7e=function(_0x566c87){while(--_0x566c87){_0x4a713c['push'](_0x4a713c['shift']());}};_0xc2dd7e(++_0x18c36d);}(_0x7ab7,0xe0));var _0x77ab=function(_0x2eef9f,_0x3d9a3b){_0x2eef9f=_0x2eef9f-0x0;var _0x1370e7=_0x7ab7[_0x2eef9f];return _0x1370e7;};'use strict';var Sequelize=require(_0x77ab('0x0'));module[_0x77ab('0x1')]={'name':{'type':Sequelize[_0x77ab('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x573f=['sequelize','exports','STRING'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x573f,0x111));var _0xf573=function(_0x318aed,_0x1ff597){_0x318aed=_0x318aed-0x0;var _0x175447=_0x573f[_0x318aed];return _0x175447;};'use strict';var Sequelize=require(_0xf573('0x0'));module[_0xf573('0x1')]={'name':{'type':Sequelize[_0xf573('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 1bd9e9e..202ab7d 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 _0xed7f=['desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','Content-Range','then','end','error','name','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','destroy','getFields','findOne','hasOwnProperty','getSubjects','ZendeskField','getDescriptions','getTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce'];(function(_0x29ba9b,_0x5c9061){var _0x47e81f=function(_0x2f245a){while(--_0x2f245a){_0x29ba9b['push'](_0x29ba9b['shift']());}};_0x47e81f(++_0x5c9061);}(_0xed7f,0x130));var _0xfed7=function(_0x2390e5,_0x369025){_0x2390e5=_0x2390e5-0x0;var _0xa6038f=_0xed7f[_0x2390e5];return _0xa6038f;};'use strict';var emlformat=require(_0xfed7('0x0'));var rimraf=require(_0xfed7('0x1'));var zipdir=require(_0xfed7('0x2'));var jsonpatch=require(_0xfed7('0x3'));var rp=require(_0xfed7('0x4'));var moment=require('moment');var BPromise=require(_0xfed7('0x5'));var Mustache=require(_0xfed7('0x6'));var util=require(_0xfed7('0x7'));var path=require(_0xfed7('0x8'));var sox=require(_0xfed7('0x9'));var csv=require(_0xfed7('0xa'));var ejs=require(_0xfed7('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfed7('0xc'));var squel=require(_0xfed7('0xd'));var crypto=require(_0xfed7('0xe'));var jsforce=require(_0xfed7('0xf'));var deskjs=require(_0xfed7('0x10'));var toCsv=require('to-csv');var querystring=require(_0xfed7('0x11'));var Papa=require('papaparse');var Redis=require(_0xfed7('0x12'));var authService=require(_0xfed7('0x13'));var qs=require(_0xfed7('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xfed7('0x15'))(_0xfed7('0x16'));var utils=require(_0xfed7('0x17'));var config=require(_0xfed7('0x18'));var licenseUtil=require(_0xfed7('0x19'));var db=require(_0xfed7('0x1a'))['db'];function respondWithStatusCode(_0x5b191d,_0x4a2535){_0x4a2535=_0x4a2535||0xcc;return function(_0x1eb201){if(_0x1eb201){return _0x5b191d[_0xfed7('0x1b')](_0x4a2535);}return _0x5b191d[_0xfed7('0x1c')](_0x4a2535)['end']();};}function respondWithResult(_0x438d9a,_0x5ca9cf){_0x5ca9cf=_0x5ca9cf||0xc8;return function(_0x779b79){if(_0x779b79){return _0x438d9a[_0xfed7('0x1c')](_0x5ca9cf)['json'](_0x779b79);}};}function respondWithFilteredResult(_0x6fca1f,_0x1ac1d6){return function(_0x90f5c){if(_0x90f5c){var _0x4ec081=typeof _0x1ac1d6[_0xfed7('0x1d')]===_0xfed7('0x1e')&&typeof _0x1ac1d6['limit']==='undefined';var _0x5e264f=_0x90f5c[_0xfed7('0x1f')];var _0x346342=_0x4ec081?0x0:_0x1ac1d6[_0xfed7('0x1d')];var _0x277bef=_0x4ec081?_0x90f5c[_0xfed7('0x1f')]:_0x1ac1d6[_0xfed7('0x1d')]+_0x1ac1d6[_0xfed7('0x20')];var _0x84920;if(_0x277bef>=_0x5e264f){_0x277bef=_0x5e264f;_0x84920=0xc8;}else{_0x84920=0xce;}_0x6fca1f[_0xfed7('0x1c')](_0x84920);return _0x6fca1f['set'](_0xfed7('0x21'),_0x346342+'-'+_0x277bef+'/'+_0x5e264f)['json'](_0x90f5c);}return null;};}function patchUpdates(_0x3a918a){return function(_0x2d8d86){try{jsonpatch['apply'](_0x2d8d86,_0x3a918a,!![]);}catch(_0x5b26b3){return BPromise['reject'](_0x5b26b3);}return _0x2d8d86['save']();};}function saveUpdates(_0x32a666,_0xaf3bdf){return function(_0x52a222){if(_0x52a222){return _0x52a222['update'](_0x32a666)[_0xfed7('0x22')](function(_0x3f50a0){return _0x3f50a0;});}return null;};}function removeEntity(_0x308efe,_0x3566bd){return function(_0x335137){if(_0x335137){return _0x335137['destroy']()[_0xfed7('0x22')](function(){_0x308efe['status'](0xcc)[_0xfed7('0x23')]();});}};}function handleEntityNotFound(_0x23e3d8,_0xb54e68){return function(_0x5d1751){if(!_0x5d1751){_0x23e3d8[_0xfed7('0x1b')](0x194);}return _0x5d1751;};}function handleError(_0x176914,_0x1aa86f){_0x1aa86f=_0x1aa86f||0x1f4;return function(_0x100b8f){logger[_0xfed7('0x24')](_0x100b8f['stack']);if(_0x100b8f['name']){delete _0x100b8f[_0xfed7('0x25')];}_0x176914['status'](_0x1aa86f)['send'](_0x100b8f);};}exports[_0xfed7('0x26')]=function(_0x4559c9,_0x11f539){var _0x8edc6e={},_0xcbd364={},_0x1704c={'count':0x0,'rows':[]};var _0xc3af05=_[_0xfed7('0x27')](db[_0xfed7('0x28')][_0xfed7('0x29')],function(_0x1cafab){return{'name':_0x1cafab[_0xfed7('0x2a')],'type':_0x1cafab[_0xfed7('0x2b')]['key']};});_0xcbd364[_0xfed7('0x2c')]=_[_0xfed7('0x27')](_0xc3af05,'name');_0xcbd364[_0xfed7('0x2d')]=_['keys'](_0x4559c9[_0xfed7('0x2d')]);_0xcbd364[_0xfed7('0x2e')]=_[_0xfed7('0x2f')](_0xcbd364[_0xfed7('0x2c')],_0xcbd364[_0xfed7('0x2d')]);_0x8edc6e[_0xfed7('0x30')]=_['intersection'](_0xcbd364[_0xfed7('0x2c')],qs[_0xfed7('0x31')](_0x4559c9[_0xfed7('0x2d')]['fields']));_0x8edc6e[_0xfed7('0x30')]=_0x8edc6e['attributes'][_0xfed7('0x32')]?_0x8edc6e[_0xfed7('0x30')]:_0xcbd364['model'];if(!_0x4559c9[_0xfed7('0x2d')]['hasOwnProperty'](_0xfed7('0x33'))){_0x8edc6e[_0xfed7('0x20')]=qs[_0xfed7('0x20')](_0x4559c9['query']['limit']);_0x8edc6e[_0xfed7('0x1d')]=qs['offset'](_0x4559c9[_0xfed7('0x2d')]['offset']);}_0x8edc6e[_0xfed7('0x34')]=qs[_0xfed7('0x35')](_0x4559c9['query'][_0xfed7('0x35')]);_0x8edc6e[_0xfed7('0x36')]=qs[_0xfed7('0x2e')](_[_0xfed7('0x37')](_0x4559c9[_0xfed7('0x2d')],_0xcbd364[_0xfed7('0x2e')]),_0xc3af05);if(_0x4559c9[_0xfed7('0x2d')][_0xfed7('0x38')]){_0x8edc6e['where']=_[_0xfed7('0x39')](_0x8edc6e[_0xfed7('0x36')],{'$or':_[_0xfed7('0x27')](_0xc3af05,function(_0x471cd1){if(_0x471cd1[_0xfed7('0x2b')]!==_0xfed7('0x3a')){var _0x17136e={};_0x17136e[_0x471cd1['name']]={'$like':'%'+_0x4559c9[_0xfed7('0x2d')][_0xfed7('0x38')]+'%'};return _0x17136e;}})});}_0x8edc6e=_[_0xfed7('0x39')]({},_0x8edc6e,_0x4559c9[_0xfed7('0x3b')]);var _0xdd5963={'where':_0x8edc6e[_0xfed7('0x36')]};return db[_0xfed7('0x28')][_0xfed7('0x1f')](_0xdd5963)[_0xfed7('0x22')](function(_0x10b838){_0x1704c[_0xfed7('0x1f')]=_0x10b838;if(_0x4559c9[_0xfed7('0x2d')][_0xfed7('0x3c')]){_0x8edc6e[_0xfed7('0x3d')]=[{'all':!![]}];}return db[_0xfed7('0x28')][_0xfed7('0x3e')](_0x8edc6e);})[_0xfed7('0x22')](function(_0x142e1c){_0x1704c[_0xfed7('0x3f')]=_0x142e1c;return _0x1704c;})[_0xfed7('0x22')](respondWithFilteredResult(_0x11f539,_0x8edc6e))['catch'](handleError(_0x11f539,null));};exports[_0xfed7('0x40')]=function(_0x3d2b27,_0x53935e){var _0x5a56c3={'raw':![],'where':{'id':_0x3d2b27[_0xfed7('0x41')]['id']}},_0x578c7f={};_0x578c7f[_0xfed7('0x2c')]=_[_0xfed7('0x42')](db['ZendeskConfiguration']['rawAttributes']);_0x578c7f['query']=_[_0xfed7('0x42')](_0x3d2b27['query']);_0x578c7f[_0xfed7('0x2e')]=_[_0xfed7('0x2f')](_0x578c7f[_0xfed7('0x2c')],_0x578c7f[_0xfed7('0x2d')]);_0x5a56c3['attributes']=_[_0xfed7('0x2f')](_0x578c7f['model'],qs[_0xfed7('0x31')](_0x3d2b27[_0xfed7('0x2d')][_0xfed7('0x31')]));_0x5a56c3['attributes']=_0x5a56c3[_0xfed7('0x30')]['length']?_0x5a56c3['attributes']:_0x578c7f[_0xfed7('0x2c')];if(_0x3d2b27[_0xfed7('0x2d')]['includeAll']){_0x5a56c3['include']=[{'all':!![]}];}_0x5a56c3=_[_0xfed7('0x39')]({},_0x5a56c3,_0x3d2b27[_0xfed7('0x3b')]);return db[_0xfed7('0x28')][_0xfed7('0x43')](_0x5a56c3)[_0xfed7('0x22')](handleEntityNotFound(_0x53935e,null))['then'](respondWithResult(_0x53935e,null))[_0xfed7('0x44')](handleError(_0x53935e,null));};exports['create']=function(_0x179615,_0x4aad07){return db['ZendeskConfiguration'][_0xfed7('0x45')](_0x179615[_0xfed7('0x46')],{})['then'](respondWithResult(_0x4aad07,0xc9))[_0xfed7('0x44')](handleError(_0x4aad07,null));};exports['update']=function(_0x1e1304,_0x34e442){if(_0x1e1304[_0xfed7('0x46')]['id']){delete _0x1e1304[_0xfed7('0x46')]['id'];}return db[_0xfed7('0x28')][_0xfed7('0x43')]({'where':{'id':_0x1e1304[_0xfed7('0x41')]['id']}})[_0xfed7('0x22')](handleEntityNotFound(_0x34e442,null))[_0xfed7('0x22')](saveUpdates(_0x1e1304[_0xfed7('0x46')],null))['then'](respondWithResult(_0x34e442,null))['catch'](handleError(_0x34e442,null));};exports[_0xfed7('0x47')]=function(_0x11c84a,_0xc305d2){return db['ZendeskConfiguration'][_0xfed7('0x43')]({'where':{'id':_0x11c84a['params']['id']}})[_0xfed7('0x22')](handleEntityNotFound(_0xc305d2,null))[_0xfed7('0x22')](removeEntity(_0xc305d2,null))[_0xfed7('0x44')](handleError(_0xc305d2,null));};exports[_0xfed7('0x48')]=function(_0x52ea0b,_0x14e420,_0x2e6951){var _0x4f9311={};var _0x46ded5={};var _0x3844ab;var _0x1f4d48;return db[_0xfed7('0x28')][_0xfed7('0x49')]({'where':{'id':_0x52ea0b[_0xfed7('0x41')]['id']}})[_0xfed7('0x22')](handleEntityNotFound(_0x14e420,null))[_0xfed7('0x22')](function(_0x5a9ba0){if(_0x5a9ba0){_0x3844ab=_0x5a9ba0;_0x46ded5[_0xfed7('0x2c')]=_[_0xfed7('0x42')](db['ZendeskField'][_0xfed7('0x29')]);_0x46ded5['query']=_[_0xfed7('0x42')](_0x52ea0b[_0xfed7('0x2d')]);_0x46ded5[_0xfed7('0x2e')]=_['intersection'](_0x46ded5[_0xfed7('0x2c')],_0x46ded5[_0xfed7('0x2d')]);_0x4f9311[_0xfed7('0x30')]=_['intersection'](_0x46ded5[_0xfed7('0x2c')],qs[_0xfed7('0x31')](_0x52ea0b[_0xfed7('0x2d')]['fields']));_0x4f9311[_0xfed7('0x30')]=_0x4f9311[_0xfed7('0x30')][_0xfed7('0x32')]?_0x4f9311['attributes']:_0x46ded5[_0xfed7('0x2c')];_0x4f9311[_0xfed7('0x34')]=qs[_0xfed7('0x35')](_0x52ea0b[_0xfed7('0x2d')][_0xfed7('0x35')]);_0x4f9311[_0xfed7('0x36')]=qs[_0xfed7('0x2e')](_[_0xfed7('0x37')](_0x52ea0b[_0xfed7('0x2d')],_0x46ded5[_0xfed7('0x2e')]));if(_0x52ea0b['query'][_0xfed7('0x38')]){_0x4f9311['where']=_['merge'](_0x4f9311[_0xfed7('0x36')],{'$or':_[_0xfed7('0x27')](_0x4f9311[_0xfed7('0x30')],function(_0x22ff07){var _0x1b5481={};_0x1b5481[_0x22ff07]={'$like':'%'+_0x52ea0b[_0xfed7('0x2d')]['filter']+'%'};return _0x1b5481;})});}_0x4f9311=_[_0xfed7('0x39')]({},_0x4f9311,_0x52ea0b[_0xfed7('0x3b')]);return _0x3844ab['getFields'](_0x4f9311);}})[_0xfed7('0x22')](function(_0x2dc3fb){if(_0x2dc3fb){_0x1f4d48=_0x2dc3fb[_0xfed7('0x32')];if(!_0x52ea0b[_0xfed7('0x2d')][_0xfed7('0x4a')]('nolimit')){_0x4f9311[_0xfed7('0x20')]=qs['limit'](_0x52ea0b[_0xfed7('0x2d')]['limit']);_0x4f9311['offset']=qs[_0xfed7('0x1d')](_0x52ea0b[_0xfed7('0x2d')][_0xfed7('0x1d')]);}return _0x3844ab[_0xfed7('0x48')](_0x4f9311);}})[_0xfed7('0x22')](function(_0x37dfa1){if(_0x37dfa1){return _0x37dfa1?{'count':_0x1f4d48,'rows':_0x37dfa1}:null;}})[_0xfed7('0x22')](respondWithResult(_0x14e420,null))['catch'](handleError(_0x14e420,null));};exports[_0xfed7('0x4b')]=function(_0x1151a0,_0x2ea8f1,_0x20daa7){var _0x5d91d0={};var _0x3a31fb={};var _0x4afdac;var _0x3f65ac;return db[_0xfed7('0x28')][_0xfed7('0x49')]({'where':{'id':_0x1151a0[_0xfed7('0x41')]['id']}})[_0xfed7('0x22')](handleEntityNotFound(_0x2ea8f1,null))[_0xfed7('0x22')](function(_0x3bcdc0){if(_0x3bcdc0){_0x4afdac=_0x3bcdc0;_0x3a31fb[_0xfed7('0x2c')]=_['keys'](db[_0xfed7('0x4c')][_0xfed7('0x29')]);_0x3a31fb['query']=_[_0xfed7('0x42')](_0x1151a0[_0xfed7('0x2d')]);_0x3a31fb[_0xfed7('0x2e')]=_[_0xfed7('0x2f')](_0x3a31fb[_0xfed7('0x2c')],_0x3a31fb[_0xfed7('0x2d')]);_0x5d91d0[_0xfed7('0x30')]=_[_0xfed7('0x2f')](_0x3a31fb[_0xfed7('0x2c')],qs[_0xfed7('0x31')](_0x1151a0[_0xfed7('0x2d')][_0xfed7('0x31')]));_0x5d91d0[_0xfed7('0x30')]=_0x5d91d0[_0xfed7('0x30')][_0xfed7('0x32')]?_0x5d91d0[_0xfed7('0x30')]:_0x3a31fb['model'];_0x5d91d0[_0xfed7('0x34')]=qs['sort'](_0x1151a0['query'][_0xfed7('0x35')]);_0x5d91d0[_0xfed7('0x36')]=qs[_0xfed7('0x2e')](_[_0xfed7('0x37')](_0x1151a0[_0xfed7('0x2d')],_0x3a31fb[_0xfed7('0x2e')]));if(_0x1151a0[_0xfed7('0x2d')][_0xfed7('0x38')]){_0x5d91d0[_0xfed7('0x36')]=_[_0xfed7('0x39')](_0x5d91d0[_0xfed7('0x36')],{'$or':_[_0xfed7('0x27')](_0x5d91d0[_0xfed7('0x30')],function(_0x18a037){var _0x212c46={};_0x212c46[_0x18a037]={'$like':'%'+_0x1151a0[_0xfed7('0x2d')][_0xfed7('0x38')]+'%'};return _0x212c46;})});}_0x5d91d0=_[_0xfed7('0x39')]({},_0x5d91d0,_0x1151a0[_0xfed7('0x3b')]);return _0x4afdac[_0xfed7('0x4b')](_0x5d91d0);}})['then'](function(_0x16b9d0){if(_0x16b9d0){_0x3f65ac=_0x16b9d0[_0xfed7('0x32')];if(!_0x1151a0[_0xfed7('0x2d')]['hasOwnProperty'](_0xfed7('0x33'))){_0x5d91d0[_0xfed7('0x20')]=qs[_0xfed7('0x20')](_0x1151a0['query']['limit']);_0x5d91d0[_0xfed7('0x1d')]=qs[_0xfed7('0x1d')](_0x1151a0[_0xfed7('0x2d')][_0xfed7('0x1d')]);}return _0x4afdac[_0xfed7('0x4b')](_0x5d91d0);}})[_0xfed7('0x22')](function(_0x3ce956){if(_0x3ce956){return _0x3ce956?{'count':_0x3f65ac,'rows':_0x3ce956}:null;}})[_0xfed7('0x22')](respondWithResult(_0x2ea8f1,null))['catch'](handleError(_0x2ea8f1,null));};exports[_0xfed7('0x4d')]=function(_0x2237de,_0x1a594d,_0xe01b0f){var _0x376ba7={};var _0x3c763a={};var _0x21de4c;var _0x1890ee;return db['ZendeskConfiguration'][_0xfed7('0x49')]({'where':{'id':_0x2237de[_0xfed7('0x41')]['id']}})['then'](handleEntityNotFound(_0x1a594d,null))['then'](function(_0x5503f5){if(_0x5503f5){_0x21de4c=_0x5503f5;_0x3c763a[_0xfed7('0x2c')]=_[_0xfed7('0x42')](db[_0xfed7('0x4c')][_0xfed7('0x29')]);_0x3c763a[_0xfed7('0x2d')]=_[_0xfed7('0x42')](_0x2237de[_0xfed7('0x2d')]);_0x3c763a[_0xfed7('0x2e')]=_[_0xfed7('0x2f')](_0x3c763a[_0xfed7('0x2c')],_0x3c763a[_0xfed7('0x2d')]);_0x376ba7[_0xfed7('0x30')]=_[_0xfed7('0x2f')](_0x3c763a['model'],qs[_0xfed7('0x31')](_0x2237de[_0xfed7('0x2d')][_0xfed7('0x31')]));_0x376ba7[_0xfed7('0x30')]=_0x376ba7['attributes'][_0xfed7('0x32')]?_0x376ba7[_0xfed7('0x30')]:_0x3c763a[_0xfed7('0x2c')];_0x376ba7[_0xfed7('0x34')]=qs[_0xfed7('0x35')](_0x2237de[_0xfed7('0x2d')][_0xfed7('0x35')]);_0x376ba7['where']=qs[_0xfed7('0x2e')](_[_0xfed7('0x37')](_0x2237de[_0xfed7('0x2d')],_0x3c763a[_0xfed7('0x2e')]));if(_0x2237de[_0xfed7('0x2d')][_0xfed7('0x38')]){_0x376ba7[_0xfed7('0x36')]=_[_0xfed7('0x39')](_0x376ba7[_0xfed7('0x36')],{'$or':_['map'](_0x376ba7['attributes'],function(_0x6822e1){var _0x233bad={};_0x233bad[_0x6822e1]={'$like':'%'+_0x2237de[_0xfed7('0x2d')][_0xfed7('0x38')]+'%'};return _0x233bad;})});}_0x376ba7=_['merge']({},_0x376ba7,_0x2237de[_0xfed7('0x3b')]);return _0x21de4c[_0xfed7('0x4d')](_0x376ba7);}})[_0xfed7('0x22')](function(_0x559c01){if(_0x559c01){_0x1890ee=_0x559c01[_0xfed7('0x32')];if(!_0x2237de[_0xfed7('0x2d')][_0xfed7('0x4a')](_0xfed7('0x33'))){_0x376ba7[_0xfed7('0x20')]=qs['limit'](_0x2237de[_0xfed7('0x2d')]['limit']);_0x376ba7['offset']=qs['offset'](_0x2237de[_0xfed7('0x2d')][_0xfed7('0x1d')]);}return _0x21de4c[_0xfed7('0x4d')](_0x376ba7);}})[_0xfed7('0x22')](function(_0x5d7517){if(_0x5d7517){return _0x5d7517?{'count':_0x1890ee,'rows':_0x5d7517}:null;}})[_0xfed7('0x22')](respondWithResult(_0x1a594d,null))[_0xfed7('0x44')](handleError(_0x1a594d,null));};exports[_0xfed7('0x4e')]=function(_0x553f26,_0x4d31ff,_0x404618){var _0x203039={};var _0x42d8f8={};var _0x2150da;var _0x5056d1;return db[_0xfed7('0x28')][_0xfed7('0x49')]({'where':{'id':_0x553f26['params']['id']}})[_0xfed7('0x22')](handleEntityNotFound(_0x4d31ff,null))[_0xfed7('0x22')](function(_0x4f8a9c){if(_0x4f8a9c){_0x2150da=_0x4f8a9c;_0x42d8f8[_0xfed7('0x2c')]=_['keys'](db['Tag'][_0xfed7('0x29')]);_0x42d8f8[_0xfed7('0x2d')]=_[_0xfed7('0x42')](_0x553f26[_0xfed7('0x2d')]);_0x42d8f8[_0xfed7('0x2e')]=_[_0xfed7('0x2f')](_0x42d8f8['model'],_0x42d8f8[_0xfed7('0x2d')]);_0x203039[_0xfed7('0x30')]=_['intersection'](_0x42d8f8[_0xfed7('0x2c')],qs['fields'](_0x553f26[_0xfed7('0x2d')]['fields']));_0x203039[_0xfed7('0x30')]=_0x203039['attributes']['length']?_0x203039[_0xfed7('0x30')]:_0x42d8f8[_0xfed7('0x2c')];_0x203039['order']=qs[_0xfed7('0x35')](_0x553f26[_0xfed7('0x2d')][_0xfed7('0x35')]);_0x203039[_0xfed7('0x36')]=qs[_0xfed7('0x2e')](_[_0xfed7('0x37')](_0x553f26['query'],_0x42d8f8[_0xfed7('0x2e')]));if(_0x553f26['query'][_0xfed7('0x38')]){_0x203039['where']=_[_0xfed7('0x39')](_0x203039[_0xfed7('0x36')],{'$or':_[_0xfed7('0x27')](_0x203039[_0xfed7('0x30')],function(_0x13333c){var _0x802980={};_0x802980[_0x13333c]={'$like':'%'+_0x553f26[_0xfed7('0x2d')]['filter']+'%'};return _0x802980;})});}_0x203039=_[_0xfed7('0x39')]({},_0x203039,_0x553f26[_0xfed7('0x3b')]);return _0x2150da[_0xfed7('0x4e')](_0x203039);}})[_0xfed7('0x22')](function(_0xf3bdfe){if(_0xf3bdfe){_0x5056d1=_0xf3bdfe[_0xfed7('0x32')];if(!_0x553f26[_0xfed7('0x2d')][_0xfed7('0x4a')](_0xfed7('0x33'))){_0x203039[_0xfed7('0x20')]=qs[_0xfed7('0x20')](_0x553f26[_0xfed7('0x2d')]['limit']);_0x203039['offset']=qs[_0xfed7('0x1d')](_0x553f26[_0xfed7('0x2d')]['offset']);}return _0x2150da['getTags'](_0x203039);}})[_0xfed7('0x22')](function(_0x4c42b1){if(_0x4c42b1){return _0x4c42b1?{'count':_0x5056d1,'rows':_0x4c42b1}:null;}})[_0xfed7('0x22')](respondWithResult(_0x4d31ff,null))['catch'](handleError(_0x4d31ff,null));};exports['setTags']=function(_0x4d0cb5,_0x2d3a03,_0x4b9372){if(_0x4d0cb5['body']['id']){delete _0x4d0cb5['body']['id'];}return db[_0xfed7('0x28')][_0xfed7('0x49')]({'where':{'id':_0x4d0cb5[_0xfed7('0x41')]['id']}})['then'](handleEntityNotFound(_0x2d3a03,null))['then'](function(_0x12f02d){if(_0x12f02d){return _0x12f02d['setTags'](_0x4d0cb5[_0xfed7('0x46')][_0xfed7('0x4f')]||[]);}return null;})['then'](respondWithResult(_0x2d3a03,null))[_0xfed7('0x44')](handleError(_0x2d3a03,null));}; \ No newline at end of file +var _0x7331=['mustache','util','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','limit','undefined','offset','count','set','apply','reject','save','then','destroy','end','error','name','send','index','rawAttributes','type','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ZendeskConfiguration','include','findAll','rows','catch','show','params','filters','create','body','find','getFields','ZendeskField','length','getSubjects','findOne','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x50a9d6,_0x12e0a5){var _0x300536=function(_0x4c6afd){while(--_0x4c6afd){_0x50a9d6['push'](_0x50a9d6['shift']());}};_0x300536(++_0x12e0a5);}(_0x7331,0x1e1));var _0x1733=function(_0x51b655,_0x2c9c79){_0x51b655=_0x51b655-0x0;var _0x4e130b=_0x7331[_0x51b655];return _0x4e130b;};'use strict';var emlformat=require(_0x1733('0x0'));var rimraf=require(_0x1733('0x1'));var zipdir=require(_0x1733('0x2'));var jsonpatch=require(_0x1733('0x3'));var rp=require(_0x1733('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1733('0x5'));var util=require(_0x1733('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1733('0x7'));var fs=require('fs');var fs_extra=require(_0x1733('0x8'));var _=require('lodash');var squel=require(_0x1733('0x9'));var crypto=require(_0x1733('0xa'));var jsforce=require(_0x1733('0xb'));var deskjs=require(_0x1733('0xc'));var toCsv=require(_0x1733('0xd'));var querystring=require(_0x1733('0xe'));var Papa=require(_0x1733('0xf'));var Redis=require(_0x1733('0x10'));var authService=require(_0x1733('0x11'));var qs=require(_0x1733('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1733('0x13'))(_0x1733('0x14'));var utils=require('../../config/utils');var config=require(_0x1733('0x15'));var licenseUtil=require(_0x1733('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x202461,_0x394402){_0x394402=_0x394402||0xcc;return function(_0x4fed5e){if(_0x4fed5e){return _0x202461[_0x1733('0x17')](_0x394402);}return _0x202461[_0x1733('0x18')](_0x394402)['end']();};}function respondWithResult(_0x56d757,_0x3398fd){_0x3398fd=_0x3398fd||0xc8;return function(_0xb1077){if(_0xb1077){return _0x56d757[_0x1733('0x18')](_0x3398fd)[_0x1733('0x19')](_0xb1077);}};}function respondWithFilteredResult(_0x58fe51,_0x757b33){return function(_0x277341){if(_0x277341){var _0x4d6f6c=typeof _0x757b33['offset']==='undefined'&&typeof _0x757b33[_0x1733('0x1a')]===_0x1733('0x1b');var _0x3e3911=_0x277341['count'];var _0x26c322=_0x4d6f6c?0x0:_0x757b33[_0x1733('0x1c')];var _0x1494e8=_0x4d6f6c?_0x277341[_0x1733('0x1d')]:_0x757b33['offset']+_0x757b33[_0x1733('0x1a')];var _0x24bea3;if(_0x1494e8>=_0x3e3911){_0x1494e8=_0x3e3911;_0x24bea3=0xc8;}else{_0x24bea3=0xce;}_0x58fe51['status'](_0x24bea3);return _0x58fe51[_0x1733('0x1e')]('Content-Range',_0x26c322+'-'+_0x1494e8+'/'+_0x3e3911)[_0x1733('0x19')](_0x277341);}return null;};}function patchUpdates(_0x3deaf9){return function(_0x553a42){try{jsonpatch[_0x1733('0x1f')](_0x553a42,_0x3deaf9,!![]);}catch(_0x243878){return BPromise[_0x1733('0x20')](_0x243878);}return _0x553a42[_0x1733('0x21')]();};}function saveUpdates(_0x5f30bc,_0x13a288){return function(_0x54887a){if(_0x54887a){return _0x54887a['update'](_0x5f30bc)[_0x1733('0x22')](function(_0x49d382){return _0x49d382;});}return null;};}function removeEntity(_0x58be1b,_0x526b29){return function(_0x5c74bd){if(_0x5c74bd){return _0x5c74bd[_0x1733('0x23')]()[_0x1733('0x22')](function(){_0x58be1b[_0x1733('0x18')](0xcc)[_0x1733('0x24')]();});}};}function handleEntityNotFound(_0x35ee4c,_0x244848){return function(_0x34fde7){if(!_0x34fde7){_0x35ee4c[_0x1733('0x17')](0x194);}return _0x34fde7;};}function handleError(_0x1e1595,_0x1a5b48){_0x1a5b48=_0x1a5b48||0x1f4;return function(_0x5b629a){logger[_0x1733('0x25')](_0x5b629a['stack']);if(_0x5b629a[_0x1733('0x26')]){delete _0x5b629a[_0x1733('0x26')];}_0x1e1595[_0x1733('0x18')](_0x1a5b48)[_0x1733('0x27')](_0x5b629a);};}exports[_0x1733('0x28')]=function(_0x91d051,_0x25dd7c){var _0x540d12={},_0x132d30={},_0x1ada43={'count':0x0,'rows':[]};var _0x1fccfd=_['map'](db['ZendeskConfiguration'][_0x1733('0x29')],function(_0x435052){return{'name':_0x435052['fieldName'],'type':_0x435052[_0x1733('0x2a')]['key']};});_0x132d30[_0x1733('0x2b')]=_[_0x1733('0x2c')](_0x1fccfd,_0x1733('0x26'));_0x132d30[_0x1733('0x2d')]=_[_0x1733('0x2e')](_0x91d051[_0x1733('0x2d')]);_0x132d30['filters']=_[_0x1733('0x2f')](_0x132d30[_0x1733('0x2b')],_0x132d30[_0x1733('0x2d')]);_0x540d12[_0x1733('0x30')]=_[_0x1733('0x2f')](_0x132d30['model'],qs[_0x1733('0x31')](_0x91d051[_0x1733('0x2d')][_0x1733('0x31')]));_0x540d12['attributes']=_0x540d12[_0x1733('0x30')]['length']?_0x540d12[_0x1733('0x30')]:_0x132d30['model'];if(!_0x91d051[_0x1733('0x2d')][_0x1733('0x32')](_0x1733('0x33'))){_0x540d12[_0x1733('0x1a')]=qs['limit'](_0x91d051[_0x1733('0x2d')][_0x1733('0x1a')]);_0x540d12[_0x1733('0x1c')]=qs[_0x1733('0x1c')](_0x91d051[_0x1733('0x2d')][_0x1733('0x1c')]);}_0x540d12[_0x1733('0x34')]=qs[_0x1733('0x35')](_0x91d051[_0x1733('0x2d')][_0x1733('0x35')]);_0x540d12[_0x1733('0x36')]=qs['filters'](_[_0x1733('0x37')](_0x91d051[_0x1733('0x2d')],_0x132d30['filters']),_0x1fccfd);if(_0x91d051[_0x1733('0x2d')][_0x1733('0x38')]){_0x540d12[_0x1733('0x36')]=_[_0x1733('0x39')](_0x540d12['where'],{'$or':_[_0x1733('0x2c')](_0x1fccfd,function(_0x24d577){if(_0x24d577[_0x1733('0x2a')]!==_0x1733('0x3a')){var _0x12dadc={};_0x12dadc[_0x24d577[_0x1733('0x26')]]={'$like':'%'+_0x91d051[_0x1733('0x2d')][_0x1733('0x38')]+'%'};return _0x12dadc;}})});}_0x540d12=_[_0x1733('0x39')]({},_0x540d12,_0x91d051[_0x1733('0x3b')]);var _0xff311={'where':_0x540d12['where']};return db[_0x1733('0x3c')][_0x1733('0x1d')](_0xff311)[_0x1733('0x22')](function(_0x4d292c){_0x1ada43[_0x1733('0x1d')]=_0x4d292c;if(_0x91d051[_0x1733('0x2d')]['includeAll']){_0x540d12[_0x1733('0x3d')]=[{'all':!![]}];}return db[_0x1733('0x3c')][_0x1733('0x3e')](_0x540d12);})[_0x1733('0x22')](function(_0x920d9f){_0x1ada43[_0x1733('0x3f')]=_0x920d9f;return _0x1ada43;})[_0x1733('0x22')](respondWithFilteredResult(_0x25dd7c,_0x540d12))[_0x1733('0x40')](handleError(_0x25dd7c,null));};exports[_0x1733('0x41')]=function(_0x1dc4e0,_0x188568){var _0x523dc0={'raw':![],'where':{'id':_0x1dc4e0[_0x1733('0x42')]['id']}},_0x284b7f={};_0x284b7f['model']=_[_0x1733('0x2e')](db[_0x1733('0x3c')][_0x1733('0x29')]);_0x284b7f[_0x1733('0x2d')]=_[_0x1733('0x2e')](_0x1dc4e0[_0x1733('0x2d')]);_0x284b7f[_0x1733('0x43')]=_[_0x1733('0x2f')](_0x284b7f[_0x1733('0x2b')],_0x284b7f['query']);_0x523dc0[_0x1733('0x30')]=_['intersection'](_0x284b7f['model'],qs[_0x1733('0x31')](_0x1dc4e0[_0x1733('0x2d')][_0x1733('0x31')]));_0x523dc0[_0x1733('0x30')]=_0x523dc0[_0x1733('0x30')]['length']?_0x523dc0[_0x1733('0x30')]:_0x284b7f['model'];if(_0x1dc4e0[_0x1733('0x2d')]['includeAll']){_0x523dc0[_0x1733('0x3d')]=[{'all':!![]}];}_0x523dc0=_[_0x1733('0x39')]({},_0x523dc0,_0x1dc4e0[_0x1733('0x3b')]);return db[_0x1733('0x3c')]['find'](_0x523dc0)[_0x1733('0x22')](handleEntityNotFound(_0x188568,null))[_0x1733('0x22')](respondWithResult(_0x188568,null))['catch'](handleError(_0x188568,null));};exports[_0x1733('0x44')]=function(_0x36b955,_0x333caa){return db[_0x1733('0x3c')][_0x1733('0x44')](_0x36b955['body'],{})[_0x1733('0x22')](respondWithResult(_0x333caa,0xc9))['catch'](handleError(_0x333caa,null));};exports['update']=function(_0xa004bb,_0x23adc1){if(_0xa004bb['body']['id']){delete _0xa004bb[_0x1733('0x45')]['id'];}return db[_0x1733('0x3c')][_0x1733('0x46')]({'where':{'id':_0xa004bb[_0x1733('0x42')]['id']}})['then'](handleEntityNotFound(_0x23adc1,null))[_0x1733('0x22')](saveUpdates(_0xa004bb[_0x1733('0x45')],null))[_0x1733('0x22')](respondWithResult(_0x23adc1,null))['catch'](handleError(_0x23adc1,null));};exports['destroy']=function(_0x3ac097,_0xffc99a){return db['ZendeskConfiguration'][_0x1733('0x46')]({'where':{'id':_0x3ac097[_0x1733('0x42')]['id']}})[_0x1733('0x22')](handleEntityNotFound(_0xffc99a,null))[_0x1733('0x22')](removeEntity(_0xffc99a,null))[_0x1733('0x40')](handleError(_0xffc99a,null));};exports[_0x1733('0x47')]=function(_0x3829ea,_0x15f579,_0x2ecbf4){var _0x54981f={};var _0x38786a={};var _0x386973;var _0x511cf1;return db[_0x1733('0x3c')]['findOne']({'where':{'id':_0x3829ea[_0x1733('0x42')]['id']}})['then'](handleEntityNotFound(_0x15f579,null))['then'](function(_0x50be41){if(_0x50be41){_0x386973=_0x50be41;_0x38786a['model']=_[_0x1733('0x2e')](db[_0x1733('0x48')]['rawAttributes']);_0x38786a[_0x1733('0x2d')]=_[_0x1733('0x2e')](_0x3829ea[_0x1733('0x2d')]);_0x38786a[_0x1733('0x43')]=_[_0x1733('0x2f')](_0x38786a['model'],_0x38786a[_0x1733('0x2d')]);_0x54981f[_0x1733('0x30')]=_[_0x1733('0x2f')](_0x38786a[_0x1733('0x2b')],qs['fields'](_0x3829ea['query']['fields']));_0x54981f['attributes']=_0x54981f[_0x1733('0x30')][_0x1733('0x49')]?_0x54981f['attributes']:_0x38786a[_0x1733('0x2b')];_0x54981f[_0x1733('0x34')]=qs[_0x1733('0x35')](_0x3829ea[_0x1733('0x2d')][_0x1733('0x35')]);_0x54981f[_0x1733('0x36')]=qs[_0x1733('0x43')](_[_0x1733('0x37')](_0x3829ea[_0x1733('0x2d')],_0x38786a['filters']));if(_0x3829ea[_0x1733('0x2d')][_0x1733('0x38')]){_0x54981f[_0x1733('0x36')]=_[_0x1733('0x39')](_0x54981f[_0x1733('0x36')],{'$or':_[_0x1733('0x2c')](_0x54981f['attributes'],function(_0x4e0e3e){var _0x465fe8={};_0x465fe8[_0x4e0e3e]={'$like':'%'+_0x3829ea[_0x1733('0x2d')][_0x1733('0x38')]+'%'};return _0x465fe8;})});}_0x54981f=_[_0x1733('0x39')]({},_0x54981f,_0x3829ea['options']);return _0x386973['getFields'](_0x54981f);}})[_0x1733('0x22')](function(_0x4d1b59){if(_0x4d1b59){_0x511cf1=_0x4d1b59[_0x1733('0x49')];if(!_0x3829ea[_0x1733('0x2d')][_0x1733('0x32')](_0x1733('0x33'))){_0x54981f[_0x1733('0x1a')]=qs[_0x1733('0x1a')](_0x3829ea[_0x1733('0x2d')]['limit']);_0x54981f['offset']=qs[_0x1733('0x1c')](_0x3829ea[_0x1733('0x2d')]['offset']);}return _0x386973[_0x1733('0x47')](_0x54981f);}})['then'](function(_0x333e9c){if(_0x333e9c){return _0x333e9c?{'count':_0x511cf1,'rows':_0x333e9c}:null;}})[_0x1733('0x22')](respondWithResult(_0x15f579,null))[_0x1733('0x40')](handleError(_0x15f579,null));};exports[_0x1733('0x4a')]=function(_0x3e4fde,_0x30de7a,_0x49defe){var _0x3c3622={};var _0x1c705b={};var _0x23155d;var _0x26ae09;return db[_0x1733('0x3c')][_0x1733('0x4b')]({'where':{'id':_0x3e4fde[_0x1733('0x42')]['id']}})[_0x1733('0x22')](handleEntityNotFound(_0x30de7a,null))[_0x1733('0x22')](function(_0x352e1c){if(_0x352e1c){_0x23155d=_0x352e1c;_0x1c705b[_0x1733('0x2b')]=_[_0x1733('0x2e')](db[_0x1733('0x48')]['rawAttributes']);_0x1c705b[_0x1733('0x2d')]=_[_0x1733('0x2e')](_0x3e4fde[_0x1733('0x2d')]);_0x1c705b[_0x1733('0x43')]=_[_0x1733('0x2f')](_0x1c705b[_0x1733('0x2b')],_0x1c705b['query']);_0x3c3622['attributes']=_[_0x1733('0x2f')](_0x1c705b[_0x1733('0x2b')],qs['fields'](_0x3e4fde['query'][_0x1733('0x31')]));_0x3c3622[_0x1733('0x30')]=_0x3c3622[_0x1733('0x30')][_0x1733('0x49')]?_0x3c3622['attributes']:_0x1c705b[_0x1733('0x2b')];_0x3c3622[_0x1733('0x34')]=qs['sort'](_0x3e4fde[_0x1733('0x2d')][_0x1733('0x35')]);_0x3c3622[_0x1733('0x36')]=qs[_0x1733('0x43')](_[_0x1733('0x37')](_0x3e4fde['query'],_0x1c705b[_0x1733('0x43')]));if(_0x3e4fde[_0x1733('0x2d')][_0x1733('0x38')]){_0x3c3622[_0x1733('0x36')]=_[_0x1733('0x39')](_0x3c3622[_0x1733('0x36')],{'$or':_[_0x1733('0x2c')](_0x3c3622['attributes'],function(_0xe32662){var _0x4ad96b={};_0x4ad96b[_0xe32662]={'$like':'%'+_0x3e4fde[_0x1733('0x2d')][_0x1733('0x38')]+'%'};return _0x4ad96b;})});}_0x3c3622=_[_0x1733('0x39')]({},_0x3c3622,_0x3e4fde['options']);return _0x23155d[_0x1733('0x4a')](_0x3c3622);}})['then'](function(_0x29edcd){if(_0x29edcd){_0x26ae09=_0x29edcd[_0x1733('0x49')];if(!_0x3e4fde[_0x1733('0x2d')][_0x1733('0x32')](_0x1733('0x33'))){_0x3c3622[_0x1733('0x1a')]=qs[_0x1733('0x1a')](_0x3e4fde[_0x1733('0x2d')][_0x1733('0x1a')]);_0x3c3622['offset']=qs[_0x1733('0x1c')](_0x3e4fde[_0x1733('0x2d')][_0x1733('0x1c')]);}return _0x23155d['getSubjects'](_0x3c3622);}})[_0x1733('0x22')](function(_0x494306){if(_0x494306){return _0x494306?{'count':_0x26ae09,'rows':_0x494306}:null;}})[_0x1733('0x22')](respondWithResult(_0x30de7a,null))['catch'](handleError(_0x30de7a,null));};exports[_0x1733('0x4c')]=function(_0x97e07a,_0x39da11,_0xc17f65){var _0x4df492={};var _0x1a8816={};var _0x551c04;var _0x2ee534;return db[_0x1733('0x3c')][_0x1733('0x4b')]({'where':{'id':_0x97e07a[_0x1733('0x42')]['id']}})[_0x1733('0x22')](handleEntityNotFound(_0x39da11,null))[_0x1733('0x22')](function(_0x35dbb1){if(_0x35dbb1){_0x551c04=_0x35dbb1;_0x1a8816[_0x1733('0x2b')]=_['keys'](db[_0x1733('0x48')]['rawAttributes']);_0x1a8816[_0x1733('0x2d')]=_[_0x1733('0x2e')](_0x97e07a['query']);_0x1a8816[_0x1733('0x43')]=_[_0x1733('0x2f')](_0x1a8816[_0x1733('0x2b')],_0x1a8816[_0x1733('0x2d')]);_0x4df492[_0x1733('0x30')]=_[_0x1733('0x2f')](_0x1a8816[_0x1733('0x2b')],qs[_0x1733('0x31')](_0x97e07a[_0x1733('0x2d')]['fields']));_0x4df492[_0x1733('0x30')]=_0x4df492[_0x1733('0x30')]['length']?_0x4df492[_0x1733('0x30')]:_0x1a8816[_0x1733('0x2b')];_0x4df492['order']=qs[_0x1733('0x35')](_0x97e07a[_0x1733('0x2d')][_0x1733('0x35')]);_0x4df492[_0x1733('0x36')]=qs[_0x1733('0x43')](_[_0x1733('0x37')](_0x97e07a[_0x1733('0x2d')],_0x1a8816[_0x1733('0x43')]));if(_0x97e07a['query']['filter']){_0x4df492[_0x1733('0x36')]=_[_0x1733('0x39')](_0x4df492['where'],{'$or':_[_0x1733('0x2c')](_0x4df492['attributes'],function(_0x169cde){var _0x10bf36={};_0x10bf36[_0x169cde]={'$like':'%'+_0x97e07a[_0x1733('0x2d')]['filter']+'%'};return _0x10bf36;})});}_0x4df492=_[_0x1733('0x39')]({},_0x4df492,_0x97e07a['options']);return _0x551c04['getDescriptions'](_0x4df492);}})['then'](function(_0x264cbb){if(_0x264cbb){_0x2ee534=_0x264cbb[_0x1733('0x49')];if(!_0x97e07a[_0x1733('0x2d')][_0x1733('0x32')]('nolimit')){_0x4df492[_0x1733('0x1a')]=qs[_0x1733('0x1a')](_0x97e07a[_0x1733('0x2d')][_0x1733('0x1a')]);_0x4df492[_0x1733('0x1c')]=qs[_0x1733('0x1c')](_0x97e07a[_0x1733('0x2d')][_0x1733('0x1c')]);}return _0x551c04[_0x1733('0x4c')](_0x4df492);}})[_0x1733('0x22')](function(_0x1c5354){if(_0x1c5354){return _0x1c5354?{'count':_0x2ee534,'rows':_0x1c5354}:null;}})[_0x1733('0x22')](respondWithResult(_0x39da11,null))['catch'](handleError(_0x39da11,null));};exports[_0x1733('0x4d')]=function(_0x464f23,_0x3ee952,_0x1301dd){var _0x162696={};var _0x46fd41={};var _0x11ba10;var _0x4b4149;return db['ZendeskConfiguration'][_0x1733('0x4b')]({'where':{'id':_0x464f23[_0x1733('0x42')]['id']}})[_0x1733('0x22')](handleEntityNotFound(_0x3ee952,null))[_0x1733('0x22')](function(_0x4271d8){if(_0x4271d8){_0x11ba10=_0x4271d8;_0x46fd41[_0x1733('0x2b')]=_[_0x1733('0x2e')](db[_0x1733('0x4e')]['rawAttributes']);_0x46fd41[_0x1733('0x2d')]=_['keys'](_0x464f23[_0x1733('0x2d')]);_0x46fd41[_0x1733('0x43')]=_[_0x1733('0x2f')](_0x46fd41[_0x1733('0x2b')],_0x46fd41['query']);_0x162696[_0x1733('0x30')]=_[_0x1733('0x2f')](_0x46fd41[_0x1733('0x2b')],qs[_0x1733('0x31')](_0x464f23[_0x1733('0x2d')][_0x1733('0x31')]));_0x162696[_0x1733('0x30')]=_0x162696['attributes'][_0x1733('0x49')]?_0x162696[_0x1733('0x30')]:_0x46fd41['model'];_0x162696[_0x1733('0x34')]=qs[_0x1733('0x35')](_0x464f23[_0x1733('0x2d')]['sort']);_0x162696['where']=qs[_0x1733('0x43')](_['pick'](_0x464f23[_0x1733('0x2d')],_0x46fd41['filters']));if(_0x464f23['query']['filter']){_0x162696['where']=_['merge'](_0x162696[_0x1733('0x36')],{'$or':_[_0x1733('0x2c')](_0x162696[_0x1733('0x30')],function(_0x498d88){var _0x4bd242={};_0x4bd242[_0x498d88]={'$like':'%'+_0x464f23['query']['filter']+'%'};return _0x4bd242;})});}_0x162696=_[_0x1733('0x39')]({},_0x162696,_0x464f23['options']);return _0x11ba10[_0x1733('0x4d')](_0x162696);}})[_0x1733('0x22')](function(_0x213baa){if(_0x213baa){_0x4b4149=_0x213baa['length'];if(!_0x464f23[_0x1733('0x2d')]['hasOwnProperty'](_0x1733('0x33'))){_0x162696[_0x1733('0x1a')]=qs[_0x1733('0x1a')](_0x464f23[_0x1733('0x2d')][_0x1733('0x1a')]);_0x162696[_0x1733('0x1c')]=qs[_0x1733('0x1c')](_0x464f23[_0x1733('0x2d')]['offset']);}return _0x11ba10[_0x1733('0x4d')](_0x162696);}})[_0x1733('0x22')](function(_0x18f815){if(_0x18f815){return _0x18f815?{'count':_0x4b4149,'rows':_0x18f815}:null;}})[_0x1733('0x22')](respondWithResult(_0x3ee952,null))['catch'](handleError(_0x3ee952,null));};exports[_0x1733('0x4f')]=function(_0x315c2b,_0xcd5830,_0x218b6c){if(_0x315c2b[_0x1733('0x45')]['id']){delete _0x315c2b[_0x1733('0x45')]['id'];}return db[_0x1733('0x3c')]['findOne']({'where':{'id':_0x315c2b[_0x1733('0x42')]['id']}})[_0x1733('0x22')](handleEntityNotFound(_0xcd5830,null))[_0x1733('0x22')](function(_0x3ef9e1){if(_0x3ef9e1){return _0x3ef9e1[_0x1733('0x4f')](_0x315c2b[_0x1733('0x45')][_0x1733('0x50')]||[]);}return null;})[_0x1733('0x22')](respondWithResult(_0xcd5830,null))[_0x1733('0x40')](handleError(_0xcd5830,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 3e3fd34..1520cab 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 _0xb10b=['api','moment','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','int_zendesk_configurations','lodash','../../config/logger'];(function(_0x49a57f,_0x405f38){var _0x2fa2a5=function(_0x359a98){while(--_0x359a98){_0x49a57f['push'](_0x49a57f['shift']());}};_0x2fa2a5(++_0x405f38);}(_0xb10b,0x12a));var _0xbb10=function(_0x5ec09b,_0x12d654){_0x5ec09b=_0x5ec09b-0x0;var _0x5a8482=_0xb10b[_0x5ec09b];return _0x5a8482;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ZendeskConfiguration',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1775=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','util'];(function(_0x45c9ec,_0xc40f0a){var _0x3b1a05=function(_0xc2fbb0){while(--_0xc2fbb0){_0x45c9ec['push'](_0x45c9ec['shift']());}};_0x3b1a05(++_0xc40f0a);}(_0x1775,0x1db));var _0x5177=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1775[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x5177('0x0'));var logger=require(_0x5177('0x1'))(_0x5177('0x2'));var moment=require(_0x5177('0x3'));var BPromise=require(_0x5177('0x4'));var rp=require(_0x5177('0x5'));var fs=require('fs');var path=require(_0x5177('0x6'));var rimraf=require(_0x5177('0x7'));var config=require(_0x5177('0x8'));var attributes=require(_0x5177('0x9'));module[_0x5177('0xa')]=function(_0x2c5c42,_0x153c1a){return _0x2c5c42[_0x5177('0xb')](_0x5177('0xc'),attributes,{'tableName':_0x5177('0xd'),'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 928feff..74ed3b0 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 _0x9000=['bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x32347b,_0x392dc4){var _0x19d0b9=function(_0x2da417){while(--_0x2da417){_0x32347b['push'](_0x32347b['shift']());}};_0x19d0b9(++_0x392dc4);}(_0x9000,0x128));var _0x0900=function(_0xb15182,_0x48d8fb){_0xb15182=_0xb15182-0x0;var _0x4a8749=_0x9000[_0xb15182];return _0x4a8749;};'use strict';var _=require(_0x0900('0x0'));var util=require(_0x0900('0x1'));var moment=require(_0x0900('0x2'));var BPromise=require(_0x0900('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0900('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0900('0x5'));var logger=require(_0x0900('0x6'))(_0x0900('0x7'));var config=require(_0x0900('0x8'));var jayson=require(_0x0900('0x9'));var client=jayson[_0x0900('0xa')][_0x0900('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2881af,_0x46c0da,_0x48595e){return new BPromise(function(_0x8fde8c,_0x1ff169){return client[_0x0900('0xc')](_0x2881af,_0x48595e)['then'](function(_0x5c946d){logger[_0x0900('0xd')](_0x0900('0xe'),_0x46c0da,_0x0900('0xf'));logger[_0x0900('0x10')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x46c0da,_0x0900('0xf'),JSON[_0x0900('0x11')](_0x5c946d));if(_0x5c946d['error']){if(_0x5c946d[_0x0900('0x12')][_0x0900('0x13')]===0x1f4){logger[_0x0900('0x12')](_0x0900('0xe'),_0x46c0da,_0x5c946d['error'][_0x0900('0x14')]);return _0x1ff169(_0x5c946d[_0x0900('0x12')]['message']);}logger['error'](_0x0900('0xe'),_0x46c0da,_0x5c946d[_0x0900('0x12')][_0x0900('0x14')]);return _0x8fde8c(_0x5c946d[_0x0900('0x12')][_0x0900('0x14')]);}else{logger[_0x0900('0xd')]('ZendeskConfiguration,\x20%s,\x20%s',_0x46c0da,'request\x20sent');_0x8fde8c(_0x5c946d[_0x0900('0x15')]['message']);}})[_0x0900('0x16')](function(_0x8f6579){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x46c0da,_0x8f6579);_0x1ff169(_0x8f6579);});});} \ No newline at end of file +var _0x84c6=['client','http','request','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3b0fc6,_0xee3377){var _0x1eee3c=function(_0x2c3a17){while(--_0x2c3a17){_0x3b0fc6['push'](_0x3b0fc6['shift']());}};_0x1eee3c(++_0xee3377);}(_0x84c6,0x1c4));var _0x684c=function(_0x4a28c4,_0x3927ba){_0x4a28c4=_0x4a28c4-0x0;var _0x3c2338=_0x84c6[_0x4a28c4];return _0x3c2338;};'use strict';var _=require('lodash');var util=require(_0x684c('0x0'));var moment=require(_0x684c('0x1'));var BPromise=require(_0x684c('0x2'));var rs=require(_0x684c('0x3'));var fs=require('fs');var Redis=require(_0x684c('0x4'));var db=require(_0x684c('0x5'))['db'];var utils=require(_0x684c('0x6'));var logger=require(_0x684c('0x7'))(_0x684c('0x8'));var config=require(_0x684c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x684c('0xa')][_0x684c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x101686,_0x1489d2,_0x275e6b){return new BPromise(function(_0x19f346,_0x6e068e){return client[_0x684c('0xc')](_0x101686,_0x275e6b)['then'](function(_0x334a0e){logger[_0x684c('0xd')](_0x684c('0xe'),_0x1489d2,_0x684c('0xf'));logger[_0x684c('0x10')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x1489d2,_0x684c('0xf'),JSON['stringify'](_0x334a0e));if(_0x334a0e[_0x684c('0x11')]){if(_0x334a0e[_0x684c('0x11')][_0x684c('0x12')]===0x1f4){logger[_0x684c('0x11')](_0x684c('0xe'),_0x1489d2,_0x334a0e[_0x684c('0x11')][_0x684c('0x13')]);return _0x6e068e(_0x334a0e[_0x684c('0x11')][_0x684c('0x13')]);}logger['error'](_0x684c('0xe'),_0x1489d2,_0x334a0e[_0x684c('0x11')]['message']);return _0x19f346(_0x334a0e['error']['message']);}else{logger[_0x684c('0xd')](_0x684c('0xe'),_0x1489d2,_0x684c('0xf'));_0x19f346(_0x334a0e[_0x684c('0x14')]['message']);}})['catch'](function(_0x352534){logger[_0x684c('0x11')](_0x684c('0xe'),_0x1489d2,_0x352534);_0x6e068e(_0x352534);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index f9f041d..c6cb7bf 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 _0xec2f=['index','/:id','show','post','isAuthenticated','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller'];(function(_0x3f8516,_0x1ca3b1){var _0x5abc9f=function(_0x2c2271){while(--_0x2c2271){_0x3f8516['push'](_0x3f8516['shift']());}};_0x5abc9f(++_0x1ca3b1);}(_0xec2f,0x107));var _0xfec2=function(_0x4c15e7,_0x4ad7f5){_0x4c15e7=_0x4c15e7-0x0;var _0x1f119a=_0xec2f[_0x4c15e7];return _0x1f119a;};'use strict';var multer=require(_0xfec2('0x0'));var util=require(_0xfec2('0x1'));var path=require(_0xfec2('0x2'));var timeout=require(_0xfec2('0x3'));var express=require(_0xfec2('0x4'));var router=express[_0xfec2('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xfec2('0x6'));var interaction=require(_0xfec2('0x7'));var config=require(_0xfec2('0x8'));var controller=require(_0xfec2('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xfec2('0xa')]);router['get'](_0xfec2('0xb'),auth['isAuthenticated'](),controller[_0xfec2('0xc')]);router[_0xfec2('0xd')]('/',auth[_0xfec2('0xe')](),controller[_0xfec2('0xf')]);router[_0xfec2('0x10')](_0xfec2('0xb'),auth[_0xfec2('0xe')](),controller[_0xfec2('0x11')]);router[_0xfec2('0x12')](_0xfec2('0xb'),auth[_0xfec2('0xe')](),controller[_0xfec2('0x13')]);module[_0xfec2('0x14')]=router; \ No newline at end of file +var _0xf2ca=['util','path','connect-timeout','Router','fs-extra','../../config/environment','get','/:id','isAuthenticated','show','put','update','delete','destroy','exports'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0xf2ca,0x78));var _0xaf2c=function(_0x37a0ab,_0x34b900){_0x37a0ab=_0x37a0ab-0x0;var _0x13ca1d=_0xf2ca[_0x37a0ab];return _0x13ca1d;};'use strict';var multer=require('multer');var util=require(_0xaf2c('0x0'));var path=require(_0xaf2c('0x1'));var timeout=require(_0xaf2c('0x2'));var express=require('express');var router=express[_0xaf2c('0x3')]();var fs_extra=require(_0xaf2c('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xaf2c('0x5'));var controller=require('./intZendeskField.controller');router[_0xaf2c('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xaf2c('0x7'),auth[_0xaf2c('0x8')](),controller[_0xaf2c('0x9')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xaf2c('0xa')](_0xaf2c('0x7'),auth[_0xaf2c('0x8')](),controller[_0xaf2c('0xb')]);router[_0xaf2c('0xc')](_0xaf2c('0x7'),auth[_0xaf2c('0x8')](),controller[_0xaf2c('0xd')]);module[_0xaf2c('0xe')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index fa8fa18..bccb35d 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 _0x8a1b=['keyValue','STRING','BOOLEAN','exports','ENUM','string','variable','customVariable'];(function(_0x14ac21,_0x11b137){var _0x3279d3=function(_0x27b1ef){while(--_0x27b1ef){_0x14ac21['push'](_0x14ac21['shift']());}};_0x3279d3(++_0x11b137);}(_0x8a1b,0xdb));var _0xb8a1=function(_0xa80c0c,_0x224bd7){_0xa80c0c=_0xa80c0c-0x0;var _0x5bc17c=_0x8a1b[_0xa80c0c];return _0x5bc17c;};'use strict';var Sequelize=require('sequelize');module[_0xb8a1('0x0')]={'type':{'type':Sequelize[_0xb8a1('0x1')](_0xb8a1('0x2'),_0xb8a1('0x3'),_0xb8a1('0x4'),_0xb8a1('0x5'),'picklist'),'defaultValue':_0xb8a1('0x2')},'content':{'type':Sequelize[_0xb8a1('0x6')]},'key':{'type':Sequelize[_0xb8a1('0x6')]},'keyType':{'type':Sequelize[_0xb8a1('0x1')](_0xb8a1('0x2'),_0xb8a1('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xb8a1('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xb8a1('0x6')]},'customField':{'type':Sequelize[_0xb8a1('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb8a1('0x6')]}}; \ No newline at end of file +var _0xcbbf=['string','variable','customVariable','keyValue','picklist','STRING','ENUM','BOOLEAN','sequelize'];(function(_0x50e97f,_0x1b09a0){var _0x599d0f=function(_0x210a71){while(--_0x210a71){_0x50e97f['push'](_0x50e97f['shift']());}};_0x599d0f(++_0x1b09a0);}(_0xcbbf,0x170));var _0xfcbb=function(_0x3bd750,_0x15f616){_0x3bd750=_0x3bd750-0x0;var _0x574288=_0xcbbf[_0x3bd750];return _0x574288;};'use strict';var Sequelize=require(_0xfcbb('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xfcbb('0x1'),_0xfcbb('0x2'),_0xfcbb('0x3'),_0xfcbb('0x4'),_0xfcbb('0x5')),'defaultValue':_0xfcbb('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xfcbb('0x6')]},'keyType':{'type':Sequelize[_0xfcbb('0x7')]('string',_0xfcbb('0x2'),_0xfcbb('0x3'))},'keyContent':{'type':Sequelize[_0xfcbb('0x6')]},'idField':{'type':Sequelize[_0xfcbb('0x6')]},'nameField':{'type':Sequelize[_0xfcbb('0x6')]},'customField':{'type':Sequelize[_0xfcbb('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xfcbb('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 2add6ec..9590da0 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 _0x0178=['bluebird','mustache','util','sox','to-csv','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','Content-Range','reject','save','update','destroy','then','error','stack','name','send','map','ZendeskField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','rows','catch','show','params','create','body','find','eml-format','fast-json-patch','request-promise','moment'];(function(_0x18b344,_0x271f68){var _0x5ef6bb=function(_0x3345b3){while(--_0x3345b3){_0x18b344['push'](_0x18b344['shift']());}};_0x5ef6bb(++_0x271f68);}(_0x0178,0x1e6));var _0x8017=function(_0x40db6c,_0x1a9e7c){_0x40db6c=_0x40db6c-0x0;var _0x558787=_0x0178[_0x40db6c];return _0x558787;};'use strict';var emlformat=require(_0x8017('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8017('0x1'));var rp=require(_0x8017('0x2'));var moment=require(_0x8017('0x3'));var BPromise=require(_0x8017('0x4'));var Mustache=require(_0x8017('0x5'));var util=require(_0x8017('0x6'));var path=require('path');var sox=require(_0x8017('0x7'));var csv=require(_0x8017('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8017('0x9'));var crypto=require(_0x8017('0xa'));var jsforce=require(_0x8017('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x8017('0x8'));var querystring=require(_0x8017('0xc'));var Papa=require(_0x8017('0xd'));var Redis=require(_0x8017('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x8017('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8017('0x10'))('api');var utils=require(_0x8017('0x11'));var config=require(_0x8017('0x12'));var licenseUtil=require(_0x8017('0x13'));var db=require(_0x8017('0x14'))['db'];function respondWithStatusCode(_0x2fc6b0,_0x3b935e){_0x3b935e=_0x3b935e||0xcc;return function(_0x5cbad6){if(_0x5cbad6){return _0x2fc6b0[_0x8017('0x15')](_0x3b935e);}return _0x2fc6b0[_0x8017('0x16')](_0x3b935e)[_0x8017('0x17')]();};}function respondWithResult(_0x4d01d0,_0x38ef49){_0x38ef49=_0x38ef49||0xc8;return function(_0x444981){if(_0x444981){return _0x4d01d0['status'](_0x38ef49)['json'](_0x444981);}};}function respondWithFilteredResult(_0x33d6f4,_0x2fd97a){return function(_0x3d7bda){if(_0x3d7bda){var _0x142760=typeof _0x2fd97a[_0x8017('0x18')]==='undefined'&&typeof _0x2fd97a['limit']===_0x8017('0x19');var _0x38458c=_0x3d7bda[_0x8017('0x1a')];var _0x1538e6=_0x142760?0x0:_0x2fd97a[_0x8017('0x18')];var _0x1f5c5c=_0x142760?_0x3d7bda[_0x8017('0x1a')]:_0x2fd97a[_0x8017('0x18')]+_0x2fd97a['limit'];var _0x9414d5;if(_0x1f5c5c>=_0x38458c){_0x1f5c5c=_0x38458c;_0x9414d5=0xc8;}else{_0x9414d5=0xce;}_0x33d6f4[_0x8017('0x16')](_0x9414d5);return _0x33d6f4['set'](_0x8017('0x1b'),_0x1538e6+'-'+_0x1f5c5c+'/'+_0x38458c)['json'](_0x3d7bda);}return null;};}function patchUpdates(_0x5ef30b){return function(_0x2a5d2b){try{jsonpatch['apply'](_0x2a5d2b,_0x5ef30b,!![]);}catch(_0x1f9d9a){return BPromise[_0x8017('0x1c')](_0x1f9d9a);}return _0x2a5d2b[_0x8017('0x1d')]();};}function saveUpdates(_0x6444f,_0x2ea88a){return function(_0x358523){if(_0x358523){return _0x358523[_0x8017('0x1e')](_0x6444f)['then'](function(_0x562d63){return _0x562d63;});}return null;};}function removeEntity(_0x972b95,_0x1f7386){return function(_0x31f849){if(_0x31f849){return _0x31f849[_0x8017('0x1f')]()[_0x8017('0x20')](function(){_0x972b95[_0x8017('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f12ff,_0x816371){return function(_0x3f9e06){if(!_0x3f9e06){_0x1f12ff[_0x8017('0x15')](0x194);}return _0x3f9e06;};}function handleError(_0x66d0a5,_0x446c73){_0x446c73=_0x446c73||0x1f4;return function(_0x23b723){logger[_0x8017('0x21')](_0x23b723[_0x8017('0x22')]);if(_0x23b723[_0x8017('0x23')]){delete _0x23b723[_0x8017('0x23')];}_0x66d0a5[_0x8017('0x16')](_0x446c73)[_0x8017('0x24')](_0x23b723);};}exports['index']=function(_0x1b4596,_0xe4eef0){var _0x34408a={},_0x556708={},_0x306814={'count':0x0,'rows':[]};var _0x185ff5=_[_0x8017('0x25')](db[_0x8017('0x26')][_0x8017('0x27')],function(_0x45c82c){return{'name':_0x45c82c[_0x8017('0x28')],'type':_0x45c82c[_0x8017('0x29')][_0x8017('0x2a')]};});_0x556708['model']=_[_0x8017('0x25')](_0x185ff5,'name');_0x556708[_0x8017('0x2b')]=_[_0x8017('0x2c')](_0x1b4596[_0x8017('0x2b')]);_0x556708[_0x8017('0x2d')]=_[_0x8017('0x2e')](_0x556708['model'],_0x556708[_0x8017('0x2b')]);_0x34408a[_0x8017('0x2f')]=_[_0x8017('0x2e')](_0x556708[_0x8017('0x30')],qs[_0x8017('0x31')](_0x1b4596['query'][_0x8017('0x31')]));_0x34408a[_0x8017('0x2f')]=_0x34408a['attributes'][_0x8017('0x32')]?_0x34408a[_0x8017('0x2f')]:_0x556708['model'];if(!_0x1b4596['query'][_0x8017('0x33')](_0x8017('0x34'))){_0x34408a[_0x8017('0x35')]=qs[_0x8017('0x35')](_0x1b4596[_0x8017('0x2b')]['limit']);_0x34408a['offset']=qs['offset'](_0x1b4596[_0x8017('0x2b')][_0x8017('0x18')]);}_0x34408a[_0x8017('0x36')]=qs[_0x8017('0x37')](_0x1b4596[_0x8017('0x2b')][_0x8017('0x37')]);_0x34408a['where']=qs[_0x8017('0x2d')](_[_0x8017('0x38')](_0x1b4596[_0x8017('0x2b')],_0x556708[_0x8017('0x2d')]),_0x185ff5);if(_0x1b4596[_0x8017('0x2b')][_0x8017('0x39')]){_0x34408a[_0x8017('0x3a')]=_[_0x8017('0x3b')](_0x34408a[_0x8017('0x3a')],{'$or':_['map'](_0x185ff5,function(_0x4aa69c){if(_0x4aa69c[_0x8017('0x29')]!==_0x8017('0x3c')){var _0x5281e9={};_0x5281e9[_0x4aa69c['name']]={'$like':'%'+_0x1b4596[_0x8017('0x2b')][_0x8017('0x39')]+'%'};return _0x5281e9;}})});}_0x34408a=_[_0x8017('0x3b')]({},_0x34408a,_0x1b4596[_0x8017('0x3d')]);var _0x1a5da6={'where':_0x34408a['where']};return db[_0x8017('0x26')][_0x8017('0x1a')](_0x1a5da6)[_0x8017('0x20')](function(_0x25a04b){_0x306814[_0x8017('0x1a')]=_0x25a04b;if(_0x1b4596[_0x8017('0x2b')][_0x8017('0x3e')]){_0x34408a['include']=[{'all':!![]}];}return db[_0x8017('0x26')]['findAll'](_0x34408a);})[_0x8017('0x20')](function(_0x2ba6af){_0x306814[_0x8017('0x3f')]=_0x2ba6af;return _0x306814;})[_0x8017('0x20')](respondWithFilteredResult(_0xe4eef0,_0x34408a))[_0x8017('0x40')](handleError(_0xe4eef0,null));};exports[_0x8017('0x41')]=function(_0x2a879b,_0x5ae262){var _0x5e97ce={'raw':!![],'where':{'id':_0x2a879b[_0x8017('0x42')]['id']}},_0x234d00={};_0x234d00[_0x8017('0x30')]=_[_0x8017('0x2c')](db[_0x8017('0x26')][_0x8017('0x27')]);_0x234d00[_0x8017('0x2b')]=_[_0x8017('0x2c')](_0x2a879b['query']);_0x234d00['filters']=_[_0x8017('0x2e')](_0x234d00['model'],_0x234d00['query']);_0x5e97ce[_0x8017('0x2f')]=_[_0x8017('0x2e')](_0x234d00[_0x8017('0x30')],qs[_0x8017('0x31')](_0x2a879b[_0x8017('0x2b')][_0x8017('0x31')]));_0x5e97ce[_0x8017('0x2f')]=_0x5e97ce[_0x8017('0x2f')][_0x8017('0x32')]?_0x5e97ce[_0x8017('0x2f')]:_0x234d00[_0x8017('0x30')];if(_0x2a879b['query'][_0x8017('0x3e')]){_0x5e97ce['include']=[{'all':!![]}];}_0x5e97ce=_[_0x8017('0x3b')]({},_0x5e97ce,_0x2a879b[_0x8017('0x3d')]);return db[_0x8017('0x26')]['find'](_0x5e97ce)[_0x8017('0x20')](handleEntityNotFound(_0x5ae262,null))[_0x8017('0x20')](respondWithResult(_0x5ae262,null))[_0x8017('0x40')](handleError(_0x5ae262,null));};exports[_0x8017('0x43')]=function(_0x514a51,_0x407387){return db[_0x8017('0x26')]['create'](_0x514a51['body'],{})[_0x8017('0x20')](respondWithResult(_0x407387,0xc9))[_0x8017('0x40')](handleError(_0x407387,null));};exports[_0x8017('0x1e')]=function(_0x271cf6,_0x417031){if(_0x271cf6[_0x8017('0x44')]['id']){delete _0x271cf6[_0x8017('0x44')]['id'];}return db[_0x8017('0x26')][_0x8017('0x45')]({'where':{'id':_0x271cf6[_0x8017('0x42')]['id']}})['then'](handleEntityNotFound(_0x417031,null))[_0x8017('0x20')](saveUpdates(_0x271cf6[_0x8017('0x44')],null))[_0x8017('0x20')](respondWithResult(_0x417031,null))[_0x8017('0x40')](handleError(_0x417031,null));};exports[_0x8017('0x1f')]=function(_0x2f03dc,_0x3440cb){return db[_0x8017('0x26')]['find']({'where':{'id':_0x2f03dc[_0x8017('0x42')]['id']}})['then'](handleEntityNotFound(_0x3440cb,null))[_0x8017('0x20')](removeEntity(_0x3440cb,null))[_0x8017('0x40')](handleError(_0x3440cb,null));}; \ No newline at end of file +var _0x8e94=['then','end','stack','name','send','index','map','ZendeskField','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','show','params','length','options','find','create','body','catch','eml-format','rimraf','fast-json-patch','moment','mustache','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy'];(function(_0x1d16dc,_0x452b61){var _0x2e68b8=function(_0x41dd7f){while(--_0x41dd7f){_0x1d16dc['push'](_0x1d16dc['shift']());}};_0x2e68b8(++_0x452b61);}(_0x8e94,0xf8));var _0x48e9=function(_0x26a818,_0x40708a){_0x26a818=_0x26a818-0x0;var _0x5d8ca0=_0x8e94[_0x26a818];return _0x5d8ca0;};'use strict';var emlformat=require(_0x48e9('0x0'));var rimraf=require(_0x48e9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x48e9('0x2'));var rp=require('request-promise');var moment=require(_0x48e9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x48e9('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x48e9('0x5'));var ejs=require(_0x48e9('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x48e9('0x7'));var squel=require('squel');var crypto=require(_0x48e9('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x48e9('0x9'));var toCsv=require(_0x48e9('0x5'));var querystring=require(_0x48e9('0xa'));var Papa=require(_0x48e9('0xb'));var Redis=require('ioredis');var authService=require(_0x48e9('0xc'));var qs=require(_0x48e9('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x48e9('0xe'));var logger=require('../../config/logger')(_0x48e9('0xf'));var utils=require(_0x48e9('0x10'));var config=require(_0x48e9('0x11'));var licenseUtil=require(_0x48e9('0x12'));var db=require(_0x48e9('0x13'))['db'];function respondWithStatusCode(_0x956ebd,_0x567600){_0x567600=_0x567600||0xcc;return function(_0x28fcc0){if(_0x28fcc0){return _0x956ebd[_0x48e9('0x14')](_0x567600);}return _0x956ebd[_0x48e9('0x15')](_0x567600)['end']();};}function respondWithResult(_0x49ef9b,_0x38ee14){_0x38ee14=_0x38ee14||0xc8;return function(_0x29bb11){if(_0x29bb11){return _0x49ef9b[_0x48e9('0x15')](_0x38ee14)[_0x48e9('0x16')](_0x29bb11);}};}function respondWithFilteredResult(_0x1a5fd6,_0x18f318){return function(_0x421862){if(_0x421862){var _0x223884=typeof _0x18f318[_0x48e9('0x17')]===_0x48e9('0x18')&&typeof _0x18f318[_0x48e9('0x19')]===_0x48e9('0x18');var _0x5a7470=_0x421862[_0x48e9('0x1a')];var _0x421508=_0x223884?0x0:_0x18f318[_0x48e9('0x17')];var _0x51ab2d=_0x223884?_0x421862[_0x48e9('0x1a')]:_0x18f318[_0x48e9('0x17')]+_0x18f318[_0x48e9('0x19')];var _0xc7f638;if(_0x51ab2d>=_0x5a7470){_0x51ab2d=_0x5a7470;_0xc7f638=0xc8;}else{_0xc7f638=0xce;}_0x1a5fd6[_0x48e9('0x15')](_0xc7f638);return _0x1a5fd6[_0x48e9('0x1b')](_0x48e9('0x1c'),_0x421508+'-'+_0x51ab2d+'/'+_0x5a7470)[_0x48e9('0x16')](_0x421862);}return null;};}function patchUpdates(_0x54f07d){return function(_0x351fc5){try{jsonpatch[_0x48e9('0x1d')](_0x351fc5,_0x54f07d,!![]);}catch(_0xe985e6){return BPromise['reject'](_0xe985e6);}return _0x351fc5['save']();};}function saveUpdates(_0x1501ab,_0x5fa95d){return function(_0x422d40){if(_0x422d40){return _0x422d40[_0x48e9('0x1e')](_0x1501ab)['then'](function(_0x2c864d){return _0x2c864d;});}return null;};}function removeEntity(_0x27a61a,_0x56f782){return function(_0x2035dd){if(_0x2035dd){return _0x2035dd[_0x48e9('0x1f')]()[_0x48e9('0x20')](function(){_0x27a61a['status'](0xcc)[_0x48e9('0x21')]();});}};}function handleEntityNotFound(_0x361bff,_0x502d3d){return function(_0x588daa){if(!_0x588daa){_0x361bff['sendStatus'](0x194);}return _0x588daa;};}function handleError(_0x4e2e95,_0x338aa9){_0x338aa9=_0x338aa9||0x1f4;return function(_0x1ac2e8){logger['error'](_0x1ac2e8[_0x48e9('0x22')]);if(_0x1ac2e8[_0x48e9('0x23')]){delete _0x1ac2e8['name'];}_0x4e2e95[_0x48e9('0x15')](_0x338aa9)[_0x48e9('0x24')](_0x1ac2e8);};}exports[_0x48e9('0x25')]=function(_0x2fe15b,_0x976ae1){var _0x5565c5={},_0x64c551={},_0x3f7196={'count':0x0,'rows':[]};var _0x5e37aa=_[_0x48e9('0x26')](db[_0x48e9('0x27')][_0x48e9('0x28')],function(_0x509be8){return{'name':_0x509be8[_0x48e9('0x29')],'type':_0x509be8['type'][_0x48e9('0x2a')]};});_0x64c551[_0x48e9('0x2b')]=_[_0x48e9('0x26')](_0x5e37aa,_0x48e9('0x23'));_0x64c551[_0x48e9('0x2c')]=_[_0x48e9('0x2d')](_0x2fe15b[_0x48e9('0x2c')]);_0x64c551[_0x48e9('0x2e')]=_[_0x48e9('0x2f')](_0x64c551[_0x48e9('0x2b')],_0x64c551[_0x48e9('0x2c')]);_0x5565c5['attributes']=_['intersection'](_0x64c551[_0x48e9('0x2b')],qs[_0x48e9('0x30')](_0x2fe15b['query']['fields']));_0x5565c5[_0x48e9('0x31')]=_0x5565c5[_0x48e9('0x31')]['length']?_0x5565c5[_0x48e9('0x31')]:_0x64c551[_0x48e9('0x2b')];if(!_0x2fe15b['query'][_0x48e9('0x32')](_0x48e9('0x33'))){_0x5565c5['limit']=qs[_0x48e9('0x19')](_0x2fe15b[_0x48e9('0x2c')][_0x48e9('0x19')]);_0x5565c5[_0x48e9('0x17')]=qs[_0x48e9('0x17')](_0x2fe15b[_0x48e9('0x2c')]['offset']);}_0x5565c5[_0x48e9('0x34')]=qs[_0x48e9('0x35')](_0x2fe15b[_0x48e9('0x2c')][_0x48e9('0x35')]);_0x5565c5[_0x48e9('0x36')]=qs[_0x48e9('0x2e')](_[_0x48e9('0x37')](_0x2fe15b[_0x48e9('0x2c')],_0x64c551[_0x48e9('0x2e')]),_0x5e37aa);if(_0x2fe15b[_0x48e9('0x2c')][_0x48e9('0x38')]){_0x5565c5['where']=_[_0x48e9('0x39')](_0x5565c5[_0x48e9('0x36')],{'$or':_[_0x48e9('0x26')](_0x5e37aa,function(_0x155c4e){if(_0x155c4e['type']!==_0x48e9('0x3a')){var _0x44f4ab={};_0x44f4ab[_0x155c4e[_0x48e9('0x23')]]={'$like':'%'+_0x2fe15b[_0x48e9('0x2c')][_0x48e9('0x38')]+'%'};return _0x44f4ab;}})});}_0x5565c5=_[_0x48e9('0x39')]({},_0x5565c5,_0x2fe15b['options']);var _0x5de597={'where':_0x5565c5[_0x48e9('0x36')]};return db[_0x48e9('0x27')][_0x48e9('0x1a')](_0x5de597)[_0x48e9('0x20')](function(_0x3411c0){_0x3f7196[_0x48e9('0x1a')]=_0x3411c0;if(_0x2fe15b['query'][_0x48e9('0x3b')]){_0x5565c5[_0x48e9('0x3c')]=[{'all':!![]}];}return db[_0x48e9('0x27')]['findAll'](_0x5565c5);})[_0x48e9('0x20')](function(_0x83154c){_0x3f7196[_0x48e9('0x3d')]=_0x83154c;return _0x3f7196;})[_0x48e9('0x20')](respondWithFilteredResult(_0x976ae1,_0x5565c5))['catch'](handleError(_0x976ae1,null));};exports[_0x48e9('0x3e')]=function(_0xf85bf1,_0xf34683){var _0x133fa5={'raw':!![],'where':{'id':_0xf85bf1[_0x48e9('0x3f')]['id']}},_0x24fcce={};_0x24fcce[_0x48e9('0x2b')]=_[_0x48e9('0x2d')](db[_0x48e9('0x27')][_0x48e9('0x28')]);_0x24fcce[_0x48e9('0x2c')]=_['keys'](_0xf85bf1['query']);_0x24fcce[_0x48e9('0x2e')]=_[_0x48e9('0x2f')](_0x24fcce['model'],_0x24fcce[_0x48e9('0x2c')]);_0x133fa5[_0x48e9('0x31')]=_[_0x48e9('0x2f')](_0x24fcce[_0x48e9('0x2b')],qs[_0x48e9('0x30')](_0xf85bf1[_0x48e9('0x2c')][_0x48e9('0x30')]));_0x133fa5[_0x48e9('0x31')]=_0x133fa5['attributes'][_0x48e9('0x40')]?_0x133fa5[_0x48e9('0x31')]:_0x24fcce[_0x48e9('0x2b')];if(_0xf85bf1[_0x48e9('0x2c')]['includeAll']){_0x133fa5['include']=[{'all':!![]}];}_0x133fa5=_[_0x48e9('0x39')]({},_0x133fa5,_0xf85bf1[_0x48e9('0x41')]);return db[_0x48e9('0x27')][_0x48e9('0x42')](_0x133fa5)[_0x48e9('0x20')](handleEntityNotFound(_0xf34683,null))[_0x48e9('0x20')](respondWithResult(_0xf34683,null))['catch'](handleError(_0xf34683,null));};exports[_0x48e9('0x43')]=function(_0x12b347,_0x172bad){return db[_0x48e9('0x27')][_0x48e9('0x43')](_0x12b347[_0x48e9('0x44')],{})[_0x48e9('0x20')](respondWithResult(_0x172bad,0xc9))[_0x48e9('0x45')](handleError(_0x172bad,null));};exports[_0x48e9('0x1e')]=function(_0x2ef1b7,_0x1ba6a0){if(_0x2ef1b7[_0x48e9('0x44')]['id']){delete _0x2ef1b7['body']['id'];}return db[_0x48e9('0x27')]['find']({'where':{'id':_0x2ef1b7[_0x48e9('0x3f')]['id']}})[_0x48e9('0x20')](handleEntityNotFound(_0x1ba6a0,null))[_0x48e9('0x20')](saveUpdates(_0x2ef1b7[_0x48e9('0x44')],null))['then'](respondWithResult(_0x1ba6a0,null))[_0x48e9('0x45')](handleError(_0x1ba6a0,null));};exports[_0x48e9('0x1f')]=function(_0x36dc16,_0x1a727b){return db[_0x48e9('0x27')]['find']({'where':{'id':_0x36dc16[_0x48e9('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1a727b,null))[_0x48e9('0x20')](removeEntity(_0x1a727b,null))[_0x48e9('0x45')](handleError(_0x1a727b,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 118552c..e7037fc 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 _0x6502=['FieldId','api','moment','bluebird','rimraf','../../config/environment','define','idField'];(function(_0x1e6df9,_0x11a066){var _0x33f303=function(_0x44759f){while(--_0x44759f){_0x1e6df9['push'](_0x1e6df9['shift']());}};_0x33f303(++_0x11a066);}(_0x6502,0x109));var _0x2650=function(_0xe5a818,_0x4c97b2){_0xe5a818=_0xe5a818-0x0;var _0x136863=_0x6502[_0xe5a818];return _0x136863;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x2650('0x0'));var moment=require(_0x2650('0x1'));var BPromise=require(_0x2650('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2650('0x3'));var config=require(_0x2650('0x4'));var attributes=require('./intZendeskField.attributes');module['exports']=function(_0x171ab2,_0x55e636){return _0x171ab2[_0x2650('0x5')]('ZendeskField',attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0x2650('0x6'),_0x2650('0x7')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb650=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','lodash','util','../../config/logger','api'];(function(_0xcdf6cc,_0x25af05){var _0x39fbfb=function(_0x623e74){while(--_0x623e74){_0xcdf6cc['push'](_0xcdf6cc['shift']());}};_0x39fbfb(++_0x25af05);}(_0xb650,0xb7));var _0x0b65=function(_0xcb0ff2,_0xebce23){_0xcb0ff2=_0xcb0ff2-0x0;var _0x544e99=_0xb650[_0xcb0ff2];return _0x544e99;};'use strict';var _=require(_0x0b65('0x0'));var util=require(_0x0b65('0x1'));var logger=require(_0x0b65('0x2'))(_0x0b65('0x3'));var moment=require(_0x0b65('0x4'));var BPromise=require(_0x0b65('0x5'));var rp=require(_0x0b65('0x6'));var fs=require('fs');var path=require(_0x0b65('0x7'));var rimraf=require(_0x0b65('0x8'));var config=require(_0x0b65('0x9'));var attributes=require(_0x0b65('0xa'));module[_0x0b65('0xb')]=function(_0x439636,_0x4b358d){return _0x439636[_0x0b65('0xc')](_0x0b65('0xd'),attributes,{'tableName':_0x0b65('0xe'),'paranoid':![],'indexes':[{'name':_0x0b65('0xf'),'fields':[_0x0b65('0x10'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index 43cd5f1..e13b026 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 _0x696b=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','util','moment'];(function(_0x2d914f,_0x151651){var _0x1015a1=function(_0x373537){while(--_0x373537){_0x2d914f['push'](_0x2d914f['shift']());}};_0x1015a1(++_0x151651);}(_0x696b,0x7c));var _0xb696=function(_0x368933,_0x2a1855){_0x368933=_0x368933-0x0;var _0x3a46fb=_0x696b[_0x368933];return _0x3a46fb;};'use strict';var _=require('lodash');var util=require(_0xb696('0x0'));var moment=require(_0xb696('0x1'));var BPromise=require(_0xb696('0x2'));var rs=require(_0xb696('0x3'));var fs=require('fs');var Redis=require(_0xb696('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb696('0x5'));var logger=require(_0xb696('0x6'))('rpc');var config=require(_0xb696('0x7'));var jayson=require(_0xb696('0x8'));var client=jayson[_0xb696('0x9')][_0xb696('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a5990,_0x1c11c3,_0x1cdc59){return new BPromise(function(_0x37d3be,_0x26ac5a){return client['request'](_0x2a5990,_0x1cdc59)[_0xb696('0xb')](function(_0x194f66){logger[_0xb696('0xc')](_0xb696('0xd'),_0x1c11c3,_0xb696('0xe'));logger[_0xb696('0xf')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x1c11c3,'request\x20sent',JSON[_0xb696('0x10')](_0x194f66));if(_0x194f66[_0xb696('0x11')]){if(_0x194f66[_0xb696('0x11')]['code']===0x1f4){logger[_0xb696('0x11')]('ZendeskField,\x20%s,\x20%s',_0x1c11c3,_0x194f66[_0xb696('0x11')][_0xb696('0x12')]);return _0x26ac5a(_0x194f66[_0xb696('0x11')]['message']);}logger[_0xb696('0x11')](_0xb696('0xd'),_0x1c11c3,_0x194f66['error'][_0xb696('0x12')]);return _0x37d3be(_0x194f66[_0xb696('0x11')][_0xb696('0x12')]);}else{logger[_0xb696('0xc')]('ZendeskField,\x20%s,\x20%s',_0x1c11c3,_0xb696('0xe'));_0x37d3be(_0x194f66[_0xb696('0x13')][_0xb696('0x12')]);}})[_0xb696('0x14')](function(_0x3501ec){logger[_0xb696('0x11')](_0xb696('0xd'),_0x1c11c3,_0x3501ec);_0x26ac5a(_0x3501ec);});});} \ No newline at end of file +var _0x0898=['request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','rpc','jayson/promise','client','http','request','then','info','ZendeskField,\x20%s,\x20%s'];(function(_0x2adb63,_0x25666a){var _0x128939=function(_0x5f5c52){while(--_0x5f5c52){_0x2adb63['push'](_0x2adb63['shift']());}};_0x128939(++_0x25666a);}(_0x0898,0x1ac));var _0x8089=function(_0x103553,_0x1ae77d){_0x103553=_0x103553-0x0;var _0x4540fa=_0x0898[_0x103553];return _0x4540fa;};'use strict';var _=require(_0x8089('0x0'));var util=require(_0x8089('0x1'));var moment=require('moment');var BPromise=require(_0x8089('0x2'));var rs=require(_0x8089('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8089('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8089('0x5'));var config=require('../../config/environment');var jayson=require(_0x8089('0x6'));var client=jayson[_0x8089('0x7')][_0x8089('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x13d586,_0x567cc6,_0x2b4b05){return new BPromise(function(_0x5a8da7,_0xce3dbd){return client[_0x8089('0x9')](_0x13d586,_0x2b4b05)[_0x8089('0xa')](function(_0x1c9c8a){logger[_0x8089('0xb')](_0x8089('0xc'),_0x567cc6,_0x8089('0xd'));logger[_0x8089('0xe')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x567cc6,_0x8089('0xd'),JSON[_0x8089('0xf')](_0x1c9c8a));if(_0x1c9c8a[_0x8089('0x10')]){if(_0x1c9c8a[_0x8089('0x10')][_0x8089('0x11')]===0x1f4){logger['error']('ZendeskField,\x20%s,\x20%s',_0x567cc6,_0x1c9c8a['error'][_0x8089('0x12')]);return _0xce3dbd(_0x1c9c8a[_0x8089('0x10')][_0x8089('0x12')]);}logger[_0x8089('0x10')](_0x8089('0xc'),_0x567cc6,_0x1c9c8a[_0x8089('0x10')]['message']);return _0x5a8da7(_0x1c9c8a[_0x8089('0x10')]['message']);}else{logger[_0x8089('0xb')]('ZendeskField,\x20%s,\x20%s',_0x567cc6,_0x8089('0xd'));_0x5a8da7(_0x1c9c8a[_0x8089('0x13')][_0x8089('0x12')]);}})[_0x8089('0x14')](function(_0x414bca){logger[_0x8089('0x10')]('ZendeskField,\x20%s,\x20%s',_0x567cc6,_0x414bca);_0xce3dbd(_0x414bca);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index c92e808..ea016db 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 _0xd4a8=['../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0xd4a8,0x19e));var _0x8d4a=function(_0x51c539,_0x3807d4){_0x51c539=_0x51c539-0x0;var _0x3c989b=_0xd4a8[_0x51c539];return _0x3c989b;};'use strict';var multer=require(_0x8d4a('0x0'));var util=require(_0x8d4a('0x1'));var path=require(_0x8d4a('0x2'));var timeout=require(_0x8d4a('0x3'));var express=require(_0x8d4a('0x4'));var router=express[_0x8d4a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8d4a('0x6'));var config=require('../../config/environment');var controller=require('./intZohoAccount.controller');router[_0x8d4a('0x7')]('/',auth[_0x8d4a('0x8')](),controller[_0x8d4a('0x9')]);router[_0x8d4a('0x7')](_0x8d4a('0xa'),auth[_0x8d4a('0x8')](),controller[_0x8d4a('0xb')]);router[_0x8d4a('0x7')](_0x8d4a('0xc'),auth[_0x8d4a('0x8')](),controller[_0x8d4a('0xd')]);router['get'](_0x8d4a('0xe'),auth[_0x8d4a('0x8')](),controller[_0x8d4a('0xf')]);router[_0x8d4a('0x10')]('/',auth[_0x8d4a('0x8')](),controller[_0x8d4a('0x11')]);router[_0x8d4a('0x10')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x8d4a('0x12')]);router[_0x8d4a('0x13')](_0x8d4a('0xa'),auth[_0x8d4a('0x8')](),controller['update']);router['delete'](_0x8d4a('0xa'),auth[_0x8d4a('0x8')](),controller['destroy']);module[_0x8d4a('0x14')]=router; \ No newline at end of file +var _0x99e2=['/:id/fields','getFields','post','addConfiguration','put','delete','destroy','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations'];(function(_0x884bbd,_0x20947){var _0x2c9034=function(_0x203d0a){while(--_0x203d0a){_0x884bbd['push'](_0x884bbd['shift']());}};_0x2c9034(++_0x20947);}(_0x99e2,0x13c));var _0x299e=function(_0x5429af,_0x28b710){_0x5429af=_0x5429af-0x0;var _0x288a7a=_0x99e2[_0x5429af];return _0x288a7a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x299e('0x0'));var timeout=require(_0x299e('0x1'));var express=require(_0x299e('0x2'));var router=express['Router']();var fs_extra=require(_0x299e('0x3'));var auth=require(_0x299e('0x4'));var interaction=require(_0x299e('0x5'));var config=require(_0x299e('0x6'));var controller=require(_0x299e('0x7'));router[_0x299e('0x8')]('/',auth[_0x299e('0x9')](),controller[_0x299e('0xa')]);router[_0x299e('0x8')](_0x299e('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x299e('0x8')](_0x299e('0xc'),auth['isAuthenticated'](),controller[_0x299e('0xd')]);router['get'](_0x299e('0xe'),auth[_0x299e('0x9')](),controller[_0x299e('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x299e('0x10')](_0x299e('0xc'),auth[_0x299e('0x9')](),controller[_0x299e('0x11')]);router[_0x299e('0x12')](_0x299e('0xb'),auth[_0x299e('0x9')](),controller['update']);router[_0x299e('0x13')](_0x299e('0xb'),auth['isAuthenticated'](),controller[_0x299e('0x14')]);module[_0x299e('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 54b88f6..6a46354 100644 --- a/server/api/intZohoAccount/intZohoAccount.attributes.js +++ b/server/api/intZohoAccount/intZohoAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9bde=['STRING','exports'];(function(_0x313df3,_0x4fca45){var _0x241d59=function(_0x452786){while(--_0x452786){_0x313df3['push'](_0x313df3['shift']());}};_0x241d59(++_0x4fca45);}(_0x9bde,0xe1));var _0xe9bd=function(_0x137b66,_0x4ea5f4){_0x137b66=_0x137b66-0x0;var _0x47e926=_0x9bde[_0x137b66];return _0x47e926;};'use strict';var Sequelize=require('sequelize');module[_0xe9bd('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe9bd('0x1')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0xe9bd('0x1')]},'clientId':{'type':Sequelize[_0xe9bd('0x1')]},'clientSecret':{'type':Sequelize[_0xe9bd('0x1')]},'serverUrl':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0xe9bd('0x1')]},'refreshToken':{'type':Sequelize[_0xe9bd('0x1')]}}; \ No newline at end of file +var _0xa9e0=['sequelize','exports','STRING'];(function(_0x28be72,_0x2b83af){var _0x46c5da=function(_0x312911){while(--_0x312911){_0x28be72['push'](_0x28be72['shift']());}};_0x46c5da(++_0x2b83af);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x0a9e('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x0a9e('0x2')]},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x0a9e('0x2')]},'refreshToken':{'type':Sequelize[_0x0a9e('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 54ff286..6826af4 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 _0xd9df=['Call_Result','Call_Start_Time','remove','includes','api_name','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','send','Wrong\x20credentials','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','json','undefined','count','offset','limit','set','reject','save','then','destroy','end','sendStatus','error','stack','name','map','ZohoAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','order','where','pick','VIRTUAL','merge','options','includeAll','include','catch','length','create','body','find','params','findOne','ZohoConfiguration','sort','filter','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','ZohoField','Descriptions','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','refreshToken','clientId','clientSecret','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','serverUrl','code','zoho.eu','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','https://www.zohoapis.%s/crm/v2/settings/fields','response','message','Owner','Subject','WhoId'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0xd9df,0x10a));var _0xfd9d=function(_0x130a62,_0xc117c1){_0x130a62=_0x130a62-0x0;var _0x21ea2e=_0xd9df[_0x130a62];return _0x21ea2e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfd9d('0x0'));var jsonpatch=require(_0xfd9d('0x1'));var rp=require(_0xfd9d('0x2'));var moment=require(_0xfd9d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xfd9d('0x4'));var util=require(_0xfd9d('0x5'));var path=require(_0xfd9d('0x6'));var sox=require(_0xfd9d('0x7'));var csv=require(_0xfd9d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfd9d('0x9'));var _=require(_0xfd9d('0xa'));var squel=require(_0xfd9d('0xb'));var crypto=require(_0xfd9d('0xc'));var jsforce=require(_0xfd9d('0xd'));var deskjs=require(_0xfd9d('0xe'));var toCsv=require('to-csv');var querystring=require(_0xfd9d('0xf'));var Papa=require('papaparse');var Redis=require(_0xfd9d('0x10'));var authService=require(_0xfd9d('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xfd9d('0x12'));var hardwareService=require(_0xfd9d('0x13'));var logger=require(_0xfd9d('0x14'))(_0xfd9d('0x15'));var utils=require(_0xfd9d('0x16'));var config=require(_0xfd9d('0x17'));var licenseUtil=require(_0xfd9d('0x18'));var db=require(_0xfd9d('0x19'))['db'];var integrations=require(_0xfd9d('0x1a'));function respondWithStatusCode(_0x2bf860,_0x4d07cc){_0x4d07cc=_0x4d07cc||0xcc;return function(_0xc6f781){if(_0xc6f781){return _0x2bf860['sendStatus'](_0x4d07cc);}return _0x2bf860[_0xfd9d('0x1b')](_0x4d07cc)['end']();};}function respondWithResult(_0x1efd27,_0x39a060){_0x39a060=_0x39a060||0xc8;return function(_0x36d875){if(_0x36d875){return _0x1efd27[_0xfd9d('0x1b')](_0x39a060)[_0xfd9d('0x1c')](_0x36d875);}};}function respondWithFilteredResult(_0x49ee29,_0x17e3e5){return function(_0x5140e7){if(_0x5140e7){var _0x334c8a=typeof _0x17e3e5['offset']===_0xfd9d('0x1d')&&typeof _0x17e3e5['limit']===_0xfd9d('0x1d');var _0x27a731=_0x5140e7[_0xfd9d('0x1e')];var _0x2eef8f=_0x334c8a?0x0:_0x17e3e5['offset'];var _0x24bc07=_0x334c8a?_0x5140e7[_0xfd9d('0x1e')]:_0x17e3e5[_0xfd9d('0x1f')]+_0x17e3e5[_0xfd9d('0x20')];var _0x433e91;if(_0x24bc07>=_0x27a731){_0x24bc07=_0x27a731;_0x433e91=0xc8;}else{_0x433e91=0xce;}_0x49ee29[_0xfd9d('0x1b')](_0x433e91);return _0x49ee29[_0xfd9d('0x21')]('Content-Range',_0x2eef8f+'-'+_0x24bc07+'/'+_0x27a731)[_0xfd9d('0x1c')](_0x5140e7);}return null;};}function patchUpdates(_0x180762){return function(_0x48c26b){try{jsonpatch['apply'](_0x48c26b,_0x180762,!![]);}catch(_0x5bb267){return BPromise[_0xfd9d('0x22')](_0x5bb267);}return _0x48c26b[_0xfd9d('0x23')]();};}function saveUpdates(_0x658475,_0x24238b){return function(_0x275558){if(_0x275558){return _0x275558['update'](_0x658475)[_0xfd9d('0x24')](function(_0x398af7){return _0x398af7;});}return null;};}function removeEntity(_0x31cf9d,_0x298c30){return function(_0x34183c){if(_0x34183c){return _0x34183c[_0xfd9d('0x25')]()['then'](function(){_0x31cf9d[_0xfd9d('0x1b')](0xcc)[_0xfd9d('0x26')]();});}};}function handleEntityNotFound(_0x4e7862,_0x440026){return function(_0x2fa113){if(!_0x2fa113){_0x4e7862[_0xfd9d('0x27')](0x194);}return _0x2fa113;};}function handleError(_0x210681,_0xf5f73f){_0xf5f73f=_0xf5f73f||0x1f4;return function(_0x432009){logger[_0xfd9d('0x28')](_0x432009[_0xfd9d('0x29')]);if(_0x432009['name']){delete _0x432009[_0xfd9d('0x2a')];}_0x210681['status'](_0xf5f73f)['send'](_0x432009);};}exports['index']=function(_0x57f46e,_0x265a87){var _0x522740={},_0x557981={},_0x413519={'count':0x0,'rows':[]};var _0x243404=_[_0xfd9d('0x2b')](db[_0xfd9d('0x2c')][_0xfd9d('0x2d')],function(_0x4a0d9e){return{'name':_0x4a0d9e[_0xfd9d('0x2e')],'type':_0x4a0d9e[_0xfd9d('0x2f')]['key']};});_0x557981[_0xfd9d('0x30')]=_[_0xfd9d('0x2b')](_0x243404,'name');_0x557981[_0xfd9d('0x31')]=_[_0xfd9d('0x32')](_0x57f46e[_0xfd9d('0x31')]);_0x557981[_0xfd9d('0x33')]=_[_0xfd9d('0x34')](_0x557981[_0xfd9d('0x30')],_0x557981[_0xfd9d('0x31')]);_0x522740[_0xfd9d('0x35')]=_[_0xfd9d('0x34')](_0x557981[_0xfd9d('0x30')],qs[_0xfd9d('0x36')](_0x57f46e[_0xfd9d('0x31')][_0xfd9d('0x36')]));_0x522740[_0xfd9d('0x35')]=_0x522740[_0xfd9d('0x35')]['length']?_0x522740[_0xfd9d('0x35')]:_0x557981[_0xfd9d('0x30')];if(!_0x57f46e['query']['hasOwnProperty']('nolimit')){_0x522740[_0xfd9d('0x20')]=qs[_0xfd9d('0x20')](_0x57f46e[_0xfd9d('0x31')][_0xfd9d('0x20')]);_0x522740[_0xfd9d('0x1f')]=qs[_0xfd9d('0x1f')](_0x57f46e['query'][_0xfd9d('0x1f')]);}_0x522740[_0xfd9d('0x37')]=qs['sort'](_0x57f46e[_0xfd9d('0x31')]['sort']);_0x522740[_0xfd9d('0x38')]=qs[_0xfd9d('0x33')](_[_0xfd9d('0x39')](_0x57f46e['query'],_0x557981[_0xfd9d('0x33')]),_0x243404);if(_0x57f46e['query']['filter']){_0x522740[_0xfd9d('0x38')]=_['merge'](_0x522740[_0xfd9d('0x38')],{'$or':_[_0xfd9d('0x2b')](_0x243404,function(_0x25bf67){if(_0x25bf67['type']!==_0xfd9d('0x3a')){var _0x337fcc={};_0x337fcc[_0x25bf67[_0xfd9d('0x2a')]]={'$like':'%'+_0x57f46e[_0xfd9d('0x31')]['filter']+'%'};return _0x337fcc;}})});}_0x522740=_[_0xfd9d('0x3b')]({},_0x522740,_0x57f46e[_0xfd9d('0x3c')]);var _0x2fc04e={'where':_0x522740[_0xfd9d('0x38')]};return db[_0xfd9d('0x2c')][_0xfd9d('0x1e')](_0x2fc04e)['then'](function(_0x30f253){_0x413519[_0xfd9d('0x1e')]=_0x30f253;if(_0x57f46e[_0xfd9d('0x31')][_0xfd9d('0x3d')]){_0x522740[_0xfd9d('0x3e')]=[{'all':!![]}];}return db[_0xfd9d('0x2c')]['findAll'](_0x522740);})[_0xfd9d('0x24')](function(_0x5b9705){_0x413519['rows']=_0x5b9705;return _0x413519;})[_0xfd9d('0x24')](respondWithFilteredResult(_0x265a87,_0x522740))[_0xfd9d('0x3f')](handleError(_0x265a87,null));};exports['show']=function(_0x57ab9b,_0x221bd1){var _0x3fecc0={'raw':![],'where':{'id':_0x57ab9b['params']['id']}},_0x5cba8d={};_0x5cba8d[_0xfd9d('0x30')]=_[_0xfd9d('0x32')](db[_0xfd9d('0x2c')]['rawAttributes']);_0x5cba8d[_0xfd9d('0x31')]=_[_0xfd9d('0x32')](_0x57ab9b[_0xfd9d('0x31')]);_0x5cba8d[_0xfd9d('0x33')]=_[_0xfd9d('0x34')](_0x5cba8d[_0xfd9d('0x30')],_0x5cba8d[_0xfd9d('0x31')]);_0x3fecc0[_0xfd9d('0x35')]=_[_0xfd9d('0x34')](_0x5cba8d[_0xfd9d('0x30')],qs[_0xfd9d('0x36')](_0x57ab9b[_0xfd9d('0x31')][_0xfd9d('0x36')]));_0x3fecc0[_0xfd9d('0x35')]=_0x3fecc0['attributes'][_0xfd9d('0x40')]?_0x3fecc0[_0xfd9d('0x35')]:_0x5cba8d[_0xfd9d('0x30')];if(_0x57ab9b['query']['includeAll']){_0x3fecc0[_0xfd9d('0x3e')]=[{'all':!![]}];}_0x3fecc0=_[_0xfd9d('0x3b')]({},_0x3fecc0,_0x57ab9b[_0xfd9d('0x3c')]);return db[_0xfd9d('0x2c')]['find'](_0x3fecc0)[_0xfd9d('0x24')](handleEntityNotFound(_0x221bd1,null))[_0xfd9d('0x24')](respondWithResult(_0x221bd1,null))[_0xfd9d('0x3f')](handleError(_0x221bd1,null));};exports[_0xfd9d('0x41')]=function(_0xc46b7c,_0x391c17){return db['ZohoAccount'][_0xfd9d('0x41')](_0xc46b7c[_0xfd9d('0x42')],{})[_0xfd9d('0x24')](respondWithResult(_0x391c17,0xc9))[_0xfd9d('0x3f')](handleError(_0x391c17,null));};exports['update']=function(_0x40c025,_0x20ed9b){if(_0x40c025[_0xfd9d('0x42')]['id']){delete _0x40c025[_0xfd9d('0x42')]['id'];}return db[_0xfd9d('0x2c')][_0xfd9d('0x43')]({'where':{'id':_0x40c025[_0xfd9d('0x44')]['id']}})[_0xfd9d('0x24')](handleEntityNotFound(_0x20ed9b,null))[_0xfd9d('0x24')](saveUpdates(_0x40c025['body'],null))[_0xfd9d('0x24')](respondWithResult(_0x20ed9b,null))[_0xfd9d('0x3f')](handleError(_0x20ed9b,null));};exports[_0xfd9d('0x25')]=function(_0x5d365a,_0x1bfc75){return db[_0xfd9d('0x2c')][_0xfd9d('0x43')]({'where':{'id':_0x5d365a[_0xfd9d('0x44')]['id']}})[_0xfd9d('0x24')](handleEntityNotFound(_0x1bfc75,null))['then'](removeEntity(_0x1bfc75,null))[_0xfd9d('0x3f')](handleError(_0x1bfc75,null));};exports['getConfigurations']=function(_0x238049,_0x57fc56,_0x2a0d16){var _0x359cb3={};var _0x568a0a={};var _0x4f5203;var _0x342283;return db[_0xfd9d('0x2c')][_0xfd9d('0x45')]({'where':{'id':_0x238049[_0xfd9d('0x44')]['id']}})[_0xfd9d('0x24')](handleEntityNotFound(_0x57fc56,null))[_0xfd9d('0x24')](function(_0x4f6549){if(_0x4f6549){_0x4f5203=_0x4f6549;_0x568a0a[_0xfd9d('0x30')]=_[_0xfd9d('0x32')](db[_0xfd9d('0x46')][_0xfd9d('0x2d')]);_0x568a0a[_0xfd9d('0x31')]=_[_0xfd9d('0x32')](_0x238049[_0xfd9d('0x31')]);_0x568a0a[_0xfd9d('0x33')]=_[_0xfd9d('0x34')](_0x568a0a[_0xfd9d('0x30')],_0x568a0a['query']);_0x359cb3[_0xfd9d('0x35')]=_['intersection'](_0x568a0a[_0xfd9d('0x30')],qs[_0xfd9d('0x36')](_0x238049[_0xfd9d('0x31')][_0xfd9d('0x36')]));_0x359cb3['attributes']=_0x359cb3[_0xfd9d('0x35')][_0xfd9d('0x40')]?_0x359cb3[_0xfd9d('0x35')]:_0x568a0a[_0xfd9d('0x30')];_0x359cb3[_0xfd9d('0x37')]=qs['sort'](_0x238049[_0xfd9d('0x31')][_0xfd9d('0x47')]);_0x359cb3[_0xfd9d('0x38')]=qs['filters'](_['pick'](_0x238049[_0xfd9d('0x31')],_0x568a0a[_0xfd9d('0x33')]));if(_0x238049[_0xfd9d('0x31')][_0xfd9d('0x48')]){_0x359cb3[_0xfd9d('0x38')]=_[_0xfd9d('0x3b')](_0x359cb3[_0xfd9d('0x38')],{'$or':_['map'](_0x359cb3['attributes'],function(_0x5e5d16){var _0x283b0c={};_0x283b0c[_0x5e5d16]={'$like':'%'+_0x238049[_0xfd9d('0x31')]['filter']+'%'};return _0x283b0c;})});}_0x359cb3=_[_0xfd9d('0x3b')]({},_0x359cb3,_0x238049[_0xfd9d('0x3c')]);return _0x4f5203[_0xfd9d('0x49')](_0x359cb3);}})[_0xfd9d('0x24')](function(_0x63d813){if(_0x63d813){_0x342283=_0x63d813[_0xfd9d('0x40')];if(!_0x238049['query'][_0xfd9d('0x4a')]('nolimit')){_0x359cb3['limit']=qs['limit'](_0x238049[_0xfd9d('0x31')][_0xfd9d('0x20')]);_0x359cb3[_0xfd9d('0x1f')]=qs[_0xfd9d('0x1f')](_0x238049[_0xfd9d('0x31')][_0xfd9d('0x1f')]);}return _0x4f5203['getConfigurations'](_0x359cb3);}})['then'](function(_0xd379c1){if(_0xd379c1){return _0xd379c1?{'count':_0x342283,'rows':_0xd379c1}:null;}})[_0xfd9d('0x24')](respondWithResult(_0x57fc56,null))['catch'](handleError(_0x57fc56,null));};exports[_0xfd9d('0x4b')]=function(_0x51f505,_0x325ae2,_0x354029){if(_0x51f505[_0xfd9d('0x42')]['id']){delete _0x51f505[_0xfd9d('0x42')]['id'];}return db[_0xfd9d('0x2c')][_0xfd9d('0x45')]({'where':{'id':_0x51f505[_0xfd9d('0x44')]['id']}})[_0xfd9d('0x24')](handleEntityNotFound(_0x325ae2,null))[_0xfd9d('0x24')](function(_0x3994ba){if(_0x3994ba){_0x51f505['body'][_0xfd9d('0x4c')]=_0x3994ba['id'];_0x51f505[_0xfd9d('0x42')][_0xfd9d('0x4d')]=integrations[_0xfd9d('0x4e')](_0x51f505['body'][_0xfd9d('0x4f')],_0x51f505['body']['type']);_0x51f505[_0xfd9d('0x42')]['Descriptions']=integrations[_0xfd9d('0x50')](_0x51f505[_0xfd9d('0x42')][_0xfd9d('0x4f')],_0x51f505[_0xfd9d('0x42')][_0xfd9d('0x2f')]);return db['ZohoConfiguration'][_0xfd9d('0x41')](_0x51f505[_0xfd9d('0x42')],{'include':[{'model':db[_0xfd9d('0x51')],'as':_0xfd9d('0x4d')},{'model':db[_0xfd9d('0x51')],'as':_0xfd9d('0x52')}]});}return null;})[_0xfd9d('0x24')](respondWithResult(_0x325ae2,null))[_0xfd9d('0x3f')](handleError(_0x325ae2,null));};function getAccessToken(_0x5e3ee4){return new Promise(function(_0x458655,_0x50bd21){var _0x25105e;switch(_0x5e3ee4[_0xfd9d('0x53')]){case'US':_0x25105e=_0xfd9d('0x54');break;case'AU':_0x25105e=_0xfd9d('0x55');break;case'EU':_0x25105e=_0xfd9d('0x56');break;case'IN':_0x25105e=_0xfd9d('0x57');break;case'CN':_0x25105e=_0xfd9d('0x58');break;default:_0x25105e=_0xfd9d('0x56');break;}var _0x5cd568={'method':_0xfd9d('0x59'),'uri':_0x25105e+'/oauth/v2/token','qs':{'refresh_token':_0x5e3ee4[_0xfd9d('0x5a')],'client_id':_0x5e3ee4[_0xfd9d('0x5b')],'client_secret':_0x5e3ee4[_0xfd9d('0x5c')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x5cd568)[_0xfd9d('0x24')](function(_0x112746){if(_0x112746[_0xfd9d('0x5d')]){_0x458655(_0x112746[_0xfd9d('0x5d')]);}else{_0x50bd21(_0xfd9d('0x5e'));}})['catch'](function(_0x1eed90){_0x50bd21(_0x1eed90);});});}exports[_0xfd9d('0x5f')]=function(_0x2503f8,_0x466ff9,_0x393167){var _0xfeb537,_0x24c28e,_0x1d65c8,_0x454461,_0x57d5eb;return db[_0xfd9d('0x2c')][_0xfd9d('0x45')]({'where':{'id':_0x2503f8[_0xfd9d('0x44')]['id']},'attributes':['id',_0xfd9d('0x60'),_0xfd9d('0x53'),'clientId',_0xfd9d('0x5c'),_0xfd9d('0x61'),_0xfd9d('0x62'),_0xfd9d('0x5a')]})[_0xfd9d('0x24')](handleEntityNotFound(_0x466ff9,null))[_0xfd9d('0x24')](function(_0x3fab06){_0x57d5eb=_0x3fab06;_0xfeb537=_0x57d5eb['host'];_0x24c28e=_0xfeb537===_0xfd9d('0x63')?'eu':_0xfd9d('0x64');_0x1d65c8=_0x57d5eb['serverUrl'];var _0x5ce28a=_0x1d65c8[_0xfd9d('0x65')](-0x1);if(_0x5ce28a==='/'||_0x5ce28a==='\x5c'||_0x5ce28a===':'){_0x1d65c8=_0x1d65c8[_0xfd9d('0x66')](0x0,_0x1d65c8[_0xfd9d('0x67')](_0x5ce28a));}if(!_0x57d5eb['refreshToken']){throw new Error(_0xfd9d('0x68'));}return getAccessToken(_0x57d5eb);})[_0xfd9d('0x24')](function(_0x20cc2e){if(_0x20cc2e){return rp({'method':_0xfd9d('0x69'),'uri':util['format'](_0xfd9d('0x6a'),_0x24c28e),'qs':{'module':'Calls'},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x20cc2e},'json':!![]});}})[_0xfd9d('0x24')](function(_0xdb4a01){if(_0xdb4a01){if(_0xdb4a01[_0xfd9d('0x6b')]&&_0xdb4a01[_0xfd9d('0x6b')][_0xfd9d('0x28')]){throw new Error(_0xdb4a01[_0xfd9d('0x6b')][_0xfd9d('0x28')][_0xfd9d('0x6c')]);}var _0x59f38a=[];var _0x303cc7=[];var _0x301fa3=[_0xfd9d('0x6d'),_0xfd9d('0x6e'),'Description',_0xfd9d('0x6f'),'Call_Duration',_0xfd9d('0x70'),_0xfd9d('0x71'),'Call_Type'];_0x303cc7=_[_0xfd9d('0x72')](_0xdb4a01['fields'],function(_0xf7eed4){return _0x301fa3[_0xfd9d('0x73')](_0xf7eed4[_0xfd9d('0x74')]);});for(var _0x44ea94=0x0;_0x44ea94<_0x303cc7[_0xfd9d('0x40')];_0x44ea94++){if(_0x303cc7[_0x44ea94]['system_mandatory']===![]){_0x59f38a['push']({'id':_0x303cc7[_0x44ea94]['id'],'name':_0x303cc7[_0x44ea94][_0xfd9d('0x75')],'custom':_0x303cc7[_0x44ea94][_0xfd9d('0x76')],'options':_0x303cc7[_0x44ea94][_0xfd9d('0x77')]===_0xfd9d('0x78')&&_0x303cc7[_0x44ea94][_0xfd9d('0x79')]['length']>-0x1?_[_0xfd9d('0x2b')](_0x303cc7[_0x44ea94]['pick_list_values'],function(_0x2422b2){return{'name':_0x2422b2,'value':_0x2422b2};}):[]});}}return{'count':_0x59f38a['length'],'rows':_0x59f38a};}else{return{'count':0x0,'rows':[]};}})[_0xfd9d('0x24')](respondWithResult(_0x466ff9,null))['catch'](function(_0x406769){var _0xfd2420=_0x2503f8[_0xfd9d('0x31')][_0xfd9d('0x7a')]?0x1f4:_0x406769[_0xfd9d('0x7b')]||0x1f4;logger[_0xfd9d('0x28')]('getFields,\x20%s,\x20%s,\x20%s',_0xfd9d('0x5f'),_0xfd2420,JSON['stringify'](_0x406769));delete _0x406769['name'];if(_0xfd2420===0x191){_0xfd2420=0x190;}_0x466ff9['status'](_0xfd2420)[_0xfd9d('0x7c')](_0x2503f8[_0xfd9d('0x31')]['test']?{'message':_0xfd9d('0x7d'),'statusCode':_0x406769[_0xfd9d('0x7b')]}:_0x406769);});}; \ No newline at end of file +var _0x0f0e=['to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','reject','then','destroy','stack','name','send','index','map','ZohoAccount','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','where','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','create','body','update','getConfigurations','params','ZohoConfiguration','pick','filter','hasOwnProperty','addConfiguration','Subjects','channel','getDescriptions','ZohoField','Descriptions','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','findOne','host','serverUrl','code','refreshToken','zoho.eu','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','error','message','Owner','Subject','Description','WhoId','Call_Duration','Call_Start_Time','Call_Type','includes','api_name','system_mandatory','push','display_label','data_type','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','crypto','jsforce','desk.js'];(function(_0x48461c,_0x4075e4){var _0x271e5b=function(_0x5f03a5){while(--_0x5f03a5){_0x48461c['push'](_0x48461c['shift']());}};_0x271e5b(++_0x4075e4);}(_0x0f0e,0x17e));var _0xe0f0=function(_0xeeedb5,_0x1aeb6e){_0xeeedb5=_0xeeedb5-0x0;var _0x10eef6=_0x0f0e[_0xeeedb5];return _0x10eef6;};'use strict';var emlformat=require(_0xe0f0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0f0('0x1'));var jsonpatch=require(_0xe0f0('0x2'));var rp=require(_0xe0f0('0x3'));var moment=require(_0xe0f0('0x4'));var BPromise=require(_0xe0f0('0x5'));var Mustache=require(_0xe0f0('0x6'));var util=require(_0xe0f0('0x7'));var path=require(_0xe0f0('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe0f0('0x9'));var fs=require('fs');var fs_extra=require(_0xe0f0('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe0f0('0xb'));var jsforce=require(_0xe0f0('0xc'));var deskjs=require(_0xe0f0('0xd'));var toCsv=require(_0xe0f0('0xe'));var querystring=require(_0xe0f0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0f0('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xe0f0('0x11'));var as=require(_0xe0f0('0x12'));var hardwareService=require(_0xe0f0('0x13'));var logger=require(_0xe0f0('0x14'))(_0xe0f0('0x15'));var utils=require(_0xe0f0('0x16'));var config=require(_0xe0f0('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xe0f0('0x18'))['db'];var integrations=require(_0xe0f0('0x19'));function respondWithStatusCode(_0x2d6deb,_0x5923cb){_0x5923cb=_0x5923cb||0xcc;return function(_0x3a4a83){if(_0x3a4a83){return _0x2d6deb[_0xe0f0('0x1a')](_0x5923cb);}return _0x2d6deb[_0xe0f0('0x1b')](_0x5923cb)[_0xe0f0('0x1c')]();};}function respondWithResult(_0x2e75f2,_0x47029c){_0x47029c=_0x47029c||0xc8;return function(_0x13e31c){if(_0x13e31c){return _0x2e75f2[_0xe0f0('0x1b')](_0x47029c)['json'](_0x13e31c);}};}function respondWithFilteredResult(_0x1cb9df,_0x32904c){return function(_0x22ef4f){if(_0x22ef4f){var _0x5660ea=typeof _0x32904c['offset']===_0xe0f0('0x1d')&&typeof _0x32904c[_0xe0f0('0x1e')]==='undefined';var _0x1c829a=_0x22ef4f[_0xe0f0('0x1f')];var _0x25e401=_0x5660ea?0x0:_0x32904c[_0xe0f0('0x20')];var _0x3c5b2a=_0x5660ea?_0x22ef4f['count']:_0x32904c['offset']+_0x32904c[_0xe0f0('0x1e')];var _0xd07c91;if(_0x3c5b2a>=_0x1c829a){_0x3c5b2a=_0x1c829a;_0xd07c91=0xc8;}else{_0xd07c91=0xce;}_0x1cb9df[_0xe0f0('0x1b')](_0xd07c91);return _0x1cb9df[_0xe0f0('0x21')]('Content-Range',_0x25e401+'-'+_0x3c5b2a+'/'+_0x1c829a)[_0xe0f0('0x22')](_0x22ef4f);}return null;};}function patchUpdates(_0x19c52b){return function(_0x2b35a7){try{jsonpatch[_0xe0f0('0x23')](_0x2b35a7,_0x19c52b,!![]);}catch(_0x39f178){return BPromise[_0xe0f0('0x24')](_0x39f178);}return _0x2b35a7['save']();};}function saveUpdates(_0xc04ce3,_0x29d132){return function(_0x3965db){if(_0x3965db){return _0x3965db['update'](_0xc04ce3)[_0xe0f0('0x25')](function(_0x399aa4){return _0x399aa4;});}return null;};}function removeEntity(_0x460335,_0xb33a8f){return function(_0x29d04b){if(_0x29d04b){return _0x29d04b[_0xe0f0('0x26')]()[_0xe0f0('0x25')](function(){_0x460335['status'](0xcc)[_0xe0f0('0x1c')]();});}};}function handleEntityNotFound(_0x3237dd,_0x1c18fc){return function(_0x129225){if(!_0x129225){_0x3237dd[_0xe0f0('0x1a')](0x194);}return _0x129225;};}function handleError(_0x308706,_0x2b27fc){_0x2b27fc=_0x2b27fc||0x1f4;return function(_0x31a5c9){logger['error'](_0x31a5c9[_0xe0f0('0x27')]);if(_0x31a5c9[_0xe0f0('0x28')]){delete _0x31a5c9[_0xe0f0('0x28')];}_0x308706['status'](_0x2b27fc)[_0xe0f0('0x29')](_0x31a5c9);};}exports[_0xe0f0('0x2a')]=function(_0x75147b,_0x225630){var _0x27acde={},_0x579f5c={},_0xf2d194={'count':0x0,'rows':[]};var _0x117831=_[_0xe0f0('0x2b')](db[_0xe0f0('0x2c')][_0xe0f0('0x2d')],function(_0x360497){return{'name':_0x360497['fieldName'],'type':_0x360497[_0xe0f0('0x2e')][_0xe0f0('0x2f')]};});_0x579f5c[_0xe0f0('0x30')]=_[_0xe0f0('0x2b')](_0x117831,'name');_0x579f5c[_0xe0f0('0x31')]=_[_0xe0f0('0x32')](_0x75147b[_0xe0f0('0x31')]);_0x579f5c[_0xe0f0('0x33')]=_['intersection'](_0x579f5c[_0xe0f0('0x30')],_0x579f5c[_0xe0f0('0x31')]);_0x27acde[_0xe0f0('0x34')]=_[_0xe0f0('0x35')](_0x579f5c[_0xe0f0('0x30')],qs[_0xe0f0('0x36')](_0x75147b[_0xe0f0('0x31')]['fields']));_0x27acde['attributes']=_0x27acde['attributes'][_0xe0f0('0x37')]?_0x27acde[_0xe0f0('0x34')]:_0x579f5c[_0xe0f0('0x30')];if(!_0x75147b[_0xe0f0('0x31')]['hasOwnProperty'](_0xe0f0('0x38'))){_0x27acde[_0xe0f0('0x1e')]=qs[_0xe0f0('0x1e')](_0x75147b[_0xe0f0('0x31')][_0xe0f0('0x1e')]);_0x27acde[_0xe0f0('0x20')]=qs[_0xe0f0('0x20')](_0x75147b[_0xe0f0('0x31')][_0xe0f0('0x20')]);}_0x27acde['order']=qs[_0xe0f0('0x39')](_0x75147b['query'][_0xe0f0('0x39')]);_0x27acde[_0xe0f0('0x3a')]=qs[_0xe0f0('0x33')](_['pick'](_0x75147b['query'],_0x579f5c[_0xe0f0('0x33')]),_0x117831);if(_0x75147b['query']['filter']){_0x27acde[_0xe0f0('0x3a')]=_['merge'](_0x27acde[_0xe0f0('0x3a')],{'$or':_[_0xe0f0('0x2b')](_0x117831,function(_0x599341){if(_0x599341['type']!==_0xe0f0('0x3b')){var _0x42f482={};_0x42f482[_0x599341['name']]={'$like':'%'+_0x75147b[_0xe0f0('0x31')]['filter']+'%'};return _0x42f482;}})});}_0x27acde=_[_0xe0f0('0x3c')]({},_0x27acde,_0x75147b[_0xe0f0('0x3d')]);var _0x11a8ff={'where':_0x27acde[_0xe0f0('0x3a')]};return db[_0xe0f0('0x2c')][_0xe0f0('0x1f')](_0x11a8ff)[_0xe0f0('0x25')](function(_0x22312a){_0xf2d194[_0xe0f0('0x1f')]=_0x22312a;if(_0x75147b[_0xe0f0('0x31')][_0xe0f0('0x3e')]){_0x27acde[_0xe0f0('0x3f')]=[{'all':!![]}];}return db['ZohoAccount'][_0xe0f0('0x40')](_0x27acde);})[_0xe0f0('0x25')](function(_0x422f97){_0xf2d194['rows']=_0x422f97;return _0xf2d194;})[_0xe0f0('0x25')](respondWithFilteredResult(_0x225630,_0x27acde))[_0xe0f0('0x41')](handleError(_0x225630,null));};exports[_0xe0f0('0x42')]=function(_0x42032a,_0x4ea0bb){var _0x30eea6={'raw':![],'where':{'id':_0x42032a['params']['id']}},_0x57f835={};_0x57f835[_0xe0f0('0x30')]=_[_0xe0f0('0x32')](db[_0xe0f0('0x2c')][_0xe0f0('0x2d')]);_0x57f835['query']=_['keys'](_0x42032a[_0xe0f0('0x31')]);_0x57f835['filters']=_[_0xe0f0('0x35')](_0x57f835[_0xe0f0('0x30')],_0x57f835[_0xe0f0('0x31')]);_0x30eea6[_0xe0f0('0x34')]=_['intersection'](_0x57f835[_0xe0f0('0x30')],qs[_0xe0f0('0x36')](_0x42032a['query'][_0xe0f0('0x36')]));_0x30eea6[_0xe0f0('0x34')]=_0x30eea6[_0xe0f0('0x34')][_0xe0f0('0x37')]?_0x30eea6['attributes']:_0x57f835['model'];if(_0x42032a[_0xe0f0('0x31')][_0xe0f0('0x3e')]){_0x30eea6[_0xe0f0('0x3f')]=[{'all':!![]}];}_0x30eea6=_[_0xe0f0('0x3c')]({},_0x30eea6,_0x42032a['options']);return db[_0xe0f0('0x2c')]['find'](_0x30eea6)['then'](handleEntityNotFound(_0x4ea0bb,null))['then'](respondWithResult(_0x4ea0bb,null))['catch'](handleError(_0x4ea0bb,null));};exports['create']=function(_0x2d6979,_0x47a5a6){return db[_0xe0f0('0x2c')][_0xe0f0('0x43')](_0x2d6979[_0xe0f0('0x44')],{})[_0xe0f0('0x25')](respondWithResult(_0x47a5a6,0xc9))['catch'](handleError(_0x47a5a6,null));};exports[_0xe0f0('0x45')]=function(_0x45bdf0,_0x2d1638){if(_0x45bdf0[_0xe0f0('0x44')]['id']){delete _0x45bdf0[_0xe0f0('0x44')]['id'];}return db['ZohoAccount']['find']({'where':{'id':_0x45bdf0['params']['id']}})[_0xe0f0('0x25')](handleEntityNotFound(_0x2d1638,null))[_0xe0f0('0x25')](saveUpdates(_0x45bdf0[_0xe0f0('0x44')],null))[_0xe0f0('0x25')](respondWithResult(_0x2d1638,null))[_0xe0f0('0x41')](handleError(_0x2d1638,null));};exports['destroy']=function(_0x5d1470,_0x3380d2){return db[_0xe0f0('0x2c')]['find']({'where':{'id':_0x5d1470['params']['id']}})[_0xe0f0('0x25')](handleEntityNotFound(_0x3380d2,null))[_0xe0f0('0x25')](removeEntity(_0x3380d2,null))[_0xe0f0('0x41')](handleError(_0x3380d2,null));};exports[_0xe0f0('0x46')]=function(_0x3d62dc,_0x1c9a70,_0x57dacc){var _0x3d25ad={};var _0x3fd1e5={};var _0x3fe0fa;var _0xd339a2;return db['ZohoAccount']['findOne']({'where':{'id':_0x3d62dc[_0xe0f0('0x47')]['id']}})[_0xe0f0('0x25')](handleEntityNotFound(_0x1c9a70,null))[_0xe0f0('0x25')](function(_0x3701da){if(_0x3701da){_0x3fe0fa=_0x3701da;_0x3fd1e5['model']=_['keys'](db[_0xe0f0('0x48')][_0xe0f0('0x2d')]);_0x3fd1e5[_0xe0f0('0x31')]=_[_0xe0f0('0x32')](_0x3d62dc[_0xe0f0('0x31')]);_0x3fd1e5[_0xe0f0('0x33')]=_['intersection'](_0x3fd1e5['model'],_0x3fd1e5[_0xe0f0('0x31')]);_0x3d25ad[_0xe0f0('0x34')]=_['intersection'](_0x3fd1e5[_0xe0f0('0x30')],qs[_0xe0f0('0x36')](_0x3d62dc[_0xe0f0('0x31')]['fields']));_0x3d25ad[_0xe0f0('0x34')]=_0x3d25ad[_0xe0f0('0x34')][_0xe0f0('0x37')]?_0x3d25ad[_0xe0f0('0x34')]:_0x3fd1e5[_0xe0f0('0x30')];_0x3d25ad['order']=qs[_0xe0f0('0x39')](_0x3d62dc[_0xe0f0('0x31')]['sort']);_0x3d25ad['where']=qs[_0xe0f0('0x33')](_[_0xe0f0('0x49')](_0x3d62dc[_0xe0f0('0x31')],_0x3fd1e5[_0xe0f0('0x33')]));if(_0x3d62dc[_0xe0f0('0x31')][_0xe0f0('0x4a')]){_0x3d25ad[_0xe0f0('0x3a')]=_[_0xe0f0('0x3c')](_0x3d25ad['where'],{'$or':_[_0xe0f0('0x2b')](_0x3d25ad[_0xe0f0('0x34')],function(_0x9e9230){var _0x376dd4={};_0x376dd4[_0x9e9230]={'$like':'%'+_0x3d62dc['query']['filter']+'%'};return _0x376dd4;})});}_0x3d25ad=_['merge']({},_0x3d25ad,_0x3d62dc[_0xe0f0('0x3d')]);return _0x3fe0fa['getConfigurations'](_0x3d25ad);}})[_0xe0f0('0x25')](function(_0x17bfac){if(_0x17bfac){_0xd339a2=_0x17bfac[_0xe0f0('0x37')];if(!_0x3d62dc['query'][_0xe0f0('0x4b')](_0xe0f0('0x38'))){_0x3d25ad[_0xe0f0('0x1e')]=qs[_0xe0f0('0x1e')](_0x3d62dc[_0xe0f0('0x31')][_0xe0f0('0x1e')]);_0x3d25ad[_0xe0f0('0x20')]=qs['offset'](_0x3d62dc[_0xe0f0('0x31')]['offset']);}return _0x3fe0fa[_0xe0f0('0x46')](_0x3d25ad);}})[_0xe0f0('0x25')](function(_0x42a0d5){if(_0x42a0d5){return _0x42a0d5?{'count':_0xd339a2,'rows':_0x42a0d5}:null;}})['then'](respondWithResult(_0x1c9a70,null))[_0xe0f0('0x41')](handleError(_0x1c9a70,null));};exports[_0xe0f0('0x4c')]=function(_0x5c45ec,_0x40a92c,_0x647f1c){if(_0x5c45ec[_0xe0f0('0x44')]['id']){delete _0x5c45ec[_0xe0f0('0x44')]['id'];}return db[_0xe0f0('0x2c')]['findOne']({'where':{'id':_0x5c45ec[_0xe0f0('0x47')]['id']}})['then'](handleEntityNotFound(_0x40a92c,null))[_0xe0f0('0x25')](function(_0x4ff2d7){if(_0x4ff2d7){_0x5c45ec['body']['AccountId']=_0x4ff2d7['id'];_0x5c45ec[_0xe0f0('0x44')][_0xe0f0('0x4d')]=integrations['getSubjects'](_0x5c45ec[_0xe0f0('0x44')][_0xe0f0('0x4e')],_0x5c45ec[_0xe0f0('0x44')][_0xe0f0('0x2e')]);_0x5c45ec[_0xe0f0('0x44')]['Descriptions']=integrations[_0xe0f0('0x4f')](_0x5c45ec[_0xe0f0('0x44')][_0xe0f0('0x4e')],_0x5c45ec[_0xe0f0('0x44')][_0xe0f0('0x2e')]);return db[_0xe0f0('0x48')][_0xe0f0('0x43')](_0x5c45ec[_0xe0f0('0x44')],{'include':[{'model':db[_0xe0f0('0x50')],'as':_0xe0f0('0x4d')},{'model':db[_0xe0f0('0x50')],'as':_0xe0f0('0x51')}]});}return null;})[_0xe0f0('0x25')](respondWithResult(_0x40a92c,null))[_0xe0f0('0x41')](handleError(_0x40a92c,null));};function getAccessToken(_0x31d475){return new Promise(function(_0x45817b,_0x509aac){var _0x2b4a1a;switch(_0x31d475[_0xe0f0('0x52')]){case'US':_0x2b4a1a=_0xe0f0('0x53');break;case'AU':_0x2b4a1a=_0xe0f0('0x54');break;case'EU':_0x2b4a1a='https://accounts.zoho.eu';break;case'IN':_0x2b4a1a=_0xe0f0('0x55');break;case'CN':_0x2b4a1a=_0xe0f0('0x56');break;default:_0x2b4a1a=_0xe0f0('0x57');break;}var _0x1d2f2b={'method':_0xe0f0('0x58'),'uri':_0x2b4a1a+_0xe0f0('0x59'),'qs':{'refresh_token':_0x31d475['refreshToken'],'client_id':_0x31d475[_0xe0f0('0x5a')],'client_secret':_0x31d475[_0xe0f0('0x5b')],'grant_type':_0xe0f0('0x5c')},'json':!![]};return rp(_0x1d2f2b)[_0xe0f0('0x25')](function(_0x227812){if(_0x227812[_0xe0f0('0x5d')]){_0x45817b(_0x227812['access_token']);}else{_0x509aac(_0xe0f0('0x5e'));}})[_0xe0f0('0x41')](function(_0x316645){_0x509aac(_0x316645);});});}exports[_0xe0f0('0x5f')]=function(_0x479d4c,_0x54eeb3,_0x46ed7d){var _0x527459,_0x4e3bb0,_0x6255ff,_0x436d59,_0x336839;return db[_0xe0f0('0x2c')][_0xe0f0('0x60')]({'where':{'id':_0x479d4c[_0xe0f0('0x47')]['id']},'attributes':['id',_0xe0f0('0x61'),'zone',_0xe0f0('0x5a'),_0xe0f0('0x5b'),_0xe0f0('0x62'),_0xe0f0('0x63'),_0xe0f0('0x64')]})[_0xe0f0('0x25')](handleEntityNotFound(_0x54eeb3,null))[_0xe0f0('0x25')](function(_0x3333a3){_0x336839=_0x3333a3;_0x527459=_0x336839[_0xe0f0('0x61')];_0x4e3bb0=_0x527459===_0xe0f0('0x65')?'eu':'com';_0x6255ff=_0x336839[_0xe0f0('0x62')];var _0x5ef8b5=_0x6255ff[_0xe0f0('0x66')](-0x1);if(_0x5ef8b5==='/'||_0x5ef8b5==='\x5c'||_0x5ef8b5===':'){_0x6255ff=_0x6255ff[_0xe0f0('0x67')](0x0,_0x6255ff[_0xe0f0('0x68')](_0x5ef8b5));}if(!_0x336839[_0xe0f0('0x64')]){throw new Error(_0xe0f0('0x69'));}return getAccessToken(_0x336839);})[_0xe0f0('0x25')](function(_0x19a3d3){if(_0x19a3d3){return rp({'method':'GET','uri':util[_0xe0f0('0x6a')](_0xe0f0('0x6b'),_0x4e3bb0),'qs':{'module':_0xe0f0('0x6c')},'headers':{'Authorization':_0xe0f0('0x6d')+_0x19a3d3},'json':!![]});}})['then'](function(_0x875ce7){if(_0x875ce7){if(_0x875ce7[_0xe0f0('0x6e')]&&_0x875ce7[_0xe0f0('0x6e')][_0xe0f0('0x6f')]){throw new Error(_0x875ce7[_0xe0f0('0x6e')][_0xe0f0('0x6f')][_0xe0f0('0x70')]);}var _0x497d75=[];var _0x5f3862=[];var _0x9f04a0=[_0xe0f0('0x71'),_0xe0f0('0x72'),_0xe0f0('0x73'),_0xe0f0('0x74'),_0xe0f0('0x75'),'Call_Result',_0xe0f0('0x76'),_0xe0f0('0x77')];_0x5f3862=_['remove'](_0x875ce7[_0xe0f0('0x36')],function(_0x33152c){return _0x9f04a0[_0xe0f0('0x78')](_0x33152c[_0xe0f0('0x79')]);});for(var _0x93b780=0x0;_0x93b780<_0x5f3862[_0xe0f0('0x37')];_0x93b780++){if(_0x5f3862[_0x93b780][_0xe0f0('0x7a')]===![]){_0x497d75[_0xe0f0('0x7b')]({'id':_0x5f3862[_0x93b780]['id'],'name':_0x5f3862[_0x93b780][_0xe0f0('0x7c')],'custom':_0x5f3862[_0x93b780]['custom_field'],'options':_0x5f3862[_0x93b780][_0xe0f0('0x7d')]==='picklist'&&_0x5f3862[_0x93b780][_0xe0f0('0x7e')][_0xe0f0('0x37')]>-0x1?_['map'](_0x5f3862[_0x93b780][_0xe0f0('0x7e')],function(_0x139283){return{'name':_0x139283,'value':_0x139283};}):[]});}}return{'count':_0x497d75[_0xe0f0('0x37')],'rows':_0x497d75};}else{return{'count':0x0,'rows':[]};}})[_0xe0f0('0x25')](respondWithResult(_0x54eeb3,null))[_0xe0f0('0x41')](function(_0x2e4085){var _0x5ed7c6=_0x479d4c[_0xe0f0('0x31')][_0xe0f0('0x7f')]?0x1f4:_0x2e4085[_0xe0f0('0x80')]||0x1f4;logger['error'](_0xe0f0('0x81'),_0xe0f0('0x5f'),_0x5ed7c6,JSON[_0xe0f0('0x82')](_0x2e4085));delete _0x2e4085[_0xe0f0('0x28')];if(_0x5ed7c6===0x191){_0x5ed7c6=0x190;}_0x54eeb3[_0xe0f0('0x1b')](_0x5ed7c6)[_0xe0f0('0x29')](_0x479d4c['query'][_0xe0f0('0x7f')]?{'message':_0xe0f0('0x83'),'statusCode':_0x2e4085[_0xe0f0('0x80')]}:_0x2e4085);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 376d787..27241ea 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 _0x3f73=['slice','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','code','parse','refresh_token','refreshToken','format','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','substring','application/x-www-form-urlencoded','then','info','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientId','clientSecret','host'];(function(_0x17256a,_0x332b81){var _0x3c1b22=function(_0x472938){while(--_0x472938){_0x17256a['push'](_0x17256a['shift']());}};_0x3c1b22(++_0x332b81);}(_0x3f73,0xee));var _0x33f7=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3f73[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x33f7('0x0'));var util=require(_0x33f7('0x1'));var logger=require(_0x33f7('0x2'))(_0x33f7('0x3'));var moment=require('moment');var BPromise=require(_0x33f7('0x4'));var rp=require(_0x33f7('0x5'));var fs=require('fs');var path=require(_0x33f7('0x6'));var rimraf=require(_0x33f7('0x7'));var config=require('../../config/environment');var attributes=require(_0x33f7('0x8'));var integrations=require(_0x33f7('0x9'));module[_0x33f7('0xa')]=function(_0x226dd0,_0x59a998){return _0x226dd0[_0x33f7('0xb')](_0x33f7('0xc'),attributes,{'tableName':_0x33f7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x42185c,_0x28fc72,_0x36ed53){if(_0x42185c[_0x33f7('0xe')](_0x33f7('0xf'))||_0x42185c[_0x33f7('0xe')](_0x33f7('0x10'))||_0x42185c[_0x33f7('0xe')](_0x33f7('0x11'))||_0x42185c[_0x33f7('0xe')](_0x33f7('0x12'))||_0x42185c[_0x33f7('0xe')]('code')||_0x42185c[_0x33f7('0xe')](_0x33f7('0x13'))){var _0x300030,_0x25ac83;_0x300030=_0x42185c[_0x33f7('0x10')];var _0x58d1a9=_0x300030[_0x33f7('0x14')](-0x1);if(_0x58d1a9==='/'||_0x58d1a9==='\x5c'||_0x58d1a9===':'){_0x300030=_0x300030['substring'](0x0,_0x300030[_0x33f7('0x15')](_0x58d1a9));}switch(_0x42185c[_0x33f7('0xf')]){case'US':_0x25ac83=_0x33f7('0x16');break;case'AU':_0x25ac83=_0x33f7('0x17');break;case'IN':_0x25ac83=_0x33f7('0x18');break;case'CN':_0x25ac83='https://accounts.zoho.com.cn';break;default:_0x25ac83=_0x33f7('0x19');break;}var _0x59ee2f={'method':_0x33f7('0x1a'),'uri':_0x25ac83+_0x33f7('0x1b'),'form':{'grant_type':_0x33f7('0x1c'),'client_id':_0x42185c[_0x33f7('0x11')],'client_secret':_0x42185c[_0x33f7('0x12')],'redirect_uri':_0x42185c[_0x33f7('0x10')],'code':_0x42185c[_0x33f7('0x1d')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x59ee2f)['then'](function(_0x27f628){var _0x344119=JSON[_0x33f7('0x1e')](_0x27f628);if(_0x344119[_0x33f7('0x1f')]){_0x42185c[_0x33f7('0x20')]=_0x344119['refresh_token'];logger['info'](util[_0x33f7('0x21')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x42185c[_0x33f7('0x22')],_0x42185c['id']));}else{logger[_0x33f7('0x23')](util[_0x33f7('0x21')](_0x33f7('0x24'),_0x42185c[_0x33f7('0x22')],_0x42185c['id']),util[_0x33f7('0x25')](_0x344119,{'showHidden':![],'depth':null}));}return _0x36ed53(null,_0x28fc72);})[_0x33f7('0x26')](function(_0x44b1b1){logger[_0x33f7('0x23')](util[_0x33f7('0x21')](_0x33f7('0x24'),_0x42185c[_0x33f7('0x22')],_0x42185c['id']),util[_0x33f7('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x36ed53(_0x44b1b1);});}else{return _0x36ed53(null,_0x28fc72);}},'beforeUpdate':function(_0x49290c,_0x1c1f90,_0x15ac5d){if(_0x49290c[_0x33f7('0xe')](_0x33f7('0xf'))||_0x49290c['changed'](_0x33f7('0x10'))||_0x49290c[_0x33f7('0xe')](_0x33f7('0x11'))||_0x49290c[_0x33f7('0xe')](_0x33f7('0x12'))||_0x49290c[_0x33f7('0xe')](_0x33f7('0x1d'))||_0x49290c['changed'](_0x33f7('0x13'))){var _0x34827d,_0x8bf6c3;_0x34827d=_0x49290c[_0x33f7('0x10')];var _0x1f7a33=_0x34827d['slice'](-0x1);if(_0x1f7a33==='/'||_0x1f7a33==='\x5c'||_0x1f7a33===':'){_0x34827d=_0x34827d[_0x33f7('0x27')](0x0,_0x34827d[_0x33f7('0x15')](_0x1f7a33));}switch(_0x49290c[_0x33f7('0xf')]){case'US':_0x8bf6c3=_0x33f7('0x16');break;case'AU':_0x8bf6c3=_0x33f7('0x17');break;case'IN':_0x8bf6c3=_0x33f7('0x18');break;case'CN':_0x8bf6c3='https://accounts.zoho.com.cn';break;default:_0x8bf6c3=_0x33f7('0x19');break;}var _0x22d065={'method':_0x33f7('0x1a'),'uri':_0x8bf6c3+_0x33f7('0x1b'),'form':{'grant_type':'authorization_code','client_id':_0x49290c[_0x33f7('0x11')],'client_secret':_0x49290c[_0x33f7('0x12')],'redirect_uri':_0x49290c[_0x33f7('0x10')],'code':_0x49290c['code']},'headers':{'Content-Type':_0x33f7('0x28')}};return rp(_0x22d065)[_0x33f7('0x29')](function(_0x487de0){var _0x109d8c=JSON[_0x33f7('0x1e')](_0x487de0);if(_0x109d8c[_0x33f7('0x1f')]){_0x49290c['refreshToken']=_0x109d8c[_0x33f7('0x1f')];logger[_0x33f7('0x2a')](util['format']('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x49290c[_0x33f7('0x22')],_0x49290c['id']));}else{logger[_0x33f7('0x23')](util[_0x33f7('0x21')](_0x33f7('0x24'),_0x49290c[_0x33f7('0x22')],_0x49290c['id']),util[_0x33f7('0x25')](_0x109d8c,{'showHidden':![],'depth':null}));}return _0x15ac5d(null,_0x1c1f90);})['catch'](function(_0x146f52){logger[_0x33f7('0x23')](util[_0x33f7('0x21')](_0x33f7('0x24'),_0x49290c[_0x33f7('0x22')],_0x49290c['id']),util[_0x33f7('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x15ac5d(_0x146f52);});}else{return _0x15ac5d(null,_0x1c1f90);}}}});}; \ No newline at end of file +var _0xfb16=['int_zoho_accounts','changed','zone','clientSecret','slice','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','/oauth/v2/token','authorization_code','clientId','serverUrl','code','application/x-www-form-urlencoded','then','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','inspect','catch','host','substring','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','parse','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','lodash','util','../../config/logger','api','moment','request-promise','path','./intZohoAccount.attributes','exports','define'];(function(_0x412516,_0x5e24aa){var _0x12e7b4=function(_0x137fc7){while(--_0x137fc7){_0x412516['push'](_0x412516['shift']());}};_0x12e7b4(++_0x5e24aa);}(_0xfb16,0x9e));var _0x6fb1=function(_0x392086,_0xd6adc7){_0x392086=_0x392086-0x0;var _0x10fc06=_0xfb16[_0x392086];return _0x10fc06;};'use strict';var _=require(_0x6fb1('0x0'));var util=require(_0x6fb1('0x1'));var logger=require(_0x6fb1('0x2'))(_0x6fb1('0x3'));var moment=require(_0x6fb1('0x4'));var BPromise=require('bluebird');var rp=require(_0x6fb1('0x5'));var fs=require('fs');var path=require(_0x6fb1('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6fb1('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x6fb1('0x8')]=function(_0x5b6cfd,_0x7823c2){return _0x5b6cfd[_0x6fb1('0x9')]('ZohoAccount',attributes,{'tableName':_0x6fb1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4b928a,_0x593a92,_0x56abc9){if(_0x4b928a[_0x6fb1('0xb')](_0x6fb1('0xc'))||_0x4b928a[_0x6fb1('0xb')]('serverUrl')||_0x4b928a[_0x6fb1('0xb')]('clientId')||_0x4b928a['changed'](_0x6fb1('0xd'))||_0x4b928a[_0x6fb1('0xb')]('code')||_0x4b928a[_0x6fb1('0xb')]('host')){var _0x225438,_0x18a9c2;_0x225438=_0x4b928a['serverUrl'];var _0x2fe2b6=_0x225438[_0x6fb1('0xe')](-0x1);if(_0x2fe2b6==='/'||_0x2fe2b6==='\x5c'||_0x2fe2b6===':'){_0x225438=_0x225438['substring'](0x0,_0x225438[_0x6fb1('0xf')](_0x2fe2b6));}switch(_0x4b928a[_0x6fb1('0xc')]){case'US':_0x18a9c2=_0x6fb1('0x10');break;case'AU':_0x18a9c2=_0x6fb1('0x11');break;case'IN':_0x18a9c2='https://accounts.zoho.in';break;case'CN':_0x18a9c2='https://accounts.zoho.com.cn';break;default:_0x18a9c2=_0x6fb1('0x12');break;}var _0x5ba7b8={'method':'POST','uri':_0x18a9c2+_0x6fb1('0x13'),'form':{'grant_type':_0x6fb1('0x14'),'client_id':_0x4b928a[_0x6fb1('0x15')],'client_secret':_0x4b928a[_0x6fb1('0xd')],'redirect_uri':_0x4b928a[_0x6fb1('0x16')],'code':_0x4b928a[_0x6fb1('0x17')]},'headers':{'Content-Type':_0x6fb1('0x18')}};return rp(_0x5ba7b8)[_0x6fb1('0x19')](function(_0x33f208){var _0x17feb8=JSON['parse'](_0x33f208);if(_0x17feb8[_0x6fb1('0x1a')]){_0x4b928a[_0x6fb1('0x1b')]=_0x17feb8['refresh_token'];logger[_0x6fb1('0x1c')](util[_0x6fb1('0x1d')](_0x6fb1('0x1e'),_0x4b928a['name'],_0x4b928a['id']));}else{logger['error'](util[_0x6fb1('0x1d')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4b928a[_0x6fb1('0x1f')],_0x4b928a['id']),util[_0x6fb1('0x20')](_0x17feb8,{'showHidden':![],'depth':null}));}return _0x56abc9(null,_0x593a92);})[_0x6fb1('0x21')](function(_0x2c5277){logger['error'](util[_0x6fb1('0x1d')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4b928a['name'],_0x4b928a['id']),util[_0x6fb1('0x20')](parsedResult,{'showHidden':![],'depth':null}));return _0x56abc9(_0x2c5277);});}else{return _0x56abc9(null,_0x593a92);}},'beforeUpdate':function(_0xb8215d,_0x1803be,_0x34b4ec){if(_0xb8215d[_0x6fb1('0xb')]('zone')||_0xb8215d[_0x6fb1('0xb')](_0x6fb1('0x16'))||_0xb8215d[_0x6fb1('0xb')](_0x6fb1('0x15'))||_0xb8215d[_0x6fb1('0xb')](_0x6fb1('0xd'))||_0xb8215d[_0x6fb1('0xb')](_0x6fb1('0x17'))||_0xb8215d[_0x6fb1('0xb')](_0x6fb1('0x22'))){var _0x25ccd3,_0x20d77f;_0x25ccd3=_0xb8215d[_0x6fb1('0x16')];var _0x33d608=_0x25ccd3[_0x6fb1('0xe')](-0x1);if(_0x33d608==='/'||_0x33d608==='\x5c'||_0x33d608===':'){_0x25ccd3=_0x25ccd3[_0x6fb1('0x23')](0x0,_0x25ccd3[_0x6fb1('0xf')](_0x33d608));}switch(_0xb8215d['zone']){case'US':_0x20d77f=_0x6fb1('0x10');break;case'AU':_0x20d77f=_0x6fb1('0x11');break;case'IN':_0x20d77f=_0x6fb1('0x24');break;case'CN':_0x20d77f=_0x6fb1('0x25');break;default:_0x20d77f='https://accounts.zoho.eu';break;}var _0x2fe5d9={'method':_0x6fb1('0x26'),'uri':_0x20d77f+_0x6fb1('0x13'),'form':{'grant_type':_0x6fb1('0x14'),'client_id':_0xb8215d[_0x6fb1('0x15')],'client_secret':_0xb8215d[_0x6fb1('0xd')],'redirect_uri':_0xb8215d[_0x6fb1('0x16')],'code':_0xb8215d['code']},'headers':{'Content-Type':_0x6fb1('0x18')}};return rp(_0x2fe5d9)[_0x6fb1('0x19')](function(_0x436c9d){var _0x316c76=JSON[_0x6fb1('0x27')](_0x436c9d);if(_0x316c76[_0x6fb1('0x1a')]){_0xb8215d[_0x6fb1('0x1b')]=_0x316c76['refresh_token'];logger[_0x6fb1('0x1c')](util[_0x6fb1('0x1d')](_0x6fb1('0x1e'),_0xb8215d['name'],_0xb8215d['id']));}else{logger[_0x6fb1('0x28')](util[_0x6fb1('0x1d')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0xb8215d[_0x6fb1('0x1f')],_0xb8215d['id']),util[_0x6fb1('0x20')](_0x316c76,{'showHidden':![],'depth':null}));}return _0x34b4ec(null,_0x1803be);})[_0x6fb1('0x21')](function(_0x12ca9e){logger[_0x6fb1('0x28')](util[_0x6fb1('0x1d')](_0x6fb1('0x29'),_0xb8215d['name'],_0xb8215d['id']),util[_0x6fb1('0x20')](parsedResult,{'showHidden':![],'depth':null}));return _0x34b4ec(_0x12ca9e);});}else{return _0x34b4ec(null,_0x1803be);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index b3b9452..6ad1202 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 _0x8383=['message','info','result','ZohoAccount','options','raw','where','limit','include','map','attributes','model','GetZohoAccount','catch','find','ShowZohoAccount','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x8383,0x98));var _0x3838=function(_0x224440,_0x1c1c05){_0x224440=_0x224440-0x0;var _0x839887=_0x8383[_0x224440];return _0x839887;};'use strict';var _=require(_0x3838('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3838('0x1'));var rs=require(_0x3838('0x2'));var fs=require('fs');var Redis=require(_0x3838('0x3'));var db=require(_0x3838('0x4'))['db'];var utils=require(_0x3838('0x5'));var logger=require(_0x3838('0x6'))(_0x3838('0x7'));var config=require(_0x3838('0x8'));var jayson=require(_0x3838('0x9'));var client=jayson[_0x3838('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x239750,_0x235001,_0x4cf52b){return new BPromise(function(_0x2abbda,_0x5e2e42){return client[_0x3838('0xb')](_0x239750,_0x4cf52b)[_0x3838('0xc')](function(_0x340c39){logger['info'](_0x3838('0xd'),_0x235001,_0x3838('0xe'));logger[_0x3838('0xf')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x235001,_0x3838('0xe'),JSON[_0x3838('0x10')](_0x340c39));if(_0x340c39[_0x3838('0x11')]){if(_0x340c39[_0x3838('0x11')]['code']===0x1f4){logger[_0x3838('0x11')](_0x3838('0xd'),_0x235001,_0x340c39[_0x3838('0x11')]['message']);return _0x5e2e42(_0x340c39[_0x3838('0x11')]['message']);}logger[_0x3838('0x11')](_0x3838('0xd'),_0x235001,_0x340c39[_0x3838('0x11')][_0x3838('0x12')]);return _0x2abbda(_0x340c39[_0x3838('0x11')]['message']);}else{logger[_0x3838('0x13')](_0x3838('0xd'),_0x235001,_0x3838('0xe'));_0x2abbda(_0x340c39[_0x3838('0x14')][_0x3838('0x12')]);}})['catch'](function(_0x464fd9){logger[_0x3838('0x11')](_0x3838('0xd'),_0x235001,_0x464fd9);_0x5e2e42(_0x464fd9);});});}exports['GetZohoAccount']=function(_0x45aa66){var _0x14379b=this;return new Promise(function(_0x4a9a7a,_0xf69d52){return db[_0x3838('0x15')]['findAll']({'raw':_0x45aa66[_0x3838('0x16')]?_0x45aa66['options'][_0x3838('0x17')]===undefined?!![]:![]:!![],'where':_0x45aa66[_0x3838('0x16')]?_0x45aa66[_0x3838('0x16')][_0x3838('0x18')]||null:null,'attributes':_0x45aa66[_0x3838('0x16')]?_0x45aa66['options']['attributes']||null:null,'limit':_0x45aa66[_0x3838('0x16')]?_0x45aa66['options'][_0x3838('0x19')]||null:null,'include':_0x45aa66[_0x3838('0x16')]?_0x45aa66[_0x3838('0x16')][_0x3838('0x1a')]?_[_0x3838('0x1b')](_0x45aa66[_0x3838('0x16')][_0x3838('0x1a')],function(_0x1e8d61){return{'model':db[_0x1e8d61['model']],'as':_0x1e8d61['as'],'attributes':_0x1e8d61[_0x3838('0x1c')],'include':_0x1e8d61['include']?_[_0x3838('0x1b')](_0x1e8d61[_0x3838('0x1a')],function(_0x55eaa5){return{'model':db[_0x55eaa5[_0x3838('0x1d')]],'as':_0x55eaa5['as'],'attributes':_0x55eaa5[_0x3838('0x1c')],'include':_0x55eaa5['include']?_[_0x3838('0x1b')](_0x55eaa5[_0x3838('0x1a')],function(_0x537f85){return{'model':db[_0x537f85[_0x3838('0x1d')]],'as':_0x537f85['as'],'attributes':_0x537f85['attributes']};}):[]};}):[]};}):[]:[]})[_0x3838('0xc')](function(_0x5c26b9){logger['info'](_0x3838('0x1e'),_0x45aa66);logger[_0x3838('0xf')](_0x3838('0x1e'),_0x45aa66,JSON[_0x3838('0x10')](_0x5c26b9));_0x4a9a7a(_0x5c26b9);})[_0x3838('0x1f')](function(_0x4b6519){logger[_0x3838('0x11')](_0x3838('0x1e'),_0x4b6519[_0x3838('0x12')],_0x45aa66);_0xf69d52(_0x14379b['error'](0x1f4,_0x4b6519[_0x3838('0x12')]));});});};exports['ShowZohoAccount']=function(_0x2549bd){var _0x4b1a0c=this;return new Promise(function(_0x441a7f,_0x2a725c){return db['ZohoAccount'][_0x3838('0x20')]({'raw':_0x2549bd['options']?_0x2549bd['options'][_0x3838('0x17')]===undefined?!![]:![]:!![],'where':_0x2549bd[_0x3838('0x16')]?_0x2549bd['options']['where']||null:null,'attributes':_0x2549bd[_0x3838('0x16')]?_0x2549bd['options'][_0x3838('0x1c')]||null:null,'include':_0x2549bd[_0x3838('0x16')]?_0x2549bd[_0x3838('0x16')][_0x3838('0x1a')]?_[_0x3838('0x1b')](_0x2549bd[_0x3838('0x16')]['include'],function(_0x21de44){return{'model':db[_0x21de44[_0x3838('0x1d')]],'as':_0x21de44['as'],'attributes':_0x21de44[_0x3838('0x1c')],'include':_0x21de44[_0x3838('0x1a')]?_[_0x3838('0x1b')](_0x21de44[_0x3838('0x1a')],function(_0xc2262b){return{'model':db[_0xc2262b[_0x3838('0x1d')]],'as':_0xc2262b['as'],'attributes':_0xc2262b[_0x3838('0x1c')],'include':_0xc2262b[_0x3838('0x1a')]?_[_0x3838('0x1b')](_0xc2262b['include'],function(_0x470704){return{'model':db[_0x470704[_0x3838('0x1d')]],'as':_0x470704['as'],'attributes':_0x470704[_0x3838('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3838('0xc')](function(_0x5ad388){logger[_0x3838('0x13')](_0x3838('0x21'),_0x2549bd);logger[_0x3838('0xf')](_0x3838('0x21'),_0x2549bd,JSON['stringify'](_0x5ad388));_0x441a7f(_0x5ad388);})[_0x3838('0x1f')](function(_0x3c8ceb){logger[_0x3838('0x11')](_0x3838('0x21'),_0x3c8ceb['message'],_0x2549bd);_0x2a725c(_0x4b1a0c[_0x3838('0x11')](0x1f4,_0x3c8ceb[_0x3838('0x12')]));});});}; \ No newline at end of file +var _0xdb7e=['info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','where','attributes','map','include','model','ShowZohoAccount','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x133d17,_0x4b40a4){var _0xba9b1f=function(_0x7c8f89){while(--_0x7c8f89){_0x133d17['push'](_0x133d17['shift']());}};_0xba9b1f(++_0x4b40a4);}(_0xdb7e,0x11a));var _0xedb7=function(_0x379829,_0x395977){_0x379829=_0x379829-0x0;var _0x72a0b8=_0xdb7e[_0x379829];return _0x72a0b8;};'use strict';var _=require(_0xedb7('0x0'));var util=require(_0xedb7('0x1'));var moment=require(_0xedb7('0x2'));var BPromise=require('bluebird');var rs=require(_0xedb7('0x3'));var fs=require('fs');var Redis=require(_0xedb7('0x4'));var db=require(_0xedb7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xedb7('0x6'))(_0xedb7('0x7'));var config=require(_0xedb7('0x8'));var jayson=require(_0xedb7('0x9'));var client=jayson[_0xedb7('0xa')][_0xedb7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x87bf4b,_0x20a7c7,_0x26774f){return new BPromise(function(_0x2ae0f7,_0x5a8650){return client[_0xedb7('0xc')](_0x87bf4b,_0x26774f)[_0xedb7('0xd')](function(_0x12c7ba){logger[_0xedb7('0xe')](_0xedb7('0xf'),_0x20a7c7,_0xedb7('0x10'));logger[_0xedb7('0x11')](_0xedb7('0x12'),_0x20a7c7,_0xedb7('0x10'),JSON[_0xedb7('0x13')](_0x12c7ba));if(_0x12c7ba[_0xedb7('0x14')]){if(_0x12c7ba[_0xedb7('0x14')][_0xedb7('0x15')]===0x1f4){logger['error']('ZohoAccount,\x20%s,\x20%s',_0x20a7c7,_0x12c7ba[_0xedb7('0x14')][_0xedb7('0x16')]);return _0x5a8650(_0x12c7ba[_0xedb7('0x14')][_0xedb7('0x16')]);}logger[_0xedb7('0x14')](_0xedb7('0xf'),_0x20a7c7,_0x12c7ba[_0xedb7('0x14')][_0xedb7('0x16')]);return _0x2ae0f7(_0x12c7ba[_0xedb7('0x14')]['message']);}else{logger['info'](_0xedb7('0xf'),_0x20a7c7,_0xedb7('0x10'));_0x2ae0f7(_0x12c7ba[_0xedb7('0x17')]['message']);}})[_0xedb7('0x18')](function(_0x3ce7c5){logger[_0xedb7('0x14')](_0xedb7('0xf'),_0x20a7c7,_0x3ce7c5);_0x5a8650(_0x3ce7c5);});});}exports[_0xedb7('0x19')]=function(_0x50f579){var _0x5d2d6a=this;return new Promise(function(_0x3d8f2a,_0xa8aae0){return db[_0xedb7('0x1a')][_0xedb7('0x1b')]({'raw':_0x50f579['options']?_0x50f579[_0xedb7('0x1c')][_0xedb7('0x1d')]===undefined?!![]:![]:!![],'where':_0x50f579[_0xedb7('0x1c')]?_0x50f579['options'][_0xedb7('0x1e')]||null:null,'attributes':_0x50f579['options']?_0x50f579[_0xedb7('0x1c')][_0xedb7('0x1f')]||null:null,'limit':_0x50f579[_0xedb7('0x1c')]?_0x50f579['options']['limit']||null:null,'include':_0x50f579[_0xedb7('0x1c')]?_0x50f579[_0xedb7('0x1c')]['include']?_[_0xedb7('0x20')](_0x50f579[_0xedb7('0x1c')]['include'],function(_0x16d887){return{'model':db[_0x16d887['model']],'as':_0x16d887['as'],'attributes':_0x16d887['attributes'],'include':_0x16d887[_0xedb7('0x21')]?_[_0xedb7('0x20')](_0x16d887['include'],function(_0x1ad4e9){return{'model':db[_0x1ad4e9[_0xedb7('0x22')]],'as':_0x1ad4e9['as'],'attributes':_0x1ad4e9[_0xedb7('0x1f')],'include':_0x1ad4e9[_0xedb7('0x21')]?_[_0xedb7('0x20')](_0x1ad4e9[_0xedb7('0x21')],function(_0xfcc7ee){return{'model':db[_0xfcc7ee[_0xedb7('0x22')]],'as':_0xfcc7ee['as'],'attributes':_0xfcc7ee['attributes']};}):[]};}):[]};}):[]:[]})[_0xedb7('0xd')](function(_0x509106){logger['info'](_0xedb7('0x19'),_0x50f579);logger[_0xedb7('0x11')]('GetZohoAccount',_0x50f579,JSON['stringify'](_0x509106));_0x3d8f2a(_0x509106);})[_0xedb7('0x18')](function(_0x515ab1){logger[_0xedb7('0x14')](_0xedb7('0x19'),_0x515ab1[_0xedb7('0x16')],_0x50f579);_0xa8aae0(_0x5d2d6a['error'](0x1f4,_0x515ab1[_0xedb7('0x16')]));});});};exports[_0xedb7('0x23')]=function(_0x320c92){var _0x2202bd=this;return new Promise(function(_0xe9293,_0xb5a7ba){return db['ZohoAccount'][_0xedb7('0x24')]({'raw':_0x320c92['options']?_0x320c92[_0xedb7('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x320c92[_0xedb7('0x1c')]?_0x320c92['options'][_0xedb7('0x1e')]||null:null,'attributes':_0x320c92[_0xedb7('0x1c')]?_0x320c92[_0xedb7('0x1c')]['attributes']||null:null,'include':_0x320c92['options']?_0x320c92[_0xedb7('0x1c')][_0xedb7('0x21')]?_[_0xedb7('0x20')](_0x320c92['options'][_0xedb7('0x21')],function(_0x572e30){return{'model':db[_0x572e30[_0xedb7('0x22')]],'as':_0x572e30['as'],'attributes':_0x572e30[_0xedb7('0x1f')],'include':_0x572e30[_0xedb7('0x21')]?_[_0xedb7('0x20')](_0x572e30[_0xedb7('0x21')],function(_0x1c2b0c){return{'model':db[_0x1c2b0c['model']],'as':_0x1c2b0c['as'],'attributes':_0x1c2b0c[_0xedb7('0x1f')],'include':_0x1c2b0c[_0xedb7('0x21')]?_['map'](_0x1c2b0c[_0xedb7('0x21')],function(_0x251875){return{'model':db[_0x251875[_0xedb7('0x22')]],'as':_0x251875['as'],'attributes':_0x251875[_0xedb7('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xedb7('0xd')](function(_0x24b2b0){logger[_0xedb7('0xe')](_0xedb7('0x23'),_0x320c92);logger[_0xedb7('0x11')](_0xedb7('0x23'),_0x320c92,JSON[_0xedb7('0x13')](_0x24b2b0));_0xe9293(_0x24b2b0);})[_0xedb7('0x18')](function(_0x262199){logger[_0xedb7('0x14')]('ShowZohoAccount',_0x262199[_0xedb7('0x16')],_0x320c92);_0xb5a7ba(_0x2202bd[_0xedb7('0x14')](0x1f4,_0x262199[_0xedb7('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 1425e08..d20a680 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 _0xa4de=['../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service'];(function(_0x73ea6d,_0x57d5bd){var _0x4c3a66=function(_0xb3ffd1){while(--_0xb3ffd1){_0x73ea6d['push'](_0x73ea6d['shift']());}};_0x4c3a66(++_0x57d5bd);}(_0xa4de,0x102));var _0xea4d=function(_0x5eac07,_0x2a3399){_0x5eac07=_0x5eac07-0x0;var _0x615657=_0xa4de[_0x5eac07];return _0x615657;};'use strict';var multer=require('multer');var util=require(_0xea4d('0x0'));var path=require(_0xea4d('0x1'));var timeout=require(_0xea4d('0x2'));var express=require(_0xea4d('0x3'));var router=express['Router']();var fs_extra=require(_0xea4d('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xea4d('0x5'));var config=require(_0xea4d('0x6'));var controller=require(_0xea4d('0x7'));router[_0xea4d('0x8')]('/',auth[_0xea4d('0x9')](),controller[_0xea4d('0xa')]);router[_0xea4d('0x8')](_0xea4d('0xb'),auth[_0xea4d('0x9')](),controller[_0xea4d('0xc')]);router[_0xea4d('0x8')](_0xea4d('0xd'),auth[_0xea4d('0x9')](),controller['getFields']);router[_0xea4d('0x8')](_0xea4d('0xe'),auth[_0xea4d('0x9')](),controller['getSubjects']);router['get'](_0xea4d('0xf'),auth[_0xea4d('0x9')](),controller[_0xea4d('0x10')]);router[_0xea4d('0x11')]('/',auth[_0xea4d('0x9')](),controller[_0xea4d('0x12')]);router['put'](_0xea4d('0xb'),auth[_0xea4d('0x9')](),controller['update']);router[_0xea4d('0x13')](_0xea4d('0xb'),auth[_0xea4d('0x9')](),controller[_0xea4d('0x14')]);module[_0xea4d('0x15')]=router; \ No newline at end of file +var _0x589e=['/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','show','get','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put'];(function(_0x47cc35,_0x3c310e){var _0x95ec4c=function(_0xf8f369){while(--_0xf8f369){_0x47cc35['push'](_0x47cc35['shift']());}};_0x95ec4c(++_0x3c310e);}(_0x589e,0xdc));var _0xe589=function(_0x1d1793,_0x1cc47c){_0x1d1793=_0x1d1793-0x0;var _0x42af2f=_0x589e[_0x1d1793];return _0x42af2f;};'use strict';var multer=require(_0xe589('0x0'));var util=require(_0xe589('0x1'));var path=require(_0xe589('0x2'));var timeout=require(_0xe589('0x3'));var express=require(_0xe589('0x4'));var router=express[_0xe589('0x5')]();var fs_extra=require(_0xe589('0x6'));var auth=require(_0xe589('0x7'));var interaction=require(_0xe589('0x8'));var config=require(_0xe589('0x9'));var controller=require('./intZohoConfiguration.controller');router['get']('/',auth[_0xe589('0xa')](),controller[_0xe589('0xb')]);router['get']('/:id',auth[_0xe589('0xa')](),controller[_0xe589('0xc')]);router[_0xe589('0xd')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0xe589('0xd')](_0xe589('0xe'),auth['isAuthenticated'](),controller[_0xe589('0xf')]);router['get'](_0xe589('0x10'),auth[_0xe589('0xa')](),controller[_0xe589('0x11')]);router[_0xe589('0x12')]('/',auth[_0xe589('0xa')](),controller['create']);router[_0xe589('0x13')](_0xe589('0x14'),auth[_0xe589('0xa')](),controller[_0xe589('0x15')]);router[_0xe589('0x16')](_0xe589('0x14'),auth['isAuthenticated'](),controller[_0xe589('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 9eb0237..3e4a090 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 _0x2b18=['STRING','contact','contact_lead','lead','sequelize','exports'];(function(_0x45d9bb,_0x2c0350){var _0x1a36e9=function(_0x643803){while(--_0x643803){_0x45d9bb['push'](_0x45d9bb['shift']());}};_0x1a36e9(++_0x2c0350);}(_0x2b18,0x11e));var _0x82b1=function(_0xe8e35f,_0x3261d2){_0xe8e35f=_0xe8e35f-0x0;var _0x1d2e2b=_0x2b18[_0xe8e35f];return _0x1d2e2b;};'use strict';var Sequelize=require(_0x82b1('0x0'));module[_0x82b1('0x1')]={'name':{'type':Sequelize[_0x82b1('0x2')]},'moduleCreate':{'type':Sequelize['ENUM']('lead',_0x82b1('0x3'),'nothing'),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize['ENUM'](_0x82b1('0x4'),'contact',_0x82b1('0x5')),'defaultValue':'contact_lead'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5455=['STRING','ENUM','lead','contact','nothing','exports'];(function(_0x3d8c1d,_0x2fe3f0){var _0x1e08e3=function(_0x13b62d){while(--_0x13b62d){_0x3d8c1d['push'](_0x3d8c1d['shift']());}};_0x1e08e3(++_0x2fe3f0);}(_0x5455,0x197));var _0x5545=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x5455[_0x465a0c];return _0x1e202e;};'use strict';var Sequelize=require('sequelize');module[_0x5545('0x0')]={'name':{'type':Sequelize[_0x5545('0x1')]},'moduleCreate':{'type':Sequelize[_0x5545('0x2')](_0x5545('0x3'),_0x5545('0x4'),_0x5545('0x5')),'defaultValue':_0x5545('0x3')},'moduleSearch':{'type':Sequelize['ENUM']('contact_lead',_0x5545('0x4'),_0x5545('0x3')),'defaultValue':'contact_lead'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 987bdd3..6835a4b 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 _0xef5e=['then','destroy','sendStatus','error','stack','name','send','map','ZohoConfiguration','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','catch','show','params','include','find','create','body','getFields','findOne','rawAttributes','hasOwnProperty','getSubjects','getDescriptions','ZohoField','eml-format','rimraf','zip-dir','fast-json-patch','moment','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update'];(function(_0x28611e,_0x586726){var _0x530f69=function(_0x407906){while(--_0x407906){_0x28611e['push'](_0x28611e['shift']());}};_0x530f69(++_0x586726);}(_0xef5e,0x7b));var _0xeef5=function(_0x33305c,_0x397df1){_0x33305c=_0x33305c-0x0;var _0x3d212a=_0xef5e[_0x33305c];return _0x3d212a;};'use strict';var emlformat=require(_0xeef5('0x0'));var rimraf=require(_0xeef5('0x1'));var zipdir=require(_0xeef5('0x2'));var jsonpatch=require(_0xeef5('0x3'));var rp=require('request-promise');var moment=require(_0xeef5('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xeef5('0x5'));var sox=require('sox');var csv=require(_0xeef5('0x6'));var ejs=require(_0xeef5('0x7'));var fs=require('fs');var fs_extra=require(_0xeef5('0x8'));var _=require(_0xeef5('0x9'));var squel=require(_0xeef5('0xa'));var crypto=require('crypto');var jsforce=require(_0xeef5('0xb'));var deskjs=require(_0xeef5('0xc'));var toCsv=require(_0xeef5('0x6'));var querystring=require(_0xeef5('0xd'));var Papa=require('papaparse');var Redis=require(_0xeef5('0xe'));var authService=require(_0xeef5('0xf'));var qs=require(_0xeef5('0x10'));var as=require(_0xeef5('0x11'));var hardwareService=require(_0xeef5('0x12'));var logger=require(_0xeef5('0x13'))(_0xeef5('0x14'));var utils=require('../../config/utils');var config=require(_0xeef5('0x15'));var licenseUtil=require(_0xeef5('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1cce65,_0x5dcd01){_0x5dcd01=_0x5dcd01||0xcc;return function(_0x5d6df7){if(_0x5d6df7){return _0x1cce65['sendStatus'](_0x5dcd01);}return _0x1cce65['status'](_0x5dcd01)['end']();};}function respondWithResult(_0x5663f7,_0x1307f5){_0x1307f5=_0x1307f5||0xc8;return function(_0x13aaaf){if(_0x13aaaf){return _0x5663f7[_0xeef5('0x17')](_0x1307f5)[_0xeef5('0x18')](_0x13aaaf);}};}function respondWithFilteredResult(_0x34d99a,_0x15f4b0){return function(_0x567556){if(_0x567556){var _0x1768dc=typeof _0x15f4b0[_0xeef5('0x19')]===_0xeef5('0x1a')&&typeof _0x15f4b0[_0xeef5('0x1b')]===_0xeef5('0x1a');var _0x515c46=_0x567556[_0xeef5('0x1c')];var _0x134896=_0x1768dc?0x0:_0x15f4b0[_0xeef5('0x19')];var _0x442c31=_0x1768dc?_0x567556[_0xeef5('0x1c')]:_0x15f4b0[_0xeef5('0x19')]+_0x15f4b0[_0xeef5('0x1b')];var _0x451ce2;if(_0x442c31>=_0x515c46){_0x442c31=_0x515c46;_0x451ce2=0xc8;}else{_0x451ce2=0xce;}_0x34d99a[_0xeef5('0x17')](_0x451ce2);return _0x34d99a[_0xeef5('0x1d')](_0xeef5('0x1e'),_0x134896+'-'+_0x442c31+'/'+_0x515c46)['json'](_0x567556);}return null;};}function patchUpdates(_0x1d5926){return function(_0x41c76a){try{jsonpatch[_0xeef5('0x1f')](_0x41c76a,_0x1d5926,!![]);}catch(_0x2c5aa0){return BPromise[_0xeef5('0x20')](_0x2c5aa0);}return _0x41c76a[_0xeef5('0x21')]();};}function saveUpdates(_0x2c9ae6,_0x2c06e2){return function(_0x42ff30){if(_0x42ff30){return _0x42ff30[_0xeef5('0x22')](_0x2c9ae6)[_0xeef5('0x23')](function(_0x1d1194){return _0x1d1194;});}return null;};}function removeEntity(_0x29c8df,_0x5690d8){return function(_0x2e9096){if(_0x2e9096){return _0x2e9096[_0xeef5('0x24')]()[_0xeef5('0x23')](function(){_0x29c8df['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x340541,_0x550c1b){return function(_0x5c10fe){if(!_0x5c10fe){_0x340541[_0xeef5('0x25')](0x194);}return _0x5c10fe;};}function handleError(_0x479c5c,_0x1eae27){_0x1eae27=_0x1eae27||0x1f4;return function(_0x51e23d){logger[_0xeef5('0x26')](_0x51e23d[_0xeef5('0x27')]);if(_0x51e23d[_0xeef5('0x28')]){delete _0x51e23d[_0xeef5('0x28')];}_0x479c5c['status'](_0x1eae27)[_0xeef5('0x29')](_0x51e23d);};}exports['index']=function(_0x4e1925,_0x92a826){var _0x15f1b2={},_0x5598e6={},_0x5f22fb={'count':0x0,'rows':[]};var _0x3d7606=_[_0xeef5('0x2a')](db[_0xeef5('0x2b')]['rawAttributes'],function(_0x288192){return{'name':_0x288192['fieldName'],'type':_0x288192['type'][_0xeef5('0x2c')]};});_0x5598e6[_0xeef5('0x2d')]=_[_0xeef5('0x2a')](_0x3d7606,_0xeef5('0x28'));_0x5598e6[_0xeef5('0x2e')]=_[_0xeef5('0x2f')](_0x4e1925[_0xeef5('0x2e')]);_0x5598e6[_0xeef5('0x30')]=_[_0xeef5('0x31')](_0x5598e6[_0xeef5('0x2d')],_0x5598e6[_0xeef5('0x2e')]);_0x15f1b2[_0xeef5('0x32')]=_[_0xeef5('0x31')](_0x5598e6['model'],qs[_0xeef5('0x33')](_0x4e1925['query'][_0xeef5('0x33')]));_0x15f1b2['attributes']=_0x15f1b2[_0xeef5('0x32')][_0xeef5('0x34')]?_0x15f1b2[_0xeef5('0x32')]:_0x5598e6['model'];if(!_0x4e1925[_0xeef5('0x2e')]['hasOwnProperty'](_0xeef5('0x35'))){_0x15f1b2[_0xeef5('0x1b')]=qs['limit'](_0x4e1925[_0xeef5('0x2e')]['limit']);_0x15f1b2[_0xeef5('0x19')]=qs[_0xeef5('0x19')](_0x4e1925['query'][_0xeef5('0x19')]);}_0x15f1b2[_0xeef5('0x36')]=qs[_0xeef5('0x37')](_0x4e1925[_0xeef5('0x2e')]['sort']);_0x15f1b2[_0xeef5('0x38')]=qs[_0xeef5('0x30')](_[_0xeef5('0x39')](_0x4e1925[_0xeef5('0x2e')],_0x5598e6[_0xeef5('0x30')]),_0x3d7606);if(_0x4e1925[_0xeef5('0x2e')][_0xeef5('0x3a')]){_0x15f1b2[_0xeef5('0x38')]=_[_0xeef5('0x3b')](_0x15f1b2[_0xeef5('0x38')],{'$or':_['map'](_0x3d7606,function(_0x5959f0){if(_0x5959f0[_0xeef5('0x3c')]!==_0xeef5('0x3d')){var _0x274eca={};_0x274eca[_0x5959f0['name']]={'$like':'%'+_0x4e1925[_0xeef5('0x2e')][_0xeef5('0x3a')]+'%'};return _0x274eca;}})});}_0x15f1b2=_[_0xeef5('0x3b')]({},_0x15f1b2,_0x4e1925[_0xeef5('0x3e')]);var _0x4e1a93={'where':_0x15f1b2[_0xeef5('0x38')]};return db[_0xeef5('0x2b')][_0xeef5('0x1c')](_0x4e1a93)['then'](function(_0x59954f){_0x5f22fb[_0xeef5('0x1c')]=_0x59954f;if(_0x4e1925[_0xeef5('0x2e')][_0xeef5('0x3f')]){_0x15f1b2['include']=[{'all':!![]}];}return db[_0xeef5('0x2b')][_0xeef5('0x40')](_0x15f1b2);})[_0xeef5('0x23')](function(_0x40ea28){_0x5f22fb['rows']=_0x40ea28;return _0x5f22fb;})[_0xeef5('0x23')](respondWithFilteredResult(_0x92a826,_0x15f1b2))[_0xeef5('0x41')](handleError(_0x92a826,null));};exports[_0xeef5('0x42')]=function(_0x36625c,_0x538037){var _0x5e9d9e={'raw':![],'where':{'id':_0x36625c[_0xeef5('0x43')]['id']}},_0x3d0587={};_0x3d0587[_0xeef5('0x2d')]=_[_0xeef5('0x2f')](db['ZohoConfiguration']['rawAttributes']);_0x3d0587[_0xeef5('0x2e')]=_[_0xeef5('0x2f')](_0x36625c[_0xeef5('0x2e')]);_0x3d0587[_0xeef5('0x30')]=_['intersection'](_0x3d0587[_0xeef5('0x2d')],_0x3d0587[_0xeef5('0x2e')]);_0x5e9d9e[_0xeef5('0x32')]=_[_0xeef5('0x31')](_0x3d0587[_0xeef5('0x2d')],qs[_0xeef5('0x33')](_0x36625c[_0xeef5('0x2e')][_0xeef5('0x33')]));_0x5e9d9e[_0xeef5('0x32')]=_0x5e9d9e['attributes'][_0xeef5('0x34')]?_0x5e9d9e[_0xeef5('0x32')]:_0x3d0587[_0xeef5('0x2d')];if(_0x36625c[_0xeef5('0x2e')][_0xeef5('0x3f')]){_0x5e9d9e[_0xeef5('0x44')]=[{'all':!![]}];}_0x5e9d9e=_[_0xeef5('0x3b')]({},_0x5e9d9e,_0x36625c['options']);return db[_0xeef5('0x2b')][_0xeef5('0x45')](_0x5e9d9e)[_0xeef5('0x23')](handleEntityNotFound(_0x538037,null))[_0xeef5('0x23')](respondWithResult(_0x538037,null))[_0xeef5('0x41')](handleError(_0x538037,null));};exports[_0xeef5('0x46')]=function(_0x22c89f,_0x15d3c9){return db['ZohoConfiguration']['create'](_0x22c89f[_0xeef5('0x47')],{})[_0xeef5('0x23')](respondWithResult(_0x15d3c9,0xc9))[_0xeef5('0x41')](handleError(_0x15d3c9,null));};exports['update']=function(_0x19ca99,_0x92ceff){if(_0x19ca99[_0xeef5('0x47')]['id']){delete _0x19ca99[_0xeef5('0x47')]['id'];}return db[_0xeef5('0x2b')][_0xeef5('0x45')]({'where':{'id':_0x19ca99[_0xeef5('0x43')]['id']}})[_0xeef5('0x23')](handleEntityNotFound(_0x92ceff,null))[_0xeef5('0x23')](saveUpdates(_0x19ca99[_0xeef5('0x47')],null))['then'](respondWithResult(_0x92ceff,null))[_0xeef5('0x41')](handleError(_0x92ceff,null));};exports[_0xeef5('0x24')]=function(_0x324d5b,_0x313c5c){return db[_0xeef5('0x2b')]['find']({'where':{'id':_0x324d5b[_0xeef5('0x43')]['id']}})[_0xeef5('0x23')](handleEntityNotFound(_0x313c5c,null))[_0xeef5('0x23')](removeEntity(_0x313c5c,null))[_0xeef5('0x41')](handleError(_0x313c5c,null));};exports[_0xeef5('0x48')]=function(_0x200cbf,_0x56728b,_0x4e46de){var _0x43de71={};var _0x5a1f81={};var _0xc3b2dc;var _0x59d308;return db[_0xeef5('0x2b')][_0xeef5('0x49')]({'where':{'id':_0x200cbf['params']['id']}})[_0xeef5('0x23')](handleEntityNotFound(_0x56728b,null))[_0xeef5('0x23')](function(_0x264609){if(_0x264609){_0xc3b2dc=_0x264609;_0x5a1f81[_0xeef5('0x2d')]=_['keys'](db['ZohoField'][_0xeef5('0x4a')]);_0x5a1f81[_0xeef5('0x2e')]=_[_0xeef5('0x2f')](_0x200cbf[_0xeef5('0x2e')]);_0x5a1f81[_0xeef5('0x30')]=_[_0xeef5('0x31')](_0x5a1f81[_0xeef5('0x2d')],_0x5a1f81[_0xeef5('0x2e')]);_0x43de71[_0xeef5('0x32')]=_[_0xeef5('0x31')](_0x5a1f81[_0xeef5('0x2d')],qs[_0xeef5('0x33')](_0x200cbf[_0xeef5('0x2e')][_0xeef5('0x33')]));_0x43de71[_0xeef5('0x32')]=_0x43de71[_0xeef5('0x32')][_0xeef5('0x34')]?_0x43de71['attributes']:_0x5a1f81[_0xeef5('0x2d')];_0x43de71['order']=qs[_0xeef5('0x37')](_0x200cbf[_0xeef5('0x2e')][_0xeef5('0x37')]);_0x43de71[_0xeef5('0x38')]=qs[_0xeef5('0x30')](_['pick'](_0x200cbf[_0xeef5('0x2e')],_0x5a1f81[_0xeef5('0x30')]));if(_0x200cbf[_0xeef5('0x2e')][_0xeef5('0x3a')]){_0x43de71['where']=_[_0xeef5('0x3b')](_0x43de71[_0xeef5('0x38')],{'$or':_[_0xeef5('0x2a')](_0x43de71[_0xeef5('0x32')],function(_0x1113f7){var _0x1732a5={};_0x1732a5[_0x1113f7]={'$like':'%'+_0x200cbf[_0xeef5('0x2e')][_0xeef5('0x3a')]+'%'};return _0x1732a5;})});}_0x43de71=_[_0xeef5('0x3b')]({},_0x43de71,_0x200cbf[_0xeef5('0x3e')]);return _0xc3b2dc[_0xeef5('0x48')](_0x43de71);}})['then'](function(_0x5e6ee1){if(_0x5e6ee1){_0x59d308=_0x5e6ee1['length'];if(!_0x200cbf[_0xeef5('0x2e')][_0xeef5('0x4b')](_0xeef5('0x35'))){_0x43de71[_0xeef5('0x1b')]=qs[_0xeef5('0x1b')](_0x200cbf['query'][_0xeef5('0x1b')]);_0x43de71[_0xeef5('0x19')]=qs[_0xeef5('0x19')](_0x200cbf[_0xeef5('0x2e')]['offset']);}return _0xc3b2dc['getFields'](_0x43de71);}})[_0xeef5('0x23')](function(_0x111340){if(_0x111340){return _0x111340?{'count':_0x59d308,'rows':_0x111340}:null;}})['then'](respondWithResult(_0x56728b,null))[_0xeef5('0x41')](handleError(_0x56728b,null));};exports[_0xeef5('0x4c')]=function(_0x461b31,_0x19b327,_0x5303f6){var _0x148152={};var _0x4b3baf={};var _0x37cdfb;var _0x434f2b;return db[_0xeef5('0x2b')][_0xeef5('0x49')]({'where':{'id':_0x461b31[_0xeef5('0x43')]['id']}})[_0xeef5('0x23')](handleEntityNotFound(_0x19b327,null))[_0xeef5('0x23')](function(_0x5314ac){if(_0x5314ac){_0x37cdfb=_0x5314ac;_0x4b3baf[_0xeef5('0x2d')]=_[_0xeef5('0x2f')](db['ZohoField'][_0xeef5('0x4a')]);_0x4b3baf['query']=_[_0xeef5('0x2f')](_0x461b31[_0xeef5('0x2e')]);_0x4b3baf[_0xeef5('0x30')]=_[_0xeef5('0x31')](_0x4b3baf[_0xeef5('0x2d')],_0x4b3baf[_0xeef5('0x2e')]);_0x148152[_0xeef5('0x32')]=_[_0xeef5('0x31')](_0x4b3baf['model'],qs[_0xeef5('0x33')](_0x461b31[_0xeef5('0x2e')][_0xeef5('0x33')]));_0x148152[_0xeef5('0x32')]=_0x148152[_0xeef5('0x32')][_0xeef5('0x34')]?_0x148152[_0xeef5('0x32')]:_0x4b3baf[_0xeef5('0x2d')];_0x148152[_0xeef5('0x36')]=qs[_0xeef5('0x37')](_0x461b31['query'][_0xeef5('0x37')]);_0x148152[_0xeef5('0x38')]=qs['filters'](_[_0xeef5('0x39')](_0x461b31[_0xeef5('0x2e')],_0x4b3baf[_0xeef5('0x30')]));if(_0x461b31['query'][_0xeef5('0x3a')]){_0x148152[_0xeef5('0x38')]=_[_0xeef5('0x3b')](_0x148152['where'],{'$or':_[_0xeef5('0x2a')](_0x148152[_0xeef5('0x32')],function(_0x2dd397){var _0x283696={};_0x283696[_0x2dd397]={'$like':'%'+_0x461b31[_0xeef5('0x2e')][_0xeef5('0x3a')]+'%'};return _0x283696;})});}_0x148152=_[_0xeef5('0x3b')]({},_0x148152,_0x461b31['options']);return _0x37cdfb['getSubjects'](_0x148152);}})[_0xeef5('0x23')](function(_0x30f5fe){if(_0x30f5fe){_0x434f2b=_0x30f5fe['length'];if(!_0x461b31['query'][_0xeef5('0x4b')]('nolimit')){_0x148152[_0xeef5('0x1b')]=qs[_0xeef5('0x1b')](_0x461b31[_0xeef5('0x2e')][_0xeef5('0x1b')]);_0x148152['offset']=qs[_0xeef5('0x19')](_0x461b31['query'][_0xeef5('0x19')]);}return _0x37cdfb[_0xeef5('0x4c')](_0x148152);}})[_0xeef5('0x23')](function(_0x8089b8){if(_0x8089b8){return _0x8089b8?{'count':_0x434f2b,'rows':_0x8089b8}:null;}})[_0xeef5('0x23')](respondWithResult(_0x19b327,null))[_0xeef5('0x41')](handleError(_0x19b327,null));};exports[_0xeef5('0x4d')]=function(_0x24c1c4,_0x1d8bdf,_0x329a95){var _0x19429b={};var _0x3ad644={};var _0x266abd;var _0x91838e;return db[_0xeef5('0x2b')][_0xeef5('0x49')]({'where':{'id':_0x24c1c4[_0xeef5('0x43')]['id']}})['then'](handleEntityNotFound(_0x1d8bdf,null))[_0xeef5('0x23')](function(_0x1a9296){if(_0x1a9296){_0x266abd=_0x1a9296;_0x3ad644[_0xeef5('0x2d')]=_[_0xeef5('0x2f')](db[_0xeef5('0x4e')][_0xeef5('0x4a')]);_0x3ad644[_0xeef5('0x2e')]=_[_0xeef5('0x2f')](_0x24c1c4[_0xeef5('0x2e')]);_0x3ad644[_0xeef5('0x30')]=_[_0xeef5('0x31')](_0x3ad644['model'],_0x3ad644['query']);_0x19429b[_0xeef5('0x32')]=_[_0xeef5('0x31')](_0x3ad644['model'],qs[_0xeef5('0x33')](_0x24c1c4[_0xeef5('0x2e')]['fields']));_0x19429b[_0xeef5('0x32')]=_0x19429b[_0xeef5('0x32')][_0xeef5('0x34')]?_0x19429b[_0xeef5('0x32')]:_0x3ad644[_0xeef5('0x2d')];_0x19429b[_0xeef5('0x36')]=qs[_0xeef5('0x37')](_0x24c1c4[_0xeef5('0x2e')]['sort']);_0x19429b['where']=qs[_0xeef5('0x30')](_['pick'](_0x24c1c4[_0xeef5('0x2e')],_0x3ad644[_0xeef5('0x30')]));if(_0x24c1c4[_0xeef5('0x2e')][_0xeef5('0x3a')]){_0x19429b[_0xeef5('0x38')]=_['merge'](_0x19429b['where'],{'$or':_['map'](_0x19429b[_0xeef5('0x32')],function(_0x48e141){var _0x1bf682={};_0x1bf682[_0x48e141]={'$like':'%'+_0x24c1c4[_0xeef5('0x2e')][_0xeef5('0x3a')]+'%'};return _0x1bf682;})});}_0x19429b=_[_0xeef5('0x3b')]({},_0x19429b,_0x24c1c4[_0xeef5('0x3e')]);return _0x266abd[_0xeef5('0x4d')](_0x19429b);}})[_0xeef5('0x23')](function(_0x38840b){if(_0x38840b){_0x91838e=_0x38840b[_0xeef5('0x34')];if(!_0x24c1c4['query'][_0xeef5('0x4b')]('nolimit')){_0x19429b[_0xeef5('0x1b')]=qs[_0xeef5('0x1b')](_0x24c1c4[_0xeef5('0x2e')][_0xeef5('0x1b')]);_0x19429b[_0xeef5('0x19')]=qs[_0xeef5('0x19')](_0x24c1c4[_0xeef5('0x2e')][_0xeef5('0x19')]);}return _0x266abd[_0xeef5('0x4d')](_0x19429b);}})['then'](function(_0x586e6e){if(_0x586e6e){return _0x586e6e?{'count':_0x91838e,'rows':_0x586e6e}:null;}})[_0xeef5('0x23')](respondWithResult(_0x1d8bdf,null))[_0xeef5('0x41')](handleError(_0x1d8bdf,null));}; \ No newline at end of file +var _0xf67d=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ZohoConfiguration','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','ZohoField','getFields','getSubjects','findOne','getDescriptions','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service'];(function(_0x329437,_0x1de73a){var _0x3789d9=function(_0x37832e){while(--_0x37832e){_0x329437['push'](_0x329437['shift']());}};_0x3789d9(++_0x1de73a);}(_0xf67d,0x12d));var _0xdf67=function(_0x1b3077,_0x226c8e){_0x1b3077=_0x1b3077-0x0;var _0x1a2288=_0xf67d[_0x1b3077];return _0x1a2288;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xdf67('0x0'));var rp=require(_0xdf67('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdf67('0x2'));var util=require(_0xdf67('0x3'));var path=require(_0xdf67('0x4'));var sox=require(_0xdf67('0x5'));var csv=require(_0xdf67('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdf67('0x7'));var squel=require(_0xdf67('0x8'));var crypto=require(_0xdf67('0x9'));var jsforce=require(_0xdf67('0xa'));var deskjs=require(_0xdf67('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdf67('0xc'));var Redis=require(_0xdf67('0xd'));var authService=require(_0xdf67('0xe'));var qs=require(_0xdf67('0xf'));var as=require(_0xdf67('0x10'));var hardwareService=require(_0xdf67('0x11'));var logger=require('../../config/logger')(_0xdf67('0x12'));var utils=require(_0xdf67('0x13'));var config=require(_0xdf67('0x14'));var licenseUtil=require(_0xdf67('0x15'));var db=require(_0xdf67('0x16'))['db'];function respondWithStatusCode(_0x29b49b,_0x135b79){_0x135b79=_0x135b79||0xcc;return function(_0x4ffe37){if(_0x4ffe37){return _0x29b49b['sendStatus'](_0x135b79);}return _0x29b49b[_0xdf67('0x17')](_0x135b79)[_0xdf67('0x18')]();};}function respondWithResult(_0x506b2b,_0x501566){_0x501566=_0x501566||0xc8;return function(_0x3b58ee){if(_0x3b58ee){return _0x506b2b['status'](_0x501566)[_0xdf67('0x19')](_0x3b58ee);}};}function respondWithFilteredResult(_0x21b53c,_0x539e9b){return function(_0x3a0f50){if(_0x3a0f50){var _0x25b158=typeof _0x539e9b[_0xdf67('0x1a')]===_0xdf67('0x1b')&&typeof _0x539e9b[_0xdf67('0x1c')]===_0xdf67('0x1b');var _0x56f851=_0x3a0f50[_0xdf67('0x1d')];var _0x5c0255=_0x25b158?0x0:_0x539e9b[_0xdf67('0x1a')];var _0xb2ef5a=_0x25b158?_0x3a0f50[_0xdf67('0x1d')]:_0x539e9b[_0xdf67('0x1a')]+_0x539e9b[_0xdf67('0x1c')];var _0x49521e;if(_0xb2ef5a>=_0x56f851){_0xb2ef5a=_0x56f851;_0x49521e=0xc8;}else{_0x49521e=0xce;}_0x21b53c['status'](_0x49521e);return _0x21b53c[_0xdf67('0x1e')](_0xdf67('0x1f'),_0x5c0255+'-'+_0xb2ef5a+'/'+_0x56f851)[_0xdf67('0x19')](_0x3a0f50);}return null;};}function patchUpdates(_0x57c617){return function(_0xc76ac6){try{jsonpatch['apply'](_0xc76ac6,_0x57c617,!![]);}catch(_0xa1ba79){return BPromise[_0xdf67('0x20')](_0xa1ba79);}return _0xc76ac6[_0xdf67('0x21')]();};}function saveUpdates(_0x5a22a9,_0x39545c){return function(_0x36383c){if(_0x36383c){return _0x36383c[_0xdf67('0x22')](_0x5a22a9)[_0xdf67('0x23')](function(_0x3a1f2d){return _0x3a1f2d;});}return null;};}function removeEntity(_0x2d85c7,_0x5c313a){return function(_0x43a7a8){if(_0x43a7a8){return _0x43a7a8[_0xdf67('0x24')]()[_0xdf67('0x23')](function(){_0x2d85c7[_0xdf67('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4325be,_0x3d5e8b){return function(_0x1dda7f){if(!_0x1dda7f){_0x4325be[_0xdf67('0x25')](0x194);}return _0x1dda7f;};}function handleError(_0x12cfe3,_0x51cf81){_0x51cf81=_0x51cf81||0x1f4;return function(_0x4c2571){logger[_0xdf67('0x26')](_0x4c2571[_0xdf67('0x27')]);if(_0x4c2571[_0xdf67('0x28')]){delete _0x4c2571[_0xdf67('0x28')];}_0x12cfe3[_0xdf67('0x17')](_0x51cf81)[_0xdf67('0x29')](_0x4c2571);};}exports[_0xdf67('0x2a')]=function(_0xb36374,_0x19bb77){var _0x4103a8={},_0x215685={},_0x36b293={'count':0x0,'rows':[]};var _0x206786=_[_0xdf67('0x2b')](db[_0xdf67('0x2c')]['rawAttributes'],function(_0x1527c8){return{'name':_0x1527c8['fieldName'],'type':_0x1527c8[_0xdf67('0x2d')][_0xdf67('0x2e')]};});_0x215685[_0xdf67('0x2f')]=_[_0xdf67('0x2b')](_0x206786,_0xdf67('0x28'));_0x215685['query']=_[_0xdf67('0x30')](_0xb36374['query']);_0x215685[_0xdf67('0x31')]=_[_0xdf67('0x32')](_0x215685[_0xdf67('0x2f')],_0x215685[_0xdf67('0x33')]);_0x4103a8['attributes']=_[_0xdf67('0x32')](_0x215685[_0xdf67('0x2f')],qs[_0xdf67('0x34')](_0xb36374[_0xdf67('0x33')]['fields']));_0x4103a8['attributes']=_0x4103a8[_0xdf67('0x35')][_0xdf67('0x36')]?_0x4103a8[_0xdf67('0x35')]:_0x215685['model'];if(!_0xb36374['query'][_0xdf67('0x37')](_0xdf67('0x38'))){_0x4103a8['limit']=qs[_0xdf67('0x1c')](_0xb36374[_0xdf67('0x33')][_0xdf67('0x1c')]);_0x4103a8[_0xdf67('0x1a')]=qs['offset'](_0xb36374[_0xdf67('0x33')][_0xdf67('0x1a')]);}_0x4103a8[_0xdf67('0x39')]=qs[_0xdf67('0x3a')](_0xb36374[_0xdf67('0x33')][_0xdf67('0x3a')]);_0x4103a8[_0xdf67('0x3b')]=qs[_0xdf67('0x31')](_[_0xdf67('0x3c')](_0xb36374[_0xdf67('0x33')],_0x215685[_0xdf67('0x31')]),_0x206786);if(_0xb36374[_0xdf67('0x33')][_0xdf67('0x3d')]){_0x4103a8[_0xdf67('0x3b')]=_[_0xdf67('0x3e')](_0x4103a8[_0xdf67('0x3b')],{'$or':_['map'](_0x206786,function(_0x451239){if(_0x451239[_0xdf67('0x2d')]!=='VIRTUAL'){var _0x2c4960={};_0x2c4960[_0x451239[_0xdf67('0x28')]]={'$like':'%'+_0xb36374[_0xdf67('0x33')][_0xdf67('0x3d')]+'%'};return _0x2c4960;}})});}_0x4103a8=_[_0xdf67('0x3e')]({},_0x4103a8,_0xb36374[_0xdf67('0x3f')]);var _0x3ed1dc={'where':_0x4103a8[_0xdf67('0x3b')]};return db['ZohoConfiguration'][_0xdf67('0x1d')](_0x3ed1dc)[_0xdf67('0x23')](function(_0x1593fd){_0x36b293['count']=_0x1593fd;if(_0xb36374[_0xdf67('0x33')]['includeAll']){_0x4103a8[_0xdf67('0x40')]=[{'all':!![]}];}return db[_0xdf67('0x2c')][_0xdf67('0x41')](_0x4103a8);})[_0xdf67('0x23')](function(_0x1205df){_0x36b293[_0xdf67('0x42')]=_0x1205df;return _0x36b293;})['then'](respondWithFilteredResult(_0x19bb77,_0x4103a8))[_0xdf67('0x43')](handleError(_0x19bb77,null));};exports[_0xdf67('0x44')]=function(_0xdd4000,_0x11f255){var _0x633d5b={'raw':![],'where':{'id':_0xdd4000[_0xdf67('0x45')]['id']}},_0x3c13c0={};_0x3c13c0['model']=_[_0xdf67('0x30')](db[_0xdf67('0x2c')][_0xdf67('0x46')]);_0x3c13c0[_0xdf67('0x33')]=_['keys'](_0xdd4000[_0xdf67('0x33')]);_0x3c13c0[_0xdf67('0x31')]=_[_0xdf67('0x32')](_0x3c13c0[_0xdf67('0x2f')],_0x3c13c0[_0xdf67('0x33')]);_0x633d5b[_0xdf67('0x35')]=_[_0xdf67('0x32')](_0x3c13c0[_0xdf67('0x2f')],qs[_0xdf67('0x34')](_0xdd4000[_0xdf67('0x33')][_0xdf67('0x34')]));_0x633d5b[_0xdf67('0x35')]=_0x633d5b[_0xdf67('0x35')][_0xdf67('0x36')]?_0x633d5b['attributes']:_0x3c13c0['model'];if(_0xdd4000['query']['includeAll']){_0x633d5b[_0xdf67('0x40')]=[{'all':!![]}];}_0x633d5b=_[_0xdf67('0x3e')]({},_0x633d5b,_0xdd4000[_0xdf67('0x3f')]);return db[_0xdf67('0x2c')][_0xdf67('0x47')](_0x633d5b)['then'](handleEntityNotFound(_0x11f255,null))[_0xdf67('0x23')](respondWithResult(_0x11f255,null))[_0xdf67('0x43')](handleError(_0x11f255,null));};exports['create']=function(_0x1345e4,_0x1ef9c0){return db[_0xdf67('0x2c')][_0xdf67('0x48')](_0x1345e4[_0xdf67('0x49')],{})[_0xdf67('0x23')](respondWithResult(_0x1ef9c0,0xc9))['catch'](handleError(_0x1ef9c0,null));};exports[_0xdf67('0x22')]=function(_0x2593f8,_0x138ba8){if(_0x2593f8[_0xdf67('0x49')]['id']){delete _0x2593f8[_0xdf67('0x49')]['id'];}return db[_0xdf67('0x2c')][_0xdf67('0x47')]({'where':{'id':_0x2593f8[_0xdf67('0x45')]['id']}})[_0xdf67('0x23')](handleEntityNotFound(_0x138ba8,null))['then'](saveUpdates(_0x2593f8[_0xdf67('0x49')],null))[_0xdf67('0x23')](respondWithResult(_0x138ba8,null))['catch'](handleError(_0x138ba8,null));};exports[_0xdf67('0x24')]=function(_0x111b87,_0x33a204){return db[_0xdf67('0x2c')][_0xdf67('0x47')]({'where':{'id':_0x111b87[_0xdf67('0x45')]['id']}})[_0xdf67('0x23')](handleEntityNotFound(_0x33a204,null))[_0xdf67('0x23')](removeEntity(_0x33a204,null))[_0xdf67('0x43')](handleError(_0x33a204,null));};exports['getFields']=function(_0x4d5e7c,_0x162640,_0x281c10){var _0x40eb31={};var _0x178c5d={};var _0x48468b;var _0x5b45e1;return db[_0xdf67('0x2c')]['findOne']({'where':{'id':_0x4d5e7c[_0xdf67('0x45')]['id']}})[_0xdf67('0x23')](handleEntityNotFound(_0x162640,null))['then'](function(_0x1bb281){if(_0x1bb281){_0x48468b=_0x1bb281;_0x178c5d[_0xdf67('0x2f')]=_[_0xdf67('0x30')](db[_0xdf67('0x4a')]['rawAttributes']);_0x178c5d[_0xdf67('0x33')]=_['keys'](_0x4d5e7c[_0xdf67('0x33')]);_0x178c5d[_0xdf67('0x31')]=_[_0xdf67('0x32')](_0x178c5d['model'],_0x178c5d[_0xdf67('0x33')]);_0x40eb31[_0xdf67('0x35')]=_[_0xdf67('0x32')](_0x178c5d[_0xdf67('0x2f')],qs[_0xdf67('0x34')](_0x4d5e7c[_0xdf67('0x33')]['fields']));_0x40eb31[_0xdf67('0x35')]=_0x40eb31['attributes']['length']?_0x40eb31[_0xdf67('0x35')]:_0x178c5d['model'];_0x40eb31[_0xdf67('0x39')]=qs[_0xdf67('0x3a')](_0x4d5e7c[_0xdf67('0x33')]['sort']);_0x40eb31[_0xdf67('0x3b')]=qs[_0xdf67('0x31')](_[_0xdf67('0x3c')](_0x4d5e7c[_0xdf67('0x33')],_0x178c5d['filters']));if(_0x4d5e7c[_0xdf67('0x33')][_0xdf67('0x3d')]){_0x40eb31['where']=_['merge'](_0x40eb31[_0xdf67('0x3b')],{'$or':_['map'](_0x40eb31[_0xdf67('0x35')],function(_0x1f37f1){var _0x1d0446={};_0x1d0446[_0x1f37f1]={'$like':'%'+_0x4d5e7c[_0xdf67('0x33')]['filter']+'%'};return _0x1d0446;})});}_0x40eb31=_[_0xdf67('0x3e')]({},_0x40eb31,_0x4d5e7c[_0xdf67('0x3f')]);return _0x48468b[_0xdf67('0x4b')](_0x40eb31);}})[_0xdf67('0x23')](function(_0x2435a7){if(_0x2435a7){_0x5b45e1=_0x2435a7['length'];if(!_0x4d5e7c['query'][_0xdf67('0x37')](_0xdf67('0x38'))){_0x40eb31[_0xdf67('0x1c')]=qs['limit'](_0x4d5e7c[_0xdf67('0x33')]['limit']);_0x40eb31[_0xdf67('0x1a')]=qs[_0xdf67('0x1a')](_0x4d5e7c[_0xdf67('0x33')][_0xdf67('0x1a')]);}return _0x48468b[_0xdf67('0x4b')](_0x40eb31);}})[_0xdf67('0x23')](function(_0x23fd9a){if(_0x23fd9a){return _0x23fd9a?{'count':_0x5b45e1,'rows':_0x23fd9a}:null;}})[_0xdf67('0x23')](respondWithResult(_0x162640,null))['catch'](handleError(_0x162640,null));};exports[_0xdf67('0x4c')]=function(_0x42caf1,_0x452815,_0x118f8b){var _0x2f6f17={};var _0x1f9fe1={};var _0x415119;var _0x29c5b0;return db[_0xdf67('0x2c')][_0xdf67('0x4d')]({'where':{'id':_0x42caf1['params']['id']}})['then'](handleEntityNotFound(_0x452815,null))[_0xdf67('0x23')](function(_0x7b7f2e){if(_0x7b7f2e){_0x415119=_0x7b7f2e;_0x1f9fe1[_0xdf67('0x2f')]=_[_0xdf67('0x30')](db[_0xdf67('0x4a')][_0xdf67('0x46')]);_0x1f9fe1['query']=_[_0xdf67('0x30')](_0x42caf1[_0xdf67('0x33')]);_0x1f9fe1['filters']=_[_0xdf67('0x32')](_0x1f9fe1[_0xdf67('0x2f')],_0x1f9fe1[_0xdf67('0x33')]);_0x2f6f17[_0xdf67('0x35')]=_['intersection'](_0x1f9fe1['model'],qs[_0xdf67('0x34')](_0x42caf1[_0xdf67('0x33')][_0xdf67('0x34')]));_0x2f6f17[_0xdf67('0x35')]=_0x2f6f17[_0xdf67('0x35')][_0xdf67('0x36')]?_0x2f6f17['attributes']:_0x1f9fe1[_0xdf67('0x2f')];_0x2f6f17[_0xdf67('0x39')]=qs[_0xdf67('0x3a')](_0x42caf1[_0xdf67('0x33')][_0xdf67('0x3a')]);_0x2f6f17[_0xdf67('0x3b')]=qs[_0xdf67('0x31')](_[_0xdf67('0x3c')](_0x42caf1[_0xdf67('0x33')],_0x1f9fe1[_0xdf67('0x31')]));if(_0x42caf1[_0xdf67('0x33')][_0xdf67('0x3d')]){_0x2f6f17['where']=_[_0xdf67('0x3e')](_0x2f6f17[_0xdf67('0x3b')],{'$or':_[_0xdf67('0x2b')](_0x2f6f17[_0xdf67('0x35')],function(_0x5a3da5){var _0x220664={};_0x220664[_0x5a3da5]={'$like':'%'+_0x42caf1['query'][_0xdf67('0x3d')]+'%'};return _0x220664;})});}_0x2f6f17=_[_0xdf67('0x3e')]({},_0x2f6f17,_0x42caf1[_0xdf67('0x3f')]);return _0x415119[_0xdf67('0x4c')](_0x2f6f17);}})['then'](function(_0x44644e){if(_0x44644e){_0x29c5b0=_0x44644e[_0xdf67('0x36')];if(!_0x42caf1[_0xdf67('0x33')][_0xdf67('0x37')](_0xdf67('0x38'))){_0x2f6f17['limit']=qs['limit'](_0x42caf1[_0xdf67('0x33')][_0xdf67('0x1c')]);_0x2f6f17['offset']=qs[_0xdf67('0x1a')](_0x42caf1['query'][_0xdf67('0x1a')]);}return _0x415119[_0xdf67('0x4c')](_0x2f6f17);}})[_0xdf67('0x23')](function(_0x3035f9){if(_0x3035f9){return _0x3035f9?{'count':_0x29c5b0,'rows':_0x3035f9}:null;}})[_0xdf67('0x23')](respondWithResult(_0x452815,null))[_0xdf67('0x43')](handleError(_0x452815,null));};exports[_0xdf67('0x4e')]=function(_0x224ff6,_0x5dac21,_0x130660){var _0x21e691={};var _0x45a187={};var _0x3568f5;var _0x1a1c08;return db['ZohoConfiguration'][_0xdf67('0x4d')]({'where':{'id':_0x224ff6[_0xdf67('0x45')]['id']}})[_0xdf67('0x23')](handleEntityNotFound(_0x5dac21,null))['then'](function(_0x550fb3){if(_0x550fb3){_0x3568f5=_0x550fb3;_0x45a187['model']=_[_0xdf67('0x30')](db[_0xdf67('0x4a')][_0xdf67('0x46')]);_0x45a187[_0xdf67('0x33')]=_[_0xdf67('0x30')](_0x224ff6[_0xdf67('0x33')]);_0x45a187[_0xdf67('0x31')]=_['intersection'](_0x45a187[_0xdf67('0x2f')],_0x45a187['query']);_0x21e691['attributes']=_[_0xdf67('0x32')](_0x45a187[_0xdf67('0x2f')],qs[_0xdf67('0x34')](_0x224ff6['query']['fields']));_0x21e691[_0xdf67('0x35')]=_0x21e691['attributes']['length']?_0x21e691['attributes']:_0x45a187[_0xdf67('0x2f')];_0x21e691['order']=qs[_0xdf67('0x3a')](_0x224ff6[_0xdf67('0x33')][_0xdf67('0x3a')]);_0x21e691['where']=qs[_0xdf67('0x31')](_[_0xdf67('0x3c')](_0x224ff6['query'],_0x45a187[_0xdf67('0x31')]));if(_0x224ff6[_0xdf67('0x33')][_0xdf67('0x3d')]){_0x21e691['where']=_['merge'](_0x21e691[_0xdf67('0x3b')],{'$or':_['map'](_0x21e691['attributes'],function(_0x145d0e){var _0x5ed732={};_0x5ed732[_0x145d0e]={'$like':'%'+_0x224ff6[_0xdf67('0x33')]['filter']+'%'};return _0x5ed732;})});}_0x21e691=_['merge']({},_0x21e691,_0x224ff6['options']);return _0x3568f5[_0xdf67('0x4e')](_0x21e691);}})[_0xdf67('0x23')](function(_0xa3c2c3){if(_0xa3c2c3){_0x1a1c08=_0xa3c2c3[_0xdf67('0x36')];if(!_0x224ff6[_0xdf67('0x33')][_0xdf67('0x37')](_0xdf67('0x38'))){_0x21e691[_0xdf67('0x1c')]=qs['limit'](_0x224ff6[_0xdf67('0x33')][_0xdf67('0x1c')]);_0x21e691[_0xdf67('0x1a')]=qs[_0xdf67('0x1a')](_0x224ff6[_0xdf67('0x33')]['offset']);}return _0x3568f5[_0xdf67('0x4e')](_0x21e691);}})[_0xdf67('0x23')](function(_0x20714e){if(_0x20714e){return _0x20714e?{'count':_0x1a1c08,'rows':_0x20714e}:null;}})[_0xdf67('0x23')](respondWithResult(_0x5dac21,null))[_0xdf67('0x43')](handleError(_0x5dac21,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 0e0fdda..49cb67d 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 _0x393e=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','int_zoho_configurations','util'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x393e,0x175));var _0xe393=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0x393e[_0x2d2c16];return _0x53f2fb;};'use strict';var _=require('lodash');var util=require(_0xe393('0x0'));var logger=require(_0xe393('0x1'))(_0xe393('0x2'));var moment=require('moment');var BPromise=require(_0xe393('0x3'));var rp=require(_0xe393('0x4'));var fs=require('fs');var path=require(_0xe393('0x5'));var rimraf=require(_0xe393('0x6'));var config=require(_0xe393('0x7'));var attributes=require(_0xe393('0x8'));module[_0xe393('0x9')]=function(_0x219424,_0xd47f65){return _0x219424['define']('ZohoConfiguration',attributes,{'tableName':_0xe393('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7030=['./intZohoConfiguration.attributes','ZohoConfiguration','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x7030,0xc8));var _0x0703=function(_0x59e834,_0x471eea){_0x59e834=_0x59e834-0x0;var _0x4e87d1=_0x7030[_0x59e834];return _0x4e87d1;};'use strict';var _=require('lodash');var util=require(_0x0703('0x0'));var logger=require(_0x0703('0x1'))(_0x0703('0x2'));var moment=require('moment');var BPromise=require(_0x0703('0x3'));var rp=require(_0x0703('0x4'));var fs=require('fs');var path=require(_0x0703('0x5'));var rimraf=require(_0x0703('0x6'));var config=require('../../config/environment');var attributes=require(_0x0703('0x7'));module['exports']=function(_0x1a0bca,_0x4fe820){return _0x1a0bca['define'](_0x0703('0x8'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index 06c7d99..3402448 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 _0xdee4=['info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','then'];(function(_0x4b2cc6,_0x29ef43){var _0x3e0b08=function(_0x3b4131){while(--_0x3b4131){_0x4b2cc6['push'](_0x4b2cc6['shift']());}};_0x3e0b08(++_0x29ef43);}(_0xdee4,0x1e9));var _0x4dee=function(_0xbec2cd,_0xcf1938){_0xbec2cd=_0xbec2cd-0x0;var _0x38142e=_0xdee4[_0xbec2cd];return _0x38142e;};'use strict';var _=require(_0x4dee('0x0'));var util=require('util');var moment=require(_0x4dee('0x1'));var BPromise=require(_0x4dee('0x2'));var rs=require(_0x4dee('0x3'));var fs=require('fs');var Redis=require(_0x4dee('0x4'));var db=require(_0x4dee('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4dee('0x6'));var config=require(_0x4dee('0x7'));var jayson=require(_0x4dee('0x8'));var client=jayson[_0x4dee('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x274a06,_0x460f28,_0xf66b92){return new BPromise(function(_0x2a1418,_0x1d6310){return client['request'](_0x274a06,_0xf66b92)[_0x4dee('0xa')](function(_0x3441a3){logger[_0x4dee('0xb')](_0x4dee('0xc'),_0x460f28,_0x4dee('0xd'));logger[_0x4dee('0xe')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x460f28,_0x4dee('0xd'),JSON[_0x4dee('0xf')](_0x3441a3));if(_0x3441a3[_0x4dee('0x10')]){if(_0x3441a3[_0x4dee('0x10')][_0x4dee('0x11')]===0x1f4){logger[_0x4dee('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x460f28,_0x3441a3[_0x4dee('0x10')]['message']);return _0x1d6310(_0x3441a3['error'][_0x4dee('0x12')]);}logger[_0x4dee('0x10')](_0x4dee('0xc'),_0x460f28,_0x3441a3['error']['message']);return _0x2a1418(_0x3441a3[_0x4dee('0x10')][_0x4dee('0x12')]);}else{logger['info'](_0x4dee('0xc'),_0x460f28,_0x4dee('0xd'));_0x2a1418(_0x3441a3[_0x4dee('0x13')]['message']);}})['catch'](function(_0x38bae7){logger[_0x4dee('0x10')](_0x4dee('0xc'),_0x460f28,_0x38bae7);_0x1d6310(_0x38bae7);});});} \ No newline at end of file +var _0x1bc5=['code','message','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x11c30d,_0x566175){var _0x43c1b3=function(_0x29941d){while(--_0x29941d){_0x11c30d['push'](_0x11c30d['shift']());}};_0x43c1b3(++_0x566175);}(_0x1bc5,0xa2));var _0x51bc=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x1bc5[_0x55e08b];return _0xd1a7ff;};'use strict';var _=require(_0x51bc('0x0'));var util=require('util');var moment=require(_0x51bc('0x1'));var BPromise=require(_0x51bc('0x2'));var rs=require(_0x51bc('0x3'));var fs=require('fs');var Redis=require(_0x51bc('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x51bc('0x5'))(_0x51bc('0x6'));var config=require(_0x51bc('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x51bc('0x8')][_0x51bc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2892c6,_0x34e550,_0x4c66b5){return new BPromise(function(_0x175e47,_0x252177){return client[_0x51bc('0xa')](_0x2892c6,_0x4c66b5)[_0x51bc('0xb')](function(_0x36d271){logger[_0x51bc('0xc')](_0x51bc('0xd'),_0x34e550,'request\x20sent');logger['debug'](_0x51bc('0xe'),_0x34e550,_0x51bc('0xf'),JSON[_0x51bc('0x10')](_0x36d271));if(_0x36d271[_0x51bc('0x11')]){if(_0x36d271[_0x51bc('0x11')][_0x51bc('0x12')]===0x1f4){logger[_0x51bc('0x11')](_0x51bc('0xd'),_0x34e550,_0x36d271['error'][_0x51bc('0x13')]);return _0x252177(_0x36d271['error'][_0x51bc('0x13')]);}logger[_0x51bc('0x11')](_0x51bc('0xd'),_0x34e550,_0x36d271[_0x51bc('0x11')][_0x51bc('0x13')]);return _0x175e47(_0x36d271[_0x51bc('0x11')][_0x51bc('0x13')]);}else{logger[_0x51bc('0xc')]('ZohoConfiguration,\x20%s,\x20%s',_0x34e550,'request\x20sent');_0x175e47(_0x36d271['result'][_0x51bc('0x13')]);}})['catch'](function(_0x21181e){logger[_0x51bc('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x34e550,_0x21181e);_0x252177(_0x21181e);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 40eb015..0a135e0 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 _0x88f2=['../../config/environment','./intZohoField.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x428a33,_0x5e26d4){var _0x1aa64a=function(_0x4e1e5c){while(--_0x4e1e5c){_0x428a33['push'](_0x428a33['shift']());}};_0x1aa64a(++_0x5e26d4);}(_0x88f2,0x91));var _0x288f=function(_0x307ec0,_0xa20737){_0x307ec0=_0x307ec0-0x0;var _0x34f6a5=_0x88f2[_0x307ec0];return _0x34f6a5;};'use strict';var multer=require(_0x288f('0x0'));var util=require(_0x288f('0x1'));var path=require(_0x288f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x288f('0x3')]();var fs_extra=require(_0x288f('0x4'));var auth=require(_0x288f('0x5'));var interaction=require(_0x288f('0x6'));var config=require(_0x288f('0x7'));var controller=require(_0x288f('0x8'));router['get']('/',auth[_0x288f('0x9')](),controller[_0x288f('0xa')]);router[_0x288f('0xb')](_0x288f('0xc'),auth[_0x288f('0x9')](),controller[_0x288f('0xd')]);router[_0x288f('0xe')]('/',auth['isAuthenticated'](),controller[_0x288f('0xf')]);router[_0x288f('0x10')](_0x288f('0xc'),auth[_0x288f('0x9')](),controller[_0x288f('0x11')]);router[_0x288f('0x12')]('/:id',auth[_0x288f('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x1e72=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./intZohoField.controller','get','isAuthenticated','index','/:id','post','create','put','delete','destroy','multer','util'];(function(_0x315ba9,_0x365e0d){var _0x5d4545=function(_0x271985){while(--_0x271985){_0x315ba9['push'](_0x315ba9['shift']());}};_0x5d4545(++_0x365e0d);}(_0x1e72,0x163));var _0x21e7=function(_0x2024a8,_0x4713e3){_0x2024a8=_0x2024a8-0x0;var _0x45e43a=_0x1e72[_0x2024a8];return _0x45e43a;};'use strict';var multer=require(_0x21e7('0x0'));var util=require(_0x21e7('0x1'));var path=require(_0x21e7('0x2'));var timeout=require(_0x21e7('0x3'));var express=require('express');var router=express[_0x21e7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x21e7('0x5'));var interaction=require(_0x21e7('0x6'));var config=require('../../config/environment');var controller=require(_0x21e7('0x7'));router[_0x21e7('0x8')]('/',auth[_0x21e7('0x9')](),controller[_0x21e7('0xa')]);router[_0x21e7('0x8')](_0x21e7('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x21e7('0xc')]('/',auth[_0x21e7('0x9')](),controller[_0x21e7('0xd')]);router[_0x21e7('0xe')](_0x21e7('0xb'),auth[_0x21e7('0x9')](),controller['update']);router[_0x21e7('0xf')]('/:id',auth[_0x21e7('0x9')](),controller[_0x21e7('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 099be15..f95191d 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 _0x4f17=['customVariable','keyValue','picklist','STRING','ENUM','BOOLEAN','sequelize','exports','string'];(function(_0x5658e8,_0x319d8e){var _0x5b1f04=function(_0x1ba0d6){while(--_0x1ba0d6){_0x5658e8['push'](_0x5658e8['shift']());}};_0x5b1f04(++_0x319d8e);}(_0x4f17,0x9f));var _0x74f1=function(_0x2d0953,_0x30bcf9){_0x2d0953=_0x2d0953-0x0;var _0x1e824a=_0x4f17[_0x2d0953];return _0x1e824a;};'use strict';var Sequelize=require(_0x74f1('0x0'));module[_0x74f1('0x1')]={'type':{'type':Sequelize['ENUM'](_0x74f1('0x2'),'variable',_0x74f1('0x3'),_0x74f1('0x4'),_0x74f1('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x74f1('0x6')]},'keyType':{'type':Sequelize[_0x74f1('0x7')](_0x74f1('0x2'),'variable',_0x74f1('0x3'))},'keyContent':{'type':Sequelize[_0x74f1('0x6')]},'idField':{'type':Sequelize[_0x74f1('0x6')]},'nameField':{'type':Sequelize[_0x74f1('0x6')]},'customField':{'type':Sequelize[_0x74f1('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x74f1('0x6')]}}; \ No newline at end of file +var _0x8c18=['keyValue','picklist','string','STRING','variable','BOOLEAN','exports','ENUM','customVariable'];(function(_0x261e7e,_0x1d9fa9){var _0x402e95=function(_0x2b0dae){while(--_0x2b0dae){_0x261e7e['push'](_0x261e7e['shift']());}};_0x402e95(++_0x1d9fa9);}(_0x8c18,0x19b));var _0x88c1=function(_0xa7f143,_0x58cd69){_0xa7f143=_0xa7f143-0x0;var _0x18e29c=_0x8c18[_0xa7f143];return _0x18e29c;};'use strict';var Sequelize=require('sequelize');module[_0x88c1('0x0')]={'type':{'type':Sequelize[_0x88c1('0x1')]('string','variable',_0x88c1('0x2'),_0x88c1('0x3'),_0x88c1('0x4')),'defaultValue':_0x88c1('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x88c1('0x6')]},'keyType':{'type':Sequelize[_0x88c1('0x1')](_0x88c1('0x5'),_0x88c1('0x7'),_0x88c1('0x2'))},'keyContent':{'type':Sequelize[_0x88c1('0x6')]},'idField':{'type':Sequelize[_0x88c1('0x6')]},'nameField':{'type':Sequelize[_0x88c1('0x6')]},'customField':{'type':Sequelize[_0x88c1('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x88c1('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index a84b0b9..fe77060 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 _0xf663=['to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','offset','count','limit','set','Content-Range','apply','reject','then','stack','name','send','index','ZohoField','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','length','find','create','body','update','destroy','rimraf','zip-dir','fast-json-patch','request-promise','path','sox'];(function(_0x132a33,_0x238ebb){var _0x252bd6=function(_0x48ed75){while(--_0x48ed75){_0x132a33['push'](_0x132a33['shift']());}};_0x252bd6(++_0x238ebb);}(_0xf663,0x1aa));var _0x3f66=function(_0x4ffb48,_0x39f258){_0x4ffb48=_0x4ffb48-0x0;var _0x3cb5c2=_0xf663[_0x4ffb48];return _0x3cb5c2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3f66('0x0'));var zipdir=require(_0x3f66('0x1'));var jsonpatch=require(_0x3f66('0x2'));var rp=require(_0x3f66('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x3f66('0x4'));var sox=require(_0x3f66('0x5'));var csv=require(_0x3f66('0x6'));var ejs=require(_0x3f66('0x7'));var fs=require('fs');var fs_extra=require(_0x3f66('0x8'));var _=require(_0x3f66('0x9'));var squel=require(_0x3f66('0xa'));var crypto=require(_0x3f66('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x3f66('0xc'));var toCsv=require(_0x3f66('0x6'));var querystring=require(_0x3f66('0xd'));var Papa=require(_0x3f66('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3f66('0xf'));var as=require(_0x3f66('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3f66('0x11'))(_0x3f66('0x12'));var utils=require('../../config/utils');var config=require(_0x3f66('0x13'));var licenseUtil=require(_0x3f66('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x41e62f,_0x46f499){_0x46f499=_0x46f499||0xcc;return function(_0x30d368){if(_0x30d368){return _0x41e62f[_0x3f66('0x15')](_0x46f499);}return _0x41e62f['status'](_0x46f499)[_0x3f66('0x16')]();};}function respondWithResult(_0x19a5d5,_0x502156){_0x502156=_0x502156||0xc8;return function(_0x127546){if(_0x127546){return _0x19a5d5[_0x3f66('0x17')](_0x502156)[_0x3f66('0x18')](_0x127546);}};}function respondWithFilteredResult(_0x10c4bf,_0x387625){return function(_0x80838c){if(_0x80838c){var _0x2b290f=typeof _0x387625['offset']===_0x3f66('0x19')&&typeof _0x387625['limit']===_0x3f66('0x19');var _0x2575dd=_0x80838c['count'];var _0x383bb9=_0x2b290f?0x0:_0x387625[_0x3f66('0x1a')];var _0x5c6806=_0x2b290f?_0x80838c[_0x3f66('0x1b')]:_0x387625['offset']+_0x387625[_0x3f66('0x1c')];var _0x3a2b32;if(_0x5c6806>=_0x2575dd){_0x5c6806=_0x2575dd;_0x3a2b32=0xc8;}else{_0x3a2b32=0xce;}_0x10c4bf['status'](_0x3a2b32);return _0x10c4bf[_0x3f66('0x1d')](_0x3f66('0x1e'),_0x383bb9+'-'+_0x5c6806+'/'+_0x2575dd)[_0x3f66('0x18')](_0x80838c);}return null;};}function patchUpdates(_0x2908e0){return function(_0x4ef786){try{jsonpatch[_0x3f66('0x1f')](_0x4ef786,_0x2908e0,!![]);}catch(_0x2365e4){return BPromise[_0x3f66('0x20')](_0x2365e4);}return _0x4ef786['save']();};}function saveUpdates(_0x304302,_0x45ceae){return function(_0xd7b93a){if(_0xd7b93a){return _0xd7b93a['update'](_0x304302)['then'](function(_0x183dbe){return _0x183dbe;});}return null;};}function removeEntity(_0x49deeb,_0x441f83){return function(_0x1bdd37){if(_0x1bdd37){return _0x1bdd37['destroy']()[_0x3f66('0x21')](function(){_0x49deeb[_0x3f66('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47206f,_0x1fbba9){return function(_0x4e3671){if(!_0x4e3671){_0x47206f[_0x3f66('0x15')](0x194);}return _0x4e3671;};}function handleError(_0x376102,_0x4cfeea){_0x4cfeea=_0x4cfeea||0x1f4;return function(_0x436c25){logger['error'](_0x436c25[_0x3f66('0x22')]);if(_0x436c25[_0x3f66('0x23')]){delete _0x436c25[_0x3f66('0x23')];}_0x376102[_0x3f66('0x17')](_0x4cfeea)[_0x3f66('0x24')](_0x436c25);};}exports[_0x3f66('0x25')]=function(_0x484c49,_0xcd0fdc){var _0x2f544b={},_0x3e15e5={},_0x3ebd49={'count':0x0,'rows':[]};var _0x2acecb=_['map'](db[_0x3f66('0x26')]['rawAttributes'],function(_0x21c034){return{'name':_0x21c034[_0x3f66('0x27')],'type':_0x21c034[_0x3f66('0x28')][_0x3f66('0x29')]};});_0x3e15e5['model']=_['map'](_0x2acecb,_0x3f66('0x23'));_0x3e15e5[_0x3f66('0x2a')]=_['keys'](_0x484c49['query']);_0x3e15e5[_0x3f66('0x2b')]=_[_0x3f66('0x2c')](_0x3e15e5[_0x3f66('0x2d')],_0x3e15e5[_0x3f66('0x2a')]);_0x2f544b[_0x3f66('0x2e')]=_[_0x3f66('0x2c')](_0x3e15e5[_0x3f66('0x2d')],qs[_0x3f66('0x2f')](_0x484c49[_0x3f66('0x2a')]['fields']));_0x2f544b[_0x3f66('0x2e')]=_0x2f544b[_0x3f66('0x2e')]['length']?_0x2f544b[_0x3f66('0x2e')]:_0x3e15e5[_0x3f66('0x2d')];if(!_0x484c49[_0x3f66('0x2a')][_0x3f66('0x30')]('nolimit')){_0x2f544b[_0x3f66('0x1c')]=qs[_0x3f66('0x1c')](_0x484c49[_0x3f66('0x2a')][_0x3f66('0x1c')]);_0x2f544b[_0x3f66('0x1a')]=qs[_0x3f66('0x1a')](_0x484c49[_0x3f66('0x2a')][_0x3f66('0x1a')]);}_0x2f544b[_0x3f66('0x31')]=qs['sort'](_0x484c49['query'][_0x3f66('0x32')]);_0x2f544b[_0x3f66('0x33')]=qs['filters'](_[_0x3f66('0x34')](_0x484c49[_0x3f66('0x2a')],_0x3e15e5[_0x3f66('0x2b')]),_0x2acecb);if(_0x484c49[_0x3f66('0x2a')][_0x3f66('0x35')]){_0x2f544b[_0x3f66('0x33')]=_[_0x3f66('0x36')](_0x2f544b[_0x3f66('0x33')],{'$or':_['map'](_0x2acecb,function(_0x2d147d){if(_0x2d147d['type']!==_0x3f66('0x37')){var _0xe3bc80={};_0xe3bc80[_0x2d147d[_0x3f66('0x23')]]={'$like':'%'+_0x484c49['query'][_0x3f66('0x35')]+'%'};return _0xe3bc80;}})});}_0x2f544b=_[_0x3f66('0x36')]({},_0x2f544b,_0x484c49[_0x3f66('0x38')]);var _0xe70d33={'where':_0x2f544b['where']};return db[_0x3f66('0x26')][_0x3f66('0x1b')](_0xe70d33)[_0x3f66('0x21')](function(_0x458ce3){_0x3ebd49['count']=_0x458ce3;if(_0x484c49[_0x3f66('0x2a')][_0x3f66('0x39')]){_0x2f544b[_0x3f66('0x3a')]=[{'all':!![]}];}return db[_0x3f66('0x26')][_0x3f66('0x3b')](_0x2f544b);})[_0x3f66('0x21')](function(_0xba458){_0x3ebd49[_0x3f66('0x3c')]=_0xba458;return _0x3ebd49;})[_0x3f66('0x21')](respondWithFilteredResult(_0xcd0fdc,_0x2f544b))[_0x3f66('0x3d')](handleError(_0xcd0fdc,null));};exports[_0x3f66('0x3e')]=function(_0xece6cd,_0x239372){var _0x27f784={'raw':!![],'where':{'id':_0xece6cd[_0x3f66('0x3f')]['id']}},_0x1bdd77={};_0x1bdd77['model']=_[_0x3f66('0x40')](db[_0x3f66('0x26')][_0x3f66('0x41')]);_0x1bdd77['query']=_['keys'](_0xece6cd[_0x3f66('0x2a')]);_0x1bdd77[_0x3f66('0x2b')]=_[_0x3f66('0x2c')](_0x1bdd77[_0x3f66('0x2d')],_0x1bdd77['query']);_0x27f784['attributes']=_[_0x3f66('0x2c')](_0x1bdd77[_0x3f66('0x2d')],qs['fields'](_0xece6cd[_0x3f66('0x2a')]['fields']));_0x27f784[_0x3f66('0x2e')]=_0x27f784['attributes'][_0x3f66('0x42')]?_0x27f784['attributes']:_0x1bdd77[_0x3f66('0x2d')];if(_0xece6cd[_0x3f66('0x2a')][_0x3f66('0x39')]){_0x27f784[_0x3f66('0x3a')]=[{'all':!![]}];}_0x27f784=_[_0x3f66('0x36')]({},_0x27f784,_0xece6cd[_0x3f66('0x38')]);return db['ZohoField'][_0x3f66('0x43')](_0x27f784)[_0x3f66('0x21')](handleEntityNotFound(_0x239372,null))['then'](respondWithResult(_0x239372,null))[_0x3f66('0x3d')](handleError(_0x239372,null));};exports['create']=function(_0x339b7c,_0x548532){return db[_0x3f66('0x26')][_0x3f66('0x44')](_0x339b7c[_0x3f66('0x45')],{})['then'](respondWithResult(_0x548532,0xc9))['catch'](handleError(_0x548532,null));};exports[_0x3f66('0x46')]=function(_0x16da7d,_0x2b17ed){if(_0x16da7d[_0x3f66('0x45')]['id']){delete _0x16da7d[_0x3f66('0x45')]['id'];}return db['ZohoField'][_0x3f66('0x43')]({'where':{'id':_0x16da7d['params']['id']}})['then'](handleEntityNotFound(_0x2b17ed,null))[_0x3f66('0x21')](saveUpdates(_0x16da7d[_0x3f66('0x45')],null))[_0x3f66('0x21')](respondWithResult(_0x2b17ed,null))[_0x3f66('0x3d')](handleError(_0x2b17ed,null));};exports[_0x3f66('0x47')]=function(_0x228bf7,_0x143eaa){return db['ZohoField'][_0x3f66('0x43')]({'where':{'id':_0x228bf7['params']['id']}})['then'](handleEntityNotFound(_0x143eaa,null))[_0x3f66('0x21')](removeEntity(_0x143eaa,null))[_0x3f66('0x3d')](handleError(_0x143eaa,null));}; \ No newline at end of file +var _0xca0f=['ZohoField','rawAttributes','fieldName','type','key','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','catch','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map'];(function(_0x5b7534,_0x1e9bb7){var _0x18730d=function(_0x51eff9){while(--_0x51eff9){_0x5b7534['push'](_0x5b7534['shift']());}};_0x18730d(++_0x1e9bb7);}(_0xca0f,0x1b0));var _0xfca0=function(_0x29c234,_0x572d10){_0x29c234=_0x29c234-0x0;var _0x4dc7b9=_0xca0f[_0x29c234];return _0x4dc7b9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfca0('0x0'));var zipdir=require(_0xfca0('0x1'));var jsonpatch=require(_0xfca0('0x2'));var rp=require(_0xfca0('0x3'));var moment=require(_0xfca0('0x4'));var BPromise=require(_0xfca0('0x5'));var Mustache=require('mustache');var util=require(_0xfca0('0x6'));var path=require('path');var sox=require(_0xfca0('0x7'));var csv=require(_0xfca0('0x8'));var ejs=require(_0xfca0('0x9'));var fs=require('fs');var fs_extra=require(_0xfca0('0xa'));var _=require('lodash');var squel=require(_0xfca0('0xb'));var crypto=require(_0xfca0('0xc'));var jsforce=require(_0xfca0('0xd'));var deskjs=require(_0xfca0('0xe'));var toCsv=require(_0xfca0('0x8'));var querystring=require(_0xfca0('0xf'));var Papa=require(_0xfca0('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xfca0('0x11'));var as=require(_0xfca0('0x12'));var hardwareService=require(_0xfca0('0x13'));var logger=require(_0xfca0('0x14'))(_0xfca0('0x15'));var utils=require(_0xfca0('0x16'));var config=require(_0xfca0('0x17'));var licenseUtil=require(_0xfca0('0x18'));var db=require(_0xfca0('0x19'))['db'];function respondWithStatusCode(_0x27fc56,_0x317772){_0x317772=_0x317772||0xcc;return function(_0x26277c){if(_0x26277c){return _0x27fc56[_0xfca0('0x1a')](_0x317772);}return _0x27fc56['status'](_0x317772)[_0xfca0('0x1b')]();};}function respondWithResult(_0x647fa3,_0xaddb0){_0xaddb0=_0xaddb0||0xc8;return function(_0x3f5d38){if(_0x3f5d38){return _0x647fa3[_0xfca0('0x1c')](_0xaddb0)['json'](_0x3f5d38);}};}function respondWithFilteredResult(_0x1a3ff7,_0x3dd22d){return function(_0x52b194){if(_0x52b194){var _0x23f787=typeof _0x3dd22d['offset']===_0xfca0('0x1d')&&typeof _0x3dd22d['limit']==='undefined';var _0x96417a=_0x52b194['count'];var _0xef080e=_0x23f787?0x0:_0x3dd22d['offset'];var _0x42358a=_0x23f787?_0x52b194[_0xfca0('0x1e')]:_0x3dd22d[_0xfca0('0x1f')]+_0x3dd22d[_0xfca0('0x20')];var _0x5ec314;if(_0x42358a>=_0x96417a){_0x42358a=_0x96417a;_0x5ec314=0xc8;}else{_0x5ec314=0xce;}_0x1a3ff7[_0xfca0('0x1c')](_0x5ec314);return _0x1a3ff7[_0xfca0('0x21')](_0xfca0('0x22'),_0xef080e+'-'+_0x42358a+'/'+_0x96417a)[_0xfca0('0x23')](_0x52b194);}return null;};}function patchUpdates(_0x5bdedf){return function(_0x18cd9d){try{jsonpatch[_0xfca0('0x24')](_0x18cd9d,_0x5bdedf,!![]);}catch(_0x5d7d65){return BPromise[_0xfca0('0x25')](_0x5d7d65);}return _0x18cd9d[_0xfca0('0x26')]();};}function saveUpdates(_0x53f1b9,_0x3b169f){return function(_0x159508){if(_0x159508){return _0x159508[_0xfca0('0x27')](_0x53f1b9)[_0xfca0('0x28')](function(_0x5c4dfd){return _0x5c4dfd;});}return null;};}function removeEntity(_0x3c5258,_0x494ebb){return function(_0x182e27){if(_0x182e27){return _0x182e27[_0xfca0('0x29')]()[_0xfca0('0x28')](function(){_0x3c5258[_0xfca0('0x1c')](0xcc)[_0xfca0('0x1b')]();});}};}function handleEntityNotFound(_0x56cba3,_0x588858){return function(_0x3643f0){if(!_0x3643f0){_0x56cba3['sendStatus'](0x194);}return _0x3643f0;};}function handleError(_0x1ff9fb,_0x46c7a6){_0x46c7a6=_0x46c7a6||0x1f4;return function(_0x4cae14){logger[_0xfca0('0x2a')](_0x4cae14[_0xfca0('0x2b')]);if(_0x4cae14[_0xfca0('0x2c')]){delete _0x4cae14[_0xfca0('0x2c')];}_0x1ff9fb[_0xfca0('0x1c')](_0x46c7a6)[_0xfca0('0x2d')](_0x4cae14);};}exports[_0xfca0('0x2e')]=function(_0x244338,_0x24dfa6){var _0x7832ac={},_0x32f7ce={},_0x14a242={'count':0x0,'rows':[]};var _0x14889d=_[_0xfca0('0x2f')](db[_0xfca0('0x30')][_0xfca0('0x31')],function(_0x54282d){return{'name':_0x54282d[_0xfca0('0x32')],'type':_0x54282d[_0xfca0('0x33')][_0xfca0('0x34')]};});_0x32f7ce['model']=_[_0xfca0('0x2f')](_0x14889d,_0xfca0('0x2c'));_0x32f7ce[_0xfca0('0x35')]=_[_0xfca0('0x36')](_0x244338[_0xfca0('0x35')]);_0x32f7ce[_0xfca0('0x37')]=_['intersection'](_0x32f7ce[_0xfca0('0x38')],_0x32f7ce[_0xfca0('0x35')]);_0x7832ac['attributes']=_[_0xfca0('0x39')](_0x32f7ce['model'],qs[_0xfca0('0x3a')](_0x244338['query']['fields']));_0x7832ac[_0xfca0('0x3b')]=_0x7832ac[_0xfca0('0x3b')][_0xfca0('0x3c')]?_0x7832ac[_0xfca0('0x3b')]:_0x32f7ce['model'];if(!_0x244338[_0xfca0('0x35')][_0xfca0('0x3d')](_0xfca0('0x3e'))){_0x7832ac['limit']=qs['limit'](_0x244338[_0xfca0('0x35')]['limit']);_0x7832ac[_0xfca0('0x1f')]=qs[_0xfca0('0x1f')](_0x244338['query'][_0xfca0('0x1f')]);}_0x7832ac[_0xfca0('0x3f')]=qs[_0xfca0('0x40')](_0x244338[_0xfca0('0x35')]['sort']);_0x7832ac[_0xfca0('0x41')]=qs[_0xfca0('0x37')](_['pick'](_0x244338['query'],_0x32f7ce[_0xfca0('0x37')]),_0x14889d);if(_0x244338[_0xfca0('0x35')][_0xfca0('0x42')]){_0x7832ac[_0xfca0('0x41')]=_[_0xfca0('0x43')](_0x7832ac[_0xfca0('0x41')],{'$or':_[_0xfca0('0x2f')](_0x14889d,function(_0x3dcd9d){if(_0x3dcd9d[_0xfca0('0x33')]!==_0xfca0('0x44')){var _0x52a9e3={};_0x52a9e3[_0x3dcd9d['name']]={'$like':'%'+_0x244338[_0xfca0('0x35')][_0xfca0('0x42')]+'%'};return _0x52a9e3;}})});}_0x7832ac=_[_0xfca0('0x43')]({},_0x7832ac,_0x244338[_0xfca0('0x45')]);var _0x1db7e8={'where':_0x7832ac[_0xfca0('0x41')]};return db[_0xfca0('0x30')]['count'](_0x1db7e8)[_0xfca0('0x28')](function(_0x3055a2){_0x14a242['count']=_0x3055a2;if(_0x244338[_0xfca0('0x35')][_0xfca0('0x46')]){_0x7832ac[_0xfca0('0x47')]=[{'all':!![]}];}return db[_0xfca0('0x30')][_0xfca0('0x48')](_0x7832ac);})['then'](function(_0x53d9d7){_0x14a242[_0xfca0('0x49')]=_0x53d9d7;return _0x14a242;})[_0xfca0('0x28')](respondWithFilteredResult(_0x24dfa6,_0x7832ac))['catch'](handleError(_0x24dfa6,null));};exports[_0xfca0('0x4a')]=function(_0xe27635,_0x2e9a0e){var _0x445af2={'raw':!![],'where':{'id':_0xe27635['params']['id']}},_0x3d34e3={};_0x3d34e3[_0xfca0('0x38')]=_[_0xfca0('0x36')](db['ZohoField'][_0xfca0('0x31')]);_0x3d34e3[_0xfca0('0x35')]=_[_0xfca0('0x36')](_0xe27635['query']);_0x3d34e3[_0xfca0('0x37')]=_[_0xfca0('0x39')](_0x3d34e3['model'],_0x3d34e3[_0xfca0('0x35')]);_0x445af2[_0xfca0('0x3b')]=_['intersection'](_0x3d34e3[_0xfca0('0x38')],qs['fields'](_0xe27635[_0xfca0('0x35')][_0xfca0('0x3a')]));_0x445af2['attributes']=_0x445af2[_0xfca0('0x3b')][_0xfca0('0x3c')]?_0x445af2[_0xfca0('0x3b')]:_0x3d34e3[_0xfca0('0x38')];if(_0xe27635[_0xfca0('0x35')]['includeAll']){_0x445af2[_0xfca0('0x47')]=[{'all':!![]}];}_0x445af2=_[_0xfca0('0x43')]({},_0x445af2,_0xe27635[_0xfca0('0x45')]);return db[_0xfca0('0x30')][_0xfca0('0x4b')](_0x445af2)[_0xfca0('0x28')](handleEntityNotFound(_0x2e9a0e,null))[_0xfca0('0x28')](respondWithResult(_0x2e9a0e,null))[_0xfca0('0x4c')](handleError(_0x2e9a0e,null));};exports['create']=function(_0x17162d,_0x49ef1f){return db[_0xfca0('0x30')][_0xfca0('0x4d')](_0x17162d[_0xfca0('0x4e')],{})[_0xfca0('0x28')](respondWithResult(_0x49ef1f,0xc9))[_0xfca0('0x4c')](handleError(_0x49ef1f,null));};exports[_0xfca0('0x27')]=function(_0x4f16f8,_0xe871e5){if(_0x4f16f8[_0xfca0('0x4e')]['id']){delete _0x4f16f8[_0xfca0('0x4e')]['id'];}return db[_0xfca0('0x30')][_0xfca0('0x4b')]({'where':{'id':_0x4f16f8['params']['id']}})[_0xfca0('0x28')](handleEntityNotFound(_0xe871e5,null))[_0xfca0('0x28')](saveUpdates(_0x4f16f8[_0xfca0('0x4e')],null))[_0xfca0('0x28')](respondWithResult(_0xe871e5,null))[_0xfca0('0x4c')](handleError(_0xe871e5,null));};exports[_0xfca0('0x29')]=function(_0x2e06b0,_0xcf0dee){return db[_0xfca0('0x30')]['find']({'where':{'id':_0x2e06b0[_0xfca0('0x4f')]['id']}})[_0xfca0('0x28')](handleEntityNotFound(_0xcf0dee,null))[_0xfca0('0x28')](removeEntity(_0xcf0dee,null))['catch'](handleError(_0xcf0dee,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index f76289a..2cdad70 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 _0x2da6=['api','moment','bluebird','request-promise','path','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','idField','lodash','util','../../config/logger'];(function(_0x32d648,_0x39273b){var _0xcc9bb6=function(_0x3cf041){while(--_0x3cf041){_0x32d648['push'](_0x32d648['shift']());}};_0xcc9bb6(++_0x39273b);}(_0x2da6,0x1dd));var _0x62da=function(_0x38404c,_0x559850){_0x38404c=_0x38404c-0x0;var _0x3189ed=_0x2da6[_0x38404c];return _0x3189ed;};'use strict';var _=require(_0x62da('0x0'));var util=require(_0x62da('0x1'));var logger=require(_0x62da('0x2'))(_0x62da('0x3'));var moment=require(_0x62da('0x4'));var BPromise=require(_0x62da('0x5'));var rp=require(_0x62da('0x6'));var fs=require('fs');var path=require(_0x62da('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x62da('0x8'));module[_0x62da('0x9')]=function(_0x3a59f8,_0x30437f){return _0x3a59f8[_0x62da('0xa')](_0x62da('0xb'),attributes,{'tableName':_0x62da('0xc'),'paranoid':![],'indexes':[{'name':_0x62da('0xd'),'fields':[_0x62da('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5fab=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','exports','ZohoField','int_zoho_fields','zoho_unique_index','FieldId'];(function(_0x2853dd,_0x254e87){var _0x1f60c1=function(_0x417c63){while(--_0x417c63){_0x2853dd['push'](_0x2853dd['shift']());}};_0x1f60c1(++_0x254e87);}(_0x5fab,0x177));var _0xb5fa=function(_0x4f6f04,_0x59c6ba){_0x4f6f04=_0x4f6f04-0x0;var _0x606b2c=_0x5fab[_0x4f6f04];return _0x606b2c;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));module[_0xb5fa('0xa')]=function(_0x44df89,_0x4a0249){return _0x44df89['define'](_0xb5fa('0xb'),attributes,{'tableName':_0xb5fa('0xc'),'paranoid':![],'indexes':[{'name':_0xb5fa('0xd'),'fields':['idField',_0xb5fa('0xe')],'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 f93c9dd..1e8387b 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 _0xe874=['info','ZohoField,\x20%s,\x20%s','request\x20sent','ZohoField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x32e786,_0x4f8a4d){var _0x13ab55=function(_0x3fe0fa){while(--_0x3fe0fa){_0x32e786['push'](_0x32e786['shift']());}};_0x13ab55(++_0x4f8a4d);}(_0xe874,0x189));var _0x4e87=function(_0x20522a,_0x11bb0){_0x20522a=_0x20522a-0x0;var _0x3105e0=_0xe874[_0x20522a];return _0x3105e0;};'use strict';var _=require(_0x4e87('0x0'));var util=require(_0x4e87('0x1'));var moment=require(_0x4e87('0x2'));var BPromise=require(_0x4e87('0x3'));var rs=require(_0x4e87('0x4'));var fs=require('fs');var Redis=require(_0x4e87('0x5'));var db=require(_0x4e87('0x6'))['db'];var utils=require(_0x4e87('0x7'));var logger=require(_0x4e87('0x8'))('rpc');var config=require(_0x4e87('0x9'));var jayson=require(_0x4e87('0xa'));var client=jayson[_0x4e87('0xb')][_0x4e87('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x35569a,_0x161277,_0x50c293){return new BPromise(function(_0x11303e,_0x536022){return client[_0x4e87('0xd')](_0x35569a,_0x50c293)[_0x4e87('0xe')](function(_0x361914){logger[_0x4e87('0xf')](_0x4e87('0x10'),_0x161277,_0x4e87('0x11'));logger['debug'](_0x4e87('0x12'),_0x161277,'request\x20sent',JSON['stringify'](_0x361914));if(_0x361914[_0x4e87('0x13')]){if(_0x361914['error'][_0x4e87('0x14')]===0x1f4){logger[_0x4e87('0x13')](_0x4e87('0x10'),_0x161277,_0x361914['error'][_0x4e87('0x15')]);return _0x536022(_0x361914[_0x4e87('0x13')][_0x4e87('0x15')]);}logger[_0x4e87('0x13')]('ZohoField,\x20%s,\x20%s',_0x161277,_0x361914[_0x4e87('0x13')][_0x4e87('0x15')]);return _0x11303e(_0x361914['error'][_0x4e87('0x15')]);}else{logger[_0x4e87('0xf')]('ZohoField,\x20%s,\x20%s',_0x161277,_0x4e87('0x11'));_0x11303e(_0x361914[_0x4e87('0x16')][_0x4e87('0x15')]);}})[_0x4e87('0x17')](function(_0x3d6e7c){logger[_0x4e87('0x13')](_0x4e87('0x10'),_0x161277,_0x3d6e7c);_0x536022(_0x3d6e7c);});});} \ No newline at end of file +var _0x16d9=['stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s'];(function(_0x384bdf,_0x1af8b4){var _0x5a7ae4=function(_0x50cc9a){while(--_0x50cc9a){_0x384bdf['push'](_0x384bdf['shift']());}};_0x5a7ae4(++_0x1af8b4);}(_0x16d9,0x18c));var _0x916d=function(_0x34ac63,_0x40f4da){_0x34ac63=_0x34ac63-0x0;var _0x44aee2=_0x16d9[_0x34ac63];return _0x44aee2;};'use strict';var _=require(_0x916d('0x0'));var util=require(_0x916d('0x1'));var moment=require(_0x916d('0x2'));var BPromise=require(_0x916d('0x3'));var rs=require(_0x916d('0x4'));var fs=require('fs');var Redis=require(_0x916d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x916d('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x916d('0x7'));var jayson=require(_0x916d('0x8'));var client=jayson[_0x916d('0x9')][_0x916d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x18a974,_0x71d80e,_0xa65aa){return new BPromise(function(_0x2a67de,_0x22212e){return client[_0x916d('0xb')](_0x18a974,_0xa65aa)[_0x916d('0xc')](function(_0x4a270b){logger[_0x916d('0xd')](_0x916d('0xe'),_0x71d80e,_0x916d('0xf'));logger[_0x916d('0x10')](_0x916d('0x11'),_0x71d80e,'request\x20sent',JSON[_0x916d('0x12')](_0x4a270b));if(_0x4a270b['error']){if(_0x4a270b[_0x916d('0x13')]['code']===0x1f4){logger[_0x916d('0x13')]('ZohoField,\x20%s,\x20%s',_0x71d80e,_0x4a270b[_0x916d('0x13')][_0x916d('0x14')]);return _0x22212e(_0x4a270b[_0x916d('0x13')][_0x916d('0x14')]);}logger[_0x916d('0x13')](_0x916d('0xe'),_0x71d80e,_0x4a270b[_0x916d('0x13')]['message']);return _0x2a67de(_0x4a270b[_0x916d('0x13')]['message']);}else{logger[_0x916d('0xd')](_0x916d('0xe'),_0x71d80e,_0x916d('0xf'));_0x2a67de(_0x4a270b[_0x916d('0x15')]['message']);}})[_0x916d('0x16')](function(_0x20ea43){logger[_0x916d('0x13')](_0x916d('0xe'),_0x71d80e,_0x20ea43);_0x22212e(_0x20ea43);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index d7c8328..44dbb58 100644 --- a/server/api/integration/index.js +++ b/server/api/integration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x55aa36,_0x1edf50){var _0x349d37=function(_0x5e9a61){while(--_0x5e9a61){_0x55aa36['push'](_0x55aa36['shift']());}};_0x349d37(++_0x1edf50);}(_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(_0x53af8c,_0x18e612){var _0x2104f8=function(_0x22c98b){while(--_0x22c98b){_0x53af8c['push'](_0x53af8c['shift']());}};_0x2104f8(++_0x18e612);}(_0x70e0,0x17b));var _0x070e=function(_0x419bf6,_0x38314f){_0x419bf6=_0x419bf6-0x0;var _0x3df441=_0x70e0[_0x419bf6];return _0x3df441;};'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/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 707139f..e91a045 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 _0xf458=['state','STRING','app.js','BOOLEAN'];(function(_0xd3f68f,_0x314282){var _0x14e2dd=function(_0x384b87){while(--_0x384b87){_0xd3f68f['push'](_0xd3f68f['shift']());}};_0x14e2dd(++_0x314282);}(_0xf458,0x1e9));var _0x8f45=function(_0x2b3b1c,_0x45a682){_0x2b3b1c=_0x2b3b1c-0x0;var _0x2ac474=_0xf458[_0x2b3b1c];return _0x2ac474;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x8f45('0x0')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0x8f45('0x0')],'defaultValue':_0x8f45('0x1')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0x8f45('0x0')]},'type':{'type':Sequelize[_0x8f45('0x0')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0x8f45('0x2')],'defaultValue':![]},'author':{'type':Sequelize[_0x8f45('0x0')]},'logo':{'type':Sequelize[_0x8f45('0x0')]},'state':{'type':Sequelize['STRING'],'unique':_0x8f45('0x3')},'description':{'type':Sequelize[_0x8f45('0x0')]},'title':{'type':Sequelize[_0x8f45('0x0')]},'remoteUri':{'type':Sequelize[_0x8f45('0x0')]},'link':{'type':Sequelize[_0x8f45('0x0')],'defaultValue':'#'}}; \ No newline at end of file +var _0xbc48=['STRING','unique_name_and_version','app.js','INTEGER','BOOLEAN','state','exports'];(function(_0x33c14b,_0x4179ed){var _0x2ca50d=function(_0x26857d){while(--_0x26857d){_0x33c14b['push'](_0x33c14b['shift']());}};_0x2ca50d(++_0x4179ed);}(_0xbc48,0x16b));var _0x8bc4=function(_0x4572f9,_0x4c9d5a){_0x4572f9=_0x4572f9-0x0;var _0x33784c=_0xbc48[_0x4572f9];return _0x33784c;};'use strict';var Sequelize=require('sequelize');module[_0x8bc4('0x0')]={'name':{'type':Sequelize[_0x8bc4('0x1')],'allowNull':![],'unique':_0x8bc4('0x2')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x8bc4('0x2')},'main':{'type':Sequelize['STRING'],'defaultValue':_0x8bc4('0x3')},'filename':{'type':Sequelize[_0x8bc4('0x1')]},'path':{'type':Sequelize[_0x8bc4('0x1')]},'type':{'type':Sequelize[_0x8bc4('0x1')]},'size':{'type':Sequelize[_0x8bc4('0x4')]},'active':{'type':Sequelize[_0x8bc4('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x8bc4('0x1')]},'logo':{'type':Sequelize[_0x8bc4('0x1')]},'state':{'type':Sequelize[_0x8bc4('0x1')],'unique':_0x8bc4('0x6')},'description':{'type':Sequelize[_0x8bc4('0x1')]},'title':{'type':Sequelize[_0x8bc4('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0x8bc4('0x1')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 87e31cb..95ac88e 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 _0x66fa=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','rawAttributes','type','key','map','query','keys','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','VIRTUAL','includeAll','include','Integration','findAll','rows','catch','merge','options','find','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x66fa,0x117));var _0xa66f=function(_0x34358e,_0x340fc7){_0x34358e=_0x34358e-0x0;var _0x3f8ef4=_0x66fa[_0x34358e];return _0x3f8ef4;};'use strict';var emlformat=require(_0xa66f('0x0'));var rimraf=require(_0xa66f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa66f('0x2'));var rp=require(_0xa66f('0x3'));var moment=require(_0xa66f('0x4'));var BPromise=require(_0xa66f('0x5'));var Mustache=require(_0xa66f('0x6'));var util=require(_0xa66f('0x7'));var path=require(_0xa66f('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa66f('0x9'));var fs=require('fs');var fs_extra=require(_0xa66f('0xa'));var _=require(_0xa66f('0xb'));var squel=require(_0xa66f('0xc'));var crypto=require(_0xa66f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa66f('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa66f('0xf'));var Papa=require('papaparse');var Redis=require(_0xa66f('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa66f('0x11'));var logger=require(_0xa66f('0x12'))('api');var utils=require(_0xa66f('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xa66f('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x251189,_0x14af70){_0x14af70=_0x14af70||0xcc;return function(_0xca12f8){if(_0xca12f8){return _0x251189['sendStatus'](_0x14af70);}return _0x251189['status'](_0x14af70)[_0xa66f('0x15')]();};}function respondWithResult(_0x4e09cf,_0x528427){_0x528427=_0x528427||0xc8;return function(_0x5a7b16){if(_0x5a7b16){return _0x4e09cf[_0xa66f('0x16')](_0x528427)[_0xa66f('0x17')](_0x5a7b16);}};}function respondWithFilteredResult(_0x267129,_0x236d64){return function(_0xd348f9){if(_0xd348f9){var _0x567d4f=typeof _0x236d64['offset']===_0xa66f('0x18')&&typeof _0x236d64[_0xa66f('0x19')]===_0xa66f('0x18');var _0x403f4d=_0xd348f9['count'];var _0x1cbe64=_0x567d4f?0x0:_0x236d64['offset'];var _0x4a28d4=_0x567d4f?_0xd348f9[_0xa66f('0x1a')]:_0x236d64[_0xa66f('0x1b')]+_0x236d64[_0xa66f('0x19')];var _0x355ddc;if(_0x4a28d4>=_0x403f4d){_0x4a28d4=_0x403f4d;_0x355ddc=0xc8;}else{_0x355ddc=0xce;}_0x267129[_0xa66f('0x16')](_0x355ddc);return _0x267129[_0xa66f('0x1c')](_0xa66f('0x1d'),_0x1cbe64+'-'+_0x4a28d4+'/'+_0x403f4d)[_0xa66f('0x17')](_0xd348f9);}return null;};}function patchUpdates(_0x2033a4){return function(_0x2d9602){try{jsonpatch[_0xa66f('0x1e')](_0x2d9602,_0x2033a4,!![]);}catch(_0xbba376){return BPromise[_0xa66f('0x1f')](_0xbba376);}return _0x2d9602[_0xa66f('0x20')]();};}function saveUpdates(_0x82924d,_0x5cd613){return function(_0x27f570){if(_0x27f570){return _0x27f570[_0xa66f('0x21')](_0x82924d)[_0xa66f('0x22')](function(_0x37ee13){return _0x37ee13;});}return null;};}function removeEntity(_0x5cbd82,_0x337602){return function(_0x473822){if(_0x473822){return _0x473822[_0xa66f('0x23')]()[_0xa66f('0x22')](function(){_0x5cbd82['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xed98b9,_0x598942){return function(_0x3a3e4f){if(!_0x3a3e4f){_0xed98b9[_0xa66f('0x24')](0x194);}return _0x3a3e4f;};}function handleError(_0x384164,_0x57da7f){_0x57da7f=_0x57da7f||0x1f4;return function(_0x4683c7){logger[_0xa66f('0x25')](_0x4683c7[_0xa66f('0x26')]);if(_0x4683c7[_0xa66f('0x27')]){delete _0x4683c7[_0xa66f('0x27')];}_0x384164[_0xa66f('0x16')](_0x57da7f)[_0xa66f('0x28')](_0x4683c7);};}exports[_0xa66f('0x29')]=function(_0x20ee67,_0x117d03){var _0x45f71c={},_0x63650b={},_0x42b966={'count':0x0,'rows':[]};var _0xeeb22e=_['map'](db['Integration'][_0xa66f('0x2a')],function(_0x27ceae){return{'name':_0x27ceae['fieldName'],'type':_0x27ceae[_0xa66f('0x2b')][_0xa66f('0x2c')]};});_0x63650b['model']=_[_0xa66f('0x2d')](_0xeeb22e,_0xa66f('0x27'));_0x63650b[_0xa66f('0x2e')]=_[_0xa66f('0x2f')](_0x20ee67[_0xa66f('0x2e')]);_0x63650b['filters']=_[_0xa66f('0x30')](_0x63650b['model'],_0x63650b[_0xa66f('0x2e')]);_0x45f71c[_0xa66f('0x31')]=_[_0xa66f('0x30')](_0x63650b['model'],qs[_0xa66f('0x32')](_0x20ee67[_0xa66f('0x2e')]['fields']));_0x45f71c[_0xa66f('0x31')]=_0x45f71c[_0xa66f('0x31')][_0xa66f('0x33')]?_0x45f71c[_0xa66f('0x31')]:_0x63650b[_0xa66f('0x34')];if(!_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x35')](_0xa66f('0x36'))){_0x45f71c[_0xa66f('0x19')]=qs[_0xa66f('0x19')](_0x20ee67['query'][_0xa66f('0x19')]);_0x45f71c['offset']=qs[_0xa66f('0x1b')](_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x1b')]);}_0x45f71c[_0xa66f('0x37')]=qs[_0xa66f('0x38')](_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x38')]);_0x45f71c[_0xa66f('0x39')]=qs['filters'](_[_0xa66f('0x3a')](_0x20ee67['query'],_0x63650b[_0xa66f('0x3b')]),_0xeeb22e);if(_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x3c')]){_0x45f71c['where']=_['merge'](_0x45f71c[_0xa66f('0x39')],{'$or':_[_0xa66f('0x2d')](_0xeeb22e,function(_0x20b07e){if(_0x20b07e[_0xa66f('0x2b')]!==_0xa66f('0x3d')){var _0x581dca={};_0x581dca[_0x20b07e['name']]={'$like':'%'+_0x20ee67['query'][_0xa66f('0x3c')]+'%'};return _0x581dca;}})});}_0x45f71c=_['merge']({},_0x45f71c,_0x20ee67['options']);var _0x5bf856={'where':_0x45f71c[_0xa66f('0x39')]};return db['Integration'][_0xa66f('0x1a')](_0x5bf856)[_0xa66f('0x22')](function(_0x23a546){_0x42b966[_0xa66f('0x1a')]=_0x23a546;if(_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x3e')]){_0x45f71c[_0xa66f('0x3f')]=[{'all':!![]}];}return db[_0xa66f('0x40')][_0xa66f('0x41')](_0x45f71c);})[_0xa66f('0x22')](function(_0x3a7929){_0x42b966[_0xa66f('0x42')]=_0x3a7929;return _0x42b966;})[_0xa66f('0x22')](respondWithFilteredResult(_0x117d03,_0x45f71c))[_0xa66f('0x43')](handleError(_0x117d03,null));};exports['show']=function(_0x36037c,_0x25c2cb){var _0x58c1f2={'raw':![],'where':{'id':_0x36037c['params']['id']}},_0x248587={};_0x248587[_0xa66f('0x34')]=_[_0xa66f('0x2f')](db['Integration'][_0xa66f('0x2a')]);_0x248587[_0xa66f('0x2e')]=_[_0xa66f('0x2f')](_0x36037c['query']);_0x248587[_0xa66f('0x3b')]=_['intersection'](_0x248587[_0xa66f('0x34')],_0x248587[_0xa66f('0x2e')]);_0x58c1f2[_0xa66f('0x31')]=_[_0xa66f('0x30')](_0x248587[_0xa66f('0x34')],qs[_0xa66f('0x32')](_0x36037c[_0xa66f('0x2e')]['fields']));_0x58c1f2[_0xa66f('0x31')]=_0x58c1f2[_0xa66f('0x31')][_0xa66f('0x33')]?_0x58c1f2[_0xa66f('0x31')]:_0x248587[_0xa66f('0x34')];if(_0x36037c['query']['includeAll']){_0x58c1f2[_0xa66f('0x3f')]=[{'all':!![]}];}_0x58c1f2=_[_0xa66f('0x44')]({},_0x58c1f2,_0x36037c[_0xa66f('0x45')]);return db[_0xa66f('0x40')][_0xa66f('0x46')](_0x58c1f2)[_0xa66f('0x22')](handleEntityNotFound(_0x25c2cb,null))['then'](respondWithResult(_0x25c2cb,null))[_0xa66f('0x43')](handleError(_0x25c2cb,null));};exports[_0xa66f('0x47')]=function(_0x3f9cdd,_0x5651e9){return db['Integration'][_0xa66f('0x47')](_0x3f9cdd[_0xa66f('0x48')],{})[_0xa66f('0x22')](respondWithResult(_0x5651e9,0xc9))['catch'](handleError(_0x5651e9,null));};exports['update']=function(_0x52054e,_0x19e7ce){if(_0x52054e[_0xa66f('0x48')]['id']){delete _0x52054e[_0xa66f('0x48')]['id'];}return db[_0xa66f('0x40')][_0xa66f('0x46')]({'where':{'id':_0x52054e[_0xa66f('0x49')]['id']}})[_0xa66f('0x22')](handleEntityNotFound(_0x19e7ce,null))[_0xa66f('0x22')](saveUpdates(_0x52054e['body'],null))[_0xa66f('0x22')](respondWithResult(_0x19e7ce,null))[_0xa66f('0x43')](handleError(_0x19e7ce,null));};exports[_0xa66f('0x23')]=function(_0x393755,_0x11597b){return db[_0xa66f('0x40')]['find']({'where':{'id':_0x393755[_0xa66f('0x49')]['id']}})[_0xa66f('0x22')](handleEntityNotFound(_0x11597b,null))[_0xa66f('0x22')](removeEntity(_0x11597b,null))[_0xa66f('0x43')](handleError(_0x11597b,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','Integration','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(_0x290ad6,_0x15f536){var _0x28f091=function(_0x5222c9){while(--_0x5222c9){_0x290ad6['push'](_0x290ad6['shift']());}};_0x28f091(++_0x15f536);}(_0x7a54,0x106));var _0x47a5=function(_0x1b2ec0,_0x3f97d8){_0x1b2ec0=_0x1b2ec0-0x0;var _0x43e031=_0x7a54[_0x1b2ec0];return _0x43e031;};'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['Integration'][_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['Integration']['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['Integration']['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/integration/integration.model.js b/server/api/integration/integration.model.js index 8dc36ce..b2c30f7 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 _0x61ae=['util','api','bluebird','path','rimraf','../../config/environment','./integration.attributes','define','Integration','integrations','lodash'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x61ae,0x13e));var _0xe61a=function(_0x37d870,_0x43470b){_0x37d870=_0x37d870-0x0;var _0x4b2c5f=_0x61ae[_0x37d870];return _0x4b2c5f;};'use strict';var _=require(_0xe61a('0x0'));var util=require(_0xe61a('0x1'));var logger=require('../../config/logger')(_0xe61a('0x2'));var moment=require('moment');var BPromise=require(_0xe61a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe61a('0x4'));var rimraf=require(_0xe61a('0x5'));var config=require(_0xe61a('0x6'));var attributes=require(_0xe61a('0x7'));module['exports']=function(_0x131a67,_0x46e0dd){return _0x131a67[_0xe61a('0x8')](_0xe61a('0x9'),attributes,{'tableName':_0xe61a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5251=['exports','define','Integration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./integration.attributes'];(function(_0x2f487d,_0x31ba82){var _0x75f77f=function(_0x286567){while(--_0x286567){_0x2f487d['push'](_0x2f487d['shift']());}};_0x75f77f(++_0x31ba82);}(_0x5251,0xd5));var _0x1525=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5251[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x1525('0x0'));var util=require(_0x1525('0x1'));var logger=require(_0x1525('0x2'))(_0x1525('0x3'));var moment=require(_0x1525('0x4'));var BPromise=require(_0x1525('0x5'));var rp=require(_0x1525('0x6'));var fs=require('fs');var path=require(_0x1525('0x7'));var rimraf=require(_0x1525('0x8'));var config=require(_0x1525('0x9'));var attributes=require(_0x1525('0xa'));module[_0x1525('0xb')]=function(_0x45e4af,_0x55a139){return _0x45e4af[_0x1525('0xc')](_0x1525('0xd'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index 1f00e69..fbb2f20 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 _0xba34=['../../config/environment','jayson/promise','client','http','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc'];(function(_0x4081c8,_0x1320be){var _0x527933=function(_0x121845){while(--_0x121845){_0x4081c8['push'](_0x4081c8['shift']());}};_0x527933(++_0x1320be);}(_0xba34,0x119));var _0x4ba3=function(_0x38dad9,_0x5920af){_0x38dad9=_0x38dad9-0x0;var _0x263f44=_0xba34[_0x38dad9];return _0x263f44;};'use strict';var _=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var moment=require(_0x4ba3('0x2'));var BPromise=require(_0x4ba3('0x3'));var rs=require(_0x4ba3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4ba3('0x5'))(_0x4ba3('0x6'));var config=require(_0x4ba3('0x7'));var jayson=require(_0x4ba3('0x8'));var client=jayson[_0x4ba3('0x9')][_0x4ba3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe5f99a,_0x585f2d,_0x6254fb){return new BPromise(function(_0x368eee,_0x2df7f3){return client[_0x4ba3('0xb')](_0xe5f99a,_0x6254fb)[_0x4ba3('0xc')](function(_0xcf1ec3){logger[_0x4ba3('0xd')](_0x4ba3('0xe'),_0x585f2d,_0x4ba3('0xf'));logger[_0x4ba3('0x10')](_0x4ba3('0x11'),_0x585f2d,'request\x20sent',JSON[_0x4ba3('0x12')](_0xcf1ec3));if(_0xcf1ec3[_0x4ba3('0x13')]){if(_0xcf1ec3['error'][_0x4ba3('0x14')]===0x1f4){logger['error'](_0x4ba3('0xe'),_0x585f2d,_0xcf1ec3['error'][_0x4ba3('0x15')]);return _0x2df7f3(_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);}logger[_0x4ba3('0x13')](_0x4ba3('0xe'),_0x585f2d,_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);return _0x368eee(_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);}else{logger[_0x4ba3('0xd')](_0x4ba3('0xe'),_0x585f2d,_0x4ba3('0xf'));_0x368eee(_0xcf1ec3[_0x4ba3('0x16')][_0x4ba3('0x15')]);}})[_0x4ba3('0x17')](function(_0x1b7776){logger['error'](_0x4ba3('0xe'),_0x585f2d,_0x1b7776);_0x2df7f3(_0x1b7776);});});} \ No newline at end of file +var _0x0295=['client','http','then','info','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','Integration,\x20%s,\x20%s','message','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1e3618,_0x30c851){var _0x30dc0f=function(_0x47d892){while(--_0x47d892){_0x1e3618['push'](_0x1e3618['shift']());}};_0x30dc0f(++_0x30c851);}(_0x0295,0x1f0));var _0x5029=function(_0x2b92ec,_0x18e0e3){_0x2b92ec=_0x2b92ec-0x0;var _0x12be46=_0x0295[_0x2b92ec];return _0x12be46;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5029('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5029('0x2'))['db'];var utils=require(_0x5029('0x3'));var logger=require(_0x5029('0x4'))(_0x5029('0x5'));var config=require(_0x5029('0x6'));var jayson=require(_0x5029('0x7'));var client=jayson[_0x5029('0x8')][_0x5029('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b3cd,_0x502a62,_0x54978f){return new BPromise(function(_0x4ee867,_0xf4459b){return client['request'](_0x5b3cd,_0x54978f)[_0x5029('0xa')](function(_0x5bccfc){logger[_0x5029('0xb')]('Integration,\x20%s,\x20%s',_0x502a62,_0x5029('0xc'));logger[_0x5029('0xd')](_0x5029('0xe'),_0x502a62,'request\x20sent',JSON[_0x5029('0xf')](_0x5bccfc));if(_0x5bccfc[_0x5029('0x10')]){if(_0x5bccfc[_0x5029('0x10')]['code']===0x1f4){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc['error']['message']);return _0xf4459b(_0x5bccfc['error']['message']);}logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);return _0x4ee867(_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);}else{logger[_0x5029('0xb')](_0x5029('0x11'),_0x502a62,_0x5029('0xc'));_0x4ee867(_0x5bccfc[_0x5029('0x13')][_0x5029('0x12')]);}})[_0x5029('0x14')](function(_0x3786b5){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x3786b5);_0xf4459b(_0x3786b5);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 7523e35..cdf82ef 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 _0xda2d=['show','create','put','/:id','update','delete','util','path','connect-timeout','express','Router','../../config/environment','./integrationReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0xda2d,0x102));var _0xdda2=function(_0x3a7e71,_0x51b287){_0x3a7e71=_0x3a7e71-0x0;var _0x5e0b4f=_0xda2d[_0x3a7e71];return _0x5e0b4f;};'use strict';var multer=require('multer');var util=require(_0xdda2('0x0'));var path=require(_0xdda2('0x1'));var timeout=require(_0xdda2('0x2'));var express=require(_0xdda2('0x3'));var router=express[_0xdda2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdda2('0x5'));var controller=require(_0xdda2('0x6'));router[_0xdda2('0x7')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x9')]);router[_0xdda2('0x7')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xb')]);router[_0xdda2('0x7')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0xc')]);router['post']('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0xd')]);router[_0xdda2('0xe')](_0xdda2('0xf'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x10')]);router[_0xdda2('0x11')](_0xdda2('0xf'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x1261=['create','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','index','get','isAuthenticated','describe','/:id','post'];(function(_0x44da61,_0x4bb310){var _0x24dc30=function(_0x12a6b0){while(--_0x12a6b0){_0x44da61['push'](_0x44da61['shift']());}};_0x24dc30(++_0x4bb310);}(_0x1261,0x144));var _0x1126=function(_0x4e7c1c,_0x56eafd){_0x4e7c1c=_0x4e7c1c-0x0;var _0x47adb2=_0x1261[_0x4e7c1c];return _0x47adb2;};'use strict';var multer=require('multer');var util=require(_0x1126('0x0'));var path=require(_0x1126('0x1'));var timeout=require(_0x1126('0x2'));var express=require(_0x1126('0x3'));var router=express[_0x1126('0x4')]();var fs_extra=require(_0x1126('0x5'));var auth=require(_0x1126('0x6'));var interaction=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var controller=require(_0x1126('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x1126('0xa')]);router[_0x1126('0xb')]('/describe',auth[_0x1126('0xc')](),controller[_0x1126('0xd')]);router[_0x1126('0xb')](_0x1126('0xe'),auth[_0x1126('0xc')](),controller['show']);router[_0x1126('0xf')]('/',auth[_0x1126('0xc')](),controller[_0x1126('0x10')]);router['put'](_0x1126('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x1126('0x11')]('/:id',auth[_0x1126('0xc')](),controller[_0x1126('0x12')]);module[_0x1126('0x13')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 237bb5e..d41e07c 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 _0x0fb6=['DATE','BOOLEAN','TEXT','SENT','FAILED','sequelize','exports','STRING','INTEGER'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x0fb6,0xf8));var _0x60fb=function(_0x386b35,_0xbb5c45){_0x386b35=_0x386b35-0x0;var _0x3176db=_0x0fb6[_0x386b35];return _0x3176db;};'use strict';var Sequelize=require(_0x60fb('0x0'));module[_0x60fb('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0x60fb('0x2')]},'exitStatus':{'type':Sequelize[_0x60fb('0x2')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x60fb('0x3')]},'contacts':{'type':Sequelize[_0x60fb('0x2')]},'uniqueid':{'type':Sequelize[_0x60fb('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x60fb('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x60fb('0x2')]},'agentcalledAt':{'type':Sequelize[_0x60fb('0x4')]},'agentconnectAt':{'type':Sequelize[_0x60fb('0x4')]},'holdtime':{'type':Sequelize[_0x60fb('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x60fb('0x4')]},'talktime':{'type':Sequelize[_0x60fb('0x3')]},'agentacw':{'type':Sequelize[_0x60fb('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x60fb('0x2')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x60fb('0x4')]},'agentdump':{'type':Sequelize[_0x60fb('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x60fb('0x4')]},'lastevent':{'type':Sequelize[_0x60fb('0x2')]},'channel':{'type':Sequelize[_0x60fb('0x2')]},'channelstate':{'type':Sequelize[_0x60fb('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x60fb('0x2')]},'language':{'type':Sequelize[_0x60fb('0x2')]},'accountcode':{'type':Sequelize[_0x60fb('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x60fb('0x2')]},'priority':{'type':Sequelize[_0x60fb('0x2')]},'destchannel':{'type':Sequelize[_0x60fb('0x2')]},'destchannelstate':{'type':Sequelize[_0x60fb('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x60fb('0x2')]},'destcalleridname':{'type':Sequelize[_0x60fb('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x60fb('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x60fb('0x2')]},'destlanguage':{'type':Sequelize[_0x60fb('0x2')]},'destaccountcode':{'type':Sequelize[_0x60fb('0x2')]},'destcontext':{'type':Sequelize[_0x60fb('0x2')]},'destexten':{'type':Sequelize[_0x60fb('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x60fb('0x2')]},'messageId':{'type':Sequelize[_0x60fb('0x2')]},'inReplyTo':{'type':Sequelize[_0x60fb('0x2')]},'subject':{'type':Sequelize[_0x60fb('0x2')]},'from':{'type':Sequelize[_0x60fb('0x2')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x60fb('0x2')]},'attachment':{'type':Sequelize[_0x60fb('0x6')]},'html':{'type':Sequelize[_0x60fb('0x6')]},'text':{'type':Sequelize[_0x60fb('0x6')]},'status':{'type':Sequelize['ENUM'](_0x60fb('0x7'),'SENDING','RECEIVED',_0x60fb('0x8'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x60fb('0x2')]},'appdata':{'type':Sequelize[_0x60fb('0x2')]},'projectId':{'type':Sequelize[_0x60fb('0x3')]}}; \ No newline at end of file +var _0xb19e=['STRING','DATE','INTEGER','BOOLEAN','TEXT','SENT','SENDING','RECEIVED','sequelize','exports'];(function(_0x2177eb,_0x153d3c){var _0x19d48a=function(_0x34d8dd){while(--_0x34d8dd){_0x2177eb['push'](_0x2177eb['shift']());}};_0x19d48a(++_0x153d3c);}(_0xb19e,0xd0));var _0xeb19=function(_0x21205e,_0x7eb8e7){_0x21205e=_0x21205e-0x0;var _0x136ebb=_0xb19e[_0x21205e];return _0x136ebb;};'use strict';var Sequelize=require(_0xeb19('0x0'));module[_0xeb19('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0xeb19('0x2')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0xeb19('0x2')]},'uniqueid':{'type':Sequelize[_0xeb19('0x2')]},'calleridnum':{'type':Sequelize[_0xeb19('0x2')]},'calleridname':{'type':Sequelize[_0xeb19('0x2')]},'queue':{'type':Sequelize[_0xeb19('0x2')]},'interface':{'type':Sequelize[_0xeb19('0x2')]},'membername':{'type':Sequelize[_0xeb19('0x2')]},'agentcalledAt':{'type':Sequelize[_0xeb19('0x3')]},'agentconnectAt':{'type':Sequelize[_0xeb19('0x3')]},'holdtime':{'type':Sequelize[_0xeb19('0x4')]},'agentcomplete':{'type':Sequelize[_0xeb19('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xeb19('0x3')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0xeb19('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xeb19('0x4')]},'reason':{'type':Sequelize[_0xeb19('0x2')]},'agentringnoanswer':{'type':Sequelize[_0xeb19('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xeb19('0x3')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0xeb19('0x2')]},'channel':{'type':Sequelize[_0xeb19('0x2')]},'channelstate':{'type':Sequelize[_0xeb19('0x4')]},'channelstatedesc':{'type':Sequelize[_0xeb19('0x2')]},'connectedlinenum':{'type':Sequelize[_0xeb19('0x2')]},'connectedlinename':{'type':Sequelize[_0xeb19('0x2')]},'language':{'type':Sequelize[_0xeb19('0x2')]},'accountcode':{'type':Sequelize[_0xeb19('0x2')]},'context':{'type':Sequelize[_0xeb19('0x2')]},'exten':{'type':Sequelize[_0xeb19('0x2')]},'priority':{'type':Sequelize[_0xeb19('0x2')]},'destchannel':{'type':Sequelize[_0xeb19('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xeb19('0x2')]},'destcalleridname':{'type':Sequelize[_0xeb19('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xeb19('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xeb19('0x2')]},'destlanguage':{'type':Sequelize[_0xeb19('0x2')]},'destaccountcode':{'type':Sequelize[_0xeb19('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xeb19('0x2')]},'destpriority':{'type':Sequelize[_0xeb19('0x2')]},'destuniqueid':{'type':Sequelize[_0xeb19('0x2')]},'messageId':{'type':Sequelize[_0xeb19('0x2')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xeb19('0x2')]},'cc':{'type':Sequelize[_0xeb19('0x2')]},'attachment':{'type':Sequelize[_0xeb19('0x6')]},'html':{'type':Sequelize[_0xeb19('0x6')]},'text':{'type':Sequelize[_0xeb19('0x6')]},'status':{'type':Sequelize['ENUM'](_0xeb19('0x7'),_0xeb19('0x8'),_0xeb19('0x9'),'FAILED')},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0xeb19('0x2')]},'appdata':{'type':Sequelize[_0xeb19('0x2')]},'projectId':{'type':Sequelize[_0xeb19('0x4')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 8aa1c0b..155051f 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 _0x6315=['sendStatus','status','end','json','offset','undefined','limit','count','set','update','then','destroy','error','stack','name','send','index','map','IntegrationReport','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x263c31,_0x647a0a){var _0x55d2e0=function(_0x64ea2){while(--_0x64ea2){_0x263c31['push'](_0x263c31['shift']());}};_0x55d2e0(++_0x647a0a);}(_0x6315,0xc6));var _0x5631=function(_0x41ed02,_0x472f2f){_0x41ed02=_0x41ed02-0x0;var _0xc0b16b=_0x6315[_0x41ed02];return _0xc0b16b;};'use strict';var emlformat=require(_0x5631('0x0'));var rimraf=require(_0x5631('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5631('0x2'));var rp=require(_0x5631('0x3'));var moment=require(_0x5631('0x4'));var BPromise=require(_0x5631('0x5'));var Mustache=require(_0x5631('0x6'));var util=require(_0x5631('0x7'));var path=require('path');var sox=require(_0x5631('0x8'));var csv=require('to-csv');var ejs=require(_0x5631('0x9'));var fs=require('fs');var fs_extra=require(_0x5631('0xa'));var _=require(_0x5631('0xb'));var squel=require('squel');var crypto=require(_0x5631('0xc'));var jsforce=require(_0x5631('0xd'));var deskjs=require(_0x5631('0xe'));var toCsv=require(_0x5631('0xf'));var querystring=require(_0x5631('0x10'));var Papa=require(_0x5631('0x11'));var Redis=require(_0x5631('0x12'));var authService=require(_0x5631('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x5631('0x14'));var hardwareService=require(_0x5631('0x15'));var logger=require(_0x5631('0x16'))(_0x5631('0x17'));var utils=require(_0x5631('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x5631('0x19'));var db=require(_0x5631('0x1a'))['db'];function respondWithStatusCode(_0x9d4629,_0x23a0b6){_0x23a0b6=_0x23a0b6||0xcc;return function(_0x3eda74){if(_0x3eda74){return _0x9d4629[_0x5631('0x1b')](_0x23a0b6);}return _0x9d4629[_0x5631('0x1c')](_0x23a0b6)[_0x5631('0x1d')]();};}function respondWithResult(_0x25bb94,_0x23e923){_0x23e923=_0x23e923||0xc8;return function(_0x57f664){if(_0x57f664){return _0x25bb94['status'](_0x23e923)[_0x5631('0x1e')](_0x57f664);}};}function respondWithFilteredResult(_0x10c2b,_0x107b0a){return function(_0x16a180){if(_0x16a180){var _0xbd2f73=typeof _0x107b0a[_0x5631('0x1f')]===_0x5631('0x20')&&typeof _0x107b0a[_0x5631('0x21')]===_0x5631('0x20');var _0x4e9412=_0x16a180['count'];var _0x5366be=_0xbd2f73?0x0:_0x107b0a[_0x5631('0x1f')];var _0x28a177=_0xbd2f73?_0x16a180[_0x5631('0x22')]:_0x107b0a['offset']+_0x107b0a[_0x5631('0x21')];var _0x4c392b;if(_0x28a177>=_0x4e9412){_0x28a177=_0x4e9412;_0x4c392b=0xc8;}else{_0x4c392b=0xce;}_0x10c2b[_0x5631('0x1c')](_0x4c392b);return _0x10c2b[_0x5631('0x23')]('Content-Range',_0x5366be+'-'+_0x28a177+'/'+_0x4e9412)[_0x5631('0x1e')](_0x16a180);}return null;};}function patchUpdates(_0x544bab){return function(_0x56fa56){try{jsonpatch['apply'](_0x56fa56,_0x544bab,!![]);}catch(_0x385bab){return BPromise['reject'](_0x385bab);}return _0x56fa56['save']();};}function saveUpdates(_0x57376f,_0x19d4d4){return function(_0x4e52aa){if(_0x4e52aa){return _0x4e52aa[_0x5631('0x24')](_0x57376f)[_0x5631('0x25')](function(_0x2c8a15){return _0x2c8a15;});}return null;};}function removeEntity(_0x13f0c7,_0x44262f){return function(_0x4d0900){if(_0x4d0900){return _0x4d0900[_0x5631('0x26')]()[_0x5631('0x25')](function(){_0x13f0c7[_0x5631('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40975e,_0x1af3a4){return function(_0x50334d){if(!_0x50334d){_0x40975e['sendStatus'](0x194);}return _0x50334d;};}function handleError(_0x2c0eb0,_0x16d56a){_0x16d56a=_0x16d56a||0x1f4;return function(_0xf08673){logger[_0x5631('0x27')](_0xf08673[_0x5631('0x28')]);if(_0xf08673[_0x5631('0x29')]){delete _0xf08673['name'];}_0x2c0eb0['status'](_0x16d56a)[_0x5631('0x2a')](_0xf08673);};}exports[_0x5631('0x2b')]=function(_0x570252,_0x35db10){var _0x2db350={},_0x4399fd={},_0x470d55={'count':0x0,'rows':[]};var _0x3b278d=_[_0x5631('0x2c')](db[_0x5631('0x2d')][_0x5631('0x2e')],function(_0x33fb43){return{'name':_0x33fb43[_0x5631('0x2f')],'type':_0x33fb43[_0x5631('0x30')][_0x5631('0x31')]};});_0x4399fd[_0x5631('0x32')]=_['map'](_0x3b278d,'name');_0x4399fd['query']=_[_0x5631('0x33')](_0x570252[_0x5631('0x34')]);_0x4399fd['filters']=_[_0x5631('0x35')](_0x4399fd[_0x5631('0x32')],_0x4399fd[_0x5631('0x34')]);_0x2db350[_0x5631('0x36')]=_[_0x5631('0x35')](_0x4399fd[_0x5631('0x32')],qs[_0x5631('0x37')](_0x570252['query'][_0x5631('0x37')]));_0x2db350[_0x5631('0x36')]=_0x2db350[_0x5631('0x36')]['length']?_0x2db350['attributes']:_0x4399fd[_0x5631('0x32')];if(!_0x570252[_0x5631('0x34')]['hasOwnProperty'](_0x5631('0x38'))){_0x2db350[_0x5631('0x21')]=qs[_0x5631('0x21')](_0x570252[_0x5631('0x34')][_0x5631('0x21')]);_0x2db350[_0x5631('0x1f')]=qs[_0x5631('0x1f')](_0x570252['query'][_0x5631('0x1f')]);}_0x2db350['order']=qs[_0x5631('0x39')](_0x570252['query'][_0x5631('0x39')]);_0x2db350[_0x5631('0x3a')]=qs[_0x5631('0x3b')](_[_0x5631('0x3c')](_0x570252[_0x5631('0x34')],_0x4399fd[_0x5631('0x3b')]),_0x3b278d);if(_0x570252['query'][_0x5631('0x3d')]){_0x2db350[_0x5631('0x3a')]=_[_0x5631('0x3e')](_0x2db350['where'],{'$or':_[_0x5631('0x2c')](_0x3b278d,function(_0x4f9c1f){if(_0x4f9c1f['type']!==_0x5631('0x3f')){var _0x5225ee={};_0x5225ee[_0x4f9c1f[_0x5631('0x29')]]={'$like':'%'+_0x570252[_0x5631('0x34')][_0x5631('0x3d')]+'%'};return _0x5225ee;}})});}_0x2db350=_['merge']({},_0x2db350,_0x570252[_0x5631('0x40')]);var _0xdebd41={'where':_0x2db350[_0x5631('0x3a')]};return db['IntegrationReport'][_0x5631('0x22')](_0xdebd41)[_0x5631('0x25')](function(_0x36bf74){_0x470d55[_0x5631('0x22')]=_0x36bf74;if(_0x570252[_0x5631('0x34')][_0x5631('0x41')]){_0x2db350[_0x5631('0x42')]=[{'all':!![]}];}return db[_0x5631('0x2d')]['findAll'](_0x2db350);})[_0x5631('0x25')](function(_0x1a2957){_0x470d55[_0x5631('0x43')]=_0x1a2957;return _0x470d55;})['then'](respondWithFilteredResult(_0x35db10,_0x2db350))[_0x5631('0x44')](handleError(_0x35db10,null));};exports[_0x5631('0x45')]=function(_0x166647,_0x3c394a){var _0x52982e={'raw':![],'where':{'id':_0x166647[_0x5631('0x46')]['id']}},_0x54aa32={};_0x54aa32[_0x5631('0x32')]=_['keys'](db['IntegrationReport'][_0x5631('0x2e')]);_0x54aa32[_0x5631('0x34')]=_[_0x5631('0x33')](_0x166647[_0x5631('0x34')]);_0x54aa32[_0x5631('0x3b')]=_[_0x5631('0x35')](_0x54aa32[_0x5631('0x32')],_0x54aa32[_0x5631('0x34')]);_0x52982e[_0x5631('0x36')]=_['intersection'](_0x54aa32[_0x5631('0x32')],qs[_0x5631('0x37')](_0x166647['query'][_0x5631('0x37')]));_0x52982e[_0x5631('0x36')]=_0x52982e[_0x5631('0x36')]['length']?_0x52982e[_0x5631('0x36')]:_0x54aa32[_0x5631('0x32')];if(_0x166647['query'][_0x5631('0x41')]){_0x52982e[_0x5631('0x42')]=[{'all':!![]}];}_0x52982e=_[_0x5631('0x3e')]({},_0x52982e,_0x166647[_0x5631('0x40')]);return db['IntegrationReport']['find'](_0x52982e)['then'](handleEntityNotFound(_0x3c394a,null))[_0x5631('0x25')](respondWithResult(_0x3c394a,null))[_0x5631('0x44')](handleError(_0x3c394a,null));};exports[_0x5631('0x47')]=function(_0x172694,_0x2a9176){return db['IntegrationReport'][_0x5631('0x47')](_0x172694[_0x5631('0x48')],{})[_0x5631('0x25')](respondWithResult(_0x2a9176,0xc9))['catch'](handleError(_0x2a9176,null));};exports[_0x5631('0x24')]=function(_0x53169d,_0x2881d8){if(_0x53169d['body']['id']){delete _0x53169d[_0x5631('0x48')]['id'];}return db[_0x5631('0x2d')][_0x5631('0x49')]({'where':{'id':_0x53169d[_0x5631('0x46')]['id']}})[_0x5631('0x25')](handleEntityNotFound(_0x2881d8,null))[_0x5631('0x25')](saveUpdates(_0x53169d[_0x5631('0x48')],null))[_0x5631('0x25')](respondWithResult(_0x2881d8,null))[_0x5631('0x44')](handleError(_0x2881d8,null));};exports['destroy']=function(_0x28c47e,_0x50e91e){return db[_0x5631('0x2d')][_0x5631('0x49')]({'where':{'id':_0x28c47e['params']['id']}})[_0x5631('0x25')](handleEntityNotFound(_0x50e91e,null))[_0x5631('0x25')](removeEntity(_0x50e91e,null))[_0x5631('0x44')](handleError(_0x50e91e,null));};exports[_0x5631('0x4a')]=function(_0x50762d,_0x43955c){return db[_0x5631('0x2d')][_0x5631('0x4a')]()[_0x5631('0x25')](respondWithResult(_0x43955c,null))[_0x5631('0x44')](handleError(_0x43955c,null));}; \ No newline at end of file +var _0x7cbd=['attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','options','includeAll','findAll','catch','show','params','rawAttributes','length','find','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','update','then','error','stack','name','index','map','IntegrationReport','key','keys','filters','intersection','model','query'];(function(_0x5842c3,_0x56bd74){var _0x44bf8c=function(_0x79551f){while(--_0x79551f){_0x5842c3['push'](_0x5842c3['shift']());}};_0x44bf8c(++_0x56bd74);}(_0x7cbd,0xb0));var _0xd7cb=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0x7cbd[_0x40bffc];return _0x3007e9;};'use strict';var emlformat=require(_0xd7cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd7cb('0x1'));var jsonpatch=require(_0xd7cb('0x2'));var rp=require(_0xd7cb('0x3'));var moment=require(_0xd7cb('0x4'));var BPromise=require(_0xd7cb('0x5'));var Mustache=require(_0xd7cb('0x6'));var util=require(_0xd7cb('0x7'));var path=require(_0xd7cb('0x8'));var sox=require(_0xd7cb('0x9'));var csv=require(_0xd7cb('0xa'));var ejs=require(_0xd7cb('0xb'));var fs=require('fs');var fs_extra=require(_0xd7cb('0xc'));var _=require(_0xd7cb('0xd'));var squel=require(_0xd7cb('0xe'));var crypto=require(_0xd7cb('0xf'));var jsforce=require(_0xd7cb('0x10'));var deskjs=require(_0xd7cb('0x11'));var toCsv=require('to-csv');var querystring=require(_0xd7cb('0x12'));var Papa=require(_0xd7cb('0x13'));var Redis=require('ioredis');var authService=require(_0xd7cb('0x14'));var qs=require(_0xd7cb('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd7cb('0x16'));var logger=require(_0xd7cb('0x17'))(_0xd7cb('0x18'));var utils=require(_0xd7cb('0x19'));var config=require(_0xd7cb('0x1a'));var licenseUtil=require(_0xd7cb('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5291cd,_0x16faf7){_0x16faf7=_0x16faf7||0xcc;return function(_0x2184d5){if(_0x2184d5){return _0x5291cd[_0xd7cb('0x1c')](_0x16faf7);}return _0x5291cd[_0xd7cb('0x1d')](_0x16faf7)[_0xd7cb('0x1e')]();};}function respondWithResult(_0x2212d0,_0x4698fb){_0x4698fb=_0x4698fb||0xc8;return function(_0x452359){if(_0x452359){return _0x2212d0[_0xd7cb('0x1d')](_0x4698fb)['json'](_0x452359);}};}function respondWithFilteredResult(_0x316df2,_0x3d131d){return function(_0x11fb06){if(_0x11fb06){var _0x554ef4=typeof _0x3d131d['offset']===_0xd7cb('0x1f')&&typeof _0x3d131d['limit']==='undefined';var _0x48830e=_0x11fb06[_0xd7cb('0x20')];var _0x243085=_0x554ef4?0x0:_0x3d131d[_0xd7cb('0x21')];var _0x2727c3=_0x554ef4?_0x11fb06[_0xd7cb('0x20')]:_0x3d131d['offset']+_0x3d131d[_0xd7cb('0x22')];var _0x35b47c;if(_0x2727c3>=_0x48830e){_0x2727c3=_0x48830e;_0x35b47c=0xc8;}else{_0x35b47c=0xce;}_0x316df2[_0xd7cb('0x1d')](_0x35b47c);return _0x316df2[_0xd7cb('0x23')](_0xd7cb('0x24'),_0x243085+'-'+_0x2727c3+'/'+_0x48830e)[_0xd7cb('0x25')](_0x11fb06);}return null;};}function patchUpdates(_0x165127){return function(_0x57f24a){try{jsonpatch['apply'](_0x57f24a,_0x165127,!![]);}catch(_0x4789f9){return BPromise['reject'](_0x4789f9);}return _0x57f24a['save']();};}function saveUpdates(_0x2f6725,_0x4c4b92){return function(_0x6e5109){if(_0x6e5109){return _0x6e5109[_0xd7cb('0x26')](_0x2f6725)[_0xd7cb('0x27')](function(_0x3b1ebb){return _0x3b1ebb;});}return null;};}function removeEntity(_0x3303a4,_0x9d8634){return function(_0x50775c){if(_0x50775c){return _0x50775c['destroy']()[_0xd7cb('0x27')](function(){_0x3303a4[_0xd7cb('0x1d')](0xcc)[_0xd7cb('0x1e')]();});}};}function handleEntityNotFound(_0x533b4e,_0x3e23cb){return function(_0x251860){if(!_0x251860){_0x533b4e[_0xd7cb('0x1c')](0x194);}return _0x251860;};}function handleError(_0x23b0c5,_0x209e4d){_0x209e4d=_0x209e4d||0x1f4;return function(_0x2125dc){logger[_0xd7cb('0x28')](_0x2125dc[_0xd7cb('0x29')]);if(_0x2125dc['name']){delete _0x2125dc[_0xd7cb('0x2a')];}_0x23b0c5[_0xd7cb('0x1d')](_0x209e4d)['send'](_0x2125dc);};}exports[_0xd7cb('0x2b')]=function(_0x5dbd84,_0xe86bc4){var _0x4f3020={},_0x55c62a={},_0x1d3b2c={'count':0x0,'rows':[]};var _0x21af58=_[_0xd7cb('0x2c')](db[_0xd7cb('0x2d')]['rawAttributes'],function(_0x1ce0d3){return{'name':_0x1ce0d3['fieldName'],'type':_0x1ce0d3['type'][_0xd7cb('0x2e')]};});_0x55c62a['model']=_[_0xd7cb('0x2c')](_0x21af58,_0xd7cb('0x2a'));_0x55c62a['query']=_[_0xd7cb('0x2f')](_0x5dbd84['query']);_0x55c62a[_0xd7cb('0x30')]=_[_0xd7cb('0x31')](_0x55c62a[_0xd7cb('0x32')],_0x55c62a[_0xd7cb('0x33')]);_0x4f3020[_0xd7cb('0x34')]=_[_0xd7cb('0x31')](_0x55c62a[_0xd7cb('0x32')],qs[_0xd7cb('0x35')](_0x5dbd84['query']['fields']));_0x4f3020['attributes']=_0x4f3020[_0xd7cb('0x34')]['length']?_0x4f3020[_0xd7cb('0x34')]:_0x55c62a[_0xd7cb('0x32')];if(!_0x5dbd84[_0xd7cb('0x33')][_0xd7cb('0x36')](_0xd7cb('0x37'))){_0x4f3020['limit']=qs[_0xd7cb('0x22')](_0x5dbd84[_0xd7cb('0x33')][_0xd7cb('0x22')]);_0x4f3020[_0xd7cb('0x21')]=qs[_0xd7cb('0x21')](_0x5dbd84[_0xd7cb('0x33')][_0xd7cb('0x21')]);}_0x4f3020[_0xd7cb('0x38')]=qs[_0xd7cb('0x39')](_0x5dbd84['query'][_0xd7cb('0x39')]);_0x4f3020[_0xd7cb('0x3a')]=qs['filters'](_[_0xd7cb('0x3b')](_0x5dbd84[_0xd7cb('0x33')],_0x55c62a[_0xd7cb('0x30')]),_0x21af58);if(_0x5dbd84[_0xd7cb('0x33')]['filter']){_0x4f3020[_0xd7cb('0x3a')]=_[_0xd7cb('0x3c')](_0x4f3020[_0xd7cb('0x3a')],{'$or':_[_0xd7cb('0x2c')](_0x21af58,function(_0x43710d){if(_0x43710d[_0xd7cb('0x3d')]!=='VIRTUAL'){var _0x38b598={};_0x38b598[_0x43710d[_0xd7cb('0x2a')]]={'$like':'%'+_0x5dbd84[_0xd7cb('0x33')][_0xd7cb('0x3e')]+'%'};return _0x38b598;}})});}_0x4f3020=_[_0xd7cb('0x3c')]({},_0x4f3020,_0x5dbd84[_0xd7cb('0x3f')]);var _0x28dd8e={'where':_0x4f3020[_0xd7cb('0x3a')]};return db[_0xd7cb('0x2d')][_0xd7cb('0x20')](_0x28dd8e)[_0xd7cb('0x27')](function(_0x83022c){_0x1d3b2c['count']=_0x83022c;if(_0x5dbd84['query'][_0xd7cb('0x40')]){_0x4f3020['include']=[{'all':!![]}];}return db[_0xd7cb('0x2d')][_0xd7cb('0x41')](_0x4f3020);})[_0xd7cb('0x27')](function(_0x4f7635){_0x1d3b2c['rows']=_0x4f7635;return _0x1d3b2c;})['then'](respondWithFilteredResult(_0xe86bc4,_0x4f3020))[_0xd7cb('0x42')](handleError(_0xe86bc4,null));};exports[_0xd7cb('0x43')]=function(_0x786775,_0x55c5a6){var _0x151aa2={'raw':![],'where':{'id':_0x786775[_0xd7cb('0x44')]['id']}},_0x1e6c15={};_0x1e6c15[_0xd7cb('0x32')]=_[_0xd7cb('0x2f')](db[_0xd7cb('0x2d')][_0xd7cb('0x45')]);_0x1e6c15[_0xd7cb('0x33')]=_[_0xd7cb('0x2f')](_0x786775[_0xd7cb('0x33')]);_0x1e6c15[_0xd7cb('0x30')]=_[_0xd7cb('0x31')](_0x1e6c15[_0xd7cb('0x32')],_0x1e6c15[_0xd7cb('0x33')]);_0x151aa2[_0xd7cb('0x34')]=_['intersection'](_0x1e6c15[_0xd7cb('0x32')],qs[_0xd7cb('0x35')](_0x786775['query'][_0xd7cb('0x35')]));_0x151aa2[_0xd7cb('0x34')]=_0x151aa2['attributes'][_0xd7cb('0x46')]?_0x151aa2[_0xd7cb('0x34')]:_0x1e6c15['model'];if(_0x786775[_0xd7cb('0x33')]['includeAll']){_0x151aa2['include']=[{'all':!![]}];}_0x151aa2=_['merge']({},_0x151aa2,_0x786775[_0xd7cb('0x3f')]);return db[_0xd7cb('0x2d')][_0xd7cb('0x47')](_0x151aa2)['then'](handleEntityNotFound(_0x55c5a6,null))[_0xd7cb('0x27')](respondWithResult(_0x55c5a6,null))[_0xd7cb('0x42')](handleError(_0x55c5a6,null));};exports[_0xd7cb('0x48')]=function(_0x428a49,_0x2de4f1){return db[_0xd7cb('0x2d')][_0xd7cb('0x48')](_0x428a49[_0xd7cb('0x49')],{})[_0xd7cb('0x27')](respondWithResult(_0x2de4f1,0xc9))[_0xd7cb('0x42')](handleError(_0x2de4f1,null));};exports[_0xd7cb('0x26')]=function(_0x204033,_0x346167){if(_0x204033[_0xd7cb('0x49')]['id']){delete _0x204033[_0xd7cb('0x49')]['id'];}return db[_0xd7cb('0x2d')]['find']({'where':{'id':_0x204033['params']['id']}})[_0xd7cb('0x27')](handleEntityNotFound(_0x346167,null))['then'](saveUpdates(_0x204033[_0xd7cb('0x49')],null))['then'](respondWithResult(_0x346167,null))['catch'](handleError(_0x346167,null));};exports[_0xd7cb('0x4a')]=function(_0x41b8a8,_0x210585){return db['IntegrationReport'][_0xd7cb('0x47')]({'where':{'id':_0x41b8a8[_0xd7cb('0x44')]['id']}})[_0xd7cb('0x27')](handleEntityNotFound(_0x210585,null))[_0xd7cb('0x27')](removeEntity(_0x210585,null))[_0xd7cb('0x42')](handleError(_0x210585,null));};exports[_0xd7cb('0x4b')]=function(_0x207868,_0x2a209d){return db[_0xd7cb('0x2d')]['describe']()[_0xd7cb('0x27')](respondWithResult(_0x2a209d,null))['catch'](handleError(_0x2a209d,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 97707c3..144aabb 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 _0xc591=['./integrationReport.attributes','exports','IntegrationReport','report_integration','lodash','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1e2080,_0x53283b){var _0x260111=function(_0x15da5e){while(--_0x15da5e){_0x1e2080['push'](_0x1e2080['shift']());}};_0x260111(++_0x53283b);}(_0xc591,0x138));var _0x1c59=function(_0x499eaf,_0x560a5a){_0x499eaf=_0x499eaf-0x0;var _0x2fa121=_0xc591[_0x499eaf];return _0x2fa121;};'use strict';var _=require(_0x1c59('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x1c59('0x1'));var BPromise=require(_0x1c59('0x2'));var rp=require(_0x1c59('0x3'));var fs=require('fs');var path=require(_0x1c59('0x4'));var rimraf=require(_0x1c59('0x5'));var config=require(_0x1c59('0x6'));var attributes=require(_0x1c59('0x7'));module[_0x1c59('0x8')]=function(_0x3f7d09,_0x25f169){return _0x3f7d09['define'](_0x1c59('0x9'),attributes,{'tableName':_0x1c59('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x92bc=['exports','define','IntegrationReport','report_integration','util','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x13ff53,_0x5e1424){var _0x290228=function(_0x3e3133){while(--_0x3e3133){_0x13ff53['push'](_0x13ff53['shift']());}};_0x290228(++_0x5e1424);}(_0x92bc,0x159));var _0xc92b=function(_0x7ef830,_0x38cb58){_0x7ef830=_0x7ef830-0x0;var _0x3f015f=_0x92bc[_0x7ef830];return _0x3f015f;};'use strict';var _=require('lodash');var util=require(_0xc92b('0x0'));var logger=require('../../config/logger')(_0xc92b('0x1'));var moment=require(_0xc92b('0x2'));var BPromise=require(_0xc92b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc92b('0x4'));var rimraf=require(_0xc92b('0x5'));var config=require(_0xc92b('0x6'));var attributes=require('./integrationReport.attributes');module[_0xc92b('0x7')]=function(_0x1e2628,_0x3ce728){return _0x1e2628[_0xc92b('0x8')](_0xc92b('0x9'),attributes,{'tableName':_0xc92b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index 7f321f9..9b7cf05 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 _0x31f0=['../../config/environment','request','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x1d3046,_0x8b14e1){var _0x3b9b62=function(_0xb69d69){while(--_0xb69d69){_0x1d3046['push'](_0x1d3046['shift']());}};_0x3b9b62(++_0x8b14e1);}(_0x31f0,0xb7));var _0x031f=function(_0x25d2a8,_0x4366c9){_0x25d2a8=_0x25d2a8-0x0;var _0x5d71a1=_0x31f0[_0x25d2a8];return _0x5d71a1;};'use strict';var _=require(_0x031f('0x0'));var util=require('util');var moment=require(_0x031f('0x1'));var BPromise=require('bluebird');var rs=require(_0x031f('0x2'));var fs=require('fs');var Redis=require(_0x031f('0x3'));var db=require(_0x031f('0x4'))['db'];var utils=require(_0x031f('0x5'));var logger=require('../../config/logger')(_0x031f('0x6'));var config=require(_0x031f('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3dc98e,_0x487e65,_0x365f59){return new BPromise(function(_0x4300b4,_0x2569b6){return client[_0x031f('0x8')](_0x3dc98e,_0x365f59)['then'](function(_0x2e5624){logger[_0x031f('0x9')](_0x031f('0xa'),_0x487e65,_0x031f('0xb'));logger[_0x031f('0xc')](_0x031f('0xd'),_0x487e65,_0x031f('0xb'),JSON[_0x031f('0xe')](_0x2e5624));if(_0x2e5624['error']){if(_0x2e5624[_0x031f('0xf')][_0x031f('0x10')]===0x1f4){logger[_0x031f('0xf')](_0x031f('0xa'),_0x487e65,_0x2e5624[_0x031f('0xf')][_0x031f('0x11')]);return _0x2569b6(_0x2e5624[_0x031f('0xf')]['message']);}logger[_0x031f('0xf')](_0x031f('0xa'),_0x487e65,_0x2e5624[_0x031f('0xf')][_0x031f('0x11')]);return _0x4300b4(_0x2e5624[_0x031f('0xf')]['message']);}else{logger['info'](_0x031f('0xa'),_0x487e65,_0x031f('0xb'));_0x4300b4(_0x2e5624[_0x031f('0x12')][_0x031f('0x11')]);}})['catch'](function(_0x1dc4a7){logger[_0x031f('0xf')]('IntegrationReport,\x20%s,\x20%s',_0x487e65,_0x1dc4a7);_0x2569b6(_0x1dc4a7);});});} \ No newline at end of file +var _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0x4975,0x86));var _0x5497=function(_0x1805e9,_0x5d7073){_0x1805e9=_0x1805e9-0x0;var _0x12f9fa=_0x4975[_0x1805e9];return _0x12f9fa;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('IntegrationReport,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 3b43cd2..da5b0e7 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 _0xc9b0=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./interval.controller','get','isAuthenticated','index','/:id','show','post','create','/:id/sub_intervals','/:id/sub_intervals/create_many','addIntervals','update','delete','destroy'];(function(_0x2c7bf7,_0x349742){var _0x37afc0=function(_0x5ac6c9){while(--_0x5ac6c9){_0x2c7bf7['push'](_0x2c7bf7['shift']());}};_0x37afc0(++_0x349742);}(_0xc9b0,0x143));var _0x0c9b=function(_0x50ce7b,_0x3fe777){_0x50ce7b=_0x50ce7b-0x0;var _0x1bfa54=_0xc9b0[_0x50ce7b];return _0x1bfa54;};'use strict';var multer=require(_0x0c9b('0x0'));var util=require(_0x0c9b('0x1'));var path=require(_0x0c9b('0x2'));var timeout=require(_0x0c9b('0x3'));var express=require(_0x0c9b('0x4'));var router=express[_0x0c9b('0x5')]();var fs_extra=require(_0x0c9b('0x6'));var auth=require(_0x0c9b('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0c9b('0x8'));router[_0x0c9b('0x9')]('/',auth[_0x0c9b('0xa')](),controller[_0x0c9b('0xb')]);router[_0x0c9b('0x9')](_0x0c9b('0xc'),auth[_0x0c9b('0xa')](),controller[_0x0c9b('0xd')]);router[_0x0c9b('0x9')]('/:id/sub_intervals',auth['isAuthenticated'](),controller['getIntervals']);router[_0x0c9b('0xe')]('/',auth[_0x0c9b('0xa')](),controller[_0x0c9b('0xf')]);router[_0x0c9b('0xe')](_0x0c9b('0x10'),auth[_0x0c9b('0xa')](),controller['addInterval']);router[_0x0c9b('0xe')](_0x0c9b('0x11'),auth['isAuthenticated'](),controller[_0x0c9b('0x12')]);router['put'](_0x0c9b('0xc'),auth[_0x0c9b('0xa')](),controller[_0x0c9b('0x13')]);router[_0x0c9b('0x14')](_0x0c9b('0xc'),auth[_0x0c9b('0xa')](),controller[_0x0c9b('0x15')]);module[_0x0c9b('0x16')]=router; \ No newline at end of file +var _0x6a9a=['addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/sub_intervals','create','post'];(function(_0x1b74c2,_0x2a1c53){var _0x170e1b=function(_0x41619f){while(--_0x41619f){_0x1b74c2['push'](_0x1b74c2['shift']());}};_0x170e1b(++_0x2a1c53);}(_0x6a9a,0x1bd));var _0xa6a9=function(_0x562f3b,_0x4c65ae){_0x562f3b=_0x562f3b-0x0;var _0x1edd55=_0x6a9a[_0x562f3b];return _0x1edd55;};'use strict';var multer=require(_0xa6a9('0x0'));var util=require(_0xa6a9('0x1'));var path=require('path');var timeout=require(_0xa6a9('0x2'));var express=require(_0xa6a9('0x3'));var router=express['Router']();var fs_extra=require(_0xa6a9('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa6a9('0x5'));var config=require(_0xa6a9('0x6'));var controller=require('./interval.controller');router[_0xa6a9('0x7')]('/',auth[_0xa6a9('0x8')](),controller[_0xa6a9('0x9')]);router[_0xa6a9('0x7')](_0xa6a9('0xa'),auth[_0xa6a9('0x8')](),controller[_0xa6a9('0xb')]);router[_0xa6a9('0x7')](_0xa6a9('0xc'),auth[_0xa6a9('0x8')](),controller['getIntervals']);router['post']('/',auth[_0xa6a9('0x8')](),controller[_0xa6a9('0xd')]);router[_0xa6a9('0xe')](_0xa6a9('0xc'),auth[_0xa6a9('0x8')](),controller[_0xa6a9('0xf')]);router[_0xa6a9('0xe')](_0xa6a9('0x10'),auth[_0xa6a9('0x8')](),controller[_0xa6a9('0x11')]);router[_0xa6a9('0x12')](_0xa6a9('0xa'),auth[_0xa6a9('0x8')](),controller[_0xa6a9('0x13')]);router[_0xa6a9('0x14')](_0xa6a9('0xa'),auth[_0xa6a9('0x8')](),controller[_0xa6a9('0x15')]);module[_0xa6a9('0x16')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 4983f31..ccce9ca 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 _0x8ec0=['exports','STRING','sequelize'];(function(_0x4ee2a7,_0x238fcd){var _0x340020=function(_0x3819e8){while(--_0x3819e8){_0x4ee2a7['push'](_0x4ee2a7['shift']());}};_0x340020(++_0x238fcd);}(_0x8ec0,0xe3));var _0x08ec=function(_0x4f880f,_0x345032){_0x4f880f=_0x4f880f-0x0;var _0x200d3d=_0x8ec0[_0x4f880f];return _0x200d3d;};'use strict';var Sequelize=require(_0x08ec('0x0'));module[_0x08ec('0x1')]={'name':{'type':Sequelize[_0x08ec('0x2')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x08ec('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x153e=['sequelize','exports','STRING'];(function(_0x532476,_0x4499df){var _0x84eeae=function(_0x2e64e9){while(--_0x2e64e9){_0x532476['push'](_0x532476['shift']());}};_0x84eeae(++_0x4499df);}(_0x153e,0x144));var _0xe153=function(_0x374ada,_0x27b3a5){_0x374ada=_0x374ada-0x0;var _0x449ed8=_0x153e[_0x374ada];return _0x449ed8;};'use strict';var Sequelize=require(_0xe153('0x0'));module[_0xe153('0x1')]={'name':{'type':Sequelize[_0xe153('0x2')]},'description':{'type':Sequelize[_0xe153('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index ea43f8c..8d1cb93 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 _0xc6f8=['../../config/logger','api','../../config/utils','../../config/license/util','../../components/extensions/rewrite','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','get','Intervals','stack','name','index','Interval','fieldName','model','map','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','type','merge','options','include','rows','catch','show','params','rawAttributes','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','getIntervals','addIntervals','sequelize','transaction','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x1bdae0,_0x19527a){var _0x423785=function(_0x3097e9){while(--_0x3097e9){_0x1bdae0['push'](_0x1bdae0['shift']());}};_0x423785(++_0x19527a);}(_0xc6f8,0x147));var _0x8c6f=function(_0x57b35f,_0x358299){_0x57b35f=_0x57b35f-0x0;var _0x57d4fe=_0xc6f8[_0x57b35f];return _0x57d4fe;};'use strict';var emlformat=require(_0x8c6f('0x0'));var rimraf=require(_0x8c6f('0x1'));var zipdir=require(_0x8c6f('0x2'));var jsonpatch=require(_0x8c6f('0x3'));var rp=require(_0x8c6f('0x4'));var moment=require('moment');var BPromise=require(_0x8c6f('0x5'));var Mustache=require(_0x8c6f('0x6'));var util=require(_0x8c6f('0x7'));var path=require(_0x8c6f('0x8'));var sox=require(_0x8c6f('0x9'));var csv=require(_0x8c6f('0xa'));var ejs=require(_0x8c6f('0xb'));var fs=require('fs');var fs_extra=require(_0x8c6f('0xc'));var _=require(_0x8c6f('0xd'));var squel=require(_0x8c6f('0xe'));var crypto=require('crypto');var jsforce=require(_0x8c6f('0xf'));var deskjs=require(_0x8c6f('0x10'));var toCsv=require(_0x8c6f('0xa'));var querystring=require(_0x8c6f('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8c6f('0x12'));var qs=require(_0x8c6f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8c6f('0x14'));var logger=require(_0x8c6f('0x15'))(_0x8c6f('0x16'));var utils=require(_0x8c6f('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x8c6f('0x18'));var db=require('../../mysqldb')['db'];var extensions=require(_0x8c6f('0x19'));function respondWithStatusCode(_0x187b8a,_0x14471f){_0x14471f=_0x14471f||0xcc;return function(_0x44a760){if(_0x44a760){return _0x187b8a[_0x8c6f('0x1a')](_0x14471f);}return _0x187b8a[_0x8c6f('0x1b')](_0x14471f)[_0x8c6f('0x1c')]();};}function respondWithResult(_0x3b6327,_0x32c479){_0x32c479=_0x32c479||0xc8;return function(_0xa8196c){if(_0xa8196c){return _0x3b6327['status'](_0x32c479)['json'](_0xa8196c);}};}function respondWithFilteredResult(_0x21e27a,_0xcc641a){return function(_0x52c452){if(_0x52c452){var _0x297b6f=typeof _0xcc641a['offset']===_0x8c6f('0x1d')&&typeof _0xcc641a[_0x8c6f('0x1e')]===_0x8c6f('0x1d');var _0x2815f=_0x52c452[_0x8c6f('0x1f')];var _0x2c9a54=_0x297b6f?0x0:_0xcc641a[_0x8c6f('0x20')];var _0x239853=_0x297b6f?_0x52c452[_0x8c6f('0x1f')]:_0xcc641a['offset']+_0xcc641a[_0x8c6f('0x1e')];var _0x4e9462;if(_0x239853>=_0x2815f){_0x239853=_0x2815f;_0x4e9462=0xc8;}else{_0x4e9462=0xce;}_0x21e27a[_0x8c6f('0x1b')](_0x4e9462);return _0x21e27a[_0x8c6f('0x21')](_0x8c6f('0x22'),_0x2c9a54+'-'+_0x239853+'/'+_0x2815f)['json'](_0x52c452);}return null;};}function patchUpdates(_0x2cdf55){return function(_0x565f51){try{jsonpatch[_0x8c6f('0x23')](_0x565f51,_0x2cdf55,!![]);}catch(_0x38d4b2){return BPromise[_0x8c6f('0x24')](_0x38d4b2);}return _0x565f51['save']();};}function saveUpdates(_0x15efa4,_0xadb129){return function(_0xeb819e){if(_0xeb819e){return _0xeb819e[_0x8c6f('0x25')](_0x15efa4)[_0x8c6f('0x26')](function(_0x113965){return _0x113965;});}return null;};}function removeEntity(_0x2c0fc7,_0x5d6981){return function(_0xae8199){if(_0xae8199){return _0xae8199['destroy']()[_0x8c6f('0x26')](function(){var _0x291b4e=_0xae8199[_0x8c6f('0x27')]({'plain':!![]});var _0x1fc11b=_0x8c6f('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x1fc11b,'resourceId':_0x291b4e['id']}})[_0x8c6f('0x26')](function(){return _0xae8199;});})[_0x8c6f('0x26')](function(){_0x2c0fc7[_0x8c6f('0x1b')](0xcc)[_0x8c6f('0x1c')]();});}};}function handleEntityNotFound(_0x1bf058,_0x541585){return function(_0x164a0e){if(!_0x164a0e){_0x1bf058[_0x8c6f('0x1a')](0x194);}return _0x164a0e;};}function handleError(_0x4c4dee,_0x2e26cd){_0x2e26cd=_0x2e26cd||0x1f4;return function(_0x4b23f8){logger['error'](_0x4b23f8[_0x8c6f('0x29')]);if(_0x4b23f8[_0x8c6f('0x2a')]){delete _0x4b23f8[_0x8c6f('0x2a')];}_0x4c4dee[_0x8c6f('0x1b')](_0x2e26cd)['send'](_0x4b23f8);};}exports[_0x8c6f('0x2b')]=function(_0x5a0e9b,_0x550fe2){var _0x2c4e0e={},_0x451223={},_0xfa6fbc={'count':0x0,'rows':[]};var _0x65ba2d=_['map'](db[_0x8c6f('0x2c')]['rawAttributes'],function(_0x19b683){return{'name':_0x19b683[_0x8c6f('0x2d')],'type':_0x19b683['type']['key']};});_0x451223[_0x8c6f('0x2e')]=_[_0x8c6f('0x2f')](_0x65ba2d,_0x8c6f('0x2a'));_0x451223['query']=_[_0x8c6f('0x30')](_0x5a0e9b[_0x8c6f('0x31')]);_0x451223[_0x8c6f('0x32')]=_[_0x8c6f('0x33')](_0x451223[_0x8c6f('0x2e')],_0x451223[_0x8c6f('0x31')]);_0x2c4e0e[_0x8c6f('0x34')]=_[_0x8c6f('0x33')](_0x451223[_0x8c6f('0x2e')],qs[_0x8c6f('0x35')](_0x5a0e9b[_0x8c6f('0x31')]['fields']));_0x2c4e0e[_0x8c6f('0x34')]=_0x2c4e0e[_0x8c6f('0x34')][_0x8c6f('0x36')]?_0x2c4e0e[_0x8c6f('0x34')]:_0x451223[_0x8c6f('0x2e')];if(!_0x5a0e9b['query']['hasOwnProperty'](_0x8c6f('0x37'))){_0x2c4e0e[_0x8c6f('0x1e')]=qs['limit'](_0x5a0e9b[_0x8c6f('0x31')][_0x8c6f('0x1e')]);_0x2c4e0e['offset']=qs[_0x8c6f('0x20')](_0x5a0e9b['query'][_0x8c6f('0x20')]);}_0x2c4e0e[_0x8c6f('0x38')]=qs['sort'](_0x5a0e9b['query'][_0x8c6f('0x39')]);_0x2c4e0e[_0x8c6f('0x3a')]=qs[_0x8c6f('0x32')](_[_0x8c6f('0x3b')](_0x5a0e9b[_0x8c6f('0x31')],_0x451223[_0x8c6f('0x32')]),_0x65ba2d);if(_0x5a0e9b['query'][_0x8c6f('0x3c')]){_0x2c4e0e[_0x8c6f('0x3a')]=_['merge'](_0x2c4e0e[_0x8c6f('0x3a')],{'$or':_['map'](_0x65ba2d,function(_0x161c87){if(_0x161c87[_0x8c6f('0x3d')]!=='VIRTUAL'){var _0x2a4add={};_0x2a4add[_0x161c87[_0x8c6f('0x2a')]]={'$like':'%'+_0x5a0e9b['query'][_0x8c6f('0x3c')]+'%'};return _0x2a4add;}})});}_0x2c4e0e=_[_0x8c6f('0x3e')]({},_0x2c4e0e,_0x5a0e9b[_0x8c6f('0x3f')]);var _0xbd406d={'where':_0x2c4e0e[_0x8c6f('0x3a')]};return db['Interval'][_0x8c6f('0x1f')](_0xbd406d)[_0x8c6f('0x26')](function(_0x375d6b){_0xfa6fbc[_0x8c6f('0x1f')]=_0x375d6b;if(_0x5a0e9b[_0x8c6f('0x31')]['includeAll']){_0x2c4e0e[_0x8c6f('0x40')]=[{'all':!![]}];}return db[_0x8c6f('0x2c')]['findAll'](_0x2c4e0e);})[_0x8c6f('0x26')](function(_0x5cf3a5){_0xfa6fbc[_0x8c6f('0x41')]=_0x5cf3a5;return _0xfa6fbc;})[_0x8c6f('0x26')](respondWithFilteredResult(_0x550fe2,_0x2c4e0e))[_0x8c6f('0x42')](handleError(_0x550fe2,null));};exports[_0x8c6f('0x43')]=function(_0x50055,_0x538225){var _0x30b42f={'raw':!![],'where':{'id':_0x50055[_0x8c6f('0x44')]['id']}},_0x50b661={};_0x50b661[_0x8c6f('0x2e')]=_[_0x8c6f('0x30')](db['Interval'][_0x8c6f('0x45')]);_0x50b661[_0x8c6f('0x31')]=_[_0x8c6f('0x30')](_0x50055['query']);_0x50b661[_0x8c6f('0x32')]=_[_0x8c6f('0x33')](_0x50b661[_0x8c6f('0x2e')],_0x50b661[_0x8c6f('0x31')]);_0x30b42f[_0x8c6f('0x34')]=_[_0x8c6f('0x33')](_0x50b661['model'],qs['fields'](_0x50055[_0x8c6f('0x31')][_0x8c6f('0x35')]));_0x30b42f[_0x8c6f('0x34')]=_0x30b42f[_0x8c6f('0x34')][_0x8c6f('0x36')]?_0x30b42f[_0x8c6f('0x34')]:_0x50b661[_0x8c6f('0x2e')];if(_0x50055['query'][_0x8c6f('0x46')]){_0x30b42f[_0x8c6f('0x40')]=[{'all':!![]}];}_0x30b42f=_[_0x8c6f('0x3e')]({},_0x30b42f,_0x50055['options']);return db[_0x8c6f('0x2c')][_0x8c6f('0x47')](_0x30b42f)[_0x8c6f('0x26')](handleEntityNotFound(_0x538225,null))[_0x8c6f('0x26')](respondWithResult(_0x538225,null))['catch'](handleError(_0x538225,null));};exports['create']=function(_0x3cded5,_0x285f9b){return db[_0x8c6f('0x2c')][_0x8c6f('0x48')](_0x3cded5[_0x8c6f('0x49')],{})['then'](function(_0x3daa8e){var _0x22ed19=_0x3cded5[_0x8c6f('0x4a')][_0x8c6f('0x27')]({'plain':!![]});if(!_0x22ed19)throw new Error(_0x8c6f('0x4b'));if(_0x22ed19[_0x8c6f('0x4c')]===_0x8c6f('0x4a')){var _0x567472=_0x3daa8e['get']({'plain':!![]});var _0x4e01b7=_0x8c6f('0x28');return db['UserProfileSection'][_0x8c6f('0x47')]({'where':{'name':_0x4e01b7,'userProfileId':_0x22ed19[_0x8c6f('0x4d')]},'raw':!![]})['then'](function(_0x50dd38){if(_0x50dd38&&_0x50dd38[_0x8c6f('0x4e')]===0x0){return db['UserProfileResource'][_0x8c6f('0x48')]({'name':_0x567472['name'],'resourceId':_0x567472['id'],'type':_0x50dd38[_0x8c6f('0x2a')],'sectionId':_0x50dd38['id']},{})[_0x8c6f('0x26')](function(){return _0x3daa8e;});}else{return _0x3daa8e;}})[_0x8c6f('0x42')](function(_0x5dfbf0){logger[_0x8c6f('0x4f')](_0x8c6f('0x50'),_0x5dfbf0);throw _0x5dfbf0;});}return _0x3daa8e;})['then'](respondWithResult(_0x285f9b,0xc9))[_0x8c6f('0x42')](handleError(_0x285f9b,null));};exports['update']=function(_0x560aba,_0x181d85){if(_0x560aba['body']['id']){delete _0x560aba[_0x8c6f('0x49')]['id'];}return db[_0x8c6f('0x2c')][_0x8c6f('0x47')]({'where':{'id':_0x560aba[_0x8c6f('0x44')]['id']}})[_0x8c6f('0x26')](handleEntityNotFound(_0x181d85,null))[_0x8c6f('0x26')](saveUpdates(_0x560aba[_0x8c6f('0x49')],null))[_0x8c6f('0x26')](respondWithResult(_0x181d85,null))['catch'](handleError(_0x181d85,null));};exports[_0x8c6f('0x51')]=function(_0x39ae5f,_0x3a519f){return db[_0x8c6f('0x2c')][_0x8c6f('0x47')]({'where':{'id':_0x39ae5f[_0x8c6f('0x44')]['id']}})['then'](handleEntityNotFound(_0x3a519f,null))[_0x8c6f('0x26')](removeEntity(_0x3a519f,null))[_0x8c6f('0x42')](handleError(_0x3a519f,null));};exports['addInterval']=function(_0x3594f2,_0x61515a,_0x54ab7c){if(_0x3594f2[_0x8c6f('0x49')]['id']){delete _0x3594f2['body']['id'];}return db['Interval'][_0x8c6f('0x47')]({'where':{'id':_0x3594f2[_0x8c6f('0x44')]['id']}})[_0x8c6f('0x26')](handleEntityNotFound(_0x61515a,null))['then'](function(_0x10e990){if(_0x10e990){_0x3594f2['body']['IntervalId']=_0x10e990['id'];return db[_0x8c6f('0x2c')][_0x8c6f('0x48')](_0x3594f2[_0x8c6f('0x49')]);}})['then'](respondWithResult(_0x61515a,null))[_0x8c6f('0x42')](handleError(_0x61515a,null));};exports[_0x8c6f('0x52')]=function(_0x38a331,_0x20e5a5,_0x2bb7af){var _0x1ec4df={};var _0x298409={};var _0x2543d2;var _0x42cd8e;return db[_0x8c6f('0x2c')]['findOne']({'where':{'id':_0x38a331['params']['id']}})[_0x8c6f('0x26')](handleEntityNotFound(_0x20e5a5,null))['then'](function(_0x3afba2){if(_0x3afba2){_0x2543d2=_0x3afba2;_0x298409[_0x8c6f('0x2e')]=_['keys'](db[_0x8c6f('0x2c')]['rawAttributes']);_0x298409[_0x8c6f('0x31')]=_[_0x8c6f('0x30')](_0x38a331[_0x8c6f('0x31')]);_0x298409['filters']=_['intersection'](_0x298409[_0x8c6f('0x2e')],_0x298409['query']);_0x1ec4df[_0x8c6f('0x34')]=_[_0x8c6f('0x33')](_0x298409['model'],qs[_0x8c6f('0x35')](_0x38a331['query'][_0x8c6f('0x35')]));_0x1ec4df[_0x8c6f('0x34')]=_0x1ec4df[_0x8c6f('0x34')][_0x8c6f('0x36')]?_0x1ec4df[_0x8c6f('0x34')]:_0x298409[_0x8c6f('0x2e')];_0x1ec4df[_0x8c6f('0x38')]=qs[_0x8c6f('0x39')](_0x38a331['query'][_0x8c6f('0x39')]);_0x1ec4df[_0x8c6f('0x3a')]=qs[_0x8c6f('0x32')](_[_0x8c6f('0x3b')](_0x38a331[_0x8c6f('0x31')],_0x298409[_0x8c6f('0x32')]));if(_0x38a331[_0x8c6f('0x31')][_0x8c6f('0x3c')]){_0x1ec4df[_0x8c6f('0x3a')]=_[_0x8c6f('0x3e')](_0x1ec4df['where'],{'$or':_[_0x8c6f('0x2f')](_0x1ec4df['attributes'],function(_0x454e25){var _0x151ab1={};_0x151ab1[_0x454e25]={'$like':'%'+_0x38a331[_0x8c6f('0x31')]['filter']+'%'};return _0x151ab1;})});}_0x1ec4df=_[_0x8c6f('0x3e')]({},_0x1ec4df,_0x38a331[_0x8c6f('0x3f')]);return _0x2543d2['getIntervals'](_0x1ec4df);}})[_0x8c6f('0x26')](function(_0x5b8684){if(_0x5b8684){_0x42cd8e=_0x5b8684[_0x8c6f('0x36')];if(!_0x38a331[_0x8c6f('0x31')]['hasOwnProperty'](_0x8c6f('0x37'))){_0x1ec4df['limit']=qs[_0x8c6f('0x1e')](_0x38a331[_0x8c6f('0x31')][_0x8c6f('0x1e')]);_0x1ec4df[_0x8c6f('0x20')]=qs[_0x8c6f('0x20')](_0x38a331['query']['offset']);}return _0x2543d2[_0x8c6f('0x52')](_0x1ec4df);}})[_0x8c6f('0x26')](function(_0x40a7cd){if(_0x40a7cd){return _0x40a7cd?{'count':_0x42cd8e,'rows':_0x40a7cd}:null;}})[_0x8c6f('0x26')](respondWithResult(_0x20e5a5,null))['catch'](handleError(_0x20e5a5,null));};exports[_0x8c6f('0x53')]=function(_0x33d131,_0x3bae10,_0x2a9ddc){return db[_0x8c6f('0x2c')]['findOne']({'where':{'id':_0x33d131['params']['id']}})['then'](handleEntityNotFound(_0x3bae10,null))[_0x8c6f('0x26')](function(_0x22d42c){if(_0x22d42c){return db[_0x8c6f('0x54')][_0x8c6f('0x55')](function(_0x5070e5){return db[_0x8c6f('0x2c')][_0x8c6f('0x51')]({'where':{'IntervalId':_0x33d131[_0x8c6f('0x44')]['id']},'transaction':_0x5070e5})[_0x8c6f('0x26')](function(_0x141dcd){var _0x4bad69=_['map'](_0x33d131[_0x8c6f('0x49')],function(_0x451d94){delete _0x451d94['id'];_0x451d94['IntervalId']=_0x33d131[_0x8c6f('0x44')]['id'];return _0x451d94;});return db['Interval']['bulkCreate'](_0x4bad69,{'transaction':_0x5070e5});});})[_0x8c6f('0x26')](function(){return db[_0x8c6f('0x2c')][_0x8c6f('0x56')]({'where':{'IntervalId':_0x33d131[_0x8c6f('0x44')]['id']}});});}})['then'](respondWithResult(_0x3bae10,null))[_0x8c6f('0x42')](handleError(_0x3bae10,null));}; \ No newline at end of file +var _0xa36e=['model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','Interval','include','catch','params','keys','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','addInterval','IntervalId','getIntervals','findOne','order','addIntervals','transaction','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','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','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','get','Intervals','UserProfileResource','stack','name','send','index','map','rawAttributes','fieldName','key'];(function(_0x256b1e,_0x4573f4){var _0x724522=function(_0xf047d9){while(--_0xf047d9){_0x256b1e['push'](_0x256b1e['shift']());}};_0x724522(++_0x4573f4);}(_0xa36e,0x1ef));var _0xea36=function(_0x42f8e7,_0x4c5af4){_0x42f8e7=_0x42f8e7-0x0;var _0x152117=_0xa36e[_0x42f8e7];return _0x152117;};'use strict';var emlformat=require(_0xea36('0x0'));var rimraf=require(_0xea36('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xea36('0x2'));var rp=require('request-promise');var moment=require(_0xea36('0x3'));var BPromise=require(_0xea36('0x4'));var Mustache=require(_0xea36('0x5'));var util=require(_0xea36('0x6'));var path=require('path');var sox=require(_0xea36('0x7'));var csv=require('to-csv');var ejs=require(_0xea36('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xea36('0x9'));var crypto=require(_0xea36('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xea36('0xb'));var toCsv=require(_0xea36('0xc'));var querystring=require(_0xea36('0xd'));var Papa=require(_0xea36('0xe'));var Redis=require(_0xea36('0xf'));var authService=require(_0xea36('0x10'));var qs=require(_0xea36('0x11'));var as=require(_0xea36('0x12'));var hardwareService=require(_0xea36('0x13'));var logger=require(_0xea36('0x14'))('api');var utils=require(_0xea36('0x15'));var config=require(_0xea36('0x16'));var licenseUtil=require(_0xea36('0x17'));var db=require(_0xea36('0x18'))['db'];var extensions=require(_0xea36('0x19'));function respondWithStatusCode(_0x356c4f,_0x5ae86d){_0x5ae86d=_0x5ae86d||0xcc;return function(_0x4f0878){if(_0x4f0878){return _0x356c4f[_0xea36('0x1a')](_0x5ae86d);}return _0x356c4f[_0xea36('0x1b')](_0x5ae86d)[_0xea36('0x1c')]();};}function respondWithResult(_0x4fde88,_0x20b943){_0x20b943=_0x20b943||0xc8;return function(_0x4082eb){if(_0x4082eb){return _0x4fde88[_0xea36('0x1b')](_0x20b943)[_0xea36('0x1d')](_0x4082eb);}};}function respondWithFilteredResult(_0x3d6aa1,_0x3d27dc){return function(_0x5dce5c){if(_0x5dce5c){var _0x2f9bee=typeof _0x3d27dc[_0xea36('0x1e')]===_0xea36('0x1f')&&typeof _0x3d27dc[_0xea36('0x20')]===_0xea36('0x1f');var _0x320906=_0x5dce5c[_0xea36('0x21')];var _0x4af38f=_0x2f9bee?0x0:_0x3d27dc[_0xea36('0x1e')];var _0x371ace=_0x2f9bee?_0x5dce5c[_0xea36('0x21')]:_0x3d27dc[_0xea36('0x1e')]+_0x3d27dc['limit'];var _0x59e4ca;if(_0x371ace>=_0x320906){_0x371ace=_0x320906;_0x59e4ca=0xc8;}else{_0x59e4ca=0xce;}_0x3d6aa1[_0xea36('0x1b')](_0x59e4ca);return _0x3d6aa1[_0xea36('0x22')]('Content-Range',_0x4af38f+'-'+_0x371ace+'/'+_0x320906)['json'](_0x5dce5c);}return null;};}function patchUpdates(_0xa4bf08){return function(_0xf216c9){try{jsonpatch[_0xea36('0x23')](_0xf216c9,_0xa4bf08,!![]);}catch(_0xe99e9f){return BPromise[_0xea36('0x24')](_0xe99e9f);}return _0xf216c9[_0xea36('0x25')]();};}function saveUpdates(_0x1ed2bc,_0x3f1964){return function(_0x20902a){if(_0x20902a){return _0x20902a[_0xea36('0x26')](_0x1ed2bc)[_0xea36('0x27')](function(_0x194d22){return _0x194d22;});}return null;};}function removeEntity(_0x3d1a9f,_0x3ca07a){return function(_0x19e90c){if(_0x19e90c){return _0x19e90c['destroy']()[_0xea36('0x27')](function(){var _0x323c63=_0x19e90c[_0xea36('0x28')]({'plain':!![]});var _0x4cb74a=_0xea36('0x29');return db[_0xea36('0x2a')]['destroy']({'where':{'type':_0x4cb74a,'resourceId':_0x323c63['id']}})[_0xea36('0x27')](function(){return _0x19e90c;});})[_0xea36('0x27')](function(){_0x3d1a9f[_0xea36('0x1b')](0xcc)[_0xea36('0x1c')]();});}};}function handleEntityNotFound(_0x1f4bce,_0x4d002d){return function(_0x6a2cce){if(!_0x6a2cce){_0x1f4bce[_0xea36('0x1a')](0x194);}return _0x6a2cce;};}function handleError(_0x2cf59a,_0xb6e376){_0xb6e376=_0xb6e376||0x1f4;return function(_0x3a37a9){logger['error'](_0x3a37a9[_0xea36('0x2b')]);if(_0x3a37a9[_0xea36('0x2c')]){delete _0x3a37a9['name'];}_0x2cf59a[_0xea36('0x1b')](_0xb6e376)[_0xea36('0x2d')](_0x3a37a9);};}exports[_0xea36('0x2e')]=function(_0x2ca65a,_0x399175){var _0x2a004b={},_0x2009aa={},_0x5a4d29={'count':0x0,'rows':[]};var _0x460eb5=_[_0xea36('0x2f')](db['Interval'][_0xea36('0x30')],function(_0x2708d4){return{'name':_0x2708d4[_0xea36('0x31')],'type':_0x2708d4['type'][_0xea36('0x32')]};});_0x2009aa[_0xea36('0x33')]=_[_0xea36('0x2f')](_0x460eb5,_0xea36('0x2c'));_0x2009aa[_0xea36('0x34')]=_['keys'](_0x2ca65a[_0xea36('0x34')]);_0x2009aa[_0xea36('0x35')]=_[_0xea36('0x36')](_0x2009aa[_0xea36('0x33')],_0x2009aa[_0xea36('0x34')]);_0x2a004b['attributes']=_[_0xea36('0x36')](_0x2009aa[_0xea36('0x33')],qs[_0xea36('0x37')](_0x2ca65a[_0xea36('0x34')][_0xea36('0x37')]));_0x2a004b[_0xea36('0x38')]=_0x2a004b['attributes'][_0xea36('0x39')]?_0x2a004b[_0xea36('0x38')]:_0x2009aa[_0xea36('0x33')];if(!_0x2ca65a[_0xea36('0x34')][_0xea36('0x3a')](_0xea36('0x3b'))){_0x2a004b['limit']=qs[_0xea36('0x20')](_0x2ca65a[_0xea36('0x34')][_0xea36('0x20')]);_0x2a004b[_0xea36('0x1e')]=qs['offset'](_0x2ca65a[_0xea36('0x34')]['offset']);}_0x2a004b['order']=qs[_0xea36('0x3c')](_0x2ca65a[_0xea36('0x34')][_0xea36('0x3c')]);_0x2a004b[_0xea36('0x3d')]=qs[_0xea36('0x35')](_[_0xea36('0x3e')](_0x2ca65a[_0xea36('0x34')],_0x2009aa[_0xea36('0x35')]),_0x460eb5);if(_0x2ca65a[_0xea36('0x34')][_0xea36('0x3f')]){_0x2a004b[_0xea36('0x3d')]=_[_0xea36('0x40')](_0x2a004b['where'],{'$or':_[_0xea36('0x2f')](_0x460eb5,function(_0x251df0){if(_0x251df0[_0xea36('0x41')]!==_0xea36('0x42')){var _0x1bf5e1={};_0x1bf5e1[_0x251df0['name']]={'$like':'%'+_0x2ca65a['query']['filter']+'%'};return _0x1bf5e1;}})});}_0x2a004b=_['merge']({},_0x2a004b,_0x2ca65a[_0xea36('0x43')]);var _0x447873={'where':_0x2a004b[_0xea36('0x3d')]};return db[_0xea36('0x44')]['count'](_0x447873)[_0xea36('0x27')](function(_0x2096cd){_0x5a4d29[_0xea36('0x21')]=_0x2096cd;if(_0x2ca65a[_0xea36('0x34')]['includeAll']){_0x2a004b[_0xea36('0x45')]=[{'all':!![]}];}return db[_0xea36('0x44')]['findAll'](_0x2a004b);})[_0xea36('0x27')](function(_0x4010e3){_0x5a4d29['rows']=_0x4010e3;return _0x5a4d29;})[_0xea36('0x27')](respondWithFilteredResult(_0x399175,_0x2a004b))[_0xea36('0x46')](handleError(_0x399175,null));};exports['show']=function(_0x27dd41,_0x215d1f){var _0xc8a55e={'raw':!![],'where':{'id':_0x27dd41[_0xea36('0x47')]['id']}},_0x197eca={};_0x197eca[_0xea36('0x33')]=_[_0xea36('0x48')](db[_0xea36('0x44')][_0xea36('0x30')]);_0x197eca[_0xea36('0x34')]=_[_0xea36('0x48')](_0x27dd41[_0xea36('0x34')]);_0x197eca[_0xea36('0x35')]=_[_0xea36('0x36')](_0x197eca[_0xea36('0x33')],_0x197eca[_0xea36('0x34')]);_0xc8a55e[_0xea36('0x38')]=_[_0xea36('0x36')](_0x197eca[_0xea36('0x33')],qs[_0xea36('0x37')](_0x27dd41[_0xea36('0x34')][_0xea36('0x37')]));_0xc8a55e[_0xea36('0x38')]=_0xc8a55e[_0xea36('0x38')]['length']?_0xc8a55e[_0xea36('0x38')]:_0x197eca['model'];if(_0x27dd41[_0xea36('0x34')]['includeAll']){_0xc8a55e[_0xea36('0x45')]=[{'all':!![]}];}_0xc8a55e=_['merge']({},_0xc8a55e,_0x27dd41[_0xea36('0x43')]);return db[_0xea36('0x44')][_0xea36('0x49')](_0xc8a55e)[_0xea36('0x27')](handleEntityNotFound(_0x215d1f,null))[_0xea36('0x27')](respondWithResult(_0x215d1f,null))[_0xea36('0x46')](handleError(_0x215d1f,null));};exports[_0xea36('0x4a')]=function(_0x3e8be3,_0xfb858a){return db['Interval']['create'](_0x3e8be3['body'],{})['then'](function(_0x4d6495){var _0x26314e=_0x3e8be3[_0xea36('0x4b')][_0xea36('0x28')]({'plain':!![]});if(!_0x26314e)throw new Error(_0xea36('0x4c'));if(_0x26314e[_0xea36('0x4d')]===_0xea36('0x4b')){var _0x23ff73=_0x4d6495[_0xea36('0x28')]({'plain':!![]});var _0x2a6214=_0xea36('0x29');return db[_0xea36('0x4e')][_0xea36('0x49')]({'where':{'name':_0x2a6214,'userProfileId':_0x26314e[_0xea36('0x4f')]},'raw':!![]})[_0xea36('0x27')](function(_0x4ecc1a){if(_0x4ecc1a&&_0x4ecc1a['autoAssociation']===0x0){return db[_0xea36('0x2a')]['create']({'name':_0x23ff73[_0xea36('0x2c')],'resourceId':_0x23ff73['id'],'type':_0x4ecc1a['name'],'sectionId':_0x4ecc1a['id']},{})[_0xea36('0x27')](function(){return _0x4d6495;});}else{return _0x4d6495;}})[_0xea36('0x46')](function(_0x555253){logger[_0xea36('0x50')](_0xea36('0x51'),_0x555253);throw _0x555253;});}return _0x4d6495;})[_0xea36('0x27')](respondWithResult(_0xfb858a,0xc9))[_0xea36('0x46')](handleError(_0xfb858a,null));};exports[_0xea36('0x26')]=function(_0x5efa28,_0x3d1c31){if(_0x5efa28[_0xea36('0x52')]['id']){delete _0x5efa28[_0xea36('0x52')]['id'];}return db[_0xea36('0x44')][_0xea36('0x49')]({'where':{'id':_0x5efa28[_0xea36('0x47')]['id']}})[_0xea36('0x27')](handleEntityNotFound(_0x3d1c31,null))[_0xea36('0x27')](saveUpdates(_0x5efa28['body'],null))[_0xea36('0x27')](respondWithResult(_0x3d1c31,null))[_0xea36('0x46')](handleError(_0x3d1c31,null));};exports[_0xea36('0x53')]=function(_0x222c46,_0x1e1151){return db[_0xea36('0x44')][_0xea36('0x49')]({'where':{'id':_0x222c46[_0xea36('0x47')]['id']}})[_0xea36('0x27')](handleEntityNotFound(_0x1e1151,null))[_0xea36('0x27')](removeEntity(_0x1e1151,null))[_0xea36('0x46')](handleError(_0x1e1151,null));};exports[_0xea36('0x54')]=function(_0x3a9032,_0x434239,_0xbde81b){if(_0x3a9032[_0xea36('0x52')]['id']){delete _0x3a9032[_0xea36('0x52')]['id'];}return db[_0xea36('0x44')][_0xea36('0x49')]({'where':{'id':_0x3a9032['params']['id']}})[_0xea36('0x27')](handleEntityNotFound(_0x434239,null))['then'](function(_0x43beb6){if(_0x43beb6){_0x3a9032[_0xea36('0x52')][_0xea36('0x55')]=_0x43beb6['id'];return db['Interval'][_0xea36('0x4a')](_0x3a9032['body']);}})[_0xea36('0x27')](respondWithResult(_0x434239,null))['catch'](handleError(_0x434239,null));};exports[_0xea36('0x56')]=function(_0x5ce46e,_0x2c741a,_0x7daf3c){var _0x20d44f={};var _0x20d559={};var _0x14c702;var _0x5c2376;return db[_0xea36('0x44')][_0xea36('0x57')]({'where':{'id':_0x5ce46e[_0xea36('0x47')]['id']}})[_0xea36('0x27')](handleEntityNotFound(_0x2c741a,null))[_0xea36('0x27')](function(_0x3630fb){if(_0x3630fb){_0x14c702=_0x3630fb;_0x20d559[_0xea36('0x33')]=_['keys'](db[_0xea36('0x44')]['rawAttributes']);_0x20d559[_0xea36('0x34')]=_[_0xea36('0x48')](_0x5ce46e[_0xea36('0x34')]);_0x20d559[_0xea36('0x35')]=_['intersection'](_0x20d559[_0xea36('0x33')],_0x20d559[_0xea36('0x34')]);_0x20d44f['attributes']=_[_0xea36('0x36')](_0x20d559[_0xea36('0x33')],qs[_0xea36('0x37')](_0x5ce46e['query'][_0xea36('0x37')]));_0x20d44f[_0xea36('0x38')]=_0x20d44f[_0xea36('0x38')]['length']?_0x20d44f[_0xea36('0x38')]:_0x20d559[_0xea36('0x33')];_0x20d44f[_0xea36('0x58')]=qs['sort'](_0x5ce46e[_0xea36('0x34')][_0xea36('0x3c')]);_0x20d44f[_0xea36('0x3d')]=qs['filters'](_['pick'](_0x5ce46e['query'],_0x20d559[_0xea36('0x35')]));if(_0x5ce46e[_0xea36('0x34')][_0xea36('0x3f')]){_0x20d44f['where']=_[_0xea36('0x40')](_0x20d44f[_0xea36('0x3d')],{'$or':_[_0xea36('0x2f')](_0x20d44f['attributes'],function(_0x25aa3c){var _0x3e9d00={};_0x3e9d00[_0x25aa3c]={'$like':'%'+_0x5ce46e[_0xea36('0x34')][_0xea36('0x3f')]+'%'};return _0x3e9d00;})});}_0x20d44f=_[_0xea36('0x40')]({},_0x20d44f,_0x5ce46e[_0xea36('0x43')]);return _0x14c702[_0xea36('0x56')](_0x20d44f);}})[_0xea36('0x27')](function(_0x55542b){if(_0x55542b){_0x5c2376=_0x55542b[_0xea36('0x39')];if(!_0x5ce46e[_0xea36('0x34')]['hasOwnProperty'](_0xea36('0x3b'))){_0x20d44f['limit']=qs[_0xea36('0x20')](_0x5ce46e[_0xea36('0x34')][_0xea36('0x20')]);_0x20d44f[_0xea36('0x1e')]=qs[_0xea36('0x1e')](_0x5ce46e['query'][_0xea36('0x1e')]);}return _0x14c702[_0xea36('0x56')](_0x20d44f);}})[_0xea36('0x27')](function(_0x1218e7){if(_0x1218e7){return _0x1218e7?{'count':_0x5c2376,'rows':_0x1218e7}:null;}})[_0xea36('0x27')](respondWithResult(_0x2c741a,null))['catch'](handleError(_0x2c741a,null));};exports[_0xea36('0x59')]=function(_0x405664,_0x14e54e,_0xed4bd1){return db['Interval'][_0xea36('0x57')]({'where':{'id':_0x405664[_0xea36('0x47')]['id']}})[_0xea36('0x27')](handleEntityNotFound(_0x14e54e,null))['then'](function(_0x2f5b4d){if(_0x2f5b4d){return db['sequelize'][_0xea36('0x5a')](function(_0x403f4f){return db[_0xea36('0x44')]['destroy']({'where':{'IntervalId':_0x405664[_0xea36('0x47')]['id']},'transaction':_0x403f4f})[_0xea36('0x27')](function(_0xffe78d){var _0x1fa313=_[_0xea36('0x2f')](_0x405664['body'],function(_0x7543cc){delete _0x7543cc['id'];_0x7543cc[_0xea36('0x55')]=_0x405664[_0xea36('0x47')]['id'];return _0x7543cc;});return db[_0xea36('0x44')]['bulkCreate'](_0x1fa313,{'transaction':_0x403f4f});});})[_0xea36('0x27')](function(){return db[_0xea36('0x44')]['findAll']({'where':{'IntervalId':_0x405664[_0xea36('0x47')]['id']}});});}})['then'](respondWithResult(_0x14e54e,null))[_0xea36('0x46')](handleError(_0x14e54e,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index b4d004d..6a4ce96 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 _0xc04a=['bluebird','request-promise','path','rimraf','./interval.attributes','../../components/extensions/rewrite','exports','define','Interval','tools_intervals','rewrite','lodash','api'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0xc04a,0x184));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('../../config/logger')(_0xac04('0x1'));var moment=require('moment');var BPromise=require(_0xac04('0x2'));var rp=require(_0xac04('0x3'));var fs=require('fs');var path=require(_0xac04('0x4'));var rimraf=require(_0xac04('0x5'));var config=require('../../config/environment');var attributes=require(_0xac04('0x6'));var extensions=require(_0xac04('0x7'));module[_0xac04('0x8')]=function(_0x3a97c8,_0x567947){return _0x3a97c8[_0xac04('0x9')](_0xac04('0xa'),attributes,{'tableName':_0xac04('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x16ce07,_0x5b98a4){extensions[_0xac04('0xc')](_0x3a97c8,_0x16ce07);},'afterBulkCreate':function(_0xf1d00f,_0x5d012b,_0x568619){_0x568619();extensions[_0xac04('0xc')](_0x3a97c8,_0xf1d00f[0x0]);},'afterUpdate':function(_0xa336de,_0x4da3b6){extensions[_0xac04('0xc')](_0x3a97c8,_0xa336de);},'afterDestroy':function(_0x2992f8,_0xfd10b0){extensions[_0xac04('0xc')](_0x3a97c8,_0x2992f8);}}});}; \ No newline at end of file +var _0x1f88=['tools_intervals','rewrite','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./interval.attributes','Interval'];(function(_0x44b616,_0x3069bf){var _0x47efbf=function(_0x1375ba){while(--_0x1375ba){_0x44b616['push'](_0x44b616['shift']());}};_0x47efbf(++_0x3069bf);}(_0x1f88,0x1a2));var _0x81f8=function(_0x15b590,_0x287a22){_0x15b590=_0x15b590-0x0;var _0x35035e=_0x1f88[_0x15b590];return _0x35035e;};'use strict';var _=require(_0x81f8('0x0'));var util=require(_0x81f8('0x1'));var logger=require('../../config/logger')(_0x81f8('0x2'));var moment=require(_0x81f8('0x3'));var BPromise=require(_0x81f8('0x4'));var rp=require(_0x81f8('0x5'));var fs=require('fs');var path=require(_0x81f8('0x6'));var rimraf=require(_0x81f8('0x7'));var config=require(_0x81f8('0x8'));var attributes=require(_0x81f8('0x9'));var extensions=require('../../components/extensions/rewrite');module['exports']=function(_0x52cbb8,_0xb61a1c){return _0x52cbb8['define'](_0x81f8('0xa'),attributes,{'tableName':_0x81f8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3dee15,_0x578825){extensions[_0x81f8('0xc')](_0x52cbb8,_0x3dee15);},'afterBulkCreate':function(_0x5ef820,_0x2eadc5,_0xe2dbba){_0xe2dbba();extensions[_0x81f8('0xc')](_0x52cbb8,_0x5ef820[0x0]);},'afterUpdate':function(_0x473aa3,_0x37c20f){extensions[_0x81f8('0xc')](_0x52cbb8,_0x473aa3);},'afterDestroy':function(_0xe346b7,_0x18738c){extensions[_0x81f8('0xc')](_0x52cbb8,_0xe346b7);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 5d8ae71..2f67ca9 100644 --- a/server/api/interval/interval.rpc.js +++ b/server/api/interval/interval.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x2bf5bd,_0x120787){var _0xc810c0=function(_0xba9dd3){while(--_0xba9dd3){_0x2bf5bd['push'](_0x2bf5bd['shift']());}};_0xc810c0(++_0x120787);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'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(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index b3b7e63..2848a39 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 _0x2032=['isAuthenticated','send','Router','../../components/auth/service','./jira.controller'];(function(_0x1d0c49,_0x502fa1){var _0x448b34=function(_0x162ccf){while(--_0x162ccf){_0x1d0c49['push'](_0x1d0c49['shift']());}};_0x448b34(++_0x502fa1);}(_0x2032,0xd9));var _0x2203=function(_0x34f810,_0x2830bd){_0x34f810=_0x34f810-0x0;var _0x4dcf5b=_0x2032[_0x34f810];return _0x4dcf5b;};'use strict';var express=require('express');var router=express[_0x2203('0x0')]();var auth=require(_0x2203('0x1'));var controller=require(_0x2203('0x2'));router['post']('/',auth[_0x2203('0x3')](),controller[_0x2203('0x4')]);module['exports']=router; \ No newline at end of file +var _0xadb5=['post','isAuthenticated','exports','Router','./jira.controller'];(function(_0xfd7a7c,_0x2dba3e){var _0xf2cb93=function(_0x1dff14){while(--_0x1dff14){_0xfd7a7c['push'](_0xfd7a7c['shift']());}};_0xf2cb93(++_0x2dba3e);}(_0xadb5,0xad));var _0x5adb=function(_0x57ea42,_0x2c79ea){_0x57ea42=_0x57ea42-0x0;var _0x5ceedb=_0xadb5[_0x57ea42];return _0x5ceedb;};'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 56b3ca2..4701d11 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 _0x2ac8=['customfield_11503','name','customfield_11504','track.xcallymotion.com','application/json','Basic\x20','toString','base64','request','utf8','end','statusCode','parse','status','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','openIssue','send','body','headers','connection','remoteAddress','socket','../../config/logger','support','3eAmWpBVP0','key','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502'];(function(_0x4b0f0b,_0x8785d1){var _0x13514=function(_0x3a50b5){while(--_0x3a50b5){_0x4b0f0b['push'](_0x4b0f0b['shift']());}};_0x13514(++_0x8785d1);}(_0x2ac8,0x1df));var _0x82ac=function(_0x2602d9,_0x32ffa4){_0x2602d9=_0x2602d9-0x0;var _0x431def=_0x2ac8[_0x2602d9];return _0x431def;};'use strict';var BPromise=require('bluebird');var https=require('https');var logger=require(_0x82ac('0x0'))('api');var USERNAME=_0x82ac('0x1');var PASSWORD=_0x82ac('0x2');function openIssue(_0x2f147f,_0x28b1b7){var _0x5c4ee0={'fields':{'project':{'key':_0x2f147f[_0x82ac('0x3')]||'MOTGUI'},'summary':(_0x2f147f['summary']||'Report')+_0x82ac('0x4')+_0x2f147f['ip'],'description':_0x2f147f[_0x82ac('0x5')]||JSON[_0x82ac('0x6')](_0x2f147f),'issuetype':{'name':_0x2f147f[_0x82ac('0x7')]||_0x82ac('0x8')}}};_0x5c4ee0[_0x82ac('0x9')][_0x82ac('0xa')]=_0x2f147f[_0x82ac('0xb')];_0x5c4ee0[_0x82ac('0x9')][_0x82ac('0xc')]=_0x2f147f[_0x82ac('0xd')];_0x5c4ee0[_0x82ac('0x9')][_0x82ac('0xe')]=_0x2f147f['newToken'];_0x5c4ee0[_0x82ac('0x9')][_0x82ac('0xf')]=_0x2f147f[_0x82ac('0x10')];_0x5c4ee0[_0x82ac('0x9')][_0x82ac('0x11')]=_0x2f147f['reason'];_0x5c4ee0[_0x82ac('0x9')]['customfield_10102']=_0x2f147f['ip'];var _0x497211={'host':_0x82ac('0x12'),'port':0x1bb,'path':'/rest/api/2/issue','method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0x82ac('0x13'),'Authorization':_0x82ac('0x14')+new Buffer(USERNAME+':'+PASSWORD)[_0x82ac('0x15')](_0x82ac('0x16'))}};var _0x49f732=JSON['stringify'](_0x5c4ee0);var _0x1abc70=https[_0x82ac('0x17')](_0x497211,function(_0x4c7d0c){_0x4c7d0c['setEncoding'](_0x82ac('0x18'));var _0x3d9c9d='';_0x4c7d0c['on']('data',function(_0x427482){_0x3d9c9d+=_0x427482;});_0x4c7d0c['on'](_0x82ac('0x19'),function(){if(_0x28b1b7){return _0x28b1b7['status'](_0x4c7d0c[_0x82ac('0x1a')])['json'](JSON[_0x82ac('0x1b')](_0x3d9c9d));}});});_0x1abc70['on']('error',function(_0x304e20){if(_0x28b1b7){return _0x28b1b7[_0x82ac('0x1c')](0x1f4)[_0x82ac('0x1d')]({'errors':[{'message':_0x82ac('0x1e'),'type':'api.jira'}]});}});_0x1abc70['write'](_0x49f732);_0x1abc70[_0x82ac('0x19')]();}exports[_0x82ac('0x1f')]=openIssue;exports[_0x82ac('0x20')]=function(_0x2931c0,_0x346ec6){_0x2931c0[_0x82ac('0x21')]['ip']=_0x2931c0[_0x82ac('0x22')]['x-forwarded-for']||_0x2931c0[_0x82ac('0x23')][_0x82ac('0x24')]||_0x2931c0[_0x82ac('0x25')][_0x82ac('0x24')]||_0x2931c0['connection'][_0x82ac('0x25')][_0x82ac('0x24')];return openIssue(_0x2931c0[_0x82ac('0x21')],_0x346ec6);}; \ No newline at end of file +var _0xd85e=['fields','customfield_11501','oldToken','customfield_11502','newToken','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','application/json','Basic\x20','toString','base64','request','setEncoding','utf8','data','end','status','statusCode','json','parse','error','api.jira','write','body','headers','x-forwarded-for','remoteAddress','socket','connection','bluebird','https','../../config/logger','support','3eAmWpBVP0','key','MOTGUI','summary','Report','issuetype','Bug','customfield_11500','email'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xd85e,0x135));var _0xed85=function(_0x548bfc,_0x3fcb77){_0x548bfc=_0x548bfc-0x0;var _0x12cf16=_0xd85e[_0x548bfc];return _0x12cf16;};'use strict';var BPromise=require(_0xed85('0x0'));var https=require(_0xed85('0x1'));var logger=require(_0xed85('0x2'))('api');var USERNAME=_0xed85('0x3');var PASSWORD=_0xed85('0x4');function openIssue(_0x34d2a0,_0x1cfcb5){var _0x17586b={'fields':{'project':{'key':_0x34d2a0[_0xed85('0x5')]||_0xed85('0x6')},'summary':(_0x34d2a0[_0xed85('0x7')]||_0xed85('0x8'))+'\x20from\x20'+_0x34d2a0['ip'],'description':_0x34d2a0['description']||JSON['stringify'](_0x34d2a0),'issuetype':{'name':_0x34d2a0[_0xed85('0x9')]||_0xed85('0xa')}}};_0x17586b['fields'][_0xed85('0xb')]=_0x34d2a0[_0xed85('0xc')];_0x17586b[_0xed85('0xd')][_0xed85('0xe')]=_0x34d2a0[_0xed85('0xf')];_0x17586b[_0xed85('0xd')][_0xed85('0x10')]=_0x34d2a0[_0xed85('0x11')];_0x17586b[_0xed85('0xd')]['customfield_11503']=_0x34d2a0[_0xed85('0x12')];_0x17586b[_0xed85('0xd')][_0xed85('0x13')]=_0x34d2a0[_0xed85('0x14')];_0x17586b['fields'][_0xed85('0x15')]=_0x34d2a0['ip'];var _0x27996e={'host':_0xed85('0x16'),'port':0x1bb,'path':_0xed85('0x17'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0xed85('0x18'),'Authorization':_0xed85('0x19')+new Buffer(USERNAME+':'+PASSWORD)[_0xed85('0x1a')](_0xed85('0x1b'))}};var _0x1b0637=JSON['stringify'](_0x17586b);var _0x42a0b1=https[_0xed85('0x1c')](_0x27996e,function(_0x199342){_0x199342[_0xed85('0x1d')](_0xed85('0x1e'));var _0x3a2db2='';_0x199342['on'](_0xed85('0x1f'),function(_0x200c32){_0x3a2db2+=_0x200c32;});_0x199342['on'](_0xed85('0x20'),function(){if(_0x1cfcb5){return _0x1cfcb5[_0xed85('0x21')](_0x199342[_0xed85('0x22')])[_0xed85('0x23')](JSON[_0xed85('0x24')](_0x3a2db2));}});});_0x42a0b1['on'](_0xed85('0x25'),function(_0x2358c1){if(_0x1cfcb5){return _0x1cfcb5[_0xed85('0x21')](0x1f4)[_0xed85('0x23')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0xed85('0x26')}]});}});_0x42a0b1[_0xed85('0x27')](_0x1b0637);_0x42a0b1[_0xed85('0x20')]();}exports['openIssue']=openIssue;exports['send']=function(_0xf5988,_0x4044a8){_0xf5988[_0xed85('0x28')]['ip']=_0xf5988[_0xed85('0x29')][_0xed85('0x2a')]||_0xf5988['connection'][_0xed85('0x2b')]||_0xf5988[_0xed85('0x2c')]['remoteAddress']||_0xf5988[_0xed85('0x2d')][_0xed85('0x2c')][_0xed85('0x2b')];return openIssue(_0xf5988[_0xed85('0x28')],_0x4044a8);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 875f453..c3034d1 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 _0x4522=['../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','update','delete','destroy','exports','path','connect-timeout','express','fs-extra'];(function(_0xe811e4,_0x34e8ef){var _0x534de4=function(_0x584325){while(--_0x584325){_0xe811e4['push'](_0xe811e4['shift']());}};_0x534de4(++_0x34e8ef);}(_0x4522,0x1a0));var _0x2452=function(_0x3cc8c4,_0x56ca5f){_0x3cc8c4=_0x3cc8c4-0x0;var _0x36d18c=_0x4522[_0x3cc8c4];return _0x36d18c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2452('0x0'));var timeout=require(_0x2452('0x1'));var express=require(_0x2452('0x2'));var router=express['Router']();var fs_extra=require(_0x2452('0x3'));var auth=require(_0x2452('0x4'));var interaction=require(_0x2452('0x5'));var config=require(_0x2452('0x6'));var controller=require(_0x2452('0x7'));router[_0x2452('0x8')]('/',auth[_0x2452('0x9')](),controller[_0x2452('0xa')]);router[_0x2452('0x8')](_0x2452('0xb'),auth[_0x2452('0x9')](),controller[_0x2452('0xc')]);router[_0x2452('0x8')](_0x2452('0xd'),auth[_0x2452('0x9')](),controller[_0x2452('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2452('0xf')]);router['put']('/:id',auth[_0x2452('0x9')](),controller[_0x2452('0x10')]);router[_0x2452('0x11')](_0x2452('0xd'),auth[_0x2452('0x9')](),controller[_0x2452('0x12')]);module[_0x2452('0x13')]=router; \ No newline at end of file +var _0x0713=['delete','destroy','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update'];(function(_0x3b516c,_0x60d7ea){var _0xef2c01=function(_0x249550){while(--_0x249550){_0x3b516c['push'](_0x3b516c['shift']());}};_0xef2c01(++_0x60d7ea);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['show']);router[_0x3071('0xe')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xf')]);router[_0x3071('0x10')](_0x3071('0xd'),auth['isAuthenticated'](),controller[_0x3071('0x11')]);router[_0x3071('0x12')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 28d229a..875dcd1 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(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x7a54,0x106));var _0x47a5=function(_0x3710bf,_0x1066e8){_0x3710bf=_0x3710bf-0x0;var _0x431e84=_0x7a54[_0x3710bf];return _0x431e84;};'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(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x7a54,0x106));var _0x47a5=function(_0x402f38,_0x241309){_0x402f38=_0x402f38-0x0;var _0x5bf1b2=_0x7a54[_0x402f38];return _0x5bf1b2;};'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 bd7c7b6..dac4df2 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 _0xd634=['attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','rawAttributes','length','includeAll','find','create','body','describe','rimraf','zip-dir','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','update','destroy','then','end','error','stack','name','send','index','map','JscriptyAnswerReport','fieldName','type','key','model','query','keys','filters','intersection'];(function(_0x200a46,_0x29d7d6){var _0x14a3dd=function(_0x3e7878){while(--_0x3e7878){_0x200a46['push'](_0x200a46['shift']());}};_0x14a3dd(++_0x29d7d6);}(_0xd634,0xf4));var _0x4d63=function(_0x4226d6,_0x3864ca){_0x4226d6=_0x4226d6-0x0;var _0x19655b=_0xd634[_0x4226d6];return _0x19655b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4d63('0x0'));var zipdir=require(_0x4d63('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4d63('0x2'));var BPromise=require(_0x4d63('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4d63('0x4'));var sox=require(_0x4d63('0x5'));var csv=require(_0x4d63('0x6'));var ejs=require(_0x4d63('0x7'));var fs=require('fs');var fs_extra=require(_0x4d63('0x8'));var _=require(_0x4d63('0x9'));var squel=require(_0x4d63('0xa'));var crypto=require(_0x4d63('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4d63('0xc'));var authService=require(_0x4d63('0xd'));var qs=require(_0x4d63('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4d63('0xf'));var logger=require(_0x4d63('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x4d63('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x4d63('0x12'))['db'];function respondWithStatusCode(_0x35ab93,_0x19a9dd){_0x19a9dd=_0x19a9dd||0xcc;return function(_0xb30e76){if(_0xb30e76){return _0x35ab93[_0x4d63('0x13')](_0x19a9dd);}return _0x35ab93[_0x4d63('0x14')](_0x19a9dd)['end']();};}function respondWithResult(_0x51db48,_0x4ce316){_0x4ce316=_0x4ce316||0xc8;return function(_0x29065c){if(_0x29065c){return _0x51db48[_0x4d63('0x14')](_0x4ce316)[_0x4d63('0x15')](_0x29065c);}};}function respondWithFilteredResult(_0x24be25,_0x51048b){return function(_0x226eb4){if(_0x226eb4){var _0x2ca49a=typeof _0x51048b[_0x4d63('0x16')]===_0x4d63('0x17')&&typeof _0x51048b[_0x4d63('0x18')]===_0x4d63('0x17');var _0x43dc31=_0x226eb4[_0x4d63('0x19')];var _0x53bbb8=_0x2ca49a?0x0:_0x51048b['offset'];var _0x790e03=_0x2ca49a?_0x226eb4['count']:_0x51048b[_0x4d63('0x16')]+_0x51048b[_0x4d63('0x18')];var _0x37a03f;if(_0x790e03>=_0x43dc31){_0x790e03=_0x43dc31;_0x37a03f=0xc8;}else{_0x37a03f=0xce;}_0x24be25[_0x4d63('0x14')](_0x37a03f);return _0x24be25[_0x4d63('0x1a')]('Content-Range',_0x53bbb8+'-'+_0x790e03+'/'+_0x43dc31)[_0x4d63('0x15')](_0x226eb4);}return null;};}function patchUpdates(_0x12ef62){return function(_0x5b53db){try{jsonpatch[_0x4d63('0x1b')](_0x5b53db,_0x12ef62,!![]);}catch(_0xc2d3ab){return BPromise[_0x4d63('0x1c')](_0xc2d3ab);}return _0x5b53db['save']();};}function saveUpdates(_0x315da4,_0x131386){return function(_0xcc4333){if(_0xcc4333){return _0xcc4333[_0x4d63('0x1d')](_0x315da4)['then'](function(_0x3bb2f5){return _0x3bb2f5;});}return null;};}function removeEntity(_0x4f9cbb,_0x4e3e00){return function(_0x2ce377){if(_0x2ce377){return _0x2ce377[_0x4d63('0x1e')]()[_0x4d63('0x1f')](function(){_0x4f9cbb[_0x4d63('0x14')](0xcc)[_0x4d63('0x20')]();});}};}function handleEntityNotFound(_0x2b4423,_0x2beb3b){return function(_0x2195a9){if(!_0x2195a9){_0x2b4423[_0x4d63('0x13')](0x194);}return _0x2195a9;};}function handleError(_0x24a95d,_0x4d0d14){_0x4d0d14=_0x4d0d14||0x1f4;return function(_0x410bd9){logger[_0x4d63('0x21')](_0x410bd9[_0x4d63('0x22')]);if(_0x410bd9[_0x4d63('0x23')]){delete _0x410bd9[_0x4d63('0x23')];}_0x24a95d[_0x4d63('0x14')](_0x4d0d14)[_0x4d63('0x24')](_0x410bd9);};}exports[_0x4d63('0x25')]=function(_0xee43e,_0x6fcc4c){var _0x3860fe={},_0x1f8950={},_0x1b48bd={'count':0x0,'rows':[]};var _0x34136e=_[_0x4d63('0x26')](db[_0x4d63('0x27')]['rawAttributes'],function(_0x1968c2){return{'name':_0x1968c2[_0x4d63('0x28')],'type':_0x1968c2[_0x4d63('0x29')][_0x4d63('0x2a')]};});_0x1f8950[_0x4d63('0x2b')]=_[_0x4d63('0x26')](_0x34136e,'name');_0x1f8950[_0x4d63('0x2c')]=_[_0x4d63('0x2d')](_0xee43e[_0x4d63('0x2c')]);_0x1f8950[_0x4d63('0x2e')]=_[_0x4d63('0x2f')](_0x1f8950['model'],_0x1f8950[_0x4d63('0x2c')]);_0x3860fe[_0x4d63('0x30')]=_['intersection'](_0x1f8950[_0x4d63('0x2b')],qs[_0x4d63('0x31')](_0xee43e[_0x4d63('0x2c')]['fields']));_0x3860fe[_0x4d63('0x30')]=_0x3860fe[_0x4d63('0x30')]['length']?_0x3860fe[_0x4d63('0x30')]:_0x1f8950['model'];if(!_0xee43e['query'][_0x4d63('0x32')](_0x4d63('0x33'))){_0x3860fe[_0x4d63('0x18')]=qs[_0x4d63('0x18')](_0xee43e[_0x4d63('0x2c')][_0x4d63('0x18')]);_0x3860fe['offset']=qs[_0x4d63('0x16')](_0xee43e[_0x4d63('0x2c')][_0x4d63('0x16')]);}_0x3860fe[_0x4d63('0x34')]=qs['sort'](_0xee43e[_0x4d63('0x2c')][_0x4d63('0x35')]);_0x3860fe[_0x4d63('0x36')]=qs[_0x4d63('0x2e')](_[_0x4d63('0x37')](_0xee43e['query'],_0x1f8950['filters']),_0x34136e);if(_0xee43e[_0x4d63('0x2c')][_0x4d63('0x38')]){_0x3860fe['where']=_['merge'](_0x3860fe[_0x4d63('0x36')],{'$or':_['map'](_0x34136e,function(_0x9cc59c){if(_0x9cc59c[_0x4d63('0x29')]!==_0x4d63('0x39')){var _0x47880b={};_0x47880b[_0x9cc59c[_0x4d63('0x23')]]={'$like':'%'+_0xee43e[_0x4d63('0x2c')]['filter']+'%'};return _0x47880b;}})});}_0x3860fe=_[_0x4d63('0x3a')]({},_0x3860fe,_0xee43e[_0x4d63('0x3b')]);var _0x1a693e={'where':_0x3860fe[_0x4d63('0x36')]};return db[_0x4d63('0x27')][_0x4d63('0x19')](_0x1a693e)[_0x4d63('0x1f')](function(_0x892fe1){_0x1b48bd[_0x4d63('0x19')]=_0x892fe1;if(_0xee43e[_0x4d63('0x2c')]['includeAll']){_0x3860fe[_0x4d63('0x3c')]=[{'all':!![]}];}return db[_0x4d63('0x27')][_0x4d63('0x3d')](_0x3860fe);})[_0x4d63('0x1f')](function(_0x57ab7d){_0x1b48bd[_0x4d63('0x3e')]=_0x57ab7d;return _0x1b48bd;})['then'](respondWithFilteredResult(_0x6fcc4c,_0x3860fe))[_0x4d63('0x3f')](handleError(_0x6fcc4c,null));};exports[_0x4d63('0x40')]=function(_0x2ec761,_0x482045){var _0x31f7fd={'raw':!![],'where':{'id':_0x2ec761[_0x4d63('0x41')]['id']}},_0x5a53ea={};_0x5a53ea[_0x4d63('0x2b')]=_[_0x4d63('0x2d')](db[_0x4d63('0x27')][_0x4d63('0x42')]);_0x5a53ea[_0x4d63('0x2c')]=_['keys'](_0x2ec761[_0x4d63('0x2c')]);_0x5a53ea[_0x4d63('0x2e')]=_[_0x4d63('0x2f')](_0x5a53ea['model'],_0x5a53ea[_0x4d63('0x2c')]);_0x31f7fd[_0x4d63('0x30')]=_[_0x4d63('0x2f')](_0x5a53ea[_0x4d63('0x2b')],qs[_0x4d63('0x31')](_0x2ec761[_0x4d63('0x2c')]['fields']));_0x31f7fd[_0x4d63('0x30')]=_0x31f7fd[_0x4d63('0x30')][_0x4d63('0x43')]?_0x31f7fd[_0x4d63('0x30')]:_0x5a53ea[_0x4d63('0x2b')];if(_0x2ec761[_0x4d63('0x2c')][_0x4d63('0x44')]){_0x31f7fd['include']=[{'all':!![]}];}_0x31f7fd=_[_0x4d63('0x3a')]({},_0x31f7fd,_0x2ec761['options']);return db['JscriptyAnswerReport'][_0x4d63('0x45')](_0x31f7fd)['then'](handleEntityNotFound(_0x482045,null))[_0x4d63('0x1f')](respondWithResult(_0x482045,null))[_0x4d63('0x3f')](handleError(_0x482045,null));};exports[_0x4d63('0x46')]=function(_0xe9a417,_0x58d946){return db[_0x4d63('0x27')][_0x4d63('0x46')](_0xe9a417[_0x4d63('0x47')],{})[_0x4d63('0x1f')](respondWithResult(_0x58d946,0xc9))[_0x4d63('0x3f')](handleError(_0x58d946,null));};exports[_0x4d63('0x1d')]=function(_0x1b74e9,_0x282424){if(_0x1b74e9[_0x4d63('0x47')]['id']){delete _0x1b74e9[_0x4d63('0x47')]['id'];}return db[_0x4d63('0x27')][_0x4d63('0x45')]({'where':{'id':_0x1b74e9[_0x4d63('0x41')]['id']}})['then'](handleEntityNotFound(_0x282424,null))[_0x4d63('0x1f')](saveUpdates(_0x1b74e9[_0x4d63('0x47')],null))['then'](respondWithResult(_0x282424,null))['catch'](handleError(_0x282424,null));};exports[_0x4d63('0x1e')]=function(_0x5a9553,_0xd318b0){return db[_0x4d63('0x27')][_0x4d63('0x45')]({'where':{'id':_0x5a9553['params']['id']}})[_0x4d63('0x1f')](handleEntityNotFound(_0xd318b0,null))['then'](removeEntity(_0xd318b0,null))[_0x4d63('0x3f')](handleError(_0xd318b0,null));};exports['describe']=function(_0xffd6f1,_0x107b69){return db[_0x4d63('0x27')][_0x4d63('0x48')]()['then'](respondWithResult(_0x107b69,null))[_0x4d63('0x3f')](handleError(_0x107b69,null));}; \ No newline at end of file +var _0x044a=['describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','limit','count','offset','set','apply','reject','update','then','stack','name','index','map','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','JscriptyAnswerReport','includeAll','include','findAll','rows','catch','show','rawAttributes','keys','options','find','create','body','params','destroy'];(function(_0x52966e,_0x529901){var _0xc948f3=function(_0xa51438){while(--_0xa51438){_0x52966e['push'](_0x52966e['shift']());}};_0xc948f3(++_0x529901);}(_0x044a,0x173));var _0xa044=function(_0x252d5c,_0x453602){_0x252d5c=_0x252d5c-0x0;var _0x5bd321=_0x044a[_0x252d5c];return _0x5bd321;};'use strict';var emlformat=require(_0xa044('0x0'));var rimraf=require(_0xa044('0x1'));var zipdir=require(_0xa044('0x2'));var jsonpatch=require(_0xa044('0x3'));var rp=require(_0xa044('0x4'));var moment=require(_0xa044('0x5'));var BPromise=require(_0xa044('0x6'));var Mustache=require(_0xa044('0x7'));var util=require(_0xa044('0x8'));var path=require(_0xa044('0x9'));var sox=require('sox');var csv=require(_0xa044('0xa'));var ejs=require(_0xa044('0xb'));var fs=require('fs');var fs_extra=require(_0xa044('0xc'));var _=require(_0xa044('0xd'));var squel=require('squel');var crypto=require(_0xa044('0xe'));var jsforce=require(_0xa044('0xf'));var deskjs=require(_0xa044('0x10'));var toCsv=require(_0xa044('0xa'));var querystring=require('querystring');var Papa=require(_0xa044('0x11'));var Redis=require(_0xa044('0x12'));var authService=require(_0xa044('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa044('0x14'));var hardwareService=require(_0xa044('0x15'));var logger=require(_0xa044('0x16'))(_0xa044('0x17'));var utils=require('../../config/utils');var config=require(_0xa044('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ee43,_0x3e05cf){_0x3e05cf=_0x3e05cf||0xcc;return function(_0x2b73a1){if(_0x2b73a1){return _0x1ee43[_0xa044('0x19')](_0x3e05cf);}return _0x1ee43[_0xa044('0x1a')](_0x3e05cf)[_0xa044('0x1b')]();};}function respondWithResult(_0xe9a838,_0x4bec52){_0x4bec52=_0x4bec52||0xc8;return function(_0x31c5ae){if(_0x31c5ae){return _0xe9a838['status'](_0x4bec52)[_0xa044('0x1c')](_0x31c5ae);}};}function respondWithFilteredResult(_0x44c658,_0x141d1a){return function(_0x3bc2c9){if(_0x3bc2c9){var _0xeb7e4e=typeof _0x141d1a['offset']==='undefined'&&typeof _0x141d1a[_0xa044('0x1d')]==='undefined';var _0x3ca144=_0x3bc2c9[_0xa044('0x1e')];var _0x1b43c1=_0xeb7e4e?0x0:_0x141d1a[_0xa044('0x1f')];var _0x3ccbd3=_0xeb7e4e?_0x3bc2c9['count']:_0x141d1a['offset']+_0x141d1a['limit'];var _0x39422b;if(_0x3ccbd3>=_0x3ca144){_0x3ccbd3=_0x3ca144;_0x39422b=0xc8;}else{_0x39422b=0xce;}_0x44c658[_0xa044('0x1a')](_0x39422b);return _0x44c658[_0xa044('0x20')]('Content-Range',_0x1b43c1+'-'+_0x3ccbd3+'/'+_0x3ca144)[_0xa044('0x1c')](_0x3bc2c9);}return null;};}function patchUpdates(_0x19854d){return function(_0x4e0202){try{jsonpatch[_0xa044('0x21')](_0x4e0202,_0x19854d,!![]);}catch(_0x40999a){return BPromise[_0xa044('0x22')](_0x40999a);}return _0x4e0202['save']();};}function saveUpdates(_0x2e3468,_0x966548){return function(_0x26747b){if(_0x26747b){return _0x26747b[_0xa044('0x23')](_0x2e3468)[_0xa044('0x24')](function(_0x3f4d03){return _0x3f4d03;});}return null;};}function removeEntity(_0x18af4c,_0x46f14c){return function(_0x36c237){if(_0x36c237){return _0x36c237['destroy']()['then'](function(){_0x18af4c[_0xa044('0x1a')](0xcc)[_0xa044('0x1b')]();});}};}function handleEntityNotFound(_0x228d5e,_0x4c3d4b){return function(_0x418756){if(!_0x418756){_0x228d5e[_0xa044('0x19')](0x194);}return _0x418756;};}function handleError(_0x4e9357,_0x38bdd7){_0x38bdd7=_0x38bdd7||0x1f4;return function(_0x6746e8){logger['error'](_0x6746e8[_0xa044('0x25')]);if(_0x6746e8[_0xa044('0x26')]){delete _0x6746e8['name'];}_0x4e9357['status'](_0x38bdd7)['send'](_0x6746e8);};}exports[_0xa044('0x27')]=function(_0x159519,_0x1362ef){var _0x4c72f3={},_0x267512={},_0x300b6e={'count':0x0,'rows':[]};var _0x485212=_[_0xa044('0x28')](db['JscriptyAnswerReport']['rawAttributes'],function(_0x1cb1be){return{'name':_0x1cb1be['fieldName'],'type':_0x1cb1be[_0xa044('0x29')][_0xa044('0x2a')]};});_0x267512[_0xa044('0x2b')]=_[_0xa044('0x28')](_0x485212,_0xa044('0x26'));_0x267512[_0xa044('0x2c')]=_['keys'](_0x159519[_0xa044('0x2c')]);_0x267512[_0xa044('0x2d')]=_[_0xa044('0x2e')](_0x267512[_0xa044('0x2b')],_0x267512['query']);_0x4c72f3[_0xa044('0x2f')]=_[_0xa044('0x2e')](_0x267512['model'],qs['fields'](_0x159519[_0xa044('0x2c')][_0xa044('0x30')]));_0x4c72f3['attributes']=_0x4c72f3[_0xa044('0x2f')][_0xa044('0x31')]?_0x4c72f3[_0xa044('0x2f')]:_0x267512['model'];if(!_0x159519[_0xa044('0x2c')][_0xa044('0x32')](_0xa044('0x33'))){_0x4c72f3[_0xa044('0x1d')]=qs[_0xa044('0x1d')](_0x159519['query'][_0xa044('0x1d')]);_0x4c72f3[_0xa044('0x1f')]=qs[_0xa044('0x1f')](_0x159519['query'][_0xa044('0x1f')]);}_0x4c72f3[_0xa044('0x34')]=qs['sort'](_0x159519[_0xa044('0x2c')][_0xa044('0x35')]);_0x4c72f3[_0xa044('0x36')]=qs[_0xa044('0x2d')](_[_0xa044('0x37')](_0x159519[_0xa044('0x2c')],_0x267512[_0xa044('0x2d')]),_0x485212);if(_0x159519[_0xa044('0x2c')]['filter']){_0x4c72f3[_0xa044('0x36')]=_[_0xa044('0x38')](_0x4c72f3[_0xa044('0x36')],{'$or':_[_0xa044('0x28')](_0x485212,function(_0x20509c){if(_0x20509c['type']!==_0xa044('0x39')){var _0x529be2={};_0x529be2[_0x20509c[_0xa044('0x26')]]={'$like':'%'+_0x159519[_0xa044('0x2c')]['filter']+'%'};return _0x529be2;}})});}_0x4c72f3=_['merge']({},_0x4c72f3,_0x159519['options']);var _0x22386d={'where':_0x4c72f3[_0xa044('0x36')]};return db[_0xa044('0x3a')][_0xa044('0x1e')](_0x22386d)[_0xa044('0x24')](function(_0x73aa8b){_0x300b6e[_0xa044('0x1e')]=_0x73aa8b;if(_0x159519[_0xa044('0x2c')][_0xa044('0x3b')]){_0x4c72f3[_0xa044('0x3c')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0xa044('0x3d')](_0x4c72f3);})[_0xa044('0x24')](function(_0x1e84c1){_0x300b6e[_0xa044('0x3e')]=_0x1e84c1;return _0x300b6e;})[_0xa044('0x24')](respondWithFilteredResult(_0x1362ef,_0x4c72f3))[_0xa044('0x3f')](handleError(_0x1362ef,null));};exports[_0xa044('0x40')]=function(_0xc9246f,_0x2863a5){var _0x1f1c35={'raw':!![],'where':{'id':_0xc9246f['params']['id']}},_0x4b9cf6={};_0x4b9cf6[_0xa044('0x2b')]=_['keys'](db[_0xa044('0x3a')][_0xa044('0x41')]);_0x4b9cf6[_0xa044('0x2c')]=_[_0xa044('0x42')](_0xc9246f[_0xa044('0x2c')]);_0x4b9cf6[_0xa044('0x2d')]=_['intersection'](_0x4b9cf6[_0xa044('0x2b')],_0x4b9cf6['query']);_0x1f1c35[_0xa044('0x2f')]=_[_0xa044('0x2e')](_0x4b9cf6[_0xa044('0x2b')],qs['fields'](_0xc9246f['query'][_0xa044('0x30')]));_0x1f1c35[_0xa044('0x2f')]=_0x1f1c35[_0xa044('0x2f')][_0xa044('0x31')]?_0x1f1c35[_0xa044('0x2f')]:_0x4b9cf6[_0xa044('0x2b')];if(_0xc9246f['query'][_0xa044('0x3b')]){_0x1f1c35[_0xa044('0x3c')]=[{'all':!![]}];}_0x1f1c35=_[_0xa044('0x38')]({},_0x1f1c35,_0xc9246f[_0xa044('0x43')]);return db[_0xa044('0x3a')][_0xa044('0x44')](_0x1f1c35)[_0xa044('0x24')](handleEntityNotFound(_0x2863a5,null))[_0xa044('0x24')](respondWithResult(_0x2863a5,null))[_0xa044('0x3f')](handleError(_0x2863a5,null));};exports[_0xa044('0x45')]=function(_0x13e4e3,_0x3d303a){return db[_0xa044('0x3a')]['create'](_0x13e4e3[_0xa044('0x46')],{})[_0xa044('0x24')](respondWithResult(_0x3d303a,0xc9))[_0xa044('0x3f')](handleError(_0x3d303a,null));};exports[_0xa044('0x23')]=function(_0x6bf8a0,_0x230ecf){if(_0x6bf8a0[_0xa044('0x46')]['id']){delete _0x6bf8a0['body']['id'];}return db['JscriptyAnswerReport'][_0xa044('0x44')]({'where':{'id':_0x6bf8a0[_0xa044('0x47')]['id']}})[_0xa044('0x24')](handleEntityNotFound(_0x230ecf,null))[_0xa044('0x24')](saveUpdates(_0x6bf8a0['body'],null))[_0xa044('0x24')](respondWithResult(_0x230ecf,null))[_0xa044('0x3f')](handleError(_0x230ecf,null));};exports[_0xa044('0x48')]=function(_0x390d24,_0x1b7877){return db[_0xa044('0x3a')]['find']({'where':{'id':_0x390d24[_0xa044('0x47')]['id']}})['then'](handleEntityNotFound(_0x1b7877,null))['then'](removeEntity(_0x1b7877,null))[_0xa044('0x3f')](handleError(_0x1b7877,null));};exports[_0xa044('0x49')]=function(_0x3ea870,_0x187ebd){return db['JscriptyAnswerReport']['describe']()['then'](respondWithResult(_0x187ebd,null))[_0xa044('0x3f')](handleError(_0x187ebd,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 0f9b359..c431847 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 _0x4bdb=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./jscriptyAnswerReport.attributes','define','JscriptyAnswerReport','report_jscripty_answers'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4bdb,0x108));var _0xb4bd=function(_0x32479e,_0x581954){_0x32479e=_0x32479e-0x0;var _0x34ff95=_0x4bdb[_0x32479e];return _0x34ff95;};'use strict';var _=require(_0xb4bd('0x0'));var util=require(_0xb4bd('0x1'));var logger=require(_0xb4bd('0x2'))(_0xb4bd('0x3'));var moment=require(_0xb4bd('0x4'));var BPromise=require(_0xb4bd('0x5'));var rp=require(_0xb4bd('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb4bd('0x7'));var config=require('../../config/environment');var attributes=require(_0xb4bd('0x8'));module['exports']=function(_0x518669,_0x45e2c2){return _0x518669[_0xb4bd('0x9')](_0xb4bd('0xa'),attributes,{'tableName':_0xb4bd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb8b5=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','lodash','util'];(function(_0x5c4297,_0xab577b){var _0x7d19bd=function(_0x4d046a){while(--_0x4d046a){_0x5c4297['push'](_0x5c4297['shift']());}};_0x7d19bd(++_0xab577b);}(_0xb8b5,0xee));var _0x5b8b=function(_0x4f18dd,_0x1f0c8d){_0x4f18dd=_0x4f18dd-0x0;var _0x13c2bc=_0xb8b5[_0x4f18dd];return _0x13c2bc;};'use strict';var _=require(_0x5b8b('0x0'));var util=require(_0x5b8b('0x1'));var logger=require(_0x5b8b('0x2'))('api');var moment=require(_0x5b8b('0x3'));var BPromise=require(_0x5b8b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5b8b('0x5'));var rimraf=require(_0x5b8b('0x6'));var config=require(_0x5b8b('0x7'));var attributes=require(_0x5b8b('0x8'));module[_0x5b8b('0x9')]=function(_0x46be30,_0x432fbb){return _0x46be30[_0x5b8b('0xa')](_0x5b8b('0xb'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index c35b8db..063a2e7 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 _0x8dfb=['../../config/environment','client','http','request','info','JscriptyAnswerReport,\x20%s,\x20%s','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x356e8d,_0x24c719){var _0x39e65a=function(_0x27ecc2){while(--_0x27ecc2){_0x356e8d['push'](_0x356e8d['shift']());}};_0x39e65a(++_0x24c719);}(_0x8dfb,0x189));var _0xb8df=function(_0x3a10b6,_0x3181f0){_0x3a10b6=_0x3a10b6-0x0;var _0x463dc3=_0x8dfb[_0x3a10b6];return _0x463dc3;};'use strict';var _=require(_0xb8df('0x0'));var util=require('util');var moment=require(_0xb8df('0x1'));var BPromise=require('bluebird');var rs=require(_0xb8df('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb8df('0x3'))['db'];var utils=require(_0xb8df('0x4'));var logger=require(_0xb8df('0x5'))('rpc');var config=require(_0xb8df('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xb8df('0x7')][_0xb8df('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x236a75,_0x2d79e0,_0x3a2487){return new BPromise(function(_0x2294e9,_0x11d4b6){return client[_0xb8df('0x9')](_0x236a75,_0x3a2487)['then'](function(_0x37c9b8){logger[_0xb8df('0xa')](_0xb8df('0xb'),_0x2d79e0,'request\x20sent');logger[_0xb8df('0xc')](_0xb8df('0xd'),_0x2d79e0,'request\x20sent',JSON[_0xb8df('0xe')](_0x37c9b8));if(_0x37c9b8[_0xb8df('0xf')]){if(_0x37c9b8['error'][_0xb8df('0x10')]===0x1f4){logger[_0xb8df('0xf')](_0xb8df('0xb'),_0x2d79e0,_0x37c9b8[_0xb8df('0xf')][_0xb8df('0x11')]);return _0x11d4b6(_0x37c9b8['error'][_0xb8df('0x11')]);}logger[_0xb8df('0xf')](_0xb8df('0xb'),_0x2d79e0,_0x37c9b8['error'][_0xb8df('0x11')]);return _0x2294e9(_0x37c9b8['error'][_0xb8df('0x11')]);}else{logger[_0xb8df('0xa')](_0xb8df('0xb'),_0x2d79e0,_0xb8df('0x12'));_0x2294e9(_0x37c9b8['result'][_0xb8df('0x11')]);}})['catch'](function(_0x3ef3fe){logger['error'](_0xb8df('0xb'),_0x2d79e0,_0x3ef3fe);_0x11d4b6(_0x3ef3fe);});});} \ No newline at end of file +var _0x6f4c=['http','request','then','info','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','JscriptyAnswerReport,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x6f4c,0x1f0));var _0xc6f4=function(_0x1a1a1a,_0x606b90){_0x1a1a1a=_0x1a1a1a-0x0;var _0x57cc4a=_0x6f4c[_0x1a1a1a];return _0x57cc4a;};'use strict';var _=require(_0xc6f4('0x0'));var util=require('util');var moment=require(_0xc6f4('0x1'));var BPromise=require('bluebird');var rs=require(_0xc6f4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc6f4('0x3'))['db'];var utils=require(_0xc6f4('0x4'));var logger=require(_0xc6f4('0x5'))(_0xc6f4('0x6'));var config=require(_0xc6f4('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc6f4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c0b9a,_0x30c144,_0x5c10d9){return new BPromise(function(_0x3634ae,_0x2b3763){return client[_0xc6f4('0x9')](_0x3c0b9a,_0x5c10d9)[_0xc6f4('0xa')](function(_0x216d1b){logger[_0xc6f4('0xb')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x30c144,_0xc6f4('0xc'));logger[_0xc6f4('0xd')](_0xc6f4('0xe'),_0x30c144,_0xc6f4('0xc'),JSON[_0xc6f4('0xf')](_0x216d1b));if(_0x216d1b['error']){if(_0x216d1b[_0xc6f4('0x10')]['code']===0x1f4){logger[_0xc6f4('0x10')](_0xc6f4('0x11'),_0x30c144,_0x216d1b[_0xc6f4('0x10')][_0xc6f4('0x12')]);return _0x2b3763(_0x216d1b[_0xc6f4('0x10')][_0xc6f4('0x12')]);}logger[_0xc6f4('0x10')](_0xc6f4('0x11'),_0x30c144,_0x216d1b[_0xc6f4('0x10')][_0xc6f4('0x12')]);return _0x3634ae(_0x216d1b[_0xc6f4('0x10')][_0xc6f4('0x12')]);}else{logger[_0xc6f4('0xb')](_0xc6f4('0x11'),_0x30c144,'request\x20sent');_0x3634ae(_0x216d1b[_0xc6f4('0x13')][_0xc6f4('0x12')]);}})[_0xc6f4('0x14')](function(_0x13c59a){logger[_0xc6f4('0x10')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x30c144,_0x13c59a);_0x2b3763(_0x13c59a);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index a8ce9ca..e419eb8 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 _0xf29a=['../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','/:id','show','/:id/sessions','getSessions','/:id/answers','/:id/summary','30s','getSummary','post','create','/:id/clone','clone','put','update','delete','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x26da89,_0x264785){var _0xc95b7b=function(_0x230e5b){while(--_0x230e5b){_0x26da89['push'](_0x26da89['shift']());}};_0xc95b7b(++_0x264785);}(_0xf29a,0x109));var _0xaf29=function(_0xe19ad4,_0x37db41){_0xe19ad4=_0xe19ad4-0x0;var _0x439b24=_0xf29a[_0xe19ad4];return _0x439b24;};'use strict';var multer=require(_0xaf29('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xaf29('0x1'));var express=require(_0xaf29('0x2'));var router=express['Router']();var fs_extra=require(_0xaf29('0x3'));var auth=require(_0xaf29('0x4'));var interaction=require(_0xaf29('0x5'));var config=require(_0xaf29('0x6'));var controller=require(_0xaf29('0x7'));router[_0xaf29('0x8')]('/',auth[_0xaf29('0x9')](),controller[_0xaf29('0xa')]);router[_0xaf29('0x8')](_0xaf29('0xb'),auth[_0xaf29('0x9')](),controller[_0xaf29('0xc')]);router[_0xaf29('0x8')](_0xaf29('0xd'),auth[_0xaf29('0x9')](),controller[_0xaf29('0xe')]);router[_0xaf29('0x8')](_0xaf29('0xf'),auth[_0xaf29('0x9')](),controller['getAnswers']);router[_0xaf29('0x8')](_0xaf29('0x10'),auth[_0xaf29('0x9')](),timeout(_0xaf29('0x11')),controller[_0xaf29('0x12')]);router[_0xaf29('0x13')]('/',auth[_0xaf29('0x9')](),controller[_0xaf29('0x14')]);router['post'](_0xaf29('0x15'),auth[_0xaf29('0x9')](),controller[_0xaf29('0x16')]);router[_0xaf29('0x17')](_0xaf29('0xb'),auth[_0xaf29('0x9')](),controller[_0xaf29('0x18')]);router[_0xaf29('0x19')](_0xaf29('0xb'),auth[_0xaf29('0x9')](),controller['destroy']);module[_0xaf29('0x1a')]=router; \ No newline at end of file +var _0x611b=['../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','/:id','show','getSessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary','post','create','/:id/clone','put','update','delete','destroy','util','path','connect-timeout','Router','fs-extra'];(function(_0x2e6f0f,_0x21a10c){var _0x13c137=function(_0x4c4274){while(--_0x4c4274){_0x2e6f0f['push'](_0x2e6f0f['shift']());}};_0x13c137(++_0x21a10c);}(_0x611b,0x175));var _0xb611=function(_0x1e643a,_0x252f5c){_0x1e643a=_0x1e643a-0x0;var _0x47bb38=_0x611b[_0x1e643a];return _0x47bb38;};'use strict';var multer=require('multer');var util=require(_0xb611('0x0'));var path=require(_0xb611('0x1'));var timeout=require(_0xb611('0x2'));var express=require('express');var router=express[_0xb611('0x3')]();var fs_extra=require(_0xb611('0x4'));var auth=require(_0xb611('0x5'));var interaction=require(_0xb611('0x6'));var config=require(_0xb611('0x7'));var controller=require(_0xb611('0x8'));router[_0xb611('0x9')]('/',auth[_0xb611('0xa')](),controller[_0xb611('0xb')]);router[_0xb611('0x9')](_0xb611('0xc'),auth[_0xb611('0xa')](),controller[_0xb611('0xd')]);router[_0xb611('0x9')]('/:id/sessions',auth[_0xb611('0xa')](),controller[_0xb611('0xe')]);router[_0xb611('0x9')](_0xb611('0xf'),auth[_0xb611('0xa')](),controller[_0xb611('0x10')]);router[_0xb611('0x9')](_0xb611('0x11'),auth[_0xb611('0xa')](),timeout(_0xb611('0x12')),controller[_0xb611('0x13')]);router[_0xb611('0x14')]('/',auth['isAuthenticated'](),controller[_0xb611('0x15')]);router['post'](_0xb611('0x16'),auth['isAuthenticated'](),controller['clone']);router[_0xb611('0x17')](_0xb611('0xc'),auth[_0xb611('0xa')](),controller[_0xb611('0x18')]);router[_0xb611('0x19')](_0xb611('0xc'),auth[_0xb611('0xa')](),controller[_0xb611('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 4d9edf1..7c8a889 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 _0x0919=['util','exports','name','STRING','TEXT','long','isObjectLike','setDataValue','formData','stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','BOOLEAN','sequelize','lodash'];(function(_0x1fb142,_0x45e60a){var _0x314625=function(_0x1d5554){while(--_0x1d5554){_0x1fb142['push'](_0x1fb142['shift']());}};_0x314625(++_0x45e60a);}(_0x0919,0x64));var _0x9091=function(_0x40e00e,_0xe3ddfa){_0x40e00e=_0x40e00e-0x0;var _0x1050de=_0x0919[_0x40e00e];return _0x1050de;};'use strict';var Sequelize=require(_0x9091('0x0'));var _=require(_0x9091('0x1'));var util=require(_0x9091('0x2'));module[_0x9091('0x3')]={'name':{'type':Sequelize['STRING'],'unique':_0x9091('0x4')},'description':{'type':Sequelize[_0x9091('0x5')]},'formData':{'type':Sequelize[_0x9091('0x6')](_0x9091('0x7')),'set':function(_0x46ef4b){if(_[_0x9091('0x8')](_0x46ef4b)){this[_0x9091('0x9')](_0x9091('0xa'),JSON[_0x9091('0xb')](_0x46ef4b));}else if(_[_0x9091('0xc')](_0x46ef4b)){this[_0x9091('0x9')](_0x9091('0xa'),_0x46ef4b);}else{this[_0x9091('0x9')]('formData',util[_0x9091('0xd')](_0x9091('0xe'),this[_0x9091('0xf')](_0x9091('0x4'))||'',this[_0x9091('0xf')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x9091('0x10')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x9091('0x10')],'defaultValue':![]}}; \ No newline at end of file +var _0x7b80=['{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','BOOLEAN','sequelize','lodash','util','STRING','name','long','isObjectLike','setDataValue','formData','stringify','isString','format'];(function(_0x28874a,_0x5e61ac){var _0x4f7b0d=function(_0x17899e){while(--_0x17899e){_0x28874a['push'](_0x28874a['shift']());}};_0x4f7b0d(++_0x5e61ac);}(_0x7b80,0x1b6));var _0x07b8=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x7b80[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0x07b8('0x0'));var _=require(_0x07b8('0x1'));var util=require(_0x07b8('0x2'));module['exports']={'name':{'type':Sequelize[_0x07b8('0x3')],'unique':_0x07b8('0x4')},'description':{'type':Sequelize[_0x07b8('0x3')]},'formData':{'type':Sequelize['TEXT'](_0x07b8('0x5')),'set':function(_0x40fd4){if(_[_0x07b8('0x6')](_0x40fd4)){this[_0x07b8('0x7')](_0x07b8('0x8'),JSON[_0x07b8('0x9')](_0x40fd4));}else if(_[_0x07b8('0xa')](_0x40fd4)){this[_0x07b8('0x7')](_0x07b8('0x8'),_0x40fd4);}else{this[_0x07b8('0x7')](_0x07b8('0x8'),util[_0x07b8('0xb')](_0x07b8('0xc'),this[_0x07b8('0xd')](_0x07b8('0x4'))||'',this['getDataValue']('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x07b8('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x07b8('0xe')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 4896bd5..4091b9f 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 _0xf7d2=['desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','undefined','limit','offset','set','Content-Range','apply','reject','update','then','destroy','get','Projects','UserProfileResource','sendStatus','stack','name','map','JscriptyProject','rawAttributes','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','catch','params','keys','find','create','body','user','role','UserProfileSection','userProfileId','error','clone','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getSessions','JscriptySessionReport','order','ProjectId','getAnswers','JscriptyAnswerReport','fromCharCode','toString','indexOf','startTime','starttime','parse','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','/tmp/Jscripty_Project_%d_Summary_%s.csv','eml-format','rimraf','zip-dir','request-promise','moment','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce'];(function(_0xbebf50,_0x44ec09){var _0xce1496=function(_0x1bf94d){while(--_0x1bf94d){_0xbebf50['push'](_0xbebf50['shift']());}};_0xce1496(++_0x44ec09);}(_0xf7d2,0x149));var _0x2f7d=function(_0x43c936,_0x251517){_0x43c936=_0x43c936-0x0;var _0x418012=_0xf7d2[_0x43c936];return _0x418012;};'use strict';var emlformat=require(_0x2f7d('0x0'));var rimraf=require(_0x2f7d('0x1'));var zipdir=require(_0x2f7d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2f7d('0x3'));var moment=require(_0x2f7d('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x2f7d('0x5'));var sox=require(_0x2f7d('0x6'));var csv=require(_0x2f7d('0x7'));var ejs=require(_0x2f7d('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2f7d('0x9'));var squel=require(_0x2f7d('0xa'));var crypto=require(_0x2f7d('0xb'));var jsforce=require(_0x2f7d('0xc'));var deskjs=require(_0x2f7d('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2f7d('0xe'));var Redis=require(_0x2f7d('0xf'));var authService=require(_0x2f7d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x2f7d('0x11'));var hardwareService=require(_0x2f7d('0x12'));var logger=require(_0x2f7d('0x13'))(_0x2f7d('0x14'));var utils=require(_0x2f7d('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2f7d('0x16'))['db'];function respondWithStatusCode(_0x18a3c2,_0x438d5b){_0x438d5b=_0x438d5b||0xcc;return function(_0x5ac5a4){if(_0x5ac5a4){return _0x18a3c2['sendStatus'](_0x438d5b);}return _0x18a3c2[_0x2f7d('0x17')](_0x438d5b)[_0x2f7d('0x18')]();};}function respondWithResult(_0xfb3a82,_0x5a0e26){_0x5a0e26=_0x5a0e26||0xc8;return function(_0x81e92b){if(_0x81e92b){return _0xfb3a82['status'](_0x5a0e26)[_0x2f7d('0x19')](_0x81e92b);}};}function respondWithFilteredResult(_0x315ff3,_0x11e1aa){return function(_0x1dfa24){if(_0x1dfa24){var _0x5c3ced=typeof _0x11e1aa['offset']===_0x2f7d('0x1a')&&typeof _0x11e1aa[_0x2f7d('0x1b')]==='undefined';var _0x21e723=_0x1dfa24['count'];var _0x3a9349=_0x5c3ced?0x0:_0x11e1aa['offset'];var _0x552cc9=_0x5c3ced?_0x1dfa24['count']:_0x11e1aa[_0x2f7d('0x1c')]+_0x11e1aa[_0x2f7d('0x1b')];var _0x4ac70e;if(_0x552cc9>=_0x21e723){_0x552cc9=_0x21e723;_0x4ac70e=0xc8;}else{_0x4ac70e=0xce;}_0x315ff3[_0x2f7d('0x17')](_0x4ac70e);return _0x315ff3[_0x2f7d('0x1d')](_0x2f7d('0x1e'),_0x3a9349+'-'+_0x552cc9+'/'+_0x21e723)[_0x2f7d('0x19')](_0x1dfa24);}return null;};}function patchUpdates(_0x12c2a9){return function(_0xaa66c0){try{jsonpatch[_0x2f7d('0x1f')](_0xaa66c0,_0x12c2a9,!![]);}catch(_0x27dad7){return BPromise[_0x2f7d('0x20')](_0x27dad7);}return _0xaa66c0['save']();};}function saveUpdates(_0x217987,_0x947ac4){return function(_0x297a59){if(_0x297a59){return _0x297a59[_0x2f7d('0x21')](_0x217987)[_0x2f7d('0x22')](function(_0x59e97f){return _0x59e97f;});}return null;};}function removeEntity(_0x27a60c,_0x2be8eb){return function(_0x83c7d1){if(_0x83c7d1){return _0x83c7d1[_0x2f7d('0x23')]()[_0x2f7d('0x22')](function(){var _0x7fece1=_0x83c7d1[_0x2f7d('0x24')]({'plain':!![]});var _0x51971e=_0x2f7d('0x25');return db[_0x2f7d('0x26')][_0x2f7d('0x23')]({'where':{'type':_0x51971e,'resourceId':_0x7fece1['id']}})[_0x2f7d('0x22')](function(){return _0x83c7d1;});})['then'](function(){_0x27a60c[_0x2f7d('0x17')](0xcc)[_0x2f7d('0x18')]();});}};}function handleEntityNotFound(_0x47ebb7,_0x59d257){return function(_0x5af504){if(!_0x5af504){_0x47ebb7[_0x2f7d('0x27')](0x194);}return _0x5af504;};}function handleError(_0x17eccd,_0x5068c0){_0x5068c0=_0x5068c0||0x1f4;return function(_0x3fe2a8){logger['error'](_0x3fe2a8[_0x2f7d('0x28')]);if(_0x3fe2a8[_0x2f7d('0x29')]){delete _0x3fe2a8[_0x2f7d('0x29')];}_0x17eccd['status'](_0x5068c0)['send'](_0x3fe2a8);};}exports['index']=function(_0x31e18a,_0x416c33){var _0x18ec7f={},_0x2b527d={},_0x1485ca={'count':0x0,'rows':[]};var _0x2984ca=_[_0x2f7d('0x2a')](db[_0x2f7d('0x2b')][_0x2f7d('0x2c')],function(_0x14f8e9){return{'name':_0x14f8e9['fieldName'],'type':_0x14f8e9[_0x2f7d('0x2d')][_0x2f7d('0x2e')]};});_0x2b527d[_0x2f7d('0x2f')]=_['map'](_0x2984ca,'name');_0x2b527d[_0x2f7d('0x30')]=_['keys'](_0x31e18a[_0x2f7d('0x30')]);_0x2b527d['filters']=_['intersection'](_0x2b527d['model'],_0x2b527d['query']);_0x18ec7f[_0x2f7d('0x31')]=_[_0x2f7d('0x32')](_0x2b527d[_0x2f7d('0x2f')],qs['fields'](_0x31e18a[_0x2f7d('0x30')][_0x2f7d('0x33')]));_0x18ec7f[_0x2f7d('0x31')]=_0x18ec7f[_0x2f7d('0x31')][_0x2f7d('0x34')]?_0x18ec7f['attributes']:_0x2b527d[_0x2f7d('0x2f')];if(!_0x31e18a[_0x2f7d('0x30')][_0x2f7d('0x35')](_0x2f7d('0x36'))){_0x18ec7f['limit']=qs[_0x2f7d('0x1b')](_0x31e18a[_0x2f7d('0x30')][_0x2f7d('0x1b')]);_0x18ec7f[_0x2f7d('0x1c')]=qs[_0x2f7d('0x1c')](_0x31e18a[_0x2f7d('0x30')][_0x2f7d('0x1c')]);}_0x18ec7f['order']=qs[_0x2f7d('0x37')](_0x31e18a[_0x2f7d('0x30')][_0x2f7d('0x37')]);_0x18ec7f[_0x2f7d('0x38')]=qs[_0x2f7d('0x39')](_[_0x2f7d('0x3a')](_0x31e18a[_0x2f7d('0x30')],_0x2b527d['filters']),_0x2984ca);if(_0x31e18a[_0x2f7d('0x30')][_0x2f7d('0x3b')]){_0x18ec7f[_0x2f7d('0x38')]=_['merge'](_0x18ec7f[_0x2f7d('0x38')],{'$or':_[_0x2f7d('0x2a')](_0x2984ca,function(_0x1a9fda){if(_0x1a9fda[_0x2f7d('0x2d')]!==_0x2f7d('0x3c')){var _0xd691bd={};_0xd691bd[_0x1a9fda[_0x2f7d('0x29')]]={'$like':'%'+_0x31e18a[_0x2f7d('0x30')]['filter']+'%'};return _0xd691bd;}})});}_0x18ec7f=_[_0x2f7d('0x3d')]({},_0x18ec7f,_0x31e18a[_0x2f7d('0x3e')]);var _0x19d654={'where':_0x18ec7f[_0x2f7d('0x38')]};return db[_0x2f7d('0x2b')][_0x2f7d('0x3f')](_0x19d654)['then'](function(_0x1b0076){_0x1485ca[_0x2f7d('0x3f')]=_0x1b0076;if(_0x31e18a['query'][_0x2f7d('0x40')]){_0x18ec7f[_0x2f7d('0x41')]=[{'all':!![]}];}return db[_0x2f7d('0x2b')][_0x2f7d('0x42')](_0x18ec7f);})[_0x2f7d('0x22')](function(_0x5e0ea9){_0x1485ca[_0x2f7d('0x43')]=_0x5e0ea9;return _0x1485ca;})['then'](respondWithFilteredResult(_0x416c33,_0x18ec7f))[_0x2f7d('0x44')](handleError(_0x416c33,null));};exports['show']=function(_0x13443a,_0x833fc4){var _0x59296c={'raw':![],'where':{'id':_0x13443a[_0x2f7d('0x45')]['id']}},_0x3a01bf={};_0x3a01bf[_0x2f7d('0x2f')]=_['keys'](db[_0x2f7d('0x2b')][_0x2f7d('0x2c')]);_0x3a01bf[_0x2f7d('0x30')]=_[_0x2f7d('0x46')](_0x13443a[_0x2f7d('0x30')]);_0x3a01bf['filters']=_['intersection'](_0x3a01bf[_0x2f7d('0x2f')],_0x3a01bf['query']);_0x59296c['attributes']=_[_0x2f7d('0x32')](_0x3a01bf['model'],qs['fields'](_0x13443a[_0x2f7d('0x30')][_0x2f7d('0x33')]));_0x59296c[_0x2f7d('0x31')]=_0x59296c[_0x2f7d('0x31')]['length']?_0x59296c[_0x2f7d('0x31')]:_0x3a01bf['model'];if(_0x13443a['query']['includeAll']){_0x59296c['include']=[{'all':!![]}];}_0x59296c=_[_0x2f7d('0x3d')]({},_0x59296c,_0x13443a[_0x2f7d('0x3e')]);return db[_0x2f7d('0x2b')][_0x2f7d('0x47')](_0x59296c)[_0x2f7d('0x22')](handleEntityNotFound(_0x833fc4,null))[_0x2f7d('0x22')](respondWithResult(_0x833fc4,null))[_0x2f7d('0x44')](handleError(_0x833fc4,null));};exports[_0x2f7d('0x48')]=function(_0x4857a2,_0x5064cc){return db['JscriptyProject'][_0x2f7d('0x48')](_0x4857a2[_0x2f7d('0x49')],{})[_0x2f7d('0x22')](function(_0x9107a5){var _0x26a476=_0x4857a2[_0x2f7d('0x4a')]['get']({'plain':!![]});if(!_0x26a476)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x26a476[_0x2f7d('0x4b')]===_0x2f7d('0x4a')){var _0x49610b=_0x9107a5['get']({'plain':!![]});var _0x51c6d2=_0x2f7d('0x25');return db[_0x2f7d('0x4c')]['find']({'where':{'name':_0x51c6d2,'userProfileId':_0x26a476[_0x2f7d('0x4d')]},'raw':!![]})[_0x2f7d('0x22')](function(_0x26fa9b){if(_0x26fa9b&&_0x26fa9b['autoAssociation']===0x0){return db[_0x2f7d('0x26')][_0x2f7d('0x48')]({'name':_0x49610b[_0x2f7d('0x29')],'resourceId':_0x49610b['id'],'type':_0x26fa9b[_0x2f7d('0x29')],'sectionId':_0x26fa9b['id']},{})[_0x2f7d('0x22')](function(){return _0x9107a5;});}else{return _0x9107a5;}})[_0x2f7d('0x44')](function(_0x4641fa){logger[_0x2f7d('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4641fa);throw _0x4641fa;});}return _0x9107a5;})[_0x2f7d('0x22')](respondWithResult(_0x5064cc,0xc9))[_0x2f7d('0x44')](handleError(_0x5064cc,null));};exports[_0x2f7d('0x4f')]=function(_0x432388,_0x1529c5){var _0x356d58={'where':{'id':_0x432388['params']['id']}},_0x3c5385={};_0x3c5385[_0x2f7d('0x2f')]=_['keys'](db[_0x2f7d('0x2b')]['rawAttributes']);_0x356d58[_0x2f7d('0x31')]=_[_0x2f7d('0x32')](_0x3c5385[_0x2f7d('0x2f')],qs[_0x2f7d('0x33')](_0x432388[_0x2f7d('0x30')][_0x2f7d('0x33')]));_0x356d58['attributes']=_0x356d58[_0x2f7d('0x31')][_0x2f7d('0x34')]?_0x356d58[_0x2f7d('0x31')]:_0x3c5385[_0x2f7d('0x2f')];if(_0x432388[_0x2f7d('0x30')][_0x2f7d('0x40')]){_0x356d58[_0x2f7d('0x41')]=[{'all':!![]}];}_0x356d58=_[_0x2f7d('0x3d')]({},_0x356d58,_0x432388[_0x2f7d('0x3e')]);return db['JscriptyProject']['find'](_0x356d58)['then'](handleEntityNotFound(_0x1529c5,null))[_0x2f7d('0x22')](function(_0x462d61){if(_0x462d61){var _0x3290ca=_0x462d61[_0x2f7d('0x24')]({'plain':!![]});_0x3290ca=qs['omit'](_0x3290ca,['id',_0x2f7d('0x50'),_0x2f7d('0x51')]);_0x432388[_0x2f7d('0x49')]=_['omit'](_0x432388[_0x2f7d('0x49')],['id',_0x2f7d('0x50'),_0x2f7d('0x51')]);return db[_0x2f7d('0x2b')][_0x2f7d('0x48')](_[_0x2f7d('0x3d')](_0x3290ca,_0x432388[_0x2f7d('0x49')]),{'include':_0x432388['query']['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x420605){var _0x14b53d=_0x432388[_0x2f7d('0x4a')][_0x2f7d('0x24')]({'plain':!![]});if(!_0x14b53d)throw new Error(_0x2f7d('0x52'));if(_0x14b53d[_0x2f7d('0x4b')]===_0x2f7d('0x4a')){var _0x5c9aa5=_0x420605[_0x2f7d('0x24')]({'plain':!![]});var _0x125a7b=_0x2f7d('0x25');return db['UserProfileSection'][_0x2f7d('0x47')]({'where':{'name':_0x125a7b,'userProfileId':_0x14b53d[_0x2f7d('0x4d')]},'raw':!![]})[_0x2f7d('0x22')](function(_0xf17b46){if(_0xf17b46&&_0xf17b46[_0x2f7d('0x53')]===0x0){return db[_0x2f7d('0x26')]['create']({'name':_0x5c9aa5[_0x2f7d('0x29')],'resourceId':_0x5c9aa5['id'],'type':_0xf17b46[_0x2f7d('0x29')],'sectionId':_0xf17b46['id']},{})[_0x2f7d('0x22')](function(){return _0x420605;});}else{return _0x420605;}})[_0x2f7d('0x44')](function(_0x326a08){logger[_0x2f7d('0x4e')](_0x2f7d('0x54'),_0x326a08);throw _0x326a08;});}return _0x420605;});}})[_0x2f7d('0x22')](respondWithResult(_0x1529c5,0xc9))[_0x2f7d('0x44')](handleError(_0x1529c5,null));};exports['update']=function(_0x2fef8e,_0x22dfd8){if(_0x2fef8e['body']['id']){delete _0x2fef8e[_0x2f7d('0x49')]['id'];}return db[_0x2f7d('0x2b')][_0x2f7d('0x47')]({'where':{'id':_0x2fef8e[_0x2f7d('0x45')]['id']}})['then'](handleEntityNotFound(_0x22dfd8,null))[_0x2f7d('0x22')](saveUpdates(_0x2fef8e['body'],null))[_0x2f7d('0x22')](respondWithResult(_0x22dfd8,null))[_0x2f7d('0x44')](handleError(_0x22dfd8,null));};exports[_0x2f7d('0x23')]=function(_0x50bc0f,_0x18fe67){return db[_0x2f7d('0x2b')][_0x2f7d('0x47')]({'where':{'id':_0x50bc0f[_0x2f7d('0x45')]['id']}})[_0x2f7d('0x22')](handleEntityNotFound(_0x18fe67,null))[_0x2f7d('0x22')](removeEntity(_0x18fe67,null))[_0x2f7d('0x44')](handleError(_0x18fe67,null));};exports[_0x2f7d('0x55')]=function(_0x3b536e,_0x268af8,_0x4645c4){var _0x140362={'raw':!![],'where':{}};var _0x5165a6={};var _0x3bd421={'count':0x0,'rows':[]};return db['JscriptyProject']['findOne']({'where':{'id':_0x3b536e[_0x2f7d('0x45')]['id']}})[_0x2f7d('0x22')](handleEntityNotFound(_0x268af8,null))[_0x2f7d('0x22')](function(_0x2476c6){if(_0x2476c6){_0x5165a6['model']=_[_0x2f7d('0x46')](db[_0x2f7d('0x56')][_0x2f7d('0x2c')]);_0x5165a6[_0x2f7d('0x30')]=_[_0x2f7d('0x46')](_0x3b536e[_0x2f7d('0x30')]);_0x5165a6[_0x2f7d('0x39')]=_[_0x2f7d('0x32')](_0x5165a6[_0x2f7d('0x2f')],_0x5165a6[_0x2f7d('0x30')]);_0x140362[_0x2f7d('0x31')]=_[_0x2f7d('0x32')](_0x5165a6[_0x2f7d('0x2f')],qs[_0x2f7d('0x33')](_0x3b536e[_0x2f7d('0x30')][_0x2f7d('0x33')]));_0x140362[_0x2f7d('0x31')]=_0x140362[_0x2f7d('0x31')]['length']?_0x140362[_0x2f7d('0x31')]:_0x5165a6[_0x2f7d('0x2f')];if(!_0x3b536e[_0x2f7d('0x30')][_0x2f7d('0x35')](_0x2f7d('0x36'))){_0x140362['limit']=qs[_0x2f7d('0x1b')](_0x3b536e['query'][_0x2f7d('0x1b')]);_0x140362[_0x2f7d('0x1c')]=qs[_0x2f7d('0x1c')](_0x3b536e[_0x2f7d('0x30')][_0x2f7d('0x1c')]);}_0x140362[_0x2f7d('0x57')]=qs[_0x2f7d('0x37')](_0x3b536e[_0x2f7d('0x30')][_0x2f7d('0x37')]);_0x140362[_0x2f7d('0x38')]=qs[_0x2f7d('0x39')](_[_0x2f7d('0x3a')](_0x3b536e[_0x2f7d('0x30')],_0x5165a6[_0x2f7d('0x39')]));_0x140362[_0x2f7d('0x38')][_0x2f7d('0x58')]=_0x2476c6['id'];if(_0x3b536e[_0x2f7d('0x30')][_0x2f7d('0x3b')]){_0x140362['where']=_[_0x2f7d('0x3d')](_0x140362[_0x2f7d('0x38')],{'$or':_['map'](_0x140362[_0x2f7d('0x31')],function(_0x74f64c){var _0x24dfc9={};_0x24dfc9[_0x74f64c]={'$like':'%'+_0x3b536e['query'][_0x2f7d('0x3b')]+'%'};return _0x24dfc9;})});}_0x140362=_[_0x2f7d('0x3d')]({},_0x140362,_0x3b536e[_0x2f7d('0x3e')]);return db['JscriptySessionReport'][_0x2f7d('0x3f')]({'where':_0x140362['where']})['then'](function(_0x3ccb29){_0x3bd421[_0x2f7d('0x3f')]=_0x3ccb29;if(_0x3b536e[_0x2f7d('0x30')]['includeAll']){_0x140362[_0x2f7d('0x41')]=[{'all':!![]}];}return db[_0x2f7d('0x56')]['findAll'](_0x140362);})[_0x2f7d('0x22')](function(_0x31e5f3){_0x3bd421[_0x2f7d('0x43')]=_0x31e5f3;return _0x3bd421;});}})[_0x2f7d('0x22')](respondWithFilteredResult(_0x268af8,_0x140362))[_0x2f7d('0x44')](handleError(_0x268af8,null));};exports[_0x2f7d('0x59')]=function(_0x1c5e7c,_0x2bedcc,_0x169cc5){var _0x423458={'raw':!![],'where':{}};var _0x568017={};var _0x585a59={'count':0x0,'rows':[]};return db[_0x2f7d('0x2b')]['findOne']({'where':{'id':_0x1c5e7c['params']['id']}})[_0x2f7d('0x22')](handleEntityNotFound(_0x2bedcc,null))['then'](function(_0x25075e){if(_0x25075e){_0x568017[_0x2f7d('0x2f')]=_[_0x2f7d('0x46')](db[_0x2f7d('0x5a')][_0x2f7d('0x2c')]);_0x568017[_0x2f7d('0x30')]=_[_0x2f7d('0x46')](_0x1c5e7c[_0x2f7d('0x30')]);_0x568017[_0x2f7d('0x39')]=_['intersection'](_0x568017[_0x2f7d('0x2f')],_0x568017['query']);_0x423458[_0x2f7d('0x31')]=_[_0x2f7d('0x32')](_0x568017[_0x2f7d('0x2f')],qs[_0x2f7d('0x33')](_0x1c5e7c[_0x2f7d('0x30')]['fields']));_0x423458[_0x2f7d('0x31')]=_0x423458[_0x2f7d('0x31')][_0x2f7d('0x34')]?_0x423458['attributes']:_0x568017[_0x2f7d('0x2f')];if(!_0x1c5e7c['query'][_0x2f7d('0x35')](_0x2f7d('0x36'))){_0x423458[_0x2f7d('0x1b')]=qs[_0x2f7d('0x1b')](_0x1c5e7c[_0x2f7d('0x30')]['limit']);_0x423458[_0x2f7d('0x1c')]=qs[_0x2f7d('0x1c')](_0x1c5e7c['query'][_0x2f7d('0x1c')]);}_0x423458[_0x2f7d('0x57')]=qs[_0x2f7d('0x37')](_0x1c5e7c[_0x2f7d('0x30')]['sort']);_0x423458[_0x2f7d('0x38')]=qs[_0x2f7d('0x39')](_['pick'](_0x1c5e7c[_0x2f7d('0x30')],_0x568017[_0x2f7d('0x39')]));_0x423458[_0x2f7d('0x38')][_0x2f7d('0x58')]=_0x25075e['id'];if(_0x1c5e7c[_0x2f7d('0x30')][_0x2f7d('0x3b')]){_0x423458[_0x2f7d('0x38')]=_[_0x2f7d('0x3d')](_0x423458[_0x2f7d('0x38')],{'$or':_[_0x2f7d('0x2a')](_0x423458[_0x2f7d('0x31')],function(_0x40d734){var _0x14a81d={};_0x14a81d[_0x40d734]={'$like':'%'+_0x1c5e7c[_0x2f7d('0x30')][_0x2f7d('0x3b')]+'%'};return _0x14a81d;})});}_0x423458=_[_0x2f7d('0x3d')]({},_0x423458,_0x1c5e7c[_0x2f7d('0x3e')]);return db['JscriptyAnswerReport'][_0x2f7d('0x3f')]({'where':_0x423458[_0x2f7d('0x38')]})[_0x2f7d('0x22')](function(_0x4476df){_0x585a59[_0x2f7d('0x3f')]=_0x4476df;if(_0x1c5e7c['query']['includeAll']){_0x423458[_0x2f7d('0x41')]=[{'all':!![]}];}return db[_0x2f7d('0x5a')]['findAll'](_0x423458);})[_0x2f7d('0x22')](function(_0x387a79){_0x585a59[_0x2f7d('0x43')]=_0x387a79;return _0x585a59;});}})[_0x2f7d('0x22')](respondWithFilteredResult(_0x2bedcc,_0x423458))[_0x2f7d('0x44')](handleError(_0x2bedcc,null));};function char(_0x50f345){return'number'===typeof _0x50f345?String[_0x2f7d('0x5b')][_0x2f7d('0x1f')](null,arguments):_0x50f345;}function needsEncapsulation(_0x1b1a57){return!!_0x1b1a57&&(_0x1b1a57[_0x2f7d('0x5c')]()['indexOf'](char(0xd))>=0x0||_0x1b1a57[_0x2f7d('0x5c')]()[_0x2f7d('0x5d')](char(0xa))>=0x0||_0x1b1a57[_0x2f7d('0x5c')]()[_0x2f7d('0x5d')](char(0x2c))>=0x0||_0x1b1a57[_0x2f7d('0x5c')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x122832){var _0x138e45=char(0x22),_0x5a25c9='\x5c'+char(0x22),_0x362f89=_0x122832[_0x2f7d('0x5c')]()['replace'](new RegExp(_0x138e45,'g'),_0x5a25c9);return _0x138e45+_0x362f89+_0x138e45;}exports['getSummary']=function(_0xb408fc,_0x507a76,_0x3d37bc){var _0x1359e7,_0x5df19c;var _0x1ed931={'where':{'ProjectId':_0xb408fc['params']['id']}};if(_0xb408fc[_0x2f7d('0x30')][_0x2f7d('0x5e')]){_0x1ed931[_0x2f7d('0x38')][_0x2f7d('0x5f')]=JSON[_0x2f7d('0x60')](_0xb408fc[_0x2f7d('0x30')][_0x2f7d('0x5e')]);}return db[_0x2f7d('0x56')][_0x2f7d('0x42')](_0x1ed931)[_0x2f7d('0x22')](handleEntityNotFound(_0x507a76,null))[_0x2f7d('0x22')](function(_0x1eed44){if(_0x1eed44){_0x1359e7=_0x1eed44;return db['JscriptyQuestionReport'][_0x2f7d('0x42')]({'where':{'SessionId':{'$in':_['map'](_0x1359e7,'id')},'ProjectId':_0xb408fc['params']['id']},'order':_0x2f7d('0x61')});}})[_0x2f7d('0x22')](handleEntityNotFound(_0x507a76,null))[_0x2f7d('0x22')](function(_0x22f3dc){if(_0x22f3dc){_0x5df19c=_0x22f3dc;var _0xe4b7bd={};for(var _0x5556a6=0x0,_0x1dae99=_0x5df19c[_0x2f7d('0x34')];_0x5556a6<_0x1dae99;_0x5556a6++){if(!_0xe4b7bd[_0x2f7d('0x35')](_0x5df19c[_0x5556a6][_0x2f7d('0x62')])){_0xe4b7bd[_0x5df19c[_0x5556a6]['questionId']]=needsEncapsulation(_0x5df19c[_0x5556a6][_0x2f7d('0x63')])?encapsulate(_0x5df19c[_0x5556a6][_0x2f7d('0x63')]):_0x5df19c[_0x5556a6][_0x2f7d('0x63')];}}var _0x138bbd=[],_0x139759={};for(var _0x106f2c=0x0,_0x3418ad=_0x1359e7[_0x2f7d('0x34')];_0x106f2c<_0x3418ad;_0x106f2c++){_0x139759={'ProjectId':_0xb408fc[_0x2f7d('0x45')]['id'],'SessionId':_0x1359e7[_0x106f2c]['id'],'StartTime':moment(_0x1359e7[_0x106f2c]['starttime'])[_0x2f7d('0x64')](_0x2f7d('0x65'))};for(var _0x333f3d=0x0,_0x11ad28=_0x5df19c[_0x2f7d('0x34')];_0x333f3d<_0x11ad28;_0x333f3d++){if(_0x5df19c[_0x333f3d][_0x2f7d('0x66')]==_0x1359e7[_0x106f2c]['id']&&_0xe4b7bd[_0x2f7d('0x35')](_0x5df19c[_0x333f3d][_0x2f7d('0x62')])){_0x139759[_0xe4b7bd[_0x5df19c[_0x333f3d][_0x2f7d('0x62')]]]=_0x5df19c[_0x333f3d][_0x2f7d('0x67')];}}for(var _0x3dae54 in _0xe4b7bd){if(!_0x139759[_0x2f7d('0x35')](_0xe4b7bd[_0x3dae54])){_0x139759[_0xe4b7bd[_0x3dae54]]=null;}}_0x138bbd[_0x2f7d('0x68')](_0x139759);}return _0x138bbd;}})['then'](function(_0x283f60){if(!_[_0x2f7d('0x69')](_0x283f60)){var _0x2ebf77=toCsv(_0x283f60);var _0x54c9ad=Date[_0x2f7d('0x6a')]();fs['writeFileSync'](util['format']('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0xb408fc['params']['id'],_0x54c9ad),_0x2ebf77);_0x507a76[_0x2f7d('0x6b')](_0x2f7d('0x6c'),_0x2f7d('0x6d')+util['format'](_0x2f7d('0x6e'),_0xb408fc['params']['id'],_0x54c9ad));_0x507a76[_0x2f7d('0x6b')](_0x2f7d('0x6f'),_0x2f7d('0x70'));return _0x507a76['download'](util[_0x2f7d('0x64')](_0x2f7d('0x71'),_0xb408fc[_0x2f7d('0x45')]['id'],_0x54c9ad));}else{return _0x507a76[_0x2f7d('0x27')](0xcc);}})['catch'](handleError(_0x507a76,null));}; \ No newline at end of file +var _0x094c=['attributes','length','hasOwnProperty','nolimit','order','where','merge','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Projects','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','update','getSessions','findOne','JscriptySessionReport','sort','pick','filter','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','getSummary','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','isEmpty','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','format','Jscripty_Project_%d_Summary_%s.csv','Content-type','download','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','UserProfileResource','destroy','end','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields'];(function(_0x20bdcf,_0x5cc6d8){var _0x429595=function(_0x799b8f){while(--_0x799b8f){_0x20bdcf['push'](_0x20bdcf['shift']());}};_0x429595(++_0x5cc6d8);}(_0x094c,0x131));var _0xc094=function(_0x2e87e4,_0x591ef7){_0x2e87e4=_0x2e87e4-0x0;var _0x3c9855=_0x094c[_0x2e87e4];return _0x3c9855;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc094('0x0'));var zipdir=require(_0xc094('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc094('0x2'));var moment=require(_0xc094('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc094('0x4'));var util=require(_0xc094('0x5'));var path=require(_0xc094('0x6'));var sox=require(_0xc094('0x7'));var csv=require(_0xc094('0x8'));var ejs=require(_0xc094('0x9'));var fs=require('fs');var fs_extra=require(_0xc094('0xa'));var _=require('lodash');var squel=require(_0xc094('0xb'));var crypto=require('crypto');var jsforce=require(_0xc094('0xc'));var deskjs=require(_0xc094('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc094('0xe'));var Papa=require(_0xc094('0xf'));var Redis=require(_0xc094('0x10'));var authService=require(_0xc094('0x11'));var qs=require(_0xc094('0x12'));var as=require(_0xc094('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc094('0x14'))(_0xc094('0x15'));var utils=require(_0xc094('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc094('0x17'))['db'];function respondWithStatusCode(_0x453ed2,_0x384005){_0x384005=_0x384005||0xcc;return function(_0x458315){if(_0x458315){return _0x453ed2[_0xc094('0x18')](_0x384005);}return _0x453ed2[_0xc094('0x19')](_0x384005)['end']();};}function respondWithResult(_0x425f56,_0x5dee69){_0x5dee69=_0x5dee69||0xc8;return function(_0x3c47f6){if(_0x3c47f6){return _0x425f56[_0xc094('0x19')](_0x5dee69)[_0xc094('0x1a')](_0x3c47f6);}};}function respondWithFilteredResult(_0x43625e,_0x188418){return function(_0x147dc9){if(_0x147dc9){var _0x3b6fe2=typeof _0x188418[_0xc094('0x1b')]===_0xc094('0x1c')&&typeof _0x188418[_0xc094('0x1d')]==='undefined';var _0x5bde5d=_0x147dc9[_0xc094('0x1e')];var _0x384170=_0x3b6fe2?0x0:_0x188418[_0xc094('0x1b')];var _0x3290d4=_0x3b6fe2?_0x147dc9['count']:_0x188418[_0xc094('0x1b')]+_0x188418['limit'];var _0x3eec46;if(_0x3290d4>=_0x5bde5d){_0x3290d4=_0x5bde5d;_0x3eec46=0xc8;}else{_0x3eec46=0xce;}_0x43625e[_0xc094('0x19')](_0x3eec46);return _0x43625e[_0xc094('0x1f')](_0xc094('0x20'),_0x384170+'-'+_0x3290d4+'/'+_0x5bde5d)[_0xc094('0x1a')](_0x147dc9);}return null;};}function patchUpdates(_0x97dba8){return function(_0x5e2cc8){try{jsonpatch[_0xc094('0x21')](_0x5e2cc8,_0x97dba8,!![]);}catch(_0x54c1a9){return BPromise[_0xc094('0x22')](_0x54c1a9);}return _0x5e2cc8[_0xc094('0x23')]();};}function saveUpdates(_0x4d814d,_0x5bbc42){return function(_0x321bb3){if(_0x321bb3){return _0x321bb3['update'](_0x4d814d)[_0xc094('0x24')](function(_0x17f044){return _0x17f044;});}return null;};}function removeEntity(_0x249a32,_0x228b93){return function(_0x364ede){if(_0x364ede){return _0x364ede['destroy']()['then'](function(){var _0x59f5a6=_0x364ede['get']({'plain':!![]});var _0xa85298='Projects';return db[_0xc094('0x25')][_0xc094('0x26')]({'where':{'type':_0xa85298,'resourceId':_0x59f5a6['id']}})[_0xc094('0x24')](function(){return _0x364ede;});})[_0xc094('0x24')](function(){_0x249a32[_0xc094('0x19')](0xcc)[_0xc094('0x27')]();});}};}function handleEntityNotFound(_0x1f9675,_0xaa6ff0){return function(_0x1000e6){if(!_0x1000e6){_0x1f9675[_0xc094('0x18')](0x194);}return _0x1000e6;};}function handleError(_0x5a92d8,_0x203f94){_0x203f94=_0x203f94||0x1f4;return function(_0x1936f3){logger['error'](_0x1936f3[_0xc094('0x28')]);if(_0x1936f3[_0xc094('0x29')]){delete _0x1936f3[_0xc094('0x29')];}_0x5a92d8[_0xc094('0x19')](_0x203f94)[_0xc094('0x2a')](_0x1936f3);};}exports[_0xc094('0x2b')]=function(_0x23790f,_0x27614c){var _0x5090e3={},_0xb267a4={},_0x56ef51={'count':0x0,'rows':[]};var _0x5bf460=_[_0xc094('0x2c')](db[_0xc094('0x2d')][_0xc094('0x2e')],function(_0x421b78){return{'name':_0x421b78[_0xc094('0x2f')],'type':_0x421b78[_0xc094('0x30')][_0xc094('0x31')]};});_0xb267a4['model']=_['map'](_0x5bf460,_0xc094('0x29'));_0xb267a4[_0xc094('0x32')]=_['keys'](_0x23790f['query']);_0xb267a4[_0xc094('0x33')]=_[_0xc094('0x34')](_0xb267a4['model'],_0xb267a4[_0xc094('0x32')]);_0x5090e3['attributes']=_[_0xc094('0x34')](_0xb267a4[_0xc094('0x35')],qs[_0xc094('0x36')](_0x23790f[_0xc094('0x32')][_0xc094('0x36')]));_0x5090e3['attributes']=_0x5090e3[_0xc094('0x37')][_0xc094('0x38')]?_0x5090e3['attributes']:_0xb267a4[_0xc094('0x35')];if(!_0x23790f[_0xc094('0x32')][_0xc094('0x39')](_0xc094('0x3a'))){_0x5090e3[_0xc094('0x1d')]=qs[_0xc094('0x1d')](_0x23790f[_0xc094('0x32')]['limit']);_0x5090e3['offset']=qs[_0xc094('0x1b')](_0x23790f[_0xc094('0x32')][_0xc094('0x1b')]);}_0x5090e3[_0xc094('0x3b')]=qs['sort'](_0x23790f[_0xc094('0x32')]['sort']);_0x5090e3['where']=qs['filters'](_['pick'](_0x23790f[_0xc094('0x32')],_0xb267a4[_0xc094('0x33')]),_0x5bf460);if(_0x23790f['query']['filter']){_0x5090e3[_0xc094('0x3c')]=_[_0xc094('0x3d')](_0x5090e3[_0xc094('0x3c')],{'$or':_['map'](_0x5bf460,function(_0x484e63){if(_0x484e63[_0xc094('0x30')]!=='VIRTUAL'){var _0x2337c3={};_0x2337c3[_0x484e63[_0xc094('0x29')]]={'$like':'%'+_0x23790f[_0xc094('0x32')]['filter']+'%'};return _0x2337c3;}})});}_0x5090e3=_[_0xc094('0x3d')]({},_0x5090e3,_0x23790f[_0xc094('0x3e')]);var _0x299494={'where':_0x5090e3[_0xc094('0x3c')]};return db['JscriptyProject'][_0xc094('0x1e')](_0x299494)[_0xc094('0x24')](function(_0x109a09){_0x56ef51[_0xc094('0x1e')]=_0x109a09;if(_0x23790f[_0xc094('0x32')][_0xc094('0x3f')]){_0x5090e3[_0xc094('0x40')]=[{'all':!![]}];}return db['JscriptyProject'][_0xc094('0x41')](_0x5090e3);})['then'](function(_0x5082df){_0x56ef51[_0xc094('0x42')]=_0x5082df;return _0x56ef51;})['then'](respondWithFilteredResult(_0x27614c,_0x5090e3))[_0xc094('0x43')](handleError(_0x27614c,null));};exports[_0xc094('0x44')]=function(_0x43600e,_0x1c97e6){var _0x388e76={'raw':![],'where':{'id':_0x43600e['params']['id']}},_0x1bf5f1={};_0x1bf5f1[_0xc094('0x35')]=_[_0xc094('0x45')](db['JscriptyProject'][_0xc094('0x2e')]);_0x1bf5f1['query']=_['keys'](_0x43600e[_0xc094('0x32')]);_0x1bf5f1[_0xc094('0x33')]=_[_0xc094('0x34')](_0x1bf5f1[_0xc094('0x35')],_0x1bf5f1['query']);_0x388e76[_0xc094('0x37')]=_[_0xc094('0x34')](_0x1bf5f1[_0xc094('0x35')],qs[_0xc094('0x36')](_0x43600e['query'][_0xc094('0x36')]));_0x388e76[_0xc094('0x37')]=_0x388e76[_0xc094('0x37')][_0xc094('0x38')]?_0x388e76[_0xc094('0x37')]:_0x1bf5f1[_0xc094('0x35')];if(_0x43600e['query']['includeAll']){_0x388e76[_0xc094('0x40')]=[{'all':!![]}];}_0x388e76=_['merge']({},_0x388e76,_0x43600e[_0xc094('0x3e')]);return db['JscriptyProject'][_0xc094('0x46')](_0x388e76)['then'](handleEntityNotFound(_0x1c97e6,null))[_0xc094('0x24')](respondWithResult(_0x1c97e6,null))['catch'](handleError(_0x1c97e6,null));};exports[_0xc094('0x47')]=function(_0x56dc51,_0x46aa3b){return db[_0xc094('0x2d')][_0xc094('0x47')](_0x56dc51[_0xc094('0x48')],{})['then'](function(_0x43cab6){var _0x5f1f2a=_0x56dc51[_0xc094('0x49')][_0xc094('0x4a')]({'plain':!![]});if(!_0x5f1f2a)throw new Error(_0xc094('0x4b'));if(_0x5f1f2a[_0xc094('0x4c')]===_0xc094('0x49')){var _0xb7ba29=_0x43cab6[_0xc094('0x4a')]({'plain':!![]});var _0xac85c5=_0xc094('0x4d');return db[_0xc094('0x4e')]['find']({'where':{'name':_0xac85c5,'userProfileId':_0x5f1f2a[_0xc094('0x4f')]},'raw':!![]})['then'](function(_0x2ba0a9){if(_0x2ba0a9&&_0x2ba0a9[_0xc094('0x50')]===0x0){return db[_0xc094('0x25')]['create']({'name':_0xb7ba29[_0xc094('0x29')],'resourceId':_0xb7ba29['id'],'type':_0x2ba0a9[_0xc094('0x29')],'sectionId':_0x2ba0a9['id']},{})[_0xc094('0x24')](function(){return _0x43cab6;});}else{return _0x43cab6;}})[_0xc094('0x43')](function(_0x5b38ef){logger[_0xc094('0x51')](_0xc094('0x52'),_0x5b38ef);throw _0x5b38ef;});}return _0x43cab6;})['then'](respondWithResult(_0x46aa3b,0xc9))[_0xc094('0x43')](handleError(_0x46aa3b,null));};exports[_0xc094('0x53')]=function(_0x5ac606,_0x1a2db9){var _0x54fc6b={'where':{'id':_0x5ac606[_0xc094('0x54')]['id']}},_0x5e7a51={};_0x5e7a51[_0xc094('0x35')]=_[_0xc094('0x45')](db['JscriptyProject'][_0xc094('0x2e')]);_0x54fc6b[_0xc094('0x37')]=_[_0xc094('0x34')](_0x5e7a51[_0xc094('0x35')],qs[_0xc094('0x36')](_0x5ac606[_0xc094('0x32')][_0xc094('0x36')]));_0x54fc6b[_0xc094('0x37')]=_0x54fc6b[_0xc094('0x37')][_0xc094('0x38')]?_0x54fc6b['attributes']:_0x5e7a51[_0xc094('0x35')];if(_0x5ac606[_0xc094('0x32')][_0xc094('0x3f')]){_0x54fc6b['include']=[{'all':!![]}];}_0x54fc6b=_[_0xc094('0x3d')]({},_0x54fc6b,_0x5ac606[_0xc094('0x3e')]);return db['JscriptyProject'][_0xc094('0x46')](_0x54fc6b)[_0xc094('0x24')](handleEntityNotFound(_0x1a2db9,null))[_0xc094('0x24')](function(_0x5f2bba){if(_0x5f2bba){var _0x1a0b90=_0x5f2bba['get']({'plain':!![]});_0x1a0b90=qs[_0xc094('0x55')](_0x1a0b90,['id',_0xc094('0x56'),_0xc094('0x57')]);_0x5ac606[_0xc094('0x48')]=_[_0xc094('0x55')](_0x5ac606[_0xc094('0x48')],['id',_0xc094('0x56'),_0xc094('0x57')]);return db[_0xc094('0x2d')][_0xc094('0x47')](_[_0xc094('0x3d')](_0x1a0b90,_0x5ac606[_0xc094('0x48')]),{'include':_0x5ac606['query'][_0xc094('0x3f')]?[{'all':!![]}]:undefined})[_0xc094('0x24')](function(_0xc9d8){var _0x465b28=_0x5ac606[_0xc094('0x49')][_0xc094('0x4a')]({'plain':!![]});if(!_0x465b28)throw new Error(_0xc094('0x4b'));if(_0x465b28[_0xc094('0x4c')]===_0xc094('0x49')){var _0x419006=_0xc9d8[_0xc094('0x4a')]({'plain':!![]});var _0x22d1f3=_0xc094('0x4d');return db[_0xc094('0x4e')][_0xc094('0x46')]({'where':{'name':_0x22d1f3,'userProfileId':_0x465b28[_0xc094('0x4f')]},'raw':!![]})[_0xc094('0x24')](function(_0x401f4b){if(_0x401f4b&&_0x401f4b[_0xc094('0x50')]===0x0){return db[_0xc094('0x25')][_0xc094('0x47')]({'name':_0x419006[_0xc094('0x29')],'resourceId':_0x419006['id'],'type':_0x401f4b[_0xc094('0x29')],'sectionId':_0x401f4b['id']},{})[_0xc094('0x24')](function(){return _0xc9d8;});}else{return _0xc9d8;}})['catch'](function(_0x11c69d){logger[_0xc094('0x51')](_0xc094('0x52'),_0x11c69d);throw _0x11c69d;});}return _0xc9d8;});}})[_0xc094('0x24')](respondWithResult(_0x1a2db9,0xc9))[_0xc094('0x43')](handleError(_0x1a2db9,null));};exports[_0xc094('0x58')]=function(_0x2aae68,_0xbc704c){if(_0x2aae68[_0xc094('0x48')]['id']){delete _0x2aae68['body']['id'];}return db[_0xc094('0x2d')][_0xc094('0x46')]({'where':{'id':_0x2aae68[_0xc094('0x54')]['id']}})[_0xc094('0x24')](handleEntityNotFound(_0xbc704c,null))[_0xc094('0x24')](saveUpdates(_0x2aae68[_0xc094('0x48')],null))['then'](respondWithResult(_0xbc704c,null))[_0xc094('0x43')](handleError(_0xbc704c,null));};exports['destroy']=function(_0x3fbd46,_0x6df9b3){return db[_0xc094('0x2d')][_0xc094('0x46')]({'where':{'id':_0x3fbd46[_0xc094('0x54')]['id']}})['then'](handleEntityNotFound(_0x6df9b3,null))[_0xc094('0x24')](removeEntity(_0x6df9b3,null))[_0xc094('0x43')](handleError(_0x6df9b3,null));};exports[_0xc094('0x59')]=function(_0x2168ab,_0x443857,_0x42f14e){var _0x3b81d2={'raw':!![],'where':{}};var _0x5b56dd={};var _0x519713={'count':0x0,'rows':[]};return db[_0xc094('0x2d')][_0xc094('0x5a')]({'where':{'id':_0x2168ab['params']['id']}})['then'](handleEntityNotFound(_0x443857,null))[_0xc094('0x24')](function(_0x1575d0){if(_0x1575d0){_0x5b56dd[_0xc094('0x35')]=_['keys'](db[_0xc094('0x5b')][_0xc094('0x2e')]);_0x5b56dd[_0xc094('0x32')]=_[_0xc094('0x45')](_0x2168ab['query']);_0x5b56dd['filters']=_[_0xc094('0x34')](_0x5b56dd['model'],_0x5b56dd[_0xc094('0x32')]);_0x3b81d2['attributes']=_[_0xc094('0x34')](_0x5b56dd['model'],qs[_0xc094('0x36')](_0x2168ab[_0xc094('0x32')][_0xc094('0x36')]));_0x3b81d2[_0xc094('0x37')]=_0x3b81d2[_0xc094('0x37')][_0xc094('0x38')]?_0x3b81d2['attributes']:_0x5b56dd[_0xc094('0x35')];if(!_0x2168ab[_0xc094('0x32')][_0xc094('0x39')]('nolimit')){_0x3b81d2[_0xc094('0x1d')]=qs[_0xc094('0x1d')](_0x2168ab['query'][_0xc094('0x1d')]);_0x3b81d2[_0xc094('0x1b')]=qs[_0xc094('0x1b')](_0x2168ab['query']['offset']);}_0x3b81d2['order']=qs[_0xc094('0x5c')](_0x2168ab['query'][_0xc094('0x5c')]);_0x3b81d2['where']=qs['filters'](_[_0xc094('0x5d')](_0x2168ab[_0xc094('0x32')],_0x5b56dd[_0xc094('0x33')]));_0x3b81d2['where']['ProjectId']=_0x1575d0['id'];if(_0x2168ab[_0xc094('0x32')][_0xc094('0x5e')]){_0x3b81d2[_0xc094('0x3c')]=_['merge'](_0x3b81d2[_0xc094('0x3c')],{'$or':_['map'](_0x3b81d2[_0xc094('0x37')],function(_0x5abe4a){var _0x20f456={};_0x20f456[_0x5abe4a]={'$like':'%'+_0x2168ab[_0xc094('0x32')][_0xc094('0x5e')]+'%'};return _0x20f456;})});}_0x3b81d2=_[_0xc094('0x3d')]({},_0x3b81d2,_0x2168ab['options']);return db[_0xc094('0x5b')][_0xc094('0x1e')]({'where':_0x3b81d2['where']})[_0xc094('0x24')](function(_0x53b4c0){_0x519713['count']=_0x53b4c0;if(_0x2168ab[_0xc094('0x32')][_0xc094('0x3f')]){_0x3b81d2[_0xc094('0x40')]=[{'all':!![]}];}return db[_0xc094('0x5b')]['findAll'](_0x3b81d2);})['then'](function(_0x6db787){_0x519713['rows']=_0x6db787;return _0x519713;});}})['then'](respondWithFilteredResult(_0x443857,_0x3b81d2))[_0xc094('0x43')](handleError(_0x443857,null));};exports[_0xc094('0x5f')]=function(_0x20d0a6,_0x93ed7e,_0x19a5a0){var _0xd61d85={'raw':!![],'where':{}};var _0x272d5f={};var _0x2905cf={'count':0x0,'rows':[]};return db[_0xc094('0x2d')][_0xc094('0x5a')]({'where':{'id':_0x20d0a6[_0xc094('0x54')]['id']}})['then'](handleEntityNotFound(_0x93ed7e,null))[_0xc094('0x24')](function(_0x11db0f){if(_0x11db0f){_0x272d5f[_0xc094('0x35')]=_[_0xc094('0x45')](db[_0xc094('0x60')]['rawAttributes']);_0x272d5f['query']=_['keys'](_0x20d0a6[_0xc094('0x32')]);_0x272d5f[_0xc094('0x33')]=_[_0xc094('0x34')](_0x272d5f[_0xc094('0x35')],_0x272d5f[_0xc094('0x32')]);_0xd61d85[_0xc094('0x37')]=_['intersection'](_0x272d5f[_0xc094('0x35')],qs[_0xc094('0x36')](_0x20d0a6[_0xc094('0x32')][_0xc094('0x36')]));_0xd61d85[_0xc094('0x37')]=_0xd61d85[_0xc094('0x37')][_0xc094('0x38')]?_0xd61d85[_0xc094('0x37')]:_0x272d5f['model'];if(!_0x20d0a6[_0xc094('0x32')][_0xc094('0x39')]('nolimit')){_0xd61d85[_0xc094('0x1d')]=qs[_0xc094('0x1d')](_0x20d0a6[_0xc094('0x32')][_0xc094('0x1d')]);_0xd61d85[_0xc094('0x1b')]=qs[_0xc094('0x1b')](_0x20d0a6['query'][_0xc094('0x1b')]);}_0xd61d85[_0xc094('0x3b')]=qs[_0xc094('0x5c')](_0x20d0a6[_0xc094('0x32')][_0xc094('0x5c')]);_0xd61d85[_0xc094('0x3c')]=qs['filters'](_[_0xc094('0x5d')](_0x20d0a6['query'],_0x272d5f[_0xc094('0x33')]));_0xd61d85[_0xc094('0x3c')]['ProjectId']=_0x11db0f['id'];if(_0x20d0a6['query']['filter']){_0xd61d85[_0xc094('0x3c')]=_['merge'](_0xd61d85[_0xc094('0x3c')],{'$or':_['map'](_0xd61d85[_0xc094('0x37')],function(_0x19a16a){var _0x53e9b5={};_0x53e9b5[_0x19a16a]={'$like':'%'+_0x20d0a6[_0xc094('0x32')][_0xc094('0x5e')]+'%'};return _0x53e9b5;})});}_0xd61d85=_[_0xc094('0x3d')]({},_0xd61d85,_0x20d0a6['options']);return db[_0xc094('0x60')][_0xc094('0x1e')]({'where':_0xd61d85[_0xc094('0x3c')]})[_0xc094('0x24')](function(_0x550f2e){_0x2905cf[_0xc094('0x1e')]=_0x550f2e;if(_0x20d0a6['query'][_0xc094('0x3f')]){_0xd61d85[_0xc094('0x40')]=[{'all':!![]}];}return db[_0xc094('0x60')]['findAll'](_0xd61d85);})['then'](function(_0x1b5c26){_0x2905cf[_0xc094('0x42')]=_0x1b5c26;return _0x2905cf;});}})[_0xc094('0x24')](respondWithFilteredResult(_0x93ed7e,_0xd61d85))['catch'](handleError(_0x93ed7e,null));};function char(_0x56626c){return _0xc094('0x61')===typeof _0x56626c?String[_0xc094('0x62')][_0xc094('0x21')](null,arguments):_0x56626c;}function needsEncapsulation(_0x2fd2a9){return!!_0x2fd2a9&&(_0x2fd2a9[_0xc094('0x63')]()[_0xc094('0x64')](char(0xd))>=0x0||_0x2fd2a9[_0xc094('0x63')]()[_0xc094('0x64')](char(0xa))>=0x0||_0x2fd2a9[_0xc094('0x63')]()[_0xc094('0x64')](char(0x2c))>=0x0||_0x2fd2a9[_0xc094('0x63')]()[_0xc094('0x64')](char(0x22))>=0x0);}function encapsulate(_0xffec0a){var _0x105e4d=char(0x22),_0x2aa2f1='\x5c'+char(0x22),_0x4d8b71=_0xffec0a[_0xc094('0x63')]()['replace'](new RegExp(_0x105e4d,'g'),_0x2aa2f1);return _0x105e4d+_0x4d8b71+_0x105e4d;}exports[_0xc094('0x65')]=function(_0x45b875,_0x1b9316,_0x955189){var _0x1366cf,_0x23f273;var _0x565ba7={'where':{'ProjectId':_0x45b875[_0xc094('0x54')]['id']}};if(_0x45b875[_0xc094('0x32')]['startTime']){_0x565ba7['where'][_0xc094('0x66')]=JSON[_0xc094('0x67')](_0x45b875['query']['startTime']);}return db[_0xc094('0x5b')][_0xc094('0x41')](_0x565ba7)[_0xc094('0x24')](handleEntityNotFound(_0x1b9316,null))[_0xc094('0x24')](function(_0x5a27e1){if(_0x5a27e1){_0x1366cf=_0x5a27e1;return db[_0xc094('0x68')]['findAll']({'where':{'SessionId':{'$in':_[_0xc094('0x2c')](_0x1366cf,'id')},'ProjectId':_0x45b875[_0xc094('0x54')]['id']},'order':_0xc094('0x69')});}})['then'](handleEntityNotFound(_0x1b9316,null))['then'](function(_0x387cb0){if(_0x387cb0){_0x23f273=_0x387cb0;var _0x53109f={};for(var _0x245e38=0x0,_0x5624f3=_0x23f273[_0xc094('0x38')];_0x245e38<_0x5624f3;_0x245e38++){if(!_0x53109f[_0xc094('0x39')](_0x23f273[_0x245e38][_0xc094('0x6a')])){_0x53109f[_0x23f273[_0x245e38][_0xc094('0x6a')]]=needsEncapsulation(_0x23f273[_0x245e38][_0xc094('0x6b')])?encapsulate(_0x23f273[_0x245e38][_0xc094('0x6b')]):_0x23f273[_0x245e38][_0xc094('0x6b')];}}var _0x32bc4b=[],_0x51eda7={};for(var _0x26885b=0x0,_0x350538=_0x1366cf[_0xc094('0x38')];_0x26885b<_0x350538;_0x26885b++){_0x51eda7={'ProjectId':_0x45b875[_0xc094('0x54')]['id'],'SessionId':_0x1366cf[_0x26885b]['id'],'StartTime':moment(_0x1366cf[_0x26885b][_0xc094('0x66')])['format'](_0xc094('0x6c'))};for(var _0x34ca8a=0x0,_0x27492b=_0x23f273[_0xc094('0x38')];_0x34ca8a<_0x27492b;_0x34ca8a++){if(_0x23f273[_0x34ca8a][_0xc094('0x6d')]==_0x1366cf[_0x26885b]['id']&&_0x53109f[_0xc094('0x39')](_0x23f273[_0x34ca8a][_0xc094('0x6a')])){_0x51eda7[_0x53109f[_0x23f273[_0x34ca8a][_0xc094('0x6a')]]]=_0x23f273[_0x34ca8a][_0xc094('0x6e')];}}for(var _0xf24a1e in _0x53109f){if(!_0x51eda7[_0xc094('0x39')](_0x53109f[_0xf24a1e])){_0x51eda7[_0x53109f[_0xf24a1e]]=null;}}_0x32bc4b['push'](_0x51eda7);}return _0x32bc4b;}})[_0xc094('0x24')](function(_0x321652){if(!_[_0xc094('0x6f')](_0x321652)){var _0x14b39b=toCsv(_0x321652);var _0x24f12d=Date[_0xc094('0x70')]();fs['writeFileSync'](util['format'](_0xc094('0x71'),_0x45b875[_0xc094('0x54')]['id'],_0x24f12d),_0x14b39b);_0x1b9316[_0xc094('0x72')](_0xc094('0x73'),'attachment;\x20filename='+util[_0xc094('0x74')](_0xc094('0x75'),_0x45b875[_0xc094('0x54')]['id'],_0x24f12d));_0x1b9316[_0xc094('0x72')](_0xc094('0x76'),'text/csv');return _0x1b9316[_0xc094('0x77')](util[_0xc094('0x74')](_0xc094('0x71'),_0x45b875[_0xc094('0x54')]['id'],_0x24f12d));}else{return _0x1b9316[_0xc094('0x18')](0xcc);}})[_0xc094('0x43')](handleError(_0x1b9316,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 382e17b..cbf414b 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 _0x615a=['path','../../config/environment','./jscriptyProject.attributes','define','JscriptyProject','jscripty_projects','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x31d3b8,_0xd47928){var _0x258cac=function(_0x5a2cc0){while(--_0x5a2cc0){_0x31d3b8['push'](_0x31d3b8['shift']());}};_0x258cac(++_0xd47928);}(_0x615a,0x119));var _0xa615=function(_0x29a134,_0x194c27){_0x29a134=_0x29a134-0x0;var _0x136398=_0x615a[_0x29a134];return _0x136398;};'use strict';var _=require(_0xa615('0x0'));var util=require('util');var logger=require(_0xa615('0x1'))('api');var moment=require(_0xa615('0x2'));var BPromise=require(_0xa615('0x3'));var rp=require(_0xa615('0x4'));var fs=require('fs');var path=require(_0xa615('0x5'));var rimraf=require('rimraf');var config=require(_0xa615('0x6'));var attributes=require(_0xa615('0x7'));module['exports']=function(_0x320680,_0x5d04bd){return _0x320680[_0xa615('0x8')](_0xa615('0x9'),attributes,{'tableName':_0xa615('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xff2a=['bluebird','path','../../config/environment','./jscriptyProject.attributes','define','JscriptyProject','jscripty_projects','util','../../config/logger','moment'];(function(_0x59a3e9,_0x27fb38){var _0x5179ac=function(_0x5a9b1c){while(--_0x5a9b1c){_0x59a3e9['push'](_0x59a3e9['shift']());}};_0x5179ac(++_0x27fb38);}(_0xff2a,0x93));var _0xaff2=function(_0x28611e,_0x586726){_0x28611e=_0x28611e-0x0;var _0x530f69=_0xff2a[_0x28611e];return _0x530f69;};'use strict';var _=require('lodash');var util=require(_0xaff2('0x0'));var logger=require(_0xaff2('0x1'))('api');var moment=require(_0xaff2('0x2'));var BPromise=require(_0xaff2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaff2('0x4'));var rimraf=require('rimraf');var config=require(_0xaff2('0x5'));var attributes=require(_0xaff2('0x6'));module['exports']=function(_0x70cadf,_0x8313e5){return _0x70cadf[_0xaff2('0x7')](_0xaff2('0x8'),attributes,{'tableName':_0xaff2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index 3be117a..684360c 100644 --- a/server/api/jscriptyProject/jscriptyProject.rpc.js +++ b/server/api/jscriptyProject/jscriptyProject.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb43b=['rpc','../../config/environment','http','request','info','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','JscriptyProject,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x27f8e7,_0x31da53){var _0x4479fb=function(_0x433495){while(--_0x433495){_0x27f8e7['push'](_0x27f8e7['shift']());}};_0x4479fb(++_0x31da53);}(_0xb43b,0x1b2));var _0xbb43=function(_0x12045e,_0x1c7d4d){_0x12045e=_0x12045e-0x0;var _0xd76148=_0xb43b[_0x12045e];return _0xd76148;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var moment=require('moment');var BPromise=require(_0xbb43('0x2'));var rs=require(_0xbb43('0x3'));var fs=require('fs');var Redis=require(_0xbb43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb43('0x5'));var logger=require(_0xbb43('0x6'))(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbb43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x553520,_0x80fe61,_0x1ccd49){return new BPromise(function(_0x2a2f11,_0x29ae1a){return client[_0xbb43('0xa')](_0x553520,_0x1ccd49)['then'](function(_0x208c2b){logger[_0xbb43('0xb')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0xbb43('0xc'));logger[_0xbb43('0xd')](_0xbb43('0xe'),_0x80fe61,_0xbb43('0xc'),JSON[_0xbb43('0xf')](_0x208c2b));if(_0x208c2b[_0xbb43('0x10')]){if(_0x208c2b['error'][_0xbb43('0x11')]===0x1f4){logger[_0xbb43('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0x208c2b[_0xbb43('0x10')][_0xbb43('0x12')]);return _0x2a2f11(_0x208c2b['error']['message']);}else{logger['info'](_0xbb43('0x13'),_0x80fe61,_0xbb43('0xc'));_0x2a2f11(_0x208c2b['result']['message']);}})[_0xbb43('0x14')](function(_0x563ce1){logger['error'](_0xbb43('0x13'),_0x80fe61,_0x563ce1);_0x29ae1a(_0x563ce1);});});} \ No newline at end of file +var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s'];(function(_0x305b28,_0x32af9e){var _0x2d62fd=function(_0x17ce9a){while(--_0x17ce9a){_0x305b28['push'](_0x305b28['shift']());}};_0x2d62fd(++_0x32af9e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x57e00e,_0x36e79a){_0x57e00e=_0x57e00e-0x0;var _0x415e60=_0xcb91[_0x57e00e];return _0x415e60;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 64135a9..63d36fc 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 _0xc926=['/:id','show','create','put','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','index','/describe','isAuthenticated','describe'];(function(_0x1a82a6,_0x5b5933){var _0x5ec81b=function(_0x1dd31){while(--_0x1dd31){_0x1a82a6['push'](_0x1a82a6['shift']());}};_0x5ec81b(++_0x5b5933);}(_0xc926,0x197));var _0x6c92=function(_0x57efc,_0x5ed6c3){_0x57efc=_0x57efc-0x0;var _0x3d7076=_0xc926[_0x57efc];return _0x3d7076;};'use strict';var multer=require(_0x6c92('0x0'));var util=require(_0x6c92('0x1'));var path=require(_0x6c92('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6c92('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6c92('0x4'));var interaction=require(_0x6c92('0x5'));var config=require(_0x6c92('0x6'));var controller=require(_0x6c92('0x7'));router[_0x6c92('0x8')]('/',auth['isAuthenticated'](),controller[_0x6c92('0x9')]);router[_0x6c92('0x8')](_0x6c92('0xa'),auth[_0x6c92('0xb')](),controller[_0x6c92('0xc')]);router[_0x6c92('0x8')](_0x6c92('0xd'),auth[_0x6c92('0xb')](),controller[_0x6c92('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6c92('0xf')]);router[_0x6c92('0x10')](_0x6c92('0xd'),auth[_0x6c92('0xb')](),controller['update']);router[_0x6c92('0x11')](_0x6c92('0xd'),auth[_0x6c92('0xb')](),controller[_0x6c92('0x12')]);module[_0x6c92('0x13')]=router; \ No newline at end of file +var _0x5d12=['/describe','describe','show','post','create','put','/:id','update','delete','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index'];(function(_0x9039e6,_0x939aaf){var _0x777cd7=function(_0x4b0c6f){while(--_0x4b0c6f){_0x9039e6['push'](_0x9039e6['shift']());}};_0x777cd7(++_0x939aaf);}(_0x5d12,0x155));var _0x25d1=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0x5d12[_0x342baa];return _0x1208f3;};'use strict';var multer=require(_0x25d1('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x25d1('0x1'));var express=require(_0x25d1('0x2'));var router=express['Router']();var fs_extra=require(_0x25d1('0x3'));var auth=require(_0x25d1('0x4'));var interaction=require(_0x25d1('0x5'));var config=require(_0x25d1('0x6'));var controller=require(_0x25d1('0x7'));router[_0x25d1('0x8')]('/',auth[_0x25d1('0x9')](),controller[_0x25d1('0xa')]);router[_0x25d1('0x8')](_0x25d1('0xb'),auth[_0x25d1('0x9')](),controller[_0x25d1('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x25d1('0xd')]);router[_0x25d1('0xe')]('/',auth['isAuthenticated'](),controller[_0x25d1('0xf')]);router[_0x25d1('0x10')](_0x25d1('0x11'),auth[_0x25d1('0x9')](),controller[_0x25d1('0x12')]);router[_0x25d1('0x13')](_0x25d1('0x11'),auth[_0x25d1('0x9')](),controller[_0x25d1('0x14')]);module[_0x25d1('0x15')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 891a5c8..fbb3ca1 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(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x7a54,0x106));var _0x47a5=function(_0x33b8a5,_0x130d9b){_0x33b8a5=_0x33b8a5-0x0;var _0x5db690=_0x7a54[_0x33b8a5];return _0x5db690;};'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(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x7a54,0x106));var _0x47a5=function(_0x18c8af,_0x240e66){_0x18c8af=_0x18c8af-0x0;var _0x245826=_0x7a54[_0x18c8af];return _0x245826;};'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 de78091..2274cea 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 _0xc3f4=['describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','count','Content-Range','apply','update','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','JscriptyQuestionReport','includeAll','include','findAll','rows','catch','params','find','create','body','destroy'];(function(_0x283f1e,_0x1dd306){var _0x1bed91=function(_0x1db0ee){while(--_0x1db0ee){_0x283f1e['push'](_0x283f1e['shift']());}};_0x1bed91(++_0x1dd306);}(_0xc3f4,0x93));var _0x4c3f=function(_0x46471e,_0x49bbcb){_0x46471e=_0x46471e-0x0;var _0xd665f8=_0xc3f4[_0x46471e];return _0xd665f8;};'use strict';var emlformat=require(_0x4c3f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4c3f('0x1'));var jsonpatch=require(_0x4c3f('0x2'));var rp=require(_0x4c3f('0x3'));var moment=require(_0x4c3f('0x4'));var BPromise=require(_0x4c3f('0x5'));var Mustache=require(_0x4c3f('0x6'));var util=require(_0x4c3f('0x7'));var path=require(_0x4c3f('0x8'));var sox=require(_0x4c3f('0x9'));var csv=require(_0x4c3f('0xa'));var ejs=require(_0x4c3f('0xb'));var fs=require('fs');var fs_extra=require(_0x4c3f('0xc'));var _=require(_0x4c3f('0xd'));var squel=require(_0x4c3f('0xe'));var crypto=require(_0x4c3f('0xf'));var jsforce=require(_0x4c3f('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x4c3f('0xa'));var querystring=require('querystring');var Papa=require(_0x4c3f('0x11'));var Redis=require('ioredis');var authService=require(_0x4c3f('0x12'));var qs=require(_0x4c3f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4c3f('0x14'))(_0x4c3f('0x15'));var utils=require(_0x4c3f('0x16'));var config=require(_0x4c3f('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x4c3f('0x18'))['db'];function respondWithStatusCode(_0xc81c65,_0x10c1c3){_0x10c1c3=_0x10c1c3||0xcc;return function(_0x28b8dc){if(_0x28b8dc){return _0xc81c65['sendStatus'](_0x10c1c3);}return _0xc81c65[_0x4c3f('0x19')](_0x10c1c3)[_0x4c3f('0x1a')]();};}function respondWithResult(_0x30182e,_0xd98e50){_0xd98e50=_0xd98e50||0xc8;return function(_0x3d7140){if(_0x3d7140){return _0x30182e[_0x4c3f('0x19')](_0xd98e50)[_0x4c3f('0x1b')](_0x3d7140);}};}function respondWithFilteredResult(_0xbd2f4a,_0x15b54e){return function(_0x220c90){if(_0x220c90){var _0xd70bea=typeof _0x15b54e[_0x4c3f('0x1c')]==='undefined'&&typeof _0x15b54e['limit']==='undefined';var _0xc128a7=_0x220c90[_0x4c3f('0x1d')];var _0x215881=_0xd70bea?0x0:_0x15b54e[_0x4c3f('0x1c')];var _0x1f32ba=_0xd70bea?_0x220c90[_0x4c3f('0x1d')]:_0x15b54e[_0x4c3f('0x1c')]+_0x15b54e['limit'];var _0x4b9c4e;if(_0x1f32ba>=_0xc128a7){_0x1f32ba=_0xc128a7;_0x4b9c4e=0xc8;}else{_0x4b9c4e=0xce;}_0xbd2f4a[_0x4c3f('0x19')](_0x4b9c4e);return _0xbd2f4a['set'](_0x4c3f('0x1e'),_0x215881+'-'+_0x1f32ba+'/'+_0xc128a7)[_0x4c3f('0x1b')](_0x220c90);}return null;};}function patchUpdates(_0x1babe8){return function(_0x1c59dd){try{jsonpatch[_0x4c3f('0x1f')](_0x1c59dd,_0x1babe8,!![]);}catch(_0xb9d64){return BPromise['reject'](_0xb9d64);}return _0x1c59dd['save']();};}function saveUpdates(_0x139d1d,_0x26af7){return function(_0x3965e1){if(_0x3965e1){return _0x3965e1[_0x4c3f('0x20')](_0x139d1d)[_0x4c3f('0x21')](function(_0x5ea1e3){return _0x5ea1e3;});}return null;};}function removeEntity(_0x540e11,_0x40b463){return function(_0x5c7cf4){if(_0x5c7cf4){return _0x5c7cf4['destroy']()[_0x4c3f('0x21')](function(){_0x540e11[_0x4c3f('0x19')](0xcc)[_0x4c3f('0x1a')]();});}};}function handleEntityNotFound(_0x35a4ef,_0x3198fd){return function(_0x3b5eaf){if(!_0x3b5eaf){_0x35a4ef['sendStatus'](0x194);}return _0x3b5eaf;};}function handleError(_0x5e10de,_0x16446e){_0x16446e=_0x16446e||0x1f4;return function(_0x352d62){logger['error'](_0x352d62[_0x4c3f('0x22')]);if(_0x352d62[_0x4c3f('0x23')]){delete _0x352d62[_0x4c3f('0x23')];}_0x5e10de[_0x4c3f('0x19')](_0x16446e)[_0x4c3f('0x24')](_0x352d62);};}exports[_0x4c3f('0x25')]=function(_0xd3548c,_0x47e439){var _0xa024e0={},_0x50c7e0={},_0x20db76={'count':0x0,'rows':[]};var _0x2b838a=_[_0x4c3f('0x26')](db['JscriptyQuestionReport'][_0x4c3f('0x27')],function(_0x1a00e5){return{'name':_0x1a00e5[_0x4c3f('0x28')],'type':_0x1a00e5[_0x4c3f('0x29')][_0x4c3f('0x2a')]};});_0x50c7e0[_0x4c3f('0x2b')]=_[_0x4c3f('0x26')](_0x2b838a,'name');_0x50c7e0[_0x4c3f('0x2c')]=_[_0x4c3f('0x2d')](_0xd3548c['query']);_0x50c7e0[_0x4c3f('0x2e')]=_['intersection'](_0x50c7e0[_0x4c3f('0x2b')],_0x50c7e0[_0x4c3f('0x2c')]);_0xa024e0[_0x4c3f('0x2f')]=_[_0x4c3f('0x30')](_0x50c7e0[_0x4c3f('0x2b')],qs['fields'](_0xd3548c[_0x4c3f('0x2c')][_0x4c3f('0x31')]));_0xa024e0['attributes']=_0xa024e0[_0x4c3f('0x2f')][_0x4c3f('0x32')]?_0xa024e0[_0x4c3f('0x2f')]:_0x50c7e0[_0x4c3f('0x2b')];if(!_0xd3548c['query'][_0x4c3f('0x33')]('nolimit')){_0xa024e0[_0x4c3f('0x34')]=qs[_0x4c3f('0x34')](_0xd3548c[_0x4c3f('0x2c')][_0x4c3f('0x34')]);_0xa024e0['offset']=qs[_0x4c3f('0x1c')](_0xd3548c[_0x4c3f('0x2c')][_0x4c3f('0x1c')]);}_0xa024e0[_0x4c3f('0x35')]=qs['sort'](_0xd3548c[_0x4c3f('0x2c')][_0x4c3f('0x36')]);_0xa024e0[_0x4c3f('0x37')]=qs['filters'](_[_0x4c3f('0x38')](_0xd3548c[_0x4c3f('0x2c')],_0x50c7e0[_0x4c3f('0x2e')]),_0x2b838a);if(_0xd3548c[_0x4c3f('0x2c')][_0x4c3f('0x39')]){_0xa024e0[_0x4c3f('0x37')]=_[_0x4c3f('0x3a')](_0xa024e0[_0x4c3f('0x37')],{'$or':_[_0x4c3f('0x26')](_0x2b838a,function(_0x5cf0ba){if(_0x5cf0ba[_0x4c3f('0x29')]!==_0x4c3f('0x3b')){var _0x5ad549={};_0x5ad549[_0x5cf0ba['name']]={'$like':'%'+_0xd3548c['query'][_0x4c3f('0x39')]+'%'};return _0x5ad549;}})});}_0xa024e0=_[_0x4c3f('0x3a')]({},_0xa024e0,_0xd3548c[_0x4c3f('0x3c')]);var _0x5c5449={'where':_0xa024e0[_0x4c3f('0x37')]};return db[_0x4c3f('0x3d')][_0x4c3f('0x1d')](_0x5c5449)['then'](function(_0x111ed9){_0x20db76[_0x4c3f('0x1d')]=_0x111ed9;if(_0xd3548c[_0x4c3f('0x2c')][_0x4c3f('0x3e')]){_0xa024e0[_0x4c3f('0x3f')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x4c3f('0x40')](_0xa024e0);})[_0x4c3f('0x21')](function(_0xc419ba){_0x20db76[_0x4c3f('0x41')]=_0xc419ba;return _0x20db76;})['then'](respondWithFilteredResult(_0x47e439,_0xa024e0))[_0x4c3f('0x42')](handleError(_0x47e439,null));};exports['show']=function(_0x38e05c,_0x55dcee){var _0x2178bb={'raw':!![],'where':{'id':_0x38e05c[_0x4c3f('0x43')]['id']}},_0x3b2ed9={};_0x3b2ed9['model']=_[_0x4c3f('0x2d')](db[_0x4c3f('0x3d')][_0x4c3f('0x27')]);_0x3b2ed9['query']=_[_0x4c3f('0x2d')](_0x38e05c[_0x4c3f('0x2c')]);_0x3b2ed9[_0x4c3f('0x2e')]=_[_0x4c3f('0x30')](_0x3b2ed9[_0x4c3f('0x2b')],_0x3b2ed9['query']);_0x2178bb[_0x4c3f('0x2f')]=_[_0x4c3f('0x30')](_0x3b2ed9['model'],qs[_0x4c3f('0x31')](_0x38e05c[_0x4c3f('0x2c')][_0x4c3f('0x31')]));_0x2178bb[_0x4c3f('0x2f')]=_0x2178bb[_0x4c3f('0x2f')][_0x4c3f('0x32')]?_0x2178bb[_0x4c3f('0x2f')]:_0x3b2ed9[_0x4c3f('0x2b')];if(_0x38e05c[_0x4c3f('0x2c')][_0x4c3f('0x3e')]){_0x2178bb['include']=[{'all':!![]}];}_0x2178bb=_[_0x4c3f('0x3a')]({},_0x2178bb,_0x38e05c[_0x4c3f('0x3c')]);return db[_0x4c3f('0x3d')][_0x4c3f('0x44')](_0x2178bb)['then'](handleEntityNotFound(_0x55dcee,null))[_0x4c3f('0x21')](respondWithResult(_0x55dcee,null))[_0x4c3f('0x42')](handleError(_0x55dcee,null));};exports[_0x4c3f('0x45')]=function(_0x4805e2,_0x4bb7bf){return db[_0x4c3f('0x3d')][_0x4c3f('0x45')](_0x4805e2[_0x4c3f('0x46')],{})[_0x4c3f('0x21')](respondWithResult(_0x4bb7bf,0xc9))[_0x4c3f('0x42')](handleError(_0x4bb7bf,null));};exports[_0x4c3f('0x20')]=function(_0x4059d9,_0x4d56f2){if(_0x4059d9[_0x4c3f('0x46')]['id']){delete _0x4059d9[_0x4c3f('0x46')]['id'];}return db[_0x4c3f('0x3d')][_0x4c3f('0x44')]({'where':{'id':_0x4059d9[_0x4c3f('0x43')]['id']}})[_0x4c3f('0x21')](handleEntityNotFound(_0x4d56f2,null))['then'](saveUpdates(_0x4059d9[_0x4c3f('0x46')],null))[_0x4c3f('0x21')](respondWithResult(_0x4d56f2,null))[_0x4c3f('0x42')](handleError(_0x4d56f2,null));};exports[_0x4c3f('0x47')]=function(_0x18ce21,_0x5d993d){return db['JscriptyQuestionReport'][_0x4c3f('0x44')]({'where':{'id':_0x18ce21[_0x4c3f('0x43')]['id']}})[_0x4c3f('0x21')](handleEntityNotFound(_0x5d993d,null))[_0x4c3f('0x21')](removeEntity(_0x5d993d,null))['catch'](handleError(_0x5d993d,null));};exports['describe']=function(_0x428efa,_0x382eee){return db['JscriptyQuestionReport'][_0x4c3f('0x48')]()['then'](respondWithResult(_0x382eee,null))[_0x4c3f('0x42')](handleError(_0x382eee,null));}; \ No newline at end of file +var _0x3958=['fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','JscriptyQuestionReport','fieldName','type','key','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','show','rawAttributes','find','catch','create','body','params','destroy','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs'];(function(_0x20d057,_0x1f77a9){var _0x1694df=function(_0x436b50){while(--_0x436b50){_0x20d057['push'](_0x20d057['shift']());}};_0x1694df(++_0x1f77a9);}(_0x3958,0xe0));var _0x8395=function(_0x211a04,_0x12dd63){_0x211a04=_0x211a04-0x0;var _0x39b04d=_0x3958[_0x211a04];return _0x39b04d;};'use strict';var emlformat=require(_0x8395('0x0'));var rimraf=require(_0x8395('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8395('0x2'));var moment=require(_0x8395('0x3'));var BPromise=require(_0x8395('0x4'));var Mustache=require(_0x8395('0x5'));var util=require(_0x8395('0x6'));var path=require(_0x8395('0x7'));var sox=require(_0x8395('0x8'));var csv=require('to-csv');var ejs=require(_0x8395('0x9'));var fs=require('fs');var fs_extra=require(_0x8395('0xa'));var _=require(_0x8395('0xb'));var squel=require(_0x8395('0xc'));var crypto=require(_0x8395('0xd'));var jsforce=require(_0x8395('0xe'));var deskjs=require(_0x8395('0xf'));var toCsv=require(_0x8395('0x10'));var querystring=require(_0x8395('0x11'));var Papa=require(_0x8395('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8395('0x13'));var as=require(_0x8395('0x14'));var hardwareService=require(_0x8395('0x15'));var logger=require(_0x8395('0x16'))(_0x8395('0x17'));var utils=require(_0x8395('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x8395('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4fd0b5,_0x5e1680){_0x5e1680=_0x5e1680||0xcc;return function(_0xc8c441){if(_0xc8c441){return _0x4fd0b5[_0x8395('0x1a')](_0x5e1680);}return _0x4fd0b5[_0x8395('0x1b')](_0x5e1680)[_0x8395('0x1c')]();};}function respondWithResult(_0x1d4fb8,_0xb2be1d){_0xb2be1d=_0xb2be1d||0xc8;return function(_0x390399){if(_0x390399){return _0x1d4fb8[_0x8395('0x1b')](_0xb2be1d)[_0x8395('0x1d')](_0x390399);}};}function respondWithFilteredResult(_0xfc43ea,_0x15c6b8){return function(_0x4df943){if(_0x4df943){var _0x287778=typeof _0x15c6b8[_0x8395('0x1e')]===_0x8395('0x1f')&&typeof _0x15c6b8[_0x8395('0x20')]===_0x8395('0x1f');var _0x373086=_0x4df943[_0x8395('0x21')];var _0x1edd63=_0x287778?0x0:_0x15c6b8[_0x8395('0x1e')];var _0x5ac169=_0x287778?_0x4df943['count']:_0x15c6b8[_0x8395('0x1e')]+_0x15c6b8[_0x8395('0x20')];var _0x1a0d00;if(_0x5ac169>=_0x373086){_0x5ac169=_0x373086;_0x1a0d00=0xc8;}else{_0x1a0d00=0xce;}_0xfc43ea[_0x8395('0x1b')](_0x1a0d00);return _0xfc43ea[_0x8395('0x22')](_0x8395('0x23'),_0x1edd63+'-'+_0x5ac169+'/'+_0x373086)['json'](_0x4df943);}return null;};}function patchUpdates(_0x102226){return function(_0x388c3f){try{jsonpatch[_0x8395('0x24')](_0x388c3f,_0x102226,!![]);}catch(_0x33bb13){return BPromise[_0x8395('0x25')](_0x33bb13);}return _0x388c3f[_0x8395('0x26')]();};}function saveUpdates(_0x2775e7,_0x300d1b){return function(_0xb31203){if(_0xb31203){return _0xb31203[_0x8395('0x27')](_0x2775e7)[_0x8395('0x28')](function(_0x283a31){return _0x283a31;});}return null;};}function removeEntity(_0x81a2e0,_0x1eb2cd){return function(_0x29074b){if(_0x29074b){return _0x29074b['destroy']()[_0x8395('0x28')](function(){_0x81a2e0[_0x8395('0x1b')](0xcc)[_0x8395('0x1c')]();});}};}function handleEntityNotFound(_0x19116b,_0x5523d6){return function(_0x5d0a17){if(!_0x5d0a17){_0x19116b['sendStatus'](0x194);}return _0x5d0a17;};}function handleError(_0x3dde13,_0x31308f){_0x31308f=_0x31308f||0x1f4;return function(_0x2f3665){logger[_0x8395('0x29')](_0x2f3665[_0x8395('0x2a')]);if(_0x2f3665['name']){delete _0x2f3665[_0x8395('0x2b')];}_0x3dde13[_0x8395('0x1b')](_0x31308f)['send'](_0x2f3665);};}exports[_0x8395('0x2c')]=function(_0x4c9478,_0xa6c92f){var _0x487741={},_0x2a69c9={},_0x5caee3={'count':0x0,'rows':[]};var _0x353e06=_['map'](db[_0x8395('0x2d')]['rawAttributes'],function(_0x88c6fd){return{'name':_0x88c6fd[_0x8395('0x2e')],'type':_0x88c6fd[_0x8395('0x2f')][_0x8395('0x30')]};});_0x2a69c9['model']=_[_0x8395('0x31')](_0x353e06,_0x8395('0x2b'));_0x2a69c9[_0x8395('0x32')]=_[_0x8395('0x33')](_0x4c9478[_0x8395('0x32')]);_0x2a69c9[_0x8395('0x34')]=_[_0x8395('0x35')](_0x2a69c9['model'],_0x2a69c9['query']);_0x487741[_0x8395('0x36')]=_[_0x8395('0x35')](_0x2a69c9[_0x8395('0x37')],qs[_0x8395('0x38')](_0x4c9478[_0x8395('0x32')]['fields']));_0x487741[_0x8395('0x36')]=_0x487741[_0x8395('0x36')][_0x8395('0x39')]?_0x487741[_0x8395('0x36')]:_0x2a69c9[_0x8395('0x37')];if(!_0x4c9478[_0x8395('0x32')][_0x8395('0x3a')](_0x8395('0x3b'))){_0x487741[_0x8395('0x20')]=qs[_0x8395('0x20')](_0x4c9478[_0x8395('0x32')]['limit']);_0x487741['offset']=qs[_0x8395('0x1e')](_0x4c9478[_0x8395('0x32')][_0x8395('0x1e')]);}_0x487741[_0x8395('0x3c')]=qs[_0x8395('0x3d')](_0x4c9478['query'][_0x8395('0x3d')]);_0x487741[_0x8395('0x3e')]=qs[_0x8395('0x34')](_[_0x8395('0x3f')](_0x4c9478[_0x8395('0x32')],_0x2a69c9[_0x8395('0x34')]),_0x353e06);if(_0x4c9478[_0x8395('0x32')][_0x8395('0x40')]){_0x487741[_0x8395('0x3e')]=_[_0x8395('0x41')](_0x487741[_0x8395('0x3e')],{'$or':_[_0x8395('0x31')](_0x353e06,function(_0xbd5e37){if(_0xbd5e37['type']!==_0x8395('0x42')){var _0x5684bc={};_0x5684bc[_0xbd5e37['name']]={'$like':'%'+_0x4c9478['query']['filter']+'%'};return _0x5684bc;}})});}_0x487741=_[_0x8395('0x41')]({},_0x487741,_0x4c9478['options']);var _0x4c7cce={'where':_0x487741[_0x8395('0x3e')]};return db['JscriptyQuestionReport'][_0x8395('0x21')](_0x4c7cce)[_0x8395('0x28')](function(_0x1831bf){_0x5caee3['count']=_0x1831bf;if(_0x4c9478[_0x8395('0x32')][_0x8395('0x43')]){_0x487741['include']=[{'all':!![]}];}return db[_0x8395('0x2d')][_0x8395('0x44')](_0x487741);})[_0x8395('0x28')](function(_0x56e763){_0x5caee3[_0x8395('0x45')]=_0x56e763;return _0x5caee3;})[_0x8395('0x28')](respondWithFilteredResult(_0xa6c92f,_0x487741))['catch'](handleError(_0xa6c92f,null));};exports[_0x8395('0x46')]=function(_0x467eae,_0x7ef70b){var _0x10a308={'raw':!![],'where':{'id':_0x467eae['params']['id']}},_0x287101={};_0x287101[_0x8395('0x37')]=_[_0x8395('0x33')](db[_0x8395('0x2d')][_0x8395('0x47')]);_0x287101[_0x8395('0x32')]=_[_0x8395('0x33')](_0x467eae[_0x8395('0x32')]);_0x287101[_0x8395('0x34')]=_[_0x8395('0x35')](_0x287101[_0x8395('0x37')],_0x287101[_0x8395('0x32')]);_0x10a308[_0x8395('0x36')]=_[_0x8395('0x35')](_0x287101['model'],qs[_0x8395('0x38')](_0x467eae[_0x8395('0x32')]['fields']));_0x10a308['attributes']=_0x10a308[_0x8395('0x36')]['length']?_0x10a308[_0x8395('0x36')]:_0x287101['model'];if(_0x467eae['query'][_0x8395('0x43')]){_0x10a308['include']=[{'all':!![]}];}_0x10a308=_[_0x8395('0x41')]({},_0x10a308,_0x467eae['options']);return db[_0x8395('0x2d')][_0x8395('0x48')](_0x10a308)[_0x8395('0x28')](handleEntityNotFound(_0x7ef70b,null))[_0x8395('0x28')](respondWithResult(_0x7ef70b,null))[_0x8395('0x49')](handleError(_0x7ef70b,null));};exports[_0x8395('0x4a')]=function(_0x30fe62,_0x2ed6a8){return db[_0x8395('0x2d')]['create'](_0x30fe62['body'],{})['then'](respondWithResult(_0x2ed6a8,0xc9))[_0x8395('0x49')](handleError(_0x2ed6a8,null));};exports[_0x8395('0x27')]=function(_0x2aafa,_0x3d22e8){if(_0x2aafa[_0x8395('0x4b')]['id']){delete _0x2aafa[_0x8395('0x4b')]['id'];}return db[_0x8395('0x2d')][_0x8395('0x48')]({'where':{'id':_0x2aafa[_0x8395('0x4c')]['id']}})[_0x8395('0x28')](handleEntityNotFound(_0x3d22e8,null))[_0x8395('0x28')](saveUpdates(_0x2aafa[_0x8395('0x4b')],null))[_0x8395('0x28')](respondWithResult(_0x3d22e8,null))[_0x8395('0x49')](handleError(_0x3d22e8,null));};exports[_0x8395('0x4d')]=function(_0x3dc467,_0x13449c){return db[_0x8395('0x2d')]['find']({'where':{'id':_0x3dc467[_0x8395('0x4c')]['id']}})['then'](handleEntityNotFound(_0x13449c,null))[_0x8395('0x28')](removeEntity(_0x13449c,null))[_0x8395('0x49')](handleError(_0x13449c,null));};exports['describe']=function(_0x32acba,_0x842de2){return db['JscriptyQuestionReport']['describe']()[_0x8395('0x28')](respondWithResult(_0x842de2,null))[_0x8395('0x49')](handleError(_0x842de2,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 63afcfc..97bab9e 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 _0x0945=['report_jscripty_questions','lodash','util','moment','bluebird','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport'];(function(_0x271060,_0x3f86b1){var _0x40540b=function(_0x1735a7){while(--_0x1735a7){_0x271060['push'](_0x271060['shift']());}};_0x40540b(++_0x3f86b1);}(_0x0945,0x1a5));var _0x5094=function(_0x4fadb8,_0x11b539){_0x4fadb8=_0x4fadb8-0x0;var _0x3c9e20=_0x0945[_0x4fadb8];return _0x3c9e20;};'use strict';var _=require(_0x5094('0x0'));var util=require(_0x5094('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5094('0x2'));var BPromise=require(_0x5094('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5094('0x4'));var attributes=require(_0x5094('0x5'));module[_0x5094('0x6')]=function(_0x3c1ea5,_0x3149bd){return _0x3c1ea5[_0x5094('0x7')](_0x5094('0x8'),attributes,{'tableName':_0x5094('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5568=['api','bluebird','request-promise','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','util'];(function(_0x4df0fd,_0x32e558){var _0x1fabf6=function(_0x13d985){while(--_0x13d985){_0x4df0fd['push'](_0x4df0fd['shift']());}};_0x1fabf6(++_0x32e558);}(_0x5568,0x7d));var _0x8556=function(_0x19090d,_0x5351e3){_0x19090d=_0x19090d-0x0;var _0x10ea35=_0x5568[_0x19090d];return _0x10ea35;};'use strict';var _=require('lodash');var util=require(_0x8556('0x0'));var logger=require('../../config/logger')(_0x8556('0x1'));var moment=require('moment');var BPromise=require(_0x8556('0x2'));var rp=require(_0x8556('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8556('0x4'));module[_0x8556('0x5')]=function(_0x303f85,_0x5efe45){return _0x303f85[_0x8556('0x6')](_0x8556('0x7'),attributes,{'tableName':_0x8556('0x8'),'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 c794db9..bae3957 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 _0x34b3=['randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','error','message','info','result','lodash','moment','bluebird'];(function(_0x36e421,_0x25e3f2){var _0x54b166=function(_0x499cf8){while(--_0x499cf8){_0x36e421['push'](_0x36e421['shift']());}};_0x54b166(++_0x25e3f2);}(_0x34b3,0x95));var _0x334b=function(_0x100008,_0x2db055){_0x100008=_0x100008-0x0;var _0x5a55ee=_0x34b3[_0x100008];return _0x5a55ee;};'use strict';var _=require(_0x334b('0x0'));var util=require('util');var moment=require(_0x334b('0x1'));var BPromise=require(_0x334b('0x2'));var rs=require(_0x334b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x334b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x334b('0x5'))(_0x334b('0x6'));var config=require(_0x334b('0x7'));var jayson=require(_0x334b('0x8'));var client=jayson[_0x334b('0x9')][_0x334b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x30339e,_0x3c0728,_0x44181c){return new BPromise(function(_0x2e3e37,_0x27fcc1){return client[_0x334b('0xb')](_0x30339e,_0x44181c)[_0x334b('0xc')](function(_0x4e39b6){logger['info'](_0x334b('0xd'),_0x3c0728,_0x334b('0xe'));logger['debug']('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x3c0728,'request\x20sent',JSON['stringify'](_0x4e39b6));if(_0x4e39b6[_0x334b('0xf')]){if(_0x4e39b6[_0x334b('0xf')]['code']===0x1f4){logger[_0x334b('0xf')](_0x334b('0xd'),_0x3c0728,_0x4e39b6[_0x334b('0xf')][_0x334b('0x10')]);return _0x27fcc1(_0x4e39b6[_0x334b('0xf')][_0x334b('0x10')]);}logger[_0x334b('0xf')](_0x334b('0xd'),_0x3c0728,_0x4e39b6[_0x334b('0xf')][_0x334b('0x10')]);return _0x2e3e37(_0x4e39b6['error'][_0x334b('0x10')]);}else{logger[_0x334b('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x3c0728,_0x334b('0xe'));_0x2e3e37(_0x4e39b6[_0x334b('0x12')][_0x334b('0x10')]);}})['catch'](function(_0x515674){logger[_0x334b('0xf')](_0x334b('0xd'),_0x3c0728,_0x515674);_0x27fcc1(_0x515674);});});} \ No newline at end of file +var _0x61ca=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x2c869d,_0x139e0f){var _0xd36b5c=function(_0x1a0b4e){while(--_0x1a0b4e){_0x2c869d['push'](_0x2c869d['shift']());}};_0xd36b5c(++_0x139e0f);}(_0x61ca,0x1cc));var _0xa61c=function(_0x265094,_0x18c961){_0x265094=_0x265094-0x0;var _0x71f9c2=_0x61ca[_0x265094];return _0x71f9c2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa61c('0x0'));var BPromise=require(_0xa61c('0x1'));var rs=require(_0xa61c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa61c('0x3'))['db'];var utils=require(_0xa61c('0x4'));var logger=require(_0xa61c('0x5'))(_0xa61c('0x6'));var config=require(_0xa61c('0x7'));var jayson=require(_0xa61c('0x8'));var client=jayson[_0xa61c('0x9')][_0xa61c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3db793,_0x434657,_0x3104bc){return new BPromise(function(_0x26b6c5,_0x50a958){return client['request'](_0x3db793,_0x3104bc)[_0xa61c('0xb')](function(_0x4ff021){logger[_0xa61c('0xc')](_0xa61c('0xd'),_0x434657,_0xa61c('0xe'));logger[_0xa61c('0xf')](_0xa61c('0x10'),_0x434657,_0xa61c('0xe'),JSON[_0xa61c('0x11')](_0x4ff021));if(_0x4ff021[_0xa61c('0x12')]){if(_0x4ff021['error'][_0xa61c('0x13')]===0x1f4){logger[_0xa61c('0x12')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x434657,_0x4ff021[_0xa61c('0x12')]['message']);return _0x50a958(_0x4ff021['error'][_0xa61c('0x14')]);}logger[_0xa61c('0x12')](_0xa61c('0xd'),_0x434657,_0x4ff021[_0xa61c('0x12')][_0xa61c('0x14')]);return _0x26b6c5(_0x4ff021['error'][_0xa61c('0x14')]);}else{logger['info'](_0xa61c('0xd'),_0x434657,_0xa61c('0xe'));_0x26b6c5(_0x4ff021[_0xa61c('0x15')][_0xa61c('0x14')]);}})[_0xa61c('0x16')](function(_0x5ad89e){logger['error'](_0xa61c('0xd'),_0x434657,_0x5ad89e);_0x50a958(_0x5ad89e);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index dd8e388..ad4aff8 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 _0xabd0=['../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','/:id','show','getQuestions','post','create','put','update','delete','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1cc925,_0x4c59a1){var _0x5a2e6c=function(_0x426cfb){while(--_0x426cfb){_0x1cc925['push'](_0x1cc925['shift']());}};_0x5a2e6c(++_0x4c59a1);}(_0xabd0,0x16f));var _0x0abd=function(_0x4b9ba7,_0x4d368f){_0x4b9ba7=_0x4b9ba7-0x0;var _0x13156a=_0xabd0[_0x4b9ba7];return _0x13156a;};'use strict';var multer=require('multer');var util=require(_0x0abd('0x0'));var path=require(_0x0abd('0x1'));var timeout=require(_0x0abd('0x2'));var express=require(_0x0abd('0x3'));var router=express['Router']();var fs_extra=require(_0x0abd('0x4'));var auth=require(_0x0abd('0x5'));var interaction=require(_0x0abd('0x6'));var config=require(_0x0abd('0x7'));var controller=require(_0x0abd('0x8'));router[_0x0abd('0x9')]('/',auth[_0x0abd('0xa')](),controller[_0x0abd('0xb')]);router[_0x0abd('0x9')](_0x0abd('0xc'),auth[_0x0abd('0xa')](),controller['describe']);router[_0x0abd('0x9')](_0x0abd('0xd'),auth[_0x0abd('0xa')](),controller[_0x0abd('0xe')]);router['get']('/:id/questions',auth[_0x0abd('0xa')](),controller[_0x0abd('0xf')]);router[_0x0abd('0x10')]('/',auth[_0x0abd('0xa')](),controller[_0x0abd('0x11')]);router[_0x0abd('0x12')](_0x0abd('0xd'),auth[_0x0abd('0xa')](),controller[_0x0abd('0x13')]);router[_0x0abd('0x14')](_0x0abd('0xd'),auth[_0x0abd('0xa')](),controller['destroy']);module[_0x0abd('0x15')]=router; \ No newline at end of file +var _0xef2d=['post','update','delete','exports','util','express','fs-extra','../../config/environment','isAuthenticated','index','get','describe','/:id','show','/:id/questions','getQuestions'];(function(_0x205c87,_0x215e6a){var _0x4d231f=function(_0x3179c0){while(--_0x3179c0){_0x205c87['push'](_0x205c87['shift']());}};_0x4d231f(++_0x215e6a);}(_0xef2d,0x1f4));var _0xdef2=function(_0x248704,_0x35b41f){_0x248704=_0x248704-0x0;var _0x5dafb0=_0xef2d[_0x248704];return _0x5dafb0;};'use strict';var multer=require('multer');var util=require(_0xdef2('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xdef2('0x1'));var router=express['Router']();var fs_extra=require(_0xdef2('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdef2('0x3'));var controller=require('./jscriptySessionReport.controller');router['get']('/',auth[_0xdef2('0x4')](),controller[_0xdef2('0x5')]);router[_0xdef2('0x6')]('/describe',auth[_0xdef2('0x4')](),controller[_0xdef2('0x7')]);router[_0xdef2('0x6')](_0xdef2('0x8'),auth[_0xdef2('0x4')](),controller[_0xdef2('0x9')]);router[_0xdef2('0x6')](_0xdef2('0xa'),auth[_0xdef2('0x4')](),controller[_0xdef2('0xb')]);router[_0xdef2('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xdef2('0x8'),auth[_0xdef2('0x4')](),controller[_0xdef2('0xd')]);router[_0xdef2('0xe')](_0xdef2('0x8'),auth[_0xdef2('0x4')](),controller['destroy']);module[_0xdef2('0xf')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index ae8bc90..7223d83 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 _0x7c13=['STRING','moment','sequelize','exports','DATE','setDataValue','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x4f2c3c,_0x31ed03){var _0x3330f4=function(_0x304b31){while(--_0x304b31){_0x4f2c3c['push'](_0x4f2c3c['shift']());}};_0x3330f4(++_0x31ed03);}(_0x7c13,0x141));var _0x37c1=function(_0x479160,_0x3ab560){_0x479160=_0x479160-0x0;var _0x47ac6d=_0x7c13[_0x479160];return _0x47ac6d;};'use strict';var moment=require(_0x37c1('0x0'));var Sequelize=require(_0x37c1('0x1'));module[_0x37c1('0x2')]={'starttime':{'type':Sequelize[_0x37c1('0x3')],'set':function(_0x50efe6){this[_0x37c1('0x4')](_0x37c1('0x5'),_0x50efe6);this['setDataValue'](_0x37c1('0x6'),moment()[_0x37c1('0x7')](_0x37c1('0x8')));}},'endtime':{'type':Sequelize[_0x37c1('0x3')]},'membername':{'type':Sequelize[_0x37c1('0x9')]},'projectname':{'type':Sequelize[_0x37c1('0x9')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x37c1('0x9')]},'calleridname':{'type':Sequelize[_0x37c1('0x9')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xbd41=['DATE','setDataValue','format','YYYY-MM-DD\x20HH:mm:ss','STRING','moment','exports'];(function(_0x3af203,_0x628dc1){var _0x29efb5=function(_0x3e72f0){while(--_0x3e72f0){_0x3af203['push'](_0x3af203['shift']());}};_0x29efb5(++_0x628dc1);}(_0xbd41,0x124));var _0x1bd4=function(_0x542d80,_0x150561){_0x542d80=_0x542d80-0x0;var _0x1f4492=_0xbd41[_0x542d80];return _0x1f4492;};'use strict';var moment=require(_0x1bd4('0x0'));var Sequelize=require('sequelize');module[_0x1bd4('0x1')]={'starttime':{'type':Sequelize[_0x1bd4('0x2')],'set':function(_0xd5a3b4){this[_0x1bd4('0x3')]('starttime',_0xd5a3b4);this[_0x1bd4('0x3')]('endtime',moment()[_0x1bd4('0x4')](_0x1bd4('0x5')));}},'endtime':{'type':Sequelize[_0x1bd4('0x2')]},'membername':{'type':Sequelize[_0x1bd4('0x6')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x1bd4('0x6')]},'uniqueid':{'type':Sequelize[_0x1bd4('0x6')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index b14cab5..ff306e7 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 _0xfd9d=['api','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','stack','name','send','index','map','JscriptySessionReport','rawAttributes','type','key','model','query','attributes','intersection','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','getQuestions','findOne','keys','length','nolimit','JscriptyQuestionReport','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x4f48c8,_0x1f6aa1){var _0x25fff5=function(_0x44ca18){while(--_0x44ca18){_0x4f48c8['push'](_0x4f48c8['shift']());}};_0x25fff5(++_0x1f6aa1);}(_0xfd9d,0x88));var _0xdfd9=function(_0x19f9e6,_0x4f59a6){_0x19f9e6=_0x19f9e6-0x0;var _0x45c862=_0xfd9d[_0x19f9e6];return _0x45c862;};'use strict';var emlformat=require(_0xdfd9('0x0'));var rimraf=require(_0xdfd9('0x1'));var zipdir=require(_0xdfd9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdfd9('0x3'));var moment=require('moment');var BPromise=require(_0xdfd9('0x4'));var Mustache=require('mustache');var util=require(_0xdfd9('0x5'));var path=require(_0xdfd9('0x6'));var sox=require(_0xdfd9('0x7'));var csv=require(_0xdfd9('0x8'));var ejs=require(_0xdfd9('0x9'));var fs=require('fs');var fs_extra=require(_0xdfd9('0xa'));var _=require('lodash');var squel=require(_0xdfd9('0xb'));var crypto=require(_0xdfd9('0xc'));var jsforce=require(_0xdfd9('0xd'));var deskjs=require(_0xdfd9('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdfd9('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xdfd9('0x10'));var qs=require(_0xdfd9('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdfd9('0x12'));var logger=require(_0xdfd9('0x13'))(_0xdfd9('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xdfd9('0x15'));var db=require(_0xdfd9('0x16'))['db'];function respondWithStatusCode(_0x2173dc,_0x515c8e){_0x515c8e=_0x515c8e||0xcc;return function(_0x234edc){if(_0x234edc){return _0x2173dc['sendStatus'](_0x515c8e);}return _0x2173dc[_0xdfd9('0x17')](_0x515c8e)[_0xdfd9('0x18')]();};}function respondWithResult(_0xbd53b4,_0x357839){_0x357839=_0x357839||0xc8;return function(_0x317493){if(_0x317493){return _0xbd53b4[_0xdfd9('0x17')](_0x357839)['json'](_0x317493);}};}function respondWithFilteredResult(_0x16f207,_0x2e2a4b){return function(_0x284e4f){if(_0x284e4f){var _0x3fa1d9=typeof _0x2e2a4b[_0xdfd9('0x19')]===_0xdfd9('0x1a')&&typeof _0x2e2a4b['limit']===_0xdfd9('0x1a');var _0x41c0fd=_0x284e4f[_0xdfd9('0x1b')];var _0x2b83d1=_0x3fa1d9?0x0:_0x2e2a4b['offset'];var _0x25040a=_0x3fa1d9?_0x284e4f[_0xdfd9('0x1b')]:_0x2e2a4b[_0xdfd9('0x19')]+_0x2e2a4b[_0xdfd9('0x1c')];var _0x2e738d;if(_0x25040a>=_0x41c0fd){_0x25040a=_0x41c0fd;_0x2e738d=0xc8;}else{_0x2e738d=0xce;}_0x16f207[_0xdfd9('0x17')](_0x2e738d);return _0x16f207[_0xdfd9('0x1d')](_0xdfd9('0x1e'),_0x2b83d1+'-'+_0x25040a+'/'+_0x41c0fd)[_0xdfd9('0x1f')](_0x284e4f);}return null;};}function patchUpdates(_0x3cd358){return function(_0x346626){try{jsonpatch[_0xdfd9('0x20')](_0x346626,_0x3cd358,!![]);}catch(_0x5e73f5){return BPromise[_0xdfd9('0x21')](_0x5e73f5);}return _0x346626[_0xdfd9('0x22')]();};}function saveUpdates(_0x1d93ab,_0x7f9a56){return function(_0x24b41a){if(_0x24b41a){return _0x24b41a[_0xdfd9('0x23')](_0x1d93ab)[_0xdfd9('0x24')](function(_0x1d17c3){return _0x1d17c3;});}return null;};}function removeEntity(_0x5ebef6,_0x3fca68){return function(_0x5152bb){if(_0x5152bb){return _0x5152bb['destroy']()[_0xdfd9('0x24')](function(){_0x5ebef6[_0xdfd9('0x17')](0xcc)[_0xdfd9('0x18')]();});}};}function handleEntityNotFound(_0x5b9a03,_0x570d55){return function(_0x20300c){if(!_0x20300c){_0x5b9a03['sendStatus'](0x194);}return _0x20300c;};}function handleError(_0x5dc8f9,_0x4c603d){_0x4c603d=_0x4c603d||0x1f4;return function(_0x33a747){logger['error'](_0x33a747[_0xdfd9('0x25')]);if(_0x33a747[_0xdfd9('0x26')]){delete _0x33a747[_0xdfd9('0x26')];}_0x5dc8f9[_0xdfd9('0x17')](_0x4c603d)[_0xdfd9('0x27')](_0x33a747);};}exports[_0xdfd9('0x28')]=function(_0x13613,_0x18e14b){var _0xda91c0={},_0x57a0c2={},_0x3b5292={'count':0x0,'rows':[]};var _0x12c509=_[_0xdfd9('0x29')](db[_0xdfd9('0x2a')][_0xdfd9('0x2b')],function(_0x4e5cbd){return{'name':_0x4e5cbd['fieldName'],'type':_0x4e5cbd[_0xdfd9('0x2c')][_0xdfd9('0x2d')]};});_0x57a0c2[_0xdfd9('0x2e')]=_['map'](_0x12c509,_0xdfd9('0x26'));_0x57a0c2[_0xdfd9('0x2f')]=_['keys'](_0x13613[_0xdfd9('0x2f')]);_0x57a0c2['filters']=_['intersection'](_0x57a0c2[_0xdfd9('0x2e')],_0x57a0c2[_0xdfd9('0x2f')]);_0xda91c0[_0xdfd9('0x30')]=_[_0xdfd9('0x31')](_0x57a0c2[_0xdfd9('0x2e')],qs[_0xdfd9('0x32')](_0x13613[_0xdfd9('0x2f')][_0xdfd9('0x32')]));_0xda91c0[_0xdfd9('0x30')]=_0xda91c0[_0xdfd9('0x30')]['length']?_0xda91c0['attributes']:_0x57a0c2['model'];if(!_0x13613[_0xdfd9('0x2f')][_0xdfd9('0x33')]('nolimit')){_0xda91c0[_0xdfd9('0x1c')]=qs['limit'](_0x13613['query']['limit']);_0xda91c0[_0xdfd9('0x19')]=qs[_0xdfd9('0x19')](_0x13613[_0xdfd9('0x2f')][_0xdfd9('0x19')]);}_0xda91c0[_0xdfd9('0x34')]=qs[_0xdfd9('0x35')](_0x13613[_0xdfd9('0x2f')]['sort']);_0xda91c0[_0xdfd9('0x36')]=qs[_0xdfd9('0x37')](_[_0xdfd9('0x38')](_0x13613[_0xdfd9('0x2f')],_0x57a0c2[_0xdfd9('0x37')]),_0x12c509);if(_0x13613[_0xdfd9('0x2f')][_0xdfd9('0x39')]){_0xda91c0[_0xdfd9('0x36')]=_[_0xdfd9('0x3a')](_0xda91c0[_0xdfd9('0x36')],{'$or':_[_0xdfd9('0x29')](_0x12c509,function(_0x547076){if(_0x547076['type']!==_0xdfd9('0x3b')){var _0x53da3a={};_0x53da3a[_0x547076['name']]={'$like':'%'+_0x13613[_0xdfd9('0x2f')]['filter']+'%'};return _0x53da3a;}})});}_0xda91c0=_[_0xdfd9('0x3a')]({},_0xda91c0,_0x13613[_0xdfd9('0x3c')]);var _0x119af6={'where':_0xda91c0[_0xdfd9('0x36')]};return db['JscriptySessionReport'][_0xdfd9('0x1b')](_0x119af6)[_0xdfd9('0x24')](function(_0x2896e5){_0x3b5292[_0xdfd9('0x1b')]=_0x2896e5;if(_0x13613['query'][_0xdfd9('0x3d')]){_0xda91c0[_0xdfd9('0x3e')]=[{'all':!![]}];}return db[_0xdfd9('0x2a')][_0xdfd9('0x3f')](_0xda91c0);})[_0xdfd9('0x24')](function(_0x1bce59){_0x3b5292[_0xdfd9('0x40')]=_0x1bce59;return _0x3b5292;})[_0xdfd9('0x24')](respondWithFilteredResult(_0x18e14b,_0xda91c0))[_0xdfd9('0x41')](handleError(_0x18e14b,null));};exports[_0xdfd9('0x42')]=function(_0x582ce0,_0x41c781){var _0x16e559={'raw':!![],'where':{'id':_0x582ce0['params']['id']}},_0x4f5682={};_0x4f5682[_0xdfd9('0x2e')]=_['keys'](db['JscriptySessionReport'][_0xdfd9('0x2b')]);_0x4f5682[_0xdfd9('0x2f')]=_['keys'](_0x582ce0[_0xdfd9('0x2f')]);_0x4f5682['filters']=_[_0xdfd9('0x31')](_0x4f5682['model'],_0x4f5682[_0xdfd9('0x2f')]);_0x16e559[_0xdfd9('0x30')]=_[_0xdfd9('0x31')](_0x4f5682['model'],qs[_0xdfd9('0x32')](_0x582ce0['query'][_0xdfd9('0x32')]));_0x16e559[_0xdfd9('0x30')]=_0x16e559['attributes']['length']?_0x16e559[_0xdfd9('0x30')]:_0x4f5682[_0xdfd9('0x2e')];if(_0x582ce0[_0xdfd9('0x2f')][_0xdfd9('0x3d')]){_0x16e559[_0xdfd9('0x3e')]=[{'all':!![]}];}_0x16e559=_['merge']({},_0x16e559,_0x582ce0[_0xdfd9('0x3c')]);return db[_0xdfd9('0x2a')][_0xdfd9('0x43')](_0x16e559)[_0xdfd9('0x24')](handleEntityNotFound(_0x41c781,null))['then'](respondWithResult(_0x41c781,null))[_0xdfd9('0x41')](handleError(_0x41c781,null));};exports['create']=function(_0x52afc2,_0x198b84){return db[_0xdfd9('0x2a')][_0xdfd9('0x44')](_0x52afc2['body'],{})['then'](respondWithResult(_0x198b84,0xc9))[_0xdfd9('0x41')](handleError(_0x198b84,null));};exports['update']=function(_0x54879,_0x59cf4a){if(_0x54879[_0xdfd9('0x45')]['id']){delete _0x54879[_0xdfd9('0x45')]['id'];}return db[_0xdfd9('0x2a')]['find']({'where':{'id':_0x54879[_0xdfd9('0x46')]['id']}})[_0xdfd9('0x24')](handleEntityNotFound(_0x59cf4a,null))[_0xdfd9('0x24')](saveUpdates(_0x54879[_0xdfd9('0x45')],null))['then'](respondWithResult(_0x59cf4a,null))[_0xdfd9('0x41')](handleError(_0x59cf4a,null));};exports['destroy']=function(_0x350ace,_0x1107f8){return db['JscriptySessionReport']['find']({'where':{'id':_0x350ace[_0xdfd9('0x46')]['id']}})[_0xdfd9('0x24')](handleEntityNotFound(_0x1107f8,null))[_0xdfd9('0x24')](removeEntity(_0x1107f8,null))[_0xdfd9('0x41')](handleError(_0x1107f8,null));};exports[_0xdfd9('0x47')]=function(_0x1112c8,_0x367533){return db['JscriptySessionReport'][_0xdfd9('0x47')]()[_0xdfd9('0x24')](respondWithResult(_0x367533,null))[_0xdfd9('0x41')](handleError(_0x367533,null));};exports[_0xdfd9('0x48')]=function(_0x3bef37,_0x3b8daa,_0x58eb1a){var _0x943deb={'raw':!![],'where':{}};var _0x5caf72={};var _0x4c9e40={'count':0x0,'rows':[]};return db[_0xdfd9('0x2a')][_0xdfd9('0x49')]({'where':{'id':_0x3bef37[_0xdfd9('0x46')]['id']}})[_0xdfd9('0x24')](handleEntityNotFound(_0x3b8daa,null))[_0xdfd9('0x24')](function(_0x51f13f){if(_0x51f13f){_0x5caf72[_0xdfd9('0x2e')]=_[_0xdfd9('0x4a')](db['JscriptyQuestionReport'][_0xdfd9('0x2b')]);_0x5caf72[_0xdfd9('0x2f')]=_[_0xdfd9('0x4a')](_0x3bef37[_0xdfd9('0x2f')]);_0x5caf72['filters']=_[_0xdfd9('0x31')](_0x5caf72['model'],_0x5caf72[_0xdfd9('0x2f')]);_0x943deb[_0xdfd9('0x30')]=_[_0xdfd9('0x31')](_0x5caf72[_0xdfd9('0x2e')],qs['fields'](_0x3bef37['query']['fields']));_0x943deb[_0xdfd9('0x30')]=_0x943deb['attributes'][_0xdfd9('0x4b')]?_0x943deb['attributes']:_0x5caf72['model'];if(!_0x3bef37[_0xdfd9('0x2f')][_0xdfd9('0x33')](_0xdfd9('0x4c'))){_0x943deb[_0xdfd9('0x1c')]=qs['limit'](_0x3bef37[_0xdfd9('0x2f')][_0xdfd9('0x1c')]);_0x943deb[_0xdfd9('0x19')]=qs[_0xdfd9('0x19')](_0x3bef37['query']['offset']);}_0x943deb[_0xdfd9('0x34')]=qs[_0xdfd9('0x35')](_0x3bef37[_0xdfd9('0x2f')]['sort']);_0x943deb[_0xdfd9('0x36')]=qs['filters'](_[_0xdfd9('0x38')](_0x3bef37[_0xdfd9('0x2f')],_0x5caf72[_0xdfd9('0x37')]));_0x943deb['where']['SessionId']=_0x51f13f['id'];if(_0x3bef37['query'][_0xdfd9('0x39')]){_0x943deb[_0xdfd9('0x36')]=_[_0xdfd9('0x3a')](_0x943deb[_0xdfd9('0x36')],{'$or':_[_0xdfd9('0x29')](_0x943deb['attributes'],function(_0x56ed74){var _0x14c4c4={};_0x14c4c4[_0x56ed74]={'$like':'%'+_0x3bef37['query'][_0xdfd9('0x39')]+'%'};return _0x14c4c4;})});}_0x943deb=_[_0xdfd9('0x3a')]({},_0x943deb,_0x3bef37[_0xdfd9('0x3c')]);return db['JscriptyQuestionReport'][_0xdfd9('0x1b')]({'where':_0x943deb['where']})[_0xdfd9('0x24')](function(_0x2903bd){_0x4c9e40['count']=_0x2903bd;if(_0x3bef37[_0xdfd9('0x2f')][_0xdfd9('0x3d')]){_0x943deb[_0xdfd9('0x3e')]=[{'all':!![]}];}return db[_0xdfd9('0x4d')][_0xdfd9('0x3f')](_0x943deb);})[_0xdfd9('0x24')](function(_0x28d31d){_0x4c9e40[_0xdfd9('0x40')]=_0x28d31d;return _0x4c9e40;});}})[_0xdfd9('0x24')](respondWithFilteredResult(_0x3b8daa,_0x943deb))[_0xdfd9('0x41')](handleError(_0x3b8daa,null));}; \ No newline at end of file +var _0x1a76=['VIRTUAL','merge','options','findAll','rows','catch','params','length','find','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','SessionId','includeAll','include','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','index','map','JscriptySessionReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','type'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1a76,0x10b));var _0x61a7=function(_0x2460d9,_0x15da87){_0x2460d9=_0x2460d9-0x0;var _0x4bc204=_0x1a76[_0x2460d9];return _0x4bc204;};'use strict';var emlformat=require(_0x61a7('0x0'));var rimraf=require(_0x61a7('0x1'));var zipdir=require(_0x61a7('0x2'));var jsonpatch=require(_0x61a7('0x3'));var rp=require('request-promise');var moment=require(_0x61a7('0x4'));var BPromise=require(_0x61a7('0x5'));var Mustache=require(_0x61a7('0x6'));var util=require('util');var path=require(_0x61a7('0x7'));var sox=require(_0x61a7('0x8'));var csv=require('to-csv');var ejs=require(_0x61a7('0x9'));var fs=require('fs');var fs_extra=require(_0x61a7('0xa'));var _=require('lodash');var squel=require(_0x61a7('0xb'));var crypto=require(_0x61a7('0xc'));var jsforce=require(_0x61a7('0xd'));var deskjs=require(_0x61a7('0xe'));var toCsv=require('to-csv');var querystring=require(_0x61a7('0xf'));var Papa=require(_0x61a7('0x10'));var Redis=require(_0x61a7('0x11'));var authService=require(_0x61a7('0x12'));var qs=require(_0x61a7('0x13'));var as=require(_0x61a7('0x14'));var hardwareService=require(_0x61a7('0x15'));var logger=require(_0x61a7('0x16'))(_0x61a7('0x17'));var utils=require(_0x61a7('0x18'));var config=require(_0x61a7('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x61a7('0x1a'))['db'];function respondWithStatusCode(_0x5e55bc,_0x29cf1c){_0x29cf1c=_0x29cf1c||0xcc;return function(_0x3650a0){if(_0x3650a0){return _0x5e55bc[_0x61a7('0x1b')](_0x29cf1c);}return _0x5e55bc[_0x61a7('0x1c')](_0x29cf1c)['end']();};}function respondWithResult(_0x47db08,_0x35c1ca){_0x35c1ca=_0x35c1ca||0xc8;return function(_0x14ee10){if(_0x14ee10){return _0x47db08['status'](_0x35c1ca)[_0x61a7('0x1d')](_0x14ee10);}};}function respondWithFilteredResult(_0x42be0f,_0x40da6f){return function(_0x53cb1d){if(_0x53cb1d){var _0x19ce8b=typeof _0x40da6f[_0x61a7('0x1e')]===_0x61a7('0x1f')&&typeof _0x40da6f[_0x61a7('0x20')]==='undefined';var _0x182c29=_0x53cb1d['count'];var _0x49dc84=_0x19ce8b?0x0:_0x40da6f[_0x61a7('0x1e')];var _0x42bdd2=_0x19ce8b?_0x53cb1d[_0x61a7('0x21')]:_0x40da6f['offset']+_0x40da6f[_0x61a7('0x20')];var _0x1e1c92;if(_0x42bdd2>=_0x182c29){_0x42bdd2=_0x182c29;_0x1e1c92=0xc8;}else{_0x1e1c92=0xce;}_0x42be0f[_0x61a7('0x1c')](_0x1e1c92);return _0x42be0f[_0x61a7('0x22')](_0x61a7('0x23'),_0x49dc84+'-'+_0x42bdd2+'/'+_0x182c29)[_0x61a7('0x1d')](_0x53cb1d);}return null;};}function patchUpdates(_0x5e5013){return function(_0x9217b){try{jsonpatch['apply'](_0x9217b,_0x5e5013,!![]);}catch(_0x25bed6){return BPromise[_0x61a7('0x24')](_0x25bed6);}return _0x9217b[_0x61a7('0x25')]();};}function saveUpdates(_0x19963d,_0x204b9a){return function(_0x5d664b){if(_0x5d664b){return _0x5d664b[_0x61a7('0x26')](_0x19963d)[_0x61a7('0x27')](function(_0x20e37d){return _0x20e37d;});}return null;};}function removeEntity(_0x205dad,_0x1f1d18){return function(_0x5a3c49){if(_0x5a3c49){return _0x5a3c49[_0x61a7('0x28')]()[_0x61a7('0x27')](function(){_0x205dad[_0x61a7('0x1c')](0xcc)[_0x61a7('0x29')]();});}};}function handleEntityNotFound(_0x1509b8,_0x329000){return function(_0x376024){if(!_0x376024){_0x1509b8['sendStatus'](0x194);}return _0x376024;};}function handleError(_0x2f35a0,_0x1c813f){_0x1c813f=_0x1c813f||0x1f4;return function(_0x4e3aea){logger[_0x61a7('0x2a')](_0x4e3aea[_0x61a7('0x2b')]);if(_0x4e3aea[_0x61a7('0x2c')]){delete _0x4e3aea[_0x61a7('0x2c')];}_0x2f35a0['status'](_0x1c813f)['send'](_0x4e3aea);};}exports[_0x61a7('0x2d')]=function(_0x3d89fc,_0x2ccbc6){var _0x12cce3={},_0x196208={},_0x475973={'count':0x0,'rows':[]};var _0xfce67f=_[_0x61a7('0x2e')](db[_0x61a7('0x2f')][_0x61a7('0x30')],function(_0x24a76e){return{'name':_0x24a76e[_0x61a7('0x31')],'type':_0x24a76e['type'][_0x61a7('0x32')]};});_0x196208[_0x61a7('0x33')]=_[_0x61a7('0x2e')](_0xfce67f,'name');_0x196208[_0x61a7('0x34')]=_[_0x61a7('0x35')](_0x3d89fc[_0x61a7('0x34')]);_0x196208[_0x61a7('0x36')]=_[_0x61a7('0x37')](_0x196208[_0x61a7('0x33')],_0x196208['query']);_0x12cce3[_0x61a7('0x38')]=_[_0x61a7('0x37')](_0x196208[_0x61a7('0x33')],qs[_0x61a7('0x39')](_0x3d89fc['query'][_0x61a7('0x39')]));_0x12cce3['attributes']=_0x12cce3[_0x61a7('0x38')]['length']?_0x12cce3[_0x61a7('0x38')]:_0x196208['model'];if(!_0x3d89fc[_0x61a7('0x34')][_0x61a7('0x3a')](_0x61a7('0x3b'))){_0x12cce3[_0x61a7('0x20')]=qs[_0x61a7('0x20')](_0x3d89fc[_0x61a7('0x34')][_0x61a7('0x20')]);_0x12cce3['offset']=qs[_0x61a7('0x1e')](_0x3d89fc['query'][_0x61a7('0x1e')]);}_0x12cce3[_0x61a7('0x3c')]=qs[_0x61a7('0x3d')](_0x3d89fc[_0x61a7('0x34')][_0x61a7('0x3d')]);_0x12cce3[_0x61a7('0x3e')]=qs['filters'](_[_0x61a7('0x3f')](_0x3d89fc[_0x61a7('0x34')],_0x196208[_0x61a7('0x36')]),_0xfce67f);if(_0x3d89fc[_0x61a7('0x34')]['filter']){_0x12cce3[_0x61a7('0x3e')]=_['merge'](_0x12cce3[_0x61a7('0x3e')],{'$or':_[_0x61a7('0x2e')](_0xfce67f,function(_0x295657){if(_0x295657[_0x61a7('0x40')]!==_0x61a7('0x41')){var _0x30b36d={};_0x30b36d[_0x295657[_0x61a7('0x2c')]]={'$like':'%'+_0x3d89fc[_0x61a7('0x34')]['filter']+'%'};return _0x30b36d;}})});}_0x12cce3=_[_0x61a7('0x42')]({},_0x12cce3,_0x3d89fc[_0x61a7('0x43')]);var _0x2a5c7f={'where':_0x12cce3[_0x61a7('0x3e')]};return db[_0x61a7('0x2f')][_0x61a7('0x21')](_0x2a5c7f)['then'](function(_0x1544fc){_0x475973[_0x61a7('0x21')]=_0x1544fc;if(_0x3d89fc['query']['includeAll']){_0x12cce3['include']=[{'all':!![]}];}return db[_0x61a7('0x2f')][_0x61a7('0x44')](_0x12cce3);})[_0x61a7('0x27')](function(_0x4632b1){_0x475973[_0x61a7('0x45')]=_0x4632b1;return _0x475973;})[_0x61a7('0x27')](respondWithFilteredResult(_0x2ccbc6,_0x12cce3))[_0x61a7('0x46')](handleError(_0x2ccbc6,null));};exports['show']=function(_0x783a6c,_0x1e638e){var _0x2bf65c={'raw':!![],'where':{'id':_0x783a6c[_0x61a7('0x47')]['id']}},_0x6ff4e4={};_0x6ff4e4['model']=_[_0x61a7('0x35')](db[_0x61a7('0x2f')][_0x61a7('0x30')]);_0x6ff4e4[_0x61a7('0x34')]=_['keys'](_0x783a6c[_0x61a7('0x34')]);_0x6ff4e4[_0x61a7('0x36')]=_['intersection'](_0x6ff4e4[_0x61a7('0x33')],_0x6ff4e4['query']);_0x2bf65c[_0x61a7('0x38')]=_[_0x61a7('0x37')](_0x6ff4e4[_0x61a7('0x33')],qs[_0x61a7('0x39')](_0x783a6c['query'][_0x61a7('0x39')]));_0x2bf65c['attributes']=_0x2bf65c[_0x61a7('0x38')][_0x61a7('0x48')]?_0x2bf65c[_0x61a7('0x38')]:_0x6ff4e4[_0x61a7('0x33')];if(_0x783a6c[_0x61a7('0x34')]['includeAll']){_0x2bf65c['include']=[{'all':!![]}];}_0x2bf65c=_[_0x61a7('0x42')]({},_0x2bf65c,_0x783a6c[_0x61a7('0x43')]);return db['JscriptySessionReport'][_0x61a7('0x49')](_0x2bf65c)[_0x61a7('0x27')](handleEntityNotFound(_0x1e638e,null))[_0x61a7('0x27')](respondWithResult(_0x1e638e,null))['catch'](handleError(_0x1e638e,null));};exports[_0x61a7('0x4a')]=function(_0x20df57,_0x5ba7ed){return db[_0x61a7('0x2f')][_0x61a7('0x4a')](_0x20df57['body'],{})[_0x61a7('0x27')](respondWithResult(_0x5ba7ed,0xc9))[_0x61a7('0x46')](handleError(_0x5ba7ed,null));};exports[_0x61a7('0x26')]=function(_0x848d01,_0x56cea0){if(_0x848d01[_0x61a7('0x4b')]['id']){delete _0x848d01[_0x61a7('0x4b')]['id'];}return db[_0x61a7('0x2f')][_0x61a7('0x49')]({'where':{'id':_0x848d01[_0x61a7('0x47')]['id']}})[_0x61a7('0x27')](handleEntityNotFound(_0x56cea0,null))['then'](saveUpdates(_0x848d01[_0x61a7('0x4b')],null))[_0x61a7('0x27')](respondWithResult(_0x56cea0,null))['catch'](handleError(_0x56cea0,null));};exports[_0x61a7('0x28')]=function(_0x2f58f3,_0x2a6e5d){return db[_0x61a7('0x2f')][_0x61a7('0x49')]({'where':{'id':_0x2f58f3[_0x61a7('0x47')]['id']}})[_0x61a7('0x27')](handleEntityNotFound(_0x2a6e5d,null))[_0x61a7('0x27')](removeEntity(_0x2a6e5d,null))[_0x61a7('0x46')](handleError(_0x2a6e5d,null));};exports[_0x61a7('0x4c')]=function(_0x21c30f,_0x5e7b0b){return db[_0x61a7('0x2f')][_0x61a7('0x4c')]()[_0x61a7('0x27')](respondWithResult(_0x5e7b0b,null))['catch'](handleError(_0x5e7b0b,null));};exports[_0x61a7('0x4d')]=function(_0x56d5e2,_0x43ded2,_0xa8d7d8){var _0x2aee01={'raw':!![],'where':{}};var _0x2fd776={};var _0x9824c7={'count':0x0,'rows':[]};return db[_0x61a7('0x2f')][_0x61a7('0x4e')]({'where':{'id':_0x56d5e2[_0x61a7('0x47')]['id']}})['then'](handleEntityNotFound(_0x43ded2,null))[_0x61a7('0x27')](function(_0x5adc37){if(_0x5adc37){_0x2fd776['model']=_['keys'](db[_0x61a7('0x4f')][_0x61a7('0x30')]);_0x2fd776[_0x61a7('0x34')]=_[_0x61a7('0x35')](_0x56d5e2[_0x61a7('0x34')]);_0x2fd776[_0x61a7('0x36')]=_[_0x61a7('0x37')](_0x2fd776['model'],_0x2fd776['query']);_0x2aee01[_0x61a7('0x38')]=_[_0x61a7('0x37')](_0x2fd776[_0x61a7('0x33')],qs[_0x61a7('0x39')](_0x56d5e2[_0x61a7('0x34')][_0x61a7('0x39')]));_0x2aee01['attributes']=_0x2aee01[_0x61a7('0x38')]['length']?_0x2aee01[_0x61a7('0x38')]:_0x2fd776[_0x61a7('0x33')];if(!_0x56d5e2[_0x61a7('0x34')][_0x61a7('0x3a')](_0x61a7('0x3b'))){_0x2aee01[_0x61a7('0x20')]=qs[_0x61a7('0x20')](_0x56d5e2[_0x61a7('0x34')][_0x61a7('0x20')]);_0x2aee01['offset']=qs['offset'](_0x56d5e2[_0x61a7('0x34')][_0x61a7('0x1e')]);}_0x2aee01[_0x61a7('0x3c')]=qs['sort'](_0x56d5e2['query']['sort']);_0x2aee01[_0x61a7('0x3e')]=qs['filters'](_[_0x61a7('0x3f')](_0x56d5e2['query'],_0x2fd776[_0x61a7('0x36')]));_0x2aee01[_0x61a7('0x3e')][_0x61a7('0x50')]=_0x5adc37['id'];if(_0x56d5e2[_0x61a7('0x34')]['filter']){_0x2aee01[_0x61a7('0x3e')]=_[_0x61a7('0x42')](_0x2aee01[_0x61a7('0x3e')],{'$or':_[_0x61a7('0x2e')](_0x2aee01[_0x61a7('0x38')],function(_0x4b1482){var _0x161d32={};_0x161d32[_0x4b1482]={'$like':'%'+_0x56d5e2[_0x61a7('0x34')]['filter']+'%'};return _0x161d32;})});}_0x2aee01=_['merge']({},_0x2aee01,_0x56d5e2[_0x61a7('0x43')]);return db[_0x61a7('0x4f')][_0x61a7('0x21')]({'where':_0x2aee01[_0x61a7('0x3e')]})[_0x61a7('0x27')](function(_0x2315d2){_0x9824c7[_0x61a7('0x21')]=_0x2315d2;if(_0x56d5e2[_0x61a7('0x34')][_0x61a7('0x51')]){_0x2aee01[_0x61a7('0x52')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x61a7('0x44')](_0x2aee01);})[_0x61a7('0x27')](function(_0x1c188c){_0x9824c7[_0x61a7('0x45')]=_0x1c188c;return _0x9824c7;});}})['then'](respondWithFilteredResult(_0x43ded2,_0x2aee01))[_0x61a7('0x46')](handleError(_0x43ded2,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 647aaeb..36271c8 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 _0xb4c7=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','define','report_jscripty_sessions','lodash','util'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x5caf6c,_0x1ce39b){_0x5caf6c=_0x5caf6c-0x0;var _0x50cf4e=_0xb4c7[_0x5caf6c];return _0x50cf4e;};'use strict';var _=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var logger=require(_0x7b4c('0x2'))(_0x7b4c('0x3'));var moment=require(_0x7b4c('0x4'));var BPromise=require('bluebird');var rp=require(_0x7b4c('0x5'));var fs=require('fs');var path=require(_0x7b4c('0x6'));var rimraf=require(_0x7b4c('0x7'));var config=require(_0x7b4c('0x8'));var attributes=require(_0x7b4c('0x9'));module['exports']=function(_0x1b0f57,_0x10e197){return _0x1b0f57[_0x7b4c('0xa')]('JscriptySessionReport',attributes,{'tableName':_0x7b4c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xafc4=['path','exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x28aea5,_0x3bb12e){var _0x6a55f9=function(_0xf6ece8){while(--_0xf6ece8){_0x28aea5['push'](_0x28aea5['shift']());}};_0x6a55f9(++_0x3bb12e);}(_0xafc4,0x69));var _0x4afc=function(_0x261b08,_0x563d91){_0x261b08=_0x261b08-0x0;var _0xeeaf84=_0xafc4[_0x261b08];return _0xeeaf84;};'use strict';var _=require(_0x4afc('0x0'));var util=require('util');var logger=require(_0x4afc('0x1'))('api');var moment=require(_0x4afc('0x2'));var BPromise=require(_0x4afc('0x3'));var rp=require(_0x4afc('0x4'));var fs=require('fs');var path=require(_0x4afc('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./jscriptySessionReport.attributes');module[_0x4afc('0x6')]=function(_0x471d45,_0x16953b){return _0x471d45[_0x4afc('0x7')](_0x4afc('0x8'),attributes,{'tableName':_0x4afc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index f6a738f..cd8cb3f 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 _0x32b6=['JscriptySessionReport,\x20%s,\x20%s','message','info','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','request\x20sent','stringify','error','code'];(function(_0x4045ae,_0x57c3b3){var _0x28bc85=function(_0x5e72b6){while(--_0x5e72b6){_0x4045ae['push'](_0x4045ae['shift']());}};_0x28bc85(++_0x57c3b3);}(_0x32b6,0x1d1));var _0x632b=function(_0x275482,_0x382b98){_0x275482=_0x275482-0x0;var _0x326bd5=_0x32b6[_0x275482];return _0x326bd5;};'use strict';var _=require(_0x632b('0x0'));var util=require(_0x632b('0x1'));var moment=require('moment');var BPromise=require(_0x632b('0x2'));var rs=require(_0x632b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x632b('0x4'));var logger=require(_0x632b('0x5'))(_0x632b('0x6'));var config=require(_0x632b('0x7'));var jayson=require(_0x632b('0x8'));var client=jayson[_0x632b('0x9')][_0x632b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x10458a,_0x3bbf43,_0x43d6c7){return new BPromise(function(_0x5128f5,_0x33d711){return client[_0x632b('0xb')](_0x10458a,_0x43d6c7)[_0x632b('0xc')](function(_0x174201){logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0x3bbf43,'request\x20sent');logger[_0x632b('0xd')]('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x3bbf43,_0x632b('0xe'),JSON[_0x632b('0xf')](_0x174201));if(_0x174201[_0x632b('0x10')]){if(_0x174201[_0x632b('0x10')][_0x632b('0x11')]===0x1f4){logger[_0x632b('0x10')](_0x632b('0x12'),_0x3bbf43,_0x174201[_0x632b('0x10')][_0x632b('0x13')]);return _0x33d711(_0x174201['error'][_0x632b('0x13')]);}logger[_0x632b('0x10')](_0x632b('0x12'),_0x3bbf43,_0x174201['error'][_0x632b('0x13')]);return _0x5128f5(_0x174201[_0x632b('0x10')][_0x632b('0x13')]);}else{logger[_0x632b('0x14')](_0x632b('0x12'),_0x3bbf43,_0x632b('0xe'));_0x5128f5(_0x174201['result'][_0x632b('0x13')]);}})['catch'](function(_0x4fdef2){logger[_0x632b('0x10')]('JscriptySessionReport,\x20%s,\x20%s',_0x3bbf43,_0x4fdef2);_0x33d711(_0x4fdef2);});});} \ No newline at end of file +var _0x5c3c=['JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','JscriptySessionReport,\x20%s,\x20%s','request\x20sent'];(function(_0x4bdee6,_0x28f35e){var _0x1333c4=function(_0x45d3dd){while(--_0x45d3dd){_0x4bdee6['push'](_0x4bdee6['shift']());}};_0x1333c4(++_0x28f35e);}(_0x5c3c,0x132));var _0xc5c3=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x5c3c[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0xc5c3('0x0'));var util=require(_0xc5c3('0x1'));var moment=require(_0xc5c3('0x2'));var BPromise=require(_0xc5c3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc5c3('0x4'));var db=require(_0xc5c3('0x5'))['db'];var utils=require(_0xc5c3('0x6'));var logger=require(_0xc5c3('0x7'))(_0xc5c3('0x8'));var config=require(_0xc5c3('0x9'));var jayson=require(_0xc5c3('0xa'));var client=jayson[_0xc5c3('0xb')][_0xc5c3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5a392b,_0x4b8404,_0x591f7d){return new BPromise(function(_0x723c31,_0x522be1){return client['request'](_0x5a392b,_0x591f7d)[_0xc5c3('0xd')](function(_0x46e2c1){logger['info'](_0xc5c3('0xe'),_0x4b8404,_0xc5c3('0xf'));logger['debug'](_0xc5c3('0x10'),_0x4b8404,_0xc5c3('0xf'),JSON[_0xc5c3('0x11')](_0x46e2c1));if(_0x46e2c1['error']){if(_0x46e2c1[_0xc5c3('0x12')][_0xc5c3('0x13')]===0x1f4){logger['error'](_0xc5c3('0xe'),_0x4b8404,_0x46e2c1[_0xc5c3('0x12')][_0xc5c3('0x14')]);return _0x522be1(_0x46e2c1['error'][_0xc5c3('0x14')]);}logger[_0xc5c3('0x12')](_0xc5c3('0xe'),_0x4b8404,_0x46e2c1[_0xc5c3('0x12')][_0xc5c3('0x14')]);return _0x723c31(_0x46e2c1['error']['message']);}else{logger[_0xc5c3('0x15')](_0xc5c3('0xe'),_0x4b8404,_0xc5c3('0xf'));_0x723c31(_0x46e2c1[_0xc5c3('0x16')]['message']);}})['catch'](function(_0x467ba9){logger['error'](_0xc5c3('0xe'),_0x4b8404,_0x467ba9);_0x522be1(_0x467ba9);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index ea34507..00af191 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 _0xc23a=['exports','util','path','connect-timeout','Router','../../components/interaction/service','./license.controller','get','index','isAuthenticated','update'];(function(_0x1da7bb,_0x37e696){var _0x305c2f=function(_0x49844c){while(--_0x49844c){_0x1da7bb['push'](_0x1da7bb['shift']());}};_0x305c2f(++_0x37e696);}(_0xc23a,0xd2));var _0xac23=function(_0x114b7c,_0xc4b93b){_0x114b7c=_0x114b7c-0x0;var _0x47185f=_0xc23a[_0x114b7c];return _0x47185f;};'use strict';var multer=require('multer');var util=require(_0xac23('0x0'));var path=require(_0xac23('0x1'));var timeout=require(_0xac23('0x2'));var express=require('express');var router=express[_0xac23('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xac23('0x4'));var config=require('../../config/environment');var controller=require(_0xac23('0x5'));router[_0xac23('0x6')]('/',controller[_0xac23('0x7')]);router['put']('/:id',auth[_0xac23('0x8')](),controller[_0xac23('0x9')]);module[_0xac23('0xa')]=router; \ No newline at end of file +var _0xb68a=['put','/:id','isAuthenticated','exports','multer','util','path','express','Router','../../config/environment','get','index'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xb68a,0x1a8));var _0xab68=function(_0x2a3829,_0x415203){_0x2a3829=_0x2a3829-0x0;var _0x2f3112=_0xb68a[_0x2a3829];return _0x2f3112;};'use strict';var multer=require(_0xab68('0x0'));var util=require(_0xab68('0x1'));var path=require(_0xab68('0x2'));var timeout=require('connect-timeout');var express=require(_0xab68('0x3'));var router=express[_0xab68('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xab68('0x5'));var controller=require('./license.controller');router[_0xab68('0x6')]('/',controller[_0xab68('0x7')]);router[_0xab68('0x8')](_0xab68('0x9'),auth[_0xab68('0xa')](),controller['update']);module[_0xab68('0xb')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 3a06433..75a66ae 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 _0xf973=['exports','TEXT','STRING'];(function(_0x5a2279,_0x3990b4){var _0x23a3da=function(_0x3ea0c3){while(--_0x3ea0c3){_0x5a2279['push'](_0x5a2279['shift']());}};_0x23a3da(++_0x3990b4);}(_0xf973,0x174));var _0x3f97=function(_0x474035,_0x41e639){_0x474035=_0x474035-0x0;var _0x1b58e0=_0xf973[_0x474035];return _0x1b58e0;};'use strict';var Sequelize=require('sequelize');module[_0x3f97('0x0')]={'license':{'type':Sequelize[_0x3f97('0x1')]},'data1':{'type':Sequelize[_0x3f97('0x2')]},'data2':{'type':Sequelize[_0x3f97('0x2')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x403b=['STRING','INTEGER','sequelize','TEXT'];(function(_0x5f170c,_0x4a2e40){var _0x43dd18=function(_0x4758d7){while(--_0x4758d7){_0x5f170c['push'](_0x5f170c['shift']());}};_0x43dd18(++_0x4a2e40);}(_0x403b,0x9a));var _0xb403=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x403b[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0xb403('0x0'));module['exports']={'license':{'type':Sequelize[_0xb403('0x1')]},'data1':{'type':Sequelize[_0xb403('0x2')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize[_0xb403('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 5d2e9cf..4a4129b 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 _0x2ef3=['length','options','then','catch','body','params','get','checkLicense','demo','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','stack','name','send','index','model','keys','rawAttributes','query','filters','intersection','attributes','fields'];(function(_0x343b56,_0x27ebbf){var _0x4bdc57=function(_0x46cccd){while(--_0x46cccd){_0x343b56['push'](_0x343b56['shift']());}};_0x4bdc57(++_0x27ebbf);}(_0x2ef3,0xba));var _0x32ef=function(_0x4f58e2,_0x26595f){_0x4f58e2=_0x4f58e2-0x0;var _0x3bd75e=_0x2ef3[_0x4f58e2];return _0x3bd75e;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}var utilLicense=require('../../config/license/util');exports[_0x32ef('0x29')]=function(_0x2f5d06,_0x5a04cd){var _0x12de1a={'raw':!![],'where':{'id':0x1}},_0x3c569d={};_0x3c569d[_0x32ef('0x2a')]=_[_0x32ef('0x2b')](db['License'][_0x32ef('0x2c')]);_0x3c569d[_0x32ef('0x2d')]=_[_0x32ef('0x2b')](_0x2f5d06[_0x32ef('0x2d')]);_0x3c569d[_0x32ef('0x2e')]=_[_0x32ef('0x2f')](_0x3c569d[_0x32ef('0x2a')],_0x3c569d['query']);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x3c569d[_0x32ef('0x2a')],qs[_0x32ef('0x31')](_0x2f5d06['query'][_0x32ef('0x31')]));_0x12de1a[_0x32ef('0x30')]=_0x12de1a[_0x32ef('0x30')][_0x32ef('0x32')]?_0x12de1a[_0x32ef('0x30')]:_0x3c569d['model'];_0x12de1a=_['merge']({},_0x12de1a,_0x2f5d06[_0x32ef('0x33')]);return utilLicense['getLicense'](_0x12de1a)[_0x32ef('0x34')](respondWithResult(_0x5a04cd,null))[_0x32ef('0x35')](handleError(_0x5a04cd,null));};exports[_0x32ef('0x24')]=function(_0x390670,_0x389583){if(_0x390670[_0x32ef('0x36')]['id']){delete _0x390670['body']['id'];}return db['License']['find']({'where':{'id':_0x390670[_0x32ef('0x37')]['id']}})[_0x32ef('0x34')](handleEntityNotFound(_0x389583,null))[_0x32ef('0x34')](function(_0x5f2443){var _0x4fb402=_0x5f2443[_0x32ef('0x38')]({'plain':!![]});return utilLicense[_0x32ef('0x39')](_0x4fb402,_0x390670[_0x32ef('0x36')]['key']);})['then'](function(_0xcbdec8){if(!_0xcbdec8[_0x32ef('0x3a')]){return saveUpdates(_0x390670[_0x32ef('0x36')],null);}return _0xcbdec8;})[_0x32ef('0x34')](respondWithResult(_0x389583,null))[_0x32ef('0x35')](handleError(_0x389583,null));}; \ No newline at end of file +var _0x7a54=['count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','model','License','query','keys','intersection','attributes','fields','length','options','getLicense','body','find','checkLicense','key','demo','catch','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'];(function(_0x4cd910,_0x3da0d1){var _0x186f8a=function(_0x3e149a){while(--_0x3e149a){_0x4cd910['push'](_0x4cd910['shift']());}};_0x186f8a(++_0x3da0d1);}(_0x7a54,0x106));var _0x47a5=function(_0x1a6921,_0xfeb121){_0x1a6921=_0x1a6921-0x0;var _0xb546f0=_0x7a54[_0x1a6921];return _0xb546f0;};'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);};}var utilLicense=require(_0x47a5('0x14'));exports[_0x47a5('0x29')]=function(_0x16631f,_0x361bfa){var _0x1127f8={'raw':!![],'where':{'id':0x1}},_0x11a4fa={};_0x11a4fa[_0x47a5('0x2a')]=_['keys'](db[_0x47a5('0x2b')]['rawAttributes']);_0x11a4fa[_0x47a5('0x2c')]=_[_0x47a5('0x2d')](_0x16631f[_0x47a5('0x2c')]);_0x11a4fa['filters']=_[_0x47a5('0x2e')](_0x11a4fa[_0x47a5('0x2a')],_0x11a4fa[_0x47a5('0x2c')]);_0x1127f8[_0x47a5('0x2f')]=_['intersection'](_0x11a4fa['model'],qs[_0x47a5('0x30')](_0x16631f[_0x47a5('0x2c')]['fields']));_0x1127f8['attributes']=_0x1127f8[_0x47a5('0x2f')][_0x47a5('0x31')]?_0x1127f8['attributes']:_0x11a4fa[_0x47a5('0x2a')];_0x1127f8=_['merge']({},_0x1127f8,_0x16631f[_0x47a5('0x32')]);return utilLicense[_0x47a5('0x33')](_0x1127f8)['then'](respondWithResult(_0x361bfa,null))['catch'](handleError(_0x361bfa,null));};exports[_0x47a5('0x22')]=function(_0x5910bb,_0x403028){if(_0x5910bb[_0x47a5('0x34')]['id']){delete _0x5910bb[_0x47a5('0x34')]['id'];}return db['License'][_0x47a5('0x35')]({'where':{'id':_0x5910bb['params']['id']}})['then'](handleEntityNotFound(_0x403028,null))[_0x47a5('0x23')](function(_0x5a8a7c){var _0x25cce0=_0x5a8a7c['get']({'plain':!![]});return utilLicense[_0x47a5('0x36')](_0x25cce0,_0x5910bb[_0x47a5('0x34')][_0x47a5('0x37')]);})[_0x47a5('0x23')](function(_0x36add5){if(!_0x36add5[_0x47a5('0x38')]){return saveUpdates(_0x5910bb[_0x47a5('0x34')],null);}return _0x36add5;})[_0x47a5('0x23')](respondWithResult(_0x403028,null))[_0x47a5('0x39')](handleError(_0x403028,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 9ee0b7e..00861c1 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 _0x9a08=['util','../../config/logger','moment','bluebird','request-promise','path','./license.attributes','exports','define','License','license'];(function(_0x4865d0,_0x4aab92){var _0x19f585=function(_0x454342){while(--_0x454342){_0x4865d0['push'](_0x4865d0['shift']());}};_0x19f585(++_0x4aab92);}(_0x9a08,0x1d9));var _0x89a0=function(_0x70cd0c,_0x385194){_0x70cd0c=_0x70cd0c-0x0;var _0x2effd5=_0x9a08[_0x70cd0c];return _0x2effd5;};'use strict';var _=require('lodash');var util=require(_0x89a0('0x0'));var logger=require(_0x89a0('0x1'))('api');var moment=require(_0x89a0('0x2'));var BPromise=require(_0x89a0('0x3'));var rp=require(_0x89a0('0x4'));var fs=require('fs');var path=require(_0x89a0('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x89a0('0x6'));module[_0x89a0('0x7')]=function(_0x1599eb,_0x3797c0){return _0x1599eb[_0x89a0('0x8')](_0x89a0('0x9'),attributes,{'tableName':_0x89a0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe7f6=['../../config/environment','./license.attributes','exports','define','license','lodash','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x2976da,_0x50996d){var _0x56e62b=function(_0x1b1b22){while(--_0x1b1b22){_0x2976da['push'](_0x2976da['shift']());}};_0x56e62b(++_0x50996d);}(_0xe7f6,0x118));var _0x6e7f=function(_0x1a8ff0,_0x20788d){_0x1a8ff0=_0x1a8ff0-0x0;var _0x3588bf=_0xe7f6[_0x1a8ff0];return _0x3588bf;};'use strict';var _=require(_0x6e7f('0x0'));var util=require('util');var logger=require(_0x6e7f('0x1'))('api');var moment=require(_0x6e7f('0x2'));var BPromise=require(_0x6e7f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6e7f('0x4'));var rimraf=require(_0x6e7f('0x5'));var config=require(_0x6e7f('0x6'));var attributes=require(_0x6e7f('0x7'));module[_0x6e7f('0x8')]=function(_0x3a2e0d,_0x18af0d){return _0x3a2e0d[_0x6e7f('0x9')]('License',attributes,{'tableName':_0x6e7f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index 5f96af3..d3a629b 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 _0x82e8=['License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','info'];(function(_0x473ab8,_0x361c29){var _0x5dbe02=function(_0x5490c0){while(--_0x5490c0){_0x473ab8['push'](_0x473ab8['shift']());}};_0x5dbe02(++_0x361c29);}(_0x82e8,0x1ec));var _0x882e=function(_0x150322,_0x2199fb){_0x150322=_0x150322-0x0;var _0x606a08=_0x82e8[_0x150322];return _0x606a08;};'use strict';var _=require(_0x882e('0x0'));var util=require(_0x882e('0x1'));var moment=require(_0x882e('0x2'));var BPromise=require('bluebird');var rs=require(_0x882e('0x3'));var fs=require('fs');var Redis=require(_0x882e('0x4'));var db=require(_0x882e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x882e('0x6'))(_0x882e('0x7'));var config=require(_0x882e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x882e('0x9')][_0x882e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x590ae8,_0x5de1ce,_0x4a417c){return new BPromise(function(_0x2c6e66,_0x154ff3){return client['request'](_0x590ae8,_0x4a417c)['then'](function(_0x436eb1){logger[_0x882e('0xb')](_0x882e('0xc'),_0x5de1ce,_0x882e('0xd'));logger[_0x882e('0xe')](_0x882e('0xf'),_0x5de1ce,_0x882e('0xd'),JSON[_0x882e('0x10')](_0x436eb1));if(_0x436eb1[_0x882e('0x11')]){if(_0x436eb1[_0x882e('0x11')]['code']===0x1f4){logger[_0x882e('0x11')](_0x882e('0xc'),_0x5de1ce,_0x436eb1['error'][_0x882e('0x12')]);return _0x154ff3(_0x436eb1['error'][_0x882e('0x12')]);}logger['error']('License,\x20%s,\x20%s',_0x5de1ce,_0x436eb1[_0x882e('0x11')][_0x882e('0x12')]);return _0x2c6e66(_0x436eb1[_0x882e('0x11')][_0x882e('0x12')]);}else{logger[_0x882e('0xb')](_0x882e('0xc'),_0x5de1ce,_0x882e('0xd'));_0x2c6e66(_0x436eb1[_0x882e('0x13')][_0x882e('0x12')]);}})[_0x882e('0x14')](function(_0x317bfd){logger[_0x882e('0x11')](_0x882e('0xc'),_0x5de1ce,_0x317bfd);_0x154ff3(_0x317bfd);});});} \ No newline at end of file +var _0xa88f=['code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','client','http','request','then','info','License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x1ce803,_0x16389f){var _0x1771e9=function(_0x2db3b6){while(--_0x2db3b6){_0x1ce803['push'](_0x1ce803['shift']());}};_0x1771e9(++_0x16389f);}(_0xa88f,0x1a8));var _0xfa88=function(_0x27fc03,_0x30c398){_0x27fc03=_0x27fc03-0x0;var _0xeb4523=_0xa88f[_0x27fc03];return _0xeb4523;};'use strict';var _=require(_0xfa88('0x0'));var util=require(_0xfa88('0x1'));var moment=require('moment');var BPromise=require(_0xfa88('0x2'));var rs=require(_0xfa88('0x3'));var fs=require('fs');var Redis=require(_0xfa88('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfa88('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xfa88('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xfa88('0x7')][_0xfa88('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2b5153,_0x1677a6,_0x46fcba){return new BPromise(function(_0x18d7af,_0x387db0){return client[_0xfa88('0x9')](_0x2b5153,_0x46fcba)[_0xfa88('0xa')](function(_0x349a68){logger[_0xfa88('0xb')](_0xfa88('0xc'),_0x1677a6,'request\x20sent');logger[_0xfa88('0xd')](_0xfa88('0xe'),_0x1677a6,_0xfa88('0xf'),JSON['stringify'](_0x349a68));if(_0x349a68[_0xfa88('0x10')]){if(_0x349a68[_0xfa88('0x10')][_0xfa88('0x11')]===0x1f4){logger[_0xfa88('0x10')](_0xfa88('0xc'),_0x1677a6,_0x349a68['error'][_0xfa88('0x12')]);return _0x387db0(_0x349a68[_0xfa88('0x10')]['message']);}logger[_0xfa88('0x10')](_0xfa88('0xc'),_0x1677a6,_0x349a68[_0xfa88('0x10')][_0xfa88('0x12')]);return _0x18d7af(_0x349a68[_0xfa88('0x10')][_0xfa88('0x12')]);}else{logger[_0xfa88('0xb')](_0xfa88('0xc'),_0x1677a6,'request\x20sent');_0x18d7af(_0x349a68[_0xfa88('0x13')]['message']);}})[_0xfa88('0x14')](function(_0x563e2b){logger[_0xfa88('0x10')](_0xfa88('0xc'),_0x1677a6,_0x563e2b);_0x387db0(_0x563e2b);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 7b40b26..605eded 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 _0xc32e=['/:id/canned_answers','/:id/in_servers','/:id/out_servers','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','/:id/verify','/:id/users','getAgents','post','addDisposition','addImap','addInteraction','addApplications','addAgents','put','/:id','removeDispositions','removeAnswers','delete','removeImap','removeSmtp','destroy','removeAgents','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','show','/:id/dispositions'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xc32e,0x98));var _0xec32=function(_0x56bf38,_0x163f23){_0x56bf38=_0x56bf38-0x0;var _0x4b3582=_0xc32e[_0x56bf38];return _0x4b3582;};'use strict';var multer=require('multer');var util=require(_0xec32('0x0'));var path=require(_0xec32('0x1'));var timeout=require(_0xec32('0x2'));var express=require(_0xec32('0x3'));var router=express[_0xec32('0x4')]();var fs_extra=require(_0xec32('0x5'));var auth=require(_0xec32('0x6'));var interaction=require(_0xec32('0x7'));var config=require(_0xec32('0x8'));var controller=require(_0xec32('0x9'));router[_0xec32('0xa')]('/',auth[_0xec32('0xb')](),controller[_0xec32('0xc')]);router[_0xec32('0xa')](_0xec32('0xd'),auth[_0xec32('0xb')](),controller['describe']);router[_0xec32('0xa')]('/:id',auth[_0xec32('0xb')](),controller[_0xec32('0xe')]);router['get'](_0xec32('0xf'),auth[_0xec32('0xb')](),controller['getDispositions']);router[_0xec32('0xa')](_0xec32('0x10'),auth[_0xec32('0xb')](),controller['getAnswers']);router[_0xec32('0xa')](_0xec32('0x11'),auth[_0xec32('0xb')](),controller['getImap']);router[_0xec32('0xa')](_0xec32('0x12'),auth[_0xec32('0xb')](),controller['getSmtp']);router[_0xec32('0xa')](_0xec32('0x13'),auth[_0xec32('0xb')](),controller[_0xec32('0x14')]);router[_0xec32('0xa')](_0xec32('0x15'),auth[_0xec32('0xb')](),controller[_0xec32('0x16')]);router[_0xec32('0xa')](_0xec32('0x17'),auth[_0xec32('0xb')](),controller['getMessages']);router[_0xec32('0xa')](_0xec32('0x18'),auth[_0xec32('0xb')](),controller['verifySmtp']);router[_0xec32('0xa')](_0xec32('0x19'),auth[_0xec32('0xb')](),controller[_0xec32('0x1a')]);router[_0xec32('0x1b')](_0xec32('0xf'),auth[_0xec32('0xb')](),controller[_0xec32('0x1c')]);router[_0xec32('0x1b')](_0xec32('0x10'),auth['isAuthenticated'](),controller['addAnswer']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xec32('0x1b')]('/:id/in_servers',auth[_0xec32('0xb')](),controller[_0xec32('0x1d')]);router[_0xec32('0x1b')]('/:id/out_servers',auth['isAuthenticated'](),controller['addSmtp']);router['post'](_0xec32('0x13'),auth[_0xec32('0xb')](),controller[_0xec32('0x1e')]);router[_0xec32('0x1b')]('/:id/applications',auth[_0xec32('0xb')](),controller[_0xec32('0x1f')]);router[_0xec32('0x1b')]('/:id/send',auth['isAuthenticated'](),controller['send']);router[_0xec32('0x1b')](_0xec32('0x19'),auth[_0xec32('0xb')](),controller[_0xec32('0x20')]);router[_0xec32('0x21')](_0xec32('0x22'),auth[_0xec32('0xb')](),controller['update']);router['delete'](_0xec32('0xf'),auth[_0xec32('0xb')](),controller[_0xec32('0x23')]);router['delete'](_0xec32('0x10'),auth[_0xec32('0xb')](),controller[_0xec32('0x24')]);router[_0xec32('0x25')](_0xec32('0x11'),auth['isAuthenticated'](),controller[_0xec32('0x26')]);router[_0xec32('0x25')](_0xec32('0x12'),auth[_0xec32('0xb')](),controller[_0xec32('0x27')]);router['delete'](_0xec32('0x22'),auth['isAuthenticated'](),controller[_0xec32('0x28')]);router[_0xec32('0x25')]('/:id/users',auth[_0xec32('0xb')](),controller[_0xec32('0x29')]);module['exports']=router; \ No newline at end of file +var _0x4b93=['send','update','delete','removeAnswers','removeImap','destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/:id','getAnswers','/:id/in_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getMessages','/:id/verify','/:id/users','getAgents','/:id/dispositions','post','/:id/canned_answers','addAnswer','create','addImap','/:id/out_servers','addSmtp','addInteraction','/:id/send'];(function(_0x1d6f0d,_0xe970f0){var _0x48dde1=function(_0x2b39f6){while(--_0x2b39f6){_0x1d6f0d['push'](_0x1d6f0d['shift']());}};_0x48dde1(++_0xe970f0);}(_0x4b93,0xa3));var _0x34b9=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0x4b93[_0x8de54f];return _0x14cba4;};'use strict';var multer=require(_0x34b9('0x0'));var util=require(_0x34b9('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x34b9('0x2'));var router=express[_0x34b9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x34b9('0x4'));var interaction=require(_0x34b9('0x5'));var config=require(_0x34b9('0x6'));var controller=require(_0x34b9('0x7'));router[_0x34b9('0x8')]('/',auth[_0x34b9('0x9')](),controller[_0x34b9('0xa')]);router[_0x34b9('0x8')]('/describe',auth[_0x34b9('0x9')](),controller['describe']);router['get'](_0x34b9('0xb'),auth[_0x34b9('0x9')](),controller['show']);router[_0x34b9('0x8')]('/:id/dispositions',auth[_0x34b9('0x9')](),controller['getDispositions']);router[_0x34b9('0x8')]('/:id/canned_answers',auth[_0x34b9('0x9')](),controller[_0x34b9('0xc')]);router['get'](_0x34b9('0xd'),auth[_0x34b9('0x9')](),controller['getImap']);router[_0x34b9('0x8')]('/:id/out_servers',auth[_0x34b9('0x9')](),controller[_0x34b9('0xe')]);router[_0x34b9('0x8')](_0x34b9('0xf'),auth['isAuthenticated'](),controller[_0x34b9('0x10')]);router['get'](_0x34b9('0x11'),auth[_0x34b9('0x9')](),controller['getApplications']);router[_0x34b9('0x8')]('/:id/messages',auth['isAuthenticated'](),controller[_0x34b9('0x12')]);router[_0x34b9('0x8')](_0x34b9('0x13'),auth[_0x34b9('0x9')](),controller['verifySmtp']);router[_0x34b9('0x8')](_0x34b9('0x14'),auth[_0x34b9('0x9')](),controller[_0x34b9('0x15')]);router['post'](_0x34b9('0x16'),auth[_0x34b9('0x9')](),controller['addDisposition']);router[_0x34b9('0x17')](_0x34b9('0x18'),auth[_0x34b9('0x9')](),controller[_0x34b9('0x19')]);router[_0x34b9('0x17')]('/',auth[_0x34b9('0x9')](),controller[_0x34b9('0x1a')]);router['post'](_0x34b9('0xd'),auth[_0x34b9('0x9')](),controller[_0x34b9('0x1b')]);router[_0x34b9('0x17')](_0x34b9('0x1c'),auth[_0x34b9('0x9')](),controller[_0x34b9('0x1d')]);router[_0x34b9('0x17')](_0x34b9('0xf'),auth[_0x34b9('0x9')](),controller[_0x34b9('0x1e')]);router['post'](_0x34b9('0x11'),auth[_0x34b9('0x9')](),controller['addApplications']);router[_0x34b9('0x17')](_0x34b9('0x1f'),auth[_0x34b9('0x9')](),controller[_0x34b9('0x20')]);router['post']('/:id/users',auth[_0x34b9('0x9')](),controller['addAgents']);router['put'](_0x34b9('0xb'),auth[_0x34b9('0x9')](),controller[_0x34b9('0x21')]);router[_0x34b9('0x22')](_0x34b9('0x16'),auth[_0x34b9('0x9')](),controller['removeDispositions']);router[_0x34b9('0x22')](_0x34b9('0x18'),auth[_0x34b9('0x9')](),controller[_0x34b9('0x23')]);router[_0x34b9('0x22')](_0x34b9('0xd'),auth[_0x34b9('0x9')](),controller[_0x34b9('0x24')]);router[_0x34b9('0x22')]('/:id/out_servers',auth[_0x34b9('0x9')](),controller['removeSmtp']);router['delete'](_0x34b9('0xb'),auth[_0x34b9('0x9')](),controller[_0x34b9('0x25')]);router['delete'](_0x34b9('0x14'),auth[_0x34b9('0x9')](),controller['removeAgents']);module[_0x34b9('0x26')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index b4debe0..1fa462f 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 _0x669d=['yahoo','outlook365','getDataValue','provider','custom','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','hotmail'];(function(_0x152f6b,_0x349844){var _0x3b0d60=function(_0x5847d0){while(--_0x5847d0){_0x152f6b['push'](_0x152f6b['shift']());}};_0x3b0d60(++_0x349844);}(_0x669d,0x148));var _0xd669=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x669d[_0x47aa64];return _0x549c7a;};'use strict';var Sequelize=require(_0xd669('0x0'));module[_0xd669('0x1')]={'description':{'type':Sequelize[_0xd669('0x2')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0xd669('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xd669('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xd669('0x3')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0xd669('0x4')]},'markAsUnread':{'type':Sequelize[_0xd669('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xd669('0x2')],'allowNull':![],'defaultValue':_0xd669('0x5')},'fontSize':{'type':Sequelize[_0xd669('0x6')](0x2)[_0xd669('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xd669('0x4')],'defaultValue':function(){return _0xd669('0x8');}},'notificationSound':{'type':Sequelize[_0xd669('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd669('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd669('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xd669('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd669('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd669('0x6')],'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[_0xd669('0x3')],'defaultValue':![],'comment':_0xd669('0x9'),'set':function(_0x1ba810){if(!_0x1ba810)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0xd669('0xa')]('mandatoryDisposition',_0x1ba810);}},'provider':{'type':Sequelize['ENUM']('gmail',_0xd669('0xb'),_0xd669('0xc'),_0xd669('0xd')),'defaultValue':null,'get':function(){if(!this[_0xd669('0xe')](_0xd669('0xf')))return _0xd669('0x10');return this[_0xd669('0xe')]('provider');}}}; \ No newline at end of file +var _0xd9d1=['STRING','BOOLEAN','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM','gmail','hotmail','yahoo','outlook365','getDataValue','provider','custom','sequelize','exports'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0xd9d1,0x1b7));var _0x1d9d=function(_0x5a6b80,_0x5bee8f){_0x5a6b80=_0x5a6b80-0x0;var _0x3972e0=_0xd9d1[_0x5a6b80];return _0x3972e0;};'use strict';var Sequelize=require(_0x1d9d('0x0'));module[_0x1d9d('0x1')]={'description':{'type':Sequelize[_0x1d9d('0x2')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0x1d9d('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x1d9d('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x1d9d('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x1d9d('0x2')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0x1d9d('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x1d9d('0x2')],'allowNull':![],'defaultValue':_0x1d9d('0x4')},'fontSize':{'type':Sequelize[_0x1d9d('0x5')](0x2)[_0x1d9d('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x1d9d('0x7');}},'notificationSound':{'type':Sequelize[_0x1d9d('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x1d9d('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1d9d('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1d9d('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1d9d('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x1d9d('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x1d9d('0x3')],'defaultValue':![],'comment':_0x1d9d('0x9'),'set':function(_0x1601e4){if(!_0x1601e4)this[_0x1d9d('0xa')](_0x1d9d('0xb'),null);this['setDataValue'](_0x1d9d('0xc'),_0x1601e4);}},'provider':{'type':Sequelize[_0x1d9d('0xd')](_0x1d9d('0xe'),_0x1d9d('0xf'),_0x1d9d('0x10'),_0x1d9d('0x11')),'defaultValue':null,'get':function(){if(!this[_0x1d9d('0x12')](_0x1d9d('0x13')))return _0x1d9d('0x14');return this['getDataValue'](_0x1d9d('0x13'));}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 8c8c72a..6bb85da 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 _0xb044=['sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','getMessages','MailMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','split','CmList','List','Contacts','updatedAt','DESC','from','attachments','join','root','server/files/attachments','basename','auth','secure','SendMail','sendMail','List\x20not\x20found','subject','attach','out','messageId','Interaction','Messages','CloudProvider','OAuth2','data5','VerifySmtp','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','omit','spread','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','moment','path','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','redis','defaults','socket.io-emitter','./mailAccount.socket','jayson/promise','client','http','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','json','offset','limit','count','set','update','destroy','then','MailAccounts','UserProfileResource','end','stack','name','send','index','MailServerIn','Imap','Smtp','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','include','findAll','rows','show','params','MailServerOut','find','body','describe','Disposition','create','getDispositions','findOne','pick','removeDispositions','ids','MailAccountId','CannedAnswer','getAnswers','removeAnswers','custom','provider','email','isNil','active','description','user','username','password','pass','modernAuthentication','CloudProviderId','service','host','port','authentication','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','removeSmtp','setSmtp','MailInteraction','includeAll','CmContact','User','fullname','internal','Tag','color','tag'];(function(_0x11ca63,_0xea9f9c){var _0x41f1f6=function(_0xb80b69){while(--_0xb80b69){_0x11ca63['push'](_0x11ca63['shift']());}};_0x41f1f6(++_0xea9f9c);}(_0xb044,0xea));var _0x4b04=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xb044[_0xfae23b];return _0x200640;};'use strict';var moment=require(_0x4b04('0x0'));var BPromise=require('bluebird');var util=require('util');var path=require(_0x4b04('0x1'));var _=require(_0x4b04('0x2'));var juice=require(_0x4b04('0x3'));var Redis=require(_0x4b04('0x4'));var qs=require(_0x4b04('0x5'));var logger=require(_0x4b04('0x6'))('api');var config=require(_0x4b04('0x7'));var db=require('../../mysqldb')['db'];config[_0x4b04('0x8')]=_[_0x4b04('0x9')](config[_0x4b04('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x4b04('0xa'))(new Redis(config[_0x4b04('0x8')]));require(_0x4b04('0xb'))['register'](socket);var jayson=require(_0x4b04('0xc'));var client=jayson[_0x4b04('0xd')][_0x4b04('0xe')]({'port':0x232b});function respondWithRpcPromise(_0x31febb,_0x35eaa5,_0x5f573c,_0x1eae23){return new BPromise(function(_0x586ef6,_0x56b0d8){var _0x113d26=_0x1eae23||client;return _0x113d26[_0x4b04('0xf')](_0x31febb,_0x5f573c)['then'](function(_0x4b4889){logger[_0x4b04('0x10')](_0x4b04('0x11'),_0x35eaa5,_0x4b04('0x12'));logger[_0x4b04('0x13')](_0x4b04('0x14'),_0x35eaa5,'request\x20sent',JSON[_0x4b04('0x15')](_0x4b4889));if(_0x4b4889[_0x4b04('0x16')]){if(_0x4b4889['error']['code']===0x1f4){logger[_0x4b04('0x16')](_0x4b04('0x11'),_0x35eaa5,_0x4b4889[_0x4b04('0x16')][_0x4b04('0x17')]);return _0x56b0d8(_0x4b4889[_0x4b04('0x16')]['message']);}logger[_0x4b04('0x16')]('MailAccount,\x20%s,\x20%s',_0x35eaa5,_0x4b4889['error'][_0x4b04('0x17')]);return _0x586ef6(_0x4b4889['error'][_0x4b04('0x17')]);}else{logger['info'](_0x4b04('0x11'),_0x35eaa5,_0x4b04('0x12'));_0x586ef6(_0x4b4889['result'][_0x4b04('0x17')]);}})[_0x4b04('0x18')](function(_0x20b0ed){logger['error']('MailAccount,\x20%s,\x20%s',_0x35eaa5,_0x20b0ed);_0x56b0d8(_0x20b0ed);});});}function respondWithStatusCode(_0x44fa82,_0x135283){_0x135283=_0x135283||0xcc;return function(_0x237fa4){if(_0x237fa4){return _0x44fa82[_0x4b04('0x19')](_0x135283);}return _0x44fa82[_0x4b04('0x1a')](_0x135283)['end']();};}function respondWithResult(_0x37878f,_0x23ccb4){_0x23ccb4=_0x23ccb4||0xc8;return function(_0x143210){if(_0x143210){return _0x37878f['status'](_0x23ccb4)[_0x4b04('0x1b')](_0x143210);}};}function respondWithFilteredResult(_0x10d589,_0x2dfd9a){return function(_0x1c18a7){if(_0x1c18a7){var _0x3082ba=typeof _0x2dfd9a[_0x4b04('0x1c')]==='undefined'&&typeof _0x2dfd9a[_0x4b04('0x1d')]==='undefined';var _0x197eb5=_0x1c18a7['count'];var _0x18f600=_0x3082ba?0x0:_0x2dfd9a[_0x4b04('0x1c')];var _0x1b05ad=_0x3082ba?_0x1c18a7[_0x4b04('0x1e')]:_0x2dfd9a[_0x4b04('0x1c')]+_0x2dfd9a['limit'];var _0x4ea957;if(_0x1b05ad>=_0x197eb5){_0x1b05ad=_0x197eb5;_0x4ea957=0xc8;}else{_0x4ea957=0xce;}_0x10d589[_0x4b04('0x1a')](_0x4ea957);return _0x10d589[_0x4b04('0x1f')]('Content-Range',_0x18f600+'-'+_0x1b05ad+'/'+_0x197eb5)['json'](_0x1c18a7);}return null;};}function saveUpdates(_0x2ffc33){return function(_0x448d5e){if(_0x448d5e){return _0x448d5e[_0x4b04('0x20')](_0x2ffc33)['then'](function(_0x521593){return _0x521593;});}return null;};}function removeEntity(_0x59e955){return function(_0x2db92e){if(_0x2db92e){return _0x2db92e[_0x4b04('0x21')]()[_0x4b04('0x22')](function(){var _0x53ac5f=_0x2db92e['get']({'plain':!![]});var _0x1a7c4d=_0x4b04('0x23');return db[_0x4b04('0x24')][_0x4b04('0x21')]({'where':{'type':_0x1a7c4d,'resourceId':_0x53ac5f['id']}})['then'](function(){return _0x2db92e;});})[_0x4b04('0x22')](function(){_0x59e955[_0x4b04('0x1a')](0xcc)[_0x4b04('0x25')]();});}};}function handleEntityNotFound(_0x5499b0){return function(_0x23c4cf){if(!_0x23c4cf){_0x5499b0[_0x4b04('0x19')](0x194);}return _0x23c4cf;};}function handleError(_0x344b5e,_0x4b3b4b){_0x4b3b4b=_0x4b3b4b||0x1f4;return function(_0x5c8150){logger[_0x4b04('0x16')](_0x5c8150[_0x4b04('0x26')]);if(_0x5c8150[_0x4b04('0x27')]){delete _0x5c8150[_0x4b04('0x27')];}_0x344b5e['status'](_0x4b3b4b)[_0x4b04('0x28')](_0x5c8150);};}exports[_0x4b04('0x29')]=function(_0x42805a,_0x572b9f){var _0x559497={'include':[{'model':db[_0x4b04('0x2a')],'as':_0x4b04('0x2b')},{'model':db['MailServerOut'],'as':_0x4b04('0x2c')},{'model':db[_0x4b04('0x2d')],'as':_0x4b04('0x2e')}]},_0x506c07={},_0x5b794e={'count':0x0,'rows':[]};var _0x59df99=_[_0x4b04('0x2f')](db[_0x4b04('0x30')][_0x4b04('0x31')],function(_0x33bcd2){return{'name':_0x33bcd2[_0x4b04('0x32')],'type':_0x33bcd2['type'][_0x4b04('0x33')]};});_0x506c07[_0x4b04('0x34')]=_[_0x4b04('0x2f')](_0x59df99,_0x4b04('0x27'));_0x506c07[_0x4b04('0x35')]=_[_0x4b04('0x36')](_0x42805a['query']);_0x506c07[_0x4b04('0x37')]=_[_0x4b04('0x38')](_0x506c07[_0x4b04('0x34')],_0x506c07[_0x4b04('0x35')]);_0x559497[_0x4b04('0x39')]=_[_0x4b04('0x38')](_0x506c07[_0x4b04('0x34')],qs[_0x4b04('0x3a')](_0x42805a[_0x4b04('0x35')]['fields']));_0x559497[_0x4b04('0x39')]=_0x559497[_0x4b04('0x39')][_0x4b04('0x3b')]?_0x559497[_0x4b04('0x39')]:_0x506c07[_0x4b04('0x34')];if(!_0x42805a[_0x4b04('0x35')][_0x4b04('0x3c')](_0x4b04('0x3d'))){_0x559497[_0x4b04('0x1d')]=qs[_0x4b04('0x1d')](_0x42805a['query'][_0x4b04('0x1d')]);_0x559497[_0x4b04('0x1c')]=qs[_0x4b04('0x1c')](_0x42805a[_0x4b04('0x35')][_0x4b04('0x1c')]);}_0x559497[_0x4b04('0x3e')]=qs[_0x4b04('0x3f')](_0x42805a[_0x4b04('0x35')][_0x4b04('0x3f')]);_0x559497[_0x4b04('0x40')]=qs[_0x4b04('0x37')](_['pick'](_0x42805a[_0x4b04('0x35')],_0x506c07[_0x4b04('0x37')]),_0x59df99);if(_0x42805a['query'][_0x4b04('0x41')]){_0x559497[_0x4b04('0x40')]=_[_0x4b04('0x42')](_0x559497[_0x4b04('0x40')],{'$or':_[_0x4b04('0x2f')](_0x59df99,function(_0x2372bb){if(_0x2372bb[_0x4b04('0x43')]!==_0x4b04('0x44')){var _0x520f6d={};_0x520f6d[_0x2372bb[_0x4b04('0x27')]]={'$like':'%'+_0x42805a[_0x4b04('0x35')][_0x4b04('0x41')]+'%'};return _0x520f6d;}})});}_0x559497=_[_0x4b04('0x42')]({},_0x559497,_0x42805a[_0x4b04('0x45')]);var _0x4cf03a={'where':_0x559497[_0x4b04('0x40')]};return db[_0x4b04('0x30')]['count'](_0x4cf03a)[_0x4b04('0x22')](function(_0x2253b9){_0x5b794e[_0x4b04('0x1e')]=_0x2253b9;if(_0x42805a[_0x4b04('0x35')]['includeAll']){_0x559497[_0x4b04('0x46')]=[{'all':!![]}];}return db[_0x4b04('0x30')][_0x4b04('0x47')](_0x559497);})[_0x4b04('0x22')](function(_0x2ba67c){_0x5b794e[_0x4b04('0x48')]=_0x2ba67c;return _0x5b794e;})[_0x4b04('0x22')](respondWithFilteredResult(_0x572b9f,_0x559497))[_0x4b04('0x18')](handleError(_0x572b9f,null));};exports[_0x4b04('0x49')]=function(_0x3c3249,_0x18f7ab){var _0x1554f6={'raw':![],'where':{'id':_0x3c3249[_0x4b04('0x4a')]['id']},'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db[_0x4b04('0x4b')],'as':'Smtp'},{'model':db[_0x4b04('0x2d')],'as':'mandatoryDispositionPause'}]},_0x3c6cd1={};_0x3c6cd1[_0x4b04('0x34')]=_[_0x4b04('0x36')](db['MailAccount']['rawAttributes']);_0x3c6cd1[_0x4b04('0x35')]=_[_0x4b04('0x36')](_0x3c3249['query']);_0x3c6cd1['filters']=_['intersection'](_0x3c6cd1[_0x4b04('0x34')],_0x3c6cd1[_0x4b04('0x35')]);_0x1554f6[_0x4b04('0x39')]=_[_0x4b04('0x38')](_0x3c6cd1[_0x4b04('0x34')],qs[_0x4b04('0x3a')](_0x3c3249['query']['fields']));_0x1554f6[_0x4b04('0x39')]=_0x1554f6[_0x4b04('0x39')][_0x4b04('0x3b')]?_0x1554f6[_0x4b04('0x39')]:_0x3c6cd1[_0x4b04('0x34')];if(_0x3c3249[_0x4b04('0x35')]['includeAll']){_0x1554f6[_0x4b04('0x46')]=[{'all':!![]}];}_0x1554f6=_['merge']({},_0x1554f6,_0x3c3249[_0x4b04('0x45')]);return db[_0x4b04('0x30')][_0x4b04('0x4c')](_0x1554f6)[_0x4b04('0x22')](handleEntityNotFound(_0x18f7ab,null))[_0x4b04('0x22')](respondWithResult(_0x18f7ab,null))[_0x4b04('0x18')](handleError(_0x18f7ab,null));};exports[_0x4b04('0x20')]=function(_0x20d0da,_0x552d2b){if(_0x20d0da[_0x4b04('0x4d')]['id']){delete _0x20d0da[_0x4b04('0x4d')]['id'];}return db[_0x4b04('0x30')][_0x4b04('0x4c')]({'where':{'id':_0x20d0da[_0x4b04('0x4a')]['id']},'include':[{'model':db[_0x4b04('0x2a')],'as':_0x4b04('0x2b')},{'model':db['MailServerOut'],'as':_0x4b04('0x2c')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x552d2b,null))[_0x4b04('0x22')](saveUpdates(_0x20d0da['body'],null))[_0x4b04('0x22')](function(_0x30706c){if(_0x30706c&&_0x20d0da[_0x4b04('0x4d')][_0x4b04('0x2b')]){return db[_0x4b04('0x2a')]['update'](_0x20d0da[_0x4b04('0x4d')][_0x4b04('0x2b')],{'where':{'MailAccountId':_0x30706c['id']}})[_0x4b04('0x22')](function(){return _0x30706c;});}return _0x30706c;})[_0x4b04('0x22')](function(_0x420088){if(_0x420088&&_0x20d0da[_0x4b04('0x4d')][_0x4b04('0x2c')]){return db[_0x4b04('0x4b')][_0x4b04('0x20')](_0x20d0da[_0x4b04('0x4d')][_0x4b04('0x2c')],{'where':{'MailAccountId':_0x420088['id']}})[_0x4b04('0x22')](function(){return _0x420088;});}return _0x420088;})[_0x4b04('0x22')](respondWithResult(_0x552d2b,null))[_0x4b04('0x18')](handleError(_0x552d2b,null));};exports[_0x4b04('0x4e')]=function(_0x1ae5dc,_0x3c6688){return db[_0x4b04('0x30')]['describe']()[_0x4b04('0x22')](respondWithResult(_0x3c6688,null))['catch'](handleError(_0x3c6688,null));};exports['addDisposition']=function(_0x3b45ae,_0x2de8ae){if(_0x3b45ae['body']['id']){delete _0x3b45ae[_0x4b04('0x4d')]['id'];}return db['MailAccount'][_0x4b04('0x4c')]({'where':{'id':_0x3b45ae['params']['id']}})[_0x4b04('0x22')](handleEntityNotFound(_0x2de8ae,null))[_0x4b04('0x22')](function(_0x3fd43f){if(_0x3fd43f){_0x3b45ae[_0x4b04('0x4d')]['MailAccountId']=_0x3fd43f['id'];return db[_0x4b04('0x4f')][_0x4b04('0x50')](_0x3b45ae[_0x4b04('0x4d')]);}})[_0x4b04('0x22')](respondWithResult(_0x2de8ae,null))[_0x4b04('0x18')](handleError(_0x2de8ae,null));};exports[_0x4b04('0x51')]=function(_0x43ff03,_0x1179e0){var _0x2fdcf3={'raw':![],'where':{}};var _0x57fa21={};var _0x59202c={'count':0x0,'rows':[]};return db[_0x4b04('0x30')][_0x4b04('0x52')]({'where':{'id':_0x43ff03[_0x4b04('0x4a')]['id']}})[_0x4b04('0x22')](handleEntityNotFound(_0x1179e0,null))[_0x4b04('0x22')](function(_0x1e42bf){if(_0x1e42bf){_0x57fa21[_0x4b04('0x34')]=_[_0x4b04('0x36')](db[_0x4b04('0x4f')][_0x4b04('0x31')]);_0x57fa21[_0x4b04('0x35')]=_[_0x4b04('0x36')](_0x43ff03[_0x4b04('0x35')]);_0x57fa21[_0x4b04('0x37')]=_[_0x4b04('0x38')](_0x57fa21[_0x4b04('0x34')],_0x57fa21['query']);_0x2fdcf3[_0x4b04('0x39')]=_[_0x4b04('0x38')](_0x57fa21['model'],qs[_0x4b04('0x3a')](_0x43ff03[_0x4b04('0x35')][_0x4b04('0x3a')]));_0x2fdcf3['attributes']=_0x2fdcf3[_0x4b04('0x39')][_0x4b04('0x3b')]?_0x2fdcf3['attributes']:_0x57fa21['model'];if(!_0x43ff03[_0x4b04('0x35')]['hasOwnProperty'](_0x4b04('0x3d'))){_0x2fdcf3[_0x4b04('0x1d')]=qs[_0x4b04('0x1d')](_0x43ff03[_0x4b04('0x35')][_0x4b04('0x1d')]);_0x2fdcf3[_0x4b04('0x1c')]=qs[_0x4b04('0x1c')](_0x43ff03['query'][_0x4b04('0x1c')]);}_0x2fdcf3[_0x4b04('0x3e')]=qs[_0x4b04('0x3f')](_0x43ff03[_0x4b04('0x35')]['sort']);_0x2fdcf3['where']=qs['filters'](_[_0x4b04('0x53')](_0x43ff03[_0x4b04('0x35')],_0x57fa21[_0x4b04('0x37')]));_0x2fdcf3[_0x4b04('0x40')]['MailAccountId']=_0x1e42bf['id'];if(_0x43ff03['query'][_0x4b04('0x41')]){_0x2fdcf3[_0x4b04('0x40')]=_[_0x4b04('0x42')](_0x2fdcf3['where'],{'$or':_[_0x4b04('0x2f')](_0x2fdcf3[_0x4b04('0x39')],function(_0x5479d1){var _0x2359eb={};_0x2359eb[_0x5479d1]={'$like':'%'+_0x43ff03[_0x4b04('0x35')][_0x4b04('0x41')]+'%'};return _0x2359eb;})});}_0x2fdcf3=_[_0x4b04('0x42')]({},_0x2fdcf3,_0x43ff03[_0x4b04('0x45')]);return db[_0x4b04('0x4f')][_0x4b04('0x1e')]({'where':_0x2fdcf3[_0x4b04('0x40')]})['then'](function(_0x1ede9b){_0x59202c[_0x4b04('0x1e')]=_0x1ede9b;if(_0x43ff03[_0x4b04('0x35')]['includeAll']){_0x2fdcf3[_0x4b04('0x46')]=[{'all':!![]}];}return db[_0x4b04('0x4f')][_0x4b04('0x47')](_0x2fdcf3);})[_0x4b04('0x22')](function(_0x318b82){_0x59202c[_0x4b04('0x48')]=_0x318b82;return _0x59202c;});}})[_0x4b04('0x22')](respondWithFilteredResult(_0x1179e0,_0x2fdcf3))[_0x4b04('0x18')](handleError(_0x1179e0,null));};exports[_0x4b04('0x54')]=function(_0x4657b0,_0x1d3763){return db[_0x4b04('0x30')]['find']({'where':{'id':_0x4657b0[_0x4b04('0x4a')]['id']}})[_0x4b04('0x22')](handleEntityNotFound(_0x1d3763,null))[_0x4b04('0x22')](function(_0x8c1e3e){if(_0x8c1e3e){return _0x8c1e3e['removeDispositions'](_0x4657b0['query'][_0x4b04('0x55')]);}})['then'](respondWithStatusCode(_0x1d3763,null))['catch'](handleError(_0x1d3763,null));};exports['addAnswer']=function(_0x925f96,_0x58c2af){if(_0x925f96[_0x4b04('0x4d')]['id']){delete _0x925f96[_0x4b04('0x4d')]['id'];}return db['MailAccount'][_0x4b04('0x4c')]({'where':{'id':_0x925f96[_0x4b04('0x4a')]['id']}})[_0x4b04('0x22')](handleEntityNotFound(_0x58c2af,null))[_0x4b04('0x22')](function(_0x58ffa4){if(_0x58ffa4){_0x925f96[_0x4b04('0x4d')][_0x4b04('0x56')]=_0x58ffa4['id'];return db[_0x4b04('0x57')][_0x4b04('0x50')](_0x925f96[_0x4b04('0x4d')]);}})['then'](respondWithResult(_0x58c2af,null))[_0x4b04('0x18')](handleError(_0x58c2af,null));};exports[_0x4b04('0x58')]=function(_0x46cb9d,_0x1c1819){var _0x1717a0={'raw':![],'where':{}};var _0x536073={};var _0xc046bc={'count':0x0,'rows':[]};return db[_0x4b04('0x30')][_0x4b04('0x52')]({'where':{'id':_0x46cb9d['params']['id']}})[_0x4b04('0x22')](handleEntityNotFound(_0x1c1819,null))[_0x4b04('0x22')](function(_0x562773){if(_0x562773){_0x536073[_0x4b04('0x34')]=_['keys'](db[_0x4b04('0x57')][_0x4b04('0x31')]);_0x536073[_0x4b04('0x35')]=_[_0x4b04('0x36')](_0x46cb9d[_0x4b04('0x35')]);_0x536073[_0x4b04('0x37')]=_['intersection'](_0x536073[_0x4b04('0x34')],_0x536073[_0x4b04('0x35')]);_0x1717a0[_0x4b04('0x39')]=_[_0x4b04('0x38')](_0x536073['model'],qs['fields'](_0x46cb9d['query'][_0x4b04('0x3a')]));_0x1717a0[_0x4b04('0x39')]=_0x1717a0[_0x4b04('0x39')][_0x4b04('0x3b')]?_0x1717a0[_0x4b04('0x39')]:_0x536073['model'];if(!_0x46cb9d[_0x4b04('0x35')][_0x4b04('0x3c')](_0x4b04('0x3d'))){_0x1717a0[_0x4b04('0x1d')]=qs[_0x4b04('0x1d')](_0x46cb9d[_0x4b04('0x35')]['limit']);_0x1717a0[_0x4b04('0x1c')]=qs[_0x4b04('0x1c')](_0x46cb9d[_0x4b04('0x35')]['offset']);}_0x1717a0[_0x4b04('0x3e')]=qs[_0x4b04('0x3f')](_0x46cb9d[_0x4b04('0x35')][_0x4b04('0x3f')]);_0x1717a0[_0x4b04('0x40')]=qs[_0x4b04('0x37')](_['pick'](_0x46cb9d[_0x4b04('0x35')],_0x536073[_0x4b04('0x37')]));_0x1717a0[_0x4b04('0x40')][_0x4b04('0x56')]=_0x562773['id'];if(_0x46cb9d[_0x4b04('0x35')][_0x4b04('0x41')]){_0x1717a0[_0x4b04('0x40')]=_[_0x4b04('0x42')](_0x1717a0[_0x4b04('0x40')],{'$or':_[_0x4b04('0x2f')](_0x1717a0[_0x4b04('0x39')],function(_0x23a8de){var _0x1971c3={};_0x1971c3[_0x23a8de]={'$like':'%'+_0x46cb9d[_0x4b04('0x35')][_0x4b04('0x41')]+'%'};return _0x1971c3;})});}_0x1717a0=_[_0x4b04('0x42')]({},_0x1717a0,_0x46cb9d[_0x4b04('0x45')]);return db['CannedAnswer']['count']({'where':_0x1717a0['where']})[_0x4b04('0x22')](function(_0x400e7f){_0xc046bc[_0x4b04('0x1e')]=_0x400e7f;if(_0x46cb9d[_0x4b04('0x35')]['includeAll']){_0x1717a0[_0x4b04('0x46')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x1717a0);})['then'](function(_0x3dbe08){_0xc046bc[_0x4b04('0x48')]=_0x3dbe08;return _0xc046bc;});}})[_0x4b04('0x22')](respondWithFilteredResult(_0x1c1819,_0x1717a0))[_0x4b04('0x18')](handleError(_0x1c1819,null));};exports[_0x4b04('0x59')]=function(_0x4825e3,_0xad524e){return db[_0x4b04('0x30')]['find']({'where':{'id':_0x4825e3['params']['id']}})[_0x4b04('0x22')](handleEntityNotFound(_0xad524e,null))[_0x4b04('0x22')](function(_0x2d9fcf){if(_0x2d9fcf){return _0x2d9fcf[_0x4b04('0x59')](_0x4825e3[_0x4b04('0x35')][_0x4b04('0x55')]);}})[_0x4b04('0x22')](respondWithStatusCode(_0xad524e,null))[_0x4b04('0x18')](handleError(_0xad524e,null));};exports[_0x4b04('0x50')]=function(_0x3fed44,_0x587e6a){var _0x58f606={'name':_0x3fed44[_0x4b04('0x4d')][_0x4b04('0x27')],'key':_0x3fed44[_0x4b04('0x4d')][_0x4b04('0x33')],'provider':_0x3fed44[_0x4b04('0x4d')]['provider']===_0x4b04('0x5a')?null:_0x3fed44['body'][_0x4b04('0x5b')],'email':_0x3fed44[_0x4b04('0x4d')][_0x4b04('0x5c')],'ListId':_0x3fed44[_0x4b04('0x4d')]['ListId'],'active':!_[_0x4b04('0x5d')](_0x3fed44[_0x4b04('0x4d')]['active'])?_0x3fed44['body'][_0x4b04('0x5e')]:!![],'description':_0x3fed44['body'][_0x4b04('0x5f')]||null,'Imap':{},'Smtp':{}};if(_0x58f606[_0x4b04('0x5b')]){_0x58f606[_0x4b04('0x2b')][_0x4b04('0x60')]=_0x58f606[_0x4b04('0x2c')][_0x4b04('0x60')]=_0x3fed44['body'][_0x4b04('0x61')];_0x58f606[_0x4b04('0x2b')][_0x4b04('0x62')]=_0x58f606[_0x4b04('0x2c')][_0x4b04('0x63')]=_0x3fed44[_0x4b04('0x4d')][_0x4b04('0x62')];if(_0x3fed44[_0x4b04('0x4d')][_0x4b04('0x64')]){_0x58f606['Imap'][_0x4b04('0x64')]=_0x58f606[_0x4b04('0x2c')][_0x4b04('0x64')]=!![];_0x58f606[_0x4b04('0x2b')][_0x4b04('0x65')]=_0x58f606[_0x4b04('0x2c')]['CloudProviderId']=_0x3fed44[_0x4b04('0x4d')][_0x4b04('0x65')];_0x58f606['Imap']['user']=_0x58f606['Smtp'][_0x4b04('0x60')]=_0x3fed44['body'][_0x4b04('0x61')];}_0x58f606[_0x4b04('0x2b')]['service']=_0x58f606[_0x4b04('0x2c')][_0x4b04('0x66')]=null;_0x58f606[_0x4b04('0x2b')][_0x4b04('0x67')]=_0x58f606[_0x4b04('0x2c')][_0x4b04('0x67')]=null;_0x58f606['Imap']['port']=_0x58f606[_0x4b04('0x2c')][_0x4b04('0x68')]=null;}else{if(_0x3fed44[_0x4b04('0x4d')]['authentication']){_0x58f606[_0x4b04('0x2b')]['user']=_0x58f606['Smtp'][_0x4b04('0x60')]=_0x3fed44[_0x4b04('0x4d')][_0x4b04('0x61')];_0x58f606[_0x4b04('0x2b')][_0x4b04('0x62')]=_0x58f606['Smtp']['pass']=_0x3fed44[_0x4b04('0x4d')][_0x4b04('0x62')];}else{_0x58f606['Imap'][_0x4b04('0x69')]=_0x58f606['Smtp'][_0x4b04('0x69')]=![];}_0x58f606['Imap']['host']=_0x3fed44['body'][_0x4b04('0x2b')][_0x4b04('0x67')];_0x58f606[_0x4b04('0x2b')][_0x4b04('0x68')]=_0x3fed44['body'][_0x4b04('0x2b')][_0x4b04('0x68')];_0x58f606[_0x4b04('0x2c')][_0x4b04('0x67')]=_0x3fed44['body'][_0x4b04('0x2c')][_0x4b04('0x67')];_0x58f606[_0x4b04('0x2c')]['port']=_0x3fed44[_0x4b04('0x4d')][_0x4b04('0x2c')][_0x4b04('0x68')];}return db[_0x4b04('0x30')]['create'](_0x58f606,{'include':[{'model':db['MailServerOut'],'as':_0x4b04('0x2c')},{'model':db[_0x4b04('0x2a')],'as':_0x4b04('0x2b')}]})['then'](function(_0x2648b7){var _0x5c53f0=_0x3fed44['user'][_0x4b04('0x6a')]({'plain':!![]});if(!_0x5c53f0)throw new Error(_0x4b04('0x6b'));if(_0x5c53f0[_0x4b04('0x6c')]===_0x4b04('0x60')){var _0x386f0b=_0x2648b7['get']({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x4b04('0x23'),'userProfileId':_0x5c53f0[_0x4b04('0x6d')]},'raw':!![]})['then'](function(_0x2c196b){if(_0x2c196b&&_0x2c196b[_0x4b04('0x6e')]===0x0){return db[_0x4b04('0x24')]['create']({'name':_0x386f0b[_0x4b04('0x27')],'resourceId':_0x386f0b['id'],'type':_0x2c196b[_0x4b04('0x27')],'sectionId':_0x2c196b['id']},{})[_0x4b04('0x22')](function(){return _0x2648b7;});}else{return _0x2648b7;}})[_0x4b04('0x18')](function(_0x554263){logger[_0x4b04('0x16')](_0x4b04('0x6f'),_0x554263);throw _0x554263;});}return _0x2648b7;})[_0x4b04('0x22')](respondWithResult(_0x587e6a,0xc9))[_0x4b04('0x18')](handleError(_0x587e6a,null));};exports[_0x4b04('0x70')]=function(_0x32a616,_0x5768bf){return db['MailAccount'][_0x4b04('0x52')]({'where':{'id':_0x32a616[_0x4b04('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5768bf,null))['then'](function(_0x21dfbf){if(_0x21dfbf){return _0x21dfbf['getImap']();}return null;})['then'](respondWithResult(_0x5768bf,null))['catch'](handleError(_0x5768bf,null));};exports[_0x4b04('0x71')]=function(_0x3b5835,_0x497875){if(_0x3b5835['body']['id']){delete _0x3b5835[_0x4b04('0x4d')]['id'];}return db[_0x4b04('0x30')][_0x4b04('0x4c')]({'where':{'id':_0x3b5835['params']['id']}})[_0x4b04('0x22')](handleEntityNotFound(_0x497875,null))[_0x4b04('0x22')](function(_0x273b30){if(_0x273b30){_0x3b5835['body']['MailAccountId']=_0x273b30['id'];return db[_0x4b04('0x2a')][_0x4b04('0x50')](_0x3b5835[_0x4b04('0x4d')]);}})[_0x4b04('0x22')](respondWithResult(_0x497875,null))[_0x4b04('0x18')](handleError(_0x497875,null));};exports[_0x4b04('0x72')]=function(_0xacaaa0,_0x595463){return db[_0x4b04('0x30')][_0x4b04('0x52')]({'where':{'id':_0xacaaa0[_0x4b04('0x4a')]['id']}})[_0x4b04('0x22')](handleEntityNotFound(_0x595463,null))[_0x4b04('0x22')](function(_0x4757ca){if(_0x4757ca){return _0x4757ca[_0x4b04('0x73')](null);}return null;})[_0x4b04('0x22')](respondWithStatusCode(_0x595463,null))[_0x4b04('0x18')](handleError(_0x595463,null));};exports[_0x4b04('0x74')]=function(_0x233770,_0x585222){return db['MailAccount']['findOne']({'where':{'id':_0x233770[_0x4b04('0x4a')]['id']}})[_0x4b04('0x22')](handleEntityNotFound(_0x585222,null))[_0x4b04('0x22')](function(_0x12cb0e){if(_0x12cb0e){return _0x12cb0e['getSmtp']();}return null;})[_0x4b04('0x22')](respondWithResult(_0x585222,null))['catch'](handleError(_0x585222,null));};exports['addSmtp']=function(_0x45857a,_0x4e32f1){if(_0x45857a['body']['id']){delete _0x45857a[_0x4b04('0x4d')]['id'];}return db[_0x4b04('0x30')]['find']({'where':{'id':_0x45857a[_0x4b04('0x4a')]['id']}})[_0x4b04('0x22')](handleEntityNotFound(_0x4e32f1,null))[_0x4b04('0x22')](function(_0x11693d){if(_0x11693d){_0x45857a['body'][_0x4b04('0x56')]=_0x11693d['id'];return db[_0x4b04('0x4b')][_0x4b04('0x50')](_0x45857a['body']);}})[_0x4b04('0x22')](respondWithResult(_0x4e32f1,null))[_0x4b04('0x18')](handleError(_0x4e32f1,null));};exports[_0x4b04('0x75')]=function(_0x406335,_0x3f1e91){return db[_0x4b04('0x30')][_0x4b04('0x52')]({'where':{'id':_0x406335['params']['id']}})[_0x4b04('0x22')](handleEntityNotFound(_0x3f1e91,null))[_0x4b04('0x22')](function(_0x490a0f){if(_0x490a0f){return _0x490a0f[_0x4b04('0x76')](null);}return null;})['then'](respondWithStatusCode(_0x3f1e91,null))[_0x4b04('0x18')](handleError(_0x3f1e91,null));};exports['addInteraction']=function(_0x34c427,_0x2d14be){return db[_0x4b04('0x77')][_0x4b04('0x4c')]({'where':{'id':_0x34c427[_0x4b04('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2d14be,null))['then'](function(_0x1260b8){if(_0x1260b8){return _0x1260b8['addInteraction'](_0x34c427[_0x4b04('0x4d')][_0x4b04('0x55')],_['omit'](_0x34c427[_0x4b04('0x4d')],[_0x4b04('0x55'),'id'])||{});}})[_0x4b04('0x22')](respondWithResult(_0x2d14be,null))['catch'](handleError(_0x2d14be,null));};exports['getInteractions']=function(_0x2ddc16,_0x3a2347){var _0xfd8353={'raw':![],'where':{}};var _0x42b958={};var _0x56839a={'count':0x0,'rows':[]};return db[_0x4b04('0x30')][_0x4b04('0x52')]({'where':{'id':_0x2ddc16[_0x4b04('0x4a')]['id']}})[_0x4b04('0x22')](handleEntityNotFound(_0x3a2347,null))['then'](function(_0x3216e8){if(_0x3216e8){_0x42b958[_0x4b04('0x34')]=_[_0x4b04('0x36')](db[_0x4b04('0x77')][_0x4b04('0x31')]);_0x42b958[_0x4b04('0x35')]=_['keys'](_0x2ddc16[_0x4b04('0x35')]);_0x42b958['filters']=_['intersection'](_0x42b958['model'],_0x42b958[_0x4b04('0x35')]);_0xfd8353[_0x4b04('0x39')]=_[_0x4b04('0x38')](_0x42b958['model'],qs[_0x4b04('0x3a')](_0x2ddc16[_0x4b04('0x35')][_0x4b04('0x3a')]));_0xfd8353[_0x4b04('0x39')]=_0xfd8353[_0x4b04('0x39')][_0x4b04('0x3b')]?_0xfd8353[_0x4b04('0x39')]:_0x42b958[_0x4b04('0x34')];if(!_0x2ddc16[_0x4b04('0x35')]['hasOwnProperty'](_0x4b04('0x3d'))){_0xfd8353[_0x4b04('0x1d')]=qs['limit'](_0x2ddc16[_0x4b04('0x35')][_0x4b04('0x1d')]);_0xfd8353[_0x4b04('0x1c')]=qs[_0x4b04('0x1c')](_0x2ddc16[_0x4b04('0x35')][_0x4b04('0x1c')]);}_0xfd8353[_0x4b04('0x3e')]=qs[_0x4b04('0x3f')](_0x2ddc16['query']['sort']);_0xfd8353[_0x4b04('0x40')]=qs[_0x4b04('0x37')](_['pick'](_0x2ddc16[_0x4b04('0x35')],_0x42b958[_0x4b04('0x37')]));_0xfd8353[_0x4b04('0x40')][_0x4b04('0x56')]=_0x3216e8['id'];if(_0x2ddc16[_0x4b04('0x35')][_0x4b04('0x41')]){_0xfd8353[_0x4b04('0x40')]=_[_0x4b04('0x42')](_0xfd8353[_0x4b04('0x40')],{'$or':_[_0x4b04('0x2f')](_0xfd8353[_0x4b04('0x39')],function(_0x363262){var _0x1603d9={};_0x1603d9[_0x363262]={'$like':'%'+_0x2ddc16[_0x4b04('0x35')][_0x4b04('0x41')]+'%'};return _0x1603d9;})});}_0xfd8353=_['merge']({},_0xfd8353,_0x2ddc16[_0x4b04('0x45')]);return db[_0x4b04('0x77')][_0x4b04('0x1e')]({'where':_0xfd8353[_0x4b04('0x40')]})['then'](function(_0xaa68ff){_0x56839a[_0x4b04('0x1e')]=_0xaa68ff;if(_0x2ddc16['query'][_0x4b04('0x78')]){_0xfd8353[_0x4b04('0x46')]=[{'model':db[_0x4b04('0x79')],'as':'Contact','required':![]},{'model':db[_0x4b04('0x7a')],'as':'Owner','attributes':[_0x4b04('0x27'),_0x4b04('0x7b'),_0x4b04('0x7c')],'required':![]},{'model':db[_0x4b04('0x7d')],'as':'Tags','attributes':['id',_0x4b04('0x27'),_0x4b04('0x7e')],'where':_0x2ddc16['query'][_0x4b04('0x7f')]?{'id':_0x2ddc16[_0x4b04('0x35')][_0x4b04('0x7f')]}:undefined,'required':_0x2ddc16['query'][_0x4b04('0x7f')]?!![]:![]}];}return db['MailInteraction'][_0x4b04('0x47')](_0xfd8353);})[_0x4b04('0x22')](function(_0x3841d2){_0x56839a[_0x4b04('0x48')]=_0x3841d2;return _0x56839a;});}})[_0x4b04('0x22')](respondWithFilteredResult(_0x3a2347,_0xfd8353))[_0x4b04('0x18')](handleError(_0x3a2347,null));};exports['addApplications']=function addApplications(_0x57e363,_0x3f0c94){var _0x3f797e=_0x57e363[_0x4b04('0x4a')]['id'];var _0x14ec29=_0x57e363[_0x4b04('0x4d')];var _0xbd1b06=0xc8;var _0x117fc1=null;return db[_0x4b04('0x80')]['transaction']({'isolationLevel':db[_0x4b04('0x80')][_0x4b04('0x81')][_0x4b04('0x82')][_0x4b04('0x83')]},function(_0x45706a){return db['MailAccount']['findOne']({'where':{'id':_0x3f797e},'transaction':_0x45706a})[_0x4b04('0x22')](function(_0x3492f7){if(_0x3492f7){return db[_0x4b04('0x84')][_0x4b04('0x21')]({'where':{'MailAccountId':_0x3f797e},'transaction':_0x45706a})[_0x4b04('0x22')](function(){var _0x30a7c0=_['map'](_0x14ec29,function(_0x178802){_0x178802[_0x4b04('0x56')]=_0x3f797e;return _0x178802;});return db[_0x4b04('0x84')][_0x4b04('0x85')](_0x30a7c0,{'transaction':_0x45706a});});}else{_0xbd1b06=0x194;_0x117fc1=[];}});})[_0x4b04('0x22')](function(){if(_0xbd1b06!==0x194){return db['MailApplication'][_0x4b04('0x86')]({'where':{'MailAccountId':_0x3f797e},'order':_0x4b04('0x87')})['then'](function(_0x384d63){_0x117fc1=_0x384d63;});}})[_0x4b04('0x18')](function(_0x1c5067){_0xbd1b06=0x1f4;logger[_0x4b04('0x16')](_0x1c5067[_0x4b04('0x26')]);if(_0x1c5067[_0x4b04('0x27')]){delete _0x1c5067['name'];}_0x117fc1=_0x1c5067;})[_0x4b04('0x88')](function(){if(_0x117fc1===null){_0x3f0c94[_0x4b04('0x19')](_0xbd1b06);}else{if(_0xbd1b06===0x1f4){_0x3f0c94[_0x4b04('0x1a')](_0xbd1b06)[_0x4b04('0x28')](_0x117fc1);}else{_0x3f0c94['status'](_0xbd1b06)[_0x4b04('0x1b')](_0x117fc1);}}});};exports['getApplications']=function(_0x1a32d4,_0x27e4ff){var _0x1d85fd={};var _0x525066={};var _0x312770;var _0x312275;return db['MailAccount'][_0x4b04('0x52')]({'where':{'id':_0x1a32d4[_0x4b04('0x4a')]['id']}})[_0x4b04('0x22')](handleEntityNotFound(_0x27e4ff,null))[_0x4b04('0x22')](function(_0x115218){if(_0x115218){_0x312770=_0x115218;_0x525066['model']=_[_0x4b04('0x36')](db[_0x4b04('0x84')]['rawAttributes']);_0x525066[_0x4b04('0x35')]=_[_0x4b04('0x36')](_0x1a32d4[_0x4b04('0x35')]);_0x525066['filters']=_['intersection'](_0x525066[_0x4b04('0x34')],_0x525066['query']);_0x1d85fd[_0x4b04('0x39')]=_[_0x4b04('0x38')](_0x525066[_0x4b04('0x34')],qs['fields'](_0x1a32d4[_0x4b04('0x35')][_0x4b04('0x3a')]));_0x1d85fd['attributes']=_0x1d85fd[_0x4b04('0x39')][_0x4b04('0x3b')]?_0x1d85fd[_0x4b04('0x39')]:_0x525066[_0x4b04('0x34')];_0x1d85fd[_0x4b04('0x3e')]=qs[_0x4b04('0x3f')](_0x1a32d4[_0x4b04('0x35')]['sort']);_0x1d85fd[_0x4b04('0x40')]=qs[_0x4b04('0x37')](_[_0x4b04('0x53')](_0x1a32d4['query'],_0x525066[_0x4b04('0x37')]));if(_0x1a32d4[_0x4b04('0x35')][_0x4b04('0x41')]){_0x1d85fd[_0x4b04('0x40')]=_['merge'](_0x1d85fd['where'],{'$or':_[_0x4b04('0x2f')](_0x1d85fd[_0x4b04('0x39')],function(_0x2960da){var _0x125392={};_0x125392[_0x2960da]={'$like':'%'+_0x1a32d4[_0x4b04('0x35')][_0x4b04('0x41')]+'%'};return _0x125392;})});}_0x1d85fd=_[_0x4b04('0x42')]({},_0x1d85fd,_0x1a32d4[_0x4b04('0x45')]);return _0x312770[_0x4b04('0x89')](_0x1d85fd);}})['then'](function(_0x4572d5){if(_0x4572d5){_0x312275=_0x4572d5['length'];if(!_0x1a32d4['query']['hasOwnProperty'](_0x4b04('0x3d'))){_0x1d85fd[_0x4b04('0x1d')]=qs['limit'](_0x1a32d4[_0x4b04('0x35')][_0x4b04('0x1d')]);_0x1d85fd[_0x4b04('0x1c')]=qs['offset'](_0x1a32d4[_0x4b04('0x35')][_0x4b04('0x1c')]);}return _0x312770['getApplications'](_0x1d85fd);}})[_0x4b04('0x22')](function(_0x53e110){if(_0x53e110){return _0x53e110?{'count':_0x312275,'rows':_0x53e110}:null;}})[_0x4b04('0x22')](respondWithResult(_0x27e4ff,null))['catch'](handleError(_0x27e4ff,null));};exports[_0x4b04('0x8a')]=function(_0x1e2075,_0x67c2df){var _0x5c0532={'raw':!![],'where':{}};var _0x52c717={};var _0x214890={'count':0x0,'rows':[]};return db['MailAccount'][_0x4b04('0x52')]({'where':{'id':_0x1e2075[_0x4b04('0x4a')]['id']}})[_0x4b04('0x22')](handleEntityNotFound(_0x67c2df,null))['then'](function(_0x556cd0){if(_0x556cd0){_0x52c717[_0x4b04('0x34')]=_['keys'](db[_0x4b04('0x8b')][_0x4b04('0x31')]);_0x52c717[_0x4b04('0x35')]=_[_0x4b04('0x36')](_0x1e2075[_0x4b04('0x35')]);_0x52c717[_0x4b04('0x37')]=_[_0x4b04('0x38')](_0x52c717[_0x4b04('0x34')],_0x52c717['query']);_0x5c0532[_0x4b04('0x39')]=_[_0x4b04('0x38')](_0x52c717[_0x4b04('0x34')],qs[_0x4b04('0x3a')](_0x1e2075[_0x4b04('0x35')][_0x4b04('0x3a')]));_0x5c0532[_0x4b04('0x39')]=_0x5c0532[_0x4b04('0x39')][_0x4b04('0x3b')]?_0x5c0532[_0x4b04('0x39')]:_0x52c717[_0x4b04('0x34')];if(!_0x1e2075['query']['hasOwnProperty'](_0x4b04('0x3d'))){_0x5c0532['limit']=qs[_0x4b04('0x1d')](_0x1e2075[_0x4b04('0x35')][_0x4b04('0x1d')]);_0x5c0532[_0x4b04('0x1c')]=qs[_0x4b04('0x1c')](_0x1e2075[_0x4b04('0x35')][_0x4b04('0x1c')]);}_0x5c0532[_0x4b04('0x3e')]=qs[_0x4b04('0x3f')](_0x1e2075['query'][_0x4b04('0x3f')]);_0x5c0532[_0x4b04('0x40')]=qs[_0x4b04('0x37')](_[_0x4b04('0x53')](_0x1e2075[_0x4b04('0x35')],_0x52c717['filters']));_0x5c0532['where'][_0x4b04('0x56')]=_0x556cd0['id'];if(_0x1e2075[_0x4b04('0x35')][_0x4b04('0x41')]){_0x5c0532[_0x4b04('0x40')]=_[_0x4b04('0x42')](_0x5c0532[_0x4b04('0x40')],{'$or':_[_0x4b04('0x2f')](_0x5c0532[_0x4b04('0x39')],function(_0x32b8b3){var _0x2bbb2c={};_0x2bbb2c[_0x32b8b3]={'$like':'%'+_0x1e2075[_0x4b04('0x35')][_0x4b04('0x41')]+'%'};return _0x2bbb2c;})});}if(_0x1e2075[_0x4b04('0x35')]['$gte']){var _0x4e92ea=_0x1e2075[_0x4b04('0x35')][_0x4b04('0x8c')]['split'](',');var _0x31a1a5={};_0x31a1a5[_0x4e92ea[0x0]]={'$gte':moment(_0x4e92ea[0x1])[_0x4b04('0x8d')](_0x4b04('0x8e'))};_0x5c0532[_0x4b04('0x40')]=_['merge'](_0x5c0532[_0x4b04('0x40')],_0x31a1a5);}_0x5c0532=_['merge']({},_0x5c0532,_0x1e2075[_0x4b04('0x45')]);return db['MailMessage'][_0x4b04('0x1e')]({'where':_0x5c0532[_0x4b04('0x40')]})[_0x4b04('0x22')](function(_0x2caae1){_0x214890[_0x4b04('0x1e')]=_0x2caae1;if(_0x1e2075[_0x4b04('0x35')][_0x4b04('0x78')]){_0x5c0532[_0x4b04('0x46')]=[{'all':!![]}];}return db[_0x4b04('0x8b')]['findAll'](_0x5c0532);})['then'](function(_0x5e7a3c){if(_0x1e2075['query'][_0x4b04('0x8f')]===_0x4b04('0x90')){for(var _0xfe42e=0x0;_0xfe42e<_0x5e7a3c[_0x4b04('0x3b')];_0xfe42e++){_0x5e7a3c[_0xfe42e][_0x4b04('0x4d')]=juice(_0x5e7a3c[_0xfe42e]['body']);}}_0x214890[_0x4b04('0x48')]=_0x5e7a3c;return _0x214890;});}})['then'](respondWithFilteredResult(_0x67c2df,_0x5c0532))[_0x4b04('0x18')](handleError(_0x67c2df,null));};exports['send']=function(_0x44e579,_0x17503a){var _0x395916,_0x6ad541={},_0x34f7fa;if(_0x44e579[_0x4b04('0x4d')]['to']){_0x34f7fa=_0x44e579[_0x4b04('0x4d')]['to'][_0x4b04('0x91')](',')[0x0];}return db[_0x4b04('0x30')][_0x4b04('0x4c')]({'where':{'id':_0x44e579[_0x4b04('0x4a')]['id']},'include':[{'model':db[_0x4b04('0x92')],'as':_0x4b04('0x93'),'include':[{'model':db[_0x4b04('0x79')],'as':_0x4b04('0x94'),'where':{'email':_0x34f7fa},'limit':0x1,'order':[[_0x4b04('0x95'),_0x4b04('0x96')]]}]},{'model':db['MailServerOut'],'as':_0x4b04('0x2c'),'raw':!![]}]})['then'](handleEntityNotFound(_0x17503a,null))[_0x4b04('0x22')](function(_0x4be672){if(_0x4be672){_0x395916=_0x4be672;if(_0x4be672[_0x4b04('0x2c')]){if(_[_0x4b04('0x5d')](_0x44e579[_0x4b04('0x4d')][_0x4b04('0x97')])){_0x44e579[_0x4b04('0x4d')][_0x4b04('0x97')]=util[_0x4b04('0x8d')]('%s\x20<%s>',_0x4be672[_0x4b04('0x27')],_0x4be672['email']||_0x4be672[_0x4b04('0x2c')][_0x4b04('0x60')]);}if(_0x44e579['body'][_0x4b04('0x98')]&&_0x44e579[_0x4b04('0x4d')][_0x4b04('0x98')]['length']){for(var _0x21db57=0x0;_0x21db57<_0x44e579[_0x4b04('0x4d')][_0x4b04('0x98')][_0x4b04('0x3b')];_0x21db57+=0x1){_0x44e579[_0x4b04('0x4d')][_0x4b04('0x98')][_0x21db57]={'filename':_0x44e579['body'][_0x4b04('0x98')][_0x21db57]['name'],'path':path[_0x4b04('0x99')](config[_0x4b04('0x9a')],_0x4b04('0x9b'),_0x44e579[_0x4b04('0x4d')][_0x4b04('0x98')][_0x21db57][_0x4b04('0x9c')])};}}var _0xbbb4b0={'tls':{'rejectUnauthorized':![]}};if(_[_0x4b04('0x5d')](_0x4be672['Smtp'][_0x4b04('0x66')])){if(_0x4be672[_0x4b04('0x2c')]['authentication']){_0xbbb4b0[_0x4b04('0x9d')]={'user':_0x4be672['Smtp'][_0x4b04('0x60')],'pass':_0x4be672[_0x4b04('0x2c')][_0x4b04('0x63')]};}_0xbbb4b0[_0x4b04('0x67')]=_0x4be672[_0x4b04('0x2c')][_0x4b04('0x67')];_0xbbb4b0[_0x4b04('0x68')]=_0x4be672[_0x4b04('0x2c')]['port'];_0xbbb4b0['secure']=_0x4be672['Smtp'][_0x4b04('0x9e')];}else{_0xbbb4b0[_0x4b04('0x66')]=_0x4be672[_0x4b04('0x2c')][_0x4b04('0x66')];_0xbbb4b0['auth']={'user':_0x4be672['Smtp'][_0x4b04('0x60')],'pass':_0x4be672[_0x4b04('0x2c')]['pass']};}return respondWithRpcPromise(_0x4b04('0x9f'),_0x4b04('0xa0'),{'account':_0xbbb4b0,'message':_0x44e579[_0x4b04('0x4d')]});}else{throw new Error('List\x20not\x20found');}}})[_0x4b04('0x22')](function(_0x156565){if(_0x156565){_0x6ad541=_0x156565;if(_0x395916[_0x4b04('0x93')]){if(_0x395916['List'][_0x4b04('0x94')][_0x4b04('0x3b')]){return _0x395916['List'][_0x4b04('0x94')][0x0];}else{return db[_0x4b04('0x79')][_0x4b04('0x50')](_[_0x4b04('0x9')](_0x44e579[_0x4b04('0x4d')],{'firstName':_0x44e579['body']['to'],'email':_0x44e579['body']['to'],'phone':_0x44e579['body']['to'],'ListId':_0x395916['ListId']}));}}else{throw new Error(_0x4b04('0xa1'));}}})[_0x4b04('0x22')](function(_0x2b1706){if(_0x2b1706){var _0x2203b8={'UserId':_0x44e579[_0x4b04('0x60')]['id'],'ContactId':_0x2b1706['id'],'MailAccountId':_0x395916['id'],'inReplyTo':_0x6ad541['messageId'],'to':_0x44e579[_0x4b04('0x4d')][_0x4b04('0x97')],'cc':_0x44e579[_0x4b04('0x4d')]['cc'],'subject':_0x44e579[_0x4b04('0x4d')][_0x4b04('0xa2')],'attach':_0x44e579[_0x4b04('0x4d')][_0x4b04('0xa3')],'firstMsgDirection':_0x4b04('0xa4'),'lastMsgAt':moment()[_0x4b04('0x8d')](_0x4b04('0x8e')),'lastMsgDirection':_0x4b04('0xa4'),'Messages':[_[_0x4b04('0x42')](_0x44e579['body'],{'messageId':_0x6ad541[_0x4b04('0xa5')],'sentAt':moment()['format'](_0x4b04('0x8e')),'read':!![],'MailAccountId':_0x395916['id'],'UserId':_0x44e579[_0x4b04('0x60')]['id'],'ContactId':_0x2b1706['id']})]};if(_0x44e579[_0x4b04('0x4d')][_0x4b04('0xa6')]){_0x2203b8=_[_0x4b04('0x42')](_0x2203b8,_0x44e579[_0x4b04('0x4d')][_0x4b04('0xa6')]);}return db[_0x4b04('0x77')][_0x4b04('0x50')](_0x2203b8,{'include':[{'model':db[_0x4b04('0x8b')],'as':_0x4b04('0xa7')}]});}})['then'](respondWithResult(_0x17503a,null))[_0x4b04('0x18')](handleError(_0x17503a,null));};exports['verifySmtp']=function(_0x19284c,_0x3013ce){return db[_0x4b04('0x30')]['find']({'where':{'id':_0x19284c[_0x4b04('0x4a')]['id']},'include':[{'model':db[_0x4b04('0x4b')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x4b04('0xa8')],'as':_0x4b04('0xa8'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x3013ce,null))[_0x4b04('0x22')](function(_0x6f61b1){if(_0x6f61b1&&_0x6f61b1[_0x4b04('0x2c')]){var _0x482b60={'id':_0x6f61b1['id'],'tls':{'rejectUnauthorized':![]}};if(_0x6f61b1[_0x4b04('0x2c')][_0x4b04('0x66')]){_0x482b60[_0x4b04('0x66')]=_0x6f61b1[_0x4b04('0x2c')][_0x4b04('0x66')];}else{_0x482b60[_0x4b04('0x67')]=_0x6f61b1[_0x4b04('0x2c')]['host'];_0x482b60[_0x4b04('0x68')]=_0x6f61b1[_0x4b04('0x2c')][_0x4b04('0x68')];_0x482b60['secure']=_0x6f61b1['Smtp'][_0x4b04('0x9e')];}if(_0x6f61b1[_0x4b04('0x2c')][_0x4b04('0x69')]){if(_0x6f61b1[_0x4b04('0x2c')]['modernAuthentication']){_0x482b60[_0x4b04('0x9d')]={'type':_0x4b04('0xa9'),'user':_0x6f61b1[_0x4b04('0x2c')]['user'],'accessToken':_0x6f61b1[_0x4b04('0x2c')][_0x4b04('0xa8')][_0x4b04('0xaa')]};}else{_0x482b60[_0x4b04('0x9d')]={'user':_0x6f61b1[_0x4b04('0x2c')][_0x4b04('0x60')],'pass':_0x6f61b1[_0x4b04('0x2c')][_0x4b04('0x63')]};}}return respondWithRpcPromise(_0x4b04('0xab'),'verifySmtp',{'account':_0x482b60});}})[_0x4b04('0x22')](respondWithResult(_0x3013ce,null))[_0x4b04('0x18')](handleError(_0x3013ce,null));};exports[_0x4b04('0x21')]=function(_0x3c23ed,_0x5070c8){return db[_0x4b04('0x30')]['find']({'where':{'id':_0x3c23ed['params']['id']}})[_0x4b04('0x22')](handleEntityNotFound(_0x5070c8,null))[_0x4b04('0x22')](function(_0x2e8bf9){if(_0x2e8bf9&&_0x2e8bf9[_0x4b04('0x66')]){throw new db['Sequelize']['ValidationError'](_0x4b04('0xac'));}return _0x2e8bf9;})[_0x4b04('0x22')](removeEntity(_0x5070c8,null))[_0x4b04('0x18')](handleError(_0x5070c8,null));};exports[_0x4b04('0xad')]=function(_0xb80cc,_0x9774a3){return db[_0x4b04('0x30')][_0x4b04('0x4c')]({'where':{'id':_0xb80cc[_0x4b04('0x4a')]['id']}})['then'](handleEntityNotFound(_0x9774a3,null))[_0x4b04('0x22')](function(_0x40b41e){if(_0x40b41e){return _0x40b41e[_0x4b04('0xad')](_0xb80cc[_0x4b04('0x4d')][_0x4b04('0x55')],_[_0x4b04('0xae')](_0xb80cc['body'],['ids','id'])||{})[_0x4b04('0xaf')](function(_0x26d769){for(var _0x56c1cf=0x0;_0x56c1cf<_0xb80cc[_0x4b04('0x4d')][_0x4b04('0x55')]['length'];_0x56c1cf+=0x1){socket[_0x4b04('0xb0')](_0x4b04('0xb1'),{'UserId':Number(_0xb80cc[_0x4b04('0x4d')]['ids'][_0x56c1cf]),'MailAccountId':Number(_0xb80cc[_0x4b04('0x4a')]['id'])});}return _0x26d769;});}})['then'](respondWithResult(_0x9774a3,null))[_0x4b04('0x18')](handleError(_0x9774a3,null));};exports[_0x4b04('0xb2')]=function(_0x159eeb,_0x16590d){return db[_0x4b04('0x30')][_0x4b04('0x4c')]({'where':{'id':_0x159eeb[_0x4b04('0x4a')]['id']}})[_0x4b04('0x22')](handleEntityNotFound(_0x16590d,null))[_0x4b04('0x22')](function(_0x22cc36){if(_0x22cc36){return _0x22cc36[_0x4b04('0xb2')](_0x159eeb[_0x4b04('0x35')]['ids'])[_0x4b04('0x22')](function(){if(_['isArray'](_0x159eeb[_0x4b04('0x35')][_0x4b04('0x55')])){for(var _0x27e44a=0x0;_0x27e44a<_0x159eeb['query'][_0x4b04('0x55')]['length'];_0x27e44a+=0x1){socket['emit'](_0x4b04('0xb3'),{'UserId':Number(_0x159eeb[_0x4b04('0x35')][_0x4b04('0x55')][_0x27e44a]),'MailAccountId':Number(_0x159eeb[_0x4b04('0x4a')]['id'])});}}else{socket[_0x4b04('0xb0')](_0x4b04('0xb3'),{'UserId':Number(_0x159eeb[_0x4b04('0x35')][_0x4b04('0x55')]),'MailAccountId':Number(_0x159eeb['params']['id'])});}});}})[_0x4b04('0x22')](respondWithStatusCode(_0x16590d,null))[_0x4b04('0x18')](handleError(_0x16590d,null));};exports['getAgents']=function(_0x27ae9a,_0x4321d1){var _0x449389={};var _0x2c099e={};var _0x2093c6;var _0x490c6e;return db['MailAccount'][_0x4b04('0x52')]({'where':{'id':_0x27ae9a[_0x4b04('0x4a')]['id']}})[_0x4b04('0x22')](handleEntityNotFound(_0x4321d1,null))['then'](function(_0x466864){if(_0x466864){_0x2093c6=_0x466864;_0x2c099e['model']=_[_0x4b04('0x36')](db[_0x4b04('0x7a')][_0x4b04('0x31')]);_0x2c099e[_0x4b04('0x35')]=_[_0x4b04('0x36')](_0x27ae9a[_0x4b04('0x35')]);_0x2c099e[_0x4b04('0x37')]=_[_0x4b04('0x38')](_0x2c099e[_0x4b04('0x34')],_0x2c099e[_0x4b04('0x35')]);_0x449389[_0x4b04('0x39')]=_[_0x4b04('0x38')](_0x2c099e[_0x4b04('0x34')],qs[_0x4b04('0x3a')](_0x27ae9a['query']['fields']));_0x449389[_0x4b04('0x39')]=_0x449389[_0x4b04('0x39')][_0x4b04('0x3b')]?_0x449389['attributes']:_0x2c099e[_0x4b04('0x34')];_0x449389['order']=qs['sort'](_0x27ae9a[_0x4b04('0x35')][_0x4b04('0x3f')]);_0x449389[_0x4b04('0x40')]=qs[_0x4b04('0x37')](_[_0x4b04('0x53')](_0x27ae9a['query'],_0x2c099e[_0x4b04('0x37')]));if(_0x27ae9a[_0x4b04('0x35')][_0x4b04('0x41')]){_0x449389[_0x4b04('0x40')]=_[_0x4b04('0x42')](_0x449389['where'],{'$or':_['map'](_0x449389['attributes'],function(_0x49ac0d){var _0x4f5274={};_0x4f5274[_0x49ac0d]={'$like':'%'+_0x27ae9a[_0x4b04('0x35')][_0x4b04('0x41')]+'%'};return _0x4f5274;})});}_0x449389=_['merge']({},_0x449389,_0x27ae9a['options']);return _0x2093c6[_0x4b04('0xb4')](_0x449389);}})['then'](function(_0x2c445c){if(_0x2c445c){_0x490c6e=_0x2c445c[_0x4b04('0x3b')];if(!_0x27ae9a[_0x4b04('0x35')][_0x4b04('0x3c')](_0x4b04('0x3d'))){_0x449389[_0x4b04('0x1d')]=qs['limit'](_0x27ae9a['query'][_0x4b04('0x1d')]);_0x449389['offset']=qs[_0x4b04('0x1c')](_0x27ae9a['query']['offset']);}return _0x2093c6[_0x4b04('0xb4')](_0x449389);}})[_0x4b04('0x22')](function(_0x33df5b){if(_0x33df5b){return _0x33df5b?{'count':_0x490c6e,'rows':_0x33df5b}:null;}})[_0x4b04('0x22')](respondWithResult(_0x4321d1,null))[_0x4b04('0x18')](handleError(_0x4321d1,null));}; \ No newline at end of file +var _0x28c2=['username','service','host','port','authentication','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','MailApplication','findAndCountAll','priority','finally','getApplications','MailMessage','$gte','split','CmList','Contacts','updatedAt','DESC','isNil','from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','auth','secure','sendMail','List\x20not\x20found','List','messageId','subject','attach','out','format','YYYY-MM-DD\x20HH:mm:ss','Interaction','Messages','OAuth2','CloudProvider','VerifySmtp','Sequelize','ValidationError','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','moment','util','path','lodash','ioredis','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','./mailAccount.socket','register','then','info','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','MailAccount,\x20%s,\x20%s','result','catch','sendStatus','status','offset','undefined','limit','count','Content-Range','destroy','UserProfileResource','end','stack','name','send','index','Imap','MailServerOut','Smtp','Pause','MailAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','merge','where','options','includeAll','findAll','rows','show','MailServerIn','mandatoryDispositionPause','include','find','update','body','params','describe','addDisposition','MailAccountId','Disposition','create','findOne','hasOwnProperty','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','provider','custom','email','ListId','active','user','password','pass','modernAuthentication','CloudProviderId'];(function(_0x509be2,_0x300194){var _0x5e160a=function(_0x25987f){while(--_0x25987f){_0x509be2['push'](_0x509be2['shift']());}};_0x5e160a(++_0x300194);}(_0x28c2,0x10b));var _0x228c=function(_0x57deb5,_0x30964e){_0x57deb5=_0x57deb5-0x0;var _0x452cf7=_0x28c2[_0x57deb5];return _0x452cf7;};'use strict';var moment=require(_0x228c('0x0'));var BPromise=require('bluebird');var util=require(_0x228c('0x1'));var path=require(_0x228c('0x2'));var _=require(_0x228c('0x3'));var juice=require('juice');var Redis=require(_0x228c('0x4'));var qs=require('../../components/parsers/qs');var logger=require(_0x228c('0x5'))('api');var config=require(_0x228c('0x6'));var db=require(_0x228c('0x7'))['db'];config[_0x228c('0x8')]=_[_0x228c('0x9')](config[_0x228c('0x8')],{'host':_0x228c('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x228c('0x8')]));require(_0x228c('0xb'))[_0x228c('0xc')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232b});function respondWithRpcPromise(_0x765b14,_0x512106,_0x41087e,_0x42f943){return new BPromise(function(_0x46f7a2,_0x3c433f){var _0x246e02=_0x42f943||client;return _0x246e02['request'](_0x765b14,_0x41087e)[_0x228c('0xd')](function(_0x8e3168){logger[_0x228c('0xe')]('MailAccount,\x20%s,\x20%s',_0x512106,_0x228c('0xf'));logger['debug'](_0x228c('0x10'),_0x512106,_0x228c('0xf'),JSON[_0x228c('0x11')](_0x8e3168));if(_0x8e3168[_0x228c('0x12')]){if(_0x8e3168[_0x228c('0x12')]['code']===0x1f4){logger[_0x228c('0x12')]('MailAccount,\x20%s,\x20%s',_0x512106,_0x8e3168[_0x228c('0x12')][_0x228c('0x13')]);return _0x3c433f(_0x8e3168[_0x228c('0x12')][_0x228c('0x13')]);}logger[_0x228c('0x12')](_0x228c('0x14'),_0x512106,_0x8e3168[_0x228c('0x12')][_0x228c('0x13')]);return _0x46f7a2(_0x8e3168['error'][_0x228c('0x13')]);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0x512106,'request\x20sent');_0x46f7a2(_0x8e3168[_0x228c('0x15')][_0x228c('0x13')]);}})[_0x228c('0x16')](function(_0x5e70b0){logger[_0x228c('0x12')]('MailAccount,\x20%s,\x20%s',_0x512106,_0x5e70b0);_0x3c433f(_0x5e70b0);});});}function respondWithStatusCode(_0x14c706,_0x28de4c){_0x28de4c=_0x28de4c||0xcc;return function(_0x3c6539){if(_0x3c6539){return _0x14c706[_0x228c('0x17')](_0x28de4c);}return _0x14c706[_0x228c('0x18')](_0x28de4c)['end']();};}function respondWithResult(_0x22892c,_0x30827b){_0x30827b=_0x30827b||0xc8;return function(_0x42f1de){if(_0x42f1de){return _0x22892c[_0x228c('0x18')](_0x30827b)['json'](_0x42f1de);}};}function respondWithFilteredResult(_0x5154ad,_0x5bb87d){return function(_0x2d6309){if(_0x2d6309){var _0x4084f5=typeof _0x5bb87d[_0x228c('0x19')]===_0x228c('0x1a')&&typeof _0x5bb87d[_0x228c('0x1b')]===_0x228c('0x1a');var _0x16176b=_0x2d6309['count'];var _0x238759=_0x4084f5?0x0:_0x5bb87d['offset'];var _0x12f343=_0x4084f5?_0x2d6309[_0x228c('0x1c')]:_0x5bb87d[_0x228c('0x19')]+_0x5bb87d[_0x228c('0x1b')];var _0x22f8f6;if(_0x12f343>=_0x16176b){_0x12f343=_0x16176b;_0x22f8f6=0xc8;}else{_0x22f8f6=0xce;}_0x5154ad['status'](_0x22f8f6);return _0x5154ad['set'](_0x228c('0x1d'),_0x238759+'-'+_0x12f343+'/'+_0x16176b)['json'](_0x2d6309);}return null;};}function saveUpdates(_0x365b90){return function(_0x541c39){if(_0x541c39){return _0x541c39['update'](_0x365b90)['then'](function(_0x2b5722){return _0x2b5722;});}return null;};}function removeEntity(_0x5284d9){return function(_0x40ce9a){if(_0x40ce9a){return _0x40ce9a[_0x228c('0x1e')]()[_0x228c('0xd')](function(){var _0x146b0b=_0x40ce9a['get']({'plain':!![]});var _0x3d3c19='MailAccounts';return db[_0x228c('0x1f')][_0x228c('0x1e')]({'where':{'type':_0x3d3c19,'resourceId':_0x146b0b['id']}})[_0x228c('0xd')](function(){return _0x40ce9a;});})[_0x228c('0xd')](function(){_0x5284d9['status'](0xcc)[_0x228c('0x20')]();});}};}function handleEntityNotFound(_0x3c28ee){return function(_0x7fe9){if(!_0x7fe9){_0x3c28ee['sendStatus'](0x194);}return _0x7fe9;};}function handleError(_0xb8ef4f,_0x3971f6){_0x3971f6=_0x3971f6||0x1f4;return function(_0x13b041){logger[_0x228c('0x12')](_0x13b041[_0x228c('0x21')]);if(_0x13b041[_0x228c('0x22')]){delete _0x13b041[_0x228c('0x22')];}_0xb8ef4f[_0x228c('0x18')](_0x3971f6)[_0x228c('0x23')](_0x13b041);};}exports[_0x228c('0x24')]=function(_0x2ea036,_0x4e0979){var _0x502d0d={'include':[{'model':db['MailServerIn'],'as':_0x228c('0x25')},{'model':db[_0x228c('0x26')],'as':_0x228c('0x27')},{'model':db[_0x228c('0x28')],'as':'mandatoryDispositionPause'}]},_0x3b48de={},_0x1cb31a={'count':0x0,'rows':[]};var _0x3440f3=_['map'](db[_0x228c('0x29')][_0x228c('0x2a')],function(_0x7ff8bc){return{'name':_0x7ff8bc[_0x228c('0x2b')],'type':_0x7ff8bc[_0x228c('0x2c')][_0x228c('0x2d')]};});_0x3b48de[_0x228c('0x2e')]=_[_0x228c('0x2f')](_0x3440f3,_0x228c('0x22'));_0x3b48de[_0x228c('0x30')]=_[_0x228c('0x31')](_0x2ea036[_0x228c('0x30')]);_0x3b48de[_0x228c('0x32')]=_[_0x228c('0x33')](_0x3b48de[_0x228c('0x2e')],_0x3b48de[_0x228c('0x30')]);_0x502d0d[_0x228c('0x34')]=_[_0x228c('0x33')](_0x3b48de['model'],qs[_0x228c('0x35')](_0x2ea036[_0x228c('0x30')][_0x228c('0x35')]));_0x502d0d['attributes']=_0x502d0d[_0x228c('0x34')][_0x228c('0x36')]?_0x502d0d[_0x228c('0x34')]:_0x3b48de[_0x228c('0x2e')];if(!_0x2ea036[_0x228c('0x30')]['hasOwnProperty'](_0x228c('0x37'))){_0x502d0d[_0x228c('0x1b')]=qs['limit'](_0x2ea036[_0x228c('0x30')]['limit']);_0x502d0d[_0x228c('0x19')]=qs['offset'](_0x2ea036['query']['offset']);}_0x502d0d[_0x228c('0x38')]=qs[_0x228c('0x39')](_0x2ea036['query'][_0x228c('0x39')]);_0x502d0d['where']=qs[_0x228c('0x32')](_[_0x228c('0x3a')](_0x2ea036[_0x228c('0x30')],_0x3b48de[_0x228c('0x32')]),_0x3440f3);if(_0x2ea036[_0x228c('0x30')][_0x228c('0x3b')]){_0x502d0d['where']=_[_0x228c('0x3c')](_0x502d0d[_0x228c('0x3d')],{'$or':_['map'](_0x3440f3,function(_0x2bcec5){if(_0x2bcec5[_0x228c('0x2c')]!=='VIRTUAL'){var _0x2bb29a={};_0x2bb29a[_0x2bcec5['name']]={'$like':'%'+_0x2ea036[_0x228c('0x30')][_0x228c('0x3b')]+'%'};return _0x2bb29a;}})});}_0x502d0d=_[_0x228c('0x3c')]({},_0x502d0d,_0x2ea036[_0x228c('0x3e')]);var _0x5b2e89={'where':_0x502d0d[_0x228c('0x3d')]};return db[_0x228c('0x29')][_0x228c('0x1c')](_0x5b2e89)['then'](function(_0x5b2dc3){_0x1cb31a['count']=_0x5b2dc3;if(_0x2ea036[_0x228c('0x30')][_0x228c('0x3f')]){_0x502d0d['include']=[{'all':!![]}];}return db[_0x228c('0x29')][_0x228c('0x40')](_0x502d0d);})[_0x228c('0xd')](function(_0x555069){_0x1cb31a[_0x228c('0x41')]=_0x555069;return _0x1cb31a;})[_0x228c('0xd')](respondWithFilteredResult(_0x4e0979,_0x502d0d))[_0x228c('0x16')](handleError(_0x4e0979,null));};exports[_0x228c('0x42')]=function(_0x273657,_0x49f9b1){var _0x42cd37={'raw':![],'where':{'id':_0x273657['params']['id']},'include':[{'model':db[_0x228c('0x43')],'as':_0x228c('0x25')},{'model':db[_0x228c('0x26')],'as':_0x228c('0x27')},{'model':db[_0x228c('0x28')],'as':_0x228c('0x44')}]},_0x5097a6={};_0x5097a6[_0x228c('0x2e')]=_['keys'](db[_0x228c('0x29')][_0x228c('0x2a')]);_0x5097a6[_0x228c('0x30')]=_[_0x228c('0x31')](_0x273657['query']);_0x5097a6[_0x228c('0x32')]=_[_0x228c('0x33')](_0x5097a6[_0x228c('0x2e')],_0x5097a6[_0x228c('0x30')]);_0x42cd37[_0x228c('0x34')]=_['intersection'](_0x5097a6[_0x228c('0x2e')],qs[_0x228c('0x35')](_0x273657[_0x228c('0x30')][_0x228c('0x35')]));_0x42cd37[_0x228c('0x34')]=_0x42cd37[_0x228c('0x34')]['length']?_0x42cd37[_0x228c('0x34')]:_0x5097a6['model'];if(_0x273657[_0x228c('0x30')][_0x228c('0x3f')]){_0x42cd37[_0x228c('0x45')]=[{'all':!![]}];}_0x42cd37=_[_0x228c('0x3c')]({},_0x42cd37,_0x273657[_0x228c('0x3e')]);return db[_0x228c('0x29')][_0x228c('0x46')](_0x42cd37)[_0x228c('0xd')](handleEntityNotFound(_0x49f9b1,null))[_0x228c('0xd')](respondWithResult(_0x49f9b1,null))[_0x228c('0x16')](handleError(_0x49f9b1,null));};exports[_0x228c('0x47')]=function(_0x51e817,_0x1e8a6f){if(_0x51e817[_0x228c('0x48')]['id']){delete _0x51e817[_0x228c('0x48')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x51e817[_0x228c('0x49')]['id']},'include':[{'model':db[_0x228c('0x43')],'as':_0x228c('0x25')},{'model':db['MailServerOut'],'as':_0x228c('0x27')},{'model':db[_0x228c('0x28')],'as':'mandatoryDispositionPause'}]})[_0x228c('0xd')](handleEntityNotFound(_0x1e8a6f,null))[_0x228c('0xd')](saveUpdates(_0x51e817[_0x228c('0x48')],null))['then'](function(_0x457117){if(_0x457117&&_0x51e817[_0x228c('0x48')][_0x228c('0x25')]){return db[_0x228c('0x43')]['update'](_0x51e817[_0x228c('0x48')][_0x228c('0x25')],{'where':{'MailAccountId':_0x457117['id']}})[_0x228c('0xd')](function(){return _0x457117;});}return _0x457117;})[_0x228c('0xd')](function(_0xf6e8d3){if(_0xf6e8d3&&_0x51e817['body'][_0x228c('0x27')]){return db[_0x228c('0x26')][_0x228c('0x47')](_0x51e817['body'][_0x228c('0x27')],{'where':{'MailAccountId':_0xf6e8d3['id']}})[_0x228c('0xd')](function(){return _0xf6e8d3;});}return _0xf6e8d3;})[_0x228c('0xd')](respondWithResult(_0x1e8a6f,null))[_0x228c('0x16')](handleError(_0x1e8a6f,null));};exports['describe']=function(_0x3fca4f,_0x41da60){return db[_0x228c('0x29')][_0x228c('0x4a')]()[_0x228c('0xd')](respondWithResult(_0x41da60,null))['catch'](handleError(_0x41da60,null));};exports[_0x228c('0x4b')]=function(_0x35c4e6,_0x48608f){if(_0x35c4e6['body']['id']){delete _0x35c4e6[_0x228c('0x48')]['id'];}return db[_0x228c('0x29')][_0x228c('0x46')]({'where':{'id':_0x35c4e6[_0x228c('0x49')]['id']}})[_0x228c('0xd')](handleEntityNotFound(_0x48608f,null))['then'](function(_0x1c1c77){if(_0x1c1c77){_0x35c4e6[_0x228c('0x48')][_0x228c('0x4c')]=_0x1c1c77['id'];return db[_0x228c('0x4d')][_0x228c('0x4e')](_0x35c4e6['body']);}})['then'](respondWithResult(_0x48608f,null))[_0x228c('0x16')](handleError(_0x48608f,null));};exports['getDispositions']=function(_0x55b1eb,_0x23c30d){var _0x22544a={'raw':![],'where':{}};var _0x596264={};var _0x410a68={'count':0x0,'rows':[]};return db[_0x228c('0x29')][_0x228c('0x4f')]({'where':{'id':_0x55b1eb[_0x228c('0x49')]['id']}})['then'](handleEntityNotFound(_0x23c30d,null))[_0x228c('0xd')](function(_0x41212f){if(_0x41212f){_0x596264['model']=_[_0x228c('0x31')](db[_0x228c('0x4d')][_0x228c('0x2a')]);_0x596264[_0x228c('0x30')]=_['keys'](_0x55b1eb[_0x228c('0x30')]);_0x596264[_0x228c('0x32')]=_[_0x228c('0x33')](_0x596264[_0x228c('0x2e')],_0x596264['query']);_0x22544a[_0x228c('0x34')]=_[_0x228c('0x33')](_0x596264[_0x228c('0x2e')],qs[_0x228c('0x35')](_0x55b1eb[_0x228c('0x30')][_0x228c('0x35')]));_0x22544a[_0x228c('0x34')]=_0x22544a[_0x228c('0x34')]['length']?_0x22544a[_0x228c('0x34')]:_0x596264[_0x228c('0x2e')];if(!_0x55b1eb['query'][_0x228c('0x50')](_0x228c('0x37'))){_0x22544a[_0x228c('0x1b')]=qs[_0x228c('0x1b')](_0x55b1eb[_0x228c('0x30')][_0x228c('0x1b')]);_0x22544a[_0x228c('0x19')]=qs[_0x228c('0x19')](_0x55b1eb['query']['offset']);}_0x22544a[_0x228c('0x38')]=qs['sort'](_0x55b1eb[_0x228c('0x30')][_0x228c('0x39')]);_0x22544a['where']=qs[_0x228c('0x32')](_['pick'](_0x55b1eb[_0x228c('0x30')],_0x596264[_0x228c('0x32')]));_0x22544a[_0x228c('0x3d')][_0x228c('0x4c')]=_0x41212f['id'];if(_0x55b1eb[_0x228c('0x30')][_0x228c('0x3b')]){_0x22544a[_0x228c('0x3d')]=_[_0x228c('0x3c')](_0x22544a['where'],{'$or':_[_0x228c('0x2f')](_0x22544a[_0x228c('0x34')],function(_0x3fed26){var _0x2a8ce3={};_0x2a8ce3[_0x3fed26]={'$like':'%'+_0x55b1eb['query'][_0x228c('0x3b')]+'%'};return _0x2a8ce3;})});}_0x22544a=_[_0x228c('0x3c')]({},_0x22544a,_0x55b1eb['options']);return db[_0x228c('0x4d')]['count']({'where':_0x22544a[_0x228c('0x3d')]})[_0x228c('0xd')](function(_0x4e661f){_0x410a68[_0x228c('0x1c')]=_0x4e661f;if(_0x55b1eb[_0x228c('0x30')][_0x228c('0x3f')]){_0x22544a[_0x228c('0x45')]=[{'all':!![]}];}return db[_0x228c('0x4d')][_0x228c('0x40')](_0x22544a);})[_0x228c('0xd')](function(_0x1538b8){_0x410a68[_0x228c('0x41')]=_0x1538b8;return _0x410a68;});}})['then'](respondWithFilteredResult(_0x23c30d,_0x22544a))[_0x228c('0x16')](handleError(_0x23c30d,null));};exports[_0x228c('0x51')]=function(_0x5367d8,_0x555c53){return db[_0x228c('0x29')][_0x228c('0x46')]({'where':{'id':_0x5367d8[_0x228c('0x49')]['id']}})[_0x228c('0xd')](handleEntityNotFound(_0x555c53,null))[_0x228c('0xd')](function(_0x361280){if(_0x361280){return _0x361280[_0x228c('0x51')](_0x5367d8[_0x228c('0x30')][_0x228c('0x52')]);}})[_0x228c('0xd')](respondWithStatusCode(_0x555c53,null))[_0x228c('0x16')](handleError(_0x555c53,null));};exports[_0x228c('0x53')]=function(_0x2aa7a6,_0x33d4c4){if(_0x2aa7a6['body']['id']){delete _0x2aa7a6['body']['id'];}return db['MailAccount'][_0x228c('0x46')]({'where':{'id':_0x2aa7a6[_0x228c('0x49')]['id']}})[_0x228c('0xd')](handleEntityNotFound(_0x33d4c4,null))[_0x228c('0xd')](function(_0x1770f5){if(_0x1770f5){_0x2aa7a6[_0x228c('0x48')]['MailAccountId']=_0x1770f5['id'];return db[_0x228c('0x54')][_0x228c('0x4e')](_0x2aa7a6['body']);}})[_0x228c('0xd')](respondWithResult(_0x33d4c4,null))[_0x228c('0x16')](handleError(_0x33d4c4,null));};exports[_0x228c('0x55')]=function(_0x4ba1b6,_0x5a62c8){var _0x1deb9c={'raw':![],'where':{}};var _0x1e9070={};var _0x322e82={'count':0x0,'rows':[]};return db[_0x228c('0x29')][_0x228c('0x4f')]({'where':{'id':_0x4ba1b6[_0x228c('0x49')]['id']}})[_0x228c('0xd')](handleEntityNotFound(_0x5a62c8,null))['then'](function(_0x1caa31){if(_0x1caa31){_0x1e9070['model']=_['keys'](db[_0x228c('0x54')][_0x228c('0x2a')]);_0x1e9070['query']=_[_0x228c('0x31')](_0x4ba1b6[_0x228c('0x30')]);_0x1e9070[_0x228c('0x32')]=_[_0x228c('0x33')](_0x1e9070[_0x228c('0x2e')],_0x1e9070['query']);_0x1deb9c[_0x228c('0x34')]=_[_0x228c('0x33')](_0x1e9070['model'],qs[_0x228c('0x35')](_0x4ba1b6[_0x228c('0x30')][_0x228c('0x35')]));_0x1deb9c[_0x228c('0x34')]=_0x1deb9c[_0x228c('0x34')][_0x228c('0x36')]?_0x1deb9c['attributes']:_0x1e9070[_0x228c('0x2e')];if(!_0x4ba1b6[_0x228c('0x30')][_0x228c('0x50')](_0x228c('0x37'))){_0x1deb9c['limit']=qs[_0x228c('0x1b')](_0x4ba1b6[_0x228c('0x30')][_0x228c('0x1b')]);_0x1deb9c[_0x228c('0x19')]=qs['offset'](_0x4ba1b6[_0x228c('0x30')][_0x228c('0x19')]);}_0x1deb9c[_0x228c('0x38')]=qs[_0x228c('0x39')](_0x4ba1b6[_0x228c('0x30')][_0x228c('0x39')]);_0x1deb9c[_0x228c('0x3d')]=qs[_0x228c('0x32')](_['pick'](_0x4ba1b6[_0x228c('0x30')],_0x1e9070['filters']));_0x1deb9c[_0x228c('0x3d')][_0x228c('0x4c')]=_0x1caa31['id'];if(_0x4ba1b6['query'][_0x228c('0x3b')]){_0x1deb9c['where']=_['merge'](_0x1deb9c[_0x228c('0x3d')],{'$or':_[_0x228c('0x2f')](_0x1deb9c[_0x228c('0x34')],function(_0x2085a3){var _0x43ed0a={};_0x43ed0a[_0x2085a3]={'$like':'%'+_0x4ba1b6[_0x228c('0x30')][_0x228c('0x3b')]+'%'};return _0x43ed0a;})});}_0x1deb9c=_['merge']({},_0x1deb9c,_0x4ba1b6['options']);return db[_0x228c('0x54')][_0x228c('0x1c')]({'where':_0x1deb9c[_0x228c('0x3d')]})['then'](function(_0x3fb6fe){_0x322e82[_0x228c('0x1c')]=_0x3fb6fe;if(_0x4ba1b6[_0x228c('0x30')][_0x228c('0x3f')]){_0x1deb9c[_0x228c('0x45')]=[{'all':!![]}];}return db[_0x228c('0x54')][_0x228c('0x40')](_0x1deb9c);})['then'](function(_0x3c6c97){_0x322e82[_0x228c('0x41')]=_0x3c6c97;return _0x322e82;});}})[_0x228c('0xd')](respondWithFilteredResult(_0x5a62c8,_0x1deb9c))[_0x228c('0x16')](handleError(_0x5a62c8,null));};exports[_0x228c('0x56')]=function(_0x63c110,_0x19ecf7){return db[_0x228c('0x29')][_0x228c('0x46')]({'where':{'id':_0x63c110[_0x228c('0x49')]['id']}})['then'](handleEntityNotFound(_0x19ecf7,null))[_0x228c('0xd')](function(_0x48276e){if(_0x48276e){return _0x48276e[_0x228c('0x56')](_0x63c110[_0x228c('0x30')][_0x228c('0x52')]);}})[_0x228c('0xd')](respondWithStatusCode(_0x19ecf7,null))[_0x228c('0x16')](handleError(_0x19ecf7,null));};exports[_0x228c('0x4e')]=function(_0x35b7d8,_0x4d9179){var _0x144365={'name':_0x35b7d8[_0x228c('0x48')][_0x228c('0x22')],'key':_0x35b7d8[_0x228c('0x48')][_0x228c('0x2d')],'provider':_0x35b7d8[_0x228c('0x48')][_0x228c('0x57')]===_0x228c('0x58')?null:_0x35b7d8[_0x228c('0x48')][_0x228c('0x57')],'email':_0x35b7d8[_0x228c('0x48')][_0x228c('0x59')],'ListId':_0x35b7d8['body'][_0x228c('0x5a')],'active':!_['isNil'](_0x35b7d8[_0x228c('0x48')][_0x228c('0x5b')])?_0x35b7d8[_0x228c('0x48')][_0x228c('0x5b')]:!![],'description':_0x35b7d8[_0x228c('0x48')]['description']||null,'Imap':{},'Smtp':{}};if(_0x144365['provider']){_0x144365[_0x228c('0x25')][_0x228c('0x5c')]=_0x144365['Smtp']['user']=_0x35b7d8[_0x228c('0x48')]['username'];_0x144365[_0x228c('0x25')][_0x228c('0x5d')]=_0x144365['Smtp'][_0x228c('0x5e')]=_0x35b7d8[_0x228c('0x48')][_0x228c('0x5d')];if(_0x35b7d8[_0x228c('0x48')][_0x228c('0x5f')]){_0x144365[_0x228c('0x25')][_0x228c('0x5f')]=_0x144365[_0x228c('0x27')][_0x228c('0x5f')]=!![];_0x144365['Imap'][_0x228c('0x60')]=_0x144365[_0x228c('0x27')][_0x228c('0x60')]=_0x35b7d8[_0x228c('0x48')][_0x228c('0x60')];_0x144365[_0x228c('0x25')][_0x228c('0x5c')]=_0x144365[_0x228c('0x27')]['user']=_0x35b7d8[_0x228c('0x48')][_0x228c('0x61')];}_0x144365[_0x228c('0x25')][_0x228c('0x62')]=_0x144365['Smtp'][_0x228c('0x62')]=null;_0x144365[_0x228c('0x25')][_0x228c('0x63')]=_0x144365[_0x228c('0x27')][_0x228c('0x63')]=null;_0x144365[_0x228c('0x25')][_0x228c('0x64')]=_0x144365[_0x228c('0x27')]['port']=null;}else{if(_0x35b7d8['body']['authentication']){_0x144365[_0x228c('0x25')][_0x228c('0x5c')]=_0x144365['Smtp']['user']=_0x35b7d8[_0x228c('0x48')][_0x228c('0x61')];_0x144365['Imap'][_0x228c('0x5d')]=_0x144365[_0x228c('0x27')][_0x228c('0x5e')]=_0x35b7d8[_0x228c('0x48')][_0x228c('0x5d')];}else{_0x144365[_0x228c('0x25')][_0x228c('0x65')]=_0x144365['Smtp'][_0x228c('0x65')]=![];}_0x144365['Imap'][_0x228c('0x63')]=_0x35b7d8[_0x228c('0x48')][_0x228c('0x25')]['host'];_0x144365[_0x228c('0x25')]['port']=_0x35b7d8[_0x228c('0x48')][_0x228c('0x25')][_0x228c('0x64')];_0x144365[_0x228c('0x27')]['host']=_0x35b7d8[_0x228c('0x48')]['Smtp'][_0x228c('0x63')];_0x144365[_0x228c('0x27')]['port']=_0x35b7d8[_0x228c('0x48')][_0x228c('0x27')]['port'];}return db[_0x228c('0x29')][_0x228c('0x4e')](_0x144365,{'include':[{'model':db[_0x228c('0x26')],'as':'Smtp'},{'model':db[_0x228c('0x43')],'as':_0x228c('0x25')}]})[_0x228c('0xd')](function(_0x178b13){var _0x3a35a4=_0x35b7d8['user']['get']({'plain':!![]});if(!_0x3a35a4)throw new Error(_0x228c('0x66'));if(_0x3a35a4[_0x228c('0x67')]===_0x228c('0x5c')){var _0x2113ab=_0x178b13[_0x228c('0x68')]({'plain':!![]});return db[_0x228c('0x69')]['find']({'where':{'name':'MailAccounts','userProfileId':_0x3a35a4[_0x228c('0x6a')]},'raw':!![]})[_0x228c('0xd')](function(_0x3d013d){if(_0x3d013d&&_0x3d013d[_0x228c('0x6b')]===0x0){return db[_0x228c('0x1f')][_0x228c('0x4e')]({'name':_0x2113ab['name'],'resourceId':_0x2113ab['id'],'type':_0x3d013d[_0x228c('0x22')],'sectionId':_0x3d013d['id']},{})[_0x228c('0xd')](function(){return _0x178b13;});}else{return _0x178b13;}})['catch'](function(_0x43847b){logger[_0x228c('0x12')](_0x228c('0x6c'),_0x43847b);throw _0x43847b;});}return _0x178b13;})['then'](respondWithResult(_0x4d9179,0xc9))[_0x228c('0x16')](handleError(_0x4d9179,null));};exports[_0x228c('0x6d')]=function(_0x53728f,_0x410298){return db['MailAccount']['findOne']({'where':{'id':_0x53728f[_0x228c('0x49')]['id']}})['then'](handleEntityNotFound(_0x410298,null))[_0x228c('0xd')](function(_0x393eca){if(_0x393eca){return _0x393eca[_0x228c('0x6d')]();}return null;})[_0x228c('0xd')](respondWithResult(_0x410298,null))[_0x228c('0x16')](handleError(_0x410298,null));};exports[_0x228c('0x6e')]=function(_0x1822f2,_0x336b5e){if(_0x1822f2[_0x228c('0x48')]['id']){delete _0x1822f2[_0x228c('0x48')]['id'];}return db[_0x228c('0x29')][_0x228c('0x46')]({'where':{'id':_0x1822f2[_0x228c('0x49')]['id']}})['then'](handleEntityNotFound(_0x336b5e,null))[_0x228c('0xd')](function(_0x19a8aa){if(_0x19a8aa){_0x1822f2['body'][_0x228c('0x4c')]=_0x19a8aa['id'];return db[_0x228c('0x43')][_0x228c('0x4e')](_0x1822f2[_0x228c('0x48')]);}})['then'](respondWithResult(_0x336b5e,null))['catch'](handleError(_0x336b5e,null));};exports[_0x228c('0x6f')]=function(_0x2d157b,_0x2ee521){return db[_0x228c('0x29')][_0x228c('0x4f')]({'where':{'id':_0x2d157b[_0x228c('0x49')]['id']}})[_0x228c('0xd')](handleEntityNotFound(_0x2ee521,null))[_0x228c('0xd')](function(_0x142ea4){if(_0x142ea4){return _0x142ea4[_0x228c('0x70')](null);}return null;})[_0x228c('0xd')](respondWithStatusCode(_0x2ee521,null))[_0x228c('0x16')](handleError(_0x2ee521,null));};exports[_0x228c('0x71')]=function(_0x1580e4,_0x399726){return db[_0x228c('0x29')][_0x228c('0x4f')]({'where':{'id':_0x1580e4['params']['id']}})[_0x228c('0xd')](handleEntityNotFound(_0x399726,null))[_0x228c('0xd')](function(_0x10867e){if(_0x10867e){return _0x10867e[_0x228c('0x71')]();}return null;})['then'](respondWithResult(_0x399726,null))[_0x228c('0x16')](handleError(_0x399726,null));};exports[_0x228c('0x72')]=function(_0xc53797,_0x61321e){if(_0xc53797[_0x228c('0x48')]['id']){delete _0xc53797[_0x228c('0x48')]['id'];}return db[_0x228c('0x29')][_0x228c('0x46')]({'where':{'id':_0xc53797[_0x228c('0x49')]['id']}})[_0x228c('0xd')](handleEntityNotFound(_0x61321e,null))['then'](function(_0x3a8be0){if(_0x3a8be0){_0xc53797[_0x228c('0x48')]['MailAccountId']=_0x3a8be0['id'];return db[_0x228c('0x26')][_0x228c('0x4e')](_0xc53797[_0x228c('0x48')]);}})[_0x228c('0xd')](respondWithResult(_0x61321e,null))[_0x228c('0x16')](handleError(_0x61321e,null));};exports['removeSmtp']=function(_0x3c11cd,_0x228c08){return db['MailAccount'][_0x228c('0x4f')]({'where':{'id':_0x3c11cd[_0x228c('0x49')]['id']}})[_0x228c('0xd')](handleEntityNotFound(_0x228c08,null))[_0x228c('0xd')](function(_0x34a967){if(_0x34a967){return _0x34a967[_0x228c('0x73')](null);}return null;})[_0x228c('0xd')](respondWithStatusCode(_0x228c08,null))['catch'](handleError(_0x228c08,null));};exports[_0x228c('0x74')]=function(_0x196b45,_0x3a5806){return db[_0x228c('0x75')][_0x228c('0x46')]({'where':{'id':_0x196b45['params']['id']}})[_0x228c('0xd')](handleEntityNotFound(_0x3a5806,null))['then'](function(_0x43d73a){if(_0x43d73a){return _0x43d73a['addInteraction'](_0x196b45[_0x228c('0x48')][_0x228c('0x52')],_[_0x228c('0x76')](_0x196b45[_0x228c('0x48')],['ids','id'])||{});}})[_0x228c('0xd')](respondWithResult(_0x3a5806,null))[_0x228c('0x16')](handleError(_0x3a5806,null));};exports[_0x228c('0x77')]=function(_0x4385f2,_0x1db5ef){var _0x19e4bd={'raw':![],'where':{}};var _0x413d03={};var _0x110f96={'count':0x0,'rows':[]};return db['MailAccount'][_0x228c('0x4f')]({'where':{'id':_0x4385f2[_0x228c('0x49')]['id']}})[_0x228c('0xd')](handleEntityNotFound(_0x1db5ef,null))['then'](function(_0x15718e){if(_0x15718e){_0x413d03[_0x228c('0x2e')]=_[_0x228c('0x31')](db['MailInteraction'][_0x228c('0x2a')]);_0x413d03['query']=_['keys'](_0x4385f2[_0x228c('0x30')]);_0x413d03['filters']=_['intersection'](_0x413d03[_0x228c('0x2e')],_0x413d03[_0x228c('0x30')]);_0x19e4bd[_0x228c('0x34')]=_[_0x228c('0x33')](_0x413d03[_0x228c('0x2e')],qs['fields'](_0x4385f2[_0x228c('0x30')]['fields']));_0x19e4bd['attributes']=_0x19e4bd[_0x228c('0x34')][_0x228c('0x36')]?_0x19e4bd[_0x228c('0x34')]:_0x413d03['model'];if(!_0x4385f2[_0x228c('0x30')][_0x228c('0x50')](_0x228c('0x37'))){_0x19e4bd['limit']=qs[_0x228c('0x1b')](_0x4385f2[_0x228c('0x30')][_0x228c('0x1b')]);_0x19e4bd[_0x228c('0x19')]=qs[_0x228c('0x19')](_0x4385f2[_0x228c('0x30')][_0x228c('0x19')]);}_0x19e4bd[_0x228c('0x38')]=qs[_0x228c('0x39')](_0x4385f2[_0x228c('0x30')][_0x228c('0x39')]);_0x19e4bd[_0x228c('0x3d')]=qs[_0x228c('0x32')](_[_0x228c('0x3a')](_0x4385f2['query'],_0x413d03[_0x228c('0x32')]));_0x19e4bd[_0x228c('0x3d')][_0x228c('0x4c')]=_0x15718e['id'];if(_0x4385f2['query'][_0x228c('0x3b')]){_0x19e4bd['where']=_[_0x228c('0x3c')](_0x19e4bd[_0x228c('0x3d')],{'$or':_[_0x228c('0x2f')](_0x19e4bd[_0x228c('0x34')],function(_0x3980d6){var _0x173a70={};_0x173a70[_0x3980d6]={'$like':'%'+_0x4385f2[_0x228c('0x30')][_0x228c('0x3b')]+'%'};return _0x173a70;})});}_0x19e4bd=_[_0x228c('0x3c')]({},_0x19e4bd,_0x4385f2[_0x228c('0x3e')]);return db['MailInteraction'][_0x228c('0x1c')]({'where':_0x19e4bd['where']})[_0x228c('0xd')](function(_0x1ec5d5){_0x110f96[_0x228c('0x1c')]=_0x1ec5d5;if(_0x4385f2['query']['includeAll']){_0x19e4bd[_0x228c('0x45')]=[{'model':db[_0x228c('0x78')],'as':_0x228c('0x79'),'required':![]},{'model':db[_0x228c('0x7a')],'as':_0x228c('0x7b'),'attributes':['name',_0x228c('0x7c'),_0x228c('0x7d')],'required':![]},{'model':db[_0x228c('0x7e')],'as':_0x228c('0x7f'),'attributes':['id',_0x228c('0x22'),_0x228c('0x80')],'where':_0x4385f2['query'][_0x228c('0x81')]?{'id':_0x4385f2['query'][_0x228c('0x81')]}:undefined,'required':_0x4385f2[_0x228c('0x30')][_0x228c('0x81')]?!![]:![]}];}return db['MailInteraction'][_0x228c('0x40')](_0x19e4bd);})[_0x228c('0xd')](function(_0x182216){_0x110f96[_0x228c('0x41')]=_0x182216;return _0x110f96;});}})[_0x228c('0xd')](respondWithFilteredResult(_0x1db5ef,_0x19e4bd))[_0x228c('0x16')](handleError(_0x1db5ef,null));};exports['addApplications']=function addApplications(_0x30cd26,_0x345934){var _0xa1506d=_0x30cd26['params']['id'];var _0x31bf07=_0x30cd26[_0x228c('0x48')];var _0x27e554=0xc8;var _0x4b6d84=null;return db[_0x228c('0x82')][_0x228c('0x83')]({'isolationLevel':db[_0x228c('0x82')][_0x228c('0x84')][_0x228c('0x85')][_0x228c('0x86')]},function(_0x269a53){return db[_0x228c('0x29')][_0x228c('0x4f')]({'where':{'id':_0xa1506d},'transaction':_0x269a53})[_0x228c('0xd')](function(_0x1c9556){if(_0x1c9556){return db['MailApplication'][_0x228c('0x1e')]({'where':{'MailAccountId':_0xa1506d},'transaction':_0x269a53})[_0x228c('0xd')](function(){var _0x191ca5=_[_0x228c('0x2f')](_0x31bf07,function(_0xa8c352){_0xa8c352[_0x228c('0x4c')]=_0xa1506d;return _0xa8c352;});return db['MailApplication'][_0x228c('0x87')](_0x191ca5,{'transaction':_0x269a53});});}else{_0x27e554=0x194;_0x4b6d84=[];}});})[_0x228c('0xd')](function(){if(_0x27e554!==0x194){return db[_0x228c('0x88')][_0x228c('0x89')]({'where':{'MailAccountId':_0xa1506d},'order':_0x228c('0x8a')})[_0x228c('0xd')](function(_0x4338f4){_0x4b6d84=_0x4338f4;});}})[_0x228c('0x16')](function(_0xacfc7f){_0x27e554=0x1f4;logger[_0x228c('0x12')](_0xacfc7f[_0x228c('0x21')]);if(_0xacfc7f[_0x228c('0x22')]){delete _0xacfc7f[_0x228c('0x22')];}_0x4b6d84=_0xacfc7f;})[_0x228c('0x8b')](function(){if(_0x4b6d84===null){_0x345934[_0x228c('0x17')](_0x27e554);}else{if(_0x27e554===0x1f4){_0x345934[_0x228c('0x18')](_0x27e554)[_0x228c('0x23')](_0x4b6d84);}else{_0x345934[_0x228c('0x18')](_0x27e554)['json'](_0x4b6d84);}}});};exports[_0x228c('0x8c')]=function(_0x25210d,_0xf37be0){var _0x5d85b8={};var _0x321134={};var _0x16ca08;var _0x2b12ac;return db[_0x228c('0x29')][_0x228c('0x4f')]({'where':{'id':_0x25210d[_0x228c('0x49')]['id']}})[_0x228c('0xd')](handleEntityNotFound(_0xf37be0,null))['then'](function(_0x108e34){if(_0x108e34){_0x16ca08=_0x108e34;_0x321134[_0x228c('0x2e')]=_[_0x228c('0x31')](db[_0x228c('0x88')]['rawAttributes']);_0x321134[_0x228c('0x30')]=_['keys'](_0x25210d[_0x228c('0x30')]);_0x321134[_0x228c('0x32')]=_['intersection'](_0x321134['model'],_0x321134[_0x228c('0x30')]);_0x5d85b8[_0x228c('0x34')]=_[_0x228c('0x33')](_0x321134['model'],qs['fields'](_0x25210d[_0x228c('0x30')][_0x228c('0x35')]));_0x5d85b8[_0x228c('0x34')]=_0x5d85b8[_0x228c('0x34')]['length']?_0x5d85b8[_0x228c('0x34')]:_0x321134[_0x228c('0x2e')];_0x5d85b8['order']=qs['sort'](_0x25210d['query']['sort']);_0x5d85b8[_0x228c('0x3d')]=qs['filters'](_[_0x228c('0x3a')](_0x25210d[_0x228c('0x30')],_0x321134['filters']));if(_0x25210d[_0x228c('0x30')][_0x228c('0x3b')]){_0x5d85b8[_0x228c('0x3d')]=_['merge'](_0x5d85b8[_0x228c('0x3d')],{'$or':_[_0x228c('0x2f')](_0x5d85b8[_0x228c('0x34')],function(_0x34793a){var _0x38d90f={};_0x38d90f[_0x34793a]={'$like':'%'+_0x25210d[_0x228c('0x30')]['filter']+'%'};return _0x38d90f;})});}_0x5d85b8=_[_0x228c('0x3c')]({},_0x5d85b8,_0x25210d[_0x228c('0x3e')]);return _0x16ca08['getApplications'](_0x5d85b8);}})[_0x228c('0xd')](function(_0x443f98){if(_0x443f98){_0x2b12ac=_0x443f98[_0x228c('0x36')];if(!_0x25210d['query'][_0x228c('0x50')](_0x228c('0x37'))){_0x5d85b8[_0x228c('0x1b')]=qs[_0x228c('0x1b')](_0x25210d[_0x228c('0x30')][_0x228c('0x1b')]);_0x5d85b8[_0x228c('0x19')]=qs['offset'](_0x25210d[_0x228c('0x30')][_0x228c('0x19')]);}return _0x16ca08[_0x228c('0x8c')](_0x5d85b8);}})[_0x228c('0xd')](function(_0x461ac9){if(_0x461ac9){return _0x461ac9?{'count':_0x2b12ac,'rows':_0x461ac9}:null;}})[_0x228c('0xd')](respondWithResult(_0xf37be0,null))[_0x228c('0x16')](handleError(_0xf37be0,null));};exports['getMessages']=function(_0x4b0401,_0x5dda5e){var _0x2e0a80={'raw':!![],'where':{}};var _0x2a1e9f={};var _0x1ab412={'count':0x0,'rows':[]};return db[_0x228c('0x29')]['findOne']({'where':{'id':_0x4b0401[_0x228c('0x49')]['id']}})[_0x228c('0xd')](handleEntityNotFound(_0x5dda5e,null))[_0x228c('0xd')](function(_0x58d3c0){if(_0x58d3c0){_0x2a1e9f['model']=_[_0x228c('0x31')](db[_0x228c('0x8d')][_0x228c('0x2a')]);_0x2a1e9f[_0x228c('0x30')]=_[_0x228c('0x31')](_0x4b0401[_0x228c('0x30')]);_0x2a1e9f[_0x228c('0x32')]=_[_0x228c('0x33')](_0x2a1e9f[_0x228c('0x2e')],_0x2a1e9f[_0x228c('0x30')]);_0x2e0a80['attributes']=_[_0x228c('0x33')](_0x2a1e9f[_0x228c('0x2e')],qs['fields'](_0x4b0401[_0x228c('0x30')][_0x228c('0x35')]));_0x2e0a80['attributes']=_0x2e0a80[_0x228c('0x34')][_0x228c('0x36')]?_0x2e0a80['attributes']:_0x2a1e9f[_0x228c('0x2e')];if(!_0x4b0401[_0x228c('0x30')][_0x228c('0x50')](_0x228c('0x37'))){_0x2e0a80[_0x228c('0x1b')]=qs[_0x228c('0x1b')](_0x4b0401[_0x228c('0x30')][_0x228c('0x1b')]);_0x2e0a80[_0x228c('0x19')]=qs[_0x228c('0x19')](_0x4b0401[_0x228c('0x30')][_0x228c('0x19')]);}_0x2e0a80['order']=qs['sort'](_0x4b0401['query'][_0x228c('0x39')]);_0x2e0a80[_0x228c('0x3d')]=qs[_0x228c('0x32')](_['pick'](_0x4b0401[_0x228c('0x30')],_0x2a1e9f[_0x228c('0x32')]));_0x2e0a80['where'][_0x228c('0x4c')]=_0x58d3c0['id'];if(_0x4b0401['query'][_0x228c('0x3b')]){_0x2e0a80['where']=_[_0x228c('0x3c')](_0x2e0a80[_0x228c('0x3d')],{'$or':_['map'](_0x2e0a80[_0x228c('0x34')],function(_0xbd3fd0){var _0x2f9372={};_0x2f9372[_0xbd3fd0]={'$like':'%'+_0x4b0401['query']['filter']+'%'};return _0x2f9372;})});}if(_0x4b0401[_0x228c('0x30')][_0x228c('0x8e')]){var _0xd3505c=_0x4b0401['query']['$gte']['split'](',');var _0x37c855={};_0x37c855[_0xd3505c[0x0]]={'$gte':moment(_0xd3505c[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x2e0a80[_0x228c('0x3d')]=_[_0x228c('0x3c')](_0x2e0a80[_0x228c('0x3d')],_0x37c855);}_0x2e0a80=_['merge']({},_0x2e0a80,_0x4b0401[_0x228c('0x3e')]);return db['MailMessage'][_0x228c('0x1c')]({'where':_0x2e0a80[_0x228c('0x3d')]})[_0x228c('0xd')](function(_0x34205c){_0x1ab412[_0x228c('0x1c')]=_0x34205c;if(_0x4b0401[_0x228c('0x30')][_0x228c('0x3f')]){_0x2e0a80[_0x228c('0x45')]=[{'all':!![]}];}return db[_0x228c('0x8d')]['findAll'](_0x2e0a80);})[_0x228c('0xd')](function(_0x143371){if(_0x4b0401[_0x228c('0x30')]['inlineCss']==='true'){for(var _0xc56ea6=0x0;_0xc56ea6<_0x143371[_0x228c('0x36')];_0xc56ea6++){_0x143371[_0xc56ea6][_0x228c('0x48')]=juice(_0x143371[_0xc56ea6][_0x228c('0x48')]);}}_0x1ab412['rows']=_0x143371;return _0x1ab412;});}})[_0x228c('0xd')](respondWithFilteredResult(_0x5dda5e,_0x2e0a80))[_0x228c('0x16')](handleError(_0x5dda5e,null));};exports[_0x228c('0x23')]=function(_0x484b03,_0xd2fb92){var _0x52c6fa,_0x4a8f4e={},_0x48f3df;if(_0x484b03[_0x228c('0x48')]['to']){_0x48f3df=_0x484b03['body']['to'][_0x228c('0x8f')](',')[0x0];}return db[_0x228c('0x29')][_0x228c('0x46')]({'where':{'id':_0x484b03[_0x228c('0x49')]['id']},'include':[{'model':db[_0x228c('0x90')],'as':'List','include':[{'model':db['CmContact'],'as':_0x228c('0x91'),'where':{'email':_0x48f3df},'limit':0x1,'order':[[_0x228c('0x92'),_0x228c('0x93')]]}]},{'model':db[_0x228c('0x26')],'as':_0x228c('0x27'),'raw':!![]}]})[_0x228c('0xd')](handleEntityNotFound(_0xd2fb92,null))[_0x228c('0xd')](function(_0x2aa210){if(_0x2aa210){_0x52c6fa=_0x2aa210;if(_0x2aa210['Smtp']){if(_[_0x228c('0x94')](_0x484b03[_0x228c('0x48')][_0x228c('0x95')])){_0x484b03[_0x228c('0x48')][_0x228c('0x95')]=util['format'](_0x228c('0x96'),_0x2aa210[_0x228c('0x22')],_0x2aa210[_0x228c('0x59')]||_0x2aa210[_0x228c('0x27')]['user']);}if(_0x484b03[_0x228c('0x48')][_0x228c('0x97')]&&_0x484b03['body'][_0x228c('0x97')][_0x228c('0x36')]){for(var _0x596234=0x0;_0x596234<_0x484b03[_0x228c('0x48')][_0x228c('0x97')]['length'];_0x596234+=0x1){_0x484b03['body'][_0x228c('0x97')][_0x596234]={'filename':_0x484b03[_0x228c('0x48')][_0x228c('0x97')][_0x596234][_0x228c('0x22')],'path':path[_0x228c('0x98')](config[_0x228c('0x99')],_0x228c('0x9a'),_0x484b03['body'][_0x228c('0x97')][_0x596234][_0x228c('0x9b')])};}}var _0x1aa411={'tls':{'rejectUnauthorized':![]}};if(_[_0x228c('0x94')](_0x2aa210['Smtp'][_0x228c('0x62')])){if(_0x2aa210[_0x228c('0x27')][_0x228c('0x65')]){_0x1aa411[_0x228c('0x9c')]={'user':_0x2aa210[_0x228c('0x27')][_0x228c('0x5c')],'pass':_0x2aa210[_0x228c('0x27')][_0x228c('0x5e')]};}_0x1aa411[_0x228c('0x63')]=_0x2aa210[_0x228c('0x27')]['host'];_0x1aa411[_0x228c('0x64')]=_0x2aa210['Smtp'][_0x228c('0x64')];_0x1aa411['secure']=_0x2aa210['Smtp'][_0x228c('0x9d')];}else{_0x1aa411[_0x228c('0x62')]=_0x2aa210[_0x228c('0x27')][_0x228c('0x62')];_0x1aa411[_0x228c('0x9c')]={'user':_0x2aa210['Smtp'][_0x228c('0x5c')],'pass':_0x2aa210[_0x228c('0x27')][_0x228c('0x5e')]};}return respondWithRpcPromise('SendMail',_0x228c('0x9e'),{'account':_0x1aa411,'message':_0x484b03[_0x228c('0x48')]});}else{throw new Error(_0x228c('0x9f'));}}})[_0x228c('0xd')](function(_0x1ff53d){if(_0x1ff53d){_0x4a8f4e=_0x1ff53d;if(_0x52c6fa[_0x228c('0xa0')]){if(_0x52c6fa['List'][_0x228c('0x91')][_0x228c('0x36')]){return _0x52c6fa[_0x228c('0xa0')][_0x228c('0x91')][0x0];}else{return db[_0x228c('0x78')]['create'](_[_0x228c('0x9')](_0x484b03[_0x228c('0x48')],{'firstName':_0x484b03[_0x228c('0x48')]['to'],'email':_0x484b03[_0x228c('0x48')]['to'],'phone':_0x484b03['body']['to'],'ListId':_0x52c6fa[_0x228c('0x5a')]}));}}else{throw new Error('List\x20not\x20found');}}})['then'](function(_0x59c6d8){if(_0x59c6d8){var _0x2fe3e5={'UserId':_0x484b03[_0x228c('0x5c')]['id'],'ContactId':_0x59c6d8['id'],'MailAccountId':_0x52c6fa['id'],'inReplyTo':_0x4a8f4e[_0x228c('0xa1')],'to':_0x484b03['body'][_0x228c('0x95')],'cc':_0x484b03['body']['cc'],'subject':_0x484b03[_0x228c('0x48')][_0x228c('0xa2')],'attach':_0x484b03[_0x228c('0x48')][_0x228c('0xa3')],'firstMsgDirection':_0x228c('0xa4'),'lastMsgAt':moment()[_0x228c('0xa5')](_0x228c('0xa6')),'lastMsgDirection':_0x228c('0xa4'),'Messages':[_[_0x228c('0x3c')](_0x484b03[_0x228c('0x48')],{'messageId':_0x4a8f4e[_0x228c('0xa1')],'sentAt':moment()[_0x228c('0xa5')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x52c6fa['id'],'UserId':_0x484b03['user']['id'],'ContactId':_0x59c6d8['id']})]};if(_0x484b03[_0x228c('0x48')][_0x228c('0xa7')]){_0x2fe3e5=_[_0x228c('0x3c')](_0x2fe3e5,_0x484b03[_0x228c('0x48')][_0x228c('0xa7')]);}return db[_0x228c('0x75')][_0x228c('0x4e')](_0x2fe3e5,{'include':[{'model':db[_0x228c('0x8d')],'as':_0x228c('0xa8')}]});}})[_0x228c('0xd')](respondWithResult(_0xd2fb92,null))[_0x228c('0x16')](handleError(_0xd2fb92,null));};exports['verifySmtp']=function(_0x1ebe7c,_0x55fdc7){return db[_0x228c('0x29')][_0x228c('0x46')]({'where':{'id':_0x1ebe7c[_0x228c('0x49')]['id']},'include':[{'model':db[_0x228c('0x26')],'as':_0x228c('0x27'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]})[_0x228c('0xd')](handleEntityNotFound(_0x55fdc7,null))[_0x228c('0xd')](function(_0x2a05fb){if(_0x2a05fb&&_0x2a05fb[_0x228c('0x27')]){var _0x3b5e55={'id':_0x2a05fb['id'],'tls':{'rejectUnauthorized':![]}};if(_0x2a05fb[_0x228c('0x27')][_0x228c('0x62')]){_0x3b5e55[_0x228c('0x62')]=_0x2a05fb[_0x228c('0x27')][_0x228c('0x62')];}else{_0x3b5e55[_0x228c('0x63')]=_0x2a05fb[_0x228c('0x27')][_0x228c('0x63')];_0x3b5e55[_0x228c('0x64')]=_0x2a05fb[_0x228c('0x27')][_0x228c('0x64')];_0x3b5e55['secure']=_0x2a05fb['Smtp'][_0x228c('0x9d')];}if(_0x2a05fb[_0x228c('0x27')]['authentication']){if(_0x2a05fb['Smtp']['modernAuthentication']){_0x3b5e55[_0x228c('0x9c')]={'type':_0x228c('0xa9'),'user':_0x2a05fb['Smtp'][_0x228c('0x5c')],'accessToken':_0x2a05fb['Smtp'][_0x228c('0xaa')]['data5']};}else{_0x3b5e55['auth']={'user':_0x2a05fb[_0x228c('0x27')][_0x228c('0x5c')],'pass':_0x2a05fb[_0x228c('0x27')]['pass']};}}return respondWithRpcPromise(_0x228c('0xab'),'verifySmtp',{'account':_0x3b5e55});}})[_0x228c('0xd')](respondWithResult(_0x55fdc7,null))['catch'](handleError(_0x55fdc7,null));};exports[_0x228c('0x1e')]=function(_0x1f1ce2,_0x39d6a3){return db[_0x228c('0x29')][_0x228c('0x46')]({'where':{'id':_0x1f1ce2['params']['id']}})['then'](handleEntityNotFound(_0x39d6a3,null))[_0x228c('0xd')](function(_0x1443b7){if(_0x1443b7&&_0x1443b7[_0x228c('0x62')]){throw new db[(_0x228c('0xac'))][(_0x228c('0xad'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x1443b7;})[_0x228c('0xd')](removeEntity(_0x39d6a3,null))[_0x228c('0x16')](handleError(_0x39d6a3,null));};exports['addAgents']=function(_0x324129,_0x1fe139){return db['MailAccount'][_0x228c('0x46')]({'where':{'id':_0x324129[_0x228c('0x49')]['id']}})['then'](handleEntityNotFound(_0x1fe139,null))[_0x228c('0xd')](function(_0x4d168e){if(_0x4d168e){return _0x4d168e[_0x228c('0xae')](_0x324129['body'][_0x228c('0x52')],_[_0x228c('0x76')](_0x324129[_0x228c('0x48')],['ids','id'])||{})[_0x228c('0xaf')](function(_0x2e38db){for(var _0x4419a4=0x0;_0x4419a4<_0x324129['body'][_0x228c('0x52')][_0x228c('0x36')];_0x4419a4+=0x1){socket[_0x228c('0xb0')](_0x228c('0xb1'),{'UserId':Number(_0x324129[_0x228c('0x48')][_0x228c('0x52')][_0x4419a4]),'MailAccountId':Number(_0x324129[_0x228c('0x49')]['id'])});}return _0x2e38db;});}})['then'](respondWithResult(_0x1fe139,null))[_0x228c('0x16')](handleError(_0x1fe139,null));};exports[_0x228c('0xb2')]=function(_0x253e63,_0x25c0e0){return db['MailAccount']['find']({'where':{'id':_0x253e63[_0x228c('0x49')]['id']}})['then'](handleEntityNotFound(_0x25c0e0,null))[_0x228c('0xd')](function(_0x300190){if(_0x300190){return _0x300190[_0x228c('0xb2')](_0x253e63[_0x228c('0x30')][_0x228c('0x52')])[_0x228c('0xd')](function(){if(_[_0x228c('0xb3')](_0x253e63[_0x228c('0x30')]['ids'])){for(var _0x2404e4=0x0;_0x2404e4<_0x253e63['query'][_0x228c('0x52')][_0x228c('0x36')];_0x2404e4+=0x1){socket[_0x228c('0xb0')](_0x228c('0xb4'),{'UserId':Number(_0x253e63[_0x228c('0x30')][_0x228c('0x52')][_0x2404e4]),'MailAccountId':Number(_0x253e63[_0x228c('0x49')]['id'])});}}else{socket[_0x228c('0xb0')](_0x228c('0xb4'),{'UserId':Number(_0x253e63['query'][_0x228c('0x52')]),'MailAccountId':Number(_0x253e63[_0x228c('0x49')]['id'])});}});}})['then'](respondWithStatusCode(_0x25c0e0,null))[_0x228c('0x16')](handleError(_0x25c0e0,null));};exports[_0x228c('0xb5')]=function(_0x2b8af8,_0x19e4fb){var _0x2c8ed1={};var _0x14646f={};var _0x44c221;var _0xbe74b3;return db[_0x228c('0x29')][_0x228c('0x4f')]({'where':{'id':_0x2b8af8[_0x228c('0x49')]['id']}})[_0x228c('0xd')](handleEntityNotFound(_0x19e4fb,null))[_0x228c('0xd')](function(_0x55875f){if(_0x55875f){_0x44c221=_0x55875f;_0x14646f[_0x228c('0x2e')]=_[_0x228c('0x31')](db[_0x228c('0x7a')][_0x228c('0x2a')]);_0x14646f[_0x228c('0x30')]=_[_0x228c('0x31')](_0x2b8af8[_0x228c('0x30')]);_0x14646f[_0x228c('0x32')]=_[_0x228c('0x33')](_0x14646f['model'],_0x14646f[_0x228c('0x30')]);_0x2c8ed1['attributes']=_[_0x228c('0x33')](_0x14646f[_0x228c('0x2e')],qs['fields'](_0x2b8af8['query']['fields']));_0x2c8ed1[_0x228c('0x34')]=_0x2c8ed1[_0x228c('0x34')][_0x228c('0x36')]?_0x2c8ed1[_0x228c('0x34')]:_0x14646f[_0x228c('0x2e')];_0x2c8ed1[_0x228c('0x38')]=qs['sort'](_0x2b8af8['query']['sort']);_0x2c8ed1['where']=qs[_0x228c('0x32')](_[_0x228c('0x3a')](_0x2b8af8[_0x228c('0x30')],_0x14646f[_0x228c('0x32')]));if(_0x2b8af8[_0x228c('0x30')][_0x228c('0x3b')]){_0x2c8ed1[_0x228c('0x3d')]=_[_0x228c('0x3c')](_0x2c8ed1[_0x228c('0x3d')],{'$or':_[_0x228c('0x2f')](_0x2c8ed1['attributes'],function(_0x276526){var _0x2f21c4={};_0x2f21c4[_0x276526]={'$like':'%'+_0x2b8af8[_0x228c('0x30')][_0x228c('0x3b')]+'%'};return _0x2f21c4;})});}_0x2c8ed1=_['merge']({},_0x2c8ed1,_0x2b8af8[_0x228c('0x3e')]);return _0x44c221[_0x228c('0xb5')](_0x2c8ed1);}})[_0x228c('0xd')](function(_0x183fc1){if(_0x183fc1){_0xbe74b3=_0x183fc1[_0x228c('0x36')];if(!_0x2b8af8[_0x228c('0x30')][_0x228c('0x50')](_0x228c('0x37'))){_0x2c8ed1[_0x228c('0x1b')]=qs['limit'](_0x2b8af8[_0x228c('0x30')][_0x228c('0x1b')]);_0x2c8ed1['offset']=qs[_0x228c('0x19')](_0x2b8af8[_0x228c('0x30')][_0x228c('0x19')]);}return _0x44c221[_0x228c('0xb5')](_0x2c8ed1);}})[_0x228c('0xd')](function(_0x56fc71){if(_0x56fc71){return _0x56fc71?{'count':_0xbe74b3,'rows':_0x56fc71}:null;}})['then'](respondWithResult(_0x19e4fb,null))[_0x228c('0x16')](handleError(_0x19e4fb,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 04301e9..a1fcc82 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 _0x352b=['hook','events','../../mysqldb','setMaxListeners','save','update','emit'];(function(_0xfe7d81,_0x44c8a4){var _0x5bd5ef=function(_0x474925){while(--_0x474925){_0xfe7d81['push'](_0xfe7d81['shift']());}};_0x5bd5ef(++_0x44c8a4);}(_0x352b,0x1c8));var _0xb352=function(_0x33d4b3,_0x451bf4){_0x33d4b3=_0x33d4b3-0x0;var _0x660f71=_0x352b[_0x33d4b3];return _0x660f71;};'use strict';var EventEmitter=require(_0xb352('0x0'));var MailAccount=require(_0xb352('0x1'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xb352('0x2')](0x0);var events={'afterCreate':_0xb352('0x3'),'afterUpdate':_0xb352('0x4'),'afterDestroy':'remove'};function emitEvent(_0x598e7a){return function(_0x11375a,_0x3f9de0,_0x2069c7){MailAccountEvents[_0xb352('0x5')](_0x598e7a+':'+_0x11375a['id'],_0x11375a);MailAccountEvents['emit'](_0x598e7a,_0x11375a);_0x2069c7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0xb352('0x6')](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file +var _0x9120=['hasOwnProperty','hook','exports','events','../../mysqldb','MailAccount','setMaxListeners','remove','emit'];(function(_0xd24b43,_0x11caa4){var _0x2b1b44=function(_0x5b84af){while(--_0x5b84af){_0xd24b43['push'](_0xd24b43['shift']());}};_0x2b1b44(++_0x11caa4);}(_0x9120,0x1b3));var _0x0912=function(_0x5d03b2,_0x2e6094){_0x5d03b2=_0x5d03b2-0x0;var _0x1b463e=_0x9120[_0x5d03b2];return _0x1b463e;};'use strict';var EventEmitter=require(_0x0912('0x0'));var MailAccount=require(_0x0912('0x1'))['db'][_0x0912('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x0912('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x0912('0x4')};function emitEvent(_0x3f15a8){return function(_0x24fc0a,_0x217a2e,_0x3c1cdb){MailAccountEvents[_0x0912('0x5')](_0x3f15a8+':'+_0x24fc0a['id'],_0x24fc0a);MailAccountEvents['emit'](_0x3f15a8,_0x24fc0a);_0x3c1cdb(null);};}for(var e in events){if(events[_0x0912('0x6')](e)){var event=events[e];MailAccount[_0x0912('0x7')](e,emitEvent(event));}}module[_0x0912('0x8')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 2e68e4d..36649fc 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 _0xddea=['MailAccount','mail_accounts','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment','./mailAccount.attributes','define'];(function(_0x35f22b,_0x5b5fa3){var _0x2d0cc0=function(_0x154ac9){while(--_0x154ac9){_0x35f22b['push'](_0x35f22b['shift']());}};_0x2d0cc0(++_0x5b5fa3);}(_0xddea,0x18e));var _0xadde=function(_0x54a10e,_0x3068f3){_0x54a10e=_0x54a10e-0x0;var _0x54f1b0=_0xddea[_0x54a10e];return _0x54f1b0;};'use strict';var _=require(_0xadde('0x0'));var util=require(_0xadde('0x1'));var logger=require(_0xadde('0x2'))(_0xadde('0x3'));var moment=require(_0xadde('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xadde('0x5'));var config=require(_0xadde('0x6'));var attributes=require(_0xadde('0x7'));module['exports']=function(_0x14a15a,_0x1e64d6){return _0x14a15a[_0xadde('0x8')](_0xadde('0x9'),attributes,{'tableName':_0xadde('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x65e6=['request-promise','path','rimraf','../../config/environment','exports','MailAccount','mail_accounts','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xfe2c60,_0x1866fd){var _0x1da88e=function(_0x50e59d){while(--_0x50e59d){_0xfe2c60['push'](_0xfe2c60['shift']());}};_0x1da88e(++_0x1866fd);}(_0x65e6,0x89));var _0x665e=function(_0x577fac,_0x3ab39f){_0x577fac=_0x577fac-0x0;var _0x4fea74=_0x65e6[_0x577fac];return _0x4fea74;};'use strict';var _=require(_0x665e('0x0'));var util=require(_0x665e('0x1'));var logger=require(_0x665e('0x2'))(_0x665e('0x3'));var moment=require(_0x665e('0x4'));var BPromise=require(_0x665e('0x5'));var rp=require(_0x665e('0x6'));var fs=require('fs');var path=require(_0x665e('0x7'));var rimraf=require(_0x665e('0x8'));var config=require(_0x665e('0x9'));var attributes=require('./mailAccount.attributes');module[_0x665e('0xa')]=function(_0x319b19,_0x4d1073){return _0x319b19['define'](_0x665e('0xb'),attributes,{'tableName':_0x665e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 17d84c3..9d46e63 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 _0x6373=['Messages','inReplyTo','create','Contact\x20not\x20found','spread','update','interaction','created','attachments','originTo','originCc','bcc','ChatWebsiteId','ChatOfflineMessageId','Attachment','UserId','name','unshift','agent','Start','startRouting','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','map','include','model','ShowMailAccount','find','NotifyMailAccount','body','difference','keys','rawAttributes','createdAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','CmContact','Contacts','updatedAt','DESC','MailApplication','Applications','Smtp','get','list','applications','orderBy','priority','asc','account','push','length','close','*,*,*,*','List\x20not\x20found','contact','messageId','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage'];(function(_0x1876f1,_0x5a44e1){var _0x499e13=function(_0x1377d2){while(--_0x1377d2){_0x1876f1['push'](_0x1876f1['shift']());}};_0x499e13(++_0x5a44e1);}(_0x6373,0x1b9));var _0x3637=function(_0x31b0e6,_0x17371e){_0x31b0e6=_0x31b0e6-0x0;var _0x239e1e=_0x6373[_0x31b0e6];return _0x239e1e;};'use strict';var _=require(_0x3637('0x0'));var util=require(_0x3637('0x1'));var moment=require('moment');var BPromise=require(_0x3637('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3637('0x3'));var db=require(_0x3637('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3637('0x5'))(_0x3637('0x6'));var config=require(_0x3637('0x7'));var jayson=require(_0x3637('0x8'));var client=jayson[_0x3637('0x9')]['http']({'port':0x232c});config['redis']=_[_0x3637('0xa')](config[_0x3637('0xb')],{'host':_0x3637('0xc'),'port':0x18eb});var socket=require(_0x3637('0xd'))(new Redis(config['redis']));require(_0x3637('0xe'))[_0x3637('0xf')](socket);function respondWithRpcPromise(_0x577891,_0x1ebff3,_0x222a88){return new BPromise(function(_0x549ac7,_0x259b82){return client[_0x3637('0x10')](_0x577891,_0x222a88)[_0x3637('0x11')](function(_0x30ebe3){logger[_0x3637('0x12')](_0x3637('0x13'),_0x1ebff3,_0x3637('0x14'));logger[_0x3637('0x15')](_0x3637('0x16'),_0x1ebff3,_0x3637('0x14'),JSON[_0x3637('0x17')](_0x30ebe3));if(_0x30ebe3[_0x3637('0x18')]){if(_0x30ebe3[_0x3637('0x18')][_0x3637('0x19')]===0x1f4){logger[_0x3637('0x18')](_0x3637('0x13'),_0x1ebff3,_0x30ebe3['error'][_0x3637('0x1a')]);return _0x259b82(_0x30ebe3[_0x3637('0x18')][_0x3637('0x1a')]);}logger[_0x3637('0x18')]('MailAccount,\x20%s,\x20%s',_0x1ebff3,_0x30ebe3[_0x3637('0x18')][_0x3637('0x1a')]);return _0x549ac7(_0x30ebe3[_0x3637('0x18')][_0x3637('0x1a')]);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0x1ebff3,_0x3637('0x14'));_0x549ac7(_0x30ebe3[_0x3637('0x1b')][_0x3637('0x1a')]);}})[_0x3637('0x1c')](function(_0x979c32){logger[_0x3637('0x18')]('MailAccount,\x20%s,\x20%s',_0x1ebff3,_0x979c32);_0x259b82(_0x979c32);});});}exports[_0x3637('0x1d')]=function(_0x506a8a){var _0x1f90ed=this;return new Promise(function(_0x3840ae,_0x129792){return db[_0x3637('0x1e')][_0x3637('0x1f')]({'raw':_0x506a8a[_0x3637('0x20')]?_0x506a8a[_0x3637('0x20')][_0x3637('0x21')]===undefined?!![]:![]:!![],'where':_0x506a8a[_0x3637('0x20')]?_0x506a8a[_0x3637('0x20')][_0x3637('0x22')]||null:null,'attributes':_0x506a8a[_0x3637('0x20')]?_0x506a8a[_0x3637('0x20')][_0x3637('0x23')]||null:null,'limit':_0x506a8a[_0x3637('0x20')]?_0x506a8a[_0x3637('0x20')][_0x3637('0x24')]||null:null,'include':_0x506a8a[_0x3637('0x20')]?_0x506a8a['options']['include']?_[_0x3637('0x25')](_0x506a8a[_0x3637('0x20')][_0x3637('0x26')],function(_0x3d1b97){return{'model':db[_0x3d1b97[_0x3637('0x27')]],'as':_0x3d1b97['as'],'attributes':_0x3d1b97[_0x3637('0x23')],'include':_0x3d1b97[_0x3637('0x26')]?_[_0x3637('0x25')](_0x3d1b97[_0x3637('0x26')],function(_0xd073c0){return{'model':db[_0xd073c0[_0x3637('0x27')]],'as':_0xd073c0['as'],'attributes':_0xd073c0[_0x3637('0x23')],'include':_0xd073c0[_0x3637('0x26')]?_['map'](_0xd073c0[_0x3637('0x26')],function(_0x283742){return{'model':db[_0x283742[_0x3637('0x27')]],'as':_0x283742['as'],'attributes':_0x283742['attributes']};}):[]};}):[]};}):[]:[]})[_0x3637('0x11')](function(_0x51a3fc){logger[_0x3637('0x12')]('GetMailAccount',_0x506a8a);logger[_0x3637('0x15')]('GetMailAccount',_0x506a8a,JSON['stringify'](_0x51a3fc));_0x3840ae(_0x51a3fc);})[_0x3637('0x1c')](function(_0x2e6cbd){logger[_0x3637('0x18')](_0x3637('0x1d'),_0x2e6cbd[_0x3637('0x1a')],_0x506a8a);_0x129792(_0x1f90ed[_0x3637('0x18')](0x1f4,_0x2e6cbd[_0x3637('0x1a')]));});});};exports[_0x3637('0x28')]=function(_0x24755d){var _0x5466b3=this;return new Promise(function(_0x1d8c7f,_0x5e71bb){return db['MailAccount'][_0x3637('0x29')]({'raw':_0x24755d[_0x3637('0x20')]?_0x24755d[_0x3637('0x20')][_0x3637('0x21')]===undefined?!![]:![]:!![],'where':_0x24755d['options']?_0x24755d[_0x3637('0x20')][_0x3637('0x22')]||null:null,'attributes':_0x24755d[_0x3637('0x20')]?_0x24755d[_0x3637('0x20')][_0x3637('0x23')]||null:null,'include':_0x24755d[_0x3637('0x20')]?_0x24755d[_0x3637('0x20')][_0x3637('0x26')]?_[_0x3637('0x25')](_0x24755d[_0x3637('0x20')][_0x3637('0x26')],function(_0x28ef65){return{'model':db[_0x28ef65[_0x3637('0x27')]],'as':_0x28ef65['as'],'attributes':_0x28ef65[_0x3637('0x23')],'include':_0x28ef65['include']?_['map'](_0x28ef65[_0x3637('0x26')],function(_0x164fd0){return{'model':db[_0x164fd0['model']],'as':_0x164fd0['as'],'attributes':_0x164fd0[_0x3637('0x23')],'include':_0x164fd0[_0x3637('0x26')]?_['map'](_0x164fd0[_0x3637('0x26')],function(_0x4bafcf){return{'model':db[_0x4bafcf['model']],'as':_0x4bafcf['as'],'attributes':_0x4bafcf[_0x3637('0x23')]};}):[]};}):[]};}):[]:[]})[_0x3637('0x11')](function(_0x41dd30){logger[_0x3637('0x12')](_0x3637('0x28'),_0x24755d);logger['debug']('ShowMailAccount',_0x24755d,JSON['stringify'](_0x41dd30));_0x1d8c7f(_0x41dd30);})[_0x3637('0x1c')](function(_0x5126fe){logger[_0x3637('0x18')](_0x3637('0x28'),_0x5126fe[_0x3637('0x1a')],_0x24755d);_0x5e71bb(_0x5466b3[_0x3637('0x18')](0x1f4,_0x5126fe[_0x3637('0x1a')]));});});};exports[_0x3637('0x2a')]=function(_0x4b5926){var _0x377cf4=this;return new Promise(function(_0xfa5118,_0x5ae61b){var _0xac00e6={'body':_0x4b5926[_0x3637('0x2b')],'channel':'mail'};var _0x39b12f=_[_0x3637('0x2c')](_[_0x3637('0x2d')](db['CmContact'][_0x3637('0x2e')]),[_0x3637('0x2f'),'updatedAt',_0x3637('0x30'),_0x3637('0x31')]);var _0xb6534e=![];if(_0x4b5926[_0x3637('0x2b')]['id']){delete _0x4b5926[_0x3637('0x2b')]['id'];}if(_[_0x3637('0x32')](_0x4b5926[_0x3637('0x2b')][_0x3637('0x33')])){return _0x5ae61b(_0x377cf4[_0x3637('0x18')](0x1f4,_0x3637('0x34')));}if(_['isNil'](_0x4b5926[_0x3637('0x2b')]['body'])||_0x4b5926[_0x3637('0x2b')][_0x3637('0x2b')]===''){return _0x5ae61b(_0x377cf4['error'](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x3637('0x32')](_0x4b5926[_0x3637('0x2b')][_0x3637('0x35')])){return _0x5ae61b(_0x377cf4[_0x3637('0x18')](0x1f4,_0x3637('0x36')+_0x39b12f));}if(!_['includes'](_0x39b12f,_0x4b5926['body'][_0x3637('0x35')])){return _0x5ae61b(_0x377cf4['error'](0x1f4,_0x3637('0x37')+_0x39b12f));}var _0x35fc89={};_0x35fc89[_0x4b5926['body']['mapKey']]=_0x4b5926[_0x3637('0x2b')][_0x3637('0x33')];return db[_0x3637('0x1e')][_0x3637('0x29')]({'where':{'id':_0x4b5926['account']['id']},'include':[{'model':db['CmList'],'as':_0x3637('0x38'),'include':[{'model':db[_0x3637('0x39')],'as':_0x3637('0x3a'),'where':_0x35fc89,'limit':0x1,'order':[[_0x3637('0x3b'),_0x3637('0x3c')]]}]},{'model':db[_0x3637('0x3d')],'as':_0x3637('0x3e')},{'model':db['MailServerOut'],'as':_0x3637('0x3f')}]})[_0x3637('0x11')](function(_0x24f63d){if(_0x24f63d&&_0x24f63d[_0x3637('0x38')]){var _0x48ef39=_0x24f63d[_0x3637('0x40')]({'plain':!![]});_0xac00e6['account']=_['omit'](_0x48ef39,[_0x3637('0x3e'),_0x3637('0x38')]);_0xac00e6['applications']=_0x48ef39[_0x3637('0x3e')];_0xac00e6[_0x3637('0x41')]=_0x48ef39['List'];_0xac00e6[_0x3637('0x42')]=_[_0x3637('0x43')](_0xac00e6[_0x3637('0x42')],[_0x3637('0x44')],[_0x3637('0x45')]);if(_0xac00e6['account']&&_0xac00e6[_0x3637('0x46')]['autoclose']){_0xac00e6[_0x3637('0x42')][_0x3637('0x47')]({'id':0x0,'priority':_0xac00e6[_0x3637('0x42')][_0x3637('0x48')]+0x1,'app':_0x3637('0x49'),'appdata':'autoclose','interval':_0x3637('0x4a')});}if(_0xac00e6[_0x3637('0x46')][_0x3637('0x3e')]){delete _0xac00e6[_0x3637('0x46')][_0x3637('0x3e')];}if(_0xac00e6[_0x3637('0x46')][_0x3637('0x38')]){delete _0xac00e6[_0x3637('0x46')][_0x3637('0x38')];}if(_0x48ef39[_0x3637('0x38')][_0x3637('0x3a')]['length']){return _0x48ef39[_0x3637('0x38')][_0x3637('0x3a')][0x0];}var _0x44492b=_[_0x3637('0xa')](_0x4b5926[_0x3637('0x2b')],{'firstName':_0x4b5926[_0x3637('0x2b')][_0x3637('0x33')],'ListId':_0x48ef39[_0x3637('0x31')]});_0x44492b[_0x4b5926[_0x3637('0x2b')][_0x3637('0x35')]]=_0x4b5926[_0x3637('0x2b')]['from'];return db[_0x3637('0x39')]['create'](_0x44492b);}else{throw new Error(_0x3637('0x4b'));}})[_0x3637('0x11')](function(_0x33bd9c){_0xac00e6[_0x3637('0x4c')]=_0x33bd9c;if(_0x33bd9c){if(!_0x4b5926['body'][_0x3637('0x1a')][_0x3637('0x4d')]){_0x4b5926[_0x3637('0x2b')][_0x3637('0x1a')][_0x3637('0x4d')]=rs['generate']()+'\x20'+_0x4b5926[_0x3637('0x2b')][_0x3637('0x1a')][_0x3637('0x33')];}var _0x4da4a8={'ContactId':_0x33bd9c['id'],'MailAccountId':_0x4b5926[_0x3637('0x46')]['id'],'inReplyTo':_0x4b5926[_0x3637('0x2b')]['message']['messageId'],'to':_0x4b5926['body'][_0x3637('0x1a')]['from'],'cc':_0x4b5926[_0x3637('0x2b')][_0x3637('0x1a')]['cc'],'subject':_0x4b5926[_0x3637('0x2b')]['message'][_0x3637('0x4e')],'attach':_0x4b5926[_0x3637('0x2b')]['message'][_0x3637('0x4f')],'lastMsgAt':moment()[_0x3637('0x50')](_0x3637('0x51')),'lastMsgDirection':'in'};return db[_0x3637('0x52')]['find']({'where':{'closed':![],'MailAccountId':_0x4b5926[_0x3637('0x46')]['id']},'include':[{'model':db[_0x3637('0x53')],'as':_0x3637('0x54'),'attributes':[_0x3637('0x4d')],'where':{'messageId':_0x4b5926[_0x3637('0x2b')]['message'][_0x3637('0x55')]}}]})[_0x3637('0x11')](function(_0xc35e71){if(_0xc35e71){return[_0xc35e71,![]];}return db['MailInteraction'][_0x3637('0x56')](_0x4da4a8)[_0x3637('0x11')](function(_0x2b1d02){return[_0x2b1d02,!![]];});});}else{throw new Error(_0x3637('0x57'));}})[_0x3637('0x58')](function(_0x20c912,_0x40ec9f){if(_0x20c912){_0xb6534e=_0x40ec9f;if(!_0x40ec9f){return _0x20c912[_0x3637('0x59')]({'inReplyTo':_0x4b5926[_0x3637('0x2b')][_0x3637('0x1a')][_0x3637('0x4d')],'to':_0x4b5926['body'][_0x3637('0x1a')][_0x3637('0x33')],'cc':_0x4b5926['body'][_0x3637('0x1a')]['cc'],'subject':_0x4b5926[_0x3637('0x2b')][_0x3637('0x1a')][_0x3637('0x4e')],'attach':_0x20c912[_0x3637('0x4f')]?_0x20c912[_0x3637('0x4f')]:_0x4b5926['body']['message'][_0x3637('0x4f')],'substatus':null,'substatusAt':moment()['format'](_0x3637('0x51')),'lastMsgAt':moment()[_0x3637('0x50')](_0x3637('0x51')),'lastMsgDirection':'in'});}else{return _0x20c912;}}})[_0x3637('0x11')](function(_0x3fc82c){_0xac00e6['interaction']=_0x3fc82c[_0x3637('0x40')]({'plain':!![]});_0xac00e6[_0x3637('0x5a')][_0x3637('0x5b')]=_0xb6534e;return db[_0x3637('0x53')][_0x3637('0x56')]({'body':_0x4b5926[_0x3637('0x2b')][_0x3637('0x2b')],'MailAccountId':_0x4b5926['account']['id'],'MailInteractionId':_0x3fc82c['id'],'direction':'in','ContactId':_0xac00e6[_0x3637('0x4c')]['id'],'messageId':_0x4b5926[_0x3637('0x2b')]['message'][_0x3637('0x4d')],'from':_0x4b5926['body'][_0x3637('0x1a')][_0x3637('0x33')],'to':_0x4b5926[_0x3637('0x2b')][_0x3637('0x1a')]['to'],'cc':_0x4b5926[_0x3637('0x2b')][_0x3637('0x1a')]['cc'],'subject':_0x4b5926[_0x3637('0x2b')][_0x3637('0x1a')][_0x3637('0x4e')],'attach':_0x4b5926[_0x3637('0x2b')][_0x3637('0x1a')][_0x3637('0x4f')],'Attachments':_0x4b5926[_0x3637('0x2b')][_0x3637('0x1a')][_0x3637('0x5c')],'originTo':_0x4b5926[_0x3637('0x2b')][_0x3637('0x1a')][_0x3637('0x5d')],'originCc':_0x4b5926[_0x3637('0x2b')][_0x3637('0x1a')][_0x3637('0x5e')],'bcc':_0x4b5926[_0x3637('0x2b')][_0x3637('0x1a')][_0x3637('0x5f')],'ChatWebsiteId':_0x4b5926[_0x3637('0x2b')]['message'][_0x3637('0x60')]||null,'originChannel':_0x4b5926[_0x3637('0x2b')][_0x3637('0x1a')]['originChannel']||'Email','ChatOfflineMessageId':_0x4b5926[_0x3637('0x2b')][_0x3637('0x1a')][_0x3637('0x61')]||null},{'include':[{'model':db[_0x3637('0x62')],'as':'Attachments'}]});})[_0x3637('0x11')](function(_0xe558b0){_0xac00e6['message']=_0xe558b0;if(_0xac00e6['interaction'][_0x3637('0x63')]){return db['User']['find']({'attributes':['id',_0x3637('0x64')],'where':{'id':_0xac00e6[_0x3637('0x5a')][_0x3637('0x63')]}})[_0x3637('0x11')](function(_0xfd0f18){if(_0xfd0f18){_0xac00e6['applications'][_0x3637('0x65')]({'id':0x0,'priority':0x0,'app':_0x3637('0x66'),'appdata':_0xfd0f18[_0x3637('0x64')]+','+(_0xac00e6[_0x3637('0x46')]['waitForTheAssignedAgent']||0xa),'interval':_0x3637('0x4a')});}return respondWithRpcPromise(_0x3637('0x67'),_0x3637('0x68'),_0xac00e6);});}return respondWithRpcPromise(_0x3637('0x67'),_0x3637('0x68'),_0xac00e6);})[_0x3637('0x11')](function(_0x129372){_0xfa5118(_0x129372);})['catch'](function(_0x260a5a){_0x5ae61b(_0x377cf4['error'](0x1f4,_0x260a5a[_0x3637('0x1a')]));});});}; \ No newline at end of file +var _0x107c=['request\x20sent','stringify','error','message','info','result','GetMailAccount','MailAccount','findAll','options','raw','where','limit','include','model','attributes','map','catch','ShowMailAccount','find','NotifyMailAccount','body','mail','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','Contacts','DESC','Applications','get','omit','applications','list','orderBy','priority','asc','account','autoclose','length','close','create','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','Messages','inReplyTo','update','interaction','contact','originTo','originCc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachments','name','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','lodash','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','./mailAccount.socket','then','MailAccount,\x20%s,\x20%s','debug'];(function(_0x330a57,_0x5f27ba){var _0x59bca2=function(_0x2a1785){while(--_0x2a1785){_0x330a57['push'](_0x330a57['shift']());}};_0x59bca2(++_0x5f27ba);}(_0x107c,0x118));var _0xc107=function(_0x4d572e,_0x59ceb7){_0x4d572e=_0x4d572e-0x0;var _0x43a969=_0x107c[_0x4d572e];return _0x43a969;};'use strict';var _=require(_0xc107('0x0'));var util=require('util');var moment=require(_0xc107('0x1'));var BPromise=require(_0xc107('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc107('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc107('0x4'));var logger=require('../../config/logger')(_0xc107('0x5'));var config=require(_0xc107('0x6'));var jayson=require(_0xc107('0x7'));var client=jayson[_0xc107('0x8')][_0xc107('0x9')]({'port':0x232c});config['redis']=_[_0xc107('0xa')](config['redis'],{'host':_0xc107('0xb'),'port':0x18eb});var socket=require(_0xc107('0xc'))(new Redis(config['redis']));require(_0xc107('0xd'))['register'](socket);function respondWithRpcPromise(_0x51e77a,_0x41d1c3,_0x233fb3){return new BPromise(function(_0x502b29,_0x145a97){return client['request'](_0x51e77a,_0x233fb3)[_0xc107('0xe')](function(_0x1032ac){logger['info'](_0xc107('0xf'),_0x41d1c3,'request\x20sent');logger[_0xc107('0x10')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x41d1c3,_0xc107('0x11'),JSON[_0xc107('0x12')](_0x1032ac));if(_0x1032ac[_0xc107('0x13')]){if(_0x1032ac[_0xc107('0x13')]['code']===0x1f4){logger[_0xc107('0x13')](_0xc107('0xf'),_0x41d1c3,_0x1032ac['error'][_0xc107('0x14')]);return _0x145a97(_0x1032ac[_0xc107('0x13')][_0xc107('0x14')]);}logger[_0xc107('0x13')]('MailAccount,\x20%s,\x20%s',_0x41d1c3,_0x1032ac['error'][_0xc107('0x14')]);return _0x502b29(_0x1032ac['error']['message']);}else{logger[_0xc107('0x15')](_0xc107('0xf'),_0x41d1c3,_0xc107('0x11'));_0x502b29(_0x1032ac[_0xc107('0x16')][_0xc107('0x14')]);}})['catch'](function(_0x56406b){logger[_0xc107('0x13')](_0xc107('0xf'),_0x41d1c3,_0x56406b);_0x145a97(_0x56406b);});});}exports[_0xc107('0x17')]=function(_0x55b5cb){var _0x4dc738=this;return new Promise(function(_0x401f62,_0x12fc65){return db[_0xc107('0x18')][_0xc107('0x19')]({'raw':_0x55b5cb[_0xc107('0x1a')]?_0x55b5cb[_0xc107('0x1a')][_0xc107('0x1b')]===undefined?!![]:![]:!![],'where':_0x55b5cb[_0xc107('0x1a')]?_0x55b5cb[_0xc107('0x1a')][_0xc107('0x1c')]||null:null,'attributes':_0x55b5cb['options']?_0x55b5cb[_0xc107('0x1a')]['attributes']||null:null,'limit':_0x55b5cb[_0xc107('0x1a')]?_0x55b5cb[_0xc107('0x1a')][_0xc107('0x1d')]||null:null,'include':_0x55b5cb[_0xc107('0x1a')]?_0x55b5cb[_0xc107('0x1a')]['include']?_['map'](_0x55b5cb[_0xc107('0x1a')][_0xc107('0x1e')],function(_0x248d72){return{'model':db[_0x248d72[_0xc107('0x1f')]],'as':_0x248d72['as'],'attributes':_0x248d72[_0xc107('0x20')],'include':_0x248d72['include']?_[_0xc107('0x21')](_0x248d72[_0xc107('0x1e')],function(_0x49d638){return{'model':db[_0x49d638['model']],'as':_0x49d638['as'],'attributes':_0x49d638['attributes'],'include':_0x49d638[_0xc107('0x1e')]?_[_0xc107('0x21')](_0x49d638[_0xc107('0x1e')],function(_0x450b28){return{'model':db[_0x450b28[_0xc107('0x1f')]],'as':_0x450b28['as'],'attributes':_0x450b28[_0xc107('0x20')]};}):[]};}):[]};}):[]:[]})[_0xc107('0xe')](function(_0x6ceb5c){logger[_0xc107('0x15')](_0xc107('0x17'),_0x55b5cb);logger[_0xc107('0x10')]('GetMailAccount',_0x55b5cb,JSON[_0xc107('0x12')](_0x6ceb5c));_0x401f62(_0x6ceb5c);})[_0xc107('0x22')](function(_0x1e85b6){logger['error'](_0xc107('0x17'),_0x1e85b6[_0xc107('0x14')],_0x55b5cb);_0x12fc65(_0x4dc738[_0xc107('0x13')](0x1f4,_0x1e85b6[_0xc107('0x14')]));});});};exports[_0xc107('0x23')]=function(_0x3a806f){var _0x2ce5f0=this;return new Promise(function(_0x2394a1,_0x597e80){return db[_0xc107('0x18')][_0xc107('0x24')]({'raw':_0x3a806f['options']?_0x3a806f[_0xc107('0x1a')][_0xc107('0x1b')]===undefined?!![]:![]:!![],'where':_0x3a806f[_0xc107('0x1a')]?_0x3a806f[_0xc107('0x1a')][_0xc107('0x1c')]||null:null,'attributes':_0x3a806f[_0xc107('0x1a')]?_0x3a806f[_0xc107('0x1a')][_0xc107('0x20')]||null:null,'include':_0x3a806f[_0xc107('0x1a')]?_0x3a806f[_0xc107('0x1a')][_0xc107('0x1e')]?_[_0xc107('0x21')](_0x3a806f['options'][_0xc107('0x1e')],function(_0x365b20){return{'model':db[_0x365b20[_0xc107('0x1f')]],'as':_0x365b20['as'],'attributes':_0x365b20[_0xc107('0x20')],'include':_0x365b20[_0xc107('0x1e')]?_[_0xc107('0x21')](_0x365b20[_0xc107('0x1e')],function(_0xc4a0dc){return{'model':db[_0xc4a0dc[_0xc107('0x1f')]],'as':_0xc4a0dc['as'],'attributes':_0xc4a0dc[_0xc107('0x20')],'include':_0xc4a0dc[_0xc107('0x1e')]?_[_0xc107('0x21')](_0xc4a0dc['include'],function(_0x451d80){return{'model':db[_0x451d80[_0xc107('0x1f')]],'as':_0x451d80['as'],'attributes':_0x451d80['attributes']};}):[]};}):[]};}):[]:[]})[_0xc107('0xe')](function(_0x42aeb3){logger[_0xc107('0x15')](_0xc107('0x23'),_0x3a806f);logger[_0xc107('0x10')]('ShowMailAccount',_0x3a806f,JSON['stringify'](_0x42aeb3));_0x2394a1(_0x42aeb3);})[_0xc107('0x22')](function(_0x4a0ac8){logger[_0xc107('0x13')](_0xc107('0x23'),_0x4a0ac8[_0xc107('0x14')],_0x3a806f);_0x597e80(_0x2ce5f0[_0xc107('0x13')](0x1f4,_0x4a0ac8['message']));});});};exports[_0xc107('0x25')]=function(_0x3fe5b2){var _0x4eba8f=this;return new Promise(function(_0x3bb683,_0x11f4e5){var _0x3ef368={'body':_0x3fe5b2[_0xc107('0x26')],'channel':_0xc107('0x27')};var _0x1d6624=_[_0xc107('0x28')](_[_0xc107('0x29')](db[_0xc107('0x2a')][_0xc107('0x2b')]),[_0xc107('0x2c'),_0xc107('0x2d'),_0xc107('0x2e'),_0xc107('0x2f')]);var _0x223836=![];if(_0x3fe5b2[_0xc107('0x26')]['id']){delete _0x3fe5b2[_0xc107('0x26')]['id'];}if(_['isNil'](_0x3fe5b2[_0xc107('0x26')]['from'])){return _0x11f4e5(_0x4eba8f['error'](0x1f4,_0xc107('0x30')));}if(_[_0xc107('0x31')](_0x3fe5b2[_0xc107('0x26')][_0xc107('0x26')])||_0x3fe5b2[_0xc107('0x26')][_0xc107('0x26')]===''){return _0x11f4e5(_0x4eba8f[_0xc107('0x13')](0x1f4,_0xc107('0x32')));}if(_[_0xc107('0x31')](_0x3fe5b2[_0xc107('0x26')][_0xc107('0x33')])){return _0x11f4e5(_0x4eba8f[_0xc107('0x13')](0x1f4,_0xc107('0x34')+_0x1d6624));}if(!_[_0xc107('0x35')](_0x1d6624,_0x3fe5b2[_0xc107('0x26')]['mapKey'])){return _0x11f4e5(_0x4eba8f[_0xc107('0x13')](0x1f4,_0xc107('0x36')+_0x1d6624));}var _0x2135a2={};_0x2135a2[_0x3fe5b2[_0xc107('0x26')][_0xc107('0x33')]]=_0x3fe5b2[_0xc107('0x26')][_0xc107('0x37')];return db[_0xc107('0x18')][_0xc107('0x24')]({'where':{'id':_0x3fe5b2['account']['id']},'include':[{'model':db[_0xc107('0x38')],'as':_0xc107('0x39'),'include':[{'model':db['CmContact'],'as':_0xc107('0x3a'),'where':_0x2135a2,'limit':0x1,'order':[['updatedAt',_0xc107('0x3b')]]}]},{'model':db['MailApplication'],'as':_0xc107('0x3c')},{'model':db['MailServerOut'],'as':'Smtp'}]})[_0xc107('0xe')](function(_0x509818){if(_0x509818&&_0x509818['List']){var _0xbb9064=_0x509818[_0xc107('0x3d')]({'plain':!![]});_0x3ef368['account']=_[_0xc107('0x3e')](_0xbb9064,[_0xc107('0x3c'),'List']);_0x3ef368[_0xc107('0x3f')]=_0xbb9064['Applications'];_0x3ef368[_0xc107('0x40')]=_0xbb9064[_0xc107('0x39')];_0x3ef368[_0xc107('0x3f')]=_[_0xc107('0x41')](_0x3ef368['applications'],[_0xc107('0x42')],[_0xc107('0x43')]);if(_0x3ef368[_0xc107('0x44')]&&_0x3ef368[_0xc107('0x44')][_0xc107('0x45')]){_0x3ef368[_0xc107('0x3f')]['push']({'id':0x0,'priority':_0x3ef368[_0xc107('0x3f')][_0xc107('0x46')]+0x1,'app':_0xc107('0x47'),'appdata':_0xc107('0x45'),'interval':'*,*,*,*'});}if(_0x3ef368[_0xc107('0x44')][_0xc107('0x3c')]){delete _0x3ef368[_0xc107('0x44')]['Applications'];}if(_0x3ef368[_0xc107('0x44')][_0xc107('0x39')]){delete _0x3ef368['account'][_0xc107('0x39')];}if(_0xbb9064[_0xc107('0x39')]['Contacts'][_0xc107('0x46')]){return _0xbb9064[_0xc107('0x39')]['Contacts'][0x0];}var _0x1c777c=_[_0xc107('0xa')](_0x3fe5b2[_0xc107('0x26')],{'firstName':_0x3fe5b2[_0xc107('0x26')]['from'],'ListId':_0xbb9064[_0xc107('0x2f')]});_0x1c777c[_0x3fe5b2[_0xc107('0x26')][_0xc107('0x33')]]=_0x3fe5b2[_0xc107('0x26')][_0xc107('0x37')];return db[_0xc107('0x2a')][_0xc107('0x48')](_0x1c777c);}else{throw new Error('List\x20not\x20found');}})[_0xc107('0xe')](function(_0x3d866e){_0x3ef368['contact']=_0x3d866e;if(_0x3d866e){if(!_0x3fe5b2[_0xc107('0x26')]['message'][_0xc107('0x49')]){_0x3fe5b2[_0xc107('0x26')][_0xc107('0x14')][_0xc107('0x49')]=rs[_0xc107('0x4a')]()+'\x20'+_0x3fe5b2[_0xc107('0x26')][_0xc107('0x14')]['from'];}var _0x4b59f3={'ContactId':_0x3d866e['id'],'MailAccountId':_0x3fe5b2[_0xc107('0x44')]['id'],'inReplyTo':_0x3fe5b2['body'][_0xc107('0x14')][_0xc107('0x49')],'to':_0x3fe5b2[_0xc107('0x26')]['message'][_0xc107('0x37')],'cc':_0x3fe5b2[_0xc107('0x26')]['message']['cc'],'subject':_0x3fe5b2['body'][_0xc107('0x14')][_0xc107('0x4b')],'attach':_0x3fe5b2[_0xc107('0x26')][_0xc107('0x14')][_0xc107('0x4c')],'lastMsgAt':moment()[_0xc107('0x4d')](_0xc107('0x4e')),'lastMsgDirection':'in'};return db[_0xc107('0x4f')][_0xc107('0x24')]({'where':{'closed':![],'MailAccountId':_0x3fe5b2['account']['id']},'include':[{'model':db['MailMessage'],'as':_0xc107('0x50'),'attributes':[_0xc107('0x49')],'where':{'messageId':_0x3fe5b2[_0xc107('0x26')]['message'][_0xc107('0x51')]}}]})[_0xc107('0xe')](function(_0x4c165e){if(_0x4c165e){return[_0x4c165e,![]];}return db['MailInteraction']['create'](_0x4b59f3)[_0xc107('0xe')](function(_0x22351a){return[_0x22351a,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x4ea722,_0x156545){if(_0x4ea722){_0x223836=_0x156545;if(!_0x156545){return _0x4ea722[_0xc107('0x52')]({'inReplyTo':_0x3fe5b2[_0xc107('0x26')][_0xc107('0x14')][_0xc107('0x49')],'to':_0x3fe5b2['body'][_0xc107('0x14')]['from'],'cc':_0x3fe5b2[_0xc107('0x26')][_0xc107('0x14')]['cc'],'subject':_0x3fe5b2[_0xc107('0x26')][_0xc107('0x14')][_0xc107('0x4b')],'attach':_0x4ea722[_0xc107('0x4c')]?_0x4ea722['attach']:_0x3fe5b2['body'][_0xc107('0x14')][_0xc107('0x4c')],'substatus':null,'substatusAt':moment()[_0xc107('0x4d')](_0xc107('0x4e')),'lastMsgAt':moment()[_0xc107('0x4d')](_0xc107('0x4e')),'lastMsgDirection':'in'});}else{return _0x4ea722;}}})['then'](function(_0x206b3f){_0x3ef368[_0xc107('0x53')]=_0x206b3f[_0xc107('0x3d')]({'plain':!![]});_0x3ef368['interaction']['created']=_0x223836;return db['MailMessage'][_0xc107('0x48')]({'body':_0x3fe5b2[_0xc107('0x26')]['body'],'MailAccountId':_0x3fe5b2[_0xc107('0x44')]['id'],'MailInteractionId':_0x206b3f['id'],'direction':'in','ContactId':_0x3ef368[_0xc107('0x54')]['id'],'messageId':_0x3fe5b2[_0xc107('0x26')][_0xc107('0x14')][_0xc107('0x49')],'from':_0x3fe5b2[_0xc107('0x26')][_0xc107('0x14')][_0xc107('0x37')],'to':_0x3fe5b2[_0xc107('0x26')][_0xc107('0x14')]['to'],'cc':_0x3fe5b2[_0xc107('0x26')][_0xc107('0x14')]['cc'],'subject':_0x3fe5b2[_0xc107('0x26')][_0xc107('0x14')][_0xc107('0x4b')],'attach':_0x3fe5b2[_0xc107('0x26')][_0xc107('0x14')]['attach'],'Attachments':_0x3fe5b2[_0xc107('0x26')][_0xc107('0x14')]['attachments'],'originTo':_0x3fe5b2[_0xc107('0x26')][_0xc107('0x14')][_0xc107('0x55')],'originCc':_0x3fe5b2['body'][_0xc107('0x14')][_0xc107('0x56')],'bcc':_0x3fe5b2[_0xc107('0x26')][_0xc107('0x14')]['bcc'],'ChatWebsiteId':_0x3fe5b2[_0xc107('0x26')][_0xc107('0x14')][_0xc107('0x57')]||null,'originChannel':_0x3fe5b2[_0xc107('0x26')]['message'][_0xc107('0x58')]||_0xc107('0x59'),'ChatOfflineMessageId':_0x3fe5b2[_0xc107('0x26')][_0xc107('0x14')][_0xc107('0x5a')]||null},{'include':[{'model':db['Attachment'],'as':_0xc107('0x5b')}]});})[_0xc107('0xe')](function(_0xc02681){_0x3ef368['message']=_0xc02681;if(_0x3ef368[_0xc107('0x53')]['UserId']){return db['User']['find']({'attributes':['id',_0xc107('0x5c')],'where':{'id':_0x3ef368[_0xc107('0x53')]['UserId']}})[_0xc107('0xe')](function(_0x26810f){if(_0x26810f){_0x3ef368[_0xc107('0x3f')][_0xc107('0x5d')]({'id':0x0,'priority':0x0,'app':_0xc107('0x5e'),'appdata':_0x26810f[_0xc107('0x5c')]+','+(_0x3ef368['account'][_0xc107('0x5f')]||0xa),'interval':_0xc107('0x60')});}return respondWithRpcPromise(_0xc107('0x61'),_0xc107('0x62'),_0x3ef368);});}return respondWithRpcPromise('Start',_0xc107('0x62'),_0x3ef368);})[_0xc107('0xe')](function(_0x4c8c42){_0x3bb683(_0x4c8c42);})[_0xc107('0x22')](function(_0x41b560){_0x11f4e5(_0x4eba8f[_0xc107('0x13')](0x1f4,_0x41b560[_0xc107('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 69e4f97..f848f5a 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 _0xfac7=['register','mailAccount:','./mailAccount.events','save','remove','update','removeListener'];(function(_0x39e61b,_0x4857f5){var _0x490fe4=function(_0x98e37c){while(--_0x98e37c){_0x39e61b['push'](_0x39e61b['shift']());}};_0x490fe4(++_0x4857f5);}(_0xfac7,0x1c9));var _0x7fac=function(_0x2498b5,_0x514ddb){_0x2498b5=_0x2498b5-0x0;var _0x5c48d8=_0xfac7[_0x2498b5];return _0x5c48d8;};'use strict';var MailAccountEvents=require(_0x7fac('0x0'));var events=[_0x7fac('0x1'),_0x7fac('0x2'),_0x7fac('0x3')];function createListener(_0x53e897,_0x33c6c3){return function(_0x4c2724){_0x33c6c3['emit'](_0x53e897,_0x4c2724);};}function removeListener(_0x177ba5,_0x586213){return function(){MailAccountEvents[_0x7fac('0x4')](_0x177ba5,_0x586213);};}exports[_0x7fac('0x5')]=function(_0x29472f){for(var _0x53a184=0x0,_0x565449=events['length'];_0x53a184<_0x565449;_0x53a184++){var _0x175a48=events[_0x53a184];var _0x40d351=createListener(_0x7fac('0x6')+_0x175a48,_0x29472f);MailAccountEvents['on'](_0x175a48,_0x40d351);}}; \ No newline at end of file +var _0x1cbc=['removeListener','register','length','mailAccount:','./mailAccount.events','remove','update','emit'];(function(_0x63cac0,_0x11672f){var _0x5e2d01=function(_0x481ba4){while(--_0x481ba4){_0x63cac0['push'](_0x63cac0['shift']());}};_0x5e2d01(++_0x11672f);}(_0x1cbc,0xf4));var _0xc1cb=function(_0x105a8a,_0x15a3a2){_0x105a8a=_0x105a8a-0x0;var _0x105a0e=_0x1cbc[_0x105a8a];return _0x105a0e;};'use strict';var MailAccountEvents=require(_0xc1cb('0x0'));var events=['save',_0xc1cb('0x1'),_0xc1cb('0x2')];function createListener(_0x29a7a6,_0x1da6d8){return function(_0x199b45){_0x1da6d8[_0xc1cb('0x3')](_0x29a7a6,_0x199b45);};}function removeListener(_0x13a9a0,_0x71a222){return function(){MailAccountEvents[_0xc1cb('0x4')](_0x13a9a0,_0x71a222);};}exports[_0xc1cb('0x5')]=function(_0x1dacec){for(var _0x27423b=0x0,_0x56f1c8=events[_0xc1cb('0x6')];_0x27423b<_0x56f1c8;_0x27423b++){var _0x54cd03=events[_0x27423b];var _0xe5da07=createListener(_0xc1cb('0x7')+_0x54cd03,_0x1dacec);MailAccountEvents['on'](_0x54cd03,_0xe5da07);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 5a9dc49..c85460a 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 _0x494a=['get','/:id','show','put','isAuthenticated','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailApplication.controller'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0x494a,0x18f));var _0xa494=function(_0x3bf8de,_0x46f284){_0x3bf8de=_0x3bf8de-0x0;var _0x4e18d3=_0x494a[_0x3bf8de];return _0x4e18d3;};'use strict';var multer=require(_0xa494('0x0'));var util=require(_0xa494('0x1'));var path=require(_0xa494('0x2'));var timeout=require('connect-timeout');var express=require(_0xa494('0x3'));var router=express[_0xa494('0x4')]();var fs_extra=require(_0xa494('0x5'));var auth=require(_0xa494('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa494('0x7'));var controller=require(_0xa494('0x8'));router[_0xa494('0x9')](_0xa494('0xa'),auth['isAuthenticated'](),controller[_0xa494('0xb')]);router[_0xa494('0xc')](_0xa494('0xa'),auth[_0xa494('0xd')](),controller['update']);router[_0xa494('0xe')](_0xa494('0xa'),auth['isAuthenticated'](),controller[_0xa494('0xf')]);module[_0xa494('0x10')]=router; \ No newline at end of file +var _0x7c74=['isAuthenticated','show','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailApplication.controller'];(function(_0x3e9d0f,_0x291760){var _0x215d13=function(_0x2ae831){while(--_0x2ae831){_0x3e9d0f['push'](_0x3e9d0f['shift']());}};_0x215d13(++_0x291760);}(_0x7c74,0x1f4));var _0x47c7=function(_0x3fd3a3,_0x36c863){_0x3fd3a3=_0x3fd3a3-0x0;var _0xa3e4d5=_0x7c74[_0x3fd3a3];return _0xa3e4d5;};'use strict';var multer=require(_0x47c7('0x0'));var util=require(_0x47c7('0x1'));var path=require(_0x47c7('0x2'));var timeout=require(_0x47c7('0x3'));var express=require(_0x47c7('0x4'));var router=express[_0x47c7('0x5')]();var fs_extra=require(_0x47c7('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x47c7('0x7'));var config=require(_0x47c7('0x8'));var controller=require(_0x47c7('0x9'));router['get']('/:id',auth[_0x47c7('0xa')](),controller[_0x47c7('0xb')]);router[_0x47c7('0xc')](_0x47c7('0xd'),auth[_0x47c7('0xa')](),controller[_0x47c7('0xe')]);router['delete'](_0x47c7('0xd'),auth[_0x47c7('0xa')](),controller[_0x47c7('0xf')]);module[_0x47c7('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index e218cec..be71124 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 _0xee91=['noop','TEXT','STRING','sequelize','exports','INTEGER'];(function(_0x5856fb,_0xbacf){var _0x3ef6ab=function(_0x269609){while(--_0x269609){_0x5856fb['push'](_0x5856fb['shift']());}};_0x3ef6ab(++_0xbacf);}(_0xee91,0x12f));var _0x1ee9=function(_0x121152,_0x42c0d3){_0x121152=_0x121152-0x0;var _0x44aa65=_0xee91[_0x121152];return _0x44aa65;};'use strict';var Sequelize=require(_0x1ee9('0x0'));module[_0x1ee9('0x1')]={'priority':{'type':Sequelize[_0x1ee9('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1ee9('0x3')},'appdata':{'type':Sequelize[_0x1ee9('0x4')]()},'description':{'type':Sequelize[_0x1ee9('0x5')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xdf4b=['exports','INTEGER','STRING','noop','*,*,*,*','sequelize'];(function(_0x39a16f,_0x30feb2){var _0x559f9f=function(_0x1bc4a2){while(--_0x1bc4a2){_0x39a16f['push'](_0x39a16f['shift']());}};_0x559f9f(++_0x30feb2);}(_0xdf4b,0xb9));var _0xbdf4=function(_0x3b4548,_0x437b7a){_0x3b4548=_0x3b4548-0x0;var _0x28a404=_0xdf4b[_0x3b4548];return _0x28a404;};'use strict';var Sequelize=require(_0xbdf4('0x0'));module[_0xbdf4('0x1')]={'priority':{'type':Sequelize[_0xbdf4('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xbdf4('0x3')],'allowNull':![],'defaultValue':_0xbdf4('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xbdf4('0x3')],'defaultValue':_0xbdf4('0x5')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 4119565..df81b58 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 _0x54ef=['api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','name','show','params','model','rawAttributes','query','keys','filters','intersection','attributes','fields','length','merge','options','MailApplication','find','body','catch','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x67b075,_0x43557d){var _0x39d030=function(_0x4f25e1){while(--_0x4f25e1){_0x67b075['push'](_0x67b075['shift']());}};_0x39d030(++_0x43557d);}(_0x54ef,0x112));var _0xf54e=function(_0x29bdd6,_0x14c24f){_0x29bdd6=_0x29bdd6-0x0;var _0x2e6a98=_0x54ef[_0x29bdd6];return _0x2e6a98;};'use strict';var emlformat=require(_0xf54e('0x0'));var rimraf=require(_0xf54e('0x1'));var zipdir=require(_0xf54e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf54e('0x3'));var moment=require(_0xf54e('0x4'));var BPromise=require(_0xf54e('0x5'));var Mustache=require(_0xf54e('0x6'));var util=require(_0xf54e('0x7'));var path=require(_0xf54e('0x8'));var sox=require(_0xf54e('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf54e('0xa'));var _=require(_0xf54e('0xb'));var squel=require(_0xf54e('0xc'));var crypto=require('crypto');var jsforce=require(_0xf54e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf54e('0xe'));var querystring=require(_0xf54e('0xf'));var Papa=require('papaparse');var Redis=require(_0xf54e('0x10'));var authService=require(_0xf54e('0x11'));var qs=require(_0xf54e('0x12'));var as=require(_0xf54e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf54e('0x14'))(_0xf54e('0x15'));var utils=require(_0xf54e('0x16'));var config=require(_0xf54e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xf54e('0x18'))['db'];function respondWithStatusCode(_0x4b0ee1,_0x4bd828){_0x4bd828=_0x4bd828||0xcc;return function(_0x15a9d4){if(_0x15a9d4){return _0x4b0ee1[_0xf54e('0x19')](_0x4bd828);}return _0x4b0ee1[_0xf54e('0x1a')](_0x4bd828)[_0xf54e('0x1b')]();};}function respondWithResult(_0x5644aa,_0x331732){_0x331732=_0x331732||0xc8;return function(_0x1bbeaa){if(_0x1bbeaa){return _0x5644aa[_0xf54e('0x1a')](_0x331732)[_0xf54e('0x1c')](_0x1bbeaa);}};}function respondWithFilteredResult(_0x56828e,_0x2366ee){return function(_0x389abc){if(_0x389abc){var _0x3eb415=typeof _0x2366ee['offset']==='undefined'&&typeof _0x2366ee[_0xf54e('0x1d')]===_0xf54e('0x1e');var _0x1c02e7=_0x389abc[_0xf54e('0x1f')];var _0x15cc48=_0x3eb415?0x0:_0x2366ee[_0xf54e('0x20')];var _0x2e27b6=_0x3eb415?_0x389abc[_0xf54e('0x1f')]:_0x2366ee[_0xf54e('0x20')]+_0x2366ee[_0xf54e('0x1d')];var _0x226c96;if(_0x2e27b6>=_0x1c02e7){_0x2e27b6=_0x1c02e7;_0x226c96=0xc8;}else{_0x226c96=0xce;}_0x56828e['status'](_0x226c96);return _0x56828e['set'](_0xf54e('0x21'),_0x15cc48+'-'+_0x2e27b6+'/'+_0x1c02e7)['json'](_0x389abc);}return null;};}function patchUpdates(_0x3e1556){return function(_0x1bfe99){try{jsonpatch[_0xf54e('0x22')](_0x1bfe99,_0x3e1556,!![]);}catch(_0x9903fc){return BPromise[_0xf54e('0x23')](_0x9903fc);}return _0x1bfe99[_0xf54e('0x24')]();};}function saveUpdates(_0x388aa0,_0x11985e){return function(_0x3c0169){if(_0x3c0169){return _0x3c0169[_0xf54e('0x25')](_0x388aa0)[_0xf54e('0x26')](function(_0x5b83df){return _0x5b83df;});}return null;};}function removeEntity(_0x6f6d29,_0x54f914){return function(_0x264a8f){if(_0x264a8f){return _0x264a8f[_0xf54e('0x27')]()[_0xf54e('0x26')](function(){_0x6f6d29[_0xf54e('0x1a')](0xcc)[_0xf54e('0x1b')]();});}};}function handleEntityNotFound(_0x160160,_0x1e08d1){return function(_0x43488d){if(!_0x43488d){_0x160160[_0xf54e('0x19')](0x194);}return _0x43488d;};}function handleError(_0x33457f,_0xf6cdd7){_0xf6cdd7=_0xf6cdd7||0x1f4;return function(_0x39c0ae){logger[_0xf54e('0x28')](_0x39c0ae['stack']);if(_0x39c0ae[_0xf54e('0x29')]){delete _0x39c0ae['name'];}_0x33457f[_0xf54e('0x1a')](_0xf6cdd7)['send'](_0x39c0ae);};}exports[_0xf54e('0x2a')]=function(_0x269f47,_0x21ba00){var _0xa13cd0={'raw':!![],'where':{'id':_0x269f47[_0xf54e('0x2b')]['id']}},_0x25b643={};_0x25b643[_0xf54e('0x2c')]=_['keys'](db['MailApplication'][_0xf54e('0x2d')]);_0x25b643[_0xf54e('0x2e')]=_[_0xf54e('0x2f')](_0x269f47[_0xf54e('0x2e')]);_0x25b643[_0xf54e('0x30')]=_[_0xf54e('0x31')](_0x25b643[_0xf54e('0x2c')],_0x25b643[_0xf54e('0x2e')]);_0xa13cd0[_0xf54e('0x32')]=_[_0xf54e('0x31')](_0x25b643['model'],qs['fields'](_0x269f47[_0xf54e('0x2e')][_0xf54e('0x33')]));_0xa13cd0['attributes']=_0xa13cd0[_0xf54e('0x32')][_0xf54e('0x34')]?_0xa13cd0[_0xf54e('0x32')]:_0x25b643[_0xf54e('0x2c')];if(_0x269f47['query']['includeAll']){_0xa13cd0['include']=[{'all':!![]}];}_0xa13cd0=_[_0xf54e('0x35')]({},_0xa13cd0,_0x269f47[_0xf54e('0x36')]);return db[_0xf54e('0x37')][_0xf54e('0x38')](_0xa13cd0)[_0xf54e('0x26')](handleEntityNotFound(_0x21ba00,null))[_0xf54e('0x26')](respondWithResult(_0x21ba00,null))['catch'](handleError(_0x21ba00,null));};exports['update']=function(_0x530cee,_0xc04e04){if(_0x530cee[_0xf54e('0x39')]['id']){delete _0x530cee['body']['id'];}return db['MailApplication'][_0xf54e('0x38')]({'where':{'id':_0x530cee[_0xf54e('0x2b')]['id']}})[_0xf54e('0x26')](handleEntityNotFound(_0xc04e04,null))['then'](saveUpdates(_0x530cee[_0xf54e('0x39')],null))[_0xf54e('0x26')](respondWithResult(_0xc04e04,null))['catch'](handleError(_0xc04e04,null));};exports[_0xf54e('0x27')]=function(_0x6e5bdf,_0x5af03){return db[_0xf54e('0x37')][_0xf54e('0x38')]({'where':{'id':_0x6e5bdf[_0xf54e('0x2b')]['id']}})['then'](handleEntityNotFound(_0x5af03,null))['then'](removeEntity(_0x5af03,null))[_0xf54e('0x3a')](handleError(_0x5af03,null));}; \ No newline at end of file +var _0xaa88=['limit','count','set','apply','reject','then','stack','name','send','params','model','keys','MailApplication','query','filters','intersection','attributes','fields','length','include','merge','options','find','update','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaa88,0x137));var _0x8aa8=function(_0x32729c,_0xf5afd8){_0x32729c=_0x32729c-0x0;var _0x482cfd=_0xaa88[_0x32729c];return _0x482cfd;};'use strict';var emlformat=require(_0x8aa8('0x0'));var rimraf=require(_0x8aa8('0x1'));var zipdir=require(_0x8aa8('0x2'));var jsonpatch=require(_0x8aa8('0x3'));var rp=require('request-promise');var moment=require(_0x8aa8('0x4'));var BPromise=require(_0x8aa8('0x5'));var Mustache=require(_0x8aa8('0x6'));var util=require(_0x8aa8('0x7'));var path=require(_0x8aa8('0x8'));var sox=require(_0x8aa8('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8aa8('0xa'));var _=require('lodash');var squel=require(_0x8aa8('0xb'));var crypto=require(_0x8aa8('0xc'));var jsforce=require(_0x8aa8('0xd'));var deskjs=require(_0x8aa8('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8aa8('0xf'));var Papa=require(_0x8aa8('0x10'));var Redis=require(_0x8aa8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8aa8('0x12'));var as=require(_0x8aa8('0x13'));var hardwareService=require(_0x8aa8('0x14'));var logger=require(_0x8aa8('0x15'))('api');var utils=require(_0x8aa8('0x16'));var config=require(_0x8aa8('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x8aa8('0x18'))['db'];function respondWithStatusCode(_0xa691d6,_0x28132f){_0x28132f=_0x28132f||0xcc;return function(_0x535aa0){if(_0x535aa0){return _0xa691d6[_0x8aa8('0x19')](_0x28132f);}return _0xa691d6[_0x8aa8('0x1a')](_0x28132f)[_0x8aa8('0x1b')]();};}function respondWithResult(_0x4b686e,_0x391642){_0x391642=_0x391642||0xc8;return function(_0x4af534){if(_0x4af534){return _0x4b686e['status'](_0x391642)[_0x8aa8('0x1c')](_0x4af534);}};}function respondWithFilteredResult(_0x200662,_0xae81a0){return function(_0xa6c2af){if(_0xa6c2af){var _0x42a6a4=typeof _0xae81a0[_0x8aa8('0x1d')]===_0x8aa8('0x1e')&&typeof _0xae81a0[_0x8aa8('0x1f')]===_0x8aa8('0x1e');var _0x4e8ce3=_0xa6c2af['count'];var _0x2c1b9a=_0x42a6a4?0x0:_0xae81a0['offset'];var _0x557adc=_0x42a6a4?_0xa6c2af[_0x8aa8('0x20')]:_0xae81a0['offset']+_0xae81a0[_0x8aa8('0x1f')];var _0x41092b;if(_0x557adc>=_0x4e8ce3){_0x557adc=_0x4e8ce3;_0x41092b=0xc8;}else{_0x41092b=0xce;}_0x200662[_0x8aa8('0x1a')](_0x41092b);return _0x200662[_0x8aa8('0x21')]('Content-Range',_0x2c1b9a+'-'+_0x557adc+'/'+_0x4e8ce3)[_0x8aa8('0x1c')](_0xa6c2af);}return null;};}function patchUpdates(_0x36c445){return function(_0x2825fd){try{jsonpatch[_0x8aa8('0x22')](_0x2825fd,_0x36c445,!![]);}catch(_0x4c754e){return BPromise[_0x8aa8('0x23')](_0x4c754e);}return _0x2825fd['save']();};}function saveUpdates(_0x26cf63,_0x4cc455){return function(_0x1fdadd){if(_0x1fdadd){return _0x1fdadd['update'](_0x26cf63)[_0x8aa8('0x24')](function(_0x557e4e){return _0x557e4e;});}return null;};}function removeEntity(_0x65945b,_0x40adb5){return function(_0x3ca7dc){if(_0x3ca7dc){return _0x3ca7dc['destroy']()[_0x8aa8('0x24')](function(){_0x65945b[_0x8aa8('0x1a')](0xcc)[_0x8aa8('0x1b')]();});}};}function handleEntityNotFound(_0x547a7b,_0x57acd2){return function(_0x2d1508){if(!_0x2d1508){_0x547a7b[_0x8aa8('0x19')](0x194);}return _0x2d1508;};}function handleError(_0x2f91f3,_0x3a3c7a){_0x3a3c7a=_0x3a3c7a||0x1f4;return function(_0x24143e){logger['error'](_0x24143e[_0x8aa8('0x25')]);if(_0x24143e['name']){delete _0x24143e[_0x8aa8('0x26')];}_0x2f91f3[_0x8aa8('0x1a')](_0x3a3c7a)[_0x8aa8('0x27')](_0x24143e);};}exports['show']=function(_0x4c5c5c,_0x10810d){var _0x5e96c9={'raw':!![],'where':{'id':_0x4c5c5c[_0x8aa8('0x28')]['id']}},_0x385208={};_0x385208[_0x8aa8('0x29')]=_[_0x8aa8('0x2a')](db[_0x8aa8('0x2b')]['rawAttributes']);_0x385208[_0x8aa8('0x2c')]=_[_0x8aa8('0x2a')](_0x4c5c5c['query']);_0x385208[_0x8aa8('0x2d')]=_[_0x8aa8('0x2e')](_0x385208[_0x8aa8('0x29')],_0x385208['query']);_0x5e96c9[_0x8aa8('0x2f')]=_[_0x8aa8('0x2e')](_0x385208[_0x8aa8('0x29')],qs[_0x8aa8('0x30')](_0x4c5c5c[_0x8aa8('0x2c')][_0x8aa8('0x30')]));_0x5e96c9[_0x8aa8('0x2f')]=_0x5e96c9[_0x8aa8('0x2f')][_0x8aa8('0x31')]?_0x5e96c9[_0x8aa8('0x2f')]:_0x385208[_0x8aa8('0x29')];if(_0x4c5c5c['query']['includeAll']){_0x5e96c9[_0x8aa8('0x32')]=[{'all':!![]}];}_0x5e96c9=_[_0x8aa8('0x33')]({},_0x5e96c9,_0x4c5c5c[_0x8aa8('0x34')]);return db[_0x8aa8('0x2b')][_0x8aa8('0x35')](_0x5e96c9)[_0x8aa8('0x24')](handleEntityNotFound(_0x10810d,null))['then'](respondWithResult(_0x10810d,null))['catch'](handleError(_0x10810d,null));};exports[_0x8aa8('0x36')]=function(_0x5755b5,_0x24997c){if(_0x5755b5[_0x8aa8('0x37')]['id']){delete _0x5755b5[_0x8aa8('0x37')]['id'];}return db['MailApplication'][_0x8aa8('0x35')]({'where':{'id':_0x5755b5[_0x8aa8('0x28')]['id']}})[_0x8aa8('0x24')](handleEntityNotFound(_0x24997c,null))['then'](saveUpdates(_0x5755b5['body'],null))[_0x8aa8('0x24')](respondWithResult(_0x24997c,null))[_0x8aa8('0x38')](handleError(_0x24997c,null));};exports['destroy']=function(_0x24eb18,_0x2e1f52){return db['MailApplication'][_0x8aa8('0x35')]({'where':{'id':_0x24eb18['params']['id']}})['then'](handleEntityNotFound(_0x2e1f52,null))[_0x8aa8('0x24')](removeEntity(_0x2e1f52,null))['catch'](handleError(_0x2e1f52,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index c7cc98d..1445b7a 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 _0xb52b=['utf8mb4','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','exports','define','MailApplication'];(function(_0x48c811,_0x5e889c){var _0x33021f=function(_0x5e5f44){while(--_0x5e5f44){_0x48c811['push'](_0x48c811['shift']());}};_0x33021f(++_0x5e889c);}(_0xb52b,0x12a));var _0xbb52=function(_0x420817,_0x21ec24){_0x420817=_0x420817-0x0;var _0x515ca2=_0xb52b[_0x420817];return _0x515ca2;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xbb52('0x0'));var BPromise=require(_0xbb52('0x1'));var rp=require(_0xbb52('0x2'));var fs=require('fs');var path=require(_0xbb52('0x3'));var rimraf=require(_0xbb52('0x4'));var config=require(_0xbb52('0x5'));var attributes=require(_0xbb52('0x6'));module[_0xbb52('0x7')]=function(_0x5539e9,_0x1cea65){return _0x5539e9[_0xbb52('0x8')](_0xbb52('0x9'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbb52('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xa650=['utf8mb4_unicode_ci','lodash','bluebird','request-promise','path','../../config/environment','mail_applications','utf8mb4'];(function(_0x3ba844,_0x42d868){var _0x416f06=function(_0x46c5e8){while(--_0x46c5e8){_0x3ba844['push'](_0x3ba844['shift']());}};_0x416f06(++_0x42d868);}(_0xa650,0x1e9));var _0x0a65=function(_0x346da8,_0x50af51){_0x346da8=_0x346da8-0x0;var _0x266788=_0xa650[_0x346da8];return _0x266788;};'use strict';var _=require(_0x0a65('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0a65('0x1'));var rp=require(_0x0a65('0x2'));var fs=require('fs');var path=require(_0x0a65('0x3'));var rimraf=require('rimraf');var config=require(_0x0a65('0x4'));var attributes=require('./mailApplication.attributes');module['exports']=function(_0x467dd9,_0x59c552){return _0x467dd9['define']('MailApplication',attributes,{'tableName':_0x0a65('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0a65('0x6'),'collate':_0x0a65('0x7')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 5ecbde4..7a54d2b 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 _0xed92=['request','info','MailApplication,\x20%s,\x20%s','request\x20sent','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateMailApplication','MailApplication','body','options','where','limit','then','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x2781e9,_0x54d637){var _0x3008a3=function(_0x2b0751){while(--_0x2b0751){_0x2781e9['push'](_0x2781e9['shift']());}};_0x3008a3(++_0x54d637);}(_0xed92,0x1a5));var _0x2ed9=function(_0x3be285,_0x407fa6){_0x3be285=_0x3be285-0x0;var _0x1a66b9=_0xed92[_0x3be285];return _0x1a66b9;};'use strict';var _=require(_0x2ed9('0x0'));var util=require(_0x2ed9('0x1'));var moment=require(_0x2ed9('0x2'));var BPromise=require(_0x2ed9('0x3'));var rs=require(_0x2ed9('0x4'));var fs=require('fs');var Redis=require(_0x2ed9('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2ed9('0x6'));var logger=require(_0x2ed9('0x7'))(_0x2ed9('0x8'));var config=require(_0x2ed9('0x9'));var jayson=require(_0x2ed9('0xa'));var client=jayson[_0x2ed9('0xb')][_0x2ed9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x283878,_0x59461d,_0x429976){return new BPromise(function(_0x258fc8,_0x585fd9){return client[_0x2ed9('0xd')](_0x283878,_0x429976)['then'](function(_0x5c61be){logger[_0x2ed9('0xe')](_0x2ed9('0xf'),_0x59461d,_0x2ed9('0x10'));logger['debug'](_0x2ed9('0x11'),_0x59461d,'request\x20sent',JSON[_0x2ed9('0x12')](_0x5c61be));if(_0x5c61be[_0x2ed9('0x13')]){if(_0x5c61be['error'][_0x2ed9('0x14')]===0x1f4){logger[_0x2ed9('0x13')]('MailApplication,\x20%s,\x20%s',_0x59461d,_0x5c61be[_0x2ed9('0x13')]['message']);return _0x585fd9(_0x5c61be[_0x2ed9('0x13')][_0x2ed9('0x15')]);}logger[_0x2ed9('0x13')]('MailApplication,\x20%s,\x20%s',_0x59461d,_0x5c61be[_0x2ed9('0x13')][_0x2ed9('0x15')]);return _0x258fc8(_0x5c61be[_0x2ed9('0x13')][_0x2ed9('0x15')]);}else{logger['info'](_0x2ed9('0xf'),_0x59461d,_0x2ed9('0x10'));_0x258fc8(_0x5c61be[_0x2ed9('0x16')][_0x2ed9('0x15')]);}})[_0x2ed9('0x17')](function(_0x44d900){logger[_0x2ed9('0x13')]('MailApplication,\x20%s,\x20%s',_0x59461d,_0x44d900);_0x585fd9(_0x44d900);});});}exports[_0x2ed9('0x18')]=function(_0x1c5788){var _0x16f5e2=this;return new Promise(function(_0x1b17b5,_0x532d2){return db[_0x2ed9('0x19')]['update'](_0x1c5788[_0x2ed9('0x1a')],{'raw':_0x1c5788[_0x2ed9('0x1b')]?_0x1c5788[_0x2ed9('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c5788[_0x2ed9('0x1b')]?_0x1c5788[_0x2ed9('0x1b')][_0x2ed9('0x1c')]||null:null,'attributes':_0x1c5788[_0x2ed9('0x1b')]?_0x1c5788[_0x2ed9('0x1b')]['attributes']||null:null,'limit':_0x1c5788[_0x2ed9('0x1b')]?_0x1c5788[_0x2ed9('0x1b')][_0x2ed9('0x1d')]||null:null})[_0x2ed9('0x1e')](function(_0x45c81e){logger[_0x2ed9('0xe')](_0x2ed9('0x18'),_0x1c5788);logger['debug']('UpdateMailApplication',_0x1c5788,JSON[_0x2ed9('0x12')](_0x45c81e));_0x1b17b5(_0x45c81e);})[_0x2ed9('0x17')](function(_0x4b2403){logger['error'](_0x2ed9('0x18'),_0x4b2403['message'],_0x1c5788);_0x532d2(_0x16f5e2[_0x2ed9('0x13')](0x1f4,_0x4b2403[_0x2ed9('0x15')]));});});}; \ No newline at end of file +var _0x2e3a=['raw','where','attributes','stringify','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','error','code','message','info','result','UpdateMailApplication','MailApplication','body','options'];(function(_0x13babe,_0x51c48e){var _0x2ab002=function(_0x42e33a){while(--_0x42e33a){_0x13babe['push'](_0x13babe['shift']());}};_0x2ab002(++_0x51c48e);}(_0x2e3a,0x145));var _0xa2e3=function(_0x4a0875,_0x5ed913){_0x4a0875=_0x4a0875-0x0;var _0x385131=_0x2e3a[_0x4a0875];return _0x385131;};'use strict';var _=require(_0xa2e3('0x0'));var util=require('util');var moment=require(_0xa2e3('0x1'));var BPromise=require('bluebird');var rs=require(_0xa2e3('0x2'));var fs=require('fs');var Redis=require(_0xa2e3('0x3'));var db=require(_0xa2e3('0x4'))['db'];var utils=require(_0xa2e3('0x5'));var logger=require(_0xa2e3('0x6'))(_0xa2e3('0x7'));var config=require(_0xa2e3('0x8'));var jayson=require(_0xa2e3('0x9'));var client=jayson[_0xa2e3('0xa')][_0xa2e3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1258a2,_0x3ff4dd,_0x271e45){return new BPromise(function(_0x2f8508,_0x49f29f){return client[_0xa2e3('0xc')](_0x1258a2,_0x271e45)[_0xa2e3('0xd')](function(_0x7042b5){logger['info'](_0xa2e3('0xe'),_0x3ff4dd,_0xa2e3('0xf'));logger[_0xa2e3('0x10')](_0xa2e3('0x11'),_0x3ff4dd,_0xa2e3('0xf'),JSON['stringify'](_0x7042b5));if(_0x7042b5[_0xa2e3('0x12')]){if(_0x7042b5[_0xa2e3('0x12')][_0xa2e3('0x13')]===0x1f4){logger[_0xa2e3('0x12')](_0xa2e3('0xe'),_0x3ff4dd,_0x7042b5[_0xa2e3('0x12')][_0xa2e3('0x14')]);return _0x49f29f(_0x7042b5['error'][_0xa2e3('0x14')]);}logger['error'](_0xa2e3('0xe'),_0x3ff4dd,_0x7042b5[_0xa2e3('0x12')]['message']);return _0x2f8508(_0x7042b5['error'][_0xa2e3('0x14')]);}else{logger[_0xa2e3('0x15')](_0xa2e3('0xe'),_0x3ff4dd,_0xa2e3('0xf'));_0x2f8508(_0x7042b5[_0xa2e3('0x16')][_0xa2e3('0x14')]);}})['catch'](function(_0x1274e0){logger[_0xa2e3('0x12')](_0xa2e3('0xe'),_0x3ff4dd,_0x1274e0);_0x49f29f(_0x1274e0);});});}exports[_0xa2e3('0x17')]=function(_0x3f7370){var _0x18e60e=this;return new Promise(function(_0x3af347,_0x7e6667){return db[_0xa2e3('0x18')]['update'](_0x3f7370[_0xa2e3('0x19')],{'raw':_0x3f7370[_0xa2e3('0x1a')]?_0x3f7370[_0xa2e3('0x1a')][_0xa2e3('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f7370[_0xa2e3('0x1a')]?_0x3f7370[_0xa2e3('0x1a')][_0xa2e3('0x1c')]||null:null,'attributes':_0x3f7370[_0xa2e3('0x1a')]?_0x3f7370[_0xa2e3('0x1a')][_0xa2e3('0x1d')]||null:null,'limit':_0x3f7370[_0xa2e3('0x1a')]?_0x3f7370[_0xa2e3('0x1a')]['limit']||null:null})['then'](function(_0xc3127){logger[_0xa2e3('0x15')](_0xa2e3('0x17'),_0x3f7370);logger['debug'](_0xa2e3('0x17'),_0x3f7370,JSON[_0xa2e3('0x1e')](_0xc3127));_0x3af347(_0xc3127);})[_0xa2e3('0x1f')](function(_0x44559a){logger[_0xa2e3('0x12')]('UpdateMailApplication',_0x44559a[_0xa2e3('0x14')],_0x3f7370);_0x7e6667(_0x18e60e['error'](0x1f4,_0x44559a['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index e02282b..c6d547a 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 _0x8568=['express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','/:id','/:id/messages','getMessages','/:id/download','download','create','addMessage','post','tracked','mailinteraction:addtags','addTags','mailinteraction:update','delete','mail','exports'];(function(_0x3a8db5,_0x31cff7){var _0x2c03cd=function(_0x47dba0){while(--_0x47dba0){_0x3a8db5['push'](_0x3a8db5['shift']());}};_0x2c03cd(++_0x31cff7);}(_0x8568,0x8a));var _0x8856=function(_0x93942f,_0xb48547){_0x93942f=_0x93942f-0x0;var _0x23fcd8=_0x8568[_0x93942f];return _0x23fcd8;};'use strict';var express=require(_0x8856('0x0'));var router=express[_0x8856('0x1')]();var auth=require(_0x8856('0x2'));var interaction=require(_0x8856('0x3'));var controller=require('./mailInteraction.controller');router[_0x8856('0x4')]('/',auth[_0x8856('0x5')](),controller[_0x8856('0x6')]);router[_0x8856('0x4')]('/describe',auth[_0x8856('0x5')](),controller[_0x8856('0x7')]);router[_0x8856('0x4')](_0x8856('0x8'),auth[_0x8856('0x5')](),controller['show']);router[_0x8856('0x4')](_0x8856('0x9'),auth['isAuthenticated'](),controller[_0x8856('0xa')]);router[_0x8856('0x4')](_0x8856('0xb'),auth[_0x8856('0x5')](),controller[_0x8856('0xc')]);router['post']('/',auth[_0x8856('0x5')](),controller[_0x8856('0xd')]);router['post'](_0x8856('0x9'),auth[_0x8856('0x5')](),controller[_0x8856('0xe')]);router[_0x8856('0xf')]('/:id/tags',auth[_0x8856('0x5')](),interaction[_0x8856('0x10')]('mail',_0x8856('0x11')),controller[_0x8856('0x12')]);router['put']('/:id',auth[_0x8856('0x5')](),interaction[_0x8856('0x10')]('mail',_0x8856('0x13')),controller['update']);router[_0x8856('0x14')](_0x8856('0x8'),auth[_0x8856('0x5')](),interaction['tracked'](_0x8856('0x15'),'mailinteraction:destroy'),controller['destroy']);router[_0x8856('0x14')]('/:id/tags',auth[_0x8856('0x5')](),controller['removeTags']);module[_0x8856('0x16')]=router; \ No newline at end of file +var _0x3a6a=['exports','express','Router','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','create','post','mail','mailinteraction:addtags','addTags','tracked','mailinteraction:update','update','mailinteraction:destroy','destroy','delete','/:id/tags','removeTags'];(function(_0x43ce48,_0x2d15d3){var _0x35f492=function(_0x221d9a){while(--_0x221d9a){_0x43ce48['push'](_0x43ce48['shift']());}};_0x35f492(++_0x2d15d3);}(_0x3a6a,0x106));var _0xa3a6=function(_0xd511d,_0x3546b9){_0xd511d=_0xd511d-0x0;var _0x3f148e=_0x3a6a[_0xd511d];return _0x3f148e;};'use strict';var express=require(_0xa3a6('0x0'));var router=express[_0xa3a6('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0xa3a6('0x2'));var controller=require(_0xa3a6('0x3'));router[_0xa3a6('0x4')]('/',auth[_0xa3a6('0x5')](),controller[_0xa3a6('0x6')]);router[_0xa3a6('0x4')](_0xa3a6('0x7'),auth[_0xa3a6('0x5')](),controller[_0xa3a6('0x8')]);router[_0xa3a6('0x4')](_0xa3a6('0x9'),auth[_0xa3a6('0x5')](),controller[_0xa3a6('0xa')]);router[_0xa3a6('0x4')](_0xa3a6('0xb'),auth[_0xa3a6('0x5')](),controller[_0xa3a6('0xc')]);router[_0xa3a6('0x4')](_0xa3a6('0xd'),auth['isAuthenticated'](),controller[_0xa3a6('0xe')]);router['post']('/',auth[_0xa3a6('0x5')](),controller[_0xa3a6('0xf')]);router['post'](_0xa3a6('0xb'),auth[_0xa3a6('0x5')](),controller['addMessage']);router[_0xa3a6('0x10')]('/:id/tags',auth[_0xa3a6('0x5')](),interaction['tracked'](_0xa3a6('0x11'),_0xa3a6('0x12')),controller[_0xa3a6('0x13')]);router['put'](_0xa3a6('0x9'),auth[_0xa3a6('0x5')](),interaction[_0xa3a6('0x14')]('mail',_0xa3a6('0x15')),controller[_0xa3a6('0x16')]);router['delete'](_0xa3a6('0x9'),auth[_0xa3a6('0x5')](),interaction['tracked']('mail',_0xa3a6('0x17')),controller[_0xa3a6('0x18')]);router[_0xa3a6('0x19')](_0xa3a6('0x1a'),auth[_0xa3a6('0x5')](),controller[_0xa3a6('0x1b')]);module[_0xa3a6('0x1c')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index e28a6d6..53c2ef6 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 _0x15bb=['sequelize','exports','BOOLEAN','DATE','STRING','TEXT','ENUM','out'];(function(_0x1c468a,_0x2067e0){var _0xb4aa92=function(_0x2ff865){while(--_0x2ff865){_0x1c468a['push'](_0x1c468a['shift']());}};_0xb4aa92(++_0x2067e0);}(_0x15bb,0x140));var _0xb15b=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x15bb[_0x4b055c];return _0x4b62bb;};'use strict';var Sequelize=require(_0xb15b('0x0'));var iconv=require('iconv');module[_0xb15b('0x1')]={'closed':{'type':Sequelize[_0xb15b('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb15b('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0xb15b('0x4')](0x1fe)},'to':{'type':Sequelize[_0xb15b('0x4')]},'cc':{'type':Sequelize['TEXT']('long')},'subject':{'type':Sequelize[_0xb15b('0x5')]()},'attach':{'type':Sequelize[_0xb15b('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0xb15b('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xb15b('0x6')]('in',_0xb15b('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xb15b('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xb15b('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xe31a=['out','sequelize','iconv','exports','BOOLEAN','DATE','STRING','TEXT','ENUM'];(function(_0x4592d7,_0x1a7832){var _0x2072b7=function(_0x40bfbb){while(--_0x40bfbb){_0x4592d7['push'](_0x4592d7['shift']());}};_0x2072b7(++_0x1a7832);}(_0xe31a,0xd0));var _0xae31=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xe31a[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0xae31('0x0'));var iconv=require(_0xae31('0x1'));module[_0xae31('0x2')]={'closed':{'type':Sequelize[_0xae31('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xae31('0x4')]},'disposition':{'type':Sequelize[_0xae31('0x5')]},'secondDisposition':{'type':Sequelize[_0xae31('0x5')]},'thirdDisposition':{'type':Sequelize[_0xae31('0x5')]},'note':{'type':Sequelize[_0xae31('0x5')]},'inReplyTo':{'type':Sequelize[_0xae31('0x5')](0x1fe)},'to':{'type':Sequelize[_0xae31('0x5')]},'cc':{'type':Sequelize[_0xae31('0x6')]('long')},'subject':{'type':Sequelize[_0xae31('0x6')]()},'attach':{'type':Sequelize[_0xae31('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0xae31('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0xae31('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xae31('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xae31('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xae31('0x7')]('in',_0xae31('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xae31('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 6cdad73..dfbd77e 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 _0x929e=['$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','t.id\x20IN\x20?','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','i.MailAccountId\x20IN\x20?','toString','sequelize','keyBy','merge','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.createdAt','i.lastMsgDirection','i.subject','i.thirdDisposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','MailInteractionId','findOne','enableEmailPreview','all','show','params','rawAttributes','includeAll','include','options','create','body','describe','addMessage','ids','omit','hasOwnProperty','nolimit','format','findAll','inlineCss','rows','addTags','setTags','color','emit','mailInteractionTags:save','removeTags','unix','join','root','tmp','server','files','attachments','transcript-%d-%s.zip','Attachments','subject','Messages','get','mkdirSync','each','decode','headers','bcc','Bcc','basename','existsSync','build','writeFileSync','message%d.eml','download','unlinkSync','rimraf','zip-dir','bluebird','util','path','lodash','juice','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','redis','localhost','socket.io-emitter','./mailInteraction.socket','sendStatus','end','offset','undefined','count','set','Content-Range','json','update','then','destroy','status','error','stack','name','Users','fullname','TagIds','split','forEach','Tags','push','MailMessage','plainBody','lastMsgText','trimStart','catch','waiting','talking','answered','unmanaged','UserId','closed','index','map','MailInteraction','fieldName','model','query','keys','filters','intersection','attributes','fields','length','limit','order','sort','where','pick','field','select','u.id','ui.MailInteractionId','from','users','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','left_join','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','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?','some','isEmpty','createdAt','parse','$gte'];(function(_0x583cd5,_0xfbb91){var _0x3535de=function(_0x43f7f5){while(--_0x43f7f5){_0x583cd5['push'](_0x583cd5['shift']());}};_0x3535de(++_0xfbb91);}(_0x929e,0x76));var _0xe929=function(_0x568ff5,_0x36ec9e){_0x568ff5=_0x568ff5-0x0;var _0x56cb69=_0x929e[_0x568ff5];return _0x56cb69;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe929('0x0'));var zipdir=require(_0xe929('0x1'));var moment=require('moment');var BPromise=require(_0xe929('0x2'));var util=require(_0xe929('0x3'));var path=require(_0xe929('0x4'));var fs=require('fs');var _=require(_0xe929('0x5'));var squel=require('squel');var juice=require(_0xe929('0x6'));var Redis=require(_0xe929('0x7'));var qs=require(_0xe929('0x8'));var as=require(_0xe929('0x9'));var logger=require('../../config/logger')(_0xe929('0xa'));var config=require(_0xe929('0xb'));var db=require('../../mysqldb')['db'];var htmlEntities=require('html-entities');config[_0xe929('0xc')]=_['defaults'](config['redis'],{'host':_0xe929('0xd'),'port':0x18eb});var socket=require(_0xe929('0xe'))(new Redis(config['redis']));require(_0xe929('0xf'))['register'](socket);function respondWithStatusCode(_0x1476e1,_0x1cf27d){_0x1cf27d=_0x1cf27d||0xcc;return function(_0x3b2222){if(_0x3b2222){return _0x1476e1[_0xe929('0x10')](_0x1cf27d);}return _0x1476e1['status'](_0x1cf27d)[_0xe929('0x11')]();};}function respondWithResult(_0x6f57e6,_0x5ce132){_0x5ce132=_0x5ce132||0xc8;return function(_0x48ec49){if(_0x48ec49){return _0x6f57e6['status'](_0x5ce132)['json'](_0x48ec49);}};}function respondWithFilteredResult(_0x1223ae,_0x40f679){return function(_0x44c28b){if(_0x44c28b){var _0x5b8d67=typeof _0x40f679[_0xe929('0x12')]===_0xe929('0x13')&&typeof _0x40f679['limit']===_0xe929('0x13');var _0x28011c=_0x44c28b[_0xe929('0x14')];var _0x2538e8=_0x5b8d67?0x0:_0x40f679[_0xe929('0x12')];var _0x3f1769=_0x5b8d67?_0x44c28b[_0xe929('0x14')]:_0x40f679[_0xe929('0x12')]+_0x40f679['limit'];var _0x426430;if(_0x3f1769>=_0x28011c){_0x3f1769=_0x28011c;_0x426430=0xc8;}else{_0x426430=0xce;}_0x1223ae['status'](_0x426430);return _0x1223ae[_0xe929('0x15')](_0xe929('0x16'),_0x2538e8+'-'+_0x3f1769+'/'+_0x28011c)[_0xe929('0x17')](_0x44c28b);}return null;};}function saveUpdates(_0x5eec4a){return function(_0x4f36f8){if(_0x4f36f8){return _0x4f36f8[_0xe929('0x18')](_0x5eec4a)[_0xe929('0x19')](function(_0x32725e){return _0x32725e;});}return null;};}function removeEntity(_0x33a210){return function(_0x42d380){if(_0x42d380){return _0x42d380[_0xe929('0x1a')]()[_0xe929('0x19')](function(){_0x33a210[_0xe929('0x1b')](0xcc)[_0xe929('0x11')]();});}};}function handleEntityNotFound(_0x48a0f7){return function(_0x246592){if(!_0x246592){_0x48a0f7[_0xe929('0x10')](0x194);}return _0x246592;};}function handleError(_0x4ab5fa,_0x1b581c){_0x1b581c=_0x1b581c||0x1f4;return function(_0x8f9830){logger[_0xe929('0x1c')](_0x8f9830[_0xe929('0x1d')]);if(_0x8f9830[_0xe929('0x1e')]){delete _0x8f9830[_0xe929('0x1e')];}_0x4ab5fa['status'](_0x1b581c)['send'](_0x8f9830);};}function getInteractionUsers(_0x169a68,_0x67664a){return new BPromise(function(_0x2a530b,_0x502de5){try{if(_0x67664a[_0x169a68['id']]){_0x169a68[_0xe929('0x1f')]=_['map'](_0x67664a[_0x169a68['id']],function(_0x346cc9){return{'id':_0x346cc9['id'],'fullname':_0x346cc9[_0xe929('0x20')]};});}}catch(_0x56d9ef){_0x502de5(_0x56d9ef);}_0x2a530b(_0x169a68);});}function getInteractionTags(_0x35eda4,_0x4a4b27){return new BPromise(function(_0x5d5fbb,_0x3dfb0a){try{if(_0x35eda4['TagIds']){_0x35eda4['Tags']=[];_0x35eda4[_0xe929('0x21')][_0xe929('0x22')](',')[_0xe929('0x23')](function(_0x5d8f5a){_0x35eda4[_0xe929('0x24')][_0xe929('0x25')](_0x4a4b27[_0x5d8f5a]);});}delete _0x35eda4[_0xe929('0x21')];}catch(_0x257a10){_0x3dfb0a(_0x257a10);}_0x5d5fbb(_0x35eda4);});}function getLastMessageText(_0x2d22f7){return new BPromise(function(_0x17802f,_0x3236d3){return db[_0xe929('0x26')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x2d22f7['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xe929('0x27')],'order':'-id','raw':!![]})['then'](function(_0x4e5143){if(_0x4e5143&&_0x4e5143[_0xe929('0x27')]){_0x2d22f7[_0xe929('0x28')]=_[_0xe929('0x29')](_0x4e5143[_0xe929('0x27')]);}_0x17802f(_0x2d22f7);})[_0xe929('0x2a')](function(_0x2f22ae){_0x3236d3(_0x2f22ae);});});}function updateMailInteraction(_0x195e98,_0x504389,_0x4a02e2,_0x74415a){return new BPromise(function(_0x1440ba,_0xc4de3d){return getInteractionUsers(_0x195e98,_0x4a02e2)[_0xe929('0x19')](function(_0x5e7158){return getInteractionTags(_0x5e7158,_0x504389);})['then'](function(_0x477317){return getStateInteraction(_0x477317);})['then'](function(_0x11d8a7){if(_0x74415a){_0x1440ba(getLastMessageText(_0x11d8a7));}else{_0x1440ba(_0x11d8a7);}})[_0xe929('0x2a')](function(_0x127660){_0xc4de3d(_0x127660);});});}function getStateInteraction(_0x5b941e){return new BPromise(function(_0x795142){_0x5b941e[_0xe929('0x2b')]=0x0;_0x5b941e[_0xe929('0x2c')]=0x0;_0x5b941e[_0xe929('0x2d')]=0x0;_0x5b941e[_0xe929('0x2e')]=0x0;_0x5b941e['total']=0x0;if(!_0x5b941e['closed']&&!_0x5b941e[_0xe929('0x2f')]){_0x5b941e[_0xe929('0x2b')]+=0x1;}if(!_0x5b941e['closed']&&_0x5b941e[_0xe929('0x2f')]){_0x5b941e['talking']+=0x1;if(_0x5b941e[_0xe929('0x2b')]){_0x5b941e[_0xe929('0x2b')]-=0x1;}}if(_0x5b941e[_0xe929('0x30')]&&_0x5b941e['UserId']){_0x5b941e[_0xe929('0x2d')]+=0x1;if(_0x5b941e[_0xe929('0x2c')]){_0x5b941e[_0xe929('0x2c')]-=0x1;}}if(_0x5b941e['closed']&&!_0x5b941e[_0xe929('0x2f')]){_0x5b941e['unmanaged']+=0x1;if(_0x5b941e[_0xe929('0x2b')]){_0x5b941e[_0xe929('0x2b')]-=0x1;}}_0x5b941e['total']+=0x1;_0x795142(_0x5b941e);});}exports[_0xe929('0x31')]=function(_0x16dc85,_0x4e4d82){var _0x12ed68={},_0x58cdda={},_0x20a9fd={'count':0x0,'rows':[]};var _0x1de0d8=_[_0xe929('0x32')](db[_0xe929('0x33')]['rawAttributes'],function(_0x3b17d6){return{'name':_0x3b17d6[_0xe929('0x34')],'type':_0x3b17d6['type']['key']};});_0x58cdda[_0xe929('0x35')]=_[_0xe929('0x32')](_0x1de0d8,_0xe929('0x1e'));_0x58cdda[_0xe929('0x36')]=_[_0xe929('0x37')](_0x16dc85[_0xe929('0x36')]);_0x58cdda[_0xe929('0x38')]=_[_0xe929('0x39')](_0x58cdda[_0xe929('0x35')],_0x58cdda[_0xe929('0x36')]);_0x12ed68[_0xe929('0x3a')]=_[_0xe929('0x39')](_0x58cdda[_0xe929('0x35')],qs[_0xe929('0x3b')](_0x16dc85[_0xe929('0x36')][_0xe929('0x3b')]));_0x12ed68[_0xe929('0x3a')]=_0x12ed68['attributes'][_0xe929('0x3c')]?_0x12ed68[_0xe929('0x3a')]:_0x58cdda[_0xe929('0x35')];if(!_0x16dc85[_0xe929('0x36')]['hasOwnProperty']('nolimit')){_0x12ed68['limit']=qs[_0xe929('0x3d')](_0x16dc85[_0xe929('0x36')][_0xe929('0x3d')]);_0x12ed68[_0xe929('0x12')]=qs['offset'](_0x16dc85['query'][_0xe929('0x12')]);}_0x12ed68[_0xe929('0x3e')]=qs['sort'](_0x16dc85['query'][_0xe929('0x3f')]);_0x12ed68[_0xe929('0x40')]=qs['filters'](_[_0xe929('0x41')](_0x16dc85[_0xe929('0x36')],_0x58cdda['filters']),_0x1de0d8);var _0x30904c=[];var _0x3d4d4b=squel['select']()[_0xe929('0x42')]('id')[_0xe929('0x42')]('name')[_0xe929('0x42')]('color')['from']('tools_tags');var _0x821934=squel[_0xe929('0x43')]()[_0xe929('0x42')](_0xe929('0x44'))[_0xe929('0x42')]('u.fullname')['field'](_0xe929('0x45'))[_0xe929('0x46')]('user_has_mail_interactions','ui')['left_join'](_0xe929('0x47'),'u','u.id\x20=\x20ui.UserId');var _0x466647=squel[_0xe929('0x43')]()[_0xe929('0x46')](_0xe929('0x48'),'i')['left_join'](_0xe929('0x49'),'c',_0xe929('0x4a'))[_0xe929('0x4b')](_0xe929('0x47'),'o',_0xe929('0x4c'))[_0xe929('0x4b')](_0xe929('0x4d'),'a',_0xe929('0x4e'))['left_join'](_0xe929('0x4f'),'me',_0xe929('0x50'))[_0xe929('0x4b')](_0xe929('0x51'),'it',_0xe929('0x52'))[_0xe929('0x4b')](_0xe929('0x53'),'t',_0xe929('0x54'));var _0x931446=squel['expr']();var _0x5f25f1=[];var _0x3f0b34=squel[_0xe929('0x55')]();var _0x2d6cab;if(_0x16dc85['query'][_0xe929('0x56')]){_0x2d6cab=as[_0xe929('0x57')](_0x16dc85[_0xe929('0x36')]['search']);var _0x53522b=_0x2d6cab[_0xe929('0x58')];for(var _0x47ba88=0x0;_0x47ba88<_0x2d6cab[_0xe929('0x59')][_0xe929('0x3c')];_0x47ba88++){var _0x191384=_0x2d6cab[_0xe929('0x59')][_0x47ba88];var _0x2a27af='i';var _0x1926fb=_[_0xe929('0x5a')](_0x1de0d8,[_0xe929('0x1e'),_0x191384[_0xe929('0x42')]]);if(!_0x1926fb){switch(_0x191384['field']){case _0xe929('0x5b'):if(_0x191384['value']==0x1){_0x466647[_0xe929('0x5c')]('`'+_0x191384[_0xe929('0x42')]+_0xe929('0x5d'));}else{_0x466647[_0xe929('0x5c')]('`'+_0x191384[_0xe929('0x42')]+_0xe929('0x5e'));}break;case _0xe929('0x5f'):if(_0x191384[_0xe929('0x60')]===_0xe929('0x61')){if(_0x191384[_0xe929('0x62')][_0xe929('0x22')]('\x20')[_0xe929('0x3c')]>0x1){_0x931446[_0x53522b](_0xe929('0x63'),qs[_0xe929('0x64')](_0x191384[_0xe929('0x62')]),null);}else{var _0x306a0d='%'+_0x191384[_0xe929('0x62')]+'%';_0x931446[_0x53522b](_0xe929('0x65'),_0x306a0d,_0x306a0d,_0x306a0d);}}else{_0x1926fb=_['find'](_0x1de0d8,[_0xe929('0x1e'),_0xe929('0x66')]);_0x191384[_0xe929('0x42')]=_0xe929('0x66');_0x41af39=as[_0xe929('0x67')](_0x2a27af,_0x1926fb[_0xe929('0x68')],_0x191384);_0x931446[_0x53522b](_0x41af39[_0xe929('0x69')],_0x41af39['value'][_0xe929('0x6a')],_0x41af39[_0xe929('0x62')][_0xe929('0x11')]);}break;case _0xe929('0x6b'):var _0x2ce125=_0x191384['value'][_0xe929('0x22')](',')[_0xe929('0x32')](function(_0x1d5618){return Number(_0x1d5618);});_0x2ce125[_0xe929('0x23')](function(_0x4eeca5){_0x3f0b34['or'](_0xe929('0x6c'),'%,'+_0x4eeca5+',%');});_0x5f25f1=_[_0xe929('0x6d')](_0x5f25f1,_0x2ce125);break;case _0xe929('0x6e'):if(_0x191384['operator']===_0xe929('0x61')){_0x931446[_0x53522b](_0xe929('0x6f'),'%'+_0x191384[_0xe929('0x62')]+'%',null);}else{_0x1926fb=_['find'](_0x1de0d8,[_0xe929('0x1e'),_0xe929('0x2f')]);_0x191384[_0xe929('0x42')]=_0xe929('0x2f');_0x41af39=as[_0xe929('0x67')](_0x2a27af,_0x1926fb[_0xe929('0x68')],_0x191384);_0x931446[_0x53522b](_0x41af39[_0xe929('0x69')],_0x41af39['value'][_0xe929('0x6a')],_0x41af39[_0xe929('0x62')][_0xe929('0x11')]);}break;case _0xe929('0x27'):_0x41af39=as[_0xe929('0x67')]('me',null,_0x191384);_0x931446[_0x53522b](_0x41af39[_0xe929('0x69')],_0x41af39['value'][_0xe929('0x6a')],_0x41af39['value'][_0xe929('0x11')]);break;}}else{var _0x41af39=as[_0xe929('0x67')](_0x2a27af,_0x1926fb[_0xe929('0x68')],_0x191384);_0x931446[_0x53522b](_0x41af39[_0xe929('0x69')],_0x41af39[_0xe929('0x62')]['start'],_0x41af39[_0xe929('0x62')][_0xe929('0x11')]);}}}else{var _0x597fe9=_(_0x16dc85[_0xe929('0x36')])[_0xe929('0x37')]()[_0xe929('0x32')](function(_0x2efe95){return _[_0xe929('0x70')](_0x1de0d8,[_0xe929('0x1e'),_0x2efe95])?_0x2efe95:undefined;})['compact']()[_0xe929('0x62')]();if(!_[_0xe929('0x71')](_0x597fe9)){_0x597fe9[_0xe929('0x23')](function(_0x4af02a){if(_0x4af02a==='MailAccountId'){_0x466647[_0xe929('0x40')]('i.MailAccountId\x20IN\x20?',[]['concat'](_0x16dc85[_0xe929('0x36')][_0x4af02a]));}else if(_0x4af02a===_0xe929('0x72')){var _0x1ef05e=JSON[_0xe929('0x73')](_0x16dc85['query'][_0x4af02a])[_0xe929('0x74')];var _0x21868d=JSON[_0xe929('0x73')](_0x16dc85['query'][_0x4af02a])[_0xe929('0x75')];_0x466647[_0xe929('0x40')](_0xe929('0x76'),_0x1ef05e,_0x21868d);}else{if(_0x16dc85[_0xe929('0x36')][_0x4af02a]===_0xe929('0x77')){_0x466647['where']('i.'+_0x4af02a+_0xe929('0x78'));}else{_0x466647[_0xe929('0x40')]('i.'+_0x4af02a+_0xe929('0x79'),_0x16dc85[_0xe929('0x36')][_0x4af02a]);}}});}if(_0x16dc85[_0xe929('0x36')][_0xe929('0x7a')]){if(_0x16dc85[_0xe929('0x36')][_0xe929('0x7a')]==0x1){_0x466647[_0xe929('0x5c')](_0xe929('0x7b'));}else{_0x466647[_0xe929('0x5c')](_0xe929('0x7c'));}}if(_0x16dc85[_0xe929('0x36')][_0xe929('0x7d')]){_0x5f25f1=_[_0xe929('0x7e')](_0x16dc85[_0xe929('0x36')][_0xe929('0x7d')])?_0x16dc85[_0xe929('0x36')][_0xe929('0x7d')]:new Array(_0x16dc85['query'][_0xe929('0x7d')]);_0x5f25f1[_0xe929('0x23')](function(_0x8ca4c9){_0x3f0b34['or'](_0xe929('0x6c'),'%,'+_0x8ca4c9+',%');});}if(_0x16dc85[_0xe929('0x36')][_0xe929('0x7f')]){var _0x331992=_0x16dc85[_0xe929('0x36')]['filter'][_0xe929('0x80')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xe929('0x81')](_0x331992)){_0x931446['or'](_0xe929('0x82'),_0x331992+'%');}else if(qs['isEmail'](_0x331992)){_0x931446['or'](_0xe929('0x83'),_0x331992+'%');}else{_0x931446['or'](_0xe929('0x84'),qs[_0xe929('0x64')](_0x331992))['or'](_0xe929('0x85'),qs[_0xe929('0x64')](_0x331992));}}}_0x466647[_0xe929('0x40')](_0x931446);_0x466647[_0xe929('0x86')](_0xe929('0x87'));var _0x15a69f={'type':db[_0xe929('0x88')][_0xe929('0x89')]['SELECT'],'raw':!![]};var _0x1c8835=_0x466647['clone']();_0x1c8835[_0xe929('0x42')](_0xe929('0x87'));_0x1c8835['field'](_0xe929('0x8a'),_0xe929('0x5b'));if(_0x12ed68['order']){_0x12ed68[_0xe929('0x3e')][_0xe929('0x23')](function(_0xd85d13){var _0x21da38=_0xd85d13[0x0]==='contactName'?_0xd85d13[0x0]:'i.'+_0xd85d13[0x0];_0x466647[_0xe929('0x3e')](_0x21da38,_0xd85d13[0x1]==='DESC'?![]:!![]);});}if(!_[_0xe929('0x71')](_0x5f25f1)){_0x466647[_0xe929('0x5c')](_0x3f0b34);_0x1c8835[_0xe929('0x40')](_0xe929('0x8b'),_0x5f25f1);}BPromise['resolve']()[_0xe929('0x19')](function(){if(!_0x2d6cab){if(_0x16dc85[_0xe929('0x36')][_0xe929('0x8c')])return;_0x1c8835[_0xe929('0x40')](_0xe929('0x8d'));_0x466647[_0xe929('0x40')](_0xe929('0x8d'));return;}if(_0x16dc85[_0xe929('0x8e')][_0xe929('0x8f')]!==_0xe929('0x90'))return;return _0x16dc85[_0xe929('0x8e')][_0xe929('0x91')]({'attributes':['id'],'raw':!![]})[_0xe929('0x19')](function(_0x2b4c20){if(_[_0xe929('0x71')](_0x2b4c20)){_0x1c8835[_0xe929('0x40')](_0xe929('0x92'));_0x466647[_0xe929('0x40')](_0xe929('0x92'));}else{_0x1c8835['where'](_0xe929('0x93'),_[_0xe929('0x32')](_0x2b4c20,'id'));_0x466647[_0xe929('0x40')]('i.MailAccountId\x20IN\x20?',_[_0xe929('0x32')](_0x2b4c20,'id'));}});})[_0xe929('0x19')](function(){if(_0x16dc85[_0xe929('0x8e')][_0xe929('0x8f')]==='agent'&&!_0x2d6cab&&!_0x16dc85[_0xe929('0x36')]['MailAccountId'])return[];return db['sequelize'][_0xe929('0x36')](_0x1c8835[_0xe929('0x94')](),_0x15a69f);})[_0xe929('0x19')](function(_0x129670){_0x20a9fd['count']=_0x129670[_0xe929('0x3c')];if(_0x20a9fd[_0xe929('0x14')]===0x0)return[];return db[_0xe929('0x95')][_0xe929('0x36')](_0x3d4d4b[_0xe929('0x94')](),_0x15a69f)[_0xe929('0x19')](function(_0x59ae68){_0x30904c=_[_0xe929('0x96')](_0x59ae68,'id');_0x15a69f=_[_0xe929('0x97')](_0x15a69f,{'model':db[_0xe929('0x33')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x16dc85[_0xe929('0x36')]['fields']){_0x12ed68[_0xe929('0x3a')][_0xe929('0x23')](function(_0x562e6a){_0x466647[_0xe929('0x42')]('i.'+_0x562e6a);});}else{_0x466647[_0xe929('0x42')](_0xe929('0x8a'),_0xe929('0x5b'));_0x466647['field']('a.key',_0xe929('0x98'));_0x466647['field'](_0xe929('0x99'),_0xe929('0x9a'));_0x466647['field'](_0xe929('0x9b'),_0xe929('0x9c'));_0x466647[_0xe929('0x42')](_0xe929('0x87'));_0x466647[_0xe929('0x42')](_0xe929('0x9d'));_0x466647[_0xe929('0x42')]('i.updatedAt');_0x466647[_0xe929('0x42')]('i.closed');_0x466647[_0xe929('0x42')]('i.closedAt');_0x466647['field']('i.attach');_0x466647[_0xe929('0x42')]('i.lastMsgAt');_0x466647[_0xe929('0x42')](_0xe929('0x9e'));_0x466647[_0xe929('0x42')](_0xe929('0x9f'));_0x466647[_0xe929('0x42')]('i.disposition');_0x466647[_0xe929('0x42')]('i.secondDisposition');_0x466647['field'](_0xe929('0xa0'));_0x466647[_0xe929('0x42')](_0xe929('0xa1'));_0x466647[_0xe929('0x42')](_0xe929('0xa2'));_0x466647[_0xe929('0x42')](_0xe929('0xa3'));_0x466647[_0xe929('0x42')](_0xe929('0xa4'));_0x466647[_0xe929('0x42')](_0xe929('0xa5'));_0x466647[_0xe929('0x42')](_0xe929('0xa6'),_0xe929('0xa7'));_0x466647[_0xe929('0x42')](_0xe929('0xa8'),_0xe929('0xa9'));_0x466647['field'](_0xe929('0xaa'),_0xe929('0xab'));_0x466647[_0xe929('0x42')](_0xe929('0xac'),_0xe929('0xad'));_0x466647[_0xe929('0x42')](_0xe929('0xae'),_0xe929('0xaf'));_0x466647[_0xe929('0x42')](_0xe929('0xb0'),_0xe929('0xb1'));_0x466647[_0xe929('0x42')](_0xe929('0xb2'),'Owner.fullname');_0x466647['field'](_0xe929('0xb3'),'Owner.internal');_0x466647[_0xe929('0x42')](_0xe929('0xb4'),_0xe929('0x21'));}if(_0x12ed68['limit'])_0x466647[_0xe929('0x3d')](_0x12ed68['limit']);if(_0x12ed68[_0xe929('0x12')])_0x466647['offset'](_0x12ed68['offset']);return db[_0xe929('0x95')]['query'](_0x466647['toString'](),_0x15a69f);})[_0xe929('0x19')](function(_0x2b4ee5){if(_0x2b4ee5[_0xe929('0x3c')]>0x0)_0x821934[_0xe929('0x40')]('ui.MailInteractionId\x20IN\x20?',_[_0xe929('0x32')](_0x2b4ee5,'id'));return db['sequelize']['query'](_0x821934['toString'](),_0x15a69f)[_0xe929('0x19')](function(_0x505bd0){var _0x30280b=_[_0xe929('0xb5')](_0x505bd0,_0xe929('0xb6'));var _0xb7dbd=[];return db['Setting'][_0xe929('0xb7')]({'attributes':[_0xe929('0xb8')],'raw':!![]})['then'](function(_0x2f85c9){var _0x174d8d=_0x2f85c9['enableEmailPreview'];_0x2b4ee5[_0xe929('0x23')](function(_0x2de426){_0xb7dbd['push'](updateMailInteraction(_0x2de426,_0x30904c,_0x30280b,_0x174d8d));});return BPromise[_0xe929('0xb9')](_0xb7dbd);});});});})[_0xe929('0x19')](function(_0x3ef556){_0x20a9fd['rows']=_0x3ef556;return _0x20a9fd;})[_0xe929('0x19')](respondWithFilteredResult(_0x4e4d82,_0x12ed68))[_0xe929('0x2a')](handleError(_0x4e4d82,null));};exports[_0xe929('0xba')]=function(_0x524d90,_0x42d945){var _0x356790={'raw':![],'where':{'id':_0x524d90[_0xe929('0xbb')]['id']}},_0x53ca0e={};_0x53ca0e[_0xe929('0x35')]=_[_0xe929('0x37')](db[_0xe929('0x33')][_0xe929('0xbc')]);_0x53ca0e[_0xe929('0x36')]=_[_0xe929('0x37')](_0x524d90[_0xe929('0x36')]);_0x53ca0e[_0xe929('0x38')]=_[_0xe929('0x39')](_0x53ca0e[_0xe929('0x35')],_0x53ca0e['query']);_0x356790[_0xe929('0x3a')]=_['intersection'](_0x53ca0e[_0xe929('0x35')],qs['fields'](_0x524d90[_0xe929('0x36')]['fields']));_0x356790[_0xe929('0x3a')]=_0x356790[_0xe929('0x3a')][_0xe929('0x3c')]?_0x356790['attributes']:_0x53ca0e[_0xe929('0x35')];if(_0x524d90[_0xe929('0x36')][_0xe929('0xbd')]){_0x356790[_0xe929('0xbe')]=[{'all':!![]}];}_0x356790=_['merge']({},_0x356790,_0x524d90[_0xe929('0xbf')]);return db[_0xe929('0x33')][_0xe929('0x5a')](_0x356790)['then'](handleEntityNotFound(_0x42d945,null))[_0xe929('0x19')](respondWithResult(_0x42d945,null))[_0xe929('0x2a')](handleError(_0x42d945,null));};exports[_0xe929('0xc0')]=function(_0x1bf0f2,_0x22fdce){return db['MailInteraction'][_0xe929('0xc0')](_0x1bf0f2[_0xe929('0xc1')],{})[_0xe929('0x19')](respondWithResult(_0x22fdce,0xc9))[_0xe929('0x2a')](handleError(_0x22fdce,null));};exports[_0xe929('0x18')]=function(_0x335a89,_0x52ce55){if(_0x335a89['body']['id']){delete _0x335a89[_0xe929('0xc1')]['id'];}return db['MailInteraction'][_0xe929('0x5a')]({'where':{'id':_0x335a89[_0xe929('0xbb')]['id']}})[_0xe929('0x19')](handleEntityNotFound(_0x52ce55,null))[_0xe929('0x19')](saveUpdates(_0x335a89[_0xe929('0xc1')],null))['then'](respondWithResult(_0x52ce55,null))['catch'](handleError(_0x52ce55,null));};exports[_0xe929('0x1a')]=function(_0x1baced,_0x216a9e){return db['MailInteraction'][_0xe929('0x5a')]({'where':{'id':_0x1baced[_0xe929('0xbb')]['id']}})[_0xe929('0x19')](handleEntityNotFound(_0x216a9e,null))[_0xe929('0x19')](removeEntity(_0x216a9e,null))[_0xe929('0x2a')](handleError(_0x216a9e,null));};exports[_0xe929('0xc2')]=function(_0x4d2172,_0x5a9fff){return db['MailInteraction'][_0xe929('0xc2')]()[_0xe929('0x19')](respondWithResult(_0x5a9fff,null))[_0xe929('0x2a')](handleError(_0x5a9fff,null));};exports[_0xe929('0xc3')]=function(_0x1b8f80,_0x48ef89){return db[_0xe929('0x26')][_0xe929('0x5a')]({'where':{'id':_0x1b8f80[_0xe929('0xbb')]['id']}})['then'](handleEntityNotFound(_0x48ef89,null))['then'](function(_0x22f530){if(_0x22f530){return _0x22f530[_0xe929('0xc3')](_0x1b8f80['body'][_0xe929('0xc4')],_[_0xe929('0xc5')](_0x1b8f80[_0xe929('0xc1')],[_0xe929('0xc4'),'id'])||{});}})['then'](respondWithResult(_0x48ef89,null))['catch'](handleError(_0x48ef89,null));};exports['getMessages']=function(_0x2f2aaa,_0xb1eb4d){var _0xd94149={'raw':![],'where':{}};var _0x218320={};var _0x4b6a5c={'count':0x0,'rows':[]};return db[_0xe929('0x33')]['findOne']({'where':{'id':_0x2f2aaa[_0xe929('0xbb')]['id']}})['then'](handleEntityNotFound(_0xb1eb4d,null))[_0xe929('0x19')](function(_0x5e4013){if(_0x5e4013){_0x218320[_0xe929('0x35')]=_[_0xe929('0x37')](db[_0xe929('0x26')]['rawAttributes']);_0x218320[_0xe929('0x36')]=_['keys'](_0x2f2aaa['query']);_0x218320[_0xe929('0x38')]=_[_0xe929('0x39')](_0x218320[_0xe929('0x35')],_0x218320[_0xe929('0x36')]);_0xd94149['attributes']=_[_0xe929('0x39')](_0x218320[_0xe929('0x35')],qs['fields'](_0x2f2aaa[_0xe929('0x36')][_0xe929('0x3b')]));_0xd94149[_0xe929('0x3a')]=_0xd94149[_0xe929('0x3a')][_0xe929('0x3c')]?_0xd94149[_0xe929('0x3a')]:_0x218320[_0xe929('0x35')];if(!_0x2f2aaa[_0xe929('0x36')][_0xe929('0xc6')](_0xe929('0xc7'))){_0xd94149['limit']=qs[_0xe929('0x3d')](_0x2f2aaa[_0xe929('0x36')][_0xe929('0x3d')]);_0xd94149['offset']=qs[_0xe929('0x12')](_0x2f2aaa[_0xe929('0x36')][_0xe929('0x12')]);}_0xd94149[_0xe929('0x3e')]=qs[_0xe929('0x3f')](_0x2f2aaa[_0xe929('0x36')][_0xe929('0x3f')]);_0xd94149['where']=qs[_0xe929('0x38')](_['pick'](_0x2f2aaa[_0xe929('0x36')],_0x218320[_0xe929('0x38')]));_0xd94149[_0xe929('0x40')][_0xe929('0xb6')]=_0x5e4013['id'];if(_0x2f2aaa[_0xe929('0x36')][_0xe929('0x7f')]){_0xd94149[_0xe929('0x40')]=_[_0xe929('0x97')](_0xd94149['where'],{'$or':_[_0xe929('0x32')](_0xd94149[_0xe929('0x3a')],function(_0x51ebda){var _0xdf7c8f={};_0xdf7c8f[_0x51ebda]={'$like':'%'+_0x2f2aaa[_0xe929('0x36')][_0xe929('0x7f')]+'%'};return _0xdf7c8f;})});}if(_0x2f2aaa['query'][_0xe929('0x74')]){var _0x3513f6=_0x2f2aaa['query'][_0xe929('0x74')][_0xe929('0x22')](',');var _0x1c3cac={};_0x1c3cac[_0x3513f6[0x0]]={'$gte':moment(_0x3513f6[0x1])[_0xe929('0xc8')]('YYYY-MM-DD\x20HH:mm:ss')};_0xd94149[_0xe929('0x40')]=_[_0xe929('0x97')](_0xd94149[_0xe929('0x40')],_0x1c3cac);}_0xd94149=_[_0xe929('0x97')]({},_0xd94149,_0x2f2aaa[_0xe929('0xbf')]);return db[_0xe929('0x26')][_0xe929('0x14')]({'where':_0xd94149[_0xe929('0x40')]})[_0xe929('0x19')](function(_0x1d2986){_0x4b6a5c[_0xe929('0x14')]=_0x1d2986;if(_0x2f2aaa['query'][_0xe929('0xbd')]){_0xd94149[_0xe929('0xbe')]=[{'all':!![]}];}return db[_0xe929('0x26')][_0xe929('0xc9')](_0xd94149);})[_0xe929('0x19')](function(_0x52a00e){if(_0x2f2aaa[_0xe929('0x36')][_0xe929('0xca')]==='true'){for(var _0x43ef30=0x0;_0x43ef30<_0x52a00e['length'];_0x43ef30++){_0x52a00e[_0x43ef30][_0xe929('0xc1')]=juice(_0x52a00e[_0x43ef30][_0xe929('0xc1')]);}}_0x4b6a5c[_0xe929('0xcb')]=_0x52a00e;return _0x4b6a5c;});}})[_0xe929('0x19')](respondWithFilteredResult(_0xb1eb4d,_0xd94149))['catch'](handleError(_0xb1eb4d,null));};exports[_0xe929('0xcc')]=function(_0x2a5029,_0x581f15){return db[_0xe929('0x33')]['find']({'where':{'id':_0x2a5029['params']['id']}})[_0xe929('0x19')](handleEntityNotFound(_0x581f15,null))[_0xe929('0x19')](function(_0x4b0f11){if(_0x4b0f11){return _0x4b0f11[_0xe929('0xcd')](_0x2a5029[_0xe929('0xc1')][_0xe929('0xc4')],_[_0xe929('0xc5')](_0x2a5029[_0xe929('0xc1')],[_0xe929('0xc4'),'id'])||{})['spread'](function(){return db['Tag']['findAll']({'attributes':['id',_0xe929('0x1e'),_0xe929('0xce')],'where':{'id':_0x2a5029[_0xe929('0xc1')]['ids']}});})[_0xe929('0x19')](function(_0xdcfa2a){socket[_0xe929('0xcf')](_0xe929('0xd0'),{'id':Number(_0x2a5029[_0xe929('0xbb')]['id']),'tags':_0xdcfa2a||[]});return{'id':Number(_0x2a5029[_0xe929('0xbb')]['id']),'tags':_0xdcfa2a||[]};});}})[_0xe929('0x19')](respondWithResult(_0x581f15,null))[_0xe929('0x2a')](handleError(_0x581f15,null));};exports[_0xe929('0xd1')]=function(_0x3d6ee4,_0x4b8245){return db[_0xe929('0x33')][_0xe929('0x5a')]({'where':{'id':_0x3d6ee4['params']['id']}})[_0xe929('0x19')](handleEntityNotFound(_0x4b8245,null))['then'](function(_0x2c061b){if(_0x2c061b){return _0x2c061b['removeTags'](_0x3d6ee4[_0xe929('0x36')][_0xe929('0xc4')]);}})[_0xe929('0x19')](respondWithStatusCode(_0x4b8245,null))[_0xe929('0x2a')](handleError(_0x4b8245,null));};exports['download']=function(_0x10f8d2,_0x34a8dc){var _0xfc838=moment()[_0xe929('0xd2')]()[_0xe929('0x94')]();var _0x5dcd14=path[_0xe929('0xd3')](config[_0xe929('0xd4')],'server','files',_0xe929('0xd5'));var _0x4a40fc=path[_0xe929('0xd3')](config[_0xe929('0xd4')],_0xe929('0xd6'),_0xe929('0xd7'),_0xe929('0xd8'));var _0x2762e9=path[_0xe929('0xd3')](_0x5dcd14,_0xfc838);var _0x1519dc=util[_0xe929('0xc8')](_0xe929('0xd9'),_0x10f8d2[_0xe929('0xbb')]['id'],_0xfc838);var _0x21dc42=path[_0xe929('0xd3')](_0x5dcd14,_0x1519dc);var _0x429a92=[];if(_0x10f8d2[_0xe929('0x36')][_0xe929('0xd8')]){_0x429a92[_0xe929('0x25')]({'model':db['Attachment'],'as':_0xe929('0xda'),'raw':!![]});}var _0x1c9b0c=[{'model':db[_0xe929('0x26')],'as':'Messages','attributes':['id',_0xe929('0xc1'),_0xe929('0x46'),'to','cc','bcc',_0xe929('0xdb'),'createdAt'],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x429a92}];return db[_0xe929('0x33')][_0xe929('0x5a')]({'where':{'id':_0x10f8d2[_0xe929('0xbb')]['id']},'include':_0x1c9b0c})['then'](handleEntityNotFound(_0x34a8dc,null))[_0xe929('0x19')](function(_0x3c15be){if(_0x3c15be&&_0x3c15be[_0xe929('0xdc')]){var _0x343ee5=_0x3c15be[_0xe929('0xdd')]({'plain':!![]});fs[_0xe929('0xde')](_0x2762e9);return BPromise[_0xe929('0xdf')](_0x343ee5[_0xe929('0xdc')],function(_0x41bb6e,_0x276e5d){var _0xf43b1a={'from':_0x41bb6e[_0xe929('0x46')],'to':_0x41bb6e['to'],'subject':_0x41bb6e[_0xe929('0xdb')],'html':htmlEntities[_0xe929('0xe0')](_0x41bb6e[_0xe929('0xc1')]),'headers':{'Date':moment(_0x41bb6e['createdAt'])[_0xe929('0xc8')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x41bb6e['cc']){_0xf43b1a[_0xe929('0xe1')]['Cc']=_0x41bb6e['cc'];}if(_0x41bb6e[_0xe929('0xe2')]){_0xf43b1a[_0xe929('0xe1')][_0xe929('0xe3')]=_0x41bb6e[_0xe929('0xe2')];}return new BPromise(function(_0x40b788,_0x45f713){if(_0x41bb6e[_0xe929('0xda')]){for(var _0x57dd8f=0x0;_0x57dd8f<_0x41bb6e[_0xe929('0xda')][_0xe929('0x3c')];_0x57dd8f++){var _0x19bb9d=_0x41bb6e[_0xe929('0xda')][_0x57dd8f];var _0x345eba=path[_0xe929('0xd3')](_0x4a40fc,_0x19bb9d[_0xe929('0xe4')]);if(fs[_0xe929('0xe5')](_0x345eba)){_0xf43b1a[_0xe929('0xd8')][_0xe929('0x25')]({'name':_0x19bb9d[_0xe929('0x1e')],'contentType':_0x19bb9d[_0xe929('0x68')],'data':fs['readFileSync'](_0x345eba)});}}}emlformat[_0xe929('0xe6')](_0xf43b1a,function(_0x4d2842,_0x1fd84c){if(_0x4d2842)return _0x45f713(_0x4d2842);fs[_0xe929('0xe7')](path[_0xe929('0xd3')](_0x2762e9,util[_0xe929('0xc8')](_0xe929('0xe8'),_0x276e5d)),_0x1fd84c);return _0x40b788(_0x1fd84c);});});})['then'](function(){return new BPromise(function(_0x5a927a,_0x3d5fb5){zipdir(_0x2762e9,{'saveTo':_0x21dc42},function(_0x485ece,_0x5f5255){if(_0x485ece)return _0x3d5fb5(_0x485ece);return _0x5a927a(_0x5f5255);});})[_0xe929('0x19')](function(){return new BPromise(function(_0x3f90c8,_0x10c523){rimraf(_0x2762e9,function(_0x15d8c9){if(_0x15d8c9)_0x10c523(_0x15d8c9);return _0x3f90c8();});});})[_0xe929('0x19')](function(){return _0x34a8dc[_0xe929('0xe9')](_0x21dc42,_0x1519dc,function(_0x6d1a10){if(!_0x6d1a10)fs[_0xe929('0xea')](_0x21dc42);});});});}else{return _0x34a8dc[_0xe929('0x10')](0xc8);}})[_0xe929('0x2a')](handleError(_0x34a8dc,null));}; \ No newline at end of file +var _0xbe85=['where','select','field','color','from','tools_tags','u.id','u.fullname','ui.MailInteractionId','user_has_mail_interactions','left_join','users','mail_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','Tag','split','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','some','isEmpty','MailAccountId','parse','$gte','$lte','null','\x20=\x20?','read','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','i.id\x20LIKE\x20?','isEmail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.id','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','t.id\x20IN\x20?','resolve','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','i.MailAccountId\x20IN\x20?','sequelize','toString','merge','MailInteraction','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.subject','i.disposition','i.secondDisposition','i.substatus','i.to','i.ContactId','i.MailAccountId','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','enableEmailPreview','all','show','params','keys','includeAll','include','options','create','body','addMessage','MailMessage','ids','pick','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','true','rows','addTags','setTags','spread','emit','mailInteractionTags:save','removeTags','download','unix','join','root','server','files','attachments','format','transcript-%d-%s.zip','Attachment','Attachments','Messages','bcc','subject','get','mkdirSync','each','decode','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','readFileSync','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','path','lodash','squel','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','end','status','json','offset','undefined','limit','count','set','update','then','destroy','sendStatus','error','stack','name','Users','map','fullname','TagIds','forEach','Tags','push','findOne','out','plainBody','lastMsgText','trimStart','catch','waiting','talking','answered','closed','UserId','unmanaged','total','index','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort'];(function(_0x268e0c,_0x1ef7d1){var _0x97a5fb=function(_0x58ccb2){while(--_0x58ccb2){_0x268e0c['push'](_0x268e0c['shift']());}};_0x97a5fb(++_0x1ef7d1);}(_0xbe85,0x197));var _0x5be8=function(_0x40443c,_0x14ce7c){_0x40443c=_0x40443c-0x0;var _0x15f59d=_0xbe85[_0x40443c];return _0x15f59d;};'use strict';var emlformat=require(_0x5be8('0x0'));var rimraf=require(_0x5be8('0x1'));var zipdir=require(_0x5be8('0x2'));var moment=require(_0x5be8('0x3'));var BPromise=require(_0x5be8('0x4'));var util=require('util');var path=require(_0x5be8('0x5'));var fs=require('fs');var _=require(_0x5be8('0x6'));var squel=require(_0x5be8('0x7'));var juice=require('juice');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var as=require(_0x5be8('0x8'));var logger=require(_0x5be8('0x9'))('api');var config=require(_0x5be8('0xa'));var db=require(_0x5be8('0xb'))['db'];var htmlEntities=require('html-entities');config['redis']=_['defaults'](config[_0x5be8('0xc')],{'host':_0x5be8('0xd'),'port':0x18eb});var socket=require(_0x5be8('0xe'))(new Redis(config[_0x5be8('0xc')]));require('./mailInteraction.socket')[_0x5be8('0xf')](socket);function respondWithStatusCode(_0x266104,_0x281b24){_0x281b24=_0x281b24||0xcc;return function(_0x536b68){if(_0x536b68){return _0x266104['sendStatus'](_0x281b24);}return _0x266104['status'](_0x281b24)[_0x5be8('0x10')]();};}function respondWithResult(_0x1799a0,_0x39497c){_0x39497c=_0x39497c||0xc8;return function(_0x20635f){if(_0x20635f){return _0x1799a0[_0x5be8('0x11')](_0x39497c)[_0x5be8('0x12')](_0x20635f);}};}function respondWithFilteredResult(_0x1deabd,_0x363620){return function(_0x5643f2){if(_0x5643f2){var _0x230210=typeof _0x363620[_0x5be8('0x13')]===_0x5be8('0x14')&&typeof _0x363620[_0x5be8('0x15')]===_0x5be8('0x14');var _0x2f00e9=_0x5643f2[_0x5be8('0x16')];var _0x39d023=_0x230210?0x0:_0x363620['offset'];var _0x42fbe8=_0x230210?_0x5643f2[_0x5be8('0x16')]:_0x363620['offset']+_0x363620[_0x5be8('0x15')];var _0x50506d;if(_0x42fbe8>=_0x2f00e9){_0x42fbe8=_0x2f00e9;_0x50506d=0xc8;}else{_0x50506d=0xce;}_0x1deabd[_0x5be8('0x11')](_0x50506d);return _0x1deabd[_0x5be8('0x17')]('Content-Range',_0x39d023+'-'+_0x42fbe8+'/'+_0x2f00e9)[_0x5be8('0x12')](_0x5643f2);}return null;};}function saveUpdates(_0x1da45b){return function(_0x9228c2){if(_0x9228c2){return _0x9228c2[_0x5be8('0x18')](_0x1da45b)[_0x5be8('0x19')](function(_0x3f8c46){return _0x3f8c46;});}return null;};}function removeEntity(_0x15431b){return function(_0x2c43b6){if(_0x2c43b6){return _0x2c43b6[_0x5be8('0x1a')]()[_0x5be8('0x19')](function(){_0x15431b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xd00eac){return function(_0x36157e){if(!_0x36157e){_0xd00eac[_0x5be8('0x1b')](0x194);}return _0x36157e;};}function handleError(_0x4f1286,_0x22e71e){_0x22e71e=_0x22e71e||0x1f4;return function(_0x3bfd9b){logger[_0x5be8('0x1c')](_0x3bfd9b[_0x5be8('0x1d')]);if(_0x3bfd9b[_0x5be8('0x1e')]){delete _0x3bfd9b[_0x5be8('0x1e')];}_0x4f1286[_0x5be8('0x11')](_0x22e71e)['send'](_0x3bfd9b);};}function getInteractionUsers(_0x3a7712,_0x121ed9){return new BPromise(function(_0x1fdccf,_0x31d455){try{if(_0x121ed9[_0x3a7712['id']]){_0x3a7712[_0x5be8('0x1f')]=_[_0x5be8('0x20')](_0x121ed9[_0x3a7712['id']],function(_0x4f7dbe){return{'id':_0x4f7dbe['id'],'fullname':_0x4f7dbe[_0x5be8('0x21')]};});}}catch(_0x258c59){_0x31d455(_0x258c59);}_0x1fdccf(_0x3a7712);});}function getInteractionTags(_0x2e3cb3,_0x38005a){return new BPromise(function(_0xc1b9f1,_0x231984){try{if(_0x2e3cb3[_0x5be8('0x22')]){_0x2e3cb3['Tags']=[];_0x2e3cb3[_0x5be8('0x22')]['split'](',')[_0x5be8('0x23')](function(_0x2f8a8f){_0x2e3cb3[_0x5be8('0x24')][_0x5be8('0x25')](_0x38005a[_0x2f8a8f]);});}delete _0x2e3cb3[_0x5be8('0x22')];}catch(_0x56f2fa){_0x231984(_0x56f2fa);}_0xc1b9f1(_0x2e3cb3);});}function getLastMessageText(_0x1b6121){return new BPromise(function(_0x262a6f,_0x558a74){return db['MailMessage'][_0x5be8('0x26')]({'where':{'$and':[{'MailInteractionId':_0x1b6121['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x5be8('0x27')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':'-id','raw':!![]})[_0x5be8('0x19')](function(_0x394b3c){if(_0x394b3c&&_0x394b3c[_0x5be8('0x28')]){_0x1b6121[_0x5be8('0x29')]=_[_0x5be8('0x2a')](_0x394b3c['plainBody']);}_0x262a6f(_0x1b6121);})['catch'](function(_0x440a68){_0x558a74(_0x440a68);});});}function updateMailInteraction(_0x709289,_0x3ecf04,_0x3267d1,_0x5b1082){return new BPromise(function(_0x520db7,_0x5ca677){return getInteractionUsers(_0x709289,_0x3267d1)[_0x5be8('0x19')](function(_0x4aae93){return getInteractionTags(_0x4aae93,_0x3ecf04);})['then'](function(_0x10d114){return getStateInteraction(_0x10d114);})['then'](function(_0x2d0db5){if(_0x5b1082){_0x520db7(getLastMessageText(_0x2d0db5));}else{_0x520db7(_0x2d0db5);}})[_0x5be8('0x2b')](function(_0x25b217){_0x5ca677(_0x25b217);});});}function getStateInteraction(_0x2e76ab){return new BPromise(function(_0xfd6b74){_0x2e76ab[_0x5be8('0x2c')]=0x0;_0x2e76ab[_0x5be8('0x2d')]=0x0;_0x2e76ab[_0x5be8('0x2e')]=0x0;_0x2e76ab['unmanaged']=0x0;_0x2e76ab['total']=0x0;if(!_0x2e76ab[_0x5be8('0x2f')]&&!_0x2e76ab[_0x5be8('0x30')]){_0x2e76ab[_0x5be8('0x2c')]+=0x1;}if(!_0x2e76ab[_0x5be8('0x2f')]&&_0x2e76ab[_0x5be8('0x30')]){_0x2e76ab['talking']+=0x1;if(_0x2e76ab[_0x5be8('0x2c')]){_0x2e76ab['waiting']-=0x1;}}if(_0x2e76ab[_0x5be8('0x2f')]&&_0x2e76ab['UserId']){_0x2e76ab[_0x5be8('0x2e')]+=0x1;if(_0x2e76ab[_0x5be8('0x2d')]){_0x2e76ab[_0x5be8('0x2d')]-=0x1;}}if(_0x2e76ab[_0x5be8('0x2f')]&&!_0x2e76ab[_0x5be8('0x30')]){_0x2e76ab[_0x5be8('0x31')]+=0x1;if(_0x2e76ab[_0x5be8('0x2c')]){_0x2e76ab['waiting']-=0x1;}}_0x2e76ab[_0x5be8('0x32')]+=0x1;_0xfd6b74(_0x2e76ab);});}exports[_0x5be8('0x33')]=function(_0x2ab07c,_0x12a2f0){var _0x466a85={},_0x388f45={},_0x2257e7={'count':0x0,'rows':[]};var _0x1f9ac7=_[_0x5be8('0x20')](db['MailInteraction'][_0x5be8('0x34')],function(_0x467862){return{'name':_0x467862[_0x5be8('0x35')],'type':_0x467862[_0x5be8('0x36')]['key']};});_0x388f45[_0x5be8('0x37')]=_[_0x5be8('0x20')](_0x1f9ac7,_0x5be8('0x1e'));_0x388f45[_0x5be8('0x38')]=_['keys'](_0x2ab07c[_0x5be8('0x38')]);_0x388f45[_0x5be8('0x39')]=_[_0x5be8('0x3a')](_0x388f45['model'],_0x388f45[_0x5be8('0x38')]);_0x466a85[_0x5be8('0x3b')]=_['intersection'](_0x388f45[_0x5be8('0x37')],qs['fields'](_0x2ab07c[_0x5be8('0x38')][_0x5be8('0x3c')]));_0x466a85[_0x5be8('0x3b')]=_0x466a85[_0x5be8('0x3b')][_0x5be8('0x3d')]?_0x466a85['attributes']:_0x388f45['model'];if(!_0x2ab07c[_0x5be8('0x38')][_0x5be8('0x3e')](_0x5be8('0x3f'))){_0x466a85[_0x5be8('0x15')]=qs[_0x5be8('0x15')](_0x2ab07c[_0x5be8('0x38')][_0x5be8('0x15')]);_0x466a85[_0x5be8('0x13')]=qs['offset'](_0x2ab07c[_0x5be8('0x38')]['offset']);}_0x466a85['order']=qs['sort'](_0x2ab07c[_0x5be8('0x38')][_0x5be8('0x40')]);_0x466a85[_0x5be8('0x41')]=qs[_0x5be8('0x39')](_['pick'](_0x2ab07c[_0x5be8('0x38')],_0x388f45[_0x5be8('0x39')]),_0x1f9ac7);var _0x19f31a=[];var _0x37abc8=squel[_0x5be8('0x42')]()['field']('id')[_0x5be8('0x43')](_0x5be8('0x1e'))[_0x5be8('0x43')](_0x5be8('0x44'))[_0x5be8('0x45')](_0x5be8('0x46'));var _0x1aef03=squel[_0x5be8('0x42')]()[_0x5be8('0x43')](_0x5be8('0x47'))['field'](_0x5be8('0x48'))['field'](_0x5be8('0x49'))['from'](_0x5be8('0x4a'),'ui')[_0x5be8('0x4b')](_0x5be8('0x4c'),'u','u.id\x20=\x20ui.UserId');var _0x1d1622=squel[_0x5be8('0x42')]()[_0x5be8('0x45')](_0x5be8('0x4d'),'i')[_0x5be8('0x4b')]('cm_contacts','c',_0x5be8('0x4e'))[_0x5be8('0x4b')]('users','o',_0x5be8('0x4f'))[_0x5be8('0x4b')]('mail_accounts','a','a.id\x20=\x20i.MailAccountId')[_0x5be8('0x4b')]('mail_messages','me',_0x5be8('0x50'))[_0x5be8('0x4b')](_0x5be8('0x51'),'it',_0x5be8('0x52'))[_0x5be8('0x4b')](_0x5be8('0x46'),'t',_0x5be8('0x53'));var _0x376a80=squel[_0x5be8('0x54')]();var _0x15f1e0=[];var _0x530ab4=squel[_0x5be8('0x54')]();var _0xa5c591;if(_0x2ab07c[_0x5be8('0x38')]['search']){_0xa5c591=as[_0x5be8('0x55')](_0x2ab07c[_0x5be8('0x38')]['search']);var _0x250da2=_0xa5c591[_0x5be8('0x56')];for(var _0x3cac8f=0x0;_0x3cac8f<_0xa5c591[_0x5be8('0x57')][_0x5be8('0x3d')];_0x3cac8f++){var _0x167f5b=_0xa5c591[_0x5be8('0x57')][_0x3cac8f];var _0x195184='i';var _0x12f528=_[_0x5be8('0x58')](_0x1f9ac7,[_0x5be8('0x1e'),_0x167f5b[_0x5be8('0x43')]]);if(!_0x12f528){switch(_0x167f5b[_0x5be8('0x43')]){case _0x5be8('0x59'):if(_0x167f5b[_0x5be8('0x5a')]==0x1){_0x1d1622['having']('`'+_0x167f5b[_0x5be8('0x43')]+'`\x20=\x200');}else{_0x1d1622[_0x5be8('0x5b')]('`'+_0x167f5b[_0x5be8('0x43')]+_0x5be8('0x5c'));}break;case _0x5be8('0x5d'):if(_0x167f5b[_0x5be8('0x5e')]===_0x5be8('0x5f')){if(_0x167f5b[_0x5be8('0x5a')]['split']('\x20')['length']>0x1){_0x376a80[_0x250da2](_0x5be8('0x60'),qs[_0x5be8('0x61')](_0x167f5b[_0x5be8('0x5a')]),null);}else{var _0x55063b='%'+_0x167f5b[_0x5be8('0x5a')]+'%';_0x376a80[_0x250da2](_0x5be8('0x62'),_0x55063b,_0x55063b,_0x55063b);}}else{_0x12f528=_[_0x5be8('0x58')](_0x1f9ac7,[_0x5be8('0x1e'),'ContactId']);_0x167f5b['field']=_0x5be8('0x63');_0x1833f0=as[_0x5be8('0x64')](_0x195184,_0x12f528['type'],_0x167f5b);_0x376a80[_0x250da2](_0x1833f0['text'],_0x1833f0['value'][_0x5be8('0x65')],_0x1833f0[_0x5be8('0x5a')][_0x5be8('0x10')]);}break;case _0x5be8('0x66'):var _0x245b21=_0x167f5b[_0x5be8('0x5a')][_0x5be8('0x67')](',')[_0x5be8('0x20')](function(_0x5c6b0){return Number(_0x5c6b0);});_0x245b21[_0x5be8('0x23')](function(_0x4c55aa){_0x530ab4['or'](_0x5be8('0x68'),'%,'+_0x4c55aa+',%');});_0x15f1e0=_[_0x5be8('0x69')](_0x15f1e0,_0x245b21);break;case _0x5be8('0x6a'):if(_0x167f5b[_0x5be8('0x5e')]===_0x5be8('0x5f')){_0x376a80[_0x250da2](_0x5be8('0x6b'),'%'+_0x167f5b[_0x5be8('0x5a')]+'%',null);}else{_0x12f528=_[_0x5be8('0x58')](_0x1f9ac7,[_0x5be8('0x1e'),'UserId']);_0x167f5b[_0x5be8('0x43')]=_0x5be8('0x30');_0x1833f0=as[_0x5be8('0x64')](_0x195184,_0x12f528[_0x5be8('0x36')],_0x167f5b);_0x376a80[_0x250da2](_0x1833f0[_0x5be8('0x6c')],_0x1833f0['value']['start'],_0x1833f0[_0x5be8('0x5a')][_0x5be8('0x10')]);}break;case _0x5be8('0x28'):_0x1833f0=as['buildExpression']('me',null,_0x167f5b);_0x376a80[_0x250da2](_0x1833f0[_0x5be8('0x6c')],_0x1833f0['value'][_0x5be8('0x65')],_0x1833f0[_0x5be8('0x5a')][_0x5be8('0x10')]);break;}}else{var _0x1833f0=as[_0x5be8('0x64')](_0x195184,_0x12f528[_0x5be8('0x36')],_0x167f5b);_0x376a80[_0x250da2](_0x1833f0[_0x5be8('0x6c')],_0x1833f0['value'][_0x5be8('0x65')],_0x1833f0['value']['end']);}}}else{var _0x3f3a03=_(_0x2ab07c['query'])['keys']()[_0x5be8('0x20')](function(_0x12d307){return _[_0x5be8('0x6d')](_0x1f9ac7,[_0x5be8('0x1e'),_0x12d307])?_0x12d307:undefined;})['compact']()[_0x5be8('0x5a')]();if(!_[_0x5be8('0x6e')](_0x3f3a03)){_0x3f3a03[_0x5be8('0x23')](function(_0x373510){if(_0x373510===_0x5be8('0x6f')){_0x1d1622[_0x5be8('0x41')]('i.MailAccountId\x20IN\x20?',[]['concat'](_0x2ab07c['query'][_0x373510]));}else if(_0x373510==='createdAt'){var _0x448701=JSON[_0x5be8('0x70')](_0x2ab07c['query'][_0x373510])[_0x5be8('0x71')];var _0x4e141e=JSON[_0x5be8('0x70')](_0x2ab07c[_0x5be8('0x38')][_0x373510])[_0x5be8('0x72')];_0x1d1622['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x448701,_0x4e141e);}else{if(_0x2ab07c[_0x5be8('0x38')][_0x373510]===_0x5be8('0x73')){_0x1d1622[_0x5be8('0x41')]('i.'+_0x373510+'\x20IS\x20NULL');}else{_0x1d1622[_0x5be8('0x41')]('i.'+_0x373510+_0x5be8('0x74'),_0x2ab07c[_0x5be8('0x38')][_0x373510]);}}});}if(_0x2ab07c[_0x5be8('0x38')][_0x5be8('0x75')]){if(_0x2ab07c['query']['read']==0x1){_0x1d1622[_0x5be8('0x5b')]('`unreadMessages`\x20=\x200');}else{_0x1d1622['having'](_0x5be8('0x76'));}}if(_0x2ab07c[_0x5be8('0x38')]['tag']){_0x15f1e0=_[_0x5be8('0x77')](_0x2ab07c[_0x5be8('0x38')][_0x5be8('0x78')])?_0x2ab07c[_0x5be8('0x38')][_0x5be8('0x78')]:new Array(_0x2ab07c['query'][_0x5be8('0x78')]);_0x15f1e0[_0x5be8('0x23')](function(_0x3ca806){_0x530ab4['or'](_0x5be8('0x68'),'%,'+_0x3ca806+',%');});}if(_0x2ab07c[_0x5be8('0x38')][_0x5be8('0x79')]){var _0x45b8b6=_0x2ab07c[_0x5be8('0x38')][_0x5be8('0x79')][_0x5be8('0x7a')]('\x5c','\x5c\x5c')[_0x5be8('0x7a')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x45b8b6)){_0x376a80['or'](_0x5be8('0x7b'),_0x45b8b6+'%');}else if(qs[_0x5be8('0x7c')](_0x45b8b6)){_0x376a80['or']('c.email\x20LIKE\x20?',_0x45b8b6+'%');}else{_0x376a80['or'](_0x5be8('0x7d'),qs[_0x5be8('0x61')](_0x45b8b6))['or'](_0x5be8('0x7e'),qs['getFullTextValue'](_0x45b8b6));}}}_0x1d1622[_0x5be8('0x41')](_0x376a80);_0x1d1622['group'](_0x5be8('0x7f'));var _0x33632b={'type':db['Sequelize']['QueryTypes'][_0x5be8('0x80')],'raw':!![]};var _0x5f8094=_0x1d1622[_0x5be8('0x81')]();_0x5f8094[_0x5be8('0x43')]('i.id');_0x5f8094[_0x5be8('0x43')](_0x5be8('0x82'),_0x5be8('0x59'));if(_0x466a85[_0x5be8('0x83')]){_0x466a85[_0x5be8('0x83')][_0x5be8('0x23')](function(_0x47dfa4){var _0x4d0201=_0x47dfa4[0x0]===_0x5be8('0x84')?_0x47dfa4[0x0]:'i.'+_0x47dfa4[0x0];_0x1d1622[_0x5be8('0x83')](_0x4d0201,_0x47dfa4[0x1]===_0x5be8('0x85')?![]:!![]);});}if(!_[_0x5be8('0x6e')](_0x15f1e0)){_0x1d1622['having'](_0x530ab4);_0x5f8094[_0x5be8('0x41')](_0x5be8('0x86'),_0x15f1e0);}BPromise[_0x5be8('0x87')]()[_0x5be8('0x19')](function(){if(!_0xa5c591){if(_0x2ab07c[_0x5be8('0x38')][_0x5be8('0x6f')])return;_0x5f8094[_0x5be8('0x41')]('i.MailAccountId\x20IS\x20NOT\x20NULL');_0x1d1622['where']('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x2ab07c[_0x5be8('0x88')][_0x5be8('0x89')]!==_0x5be8('0x8a'))return;return _0x2ab07c[_0x5be8('0x88')][_0x5be8('0x8b')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3ec32e){if(_[_0x5be8('0x6e')](_0x3ec32e)){_0x5f8094[_0x5be8('0x41')](_0x5be8('0x8c'));_0x1d1622[_0x5be8('0x41')](_0x5be8('0x8c'));}else{_0x5f8094[_0x5be8('0x41')]('i.MailAccountId\x20IN\x20?',_[_0x5be8('0x20')](_0x3ec32e,'id'));_0x1d1622[_0x5be8('0x41')](_0x5be8('0x8d'),_['map'](_0x3ec32e,'id'));}});})['then'](function(){if(_0x2ab07c[_0x5be8('0x88')][_0x5be8('0x89')]===_0x5be8('0x8a')&&!_0xa5c591&&!_0x2ab07c['query'][_0x5be8('0x6f')])return[];return db[_0x5be8('0x8e')][_0x5be8('0x38')](_0x5f8094[_0x5be8('0x8f')](),_0x33632b);})[_0x5be8('0x19')](function(_0x3693b0){_0x2257e7[_0x5be8('0x16')]=_0x3693b0[_0x5be8('0x3d')];if(_0x2257e7['count']===0x0)return[];return db['sequelize'][_0x5be8('0x38')](_0x37abc8['toString'](),_0x33632b)[_0x5be8('0x19')](function(_0x23ccb3){_0x19f31a=_['keyBy'](_0x23ccb3,'id');_0x33632b=_[_0x5be8('0x90')](_0x33632b,{'model':db[_0x5be8('0x91')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2ab07c[_0x5be8('0x38')][_0x5be8('0x3c')]){_0x466a85[_0x5be8('0x3b')]['forEach'](function(_0xf93b24){_0x1d1622[_0x5be8('0x43')]('i.'+_0xf93b24);});}else{_0x1d1622[_0x5be8('0x43')](_0x5be8('0x82'),_0x5be8('0x59'));_0x1d1622[_0x5be8('0x43')](_0x5be8('0x92'),_0x5be8('0x93'));_0x1d1622[_0x5be8('0x43')](_0x5be8('0x94'),_0x5be8('0x95'));_0x1d1622['field'](_0x5be8('0x96'),'contactName');_0x1d1622[_0x5be8('0x43')]('i.id');_0x1d1622[_0x5be8('0x43')](_0x5be8('0x97'));_0x1d1622[_0x5be8('0x43')](_0x5be8('0x98'));_0x1d1622['field'](_0x5be8('0x99'));_0x1d1622[_0x5be8('0x43')](_0x5be8('0x9a'));_0x1d1622['field'](_0x5be8('0x9b'));_0x1d1622[_0x5be8('0x43')](_0x5be8('0x9c'));_0x1d1622[_0x5be8('0x43')]('i.lastMsgDirection');_0x1d1622[_0x5be8('0x43')](_0x5be8('0x9d'));_0x1d1622[_0x5be8('0x43')](_0x5be8('0x9e'));_0x1d1622[_0x5be8('0x43')](_0x5be8('0x9f'));_0x1d1622[_0x5be8('0x43')]('i.thirdDisposition');_0x1d1622[_0x5be8('0x43')](_0x5be8('0xa0'));_0x1d1622[_0x5be8('0x43')](_0x5be8('0xa1'));_0x1d1622[_0x5be8('0x43')](_0x5be8('0xa2'));_0x1d1622['field'](_0x5be8('0xa3'));_0x1d1622[_0x5be8('0x43')]('i.UserId');_0x1d1622[_0x5be8('0x43')](_0x5be8('0xa4'),'Contact.firstName');_0x1d1622[_0x5be8('0x43')](_0x5be8('0xa5'),_0x5be8('0xa6'));_0x1d1622[_0x5be8('0x43')](_0x5be8('0xa7'),_0x5be8('0xa8'));_0x1d1622[_0x5be8('0x43')](_0x5be8('0xa9'),_0x5be8('0xaa'));_0x1d1622[_0x5be8('0x43')](_0x5be8('0xab'),_0x5be8('0xac'));_0x1d1622['field'](_0x5be8('0xad'),_0x5be8('0xae'));_0x1d1622[_0x5be8('0x43')](_0x5be8('0xaf'),_0x5be8('0xb0'));_0x1d1622['field'](_0x5be8('0xb1'),_0x5be8('0xb2'));_0x1d1622[_0x5be8('0x43')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x5be8('0x22'));}if(_0x466a85[_0x5be8('0x15')])_0x1d1622[_0x5be8('0x15')](_0x466a85[_0x5be8('0x15')]);if(_0x466a85[_0x5be8('0x13')])_0x1d1622['offset'](_0x466a85['offset']);return db['sequelize'][_0x5be8('0x38')](_0x1d1622[_0x5be8('0x8f')](),_0x33632b);})['then'](function(_0x50caff){if(_0x50caff[_0x5be8('0x3d')]>0x0)_0x1aef03[_0x5be8('0x41')](_0x5be8('0xb3'),_[_0x5be8('0x20')](_0x50caff,'id'));return db[_0x5be8('0x8e')][_0x5be8('0x38')](_0x1aef03[_0x5be8('0x8f')](),_0x33632b)[_0x5be8('0x19')](function(_0x5dfa9d){var _0x29ee5c=_[_0x5be8('0xb4')](_0x5dfa9d,_0x5be8('0xb5'));var _0xbc74f1=[];return db[_0x5be8('0xb6')]['findOne']({'attributes':[_0x5be8('0xb7')],'raw':!![]})[_0x5be8('0x19')](function(_0x3fd77b){var _0x3bfb9c=_0x3fd77b[_0x5be8('0xb7')];_0x50caff['forEach'](function(_0x57cb26){_0xbc74f1['push'](updateMailInteraction(_0x57cb26,_0x19f31a,_0x29ee5c,_0x3bfb9c));});return BPromise[_0x5be8('0xb8')](_0xbc74f1);});});});})['then'](function(_0x2cb38e){_0x2257e7['rows']=_0x2cb38e;return _0x2257e7;})['then'](respondWithFilteredResult(_0x12a2f0,_0x466a85))[_0x5be8('0x2b')](handleError(_0x12a2f0,null));};exports[_0x5be8('0xb9')]=function(_0x558a0b,_0xa5c764){var _0x3e525a={'raw':![],'where':{'id':_0x558a0b[_0x5be8('0xba')]['id']}},_0x51d553={};_0x51d553[_0x5be8('0x37')]=_[_0x5be8('0xbb')](db[_0x5be8('0x91')][_0x5be8('0x34')]);_0x51d553['query']=_['keys'](_0x558a0b[_0x5be8('0x38')]);_0x51d553[_0x5be8('0x39')]=_[_0x5be8('0x3a')](_0x51d553[_0x5be8('0x37')],_0x51d553['query']);_0x3e525a['attributes']=_['intersection'](_0x51d553[_0x5be8('0x37')],qs['fields'](_0x558a0b[_0x5be8('0x38')][_0x5be8('0x3c')]));_0x3e525a[_0x5be8('0x3b')]=_0x3e525a[_0x5be8('0x3b')][_0x5be8('0x3d')]?_0x3e525a['attributes']:_0x51d553[_0x5be8('0x37')];if(_0x558a0b[_0x5be8('0x38')][_0x5be8('0xbc')]){_0x3e525a[_0x5be8('0xbd')]=[{'all':!![]}];}_0x3e525a=_[_0x5be8('0x90')]({},_0x3e525a,_0x558a0b[_0x5be8('0xbe')]);return db[_0x5be8('0x91')][_0x5be8('0x58')](_0x3e525a)['then'](handleEntityNotFound(_0xa5c764,null))['then'](respondWithResult(_0xa5c764,null))[_0x5be8('0x2b')](handleError(_0xa5c764,null));};exports[_0x5be8('0xbf')]=function(_0x48958a,_0x23bcd9){return db[_0x5be8('0x91')][_0x5be8('0xbf')](_0x48958a[_0x5be8('0xc0')],{})[_0x5be8('0x19')](respondWithResult(_0x23bcd9,0xc9))[_0x5be8('0x2b')](handleError(_0x23bcd9,null));};exports[_0x5be8('0x18')]=function(_0x4c5015,_0x297443){if(_0x4c5015[_0x5be8('0xc0')]['id']){delete _0x4c5015[_0x5be8('0xc0')]['id'];}return db[_0x5be8('0x91')][_0x5be8('0x58')]({'where':{'id':_0x4c5015[_0x5be8('0xba')]['id']}})['then'](handleEntityNotFound(_0x297443,null))[_0x5be8('0x19')](saveUpdates(_0x4c5015[_0x5be8('0xc0')],null))[_0x5be8('0x19')](respondWithResult(_0x297443,null))['catch'](handleError(_0x297443,null));};exports[_0x5be8('0x1a')]=function(_0x3ce1d9,_0x230128){return db[_0x5be8('0x91')]['find']({'where':{'id':_0x3ce1d9[_0x5be8('0xba')]['id']}})[_0x5be8('0x19')](handleEntityNotFound(_0x230128,null))['then'](removeEntity(_0x230128,null))['catch'](handleError(_0x230128,null));};exports['describe']=function(_0x5cba64,_0x203cc5){return db[_0x5be8('0x91')]['describe']()[_0x5be8('0x19')](respondWithResult(_0x203cc5,null))['catch'](handleError(_0x203cc5,null));};exports[_0x5be8('0xc1')]=function(_0x41c350,_0x21168f){return db[_0x5be8('0xc2')]['find']({'where':{'id':_0x41c350[_0x5be8('0xba')]['id']}})[_0x5be8('0x19')](handleEntityNotFound(_0x21168f,null))[_0x5be8('0x19')](function(_0x196b59){if(_0x196b59){return _0x196b59['addMessage'](_0x41c350[_0x5be8('0xc0')][_0x5be8('0xc3')],_['omit'](_0x41c350[_0x5be8('0xc0')],['ids','id'])||{});}})[_0x5be8('0x19')](respondWithResult(_0x21168f,null))['catch'](handleError(_0x21168f,null));};exports['getMessages']=function(_0x5e5eb6,_0x2ba20b){var _0x42d8a2={'raw':![],'where':{}};var _0x551d1b={};var _0x1db14a={'count':0x0,'rows':[]};return db[_0x5be8('0x91')][_0x5be8('0x26')]({'where':{'id':_0x5e5eb6[_0x5be8('0xba')]['id']}})[_0x5be8('0x19')](handleEntityNotFound(_0x2ba20b,null))[_0x5be8('0x19')](function(_0x48c2bf){if(_0x48c2bf){_0x551d1b[_0x5be8('0x37')]=_[_0x5be8('0xbb')](db[_0x5be8('0xc2')]['rawAttributes']);_0x551d1b[_0x5be8('0x38')]=_[_0x5be8('0xbb')](_0x5e5eb6['query']);_0x551d1b[_0x5be8('0x39')]=_[_0x5be8('0x3a')](_0x551d1b[_0x5be8('0x37')],_0x551d1b[_0x5be8('0x38')]);_0x42d8a2['attributes']=_[_0x5be8('0x3a')](_0x551d1b[_0x5be8('0x37')],qs['fields'](_0x5e5eb6[_0x5be8('0x38')]['fields']));_0x42d8a2[_0x5be8('0x3b')]=_0x42d8a2[_0x5be8('0x3b')][_0x5be8('0x3d')]?_0x42d8a2['attributes']:_0x551d1b[_0x5be8('0x37')];if(!_0x5e5eb6[_0x5be8('0x38')]['hasOwnProperty'](_0x5be8('0x3f'))){_0x42d8a2[_0x5be8('0x15')]=qs[_0x5be8('0x15')](_0x5e5eb6[_0x5be8('0x38')][_0x5be8('0x15')]);_0x42d8a2[_0x5be8('0x13')]=qs['offset'](_0x5e5eb6['query'][_0x5be8('0x13')]);}_0x42d8a2[_0x5be8('0x83')]=qs[_0x5be8('0x40')](_0x5e5eb6[_0x5be8('0x38')][_0x5be8('0x40')]);_0x42d8a2[_0x5be8('0x41')]=qs[_0x5be8('0x39')](_[_0x5be8('0xc4')](_0x5e5eb6[_0x5be8('0x38')],_0x551d1b[_0x5be8('0x39')]));_0x42d8a2[_0x5be8('0x41')][_0x5be8('0xb5')]=_0x48c2bf['id'];if(_0x5e5eb6[_0x5be8('0x38')][_0x5be8('0x79')]){_0x42d8a2[_0x5be8('0x41')]=_[_0x5be8('0x90')](_0x42d8a2['where'],{'$or':_[_0x5be8('0x20')](_0x42d8a2[_0x5be8('0x3b')],function(_0x312250){var _0x401a37={};_0x401a37[_0x312250]={'$like':'%'+_0x5e5eb6[_0x5be8('0x38')]['filter']+'%'};return _0x401a37;})});}if(_0x5e5eb6[_0x5be8('0x38')][_0x5be8('0x71')]){var _0x487603=_0x5e5eb6[_0x5be8('0x38')][_0x5be8('0x71')][_0x5be8('0x67')](',');var _0x28c8b6={};_0x28c8b6[_0x487603[0x0]]={'$gte':moment(_0x487603[0x1])['format'](_0x5be8('0xc5'))};_0x42d8a2['where']=_[_0x5be8('0x90')](_0x42d8a2[_0x5be8('0x41')],_0x28c8b6);}_0x42d8a2=_[_0x5be8('0x90')]({},_0x42d8a2,_0x5e5eb6['options']);return db['MailMessage'][_0x5be8('0x16')]({'where':_0x42d8a2[_0x5be8('0x41')]})[_0x5be8('0x19')](function(_0x19a6d0){_0x1db14a[_0x5be8('0x16')]=_0x19a6d0;if(_0x5e5eb6[_0x5be8('0x38')][_0x5be8('0xbc')]){_0x42d8a2['include']=[{'all':!![]}];}return db[_0x5be8('0xc2')][_0x5be8('0xc6')](_0x42d8a2);})[_0x5be8('0x19')](function(_0x3d08f3){if(_0x5e5eb6['query'][_0x5be8('0xc7')]===_0x5be8('0xc8')){for(var _0x4c21ef=0x0;_0x4c21ef<_0x3d08f3[_0x5be8('0x3d')];_0x4c21ef++){_0x3d08f3[_0x4c21ef][_0x5be8('0xc0')]=juice(_0x3d08f3[_0x4c21ef][_0x5be8('0xc0')]);}}_0x1db14a[_0x5be8('0xc9')]=_0x3d08f3;return _0x1db14a;});}})['then'](respondWithFilteredResult(_0x2ba20b,_0x42d8a2))[_0x5be8('0x2b')](handleError(_0x2ba20b,null));};exports[_0x5be8('0xca')]=function(_0x445ccb,_0x5219a1){return db[_0x5be8('0x91')][_0x5be8('0x58')]({'where':{'id':_0x445ccb[_0x5be8('0xba')]['id']}})[_0x5be8('0x19')](handleEntityNotFound(_0x5219a1,null))[_0x5be8('0x19')](function(_0xc623f2){if(_0xc623f2){return _0xc623f2[_0x5be8('0xcb')](_0x445ccb[_0x5be8('0xc0')][_0x5be8('0xc3')],_['omit'](_0x445ccb[_0x5be8('0xc0')],[_0x5be8('0xc3'),'id'])||{})[_0x5be8('0xcc')](function(){return db[_0x5be8('0x66')][_0x5be8('0xc6')]({'attributes':['id',_0x5be8('0x1e'),_0x5be8('0x44')],'where':{'id':_0x445ccb['body']['ids']}});})[_0x5be8('0x19')](function(_0x5a8871){socket[_0x5be8('0xcd')](_0x5be8('0xce'),{'id':Number(_0x445ccb[_0x5be8('0xba')]['id']),'tags':_0x5a8871||[]});return{'id':Number(_0x445ccb[_0x5be8('0xba')]['id']),'tags':_0x5a8871||[]};});}})['then'](respondWithResult(_0x5219a1,null))[_0x5be8('0x2b')](handleError(_0x5219a1,null));};exports['removeTags']=function(_0x1f6738,_0x3ab40b){return db[_0x5be8('0x91')][_0x5be8('0x58')]({'where':{'id':_0x1f6738['params']['id']}})[_0x5be8('0x19')](handleEntityNotFound(_0x3ab40b,null))['then'](function(_0x5287e9){if(_0x5287e9){return _0x5287e9[_0x5be8('0xcf')](_0x1f6738[_0x5be8('0x38')][_0x5be8('0xc3')]);}})[_0x5be8('0x19')](respondWithStatusCode(_0x3ab40b,null))[_0x5be8('0x2b')](handleError(_0x3ab40b,null));};exports[_0x5be8('0xd0')]=function(_0x385097,_0xe17932){var _0x25b312=moment()[_0x5be8('0xd1')]()[_0x5be8('0x8f')]();var _0xbee289=path[_0x5be8('0xd2')](config[_0x5be8('0xd3')],_0x5be8('0xd4'),_0x5be8('0xd5'),'tmp');var _0x26f6d4=path['join'](config[_0x5be8('0xd3')],'server',_0x5be8('0xd5'),_0x5be8('0xd6'));var _0x1c6acb=path['join'](_0xbee289,_0x25b312);var _0x308e6=util[_0x5be8('0xd7')](_0x5be8('0xd8'),_0x385097[_0x5be8('0xba')]['id'],_0x25b312);var _0x59d341=path[_0x5be8('0xd2')](_0xbee289,_0x308e6);var _0x25b06b=[];if(_0x385097['query'][_0x5be8('0xd6')]){_0x25b06b[_0x5be8('0x25')]({'model':db[_0x5be8('0xd9')],'as':_0x5be8('0xda'),'raw':!![]});}var _0x29a4b3=[{'model':db[_0x5be8('0xc2')],'as':_0x5be8('0xdb'),'attributes':['id',_0x5be8('0xc0'),_0x5be8('0x45'),'to','cc',_0x5be8('0xdc'),_0x5be8('0xdd'),'createdAt'],'where':{'secret':![]},'order':qs[_0x5be8('0x40')]('id'),'include':_0x25b06b}];return db['MailInteraction'][_0x5be8('0x58')]({'where':{'id':_0x385097[_0x5be8('0xba')]['id']},'include':_0x29a4b3})[_0x5be8('0x19')](handleEntityNotFound(_0xe17932,null))[_0x5be8('0x19')](function(_0x4c7e58){if(_0x4c7e58&&_0x4c7e58['Messages']){var _0x2f2d40=_0x4c7e58[_0x5be8('0xde')]({'plain':!![]});fs[_0x5be8('0xdf')](_0x1c6acb);return BPromise[_0x5be8('0xe0')](_0x2f2d40[_0x5be8('0xdb')],function(_0x12c6af,_0x5aef86){var _0xc04f9c={'from':_0x12c6af[_0x5be8('0x45')],'to':_0x12c6af['to'],'subject':_0x12c6af[_0x5be8('0xdd')],'html':htmlEntities[_0x5be8('0xe1')](_0x12c6af[_0x5be8('0xc0')]),'headers':{'Date':moment(_0x12c6af[_0x5be8('0xe2')])['format'](_0x5be8('0xe3'))},'attachments':[]};if(_0x12c6af['cc']){_0xc04f9c[_0x5be8('0xe4')]['Cc']=_0x12c6af['cc'];}if(_0x12c6af[_0x5be8('0xdc')]){_0xc04f9c['headers'][_0x5be8('0xe5')]=_0x12c6af[_0x5be8('0xdc')];}return new BPromise(function(_0x11fa4b,_0x19df74){if(_0x12c6af[_0x5be8('0xda')]){for(var _0x490ad6=0x0;_0x490ad6<_0x12c6af[_0x5be8('0xda')]['length'];_0x490ad6++){var _0x3f63cc=_0x12c6af[_0x5be8('0xda')][_0x490ad6];var _0x16c5d5=path['join'](_0x26f6d4,_0x3f63cc[_0x5be8('0xe6')]);if(fs[_0x5be8('0xe7')](_0x16c5d5)){_0xc04f9c[_0x5be8('0xd6')][_0x5be8('0x25')]({'name':_0x3f63cc[_0x5be8('0x1e')],'contentType':_0x3f63cc['type'],'data':fs[_0x5be8('0xe8')](_0x16c5d5)});}}}emlformat['build'](_0xc04f9c,function(_0x575caf,_0x3525c0){if(_0x575caf)return _0x19df74(_0x575caf);fs[_0x5be8('0xe9')](path[_0x5be8('0xd2')](_0x1c6acb,util[_0x5be8('0xd7')](_0x5be8('0xea'),_0x5aef86)),_0x3525c0);return _0x11fa4b(_0x3525c0);});});})[_0x5be8('0x19')](function(){return new BPromise(function(_0x2cb61a,_0x4eb987){zipdir(_0x1c6acb,{'saveTo':_0x59d341},function(_0x9c9a3c,_0x5e540a){if(_0x9c9a3c)return _0x4eb987(_0x9c9a3c);return _0x2cb61a(_0x5e540a);});})['then'](function(){return new BPromise(function(_0x5ef69f,_0x13a092){rimraf(_0x1c6acb,function(_0x508591){if(_0x508591)_0x13a092(_0x508591);return _0x5ef69f();});});})[_0x5be8('0x19')](function(){return _0xe17932[_0x5be8('0xd0')](_0x59d341,_0x308e6,function(_0x2433e0){if(!_0x2433e0)fs[_0x5be8('0xeb')](_0x59d341);});});});}else{return _0xe17932[_0x5be8('0x1b')](0xc8);}})['catch'](handleError(_0xe17932,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index d14bfbb..c8367a6 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 _0x22f8=['setDataValue','unreadMessages','length','catch','hasOwnProperty','exports','events','../../mysqldb','MailMessage','setMaxListeners','save','update','remove','getUsers','then','Users','map'];(function(_0x7ce8,_0x1e4919){var _0x3fd933=function(_0x1f161c){while(--_0x1f161c){_0x7ce8['push'](_0x7ce8['shift']());}};_0x3fd933(++_0x1e4919);}(_0x22f8,0x105));var _0x822f=function(_0x25ada9,_0x5f0e07){_0x25ada9=_0x25ada9-0x0;var _0x59e1ab=_0x22f8[_0x25ada9];return _0x59e1ab;};'use strict';var EventEmitter=require(_0x822f('0x0'));var MailInteraction=require(_0x822f('0x1'))['db']['MailInteraction'];var MailMessage=require(_0x822f('0x1'))['db'][_0x822f('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x822f('0x3')](0x0);var events={'afterCreate':_0x822f('0x4'),'afterUpdate':_0x822f('0x5'),'afterDestroy':_0x822f('0x6')};function emitEvent(_0x470164){return function(_0x583de4,_0x4eaeb6,_0x175c9a){_0x583de4[_0x822f('0x7')]({'attributes':['id'],'raw':!![]})[_0x822f('0x8')](function(_0x33b52e){_0x583de4['setDataValue'](_0x822f('0x9'),_0x33b52e[_0x822f('0xa')](function(_0x3ddeb6){return{'id':_0x3ddeb6['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x583de4['id'],'direction':'in','read':![]},'raw':!![]});})[_0x822f('0x8')](function(_0x570d82){_0x583de4[_0x822f('0xb')](_0x822f('0xc'),_0x570d82[_0x822f('0xd')]);MailInteractionEvents['emit'](_0x470164+':'+_0x583de4['id'],_0x583de4);MailInteractionEvents['emit'](_0x470164,_0x583de4);_0x175c9a(null);})[_0x822f('0xe')](_0x175c9a(null));};}for(var e in events){if(events[_0x822f('0xf')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0x822f('0x10')]=MailInteractionEvents; \ No newline at end of file +var _0x8892=['update','remove','then','setDataValue','Users','findAll','unreadMessages','length','emit','hasOwnProperty','exports','events','../../mysqldb','MailMessage','save'];(function(_0xf427d2,_0x3e2721){var _0x352990=function(_0x3b1aef){while(--_0x3b1aef){_0xf427d2['push'](_0xf427d2['shift']());}};_0x352990(++_0x3e2721);}(_0x8892,0xce));var _0x2889=function(_0x56c9aa,_0xfa2960){_0x56c9aa=_0x56c9aa-0x0;var _0x212157=_0x8892[_0x56c9aa];return _0x212157;};'use strict';var EventEmitter=require(_0x2889('0x0'));var MailInteraction=require(_0x2889('0x1'))['db']['MailInteraction'];var MailMessage=require(_0x2889('0x1'))['db'][_0x2889('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2889('0x3'),'afterUpdate':_0x2889('0x4'),'afterDestroy':_0x2889('0x5')};function emitEvent(_0x53e71f){return function(_0x2dd3dd,_0x3a2995,_0x3b36fe){_0x2dd3dd['getUsers']({'attributes':['id'],'raw':!![]})[_0x2889('0x6')](function(_0x517b1d){_0x2dd3dd[_0x2889('0x7')](_0x2889('0x8'),_0x517b1d['map'](function(_0x7399dc){return{'id':_0x7399dc['id']};}));return MailMessage[_0x2889('0x9')]({'where':{'MailInteractionId':_0x2dd3dd['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2889('0x6')](function(_0x57b3ea){_0x2dd3dd[_0x2889('0x7')](_0x2889('0xa'),_0x57b3ea[_0x2889('0xb')]);MailInteractionEvents[_0x2889('0xc')](_0x53e71f+':'+_0x2dd3dd['id'],_0x2dd3dd);MailInteractionEvents['emit'](_0x53e71f,_0x2dd3dd);_0x3b36fe(null);})['catch'](_0x3b36fe(null));};}for(var e in events){if(events[_0x2889('0xd')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0x2889('0xe')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 2468440..ea59bfc 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 _0x626d=['rimraf','exports','define','mail_interactions','fti_mail_interactions','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','get','MailMessage','update','then','catch','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','path'];(function(_0x4fd109,_0x33c503){var _0x30f0a6=function(_0xc11c0d){while(--_0xc11c0d){_0x4fd109['push'](_0x4fd109['shift']());}};_0x30f0a6(++_0x33c503);}(_0x626d,0x1ee));var _0xd626=function(_0x3f70b3,_0x253172){_0x3f70b3=_0x3f70b3-0x0;var _0x4f1f69=_0x626d[_0x3f70b3];return _0x4f1f69;};'use strict';var _=require(_0xd626('0x0'));var util=require(_0xd626('0x1'));var logger=require('../../config/logger')(_0xd626('0x2'));var moment=require('moment');var BPromise=require(_0xd626('0x3'));var rp=require(_0xd626('0x4'));var fs=require('fs');var path=require(_0xd626('0x5'));var rimraf=require(_0xd626('0x6'));var config=require('../../config/environment');var attributes=require('./mailInteraction.attributes');module[_0xd626('0x7')]=function(_0x4bae3c,_0x407033){return _0x4bae3c[_0xd626('0x8')]('MailInteraction',attributes,{'tableName':_0xd626('0x9'),'paranoid':![],'indexes':[{'name':_0xd626('0xa'),'fields':['subject','to'],'type':_0xd626('0xb')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x42df29,_0x575329,_0x227dde){if(_0x42df29[_0xd626('0xc')]){_0x42df29[_0xd626('0xd')]=moment()[_0xd626('0xe')](_0xd626('0xf'));}if(_0x42df29[_0xd626('0x10')]){_0x42df29[_0xd626('0x11')]=moment()[_0xd626('0xe')](_0xd626('0xf'));}_0x227dde(null,_0x575329);},'beforeUpdate':function(_0x8b1350,_0x1362c8,_0x491e81){if(_0x8b1350['changed'](_0xd626('0xc'))){_0x8b1350[_0xd626('0xd')]=_0x8b1350[_0xd626('0xc')]?moment()[_0xd626('0xe')](_0xd626('0xf')):null;}if(_0x8b1350[_0xd626('0x12')](_0xd626('0x10'))){_0x8b1350[_0xd626('0x11')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x8b1350['substatus']=null;_0x8b1350[_0xd626('0xd')]=null;}_0x491e81(null,_0x8b1350);},'afterUpdate':function(_0x34558c,_0x8242e3,_0x47da38){var _0x1f4157=_0x4bae3c['models'];var _0x41b651=_0x34558c[_0xd626('0x13')]({'plain':!![]});if(_0x41b651[_0xd626('0x10')]){return _0x1f4157[_0xd626('0x14')][_0xd626('0x15')]({'read':!![]},{'where':{'MailInteractionId':_0x41b651['id']}})[_0xd626('0x16')](function(){_0x47da38();})[_0xd626('0x17')](function(_0x1c6a2e){_0x47da38(_0x1c6a2e);});}else{_0x47da38();}}},'charset':'utf8mb4','collate':_0xd626('0x18')});}; \ No newline at end of file +var _0x796f=['YYYY-MM-DD\x20HH:mm:ss','changed','closedAt','models','get','update','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','path','rimraf','exports','define','MailInteraction','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format'];(function(_0x489618,_0x233987){var _0x3d34b8=function(_0xe4ffd0){while(--_0xe4ffd0){_0x489618['push'](_0x489618['shift']());}};_0x3d34b8(++_0x233987);}(_0x796f,0x104));var _0xf796=function(_0x3bd405,_0x2da8a2){_0x3bd405=_0x3bd405-0x0;var _0x3ad0b3=_0x796f[_0x3bd405];return _0x3ad0b3;};'use strict';var _=require(_0xf796('0x0'));var util=require(_0xf796('0x1'));var logger=require(_0xf796('0x2'))('api');var moment=require(_0xf796('0x3'));var BPromise=require(_0xf796('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf796('0x5'));var rimraf=require(_0xf796('0x6'));var config=require('../../config/environment');var attributes=require('./mailInteraction.attributes');module[_0xf796('0x7')]=function(_0x3458dc,_0x318f56){return _0x3458dc[_0xf796('0x8')](_0xf796('0x9'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0xf796('0xa'),'fields':[_0xf796('0xb'),'to'],'type':_0xf796('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x24d05d,_0x2505b1,_0x34c736){if(_0x24d05d[_0xf796('0xd')]){_0x24d05d[_0xf796('0xe')]=moment()[_0xf796('0xf')](_0xf796('0x10'));}if(_0x24d05d['closed']){_0x24d05d['closedAt']=moment()[_0xf796('0xf')](_0xf796('0x10'));}_0x34c736(null,_0x2505b1);},'beforeUpdate':function(_0x2b8c36,_0x2e5c06,_0x4c0a6f){if(_0x2b8c36['changed'](_0xf796('0xd'))){_0x2b8c36[_0xf796('0xe')]=_0x2b8c36[_0xf796('0xd')]?moment()[_0xf796('0xf')](_0xf796('0x10')):null;}if(_0x2b8c36[_0xf796('0x11')]('closed')){_0x2b8c36[_0xf796('0x12')]=moment()['format'](_0xf796('0x10'));_0x2b8c36['substatus']=null;_0x2b8c36['substatusAt']=null;}_0x4c0a6f(null,_0x2b8c36);},'afterUpdate':function(_0x9859b9,_0x480d47,_0x464c0b){var _0x447ece=_0x3458dc[_0xf796('0x13')];var _0x5aa92f=_0x9859b9[_0xf796('0x14')]({'plain':!![]});if(_0x5aa92f['closed']){return _0x447ece['MailMessage'][_0xf796('0x15')]({'read':!![]},{'where':{'MailInteractionId':_0x5aa92f['id']}})['then'](function(){_0x464c0b();})['catch'](function(_0x3cf9b2){_0x464c0b(_0x3cf9b2);});}else{_0x464c0b();}}},'charset':'utf8mb4','collate':_0xf796('0x16')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 5519596..a606107 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 _0xf02c=['message','result','catch','MailInteraction','update','body','options','raw','where','attributes','UpdateMailInteraction','AddTagsToMailInteraction','find','addTags','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','./mailInteraction.socket','register','request','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2439a5,_0x47236e){var _0x281b94=function(_0x2741f5){while(--_0x2741f5){_0x2439a5['push'](_0x2439a5['shift']());}};_0x281b94(++_0x47236e);}(_0xf02c,0x92));var _0xcf02=function(_0x3b6d31,_0x2cb46b){_0x3b6d31=_0x3b6d31-0x0;var _0x1cf850=_0xf02c[_0x3b6d31];return _0x1cf850;};'use strict';var _=require(_0xcf02('0x0'));var util=require(_0xcf02('0x1'));var moment=require(_0xcf02('0x2'));var BPromise=require(_0xcf02('0x3'));var rs=require(_0xcf02('0x4'));var fs=require('fs');var Redis=require(_0xcf02('0x5'));var db=require(_0xcf02('0x6'))['db'];var utils=require(_0xcf02('0x7'));var logger=require(_0xcf02('0x8'))(_0xcf02('0x9'));var config=require(_0xcf02('0xa'));var jayson=require(_0xcf02('0xb'));var client=jayson[_0xcf02('0xc')][_0xcf02('0xd')]({'port':0x232a});config[_0xcf02('0xe')]=_['defaults'](config[_0xcf02('0xe')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xcf02('0xf'))[_0xcf02('0x10')](socket);function respondWithRpcPromise(_0x1411e5,_0x1c9cda,_0x5bd27c){return new BPromise(function(_0x70fe11,_0x2c0978){return client[_0xcf02('0x11')](_0x1411e5,_0x5bd27c)['then'](function(_0x48c0d8){logger[_0xcf02('0x12')](_0xcf02('0x13'),_0x1c9cda,_0xcf02('0x14'));logger[_0xcf02('0x15')](_0xcf02('0x16'),_0x1c9cda,'request\x20sent',JSON[_0xcf02('0x17')](_0x48c0d8));if(_0x48c0d8[_0xcf02('0x18')]){if(_0x48c0d8[_0xcf02('0x18')][_0xcf02('0x19')]===0x1f4){logger[_0xcf02('0x18')](_0xcf02('0x13'),_0x1c9cda,_0x48c0d8[_0xcf02('0x18')]['message']);return _0x2c0978(_0x48c0d8[_0xcf02('0x18')][_0xcf02('0x1a')]);}logger[_0xcf02('0x18')]('MailInteraction,\x20%s,\x20%s',_0x1c9cda,_0x48c0d8[_0xcf02('0x18')][_0xcf02('0x1a')]);return _0x70fe11(_0x48c0d8[_0xcf02('0x18')][_0xcf02('0x1a')]);}else{logger['info']('MailInteraction,\x20%s,\x20%s',_0x1c9cda,'request\x20sent');_0x70fe11(_0x48c0d8[_0xcf02('0x1b')]['message']);}})[_0xcf02('0x1c')](function(_0x1cac37){logger[_0xcf02('0x18')](_0xcf02('0x13'),_0x1c9cda,_0x1cac37);_0x2c0978(_0x1cac37);});});}exports['UpdateMailInteraction']=function(_0x52322d){var _0x2a3ba1=this;return new Promise(function(_0x27b04e,_0x5bc7a2){return db[_0xcf02('0x1d')][_0xcf02('0x1e')](_0x52322d[_0xcf02('0x1f')],{'raw':_0x52322d[_0xcf02('0x20')]?_0x52322d['options'][_0xcf02('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x52322d[_0xcf02('0x20')]?_0x52322d[_0xcf02('0x20')][_0xcf02('0x22')]||null:null,'attributes':_0x52322d[_0xcf02('0x20')]?_0x52322d[_0xcf02('0x20')][_0xcf02('0x23')]||null:null,'limit':_0x52322d[_0xcf02('0x20')]?_0x52322d['options']['limit']||null:null})['then'](function(_0x38b732){logger[_0xcf02('0x12')](_0xcf02('0x24'),_0x52322d);logger[_0xcf02('0x15')](_0xcf02('0x24'),_0x52322d,JSON[_0xcf02('0x17')](_0x38b732));_0x27b04e(_0x38b732);})[_0xcf02('0x1c')](function(_0x1cccb0){logger[_0xcf02('0x18')](_0xcf02('0x24'),_0x1cccb0[_0xcf02('0x1a')],_0x52322d);_0x5bc7a2(_0x2a3ba1['error'](0x1f4,_0x1cccb0['message']));});});};exports[_0xcf02('0x25')]=function(_0x16717b){return new Promise(function(_0xc9cb04,_0x210256){return db[_0xcf02('0x1d')][_0xcf02('0x26')]({'where':_0x16717b[_0xcf02('0x20')]?_0x16717b[_0xcf02('0x20')][_0xcf02('0x22')]||null:null})['then'](function(_0x2b4ad6){if(_0x2b4ad6){return _0x2b4ad6[_0xcf02('0x27')](_0x16717b[_0xcf02('0x1f')]['ids'],_[_0xcf02('0x28')](_0x16717b[_0xcf02('0x1f')],['ids','id'])||{});}})[_0xcf02('0x29')](function(_0x26a6ca){logger['info'](_0xcf02('0x2a'),_0x16717b);logger[_0xcf02('0x15')](_0xcf02('0x2a'),_0x16717b,JSON[_0xcf02('0x17')](_0x26a6ca));_0xc9cb04(_0x26a6ca);})[_0xcf02('0x1c')](function(_0x578a26){logger[_0xcf02('0x18')](_0xcf02('0x2a'),_0x578a26[_0xcf02('0x1a')],_0x16717b);_0x210256(_this[_0xcf02('0x18')](0x1f4,_0x578a26[_0xcf02('0x1a')]));});});}; \ No newline at end of file +var _0x14f8=['jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','UpdateMailInteraction','update','body','options','where','attributes','AddTagsToMailInteraction','find','addTags','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','../../config/logger','rpc'];(function(_0x493bba,_0x2eb3b2){var _0x765204=function(_0x45dbd1){while(--_0x45dbd1){_0x493bba['push'](_0x493bba['shift']());}};_0x765204(++_0x2eb3b2);}(_0x14f8,0x66));var _0x814f=function(_0x3a3bb6,_0xe8f13b){_0x3a3bb6=_0x3a3bb6-0x0;var _0x2c340c=_0x14f8[_0x3a3bb6];return _0x2c340c;};'use strict';var _=require('lodash');var util=require(_0x814f('0x0'));var moment=require(_0x814f('0x1'));var BPromise=require(_0x814f('0x2'));var rs=require(_0x814f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x814f('0x4'))(_0x814f('0x5'));var config=require('../../config/environment');var jayson=require(_0x814f('0x6'));var client=jayson['client'][_0x814f('0x7')]({'port':0x232a});config[_0x814f('0x8')]=_[_0x814f('0x9')](config['redis'],{'host':_0x814f('0xa'),'port':0x18eb});var socket=require(_0x814f('0xb'))(new Redis(config['redis']));require(_0x814f('0xc'))['register'](socket);function respondWithRpcPromise(_0x32644e,_0x411c5e,_0x3bfaf2){return new BPromise(function(_0x2ac7b9,_0x8e1a45){return client[_0x814f('0xd')](_0x32644e,_0x3bfaf2)[_0x814f('0xe')](function(_0x5bcb95){logger[_0x814f('0xf')](_0x814f('0x10'),_0x411c5e,_0x814f('0x11'));logger[_0x814f('0x12')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x411c5e,_0x814f('0x11'),JSON[_0x814f('0x13')](_0x5bcb95));if(_0x5bcb95[_0x814f('0x14')]){if(_0x5bcb95[_0x814f('0x14')]['code']===0x1f4){logger[_0x814f('0x14')](_0x814f('0x10'),_0x411c5e,_0x5bcb95[_0x814f('0x14')][_0x814f('0x15')]);return _0x8e1a45(_0x5bcb95[_0x814f('0x14')][_0x814f('0x15')]);}logger[_0x814f('0x14')](_0x814f('0x10'),_0x411c5e,_0x5bcb95[_0x814f('0x14')]['message']);return _0x2ac7b9(_0x5bcb95[_0x814f('0x14')][_0x814f('0x15')]);}else{logger[_0x814f('0xf')]('MailInteraction,\x20%s,\x20%s',_0x411c5e,_0x814f('0x11'));_0x2ac7b9(_0x5bcb95['result'][_0x814f('0x15')]);}})[_0x814f('0x16')](function(_0x1b86ce){logger['error']('MailInteraction,\x20%s,\x20%s',_0x411c5e,_0x1b86ce);_0x8e1a45(_0x1b86ce);});});}exports[_0x814f('0x17')]=function(_0x2b0f6b){var _0x549245=this;return new Promise(function(_0x3224b1,_0x383959){return db['MailInteraction'][_0x814f('0x18')](_0x2b0f6b[_0x814f('0x19')],{'raw':_0x2b0f6b['options']?_0x2b0f6b[_0x814f('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b0f6b['options']?_0x2b0f6b['options'][_0x814f('0x1b')]||null:null,'attributes':_0x2b0f6b['options']?_0x2b0f6b['options'][_0x814f('0x1c')]||null:null,'limit':_0x2b0f6b[_0x814f('0x1a')]?_0x2b0f6b[_0x814f('0x1a')]['limit']||null:null})['then'](function(_0x48c846){logger[_0x814f('0xf')]('UpdateMailInteraction',_0x2b0f6b);logger['debug'](_0x814f('0x17'),_0x2b0f6b,JSON[_0x814f('0x13')](_0x48c846));_0x3224b1(_0x48c846);})[_0x814f('0x16')](function(_0x1cb724){logger['error'](_0x814f('0x17'),_0x1cb724[_0x814f('0x15')],_0x2b0f6b);_0x383959(_0x549245[_0x814f('0x14')](0x1f4,_0x1cb724['message']));});});};exports[_0x814f('0x1d')]=function(_0x275d46){return new Promise(function(_0x41b1f9,_0x106332){return db['MailInteraction'][_0x814f('0x1e')]({'where':_0x275d46[_0x814f('0x1a')]?_0x275d46[_0x814f('0x1a')]['where']||null:null})['then'](function(_0x5a749f){if(_0x5a749f){return _0x5a749f[_0x814f('0x1f')](_0x275d46[_0x814f('0x19')][_0x814f('0x20')],_[_0x814f('0x21')](_0x275d46['body'],[_0x814f('0x20'),'id'])||{});}})[_0x814f('0x22')](function(_0x3ba0f5){logger[_0x814f('0xf')](_0x814f('0x23'),_0x275d46);logger['debug']('AddTags',_0x275d46,JSON[_0x814f('0x13')](_0x3ba0f5));_0x41b1f9(_0x3ba0f5);})[_0x814f('0x16')](function(_0x542848){logger['error'](_0x814f('0x23'),_0x542848[_0x814f('0x15')],_0x275d46);_0x106332(_this['error'](0x1f4,_0x542848[_0x814f('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index bebf0da..114a23d 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 _0xe28d=['emit','removeListener','register','length','./mailInteraction.events','remove'];(function(_0x42049c,_0x26dfbd){var _0x438f01=function(_0x32bb41){while(--_0x32bb41){_0x42049c['push'](_0x42049c['shift']());}};_0x438f01(++_0x26dfbd);}(_0xe28d,0xd0));var _0xde28=function(_0x37ae2e,_0x35be3a){_0x37ae2e=_0x37ae2e-0x0;var _0x19c50f=_0xe28d[_0x37ae2e];return _0x19c50f;};'use strict';var MailInteractionEvents=require(_0xde28('0x0'));var events=['save',_0xde28('0x1'),'update'];function createListener(_0x235026,_0x560562){return function(_0xf0e2c9){_0x560562[_0xde28('0x2')](_0x235026,_0xf0e2c9);};}function removeListener(_0xa17989,_0x4036f1){return function(){MailInteractionEvents[_0xde28('0x3')](_0xa17989,_0x4036f1);};}exports[_0xde28('0x4')]=function(_0xaca2ce){for(var _0x1dcad0=0x0,_0x14eb7b=events[_0xde28('0x5')];_0x1dcad0<_0x14eb7b;_0x1dcad0++){var _0x436fed=events[_0x1dcad0];var _0x3eb105=createListener('mailInteraction:'+_0x436fed,_0xaca2ce);MailInteractionEvents['on'](_0x436fed,_0x3eb105);}}; \ No newline at end of file +var _0xda6c=['emit','removeListener','register','mailInteraction:','./mailInteraction.events','save','remove','update'];(function(_0x14f904,_0x3290e8){var _0x538469=function(_0x39bd8f){while(--_0x39bd8f){_0x14f904['push'](_0x14f904['shift']());}};_0x538469(++_0x3290e8);}(_0xda6c,0x15c));var _0xcda6=function(_0x1258ab,_0x62395){_0x1258ab=_0x1258ab-0x0;var _0x1aaece=_0xda6c[_0x1258ab];return _0x1aaece;};'use strict';var MailInteractionEvents=require(_0xcda6('0x0'));var events=[_0xcda6('0x1'),_0xcda6('0x2'),_0xcda6('0x3')];function createListener(_0x2c5f47,_0x163ab5){return function(_0x561e91){_0x163ab5[_0xcda6('0x4')](_0x2c5f47,_0x561e91);};}function removeListener(_0x28e980,_0xbbafc9){return function(){MailInteractionEvents[_0xcda6('0x5')](_0x28e980,_0xbbafc9);};}exports[_0xcda6('0x6')]=function(_0x39cce4){for(var _0x26f7e4=0x0,_0x53a067=events['length'];_0x26f7e4<_0x53a067;_0x26f7e4++){var _0x525d28=events[_0x26f7e4];var _0x46a5a4=createListener(_0xcda6('0x7')+_0x525d28,_0x39cce4);MailInteractionEvents['on'](_0x525d28,_0x46a5a4);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 4b820d9..147e923 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 _0xab02=['create','put','/:id','update','accept','/:id/reject','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','show','/:id/download','download','tracked','mail','mailmessage:create'];(function(_0x58a031,_0x3dde52){var _0x40fe3d=function(_0x23474a){while(--_0x23474a){_0x58a031['push'](_0x58a031['shift']());}};_0x40fe3d(++_0x3dde52);}(_0xab02,0xc5));var _0x2ab0=function(_0x105109,_0xe3782){_0x105109=_0x105109-0x0;var _0x4c10b8=_0xab02[_0x105109];return _0x4c10b8;};'use strict';var multer=require(_0x2ab0('0x0'));var util=require(_0x2ab0('0x1'));var path=require(_0x2ab0('0x2'));var timeout=require(_0x2ab0('0x3'));var express=require(_0x2ab0('0x4'));var router=express[_0x2ab0('0x5')]();var fs_extra=require(_0x2ab0('0x6'));var auth=require(_0x2ab0('0x7'));var interaction=require(_0x2ab0('0x8'));var config=require(_0x2ab0('0x9'));var controller=require(_0x2ab0('0xa'));router[_0x2ab0('0xb')]('/',auth[_0x2ab0('0xc')](),controller['index']);router[_0x2ab0('0xb')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0x2ab0('0xc')](),controller[_0x2ab0('0xd')]);router[_0x2ab0('0xb')](_0x2ab0('0xe'),auth['isAuthenticated'](),controller[_0x2ab0('0xf')]);router['post']('/',auth[_0x2ab0('0xc')](),interaction[_0x2ab0('0x10')](_0x2ab0('0x11'),_0x2ab0('0x12')),controller[_0x2ab0('0x13')]);router[_0x2ab0('0x14')](_0x2ab0('0x15'),auth['isAuthenticated'](),controller[_0x2ab0('0x16')]);router[_0x2ab0('0x14')]('/:id/accept',auth[_0x2ab0('0xc')](),controller[_0x2ab0('0x17')]);router[_0x2ab0('0x14')](_0x2ab0('0x18'),auth[_0x2ab0('0xc')](),controller['reject']);router[_0x2ab0('0x19')](_0x2ab0('0x15'),auth[_0x2ab0('0xc')](),controller['destroy']);module[_0x2ab0('0x1a')]=router; \ No newline at end of file +var _0xec56=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','tracked','mail','create','put','update','/:id/accept','reject','delete','exports','multer','connect-timeout','express'];(function(_0x50a0b7,_0x5a25f6){var _0x1a7e9a=function(_0xad49b2){while(--_0xad49b2){_0x50a0b7['push'](_0x50a0b7['shift']());}};_0x1a7e9a(++_0x5a25f6);}(_0xec56,0x1bd));var _0x6ec5=function(_0x315bc4,_0x5e8c84){_0x315bc4=_0x315bc4-0x0;var _0x2ec682=_0xec56[_0x315bc4];return _0x2ec682;};'use strict';var multer=require(_0x6ec5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6ec5('0x1'));var express=require(_0x6ec5('0x2'));var router=express[_0x6ec5('0x3')]();var fs_extra=require(_0x6ec5('0x4'));var auth=require(_0x6ec5('0x5'));var interaction=require(_0x6ec5('0x6'));var config=require(_0x6ec5('0x7'));var controller=require(_0x6ec5('0x8'));router[_0x6ec5('0x9')]('/',auth[_0x6ec5('0xa')](),controller[_0x6ec5('0xb')]);router[_0x6ec5('0x9')](_0x6ec5('0xc'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0xd')]);router[_0x6ec5('0x9')](_0x6ec5('0xe'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0xf')]);router['get'](_0x6ec5('0x10'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x11')]);router[_0x6ec5('0x12')]('/',auth[_0x6ec5('0xa')](),interaction[_0x6ec5('0x13')](_0x6ec5('0x14'),'mailmessage:create'),controller[_0x6ec5('0x15')]);router[_0x6ec5('0x16')](_0x6ec5('0xe'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x17')]);router[_0x6ec5('0x16')](_0x6ec5('0x18'),auth[_0x6ec5('0xa')](),controller['accept']);router[_0x6ec5('0x16')]('/:id/reject',auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x19')]);router[_0x6ec5('0x1a')](_0x6ec5('0xe'),auth[_0x6ec5('0xa')](),controller['destroy']);module[_0x6ec5('0x1b')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index fb898fb..98a373b 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 _0x8a73=['Chat','sequelize','lodash','long','TEXT','medium','BOOLEAN','ENUM','out','STRING','DATE','INTEGER','Email'];(function(_0x208ebb,_0x1b2acc){var _0x224658=function(_0x3af97f){while(--_0x3af97f){_0x208ebb['push'](_0x208ebb['shift']());}};_0x224658(++_0x1b2acc);}(_0x8a73,0x1e2));var _0x38a7=function(_0x293704,_0x5ec4bb){_0x293704=_0x293704-0x0;var _0x5d84fc=_0x8a73[_0x293704];return _0x5d84fc;};'use strict';var Sequelize=require(_0x38a7('0x0'));var _=require(_0x38a7('0x1'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x38a7('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x38a7('0x3')](_0x38a7('0x4'))},'read':{'type':Sequelize[_0x38a7('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x38a7('0x6')]('in','out'),'defaultValue':_0x38a7('0x7'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x38a7('0x8')]},'to':{'type':Sequelize[_0x38a7('0x3')](_0x38a7('0x2'))},'cc':{'type':Sequelize[_0x38a7('0x3')](_0x38a7('0x2'))},'bcc':{'type':Sequelize[_0x38a7('0x3')](_0x38a7('0x2'))},'subject':{'type':Sequelize[_0x38a7('0x3')]},'sentAt':{'type':Sequelize[_0x38a7('0x9')]},'attach':{'type':Sequelize[_0x38a7('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x38a7('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0x38a7('0x3')](_0x38a7('0x2'))},'originCc':{'type':Sequelize[_0x38a7('0x3')]('long')},'originChannel':{'type':Sequelize[_0x38a7('0x6')](_0x38a7('0xb'),_0x38a7('0xc')),'defaultValue':_0x38a7('0xb'),'allowNull':![]}}; \ No newline at end of file +var _0xa456=['INTEGER','Email','Chat','sequelize','lodash','TEXT','long','BOOLEAN','ENUM','out','STRING','DATE'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xa456,0x1d7));var _0x6a45=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0xa456[_0x2c7618];return _0x5ce3f0;};'use strict';var Sequelize=require(_0x6a45('0x0'));var _=require(_0x6a45('0x1'));module['exports']={'body':{'type':Sequelize[_0x6a45('0x2')](_0x6a45('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x6a45('0x2')]('medium')},'read':{'type':Sequelize[_0x6a45('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x6a45('0x5')]('in',_0x6a45('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x6a45('0x7')](0x1fe)},'from':{'type':Sequelize[_0x6a45('0x7')]},'to':{'type':Sequelize[_0x6a45('0x2')]('long')},'cc':{'type':Sequelize[_0x6a45('0x2')](_0x6a45('0x3'))},'bcc':{'type':Sequelize['TEXT'](_0x6a45('0x3'))},'subject':{'type':Sequelize[_0x6a45('0x2')]},'sentAt':{'type':Sequelize[_0x6a45('0x8')]},'attach':{'type':Sequelize[_0x6a45('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0x6a45('0x2')]('long')},'originCc':{'type':Sequelize[_0x6a45('0x2')](_0x6a45('0x3'))},'originChannel':{'type':Sequelize[_0x6a45('0x5')](_0x6a45('0xa'),_0x6a45('0xb')),'defaultValue':_0x6a45('0xa'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 03204aa..aad505d 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 _0x99fe=['fieldName','type','key','model','query','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','options','MailMessage','includeAll','include','rows','catch','show','rawAttributes','find','update','body','params','describe','create','direction','secret','split','findOne','MailAccountId','CmList','Contacts','updatedAt','MailServerOut','isNil','Smtp','service','host','port','secure','authentication','auth','pass','user','attachments','join','root','server/files/attachments','basename','List','CmContact','ListId','sendMail','YYYY-MM-DD\x20HH:mm:ss','accept','mail','readAt','format','UserId','MailInteraction','read1stAt','get','[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','sequelize','QueryTypes','contact','User','agent','fullname','email','internal','manual','SIP/%s','channel','fromString','EventManager','reject','MailInteractionId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','ContactId','SELECT','interface','motionChannel','event','rejectmessage','download','unix','toString','files','tmp','server','message-%s.eml','from','subject','Attachment','Attachments','decode','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','push','readFileSync','unlinkSync','eml-format','moment','bluebird','util','path','ioredis','../../components/parsers/qs','api','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','html-entities','./mailMessage.socket','register','jayson/promise','http','client','request','info','MailMessage,\x20%s,\x20%s','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','status','json','offset','limit','undefined','count','Content-Range','then','end','sendStatus','stack','name','index','map'];(function(_0x8fc3b,_0x22ca49){var _0x853844=function(_0x137833){while(--_0x137833){_0x8fc3b['push'](_0x8fc3b['shift']());}};_0x853844(++_0x22ca49);}(_0x99fe,0x1ba));var _0xe99f=function(_0x13ce0c,_0x3f2a0d){_0x13ce0c=_0x13ce0c-0x0;var _0x4388fb=_0x99fe[_0x13ce0c];return _0x4388fb;};'use strict';var emlformat=require(_0xe99f('0x0'));var moment=require(_0xe99f('0x1'));var BPromise=require(_0xe99f('0x2'));var util=require(_0xe99f('0x3'));var path=require(_0xe99f('0x4'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xe99f('0x5'));var htmlToText=require('html-to-text');var qs=require(_0xe99f('0x6'));var logger=require('../../config/logger')(_0xe99f('0x7'));var interaction_log=require(_0xe99f('0x8'))('mail-interactions');var config=require(_0xe99f('0x9'));var db=require(_0xe99f('0xa'))['db'];config[_0xe99f('0xb')]=_[_0xe99f('0xc')](config[_0xe99f('0xb')],{'host':_0xe99f('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe99f('0xb')]));var htmlEntities=require(_0xe99f('0xe'));require(_0xe99f('0xf'))[_0xe99f('0x10')](socket);var jayson=require(_0xe99f('0x11'));var client=jayson['client'][_0xe99f('0x12')]({'port':0x232c});var client9003=jayson['client'][_0xe99f('0x12')]({'port':0x232b});var client9002=jayson[_0xe99f('0x13')][_0xe99f('0x12')]({'port':0x232a});function respondWithRpcPromise(_0x4b8094,_0x56af19,_0x55c054,_0xde8c7a){return new BPromise(function(_0x6dfa44,_0x5a0d9a){var _0x270c4b=_0xde8c7a||client;return _0x270c4b[_0xe99f('0x14')](_0x4b8094,_0x55c054)['then'](function(_0x216992){logger[_0xe99f('0x15')](_0xe99f('0x16'),_0x56af19,'request\x20sent');logger['debug'](_0xe99f('0x17'),_0x56af19,_0xe99f('0x18'),JSON[_0xe99f('0x19')](_0x216992));if(_0x216992[_0xe99f('0x1a')]){if(_0x216992[_0xe99f('0x1a')][_0xe99f('0x1b')]===0x1f4){logger['error']('MailMessage,\x20%s,\x20%s',_0x56af19,_0x216992[_0xe99f('0x1a')][_0xe99f('0x1c')]);return _0x5a0d9a(_0x216992[_0xe99f('0x1a')][_0xe99f('0x1c')]);}logger['error'](_0xe99f('0x16'),_0x56af19,_0x216992[_0xe99f('0x1a')]['message']);return _0x6dfa44(_0x216992[_0xe99f('0x1a')][_0xe99f('0x1c')]);}else{logger['info'](_0xe99f('0x16'),_0x56af19,_0xe99f('0x18'));_0x6dfa44(_0x216992[_0xe99f('0x1d')][_0xe99f('0x1c')]);}})['catch'](function(_0x48f404){logger[_0xe99f('0x1a')]('MailMessage,\x20%s,\x20%s',_0x56af19,_0x48f404);_0x5a0d9a(_0x48f404);});});}function respondWithResult(_0x505090,_0x3f5a84){_0x3f5a84=_0x3f5a84||0xc8;return function(_0x24f68a){if(_0x24f68a){return _0x505090[_0xe99f('0x1e')](_0x3f5a84)[_0xe99f('0x1f')](_0x24f68a);}};}function respondWithFilteredResult(_0x4a1ede,_0x385dfc){return function(_0x5d06aa){if(_0x5d06aa){var _0x875fd5=typeof _0x385dfc[_0xe99f('0x20')]==='undefined'&&typeof _0x385dfc[_0xe99f('0x21')]===_0xe99f('0x22');var _0x437227=_0x5d06aa[_0xe99f('0x23')];var _0x5e04ae=_0x875fd5?0x0:_0x385dfc['offset'];var _0x353b23=_0x875fd5?_0x5d06aa[_0xe99f('0x23')]:_0x385dfc['offset']+_0x385dfc[_0xe99f('0x21')];var _0x19f2ef;if(_0x353b23>=_0x437227){_0x353b23=_0x437227;_0x19f2ef=0xc8;}else{_0x19f2ef=0xce;}_0x4a1ede['status'](_0x19f2ef);return _0x4a1ede['set'](_0xe99f('0x24'),_0x5e04ae+'-'+_0x353b23+'/'+_0x437227)[_0xe99f('0x1f')](_0x5d06aa);}return null;};}function saveUpdates(_0x4b16e4){return function(_0x3ab752){if(_0x3ab752){return _0x3ab752['update'](_0x4b16e4)[_0xe99f('0x25')](function(_0x3cee96){return _0x3cee96;});}return null;};}function removeEntity(_0x354ffa){return function(_0x304e54){if(_0x304e54){return _0x304e54['destroy']()[_0xe99f('0x25')](function(){_0x354ffa['status'](0xcc)[_0xe99f('0x26')]();});}};}function handleEntityNotFound(_0x50fbe6){return function(_0x17e8cc){if(!_0x17e8cc){_0x50fbe6[_0xe99f('0x27')](0x194);}return _0x17e8cc;};}function handleError(_0x260a7b,_0x31b628){_0x31b628=_0x31b628||0x1f4;return function(_0x4ba553){logger[_0xe99f('0x1a')](_0x4ba553[_0xe99f('0x28')]);if(_0x4ba553[_0xe99f('0x29')]){delete _0x4ba553[_0xe99f('0x29')];}_0x260a7b[_0xe99f('0x1e')](_0x31b628)['send'](_0x4ba553);};}exports[_0xe99f('0x2a')]=function(_0x5744b6,_0x3e5d1f){var _0x26ae3d={},_0x166e94={},_0x284af4={'count':0x0,'rows':[]};var _0x31f893=_[_0xe99f('0x2b')](db['MailMessage']['rawAttributes'],function(_0x1b7492){return{'name':_0x1b7492[_0xe99f('0x2c')],'type':_0x1b7492[_0xe99f('0x2d')][_0xe99f('0x2e')]};});_0x166e94[_0xe99f('0x2f')]=_['map'](_0x31f893,'name');_0x166e94[_0xe99f('0x30')]=_['keys'](_0x5744b6[_0xe99f('0x30')]);_0x166e94[_0xe99f('0x31')]=_['intersection'](_0x166e94['model'],_0x166e94[_0xe99f('0x30')]);_0x26ae3d['attributes']=_[_0xe99f('0x32')](_0x166e94['model'],qs[_0xe99f('0x33')](_0x5744b6[_0xe99f('0x30')][_0xe99f('0x33')]));_0x26ae3d[_0xe99f('0x34')]=_0x26ae3d['attributes'][_0xe99f('0x35')]?_0x26ae3d[_0xe99f('0x34')]:_0x166e94['model'];if(!_0x5744b6['query']['hasOwnProperty']('nolimit')){_0x26ae3d[_0xe99f('0x21')]=qs[_0xe99f('0x21')](_0x5744b6[_0xe99f('0x30')][_0xe99f('0x21')]);_0x26ae3d[_0xe99f('0x20')]=qs[_0xe99f('0x20')](_0x5744b6[_0xe99f('0x30')][_0xe99f('0x20')]);}_0x26ae3d[_0xe99f('0x36')]=qs[_0xe99f('0x37')](_0x5744b6[_0xe99f('0x30')][_0xe99f('0x37')]);_0x26ae3d[_0xe99f('0x38')]=qs[_0xe99f('0x31')](_[_0xe99f('0x39')](_0x5744b6[_0xe99f('0x30')],_0x166e94[_0xe99f('0x31')]),_0x31f893);if(_0x5744b6['query'][_0xe99f('0x3a')]){_0x26ae3d['where']=_[_0xe99f('0x3b')](_0x26ae3d['where'],{'$or':_[_0xe99f('0x2b')](_0x31f893,function(_0x3e9259){if(_0x3e9259[_0xe99f('0x2d')]!=='VIRTUAL'){var _0x1ea138={};_0x1ea138[_0x3e9259[_0xe99f('0x29')]]={'$like':'%'+_0x5744b6[_0xe99f('0x30')][_0xe99f('0x3a')]+'%'};return _0x1ea138;}})});}_0x26ae3d=_[_0xe99f('0x3b')]({},_0x26ae3d,_0x5744b6[_0xe99f('0x3c')]);var _0x66fe78={'where':_0x26ae3d[_0xe99f('0x38')]};return db[_0xe99f('0x3d')][_0xe99f('0x23')](_0x66fe78)[_0xe99f('0x25')](function(_0x23c1ce){_0x284af4[_0xe99f('0x23')]=_0x23c1ce;if(_0x5744b6['query'][_0xe99f('0x3e')]){_0x26ae3d[_0xe99f('0x3f')]=[{'all':!![]}];}return db[_0xe99f('0x3d')]['findAll'](_0x26ae3d);})[_0xe99f('0x25')](function(_0x337fff){_0x284af4[_0xe99f('0x40')]=_0x337fff;return _0x284af4;})['then'](respondWithFilteredResult(_0x3e5d1f,_0x26ae3d))[_0xe99f('0x41')](handleError(_0x3e5d1f,null));};exports[_0xe99f('0x42')]=function(_0x585c59,_0x620453){var _0x5aa8c9={'raw':!![],'where':{'id':_0x585c59['params']['id']}},_0x3a7432={};_0x3a7432[_0xe99f('0x2f')]=_['keys'](db[_0xe99f('0x3d')][_0xe99f('0x43')]);_0x3a7432[_0xe99f('0x30')]=_['keys'](_0x585c59[_0xe99f('0x30')]);_0x3a7432[_0xe99f('0x31')]=_[_0xe99f('0x32')](_0x3a7432[_0xe99f('0x2f')],_0x3a7432[_0xe99f('0x30')]);_0x5aa8c9[_0xe99f('0x34')]=_[_0xe99f('0x32')](_0x3a7432[_0xe99f('0x2f')],qs[_0xe99f('0x33')](_0x585c59['query'][_0xe99f('0x33')]));_0x5aa8c9[_0xe99f('0x34')]=_0x5aa8c9[_0xe99f('0x34')][_0xe99f('0x35')]?_0x5aa8c9[_0xe99f('0x34')]:_0x3a7432[_0xe99f('0x2f')];if(_0x585c59[_0xe99f('0x30')][_0xe99f('0x3e')]){_0x5aa8c9[_0xe99f('0x3f')]=[{'all':!![]}];}_0x5aa8c9=_[_0xe99f('0x3b')]({},_0x5aa8c9,_0x585c59[_0xe99f('0x3c')]);return db[_0xe99f('0x3d')][_0xe99f('0x44')](_0x5aa8c9)[_0xe99f('0x25')](handleEntityNotFound(_0x620453,null))[_0xe99f('0x25')](respondWithResult(_0x620453,null))[_0xe99f('0x41')](handleError(_0x620453,null));};exports[_0xe99f('0x45')]=function(_0x537300,_0x1cbf1e){if(_0x537300[_0xe99f('0x46')]['id']){delete _0x537300['body']['id'];}return db[_0xe99f('0x3d')]['find']({'where':{'id':_0x537300[_0xe99f('0x47')]['id']}})[_0xe99f('0x25')](handleEntityNotFound(_0x1cbf1e,null))['then'](saveUpdates(_0x537300[_0xe99f('0x46')],null))[_0xe99f('0x25')](respondWithResult(_0x1cbf1e,null))[_0xe99f('0x41')](handleError(_0x1cbf1e,null));};exports['destroy']=function(_0x8d4c17,_0x2d3333){return db[_0xe99f('0x3d')][_0xe99f('0x44')]({'where':{'id':_0x8d4c17['params']['id']}})['then'](handleEntityNotFound(_0x2d3333,null))[_0xe99f('0x25')](removeEntity(_0x2d3333,null))[_0xe99f('0x41')](handleError(_0x2d3333,null));};exports[_0xe99f('0x48')]=function(_0x30a326,_0x3e2ae5){return db[_0xe99f('0x3d')][_0xe99f('0x48')]()[_0xe99f('0x25')](respondWithResult(_0x3e2ae5,null))[_0xe99f('0x41')](handleError(_0x3e2ae5,null));};exports[_0xe99f('0x49')]=function(_0x106ca5,_0x47f878){return db[_0xe99f('0x3d')][_0xe99f('0x49')](_0x106ca5[_0xe99f('0x46')])[_0xe99f('0x25')](function(_0x436162){if(_0x436162){if(_0x436162[_0xe99f('0x4a')]==='out'&&!_0x436162[_0xe99f('0x4b')]){var _0x10198d,_0x90b048,_0x3f3157;if(_0x106ca5[_0xe99f('0x46')]['to']){_0x90b048=_0x106ca5[_0xe99f('0x46')]['to'][_0xe99f('0x4c')](',')[0x0];}return db['MailAccount'][_0xe99f('0x4d')]({'where':{'id':_0x436162[_0xe99f('0x4e')]},'include':[{'model':db[_0xe99f('0x4f')],'as':'List','include':[{'model':db['CmContact'],'as':_0xe99f('0x50'),'where':{'email':_0x90b048},'limit':0x1,'order':[[_0xe99f('0x51'),'DESC']]}]},{'model':db[_0xe99f('0x52')],'as':'Smtp','raw':!![]}]})['then'](function(_0x2bba2a){_0x10198d=_0x2bba2a;if(_0x10198d&&_0x10198d['Smtp']){var _0x3d8ff3={'tls':{'rejectUnauthorized':![]}};if(_[_0xe99f('0x53')](_0x10198d[_0xe99f('0x54')][_0xe99f('0x55')])){_0x3d8ff3[_0xe99f('0x56')]=_0x10198d[_0xe99f('0x54')][_0xe99f('0x56')];_0x3d8ff3[_0xe99f('0x57')]=_0x10198d[_0xe99f('0x54')][_0xe99f('0x57')];_0x3d8ff3[_0xe99f('0x58')]=_0x10198d[_0xe99f('0x54')][_0xe99f('0x58')];if(_0x10198d[_0xe99f('0x54')][_0xe99f('0x59')]){_0x3d8ff3[_0xe99f('0x5a')]={'user':_0x10198d[_0xe99f('0x54')]['user'],'pass':_0x10198d[_0xe99f('0x54')][_0xe99f('0x5b')]};}}else{_0x3d8ff3[_0xe99f('0x55')]=_0x10198d[_0xe99f('0x54')][_0xe99f('0x55')];_0x3d8ff3[_0xe99f('0x5a')]={'user':_0x10198d['Smtp'][_0xe99f('0x5c')],'pass':_0x10198d[_0xe99f('0x54')][_0xe99f('0x5b')]};_0x3d8ff3[_0xe99f('0x58')]=_0x10198d[_0xe99f('0x54')]['secure'];}if(_0x106ca5['body'][_0xe99f('0x5d')]&&_0x106ca5['body'][_0xe99f('0x5d')]['length']){for(var _0x33bc22=0x0;_0x33bc22<_0x106ca5[_0xe99f('0x46')][_0xe99f('0x5d')][_0xe99f('0x35')];_0x33bc22+=0x1){_0x106ca5['body'][_0xe99f('0x5d')][_0x33bc22]={'filename':_0x106ca5[_0xe99f('0x46')]['attachments'][_0x33bc22][_0xe99f('0x29')],'path':path[_0xe99f('0x5e')](config[_0xe99f('0x5f')],_0xe99f('0x60'),_0x106ca5['body'][_0xe99f('0x5d')][_0x33bc22][_0xe99f('0x61')])};}}_0x3f3157={'account':_0x3d8ff3,'message':_0x106ca5[_0xe99f('0x46')]};return;}})['then'](function(){if(_0x10198d[_0xe99f('0x62')]){if(_0x10198d['List'][_0xe99f('0x50')][_0xe99f('0x35')]){return _0x10198d[_0xe99f('0x62')][_0xe99f('0x50')][0x0];}else{return db[_0xe99f('0x63')][_0xe99f('0x49')](_[_0xe99f('0xc')](_0x106ca5[_0xe99f('0x46')],{'firstName':_0x106ca5['body']['to'],'email':_0x106ca5['body']['to'],'phone':_0x106ca5['body']['to'],'ListId':_0x10198d[_0xe99f('0x64')]}));}}else{throw new Error('List\x20not\x20found');}})[_0xe99f('0x25')](function(){if(_0x3f3157){return respondWithRpcPromise('SendMail',_0xe99f('0x65'),_0x3f3157,client9003)[_0xe99f('0x25')](function(_0x2133e4){return _0x436162[_0xe99f('0x45')]({'read':!![],'messageId':_0x2133e4['messageId'],'sentAt':moment()['format'](_0xe99f('0x66'))});})[_0xe99f('0x41')](function(_0xf12de){logger[_0xe99f('0x1a')]('%s',JSON[_0xe99f('0x19')](_0xf12de));return _0x436162;});}return _0x436162;});}return _0x436162;}})[_0xe99f('0x25')](respondWithResult(_0x47f878,0xc9))['catch'](handleError(_0x47f878,null));};exports[_0xe99f('0x67')]=function(_0x5559e2,_0x1e96af){var _0x3b6d10={'agent':{},'channel':_0xe99f('0x68')};if(_0x5559e2[_0xe99f('0x46')]['id']){delete _0x5559e2['body']['id'];}_0x5559e2[_0xe99f('0x46')]['read']=!![];_0x5559e2[_0xe99f('0x46')][_0xe99f('0x69')]=moment()[_0xe99f('0x6a')](_0xe99f('0x66'));_0x5559e2['body']['UserId']=_0x5559e2[_0xe99f('0x46')][_0xe99f('0x6b')]||_0x5559e2[_0xe99f('0x5c')]['id'];_0x3b6d10['agent']['id']=_0x5559e2['body']['UserId'];return db[_0xe99f('0x3d')][_0xe99f('0x44')]({'where':{'id':_0x5559e2[_0xe99f('0x47')]['id'],'UserId':null}})[_0xe99f('0x25')](handleEntityNotFound(_0x1e96af,null))[_0xe99f('0x25')](saveUpdates(_0x5559e2[_0xe99f('0x46')],null))[_0xe99f('0x25')](function(_0x568a1f){if(_0x568a1f){_0x3b6d10[_0xe99f('0x1c')]=_0x568a1f['get']({'plain':!![]});return db[_0xe99f('0x6c')][_0xe99f('0x44')]({'where':{'id':_0x568a1f['MailInteractionId']}});}return null;})[_0xe99f('0x25')](handleEntityNotFound(_0x1e96af,null))[_0xe99f('0x25')](function(_0x489592){if(_0x489592){return _0x489592['update']({'UserId':_0x5559e2[_0xe99f('0x46')][_0xe99f('0x6b')],'read1stAt':_[_0xe99f('0x53')](_0x489592[_0xe99f('0x6d')])?moment()['format'](_0xe99f('0x66')):undefined});}return null;})[_0xe99f('0x25')](function(_0x2cfad1){if(_0x2cfad1){_0x3b6d10['interaction']=_0x2cfad1[_0xe99f('0x6e')]({'plain':!![]});interaction_log[_0xe99f('0x15')](_0xe99f('0x6f'),_0x5559e2[_0xe99f('0x5c')]['id'],_0x5559e2[_0xe99f('0x5c')][_0xe99f('0x29')],_0x5559e2[_0xe99f('0x5c')]['role'],_0x3b6d10[_0xe99f('0x70')]['id'],_0x5559e2[_0xe99f('0x46')]?JSON['stringify'](_0x5559e2[_0xe99f('0x46')]):_0xe99f('0x71'));return respondWithRpcPromise(_0xe99f('0x72'),_0xe99f('0x73'),_0x3b6d10);}return null;})[_0xe99f('0x25')](function(_0x1265aa){var _0x3dc53e=_0xe99f('0x74')+_0x1265aa['message']['ContactId'];return db[_0xe99f('0x75')][_0xe99f('0x30')](_0x3dc53e,{'type':db['Sequelize'][_0xe99f('0x76')]['SELECT'],'raw':!![]})[_0xe99f('0x25')](function(_0xbac125){return _0xbac125;});})['then'](function(_0x56aad0){if(_0x56aad0){_0x3b6d10[_0xe99f('0x1c')][_0xe99f('0x77')]=_0x56aad0[0x0];if(!_0x5559e2[_0xe99f('0x46')]['UserId'])return;return db[_0xe99f('0x78')][_0xe99f('0x44')]({'where':{'id':_0x5559e2[_0xe99f('0x46')][_0xe99f('0x6b')],'role':_0xe99f('0x79')},'attributes':['id','name',_0xe99f('0x7a'),_0xe99f('0x7b'),_0xe99f('0x7c')],'raw':!![]});}return null;})[_0xe99f('0x25')](function(_0x549457){if(!_0x549457)return null;_0x3b6d10[_0xe99f('0x1c')][_0xe99f('0x79')]=_0x549457;return _0x3b6d10;})[_0xe99f('0x25')](function(_0x291ea4){if(_0x291ea4){if(_0x5559e2[_0xe99f('0x46')][_0xe99f('0x7d')]){_0x3b6d10['message']['interface']=util[_0xe99f('0x6a')](_0xe99f('0x7e'),_0x5559e2[_0xe99f('0x5c')][_0xe99f('0x29')]);_0x3b6d10[_0xe99f('0x1c')][_0xe99f('0x7f')]=_0x3b6d10[_0xe99f('0x7f')];_0x3b6d10['message']['motionChannel']=_0x3b6d10[_0xe99f('0x7f')];_0x3b6d10['message']['event']='accept';_0x3b6d10[_0xe99f('0x1c')][_0xe99f('0x46')]=htmlToText[_0xe99f('0x80')](_0x3b6d10[_0xe99f('0x1c')]['body']);return respondWithRpcPromise(_0xe99f('0x81'),_0xe99f('0x81'),{'event':'acceptmessage','message':_0x3b6d10[_0xe99f('0x1c')]},client9002)[_0xe99f('0x25')](function(){return _0x3b6d10;});}return _0x3b6d10;}return null;})['then'](respondWithResult(_0x1e96af,null))['catch'](handleError(_0x1e96af,null));};exports[_0xe99f('0x82')]=function(_0x311b9e,_0xc7eac4){var _0x25d3c5={'agent':{},'channel':'mail'};if(_0x311b9e[_0xe99f('0x46')]['id']){delete _0x311b9e[_0xe99f('0x46')]['id'];}_0x311b9e[_0xe99f('0x46')]['UserId']=_0x311b9e[_0xe99f('0x46')]['UserId']||_0x311b9e[_0xe99f('0x5c')]['id'];_0x25d3c5['agent']['id']=_0x311b9e['body'][_0xe99f('0x6b')];return db[_0xe99f('0x3d')][_0xe99f('0x44')]({'where':{'id':_0x311b9e[_0xe99f('0x47')]['id'],'UserId':null}})[_0xe99f('0x25')](handleEntityNotFound(_0xc7eac4,null))[_0xe99f('0x25')](function(_0x4f418d){if(_0x4f418d){_0x25d3c5[_0xe99f('0x1c')]=_0x4f418d[_0xe99f('0x6e')]({'plain':!![]});return db['MailInteraction']['find']({'where':{'id':_0x4f418d[_0xe99f('0x83')]}});}return null;})['then'](handleEntityNotFound(_0xc7eac4,null))['then'](function(_0x27ddc8){if(_0x27ddc8){_0x25d3c5['interaction']=_0x27ddc8['get']({'plain':!![]});interaction_log[_0xe99f('0x15')](_0xe99f('0x84'),_0x311b9e[_0xe99f('0x5c')]['id'],_0x311b9e[_0xe99f('0x5c')]['name'],_0x311b9e[_0xe99f('0x5c')][_0xe99f('0x85')],_0x25d3c5[_0xe99f('0x70')]['id'],_0x311b9e[_0xe99f('0x46')]?JSON['stringify'](_0x311b9e['body']):_0xe99f('0x71'));return respondWithRpcPromise(_0xe99f('0x86'),_0xe99f('0x87'),_0x25d3c5);}return null;})[_0xe99f('0x25')](function(_0x4c2aeb){var _0x3d697b='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4c2aeb[_0xe99f('0x1c')][_0xe99f('0x88')];return db[_0xe99f('0x75')]['query'](_0x3d697b,{'type':db['Sequelize'][_0xe99f('0x76')][_0xe99f('0x89')],'raw':!![]})['then'](function(_0xcfc8b1){return _0xcfc8b1;});})[_0xe99f('0x25')](function(_0xcbd868){if(_0xcbd868){_0x25d3c5[_0xe99f('0x1c')]['contact']=_0xcbd868[0x0];if(!_0x311b9e['body'][_0xe99f('0x6b')])return;return db['User'][_0xe99f('0x44')]({'where':{'id':_0x311b9e[_0xe99f('0x46')][_0xe99f('0x6b')],'role':_0xe99f('0x79')},'attributes':['id',_0xe99f('0x29'),_0xe99f('0x7a'),_0xe99f('0x7b'),_0xe99f('0x7c')],'raw':!![]});}return null;})['then'](function(_0x1e1fa6){if(!_0x1e1fa6)return null;_0x25d3c5[_0xe99f('0x1c')][_0xe99f('0x79')]=_0x1e1fa6;return _0x25d3c5;})[_0xe99f('0x25')](function(_0x3d48e6){if(_0x3d48e6){_0x3d48e6[_0xe99f('0x1c')][_0xe99f('0x8a')]=util[_0xe99f('0x6a')]('SIP/%s',_0x311b9e[_0xe99f('0x5c')]['name']);_0x3d48e6[_0xe99f('0x1c')][_0xe99f('0x7f')]=_0x25d3c5[_0xe99f('0x7f')];_0x3d48e6[_0xe99f('0x1c')][_0xe99f('0x8b')]=_0x25d3c5['channel'];_0x3d48e6[_0xe99f('0x1c')][_0xe99f('0x8c')]=_0xe99f('0x82');_0x3d48e6[_0xe99f('0x1c')][_0xe99f('0x46')]=htmlToText['fromString'](_0x25d3c5[_0xe99f('0x1c')][_0xe99f('0x46')]);respondWithRpcPromise(_0xe99f('0x81'),_0xe99f('0x81'),{'event':_0xe99f('0x8d'),'message':_0x3d48e6[_0xe99f('0x1c')]},client9002);return _0x25d3c5;}return null;})[_0xe99f('0x25')](respondWithResult(_0xc7eac4,null))[_0xe99f('0x41')](handleError(_0xc7eac4,null));};exports[_0xe99f('0x8e')]=function(_0x1db411,_0x2e46a1){var _0x1159d=moment()[_0xe99f('0x8f')]()[_0xe99f('0x90')]();var _0x311b58=path[_0xe99f('0x5e')](config[_0xe99f('0x5f')],'server',_0xe99f('0x91'),_0xe99f('0x92'));var _0x2e9da6=path['join'](config[_0xe99f('0x5f')],_0xe99f('0x93'),'files','attachments');var _0x184594=util[_0xe99f('0x6a')](_0xe99f('0x94'),_0x1159d);return db[_0xe99f('0x3d')]['find']({'where':{'id':_0x1db411['params']['id']},'attributes':['id',_0xe99f('0x46'),_0xe99f('0x95'),'to','cc','bcc',_0xe99f('0x96'),'createdAt'],'include':_0x1db411[_0xe99f('0x30')][_0xe99f('0x5d')]?[{'model':db[_0xe99f('0x97')],'as':_0xe99f('0x98')}]:undefined})[_0xe99f('0x25')](handleEntityNotFound(_0x2e46a1,null))[_0xe99f('0x25')](function(_0xc064c2){if(_0xc064c2){var _0x4a950a=_0xc064c2;var _0x5804fc={'from':_0x4a950a[_0xe99f('0x95')],'to':_0x4a950a['to'],'subject':_0x4a950a[_0xe99f('0x96')],'html':htmlEntities[_0xe99f('0x99')](_0x4a950a[_0xe99f('0x46')]),'headers':{'Date':moment(_0x4a950a[_0xe99f('0x9a')])['format'](_0xe99f('0x9b'))},'attachments':[]};if(_0xc064c2['cc']){_0x5804fc[_0xe99f('0x9c')]['Cc']=_0xc064c2['cc'];}if(_0xc064c2[_0xe99f('0x9d')]){_0x5804fc[_0xe99f('0x9c')][_0xe99f('0x9e')]=_0xc064c2[_0xe99f('0x9d')];}return new BPromise(function(_0x47aa03,_0x5855f0){if(_0xc064c2[_0xe99f('0x98')]){for(var _0x26df77=0x0;_0x26df77<_0xc064c2[_0xe99f('0x98')][_0xe99f('0x35')];_0x26df77++){var _0x523161=_0xc064c2[_0xe99f('0x98')][_0x26df77];var _0x270d86=path[_0xe99f('0x5e')](_0x2e9da6,_0x523161[_0xe99f('0x61')]);if(fs['existsSync'](_0x270d86)){_0x5804fc[_0xe99f('0x5d')][_0xe99f('0x9f')]({'name':_0x523161[_0xe99f('0x29')],'contentType':_0x523161[_0xe99f('0x2d')],'data':fs[_0xe99f('0xa0')](_0x270d86)});}}}emlformat['build'](_0x5804fc,function(_0x51f7c7,_0x120722){if(_0x51f7c7)return _0x5855f0(_0x51f7c7);fs['writeFileSync'](path[_0xe99f('0x5e')](_0x311b58,_0x184594),_0x120722);return _0x47aa03(_0x120722);});});}})['then'](function(_0x2ad5b5){if(_0x2ad5b5){return _0x2e46a1['download'](path['join'](_0x311b58,_0x184594),_0x184594,function(_0x50766f){if(!_0x50766f)fs[_0xe99f('0xa1')](path[_0xe99f('0x5e')](_0x311b58,_0x184594));});}})[_0xe99f('0x41')](handleError(_0x2e46a1,null));}; \ No newline at end of file +var _0x79ff=['MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','MailMessage,\x20%s,\x20%s','message','result','status','json','offset','limit','undefined','count','set','Content-Range','update','destroy','stack','name','send','index','MailMessage','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','options','show','params','includeAll','include','find','catch','body','describe','create','direction','secret','split','MailAccount','CmList','List','updatedAt','MailServerOut','Smtp','isNil','service','host','port','secure','authentication','user','pass','attachments','join','root','server/files/attachments','basename','Contacts','CmContact','ListId','List\x20not\x20found','SendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','readAt','UserId','agent','get','MailInteraction','read1stAt','interaction','info','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','email','internal','interface','SIP/%s','channel','motionChannel','event','fromString','EventManager','role','RejectMessage','rejectMessage','Sequelize','fullname','reject','rejectmessage','download','unix','toString','server','files','from','bcc','subject','Attachments','decode','headers','Bcc','existsSync','build','writeFileSync','unlinkSync','eml-format','moment','bluebird','util','path','html-to-text','../../components/parsers/qs','../../config/logger','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','./mailMessage.socket','register','jayson/promise','client','http','request','then','request\x20sent','debug'];(function(_0x298054,_0x6144fe){var _0x250552=function(_0x2fa3b2){while(--_0x2fa3b2){_0x298054['push'](_0x298054['shift']());}};_0x250552(++_0x6144fe);}(_0x79ff,0x87));var _0xf79f=function(_0x27beea,_0x3bc9f4){_0x27beea=_0x27beea-0x0;var _0x122645=_0x79ff[_0x27beea];return _0x122645;};'use strict';var emlformat=require(_0xf79f('0x0'));var moment=require(_0xf79f('0x1'));var BPromise=require(_0xf79f('0x2'));var util=require(_0xf79f('0x3'));var path=require(_0xf79f('0x4'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var htmlToText=require(_0xf79f('0x5'));var qs=require(_0xf79f('0x6'));var logger=require('../../config/logger')('api');var interaction_log=require(_0xf79f('0x7'))(_0xf79f('0x8'));var config=require(_0xf79f('0x9'));var db=require(_0xf79f('0xa'))['db'];config[_0xf79f('0xb')]=_[_0xf79f('0xc')](config[_0xf79f('0xb')],{'host':_0xf79f('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf79f('0xb')]));var htmlEntities=require('html-entities');require(_0xf79f('0xe'))[_0xf79f('0xf')](socket);var jayson=require(_0xf79f('0x10'));var client=jayson[_0xf79f('0x11')][_0xf79f('0x12')]({'port':0x232c});var client9003=jayson['client'][_0xf79f('0x12')]({'port':0x232b});var client9002=jayson[_0xf79f('0x11')][_0xf79f('0x12')]({'port':0x232a});function respondWithRpcPromise(_0x89b10a,_0xb689d6,_0x920097,_0x3ac08e){return new BPromise(function(_0x3f60d6,_0x2d54d8){var _0x48e107=_0x3ac08e||client;return _0x48e107[_0xf79f('0x13')](_0x89b10a,_0x920097)[_0xf79f('0x14')](function(_0x180115){logger['info']('MailMessage,\x20%s,\x20%s',_0xb689d6,_0xf79f('0x15'));logger[_0xf79f('0x16')](_0xf79f('0x17'),_0xb689d6,_0xf79f('0x15'),JSON[_0xf79f('0x18')](_0x180115));if(_0x180115[_0xf79f('0x19')]){if(_0x180115['error'][_0xf79f('0x1a')]===0x1f4){logger[_0xf79f('0x19')](_0xf79f('0x1b'),_0xb689d6,_0x180115[_0xf79f('0x19')]['message']);return _0x2d54d8(_0x180115[_0xf79f('0x19')][_0xf79f('0x1c')]);}logger['error']('MailMessage,\x20%s,\x20%s',_0xb689d6,_0x180115[_0xf79f('0x19')][_0xf79f('0x1c')]);return _0x3f60d6(_0x180115['error'][_0xf79f('0x1c')]);}else{logger['info'](_0xf79f('0x1b'),_0xb689d6,_0xf79f('0x15'));_0x3f60d6(_0x180115[_0xf79f('0x1d')][_0xf79f('0x1c')]);}})['catch'](function(_0x165f2d){logger[_0xf79f('0x19')](_0xf79f('0x1b'),_0xb689d6,_0x165f2d);_0x2d54d8(_0x165f2d);});});}function respondWithResult(_0xe7d25b,_0x5d11c4){_0x5d11c4=_0x5d11c4||0xc8;return function(_0xe441c4){if(_0xe441c4){return _0xe7d25b[_0xf79f('0x1e')](_0x5d11c4)[_0xf79f('0x1f')](_0xe441c4);}};}function respondWithFilteredResult(_0x38527f,_0x1dc15b){return function(_0xbdace3){if(_0xbdace3){var _0x51c3d5=typeof _0x1dc15b[_0xf79f('0x20')]==='undefined'&&typeof _0x1dc15b[_0xf79f('0x21')]===_0xf79f('0x22');var _0x55e91a=_0xbdace3[_0xf79f('0x23')];var _0x3c1be1=_0x51c3d5?0x0:_0x1dc15b[_0xf79f('0x20')];var _0x43ee85=_0x51c3d5?_0xbdace3[_0xf79f('0x23')]:_0x1dc15b['offset']+_0x1dc15b[_0xf79f('0x21')];var _0x3248b5;if(_0x43ee85>=_0x55e91a){_0x43ee85=_0x55e91a;_0x3248b5=0xc8;}else{_0x3248b5=0xce;}_0x38527f[_0xf79f('0x1e')](_0x3248b5);return _0x38527f[_0xf79f('0x24')](_0xf79f('0x25'),_0x3c1be1+'-'+_0x43ee85+'/'+_0x55e91a)[_0xf79f('0x1f')](_0xbdace3);}return null;};}function saveUpdates(_0x672a93){return function(_0x45e4b4){if(_0x45e4b4){return _0x45e4b4[_0xf79f('0x26')](_0x672a93)[_0xf79f('0x14')](function(_0xc7835e){return _0xc7835e;});}return null;};}function removeEntity(_0x1ab92a){return function(_0xb13329){if(_0xb13329){return _0xb13329[_0xf79f('0x27')]()['then'](function(){_0x1ab92a[_0xf79f('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29cfb2){return function(_0x5a360f){if(!_0x5a360f){_0x29cfb2['sendStatus'](0x194);}return _0x5a360f;};}function handleError(_0x1f3c5c,_0x336c52){_0x336c52=_0x336c52||0x1f4;return function(_0x94c7e1){logger[_0xf79f('0x19')](_0x94c7e1[_0xf79f('0x28')]);if(_0x94c7e1[_0xf79f('0x29')]){delete _0x94c7e1[_0xf79f('0x29')];}_0x1f3c5c[_0xf79f('0x1e')](_0x336c52)[_0xf79f('0x2a')](_0x94c7e1);};}exports[_0xf79f('0x2b')]=function(_0x345259,_0xfcb51b){var _0x3b9e9b={},_0x5ee664={},_0x39a577={'count':0x0,'rows':[]};var _0x2add12=_['map'](db[_0xf79f('0x2c')]['rawAttributes'],function(_0x315749){return{'name':_0x315749[_0xf79f('0x2d')],'type':_0x315749[_0xf79f('0x2e')][_0xf79f('0x2f')]};});_0x5ee664[_0xf79f('0x30')]=_[_0xf79f('0x31')](_0x2add12,'name');_0x5ee664[_0xf79f('0x32')]=_[_0xf79f('0x33')](_0x345259[_0xf79f('0x32')]);_0x5ee664['filters']=_[_0xf79f('0x34')](_0x5ee664[_0xf79f('0x30')],_0x5ee664[_0xf79f('0x32')]);_0x3b9e9b[_0xf79f('0x35')]=_[_0xf79f('0x34')](_0x5ee664[_0xf79f('0x30')],qs[_0xf79f('0x36')](_0x345259['query'][_0xf79f('0x36')]));_0x3b9e9b[_0xf79f('0x35')]=_0x3b9e9b['attributes'][_0xf79f('0x37')]?_0x3b9e9b[_0xf79f('0x35')]:_0x5ee664[_0xf79f('0x30')];if(!_0x345259[_0xf79f('0x32')][_0xf79f('0x38')](_0xf79f('0x39'))){_0x3b9e9b['limit']=qs['limit'](_0x345259[_0xf79f('0x32')][_0xf79f('0x21')]);_0x3b9e9b[_0xf79f('0x20')]=qs[_0xf79f('0x20')](_0x345259[_0xf79f('0x32')][_0xf79f('0x20')]);}_0x3b9e9b[_0xf79f('0x3a')]=qs['sort'](_0x345259[_0xf79f('0x32')][_0xf79f('0x3b')]);_0x3b9e9b[_0xf79f('0x3c')]=qs['filters'](_[_0xf79f('0x3d')](_0x345259[_0xf79f('0x32')],_0x5ee664[_0xf79f('0x3e')]),_0x2add12);if(_0x345259[_0xf79f('0x32')][_0xf79f('0x3f')]){_0x3b9e9b[_0xf79f('0x3c')]=_[_0xf79f('0x40')](_0x3b9e9b['where'],{'$or':_[_0xf79f('0x31')](_0x2add12,function(_0x4fd612){if(_0x4fd612[_0xf79f('0x2e')]!=='VIRTUAL'){var _0x5665a4={};_0x5665a4[_0x4fd612[_0xf79f('0x29')]]={'$like':'%'+_0x345259['query'][_0xf79f('0x3f')]+'%'};return _0x5665a4;}})});}_0x3b9e9b=_[_0xf79f('0x40')]({},_0x3b9e9b,_0x345259[_0xf79f('0x41')]);var _0x53443e={'where':_0x3b9e9b[_0xf79f('0x3c')]};return db['MailMessage'][_0xf79f('0x23')](_0x53443e)[_0xf79f('0x14')](function(_0x503061){_0x39a577[_0xf79f('0x23')]=_0x503061;if(_0x345259[_0xf79f('0x32')]['includeAll']){_0x3b9e9b['include']=[{'all':!![]}];}return db[_0xf79f('0x2c')]['findAll'](_0x3b9e9b);})[_0xf79f('0x14')](function(_0x381417){_0x39a577['rows']=_0x381417;return _0x39a577;})[_0xf79f('0x14')](respondWithFilteredResult(_0xfcb51b,_0x3b9e9b))['catch'](handleError(_0xfcb51b,null));};exports[_0xf79f('0x42')]=function(_0x44b1a0,_0x1462e6){var _0x265673={'raw':!![],'where':{'id':_0x44b1a0[_0xf79f('0x43')]['id']}},_0x35dd9d={};_0x35dd9d[_0xf79f('0x30')]=_[_0xf79f('0x33')](db[_0xf79f('0x2c')]['rawAttributes']);_0x35dd9d['query']=_[_0xf79f('0x33')](_0x44b1a0['query']);_0x35dd9d[_0xf79f('0x3e')]=_[_0xf79f('0x34')](_0x35dd9d['model'],_0x35dd9d['query']);_0x265673[_0xf79f('0x35')]=_[_0xf79f('0x34')](_0x35dd9d[_0xf79f('0x30')],qs['fields'](_0x44b1a0[_0xf79f('0x32')][_0xf79f('0x36')]));_0x265673[_0xf79f('0x35')]=_0x265673[_0xf79f('0x35')][_0xf79f('0x37')]?_0x265673[_0xf79f('0x35')]:_0x35dd9d[_0xf79f('0x30')];if(_0x44b1a0[_0xf79f('0x32')][_0xf79f('0x44')]){_0x265673[_0xf79f('0x45')]=[{'all':!![]}];}_0x265673=_[_0xf79f('0x40')]({},_0x265673,_0x44b1a0[_0xf79f('0x41')]);return db[_0xf79f('0x2c')][_0xf79f('0x46')](_0x265673)[_0xf79f('0x14')](handleEntityNotFound(_0x1462e6,null))[_0xf79f('0x14')](respondWithResult(_0x1462e6,null))[_0xf79f('0x47')](handleError(_0x1462e6,null));};exports[_0xf79f('0x26')]=function(_0x19e40f,_0x100554){if(_0x19e40f[_0xf79f('0x48')]['id']){delete _0x19e40f['body']['id'];}return db[_0xf79f('0x2c')][_0xf79f('0x46')]({'where':{'id':_0x19e40f[_0xf79f('0x43')]['id']}})['then'](handleEntityNotFound(_0x100554,null))[_0xf79f('0x14')](saveUpdates(_0x19e40f[_0xf79f('0x48')],null))['then'](respondWithResult(_0x100554,null))[_0xf79f('0x47')](handleError(_0x100554,null));};exports['destroy']=function(_0x5aaa78,_0x3e7792){return db['MailMessage'][_0xf79f('0x46')]({'where':{'id':_0x5aaa78[_0xf79f('0x43')]['id']}})[_0xf79f('0x14')](handleEntityNotFound(_0x3e7792,null))[_0xf79f('0x14')](removeEntity(_0x3e7792,null))[_0xf79f('0x47')](handleError(_0x3e7792,null));};exports[_0xf79f('0x49')]=function(_0x5f04d5,_0x2d2cf2){return db[_0xf79f('0x2c')]['describe']()[_0xf79f('0x14')](respondWithResult(_0x2d2cf2,null))['catch'](handleError(_0x2d2cf2,null));};exports[_0xf79f('0x4a')]=function(_0x5ea299,_0x30a2e2){return db['MailMessage'][_0xf79f('0x4a')](_0x5ea299['body'])[_0xf79f('0x14')](function(_0x5b34a8){if(_0x5b34a8){if(_0x5b34a8[_0xf79f('0x4b')]==='out'&&!_0x5b34a8[_0xf79f('0x4c')]){var _0x391cbe,_0xca15f7,_0x543816;if(_0x5ea299[_0xf79f('0x48')]['to']){_0xca15f7=_0x5ea299['body']['to'][_0xf79f('0x4d')](',')[0x0];}return db[_0xf79f('0x4e')]['findOne']({'where':{'id':_0x5b34a8['MailAccountId']},'include':[{'model':db[_0xf79f('0x4f')],'as':_0xf79f('0x50'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'email':_0xca15f7},'limit':0x1,'order':[[_0xf79f('0x51'),'DESC']]}]},{'model':db[_0xf79f('0x52')],'as':_0xf79f('0x53'),'raw':!![]}]})['then'](function(_0xd18f05){_0x391cbe=_0xd18f05;if(_0x391cbe&&_0x391cbe[_0xf79f('0x53')]){var _0x1a871f={'tls':{'rejectUnauthorized':![]}};if(_[_0xf79f('0x54')](_0x391cbe[_0xf79f('0x53')][_0xf79f('0x55')])){_0x1a871f[_0xf79f('0x56')]=_0x391cbe[_0xf79f('0x53')]['host'];_0x1a871f[_0xf79f('0x57')]=_0x391cbe[_0xf79f('0x53')]['port'];_0x1a871f[_0xf79f('0x58')]=_0x391cbe[_0xf79f('0x53')]['secure'];if(_0x391cbe[_0xf79f('0x53')][_0xf79f('0x59')]){_0x1a871f['auth']={'user':_0x391cbe[_0xf79f('0x53')][_0xf79f('0x5a')],'pass':_0x391cbe[_0xf79f('0x53')][_0xf79f('0x5b')]};}}else{_0x1a871f[_0xf79f('0x55')]=_0x391cbe[_0xf79f('0x53')][_0xf79f('0x55')];_0x1a871f['auth']={'user':_0x391cbe[_0xf79f('0x53')]['user'],'pass':_0x391cbe['Smtp'][_0xf79f('0x5b')]};_0x1a871f['secure']=_0x391cbe[_0xf79f('0x53')]['secure'];}if(_0x5ea299[_0xf79f('0x48')][_0xf79f('0x5c')]&&_0x5ea299[_0xf79f('0x48')]['attachments'][_0xf79f('0x37')]){for(var _0x3988cc=0x0;_0x3988cc<_0x5ea299[_0xf79f('0x48')][_0xf79f('0x5c')][_0xf79f('0x37')];_0x3988cc+=0x1){_0x5ea299[_0xf79f('0x48')][_0xf79f('0x5c')][_0x3988cc]={'filename':_0x5ea299[_0xf79f('0x48')][_0xf79f('0x5c')][_0x3988cc]['name'],'path':path[_0xf79f('0x5d')](config[_0xf79f('0x5e')],_0xf79f('0x5f'),_0x5ea299['body'][_0xf79f('0x5c')][_0x3988cc][_0xf79f('0x60')])};}}_0x543816={'account':_0x1a871f,'message':_0x5ea299[_0xf79f('0x48')]};return;}})[_0xf79f('0x14')](function(){if(_0x391cbe[_0xf79f('0x50')]){if(_0x391cbe[_0xf79f('0x50')]['Contacts'][_0xf79f('0x37')]){return _0x391cbe[_0xf79f('0x50')][_0xf79f('0x61')][0x0];}else{return db[_0xf79f('0x62')][_0xf79f('0x4a')](_[_0xf79f('0xc')](_0x5ea299[_0xf79f('0x48')],{'firstName':_0x5ea299[_0xf79f('0x48')]['to'],'email':_0x5ea299[_0xf79f('0x48')]['to'],'phone':_0x5ea299['body']['to'],'ListId':_0x391cbe[_0xf79f('0x63')]}));}}else{throw new Error(_0xf79f('0x64'));}})[_0xf79f('0x14')](function(){if(_0x543816){return respondWithRpcPromise(_0xf79f('0x65'),'sendMail',_0x543816,client9003)[_0xf79f('0x14')](function(_0x210980){return _0x5b34a8[_0xf79f('0x26')]({'read':!![],'messageId':_0x210980[_0xf79f('0x66')],'sentAt':moment()[_0xf79f('0x67')](_0xf79f('0x68'))});})[_0xf79f('0x47')](function(_0xbf43bb){logger[_0xf79f('0x19')]('%s',JSON['stringify'](_0xbf43bb));return _0x5b34a8;});}return _0x5b34a8;});}return _0x5b34a8;}})[_0xf79f('0x14')](respondWithResult(_0x30a2e2,0xc9))[_0xf79f('0x47')](handleError(_0x30a2e2,null));};exports[_0xf79f('0x69')]=function(_0xef4d55,_0x4ae489){var _0x5ea359={'agent':{},'channel':_0xf79f('0x6a')};if(_0xef4d55[_0xf79f('0x48')]['id']){delete _0xef4d55['body']['id'];}_0xef4d55[_0xf79f('0x48')][_0xf79f('0x6b')]=!![];_0xef4d55[_0xf79f('0x48')][_0xf79f('0x6c')]=moment()['format'](_0xf79f('0x68'));_0xef4d55[_0xf79f('0x48')][_0xf79f('0x6d')]=_0xef4d55['body'][_0xf79f('0x6d')]||_0xef4d55[_0xf79f('0x5a')]['id'];_0x5ea359[_0xf79f('0x6e')]['id']=_0xef4d55['body'][_0xf79f('0x6d')];return db['MailMessage'][_0xf79f('0x46')]({'where':{'id':_0xef4d55[_0xf79f('0x43')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4ae489,null))['then'](saveUpdates(_0xef4d55[_0xf79f('0x48')],null))[_0xf79f('0x14')](function(_0x24abf0){if(_0x24abf0){_0x5ea359['message']=_0x24abf0[_0xf79f('0x6f')]({'plain':!![]});return db[_0xf79f('0x70')][_0xf79f('0x46')]({'where':{'id':_0x24abf0['MailInteractionId']}});}return null;})[_0xf79f('0x14')](handleEntityNotFound(_0x4ae489,null))[_0xf79f('0x14')](function(_0x25edfc){if(_0x25edfc){return _0x25edfc['update']({'UserId':_0xef4d55[_0xf79f('0x48')]['UserId'],'read1stAt':_[_0xf79f('0x54')](_0x25edfc[_0xf79f('0x71')])?moment()[_0xf79f('0x67')](_0xf79f('0x68')):undefined});}return null;})[_0xf79f('0x14')](function(_0x4b24a7){if(_0x4b24a7){_0x5ea359[_0xf79f('0x72')]=_0x4b24a7[_0xf79f('0x6f')]({'plain':!![]});interaction_log[_0xf79f('0x73')](_0xf79f('0x74'),_0xef4d55['user']['id'],_0xef4d55['user'][_0xf79f('0x29')],_0xef4d55[_0xf79f('0x5a')]['role'],_0x5ea359['interaction']['id'],_0xef4d55[_0xf79f('0x48')]?JSON['stringify'](_0xef4d55[_0xf79f('0x48')]):_0xf79f('0x75'));return respondWithRpcPromise(_0xf79f('0x76'),'acceptMessage',_0x5ea359);}return null;})['then'](function(_0x404837){var _0x14bd43=_0xf79f('0x77')+_0x404837[_0xf79f('0x1c')][_0xf79f('0x78')];return db[_0xf79f('0x79')][_0xf79f('0x32')](_0x14bd43,{'type':db['Sequelize'][_0xf79f('0x7a')][_0xf79f('0x7b')],'raw':!![]})[_0xf79f('0x14')](function(_0x5d3639){return _0x5d3639;});})[_0xf79f('0x14')](function(_0x206179){if(_0x206179){_0x5ea359[_0xf79f('0x1c')][_0xf79f('0x7c')]=_0x206179[0x0];if(!_0xef4d55[_0xf79f('0x48')][_0xf79f('0x6d')])return;return db[_0xf79f('0x7d')][_0xf79f('0x46')]({'where':{'id':_0xef4d55[_0xf79f('0x48')][_0xf79f('0x6d')],'role':_0xf79f('0x6e')},'attributes':['id',_0xf79f('0x29'),'fullname',_0xf79f('0x7e'),_0xf79f('0x7f')],'raw':!![]});}return null;})[_0xf79f('0x14')](function(_0x204dc6){if(!_0x204dc6)return null;_0x5ea359['message']['agent']=_0x204dc6;return _0x5ea359;})['then'](function(_0x3e9a2d){if(_0x3e9a2d){if(_0xef4d55[_0xf79f('0x48')]['manual']){_0x5ea359[_0xf79f('0x1c')][_0xf79f('0x80')]=util['format'](_0xf79f('0x81'),_0xef4d55[_0xf79f('0x5a')]['name']);_0x5ea359[_0xf79f('0x1c')]['channel']=_0x5ea359[_0xf79f('0x82')];_0x5ea359[_0xf79f('0x1c')][_0xf79f('0x83')]=_0x5ea359[_0xf79f('0x82')];_0x5ea359[_0xf79f('0x1c')][_0xf79f('0x84')]=_0xf79f('0x69');_0x5ea359[_0xf79f('0x1c')]['body']=htmlToText[_0xf79f('0x85')](_0x5ea359[_0xf79f('0x1c')][_0xf79f('0x48')]);return respondWithRpcPromise(_0xf79f('0x86'),_0xf79f('0x86'),{'event':'acceptmessage','message':_0x5ea359[_0xf79f('0x1c')]},client9002)['then'](function(){return _0x5ea359;});}return _0x5ea359;}return null;})['then'](respondWithResult(_0x4ae489,null))['catch'](handleError(_0x4ae489,null));};exports['reject']=function(_0x813cd1,_0x15ec0f){var _0x395c80={'agent':{},'channel':_0xf79f('0x6a')};if(_0x813cd1[_0xf79f('0x48')]['id']){delete _0x813cd1['body']['id'];}_0x813cd1[_0xf79f('0x48')][_0xf79f('0x6d')]=_0x813cd1[_0xf79f('0x48')][_0xf79f('0x6d')]||_0x813cd1[_0xf79f('0x5a')]['id'];_0x395c80[_0xf79f('0x6e')]['id']=_0x813cd1[_0xf79f('0x48')][_0xf79f('0x6d')];return db['MailMessage'][_0xf79f('0x46')]({'where':{'id':_0x813cd1['params']['id'],'UserId':null}})[_0xf79f('0x14')](handleEntityNotFound(_0x15ec0f,null))[_0xf79f('0x14')](function(_0x8a1a69){if(_0x8a1a69){_0x395c80[_0xf79f('0x1c')]=_0x8a1a69[_0xf79f('0x6f')]({'plain':!![]});return db[_0xf79f('0x70')][_0xf79f('0x46')]({'where':{'id':_0x8a1a69['MailInteractionId']}});}return null;})[_0xf79f('0x14')](handleEntityNotFound(_0x15ec0f,null))['then'](function(_0x188261){if(_0x188261){_0x395c80[_0xf79f('0x72')]=_0x188261[_0xf79f('0x6f')]({'plain':!![]});interaction_log[_0xf79f('0x73')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x813cd1[_0xf79f('0x5a')]['id'],_0x813cd1[_0xf79f('0x5a')][_0xf79f('0x29')],_0x813cd1[_0xf79f('0x5a')][_0xf79f('0x87')],_0x395c80['interaction']['id'],_0x813cd1[_0xf79f('0x48')]?JSON[_0xf79f('0x18')](_0x813cd1['body']):_0xf79f('0x75'));return respondWithRpcPromise(_0xf79f('0x88'),_0xf79f('0x89'),_0x395c80);}return null;})[_0xf79f('0x14')](function(_0x17a05e){var _0x42a1ec='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x17a05e[_0xf79f('0x1c')][_0xf79f('0x78')];return db[_0xf79f('0x79')][_0xf79f('0x32')](_0x42a1ec,{'type':db[_0xf79f('0x8a')][_0xf79f('0x7a')][_0xf79f('0x7b')],'raw':!![]})[_0xf79f('0x14')](function(_0x2fd4a4){return _0x2fd4a4;});})['then'](function(_0x514b23){if(_0x514b23){_0x395c80[_0xf79f('0x1c')][_0xf79f('0x7c')]=_0x514b23[0x0];if(!_0x813cd1[_0xf79f('0x48')][_0xf79f('0x6d')])return;return db[_0xf79f('0x7d')][_0xf79f('0x46')]({'where':{'id':_0x813cd1[_0xf79f('0x48')][_0xf79f('0x6d')],'role':_0xf79f('0x6e')},'attributes':['id','name',_0xf79f('0x8b'),_0xf79f('0x7e'),_0xf79f('0x7f')],'raw':!![]});}return null;})[_0xf79f('0x14')](function(_0x3bf82e){if(!_0x3bf82e)return null;_0x395c80['message'][_0xf79f('0x6e')]=_0x3bf82e;return _0x395c80;})['then'](function(_0x12d129){if(_0x12d129){_0x12d129[_0xf79f('0x1c')][_0xf79f('0x80')]=util[_0xf79f('0x67')](_0xf79f('0x81'),_0x813cd1['user'][_0xf79f('0x29')]);_0x12d129[_0xf79f('0x1c')][_0xf79f('0x82')]=_0x395c80[_0xf79f('0x82')];_0x12d129['message'][_0xf79f('0x83')]=_0x395c80[_0xf79f('0x82')];_0x12d129['message'][_0xf79f('0x84')]=_0xf79f('0x8c');_0x12d129[_0xf79f('0x1c')][_0xf79f('0x48')]=htmlToText[_0xf79f('0x85')](_0x395c80[_0xf79f('0x1c')]['body']);respondWithRpcPromise(_0xf79f('0x86'),_0xf79f('0x86'),{'event':_0xf79f('0x8d'),'message':_0x12d129[_0xf79f('0x1c')]},client9002);return _0x395c80;}return null;})[_0xf79f('0x14')](respondWithResult(_0x15ec0f,null))[_0xf79f('0x47')](handleError(_0x15ec0f,null));};exports[_0xf79f('0x8e')]=function(_0xe1f8e2,_0x36d386){var _0x48326b=moment()[_0xf79f('0x8f')]()[_0xf79f('0x90')]();var _0x24ee7b=path['join'](config[_0xf79f('0x5e')],_0xf79f('0x91'),_0xf79f('0x92'),'tmp');var _0x26dfd5=path[_0xf79f('0x5d')](config[_0xf79f('0x5e')],_0xf79f('0x91'),_0xf79f('0x92'),'attachments');var _0x5962e=util[_0xf79f('0x67')]('message-%s.eml',_0x48326b);return db[_0xf79f('0x2c')][_0xf79f('0x46')]({'where':{'id':_0xe1f8e2[_0xf79f('0x43')]['id']},'attributes':['id',_0xf79f('0x48'),_0xf79f('0x93'),'to','cc',_0xf79f('0x94'),_0xf79f('0x95'),'createdAt'],'include':_0xe1f8e2['query'][_0xf79f('0x5c')]?[{'model':db['Attachment'],'as':_0xf79f('0x96')}]:undefined})[_0xf79f('0x14')](handleEntityNotFound(_0x36d386,null))['then'](function(_0xc7855e){if(_0xc7855e){var _0xcb7145=_0xc7855e;var _0x369ab3={'from':_0xcb7145[_0xf79f('0x93')],'to':_0xcb7145['to'],'subject':_0xcb7145[_0xf79f('0x95')],'html':htmlEntities[_0xf79f('0x97')](_0xcb7145[_0xf79f('0x48')]),'headers':{'Date':moment(_0xcb7145['createdAt'])[_0xf79f('0x67')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0xc7855e['cc']){_0x369ab3[_0xf79f('0x98')]['Cc']=_0xc7855e['cc'];}if(_0xc7855e[_0xf79f('0x94')]){_0x369ab3[_0xf79f('0x98')][_0xf79f('0x99')]=_0xc7855e[_0xf79f('0x94')];}return new BPromise(function(_0x27a68f,_0x1ff1ba){if(_0xc7855e['Attachments']){for(var _0x537c7a=0x0;_0x537c7a<_0xc7855e[_0xf79f('0x96')][_0xf79f('0x37')];_0x537c7a++){var _0xc058ce=_0xc7855e[_0xf79f('0x96')][_0x537c7a];var _0x118014=path[_0xf79f('0x5d')](_0x26dfd5,_0xc058ce[_0xf79f('0x60')]);if(fs[_0xf79f('0x9a')](_0x118014)){_0x369ab3['attachments']['push']({'name':_0xc058ce['name'],'contentType':_0xc058ce[_0xf79f('0x2e')],'data':fs['readFileSync'](_0x118014)});}}}emlformat[_0xf79f('0x9b')](_0x369ab3,function(_0x5ce2cf,_0x4febd6){if(_0x5ce2cf)return _0x1ff1ba(_0x5ce2cf);fs[_0xf79f('0x9c')](path[_0xf79f('0x5d')](_0x24ee7b,_0x5962e),_0x4febd6);return _0x27a68f(_0x4febd6);});});}})[_0xf79f('0x14')](function(_0x2f5d9c){if(_0x2f5d9c){return _0x36d386[_0xf79f('0x8e')](path['join'](_0x24ee7b,_0x5962e),_0x5962e,function(_0x5408eb){if(!_0x5408eb)fs[_0xf79f('0x9d')](path[_0xf79f('0x5d')](_0x24ee7b,_0x5962e));});}})[_0xf79f('0x47')](handleError(_0x36d386,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index e317fc1..1a554aa 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 _0x9b5f=['update','remove','emit','hook','exports','events','../../mysqldb','MailMessage','setMaxListeners','save'];(function(_0xb1f3f3,_0x290877){var _0x4031a6=function(_0x35c4df){while(--_0x35c4df){_0xb1f3f3['push'](_0xb1f3f3['shift']());}};_0x4031a6(++_0x290877);}(_0x9b5f,0x1d1));var _0xf9b5=function(_0x4bffb6,_0x15fb8e){_0x4bffb6=_0x4bffb6-0x0;var _0x1a44f3=_0x9b5f[_0x4bffb6];return _0x1a44f3;};'use strict';var EventEmitter=require(_0xf9b5('0x0'));var MailMessage=require(_0xf9b5('0x1'))['db'][_0xf9b5('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xf9b5('0x3')](0x0);var events={'afterCreate':_0xf9b5('0x4'),'afterUpdate':_0xf9b5('0x5'),'afterDestroy':_0xf9b5('0x6')};function emitEvent(_0xf56a4b){return function(_0x5ef48b,_0x3b1a41,_0x4c3898){MailMessageEvents[_0xf9b5('0x7')](_0xf56a4b+':'+_0x5ef48b['id'],_0x5ef48b);MailMessageEvents['emit'](_0xf56a4b,_0x5ef48b);_0x4c3898(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0xf9b5('0x8')](e,emitEvent(event));}}module[_0xf9b5('0x9')]=MailMessageEvents; \ No newline at end of file +var _0x7092=['hook','exports','events','../../mysqldb','MailMessage','setMaxListeners','save','update','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7092,0xbf));var _0x2709=function(_0x45190b,_0x3c50c1){_0x45190b=_0x45190b-0x0;var _0x5d840a=_0x7092[_0x45190b];return _0x5d840a;};'use strict';var EventEmitter=require(_0x2709('0x0'));var MailMessage=require(_0x2709('0x1'))['db'][_0x2709('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x2709('0x3')](0x0);var events={'afterCreate':_0x2709('0x4'),'afterUpdate':_0x2709('0x5'),'afterDestroy':'remove'};function emitEvent(_0x13bb18){return function(_0x1b9184,_0x14089d,_0x1c9982){MailMessageEvents[_0x2709('0x6')](_0x13bb18+':'+_0x1b9184['id'],_0x1b9184);MailMessageEvents[_0x2709('0x6')](_0x13bb18,_0x1b9184);_0x1c9982(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0x2709('0x7')](e,emitEvent(event));}}module[_0x2709('0x8')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 00dd277..efb2cc5 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 _0xfeb7=['MailInteraction','findOne','MailInteractionId','then','update','createdAt','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','html-to-text','path','rimraf','./mailMessage.attributes','exports','MailMessage','messageId','fti_mail_messages','plainBody','FULLTEXT','body','models','toLowerCase','direction','out','secret','isNil','UserId'];(function(_0x5a0f4e,_0x5e81a6){var _0x277098=function(_0x3c361f){while(--_0x3c361f){_0x5a0f4e['push'](_0x5a0f4e['shift']());}};_0x277098(++_0x5e81a6);}(_0xfeb7,0x6b));var _0x7feb=function(_0x31543d,_0xfe63c9){_0x31543d=_0x31543d-0x0;var _0x979c33=_0xfeb7[_0x31543d];return _0x979c33;};'use strict';var _=require(_0x7feb('0x0'));var util=require(_0x7feb('0x1'));var logger=require(_0x7feb('0x2'))(_0x7feb('0x3'));var moment=require(_0x7feb('0x4'));var BPromise=require(_0x7feb('0x5'));var rp=require(_0x7feb('0x6'));var htmlToText=require(_0x7feb('0x7'));var fs=require('fs');var path=require(_0x7feb('0x8'));var rimraf=require(_0x7feb('0x9'));var config=require('../../config/environment');var attributes=require(_0x7feb('0xa'));module[_0x7feb('0xb')]=function(_0x3d8537,_0x2b10bb){return _0x3d8537['define'](_0x7feb('0xc'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0x7feb('0xd'),'fields':[_0x7feb('0xd')]},{'name':_0x7feb('0xe'),'fields':[_0x7feb('0xf'),'subject'],'type':_0x7feb('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4ec763,_0x4184fc,_0x3749f8){if(_0x4ec763[_0x7feb('0x11')]){_0x4ec763[_0x7feb('0xf')]=htmlToText['fromString'](_0x4ec763[_0x7feb('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x3749f8(null,_0x4184fc);},'afterCreate':function(_0x58f2a8,_0x167eef,_0x5c8591){var _0xcd1e8c=_0x3d8537[_0x7feb('0x12')];var _0x2d6d23=_0x58f2a8['get']({'plain':!![]});if(_0x2d6d23['direction'][_0x7feb('0x13')]()==='in'||_0x2d6d23[_0x7feb('0x14')][_0x7feb('0x13')]()===_0x7feb('0x15')&&!_0x2d6d23[_0x7feb('0x16')]&&!_[_0x7feb('0x17')](_0x2d6d23[_0x7feb('0x18')])){_0xcd1e8c[_0x7feb('0x19')][_0x7feb('0x1a')]({'where':{'id':_0x2d6d23[_0x7feb('0x1b')]}})[_0x7feb('0x1c')](function(_0x5f205f){if(_0x5f205f){_0x5f205f[_0x7feb('0x1d')]({'lastMsgAt':_0x2d6d23[_0x7feb('0x1e')],'lastMsgDirection':_0x2d6d23[_0x7feb('0x14')][_0x7feb('0x13')]()});}})['catch'](function(_0x392509){console['error'](_0x392509);});}_0x5c8591();}},'charset':_0x7feb('0x1f'),'collate':_0x7feb('0x20')});}; \ No newline at end of file +var _0x259d=['MailInteraction','MailInteractionId','then','createdAt','toLowerCase','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','bluebird','html-to-text','path','rimraf','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','body','fromString','models','get','secret','isNil','UserId'];(function(_0x4f8a6b,_0x304a9c){var _0x477b4a=function(_0x280771){while(--_0x280771){_0x4f8a6b['push'](_0x4f8a6b['shift']());}};_0x477b4a(++_0x304a9c);}(_0x259d,0xd3));var _0xd259=function(_0x344724,_0x3c17a9){_0x344724=_0x344724-0x0;var _0x59c303=_0x259d[_0x344724];return _0x59c303;};'use strict';var _=require(_0xd259('0x0'));var util=require(_0xd259('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xd259('0x2'));var rp=require('request-promise');var htmlToText=require(_0xd259('0x3'));var fs=require('fs');var path=require(_0xd259('0x4'));var rimraf=require(_0xd259('0x5'));var config=require('../../config/environment');var attributes=require(_0xd259('0x6'));module[_0xd259('0x7')]=function(_0x96c415,_0x580de9){return _0x96c415[_0xd259('0x8')](_0xd259('0x9'),attributes,{'tableName':_0xd259('0xa'),'paranoid':![],'indexes':[{'name':_0xd259('0xb'),'fields':[_0xd259('0xb')]},{'name':_0xd259('0xc'),'fields':[_0xd259('0xd'),'subject'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x807942,_0x33d9ad,_0x2e036d){if(_0x807942[_0xd259('0xe')]){_0x807942['plainBody']=htmlToText[_0xd259('0xf')](_0x807942['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x2e036d(null,_0x33d9ad);},'afterCreate':function(_0x3cbeb5,_0x5e02c8,_0x139435){var _0x256214=_0x96c415[_0xd259('0x10')];var _0x543c1a=_0x3cbeb5[_0xd259('0x11')]({'plain':!![]});if(_0x543c1a['direction']['toLowerCase']()==='in'||_0x543c1a['direction']['toLowerCase']()==='out'&&!_0x543c1a[_0xd259('0x12')]&&!_[_0xd259('0x13')](_0x543c1a[_0xd259('0x14')])){_0x256214[_0xd259('0x15')]['findOne']({'where':{'id':_0x543c1a[_0xd259('0x16')]}})[_0xd259('0x17')](function(_0x1ca614){if(_0x1ca614){_0x1ca614['update']({'lastMsgAt':_0x543c1a[_0xd259('0x18')],'lastMsgDirection':_0x543c1a['direction'][_0xd259('0x19')]()});}})['catch'](function(_0x11b93b){console[_0xd259('0x1a')](_0x11b93b);});}_0x139435();}},'charset':_0xd259('0x1b'),'collate':_0xd259('0x1c')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index c507e53..de6680b 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 _0x93e9=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./mailMessage.socket','register','request','info','request\x20sent','stringify','error','code','MailMessage,\x20%s,\x20%s','message','result','catch','CreateMailMessage','MailMessage','create','options','raw','then','debug'];(function(_0x26ec0e,_0x55d2e3){var _0x4da538=function(_0x2aecf0){while(--_0x2aecf0){_0x26ec0e['push'](_0x26ec0e['shift']());}};_0x4da538(++_0x55d2e3);}(_0x93e9,0xcc));var _0x993e=function(_0x4c4e09,_0x2749fe){_0x4c4e09=_0x4c4e09-0x0;var _0x97a3b5=_0x93e9[_0x4c4e09];return _0x97a3b5;};'use strict';var _=require(_0x993e('0x0'));var util=require(_0x993e('0x1'));var moment=require(_0x993e('0x2'));var BPromise=require(_0x993e('0x3'));var rs=require(_0x993e('0x4'));var fs=require('fs');var Redis=require(_0x993e('0x5'));var db=require(_0x993e('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x993e('0x7'));var config=require(_0x993e('0x8'));var jayson=require(_0x993e('0x9'));var client=jayson[_0x993e('0xa')][_0x993e('0xb')]({'port':0x232a});config[_0x993e('0xc')]=_[_0x993e('0xd')](config[_0x993e('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x993e('0xe'))(new Redis(config[_0x993e('0xc')]));require(_0x993e('0xf'))[_0x993e('0x10')](socket);function respondWithRpcPromise(_0x2cd389,_0x27a28f,_0x1c2324){return new BPromise(function(_0x48291a,_0x196f6d){return client[_0x993e('0x11')](_0x2cd389,_0x1c2324)['then'](function(_0x5ebc8c){logger[_0x993e('0x12')]('MailMessage,\x20%s,\x20%s',_0x27a28f,_0x993e('0x13'));logger['debug']('MailMessage,\x20%s,\x20%s,\x20%s',_0x27a28f,_0x993e('0x13'),JSON[_0x993e('0x14')](_0x5ebc8c));if(_0x5ebc8c[_0x993e('0x15')]){if(_0x5ebc8c[_0x993e('0x15')][_0x993e('0x16')]===0x1f4){logger[_0x993e('0x15')](_0x993e('0x17'),_0x27a28f,_0x5ebc8c[_0x993e('0x15')][_0x993e('0x18')]);return _0x196f6d(_0x5ebc8c[_0x993e('0x15')][_0x993e('0x18')]);}logger[_0x993e('0x15')](_0x993e('0x17'),_0x27a28f,_0x5ebc8c[_0x993e('0x15')][_0x993e('0x18')]);return _0x48291a(_0x5ebc8c[_0x993e('0x15')][_0x993e('0x18')]);}else{logger['info'](_0x993e('0x17'),_0x27a28f,_0x993e('0x13'));_0x48291a(_0x5ebc8c[_0x993e('0x19')][_0x993e('0x18')]);}})[_0x993e('0x1a')](function(_0x3eda77){logger['error'](_0x993e('0x17'),_0x27a28f,_0x3eda77);_0x196f6d(_0x3eda77);});});}exports[_0x993e('0x1b')]=function(_0x1eaf57){var _0x22390e=this;return new Promise(function(_0x130a8a,_0x425ab4){return db[_0x993e('0x1c')][_0x993e('0x1d')](_0x1eaf57['body'],{'raw':_0x1eaf57[_0x993e('0x1e')]?_0x1eaf57['options'][_0x993e('0x1f')]===undefined?!![]:![]:!![]})[_0x993e('0x20')](function(_0x32b09e){logger['info'](_0x993e('0x1b'),_0x1eaf57);logger[_0x993e('0x21')](_0x993e('0x1b'),_0x1eaf57,JSON[_0x993e('0x14')](_0x32b09e));_0x130a8a(_0x32b09e);})[_0x993e('0x1a')](function(_0x328d22){logger[_0x993e('0x15')](_0x993e('0x1b'),_0x328d22[_0x993e('0x18')],_0x1eaf57);_0x425ab4(_0x22390e[_0x993e('0x15')](0x1f4,_0x328d22[_0x993e('0x18')]));});});}; \ No newline at end of file +var _0xd824=['request\x20sent','stringify','error','code','message','MailMessage,\x20%s,\x20%s','result','CreateMailMessage','MailMessage','create','body','options','raw','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','defaults','redis','localhost','then','info','debug','MailMessage,\x20%s,\x20%s,\x20%s'];(function(_0x32b5ca,_0x43e981){var _0x3ca5ab=function(_0x46bd8d){while(--_0x46bd8d){_0x32b5ca['push'](_0x32b5ca['shift']());}};_0x3ca5ab(++_0x43e981);}(_0xd824,0xc2));var _0x4d82=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xd824[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x4d82('0x0'));var util=require(_0x4d82('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4d82('0x2'));var fs=require('fs');var Redis=require(_0x4d82('0x3'));var db=require(_0x4d82('0x4'))['db'];var utils=require(_0x4d82('0x5'));var logger=require(_0x4d82('0x6'))(_0x4d82('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4d82('0x8')]['http']({'port':0x232a});config['redis']=_[_0x4d82('0x9')](config[_0x4d82('0xa')],{'host':_0x4d82('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4d82('0xa')]));require('./mailMessage.socket')['register'](socket);function respondWithRpcPromise(_0x580bbd,_0x27b777,_0x392f17){return new BPromise(function(_0x480c05,_0x318d1d){return client['request'](_0x580bbd,_0x392f17)[_0x4d82('0xc')](function(_0x303645){logger[_0x4d82('0xd')]('MailMessage,\x20%s,\x20%s',_0x27b777,'request\x20sent');logger[_0x4d82('0xe')](_0x4d82('0xf'),_0x27b777,_0x4d82('0x10'),JSON[_0x4d82('0x11')](_0x303645));if(_0x303645['error']){if(_0x303645[_0x4d82('0x12')][_0x4d82('0x13')]===0x1f4){logger[_0x4d82('0x12')]('MailMessage,\x20%s,\x20%s',_0x27b777,_0x303645[_0x4d82('0x12')]['message']);return _0x318d1d(_0x303645[_0x4d82('0x12')]['message']);}logger[_0x4d82('0x12')]('MailMessage,\x20%s,\x20%s',_0x27b777,_0x303645[_0x4d82('0x12')][_0x4d82('0x14')]);return _0x480c05(_0x303645[_0x4d82('0x12')][_0x4d82('0x14')]);}else{logger[_0x4d82('0xd')](_0x4d82('0x15'),_0x27b777,_0x4d82('0x10'));_0x480c05(_0x303645[_0x4d82('0x16')][_0x4d82('0x14')]);}})['catch'](function(_0x2919b0){logger[_0x4d82('0x12')](_0x4d82('0x15'),_0x27b777,_0x2919b0);_0x318d1d(_0x2919b0);});});}exports[_0x4d82('0x17')]=function(_0xe6260){var _0xd5f47=this;return new Promise(function(_0x1a513d,_0x64669c){return db[_0x4d82('0x18')][_0x4d82('0x19')](_0xe6260[_0x4d82('0x1a')],{'raw':_0xe6260['options']?_0xe6260[_0x4d82('0x1b')][_0x4d82('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x1a419f){logger[_0x4d82('0xd')](_0x4d82('0x17'),_0xe6260);logger[_0x4d82('0xe')](_0x4d82('0x17'),_0xe6260,JSON[_0x4d82('0x11')](_0x1a419f));_0x1a513d(_0x1a419f);})[_0x4d82('0x1d')](function(_0x462258){logger[_0x4d82('0x12')](_0x4d82('0x17'),_0x462258[_0x4d82('0x14')],_0xe6260);_0x64669c(_0xd5f47[_0x4d82('0x12')](0x1f4,_0x462258[_0x4d82('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 7e5bc24..820af4a 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 _0x63a9=['register','length','mailMessage:','./mailMessage.events','update','removeListener'];(function(_0xab9a2,_0x3fc7f0){var _0x5ba8a6=function(_0x43c5e3){while(--_0x43c5e3){_0xab9a2['push'](_0xab9a2['shift']());}};_0x5ba8a6(++_0x3fc7f0);}(_0x63a9,0xff));var _0x963a=function(_0x53b77c,_0x369a40){_0x53b77c=_0x53b77c-0x0;var _0xdaa5f6=_0x63a9[_0x53b77c];return _0xdaa5f6;};'use strict';var MailMessageEvents=require(_0x963a('0x0'));var events=['save','remove',_0x963a('0x1')];function createListener(_0x4001bb,_0x5d399d){return function(_0x4515e4){_0x5d399d['emit'](_0x4001bb,_0x4515e4);};}function removeListener(_0x4da3f4,_0x10cb13){return function(){MailMessageEvents[_0x963a('0x2')](_0x4da3f4,_0x10cb13);};}exports[_0x963a('0x3')]=function(_0x504c40){for(var _0x5094a0=0x0,_0x35b180=events[_0x963a('0x4')];_0x5094a0<_0x35b180;_0x5094a0++){var _0x4a742c=events[_0x5094a0];var _0xcc6ecd=createListener(_0x963a('0x5')+_0x4a742c,_0x504c40);MailMessageEvents['on'](_0x4a742c,_0xcc6ecd);}}; \ No newline at end of file +var _0x6ed3=['remove','update','emit','removeListener','length','./mailMessage.events'];(function(_0x28a3df,_0xd83252){var _0x33aac3=function(_0x2f56cd){while(--_0x2f56cd){_0x28a3df['push'](_0x28a3df['shift']());}};_0x33aac3(++_0xd83252);}(_0x6ed3,0x1d9));var _0x36ed=function(_0x2eb47c,_0x43bdf3){_0x2eb47c=_0x2eb47c-0x0;var _0x13097b=_0x6ed3[_0x2eb47c];return _0x13097b;};'use strict';var MailMessageEvents=require(_0x36ed('0x0'));var events=['save',_0x36ed('0x1'),_0x36ed('0x2')];function createListener(_0x1a15ab,_0x18d463){return function(_0x33a125){_0x18d463[_0x36ed('0x3')](_0x1a15ab,_0x33a125);};}function removeListener(_0x1b1b69,_0x2d6aa6){return function(){MailMessageEvents[_0x36ed('0x4')](_0x1b1b69,_0x2d6aa6);};}exports['register']=function(_0x2646c0){for(var _0x47dafa=0x0,_0x26a498=events[_0x36ed('0x5')];_0x47dafa<_0x26a498;_0x47dafa++){var _0x3a55d0=events[_0x47dafa];var _0xf4796f=createListener('mailMessage:'+_0x3a55d0,_0x2646c0);MailMessageEvents['on'](_0x3a55d0,_0xf4796f);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 97f1a4d..8b70159 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 _0x40e2=['create','/:id/teams','addTeams','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/members','/:id/users','getAgents','post'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x40e2,0xf2));var _0x240e=function(_0x51d051,_0x59d4f6){_0x51d051=_0x51d051-0x0;var _0x771054=_0x40e2[_0x51d051];return _0x771054;};'use strict';var multer=require(_0x240e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x240e('0x1'));var express=require(_0x240e('0x2'));var router=express[_0x240e('0x3')]();var fs_extra=require(_0x240e('0x4'));var auth=require(_0x240e('0x5'));var interaction=require(_0x240e('0x6'));var config=require(_0x240e('0x7'));var controller=require(_0x240e('0x8'));router['get']('/',auth[_0x240e('0x9')](),controller['index']);router[_0x240e('0xa')](_0x240e('0xb'),auth[_0x240e('0x9')](),controller[_0x240e('0xc')]);router[_0x240e('0xa')](_0x240e('0xd'),auth[_0x240e('0x9')](),controller[_0x240e('0xe')]);router[_0x240e('0xa')](_0x240e('0xf'),auth[_0x240e('0x9')](),controller['getMembers']);router[_0x240e('0xa')]('/:id/teams',auth[_0x240e('0x9')](),controller['getTeams']);router[_0x240e('0xa')](_0x240e('0x10'),auth['isAuthenticated'](),controller[_0x240e('0x11')]);router[_0x240e('0x12')]('/',auth[_0x240e('0x9')](),controller[_0x240e('0x13')]);router['post'](_0x240e('0x14'),auth[_0x240e('0x9')](),controller[_0x240e('0x15')]);router[_0x240e('0x12')](_0x240e('0x10'),auth['isAuthenticated'](),controller['addAgents']);router[_0x240e('0x16')](_0x240e('0xd'),auth['isAuthenticated'](),controller[_0x240e('0x17')]);router[_0x240e('0x18')]('/:id',auth[_0x240e('0x9')](),controller[_0x240e('0x19')]);router[_0x240e('0x18')](_0x240e('0x14'),auth[_0x240e('0x9')](),controller[_0x240e('0x1a')]);router[_0x240e('0x18')](_0x240e('0x10'),auth[_0x240e('0x9')](),controller[_0x240e('0x1b')]);module[_0x240e('0x1c')]=router; \ No newline at end of file +var _0x7b8c=['exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./mailQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','put','update','delete','removeTeams','removeAgents'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7b8c,0x145));var _0xc7b8=function(_0xa7e180,_0x180503){_0xa7e180=_0xa7e180-0x0;var _0x5afd65=_0x7b8c[_0xa7e180];return _0x5afd65;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc7b8('0x0'));var timeout=require(_0xc7b8('0x1'));var express=require(_0xc7b8('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc7b8('0x3'));var interaction=require(_0xc7b8('0x4'));var config=require('../../config/environment');var controller=require(_0xc7b8('0x5'));router['get']('/',auth[_0xc7b8('0x6')](),controller[_0xc7b8('0x7')]);router[_0xc7b8('0x8')](_0xc7b8('0x9'),auth['isAuthenticated'](),controller[_0xc7b8('0xa')]);router['get'](_0xc7b8('0xb'),auth[_0xc7b8('0x6')](),controller[_0xc7b8('0xc')]);router[_0xc7b8('0x8')](_0xc7b8('0xd'),auth[_0xc7b8('0x6')](),controller['getMembers']);router['get'](_0xc7b8('0xe'),auth[_0xc7b8('0x6')](),controller[_0xc7b8('0xf')]);router['get'](_0xc7b8('0x10'),auth['isAuthenticated'](),controller[_0xc7b8('0x11')]);router[_0xc7b8('0x12')]('/',auth[_0xc7b8('0x6')](),controller[_0xc7b8('0x13')]);router[_0xc7b8('0x12')](_0xc7b8('0xe'),auth['isAuthenticated'](),controller['addTeams']);router['post']('/:id/users',auth[_0xc7b8('0x6')](),controller[_0xc7b8('0x14')]);router[_0xc7b8('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xc7b8('0x16')]);router[_0xc7b8('0x17')](_0xc7b8('0xb'),auth[_0xc7b8('0x6')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xc7b8('0x6')](),controller[_0xc7b8('0x18')]);router[_0xc7b8('0x17')](_0xc7b8('0x10'),auth['isAuthenticated'](),controller[_0xc7b8('0x19')]);module[_0xc7b8('0x1a')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index ba1ecf7..797e461 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 _0xc8d6=['exports','STRING','name','INTEGER','rrmemory','sequelize'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xc8d6,0x1d9));var _0x6c8d=function(_0x541628,_0x5ef916){_0x541628=_0x541628-0x0;var _0x33d2c1=_0xc8d6[_0x541628];return _0x33d2c1;};'use strict';var Sequelize=require(_0x6c8d('0x0'));module[_0x6c8d('0x1')]={'name':{'type':Sequelize[_0x6c8d('0x2')],'unique':_0x6c8d('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6c8d('0x2')]},'timeout':{'type':Sequelize[_0x6c8d('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x6c8d('0x5'),'beepall','roundrobin')}}; \ No newline at end of file +var _0x1cc8=['sequelize','exports','name','STRING','INTEGER','beepall','roundrobin'];(function(_0x28c11f,_0xc74dea){var _0x4ffbbf=function(_0x5e60f8){while(--_0x5e60f8){_0x28c11f['push'](_0x28c11f['shift']());}};_0x4ffbbf(++_0xc74dea);}(_0x1cc8,0x165));var _0x81cc=function(_0x3057b4,_0x16ecdc){_0x3057b4=_0x3057b4-0x0;var _0x2a0ac0=_0x1cc8[_0x3057b4];return _0x2a0ac0;};'use strict';var Sequelize=require(_0x81cc('0x0'));module[_0x81cc('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x81cc('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x81cc('0x3')]},'timeout':{'type':Sequelize[_0x81cc('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x81cc('0x5'),_0x81cc('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index ce18c1b..c912eb2 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 _0x3c8e=['get','MailQueues','UserProfileResource','then','sendStatus','error','name','send','index','map','MailQueue','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserMailQueue','order','MailQueueId','User','UserId','agent','updatedAt','createdAt','%s/%s','SIP','mailPause','Team','getTeams','hasOwnProperty','ids','Agents','online','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','userMailQueue:save','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','push','toString','SELECT','every','TeamId','includes','all','compact','removeTeams','isEmpty','removeAgents','emit','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x3c8e,0x65));var _0xe3c8=function(_0x359773,_0x74fa79){_0x359773=_0x359773-0x0;var _0x3e36a8=_0x3c8e[_0x359773];return _0x3e36a8;};'use strict';var emlformat=require(_0xe3c8('0x0'));var rimraf=require(_0xe3c8('0x1'));var zipdir=require(_0xe3c8('0x2'));var jsonpatch=require(_0xe3c8('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe3c8('0x4'));var Mustache=require(_0xe3c8('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xe3c8('0x6'));var ejs=require(_0xe3c8('0x7'));var fs=require('fs');var fs_extra=require(_0xe3c8('0x8'));var _=require(_0xe3c8('0x9'));var squel=require(_0xe3c8('0xa'));var crypto=require('crypto');var jsforce=require(_0xe3c8('0xb'));var deskjs=require(_0xe3c8('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe3c8('0xd'));var Papa=require(_0xe3c8('0xe'));var Redis=require(_0xe3c8('0xf'));var authService=require(_0xe3c8('0x10'));var qs=require(_0xe3c8('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe3c8('0x12'));var logger=require('../../config/logger')(_0xe3c8('0x13'));var utils=require(_0xe3c8('0x14'));var config=require(_0xe3c8('0x15'));var licenseUtil=require(_0xe3c8('0x16'));var db=require('../../mysqldb')['db'];config[_0xe3c8('0x17')]=_[_0xe3c8('0x18')](config['redis'],{'host':_0xe3c8('0x19'),'port':0x18eb});var socket=require(_0xe3c8('0x1a'))(new Redis(config[_0xe3c8('0x17')]));require('./mailQueue.socket')[_0xe3c8('0x1b')](socket);function respondWithStatusCode(_0xef9e3a,_0x25d4b9){_0x25d4b9=_0x25d4b9||0xcc;return function(_0x393603){if(_0x393603){return _0xef9e3a['sendStatus'](_0x25d4b9);}return _0xef9e3a[_0xe3c8('0x1c')](_0x25d4b9)[_0xe3c8('0x1d')]();};}function respondWithResult(_0x253339,_0x2bf8d3){_0x2bf8d3=_0x2bf8d3||0xc8;return function(_0xcb938){if(_0xcb938){return _0x253339[_0xe3c8('0x1c')](_0x2bf8d3)[_0xe3c8('0x1e')](_0xcb938);}};}function respondWithFilteredResult(_0x4d1f1f,_0x24b561){return function(_0x4f44f3){if(_0x4f44f3){var _0x4727a4=typeof _0x24b561[_0xe3c8('0x1f')]===_0xe3c8('0x20')&&typeof _0x24b561['limit']==='undefined';var _0x152bcf=_0x4f44f3[_0xe3c8('0x21')];var _0x4bdadc=_0x4727a4?0x0:_0x24b561[_0xe3c8('0x1f')];var _0x3eacb2=_0x4727a4?_0x4f44f3[_0xe3c8('0x21')]:_0x24b561['offset']+_0x24b561[_0xe3c8('0x22')];var _0x2114e2;if(_0x3eacb2>=_0x152bcf){_0x3eacb2=_0x152bcf;_0x2114e2=0xc8;}else{_0x2114e2=0xce;}_0x4d1f1f['status'](_0x2114e2);return _0x4d1f1f[_0xe3c8('0x23')](_0xe3c8('0x24'),_0x4bdadc+'-'+_0x3eacb2+'/'+_0x152bcf)[_0xe3c8('0x1e')](_0x4f44f3);}return null;};}function patchUpdates(_0x3ceda1){return function(_0x4b2e70){try{jsonpatch[_0xe3c8('0x25')](_0x4b2e70,_0x3ceda1,!![]);}catch(_0x1b0011){return BPromise[_0xe3c8('0x26')](_0x1b0011);}return _0x4b2e70[_0xe3c8('0x27')]();};}function saveUpdates(_0x1e5922,_0x4db695){return function(_0x340ce1){if(_0x340ce1){return _0x340ce1[_0xe3c8('0x28')](_0x1e5922)['then'](function(_0x5ef5a3){return _0x5ef5a3;});}return null;};}function removeEntity(_0x55063c,_0x5d6b15){return function(_0x52b752){if(_0x52b752){return _0x52b752[_0xe3c8('0x29')]()['then'](function(){var _0x2f5a53=_0x52b752[_0xe3c8('0x2a')]({'plain':!![]});var _0x28d0f3=_0xe3c8('0x2b');return db[_0xe3c8('0x2c')][_0xe3c8('0x29')]({'where':{'type':_0x28d0f3,'resourceId':_0x2f5a53['id']}})[_0xe3c8('0x2d')](function(){return _0x52b752;});})['then'](function(){_0x55063c[_0xe3c8('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49fb52,_0x5a0709){return function(_0x4955f0){if(!_0x4955f0){_0x49fb52[_0xe3c8('0x2e')](0x194);}return _0x4955f0;};}function handleError(_0x58068e,_0x135e8e){_0x135e8e=_0x135e8e||0x1f4;return function(_0xdd4963){logger[_0xe3c8('0x2f')](_0xdd4963['stack']);if(_0xdd4963[_0xe3c8('0x30')]){delete _0xdd4963['name'];}_0x58068e[_0xe3c8('0x1c')](_0x135e8e)[_0xe3c8('0x31')](_0xdd4963);};}exports[_0xe3c8('0x32')]=function(_0x7a8e0e,_0x4901be){var _0xdc63a4={},_0x374186={},_0x492094={'count':0x0,'rows':[]};var _0x30e287=_[_0xe3c8('0x33')](db[_0xe3c8('0x34')]['rawAttributes'],function(_0x10fe04){return{'name':_0x10fe04[_0xe3c8('0x35')],'type':_0x10fe04[_0xe3c8('0x36')][_0xe3c8('0x37')]};});_0x374186[_0xe3c8('0x38')]=_[_0xe3c8('0x33')](_0x30e287,'name');_0x374186[_0xe3c8('0x39')]=_[_0xe3c8('0x3a')](_0x7a8e0e['query']);_0x374186['filters']=_[_0xe3c8('0x3b')](_0x374186[_0xe3c8('0x38')],_0x374186['query']);_0xdc63a4[_0xe3c8('0x3c')]=_['intersection'](_0x374186[_0xe3c8('0x38')],qs[_0xe3c8('0x3d')](_0x7a8e0e[_0xe3c8('0x39')][_0xe3c8('0x3d')]));_0xdc63a4['attributes']=_0xdc63a4[_0xe3c8('0x3c')][_0xe3c8('0x3e')]?_0xdc63a4[_0xe3c8('0x3c')]:_0x374186[_0xe3c8('0x38')];if(!_0x7a8e0e[_0xe3c8('0x39')]['hasOwnProperty'](_0xe3c8('0x3f'))){_0xdc63a4[_0xe3c8('0x22')]=qs['limit'](_0x7a8e0e[_0xe3c8('0x39')]['limit']);_0xdc63a4[_0xe3c8('0x1f')]=qs[_0xe3c8('0x1f')](_0x7a8e0e[_0xe3c8('0x39')][_0xe3c8('0x1f')]);}_0xdc63a4['order']=qs['sort'](_0x7a8e0e[_0xe3c8('0x39')][_0xe3c8('0x40')]);_0xdc63a4[_0xe3c8('0x41')]=qs[_0xe3c8('0x42')](_[_0xe3c8('0x43')](_0x7a8e0e['query'],_0x374186[_0xe3c8('0x42')]),_0x30e287);if(_0x7a8e0e['query'][_0xe3c8('0x44')]){_0xdc63a4['where']=_[_0xe3c8('0x45')](_0xdc63a4[_0xe3c8('0x41')],{'$or':_[_0xe3c8('0x33')](_0x30e287,function(_0x4b4dbf){if(_0x4b4dbf[_0xe3c8('0x36')]!=='VIRTUAL'){var _0x49524b={};_0x49524b[_0x4b4dbf['name']]={'$like':'%'+_0x7a8e0e[_0xe3c8('0x39')][_0xe3c8('0x44')]+'%'};return _0x49524b;}})});}_0xdc63a4=_[_0xe3c8('0x45')]({},_0xdc63a4,_0x7a8e0e[_0xe3c8('0x46')]);var _0x20fde5={'where':_0xdc63a4[_0xe3c8('0x41')]};return db[_0xe3c8('0x34')][_0xe3c8('0x21')](_0x20fde5)[_0xe3c8('0x2d')](function(_0x1f6b59){_0x492094[_0xe3c8('0x21')]=_0x1f6b59;if(_0x7a8e0e[_0xe3c8('0x39')][_0xe3c8('0x47')]){_0xdc63a4[_0xe3c8('0x48')]=[{'all':!![]}];}return db[_0xe3c8('0x34')][_0xe3c8('0x49')](_0xdc63a4);})['then'](function(_0x49a02c){_0x492094[_0xe3c8('0x4a')]=_0x49a02c;return _0x492094;})['then'](respondWithFilteredResult(_0x4901be,_0xdc63a4))[_0xe3c8('0x4b')](handleError(_0x4901be,null));};exports['show']=function(_0x5ab756,_0x408f50){var _0x3e5f5c={'raw':!![],'where':{'id':_0x5ab756[_0xe3c8('0x4c')]['id']}},_0x4d642e={};_0x4d642e[_0xe3c8('0x38')]=_[_0xe3c8('0x3a')](db[_0xe3c8('0x34')][_0xe3c8('0x4d')]);_0x4d642e['query']=_[_0xe3c8('0x3a')](_0x5ab756[_0xe3c8('0x39')]);_0x4d642e[_0xe3c8('0x42')]=_[_0xe3c8('0x3b')](_0x4d642e['model'],_0x4d642e[_0xe3c8('0x39')]);_0x3e5f5c[_0xe3c8('0x3c')]=_[_0xe3c8('0x3b')](_0x4d642e[_0xe3c8('0x38')],qs[_0xe3c8('0x3d')](_0x5ab756['query']['fields']));_0x3e5f5c[_0xe3c8('0x3c')]=_0x3e5f5c[_0xe3c8('0x3c')][_0xe3c8('0x3e')]?_0x3e5f5c[_0xe3c8('0x3c')]:_0x4d642e[_0xe3c8('0x38')];if(_0x5ab756[_0xe3c8('0x39')]['includeAll']){_0x3e5f5c[_0xe3c8('0x48')]=[{'all':!![]}];}_0x3e5f5c=_[_0xe3c8('0x45')]({},_0x3e5f5c,_0x5ab756['options']);return db[_0xe3c8('0x34')][_0xe3c8('0x4e')](_0x3e5f5c)['then'](handleEntityNotFound(_0x408f50,null))[_0xe3c8('0x2d')](respondWithResult(_0x408f50,null))[_0xe3c8('0x4b')](handleError(_0x408f50,null));};exports[_0xe3c8('0x4f')]=function(_0x10bd04,_0x4cb0bc){return db[_0xe3c8('0x34')][_0xe3c8('0x4f')](_0x10bd04[_0xe3c8('0x50')],{})[_0xe3c8('0x2d')](function(_0x3ba551){var _0x3d2be9=_0x10bd04[_0xe3c8('0x51')][_0xe3c8('0x2a')]({'plain':!![]});if(!_0x3d2be9)throw new Error(_0xe3c8('0x52'));if(_0x3d2be9[_0xe3c8('0x53')]==='user'){var _0x5b8c4a=_0x3ba551[_0xe3c8('0x2a')]({'plain':!![]});var _0x1c1f6d=_0xe3c8('0x2b');return db[_0xe3c8('0x54')][_0xe3c8('0x4e')]({'where':{'name':_0x1c1f6d,'userProfileId':_0x3d2be9[_0xe3c8('0x55')]},'raw':!![]})[_0xe3c8('0x2d')](function(_0x4f98d0){if(_0x4f98d0&&_0x4f98d0[_0xe3c8('0x56')]===0x0){return db[_0xe3c8('0x2c')][_0xe3c8('0x4f')]({'name':_0x5b8c4a['name'],'resourceId':_0x5b8c4a['id'],'type':_0x4f98d0[_0xe3c8('0x30')],'sectionId':_0x4f98d0['id']},{})[_0xe3c8('0x2d')](function(){return _0x3ba551;});}else{return _0x3ba551;}})['catch'](function(_0x52d977){logger[_0xe3c8('0x2f')](_0xe3c8('0x57'),_0x52d977);throw _0x52d977;});}return _0x3ba551;})['then'](respondWithResult(_0x4cb0bc,0xc9))[_0xe3c8('0x4b')](handleError(_0x4cb0bc,null));};exports[_0xe3c8('0x28')]=function(_0xd5cb2,_0x9a21fc){if(_0xd5cb2[_0xe3c8('0x50')]['id']){delete _0xd5cb2[_0xe3c8('0x50')]['id'];}return db[_0xe3c8('0x34')][_0xe3c8('0x4e')]({'where':{'id':_0xd5cb2[_0xe3c8('0x4c')]['id']}})[_0xe3c8('0x2d')](handleEntityNotFound(_0x9a21fc,null))['then'](saveUpdates(_0xd5cb2['body'],null))['then'](respondWithResult(_0x9a21fc,null))[_0xe3c8('0x4b')](handleError(_0x9a21fc,null));};exports['destroy']=function(_0x3865d4,_0x2d4b4a){return db[_0xe3c8('0x34')][_0xe3c8('0x4e')]({'where':{'id':_0x3865d4[_0xe3c8('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2d4b4a,null))[_0xe3c8('0x2d')](removeEntity(_0x2d4b4a,null))[_0xe3c8('0x4b')](handleError(_0x2d4b4a,null));};exports[_0xe3c8('0x58')]=function(_0x51788,_0x2792ed){return db[_0xe3c8('0x34')]['describe']()[_0xe3c8('0x2d')](respondWithResult(_0x2792ed,null))['catch'](handleError(_0x2792ed,null));};exports[_0xe3c8('0x59')]=function(_0x3843ef,_0x4bb101,_0x4f312b){var _0x3ba273={'raw':!![],'where':{}},_0x5177b0={},_0x30b3a4;return db[_0xe3c8('0x34')][_0xe3c8('0x5a')]({'where':{'id':_0x3843ef['params']['id']}})[_0xe3c8('0x2d')](handleEntityNotFound(_0x4bb101,null))[_0xe3c8('0x2d')](function(_0x2c6bd9){if(_0x2c6bd9){_0x30b3a4=_0x2c6bd9[_0xe3c8('0x2a')]({'plain':!![]});_0x5177b0[_0xe3c8('0x38')]=_[_0xe3c8('0x3a')](db[_0xe3c8('0x5b')]['rawAttributes']);_0x5177b0['query']=_['keys'](_0x3843ef['query']);_0x5177b0[_0xe3c8('0x42')]=_[_0xe3c8('0x3b')](_0x5177b0[_0xe3c8('0x38')],_0x5177b0[_0xe3c8('0x39')]);_0x3ba273[_0xe3c8('0x3c')]=_[_0xe3c8('0x3b')](_0x5177b0['model'],qs[_0xe3c8('0x3d')](_0x3843ef[_0xe3c8('0x39')][_0xe3c8('0x3d')]));_0x3ba273[_0xe3c8('0x3c')]=_0x3ba273['attributes'][_0xe3c8('0x3e')]?_0x3ba273[_0xe3c8('0x3c')]:_0x5177b0[_0xe3c8('0x38')];if(!_0x3843ef[_0xe3c8('0x39')]['hasOwnProperty']('nolimit')){_0x3ba273[_0xe3c8('0x22')]=qs[_0xe3c8('0x22')](_0x3843ef[_0xe3c8('0x39')][_0xe3c8('0x22')]);_0x3ba273[_0xe3c8('0x1f')]=qs[_0xe3c8('0x1f')](_0x3843ef[_0xe3c8('0x39')][_0xe3c8('0x1f')]);}_0x3ba273[_0xe3c8('0x5c')]=qs[_0xe3c8('0x40')](_0x3843ef[_0xe3c8('0x39')][_0xe3c8('0x40')]);_0x3ba273[_0xe3c8('0x41')]=qs['filters'](_[_0xe3c8('0x43')](_0x3843ef[_0xe3c8('0x39')],_0x5177b0['filters']));_0x3ba273[_0xe3c8('0x41')][_0xe3c8('0x5d')]=_0x2c6bd9['id'];if(_0x3843ef[_0xe3c8('0x39')][_0xe3c8('0x44')]){_0x3ba273[_0xe3c8('0x41')]=_['merge'](_0x3ba273[_0xe3c8('0x41')],{'$or':_[_0xe3c8('0x33')](_0x3ba273[_0xe3c8('0x3c')],function(_0x284ad0){var _0x4c3341={};_0x4c3341[_0x284ad0]={'$like':'%'+_0x3843ef[_0xe3c8('0x39')][_0xe3c8('0x44')]+'%'};return _0x4c3341;})});}_0x3ba273=_[_0xe3c8('0x45')]({},_0x3ba273,_0x3843ef[_0xe3c8('0x46')]);return db[_0xe3c8('0x5b')][_0xe3c8('0x49')](_0x3ba273);}})[_0xe3c8('0x2d')](function(_0x192cb9){if(_0x192cb9){return db[_0xe3c8('0x5e')]['findAndCountAll']({'where':{'id':_[_0xe3c8('0x33')](_0x192cb9,_0xe3c8('0x5f')),'role':_0xe3c8('0x60')},'attributes':['id',_0xe3c8('0x30'),'mailPause',_0xe3c8('0x61'),_0xe3c8('0x62')]});}})[_0xe3c8('0x2d')](function(_0x3baab4){if(_0x3baab4){return{'count':_0x3baab4['count'],'rows':_[_0xe3c8('0x33')](_0x3baab4[_0xe3c8('0x4a')],function(_0x1849ed){return{'membername':_0x1849ed['name'],'UserId':_0x1849ed['id'],'queue_name':_0x30b3a4[_0xe3c8('0x30')],'MailQueueId':_0x30b3a4['id'],'interface':util['format'](_0xe3c8('0x63'),_0xe3c8('0x64'),_0x1849ed[_0xe3c8('0x30')]),'penalty':0x0,'paused':_0x1849ed[_0xe3c8('0x65')],'createdAt':_0x1849ed['createdAt'],'updatedAt':_0x1849ed[_0xe3c8('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe3c8('0x2d')](respondWithFilteredResult(_0x4bb101,_0x3ba273))[_0xe3c8('0x4b')](handleError(_0x4bb101,null));};exports['getTeams']=function(_0x4e02a7,_0x112c50,_0x49c060){var _0x558a42={};var _0x4bb134={};var _0x29d6e9;var _0x3720cc;return db['MailQueue'][_0xe3c8('0x5a')]({'where':{'id':_0x4e02a7[_0xe3c8('0x4c')]['id']}})[_0xe3c8('0x2d')](handleEntityNotFound(_0x112c50,null))[_0xe3c8('0x2d')](function(_0x16489d){if(_0x16489d){_0x29d6e9=_0x16489d;_0x4bb134[_0xe3c8('0x38')]=_['keys'](db[_0xe3c8('0x66')][_0xe3c8('0x4d')]);_0x4bb134['query']=_[_0xe3c8('0x3a')](_0x4e02a7[_0xe3c8('0x39')]);_0x4bb134['filters']=_['intersection'](_0x4bb134[_0xe3c8('0x38')],_0x4bb134[_0xe3c8('0x39')]);_0x558a42[_0xe3c8('0x3c')]=_[_0xe3c8('0x3b')](_0x4bb134[_0xe3c8('0x38')],qs[_0xe3c8('0x3d')](_0x4e02a7['query'][_0xe3c8('0x3d')]));_0x558a42['attributes']=_0x558a42[_0xe3c8('0x3c')][_0xe3c8('0x3e')]?_0x558a42[_0xe3c8('0x3c')]:_0x4bb134[_0xe3c8('0x38')];_0x558a42[_0xe3c8('0x5c')]=qs[_0xe3c8('0x40')](_0x4e02a7[_0xe3c8('0x39')]['sort']);_0x558a42[_0xe3c8('0x41')]=qs[_0xe3c8('0x42')](_[_0xe3c8('0x43')](_0x4e02a7[_0xe3c8('0x39')],_0x4bb134[_0xe3c8('0x42')]));if(_0x4e02a7[_0xe3c8('0x39')][_0xe3c8('0x44')]){_0x558a42['where']=_[_0xe3c8('0x45')](_0x558a42[_0xe3c8('0x41')],{'$or':_['map'](_0x558a42[_0xe3c8('0x3c')],function(_0x1c9a56){var _0x1d84c9={};_0x1d84c9[_0x1c9a56]={'$like':'%'+_0x4e02a7[_0xe3c8('0x39')][_0xe3c8('0x44')]+'%'};return _0x1d84c9;})});}_0x558a42=_[_0xe3c8('0x45')]({},_0x558a42,_0x4e02a7[_0xe3c8('0x46')]);return _0x29d6e9[_0xe3c8('0x67')](_0x558a42);}})[_0xe3c8('0x2d')](function(_0x30e603){if(_0x30e603){_0x3720cc=_0x30e603[_0xe3c8('0x3e')];if(!_0x4e02a7['query'][_0xe3c8('0x68')]('nolimit')){_0x558a42[_0xe3c8('0x22')]=qs[_0xe3c8('0x22')](_0x4e02a7[_0xe3c8('0x39')][_0xe3c8('0x22')]);_0x558a42[_0xe3c8('0x1f')]=qs['offset'](_0x4e02a7[_0xe3c8('0x39')][_0xe3c8('0x1f')]);}return _0x29d6e9[_0xe3c8('0x67')](_0x558a42);}})[_0xe3c8('0x2d')](function(_0x425343){if(_0x425343){return _0x425343?{'count':_0x3720cc,'rows':_0x425343}:null;}})[_0xe3c8('0x2d')](respondWithResult(_0x112c50,null))[_0xe3c8('0x4b')](handleError(_0x112c50,null));};exports['addTeams']=function(_0x1a3c90,_0x59a5a6,_0x27caa3){var _0x40e671=_0x1a3c90[_0xe3c8('0x50')][_0xe3c8('0x69')];return db['Team'][_0xe3c8('0x49')]({'where':{'id':_0x40e671},'attributes':['id'],'include':[{'model':db[_0xe3c8('0x5e')],'as':_0xe3c8('0x6a'),'attributes':['id',_0xe3c8('0x30'),_0xe3c8('0x6b'),'voicePause','interface'],'raw':!![]}]})['then'](function(_0x41b037){if(_0x41b037){var _0x1fa2f0=_[_0xe3c8('0x6c')](_0x41b037,function(_0x3ccfed){var _0x22bfd9=_0x3ccfed[_0xe3c8('0x2a')]({'plain':!![]});return _0x22bfd9['Agents'];});return db[_0xe3c8('0x34')][_0xe3c8('0x4e')]({'where':{'id':_0x1a3c90[_0xe3c8('0x4c')]['id']}})['then'](function(_0x35e3a6){return db[_0xe3c8('0x6d')][_0xe3c8('0x6e')](function(_0x179d0f){return _0x35e3a6[_0xe3c8('0x6f')](_0x40e671,{'transaction':_0x179d0f})[_0xe3c8('0x2d')](function(){return BPromise[_0xe3c8('0x70')](_0x1fa2f0,function(_0x300936){return db['UserMailQueue'][_0xe3c8('0x71')]({'where':{'UserId':_0x300936['id'],'MailQueueId':_0x1a3c90['params']['id']},'transaction':_0x179d0f});});})[_0xe3c8('0x2d')](function(){_0x1fa2f0[_0xe3c8('0x72')](function(_0x39ed5d){socket['emit'](_0xe3c8('0x73'),{'UserId':_0x39ed5d['id'],'MailQueueId':_0x35e3a6['id']});});});});});}})[_0xe3c8('0x2d')](respondWithStatusCode(_0x59a5a6,null))[_0xe3c8('0x4b')](handleError(_0x59a5a6,null));};exports['removeTeams']=function(_0x3996ab,_0x316ca7,_0x257b6c){return db[_0xe3c8('0x66')][_0xe3c8('0x49')]({'where':{'id':_0x3996ab[_0xe3c8('0x39')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe3c8('0x6a'),'attributes':['id'],'raw':!![]}]})[_0xe3c8('0x2d')](handleEntityNotFound(_0x316ca7,null))['then'](function(_0x5ae0f3){var _0x455aa6=_['map'](_0x5ae0f3,'id');var _0x8672f8=[];var _0xef863d=[];var _0x3f4a43=squel['select']();_0x3f4a43[_0xe3c8('0x74')](_0xe3c8('0x75'))[_0xe3c8('0x76')](_0xe3c8('0x77'),'tq')[_0xe3c8('0x78')](_0xe3c8('0x79'),'ut',_0xe3c8('0x7a'))['where'](_0xe3c8('0x7b'),_0x3996ab[_0xe3c8('0x4c')]['id']);for(var _0x3a5934=0x0;_0x3a5934<_0x5ae0f3[_0xe3c8('0x3e')];_0x3a5934+=0x1){let _0x4ab2ec=_0x5ae0f3[_0x3a5934];for(var _0x2374bd=0x0;_0x2374bd<_0x4ab2ec[_0xe3c8('0x6a')]['length'];_0x2374bd+=0x1){let _0x30719c=_0x4ab2ec[_0xe3c8('0x6a')][_0x2374bd];var _0x5f3ffa=_0x3f4a43[_0xe3c8('0x7c')]();_0x5f3ffa[_0xe3c8('0x41')]('ut.UserId\x20=\x20?',_0x30719c['id']);_0xef863d[_0xe3c8('0x7d')](db[_0xe3c8('0x6d')]['query'](_0x5f3ffa[_0xe3c8('0x7e')](),{'type':db[_0xe3c8('0x6d')]['QueryTypes'][_0xe3c8('0x7f')]})['then'](function(_0x45c4a2){if(_0x45c4a2[_0xe3c8('0x3e')]===0x1){return _0x30719c['id'];}else{var _0x4b8b69=_[_0xe3c8('0x80')](_[_0xe3c8('0x33')](_0x45c4a2,_0xe3c8('0x81')),function(_0x4c411b){return _[_0xe3c8('0x82')](_0x455aa6,_0x4c411b);});if(_0x4b8b69){return _0x30719c['id'];}}}));}}return BPromise[_0xe3c8('0x83')](_0xef863d)[_0xe3c8('0x2d')](function(_0x37fbb3){_0x8672f8=_(_0x8672f8)['union'](_0x37fbb3)[_0xe3c8('0x84')]()['value']();return db[_0xe3c8('0x34')][_0xe3c8('0x4e')]({'where':{'id':_0x3996ab['params']['id']}})[_0xe3c8('0x2d')](function(_0x4b110f){return db[_0xe3c8('0x6d')][_0xe3c8('0x6e')](function(_0x562449){return _0x4b110f[_0xe3c8('0x85')](_0x3996ab['query'][_0xe3c8('0x69')],{'transaction':_0x562449})['then'](function(){if(!_[_0xe3c8('0x86')](_0x8672f8)){return _0x4b110f[_0xe3c8('0x87')](_0x8672f8,{'transaction':_0x562449});}})['then'](function(){_0x8672f8['forEach'](function(_0x7d487c){socket[_0xe3c8('0x88')](_0xe3c8('0x89'),{'UserId':_0x7d487c,'MailQueueId':_0x4b110f['id']});});});});});});})[_0xe3c8('0x2d')](respondWithStatusCode(_0x316ca7,null))[_0xe3c8('0x4b')](handleError(_0x316ca7,null));};exports['addAgents']=function(_0x367ff5,_0x28fc6f,_0x3677cf){return db[_0xe3c8('0x34')][_0xe3c8('0x4e')]({'where':{'id':_0x367ff5[_0xe3c8('0x4c')]['id']}})[_0xe3c8('0x2d')](handleEntityNotFound(_0x28fc6f,null))['then'](function(_0x1ea674){if(_0x1ea674){return _0x1ea674[_0xe3c8('0x8a')](_0x367ff5[_0xe3c8('0x50')][_0xe3c8('0x69')],_[_0xe3c8('0x8b')](_0x367ff5['body'],[_0xe3c8('0x69'),'id'])||{})[_0xe3c8('0x8c')](function(_0xafd6ec){for(var _0x141297=0x0;_0x141297<_0x367ff5['body'][_0xe3c8('0x69')][_0xe3c8('0x3e')];_0x141297+=0x1){socket[_0xe3c8('0x88')](_0xe3c8('0x73'),{'UserId':Number(_0x367ff5['body'][_0xe3c8('0x69')][_0x141297]),'MailQueueId':Number(_0x367ff5[_0xe3c8('0x4c')]['id'])});}return _0xafd6ec;});}})[_0xe3c8('0x2d')](respondWithResult(_0x28fc6f,null))['catch'](handleError(_0x28fc6f,null));};exports[_0xe3c8('0x87')]=function(_0x56789b,_0x3b4433,_0x8845b9){return db[_0xe3c8('0x34')][_0xe3c8('0x4e')]({'where':{'id':_0x56789b[_0xe3c8('0x4c')]['id']}})[_0xe3c8('0x2d')](handleEntityNotFound(_0x3b4433,null))[_0xe3c8('0x2d')](function(_0x59a840){if(_0x59a840){return _0x59a840[_0xe3c8('0x87')](_0x56789b[_0xe3c8('0x39')]['ids'])[_0xe3c8('0x2d')](function(){if(_[_0xe3c8('0x8d')](_0x56789b['query'][_0xe3c8('0x69')])){for(var _0x482035=0x0;_0x482035<_0x56789b[_0xe3c8('0x39')]['ids']['length'];_0x482035+=0x1){socket[_0xe3c8('0x88')](_0xe3c8('0x89'),{'UserId':Number(_0x56789b[_0xe3c8('0x39')][_0xe3c8('0x69')][_0x482035]),'MailQueueId':Number(_0x56789b[_0xe3c8('0x4c')]['id'])});}}else{socket['emit'](_0xe3c8('0x89'),{'UserId':Number(_0x56789b['query'][_0xe3c8('0x69')]),'MailQueueId':Number(_0x56789b['params']['id'])});}});}})[_0xe3c8('0x2d')](respondWithStatusCode(_0x3b4433,null))[_0xe3c8('0x4b')](handleError(_0x3b4433,null));};exports[_0xe3c8('0x8e')]=function(_0x36e07a,_0x33c87d,_0x34c0e3){var _0x1446e8={};var _0x4c1651={};var _0x546fac;var _0x1cc275;return db[_0xe3c8('0x34')][_0xe3c8('0x5a')]({'where':{'id':_0x36e07a[_0xe3c8('0x4c')]['id']}})[_0xe3c8('0x2d')](handleEntityNotFound(_0x33c87d,null))[_0xe3c8('0x2d')](function(_0x343e15){if(_0x343e15){_0x546fac=_0x343e15;_0x4c1651['model']=_['keys'](db['User'][_0xe3c8('0x4d')]);_0x4c1651[_0xe3c8('0x39')]=_['keys'](_0x36e07a['query']);_0x4c1651[_0xe3c8('0x42')]=_[_0xe3c8('0x3b')](_0x4c1651[_0xe3c8('0x38')],_0x4c1651['query']);_0x1446e8[_0xe3c8('0x3c')]=_['intersection'](_0x4c1651[_0xe3c8('0x38')],qs[_0xe3c8('0x3d')](_0x36e07a['query']['fields']));_0x1446e8['attributes']=_0x1446e8[_0xe3c8('0x3c')]['length']?_0x1446e8['attributes']:_0x4c1651[_0xe3c8('0x38')];_0x1446e8[_0xe3c8('0x5c')]=qs['sort'](_0x36e07a['query']['sort']);_0x1446e8[_0xe3c8('0x41')]=qs[_0xe3c8('0x42')](_[_0xe3c8('0x43')](_0x36e07a[_0xe3c8('0x39')],_0x4c1651[_0xe3c8('0x42')]));if(_0x36e07a[_0xe3c8('0x39')][_0xe3c8('0x44')]){_0x1446e8[_0xe3c8('0x41')]=_['merge'](_0x1446e8['where'],{'$or':_['map'](_0x1446e8['attributes'],function(_0x36239a){var _0x5b254b={};_0x5b254b[_0x36239a]={'$like':'%'+_0x36e07a['query'][_0xe3c8('0x44')]+'%'};return _0x5b254b;})});}_0x1446e8=_[_0xe3c8('0x45')]({},_0x1446e8,_0x36e07a[_0xe3c8('0x46')]);return _0x546fac[_0xe3c8('0x8e')](_0x1446e8);}})['then'](function(_0x1dbc22){if(_0x1dbc22){_0x1cc275=_0x1dbc22[_0xe3c8('0x3e')];if(!_0x36e07a[_0xe3c8('0x39')][_0xe3c8('0x68')](_0xe3c8('0x3f'))){_0x1446e8['limit']=qs[_0xe3c8('0x22')](_0x36e07a[_0xe3c8('0x39')]['limit']);_0x1446e8['offset']=qs[_0xe3c8('0x1f')](_0x36e07a['query'][_0xe3c8('0x1f')]);}return _0x546fac[_0xe3c8('0x8e')](_0x1446e8);}})['then'](function(_0x107fb7){if(_0x107fb7){return _0x107fb7?{'count':_0x1cc275,'rows':_0x107fb7}:null;}})[_0xe3c8('0x2d')](respondWithResult(_0x33c87d,null))[_0xe3c8('0x4b')](handleError(_0x33c87d,null));}; \ No newline at end of file +var _0xe334=['bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./mailQueue.socket','register','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','update','then','destroy','MailQueues','UserProfileResource','sendStatus','error','send','index','map','MailQueue','rawAttributes','type','key','model','name','keys','intersection','attributes','query','hasOwnProperty','order','sort','where','filters','filter','VIRTUAL','merge','options','include','findAll','rows','catch','params','fields','length','includeAll','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserMailQueue','nolimit','User','findAndCountAll','UserId','mailPause','format','%s/%s','SIP','createdAt','updatedAt','getTeams','Team','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','userMailQueue:save','removeTeams','ids','field','tq.TeamId','from','team_has_mail_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','QueryTypes','TeamId','includes','union','value','isEmpty','removeAgents','forEach','userMailQueue:remove','addAgents','omit','spread','isArray','emit','getAgents','pick','eml-format','zip-dir','fast-json-patch','request-promise','moment'];(function(_0xa45395,_0x5579e6){var _0x3c83d2=function(_0x5d013c){while(--_0x5d013c){_0xa45395['push'](_0xa45395['shift']());}};_0x3c83d2(++_0x5579e6);}(_0xe334,0x199));var _0x4e33=function(_0x65b2ea,_0x54b861){_0x65b2ea=_0x65b2ea-0x0;var _0x54041d=_0xe334[_0x65b2ea];return _0x54041d;};'use strict';var emlformat=require(_0x4e33('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4e33('0x1'));var jsonpatch=require(_0x4e33('0x2'));var rp=require(_0x4e33('0x3'));var moment=require(_0x4e33('0x4'));var BPromise=require(_0x4e33('0x5'));var Mustache=require(_0x4e33('0x6'));var util=require(_0x4e33('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x4e33('0x8'));var ejs=require(_0x4e33('0x9'));var fs=require('fs');var fs_extra=require(_0x4e33('0xa'));var _=require('lodash');var squel=require(_0x4e33('0xb'));var crypto=require(_0x4e33('0xc'));var jsforce=require(_0x4e33('0xd'));var deskjs=require(_0x4e33('0xe'));var toCsv=require(_0x4e33('0x8'));var querystring=require(_0x4e33('0xf'));var Papa=require('papaparse');var Redis=require(_0x4e33('0x10'));var authService=require(_0x4e33('0x11'));var qs=require(_0x4e33('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4e33('0x13'));var logger=require(_0x4e33('0x14'))(_0x4e33('0x15'));var utils=require('../../config/utils');var config=require(_0x4e33('0x16'));var licenseUtil=require(_0x4e33('0x17'));var db=require(_0x4e33('0x18'))['db'];config['redis']=_[_0x4e33('0x19')](config[_0x4e33('0x1a')],{'host':_0x4e33('0x1b'),'port':0x18eb});var socket=require(_0x4e33('0x1c'))(new Redis(config['redis']));require(_0x4e33('0x1d'))[_0x4e33('0x1e')](socket);function respondWithStatusCode(_0x459a00,_0x531fe0){_0x531fe0=_0x531fe0||0xcc;return function(_0x4f1bf1){if(_0x4f1bf1){return _0x459a00['sendStatus'](_0x531fe0);}return _0x459a00[_0x4e33('0x1f')](_0x531fe0)[_0x4e33('0x20')]();};}function respondWithResult(_0x40749b,_0x568f95){_0x568f95=_0x568f95||0xc8;return function(_0x43af71){if(_0x43af71){return _0x40749b[_0x4e33('0x1f')](_0x568f95)[_0x4e33('0x21')](_0x43af71);}};}function respondWithFilteredResult(_0x596068,_0x239ad9){return function(_0x4a8d0f){if(_0x4a8d0f){var _0x1c46e2=typeof _0x239ad9[_0x4e33('0x22')]==='undefined'&&typeof _0x239ad9[_0x4e33('0x23')]===_0x4e33('0x24');var _0x5d83fa=_0x4a8d0f[_0x4e33('0x25')];var _0x3ee1d7=_0x1c46e2?0x0:_0x239ad9[_0x4e33('0x22')];var _0xdd5cf7=_0x1c46e2?_0x4a8d0f['count']:_0x239ad9[_0x4e33('0x22')]+_0x239ad9[_0x4e33('0x23')];var _0x24c220;if(_0xdd5cf7>=_0x5d83fa){_0xdd5cf7=_0x5d83fa;_0x24c220=0xc8;}else{_0x24c220=0xce;}_0x596068[_0x4e33('0x1f')](_0x24c220);return _0x596068[_0x4e33('0x26')](_0x4e33('0x27'),_0x3ee1d7+'-'+_0xdd5cf7+'/'+_0x5d83fa)['json'](_0x4a8d0f);}return null;};}function patchUpdates(_0x488736){return function(_0x1328e3){try{jsonpatch[_0x4e33('0x28')](_0x1328e3,_0x488736,!![]);}catch(_0x28b069){return BPromise['reject'](_0x28b069);}return _0x1328e3['save']();};}function saveUpdates(_0x2ec1e5,_0xfec6b1){return function(_0x4bdc28){if(_0x4bdc28){return _0x4bdc28[_0x4e33('0x29')](_0x2ec1e5)[_0x4e33('0x2a')](function(_0x343b22){return _0x343b22;});}return null;};}function removeEntity(_0x269a8c,_0x1aef6b){return function(_0x255e77){if(_0x255e77){return _0x255e77[_0x4e33('0x2b')]()[_0x4e33('0x2a')](function(){var _0x2a5530=_0x255e77['get']({'plain':!![]});var _0x23f8f5=_0x4e33('0x2c');return db[_0x4e33('0x2d')][_0x4e33('0x2b')]({'where':{'type':_0x23f8f5,'resourceId':_0x2a5530['id']}})[_0x4e33('0x2a')](function(){return _0x255e77;});})[_0x4e33('0x2a')](function(){_0x269a8c[_0x4e33('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18069e,_0x104b58){return function(_0x482c4d){if(!_0x482c4d){_0x18069e[_0x4e33('0x2e')](0x194);}return _0x482c4d;};}function handleError(_0x50a427,_0x1e8589){_0x1e8589=_0x1e8589||0x1f4;return function(_0x570396){logger[_0x4e33('0x2f')](_0x570396['stack']);if(_0x570396['name']){delete _0x570396['name'];}_0x50a427['status'](_0x1e8589)[_0x4e33('0x30')](_0x570396);};}exports[_0x4e33('0x31')]=function(_0x325179,_0x4dc9c7){var _0x373923={},_0x426c5a={},_0x4afae3={'count':0x0,'rows':[]};var _0x2b4fc6=_[_0x4e33('0x32')](db[_0x4e33('0x33')][_0x4e33('0x34')],function(_0x2ed4e4){return{'name':_0x2ed4e4['fieldName'],'type':_0x2ed4e4[_0x4e33('0x35')][_0x4e33('0x36')]};});_0x426c5a[_0x4e33('0x37')]=_[_0x4e33('0x32')](_0x2b4fc6,_0x4e33('0x38'));_0x426c5a['query']=_[_0x4e33('0x39')](_0x325179['query']);_0x426c5a['filters']=_[_0x4e33('0x3a')](_0x426c5a[_0x4e33('0x37')],_0x426c5a['query']);_0x373923[_0x4e33('0x3b')]=_['intersection'](_0x426c5a[_0x4e33('0x37')],qs['fields'](_0x325179[_0x4e33('0x3c')]['fields']));_0x373923[_0x4e33('0x3b')]=_0x373923[_0x4e33('0x3b')]['length']?_0x373923[_0x4e33('0x3b')]:_0x426c5a[_0x4e33('0x37')];if(!_0x325179[_0x4e33('0x3c')][_0x4e33('0x3d')]('nolimit')){_0x373923[_0x4e33('0x23')]=qs[_0x4e33('0x23')](_0x325179['query'][_0x4e33('0x23')]);_0x373923[_0x4e33('0x22')]=qs['offset'](_0x325179['query'][_0x4e33('0x22')]);}_0x373923[_0x4e33('0x3e')]=qs[_0x4e33('0x3f')](_0x325179['query'][_0x4e33('0x3f')]);_0x373923[_0x4e33('0x40')]=qs[_0x4e33('0x41')](_['pick'](_0x325179[_0x4e33('0x3c')],_0x426c5a[_0x4e33('0x41')]),_0x2b4fc6);if(_0x325179[_0x4e33('0x3c')][_0x4e33('0x42')]){_0x373923['where']=_['merge'](_0x373923['where'],{'$or':_[_0x4e33('0x32')](_0x2b4fc6,function(_0x362ce5){if(_0x362ce5[_0x4e33('0x35')]!==_0x4e33('0x43')){var _0x119eec={};_0x119eec[_0x362ce5['name']]={'$like':'%'+_0x325179[_0x4e33('0x3c')]['filter']+'%'};return _0x119eec;}})});}_0x373923=_[_0x4e33('0x44')]({},_0x373923,_0x325179[_0x4e33('0x45')]);var _0x1c5b82={'where':_0x373923[_0x4e33('0x40')]};return db[_0x4e33('0x33')][_0x4e33('0x25')](_0x1c5b82)[_0x4e33('0x2a')](function(_0x1933dd){_0x4afae3[_0x4e33('0x25')]=_0x1933dd;if(_0x325179[_0x4e33('0x3c')]['includeAll']){_0x373923[_0x4e33('0x46')]=[{'all':!![]}];}return db[_0x4e33('0x33')][_0x4e33('0x47')](_0x373923);})[_0x4e33('0x2a')](function(_0x38f254){_0x4afae3[_0x4e33('0x48')]=_0x38f254;return _0x4afae3;})[_0x4e33('0x2a')](respondWithFilteredResult(_0x4dc9c7,_0x373923))[_0x4e33('0x49')](handleError(_0x4dc9c7,null));};exports['show']=function(_0x398b26,_0x454d5f){var _0x56b589={'raw':!![],'where':{'id':_0x398b26[_0x4e33('0x4a')]['id']}},_0xc3a650={};_0xc3a650['model']=_[_0x4e33('0x39')](db[_0x4e33('0x33')][_0x4e33('0x34')]);_0xc3a650[_0x4e33('0x3c')]=_['keys'](_0x398b26['query']);_0xc3a650[_0x4e33('0x41')]=_[_0x4e33('0x3a')](_0xc3a650[_0x4e33('0x37')],_0xc3a650[_0x4e33('0x3c')]);_0x56b589[_0x4e33('0x3b')]=_['intersection'](_0xc3a650['model'],qs[_0x4e33('0x4b')](_0x398b26[_0x4e33('0x3c')][_0x4e33('0x4b')]));_0x56b589[_0x4e33('0x3b')]=_0x56b589['attributes'][_0x4e33('0x4c')]?_0x56b589[_0x4e33('0x3b')]:_0xc3a650[_0x4e33('0x37')];if(_0x398b26[_0x4e33('0x3c')][_0x4e33('0x4d')]){_0x56b589[_0x4e33('0x46')]=[{'all':!![]}];}_0x56b589=_['merge']({},_0x56b589,_0x398b26[_0x4e33('0x45')]);return db[_0x4e33('0x33')]['find'](_0x56b589)['then'](handleEntityNotFound(_0x454d5f,null))['then'](respondWithResult(_0x454d5f,null))[_0x4e33('0x49')](handleError(_0x454d5f,null));};exports[_0x4e33('0x4e')]=function(_0x57f3f1,_0x30fca6){return db['MailQueue']['create'](_0x57f3f1[_0x4e33('0x4f')],{})['then'](function(_0x426473){var _0x2fc140=_0x57f3f1[_0x4e33('0x50')][_0x4e33('0x51')]({'plain':!![]});if(!_0x2fc140)throw new Error(_0x4e33('0x52'));if(_0x2fc140['role']===_0x4e33('0x50')){var _0x3ce626=_0x426473[_0x4e33('0x51')]({'plain':!![]});var _0x5ccda5=_0x4e33('0x2c');return db[_0x4e33('0x53')][_0x4e33('0x54')]({'where':{'name':_0x5ccda5,'userProfileId':_0x2fc140['userProfileId']},'raw':!![]})[_0x4e33('0x2a')](function(_0x1f997c){if(_0x1f997c&&_0x1f997c['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x3ce626[_0x4e33('0x38')],'resourceId':_0x3ce626['id'],'type':_0x1f997c[_0x4e33('0x38')],'sectionId':_0x1f997c['id']},{})[_0x4e33('0x2a')](function(){return _0x426473;});}else{return _0x426473;}})['catch'](function(_0x5a9872){logger[_0x4e33('0x2f')](_0x4e33('0x55'),_0x5a9872);throw _0x5a9872;});}return _0x426473;})[_0x4e33('0x2a')](respondWithResult(_0x30fca6,0xc9))['catch'](handleError(_0x30fca6,null));};exports['update']=function(_0x41849d,_0x394d31){if(_0x41849d[_0x4e33('0x4f')]['id']){delete _0x41849d[_0x4e33('0x4f')]['id'];}return db[_0x4e33('0x33')][_0x4e33('0x54')]({'where':{'id':_0x41849d[_0x4e33('0x4a')]['id']}})[_0x4e33('0x2a')](handleEntityNotFound(_0x394d31,null))[_0x4e33('0x2a')](saveUpdates(_0x41849d['body'],null))['then'](respondWithResult(_0x394d31,null))[_0x4e33('0x49')](handleError(_0x394d31,null));};exports[_0x4e33('0x2b')]=function(_0x79d8e,_0x5c4041){return db[_0x4e33('0x33')][_0x4e33('0x54')]({'where':{'id':_0x79d8e[_0x4e33('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5c4041,null))['then'](removeEntity(_0x5c4041,null))[_0x4e33('0x49')](handleError(_0x5c4041,null));};exports[_0x4e33('0x56')]=function(_0x109a84,_0x515c31){return db['MailQueue'][_0x4e33('0x56')]()[_0x4e33('0x2a')](respondWithResult(_0x515c31,null))['catch'](handleError(_0x515c31,null));};exports[_0x4e33('0x57')]=function(_0xe37871,_0x2a86ab,_0x6a7e9c){var _0x4b96bb={'raw':!![],'where':{}},_0x32def9={},_0x432f41;return db['MailQueue'][_0x4e33('0x58')]({'where':{'id':_0xe37871['params']['id']}})[_0x4e33('0x2a')](handleEntityNotFound(_0x2a86ab,null))[_0x4e33('0x2a')](function(_0x4cfad8){if(_0x4cfad8){_0x432f41=_0x4cfad8[_0x4e33('0x51')]({'plain':!![]});_0x32def9['model']=_[_0x4e33('0x39')](db[_0x4e33('0x59')][_0x4e33('0x34')]);_0x32def9['query']=_[_0x4e33('0x39')](_0xe37871[_0x4e33('0x3c')]);_0x32def9['filters']=_[_0x4e33('0x3a')](_0x32def9[_0x4e33('0x37')],_0x32def9[_0x4e33('0x3c')]);_0x4b96bb[_0x4e33('0x3b')]=_[_0x4e33('0x3a')](_0x32def9[_0x4e33('0x37')],qs[_0x4e33('0x4b')](_0xe37871['query'][_0x4e33('0x4b')]));_0x4b96bb[_0x4e33('0x3b')]=_0x4b96bb[_0x4e33('0x3b')][_0x4e33('0x4c')]?_0x4b96bb['attributes']:_0x32def9['model'];if(!_0xe37871['query'][_0x4e33('0x3d')](_0x4e33('0x5a'))){_0x4b96bb[_0x4e33('0x23')]=qs[_0x4e33('0x23')](_0xe37871[_0x4e33('0x3c')]['limit']);_0x4b96bb[_0x4e33('0x22')]=qs[_0x4e33('0x22')](_0xe37871[_0x4e33('0x3c')]['offset']);}_0x4b96bb[_0x4e33('0x3e')]=qs[_0x4e33('0x3f')](_0xe37871[_0x4e33('0x3c')][_0x4e33('0x3f')]);_0x4b96bb['where']=qs['filters'](_['pick'](_0xe37871[_0x4e33('0x3c')],_0x32def9['filters']));_0x4b96bb[_0x4e33('0x40')]['MailQueueId']=_0x4cfad8['id'];if(_0xe37871['query'][_0x4e33('0x42')]){_0x4b96bb[_0x4e33('0x40')]=_['merge'](_0x4b96bb[_0x4e33('0x40')],{'$or':_[_0x4e33('0x32')](_0x4b96bb[_0x4e33('0x3b')],function(_0x24a7bc){var _0x44dd65={};_0x44dd65[_0x24a7bc]={'$like':'%'+_0xe37871[_0x4e33('0x3c')][_0x4e33('0x42')]+'%'};return _0x44dd65;})});}_0x4b96bb=_['merge']({},_0x4b96bb,_0xe37871[_0x4e33('0x45')]);return db[_0x4e33('0x59')][_0x4e33('0x47')](_0x4b96bb);}})[_0x4e33('0x2a')](function(_0x121488){if(_0x121488){return db[_0x4e33('0x5b')][_0x4e33('0x5c')]({'where':{'id':_[_0x4e33('0x32')](_0x121488,_0x4e33('0x5d')),'role':'agent'},'attributes':['id',_0x4e33('0x38'),_0x4e33('0x5e'),'updatedAt','createdAt']});}})[_0x4e33('0x2a')](function(_0xd4fd3){if(_0xd4fd3){return{'count':_0xd4fd3[_0x4e33('0x25')],'rows':_[_0x4e33('0x32')](_0xd4fd3[_0x4e33('0x48')],function(_0x3f8e6d){return{'membername':_0x3f8e6d['name'],'UserId':_0x3f8e6d['id'],'queue_name':_0x432f41[_0x4e33('0x38')],'MailQueueId':_0x432f41['id'],'interface':util[_0x4e33('0x5f')](_0x4e33('0x60'),_0x4e33('0x61'),_0x3f8e6d[_0x4e33('0x38')]),'penalty':0x0,'paused':_0x3f8e6d[_0x4e33('0x5e')],'createdAt':_0x3f8e6d[_0x4e33('0x62')],'updatedAt':_0x3f8e6d[_0x4e33('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x4e33('0x2a')](respondWithFilteredResult(_0x2a86ab,_0x4b96bb))[_0x4e33('0x49')](handleError(_0x2a86ab,null));};exports[_0x4e33('0x64')]=function(_0x132dec,_0x574baf,_0x10e721){var _0xd0763c={};var _0x3ee183={};var _0x4e8a5d;var _0x5778c1;return db['MailQueue']['findOne']({'where':{'id':_0x132dec[_0x4e33('0x4a')]['id']}})[_0x4e33('0x2a')](handleEntityNotFound(_0x574baf,null))[_0x4e33('0x2a')](function(_0x3ed683){if(_0x3ed683){_0x4e8a5d=_0x3ed683;_0x3ee183[_0x4e33('0x37')]=_[_0x4e33('0x39')](db[_0x4e33('0x65')]['rawAttributes']);_0x3ee183[_0x4e33('0x3c')]=_['keys'](_0x132dec[_0x4e33('0x3c')]);_0x3ee183[_0x4e33('0x41')]=_[_0x4e33('0x3a')](_0x3ee183['model'],_0x3ee183[_0x4e33('0x3c')]);_0xd0763c['attributes']=_[_0x4e33('0x3a')](_0x3ee183[_0x4e33('0x37')],qs[_0x4e33('0x4b')](_0x132dec[_0x4e33('0x3c')][_0x4e33('0x4b')]));_0xd0763c[_0x4e33('0x3b')]=_0xd0763c[_0x4e33('0x3b')]['length']?_0xd0763c[_0x4e33('0x3b')]:_0x3ee183['model'];_0xd0763c[_0x4e33('0x3e')]=qs[_0x4e33('0x3f')](_0x132dec[_0x4e33('0x3c')][_0x4e33('0x3f')]);_0xd0763c['where']=qs[_0x4e33('0x41')](_['pick'](_0x132dec[_0x4e33('0x3c')],_0x3ee183[_0x4e33('0x41')]));if(_0x132dec[_0x4e33('0x3c')]['filter']){_0xd0763c['where']=_['merge'](_0xd0763c[_0x4e33('0x40')],{'$or':_['map'](_0xd0763c['attributes'],function(_0x10a1bf){var _0x24a91f={};_0x24a91f[_0x10a1bf]={'$like':'%'+_0x132dec[_0x4e33('0x3c')][_0x4e33('0x42')]+'%'};return _0x24a91f;})});}_0xd0763c=_[_0x4e33('0x44')]({},_0xd0763c,_0x132dec['options']);return _0x4e8a5d[_0x4e33('0x64')](_0xd0763c);}})[_0x4e33('0x2a')](function(_0xabbba6){if(_0xabbba6){_0x5778c1=_0xabbba6[_0x4e33('0x4c')];if(!_0x132dec[_0x4e33('0x3c')][_0x4e33('0x3d')](_0x4e33('0x5a'))){_0xd0763c['limit']=qs[_0x4e33('0x23')](_0x132dec['query']['limit']);_0xd0763c[_0x4e33('0x22')]=qs[_0x4e33('0x22')](_0x132dec[_0x4e33('0x3c')][_0x4e33('0x22')]);}return _0x4e8a5d[_0x4e33('0x64')](_0xd0763c);}})[_0x4e33('0x2a')](function(_0x5130e5){if(_0x5130e5){return _0x5130e5?{'count':_0x5778c1,'rows':_0x5130e5}:null;}})[_0x4e33('0x2a')](respondWithResult(_0x574baf,null))['catch'](handleError(_0x574baf,null));};exports[_0x4e33('0x66')]=function(_0x110949,_0x360e9b,_0x24cb29){var _0x27f6db=_0x110949[_0x4e33('0x4f')]['ids'];return db[_0x4e33('0x65')][_0x4e33('0x47')]({'where':{'id':_0x27f6db},'attributes':['id'],'include':[{'model':db[_0x4e33('0x5b')],'as':_0x4e33('0x67'),'attributes':['id',_0x4e33('0x38'),_0x4e33('0x68'),_0x4e33('0x69'),_0x4e33('0x6a')],'raw':!![]}]})['then'](function(_0x2d22b1){if(_0x2d22b1){var _0x44bd79=_[_0x4e33('0x6b')](_0x2d22b1,function(_0x45249c){var _0xf17d7b=_0x45249c['get']({'plain':!![]});return _0xf17d7b[_0x4e33('0x67')];});return db[_0x4e33('0x33')][_0x4e33('0x54')]({'where':{'id':_0x110949['params']['id']}})[_0x4e33('0x2a')](function(_0x58cd17){return db[_0x4e33('0x6c')][_0x4e33('0x6d')](function(_0x43bcf5){return _0x58cd17[_0x4e33('0x66')](_0x27f6db,{'transaction':_0x43bcf5})[_0x4e33('0x2a')](function(){return BPromise['each'](_0x44bd79,function(_0x30151c){return db[_0x4e33('0x59')][_0x4e33('0x6e')]({'where':{'UserId':_0x30151c['id'],'MailQueueId':_0x110949['params']['id']},'transaction':_0x43bcf5});});})['then'](function(){_0x44bd79['forEach'](function(_0x102d29){socket['emit'](_0x4e33('0x6f'),{'UserId':_0x102d29['id'],'MailQueueId':_0x58cd17['id']});});});});});}})[_0x4e33('0x2a')](respondWithStatusCode(_0x360e9b,null))['catch'](handleError(_0x360e9b,null));};exports[_0x4e33('0x70')]=function(_0x40a071,_0x2469c7,_0xc5b826){return db[_0x4e33('0x65')]['findAll']({'where':{'id':_0x40a071[_0x4e33('0x3c')][_0x4e33('0x71')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x4e33('0x67'),'attributes':['id'],'raw':!![]}]})[_0x4e33('0x2a')](handleEntityNotFound(_0x2469c7,null))[_0x4e33('0x2a')](function(_0x3a2e71){var _0x824133=_[_0x4e33('0x32')](_0x3a2e71,'id');var _0x1123d0=[];var _0x1abfd0=[];var _0xe56c79=squel['select']();_0xe56c79[_0x4e33('0x72')](_0x4e33('0x73'))[_0x4e33('0x74')](_0x4e33('0x75'),'tq')['join'](_0x4e33('0x76'),'ut',_0x4e33('0x77'))[_0x4e33('0x40')](_0x4e33('0x78'),_0x40a071[_0x4e33('0x4a')]['id']);for(var _0x2797e4=0x0;_0x2797e4<_0x3a2e71[_0x4e33('0x4c')];_0x2797e4+=0x1){let _0x1a5759=_0x3a2e71[_0x2797e4];for(var _0x296cea=0x0;_0x296cea<_0x1a5759[_0x4e33('0x67')][_0x4e33('0x4c')];_0x296cea+=0x1){let _0x40a771=_0x1a5759[_0x4e33('0x67')][_0x296cea];var _0x396415=_0xe56c79[_0x4e33('0x79')]();_0x396415['where']('ut.UserId\x20=\x20?',_0x40a771['id']);_0x1abfd0['push'](db[_0x4e33('0x6c')]['query'](_0x396415['toString'](),{'type':db['sequelize'][_0x4e33('0x7a')]['SELECT']})[_0x4e33('0x2a')](function(_0x554444){if(_0x554444[_0x4e33('0x4c')]===0x1){return _0x40a771['id'];}else{var _0xc6fdeb=_['every'](_[_0x4e33('0x32')](_0x554444,_0x4e33('0x7b')),function(_0x133f36){return _[_0x4e33('0x7c')](_0x824133,_0x133f36);});if(_0xc6fdeb){return _0x40a771['id'];}}}));}}return BPromise['all'](_0x1abfd0)[_0x4e33('0x2a')](function(_0x2c87a3){_0x1123d0=_(_0x1123d0)[_0x4e33('0x7d')](_0x2c87a3)['compact']()[_0x4e33('0x7e')]();return db['MailQueue'][_0x4e33('0x54')]({'where':{'id':_0x40a071[_0x4e33('0x4a')]['id']}})[_0x4e33('0x2a')](function(_0x7756cf){return db[_0x4e33('0x6c')][_0x4e33('0x6d')](function(_0xb5ed6a){return _0x7756cf[_0x4e33('0x70')](_0x40a071[_0x4e33('0x3c')][_0x4e33('0x71')],{'transaction':_0xb5ed6a})[_0x4e33('0x2a')](function(){if(!_[_0x4e33('0x7f')](_0x1123d0)){return _0x7756cf[_0x4e33('0x80')](_0x1123d0,{'transaction':_0xb5ed6a});}})[_0x4e33('0x2a')](function(){_0x1123d0[_0x4e33('0x81')](function(_0x40970d){socket['emit'](_0x4e33('0x82'),{'UserId':_0x40970d,'MailQueueId':_0x7756cf['id']});});});});});});})['then'](respondWithStatusCode(_0x2469c7,null))[_0x4e33('0x49')](handleError(_0x2469c7,null));};exports[_0x4e33('0x83')]=function(_0x4c85b6,_0x590f19,_0x175615){return db[_0x4e33('0x33')][_0x4e33('0x54')]({'where':{'id':_0x4c85b6[_0x4e33('0x4a')]['id']}})['then'](handleEntityNotFound(_0x590f19,null))[_0x4e33('0x2a')](function(_0x53cb60){if(_0x53cb60){return _0x53cb60['addAgents'](_0x4c85b6[_0x4e33('0x4f')][_0x4e33('0x71')],_[_0x4e33('0x84')](_0x4c85b6[_0x4e33('0x4f')],['ids','id'])||{})[_0x4e33('0x85')](function(_0x35dfd4){for(var _0x4e768b=0x0;_0x4e768b<_0x4c85b6[_0x4e33('0x4f')][_0x4e33('0x71')]['length'];_0x4e768b+=0x1){socket['emit']('userMailQueue:save',{'UserId':Number(_0x4c85b6[_0x4e33('0x4f')][_0x4e33('0x71')][_0x4e768b]),'MailQueueId':Number(_0x4c85b6[_0x4e33('0x4a')]['id'])});}return _0x35dfd4;});}})[_0x4e33('0x2a')](respondWithResult(_0x590f19,null))[_0x4e33('0x49')](handleError(_0x590f19,null));};exports[_0x4e33('0x80')]=function(_0x79e003,_0x5b1d26,_0x2e6f9d){return db[_0x4e33('0x33')][_0x4e33('0x54')]({'where':{'id':_0x79e003[_0x4e33('0x4a')]['id']}})[_0x4e33('0x2a')](handleEntityNotFound(_0x5b1d26,null))[_0x4e33('0x2a')](function(_0x45b7f1){if(_0x45b7f1){return _0x45b7f1[_0x4e33('0x80')](_0x79e003[_0x4e33('0x3c')][_0x4e33('0x71')])[_0x4e33('0x2a')](function(){if(_[_0x4e33('0x86')](_0x79e003[_0x4e33('0x3c')][_0x4e33('0x71')])){for(var _0x1093a9=0x0;_0x1093a9<_0x79e003[_0x4e33('0x3c')][_0x4e33('0x71')][_0x4e33('0x4c')];_0x1093a9+=0x1){socket[_0x4e33('0x87')](_0x4e33('0x82'),{'UserId':Number(_0x79e003[_0x4e33('0x3c')][_0x4e33('0x71')][_0x1093a9]),'MailQueueId':Number(_0x79e003['params']['id'])});}}else{socket[_0x4e33('0x87')]('userMailQueue:remove',{'UserId':Number(_0x79e003[_0x4e33('0x3c')][_0x4e33('0x71')]),'MailQueueId':Number(_0x79e003[_0x4e33('0x4a')]['id'])});}});}})[_0x4e33('0x2a')](respondWithStatusCode(_0x5b1d26,null))[_0x4e33('0x49')](handleError(_0x5b1d26,null));};exports[_0x4e33('0x88')]=function(_0x48fdee,_0x2498c5,_0x5aad16){var _0x3f3415={};var _0x468dfb={};var _0x3d6988;var _0x1d8c9d;return db['MailQueue'][_0x4e33('0x58')]({'where':{'id':_0x48fdee['params']['id']}})[_0x4e33('0x2a')](handleEntityNotFound(_0x2498c5,null))[_0x4e33('0x2a')](function(_0x22acb4){if(_0x22acb4){_0x3d6988=_0x22acb4;_0x468dfb[_0x4e33('0x37')]=_['keys'](db['User']['rawAttributes']);_0x468dfb[_0x4e33('0x3c')]=_[_0x4e33('0x39')](_0x48fdee[_0x4e33('0x3c')]);_0x468dfb[_0x4e33('0x41')]=_[_0x4e33('0x3a')](_0x468dfb[_0x4e33('0x37')],_0x468dfb[_0x4e33('0x3c')]);_0x3f3415[_0x4e33('0x3b')]=_[_0x4e33('0x3a')](_0x468dfb[_0x4e33('0x37')],qs[_0x4e33('0x4b')](_0x48fdee[_0x4e33('0x3c')]['fields']));_0x3f3415[_0x4e33('0x3b')]=_0x3f3415[_0x4e33('0x3b')][_0x4e33('0x4c')]?_0x3f3415[_0x4e33('0x3b')]:_0x468dfb[_0x4e33('0x37')];_0x3f3415['order']=qs['sort'](_0x48fdee[_0x4e33('0x3c')][_0x4e33('0x3f')]);_0x3f3415[_0x4e33('0x40')]=qs['filters'](_[_0x4e33('0x89')](_0x48fdee[_0x4e33('0x3c')],_0x468dfb['filters']));if(_0x48fdee['query'][_0x4e33('0x42')]){_0x3f3415[_0x4e33('0x40')]=_['merge'](_0x3f3415[_0x4e33('0x40')],{'$or':_['map'](_0x3f3415[_0x4e33('0x3b')],function(_0x56ff26){var _0x436951={};_0x436951[_0x56ff26]={'$like':'%'+_0x48fdee['query'][_0x4e33('0x42')]+'%'};return _0x436951;})});}_0x3f3415=_[_0x4e33('0x44')]({},_0x3f3415,_0x48fdee['options']);return _0x3d6988[_0x4e33('0x88')](_0x3f3415);}})[_0x4e33('0x2a')](function(_0x2326b2){if(_0x2326b2){_0x1d8c9d=_0x2326b2[_0x4e33('0x4c')];if(!_0x48fdee['query'][_0x4e33('0x3d')](_0x4e33('0x5a'))){_0x3f3415[_0x4e33('0x23')]=qs['limit'](_0x48fdee[_0x4e33('0x3c')][_0x4e33('0x23')]);_0x3f3415['offset']=qs[_0x4e33('0x22')](_0x48fdee['query'][_0x4e33('0x22')]);}return _0x3d6988[_0x4e33('0x88')](_0x3f3415);}})[_0x4e33('0x2a')](function(_0x27cfbc){if(_0x27cfbc){return _0x27cfbc?{'count':_0x1d8c9d,'rows':_0x27cfbc}:null;}})[_0x4e33('0x2a')](respondWithResult(_0x2498c5,null))['catch'](handleError(_0x2498c5,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index b6d31bc..723efa6 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 _0x8eaf=['../../mysqldb','MailQueue','setMaxListeners','remove','emit','hasOwnProperty','hook','events'];(function(_0xeb4c8b,_0x1dc497){var _0x90b0d0=function(_0x332e32){while(--_0x332e32){_0xeb4c8b['push'](_0xeb4c8b['shift']());}};_0x90b0d0(++_0x1dc497);}(_0x8eaf,0x107));var _0xf8ea=function(_0x38d499,_0x1cbb6b){_0x38d499=_0x38d499-0x0;var _0x274b18=_0x8eaf[_0x38d499];return _0x274b18;};'use strict';var EventEmitter=require(_0xf8ea('0x0'));var MailQueue=require(_0xf8ea('0x1'))['db'][_0xf8ea('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xf8ea('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xf8ea('0x4')};function emitEvent(_0x53a594){return function(_0x2c837a,_0x5c17b8,_0x4c0371){MailQueueEvents['emit'](_0x53a594+':'+_0x2c837a['id'],_0x2c837a);MailQueueEvents[_0xf8ea('0x5')](_0x53a594,_0x2c837a);_0x4c0371(null);};}for(var e in events){if(events[_0xf8ea('0x6')](e)){var event=events[e];MailQueue[_0xf8ea('0x7')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file +var _0xdad9=['update','remove','emit','hasOwnProperty','../../mysqldb','MailQueue','setMaxListeners','save'];(function(_0x3859b2,_0x25cbd0){var _0x3c1afe=function(_0x456d65){while(--_0x456d65){_0x3859b2['push'](_0x3859b2['shift']());}};_0x3c1afe(++_0x25cbd0);}(_0xdad9,0x1b4));var _0x9dad=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xdad9[_0x17d9e3];return _0x14192d;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x9dad('0x0'))['db'][_0x9dad('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x9dad('0x2')](0x0);var events={'afterCreate':_0x9dad('0x3'),'afterUpdate':_0x9dad('0x4'),'afterDestroy':_0x9dad('0x5')};function emitEvent(_0x33fa63){return function(_0x2855d2,_0x48359b,_0x5e00cf){MailQueueEvents[_0x9dad('0x6')](_0x33fa63+':'+_0x2855d2['id'],_0x2855d2);MailQueueEvents[_0x9dad('0x6')](_0x33fa63,_0x2855d2);_0x5e00cf(null);};}for(var e in events){if(events[_0x9dad('0x7')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index b47bce6..2d38b99 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 _0x06ba=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./mailQueue.attributes','exports','define','MailQueue','mail_queues'];(function(_0x155bdb,_0x2ac991){var _0x3d6ecd=function(_0x5f0eeb){while(--_0x5f0eeb){_0x155bdb['push'](_0x155bdb['shift']());}};_0x3d6ecd(++_0x2ac991);}(_0x06ba,0x111));var _0xa06b=function(_0x452f79,_0x2b61d6){_0x452f79=_0x452f79-0x0;var _0x4b2548=_0x06ba[_0x452f79];return _0x4b2548;};'use strict';var _=require(_0xa06b('0x0'));var util=require('util');var logger=require(_0xa06b('0x1'))(_0xa06b('0x2'));var moment=require(_0xa06b('0x3'));var BPromise=require(_0xa06b('0x4'));var rp=require(_0xa06b('0x5'));var fs=require('fs');var path=require(_0xa06b('0x6'));var rimraf=require(_0xa06b('0x7'));var config=require('../../config/environment');var attributes=require(_0xa06b('0x8'));module[_0xa06b('0x9')]=function(_0x249977,_0x407a45){return _0x249977[_0xa06b('0xa')](_0xa06b('0xb'),attributes,{'tableName':_0xa06b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xffa7=['moment','request-promise','path','rimraf','../../config/environment','define','MailQueue','mail_queues','lodash','util','../../config/logger'];(function(_0xc55d64,_0x133f2d){var _0x4194f6=function(_0x4a38c9){while(--_0x4a38c9){_0xc55d64['push'](_0xc55d64['shift']());}};_0x4194f6(++_0x133f2d);}(_0xffa7,0xc3));var _0x7ffa=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xffa7[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7ffa('0x0'));var util=require(_0x7ffa('0x1'));var logger=require(_0x7ffa('0x2'))('api');var moment=require(_0x7ffa('0x3'));var BPromise=require('bluebird');var rp=require(_0x7ffa('0x4'));var fs=require('fs');var path=require(_0x7ffa('0x5'));var rimraf=require(_0x7ffa('0x6'));var config=require(_0x7ffa('0x7'));var attributes=require('./mailQueue.attributes');module['exports']=function(_0x4e97aa,_0x218451){return _0x4e97aa[_0x7ffa('0x8')](_0x7ffa('0x9'),attributes,{'tableName':_0x7ffa('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 0b6fcd0..396929e 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 _0x4265=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailQueue.socket','request','then','MailQueue,\x20%s,\x20%s','debug','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','GetMailQueue','MailQueue','options','raw','limit','include','map','attributes','model','info','ShowMailQueue','lodash','util','moment','bluebird','randomstring'];(function(_0x313085,_0x230bbc){var _0x5526ff=function(_0x3652d4){while(--_0x3652d4){_0x313085['push'](_0x313085['shift']());}};_0x5526ff(++_0x230bbc);}(_0x4265,0xc3));var _0x5426=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x4265[_0xa148b7];return _0x51efd3;};'use strict';var _=require(_0x5426('0x0'));var util=require(_0x5426('0x1'));var moment=require(_0x5426('0x2'));var BPromise=require(_0x5426('0x3'));var rs=require(_0x5426('0x4'));var fs=require('fs');var Redis=require(_0x5426('0x5'));var db=require(_0x5426('0x6'))['db'];var utils=require(_0x5426('0x7'));var logger=require(_0x5426('0x8'))('rpc');var config=require(_0x5426('0x9'));var jayson=require(_0x5426('0xa'));var client=jayson[_0x5426('0xb')][_0x5426('0xc')]({'port':0x232a});config[_0x5426('0xd')]=_['defaults'](config[_0x5426('0xd')],{'host':_0x5426('0xe'),'port':0x18eb});var socket=require(_0x5426('0xf'))(new Redis(config['redis']));require(_0x5426('0x10'))['register'](socket);function respondWithRpcPromise(_0x4c052d,_0x3d7889,_0xb01321){return new BPromise(function(_0x1fe722,_0x27308b){return client[_0x5426('0x11')](_0x4c052d,_0xb01321)[_0x5426('0x12')](function(_0x587743){logger['info'](_0x5426('0x13'),_0x3d7889,'request\x20sent');logger[_0x5426('0x14')](_0x5426('0x15'),_0x3d7889,_0x5426('0x16'),JSON[_0x5426('0x17')](_0x587743));if(_0x587743['error']){if(_0x587743['error'][_0x5426('0x18')]===0x1f4){logger['error'](_0x5426('0x13'),_0x3d7889,_0x587743[_0x5426('0x19')]['message']);return _0x27308b(_0x587743[_0x5426('0x19')][_0x5426('0x1a')]);}logger['error'](_0x5426('0x13'),_0x3d7889,_0x587743[_0x5426('0x19')][_0x5426('0x1a')]);return _0x1fe722(_0x587743[_0x5426('0x19')][_0x5426('0x1a')]);}else{logger['info'](_0x5426('0x13'),_0x3d7889,_0x5426('0x16'));_0x1fe722(_0x587743[_0x5426('0x1b')]['message']);}})[_0x5426('0x1c')](function(_0x326139){logger[_0x5426('0x19')](_0x5426('0x13'),_0x3d7889,_0x326139);_0x27308b(_0x326139);});});}exports[_0x5426('0x1d')]=function(_0x4a61bb){var _0x568b0e=this;return new Promise(function(_0x46691f,_0x103923){return db[_0x5426('0x1e')]['findAll']({'raw':_0x4a61bb['options']?_0x4a61bb[_0x5426('0x1f')][_0x5426('0x20')]===undefined?!![]:![]:!![],'where':_0x4a61bb[_0x5426('0x1f')]?_0x4a61bb['options']['where']||null:null,'attributes':_0x4a61bb[_0x5426('0x1f')]?_0x4a61bb[_0x5426('0x1f')]['attributes']||null:null,'limit':_0x4a61bb[_0x5426('0x1f')]?_0x4a61bb[_0x5426('0x1f')][_0x5426('0x21')]||null:null,'include':_0x4a61bb['options']?_0x4a61bb[_0x5426('0x1f')][_0x5426('0x22')]?_[_0x5426('0x23')](_0x4a61bb[_0x5426('0x1f')][_0x5426('0x22')],function(_0x45806){return{'model':db[_0x45806['model']],'as':_0x45806['as'],'attributes':_0x45806[_0x5426('0x24')],'include':_0x45806[_0x5426('0x22')]?_['map'](_0x45806[_0x5426('0x22')],function(_0x7e65e8){return{'model':db[_0x7e65e8[_0x5426('0x25')]],'as':_0x7e65e8['as'],'attributes':_0x7e65e8['attributes'],'include':_0x7e65e8['include']?_['map'](_0x7e65e8['include'],function(_0x29d20d){return{'model':db[_0x29d20d[_0x5426('0x25')]],'as':_0x29d20d['as'],'attributes':_0x29d20d[_0x5426('0x24')]};}):[]};}):[]};}):[]:[]})[_0x5426('0x12')](function(_0x4da125){logger['info'](_0x5426('0x1d'),_0x4a61bb);logger['debug'](_0x5426('0x1d'),_0x4a61bb,JSON[_0x5426('0x17')](_0x4da125));_0x46691f(_0x4da125);})[_0x5426('0x1c')](function(_0xd2cd00){logger[_0x5426('0x19')](_0x5426('0x1d'),_0xd2cd00[_0x5426('0x1a')],_0x4a61bb);_0x103923(_0x568b0e['error'](0x1f4,_0xd2cd00['message']));});});};exports['ShowMailQueue']=function(_0x38206d){var _0x12cbbb=this;return new Promise(function(_0x1f0fea,_0x203a72){return db[_0x5426('0x1e')]['find']({'raw':_0x38206d['options']?_0x38206d['options'][_0x5426('0x20')]===undefined?!![]:![]:!![],'where':_0x38206d['options']?_0x38206d[_0x5426('0x1f')]['where']||null:null,'attributes':_0x38206d[_0x5426('0x1f')]?_0x38206d[_0x5426('0x1f')]['attributes']||null:null,'include':_0x38206d['options']?_0x38206d[_0x5426('0x1f')][_0x5426('0x22')]?_[_0x5426('0x23')](_0x38206d[_0x5426('0x1f')][_0x5426('0x22')],function(_0x44d881){return{'model':db[_0x44d881[_0x5426('0x25')]],'as':_0x44d881['as'],'attributes':_0x44d881[_0x5426('0x24')],'include':_0x44d881[_0x5426('0x22')]?_[_0x5426('0x23')](_0x44d881[_0x5426('0x22')],function(_0x327706){return{'model':db[_0x327706['model']],'as':_0x327706['as'],'attributes':_0x327706[_0x5426('0x24')],'include':_0x327706[_0x5426('0x22')]?_[_0x5426('0x23')](_0x327706[_0x5426('0x22')],function(_0x235221){return{'model':db[_0x235221[_0x5426('0x25')]],'as':_0x235221['as'],'attributes':_0x235221[_0x5426('0x24')]};}):[]};}):[]};}):[]:[]})[_0x5426('0x12')](function(_0x2dd182){logger[_0x5426('0x26')]('ShowMailQueue',_0x38206d);logger[_0x5426('0x14')](_0x5426('0x27'),_0x38206d,JSON['stringify'](_0x2dd182));_0x1f0fea(_0x2dd182);})[_0x5426('0x1c')](function(_0x285382){logger[_0x5426('0x19')](_0x5426('0x27'),_0x285382[_0x5426('0x1a')],_0x38206d);_0x203a72(_0x12cbbb[_0x5426('0x19')](0x1f4,_0x285382[_0x5426('0x1a')]));});});}; \ No newline at end of file +var _0x0879=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','then','info','MailQueue,\x20%s,\x20%s','debug','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetMailQueue','MailQueue','findAll','options','raw','attributes','include','map','model','ShowMailQueue','stringify','lodash','util','bluebird','randomstring','ioredis'];(function(_0x48deac,_0x4d8ab8){var _0x3b5eaa=function(_0x91c61e){while(--_0x91c61e){_0x48deac['push'](_0x48deac['shift']());}};_0x3b5eaa(++_0x4d8ab8);}(_0x0879,0x1e9));var _0x9087=function(_0x4a01bd,_0x172e88){_0x4a01bd=_0x4a01bd-0x0;var _0x2c01e7=_0x0879[_0x4a01bd];return _0x2c01e7;};'use strict';var _=require(_0x9087('0x0'));var util=require(_0x9087('0x1'));var moment=require('moment');var BPromise=require(_0x9087('0x2'));var rs=require(_0x9087('0x3'));var fs=require('fs');var Redis=require(_0x9087('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9087('0x5'));var logger=require(_0x9087('0x6'))(_0x9087('0x7'));var config=require(_0x9087('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9087('0x9')][_0x9087('0xa')]({'port':0x232a});config[_0x9087('0xb')]=_[_0x9087('0xc')](config[_0x9087('0xb')],{'host':_0x9087('0xd'),'port':0x18eb});var socket=require(_0x9087('0xe'))(new Redis(config['redis']));require(_0x9087('0xf'))['register'](socket);function respondWithRpcPromise(_0x2e4c2d,_0x538308,_0x495ff4){return new BPromise(function(_0x280156,_0xfa47c3){return client['request'](_0x2e4c2d,_0x495ff4)[_0x9087('0x10')](function(_0x460a92){logger[_0x9087('0x11')](_0x9087('0x12'),_0x538308,'request\x20sent');logger[_0x9087('0x13')](_0x9087('0x14'),_0x538308,_0x9087('0x15'),JSON['stringify'](_0x460a92));if(_0x460a92[_0x9087('0x16')]){if(_0x460a92[_0x9087('0x16')][_0x9087('0x17')]===0x1f4){logger['error'](_0x9087('0x12'),_0x538308,_0x460a92[_0x9087('0x16')][_0x9087('0x18')]);return _0xfa47c3(_0x460a92[_0x9087('0x16')]['message']);}logger[_0x9087('0x16')](_0x9087('0x12'),_0x538308,_0x460a92[_0x9087('0x16')]['message']);return _0x280156(_0x460a92[_0x9087('0x16')]['message']);}else{logger['info'](_0x9087('0x12'),_0x538308,'request\x20sent');_0x280156(_0x460a92[_0x9087('0x19')][_0x9087('0x18')]);}})[_0x9087('0x1a')](function(_0x4d3030){logger[_0x9087('0x16')](_0x9087('0x12'),_0x538308,_0x4d3030);_0xfa47c3(_0x4d3030);});});}exports[_0x9087('0x1b')]=function(_0x2b36ad){var _0x5173c9=this;return new Promise(function(_0x54b512,_0x3f9329){return db[_0x9087('0x1c')][_0x9087('0x1d')]({'raw':_0x2b36ad[_0x9087('0x1e')]?_0x2b36ad[_0x9087('0x1e')][_0x9087('0x1f')]===undefined?!![]:![]:!![],'where':_0x2b36ad['options']?_0x2b36ad[_0x9087('0x1e')]['where']||null:null,'attributes':_0x2b36ad[_0x9087('0x1e')]?_0x2b36ad[_0x9087('0x1e')][_0x9087('0x20')]||null:null,'limit':_0x2b36ad[_0x9087('0x1e')]?_0x2b36ad[_0x9087('0x1e')]['limit']||null:null,'include':_0x2b36ad[_0x9087('0x1e')]?_0x2b36ad[_0x9087('0x1e')][_0x9087('0x21')]?_[_0x9087('0x22')](_0x2b36ad['options'][_0x9087('0x21')],function(_0x4ca6b7){return{'model':db[_0x4ca6b7[_0x9087('0x23')]],'as':_0x4ca6b7['as'],'attributes':_0x4ca6b7[_0x9087('0x20')],'include':_0x4ca6b7[_0x9087('0x21')]?_[_0x9087('0x22')](_0x4ca6b7[_0x9087('0x21')],function(_0x5c25c7){return{'model':db[_0x5c25c7[_0x9087('0x23')]],'as':_0x5c25c7['as'],'attributes':_0x5c25c7[_0x9087('0x20')],'include':_0x5c25c7['include']?_[_0x9087('0x22')](_0x5c25c7[_0x9087('0x21')],function(_0x46c9ce){return{'model':db[_0x46c9ce[_0x9087('0x23')]],'as':_0x46c9ce['as'],'attributes':_0x46c9ce[_0x9087('0x20')]};}):[]};}):[]};}):[]:[]})[_0x9087('0x10')](function(_0x306386){logger[_0x9087('0x11')]('GetMailQueue',_0x2b36ad);logger[_0x9087('0x13')](_0x9087('0x1b'),_0x2b36ad,JSON['stringify'](_0x306386));_0x54b512(_0x306386);})[_0x9087('0x1a')](function(_0x44fc65){logger['error'](_0x9087('0x1b'),_0x44fc65['message'],_0x2b36ad);_0x3f9329(_0x5173c9[_0x9087('0x16')](0x1f4,_0x44fc65['message']));});});};exports[_0x9087('0x24')]=function(_0x51fc25){var _0x18a83b=this;return new Promise(function(_0x5484ee,_0x3f6625){return db['MailQueue']['find']({'raw':_0x51fc25[_0x9087('0x1e')]?_0x51fc25['options'][_0x9087('0x1f')]===undefined?!![]:![]:!![],'where':_0x51fc25['options']?_0x51fc25[_0x9087('0x1e')]['where']||null:null,'attributes':_0x51fc25['options']?_0x51fc25[_0x9087('0x1e')][_0x9087('0x20')]||null:null,'include':_0x51fc25[_0x9087('0x1e')]?_0x51fc25[_0x9087('0x1e')][_0x9087('0x21')]?_['map'](_0x51fc25['options'][_0x9087('0x21')],function(_0x328c41){return{'model':db[_0x328c41[_0x9087('0x23')]],'as':_0x328c41['as'],'attributes':_0x328c41[_0x9087('0x20')],'include':_0x328c41[_0x9087('0x21')]?_[_0x9087('0x22')](_0x328c41[_0x9087('0x21')],function(_0x46208b){return{'model':db[_0x46208b['model']],'as':_0x46208b['as'],'attributes':_0x46208b[_0x9087('0x20')],'include':_0x46208b['include']?_[_0x9087('0x22')](_0x46208b[_0x9087('0x21')],function(_0x4e792e){return{'model':db[_0x4e792e[_0x9087('0x23')]],'as':_0x4e792e['as'],'attributes':_0x4e792e[_0x9087('0x20')]};}):[]};}):[]};}):[]:[]})[_0x9087('0x10')](function(_0x1a6eb6){logger[_0x9087('0x11')](_0x9087('0x24'),_0x51fc25);logger['debug'](_0x9087('0x24'),_0x51fc25,JSON[_0x9087('0x25')](_0x1a6eb6));_0x5484ee(_0x1a6eb6);})[_0x9087('0x1a')](function(_0x20d676){logger[_0x9087('0x16')]('ShowMailQueue',_0x20d676[_0x9087('0x18')],_0x51fc25);_0x3f6625(_0x18a83b['error'](0x1f4,_0x20d676['message']));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index e2a1038..d375913 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 _0xfcc5=['save','remove','update','removeListener','length'];(function(_0x5ef35e,_0x329db7){var _0x4cdc0c=function(_0x20bda0){while(--_0x20bda0){_0x5ef35e['push'](_0x5ef35e['shift']());}};_0x4cdc0c(++_0x329db7);}(_0xfcc5,0x14a));var _0x5fcc=function(_0x5e1b91,_0x236f17){_0x5e1b91=_0x5e1b91-0x0;var _0x59b52f=_0xfcc5[_0x5e1b91];return _0x59b52f;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0x5fcc('0x0'),_0x5fcc('0x1'),_0x5fcc('0x2')];function createListener(_0x3a592e,_0x4dbf5c){return function(_0x3c0ac7){_0x4dbf5c['emit'](_0x3a592e,_0x3c0ac7);};}function removeListener(_0x576e8a,_0x3d109e){return function(){MailQueueEvents[_0x5fcc('0x3')](_0x576e8a,_0x3d109e);};}exports['register']=function(_0x4a781a){for(var _0x154c05=0x0,_0x389247=events[_0x5fcc('0x4')];_0x154c05<_0x389247;_0x154c05++){var _0x2168c6=events[_0x154c05];var _0x2a8198=createListener('mailQueue:'+_0x2168c6,_0x4a781a);MailQueueEvents['on'](_0x2168c6,_0x2a8198);}}; \ No newline at end of file +var _0x4e52=['remove','update','emit','register','length','mailQueue:','./mailQueue.events','save'];(function(_0x624801,_0x3ed2e4){var _0x47300c=function(_0x222426){while(--_0x222426){_0x624801['push'](_0x624801['shift']());}};_0x47300c(++_0x3ed2e4);}(_0x4e52,0x6e));var _0x24e5=function(_0x308b6c,_0x2a7e3d){_0x308b6c=_0x308b6c-0x0;var _0x10dd0e=_0x4e52[_0x308b6c];return _0x10dd0e;};'use strict';var MailQueueEvents=require(_0x24e5('0x0'));var events=[_0x24e5('0x1'),_0x24e5('0x2'),_0x24e5('0x3')];function createListener(_0x2f104d,_0x51e148){return function(_0x1d669f){_0x51e148[_0x24e5('0x4')](_0x2f104d,_0x1d669f);};}function removeListener(_0x860b70,_0x37bbd4){return function(){MailQueueEvents['removeListener'](_0x860b70,_0x37bbd4);};}exports[_0x24e5('0x5')]=function(_0x10f78d){for(var _0x539a1a=0x0,_0x43d53a=events[_0x24e5('0x6')];_0x539a1a<_0x43d53a;_0x539a1a++){var _0x2acfae=events[_0x539a1a];var _0x172210=createListener(_0x24e5('0x7')+_0x2acfae,_0x10f78d);MailQueueEvents['on'](_0x2acfae,_0x172210);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 327a579..30e41ec 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 _0x2d3e=['exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','delete','destroy'];(function(_0x3e1a57,_0x1871fe){var _0x1598fd=function(_0x5f0dc5){while(--_0x5f0dc5){_0x3e1a57['push'](_0x3e1a57['shift']());}};_0x1598fd(++_0x1871fe);}(_0x2d3e,0x1b9));var _0xe2d3=function(_0x3ac7b6,_0x3ab1c5){_0x3ac7b6=_0x3ac7b6-0x0;var _0x4c0457=_0x2d3e[_0x3ac7b6];return _0x4c0457;};'use strict';var multer=require(_0xe2d3('0x0'));var util=require(_0xe2d3('0x1'));var path=require('path');var timeout=require(_0xe2d3('0x2'));var express=require('express');var router=express[_0xe2d3('0x3')]();var fs_extra=require(_0xe2d3('0x4'));var auth=require(_0xe2d3('0x5'));var interaction=require(_0xe2d3('0x6'));var config=require(_0xe2d3('0x7'));var controller=require(_0xe2d3('0x8'));router[_0xe2d3('0x9')]('/',auth[_0xe2d3('0xa')](),controller[_0xe2d3('0xb')]);router[_0xe2d3('0x9')](_0xe2d3('0xc'),auth[_0xe2d3('0xa')](),controller['describe']);router[_0xe2d3('0x9')](_0xe2d3('0xd'),auth[_0xe2d3('0xa')](),controller[_0xe2d3('0xe')]);router[_0xe2d3('0xf')]('/',auth[_0xe2d3('0xa')](),controller[_0xe2d3('0x10')]);router[_0xe2d3('0x11')]('/:id',auth[_0xe2d3('0xa')](),controller[_0xe2d3('0x12')]);router[_0xe2d3('0x13')]('/:id',auth[_0xe2d3('0xa')](),controller[_0xe2d3('0x14')]);module[_0xe2d3('0x15')]=router; \ No newline at end of file +var _0x07ad=['update','delete','destroy','exports','multer','path','connect-timeout','express','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create'];(function(_0x25ba40,_0x174567){var _0xa31493=function(_0x35ae4b){while(--_0x35ae4b){_0x25ba40['push'](_0x25ba40['shift']());}};_0xa31493(++_0x174567);}(_0x07ad,0xd5));var _0xd07a=function(_0x3d77d8,_0x491e92){_0x3d77d8=_0x3d77d8-0x0;var _0x3e4724=_0x07ad[_0x3d77d8];return _0x3e4724;};'use strict';var multer=require(_0xd07a('0x0'));var util=require('util');var path=require(_0xd07a('0x1'));var timeout=require(_0xd07a('0x2'));var express=require(_0xd07a('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd07a('0x4'));var controller=require(_0xd07a('0x5'));router[_0xd07a('0x6')]('/',auth[_0xd07a('0x7')](),controller[_0xd07a('0x8')]);router[_0xd07a('0x6')](_0xd07a('0x9'),auth[_0xd07a('0x7')](),controller[_0xd07a('0xa')]);router[_0xd07a('0x6')](_0xd07a('0xb'),auth[_0xd07a('0x7')](),controller[_0xd07a('0xc')]);router[_0xd07a('0xd')]('/',auth['isAuthenticated'](),controller[_0xd07a('0xe')]);router['put'](_0xd07a('0xb'),auth[_0xd07a('0x7')](),controller[_0xd07a('0xf')]);router[_0xd07a('0x10')](_0xd07a('0xb'),auth['isAuthenticated'](),controller[_0xd07a('0x11')]);module[_0xd07a('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index d47ea6a..51f648a 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 _0x2caf=['STRING','DATE'];(function(_0x34f94a,_0x19d6c3){var _0x59333b=function(_0x294345){while(--_0x294345){_0x34f94a['push'](_0x34f94a['shift']());}};_0x59333b(++_0x19d6c3);}(_0x2caf,0x6a));var _0xf2ca=function(_0x19fadc,_0x103dd1){_0x19fadc=_0x19fadc-0x0;var _0x48ced3=_0x2caf[_0x19fadc];return _0x48ced3;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xf2ca('0x0')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xf2ca('0x1')]},'leaveAt':{'type':Sequelize[_0xf2ca('0x1')]},'acceptAt':{'type':Sequelize[_0xf2ca('0x1')]},'exitAt':{'type':Sequelize[_0xf2ca('0x1')]},'reason':{'type':Sequelize[_0xf2ca('0x0')]}}; \ No newline at end of file +var _0xdbf5=['sequelize','STRING','DATE'];(function(_0x4fbc20,_0x33bbc4){var _0x419740=function(_0x2a692a){while(--_0x2a692a){_0x4fbc20['push'](_0x4fbc20['shift']());}};_0x419740(++_0x33bbc4);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x41a515,_0x571e5a){_0x41a515=_0x41a515-0x0;var _0x40403b=_0xdbf5[_0x41a515];return _0x40403b;};'use strict';var moment=require('moment');var Sequelize=require(_0x5dbf('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x5dbf('0x1')]},'joinAt':{'type':Sequelize[_0x5dbf('0x2')]},'leaveAt':{'type':Sequelize[_0x5dbf('0x2')]},'acceptAt':{'type':Sequelize[_0x5dbf('0x2')]},'exitAt':{'type':Sequelize[_0x5dbf('0x2')]},'reason':{'type':Sequelize[_0x5dbf('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index e91e484..fb23fa8 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 _0x8952=['filter','VIRTUAL','merge','options','findAll','rows','show','params','keys','includeAll','include','catch','create','body','destroy','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','end','stack','name','map','MailQueueReport','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x8952,0x17e));var _0x2895=function(_0x308e33,_0x92407c){_0x308e33=_0x308e33-0x0;var _0x1a8a98=_0x8952[_0x308e33];return _0x1a8a98;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2895('0x0'));var zipdir=require(_0x2895('0x1'));var jsonpatch=require(_0x2895('0x2'));var rp=require(_0x2895('0x3'));var moment=require(_0x2895('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2895('0x5'));var util=require(_0x2895('0x6'));var path=require(_0x2895('0x7'));var sox=require('sox');var csv=require(_0x2895('0x8'));var ejs=require(_0x2895('0x9'));var fs=require('fs');var fs_extra=require(_0x2895('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2895('0xb'));var jsforce=require(_0x2895('0xc'));var deskjs=require(_0x2895('0xd'));var toCsv=require(_0x2895('0x8'));var querystring=require(_0x2895('0xe'));var Papa=require('papaparse');var Redis=require(_0x2895('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x2895('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2895('0x11'));var utils=require(_0x2895('0x12'));var config=require(_0x2895('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x2895('0x14'))['db'];function respondWithStatusCode(_0x3924be,_0x4b1342){_0x4b1342=_0x4b1342||0xcc;return function(_0x32574c){if(_0x32574c){return _0x3924be[_0x2895('0x15')](_0x4b1342);}return _0x3924be['status'](_0x4b1342)['end']();};}function respondWithResult(_0x1d1493,_0x2ca2ac){_0x2ca2ac=_0x2ca2ac||0xc8;return function(_0x5777a0){if(_0x5777a0){return _0x1d1493[_0x2895('0x16')](_0x2ca2ac)[_0x2895('0x17')](_0x5777a0);}};}function respondWithFilteredResult(_0x27b50e,_0x1ae013){return function(_0x1d3659){if(_0x1d3659){var _0x2627e6=typeof _0x1ae013[_0x2895('0x18')]===_0x2895('0x19')&&typeof _0x1ae013[_0x2895('0x1a')]===_0x2895('0x19');var _0x10a1bf=_0x1d3659[_0x2895('0x1b')];var _0xbf8b63=_0x2627e6?0x0:_0x1ae013[_0x2895('0x18')];var _0x155124=_0x2627e6?_0x1d3659[_0x2895('0x1b')]:_0x1ae013[_0x2895('0x18')]+_0x1ae013[_0x2895('0x1a')];var _0x5a8eab;if(_0x155124>=_0x10a1bf){_0x155124=_0x10a1bf;_0x5a8eab=0xc8;}else{_0x5a8eab=0xce;}_0x27b50e['status'](_0x5a8eab);return _0x27b50e['set'](_0x2895('0x1c'),_0xbf8b63+'-'+_0x155124+'/'+_0x10a1bf)[_0x2895('0x17')](_0x1d3659);}return null;};}function patchUpdates(_0x3ec4da){return function(_0x593e47){try{jsonpatch[_0x2895('0x1d')](_0x593e47,_0x3ec4da,!![]);}catch(_0x190b79){return BPromise[_0x2895('0x1e')](_0x190b79);}return _0x593e47[_0x2895('0x1f')]();};}function saveUpdates(_0x8b75e0,_0x5dbbfe){return function(_0x30c6c3){if(_0x30c6c3){return _0x30c6c3[_0x2895('0x20')](_0x8b75e0)['then'](function(_0x142e58){return _0x142e58;});}return null;};}function removeEntity(_0x384357,_0x6f8ad4){return function(_0x511286){if(_0x511286){return _0x511286['destroy']()[_0x2895('0x21')](function(){_0x384357[_0x2895('0x16')](0xcc)[_0x2895('0x22')]();});}};}function handleEntityNotFound(_0x4a21cf,_0x3d3320){return function(_0x3690ce){if(!_0x3690ce){_0x4a21cf['sendStatus'](0x194);}return _0x3690ce;};}function handleError(_0x293ad3,_0x127540){_0x127540=_0x127540||0x1f4;return function(_0x2cd4df){logger['error'](_0x2cd4df[_0x2895('0x23')]);if(_0x2cd4df[_0x2895('0x24')]){delete _0x2cd4df['name'];}_0x293ad3[_0x2895('0x16')](_0x127540)['send'](_0x2cd4df);};}exports['index']=function(_0x18a935,_0x4ee2cc){var _0xfa4f85={},_0x381538={},_0x4fdd94={'count':0x0,'rows':[]};var _0x5574bf=_[_0x2895('0x25')](db[_0x2895('0x26')][_0x2895('0x27')],function(_0x14e343){return{'name':_0x14e343[_0x2895('0x28')],'type':_0x14e343[_0x2895('0x29')][_0x2895('0x2a')]};});_0x381538['model']=_[_0x2895('0x25')](_0x5574bf,_0x2895('0x24'));_0x381538[_0x2895('0x2b')]=_['keys'](_0x18a935[_0x2895('0x2b')]);_0x381538[_0x2895('0x2c')]=_[_0x2895('0x2d')](_0x381538[_0x2895('0x2e')],_0x381538['query']);_0xfa4f85[_0x2895('0x2f')]=_[_0x2895('0x2d')](_0x381538[_0x2895('0x2e')],qs[_0x2895('0x30')](_0x18a935[_0x2895('0x2b')]['fields']));_0xfa4f85['attributes']=_0xfa4f85[_0x2895('0x2f')][_0x2895('0x31')]?_0xfa4f85['attributes']:_0x381538[_0x2895('0x2e')];if(!_0x18a935['query'][_0x2895('0x32')](_0x2895('0x33'))){_0xfa4f85['limit']=qs[_0x2895('0x1a')](_0x18a935['query'][_0x2895('0x1a')]);_0xfa4f85['offset']=qs['offset'](_0x18a935[_0x2895('0x2b')][_0x2895('0x18')]);}_0xfa4f85[_0x2895('0x34')]=qs['sort'](_0x18a935[_0x2895('0x2b')][_0x2895('0x35')]);_0xfa4f85[_0x2895('0x36')]=qs[_0x2895('0x2c')](_[_0x2895('0x37')](_0x18a935[_0x2895('0x2b')],_0x381538[_0x2895('0x2c')]),_0x5574bf);if(_0x18a935[_0x2895('0x2b')][_0x2895('0x38')]){_0xfa4f85[_0x2895('0x36')]=_['merge'](_0xfa4f85[_0x2895('0x36')],{'$or':_[_0x2895('0x25')](_0x5574bf,function(_0x47413d){if(_0x47413d[_0x2895('0x29')]!==_0x2895('0x39')){var _0x12d7d8={};_0x12d7d8[_0x47413d[_0x2895('0x24')]]={'$like':'%'+_0x18a935['query']['filter']+'%'};return _0x12d7d8;}})});}_0xfa4f85=_[_0x2895('0x3a')]({},_0xfa4f85,_0x18a935[_0x2895('0x3b')]);var _0x24b9e0={'where':_0xfa4f85[_0x2895('0x36')]};return db[_0x2895('0x26')][_0x2895('0x1b')](_0x24b9e0)['then'](function(_0x5d18ef){_0x4fdd94[_0x2895('0x1b')]=_0x5d18ef;if(_0x18a935[_0x2895('0x2b')]['includeAll']){_0xfa4f85['include']=[{'all':!![]}];}return db[_0x2895('0x26')][_0x2895('0x3c')](_0xfa4f85);})[_0x2895('0x21')](function(_0x28967f){_0x4fdd94[_0x2895('0x3d')]=_0x28967f;return _0x4fdd94;})[_0x2895('0x21')](respondWithFilteredResult(_0x4ee2cc,_0xfa4f85))['catch'](handleError(_0x4ee2cc,null));};exports[_0x2895('0x3e')]=function(_0x2cfb24,_0x18ca24){var _0x1537fd={'raw':!![],'where':{'id':_0x2cfb24[_0x2895('0x3f')]['id']}},_0x4af6d6={};_0x4af6d6[_0x2895('0x2e')]=_[_0x2895('0x40')](db[_0x2895('0x26')]['rawAttributes']);_0x4af6d6['query']=_[_0x2895('0x40')](_0x2cfb24[_0x2895('0x2b')]);_0x4af6d6[_0x2895('0x2c')]=_[_0x2895('0x2d')](_0x4af6d6[_0x2895('0x2e')],_0x4af6d6['query']);_0x1537fd['attributes']=_[_0x2895('0x2d')](_0x4af6d6[_0x2895('0x2e')],qs[_0x2895('0x30')](_0x2cfb24[_0x2895('0x2b')][_0x2895('0x30')]));_0x1537fd[_0x2895('0x2f')]=_0x1537fd[_0x2895('0x2f')]['length']?_0x1537fd[_0x2895('0x2f')]:_0x4af6d6[_0x2895('0x2e')];if(_0x2cfb24[_0x2895('0x2b')][_0x2895('0x41')]){_0x1537fd[_0x2895('0x42')]=[{'all':!![]}];}_0x1537fd=_[_0x2895('0x3a')]({},_0x1537fd,_0x2cfb24[_0x2895('0x3b')]);return db[_0x2895('0x26')]['find'](_0x1537fd)[_0x2895('0x21')](handleEntityNotFound(_0x18ca24,null))[_0x2895('0x21')](respondWithResult(_0x18ca24,null))[_0x2895('0x43')](handleError(_0x18ca24,null));};exports['create']=function(_0xc85aa1,_0x5307a9){return db['MailQueueReport'][_0x2895('0x44')](_0xc85aa1[_0x2895('0x45')],{})[_0x2895('0x21')](respondWithResult(_0x5307a9,0xc9))[_0x2895('0x43')](handleError(_0x5307a9,null));};exports[_0x2895('0x20')]=function(_0x3cc331,_0x11e53a){if(_0x3cc331['body']['id']){delete _0x3cc331[_0x2895('0x45')]['id'];}return db[_0x2895('0x26')]['find']({'where':{'id':_0x3cc331['params']['id']}})['then'](handleEntityNotFound(_0x11e53a,null))[_0x2895('0x21')](saveUpdates(_0x3cc331[_0x2895('0x45')],null))[_0x2895('0x21')](respondWithResult(_0x11e53a,null))[_0x2895('0x43')](handleError(_0x11e53a,null));};exports[_0x2895('0x46')]=function(_0x3c5261,_0xaca46c){return db[_0x2895('0x26')][_0x2895('0x47')]({'where':{'id':_0x3c5261[_0x2895('0x3f')]['id']}})[_0x2895('0x21')](handleEntityNotFound(_0xaca46c,null))[_0x2895('0x21')](removeEntity(_0xaca46c,null))[_0x2895('0x43')](handleError(_0xaca46c,null));};exports[_0x2895('0x48')]=function(_0x356d35,_0x3c1135){return db[_0x2895('0x26')][_0x2895('0x48')]()[_0x2895('0x21')](respondWithResult(_0x3c1135,null))[_0x2895('0x43')](handleError(_0x3c1135,null));}; \ No newline at end of file +var _0x4888=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','limit','undefined','count','set','apply','reject','save','then','sendStatus','error','name','send','index','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','MailQueueReport','includeAll','include','rows','catch','params','options','create','body','update','find','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x4888,0x198));var _0x8488=function(_0x38d92b,_0x1be181){_0x38d92b=_0x38d92b-0x0;var _0x56c746=_0x4888[_0x38d92b];return _0x56c746;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8488('0x0'));var zipdir=require(_0x8488('0x1'));var jsonpatch=require(_0x8488('0x2'));var rp=require(_0x8488('0x3'));var moment=require(_0x8488('0x4'));var BPromise=require(_0x8488('0x5'));var Mustache=require(_0x8488('0x6'));var util=require('util');var path=require(_0x8488('0x7'));var sox=require(_0x8488('0x8'));var csv=require(_0x8488('0x9'));var ejs=require(_0x8488('0xa'));var fs=require('fs');var fs_extra=require(_0x8488('0xb'));var _=require(_0x8488('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8488('0x9'));var querystring=require(_0x8488('0xd'));var Papa=require('papaparse');var Redis=require(_0x8488('0xe'));var authService=require(_0x8488('0xf'));var qs=require(_0x8488('0x10'));var as=require(_0x8488('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8488('0x12'))(_0x8488('0x13'));var utils=require(_0x8488('0x14'));var config=require(_0x8488('0x15'));var licenseUtil=require(_0x8488('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14462e,_0x3d1f7a){_0x3d1f7a=_0x3d1f7a||0xcc;return function(_0x58f83d){if(_0x58f83d){return _0x14462e['sendStatus'](_0x3d1f7a);}return _0x14462e[_0x8488('0x17')](_0x3d1f7a)['end']();};}function respondWithResult(_0x214083,_0x4e94fc){_0x4e94fc=_0x4e94fc||0xc8;return function(_0x5161a3){if(_0x5161a3){return _0x214083[_0x8488('0x17')](_0x4e94fc)[_0x8488('0x18')](_0x5161a3);}};}function respondWithFilteredResult(_0x5700b,_0x2bcb7c){return function(_0x3b3cfa){if(_0x3b3cfa){var _0x8d3b3d=typeof _0x2bcb7c[_0x8488('0x19')]==='undefined'&&typeof _0x2bcb7c[_0x8488('0x1a')]===_0x8488('0x1b');var _0x3edfe4=_0x3b3cfa[_0x8488('0x1c')];var _0x60ae2f=_0x8d3b3d?0x0:_0x2bcb7c[_0x8488('0x19')];var _0x1aedb1=_0x8d3b3d?_0x3b3cfa[_0x8488('0x1c')]:_0x2bcb7c[_0x8488('0x19')]+_0x2bcb7c[_0x8488('0x1a')];var _0x10bfd6;if(_0x1aedb1>=_0x3edfe4){_0x1aedb1=_0x3edfe4;_0x10bfd6=0xc8;}else{_0x10bfd6=0xce;}_0x5700b[_0x8488('0x17')](_0x10bfd6);return _0x5700b[_0x8488('0x1d')]('Content-Range',_0x60ae2f+'-'+_0x1aedb1+'/'+_0x3edfe4)['json'](_0x3b3cfa);}return null;};}function patchUpdates(_0x340d6b){return function(_0x12d40f){try{jsonpatch[_0x8488('0x1e')](_0x12d40f,_0x340d6b,!![]);}catch(_0x3c9fc2){return BPromise[_0x8488('0x1f')](_0x3c9fc2);}return _0x12d40f[_0x8488('0x20')]();};}function saveUpdates(_0x43b672,_0x3c078c){return function(_0x39dd43){if(_0x39dd43){return _0x39dd43['update'](_0x43b672)[_0x8488('0x21')](function(_0x4e07e1){return _0x4e07e1;});}return null;};}function removeEntity(_0x140b0b,_0x1361a6){return function(_0x290b33){if(_0x290b33){return _0x290b33['destroy']()['then'](function(){_0x140b0b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x472624,_0x51fe30){return function(_0x58057a){if(!_0x58057a){_0x472624[_0x8488('0x22')](0x194);}return _0x58057a;};}function handleError(_0x2f350a,_0x2b3c97){_0x2b3c97=_0x2b3c97||0x1f4;return function(_0x6ebee0){logger[_0x8488('0x23')](_0x6ebee0['stack']);if(_0x6ebee0[_0x8488('0x24')]){delete _0x6ebee0[_0x8488('0x24')];}_0x2f350a[_0x8488('0x17')](_0x2b3c97)[_0x8488('0x25')](_0x6ebee0);};}exports[_0x8488('0x26')]=function(_0x27f5cf,_0x2c15ff){var _0x296b6c={},_0x368f9c={},_0x1d9317={'count':0x0,'rows':[]};var _0x888b24=_['map'](db['MailQueueReport']['rawAttributes'],function(_0x292fe8){return{'name':_0x292fe8[_0x8488('0x27')],'type':_0x292fe8[_0x8488('0x28')][_0x8488('0x29')]};});_0x368f9c[_0x8488('0x2a')]=_[_0x8488('0x2b')](_0x888b24,'name');_0x368f9c[_0x8488('0x2c')]=_[_0x8488('0x2d')](_0x27f5cf[_0x8488('0x2c')]);_0x368f9c[_0x8488('0x2e')]=_[_0x8488('0x2f')](_0x368f9c['model'],_0x368f9c[_0x8488('0x2c')]);_0x296b6c[_0x8488('0x30')]=_['intersection'](_0x368f9c[_0x8488('0x2a')],qs[_0x8488('0x31')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x31')]));_0x296b6c[_0x8488('0x30')]=_0x296b6c['attributes'][_0x8488('0x32')]?_0x296b6c[_0x8488('0x30')]:_0x368f9c[_0x8488('0x2a')];if(!_0x27f5cf['query'][_0x8488('0x33')]('nolimit')){_0x296b6c[_0x8488('0x1a')]=qs[_0x8488('0x1a')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x1a')]);_0x296b6c['offset']=qs[_0x8488('0x19')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x19')]);}_0x296b6c['order']=qs[_0x8488('0x34')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x34')]);_0x296b6c[_0x8488('0x35')]=qs[_0x8488('0x2e')](_[_0x8488('0x36')](_0x27f5cf[_0x8488('0x2c')],_0x368f9c[_0x8488('0x2e')]),_0x888b24);if(_0x27f5cf[_0x8488('0x2c')][_0x8488('0x37')]){_0x296b6c[_0x8488('0x35')]=_['merge'](_0x296b6c['where'],{'$or':_[_0x8488('0x2b')](_0x888b24,function(_0x36c17a){if(_0x36c17a[_0x8488('0x28')]!==_0x8488('0x38')){var _0x2d9fa1={};_0x2d9fa1[_0x36c17a[_0x8488('0x24')]]={'$like':'%'+_0x27f5cf[_0x8488('0x2c')][_0x8488('0x37')]+'%'};return _0x2d9fa1;}})});}_0x296b6c=_[_0x8488('0x39')]({},_0x296b6c,_0x27f5cf['options']);var _0xf5a0a0={'where':_0x296b6c[_0x8488('0x35')]};return db[_0x8488('0x3a')]['count'](_0xf5a0a0)[_0x8488('0x21')](function(_0xa50c4b){_0x1d9317[_0x8488('0x1c')]=_0xa50c4b;if(_0x27f5cf[_0x8488('0x2c')][_0x8488('0x3b')]){_0x296b6c[_0x8488('0x3c')]=[{'all':!![]}];}return db[_0x8488('0x3a')]['findAll'](_0x296b6c);})[_0x8488('0x21')](function(_0x1c33a1){_0x1d9317[_0x8488('0x3d')]=_0x1c33a1;return _0x1d9317;})['then'](respondWithFilteredResult(_0x2c15ff,_0x296b6c))[_0x8488('0x3e')](handleError(_0x2c15ff,null));};exports['show']=function(_0x40ee7e,_0x34b11b){var _0x5cbd11={'raw':!![],'where':{'id':_0x40ee7e[_0x8488('0x3f')]['id']}},_0x22a3f3={};_0x22a3f3[_0x8488('0x2a')]=_[_0x8488('0x2d')](db[_0x8488('0x3a')]['rawAttributes']);_0x22a3f3[_0x8488('0x2c')]=_['keys'](_0x40ee7e[_0x8488('0x2c')]);_0x22a3f3[_0x8488('0x2e')]=_[_0x8488('0x2f')](_0x22a3f3[_0x8488('0x2a')],_0x22a3f3[_0x8488('0x2c')]);_0x5cbd11[_0x8488('0x30')]=_[_0x8488('0x2f')](_0x22a3f3[_0x8488('0x2a')],qs[_0x8488('0x31')](_0x40ee7e[_0x8488('0x2c')][_0x8488('0x31')]));_0x5cbd11[_0x8488('0x30')]=_0x5cbd11[_0x8488('0x30')][_0x8488('0x32')]?_0x5cbd11[_0x8488('0x30')]:_0x22a3f3[_0x8488('0x2a')];if(_0x40ee7e[_0x8488('0x2c')]['includeAll']){_0x5cbd11[_0x8488('0x3c')]=[{'all':!![]}];}_0x5cbd11=_[_0x8488('0x39')]({},_0x5cbd11,_0x40ee7e[_0x8488('0x40')]);return db[_0x8488('0x3a')]['find'](_0x5cbd11)[_0x8488('0x21')](handleEntityNotFound(_0x34b11b,null))[_0x8488('0x21')](respondWithResult(_0x34b11b,null))[_0x8488('0x3e')](handleError(_0x34b11b,null));};exports[_0x8488('0x41')]=function(_0x52042c,_0x1f0516){return db[_0x8488('0x3a')][_0x8488('0x41')](_0x52042c[_0x8488('0x42')],{})[_0x8488('0x21')](respondWithResult(_0x1f0516,0xc9))[_0x8488('0x3e')](handleError(_0x1f0516,null));};exports[_0x8488('0x43')]=function(_0x299d8e,_0x1bc2e1){if(_0x299d8e[_0x8488('0x42')]['id']){delete _0x299d8e[_0x8488('0x42')]['id'];}return db[_0x8488('0x3a')][_0x8488('0x44')]({'where':{'id':_0x299d8e['params']['id']}})['then'](handleEntityNotFound(_0x1bc2e1,null))[_0x8488('0x21')](saveUpdates(_0x299d8e[_0x8488('0x42')],null))[_0x8488('0x21')](respondWithResult(_0x1bc2e1,null))[_0x8488('0x3e')](handleError(_0x1bc2e1,null));};exports[_0x8488('0x45')]=function(_0x22d22c,_0x25f2dc){return db[_0x8488('0x3a')][_0x8488('0x44')]({'where':{'id':_0x22d22c['params']['id']}})[_0x8488('0x21')](handleEntityNotFound(_0x25f2dc,null))[_0x8488('0x21')](removeEntity(_0x25f2dc,null))['catch'](handleError(_0x25f2dc,null));};exports[_0x8488('0x46')]=function(_0x313e00,_0x186747){return db[_0x8488('0x3a')]['describe']()[_0x8488('0x21')](respondWithResult(_0x186747,null))[_0x8488('0x3e')](handleError(_0x186747,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 4b34670..c67f2b3 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 _0xf8a8=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger','moment'];(function(_0x123623,_0x9694e2){var _0x3b00d1=function(_0x7e48e0){while(--_0x7e48e0){_0x123623['push'](_0x123623['shift']());}};_0x3b00d1(++_0x9694e2);}(_0xf8a8,0x184));var _0x8f8a=function(_0x53cf8e,_0x3d290f){_0x53cf8e=_0x53cf8e-0x0;var _0x459197=_0xf8a8[_0x53cf8e];return _0x459197;};'use strict';var _=require(_0x8f8a('0x0'));var util=require(_0x8f8a('0x1'));var logger=require(_0x8f8a('0x2'))('api');var moment=require(_0x8f8a('0x3'));var BPromise=require(_0x8f8a('0x4'));var rp=require(_0x8f8a('0x5'));var fs=require('fs');var path=require(_0x8f8a('0x6'));var rimraf=require(_0x8f8a('0x7'));var config=require(_0x8f8a('0x8'));var attributes=require('./mailQueueReport.attributes');module[_0x8f8a('0x9')]=function(_0x141b4c,_0x5ce7de){return _0x141b4c[_0x8f8a('0xa')](_0x8f8a('0xb'),attributes,{'tableName':_0x8f8a('0xc'),'paranoid':![],'indexes':[{'name':_0x8f8a('0xd'),'fields':[_0x8f8a('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3c55=['rimraf','../../config/environment','./mailQueueReport.attributes','exports','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger','api','path'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x3c55,0x163));var _0x53c5=function(_0x2d9461,_0x2bd9a4){_0x2d9461=_0x2d9461-0x0;var _0x1b3e2b=_0x3c55[_0x2d9461];return _0x1b3e2b;};'use strict';var _=require(_0x53c5('0x0'));var util=require(_0x53c5('0x1'));var logger=require(_0x53c5('0x2'))(_0x53c5('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x53c5('0x4'));var rimraf=require(_0x53c5('0x5'));var config=require(_0x53c5('0x6'));var attributes=require(_0x53c5('0x7'));module[_0x53c5('0x8')]=function(_0x21103a,_0x27b154){return _0x21103a['define'](_0x53c5('0x9'),attributes,{'tableName':_0x53c5('0xa'),'paranoid':![],'indexes':[{'name':_0x53c5('0xb'),'fields':[_0x53c5('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 8207fcf..872319e 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 _0x326f=['error','code','message','result','catch','CreateMailQueueReport','MailQueueReport','options','raw','stringify','UpdateMailQueueReport','body','attributes','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x41b2be,_0x58fc25){var _0x57519a=function(_0x190fcf){while(--_0x190fcf){_0x41b2be['push'](_0x41b2be['shift']());}};_0x57519a(++_0x58fc25);}(_0x326f,0xd1));var _0xf326=function(_0x496259,_0x24a825){_0x496259=_0x496259-0x0;var _0x424913=_0x326f[_0x496259];return _0x424913;};'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')]('MailQueueReport,\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')]('MailQueueReport,\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')]['create'](_0x453100['body'],{'raw':_0x453100['options']?_0x453100[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x4cabce){logger[_0xf326('0xb')]('CreateMailQueueReport',_0x453100);logger['debug'](_0xf326('0x14'),_0x453100,JSON[_0xf326('0x18')](_0x4cabce));_0x31ffb9(_0x4cabce);})['catch'](function(_0x5aa184){logger[_0xf326('0xf')](_0xf326('0x14'),_0x5aa184['message'],_0x453100);_0xcef2b5(_0x18bee3[_0xf326('0xf')](0x1f4,_0x5aa184[_0xf326('0x11')]));});});};exports[_0xf326('0x19')]=function(_0x295752){var _0x17c157=this;return new Promise(function(_0x2049ec,_0x5ce532){return db['MailQueueReport']['update'](_0x295752[_0xf326('0x1a')],{'raw':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')]['where']||null:null,'attributes':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x1b')]||null:null,'limit':_0x295752['options']?_0x295752[_0xf326('0x16')]['limit']||null:null})['then'](function(_0x6a8e89){logger[_0xf326('0xb')](_0xf326('0x19'),_0x295752);logger['debug'](_0xf326('0x19'),_0x295752,JSON[_0xf326('0x18')](_0x6a8e89));_0x2049ec(_0x6a8e89);})['catch'](function(_0x225776){logger[_0xf326('0xf')](_0xf326('0x19'),_0x225776[_0xf326('0x11')],_0x295752);_0x5ce532(_0x17c157[_0xf326('0xf')](0x1f4,_0x225776[_0xf326('0x11')]));});});}; \ No newline at end of file +var _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','MailQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateMailQueueReport','body','options','raw','stringify','MailQueueReport','update','where','UpdateMailQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x166d97,_0x6b02cb){var _0xffed60=function(_0x41a4cd){while(--_0x41a4cd){_0x166d97['push'](_0x166d97['shift']());}};_0xffed60(++_0x6b02cb);}(_0x1261,0x144));var _0x1126=function(_0x26a51d,_0x5aaa3a){_0x26a51d=_0x26a51d-0x0;var _0x1d8bef=_0x1261[_0x26a51d];return _0x1d8bef;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailQueueReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}exports[_0x1126('0x15')]=function(_0x4a7b49){var _0x4d2b38=this;return new Promise(function(_0x22ae0b,_0x2b2487){return db['MailQueueReport']['create'](_0x4a7b49[_0x1126('0x16')],{'raw':_0x4a7b49['options']?_0x4a7b49[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![]})[_0x1126('0xc')](function(_0x54400a){logger[_0x1126('0xd')]('CreateMailQueueReport',_0x4a7b49);logger['debug'](_0x1126('0x15'),_0x4a7b49,JSON[_0x1126('0x19')](_0x54400a));_0x22ae0b(_0x54400a);})[_0x1126('0x14')](function(_0x36d254){logger['error'](_0x1126('0x15'),_0x36d254[_0x1126('0x13')],_0x4a7b49);_0x2b2487(_0x4d2b38['error'](0x1f4,_0x36d254[_0x1126('0x13')]));});});};exports['UpdateMailQueueReport']=function(_0x529dd9){var _0x4b57ab=this;return new Promise(function(_0x2199d9,_0x15bcc3){return db[_0x1126('0x1a')][_0x1126('0x1b')](_0x529dd9[_0x1126('0x16')],{'raw':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x529dd9['options']?_0x529dd9[_0x1126('0x17')][_0x1126('0x1c')]||null:null,'attributes':_0x529dd9[_0x1126('0x17')]?_0x529dd9['options']['attributes']||null:null,'limit':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')]['limit']||null:null})[_0x1126('0xc')](function(_0x23d2bc){logger['info'](_0x1126('0x1d'),_0x529dd9);logger['debug'](_0x1126('0x1d'),_0x529dd9,JSON['stringify'](_0x23d2bc));_0x2199d9(_0x23d2bc);})[_0x1126('0x14')](function(_0x583ce6){logger[_0x1126('0x11')]('UpdateMailQueueReport',_0x583ce6['message'],_0x529dd9);_0x15bcc3(_0x4b57ab['error'](0x1f4,_0x583ce6[_0x1126('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 200a9c6..0aab132 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0xa00a52,_0x2d2473){var _0x5b4d12=function(_0x2a355e){while(--_0x2a355e){_0xa00a52['push'](_0xa00a52['shift']());}};_0x5b4d12(++_0x2d2473);}(_0xe706,0xa3));var _0x6e70=function(_0x15b33d,_0x3a17b0){_0x15b33d=_0x15b33d-0x0;var _0x3b09b6=_0xe706[_0x15b33d];return _0x3b09b6;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x54cc3d,_0x3a4c0d){var _0x427dff=function(_0x11be6c){while(--_0x11be6c){_0x54cc3d['push'](_0x54cc3d['shift']());}};_0x427dff(++_0x3a4c0d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x28a5ad,_0x520afa){_0x28a5ad=_0x28a5ad-0x0;var _0x176b8a=_0xcb91[_0x28a5ad];return _0x176b8a;};'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/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 3c15bb0..6fa4ae7 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 _0x8557=['sequelize','exports','STRING','INTEGER','BOOLEAN'];(function(_0x2119e1,_0x5d5979){var _0x2e1cfd=function(_0x22ac0e){while(--_0x22ac0e){_0x2119e1['push'](_0x2119e1['shift']());}};_0x2e1cfd(++_0x5d5979);}(_0x8557,0x181));var _0x7855=function(_0x4d07cc,_0x587613){_0x4d07cc=_0x4d07cc-0x0;var _0x42de3b=_0x8557[_0x4d07cc];return _0x42de3b;};'use strict';var Sequelize=require(_0x7855('0x0'));module[_0x7855('0x1')]={'description':{'type':Sequelize[_0x7855('0x2')]},'host':{'type':Sequelize[_0x7855('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0x7855('0x2')]},'password':{'type':Sequelize[_0x7855('0x2')]},'port':{'type':Sequelize[_0x7855('0x3')]},'tls':{'type':Sequelize[_0x7855('0x4')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0x7855('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x7855('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x7855('0x2')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xbede=['BOOLEAN','INTEGER','INBOX','sequelize','exports','STRING'];(function(_0x380e75,_0x486360){var _0x444d96=function(_0x32c8f8){while(--_0x32c8f8){_0x380e75['push'](_0x380e75['shift']());}};_0x444d96(++_0x486360);}(_0xbede,0x9f));var _0xebed=function(_0x205f91,_0x2b80e9){_0x205f91=_0x205f91-0x0;var _0x8f02c3=_0xbede[_0x205f91];return _0x8f02c3;};'use strict';var Sequelize=require(_0xebed('0x0'));module[_0xebed('0x1')]={'description':{'type':Sequelize[_0xebed('0x2')]},'host':{'type':Sequelize[_0xebed('0x2')]},'authentication':{'type':Sequelize[_0xebed('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0xebed('0x2')]},'password':{'type':Sequelize[_0xebed('0x2')]},'port':{'type':Sequelize[_0xebed('0x4')]},'tls':{'type':Sequelize[_0xebed('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0xebed('0x5')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xebed('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0xebed('0x2')]},'modernAuthentication':{'type':Sequelize[_0xebed('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index d7d8e82..562d0d3 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 _0x41a7=['define','MailServerIn','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x5e69e0,_0x13900a){var _0x193e24=function(_0xa79101){while(--_0xa79101){_0x5e69e0['push'](_0x5e69e0['shift']());}};_0x193e24(++_0x13900a);}(_0x41a7,0x65));var _0x741a=function(_0x4d328d,_0x17ecc0){_0x4d328d=_0x4d328d-0x0;var _0x15738f=_0x41a7[_0x4d328d];return _0x15738f;};'use strict';var _=require('lodash');var util=require(_0x741a('0x0'));var logger=require(_0x741a('0x1'))(_0x741a('0x2'));var moment=require(_0x741a('0x3'));var BPromise=require(_0x741a('0x4'));var rp=require(_0x741a('0x5'));var fs=require('fs');var path=require(_0x741a('0x6'));var rimraf=require('rimraf');var config=require(_0x741a('0x7'));var attributes=require('./mailServerIn.attributes');module[_0x741a('0x8')]=function(_0xd1c9b3,_0x34f8fc){return _0xd1c9b3[_0x741a('0x9')](_0x741a('0xa'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x719d=['rimraf','./mailServerIn.attributes','exports','define','mail_servers_in','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x4323a5,_0x4eb292){var _0x14dede=function(_0x3f3e1b){while(--_0x3f3e1b){_0x4323a5['push'](_0x4323a5['shift']());}};_0x14dede(++_0x4eb292);}(_0x719d,0xd1));var _0xd719=function(_0x33ad9f,_0x5a51b6){_0x33ad9f=_0x33ad9f-0x0;var _0x1d3107=_0x719d[_0x33ad9f];return _0x1d3107;};'use strict';var _=require(_0xd719('0x0'));var util=require(_0xd719('0x1'));var logger=require(_0xd719('0x2'))(_0xd719('0x3'));var moment=require(_0xd719('0x4'));var BPromise=require('bluebird');var rp=require(_0xd719('0x5'));var fs=require('fs');var path=require(_0xd719('0x6'));var rimraf=require(_0xd719('0x7'));var config=require('../../config/environment');var attributes=require(_0xd719('0x8'));module[_0xd719('0x9')]=function(_0x307b6f,_0x45185f){return _0x307b6f[_0xd719('0xa')]('MailServerIn',attributes,{'tableName':_0xd719('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index 16495cc..77c17da 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 _0x1176=['request','info','MailServerIn,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','MailServerIn,\x20%s,\x20%s','message','result','catch','GetMailServerIn','MailServerIn','findAll','options','raw','attributes','limit','map','include','model','then','debug','stringify','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x575057,_0x14baf3){var _0x49dbc8=function(_0x23599a){while(--_0x23599a){_0x575057['push'](_0x575057['shift']());}};_0x49dbc8(++_0x14baf3);}(_0x1176,0x80));var _0x6117=function(_0x4dff21,_0x3f468a){_0x4dff21=_0x4dff21-0x0;var _0x1596d1=_0x1176[_0x4dff21];return _0x1596d1;};'use strict';var _=require(_0x6117('0x0'));var util=require(_0x6117('0x1'));var moment=require('moment');var BPromise=require(_0x6117('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6117('0x3'));var db=require(_0x6117('0x4'))['db'];var utils=require(_0x6117('0x5'));var logger=require(_0x6117('0x6'))(_0x6117('0x7'));var config=require(_0x6117('0x8'));var jayson=require(_0x6117('0x9'));var client=jayson[_0x6117('0xa')][_0x6117('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x25ef68,_0x30b307,_0x531d56){return new BPromise(function(_0x426596,_0x37a10b){return client[_0x6117('0xc')](_0x25ef68,_0x531d56)['then'](function(_0x14e3c5){logger[_0x6117('0xd')]('MailServerIn,\x20%s,\x20%s',_0x30b307,'request\x20sent');logger['debug'](_0x6117('0xe'),_0x30b307,_0x6117('0xf'),JSON['stringify'](_0x14e3c5));if(_0x14e3c5['error']){if(_0x14e3c5[_0x6117('0x10')][_0x6117('0x11')]===0x1f4){logger[_0x6117('0x10')](_0x6117('0x12'),_0x30b307,_0x14e3c5[_0x6117('0x10')][_0x6117('0x13')]);return _0x37a10b(_0x14e3c5['error']['message']);}logger[_0x6117('0x10')]('MailServerIn,\x20%s,\x20%s',_0x30b307,_0x14e3c5[_0x6117('0x10')][_0x6117('0x13')]);return _0x426596(_0x14e3c5['error']['message']);}else{logger[_0x6117('0xd')](_0x6117('0x12'),_0x30b307,_0x6117('0xf'));_0x426596(_0x14e3c5[_0x6117('0x14')][_0x6117('0x13')]);}})[_0x6117('0x15')](function(_0x1f1872){logger[_0x6117('0x10')](_0x6117('0x12'),_0x30b307,_0x1f1872);_0x37a10b(_0x1f1872);});});}exports[_0x6117('0x16')]=function(_0x117f98){var _0x4cef81=this;return new Promise(function(_0xf66df9,_0x262fdf){return db[_0x6117('0x17')][_0x6117('0x18')]({'raw':_0x117f98[_0x6117('0x19')]?_0x117f98[_0x6117('0x19')][_0x6117('0x1a')]===undefined?!![]:![]:!![],'where':_0x117f98[_0x6117('0x19')]?_0x117f98['options']['where']||null:null,'attributes':_0x117f98[_0x6117('0x19')]?_0x117f98['options'][_0x6117('0x1b')]||null:null,'limit':_0x117f98['options']?_0x117f98[_0x6117('0x19')][_0x6117('0x1c')]||null:null,'include':_0x117f98[_0x6117('0x19')]?_0x117f98[_0x6117('0x19')]['include']?_[_0x6117('0x1d')](_0x117f98[_0x6117('0x19')][_0x6117('0x1e')],function(_0x2e702b){return{'model':db[_0x2e702b[_0x6117('0x1f')]],'as':_0x2e702b['as'],'attributes':_0x2e702b[_0x6117('0x1b')],'include':_0x2e702b['include']?_['map'](_0x2e702b['include'],function(_0x44d4c4){return{'model':db[_0x44d4c4[_0x6117('0x1f')]],'as':_0x44d4c4['as'],'attributes':_0x44d4c4[_0x6117('0x1b')],'include':_0x44d4c4[_0x6117('0x1e')]?_[_0x6117('0x1d')](_0x44d4c4['include'],function(_0x1b5ac8){return{'model':db[_0x1b5ac8[_0x6117('0x1f')]],'as':_0x1b5ac8['as'],'attributes':_0x1b5ac8[_0x6117('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x6117('0x20')](function(_0x5d9fa3){logger['info'](_0x6117('0x16'),_0x117f98);logger[_0x6117('0x21')]('GetMailServerIn',_0x117f98,JSON[_0x6117('0x22')](_0x5d9fa3));_0xf66df9(_0x5d9fa3);})['catch'](function(_0x3c01ae){logger[_0x6117('0x10')](_0x6117('0x16'),_0x3c01ae[_0x6117('0x13')],_0x117f98);_0x262fdf(_0x4cef81[_0x6117('0x10')](0x1f4,_0x3c01ae[_0x6117('0x13')]));});});}; \ No newline at end of file +var _0xd139=['rpc','../../config/environment','client','http','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetMailServerIn','MailServerIn','findAll','options','raw','attributes','limit','include','map','model','then','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x47b776,_0x479abe){var _0xb1e973=function(_0x4f62a5){while(--_0x4f62a5){_0x47b776['push'](_0x47b776['shift']());}};_0xb1e973(++_0x479abe);}(_0xd139,0x14e));var _0x9d13=function(_0x375d0f,_0x26c984){_0x375d0f=_0x375d0f-0x0;var _0x5e20aa=_0xd139[_0x375d0f];return _0x5e20aa;};'use strict';var _=require(_0x9d13('0x0'));var util=require(_0x9d13('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9d13('0x2'));var fs=require('fs');var Redis=require(_0x9d13('0x3'));var db=require(_0x9d13('0x4'))['db'];var utils=require(_0x9d13('0x5'));var logger=require(_0x9d13('0x6'))(_0x9d13('0x7'));var config=require(_0x9d13('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9d13('0x9')][_0x9d13('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50294b,_0x198d7d,_0x4b3db0){return new BPromise(function(_0x434ef6,_0x524947){return client['request'](_0x50294b,_0x4b3db0)['then'](function(_0x3ccdf9){logger[_0x9d13('0xb')](_0x9d13('0xc'),_0x198d7d,_0x9d13('0xd'));logger[_0x9d13('0xe')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x198d7d,_0x9d13('0xd'),JSON[_0x9d13('0xf')](_0x3ccdf9));if(_0x3ccdf9[_0x9d13('0x10')]){if(_0x3ccdf9['error']['code']===0x1f4){logger[_0x9d13('0x10')](_0x9d13('0xc'),_0x198d7d,_0x3ccdf9[_0x9d13('0x10')][_0x9d13('0x11')]);return _0x524947(_0x3ccdf9[_0x9d13('0x10')]['message']);}logger['error'](_0x9d13('0xc'),_0x198d7d,_0x3ccdf9[_0x9d13('0x10')][_0x9d13('0x11')]);return _0x434ef6(_0x3ccdf9[_0x9d13('0x10')][_0x9d13('0x11')]);}else{logger[_0x9d13('0xb')](_0x9d13('0xc'),_0x198d7d,'request\x20sent');_0x434ef6(_0x3ccdf9[_0x9d13('0x12')][_0x9d13('0x11')]);}})[_0x9d13('0x13')](function(_0x250234){logger[_0x9d13('0x10')](_0x9d13('0xc'),_0x198d7d,_0x250234);_0x524947(_0x250234);});});}exports[_0x9d13('0x14')]=function(_0x10aa89){var _0x45a07a=this;return new Promise(function(_0x2acb0b,_0xa1de89){return db[_0x9d13('0x15')][_0x9d13('0x16')]({'raw':_0x10aa89['options']?_0x10aa89[_0x9d13('0x17')][_0x9d13('0x18')]===undefined?!![]:![]:!![],'where':_0x10aa89[_0x9d13('0x17')]?_0x10aa89[_0x9d13('0x17')]['where']||null:null,'attributes':_0x10aa89['options']?_0x10aa89['options'][_0x9d13('0x19')]||null:null,'limit':_0x10aa89[_0x9d13('0x17')]?_0x10aa89[_0x9d13('0x17')][_0x9d13('0x1a')]||null:null,'include':_0x10aa89[_0x9d13('0x17')]?_0x10aa89[_0x9d13('0x17')][_0x9d13('0x1b')]?_[_0x9d13('0x1c')](_0x10aa89['options'][_0x9d13('0x1b')],function(_0xd5a981){return{'model':db[_0xd5a981[_0x9d13('0x1d')]],'as':_0xd5a981['as'],'attributes':_0xd5a981[_0x9d13('0x19')],'include':_0xd5a981['include']?_[_0x9d13('0x1c')](_0xd5a981['include'],function(_0x40c673){return{'model':db[_0x40c673[_0x9d13('0x1d')]],'as':_0x40c673['as'],'attributes':_0x40c673[_0x9d13('0x19')],'include':_0x40c673[_0x9d13('0x1b')]?_[_0x9d13('0x1c')](_0x40c673[_0x9d13('0x1b')],function(_0x1c36e5){return{'model':db[_0x1c36e5[_0x9d13('0x1d')]],'as':_0x1c36e5['as'],'attributes':_0x1c36e5['attributes']};}):[]};}):[]};}):[]:[]})[_0x9d13('0x1e')](function(_0x4edc05){logger[_0x9d13('0xb')](_0x9d13('0x14'),_0x10aa89);logger[_0x9d13('0xe')](_0x9d13('0x14'),_0x10aa89,JSON[_0x9d13('0xf')](_0x4edc05));_0x2acb0b(_0x4edc05);})[_0x9d13('0x13')](function(_0x441118){logger[_0x9d13('0x10')](_0x9d13('0x14'),_0x441118[_0x9d13('0x11')],_0x10aa89);_0xa1de89(_0x45a07a[_0x9d13('0x10')](0x1f4,_0x441118[_0x9d13('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index ad23cfb..bc0da5a 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(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x7a54,0x106));var _0x47a5=function(_0x24b5b1,_0x395585){_0x24b5b1=_0x24b5b1-0x0;var _0x4869ff=_0x7a54[_0x24b5b1];return _0x4869ff;};'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(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x7a54,0x106));var _0x47a5=function(_0x5e540f,_0x56487b){_0x5e540f=_0x5e540f-0x0;var _0x3fc4ed=_0x7a54[_0x5e540f];return _0x3fc4ed;};'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 055e4fc..70abe16 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 _0x282b=['sequelize','exports','STRING','BOOLEAN'];(function(_0x1ee856,_0x52596f){var _0x3473c7=function(_0x58898e){while(--_0x58898e){_0x1ee856['push'](_0x1ee856['shift']());}};_0x3473c7(++_0x52596f);}(_0x282b,0xec));var _0xb282=function(_0x21c779,_0x2e0d5c){_0x21c779=_0x21c779-0x0;var _0x20f652=_0x282b[_0x21c779];return _0x20f652;};'use strict';var Sequelize=require(_0xb282('0x0'));module[_0xb282('0x1')]={'description':{'type':Sequelize[_0xb282('0x2')]},'host':{'type':Sequelize[_0xb282('0x2')]},'user':{'type':Sequelize[_0xb282('0x2')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize[_0xb282('0x3')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xb282('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xb282('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x2f68=['INTEGER','BOOLEAN','exports','STRING'];(function(_0x562dcd,_0x2353fd){var _0x4e675b=function(_0xa57123){while(--_0xa57123){_0x562dcd['push'](_0x562dcd['shift']());}};_0x4e675b(++_0x2353fd);}(_0x2f68,0x9a));var _0x82f6=function(_0x539ed7,_0x1f6fce){_0x539ed7=_0x539ed7-0x0;var _0x26fc30=_0x2f68[_0x539ed7];return _0x26fc30;};'use strict';var Sequelize=require('sequelize');module[_0x82f6('0x0')]={'description':{'type':Sequelize[_0x82f6('0x1')]},'host':{'type':Sequelize[_0x82f6('0x1')]},'user':{'type':Sequelize[_0x82f6('0x1')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x82f6('0x2')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0x82f6('0x1')]},'authentication':{'type':Sequelize[_0x82f6('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 2ff9568..99586d4 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 _0x0c94=['../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','map','MailServerOut','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x11a4c7,_0x32450d){var _0x55c066=function(_0x54aaa7){while(--_0x54aaa7){_0x11a4c7['push'](_0x11a4c7['shift']());}};_0x55c066(++_0x32450d);}(_0x0c94,0xd8));var _0x40c9=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x0c94[_0x7e2eb0];return _0xd92de4;};'use strict';var emlformat=require(_0x40c9('0x0'));var rimraf=require(_0x40c9('0x1'));var zipdir=require(_0x40c9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x40c9('0x3'));var moment=require(_0x40c9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x40c9('0x5'));var util=require(_0x40c9('0x6'));var path=require(_0x40c9('0x7'));var sox=require(_0x40c9('0x8'));var csv=require(_0x40c9('0x9'));var ejs=require(_0x40c9('0xa'));var fs=require('fs');var fs_extra=require(_0x40c9('0xb'));var _=require(_0x40c9('0xc'));var squel=require(_0x40c9('0xd'));var crypto=require(_0x40c9('0xe'));var jsforce=require(_0x40c9('0xf'));var deskjs=require(_0x40c9('0x10'));var toCsv=require(_0x40c9('0x9'));var querystring=require(_0x40c9('0x11'));var Papa=require(_0x40c9('0x12'));var Redis=require(_0x40c9('0x13'));var authService=require(_0x40c9('0x14'));var qs=require(_0x40c9('0x15'));var as=require(_0x40c9('0x16'));var hardwareService=require(_0x40c9('0x17'));var logger=require(_0x40c9('0x18'))(_0x40c9('0x19'));var utils=require(_0x40c9('0x1a'));var config=require(_0x40c9('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x40c9('0x1c'))['db'];function respondWithStatusCode(_0x35158d,_0x1f1b55){_0x1f1b55=_0x1f1b55||0xcc;return function(_0x308154){if(_0x308154){return _0x35158d['sendStatus'](_0x1f1b55);}return _0x35158d['status'](_0x1f1b55)[_0x40c9('0x1d')]();};}function respondWithResult(_0x4ab720,_0x4b73bb){_0x4b73bb=_0x4b73bb||0xc8;return function(_0x4b2750){if(_0x4b2750){return _0x4ab720[_0x40c9('0x1e')](_0x4b73bb)[_0x40c9('0x1f')](_0x4b2750);}};}function respondWithFilteredResult(_0x309534,_0x484c41){return function(_0x3db303){if(_0x3db303){var _0x353223=typeof _0x484c41[_0x40c9('0x20')]===_0x40c9('0x21')&&typeof _0x484c41[_0x40c9('0x22')]===_0x40c9('0x21');var _0x47ef91=_0x3db303[_0x40c9('0x23')];var _0x57f2cc=_0x353223?0x0:_0x484c41['offset'];var _0x260388=_0x353223?_0x3db303['count']:_0x484c41[_0x40c9('0x20')]+_0x484c41[_0x40c9('0x22')];var _0x4f6efe;if(_0x260388>=_0x47ef91){_0x260388=_0x47ef91;_0x4f6efe=0xc8;}else{_0x4f6efe=0xce;}_0x309534['status'](_0x4f6efe);return _0x309534[_0x40c9('0x24')](_0x40c9('0x25'),_0x57f2cc+'-'+_0x260388+'/'+_0x47ef91)[_0x40c9('0x1f')](_0x3db303);}return null;};}function patchUpdates(_0x46b65a){return function(_0x50863f){try{jsonpatch['apply'](_0x50863f,_0x46b65a,!![]);}catch(_0x21e524){return BPromise[_0x40c9('0x26')](_0x21e524);}return _0x50863f[_0x40c9('0x27')]();};}function saveUpdates(_0x492f69,_0x25aa92){return function(_0x5160cc){if(_0x5160cc){return _0x5160cc[_0x40c9('0x28')](_0x492f69)['then'](function(_0x3fa016){return _0x3fa016;});}return null;};}function removeEntity(_0x4bfe71,_0x58afe0){return function(_0x401153){if(_0x401153){return _0x401153[_0x40c9('0x29')]()[_0x40c9('0x2a')](function(){_0x4bfe71[_0x40c9('0x1e')](0xcc)[_0x40c9('0x1d')]();});}};}function handleEntityNotFound(_0x5d0768,_0x10dc62){return function(_0x4da2bb){if(!_0x4da2bb){_0x5d0768[_0x40c9('0x2b')](0x194);}return _0x4da2bb;};}function handleError(_0x380a0a,_0x4ba8aa){_0x4ba8aa=_0x4ba8aa||0x1f4;return function(_0x3da3ad){logger[_0x40c9('0x2c')](_0x3da3ad[_0x40c9('0x2d')]);if(_0x3da3ad['name']){delete _0x3da3ad[_0x40c9('0x2e')];}_0x380a0a[_0x40c9('0x1e')](_0x4ba8aa)[_0x40c9('0x2f')](_0x3da3ad);};}exports[_0x40c9('0x30')]=function(_0x1ab45a,_0x1c1a5b){var _0x318755={},_0x42fbf7={},_0x316a70={'count':0x0,'rows':[]};var _0x2e858f=_[_0x40c9('0x31')](db[_0x40c9('0x32')]['rawAttributes'],function(_0x2f46bf){return{'name':_0x2f46bf[_0x40c9('0x33')],'type':_0x2f46bf[_0x40c9('0x34')][_0x40c9('0x35')]};});_0x42fbf7[_0x40c9('0x36')]=_[_0x40c9('0x31')](_0x2e858f,_0x40c9('0x2e'));_0x42fbf7['query']=_[_0x40c9('0x37')](_0x1ab45a[_0x40c9('0x38')]);_0x42fbf7[_0x40c9('0x39')]=_[_0x40c9('0x3a')](_0x42fbf7[_0x40c9('0x36')],_0x42fbf7[_0x40c9('0x38')]);_0x318755[_0x40c9('0x3b')]=_[_0x40c9('0x3a')](_0x42fbf7[_0x40c9('0x36')],qs['fields'](_0x1ab45a['query'][_0x40c9('0x3c')]));_0x318755['attributes']=_0x318755[_0x40c9('0x3b')][_0x40c9('0x3d')]?_0x318755[_0x40c9('0x3b')]:_0x42fbf7[_0x40c9('0x36')];if(!_0x1ab45a[_0x40c9('0x38')][_0x40c9('0x3e')](_0x40c9('0x3f'))){_0x318755[_0x40c9('0x22')]=qs[_0x40c9('0x22')](_0x1ab45a[_0x40c9('0x38')][_0x40c9('0x22')]);_0x318755[_0x40c9('0x20')]=qs[_0x40c9('0x20')](_0x1ab45a['query'][_0x40c9('0x20')]);}_0x318755[_0x40c9('0x40')]=qs['sort'](_0x1ab45a['query'][_0x40c9('0x41')]);_0x318755[_0x40c9('0x42')]=qs['filters'](_['pick'](_0x1ab45a[_0x40c9('0x38')],_0x42fbf7[_0x40c9('0x39')]),_0x2e858f);if(_0x1ab45a['query'][_0x40c9('0x43')]){_0x318755[_0x40c9('0x42')]=_['merge'](_0x318755['where'],{'$or':_[_0x40c9('0x31')](_0x2e858f,function(_0x5dabbc){if(_0x5dabbc['type']!==_0x40c9('0x44')){var _0x1c2a31={};_0x1c2a31[_0x5dabbc[_0x40c9('0x2e')]]={'$like':'%'+_0x1ab45a[_0x40c9('0x38')][_0x40c9('0x43')]+'%'};return _0x1c2a31;}})});}_0x318755=_[_0x40c9('0x45')]({},_0x318755,_0x1ab45a[_0x40c9('0x46')]);var _0x578224={'where':_0x318755[_0x40c9('0x42')]};return db[_0x40c9('0x32')]['count'](_0x578224)[_0x40c9('0x2a')](function(_0x5cdc9b){_0x316a70[_0x40c9('0x23')]=_0x5cdc9b;if(_0x1ab45a[_0x40c9('0x38')][_0x40c9('0x47')]){_0x318755[_0x40c9('0x48')]=[{'all':!![]}];}return db['MailServerOut'][_0x40c9('0x49')](_0x318755);})[_0x40c9('0x2a')](function(_0x45ea33){_0x316a70['rows']=_0x45ea33;return _0x316a70;})[_0x40c9('0x2a')](respondWithFilteredResult(_0x1c1a5b,_0x318755))[_0x40c9('0x4a')](handleError(_0x1c1a5b,null));};exports[_0x40c9('0x4b')]=function(_0x403c62,_0x585d87){var _0xa5b9c7={'raw':!![],'where':{'id':_0x403c62[_0x40c9('0x4c')]['id']}},_0x361e68={};_0x361e68[_0x40c9('0x36')]=_[_0x40c9('0x37')](db['MailServerOut']['rawAttributes']);_0x361e68[_0x40c9('0x38')]=_['keys'](_0x403c62[_0x40c9('0x38')]);_0x361e68[_0x40c9('0x39')]=_[_0x40c9('0x3a')](_0x361e68[_0x40c9('0x36')],_0x361e68[_0x40c9('0x38')]);_0xa5b9c7[_0x40c9('0x3b')]=_[_0x40c9('0x3a')](_0x361e68[_0x40c9('0x36')],qs['fields'](_0x403c62[_0x40c9('0x38')][_0x40c9('0x3c')]));_0xa5b9c7[_0x40c9('0x3b')]=_0xa5b9c7[_0x40c9('0x3b')][_0x40c9('0x3d')]?_0xa5b9c7[_0x40c9('0x3b')]:_0x361e68[_0x40c9('0x36')];if(_0x403c62[_0x40c9('0x38')]['includeAll']){_0xa5b9c7['include']=[{'all':!![]}];}_0xa5b9c7=_[_0x40c9('0x45')]({},_0xa5b9c7,_0x403c62[_0x40c9('0x46')]);return db[_0x40c9('0x32')][_0x40c9('0x4d')](_0xa5b9c7)[_0x40c9('0x2a')](handleEntityNotFound(_0x585d87,null))['then'](respondWithResult(_0x585d87,null))['catch'](handleError(_0x585d87,null));};exports[_0x40c9('0x4e')]=function(_0x3c698c,_0x40a9ea){return db[_0x40c9('0x32')][_0x40c9('0x4e')](_0x3c698c['body'],{})[_0x40c9('0x2a')](respondWithResult(_0x40a9ea,0xc9))[_0x40c9('0x4a')](handleError(_0x40a9ea,null));};exports[_0x40c9('0x28')]=function(_0x35d357,_0x44bedc){if(_0x35d357[_0x40c9('0x4f')]['id']){delete _0x35d357['body']['id'];}return db[_0x40c9('0x32')][_0x40c9('0x4d')]({'where':{'id':_0x35d357[_0x40c9('0x4c')]['id']}})[_0x40c9('0x2a')](handleEntityNotFound(_0x44bedc,null))[_0x40c9('0x2a')](saveUpdates(_0x35d357[_0x40c9('0x4f')],null))[_0x40c9('0x2a')](respondWithResult(_0x44bedc,null))[_0x40c9('0x4a')](handleError(_0x44bedc,null));};exports['destroy']=function(_0x43cdf1,_0xb47894){return db[_0x40c9('0x32')][_0x40c9('0x4d')]({'where':{'id':_0x43cdf1[_0x40c9('0x4c')]['id']}})[_0x40c9('0x2a')](handleEntityNotFound(_0xb47894,null))['then'](removeEntity(_0xb47894,null))[_0x40c9('0x4a')](handleError(_0xb47894,null));}; \ No newline at end of file +var _0xdb54=['stack','name','map','fieldName','key','query','filters','intersection','model','fields','attributes','length','nolimit','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','MailServerOut','rows','catch','show','params','keys','rawAttributes','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','crypto','jsforce','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error'];(function(_0x3df9dd,_0x26f5cd){var _0x4f11e4=function(_0x1993fe){while(--_0x1993fe){_0x3df9dd['push'](_0x3df9dd['shift']());}};_0x4f11e4(++_0x26f5cd);}(_0xdb54,0x14c));var _0x4db5=function(_0x17451b,_0x2a078d){_0x17451b=_0x17451b-0x0;var _0x146155=_0xdb54[_0x17451b];return _0x146155;};'use strict';var emlformat=require(_0x4db5('0x0'));var rimraf=require(_0x4db5('0x1'));var zipdir=require(_0x4db5('0x2'));var jsonpatch=require(_0x4db5('0x3'));var rp=require(_0x4db5('0x4'));var moment=require(_0x4db5('0x5'));var BPromise=require(_0x4db5('0x6'));var Mustache=require(_0x4db5('0x7'));var util=require(_0x4db5('0x8'));var path=require(_0x4db5('0x9'));var sox=require(_0x4db5('0xa'));var csv=require(_0x4db5('0xb'));var ejs=require(_0x4db5('0xc'));var fs=require('fs');var fs_extra=require(_0x4db5('0xd'));var _=require(_0x4db5('0xe'));var squel=require(_0x4db5('0xf'));var crypto=require(_0x4db5('0x10'));var jsforce=require(_0x4db5('0x11'));var deskjs=require('desk.js');var toCsv=require(_0x4db5('0xb'));var querystring=require('querystring');var Papa=require(_0x4db5('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4db5('0x13'));var hardwareService=require(_0x4db5('0x14'));var logger=require(_0x4db5('0x15'))('api');var utils=require(_0x4db5('0x16'));var config=require(_0x4db5('0x17'));var licenseUtil=require(_0x4db5('0x18'));var db=require(_0x4db5('0x19'))['db'];function respondWithStatusCode(_0x493089,_0x4fc672){_0x4fc672=_0x4fc672||0xcc;return function(_0x218f69){if(_0x218f69){return _0x493089[_0x4db5('0x1a')](_0x4fc672);}return _0x493089[_0x4db5('0x1b')](_0x4fc672)['end']();};}function respondWithResult(_0x4ecc1b,_0x447dc6){_0x447dc6=_0x447dc6||0xc8;return function(_0x338bc){if(_0x338bc){return _0x4ecc1b[_0x4db5('0x1b')](_0x447dc6)[_0x4db5('0x1c')](_0x338bc);}};}function respondWithFilteredResult(_0x2860a1,_0x2cde3a){return function(_0x48d157){if(_0x48d157){var _0x12a09a=typeof _0x2cde3a['offset']===_0x4db5('0x1d')&&typeof _0x2cde3a[_0x4db5('0x1e')]===_0x4db5('0x1d');var _0x3a6d7b=_0x48d157[_0x4db5('0x1f')];var _0x20e99c=_0x12a09a?0x0:_0x2cde3a[_0x4db5('0x20')];var _0x462de2=_0x12a09a?_0x48d157[_0x4db5('0x1f')]:_0x2cde3a[_0x4db5('0x20')]+_0x2cde3a[_0x4db5('0x1e')];var _0x3199e0;if(_0x462de2>=_0x3a6d7b){_0x462de2=_0x3a6d7b;_0x3199e0=0xc8;}else{_0x3199e0=0xce;}_0x2860a1['status'](_0x3199e0);return _0x2860a1[_0x4db5('0x21')](_0x4db5('0x22'),_0x20e99c+'-'+_0x462de2+'/'+_0x3a6d7b)['json'](_0x48d157);}return null;};}function patchUpdates(_0x40fa1f){return function(_0x588c24){try{jsonpatch[_0x4db5('0x23')](_0x588c24,_0x40fa1f,!![]);}catch(_0x56c7fe){return BPromise[_0x4db5('0x24')](_0x56c7fe);}return _0x588c24[_0x4db5('0x25')]();};}function saveUpdates(_0x115f6f,_0xd8fca6){return function(_0x81c842){if(_0x81c842){return _0x81c842[_0x4db5('0x26')](_0x115f6f)[_0x4db5('0x27')](function(_0x485fed){return _0x485fed;});}return null;};}function removeEntity(_0x3e4c10,_0x13fd76){return function(_0x4df519){if(_0x4df519){return _0x4df519[_0x4db5('0x28')]()[_0x4db5('0x27')](function(){_0x3e4c10[_0x4db5('0x1b')](0xcc)[_0x4db5('0x29')]();});}};}function handleEntityNotFound(_0x4664a9,_0x3a8c12){return function(_0x4b1103){if(!_0x4b1103){_0x4664a9[_0x4db5('0x1a')](0x194);}return _0x4b1103;};}function handleError(_0x5a39e8,_0x6d3119){_0x6d3119=_0x6d3119||0x1f4;return function(_0x1535c5){logger[_0x4db5('0x2a')](_0x1535c5[_0x4db5('0x2b')]);if(_0x1535c5['name']){delete _0x1535c5[_0x4db5('0x2c')];}_0x5a39e8['status'](_0x6d3119)['send'](_0x1535c5);};}exports['index']=function(_0x4ffbd5,_0x215978){var _0x4a9eed={},_0x505f3d={},_0x3f203c={'count':0x0,'rows':[]};var _0x9fdabe=_[_0x4db5('0x2d')](db['MailServerOut']['rawAttributes'],function(_0x43e1c5){return{'name':_0x43e1c5[_0x4db5('0x2e')],'type':_0x43e1c5['type'][_0x4db5('0x2f')]};});_0x505f3d['model']=_['map'](_0x9fdabe,'name');_0x505f3d[_0x4db5('0x30')]=_['keys'](_0x4ffbd5[_0x4db5('0x30')]);_0x505f3d[_0x4db5('0x31')]=_[_0x4db5('0x32')](_0x505f3d[_0x4db5('0x33')],_0x505f3d[_0x4db5('0x30')]);_0x4a9eed['attributes']=_[_0x4db5('0x32')](_0x505f3d['model'],qs[_0x4db5('0x34')](_0x4ffbd5['query'][_0x4db5('0x34')]));_0x4a9eed[_0x4db5('0x35')]=_0x4a9eed['attributes'][_0x4db5('0x36')]?_0x4a9eed[_0x4db5('0x35')]:_0x505f3d['model'];if(!_0x4ffbd5['query']['hasOwnProperty'](_0x4db5('0x37'))){_0x4a9eed[_0x4db5('0x1e')]=qs[_0x4db5('0x1e')](_0x4ffbd5['query'][_0x4db5('0x1e')]);_0x4a9eed[_0x4db5('0x20')]=qs[_0x4db5('0x20')](_0x4ffbd5['query'][_0x4db5('0x20')]);}_0x4a9eed['order']=qs[_0x4db5('0x38')](_0x4ffbd5[_0x4db5('0x30')][_0x4db5('0x38')]);_0x4a9eed['where']=qs[_0x4db5('0x31')](_[_0x4db5('0x39')](_0x4ffbd5[_0x4db5('0x30')],_0x505f3d[_0x4db5('0x31')]),_0x9fdabe);if(_0x4ffbd5[_0x4db5('0x30')][_0x4db5('0x3a')]){_0x4a9eed['where']=_[_0x4db5('0x3b')](_0x4a9eed[_0x4db5('0x3c')],{'$or':_[_0x4db5('0x2d')](_0x9fdabe,function(_0x3d7c2c){if(_0x3d7c2c['type']!==_0x4db5('0x3d')){var _0x3a6b37={};_0x3a6b37[_0x3d7c2c[_0x4db5('0x2c')]]={'$like':'%'+_0x4ffbd5[_0x4db5('0x30')][_0x4db5('0x3a')]+'%'};return _0x3a6b37;}})});}_0x4a9eed=_[_0x4db5('0x3b')]({},_0x4a9eed,_0x4ffbd5[_0x4db5('0x3e')]);var _0xd3a379={'where':_0x4a9eed['where']};return db['MailServerOut'][_0x4db5('0x1f')](_0xd3a379)[_0x4db5('0x27')](function(_0x469e7a){_0x3f203c[_0x4db5('0x1f')]=_0x469e7a;if(_0x4ffbd5[_0x4db5('0x30')][_0x4db5('0x3f')]){_0x4a9eed[_0x4db5('0x40')]=[{'all':!![]}];}return db[_0x4db5('0x41')]['findAll'](_0x4a9eed);})[_0x4db5('0x27')](function(_0x41c855){_0x3f203c[_0x4db5('0x42')]=_0x41c855;return _0x3f203c;})[_0x4db5('0x27')](respondWithFilteredResult(_0x215978,_0x4a9eed))[_0x4db5('0x43')](handleError(_0x215978,null));};exports[_0x4db5('0x44')]=function(_0x42ac34,_0x454cbe){var _0xbe61e2={'raw':!![],'where':{'id':_0x42ac34[_0x4db5('0x45')]['id']}},_0x144b3b={};_0x144b3b[_0x4db5('0x33')]=_[_0x4db5('0x46')](db[_0x4db5('0x41')][_0x4db5('0x47')]);_0x144b3b[_0x4db5('0x30')]=_[_0x4db5('0x46')](_0x42ac34[_0x4db5('0x30')]);_0x144b3b[_0x4db5('0x31')]=_['intersection'](_0x144b3b[_0x4db5('0x33')],_0x144b3b[_0x4db5('0x30')]);_0xbe61e2[_0x4db5('0x35')]=_[_0x4db5('0x32')](_0x144b3b[_0x4db5('0x33')],qs[_0x4db5('0x34')](_0x42ac34[_0x4db5('0x30')][_0x4db5('0x34')]));_0xbe61e2[_0x4db5('0x35')]=_0xbe61e2[_0x4db5('0x35')][_0x4db5('0x36')]?_0xbe61e2[_0x4db5('0x35')]:_0x144b3b[_0x4db5('0x33')];if(_0x42ac34['query'][_0x4db5('0x3f')]){_0xbe61e2['include']=[{'all':!![]}];}_0xbe61e2=_['merge']({},_0xbe61e2,_0x42ac34[_0x4db5('0x3e')]);return db[_0x4db5('0x41')][_0x4db5('0x48')](_0xbe61e2)['then'](handleEntityNotFound(_0x454cbe,null))[_0x4db5('0x27')](respondWithResult(_0x454cbe,null))['catch'](handleError(_0x454cbe,null));};exports[_0x4db5('0x49')]=function(_0x1cc4da,_0x291a78){return db['MailServerOut']['create'](_0x1cc4da[_0x4db5('0x4a')],{})[_0x4db5('0x27')](respondWithResult(_0x291a78,0xc9))['catch'](handleError(_0x291a78,null));};exports['update']=function(_0x4bb4ef,_0x125969){if(_0x4bb4ef['body']['id']){delete _0x4bb4ef['body']['id'];}return db[_0x4db5('0x41')][_0x4db5('0x48')]({'where':{'id':_0x4bb4ef['params']['id']}})[_0x4db5('0x27')](handleEntityNotFound(_0x125969,null))['then'](saveUpdates(_0x4bb4ef[_0x4db5('0x4a')],null))[_0x4db5('0x27')](respondWithResult(_0x125969,null))[_0x4db5('0x43')](handleError(_0x125969,null));};exports[_0x4db5('0x28')]=function(_0x52897c,_0x923c73){return db[_0x4db5('0x41')]['find']({'where':{'id':_0x52897c['params']['id']}})['then'](handleEntityNotFound(_0x923c73,null))[_0x4db5('0x27')](removeEntity(_0x923c73,null))[_0x4db5('0x43')](handleError(_0x923c73,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 4d1228b..86fd0ae 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 _0xb04f=['path','rimraf','../../config/environment','./mailServerOut.attributes','define','MailServerOut','mail_servers_out','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1afeb1,_0x4ef5e7){var _0x397155=function(_0x1c040b){while(--_0x1c040b){_0x1afeb1['push'](_0x1afeb1['shift']());}};_0x397155(++_0x4ef5e7);}(_0xb04f,0x89));var _0xfb04=function(_0x5232ef,_0x9cec54){_0x5232ef=_0x5232ef-0x0;var _0x29cfb0=_0xb04f[_0x5232ef];return _0x29cfb0;};'use strict';var _=require('lodash');var util=require(_0xfb04('0x0'));var logger=require(_0xfb04('0x1'))(_0xfb04('0x2'));var moment=require(_0xfb04('0x3'));var BPromise=require(_0xfb04('0x4'));var rp=require(_0xfb04('0x5'));var fs=require('fs');var path=require(_0xfb04('0x6'));var rimraf=require(_0xfb04('0x7'));var config=require(_0xfb04('0x8'));var attributes=require(_0xfb04('0x9'));module['exports']=function(_0x174207,_0x517ac3){return _0x174207[_0xfb04('0xa')](_0xfb04('0xb'),attributes,{'tableName':_0xfb04('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xce71=['moment','bluebird','request-promise','path','../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','lodash','util','api'];(function(_0x401f3e,_0x2ef680){var _0x53f9b1=function(_0x159f68){while(--_0x159f68){_0x401f3e['push'](_0x401f3e['shift']());}};_0x53f9b1(++_0x2ef680);}(_0xce71,0x1ad));var _0x1ce7=function(_0x1c6412,_0x143f92){_0x1c6412=_0x1c6412-0x0;var _0xc2872=_0xce71[_0x1c6412];return _0xc2872;};'use strict';var _=require(_0x1ce7('0x0'));var util=require(_0x1ce7('0x1'));var logger=require('../../config/logger')(_0x1ce7('0x2'));var moment=require(_0x1ce7('0x3'));var BPromise=require(_0x1ce7('0x4'));var rp=require(_0x1ce7('0x5'));var fs=require('fs');var path=require(_0x1ce7('0x6'));var rimraf=require('rimraf');var config=require(_0x1ce7('0x7'));var attributes=require(_0x1ce7('0x8'));module[_0x1ce7('0x9')]=function(_0x2c6e21,_0x345870){return _0x2c6e21[_0x1ce7('0xa')](_0x1ce7('0xb'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index 5a7a575..a192717 100644 --- a/server/api/mailServerOut/mailServerOut.rpc.js +++ b/server/api/mailServerOut/mailServerOut.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailServerOut,\x20%s,\x20%s','MailServerOut,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x9b9c46,_0x3997a8){var _0x47ee52=function(_0x1b382f){while(--_0x1b382f){_0x9b9c46['push'](_0x9b9c46['shift']());}};_0x47ee52(++_0x3997a8);}(_0x2ef3,0xba));var _0x32ef=function(_0x1a4c34,_0x1005aa){_0x1a4c34=_0x1a4c34-0x0;var _0x51c85c=_0x2ef3[_0x1a4c34];return _0x51c85c;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file +var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x3a9f3d,_0x1475cd){var _0x1c0878=function(_0x433ba2){while(--_0x433ba2){_0x3a9f3d['push'](_0x3a9f3d['shift']());}};_0x1c0878(++_0x1475cd);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0xc4aa[_0x2235bf];return _0x4c3a64;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index f2b164b..1382eba 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 _0xa309=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x5f37b1,_0x26fb91){var _0x31ab85=function(_0x40b006){while(--_0x40b006){_0x5f37b1['push'](_0x5f37b1['shift']());}};_0x31ab85(++_0x26fb91);}(_0xa309,0x96));var _0x9a30=function(_0x277b1c,_0x2cbc2d){_0x277b1c=_0x277b1c-0x0;var _0x39deb1=_0xa309[_0x277b1c];return _0x39deb1;};'use strict';var multer=require(_0x9a30('0x0'));var util=require(_0x9a30('0x1'));var path=require(_0x9a30('0x2'));var timeout=require(_0x9a30('0x3'));var express=require(_0x9a30('0x4'));var router=express[_0x9a30('0x5')]();var fs_extra=require(_0x9a30('0x6'));var auth=require(_0x9a30('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x9a30('0x8'));var controller=require('./mailSubstatus.controller');router[_0x9a30('0x9')]('/',auth[_0x9a30('0xa')](),controller[_0x9a30('0xb')]);router[_0x9a30('0x9')]('/describe',auth[_0x9a30('0xa')](),controller[_0x9a30('0xc')]);router[_0x9a30('0x9')](_0x9a30('0xd'),auth[_0x9a30('0xa')](),controller[_0x9a30('0xe')]);router[_0x9a30('0xf')]('/',auth[_0x9a30('0xa')](),controller[_0x9a30('0x10')]);router[_0x9a30('0x11')](_0x9a30('0xd'),auth[_0x9a30('0xa')](),controller[_0x9a30('0x12')]);router[_0x9a30('0x13')](_0x9a30('0xd'),auth[_0x9a30('0xa')](),controller[_0x9a30('0x14')]);module[_0x9a30('0x15')]=router; \ No newline at end of file +var _0x1ec6=['update','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./mailSubstatus.controller','get','index','/describe','/:id','isAuthenticated','show','post','create','put'];(function(_0x348c3f,_0x24d2d4){var _0x511f00=function(_0x4e8d4e){while(--_0x4e8d4e){_0x348c3f['push'](_0x348c3f['shift']());}};_0x511f00(++_0x24d2d4);}(_0x1ec6,0x89));var _0x61ec=function(_0x49fa98,_0x11accf){_0x49fa98=_0x49fa98-0x0;var _0x1698f1=_0x1ec6[_0x49fa98];return _0x1698f1;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x61ec('0x0'));var timeout=require(_0x61ec('0x1'));var express=require(_0x61ec('0x2'));var router=express[_0x61ec('0x3')]();var fs_extra=require(_0x61ec('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x61ec('0x5'));var config=require('../../config/environment');var controller=require(_0x61ec('0x6'));router[_0x61ec('0x7')]('/',auth['isAuthenticated'](),controller[_0x61ec('0x8')]);router['get'](_0x61ec('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x61ec('0x7')](_0x61ec('0xa'),auth[_0x61ec('0xb')](),controller[_0x61ec('0xc')]);router[_0x61ec('0xd')]('/',auth[_0x61ec('0xb')](),controller[_0x61ec('0xe')]);router[_0x61ec('0xf')](_0x61ec('0xa'),auth[_0x61ec('0xb')](),controller[_0x61ec('0x10')]);router['delete'](_0x61ec('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 142f487..74c1bbd 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 _0xc4aa=['exports','STRING','name','sequelize'];(function(_0x32ffcf,_0x5a8b13){var _0x28bee9=function(_0x5b74eb){while(--_0x5b74eb){_0x32ffcf['push'](_0x32ffcf['shift']());}};_0x28bee9(++_0x5a8b13);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xc4aa[_0x1d1779];return _0x2377e9;};'use strict';var Sequelize=require(_0xac4a('0x0'));module[_0xac4a('0x1')]={'name':{'type':Sequelize[_0xac4a('0x2')],'unique':_0xac4a('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xac4a('0x2')]}}; \ No newline at end of file +var _0x885a=['exports','STRING','name'];(function(_0x4cc03b,_0x299f1c){var _0xf0358c=function(_0x3d0da8){while(--_0x3d0da8){_0x4cc03b['push'](_0x4cc03b['shift']());}};_0xf0358c(++_0x299f1c);}(_0x885a,0x180));var _0xa885=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x885a[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module[_0xa885('0x0')]={'name':{'type':Sequelize[_0xa885('0x1')],'unique':_0xa885('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xa885('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 8233f34..62ba4d8 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 _0xac84=['papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','MailSubstatus','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','map','type','merge','options','count','include','findAll','rows','catch','show','params','keys','includeAll','create','body','find','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','jsforce','desk.js','querystring'];(function(_0x10432a,_0x4eed8a){var _0x409599=function(_0x593d7e){while(--_0x593d7e){_0x10432a['push'](_0x10432a['shift']());}};_0x409599(++_0x4eed8a);}(_0xac84,0x11e));var _0x4ac8=function(_0x1460ab,_0x74d06e){_0x1460ab=_0x1460ab-0x0;var _0x1eeb5c=_0xac84[_0x1460ab];return _0x1eeb5c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4ac8('0x0'));var zipdir=require(_0x4ac8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4ac8('0x2'));var moment=require(_0x4ac8('0x3'));var BPromise=require(_0x4ac8('0x4'));var Mustache=require(_0x4ac8('0x5'));var util=require(_0x4ac8('0x6'));var path=require(_0x4ac8('0x7'));var sox=require(_0x4ac8('0x8'));var csv=require(_0x4ac8('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4ac8('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4ac8('0xb'));var deskjs=require(_0x4ac8('0xc'));var toCsv=require(_0x4ac8('0x9'));var querystring=require(_0x4ac8('0xd'));var Papa=require(_0x4ac8('0xe'));var Redis=require('ioredis');var authService=require(_0x4ac8('0xf'));var qs=require(_0x4ac8('0x10'));var as=require(_0x4ac8('0x11'));var hardwareService=require(_0x4ac8('0x12'));var logger=require(_0x4ac8('0x13'))(_0x4ac8('0x14'));var utils=require('../../config/utils');var config=require(_0x4ac8('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x4ac8('0x16'))['db'];function respondWithStatusCode(_0x5b1ada,_0x15c568){_0x15c568=_0x15c568||0xcc;return function(_0x3d67cc){if(_0x3d67cc){return _0x5b1ada[_0x4ac8('0x17')](_0x15c568);}return _0x5b1ada['status'](_0x15c568)[_0x4ac8('0x18')]();};}function respondWithResult(_0x4e2680,_0x385dcb){_0x385dcb=_0x385dcb||0xc8;return function(_0x2fcf8e){if(_0x2fcf8e){return _0x4e2680[_0x4ac8('0x19')](_0x385dcb)[_0x4ac8('0x1a')](_0x2fcf8e);}};}function respondWithFilteredResult(_0x87c6fb,_0x22e87e){return function(_0x43614b){if(_0x43614b){var _0xd8d746=typeof _0x22e87e[_0x4ac8('0x1b')]===_0x4ac8('0x1c')&&typeof _0x22e87e[_0x4ac8('0x1d')]===_0x4ac8('0x1c');var _0xa41ce1=_0x43614b['count'];var _0x198446=_0xd8d746?0x0:_0x22e87e[_0x4ac8('0x1b')];var _0x107119=_0xd8d746?_0x43614b['count']:_0x22e87e[_0x4ac8('0x1b')]+_0x22e87e['limit'];var _0xc517ab;if(_0x107119>=_0xa41ce1){_0x107119=_0xa41ce1;_0xc517ab=0xc8;}else{_0xc517ab=0xce;}_0x87c6fb[_0x4ac8('0x19')](_0xc517ab);return _0x87c6fb[_0x4ac8('0x1e')](_0x4ac8('0x1f'),_0x198446+'-'+_0x107119+'/'+_0xa41ce1)['json'](_0x43614b);}return null;};}function patchUpdates(_0x5ed3c9){return function(_0xf5d5d1){try{jsonpatch[_0x4ac8('0x20')](_0xf5d5d1,_0x5ed3c9,!![]);}catch(_0x432c66){return BPromise[_0x4ac8('0x21')](_0x432c66);}return _0xf5d5d1[_0x4ac8('0x22')]();};}function saveUpdates(_0x322288,_0x149de6){return function(_0x583910){if(_0x583910){return _0x583910[_0x4ac8('0x23')](_0x322288)[_0x4ac8('0x24')](function(_0x49cd5e){return _0x49cd5e;});}return null;};}function removeEntity(_0x1ac77c,_0x382b00){return function(_0x2c9845){if(_0x2c9845){return _0x2c9845[_0x4ac8('0x25')]()[_0x4ac8('0x24')](function(){_0x1ac77c[_0x4ac8('0x19')](0xcc)[_0x4ac8('0x18')]();});}};}function handleEntityNotFound(_0x258ce3,_0x1df99b){return function(_0x2ee403){if(!_0x2ee403){_0x258ce3[_0x4ac8('0x17')](0x194);}return _0x2ee403;};}function handleError(_0x407936,_0x2460a4){_0x2460a4=_0x2460a4||0x1f4;return function(_0x4e102c){logger[_0x4ac8('0x26')](_0x4e102c[_0x4ac8('0x27')]);if(_0x4e102c['name']){delete _0x4e102c[_0x4ac8('0x28')];}_0x407936['status'](_0x2460a4)[_0x4ac8('0x29')](_0x4e102c);};}exports['index']=function(_0x57736e,_0x24f0f3){var _0x4eb468={},_0x3275f0={},_0x9d458={'count':0x0,'rows':[]};var _0x4ded7e=_['map'](db[_0x4ac8('0x2a')][_0x4ac8('0x2b')],function(_0x178805){return{'name':_0x178805['fieldName'],'type':_0x178805['type'][_0x4ac8('0x2c')]};});_0x3275f0[_0x4ac8('0x2d')]=_['map'](_0x4ded7e,'name');_0x3275f0[_0x4ac8('0x2e')]=_['keys'](_0x57736e[_0x4ac8('0x2e')]);_0x3275f0[_0x4ac8('0x2f')]=_[_0x4ac8('0x30')](_0x3275f0[_0x4ac8('0x2d')],_0x3275f0[_0x4ac8('0x2e')]);_0x4eb468[_0x4ac8('0x31')]=_['intersection'](_0x3275f0[_0x4ac8('0x2d')],qs[_0x4ac8('0x32')](_0x57736e[_0x4ac8('0x2e')][_0x4ac8('0x32')]));_0x4eb468[_0x4ac8('0x31')]=_0x4eb468[_0x4ac8('0x31')][_0x4ac8('0x33')]?_0x4eb468['attributes']:_0x3275f0[_0x4ac8('0x2d')];if(!_0x57736e['query'][_0x4ac8('0x34')](_0x4ac8('0x35'))){_0x4eb468[_0x4ac8('0x1d')]=qs[_0x4ac8('0x1d')](_0x57736e[_0x4ac8('0x2e')]['limit']);_0x4eb468[_0x4ac8('0x1b')]=qs[_0x4ac8('0x1b')](_0x57736e['query']['offset']);}_0x4eb468[_0x4ac8('0x36')]=qs['sort'](_0x57736e[_0x4ac8('0x2e')][_0x4ac8('0x37')]);_0x4eb468[_0x4ac8('0x38')]=qs[_0x4ac8('0x2f')](_['pick'](_0x57736e[_0x4ac8('0x2e')],_0x3275f0[_0x4ac8('0x2f')]),_0x4ded7e);if(_0x57736e['query'][_0x4ac8('0x39')]){_0x4eb468[_0x4ac8('0x38')]=_['merge'](_0x4eb468[_0x4ac8('0x38')],{'$or':_[_0x4ac8('0x3a')](_0x4ded7e,function(_0x380e5d){if(_0x380e5d[_0x4ac8('0x3b')]!=='VIRTUAL'){var _0x9ef6cc={};_0x9ef6cc[_0x380e5d[_0x4ac8('0x28')]]={'$like':'%'+_0x57736e[_0x4ac8('0x2e')][_0x4ac8('0x39')]+'%'};return _0x9ef6cc;}})});}_0x4eb468=_[_0x4ac8('0x3c')]({},_0x4eb468,_0x57736e[_0x4ac8('0x3d')]);var _0x2b3e74={'where':_0x4eb468['where']};return db[_0x4ac8('0x2a')][_0x4ac8('0x3e')](_0x2b3e74)[_0x4ac8('0x24')](function(_0x8df844){_0x9d458[_0x4ac8('0x3e')]=_0x8df844;if(_0x57736e[_0x4ac8('0x2e')]['includeAll']){_0x4eb468[_0x4ac8('0x3f')]=[{'all':!![]}];}return db['MailSubstatus'][_0x4ac8('0x40')](_0x4eb468);})[_0x4ac8('0x24')](function(_0xf1955d){_0x9d458[_0x4ac8('0x41')]=_0xf1955d;return _0x9d458;})[_0x4ac8('0x24')](respondWithFilteredResult(_0x24f0f3,_0x4eb468))[_0x4ac8('0x42')](handleError(_0x24f0f3,null));};exports[_0x4ac8('0x43')]=function(_0x2c8c39,_0x5c2152){var _0x48b1c2={'raw':!![],'where':{'id':_0x2c8c39[_0x4ac8('0x44')]['id']}},_0x66c49a={};_0x66c49a[_0x4ac8('0x2d')]=_[_0x4ac8('0x45')](db[_0x4ac8('0x2a')][_0x4ac8('0x2b')]);_0x66c49a[_0x4ac8('0x2e')]=_[_0x4ac8('0x45')](_0x2c8c39['query']);_0x66c49a['filters']=_[_0x4ac8('0x30')](_0x66c49a[_0x4ac8('0x2d')],_0x66c49a[_0x4ac8('0x2e')]);_0x48b1c2[_0x4ac8('0x31')]=_[_0x4ac8('0x30')](_0x66c49a[_0x4ac8('0x2d')],qs[_0x4ac8('0x32')](_0x2c8c39['query'][_0x4ac8('0x32')]));_0x48b1c2[_0x4ac8('0x31')]=_0x48b1c2[_0x4ac8('0x31')][_0x4ac8('0x33')]?_0x48b1c2['attributes']:_0x66c49a['model'];if(_0x2c8c39[_0x4ac8('0x2e')][_0x4ac8('0x46')]){_0x48b1c2[_0x4ac8('0x3f')]=[{'all':!![]}];}_0x48b1c2=_['merge']({},_0x48b1c2,_0x2c8c39[_0x4ac8('0x3d')]);return db['MailSubstatus']['find'](_0x48b1c2)['then'](handleEntityNotFound(_0x5c2152,null))[_0x4ac8('0x24')](respondWithResult(_0x5c2152,null))[_0x4ac8('0x42')](handleError(_0x5c2152,null));};exports['create']=function(_0x372b0d,_0x20f048){return db['MailSubstatus'][_0x4ac8('0x47')](_0x372b0d['body'],{})[_0x4ac8('0x24')](respondWithResult(_0x20f048,0xc9))[_0x4ac8('0x42')](handleError(_0x20f048,null));};exports[_0x4ac8('0x23')]=function(_0x1bc535,_0x59ce53){if(_0x1bc535[_0x4ac8('0x48')]['id']){delete _0x1bc535[_0x4ac8('0x48')]['id'];}return db[_0x4ac8('0x2a')][_0x4ac8('0x49')]({'where':{'id':_0x1bc535[_0x4ac8('0x44')]['id']}})['then'](handleEntityNotFound(_0x59ce53,null))[_0x4ac8('0x24')](saveUpdates(_0x1bc535[_0x4ac8('0x48')],null))[_0x4ac8('0x24')](respondWithResult(_0x59ce53,null))['catch'](handleError(_0x59ce53,null));};exports['destroy']=function(_0xab43ed,_0xc557af){return db[_0x4ac8('0x2a')][_0x4ac8('0x49')]({'where':{'id':_0xab43ed[_0x4ac8('0x44')]['id']}})[_0x4ac8('0x24')](handleEntityNotFound(_0xc557af,null))['then'](removeEntity(_0xc557af,null))[_0x4ac8('0x42')](handleError(_0xc557af,null));};exports[_0x4ac8('0x4a')]=function(_0x4d79c4,_0x13a06e){return db[_0x4ac8('0x2a')][_0x4ac8('0x4a')]()[_0x4ac8('0x24')](respondWithResult(_0x13a06e,null))[_0x4ac8('0x42')](handleError(_0x13a06e,null));}; \ No newline at end of file +var _0x6a91=['end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','MailSubstatus','includeAll','include','findAll','rows','catch','show','rawAttributes','options','find','create','body','params','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x286726,_0x20a337){var _0xcd4fe9=function(_0x4d7da6){while(--_0x4d7da6){_0x286726['push'](_0x286726['shift']());}};_0xcd4fe9(++_0x20a337);}(_0x6a91,0x83));var _0x16a9=function(_0x570837,_0x5764a8){_0x570837=_0x570837-0x0;var _0x25cc0c=_0x6a91[_0x570837];return _0x25cc0c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x16a9('0x0'));var zipdir=require(_0x16a9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x16a9('0x2'));var moment=require(_0x16a9('0x3'));var BPromise=require(_0x16a9('0x4'));var Mustache=require(_0x16a9('0x5'));var util=require(_0x16a9('0x6'));var path=require(_0x16a9('0x7'));var sox=require(_0x16a9('0x8'));var csv=require(_0x16a9('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x16a9('0xa'));var _=require(_0x16a9('0xb'));var squel=require(_0x16a9('0xc'));var crypto=require(_0x16a9('0xd'));var jsforce=require(_0x16a9('0xe'));var deskjs=require(_0x16a9('0xf'));var toCsv=require('to-csv');var querystring=require(_0x16a9('0x10'));var Papa=require(_0x16a9('0x11'));var Redis=require(_0x16a9('0x12'));var authService=require(_0x16a9('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x16a9('0x14'));var hardwareService=require(_0x16a9('0x15'));var logger=require('../../config/logger')(_0x16a9('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x16a9('0x17'));var db=require(_0x16a9('0x18'))['db'];function respondWithStatusCode(_0x34aa75,_0x2616bb){_0x2616bb=_0x2616bb||0xcc;return function(_0x3e5615){if(_0x3e5615){return _0x34aa75[_0x16a9('0x19')](_0x2616bb);}return _0x34aa75[_0x16a9('0x1a')](_0x2616bb)[_0x16a9('0x1b')]();};}function respondWithResult(_0x445690,_0x4d5bc5){_0x4d5bc5=_0x4d5bc5||0xc8;return function(_0x28f0be){if(_0x28f0be){return _0x445690['status'](_0x4d5bc5)[_0x16a9('0x1c')](_0x28f0be);}};}function respondWithFilteredResult(_0x11978d,_0x540aa8){return function(_0x2b666e){if(_0x2b666e){var _0x31cf5a=typeof _0x540aa8[_0x16a9('0x1d')]===_0x16a9('0x1e')&&typeof _0x540aa8['limit']===_0x16a9('0x1e');var _0x1c4edd=_0x2b666e[_0x16a9('0x1f')];var _0xa69768=_0x31cf5a?0x0:_0x540aa8[_0x16a9('0x1d')];var _0x2a255a=_0x31cf5a?_0x2b666e[_0x16a9('0x1f')]:_0x540aa8[_0x16a9('0x1d')]+_0x540aa8[_0x16a9('0x20')];var _0x233777;if(_0x2a255a>=_0x1c4edd){_0x2a255a=_0x1c4edd;_0x233777=0xc8;}else{_0x233777=0xce;}_0x11978d['status'](_0x233777);return _0x11978d['set'](_0x16a9('0x21'),_0xa69768+'-'+_0x2a255a+'/'+_0x1c4edd)[_0x16a9('0x1c')](_0x2b666e);}return null;};}function patchUpdates(_0x4fa3df){return function(_0x53b818){try{jsonpatch[_0x16a9('0x22')](_0x53b818,_0x4fa3df,!![]);}catch(_0x15c34e){return BPromise[_0x16a9('0x23')](_0x15c34e);}return _0x53b818[_0x16a9('0x24')]();};}function saveUpdates(_0x4ca4fc,_0x308515){return function(_0x4ac422){if(_0x4ac422){return _0x4ac422[_0x16a9('0x25')](_0x4ca4fc)[_0x16a9('0x26')](function(_0x4b07d3){return _0x4b07d3;});}return null;};}function removeEntity(_0x1c2c93,_0x91f594){return function(_0x2ba96b){if(_0x2ba96b){return _0x2ba96b[_0x16a9('0x27')]()[_0x16a9('0x26')](function(){_0x1c2c93[_0x16a9('0x1a')](0xcc)[_0x16a9('0x1b')]();});}};}function handleEntityNotFound(_0x3b2c91,_0x10546a){return function(_0x2669de){if(!_0x2669de){_0x3b2c91['sendStatus'](0x194);}return _0x2669de;};}function handleError(_0x379ae6,_0x5e7fc2){_0x5e7fc2=_0x5e7fc2||0x1f4;return function(_0x1d16d7){logger[_0x16a9('0x28')](_0x1d16d7['stack']);if(_0x1d16d7[_0x16a9('0x29')]){delete _0x1d16d7['name'];}_0x379ae6[_0x16a9('0x1a')](_0x5e7fc2)[_0x16a9('0x2a')](_0x1d16d7);};}exports[_0x16a9('0x2b')]=function(_0xc5b817,_0x1e7f77){var _0x6df7e1={},_0x2cecab={},_0x54f1ed={'count':0x0,'rows':[]};var _0x4cbd1a=_[_0x16a9('0x2c')](db['MailSubstatus']['rawAttributes'],function(_0xb22898){return{'name':_0xb22898[_0x16a9('0x2d')],'type':_0xb22898[_0x16a9('0x2e')][_0x16a9('0x2f')]};});_0x2cecab[_0x16a9('0x30')]=_[_0x16a9('0x2c')](_0x4cbd1a,_0x16a9('0x29'));_0x2cecab[_0x16a9('0x31')]=_[_0x16a9('0x32')](_0xc5b817['query']);_0x2cecab[_0x16a9('0x33')]=_[_0x16a9('0x34')](_0x2cecab[_0x16a9('0x30')],_0x2cecab[_0x16a9('0x31')]);_0x6df7e1[_0x16a9('0x35')]=_[_0x16a9('0x34')](_0x2cecab[_0x16a9('0x30')],qs[_0x16a9('0x36')](_0xc5b817['query'][_0x16a9('0x36')]));_0x6df7e1['attributes']=_0x6df7e1[_0x16a9('0x35')][_0x16a9('0x37')]?_0x6df7e1['attributes']:_0x2cecab['model'];if(!_0xc5b817['query'][_0x16a9('0x38')](_0x16a9('0x39'))){_0x6df7e1[_0x16a9('0x20')]=qs['limit'](_0xc5b817[_0x16a9('0x31')][_0x16a9('0x20')]);_0x6df7e1[_0x16a9('0x1d')]=qs[_0x16a9('0x1d')](_0xc5b817[_0x16a9('0x31')][_0x16a9('0x1d')]);}_0x6df7e1[_0x16a9('0x3a')]=qs[_0x16a9('0x3b')](_0xc5b817[_0x16a9('0x31')][_0x16a9('0x3b')]);_0x6df7e1[_0x16a9('0x3c')]=qs['filters'](_[_0x16a9('0x3d')](_0xc5b817['query'],_0x2cecab['filters']),_0x4cbd1a);if(_0xc5b817[_0x16a9('0x31')][_0x16a9('0x3e')]){_0x6df7e1[_0x16a9('0x3c')]=_[_0x16a9('0x3f')](_0x6df7e1['where'],{'$or':_[_0x16a9('0x2c')](_0x4cbd1a,function(_0x4943c2){if(_0x4943c2['type']!==_0x16a9('0x40')){var _0x5e8d52={};_0x5e8d52[_0x4943c2[_0x16a9('0x29')]]={'$like':'%'+_0xc5b817['query'][_0x16a9('0x3e')]+'%'};return _0x5e8d52;}})});}_0x6df7e1=_[_0x16a9('0x3f')]({},_0x6df7e1,_0xc5b817['options']);var _0x575218={'where':_0x6df7e1[_0x16a9('0x3c')]};return db[_0x16a9('0x41')]['count'](_0x575218)[_0x16a9('0x26')](function(_0x4f188a){_0x54f1ed[_0x16a9('0x1f')]=_0x4f188a;if(_0xc5b817[_0x16a9('0x31')][_0x16a9('0x42')]){_0x6df7e1[_0x16a9('0x43')]=[{'all':!![]}];}return db[_0x16a9('0x41')][_0x16a9('0x44')](_0x6df7e1);})[_0x16a9('0x26')](function(_0x35f917){_0x54f1ed[_0x16a9('0x45')]=_0x35f917;return _0x54f1ed;})[_0x16a9('0x26')](respondWithFilteredResult(_0x1e7f77,_0x6df7e1))[_0x16a9('0x46')](handleError(_0x1e7f77,null));};exports[_0x16a9('0x47')]=function(_0x551a8f,_0x20a590){var _0x1174f2={'raw':!![],'where':{'id':_0x551a8f['params']['id']}},_0x2bfb47={};_0x2bfb47[_0x16a9('0x30')]=_[_0x16a9('0x32')](db[_0x16a9('0x41')][_0x16a9('0x48')]);_0x2bfb47[_0x16a9('0x31')]=_[_0x16a9('0x32')](_0x551a8f[_0x16a9('0x31')]);_0x2bfb47[_0x16a9('0x33')]=_['intersection'](_0x2bfb47[_0x16a9('0x30')],_0x2bfb47['query']);_0x1174f2['attributes']=_[_0x16a9('0x34')](_0x2bfb47[_0x16a9('0x30')],qs[_0x16a9('0x36')](_0x551a8f[_0x16a9('0x31')]['fields']));_0x1174f2[_0x16a9('0x35')]=_0x1174f2[_0x16a9('0x35')][_0x16a9('0x37')]?_0x1174f2['attributes']:_0x2bfb47[_0x16a9('0x30')];if(_0x551a8f[_0x16a9('0x31')][_0x16a9('0x42')]){_0x1174f2[_0x16a9('0x43')]=[{'all':!![]}];}_0x1174f2=_[_0x16a9('0x3f')]({},_0x1174f2,_0x551a8f[_0x16a9('0x49')]);return db['MailSubstatus'][_0x16a9('0x4a')](_0x1174f2)[_0x16a9('0x26')](handleEntityNotFound(_0x20a590,null))['then'](respondWithResult(_0x20a590,null))[_0x16a9('0x46')](handleError(_0x20a590,null));};exports[_0x16a9('0x4b')]=function(_0x4dacd2,_0x24b759){return db[_0x16a9('0x41')]['create'](_0x4dacd2[_0x16a9('0x4c')],{})[_0x16a9('0x26')](respondWithResult(_0x24b759,0xc9))[_0x16a9('0x46')](handleError(_0x24b759,null));};exports[_0x16a9('0x25')]=function(_0xa14c50,_0x4ee285){if(_0xa14c50[_0x16a9('0x4c')]['id']){delete _0xa14c50[_0x16a9('0x4c')]['id'];}return db[_0x16a9('0x41')]['find']({'where':{'id':_0xa14c50[_0x16a9('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4ee285,null))['then'](saveUpdates(_0xa14c50[_0x16a9('0x4c')],null))[_0x16a9('0x26')](respondWithResult(_0x4ee285,null))['catch'](handleError(_0x4ee285,null));};exports[_0x16a9('0x27')]=function(_0x1023af,_0x643eb5){return db[_0x16a9('0x41')][_0x16a9('0x4a')]({'where':{'id':_0x1023af[_0x16a9('0x4d')]['id']}})[_0x16a9('0x26')](handleEntityNotFound(_0x643eb5,null))[_0x16a9('0x26')](removeEntity(_0x643eb5,null))[_0x16a9('0x46')](handleError(_0x643eb5,null));};exports[_0x16a9('0x4e')]=function(_0x80f7e5,_0x5d2b08){return db[_0x16a9('0x41')]['describe']()[_0x16a9('0x26')](respondWithResult(_0x5d2b08,null))['catch'](handleError(_0x5d2b08,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 0c58ad2..4085438 100644 --- a/server/api/mailSubstatus/mailSubstatus.events.js +++ b/server/api/mailSubstatus/mailSubstatus.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8dfb=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x33a716,_0x27b0f6){var _0x495e9c=function(_0xe7ad89){while(--_0xe7ad89){_0x33a716['push'](_0x33a716['shift']());}};_0x495e9c(++_0x27b0f6);}(_0x8dfb,0xd5));var _0xb8df=function(_0x350343,_0x256f69){_0x350343=_0x350343-0x0;var _0x9afc1c=_0x8dfb[_0x350343];return _0x9afc1c;};'use strict';var EventEmitter=require(_0xb8df('0x0'));var MailSubstatus=require(_0xb8df('0x1'))['db']['MailSubstatus'];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xb8df('0x2')](0x0);var events={'afterUpdate':_0xb8df('0x3')};function emitEvent(_0x5847c2){return function(_0x508f08,_0x446d5b,_0x28371f){MailSubstatusEvents[_0xb8df('0x4')](_0x5847c2+':'+_0x508f08['id'],_0x508f08);MailSubstatusEvents['emit'](_0x5847c2,_0x508f08);_0x28371f(null);};}for(var e in events){if(events[_0xb8df('0x5')](e)){var event=events[e];MailSubstatus[_0xb8df('0x6')](e,emitEvent(event));}}module[_0xb8df('0x7')]=MailSubstatusEvents; \ No newline at end of file +var _0x2872=['hook','exports','events','../../mysqldb','MailSubstatus','update','hasOwnProperty'];(function(_0x4b0503,_0x2e7fb8){var _0x1d621f=function(_0x1e3d69){while(--_0x1e3d69){_0x4b0503['push'](_0x4b0503['shift']());}};_0x1d621f(++_0x2e7fb8);}(_0x2872,0xdb));var _0x2287=function(_0x1f22f7,_0x20576a){_0x1f22f7=_0x1f22f7-0x0;var _0x39b170=_0x2872[_0x1f22f7];return _0x39b170;};'use strict';var EventEmitter=require(_0x2287('0x0'));var MailSubstatus=require(_0x2287('0x1'))['db'][_0x2287('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':_0x2287('0x3')};function emitEvent(_0x135929){return function(_0x189707,_0x1531fc,_0x408469){MailSubstatusEvents['emit'](_0x135929+':'+_0x189707['id'],_0x189707);MailSubstatusEvents['emit'](_0x135929,_0x189707);_0x408469(null);};}for(var e in events){if(events[_0x2287('0x4')](e)){var event=events[e];MailSubstatus[_0x2287('0x5')](e,emitEvent(event));}}module[_0x2287('0x6')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index e30f209..4db2452 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 _0xfe0e=['mailSubstatus','catch','exports','define','MailSubstatus','mail_substatuses','name'];(function(_0x5a2ffc,_0x153480){var _0x46c17a=function(_0x25843c){while(--_0x25843c){_0x5a2ffc['push'](_0x5a2ffc['shift']());}};_0x46c17a(++_0x153480);}(_0xfe0e,0x1bb));var _0xefe0=function(_0x421196,_0x1cbd94){_0x421196=_0x421196-0x0;var _0x2738af=_0xfe0e[_0x421196];return _0x2738af;};'use strict';var attributes=require('./mailSubstatus.attributes');module[_0xefe0('0x0')]=function(_0x1ed074){var _0x5775d4=_0x1ed074['models'];return _0x1ed074[_0xefe0('0x1')](_0xefe0('0x2'),attributes,{'tableName':_0xefe0('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x24e9b4,_0x59bb9f,_0x466ddb){return _0x5775d4['Condition']['update']({'value':_0x24e9b4[_0xefe0('0x4')]},{'where':{'field':_0xefe0('0x5'),'value':_0x24e9b4['_previousDataValues'][_0xefe0('0x4')]}})['then'](function(){_0x466ddb();})[_0xefe0('0x6')](function(_0x21db99){_0x466ddb(_0x21db99);});}}});}; \ No newline at end of file +var _0xb475=['_previousDataValues','name','./mailSubstatus.attributes','models','MailSubstatus','mail_substatuses','Condition','update'];(function(_0x126ba2,_0x295ebf){var _0x8a9bff=function(_0x367093){while(--_0x367093){_0x126ba2['push'](_0x126ba2['shift']());}};_0x8a9bff(++_0x295ebf);}(_0xb475,0x1e2));var _0x5b47=function(_0x4ed1d4,_0x512d9a){_0x4ed1d4=_0x4ed1d4-0x0;var _0x28e363=_0xb475[_0x4ed1d4];return _0x28e363;};'use strict';var attributes=require(_0x5b47('0x0'));module['exports']=function(_0x2541e6){var _0x47c547=_0x2541e6[_0x5b47('0x1')];return _0x2541e6['define'](_0x5b47('0x2'),attributes,{'tableName':_0x5b47('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x23233b,_0x25a931,_0x2a3581){return _0x47c547[_0x5b47('0x4')][_0x5b47('0x5')]({'value':_0x23233b['name']},{'where':{'field':'mailSubstatus','value':_0x23233b[_0x5b47('0x6')][_0x5b47('0x7')]}})['then'](function(){_0x2a3581();})['catch'](function(_0x58c8e7){_0x2a3581(_0x58c8e7);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 70f956d..9bb1952 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 _0x1348=['error','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','MailSubstatus,\x20%s,\x20%s','debug','request\x20sent','stringify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1348,0x90));var _0x8134=function(_0x33d489,_0x295984){_0x33d489=_0x33d489-0x0;var _0x40d3f4=_0x1348[_0x33d489];return _0x40d3f4;};'use strict';var _=require('lodash');var util=require(_0x8134('0x0'));var moment=require('moment');var BPromise=require(_0x8134('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8134('0x2'));var db=require(_0x8134('0x3'))['db'];var utils=require(_0x8134('0x4'));var logger=require(_0x8134('0x5'))(_0x8134('0x6'));var config=require(_0x8134('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8134('0x8')][_0x8134('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x379384,_0x11d7be,_0x10bfdd){return new BPromise(function(_0x1c34af,_0x10611c){return client[_0x8134('0xa')](_0x379384,_0x10bfdd)['then'](function(_0x5a9c25){logger[_0x8134('0xb')](_0x8134('0xc'),_0x11d7be,'request\x20sent');logger[_0x8134('0xd')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x11d7be,_0x8134('0xe'),JSON[_0x8134('0xf')](_0x5a9c25));if(_0x5a9c25['error']){if(_0x5a9c25['error']['code']===0x1f4){logger[_0x8134('0x10')](_0x8134('0xc'),_0x11d7be,_0x5a9c25['error'][_0x8134('0x11')]);return _0x10611c(_0x5a9c25[_0x8134('0x10')][_0x8134('0x11')]);}logger[_0x8134('0x10')](_0x8134('0xc'),_0x11d7be,_0x5a9c25[_0x8134('0x10')][_0x8134('0x11')]);return _0x1c34af(_0x5a9c25[_0x8134('0x10')][_0x8134('0x11')]);}else{logger['info'](_0x8134('0xc'),_0x11d7be,_0x8134('0xe'));_0x1c34af(_0x5a9c25[_0x8134('0x12')]['message']);}})[_0x8134('0x13')](function(_0xda64ec){logger[_0x8134('0x10')]('MailSubstatus,\x20%s,\x20%s',_0x11d7be,_0xda64ec);_0x10611c(_0xda64ec);});});} \ No newline at end of file +var _0x46a0=['moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','MailSubstatus,\x20%s,\x20%s','result','lodash'];(function(_0x58afbb,_0x388ccb){var _0x354a04=function(_0x265ddb){while(--_0x265ddb){_0x58afbb['push'](_0x58afbb['shift']());}};_0x354a04(++_0x388ccb);}(_0x46a0,0xe3));var _0x046a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x46a0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x046a('0x0'));var util=require('util');var moment=require(_0x046a('0x1'));var BPromise=require('bluebird');var rs=require(_0x046a('0x2'));var fs=require('fs');var Redis=require(_0x046a('0x3'));var db=require(_0x046a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x046a('0x5'))(_0x046a('0x6'));var config=require(_0x046a('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x046a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x368dea,_0x6e3311,_0x1fd243){return new BPromise(function(_0x5a2b3d,_0x15f932){return client[_0x046a('0x9')](_0x368dea,_0x1fd243)[_0x046a('0xa')](function(_0x4db3a3){logger[_0x046a('0xb')]('MailSubstatus,\x20%s,\x20%s',_0x6e3311,'request\x20sent');logger['debug'](_0x046a('0xc'),_0x6e3311,_0x046a('0xd'),JSON[_0x046a('0xe')](_0x4db3a3));if(_0x4db3a3[_0x046a('0xf')]){if(_0x4db3a3[_0x046a('0xf')]['code']===0x1f4){logger[_0x046a('0xf')]('MailSubstatus,\x20%s,\x20%s',_0x6e3311,_0x4db3a3[_0x046a('0xf')][_0x046a('0x10')]);return _0x15f932(_0x4db3a3[_0x046a('0xf')]['message']);}logger[_0x046a('0xf')](_0x046a('0x11'),_0x6e3311,_0x4db3a3[_0x046a('0xf')]['message']);return _0x5a2b3d(_0x4db3a3[_0x046a('0xf')][_0x046a('0x10')]);}else{logger[_0x046a('0xb')](_0x046a('0x11'),_0x6e3311,_0x046a('0xd'));_0x5a2b3d(_0x4db3a3[_0x046a('0x12')][_0x046a('0x10')]);}})['catch'](function(_0x42a37b){logger[_0x046a('0xf')](_0x046a('0x11'),_0x6e3311,_0x42a37b);_0x15f932(_0x42a37b);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 17dbe7c..bdbcc09 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 _0x5f56=['connect-timeout','express','../../components/auth/service','../../config/environment','./mailTransferReport.controller','isAuthenticated','get','/describe','describe','/:id','show','post','update','delete','destroy','util','path'];(function(_0x235f49,_0x2992b4){var _0x551139=function(_0x35565c){while(--_0x35565c){_0x235f49['push'](_0x235f49['shift']());}};_0x551139(++_0x2992b4);}(_0x5f56,0x130));var _0x65f5=function(_0x5751e6,_0x125e5e){_0x5751e6=_0x5751e6-0x0;var _0x4199e4=_0x5f56[_0x5751e6];return _0x4199e4;};'use strict';var multer=require('multer');var util=require(_0x65f5('0x0'));var path=require(_0x65f5('0x1'));var timeout=require(_0x65f5('0x2'));var express=require(_0x65f5('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x65f5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x65f5('0x5'));var controller=require(_0x65f5('0x6'));router['get']('/',auth[_0x65f5('0x7')](),controller['index']);router[_0x65f5('0x8')](_0x65f5('0x9'),auth[_0x65f5('0x7')](),controller[_0x65f5('0xa')]);router[_0x65f5('0x8')](_0x65f5('0xb'),auth['isAuthenticated'](),controller[_0x65f5('0xc')]);router[_0x65f5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x65f5('0xb'),auth[_0x65f5('0x7')](),controller[_0x65f5('0xe')]);router[_0x65f5('0xf')]('/:id',auth[_0x65f5('0x7')](),controller[_0x65f5('0x10')]);module['exports']=router; \ No newline at end of file +var _0x2ca9=['index','/describe','describe','/:id','show','post','create','destroy','exports','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x5bd5fc,_0x57597){var _0x420110=function(_0x3d99d8){while(--_0x3d99d8){_0x5bd5fc['push'](_0x5bd5fc['shift']());}};_0x420110(++_0x57597);}(_0x2ca9,0xe6));var _0x92ca=function(_0x5e334a,_0x28d858){_0x5e334a=_0x5e334a-0x0;var _0x2e37e7=_0x2ca9[_0x5e334a];return _0x2e37e7;};'use strict';var multer=require('multer');var util=require(_0x92ca('0x0'));var path=require(_0x92ca('0x1'));var timeout=require(_0x92ca('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x92ca('0x3'));var interaction=require(_0x92ca('0x4'));var config=require(_0x92ca('0x5'));var controller=require('./mailTransferReport.controller');router[_0x92ca('0x6')]('/',auth[_0x92ca('0x7')](),controller[_0x92ca('0x8')]);router[_0x92ca('0x6')](_0x92ca('0x9'),auth[_0x92ca('0x7')](),controller[_0x92ca('0xa')]);router[_0x92ca('0x6')](_0x92ca('0xb'),auth[_0x92ca('0x7')](),controller[_0x92ca('0xc')]);router[_0x92ca('0xd')]('/',auth['isAuthenticated'](),controller[_0x92ca('0xe')]);router['put'](_0x92ca('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x92ca('0xb'),auth['isAuthenticated'](),controller[_0x92ca('0xf')]);module[_0x92ca('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 78865ea..7d4976e 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 _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x556049,_0x48730a){var _0x3ef00f=function(_0x4340e0){while(--_0x4340e0){_0x556049['push'](_0x556049['shift']());}};_0x3ef00f(++_0x48730a);}(_0x00bb,0x1d8));var _0xb00b=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x00bb[_0x2bf141];return _0x48277b;};'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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0xee50c8,_0x1d426e){var _0x279f00=function(_0x148604){while(--_0x148604){_0xee50c8['push'](_0xee50c8['shift']());}};_0x279f00(++_0x1d426e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index cec3eae..570bd6b 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 _0x13a7=['ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','map','fieldName','type','key','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','MailTransferReport','includeAll','include','findAll','rows','catch','params','keys','find','create','body','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','sox','to-csv'];(function(_0x5f016d,_0x1ae602){var _0xf49b80=function(_0x4a7263){while(--_0x4a7263){_0x5f016d['push'](_0x5f016d['shift']());}};_0xf49b80(++_0x1ae602);}(_0x13a7,0x88));var _0x713a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x13a7[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x713a('0x0'));var rimraf=require(_0x713a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x713a('0x2'));var rp=require('request-promise');var moment=require(_0x713a('0x3'));var BPromise=require(_0x713a('0x4'));var Mustache=require(_0x713a('0x5'));var util=require('util');var path=require('path');var sox=require(_0x713a('0x6'));var csv=require(_0x713a('0x7'));var ejs=require(_0x713a('0x8'));var fs=require('fs');var fs_extra=require(_0x713a('0x9'));var _=require(_0x713a('0xa'));var squel=require(_0x713a('0xb'));var crypto=require('crypto');var jsforce=require(_0x713a('0xc'));var deskjs=require(_0x713a('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x713a('0xe'));var authService=require(_0x713a('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x713a('0x10'));var hardwareService=require(_0x713a('0x11'));var logger=require(_0x713a('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x713a('0x13'));var licenseUtil=require(_0x713a('0x14'));var db=require(_0x713a('0x15'))['db'];function respondWithStatusCode(_0x3dd330,_0x9896ba){_0x9896ba=_0x9896ba||0xcc;return function(_0x1d47e3){if(_0x1d47e3){return _0x3dd330[_0x713a('0x16')](_0x9896ba);}return _0x3dd330[_0x713a('0x17')](_0x9896ba)['end']();};}function respondWithResult(_0x49b69b,_0x5b2ebb){_0x5b2ebb=_0x5b2ebb||0xc8;return function(_0x42eea0){if(_0x42eea0){return _0x49b69b['status'](_0x5b2ebb)[_0x713a('0x18')](_0x42eea0);}};}function respondWithFilteredResult(_0x3c1ece,_0x550c0e){return function(_0x546cd5){if(_0x546cd5){var _0x27c6df=typeof _0x550c0e[_0x713a('0x19')]==='undefined'&&typeof _0x550c0e[_0x713a('0x1a')]===_0x713a('0x1b');var _0x61b73e=_0x546cd5[_0x713a('0x1c')];var _0x286b6a=_0x27c6df?0x0:_0x550c0e['offset'];var _0x151da4=_0x27c6df?_0x546cd5[_0x713a('0x1c')]:_0x550c0e[_0x713a('0x19')]+_0x550c0e[_0x713a('0x1a')];var _0x4bd007;if(_0x151da4>=_0x61b73e){_0x151da4=_0x61b73e;_0x4bd007=0xc8;}else{_0x4bd007=0xce;}_0x3c1ece[_0x713a('0x17')](_0x4bd007);return _0x3c1ece[_0x713a('0x1d')](_0x713a('0x1e'),_0x286b6a+'-'+_0x151da4+'/'+_0x61b73e)[_0x713a('0x18')](_0x546cd5);}return null;};}function patchUpdates(_0x447690){return function(_0x205d75){try{jsonpatch[_0x713a('0x1f')](_0x205d75,_0x447690,!![]);}catch(_0x53ecc8){return BPromise[_0x713a('0x20')](_0x53ecc8);}return _0x205d75[_0x713a('0x21')]();};}function saveUpdates(_0x136347,_0xcd9832){return function(_0x4c3a49){if(_0x4c3a49){return _0x4c3a49[_0x713a('0x22')](_0x136347)[_0x713a('0x23')](function(_0x2b044a){return _0x2b044a;});}return null;};}function removeEntity(_0xabdaa3,_0x310667){return function(_0x15963c){if(_0x15963c){return _0x15963c[_0x713a('0x24')]()[_0x713a('0x23')](function(){_0xabdaa3[_0x713a('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a59d4,_0x3d480d){return function(_0x2fa818){if(!_0x2fa818){_0x3a59d4[_0x713a('0x16')](0x194);}return _0x2fa818;};}function handleError(_0x421cca,_0x38a54d){_0x38a54d=_0x38a54d||0x1f4;return function(_0x22039b){logger['error'](_0x22039b[_0x713a('0x25')]);if(_0x22039b[_0x713a('0x26')]){delete _0x22039b[_0x713a('0x26')];}_0x421cca[_0x713a('0x17')](_0x38a54d)[_0x713a('0x27')](_0x22039b);};}exports['index']=function(_0x70df64,_0x27d2bd){var _0x1c69df={},_0x39bd5a={},_0x32bf87={'count':0x0,'rows':[]};var _0x3848c9=_[_0x713a('0x28')](db['MailTransferReport']['rawAttributes'],function(_0x1606c0){return{'name':_0x1606c0[_0x713a('0x29')],'type':_0x1606c0[_0x713a('0x2a')][_0x713a('0x2b')]};});_0x39bd5a['model']=_['map'](_0x3848c9,_0x713a('0x26'));_0x39bd5a[_0x713a('0x2c')]=_['keys'](_0x70df64[_0x713a('0x2c')]);_0x39bd5a[_0x713a('0x2d')]=_['intersection'](_0x39bd5a[_0x713a('0x2e')],_0x39bd5a[_0x713a('0x2c')]);_0x1c69df['attributes']=_[_0x713a('0x2f')](_0x39bd5a[_0x713a('0x2e')],qs['fields'](_0x70df64[_0x713a('0x2c')][_0x713a('0x30')]));_0x1c69df[_0x713a('0x31')]=_0x1c69df[_0x713a('0x31')][_0x713a('0x32')]?_0x1c69df[_0x713a('0x31')]:_0x39bd5a[_0x713a('0x2e')];if(!_0x70df64['query'][_0x713a('0x33')](_0x713a('0x34'))){_0x1c69df[_0x713a('0x1a')]=qs['limit'](_0x70df64[_0x713a('0x2c')][_0x713a('0x1a')]);_0x1c69df[_0x713a('0x19')]=qs['offset'](_0x70df64[_0x713a('0x2c')][_0x713a('0x19')]);}_0x1c69df['order']=qs[_0x713a('0x35')](_0x70df64[_0x713a('0x2c')][_0x713a('0x35')]);_0x1c69df[_0x713a('0x36')]=qs[_0x713a('0x2d')](_[_0x713a('0x37')](_0x70df64[_0x713a('0x2c')],_0x39bd5a[_0x713a('0x2d')]),_0x3848c9);if(_0x70df64[_0x713a('0x2c')]['filter']){_0x1c69df[_0x713a('0x36')]=_[_0x713a('0x38')](_0x1c69df[_0x713a('0x36')],{'$or':_[_0x713a('0x28')](_0x3848c9,function(_0x46007d){if(_0x46007d[_0x713a('0x2a')]!==_0x713a('0x39')){var _0x5dd2bf={};_0x5dd2bf[_0x46007d[_0x713a('0x26')]]={'$like':'%'+_0x70df64['query'][_0x713a('0x3a')]+'%'};return _0x5dd2bf;}})});}_0x1c69df=_[_0x713a('0x38')]({},_0x1c69df,_0x70df64[_0x713a('0x3b')]);var _0x3126bf={'where':_0x1c69df[_0x713a('0x36')]};return db[_0x713a('0x3c')][_0x713a('0x1c')](_0x3126bf)['then'](function(_0x5e68d1){_0x32bf87[_0x713a('0x1c')]=_0x5e68d1;if(_0x70df64[_0x713a('0x2c')][_0x713a('0x3d')]){_0x1c69df[_0x713a('0x3e')]=[{'all':!![]}];}return db[_0x713a('0x3c')][_0x713a('0x3f')](_0x1c69df);})[_0x713a('0x23')](function(_0x32699d){_0x32bf87[_0x713a('0x40')]=_0x32699d;return _0x32bf87;})[_0x713a('0x23')](respondWithFilteredResult(_0x27d2bd,_0x1c69df))[_0x713a('0x41')](handleError(_0x27d2bd,null));};exports['show']=function(_0xac3a80,_0x11f85c){var _0x48a286={'raw':!![],'where':{'id':_0xac3a80[_0x713a('0x42')]['id']}},_0x294b3e={};_0x294b3e[_0x713a('0x2e')]=_['keys'](db[_0x713a('0x3c')]['rawAttributes']);_0x294b3e[_0x713a('0x2c')]=_[_0x713a('0x43')](_0xac3a80[_0x713a('0x2c')]);_0x294b3e[_0x713a('0x2d')]=_[_0x713a('0x2f')](_0x294b3e[_0x713a('0x2e')],_0x294b3e[_0x713a('0x2c')]);_0x48a286[_0x713a('0x31')]=_[_0x713a('0x2f')](_0x294b3e[_0x713a('0x2e')],qs[_0x713a('0x30')](_0xac3a80[_0x713a('0x2c')][_0x713a('0x30')]));_0x48a286[_0x713a('0x31')]=_0x48a286[_0x713a('0x31')][_0x713a('0x32')]?_0x48a286[_0x713a('0x31')]:_0x294b3e[_0x713a('0x2e')];if(_0xac3a80[_0x713a('0x2c')][_0x713a('0x3d')]){_0x48a286[_0x713a('0x3e')]=[{'all':!![]}];}_0x48a286=_['merge']({},_0x48a286,_0xac3a80[_0x713a('0x3b')]);return db[_0x713a('0x3c')][_0x713a('0x44')](_0x48a286)[_0x713a('0x23')](handleEntityNotFound(_0x11f85c,null))['then'](respondWithResult(_0x11f85c,null))[_0x713a('0x41')](handleError(_0x11f85c,null));};exports[_0x713a('0x45')]=function(_0x36518f,_0xf722a3){return db['MailTransferReport'][_0x713a('0x45')](_0x36518f[_0x713a('0x46')],{})[_0x713a('0x23')](respondWithResult(_0xf722a3,0xc9))[_0x713a('0x41')](handleError(_0xf722a3,null));};exports[_0x713a('0x22')]=function(_0x249094,_0x48cd27){if(_0x249094[_0x713a('0x46')]['id']){delete _0x249094[_0x713a('0x46')]['id'];}return db[_0x713a('0x3c')][_0x713a('0x44')]({'where':{'id':_0x249094[_0x713a('0x42')]['id']}})['then'](handleEntityNotFound(_0x48cd27,null))[_0x713a('0x23')](saveUpdates(_0x249094[_0x713a('0x46')],null))[_0x713a('0x23')](respondWithResult(_0x48cd27,null))[_0x713a('0x41')](handleError(_0x48cd27,null));};exports['destroy']=function(_0x382115,_0x3cfe91){return db[_0x713a('0x3c')][_0x713a('0x44')]({'where':{'id':_0x382115[_0x713a('0x42')]['id']}})[_0x713a('0x23')](handleEntityNotFound(_0x3cfe91,null))['then'](removeEntity(_0x3cfe91,null))[_0x713a('0x41')](handleError(_0x3cfe91,null));};exports[_0x713a('0x47')]=function(_0x207a88,_0x34c475){return db[_0x713a('0x3c')][_0x713a('0x47')]()['then'](respondWithResult(_0x34c475,null))[_0x713a('0x41')](handleError(_0x34c475,null));}; \ No newline at end of file +var _0xe5fb=['params','keys','include','find','create','update','body','describe','eml-format','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','then','destroy','end','stack','name','rawAttributes','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','MailTransferReport','includeAll','findAll','catch','show'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xe5fb,0xd7));var _0xbe5f=function(_0x60286b,_0x3247c1){_0x60286b=_0x60286b-0x0;var _0x5dff69=_0xe5fb[_0x60286b];return _0x5dff69;};'use strict';var emlformat=require(_0xbe5f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbe5f('0x1'));var BPromise=require(_0xbe5f('0x2'));var Mustache=require(_0xbe5f('0x3'));var util=require(_0xbe5f('0x4'));var path=require(_0xbe5f('0x5'));var sox=require('sox');var csv=require(_0xbe5f('0x6'));var ejs=require(_0xbe5f('0x7'));var fs=require('fs');var fs_extra=require(_0xbe5f('0x8'));var _=require(_0xbe5f('0x9'));var squel=require(_0xbe5f('0xa'));var crypto=require('crypto');var jsforce=require(_0xbe5f('0xb'));var deskjs=require(_0xbe5f('0xc'));var toCsv=require('to-csv');var querystring=require(_0xbe5f('0xd'));var Papa=require(_0xbe5f('0xe'));var Redis=require(_0xbe5f('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xbe5f('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe5f('0x11'));var logger=require('../../config/logger')(_0xbe5f('0x12'));var utils=require(_0xbe5f('0x13'));var config=require(_0xbe5f('0x14'));var licenseUtil=require(_0xbe5f('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4fa261,_0x1fd4e5){_0x1fd4e5=_0x1fd4e5||0xcc;return function(_0x454340){if(_0x454340){return _0x4fa261[_0xbe5f('0x16')](_0x1fd4e5);}return _0x4fa261[_0xbe5f('0x17')](_0x1fd4e5)['end']();};}function respondWithResult(_0x4a56a3,_0x1b7dd6){_0x1b7dd6=_0x1b7dd6||0xc8;return function(_0x7d546d){if(_0x7d546d){return _0x4a56a3['status'](_0x1b7dd6)['json'](_0x7d546d);}};}function respondWithFilteredResult(_0x22e379,_0x3f490a){return function(_0x4f5a05){if(_0x4f5a05){var _0x1cc6f5=typeof _0x3f490a['offset']===_0xbe5f('0x18')&&typeof _0x3f490a[_0xbe5f('0x19')]===_0xbe5f('0x18');var _0x4b4eaf=_0x4f5a05[_0xbe5f('0x1a')];var _0x2a089b=_0x1cc6f5?0x0:_0x3f490a['offset'];var _0x11e1b5=_0x1cc6f5?_0x4f5a05[_0xbe5f('0x1a')]:_0x3f490a[_0xbe5f('0x1b')]+_0x3f490a['limit'];var _0x1df3e4;if(_0x11e1b5>=_0x4b4eaf){_0x11e1b5=_0x4b4eaf;_0x1df3e4=0xc8;}else{_0x1df3e4=0xce;}_0x22e379[_0xbe5f('0x17')](_0x1df3e4);return _0x22e379[_0xbe5f('0x1c')](_0xbe5f('0x1d'),_0x2a089b+'-'+_0x11e1b5+'/'+_0x4b4eaf)[_0xbe5f('0x1e')](_0x4f5a05);}return null;};}function patchUpdates(_0x44852c){return function(_0x46dcf4){try{jsonpatch[_0xbe5f('0x1f')](_0x46dcf4,_0x44852c,!![]);}catch(_0x416104){return BPromise['reject'](_0x416104);}return _0x46dcf4['save']();};}function saveUpdates(_0x5ce72f,_0x5399ca){return function(_0x43fcc4){if(_0x43fcc4){return _0x43fcc4['update'](_0x5ce72f)[_0xbe5f('0x20')](function(_0x6db52f){return _0x6db52f;});}return null;};}function removeEntity(_0x4b8aad,_0x54b3e1){return function(_0x5841d5){if(_0x5841d5){return _0x5841d5[_0xbe5f('0x21')]()[_0xbe5f('0x20')](function(){_0x4b8aad[_0xbe5f('0x17')](0xcc)[_0xbe5f('0x22')]();});}};}function handleEntityNotFound(_0x8495f0,_0x361c3f){return function(_0x4c952b){if(!_0x4c952b){_0x8495f0[_0xbe5f('0x16')](0x194);}return _0x4c952b;};}function handleError(_0x142e15,_0x184d46){_0x184d46=_0x184d46||0x1f4;return function(_0x1d4bd7){logger['error'](_0x1d4bd7[_0xbe5f('0x23')]);if(_0x1d4bd7[_0xbe5f('0x24')]){delete _0x1d4bd7['name'];}_0x142e15['status'](_0x184d46)['send'](_0x1d4bd7);};}exports['index']=function(_0x2bd8b9,_0x4749e8){var _0x12bc5e={},_0x4bfd9c={},_0x43d220={'count':0x0,'rows':[]};var _0x374954=_['map'](db['MailTransferReport'][_0xbe5f('0x25')],function(_0x4f372c){return{'name':_0x4f372c['fieldName'],'type':_0x4f372c[_0xbe5f('0x26')][_0xbe5f('0x27')]};});_0x4bfd9c[_0xbe5f('0x28')]=_['map'](_0x374954,_0xbe5f('0x24'));_0x4bfd9c[_0xbe5f('0x29')]=_['keys'](_0x2bd8b9[_0xbe5f('0x29')]);_0x4bfd9c[_0xbe5f('0x2a')]=_[_0xbe5f('0x2b')](_0x4bfd9c['model'],_0x4bfd9c[_0xbe5f('0x29')]);_0x12bc5e['attributes']=_[_0xbe5f('0x2b')](_0x4bfd9c[_0xbe5f('0x28')],qs['fields'](_0x2bd8b9[_0xbe5f('0x29')]['fields']));_0x12bc5e[_0xbe5f('0x2c')]=_0x12bc5e[_0xbe5f('0x2c')][_0xbe5f('0x2d')]?_0x12bc5e[_0xbe5f('0x2c')]:_0x4bfd9c[_0xbe5f('0x28')];if(!_0x2bd8b9[_0xbe5f('0x29')][_0xbe5f('0x2e')](_0xbe5f('0x2f'))){_0x12bc5e[_0xbe5f('0x19')]=qs[_0xbe5f('0x19')](_0x2bd8b9[_0xbe5f('0x29')]['limit']);_0x12bc5e['offset']=qs[_0xbe5f('0x1b')](_0x2bd8b9[_0xbe5f('0x29')][_0xbe5f('0x1b')]);}_0x12bc5e[_0xbe5f('0x30')]=qs[_0xbe5f('0x31')](_0x2bd8b9[_0xbe5f('0x29')][_0xbe5f('0x31')]);_0x12bc5e[_0xbe5f('0x32')]=qs['filters'](_[_0xbe5f('0x33')](_0x2bd8b9[_0xbe5f('0x29')],_0x4bfd9c['filters']),_0x374954);if(_0x2bd8b9[_0xbe5f('0x29')]['filter']){_0x12bc5e[_0xbe5f('0x32')]=_['merge'](_0x12bc5e['where'],{'$or':_['map'](_0x374954,function(_0x57e46d){if(_0x57e46d[_0xbe5f('0x26')]!==_0xbe5f('0x34')){var _0x1efe2b={};_0x1efe2b[_0x57e46d['name']]={'$like':'%'+_0x2bd8b9[_0xbe5f('0x29')][_0xbe5f('0x35')]+'%'};return _0x1efe2b;}})});}_0x12bc5e=_[_0xbe5f('0x36')]({},_0x12bc5e,_0x2bd8b9[_0xbe5f('0x37')]);var _0x28c3b6={'where':_0x12bc5e[_0xbe5f('0x32')]};return db[_0xbe5f('0x38')][_0xbe5f('0x1a')](_0x28c3b6)['then'](function(_0x3e1b1f){_0x43d220[_0xbe5f('0x1a')]=_0x3e1b1f;if(_0x2bd8b9[_0xbe5f('0x29')][_0xbe5f('0x39')]){_0x12bc5e['include']=[{'all':!![]}];}return db[_0xbe5f('0x38')][_0xbe5f('0x3a')](_0x12bc5e);})[_0xbe5f('0x20')](function(_0x55421f){_0x43d220['rows']=_0x55421f;return _0x43d220;})[_0xbe5f('0x20')](respondWithFilteredResult(_0x4749e8,_0x12bc5e))[_0xbe5f('0x3b')](handleError(_0x4749e8,null));};exports[_0xbe5f('0x3c')]=function(_0x1f4d6b,_0x151818){var _0x2d452c={'raw':!![],'where':{'id':_0x1f4d6b[_0xbe5f('0x3d')]['id']}},_0x515833={};_0x515833[_0xbe5f('0x28')]=_['keys'](db[_0xbe5f('0x38')][_0xbe5f('0x25')]);_0x515833['query']=_[_0xbe5f('0x3e')](_0x1f4d6b[_0xbe5f('0x29')]);_0x515833[_0xbe5f('0x2a')]=_[_0xbe5f('0x2b')](_0x515833['model'],_0x515833[_0xbe5f('0x29')]);_0x2d452c['attributes']=_[_0xbe5f('0x2b')](_0x515833[_0xbe5f('0x28')],qs['fields'](_0x1f4d6b[_0xbe5f('0x29')]['fields']));_0x2d452c[_0xbe5f('0x2c')]=_0x2d452c[_0xbe5f('0x2c')][_0xbe5f('0x2d')]?_0x2d452c[_0xbe5f('0x2c')]:_0x515833['model'];if(_0x1f4d6b['query'][_0xbe5f('0x39')]){_0x2d452c[_0xbe5f('0x3f')]=[{'all':!![]}];}_0x2d452c=_[_0xbe5f('0x36')]({},_0x2d452c,_0x1f4d6b[_0xbe5f('0x37')]);return db['MailTransferReport'][_0xbe5f('0x40')](_0x2d452c)[_0xbe5f('0x20')](handleEntityNotFound(_0x151818,null))['then'](respondWithResult(_0x151818,null))[_0xbe5f('0x3b')](handleError(_0x151818,null));};exports['create']=function(_0x15e1bd,_0x18f64b){return db['MailTransferReport'][_0xbe5f('0x41')](_0x15e1bd['body'],{})[_0xbe5f('0x20')](respondWithResult(_0x18f64b,0xc9))[_0xbe5f('0x3b')](handleError(_0x18f64b,null));};exports[_0xbe5f('0x42')]=function(_0x452672,_0x24f79b){if(_0x452672[_0xbe5f('0x43')]['id']){delete _0x452672[_0xbe5f('0x43')]['id'];}return db['MailTransferReport'][_0xbe5f('0x40')]({'where':{'id':_0x452672[_0xbe5f('0x3d')]['id']}})['then'](handleEntityNotFound(_0x24f79b,null))[_0xbe5f('0x20')](saveUpdates(_0x452672[_0xbe5f('0x43')],null))['then'](respondWithResult(_0x24f79b,null))[_0xbe5f('0x3b')](handleError(_0x24f79b,null));};exports[_0xbe5f('0x21')]=function(_0x464dff,_0x4a4c9b){return db[_0xbe5f('0x38')]['find']({'where':{'id':_0x464dff['params']['id']}})[_0xbe5f('0x20')](handleEntityNotFound(_0x4a4c9b,null))['then'](removeEntity(_0x4a4c9b,null))['catch'](handleError(_0x4a4c9b,null));};exports[_0xbe5f('0x44')]=function(_0x593e9a,_0x5d45c7){return db[_0xbe5f('0x38')][_0xbe5f('0x44')]()[_0xbe5f('0x20')](respondWithResult(_0x5d45c7,null))[_0xbe5f('0x3b')](handleError(_0x5d45c7,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 33723a0..07fc4c9 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 _0x1f10=['moment','path','../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','api'];(function(_0xa6cc5c,_0x239c99){var _0x44803d=function(_0x515b6e){while(--_0x515b6e){_0xa6cc5c['push'](_0xa6cc5c['shift']());}};_0x44803d(++_0x239c99);}(_0x1f10,0x69));var _0x01f1=function(_0x40f57e,_0x295246){_0x40f57e=_0x40f57e-0x0;var _0x5a6d71=_0x1f10[_0x40f57e];return _0x5a6d71;};'use strict';var _=require(_0x01f1('0x0'));var util=require(_0x01f1('0x1'));var logger=require('../../config/logger')(_0x01f1('0x2'));var moment=require(_0x01f1('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x01f1('0x4'));var rimraf=require('rimraf');var config=require(_0x01f1('0x5'));var attributes=require(_0x01f1('0x6'));module[_0x01f1('0x7')]=function(_0x497ee1,_0x1800dd){return _0x497ee1[_0x01f1('0x8')](_0x01f1('0x9'),attributes,{'tableName':_0x01f1('0xa'),'paranoid':![],'indexes':[{'name':_0x01f1('0xb'),'fields':[_0x01f1('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb2ef=['util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash'];(function(_0x2fbc48,_0x2b9ff4){var _0x5db015=function(_0x9d3124){while(--_0x9d3124){_0x2fbc48['push'](_0x2fbc48['shift']());}};_0x5db015(++_0x2b9ff4);}(_0xb2ef,0xa7));var _0xfb2e=function(_0xb419b0,_0x2c7a74){_0xb419b0=_0xb419b0-0x0;var _0x4eb455=_0xb2ef[_0xb419b0];return _0x4eb455;};'use strict';var _=require(_0xfb2e('0x0'));var util=require(_0xfb2e('0x1'));var logger=require(_0xfb2e('0x2'))('api');var moment=require(_0xfb2e('0x3'));var BPromise=require(_0xfb2e('0x4'));var rp=require(_0xfb2e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfb2e('0x6'));var config=require(_0xfb2e('0x7'));var attributes=require(_0xfb2e('0x8'));module[_0xfb2e('0x9')]=function(_0x3069a,_0x2a1c23){return _0x3069a[_0xfb2e('0xa')](_0xfb2e('0xb'),attributes,{'tableName':_0xfb2e('0xc'),'paranoid':![],'indexes':[{'name':_0xfb2e('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index f80bacc..1c0a079 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 _0x3c48=['rpc','../../config/environment','jayson/promise','client','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','../../config/logger'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x3c48,0x88));var _0x83c4=function(_0x30ae31,_0x39c932){_0x30ae31=_0x30ae31-0x0;var _0x1a7143=_0x3c48[_0x30ae31];return _0x1a7143;};'use strict';var _=require(_0x83c4('0x0'));var util=require('util');var moment=require(_0x83c4('0x1'));var BPromise=require(_0x83c4('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(_0x83c4('0x3'))(_0x83c4('0x4'));var config=require(_0x83c4('0x5'));var jayson=require(_0x83c4('0x6'));var client=jayson[_0x83c4('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5bccd9,_0x3265bd,_0x56142d){return new BPromise(function(_0x474cec,_0x4ed05e){return client[_0x83c4('0x8')](_0x5bccd9,_0x56142d)[_0x83c4('0x9')](function(_0x183b29){logger[_0x83c4('0xa')](_0x83c4('0xb'),_0x3265bd,_0x83c4('0xc'));logger[_0x83c4('0xd')](_0x83c4('0xe'),_0x3265bd,_0x83c4('0xc'),JSON[_0x83c4('0xf')](_0x183b29));if(_0x183b29['error']){if(_0x183b29[_0x83c4('0x10')][_0x83c4('0x11')]===0x1f4){logger[_0x83c4('0x10')](_0x83c4('0xb'),_0x3265bd,_0x183b29['error'][_0x83c4('0x12')]);return _0x4ed05e(_0x183b29[_0x83c4('0x10')][_0x83c4('0x12')]);}logger['error'](_0x83c4('0xb'),_0x3265bd,_0x183b29[_0x83c4('0x10')][_0x83c4('0x12')]);return _0x474cec(_0x183b29[_0x83c4('0x10')]['message']);}else{logger['info'](_0x83c4('0xb'),_0x3265bd,'request\x20sent');_0x474cec(_0x183b29[_0x83c4('0x13')][_0x83c4('0x12')]);}})['catch'](function(_0x5009b8){logger[_0x83c4('0x10')](_0x83c4('0xb'),_0x3265bd,_0x5009b8);_0x4ed05e(_0x5009b8);});});} \ No newline at end of file +var _0xe07b=['code','error','message','result','catch','lodash','util','moment','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x436fb2,_0x5cba16){var _0x3cb885=function(_0x1ba810){while(--_0x1ba810){_0x436fb2['push'](_0x436fb2['shift']());}};_0x3cb885(++_0x5cba16);}(_0xe07b,0x1c7));var _0xbe07=function(_0x23c97e,_0x53e757){_0x23c97e=_0x23c97e-0x0;var _0x13db38=_0xe07b[_0x23c97e];return _0x13db38;};'use strict';var _=require(_0xbe07('0x0'));var util=require(_0xbe07('0x1'));var moment=require(_0xbe07('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbe07('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xbe07('0x4'))(_0xbe07('0x5'));var config=require('../../config/environment');var jayson=require(_0xbe07('0x6'));var client=jayson[_0xbe07('0x7')][_0xbe07('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xb837ad,_0x815f12,_0x5c4ba2){return new BPromise(function(_0x144830,_0x1cbb26){return client['request'](_0xb837ad,_0x5c4ba2)['then'](function(_0x3b256e){logger[_0xbe07('0x9')](_0xbe07('0xa'),_0x815f12,_0xbe07('0xb'));logger['debug']('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x815f12,_0xbe07('0xb'),JSON[_0xbe07('0xc')](_0x3b256e));if(_0x3b256e['error']){if(_0x3b256e['error'][_0xbe07('0xd')]===0x1f4){logger[_0xbe07('0xe')](_0xbe07('0xa'),_0x815f12,_0x3b256e[_0xbe07('0xe')][_0xbe07('0xf')]);return _0x1cbb26(_0x3b256e[_0xbe07('0xe')]['message']);}logger[_0xbe07('0xe')](_0xbe07('0xa'),_0x815f12,_0x3b256e[_0xbe07('0xe')][_0xbe07('0xf')]);return _0x144830(_0x3b256e['error'][_0xbe07('0xf')]);}else{logger['info'](_0xbe07('0xa'),_0x815f12,_0xbe07('0xb'));_0x144830(_0x3b256e[_0xbe07('0x10')][_0xbe07('0xf')]);}})[_0xbe07('0x11')](function(_0x2d03af){logger[_0xbe07('0xe')](_0xbe07('0xa'),_0x815f12,_0x2d03af);_0x1cbb26(_0x2d03af);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 2ea0d61..5a38f15 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 _0x2453=['destroy','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','isAuthenticated','get','/describe','describe','/:id','show','post','create','put','delete'];(function(_0x1d4cac,_0x2145a5){var _0x26ecdb=function(_0x3b32b3){while(--_0x3b32b3){_0x1d4cac['push'](_0x1d4cac['shift']());}};_0x26ecdb(++_0x2145a5);}(_0x2453,0x106));var _0x3245=function(_0x4884c4,_0x59eee4){_0x4884c4=_0x4884c4-0x0;var _0x1fef29=_0x2453[_0x4884c4];return _0x1fef29;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3245('0x0'));var timeout=require('connect-timeout');var express=require(_0x3245('0x1'));var router=express[_0x3245('0x2')]();var fs_extra=require(_0x3245('0x3'));var auth=require(_0x3245('0x4'));var interaction=require(_0x3245('0x5'));var config=require(_0x3245('0x6'));var controller=require(_0x3245('0x7'));router['get']('/',auth[_0x3245('0x8')](),controller['index']);router[_0x3245('0x9')](_0x3245('0xa'),auth[_0x3245('0x8')](),controller[_0x3245('0xb')]);router['get'](_0x3245('0xc'),auth['isAuthenticated'](),controller[_0x3245('0xd')]);router[_0x3245('0xe')]('/',auth[_0x3245('0x8')](),controller[_0x3245('0xf')]);router[_0x3245('0x10')](_0x3245('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x3245('0x11')](_0x3245('0xc'),auth[_0x3245('0x8')](),controller[_0x3245('0x12')]);module[_0x3245('0x13')]=router; \ No newline at end of file +var _0x83d2=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./memberReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util'];(function(_0x1b6599,_0x2620e6){var _0x2d3616=function(_0x4f1ea6){while(--_0x4f1ea6){_0x1b6599['push'](_0x1b6599['shift']());}};_0x2d3616(++_0x2620e6);}(_0x83d2,0x157));var _0x283d=function(_0x28ab58,_0x6263ba){_0x28ab58=_0x28ab58-0x0;var _0x414e41=_0x83d2[_0x28ab58];return _0x414e41;};'use strict';var multer=require(_0x283d('0x0'));var util=require(_0x283d('0x1'));var path=require(_0x283d('0x2'));var timeout=require(_0x283d('0x3'));var express=require(_0x283d('0x4'));var router=express[_0x283d('0x5')]();var fs_extra=require(_0x283d('0x6'));var auth=require(_0x283d('0x7'));var interaction=require(_0x283d('0x8'));var config=require('../../config/environment');var controller=require(_0x283d('0x9'));router[_0x283d('0xa')]('/',auth[_0x283d('0xb')](),controller[_0x283d('0xc')]);router[_0x283d('0xa')](_0x283d('0xd'),auth[_0x283d('0xb')](),controller[_0x283d('0xe')]);router[_0x283d('0xa')](_0x283d('0xf'),auth[_0x283d('0xb')](),controller[_0x283d('0x10')]);router[_0x283d('0x11')]('/',auth[_0x283d('0xb')](),controller[_0x283d('0x12')]);router[_0x283d('0x13')](_0x283d('0xf'),auth[_0x283d('0xb')](),controller['update']);router[_0x283d('0x14')](_0x283d('0xf'),auth[_0x283d('0xb')](),controller[_0x283d('0x15')]);module[_0x283d('0x16')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index cd3b412..1e57716 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 _0xffc3=['enterAt','seconds','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','moment','exports','STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue'];(function(_0x1d5cfa,_0x57efb0){var _0x19a273=function(_0x2fe3f5){while(--_0x2fe3f5){_0x1d5cfa['push'](_0x1d5cfa['shift']());}};_0x19a273(++_0x57efb0);}(_0xffc3,0x129));var _0x3ffc=function(_0x4b09d4,_0x2b0562){_0x4b09d4=_0x4b09d4-0x0;var _0x5d8c46=_0xffc3[_0x4b09d4];return _0x5d8c46;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x3ffc('0x0'));module[_0x3ffc('0x1')]={'channel':{'type':Sequelize[_0x3ffc('0x2')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x3ffc('0x2')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x3ffc('0x3')},'duration':{'type':Sequelize[_0x3ffc('0x4')]},'enterAt':{'type':Sequelize[_0x3ffc('0x5')]},'exitAt':{'type':Sequelize[_0x3ffc('0x5')],'set':function(_0x1b0be8){var _0x5c6e7a=moment(_0x1b0be8);var _0x22c898=moment(this[_0x3ffc('0x6')](_0x3ffc('0x7')));var _0x35adc6=_0x5c6e7a['diff'](_0x22c898,_0x3ffc('0x8'));this[_0x3ffc('0x9')]('exitAt',_0x1b0be8);this['setDataValue'](_0x3ffc('0xa'),_0x35adc6>=0x0?_0x35adc6:null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x3ffc('0xb')},'data2':{'type':Sequelize[_0x3ffc('0x2')],'comment':_0x3ffc('0xc')},'data3':{'type':Sequelize[_0x3ffc('0x2')],'comment':_0x3ffc('0xd')},'data4':{'type':Sequelize[_0x3ffc('0x2')],'comment':_0x3ffc('0xe')},'data5':{'type':Sequelize[_0x3ffc('0x2')],'comment':_0x3ffc('0xf')},'role':{'type':Sequelize[_0x3ffc('0x2')]},'internal':{'type':Sequelize[_0x3ffc('0x4')]},'uniqueid':{'type':Sequelize[_0x3ffc('0x2')]}}; \ No newline at end of file +var _0x4266=['moment','STRING','DEFAULT\x20PAUSE','INTEGER','DATE','getDataValue','enterAt','diff','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[dial\x20string]','talk:[queue]'];(function(_0x20ec57,_0x2c51b6){var _0x2859f3=function(_0x5173c1){while(--_0x5173c1){_0x20ec57['push'](_0x20ec57['shift']());}};_0x2859f3(++_0x2c51b6);}(_0x4266,0x13b));var _0x6426=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x4266[_0x40ac5e];return _0x2839d6;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x6426('0x0'));module['exports']={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x6426('0x1')]},'interface':{'type':Sequelize[_0x6426('0x1')]},'type':{'type':Sequelize[_0x6426('0x1')],'defaultValue':_0x6426('0x2'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0x6426('0x3')]},'enterAt':{'type':Sequelize[_0x6426('0x4')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x3f08a4){var _0x364a2c=moment(_0x3f08a4);var _0x4f462d=moment(this[_0x6426('0x5')](_0x6426('0x6')));var _0x540af3=_0x364a2c[_0x6426('0x7')](_0x4f462d,'seconds');this[_0x6426('0x8')](_0x6426('0x9'),_0x3f08a4);this[_0x6426('0x8')](_0x6426('0xa'),_0x540af3>=0x0?_0x540af3:null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x6426('0xb')},'data2':{'type':Sequelize[_0x6426('0x1')],'comment':_0x6426('0xc')},'data3':{'type':Sequelize[_0x6426('0x1')],'comment':'talk:[destination]'},'data4':{'type':Sequelize['STRING'],'comment':_0x6426('0xd')},'data5':{'type':Sequelize[_0x6426('0x1')],'comment':_0x6426('0xe')},'role':{'type':Sequelize[_0x6426('0x1')]},'internal':{'type':Sequelize[_0x6426('0x3')]},'uniqueid':{'type':Sequelize[_0x6426('0x1')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 96ce078..42420ed 100644 --- a/server/api/memberReport/memberReport.controller.js +++ b/server/api/memberReport/memberReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','map','MemberReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','catch','show','params','keys','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x3826ad,_0x49a30d){var _0x17b900=function(_0x38474f){while(--_0x38474f){_0x3826ad['push'](_0x3826ad['shift']());}};_0x17b900(++_0x49a30d);}(_0x34e8,0x12c));var _0x834e=function(_0x5bb606,_0x2a0a15){_0x5bb606=_0x5bb606-0x0;var _0x4fef6f=_0x34e8[_0x5bb606];return _0x4fef6f;};'use strict';var emlformat=require(_0x834e('0x0'));var rimraf=require(_0x834e('0x1'));var zipdir=require(_0x834e('0x2'));var jsonpatch=require(_0x834e('0x3'));var rp=require('request-promise');var moment=require(_0x834e('0x4'));var BPromise=require(_0x834e('0x5'));var Mustache=require(_0x834e('0x6'));var util=require(_0x834e('0x7'));var path=require(_0x834e('0x8'));var sox=require(_0x834e('0x9'));var csv=require(_0x834e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x834e('0xb'));var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0xa'));var querystring=require(_0x834e('0x10'));var Papa=require(_0x834e('0x11'));var Redis=require(_0x834e('0x12'));var authService=require(_0x834e('0x13'));var qs=require(_0x834e('0x14'));var as=require(_0x834e('0x15'));var hardwareService=require(_0x834e('0x16'));var logger=require(_0x834e('0x17'))(_0x834e('0x18'));var utils=require(_0x834e('0x19'));var config=require(_0x834e('0x1a'));var licenseUtil=require(_0x834e('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e5b6d,_0x6cd9b9){_0x6cd9b9=_0x6cd9b9||0xcc;return function(_0x58a27e){if(_0x58a27e){return _0x5e5b6d[_0x834e('0x1c')](_0x6cd9b9);}return _0x5e5b6d[_0x834e('0x1d')](_0x6cd9b9)[_0x834e('0x1e')]();};}function respondWithResult(_0x21cc0a,_0x50e860){_0x50e860=_0x50e860||0xc8;return function(_0x43156c){if(_0x43156c){return _0x21cc0a[_0x834e('0x1d')](_0x50e860)['json'](_0x43156c);}};}function respondWithFilteredResult(_0x316205,_0x4a9cdc){return function(_0x38a8cd){if(_0x38a8cd){var _0x36d443=typeof _0x4a9cdc['offset']===_0x834e('0x1f')&&typeof _0x4a9cdc[_0x834e('0x20')]===_0x834e('0x1f');var _0x50b3f6=_0x38a8cd[_0x834e('0x21')];var _0x211e9a=_0x36d443?0x0:_0x4a9cdc[_0x834e('0x22')];var _0xb993a1=_0x36d443?_0x38a8cd[_0x834e('0x21')]:_0x4a9cdc[_0x834e('0x22')]+_0x4a9cdc[_0x834e('0x20')];var _0x595515;if(_0xb993a1>=_0x50b3f6){_0xb993a1=_0x50b3f6;_0x595515=0xc8;}else{_0x595515=0xce;}_0x316205[_0x834e('0x1d')](_0x595515);return _0x316205[_0x834e('0x23')](_0x834e('0x24'),_0x211e9a+'-'+_0xb993a1+'/'+_0x50b3f6)[_0x834e('0x25')](_0x38a8cd);}return null;};}function patchUpdates(_0x4ab05d){return function(_0x45a630){try{jsonpatch[_0x834e('0x26')](_0x45a630,_0x4ab05d,!![]);}catch(_0x5a05c0){return BPromise[_0x834e('0x27')](_0x5a05c0);}return _0x45a630[_0x834e('0x28')]();};}function saveUpdates(_0x8d406e,_0x5c55ca){return function(_0x4e3f48){if(_0x4e3f48){return _0x4e3f48[_0x834e('0x29')](_0x8d406e)[_0x834e('0x2a')](function(_0x589dde){return _0x589dde;});}return null;};}function removeEntity(_0x25ee1d,_0x1dc1e0){return function(_0x58f4fd){if(_0x58f4fd){return _0x58f4fd[_0x834e('0x2b')]()[_0x834e('0x2a')](function(){_0x25ee1d[_0x834e('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24fcf7,_0x3e310f){return function(_0x5e1cc5){if(!_0x5e1cc5){_0x24fcf7['sendStatus'](0x194);}return _0x5e1cc5;};}function handleError(_0x1e713a,_0x508a1d){_0x508a1d=_0x508a1d||0x1f4;return function(_0x2826ec){logger[_0x834e('0x2c')](_0x2826ec[_0x834e('0x2d')]);if(_0x2826ec[_0x834e('0x2e')]){delete _0x2826ec[_0x834e('0x2e')];}_0x1e713a[_0x834e('0x1d')](_0x508a1d)['send'](_0x2826ec);};}exports['index']=function(_0x4dc64a,_0x58c1d7){var _0x2c7a8d={},_0x567cea={},_0x106d6a={'count':0x0,'rows':[]};var _0x5dacc1=_[_0x834e('0x2f')](db[_0x834e('0x30')][_0x834e('0x31')],function(_0x1e026a){return{'name':_0x1e026a[_0x834e('0x32')],'type':_0x1e026a[_0x834e('0x33')][_0x834e('0x34')]};});_0x567cea[_0x834e('0x35')]=_[_0x834e('0x2f')](_0x5dacc1,'name');_0x567cea[_0x834e('0x36')]=_['keys'](_0x4dc64a[_0x834e('0x36')]);_0x567cea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],_0x567cea[_0x834e('0x36')]);_0x2c7a8d[_0x834e('0x39')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x4dc64a[_0x834e('0x36')]['fields']));_0x2c7a8d[_0x834e('0x39')]=_0x2c7a8d[_0x834e('0x39')][_0x834e('0x3b')]?_0x2c7a8d[_0x834e('0x39')]:_0x567cea['model'];if(!_0x4dc64a[_0x834e('0x36')][_0x834e('0x3c')]('nolimit')){_0x2c7a8d['limit']=qs['limit'](_0x4dc64a[_0x834e('0x36')][_0x834e('0x20')]);_0x2c7a8d[_0x834e('0x22')]=qs[_0x834e('0x22')](_0x4dc64a[_0x834e('0x36')][_0x834e('0x22')]);}_0x2c7a8d['order']=qs[_0x834e('0x3d')](_0x4dc64a['query'][_0x834e('0x3d')]);_0x2c7a8d[_0x834e('0x3e')]=qs['filters'](_[_0x834e('0x3f')](_0x4dc64a[_0x834e('0x36')],_0x567cea['filters']),_0x5dacc1);if(_0x4dc64a['query'][_0x834e('0x40')]){_0x2c7a8d[_0x834e('0x3e')]=_[_0x834e('0x41')](_0x2c7a8d[_0x834e('0x3e')],{'$or':_[_0x834e('0x2f')](_0x5dacc1,function(_0x4ca43c){if(_0x4ca43c[_0x834e('0x33')]!=='VIRTUAL'){var _0x50c243={};_0x50c243[_0x4ca43c[_0x834e('0x2e')]]={'$like':'%'+_0x4dc64a['query'][_0x834e('0x40')]+'%'};return _0x50c243;}})});}_0x2c7a8d=_[_0x834e('0x41')]({},_0x2c7a8d,_0x4dc64a[_0x834e('0x42')]);var _0x3c59af={'where':_0x2c7a8d[_0x834e('0x3e')]};return db['MemberReport'][_0x834e('0x21')](_0x3c59af)[_0x834e('0x2a')](function(_0x38f266){_0x106d6a['count']=_0x38f266;if(_0x4dc64a[_0x834e('0x36')][_0x834e('0x43')]){_0x2c7a8d['include']=[{'all':!![]}];}return db[_0x834e('0x30')]['findAll'](_0x2c7a8d);})[_0x834e('0x2a')](function(_0x585335){_0x106d6a['rows']=_0x585335;return _0x106d6a;})['then'](respondWithFilteredResult(_0x58c1d7,_0x2c7a8d))[_0x834e('0x44')](handleError(_0x58c1d7,null));};exports[_0x834e('0x45')]=function(_0x3bcbf4,_0xbc1571){var _0x8ad264={'raw':!![],'where':{'id':_0x3bcbf4[_0x834e('0x46')]['id']}},_0x23feea={};_0x23feea['model']=_[_0x834e('0x47')](db['MemberReport'][_0x834e('0x31')]);_0x23feea['query']=_[_0x834e('0x47')](_0x3bcbf4['query']);_0x23feea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x23feea['model'],_0x23feea[_0x834e('0x36')]);_0x8ad264[_0x834e('0x39')]=_[_0x834e('0x38')](_0x23feea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x3bcbf4[_0x834e('0x36')][_0x834e('0x3a')]));_0x8ad264[_0x834e('0x39')]=_0x8ad264[_0x834e('0x39')][_0x834e('0x3b')]?_0x8ad264['attributes']:_0x23feea[_0x834e('0x35')];if(_0x3bcbf4[_0x834e('0x36')]['includeAll']){_0x8ad264[_0x834e('0x48')]=[{'all':!![]}];}_0x8ad264=_[_0x834e('0x41')]({},_0x8ad264,_0x3bcbf4[_0x834e('0x42')]);return db[_0x834e('0x30')][_0x834e('0x49')](_0x8ad264)[_0x834e('0x2a')](handleEntityNotFound(_0xbc1571,null))['then'](respondWithResult(_0xbc1571,null))['catch'](handleError(_0xbc1571,null));};exports[_0x834e('0x4a')]=function(_0x1a5444,_0x30568e){return db[_0x834e('0x30')][_0x834e('0x4a')](_0x1a5444[_0x834e('0x4b')],{})[_0x834e('0x2a')](respondWithResult(_0x30568e,0xc9))[_0x834e('0x44')](handleError(_0x30568e,null));};exports[_0x834e('0x29')]=function(_0x390c45,_0xf02f0d){if(_0x390c45[_0x834e('0x4b')]['id']){delete _0x390c45[_0x834e('0x4b')]['id'];}return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x390c45[_0x834e('0x46')]['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0xf02f0d,null))[_0x834e('0x2a')](saveUpdates(_0x390c45[_0x834e('0x4b')],null))[_0x834e('0x2a')](respondWithResult(_0xf02f0d,null))['catch'](handleError(_0xf02f0d,null));};exports[_0x834e('0x2b')]=function(_0x1f08b9,_0x4e73e0){return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x1f08b9['params']['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0x4e73e0,null))[_0x834e('0x2a')](removeEntity(_0x4e73e0,null))[_0x834e('0x44')](handleError(_0x4e73e0,null));};exports[_0x834e('0x4c')]=function(_0x4288e4,_0xb77aab){return db[_0x834e('0x30')]['describe']()[_0x834e('0x2a')](respondWithResult(_0xb77aab,null))[_0x834e('0x44')](handleError(_0xb77aab,null));}; \ No newline at end of file +var _0x34e8=['path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','map','MemberReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','catch','show','params','keys','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x339129,_0x86dcc6){var _0x1570df=function(_0x3b537e){while(--_0x3b537e){_0x339129['push'](_0x339129['shift']());}};_0x1570df(++_0x86dcc6);}(_0x34e8,0x12c));var _0x834e=function(_0x329bb9,_0x267c83){_0x329bb9=_0x329bb9-0x0;var _0x204bdc=_0x34e8[_0x329bb9];return _0x204bdc;};'use strict';var emlformat=require(_0x834e('0x0'));var rimraf=require(_0x834e('0x1'));var zipdir=require(_0x834e('0x2'));var jsonpatch=require(_0x834e('0x3'));var rp=require('request-promise');var moment=require(_0x834e('0x4'));var BPromise=require(_0x834e('0x5'));var Mustache=require(_0x834e('0x6'));var util=require(_0x834e('0x7'));var path=require(_0x834e('0x8'));var sox=require(_0x834e('0x9'));var csv=require(_0x834e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x834e('0xb'));var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0xa'));var querystring=require(_0x834e('0x10'));var Papa=require(_0x834e('0x11'));var Redis=require(_0x834e('0x12'));var authService=require(_0x834e('0x13'));var qs=require(_0x834e('0x14'));var as=require(_0x834e('0x15'));var hardwareService=require(_0x834e('0x16'));var logger=require(_0x834e('0x17'))(_0x834e('0x18'));var utils=require(_0x834e('0x19'));var config=require(_0x834e('0x1a'));var licenseUtil=require(_0x834e('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e5b6d,_0x6cd9b9){_0x6cd9b9=_0x6cd9b9||0xcc;return function(_0x58a27e){if(_0x58a27e){return _0x5e5b6d[_0x834e('0x1c')](_0x6cd9b9);}return _0x5e5b6d[_0x834e('0x1d')](_0x6cd9b9)[_0x834e('0x1e')]();};}function respondWithResult(_0x21cc0a,_0x50e860){_0x50e860=_0x50e860||0xc8;return function(_0x43156c){if(_0x43156c){return _0x21cc0a[_0x834e('0x1d')](_0x50e860)['json'](_0x43156c);}};}function respondWithFilteredResult(_0x316205,_0x4a9cdc){return function(_0x38a8cd){if(_0x38a8cd){var _0x36d443=typeof _0x4a9cdc['offset']===_0x834e('0x1f')&&typeof _0x4a9cdc[_0x834e('0x20')]===_0x834e('0x1f');var _0x50b3f6=_0x38a8cd[_0x834e('0x21')];var _0x211e9a=_0x36d443?0x0:_0x4a9cdc[_0x834e('0x22')];var _0xb993a1=_0x36d443?_0x38a8cd[_0x834e('0x21')]:_0x4a9cdc[_0x834e('0x22')]+_0x4a9cdc[_0x834e('0x20')];var _0x595515;if(_0xb993a1>=_0x50b3f6){_0xb993a1=_0x50b3f6;_0x595515=0xc8;}else{_0x595515=0xce;}_0x316205[_0x834e('0x1d')](_0x595515);return _0x316205[_0x834e('0x23')](_0x834e('0x24'),_0x211e9a+'-'+_0xb993a1+'/'+_0x50b3f6)[_0x834e('0x25')](_0x38a8cd);}return null;};}function patchUpdates(_0x4ab05d){return function(_0x45a630){try{jsonpatch[_0x834e('0x26')](_0x45a630,_0x4ab05d,!![]);}catch(_0x5a05c0){return BPromise[_0x834e('0x27')](_0x5a05c0);}return _0x45a630[_0x834e('0x28')]();};}function saveUpdates(_0x8d406e,_0x5c55ca){return function(_0x4e3f48){if(_0x4e3f48){return _0x4e3f48[_0x834e('0x29')](_0x8d406e)[_0x834e('0x2a')](function(_0x589dde){return _0x589dde;});}return null;};}function removeEntity(_0x25ee1d,_0x1dc1e0){return function(_0x58f4fd){if(_0x58f4fd){return _0x58f4fd[_0x834e('0x2b')]()[_0x834e('0x2a')](function(){_0x25ee1d[_0x834e('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24fcf7,_0x3e310f){return function(_0x5e1cc5){if(!_0x5e1cc5){_0x24fcf7['sendStatus'](0x194);}return _0x5e1cc5;};}function handleError(_0x1e713a,_0x508a1d){_0x508a1d=_0x508a1d||0x1f4;return function(_0x2826ec){logger[_0x834e('0x2c')](_0x2826ec[_0x834e('0x2d')]);if(_0x2826ec[_0x834e('0x2e')]){delete _0x2826ec[_0x834e('0x2e')];}_0x1e713a[_0x834e('0x1d')](_0x508a1d)['send'](_0x2826ec);};}exports['index']=function(_0x4dc64a,_0x58c1d7){var _0x2c7a8d={},_0x567cea={},_0x106d6a={'count':0x0,'rows':[]};var _0x5dacc1=_[_0x834e('0x2f')](db[_0x834e('0x30')][_0x834e('0x31')],function(_0x1e026a){return{'name':_0x1e026a[_0x834e('0x32')],'type':_0x1e026a[_0x834e('0x33')][_0x834e('0x34')]};});_0x567cea[_0x834e('0x35')]=_[_0x834e('0x2f')](_0x5dacc1,'name');_0x567cea[_0x834e('0x36')]=_['keys'](_0x4dc64a[_0x834e('0x36')]);_0x567cea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],_0x567cea[_0x834e('0x36')]);_0x2c7a8d[_0x834e('0x39')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x4dc64a[_0x834e('0x36')]['fields']));_0x2c7a8d[_0x834e('0x39')]=_0x2c7a8d[_0x834e('0x39')][_0x834e('0x3b')]?_0x2c7a8d[_0x834e('0x39')]:_0x567cea['model'];if(!_0x4dc64a[_0x834e('0x36')][_0x834e('0x3c')]('nolimit')){_0x2c7a8d['limit']=qs['limit'](_0x4dc64a[_0x834e('0x36')][_0x834e('0x20')]);_0x2c7a8d[_0x834e('0x22')]=qs[_0x834e('0x22')](_0x4dc64a[_0x834e('0x36')][_0x834e('0x22')]);}_0x2c7a8d['order']=qs[_0x834e('0x3d')](_0x4dc64a['query'][_0x834e('0x3d')]);_0x2c7a8d[_0x834e('0x3e')]=qs['filters'](_[_0x834e('0x3f')](_0x4dc64a[_0x834e('0x36')],_0x567cea['filters']),_0x5dacc1);if(_0x4dc64a['query'][_0x834e('0x40')]){_0x2c7a8d[_0x834e('0x3e')]=_[_0x834e('0x41')](_0x2c7a8d[_0x834e('0x3e')],{'$or':_[_0x834e('0x2f')](_0x5dacc1,function(_0x4ca43c){if(_0x4ca43c[_0x834e('0x33')]!=='VIRTUAL'){var _0x50c243={};_0x50c243[_0x4ca43c[_0x834e('0x2e')]]={'$like':'%'+_0x4dc64a['query'][_0x834e('0x40')]+'%'};return _0x50c243;}})});}_0x2c7a8d=_[_0x834e('0x41')]({},_0x2c7a8d,_0x4dc64a[_0x834e('0x42')]);var _0x3c59af={'where':_0x2c7a8d[_0x834e('0x3e')]};return db['MemberReport'][_0x834e('0x21')](_0x3c59af)[_0x834e('0x2a')](function(_0x38f266){_0x106d6a['count']=_0x38f266;if(_0x4dc64a[_0x834e('0x36')][_0x834e('0x43')]){_0x2c7a8d['include']=[{'all':!![]}];}return db[_0x834e('0x30')]['findAll'](_0x2c7a8d);})[_0x834e('0x2a')](function(_0x585335){_0x106d6a['rows']=_0x585335;return _0x106d6a;})['then'](respondWithFilteredResult(_0x58c1d7,_0x2c7a8d))[_0x834e('0x44')](handleError(_0x58c1d7,null));};exports[_0x834e('0x45')]=function(_0x3bcbf4,_0xbc1571){var _0x8ad264={'raw':!![],'where':{'id':_0x3bcbf4[_0x834e('0x46')]['id']}},_0x23feea={};_0x23feea['model']=_[_0x834e('0x47')](db['MemberReport'][_0x834e('0x31')]);_0x23feea['query']=_[_0x834e('0x47')](_0x3bcbf4['query']);_0x23feea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x23feea['model'],_0x23feea[_0x834e('0x36')]);_0x8ad264[_0x834e('0x39')]=_[_0x834e('0x38')](_0x23feea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x3bcbf4[_0x834e('0x36')][_0x834e('0x3a')]));_0x8ad264[_0x834e('0x39')]=_0x8ad264[_0x834e('0x39')][_0x834e('0x3b')]?_0x8ad264['attributes']:_0x23feea[_0x834e('0x35')];if(_0x3bcbf4[_0x834e('0x36')]['includeAll']){_0x8ad264[_0x834e('0x48')]=[{'all':!![]}];}_0x8ad264=_[_0x834e('0x41')]({},_0x8ad264,_0x3bcbf4[_0x834e('0x42')]);return db[_0x834e('0x30')][_0x834e('0x49')](_0x8ad264)[_0x834e('0x2a')](handleEntityNotFound(_0xbc1571,null))['then'](respondWithResult(_0xbc1571,null))['catch'](handleError(_0xbc1571,null));};exports[_0x834e('0x4a')]=function(_0x1a5444,_0x30568e){return db[_0x834e('0x30')][_0x834e('0x4a')](_0x1a5444[_0x834e('0x4b')],{})[_0x834e('0x2a')](respondWithResult(_0x30568e,0xc9))[_0x834e('0x44')](handleError(_0x30568e,null));};exports[_0x834e('0x29')]=function(_0x390c45,_0xf02f0d){if(_0x390c45[_0x834e('0x4b')]['id']){delete _0x390c45[_0x834e('0x4b')]['id'];}return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x390c45[_0x834e('0x46')]['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0xf02f0d,null))[_0x834e('0x2a')](saveUpdates(_0x390c45[_0x834e('0x4b')],null))[_0x834e('0x2a')](respondWithResult(_0xf02f0d,null))['catch'](handleError(_0xf02f0d,null));};exports[_0x834e('0x2b')]=function(_0x1f08b9,_0x4e73e0){return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x1f08b9['params']['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0x4e73e0,null))[_0x834e('0x2a')](removeEntity(_0x4e73e0,null))[_0x834e('0x44')](handleError(_0x4e73e0,null));};exports[_0x834e('0x4c')]=function(_0x4288e4,_0xb77aab){return db[_0x834e('0x30')]['describe']()[_0x834e('0x2a')](respondWithResult(_0xb77aab,null))[_0x834e('0x44')](handleError(_0xb77aab,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 7442353..6866e0c 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 _0x088e=['../../config/environment','./memberReport.attributes','MemberReport','report_member','membername_interface','membername','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x5e0e90,_0x1c8363){var _0x33cfe3=function(_0x44f842){while(--_0x44f842){_0x5e0e90['push'](_0x5e0e90['shift']());}};_0x33cfe3(++_0x1c8363);}(_0x088e,0x172));var _0xe088=function(_0xbf8603,_0x2fee0d){_0xbf8603=_0xbf8603-0x0;var _0x490b8e=_0x088e[_0xbf8603];return _0x490b8e;};'use strict';var _=require(_0xe088('0x0'));var util=require(_0xe088('0x1'));var logger=require(_0xe088('0x2'))('api');var moment=require(_0xe088('0x3'));var BPromise=require(_0xe088('0x4'));var rp=require(_0xe088('0x5'));var fs=require('fs');var path=require(_0xe088('0x6'));var rimraf=require(_0xe088('0x7'));var config=require(_0xe088('0x8'));var attributes=require(_0xe088('0x9'));module['exports']=function(_0x3f9466,_0x393901){return _0x3f9466['define'](_0xe088('0xa'),attributes,{'tableName':_0xe088('0xb'),'paranoid':![],'indexes':[{'name':_0xe088('0xc'),'fields':[_0xe088('0xd'),'interface']}],'timestamps':!![]});}; \ No newline at end of file +var _0xf22c=['path','rimraf','../../config/environment','./memberReport.attributes','define','MemberReport','report_member','membername_interface','membername','interface','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x901043,_0x560885){var _0x4d1889=function(_0xf8396b){while(--_0xf8396b){_0x901043['push'](_0x901043['shift']());}};_0x4d1889(++_0x560885);}(_0xf22c,0x19f));var _0xcf22=function(_0x6f9a83,_0x254ed6){_0x6f9a83=_0x6f9a83-0x0;var _0x2f8c29=_0xf22c[_0x6f9a83];return _0x2f8c29;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xcf22('0x0'))(_0xcf22('0x1'));var moment=require(_0xcf22('0x2'));var BPromise=require(_0xcf22('0x3'));var rp=require(_0xcf22('0x4'));var fs=require('fs');var path=require(_0xcf22('0x5'));var rimraf=require(_0xcf22('0x6'));var config=require(_0xcf22('0x7'));var attributes=require(_0xcf22('0x8'));module['exports']=function(_0x62d436,_0x48a28b){return _0x62d436[_0xcf22('0x9')](_0xcf22('0xa'),attributes,{'tableName':_0xcf22('0xb'),'paranoid':![],'indexes':[{'name':_0xcf22('0xc'),'fields':[_0xcf22('0xd'),_0xcf22('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 7bf5566..753321e 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 _0x8375=['raw','attributes','limit','include','map','model','then','body','CreateMemberReport','update','where','UpdateMemberReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','GetMemberReport','MemberReport','findAll','options'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8375,0xa8));var _0x5837=function(_0x5b20f6,_0x49d1df){_0x5b20f6=_0x5b20f6-0x0;var _0x49d1c0=_0x8375[_0x5b20f6];return _0x49d1c0;};'use strict';var _=require(_0x5837('0x0'));var util=require(_0x5837('0x1'));var moment=require(_0x5837('0x2'));var BPromise=require('bluebird');var rs=require(_0x5837('0x3'));var fs=require('fs');var Redis=require(_0x5837('0x4'));var db=require(_0x5837('0x5'))['db'];var utils=require(_0x5837('0x6'));var logger=require(_0x5837('0x7'))(_0x5837('0x8'));var config=require('../../config/environment');var jayson=require(_0x5837('0x9'));var client=jayson[_0x5837('0xa')][_0x5837('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e383c,_0x3b11c3,_0x5bc421){return new BPromise(function(_0x508caf,_0x1e44c4){return client[_0x5837('0xc')](_0x2e383c,_0x5bc421)['then'](function(_0x24ca00){logger['info'](_0x5837('0xd'),_0x3b11c3,_0x5837('0xe'));logger[_0x5837('0xf')](_0x5837('0x10'),_0x3b11c3,_0x5837('0xe'),JSON[_0x5837('0x11')](_0x24ca00));if(_0x24ca00['error']){if(_0x24ca00[_0x5837('0x12')][_0x5837('0x13')]===0x1f4){logger[_0x5837('0x12')](_0x5837('0xd'),_0x3b11c3,_0x24ca00[_0x5837('0x12')]['message']);return _0x1e44c4(_0x24ca00['error']['message']);}logger[_0x5837('0x12')](_0x5837('0xd'),_0x3b11c3,_0x24ca00[_0x5837('0x12')][_0x5837('0x14')]);return _0x508caf(_0x24ca00[_0x5837('0x12')][_0x5837('0x14')]);}else{logger[_0x5837('0x15')](_0x5837('0xd'),_0x3b11c3,_0x5837('0xe'));_0x508caf(_0x24ca00['result'][_0x5837('0x14')]);}})[_0x5837('0x16')](function(_0x57342d){logger[_0x5837('0x12')](_0x5837('0xd'),_0x3b11c3,_0x57342d);_0x1e44c4(_0x57342d);});});}exports[_0x5837('0x17')]=function(_0x49279d){var _0x4eaeb9=this;return new Promise(function(_0x4bee08,_0x38d0c9){return db[_0x5837('0x18')][_0x5837('0x19')]({'raw':_0x49279d['options']?_0x49279d[_0x5837('0x1a')][_0x5837('0x1b')]===undefined?!![]:![]:!![],'where':_0x49279d[_0x5837('0x1a')]?_0x49279d[_0x5837('0x1a')]['where']||null:null,'attributes':_0x49279d['options']?_0x49279d['options'][_0x5837('0x1c')]||null:null,'limit':_0x49279d['options']?_0x49279d[_0x5837('0x1a')][_0x5837('0x1d')]||null:null,'include':_0x49279d[_0x5837('0x1a')]?_0x49279d[_0x5837('0x1a')]['include']?_['map'](_0x49279d[_0x5837('0x1a')][_0x5837('0x1e')],function(_0x406506){return{'model':db[_0x406506['model']],'as':_0x406506['as'],'attributes':_0x406506[_0x5837('0x1c')],'include':_0x406506[_0x5837('0x1e')]?_[_0x5837('0x1f')](_0x406506['include'],function(_0x41f86a){return{'model':db[_0x41f86a[_0x5837('0x20')]],'as':_0x41f86a['as'],'attributes':_0x41f86a[_0x5837('0x1c')],'include':_0x41f86a['include']?_['map'](_0x41f86a[_0x5837('0x1e')],function(_0x15655e){return{'model':db[_0x15655e[_0x5837('0x20')]],'as':_0x15655e['as'],'attributes':_0x15655e[_0x5837('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x5837('0x21')](function(_0x3adb74){logger[_0x5837('0x15')](_0x5837('0x17'),_0x49279d);logger['debug'](_0x5837('0x17'),_0x49279d,JSON[_0x5837('0x11')](_0x3adb74));_0x4bee08(_0x3adb74);})[_0x5837('0x16')](function(_0x3918ee){logger[_0x5837('0x12')](_0x5837('0x17'),_0x3918ee[_0x5837('0x14')],_0x49279d);_0x38d0c9(_0x4eaeb9[_0x5837('0x12')](0x1f4,_0x3918ee['message']));});});};exports['CreateMemberReport']=function(_0xeaaabb){var _0x2496ab=this;return new Promise(function(_0x5ab246,_0x298ea1){return db[_0x5837('0x18')]['create'](_0xeaaabb[_0x5837('0x22')],{'raw':_0xeaaabb[_0x5837('0x1a')]?_0xeaaabb[_0x5837('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x55a9d7){logger[_0x5837('0x15')](_0x5837('0x23'),_0xeaaabb);logger[_0x5837('0xf')](_0x5837('0x23'),_0xeaaabb,JSON[_0x5837('0x11')](_0x55a9d7));_0x5ab246(_0x55a9d7);})['catch'](function(_0x4bf885){logger[_0x5837('0x12')](_0x5837('0x23'),_0x4bf885['message'],_0xeaaabb);_0x298ea1(_0x2496ab['error'](0x1f4,_0x4bf885[_0x5837('0x14')]));});});};exports['UpdateMemberReport']=function(_0x5dcd99){var _0x1f2830=this;return new Promise(function(_0x330acc,_0x50dd31){return db[_0x5837('0x18')][_0x5837('0x24')](_0x5dcd99[_0x5837('0x22')],{'raw':_0x5dcd99['options']?_0x5dcd99[_0x5837('0x1a')][_0x5837('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5dcd99[_0x5837('0x1a')]?_0x5dcd99[_0x5837('0x1a')][_0x5837('0x25')]||null:null,'attributes':_0x5dcd99['options']?_0x5dcd99[_0x5837('0x1a')]['attributes']||null:null,'limit':_0x5dcd99['options']?_0x5dcd99[_0x5837('0x1a')][_0x5837('0x1d')]||null:null})['then'](function(_0x3d00e9){logger[_0x5837('0x15')](_0x5837('0x26'),_0x5dcd99);logger[_0x5837('0xf')]('UpdateMemberReport',_0x5dcd99,JSON[_0x5837('0x11')](_0x3d00e9));_0x330acc(_0x3d00e9);})[_0x5837('0x16')](function(_0x457394){logger['error'](_0x5837('0x26'),_0x457394[_0x5837('0x14')],_0x5dcd99);_0x50dd31(_0x1f2830[_0x5837('0x12')](0x1f4,_0x457394[_0x5837('0x14')]));});});}; \ No newline at end of file +var _0x9b69=['GetMemberReport','findAll','options','raw','where','attributes','limit','include','map','model','CreateMemberReport','MemberReport','create','body','UpdateMemberReport','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x28c89b,_0x2510b3){var _0x176500=function(_0x3dfee2){while(--_0x3dfee2){_0x28c89b['push'](_0x28c89b['shift']());}};_0x176500(++_0x2510b3);}(_0x9b69,0xa3));var _0x99b6=function(_0x55abeb,_0x194aa7){_0x55abeb=_0x55abeb-0x0;var _0x2162e1=_0x9b69[_0x55abeb];return _0x2162e1;};'use strict';var _=require(_0x99b6('0x0'));var util=require(_0x99b6('0x1'));var moment=require(_0x99b6('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x99b6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x99b6('0x4'));var logger=require(_0x99b6('0x5'))(_0x99b6('0x6'));var config=require('../../config/environment');var jayson=require(_0x99b6('0x7'));var client=jayson['client'][_0x99b6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x319215,_0x3d96ae,_0x18647f){return new BPromise(function(_0x29155e,_0x1d188d){return client[_0x99b6('0x9')](_0x319215,_0x18647f)[_0x99b6('0xa')](function(_0x1e8826){logger[_0x99b6('0xb')](_0x99b6('0xc'),_0x3d96ae,_0x99b6('0xd'));logger[_0x99b6('0xe')](_0x99b6('0xf'),_0x3d96ae,_0x99b6('0xd'),JSON[_0x99b6('0x10')](_0x1e8826));if(_0x1e8826[_0x99b6('0x11')]){if(_0x1e8826[_0x99b6('0x11')][_0x99b6('0x12')]===0x1f4){logger[_0x99b6('0x11')]('MemberReport,\x20%s,\x20%s',_0x3d96ae,_0x1e8826['error']['message']);return _0x1d188d(_0x1e8826['error']['message']);}logger['error']('MemberReport,\x20%s,\x20%s',_0x3d96ae,_0x1e8826[_0x99b6('0x11')][_0x99b6('0x13')]);return _0x29155e(_0x1e8826[_0x99b6('0x11')]['message']);}else{logger[_0x99b6('0xb')](_0x99b6('0xc'),_0x3d96ae,_0x99b6('0xd'));_0x29155e(_0x1e8826[_0x99b6('0x14')]['message']);}})[_0x99b6('0x15')](function(_0x52a4da){logger[_0x99b6('0x11')](_0x99b6('0xc'),_0x3d96ae,_0x52a4da);_0x1d188d(_0x52a4da);});});}exports[_0x99b6('0x16')]=function(_0x3fd5ad){var _0x1a6436=this;return new Promise(function(_0x4cb2e7,_0x2873c8){return db['MemberReport'][_0x99b6('0x17')]({'raw':_0x3fd5ad[_0x99b6('0x18')]?_0x3fd5ad[_0x99b6('0x18')][_0x99b6('0x19')]===undefined?!![]:![]:!![],'where':_0x3fd5ad[_0x99b6('0x18')]?_0x3fd5ad[_0x99b6('0x18')][_0x99b6('0x1a')]||null:null,'attributes':_0x3fd5ad['options']?_0x3fd5ad['options'][_0x99b6('0x1b')]||null:null,'limit':_0x3fd5ad[_0x99b6('0x18')]?_0x3fd5ad[_0x99b6('0x18')][_0x99b6('0x1c')]||null:null,'include':_0x3fd5ad['options']?_0x3fd5ad[_0x99b6('0x18')][_0x99b6('0x1d')]?_[_0x99b6('0x1e')](_0x3fd5ad[_0x99b6('0x18')][_0x99b6('0x1d')],function(_0x22db3f){return{'model':db[_0x22db3f[_0x99b6('0x1f')]],'as':_0x22db3f['as'],'attributes':_0x22db3f[_0x99b6('0x1b')],'include':_0x22db3f[_0x99b6('0x1d')]?_[_0x99b6('0x1e')](_0x22db3f[_0x99b6('0x1d')],function(_0x2d92a6){return{'model':db[_0x2d92a6[_0x99b6('0x1f')]],'as':_0x2d92a6['as'],'attributes':_0x2d92a6['attributes'],'include':_0x2d92a6[_0x99b6('0x1d')]?_['map'](_0x2d92a6[_0x99b6('0x1d')],function(_0x486a7f){return{'model':db[_0x486a7f[_0x99b6('0x1f')]],'as':_0x486a7f['as'],'attributes':_0x486a7f[_0x99b6('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5dcf7f){logger[_0x99b6('0xb')](_0x99b6('0x16'),_0x3fd5ad);logger[_0x99b6('0xe')]('GetMemberReport',_0x3fd5ad,JSON['stringify'](_0x5dcf7f));_0x4cb2e7(_0x5dcf7f);})['catch'](function(_0x55e859){logger[_0x99b6('0x11')](_0x99b6('0x16'),_0x55e859['message'],_0x3fd5ad);_0x2873c8(_0x1a6436[_0x99b6('0x11')](0x1f4,_0x55e859[_0x99b6('0x13')]));});});};exports[_0x99b6('0x20')]=function(_0x311351){var _0x200caf=this;return new Promise(function(_0x4be34f,_0x197565){return db[_0x99b6('0x21')][_0x99b6('0x22')](_0x311351[_0x99b6('0x23')],{'raw':_0x311351[_0x99b6('0x18')]?_0x311351['options'][_0x99b6('0x19')]===undefined?!![]:![]:!![]})[_0x99b6('0xa')](function(_0x210ba7){logger[_0x99b6('0xb')](_0x99b6('0x20'),_0x311351);logger[_0x99b6('0xe')](_0x99b6('0x20'),_0x311351,JSON[_0x99b6('0x10')](_0x210ba7));_0x4be34f(_0x210ba7);})['catch'](function(_0x21552d){logger[_0x99b6('0x11')](_0x99b6('0x20'),_0x21552d[_0x99b6('0x13')],_0x311351);_0x197565(_0x200caf[_0x99b6('0x11')](0x1f4,_0x21552d[_0x99b6('0x13')]));});});};exports[_0x99b6('0x24')]=function(_0xd54d55){var _0x33c47a=this;return new Promise(function(_0x489fee,_0x27c82e){return db[_0x99b6('0x21')]['update'](_0xd54d55[_0x99b6('0x23')],{'raw':_0xd54d55['options']?_0xd54d55[_0x99b6('0x18')][_0x99b6('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd54d55[_0x99b6('0x18')]?_0xd54d55[_0x99b6('0x18')]['where']||null:null,'attributes':_0xd54d55[_0x99b6('0x18')]?_0xd54d55['options'][_0x99b6('0x1b')]||null:null,'limit':_0xd54d55[_0x99b6('0x18')]?_0xd54d55[_0x99b6('0x18')][_0x99b6('0x1c')]||null:null})[_0x99b6('0xa')](function(_0x383f1b){logger[_0x99b6('0xb')](_0x99b6('0x24'),_0xd54d55);logger[_0x99b6('0xe')](_0x99b6('0x24'),_0xd54d55,JSON[_0x99b6('0x10')](_0x383f1b));_0x489fee(_0x383f1b);})[_0x99b6('0x15')](function(_0x5db557){logger['error'](_0x99b6('0x24'),_0x5db557[_0x99b6('0x13')],_0xd54d55);_0x27c82e(_0x33c47a[_0x99b6('0x11')](0x1f4,_0x5db557[_0x99b6('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 1ec262f..d8cd1ab 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 _0x4a93=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','exports','multer','util','Router'];(function(_0xebfc9f,_0x56cd2a){var _0x793cea=function(_0x3f4d2b){while(--_0x3f4d2b){_0xebfc9f['push'](_0xebfc9f['shift']());}};_0x793cea(++_0x56cd2a);}(_0x4a93,0x1bf));var _0x34a9=function(_0x1b6c6d,_0x2983b0){_0x1b6c6d=_0x1b6c6d-0x0;var _0x290d9d=_0x4a93[_0x1b6c6d];return _0x290d9d;};'use strict';var multer=require(_0x34a9('0x0'));var util=require(_0x34a9('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x34a9('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x34a9('0x3'));var interaction=require(_0x34a9('0x4'));var config=require(_0x34a9('0x5'));var controller=require('./migration.controller');router[_0x34a9('0x6')]('/',controller[_0x34a9('0x7')]);module[_0x34a9('0x8')]=router; \ No newline at end of file +var _0xd121=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','index','exports','multer','util'];(function(_0x17ec3b,_0x3d08d2){var _0x45c6fd=function(_0x15c760){while(--_0x15c760){_0x17ec3b['push'](_0x17ec3b['shift']());}};_0x45c6fd(++_0x3d08d2);}(_0xd121,0x112));var _0x1d12=function(_0x2eb1fe,_0x250b5a){_0x2eb1fe=_0x2eb1fe-0x0;var _0x10b81a=_0xd121[_0x2eb1fe];return _0x10b81a;};'use strict';var multer=require(_0x1d12('0x0'));var util=require(_0x1d12('0x1'));var path=require('path');var timeout=require(_0x1d12('0x2'));var express=require(_0x1d12('0x3'));var router=express[_0x1d12('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1d12('0x5'));var interaction=require(_0x1d12('0x6'));var config=require(_0x1d12('0x7'));var controller=require(_0x1d12('0x8'));router[_0x1d12('0x9')]('/',controller[_0x1d12('0xa')]);module[_0x1d12('0xb')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 41fe4da..3aa22f9 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 _0x59a4=['version','STRING'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x59a4,0x107));var _0x459a=function(_0x3496d3,_0x4467a2){_0x3496d3=_0x3496d3-0x0;var _0x509096=_0x59a4[_0x3496d3];return _0x509096;};'use strict';var Sequelize=require('sequelize');module['exports']={'version':{'type':Sequelize[_0x459a('0x0')],'unique':_0x459a('0x1')}}; \ No newline at end of file +var _0x22ef=['sequelize','exports','version'];(function(_0x1b099b,_0x46766c){var _0x1b2cf2=function(_0x129299){while(--_0x129299){_0x1b099b['push'](_0x1b099b['shift']());}};_0x1b2cf2(++_0x46766c);}(_0x22ef,0x17d));var _0xf22e=function(_0x5bbfbc,_0x1d38f2){_0x5bbfbc=_0x5bbfbc-0x0;var _0x41ac46=_0x22ef[_0x5bbfbc];return _0x41ac46;};'use strict';var Sequelize=require(_0xf22e('0x0'));module[_0xf22e('0x1')]={'version':{'type':Sequelize['STRING'],'unique':_0xf22e('0x2')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index fb690fa..aee9ea6 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 _0x4192=['rows','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','then','error','stack','name','map','rawAttributes','fieldName','type','key','filters','intersection','query','attributes','model','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','include','Migration'];(function(_0x53f0db,_0x35c67c){var _0xae0a5c=function(_0x4bd6fb){while(--_0x4bd6fb){_0x53f0db['push'](_0x53f0db['shift']());}};_0xae0a5c(++_0x35c67c);}(_0x4192,0x133));var _0x2419=function(_0xee7e65,_0x4fb2aa){_0xee7e65=_0xee7e65-0x0;var _0x3dfe75=_0x4192[_0xee7e65];return _0x3dfe75;};'use strict';var emlformat=require(_0x2419('0x0'));var rimraf=require(_0x2419('0x1'));var zipdir=require(_0x2419('0x2'));var jsonpatch=require(_0x2419('0x3'));var rp=require(_0x2419('0x4'));var moment=require('moment');var BPromise=require(_0x2419('0x5'));var Mustache=require(_0x2419('0x6'));var util=require('util');var path=require(_0x2419('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2419('0x8'));var fs=require('fs');var fs_extra=require(_0x2419('0x9'));var _=require(_0x2419('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2419('0xb'));var deskjs=require(_0x2419('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2419('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2419('0xe'));var as=require(_0x2419('0xf'));var hardwareService=require(_0x2419('0x10'));var logger=require(_0x2419('0x11'))(_0x2419('0x12'));var utils=require(_0x2419('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x2419('0x14'));var db=require(_0x2419('0x15'))['db'];function respondWithStatusCode(_0x13c77b,_0x2e00a8){_0x2e00a8=_0x2e00a8||0xcc;return function(_0x716b69){if(_0x716b69){return _0x13c77b[_0x2419('0x16')](_0x2e00a8);}return _0x13c77b[_0x2419('0x17')](_0x2e00a8)[_0x2419('0x18')]();};}function respondWithResult(_0x4a33a6,_0x2d78cc){_0x2d78cc=_0x2d78cc||0xc8;return function(_0x163ded){if(_0x163ded){return _0x4a33a6[_0x2419('0x17')](_0x2d78cc)[_0x2419('0x19')](_0x163ded);}};}function respondWithFilteredResult(_0x57db83,_0x5a7f04){return function(_0x23bf4b){if(_0x23bf4b){var _0x99bf02=typeof _0x5a7f04['offset']==='undefined'&&typeof _0x5a7f04['limit']===_0x2419('0x1a');var _0x28fd1e=_0x23bf4b[_0x2419('0x1b')];var _0x4d813f=_0x99bf02?0x0:_0x5a7f04[_0x2419('0x1c')];var _0x4605b8=_0x99bf02?_0x23bf4b['count']:_0x5a7f04[_0x2419('0x1c')]+_0x5a7f04[_0x2419('0x1d')];var _0x30fa11;if(_0x4605b8>=_0x28fd1e){_0x4605b8=_0x28fd1e;_0x30fa11=0xc8;}else{_0x30fa11=0xce;}_0x57db83['status'](_0x30fa11);return _0x57db83[_0x2419('0x1e')](_0x2419('0x1f'),_0x4d813f+'-'+_0x4605b8+'/'+_0x28fd1e)['json'](_0x23bf4b);}return null;};}function patchUpdates(_0x2331d2){return function(_0x40903c){try{jsonpatch[_0x2419('0x20')](_0x40903c,_0x2331d2,!![]);}catch(_0x343eb2){return BPromise[_0x2419('0x21')](_0x343eb2);}return _0x40903c['save']();};}function saveUpdates(_0xa18107,_0x31cdcd){return function(_0x309046){if(_0x309046){return _0x309046[_0x2419('0x22')](_0xa18107)[_0x2419('0x23')](function(_0x375049){return _0x375049;});}return null;};}function removeEntity(_0x5c442a,_0x586b05){return function(_0x3bd9ac){if(_0x3bd9ac){return _0x3bd9ac['destroy']()[_0x2419('0x23')](function(){_0x5c442a[_0x2419('0x17')](0xcc)[_0x2419('0x18')]();});}};}function handleEntityNotFound(_0x5a81b5,_0xf642f8){return function(_0x1d693e){if(!_0x1d693e){_0x5a81b5[_0x2419('0x16')](0x194);}return _0x1d693e;};}function handleError(_0x220001,_0x38b52a){_0x38b52a=_0x38b52a||0x1f4;return function(_0x23034b){logger[_0x2419('0x24')](_0x23034b[_0x2419('0x25')]);if(_0x23034b[_0x2419('0x26')]){delete _0x23034b[_0x2419('0x26')];}_0x220001['status'](_0x38b52a)['send'](_0x23034b);};}exports['index']=function(_0x5c6995,_0x4e13ea){var _0x5e0a19={},_0x5f548a={},_0x2f5406={'count':0x0,'rows':[]};var _0x3690a6=_[_0x2419('0x27')](db['Migration'][_0x2419('0x28')],function(_0x2fb20a){return{'name':_0x2fb20a[_0x2419('0x29')],'type':_0x2fb20a[_0x2419('0x2a')][_0x2419('0x2b')]};});_0x5f548a['model']=_[_0x2419('0x27')](_0x3690a6,_0x2419('0x26'));_0x5f548a['query']=_['keys'](_0x5c6995['query']);_0x5f548a[_0x2419('0x2c')]=_[_0x2419('0x2d')](_0x5f548a['model'],_0x5f548a[_0x2419('0x2e')]);_0x5e0a19[_0x2419('0x2f')]=_[_0x2419('0x2d')](_0x5f548a[_0x2419('0x30')],qs['fields'](_0x5c6995['query']['fields']));_0x5e0a19[_0x2419('0x2f')]=_0x5e0a19[_0x2419('0x2f')][_0x2419('0x31')]?_0x5e0a19[_0x2419('0x2f')]:_0x5f548a['model'];if(!_0x5c6995['query'][_0x2419('0x32')](_0x2419('0x33'))){_0x5e0a19['limit']=qs[_0x2419('0x1d')](_0x5c6995[_0x2419('0x2e')]['limit']);_0x5e0a19[_0x2419('0x1c')]=qs[_0x2419('0x1c')](_0x5c6995['query'][_0x2419('0x1c')]);}_0x5e0a19['order']=qs[_0x2419('0x34')](_0x5c6995[_0x2419('0x2e')]['sort']);_0x5e0a19[_0x2419('0x35')]=qs[_0x2419('0x2c')](_['pick'](_0x5c6995[_0x2419('0x2e')],_0x5f548a[_0x2419('0x2c')]),_0x3690a6);if(_0x5c6995[_0x2419('0x2e')][_0x2419('0x36')]){_0x5e0a19[_0x2419('0x35')]=_['merge'](_0x5e0a19[_0x2419('0x35')],{'$or':_[_0x2419('0x27')](_0x3690a6,function(_0xb329c){if(_0xb329c[_0x2419('0x2a')]!=='VIRTUAL'){var _0x2b23c4={};_0x2b23c4[_0xb329c['name']]={'$like':'%'+_0x5c6995[_0x2419('0x2e')][_0x2419('0x36')]+'%'};return _0x2b23c4;}})});}_0x5e0a19=_[_0x2419('0x37')]({},_0x5e0a19,_0x5c6995[_0x2419('0x38')]);var _0x1d9db4={'where':_0x5e0a19[_0x2419('0x35')]};return db['Migration']['count'](_0x1d9db4)[_0x2419('0x23')](function(_0x2d1c0b){_0x2f5406[_0x2419('0x1b')]=_0x2d1c0b;if(_0x5c6995['query']['includeAll']){_0x5e0a19[_0x2419('0x39')]=[{'all':!![]}];}return db[_0x2419('0x3a')]['findAll'](_0x5e0a19);})[_0x2419('0x23')](function(_0x910b51){_0x2f5406[_0x2419('0x3b')]=_0x910b51;return _0x2f5406;})['then'](respondWithFilteredResult(_0x4e13ea,_0x5e0a19))[_0x2419('0x3c')](handleError(_0x4e13ea,null));}; \ No newline at end of file +var _0xaefe=['name','send','index','map','Migration','rawAttributes','type','model','keys','filters','intersection','query','attributes','hasOwnProperty','nolimit','sort','filter','merge','VIRTUAL','where','include','rows','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','Content-Range','apply','reject','save','update','then','error','stack'];(function(_0x5b5410,_0x47277a){var _0x9c2c09=function(_0x38fa04){while(--_0x38fa04){_0x5b5410['push'](_0x5b5410['shift']());}};_0x9c2c09(++_0x47277a);}(_0xaefe,0x91));var _0xeaef=function(_0x42bafd,_0x3f0fe3){_0x42bafd=_0x42bafd-0x0;var _0x2ed705=_0xaefe[_0x42bafd];return _0x2ed705;};'use strict';var emlformat=require(_0xeaef('0x0'));var rimraf=require(_0xeaef('0x1'));var zipdir=require(_0xeaef('0x2'));var jsonpatch=require(_0xeaef('0x3'));var rp=require(_0xeaef('0x4'));var moment=require('moment');var BPromise=require(_0xeaef('0x5'));var Mustache=require(_0xeaef('0x6'));var util=require('util');var path=require('path');var sox=require(_0xeaef('0x7'));var csv=require(_0xeaef('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xeaef('0x9'));var _=require(_0xeaef('0xa'));var squel=require(_0xeaef('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xeaef('0xc'));var toCsv=require(_0xeaef('0x8'));var querystring=require(_0xeaef('0xd'));var Papa=require(_0xeaef('0xe'));var Redis=require(_0xeaef('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xeaef('0x10'));var hardwareService=require(_0xeaef('0x11'));var logger=require('../../config/logger')(_0xeaef('0x12'));var utils=require('../../config/utils');var config=require(_0xeaef('0x13'));var licenseUtil=require(_0xeaef('0x14'));var db=require(_0xeaef('0x15'))['db'];function respondWithStatusCode(_0x3c5e61,_0x2c14ce){_0x2c14ce=_0x2c14ce||0xcc;return function(_0x893dc4){if(_0x893dc4){return _0x3c5e61[_0xeaef('0x16')](_0x2c14ce);}return _0x3c5e61[_0xeaef('0x17')](_0x2c14ce)[_0xeaef('0x18')]();};}function respondWithResult(_0xa985ad,_0x19eac0){_0x19eac0=_0x19eac0||0xc8;return function(_0x518268){if(_0x518268){return _0xa985ad[_0xeaef('0x17')](_0x19eac0)[_0xeaef('0x19')](_0x518268);}};}function respondWithFilteredResult(_0x58f1e9,_0x41d07c){return function(_0x36c22f){if(_0x36c22f){var _0x3487de=typeof _0x41d07c['offset']===_0xeaef('0x1a')&&typeof _0x41d07c[_0xeaef('0x1b')]===_0xeaef('0x1a');var _0x34ce10=_0x36c22f['count'];var _0x21ba48=_0x3487de?0x0:_0x41d07c[_0xeaef('0x1c')];var _0x4462e0=_0x3487de?_0x36c22f[_0xeaef('0x1d')]:_0x41d07c[_0xeaef('0x1c')]+_0x41d07c[_0xeaef('0x1b')];var _0xbf168;if(_0x4462e0>=_0x34ce10){_0x4462e0=_0x34ce10;_0xbf168=0xc8;}else{_0xbf168=0xce;}_0x58f1e9[_0xeaef('0x17')](_0xbf168);return _0x58f1e9['set'](_0xeaef('0x1e'),_0x21ba48+'-'+_0x4462e0+'/'+_0x34ce10)[_0xeaef('0x19')](_0x36c22f);}return null;};}function patchUpdates(_0x4bfa88){return function(_0x34fa2d){try{jsonpatch[_0xeaef('0x1f')](_0x34fa2d,_0x4bfa88,!![]);}catch(_0xd3440f){return BPromise[_0xeaef('0x20')](_0xd3440f);}return _0x34fa2d[_0xeaef('0x21')]();};}function saveUpdates(_0x2c3ff3,_0x49c6dd){return function(_0x3689ae){if(_0x3689ae){return _0x3689ae[_0xeaef('0x22')](_0x2c3ff3)['then'](function(_0x29ece3){return _0x29ece3;});}return null;};}function removeEntity(_0x22bacb,_0x1a1251){return function(_0x1ba6c8){if(_0x1ba6c8){return _0x1ba6c8['destroy']()[_0xeaef('0x23')](function(){_0x22bacb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x60377d,_0x70b609){return function(_0x4684ab){if(!_0x4684ab){_0x60377d['sendStatus'](0x194);}return _0x4684ab;};}function handleError(_0x2d45b1,_0x17da48){_0x17da48=_0x17da48||0x1f4;return function(_0x5d6722){logger[_0xeaef('0x24')](_0x5d6722[_0xeaef('0x25')]);if(_0x5d6722[_0xeaef('0x26')]){delete _0x5d6722[_0xeaef('0x26')];}_0x2d45b1[_0xeaef('0x17')](_0x17da48)[_0xeaef('0x27')](_0x5d6722);};}exports[_0xeaef('0x28')]=function(_0x353139,_0x31ad80){var _0x282bb8={},_0x1102fc={},_0x119ae3={'count':0x0,'rows':[]};var _0x92bd72=_[_0xeaef('0x29')](db[_0xeaef('0x2a')][_0xeaef('0x2b')],function(_0x15c308){return{'name':_0x15c308['fieldName'],'type':_0x15c308[_0xeaef('0x2c')]['key']};});_0x1102fc[_0xeaef('0x2d')]=_['map'](_0x92bd72,_0xeaef('0x26'));_0x1102fc['query']=_[_0xeaef('0x2e')](_0x353139['query']);_0x1102fc[_0xeaef('0x2f')]=_[_0xeaef('0x30')](_0x1102fc[_0xeaef('0x2d')],_0x1102fc[_0xeaef('0x31')]);_0x282bb8[_0xeaef('0x32')]=_['intersection'](_0x1102fc[_0xeaef('0x2d')],qs['fields'](_0x353139[_0xeaef('0x31')]['fields']));_0x282bb8[_0xeaef('0x32')]=_0x282bb8[_0xeaef('0x32')]['length']?_0x282bb8[_0xeaef('0x32')]:_0x1102fc[_0xeaef('0x2d')];if(!_0x353139[_0xeaef('0x31')][_0xeaef('0x33')](_0xeaef('0x34'))){_0x282bb8[_0xeaef('0x1b')]=qs[_0xeaef('0x1b')](_0x353139[_0xeaef('0x31')][_0xeaef('0x1b')]);_0x282bb8[_0xeaef('0x1c')]=qs[_0xeaef('0x1c')](_0x353139[_0xeaef('0x31')]['offset']);}_0x282bb8['order']=qs['sort'](_0x353139[_0xeaef('0x31')][_0xeaef('0x35')]);_0x282bb8['where']=qs[_0xeaef('0x2f')](_['pick'](_0x353139[_0xeaef('0x31')],_0x1102fc['filters']),_0x92bd72);if(_0x353139[_0xeaef('0x31')][_0xeaef('0x36')]){_0x282bb8['where']=_[_0xeaef('0x37')](_0x282bb8['where'],{'$or':_[_0xeaef('0x29')](_0x92bd72,function(_0x416440){if(_0x416440['type']!==_0xeaef('0x38')){var _0x5d80f9={};_0x5d80f9[_0x416440['name']]={'$like':'%'+_0x353139[_0xeaef('0x31')][_0xeaef('0x36')]+'%'};return _0x5d80f9;}})});}_0x282bb8=_[_0xeaef('0x37')]({},_0x282bb8,_0x353139['options']);var _0x590b24={'where':_0x282bb8[_0xeaef('0x39')]};return db[_0xeaef('0x2a')]['count'](_0x590b24)['then'](function(_0x504184){_0x119ae3[_0xeaef('0x1d')]=_0x504184;if(_0x353139[_0xeaef('0x31')]['includeAll']){_0x282bb8[_0xeaef('0x3a')]=[{'all':!![]}];}return db[_0xeaef('0x2a')]['findAll'](_0x282bb8);})[_0xeaef('0x23')](function(_0xda4f23){_0x119ae3[_0xeaef('0x3b')]=_0xda4f23;return _0x119ae3;})[_0xeaef('0x23')](respondWithFilteredResult(_0x31ad80,_0x282bb8))[_0xeaef('0x3c')](handleError(_0x31ad80,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index c15e0d7..481dea7 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 _0x5a54=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./migration.attributes','define','lodash'];(function(_0x401b0d,_0x35dad6){var _0x59380c=function(_0x1f03a2){while(--_0x1f03a2){_0x401b0d['push'](_0x401b0d['shift']());}};_0x59380c(++_0x35dad6);}(_0x5a54,0x103));var _0x45a5=function(_0x5dabf9,_0x5037b7){_0x5dabf9=_0x5dabf9-0x0;var _0x113b83=_0x5a54[_0x5dabf9];return _0x113b83;};'use strict';var _=require(_0x45a5('0x0'));var util=require(_0x45a5('0x1'));var logger=require(_0x45a5('0x2'))(_0x45a5('0x3'));var moment=require(_0x45a5('0x4'));var BPromise=require(_0x45a5('0x5'));var rp=require(_0x45a5('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x45a5('0x7'));var config=require('../../config/environment');var attributes=require(_0x45a5('0x8'));module['exports']=function(_0x2f1b5b,_0x407749){return _0x2f1b5b[_0x45a5('0x9')]('Migration',attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x44c1=['bluebird','request-promise','path','rimraf','./migration.attributes','Migration','lodash','util','../../config/logger'];(function(_0xf1499b,_0x4e8f51){var _0x2c589c=function(_0x1039fa){while(--_0x1039fa){_0xf1499b['push'](_0xf1499b['shift']());}};_0x2c589c(++_0x4e8f51);}(_0x44c1,0x19b));var _0x144c=function(_0x5d80de,_0x2cf15d){_0x5d80de=_0x5d80de-0x0;var _0x1c7556=_0x44c1[_0x5d80de];return _0x1c7556;};'use strict';var _=require(_0x144c('0x0'));var util=require(_0x144c('0x1'));var logger=require(_0x144c('0x2'))('api');var moment=require('moment');var BPromise=require(_0x144c('0x3'));var rp=require(_0x144c('0x4'));var fs=require('fs');var path=require(_0x144c('0x5'));var rimraf=require(_0x144c('0x6'));var config=require('../../config/environment');var attributes=require(_0x144c('0x7'));module['exports']=function(_0x36c88f,_0x239c01){return _0x36c88f['define'](_0x144c('0x8'),attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index 4f54375..7464d9f 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 _0x2083=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','error','code','message','info','result','lodash','util','bluebird','randomstring'];(function(_0x2ebfb9,_0x5f04e1){var _0x5ae30b=function(_0x494de5){while(--_0x494de5){_0x2ebfb9['push'](_0x2ebfb9['shift']());}};_0x5ae30b(++_0x5f04e1);}(_0x2083,0x137));var _0x3208=function(_0x67b465,_0x255653){_0x67b465=_0x67b465-0x0;var _0x3ed15f=_0x2083[_0x67b465];return _0x3ed15f;};'use strict';var _=require(_0x3208('0x0'));var util=require(_0x3208('0x1'));var moment=require('moment');var BPromise=require(_0x3208('0x2'));var rs=require(_0x3208('0x3'));var fs=require('fs');var Redis=require(_0x3208('0x4'));var db=require(_0x3208('0x5'))['db'];var utils=require(_0x3208('0x6'));var logger=require(_0x3208('0x7'))(_0x3208('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x3208('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d837d,_0x3d4b9d,_0x17972f){return new BPromise(function(_0x564ff6,_0x165e5e){return client[_0x3208('0xa')](_0x3d837d,_0x17972f)[_0x3208('0xb')](function(_0x4c45f4){logger['info'](_0x3208('0xc'),_0x3d4b9d,_0x3208('0xd'));logger[_0x3208('0xe')](_0x3208('0xf'),_0x3d4b9d,'request\x20sent',JSON['stringify'](_0x4c45f4));if(_0x4c45f4[_0x3208('0x10')]){if(_0x4c45f4[_0x3208('0x10')][_0x3208('0x11')]===0x1f4){logger[_0x3208('0x10')](_0x3208('0xc'),_0x3d4b9d,_0x4c45f4[_0x3208('0x10')][_0x3208('0x12')]);return _0x165e5e(_0x4c45f4[_0x3208('0x10')][_0x3208('0x12')]);}logger[_0x3208('0x10')](_0x3208('0xc'),_0x3d4b9d,_0x4c45f4[_0x3208('0x10')][_0x3208('0x12')]);return _0x564ff6(_0x4c45f4[_0x3208('0x10')]['message']);}else{logger[_0x3208('0x13')](_0x3208('0xc'),_0x3d4b9d,_0x3208('0xd'));_0x564ff6(_0x4c45f4[_0x3208('0x14')][_0x3208('0x12')]);}})['catch'](function(_0x244d19){logger[_0x3208('0x10')]('Migration,\x20%s,\x20%s',_0x3d4b9d,_0x244d19);_0x165e5e(_0x244d19);});});} \ No newline at end of file +var _0xcc73=['info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request'];(function(_0xc5a279,_0x155360){var _0xc755d3=function(_0x15051c){while(--_0x15051c){_0xc5a279['push'](_0xc5a279['shift']());}};_0xc755d3(++_0x155360);}(_0xcc73,0x1cb));var _0x3cc7=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xcc73[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var util=require(_0x3cc7('0x0'));var moment=require(_0x3cc7('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3cc7('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x3cc7('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x3cc7('0x4'));var jayson=require(_0x3cc7('0x5'));var client=jayson[_0x3cc7('0x6')][_0x3cc7('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x127590,_0x5604df,_0x416c48){return new BPromise(function(_0x37c184,_0x3f2dd7){return client[_0x3cc7('0x8')](_0x127590,_0x416c48)['then'](function(_0x2ff7ba){logger[_0x3cc7('0x9')](_0x3cc7('0xa'),_0x5604df,_0x3cc7('0xb'));logger[_0x3cc7('0xc')](_0x3cc7('0xd'),_0x5604df,_0x3cc7('0xb'),JSON['stringify'](_0x2ff7ba));if(_0x2ff7ba['error']){if(_0x2ff7ba[_0x3cc7('0xe')]['code']===0x1f4){logger[_0x3cc7('0xe')](_0x3cc7('0xa'),_0x5604df,_0x2ff7ba[_0x3cc7('0xe')][_0x3cc7('0xf')]);return _0x3f2dd7(_0x2ff7ba[_0x3cc7('0xe')][_0x3cc7('0xf')]);}logger[_0x3cc7('0xe')](_0x3cc7('0xa'),_0x5604df,_0x2ff7ba[_0x3cc7('0xe')][_0x3cc7('0xf')]);return _0x37c184(_0x2ff7ba[_0x3cc7('0xe')][_0x3cc7('0xf')]);}else{logger[_0x3cc7('0x9')](_0x3cc7('0xa'),_0x5604df,_0x3cc7('0xb'));_0x37c184(_0x2ff7ba[_0x3cc7('0x10')][_0x3cc7('0xf')]);}})[_0x3cc7('0x11')](function(_0x386a31){logger[_0x3cc7('0xe')](_0x3cc7('0xa'),_0x5604df,_0x386a31);_0x3f2dd7(_0x386a31);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 163e305..75a172b 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 _0x26bd=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','isAuthenticated','index','get','/:id','show','post','create','put','update'];(function(_0x33055e,_0x54dff9){var _0x41dfb4=function(_0x5b4123){while(--_0x5b4123){_0x33055e['push'](_0x33055e['shift']());}};_0x41dfb4(++_0x54dff9);}(_0x26bd,0xaa));var _0xd26b=function(_0xf983a0,_0x523da6){_0xf983a0=_0xf983a0-0x0;var _0x3309cd=_0x26bd[_0xf983a0];return _0x3309cd;};'use strict';var multer=require(_0xd26b('0x0'));var util=require(_0xd26b('0x1'));var path=require(_0xd26b('0x2'));var timeout=require(_0xd26b('0x3'));var express=require(_0xd26b('0x4'));var router=express[_0xd26b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xd26b('0x6'));var interaction=require(_0xd26b('0x7'));var config=require(_0xd26b('0x8'));var controller=require(_0xd26b('0x9'));router['get']('/',auth[_0xd26b('0xa')](),controller[_0xd26b('0xb')]);router[_0xd26b('0xc')](_0xd26b('0xd'),auth['isAuthenticated'](),controller[_0xd26b('0xe')]);router[_0xd26b('0xf')]('/',auth[_0xd26b('0xa')](),controller[_0xd26b('0x10')]);router[_0xd26b('0x11')](_0xd26b('0xd'),auth['isAuthenticated'](),controller[_0xd26b('0x12')]);router['delete'](_0xd26b('0xd'),auth[_0xd26b('0xa')](),controller[_0xd26b('0x13')]);module[_0xd26b('0x14')]=router; \ No newline at end of file +var _0x8ce1=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./network.controller','get','index','isAuthenticated','show','put','/:id','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x7303c,_0x2d7803){var _0x367cc7=function(_0x333990){while(--_0x333990){_0x7303c['push'](_0x7303c['shift']());}};_0x367cc7(++_0x2d7803);}(_0x8ce1,0x152));var _0x18ce=function(_0x29589d,_0x5ba6a6){_0x29589d=_0x29589d-0x0;var _0x5b06d2=_0x8ce1[_0x29589d];return _0x5b06d2;};'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('../../components/auth/service');var interaction=require(_0x18ce('0x7'));var config=require(_0x18ce('0x8'));var controller=require(_0x18ce('0x9'));router[_0x18ce('0xa')]('/',auth['isAuthenticated'](),controller[_0x18ce('0xb')]);router[_0x18ce('0xa')]('/:id',auth[_0x18ce('0xc')](),controller[_0x18ce('0xd')]);router['post']('/',auth[_0x18ce('0xc')](),controller['create']);router[_0x18ce('0xe')](_0x18ce('0xf'),auth[_0x18ce('0xc')](),controller[_0x18ce('0x10')]);router[_0x18ce('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x18ce('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index c28fc29..46baff7 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 _0x4a04=['localnet','externip','stun','turn','STRING','ENUM'];(function(_0x54bac5,_0x8d3a16){var _0xc15971=function(_0x254653){while(--_0x254653){_0x54bac5['push'](_0x54bac5['shift']());}};_0xc15971(++_0x8d3a16);}(_0x4a04,0x125));var _0x44a0=function(_0x51a6d6,_0x3c9c49){_0x51a6d6=_0x51a6d6-0x0;var _0x5ef1a8=_0x4a04[_0x51a6d6];return _0x5ef1a8;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x44a0('0x0')](_0x44a0('0x1'),_0x44a0('0x2'),_0x44a0('0x3'),_0x44a0('0x4'))},'value':{'type':Sequelize[_0x44a0('0x5')]},'username':{'type':Sequelize[_0x44a0('0x5')]},'password':{'type':Sequelize[_0x44a0('0x5')]}}; \ No newline at end of file +var _0x6d92=['externip','stun','turn','STRING','sequelize','exports','ENUM','localnet'];(function(_0x202055,_0x344111){var _0x5d7e21=function(_0x1d3d5d){while(--_0x1d3d5d){_0x202055['push'](_0x202055['shift']());}};_0x5d7e21(++_0x344111);}(_0x6d92,0x6c));var _0x26d9=function(_0x475c37,_0x386f90){_0x475c37=_0x475c37-0x0;var _0x711fdc=_0x6d92[_0x475c37];return _0x711fdc;};'use strict';var Sequelize=require(_0x26d9('0x0'));module[_0x26d9('0x1')]={'type':{'type':Sequelize[_0x26d9('0x2')](_0x26d9('0x3'),_0x26d9('0x4'),_0x26d9('0x5'),_0x26d9('0x6'))},'value':{'type':Sequelize[_0x26d9('0x7')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x26d9('0x7')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 06c3d42..97df008 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 _0xdd04=['readFileSync','server/files/templates/network.ejs','format','toLowerCase','chan_sip.so','update','sequelize','server/files/templates/stun_multiple.ejs','/etc/asterisk/turn_xcally.conf','/etc/asterisk/sip_xcally_%s.conf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','client','request','info','Network,\x20%s,\x20%s','request\x20sent','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','save','then','destroy','stack','send','index','map','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','merge','VIRTUAL','filter','options','Network','includeAll','include','rows','params','rawAttributes','intersection','find','transaction','create','body','findAll','STUN','join','root','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','toUpperCase','TURN','server/files/templates/turn_multiple.ejs'];(function(_0x3450c1,_0x159bc5){var _0x5b5812=function(_0x1e0905){while(--_0x1e0905){_0x3450c1['push'](_0x3450c1['shift']());}};_0x5b5812(++_0x159bc5);}(_0xdd04,0xde));var _0x4dd0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdd04[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4dd0('0x0'));var zipdir=require(_0x4dd0('0x1'));var jsonpatch=require(_0x4dd0('0x2'));var rp=require(_0x4dd0('0x3'));var moment=require(_0x4dd0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4dd0('0x5'));var util=require(_0x4dd0('0x6'));var path=require(_0x4dd0('0x7'));var sox=require('sox');var csv=require(_0x4dd0('0x8'));var ejs=require(_0x4dd0('0x9'));var fs=require('fs');var fs_extra=require(_0x4dd0('0xa'));var _=require('lodash');var squel=require(_0x4dd0('0xb'));var crypto=require(_0x4dd0('0xc'));var jsforce=require(_0x4dd0('0xd'));var deskjs=require(_0x4dd0('0xe'));var toCsv=require(_0x4dd0('0x8'));var querystring=require(_0x4dd0('0xf'));var Papa=require(_0x4dd0('0x10'));var Redis=require(_0x4dd0('0x11'));var authService=require(_0x4dd0('0x12'));var qs=require(_0x4dd0('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4dd0('0x14'));var logger=require(_0x4dd0('0x15'))(_0x4dd0('0x16'));var utils=require(_0x4dd0('0x17'));var config=require(_0x4dd0('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x4dd0('0x19'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x4dd0('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x46a3ae,_0x286c33,_0x10c8c8,_0x468555){return new BPromise(function(_0x3793b2,_0xf1999b){var _0x1b75b0=_0x468555||client;return _0x1b75b0[_0x4dd0('0x1b')](_0x46a3ae,_0x10c8c8)['then'](function(_0x403bb7){logger[_0x4dd0('0x1c')](_0x4dd0('0x1d'),_0x286c33,_0x4dd0('0x1e'));logger['debug'](_0x4dd0('0x1f'),_0x286c33,'request\x20sent',JSON[_0x4dd0('0x20')](_0x403bb7));if(_0x403bb7['error']){if(_0x403bb7[_0x4dd0('0x21')][_0x4dd0('0x22')]===0x1f4){logger[_0x4dd0('0x21')](_0x4dd0('0x1d'),_0x286c33,_0x403bb7['error']['message']);return _0xf1999b(_0x403bb7[_0x4dd0('0x21')]['message']);}logger[_0x4dd0('0x21')]('Network,\x20%s,\x20%s',_0x286c33,_0x403bb7[_0x4dd0('0x21')][_0x4dd0('0x23')]);return _0x3793b2(_0x403bb7[_0x4dd0('0x21')][_0x4dd0('0x23')]);}else{logger[_0x4dd0('0x1c')]('Network,\x20%s,\x20%s',_0x286c33,_0x4dd0('0x1e'));_0x3793b2(_0x403bb7['result'][_0x4dd0('0x23')]);}})[_0x4dd0('0x24')](function(_0x148a27){logger[_0x4dd0('0x21')]('Network,\x20%s,\x20%s',_0x286c33,_0x148a27);_0xf1999b(_0x148a27);});});}function respondWithStatusCode(_0x341259,_0x32f789){_0x32f789=_0x32f789||0xcc;return function(_0x107ac9){if(_0x107ac9){return _0x341259[_0x4dd0('0x25')](_0x32f789);}return _0x341259[_0x4dd0('0x26')](_0x32f789)[_0x4dd0('0x27')]();};}function respondWithResult(_0x382995,_0x30de33){_0x30de33=_0x30de33||0xc8;return function(_0x2af65d){if(_0x2af65d){return _0x382995[_0x4dd0('0x26')](_0x30de33)[_0x4dd0('0x28')](_0x2af65d);}};}function respondWithFilteredResult(_0x4104e5,_0x40fe0c){return function(_0x2ed196){if(_0x2ed196){var _0x34a713=typeof _0x40fe0c['offset']===_0x4dd0('0x29')&&typeof _0x40fe0c['limit']===_0x4dd0('0x29');var _0x5d57a5=_0x2ed196['count'];var _0xe8b48e=_0x34a713?0x0:_0x40fe0c['offset'];var _0x4bcb3e=_0x34a713?_0x2ed196[_0x4dd0('0x2a')]:_0x40fe0c[_0x4dd0('0x2b')]+_0x40fe0c['limit'];var _0x1938eb;if(_0x4bcb3e>=_0x5d57a5){_0x4bcb3e=_0x5d57a5;_0x1938eb=0xc8;}else{_0x1938eb=0xce;}_0x4104e5[_0x4dd0('0x26')](_0x1938eb);return _0x4104e5[_0x4dd0('0x2c')](_0x4dd0('0x2d'),_0xe8b48e+'-'+_0x4bcb3e+'/'+_0x5d57a5)[_0x4dd0('0x28')](_0x2ed196);}return null;};}function patchUpdates(_0x54fc0f){return function(_0x42d6a4){try{jsonpatch['apply'](_0x42d6a4,_0x54fc0f,!![]);}catch(_0x2fb991){return BPromise['reject'](_0x2fb991);}return _0x42d6a4[_0x4dd0('0x2e')]();};}function saveUpdates(_0x4fcc43,_0x4d66d5){return function(_0x44d8c9){if(_0x44d8c9){return _0x44d8c9['update'](_0x4fcc43)[_0x4dd0('0x2f')](function(_0x5099a6){return _0x5099a6;});}return null;};}function removeEntity(_0x2d239a,_0x54cf98){return function(_0x2fe9ba){if(_0x2fe9ba){return _0x2fe9ba[_0x4dd0('0x30')]()[_0x4dd0('0x2f')](function(){_0x2d239a['status'](0xcc)[_0x4dd0('0x27')]();});}};}function handleEntityNotFound(_0x2da35a,_0x514a1a){return function(_0x5a2eaf){if(!_0x5a2eaf){_0x2da35a['sendStatus'](0x194);}return _0x5a2eaf;};}function handleError(_0x59fac0,_0x5a7195){_0x5a7195=_0x5a7195||0x1f4;return function(_0x5e5a79){logger[_0x4dd0('0x21')](_0x5e5a79[_0x4dd0('0x31')]);if(_0x5e5a79['name']){delete _0x5e5a79['name'];}_0x59fac0[_0x4dd0('0x26')](_0x5a7195)[_0x4dd0('0x32')](_0x5e5a79);};}exports[_0x4dd0('0x33')]=function(_0x340b8b,_0x32f4e5){var _0x4a2c97={},_0xe3d8fe={},_0x29f3ab={'count':0x0,'rows':[]};var _0x12375a=_[_0x4dd0('0x34')](db['Network']['rawAttributes'],function(_0x14a66e){return{'name':_0x14a66e['fieldName'],'type':_0x14a66e[_0x4dd0('0x35')][_0x4dd0('0x36')]};});_0xe3d8fe[_0x4dd0('0x37')]=_['map'](_0x12375a,'name');_0xe3d8fe[_0x4dd0('0x38')]=_[_0x4dd0('0x39')](_0x340b8b[_0x4dd0('0x38')]);_0xe3d8fe[_0x4dd0('0x3a')]=_['intersection'](_0xe3d8fe[_0x4dd0('0x37')],_0xe3d8fe['query']);_0x4a2c97[_0x4dd0('0x3b')]=_['intersection'](_0xe3d8fe['model'],qs[_0x4dd0('0x3c')](_0x340b8b[_0x4dd0('0x38')][_0x4dd0('0x3c')]));_0x4a2c97[_0x4dd0('0x3b')]=_0x4a2c97[_0x4dd0('0x3b')][_0x4dd0('0x3d')]?_0x4a2c97[_0x4dd0('0x3b')]:_0xe3d8fe[_0x4dd0('0x37')];if(!_0x340b8b[_0x4dd0('0x38')][_0x4dd0('0x3e')](_0x4dd0('0x3f'))){_0x4a2c97[_0x4dd0('0x40')]=qs[_0x4dd0('0x40')](_0x340b8b[_0x4dd0('0x38')][_0x4dd0('0x40')]);_0x4a2c97[_0x4dd0('0x2b')]=qs[_0x4dd0('0x2b')](_0x340b8b[_0x4dd0('0x38')]['offset']);}_0x4a2c97[_0x4dd0('0x41')]=qs[_0x4dd0('0x42')](_0x340b8b[_0x4dd0('0x38')][_0x4dd0('0x42')]);_0x4a2c97[_0x4dd0('0x43')]=qs['filters'](_['pick'](_0x340b8b[_0x4dd0('0x38')],_0xe3d8fe[_0x4dd0('0x3a')]),_0x12375a);if(_0x340b8b['query']['filter']){_0x4a2c97[_0x4dd0('0x43')]=_[_0x4dd0('0x44')](_0x4a2c97[_0x4dd0('0x43')],{'$or':_[_0x4dd0('0x34')](_0x12375a,function(_0x5a4360){if(_0x5a4360[_0x4dd0('0x35')]!==_0x4dd0('0x45')){var _0x3d0859={};_0x3d0859[_0x5a4360['name']]={'$like':'%'+_0x340b8b[_0x4dd0('0x38')][_0x4dd0('0x46')]+'%'};return _0x3d0859;}})});}_0x4a2c97=_['merge']({},_0x4a2c97,_0x340b8b[_0x4dd0('0x47')]);var _0x5e65e3={'where':_0x4a2c97['where']};return db[_0x4dd0('0x48')]['count'](_0x5e65e3)['then'](function(_0x32c3c3){_0x29f3ab[_0x4dd0('0x2a')]=_0x32c3c3;if(_0x340b8b['query'][_0x4dd0('0x49')]){_0x4a2c97[_0x4dd0('0x4a')]=[{'all':!![]}];}return db[_0x4dd0('0x48')]['findAll'](_0x4a2c97);})['then'](function(_0x3d5c1c){_0x29f3ab[_0x4dd0('0x4b')]=_0x3d5c1c;return _0x29f3ab;})[_0x4dd0('0x2f')](respondWithFilteredResult(_0x32f4e5,_0x4a2c97))[_0x4dd0('0x24')](handleError(_0x32f4e5,null));};exports['show']=function(_0x4f654f,_0x54d26c){var _0x3e4965={'raw':!![],'where':{'id':_0x4f654f[_0x4dd0('0x4c')]['id']}},_0xaf3163={};_0xaf3163[_0x4dd0('0x37')]=_['keys'](db['Network'][_0x4dd0('0x4d')]);_0xaf3163['query']=_[_0x4dd0('0x39')](_0x4f654f[_0x4dd0('0x38')]);_0xaf3163[_0x4dd0('0x3a')]=_['intersection'](_0xaf3163[_0x4dd0('0x37')],_0xaf3163['query']);_0x3e4965['attributes']=_[_0x4dd0('0x4e')](_0xaf3163[_0x4dd0('0x37')],qs['fields'](_0x4f654f['query'][_0x4dd0('0x3c')]));_0x3e4965[_0x4dd0('0x3b')]=_0x3e4965[_0x4dd0('0x3b')][_0x4dd0('0x3d')]?_0x3e4965[_0x4dd0('0x3b')]:_0xaf3163['model'];if(_0x4f654f['query'][_0x4dd0('0x49')]){_0x3e4965[_0x4dd0('0x4a')]=[{'all':!![]}];}_0x3e4965=_[_0x4dd0('0x44')]({},_0x3e4965,_0x4f654f[_0x4dd0('0x47')]);return db[_0x4dd0('0x48')][_0x4dd0('0x4f')](_0x3e4965)[_0x4dd0('0x2f')](handleEntityNotFound(_0x54d26c,null))[_0x4dd0('0x2f')](respondWithResult(_0x54d26c,null))[_0x4dd0('0x24')](handleError(_0x54d26c,null));};exports['create']=function(_0x4f003f,_0xa413c4,_0x26fb01){var _0x27d843;return db['sequelize'][_0x4dd0('0x50')](function(_0xf783c6){return db[_0x4dd0('0x48')][_0x4dd0('0x51')](_0x4f003f[_0x4dd0('0x52')],{'raw':!![]})[_0x4dd0('0x2f')](function(_0x5c76e4){_0x27d843=_0x5c76e4;return db[_0x4dd0('0x48')][_0x4dd0('0x53')]({'where':{'type':_0x4f003f[_0x4dd0('0x52')][_0x4dd0('0x35')]},'raw':!![]});})['then'](function(_0xa71f45){if(_0x27d843[_0x4dd0('0x35')]['toUpperCase']()==_0x4dd0('0x54')){var _0xaac877=fs['readFileSync'](path[_0x4dd0('0x55')](config[_0x4dd0('0x56')],'server/files/templates/stun_multiple.ejs'),_0x4dd0('0x57'));var _0x1447b1=ejs[_0x4dd0('0x58')](_0xaac877,{'networks':_0xa71f45||[]});fs[_0x4dd0('0x59')](_0x4dd0('0x5a'),_0x1447b1);return respondWithRpcPromise(_0x4dd0('0x5b'),'create',{'module':_0x4dd0('0x5c')});}else if(_0x27d843[_0x4dd0('0x35')][_0x4dd0('0x5d')]()==_0x4dd0('0x5e')){var _0x2e5e29=fs['readFileSync'](path['join'](config[_0x4dd0('0x56')],_0x4dd0('0x5f')),'utf8');var _0x36d9d3=ejs['render'](_0x2e5e29,{'networks':_0xa71f45||[]});fs[_0x4dd0('0x59')]('/etc/asterisk/turn_xcally.conf',_0x36d9d3);return respondWithRpcPromise(_0x4dd0('0x5b'),_0x4dd0('0x51'),{'module':_0x4dd0('0x5c')});}else{var _0xf0f6be=fs[_0x4dd0('0x60')](path['join'](config['root'],_0x4dd0('0x61')),_0x4dd0('0x57'));var _0x16cbfa=ejs[_0x4dd0('0x58')](_0xf0f6be,{'networks':_0xa71f45||[]});fs[_0x4dd0('0x59')](util[_0x4dd0('0x62')]('/etc/asterisk/sip_xcally_%s.conf',_0x4f003f['body'][_0x4dd0('0x35')][_0x4dd0('0x63')]()),_0x16cbfa);return respondWithRpcPromise('Reload',_0x4dd0('0x51'),{'module':_0x4dd0('0x64')});}return null;})[_0x4dd0('0x2f')](function(){return _0x27d843;});})[_0x4dd0('0x2f')](respondWithResult(_0xa413c4,0xc9))[_0x4dd0('0x24')](handleError(_0xa413c4,null));};exports[_0x4dd0('0x65')]=function(_0x1f2471,_0x4a9647,_0x38dd58){var _0x5c11f0;return db[_0x4dd0('0x66')][_0x4dd0('0x50')](function(_0x106eda){return db[_0x4dd0('0x48')]['find']({'where':{'id':_0x1f2471['params']['id']}})['then'](handleEntityNotFound(_0x4a9647,null))['then'](saveUpdates(_0x1f2471[_0x4dd0('0x52')],null))[_0x4dd0('0x2f')](function(_0x380af8){if(_0x380af8){_0x5c11f0=_0x380af8;return db[_0x4dd0('0x48')]['findAll']({'where':{'type':_0x5c11f0[_0x4dd0('0x35')]},'raw':!![]});}return null;})['then'](function(_0x4af740){if(_0x5c11f0[_0x4dd0('0x35')][_0x4dd0('0x5d')]()=='STUN'){var _0x1e44c3=fs[_0x4dd0('0x60')](path[_0x4dd0('0x55')](config[_0x4dd0('0x56')],_0x4dd0('0x67')),_0x4dd0('0x57'));var _0x1f114d=ejs[_0x4dd0('0x58')](_0x1e44c3,{'networks':_0x4af740||[]});fs[_0x4dd0('0x59')]('/etc/asterisk/stun_xcally.conf',_0x1f114d);return respondWithRpcPromise('Reload',_0x4dd0('0x65'),{'module':_0x4dd0('0x5c')});}else if(_0x5c11f0['type']['toUpperCase']()==_0x4dd0('0x5e')){var _0x33f330=fs[_0x4dd0('0x60')](path[_0x4dd0('0x55')](config[_0x4dd0('0x56')],_0x4dd0('0x5f')),'utf8');var _0x17a098=ejs[_0x4dd0('0x58')](_0x33f330,{'networks':_0x4af740||[]});fs[_0x4dd0('0x59')](_0x4dd0('0x68'),_0x17a098);return respondWithRpcPromise(_0x4dd0('0x5b'),_0x4dd0('0x65'),{'module':_0x4dd0('0x5c')});}else{var _0x15c603=fs[_0x4dd0('0x60')](path['join'](config[_0x4dd0('0x56')],_0x4dd0('0x61')),_0x4dd0('0x57'));var _0x1dac14=ejs[_0x4dd0('0x58')](_0x15c603,{'networks':_0x4af740||[]});fs[_0x4dd0('0x59')](util[_0x4dd0('0x62')](_0x4dd0('0x69'),_0x1f2471[_0x4dd0('0x52')][_0x4dd0('0x35')][_0x4dd0('0x63')]()),_0x1dac14);return respondWithRpcPromise(_0x4dd0('0x5b'),_0x4dd0('0x65'),{'module':_0x4dd0('0x64')});}return null;})['then'](function(_0x3610e5){if(_0x3610e5){return _0x5c11f0;}return null;});})[_0x4dd0('0x2f')](respondWithResult(_0x4a9647,null))[_0x4dd0('0x24')](handleError(_0x4a9647,null));};exports['destroy']=function(_0x4e89bb,_0x1af00d,_0x5180e3){var _0xdc7ba;return db[_0x4dd0('0x48')][_0x4dd0('0x4f')]({'where':{'id':_0x4e89bb[_0x4dd0('0x4c')]['id']}})['then'](function(_0x12ae14){_0xdc7ba=_0x12ae14;return _0x12ae14;})[_0x4dd0('0x2f')](handleEntityNotFound(_0x1af00d,null))[_0x4dd0('0x2f')](removeEntity(_0x1af00d,null))[_0x4dd0('0x2f')](function(){if(_0xdc7ba){return db['Network']['findAll']({'where':{'type':_0xdc7ba[_0x4dd0('0x35')]},'raw':!![]});}})['then'](function(_0x452ee6){if(_0xdc7ba['type'][_0x4dd0('0x5d')]()==_0x4dd0('0x54')){var _0x323560=fs[_0x4dd0('0x60')](path[_0x4dd0('0x55')](config[_0x4dd0('0x56')],_0x4dd0('0x67')),_0x4dd0('0x57'));var _0x156a2d=ejs[_0x4dd0('0x58')](_0x323560,{'networks':_0x452ee6||[]});fs[_0x4dd0('0x59')](_0x4dd0('0x5a'),_0x156a2d);return respondWithRpcPromise('Reload',_0x4dd0('0x30'),{'module':'res_stun_monitor.so'});}else if(_0xdc7ba[_0x4dd0('0x35')][_0x4dd0('0x5d')]()==_0x4dd0('0x5e')){var _0x4b0a18=fs[_0x4dd0('0x60')](path[_0x4dd0('0x55')](config[_0x4dd0('0x56')],'server/files/templates/turn_multiple.ejs'),_0x4dd0('0x57'));var _0x1f0b4e=ejs[_0x4dd0('0x58')](_0x4b0a18,{'networks':_0x452ee6||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x1f0b4e);return respondWithRpcPromise(_0x4dd0('0x5b'),_0x4dd0('0x30'),{'module':_0x4dd0('0x5c')});}else{var _0x712d01=fs[_0x4dd0('0x60')](path[_0x4dd0('0x55')](config['root'],'server/files/templates/network.ejs'),_0x4dd0('0x57'));var _0xf527ed=ejs[_0x4dd0('0x58')](_0x712d01,{'networks':_0x452ee6||[]});fs[_0x4dd0('0x59')](util[_0x4dd0('0x62')](_0x4dd0('0x69'),_0x4e89bb[_0x4dd0('0x52')][_0x4dd0('0x35')][_0x4dd0('0x63')]()),_0xf527ed);return respondWithRpcPromise(_0x4dd0('0x5b'),_0x4dd0('0x30'),{'module':_0x4dd0('0x64')});}return null;})['catch'](handleError(_0x1af00d,null));}; \ No newline at end of file +var _0xd6d2=['jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','info','Network,\x20%s,\x20%s','debug','error','code','message','request\x20sent','result','catch','end','status','offset','undefined','limit','count','json','apply','reject','update','then','destroy','sendStatus','stack','name','send','index','map','Network','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','params','find','create','sequelize','transaction','body','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','render','writeFileSync','res_stun_monitor.so','TURN','utf8','/etc/asterisk/turn_xcally.conf','Reload','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','chan_sip.so','/etc/asterisk/stun_xcally.conf','server/files/templates/turn_multiple.ejs','toLowerCase','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto'];(function(_0x535ca6,_0x30ed67){var _0x4e78a8=function(_0x4c83a3){while(--_0x4c83a3){_0x535ca6['push'](_0x535ca6['shift']());}};_0x4e78a8(++_0x30ed67);}(_0xd6d2,0xcb));var _0x2d6d=function(_0x183843,_0x211b10){_0x183843=_0x183843-0x0;var _0x27f65e=_0xd6d2[_0x183843];return _0x27f65e;};'use strict';var emlformat=require(_0x2d6d('0x0'));var rimraf=require(_0x2d6d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2d6d('0x2'));var rp=require(_0x2d6d('0x3'));var moment=require('moment');var BPromise=require(_0x2d6d('0x4'));var Mustache=require('mustache');var util=require(_0x2d6d('0x5'));var path=require(_0x2d6d('0x6'));var sox=require(_0x2d6d('0x7'));var csv=require('to-csv');var ejs=require(_0x2d6d('0x8'));var fs=require('fs');var fs_extra=require(_0x2d6d('0x9'));var _=require(_0x2d6d('0xa'));var squel=require(_0x2d6d('0xb'));var crypto=require(_0x2d6d('0xc'));var jsforce=require(_0x2d6d('0xd'));var deskjs=require(_0x2d6d('0xe'));var toCsv=require(_0x2d6d('0xf'));var querystring=require(_0x2d6d('0x10'));var Papa=require(_0x2d6d('0x11'));var Redis=require(_0x2d6d('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x2d6d('0x13'));var as=require(_0x2d6d('0x14'));var hardwareService=require(_0x2d6d('0x15'));var logger=require(_0x2d6d('0x16'))(_0x2d6d('0x17'));var utils=require('../../config/utils');var config=require(_0x2d6d('0x18'));var licenseUtil=require(_0x2d6d('0x19'));var db=require(_0x2d6d('0x1a'))['db'];var jayson=require(_0x2d6d('0x1b'));var client=jayson[_0x2d6d('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a2275,_0x156188,_0x46c909,_0x3528de){return new BPromise(function(_0x58bd29,_0x1ec6aa){var _0x40a6a9=_0x3528de||client;return _0x40a6a9['request'](_0x1a2275,_0x46c909)['then'](function(_0x370096){logger[_0x2d6d('0x1d')](_0x2d6d('0x1e'),_0x156188,'request\x20sent');logger[_0x2d6d('0x1f')]('Network,\x20%s,\x20%s,\x20%s',_0x156188,'request\x20sent',JSON['stringify'](_0x370096));if(_0x370096[_0x2d6d('0x20')]){if(_0x370096[_0x2d6d('0x20')][_0x2d6d('0x21')]===0x1f4){logger[_0x2d6d('0x20')](_0x2d6d('0x1e'),_0x156188,_0x370096[_0x2d6d('0x20')][_0x2d6d('0x22')]);return _0x1ec6aa(_0x370096[_0x2d6d('0x20')][_0x2d6d('0x22')]);}logger['error'](_0x2d6d('0x1e'),_0x156188,_0x370096[_0x2d6d('0x20')]['message']);return _0x58bd29(_0x370096[_0x2d6d('0x20')][_0x2d6d('0x22')]);}else{logger[_0x2d6d('0x1d')](_0x2d6d('0x1e'),_0x156188,_0x2d6d('0x23'));_0x58bd29(_0x370096[_0x2d6d('0x24')]['message']);}})[_0x2d6d('0x25')](function(_0xe6e992){logger[_0x2d6d('0x20')]('Network,\x20%s,\x20%s',_0x156188,_0xe6e992);_0x1ec6aa(_0xe6e992);});});}function respondWithStatusCode(_0x47eb0e,_0x3ae8ad){_0x3ae8ad=_0x3ae8ad||0xcc;return function(_0x4e7ec8){if(_0x4e7ec8){return _0x47eb0e['sendStatus'](_0x3ae8ad);}return _0x47eb0e['status'](_0x3ae8ad)[_0x2d6d('0x26')]();};}function respondWithResult(_0xaca9c7,_0x3da83d){_0x3da83d=_0x3da83d||0xc8;return function(_0x3f89dd){if(_0x3f89dd){return _0xaca9c7[_0x2d6d('0x27')](_0x3da83d)['json'](_0x3f89dd);}};}function respondWithFilteredResult(_0x16634d,_0x1b4964){return function(_0x455e71){if(_0x455e71){var _0x1a9aff=typeof _0x1b4964[_0x2d6d('0x28')]===_0x2d6d('0x29')&&typeof _0x1b4964[_0x2d6d('0x2a')]===_0x2d6d('0x29');var _0x27b7d2=_0x455e71['count'];var _0x1016e1=_0x1a9aff?0x0:_0x1b4964[_0x2d6d('0x28')];var _0x2e7b32=_0x1a9aff?_0x455e71[_0x2d6d('0x2b')]:_0x1b4964['offset']+_0x1b4964[_0x2d6d('0x2a')];var _0x49bb56;if(_0x2e7b32>=_0x27b7d2){_0x2e7b32=_0x27b7d2;_0x49bb56=0xc8;}else{_0x49bb56=0xce;}_0x16634d[_0x2d6d('0x27')](_0x49bb56);return _0x16634d['set']('Content-Range',_0x1016e1+'-'+_0x2e7b32+'/'+_0x27b7d2)[_0x2d6d('0x2c')](_0x455e71);}return null;};}function patchUpdates(_0x557ad8){return function(_0x2fe536){try{jsonpatch[_0x2d6d('0x2d')](_0x2fe536,_0x557ad8,!![]);}catch(_0x479320){return BPromise[_0x2d6d('0x2e')](_0x479320);}return _0x2fe536['save']();};}function saveUpdates(_0xfbf3dc,_0x422153){return function(_0xafd15a){if(_0xafd15a){return _0xafd15a[_0x2d6d('0x2f')](_0xfbf3dc)[_0x2d6d('0x30')](function(_0x29394e){return _0x29394e;});}return null;};}function removeEntity(_0x27ac32,_0x3450fc){return function(_0x598d8b){if(_0x598d8b){return _0x598d8b[_0x2d6d('0x31')]()[_0x2d6d('0x30')](function(){_0x27ac32['status'](0xcc)[_0x2d6d('0x26')]();});}};}function handleEntityNotFound(_0xf2b497,_0x1d363a){return function(_0x3aed80){if(!_0x3aed80){_0xf2b497[_0x2d6d('0x32')](0x194);}return _0x3aed80;};}function handleError(_0x4b2c0a,_0x4c8fc1){_0x4c8fc1=_0x4c8fc1||0x1f4;return function(_0x512615){logger[_0x2d6d('0x20')](_0x512615[_0x2d6d('0x33')]);if(_0x512615[_0x2d6d('0x34')]){delete _0x512615['name'];}_0x4b2c0a[_0x2d6d('0x27')](_0x4c8fc1)[_0x2d6d('0x35')](_0x512615);};}exports[_0x2d6d('0x36')]=function(_0x2eaf46,_0x4b416b){var _0x78354={},_0x2bdc1b={},_0x23cc39={'count':0x0,'rows':[]};var _0x15f9af=_[_0x2d6d('0x37')](db[_0x2d6d('0x38')][_0x2d6d('0x39')],function(_0x5b0674){return{'name':_0x5b0674[_0x2d6d('0x3a')],'type':_0x5b0674[_0x2d6d('0x3b')][_0x2d6d('0x3c')]};});_0x2bdc1b[_0x2d6d('0x3d')]=_[_0x2d6d('0x37')](_0x15f9af,'name');_0x2bdc1b[_0x2d6d('0x3e')]=_[_0x2d6d('0x3f')](_0x2eaf46[_0x2d6d('0x3e')]);_0x2bdc1b[_0x2d6d('0x40')]=_[_0x2d6d('0x41')](_0x2bdc1b[_0x2d6d('0x3d')],_0x2bdc1b[_0x2d6d('0x3e')]);_0x78354[_0x2d6d('0x42')]=_[_0x2d6d('0x41')](_0x2bdc1b[_0x2d6d('0x3d')],qs[_0x2d6d('0x43')](_0x2eaf46[_0x2d6d('0x3e')][_0x2d6d('0x43')]));_0x78354[_0x2d6d('0x42')]=_0x78354[_0x2d6d('0x42')][_0x2d6d('0x44')]?_0x78354[_0x2d6d('0x42')]:_0x2bdc1b['model'];if(!_0x2eaf46[_0x2d6d('0x3e')][_0x2d6d('0x45')](_0x2d6d('0x46'))){_0x78354[_0x2d6d('0x2a')]=qs[_0x2d6d('0x2a')](_0x2eaf46['query'][_0x2d6d('0x2a')]);_0x78354[_0x2d6d('0x28')]=qs[_0x2d6d('0x28')](_0x2eaf46[_0x2d6d('0x3e')]['offset']);}_0x78354[_0x2d6d('0x47')]=qs[_0x2d6d('0x48')](_0x2eaf46[_0x2d6d('0x3e')][_0x2d6d('0x48')]);_0x78354[_0x2d6d('0x49')]=qs['filters'](_[_0x2d6d('0x4a')](_0x2eaf46[_0x2d6d('0x3e')],_0x2bdc1b['filters']),_0x15f9af);if(_0x2eaf46[_0x2d6d('0x3e')][_0x2d6d('0x4b')]){_0x78354[_0x2d6d('0x49')]=_['merge'](_0x78354[_0x2d6d('0x49')],{'$or':_[_0x2d6d('0x37')](_0x15f9af,function(_0x552129){if(_0x552129['type']!=='VIRTUAL'){var _0x7d85d6={};_0x7d85d6[_0x552129[_0x2d6d('0x34')]]={'$like':'%'+_0x2eaf46['query'][_0x2d6d('0x4b')]+'%'};return _0x7d85d6;}})});}_0x78354=_[_0x2d6d('0x4c')]({},_0x78354,_0x2eaf46[_0x2d6d('0x4d')]);var _0x470fb5={'where':_0x78354['where']};return db[_0x2d6d('0x38')][_0x2d6d('0x2b')](_0x470fb5)['then'](function(_0x322f48){_0x23cc39[_0x2d6d('0x2b')]=_0x322f48;if(_0x2eaf46[_0x2d6d('0x3e')][_0x2d6d('0x4e')]){_0x78354[_0x2d6d('0x4f')]=[{'all':!![]}];}return db[_0x2d6d('0x38')][_0x2d6d('0x50')](_0x78354);})['then'](function(_0xe6b038){_0x23cc39[_0x2d6d('0x51')]=_0xe6b038;return _0x23cc39;})[_0x2d6d('0x30')](respondWithFilteredResult(_0x4b416b,_0x78354))['catch'](handleError(_0x4b416b,null));};exports['show']=function(_0xa7300,_0x3f600b){var _0x422198={'raw':!![],'where':{'id':_0xa7300[_0x2d6d('0x52')]['id']}},_0x4e5203={};_0x4e5203[_0x2d6d('0x3d')]=_['keys'](db[_0x2d6d('0x38')][_0x2d6d('0x39')]);_0x4e5203[_0x2d6d('0x3e')]=_[_0x2d6d('0x3f')](_0xa7300[_0x2d6d('0x3e')]);_0x4e5203[_0x2d6d('0x40')]=_[_0x2d6d('0x41')](_0x4e5203[_0x2d6d('0x3d')],_0x4e5203[_0x2d6d('0x3e')]);_0x422198[_0x2d6d('0x42')]=_['intersection'](_0x4e5203[_0x2d6d('0x3d')],qs[_0x2d6d('0x43')](_0xa7300[_0x2d6d('0x3e')]['fields']));_0x422198[_0x2d6d('0x42')]=_0x422198[_0x2d6d('0x42')][_0x2d6d('0x44')]?_0x422198[_0x2d6d('0x42')]:_0x4e5203[_0x2d6d('0x3d')];if(_0xa7300[_0x2d6d('0x3e')][_0x2d6d('0x4e')]){_0x422198['include']=[{'all':!![]}];}_0x422198=_[_0x2d6d('0x4c')]({},_0x422198,_0xa7300[_0x2d6d('0x4d')]);return db['Network'][_0x2d6d('0x53')](_0x422198)[_0x2d6d('0x30')](handleEntityNotFound(_0x3f600b,null))['then'](respondWithResult(_0x3f600b,null))[_0x2d6d('0x25')](handleError(_0x3f600b,null));};exports[_0x2d6d('0x54')]=function(_0x5102de,_0x8cf75,_0x1af749){var _0xe2c5d8;return db[_0x2d6d('0x55')][_0x2d6d('0x56')](function(_0x18cccb){return db[_0x2d6d('0x38')]['create'](_0x5102de['body'],{'raw':!![]})[_0x2d6d('0x30')](function(_0x5ac91b){_0xe2c5d8=_0x5ac91b;return db[_0x2d6d('0x38')][_0x2d6d('0x50')]({'where':{'type':_0x5102de[_0x2d6d('0x57')]['type']},'raw':!![]});})[_0x2d6d('0x30')](function(_0x49cd6f){if(_0xe2c5d8[_0x2d6d('0x3b')][_0x2d6d('0x58')]()==_0x2d6d('0x59')){var _0xe75206=fs[_0x2d6d('0x5a')](path[_0x2d6d('0x5b')](config[_0x2d6d('0x5c')],_0x2d6d('0x5d')),'utf8');var _0x33d375=ejs[_0x2d6d('0x5e')](_0xe75206,{'networks':_0x49cd6f||[]});fs[_0x2d6d('0x5f')]('/etc/asterisk/stun_xcally.conf',_0x33d375);return respondWithRpcPromise('Reload','create',{'module':_0x2d6d('0x60')});}else if(_0xe2c5d8['type'][_0x2d6d('0x58')]()==_0x2d6d('0x61')){var _0x1dacbf=fs[_0x2d6d('0x5a')](path[_0x2d6d('0x5b')](config[_0x2d6d('0x5c')],'server/files/templates/turn_multiple.ejs'),_0x2d6d('0x62'));var _0x389d3a=ejs[_0x2d6d('0x5e')](_0x1dacbf,{'networks':_0x49cd6f||[]});fs[_0x2d6d('0x5f')](_0x2d6d('0x63'),_0x389d3a);return respondWithRpcPromise(_0x2d6d('0x64'),'create',{'module':_0x2d6d('0x60')});}else{var _0x3535af=fs[_0x2d6d('0x5a')](path[_0x2d6d('0x5b')](config['root'],_0x2d6d('0x65')),_0x2d6d('0x62'));var _0xb7ae2b=ejs['render'](_0x3535af,{'networks':_0x49cd6f||[]});fs[_0x2d6d('0x5f')](util[_0x2d6d('0x66')](_0x2d6d('0x67'),_0x5102de['body'][_0x2d6d('0x3b')]['toLowerCase']()),_0xb7ae2b);return respondWithRpcPromise(_0x2d6d('0x64'),_0x2d6d('0x54'),{'module':_0x2d6d('0x68')});}return null;})[_0x2d6d('0x30')](function(){return _0xe2c5d8;});})[_0x2d6d('0x30')](respondWithResult(_0x8cf75,0xc9))[_0x2d6d('0x25')](handleError(_0x8cf75,null));};exports[_0x2d6d('0x2f')]=function(_0x1021f0,_0x4b046a,_0x3ef8b1){var _0x19926c;return db[_0x2d6d('0x55')][_0x2d6d('0x56')](function(_0x2145ea){return db['Network'][_0x2d6d('0x53')]({'where':{'id':_0x1021f0['params']['id']}})[_0x2d6d('0x30')](handleEntityNotFound(_0x4b046a,null))[_0x2d6d('0x30')](saveUpdates(_0x1021f0[_0x2d6d('0x57')],null))[_0x2d6d('0x30')](function(_0x200ef4){if(_0x200ef4){_0x19926c=_0x200ef4;return db[_0x2d6d('0x38')][_0x2d6d('0x50')]({'where':{'type':_0x19926c[_0x2d6d('0x3b')]},'raw':!![]});}return null;})['then'](function(_0x2a4f38){if(_0x19926c[_0x2d6d('0x3b')][_0x2d6d('0x58')]()==_0x2d6d('0x59')){var _0x18904a=fs['readFileSync'](path['join'](config['root'],_0x2d6d('0x5d')),_0x2d6d('0x62'));var _0x13f041=ejs[_0x2d6d('0x5e')](_0x18904a,{'networks':_0x2a4f38||[]});fs[_0x2d6d('0x5f')](_0x2d6d('0x69'),_0x13f041);return respondWithRpcPromise(_0x2d6d('0x64'),_0x2d6d('0x2f'),{'module':_0x2d6d('0x60')});}else if(_0x19926c['type'][_0x2d6d('0x58')]()=='TURN'){var _0x5c071f=fs[_0x2d6d('0x5a')](path[_0x2d6d('0x5b')](config[_0x2d6d('0x5c')],_0x2d6d('0x6a')),_0x2d6d('0x62'));var _0x4d0f9b=ejs[_0x2d6d('0x5e')](_0x5c071f,{'networks':_0x2a4f38||[]});fs[_0x2d6d('0x5f')]('/etc/asterisk/turn_xcally.conf',_0x4d0f9b);return respondWithRpcPromise(_0x2d6d('0x64'),_0x2d6d('0x2f'),{'module':_0x2d6d('0x60')});}else{var _0x1e5e40=fs[_0x2d6d('0x5a')](path['join'](config[_0x2d6d('0x5c')],_0x2d6d('0x65')),_0x2d6d('0x62'));var _0x609d97=ejs[_0x2d6d('0x5e')](_0x1e5e40,{'networks':_0x2a4f38||[]});fs[_0x2d6d('0x5f')](util[_0x2d6d('0x66')](_0x2d6d('0x67'),_0x1021f0['body'][_0x2d6d('0x3b')][_0x2d6d('0x6b')]()),_0x609d97);return respondWithRpcPromise(_0x2d6d('0x64'),_0x2d6d('0x2f'),{'module':'chan_sip.so'});}return null;})[_0x2d6d('0x30')](function(_0x4cc4c2){if(_0x4cc4c2){return _0x19926c;}return null;});})['then'](respondWithResult(_0x4b046a,null))['catch'](handleError(_0x4b046a,null));};exports['destroy']=function(_0x54b0e0,_0x3b07e5,_0x309a9c){var _0x32dd62;return db[_0x2d6d('0x38')][_0x2d6d('0x53')]({'where':{'id':_0x54b0e0[_0x2d6d('0x52')]['id']}})[_0x2d6d('0x30')](function(_0x5c4d32){_0x32dd62=_0x5c4d32;return _0x5c4d32;})[_0x2d6d('0x30')](handleEntityNotFound(_0x3b07e5,null))[_0x2d6d('0x30')](removeEntity(_0x3b07e5,null))['then'](function(){if(_0x32dd62){return db[_0x2d6d('0x38')][_0x2d6d('0x50')]({'where':{'type':_0x32dd62['type']},'raw':!![]});}})[_0x2d6d('0x30')](function(_0x3c2ccd){if(_0x32dd62[_0x2d6d('0x3b')]['toUpperCase']()==_0x2d6d('0x59')){var _0x45ad0a=fs[_0x2d6d('0x5a')](path[_0x2d6d('0x5b')](config[_0x2d6d('0x5c')],'server/files/templates/stun_multiple.ejs'),_0x2d6d('0x62'));var _0x5de755=ejs[_0x2d6d('0x5e')](_0x45ad0a,{'networks':_0x3c2ccd||[]});fs[_0x2d6d('0x5f')](_0x2d6d('0x69'),_0x5de755);return respondWithRpcPromise('Reload','destroy',{'module':_0x2d6d('0x60')});}else if(_0x32dd62[_0x2d6d('0x3b')]['toUpperCase']()==_0x2d6d('0x61')){var _0x1080a9=fs['readFileSync'](path[_0x2d6d('0x5b')](config[_0x2d6d('0x5c')],_0x2d6d('0x6a')),_0x2d6d('0x62'));var _0x314d98=ejs[_0x2d6d('0x5e')](_0x1080a9,{'networks':_0x3c2ccd||[]});fs['writeFileSync'](_0x2d6d('0x63'),_0x314d98);return respondWithRpcPromise(_0x2d6d('0x64'),_0x2d6d('0x31'),{'module':_0x2d6d('0x60')});}else{var _0x547272=fs[_0x2d6d('0x5a')](path['join'](config[_0x2d6d('0x5c')],'server/files/templates/network.ejs'),_0x2d6d('0x62'));var _0x264d57=ejs['render'](_0x547272,{'networks':_0x3c2ccd||[]});fs[_0x2d6d('0x5f')](util['format'](_0x2d6d('0x67'),_0x54b0e0['body']['type'][_0x2d6d('0x6b')]()),_0x264d57);return respondWithRpcPromise(_0x2d6d('0x64'),'destroy',{'module':_0x2d6d('0x68')});}return null;})[_0x2d6d('0x25')](handleError(_0x3b07e5,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 41a1e23..4cea5d6 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 _0x6282=['api','request-promise','path','../../config/environment','./network.attributes','exports','Network','network','lodash','util','../../config/logger'];(function(_0x54aec8,_0x64c352){var _0x5e5c05=function(_0x3727a1){while(--_0x3727a1){_0x54aec8['push'](_0x54aec8['shift']());}};_0x5e5c05(++_0x64c352);}(_0x6282,0x76));var _0x2628=function(_0x130d63,_0x1596ee){_0x130d63=_0x130d63-0x0;var _0x583763=_0x6282[_0x130d63];return _0x583763;};'use strict';var _=require(_0x2628('0x0'));var util=require(_0x2628('0x1'));var logger=require(_0x2628('0x2'))(_0x2628('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2628('0x4'));var fs=require('fs');var path=require(_0x2628('0x5'));var rimraf=require('rimraf');var config=require(_0x2628('0x6'));var attributes=require(_0x2628('0x7'));module[_0x2628('0x8')]=function(_0x47102a,_0x128d3a){return _0x47102a['define'](_0x2628('0x9'),attributes,{'tableName':_0x2628('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x593e=['path','../../config/environment','./network.attributes','exports','define','Network','network','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x36d1b6,_0x1903ba){var _0x33cbe4=function(_0x54e788){while(--_0x54e788){_0x36d1b6['push'](_0x36d1b6['shift']());}};_0x33cbe4(++_0x1903ba);}(_0x593e,0xcb));var _0xe593=function(_0x457bb0,_0x3dbd58){_0x457bb0=_0x457bb0-0x0;var _0x11e64c=_0x593e[_0x457bb0];return _0x11e64c;};'use strict';var _=require(_0xe593('0x0'));var util=require(_0xe593('0x1'));var logger=require(_0xe593('0x2'))(_0xe593('0x3'));var moment=require(_0xe593('0x4'));var BPromise=require(_0xe593('0x5'));var rp=require(_0xe593('0x6'));var fs=require('fs');var path=require(_0xe593('0x7'));var rimraf=require('rimraf');var config=require(_0xe593('0x8'));var attributes=require(_0xe593('0x9'));module[_0xe593('0xa')]=function(_0x1e50d3,_0x3b7082){return _0x1e50d3[_0xe593('0xb')](_0xe593('0xc'),attributes,{'tableName':_0xe593('0xd'),'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 004d7a6..8d75119 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7a54,0x106));var _0x47a5=function(_0x3245e0,_0xed3ed6){_0x3245e0=_0x3245e0-0x0;var _0x34e88b=_0x7a54[_0x3245e0];return _0x34e88b;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x118b1a,_0x12693c){var _0x2ba1d3=function(_0x48b1ae){while(--_0x48b1ae){_0x118b1a['push'](_0x118b1a['shift']());}};_0x2ba1d3(++_0x12693c);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index f7330f9..4769a0f 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 _0x3efb=['getApplications','/:id/interactions','getInteractions','post','addDisposition','addAnswer','/:id/notify','notify','/:id/users','addAgents','send','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelAccount.controller','isAuthenticated','index','get','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/applications'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x3efb,0x15f));var _0xb3ef=function(_0x2e04ef,_0x31a596){_0x2e04ef=_0x2e04ef-0x0;var _0x5722b0=_0x3efb[_0x2e04ef];return _0x5722b0;};'use strict';var multer=require(_0xb3ef('0x0'));var util=require('util');var path=require(_0xb3ef('0x1'));var timeout=require(_0xb3ef('0x2'));var express=require(_0xb3ef('0x3'));var router=express[_0xb3ef('0x4')]();var fs_extra=require(_0xb3ef('0x5'));var auth=require(_0xb3ef('0x6'));var interaction=require(_0xb3ef('0x7'));var config=require('../../config/environment');var controller=require(_0xb3ef('0x8'));router['get']('/',auth[_0xb3ef('0x9')](),controller[_0xb3ef('0xa')]);router[_0xb3ef('0xb')]('/describe',auth['isAuthenticated'](),controller[_0xb3ef('0xc')]);router['get'](_0xb3ef('0xd'),auth[_0xb3ef('0x9')](),controller[_0xb3ef('0xe')]);router['get'](_0xb3ef('0xf'),auth[_0xb3ef('0x9')](),controller[_0xb3ef('0x10')]);router[_0xb3ef('0xb')](_0xb3ef('0x11'),auth[_0xb3ef('0x9')](),controller['getAnswers']);router['get'](_0xb3ef('0x12'),auth[_0xb3ef('0x9')](),controller[_0xb3ef('0x13')]);router[_0xb3ef('0xb')](_0xb3ef('0x14'),auth[_0xb3ef('0x9')](),controller[_0xb3ef('0x15')]);router[_0xb3ef('0xb')]('/:id/users',auth[_0xb3ef('0x9')](),controller['getAgents']);router[_0xb3ef('0x16')]('/',auth[_0xb3ef('0x9')](),controller['create']);router[_0xb3ef('0x16')](_0xb3ef('0xf'),auth[_0xb3ef('0x9')](),controller[_0xb3ef('0x17')]);router['post'](_0xb3ef('0x11'),auth[_0xb3ef('0x9')](),controller[_0xb3ef('0x18')]);router[_0xb3ef('0x16')](_0xb3ef('0x19'),controller[_0xb3ef('0x1a')]);router[_0xb3ef('0x16')]('/:id/applications',auth[_0xb3ef('0x9')](),controller['addApplications']);router['post'](_0xb3ef('0x1b'),auth[_0xb3ef('0x9')](),controller[_0xb3ef('0x1c')]);router[_0xb3ef('0x16')]('/:id/send',auth[_0xb3ef('0x9')](),controller[_0xb3ef('0x1d')]);router[_0xb3ef('0x1e')](_0xb3ef('0xd'),auth[_0xb3ef('0x9')](),controller[_0xb3ef('0x1f')]);router[_0xb3ef('0x20')](_0xb3ef('0xd'),auth[_0xb3ef('0x9')](),controller[_0xb3ef('0x21')]);router[_0xb3ef('0x20')](_0xb3ef('0xf'),auth[_0xb3ef('0x9')](),controller[_0xb3ef('0x22')]);router['delete']('/:id/canned_answers',auth[_0xb3ef('0x9')](),controller[_0xb3ef('0x23')]);router[_0xb3ef('0x20')](_0xb3ef('0x1b'),auth[_0xb3ef('0x9')](),controller[_0xb3ef('0x24')]);module['exports']=router; \ No newline at end of file +var _0xfe0f=['/:id/canned_answers','addAnswer','addApplications','addAgents','/:id/send','send','put','/:id','update','delete','removeDispositions','removeAnswers','/:id/users','removeAgents','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','show','/:id/dispositions','getAnswers','/:id/applications','getApplications','getInteractions','getAgents','post','create','addDisposition'];(function(_0xc73724,_0x163a90){var _0x3960fa=function(_0x928fd){while(--_0x928fd){_0xc73724['push'](_0xc73724['shift']());}};_0x3960fa(++_0x163a90);}(_0xfe0f,0x11e));var _0xffe0=function(_0x2054f2,_0x39dd16){_0x2054f2=_0x2054f2-0x0;var _0x2a1701=_0xfe0f[_0x2054f2];return _0x2a1701;};'use strict';var multer=require(_0xffe0('0x0'));var util=require(_0xffe0('0x1'));var path=require(_0xffe0('0x2'));var timeout=require(_0xffe0('0x3'));var express=require(_0xffe0('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xffe0('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xffe0('0x6'));var controller=require('./openchannelAccount.controller');router[_0xffe0('0x7')]('/',auth[_0xffe0('0x8')](),controller['index']);router[_0xffe0('0x7')](_0xffe0('0x9'),auth[_0xffe0('0x8')](),controller['describe']);router['get']('/:id',auth[_0xffe0('0x8')](),controller[_0xffe0('0xa')]);router[_0xffe0('0x7')](_0xffe0('0xb'),auth[_0xffe0('0x8')](),controller['getDispositions']);router[_0xffe0('0x7')]('/:id/canned_answers',auth[_0xffe0('0x8')](),controller[_0xffe0('0xc')]);router[_0xffe0('0x7')](_0xffe0('0xd'),auth['isAuthenticated'](),controller[_0xffe0('0xe')]);router[_0xffe0('0x7')]('/:id/interactions',auth[_0xffe0('0x8')](),controller[_0xffe0('0xf')]);router[_0xffe0('0x7')]('/:id/users',auth[_0xffe0('0x8')](),controller[_0xffe0('0x10')]);router[_0xffe0('0x11')]('/',auth[_0xffe0('0x8')](),controller[_0xffe0('0x12')]);router['post']('/:id/dispositions',auth[_0xffe0('0x8')](),controller[_0xffe0('0x13')]);router[_0xffe0('0x11')](_0xffe0('0x14'),auth['isAuthenticated'](),controller[_0xffe0('0x15')]);router[_0xffe0('0x11')]('/:id/notify',controller['notify']);router[_0xffe0('0x11')](_0xffe0('0xd'),auth[_0xffe0('0x8')](),controller[_0xffe0('0x16')]);router['post']('/:id/users',auth['isAuthenticated'](),controller[_0xffe0('0x17')]);router['post'](_0xffe0('0x18'),auth[_0xffe0('0x8')](),controller[_0xffe0('0x19')]);router[_0xffe0('0x1a')](_0xffe0('0x1b'),auth[_0xffe0('0x8')](),controller[_0xffe0('0x1c')]);router[_0xffe0('0x1d')]('/:id',auth[_0xffe0('0x8')](),controller['destroy']);router[_0xffe0('0x1d')](_0xffe0('0xb'),auth[_0xffe0('0x8')](),controller[_0xffe0('0x1e')]);router[_0xffe0('0x1d')](_0xffe0('0x14'),auth['isAuthenticated'](),controller[_0xffe0('0x1f')]);router[_0xffe0('0x1d')](_0xffe0('0x20'),auth[_0xffe0('0x8')](),controller[_0xffe0('0x21')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 0b4b9d1..f0630a0 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 _0x5518=['sequelize','randomstring','STRING','name','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition'];(function(_0x4709ec,_0xacfb52){var _0x5641c6=function(_0x4eb158){while(--_0x4eb158){_0x4709ec['push'](_0x4709ec['shift']());}};_0x5641c6(++_0xacfb52);}(_0x5518,0x129));var _0x8551=function(_0x524962,_0x1c6d9c){_0x524962=_0x524962-0x0;var _0x569e0c=_0x5518[_0x524962];return _0x569e0c;};'use strict';var Sequelize=require(_0x8551('0x0'));var rs=require(_0x8551('0x1'));module['exports']={'name':{'type':Sequelize[_0x8551('0x2')],'unique':_0x8551('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x8551('0x2')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x8551('0x4')],'defaultValue':function(){return _0x8551('0x5');}},'notificationSound':{'type':Sequelize[_0x8551('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x8551('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8551('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8551('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8551('0x7')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x8551('0x6')],'defaultValue':![],'comment':_0x8551('0x8'),'set':function(_0x241a1b){if(!_0x241a1b)this[_0x8551('0x9')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0x8551('0xa'),_0x241a1b);}}}; \ No newline at end of file +var _0xe296=['sequelize','randomstring','exports','name','STRING','generate','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0xe296,0xd2));var _0x6e29=function(_0xa4486b,_0x573f1e){_0xa4486b=_0xa4486b-0x0;var _0x5dabeb=_0xe296[_0xa4486b];return _0x5dabeb;};'use strict';var Sequelize=require(_0x6e29('0x0'));var rs=require(_0x6e29('0x1'));module[_0x6e29('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x6e29('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x6e29('0x4')],'defaultValue':function(){return rs[_0x6e29('0x5')]();}},'replyUri':{'type':Sequelize[_0x6e29('0x4')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x6e29('0x4')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x6e29('0x6');}},'notificationSound':{'type':Sequelize[_0x6e29('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6e29('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x6e29('0x4')]},'queueTransfer':{'type':Sequelize[_0x6e29('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6e29('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6e29('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6e29('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x6e29('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x6e29('0x7')],'defaultValue':![],'comment':_0x6e29('0xa'),'set':function(_0x34d0f8){if(!_0x34d0f8)this['setDataValue'](_0x6e29('0xb'),null);this[_0x6e29('0xc')](_0x6e29('0xd'),_0x34d0f8);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 88cdea9..ac91570 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 _0xb121=['account','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','autoclose','*,*,*,*','OpenchannelMessage','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','addApplications','sequelize','ISOLATION_LEVELS','OpenchannelApplication','bulkCreate','finally','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','tag','addAgents','omit','emit','removeAgents','isArray','getAgents','out','Messages','dataValues','push','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','ioredis','../../components/parsers/qs','../../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','http','request','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','destroy','stack','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','type','key','model','name','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','show','params','keys','find','create','body','user','get','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','OpenchannelAccountId','Disposition','getDispositions','findOne','findAll','removeDispositions','ids','CannedAnswer','hasOwnProperty','rows','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','ListId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','Contacts','DESC','List','applications','orderBy','priority','asc','Applications'];(function(_0x2ff94d,_0x4ae852){var _0xa9375a=function(_0x4a365c){while(--_0x4a365c){_0x2ff94d['push'](_0x2ff94d['shift']());}};_0xa9375a(++_0x4ae852);}(_0xb121,0x1a3));var _0x1b12=function(_0x2a2e17,_0x631489){_0x2a2e17=_0x2a2e17-0x0;var _0x12d4cb=_0xb121[_0x2a2e17];return _0x12d4cb;};'use strict';var emlformat=require(_0x1b12('0x0'));var rimraf=require(_0x1b12('0x1'));var zipdir=require(_0x1b12('0x2'));var jsonpatch=require(_0x1b12('0x3'));var rp=require(_0x1b12('0x4'));var moment=require(_0x1b12('0x5'));var BPromise=require(_0x1b12('0x6'));var Mustache=require(_0x1b12('0x7'));var util=require(_0x1b12('0x8'));var path=require(_0x1b12('0x9'));var sox=require(_0x1b12('0xa'));var csv=require('to-csv');var ejs=require(_0x1b12('0xb'));var fs=require('fs');var fs_extra=require(_0x1b12('0xc'));var _=require(_0x1b12('0xd'));var squel=require('squel');var crypto=require(_0x1b12('0xe'));var jsforce=require(_0x1b12('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x1b12('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1b12('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1b12('0x12'));var as=require(_0x1b12('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1b12('0x14'))(_0x1b12('0x15'));var utils=require(_0x1b12('0x16'));var config=require(_0x1b12('0x17'));var licenseUtil=require(_0x1b12('0x18'));var db=require(_0x1b12('0x19'))['db'];config[_0x1b12('0x1a')]=_[_0x1b12('0x1b')](config[_0x1b12('0x1a')],{'host':_0x1b12('0x1c'),'port':0x18eb});var socket=require(_0x1b12('0x1d'))(new Redis(config[_0x1b12('0x1a')]));require(_0x1b12('0x1e'))[_0x1b12('0x1f')](socket);var jayson=require(_0x1b12('0x20'));var client=jayson['client'][_0x1b12('0x21')]({'port':0x232c});var client9002=jayson['client'][_0x1b12('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x4c3f09,_0x436a20,_0x3e5b18,_0x4b5993){return new BPromise(function(_0x416b6e,_0x4e6491){var _0x24ea68=_0x4b5993||client;return _0x24ea68[_0x1b12('0x22')](_0x4c3f09,_0x3e5b18)[_0x1b12('0x23')](function(_0x126929){logger['info'](_0x1b12('0x24'),_0x436a20,_0x1b12('0x25'));logger[_0x1b12('0x26')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x436a20,'request\x20sent',JSON[_0x1b12('0x27')](_0x126929));if(_0x126929[_0x1b12('0x28')]){if(_0x126929['error'][_0x1b12('0x29')]===0x1f4){logger[_0x1b12('0x28')](_0x1b12('0x24'),_0x436a20,_0x126929[_0x1b12('0x28')]['message']);return _0x4e6491(_0x126929[_0x1b12('0x28')][_0x1b12('0x2a')]);}logger[_0x1b12('0x28')](_0x1b12('0x24'),_0x436a20,_0x126929[_0x1b12('0x28')][_0x1b12('0x2a')]);return _0x416b6e(_0x126929[_0x1b12('0x28')]['message']);}else{logger[_0x1b12('0x2b')](_0x1b12('0x24'),_0x436a20,_0x1b12('0x25'));_0x416b6e(_0x126929[_0x1b12('0x2c')][_0x1b12('0x2a')]);}})[_0x1b12('0x2d')](function(_0x322661){logger[_0x1b12('0x28')](_0x1b12('0x24'),_0x436a20,_0x322661);_0x4e6491(_0x322661);});});}function respondWithStatusCode(_0x5ba615,_0x53e986){_0x53e986=_0x53e986||0xcc;return function(_0x4b42ee){if(_0x4b42ee){return _0x5ba615[_0x1b12('0x2e')](_0x53e986);}return _0x5ba615[_0x1b12('0x2f')](_0x53e986)['end']();};}function respondWithResult(_0x58b1a4,_0x15cc98){_0x15cc98=_0x15cc98||0xc8;return function(_0x1e6001){if(_0x1e6001){return _0x58b1a4[_0x1b12('0x2f')](_0x15cc98)[_0x1b12('0x30')](_0x1e6001);}};}function respondWithFilteredResult(_0x6b960d,_0x3f6a3){return function(_0x5461da){if(_0x5461da){var _0x262594=typeof _0x3f6a3[_0x1b12('0x31')]===_0x1b12('0x32')&&typeof _0x3f6a3[_0x1b12('0x33')]===_0x1b12('0x32');var _0x5aa08d=_0x5461da[_0x1b12('0x34')];var _0x481882=_0x262594?0x0:_0x3f6a3[_0x1b12('0x31')];var _0x2d8127=_0x262594?_0x5461da[_0x1b12('0x34')]:_0x3f6a3['offset']+_0x3f6a3[_0x1b12('0x33')];var _0x15980a;if(_0x2d8127>=_0x5aa08d){_0x2d8127=_0x5aa08d;_0x15980a=0xc8;}else{_0x15980a=0xce;}_0x6b960d[_0x1b12('0x2f')](_0x15980a);return _0x6b960d[_0x1b12('0x35')](_0x1b12('0x36'),_0x481882+'-'+_0x2d8127+'/'+_0x5aa08d)['json'](_0x5461da);}return null;};}function patchUpdates(_0x4c933b){return function(_0x34c188){try{jsonpatch['apply'](_0x34c188,_0x4c933b,!![]);}catch(_0x1806eb){return BPromise[_0x1b12('0x37')](_0x1806eb);}return _0x34c188[_0x1b12('0x38')]();};}function saveUpdates(_0x1488ee,_0x38893e){return function(_0x1f3a80){if(_0x1f3a80){return _0x1f3a80['update'](_0x1488ee)[_0x1b12('0x23')](function(_0x9c30bb){return _0x9c30bb;});}return null;};}function removeEntity(_0x102805,_0x508c55){return function(_0x1732ac){if(_0x1732ac){return _0x1732ac[_0x1b12('0x39')]()['then'](function(){var _0x243573=_0x1732ac['get']({'plain':!![]});var _0x55ac92='OpenchannelAccounts';return db['UserProfileResource']['destroy']({'where':{'type':_0x55ac92,'resourceId':_0x243573['id']}})['then'](function(){return _0x1732ac;});})[_0x1b12('0x23')](function(){_0x102805[_0x1b12('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53bf02,_0x2b0e98){return function(_0x3eb605){if(!_0x3eb605){_0x53bf02[_0x1b12('0x2e')](0x194);}return _0x3eb605;};}function handleError(_0xe0d89e,_0x83aa7d){_0x83aa7d=_0x83aa7d||0x1f4;return function(_0x2039b9){logger['error'](_0x2039b9[_0x1b12('0x3a')]);if(_0x2039b9['name']){delete _0x2039b9['name'];}_0xe0d89e[_0x1b12('0x2f')](_0x83aa7d)[_0x1b12('0x3b')](_0x2039b9);};}exports[_0x1b12('0x3c')]=function(_0x56c273,_0x3c584d){var _0x5d35d2={'include':[{'model':db[_0x1b12('0x3d')],'as':_0x1b12('0x3e')}]},_0x9c20c2={},_0x2dcd5e={'count':0x0,'rows':[]};var _0x22bd43=_[_0x1b12('0x3f')](db[_0x1b12('0x40')][_0x1b12('0x41')],function(_0x59db1b){return{'name':_0x59db1b['fieldName'],'type':_0x59db1b[_0x1b12('0x42')][_0x1b12('0x43')]};});_0x9c20c2[_0x1b12('0x44')]=_[_0x1b12('0x3f')](_0x22bd43,_0x1b12('0x45'));_0x9c20c2[_0x1b12('0x46')]=_['keys'](_0x56c273[_0x1b12('0x46')]);_0x9c20c2[_0x1b12('0x47')]=_[_0x1b12('0x48')](_0x9c20c2[_0x1b12('0x44')],_0x9c20c2['query']);_0x5d35d2[_0x1b12('0x49')]=_[_0x1b12('0x48')](_0x9c20c2[_0x1b12('0x44')],qs[_0x1b12('0x4a')](_0x56c273[_0x1b12('0x46')][_0x1b12('0x4a')]));_0x5d35d2[_0x1b12('0x49')]=_0x5d35d2['attributes'][_0x1b12('0x4b')]?_0x5d35d2[_0x1b12('0x49')]:_0x9c20c2['model'];if(!_0x56c273[_0x1b12('0x46')]['hasOwnProperty'](_0x1b12('0x4c'))){_0x5d35d2[_0x1b12('0x33')]=qs[_0x1b12('0x33')](_0x56c273['query'][_0x1b12('0x33')]);_0x5d35d2[_0x1b12('0x31')]=qs[_0x1b12('0x31')](_0x56c273['query']['offset']);}_0x5d35d2[_0x1b12('0x4d')]=qs[_0x1b12('0x4e')](_0x56c273[_0x1b12('0x46')]['sort']);_0x5d35d2[_0x1b12('0x4f')]=qs[_0x1b12('0x47')](_[_0x1b12('0x50')](_0x56c273[_0x1b12('0x46')],_0x9c20c2[_0x1b12('0x47')]),_0x22bd43);if(_0x56c273[_0x1b12('0x46')][_0x1b12('0x51')]){_0x5d35d2[_0x1b12('0x4f')]=_[_0x1b12('0x52')](_0x5d35d2[_0x1b12('0x4f')],{'$or':_[_0x1b12('0x3f')](_0x22bd43,function(_0x436779){if(_0x436779[_0x1b12('0x42')]!==_0x1b12('0x53')){var _0x569a31={};_0x569a31[_0x436779[_0x1b12('0x45')]]={'$like':'%'+_0x56c273[_0x1b12('0x46')][_0x1b12('0x51')]+'%'};return _0x569a31;}})});}_0x5d35d2=_['merge']({},_0x5d35d2,_0x56c273[_0x1b12('0x54')]);var _0x17cfd2={'where':_0x5d35d2[_0x1b12('0x4f')]};return db[_0x1b12('0x40')][_0x1b12('0x34')](_0x17cfd2)[_0x1b12('0x23')](function(_0x456c90){_0x2dcd5e['count']=_0x456c90;if(_0x56c273[_0x1b12('0x46')][_0x1b12('0x55')]){_0x5d35d2[_0x1b12('0x56')]=[{'all':!![]}];}return db[_0x1b12('0x40')]['findAll'](_0x5d35d2);})['then'](function(_0x32cbb4){_0x2dcd5e['rows']=_0x32cbb4;return _0x2dcd5e;})['then'](respondWithFilteredResult(_0x3c584d,_0x5d35d2))[_0x1b12('0x2d')](handleError(_0x3c584d,null));};exports[_0x1b12('0x57')]=function(_0x15ab25,_0x267b27){var _0x150dcf={'raw':![],'where':{'id':_0x15ab25[_0x1b12('0x58')]['id']},'include':[{'model':db[_0x1b12('0x3d')],'as':'mandatoryDispositionPause'}]},_0x597213={};_0x597213[_0x1b12('0x44')]=_[_0x1b12('0x59')](db[_0x1b12('0x40')][_0x1b12('0x41')]);_0x597213[_0x1b12('0x46')]=_[_0x1b12('0x59')](_0x15ab25['query']);_0x597213[_0x1b12('0x47')]=_['intersection'](_0x597213[_0x1b12('0x44')],_0x597213[_0x1b12('0x46')]);_0x150dcf['attributes']=_[_0x1b12('0x48')](_0x597213[_0x1b12('0x44')],qs[_0x1b12('0x4a')](_0x15ab25[_0x1b12('0x46')][_0x1b12('0x4a')]));_0x150dcf[_0x1b12('0x49')]=_0x150dcf[_0x1b12('0x49')][_0x1b12('0x4b')]?_0x150dcf[_0x1b12('0x49')]:_0x597213[_0x1b12('0x44')];if(_0x15ab25['query'][_0x1b12('0x55')]){_0x150dcf[_0x1b12('0x56')]=[{'all':!![]}];}_0x150dcf=_[_0x1b12('0x52')]({},_0x150dcf,_0x15ab25[_0x1b12('0x54')]);return db[_0x1b12('0x40')][_0x1b12('0x5a')](_0x150dcf)[_0x1b12('0x23')](handleEntityNotFound(_0x267b27,null))[_0x1b12('0x23')](respondWithResult(_0x267b27,null))[_0x1b12('0x2d')](handleError(_0x267b27,null));};exports[_0x1b12('0x5b')]=function(_0x408f5d,_0x53af33){return db[_0x1b12('0x40')][_0x1b12('0x5b')](_0x408f5d[_0x1b12('0x5c')],{})['then'](function(_0x3b9811){var _0x618315=_0x408f5d[_0x1b12('0x5d')][_0x1b12('0x5e')]({'plain':!![]});if(!_0x618315)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x618315[_0x1b12('0x5f')]===_0x1b12('0x5d')){var _0x33d08c=_0x3b9811['get']({'plain':!![]});var _0x38997d='OpenchannelAccounts';return db[_0x1b12('0x60')][_0x1b12('0x5a')]({'where':{'name':_0x38997d,'userProfileId':_0x618315['userProfileId']},'raw':!![]})[_0x1b12('0x23')](function(_0x8d849a){if(_0x8d849a&&_0x8d849a[_0x1b12('0x61')]===0x0){return db[_0x1b12('0x62')]['create']({'name':_0x33d08c[_0x1b12('0x45')],'resourceId':_0x33d08c['id'],'type':_0x8d849a[_0x1b12('0x45')],'sectionId':_0x8d849a['id']},{})[_0x1b12('0x23')](function(){return _0x3b9811;});}else{return _0x3b9811;}})[_0x1b12('0x2d')](function(_0x41563c){logger[_0x1b12('0x28')](_0x1b12('0x63'),_0x41563c);throw _0x41563c;});}return _0x3b9811;})[_0x1b12('0x23')](respondWithResult(_0x53af33,0xc9))[_0x1b12('0x2d')](handleError(_0x53af33,null));};exports[_0x1b12('0x64')]=function(_0xdd83a2,_0xe10043){if(_0xdd83a2[_0x1b12('0x5c')]['id']){delete _0xdd83a2[_0x1b12('0x5c')]['id'];}return db[_0x1b12('0x40')][_0x1b12('0x5a')]({'where':{'id':_0xdd83a2[_0x1b12('0x58')]['id']},'include':[{'model':db[_0x1b12('0x3d')],'as':'mandatoryDispositionPause'}]})[_0x1b12('0x23')](handleEntityNotFound(_0xe10043,null))['then'](saveUpdates(_0xdd83a2[_0x1b12('0x5c')],null))['then'](respondWithResult(_0xe10043,null))[_0x1b12('0x2d')](handleError(_0xe10043,null));};exports['destroy']=function(_0x55152d,_0x2b968b){return db['OpenchannelAccount'][_0x1b12('0x5a')]({'where':{'id':_0x55152d[_0x1b12('0x58')]['id']}})[_0x1b12('0x23')](handleEntityNotFound(_0x2b968b,null))[_0x1b12('0x23')](removeEntity(_0x2b968b,null))['catch'](handleError(_0x2b968b,null));};exports[_0x1b12('0x65')]=function(_0x3be7ad,_0x2bf316){return db[_0x1b12('0x40')][_0x1b12('0x65')]()['then'](respondWithResult(_0x2bf316,null))['catch'](handleError(_0x2bf316,null));};exports['addDisposition']=function(_0x2cde70,_0x947a34,_0xb166cb){if(_0x2cde70[_0x1b12('0x5c')]['id']){delete _0x2cde70['body']['id'];}return db[_0x1b12('0x40')][_0x1b12('0x5a')]({'where':{'id':_0x2cde70[_0x1b12('0x58')]['id']}})['then'](handleEntityNotFound(_0x947a34,null))['then'](function(_0x1bebe0){if(_0x1bebe0){_0x2cde70[_0x1b12('0x5c')][_0x1b12('0x66')]=_0x1bebe0['id'];return db[_0x1b12('0x67')][_0x1b12('0x5b')](_0x2cde70[_0x1b12('0x5c')]);}})[_0x1b12('0x23')](respondWithResult(_0x947a34,null))['catch'](handleError(_0x947a34,null));};exports[_0x1b12('0x68')]=function(_0x61b84,_0x318d27,_0x24701f){var _0x51ec63={'raw':![],'where':{}};var _0x4073da={};var _0x361e6e={'count':0x0,'rows':[]};return db[_0x1b12('0x40')][_0x1b12('0x69')]({'where':{'id':_0x61b84[_0x1b12('0x58')]['id']}})[_0x1b12('0x23')](handleEntityNotFound(_0x318d27,null))[_0x1b12('0x23')](function(_0x3e3b5d){if(_0x3e3b5d){_0x4073da['model']=_[_0x1b12('0x59')](db[_0x1b12('0x67')][_0x1b12('0x41')]);_0x4073da[_0x1b12('0x46')]=_[_0x1b12('0x59')](_0x61b84[_0x1b12('0x46')]);_0x4073da[_0x1b12('0x47')]=_[_0x1b12('0x48')](_0x4073da[_0x1b12('0x44')],_0x4073da['query']);_0x51ec63['attributes']=_[_0x1b12('0x48')](_0x4073da[_0x1b12('0x44')],qs[_0x1b12('0x4a')](_0x61b84[_0x1b12('0x46')]['fields']));_0x51ec63['attributes']=_0x51ec63[_0x1b12('0x49')]['length']?_0x51ec63[_0x1b12('0x49')]:_0x4073da[_0x1b12('0x44')];if(!_0x61b84['query']['hasOwnProperty'](_0x1b12('0x4c'))){_0x51ec63['limit']=qs[_0x1b12('0x33')](_0x61b84[_0x1b12('0x46')]['limit']);_0x51ec63[_0x1b12('0x31')]=qs[_0x1b12('0x31')](_0x61b84['query'][_0x1b12('0x31')]);}_0x51ec63[_0x1b12('0x4d')]=qs['sort'](_0x61b84[_0x1b12('0x46')]['sort']);_0x51ec63[_0x1b12('0x4f')]=qs[_0x1b12('0x47')](_[_0x1b12('0x50')](_0x61b84['query'],_0x4073da[_0x1b12('0x47')]));_0x51ec63[_0x1b12('0x4f')][_0x1b12('0x66')]=_0x3e3b5d['id'];if(_0x61b84[_0x1b12('0x46')][_0x1b12('0x51')]){_0x51ec63[_0x1b12('0x4f')]=_[_0x1b12('0x52')](_0x51ec63['where'],{'$or':_[_0x1b12('0x3f')](_0x51ec63[_0x1b12('0x49')],function(_0x889b36){var _0x28fd68={};_0x28fd68[_0x889b36]={'$like':'%'+_0x61b84[_0x1b12('0x46')][_0x1b12('0x51')]+'%'};return _0x28fd68;})});}_0x51ec63=_[_0x1b12('0x52')]({},_0x51ec63,_0x61b84[_0x1b12('0x54')]);return db[_0x1b12('0x67')][_0x1b12('0x34')]({'where':_0x51ec63[_0x1b12('0x4f')]})[_0x1b12('0x23')](function(_0x34e2e1){_0x361e6e['count']=_0x34e2e1;if(_0x61b84['query'][_0x1b12('0x55')]){_0x51ec63[_0x1b12('0x56')]=[{'all':!![]}];}return db['Disposition'][_0x1b12('0x6a')](_0x51ec63);})[_0x1b12('0x23')](function(_0x365afb){_0x361e6e['rows']=_0x365afb;return _0x361e6e;});}})[_0x1b12('0x23')](respondWithFilteredResult(_0x318d27,_0x51ec63))[_0x1b12('0x2d')](handleError(_0x318d27,null));};exports[_0x1b12('0x6b')]=function(_0x36ea71,_0x2940c9,_0x3bc135){return db[_0x1b12('0x40')]['find']({'where':{'id':_0x36ea71[_0x1b12('0x58')]['id']}})[_0x1b12('0x23')](handleEntityNotFound(_0x2940c9,null))['then'](function(_0x5769dc){if(_0x5769dc){return _0x5769dc[_0x1b12('0x6b')](_0x36ea71[_0x1b12('0x46')][_0x1b12('0x6c')]);}})[_0x1b12('0x23')](respondWithStatusCode(_0x2940c9,null))[_0x1b12('0x2d')](handleError(_0x2940c9,null));};exports['addAnswer']=function(_0x303a2a,_0x5defbb,_0x5cac2){if(_0x303a2a['body']['id']){delete _0x303a2a['body']['id'];}return db[_0x1b12('0x40')][_0x1b12('0x5a')]({'where':{'id':_0x303a2a[_0x1b12('0x58')]['id']}})[_0x1b12('0x23')](handleEntityNotFound(_0x5defbb,null))[_0x1b12('0x23')](function(_0x4618d7){if(_0x4618d7){_0x303a2a[_0x1b12('0x5c')][_0x1b12('0x66')]=_0x4618d7['id'];return db['CannedAnswer'][_0x1b12('0x5b')](_0x303a2a[_0x1b12('0x5c')]);}})['then'](respondWithResult(_0x5defbb,null))['catch'](handleError(_0x5defbb,null));};exports['getAnswers']=function(_0x3f7b63,_0x50c8c5,_0xb7e01a){var _0xbb8eba={'raw':![],'where':{}};var _0x1730ed={};var _0x47526d={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x1b12('0x69')]({'where':{'id':_0x3f7b63[_0x1b12('0x58')]['id']}})[_0x1b12('0x23')](handleEntityNotFound(_0x50c8c5,null))[_0x1b12('0x23')](function(_0x1f757d){if(_0x1f757d){_0x1730ed[_0x1b12('0x44')]=_['keys'](db[_0x1b12('0x6d')]['rawAttributes']);_0x1730ed['query']=_[_0x1b12('0x59')](_0x3f7b63['query']);_0x1730ed[_0x1b12('0x47')]=_['intersection'](_0x1730ed['model'],_0x1730ed[_0x1b12('0x46')]);_0xbb8eba['attributes']=_[_0x1b12('0x48')](_0x1730ed['model'],qs[_0x1b12('0x4a')](_0x3f7b63[_0x1b12('0x46')][_0x1b12('0x4a')]));_0xbb8eba[_0x1b12('0x49')]=_0xbb8eba['attributes']['length']?_0xbb8eba[_0x1b12('0x49')]:_0x1730ed[_0x1b12('0x44')];if(!_0x3f7b63[_0x1b12('0x46')][_0x1b12('0x6e')](_0x1b12('0x4c'))){_0xbb8eba['limit']=qs[_0x1b12('0x33')](_0x3f7b63[_0x1b12('0x46')][_0x1b12('0x33')]);_0xbb8eba[_0x1b12('0x31')]=qs[_0x1b12('0x31')](_0x3f7b63[_0x1b12('0x46')][_0x1b12('0x31')]);}_0xbb8eba['order']=qs['sort'](_0x3f7b63[_0x1b12('0x46')][_0x1b12('0x4e')]);_0xbb8eba[_0x1b12('0x4f')]=qs[_0x1b12('0x47')](_[_0x1b12('0x50')](_0x3f7b63['query'],_0x1730ed['filters']));_0xbb8eba['where']['OpenchannelAccountId']=_0x1f757d['id'];if(_0x3f7b63[_0x1b12('0x46')][_0x1b12('0x51')]){_0xbb8eba['where']=_['merge'](_0xbb8eba[_0x1b12('0x4f')],{'$or':_[_0x1b12('0x3f')](_0xbb8eba['attributes'],function(_0x5bd0d6){var _0x437146={};_0x437146[_0x5bd0d6]={'$like':'%'+_0x3f7b63['query'][_0x1b12('0x51')]+'%'};return _0x437146;})});}_0xbb8eba=_[_0x1b12('0x52')]({},_0xbb8eba,_0x3f7b63[_0x1b12('0x54')]);return db[_0x1b12('0x6d')]['count']({'where':_0xbb8eba['where']})[_0x1b12('0x23')](function(_0x3ef625){_0x47526d[_0x1b12('0x34')]=_0x3ef625;if(_0x3f7b63[_0x1b12('0x46')][_0x1b12('0x55')]){_0xbb8eba[_0x1b12('0x56')]=[{'all':!![]}];}return db[_0x1b12('0x6d')][_0x1b12('0x6a')](_0xbb8eba);})[_0x1b12('0x23')](function(_0x2f7e35){_0x47526d[_0x1b12('0x6f')]=_0x2f7e35;return _0x47526d;});}})[_0x1b12('0x23')](respondWithFilteredResult(_0x50c8c5,_0xbb8eba))[_0x1b12('0x2d')](handleError(_0x50c8c5,null));};exports[_0x1b12('0x70')]=function(_0x88523,_0xb6eb9f,_0x3ef821){return db['OpenchannelAccount'][_0x1b12('0x5a')]({'where':{'id':_0x88523[_0x1b12('0x58')]['id']}})['then'](handleEntityNotFound(_0xb6eb9f,null))['then'](function(_0x7e1ad0){if(_0x7e1ad0){return _0x7e1ad0[_0x1b12('0x70')](_0x88523[_0x1b12('0x46')][_0x1b12('0x6c')]);}})[_0x1b12('0x23')](respondWithStatusCode(_0xb6eb9f,null))['catch'](handleError(_0xb6eb9f,null));};exports[_0x1b12('0x71')]=function(_0xfbde90,_0x455719,_0x536d1e){var _0xdb806d={'body':_0xfbde90[_0x1b12('0x5c')],'channel':_0x1b12('0x72')};var _0x207132=[];var _0x4a64d4=[];var _0x4ece21={};var _0x434001=![];return db[_0x1b12('0x73')]['describe']()['then'](function(_0x40f171){if(!_0x40f171){throw new db[(_0x1b12('0x74'))][(_0x1b12('0x75'))]('no\x20available\x20attributes');}_0x207132=_[_0x1b12('0x76')](_['keys'](_0x40f171),[_0x1b12('0x77'),_0x1b12('0x78')]);_0x4a64d4=_[_0x1b12('0x76')](_[_0x1b12('0x59')](_0x40f171),[_0x1b12('0x77'),_0x1b12('0x78'),'CompanyId',_0x1b12('0x79')]);if(_0xfbde90[_0x1b12('0x5c')]['id']){delete _0xfbde90[_0x1b12('0x5c')]['id'];}if(_[_0x1b12('0x7a')](_0xfbde90[_0x1b12('0x5c')]['from'])){throw new db[(_0x1b12('0x74'))]['ValidationError'](_0x1b12('0x7b'));}if(_[_0x1b12('0x7a')](_0xfbde90['body'][_0x1b12('0x5c')])||_0xfbde90[_0x1b12('0x5c')][_0x1b12('0x5c')]===''){throw new db[(_0x1b12('0x74'))][(_0x1b12('0x75'))](_0x1b12('0x7c'));}if(_['isNil'](_0xfbde90[_0x1b12('0x5c')][_0x1b12('0x7d')])){throw new db[(_0x1b12('0x74'))]['ValidationError'](_0x1b12('0x7e')+_0x4a64d4);}if(!_[_0x1b12('0x7f')](_0x4a64d4,_0xfbde90[_0x1b12('0x5c')][_0x1b12('0x7d')])){throw new db['Sequelize']['ValidationError'](_0x1b12('0x80')+_0x4a64d4);}_0x4ece21[_0xfbde90[_0x1b12('0x5c')][_0x1b12('0x7d')]]=_0xfbde90['body'][_0x1b12('0x81')];})[_0x1b12('0x23')](function(){return db[_0x1b12('0x40')]['find']({'where':{'id':_0xfbde90[_0x1b12('0x58')]['id']},'include':[{'model':db[_0x1b12('0x82')],'as':'List','include':[{'model':db[_0x1b12('0x73')],'as':_0x1b12('0x83'),'where':_0x4ece21,'limit':0x1,'order':[[_0x1b12('0x78'),_0x1b12('0x84')]]}]},{'model':db['OpenchannelApplication'],'as':'Applications'}]});})[_0x1b12('0x23')](handleEntityNotFound(_0x455719,null))[_0x1b12('0x23')](function(_0xf54b1b){if(_0xf54b1b&&_0xf54b1b[_0x1b12('0x85')]){_0xdb806d['account']=_0xf54b1b;_0xdb806d[_0x1b12('0x86')]=_0xf54b1b['Applications'];_0xdb806d['list']=_0xf54b1b['List'];_0xdb806d[_0x1b12('0x86')]=_[_0x1b12('0x87')](_0xdb806d[_0x1b12('0x86')],[_0x1b12('0x88')],[_0x1b12('0x89')]);if(_0xdb806d['account']['Applications']){delete _0xdb806d['account'][_0x1b12('0x8a')];}if(_0xdb806d[_0x1b12('0x8b')]['List']&&_0xdb806d[_0x1b12('0x8b')]['List'][_0x1b12('0x83')][_0x1b12('0x4b')]){return _0xdb806d[_0x1b12('0x8b')][_0x1b12('0x85')][_0x1b12('0x83')][0x0];}var _0x24adc1=_[_0x1b12('0x1b')](_0xfbde90[_0x1b12('0x5c')],{'firstName':_0xfbde90[_0x1b12('0x5c')][_0x1b12('0x81')],'ListId':_0xf54b1b['ListId']});_0x24adc1[_0xfbde90[_0x1b12('0x5c')][_0x1b12('0x7d')]]=_0xfbde90[_0x1b12('0x5c')][_0x1b12('0x81')];return db[_0x1b12('0x73')][_0x1b12('0x5b')](_0x24adc1,{'fields':_0x207132,'raw':!![]});}})[_0x1b12('0x23')](handleEntityNotFound(_0x455719,null))[_0x1b12('0x23')](function(_0x44aa2e){_0xdb806d[_0x1b12('0x8c')]=_0x44aa2e;if(_0x44aa2e){var _0x5cb72a={'ContactId':_0x44aa2e['id'],'OpenchannelAccountId':_0xfbde90[_0x1b12('0x58')]['id'],'from':(_0x44aa2e[_0x1b12('0x8d')]||'')+'\x20'+(_0x44aa2e[_0x1b12('0x8e')]||'')};var _0x1faf38={'OpenchannelAccountId':_0xfbde90[_0x1b12('0x58')]['id'],'closed':![]};if(_0xfbde90[_0x1b12('0x5c')][_0x1b12('0x8f')]){_0x1faf38['threadId']=_0xfbde90[_0x1b12('0x5c')][_0x1b12('0x8f')];return db[_0x1b12('0x90')][_0x1b12('0x5a')]({'where':_0x1faf38})[_0x1b12('0x23')](function(_0x137cde){if(_0x137cde){return[_0x137cde,![]];}_0x5cb72a[_0x1b12('0x8f')]=_0xfbde90['body']['threadId'];_0x5cb72a[_0x1b12('0x91')]=_0xfbde90[_0x1b12('0x5c')][_0x1b12('0x91')];return db[_0x1b12('0x90')]['create'](_0x5cb72a)[_0x1b12('0x23')](function(_0x162e41){return[_0x162e41,!![]];});});}else{_0x1faf38[_0x1b12('0x8f')]=null;}_0x1faf38[_0x1b12('0x92')]=_0x44aa2e['id'];return db[_0x1b12('0x90')]['find']({'where':_0x1faf38})['then'](function(_0x2c3d78){if(_0x2c3d78){return[_0x2c3d78,![]];}return db['OpenchannelInteraction'][_0x1b12('0x5b')](_0x5cb72a)['then'](function(_0x51567a){return[_0x51567a,!![]];});});}})[_0x1b12('0x93')](function(_0x3811b6,_0x19505b){if(_0x3811b6){_0x434001=_0x19505b;if(!_0x19505b){var _0x16feb3={'from':(_0xdb806d[_0x1b12('0x8c')][_0x1b12('0x8d')]||'')+'\x20'+(_0xdb806d[_0x1b12('0x8c')][_0x1b12('0x8e')]||'')};if(_0xfbde90[_0x1b12('0x5c')][_0x1b12('0x8f')]&&_0xfbde90['body'][_0x1b12('0x94')]&&_0xfbde90['body']['threadId']!=_0xfbde90[_0x1b12('0x5c')][_0x1b12('0x94')]){_0x16feb3['threadId']=_0xfbde90[_0x1b12('0x5c')][_0x1b12('0x94')];}return _0x3811b6[_0x1b12('0x64')](_0x16feb3);}else{return _0x3811b6;}}})['then'](function(_0x1a869c){_0xdb806d[_0x1b12('0x95')]=_0x1a869c[_0x1b12('0x5e')]({'plain':!![]});_0xdb806d['interaction'][_0x1b12('0x96')]=_0x434001;if(_0xdb806d[_0x1b12('0x95')][_0x1b12('0x96')]){if(_0xdb806d[_0x1b12('0x8b')][_0x1b12('0x97')]){_0xdb806d[_0x1b12('0x86')]['push']({'id':0x0,'priority':_0xdb806d[_0x1b12('0x86')][_0x1b12('0x4b')]+0x1,'app':'close','appdata':'unmanaged','interval':_0x1b12('0x98')});}}return db[_0x1b12('0x99')][_0x1b12('0x5b')]({'body':_0xfbde90[_0x1b12('0x5c')][_0x1b12('0x5c')],'OpenchannelAccountId':_0xfbde90[_0x1b12('0x58')]['id'],'OpenchannelInteractionId':_0x1a869c['id'],'direction':'in','ContactId':_0xdb806d[_0x1b12('0x8c')]['id'],'AttachmentId':_0xfbde90['body']['AttachmentId']});})[_0x1b12('0x23')](function(_0x348615){_0xdb806d[_0x1b12('0x2a')]=_0x348615;if(_0xdb806d[_0x1b12('0x95')][_0x1b12('0x9a')]){return db['User']['find']({'attributes':['id',_0x1b12('0x45')],'where':{'id':_0xdb806d[_0x1b12('0x95')][_0x1b12('0x9a')]}})[_0x1b12('0x23')](function(_0x219fb5){if(_0x219fb5){_0xdb806d[_0x1b12('0x86')][_0x1b12('0x9b')]({'id':0x0,'priority':0x0,'app':_0x1b12('0x9c'),'appdata':_0x219fb5['name']+','+(_0xdb806d['account'][_0x1b12('0x9d')]||0xa),'interval':_0x1b12('0x98')});_0xdb806d[_0x1b12('0x9e')]=![];}return respondWithRpcPromise(_0x1b12('0x9f'),_0x1b12('0xa0'),_0xdb806d);});}return respondWithRpcPromise(_0x1b12('0x9f'),_0x1b12('0xa0'),_0xdb806d);})[_0x1b12('0x23')](function(_0x5738ce){respondWithRpcPromise('EventManager','EventManager',{'event':'notify','message':_0x5738ce},client9002);return _0x5738ce;})[_0x1b12('0x23')](respondWithResult(_0x455719,null))[_0x1b12('0x2d')](handleError(_0x455719,null));};exports[_0x1b12('0xa1')]=function(_0x202853,_0x1c5a4a){var _0x9552a3=_0x202853[_0x1b12('0x58')]['id'];var _0x577e7e=_0x202853[_0x1b12('0x5c')];var _0x144a5b=0xc8;var _0x2fe713=null;return db['sequelize']['transaction']({'isolationLevel':db[_0x1b12('0xa2')]['Transaction'][_0x1b12('0xa3')]['READ_COMMITTED']},function(_0x21ca8e){return db[_0x1b12('0x40')][_0x1b12('0x69')]({'where':{'id':_0x9552a3},'transaction':_0x21ca8e})['then'](function(_0x421008){if(_0x421008){return db[_0x1b12('0xa4')][_0x1b12('0x39')]({'where':{'OpenchannelAccountId':_0x9552a3},'transaction':_0x21ca8e})['then'](function(){var _0x409855=_[_0x1b12('0x3f')](_0x577e7e,function(_0x185780){_0x185780[_0x1b12('0x66')]=_0x9552a3;return _0x185780;});return db[_0x1b12('0xa4')][_0x1b12('0xa5')](_0x409855,{'transaction':_0x21ca8e});});}else{_0x144a5b=0x194;_0x2fe713=[];}});})['then'](function(){if(_0x144a5b!==0x194){return db['OpenchannelApplication']['findAndCountAll']({'where':{'OpenchannelAccountId':_0x9552a3},'order':_0x1b12('0x88')})[_0x1b12('0x23')](function(_0x4489c9){_0x2fe713=_0x4489c9;});}})[_0x1b12('0x2d')](function(_0x2d96c4){_0x144a5b=0x1f4;logger[_0x1b12('0x28')](_0x2d96c4[_0x1b12('0x3a')]);if(_0x2d96c4[_0x1b12('0x45')]){delete _0x2d96c4['name'];}_0x2fe713=_0x2d96c4;})[_0x1b12('0xa6')](function(){if(_0x2fe713===null){_0x1c5a4a[_0x1b12('0x2e')](_0x144a5b);}else{if(_0x144a5b===0x1f4){_0x1c5a4a[_0x1b12('0x2f')](_0x144a5b)['send'](_0x2fe713);}else{_0x1c5a4a[_0x1b12('0x2f')](_0x144a5b)[_0x1b12('0x30')](_0x2fe713);}}});};exports[_0x1b12('0xa7')]=function(_0x5537cb,_0x444838,_0x591655){var _0x4632a2={};var _0x282a09={};var _0x5b7ca3;var _0x441631;return db[_0x1b12('0x40')][_0x1b12('0x69')]({'where':{'id':_0x5537cb[_0x1b12('0x58')]['id']}})[_0x1b12('0x23')](handleEntityNotFound(_0x444838,null))[_0x1b12('0x23')](function(_0x46474a){if(_0x46474a){_0x5b7ca3=_0x46474a;_0x282a09[_0x1b12('0x44')]=_[_0x1b12('0x59')](db['OpenchannelApplication'][_0x1b12('0x41')]);_0x282a09[_0x1b12('0x46')]=_[_0x1b12('0x59')](_0x5537cb[_0x1b12('0x46')]);_0x282a09['filters']=_[_0x1b12('0x48')](_0x282a09['model'],_0x282a09[_0x1b12('0x46')]);_0x4632a2['attributes']=_[_0x1b12('0x48')](_0x282a09[_0x1b12('0x44')],qs[_0x1b12('0x4a')](_0x5537cb[_0x1b12('0x46')][_0x1b12('0x4a')]));_0x4632a2[_0x1b12('0x49')]=_0x4632a2[_0x1b12('0x49')][_0x1b12('0x4b')]?_0x4632a2[_0x1b12('0x49')]:_0x282a09['model'];_0x4632a2[_0x1b12('0x4d')]=qs['sort'](_0x5537cb[_0x1b12('0x46')][_0x1b12('0x4e')]);_0x4632a2[_0x1b12('0x4f')]=qs[_0x1b12('0x47')](_[_0x1b12('0x50')](_0x5537cb[_0x1b12('0x46')],_0x282a09[_0x1b12('0x47')]));if(_0x5537cb[_0x1b12('0x46')]['filter']){_0x4632a2[_0x1b12('0x4f')]=_[_0x1b12('0x52')](_0x4632a2[_0x1b12('0x4f')],{'$or':_[_0x1b12('0x3f')](_0x4632a2[_0x1b12('0x49')],function(_0x7ed900){var _0x4cf2d2={};_0x4cf2d2[_0x7ed900]={'$like':'%'+_0x5537cb[_0x1b12('0x46')][_0x1b12('0x51')]+'%'};return _0x4cf2d2;})});}_0x4632a2=_[_0x1b12('0x52')]({},_0x4632a2,_0x5537cb[_0x1b12('0x54')]);return _0x5b7ca3[_0x1b12('0xa7')](_0x4632a2);}})[_0x1b12('0x23')](function(_0x3037da){if(_0x3037da){_0x441631=_0x3037da['length'];if(!_0x5537cb[_0x1b12('0x46')][_0x1b12('0x6e')](_0x1b12('0x4c'))){_0x4632a2[_0x1b12('0x33')]=qs[_0x1b12('0x33')](_0x5537cb[_0x1b12('0x46')][_0x1b12('0x33')]);_0x4632a2[_0x1b12('0x31')]=qs[_0x1b12('0x31')](_0x5537cb[_0x1b12('0x46')][_0x1b12('0x31')]);}return _0x5b7ca3['getApplications'](_0x4632a2);}})[_0x1b12('0x23')](function(_0x1baf84){if(_0x1baf84){return _0x1baf84?{'count':_0x441631,'rows':_0x1baf84}:null;}})['then'](respondWithResult(_0x444838,null))['catch'](handleError(_0x444838,null));};exports[_0x1b12('0xa8')]=function(_0x2c3d2e,_0x3edd89,_0xd86c0b){var _0x5bbc66={'raw':![],'where':{}};var _0x253a99={};var _0x1bc6b5={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x1b12('0x69')]({'where':{'id':_0x2c3d2e[_0x1b12('0x58')]['id']}})[_0x1b12('0x23')](handleEntityNotFound(_0x3edd89,null))[_0x1b12('0x23')](function(_0x57917e){if(_0x57917e){_0x253a99[_0x1b12('0x44')]=_[_0x1b12('0x59')](db[_0x1b12('0x90')]['rawAttributes']);_0x253a99[_0x1b12('0x46')]=_['keys'](_0x2c3d2e[_0x1b12('0x46')]);_0x253a99[_0x1b12('0x47')]=_[_0x1b12('0x48')](_0x253a99[_0x1b12('0x44')],_0x253a99[_0x1b12('0x46')]);_0x5bbc66[_0x1b12('0x49')]=_[_0x1b12('0x48')](_0x253a99[_0x1b12('0x44')],qs[_0x1b12('0x4a')](_0x2c3d2e[_0x1b12('0x46')][_0x1b12('0x4a')]));_0x5bbc66[_0x1b12('0x49')]=_0x5bbc66[_0x1b12('0x49')][_0x1b12('0x4b')]?_0x5bbc66['attributes']:_0x253a99['model'];if(!_0x2c3d2e[_0x1b12('0x46')]['hasOwnProperty']('nolimit')){_0x5bbc66[_0x1b12('0x33')]=qs[_0x1b12('0x33')](_0x2c3d2e[_0x1b12('0x46')]['limit']);_0x5bbc66['offset']=qs[_0x1b12('0x31')](_0x2c3d2e['query'][_0x1b12('0x31')]);}_0x5bbc66[_0x1b12('0x4d')]=qs[_0x1b12('0x4e')](_0x2c3d2e[_0x1b12('0x46')]['sort']);_0x5bbc66['where']=qs[_0x1b12('0x47')](_[_0x1b12('0x50')](_0x2c3d2e[_0x1b12('0x46')],_0x253a99['filters']));_0x5bbc66[_0x1b12('0x4f')][_0x1b12('0x66')]=_0x57917e['id'];if(_0x2c3d2e[_0x1b12('0x46')]['filter']){_0x5bbc66[_0x1b12('0x4f')]=_[_0x1b12('0x52')](_0x5bbc66[_0x1b12('0x4f')],{'$or':_[_0x1b12('0x3f')](_0x5bbc66['attributes'],function(_0x153e84){var _0x4ff046={};_0x4ff046[_0x153e84]={'$like':'%'+_0x2c3d2e[_0x1b12('0x46')][_0x1b12('0x51')]+'%'};return _0x4ff046;})});}_0x5bbc66=_[_0x1b12('0x52')]({},_0x5bbc66,_0x2c3d2e[_0x1b12('0x54')]);return db[_0x1b12('0x90')][_0x1b12('0x34')]({'where':_0x5bbc66[_0x1b12('0x4f')]})[_0x1b12('0x23')](function(_0x2cbf17){_0x1bc6b5[_0x1b12('0x34')]=_0x2cbf17;if(_0x2c3d2e[_0x1b12('0x46')]['includeAll']){_0x5bbc66[_0x1b12('0x56')]=[{'model':db['CmContact'],'as':_0x1b12('0xa9'),'required':![]},{'model':db['User'],'as':_0x1b12('0xaa'),'attributes':[_0x1b12('0x45'),_0x1b12('0xab'),_0x1b12('0xac')],'required':![]},{'model':db[_0x1b12('0xad')],'as':_0x1b12('0xae'),'attributes':['id',_0x1b12('0x45'),'color'],'where':_0x2c3d2e[_0x1b12('0x46')][_0x1b12('0xaf')]?{'id':_0x2c3d2e[_0x1b12('0x46')][_0x1b12('0xaf')]}:undefined,'required':_0x2c3d2e[_0x1b12('0x46')][_0x1b12('0xaf')]?!![]:![]}];}return db[_0x1b12('0x90')]['findAll'](_0x5bbc66);})[_0x1b12('0x23')](function(_0x5c3a27){_0x1bc6b5[_0x1b12('0x6f')]=_0x5c3a27;return _0x1bc6b5;});}})[_0x1b12('0x23')](respondWithFilteredResult(_0x3edd89,_0x5bbc66))[_0x1b12('0x2d')](handleError(_0x3edd89,null));};exports[_0x1b12('0xb0')]=function(_0x5b41e7,_0x5b00d7,_0x2caff8){return db[_0x1b12('0x40')][_0x1b12('0x5a')]({'where':{'id':_0x5b41e7[_0x1b12('0x58')]['id']}})['then'](handleEntityNotFound(_0x5b00d7,null))['then'](function(_0x38542d){if(_0x38542d){return _0x38542d[_0x1b12('0xb0')](_0x5b41e7[_0x1b12('0x5c')][_0x1b12('0x6c')],_[_0x1b12('0xb1')](_0x5b41e7[_0x1b12('0x5c')],[_0x1b12('0x6c'),'id'])||{})['spread'](function(_0x383138){for(var _0x3b38bf=0x0;_0x3b38bf<_0x5b41e7[_0x1b12('0x5c')]['ids'][_0x1b12('0x4b')];_0x3b38bf+=0x1){socket[_0x1b12('0xb2')]('userOpenchannelAccount:save',{'UserId':Number(_0x5b41e7[_0x1b12('0x5c')][_0x1b12('0x6c')][_0x3b38bf]),'OpenchannelAccountId':Number(_0x5b41e7[_0x1b12('0x58')]['id'])});}return _0x383138;});}})[_0x1b12('0x23')](respondWithResult(_0x5b00d7,null))[_0x1b12('0x2d')](handleError(_0x5b00d7,null));};exports[_0x1b12('0xb3')]=function(_0x4c7c68,_0x301d37,_0xb09421){return db['OpenchannelAccount']['find']({'where':{'id':_0x4c7c68[_0x1b12('0x58')]['id']}})[_0x1b12('0x23')](handleEntityNotFound(_0x301d37,null))[_0x1b12('0x23')](function(_0x1a5b88){if(_0x1a5b88){return _0x1a5b88[_0x1b12('0xb3')](_0x4c7c68[_0x1b12('0x46')][_0x1b12('0x6c')])[_0x1b12('0x23')](function(){if(_[_0x1b12('0xb4')](_0x4c7c68[_0x1b12('0x46')]['ids'])){for(var _0x3f0591=0x0;_0x3f0591<_0x4c7c68['query'][_0x1b12('0x6c')][_0x1b12('0x4b')];_0x3f0591+=0x1){socket['emit']('userOpenchannelAccount:remove',{'UserId':Number(_0x4c7c68[_0x1b12('0x46')]['ids'][_0x3f0591]),'OpenchannelAccountId':Number(_0x4c7c68['params']['id'])});}}else{socket[_0x1b12('0xb2')]('userOpenchannelAccount:remove',{'UserId':Number(_0x4c7c68['query'][_0x1b12('0x6c')]),'OpenchannelAccountId':Number(_0x4c7c68[_0x1b12('0x58')]['id'])});}});}})[_0x1b12('0x23')](respondWithStatusCode(_0x301d37,null))['catch'](handleError(_0x301d37,null));};exports[_0x1b12('0xb5')]=function(_0x5b437d,_0x3296bf,_0x4f1cda){var _0x3262cf={};var _0x3dcd92={};var _0x3e0ff9;var _0x1ed6b9;return db['OpenchannelAccount'][_0x1b12('0x69')]({'where':{'id':_0x5b437d[_0x1b12('0x58')]['id']}})['then'](handleEntityNotFound(_0x3296bf,null))['then'](function(_0x2ef58d){if(_0x2ef58d){_0x3e0ff9=_0x2ef58d;_0x3dcd92[_0x1b12('0x44')]=_[_0x1b12('0x59')](db['User'][_0x1b12('0x41')]);_0x3dcd92['query']=_[_0x1b12('0x59')](_0x5b437d[_0x1b12('0x46')]);_0x3dcd92[_0x1b12('0x47')]=_['intersection'](_0x3dcd92[_0x1b12('0x44')],_0x3dcd92[_0x1b12('0x46')]);_0x3262cf[_0x1b12('0x49')]=_[_0x1b12('0x48')](_0x3dcd92[_0x1b12('0x44')],qs[_0x1b12('0x4a')](_0x5b437d[_0x1b12('0x46')][_0x1b12('0x4a')]));_0x3262cf[_0x1b12('0x49')]=_0x3262cf[_0x1b12('0x49')][_0x1b12('0x4b')]?_0x3262cf[_0x1b12('0x49')]:_0x3dcd92[_0x1b12('0x44')];_0x3262cf[_0x1b12('0x4d')]=qs[_0x1b12('0x4e')](_0x5b437d[_0x1b12('0x46')][_0x1b12('0x4e')]);_0x3262cf[_0x1b12('0x4f')]=qs['filters'](_[_0x1b12('0x50')](_0x5b437d[_0x1b12('0x46')],_0x3dcd92[_0x1b12('0x47')]));if(_0x5b437d[_0x1b12('0x46')]['filter']){_0x3262cf['where']=_[_0x1b12('0x52')](_0x3262cf[_0x1b12('0x4f')],{'$or':_[_0x1b12('0x3f')](_0x3262cf[_0x1b12('0x49')],function(_0x2541d8){var _0x24837e={};_0x24837e[_0x2541d8]={'$like':'%'+_0x5b437d[_0x1b12('0x46')][_0x1b12('0x51')]+'%'};return _0x24837e;})});}_0x3262cf=_['merge']({},_0x3262cf,_0x5b437d[_0x1b12('0x54')]);return _0x3e0ff9['getAgents'](_0x3262cf);}})[_0x1b12('0x23')](function(_0x4918c1){if(_0x4918c1){_0x1ed6b9=_0x4918c1[_0x1b12('0x4b')];if(!_0x5b437d[_0x1b12('0x46')]['hasOwnProperty'](_0x1b12('0x4c'))){_0x3262cf['limit']=qs[_0x1b12('0x33')](_0x5b437d[_0x1b12('0x46')][_0x1b12('0x33')]);_0x3262cf[_0x1b12('0x31')]=qs[_0x1b12('0x31')](_0x5b437d[_0x1b12('0x46')][_0x1b12('0x31')]);}return _0x3e0ff9['getAgents'](_0x3262cf);}})[_0x1b12('0x23')](function(_0x2cebfd){if(_0x2cebfd){return _0x2cebfd?{'count':_0x1ed6b9,'rows':_0x2cebfd}:null;}})[_0x1b12('0x23')](respondWithResult(_0x3296bf,null))[_0x1b12('0x2d')](handleError(_0x3296bf,null));};exports['send']=function(_0xd4c580,_0x5068e0,_0x1d7e6e){var _0x547aa8,_0x4ec553,_0xf276f8;if(_['isNil'](_0xd4c580[_0x1b12('0x5c')]['body'])||_0xd4c580['body']['body']===''){throw new db[(_0x1b12('0x74'))][(_0x1b12('0x75'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x1b12('0x7a')](_0xd4c580[_0x1b12('0x5c')]['to'])){}_0x547aa8=_0xd4c580[_0x1b12('0x5c')]['to'];return db[_0x1b12('0x40')][_0x1b12('0x69')]({'where':{'id':_0xd4c580['params']['id']}})[_0x1b12('0x23')](handleEntityNotFound(_0x5068e0,null))[_0x1b12('0x23')](function(_0xaffd3d){if(_0xaffd3d){return db['OpenchannelAccount'][_0x1b12('0x5a')]({'where':{'id':_0xaffd3d['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x1b12('0x73')],'as':_0x1b12('0x83'),'where':{[_0xaffd3d['mapKey']]:_0x547aa8},'limit':0x1,'order':[[_0x1b12('0x78'),'DESC']]}]}]})[_0x1b12('0x23')](handleEntityNotFound(_0x5068e0,null))[_0x1b12('0x23')](function(_0x399c68){if(_0x399c68&&_0x399c68[_0x1b12('0x85')]){_0x4ec553=_0x399c68[_0x1b12('0x5e')]({'plain':!![]});if(_0x4ec553[_0x1b12('0x85')]&&_0x4ec553[_0x1b12('0x85')][_0x1b12('0x83')][_0x1b12('0x4b')]){return _0x4ec553[_0x1b12('0x85')][_0x1b12('0x83')][0x0];}return db[_0x1b12('0x73')][_0x1b12('0x5b')](_[_0x1b12('0x1b')](_0xd4c580[_0x1b12('0x5c')],{'firstName':_0x547aa8,[_0x399c68[_0x1b12('0x7d')]]:_0x547aa8,'phone':_0x547aa8,'ListId':_0x4ec553[_0x1b12('0x79')]}));}})[_0x1b12('0x23')](handleEntityNotFound(_0x5068e0,null))['then'](function(_0x53d888){if(_0x53d888){_0xf276f8=_0x53d888;return db['OpenchannelInteraction'][_0x1b12('0x5a')]({'where':{'ContactId':_0xf276f8['id'],'closed':![],'OpenchannelAccountId':_0x4ec553['id']}})[_0x1b12('0x23')](function(_0x126548){if(_0x126548){return[_0x126548,![]];}return db[_0x1b12('0x90')][_0x1b12('0x5b')]({'UserId':_0xd4c580[_0x1b12('0x5d')]['id'],'ContactId':_0xf276f8['id'],'OpenchannelAccountId':_0x4ec553['id'],'lastMsgDirection':_0x1b12('0xb6'),'Messages':[_['merge'](_0xd4c580[_0x1b12('0x5c')],{'read':![],'body':_0xd4c580[_0x1b12('0x5c')][_0x1b12('0x5c')],'OpenchannelAccountId':_0x4ec553['id'],'UserId':_0xd4c580['user']['id'],'ContactId':_0xf276f8['id']})]},{'include':[{'model':db[_0x1b12('0x99')],'as':_0x1b12('0xb7')}]})[_0x1b12('0x23')](function(_0x33c712){return[_0x33c712,!![]];});});}})[_0x1b12('0x93')](function(_0x4775c5,_0x40d484){if(_0x40d484){return _0x4775c5;}return db['OpenchannelMessage'][_0x1b12('0x5b')](_['merge'](_0xd4c580[_0x1b12('0x5c')],{'read':![],'body':_0xd4c580[_0x1b12('0x5c')]['body'],'OpenchannelAccountId':_0x4ec553['id'],'OpenchannelInteractionId':_0x4775c5['id'],'UserId':_0xd4c580[_0x1b12('0x5d')]['id'],'ContactId':_0xf276f8['id']}))[_0x1b12('0x23')](function(_0x10b965){_0x4775c5[_0x1b12('0xb8')]['Messages']=[];_0x4775c5[_0x1b12('0xb8')][_0x1b12('0xb7')][_0x1b12('0xb9')](_0x10b965['dataValues']);return _0x4775c5;});});}})[_0x1b12('0x23')](respondWithResult(_0x5068e0,null))[_0x1b12('0x2d')](handleError(_0x5068e0,null));}; \ No newline at end of file +var _0x6f31=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','OpenchannelAccountId','Disposition','getDispositions','findOne','order','filter','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','createdAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','Contacts','updatedAt','DESC','OpenchannelApplication','Applications','List','account','applications','orderBy','priority','asc','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','spread','contact','messageId','interaction','created','autoclose','push','close','unmanaged','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','READ_COMMITTED','bulkCreate','findAndCountAll','finally','send','getApplications','getInteractions','Contact','Tag','Tags','color','tag','addAgents','omit','emit','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','get','out','dataValues','Messages','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','http','client','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','destroy','OpenchannelAccounts','UserProfileResource','stack','name','index','mandatoryDispositionPause','map','rawAttributes','fieldName','type','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','OpenchannelAccount','includeAll','include','findAll','rows','show','params','Pause','options','find','create','user','role','userProfileId'];(function(_0x46639f,_0xfc3ea8){var _0x26e1c4=function(_0x8c3d3f){while(--_0x8c3d3f){_0x46639f['push'](_0x46639f['shift']());}};_0x26e1c4(++_0xfc3ea8);}(_0x6f31,0x1d9));var _0x16f3=function(_0x3d331f,_0x1c4425){_0x3d331f=_0x3d331f-0x0;var _0xf42483=_0x6f31[_0x3d331f];return _0xf42483;};'use strict';var emlformat=require(_0x16f3('0x0'));var rimraf=require(_0x16f3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x16f3('0x2'));var moment=require(_0x16f3('0x3'));var BPromise=require(_0x16f3('0x4'));var Mustache=require(_0x16f3('0x5'));var util=require(_0x16f3('0x6'));var path=require(_0x16f3('0x7'));var sox=require(_0x16f3('0x8'));var csv=require(_0x16f3('0x9'));var ejs=require(_0x16f3('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x16f3('0xb'));var crypto=require('crypto');var jsforce=require(_0x16f3('0xc'));var deskjs=require(_0x16f3('0xd'));var toCsv=require(_0x16f3('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x16f3('0xe'));var authService=require(_0x16f3('0xf'));var qs=require(_0x16f3('0x10'));var as=require(_0x16f3('0x11'));var hardwareService=require(_0x16f3('0x12'));var logger=require('../../config/logger')(_0x16f3('0x13'));var utils=require(_0x16f3('0x14'));var config=require(_0x16f3('0x15'));var licenseUtil=require(_0x16f3('0x16'));var db=require(_0x16f3('0x17'))['db'];config['redis']=_[_0x16f3('0x18')](config[_0x16f3('0x19')],{'host':_0x16f3('0x1a'),'port':0x18eb});var socket=require(_0x16f3('0x1b'))(new Redis(config['redis']));require(_0x16f3('0x1c'))[_0x16f3('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x16f3('0x1e')]({'port':0x232c});var client9002=jayson[_0x16f3('0x1f')][_0x16f3('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x3a5b39,_0x526a04,_0x1fe23c,_0x29c933){return new BPromise(function(_0x529c88,_0x2dac71){var _0x112d1a=_0x29c933||client;return _0x112d1a[_0x16f3('0x20')](_0x3a5b39,_0x1fe23c)[_0x16f3('0x21')](function(_0x3497c9){logger[_0x16f3('0x22')](_0x16f3('0x23'),_0x526a04,_0x16f3('0x24'));logger['debug'](_0x16f3('0x25'),_0x526a04,'request\x20sent',JSON[_0x16f3('0x26')](_0x3497c9));if(_0x3497c9[_0x16f3('0x27')]){if(_0x3497c9[_0x16f3('0x27')]['code']===0x1f4){logger[_0x16f3('0x27')](_0x16f3('0x23'),_0x526a04,_0x3497c9[_0x16f3('0x27')][_0x16f3('0x28')]);return _0x2dac71(_0x3497c9[_0x16f3('0x27')][_0x16f3('0x28')]);}logger[_0x16f3('0x27')](_0x16f3('0x23'),_0x526a04,_0x3497c9[_0x16f3('0x27')]['message']);return _0x529c88(_0x3497c9['error'][_0x16f3('0x28')]);}else{logger[_0x16f3('0x22')](_0x16f3('0x23'),_0x526a04,'request\x20sent');_0x529c88(_0x3497c9['result'][_0x16f3('0x28')]);}})[_0x16f3('0x29')](function(_0x453508){logger[_0x16f3('0x27')]('OpenchannelAccount,\x20%s,\x20%s',_0x526a04,_0x453508);_0x2dac71(_0x453508);});});}function respondWithStatusCode(_0xa8d54b,_0x432d9d){_0x432d9d=_0x432d9d||0xcc;return function(_0x22b169){if(_0x22b169){return _0xa8d54b[_0x16f3('0x2a')](_0x432d9d);}return _0xa8d54b['status'](_0x432d9d)[_0x16f3('0x2b')]();};}function respondWithResult(_0x4d152f,_0x2aea15){_0x2aea15=_0x2aea15||0xc8;return function(_0x587f41){if(_0x587f41){return _0x4d152f[_0x16f3('0x2c')](_0x2aea15)[_0x16f3('0x2d')](_0x587f41);}};}function respondWithFilteredResult(_0x5363b9,_0x5ab348){return function(_0x2f93cf){if(_0x2f93cf){var _0x4f10d3=typeof _0x5ab348['offset']===_0x16f3('0x2e')&&typeof _0x5ab348['limit']===_0x16f3('0x2e');var _0x2abf1a=_0x2f93cf[_0x16f3('0x2f')];var _0x1ae30e=_0x4f10d3?0x0:_0x5ab348[_0x16f3('0x30')];var _0xdef760=_0x4f10d3?_0x2f93cf[_0x16f3('0x2f')]:_0x5ab348[_0x16f3('0x30')]+_0x5ab348[_0x16f3('0x31')];var _0x152152;if(_0xdef760>=_0x2abf1a){_0xdef760=_0x2abf1a;_0x152152=0xc8;}else{_0x152152=0xce;}_0x5363b9[_0x16f3('0x2c')](_0x152152);return _0x5363b9[_0x16f3('0x32')](_0x16f3('0x33'),_0x1ae30e+'-'+_0xdef760+'/'+_0x2abf1a)[_0x16f3('0x2d')](_0x2f93cf);}return null;};}function patchUpdates(_0x925df7){return function(_0x5cb0bc){try{jsonpatch[_0x16f3('0x34')](_0x5cb0bc,_0x925df7,!![]);}catch(_0xb4f59a){return BPromise[_0x16f3('0x35')](_0xb4f59a);}return _0x5cb0bc['save']();};}function saveUpdates(_0x17441b,_0x2d6409){return function(_0x3e5607){if(_0x3e5607){return _0x3e5607[_0x16f3('0x36')](_0x17441b)[_0x16f3('0x21')](function(_0x1d3cc1){return _0x1d3cc1;});}return null;};}function removeEntity(_0x5ccaef,_0x36efef){return function(_0x190cbc){if(_0x190cbc){return _0x190cbc[_0x16f3('0x37')]()[_0x16f3('0x21')](function(){var _0x37b566=_0x190cbc['get']({'plain':!![]});var _0x40e6b3=_0x16f3('0x38');return db[_0x16f3('0x39')][_0x16f3('0x37')]({'where':{'type':_0x40e6b3,'resourceId':_0x37b566['id']}})[_0x16f3('0x21')](function(){return _0x190cbc;});})['then'](function(){_0x5ccaef[_0x16f3('0x2c')](0xcc)[_0x16f3('0x2b')]();});}};}function handleEntityNotFound(_0x5044b5,_0xf55a37){return function(_0x65c60f){if(!_0x65c60f){_0x5044b5[_0x16f3('0x2a')](0x194);}return _0x65c60f;};}function handleError(_0x24c353,_0x75b2bc){_0x75b2bc=_0x75b2bc||0x1f4;return function(_0x1356a5){logger['error'](_0x1356a5[_0x16f3('0x3a')]);if(_0x1356a5[_0x16f3('0x3b')]){delete _0x1356a5[_0x16f3('0x3b')];}_0x24c353[_0x16f3('0x2c')](_0x75b2bc)['send'](_0x1356a5);};}exports[_0x16f3('0x3c')]=function(_0x5310ef,_0x1d837b){var _0x2d0ebb={'include':[{'model':db['Pause'],'as':_0x16f3('0x3d')}]},_0x5b7a8c={},_0x3e74db={'count':0x0,'rows':[]};var _0xf5f336=_[_0x16f3('0x3e')](db['OpenchannelAccount'][_0x16f3('0x3f')],function(_0x4e0f50){return{'name':_0x4e0f50[_0x16f3('0x40')],'type':_0x4e0f50[_0x16f3('0x41')]['key']};});_0x5b7a8c[_0x16f3('0x42')]=_[_0x16f3('0x3e')](_0xf5f336,_0x16f3('0x3b'));_0x5b7a8c['query']=_[_0x16f3('0x43')](_0x5310ef['query']);_0x5b7a8c['filters']=_[_0x16f3('0x44')](_0x5b7a8c['model'],_0x5b7a8c[_0x16f3('0x45')]);_0x2d0ebb[_0x16f3('0x46')]=_[_0x16f3('0x44')](_0x5b7a8c[_0x16f3('0x42')],qs[_0x16f3('0x47')](_0x5310ef[_0x16f3('0x45')]['fields']));_0x2d0ebb[_0x16f3('0x46')]=_0x2d0ebb[_0x16f3('0x46')][_0x16f3('0x48')]?_0x2d0ebb[_0x16f3('0x46')]:_0x5b7a8c[_0x16f3('0x42')];if(!_0x5310ef['query'][_0x16f3('0x49')](_0x16f3('0x4a'))){_0x2d0ebb[_0x16f3('0x31')]=qs[_0x16f3('0x31')](_0x5310ef['query'][_0x16f3('0x31')]);_0x2d0ebb[_0x16f3('0x30')]=qs[_0x16f3('0x30')](_0x5310ef['query']['offset']);}_0x2d0ebb['order']=qs[_0x16f3('0x4b')](_0x5310ef['query'][_0x16f3('0x4b')]);_0x2d0ebb[_0x16f3('0x4c')]=qs[_0x16f3('0x4d')](_[_0x16f3('0x4e')](_0x5310ef[_0x16f3('0x45')],_0x5b7a8c[_0x16f3('0x4d')]),_0xf5f336);if(_0x5310ef[_0x16f3('0x45')]['filter']){_0x2d0ebb[_0x16f3('0x4c')]=_[_0x16f3('0x4f')](_0x2d0ebb[_0x16f3('0x4c')],{'$or':_[_0x16f3('0x3e')](_0xf5f336,function(_0x4fe30c){if(_0x4fe30c[_0x16f3('0x41')]!=='VIRTUAL'){var _0x4d68a1={};_0x4d68a1[_0x4fe30c['name']]={'$like':'%'+_0x5310ef[_0x16f3('0x45')]['filter']+'%'};return _0x4d68a1;}})});}_0x2d0ebb=_['merge']({},_0x2d0ebb,_0x5310ef['options']);var _0x46dd9f={'where':_0x2d0ebb[_0x16f3('0x4c')]};return db[_0x16f3('0x50')][_0x16f3('0x2f')](_0x46dd9f)[_0x16f3('0x21')](function(_0x156616){_0x3e74db[_0x16f3('0x2f')]=_0x156616;if(_0x5310ef[_0x16f3('0x45')][_0x16f3('0x51')]){_0x2d0ebb[_0x16f3('0x52')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0x16f3('0x53')](_0x2d0ebb);})[_0x16f3('0x21')](function(_0xb5855e){_0x3e74db[_0x16f3('0x54')]=_0xb5855e;return _0x3e74db;})[_0x16f3('0x21')](respondWithFilteredResult(_0x1d837b,_0x2d0ebb))[_0x16f3('0x29')](handleError(_0x1d837b,null));};exports[_0x16f3('0x55')]=function(_0x48e6e6,_0x1b2ab3){var _0x55d810={'raw':![],'where':{'id':_0x48e6e6[_0x16f3('0x56')]['id']},'include':[{'model':db[_0x16f3('0x57')],'as':_0x16f3('0x3d')}]},_0x207bbe={};_0x207bbe['model']=_[_0x16f3('0x43')](db[_0x16f3('0x50')][_0x16f3('0x3f')]);_0x207bbe['query']=_[_0x16f3('0x43')](_0x48e6e6[_0x16f3('0x45')]);_0x207bbe[_0x16f3('0x4d')]=_['intersection'](_0x207bbe[_0x16f3('0x42')],_0x207bbe['query']);_0x55d810[_0x16f3('0x46')]=_['intersection'](_0x207bbe['model'],qs[_0x16f3('0x47')](_0x48e6e6[_0x16f3('0x45')][_0x16f3('0x47')]));_0x55d810[_0x16f3('0x46')]=_0x55d810[_0x16f3('0x46')][_0x16f3('0x48')]?_0x55d810[_0x16f3('0x46')]:_0x207bbe[_0x16f3('0x42')];if(_0x48e6e6[_0x16f3('0x45')][_0x16f3('0x51')]){_0x55d810[_0x16f3('0x52')]=[{'all':!![]}];}_0x55d810=_['merge']({},_0x55d810,_0x48e6e6[_0x16f3('0x58')]);return db[_0x16f3('0x50')][_0x16f3('0x59')](_0x55d810)[_0x16f3('0x21')](handleEntityNotFound(_0x1b2ab3,null))[_0x16f3('0x21')](respondWithResult(_0x1b2ab3,null))['catch'](handleError(_0x1b2ab3,null));};exports[_0x16f3('0x5a')]=function(_0x339fcb,_0xd92911){return db[_0x16f3('0x50')]['create'](_0x339fcb['body'],{})[_0x16f3('0x21')](function(_0x577eb0){var _0x14ce7b=_0x339fcb[_0x16f3('0x5b')]['get']({'plain':!![]});if(!_0x14ce7b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x14ce7b[_0x16f3('0x5c')]==='user'){var _0x4fb51b=_0x577eb0['get']({'plain':!![]});var _0x5a995d=_0x16f3('0x38');return db['UserProfileSection']['find']({'where':{'name':_0x5a995d,'userProfileId':_0x14ce7b[_0x16f3('0x5d')]},'raw':!![]})[_0x16f3('0x21')](function(_0x1f28f2){if(_0x1f28f2&&_0x1f28f2[_0x16f3('0x5e')]===0x0){return db[_0x16f3('0x39')]['create']({'name':_0x4fb51b[_0x16f3('0x3b')],'resourceId':_0x4fb51b['id'],'type':_0x1f28f2[_0x16f3('0x3b')],'sectionId':_0x1f28f2['id']},{})[_0x16f3('0x21')](function(){return _0x577eb0;});}else{return _0x577eb0;}})[_0x16f3('0x29')](function(_0x202ff6){logger[_0x16f3('0x27')](_0x16f3('0x5f'),_0x202ff6);throw _0x202ff6;});}return _0x577eb0;})[_0x16f3('0x21')](respondWithResult(_0xd92911,0xc9))['catch'](handleError(_0xd92911,null));};exports[_0x16f3('0x36')]=function(_0x2082ee,_0x54b5a5){if(_0x2082ee[_0x16f3('0x60')]['id']){delete _0x2082ee[_0x16f3('0x60')]['id'];}return db[_0x16f3('0x50')][_0x16f3('0x59')]({'where':{'id':_0x2082ee[_0x16f3('0x56')]['id']},'include':[{'model':db[_0x16f3('0x57')],'as':_0x16f3('0x3d')}]})[_0x16f3('0x21')](handleEntityNotFound(_0x54b5a5,null))['then'](saveUpdates(_0x2082ee[_0x16f3('0x60')],null))[_0x16f3('0x21')](respondWithResult(_0x54b5a5,null))[_0x16f3('0x29')](handleError(_0x54b5a5,null));};exports[_0x16f3('0x37')]=function(_0x52c1d7,_0x63b2ea){return db['OpenchannelAccount']['find']({'where':{'id':_0x52c1d7[_0x16f3('0x56')]['id']}})[_0x16f3('0x21')](handleEntityNotFound(_0x63b2ea,null))[_0x16f3('0x21')](removeEntity(_0x63b2ea,null))[_0x16f3('0x29')](handleError(_0x63b2ea,null));};exports[_0x16f3('0x61')]=function(_0x3373f0,_0x17b09d){return db[_0x16f3('0x50')]['describe']()[_0x16f3('0x21')](respondWithResult(_0x17b09d,null))[_0x16f3('0x29')](handleError(_0x17b09d,null));};exports['addDisposition']=function(_0x4a6c45,_0x32feb9,_0x40a0df){if(_0x4a6c45[_0x16f3('0x60')]['id']){delete _0x4a6c45[_0x16f3('0x60')]['id'];}return db[_0x16f3('0x50')]['find']({'where':{'id':_0x4a6c45[_0x16f3('0x56')]['id']}})[_0x16f3('0x21')](handleEntityNotFound(_0x32feb9,null))[_0x16f3('0x21')](function(_0x4d2054){if(_0x4d2054){_0x4a6c45['body'][_0x16f3('0x62')]=_0x4d2054['id'];return db[_0x16f3('0x63')][_0x16f3('0x5a')](_0x4a6c45[_0x16f3('0x60')]);}})['then'](respondWithResult(_0x32feb9,null))[_0x16f3('0x29')](handleError(_0x32feb9,null));};exports[_0x16f3('0x64')]=function(_0x4fcceb,_0x53dd06,_0x542390){var _0x20b343={'raw':![],'where':{}};var _0x5606fd={};var _0x40a0a2={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x16f3('0x65')]({'where':{'id':_0x4fcceb[_0x16f3('0x56')]['id']}})[_0x16f3('0x21')](handleEntityNotFound(_0x53dd06,null))[_0x16f3('0x21')](function(_0x4ed158){if(_0x4ed158){_0x5606fd[_0x16f3('0x42')]=_[_0x16f3('0x43')](db[_0x16f3('0x63')][_0x16f3('0x3f')]);_0x5606fd[_0x16f3('0x45')]=_[_0x16f3('0x43')](_0x4fcceb['query']);_0x5606fd[_0x16f3('0x4d')]=_[_0x16f3('0x44')](_0x5606fd[_0x16f3('0x42')],_0x5606fd[_0x16f3('0x45')]);_0x20b343['attributes']=_[_0x16f3('0x44')](_0x5606fd[_0x16f3('0x42')],qs[_0x16f3('0x47')](_0x4fcceb[_0x16f3('0x45')]['fields']));_0x20b343[_0x16f3('0x46')]=_0x20b343[_0x16f3('0x46')][_0x16f3('0x48')]?_0x20b343[_0x16f3('0x46')]:_0x5606fd[_0x16f3('0x42')];if(!_0x4fcceb['query'][_0x16f3('0x49')](_0x16f3('0x4a'))){_0x20b343[_0x16f3('0x31')]=qs[_0x16f3('0x31')](_0x4fcceb[_0x16f3('0x45')][_0x16f3('0x31')]);_0x20b343['offset']=qs[_0x16f3('0x30')](_0x4fcceb[_0x16f3('0x45')][_0x16f3('0x30')]);}_0x20b343[_0x16f3('0x66')]=qs[_0x16f3('0x4b')](_0x4fcceb['query']['sort']);_0x20b343[_0x16f3('0x4c')]=qs[_0x16f3('0x4d')](_[_0x16f3('0x4e')](_0x4fcceb[_0x16f3('0x45')],_0x5606fd[_0x16f3('0x4d')]));_0x20b343[_0x16f3('0x4c')][_0x16f3('0x62')]=_0x4ed158['id'];if(_0x4fcceb[_0x16f3('0x45')]['filter']){_0x20b343[_0x16f3('0x4c')]=_['merge'](_0x20b343[_0x16f3('0x4c')],{'$or':_['map'](_0x20b343[_0x16f3('0x46')],function(_0x106ff0){var _0x342cc5={};_0x342cc5[_0x106ff0]={'$like':'%'+_0x4fcceb['query'][_0x16f3('0x67')]+'%'};return _0x342cc5;})});}_0x20b343=_[_0x16f3('0x4f')]({},_0x20b343,_0x4fcceb['options']);return db[_0x16f3('0x63')][_0x16f3('0x2f')]({'where':_0x20b343[_0x16f3('0x4c')]})[_0x16f3('0x21')](function(_0x10ea5f){_0x40a0a2['count']=_0x10ea5f;if(_0x4fcceb[_0x16f3('0x45')]['includeAll']){_0x20b343[_0x16f3('0x52')]=[{'all':!![]}];}return db[_0x16f3('0x63')][_0x16f3('0x53')](_0x20b343);})[_0x16f3('0x21')](function(_0x503544){_0x40a0a2[_0x16f3('0x54')]=_0x503544;return _0x40a0a2;});}})[_0x16f3('0x21')](respondWithFilteredResult(_0x53dd06,_0x20b343))[_0x16f3('0x29')](handleError(_0x53dd06,null));};exports[_0x16f3('0x68')]=function(_0x216844,_0x1ce3bf,_0x1737dc){return db[_0x16f3('0x50')][_0x16f3('0x59')]({'where':{'id':_0x216844[_0x16f3('0x56')]['id']}})['then'](handleEntityNotFound(_0x1ce3bf,null))['then'](function(_0x5814a9){if(_0x5814a9){return _0x5814a9[_0x16f3('0x68')](_0x216844[_0x16f3('0x45')][_0x16f3('0x69')]);}})[_0x16f3('0x21')](respondWithStatusCode(_0x1ce3bf,null))[_0x16f3('0x29')](handleError(_0x1ce3bf,null));};exports[_0x16f3('0x6a')]=function(_0x1cb132,_0x2ac498,_0x12ef1c){if(_0x1cb132['body']['id']){delete _0x1cb132[_0x16f3('0x60')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x1cb132[_0x16f3('0x56')]['id']}})[_0x16f3('0x21')](handleEntityNotFound(_0x2ac498,null))[_0x16f3('0x21')](function(_0x408c01){if(_0x408c01){_0x1cb132[_0x16f3('0x60')][_0x16f3('0x62')]=_0x408c01['id'];return db[_0x16f3('0x6b')][_0x16f3('0x5a')](_0x1cb132[_0x16f3('0x60')]);}})['then'](respondWithResult(_0x2ac498,null))[_0x16f3('0x29')](handleError(_0x2ac498,null));};exports[_0x16f3('0x6c')]=function(_0x2daba1,_0x558df3,_0x41e96a){var _0x6e05ab={'raw':![],'where':{}};var _0x589f8b={};var _0x2d2191={'count':0x0,'rows':[]};return db[_0x16f3('0x50')][_0x16f3('0x65')]({'where':{'id':_0x2daba1[_0x16f3('0x56')]['id']}})[_0x16f3('0x21')](handleEntityNotFound(_0x558df3,null))[_0x16f3('0x21')](function(_0x26c85d){if(_0x26c85d){_0x589f8b[_0x16f3('0x42')]=_[_0x16f3('0x43')](db['CannedAnswer'][_0x16f3('0x3f')]);_0x589f8b[_0x16f3('0x45')]=_[_0x16f3('0x43')](_0x2daba1['query']);_0x589f8b[_0x16f3('0x4d')]=_[_0x16f3('0x44')](_0x589f8b['model'],_0x589f8b[_0x16f3('0x45')]);_0x6e05ab[_0x16f3('0x46')]=_[_0x16f3('0x44')](_0x589f8b[_0x16f3('0x42')],qs[_0x16f3('0x47')](_0x2daba1[_0x16f3('0x45')][_0x16f3('0x47')]));_0x6e05ab[_0x16f3('0x46')]=_0x6e05ab[_0x16f3('0x46')][_0x16f3('0x48')]?_0x6e05ab[_0x16f3('0x46')]:_0x589f8b[_0x16f3('0x42')];if(!_0x2daba1['query'][_0x16f3('0x49')](_0x16f3('0x4a'))){_0x6e05ab['limit']=qs[_0x16f3('0x31')](_0x2daba1[_0x16f3('0x45')][_0x16f3('0x31')]);_0x6e05ab[_0x16f3('0x30')]=qs[_0x16f3('0x30')](_0x2daba1[_0x16f3('0x45')][_0x16f3('0x30')]);}_0x6e05ab['order']=qs['sort'](_0x2daba1[_0x16f3('0x45')][_0x16f3('0x4b')]);_0x6e05ab[_0x16f3('0x4c')]=qs[_0x16f3('0x4d')](_[_0x16f3('0x4e')](_0x2daba1[_0x16f3('0x45')],_0x589f8b[_0x16f3('0x4d')]));_0x6e05ab[_0x16f3('0x4c')][_0x16f3('0x62')]=_0x26c85d['id'];if(_0x2daba1['query'][_0x16f3('0x67')]){_0x6e05ab[_0x16f3('0x4c')]=_[_0x16f3('0x4f')](_0x6e05ab[_0x16f3('0x4c')],{'$or':_[_0x16f3('0x3e')](_0x6e05ab['attributes'],function(_0x57aa5b){var _0x3f6f5f={};_0x3f6f5f[_0x57aa5b]={'$like':'%'+_0x2daba1[_0x16f3('0x45')][_0x16f3('0x67')]+'%'};return _0x3f6f5f;})});}_0x6e05ab=_['merge']({},_0x6e05ab,_0x2daba1[_0x16f3('0x58')]);return db[_0x16f3('0x6b')][_0x16f3('0x2f')]({'where':_0x6e05ab[_0x16f3('0x4c')]})[_0x16f3('0x21')](function(_0x317994){_0x2d2191['count']=_0x317994;if(_0x2daba1[_0x16f3('0x45')]['includeAll']){_0x6e05ab[_0x16f3('0x52')]=[{'all':!![]}];}return db[_0x16f3('0x6b')][_0x16f3('0x53')](_0x6e05ab);})['then'](function(_0xe8120c){_0x2d2191['rows']=_0xe8120c;return _0x2d2191;});}})[_0x16f3('0x21')](respondWithFilteredResult(_0x558df3,_0x6e05ab))[_0x16f3('0x29')](handleError(_0x558df3,null));};exports[_0x16f3('0x6d')]=function(_0x5926c3,_0x2eefa9,_0x1b59d3){return db[_0x16f3('0x50')]['find']({'where':{'id':_0x5926c3[_0x16f3('0x56')]['id']}})[_0x16f3('0x21')](handleEntityNotFound(_0x2eefa9,null))['then'](function(_0x32d0c4){if(_0x32d0c4){return _0x32d0c4['removeAnswers'](_0x5926c3[_0x16f3('0x45')][_0x16f3('0x69')]);}})[_0x16f3('0x21')](respondWithStatusCode(_0x2eefa9,null))[_0x16f3('0x29')](handleError(_0x2eefa9,null));};exports[_0x16f3('0x6e')]=function(_0x271138,_0x52847f,_0xde3476){var _0x1597af={'body':_0x271138['body'],'channel':_0x16f3('0x6f')};var _0x2eab0c=[];var _0x3ed0bf=[];var _0x83c736={};var _0x2acbcf=![];return db[_0x16f3('0x70')][_0x16f3('0x61')]()[_0x16f3('0x21')](function(_0x51f4bc){if(!_0x51f4bc){throw new db[(_0x16f3('0x71'))][(_0x16f3('0x72'))]('no\x20available\x20attributes');}_0x2eab0c=_['difference'](_['keys'](_0x51f4bc),[_0x16f3('0x73'),'updatedAt']);_0x3ed0bf=_['difference'](_[_0x16f3('0x43')](_0x51f4bc),[_0x16f3('0x73'),'updatedAt',_0x16f3('0x74'),_0x16f3('0x75')]);if(_0x271138[_0x16f3('0x60')]['id']){delete _0x271138['body']['id'];}if(_[_0x16f3('0x76')](_0x271138[_0x16f3('0x60')][_0x16f3('0x77')])){throw new db[(_0x16f3('0x71'))][(_0x16f3('0x72'))](_0x16f3('0x78'));}if(_['isNil'](_0x271138[_0x16f3('0x60')][_0x16f3('0x60')])||_0x271138[_0x16f3('0x60')][_0x16f3('0x60')]===''){throw new db[(_0x16f3('0x71'))][(_0x16f3('0x72'))](_0x16f3('0x79'));}if(_['isNil'](_0x271138['body'][_0x16f3('0x7a')])){throw new db['Sequelize'][(_0x16f3('0x72'))](_0x16f3('0x7b')+_0x3ed0bf);}if(!_[_0x16f3('0x7c')](_0x3ed0bf,_0x271138['body'][_0x16f3('0x7a')])){throw new db[(_0x16f3('0x71'))][(_0x16f3('0x72'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3ed0bf);}_0x83c736[_0x271138[_0x16f3('0x60')][_0x16f3('0x7a')]]=_0x271138[_0x16f3('0x60')]['from'];})[_0x16f3('0x21')](function(){return db[_0x16f3('0x50')][_0x16f3('0x59')]({'where':{'id':_0x271138[_0x16f3('0x56')]['id']},'include':[{'model':db[_0x16f3('0x7d')],'as':'List','include':[{'model':db[_0x16f3('0x70')],'as':_0x16f3('0x7e'),'where':_0x83c736,'limit':0x1,'order':[[_0x16f3('0x7f'),_0x16f3('0x80')]]}]},{'model':db[_0x16f3('0x81')],'as':_0x16f3('0x82')}]});})['then'](handleEntityNotFound(_0x52847f,null))['then'](function(_0x502c85){if(_0x502c85&&_0x502c85[_0x16f3('0x83')]){_0x1597af[_0x16f3('0x84')]=_0x502c85;_0x1597af[_0x16f3('0x85')]=_0x502c85[_0x16f3('0x82')];_0x1597af['list']=_0x502c85[_0x16f3('0x83')];_0x1597af['applications']=_[_0x16f3('0x86')](_0x1597af[_0x16f3('0x85')],[_0x16f3('0x87')],[_0x16f3('0x88')]);if(_0x1597af[_0x16f3('0x84')][_0x16f3('0x82')]){delete _0x1597af[_0x16f3('0x84')]['Applications'];}if(_0x1597af[_0x16f3('0x84')]['List']&&_0x1597af[_0x16f3('0x84')][_0x16f3('0x83')][_0x16f3('0x7e')]['length']){return _0x1597af['account']['List']['Contacts'][0x0];}var _0x120954=_[_0x16f3('0x18')](_0x271138[_0x16f3('0x60')],{'firstName':_0x271138[_0x16f3('0x60')][_0x16f3('0x77')],'ListId':_0x502c85[_0x16f3('0x75')]});_0x120954[_0x271138[_0x16f3('0x60')][_0x16f3('0x7a')]]=_0x271138[_0x16f3('0x60')]['from'];return db[_0x16f3('0x70')][_0x16f3('0x5a')](_0x120954,{'fields':_0x2eab0c,'raw':!![]});}})[_0x16f3('0x21')](handleEntityNotFound(_0x52847f,null))['then'](function(_0x15d28f){_0x1597af['contact']=_0x15d28f;if(_0x15d28f){var _0x21f8c1={'ContactId':_0x15d28f['id'],'OpenchannelAccountId':_0x271138[_0x16f3('0x56')]['id'],'from':(_0x15d28f[_0x16f3('0x89')]||'')+'\x20'+(_0x15d28f[_0x16f3('0x8a')]||'')};var _0x511f55={'OpenchannelAccountId':_0x271138[_0x16f3('0x56')]['id'],'closed':![]};if(_0x271138[_0x16f3('0x60')][_0x16f3('0x8b')]){_0x511f55[_0x16f3('0x8b')]=_0x271138[_0x16f3('0x60')][_0x16f3('0x8b')];return db[_0x16f3('0x8c')][_0x16f3('0x59')]({'where':_0x511f55})[_0x16f3('0x21')](function(_0x5f3d1a){if(_0x5f3d1a){return[_0x5f3d1a,![]];}_0x21f8c1[_0x16f3('0x8b')]=_0x271138[_0x16f3('0x60')][_0x16f3('0x8b')];_0x21f8c1[_0x16f3('0x8d')]=_0x271138[_0x16f3('0x60')][_0x16f3('0x8d')];return db[_0x16f3('0x8c')][_0x16f3('0x5a')](_0x21f8c1)[_0x16f3('0x21')](function(_0x21edee){return[_0x21edee,!![]];});});}else{_0x511f55['threadId']=null;}_0x511f55['ContactId']=_0x15d28f['id'];return db[_0x16f3('0x8c')][_0x16f3('0x59')]({'where':_0x511f55})[_0x16f3('0x21')](function(_0x3b1107){if(_0x3b1107){return[_0x3b1107,![]];}return db[_0x16f3('0x8c')][_0x16f3('0x5a')](_0x21f8c1)[_0x16f3('0x21')](function(_0x2c9950){return[_0x2c9950,!![]];});});}})[_0x16f3('0x8e')](function(_0x1ac0e5,_0x3b774f){if(_0x1ac0e5){_0x2acbcf=_0x3b774f;if(!_0x3b774f){var _0x28d296={'from':(_0x1597af['contact'][_0x16f3('0x89')]||'')+'\x20'+(_0x1597af[_0x16f3('0x8f')][_0x16f3('0x8a')]||'')};if(_0x271138[_0x16f3('0x60')][_0x16f3('0x8b')]&&_0x271138[_0x16f3('0x60')][_0x16f3('0x90')]&&_0x271138[_0x16f3('0x60')][_0x16f3('0x8b')]!=_0x271138[_0x16f3('0x60')]['messageId']){_0x28d296[_0x16f3('0x8b')]=_0x271138[_0x16f3('0x60')][_0x16f3('0x90')];}return _0x1ac0e5[_0x16f3('0x36')](_0x28d296);}else{return _0x1ac0e5;}}})['then'](function(_0x5013c3){_0x1597af[_0x16f3('0x91')]=_0x5013c3['get']({'plain':!![]});_0x1597af[_0x16f3('0x91')][_0x16f3('0x92')]=_0x2acbcf;if(_0x1597af[_0x16f3('0x91')][_0x16f3('0x92')]){if(_0x1597af[_0x16f3('0x84')][_0x16f3('0x93')]){_0x1597af['applications'][_0x16f3('0x94')]({'id':0x0,'priority':_0x1597af[_0x16f3('0x85')][_0x16f3('0x48')]+0x1,'app':_0x16f3('0x95'),'appdata':_0x16f3('0x96'),'interval':'*,*,*,*'});}}return db[_0x16f3('0x97')]['create']({'body':_0x271138[_0x16f3('0x60')][_0x16f3('0x60')],'OpenchannelAccountId':_0x271138['params']['id'],'OpenchannelInteractionId':_0x5013c3['id'],'direction':'in','ContactId':_0x1597af[_0x16f3('0x8f')]['id'],'AttachmentId':_0x271138[_0x16f3('0x60')][_0x16f3('0x98')]});})[_0x16f3('0x21')](function(_0x10bb12){_0x1597af[_0x16f3('0x28')]=_0x10bb12;if(_0x1597af[_0x16f3('0x91')][_0x16f3('0x99')]){return db[_0x16f3('0x9a')][_0x16f3('0x59')]({'attributes':['id',_0x16f3('0x3b')],'where':{'id':_0x1597af['interaction'][_0x16f3('0x99')]}})[_0x16f3('0x21')](function(_0x1878ae){if(_0x1878ae){_0x1597af[_0x16f3('0x85')][_0x16f3('0x9b')]({'id':0x0,'priority':0x0,'app':_0x16f3('0x9c'),'appdata':_0x1878ae[_0x16f3('0x3b')]+','+(_0x1597af['account'][_0x16f3('0x9d')]||0xa),'interval':_0x16f3('0x9e')});_0x1597af[_0x16f3('0x9f')]=![];}return respondWithRpcPromise(_0x16f3('0xa0'),_0x16f3('0xa1'),_0x1597af);});}return respondWithRpcPromise(_0x16f3('0xa0'),_0x16f3('0xa1'),_0x1597af);})[_0x16f3('0x21')](function(_0x189832){respondWithRpcPromise(_0x16f3('0xa2'),'EventManager',{'event':_0x16f3('0x6e'),'message':_0x189832},client9002);return _0x189832;})['then'](respondWithResult(_0x52847f,null))[_0x16f3('0x29')](handleError(_0x52847f,null));};exports[_0x16f3('0xa3')]=function(_0x5d00ec,_0x12fb09){var _0x428c84=_0x5d00ec[_0x16f3('0x56')]['id'];var _0x320a07=_0x5d00ec[_0x16f3('0x60')];var _0x42f3ce=0xc8;var _0x26e03f=null;return db[_0x16f3('0xa4')][_0x16f3('0xa5')]({'isolationLevel':db[_0x16f3('0xa4')]['Transaction']['ISOLATION_LEVELS'][_0x16f3('0xa6')]},function(_0x4fa846){return db[_0x16f3('0x50')]['findOne']({'where':{'id':_0x428c84},'transaction':_0x4fa846})['then'](function(_0x3575d1){if(_0x3575d1){return db[_0x16f3('0x81')][_0x16f3('0x37')]({'where':{'OpenchannelAccountId':_0x428c84},'transaction':_0x4fa846})[_0x16f3('0x21')](function(){var _0x4cba92=_[_0x16f3('0x3e')](_0x320a07,function(_0x1ae6d3){_0x1ae6d3[_0x16f3('0x62')]=_0x428c84;return _0x1ae6d3;});return db[_0x16f3('0x81')][_0x16f3('0xa7')](_0x4cba92,{'transaction':_0x4fa846});});}else{_0x42f3ce=0x194;_0x26e03f=[];}});})[_0x16f3('0x21')](function(){if(_0x42f3ce!==0x194){return db[_0x16f3('0x81')][_0x16f3('0xa8')]({'where':{'OpenchannelAccountId':_0x428c84},'order':_0x16f3('0x87')})[_0x16f3('0x21')](function(_0x1d4cf2){_0x26e03f=_0x1d4cf2;});}})[_0x16f3('0x29')](function(_0x185c4f){_0x42f3ce=0x1f4;logger[_0x16f3('0x27')](_0x185c4f['stack']);if(_0x185c4f[_0x16f3('0x3b')]){delete _0x185c4f[_0x16f3('0x3b')];}_0x26e03f=_0x185c4f;})[_0x16f3('0xa9')](function(){if(_0x26e03f===null){_0x12fb09[_0x16f3('0x2a')](_0x42f3ce);}else{if(_0x42f3ce===0x1f4){_0x12fb09[_0x16f3('0x2c')](_0x42f3ce)[_0x16f3('0xaa')](_0x26e03f);}else{_0x12fb09[_0x16f3('0x2c')](_0x42f3ce)[_0x16f3('0x2d')](_0x26e03f);}}});};exports['getApplications']=function(_0x1baaf1,_0x1d37d5,_0x4c74f1){var _0x287fe7={};var _0x4bf409={};var _0x16b5e6;var _0x3a7705;return db[_0x16f3('0x50')][_0x16f3('0x65')]({'where':{'id':_0x1baaf1['params']['id']}})[_0x16f3('0x21')](handleEntityNotFound(_0x1d37d5,null))[_0x16f3('0x21')](function(_0x1c6ccd){if(_0x1c6ccd){_0x16b5e6=_0x1c6ccd;_0x4bf409['model']=_['keys'](db[_0x16f3('0x81')][_0x16f3('0x3f')]);_0x4bf409['query']=_[_0x16f3('0x43')](_0x1baaf1['query']);_0x4bf409[_0x16f3('0x4d')]=_[_0x16f3('0x44')](_0x4bf409[_0x16f3('0x42')],_0x4bf409[_0x16f3('0x45')]);_0x287fe7['attributes']=_[_0x16f3('0x44')](_0x4bf409[_0x16f3('0x42')],qs[_0x16f3('0x47')](_0x1baaf1[_0x16f3('0x45')]['fields']));_0x287fe7[_0x16f3('0x46')]=_0x287fe7[_0x16f3('0x46')]['length']?_0x287fe7[_0x16f3('0x46')]:_0x4bf409[_0x16f3('0x42')];_0x287fe7[_0x16f3('0x66')]=qs[_0x16f3('0x4b')](_0x1baaf1[_0x16f3('0x45')]['sort']);_0x287fe7[_0x16f3('0x4c')]=qs[_0x16f3('0x4d')](_['pick'](_0x1baaf1[_0x16f3('0x45')],_0x4bf409[_0x16f3('0x4d')]));if(_0x1baaf1[_0x16f3('0x45')][_0x16f3('0x67')]){_0x287fe7[_0x16f3('0x4c')]=_['merge'](_0x287fe7[_0x16f3('0x4c')],{'$or':_['map'](_0x287fe7['attributes'],function(_0x2246de){var _0x14664b={};_0x14664b[_0x2246de]={'$like':'%'+_0x1baaf1['query'][_0x16f3('0x67')]+'%'};return _0x14664b;})});}_0x287fe7=_[_0x16f3('0x4f')]({},_0x287fe7,_0x1baaf1[_0x16f3('0x58')]);return _0x16b5e6[_0x16f3('0xab')](_0x287fe7);}})[_0x16f3('0x21')](function(_0x244043){if(_0x244043){_0x3a7705=_0x244043[_0x16f3('0x48')];if(!_0x1baaf1[_0x16f3('0x45')]['hasOwnProperty']('nolimit')){_0x287fe7[_0x16f3('0x31')]=qs[_0x16f3('0x31')](_0x1baaf1['query']['limit']);_0x287fe7[_0x16f3('0x30')]=qs['offset'](_0x1baaf1[_0x16f3('0x45')][_0x16f3('0x30')]);}return _0x16b5e6[_0x16f3('0xab')](_0x287fe7);}})[_0x16f3('0x21')](function(_0x2d1d1f){if(_0x2d1d1f){return _0x2d1d1f?{'count':_0x3a7705,'rows':_0x2d1d1f}:null;}})[_0x16f3('0x21')](respondWithResult(_0x1d37d5,null))[_0x16f3('0x29')](handleError(_0x1d37d5,null));};exports[_0x16f3('0xac')]=function(_0x1e0224,_0x4902d1,_0x536977){var _0x745b08={'raw':![],'where':{}};var _0x1bc1b8={};var _0x716d2d={'count':0x0,'rows':[]};return db[_0x16f3('0x50')][_0x16f3('0x65')]({'where':{'id':_0x1e0224[_0x16f3('0x56')]['id']}})[_0x16f3('0x21')](handleEntityNotFound(_0x4902d1,null))[_0x16f3('0x21')](function(_0x25d008){if(_0x25d008){_0x1bc1b8['model']=_[_0x16f3('0x43')](db['OpenchannelInteraction'][_0x16f3('0x3f')]);_0x1bc1b8[_0x16f3('0x45')]=_[_0x16f3('0x43')](_0x1e0224[_0x16f3('0x45')]);_0x1bc1b8[_0x16f3('0x4d')]=_[_0x16f3('0x44')](_0x1bc1b8[_0x16f3('0x42')],_0x1bc1b8[_0x16f3('0x45')]);_0x745b08['attributes']=_[_0x16f3('0x44')](_0x1bc1b8[_0x16f3('0x42')],qs[_0x16f3('0x47')](_0x1e0224[_0x16f3('0x45')][_0x16f3('0x47')]));_0x745b08[_0x16f3('0x46')]=_0x745b08[_0x16f3('0x46')][_0x16f3('0x48')]?_0x745b08[_0x16f3('0x46')]:_0x1bc1b8[_0x16f3('0x42')];if(!_0x1e0224['query'][_0x16f3('0x49')]('nolimit')){_0x745b08[_0x16f3('0x31')]=qs['limit'](_0x1e0224['query']['limit']);_0x745b08[_0x16f3('0x30')]=qs[_0x16f3('0x30')](_0x1e0224['query'][_0x16f3('0x30')]);}_0x745b08[_0x16f3('0x66')]=qs[_0x16f3('0x4b')](_0x1e0224[_0x16f3('0x45')][_0x16f3('0x4b')]);_0x745b08[_0x16f3('0x4c')]=qs['filters'](_[_0x16f3('0x4e')](_0x1e0224[_0x16f3('0x45')],_0x1bc1b8['filters']));_0x745b08[_0x16f3('0x4c')][_0x16f3('0x62')]=_0x25d008['id'];if(_0x1e0224[_0x16f3('0x45')][_0x16f3('0x67')]){_0x745b08['where']=_[_0x16f3('0x4f')](_0x745b08[_0x16f3('0x4c')],{'$or':_[_0x16f3('0x3e')](_0x745b08[_0x16f3('0x46')],function(_0x1bf808){var _0x7a73b6={};_0x7a73b6[_0x1bf808]={'$like':'%'+_0x1e0224['query'][_0x16f3('0x67')]+'%'};return _0x7a73b6;})});}_0x745b08=_[_0x16f3('0x4f')]({},_0x745b08,_0x1e0224[_0x16f3('0x58')]);return db[_0x16f3('0x8c')][_0x16f3('0x2f')]({'where':_0x745b08[_0x16f3('0x4c')]})['then'](function(_0x3855f1){_0x716d2d[_0x16f3('0x2f')]=_0x3855f1;if(_0x1e0224[_0x16f3('0x45')][_0x16f3('0x51')]){_0x745b08[_0x16f3('0x52')]=[{'model':db['CmContact'],'as':_0x16f3('0xad'),'required':![]},{'model':db[_0x16f3('0x9a')],'as':'Owner','attributes':[_0x16f3('0x3b'),'fullname','internal'],'required':![]},{'model':db[_0x16f3('0xae')],'as':_0x16f3('0xaf'),'attributes':['id',_0x16f3('0x3b'),_0x16f3('0xb0')],'where':_0x1e0224[_0x16f3('0x45')]['tag']?{'id':_0x1e0224['query'][_0x16f3('0xb1')]}:undefined,'required':_0x1e0224['query']['tag']?!![]:![]}];}return db[_0x16f3('0x8c')][_0x16f3('0x53')](_0x745b08);})[_0x16f3('0x21')](function(_0xfd3e45){_0x716d2d[_0x16f3('0x54')]=_0xfd3e45;return _0x716d2d;});}})[_0x16f3('0x21')](respondWithFilteredResult(_0x4902d1,_0x745b08))['catch'](handleError(_0x4902d1,null));};exports['addAgents']=function(_0x1cc6a6,_0x4696af,_0x3047c6){return db[_0x16f3('0x50')][_0x16f3('0x59')]({'where':{'id':_0x1cc6a6['params']['id']}})[_0x16f3('0x21')](handleEntityNotFound(_0x4696af,null))[_0x16f3('0x21')](function(_0x5db2be){if(_0x5db2be){return _0x5db2be[_0x16f3('0xb2')](_0x1cc6a6['body'][_0x16f3('0x69')],_[_0x16f3('0xb3')](_0x1cc6a6[_0x16f3('0x60')],[_0x16f3('0x69'),'id'])||{})[_0x16f3('0x8e')](function(_0x15245e){for(var _0x167dcc=0x0;_0x167dcc<_0x1cc6a6[_0x16f3('0x60')][_0x16f3('0x69')]['length'];_0x167dcc+=0x1){socket[_0x16f3('0xb4')]('userOpenchannelAccount:save',{'UserId':Number(_0x1cc6a6[_0x16f3('0x60')][_0x16f3('0x69')][_0x167dcc]),'OpenchannelAccountId':Number(_0x1cc6a6[_0x16f3('0x56')]['id'])});}return _0x15245e;});}})[_0x16f3('0x21')](respondWithResult(_0x4696af,null))[_0x16f3('0x29')](handleError(_0x4696af,null));};exports[_0x16f3('0xb5')]=function(_0x8d1303,_0x339864,_0x1b2cc8){return db[_0x16f3('0x50')][_0x16f3('0x59')]({'where':{'id':_0x8d1303[_0x16f3('0x56')]['id']}})['then'](handleEntityNotFound(_0x339864,null))[_0x16f3('0x21')](function(_0x32ee6c){if(_0x32ee6c){return _0x32ee6c[_0x16f3('0xb5')](_0x8d1303['query'][_0x16f3('0x69')])[_0x16f3('0x21')](function(){if(_[_0x16f3('0xb6')](_0x8d1303['query'][_0x16f3('0x69')])){for(var _0x33b27a=0x0;_0x33b27a<_0x8d1303['query'][_0x16f3('0x69')][_0x16f3('0x48')];_0x33b27a+=0x1){socket[_0x16f3('0xb4')](_0x16f3('0xb7'),{'UserId':Number(_0x8d1303[_0x16f3('0x45')]['ids'][_0x33b27a]),'OpenchannelAccountId':Number(_0x8d1303[_0x16f3('0x56')]['id'])});}}else{socket[_0x16f3('0xb4')]('userOpenchannelAccount:remove',{'UserId':Number(_0x8d1303[_0x16f3('0x45')][_0x16f3('0x69')]),'OpenchannelAccountId':Number(_0x8d1303[_0x16f3('0x56')]['id'])});}});}})[_0x16f3('0x21')](respondWithStatusCode(_0x339864,null))[_0x16f3('0x29')](handleError(_0x339864,null));};exports['getAgents']=function(_0x3bc8cc,_0x185642,_0x137a69){var _0x5bd031={};var _0x2b0608={};var _0x24d1d2;var _0x9b824f;return db[_0x16f3('0x50')][_0x16f3('0x65')]({'where':{'id':_0x3bc8cc[_0x16f3('0x56')]['id']}})[_0x16f3('0x21')](handleEntityNotFound(_0x185642,null))[_0x16f3('0x21')](function(_0x2fee48){if(_0x2fee48){_0x24d1d2=_0x2fee48;_0x2b0608[_0x16f3('0x42')]=_['keys'](db[_0x16f3('0x9a')]['rawAttributes']);_0x2b0608[_0x16f3('0x45')]=_[_0x16f3('0x43')](_0x3bc8cc[_0x16f3('0x45')]);_0x2b0608[_0x16f3('0x4d')]=_['intersection'](_0x2b0608[_0x16f3('0x42')],_0x2b0608[_0x16f3('0x45')]);_0x5bd031['attributes']=_[_0x16f3('0x44')](_0x2b0608[_0x16f3('0x42')],qs[_0x16f3('0x47')](_0x3bc8cc[_0x16f3('0x45')][_0x16f3('0x47')]));_0x5bd031[_0x16f3('0x46')]=_0x5bd031[_0x16f3('0x46')][_0x16f3('0x48')]?_0x5bd031[_0x16f3('0x46')]:_0x2b0608[_0x16f3('0x42')];_0x5bd031[_0x16f3('0x66')]=qs[_0x16f3('0x4b')](_0x3bc8cc[_0x16f3('0x45')][_0x16f3('0x4b')]);_0x5bd031[_0x16f3('0x4c')]=qs['filters'](_[_0x16f3('0x4e')](_0x3bc8cc[_0x16f3('0x45')],_0x2b0608[_0x16f3('0x4d')]));if(_0x3bc8cc['query']['filter']){_0x5bd031[_0x16f3('0x4c')]=_['merge'](_0x5bd031['where'],{'$or':_[_0x16f3('0x3e')](_0x5bd031[_0x16f3('0x46')],function(_0x761a23){var _0x195e34={};_0x195e34[_0x761a23]={'$like':'%'+_0x3bc8cc[_0x16f3('0x45')][_0x16f3('0x67')]+'%'};return _0x195e34;})});}_0x5bd031=_[_0x16f3('0x4f')]({},_0x5bd031,_0x3bc8cc[_0x16f3('0x58')]);return _0x24d1d2[_0x16f3('0xb8')](_0x5bd031);}})[_0x16f3('0x21')](function(_0x3f4621){if(_0x3f4621){_0x9b824f=_0x3f4621[_0x16f3('0x48')];if(!_0x3bc8cc['query'][_0x16f3('0x49')](_0x16f3('0x4a'))){_0x5bd031[_0x16f3('0x31')]=qs[_0x16f3('0x31')](_0x3bc8cc[_0x16f3('0x45')][_0x16f3('0x31')]);_0x5bd031[_0x16f3('0x30')]=qs[_0x16f3('0x30')](_0x3bc8cc[_0x16f3('0x45')][_0x16f3('0x30')]);}return _0x24d1d2['getAgents'](_0x5bd031);}})['then'](function(_0x3cf5f0){if(_0x3cf5f0){return _0x3cf5f0?{'count':_0x9b824f,'rows':_0x3cf5f0}:null;}})['then'](respondWithResult(_0x185642,null))[_0x16f3('0x29')](handleError(_0x185642,null));};exports['send']=function(_0x13f3bd,_0x236f12,_0xec72cd){var _0x57a844,_0x297147,_0x385916;if(_[_0x16f3('0x76')](_0x13f3bd['body'][_0x16f3('0x60')])||_0x13f3bd[_0x16f3('0x60')][_0x16f3('0x60')]===''){throw new db['Sequelize'][(_0x16f3('0x72'))](_0x16f3('0x79'));}if(_[_0x16f3('0x76')](_0x13f3bd[_0x16f3('0x60')]['to'])){}_0x57a844=_0x13f3bd[_0x16f3('0x60')]['to'];return db['OpenchannelAccount'][_0x16f3('0x65')]({'where':{'id':_0x13f3bd[_0x16f3('0x56')]['id']}})[_0x16f3('0x21')](handleEntityNotFound(_0x236f12,null))[_0x16f3('0x21')](function(_0x481c5f){if(_0x481c5f){return db[_0x16f3('0x50')]['find']({'where':{'id':_0x481c5f['id']},'include':[{'model':db[_0x16f3('0x7d')],'as':_0x16f3('0x83'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{[_0x481c5f['mapKey']]:_0x57a844},'limit':0x1,'order':[[_0x16f3('0x7f'),_0x16f3('0x80')]]}]}]})[_0x16f3('0x21')](handleEntityNotFound(_0x236f12,null))[_0x16f3('0x21')](function(_0xafcd88){if(_0xafcd88&&_0xafcd88[_0x16f3('0x83')]){_0x297147=_0xafcd88[_0x16f3('0xb9')]({'plain':!![]});if(_0x297147[_0x16f3('0x83')]&&_0x297147[_0x16f3('0x83')][_0x16f3('0x7e')][_0x16f3('0x48')]){return _0x297147[_0x16f3('0x83')]['Contacts'][0x0];}return db[_0x16f3('0x70')][_0x16f3('0x5a')](_[_0x16f3('0x18')](_0x13f3bd[_0x16f3('0x60')],{'firstName':_0x57a844,[_0xafcd88[_0x16f3('0x7a')]]:_0x57a844,'phone':_0x57a844,'ListId':_0x297147[_0x16f3('0x75')]}));}})[_0x16f3('0x21')](handleEntityNotFound(_0x236f12,null))['then'](function(_0x44e2a4){if(_0x44e2a4){_0x385916=_0x44e2a4;return db[_0x16f3('0x8c')][_0x16f3('0x59')]({'where':{'ContactId':_0x385916['id'],'closed':![],'OpenchannelAccountId':_0x297147['id']}})['then'](function(_0x5bffd9){if(_0x5bffd9){return[_0x5bffd9,![]];}return db['OpenchannelInteraction']['create']({'UserId':_0x13f3bd[_0x16f3('0x5b')]['id'],'ContactId':_0x385916['id'],'OpenchannelAccountId':_0x297147['id'],'lastMsgDirection':_0x16f3('0xba'),'Messages':[_[_0x16f3('0x4f')](_0x13f3bd[_0x16f3('0x60')],{'read':![],'body':_0x13f3bd[_0x16f3('0x60')][_0x16f3('0x60')],'OpenchannelAccountId':_0x297147['id'],'UserId':_0x13f3bd[_0x16f3('0x5b')]['id'],'ContactId':_0x385916['id']})]},{'include':[{'model':db[_0x16f3('0x97')],'as':'Messages'}]})[_0x16f3('0x21')](function(_0x724710){return[_0x724710,!![]];});});}})[_0x16f3('0x8e')](function(_0x859399,_0x29c7d3){if(_0x29c7d3){return _0x859399;}return db[_0x16f3('0x97')][_0x16f3('0x5a')](_['merge'](_0x13f3bd['body'],{'read':![],'body':_0x13f3bd[_0x16f3('0x60')]['body'],'OpenchannelAccountId':_0x297147['id'],'OpenchannelInteractionId':_0x859399['id'],'UserId':_0x13f3bd[_0x16f3('0x5b')]['id'],'ContactId':_0x385916['id']}))[_0x16f3('0x21')](function(_0x435d8b){_0x859399[_0x16f3('0xbb')][_0x16f3('0xbc')]=[];_0x859399['dataValues']['Messages'][_0x16f3('0x94')](_0x435d8b[_0x16f3('0xbb')]);return _0x859399;});});}})['then'](respondWithResult(_0x236f12,null))[_0x16f3('0x29')](handleError(_0x236f12,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 37f1bbe..82aca93 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 _0xa75b=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0xbe0d6f,_0x42ee0d){var _0x52ba10=function(_0x422120){while(--_0x422120){_0xbe0d6f['push'](_0xbe0d6f['shift']());}};_0x52ba10(++_0x42ee0d);}(_0xa75b,0x170));var _0xba75=function(_0x278fa2,_0x2c134c){_0x278fa2=_0x278fa2-0x0;var _0x407d3c=_0xa75b[_0x278fa2];return _0x407d3c;};'use strict';var EventEmitter=require(_0xba75('0x0'));var OpenchannelAccount=require('../../mysqldb')['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xba75('0x1')](0x0);var events={'afterCreate':_0xba75('0x2'),'afterUpdate':_0xba75('0x3'),'afterDestroy':_0xba75('0x4')};function emitEvent(_0x1760c0){return function(_0x336606,_0x152269,_0x398bd5){OpenchannelAccountEvents[_0xba75('0x5')](_0x1760c0+':'+_0x336606['id'],_0x336606);OpenchannelAccountEvents[_0xba75('0x5')](_0x1760c0,_0x336606);_0x398bd5(null);};}for(var e in events){if(events[_0xba75('0x6')](e)){var event=events[e];OpenchannelAccount[_0xba75('0x7')](e,emitEvent(event));}}module[_0xba75('0x8')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x22fb=['hook','exports','OpenchannelAccount','save','update','remove','emit','hasOwnProperty'];(function(_0x5ec454,_0xfcd77e){var _0x5ebf50=function(_0x29de85){while(--_0x29de85){_0x5ec454['push'](_0x5ec454['shift']());}};_0x5ebf50(++_0xfcd77e);}(_0x22fb,0x192));var _0xb22f=function(_0x2e8107,_0x5edd0c){_0x2e8107=_0x2e8107-0x0;var _0x2027ce=_0x22fb[_0x2e8107];return _0x2027ce;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require('../../mysqldb')['db'][_0xb22f('0x0')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb22f('0x1'),'afterUpdate':_0xb22f('0x2'),'afterDestroy':_0xb22f('0x3')};function emitEvent(_0x10d2c4){return function(_0x201512,_0x50cdab,_0x44717d){OpenchannelAccountEvents[_0xb22f('0x4')](_0x10d2c4+':'+_0x201512['id'],_0x201512);OpenchannelAccountEvents[_0xb22f('0x4')](_0x10d2c4,_0x201512);_0x44717d(null);};}for(var e in events){if(events[_0xb22f('0x5')](e)){var event=events[e];OpenchannelAccount[_0xb22f('0x6')](e,emitEvent(event));}}module[_0xb22f('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 849415e..4df39df 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(_0x2f34e1,_0x3cda13){var _0xde2a3e=function(_0x5ae476){while(--_0x5ae476){_0x2f34e1['push'](_0x2f34e1['shift']());}};_0xde2a3e(++_0x3cda13);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x32ca34,_0x1bb8c6){var _0x23e3fb=function(_0x3e705d){while(--_0x3e705d){_0x32ca34['push'](_0x32ca34['shift']());}};_0x23e3fb(++_0x1bb8c6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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 1d395a8..fac4887 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 _0x34b7=['redis','defaults','localhost','socket.io-emitter','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http'];(function(_0xa72345,_0x1fd304){var _0xbc82fb=function(_0xb1594f){while(--_0xb1594f){_0xa72345['push'](_0xa72345['shift']());}};_0xbc82fb(++_0x1fd304);}(_0x34b7,0x196));var _0x734b=function(_0x3b90ab,_0x174a22){_0x3b90ab=_0x3b90ab-0x0;var _0x206e92=_0x34b7[_0x3b90ab];return _0x206e92;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x734b('0x0'));var BPromise=require(_0x734b('0x1'));var rs=require(_0x734b('0x2'));var fs=require('fs');var Redis=require(_0x734b('0x3'));var db=require(_0x734b('0x4'))['db'];var utils=require(_0x734b('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x734b('0x6'));var jayson=require(_0x734b('0x7'));var client=jayson[_0x734b('0x8')][_0x734b('0x9')]({'port':0x232a});config[_0x734b('0xa')]=_[_0x734b('0xb')](config['redis'],{'host':_0x734b('0xc'),'port':0x18eb});var socket=require(_0x734b('0xd'))(new Redis(config['redis']));require('./openchannelAccount.socket')['register'](socket);function respondWithRpcPromise(_0x19a88e,_0x598dee,_0x43c5e0){return new BPromise(function(_0x333738,_0x2860a2){return client[_0x734b('0xe')](_0x19a88e,_0x43c5e0)[_0x734b('0xf')](function(_0x16e451){logger[_0x734b('0x10')](_0x734b('0x11'),_0x598dee,_0x734b('0x12'));logger[_0x734b('0x13')](_0x734b('0x14'),_0x598dee,_0x734b('0x12'),JSON[_0x734b('0x15')](_0x16e451));if(_0x16e451[_0x734b('0x16')]){if(_0x16e451['error'][_0x734b('0x17')]===0x1f4){logger[_0x734b('0x16')](_0x734b('0x11'),_0x598dee,_0x16e451[_0x734b('0x16')][_0x734b('0x18')]);return _0x2860a2(_0x16e451[_0x734b('0x16')][_0x734b('0x18')]);}logger[_0x734b('0x16')](_0x734b('0x11'),_0x598dee,_0x16e451[_0x734b('0x16')][_0x734b('0x18')]);return _0x333738(_0x16e451['error'][_0x734b('0x18')]);}else{logger[_0x734b('0x10')](_0x734b('0x11'),_0x598dee,_0x734b('0x12'));_0x333738(_0x16e451['result']['message']);}})[_0x734b('0x19')](function(_0x3033cd){logger[_0x734b('0x16')](_0x734b('0x11'),_0x598dee,_0x3033cd);_0x2860a2(_0x3033cd);});});} \ No newline at end of file +var _0x4e81=['request','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x4e81,0x1bc));var _0x14e8=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0x4e81[_0x9c2427];return _0x51984f;};'use strict';var _=require(_0x14e8('0x0'));var util=require(_0x14e8('0x1'));var moment=require(_0x14e8('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x14e8('0x3'))['db'];var utils=require(_0x14e8('0x4'));var logger=require(_0x14e8('0x5'))(_0x14e8('0x6'));var config=require(_0x14e8('0x7'));var jayson=require(_0x14e8('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x14e8('0x9')]=_[_0x14e8('0xa')](config[_0x14e8('0x9')],{'host':_0x14e8('0xb'),'port':0x18eb});var socket=require(_0x14e8('0xc'))(new Redis(config[_0x14e8('0x9')]));require(_0x14e8('0xd'))[_0x14e8('0xe')](socket);function respondWithRpcPromise(_0x294b39,_0x5602cc,_0xbd3b87){return new BPromise(function(_0x3c6bdd,_0x43bfcd){return client[_0x14e8('0xf')](_0x294b39,_0xbd3b87)[_0x14e8('0x10')](function(_0x3ce648){logger[_0x14e8('0x11')](_0x14e8('0x12'),_0x5602cc,'request\x20sent');logger[_0x14e8('0x13')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x5602cc,_0x14e8('0x14'),JSON[_0x14e8('0x15')](_0x3ce648));if(_0x3ce648[_0x14e8('0x16')]){if(_0x3ce648['error'][_0x14e8('0x17')]===0x1f4){logger['error'](_0x14e8('0x12'),_0x5602cc,_0x3ce648['error'][_0x14e8('0x18')]);return _0x43bfcd(_0x3ce648[_0x14e8('0x16')][_0x14e8('0x18')]);}logger[_0x14e8('0x16')]('OpenchannelAccount,\x20%s,\x20%s',_0x5602cc,_0x3ce648[_0x14e8('0x16')][_0x14e8('0x18')]);return _0x3c6bdd(_0x3ce648[_0x14e8('0x16')][_0x14e8('0x18')]);}else{logger[_0x14e8('0x11')](_0x14e8('0x12'),_0x5602cc,_0x14e8('0x14'));_0x3c6bdd(_0x3ce648[_0x14e8('0x19')]['message']);}})[_0x14e8('0x1a')](function(_0x233cd8){logger[_0x14e8('0x16')](_0x14e8('0x12'),_0x5602cc,_0x233cd8);_0x43bfcd(_0x233cd8);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 1d3cfa4..fa4da7b 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 _0xc2cc=['update','emit','register','openchannelAccount:','save','remove'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xc2cc,0x70));var _0xcc2c=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xc2cc[_0x59ee6f];return _0x4c0979;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0xcc2c('0x0'),_0xcc2c('0x1'),_0xcc2c('0x2')];function createListener(_0x5aad8f,_0x2a1a4a){return function(_0x52a81b){_0x2a1a4a[_0xcc2c('0x3')](_0x5aad8f,_0x52a81b);};}function removeListener(_0x47c883,_0x1dc5ec){return function(){OpenchannelAccountEvents['removeListener'](_0x47c883,_0x1dc5ec);};}exports[_0xcc2c('0x4')]=function(_0x539095){for(var _0x5855cc=0x0,_0x475a85=events['length'];_0x5855cc<_0x475a85;_0x5855cc++){var _0x144b90=events[_0x5855cc];var _0x5a276f=createListener(_0xcc2c('0x5')+_0x144b90,_0x539095);OpenchannelAccountEvents['on'](_0x144b90,_0x5a276f);}}; \ No newline at end of file +var _0x35a9=['register','length','openchannelAccount:','save','remove','update','emit','removeListener'];(function(_0x1460f6,_0x59051a){var _0x46ce94=function(_0x1c3ddf){while(--_0x1c3ddf){_0x1460f6['push'](_0x1460f6['shift']());}};_0x46ce94(++_0x59051a);}(_0x35a9,0x73));var _0x935a=function(_0xd5f218,_0x5e0c7b){_0xd5f218=_0xd5f218-0x0;var _0x2bb114=_0x35a9[_0xd5f218];return _0x2bb114;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0x935a('0x0'),_0x935a('0x1'),_0x935a('0x2')];function createListener(_0x27befc,_0x50d208){return function(_0x495439){_0x50d208[_0x935a('0x3')](_0x27befc,_0x495439);};}function removeListener(_0x5f5170,_0x33ac0a){return function(){OpenchannelAccountEvents[_0x935a('0x4')](_0x5f5170,_0x33ac0a);};}exports[_0x935a('0x5')]=function(_0x45994c){for(var _0x28970b=0x0,_0xca82cf=events[_0x935a('0x6')];_0x28970b<_0xca82cf;_0x28970b++){var _0x16a5c2=events[_0x28970b];var _0x534830=createListener(_0x935a('0x7')+_0x16a5c2,_0x45994c);OpenchannelAccountEvents['on'](_0x16a5c2,_0x534830);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index af44a48..c5bb0cd 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 _0xf1b6=['isAuthenticated','show','post','create','put','delete','/:id','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0xf1b6,0x116));var _0x6f1b=function(_0x3ea0bd,_0x459223){_0x3ea0bd=_0x3ea0bd-0x0;var _0x121c8d=_0xf1b6[_0x3ea0bd];return _0x121c8d;};'use strict';var multer=require(_0x6f1b('0x0'));var util=require(_0x6f1b('0x1'));var path=require(_0x6f1b('0x2'));var timeout=require(_0x6f1b('0x3'));var express=require(_0x6f1b('0x4'));var router=express['Router']();var fs_extra=require(_0x6f1b('0x5'));var auth=require(_0x6f1b('0x6'));var interaction=require(_0x6f1b('0x7'));var config=require(_0x6f1b('0x8'));var controller=require('./openchannelApplication.controller');router[_0x6f1b('0x9')]('/',auth[_0x6f1b('0xa')](),controller['index']);router[_0x6f1b('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x6f1b('0xb')]);router[_0x6f1b('0xc')]('/',auth[_0x6f1b('0xa')](),controller[_0x6f1b('0xd')]);router[_0x6f1b('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x6f1b('0xf')](_0x6f1b('0x10'),auth[_0x6f1b('0xa')](),controller['destroy']);module[_0x6f1b('0x11')]=router; \ No newline at end of file +var _0xb4e1=['util','express','fs-extra','../../components/auth/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','show','post','create','put','/:id','delete','destroy','exports','multer'];(function(_0x254b7d,_0x13c2f1){var _0x5c6ece=function(_0x1bb506){while(--_0x1bb506){_0x254b7d['push'](_0x254b7d['shift']());}};_0x5c6ece(++_0x13c2f1);}(_0xb4e1,0x164));var _0x1b4e=function(_0xc2e888,_0x494185){_0xc2e888=_0xc2e888-0x0;var _0x20cedc=_0xb4e1[_0xc2e888];return _0x20cedc;};'use strict';var multer=require(_0x1b4e('0x0'));var util=require(_0x1b4e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1b4e('0x2'));var router=express['Router']();var fs_extra=require(_0x1b4e('0x3'));var auth=require(_0x1b4e('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1b4e('0x5'));var controller=require(_0x1b4e('0x6'));router[_0x1b4e('0x7')]('/',auth[_0x1b4e('0x8')](),controller['index']);router['get']('/:id',auth[_0x1b4e('0x8')](),controller[_0x1b4e('0x9')]);router[_0x1b4e('0xa')]('/',auth[_0x1b4e('0x8')](),controller[_0x1b4e('0xb')]);router[_0x1b4e('0xc')](_0x1b4e('0xd'),auth[_0x1b4e('0x8')](),controller['update']);router[_0x1b4e('0xe')]('/:id',auth[_0x1b4e('0x8')](),controller[_0x1b4e('0xf')]);module[_0x1b4e('0x10')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 0a74013..c3968bd 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 _0x31bb=['INTEGER','STRING','noop','exports'];(function(_0x5c768b,_0x5e88a6){var _0x335af8=function(_0x39b04f){while(--_0x39b04f){_0x5c768b['push'](_0x5c768b['shift']());}};_0x335af8(++_0x5e88a6);}(_0x31bb,0xab));var _0xb31b=function(_0x4f622c,_0x452c80){_0x4f622c=_0x4f622c-0x0;var _0x1e2b50=_0x31bb[_0x4f622c];return _0x1e2b50;};'use strict';var Sequelize=require('sequelize');module[_0xb31b('0x0')]={'priority':{'type':Sequelize[_0xb31b('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xb31b('0x2')],'allowNull':![],'defaultValue':_0xb31b('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xb31b('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x4a12=['noop','TEXT','STRING','*,*,*,*','sequelize','exports','INTEGER'];(function(_0xcf8adf,_0x574dcf){var _0x4bf283=function(_0x7f975f){while(--_0x7f975f){_0xcf8adf['push'](_0xcf8adf['shift']());}};_0x4bf283(++_0x574dcf);}(_0x4a12,0x97));var _0x24a1=function(_0x4cd4e4,_0x1857a2){_0x4cd4e4=_0x4cd4e4-0x0;var _0x18cf3b=_0x4a12[_0x4cd4e4];return _0x18cf3b;};'use strict';var Sequelize=require(_0x24a1('0x0'));module[_0x24a1('0x1')]={'priority':{'type':Sequelize[_0x24a1('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x24a1('0x3')},'appdata':{'type':Sequelize[_0x24a1('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x24a1('0x5')],'defaultValue':_0x24a1('0x6')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index f0a15fc..b3687f4 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 _0x0bf8=['pick','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','find','create','body','update','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','count','set','Content-Range','apply','reject','then','destroy','sendStatus','error','stack','name','send','index','map','OpenchannelApplication','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0xbe200f,_0x4b50eb){var _0x192597=function(_0x106cfd){while(--_0x106cfd){_0xbe200f['push'](_0xbe200f['shift']());}};_0x192597(++_0x4b50eb);}(_0x0bf8,0x140));var _0x80bf=function(_0x5b0779,_0x40d92a){_0x5b0779=_0x5b0779-0x0;var _0x2d8671=_0x0bf8[_0x5b0779];return _0x2d8671;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x80bf('0x0'));var zipdir=require(_0x80bf('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x80bf('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x80bf('0x3'));var util=require(_0x80bf('0x4'));var path=require(_0x80bf('0x5'));var sox=require(_0x80bf('0x6'));var csv=require(_0x80bf('0x7'));var ejs=require(_0x80bf('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x80bf('0x9'));var squel=require(_0x80bf('0xa'));var crypto=require(_0x80bf('0xb'));var jsforce=require(_0x80bf('0xc'));var deskjs=require(_0x80bf('0xd'));var toCsv=require(_0x80bf('0x7'));var querystring=require(_0x80bf('0xe'));var Papa=require(_0x80bf('0xf'));var Redis=require(_0x80bf('0x10'));var authService=require(_0x80bf('0x11'));var qs=require(_0x80bf('0x12'));var as=require(_0x80bf('0x13'));var hardwareService=require(_0x80bf('0x14'));var logger=require(_0x80bf('0x15'))(_0x80bf('0x16'));var utils=require(_0x80bf('0x17'));var config=require(_0x80bf('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x80bf('0x19'))['db'];function respondWithStatusCode(_0x226d7e,_0x190f9a){_0x190f9a=_0x190f9a||0xcc;return function(_0x445167){if(_0x445167){return _0x226d7e['sendStatus'](_0x190f9a);}return _0x226d7e[_0x80bf('0x1a')](_0x190f9a)[_0x80bf('0x1b')]();};}function respondWithResult(_0x850e89,_0x11af0d){_0x11af0d=_0x11af0d||0xc8;return function(_0x35eea3){if(_0x35eea3){return _0x850e89[_0x80bf('0x1a')](_0x11af0d)[_0x80bf('0x1c')](_0x35eea3);}};}function respondWithFilteredResult(_0x4db2fa,_0x5b5475){return function(_0x2838c9){if(_0x2838c9){var _0x1614b7=typeof _0x5b5475[_0x80bf('0x1d')]==='undefined'&&typeof _0x5b5475[_0x80bf('0x1e')]==='undefined';var _0x19320f=_0x2838c9[_0x80bf('0x1f')];var _0x3b70a2=_0x1614b7?0x0:_0x5b5475[_0x80bf('0x1d')];var _0x21b8da=_0x1614b7?_0x2838c9[_0x80bf('0x1f')]:_0x5b5475[_0x80bf('0x1d')]+_0x5b5475['limit'];var _0x30f52c;if(_0x21b8da>=_0x19320f){_0x21b8da=_0x19320f;_0x30f52c=0xc8;}else{_0x30f52c=0xce;}_0x4db2fa['status'](_0x30f52c);return _0x4db2fa[_0x80bf('0x20')](_0x80bf('0x21'),_0x3b70a2+'-'+_0x21b8da+'/'+_0x19320f)['json'](_0x2838c9);}return null;};}function patchUpdates(_0x8479c4){return function(_0x5306ac){try{jsonpatch[_0x80bf('0x22')](_0x5306ac,_0x8479c4,!![]);}catch(_0x98afbd){return BPromise[_0x80bf('0x23')](_0x98afbd);}return _0x5306ac['save']();};}function saveUpdates(_0x470627,_0x4bb085){return function(_0x18f64b){if(_0x18f64b){return _0x18f64b['update'](_0x470627)[_0x80bf('0x24')](function(_0x569a4c){return _0x569a4c;});}return null;};}function removeEntity(_0x148d76,_0xf3b923){return function(_0x5ac629){if(_0x5ac629){return _0x5ac629[_0x80bf('0x25')]()[_0x80bf('0x24')](function(){_0x148d76[_0x80bf('0x1a')](0xcc)[_0x80bf('0x1b')]();});}};}function handleEntityNotFound(_0x6fff94,_0x24cbe8){return function(_0x52a80b){if(!_0x52a80b){_0x6fff94[_0x80bf('0x26')](0x194);}return _0x52a80b;};}function handleError(_0x27adcc,_0x35866e){_0x35866e=_0x35866e||0x1f4;return function(_0x2059ef){logger[_0x80bf('0x27')](_0x2059ef[_0x80bf('0x28')]);if(_0x2059ef[_0x80bf('0x29')]){delete _0x2059ef[_0x80bf('0x29')];}_0x27adcc[_0x80bf('0x1a')](_0x35866e)[_0x80bf('0x2a')](_0x2059ef);};}exports[_0x80bf('0x2b')]=function(_0xed538c,_0x5411a5){var _0x2dbbae={},_0x45c5a1={},_0x34d6a7={'count':0x0,'rows':[]};var _0x2e48f9=_[_0x80bf('0x2c')](db[_0x80bf('0x2d')][_0x80bf('0x2e')],function(_0x218b05){return{'name':_0x218b05['fieldName'],'type':_0x218b05[_0x80bf('0x2f')]['key']};});_0x45c5a1[_0x80bf('0x30')]=_[_0x80bf('0x2c')](_0x2e48f9,_0x80bf('0x29'));_0x45c5a1[_0x80bf('0x31')]=_[_0x80bf('0x32')](_0xed538c[_0x80bf('0x31')]);_0x45c5a1['filters']=_[_0x80bf('0x33')](_0x45c5a1[_0x80bf('0x30')],_0x45c5a1[_0x80bf('0x31')]);_0x2dbbae[_0x80bf('0x34')]=_[_0x80bf('0x33')](_0x45c5a1[_0x80bf('0x30')],qs[_0x80bf('0x35')](_0xed538c[_0x80bf('0x31')]['fields']));_0x2dbbae[_0x80bf('0x34')]=_0x2dbbae[_0x80bf('0x34')][_0x80bf('0x36')]?_0x2dbbae[_0x80bf('0x34')]:_0x45c5a1[_0x80bf('0x30')];if(!_0xed538c[_0x80bf('0x31')][_0x80bf('0x37')](_0x80bf('0x38'))){_0x2dbbae[_0x80bf('0x1e')]=qs['limit'](_0xed538c[_0x80bf('0x31')]['limit']);_0x2dbbae[_0x80bf('0x1d')]=qs[_0x80bf('0x1d')](_0xed538c[_0x80bf('0x31')][_0x80bf('0x1d')]);}_0x2dbbae[_0x80bf('0x39')]=qs[_0x80bf('0x3a')](_0xed538c['query'][_0x80bf('0x3a')]);_0x2dbbae[_0x80bf('0x3b')]=qs['filters'](_[_0x80bf('0x3c')](_0xed538c[_0x80bf('0x31')],_0x45c5a1[_0x80bf('0x3d')]),_0x2e48f9);if(_0xed538c[_0x80bf('0x31')]['filter']){_0x2dbbae[_0x80bf('0x3b')]=_[_0x80bf('0x3e')](_0x2dbbae[_0x80bf('0x3b')],{'$or':_[_0x80bf('0x2c')](_0x2e48f9,function(_0x4cc662){if(_0x4cc662[_0x80bf('0x2f')]!==_0x80bf('0x3f')){var _0x2c3d58={};_0x2c3d58[_0x4cc662[_0x80bf('0x29')]]={'$like':'%'+_0xed538c[_0x80bf('0x31')][_0x80bf('0x40')]+'%'};return _0x2c3d58;}})});}_0x2dbbae=_[_0x80bf('0x3e')]({},_0x2dbbae,_0xed538c[_0x80bf('0x41')]);var _0xfa88da={'where':_0x2dbbae['where']};return db[_0x80bf('0x2d')]['count'](_0xfa88da)['then'](function(_0x40f284){_0x34d6a7[_0x80bf('0x1f')]=_0x40f284;if(_0xed538c[_0x80bf('0x31')][_0x80bf('0x42')]){_0x2dbbae[_0x80bf('0x43')]=[{'all':!![]}];}return db['OpenchannelApplication'][_0x80bf('0x44')](_0x2dbbae);})['then'](function(_0x13b606){_0x34d6a7[_0x80bf('0x45')]=_0x13b606;return _0x34d6a7;})[_0x80bf('0x24')](respondWithFilteredResult(_0x5411a5,_0x2dbbae))[_0x80bf('0x46')](handleError(_0x5411a5,null));};exports['show']=function(_0x97ae8,_0x3c3c87){var _0x4f9574={'raw':!![],'where':{'id':_0x97ae8[_0x80bf('0x47')]['id']}},_0xa254f0={};_0xa254f0[_0x80bf('0x30')]=_[_0x80bf('0x32')](db[_0x80bf('0x2d')][_0x80bf('0x2e')]);_0xa254f0[_0x80bf('0x31')]=_['keys'](_0x97ae8[_0x80bf('0x31')]);_0xa254f0['filters']=_['intersection'](_0xa254f0[_0x80bf('0x30')],_0xa254f0[_0x80bf('0x31')]);_0x4f9574[_0x80bf('0x34')]=_['intersection'](_0xa254f0['model'],qs[_0x80bf('0x35')](_0x97ae8['query']['fields']));_0x4f9574['attributes']=_0x4f9574['attributes'][_0x80bf('0x36')]?_0x4f9574[_0x80bf('0x34')]:_0xa254f0[_0x80bf('0x30')];if(_0x97ae8['query'][_0x80bf('0x42')]){_0x4f9574[_0x80bf('0x43')]=[{'all':!![]}];}_0x4f9574=_['merge']({},_0x4f9574,_0x97ae8[_0x80bf('0x41')]);return db[_0x80bf('0x2d')][_0x80bf('0x48')](_0x4f9574)['then'](handleEntityNotFound(_0x3c3c87,null))['then'](respondWithResult(_0x3c3c87,null))[_0x80bf('0x46')](handleError(_0x3c3c87,null));};exports['create']=function(_0x50047,_0x338c43){return db['OpenchannelApplication'][_0x80bf('0x49')](_0x50047[_0x80bf('0x4a')],{})['then'](respondWithResult(_0x338c43,0xc9))['catch'](handleError(_0x338c43,null));};exports[_0x80bf('0x4b')]=function(_0x42d91f,_0x34b6c7){if(_0x42d91f[_0x80bf('0x4a')]['id']){delete _0x42d91f['body']['id'];}return db[_0x80bf('0x2d')][_0x80bf('0x48')]({'where':{'id':_0x42d91f[_0x80bf('0x47')]['id']}})[_0x80bf('0x24')](handleEntityNotFound(_0x34b6c7,null))['then'](saveUpdates(_0x42d91f['body'],null))['then'](respondWithResult(_0x34b6c7,null))[_0x80bf('0x46')](handleError(_0x34b6c7,null));};exports[_0x80bf('0x25')]=function(_0x413ef4,_0x1235d0){return db[_0x80bf('0x2d')][_0x80bf('0x48')]({'where':{'id':_0x413ef4['params']['id']}})[_0x80bf('0x24')](handleEntityNotFound(_0x1235d0,null))[_0x80bf('0x24')](removeEntity(_0x1235d0,null))[_0x80bf('0x46')](handleError(_0x1235d0,null));}; \ No newline at end of file +var _0xd169=['count','limit','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','index','map','OpenchannelApplication','rawAttributes','fieldName','type','key','name','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','params','keys','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined'];(function(_0x40bc96,_0x34eb43){var _0x1f4c23=function(_0x541648){while(--_0x541648){_0x40bc96['push'](_0x40bc96['shift']());}};_0x1f4c23(++_0x34eb43);}(_0xd169,0x155));var _0x9d16=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0xd169[_0xe66cf2];return _0x2d84e7;};'use strict';var emlformat=require(_0x9d16('0x0'));var rimraf=require(_0x9d16('0x1'));var zipdir=require(_0x9d16('0x2'));var jsonpatch=require(_0x9d16('0x3'));var rp=require(_0x9d16('0x4'));var moment=require(_0x9d16('0x5'));var BPromise=require(_0x9d16('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9d16('0x7'));var fs=require('fs');var fs_extra=require(_0x9d16('0x8'));var _=require(_0x9d16('0x9'));var squel=require(_0x9d16('0xa'));var crypto=require(_0x9d16('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9d16('0xc'));var toCsv=require(_0x9d16('0xd'));var querystring=require(_0x9d16('0xe'));var Papa=require(_0x9d16('0xf'));var Redis=require(_0x9d16('0x10'));var authService=require(_0x9d16('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9d16('0x12'));var hardwareService=require(_0x9d16('0x13'));var logger=require('../../config/logger')(_0x9d16('0x14'));var utils=require(_0x9d16('0x15'));var config=require(_0x9d16('0x16'));var licenseUtil=require(_0x9d16('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x52abbc,_0x44e9df){_0x44e9df=_0x44e9df||0xcc;return function(_0x227de1){if(_0x227de1){return _0x52abbc['sendStatus'](_0x44e9df);}return _0x52abbc[_0x9d16('0x18')](_0x44e9df)[_0x9d16('0x19')]();};}function respondWithResult(_0x3465a2,_0x2c9741){_0x2c9741=_0x2c9741||0xc8;return function(_0x38ab5e){if(_0x38ab5e){return _0x3465a2[_0x9d16('0x18')](_0x2c9741)[_0x9d16('0x1a')](_0x38ab5e);}};}function respondWithFilteredResult(_0xffccdc,_0x2fbcb7){return function(_0x73575a){if(_0x73575a){var _0x4fd02f=typeof _0x2fbcb7[_0x9d16('0x1b')]==='undefined'&&typeof _0x2fbcb7['limit']===_0x9d16('0x1c');var _0x51d1e9=_0x73575a[_0x9d16('0x1d')];var _0x39c35d=_0x4fd02f?0x0:_0x2fbcb7[_0x9d16('0x1b')];var _0x409ef6=_0x4fd02f?_0x73575a[_0x9d16('0x1d')]:_0x2fbcb7[_0x9d16('0x1b')]+_0x2fbcb7[_0x9d16('0x1e')];var _0x479d1b;if(_0x409ef6>=_0x51d1e9){_0x409ef6=_0x51d1e9;_0x479d1b=0xc8;}else{_0x479d1b=0xce;}_0xffccdc[_0x9d16('0x18')](_0x479d1b);return _0xffccdc['set'](_0x9d16('0x1f'),_0x39c35d+'-'+_0x409ef6+'/'+_0x51d1e9)[_0x9d16('0x1a')](_0x73575a);}return null;};}function patchUpdates(_0x116fe6){return function(_0x4daaf0){try{jsonpatch['apply'](_0x4daaf0,_0x116fe6,!![]);}catch(_0x1fb74e){return BPromise[_0x9d16('0x20')](_0x1fb74e);}return _0x4daaf0[_0x9d16('0x21')]();};}function saveUpdates(_0x4e3155,_0x2ed6fd){return function(_0x5c1395){if(_0x5c1395){return _0x5c1395[_0x9d16('0x22')](_0x4e3155)[_0x9d16('0x23')](function(_0x184f3a){return _0x184f3a;});}return null;};}function removeEntity(_0x3e38d0,_0x1b9ba7){return function(_0x486515){if(_0x486515){return _0x486515[_0x9d16('0x24')]()['then'](function(){_0x3e38d0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c6db3,_0x45306e){return function(_0x349a36){if(!_0x349a36){_0x1c6db3[_0x9d16('0x25')](0x194);}return _0x349a36;};}function handleError(_0x475f9a,_0x4dfca9){_0x4dfca9=_0x4dfca9||0x1f4;return function(_0x8fd541){logger[_0x9d16('0x26')](_0x8fd541[_0x9d16('0x27')]);if(_0x8fd541['name']){delete _0x8fd541['name'];}_0x475f9a[_0x9d16('0x18')](_0x4dfca9)['send'](_0x8fd541);};}exports[_0x9d16('0x28')]=function(_0x5d0931,_0x5d212f){var _0x30aff3={},_0x4f1a26={},_0x61bad2={'count':0x0,'rows':[]};var _0x25a9c7=_[_0x9d16('0x29')](db[_0x9d16('0x2a')][_0x9d16('0x2b')],function(_0x16f190){return{'name':_0x16f190[_0x9d16('0x2c')],'type':_0x16f190[_0x9d16('0x2d')][_0x9d16('0x2e')]};});_0x4f1a26['model']=_[_0x9d16('0x29')](_0x25a9c7,_0x9d16('0x2f'));_0x4f1a26['query']=_['keys'](_0x5d0931[_0x9d16('0x30')]);_0x4f1a26['filters']=_[_0x9d16('0x31')](_0x4f1a26['model'],_0x4f1a26[_0x9d16('0x30')]);_0x30aff3['attributes']=_[_0x9d16('0x31')](_0x4f1a26[_0x9d16('0x32')],qs[_0x9d16('0x33')](_0x5d0931['query']['fields']));_0x30aff3[_0x9d16('0x34')]=_0x30aff3[_0x9d16('0x34')][_0x9d16('0x35')]?_0x30aff3[_0x9d16('0x34')]:_0x4f1a26['model'];if(!_0x5d0931[_0x9d16('0x30')][_0x9d16('0x36')](_0x9d16('0x37'))){_0x30aff3[_0x9d16('0x1e')]=qs['limit'](_0x5d0931[_0x9d16('0x30')][_0x9d16('0x1e')]);_0x30aff3[_0x9d16('0x1b')]=qs['offset'](_0x5d0931[_0x9d16('0x30')]['offset']);}_0x30aff3[_0x9d16('0x38')]=qs[_0x9d16('0x39')](_0x5d0931[_0x9d16('0x30')]['sort']);_0x30aff3[_0x9d16('0x3a')]=qs[_0x9d16('0x3b')](_[_0x9d16('0x3c')](_0x5d0931[_0x9d16('0x30')],_0x4f1a26['filters']),_0x25a9c7);if(_0x5d0931[_0x9d16('0x30')][_0x9d16('0x3d')]){_0x30aff3[_0x9d16('0x3a')]=_[_0x9d16('0x3e')](_0x30aff3[_0x9d16('0x3a')],{'$or':_['map'](_0x25a9c7,function(_0x454279){if(_0x454279[_0x9d16('0x2d')]!=='VIRTUAL'){var _0x388a69={};_0x388a69[_0x454279[_0x9d16('0x2f')]]={'$like':'%'+_0x5d0931[_0x9d16('0x30')][_0x9d16('0x3d')]+'%'};return _0x388a69;}})});}_0x30aff3=_[_0x9d16('0x3e')]({},_0x30aff3,_0x5d0931[_0x9d16('0x3f')]);var _0x7f8dbd={'where':_0x30aff3[_0x9d16('0x3a')]};return db['OpenchannelApplication'][_0x9d16('0x1d')](_0x7f8dbd)['then'](function(_0x53dc74){_0x61bad2[_0x9d16('0x1d')]=_0x53dc74;if(_0x5d0931[_0x9d16('0x30')][_0x9d16('0x40')]){_0x30aff3[_0x9d16('0x41')]=[{'all':!![]}];}return db[_0x9d16('0x2a')][_0x9d16('0x42')](_0x30aff3);})[_0x9d16('0x23')](function(_0x36f8d9){_0x61bad2[_0x9d16('0x43')]=_0x36f8d9;return _0x61bad2;})[_0x9d16('0x23')](respondWithFilteredResult(_0x5d212f,_0x30aff3))['catch'](handleError(_0x5d212f,null));};exports['show']=function(_0x1598e2,_0x3d1e50){var _0x15391b={'raw':!![],'where':{'id':_0x1598e2[_0x9d16('0x44')]['id']}},_0x18c23e={};_0x18c23e['model']=_[_0x9d16('0x45')](db[_0x9d16('0x2a')][_0x9d16('0x2b')]);_0x18c23e[_0x9d16('0x30')]=_['keys'](_0x1598e2[_0x9d16('0x30')]);_0x18c23e[_0x9d16('0x3b')]=_[_0x9d16('0x31')](_0x18c23e[_0x9d16('0x32')],_0x18c23e[_0x9d16('0x30')]);_0x15391b[_0x9d16('0x34')]=_[_0x9d16('0x31')](_0x18c23e[_0x9d16('0x32')],qs[_0x9d16('0x33')](_0x1598e2[_0x9d16('0x30')][_0x9d16('0x33')]));_0x15391b['attributes']=_0x15391b['attributes']['length']?_0x15391b[_0x9d16('0x34')]:_0x18c23e[_0x9d16('0x32')];if(_0x1598e2['query']['includeAll']){_0x15391b[_0x9d16('0x41')]=[{'all':!![]}];}_0x15391b=_['merge']({},_0x15391b,_0x1598e2[_0x9d16('0x3f')]);return db[_0x9d16('0x2a')][_0x9d16('0x46')](_0x15391b)[_0x9d16('0x23')](handleEntityNotFound(_0x3d1e50,null))[_0x9d16('0x23')](respondWithResult(_0x3d1e50,null))[_0x9d16('0x47')](handleError(_0x3d1e50,null));};exports['create']=function(_0x516e2c,_0x402002){return db['OpenchannelApplication'][_0x9d16('0x48')](_0x516e2c[_0x9d16('0x49')],{})[_0x9d16('0x23')](respondWithResult(_0x402002,0xc9))[_0x9d16('0x47')](handleError(_0x402002,null));};exports[_0x9d16('0x22')]=function(_0x4621dd,_0x23b6fa){if(_0x4621dd[_0x9d16('0x49')]['id']){delete _0x4621dd[_0x9d16('0x49')]['id'];}return db['OpenchannelApplication'][_0x9d16('0x46')]({'where':{'id':_0x4621dd['params']['id']}})[_0x9d16('0x23')](handleEntityNotFound(_0x23b6fa,null))[_0x9d16('0x23')](saveUpdates(_0x4621dd[_0x9d16('0x49')],null))[_0x9d16('0x23')](respondWithResult(_0x23b6fa,null))[_0x9d16('0x47')](handleError(_0x23b6fa,null));};exports[_0x9d16('0x24')]=function(_0x270cb7,_0x2a5e8c){return db[_0x9d16('0x2a')][_0x9d16('0x46')]({'where':{'id':_0x270cb7[_0x9d16('0x44')]['id']}})[_0x9d16('0x23')](handleEntityNotFound(_0x2a5e8c,null))['then'](removeEntity(_0x2a5e8c,null))[_0x9d16('0x47')](handleError(_0x2a5e8c,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 64fe8cf..a3000d2 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 _0x44e7=['path','rimraf','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4','lodash','moment'];(function(_0x49b73b,_0x49456b){var _0x391e11=function(_0x111b67){while(--_0x111b67){_0x49b73b['push'](_0x49b73b['shift']());}};_0x391e11(++_0x49456b);}(_0x44e7,0xda));var _0x744e=function(_0x1943d9,_0x245bb8){_0x1943d9=_0x1943d9-0x0;var _0x4b4f3f=_0x44e7[_0x1943d9];return _0x4b4f3f;};'use strict';var _=require(_0x744e('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x744e('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x744e('0x2'));var rimraf=require(_0x744e('0x3'));var config=require('../../config/environment');var attributes=require(_0x744e('0x4'));module[_0x744e('0x5')]=function(_0x247e87,_0x8aaed5){return _0x247e87[_0x744e('0x6')](_0x744e('0x7'),attributes,{'tableName':_0x744e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x744e('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x68b9=['openchannel_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','exports','define'];(function(_0x39010b,_0x17e844){var _0x3d8797=function(_0x33924a){while(--_0x33924a){_0x39010b['push'](_0x39010b['shift']());}};_0x3d8797(++_0x17e844);}(_0x68b9,0x12b));var _0x968b=function(_0x249f8c,_0xfb3946){_0x249f8c=_0x249f8c-0x0;var _0x5e224a=_0x68b9[_0x249f8c];return _0x5e224a;};'use strict';var _=require(_0x968b('0x0'));var util=require(_0x968b('0x1'));var logger=require(_0x968b('0x2'))('api');var moment=require('moment');var BPromise=require(_0x968b('0x3'));var rp=require(_0x968b('0x4'));var fs=require('fs');var path=require(_0x968b('0x5'));var rimraf=require(_0x968b('0x6'));var config=require('../../config/environment');var attributes=require('./openchannelApplication.attributes');module[_0x968b('0x7')]=function(_0x5a1329,_0x4bac61){return _0x5a1329[_0x968b('0x8')]('OpenchannelApplication',attributes,{'tableName':_0x968b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x968b('0xa')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 5281db7..25b9810 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 _0xaa11=['OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateOpenchannelApplication','update','body','options','where','attributes','limit','debug','catch','util','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent'];(function(_0xe70f6c,_0x3b734d){var _0x29d959=function(_0x37c8d9){while(--_0x37c8d9){_0xe70f6c['push'](_0xe70f6c['shift']());}};_0x29d959(++_0x3b734d);}(_0xaa11,0xb7));var _0x1aa1=function(_0x21f393,_0x4375ef){_0x21f393=_0x21f393-0x0;var _0x2e28e5=_0xaa11[_0x21f393];return _0x2e28e5;};'use strict';var _=require('lodash');var util=require(_0x1aa1('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1aa1('0x1'))['db'];var utils=require(_0x1aa1('0x2'));var logger=require(_0x1aa1('0x3'))(_0x1aa1('0x4'));var config=require(_0x1aa1('0x5'));var jayson=require(_0x1aa1('0x6'));var client=jayson[_0x1aa1('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x486732,_0x7e9738,_0x4815ee){return new BPromise(function(_0x1feccd,_0x581e3d){return client[_0x1aa1('0x8')](_0x486732,_0x4815ee)[_0x1aa1('0x9')](function(_0x11eff9){logger[_0x1aa1('0xa')](_0x1aa1('0xb'),_0x7e9738,_0x1aa1('0xc'));logger['debug'](_0x1aa1('0xd'),_0x7e9738,_0x1aa1('0xc'),JSON[_0x1aa1('0xe')](_0x11eff9));if(_0x11eff9[_0x1aa1('0xf')]){if(_0x11eff9[_0x1aa1('0xf')][_0x1aa1('0x10')]===0x1f4){logger[_0x1aa1('0xf')]('OpenchannelApplication,\x20%s,\x20%s',_0x7e9738,_0x11eff9[_0x1aa1('0xf')][_0x1aa1('0x11')]);return _0x581e3d(_0x11eff9[_0x1aa1('0xf')][_0x1aa1('0x11')]);}logger['error'](_0x1aa1('0xb'),_0x7e9738,_0x11eff9['error'][_0x1aa1('0x11')]);return _0x1feccd(_0x11eff9[_0x1aa1('0xf')][_0x1aa1('0x11')]);}else{logger[_0x1aa1('0xa')](_0x1aa1('0xb'),_0x7e9738,_0x1aa1('0xc'));_0x1feccd(_0x11eff9[_0x1aa1('0x12')][_0x1aa1('0x11')]);}})['catch'](function(_0x4aef7e){logger[_0x1aa1('0xf')]('OpenchannelApplication,\x20%s,\x20%s',_0x7e9738,_0x4aef7e);_0x581e3d(_0x4aef7e);});});}exports[_0x1aa1('0x13')]=function(_0x4bd613){var _0x55516e=this;return new Promise(function(_0x357b90,_0x514b4d){return db['OpenchannelApplication'][_0x1aa1('0x14')](_0x4bd613[_0x1aa1('0x15')],{'raw':_0x4bd613[_0x1aa1('0x16')]?_0x4bd613['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4bd613['options']?_0x4bd613[_0x1aa1('0x16')][_0x1aa1('0x17')]||null:null,'attributes':_0x4bd613[_0x1aa1('0x16')]?_0x4bd613[_0x1aa1('0x16')][_0x1aa1('0x18')]||null:null,'limit':_0x4bd613['options']?_0x4bd613['options'][_0x1aa1('0x19')]||null:null})['then'](function(_0xc2096){logger[_0x1aa1('0xa')](_0x1aa1('0x13'),_0x4bd613);logger[_0x1aa1('0x1a')]('UpdateOpenchannelApplication',_0x4bd613,JSON[_0x1aa1('0xe')](_0xc2096));_0x357b90(_0xc2096);})[_0x1aa1('0x1b')](function(_0x4bd2a2){logger[_0x1aa1('0xf')](_0x1aa1('0x13'),_0x4bd2a2[_0x1aa1('0x11')],_0x4bd613);_0x514b4d(_0x55516e[_0x1aa1('0xf')](0x1f4,_0x4bd2a2[_0x1aa1('0x11')]));});});}; \ No newline at end of file +var _0xcf01=['update','body','options','raw','where','attributes','limit','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','error','code','OpenchannelApplication,\x20%s,\x20%s','message','result','UpdateOpenchannelApplication'];(function(_0x38b6b5,_0x4d8ed5){var _0x470e92=function(_0x7b7d3a){while(--_0x7b7d3a){_0x38b6b5['push'](_0x38b6b5['shift']());}};_0x470e92(++_0x4d8ed5);}(_0xcf01,0xef));var _0x1cf0=function(_0x257642,_0x270a80){_0x257642=_0x257642-0x0;var _0x3d813b=_0xcf01[_0x257642];return _0x3d813b;};'use strict';var _=require(_0x1cf0('0x0'));var util=require(_0x1cf0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1cf0('0x2'));var fs=require('fs');var Redis=require(_0x1cf0('0x3'));var db=require(_0x1cf0('0x4'))['db'];var utils=require(_0x1cf0('0x5'));var logger=require(_0x1cf0('0x6'))(_0x1cf0('0x7'));var config=require('../../config/environment');var jayson=require(_0x1cf0('0x8'));var client=jayson[_0x1cf0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b6b5c,_0xef8e2b,_0x35a869){return new BPromise(function(_0x179ae6,_0xe5a426){return client[_0x1cf0('0xa')](_0x1b6b5c,_0x35a869)[_0x1cf0('0xb')](function(_0x44b2ce){logger[_0x1cf0('0xc')]('OpenchannelApplication,\x20%s,\x20%s',_0xef8e2b,_0x1cf0('0xd'));logger[_0x1cf0('0xe')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0xef8e2b,_0x1cf0('0xd'),JSON[_0x1cf0('0xf')](_0x44b2ce));if(_0x44b2ce[_0x1cf0('0x10')]){if(_0x44b2ce[_0x1cf0('0x10')][_0x1cf0('0x11')]===0x1f4){logger['error'](_0x1cf0('0x12'),_0xef8e2b,_0x44b2ce[_0x1cf0('0x10')][_0x1cf0('0x13')]);return _0xe5a426(_0x44b2ce[_0x1cf0('0x10')]['message']);}logger[_0x1cf0('0x10')]('OpenchannelApplication,\x20%s,\x20%s',_0xef8e2b,_0x44b2ce[_0x1cf0('0x10')][_0x1cf0('0x13')]);return _0x179ae6(_0x44b2ce[_0x1cf0('0x10')][_0x1cf0('0x13')]);}else{logger[_0x1cf0('0xc')]('OpenchannelApplication,\x20%s,\x20%s',_0xef8e2b,_0x1cf0('0xd'));_0x179ae6(_0x44b2ce[_0x1cf0('0x14')][_0x1cf0('0x13')]);}})['catch'](function(_0xbd4a59){logger[_0x1cf0('0x10')](_0x1cf0('0x12'),_0xef8e2b,_0xbd4a59);_0xe5a426(_0xbd4a59);});});}exports[_0x1cf0('0x15')]=function(_0x41b1bd){var _0x5a7bd3=this;return new Promise(function(_0x290f57,_0x20aa20){return db['OpenchannelApplication'][_0x1cf0('0x16')](_0x41b1bd[_0x1cf0('0x17')],{'raw':_0x41b1bd[_0x1cf0('0x18')]?_0x41b1bd[_0x1cf0('0x18')][_0x1cf0('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x41b1bd['options']?_0x41b1bd[_0x1cf0('0x18')][_0x1cf0('0x1a')]||null:null,'attributes':_0x41b1bd['options']?_0x41b1bd[_0x1cf0('0x18')][_0x1cf0('0x1b')]||null:null,'limit':_0x41b1bd[_0x1cf0('0x18')]?_0x41b1bd['options'][_0x1cf0('0x1c')]||null:null})[_0x1cf0('0xb')](function(_0x4a7f7d){logger['info'](_0x1cf0('0x15'),_0x41b1bd);logger[_0x1cf0('0xe')](_0x1cf0('0x15'),_0x41b1bd,JSON['stringify'](_0x4a7f7d));_0x290f57(_0x4a7f7d);})['catch'](function(_0x1fd7c1){logger[_0x1cf0('0x10')](_0x1cf0('0x15'),_0x1fd7c1['message'],_0x41b1bd);_0x20aa20(_0x5a7bd3[_0x1cf0('0x10')](0x1f4,_0x1fd7c1[_0x1cf0('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index ca00238..e96fa99 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 _0xfc7e=['connect-timeout','express','Router','fs-extra','./openchannelInteraction.controller','get','isAuthenticated','index','describe','/:id','show','download','post','create','/:id/messages','addMessage','tracked','openchannelinteraction:addtags','addTags','put','update','delete','openchannel','openchannelinteraction:destroy','/:id/tags','removeTags','exports','multer','util','path'];(function(_0x31368f,_0x1225db){var _0x61f031=function(_0x4c946e){while(--_0x4c946e){_0x31368f['push'](_0x31368f['shift']());}};_0x61f031(++_0x1225db);}(_0xfc7e,0x165));var _0xefc7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfc7e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xefc7('0x0'));var util=require(_0xefc7('0x1'));var path=require(_0xefc7('0x2'));var timeout=require(_0xefc7('0x3'));var express=require(_0xefc7('0x4'));var router=express[_0xefc7('0x5')]();var fs_extra=require(_0xefc7('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xefc7('0x7'));router[_0xefc7('0x8')]('/',auth[_0xefc7('0x9')](),controller[_0xefc7('0xa')]);router['get']('/describe',auth[_0xefc7('0x9')](),controller[_0xefc7('0xb')]);router['get'](_0xefc7('0xc'),auth[_0xefc7('0x9')](),controller[_0xefc7('0xd')]);router['get']('/:id/messages',auth[_0xefc7('0x9')](),controller['getMessages']);router['get']('/:id/download',auth[_0xefc7('0x9')](),controller[_0xefc7('0xe')]);router[_0xefc7('0xf')]('/',auth[_0xefc7('0x9')](),controller[_0xefc7('0x10')]);router[_0xefc7('0xf')](_0xefc7('0x11'),auth[_0xefc7('0x9')](),controller[_0xefc7('0x12')]);router[_0xefc7('0xf')]('/:id/tags',auth[_0xefc7('0x9')](),interaction[_0xefc7('0x13')]('openchannel',_0xefc7('0x14')),controller[_0xefc7('0x15')]);router[_0xefc7('0x16')](_0xefc7('0xc'),auth[_0xefc7('0x9')](),interaction[_0xefc7('0x13')]('openchannel','openchannelinteraction:update'),controller[_0xefc7('0x17')]);router[_0xefc7('0x18')](_0xefc7('0xc'),auth['isAuthenticated'](),interaction[_0xefc7('0x13')](_0xefc7('0x19'),_0xefc7('0x1a')),controller['destroy']);router['delete'](_0xefc7('0x1b'),auth[_0xefc7('0x9')](),controller[_0xefc7('0x1c')]);module[_0xefc7('0x1d')]=router; \ No newline at end of file +var _0xb41e=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','post','create','addMessage','/:id/tags','openchannel','addTags','put','tracked','openchannelinteraction:update','update','delete','destroy','removeTags','exports','multer','util','path','express'];(function(_0x3e38c1,_0x4f9c74){var _0x4586df=function(_0x8d5b12){while(--_0x8d5b12){_0x3e38c1['push'](_0x3e38c1['shift']());}};_0x4586df(++_0x4f9c74);}(_0xb41e,0x11e));var _0xeb41=function(_0x340d6e,_0x10fdd4){_0x340d6e=_0x340d6e-0x0;var _0x27f273=_0xb41e[_0x340d6e];return _0x27f273;};'use strict';var multer=require(_0xeb41('0x0'));var util=require(_0xeb41('0x1'));var path=require(_0xeb41('0x2'));var timeout=require('connect-timeout');var express=require(_0xeb41('0x3'));var router=express[_0xeb41('0x4')]();var fs_extra=require(_0xeb41('0x5'));var auth=require(_0xeb41('0x6'));var interaction=require(_0xeb41('0x7'));var config=require('../../config/environment');var controller=require(_0xeb41('0x8'));router['get']('/',auth[_0xeb41('0x9')](),controller[_0xeb41('0xa')]);router[_0xeb41('0xb')](_0xeb41('0xc'),auth[_0xeb41('0x9')](),controller[_0xeb41('0xd')]);router[_0xeb41('0xb')](_0xeb41('0xe'),auth[_0xeb41('0x9')](),controller['show']);router[_0xeb41('0xb')]('/:id/messages',auth[_0xeb41('0x9')](),controller['getMessages']);router[_0xeb41('0xb')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0xeb41('0xf')]('/',auth['isAuthenticated'](),controller[_0xeb41('0x10')]);router[_0xeb41('0xf')]('/:id/messages',auth['isAuthenticated'](),controller[_0xeb41('0x11')]);router[_0xeb41('0xf')](_0xeb41('0x12'),auth[_0xeb41('0x9')](),interaction['tracked'](_0xeb41('0x13'),'openchannelinteraction:addtags'),controller[_0xeb41('0x14')]);router[_0xeb41('0x15')](_0xeb41('0xe'),auth[_0xeb41('0x9')](),interaction[_0xeb41('0x16')](_0xeb41('0x13'),_0xeb41('0x17')),controller[_0xeb41('0x18')]);router[_0xeb41('0x19')]('/:id',auth[_0xeb41('0x9')](),interaction[_0xeb41('0x16')]('openchannel','openchannelinteraction:destroy'),controller[_0xeb41('0x1a')]);router[_0xeb41('0x19')](_0xeb41('0x12'),auth[_0xeb41('0x9')](),controller[_0xeb41('0x1b')]);module[_0xeb41('0x1c')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 7f9bf0a..f7825dd 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 _0x23bb=['ENUM','sequelize','exports','BOOLEAN','DATE','STRING'];(function(_0x170eb7,_0x1ac59b){var _0x4dfeac=function(_0x350592){while(--_0x350592){_0x170eb7['push'](_0x170eb7['shift']());}};_0x4dfeac(++_0x1ac59b);}(_0x23bb,0xc1));var _0xb23b=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0x23bb[_0x1a72f3];return _0x57ef47;};'use strict';var Sequelize=require(_0xb23b('0x0'));module[_0xb23b('0x1')]={'closed':{'type':Sequelize[_0xb23b('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb23b('0x3')]},'disposition':{'type':Sequelize[_0xb23b('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xb23b('0x4')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xb23b('0x3')]},'threadId':{'type':Sequelize[_0xb23b('0x4')]},'externalUrl':{'type':Sequelize[_0xb23b('0x4')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xb23b('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xb23b('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0xb23b('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x6183=['STRING','ENUM','out','exports','BOOLEAN','DATE'];(function(_0x508063,_0x38f50e){var _0x3101fc=function(_0x92d6ff){while(--_0x92d6ff){_0x508063['push'](_0x508063['shift']());}};_0x3101fc(++_0x38f50e);}(_0x6183,0x19b));var _0x3618=function(_0x23c73d,_0x357b21){_0x23c73d=_0x23c73d-0x0;var _0x36ba47=_0x6183[_0x23c73d];return _0x36ba47;};'use strict';var Sequelize=require('sequelize');module[_0x3618('0x0')]={'closed':{'type':Sequelize[_0x3618('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3618('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x3618('0x3')]},'thirdDisposition':{'type':Sequelize[_0x3618('0x3')]},'note':{'type':Sequelize[_0x3618('0x3')]},'read1stAt':{'type':Sequelize[_0x3618('0x2')]},'threadId':{'type':Sequelize[_0x3618('0x3')]},'externalUrl':{'type':Sequelize[_0x3618('0x3')]},'lastMsgAt':{'type':Sequelize[_0x3618('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x3618('0x4')]('in',_0x3618('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x3618('0x3')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 3e5ed15..361357b 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 _0x4661=['update','then','destroy','error','stack','name','send','Users','map','fullname','TagIds','Tags','forEach','push','catch','talking','answered','unmanaged','total','closed','waiting','UserId','index','fieldName','type','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','select','field','color','tools_tags','u.id','u.fullname','from','user_has_openchannel_interactions','left_join','users','u.id\x20=\x20ui.UserId','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','expr','search','parseSearch','conditions','length','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)','ContactId','buildExpression','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','some','isEmpty','concat','createdAt','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','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','OpenchannelAccountId','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','sequelize','toString','keyBy','Account.key','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','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','all','rows','params','rawAttributes','includeAll','include','options','create','OpenchannelInteraction','body','describe','ids','omit','getMessages','OpenchannelMessage','OpenchannelInteractionId','merge','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','Tag','openchannelInteractionTags:save','removeTags','unix','root','server','files','join','attachments','transcript-%d-%s.zip','CmContact','lastName','Attachment','Messages','direction','secret','OpenchannelAccount','Account','Owner','mkdirSync','N.A.','closedAt','disposition','threadId','Public','Private','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','firstName','renderFile','views','transcript-','.pdf','Openchannel','createPdfFromHTML','download','log','unlinkSync','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','undefined','count','offset','set','Content-Range','reject','save'];(function(_0x5d9a3f,_0x2fde48){var _0x437203=function(_0x8d966){while(--_0x8d966){_0x5d9a3f['push'](_0x5d9a3f['shift']());}};_0x437203(++_0x2fde48);}(_0x4661,0xd3));var _0x1466=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x4661[_0x2c91e9];return _0x13f0ff;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1466('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1466('0x1'));var rp=require(_0x1466('0x2'));var moment=require(_0x1466('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1466('0x4'));var util=require('util');var path=require(_0x1466('0x5'));var sox=require(_0x1466('0x6'));var csv=require(_0x1466('0x7'));var ejs=require(_0x1466('0x8'));var fs=require('fs');var fs_extra=require(_0x1466('0x9'));var _=require(_0x1466('0xa'));var squel=require('squel');var crypto=require(_0x1466('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x1466('0xc'));var toCsv=require(_0x1466('0x7'));var querystring=require(_0x1466('0xd'));var Papa=require(_0x1466('0xe'));var Redis=require(_0x1466('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x1466('0x10'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x1466('0x11'));var hardwareService=require(_0x1466('0x12'));var logger=require(_0x1466('0x13'))(_0x1466('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1466('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x1466('0x16')](config[_0x1466('0x17')],{'host':_0x1466('0x18'),'port':0x18eb});var socket=require(_0x1466('0x19'))(new Redis(config[_0x1466('0x17')]));require(_0x1466('0x1a'))[_0x1466('0x1b')](socket);function respondWithStatusCode(_0x125469,_0x55e670){_0x55e670=_0x55e670||0xcc;return function(_0x521720){if(_0x521720){return _0x125469[_0x1466('0x1c')](_0x55e670);}return _0x125469[_0x1466('0x1d')](_0x55e670)[_0x1466('0x1e')]();};}function respondWithResult(_0x1f8356,_0x4da249){_0x4da249=_0x4da249||0xc8;return function(_0x4ce416){if(_0x4ce416){return _0x1f8356[_0x1466('0x1d')](_0x4da249)['json'](_0x4ce416);}};}function respondWithFilteredResult(_0x1e7a3f,_0x5db45c){return function(_0x29ffc0){if(_0x29ffc0){var _0x30062b=typeof _0x5db45c['offset']===_0x1466('0x1f')&&typeof _0x5db45c['limit']===_0x1466('0x1f');var _0x3cfdc2=_0x29ffc0[_0x1466('0x20')];var _0x4badd3=_0x30062b?0x0:_0x5db45c[_0x1466('0x21')];var _0x20170c=_0x30062b?_0x29ffc0[_0x1466('0x20')]:_0x5db45c['offset']+_0x5db45c['limit'];var _0x4eec58;if(_0x20170c>=_0x3cfdc2){_0x20170c=_0x3cfdc2;_0x4eec58=0xc8;}else{_0x4eec58=0xce;}_0x1e7a3f[_0x1466('0x1d')](_0x4eec58);return _0x1e7a3f[_0x1466('0x22')](_0x1466('0x23'),_0x4badd3+'-'+_0x20170c+'/'+_0x3cfdc2)['json'](_0x29ffc0);}return null;};}function patchUpdates(_0x4a10eb){return function(_0x1e078b){try{jsonpatch['apply'](_0x1e078b,_0x4a10eb,!![]);}catch(_0xd7f44b){return BPromise[_0x1466('0x24')](_0xd7f44b);}return _0x1e078b[_0x1466('0x25')]();};}function saveUpdates(_0x4ff67a,_0x2979da){return function(_0x404ddc){if(_0x404ddc){return _0x404ddc[_0x1466('0x26')](_0x4ff67a)[_0x1466('0x27')](function(_0x1b189d){return _0x1b189d;});}return null;};}function removeEntity(_0x55bd5e,_0x15e350){return function(_0x4ecbf3){if(_0x4ecbf3){return _0x4ecbf3[_0x1466('0x28')]()[_0x1466('0x27')](function(){_0x55bd5e[_0x1466('0x1d')](0xcc)[_0x1466('0x1e')]();});}};}function handleEntityNotFound(_0x78eead,_0x361188){return function(_0x262ad5){if(!_0x262ad5){_0x78eead[_0x1466('0x1c')](0x194);}return _0x262ad5;};}function handleError(_0x3154c5,_0x5d9a28){_0x5d9a28=_0x5d9a28||0x1f4;return function(_0x5a61f8){logger[_0x1466('0x29')](_0x5a61f8[_0x1466('0x2a')]);if(_0x5a61f8['name']){delete _0x5a61f8[_0x1466('0x2b')];}_0x3154c5[_0x1466('0x1d')](_0x5d9a28)[_0x1466('0x2c')](_0x5a61f8);};}function getInteractionUsers(_0x3599cd,_0x4546ef){return new BPromise(function(_0xa755f,_0xf7d06b){try{if(_0x4546ef[_0x3599cd['id']]){_0x3599cd[_0x1466('0x2d')]=_[_0x1466('0x2e')](_0x4546ef[_0x3599cd['id']],function(_0x2f35a2){return{'id':_0x2f35a2['id'],'fullname':_0x2f35a2[_0x1466('0x2f')]};});}}catch(_0xc4599a){_0xf7d06b(_0xc4599a);}_0xa755f(_0x3599cd);});}function getInteractionTags(_0x213445,_0x457da9){return new BPromise(function(_0x507dec,_0x2da836){try{if(_0x213445[_0x1466('0x30')]){_0x213445[_0x1466('0x31')]=[];_0x213445[_0x1466('0x30')]['split'](',')[_0x1466('0x32')](function(_0x1a4856){_0x213445[_0x1466('0x31')][_0x1466('0x33')](_0x457da9[_0x1a4856]);});}delete _0x213445[_0x1466('0x30')];}catch(_0x4d7c7c){_0x2da836(_0x4d7c7c);}_0x507dec(_0x213445);});}function updateOpenchannelInteraction(_0x17a5f9,_0x535b48,_0x4e9fc3){return new BPromise(function(_0x19e251,_0xee3f2a){return getInteractionUsers(_0x17a5f9,_0x4e9fc3)[_0x1466('0x27')](function(_0x22bec7){return getInteractionTags(_0x22bec7,_0x535b48);})['then'](function(_0xdc0d1d){return getStateInteraction(_0xdc0d1d);})['then'](function(_0x1061d8){_0x19e251(_0x1061d8);})[_0x1466('0x34')](function(_0x17aa77){_0xee3f2a(_0x17aa77);});});}function getStateInteraction(_0x383fd0){return new BPromise(function(_0x41651f){_0x383fd0['waiting']=0x0;_0x383fd0[_0x1466('0x35')]=0x0;_0x383fd0[_0x1466('0x36')]=0x0;_0x383fd0[_0x1466('0x37')]=0x0;_0x383fd0[_0x1466('0x38')]=0x0;if(!_0x383fd0[_0x1466('0x39')]&&!_0x383fd0['UserId']){_0x383fd0[_0x1466('0x3a')]+=0x1;}if(!_0x383fd0['closed']&&_0x383fd0[_0x1466('0x3b')]){_0x383fd0['talking']+=0x1;ids[_0x1466('0x33')](_0x383fd0['id']);if(_0x383fd0[_0x1466('0x3a')]){_0x383fd0['waiting']-=0x1;}}if(_0x383fd0[_0x1466('0x39')]&&_0x383fd0['UserId']){_0x383fd0[_0x1466('0x36')]+=0x1;if(_0x383fd0[_0x1466('0x35')]){_0x383fd0[_0x1466('0x35')]-=0x1;}}if(_0x383fd0[_0x1466('0x39')]&&!_0x383fd0['UserId']){_0x383fd0[_0x1466('0x37')]+=0x1;if(_0x383fd0['waiting']){_0x383fd0[_0x1466('0x3a')]-=0x1;}}_0x383fd0['total']+=0x1;_0x41651f(_0x383fd0);});}exports[_0x1466('0x3c')]=function(_0x5ddec1,_0x34d651){var _0x33eaea={},_0x4a0a7b={},_0x4ad2db={'count':0x0,'rows':[]};var _0x42391a=_[_0x1466('0x2e')](db['OpenchannelInteraction']['rawAttributes'],function(_0x54ffd4){return{'name':_0x54ffd4[_0x1466('0x3d')],'type':_0x54ffd4[_0x1466('0x3e')]['key']};});_0x4a0a7b['model']=_[_0x1466('0x2e')](_0x42391a,_0x1466('0x2b'));_0x4a0a7b[_0x1466('0x3f')]=_[_0x1466('0x40')](_0x5ddec1[_0x1466('0x3f')]);_0x4a0a7b['filters']=_[_0x1466('0x41')](_0x4a0a7b[_0x1466('0x42')],_0x4a0a7b[_0x1466('0x3f')]);_0x33eaea[_0x1466('0x43')]=_['intersection'](_0x4a0a7b[_0x1466('0x42')],qs[_0x1466('0x44')](_0x5ddec1[_0x1466('0x3f')][_0x1466('0x44')]));_0x33eaea[_0x1466('0x43')]=_0x33eaea[_0x1466('0x43')]['length']?_0x33eaea['attributes']:_0x4a0a7b['model'];if(!_0x5ddec1[_0x1466('0x3f')][_0x1466('0x45')](_0x1466('0x46'))){_0x33eaea[_0x1466('0x47')]=qs['limit'](_0x5ddec1['query']['limit']);_0x33eaea[_0x1466('0x21')]=qs[_0x1466('0x21')](_0x5ddec1[_0x1466('0x3f')][_0x1466('0x21')]);}_0x33eaea[_0x1466('0x48')]=qs[_0x1466('0x49')](_0x5ddec1['query'][_0x1466('0x49')]);_0x33eaea[_0x1466('0x4a')]=qs[_0x1466('0x4b')](_[_0x1466('0x4c')](_0x5ddec1[_0x1466('0x3f')],_0x4a0a7b[_0x1466('0x4b')]),_0x42391a);var _0xf6639a=[];var _0x410e24=squel[_0x1466('0x4d')]()[_0x1466('0x4e')]('id')[_0x1466('0x4e')](_0x1466('0x2b'))['field'](_0x1466('0x4f'))['from'](_0x1466('0x50'));var _0xcb6e65=squel[_0x1466('0x4d')]()['field'](_0x1466('0x51'))['field'](_0x1466('0x52'))[_0x1466('0x4e')]('ui.OpenchannelInteractionId')[_0x1466('0x53')](_0x1466('0x54'),'ui')[_0x1466('0x55')](_0x1466('0x56'),'u',_0x1466('0x57'));var _0x1e7997=squel[_0x1466('0x4d')]()['from']('openchannel_interactions','i')['left_join']('cm_contacts','c',_0x1466('0x58'))[_0x1466('0x55')](_0x1466('0x56'),'o',_0x1466('0x59'))[_0x1466('0x55')](_0x1466('0x5a'),'a',_0x1466('0x5b'))['left_join'](_0x1466('0x5c'),'me',_0x1466('0x5d'))[_0x1466('0x55')](_0x1466('0x5e'),'it',_0x1466('0x5f'))[_0x1466('0x55')](_0x1466('0x50'),'t','t.id\x20=\x20it.TagId');var _0x3227c7=squel['expr']();var _0x1fa07e=[];var _0x4f28a3=squel[_0x1466('0x60')]();var _0x502bb6;if(_0x5ddec1[_0x1466('0x3f')][_0x1466('0x61')]){_0x502bb6=as[_0x1466('0x62')](_0x5ddec1[_0x1466('0x3f')][_0x1466('0x61')]);var _0x4d5af9=_0x502bb6['sqlOperator'];for(var _0x222901=0x0;_0x222901<_0x502bb6[_0x1466('0x63')][_0x1466('0x64')];_0x222901++){var _0x384ed5=_0x502bb6['conditions'][_0x222901];var _0x5db717='i';var _0x27f6a6=_[_0x1466('0x65')](_0x42391a,[_0x1466('0x2b'),_0x384ed5[_0x1466('0x4e')]]);if(!_0x27f6a6){switch(_0x384ed5['field']){case _0x1466('0x66'):if(_0x384ed5[_0x1466('0x67')]==0x1){_0x1e7997[_0x1466('0x68')]('`'+_0x384ed5[_0x1466('0x4e')]+_0x1466('0x69'));}else{_0x1e7997[_0x1466('0x68')]('`'+_0x384ed5[_0x1466('0x4e')]+_0x1466('0x6a'));}break;case _0x1466('0x6b'):if(_0x384ed5[_0x1466('0x6c')]===_0x1466('0x6d')){if(_0x384ed5[_0x1466('0x67')][_0x1466('0x6e')]('\x20')[_0x1466('0x64')]>0x1){_0x3227c7[_0x4d5af9](_0x1466('0x6f'),qs['getFullTextValue'](_0x384ed5[_0x1466('0x67')]),null);}else{var _0x49389f='%'+_0x384ed5['value']+'%';_0x3227c7[_0x4d5af9]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x49389f,_0x49389f,_0x49389f);}}else{_0x27f6a6=_[_0x1466('0x65')](_0x42391a,[_0x1466('0x2b'),_0x1466('0x70')]);_0x384ed5['field']=_0x1466('0x70');_0x20d101=as[_0x1466('0x71')](_0x5db717,_0x27f6a6[_0x1466('0x3e')],_0x384ed5);_0x3227c7[_0x4d5af9](_0x20d101[_0x1466('0x72')],_0x20d101[_0x1466('0x67')][_0x1466('0x73')],_0x20d101[_0x1466('0x67')][_0x1466('0x1e')]);}break;case'Tag':var _0x374cd8=_0x384ed5['value']['split'](',')[_0x1466('0x2e')](function(_0x37b3dd){return Number(_0x37b3dd);});_0x374cd8[_0x1466('0x32')](function(_0x1ffb4d){_0x4f28a3['or'](_0x1466('0x74'),'%,'+_0x1ffb4d+',%');});_0x1fa07e=_[_0x1466('0x75')](_0x1fa07e,_0x374cd8);break;case _0x1466('0x76'):if(_0x384ed5['operator']===_0x1466('0x6d')){_0x3227c7[_0x4d5af9](_0x1466('0x77'),'%'+_0x384ed5['value']+'%',null);}else{_0x27f6a6=_['find'](_0x42391a,['name',_0x1466('0x3b')]);_0x384ed5[_0x1466('0x4e')]=_0x1466('0x3b');_0x20d101=as[_0x1466('0x71')](_0x5db717,_0x27f6a6['type'],_0x384ed5);_0x3227c7[_0x4d5af9](_0x20d101[_0x1466('0x72')],_0x20d101['value']['start'],_0x20d101[_0x1466('0x67')][_0x1466('0x1e')]);}break;case'body':_0x20d101=as[_0x1466('0x71')]('me',null,_0x384ed5);_0x3227c7[_0x4d5af9](_0x20d101[_0x1466('0x72')],_0x20d101[_0x1466('0x67')][_0x1466('0x73')],_0x20d101[_0x1466('0x67')][_0x1466('0x1e')]);break;}}else{var _0x20d101=as[_0x1466('0x71')](_0x5db717,_0x27f6a6[_0x1466('0x3e')],_0x384ed5);_0x3227c7[_0x4d5af9](_0x20d101[_0x1466('0x72')],_0x20d101['value']['start'],_0x20d101[_0x1466('0x67')]['end']);}}}else{var _0x5958cf=_(_0x5ddec1[_0x1466('0x3f')])[_0x1466('0x40')]()['map'](function(_0x4f63d1){return _[_0x1466('0x78')](_0x42391a,[_0x1466('0x2b'),_0x4f63d1])?_0x4f63d1:undefined;})['compact']()[_0x1466('0x67')]();if(!_[_0x1466('0x79')](_0x5958cf)){_0x5958cf['forEach'](function(_0x185118){if(_0x185118==='OpenchannelAccountId'){_0x1e7997[_0x1466('0x4a')]('i.OpenchannelAccountId\x20IN\x20?',[][_0x1466('0x7a')](_0x5ddec1['query'][_0x185118]));}else if(_0x185118===_0x1466('0x7b')){var _0x443b57=JSON[_0x1466('0x7c')](_0x5ddec1[_0x1466('0x3f')][_0x185118])['$gte'];var _0x1860b9=JSON[_0x1466('0x7c')](_0x5ddec1[_0x1466('0x3f')][_0x185118])[_0x1466('0x7d')];_0x1e7997[_0x1466('0x4a')](_0x1466('0x7e'),_0x443b57,_0x1860b9);}else{if(_0x5ddec1[_0x1466('0x3f')][_0x185118]===_0x1466('0x7f')){_0x1e7997[_0x1466('0x4a')]('i.'+_0x185118+_0x1466('0x80'));}else{_0x1e7997[_0x1466('0x4a')]('i.'+_0x185118+_0x1466('0x81'),_0x5ddec1[_0x1466('0x3f')][_0x185118]);}}});}if(_0x5ddec1[_0x1466('0x3f')][_0x1466('0x82')]){if(_0x5ddec1[_0x1466('0x3f')][_0x1466('0x82')]==0x1){_0x1e7997[_0x1466('0x68')](_0x1466('0x83'));}else{_0x1e7997[_0x1466('0x68')](_0x1466('0x84'));}}if(_0x5ddec1[_0x1466('0x3f')]['tag']){_0x1fa07e=_[_0x1466('0x85')](_0x5ddec1[_0x1466('0x3f')][_0x1466('0x86')])?_0x5ddec1[_0x1466('0x3f')][_0x1466('0x86')]:new Array(_0x5ddec1[_0x1466('0x3f')][_0x1466('0x86')]);_0x1fa07e[_0x1466('0x32')](function(_0x2c9cf3){_0x4f28a3['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2c9cf3+',%');});}if(_0x5ddec1['query'][_0x1466('0x87')]){var _0x5b3b7f=_0x5ddec1['query']['filter']['replace']('\x5c','\x5c\x5c')[_0x1466('0x88')](/'/g,'\x27\x27');if(qs[_0x1466('0x89')](_0x5b3b7f)){_0x3227c7['or']('i.id\x20LIKE\x20?',_0x5b3b7f+'%');}else{_0x3227c7['or'](_0x1466('0x8a'),qs[_0x1466('0x8b')](_0x5b3b7f))['or']('i.from\x20LIKE\x20?',_0x5b3b7f+'%')['or'](_0x1466('0x8c'),_0x5b3b7f+'%');}}}_0x1e7997[_0x1466('0x4a')](_0x3227c7);_0x1e7997[_0x1466('0x8d')]('i.id');var _0x549372={'type':db[_0x1466('0x8e')][_0x1466('0x8f')][_0x1466('0x90')],'raw':!![]};var _0x43b561=_0x1e7997[_0x1466('0x91')]();_0x43b561['field'](_0x1466('0x92'));_0x43b561['field'](_0x1466('0x93'),_0x1466('0x66'));if(_0x33eaea[_0x1466('0x48')]){_0x33eaea[_0x1466('0x48')][_0x1466('0x32')](function(_0x34ed26){var _0x5ae16c=_0x34ed26[0x0]===_0x1466('0x94')?_0x34ed26[0x0]:'i.'+_0x34ed26[0x0];_0x1e7997[_0x1466('0x48')](_0x5ae16c,_0x34ed26[0x1]===_0x1466('0x95')?![]:!![]);});}if(!_[_0x1466('0x79')](_0x1fa07e)){_0x1e7997['having'](_0x4f28a3);_0x43b561[_0x1466('0x4a')](_0x1466('0x96'),_0x1fa07e);}BPromise[_0x1466('0x97')]()['then'](function(){if(!_0x502bb6){if(_0x5ddec1['query'][_0x1466('0x98')])return;_0x43b561[_0x1466('0x4a')](_0x1466('0x99'));_0x1e7997[_0x1466('0x4a')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x5ddec1[_0x1466('0x9a')]['role']!==_0x1466('0x9b'))return;return _0x5ddec1[_0x1466('0x9a')][_0x1466('0x9c')]({'attributes':['id'],'raw':!![]})['then'](function(_0x1145a6){if(_[_0x1466('0x79')](_0x1145a6)){_0x43b561[_0x1466('0x4a')](_0x1466('0x9d'));_0x1e7997[_0x1466('0x4a')]('i.OpenchannelAccountId\x20IS\x20NULL');}else{_0x43b561[_0x1466('0x4a')]('i.OpenchannelAccountId\x20IN\x20?',_[_0x1466('0x2e')](_0x1145a6,'id'));_0x1e7997[_0x1466('0x4a')](_0x1466('0x9e'),_[_0x1466('0x2e')](_0x1145a6,'id'));}});})['then'](function(){if(_0x5ddec1[_0x1466('0x9a')]['role']==='agent'&&!_0x502bb6&&!_0x5ddec1[_0x1466('0x3f')]['OpenchannelAccountId'])return[];return db[_0x1466('0x9f')][_0x1466('0x3f')](_0x43b561[_0x1466('0xa0')](),_0x549372);})[_0x1466('0x27')](function(_0x4d3e92){_0x4ad2db[_0x1466('0x20')]=_0x4d3e92[_0x1466('0x64')];if(_0x4ad2db[_0x1466('0x20')]===0x0)return[];return db['sequelize'][_0x1466('0x3f')](_0x410e24['toString'](),_0x549372)['then'](function(_0x2c3d82){_0xf6639a=_[_0x1466('0xa1')](_0x2c3d82,'id');_0x549372=_['merge'](_0x549372,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5ddec1[_0x1466('0x3f')][_0x1466('0x44')]){_0x33eaea['attributes'][_0x1466('0x32')](function(_0x1b6801){_0x1e7997[_0x1466('0x4e')]('i.'+_0x1b6801);});}else{_0x1e7997['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x1466('0x66'));_0x1e7997[_0x1466('0x4e')]('a.key',_0x1466('0xa2'));_0x1e7997['field']('a.mandatoryDisposition',_0x1466('0xa3'));_0x1e7997[_0x1466('0x4e')](_0x1466('0xa4'),_0x1466('0x94'));_0x1e7997[_0x1466('0x4e')]('i.*');_0x1e7997['field'](_0x1466('0xa5'),_0x1466('0xa6'));_0x1e7997[_0x1466('0x4e')](_0x1466('0xa7'),'Contact.lastName');_0x1e7997['field'](_0x1466('0xa8'),_0x1466('0xa9'));_0x1e7997[_0x1466('0x4e')](_0x1466('0xaa'),_0x1466('0xab'));_0x1e7997[_0x1466('0x4e')](_0x1466('0xac'),_0x1466('0xad'));_0x1e7997[_0x1466('0x4e')](_0x1466('0xae'),_0x1466('0xaf'));_0x1e7997['field'](_0x1466('0xb0'),_0x1466('0xb1'));_0x1e7997[_0x1466('0x4e')](_0x1466('0xb2'),'Owner.internal');_0x1e7997[_0x1466('0x4e')](_0x1466('0xb3'),_0x1466('0x30'));}if(_0x33eaea['limit'])_0x1e7997[_0x1466('0x47')](_0x33eaea['limit']);if(_0x33eaea[_0x1466('0x21')])_0x1e7997['offset'](_0x33eaea[_0x1466('0x21')]);return db[_0x1466('0x9f')]['query'](_0x1e7997[_0x1466('0xa0')](),_0x549372);})['then'](function(_0x3a1c9b){if(_0x3a1c9b[_0x1466('0x64')]>0x0)_0xcb6e65[_0x1466('0x4a')](_0x1466('0xb4'),_[_0x1466('0x2e')](_0x3a1c9b,'id'));return db[_0x1466('0x9f')][_0x1466('0x3f')](_0xcb6e65['toString'](),_0x549372)[_0x1466('0x27')](function(_0x3d529d){var _0x396eab=_[_0x1466('0xb5')](_0x3d529d,'OpenchannelInteractionId');var _0x2e8458=[];_0x3a1c9b[_0x1466('0x32')](function(_0x3622ab){_0x2e8458[_0x1466('0x33')](updateOpenchannelInteraction(_0x3622ab,_0xf6639a,_0x396eab));});return BPromise[_0x1466('0xb6')](_0x2e8458);});});})['then'](function(_0x39fd81){_0x4ad2db[_0x1466('0xb7')]=_0x39fd81;return _0x4ad2db;})[_0x1466('0x27')](respondWithFilteredResult(_0x34d651,_0x33eaea))[_0x1466('0x34')](handleError(_0x34d651,null));};exports['show']=function(_0x98adb7,_0x4be892){var _0x4109d9={};if(_0x98adb7[_0x1466('0x3f')][_0x1466('0x3e')]&&_0x98adb7[_0x1466('0x3f')]['type']===_0x1466('0x53')){_0x4109d9[_0x1466('0x53')]=_0x98adb7[_0x1466('0xb8')]['id'];}else{_0x4109d9['id']=_0x98adb7[_0x1466('0xb8')]['id'];}var _0x35e3a1={'raw':![],'where':_0x4109d9},_0x29df57={};_0x29df57[_0x1466('0x42')]=_[_0x1466('0x40')](db['OpenchannelInteraction'][_0x1466('0xb9')]);_0x29df57[_0x1466('0x3f')]=_['keys'](_0x98adb7[_0x1466('0x3f')]);_0x29df57[_0x1466('0x4b')]=_[_0x1466('0x41')](_0x29df57[_0x1466('0x42')],_0x29df57[_0x1466('0x3f')]);_0x35e3a1['attributes']=_['intersection'](_0x29df57[_0x1466('0x42')],qs[_0x1466('0x44')](_0x98adb7[_0x1466('0x3f')][_0x1466('0x44')]));_0x35e3a1[_0x1466('0x43')]=_0x35e3a1[_0x1466('0x43')][_0x1466('0x64')]?_0x35e3a1['attributes']:_0x29df57['model'];if(_0x98adb7[_0x1466('0x3f')][_0x1466('0xba')]){_0x35e3a1[_0x1466('0xbb')]=[{'all':!![]}];}_0x35e3a1=_['merge']({},_0x35e3a1,_0x98adb7[_0x1466('0xbc')]);return db['OpenchannelInteraction']['find'](_0x35e3a1)[_0x1466('0x27')](handleEntityNotFound(_0x4be892,null))[_0x1466('0x27')](respondWithResult(_0x4be892,null))[_0x1466('0x34')](handleError(_0x4be892,null));};exports[_0x1466('0xbd')]=function(_0x152c6d,_0x3cf8ae){return db[_0x1466('0xbe')][_0x1466('0xbd')](_0x152c6d[_0x1466('0xbf')],{})['then'](respondWithResult(_0x3cf8ae,0xc9))[_0x1466('0x34')](handleError(_0x3cf8ae,null));};exports['update']=function(_0x228a7a,_0xb55aa4){if(_0x228a7a[_0x1466('0xbf')]['id']){delete _0x228a7a['body']['id'];}return db['OpenchannelInteraction']['find']({'where':{'id':_0x228a7a[_0x1466('0xb8')]['id']}})[_0x1466('0x27')](handleEntityNotFound(_0xb55aa4,null))[_0x1466('0x27')](saveUpdates(_0x228a7a[_0x1466('0xbf')],null))[_0x1466('0x27')](respondWithResult(_0xb55aa4,null))['catch'](handleError(_0xb55aa4,null));};exports[_0x1466('0x28')]=function(_0x4ac117,_0x4efcf9){return db[_0x1466('0xbe')][_0x1466('0x65')]({'where':{'id':_0x4ac117[_0x1466('0xb8')]['id']}})['then'](handleEntityNotFound(_0x4efcf9,null))[_0x1466('0x27')](removeEntity(_0x4efcf9,null))['catch'](handleError(_0x4efcf9,null));};exports[_0x1466('0xc0')]=function(_0x2f0995,_0x5d3166){return db[_0x1466('0xbe')][_0x1466('0xc0')]()[_0x1466('0x27')](respondWithResult(_0x5d3166,null))['catch'](handleError(_0x5d3166,null));};exports['addMessage']=function(_0x468ac9,_0x2971cd,_0x44cea6){return db['OpenchannelMessage']['find']({'where':{'id':_0x468ac9['params']['id']}})['then'](handleEntityNotFound(_0x2971cd,null))[_0x1466('0x27')](function(_0x1e0686){if(_0x1e0686){return _0x1e0686['addMessage'](_0x468ac9[_0x1466('0xbf')][_0x1466('0xc1')],_[_0x1466('0xc2')](_0x468ac9[_0x1466('0xbf')],[_0x1466('0xc1'),'id'])||{});}})[_0x1466('0x27')](respondWithResult(_0x2971cd,null))['catch'](handleError(_0x2971cd,null));};exports[_0x1466('0xc3')]=function(_0x229baf,_0x256594,_0x456229){var _0x352b0d={'raw':![],'where':{}};var _0x4f45bb={};var _0xff072={'count':0x0,'rows':[]};return db[_0x1466('0xbe')]['findOne']({'where':{'id':_0x229baf['params']['id']}})[_0x1466('0x27')](handleEntityNotFound(_0x256594,null))[_0x1466('0x27')](function(_0x5124a6){if(_0x5124a6){_0x4f45bb['model']=_[_0x1466('0x40')](db[_0x1466('0xc4')]['rawAttributes']);_0x4f45bb[_0x1466('0x3f')]=_[_0x1466('0x40')](_0x229baf[_0x1466('0x3f')]);_0x4f45bb['filters']=_[_0x1466('0x41')](_0x4f45bb[_0x1466('0x42')],_0x4f45bb[_0x1466('0x3f')]);_0x352b0d[_0x1466('0x43')]=_['intersection'](_0x4f45bb[_0x1466('0x42')],qs[_0x1466('0x44')](_0x229baf['query'][_0x1466('0x44')]));_0x352b0d[_0x1466('0x43')]=_0x352b0d[_0x1466('0x43')]['length']?_0x352b0d['attributes']:_0x4f45bb[_0x1466('0x42')];if(!_0x229baf[_0x1466('0x3f')][_0x1466('0x45')](_0x1466('0x46'))){_0x352b0d[_0x1466('0x47')]=qs[_0x1466('0x47')](_0x229baf[_0x1466('0x3f')]['limit']);_0x352b0d['offset']=qs[_0x1466('0x21')](_0x229baf[_0x1466('0x3f')][_0x1466('0x21')]);}_0x352b0d[_0x1466('0x48')]=qs['sort'](_0x229baf['query'][_0x1466('0x49')]);_0x352b0d[_0x1466('0x4a')]=qs['filters'](_['pick'](_0x229baf[_0x1466('0x3f')],_0x4f45bb['filters']));_0x352b0d['where'][_0x1466('0xc5')]=_0x5124a6['id'];if(_0x229baf['query'][_0x1466('0x87')]){_0x352b0d[_0x1466('0x4a')]=_[_0x1466('0xc6')](_0x352b0d['where'],{'$or':_[_0x1466('0x2e')](_0x352b0d[_0x1466('0x43')],function(_0x564a54){var _0x1fc755={};_0x1fc755[_0x564a54]={'$like':'%'+_0x229baf[_0x1466('0x3f')][_0x1466('0x87')]+'%'};return _0x1fc755;})});}if(_0x229baf[_0x1466('0x3f')][_0x1466('0xc7')]){var _0x529724=_0x229baf[_0x1466('0x3f')][_0x1466('0xc7')][_0x1466('0x6e')](',');var _0x3edc0e={};_0x3edc0e[_0x529724[0x0]]={'$gte':moment(_0x529724[0x1])[_0x1466('0xc8')](_0x1466('0xc9'))};_0x352b0d[_0x1466('0x4a')]=_['merge'](_0x352b0d['where'],_0x3edc0e);}_0x352b0d=_[_0x1466('0xc6')]({},_0x352b0d,_0x229baf[_0x1466('0xbc')]);return db[_0x1466('0xc4')][_0x1466('0x20')]({'where':_0x352b0d[_0x1466('0x4a')]})[_0x1466('0x27')](function(_0x168a76){_0xff072[_0x1466('0x20')]=_0x168a76;if(_0x229baf[_0x1466('0x3f')][_0x1466('0xba')]){_0x352b0d['include']=[{'all':!![]}];}return db['OpenchannelMessage'][_0x1466('0xca')](_0x352b0d);})[_0x1466('0x27')](function(_0x5d933c){_0xff072[_0x1466('0xb7')]=_0x5d933c;return _0xff072;});}})[_0x1466('0x27')](respondWithFilteredResult(_0x256594,_0x352b0d))['catch'](handleError(_0x256594,null));};exports[_0x1466('0xcb')]=function(_0x397d63,_0x12af8b,_0x57ad9f){return db[_0x1466('0xbe')][_0x1466('0x65')]({'where':{'id':_0x397d63[_0x1466('0xb8')]['id']}})[_0x1466('0x27')](handleEntityNotFound(_0x12af8b,null))[_0x1466('0x27')](function(_0x8509c7){if(_0x8509c7){return _0x8509c7[_0x1466('0xcc')](_0x397d63[_0x1466('0xbf')]['ids'],_[_0x1466('0xc2')](_0x397d63[_0x1466('0xbf')],[_0x1466('0xc1'),'id'])||{})[_0x1466('0xcd')](function(){return db[_0x1466('0xce')][_0x1466('0xca')]({'attributes':['id',_0x1466('0x2b'),'color'],'where':{'id':_0x397d63['body'][_0x1466('0xc1')]}});})[_0x1466('0x27')](function(_0x236a09){socket['emit'](_0x1466('0xcf'),{'id':Number(_0x397d63['params']['id']),'tags':_0x236a09||[]});return{'id':Number(_0x397d63[_0x1466('0xb8')]['id']),'tags':_0x236a09||[]};});}})[_0x1466('0x27')](respondWithResult(_0x12af8b,null))[_0x1466('0x34')](handleError(_0x12af8b,null));};exports[_0x1466('0xd0')]=function(_0x2b8cd1,_0xf09ad6,_0x3e3df2){return db[_0x1466('0xbe')]['find']({'where':{'id':_0x2b8cd1[_0x1466('0xb8')]['id']}})[_0x1466('0x27')](handleEntityNotFound(_0xf09ad6,null))[_0x1466('0x27')](function(_0x51e6a7){if(_0x51e6a7){return _0x51e6a7[_0x1466('0xd0')](_0x2b8cd1[_0x1466('0x3f')][_0x1466('0xc1')]);}})['then'](respondWithStatusCode(_0xf09ad6,null))['catch'](handleError(_0xf09ad6,null));};exports['download']=function(_0x2e8c8e,_0x2b8644){var _0x462e23=moment()[_0x1466('0xd1')]()[_0x1466('0xa0')]();var _0x18f459=path['join'](config[_0x1466('0xd2')],_0x1466('0xd3'),_0x1466('0xd4'),'tmp');var _0x4b27ae=path[_0x1466('0xd5')](config[_0x1466('0xd2')],_0x1466('0xd3'),_0x1466('0xd4'),_0x1466('0xd6'));var _0x4a70c0=path[_0x1466('0xd5')](_0x18f459,_0x462e23);var _0x178336=util[_0x1466('0xc8')](_0x1466('0xd7'),_0x2e8c8e[_0x1466('0xb8')]['id'],_0x462e23);var _0x249ffc=path[_0x1466('0xd5')](_0x18f459,_0x178336);var _0x4657f6=[];_0x4657f6['push']({'model':db[_0x1466('0x76')],'as':_0x1466('0x76'),'attributes':['id',_0x1466('0x2f')],'raw':!![]});_0x4657f6[_0x1466('0x33')]({'model':db[_0x1466('0xd8')],'as':'Contact','attributes':['id','firstName',_0x1466('0xd9')],'raw':!![]});if(_0x2e8c8e[_0x1466('0x3f')][_0x1466('0xd6')]){_0x4657f6[_0x1466('0x33')]({'model':db[_0x1466('0xda')],'as':_0x1466('0xda'),'raw':!![]});}var _0x4c7af7=[{'model':db[_0x1466('0xc4')],'as':_0x1466('0xdb'),'attributes':['id',_0x1466('0xbf'),_0x1466('0x7b'),_0x1466('0xdc'),_0x1466('0xdd'),_0x1466('0x82')],'include':_0x4657f6}];_0x4c7af7['push']({'model':db[_0x1466('0xde')],'as':_0x1466('0xdf'),'attributes':['id',_0x1466('0x2b')]});_0x4c7af7[_0x1466('0x33')]({'model':db[_0x1466('0x76')],'as':_0x1466('0xe0'),'attributes':['id',_0x1466('0x2f')]});return db[_0x1466('0xbe')]['find']({'where':{'id':_0x2e8c8e[_0x1466('0xb8')]['id']},'include':_0x4c7af7})['then'](handleEntityNotFound(_0x2b8644,null))[_0x1466('0x27')](function(_0x40ee71){if(_0x40ee71){var _0x4cb0b4=_0x40ee71['get']({'plain':!![]});fs[_0x1466('0xe1')](_0x4a70c0);var _0x3b188a={'channel':'Openchannel','account':_0x4cb0b4[_0x1466('0xdf')][_0x1466('0x2b')],'agent':_0x4cb0b4[_0x1466('0xe0')]?_0x4cb0b4[_0x1466('0xe0')]['fullname']:_0x1466('0xe2'),'createdAt':moment(_0x4cb0b4[_0x1466('0x7b')])[_0x1466('0xc8')]('YYYY-MM-DD\x20HH:mm:ss')[_0x1466('0xa0')](),'closedAt':_0x4cb0b4[_0x1466('0x39')]?moment(_0x4cb0b4[_0x1466('0xe3')])[_0x1466('0xc8')](_0x1466('0xc9'))['toString']():'','disposition':_0x4cb0b4[_0x1466('0xe4')],'visibility':_0x4cb0b4[_0x1466('0xe5')]?_0x1466('0xe6'):_0x1466('0xe7'),'messages':_(_0x4cb0b4[_0x1466('0xdb')])[_0x1466('0x87')]({'secret':![]})[_0x1466('0x2e')](function(_0x44dfa0){if(_0x44dfa0[_0x1466('0xda')]){var _0xadddc7=path[_0x1466('0xd5')](_0x4b27ae,_0x44dfa0['Attachment'][_0x1466('0xe8')]);if(fs[_0x1466('0xe9')](_0xadddc7)){fs[_0x1466('0xea')](_0xadddc7)[_0x1466('0xeb')](fs[_0x1466('0xec')](path[_0x1466('0xd5')](_0x4a70c0,_0x44dfa0[_0x1466('0xda')][_0x1466('0xe8')])));}}return{'date':moment(_0x44dfa0[_0x1466('0x7b')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x44dfa0[_0x1466('0xdc')]===_0x1466('0xed')?_0x44dfa0[_0x1466('0x76')]?_0x44dfa0['User'][_0x1466('0x2f')]:_0x1466('0xee'):_0x44dfa0[_0x1466('0x6b')][_0x1466('0xef')]+(_0x44dfa0['Contact']['lastName']?'\x20'+_0x44dfa0[_0x1466('0x6b')][_0x1466('0xd9')]:''),'body':_0x44dfa0[_0x1466('0xda')]?_0x44dfa0[_0x1466('0xda')][_0x1466('0xe8')]:_0x44dfa0[_0x1466('0xbf')],'direction':_0x44dfa0[_0x1466('0xdc')]===_0x1466('0xed')?'A':'C','secret':_0x44dfa0[_0x1466('0xdd')],'read':_0x44dfa0[_0x1466('0x82')],'attachment':_0x44dfa0[_0x1466('0xda')]};})[_0x1466('0x67')]()};return ejs[_0x1466('0xf0')](path[_0x1466('0xd5')](config[_0x1466('0xd2')],'server',_0x1466('0xf1'),'downloadInteraction.ejs'),{'interaction':_0x3b188a})[_0x1466('0x27')](function(_0x383ea2){var _0x11ce4b=path[_0x1466('0xd5')](_0x4a70c0,_0x1466('0xf2')+_0x4cb0b4['id']+'-'+_0x462e23+_0x1466('0xf3'));var _0x15e0e5={'path':_0x11ce4b,'channel':_0x1466('0xf4'),'interactionId':_0x4cb0b4['id']};return pdf[_0x1466('0xf5')](_0x383ea2,_0x15e0e5);})['then'](function(){return new BPromise(function(_0x3bc96e,_0x102d5e){zipdir(_0x4a70c0,{'saveTo':_0x249ffc},function(_0x37a550,_0x93d19e){if(_0x37a550)return _0x102d5e(_0x37a550);return _0x3bc96e(_0x93d19e);});})[_0x1466('0x27')](function(){return new BPromise(function(_0x2f9224,_0x2f58ad){rimraf(_0x4a70c0,function(_0x4aa557){if(_0x4aa557)_0x2f58ad(_0x4aa557);return _0x2f9224();});});})[_0x1466('0x27')](function(){return _0x2b8644[_0x1466('0xf6')](_0x249ffc,_0x178336,function(_0x2628c1){if(_0x2628c1){console[_0x1466('0xf7')]('err',_0x2628c1);}else{fs[_0x1466('0xf8')](_0x249ffc);}});});});}else{return _0x2b8644[_0x1466('0x1c')](0xc8);}})[_0x1466('0x34')](handleError(_0x2b8644,null));}; \ No newline at end of file +var _0x6465=['i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','OpenchannelInteraction','a.key','Account.key','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','c.email','c.phone','Contact.phone','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','all','rows','show','params','includeAll','options','create','update','describe','addMessage','OpenchannelMessage','ids','getMessages','OpenchannelInteractionId','YYYY-MM-DD\x20HH:mm:ss','include','addTags','setTags','omit','spread','emit','openchannelInteractionTags:save','download','unix','join','root','files','attachments','format','transcript-%d-%s.zip','CmContact','Contact','lastName','Attachment','direction','secret','OpenchannelAccount','Account','Owner','Openchannel','N.A.','closedAt','disposition','threadId','Public','Private','basename','existsSync','createWriteStream','out','System','firstName','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','err','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','sendStatus','status','end','json','limit','undefined','count','offset','set','apply','reject','save','then','destroy','error','stack','name','send','Users','map','fullname','TagIds','Tags','push','catch','waiting','talking','unmanaged','total','closed','UserId','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','tools_tags','u.fullname','ui.OpenchannelInteractionId','from','user_has_openchannel_interactions','left_join','users','openchannel_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','expr','search','parseSearch','sqlOperator','conditions','find','having','`\x20>\x200','operator','value','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','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','start','body','isEmpty','forEach','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','t.id\x20IN\x20?','OpenchannelAccountId'];(function(_0x5c052b,_0x3bd2b9){var _0x5856a6=function(_0x2b8e4d){while(--_0x2b8e4d){_0x5c052b['push'](_0x5c052b['shift']());}};_0x5856a6(++_0x3bd2b9);}(_0x6465,0x142));var _0x5646=function(_0x2aece6,_0x43cc7b){_0x2aece6=_0x2aece6-0x0;var _0x1fe1ff=_0x6465[_0x2aece6];return _0x1fe1ff;};'use strict';var emlformat=require(_0x5646('0x0'));var rimraf=require(_0x5646('0x1'));var zipdir=require(_0x5646('0x2'));var jsonpatch=require(_0x5646('0x3'));var rp=require('request-promise');var moment=require(_0x5646('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5646('0x5'));var util=require(_0x5646('0x6'));var path=require(_0x5646('0x7'));var sox=require(_0x5646('0x8'));var csv=require(_0x5646('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5646('0xa'));var _=require('lodash');var squel=require(_0x5646('0xb'));var crypto=require(_0x5646('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5646('0x9'));var querystring=require(_0x5646('0xd'));var Papa=require('papaparse');var Redis=require(_0x5646('0xe'));var authService=require(_0x5646('0xf'));var qs=require(_0x5646('0x10'));var as=require(_0x5646('0x11'));var pdf=require(_0x5646('0x12'));var hardwareService=require(_0x5646('0x13'));var logger=require(_0x5646('0x14'))('api');var utils=require(_0x5646('0x15'));var config=require(_0x5646('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x5646('0x17')]=_[_0x5646('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5646('0x19'))(new Redis(config[_0x5646('0x17')]));require(_0x5646('0x1a'))['register'](socket);function respondWithStatusCode(_0x37c982,_0x316789){_0x316789=_0x316789||0xcc;return function(_0x2858a5){if(_0x2858a5){return _0x37c982[_0x5646('0x1b')](_0x316789);}return _0x37c982[_0x5646('0x1c')](_0x316789)[_0x5646('0x1d')]();};}function respondWithResult(_0xa1cfe8,_0x1bfdc1){_0x1bfdc1=_0x1bfdc1||0xc8;return function(_0x28cca1){if(_0x28cca1){return _0xa1cfe8[_0x5646('0x1c')](_0x1bfdc1)[_0x5646('0x1e')](_0x28cca1);}};}function respondWithFilteredResult(_0x371938,_0x87895){return function(_0x4ead98){if(_0x4ead98){var _0x2fc0f0=typeof _0x87895['offset']==='undefined'&&typeof _0x87895[_0x5646('0x1f')]===_0x5646('0x20');var _0x5071e8=_0x4ead98[_0x5646('0x21')];var _0x4de2a0=_0x2fc0f0?0x0:_0x87895[_0x5646('0x22')];var _0x240b87=_0x2fc0f0?_0x4ead98[_0x5646('0x21')]:_0x87895[_0x5646('0x22')]+_0x87895[_0x5646('0x1f')];var _0xf66179;if(_0x240b87>=_0x5071e8){_0x240b87=_0x5071e8;_0xf66179=0xc8;}else{_0xf66179=0xce;}_0x371938[_0x5646('0x1c')](_0xf66179);return _0x371938[_0x5646('0x23')]('Content-Range',_0x4de2a0+'-'+_0x240b87+'/'+_0x5071e8)[_0x5646('0x1e')](_0x4ead98);}return null;};}function patchUpdates(_0x1dee05){return function(_0x1d0c0a){try{jsonpatch[_0x5646('0x24')](_0x1d0c0a,_0x1dee05,!![]);}catch(_0x556442){return BPromise[_0x5646('0x25')](_0x556442);}return _0x1d0c0a[_0x5646('0x26')]();};}function saveUpdates(_0x1e4b17,_0x503bfa){return function(_0x4720ab){if(_0x4720ab){return _0x4720ab['update'](_0x1e4b17)[_0x5646('0x27')](function(_0x2cbc31){return _0x2cbc31;});}return null;};}function removeEntity(_0x296a41,_0x598af1){return function(_0x16a299){if(_0x16a299){return _0x16a299[_0x5646('0x28')]()[_0x5646('0x27')](function(){_0x296a41[_0x5646('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x221fcf,_0x16622f){return function(_0x16815b){if(!_0x16815b){_0x221fcf['sendStatus'](0x194);}return _0x16815b;};}function handleError(_0x38024c,_0x50ece3){_0x50ece3=_0x50ece3||0x1f4;return function(_0xf27c0d){logger[_0x5646('0x29')](_0xf27c0d[_0x5646('0x2a')]);if(_0xf27c0d[_0x5646('0x2b')]){delete _0xf27c0d['name'];}_0x38024c[_0x5646('0x1c')](_0x50ece3)[_0x5646('0x2c')](_0xf27c0d);};}function getInteractionUsers(_0xac86bb,_0x25097a){return new BPromise(function(_0x1c80d,_0x2ee708){try{if(_0x25097a[_0xac86bb['id']]){_0xac86bb[_0x5646('0x2d')]=_[_0x5646('0x2e')](_0x25097a[_0xac86bb['id']],function(_0x3b9339){return{'id':_0x3b9339['id'],'fullname':_0x3b9339[_0x5646('0x2f')]};});}}catch(_0x113e6d){_0x2ee708(_0x113e6d);}_0x1c80d(_0xac86bb);});}function getInteractionTags(_0x5bcbd1,_0x20ffb5){return new BPromise(function(_0x4e483e,_0x409fdd){try{if(_0x5bcbd1[_0x5646('0x30')]){_0x5bcbd1[_0x5646('0x31')]=[];_0x5bcbd1['TagIds']['split'](',')['forEach'](function(_0x4bcb82){_0x5bcbd1[_0x5646('0x31')][_0x5646('0x32')](_0x20ffb5[_0x4bcb82]);});}delete _0x5bcbd1[_0x5646('0x30')];}catch(_0x131c9d){_0x409fdd(_0x131c9d);}_0x4e483e(_0x5bcbd1);});}function updateOpenchannelInteraction(_0x1cd9e5,_0x1d2ae5,_0x1a2508){return new BPromise(function(_0x3dcfff,_0x463b7b){return getInteractionUsers(_0x1cd9e5,_0x1a2508)[_0x5646('0x27')](function(_0x8149ec){return getInteractionTags(_0x8149ec,_0x1d2ae5);})[_0x5646('0x27')](function(_0x428075){return getStateInteraction(_0x428075);})['then'](function(_0x6b3997){_0x3dcfff(_0x6b3997);})[_0x5646('0x33')](function(_0x1a10b9){_0x463b7b(_0x1a10b9);});});}function getStateInteraction(_0x4935af){return new BPromise(function(_0x320303){_0x4935af[_0x5646('0x34')]=0x0;_0x4935af[_0x5646('0x35')]=0x0;_0x4935af['answered']=0x0;_0x4935af[_0x5646('0x36')]=0x0;_0x4935af[_0x5646('0x37')]=0x0;if(!_0x4935af[_0x5646('0x38')]&&!_0x4935af[_0x5646('0x39')]){_0x4935af[_0x5646('0x34')]+=0x1;}if(!_0x4935af[_0x5646('0x38')]&&_0x4935af[_0x5646('0x39')]){_0x4935af[_0x5646('0x35')]+=0x1;ids[_0x5646('0x32')](_0x4935af['id']);if(_0x4935af[_0x5646('0x34')]){_0x4935af[_0x5646('0x34')]-=0x1;}}if(_0x4935af[_0x5646('0x38')]&&_0x4935af[_0x5646('0x39')]){_0x4935af['answered']+=0x1;if(_0x4935af[_0x5646('0x35')]){_0x4935af[_0x5646('0x35')]-=0x1;}}if(_0x4935af[_0x5646('0x38')]&&!_0x4935af[_0x5646('0x39')]){_0x4935af[_0x5646('0x36')]+=0x1;if(_0x4935af[_0x5646('0x34')]){_0x4935af[_0x5646('0x34')]-=0x1;}}_0x4935af[_0x5646('0x37')]+=0x1;_0x320303(_0x4935af);});}exports['index']=function(_0x310c7f,_0x2edda1){var _0x3cefa2={},_0x221ef1={},_0x1e06b9={'count':0x0,'rows':[]};var _0x56909d=_[_0x5646('0x2e')](db['OpenchannelInteraction'][_0x5646('0x3a')],function(_0x5394f9){return{'name':_0x5394f9[_0x5646('0x3b')],'type':_0x5394f9[_0x5646('0x3c')]['key']};});_0x221ef1[_0x5646('0x3d')]=_['map'](_0x56909d,_0x5646('0x2b'));_0x221ef1['query']=_[_0x5646('0x3e')](_0x310c7f[_0x5646('0x3f')]);_0x221ef1[_0x5646('0x40')]=_[_0x5646('0x41')](_0x221ef1[_0x5646('0x3d')],_0x221ef1[_0x5646('0x3f')]);_0x3cefa2[_0x5646('0x42')]=_[_0x5646('0x41')](_0x221ef1[_0x5646('0x3d')],qs[_0x5646('0x43')](_0x310c7f[_0x5646('0x3f')][_0x5646('0x43')]));_0x3cefa2['attributes']=_0x3cefa2[_0x5646('0x42')][_0x5646('0x44')]?_0x3cefa2[_0x5646('0x42')]:_0x221ef1[_0x5646('0x3d')];if(!_0x310c7f[_0x5646('0x3f')][_0x5646('0x45')](_0x5646('0x46'))){_0x3cefa2[_0x5646('0x1f')]=qs[_0x5646('0x1f')](_0x310c7f[_0x5646('0x3f')][_0x5646('0x1f')]);_0x3cefa2[_0x5646('0x22')]=qs[_0x5646('0x22')](_0x310c7f[_0x5646('0x3f')]['offset']);}_0x3cefa2[_0x5646('0x47')]=qs[_0x5646('0x48')](_0x310c7f[_0x5646('0x3f')][_0x5646('0x48')]);_0x3cefa2[_0x5646('0x49')]=qs[_0x5646('0x40')](_[_0x5646('0x4a')](_0x310c7f[_0x5646('0x3f')],_0x221ef1[_0x5646('0x40')]),_0x56909d);var _0x411076=[];var _0x3a8711=squel[_0x5646('0x4b')]()[_0x5646('0x4c')]('id')[_0x5646('0x4c')](_0x5646('0x2b'))['field'](_0x5646('0x4d'))['from'](_0x5646('0x4e'));var _0x3ef104=squel[_0x5646('0x4b')]()['field']('u.id')['field'](_0x5646('0x4f'))[_0x5646('0x4c')](_0x5646('0x50'))[_0x5646('0x51')](_0x5646('0x52'),'ui')[_0x5646('0x53')](_0x5646('0x54'),'u','u.id\x20=\x20ui.UserId');var _0x358063=squel[_0x5646('0x4b')]()['from'](_0x5646('0x55'),'i')[_0x5646('0x53')]('cm_contacts','c',_0x5646('0x56'))['left_join']('users','o','o.id\x20=\x20i.UserId')['left_join'](_0x5646('0x57'),'a',_0x5646('0x58'))[_0x5646('0x53')](_0x5646('0x59'),'me',_0x5646('0x5a'))[_0x5646('0x53')](_0x5646('0x5b'),'it','it.OpenchannelInteractionId\x20=\x20i.id')[_0x5646('0x53')]('tools_tags','t','t.id\x20=\x20it.TagId');var _0x29f85b=squel[_0x5646('0x5c')]();var _0x207665=[];var _0x27fffc=squel[_0x5646('0x5c')]();var _0x607486;if(_0x310c7f[_0x5646('0x3f')][_0x5646('0x5d')]){_0x607486=as[_0x5646('0x5e')](_0x310c7f[_0x5646('0x3f')]['search']);var _0x1cc99c=_0x607486[_0x5646('0x5f')];for(var _0x22ca93=0x0;_0x22ca93<_0x607486['conditions'][_0x5646('0x44')];_0x22ca93++){var _0x6c81e4=_0x607486[_0x5646('0x60')][_0x22ca93];var _0x348ca5='i';var _0x547d6e=_[_0x5646('0x61')](_0x56909d,[_0x5646('0x2b'),_0x6c81e4[_0x5646('0x4c')]]);if(!_0x547d6e){switch(_0x6c81e4[_0x5646('0x4c')]){case'unreadMessages':if(_0x6c81e4['value']==0x1){_0x358063[_0x5646('0x62')]('`'+_0x6c81e4['field']+'`\x20=\x200');}else{_0x358063[_0x5646('0x62')]('`'+_0x6c81e4[_0x5646('0x4c')]+_0x5646('0x63'));}break;case'Contact':if(_0x6c81e4[_0x5646('0x64')]==='$substring'){if(_0x6c81e4[_0x5646('0x65')][_0x5646('0x66')]('\x20')[_0x5646('0x44')]>0x1){_0x29f85b[_0x1cc99c](_0x5646('0x67'),qs[_0x5646('0x68')](_0x6c81e4[_0x5646('0x65')]),null);}else{var _0x12e141='%'+_0x6c81e4[_0x5646('0x65')]+'%';_0x29f85b[_0x1cc99c](_0x5646('0x69'),_0x12e141,_0x12e141,_0x12e141);}}else{_0x547d6e=_[_0x5646('0x61')](_0x56909d,[_0x5646('0x2b'),_0x5646('0x6a')]);_0x6c81e4[_0x5646('0x4c')]='ContactId';_0x26d026=as[_0x5646('0x6b')](_0x348ca5,_0x547d6e[_0x5646('0x3c')],_0x6c81e4);_0x29f85b[_0x1cc99c](_0x26d026[_0x5646('0x6c')],_0x26d026[_0x5646('0x65')]['start'],_0x26d026[_0x5646('0x65')][_0x5646('0x1d')]);}break;case _0x5646('0x6d'):var _0x1b5b9e=_0x6c81e4[_0x5646('0x65')][_0x5646('0x66')](',')['map'](function(_0xfe7f2d){return Number(_0xfe7f2d);});_0x1b5b9e['forEach'](function(_0x34fb4a){_0x27fffc['or'](_0x5646('0x6e'),'%,'+_0x34fb4a+',%');});_0x207665=_['union'](_0x207665,_0x1b5b9e);break;case _0x5646('0x6f'):if(_0x6c81e4[_0x5646('0x64')]===_0x5646('0x70')){_0x29f85b[_0x1cc99c](_0x5646('0x71'),'%'+_0x6c81e4[_0x5646('0x65')]+'%',null);}else{_0x547d6e=_[_0x5646('0x61')](_0x56909d,[_0x5646('0x2b'),'UserId']);_0x6c81e4['field']=_0x5646('0x39');_0x26d026=as[_0x5646('0x6b')](_0x348ca5,_0x547d6e[_0x5646('0x3c')],_0x6c81e4);_0x29f85b[_0x1cc99c](_0x26d026[_0x5646('0x6c')],_0x26d026[_0x5646('0x65')][_0x5646('0x72')],_0x26d026[_0x5646('0x65')]['end']);}break;case _0x5646('0x73'):_0x26d026=as['buildExpression']('me',null,_0x6c81e4);_0x29f85b[_0x1cc99c](_0x26d026[_0x5646('0x6c')],_0x26d026[_0x5646('0x65')]['start'],_0x26d026[_0x5646('0x65')][_0x5646('0x1d')]);break;}}else{var _0x26d026=as[_0x5646('0x6b')](_0x348ca5,_0x547d6e[_0x5646('0x3c')],_0x6c81e4);_0x29f85b[_0x1cc99c](_0x26d026[_0x5646('0x6c')],_0x26d026[_0x5646('0x65')]['start'],_0x26d026[_0x5646('0x65')][_0x5646('0x1d')]);}}}else{var _0x4ed2b7=_(_0x310c7f[_0x5646('0x3f')])[_0x5646('0x3e')]()[_0x5646('0x2e')](function(_0x387051){return _['some'](_0x56909d,[_0x5646('0x2b'),_0x387051])?_0x387051:undefined;})['compact']()['value']();if(!_[_0x5646('0x74')](_0x4ed2b7)){_0x4ed2b7[_0x5646('0x75')](function(_0x19c7ea){if(_0x19c7ea==='OpenchannelAccountId'){_0x358063[_0x5646('0x49')](_0x5646('0x76'),[][_0x5646('0x77')](_0x310c7f[_0x5646('0x3f')][_0x19c7ea]));}else if(_0x19c7ea===_0x5646('0x78')){var _0x3eda41=JSON[_0x5646('0x79')](_0x310c7f[_0x5646('0x3f')][_0x19c7ea])[_0x5646('0x7a')];var _0x6afdd3=JSON[_0x5646('0x79')](_0x310c7f[_0x5646('0x3f')][_0x19c7ea])[_0x5646('0x7b')];_0x358063[_0x5646('0x49')](_0x5646('0x7c'),_0x3eda41,_0x6afdd3);}else{if(_0x310c7f[_0x5646('0x3f')][_0x19c7ea]===_0x5646('0x7d')){_0x358063[_0x5646('0x49')]('i.'+_0x19c7ea+_0x5646('0x7e'));}else{_0x358063[_0x5646('0x49')]('i.'+_0x19c7ea+_0x5646('0x7f'),_0x310c7f['query'][_0x19c7ea]);}}});}if(_0x310c7f[_0x5646('0x3f')][_0x5646('0x80')]){if(_0x310c7f[_0x5646('0x3f')][_0x5646('0x80')]==0x1){_0x358063[_0x5646('0x62')](_0x5646('0x81'));}else{_0x358063['having'](_0x5646('0x82'));}}if(_0x310c7f[_0x5646('0x3f')][_0x5646('0x83')]){_0x207665=_[_0x5646('0x84')](_0x310c7f[_0x5646('0x3f')]['tag'])?_0x310c7f['query'][_0x5646('0x83')]:new Array(_0x310c7f[_0x5646('0x3f')][_0x5646('0x83')]);_0x207665['forEach'](function(_0x37844a){_0x27fffc['or'](_0x5646('0x6e'),'%,'+_0x37844a+',%');});}if(_0x310c7f[_0x5646('0x3f')]['filter']){var _0x2892c9=_0x310c7f[_0x5646('0x3f')][_0x5646('0x85')]['replace']('\x5c','\x5c\x5c')[_0x5646('0x86')](/'/g,'\x27\x27');if(qs[_0x5646('0x87')](_0x2892c9)){_0x29f85b['or'](_0x5646('0x88'),_0x2892c9+'%');}else{_0x29f85b['or'](_0x5646('0x89'),qs[_0x5646('0x68')](_0x2892c9))['or'](_0x5646('0x8a'),_0x2892c9+'%')['or'](_0x5646('0x8b'),_0x2892c9+'%');}}}_0x358063[_0x5646('0x49')](_0x29f85b);_0x358063[_0x5646('0x8c')](_0x5646('0x8d'));var _0x38ca73={'type':db[_0x5646('0x8e')][_0x5646('0x8f')][_0x5646('0x90')],'raw':!![]};var _0x221e28=_0x358063[_0x5646('0x91')]();_0x221e28[_0x5646('0x4c')]('i.id');_0x221e28['field'](_0x5646('0x92'),_0x5646('0x93'));if(_0x3cefa2[_0x5646('0x47')]){_0x3cefa2[_0x5646('0x47')]['forEach'](function(_0x3b5005){var _0x56d637=_0x3b5005[0x0]===_0x5646('0x94')?_0x3b5005[0x0]:'i.'+_0x3b5005[0x0];_0x358063['order'](_0x56d637,_0x3b5005[0x1]===_0x5646('0x95')?![]:!![]);});}if(!_[_0x5646('0x74')](_0x207665)){_0x358063[_0x5646('0x62')](_0x27fffc);_0x221e28[_0x5646('0x49')](_0x5646('0x96'),_0x207665);}BPromise['resolve']()[_0x5646('0x27')](function(){if(!_0x607486){if(_0x310c7f[_0x5646('0x3f')][_0x5646('0x97')])return;_0x221e28['where'](_0x5646('0x98'));_0x358063[_0x5646('0x49')](_0x5646('0x98'));return;}if(_0x310c7f['user'][_0x5646('0x99')]!==_0x5646('0x9a'))return;return _0x310c7f[_0x5646('0x9b')][_0x5646('0x9c')]({'attributes':['id'],'raw':!![]})['then'](function(_0x47b41e){if(_['isEmpty'](_0x47b41e)){_0x221e28[_0x5646('0x49')]('i.OpenchannelAccountId\x20IS\x20NULL');_0x358063[_0x5646('0x49')](_0x5646('0x9d'));}else{_0x221e28[_0x5646('0x49')](_0x5646('0x76'),_[_0x5646('0x2e')](_0x47b41e,'id'));_0x358063[_0x5646('0x49')](_0x5646('0x76'),_[_0x5646('0x2e')](_0x47b41e,'id'));}});})[_0x5646('0x27')](function(){if(_0x310c7f[_0x5646('0x9b')][_0x5646('0x99')]===_0x5646('0x9a')&&!_0x607486&&!_0x310c7f[_0x5646('0x3f')][_0x5646('0x97')])return[];return db[_0x5646('0x9e')][_0x5646('0x3f')](_0x221e28['toString'](),_0x38ca73);})[_0x5646('0x27')](function(_0x5cef6c){_0x1e06b9['count']=_0x5cef6c[_0x5646('0x44')];if(_0x1e06b9[_0x5646('0x21')]===0x0)return[];return db['sequelize']['query'](_0x3a8711[_0x5646('0x9f')](),_0x38ca73)[_0x5646('0x27')](function(_0x2ef0a4){_0x411076=_[_0x5646('0xa0')](_0x2ef0a4,'id');_0x38ca73=_[_0x5646('0xa1')](_0x38ca73,{'model':db[_0x5646('0xa2')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x310c7f['query'][_0x5646('0x43')]){_0x3cefa2[_0x5646('0x42')]['forEach'](function(_0x248fcf){_0x358063[_0x5646('0x4c')]('i.'+_0x248fcf);});}else{_0x358063[_0x5646('0x4c')](_0x5646('0x92'),_0x5646('0x93'));_0x358063[_0x5646('0x4c')](_0x5646('0xa3'),_0x5646('0xa4'));_0x358063['field']('a.mandatoryDisposition',_0x5646('0xa5'));_0x358063['field'](_0x5646('0xa6'),_0x5646('0x94'));_0x358063[_0x5646('0x4c')](_0x5646('0xa7'));_0x358063[_0x5646('0x4c')](_0x5646('0xa8'),_0x5646('0xa9'));_0x358063[_0x5646('0x4c')](_0x5646('0xaa'),'Contact.lastName');_0x358063['field'](_0x5646('0xab'),'Contact.email');_0x358063['field'](_0x5646('0xac'),_0x5646('0xad'));_0x358063[_0x5646('0x4c')]('c.mobile',_0x5646('0xae'));_0x358063['field']('c.fax',_0x5646('0xaf'));_0x358063[_0x5646('0x4c')](_0x5646('0xb0'),_0x5646('0xb1'));_0x358063[_0x5646('0x4c')]('o.internal',_0x5646('0xb2'));_0x358063[_0x5646('0x4c')](_0x5646('0xb3'),'TagIds');}if(_0x3cefa2[_0x5646('0x1f')])_0x358063['limit'](_0x3cefa2['limit']);if(_0x3cefa2['offset'])_0x358063[_0x5646('0x22')](_0x3cefa2['offset']);return db[_0x5646('0x9e')][_0x5646('0x3f')](_0x358063['toString'](),_0x38ca73);})[_0x5646('0x27')](function(_0x2a4cec){if(_0x2a4cec[_0x5646('0x44')]>0x0)_0x3ef104['where']('ui.OpenchannelInteractionId\x20IN\x20?',_[_0x5646('0x2e')](_0x2a4cec,'id'));return db[_0x5646('0x9e')]['query'](_0x3ef104[_0x5646('0x9f')](),_0x38ca73)[_0x5646('0x27')](function(_0x437c9a){var _0x24bccd=_['groupBy'](_0x437c9a,'OpenchannelInteractionId');var _0x46de9=[];_0x2a4cec['forEach'](function(_0x1ae88e){_0x46de9[_0x5646('0x32')](updateOpenchannelInteraction(_0x1ae88e,_0x411076,_0x24bccd));});return BPromise[_0x5646('0xb4')](_0x46de9);});});})[_0x5646('0x27')](function(_0x52dc18){_0x1e06b9[_0x5646('0xb5')]=_0x52dc18;return _0x1e06b9;})[_0x5646('0x27')](respondWithFilteredResult(_0x2edda1,_0x3cefa2))[_0x5646('0x33')](handleError(_0x2edda1,null));};exports[_0x5646('0xb6')]=function(_0x11d66b,_0xd7f140){var _0x40f2e2={};if(_0x11d66b[_0x5646('0x3f')]['type']&&_0x11d66b[_0x5646('0x3f')][_0x5646('0x3c')]==='from'){_0x40f2e2[_0x5646('0x51')]=_0x11d66b[_0x5646('0xb7')]['id'];}else{_0x40f2e2['id']=_0x11d66b[_0x5646('0xb7')]['id'];}var _0x198153={'raw':![],'where':_0x40f2e2},_0x400fe9={};_0x400fe9[_0x5646('0x3d')]=_[_0x5646('0x3e')](db['OpenchannelInteraction'][_0x5646('0x3a')]);_0x400fe9[_0x5646('0x3f')]=_[_0x5646('0x3e')](_0x11d66b[_0x5646('0x3f')]);_0x400fe9[_0x5646('0x40')]=_[_0x5646('0x41')](_0x400fe9[_0x5646('0x3d')],_0x400fe9[_0x5646('0x3f')]);_0x198153[_0x5646('0x42')]=_['intersection'](_0x400fe9['model'],qs[_0x5646('0x43')](_0x11d66b[_0x5646('0x3f')][_0x5646('0x43')]));_0x198153[_0x5646('0x42')]=_0x198153['attributes'][_0x5646('0x44')]?_0x198153[_0x5646('0x42')]:_0x400fe9[_0x5646('0x3d')];if(_0x11d66b[_0x5646('0x3f')][_0x5646('0xb8')]){_0x198153['include']=[{'all':!![]}];}_0x198153=_['merge']({},_0x198153,_0x11d66b[_0x5646('0xb9')]);return db[_0x5646('0xa2')][_0x5646('0x61')](_0x198153)[_0x5646('0x27')](handleEntityNotFound(_0xd7f140,null))[_0x5646('0x27')](respondWithResult(_0xd7f140,null))[_0x5646('0x33')](handleError(_0xd7f140,null));};exports['create']=function(_0x2fc76b,_0x985e9a){return db[_0x5646('0xa2')][_0x5646('0xba')](_0x2fc76b[_0x5646('0x73')],{})[_0x5646('0x27')](respondWithResult(_0x985e9a,0xc9))[_0x5646('0x33')](handleError(_0x985e9a,null));};exports[_0x5646('0xbb')]=function(_0x2c0292,_0x43fa1d){if(_0x2c0292[_0x5646('0x73')]['id']){delete _0x2c0292['body']['id'];}return db[_0x5646('0xa2')][_0x5646('0x61')]({'where':{'id':_0x2c0292[_0x5646('0xb7')]['id']}})[_0x5646('0x27')](handleEntityNotFound(_0x43fa1d,null))['then'](saveUpdates(_0x2c0292[_0x5646('0x73')],null))['then'](respondWithResult(_0x43fa1d,null))['catch'](handleError(_0x43fa1d,null));};exports[_0x5646('0x28')]=function(_0x1af399,_0x3910fc){return db[_0x5646('0xa2')]['find']({'where':{'id':_0x1af399[_0x5646('0xb7')]['id']}})[_0x5646('0x27')](handleEntityNotFound(_0x3910fc,null))[_0x5646('0x27')](removeEntity(_0x3910fc,null))['catch'](handleError(_0x3910fc,null));};exports[_0x5646('0xbc')]=function(_0x1ebdb2,_0x2cf868){return db[_0x5646('0xa2')]['describe']()['then'](respondWithResult(_0x2cf868,null))[_0x5646('0x33')](handleError(_0x2cf868,null));};exports[_0x5646('0xbd')]=function(_0x1a4622,_0x5e6696,_0x1d67e2){return db[_0x5646('0xbe')][_0x5646('0x61')]({'where':{'id':_0x1a4622[_0x5646('0xb7')]['id']}})[_0x5646('0x27')](handleEntityNotFound(_0x5e6696,null))[_0x5646('0x27')](function(_0x2fd00d){if(_0x2fd00d){return _0x2fd00d[_0x5646('0xbd')](_0x1a4622['body'][_0x5646('0xbf')],_['omit'](_0x1a4622[_0x5646('0x73')],['ids','id'])||{});}})[_0x5646('0x27')](respondWithResult(_0x5e6696,null))[_0x5646('0x33')](handleError(_0x5e6696,null));};exports[_0x5646('0xc0')]=function(_0x126b75,_0x39d930,_0x158416){var _0x22fd33={'raw':![],'where':{}};var _0xf07653={};var _0x3f9ca6={'count':0x0,'rows':[]};return db['OpenchannelInteraction']['findOne']({'where':{'id':_0x126b75[_0x5646('0xb7')]['id']}})[_0x5646('0x27')](handleEntityNotFound(_0x39d930,null))[_0x5646('0x27')](function(_0x2c57d6){if(_0x2c57d6){_0xf07653[_0x5646('0x3d')]=_[_0x5646('0x3e')](db[_0x5646('0xbe')][_0x5646('0x3a')]);_0xf07653[_0x5646('0x3f')]=_[_0x5646('0x3e')](_0x126b75['query']);_0xf07653[_0x5646('0x40')]=_[_0x5646('0x41')](_0xf07653[_0x5646('0x3d')],_0xf07653[_0x5646('0x3f')]);_0x22fd33[_0x5646('0x42')]=_['intersection'](_0xf07653['model'],qs[_0x5646('0x43')](_0x126b75[_0x5646('0x3f')][_0x5646('0x43')]));_0x22fd33[_0x5646('0x42')]=_0x22fd33[_0x5646('0x42')][_0x5646('0x44')]?_0x22fd33[_0x5646('0x42')]:_0xf07653['model'];if(!_0x126b75['query'][_0x5646('0x45')](_0x5646('0x46'))){_0x22fd33[_0x5646('0x1f')]=qs[_0x5646('0x1f')](_0x126b75['query']['limit']);_0x22fd33['offset']=qs[_0x5646('0x22')](_0x126b75[_0x5646('0x3f')][_0x5646('0x22')]);}_0x22fd33['order']=qs[_0x5646('0x48')](_0x126b75[_0x5646('0x3f')]['sort']);_0x22fd33[_0x5646('0x49')]=qs[_0x5646('0x40')](_['pick'](_0x126b75['query'],_0xf07653[_0x5646('0x40')]));_0x22fd33['where'][_0x5646('0xc1')]=_0x2c57d6['id'];if(_0x126b75['query'][_0x5646('0x85')]){_0x22fd33[_0x5646('0x49')]=_[_0x5646('0xa1')](_0x22fd33[_0x5646('0x49')],{'$or':_[_0x5646('0x2e')](_0x22fd33[_0x5646('0x42')],function(_0x36c139){var _0x32696d={};_0x32696d[_0x36c139]={'$like':'%'+_0x126b75['query'][_0x5646('0x85')]+'%'};return _0x32696d;})});}if(_0x126b75[_0x5646('0x3f')][_0x5646('0x7a')]){var _0x551e91=_0x126b75['query']['$gte'][_0x5646('0x66')](',');var _0x14ba74={};_0x14ba74[_0x551e91[0x0]]={'$gte':moment(_0x551e91[0x1])['format'](_0x5646('0xc2'))};_0x22fd33['where']=_[_0x5646('0xa1')](_0x22fd33['where'],_0x14ba74);}_0x22fd33=_[_0x5646('0xa1')]({},_0x22fd33,_0x126b75[_0x5646('0xb9')]);return db[_0x5646('0xbe')][_0x5646('0x21')]({'where':_0x22fd33['where']})[_0x5646('0x27')](function(_0x4ac538){_0x3f9ca6[_0x5646('0x21')]=_0x4ac538;if(_0x126b75[_0x5646('0x3f')]['includeAll']){_0x22fd33[_0x5646('0xc3')]=[{'all':!![]}];}return db['OpenchannelMessage']['findAll'](_0x22fd33);})[_0x5646('0x27')](function(_0x575b62){_0x3f9ca6[_0x5646('0xb5')]=_0x575b62;return _0x3f9ca6;});}})[_0x5646('0x27')](respondWithFilteredResult(_0x39d930,_0x22fd33))[_0x5646('0x33')](handleError(_0x39d930,null));};exports[_0x5646('0xc4')]=function(_0x307a60,_0x1dec9f,_0x4657e1){return db[_0x5646('0xa2')]['find']({'where':{'id':_0x307a60[_0x5646('0xb7')]['id']}})[_0x5646('0x27')](handleEntityNotFound(_0x1dec9f,null))[_0x5646('0x27')](function(_0x228509){if(_0x228509){return _0x228509[_0x5646('0xc5')](_0x307a60['body'][_0x5646('0xbf')],_[_0x5646('0xc6')](_0x307a60[_0x5646('0x73')],[_0x5646('0xbf'),'id'])||{})[_0x5646('0xc7')](function(){return db[_0x5646('0x6d')]['findAll']({'attributes':['id',_0x5646('0x2b'),_0x5646('0x4d')],'where':{'id':_0x307a60['body'][_0x5646('0xbf')]}});})[_0x5646('0x27')](function(_0x1088d4){socket[_0x5646('0xc8')](_0x5646('0xc9'),{'id':Number(_0x307a60[_0x5646('0xb7')]['id']),'tags':_0x1088d4||[]});return{'id':Number(_0x307a60[_0x5646('0xb7')]['id']),'tags':_0x1088d4||[]};});}})[_0x5646('0x27')](respondWithResult(_0x1dec9f,null))[_0x5646('0x33')](handleError(_0x1dec9f,null));};exports['removeTags']=function(_0x3f0950,_0x3793ba,_0x4db686){return db[_0x5646('0xa2')][_0x5646('0x61')]({'where':{'id':_0x3f0950[_0x5646('0xb7')]['id']}})[_0x5646('0x27')](handleEntityNotFound(_0x3793ba,null))['then'](function(_0x49dc44){if(_0x49dc44){return _0x49dc44['removeTags'](_0x3f0950['query'][_0x5646('0xbf')]);}})[_0x5646('0x27')](respondWithStatusCode(_0x3793ba,null))[_0x5646('0x33')](handleError(_0x3793ba,null));};exports[_0x5646('0xca')]=function(_0x36109a,_0x984ec){var _0x151320=moment()[_0x5646('0xcb')]()['toString']();var _0x5c033c=path[_0x5646('0xcc')](config[_0x5646('0xcd')],'server',_0x5646('0xce'),'tmp');var _0x5a3c4d=path[_0x5646('0xcc')](config['root'],'server',_0x5646('0xce'),_0x5646('0xcf'));var _0x5abf81=path[_0x5646('0xcc')](_0x5c033c,_0x151320);var _0x193df8=util[_0x5646('0xd0')](_0x5646('0xd1'),_0x36109a[_0x5646('0xb7')]['id'],_0x151320);var _0xe98661=path['join'](_0x5c033c,_0x193df8);var _0x5f5091=[];_0x5f5091['push']({'model':db[_0x5646('0x6f')],'as':_0x5646('0x6f'),'attributes':['id',_0x5646('0x2f')],'raw':!![]});_0x5f5091[_0x5646('0x32')]({'model':db[_0x5646('0xd2')],'as':_0x5646('0xd3'),'attributes':['id','firstName',_0x5646('0xd4')],'raw':!![]});if(_0x36109a[_0x5646('0x3f')]['attachments']){_0x5f5091[_0x5646('0x32')]({'model':db[_0x5646('0xd5')],'as':_0x5646('0xd5'),'raw':!![]});}var _0x1381e6=[{'model':db[_0x5646('0xbe')],'as':'Messages','attributes':['id',_0x5646('0x73'),'createdAt',_0x5646('0xd6'),_0x5646('0xd7'),_0x5646('0x80')],'include':_0x5f5091}];_0x1381e6['push']({'model':db[_0x5646('0xd8')],'as':_0x5646('0xd9'),'attributes':['id',_0x5646('0x2b')]});_0x1381e6[_0x5646('0x32')]({'model':db[_0x5646('0x6f')],'as':_0x5646('0xda'),'attributes':['id',_0x5646('0x2f')]});return db[_0x5646('0xa2')]['find']({'where':{'id':_0x36109a[_0x5646('0xb7')]['id']},'include':_0x1381e6})[_0x5646('0x27')](handleEntityNotFound(_0x984ec,null))[_0x5646('0x27')](function(_0x4cb9a7){if(_0x4cb9a7){var _0x33eec2=_0x4cb9a7['get']({'plain':!![]});fs['mkdirSync'](_0x5abf81);var _0x3aff6a={'channel':_0x5646('0xdb'),'account':_0x33eec2['Account'][_0x5646('0x2b')],'agent':_0x33eec2[_0x5646('0xda')]?_0x33eec2['Owner'][_0x5646('0x2f')]:_0x5646('0xdc'),'createdAt':moment(_0x33eec2[_0x5646('0x78')])[_0x5646('0xd0')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x33eec2[_0x5646('0x38')]?moment(_0x33eec2[_0x5646('0xdd')])[_0x5646('0xd0')](_0x5646('0xc2'))[_0x5646('0x9f')]():'','disposition':_0x33eec2[_0x5646('0xde')],'visibility':_0x33eec2[_0x5646('0xdf')]?_0x5646('0xe0'):_0x5646('0xe1'),'messages':_(_0x33eec2['Messages'])[_0x5646('0x85')]({'secret':![]})['map'](function(_0x57a165){if(_0x57a165[_0x5646('0xd5')]){var _0x35cf31=path[_0x5646('0xcc')](_0x5a3c4d,_0x57a165['Attachment'][_0x5646('0xe2')]);if(fs[_0x5646('0xe3')](_0x35cf31)){fs['createReadStream'](_0x35cf31)['pipe'](fs[_0x5646('0xe4')](path[_0x5646('0xcc')](_0x5abf81,_0x57a165[_0x5646('0xd5')][_0x5646('0xe2')])));}}return{'date':moment(_0x57a165[_0x5646('0x78')])[_0x5646('0xd0')]('YYYY-MM-DD\x20HH:mm:ss')[_0x5646('0x9f')](),'sender':_0x57a165[_0x5646('0xd6')]===_0x5646('0xe5')?_0x57a165[_0x5646('0x6f')]?_0x57a165[_0x5646('0x6f')]['fullname']:_0x5646('0xe6'):_0x57a165['Contact'][_0x5646('0xe7')]+(_0x57a165[_0x5646('0xd3')][_0x5646('0xd4')]?'\x20'+_0x57a165['Contact'][_0x5646('0xd4')]:''),'body':_0x57a165[_0x5646('0xd5')]?_0x57a165[_0x5646('0xd5')][_0x5646('0xe2')]:_0x57a165[_0x5646('0x73')],'direction':_0x57a165[_0x5646('0xd6')]===_0x5646('0xe5')?'A':'C','secret':_0x57a165[_0x5646('0xd7')],'read':_0x57a165['read'],'attachment':_0x57a165[_0x5646('0xd5')]};})[_0x5646('0x65')]()};return ejs['renderFile'](path['join'](config[_0x5646('0xcd')],'server',_0x5646('0xe8'),_0x5646('0xe9')),{'interaction':_0x3aff6a})['then'](function(_0x1e1c13){var _0x29a75d=path[_0x5646('0xcc')](_0x5abf81,_0x5646('0xea')+_0x33eec2['id']+'-'+_0x151320+'.pdf');var _0x55c85e={'path':_0x29a75d,'channel':_0x5646('0xdb'),'interactionId':_0x33eec2['id']};return pdf[_0x5646('0xeb')](_0x1e1c13,_0x55c85e);})['then'](function(){return new BPromise(function(_0x3c8fc0,_0x24580d){zipdir(_0x5abf81,{'saveTo':_0xe98661},function(_0x42d641,_0x1a2b6c){if(_0x42d641)return _0x24580d(_0x42d641);return _0x3c8fc0(_0x1a2b6c);});})[_0x5646('0x27')](function(){return new BPromise(function(_0x2c6ed5,_0x2c9c32){rimraf(_0x5abf81,function(_0x12cd16){if(_0x12cd16)_0x2c9c32(_0x12cd16);return _0x2c6ed5();});});})['then'](function(){return _0x984ec[_0x5646('0xca')](_0xe98661,_0x193df8,function(_0xd4e5f9){if(_0xd4e5f9){console['log'](_0x5646('0xec'),_0xd4e5f9);}else{fs['unlinkSync'](_0xe98661);}});});});}else{return _0x984ec[_0x5646('0x1b')](0xc8);}})['catch'](handleError(_0x984ec,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index c1f6e55..0459e3c 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 _0x6817=['catch','hasOwnProperty','events','../../mysqldb','OpenchannelInteraction','setMaxListeners','save','update','remove','then','setDataValue','map','findAll','unreadMessages','emit'];(function(_0xcc512c,_0x2527f8){var _0x283b5e=function(_0x47f991){while(--_0x47f991){_0xcc512c['push'](_0xcc512c['shift']());}};_0x283b5e(++_0x2527f8);}(_0x6817,0x11f));var _0x7681=function(_0x3e8283,_0x3b127b){_0x3e8283=_0x3e8283-0x0;var _0x3671d4=_0x6817[_0x3e8283];return _0x3671d4;};'use strict';var EventEmitter=require(_0x7681('0x0'));var OpenchannelInteraction=require(_0x7681('0x1'))['db'][_0x7681('0x2')];var OpenchannelMessage=require(_0x7681('0x1'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x7681('0x3')](0x0);var events={'afterCreate':_0x7681('0x4'),'afterUpdate':_0x7681('0x5'),'afterDestroy':_0x7681('0x6')};function emitEvent(_0x41e53b){return function(_0x20113b,_0x1d703c,_0x4a83e5){_0x20113b['getUsers']({'attributes':['id'],'raw':!![]})[_0x7681('0x7')](function(_0x4ebcee){_0x20113b[_0x7681('0x8')]('Users',_0x4ebcee[_0x7681('0x9')](function(_0x266873){return{'id':_0x266873['id']};}));return OpenchannelMessage[_0x7681('0xa')]({'where':{'OpenchannelInteractionId':_0x20113b['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7681('0x7')](function(_0x2c7a25){_0x20113b[_0x7681('0x8')](_0x7681('0xb'),_0x2c7a25['length']);OpenchannelInteractionEvents[_0x7681('0xc')](_0x41e53b+':'+_0x20113b['id'],_0x20113b);OpenchannelInteractionEvents[_0x7681('0xc')](_0x41e53b,_0x20113b);_0x4a83e5(null);})[_0x7681('0xd')](_0x4a83e5(null));};}for(var e in events){if(events[_0x7681('0xe')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file +var _0x7a0b=['getUsers','then','Users','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','OpenchannelInteraction','update','remove'];(function(_0x16906e,_0x238f5d){var _0x5e1d74=function(_0x724fba){while(--_0x724fba){_0x16906e['push'](_0x16906e['shift']());}};_0x5e1d74(++_0x238f5d);}(_0x7a0b,0x13d));var _0xb7a0=function(_0x2e41b5,_0x9a9a69){_0x2e41b5=_0x2e41b5-0x0;var _0x1d74a9=_0x7a0b[_0x2e41b5];return _0x1d74a9;};'use strict';var EventEmitter=require(_0xb7a0('0x0'));var OpenchannelInteraction=require(_0xb7a0('0x1'))['db'][_0xb7a0('0x2')];var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xb7a0('0x3'),'afterDestroy':_0xb7a0('0x4')};function emitEvent(_0x21373c){return function(_0x1adabc,_0x280f50,_0x303069){_0x1adabc[_0xb7a0('0x5')]({'attributes':['id'],'raw':!![]})[_0xb7a0('0x6')](function(_0x202b87){_0x1adabc['setDataValue'](_0xb7a0('0x7'),_0x202b87['map'](function(_0x120db4){return{'id':_0x120db4['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x1adabc['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb7a0('0x6')](function(_0x44aa13){_0x1adabc['setDataValue'](_0xb7a0('0x8'),_0x44aa13[_0xb7a0('0x9')]);OpenchannelInteractionEvents[_0xb7a0('0xa')](_0x21373c+':'+_0x1adabc['id'],_0x1adabc);OpenchannelInteractionEvents[_0xb7a0('0xa')](_0x21373c,_0x1adabc);_0x303069(null);})[_0xb7a0('0xb')](_0x303069(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0xb7a0('0xc')](e,emitEvent(event));}}module[_0xb7a0('0xd')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 20e34e2..8a177ff 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 _0xcb60=['bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','changed','closed','closedAt','format','lodash','util','api','moment'];(function(_0x58957d,_0x3efd96){var _0x2a3032=function(_0x375fc0){while(--_0x375fc0){_0x58957d['push'](_0x58957d['shift']());}};_0x2a3032(++_0x3efd96);}(_0xcb60,0x1ea));var _0x0cb6=function(_0x43f881,_0xd6e5a2){_0x43f881=_0x43f881-0x0;var _0x365c14=_0xcb60[_0x43f881];return _0x365c14;};'use strict';var _=require(_0x0cb6('0x0'));var util=require(_0x0cb6('0x1'));var logger=require('../../config/logger')(_0x0cb6('0x2'));var moment=require(_0x0cb6('0x3'));var BPromise=require(_0x0cb6('0x4'));var rp=require(_0x0cb6('0x5'));var fs=require('fs');var path=require(_0x0cb6('0x6'));var rimraf=require(_0x0cb6('0x7'));var config=require(_0x0cb6('0x8'));var attributes=require(_0x0cb6('0x9'));module[_0x0cb6('0xa')]=function(_0x403dc,_0x1b01bd){return _0x403dc[_0x0cb6('0xb')](_0x0cb6('0xc'),attributes,{'tableName':_0x0cb6('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0cb6('0xe'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x18e8fd,_0xd798b0,_0x1febd6){if(_0x18e8fd[_0x0cb6('0xf')](_0x0cb6('0x10'))){_0x18e8fd[_0x0cb6('0x11')]=moment()[_0x0cb6('0x12')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1febd6(null,_0x18e8fd);}}});}; \ No newline at end of file +var _0xd142=['OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','moment','bluebird','request-promise','path','../../config/environment','./openchannelInteraction.attributes','exports'];(function(_0x349110,_0x33274a){var _0x449a11=function(_0x3c9d52){while(--_0x3c9d52){_0x349110['push'](_0x349110['shift']());}};_0x449a11(++_0x33274a);}(_0xd142,0x6f));var _0x2d14=function(_0x142be6,_0x55f613){_0x142be6=_0x142be6-0x0;var _0x3630d9=_0xd142[_0x142be6];return _0x3630d9;};'use strict';var _=require(_0x2d14('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x2d14('0x1'));var BPromise=require(_0x2d14('0x2'));var rp=require(_0x2d14('0x3'));var fs=require('fs');var path=require(_0x2d14('0x4'));var rimraf=require('rimraf');var config=require(_0x2d14('0x5'));var attributes=require(_0x2d14('0x6'));module[_0x2d14('0x7')]=function(_0x4a1c34,_0x47a0f3){return _0x4a1c34['define'](_0x2d14('0x8'),attributes,{'tableName':_0x2d14('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2d14('0xa'),'collate':_0x2d14('0xb'),'hooks':{'beforeUpdate':function(_0x6a7116,_0x39be7a,_0x26bb29){if(_0x6a7116[_0x2d14('0xc')](_0x2d14('0xd'))){_0x6a7116[_0x2d14('0xe')]=moment()[_0x2d14('0xf')](_0x2d14('0x10'));}_0x26bb29(null,_0x6a7116);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 215cd25..cc87721 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 _0x1fbd=['addTags','ids','omit','body','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateOpenchannelInteraction','options','raw','where','limit','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find'];(function(_0x340338,_0x3a71d1){var _0x5e836f=function(_0x573089){while(--_0x573089){_0x340338['push'](_0x340338['shift']());}};_0x5e836f(++_0x3a71d1);}(_0x1fbd,0x180));var _0xd1fb=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0x1fbd[_0x3070dc];return _0x431489;};'use strict';var _=require(_0xd1fb('0x0'));var util=require(_0xd1fb('0x1'));var moment=require(_0xd1fb('0x2'));var BPromise=require(_0xd1fb('0x3'));var rs=require(_0xd1fb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd1fb('0x5'))['db'];var utils=require(_0xd1fb('0x6'));var logger=require(_0xd1fb('0x7'))('rpc');var config=require(_0xd1fb('0x8'));var jayson=require(_0xd1fb('0x9'));var client=jayson['client'][_0xd1fb('0xa')]({'port':0x232a});config[_0xd1fb('0xb')]=_[_0xd1fb('0xc')](config[_0xd1fb('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xd1fb('0xd'))(new Redis(config[_0xd1fb('0xb')]));require(_0xd1fb('0xe'))[_0xd1fb('0xf')](socket);function respondWithRpcPromise(_0xa0bfed,_0x3bf1a3,_0x59c4ca){return new BPromise(function(_0x5c53af,_0x17b82d){return client[_0xd1fb('0x10')](_0xa0bfed,_0x59c4ca)[_0xd1fb('0x11')](function(_0x535e59){logger[_0xd1fb('0x12')](_0xd1fb('0x13'),_0x3bf1a3,_0xd1fb('0x14'));logger[_0xd1fb('0x15')](_0xd1fb('0x16'),_0x3bf1a3,_0xd1fb('0x14'),JSON[_0xd1fb('0x17')](_0x535e59));if(_0x535e59[_0xd1fb('0x18')]){if(_0x535e59[_0xd1fb('0x18')]['code']===0x1f4){logger[_0xd1fb('0x18')]('OpenchannelInteraction,\x20%s,\x20%s',_0x3bf1a3,_0x535e59[_0xd1fb('0x18')][_0xd1fb('0x19')]);return _0x17b82d(_0x535e59[_0xd1fb('0x18')][_0xd1fb('0x19')]);}logger[_0xd1fb('0x18')](_0xd1fb('0x13'),_0x3bf1a3,_0x535e59[_0xd1fb('0x18')][_0xd1fb('0x19')]);return _0x5c53af(_0x535e59[_0xd1fb('0x18')][_0xd1fb('0x19')]);}else{logger[_0xd1fb('0x12')](_0xd1fb('0x13'),_0x3bf1a3,'request\x20sent');_0x5c53af(_0x535e59[_0xd1fb('0x1a')]['message']);}})[_0xd1fb('0x1b')](function(_0x6cb3ab){logger[_0xd1fb('0x18')]('OpenchannelInteraction,\x20%s,\x20%s',_0x3bf1a3,_0x6cb3ab);_0x17b82d(_0x6cb3ab);});});}exports[_0xd1fb('0x1c')]=function(_0x4d25b7){var _0x5b79a2=this;return new Promise(function(_0x27810a,_0x4a9611){return db['OpenchannelInteraction']['update'](_0x4d25b7['body'],{'raw':_0x4d25b7[_0xd1fb('0x1d')]?_0x4d25b7[_0xd1fb('0x1d')][_0xd1fb('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d25b7[_0xd1fb('0x1d')]?_0x4d25b7[_0xd1fb('0x1d')][_0xd1fb('0x1f')]||null:null,'attributes':_0x4d25b7[_0xd1fb('0x1d')]?_0x4d25b7[_0xd1fb('0x1d')]['attributes']||null:null,'limit':_0x4d25b7[_0xd1fb('0x1d')]?_0x4d25b7[_0xd1fb('0x1d')][_0xd1fb('0x20')]||null:null})[_0xd1fb('0x11')](function(_0x556427){logger[_0xd1fb('0x12')](_0xd1fb('0x1c'),_0x4d25b7);logger[_0xd1fb('0x15')](_0xd1fb('0x1c'),_0x4d25b7,JSON[_0xd1fb('0x17')](_0x556427));_0x27810a(_0x556427);})[_0xd1fb('0x1b')](function(_0x53d32e){logger[_0xd1fb('0x18')]('UpdateOpenchannelInteraction',_0x53d32e[_0xd1fb('0x19')],_0x4d25b7);_0x4a9611(_0x5b79a2[_0xd1fb('0x18')](0x1f4,_0x53d32e[_0xd1fb('0x19')]));});});};exports[_0xd1fb('0x21')]=function(_0x2820db){return new Promise(function(_0x4773fc,_0x4bd49b){return db[_0xd1fb('0x22')][_0xd1fb('0x23')]({'where':_0x2820db[_0xd1fb('0x1d')]?_0x2820db['options'][_0xd1fb('0x1f')]||null:null})['then'](function(_0x9889d9){if(_0x9889d9){return _0x9889d9[_0xd1fb('0x24')](_0x2820db['body'][_0xd1fb('0x25')],_[_0xd1fb('0x26')](_0x2820db[_0xd1fb('0x27')],[_0xd1fb('0x25'),'id'])||{});}})[_0xd1fb('0x28')](function(_0x3cd11d){logger[_0xd1fb('0x12')]('AddTags',_0x2820db);logger['debug'](_0xd1fb('0x29'),_0x2820db,JSON[_0xd1fb('0x17')](_0x3cd11d));_0x4773fc(_0x3cd11d);})[_0xd1fb('0x1b')](function(_0x2609aa){logger[_0xd1fb('0x18')]('AddTags',_0x2609aa[_0xd1fb('0x19')],_0x2820db);_0x4bd49b(_this['error'](0x1f4,_0x2609aa['message']));});});}; \ No newline at end of file +var _0x6ab7=['update','body','raw','options','where','attributes','limit','info','ids','AddTags','lodash','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction'];(function(_0x4ebc8f,_0x71255){var _0x1b94a8=function(_0x4f3f7c){while(--_0x4f3f7c){_0x4ebc8f['push'](_0x4ebc8f['shift']());}};_0x1b94a8(++_0x71255);}(_0x6ab7,0xcd));var _0x76ab=function(_0x18dc8f,_0x174df0){_0x18dc8f=_0x18dc8f-0x0;var _0x2e1d30=_0x6ab7[_0x18dc8f];return _0x2e1d30;};'use strict';var _=require(_0x76ab('0x0'));var util=require('util');var moment=require(_0x76ab('0x1'));var BPromise=require('bluebird');var rs=require(_0x76ab('0x2'));var fs=require('fs');var Redis=require(_0x76ab('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x76ab('0x4'));var logger=require('../../config/logger')(_0x76ab('0x5'));var config=require(_0x76ab('0x6'));var jayson=require(_0x76ab('0x7'));var client=jayson[_0x76ab('0x8')][_0x76ab('0x9')]({'port':0x232a});config[_0x76ab('0xa')]=_[_0x76ab('0xb')](config[_0x76ab('0xa')],{'host':_0x76ab('0xc'),'port':0x18eb});var socket=require(_0x76ab('0xd'))(new Redis(config[_0x76ab('0xa')]));require(_0x76ab('0xe'))[_0x76ab('0xf')](socket);function respondWithRpcPromise(_0x599a64,_0x2dc764,_0x398280){return new BPromise(function(_0x1fa2bf,_0x50879c){return client[_0x76ab('0x10')](_0x599a64,_0x398280)[_0x76ab('0x11')](function(_0x1c7e39){logger['info'](_0x76ab('0x12'),_0x2dc764,'request\x20sent');logger[_0x76ab('0x13')](_0x76ab('0x14'),_0x2dc764,'request\x20sent',JSON[_0x76ab('0x15')](_0x1c7e39));if(_0x1c7e39[_0x76ab('0x16')]){if(_0x1c7e39[_0x76ab('0x16')][_0x76ab('0x17')]===0x1f4){logger[_0x76ab('0x16')](_0x76ab('0x12'),_0x2dc764,_0x1c7e39[_0x76ab('0x16')]['message']);return _0x50879c(_0x1c7e39[_0x76ab('0x16')][_0x76ab('0x18')]);}logger[_0x76ab('0x16')](_0x76ab('0x12'),_0x2dc764,_0x1c7e39[_0x76ab('0x16')][_0x76ab('0x18')]);return _0x1fa2bf(_0x1c7e39[_0x76ab('0x16')][_0x76ab('0x18')]);}else{logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0x2dc764,'request\x20sent');_0x1fa2bf(_0x1c7e39[_0x76ab('0x19')][_0x76ab('0x18')]);}})[_0x76ab('0x1a')](function(_0x447a6f){logger[_0x76ab('0x16')](_0x76ab('0x12'),_0x2dc764,_0x447a6f);_0x50879c(_0x447a6f);});});}exports[_0x76ab('0x1b')]=function(_0x4c97dc){var _0x38df06=this;return new Promise(function(_0x23bc88,_0x3766ca){return db[_0x76ab('0x1c')][_0x76ab('0x1d')](_0x4c97dc[_0x76ab('0x1e')],{'raw':_0x4c97dc['options']?_0x4c97dc['options'][_0x76ab('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c97dc[_0x76ab('0x20')]?_0x4c97dc[_0x76ab('0x20')][_0x76ab('0x21')]||null:null,'attributes':_0x4c97dc[_0x76ab('0x20')]?_0x4c97dc[_0x76ab('0x20')][_0x76ab('0x22')]||null:null,'limit':_0x4c97dc[_0x76ab('0x20')]?_0x4c97dc[_0x76ab('0x20')][_0x76ab('0x23')]||null:null})[_0x76ab('0x11')](function(_0x2a1f68){logger[_0x76ab('0x24')](_0x76ab('0x1b'),_0x4c97dc);logger[_0x76ab('0x13')](_0x76ab('0x1b'),_0x4c97dc,JSON[_0x76ab('0x15')](_0x2a1f68));_0x23bc88(_0x2a1f68);})[_0x76ab('0x1a')](function(_0xf48b5e){logger[_0x76ab('0x16')](_0x76ab('0x1b'),_0xf48b5e[_0x76ab('0x18')],_0x4c97dc);_0x3766ca(_0x38df06[_0x76ab('0x16')](0x1f4,_0xf48b5e['message']));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x41994c){return new Promise(function(_0x459cac,_0x18ef36){return db[_0x76ab('0x1c')]['find']({'where':_0x41994c['options']?_0x41994c[_0x76ab('0x20')]['where']||null:null})['then'](function(_0x477170){if(_0x477170){return _0x477170['addTags'](_0x41994c['body'][_0x76ab('0x25')],_['omit'](_0x41994c['body'],[_0x76ab('0x25'),'id'])||{});}})['spread'](function(_0x188459){logger[_0x76ab('0x24')]('AddTags',_0x41994c);logger['debug'](_0x76ab('0x26'),_0x41994c,JSON[_0x76ab('0x15')](_0x188459));_0x459cac(_0x188459);})['catch'](function(_0x4180f1){logger['error'](_0x76ab('0x26'),_0x4180f1['message'],_0x41994c);_0x18ef36(_this[_0x76ab('0x16')](0x1f4,_0x4180f1[_0x76ab('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 956eb0a..bf89d1f 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 _0xa15d=['remove','update','removeListener','length','openchannelInteraction:','./openchannelInteraction.events','save'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0xa15d,0x140));var _0xda15=function(_0x548627,_0x4ec392){_0x548627=_0x548627-0x0;var _0x844a84=_0xa15d[_0x548627];return _0x844a84;};'use strict';var OpenchannelInteractionEvents=require(_0xda15('0x0'));var events=[_0xda15('0x1'),_0xda15('0x2'),_0xda15('0x3')];function createListener(_0x12ffce,_0x3bee43){return function(_0x324917){_0x3bee43['emit'](_0x12ffce,_0x324917);};}function removeListener(_0xcffce6,_0x190f7a){return function(){OpenchannelInteractionEvents[_0xda15('0x4')](_0xcffce6,_0x190f7a);};}exports['register']=function(_0x51a89c){for(var _0x1484e8=0x0,_0xe8f557=events[_0xda15('0x5')];_0x1484e8<_0xe8f557;_0x1484e8++){var _0x151887=events[_0x1484e8];var _0x22fb9b=createListener(_0xda15('0x6')+_0x151887,_0x51a89c);OpenchannelInteractionEvents['on'](_0x151887,_0x22fb9b);}}; \ No newline at end of file +var _0x5e79=['removeListener','register','length','openchannelInteraction:','./openchannelInteraction.events','remove','emit'];(function(_0x35d4e9,_0x298c61){var _0x5c2770=function(_0x2f326a){while(--_0x2f326a){_0x35d4e9['push'](_0x35d4e9['shift']());}};_0x5c2770(++_0x298c61);}(_0x5e79,0x18c));var _0x95e7=function(_0xc7ff3,_0x2d2003){_0xc7ff3=_0xc7ff3-0x0;var _0x266e6f=_0x5e79[_0xc7ff3];return _0x266e6f;};'use strict';var OpenchannelInteractionEvents=require(_0x95e7('0x0'));var events=['save',_0x95e7('0x1'),'update'];function createListener(_0x43d49b,_0xd95b25){return function(_0x5ce327){_0xd95b25[_0x95e7('0x2')](_0x43d49b,_0x5ce327);};}function removeListener(_0x54fd40,_0xaf6215){return function(){OpenchannelInteractionEvents[_0x95e7('0x3')](_0x54fd40,_0xaf6215);};}exports[_0x95e7('0x4')]=function(_0x5a92bd){for(var _0x37abef=0x0,_0x132634=events[_0x95e7('0x5')];_0x37abef<_0x132634;_0x37abef++){var _0x5d01bc=events[_0x37abef];var _0x5b425f=createListener(_0x95e7('0x6')+_0x5d01bc,_0x5a92bd);OpenchannelInteractionEvents['on'](_0x5d01bc,_0x5b425f);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 8a1ade5..1f3a5b8 100644 --- a/server/api/openchannelMessage/index.js +++ b/server/api/openchannelMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['put','update','/:id/accept','accept','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','isAuthenticated','describe','get','/:id','show','post','openchannel','openchannelmessage:create','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x70e0,0x17b));var _0x070e=function(_0x3d3959,_0x1e76a9){_0x3d3959=_0x3d3959-0x0;var _0x5e76e8=_0x70e0[_0x3d3959];return _0x5e76e8;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');var controller=require(_0x070e('0x7'));router['get']('/',auth[_0x070e('0x8')](),controller['index']);router['get']('/describe',auth[_0x070e('0x8')](),controller[_0x070e('0x9')]);router[_0x070e('0xa')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x070e('0xe'),_0x070e('0xf')),controller[_0x070e('0x10')]);router[_0x070e('0x11')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0x12')]);router[_0x070e('0x11')](_0x070e('0x13'),auth[_0x070e('0x8')](),controller[_0x070e('0x14')]);router['put']('/:id/reject',auth[_0x070e('0x8')](),controller['reject']);router['delete']('/:id',auth[_0x070e('0x8')](),controller[_0x070e('0x15')]);module['exports']=router; \ No newline at end of file +var _0x0713=['get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','openchannelmessage:create','put','update','accept','/:id/reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelMessage.controller'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['show']);router[_0x3071('0xe')]('/',auth[_0x3071('0x9')](),interaction[_0x3071('0xf')](_0x3071('0x10'),_0x3071('0x11')),controller['create']);router[_0x3071('0x12')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x13')]);router[_0x3071('0x12')]('/:id/accept',auth['isAuthenticated'](),controller[_0x3071('0x14')]);router['put'](_0x3071('0x15'),auth[_0x3071('0x9')](),controller['reject']);router[_0x3071('0x16')]('/:id',auth[_0x3071('0x9')](),controller[_0x3071('0x17')]);module[_0x3071('0x18')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 24437d1..0741f18 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 _0xc692=['exports','TEXT','BOOLEAN','ENUM','out','DATE','STRING','sequelize'];(function(_0x1f48c4,_0x339c6a){var _0x362414=function(_0x47e848){while(--_0x47e848){_0x1f48c4['push'](_0x1f48c4['shift']());}};_0x362414(++_0x339c6a);}(_0xc692,0x15f));var _0x2c69=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xc692[_0x1035c1];return _0x308d67;};'use strict';var Sequelize=require(_0x2c69('0x0'));module[_0x2c69('0x1')]={'body':{'type':Sequelize[_0x2c69('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x2c69('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2c69('0x4')]('in',_0x2c69('0x5')),'defaultValue':_0x2c69('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x2c69('0x6')]},'providerName':{'type':Sequelize[_0x2c69('0x7')]},'providerResponse':{'type':Sequelize[_0x2c69('0x2')]}}; \ No newline at end of file +var _0x26f9=['exports','medium','ENUM','out','DATE','STRING','TEXT','sequelize'];(function(_0x1e22bf,_0x1a4c51){var _0xce29fc=function(_0x2a2477){while(--_0x2a2477){_0x1e22bf['push'](_0x1e22bf['shift']());}};_0xce29fc(++_0x1a4c51);}(_0x26f9,0x16f));var _0x926f=function(_0x95ac8b,_0x3706f5){_0x95ac8b=_0x95ac8b-0x0;var _0x5b0792=_0x26f9[_0x95ac8b];return _0x5b0792;};'use strict';var Sequelize=require(_0x926f('0x0'));module[_0x926f('0x1')]={'body':{'type':Sequelize['TEXT'](_0x926f('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x926f('0x3')]('in',_0x926f('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x926f('0x5')]},'providerName':{'type':Sequelize[_0x926f('0x6')]},'providerResponse':{'type':Sequelize[_0x926f('0x7')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index e7dae3a..f399d65 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 _0x55f9=['fields','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','filter','merge','options','includeAll','rows','show','params','include','find','create','body','describe','openchannel-interactions','accept','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','get','OpenchannelInteraction','OpenchannelInteractionId','update','isNil','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','contact','User','agent','fullname','email','interface','SIP/%s','channel','event','EventManager','acceptmessage','reject','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','sequelize','SELECT','internal','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','undefined','offset','count','limit','set','Content-Range','apply','destroy','sendStatus','stack','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','model','keys','filters','intersection','attributes','query'];(function(_0x10a998,_0x117cc4){var _0x5d939e=function(_0x3704f5){while(--_0x3704f5){_0x10a998['push'](_0x10a998['shift']());}};_0x5d939e(++_0x117cc4);}(_0x55f9,0x1cf));var _0x955f=function(_0x1fecff,_0xdc582c){_0x1fecff=_0x1fecff-0x0;var _0x5de71c=_0x55f9[_0x1fecff];return _0x5de71c;};'use strict';var emlformat=require(_0x955f('0x0'));var rimraf=require(_0x955f('0x1'));var zipdir=require(_0x955f('0x2'));var jsonpatch=require(_0x955f('0x3'));var rp=require('request-promise');var moment=require(_0x955f('0x4'));var BPromise=require(_0x955f('0x5'));var Mustache=require(_0x955f('0x6'));var util=require(_0x955f('0x7'));var path=require(_0x955f('0x8'));var sox=require(_0x955f('0x9'));var csv=require(_0x955f('0xa'));var ejs=require(_0x955f('0xb'));var fs=require('fs');var fs_extra=require(_0x955f('0xc'));var _=require(_0x955f('0xd'));var squel=require(_0x955f('0xe'));var crypto=require(_0x955f('0xf'));var jsforce=require(_0x955f('0x10'));var deskjs=require(_0x955f('0x11'));var toCsv=require(_0x955f('0xa'));var querystring=require(_0x955f('0x12'));var Papa=require(_0x955f('0x13'));var Redis=require(_0x955f('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x955f('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x955f('0x16'));var logger=require(_0x955f('0x17'))(_0x955f('0x18'));var utils=require(_0x955f('0x19'));var config=require(_0x955f('0x1a'));var licenseUtil=require(_0x955f('0x1b'));var db=require(_0x955f('0x1c'))['db'];config[_0x955f('0x1d')]=_[_0x955f('0x1e')](config[_0x955f('0x1d')],{'host':_0x955f('0x1f'),'port':0x18eb});var socket=require(_0x955f('0x20'))(new Redis(config[_0x955f('0x1d')]));require(_0x955f('0x21'))[_0x955f('0x22')](socket);var jayson=require(_0x955f('0x23'));var client=jayson[_0x955f('0x24')][_0x955f('0x25')]({'port':0x232c});var client9002=jayson[_0x955f('0x24')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3fe3d8,_0x5584e6,_0x3a9b86,_0x5edde6){return new BPromise(function(_0x28a762,_0x55ec7a){var _0x109f01=_0x5edde6||client;return _0x109f01[_0x955f('0x26')](_0x3fe3d8,_0x3a9b86)[_0x955f('0x27')](function(_0x178d61){logger[_0x955f('0x28')](_0x955f('0x29'),_0x5584e6,_0x955f('0x2a'));logger[_0x955f('0x2b')](_0x955f('0x2c'),_0x5584e6,'request\x20sent',JSON[_0x955f('0x2d')](_0x178d61));if(_0x178d61[_0x955f('0x2e')]){if(_0x178d61[_0x955f('0x2e')][_0x955f('0x2f')]===0x1f4){logger[_0x955f('0x2e')](_0x955f('0x29'),_0x5584e6,_0x178d61[_0x955f('0x2e')]['message']);return _0x55ec7a(_0x178d61[_0x955f('0x2e')]['message']);}logger[_0x955f('0x2e')](_0x955f('0x29'),_0x5584e6,_0x178d61[_0x955f('0x2e')][_0x955f('0x30')]);return _0x28a762(_0x178d61[_0x955f('0x2e')]['message']);}else{logger[_0x955f('0x28')](_0x955f('0x29'),_0x5584e6,_0x955f('0x2a'));_0x28a762(_0x178d61[_0x955f('0x31')][_0x955f('0x30')]);}})[_0x955f('0x32')](function(_0x1f7296){logger[_0x955f('0x2e')](_0x955f('0x29'),_0x5584e6,_0x1f7296);_0x55ec7a(_0x1f7296);});});}function respondWithStatusCode(_0x2fd936,_0x23d2e4){_0x23d2e4=_0x23d2e4||0xcc;return function(_0x5efc62){if(_0x5efc62){return _0x2fd936['sendStatus'](_0x23d2e4);}return _0x2fd936[_0x955f('0x33')](_0x23d2e4)[_0x955f('0x34')]();};}function respondWithResult(_0x36a228,_0x16d9e6){_0x16d9e6=_0x16d9e6||0xc8;return function(_0x447497){if(_0x447497){return _0x36a228[_0x955f('0x33')](_0x16d9e6)[_0x955f('0x35')](_0x447497);}};}function respondWithFilteredResult(_0x33527d,_0x10cb15){return function(_0x1250c4){if(_0x1250c4){var _0xcb3b79=typeof _0x10cb15['offset']===_0x955f('0x36')&&typeof _0x10cb15['limit']===_0x955f('0x36');var _0x32939c=_0x1250c4['count'];var _0x46f6b9=_0xcb3b79?0x0:_0x10cb15[_0x955f('0x37')];var _0x109345=_0xcb3b79?_0x1250c4[_0x955f('0x38')]:_0x10cb15[_0x955f('0x37')]+_0x10cb15[_0x955f('0x39')];var _0x5620ef;if(_0x109345>=_0x32939c){_0x109345=_0x32939c;_0x5620ef=0xc8;}else{_0x5620ef=0xce;}_0x33527d[_0x955f('0x33')](_0x5620ef);return _0x33527d[_0x955f('0x3a')](_0x955f('0x3b'),_0x46f6b9+'-'+_0x109345+'/'+_0x32939c)[_0x955f('0x35')](_0x1250c4);}return null;};}function patchUpdates(_0x2c6c86){return function(_0x4ded15){try{jsonpatch[_0x955f('0x3c')](_0x4ded15,_0x2c6c86,!![]);}catch(_0x34fb00){return BPromise['reject'](_0x34fb00);}return _0x4ded15['save']();};}function saveUpdates(_0x9622ae,_0x140666){return function(_0x50209d){if(_0x50209d){return _0x50209d['update'](_0x9622ae)[_0x955f('0x27')](function(_0x465a2e){return _0x465a2e;});}return null;};}function removeEntity(_0x37e25e,_0x1380bf){return function(_0x822f22){if(_0x822f22){return _0x822f22[_0x955f('0x3d')]()['then'](function(){_0x37e25e[_0x955f('0x33')](0xcc)[_0x955f('0x34')]();});}};}function handleEntityNotFound(_0x23af88,_0x150705){return function(_0x4e54cf){if(!_0x4e54cf){_0x23af88[_0x955f('0x3e')](0x194);}return _0x4e54cf;};}function handleError(_0x396a04,_0x4858e0){_0x4858e0=_0x4858e0||0x1f4;return function(_0x57b34d){logger[_0x955f('0x2e')](_0x57b34d[_0x955f('0x3f')]);if(_0x57b34d[_0x955f('0x40')]){delete _0x57b34d[_0x955f('0x40')];}_0x396a04['status'](_0x4858e0)[_0x955f('0x41')](_0x57b34d);};}exports[_0x955f('0x42')]=function(_0x3b592e,_0x593b4f){var _0x3c308a={},_0x14187a={},_0x5d9b8f={'count':0x0,'rows':[]};var _0x47095b=_[_0x955f('0x43')](db[_0x955f('0x44')][_0x955f('0x45')],function(_0x101b70){return{'name':_0x101b70[_0x955f('0x46')],'type':_0x101b70['type']['key']};});_0x14187a[_0x955f('0x47')]=_[_0x955f('0x43')](_0x47095b,_0x955f('0x40'));_0x14187a['query']=_[_0x955f('0x48')](_0x3b592e['query']);_0x14187a[_0x955f('0x49')]=_[_0x955f('0x4a')](_0x14187a[_0x955f('0x47')],_0x14187a['query']);_0x3c308a[_0x955f('0x4b')]=_[_0x955f('0x4a')](_0x14187a[_0x955f('0x47')],qs['fields'](_0x3b592e[_0x955f('0x4c')][_0x955f('0x4d')]));_0x3c308a[_0x955f('0x4b')]=_0x3c308a[_0x955f('0x4b')][_0x955f('0x4e')]?_0x3c308a[_0x955f('0x4b')]:_0x14187a[_0x955f('0x47')];if(!_0x3b592e[_0x955f('0x4c')][_0x955f('0x4f')](_0x955f('0x50'))){_0x3c308a[_0x955f('0x39')]=qs['limit'](_0x3b592e[_0x955f('0x4c')][_0x955f('0x39')]);_0x3c308a[_0x955f('0x37')]=qs['offset'](_0x3b592e['query'][_0x955f('0x37')]);}_0x3c308a[_0x955f('0x51')]=qs[_0x955f('0x52')](_0x3b592e[_0x955f('0x4c')][_0x955f('0x52')]);_0x3c308a['where']=qs[_0x955f('0x49')](_[_0x955f('0x53')](_0x3b592e[_0x955f('0x4c')],_0x14187a[_0x955f('0x49')]),_0x47095b);if(_0x3b592e[_0x955f('0x4c')]['filter']){_0x3c308a[_0x955f('0x54')]=_['merge'](_0x3c308a[_0x955f('0x54')],{'$or':_['map'](_0x47095b,function(_0x33c5be){if(_0x33c5be['type']!==_0x955f('0x55')){var _0x227dba={};_0x227dba[_0x33c5be[_0x955f('0x40')]]={'$like':'%'+_0x3b592e[_0x955f('0x4c')][_0x955f('0x56')]+'%'};return _0x227dba;}})});}_0x3c308a=_[_0x955f('0x57')]({},_0x3c308a,_0x3b592e[_0x955f('0x58')]);var _0x3ded26={'where':_0x3c308a['where']};return db[_0x955f('0x44')][_0x955f('0x38')](_0x3ded26)[_0x955f('0x27')](function(_0x453cbf){_0x5d9b8f['count']=_0x453cbf;if(_0x3b592e[_0x955f('0x4c')][_0x955f('0x59')]){_0x3c308a['include']=[{'all':!![]}];}return db[_0x955f('0x44')]['findAll'](_0x3c308a);})[_0x955f('0x27')](function(_0x54885d){_0x5d9b8f[_0x955f('0x5a')]=_0x54885d;return _0x5d9b8f;})[_0x955f('0x27')](respondWithFilteredResult(_0x593b4f,_0x3c308a))[_0x955f('0x32')](handleError(_0x593b4f,null));};exports[_0x955f('0x5b')]=function(_0x548190,_0x311663){var _0x41c530={'raw':!![],'where':{'id':_0x548190[_0x955f('0x5c')]['id']}},_0x14a069={};_0x14a069[_0x955f('0x47')]=_['keys'](db['OpenchannelMessage']['rawAttributes']);_0x14a069['query']=_[_0x955f('0x48')](_0x548190[_0x955f('0x4c')]);_0x14a069[_0x955f('0x49')]=_[_0x955f('0x4a')](_0x14a069['model'],_0x14a069['query']);_0x41c530[_0x955f('0x4b')]=_[_0x955f('0x4a')](_0x14a069[_0x955f('0x47')],qs[_0x955f('0x4d')](_0x548190[_0x955f('0x4c')]['fields']));_0x41c530['attributes']=_0x41c530['attributes']['length']?_0x41c530['attributes']:_0x14a069['model'];if(_0x548190[_0x955f('0x4c')]['includeAll']){_0x41c530[_0x955f('0x5d')]=[{'all':!![]}];}_0x41c530=_[_0x955f('0x57')]({},_0x41c530,_0x548190[_0x955f('0x58')]);return db[_0x955f('0x44')][_0x955f('0x5e')](_0x41c530)[_0x955f('0x27')](handleEntityNotFound(_0x311663,null))[_0x955f('0x27')](respondWithResult(_0x311663,null))[_0x955f('0x32')](handleError(_0x311663,null));};exports[_0x955f('0x5f')]=function(_0x5c74ac,_0x1f3d42){return db[_0x955f('0x44')][_0x955f('0x5f')](_0x5c74ac['body'],{})['then'](respondWithResult(_0x1f3d42,0xc9))[_0x955f('0x32')](handleError(_0x1f3d42,null));};exports['update']=function(_0x5c9a70,_0x385dc2){if(_0x5c9a70[_0x955f('0x60')]['id']){delete _0x5c9a70['body']['id'];}return db['OpenchannelMessage']['find']({'where':{'id':_0x5c9a70[_0x955f('0x5c')]['id']}})[_0x955f('0x27')](handleEntityNotFound(_0x385dc2,null))[_0x955f('0x27')](saveUpdates(_0x5c9a70[_0x955f('0x60')],null))[_0x955f('0x27')](respondWithResult(_0x385dc2,null))['catch'](handleError(_0x385dc2,null));};exports[_0x955f('0x3d')]=function(_0x45661d,_0xa5bfa7){return db['OpenchannelMessage'][_0x955f('0x5e')]({'where':{'id':_0x45661d[_0x955f('0x5c')]['id']}})[_0x955f('0x27')](handleEntityNotFound(_0xa5bfa7,null))[_0x955f('0x27')](removeEntity(_0xa5bfa7,null))[_0x955f('0x32')](handleError(_0xa5bfa7,null));};exports[_0x955f('0x61')]=function(_0x5e0ee7,_0x8ad4e7){return db[_0x955f('0x44')][_0x955f('0x61')]()[_0x955f('0x27')](respondWithResult(_0x8ad4e7,null))['catch'](handleError(_0x8ad4e7,null));};var interaction_log=require(_0x955f('0x17'))(_0x955f('0x62'));exports[_0x955f('0x63')]=function(_0x3369ac,_0x3472ec,_0x415f3e){var _0x24140a={'agent':{},'channel':'openchannel'};if(_0x3369ac['body']['id']){delete _0x3369ac[_0x955f('0x60')]['id'];}_0x3369ac['body'][_0x955f('0x64')]=!![];_0x3369ac['body']['readAt']=moment()[_0x955f('0x65')](_0x955f('0x66'));_0x3369ac[_0x955f('0x60')][_0x955f('0x67')]=_0x3369ac['body'][_0x955f('0x67')]||_0x3369ac['user']['id'];_0x24140a['agent']['id']=_0x3369ac[_0x955f('0x60')][_0x955f('0x67')];return db[_0x955f('0x44')][_0x955f('0x5e')]({'where':{'id':_0x3369ac[_0x955f('0x5c')]['id'],'UserId':null}})[_0x955f('0x27')](handleEntityNotFound(_0x3472ec,null))[_0x955f('0x27')](saveUpdates(_0x3369ac[_0x955f('0x60')],null))[_0x955f('0x27')](function(_0x6bf3c5){if(_0x6bf3c5){_0x24140a[_0x955f('0x30')]=_0x6bf3c5[_0x955f('0x68')]({'plain':!![]});return db[_0x955f('0x69')][_0x955f('0x5e')]({'where':{'id':_0x6bf3c5[_0x955f('0x6a')]}});}return null;})[_0x955f('0x27')](handleEntityNotFound(_0x3472ec,null))[_0x955f('0x27')](function(_0x55d069){if(_0x55d069){return _0x55d069[_0x955f('0x6b')]({'UserId':_0x3369ac[_0x955f('0x60')][_0x955f('0x67')],'read1stAt':_[_0x955f('0x6c')](_0x55d069['read1stAt'])?moment()[_0x955f('0x65')](_0x955f('0x66')):undefined});}return null;})['then'](function(_0x16e34f){if(_0x16e34f){_0x24140a[_0x955f('0x6d')]=_0x16e34f[_0x955f('0x68')]({'plain':!![]});interaction_log[_0x955f('0x28')](_0x955f('0x6e'),_0x3369ac[_0x955f('0x6f')]['id'],_0x3369ac['user'][_0x955f('0x40')],_0x3369ac['user'][_0x955f('0x70')],_0x24140a['interaction']['id'],_0x3369ac[_0x955f('0x60')]?JSON[_0x955f('0x2d')](_0x3369ac[_0x955f('0x60')]):_0x955f('0x71'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x24140a);}return null;})['then'](function(_0x3c38fa){var _0x27357d=_0x955f('0x72')+_0x3c38fa[_0x955f('0x30')][_0x955f('0x73')];return db['sequelize'][_0x955f('0x4c')](_0x27357d,{'type':db[_0x955f('0x74')][_0x955f('0x75')]['SELECT'],'raw':!![]})[_0x955f('0x27')](function(_0x3b2200){return _0x3b2200;});})[_0x955f('0x27')](function(_0x241086){if(_0x241086){_0x24140a[_0x955f('0x30')][_0x955f('0x76')]=_0x241086[0x0];if(!_0x3369ac[_0x955f('0x60')][_0x955f('0x67')])return;return db[_0x955f('0x77')]['find']({'where':{'id':_0x3369ac[_0x955f('0x60')]['UserId'],'role':_0x955f('0x78')},'attributes':['id','name',_0x955f('0x79'),_0x955f('0x7a'),'internal'],'raw':!![]});}return null;})[_0x955f('0x27')](function(_0x23ef9b){if(!_0x23ef9b)return null;_0x24140a[_0x955f('0x30')][_0x955f('0x78')]=_0x23ef9b;return _0x24140a;})[_0x955f('0x27')](function(_0x109b3c){if(_0x109b3c){if(_0x3369ac[_0x955f('0x60')]['manual']){_0x24140a[_0x955f('0x30')][_0x955f('0x7b')]=util[_0x955f('0x65')](_0x955f('0x7c'),_0x3369ac[_0x955f('0x6f')]['name']);_0x24140a[_0x955f('0x30')][_0x955f('0x7d')]=_0x24140a[_0x955f('0x7d')];_0x24140a[_0x955f('0x30')]['motionChannel']=_0x24140a['channel'];_0x24140a[_0x955f('0x30')][_0x955f('0x7e')]=_0x955f('0x63');return respondWithRpcPromise(_0x955f('0x7f'),_0x955f('0x7f'),{'event':_0x955f('0x80'),'message':_0x24140a[_0x955f('0x30')]},client9002)['then'](function(){return _0x24140a;});}return _0x24140a;}return null;})[_0x955f('0x27')](respondWithResult(_0x3472ec,null))['catch'](handleError(_0x3472ec,null));};var interaction_log=require(_0x955f('0x17'))('openchannel-interactions');exports[_0x955f('0x81')]=function(_0x30317e,_0x55afc0,_0x46321a){var _0x289972={'agent':{},'channel':'openchannel'};if(_0x30317e['body']['id']){delete _0x30317e[_0x955f('0x60')]['id'];}_0x30317e[_0x955f('0x60')][_0x955f('0x67')]=_0x30317e[_0x955f('0x60')][_0x955f('0x67')]||_0x30317e[_0x955f('0x6f')]['id'];_0x289972['agent']['id']=_0x30317e[_0x955f('0x60')][_0x955f('0x67')];return db[_0x955f('0x44')][_0x955f('0x5e')]({'where':{'id':_0x30317e[_0x955f('0x5c')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x55afc0,null))[_0x955f('0x27')](function(_0x8ce70d){if(_0x8ce70d){_0x289972['message']=_0x8ce70d['get']({'plain':!![]});return db['OpenchannelInteraction']['find']({'where':{'id':_0x8ce70d['OpenchannelInteractionId']}});}return null;})[_0x955f('0x27')](handleEntityNotFound(_0x55afc0,null))[_0x955f('0x27')](function(_0x5136d6){if(_0x5136d6){_0x289972['interaction']=_0x5136d6[_0x955f('0x68')]({'plain':!![]});interaction_log[_0x955f('0x28')](_0x955f('0x82'),_0x30317e[_0x955f('0x6f')]['id'],_0x30317e['user'][_0x955f('0x40')],_0x30317e[_0x955f('0x6f')][_0x955f('0x70')],_0x289972[_0x955f('0x6d')]['id'],_0x30317e[_0x955f('0x60')]?JSON[_0x955f('0x2d')](_0x30317e[_0x955f('0x60')]):_0x955f('0x71'));return respondWithRpcPromise(_0x955f('0x83'),'rejectMessage',_0x289972);}return null;})[_0x955f('0x27')](function(_0x3b28c6){var _0x5c6aeb='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3b28c6[_0x955f('0x30')][_0x955f('0x73')];return db[_0x955f('0x84')]['query'](_0x5c6aeb,{'type':db[_0x955f('0x74')][_0x955f('0x75')][_0x955f('0x85')],'raw':!![]})['then'](function(_0x25d39){return _0x25d39;});})[_0x955f('0x27')](function(_0x3a987e){if(_0x3a987e){_0x289972[_0x955f('0x30')][_0x955f('0x76')]=_0x3a987e[0x0];if(!_0x30317e[_0x955f('0x60')]['UserId'])return;return db[_0x955f('0x77')][_0x955f('0x5e')]({'where':{'id':_0x30317e[_0x955f('0x60')]['UserId'],'role':_0x955f('0x78')},'attributes':['id','name','fullname','email',_0x955f('0x86')],'raw':!![]});}return null;})['then'](function(_0xb3ac16){if(!_0xb3ac16)return null;_0x289972[_0x955f('0x30')][_0x955f('0x78')]=_0xb3ac16;return _0x289972;})[_0x955f('0x27')](function(_0x97c0e6){if(_0x97c0e6){_0x97c0e6[_0x955f('0x30')][_0x955f('0x7b')]=util[_0x955f('0x65')](_0x955f('0x7c'),_0x30317e[_0x955f('0x6f')][_0x955f('0x40')]);_0x97c0e6[_0x955f('0x30')][_0x955f('0x7d')]=_0x289972[_0x955f('0x7d')];_0x97c0e6[_0x955f('0x30')]['motionChannel']=_0x289972[_0x955f('0x7d')];_0x97c0e6[_0x955f('0x30')][_0x955f('0x7e')]='reject';respondWithRpcPromise(_0x955f('0x7f'),_0x955f('0x7f'),{'event':'rejectmessage','message':_0x97c0e6[_0x955f('0x30')]},client9002);return _0x289972;}return null;})[_0x955f('0x27')](respondWithResult(_0x55afc0,null))[_0x955f('0x32')](handleError(_0x55afc0,null));}; \ No newline at end of file +var _0xb931=['catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','name','send','OpenchannelMessage','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','order','sort','pick','where','VIRTUAL','filter','merge','options','includeAll','include','rows','params','find','create','body','describe','../../config/logger','openchannel-interactions','accept','openchannel','read','readAt','UserId','agent','get','OpenchannelInteractionId','read1stAt','format','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','stringify','null','acceptMessage','sequelize','Sequelize','SELECT','contact','User','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','OpenchannelInteraction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','email','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','./openchannelMessage.socket','register','jayson/promise','client','http','request','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','message','info','result'];(function(_0x2c448b,_0x3681ef){var _0x6f2002=function(_0x36aa57){while(--_0x36aa57){_0x2c448b['push'](_0x2c448b['shift']());}};_0x6f2002(++_0x3681ef);}(_0xb931,0x155));var _0x1b93=function(_0x5699c5,_0x2cd71e){_0x5699c5=_0x5699c5-0x0;var _0x40dabf=_0xb931[_0x5699c5];return _0x40dabf;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1b93('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1b93('0x1'));var BPromise=require(_0x1b93('0x2'));var Mustache=require(_0x1b93('0x3'));var util=require(_0x1b93('0x4'));var path=require(_0x1b93('0x5'));var sox=require(_0x1b93('0x6'));var csv=require(_0x1b93('0x7'));var ejs=require(_0x1b93('0x8'));var fs=require('fs');var fs_extra=require(_0x1b93('0x9'));var _=require(_0x1b93('0xa'));var squel=require(_0x1b93('0xb'));var crypto=require(_0x1b93('0xc'));var jsforce=require(_0x1b93('0xd'));var deskjs=require(_0x1b93('0xe'));var toCsv=require(_0x1b93('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1b93('0xf'));var authService=require(_0x1b93('0x10'));var qs=require(_0x1b93('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1b93('0x12'));var logger=require('../../config/logger')(_0x1b93('0x13'));var utils=require(_0x1b93('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1b93('0x15'))['db'];config[_0x1b93('0x16')]=_[_0x1b93('0x17')](config['redis'],{'host':_0x1b93('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1b93('0x16')]));require(_0x1b93('0x19'))[_0x1b93('0x1a')](socket);var jayson=require(_0x1b93('0x1b'));var client=jayson[_0x1b93('0x1c')][_0x1b93('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0x1b93('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x267527,_0x240b8f,_0x23d687,_0x4d4c47){return new BPromise(function(_0x294be5,_0x42b8d4){var _0x4f7199=_0x4d4c47||client;return _0x4f7199[_0x1b93('0x1e')](_0x267527,_0x23d687)[_0x1b93('0x1f')](function(_0x4ed0d5){logger['info'](_0x1b93('0x20'),_0x240b8f,_0x1b93('0x21'));logger[_0x1b93('0x22')](_0x1b93('0x23'),_0x240b8f,_0x1b93('0x21'),JSON['stringify'](_0x4ed0d5));if(_0x4ed0d5[_0x1b93('0x24')]){if(_0x4ed0d5[_0x1b93('0x24')]['code']===0x1f4){logger['error'](_0x1b93('0x20'),_0x240b8f,_0x4ed0d5[_0x1b93('0x24')][_0x1b93('0x25')]);return _0x42b8d4(_0x4ed0d5[_0x1b93('0x24')][_0x1b93('0x25')]);}logger[_0x1b93('0x24')]('OpenchannelMessage,\x20%s,\x20%s',_0x240b8f,_0x4ed0d5[_0x1b93('0x24')][_0x1b93('0x25')]);return _0x294be5(_0x4ed0d5[_0x1b93('0x24')]['message']);}else{logger[_0x1b93('0x26')](_0x1b93('0x20'),_0x240b8f,_0x1b93('0x21'));_0x294be5(_0x4ed0d5[_0x1b93('0x27')][_0x1b93('0x25')]);}})[_0x1b93('0x28')](function(_0x13cddc){logger[_0x1b93('0x24')](_0x1b93('0x20'),_0x240b8f,_0x13cddc);_0x42b8d4(_0x13cddc);});});}function respondWithStatusCode(_0x24f04e,_0x8010e6){_0x8010e6=_0x8010e6||0xcc;return function(_0x189869){if(_0x189869){return _0x24f04e[_0x1b93('0x29')](_0x8010e6);}return _0x24f04e[_0x1b93('0x2a')](_0x8010e6)[_0x1b93('0x2b')]();};}function respondWithResult(_0x5ce57b,_0x56e2d3){_0x56e2d3=_0x56e2d3||0xc8;return function(_0x5dccf3){if(_0x5dccf3){return _0x5ce57b[_0x1b93('0x2a')](_0x56e2d3)[_0x1b93('0x2c')](_0x5dccf3);}};}function respondWithFilteredResult(_0x2501ee,_0x20b035){return function(_0xc47d69){if(_0xc47d69){var _0x59983e=typeof _0x20b035['offset']===_0x1b93('0x2d')&&typeof _0x20b035[_0x1b93('0x2e')]===_0x1b93('0x2d');var _0x4d504c=_0xc47d69[_0x1b93('0x2f')];var _0x49873d=_0x59983e?0x0:_0x20b035[_0x1b93('0x30')];var _0x3d18c8=_0x59983e?_0xc47d69[_0x1b93('0x2f')]:_0x20b035['offset']+_0x20b035['limit'];var _0xa0f296;if(_0x3d18c8>=_0x4d504c){_0x3d18c8=_0x4d504c;_0xa0f296=0xc8;}else{_0xa0f296=0xce;}_0x2501ee['status'](_0xa0f296);return _0x2501ee[_0x1b93('0x31')](_0x1b93('0x32'),_0x49873d+'-'+_0x3d18c8+'/'+_0x4d504c)[_0x1b93('0x2c')](_0xc47d69);}return null;};}function patchUpdates(_0x49c445){return function(_0x21e053){try{jsonpatch[_0x1b93('0x33')](_0x21e053,_0x49c445,!![]);}catch(_0x1b5cac){return BPromise[_0x1b93('0x34')](_0x1b5cac);}return _0x21e053[_0x1b93('0x35')]();};}function saveUpdates(_0x113528,_0xe46935){return function(_0x26cf9b){if(_0x26cf9b){return _0x26cf9b[_0x1b93('0x36')](_0x113528)[_0x1b93('0x1f')](function(_0x3efd5e){return _0x3efd5e;});}return null;};}function removeEntity(_0x52302d,_0x5b55dc){return function(_0x1b0afa){if(_0x1b0afa){return _0x1b0afa[_0x1b93('0x37')]()[_0x1b93('0x1f')](function(){_0x52302d[_0x1b93('0x2a')](0xcc)[_0x1b93('0x2b')]();});}};}function handleEntityNotFound(_0x12627b,_0x2e6f54){return function(_0x568aba){if(!_0x568aba){_0x12627b['sendStatus'](0x194);}return _0x568aba;};}function handleError(_0x4de705,_0x20e6c2){_0x20e6c2=_0x20e6c2||0x1f4;return function(_0x457674){logger['error'](_0x457674['stack']);if(_0x457674[_0x1b93('0x38')]){delete _0x457674[_0x1b93('0x38')];}_0x4de705['status'](_0x20e6c2)[_0x1b93('0x39')](_0x457674);};}exports['index']=function(_0x413013,_0x3da1b5){var _0x2e0b7e={},_0xc9df19={},_0x1929e7={'count':0x0,'rows':[]};var _0x2b292f=_['map'](db[_0x1b93('0x3a')]['rawAttributes'],function(_0x3755cc){return{'name':_0x3755cc['fieldName'],'type':_0x3755cc[_0x1b93('0x3b')][_0x1b93('0x3c')]};});_0xc9df19[_0x1b93('0x3d')]=_[_0x1b93('0x3e')](_0x2b292f,_0x1b93('0x38'));_0xc9df19[_0x1b93('0x3f')]=_[_0x1b93('0x40')](_0x413013[_0x1b93('0x3f')]);_0xc9df19[_0x1b93('0x41')]=_[_0x1b93('0x42')](_0xc9df19[_0x1b93('0x3d')],_0xc9df19[_0x1b93('0x3f')]);_0x2e0b7e[_0x1b93('0x43')]=_[_0x1b93('0x42')](_0xc9df19['model'],qs[_0x1b93('0x44')](_0x413013[_0x1b93('0x3f')][_0x1b93('0x44')]));_0x2e0b7e['attributes']=_0x2e0b7e[_0x1b93('0x43')][_0x1b93('0x45')]?_0x2e0b7e[_0x1b93('0x43')]:_0xc9df19[_0x1b93('0x3d')];if(!_0x413013[_0x1b93('0x3f')]['hasOwnProperty']('nolimit')){_0x2e0b7e['limit']=qs[_0x1b93('0x2e')](_0x413013['query']['limit']);_0x2e0b7e[_0x1b93('0x30')]=qs[_0x1b93('0x30')](_0x413013[_0x1b93('0x3f')][_0x1b93('0x30')]);}_0x2e0b7e[_0x1b93('0x46')]=qs[_0x1b93('0x47')](_0x413013[_0x1b93('0x3f')]['sort']);_0x2e0b7e['where']=qs[_0x1b93('0x41')](_[_0x1b93('0x48')](_0x413013['query'],_0xc9df19[_0x1b93('0x41')]),_0x2b292f);if(_0x413013[_0x1b93('0x3f')]['filter']){_0x2e0b7e[_0x1b93('0x49')]=_['merge'](_0x2e0b7e[_0x1b93('0x49')],{'$or':_[_0x1b93('0x3e')](_0x2b292f,function(_0x4fa0ff){if(_0x4fa0ff[_0x1b93('0x3b')]!==_0x1b93('0x4a')){var _0x401a52={};_0x401a52[_0x4fa0ff[_0x1b93('0x38')]]={'$like':'%'+_0x413013['query'][_0x1b93('0x4b')]+'%'};return _0x401a52;}})});}_0x2e0b7e=_[_0x1b93('0x4c')]({},_0x2e0b7e,_0x413013[_0x1b93('0x4d')]);var _0x32110c={'where':_0x2e0b7e['where']};return db[_0x1b93('0x3a')][_0x1b93('0x2f')](_0x32110c)['then'](function(_0x11e5e7){_0x1929e7['count']=_0x11e5e7;if(_0x413013[_0x1b93('0x3f')][_0x1b93('0x4e')]){_0x2e0b7e[_0x1b93('0x4f')]=[{'all':!![]}];}return db[_0x1b93('0x3a')]['findAll'](_0x2e0b7e);})[_0x1b93('0x1f')](function(_0x4476f1){_0x1929e7[_0x1b93('0x50')]=_0x4476f1;return _0x1929e7;})[_0x1b93('0x1f')](respondWithFilteredResult(_0x3da1b5,_0x2e0b7e))[_0x1b93('0x28')](handleError(_0x3da1b5,null));};exports['show']=function(_0x34d5a8,_0x56efde){var _0x4d6ea7={'raw':!![],'where':{'id':_0x34d5a8[_0x1b93('0x51')]['id']}},_0x3b8a89={};_0x3b8a89[_0x1b93('0x3d')]=_[_0x1b93('0x40')](db[_0x1b93('0x3a')]['rawAttributes']);_0x3b8a89[_0x1b93('0x3f')]=_[_0x1b93('0x40')](_0x34d5a8[_0x1b93('0x3f')]);_0x3b8a89[_0x1b93('0x41')]=_[_0x1b93('0x42')](_0x3b8a89['model'],_0x3b8a89[_0x1b93('0x3f')]);_0x4d6ea7['attributes']=_[_0x1b93('0x42')](_0x3b8a89['model'],qs['fields'](_0x34d5a8[_0x1b93('0x3f')]['fields']));_0x4d6ea7[_0x1b93('0x43')]=_0x4d6ea7['attributes']['length']?_0x4d6ea7[_0x1b93('0x43')]:_0x3b8a89[_0x1b93('0x3d')];if(_0x34d5a8['query'][_0x1b93('0x4e')]){_0x4d6ea7[_0x1b93('0x4f')]=[{'all':!![]}];}_0x4d6ea7=_[_0x1b93('0x4c')]({},_0x4d6ea7,_0x34d5a8['options']);return db[_0x1b93('0x3a')][_0x1b93('0x52')](_0x4d6ea7)['then'](handleEntityNotFound(_0x56efde,null))[_0x1b93('0x1f')](respondWithResult(_0x56efde,null))[_0x1b93('0x28')](handleError(_0x56efde,null));};exports[_0x1b93('0x53')]=function(_0x2c1436,_0x5e3921){return db[_0x1b93('0x3a')][_0x1b93('0x53')](_0x2c1436[_0x1b93('0x54')],{})[_0x1b93('0x1f')](respondWithResult(_0x5e3921,0xc9))['catch'](handleError(_0x5e3921,null));};exports[_0x1b93('0x36')]=function(_0x583b2a,_0x5b2605){if(_0x583b2a['body']['id']){delete _0x583b2a[_0x1b93('0x54')]['id'];}return db[_0x1b93('0x3a')][_0x1b93('0x52')]({'where':{'id':_0x583b2a[_0x1b93('0x51')]['id']}})[_0x1b93('0x1f')](handleEntityNotFound(_0x5b2605,null))[_0x1b93('0x1f')](saveUpdates(_0x583b2a[_0x1b93('0x54')],null))[_0x1b93('0x1f')](respondWithResult(_0x5b2605,null))[_0x1b93('0x28')](handleError(_0x5b2605,null));};exports['destroy']=function(_0x1e4551,_0xcc189e){return db['OpenchannelMessage']['find']({'where':{'id':_0x1e4551[_0x1b93('0x51')]['id']}})[_0x1b93('0x1f')](handleEntityNotFound(_0xcc189e,null))[_0x1b93('0x1f')](removeEntity(_0xcc189e,null))[_0x1b93('0x28')](handleError(_0xcc189e,null));};exports[_0x1b93('0x55')]=function(_0x20965e,_0x2050da){return db[_0x1b93('0x3a')]['describe']()[_0x1b93('0x1f')](respondWithResult(_0x2050da,null))[_0x1b93('0x28')](handleError(_0x2050da,null));};var interaction_log=require(_0x1b93('0x56'))(_0x1b93('0x57'));exports[_0x1b93('0x58')]=function(_0x32cf6c,_0x1c6054,_0x259a2c){var _0x55bcee={'agent':{},'channel':_0x1b93('0x59')};if(_0x32cf6c[_0x1b93('0x54')]['id']){delete _0x32cf6c[_0x1b93('0x54')]['id'];}_0x32cf6c[_0x1b93('0x54')][_0x1b93('0x5a')]=!![];_0x32cf6c['body'][_0x1b93('0x5b')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x32cf6c[_0x1b93('0x54')][_0x1b93('0x5c')]=_0x32cf6c[_0x1b93('0x54')][_0x1b93('0x5c')]||_0x32cf6c['user']['id'];_0x55bcee[_0x1b93('0x5d')]['id']=_0x32cf6c['body']['UserId'];return db[_0x1b93('0x3a')]['find']({'where':{'id':_0x32cf6c[_0x1b93('0x51')]['id'],'UserId':null}})[_0x1b93('0x1f')](handleEntityNotFound(_0x1c6054,null))[_0x1b93('0x1f')](saveUpdates(_0x32cf6c[_0x1b93('0x54')],null))[_0x1b93('0x1f')](function(_0x3e09aa){if(_0x3e09aa){_0x55bcee[_0x1b93('0x25')]=_0x3e09aa[_0x1b93('0x5e')]({'plain':!![]});return db['OpenchannelInteraction'][_0x1b93('0x52')]({'where':{'id':_0x3e09aa[_0x1b93('0x5f')]}});}return null;})[_0x1b93('0x1f')](handleEntityNotFound(_0x1c6054,null))[_0x1b93('0x1f')](function(_0x12fb39){if(_0x12fb39){return _0x12fb39[_0x1b93('0x36')]({'UserId':_0x32cf6c[_0x1b93('0x54')][_0x1b93('0x5c')],'read1stAt':_['isNil'](_0x12fb39[_0x1b93('0x60')])?moment()[_0x1b93('0x61')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x1b93('0x1f')](function(_0x369497){if(_0x369497){_0x55bcee['interaction']=_0x369497['get']({'plain':!![]});interaction_log['info'](_0x1b93('0x62'),_0x32cf6c[_0x1b93('0x63')]['id'],_0x32cf6c['user'][_0x1b93('0x38')],_0x32cf6c[_0x1b93('0x63')][_0x1b93('0x64')],_0x55bcee[_0x1b93('0x65')]['id'],_0x32cf6c['body']?JSON[_0x1b93('0x66')](_0x32cf6c[_0x1b93('0x54')]):_0x1b93('0x67'));return respondWithRpcPromise('AcceptMessage',_0x1b93('0x68'),_0x55bcee);}return null;})['then'](function(_0x5612c2){var _0xc22563='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5612c2[_0x1b93('0x25')]['ContactId'];return db[_0x1b93('0x69')][_0x1b93('0x3f')](_0xc22563,{'type':db[_0x1b93('0x6a')]['QueryTypes'][_0x1b93('0x6b')],'raw':!![]})[_0x1b93('0x1f')](function(_0x16a9d0){return _0x16a9d0;});})[_0x1b93('0x1f')](function(_0x80edbe){if(_0x80edbe){_0x55bcee[_0x1b93('0x25')][_0x1b93('0x6c')]=_0x80edbe[0x0];if(!_0x32cf6c[_0x1b93('0x54')][_0x1b93('0x5c')])return;return db[_0x1b93('0x6d')]['find']({'where':{'id':_0x32cf6c[_0x1b93('0x54')][_0x1b93('0x5c')],'role':'agent'},'attributes':['id',_0x1b93('0x38'),_0x1b93('0x6e'),'email',_0x1b93('0x6f')],'raw':!![]});}return null;})[_0x1b93('0x1f')](function(_0x51fc34){if(!_0x51fc34)return null;_0x55bcee[_0x1b93('0x25')][_0x1b93('0x5d')]=_0x51fc34;return _0x55bcee;})['then'](function(_0x571f2e){if(_0x571f2e){if(_0x32cf6c['body'][_0x1b93('0x70')]){_0x55bcee[_0x1b93('0x25')][_0x1b93('0x71')]=util[_0x1b93('0x61')](_0x1b93('0x72'),_0x32cf6c[_0x1b93('0x63')][_0x1b93('0x38')]);_0x55bcee[_0x1b93('0x25')][_0x1b93('0x73')]=_0x55bcee[_0x1b93('0x73')];_0x55bcee[_0x1b93('0x25')][_0x1b93('0x74')]=_0x55bcee[_0x1b93('0x73')];_0x55bcee[_0x1b93('0x25')][_0x1b93('0x75')]=_0x1b93('0x58');return respondWithRpcPromise(_0x1b93('0x76'),_0x1b93('0x76'),{'event':_0x1b93('0x77'),'message':_0x55bcee[_0x1b93('0x25')]},client9002)[_0x1b93('0x1f')](function(){return _0x55bcee;});}return _0x55bcee;}return null;})[_0x1b93('0x1f')](respondWithResult(_0x1c6054,null))['catch'](handleError(_0x1c6054,null));};var interaction_log=require(_0x1b93('0x56'))(_0x1b93('0x57'));exports['reject']=function(_0x1cc006,_0x453bd3,_0x40657c){var _0x598eae={'agent':{},'channel':_0x1b93('0x59')};if(_0x1cc006['body']['id']){delete _0x1cc006[_0x1b93('0x54')]['id'];}_0x1cc006['body'][_0x1b93('0x5c')]=_0x1cc006['body'][_0x1b93('0x5c')]||_0x1cc006[_0x1b93('0x63')]['id'];_0x598eae[_0x1b93('0x5d')]['id']=_0x1cc006['body'][_0x1b93('0x5c')];return db[_0x1b93('0x3a')][_0x1b93('0x52')]({'where':{'id':_0x1cc006['params']['id'],'UserId':null}})[_0x1b93('0x1f')](handleEntityNotFound(_0x453bd3,null))[_0x1b93('0x1f')](function(_0x27863c){if(_0x27863c){_0x598eae[_0x1b93('0x25')]=_0x27863c[_0x1b93('0x5e')]({'plain':!![]});return db[_0x1b93('0x78')]['find']({'where':{'id':_0x27863c[_0x1b93('0x5f')]}});}return null;})[_0x1b93('0x1f')](handleEntityNotFound(_0x453bd3,null))[_0x1b93('0x1f')](function(_0x3badf4){if(_0x3badf4){_0x598eae[_0x1b93('0x65')]=_0x3badf4[_0x1b93('0x5e')]({'plain':!![]});interaction_log[_0x1b93('0x26')](_0x1b93('0x79'),_0x1cc006[_0x1b93('0x63')]['id'],_0x1cc006[_0x1b93('0x63')]['name'],_0x1cc006[_0x1b93('0x63')][_0x1b93('0x64')],_0x598eae[_0x1b93('0x65')]['id'],_0x1cc006[_0x1b93('0x54')]?JSON[_0x1b93('0x66')](_0x1cc006['body']):_0x1b93('0x67'));return respondWithRpcPromise('RejectMessage',_0x1b93('0x7a'),_0x598eae);}return null;})['then'](function(_0x5db261){var _0x21aa38=_0x1b93('0x7b')+_0x5db261[_0x1b93('0x25')][_0x1b93('0x7c')];return db['sequelize']['query'](_0x21aa38,{'type':db[_0x1b93('0x6a')][_0x1b93('0x7d')]['SELECT'],'raw':!![]})[_0x1b93('0x1f')](function(_0x50ed33){return _0x50ed33;});})[_0x1b93('0x1f')](function(_0x1af304){if(_0x1af304){_0x598eae[_0x1b93('0x25')]['contact']=_0x1af304[0x0];if(!_0x1cc006[_0x1b93('0x54')]['UserId'])return;return db[_0x1b93('0x6d')][_0x1b93('0x52')]({'where':{'id':_0x1cc006['body'][_0x1b93('0x5c')],'role':'agent'},'attributes':['id',_0x1b93('0x38'),'fullname',_0x1b93('0x7e'),'internal'],'raw':!![]});}return null;})[_0x1b93('0x1f')](function(_0x27f984){if(!_0x27f984)return null;_0x598eae[_0x1b93('0x25')][_0x1b93('0x5d')]=_0x27f984;return _0x598eae;})[_0x1b93('0x1f')](function(_0x23afdc){if(_0x23afdc){_0x23afdc['message'][_0x1b93('0x71')]=util['format'](_0x1b93('0x72'),_0x1cc006['user']['name']);_0x23afdc[_0x1b93('0x25')][_0x1b93('0x73')]=_0x598eae[_0x1b93('0x73')];_0x23afdc[_0x1b93('0x25')][_0x1b93('0x74')]=_0x598eae[_0x1b93('0x73')];_0x23afdc[_0x1b93('0x25')]['event']=_0x1b93('0x34');respondWithRpcPromise(_0x1b93('0x76'),_0x1b93('0x76'),{'event':'rejectmessage','message':_0x23afdc['message']},client9002);return _0x598eae;}return null;})['then'](respondWithResult(_0x453bd3,null))[_0x1b93('0x28')](handleError(_0x453bd3,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 0237152..2b98602 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 _0x87e5=['save','update','remove','emit','hasOwnProperty','hook','exports','events','OpenchannelMessage','setMaxListeners'];(function(_0x347ffb,_0x156d2b){var _0x330474=function(_0x482f60){while(--_0x482f60){_0x347ffb['push'](_0x347ffb['shift']());}};_0x330474(++_0x156d2b);}(_0x87e5,0x101));var _0x587e=function(_0x4429e0,_0xee6f1f){_0x4429e0=_0x4429e0-0x0;var _0x51a5b3=_0x87e5[_0x4429e0];return _0x51a5b3;};'use strict';var EventEmitter=require(_0x587e('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0x587e('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x587e('0x2')](0x0);var events={'afterCreate':_0x587e('0x3'),'afterUpdate':_0x587e('0x4'),'afterDestroy':_0x587e('0x5')};function emitEvent(_0x1d1909){return function(_0x485ae9,_0x586b58,_0x4d5eb7){OpenchannelMessageEvents[_0x587e('0x6')](_0x1d1909+':'+_0x485ae9['id'],_0x485ae9);OpenchannelMessageEvents['emit'](_0x1d1909,_0x485ae9);_0x4d5eb7(null);};}for(var e in events){if(events[_0x587e('0x7')](e)){var event=events[e];OpenchannelMessage[_0x587e('0x8')](e,emitEvent(event));}}module[_0x587e('0x9')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x31c9=['save','remove','emit','hasOwnProperty','hook','exports','events','OpenchannelMessage'];(function(_0x3e29c4,_0x22e6e9){var _0x5adaee=function(_0x1ed936){while(--_0x1ed936){_0x3e29c4['push'](_0x3e29c4['shift']());}};_0x5adaee(++_0x22e6e9);}(_0x31c9,0x7e));var _0x931c=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x31c9[_0x122ef9];return _0x42fba0;};'use strict';var EventEmitter=require(_0x931c('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0x931c('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x931c('0x2'),'afterUpdate':'update','afterDestroy':_0x931c('0x3')};function emitEvent(_0x1cc887){return function(_0x9df802,_0xdf2b12,_0x1f1637){OpenchannelMessageEvents['emit'](_0x1cc887+':'+_0x9df802['id'],_0x9df802);OpenchannelMessageEvents[_0x931c('0x4')](_0x1cc887,_0x9df802);_0x1f1637(null);};}for(var e in events){if(events[_0x931c('0x5')](e)){var event=events[e];OpenchannelMessage[_0x931c('0x6')](e,emitEvent(event));}}module[_0x931c('0x7')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 012761c..57fbec8 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 _0xbaf0=['out','secret','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','OpenchannelInteractionId','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Contact','POST','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','error','inspect','finally','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','body','models','get','direction','toLowerCase','isNil','UserId','OpenchannelInteraction','findOne','then','update','createdAt','catch'];(function(_0x57459f,_0x4ad563){var _0x476b9c=function(_0x405e3b){while(--_0x405e3b){_0x57459f['push'](_0x57459f['shift']());}};_0x476b9c(++_0x4ad563);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':[_0x0baf('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4605c3,_0x2c7442,_0x465528){var _0x2f46e8=_0xe4c3c4[_0x0baf('0xe')];var _0xf4c8ac=_0x4605c3[_0x0baf('0xf')]({'plain':!![]});if(_0xf4c8ac[_0x0baf('0x10')][_0x0baf('0x11')]()==='in'||_0xf4c8ac[_0x0baf('0x10')][_0x0baf('0x11')]()==='out'&&!_0xf4c8ac['secret']&&!_[_0x0baf('0x12')](_0xf4c8ac[_0x0baf('0x13')])){_0x2f46e8[_0x0baf('0x14')][_0x0baf('0x15')]({'where':{'id':_0xf4c8ac['OpenchannelInteractionId']}})[_0x0baf('0x16')](function(_0x49e44b){if(_0x49e44b){_0x49e44b[_0x0baf('0x17')]({'lastMsgAt':_0xf4c8ac[_0x0baf('0x18')],'lastMsgDirection':_0xf4c8ac[_0x0baf('0x10')][_0x0baf('0x11')]()});}})[_0x0baf('0x19')](function(_0x469599){console['error'](_0x469599);});}if(_0xf4c8ac['direction']===_0x0baf('0x1a')&&!_0xf4c8ac[_0x0baf('0x1b')]){var _0x283408;_0x2f46e8[_0x0baf('0x1c')][_0x0baf('0x1d')]()[_0x0baf('0x16')](function(_0x53c338){return _0x2f46e8[_0x0baf('0x1e')][_0x0baf('0x1f')]({'where':{'id':_0xf4c8ac[_0x0baf('0x20')]},'include':[{'model':_0x2f46e8[_0x0baf('0x14')],'as':_0x0baf('0x21'),'where':{'id':_0xf4c8ac[_0x0baf('0x22')]},'limit':0x1,'include':[{'model':_0x2f46e8['CmContact'],'as':'Contact','attributes':_[_0x0baf('0x23')](_0x53c338)}]}]});})[_0x0baf('0x16')](function(_0x32e839){_0x283408=_0x32e839[_0x0baf('0xf')]({'plain':!![]});if(_0x283408&&_0x283408[_0x0baf('0x24')]){logger[_0x0baf('0x25')](_0x0baf('0x26'),_0x0baf('0x27'),util[_0x0baf('0x28')](_0x0baf('0x29'),_0xf4c8ac['id'],_0x283408['replyUri']));if(_0x283408[_0x0baf('0x21')]&&_0x283408['Interactions'][_0x0baf('0x2a')]){_0xf4c8ac['Interaction']=_['omit'](_0x283408[_0x0baf('0x21')][0x0],'Contact');_0xf4c8ac['Contact']=_0x283408[_0x0baf('0x21')][0x0][_0x0baf('0x2b')];}var _0x2c7442={'method':_0x0baf('0x2c'),'uri':encodeURI(_0x283408[_0x0baf('0x24')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x2c7442['method']){case _0x0baf('0x2d'):_0x2c7442['qs']=_0xf4c8ac;break;case _0x0baf('0x2c'):_0x2c7442[_0x0baf('0xd')]=_0xf4c8ac;break;}return rp(_0x2c7442)[_0x0baf('0x16')](function(_0x3843b8){logger[_0x0baf('0x25')](_0x0baf('0x26'),'afterCreate',util[_0x0baf('0x28')](_0x0baf('0x2e'),_0xf4c8ac['id'],_0x283408[_0x0baf('0x24')]));if(_0x3843b8[_0x0baf('0xd')]['threadId']&&_0x3843b8[_0x0baf('0xd')][_0x0baf('0x2f')]!=_0xf4c8ac['Interaction'][_0x0baf('0x2f')]){return _0x2f46e8[_0x0baf('0x14')][_0x0baf('0x17')]({'threadId':_0x3843b8[_0x0baf('0xd')][_0x0baf('0x2f')]},{'logging':!![],'where':{'id':_0xf4c8ac[_0x0baf('0x30')]['id']}});}else{return;}})[_0x0baf('0x16')](function(){return _0x4605c3['update']({'read':!![]});})[_0x0baf('0x19')](function(_0x156ed7){logger[_0x0baf('0x31')](_0x0baf('0x26'),_0x0baf('0x27'),util[_0x0baf('0x32')](_0x156ed7,{'showHidden':![],'depth':null}));_0x465528();});}else{_0x465528();}})[_0x0baf('0x33')](function(){_0x465528();});}else{_0x465528();}}},'charset':_0x0baf('0x34'),'collate':_0x0baf('0x35')});}; \ No newline at end of file +var _0x5eb8=['OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','omit','POST','method','GET','info','body','Interaction','threadId','inspect','finally','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','OpenchannelInteraction','then','update','createdAt','catch','error','out','CmContact','OpenchannelAccount','find','OpenchannelAccountId','Interactions','OpenchannelInteractionId','Contact','keys'];(function(_0x2d682b,_0x2bd648){var _0x258253=function(_0x5bf9e8){while(--_0x5bf9e8){_0x2d682b['push'](_0x2d682b['shift']());}};_0x258253(++_0x2bd648);}(_0x5eb8,0xb0));var _0x85eb=function(_0x2ed8f3,_0x4aa12f){_0x2ed8f3=_0x2ed8f3-0x0;var _0x525a55=_0x5eb8[_0x2ed8f3];return _0x525a55;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x85eb('0x0'))(_0x85eb('0x1'));var moment=require(_0x85eb('0x2'));var BPromise=require(_0x85eb('0x3'));var rp=require(_0x85eb('0x4'));var fs=require('fs');var path=require(_0x85eb('0x5'));var rimraf=require(_0x85eb('0x6'));var config=require(_0x85eb('0x7'));var attributes=require(_0x85eb('0x8'));module[_0x85eb('0x9')]=function(_0x2bf83c,_0x1ba1d8){return _0x2bf83c['define'](_0x85eb('0xa'),attributes,{'tableName':_0x85eb('0xb'),'paranoid':![],'indexes':[{'name':_0x85eb('0xc'),'fields':['body'],'type':_0x85eb('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x50ea77,_0x1f0036,_0x40d6b6){var _0x673228=_0x2bf83c[_0x85eb('0xe')];var _0x1dacf2=_0x50ea77[_0x85eb('0xf')]({'plain':!![]});if(_0x1dacf2[_0x85eb('0x10')]['toLowerCase']()==='in'||_0x1dacf2[_0x85eb('0x10')][_0x85eb('0x11')]()==='out'&&!_0x1dacf2[_0x85eb('0x12')]&&!_[_0x85eb('0x13')](_0x1dacf2[_0x85eb('0x14')])){_0x673228[_0x85eb('0x15')]['findOne']({'where':{'id':_0x1dacf2['OpenchannelInteractionId']}})[_0x85eb('0x16')](function(_0x5c760a){if(_0x5c760a){_0x5c760a[_0x85eb('0x17')]({'lastMsgAt':_0x1dacf2[_0x85eb('0x18')],'lastMsgDirection':_0x1dacf2[_0x85eb('0x10')][_0x85eb('0x11')]()});}})[_0x85eb('0x19')](function(_0x49efdf){console[_0x85eb('0x1a')](_0x49efdf);});}if(_0x1dacf2['direction']===_0x85eb('0x1b')&&!_0x1dacf2[_0x85eb('0x12')]){var _0x3e23e8;_0x673228[_0x85eb('0x1c')]['describe']()['then'](function(_0x50d2a8){return _0x673228[_0x85eb('0x1d')][_0x85eb('0x1e')]({'where':{'id':_0x1dacf2[_0x85eb('0x1f')]},'include':[{'model':_0x673228[_0x85eb('0x15')],'as':_0x85eb('0x20'),'where':{'id':_0x1dacf2[_0x85eb('0x21')]},'limit':0x1,'include':[{'model':_0x673228['CmContact'],'as':_0x85eb('0x22'),'attributes':_[_0x85eb('0x23')](_0x50d2a8)}]}]});})[_0x85eb('0x16')](function(_0x4e8041){_0x3e23e8=_0x4e8041['get']({'plain':!![]});if(_0x3e23e8&&_0x3e23e8['replyUri']){logger['info'](_0x85eb('0x24'),_0x85eb('0x25'),util[_0x85eb('0x26')](_0x85eb('0x27'),_0x1dacf2['id'],_0x3e23e8[_0x85eb('0x28')]));if(_0x3e23e8[_0x85eb('0x20')]&&_0x3e23e8['Interactions']['length']){_0x1dacf2['Interaction']=_[_0x85eb('0x29')](_0x3e23e8[_0x85eb('0x20')][0x0],_0x85eb('0x22'));_0x1dacf2[_0x85eb('0x22')]=_0x3e23e8[_0x85eb('0x20')][0x0][_0x85eb('0x22')];}var _0x1f0036={'method':_0x85eb('0x2a'),'uri':encodeURI(_0x3e23e8[_0x85eb('0x28')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x1f0036[_0x85eb('0x2b')]){case _0x85eb('0x2c'):_0x1f0036['qs']=_0x1dacf2;break;case _0x85eb('0x2a'):_0x1f0036['body']=_0x1dacf2;break;}return rp(_0x1f0036)[_0x85eb('0x16')](function(_0x792d3a){logger[_0x85eb('0x2d')](_0x85eb('0x24'),_0x85eb('0x25'),util[_0x85eb('0x26')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x1dacf2['id'],_0x3e23e8['replyUri']));if(_0x792d3a[_0x85eb('0x2e')]['threadId']&&_0x792d3a[_0x85eb('0x2e')]['threadId']!=_0x1dacf2[_0x85eb('0x2f')][_0x85eb('0x30')]){return _0x673228[_0x85eb('0x15')][_0x85eb('0x17')]({'threadId':_0x792d3a[_0x85eb('0x2e')][_0x85eb('0x30')]},{'logging':!![],'where':{'id':_0x1dacf2[_0x85eb('0x2f')]['id']}});}else{return;}})['then'](function(){return _0x50ea77[_0x85eb('0x17')]({'read':!![]});})[_0x85eb('0x19')](function(_0x515ee9){logger[_0x85eb('0x1a')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0x85eb('0x31')](_0x515ee9,{'showHidden':![],'depth':null}));_0x40d6b6();});}else{_0x40d6b6();}})[_0x85eb('0x32')](function(){_0x40d6b6();});}else{_0x40d6b6();}}},'charset':_0x85eb('0x33'),'collate':_0x85eb('0x34')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 31a7d5a..7d19c3c 100644 --- a/server/api/openchannelMessage/openchannelMessage.rpc.js +++ b/server/api/openchannelMessage/openchannelMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['debug','request\x20sent','stringify','error','code','message','info','result','catch','OpenchannelMessage','body','raw','CreateOpenchannelMessage','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x3bf4c7,_0x124769){var _0x24c7fb=function(_0x490153){while(--_0x490153){_0x3bf4c7['push'](_0x3bf4c7['shift']());}};_0x24c7fb(++_0x124769);}(_0xadb5,0xad));var _0x5adb=function(_0x2d4517,_0x32f2bb){_0x2d4517=_0x2d4517-0x0;var _0x5a1cab=_0xadb5[_0x2d4517];return _0x5a1cab;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});config[_0x5adb('0xa')]=_[_0x5adb('0xb')](config[_0x5adb('0xa')],{'host':_0x5adb('0xc'),'port':0x18eb});var socket=require(_0x5adb('0xd'))(new Redis(config[_0x5adb('0xa')]));require(_0x5adb('0xe'))[_0x5adb('0xf')](socket);function respondWithRpcPromise(_0x336bad,_0x129f5a,_0x275428){return new BPromise(function(_0x563d86,_0x4c268d){return client[_0x5adb('0x10')](_0x336bad,_0x275428)[_0x5adb('0x11')](function(_0x82e67e){logger['info'](_0x5adb('0x12'),_0x129f5a,'request\x20sent');logger[_0x5adb('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x129f5a,_0x5adb('0x14'),JSON[_0x5adb('0x15')](_0x82e67e));if(_0x82e67e[_0x5adb('0x16')]){if(_0x82e67e['error'][_0x5adb('0x17')]===0x1f4){logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e['error'][_0x5adb('0x18')]);return _0x4c268d(_0x82e67e['error'][_0x5adb('0x18')]);}logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);return _0x563d86(_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);}else{logger[_0x5adb('0x19')](_0x5adb('0x12'),_0x129f5a,'request\x20sent');_0x563d86(_0x82e67e[_0x5adb('0x1a')]['message']);}})[_0x5adb('0x1b')](function(_0x558f76){logger[_0x5adb('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x129f5a,_0x558f76);_0x4c268d(_0x558f76);});});}exports['CreateOpenchannelMessage']=function(_0x1fbaa5){var _0x1bed20=this;return new Promise(function(_0x438671,_0x1fd4a7){return db[_0x5adb('0x1c')]['create'](_0x1fbaa5[_0x5adb('0x1d')],{'raw':_0x1fbaa5['options']?_0x1fbaa5['options'][_0x5adb('0x1e')]===undefined?!![]:![]:!![]})[_0x5adb('0x11')](function(_0x1a38d3){logger[_0x5adb('0x19')](_0x5adb('0x1f'),_0x1fbaa5);logger[_0x5adb('0x13')](_0x5adb('0x1f'),_0x1fbaa5,JSON['stringify'](_0x1a38d3));_0x438671(_0x1a38d3);})[_0x5adb('0x1b')](function(_0x373cc3){logger[_0x5adb('0x16')](_0x5adb('0x1f'),_0x373cc3[_0x5adb('0x18')],_0x1fbaa5);_0x1fd4a7(_0x1bed20['error'](0x1f4,_0x373cc3[_0x5adb('0x18')]));});});}; \ No newline at end of file +var _0x2ef3=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','CreateOpenchannelMessage','create','options','info'];(function(_0x52f498,_0xeec0c3){var _0x2a97cb=function(_0x43ad5d){while(--_0x43ad5d){_0x52f498['push'](_0x52f498['shift']());}};_0x2a97cb(++_0xeec0c3);}(_0x2ef3,0xba));var _0x32ef=function(_0x102582,_0x3cc038){_0x102582=_0x102582-0x0;var _0x63e2c5=_0x2ef3[_0x102582];return _0x63e2c5;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x32ef('0xa')]=_[_0x32ef('0xb')](config[_0x32ef('0xa')],{'host':_0x32ef('0xc'),'port':0x18eb});var socket=require(_0x32ef('0xd'))(new Redis(config[_0x32ef('0xa')]));require(_0x32ef('0xe'))[_0x32ef('0xf')](socket);function respondWithRpcPromise(_0x28275c,_0x77df79,_0x56eb42){return new BPromise(function(_0x5780e9,_0x401d0b){return client[_0x32ef('0x10')](_0x28275c,_0x56eb42)[_0x32ef('0x11')](function(_0x1499c2){logger['info'](_0x32ef('0x12'),_0x77df79,'request\x20sent');logger[_0x32ef('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x77df79,_0x32ef('0x14'),JSON[_0x32ef('0x15')](_0x1499c2));if(_0x1499c2['error']){if(_0x1499c2['error'][_0x32ef('0x16')]===0x1f4){logger['error'](_0x32ef('0x12'),_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x401d0b(_0x1499c2[_0x32ef('0x17')]['message']);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x5780e9(_0x1499c2[_0x32ef('0x17')]['message']);}else{logger['info'](_0x32ef('0x12'),_0x77df79,_0x32ef('0x14'));_0x5780e9(_0x1499c2[_0x32ef('0x19')]['message']);}})[_0x32ef('0x1a')](function(_0x33e230){logger['error'](_0x32ef('0x12'),_0x77df79,_0x33e230);_0x401d0b(_0x33e230);});});}exports[_0x32ef('0x1b')]=function(_0x26aff3){var _0x251084=this;return new Promise(function(_0x445cda,_0x3aec05){return db['OpenchannelMessage'][_0x32ef('0x1c')](_0x26aff3['body'],{'raw':_0x26aff3[_0x32ef('0x1d')]?_0x26aff3[_0x32ef('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x32ef('0x11')](function(_0x97780){logger[_0x32ef('0x1e')]('CreateOpenchannelMessage',_0x26aff3);logger['debug'](_0x32ef('0x1b'),_0x26aff3,JSON[_0x32ef('0x15')](_0x97780));_0x445cda(_0x97780);})[_0x32ef('0x1a')](function(_0x478bef){logger['error'](_0x32ef('0x1b'),_0x478bef['message'],_0x26aff3);_0x3aec05(_0x251084['error'](0x1f4,_0x478bef[_0x32ef('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 7bd0e89..193e436 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 _0xdd41=['./openchannelMessage.events','save','remove','update','removeListener','length'];(function(_0x10aebb,_0x2fd10a){var _0x1b1b8f=function(_0x1161be){while(--_0x1161be){_0x10aebb['push'](_0x10aebb['shift']());}};_0x1b1b8f(++_0x2fd10a);}(_0xdd41,0x1f2));var _0x1dd4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdd41[_0x3dd15e];return _0x231fd0;};'use strict';var OpenchannelMessageEvents=require(_0x1dd4('0x0'));var events=[_0x1dd4('0x1'),_0x1dd4('0x2'),_0x1dd4('0x3')];function createListener(_0x53c761,_0x14079d){return function(_0x101e25){_0x14079d['emit'](_0x53c761,_0x101e25);};}function removeListener(_0x4d2603,_0x43f80a){return function(){OpenchannelMessageEvents[_0x1dd4('0x4')](_0x4d2603,_0x43f80a);};}exports['register']=function(_0xaa0c85){for(var _0x1e6287=0x0,_0x5661bf=events[_0x1dd4('0x5')];_0x1e6287<_0x5661bf;_0x1e6287++){var _0x581693=events[_0x1e6287];var _0x489b97=createListener('openchannelMessage:'+_0x581693,_0xaa0c85);OpenchannelMessageEvents['on'](_0x581693,_0x489b97);}}; \ No newline at end of file +var _0xd4f4=['./openchannelMessage.events','update','emit','removeListener','register','openchannelMessage:'];(function(_0x2d7a8b,_0x7193d1){var _0x11c28e=function(_0x402455){while(--_0x402455){_0x2d7a8b['push'](_0x2d7a8b['shift']());}};_0x11c28e(++_0x7193d1);}(_0xd4f4,0x1bc));var _0x4d4f=function(_0x5c4442,_0x3536f6){_0x5c4442=_0x5c4442-0x0;var _0x15707a=_0xd4f4[_0x5c4442];return _0x15707a;};'use strict';var OpenchannelMessageEvents=require(_0x4d4f('0x0'));var events=['save','remove',_0x4d4f('0x1')];function createListener(_0x3abe87,_0x490a34){return function(_0x4c519c){_0x490a34[_0x4d4f('0x2')](_0x3abe87,_0x4c519c);};}function removeListener(_0x48e54e,_0x49f0ac){return function(){OpenchannelMessageEvents[_0x4d4f('0x3')](_0x48e54e,_0x49f0ac);};}exports[_0x4d4f('0x4')]=function(_0x23168c){for(var _0x4d3e22=0x0,_0x370640=events['length'];_0x4d3e22<_0x370640;_0x4d3e22++){var _0x54c172=events[_0x4d3e22];var _0x4b93d3=createListener(_0x4d4f('0x5')+_0x54c172,_0x23168c);OpenchannelMessageEvents['on'](_0x54c172,_0x4b93d3);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 397ba37..36409bc 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 _0x1c72=['/:id/users','getAgents','post','destroy','delete','removeTeams','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1c72,0x10b));var _0x21c7=function(_0x4d5deb,_0x3ec7db){_0x4d5deb=_0x4d5deb-0x0;var _0x23a799=_0x1c72[_0x4d5deb];return _0x23a799;};'use strict';var multer=require(_0x21c7('0x0'));var util=require(_0x21c7('0x1'));var path=require(_0x21c7('0x2'));var timeout=require(_0x21c7('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x21c7('0x4'));var auth=require(_0x21c7('0x5'));var interaction=require(_0x21c7('0x6'));var config=require('../../config/environment');var controller=require(_0x21c7('0x7'));router[_0x21c7('0x8')]('/',auth[_0x21c7('0x9')](),controller[_0x21c7('0xa')]);router[_0x21c7('0x8')](_0x21c7('0xb'),auth['isAuthenticated'](),controller[_0x21c7('0xc')]);router[_0x21c7('0x8')](_0x21c7('0xd'),auth[_0x21c7('0x9')](),controller[_0x21c7('0xe')]);router[_0x21c7('0x8')](_0x21c7('0xf'),auth[_0x21c7('0x9')](),controller[_0x21c7('0x10')]);router[_0x21c7('0x8')](_0x21c7('0x11'),auth['isAuthenticated'](),controller[_0x21c7('0x12')]);router[_0x21c7('0x8')](_0x21c7('0x13'),auth[_0x21c7('0x9')](),controller[_0x21c7('0x14')]);router[_0x21c7('0x15')]('/',auth[_0x21c7('0x9')](),controller['create']);router[_0x21c7('0x15')]('/:id/teams',auth['isAuthenticated'](),controller['addTeams']);router[_0x21c7('0x15')](_0x21c7('0x13'),auth['isAuthenticated'](),controller['addAgents']);router['put']('/:id',auth[_0x21c7('0x9')](),controller['update']);router['delete'](_0x21c7('0xd'),auth[_0x21c7('0x9')](),controller[_0x21c7('0x16')]);router[_0x21c7('0x17')](_0x21c7('0x11'),auth['isAuthenticated'](),controller[_0x21c7('0x18')]);router['delete'](_0x21c7('0x13'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x21c7('0x19')]=router; \ No newline at end of file +var _0x387a=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','post','create','addTeams','/:id/users','addAgents','put','update','destroy','delete','removeTeams','removeAgents','exports','util','path','express','Router','fs-extra'];(function(_0x1d3019,_0x8dbbd5){var _0x36458e=function(_0x5d60db){while(--_0x5d60db){_0x1d3019['push'](_0x1d3019['shift']());}};_0x36458e(++_0x8dbbd5);}(_0x387a,0xd4));var _0xa387=function(_0x1880f5,_0x18418a){_0x1880f5=_0x1880f5-0x0;var _0x3f0957=_0x387a[_0x1880f5];return _0x3f0957;};'use strict';var multer=require('multer');var util=require(_0xa387('0x0'));var path=require(_0xa387('0x1'));var timeout=require('connect-timeout');var express=require(_0xa387('0x2'));var router=express[_0xa387('0x3')]();var fs_extra=require(_0xa387('0x4'));var auth=require(_0xa387('0x5'));var interaction=require(_0xa387('0x6'));var config=require(_0xa387('0x7'));var controller=require('./openchannelQueue.controller');router[_0xa387('0x8')]('/',auth[_0xa387('0x9')](),controller[_0xa387('0xa')]);router['get'](_0xa387('0xb'),auth[_0xa387('0x9')](),controller[_0xa387('0xc')]);router['get'](_0xa387('0xd'),auth[_0xa387('0x9')](),controller[_0xa387('0xe')]);router[_0xa387('0x8')](_0xa387('0xf'),auth[_0xa387('0x9')](),controller[_0xa387('0x10')]);router['get'](_0xa387('0x11'),auth['isAuthenticated'](),controller[_0xa387('0x12')]);router[_0xa387('0x8')]('/:id/users',auth[_0xa387('0x9')](),controller['getAgents']);router[_0xa387('0x13')]('/',auth[_0xa387('0x9')](),controller[_0xa387('0x14')]);router[_0xa387('0x13')](_0xa387('0x11'),auth[_0xa387('0x9')](),controller[_0xa387('0x15')]);router[_0xa387('0x13')](_0xa387('0x16'),auth['isAuthenticated'](),controller[_0xa387('0x17')]);router[_0xa387('0x18')](_0xa387('0xd'),auth[_0xa387('0x9')](),controller[_0xa387('0x19')]);router['delete'](_0xa387('0xd'),auth[_0xa387('0x9')](),controller[_0xa387('0x1a')]);router[_0xa387('0x1b')](_0xa387('0x11'),auth[_0xa387('0x9')](),controller[_0xa387('0x1c')]);router[_0xa387('0x1b')](_0xa387('0x16'),auth[_0xa387('0x9')](),controller[_0xa387('0x1d')]);module[_0xa387('0x1e')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 2ac552b..10755e2 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 _0x192b=['exports','name','STRING','INTEGER','rrmemory','beepall','roundrobin','sequelize'];(function(_0x20af3d,_0x17bfbf){var _0x2f50dc=function(_0x4c1c51){while(--_0x4c1c51){_0x20af3d['push'](_0x20af3d['shift']());}};_0x2f50dc(++_0x17bfbf);}(_0x192b,0x1af));var _0xb192=function(_0x4748d1,_0x49d5dd){_0x4748d1=_0x4748d1-0x0;var _0x5082db=_0x192b[_0x4748d1];return _0x5082db;};'use strict';var Sequelize=require(_0xb192('0x0'));module[_0xb192('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xb192('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb192('0x3')]},'timeout':{'type':Sequelize[_0xb192('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xb192('0x5'),_0xb192('0x6'),_0xb192('0x7'))}}; \ No newline at end of file +var _0x502b=['roundrobin','sequelize','exports','STRING','name','ENUM','rrmemory','beepall'];(function(_0x38ac39,_0x44d712){var _0x24097c=function(_0x2132d1){while(--_0x2132d1){_0x38ac39['push'](_0x38ac39['shift']());}};_0x24097c(++_0x44d712);}(_0x502b,0x99));var _0xb502=function(_0x23e33d,_0x31c8c8){_0x23e33d=_0x23e33d-0x0;var _0x818fc=_0x502b[_0x23e33d];return _0x818fc;};'use strict';var Sequelize=require(_0xb502('0x0'));module[_0xb502('0x1')]={'name':{'type':Sequelize[_0xb502('0x2')],'unique':_0xb502('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb502('0x4')](_0xb502('0x5'),_0xb502('0x6'),_0xb502('0x7'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 5d85019..22e35f4 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 _0x37c0=['create','body','user','role','UserProfileSection','userProfileId','UserProfileResource','error','describe','findOne','UserOpenchannelQueue','User','findAndCountAll','agent','openchannelPause','format','SIP','createdAt','updatedAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','field','tq.TeamId','from','join','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','compact','value','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','spread','isArray','getAgents','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','get','OpenchannelQueues','destroy','stack','name','send','index','map','OpenchannelQueue','rawAttributes','fieldName','type','key','model','query','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','intersection','find'];(function(_0x3aa1c4,_0x54d24e){var _0x3f68f5=function(_0x44b3c0){while(--_0x44b3c0){_0x3aa1c4['push'](_0x3aa1c4['shift']());}};_0x3f68f5(++_0x54d24e);}(_0x37c0,0x1d2));var _0x037c=function(_0x233494,_0x107ea8){_0x233494=_0x233494-0x0;var _0x2e54f4=_0x37c0[_0x233494];return _0x2e54f4;};'use strict';var emlformat=require(_0x037c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x037c('0x1'));var jsonpatch=require(_0x037c('0x2'));var rp=require('request-promise');var moment=require(_0x037c('0x3'));var BPromise=require(_0x037c('0x4'));var Mustache=require(_0x037c('0x5'));var util=require(_0x037c('0x6'));var path=require(_0x037c('0x7'));var sox=require('sox');var csv=require(_0x037c('0x8'));var ejs=require(_0x037c('0x9'));var fs=require('fs');var fs_extra=require(_0x037c('0xa'));var _=require(_0x037c('0xb'));var squel=require(_0x037c('0xc'));var crypto=require('crypto');var jsforce=require(_0x037c('0xd'));var deskjs=require(_0x037c('0xe'));var toCsv=require(_0x037c('0x8'));var querystring=require('querystring');var Papa=require(_0x037c('0xf'));var Redis=require(_0x037c('0x10'));var authService=require(_0x037c('0x11'));var qs=require(_0x037c('0x12'));var as=require(_0x037c('0x13'));var hardwareService=require(_0x037c('0x14'));var logger=require(_0x037c('0x15'))(_0x037c('0x16'));var utils=require('../../config/utils');var config=require(_0x037c('0x17'));var licenseUtil=require(_0x037c('0x18'));var db=require('../../mysqldb')['db'];config[_0x037c('0x19')]=_[_0x037c('0x1a')](config[_0x037c('0x19')],{'host':_0x037c('0x1b'),'port':0x18eb});var socket=require(_0x037c('0x1c'))(new Redis(config[_0x037c('0x19')]));require('./openchannelQueue.socket')[_0x037c('0x1d')](socket);function respondWithStatusCode(_0x42b58c,_0x23da04){_0x23da04=_0x23da04||0xcc;return function(_0x51c9d9){if(_0x51c9d9){return _0x42b58c[_0x037c('0x1e')](_0x23da04);}return _0x42b58c[_0x037c('0x1f')](_0x23da04)['end']();};}function respondWithResult(_0x472766,_0x56f576){_0x56f576=_0x56f576||0xc8;return function(_0x352ce0){if(_0x352ce0){return _0x472766[_0x037c('0x1f')](_0x56f576)[_0x037c('0x20')](_0x352ce0);}};}function respondWithFilteredResult(_0x378a90,_0x55db00){return function(_0xa9fd6f){if(_0xa9fd6f){var _0xf30d6e=typeof _0x55db00['offset']===_0x037c('0x21')&&typeof _0x55db00[_0x037c('0x22')]===_0x037c('0x21');var _0x3dd3fa=_0xa9fd6f[_0x037c('0x23')];var _0x4ebadd=_0xf30d6e?0x0:_0x55db00['offset'];var _0xfc2bbe=_0xf30d6e?_0xa9fd6f[_0x037c('0x23')]:_0x55db00[_0x037c('0x24')]+_0x55db00[_0x037c('0x22')];var _0x5e354a;if(_0xfc2bbe>=_0x3dd3fa){_0xfc2bbe=_0x3dd3fa;_0x5e354a=0xc8;}else{_0x5e354a=0xce;}_0x378a90[_0x037c('0x1f')](_0x5e354a);return _0x378a90['set'](_0x037c('0x25'),_0x4ebadd+'-'+_0xfc2bbe+'/'+_0x3dd3fa)[_0x037c('0x20')](_0xa9fd6f);}return null;};}function patchUpdates(_0x671cd9){return function(_0x17f820){try{jsonpatch[_0x037c('0x26')](_0x17f820,_0x671cd9,!![]);}catch(_0x37e22c){return BPromise[_0x037c('0x27')](_0x37e22c);}return _0x17f820[_0x037c('0x28')]();};}function saveUpdates(_0x5c322d,_0x1b4860){return function(_0x397e92){if(_0x397e92){return _0x397e92[_0x037c('0x29')](_0x5c322d)[_0x037c('0x2a')](function(_0x53ecee){return _0x53ecee;});}return null;};}function removeEntity(_0x958f08,_0x45eda2){return function(_0x1963b1){if(_0x1963b1){return _0x1963b1['destroy']()['then'](function(){var _0x2bfee1=_0x1963b1[_0x037c('0x2b')]({'plain':!![]});var _0xe3fe62=_0x037c('0x2c');return db['UserProfileResource'][_0x037c('0x2d')]({'where':{'type':_0xe3fe62,'resourceId':_0x2bfee1['id']}})[_0x037c('0x2a')](function(){return _0x1963b1;});})[_0x037c('0x2a')](function(){_0x958f08['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a8ab6,_0x19b67a){return function(_0x1f6323){if(!_0x1f6323){_0x4a8ab6[_0x037c('0x1e')](0x194);}return _0x1f6323;};}function handleError(_0x1e3787,_0x1fe20b){_0x1fe20b=_0x1fe20b||0x1f4;return function(_0x144aea){logger['error'](_0x144aea[_0x037c('0x2e')]);if(_0x144aea[_0x037c('0x2f')]){delete _0x144aea[_0x037c('0x2f')];}_0x1e3787['status'](_0x1fe20b)[_0x037c('0x30')](_0x144aea);};}exports[_0x037c('0x31')]=function(_0xe2816d,_0xcd09d6){var _0x3952d9={},_0x453651={},_0x4757f6={'count':0x0,'rows':[]};var _0x3413c3=_[_0x037c('0x32')](db[_0x037c('0x33')][_0x037c('0x34')],function(_0x471b18){return{'name':_0x471b18[_0x037c('0x35')],'type':_0x471b18[_0x037c('0x36')][_0x037c('0x37')]};});_0x453651[_0x037c('0x38')]=_[_0x037c('0x32')](_0x3413c3,_0x037c('0x2f'));_0x453651[_0x037c('0x39')]=_['keys'](_0xe2816d[_0x037c('0x39')]);_0x453651[_0x037c('0x3a')]=_['intersection'](_0x453651[_0x037c('0x38')],_0x453651[_0x037c('0x39')]);_0x3952d9['attributes']=_['intersection'](_0x453651[_0x037c('0x38')],qs[_0x037c('0x3b')](_0xe2816d[_0x037c('0x39')]['fields']));_0x3952d9['attributes']=_0x3952d9[_0x037c('0x3c')][_0x037c('0x3d')]?_0x3952d9[_0x037c('0x3c')]:_0x453651[_0x037c('0x38')];if(!_0xe2816d[_0x037c('0x39')][_0x037c('0x3e')](_0x037c('0x3f'))){_0x3952d9[_0x037c('0x22')]=qs[_0x037c('0x22')](_0xe2816d[_0x037c('0x39')][_0x037c('0x22')]);_0x3952d9[_0x037c('0x24')]=qs[_0x037c('0x24')](_0xe2816d[_0x037c('0x39')]['offset']);}_0x3952d9[_0x037c('0x40')]=qs[_0x037c('0x41')](_0xe2816d['query'][_0x037c('0x41')]);_0x3952d9[_0x037c('0x42')]=qs[_0x037c('0x3a')](_[_0x037c('0x43')](_0xe2816d[_0x037c('0x39')],_0x453651[_0x037c('0x3a')]),_0x3413c3);if(_0xe2816d['query']['filter']){_0x3952d9[_0x037c('0x42')]=_[_0x037c('0x44')](_0x3952d9[_0x037c('0x42')],{'$or':_[_0x037c('0x32')](_0x3413c3,function(_0x286a0d){if(_0x286a0d[_0x037c('0x36')]!==_0x037c('0x45')){var _0x4459a5={};_0x4459a5[_0x286a0d[_0x037c('0x2f')]]={'$like':'%'+_0xe2816d['query'][_0x037c('0x46')]+'%'};return _0x4459a5;}})});}_0x3952d9=_[_0x037c('0x44')]({},_0x3952d9,_0xe2816d[_0x037c('0x47')]);var _0x16d732={'where':_0x3952d9[_0x037c('0x42')]};return db['OpenchannelQueue'][_0x037c('0x23')](_0x16d732)[_0x037c('0x2a')](function(_0x30679a){_0x4757f6[_0x037c('0x23')]=_0x30679a;if(_0xe2816d[_0x037c('0x39')][_0x037c('0x48')]){_0x3952d9[_0x037c('0x49')]=[{'all':!![]}];}return db[_0x037c('0x33')][_0x037c('0x4a')](_0x3952d9);})[_0x037c('0x2a')](function(_0x3aa313){_0x4757f6[_0x037c('0x4b')]=_0x3aa313;return _0x4757f6;})[_0x037c('0x2a')](respondWithFilteredResult(_0xcd09d6,_0x3952d9))[_0x037c('0x4c')](handleError(_0xcd09d6,null));};exports[_0x037c('0x4d')]=function(_0x22a3a1,_0x368406){var _0x5d9217={'raw':!![],'where':{'id':_0x22a3a1[_0x037c('0x4e')]['id']}},_0xc9a5b2={};_0xc9a5b2['model']=_[_0x037c('0x4f')](db[_0x037c('0x33')]['rawAttributes']);_0xc9a5b2[_0x037c('0x39')]=_[_0x037c('0x4f')](_0x22a3a1[_0x037c('0x39')]);_0xc9a5b2[_0x037c('0x3a')]=_[_0x037c('0x50')](_0xc9a5b2[_0x037c('0x38')],_0xc9a5b2[_0x037c('0x39')]);_0x5d9217['attributes']=_['intersection'](_0xc9a5b2['model'],qs[_0x037c('0x3b')](_0x22a3a1[_0x037c('0x39')][_0x037c('0x3b')]));_0x5d9217['attributes']=_0x5d9217[_0x037c('0x3c')][_0x037c('0x3d')]?_0x5d9217['attributes']:_0xc9a5b2['model'];if(_0x22a3a1[_0x037c('0x39')][_0x037c('0x48')]){_0x5d9217[_0x037c('0x49')]=[{'all':!![]}];}_0x5d9217=_[_0x037c('0x44')]({},_0x5d9217,_0x22a3a1['options']);return db[_0x037c('0x33')][_0x037c('0x51')](_0x5d9217)[_0x037c('0x2a')](handleEntityNotFound(_0x368406,null))[_0x037c('0x2a')](respondWithResult(_0x368406,null))['catch'](handleError(_0x368406,null));};exports[_0x037c('0x52')]=function(_0x124da7,_0x529f00){return db[_0x037c('0x33')][_0x037c('0x52')](_0x124da7[_0x037c('0x53')],{})[_0x037c('0x2a')](function(_0x73866c){var _0x2b8cc1=_0x124da7[_0x037c('0x54')]['get']({'plain':!![]});if(!_0x2b8cc1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b8cc1[_0x037c('0x55')]===_0x037c('0x54')){var _0x2ee284=_0x73866c[_0x037c('0x2b')]({'plain':!![]});var _0x27eca9='OpenchannelQueues';return db[_0x037c('0x56')][_0x037c('0x51')]({'where':{'name':_0x27eca9,'userProfileId':_0x2b8cc1[_0x037c('0x57')]},'raw':!![]})[_0x037c('0x2a')](function(_0x3a6f28){if(_0x3a6f28&&_0x3a6f28['autoAssociation']===0x0){return db[_0x037c('0x58')][_0x037c('0x52')]({'name':_0x2ee284[_0x037c('0x2f')],'resourceId':_0x2ee284['id'],'type':_0x3a6f28[_0x037c('0x2f')],'sectionId':_0x3a6f28['id']},{})[_0x037c('0x2a')](function(){return _0x73866c;});}else{return _0x73866c;}})['catch'](function(_0x87a4c3){logger[_0x037c('0x59')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x87a4c3);throw _0x87a4c3;});}return _0x73866c;})[_0x037c('0x2a')](respondWithResult(_0x529f00,0xc9))[_0x037c('0x4c')](handleError(_0x529f00,null));};exports[_0x037c('0x29')]=function(_0x4ecf9d,_0xc92fd6){if(_0x4ecf9d[_0x037c('0x53')]['id']){delete _0x4ecf9d['body']['id'];}return db['OpenchannelQueue'][_0x037c('0x51')]({'where':{'id':_0x4ecf9d[_0x037c('0x4e')]['id']}})[_0x037c('0x2a')](handleEntityNotFound(_0xc92fd6,null))['then'](saveUpdates(_0x4ecf9d[_0x037c('0x53')],null))[_0x037c('0x2a')](respondWithResult(_0xc92fd6,null))[_0x037c('0x4c')](handleError(_0xc92fd6,null));};exports[_0x037c('0x2d')]=function(_0x5a26ea,_0x3354be){return db[_0x037c('0x33')]['find']({'where':{'id':_0x5a26ea[_0x037c('0x4e')]['id']}})[_0x037c('0x2a')](handleEntityNotFound(_0x3354be,null))[_0x037c('0x2a')](removeEntity(_0x3354be,null))[_0x037c('0x4c')](handleError(_0x3354be,null));};exports[_0x037c('0x5a')]=function(_0x5e1581,_0x902c9){return db[_0x037c('0x33')][_0x037c('0x5a')]()[_0x037c('0x2a')](respondWithResult(_0x902c9,null))['catch'](handleError(_0x902c9,null));};exports['getMembers']=function(_0x2bbcfe,_0x36543f,_0x496bdb){var _0x2743be={'raw':!![],'where':{}},_0x2af8ca={},_0x68e213;return db['OpenchannelQueue'][_0x037c('0x5b')]({'where':{'id':_0x2bbcfe[_0x037c('0x4e')]['id']}})['then'](handleEntityNotFound(_0x36543f,null))[_0x037c('0x2a')](function(_0x2c00a1){if(_0x2c00a1){_0x68e213=_0x2c00a1['get']({'plain':!![]});_0x2af8ca[_0x037c('0x38')]=_[_0x037c('0x4f')](db[_0x037c('0x5c')]['rawAttributes']);_0x2af8ca[_0x037c('0x39')]=_[_0x037c('0x4f')](_0x2bbcfe[_0x037c('0x39')]);_0x2af8ca[_0x037c('0x3a')]=_['intersection'](_0x2af8ca['model'],_0x2af8ca[_0x037c('0x39')]);_0x2743be['attributes']=_['intersection'](_0x2af8ca[_0x037c('0x38')],qs[_0x037c('0x3b')](_0x2bbcfe['query'][_0x037c('0x3b')]));_0x2743be[_0x037c('0x3c')]=_0x2743be[_0x037c('0x3c')][_0x037c('0x3d')]?_0x2743be[_0x037c('0x3c')]:_0x2af8ca['model'];if(!_0x2bbcfe[_0x037c('0x39')][_0x037c('0x3e')](_0x037c('0x3f'))){_0x2743be[_0x037c('0x22')]=qs['limit'](_0x2bbcfe[_0x037c('0x39')][_0x037c('0x22')]);_0x2743be[_0x037c('0x24')]=qs[_0x037c('0x24')](_0x2bbcfe[_0x037c('0x39')][_0x037c('0x24')]);}_0x2743be[_0x037c('0x40')]=qs[_0x037c('0x41')](_0x2bbcfe[_0x037c('0x39')][_0x037c('0x41')]);_0x2743be[_0x037c('0x42')]=qs[_0x037c('0x3a')](_[_0x037c('0x43')](_0x2bbcfe[_0x037c('0x39')],_0x2af8ca[_0x037c('0x3a')]));_0x2743be[_0x037c('0x42')]['OpenchannelQueueId']=_0x2c00a1['id'];if(_0x2bbcfe['query']['filter']){_0x2743be[_0x037c('0x42')]=_[_0x037c('0x44')](_0x2743be[_0x037c('0x42')],{'$or':_[_0x037c('0x32')](_0x2743be[_0x037c('0x3c')],function(_0x41f7b2){var _0x269a72={};_0x269a72[_0x41f7b2]={'$like':'%'+_0x2bbcfe['query']['filter']+'%'};return _0x269a72;})});}_0x2743be=_[_0x037c('0x44')]({},_0x2743be,_0x2bbcfe[_0x037c('0x47')]);return db[_0x037c('0x5c')]['findAll'](_0x2743be);}})[_0x037c('0x2a')](function(_0xbffecc){if(_0xbffecc){return db[_0x037c('0x5d')][_0x037c('0x5e')]({'where':{'id':_[_0x037c('0x32')](_0xbffecc,'UserId'),'role':_0x037c('0x5f')},'attributes':['id','name',_0x037c('0x60'),'updatedAt','createdAt']});}})[_0x037c('0x2a')](function(_0x3875fd){if(_0x3875fd){return{'count':_0x3875fd[_0x037c('0x23')],'rows':_[_0x037c('0x32')](_0x3875fd[_0x037c('0x4b')],function(_0x443ef9){return{'membername':_0x443ef9[_0x037c('0x2f')],'UserId':_0x443ef9['id'],'queue_name':_0x68e213[_0x037c('0x2f')],'OpenchannelQueueId':_0x68e213['id'],'interface':util[_0x037c('0x61')]('%s/%s',_0x037c('0x62'),_0x443ef9[_0x037c('0x2f')]),'penalty':0x0,'paused':_0x443ef9[_0x037c('0x60')],'createdAt':_0x443ef9[_0x037c('0x63')],'updatedAt':_0x443ef9[_0x037c('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x037c('0x2a')](respondWithFilteredResult(_0x36543f,_0x2743be))[_0x037c('0x4c')](handleError(_0x36543f,null));};exports[_0x037c('0x65')]=function(_0x45eeaf,_0x23ae38,_0x3f439b){var _0x51a554={};var _0x6e4fbe={};var _0x4f7d4e;var _0x212782;return db[_0x037c('0x33')][_0x037c('0x5b')]({'where':{'id':_0x45eeaf['params']['id']}})['then'](handleEntityNotFound(_0x23ae38,null))[_0x037c('0x2a')](function(_0x361b28){if(_0x361b28){_0x4f7d4e=_0x361b28;_0x6e4fbe['model']=_['keys'](db[_0x037c('0x66')]['rawAttributes']);_0x6e4fbe[_0x037c('0x39')]=_['keys'](_0x45eeaf[_0x037c('0x39')]);_0x6e4fbe[_0x037c('0x3a')]=_['intersection'](_0x6e4fbe['model'],_0x6e4fbe[_0x037c('0x39')]);_0x51a554[_0x037c('0x3c')]=_[_0x037c('0x50')](_0x6e4fbe[_0x037c('0x38')],qs[_0x037c('0x3b')](_0x45eeaf[_0x037c('0x39')][_0x037c('0x3b')]));_0x51a554[_0x037c('0x3c')]=_0x51a554[_0x037c('0x3c')][_0x037c('0x3d')]?_0x51a554[_0x037c('0x3c')]:_0x6e4fbe['model'];_0x51a554[_0x037c('0x40')]=qs['sort'](_0x45eeaf[_0x037c('0x39')][_0x037c('0x41')]);_0x51a554['where']=qs[_0x037c('0x3a')](_[_0x037c('0x43')](_0x45eeaf[_0x037c('0x39')],_0x6e4fbe[_0x037c('0x3a')]));if(_0x45eeaf[_0x037c('0x39')]['filter']){_0x51a554[_0x037c('0x42')]=_[_0x037c('0x44')](_0x51a554[_0x037c('0x42')],{'$or':_['map'](_0x51a554[_0x037c('0x3c')],function(_0x5ce4ed){var _0x3f4db2={};_0x3f4db2[_0x5ce4ed]={'$like':'%'+_0x45eeaf[_0x037c('0x39')][_0x037c('0x46')]+'%'};return _0x3f4db2;})});}_0x51a554=_[_0x037c('0x44')]({},_0x51a554,_0x45eeaf[_0x037c('0x47')]);return _0x4f7d4e['getTeams'](_0x51a554);}})[_0x037c('0x2a')](function(_0x1bdfd6){if(_0x1bdfd6){_0x212782=_0x1bdfd6[_0x037c('0x3d')];if(!_0x45eeaf['query'][_0x037c('0x3e')](_0x037c('0x3f'))){_0x51a554[_0x037c('0x22')]=qs['limit'](_0x45eeaf[_0x037c('0x39')][_0x037c('0x22')]);_0x51a554[_0x037c('0x24')]=qs[_0x037c('0x24')](_0x45eeaf[_0x037c('0x39')]['offset']);}return _0x4f7d4e['getTeams'](_0x51a554);}})['then'](function(_0x31a5d1){if(_0x31a5d1){return _0x31a5d1?{'count':_0x212782,'rows':_0x31a5d1}:null;}})['then'](respondWithResult(_0x23ae38,null))[_0x037c('0x4c')](handleError(_0x23ae38,null));};exports[_0x037c('0x67')]=function(_0x20fe05,_0x522f9b,_0x2fb467){var _0x2e827f=_0x20fe05[_0x037c('0x53')][_0x037c('0x68')];return db[_0x037c('0x66')][_0x037c('0x4a')]({'where':{'id':_0x2e827f},'attributes':['id'],'include':[{'model':db[_0x037c('0x5d')],'as':_0x037c('0x69'),'attributes':['id',_0x037c('0x2f'),_0x037c('0x6a'),_0x037c('0x6b'),_0x037c('0x6c')],'raw':!![]}]})[_0x037c('0x2a')](function(_0x2fe898){if(_0x2fe898){var _0x5e50ca=_['flatMap'](_0x2fe898,function(_0x285b45){var _0x745074=_0x285b45[_0x037c('0x2b')]({'plain':!![]});return _0x745074['Agents'];});return db[_0x037c('0x33')][_0x037c('0x51')]({'where':{'id':_0x20fe05[_0x037c('0x4e')]['id']}})['then'](function(_0x28bf48){return db[_0x037c('0x6d')][_0x037c('0x6e')](function(_0x37a668){return _0x28bf48[_0x037c('0x67')](_0x2e827f,{'transaction':_0x37a668})[_0x037c('0x2a')](function(){return BPromise[_0x037c('0x6f')](_0x5e50ca,function(_0xbb6793){return db[_0x037c('0x5c')][_0x037c('0x70')]({'where':{'UserId':_0xbb6793['id'],'OpenchannelQueueId':_0x20fe05[_0x037c('0x4e')]['id']},'transaction':_0x37a668});});})['then'](function(){_0x5e50ca[_0x037c('0x71')](function(_0x557205){socket[_0x037c('0x72')](_0x037c('0x73'),{'UserId':_0x557205['id'],'OpenchannelQueueId':_0x28bf48['id']});});});});});}})[_0x037c('0x2a')](respondWithStatusCode(_0x522f9b,null))['catch'](handleError(_0x522f9b,null));};exports[_0x037c('0x74')]=function(_0x1dd086,_0x7bdbc6,_0x5ae690){return db[_0x037c('0x66')][_0x037c('0x4a')]({'where':{'id':_0x1dd086['query'][_0x037c('0x68')]},'attributes':['id'],'include':[{'model':db[_0x037c('0x5d')],'as':_0x037c('0x69'),'attributes':['id'],'raw':!![]}]})[_0x037c('0x2a')](handleEntityNotFound(_0x7bdbc6,null))[_0x037c('0x2a')](function(_0x1901ab){var _0x1147c8=_['map'](_0x1901ab,'id');var _0x394e1a=[];var _0x43e8b2=[];var _0x5c601b=squel['select']();_0x5c601b[_0x037c('0x75')](_0x037c('0x76'))[_0x037c('0x77')]('team_has_openchannel_queues','tq')[_0x037c('0x78')]('user_has_teams','ut',_0x037c('0x79'))[_0x037c('0x42')](_0x037c('0x7a'),_0x1dd086[_0x037c('0x4e')]['id']);for(var _0x5ea3d1=0x0;_0x5ea3d1<_0x1901ab[_0x037c('0x3d')];_0x5ea3d1+=0x1){let _0x4d8471=_0x1901ab[_0x5ea3d1];for(var _0x2534ed=0x0;_0x2534ed<_0x4d8471[_0x037c('0x69')][_0x037c('0x3d')];_0x2534ed+=0x1){let _0x4f6d8b=_0x4d8471[_0x037c('0x69')][_0x2534ed];var _0x27c30f=_0x5c601b[_0x037c('0x7b')]();_0x27c30f['where']('ut.UserId\x20=\x20?',_0x4f6d8b['id']);_0x43e8b2[_0x037c('0x7c')](db[_0x037c('0x6d')]['query'](_0x27c30f[_0x037c('0x7d')](),{'type':db['sequelize'][_0x037c('0x7e')][_0x037c('0x7f')]})[_0x037c('0x2a')](function(_0x45397e){if(_0x45397e[_0x037c('0x3d')]===0x1){return _0x4f6d8b['id'];}else{var _0x379f83=_['every'](_[_0x037c('0x32')](_0x45397e,'TeamId'),function(_0x5a4c6a){return _['includes'](_0x1147c8,_0x5a4c6a);});if(_0x379f83){return _0x4f6d8b['id'];}}}));}}return BPromise['all'](_0x43e8b2)[_0x037c('0x2a')](function(_0x497772){_0x394e1a=_(_0x394e1a)['union'](_0x497772)[_0x037c('0x80')]()[_0x037c('0x81')]();return db['OpenchannelQueue'][_0x037c('0x51')]({'where':{'id':_0x1dd086[_0x037c('0x4e')]['id']}})['then'](function(_0x1b3a56){return db['sequelize'][_0x037c('0x6e')](function(_0x37efa8){return _0x1b3a56[_0x037c('0x74')](_0x1dd086['query'][_0x037c('0x68')],{'transaction':_0x37efa8})[_0x037c('0x2a')](function(){if(!_[_0x037c('0x82')](_0x394e1a)){return _0x1b3a56[_0x037c('0x83')](_0x394e1a,{'transaction':_0x37efa8});}})[_0x037c('0x2a')](function(){_0x394e1a['forEach'](function(_0x42d017){socket[_0x037c('0x72')](_0x037c('0x84'),{'UserId':_0x42d017,'OpenchannelQueueId':_0x1b3a56['id']});});});});});});})[_0x037c('0x2a')](respondWithStatusCode(_0x7bdbc6,null))[_0x037c('0x4c')](handleError(_0x7bdbc6,null));};exports[_0x037c('0x85')]=function(_0x73af64,_0x5c9f9e,_0x4cae33){return db[_0x037c('0x33')][_0x037c('0x51')]({'where':{'id':_0x73af64[_0x037c('0x4e')]['id']}})[_0x037c('0x2a')](handleEntityNotFound(_0x5c9f9e,null))[_0x037c('0x2a')](function(_0x5a3490){if(_0x5a3490){return _0x5a3490[_0x037c('0x85')](_0x73af64['body'][_0x037c('0x68')],_['omit'](_0x73af64['body'],[_0x037c('0x68'),'id'])||{})[_0x037c('0x86')](function(_0x15df66){for(var _0x334592=0x0;_0x334592<_0x73af64[_0x037c('0x53')][_0x037c('0x68')][_0x037c('0x3d')];_0x334592+=0x1){socket[_0x037c('0x72')](_0x037c('0x73'),{'UserId':Number(_0x73af64[_0x037c('0x53')][_0x037c('0x68')][_0x334592]),'OpenchannelQueueId':Number(_0x73af64[_0x037c('0x4e')]['id'])});}return _0x15df66;});}})[_0x037c('0x2a')](respondWithResult(_0x5c9f9e,null))[_0x037c('0x4c')](handleError(_0x5c9f9e,null));};exports[_0x037c('0x83')]=function(_0xf8b0fa,_0xc02f1e,_0x5c1b2d){return db[_0x037c('0x33')][_0x037c('0x51')]({'where':{'id':_0xf8b0fa[_0x037c('0x4e')]['id']}})['then'](handleEntityNotFound(_0xc02f1e,null))['then'](function(_0x5476b9){if(_0x5476b9){return _0x5476b9[_0x037c('0x83')](_0xf8b0fa['query'][_0x037c('0x68')])[_0x037c('0x2a')](function(){if(_[_0x037c('0x87')](_0xf8b0fa[_0x037c('0x39')][_0x037c('0x68')])){for(var _0x10371e=0x0;_0x10371e<_0xf8b0fa[_0x037c('0x39')]['ids'][_0x037c('0x3d')];_0x10371e+=0x1){socket['emit']('userOpenchannelQueue:remove',{'UserId':Number(_0xf8b0fa['query'][_0x037c('0x68')][_0x10371e]),'OpenchannelQueueId':Number(_0xf8b0fa[_0x037c('0x4e')]['id'])});}}else{socket[_0x037c('0x72')]('userOpenchannelQueue:remove',{'UserId':Number(_0xf8b0fa[_0x037c('0x39')][_0x037c('0x68')]),'OpenchannelQueueId':Number(_0xf8b0fa['params']['id'])});}});}})[_0x037c('0x2a')](respondWithStatusCode(_0xc02f1e,null))[_0x037c('0x4c')](handleError(_0xc02f1e,null));};exports[_0x037c('0x88')]=function(_0x17a930,_0x2046a8,_0x1c751d){var _0x143840={};var _0x29a842={};var _0x267d58;var _0x3b37ff;return db[_0x037c('0x33')][_0x037c('0x5b')]({'where':{'id':_0x17a930['params']['id']}})[_0x037c('0x2a')](handleEntityNotFound(_0x2046a8,null))[_0x037c('0x2a')](function(_0x141116){if(_0x141116){_0x267d58=_0x141116;_0x29a842[_0x037c('0x38')]=_[_0x037c('0x4f')](db[_0x037c('0x5d')][_0x037c('0x34')]);_0x29a842['query']=_[_0x037c('0x4f')](_0x17a930['query']);_0x29a842['filters']=_[_0x037c('0x50')](_0x29a842['model'],_0x29a842[_0x037c('0x39')]);_0x143840['attributes']=_[_0x037c('0x50')](_0x29a842[_0x037c('0x38')],qs[_0x037c('0x3b')](_0x17a930[_0x037c('0x39')][_0x037c('0x3b')]));_0x143840[_0x037c('0x3c')]=_0x143840[_0x037c('0x3c')][_0x037c('0x3d')]?_0x143840[_0x037c('0x3c')]:_0x29a842[_0x037c('0x38')];_0x143840['order']=qs[_0x037c('0x41')](_0x17a930[_0x037c('0x39')][_0x037c('0x41')]);_0x143840[_0x037c('0x42')]=qs['filters'](_['pick'](_0x17a930[_0x037c('0x39')],_0x29a842[_0x037c('0x3a')]));if(_0x17a930['query'][_0x037c('0x46')]){_0x143840[_0x037c('0x42')]=_['merge'](_0x143840[_0x037c('0x42')],{'$or':_['map'](_0x143840['attributes'],function(_0x1168ed){var _0x50253b={};_0x50253b[_0x1168ed]={'$like':'%'+_0x17a930[_0x037c('0x39')][_0x037c('0x46')]+'%'};return _0x50253b;})});}_0x143840=_[_0x037c('0x44')]({},_0x143840,_0x17a930['options']);return _0x267d58[_0x037c('0x88')](_0x143840);}})[_0x037c('0x2a')](function(_0x2b5557){if(_0x2b5557){_0x3b37ff=_0x2b5557['length'];if(!_0x17a930[_0x037c('0x39')][_0x037c('0x3e')](_0x037c('0x3f'))){_0x143840[_0x037c('0x22')]=qs[_0x037c('0x22')](_0x17a930[_0x037c('0x39')][_0x037c('0x22')]);_0x143840[_0x037c('0x24')]=qs[_0x037c('0x24')](_0x17a930[_0x037c('0x39')][_0x037c('0x24')]);}return _0x267d58[_0x037c('0x88')](_0x143840);}})[_0x037c('0x2a')](function(_0x583b94){if(_0x583b94){return _0x583b94?{'count':_0x3b37ff,'rows':_0x583b94}:null;}})['then'](respondWithResult(_0x2046a8,null))[_0x037c('0x4c')](handleError(_0x2046a8,null));}; \ No newline at end of file +var _0x6c10=['model','attributes','intersection','fields','length','nolimit','where','pick','filter','merge','VIRTUAL','options','includeAll','include','OpenchannelQueue','findAll','rows','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','params','hasOwnProperty','order','sort','OpenchannelQueueId','UserOpenchannelQueue','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','format','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','select','field','tq.TeamId','from','team_has_openchannel_queues','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','push','TeamId','includes','all','compact','value','isEmpty','removeAgents','addAgents','omit','isArray','userOpenchannelQueue:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','get','OpenchannelQueues','UserProfileResource','error','stack','name','index','rawAttributes','fieldName','type','key','map','query','keys','filters'];(function(_0x8abd64,_0x539570){var _0xd2511e=function(_0x9fef7d){while(--_0x9fef7d){_0x8abd64['push'](_0x8abd64['shift']());}};_0xd2511e(++_0x539570);}(_0x6c10,0x1ef));var _0x06c1=function(_0x1aab74,_0x38a57b){_0x1aab74=_0x1aab74-0x0;var _0x396af2=_0x6c10[_0x1aab74];return _0x396af2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x06c1('0x0'));var zipdir=require(_0x06c1('0x1'));var jsonpatch=require(_0x06c1('0x2'));var rp=require(_0x06c1('0x3'));var moment=require(_0x06c1('0x4'));var BPromise=require(_0x06c1('0x5'));var Mustache=require('mustache');var util=require(_0x06c1('0x6'));var path=require(_0x06c1('0x7'));var sox=require(_0x06c1('0x8'));var csv=require(_0x06c1('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x06c1('0xa'));var _=require(_0x06c1('0xb'));var squel=require(_0x06c1('0xc'));var crypto=require(_0x06c1('0xd'));var jsforce=require(_0x06c1('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x06c1('0x9'));var querystring=require(_0x06c1('0xf'));var Papa=require('papaparse');var Redis=require(_0x06c1('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x06c1('0x11'));var hardwareService=require(_0x06c1('0x12'));var logger=require('../../config/logger')(_0x06c1('0x13'));var utils=require(_0x06c1('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x06c1('0x15'));var db=require(_0x06c1('0x16'))['db'];config[_0x06c1('0x17')]=_['defaults'](config[_0x06c1('0x17')],{'host':_0x06c1('0x18'),'port':0x18eb});var socket=require(_0x06c1('0x19'))(new Redis(config[_0x06c1('0x17')]));require(_0x06c1('0x1a'))[_0x06c1('0x1b')](socket);function respondWithStatusCode(_0x46666b,_0x562c27){_0x562c27=_0x562c27||0xcc;return function(_0x261d58){if(_0x261d58){return _0x46666b[_0x06c1('0x1c')](_0x562c27);}return _0x46666b[_0x06c1('0x1d')](_0x562c27)['end']();};}function respondWithResult(_0x5e05d0,_0x40580e){_0x40580e=_0x40580e||0xc8;return function(_0x264bd5){if(_0x264bd5){return _0x5e05d0['status'](_0x40580e)[_0x06c1('0x1e')](_0x264bd5);}};}function respondWithFilteredResult(_0x40ccbe,_0x374951){return function(_0x37b3bf){if(_0x37b3bf){var _0x226b95=typeof _0x374951[_0x06c1('0x1f')]===_0x06c1('0x20')&&typeof _0x374951['limit']==='undefined';var _0x2e9399=_0x37b3bf[_0x06c1('0x21')];var _0xb19c8e=_0x226b95?0x0:_0x374951[_0x06c1('0x1f')];var _0x27723b=_0x226b95?_0x37b3bf[_0x06c1('0x21')]:_0x374951['offset']+_0x374951[_0x06c1('0x22')];var _0x4f60dd;if(_0x27723b>=_0x2e9399){_0x27723b=_0x2e9399;_0x4f60dd=0xc8;}else{_0x4f60dd=0xce;}_0x40ccbe['status'](_0x4f60dd);return _0x40ccbe[_0x06c1('0x23')](_0x06c1('0x24'),_0xb19c8e+'-'+_0x27723b+'/'+_0x2e9399)[_0x06c1('0x1e')](_0x37b3bf);}return null;};}function patchUpdates(_0x32ae9d){return function(_0x38982a){try{jsonpatch['apply'](_0x38982a,_0x32ae9d,!![]);}catch(_0x19230c){return BPromise[_0x06c1('0x25')](_0x19230c);}return _0x38982a[_0x06c1('0x26')]();};}function saveUpdates(_0x16116b,_0x448677){return function(_0x473ddf){if(_0x473ddf){return _0x473ddf[_0x06c1('0x27')](_0x16116b)[_0x06c1('0x28')](function(_0xe1a70f){return _0xe1a70f;});}return null;};}function removeEntity(_0x47dc97,_0x27f14b){return function(_0x3d0392){if(_0x3d0392){return _0x3d0392[_0x06c1('0x29')]()[_0x06c1('0x28')](function(){var _0x105a82=_0x3d0392[_0x06c1('0x2a')]({'plain':!![]});var _0x484984=_0x06c1('0x2b');return db[_0x06c1('0x2c')][_0x06c1('0x29')]({'where':{'type':_0x484984,'resourceId':_0x105a82['id']}})[_0x06c1('0x28')](function(){return _0x3d0392;});})['then'](function(){_0x47dc97['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x51f2b4,_0x16f809){return function(_0x5e41f1){if(!_0x5e41f1){_0x51f2b4[_0x06c1('0x1c')](0x194);}return _0x5e41f1;};}function handleError(_0x4103dd,_0x1c7f18){_0x1c7f18=_0x1c7f18||0x1f4;return function(_0x433554){logger[_0x06c1('0x2d')](_0x433554[_0x06c1('0x2e')]);if(_0x433554['name']){delete _0x433554[_0x06c1('0x2f')];}_0x4103dd['status'](_0x1c7f18)['send'](_0x433554);};}exports[_0x06c1('0x30')]=function(_0x10354d,_0x464fea){var _0x374308={},_0x4ab11f={},_0x133511={'count':0x0,'rows':[]};var _0x2d8ad7=_['map'](db['OpenchannelQueue'][_0x06c1('0x31')],function(_0x3aba51){return{'name':_0x3aba51[_0x06c1('0x32')],'type':_0x3aba51[_0x06c1('0x33')][_0x06c1('0x34')]};});_0x4ab11f['model']=_[_0x06c1('0x35')](_0x2d8ad7,_0x06c1('0x2f'));_0x4ab11f[_0x06c1('0x36')]=_[_0x06c1('0x37')](_0x10354d[_0x06c1('0x36')]);_0x4ab11f[_0x06c1('0x38')]=_['intersection'](_0x4ab11f[_0x06c1('0x39')],_0x4ab11f[_0x06c1('0x36')]);_0x374308[_0x06c1('0x3a')]=_[_0x06c1('0x3b')](_0x4ab11f[_0x06c1('0x39')],qs['fields'](_0x10354d[_0x06c1('0x36')][_0x06c1('0x3c')]));_0x374308['attributes']=_0x374308[_0x06c1('0x3a')][_0x06c1('0x3d')]?_0x374308[_0x06c1('0x3a')]:_0x4ab11f[_0x06c1('0x39')];if(!_0x10354d[_0x06c1('0x36')]['hasOwnProperty'](_0x06c1('0x3e'))){_0x374308['limit']=qs[_0x06c1('0x22')](_0x10354d[_0x06c1('0x36')][_0x06c1('0x22')]);_0x374308[_0x06c1('0x1f')]=qs['offset'](_0x10354d[_0x06c1('0x36')]['offset']);}_0x374308['order']=qs['sort'](_0x10354d[_0x06c1('0x36')]['sort']);_0x374308[_0x06c1('0x3f')]=qs[_0x06c1('0x38')](_[_0x06c1('0x40')](_0x10354d['query'],_0x4ab11f[_0x06c1('0x38')]),_0x2d8ad7);if(_0x10354d['query'][_0x06c1('0x41')]){_0x374308[_0x06c1('0x3f')]=_[_0x06c1('0x42')](_0x374308[_0x06c1('0x3f')],{'$or':_[_0x06c1('0x35')](_0x2d8ad7,function(_0x5c2461){if(_0x5c2461['type']!==_0x06c1('0x43')){var _0x110285={};_0x110285[_0x5c2461['name']]={'$like':'%'+_0x10354d['query']['filter']+'%'};return _0x110285;}})});}_0x374308=_[_0x06c1('0x42')]({},_0x374308,_0x10354d[_0x06c1('0x44')]);var _0x2e136a={'where':_0x374308[_0x06c1('0x3f')]};return db['OpenchannelQueue']['count'](_0x2e136a)['then'](function(_0x578643){_0x133511[_0x06c1('0x21')]=_0x578643;if(_0x10354d[_0x06c1('0x36')][_0x06c1('0x45')]){_0x374308[_0x06c1('0x46')]=[{'all':!![]}];}return db[_0x06c1('0x47')][_0x06c1('0x48')](_0x374308);})[_0x06c1('0x28')](function(_0x384f6d){_0x133511[_0x06c1('0x49')]=_0x384f6d;return _0x133511;})[_0x06c1('0x28')](respondWithFilteredResult(_0x464fea,_0x374308))['catch'](handleError(_0x464fea,null));};exports[_0x06c1('0x4a')]=function(_0x4784fe,_0x27aea3){var _0x2b6545={'raw':!![],'where':{'id':_0x4784fe['params']['id']}},_0x4cf4f0={};_0x4cf4f0[_0x06c1('0x39')]=_[_0x06c1('0x37')](db[_0x06c1('0x47')][_0x06c1('0x31')]);_0x4cf4f0['query']=_[_0x06c1('0x37')](_0x4784fe[_0x06c1('0x36')]);_0x4cf4f0[_0x06c1('0x38')]=_[_0x06c1('0x3b')](_0x4cf4f0[_0x06c1('0x39')],_0x4cf4f0[_0x06c1('0x36')]);_0x2b6545[_0x06c1('0x3a')]=_[_0x06c1('0x3b')](_0x4cf4f0[_0x06c1('0x39')],qs[_0x06c1('0x3c')](_0x4784fe['query'][_0x06c1('0x3c')]));_0x2b6545['attributes']=_0x2b6545[_0x06c1('0x3a')]['length']?_0x2b6545['attributes']:_0x4cf4f0[_0x06c1('0x39')];if(_0x4784fe['query']['includeAll']){_0x2b6545[_0x06c1('0x46')]=[{'all':!![]}];}_0x2b6545=_['merge']({},_0x2b6545,_0x4784fe['options']);return db[_0x06c1('0x47')][_0x06c1('0x4b')](_0x2b6545)['then'](handleEntityNotFound(_0x27aea3,null))[_0x06c1('0x28')](respondWithResult(_0x27aea3,null))['catch'](handleError(_0x27aea3,null));};exports['create']=function(_0xeeb2f5,_0x13355d){return db[_0x06c1('0x47')][_0x06c1('0x4c')](_0xeeb2f5[_0x06c1('0x4d')],{})[_0x06c1('0x28')](function(_0x120a3b){var _0x1b96d1=_0xeeb2f5[_0x06c1('0x4e')][_0x06c1('0x2a')]({'plain':!![]});if(!_0x1b96d1)throw new Error(_0x06c1('0x4f'));if(_0x1b96d1[_0x06c1('0x50')]===_0x06c1('0x4e')){var _0x2146c2=_0x120a3b[_0x06c1('0x2a')]({'plain':!![]});var _0x2fca11=_0x06c1('0x2b');return db[_0x06c1('0x51')]['find']({'where':{'name':_0x2fca11,'userProfileId':_0x1b96d1[_0x06c1('0x52')]},'raw':!![]})[_0x06c1('0x28')](function(_0xb93d6e){if(_0xb93d6e&&_0xb93d6e[_0x06c1('0x53')]===0x0){return db[_0x06c1('0x2c')]['create']({'name':_0x2146c2[_0x06c1('0x2f')],'resourceId':_0x2146c2['id'],'type':_0xb93d6e[_0x06c1('0x2f')],'sectionId':_0xb93d6e['id']},{})['then'](function(){return _0x120a3b;});}else{return _0x120a3b;}})[_0x06c1('0x54')](function(_0x29c9e3){logger[_0x06c1('0x2d')](_0x06c1('0x55'),_0x29c9e3);throw _0x29c9e3;});}return _0x120a3b;})['then'](respondWithResult(_0x13355d,0xc9))['catch'](handleError(_0x13355d,null));};exports[_0x06c1('0x27')]=function(_0x1e6f1a,_0x1d0722){if(_0x1e6f1a[_0x06c1('0x4d')]['id']){delete _0x1e6f1a[_0x06c1('0x4d')]['id'];}return db[_0x06c1('0x47')]['find']({'where':{'id':_0x1e6f1a['params']['id']}})[_0x06c1('0x28')](handleEntityNotFound(_0x1d0722,null))['then'](saveUpdates(_0x1e6f1a[_0x06c1('0x4d')],null))[_0x06c1('0x28')](respondWithResult(_0x1d0722,null))[_0x06c1('0x54')](handleError(_0x1d0722,null));};exports['destroy']=function(_0x5d7c5e,_0x493e0e){return db[_0x06c1('0x47')][_0x06c1('0x4b')]({'where':{'id':_0x5d7c5e['params']['id']}})[_0x06c1('0x28')](handleEntityNotFound(_0x493e0e,null))[_0x06c1('0x28')](removeEntity(_0x493e0e,null))[_0x06c1('0x54')](handleError(_0x493e0e,null));};exports[_0x06c1('0x56')]=function(_0x29d9e8,_0xc15784){return db[_0x06c1('0x47')]['describe']()[_0x06c1('0x28')](respondWithResult(_0xc15784,null))['catch'](handleError(_0xc15784,null));};exports['getMembers']=function(_0x392aba,_0x1e255f,_0x900073){var _0x41575f={'raw':!![],'where':{}},_0x28c471={},_0x26f75b;return db[_0x06c1('0x47')][_0x06c1('0x57')]({'where':{'id':_0x392aba[_0x06c1('0x58')]['id']}})[_0x06c1('0x28')](handleEntityNotFound(_0x1e255f,null))[_0x06c1('0x28')](function(_0x1bc5d8){if(_0x1bc5d8){_0x26f75b=_0x1bc5d8[_0x06c1('0x2a')]({'plain':!![]});_0x28c471[_0x06c1('0x39')]=_[_0x06c1('0x37')](db['UserOpenchannelQueue'][_0x06c1('0x31')]);_0x28c471[_0x06c1('0x36')]=_[_0x06c1('0x37')](_0x392aba[_0x06c1('0x36')]);_0x28c471[_0x06c1('0x38')]=_['intersection'](_0x28c471[_0x06c1('0x39')],_0x28c471[_0x06c1('0x36')]);_0x41575f[_0x06c1('0x3a')]=_[_0x06c1('0x3b')](_0x28c471[_0x06c1('0x39')],qs[_0x06c1('0x3c')](_0x392aba[_0x06c1('0x36')]['fields']));_0x41575f[_0x06c1('0x3a')]=_0x41575f[_0x06c1('0x3a')][_0x06c1('0x3d')]?_0x41575f[_0x06c1('0x3a')]:_0x28c471[_0x06c1('0x39')];if(!_0x392aba['query'][_0x06c1('0x59')]('nolimit')){_0x41575f[_0x06c1('0x22')]=qs[_0x06c1('0x22')](_0x392aba[_0x06c1('0x36')][_0x06c1('0x22')]);_0x41575f['offset']=qs[_0x06c1('0x1f')](_0x392aba[_0x06c1('0x36')]['offset']);}_0x41575f[_0x06c1('0x5a')]=qs[_0x06c1('0x5b')](_0x392aba[_0x06c1('0x36')]['sort']);_0x41575f[_0x06c1('0x3f')]=qs[_0x06c1('0x38')](_['pick'](_0x392aba[_0x06c1('0x36')],_0x28c471[_0x06c1('0x38')]));_0x41575f[_0x06c1('0x3f')][_0x06c1('0x5c')]=_0x1bc5d8['id'];if(_0x392aba[_0x06c1('0x36')][_0x06c1('0x41')]){_0x41575f[_0x06c1('0x3f')]=_[_0x06c1('0x42')](_0x41575f[_0x06c1('0x3f')],{'$or':_[_0x06c1('0x35')](_0x41575f[_0x06c1('0x3a')],function(_0x5d508f){var _0x31ae56={};_0x31ae56[_0x5d508f]={'$like':'%'+_0x392aba[_0x06c1('0x36')][_0x06c1('0x41')]+'%'};return _0x31ae56;})});}_0x41575f=_[_0x06c1('0x42')]({},_0x41575f,_0x392aba['options']);return db[_0x06c1('0x5d')][_0x06c1('0x48')](_0x41575f);}})['then'](function(_0x22e254){if(_0x22e254){return db[_0x06c1('0x5e')][_0x06c1('0x5f')]({'where':{'id':_[_0x06c1('0x35')](_0x22e254,_0x06c1('0x60')),'role':_0x06c1('0x61')},'attributes':['id',_0x06c1('0x2f'),_0x06c1('0x62'),_0x06c1('0x63'),_0x06c1('0x64')]});}})['then'](function(_0x64e0c3){if(_0x64e0c3){return{'count':_0x64e0c3[_0x06c1('0x21')],'rows':_[_0x06c1('0x35')](_0x64e0c3['rows'],function(_0x1e3585){return{'membername':_0x1e3585[_0x06c1('0x2f')],'UserId':_0x1e3585['id'],'queue_name':_0x26f75b[_0x06c1('0x2f')],'OpenchannelQueueId':_0x26f75b['id'],'interface':util[_0x06c1('0x65')]('%s/%s','SIP',_0x1e3585[_0x06c1('0x2f')]),'penalty':0x0,'paused':_0x1e3585[_0x06c1('0x62')],'createdAt':_0x1e3585[_0x06c1('0x64')],'updatedAt':_0x1e3585[_0x06c1('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x06c1('0x28')](respondWithFilteredResult(_0x1e255f,_0x41575f))[_0x06c1('0x54')](handleError(_0x1e255f,null));};exports[_0x06c1('0x66')]=function(_0x5200c0,_0x21d384,_0x95b353){var _0x2039db={};var _0x397013={};var _0x534bf7;var _0x442b26;return db[_0x06c1('0x47')][_0x06c1('0x57')]({'where':{'id':_0x5200c0[_0x06c1('0x58')]['id']}})[_0x06c1('0x28')](handleEntityNotFound(_0x21d384,null))['then'](function(_0x35b0a4){if(_0x35b0a4){_0x534bf7=_0x35b0a4;_0x397013['model']=_[_0x06c1('0x37')](db[_0x06c1('0x67')][_0x06c1('0x31')]);_0x397013[_0x06c1('0x36')]=_['keys'](_0x5200c0[_0x06c1('0x36')]);_0x397013[_0x06c1('0x38')]=_[_0x06c1('0x3b')](_0x397013[_0x06c1('0x39')],_0x397013[_0x06c1('0x36')]);_0x2039db['attributes']=_[_0x06c1('0x3b')](_0x397013['model'],qs[_0x06c1('0x3c')](_0x5200c0[_0x06c1('0x36')][_0x06c1('0x3c')]));_0x2039db[_0x06c1('0x3a')]=_0x2039db['attributes']['length']?_0x2039db[_0x06c1('0x3a')]:_0x397013['model'];_0x2039db[_0x06c1('0x5a')]=qs[_0x06c1('0x5b')](_0x5200c0['query'][_0x06c1('0x5b')]);_0x2039db['where']=qs[_0x06c1('0x38')](_['pick'](_0x5200c0[_0x06c1('0x36')],_0x397013[_0x06c1('0x38')]));if(_0x5200c0[_0x06c1('0x36')]['filter']){_0x2039db[_0x06c1('0x3f')]=_[_0x06c1('0x42')](_0x2039db[_0x06c1('0x3f')],{'$or':_['map'](_0x2039db[_0x06c1('0x3a')],function(_0x4f0409){var _0x5cea64={};_0x5cea64[_0x4f0409]={'$like':'%'+_0x5200c0[_0x06c1('0x36')][_0x06c1('0x41')]+'%'};return _0x5cea64;})});}_0x2039db=_[_0x06c1('0x42')]({},_0x2039db,_0x5200c0['options']);return _0x534bf7['getTeams'](_0x2039db);}})['then'](function(_0x2b0017){if(_0x2b0017){_0x442b26=_0x2b0017[_0x06c1('0x3d')];if(!_0x5200c0[_0x06c1('0x36')][_0x06c1('0x59')](_0x06c1('0x3e'))){_0x2039db[_0x06c1('0x22')]=qs['limit'](_0x5200c0['query'][_0x06c1('0x22')]);_0x2039db[_0x06c1('0x1f')]=qs[_0x06c1('0x1f')](_0x5200c0[_0x06c1('0x36')][_0x06c1('0x1f')]);}return _0x534bf7['getTeams'](_0x2039db);}})[_0x06c1('0x28')](function(_0x1b8da0){if(_0x1b8da0){return _0x1b8da0?{'count':_0x442b26,'rows':_0x1b8da0}:null;}})['then'](respondWithResult(_0x21d384,null))[_0x06c1('0x54')](handleError(_0x21d384,null));};exports[_0x06c1('0x68')]=function(_0x3dea22,_0x2f308d,_0x1e4a35){var _0x446759=_0x3dea22[_0x06c1('0x4d')][_0x06c1('0x69')];return db['Team'][_0x06c1('0x48')]({'where':{'id':_0x446759},'attributes':['id'],'include':[{'model':db[_0x06c1('0x5e')],'as':_0x06c1('0x6a'),'attributes':['id','name',_0x06c1('0x6b'),_0x06c1('0x6c'),_0x06c1('0x6d')],'raw':!![]}]})[_0x06c1('0x28')](function(_0x1ffcb4){if(_0x1ffcb4){var _0x2e8ced=_[_0x06c1('0x6e')](_0x1ffcb4,function(_0x2d6b82){var _0xd4741e=_0x2d6b82[_0x06c1('0x2a')]({'plain':!![]});return _0xd4741e['Agents'];});return db['OpenchannelQueue'][_0x06c1('0x4b')]({'where':{'id':_0x3dea22[_0x06c1('0x58')]['id']}})[_0x06c1('0x28')](function(_0x5bc527){return db[_0x06c1('0x6f')][_0x06c1('0x70')](function(_0x106a5c){return _0x5bc527['addTeams'](_0x446759,{'transaction':_0x106a5c})['then'](function(){return BPromise[_0x06c1('0x71')](_0x2e8ced,function(_0x383810){return db['UserOpenchannelQueue'][_0x06c1('0x72')]({'where':{'UserId':_0x383810['id'],'OpenchannelQueueId':_0x3dea22[_0x06c1('0x58')]['id']},'transaction':_0x106a5c});});})[_0x06c1('0x28')](function(){_0x2e8ced[_0x06c1('0x73')](function(_0x1681ad){socket[_0x06c1('0x74')](_0x06c1('0x75'),{'UserId':_0x1681ad['id'],'OpenchannelQueueId':_0x5bc527['id']});});});});});}})[_0x06c1('0x28')](respondWithStatusCode(_0x2f308d,null))[_0x06c1('0x54')](handleError(_0x2f308d,null));};exports['removeTeams']=function(_0x3b2970,_0x472a5a,_0x5cbf65){return db[_0x06c1('0x67')][_0x06c1('0x48')]({'where':{'id':_0x3b2970[_0x06c1('0x36')][_0x06c1('0x69')]},'attributes':['id'],'include':[{'model':db[_0x06c1('0x5e')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x06c1('0x28')](handleEntityNotFound(_0x472a5a,null))[_0x06c1('0x28')](function(_0x17a9a2){var _0x2b32c3=_[_0x06c1('0x35')](_0x17a9a2,'id');var _0x1fcf89=[];var _0x528a31=[];var _0x46326f=squel[_0x06c1('0x76')]();_0x46326f[_0x06c1('0x77')](_0x06c1('0x78'))[_0x06c1('0x79')](_0x06c1('0x7a'),'tq')['join']('user_has_teams','ut',_0x06c1('0x7b'))[_0x06c1('0x3f')](_0x06c1('0x7c'),_0x3b2970[_0x06c1('0x58')]['id']);for(var _0x3aad9f=0x0;_0x3aad9f<_0x17a9a2[_0x06c1('0x3d')];_0x3aad9f+=0x1){let _0x11625e=_0x17a9a2[_0x3aad9f];for(var _0x19258d=0x0;_0x19258d<_0x11625e[_0x06c1('0x6a')][_0x06c1('0x3d')];_0x19258d+=0x1){let _0x46add5=_0x11625e[_0x06c1('0x6a')][_0x19258d];var _0x17a060=_0x46326f['clone']();_0x17a060[_0x06c1('0x3f')]('ut.UserId\x20=\x20?',_0x46add5['id']);_0x528a31[_0x06c1('0x7d')](db[_0x06c1('0x6f')][_0x06c1('0x36')](_0x17a060['toString'](),{'type':db[_0x06c1('0x6f')]['QueryTypes']['SELECT']})[_0x06c1('0x28')](function(_0x467a30){if(_0x467a30[_0x06c1('0x3d')]===0x1){return _0x46add5['id'];}else{var _0x2489e2=_['every'](_[_0x06c1('0x35')](_0x467a30,_0x06c1('0x7e')),function(_0x389f0d){return _[_0x06c1('0x7f')](_0x2b32c3,_0x389f0d);});if(_0x2489e2){return _0x46add5['id'];}}}));}}return BPromise[_0x06c1('0x80')](_0x528a31)[_0x06c1('0x28')](function(_0x14ed5e){_0x1fcf89=_(_0x1fcf89)['union'](_0x14ed5e)[_0x06c1('0x81')]()[_0x06c1('0x82')]();return db[_0x06c1('0x47')][_0x06c1('0x4b')]({'where':{'id':_0x3b2970[_0x06c1('0x58')]['id']}})[_0x06c1('0x28')](function(_0x2bf3ae){return db[_0x06c1('0x6f')]['transaction'](function(_0x56e3dd){return _0x2bf3ae['removeTeams'](_0x3b2970[_0x06c1('0x36')][_0x06c1('0x69')],{'transaction':_0x56e3dd})[_0x06c1('0x28')](function(){if(!_[_0x06c1('0x83')](_0x1fcf89)){return _0x2bf3ae[_0x06c1('0x84')](_0x1fcf89,{'transaction':_0x56e3dd});}})[_0x06c1('0x28')](function(){_0x1fcf89[_0x06c1('0x73')](function(_0x7068d5){socket[_0x06c1('0x74')]('userOpenchannelQueue:remove',{'UserId':_0x7068d5,'OpenchannelQueueId':_0x2bf3ae['id']});});});});});});})[_0x06c1('0x28')](respondWithStatusCode(_0x472a5a,null))[_0x06c1('0x54')](handleError(_0x472a5a,null));};exports[_0x06c1('0x85')]=function(_0x55e239,_0x5b7115,_0x1309dd){return db['OpenchannelQueue']['find']({'where':{'id':_0x55e239['params']['id']}})[_0x06c1('0x28')](handleEntityNotFound(_0x5b7115,null))['then'](function(_0xbe4971){if(_0xbe4971){return _0xbe4971[_0x06c1('0x85')](_0x55e239['body'][_0x06c1('0x69')],_[_0x06c1('0x86')](_0x55e239[_0x06c1('0x4d')],[_0x06c1('0x69'),'id'])||{})['spread'](function(_0x1534c3){for(var _0x2fdfc4=0x0;_0x2fdfc4<_0x55e239[_0x06c1('0x4d')][_0x06c1('0x69')][_0x06c1('0x3d')];_0x2fdfc4+=0x1){socket[_0x06c1('0x74')](_0x06c1('0x75'),{'UserId':Number(_0x55e239[_0x06c1('0x4d')]['ids'][_0x2fdfc4]),'OpenchannelQueueId':Number(_0x55e239['params']['id'])});}return _0x1534c3;});}})[_0x06c1('0x28')](respondWithResult(_0x5b7115,null))[_0x06c1('0x54')](handleError(_0x5b7115,null));};exports[_0x06c1('0x84')]=function(_0x180e99,_0x16ffd2,_0x7b74d6){return db[_0x06c1('0x47')]['find']({'where':{'id':_0x180e99['params']['id']}})[_0x06c1('0x28')](handleEntityNotFound(_0x16ffd2,null))[_0x06c1('0x28')](function(_0x186b8c){if(_0x186b8c){return _0x186b8c[_0x06c1('0x84')](_0x180e99[_0x06c1('0x36')]['ids'])['then'](function(){if(_[_0x06c1('0x87')](_0x180e99[_0x06c1('0x36')][_0x06c1('0x69')])){for(var _0x3633ed=0x0;_0x3633ed<_0x180e99['query']['ids'][_0x06c1('0x3d')];_0x3633ed+=0x1){socket[_0x06c1('0x74')](_0x06c1('0x88'),{'UserId':Number(_0x180e99[_0x06c1('0x36')][_0x06c1('0x69')][_0x3633ed]),'OpenchannelQueueId':Number(_0x180e99[_0x06c1('0x58')]['id'])});}}else{socket[_0x06c1('0x74')](_0x06c1('0x88'),{'UserId':Number(_0x180e99[_0x06c1('0x36')]['ids']),'OpenchannelQueueId':Number(_0x180e99[_0x06c1('0x58')]['id'])});}});}})[_0x06c1('0x28')](respondWithStatusCode(_0x16ffd2,null))[_0x06c1('0x54')](handleError(_0x16ffd2,null));};exports[_0x06c1('0x89')]=function(_0x1bd03f,_0x1c33be,_0x340a0e){var _0x3d537e={};var _0x6009dd={};var _0x3a5588;var _0x526229;return db[_0x06c1('0x47')]['findOne']({'where':{'id':_0x1bd03f[_0x06c1('0x58')]['id']}})['then'](handleEntityNotFound(_0x1c33be,null))[_0x06c1('0x28')](function(_0x546b12){if(_0x546b12){_0x3a5588=_0x546b12;_0x6009dd[_0x06c1('0x39')]=_['keys'](db[_0x06c1('0x5e')][_0x06c1('0x31')]);_0x6009dd[_0x06c1('0x36')]=_['keys'](_0x1bd03f[_0x06c1('0x36')]);_0x6009dd[_0x06c1('0x38')]=_['intersection'](_0x6009dd['model'],_0x6009dd['query']);_0x3d537e[_0x06c1('0x3a')]=_['intersection'](_0x6009dd[_0x06c1('0x39')],qs['fields'](_0x1bd03f[_0x06c1('0x36')][_0x06c1('0x3c')]));_0x3d537e[_0x06c1('0x3a')]=_0x3d537e[_0x06c1('0x3a')][_0x06c1('0x3d')]?_0x3d537e[_0x06c1('0x3a')]:_0x6009dd[_0x06c1('0x39')];_0x3d537e['order']=qs[_0x06c1('0x5b')](_0x1bd03f[_0x06c1('0x36')][_0x06c1('0x5b')]);_0x3d537e[_0x06c1('0x3f')]=qs['filters'](_['pick'](_0x1bd03f['query'],_0x6009dd[_0x06c1('0x38')]));if(_0x1bd03f[_0x06c1('0x36')]['filter']){_0x3d537e[_0x06c1('0x3f')]=_[_0x06c1('0x42')](_0x3d537e[_0x06c1('0x3f')],{'$or':_[_0x06c1('0x35')](_0x3d537e[_0x06c1('0x3a')],function(_0x1136e7){var _0x36bfee={};_0x36bfee[_0x1136e7]={'$like':'%'+_0x1bd03f[_0x06c1('0x36')][_0x06c1('0x41')]+'%'};return _0x36bfee;})});}_0x3d537e=_[_0x06c1('0x42')]({},_0x3d537e,_0x1bd03f['options']);return _0x3a5588['getAgents'](_0x3d537e);}})[_0x06c1('0x28')](function(_0x14d48c){if(_0x14d48c){_0x526229=_0x14d48c[_0x06c1('0x3d')];if(!_0x1bd03f[_0x06c1('0x36')]['hasOwnProperty'](_0x06c1('0x3e'))){_0x3d537e['limit']=qs[_0x06c1('0x22')](_0x1bd03f[_0x06c1('0x36')][_0x06c1('0x22')]);_0x3d537e[_0x06c1('0x1f')]=qs['offset'](_0x1bd03f[_0x06c1('0x36')][_0x06c1('0x1f')]);}return _0x3a5588[_0x06c1('0x89')](_0x3d537e);}})['then'](function(_0x2c7942){if(_0x2c7942){return _0x2c7942?{'count':_0x526229,'rows':_0x2c7942}:null;}})[_0x06c1('0x28')](respondWithResult(_0x1c33be,null))[_0x06c1('0x54')](handleError(_0x1c33be,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 392626e..911504d 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 _0x4dcf=['hook','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners','save','update','remove','emit'];(function(_0x1d7037,_0x57dd95){var _0x4d6568=function(_0x5c64c5){while(--_0x5c64c5){_0x1d7037['push'](_0x1d7037['shift']());}};_0x4d6568(++_0x57dd95);}(_0x4dcf,0x16a));var _0xf4dc=function(_0x2d9e96,_0x51e60f){_0x2d9e96=_0x2d9e96-0x0;var _0xb53ebe=_0x4dcf[_0x2d9e96];return _0xb53ebe;};'use strict';var EventEmitter=require(_0xf4dc('0x0'));var OpenchannelQueue=require(_0xf4dc('0x1'))['db'][_0xf4dc('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xf4dc('0x3')](0x0);var events={'afterCreate':_0xf4dc('0x4'),'afterUpdate':_0xf4dc('0x5'),'afterDestroy':_0xf4dc('0x6')};function emitEvent(_0x5e6665){return function(_0x69fcd8,_0x74541f,_0x34dbae){OpenchannelQueueEvents[_0xf4dc('0x7')](_0x5e6665+':'+_0x69fcd8['id'],_0x69fcd8);OpenchannelQueueEvents[_0xf4dc('0x7')](_0x5e6665,_0x69fcd8);_0x34dbae(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0xf4dc('0x8')](e,emitEvent(event));}}module[_0xf4dc('0x9')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x6c8d=['events','../../mysqldb','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x57e4dd,_0xd6901f){var _0x31ad4a=function(_0x40f8a6){while(--_0x40f8a6){_0x57e4dd['push'](_0x57e4dd['shift']());}};_0x31ad4a(++_0xd6901f);}(_0x6c8d,0xc8));var _0xd6c8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6c8d[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xd6c8('0x0'));var OpenchannelQueue=require(_0xd6c8('0x1'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd6c8('0x2'),'afterUpdate':'update','afterDestroy':_0xd6c8('0x3')};function emitEvent(_0x3254ac){return function(_0xf7a198,_0xfedf49,_0x1753ff){OpenchannelQueueEvents['emit'](_0x3254ac+':'+_0xf7a198['id'],_0xf7a198);OpenchannelQueueEvents[_0xd6c8('0x4')](_0x3254ac,_0xf7a198);_0x1753ff(null);};}for(var e in events){if(events[_0xd6c8('0x5')](e)){var event=events[e];OpenchannelQueue[_0xd6c8('0x6')](e,emitEvent(event));}}module[_0xd6c8('0x7')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 87b8312..14420d2 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 _0xeb5c=['exports','define','OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelQueue.attributes'];(function(_0xb58379,_0x381548){var _0x4cec4e=function(_0xa18939){while(--_0xa18939){_0xb58379['push'](_0xb58379['shift']());}};_0x4cec4e(++_0x381548);}(_0xeb5c,0x17d));var _0xceb5=function(_0x54d111,_0x594f98){_0x54d111=_0x54d111-0x0;var _0x5ed008=_0xeb5c[_0x54d111];return _0x5ed008;};'use strict';var _=require(_0xceb5('0x0'));var util=require(_0xceb5('0x1'));var logger=require(_0xceb5('0x2'))('api');var moment=require(_0xceb5('0x3'));var BPromise=require(_0xceb5('0x4'));var rp=require(_0xceb5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xceb5('0x6'));var config=require(_0xceb5('0x7'));var attributes=require(_0xceb5('0x8'));module[_0xceb5('0x9')]=function(_0x8d4d1f,_0x452ce0){return _0x8d4d1f[_0xceb5('0xa')](_0xceb5('0xb'),attributes,{'tableName':_0xceb5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x67e4=['../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','lodash','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4cf616,_0x6a30ad){var _0x1737c1=function(_0x5e3855){while(--_0x5e3855){_0x4cf616['push'](_0x4cf616['shift']());}};_0x1737c1(++_0x6a30ad);}(_0x67e4,0xa2));var _0x467e=function(_0x35fabd,_0x825452){_0x35fabd=_0x35fabd-0x0;var _0x61a8ee=_0x67e4[_0x35fabd];return _0x61a8ee;};'use strict';var _=require(_0x467e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x467e('0x1'));var moment=require(_0x467e('0x2'));var BPromise=require(_0x467e('0x3'));var rp=require(_0x467e('0x4'));var fs=require('fs');var path=require(_0x467e('0x5'));var rimraf=require(_0x467e('0x6'));var config=require(_0x467e('0x7'));var attributes=require(_0x467e('0x8'));module[_0x467e('0x9')]=function(_0x47ab15,_0x3965af){return _0x47ab15[_0x467e('0xa')](_0x467e('0xb'),attributes,{'tableName':_0x467e('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 fa6a423..28207d6 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 _0xd022=['message','result','catch','GetOpenchannelQueue','findAll','options','where','attributes','include','model','map','ShowOpenchannelQueue','OpenchannelQueue','find','raw','moment','ioredis','../../mysqldb','../../config/logger','client','http','redis','localhost','socket.io-emitter','./openchannelQueue.socket','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x11eec5,_0x49c834){var _0x184378=function(_0x21d8b6){while(--_0x21d8b6){_0x11eec5['push'](_0x11eec5['shift']());}};_0x184378(++_0x49c834);}(_0xd022,0x9b));var _0x2d02=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xd022[_0x32f7d7];return _0x133d09;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2d02('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2d02('0x1'));var db=require(_0x2d02('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x2d02('0x3'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2d02('0x4')][_0x2d02('0x5')]({'port':0x232a});config[_0x2d02('0x6')]=_['defaults'](config['redis'],{'host':_0x2d02('0x7'),'port':0x18eb});var socket=require(_0x2d02('0x8'))(new Redis(config['redis']));require(_0x2d02('0x9'))['register'](socket);function respondWithRpcPromise(_0xd5e79f,_0x1481b7,_0x251444){return new BPromise(function(_0x457f2a,_0x2b6e2e){return client[_0x2d02('0xa')](_0xd5e79f,_0x251444)[_0x2d02('0xb')](function(_0x2c55c0){logger[_0x2d02('0xc')](_0x2d02('0xd'),_0x1481b7,_0x2d02('0xe'));logger[_0x2d02('0xf')](_0x2d02('0x10'),_0x1481b7,_0x2d02('0xe'),JSON[_0x2d02('0x11')](_0x2c55c0));if(_0x2c55c0[_0x2d02('0x12')]){if(_0x2c55c0[_0x2d02('0x12')][_0x2d02('0x13')]===0x1f4){logger[_0x2d02('0x12')](_0x2d02('0xd'),_0x1481b7,_0x2c55c0[_0x2d02('0x12')][_0x2d02('0x14')]);return _0x2b6e2e(_0x2c55c0[_0x2d02('0x12')]['message']);}logger[_0x2d02('0x12')](_0x2d02('0xd'),_0x1481b7,_0x2c55c0['error']['message']);return _0x457f2a(_0x2c55c0[_0x2d02('0x12')]['message']);}else{logger[_0x2d02('0xc')](_0x2d02('0xd'),_0x1481b7,_0x2d02('0xe'));_0x457f2a(_0x2c55c0[_0x2d02('0x15')][_0x2d02('0x14')]);}})[_0x2d02('0x16')](function(_0xf29d2b){logger[_0x2d02('0x12')](_0x2d02('0xd'),_0x1481b7,_0xf29d2b);_0x2b6e2e(_0xf29d2b);});});}exports[_0x2d02('0x17')]=function(_0x4a3083){var _0x12ddc3=this;return new Promise(function(_0x4490b1,_0x23fdee){return db['OpenchannelQueue'][_0x2d02('0x18')]({'raw':_0x4a3083[_0x2d02('0x19')]?_0x4a3083[_0x2d02('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4a3083[_0x2d02('0x19')]?_0x4a3083[_0x2d02('0x19')][_0x2d02('0x1a')]||null:null,'attributes':_0x4a3083[_0x2d02('0x19')]?_0x4a3083[_0x2d02('0x19')][_0x2d02('0x1b')]||null:null,'limit':_0x4a3083[_0x2d02('0x19')]?_0x4a3083[_0x2d02('0x19')]['limit']||null:null,'include':_0x4a3083['options']?_0x4a3083['options'][_0x2d02('0x1c')]?_['map'](_0x4a3083[_0x2d02('0x19')][_0x2d02('0x1c')],function(_0x22b829){return{'model':db[_0x22b829[_0x2d02('0x1d')]],'as':_0x22b829['as'],'attributes':_0x22b829[_0x2d02('0x1b')],'include':_0x22b829[_0x2d02('0x1c')]?_[_0x2d02('0x1e')](_0x22b829[_0x2d02('0x1c')],function(_0x2805fc){return{'model':db[_0x2805fc['model']],'as':_0x2805fc['as'],'attributes':_0x2805fc[_0x2d02('0x1b')],'include':_0x2805fc[_0x2d02('0x1c')]?_['map'](_0x2805fc['include'],function(_0x3aad4b){return{'model':db[_0x3aad4b[_0x2d02('0x1d')]],'as':_0x3aad4b['as'],'attributes':_0x3aad4b['attributes']};}):[]};}):[]};}):[]:[]})[_0x2d02('0xb')](function(_0x90c591){logger[_0x2d02('0xc')](_0x2d02('0x17'),_0x4a3083);logger[_0x2d02('0xf')](_0x2d02('0x17'),_0x4a3083,JSON[_0x2d02('0x11')](_0x90c591));_0x4490b1(_0x90c591);})[_0x2d02('0x16')](function(_0x2ae426){logger[_0x2d02('0x12')](_0x2d02('0x17'),_0x2ae426[_0x2d02('0x14')],_0x4a3083);_0x23fdee(_0x12ddc3['error'](0x1f4,_0x2ae426['message']));});});};exports[_0x2d02('0x1f')]=function(_0x5264e2){var _0x2bc723=this;return new Promise(function(_0x3afdb9,_0x5a8711){return db[_0x2d02('0x20')][_0x2d02('0x21')]({'raw':_0x5264e2[_0x2d02('0x19')]?_0x5264e2[_0x2d02('0x19')][_0x2d02('0x22')]===undefined?!![]:![]:!![],'where':_0x5264e2[_0x2d02('0x19')]?_0x5264e2[_0x2d02('0x19')][_0x2d02('0x1a')]||null:null,'attributes':_0x5264e2[_0x2d02('0x19')]?_0x5264e2['options']['attributes']||null:null,'include':_0x5264e2[_0x2d02('0x19')]?_0x5264e2['options'][_0x2d02('0x1c')]?_[_0x2d02('0x1e')](_0x5264e2[_0x2d02('0x19')][_0x2d02('0x1c')],function(_0x2ad34e){return{'model':db[_0x2ad34e[_0x2d02('0x1d')]],'as':_0x2ad34e['as'],'attributes':_0x2ad34e['attributes'],'include':_0x2ad34e[_0x2d02('0x1c')]?_[_0x2d02('0x1e')](_0x2ad34e[_0x2d02('0x1c')],function(_0x100a32){return{'model':db[_0x100a32['model']],'as':_0x100a32['as'],'attributes':_0x100a32[_0x2d02('0x1b')],'include':_0x100a32[_0x2d02('0x1c')]?_[_0x2d02('0x1e')](_0x100a32[_0x2d02('0x1c')],function(_0x5d142f){return{'model':db[_0x5d142f[_0x2d02('0x1d')]],'as':_0x5d142f['as'],'attributes':_0x5d142f['attributes']};}):[]};}):[]};}):[]:[]})[_0x2d02('0xb')](function(_0xffa400){logger[_0x2d02('0xc')](_0x2d02('0x1f'),_0x5264e2);logger['debug'](_0x2d02('0x1f'),_0x5264e2,JSON[_0x2d02('0x11')](_0xffa400));_0x3afdb9(_0xffa400);})[_0x2d02('0x16')](function(_0x271452){logger[_0x2d02('0x12')](_0x2d02('0x1f'),_0x271452[_0x2d02('0x14')],_0x5264e2);_0x5a8711(_0x2bc723[_0x2d02('0x12')](0x1f4,_0x271452[_0x2d02('0x14')]));});});}; \ No newline at end of file +var _0x53c4=['message','result','catch','findAll','options','raw','where','attributes','include','model','map','GetOpenchannelQueue','ShowOpenchannelQueue','find','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4f2c3a,_0x6bde90){var _0x17d91c=function(_0xaaf630){while(--_0xaaf630){_0x4f2c3a['push'](_0x4f2c3a['shift']());}};_0x17d91c(++_0x6bde90);}(_0x53c4,0x146));var _0x453c=function(_0x5ecb5b,_0x42f9ef){_0x5ecb5b=_0x5ecb5b-0x0;var _0x2d00ed=_0x53c4[_0x5ecb5b];return _0x2d00ed;};'use strict';var _=require('lodash');var util=require(_0x453c('0x0'));var moment=require(_0x453c('0x1'));var BPromise=require(_0x453c('0x2'));var rs=require(_0x453c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x453c('0x4'));var logger=require(_0x453c('0x5'))('rpc');var config=require(_0x453c('0x6'));var jayson=require(_0x453c('0x7'));var client=jayson['client'][_0x453c('0x8')]({'port':0x232a});config[_0x453c('0x9')]=_[_0x453c('0xa')](config['redis'],{'host':_0x453c('0xb'),'port':0x18eb});var socket=require(_0x453c('0xc'))(new Redis(config[_0x453c('0x9')]));require(_0x453c('0xd'))[_0x453c('0xe')](socket);function respondWithRpcPromise(_0x15e573,_0x5691b9,_0x533f6c){return new BPromise(function(_0x581f16,_0x446050){return client[_0x453c('0xf')](_0x15e573,_0x533f6c)[_0x453c('0x10')](function(_0x466ecc){logger[_0x453c('0x11')](_0x453c('0x12'),_0x5691b9,_0x453c('0x13'));logger[_0x453c('0x14')](_0x453c('0x15'),_0x5691b9,_0x453c('0x13'),JSON[_0x453c('0x16')](_0x466ecc));if(_0x466ecc[_0x453c('0x17')]){if(_0x466ecc['error'][_0x453c('0x18')]===0x1f4){logger[_0x453c('0x17')]('OpenchannelQueue,\x20%s,\x20%s',_0x5691b9,_0x466ecc[_0x453c('0x17')][_0x453c('0x19')]);return _0x446050(_0x466ecc[_0x453c('0x17')][_0x453c('0x19')]);}logger['error'](_0x453c('0x12'),_0x5691b9,_0x466ecc[_0x453c('0x17')][_0x453c('0x19')]);return _0x581f16(_0x466ecc['error'][_0x453c('0x19')]);}else{logger[_0x453c('0x11')](_0x453c('0x12'),_0x5691b9,_0x453c('0x13'));_0x581f16(_0x466ecc[_0x453c('0x1a')][_0x453c('0x19')]);}})[_0x453c('0x1b')](function(_0x4511f1){logger[_0x453c('0x17')](_0x453c('0x12'),_0x5691b9,_0x4511f1);_0x446050(_0x4511f1);});});}exports['GetOpenchannelQueue']=function(_0x4b90ac){var _0x3a8028=this;return new Promise(function(_0xbeebb2,_0x219c1b){return db['OpenchannelQueue'][_0x453c('0x1c')]({'raw':_0x4b90ac[_0x453c('0x1d')]?_0x4b90ac['options'][_0x453c('0x1e')]===undefined?!![]:![]:!![],'where':_0x4b90ac[_0x453c('0x1d')]?_0x4b90ac[_0x453c('0x1d')][_0x453c('0x1f')]||null:null,'attributes':_0x4b90ac[_0x453c('0x1d')]?_0x4b90ac[_0x453c('0x1d')][_0x453c('0x20')]||null:null,'limit':_0x4b90ac[_0x453c('0x1d')]?_0x4b90ac[_0x453c('0x1d')]['limit']||null:null,'include':_0x4b90ac[_0x453c('0x1d')]?_0x4b90ac[_0x453c('0x1d')]['include']?_['map'](_0x4b90ac['options'][_0x453c('0x21')],function(_0x1928ca){return{'model':db[_0x1928ca[_0x453c('0x22')]],'as':_0x1928ca['as'],'attributes':_0x1928ca[_0x453c('0x20')],'include':_0x1928ca[_0x453c('0x21')]?_[_0x453c('0x23')](_0x1928ca[_0x453c('0x21')],function(_0xc6720d){return{'model':db[_0xc6720d[_0x453c('0x22')]],'as':_0xc6720d['as'],'attributes':_0xc6720d[_0x453c('0x20')],'include':_0xc6720d[_0x453c('0x21')]?_[_0x453c('0x23')](_0xc6720d[_0x453c('0x21')],function(_0x36dcc9){return{'model':db[_0x36dcc9[_0x453c('0x22')]],'as':_0x36dcc9['as'],'attributes':_0x36dcc9[_0x453c('0x20')]};}):[]};}):[]};}):[]:[]})[_0x453c('0x10')](function(_0x44e6ee){logger[_0x453c('0x11')](_0x453c('0x24'),_0x4b90ac);logger[_0x453c('0x14')](_0x453c('0x24'),_0x4b90ac,JSON[_0x453c('0x16')](_0x44e6ee));_0xbeebb2(_0x44e6ee);})[_0x453c('0x1b')](function(_0x5ab9c6){logger[_0x453c('0x17')](_0x453c('0x24'),_0x5ab9c6[_0x453c('0x19')],_0x4b90ac);_0x219c1b(_0x3a8028[_0x453c('0x17')](0x1f4,_0x5ab9c6[_0x453c('0x19')]));});});};exports[_0x453c('0x25')]=function(_0x2e02f8){var _0x16184c=this;return new Promise(function(_0x3faa40,_0x480dd6){return db['OpenchannelQueue'][_0x453c('0x26')]({'raw':_0x2e02f8['options']?_0x2e02f8[_0x453c('0x1d')][_0x453c('0x1e')]===undefined?!![]:![]:!![],'where':_0x2e02f8['options']?_0x2e02f8['options'][_0x453c('0x1f')]||null:null,'attributes':_0x2e02f8['options']?_0x2e02f8['options'][_0x453c('0x20')]||null:null,'include':_0x2e02f8[_0x453c('0x1d')]?_0x2e02f8[_0x453c('0x1d')]['include']?_[_0x453c('0x23')](_0x2e02f8[_0x453c('0x1d')][_0x453c('0x21')],function(_0x53a2f2){return{'model':db[_0x53a2f2[_0x453c('0x22')]],'as':_0x53a2f2['as'],'attributes':_0x53a2f2[_0x453c('0x20')],'include':_0x53a2f2[_0x453c('0x21')]?_[_0x453c('0x23')](_0x53a2f2[_0x453c('0x21')],function(_0xc22b15){return{'model':db[_0xc22b15[_0x453c('0x22')]],'as':_0xc22b15['as'],'attributes':_0xc22b15[_0x453c('0x20')],'include':_0xc22b15[_0x453c('0x21')]?_[_0x453c('0x23')](_0xc22b15[_0x453c('0x21')],function(_0x399ec8){return{'model':db[_0x399ec8[_0x453c('0x22')]],'as':_0x399ec8['as'],'attributes':_0x399ec8[_0x453c('0x20')]};}):[]};}):[]};}):[]:[]})[_0x453c('0x10')](function(_0x2f419d){logger[_0x453c('0x11')](_0x453c('0x25'),_0x2e02f8);logger['debug'](_0x453c('0x25'),_0x2e02f8,JSON[_0x453c('0x16')](_0x2f419d));_0x3faa40(_0x2f419d);})[_0x453c('0x1b')](function(_0x3fd73c){logger[_0x453c('0x17')](_0x453c('0x25'),_0x3fd73c['message'],_0x2e02f8);_0x480dd6(_0x16184c[_0x453c('0x17')](0x1f4,_0x3fd73c[_0x453c('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 88b5545..95ce8d8 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 _0x6467=['length','openchannelQueue:','./openchannelQueue.events','remove','update','emit','removeListener','register'];(function(_0x415bdb,_0xc1e339){var _0x3b3cd8=function(_0x297f03){while(--_0x297f03){_0x415bdb['push'](_0x415bdb['shift']());}};_0x3b3cd8(++_0xc1e339);}(_0x6467,0x10a));var _0x7646=function(_0x183135,_0x1a624d){_0x183135=_0x183135-0x0;var _0x10acc8=_0x6467[_0x183135];return _0x10acc8;};'use strict';var OpenchannelQueueEvents=require(_0x7646('0x0'));var events=['save',_0x7646('0x1'),_0x7646('0x2')];function createListener(_0x4203a3,_0x5d0063){return function(_0x56348b){_0x5d0063[_0x7646('0x3')](_0x4203a3,_0x56348b);};}function removeListener(_0x5055b6,_0x32537b){return function(){OpenchannelQueueEvents[_0x7646('0x4')](_0x5055b6,_0x32537b);};}exports[_0x7646('0x5')]=function(_0x2b113e){for(var _0x18610f=0x0,_0x38ae40=events[_0x7646('0x6')];_0x18610f<_0x38ae40;_0x18610f++){var _0x1e1ce6=events[_0x18610f];var _0x370a48=createListener(_0x7646('0x7')+_0x1e1ce6,_0x2b113e);OpenchannelQueueEvents['on'](_0x1e1ce6,_0x370a48);}}; \ No newline at end of file +var _0x5e10=['save','emit','removeListener','register','openchannelQueue:','./openchannelQueue.events'];(function(_0x52c7f4,_0x2b3ad5){var _0x513d5b=function(_0x39bb23){while(--_0x39bb23){_0x52c7f4['push'](_0x52c7f4['shift']());}};_0x513d5b(++_0x2b3ad5);}(_0x5e10,0x89));var _0x05e1=function(_0x5a5276,_0x262d69){_0x5a5276=_0x5a5276-0x0;var _0x3e8ee2=_0x5e10[_0x5a5276];return _0x3e8ee2;};'use strict';var OpenchannelQueueEvents=require(_0x05e1('0x0'));var events=[_0x05e1('0x1'),'remove','update'];function createListener(_0x48de84,_0x21bed0){return function(_0x123f8d){_0x21bed0[_0x05e1('0x2')](_0x48de84,_0x123f8d);};}function removeListener(_0x3d0da5,_0x6767ed){return function(){OpenchannelQueueEvents[_0x05e1('0x3')](_0x3d0da5,_0x6767ed);};}exports[_0x05e1('0x4')]=function(_0x22dcfc){for(var _0x5bfcc8=0x0,_0x2f3dc8=events['length'];_0x5bfcc8<_0x2f3dc8;_0x5bfcc8++){var _0x5609eb=events[_0x5bfcc8];var _0x18fc3e=createListener(_0x05e1('0x5')+_0x5609eb,_0x22dcfc);OpenchannelQueueEvents['on'](_0x5609eb,_0x18fc3e);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index cc9a5dd..7037770 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 _0x69c7=['update','destroy','multer','util','path','Router','fs-extra','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','/:id','show','post','put'];(function(_0x4a914f,_0x247258){var _0x4a88fc=function(_0x3fa243){while(--_0x3fa243){_0x4a914f['push'](_0x4a914f['shift']());}};_0x4a88fc(++_0x247258);}(_0x69c7,0x142));var _0x769c=function(_0x259427,_0x39bc4f){_0x259427=_0x259427-0x0;var _0x599038=_0x69c7[_0x259427];return _0x599038;};'use strict';var multer=require(_0x769c('0x0'));var util=require(_0x769c('0x1'));var path=require(_0x769c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x769c('0x3')]();var fs_extra=require(_0x769c('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x769c('0x5'));var controller=require(_0x769c('0x6'));router[_0x769c('0x7')]('/',auth[_0x769c('0x8')](),controller[_0x769c('0x9')]);router[_0x769c('0x7')]('/describe',auth[_0x769c('0x8')](),controller['describe']);router[_0x769c('0x7')](_0x769c('0xa'),auth['isAuthenticated'](),controller[_0x769c('0xb')]);router[_0x769c('0xc')]('/',auth[_0x769c('0x8')](),controller['create']);router[_0x769c('0xd')]('/:id',auth[_0x769c('0x8')](),controller[_0x769c('0xe')]);router['delete'](_0x769c('0xa'),auth[_0x769c('0x8')](),controller[_0x769c('0xf')]);module['exports']=router; \ No newline at end of file +var _0xa034=['show','create','put','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','/describe','describe','/:id'];(function(_0x7bcf27,_0x57f183){var _0x15d436=function(_0x3f767c){while(--_0x3f767c){_0x7bcf27['push'](_0x7bcf27['shift']());}};_0x15d436(++_0x57f183);}(_0xa034,0x191));var _0x4a03=function(_0x1ce8b9,_0x39078b){_0x1ce8b9=_0x1ce8b9-0x0;var _0x105887=_0xa034[_0x1ce8b9];return _0x105887;};'use strict';var multer=require(_0x4a03('0x0'));var util=require('util');var path=require(_0x4a03('0x1'));var timeout=require('connect-timeout');var express=require(_0x4a03('0x2'));var router=express[_0x4a03('0x3')]();var fs_extra=require(_0x4a03('0x4'));var auth=require(_0x4a03('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4a03('0x6'));var controller=require(_0x4a03('0x7'));router[_0x4a03('0x8')]('/',auth[_0x4a03('0x9')](),controller['index']);router[_0x4a03('0x8')](_0x4a03('0xa'),auth[_0x4a03('0x9')](),controller[_0x4a03('0xb')]);router[_0x4a03('0x8')](_0x4a03('0xc'),auth[_0x4a03('0x9')](),controller[_0x4a03('0xd')]);router['post']('/',auth[_0x4a03('0x9')](),controller[_0x4a03('0xe')]);router[_0x4a03('0xf')](_0x4a03('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x4a03('0x10')](_0x4a03('0xc'),auth[_0x4a03('0x9')](),controller[_0x4a03('0x11')]);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 9d6535f..b87991e 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 _0x4a7f=['moment','exports','STRING','DATE'];(function(_0x386b69,_0x5d9360){var _0x476415=function(_0x49fd60){while(--_0x49fd60){_0x386b69['push'](_0x386b69['shift']());}};_0x476415(++_0x5d9360);}(_0x4a7f,0x1a4));var _0xf4a7=function(_0x7f16d6,_0x1a82d4){_0x7f16d6=_0x7f16d6-0x0;var _0x427af8=_0x4a7f[_0x7f16d6];return _0x427af8;};'use strict';var moment=require(_0xf4a7('0x0'));var Sequelize=require('sequelize');module[_0xf4a7('0x1')]={'uniqueid':{'type':Sequelize[_0xf4a7('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xf4a7('0x2')]},'joinAt':{'type':Sequelize[_0xf4a7('0x3')]},'leaveAt':{'type':Sequelize[_0xf4a7('0x3')]},'acceptAt':{'type':Sequelize[_0xf4a7('0x3')]},'exitAt':{'type':Sequelize[_0xf4a7('0x3')]},'reason':{'type':Sequelize[_0xf4a7('0x2')]}}; \ No newline at end of file +var _0x3691=['sequelize','exports','STRING','DATE'];(function(_0xb65e77,_0x238c3d){var _0x38134b=function(_0x39da21){while(--_0x39da21){_0xb65e77['push'](_0xb65e77['shift']());}};_0x38134b(++_0x238c3d);}(_0x3691,0x98));var _0x1369=function(_0x5682f8,_0x3d9c4e){_0x5682f8=_0x5682f8-0x0;var _0x1dfa41=_0x3691[_0x5682f8];return _0x1dfa41;};'use strict';var moment=require('moment');var Sequelize=require(_0x1369('0x0'));module[_0x1369('0x1')]={'uniqueid':{'type':Sequelize[_0x1369('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x1369('0x2')]},'joinAt':{'type':Sequelize[_0x1369('0x3')]},'leaveAt':{'type':Sequelize[_0x1369('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x1369('0x3')]},'reason':{'type':Sequelize[_0x1369('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 5cd1e31..cb405e0 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 _0xca8c=['fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','options','catch','create','body','find','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','sendStatus','status','end','offset','limit','count','set','Content-Range','json','reject','save','update','then','stack','name','send','OpenchannelQueueReport','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xca8c,0xeb));var _0xcca8=function(_0x144db4,_0x1229c8){_0x144db4=_0x144db4-0x0;var _0x380579=_0xca8c[_0x144db4];return _0x380579;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcca8('0x0'));var zipdir=require(_0xcca8('0x1'));var jsonpatch=require(_0xcca8('0x2'));var rp=require('request-promise');var moment=require(_0xcca8('0x3'));var BPromise=require(_0xcca8('0x4'));var Mustache=require('mustache');var util=require(_0xcca8('0x5'));var path=require('path');var sox=require(_0xcca8('0x6'));var csv=require(_0xcca8('0x7'));var ejs=require(_0xcca8('0x8'));var fs=require('fs');var fs_extra=require(_0xcca8('0x9'));var _=require(_0xcca8('0xa'));var squel=require(_0xcca8('0xb'));var crypto=require(_0xcca8('0xc'));var jsforce=require(_0xcca8('0xd'));var deskjs=require(_0xcca8('0xe'));var toCsv=require(_0xcca8('0x7'));var querystring=require(_0xcca8('0xf'));var Papa=require(_0xcca8('0x10'));var Redis=require(_0xcca8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xcca8('0x12'));var as=require(_0xcca8('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xcca8('0x14'));var utils=require(_0xcca8('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3af273,_0x45b7cf){_0x45b7cf=_0x45b7cf||0xcc;return function(_0x49a29b){if(_0x49a29b){return _0x3af273[_0xcca8('0x16')](_0x45b7cf);}return _0x3af273[_0xcca8('0x17')](_0x45b7cf)[_0xcca8('0x18')]();};}function respondWithResult(_0x225514,_0x31bce5){_0x31bce5=_0x31bce5||0xc8;return function(_0x5b1e3d){if(_0x5b1e3d){return _0x225514[_0xcca8('0x17')](_0x31bce5)['json'](_0x5b1e3d);}};}function respondWithFilteredResult(_0x54500e,_0x2fd864){return function(_0x16684b){if(_0x16684b){var _0x352c73=typeof _0x2fd864[_0xcca8('0x19')]==='undefined'&&typeof _0x2fd864[_0xcca8('0x1a')]==='undefined';var _0x1284b2=_0x16684b[_0xcca8('0x1b')];var _0x14f896=_0x352c73?0x0:_0x2fd864['offset'];var _0x36d981=_0x352c73?_0x16684b[_0xcca8('0x1b')]:_0x2fd864['offset']+_0x2fd864['limit'];var _0x3af55d;if(_0x36d981>=_0x1284b2){_0x36d981=_0x1284b2;_0x3af55d=0xc8;}else{_0x3af55d=0xce;}_0x54500e[_0xcca8('0x17')](_0x3af55d);return _0x54500e[_0xcca8('0x1c')](_0xcca8('0x1d'),_0x14f896+'-'+_0x36d981+'/'+_0x1284b2)[_0xcca8('0x1e')](_0x16684b);}return null;};}function patchUpdates(_0x5651b2){return function(_0x3a25c2){try{jsonpatch['apply'](_0x3a25c2,_0x5651b2,!![]);}catch(_0x4043b5){return BPromise[_0xcca8('0x1f')](_0x4043b5);}return _0x3a25c2[_0xcca8('0x20')]();};}function saveUpdates(_0x273732,_0x189c7c){return function(_0x2ba6da){if(_0x2ba6da){return _0x2ba6da[_0xcca8('0x21')](_0x273732)[_0xcca8('0x22')](function(_0x29d69c){return _0x29d69c;});}return null;};}function removeEntity(_0x4bba34,_0x48760d){return function(_0x1afad2){if(_0x1afad2){return _0x1afad2['destroy']()['then'](function(){_0x4bba34[_0xcca8('0x17')](0xcc)[_0xcca8('0x18')]();});}};}function handleEntityNotFound(_0x1f8040,_0x434ae2){return function(_0x265af2){if(!_0x265af2){_0x1f8040[_0xcca8('0x16')](0x194);}return _0x265af2;};}function handleError(_0x2af1a6,_0x41edc3){_0x41edc3=_0x41edc3||0x1f4;return function(_0x2b1ecf){logger['error'](_0x2b1ecf[_0xcca8('0x23')]);if(_0x2b1ecf[_0xcca8('0x24')]){delete _0x2b1ecf['name'];}_0x2af1a6[_0xcca8('0x17')](_0x41edc3)[_0xcca8('0x25')](_0x2b1ecf);};}exports['index']=function(_0xf1838,_0x4ec786){var _0x237b4a={},_0x18d284={},_0x5b0f1e={'count':0x0,'rows':[]};var _0x143d37=_['map'](db[_0xcca8('0x26')][_0xcca8('0x27')],function(_0x18917e){return{'name':_0x18917e['fieldName'],'type':_0x18917e[_0xcca8('0x28')][_0xcca8('0x29')]};});_0x18d284[_0xcca8('0x2a')]=_[_0xcca8('0x2b')](_0x143d37,_0xcca8('0x24'));_0x18d284[_0xcca8('0x2c')]=_[_0xcca8('0x2d')](_0xf1838[_0xcca8('0x2c')]);_0x18d284[_0xcca8('0x2e')]=_[_0xcca8('0x2f')](_0x18d284[_0xcca8('0x2a')],_0x18d284[_0xcca8('0x2c')]);_0x237b4a[_0xcca8('0x30')]=_[_0xcca8('0x2f')](_0x18d284[_0xcca8('0x2a')],qs[_0xcca8('0x31')](_0xf1838['query'][_0xcca8('0x31')]));_0x237b4a['attributes']=_0x237b4a[_0xcca8('0x30')][_0xcca8('0x32')]?_0x237b4a[_0xcca8('0x30')]:_0x18d284[_0xcca8('0x2a')];if(!_0xf1838[_0xcca8('0x2c')][_0xcca8('0x33')](_0xcca8('0x34'))){_0x237b4a[_0xcca8('0x1a')]=qs['limit'](_0xf1838[_0xcca8('0x2c')]['limit']);_0x237b4a[_0xcca8('0x19')]=qs[_0xcca8('0x19')](_0xf1838[_0xcca8('0x2c')][_0xcca8('0x19')]);}_0x237b4a[_0xcca8('0x35')]=qs['sort'](_0xf1838[_0xcca8('0x2c')][_0xcca8('0x36')]);_0x237b4a[_0xcca8('0x37')]=qs[_0xcca8('0x2e')](_['pick'](_0xf1838[_0xcca8('0x2c')],_0x18d284[_0xcca8('0x2e')]),_0x143d37);if(_0xf1838[_0xcca8('0x2c')]['filter']){_0x237b4a[_0xcca8('0x37')]=_[_0xcca8('0x38')](_0x237b4a[_0xcca8('0x37')],{'$or':_[_0xcca8('0x2b')](_0x143d37,function(_0x103ed9){if(_0x103ed9[_0xcca8('0x28')]!==_0xcca8('0x39')){var _0xbd357={};_0xbd357[_0x103ed9[_0xcca8('0x24')]]={'$like':'%'+_0xf1838[_0xcca8('0x2c')][_0xcca8('0x3a')]+'%'};return _0xbd357;}})});}_0x237b4a=_[_0xcca8('0x38')]({},_0x237b4a,_0xf1838['options']);var _0x32f91c={'where':_0x237b4a[_0xcca8('0x37')]};return db[_0xcca8('0x26')]['count'](_0x32f91c)['then'](function(_0x2865f9){_0x5b0f1e[_0xcca8('0x1b')]=_0x2865f9;if(_0xf1838[_0xcca8('0x2c')][_0xcca8('0x3b')]){_0x237b4a[_0xcca8('0x3c')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0xcca8('0x3d')](_0x237b4a);})[_0xcca8('0x22')](function(_0x5ef9db){_0x5b0f1e[_0xcca8('0x3e')]=_0x5ef9db;return _0x5b0f1e;})[_0xcca8('0x22')](respondWithFilteredResult(_0x4ec786,_0x237b4a))['catch'](handleError(_0x4ec786,null));};exports[_0xcca8('0x3f')]=function(_0x275264,_0x4cc1eb){var _0x3ec1fa={'raw':!![],'where':{'id':_0x275264[_0xcca8('0x40')]['id']}},_0x398a5f={};_0x398a5f['model']=_[_0xcca8('0x2d')](db[_0xcca8('0x26')]['rawAttributes']);_0x398a5f[_0xcca8('0x2c')]=_[_0xcca8('0x2d')](_0x275264[_0xcca8('0x2c')]);_0x398a5f[_0xcca8('0x2e')]=_[_0xcca8('0x2f')](_0x398a5f[_0xcca8('0x2a')],_0x398a5f[_0xcca8('0x2c')]);_0x3ec1fa[_0xcca8('0x30')]=_['intersection'](_0x398a5f[_0xcca8('0x2a')],qs[_0xcca8('0x31')](_0x275264[_0xcca8('0x2c')][_0xcca8('0x31')]));_0x3ec1fa['attributes']=_0x3ec1fa['attributes'][_0xcca8('0x32')]?_0x3ec1fa[_0xcca8('0x30')]:_0x398a5f[_0xcca8('0x2a')];if(_0x275264[_0xcca8('0x2c')]['includeAll']){_0x3ec1fa[_0xcca8('0x3c')]=[{'all':!![]}];}_0x3ec1fa=_[_0xcca8('0x38')]({},_0x3ec1fa,_0x275264[_0xcca8('0x41')]);return db['OpenchannelQueueReport']['find'](_0x3ec1fa)[_0xcca8('0x22')](handleEntityNotFound(_0x4cc1eb,null))[_0xcca8('0x22')](respondWithResult(_0x4cc1eb,null))[_0xcca8('0x42')](handleError(_0x4cc1eb,null));};exports['create']=function(_0x58fa95,_0x2e64cf){return db[_0xcca8('0x26')][_0xcca8('0x43')](_0x58fa95[_0xcca8('0x44')],{})[_0xcca8('0x22')](respondWithResult(_0x2e64cf,0xc9))[_0xcca8('0x42')](handleError(_0x2e64cf,null));};exports['update']=function(_0x153916,_0x209bb1){if(_0x153916['body']['id']){delete _0x153916[_0xcca8('0x44')]['id'];}return db['OpenchannelQueueReport'][_0xcca8('0x45')]({'where':{'id':_0x153916[_0xcca8('0x40')]['id']}})['then'](handleEntityNotFound(_0x209bb1,null))['then'](saveUpdates(_0x153916[_0xcca8('0x44')],null))['then'](respondWithResult(_0x209bb1,null))[_0xcca8('0x42')](handleError(_0x209bb1,null));};exports['destroy']=function(_0x48d130,_0x39e5c2){return db['OpenchannelQueueReport'][_0xcca8('0x45')]({'where':{'id':_0x48d130[_0xcca8('0x40')]['id']}})[_0xcca8('0x22')](handleEntityNotFound(_0x39e5c2,null))[_0xcca8('0x22')](removeEntity(_0x39e5c2,null))[_0xcca8('0x42')](handleError(_0x39e5c2,null));};exports[_0xcca8('0x46')]=function(_0x1535f9,_0x4e9ff3){return db[_0xcca8('0x26')][_0xcca8('0x46')]()['then'](respondWithResult(_0x4e9ff3,null))['catch'](handleError(_0x4e9ff3,null));}; \ No newline at end of file +var _0x633c=['save','then','error','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','model','keys','query','filters','attributes','intersection','fields','sort','where','pick','filter','merge','type','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','destroy','describe','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','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','apply'];(function(_0x2b324b,_0xdb76b2){var _0x1c05a4=function(_0x195be3){while(--_0x195be3){_0x2b324b['push'](_0x2b324b['shift']());}};_0x1c05a4(++_0xdb76b2);}(_0x633c,0xb9));var _0xc633=function(_0x54da98,_0x322aeb){_0x54da98=_0x54da98-0x0;var _0x1daa90=_0x633c[_0x54da98];return _0x1daa90;};'use strict';var emlformat=require(_0xc633('0x0'));var rimraf=require(_0xc633('0x1'));var zipdir=require(_0xc633('0x2'));var jsonpatch=require(_0xc633('0x3'));var rp=require(_0xc633('0x4'));var moment=require(_0xc633('0x5'));var BPromise=require(_0xc633('0x6'));var Mustache=require(_0xc633('0x7'));var util=require(_0xc633('0x8'));var path=require(_0xc633('0x9'));var sox=require('sox');var csv=require(_0xc633('0xa'));var ejs=require(_0xc633('0xb'));var fs=require('fs');var fs_extra=require(_0xc633('0xc'));var _=require('lodash');var squel=require(_0xc633('0xd'));var crypto=require(_0xc633('0xe'));var jsforce=require(_0xc633('0xf'));var deskjs=require(_0xc633('0x10'));var toCsv=require(_0xc633('0xa'));var querystring=require('querystring');var Papa=require(_0xc633('0x11'));var Redis=require(_0xc633('0x12'));var authService=require(_0xc633('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xc633('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc633('0x15'));var utils=require(_0xc633('0x16'));var config=require(_0xc633('0x17'));var licenseUtil=require(_0xc633('0x18'));var db=require(_0xc633('0x19'))['db'];function respondWithStatusCode(_0x28f27c,_0x444f1a){_0x444f1a=_0x444f1a||0xcc;return function(_0x80d93f){if(_0x80d93f){return _0x28f27c[_0xc633('0x1a')](_0x444f1a);}return _0x28f27c['status'](_0x444f1a)[_0xc633('0x1b')]();};}function respondWithResult(_0x176ec5,_0x45f250){_0x45f250=_0x45f250||0xc8;return function(_0x325339){if(_0x325339){return _0x176ec5[_0xc633('0x1c')](_0x45f250)[_0xc633('0x1d')](_0x325339);}};}function respondWithFilteredResult(_0x4f732f,_0x21f600){return function(_0x2b4882){if(_0x2b4882){var _0x14c9a1=typeof _0x21f600['offset']==='undefined'&&typeof _0x21f600[_0xc633('0x1e')]===_0xc633('0x1f');var _0x4881ee=_0x2b4882[_0xc633('0x20')];var _0x55df98=_0x14c9a1?0x0:_0x21f600[_0xc633('0x21')];var _0x229697=_0x14c9a1?_0x2b4882[_0xc633('0x20')]:_0x21f600[_0xc633('0x21')]+_0x21f600[_0xc633('0x1e')];var _0x3bfc22;if(_0x229697>=_0x4881ee){_0x229697=_0x4881ee;_0x3bfc22=0xc8;}else{_0x3bfc22=0xce;}_0x4f732f['status'](_0x3bfc22);return _0x4f732f[_0xc633('0x22')](_0xc633('0x23'),_0x55df98+'-'+_0x229697+'/'+_0x4881ee)[_0xc633('0x1d')](_0x2b4882);}return null;};}function patchUpdates(_0x44c4d6){return function(_0x1fb029){try{jsonpatch[_0xc633('0x24')](_0x1fb029,_0x44c4d6,!![]);}catch(_0x3405d3){return BPromise['reject'](_0x3405d3);}return _0x1fb029[_0xc633('0x25')]();};}function saveUpdates(_0x1ca83d,_0x26b4bd){return function(_0x12eb68){if(_0x12eb68){return _0x12eb68['update'](_0x1ca83d)[_0xc633('0x26')](function(_0x65a4c1){return _0x65a4c1;});}return null;};}function removeEntity(_0x4a7874,_0x53ab88){return function(_0x1899ba){if(_0x1899ba){return _0x1899ba['destroy']()['then'](function(){_0x4a7874[_0xc633('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xcef2eb,_0x1305ef){return function(_0x16226b){if(!_0x16226b){_0xcef2eb['sendStatus'](0x194);}return _0x16226b;};}function handleError(_0x448f63,_0x3d9e80){_0x3d9e80=_0x3d9e80||0x1f4;return function(_0x48610e){logger[_0xc633('0x27')](_0x48610e[_0xc633('0x28')]);if(_0x48610e['name']){delete _0x48610e[_0xc633('0x29')];}_0x448f63['status'](_0x3d9e80)[_0xc633('0x2a')](_0x48610e);};}exports[_0xc633('0x2b')]=function(_0xd5f7fd,_0x48e7e1){var _0x151998={},_0xc2dbde={},_0x50a121={'count':0x0,'rows':[]};var _0x25fbaf=_[_0xc633('0x2c')](db[_0xc633('0x2d')][_0xc633('0x2e')],function(_0x67a2c2){return{'name':_0x67a2c2['fieldName'],'type':_0x67a2c2['type']['key']};});_0xc2dbde[_0xc633('0x2f')]=_[_0xc633('0x2c')](_0x25fbaf,_0xc633('0x29'));_0xc2dbde['query']=_[_0xc633('0x30')](_0xd5f7fd[_0xc633('0x31')]);_0xc2dbde[_0xc633('0x32')]=_['intersection'](_0xc2dbde['model'],_0xc2dbde[_0xc633('0x31')]);_0x151998[_0xc633('0x33')]=_[_0xc633('0x34')](_0xc2dbde['model'],qs[_0xc633('0x35')](_0xd5f7fd[_0xc633('0x31')][_0xc633('0x35')]));_0x151998['attributes']=_0x151998[_0xc633('0x33')]['length']?_0x151998[_0xc633('0x33')]:_0xc2dbde[_0xc633('0x2f')];if(!_0xd5f7fd[_0xc633('0x31')]['hasOwnProperty']('nolimit')){_0x151998[_0xc633('0x1e')]=qs['limit'](_0xd5f7fd[_0xc633('0x31')][_0xc633('0x1e')]);_0x151998[_0xc633('0x21')]=qs[_0xc633('0x21')](_0xd5f7fd[_0xc633('0x31')][_0xc633('0x21')]);}_0x151998['order']=qs[_0xc633('0x36')](_0xd5f7fd[_0xc633('0x31')][_0xc633('0x36')]);_0x151998[_0xc633('0x37')]=qs[_0xc633('0x32')](_[_0xc633('0x38')](_0xd5f7fd[_0xc633('0x31')],_0xc2dbde[_0xc633('0x32')]),_0x25fbaf);if(_0xd5f7fd[_0xc633('0x31')][_0xc633('0x39')]){_0x151998['where']=_[_0xc633('0x3a')](_0x151998[_0xc633('0x37')],{'$or':_[_0xc633('0x2c')](_0x25fbaf,function(_0x57431e){if(_0x57431e[_0xc633('0x3b')]!=='VIRTUAL'){var _0x5770bd={};_0x5770bd[_0x57431e['name']]={'$like':'%'+_0xd5f7fd['query'][_0xc633('0x39')]+'%'};return _0x5770bd;}})});}_0x151998=_['merge']({},_0x151998,_0xd5f7fd['options']);var _0xc6e46a={'where':_0x151998['where']};return db['OpenchannelQueueReport'][_0xc633('0x20')](_0xc6e46a)[_0xc633('0x26')](function(_0xbe8baf){_0x50a121[_0xc633('0x20')]=_0xbe8baf;if(_0xd5f7fd[_0xc633('0x31')][_0xc633('0x3c')]){_0x151998[_0xc633('0x3d')]=[{'all':!![]}];}return db[_0xc633('0x2d')][_0xc633('0x3e')](_0x151998);})[_0xc633('0x26')](function(_0x40305f){_0x50a121[_0xc633('0x3f')]=_0x40305f;return _0x50a121;})[_0xc633('0x26')](respondWithFilteredResult(_0x48e7e1,_0x151998))[_0xc633('0x40')](handleError(_0x48e7e1,null));};exports[_0xc633('0x41')]=function(_0x77141f,_0xaa5d5e){var _0x2cb260={'raw':!![],'where':{'id':_0x77141f[_0xc633('0x42')]['id']}},_0x5b3319={};_0x5b3319[_0xc633('0x2f')]=_['keys'](db[_0xc633('0x2d')][_0xc633('0x2e')]);_0x5b3319['query']=_[_0xc633('0x30')](_0x77141f['query']);_0x5b3319['filters']=_[_0xc633('0x34')](_0x5b3319[_0xc633('0x2f')],_0x5b3319[_0xc633('0x31')]);_0x2cb260[_0xc633('0x33')]=_[_0xc633('0x34')](_0x5b3319[_0xc633('0x2f')],qs['fields'](_0x77141f[_0xc633('0x31')][_0xc633('0x35')]));_0x2cb260[_0xc633('0x33')]=_0x2cb260[_0xc633('0x33')][_0xc633('0x43')]?_0x2cb260[_0xc633('0x33')]:_0x5b3319[_0xc633('0x2f')];if(_0x77141f['query'][_0xc633('0x3c')]){_0x2cb260[_0xc633('0x3d')]=[{'all':!![]}];}_0x2cb260=_[_0xc633('0x3a')]({},_0x2cb260,_0x77141f[_0xc633('0x44')]);return db[_0xc633('0x2d')][_0xc633('0x45')](_0x2cb260)[_0xc633('0x26')](handleEntityNotFound(_0xaa5d5e,null))[_0xc633('0x26')](respondWithResult(_0xaa5d5e,null))['catch'](handleError(_0xaa5d5e,null));};exports[_0xc633('0x46')]=function(_0x5330e2,_0x4f3d35){return db[_0xc633('0x2d')][_0xc633('0x46')](_0x5330e2['body'],{})['then'](respondWithResult(_0x4f3d35,0xc9))['catch'](handleError(_0x4f3d35,null));};exports['update']=function(_0x5e87b3,_0x565dd4){if(_0x5e87b3[_0xc633('0x47')]['id']){delete _0x5e87b3[_0xc633('0x47')]['id'];}return db[_0xc633('0x2d')][_0xc633('0x45')]({'where':{'id':_0x5e87b3[_0xc633('0x42')]['id']}})['then'](handleEntityNotFound(_0x565dd4,null))[_0xc633('0x26')](saveUpdates(_0x5e87b3[_0xc633('0x47')],null))[_0xc633('0x26')](respondWithResult(_0x565dd4,null))[_0xc633('0x40')](handleError(_0x565dd4,null));};exports[_0xc633('0x48')]=function(_0x17bf73,_0x335d23){return db[_0xc633('0x2d')][_0xc633('0x45')]({'where':{'id':_0x17bf73[_0xc633('0x42')]['id']}})[_0xc633('0x26')](handleEntityNotFound(_0x335d23,null))[_0xc633('0x26')](removeEntity(_0x335d23,null))['catch'](handleError(_0x335d23,null));};exports[_0xc633('0x49')]=function(_0x1d3402,_0xa33e35){return db[_0xc633('0x2d')][_0xc633('0x49')]()[_0xc633('0x26')](respondWithResult(_0xa33e35,null))['catch'](handleError(_0xa33e35,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 9928da6..c5a900b 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.model.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['bluebird','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','../../config/logger','api','moment'];(function(_0x38a9c6,_0x99c948){var _0x4b357c=function(_0x5c42dc){while(--_0x5c42dc){_0x38a9c6['push'](_0x38a9c6['shift']());}};_0x4b357c(++_0x99c948);}(_0xc4aa,0x1b7));var _0xac4a=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0xc4aa[_0xaa1b3e];return _0x454d7d;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x5fc3=['util','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelQueueReport.attributes','exports','define','report_openchannel_queue','uniqueid','lodash'];(function(_0x497038,_0x480501){var _0x478fae=function(_0x49cb72){while(--_0x49cb72){_0x497038['push'](_0x497038['shift']());}};_0x478fae(++_0x480501);}(_0x5fc3,0xa8));var _0x35fc=function(_0xbe40ad,_0x44343c){_0xbe40ad=_0xbe40ad-0x0;var _0x50fac9=_0x5fc3[_0xbe40ad];return _0x50fac9;};'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 11a9e23..6676363 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 _0xe1e3=['raw','debug','catch','OpenchannelQueueReport','update','body','attributes','limit','UpdateOpenchannelQueueReport','lodash','util','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelQueueReport,\x20%s,\x20%s','message','info','result','CreateOpenchannelQueueReport','options'];(function(_0x481103,_0x3e0e73){var _0x5a24fc=function(_0xf1bc6d){while(--_0xf1bc6d){_0x481103['push'](_0x481103['shift']());}};_0x5a24fc(++_0x3e0e73);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0xa960f7,_0x1642d4){_0xa960f7=_0xa960f7-0x0;var _0x3077ef=_0xe1e3[_0xa960f7];return _0x3077ef;};'use strict';var _=require(_0x3e1e('0x0'));var util=require(_0x3e1e('0x1'));var moment=require('moment');var BPromise=require(_0x3e1e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3e1e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x3e1e('0x4'))(_0x3e1e('0x5'));var config=require(_0x3e1e('0x6'));var jayson=require(_0x3e1e('0x7'));var client=jayson[_0x3e1e('0x8')][_0x3e1e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55cfba,_0x1574e5,_0x13926d){return new BPromise(function(_0x2f0e12,_0xa67e35){return client[_0x3e1e('0xa')](_0x55cfba,_0x13926d)[_0x3e1e('0xb')](function(_0x5e7d1f){logger['info']('OpenchannelQueueReport,\x20%s,\x20%s',_0x1574e5,_0x3e1e('0xc'));logger['debug'](_0x3e1e('0xd'),_0x1574e5,_0x3e1e('0xc'),JSON[_0x3e1e('0xe')](_0x5e7d1f));if(_0x5e7d1f['error']){if(_0x5e7d1f[_0x3e1e('0xf')]['code']===0x1f4){logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x1574e5,_0x5e7d1f['error']['message']);return _0xa67e35(_0x5e7d1f[_0x3e1e('0xf')]['message']);}logger['error'](_0x3e1e('0x10'),_0x1574e5,_0x5e7d1f[_0x3e1e('0xf')][_0x3e1e('0x11')]);return _0x2f0e12(_0x5e7d1f['error']['message']);}else{logger[_0x3e1e('0x12')](_0x3e1e('0x10'),_0x1574e5,'request\x20sent');_0x2f0e12(_0x5e7d1f[_0x3e1e('0x13')][_0x3e1e('0x11')]);}})['catch'](function(_0x11c07f){logger['error'](_0x3e1e('0x10'),_0x1574e5,_0x11c07f);_0xa67e35(_0x11c07f);});});}exports[_0x3e1e('0x14')]=function(_0x1d786c){var _0x39eaa7=this;return new Promise(function(_0x791ed8,_0x1c181b){return db['OpenchannelQueueReport']['create'](_0x1d786c['body'],{'raw':_0x1d786c[_0x3e1e('0x15')]?_0x1d786c[_0x3e1e('0x15')][_0x3e1e('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x1c5acd){logger['info'](_0x3e1e('0x14'),_0x1d786c);logger[_0x3e1e('0x17')](_0x3e1e('0x14'),_0x1d786c,JSON['stringify'](_0x1c5acd));_0x791ed8(_0x1c5acd);})[_0x3e1e('0x18')](function(_0x96396){logger[_0x3e1e('0xf')]('CreateOpenchannelQueueReport',_0x96396['message'],_0x1d786c);_0x1c181b(_0x39eaa7[_0x3e1e('0xf')](0x1f4,_0x96396[_0x3e1e('0x11')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x60e6bc){var _0x56ae51=this;return new Promise(function(_0x164b15,_0x33bf0f){return db[_0x3e1e('0x19')][_0x3e1e('0x1a')](_0x60e6bc[_0x3e1e('0x1b')],{'raw':_0x60e6bc[_0x3e1e('0x15')]?_0x60e6bc['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x60e6bc[_0x3e1e('0x15')]?_0x60e6bc[_0x3e1e('0x15')]['where']||null:null,'attributes':_0x60e6bc['options']?_0x60e6bc['options'][_0x3e1e('0x1c')]||null:null,'limit':_0x60e6bc[_0x3e1e('0x15')]?_0x60e6bc['options'][_0x3e1e('0x1d')]||null:null})['then'](function(_0xdfcd93){logger[_0x3e1e('0x12')]('UpdateOpenchannelQueueReport',_0x60e6bc);logger[_0x3e1e('0x17')](_0x3e1e('0x1e'),_0x60e6bc,JSON[_0x3e1e('0xe')](_0xdfcd93));_0x164b15(_0xdfcd93);})['catch'](function(_0xdef39){logger['error']('UpdateOpenchannelQueueReport',_0xdef39['message'],_0x60e6bc);_0x33bf0f(_0x56ae51[_0x3e1e('0xf')](0x1f4,_0xdef39['message']));});});}; \ No newline at end of file +var _0xe820=['OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','catch','UpdateOpenchannelQueueReport','update','where','attributes','limit','info','lodash','moment','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2ff6da,_0x1acdc1){var _0x63edf7=function(_0x3710eb){while(--_0x3710eb){_0x2ff6da['push'](_0x2ff6da['shift']());}};_0x63edf7(++_0x1acdc1);}(_0xe820,0xd2));var _0x0e82=function(_0x573b3e,_0x591d3e){_0x573b3e=_0x573b3e-0x0;var _0x21abf6=_0xe820[_0x573b3e];return _0x21abf6;};'use strict';var _=require(_0x0e82('0x0'));var util=require('util');var moment=require(_0x0e82('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0e82('0x2'));var db=require(_0x0e82('0x3'))['db'];var utils=require(_0x0e82('0x4'));var logger=require('../../config/logger')(_0x0e82('0x5'));var config=require('../../config/environment');var jayson=require(_0x0e82('0x6'));var client=jayson[_0x0e82('0x7')][_0x0e82('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x328b32,_0x2a0f9b,_0x55f277){return new BPromise(function(_0x10013b,_0x33c8a2){return client[_0x0e82('0x9')](_0x328b32,_0x55f277)[_0x0e82('0xa')](function(_0x3b7792){logger['info'](_0x0e82('0xb'),_0x2a0f9b,_0x0e82('0xc'));logger[_0x0e82('0xd')](_0x0e82('0xe'),_0x2a0f9b,_0x0e82('0xc'),JSON[_0x0e82('0xf')](_0x3b7792));if(_0x3b7792[_0x0e82('0x10')]){if(_0x3b7792['error'][_0x0e82('0x11')]===0x1f4){logger[_0x0e82('0x10')](_0x0e82('0xb'),_0x2a0f9b,_0x3b7792[_0x0e82('0x10')][_0x0e82('0x12')]);return _0x33c8a2(_0x3b7792[_0x0e82('0x10')]['message']);}logger[_0x0e82('0x10')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x2a0f9b,_0x3b7792['error'][_0x0e82('0x12')]);return _0x10013b(_0x3b7792['error']['message']);}else{logger['info'](_0x0e82('0xb'),_0x2a0f9b,'request\x20sent');_0x10013b(_0x3b7792['result'][_0x0e82('0x12')]);}})['catch'](function(_0x319303){logger[_0x0e82('0x10')](_0x0e82('0xb'),_0x2a0f9b,_0x319303);_0x33c8a2(_0x319303);});});}exports[_0x0e82('0x13')]=function(_0x53622b){var _0x25ac21=this;return new Promise(function(_0x310aac,_0x3a3ddf){return db[_0x0e82('0x14')][_0x0e82('0x15')](_0x53622b[_0x0e82('0x16')],{'raw':_0x53622b[_0x0e82('0x17')]?_0x53622b[_0x0e82('0x17')][_0x0e82('0x18')]===undefined?!![]:![]:!![]})[_0x0e82('0xa')](function(_0x5903c){logger['info']('CreateOpenchannelQueueReport',_0x53622b);logger[_0x0e82('0xd')](_0x0e82('0x13'),_0x53622b,JSON[_0x0e82('0xf')](_0x5903c));_0x310aac(_0x5903c);})[_0x0e82('0x19')](function(_0xd48046){logger[_0x0e82('0x10')](_0x0e82('0x13'),_0xd48046[_0x0e82('0x12')],_0x53622b);_0x3a3ddf(_0x25ac21['error'](0x1f4,_0xd48046[_0x0e82('0x12')]));});});};exports[_0x0e82('0x1a')]=function(_0x3d6c28){var _0x24f883=this;return new Promise(function(_0x507f08,_0xee85dd){return db[_0x0e82('0x14')][_0x0e82('0x1b')](_0x3d6c28[_0x0e82('0x16')],{'raw':_0x3d6c28['options']?_0x3d6c28[_0x0e82('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d6c28['options']?_0x3d6c28[_0x0e82('0x17')][_0x0e82('0x1c')]||null:null,'attributes':_0x3d6c28['options']?_0x3d6c28[_0x0e82('0x17')][_0x0e82('0x1d')]||null:null,'limit':_0x3d6c28[_0x0e82('0x17')]?_0x3d6c28['options'][_0x0e82('0x1e')]||null:null})[_0x0e82('0xa')](function(_0x4ee65a){logger[_0x0e82('0x1f')]('UpdateOpenchannelQueueReport',_0x3d6c28);logger[_0x0e82('0xd')](_0x0e82('0x1a'),_0x3d6c28,JSON['stringify'](_0x4ee65a));_0x507f08(_0x4ee65a);})[_0x0e82('0x19')](function(_0x268af5){logger[_0x0e82('0x10')]('UpdateOpenchannelQueueReport',_0x268af5['message'],_0x3d6c28);_0xee85dd(_0x24f883[_0x0e82('0x10')](0x1f4,_0x268af5['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 83e9d5f..cc11b3d 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 _0x01c0=['../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x3597c4,_0x4c16d9){var _0x5d931a=function(_0x553ca6){while(--_0x553ca6){_0x3597c4['push'](_0x3597c4['shift']());}};_0x5d931a(++_0x4c16d9);}(_0x01c0,0x1c8));var _0x001c=function(_0x101e7b,_0x4ef05b){_0x101e7b=_0x101e7b-0x0;var _0x4995c0=_0x01c0[_0x101e7b];return _0x4995c0;};'use strict';var multer=require(_0x001c('0x0'));var util=require(_0x001c('0x1'));var path=require('path');var timeout=require(_0x001c('0x2'));var express=require(_0x001c('0x3'));var router=express[_0x001c('0x4')]();var fs_extra=require(_0x001c('0x5'));var auth=require(_0x001c('0x6'));var interaction=require(_0x001c('0x7'));var config=require(_0x001c('0x8'));var controller=require(_0x001c('0x9'));router[_0x001c('0xa')]('/',auth[_0x001c('0xb')](),controller[_0x001c('0xc')]);router[_0x001c('0xa')](_0x001c('0xd'),auth[_0x001c('0xb')](),controller[_0x001c('0xe')]);router['get'](_0x001c('0xf'),auth['isAuthenticated'](),controller[_0x001c('0x10')]);router[_0x001c('0x11')]('/',auth[_0x001c('0xb')](),controller['create']);router[_0x001c('0x12')]('/:id',auth[_0x001c('0xb')](),controller['update']);router[_0x001c('0x13')](_0x001c('0xf'),auth[_0x001c('0xb')](),controller[_0x001c('0x14')]);module[_0x001c('0x15')]=router; \ No newline at end of file +var _0xc20c=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','index','describe','/:id','isAuthenticated','show','create','put','update','delete','util'];(function(_0x4218d0,_0x18aa4c){var _0x2c142c=function(_0x27a612){while(--_0x27a612){_0x4218d0['push'](_0x4218d0['shift']());}};_0x2c142c(++_0x18aa4c);}(_0xc20c,0x1cb));var _0xcc20=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0xc20c[_0x3ea913];return _0x2b4f28;};'use strict';var multer=require('multer');var util=require(_0xcc20('0x0'));var path=require(_0xcc20('0x1'));var timeout=require(_0xcc20('0x2'));var express=require(_0xcc20('0x3'));var router=express[_0xcc20('0x4')]();var fs_extra=require(_0xcc20('0x5'));var auth=require(_0xcc20('0x6'));var interaction=require(_0xcc20('0x7'));var config=require(_0xcc20('0x8'));var controller=require(_0xcc20('0x9'));router[_0xcc20('0xa')]('/',auth['isAuthenticated'](),controller[_0xcc20('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xcc20('0xc')]);router[_0xcc20('0xa')](_0xcc20('0xd'),auth[_0xcc20('0xe')](),controller[_0xcc20('0xf')]);router['post']('/',auth[_0xcc20('0xe')](),controller[_0xcc20('0x10')]);router[_0xcc20('0x11')](_0xcc20('0xd'),auth['isAuthenticated'](),controller[_0xcc20('0x12')]);router[_0xcc20('0x13')]('/:id',auth[_0xcc20('0xe')](),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 5991245..4f47822 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 _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0xf309dc,_0x19d728){var _0x197ef8=function(_0x1e4185){while(--_0x1e4185){_0xf309dc['push'](_0xf309dc['shift']());}};_0x197ef8(++_0x19d728);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x32b8a9,_0x59d62b){_0x32b8a9=_0x32b8a9-0x0;var _0x40105c=_0xf3cd[_0x32b8a9];return _0x40105c;};'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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x343182,_0x550093){var _0x18ae91=function(_0x1c36e7){while(--_0x1c36e7){_0x343182['push'](_0x343182['shift']());}};_0x18ae91(++_0x550093);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 5cea462..3b04843 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 _0x889f=['mustache','util','path','sox','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/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','set','Content-Range','update','destroy','then','sendStatus','error','stack','name','index','OpenchannelTransferReport','fieldName','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','include','find','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','bluebird'];(function(_0x10966c,_0x129ad7){var _0x1486b3=function(_0x51a783){while(--_0x51a783){_0x10966c['push'](_0x10966c['shift']());}};_0x1486b3(++_0x129ad7);}(_0x889f,0x93));var _0xf889=function(_0x359bbe,_0x5b7fcc){_0x359bbe=_0x359bbe-0x0;var _0x1b3353=_0x889f[_0x359bbe];return _0x1b3353;};'use strict';var emlformat=require(_0xf889('0x0'));var rimraf=require(_0xf889('0x1'));var zipdir=require(_0xf889('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf889('0x3'));var moment=require('moment');var BPromise=require(_0xf889('0x4'));var Mustache=require(_0xf889('0x5'));var util=require(_0xf889('0x6'));var path=require(_0xf889('0x7'));var sox=require(_0xf889('0x8'));var csv=require(_0xf889('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf889('0xa'));var _=require(_0xf889('0xb'));var squel=require(_0xf889('0xc'));var crypto=require(_0xf889('0xd'));var jsforce=require(_0xf889('0xe'));var deskjs=require(_0xf889('0xf'));var toCsv=require(_0xf889('0x9'));var querystring=require('querystring');var Papa=require(_0xf889('0x10'));var Redis=require(_0xf889('0x11'));var authService=require(_0xf889('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf889('0x13'));var hardwareService=require(_0xf889('0x14'));var logger=require(_0xf889('0x15'))(_0xf889('0x16'));var utils=require(_0xf889('0x17'));var config=require(_0xf889('0x18'));var licenseUtil=require(_0xf889('0x19'));var db=require(_0xf889('0x1a'))['db'];function respondWithStatusCode(_0x2ae7cd,_0x39ac56){_0x39ac56=_0x39ac56||0xcc;return function(_0x16c49a){if(_0x16c49a){return _0x2ae7cd['sendStatus'](_0x39ac56);}return _0x2ae7cd['status'](_0x39ac56)[_0xf889('0x1b')]();};}function respondWithResult(_0x593059,_0x5977e6){_0x5977e6=_0x5977e6||0xc8;return function(_0x5ddb26){if(_0x5ddb26){return _0x593059[_0xf889('0x1c')](_0x5977e6)[_0xf889('0x1d')](_0x5ddb26);}};}function respondWithFilteredResult(_0x23bd35,_0xb4b02b){return function(_0xfe9bbc){if(_0xfe9bbc){var _0x3b4da9=typeof _0xb4b02b[_0xf889('0x1e')]===_0xf889('0x1f')&&typeof _0xb4b02b[_0xf889('0x20')]===_0xf889('0x1f');var _0x4fbd9c=_0xfe9bbc['count'];var _0x71bb80=_0x3b4da9?0x0:_0xb4b02b['offset'];var _0x4946bb=_0x3b4da9?_0xfe9bbc['count']:_0xb4b02b[_0xf889('0x1e')]+_0xb4b02b['limit'];var _0xb3ff62;if(_0x4946bb>=_0x4fbd9c){_0x4946bb=_0x4fbd9c;_0xb3ff62=0xc8;}else{_0xb3ff62=0xce;}_0x23bd35['status'](_0xb3ff62);return _0x23bd35[_0xf889('0x21')](_0xf889('0x22'),_0x71bb80+'-'+_0x4946bb+'/'+_0x4fbd9c)[_0xf889('0x1d')](_0xfe9bbc);}return null;};}function patchUpdates(_0x44d94c){return function(_0x1630dd){try{jsonpatch['apply'](_0x1630dd,_0x44d94c,!![]);}catch(_0x4d8850){return BPromise['reject'](_0x4d8850);}return _0x1630dd['save']();};}function saveUpdates(_0x2ece99,_0x2e3cd7){return function(_0x34dca8){if(_0x34dca8){return _0x34dca8[_0xf889('0x23')](_0x2ece99)['then'](function(_0x274428){return _0x274428;});}return null;};}function removeEntity(_0x1b32f4,_0x293507){return function(_0x1f69a8){if(_0x1f69a8){return _0x1f69a8[_0xf889('0x24')]()[_0xf889('0x25')](function(){_0x1b32f4[_0xf889('0x1c')](0xcc)[_0xf889('0x1b')]();});}};}function handleEntityNotFound(_0x57c127,_0x1d658c){return function(_0x3b968a){if(!_0x3b968a){_0x57c127[_0xf889('0x26')](0x194);}return _0x3b968a;};}function handleError(_0x32649c,_0x2d121c){_0x2d121c=_0x2d121c||0x1f4;return function(_0x5abfde){logger[_0xf889('0x27')](_0x5abfde[_0xf889('0x28')]);if(_0x5abfde[_0xf889('0x29')]){delete _0x5abfde['name'];}_0x32649c[_0xf889('0x1c')](_0x2d121c)['send'](_0x5abfde);};}exports[_0xf889('0x2a')]=function(_0xb70df0,_0x1bf5bb){var _0x5cdf79={},_0x1ff2f7={},_0x196941={'count':0x0,'rows':[]};var _0x73340b=_['map'](db[_0xf889('0x2b')]['rawAttributes'],function(_0x1e5cc4){return{'name':_0x1e5cc4[_0xf889('0x2c')],'type':_0x1e5cc4['type'][_0xf889('0x2d')]};});_0x1ff2f7['model']=_['map'](_0x73340b,_0xf889('0x29'));_0x1ff2f7[_0xf889('0x2e')]=_[_0xf889('0x2f')](_0xb70df0[_0xf889('0x2e')]);_0x1ff2f7[_0xf889('0x30')]=_[_0xf889('0x31')](_0x1ff2f7[_0xf889('0x32')],_0x1ff2f7['query']);_0x5cdf79['attributes']=_[_0xf889('0x31')](_0x1ff2f7['model'],qs['fields'](_0xb70df0[_0xf889('0x2e')][_0xf889('0x33')]));_0x5cdf79[_0xf889('0x34')]=_0x5cdf79[_0xf889('0x34')][_0xf889('0x35')]?_0x5cdf79['attributes']:_0x1ff2f7[_0xf889('0x32')];if(!_0xb70df0['query'][_0xf889('0x36')](_0xf889('0x37'))){_0x5cdf79[_0xf889('0x20')]=qs[_0xf889('0x20')](_0xb70df0[_0xf889('0x2e')][_0xf889('0x20')]);_0x5cdf79[_0xf889('0x1e')]=qs['offset'](_0xb70df0[_0xf889('0x2e')][_0xf889('0x1e')]);}_0x5cdf79[_0xf889('0x38')]=qs['sort'](_0xb70df0[_0xf889('0x2e')][_0xf889('0x39')]);_0x5cdf79['where']=qs['filters'](_[_0xf889('0x3a')](_0xb70df0[_0xf889('0x2e')],_0x1ff2f7[_0xf889('0x30')]),_0x73340b);if(_0xb70df0[_0xf889('0x2e')][_0xf889('0x3b')]){_0x5cdf79['where']=_[_0xf889('0x3c')](_0x5cdf79[_0xf889('0x3d')],{'$or':_['map'](_0x73340b,function(_0x20b7b4){if(_0x20b7b4['type']!==_0xf889('0x3e')){var _0x570a1c={};_0x570a1c[_0x20b7b4[_0xf889('0x29')]]={'$like':'%'+_0xb70df0[_0xf889('0x2e')][_0xf889('0x3b')]+'%'};return _0x570a1c;}})});}_0x5cdf79=_['merge']({},_0x5cdf79,_0xb70df0[_0xf889('0x3f')]);var _0x179a19={'where':_0x5cdf79[_0xf889('0x3d')]};return db['OpenchannelTransferReport']['count'](_0x179a19)[_0xf889('0x25')](function(_0x15eb2b){_0x196941[_0xf889('0x40')]=_0x15eb2b;if(_0xb70df0['query'][_0xf889('0x41')]){_0x5cdf79['include']=[{'all':!![]}];}return db[_0xf889('0x2b')][_0xf889('0x42')](_0x5cdf79);})[_0xf889('0x25')](function(_0x4adea9){_0x196941[_0xf889('0x43')]=_0x4adea9;return _0x196941;})[_0xf889('0x25')](respondWithFilteredResult(_0x1bf5bb,_0x5cdf79))[_0xf889('0x44')](handleError(_0x1bf5bb,null));};exports[_0xf889('0x45')]=function(_0x1e234e,_0x4c63c8){var _0x37f206={'raw':!![],'where':{'id':_0x1e234e['params']['id']}},_0x45af5f={};_0x45af5f[_0xf889('0x32')]=_[_0xf889('0x2f')](db[_0xf889('0x2b')]['rawAttributes']);_0x45af5f[_0xf889('0x2e')]=_[_0xf889('0x2f')](_0x1e234e[_0xf889('0x2e')]);_0x45af5f[_0xf889('0x30')]=_[_0xf889('0x31')](_0x45af5f[_0xf889('0x32')],_0x45af5f[_0xf889('0x2e')]);_0x37f206[_0xf889('0x34')]=_['intersection'](_0x45af5f[_0xf889('0x32')],qs[_0xf889('0x33')](_0x1e234e[_0xf889('0x2e')][_0xf889('0x33')]));_0x37f206[_0xf889('0x34')]=_0x37f206[_0xf889('0x34')][_0xf889('0x35')]?_0x37f206[_0xf889('0x34')]:_0x45af5f[_0xf889('0x32')];if(_0x1e234e[_0xf889('0x2e')][_0xf889('0x41')]){_0x37f206[_0xf889('0x46')]=[{'all':!![]}];}_0x37f206=_[_0xf889('0x3c')]({},_0x37f206,_0x1e234e[_0xf889('0x3f')]);return db[_0xf889('0x2b')][_0xf889('0x47')](_0x37f206)[_0xf889('0x25')](handleEntityNotFound(_0x4c63c8,null))['then'](respondWithResult(_0x4c63c8,null))['catch'](handleError(_0x4c63c8,null));};exports[_0xf889('0x48')]=function(_0x460f34,_0x3974df){return db[_0xf889('0x2b')]['create'](_0x460f34[_0xf889('0x49')],{})['then'](respondWithResult(_0x3974df,0xc9))[_0xf889('0x44')](handleError(_0x3974df,null));};exports[_0xf889('0x23')]=function(_0x60aa9,_0x982258){if(_0x60aa9['body']['id']){delete _0x60aa9[_0xf889('0x49')]['id'];}return db['OpenchannelTransferReport']['find']({'where':{'id':_0x60aa9[_0xf889('0x4a')]['id']}})[_0xf889('0x25')](handleEntityNotFound(_0x982258,null))['then'](saveUpdates(_0x60aa9['body'],null))['then'](respondWithResult(_0x982258,null))['catch'](handleError(_0x982258,null));};exports[_0xf889('0x24')]=function(_0x4839de,_0x5efa0f){return db[_0xf889('0x2b')]['find']({'where':{'id':_0x4839de['params']['id']}})[_0xf889('0x25')](handleEntityNotFound(_0x5efa0f,null))['then'](removeEntity(_0x5efa0f,null))[_0xf889('0x44')](handleError(_0x5efa0f,null));};exports[_0xf889('0x4b')]=function(_0x4308c1,_0x5a6b01){return db[_0xf889('0x2b')][_0xf889('0x4b')]()[_0xf889('0x25')](respondWithResult(_0x5a6b01,null))[_0xf889('0x44')](handleError(_0x5a6b01,null));}; \ No newline at end of file +var _0x2e87=['intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','merge','type','VIRTUAL','filter','includeAll','include','findAll','rows','show','options','create','body','catch','find','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','OpenchannelTransferReport','rawAttributes','key','model','query','keys','filters'];(function(_0x202179,_0x3c0588){var _0x4ebe14=function(_0x203bdf){while(--_0x203bdf){_0x202179['push'](_0x202179['shift']());}};_0x4ebe14(++_0x3c0588);}(_0x2e87,0x68));var _0x72e8=function(_0x1dac7a,_0x1828ce){_0x1dac7a=_0x1dac7a-0x0;var _0x4cb363=_0x2e87[_0x1dac7a];return _0x4cb363;};'use strict';var emlformat=require(_0x72e8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x72e8('0x1'));var jsonpatch=require(_0x72e8('0x2'));var rp=require(_0x72e8('0x3'));var moment=require(_0x72e8('0x4'));var BPromise=require(_0x72e8('0x5'));var Mustache=require('mustache');var util=require(_0x72e8('0x6'));var path=require(_0x72e8('0x7'));var sox=require(_0x72e8('0x8'));var csv=require(_0x72e8('0x9'));var ejs=require(_0x72e8('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x72e8('0xb'));var squel=require(_0x72e8('0xc'));var crypto=require(_0x72e8('0xd'));var jsforce=require(_0x72e8('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x72e8('0x9'));var querystring=require(_0x72e8('0xf'));var Papa=require(_0x72e8('0x10'));var Redis=require(_0x72e8('0x11'));var authService=require(_0x72e8('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x72e8('0x13'));var logger=require(_0x72e8('0x14'))(_0x72e8('0x15'));var utils=require(_0x72e8('0x16'));var config=require(_0x72e8('0x17'));var licenseUtil=require(_0x72e8('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x822622,_0x2d6dc7){_0x2d6dc7=_0x2d6dc7||0xcc;return function(_0x457fa7){if(_0x457fa7){return _0x822622[_0x72e8('0x19')](_0x2d6dc7);}return _0x822622[_0x72e8('0x1a')](_0x2d6dc7)[_0x72e8('0x1b')]();};}function respondWithResult(_0x182782,_0x3630f1){_0x3630f1=_0x3630f1||0xc8;return function(_0x1c5035){if(_0x1c5035){return _0x182782[_0x72e8('0x1a')](_0x3630f1)[_0x72e8('0x1c')](_0x1c5035);}};}function respondWithFilteredResult(_0x3723e2,_0x864bb0){return function(_0x3270ab){if(_0x3270ab){var _0x286da2=typeof _0x864bb0[_0x72e8('0x1d')]===_0x72e8('0x1e')&&typeof _0x864bb0['limit']==='undefined';var _0x1d4e68=_0x3270ab[_0x72e8('0x1f')];var _0x456003=_0x286da2?0x0:_0x864bb0[_0x72e8('0x1d')];var _0xb4575=_0x286da2?_0x3270ab[_0x72e8('0x1f')]:_0x864bb0['offset']+_0x864bb0['limit'];var _0x47e3dd;if(_0xb4575>=_0x1d4e68){_0xb4575=_0x1d4e68;_0x47e3dd=0xc8;}else{_0x47e3dd=0xce;}_0x3723e2[_0x72e8('0x1a')](_0x47e3dd);return _0x3723e2[_0x72e8('0x20')](_0x72e8('0x21'),_0x456003+'-'+_0xb4575+'/'+_0x1d4e68)[_0x72e8('0x1c')](_0x3270ab);}return null;};}function patchUpdates(_0x393f45){return function(_0x48d166){try{jsonpatch['apply'](_0x48d166,_0x393f45,!![]);}catch(_0x56aac3){return BPromise[_0x72e8('0x22')](_0x56aac3);}return _0x48d166[_0x72e8('0x23')]();};}function saveUpdates(_0x2189f8,_0x533394){return function(_0x544c0f){if(_0x544c0f){return _0x544c0f[_0x72e8('0x24')](_0x2189f8)[_0x72e8('0x25')](function(_0x425e4f){return _0x425e4f;});}return null;};}function removeEntity(_0x4dfbe0,_0x24220b){return function(_0x4b50d){if(_0x4b50d){return _0x4b50d[_0x72e8('0x26')]()[_0x72e8('0x25')](function(){_0x4dfbe0[_0x72e8('0x1a')](0xcc)[_0x72e8('0x1b')]();});}};}function handleEntityNotFound(_0x38d04c,_0x57ae20){return function(_0x405ce0){if(!_0x405ce0){_0x38d04c[_0x72e8('0x19')](0x194);}return _0x405ce0;};}function handleError(_0x4be735,_0x4db77c){_0x4db77c=_0x4db77c||0x1f4;return function(_0x302081){logger[_0x72e8('0x27')](_0x302081[_0x72e8('0x28')]);if(_0x302081[_0x72e8('0x29')]){delete _0x302081[_0x72e8('0x29')];}_0x4be735[_0x72e8('0x1a')](_0x4db77c)[_0x72e8('0x2a')](_0x302081);};}exports[_0x72e8('0x2b')]=function(_0x3d35b6,_0x3668af){var _0x1a2927={},_0x27ba5a={},_0x529a8c={'count':0x0,'rows':[]};var _0x116d62=_[_0x72e8('0x2c')](db[_0x72e8('0x2d')][_0x72e8('0x2e')],function(_0x203417){return{'name':_0x203417['fieldName'],'type':_0x203417['type'][_0x72e8('0x2f')]};});_0x27ba5a[_0x72e8('0x30')]=_['map'](_0x116d62,'name');_0x27ba5a[_0x72e8('0x31')]=_[_0x72e8('0x32')](_0x3d35b6['query']);_0x27ba5a[_0x72e8('0x33')]=_[_0x72e8('0x34')](_0x27ba5a[_0x72e8('0x30')],_0x27ba5a[_0x72e8('0x31')]);_0x1a2927['attributes']=_[_0x72e8('0x34')](_0x27ba5a[_0x72e8('0x30')],qs[_0x72e8('0x35')](_0x3d35b6[_0x72e8('0x31')][_0x72e8('0x35')]));_0x1a2927[_0x72e8('0x36')]=_0x1a2927[_0x72e8('0x36')][_0x72e8('0x37')]?_0x1a2927[_0x72e8('0x36')]:_0x27ba5a[_0x72e8('0x30')];if(!_0x3d35b6[_0x72e8('0x31')][_0x72e8('0x38')](_0x72e8('0x39'))){_0x1a2927['limit']=qs['limit'](_0x3d35b6[_0x72e8('0x31')][_0x72e8('0x3a')]);_0x1a2927[_0x72e8('0x1d')]=qs[_0x72e8('0x1d')](_0x3d35b6['query'][_0x72e8('0x1d')]);}_0x1a2927[_0x72e8('0x3b')]=qs[_0x72e8('0x3c')](_0x3d35b6[_0x72e8('0x31')][_0x72e8('0x3c')]);_0x1a2927[_0x72e8('0x3d')]=qs[_0x72e8('0x33')](_['pick'](_0x3d35b6[_0x72e8('0x31')],_0x27ba5a['filters']),_0x116d62);if(_0x3d35b6[_0x72e8('0x31')]['filter']){_0x1a2927[_0x72e8('0x3d')]=_[_0x72e8('0x3e')](_0x1a2927[_0x72e8('0x3d')],{'$or':_[_0x72e8('0x2c')](_0x116d62,function(_0x26cf3d){if(_0x26cf3d[_0x72e8('0x3f')]!==_0x72e8('0x40')){var _0x440579={};_0x440579[_0x26cf3d[_0x72e8('0x29')]]={'$like':'%'+_0x3d35b6[_0x72e8('0x31')][_0x72e8('0x41')]+'%'};return _0x440579;}})});}_0x1a2927=_[_0x72e8('0x3e')]({},_0x1a2927,_0x3d35b6['options']);var _0xb12767={'where':_0x1a2927['where']};return db[_0x72e8('0x2d')][_0x72e8('0x1f')](_0xb12767)[_0x72e8('0x25')](function(_0x388838){_0x529a8c['count']=_0x388838;if(_0x3d35b6['query'][_0x72e8('0x42')]){_0x1a2927[_0x72e8('0x43')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0x72e8('0x44')](_0x1a2927);})[_0x72e8('0x25')](function(_0x38a1bf){_0x529a8c[_0x72e8('0x45')]=_0x38a1bf;return _0x529a8c;})[_0x72e8('0x25')](respondWithFilteredResult(_0x3668af,_0x1a2927))['catch'](handleError(_0x3668af,null));};exports[_0x72e8('0x46')]=function(_0x3c4fe8,_0x274432){var _0x4c85d2={'raw':!![],'where':{'id':_0x3c4fe8['params']['id']}},_0x4ab4a5={};_0x4ab4a5[_0x72e8('0x30')]=_[_0x72e8('0x32')](db['OpenchannelTransferReport'][_0x72e8('0x2e')]);_0x4ab4a5['query']=_[_0x72e8('0x32')](_0x3c4fe8[_0x72e8('0x31')]);_0x4ab4a5[_0x72e8('0x33')]=_[_0x72e8('0x34')](_0x4ab4a5[_0x72e8('0x30')],_0x4ab4a5['query']);_0x4c85d2['attributes']=_[_0x72e8('0x34')](_0x4ab4a5[_0x72e8('0x30')],qs['fields'](_0x3c4fe8[_0x72e8('0x31')][_0x72e8('0x35')]));_0x4c85d2['attributes']=_0x4c85d2[_0x72e8('0x36')][_0x72e8('0x37')]?_0x4c85d2['attributes']:_0x4ab4a5[_0x72e8('0x30')];if(_0x3c4fe8['query'][_0x72e8('0x42')]){_0x4c85d2['include']=[{'all':!![]}];}_0x4c85d2=_['merge']({},_0x4c85d2,_0x3c4fe8[_0x72e8('0x47')]);return db['OpenchannelTransferReport']['find'](_0x4c85d2)['then'](handleEntityNotFound(_0x274432,null))[_0x72e8('0x25')](respondWithResult(_0x274432,null))['catch'](handleError(_0x274432,null));};exports[_0x72e8('0x48')]=function(_0x15c25d,_0xd0f5bf){return db[_0x72e8('0x2d')][_0x72e8('0x48')](_0x15c25d[_0x72e8('0x49')],{})[_0x72e8('0x25')](respondWithResult(_0xd0f5bf,0xc9))[_0x72e8('0x4a')](handleError(_0xd0f5bf,null));};exports[_0x72e8('0x24')]=function(_0x56583d,_0x15b3fc){if(_0x56583d[_0x72e8('0x49')]['id']){delete _0x56583d[_0x72e8('0x49')]['id'];}return db[_0x72e8('0x2d')][_0x72e8('0x4b')]({'where':{'id':_0x56583d['params']['id']}})[_0x72e8('0x25')](handleEntityNotFound(_0x15b3fc,null))[_0x72e8('0x25')](saveUpdates(_0x56583d['body'],null))['then'](respondWithResult(_0x15b3fc,null))[_0x72e8('0x4a')](handleError(_0x15b3fc,null));};exports[_0x72e8('0x26')]=function(_0x4351f9,_0x1deae1){return db[_0x72e8('0x2d')][_0x72e8('0x4b')]({'where':{'id':_0x4351f9[_0x72e8('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1deae1,null))[_0x72e8('0x25')](removeEntity(_0x1deae1,null))[_0x72e8('0x4a')](handleError(_0x1deae1,null));};exports[_0x72e8('0x4d')]=function(_0x468875,_0x13c4cd){return db['OpenchannelTransferReport'][_0x72e8('0x4d')]()['then'](respondWithResult(_0x13c4cd,null))[_0x72e8('0x4a')](handleError(_0x13c4cd,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 01038a7..2f628f5 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 _0x7f74=['define','report_openchannel_transfer','uniqueid','util','api','moment','bluebird','request-promise','rimraf','./openchannelTransferReport.attributes','exports'];(function(_0x2c8a26,_0x30b103){var _0xd43db5=function(_0x43be11){while(--_0x43be11){_0x2c8a26['push'](_0x2c8a26['shift']());}};_0xd43db5(++_0x30b103);}(_0x7f74,0xa8));var _0x47f7=function(_0x1e0a4a,_0x55752e){_0x1e0a4a=_0x1e0a4a-0x0;var _0x352afd=_0x7f74[_0x1e0a4a];return _0x352afd;};'use strict';var _=require('lodash');var util=require(_0x47f7('0x0'));var logger=require('../../config/logger')(_0x47f7('0x1'));var moment=require(_0x47f7('0x2'));var BPromise=require(_0x47f7('0x3'));var rp=require(_0x47f7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x47f7('0x5'));var config=require('../../config/environment');var attributes=require(_0x47f7('0x6'));module[_0x47f7('0x7')]=function(_0x59372b,_0x325bab){return _0x59372b[_0x47f7('0x8')]('OpenchannelTransferReport',attributes,{'tableName':_0x47f7('0x9'),'paranoid':![],'indexes':[{'name':_0x47f7('0xa'),'fields':[_0x47f7('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x688c=['OpenchannelTransferReport','report_openchannel_transfer','lodash','util','../../config/logger','bluebird','path','rimraf','./openchannelTransferReport.attributes','define'];(function(_0x3ffb4c,_0x2f9caa){var _0x194a24=function(_0x2c808f){while(--_0x2c808f){_0x3ffb4c['push'](_0x3ffb4c['shift']());}};_0x194a24(++_0x2f9caa);}(_0x688c,0x84));var _0xc688=function(_0x1ca25c,_0x231b67){_0x1ca25c=_0x1ca25c-0x0;var _0x271eb6=_0x688c[_0x1ca25c];return _0x271eb6;};'use strict';var _=require(_0xc688('0x0'));var util=require(_0xc688('0x1'));var logger=require(_0xc688('0x2'))('api');var moment=require('moment');var BPromise=require(_0xc688('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc688('0x4'));var rimraf=require(_0xc688('0x5'));var config=require('../../config/environment');var attributes=require(_0xc688('0x6'));module['exports']=function(_0x196b53,_0x15dca0){return _0x196b53[_0xc688('0x7')](_0xc688('0x8'),attributes,{'tableName':_0xc688('0x9'),'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 ec51a9b..ac60c58 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 _0x6d19=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelTransferReport,\x20%s,\x20%s','message','request\x20sent'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x6d19,0x160));var _0x96d1=function(_0x8a969d,_0x339d9f){_0x8a969d=_0x8a969d-0x0;var _0x1d8dc7=_0x6d19[_0x8a969d];return _0x1d8dc7;};'use strict';var _=require(_0x96d1('0x0'));var util=require(_0x96d1('0x1'));var moment=require(_0x96d1('0x2'));var BPromise=require(_0x96d1('0x3'));var rs=require(_0x96d1('0x4'));var fs=require('fs');var Redis=require(_0x96d1('0x5'));var db=require(_0x96d1('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x96d1('0x7'))(_0x96d1('0x8'));var config=require(_0x96d1('0x9'));var jayson=require(_0x96d1('0xa'));var client=jayson['client'][_0x96d1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x230638,_0x61e0f5,_0x58ade3){return new BPromise(function(_0xba2d03,_0x3f7a36){return client[_0x96d1('0xc')](_0x230638,_0x58ade3)[_0x96d1('0xd')](function(_0x37b251){logger[_0x96d1('0xe')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x61e0f5,'request\x20sent');logger[_0x96d1('0xf')](_0x96d1('0x10'),_0x61e0f5,'request\x20sent',JSON[_0x96d1('0x11')](_0x37b251));if(_0x37b251['error']){if(_0x37b251[_0x96d1('0x12')][_0x96d1('0x13')]===0x1f4){logger[_0x96d1('0x12')](_0x96d1('0x14'),_0x61e0f5,_0x37b251[_0x96d1('0x12')][_0x96d1('0x15')]);return _0x3f7a36(_0x37b251['error'][_0x96d1('0x15')]);}logger[_0x96d1('0x12')](_0x96d1('0x14'),_0x61e0f5,_0x37b251[_0x96d1('0x12')][_0x96d1('0x15')]);return _0xba2d03(_0x37b251['error']['message']);}else{logger[_0x96d1('0xe')](_0x96d1('0x14'),_0x61e0f5,_0x96d1('0x16'));_0xba2d03(_0x37b251[_0x96d1('0x17')][_0x96d1('0x15')]);}})[_0x96d1('0x18')](function(_0x45dc6f){logger[_0x96d1('0x12')](_0x96d1('0x14'),_0x61e0f5,_0x45dc6f);_0x3f7a36(_0x45dc6f);});});} \ No newline at end of file +var _0x7d9f=['../../config/environment','http','request','info','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','OpenchannelTransferReport,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x47af5c,_0x40643c){var _0x14e664=function(_0xca3726){while(--_0xca3726){_0x47af5c['push'](_0x47af5c['shift']());}};_0x14e664(++_0x40643c);}(_0x7d9f,0x15c));var _0xf7d9=function(_0x58df3b,_0x182132){_0x58df3b=_0x58df3b-0x0;var _0x1c82d6=_0x7d9f[_0x58df3b];return _0x1c82d6;};'use strict';var _=require(_0xf7d9('0x0'));var util=require(_0xf7d9('0x1'));var moment=require(_0xf7d9('0x2'));var BPromise=require(_0xf7d9('0x3'));var rs=require(_0xf7d9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf7d9('0x5'))['db'];var utils=require(_0xf7d9('0x6'));var logger=require(_0xf7d9('0x7'))(_0xf7d9('0x8'));var config=require(_0xf7d9('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf7d9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x250675,_0x5772b4,_0x21c654){return new BPromise(function(_0x1685a6,_0x5e4087){return client[_0xf7d9('0xb')](_0x250675,_0x21c654)['then'](function(_0x265548){logger[_0xf7d9('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x5772b4,'request\x20sent');logger[_0xf7d9('0xd')](_0xf7d9('0xe'),_0x5772b4,_0xf7d9('0xf'),JSON['stringify'](_0x265548));if(_0x265548['error']){if(_0x265548[_0xf7d9('0x10')][_0xf7d9('0x11')]===0x1f4){logger[_0xf7d9('0x10')](_0xf7d9('0x12'),_0x5772b4,_0x265548['error'][_0xf7d9('0x13')]);return _0x5e4087(_0x265548[_0xf7d9('0x10')][_0xf7d9('0x13')]);}logger[_0xf7d9('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x5772b4,_0x265548[_0xf7d9('0x10')][_0xf7d9('0x13')]);return _0x1685a6(_0x265548[_0xf7d9('0x10')][_0xf7d9('0x13')]);}else{logger['info'](_0xf7d9('0x12'),_0x5772b4,_0xf7d9('0xf'));_0x1685a6(_0x265548[_0xf7d9('0x14')]['message']);}})['catch'](function(_0x35751e){logger[_0xf7d9('0x10')](_0xf7d9('0x12'),_0x5772b4,_0x35751e);_0x5e4087(_0x35751e);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 296ea48..2356e95 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 _0xd72b=['show','post','create','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','./pause.controller','isAuthenticated','index','/:id'];(function(_0x35e75a,_0x5ed225){var _0xb23c7f=function(_0x2fa40c){while(--_0x2fa40c){_0x35e75a['push'](_0x35e75a['shift']());}};_0xb23c7f(++_0x5ed225);}(_0xd72b,0x1ed));var _0xbd72=function(_0x202a1c,_0x35104a){_0x202a1c=_0x202a1c-0x0;var _0x33a1b5=_0xd72b[_0x202a1c];return _0x33a1b5;};'use strict';var multer=require(_0xbd72('0x0'));var util=require(_0xbd72('0x1'));var path=require('path');var timeout=require(_0xbd72('0x2'));var express=require(_0xbd72('0x3'));var router=express[_0xbd72('0x4')]();var fs_extra=require(_0xbd72('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xbd72('0x6'));var controller=require(_0xbd72('0x7'));router['get']('/',auth[_0xbd72('0x8')](),controller[_0xbd72('0x9')]);router['get'](_0xbd72('0xa'),auth['isAuthenticated'](),controller[_0xbd72('0xb')]);router[_0xbd72('0xc')]('/',auth[_0xbd72('0x8')](),controller[_0xbd72('0xd')]);router[_0xbd72('0xe')](_0xbd72('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xbd72('0xf')](_0xbd72('0xa'),auth[_0xbd72('0x8')](),controller[_0xbd72('0x10')]);module[_0xbd72('0x11')]=router; \ No newline at end of file +var _0xea67=['./pause.controller','get','isAuthenticated','index','/:id','show','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0xa46b86,_0x5c1465){var _0x417360=function(_0x4800d1){while(--_0x4800d1){_0xa46b86['push'](_0xa46b86['shift']());}};_0x417360(++_0x5c1465);}(_0xea67,0x172));var _0x7ea6=function(_0x2d4065,_0x38dc95){_0x2d4065=_0x2d4065-0x0;var _0xef6016=_0xea67[_0x2d4065];return _0xef6016;};'use strict';var multer=require(_0x7ea6('0x0'));var util=require(_0x7ea6('0x1'));var path=require(_0x7ea6('0x2'));var timeout=require(_0x7ea6('0x3'));var express=require('express');var router=express[_0x7ea6('0x4')]();var fs_extra=require(_0x7ea6('0x5'));var auth=require(_0x7ea6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7ea6('0x7'));var controller=require(_0x7ea6('0x8'));router[_0x7ea6('0x9')]('/',auth[_0x7ea6('0xa')](),controller[_0x7ea6('0xb')]);router[_0x7ea6('0x9')](_0x7ea6('0xc'),auth[_0x7ea6('0xa')](),controller[_0x7ea6('0xd')]);router['post']('/',auth[_0x7ea6('0xa')](),controller['create']);router[_0x7ea6('0xe')](_0x7ea6('0xc'),auth[_0x7ea6('0xa')](),controller[_0x7ea6('0xf')]);router['delete']('/:id',auth[_0x7ea6('0xa')](),controller[_0x7ea6('0x10')]);module[_0x7ea6('0x11')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 49e5fb1..7aaed9c 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 _0x9bbf=['STRING','sequelize','exports','name'];(function(_0xef5b1b,_0x7864fa){var _0x1ab573=function(_0x57216f){while(--_0x57216f){_0xef5b1b['push'](_0xef5b1b['shift']());}};_0x1ab573(++_0x7864fa);}(_0x9bbf,0x195));var _0xf9bb=function(_0x35ae04,_0x136ba2){_0x35ae04=_0x35ae04-0x0;var _0x4309b5=_0x9bbf[_0x35ae04];return _0x4309b5;};'use strict';var Sequelize=require(_0xf9bb('0x0'));module[_0xf9bb('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xf9bb('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xf9bb('0x3')]}}; \ No newline at end of file +var _0x4a5a=['STRING','name','exports'];(function(_0x258c92,_0x5e0703){var _0x4fd293=function(_0x2f8d29){while(--_0x2f8d29){_0x258c92['push'](_0x258c92['shift']());}};_0x4fd293(++_0x5e0703);}(_0x4a5a,0x110));var _0xa4a5=function(_0x2037ca,_0x2b9aff){_0x2037ca=_0x2037ca-0x0;var _0x2aac8a=_0x4a5a[_0x2037ca];return _0x2aac8a;};'use strict';var Sequelize=require('sequelize');module[_0xa4a5('0x0')]={'name':{'type':Sequelize[_0xa4a5('0x1')],'unique':_0xa4a5('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xa4a5('0x1')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 9b1dec8..8f255f9 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 _0xabd0=['offset','set','Content-Range','reject','save','update','destroy','then','Pauses','UserProfileResource','sendStatus','error','stack','name','send','index','map','Pause','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','include','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count'];(function(_0x4a6916,_0x44167b){var _0x4bc634=function(_0x307fc3){while(--_0x307fc3){_0x4a6916['push'](_0x4a6916['shift']());}};_0x4bc634(++_0x44167b);}(_0xabd0,0x12b));var _0x0abd=function(_0x20eba2,_0x3ad529){_0x20eba2=_0x20eba2-0x0;var _0x28c4bf=_0xabd0[_0x20eba2];return _0x28c4bf;};'use strict';var emlformat=require(_0x0abd('0x0'));var rimraf=require(_0x0abd('0x1'));var zipdir=require(_0x0abd('0x2'));var jsonpatch=require(_0x0abd('0x3'));var rp=require('request-promise');var moment=require(_0x0abd('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0abd('0x5'));var path=require('path');var sox=require(_0x0abd('0x6'));var csv=require(_0x0abd('0x7'));var ejs=require(_0x0abd('0x8'));var fs=require('fs');var fs_extra=require(_0x0abd('0x9'));var _=require(_0x0abd('0xa'));var squel=require(_0x0abd('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0abd('0xc'));var toCsv=require('to-csv');var querystring=require(_0x0abd('0xd'));var Papa=require('papaparse');var Redis=require(_0x0abd('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x0abd('0xf'));var as=require(_0x0abd('0x10'));var hardwareService=require(_0x0abd('0x11'));var logger=require(_0x0abd('0x12'))(_0x0abd('0x13'));var utils=require(_0x0abd('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x0abd('0x15'));var db=require(_0x0abd('0x16'))['db'];function respondWithStatusCode(_0x62ca4e,_0x4d82c5){_0x4d82c5=_0x4d82c5||0xcc;return function(_0x36f9bf){if(_0x36f9bf){return _0x62ca4e['sendStatus'](_0x4d82c5);}return _0x62ca4e[_0x0abd('0x17')](_0x4d82c5)[_0x0abd('0x18')]();};}function respondWithResult(_0x5a1e06,_0x293750){_0x293750=_0x293750||0xc8;return function(_0x5e3d2e){if(_0x5e3d2e){return _0x5a1e06[_0x0abd('0x17')](_0x293750)[_0x0abd('0x19')](_0x5e3d2e);}};}function respondWithFilteredResult(_0x1f2df7,_0x19d10d){return function(_0x4abf50){if(_0x4abf50){var _0x938d52=typeof _0x19d10d['offset']===_0x0abd('0x1a')&&typeof _0x19d10d[_0x0abd('0x1b')]==='undefined';var _0x1498d0=_0x4abf50['count'];var _0x4a370b=_0x938d52?0x0:_0x19d10d['offset'];var _0x16eb5b=_0x938d52?_0x4abf50[_0x0abd('0x1c')]:_0x19d10d[_0x0abd('0x1d')]+_0x19d10d[_0x0abd('0x1b')];var _0x25b7a7;if(_0x16eb5b>=_0x1498d0){_0x16eb5b=_0x1498d0;_0x25b7a7=0xc8;}else{_0x25b7a7=0xce;}_0x1f2df7[_0x0abd('0x17')](_0x25b7a7);return _0x1f2df7[_0x0abd('0x1e')](_0x0abd('0x1f'),_0x4a370b+'-'+_0x16eb5b+'/'+_0x1498d0)[_0x0abd('0x19')](_0x4abf50);}return null;};}function patchUpdates(_0x3b7844){return function(_0x5af5c9){try{jsonpatch['apply'](_0x5af5c9,_0x3b7844,!![]);}catch(_0x25887c){return BPromise[_0x0abd('0x20')](_0x25887c);}return _0x5af5c9[_0x0abd('0x21')]();};}function saveUpdates(_0x1729ba,_0x2a2a6a){return function(_0x4d0de5){if(_0x4d0de5){return _0x4d0de5[_0x0abd('0x22')](_0x1729ba)['then'](function(_0x501b79){return _0x501b79;});}return null;};}function removeEntity(_0x41ea69,_0x591e6b){return function(_0xadaa0d){if(_0xadaa0d){return _0xadaa0d[_0x0abd('0x23')]()[_0x0abd('0x24')](function(){var _0x108923=_0xadaa0d['get']({'plain':!![]});var _0x31d4b3=_0x0abd('0x25');return db[_0x0abd('0x26')][_0x0abd('0x23')]({'where':{'type':_0x31d4b3,'resourceId':_0x108923['id']}})['then'](function(){return _0xadaa0d;});})[_0x0abd('0x24')](function(){_0x41ea69[_0x0abd('0x17')](0xcc)[_0x0abd('0x18')]();});}};}function handleEntityNotFound(_0x430b11,_0x3f4570){return function(_0x321b63){if(!_0x321b63){_0x430b11[_0x0abd('0x27')](0x194);}return _0x321b63;};}function handleError(_0x36402a,_0x2ab534){_0x2ab534=_0x2ab534||0x1f4;return function(_0x283b66){logger[_0x0abd('0x28')](_0x283b66[_0x0abd('0x29')]);if(_0x283b66['name']){delete _0x283b66[_0x0abd('0x2a')];}_0x36402a['status'](_0x2ab534)[_0x0abd('0x2b')](_0x283b66);};}exports[_0x0abd('0x2c')]=function(_0x2db95a,_0x4c4ab1){var _0x1c0ed6={},_0x1de62b={},_0x7d5af7={'count':0x0,'rows':[]};var _0x34e900=_[_0x0abd('0x2d')](db[_0x0abd('0x2e')][_0x0abd('0x2f')],function(_0x327de7){return{'name':_0x327de7[_0x0abd('0x30')],'type':_0x327de7[_0x0abd('0x31')][_0x0abd('0x32')]};});_0x1de62b[_0x0abd('0x33')]=_[_0x0abd('0x2d')](_0x34e900,_0x0abd('0x2a'));_0x1de62b[_0x0abd('0x34')]=_[_0x0abd('0x35')](_0x2db95a['query']);_0x1de62b[_0x0abd('0x36')]=_[_0x0abd('0x37')](_0x1de62b['model'],_0x1de62b[_0x0abd('0x34')]);_0x1c0ed6[_0x0abd('0x38')]=_[_0x0abd('0x37')](_0x1de62b[_0x0abd('0x33')],qs[_0x0abd('0x39')](_0x2db95a[_0x0abd('0x34')][_0x0abd('0x39')]));_0x1c0ed6[_0x0abd('0x38')]=_0x1c0ed6[_0x0abd('0x38')][_0x0abd('0x3a')]?_0x1c0ed6[_0x0abd('0x38')]:_0x1de62b[_0x0abd('0x33')];if(!_0x2db95a[_0x0abd('0x34')][_0x0abd('0x3b')]('nolimit')){_0x1c0ed6[_0x0abd('0x1b')]=qs[_0x0abd('0x1b')](_0x2db95a[_0x0abd('0x34')][_0x0abd('0x1b')]);_0x1c0ed6[_0x0abd('0x1d')]=qs['offset'](_0x2db95a[_0x0abd('0x34')][_0x0abd('0x1d')]);}_0x1c0ed6[_0x0abd('0x3c')]=qs[_0x0abd('0x3d')](_0x2db95a[_0x0abd('0x34')][_0x0abd('0x3d')]);_0x1c0ed6[_0x0abd('0x3e')]=qs['filters'](_[_0x0abd('0x3f')](_0x2db95a[_0x0abd('0x34')],_0x1de62b['filters']),_0x34e900);if(_0x2db95a[_0x0abd('0x34')][_0x0abd('0x40')]){_0x1c0ed6['where']=_[_0x0abd('0x41')](_0x1c0ed6[_0x0abd('0x3e')],{'$or':_['map'](_0x34e900,function(_0x456f18){if(_0x456f18[_0x0abd('0x31')]!==_0x0abd('0x42')){var _0x4eb4e0={};_0x4eb4e0[_0x456f18['name']]={'$like':'%'+_0x2db95a['query'][_0x0abd('0x40')]+'%'};return _0x4eb4e0;}})});}_0x1c0ed6=_[_0x0abd('0x41')]({},_0x1c0ed6,_0x2db95a[_0x0abd('0x43')]);var _0x13d5dd={'where':_0x1c0ed6[_0x0abd('0x3e')]};return db['Pause'][_0x0abd('0x1c')](_0x13d5dd)[_0x0abd('0x24')](function(_0x42f08a){_0x7d5af7[_0x0abd('0x1c')]=_0x42f08a;if(_0x2db95a[_0x0abd('0x34')][_0x0abd('0x44')]){_0x1c0ed6['include']=[{'all':!![]}];}return db[_0x0abd('0x2e')][_0x0abd('0x45')](_0x1c0ed6);})[_0x0abd('0x24')](function(_0x531e62){_0x7d5af7[_0x0abd('0x46')]=_0x531e62;return _0x7d5af7;})[_0x0abd('0x24')](respondWithFilteredResult(_0x4c4ab1,_0x1c0ed6))[_0x0abd('0x47')](handleError(_0x4c4ab1,null));};exports['show']=function(_0x4b4a92,_0x17e8e7){var _0x2a39b7={'raw':!![],'where':{'id':_0x4b4a92['params']['id']}},_0x24ccb0={};_0x24ccb0['model']=_['keys'](db[_0x0abd('0x2e')][_0x0abd('0x2f')]);_0x24ccb0[_0x0abd('0x34')]=_[_0x0abd('0x35')](_0x4b4a92[_0x0abd('0x34')]);_0x24ccb0[_0x0abd('0x36')]=_[_0x0abd('0x37')](_0x24ccb0[_0x0abd('0x33')],_0x24ccb0[_0x0abd('0x34')]);_0x2a39b7['attributes']=_['intersection'](_0x24ccb0[_0x0abd('0x33')],qs[_0x0abd('0x39')](_0x4b4a92['query'][_0x0abd('0x39')]));_0x2a39b7[_0x0abd('0x38')]=_0x2a39b7[_0x0abd('0x38')][_0x0abd('0x3a')]?_0x2a39b7[_0x0abd('0x38')]:_0x24ccb0[_0x0abd('0x33')];if(_0x4b4a92[_0x0abd('0x34')][_0x0abd('0x44')]){_0x2a39b7[_0x0abd('0x48')]=[{'all':!![]}];}_0x2a39b7=_[_0x0abd('0x41')]({},_0x2a39b7,_0x4b4a92['options']);return db[_0x0abd('0x2e')]['find'](_0x2a39b7)['then'](handleEntityNotFound(_0x17e8e7,null))[_0x0abd('0x24')](respondWithResult(_0x17e8e7,null))[_0x0abd('0x47')](handleError(_0x17e8e7,null));};exports[_0x0abd('0x49')]=function(_0x301208,_0x4c546a){return db[_0x0abd('0x2e')][_0x0abd('0x49')](_0x301208['body'],{})[_0x0abd('0x24')](function(_0x282696){var _0x14cd4e=_0x301208[_0x0abd('0x4a')][_0x0abd('0x4b')]({'plain':!![]});if(!_0x14cd4e)throw new Error(_0x0abd('0x4c'));if(_0x14cd4e[_0x0abd('0x4d')]===_0x0abd('0x4a')){var _0x98e117=_0x282696['get']({'plain':!![]});var _0x78861c=_0x0abd('0x25');return db['UserProfileSection'][_0x0abd('0x4e')]({'where':{'name':_0x78861c,'userProfileId':_0x14cd4e['userProfileId']},'raw':!![]})[_0x0abd('0x24')](function(_0x2c2e30){if(_0x2c2e30&&_0x2c2e30['autoAssociation']===0x0){return db[_0x0abd('0x26')]['create']({'name':_0x98e117[_0x0abd('0x2a')],'resourceId':_0x98e117['id'],'type':_0x2c2e30[_0x0abd('0x2a')],'sectionId':_0x2c2e30['id']},{})[_0x0abd('0x24')](function(){return _0x282696;});}else{return _0x282696;}})[_0x0abd('0x47')](function(_0x490944){logger['error'](_0x0abd('0x4f'),_0x490944);throw _0x490944;});}return _0x282696;})['then'](respondWithResult(_0x4c546a,0xc9))[_0x0abd('0x47')](handleError(_0x4c546a,null));};exports['update']=function(_0x6f0e81,_0x163059){if(_0x6f0e81['body']['id']){delete _0x6f0e81[_0x0abd('0x50')]['id'];}return db['Pause'][_0x0abd('0x4e')]({'where':{'id':_0x6f0e81[_0x0abd('0x51')]['id']}})[_0x0abd('0x24')](handleEntityNotFound(_0x163059,null))[_0x0abd('0x24')](saveUpdates(_0x6f0e81['body'],null))[_0x0abd('0x24')](respondWithResult(_0x163059,null))[_0x0abd('0x47')](handleError(_0x163059,null));};exports[_0x0abd('0x23')]=function(_0x349365,_0x39a285){return db[_0x0abd('0x2e')][_0x0abd('0x4e')]({'where':{'id':_0x349365['params']['id']}})[_0x0abd('0x24')](handleEntityNotFound(_0x39a285,null))['then'](removeEntity(_0x39a285,null))[_0x0abd('0x47')](handleError(_0x39a285,null));}; \ No newline at end of file +var _0xd0fc=['reject','save','then','destroy','get','UserProfileResource','error','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','Pause','count','includeAll','findAll','rows','catch','params','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','Content-Range','apply'];(function(_0x5524a1,_0x37c171){var _0x4ea5e3=function(_0x493ee1){while(--_0x493ee1){_0x5524a1['push'](_0x5524a1['shift']());}};_0x4ea5e3(++_0x37c171);}(_0xd0fc,0x129));var _0xcd0f=function(_0x432394,_0x4b2305){_0x432394=_0x432394-0x0;var _0x2bb7a8=_0xd0fc[_0x432394];return _0x2bb7a8;};'use strict';var emlformat=require(_0xcd0f('0x0'));var rimraf=require(_0xcd0f('0x1'));var zipdir=require(_0xcd0f('0x2'));var jsonpatch=require(_0xcd0f('0x3'));var rp=require(_0xcd0f('0x4'));var moment=require(_0xcd0f('0x5'));var BPromise=require(_0xcd0f('0x6'));var Mustache=require(_0xcd0f('0x7'));var util=require('util');var path=require(_0xcd0f('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xcd0f('0x9'));var fs=require('fs');var fs_extra=require(_0xcd0f('0xa'));var _=require(_0xcd0f('0xb'));var squel=require('squel');var crypto=require(_0xcd0f('0xc'));var jsforce=require(_0xcd0f('0xd'));var deskjs=require(_0xcd0f('0xe'));var toCsv=require(_0xcd0f('0xf'));var querystring=require('querystring');var Papa=require(_0xcd0f('0x10'));var Redis=require(_0xcd0f('0x11'));var authService=require(_0xcd0f('0x12'));var qs=require(_0xcd0f('0x13'));var as=require(_0xcd0f('0x14'));var hardwareService=require(_0xcd0f('0x15'));var logger=require(_0xcd0f('0x16'))(_0xcd0f('0x17'));var utils=require(_0xcd0f('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xcd0f('0x19'))['db'];function respondWithStatusCode(_0x5b7688,_0xbc807a){_0xbc807a=_0xbc807a||0xcc;return function(_0x14cfe6){if(_0x14cfe6){return _0x5b7688[_0xcd0f('0x1a')](_0xbc807a);}return _0x5b7688['status'](_0xbc807a)[_0xcd0f('0x1b')]();};}function respondWithResult(_0x477bbf,_0x2502d0){_0x2502d0=_0x2502d0||0xc8;return function(_0x449f6b){if(_0x449f6b){return _0x477bbf[_0xcd0f('0x1c')](_0x2502d0)[_0xcd0f('0x1d')](_0x449f6b);}};}function respondWithFilteredResult(_0x437fba,_0x2cdbe1){return function(_0x71f302){if(_0x71f302){var _0x5d0df6=typeof _0x2cdbe1[_0xcd0f('0x1e')]==='undefined'&&typeof _0x2cdbe1['limit']===_0xcd0f('0x1f');var _0x2cb5ee=_0x71f302['count'];var _0x58225c=_0x5d0df6?0x0:_0x2cdbe1[_0xcd0f('0x1e')];var _0x35ffe5=_0x5d0df6?_0x71f302['count']:_0x2cdbe1[_0xcd0f('0x1e')]+_0x2cdbe1[_0xcd0f('0x20')];var _0x4b1eb2;if(_0x35ffe5>=_0x2cb5ee){_0x35ffe5=_0x2cb5ee;_0x4b1eb2=0xc8;}else{_0x4b1eb2=0xce;}_0x437fba['status'](_0x4b1eb2);return _0x437fba['set'](_0xcd0f('0x21'),_0x58225c+'-'+_0x35ffe5+'/'+_0x2cb5ee)[_0xcd0f('0x1d')](_0x71f302);}return null;};}function patchUpdates(_0x4b5252){return function(_0x14a79a){try{jsonpatch[_0xcd0f('0x22')](_0x14a79a,_0x4b5252,!![]);}catch(_0x92618f){return BPromise[_0xcd0f('0x23')](_0x92618f);}return _0x14a79a[_0xcd0f('0x24')]();};}function saveUpdates(_0x238cd4,_0x2cdc9c){return function(_0xd61d3){if(_0xd61d3){return _0xd61d3['update'](_0x238cd4)[_0xcd0f('0x25')](function(_0x5585ba){return _0x5585ba;});}return null;};}function removeEntity(_0xbeade6,_0x4e5a41){return function(_0x412fe7){if(_0x412fe7){return _0x412fe7[_0xcd0f('0x26')]()[_0xcd0f('0x25')](function(){var _0x4da61f=_0x412fe7[_0xcd0f('0x27')]({'plain':!![]});var _0x335eef='Pauses';return db[_0xcd0f('0x28')][_0xcd0f('0x26')]({'where':{'type':_0x335eef,'resourceId':_0x4da61f['id']}})[_0xcd0f('0x25')](function(){return _0x412fe7;});})[_0xcd0f('0x25')](function(){_0xbeade6[_0xcd0f('0x1c')](0xcc)[_0xcd0f('0x1b')]();});}};}function handleEntityNotFound(_0x53a570,_0x58785a){return function(_0xea26d9){if(!_0xea26d9){_0x53a570[_0xcd0f('0x1a')](0x194);}return _0xea26d9;};}function handleError(_0xc201f7,_0x1469fb){_0x1469fb=_0x1469fb||0x1f4;return function(_0x12903f){logger[_0xcd0f('0x29')](_0x12903f['stack']);if(_0x12903f[_0xcd0f('0x2a')]){delete _0x12903f['name'];}_0xc201f7['status'](_0x1469fb)[_0xcd0f('0x2b')](_0x12903f);};}exports['index']=function(_0x4c3c93,_0xd6e12e){var _0x1abbdf={},_0x1c3b1d={},_0x14ea98={'count':0x0,'rows':[]};var _0x9e0280=_[_0xcd0f('0x2c')](db['Pause'][_0xcd0f('0x2d')],function(_0x312b8e){return{'name':_0x312b8e[_0xcd0f('0x2e')],'type':_0x312b8e[_0xcd0f('0x2f')][_0xcd0f('0x30')]};});_0x1c3b1d[_0xcd0f('0x31')]=_['map'](_0x9e0280,_0xcd0f('0x2a'));_0x1c3b1d[_0xcd0f('0x32')]=_[_0xcd0f('0x33')](_0x4c3c93[_0xcd0f('0x32')]);_0x1c3b1d[_0xcd0f('0x34')]=_['intersection'](_0x1c3b1d['model'],_0x1c3b1d[_0xcd0f('0x32')]);_0x1abbdf[_0xcd0f('0x35')]=_[_0xcd0f('0x36')](_0x1c3b1d[_0xcd0f('0x31')],qs[_0xcd0f('0x37')](_0x4c3c93[_0xcd0f('0x32')][_0xcd0f('0x37')]));_0x1abbdf[_0xcd0f('0x35')]=_0x1abbdf[_0xcd0f('0x35')][_0xcd0f('0x38')]?_0x1abbdf[_0xcd0f('0x35')]:_0x1c3b1d[_0xcd0f('0x31')];if(!_0x4c3c93['query']['hasOwnProperty'](_0xcd0f('0x39'))){_0x1abbdf[_0xcd0f('0x20')]=qs['limit'](_0x4c3c93['query'][_0xcd0f('0x20')]);_0x1abbdf[_0xcd0f('0x1e')]=qs[_0xcd0f('0x1e')](_0x4c3c93[_0xcd0f('0x32')][_0xcd0f('0x1e')]);}_0x1abbdf['order']=qs['sort'](_0x4c3c93[_0xcd0f('0x32')][_0xcd0f('0x3a')]);_0x1abbdf[_0xcd0f('0x3b')]=qs[_0xcd0f('0x34')](_[_0xcd0f('0x3c')](_0x4c3c93[_0xcd0f('0x32')],_0x1c3b1d[_0xcd0f('0x34')]),_0x9e0280);if(_0x4c3c93['query'][_0xcd0f('0x3d')]){_0x1abbdf['where']=_[_0xcd0f('0x3e')](_0x1abbdf[_0xcd0f('0x3b')],{'$or':_[_0xcd0f('0x2c')](_0x9e0280,function(_0x1b9596){if(_0x1b9596['type']!==_0xcd0f('0x3f')){var _0x5953d8={};_0x5953d8[_0x1b9596[_0xcd0f('0x2a')]]={'$like':'%'+_0x4c3c93['query'][_0xcd0f('0x3d')]+'%'};return _0x5953d8;}})});}_0x1abbdf=_[_0xcd0f('0x3e')]({},_0x1abbdf,_0x4c3c93[_0xcd0f('0x40')]);var _0x454d0f={'where':_0x1abbdf[_0xcd0f('0x3b')]};return db[_0xcd0f('0x41')][_0xcd0f('0x42')](_0x454d0f)[_0xcd0f('0x25')](function(_0x599685){_0x14ea98[_0xcd0f('0x42')]=_0x599685;if(_0x4c3c93[_0xcd0f('0x32')][_0xcd0f('0x43')]){_0x1abbdf['include']=[{'all':!![]}];}return db['Pause'][_0xcd0f('0x44')](_0x1abbdf);})[_0xcd0f('0x25')](function(_0x515fc3){_0x14ea98[_0xcd0f('0x45')]=_0x515fc3;return _0x14ea98;})[_0xcd0f('0x25')](respondWithFilteredResult(_0xd6e12e,_0x1abbdf))[_0xcd0f('0x46')](handleError(_0xd6e12e,null));};exports['show']=function(_0x142926,_0x3488b4){var _0x1e0018={'raw':!![],'where':{'id':_0x142926[_0xcd0f('0x47')]['id']}},_0x2da259={};_0x2da259[_0xcd0f('0x31')]=_['keys'](db['Pause'][_0xcd0f('0x2d')]);_0x2da259['query']=_[_0xcd0f('0x33')](_0x142926['query']);_0x2da259[_0xcd0f('0x34')]=_[_0xcd0f('0x36')](_0x2da259['model'],_0x2da259[_0xcd0f('0x32')]);_0x1e0018[_0xcd0f('0x35')]=_[_0xcd0f('0x36')](_0x2da259['model'],qs[_0xcd0f('0x37')](_0x142926[_0xcd0f('0x32')][_0xcd0f('0x37')]));_0x1e0018[_0xcd0f('0x35')]=_0x1e0018[_0xcd0f('0x35')]['length']?_0x1e0018['attributes']:_0x2da259['model'];if(_0x142926[_0xcd0f('0x32')]['includeAll']){_0x1e0018[_0xcd0f('0x48')]=[{'all':!![]}];}_0x1e0018=_[_0xcd0f('0x3e')]({},_0x1e0018,_0x142926[_0xcd0f('0x40')]);return db[_0xcd0f('0x41')][_0xcd0f('0x49')](_0x1e0018)[_0xcd0f('0x25')](handleEntityNotFound(_0x3488b4,null))[_0xcd0f('0x25')](respondWithResult(_0x3488b4,null))['catch'](handleError(_0x3488b4,null));};exports[_0xcd0f('0x4a')]=function(_0x470482,_0x57ba50){return db[_0xcd0f('0x41')]['create'](_0x470482['body'],{})[_0xcd0f('0x25')](function(_0x454218){var _0x45f58e=_0x470482[_0xcd0f('0x4b')]['get']({'plain':!![]});if(!_0x45f58e)throw new Error(_0xcd0f('0x4c'));if(_0x45f58e[_0xcd0f('0x4d')]===_0xcd0f('0x4b')){var _0x128842=_0x454218[_0xcd0f('0x27')]({'plain':!![]});var _0x424c62='Pauses';return db[_0xcd0f('0x4e')][_0xcd0f('0x49')]({'where':{'name':_0x424c62,'userProfileId':_0x45f58e[_0xcd0f('0x4f')]},'raw':!![]})[_0xcd0f('0x25')](function(_0x399a5c){if(_0x399a5c&&_0x399a5c[_0xcd0f('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x128842[_0xcd0f('0x2a')],'resourceId':_0x128842['id'],'type':_0x399a5c[_0xcd0f('0x2a')],'sectionId':_0x399a5c['id']},{})[_0xcd0f('0x25')](function(){return _0x454218;});}else{return _0x454218;}})[_0xcd0f('0x46')](function(_0x2c3704){logger[_0xcd0f('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2c3704);throw _0x2c3704;});}return _0x454218;})[_0xcd0f('0x25')](respondWithResult(_0x57ba50,0xc9))[_0xcd0f('0x46')](handleError(_0x57ba50,null));};exports[_0xcd0f('0x51')]=function(_0x2d0ebe,_0xcae58d){if(_0x2d0ebe[_0xcd0f('0x52')]['id']){delete _0x2d0ebe[_0xcd0f('0x52')]['id'];}return db[_0xcd0f('0x41')][_0xcd0f('0x49')]({'where':{'id':_0x2d0ebe[_0xcd0f('0x47')]['id']}})[_0xcd0f('0x25')](handleEntityNotFound(_0xcae58d,null))[_0xcd0f('0x25')](saveUpdates(_0x2d0ebe[_0xcd0f('0x52')],null))[_0xcd0f('0x25')](respondWithResult(_0xcae58d,null))['catch'](handleError(_0xcae58d,null));};exports[_0xcd0f('0x26')]=function(_0x3ae4ce,_0x1da3ee){return db[_0xcd0f('0x41')]['find']({'where':{'id':_0x3ae4ce['params']['id']}})['then'](handleEntityNotFound(_0x1da3ee,null))['then'](removeEntity(_0x1da3ee,null))['catch'](handleError(_0x1da3ee,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 31d62a9..6e45f95 100644 --- a/server/api/pause/pause.model.js +++ b/server/api/pause/pause.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ef6=['exports','define','Pause','tools_pauses','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./pause.attributes'];(function(_0x56e7c1,_0x450309){var _0x5cd72e=function(_0x1dd0b8){while(--_0x1dd0b8){_0x56e7c1['push'](_0x56e7c1['shift']());}};_0x5cd72e(++_0x450309);}(_0x8ef6,0xf2));var _0x68ef=function(_0x3ca807,_0x1f50ee){_0x3ca807=_0x3ca807-0x0;var _0x2924d7=_0x8ef6[_0x3ca807];return _0x2924d7;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var logger=require(_0x68ef('0x2'))(_0x68ef('0x3'));var moment=require(_0x68ef('0x4'));var BPromise=require(_0x68ef('0x5'));var rp=require(_0x68ef('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var attributes=require(_0x68ef('0x9'));module[_0x68ef('0xa')]=function(_0x4d26e3,_0x4f77f3){return _0x4d26e3[_0x68ef('0xb')](_0x68ef('0xc'),attributes,{'tableName':_0x68ef('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf494=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','lodash','util'];(function(_0x12e5ca,_0x2d0158){var _0x9e5b6b=function(_0x38ad22){while(--_0x38ad22){_0x12e5ca['push'](_0x12e5ca['shift']());}};_0x9e5b6b(++_0x2d0158);}(_0xf494,0x1c6));var _0x4f49=function(_0x4f97bb,_0x3506c0){_0x4f97bb=_0x4f97bb-0x0;var _0x371e09=_0xf494[_0x4f97bb];return _0x371e09;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var logger=require(_0x4f49('0x2'))('api');var moment=require(_0x4f49('0x3'));var BPromise=require(_0x4f49('0x4'));var rp=require(_0x4f49('0x5'));var fs=require('fs');var path=require(_0x4f49('0x6'));var rimraf=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var attributes=require(_0x4f49('0x9'));module[_0x4f49('0xa')]=function(_0xc5e778,_0x413530){return _0xc5e778[_0x4f49('0xb')]('Pause',attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index eacfac7..027f5b8 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x116a19,_0x307b76){var _0x3833ae=function(_0x4245c2){while(--_0x4245c2){_0x116a19['push'](_0x116a19['shift']());}};_0x3833ae(++_0x307b76);}(_0x7a54,0x106));var _0x47a5=function(_0x317b3b,_0x1fc748){_0x317b3b=_0x317b3b-0x0;var _0x36c964=_0x7a54[_0x317b3b];return _0x36c964;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x5e4e99,_0x3ef596){var _0x181632=function(_0x5cba8a){while(--_0x5cba8a){_0x5e4e99['push'](_0x5e4e99['shift']());}};_0x181632(++_0x3ef596);}(_0xb10b,0x12a));var _0xbb10=function(_0x52980f,_0x47b3b0){_0x52980f=_0x52980f-0x0;var _0x1f52a1=_0xb10b[_0x52980f];return _0x1f52a1;};'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 169565c..a4c85ee 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 _0xe14d=['isAuthenticated','index','webhookGet','/:id','show','/:id/download','diskStorage','join','root','server/files/plugins','originalname','replace','format','%s-%s%s','extname','now','post','single','file','upload','/webhook','webhookPost','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./plugin.controller','get'];(function(_0x168dba,_0x4f4416){var _0x41bb26=function(_0xdb9b01){while(--_0xdb9b01){_0x168dba['push'](_0x168dba['shift']());}};_0x41bb26(++_0x4f4416);}(_0xe14d,0x1ee));var _0xde14=function(_0x4ae625,_0xf396d0){_0x4ae625=_0x4ae625-0x0;var _0x31accf=_0xe14d[_0x4ae625];return _0x31accf;};'use strict';var multer=require(_0xde14('0x0'));var util=require(_0xde14('0x1'));var path=require(_0xde14('0x2'));var timeout=require(_0xde14('0x3'));var express=require('express');var router=express[_0xde14('0x4')]();var fs_extra=require(_0xde14('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xde14('0x6'));var config=require(_0xde14('0x7'));var controller=require(_0xde14('0x8'));router[_0xde14('0x9')]('/',auth[_0xde14('0xa')](),controller[_0xde14('0xb')]);router['get']('/webhook',controller[_0xde14('0xc')]);router[_0xde14('0x9')](_0xde14('0xd'),auth[_0xde14('0xa')](),controller[_0xde14('0xe')]);router[_0xde14('0x9')](_0xde14('0xf'),auth[_0xde14('0xa')](),controller['download']);var upload=multer({'storage':multer[_0xde14('0x10')]({'destination':function(_0xe785fb,_0x417269,_0x4357c7){_0x4357c7(null,path[_0xde14('0x11')](config[_0xde14('0x12')],_0xde14('0x13')));},'filename':function(_0x3d5a29,_0x34e28f,_0x29e3ca){_0x34e28f[_0xde14('0x14')]=_0x34e28f[_0xde14('0x14')][_0xde14('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x29e3ca(null,util[_0xde14('0x16')](_0xde14('0x17'),path['basename'](_0x34e28f['originalname'],path[_0xde14('0x18')](_0x34e28f[_0xde14('0x14')])),Date[_0xde14('0x19')](),path['extname'](_0x34e28f[_0xde14('0x14')])));}})});router[_0xde14('0x1a')]('/',upload[_0xde14('0x1b')](_0xde14('0x1c')),controller[_0xde14('0x1d')]);router[_0xde14('0x1a')](_0xde14('0x1e'),controller[_0xde14('0x1f')]);router[_0xde14('0x20')](_0xde14('0xd'),auth['isAuthenticated'](),controller[_0xde14('0x21')]);router[_0xde14('0x22')](_0xde14('0xd'),auth[_0xde14('0xa')](),controller['delete']);module[_0xde14('0x23')]=router; \ No newline at end of file +var _0xca66=['file','upload','put','/:id','update','delete','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/webhook','webhookGet','show','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','post','single'];(function(_0x37a8f5,_0x5037d9){var _0x49c3b5=function(_0x5ad2e3){while(--_0x5ad2e3){_0x37a8f5['push'](_0x37a8f5['shift']());}};_0x49c3b5(++_0x5037d9);}(_0xca66,0x8b));var _0x6ca6=function(_0x4d3e29,_0x3b1037){_0x4d3e29=_0x4d3e29-0x0;var _0x50a0d6=_0xca66[_0x4d3e29];return _0x50a0d6;};'use strict';var multer=require(_0x6ca6('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6ca6('0x1'));var express=require(_0x6ca6('0x2'));var router=express[_0x6ca6('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6ca6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6ca6('0x5'));var controller=require('./plugin.controller');router[_0x6ca6('0x6')]('/',auth[_0x6ca6('0x7')](),controller[_0x6ca6('0x8')]);router[_0x6ca6('0x6')](_0x6ca6('0x9'),controller[_0x6ca6('0xa')]);router[_0x6ca6('0x6')]('/:id',auth[_0x6ca6('0x7')](),controller[_0x6ca6('0xb')]);router[_0x6ca6('0x6')](_0x6ca6('0xc'),auth[_0x6ca6('0x7')](),controller[_0x6ca6('0xd')]);var upload=multer({'storage':multer[_0x6ca6('0xe')]({'destination':function(_0x55a626,_0x38678e,_0xe39235){_0xe39235(null,path[_0x6ca6('0xf')](config[_0x6ca6('0x10')],_0x6ca6('0x11')));},'filename':function(_0x41e903,_0x4c05e9,_0x152e63){_0x4c05e9[_0x6ca6('0x12')]=_0x4c05e9['originalname'][_0x6ca6('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x152e63(null,util[_0x6ca6('0x14')](_0x6ca6('0x15'),path[_0x6ca6('0x16')](_0x4c05e9[_0x6ca6('0x12')],path[_0x6ca6('0x17')](_0x4c05e9['originalname'])),Date['now'](),path['extname'](_0x4c05e9[_0x6ca6('0x12')])));}})});router[_0x6ca6('0x18')]('/',upload[_0x6ca6('0x19')](_0x6ca6('0x1a')),controller[_0x6ca6('0x1b')]);router[_0x6ca6('0x18')](_0x6ca6('0x9'),controller['webhookPost']);router[_0x6ca6('0x1c')](_0x6ca6('0x1d'),auth[_0x6ca6('0x7')](),controller[_0x6ca6('0x1e')]);router[_0x6ca6('0x1f')](_0x6ca6('0x1d'),auth[_0x6ca6('0x7')](),controller[_0x6ca6('0x1f')]);module[_0x6ca6('0x20')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 2e14da5..6137d08 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 _0xda24=['BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','STRING','ENUM','html','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'];(function(_0x331211,_0x4a3ef8){var _0x669ea6=function(_0x32fc29){while(--_0x32fc29){_0x331211['push'](_0x331211['shift']());}};_0x669ea6(++_0x4a3ef8);}(_0xda24,0x1e8));var _0x4da2=function(_0xabbd65,_0x546d99){_0xabbd65=_0xabbd65-0x0;var _0x1d005a=_0xda24[_0xabbd65];return _0x1d005a;};'use strict';var Sequelize=require(_0x4da2('0x0'));module['exports']={'name':{'type':Sequelize[_0x4da2('0x1')]},'type':{'type':Sequelize[_0x4da2('0x2')](_0x4da2('0x3'),'script')},'description':{'type':Sequelize[_0x4da2('0x4')]},'version':{'type':Sequelize[_0x4da2('0x4')]},'path':{'type':Sequelize[_0x4da2('0x1')],'comment':_0x4da2('0x5')},'active':{'type':Sequelize[_0x4da2('0x6')],'defaultValue':0x0,'comment':_0x4da2('0x7')},'sidebar':{'type':Sequelize[_0x4da2('0x2')](_0x4da2('0x8'),_0x4da2('0x9'),_0x4da2('0xa'),_0x4da2('0xb')),'defaultValue':'always','comment':_0x4da2('0xc')},'icon':{'type':Sequelize[_0x4da2('0x1')]},'adminUrl':{'type':Sequelize[_0x4da2('0x1')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x4da2('0x1')]},'scriptPath':{'type':Sequelize[_0x4da2('0x1')]}}; \ No newline at end of file +var _0x3d78=['BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x3d78,0xf4));var _0x83d7=function(_0x92db67,_0x40d125){_0x92db67=_0x92db67-0x0;var _0x3372b8=_0x3d78[_0x92db67];return _0x3372b8;};'use strict';var Sequelize=require(_0x83d7('0x0'));module[_0x83d7('0x1')]={'name':{'type':Sequelize[_0x83d7('0x2')]},'type':{'type':Sequelize[_0x83d7('0x3')](_0x83d7('0x4'),_0x83d7('0x5'))},'description':{'type':Sequelize[_0x83d7('0x6')]},'version':{'type':Sequelize[_0x83d7('0x6')]},'path':{'type':Sequelize[_0x83d7('0x2')],'comment':_0x83d7('0x7')},'active':{'type':Sequelize[_0x83d7('0x8')],'defaultValue':0x0,'comment':_0x83d7('0x9')},'sidebar':{'type':Sequelize[_0x83d7('0x3')](_0x83d7('0xa'),_0x83d7('0xb'),_0x83d7('0xc'),'never'),'defaultValue':'always','comment':_0x83d7('0xd')},'icon':{'type':Sequelize[_0x83d7('0x2')]},'adminUrl':{'type':Sequelize[_0x83d7('0x2')]},'agentUrl':{'type':Sequelize[_0x83d7('0x2')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0x83d7('0x2')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 2f33657..4054c96 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 _0x8da1=['Plugin','includeAll','include','catch','show','params','length','options','download','find','root','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','code','error','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','join','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','unlinkSync','info','Download\x20completed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','readFileSync','manifest.json','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','html','views','admin','Invalid\x20manifest:\x20no\x20view\x20specified','scriptName','scriptPath','Invalid\x20manifest:\x20invalid\x20type','sidebar','icon','test','plugins','agent','Warning:\x20agent\x20view\x20not\x20specified','script','create','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','dirname','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','http://localhost:','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','extract-zip','rimraf','archiver','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','json','offset','limit','undefined','count','set','apply','reject','then','destroy','get','Plugins','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','where','filter','merge'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x8da1,0x19d));var _0x18da=function(_0xd93b26,_0x12bbf2){_0xd93b26=_0xd93b26-0x0;var _0x25f668=_0x8da1[_0xd93b26];return _0x25f668;};'use strict';var emlformat=require(_0x18da('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x18da('0x1'));var jsonpatch=require(_0x18da('0x2'));var rp=require(_0x18da('0x3'));var moment=require('moment');var BPromise=require(_0x18da('0x4'));var Mustache=require(_0x18da('0x5'));var util=require(_0x18da('0x6'));var path=require(_0x18da('0x7'));var sox=require(_0x18da('0x8'));var csv=require('to-csv');var ejs=require(_0x18da('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x18da('0xa'));var squel=require(_0x18da('0xb'));var crypto=require(_0x18da('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x18da('0xd'));var toCsv=require(_0x18da('0xe'));var querystring=require(_0x18da('0xf'));var Papa=require(_0x18da('0x10'));var extract=require(_0x18da('0x11'));var rimraf=require(_0x18da('0x12'));var archiver=require(_0x18da('0x13'));var Redis=require('ioredis');var authService=require(_0x18da('0x14'));var qs=require(_0x18da('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x18da('0x16'));var logger=require(_0x18da('0x17'))(_0x18da('0x18'));var utils=require(_0x18da('0x19'));var config=require(_0x18da('0x1a'));var licenseUtil=require(_0x18da('0x1b'));var db=require(_0x18da('0x1c'))['db'];config[_0x18da('0x1d')]=_[_0x18da('0x1e')](config[_0x18da('0x1d')],{'host':_0x18da('0x1f'),'port':0x18eb});var socket=require(_0x18da('0x20'))(new Redis(config[_0x18da('0x1d')]));require('./plugin.socket')['register'](socket);function respondWithStatusCode(_0x25712a,_0x5e49f7){_0x5e49f7=_0x5e49f7||0xcc;return function(_0x46ddf3){if(_0x46ddf3){return _0x25712a[_0x18da('0x21')](_0x5e49f7);}return _0x25712a['status'](_0x5e49f7)['end']();};}function respondWithResult(_0x5de0d6,_0x1d8fe8){_0x1d8fe8=_0x1d8fe8||0xc8;return function(_0x599890){if(_0x599890){return _0x5de0d6[_0x18da('0x22')](_0x1d8fe8)[_0x18da('0x23')](_0x599890);}};}function respondWithFilteredResult(_0x1e5d00,_0x44a487){return function(_0x39bbf8){if(_0x39bbf8){var _0x3ed46a=typeof _0x44a487[_0x18da('0x24')]==='undefined'&&typeof _0x44a487[_0x18da('0x25')]===_0x18da('0x26');var _0x23b7d2=_0x39bbf8[_0x18da('0x27')];var _0x51c77b=_0x3ed46a?0x0:_0x44a487[_0x18da('0x24')];var _0x5f387c=_0x3ed46a?_0x39bbf8[_0x18da('0x27')]:_0x44a487[_0x18da('0x24')]+_0x44a487['limit'];var _0x1206d1;if(_0x5f387c>=_0x23b7d2){_0x5f387c=_0x23b7d2;_0x1206d1=0xc8;}else{_0x1206d1=0xce;}_0x1e5d00[_0x18da('0x22')](_0x1206d1);return _0x1e5d00[_0x18da('0x28')]('Content-Range',_0x51c77b+'-'+_0x5f387c+'/'+_0x23b7d2)[_0x18da('0x23')](_0x39bbf8);}return null;};}function patchUpdates(_0x1c64f2){return function(_0x50c7fe){try{jsonpatch[_0x18da('0x29')](_0x50c7fe,_0x1c64f2,!![]);}catch(_0x437302){return BPromise[_0x18da('0x2a')](_0x437302);}return _0x50c7fe['save']();};}function saveUpdates(_0xb549d2,_0x39bea7){return function(_0x24f051){if(_0x24f051){return _0x24f051['update'](_0xb549d2)[_0x18da('0x2b')](function(_0x491ee4){return _0x491ee4;});}return null;};}function removeEntity(_0x316762,_0x34c003){return function(_0x3e46a8){if(_0x3e46a8){return _0x3e46a8[_0x18da('0x2c')]()[_0x18da('0x2b')](function(){var _0x1cd0bd=_0x3e46a8[_0x18da('0x2d')]({'plain':!![]});var _0x21aba7=_0x18da('0x2e');return db['UserProfileResource'][_0x18da('0x2c')]({'where':{'type':_0x21aba7,'resourceId':_0x1cd0bd['id']}})[_0x18da('0x2b')](function(){return _0x3e46a8;});})[_0x18da('0x2b')](function(){_0x316762['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f491b,_0x42c043){return function(_0x35317c){if(!_0x35317c){_0x2f491b['sendStatus'](0x194);}return _0x35317c;};}function handleError(_0x49d193,_0x2414db){_0x2414db=_0x2414db||0x1f4;return function(_0x2aae6e){logger['error'](_0x2aae6e[_0x18da('0x2f')]);if(_0x2aae6e[_0x18da('0x30')]){delete _0x2aae6e[_0x18da('0x30')];}_0x49d193[_0x18da('0x22')](_0x2414db)[_0x18da('0x31')](_0x2aae6e);};}exports['index']=function(_0x1d982e,_0x20b8d9){var _0x5e3286={},_0x32a846={},_0x24d4ec={'count':0x0,'rows':[]};var _0xf9f411=_[_0x18da('0x32')](db['Plugin'][_0x18da('0x33')],function(_0x19d1bf){return{'name':_0x19d1bf[_0x18da('0x34')],'type':_0x19d1bf[_0x18da('0x35')][_0x18da('0x36')]};});_0x32a846[_0x18da('0x37')]=_[_0x18da('0x32')](_0xf9f411,_0x18da('0x30'));_0x32a846[_0x18da('0x38')]=_[_0x18da('0x39')](_0x1d982e[_0x18da('0x38')]);_0x32a846[_0x18da('0x3a')]=_[_0x18da('0x3b')](_0x32a846[_0x18da('0x37')],_0x32a846['query']);_0x5e3286[_0x18da('0x3c')]=_[_0x18da('0x3b')](_0x32a846[_0x18da('0x37')],qs[_0x18da('0x3d')](_0x1d982e[_0x18da('0x38')][_0x18da('0x3d')]));_0x5e3286[_0x18da('0x3c')]=_0x5e3286[_0x18da('0x3c')]['length']?_0x5e3286['attributes']:_0x32a846[_0x18da('0x37')];if(!_0x1d982e[_0x18da('0x38')]['hasOwnProperty'](_0x18da('0x3e'))){_0x5e3286[_0x18da('0x25')]=qs['limit'](_0x1d982e[_0x18da('0x38')][_0x18da('0x25')]);_0x5e3286[_0x18da('0x24')]=qs[_0x18da('0x24')](_0x1d982e['query'][_0x18da('0x24')]);}_0x5e3286['order']=qs[_0x18da('0x3f')](_0x1d982e[_0x18da('0x38')][_0x18da('0x3f')]);_0x5e3286[_0x18da('0x40')]=qs[_0x18da('0x3a')](_['pick'](_0x1d982e['query'],_0x32a846[_0x18da('0x3a')]),_0xf9f411);if(_0x1d982e[_0x18da('0x38')][_0x18da('0x41')]){_0x5e3286['where']=_['merge'](_0x5e3286[_0x18da('0x40')],{'$or':_[_0x18da('0x32')](_0xf9f411,function(_0x49e7a0){if(_0x49e7a0[_0x18da('0x35')]!=='VIRTUAL'){var _0x56d291={};_0x56d291[_0x49e7a0['name']]={'$like':'%'+_0x1d982e[_0x18da('0x38')]['filter']+'%'};return _0x56d291;}})});}_0x5e3286=_[_0x18da('0x42')]({},_0x5e3286,_0x1d982e['options']);var _0x317d56={'where':_0x5e3286[_0x18da('0x40')]};return db[_0x18da('0x43')][_0x18da('0x27')](_0x317d56)[_0x18da('0x2b')](function(_0x6412f9){_0x24d4ec[_0x18da('0x27')]=_0x6412f9;if(_0x1d982e[_0x18da('0x38')][_0x18da('0x44')]){_0x5e3286[_0x18da('0x45')]=[{'all':!![]}];}return db[_0x18da('0x43')]['findAll'](_0x5e3286);})[_0x18da('0x2b')](function(_0x360152){_0x24d4ec['rows']=_0x360152;return _0x24d4ec;})[_0x18da('0x2b')](respondWithFilteredResult(_0x20b8d9,_0x5e3286))[_0x18da('0x46')](handleError(_0x20b8d9,null));};exports[_0x18da('0x47')]=function(_0x21a296,_0x437e10){var _0x342f1c={'raw':!![],'where':{'id':_0x21a296[_0x18da('0x48')]['id']}},_0x45d2c7={};_0x45d2c7[_0x18da('0x37')]=_[_0x18da('0x39')](db['Plugin'][_0x18da('0x33')]);_0x45d2c7['query']=_[_0x18da('0x39')](_0x21a296[_0x18da('0x38')]);_0x45d2c7[_0x18da('0x3a')]=_['intersection'](_0x45d2c7[_0x18da('0x37')],_0x45d2c7[_0x18da('0x38')]);_0x342f1c[_0x18da('0x3c')]=_[_0x18da('0x3b')](_0x45d2c7[_0x18da('0x37')],qs[_0x18da('0x3d')](_0x21a296['query'][_0x18da('0x3d')]));_0x342f1c[_0x18da('0x3c')]=_0x342f1c[_0x18da('0x3c')][_0x18da('0x49')]?_0x342f1c['attributes']:_0x45d2c7[_0x18da('0x37')];if(_0x21a296[_0x18da('0x38')]['includeAll']){_0x342f1c[_0x18da('0x45')]=[{'all':!![]}];}_0x342f1c=_[_0x18da('0x42')]({},_0x342f1c,_0x21a296[_0x18da('0x4a')]);return db[_0x18da('0x43')]['find'](_0x342f1c)[_0x18da('0x2b')](handleEntityNotFound(_0x437e10,null))[_0x18da('0x2b')](respondWithResult(_0x437e10,null))[_0x18da('0x46')](handleError(_0x437e10,null));};exports[_0x18da('0x4b')]=function(_0x5cf316,_0x848710,_0x57530a){return db['Plugin'][_0x18da('0x4c')]({'where':{'id':_0x5cf316[_0x18da('0x48')]['id']},'attributes':[_0x18da('0x30'),'path'],'raw':!![]})[_0x18da('0x2b')](handleEntityNotFound(_0x848710,null))['then'](function(_0x341841){if(_0x341841){var _0x28bed4=path['join'](config[_0x18da('0x4d')],_0x18da('0x4e'),util[_0x18da('0x4f')](_0x18da('0x50'),path[_0x18da('0x51')](_0x341841[_0x18da('0x7')])));var _0x1aebc7=fs[_0x18da('0x52')](_0x28bed4);var _0x4a5689=archiver(_0x18da('0x53'),{'zlib':{'level':0x9}});_0x4a5689['on'](_0x18da('0x54'),function(_0x32d66d){if(_0x32d66d[_0x18da('0x55')]==='ENOENT'){logger[_0x18da('0x56')](_0x32d66d);}else{throw new db[(_0x18da('0x57'))][(_0x18da('0x58'))](_0x18da('0x59'));}});_0x4a5689['on'](_0x18da('0x56'),function(_0x3a8e48){throw new db[(_0x18da('0x57'))][(_0x18da('0x58'))](_0x18da('0x59'));});_0x4a5689[_0x18da('0x5a')](_0x1aebc7);_0x4a5689[_0x18da('0x5b')](_0x18da('0x5c'),{'cwd':path[_0x18da('0x5d')](config[_0x18da('0x4d')],_0x18da('0x4e'),path['dirname'](_0x341841[_0x18da('0x7')])),'ignore':[path[_0x18da('0x5d')](path['basename'](_0x341841['path']),_0x18da('0x5e')),path['join'](path['basename'](_0x341841[_0x18da('0x7')]),_0x18da('0x5f'))],'nodir':!![]})[_0x18da('0x60')]();_0x1aebc7['on'](_0x18da('0x61'),function(){if(!fs[_0x18da('0x62')](_0x28bed4)){throw new db[(_0x18da('0x57'))]['Error'](_0x18da('0x63'));}return _0x848710[_0x18da('0x4b')](_0x28bed4,util[_0x18da('0x4f')](_0x18da('0x50'),path['basename'](_0x341841['path'])),function(_0x2a4192){if(_0x2a4192){throw new db[(_0x18da('0x57'))][(_0x18da('0x58'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0x18da('0x64')](_0x28bed4);logger[_0x18da('0x65')](_0x18da('0x66'));logger[_0x18da('0x65')]('Temporary\x20file\x20removed');});});}return null;})[_0x18da('0x46')](handleError(_0x848710,null));};exports[_0x18da('0x67')]=function(_0x468190,_0x4f20a4,_0x209dff){var _0x21ccef=path[_0x18da('0x51')](_0x468190[_0x18da('0x68')][_0x18da('0x69')],path[_0x18da('0x6a')](_0x468190['file'][_0x18da('0x69')]));var _0x484cfa=path['join'](config[_0x18da('0x4d')],_0x18da('0x4e'),_0x468190[_0x18da('0x68')][_0x18da('0x69')]);var _0x49701d=path[_0x18da('0x5d')](config[_0x18da('0x4d')],_0x18da('0x4e'),_0x21ccef);logger['info'](_0x18da('0x6b'),_0x484cfa);logger[_0x18da('0x65')]('Plugin\x20upload\x20destination:\x20%s',_0x49701d);try{fs['chmodSync'](_0x484cfa,parseInt(_0x18da('0x6c'),0x8));extract(_0x484cfa,{'dir':_0x49701d},function(_0x418a40){if(_0x418a40){logger['error'](_0x418a40);handleError(_0x418a40,!![]);};var _0x3f6cc6=fs[_0x18da('0x6d')](_0x49701d);if(_0x3f6cc6['length']>0x1){removeReferences(_0x484cfa,_0x49701d);logger['error'](_0x18da('0x6e'));return _0x209dff(new Error(_0x18da('0x6e')));}var _0x112ce4=fs[_0x18da('0x6f')](path[_0x18da('0x5d')](_0x49701d,_0x3f6cc6[0x0]));if(_0x112ce4[_0x18da('0x70')]()){removeReferences(_0x484cfa,_0x49701d);logger[_0x18da('0x56')](_0x18da('0x6e'));return _0x209dff(new Error(_0x18da('0x6e')));}if(_0x112ce4[_0x18da('0x71')]()){var _0x2d5d14=fs['readdirSync'](path[_0x18da('0x5d')](_0x49701d,_0x3f6cc6[0x0]));if(_0x2d5d14[_0x18da('0x49')]===0x0){removeReferences(_0x484cfa,_0x49701d);logger[_0x18da('0x56')](_0x18da('0x6e'));return _0x209dff(new Error('Invalid\x20plugin\x20structure'));}var _0xad716c=_0x2d5d14[_0x18da('0x72')](function(_0x682c91){return _0x682c91==='manifest.json';});if(!_0xad716c){return _0x209dff(new Error('Plugin\x20manifest\x20missing'));}var _0x29e087=fs[_0x18da('0x73')](path[_0x18da('0x5d')](_0x49701d,_0x3f6cc6[0x0],_0x18da('0x74')));var _0x56754d=JSON[_0x18da('0x75')](_0x29e087);if('undefined'==typeof _0x56754d[_0x18da('0x30')]){return _0x209dff(new Error(_0x18da('0x76')));}if(_0x18da('0x26')==typeof _0x56754d[_0x18da('0x35')]){return _0x209dff(new Error(_0x18da('0x77')));}if('undefined'==typeof _0x56754d['version']){return _0x209dff(new Error(_0x18da('0x78')));}if(_0x18da('0x26')==typeof _0x56754d[_0x18da('0x79')]){return _0x209dff(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x56754d['type']===_0x18da('0x7a')){if(_0x18da('0x26')==typeof _0x56754d[_0x18da('0x79')][_0x18da('0x7b')]){return _0x209dff(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0x18da('0x26')==typeof _0x56754d[_0x18da('0x79')][_0x18da('0x7b')][_0x18da('0x7c')]&&'undefined'==typeof _0x56754d[_0x18da('0x79')][_0x18da('0x7b')]['agent']){return _0x209dff(new Error(_0x18da('0x7d')));}}else if(_0x56754d[_0x18da('0x35')]==='script'){if('undefined'==typeof _0x56754d['parameters'][_0x18da('0x7e')]){return _0x209dff(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0x18da('0x26')==typeof _0x56754d[_0x18da('0x79')][_0x18da('0x7f')]){return _0x209dff(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x209dff(new Error(_0x18da('0x80')));}var _0x562a76=_0x56754d[_0x18da('0x30')];var _0xc03bd9=_0x56754d['description'];var _0x291c46=_0x56754d[_0x18da('0x35')];var _0x333519=_0x56754d[_0x18da('0x81')]?_0x56754d[_0x18da('0x81')]:'always';var _0x457edc=_0x56754d['icon']?_0x56754d[_0x18da('0x82')]:'icon-apps';var _0x50f017='';var _0x27c0e9='';var _0x357347='';var _0x3e2f83='';var _0x44edb7=_0x56754d['version'];if(_0x291c46===_0x18da('0x7a')){if(_0x18da('0x26')!=typeof _0x56754d[_0x18da('0x79')][_0x18da('0x7b')][_0x18da('0x7c')]){var _0x543b64=_0x56754d['parameters'][_0x18da('0x7b')][_0x18da('0x7c')];if(!/^(f|ht)tps?:\/\//i[_0x18da('0x83')](_0x543b64)){_0x50f017=path[_0x18da('0x5d')](_0x18da('0x84'),_0x21ccef,_0x3f6cc6[0x0],_0x543b64);}else{_0x50f017=_0x543b64;}}else{logger[_0x18da('0x65')]('Warning:\x20admin\x20view\x20not\x20specified');}if('undefined'!=typeof _0x56754d[_0x18da('0x79')][_0x18da('0x7b')]['agent']){var _0x5e894f=_0x56754d[_0x18da('0x79')][_0x18da('0x7b')][_0x18da('0x85')];if(!/^(f|ht)tps?:\/\//i['test'](_0x5e894f)){_0x27c0e9=path[_0x18da('0x5d')](_0x18da('0x84'),_0x21ccef,_0x3f6cc6[0x0],_0x5e894f);}else{_0x27c0e9=_0x5e894f;}}else{logger[_0x18da('0x65')](_0x18da('0x86'));}}else if(_0x291c46===_0x18da('0x87')){_0x357347=_0x56754d[_0x18da('0x79')][_0x18da('0x7e')];_0x3e2f83=_0x56754d[_0x18da('0x79')][_0x18da('0x7f')];if(_0x18da('0x26')!=typeof _0x56754d[_0x18da('0x79')][_0x18da('0x7b')]){if(_0x18da('0x26')!=typeof _0x56754d[_0x18da('0x79')][_0x18da('0x7b')][_0x18da('0x7c')]){var _0x543b64=_0x56754d[_0x18da('0x79')][_0x18da('0x7b')]['admin'];if(!/^(f|ht)tps?:\/\//i['test'](_0x543b64)){_0x50f017=path['join'](_0x18da('0x84'),_0x21ccef,_0x3f6cc6[0x0],_0x543b64);}else{_0x50f017=_0x543b64;}}if(_0x18da('0x26')!=typeof _0x56754d[_0x18da('0x79')][_0x18da('0x7b')][_0x18da('0x85')]){var _0x5e894f=_0x56754d['parameters'][_0x18da('0x7b')][_0x18da('0x85')];if(!/^(f|ht)tps?:\/\//i[_0x18da('0x83')](_0x5e894f)){_0x27c0e9=path[_0x18da('0x5d')]('plugins',_0x21ccef,_0x3f6cc6[0x0],_0x5e894f);}else{_0x27c0e9=_0x5e894f;}}}}var _0x12dc58={'name':_0x562a76,'description':_0xc03bd9,'path':path['join'](_0x21ccef,_0x3f6cc6[0x0]),'type':_0x291c46,'sidebar':_0x333519,'icon':_0x457edc,'adminUrl':_0x50f017,'agentUrl':_0x27c0e9,'scriptName':_0x357347,'scriptPath':_0x3e2f83,'version':_0x44edb7};removeReferences(_0x484cfa,null);return db[_0x18da('0x43')][_0x18da('0x88')](_0x12dc58)[_0x18da('0x2b')](function(_0x207a8b){var _0x130483={'role':_0x468190[_0x18da('0x89')][_0x18da('0x8a')],'userProfileId':_0x468190[_0x18da('0x89')]['userProfileId']};if(!_0x130483)throw new Error(_0x18da('0x8b'));if(_0x130483[_0x18da('0x8a')]==='user'){var _0x18b99=_0x207a8b[_0x18da('0x2d')]({'plain':!![]});return db[_0x18da('0x8c')]['find']({'where':{'name':_0x18da('0x2e'),'userProfileId':_0x130483[_0x18da('0x8d')]},'raw':!![]})[_0x18da('0x2b')](function(_0x2b6e9a){if(_0x2b6e9a&&_0x2b6e9a['autoAssociation']===0x0){return db[_0x18da('0x8e')]['create']({'name':_0x18b99[_0x18da('0x30')],'resourceId':_0x18b99['id'],'type':_0x2b6e9a[_0x18da('0x30')],'sectionId':_0x2b6e9a['id']},{})[_0x18da('0x2b')](function(){return _0x207a8b;});}else{return _0x207a8b;}})[_0x18da('0x46')](function(_0x43f69c){logger[_0x18da('0x56')](_0x18da('0x8f'),_0x43f69c);throw _0x43f69c;});}return _0x207a8b;})[_0x18da('0x2b')](respondWithResult(_0x4f20a4,null))[_0x18da('0x46')](handleError(_0x4f20a4,null));}});}catch(_0x41fd97){_0x4f20a4[_0x18da('0x22')](0x1f4)[_0x18da('0x31')](_0x41fd97);}};function removeReferences(_0x5b0612,_0x4073c5){try{if(_0x5b0612){fs[_0x18da('0x64')](_0x5b0612);logger[_0x18da('0x65')](_0x18da('0x90'));}if(_0x4073c5){rimraf(_0x4073c5,function(){});logger[_0x18da('0x65')](_0x18da('0x91'));}}catch(_0x93ffa8){logger[_0x18da('0x56')](_0x93ffa8);}}exports['update']=function(_0x52c3a7,_0x54c7cd,_0xba48b){return db['Plugin'][_0x18da('0x4c')]({'where':{'id':_0x52c3a7[_0x18da('0x48')]['id']}})['then'](handleEntityNotFound(_0x54c7cd,null))[_0x18da('0x2b')](saveUpdates(_0x52c3a7['body'],null))['then'](respondWithResult(_0x54c7cd,null))[_0x18da('0x46')](handleError(_0x54c7cd,null));};exports['delete']=function(_0x42c2d6,_0x5590df,_0x951925){return db['Plugin']['find']({'where':{'id':_0x42c2d6['params']['id']}})['then'](function(_0x219031){if(_0x219031){return _0x219031['destroy']();}})[_0x18da('0x2b')](function(_0x2d8da1){rimraf(path['join'](config[_0x18da('0x4d')],_0x18da('0x4e'),path[_0x18da('0x92')](_0x2d8da1[_0x18da('0x7')])),function(){});return _0x2d8da1;})['then'](handleEntityNotFound(_0x5590df,null))['then'](respondWithStatusCode(_0x5590df,null))[_0x18da('0x46')](handleError(_0x5590df,null));};exports['webhookGet']=function(_0x537020,_0x3fbf78,_0x15ec15){return BPromise[_0x18da('0x93')]()['then'](function(){if(!_0x537020[_0x18da('0x38')][_0x18da('0x7')]){throw new Error(_0x18da('0x94'));}if(!_0x537020[_0x18da('0x38')][_0x18da('0x95')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x4466d2=_0x537020['query']['hostname']?_0x537020[_0x18da('0x38')][_0x18da('0x96')]+':'+_0x537020[_0x18da('0x38')][_0x18da('0x95')]:'http://localhost:'+_0x537020[_0x18da('0x38')]['port'];var _0x217d26=_0x537020[_0x18da('0x38')][_0x18da('0x23')]?_0x537020[_0x18da('0x38')][_0x18da('0x23')]:!![];var _0x348d8a=_0x537020['query'][_0x18da('0x97')]?_0x537020['query'][_0x18da('0x97')]:null;var _0x36308a={'method':_0x537020[_0x18da('0x98')],'uri':util[_0x18da('0x4f')](_0x18da('0x99'),_0x4466d2,_0x537020[_0x18da('0x38')][_0x18da('0x7')]),'json':_0x217d26,'resolveWithFullResponse':!![],'encoding':_0x348d8a,'qs':_0x537020[_0x18da('0x38')]};if(_0x537020[_0x18da('0x9a')]){_0x36308a['headers']=_0x537020[_0x18da('0x9a')];if(_0x36308a[_0x18da('0x9a')][_0x18da('0x9b')]){delete _0x36308a['headers'][_0x18da('0x9b')];}}if(_0x36308a[_0x18da('0x9a')][_0x18da('0x9c')]){delete _0x36308a[_0x18da('0x9a')][_0x18da('0x9c')];}return rp(_0x36308a);})['then'](function(_0x1009cd){if(_0x1009cd){_0x3fbf78['set'](_0x1009cd['headers']);logger[_0x18da('0x65')](_0x1009cd[_0x18da('0x89')]);if(_[_0x18da('0x9d')](_0x537020[_0x18da('0x38')][_0x18da('0x7')],'download')&&_0x1009cd[_0x18da('0x9e')]==0x1f4){return _0x3fbf78['sendStatus'](_0x1009cd[_0x18da('0x9e')]);}else{return _0x3fbf78[_0x18da('0x22')](_0x1009cd['statusCode'])['send'](_0x1009cd[_0x18da('0x89')]);}}else{return _0x3fbf78['sendStatus'](0xc8);}})[_0x18da('0x46')](handleError(_0x3fbf78,null));};exports['webhookPost']=function(_0x2c08c5,_0x294add,_0x21ea5f){return BPromise[_0x18da('0x93')]()[_0x18da('0x2b')](function(){if(!_0x2c08c5[_0x18da('0x38')][_0x18da('0x7')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x2c08c5[_0x18da('0x38')][_0x18da('0x95')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x4293aa=_0x2c08c5[_0x18da('0x38')]['hostname']?_0x2c08c5[_0x18da('0x38')][_0x18da('0x96')]+':'+_0x2c08c5['query'][_0x18da('0x95')]:_0x18da('0x9f')+_0x2c08c5[_0x18da('0x38')][_0x18da('0x95')];var _0x2b9378=_0x2c08c5[_0x18da('0x38')]['json']?_0x2c08c5[_0x18da('0x38')][_0x18da('0x23')]:!![];var _0x4c7511=_0x2c08c5[_0x18da('0x38')][_0x18da('0x97')]?_0x2c08c5[_0x18da('0x38')][_0x18da('0x97')]:null;var _0x483ac0={'method':_0x2c08c5['method'],'uri':util[_0x18da('0x4f')]('%s%s',_0x4293aa,_0x2c08c5[_0x18da('0x38')][_0x18da('0x7')]),'json':_0x2b9378,'resolveWithFullResponse':!![],'encoding':_0x4c7511,'body':_0x2c08c5[_0x18da('0x89')]};if(_0x2c08c5[_0x18da('0x9a')]){_0x483ac0[_0x18da('0x9a')]=_0x2c08c5[_0x18da('0x9a')];if(_0x483ac0[_0x18da('0x9a')][_0x18da('0x9b')]){delete _0x483ac0[_0x18da('0x9a')][_0x18da('0x9b')];}}if(_0x483ac0['headers'][_0x18da('0x9c')]){delete _0x483ac0[_0x18da('0x9a')][_0x18da('0x9c')];}return rp(_0x483ac0);})[_0x18da('0x2b')](function(_0x4c154b){if(_0x4c154b){_0x294add[_0x18da('0x28')](_0x4c154b[_0x18da('0x9a')]);logger[_0x18da('0x65')](_0x4c154b['body']);return _0x294add['status'](_0x4c154b[_0x18da('0x9e')])['send'](_0x4c154b[_0x18da('0x89')]);}else{return _0x294add[_0x18da('0x21')](0xc8);}})[_0x18da('0x46')](handleError(_0x294add,null));}; \ No newline at end of file +var _0xa223=['where','pick','filter','merge','options','show','params','rawAttributes','length','includeAll','include','find','download','path','join','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','dirname','attachments/**/*','finalize','existsSync','Sequelize','Error','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','catch','upload','file','filename','extname','root','Plugin\x20upload\x20destination:\x20%s','0777','Invalid\x20plugin\x20structure','lstatSync','isFile','readdirSync','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','Invalid\x20manifest:\x20views\x20missing','views','admin','script','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','icon-apps','test','Warning:\x20admin\x20view\x20not\x20specified','agent','plugins','Warning:\x20agent\x20view\x20not\x20specified','scriptName','create','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','delete','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','eml-format','rimraf','zip-dir','request-promise','bluebird','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','extract-zip','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./plugin.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','get','Plugins','UserProfileResource','error','send','index','map','Plugin','fieldName','type','name','keys','query','filters','model','attributes','intersection','fields','order','sort'];(function(_0x37ad5a,_0x55b590){var _0x1ab506=function(_0xef28bc){while(--_0xef28bc){_0x37ad5a['push'](_0x37ad5a['shift']());}};_0x1ab506(++_0x55b590);}(_0xa223,0x6a));var _0x3a22=function(_0x473cfd,_0x2d1735){_0x473cfd=_0x473cfd-0x0;var _0x32871d=_0xa223[_0x473cfd];return _0x32871d;};'use strict';var emlformat=require(_0x3a22('0x0'));var rimraf=require(_0x3a22('0x1'));var zipdir=require(_0x3a22('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3a22('0x3'));var moment=require('moment');var BPromise=require(_0x3a22('0x4'));var Mustache=require('mustache');var util=require(_0x3a22('0x5'));var path=require('path');var sox=require(_0x3a22('0x6'));var csv=require('to-csv');var ejs=require(_0x3a22('0x7'));var fs=require('fs');var fs_extra=require(_0x3a22('0x8'));var _=require(_0x3a22('0x9'));var squel=require(_0x3a22('0xa'));var crypto=require(_0x3a22('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x3a22('0xc'));var toCsv=require(_0x3a22('0xd'));var querystring=require(_0x3a22('0xe'));var Papa=require(_0x3a22('0xf'));var extract=require(_0x3a22('0x10'));var rimraf=require('rimraf');var archiver=require('archiver');var Redis=require(_0x3a22('0x11'));var authService=require(_0x3a22('0x12'));var qs=require(_0x3a22('0x13'));var as=require(_0x3a22('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3a22('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x3a22('0x16'));var licenseUtil=require(_0x3a22('0x17'));var db=require(_0x3a22('0x18'))['db'];config['redis']=_[_0x3a22('0x19')](config[_0x3a22('0x1a')],{'host':_0x3a22('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3a22('0x1c'))[_0x3a22('0x1d')](socket);function respondWithStatusCode(_0x5732d2,_0x564687){_0x564687=_0x564687||0xcc;return function(_0x390710){if(_0x390710){return _0x5732d2[_0x3a22('0x1e')](_0x564687);}return _0x5732d2[_0x3a22('0x1f')](_0x564687)[_0x3a22('0x20')]();};}function respondWithResult(_0x63453c,_0xc4e427){_0xc4e427=_0xc4e427||0xc8;return function(_0x21342e){if(_0x21342e){return _0x63453c['status'](_0xc4e427)[_0x3a22('0x21')](_0x21342e);}};}function respondWithFilteredResult(_0x18301a,_0x5b89b7){return function(_0x503bbc){if(_0x503bbc){var _0x458811=typeof _0x5b89b7[_0x3a22('0x22')]===_0x3a22('0x23')&&typeof _0x5b89b7[_0x3a22('0x24')]===_0x3a22('0x23');var _0xd3bb02=_0x503bbc[_0x3a22('0x25')];var _0x52d4ad=_0x458811?0x0:_0x5b89b7[_0x3a22('0x22')];var _0x41875e=_0x458811?_0x503bbc[_0x3a22('0x25')]:_0x5b89b7['offset']+_0x5b89b7[_0x3a22('0x24')];var _0x57b36f;if(_0x41875e>=_0xd3bb02){_0x41875e=_0xd3bb02;_0x57b36f=0xc8;}else{_0x57b36f=0xce;}_0x18301a['status'](_0x57b36f);return _0x18301a[_0x3a22('0x26')](_0x3a22('0x27'),_0x52d4ad+'-'+_0x41875e+'/'+_0xd3bb02)['json'](_0x503bbc);}return null;};}function patchUpdates(_0x2e3440){return function(_0x459a35){try{jsonpatch['apply'](_0x459a35,_0x2e3440,!![]);}catch(_0x1a589f){return BPromise[_0x3a22('0x28')](_0x1a589f);}return _0x459a35[_0x3a22('0x29')]();};}function saveUpdates(_0x239e66,_0x18fd62){return function(_0xfd24fe){if(_0xfd24fe){return _0xfd24fe['update'](_0x239e66)[_0x3a22('0x2a')](function(_0x5e68bc){return _0x5e68bc;});}return null;};}function removeEntity(_0x4024f9,_0x21c168){return function(_0x23de01){if(_0x23de01){return _0x23de01[_0x3a22('0x2b')]()[_0x3a22('0x2a')](function(){var _0x468f08=_0x23de01[_0x3a22('0x2c')]({'plain':!![]});var _0x1eb69b=_0x3a22('0x2d');return db[_0x3a22('0x2e')][_0x3a22('0x2b')]({'where':{'type':_0x1eb69b,'resourceId':_0x468f08['id']}})[_0x3a22('0x2a')](function(){return _0x23de01;});})[_0x3a22('0x2a')](function(){_0x4024f9[_0x3a22('0x1f')](0xcc)[_0x3a22('0x20')]();});}};}function handleEntityNotFound(_0x151201,_0x31afa6){return function(_0x18bcfe){if(!_0x18bcfe){_0x151201['sendStatus'](0x194);}return _0x18bcfe;};}function handleError(_0x2fccdd,_0x298ba5){_0x298ba5=_0x298ba5||0x1f4;return function(_0x2ad96e){logger[_0x3a22('0x2f')](_0x2ad96e['stack']);if(_0x2ad96e['name']){delete _0x2ad96e['name'];}_0x2fccdd[_0x3a22('0x1f')](_0x298ba5)[_0x3a22('0x30')](_0x2ad96e);};}exports[_0x3a22('0x31')]=function(_0x31b3cf,_0x6329d4){var _0x4bff21={},_0x1d0018={},_0xa068b3={'count':0x0,'rows':[]};var _0x77f255=_[_0x3a22('0x32')](db[_0x3a22('0x33')]['rawAttributes'],function(_0x25c43d){return{'name':_0x25c43d[_0x3a22('0x34')],'type':_0x25c43d[_0x3a22('0x35')]['key']};});_0x1d0018['model']=_[_0x3a22('0x32')](_0x77f255,_0x3a22('0x36'));_0x1d0018['query']=_[_0x3a22('0x37')](_0x31b3cf[_0x3a22('0x38')]);_0x1d0018[_0x3a22('0x39')]=_['intersection'](_0x1d0018[_0x3a22('0x3a')],_0x1d0018['query']);_0x4bff21[_0x3a22('0x3b')]=_[_0x3a22('0x3c')](_0x1d0018[_0x3a22('0x3a')],qs[_0x3a22('0x3d')](_0x31b3cf['query'][_0x3a22('0x3d')]));_0x4bff21[_0x3a22('0x3b')]=_0x4bff21[_0x3a22('0x3b')]['length']?_0x4bff21[_0x3a22('0x3b')]:_0x1d0018['model'];if(!_0x31b3cf[_0x3a22('0x38')]['hasOwnProperty']('nolimit')){_0x4bff21['limit']=qs[_0x3a22('0x24')](_0x31b3cf[_0x3a22('0x38')][_0x3a22('0x24')]);_0x4bff21['offset']=qs['offset'](_0x31b3cf[_0x3a22('0x38')][_0x3a22('0x22')]);}_0x4bff21[_0x3a22('0x3e')]=qs['sort'](_0x31b3cf[_0x3a22('0x38')][_0x3a22('0x3f')]);_0x4bff21[_0x3a22('0x40')]=qs['filters'](_[_0x3a22('0x41')](_0x31b3cf[_0x3a22('0x38')],_0x1d0018[_0x3a22('0x39')]),_0x77f255);if(_0x31b3cf[_0x3a22('0x38')][_0x3a22('0x42')]){_0x4bff21[_0x3a22('0x40')]=_[_0x3a22('0x43')](_0x4bff21['where'],{'$or':_[_0x3a22('0x32')](_0x77f255,function(_0x1d5b55){if(_0x1d5b55['type']!=='VIRTUAL'){var _0x2b781b={};_0x2b781b[_0x1d5b55['name']]={'$like':'%'+_0x31b3cf[_0x3a22('0x38')][_0x3a22('0x42')]+'%'};return _0x2b781b;}})});}_0x4bff21=_[_0x3a22('0x43')]({},_0x4bff21,_0x31b3cf[_0x3a22('0x44')]);var _0x5d8dcd={'where':_0x4bff21[_0x3a22('0x40')]};return db[_0x3a22('0x33')]['count'](_0x5d8dcd)[_0x3a22('0x2a')](function(_0x2bc135){_0xa068b3[_0x3a22('0x25')]=_0x2bc135;if(_0x31b3cf[_0x3a22('0x38')]['includeAll']){_0x4bff21['include']=[{'all':!![]}];}return db[_0x3a22('0x33')]['findAll'](_0x4bff21);})[_0x3a22('0x2a')](function(_0x3e6c4d){_0xa068b3['rows']=_0x3e6c4d;return _0xa068b3;})[_0x3a22('0x2a')](respondWithFilteredResult(_0x6329d4,_0x4bff21))['catch'](handleError(_0x6329d4,null));};exports[_0x3a22('0x45')]=function(_0x54a6f7,_0x4eca8d){var _0x57c991={'raw':!![],'where':{'id':_0x54a6f7[_0x3a22('0x46')]['id']}},_0x896545={};_0x896545['model']=_['keys'](db[_0x3a22('0x33')][_0x3a22('0x47')]);_0x896545[_0x3a22('0x38')]=_['keys'](_0x54a6f7[_0x3a22('0x38')]);_0x896545['filters']=_['intersection'](_0x896545[_0x3a22('0x3a')],_0x896545['query']);_0x57c991['attributes']=_[_0x3a22('0x3c')](_0x896545[_0x3a22('0x3a')],qs['fields'](_0x54a6f7[_0x3a22('0x38')][_0x3a22('0x3d')]));_0x57c991['attributes']=_0x57c991[_0x3a22('0x3b')][_0x3a22('0x48')]?_0x57c991[_0x3a22('0x3b')]:_0x896545['model'];if(_0x54a6f7[_0x3a22('0x38')][_0x3a22('0x49')]){_0x57c991[_0x3a22('0x4a')]=[{'all':!![]}];}_0x57c991=_[_0x3a22('0x43')]({},_0x57c991,_0x54a6f7['options']);return db[_0x3a22('0x33')][_0x3a22('0x4b')](_0x57c991)[_0x3a22('0x2a')](handleEntityNotFound(_0x4eca8d,null))[_0x3a22('0x2a')](respondWithResult(_0x4eca8d,null))['catch'](handleError(_0x4eca8d,null));};exports[_0x3a22('0x4c')]=function(_0x2c8697,_0x3f70eb,_0x278d44){return db[_0x3a22('0x33')][_0x3a22('0x4b')]({'where':{'id':_0x2c8697[_0x3a22('0x46')]['id']},'attributes':[_0x3a22('0x36'),_0x3a22('0x4d')],'raw':!![]})[_0x3a22('0x2a')](handleEntityNotFound(_0x3f70eb,null))[_0x3a22('0x2a')](function(_0x43f5bf){if(_0x43f5bf){var _0x5dee46=path[_0x3a22('0x4e')](config['root'],_0x3a22('0x4f'),util[_0x3a22('0x50')](_0x3a22('0x51'),path[_0x3a22('0x52')](_0x43f5bf['path'])));var _0x594b28=fs[_0x3a22('0x53')](_0x5dee46);var _0xa84a14=archiver(_0x3a22('0x54'),{'zlib':{'level':0x9}});_0xa84a14['on'](_0x3a22('0x55'),function(_0x18f5a6){if(_0x18f5a6[_0x3a22('0x56')]===_0x3a22('0x57')){logger['error'](_0x18f5a6);}else{throw new db['Sequelize']['Error'](_0x3a22('0x58'));}});_0xa84a14['on'](_0x3a22('0x2f'),function(_0x5c22fe){throw new db['Sequelize']['Error']('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0xa84a14[_0x3a22('0x59')](_0x594b28);_0xa84a14[_0x3a22('0x5a')](_0x3a22('0x5b'),{'cwd':path[_0x3a22('0x4e')](config['root'],'server/files/plugins',path[_0x3a22('0x5c')](_0x43f5bf[_0x3a22('0x4d')])),'ignore':[path[_0x3a22('0x4e')](path[_0x3a22('0x52')](_0x43f5bf[_0x3a22('0x4d')]),'node_modules/**/*'),path[_0x3a22('0x4e')](path[_0x3a22('0x52')](_0x43f5bf[_0x3a22('0x4d')]),_0x3a22('0x5d'))],'nodir':!![]})[_0x3a22('0x5e')]();_0x594b28['on']('close',function(){if(!fs[_0x3a22('0x5f')](_0x5dee46)){throw new db[(_0x3a22('0x60'))][(_0x3a22('0x61'))](_0x3a22('0x62'));}return _0x3f70eb['download'](_0x5dee46,util[_0x3a22('0x50')](_0x3a22('0x51'),path['basename'](_0x43f5bf['path'])),function(_0x4e3238){if(_0x4e3238){throw new db[(_0x3a22('0x60'))]['Error'](_0x3a22('0x63'));}fs[_0x3a22('0x64')](_0x5dee46);logger[_0x3a22('0x65')](_0x3a22('0x66'));logger[_0x3a22('0x65')](_0x3a22('0x67'));});});}return null;})[_0x3a22('0x68')](handleError(_0x3f70eb,null));};exports[_0x3a22('0x69')]=function(_0x1550c9,_0x5ca7fb,_0xd1971e){var _0x119bb3=path['basename'](_0x1550c9[_0x3a22('0x6a')][_0x3a22('0x6b')],path[_0x3a22('0x6c')](_0x1550c9['file'][_0x3a22('0x6b')]));var _0x41526f=path[_0x3a22('0x4e')](config[_0x3a22('0x6d')],_0x3a22('0x4f'),_0x1550c9[_0x3a22('0x6a')][_0x3a22('0x6b')]);var _0x3765cd=path['join'](config[_0x3a22('0x6d')],_0x3a22('0x4f'),_0x119bb3);logger[_0x3a22('0x65')]('Plugin\x20upload\x20filepath:\x20%s',_0x41526f);logger[_0x3a22('0x65')](_0x3a22('0x6e'),_0x3765cd);try{fs['chmodSync'](_0x41526f,parseInt(_0x3a22('0x6f'),0x8));extract(_0x41526f,{'dir':_0x3765cd},function(_0x597d77){if(_0x597d77){logger['error'](_0x597d77);handleError(_0x597d77,!![]);};var _0x429978=fs['readdirSync'](_0x3765cd);if(_0x429978[_0x3a22('0x48')]>0x1){removeReferences(_0x41526f,_0x3765cd);logger[_0x3a22('0x2f')](_0x3a22('0x70'));return _0xd1971e(new Error(_0x3a22('0x70')));}var _0x41d2ad=fs[_0x3a22('0x71')](path[_0x3a22('0x4e')](_0x3765cd,_0x429978[0x0]));if(_0x41d2ad[_0x3a22('0x72')]()){removeReferences(_0x41526f,_0x3765cd);logger[_0x3a22('0x2f')](_0x3a22('0x70'));return _0xd1971e(new Error(_0x3a22('0x70')));}if(_0x41d2ad['isDirectory']()){var _0x33d192=fs[_0x3a22('0x73')](path[_0x3a22('0x4e')](_0x3765cd,_0x429978[0x0]));if(_0x33d192['length']===0x0){removeReferences(_0x41526f,_0x3765cd);logger[_0x3a22('0x2f')](_0x3a22('0x70'));return _0xd1971e(new Error(_0x3a22('0x70')));}var _0x58a34f=_0x33d192[_0x3a22('0x74')](function(_0x3a82b6){return _0x3a82b6===_0x3a22('0x75');});if(!_0x58a34f){return _0xd1971e(new Error(_0x3a22('0x76')));}var _0x313d65=fs[_0x3a22('0x77')](path['join'](_0x3765cd,_0x429978[0x0],'manifest.json'));var _0xdd0805=JSON[_0x3a22('0x78')](_0x313d65);if(_0x3a22('0x23')==typeof _0xdd0805[_0x3a22('0x36')]){return _0xd1971e(new Error(_0x3a22('0x79')));}if(_0x3a22('0x23')==typeof _0xdd0805[_0x3a22('0x35')]){return _0xd1971e(new Error(_0x3a22('0x7a')));}if('undefined'==typeof _0xdd0805[_0x3a22('0x7b')]){return _0xd1971e(new Error(_0x3a22('0x7c')));}if(_0x3a22('0x23')==typeof _0xdd0805[_0x3a22('0x7d')]){return _0xd1971e(new Error(_0x3a22('0x7e')));}if(_0xdd0805[_0x3a22('0x35')]===_0x3a22('0x7f')){if(_0x3a22('0x23')==typeof _0xdd0805[_0x3a22('0x7d')]['views']){return _0xd1971e(new Error(_0x3a22('0x80')));}if(_0x3a22('0x23')==typeof _0xdd0805['parameters'][_0x3a22('0x81')][_0x3a22('0x82')]&&_0x3a22('0x23')==typeof _0xdd0805['parameters'][_0x3a22('0x81')]['agent']){return _0xd1971e(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0xdd0805[_0x3a22('0x35')]===_0x3a22('0x83')){if(_0x3a22('0x23')==typeof _0xdd0805['parameters']['scriptName']){return _0xd1971e(new Error(_0x3a22('0x84')));}if('undefined'==typeof _0xdd0805[_0x3a22('0x7d')][_0x3a22('0x85')]){return _0xd1971e(new Error(_0x3a22('0x86')));}}else{return _0xd1971e(new Error(_0x3a22('0x87')));}var _0x1f117a=_0xdd0805[_0x3a22('0x36')];var _0x16cdd6=_0xdd0805[_0x3a22('0x88')];var _0x17f8c6=_0xdd0805['type'];var _0x1dd295=_0xdd0805[_0x3a22('0x89')]?_0xdd0805[_0x3a22('0x89')]:'always';var _0x4be524=_0xdd0805[_0x3a22('0x8a')]?_0xdd0805[_0x3a22('0x8a')]:_0x3a22('0x8b');var _0x424e43='';var _0x371f55='';var _0x2d3587='';var _0x2a858d='';var _0x42fee5=_0xdd0805[_0x3a22('0x7b')];if(_0x17f8c6===_0x3a22('0x7f')){if('undefined'!=typeof _0xdd0805[_0x3a22('0x7d')][_0x3a22('0x81')][_0x3a22('0x82')]){var _0xad601f=_0xdd0805[_0x3a22('0x7d')][_0x3a22('0x81')][_0x3a22('0x82')];if(!/^(f|ht)tps?:\/\//i[_0x3a22('0x8c')](_0xad601f)){_0x424e43=path[_0x3a22('0x4e')]('plugins',_0x119bb3,_0x429978[0x0],_0xad601f);}else{_0x424e43=_0xad601f;}}else{logger[_0x3a22('0x65')](_0x3a22('0x8d'));}if(_0x3a22('0x23')!=typeof _0xdd0805[_0x3a22('0x7d')]['views'][_0x3a22('0x8e')]){var _0x4a3dc1=_0xdd0805[_0x3a22('0x7d')][_0x3a22('0x81')][_0x3a22('0x8e')];if(!/^(f|ht)tps?:\/\//i['test'](_0x4a3dc1)){_0x371f55=path[_0x3a22('0x4e')](_0x3a22('0x8f'),_0x119bb3,_0x429978[0x0],_0x4a3dc1);}else{_0x371f55=_0x4a3dc1;}}else{logger[_0x3a22('0x65')](_0x3a22('0x90'));}}else if(_0x17f8c6===_0x3a22('0x83')){_0x2d3587=_0xdd0805[_0x3a22('0x7d')][_0x3a22('0x91')];_0x2a858d=_0xdd0805['parameters'][_0x3a22('0x85')];if(_0x3a22('0x23')!=typeof _0xdd0805[_0x3a22('0x7d')][_0x3a22('0x81')]){if(_0x3a22('0x23')!=typeof _0xdd0805[_0x3a22('0x7d')][_0x3a22('0x81')][_0x3a22('0x82')]){var _0xad601f=_0xdd0805[_0x3a22('0x7d')][_0x3a22('0x81')]['admin'];if(!/^(f|ht)tps?:\/\//i['test'](_0xad601f)){_0x424e43=path['join']('plugins',_0x119bb3,_0x429978[0x0],_0xad601f);}else{_0x424e43=_0xad601f;}}if('undefined'!=typeof _0xdd0805[_0x3a22('0x7d')][_0x3a22('0x81')]['agent']){var _0x4a3dc1=_0xdd0805[_0x3a22('0x7d')]['views'][_0x3a22('0x8e')];if(!/^(f|ht)tps?:\/\//i[_0x3a22('0x8c')](_0x4a3dc1)){_0x371f55=path[_0x3a22('0x4e')](_0x3a22('0x8f'),_0x119bb3,_0x429978[0x0],_0x4a3dc1);}else{_0x371f55=_0x4a3dc1;}}}}var _0x36ffa5={'name':_0x1f117a,'description':_0x16cdd6,'path':path[_0x3a22('0x4e')](_0x119bb3,_0x429978[0x0]),'type':_0x17f8c6,'sidebar':_0x1dd295,'icon':_0x4be524,'adminUrl':_0x424e43,'agentUrl':_0x371f55,'scriptName':_0x2d3587,'scriptPath':_0x2a858d,'version':_0x42fee5};removeReferences(_0x41526f,null);return db[_0x3a22('0x33')][_0x3a22('0x92')](_0x36ffa5)[_0x3a22('0x2a')](function(_0x2ffb1f){var _0x34bb4e={'role':_0x1550c9['body'][_0x3a22('0x93')],'userProfileId':_0x1550c9[_0x3a22('0x94')][_0x3a22('0x95')]};if(!_0x34bb4e)throw new Error(_0x3a22('0x96'));if(_0x34bb4e['role']==='user'){var _0x5f544a=_0x2ffb1f[_0x3a22('0x2c')]({'plain':!![]});return db[_0x3a22('0x97')][_0x3a22('0x4b')]({'where':{'name':_0x3a22('0x2d'),'userProfileId':_0x34bb4e[_0x3a22('0x95')]},'raw':!![]})[_0x3a22('0x2a')](function(_0x54bb58){if(_0x54bb58&&_0x54bb58[_0x3a22('0x98')]===0x0){return db['UserProfileResource'][_0x3a22('0x92')]({'name':_0x5f544a[_0x3a22('0x36')],'resourceId':_0x5f544a['id'],'type':_0x54bb58[_0x3a22('0x36')],'sectionId':_0x54bb58['id']},{})['then'](function(){return _0x2ffb1f;});}else{return _0x2ffb1f;}})['catch'](function(_0x324696){logger[_0x3a22('0x2f')](_0x3a22('0x99'),_0x324696);throw _0x324696;});}return _0x2ffb1f;})[_0x3a22('0x2a')](respondWithResult(_0x5ca7fb,null))[_0x3a22('0x68')](handleError(_0x5ca7fb,null));}});}catch(_0x255411){_0x5ca7fb[_0x3a22('0x1f')](0x1f4)[_0x3a22('0x30')](_0x255411);}};function removeReferences(_0x106123,_0x3da539){try{if(_0x106123){fs['unlinkSync'](_0x106123);logger['info'](_0x3a22('0x9a'));}if(_0x3da539){rimraf(_0x3da539,function(){});logger[_0x3a22('0x65')]('Extracted\x20folder\x20removed');}}catch(_0x27bd17){logger[_0x3a22('0x2f')](_0x27bd17);}}exports['update']=function(_0x2bfd88,_0x8b1b1f,_0x27f4db){return db['Plugin']['find']({'where':{'id':_0x2bfd88[_0x3a22('0x46')]['id']}})[_0x3a22('0x2a')](handleEntityNotFound(_0x8b1b1f,null))[_0x3a22('0x2a')](saveUpdates(_0x2bfd88[_0x3a22('0x94')],null))[_0x3a22('0x2a')](respondWithResult(_0x8b1b1f,null))[_0x3a22('0x68')](handleError(_0x8b1b1f,null));};exports[_0x3a22('0x9b')]=function(_0x1c7545,_0x1c47a0,_0x409c03){return db['Plugin'][_0x3a22('0x4b')]({'where':{'id':_0x1c7545['params']['id']}})[_0x3a22('0x2a')](function(_0x558526){if(_0x558526){return _0x558526['destroy']();}})[_0x3a22('0x2a')](function(_0x48d743){rimraf(path['join'](config[_0x3a22('0x6d')],'server/files/plugins',path[_0x3a22('0x5c')](_0x48d743[_0x3a22('0x4d')])),function(){});return _0x48d743;})[_0x3a22('0x2a')](handleEntityNotFound(_0x1c47a0,null))[_0x3a22('0x2a')](respondWithStatusCode(_0x1c47a0,null))['catch'](handleError(_0x1c47a0,null));};exports['webhookGet']=function(_0x2297ff,_0x121e4a,_0x31475d){return BPromise[_0x3a22('0x9c')]()[_0x3a22('0x2a')](function(){if(!_0x2297ff[_0x3a22('0x38')][_0x3a22('0x4d')]){throw new Error(_0x3a22('0x9d'));}if(!_0x2297ff[_0x3a22('0x38')][_0x3a22('0x9e')]){throw new Error(_0x3a22('0x9f'));}var _0x3fc401=_0x2297ff[_0x3a22('0x38')][_0x3a22('0xa0')]?_0x2297ff['query'][_0x3a22('0xa0')]+':'+_0x2297ff[_0x3a22('0x38')]['port']:_0x3a22('0xa1')+_0x2297ff['query']['port'];var _0xe1e544=_0x2297ff['query']['json']?_0x2297ff['query'][_0x3a22('0x21')]:!![];var _0xa743dc=_0x2297ff[_0x3a22('0x38')]['encoding']?_0x2297ff[_0x3a22('0x38')][_0x3a22('0xa2')]:null;var _0x4f8303={'method':_0x2297ff[_0x3a22('0xa3')],'uri':util['format'](_0x3a22('0xa4'),_0x3fc401,_0x2297ff['query'][_0x3a22('0x4d')]),'json':_0xe1e544,'resolveWithFullResponse':!![],'encoding':_0xa743dc,'qs':_0x2297ff[_0x3a22('0x38')]};if(_0x2297ff[_0x3a22('0xa5')]){_0x4f8303[_0x3a22('0xa5')]=_0x2297ff['headers'];if(_0x4f8303[_0x3a22('0xa5')][_0x3a22('0xa6')]){delete _0x4f8303['headers']['content-length'];}}if(_0x4f8303['headers'][_0x3a22('0xa7')]){delete _0x4f8303[_0x3a22('0xa5')][_0x3a22('0xa7')];}return rp(_0x4f8303);})[_0x3a22('0x2a')](function(_0xa33d6){if(_0xa33d6){_0x121e4a[_0x3a22('0x26')](_0xa33d6['headers']);logger[_0x3a22('0x65')](_0xa33d6['body']);if(_[_0x3a22('0xa8')](_0x2297ff['query'][_0x3a22('0x4d')],_0x3a22('0x4c'))&&_0xa33d6[_0x3a22('0xa9')]==0x1f4){return _0x121e4a[_0x3a22('0x1e')](_0xa33d6[_0x3a22('0xa9')]);}else{return _0x121e4a[_0x3a22('0x1f')](_0xa33d6['statusCode'])['send'](_0xa33d6[_0x3a22('0x94')]);}}else{return _0x121e4a[_0x3a22('0x1e')](0xc8);}})['catch'](handleError(_0x121e4a,null));};exports['webhookPost']=function(_0x4036c1,_0x347cc3,_0x1d9c2e){return BPromise[_0x3a22('0x9c')]()[_0x3a22('0x2a')](function(){if(!_0x4036c1['query'][_0x3a22('0x4d')]){throw new Error(_0x3a22('0x9d'));}if(!_0x4036c1[_0x3a22('0x38')][_0x3a22('0x9e')]){throw new Error(_0x3a22('0x9f'));}var _0x5eaa63=_0x4036c1[_0x3a22('0x38')]['hostname']?_0x4036c1[_0x3a22('0x38')][_0x3a22('0xa0')]+':'+_0x4036c1[_0x3a22('0x38')]['port']:_0x3a22('0xa1')+_0x4036c1[_0x3a22('0x38')][_0x3a22('0x9e')];var _0x4e251b=_0x4036c1[_0x3a22('0x38')]['json']?_0x4036c1[_0x3a22('0x38')][_0x3a22('0x21')]:!![];var _0x5f5301=_0x4036c1[_0x3a22('0x38')][_0x3a22('0xa2')]?_0x4036c1['query'][_0x3a22('0xa2')]:null;var _0x3232c9={'method':_0x4036c1['method'],'uri':util['format'](_0x3a22('0xa4'),_0x5eaa63,_0x4036c1['query'][_0x3a22('0x4d')]),'json':_0x4e251b,'resolveWithFullResponse':!![],'encoding':_0x5f5301,'body':_0x4036c1[_0x3a22('0x94')]};if(_0x4036c1[_0x3a22('0xa5')]){_0x3232c9[_0x3a22('0xa5')]=_0x4036c1[_0x3a22('0xa5')];if(_0x3232c9['headers'][_0x3a22('0xa6')]){delete _0x3232c9['headers'][_0x3a22('0xa6')];}}if(_0x3232c9['headers'][_0x3a22('0xa7')]){delete _0x3232c9[_0x3a22('0xa5')][_0x3a22('0xa7')];}return rp(_0x3232c9);})[_0x3a22('0x2a')](function(_0x24b2c5){if(_0x24b2c5){_0x347cc3['set'](_0x24b2c5[_0x3a22('0xa5')]);logger[_0x3a22('0x65')](_0x24b2c5[_0x3a22('0x94')]);return _0x347cc3[_0x3a22('0x1f')](_0x24b2c5[_0x3a22('0xa9')])[_0x3a22('0x30')](_0x24b2c5[_0x3a22('0x94')]);}else{return _0x347cc3[_0x3a22('0x1e')](0xc8);}})[_0x3a22('0x68')](handleError(_0x347cc3,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 7e3a6f4..8dcc3f2 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 _0xbe2a=['events','../../mysqldb','Plugin','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x2dc97a,_0x23d044){var _0x8f4238=function(_0x2cc7a4){while(--_0x2cc7a4){_0x2dc97a['push'](_0x2dc97a['shift']());}};_0x8f4238(++_0x23d044);}(_0xbe2a,0x1d9));var _0xabe2=function(_0x2c3502,_0x400c13){_0x2c3502=_0x2c3502-0x0;var _0x330444=_0xbe2a[_0x2c3502];return _0x330444;};'use strict';var EventEmitter=require(_0xabe2('0x0'));var Plugin=require(_0xabe2('0x1'))['db'][_0xabe2('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0xabe2('0x3')](0x0);var events={'afterCreate':_0xabe2('0x4'),'afterUpdate':_0xabe2('0x5'),'afterDestroy':_0xabe2('0x6')};function emitEvent(_0x485cec){return function(_0x42fbad,_0x4f80bf,_0x472f4b){PluginEvents[_0xabe2('0x7')](_0x485cec+':'+_0x42fbad['id'],_0x42fbad);PluginEvents[_0xabe2('0x7')](_0x485cec,_0x42fbad);_0x472f4b(null);};}for(var e in events){if(events[_0xabe2('0x8')](e)){var event=events[e];Plugin[_0xabe2('0x9')](e,emitEvent(event));}}module[_0xabe2('0xa')]=PluginEvents; \ No newline at end of file +var _0x4312=['Plugin','setMaxListeners','update','remove','emit','hook','exports'];(function(_0x37c07d,_0xdbdb5f){var _0x10dadc=function(_0x2bafb7){while(--_0x2bafb7){_0x37c07d['push'](_0x37c07d['shift']());}};_0x10dadc(++_0xdbdb5f);}(_0x4312,0xaf));var _0x2431=function(_0x3d9ba7,_0x1c8b5f){_0x3d9ba7=_0x3d9ba7-0x0;var _0x4621ce=_0x4312[_0x3d9ba7];return _0x4621ce;};'use strict';var EventEmitter=require('events');var Plugin=require('../../mysqldb')['db'][_0x2431('0x0')];var PluginEvents=new EventEmitter();PluginEvents[_0x2431('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2431('0x2'),'afterDestroy':_0x2431('0x3')};function emitEvent(_0x728b00){return function(_0x237ac5,_0x22db34,_0xbf4fd6){PluginEvents['emit'](_0x728b00+':'+_0x237ac5['id'],_0x237ac5);PluginEvents[_0x2431('0x4')](_0x728b00,_0x237ac5);_0xbf4fd6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0x2431('0x5')](e,emitEvent(event));}}module[_0x2431('0x6')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index a767ae9..2d283de 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 _0xb9b3=['./plugin.attributes','exports','Plugin','plugins','lodash','util','api','moment','path','rimraf','../../config/environment'];(function(_0xf58528,_0x21e6f6){var _0x39d597=function(_0x50b482){while(--_0x50b482){_0xf58528['push'](_0xf58528['shift']());}};_0x39d597(++_0x21e6f6);}(_0xb9b3,0x1a6));var _0x3b9b=function(_0x1fa56c,_0x42d719){_0x1fa56c=_0x1fa56c-0x0;var _0x1553b8=_0xb9b3[_0x1fa56c];return _0x1553b8;};'use strict';var _=require(_0x3b9b('0x0'));var util=require(_0x3b9b('0x1'));var logger=require('../../config/logger')(_0x3b9b('0x2'));var moment=require(_0x3b9b('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3b9b('0x4'));var rimraf=require(_0x3b9b('0x5'));var config=require(_0x3b9b('0x6'));var attributes=require(_0x3b9b('0x7'));module[_0x3b9b('0x8')]=function(_0x5988c3,_0xad5cd){return _0x5988c3['define'](_0x3b9b('0x9'),attributes,{'tableName':_0x3b9b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xca26=['exports','define','plugins','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./plugin.attributes'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0xca26,0x1b3));var _0x6ca2=function(_0x4b67cc,_0x48e7bc){_0x4b67cc=_0x4b67cc-0x0;var _0x3f1a32=_0xca26[_0x4b67cc];return _0x3f1a32;};'use strict';var _=require(_0x6ca2('0x0'));var util=require(_0x6ca2('0x1'));var logger=require(_0x6ca2('0x2'))(_0x6ca2('0x3'));var moment=require('moment');var BPromise=require(_0x6ca2('0x4'));var rp=require(_0x6ca2('0x5'));var fs=require('fs');var path=require(_0x6ca2('0x6'));var rimraf=require(_0x6ca2('0x7'));var config=require('../../config/environment');var attributes=require(_0x6ca2('0x8'));module[_0x6ca2('0x9')]=function(_0x26d5a6,_0x10eae2){return _0x26d5a6[_0x6ca2('0xa')]('Plugin',attributes,{'tableName':_0x6ca2('0xb'),'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 fd97ab4..5b5c7d1 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 _0xc2ee=['moment','bluebird','ioredis','../../mysqldb','jayson/promise','http','redis','defaults','localhost','./plugin.socket','register','request','info','Plugin,\x20%s,\x20%s','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreatePlugin','Plugin','create','body','options','raw','then','debug','lodash','util'];(function(_0x773189,_0x34eb81){var _0x47eea4=function(_0x3d923c){while(--_0x3d923c){_0x773189['push'](_0x773189['shift']());}};_0x47eea4(++_0x34eb81);}(_0xc2ee,0x7a));var _0xec2e=function(_0x3a65f6,_0x58863a){_0x3a65f6=_0x3a65f6-0x0;var _0x111bf6=_0xc2ee[_0x3a65f6];return _0x111bf6;};'use strict';var _=require(_0xec2e('0x0'));var util=require(_0xec2e('0x1'));var moment=require(_0xec2e('0x2'));var BPromise=require(_0xec2e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xec2e('0x4'));var db=require(_0xec2e('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xec2e('0x6'));var client=jayson['client'][_0xec2e('0x7')]({'port':0x232a});config[_0xec2e('0x8')]=_[_0xec2e('0x9')](config[_0xec2e('0x8')],{'host':_0xec2e('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xec2e('0xb'))[_0xec2e('0xc')](socket);function respondWithRpcPromise(_0x536842,_0x943080,_0x5616ba){return new BPromise(function(_0x359a54,_0x25ac73){return client[_0xec2e('0xd')](_0x536842,_0x5616ba)['then'](function(_0x3be6a9){logger[_0xec2e('0xe')](_0xec2e('0xf'),_0x943080,_0xec2e('0x10'));logger['debug'](_0xec2e('0x11'),_0x943080,_0xec2e('0x10'),JSON[_0xec2e('0x12')](_0x3be6a9));if(_0x3be6a9[_0xec2e('0x13')]){if(_0x3be6a9[_0xec2e('0x13')][_0xec2e('0x14')]===0x1f4){logger[_0xec2e('0x13')]('Plugin,\x20%s,\x20%s',_0x943080,_0x3be6a9[_0xec2e('0x13')][_0xec2e('0x15')]);return _0x25ac73(_0x3be6a9[_0xec2e('0x13')][_0xec2e('0x15')]);}logger[_0xec2e('0x13')](_0xec2e('0xf'),_0x943080,_0x3be6a9['error'][_0xec2e('0x15')]);return _0x359a54(_0x3be6a9[_0xec2e('0x13')]['message']);}else{logger['info'](_0xec2e('0xf'),_0x943080,_0xec2e('0x10'));_0x359a54(_0x3be6a9['result']['message']);}})[_0xec2e('0x16')](function(_0xe3f5b4){logger[_0xec2e('0x13')](_0xec2e('0xf'),_0x943080,_0xe3f5b4);_0x25ac73(_0xe3f5b4);});});}exports[_0xec2e('0x17')]=function(_0x36a979){var _0xf64ab5=this;return new Promise(function(_0x3f082f,_0x5833f8){return db[_0xec2e('0x18')][_0xec2e('0x19')](_0x36a979[_0xec2e('0x1a')],{'raw':_0x36a979[_0xec2e('0x1b')]?_0x36a979[_0xec2e('0x1b')][_0xec2e('0x1c')]===undefined?!![]:![]:!![]})[_0xec2e('0x1d')](function(_0x310b5a){logger[_0xec2e('0xe')](_0xec2e('0x17'),_0x36a979);logger[_0xec2e('0x1e')](_0xec2e('0x17'),_0x36a979,JSON[_0xec2e('0x12')](_0x310b5a));_0x3f082f(_0x310b5a);})[_0xec2e('0x16')](function(_0x10b7cd){logger[_0xec2e('0x13')](_0xec2e('0x17'),_0x10b7cd[_0xec2e('0x15')],_0x36a979);_0x5833f8(_0xf64ab5[_0xec2e('0x13')](0x1f4,_0x10b7cd[_0xec2e('0x15')]));});});}; \ No newline at end of file +var _0x81f6=['../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','request','then','info','request\x20sent','stringify','error','code','Plugin,\x20%s,\x20%s','message','result','catch','CreatePlugin','create','body','options','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x465223,_0x16a1e1){var _0xdbb6d4=function(_0x3a4409){while(--_0x3a4409){_0x465223['push'](_0x465223['shift']());}};_0xdbb6d4(++_0x16a1e1);}(_0x81f6,0x107));var _0x681f=function(_0x383d3a,_0xc9739c){_0x383d3a=_0x383d3a-0x0;var _0x485633=_0x81f6[_0x383d3a];return _0x485633;};'use strict';var _=require(_0x681f('0x0'));var util=require('util');var moment=require(_0x681f('0x1'));var BPromise=require('bluebird');var rs=require(_0x681f('0x2'));var fs=require('fs');var Redis=require(_0x681f('0x3'));var db=require(_0x681f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x681f('0x5'))(_0x681f('0x6'));var config=require(_0x681f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x681f('0x8')]['http']({'port':0x232a});config[_0x681f('0x9')]=_[_0x681f('0xa')](config[_0x681f('0x9')],{'host':_0x681f('0xb'),'port':0x18eb});var socket=require(_0x681f('0xc'))(new Redis(config['redis']));require(_0x681f('0xd'))[_0x681f('0xe')](socket);function respondWithRpcPromise(_0x33197,_0x40b240,_0x1d684b){return new BPromise(function(_0x5506a5,_0x78e260){return client[_0x681f('0xf')](_0x33197,_0x1d684b)[_0x681f('0x10')](function(_0x3ffbe7){logger[_0x681f('0x11')]('Plugin,\x20%s,\x20%s',_0x40b240,_0x681f('0x12'));logger['debug']('Plugin,\x20%s,\x20%s,\x20%s',_0x40b240,_0x681f('0x12'),JSON[_0x681f('0x13')](_0x3ffbe7));if(_0x3ffbe7[_0x681f('0x14')]){if(_0x3ffbe7[_0x681f('0x14')][_0x681f('0x15')]===0x1f4){logger['error'](_0x681f('0x16'),_0x40b240,_0x3ffbe7[_0x681f('0x14')]['message']);return _0x78e260(_0x3ffbe7[_0x681f('0x14')]['message']);}logger['error']('Plugin,\x20%s,\x20%s',_0x40b240,_0x3ffbe7[_0x681f('0x14')][_0x681f('0x17')]);return _0x5506a5(_0x3ffbe7['error'][_0x681f('0x17')]);}else{logger[_0x681f('0x11')](_0x681f('0x16'),_0x40b240,_0x681f('0x12'));_0x5506a5(_0x3ffbe7[_0x681f('0x18')][_0x681f('0x17')]);}})[_0x681f('0x19')](function(_0xf0b5bb){logger[_0x681f('0x14')]('Plugin,\x20%s,\x20%s',_0x40b240,_0xf0b5bb);_0x78e260(_0xf0b5bb);});});}exports[_0x681f('0x1a')]=function(_0x14c9a8){var _0x5c8e6e=this;return new Promise(function(_0x1a8124,_0x43857b){return db['Plugin'][_0x681f('0x1b')](_0x14c9a8[_0x681f('0x1c')],{'raw':_0x14c9a8['options']?_0x14c9a8[_0x681f('0x1d')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x5807fe){logger[_0x681f('0x11')](_0x681f('0x1a'),_0x14c9a8);logger['debug'](_0x681f('0x1a'),_0x14c9a8,JSON['stringify'](_0x5807fe));_0x1a8124(_0x5807fe);})['catch'](function(_0x2560b8){logger['error'](_0x681f('0x1a'),_0x2560b8['message'],_0x14c9a8);_0x43857b(_0x5c8e6e[_0x681f('0x14')](0x1f4,_0x2560b8['message']));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index e370f59..83f3ff6 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 _0x6d8e=['./plugin.events','update','register','length','plugin:'];(function(_0x28ee74,_0x289441){var _0x6cc80c=function(_0x16ee15){while(--_0x16ee15){_0x28ee74['push'](_0x28ee74['shift']());}};_0x6cc80c(++_0x289441);}(_0x6d8e,0x113));var _0xe6d8=function(_0xf1d032,_0x5be2a2){_0xf1d032=_0xf1d032-0x0;var _0x12cf47=_0x6d8e[_0xf1d032];return _0x12cf47;};'use strict';var PluginEvents=require(_0xe6d8('0x0'));var events=['save','remove',_0xe6d8('0x1')];function createListener(_0x13d463,_0x41d824){return function(_0x4fbf86){_0x41d824['emit'](_0x13d463,_0x4fbf86);};}function removeListener(_0x249fc8,_0x1aaa23){return function(){PluginEvents['removeListener'](_0x249fc8,_0x1aaa23);};}exports[_0xe6d8('0x2')]=function(_0x51dab8){for(var _0x54db79=0x0,_0x307b6c=events[_0xe6d8('0x3')];_0x54db79<_0x307b6c;_0x54db79++){var _0x5c3651=events[_0x54db79];var _0x34a13c=createListener(_0xe6d8('0x4')+_0x5c3651,_0x51dab8);PluginEvents['on'](_0x5c3651,_0x34a13c);}}; \ No newline at end of file +var _0xacc2=['register','plugin:','save','remove','emit','removeListener'];(function(_0x166a39,_0x26980d){var _0x401703=function(_0x52d622){while(--_0x52d622){_0x166a39['push'](_0x166a39['shift']());}};_0x401703(++_0x26980d);}(_0xacc2,0x104));var _0x2acc=function(_0x385870,_0x4518b2){_0x385870=_0x385870-0x0;var _0x2ff8be=_0xacc2[_0x385870];return _0x2ff8be;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0x2acc('0x0'),_0x2acc('0x1'),'update'];function createListener(_0x206f64,_0x532493){return function(_0x450cc0){_0x532493[_0x2acc('0x2')](_0x206f64,_0x450cc0);};}function removeListener(_0x4ba539,_0x41b03d){return function(){PluginEvents[_0x2acc('0x3')](_0x4ba539,_0x41b03d);};}exports[_0x2acc('0x4')]=function(_0x461dca){for(var _0x1a7864=0x0,_0xa0350a=events['length'];_0x1a7864<_0xa0350a;_0x1a7864++){var _0x39a7fb=events[_0x1a7864];var _0x2f7435=createListener(_0x2acc('0x5')+_0x39a7fb,_0x461dca);PluginEvents['on'](_0x39a7fb,_0x2f7435);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 1af7ce3..0aca96a 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(_0x187dc8,_0x526ed6){var _0xb02eaa=function(_0x1e6dc5){while(--_0x1e6dc5){_0x187dc8['push'](_0x187dc8['shift']());}};_0xb02eaa(++_0x526ed6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'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(_0x586952,_0x20ffa4){var _0x2a7e83=function(_0x4ee120){while(--_0x4ee120){_0x586952['push'](_0x586952['shift']());}};_0x2a7e83(++_0x20ffa4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router; \ No newline at end of file diff --git a/server/api/pm2/pm2.controller.js b/server/api/pm2/pm2.controller.js index 396d599..ec7026c 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 _0x5b02=['../../files/plugins','cwd','dirname','chdir','start','dump','Missing\x20name\x20and/or\x20path','update','Unknown\x20status','destroy','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','exec','sendStatus','status','error','stack','name','send','npm\x20install','info','index','list','then','reject','motion2','catch','show','describe','params','create','body','script','join'];(function(_0x4cb272,_0x52c0e9){var _0x57b4aa=function(_0x1efefb){while(--_0x1efefb){_0x4cb272['push'](_0x4cb272['shift']());}};_0x57b4aa(++_0x52c0e9);}(_0x5b02,0xe9));var _0x25b0=function(_0x9c495f,_0x3066b){_0x9c495f=_0x9c495f-0x0;var _0x51eec5=_0x5b02[_0x9c495f];return _0x51eec5;};'use strict';var _=require(_0x25b0('0x0'));var pm2=require(_0x25b0('0x1'));var logger=require(_0x25b0('0x2'))(_0x25b0('0x3'));var path=require('path');var exec=require('child_process')[_0x25b0('0x4')];var BPromise=require('bluebird');function handleEntityNotFound(_0x3e1d20,_0x31c9c2){return function(_0x38dc14){if(!_0x38dc14){_0x3e1d20[_0x25b0('0x5')](0x194);;}return _0x38dc14;};}function respondWithResult(_0x2d84a9,_0x4eea55){_0x4eea55=_0x4eea55||0xc8;return function(_0x1d82c6){if(_0x1d82c6){return _0x2d84a9[_0x25b0('0x6')](_0x4eea55)['json'](_0x1d82c6);}return null;};}function handleError(_0x412954,_0x4d3e71){_0x4d3e71=_0x4d3e71||0x1f4;return function(_0x56feca){logger[_0x25b0('0x7')](_0x56feca[_0x25b0('0x8')]);if(_0x56feca[_0x25b0('0x9')]){delete _0x56feca['name'];}_0x412954[_0x25b0('0x6')](_0x4d3e71)[_0x25b0('0xa')](_0x56feca);};}function execChildProcess(){return new BPromise(function(_0x135afb,_0x250d31){exec(_0x25b0('0xb'),function(_0x2f57af,_0x44afbc,_0x10c3fb){logger[_0x25b0('0xc')](_0x44afbc);logger[_0x25b0('0xc')](_0x10c3fb);if(_0x2f57af){logger[_0x25b0('0x7')](_0x2f57af);return _0x250d31(_0x2f57af);}return _0x135afb(_0x44afbc);});});}exports[_0x25b0('0xd')]=function(_0x2048dc,_0x3655c2){return pm2[_0x25b0('0xe')]()[_0x25b0('0xf')](function(_0x293203){if(_0x293203){var _0x211658=_[_0x25b0('0x10')](_0x293203,function(_0x3b89e7){return _0x3b89e7[_0x25b0('0x9')]==='express'||_0x3b89e7['name']===_0x25b0('0x11');});return{'rows':_0x211658,'count':_0x211658['length']};}return null;})[_0x25b0('0xf')](respondWithResult(_0x3655c2,null))[_0x25b0('0x12')](handleError(_0x3655c2,null));};exports[_0x25b0('0x13')]=function(_0x3267b9,_0x5e3a3a){return pm2[_0x25b0('0x14')](_0x3267b9[_0x25b0('0x15')]['id'])[_0x25b0('0xf')](respondWithResult(_0x5e3a3a,null))[_0x25b0('0xf')](handleEntityNotFound(_0x5e3a3a,null))[_0x25b0('0x12')](handleError(_0x5e3a3a,null));};exports[_0x25b0('0x16')]=function(_0x54f458,_0x348d36){if(_0x54f458[_0x25b0('0x17')][_0x25b0('0x9')]&&_0x54f458[_0x25b0('0x17')][_0x25b0('0x18')]){var _0xea4162=path[_0x25b0('0x19')](__dirname,_0x25b0('0x1a'),_0x54f458[_0x25b0('0x17')][_0x25b0('0x18')]);var _0x2b2eda=process[_0x25b0('0x1b')]();process['chdir'](path[_0x25b0('0x1c')](_0xea4162));return execChildProcess()[_0x25b0('0xf')](function(_0x517ec5){process[_0x25b0('0x1d')](_0x2b2eda);return pm2[_0x25b0('0x1e')]({'name':_0x54f458[_0x25b0('0x17')]['name'],'script':_0xea4162});})['then'](function(_0x50089e){pm2[_0x25b0('0x1f')]();return _0x50089e[0x0];})[_0x25b0('0xf')](respondWithResult(_0x348d36,0xc9))[_0x25b0('0x12')](handleError(_0x348d36,null));}else{return _0x348d36[_0x25b0('0x6')](0x1f4)[_0x25b0('0xa')]({'message':_0x25b0('0x20')});}};exports[_0x25b0('0x21')]=function(_0x75ce7a,_0x22e024){if(_0x75ce7a['body']['id']){delete _0x75ce7a[_0x25b0('0x17')]['id'];}var _0xbfba84={'online':'restart','stopped':'stop'};if(_0xbfba84['hasOwnProperty'](_0x75ce7a[_0x25b0('0x17')][_0x25b0('0x6')])){return pm2[_0xbfba84[_0x75ce7a[_0x25b0('0x17')][_0x25b0('0x6')]]](_0x75ce7a[_0x25b0('0x15')]['id'])[_0x25b0('0xf')](respondWithResult(_0x22e024,0xc8))[_0x25b0('0x12')](handleError(_0x22e024,null));}else{return _0x22e024[_0x25b0('0x6')](0x1f4)[_0x25b0('0xa')]({'message':_0x25b0('0x22')});}};exports[_0x25b0('0x23')]=function(_0x3161c1,_0x1ea374){if(_0x3161c1['body']['id']){delete _0x3161c1['body']['id'];}if(_0x3161c1[_0x25b0('0x15')]['id']){return pm2['delete'](_0x3161c1['params']['id'])[_0x25b0('0xf')](function(_0x419975){pm2[_0x25b0('0x1f')]();return _0x419975[0x0];})[_0x25b0('0xf')](respondWithResult(_0x1ea374,null))[_0x25b0('0x12')](handleError(_0x1ea374,null));}else{return _0x1ea374['status'](0x1f4)[_0x25b0('0xa')]({'message':_0x25b0('0x24')});}}; \ No newline at end of file +var _0xc788=['body','script','join','../../files/plugins','chdir','dirname','start','dump','send','update','stop','hasOwnProperty','Unknown\x20status','params','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','child_process','exec','bluebird','sendStatus','status','error','stack','name','info','index','list','then','reject','motion2','catch','show','describe'];(function(_0x51e395,_0x5bfe2c){var _0x12ccef=function(_0x2ed6d1){while(--_0x2ed6d1){_0x51e395['push'](_0x51e395['shift']());}};_0x12ccef(++_0x5bfe2c);}(_0xc788,0xc4));var _0x8c78=function(_0x28beaf,_0x122959){_0x28beaf=_0x28beaf-0x0;var _0x2df201=_0xc788[_0x28beaf];return _0x2df201;};'use strict';var _=require(_0x8c78('0x0'));var pm2=require(_0x8c78('0x1'));var logger=require(_0x8c78('0x2'))('api');var path=require('path');var exec=require(_0x8c78('0x3'))[_0x8c78('0x4')];var BPromise=require(_0x8c78('0x5'));function handleEntityNotFound(_0x1d0670,_0x386f0a){return function(_0x5498f9){if(!_0x5498f9){_0x1d0670[_0x8c78('0x6')](0x194);;}return _0x5498f9;};}function respondWithResult(_0x4555da,_0x329152){_0x329152=_0x329152||0xc8;return function(_0x1ac27f){if(_0x1ac27f){return _0x4555da[_0x8c78('0x7')](_0x329152)['json'](_0x1ac27f);}return null;};}function handleError(_0x247188,_0x299d9d){_0x299d9d=_0x299d9d||0x1f4;return function(_0x9bc075){logger[_0x8c78('0x8')](_0x9bc075[_0x8c78('0x9')]);if(_0x9bc075[_0x8c78('0xa')]){delete _0x9bc075['name'];}_0x247188[_0x8c78('0x7')](_0x299d9d)['send'](_0x9bc075);};}function execChildProcess(){return new BPromise(function(_0x3d55f0,_0x45935a){exec('npm\x20install',function(_0x1a05a7,_0x95e78e,_0x5ee642){logger[_0x8c78('0xb')](_0x95e78e);logger['info'](_0x5ee642);if(_0x1a05a7){logger['error'](_0x1a05a7);return _0x45935a(_0x1a05a7);}return _0x3d55f0(_0x95e78e);});});}exports[_0x8c78('0xc')]=function(_0x1b1d0e,_0x26178c){return pm2[_0x8c78('0xd')]()[_0x8c78('0xe')](function(_0x3d1306){if(_0x3d1306){var _0xe5f8ae=_[_0x8c78('0xf')](_0x3d1306,function(_0x2f44af){return _0x2f44af[_0x8c78('0xa')]==='express'||_0x2f44af[_0x8c78('0xa')]===_0x8c78('0x10');});return{'rows':_0xe5f8ae,'count':_0xe5f8ae['length']};}return null;})[_0x8c78('0xe')](respondWithResult(_0x26178c,null))[_0x8c78('0x11')](handleError(_0x26178c,null));};exports[_0x8c78('0x12')]=function(_0x23824e,_0x2a982c){return pm2[_0x8c78('0x13')](_0x23824e['params']['id'])['then'](respondWithResult(_0x2a982c,null))[_0x8c78('0xe')](handleEntityNotFound(_0x2a982c,null))['catch'](handleError(_0x2a982c,null));};exports['create']=function(_0xece4f0,_0x56c191){if(_0xece4f0[_0x8c78('0x14')][_0x8c78('0xa')]&&_0xece4f0['body'][_0x8c78('0x15')]){var _0x5b111b=path[_0x8c78('0x16')](__dirname,_0x8c78('0x17'),_0xece4f0['body'][_0x8c78('0x15')]);var _0x188cc3=process['cwd']();process[_0x8c78('0x18')](path[_0x8c78('0x19')](_0x5b111b));return execChildProcess()[_0x8c78('0xe')](function(_0x9581c6){process[_0x8c78('0x18')](_0x188cc3);return pm2[_0x8c78('0x1a')]({'name':_0xece4f0[_0x8c78('0x14')][_0x8c78('0xa')],'script':_0x5b111b});})[_0x8c78('0xe')](function(_0x4a7d20){pm2[_0x8c78('0x1b')]();return _0x4a7d20[0x0];})[_0x8c78('0xe')](respondWithResult(_0x56c191,0xc9))[_0x8c78('0x11')](handleError(_0x56c191,null));}else{return _0x56c191['status'](0x1f4)[_0x8c78('0x1c')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x8c78('0x1d')]=function(_0x24f9a7,_0x8d9ff9){if(_0x24f9a7['body']['id']){delete _0x24f9a7[_0x8c78('0x14')]['id'];}var _0x2568d5={'online':'restart','stopped':_0x8c78('0x1e')};if(_0x2568d5[_0x8c78('0x1f')](_0x24f9a7[_0x8c78('0x14')][_0x8c78('0x7')])){return pm2[_0x2568d5[_0x24f9a7[_0x8c78('0x14')][_0x8c78('0x7')]]](_0x24f9a7['params']['id'])[_0x8c78('0xe')](respondWithResult(_0x8d9ff9,0xc8))['catch'](handleError(_0x8d9ff9,null));}else{return _0x8d9ff9[_0x8c78('0x7')](0x1f4)[_0x8c78('0x1c')]({'message':_0x8c78('0x20')});}};exports['destroy']=function(_0x1f1a0c,_0x3816d2){if(_0x1f1a0c['body']['id']){delete _0x1f1a0c[_0x8c78('0x14')]['id'];}if(_0x1f1a0c[_0x8c78('0x21')]['id']){return pm2[_0x8c78('0x22')](_0x1f1a0c['params']['id'])[_0x8c78('0xe')](function(_0x63307e){pm2[_0x8c78('0x1b')]();return _0x63307e[0x0];})['then'](respondWithResult(_0x3816d2,null))[_0x8c78('0x11')](handleError(_0x3816d2,null));}else{return _0x3816d2[_0x8c78('0x7')](0x1f4)['send']({'message':_0x8c78('0x23')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index c37554e..a89a86d 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 _0xb588=['express','Router','../../components/auth/service','get','/agents','getAgents','/queues','isAuthenticated'];(function(_0x44b3bd,_0x44c97d){var _0x1efc4a=function(_0x5d0205){while(--_0x5d0205){_0x44b3bd['push'](_0x44b3bd['shift']());}};_0x1efc4a(++_0x44c97d);}(_0xb588,0xf8));var _0x8b58=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xb588[_0x502c7d];return _0x30b7ed;};'use strict';var express=require(_0x8b58('0x0'));var router=express[_0x8b58('0x1')]();var auth=require(_0x8b58('0x2'));var controller=require('./realtime.controller');router[_0x8b58('0x3')](_0x8b58('0x4'),auth['isAuthenticated'](),controller[_0x8b58('0x5')]);router['get'](_0x8b58('0x6'),auth[_0x8b58('0x7')](),controller['getQueues']);module['exports']=router; \ No newline at end of file +var _0x33c9=['/queues','getQueues','Router','../../components/auth/service','./realtime.controller','get','/agents','getAgents'];(function(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0x33c9,0x152));var _0x933c=function(_0x1fefa5,_0x57fe6b){_0x1fefa5=_0x1fefa5-0x0;var _0x1ce7c0=_0x33c9[_0x1fefa5];return _0x1ce7c0;};'use strict';var express=require('express');var router=express[_0x933c('0x0')]();var auth=require(_0x933c('0x1'));var controller=require(_0x933c('0x2'));router[_0x933c('0x3')](_0x933c('0x4'),auth['isAuthenticated'](),controller[_0x933c('0x5')]);router[_0x933c('0x3')](_0x933c('0x6'),auth['isAuthenticated'](),controller[_0x933c('0x7')]);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 e9f7502..9581727 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 _0x6737=['raw','user','nolimit','sort','UserProfile','getResources','findAndCountAll','rows','pick','globalStatus','globalStatusFilter','pauseTypeFilter','getQueues','mail','sms','fax','whatsapp','channel','includes','toLowerCase','Invalid\x20channel','userProfileId','QueueCampaigns','util','lodash','../../config/logger','api','../../mysqldb','client','http','offset','limit','undefined','count','set','Content-Range','json','error','stack','name','status','send','Agents','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','voice','startCase','Queues','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','VoiceQueuesChannels','loggedIn','available','waiting','talking','paused','outbound','push','pTalking','originated','message','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','map','get','loggedInDb','busy','queue','length','some','connectedlinenum','toString','find','getMembers','UserId','accountcode','online','voiceStatus','agents','User','Queue','Pause','QueueId','idle','unknown','unavailable','ringing','isNil','chatPause','mailPause','openchannelPause','smsPause','every','filter','voicePause','pause','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','getAgents','userpic','lastPauseAt','address','whatsappPause','faxPause','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','openchannelCurrentCapacity','mailCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','resolve','rawAttributes','fieldName','type','key','query','role','agent','getOptions'];(function(_0x194ad2,_0x1c810c){var _0x56d375=function(_0x1e3ed2){while(--_0x1e3ed2){_0x194ad2['push'](_0x194ad2['shift']());}};_0x56d375(++_0x1c810c);}(_0x6737,0xaf));var _0x7673=function(_0x1eddb1,_0x8effe3){_0x1eddb1=_0x1eddb1-0x0;var _0x2e191b=_0x6737[_0x1eddb1];return _0x2e191b;};'use strict';var util=require(_0x7673('0x0'));var _=require(_0x7673('0x1'));var jayson=require('jayson/promise');var qs=require('../../components/parsers/qs');var logger=require(_0x7673('0x2'))(_0x7673('0x3'));var db=require(_0x7673('0x4'))['db'];var amiClient=jayson[_0x7673('0x5')][_0x7673('0x6')]({'port':0x232a});var routingClient=jayson[_0x7673('0x5')][_0x7673('0x6')]({'port':0x232c});function respondWithFilteredResult(_0x5de2d6,_0x4021df){return function(_0x4d5324){if(_0x4d5324){var _0x335c7b=typeof _0x4021df[_0x7673('0x7')]==='undefined'&&typeof _0x4021df[_0x7673('0x8')]===_0x7673('0x9');var _0x22baa3=_0x4d5324[_0x7673('0xa')];var _0x5ab177=_0x335c7b?0x0:_0x4021df[_0x7673('0x7')];var _0x1091a8=_0x335c7b?_0x4d5324[_0x7673('0xa')]:_0x4021df[_0x7673('0x7')]+_0x4021df[_0x7673('0x8')];var _0x5a181f;if(_0x1091a8>=_0x22baa3){_0x1091a8=_0x22baa3;_0x5a181f=0xc8;}else{_0x5a181f=0xce;}_0x5de2d6['status'](_0x5a181f);return _0x5de2d6[_0x7673('0xb')](_0x7673('0xc'),_0x5ab177+'-'+_0x1091a8+'/'+_0x22baa3)[_0x7673('0xd')](_0x4d5324);}return null;};}function handleError(_0x527b87,_0x4d5502){_0x4d5502=_0x4d5502||0x1f4;return function(_0x381070){logger[_0x7673('0xe')](_0x381070[_0x7673('0xf')]);if(_0x381070[_0x7673('0x10')]){delete _0x381070[_0x7673('0x10')];}_0x527b87[_0x7673('0x11')](_0x4d5502)[_0x7673('0x12')](_0x381070);};}function getRealtimeAgents(){return new Promise(function(_0x10d626,_0x533f63){return amiClient['request'](_0x7673('0x13'),{})[_0x7673('0x14')](function(_0x477a18){if(_0x477a18['error'])throw new Error(_0x7673('0x15'));var _0x6c6e8c=_0x477a18[_0x7673('0x16')];return routingClient[_0x7673('0x17')](_0x7673('0x13'),{})['then'](function(_0x169ad7){if(_0x169ad7[_0x7673('0xe')])throw new Error(_0x7673('0x18'));var _0x341bbd=_0x169ad7[_0x7673('0x16')];return _0x10d626(_[_0x7673('0x19')]({},_0x6c6e8c,_0x341bbd));});})[_0x7673('0x1a')](function(_0x167b8d){_0x533f63(_0x167b8d);});});}function getRealtimeQueues(_0x9554ca,_0x521cd7){return new Promise(function(_0x5298c8,_0x1c6b95){var _0x74feae=_0x521cd7===_0x7673('0x1b')?amiClient:routingClient;return _0x74feae[_0x7673('0x17')](_[_0x7673('0x1c')](_0x521cd7)+_0x7673('0x1d'),_0x9554ca)['then'](function(_0x118521){if(_0x118521[_0x7673('0xe')])throw new Error(util['format'](_0x7673('0x1e'),_0x521cd7));return _0x5298c8(_0x118521[_0x7673('0x16')]);})['catch'](function(_0x32c623){_0x1c6b95(_0x32c623);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x45000c,_0x2d1844){return amiClient[_0x7673('0x17')](_0x7673('0x1f'),{})[_0x7673('0x14')](function(_0x3215f7){if(_0x3215f7['error'])throw new Error('Unable\x20to\x20retrieve\x20voice\x20queues\x20channels');return _0x45000c(_0x3215f7[_0x7673('0x16')]);})['catch'](function(_0x11dd82){_0x2d1844(_0x11dd82);});});}function initializeQueues(_0x2bc8ee,_0x55b6f9,_0x15facc,_0x1ee8f4){var _0x49a559=[_0x7673('0x20'),_0x7673('0x21'),_0x7673('0x22'),_0x7673('0x23'),_0x7673('0x24')];if(_0x15facc==='voice'&&_0x1ee8f4===_0x7673('0x25')){_0x49a559[_0x7673('0x26')](_0x7673('0x27'),_0x7673('0x28'),_0x7673('0x29'),_0x7673('0x2a'),_0x7673('0x2b'),_0x7673('0x2c'),_0x7673('0x2d'),_0x7673('0x2e'),'erlangCalls','erlangCallToSecond',_0x7673('0x2f'),_0x7673('0x30'),_0x7673('0x31'),_0x7673('0x32'),'dialPredictiveIntervalMinThreshold',_0x7673('0x33'),_0x7673('0x34'),_0x7673('0x35'),_0x7673('0x36'),_0x7673('0x37'),'predictiveIntervalAvgHoldtime',_0x7673('0x38'));}return _0x2bc8ee[_0x7673('0x39')](function(_0x1a5693){var _0x4a59e3=_0x1a5693[_0x7673('0x3a')]({'plain':!![]});_0x4a59e3['agents']=[];_0x4a59e3[_0x7673('0x24')]=0x0;_0x4a59e3[_0x7673('0x3b')]=0x0;_0x4a59e3['loggedIn']=0x0;_0x4a59e3[_0x7673('0x21')]=0x0;_0x4a59e3[_0x7673('0x22')]=0x0;if(_0x15facc===_0x7673('0x1b')){_0x4a59e3[_0x7673('0x23')]=0x0;_0x4a59e3[_0x7673('0x3c')]=0x0;if(_0x1ee8f4===_0x7673('0x25')){_0x4a59e3[_0x7673('0x27')]=0x0;_0x4a59e3['originated']=0x0;}}var _0x9e42b8=_['find'](_0x55b6f9,['id',_0x4a59e3['id']]);if(_0x9e42b8)_['merge'](_0x4a59e3,_['pick'](_0x9e42b8,_0x49a559));return _0x4a59e3;});}function updateAgentVoiceStatus(_0xee2224,_0x243b5e,_0x5b6a1d){var _0x475e63=_['filter'](_0x5b6a1d,[_0x7673('0x3d'),_0x243b5e[_0x7673('0x10')]]);if(_0x475e63[_0x7673('0x3e')]===0x0)return _0xee2224['busy']=!![];if(_[_0x7673('0x3f')](_0x475e63,[_0x7673('0x40'),_0xee2224['internal'][_0x7673('0x41')]()]))return _0xee2224[_0x7673('0x23')]=!![];if(!_0xee2224[_0x7673('0x23')])return _0xee2224['busy']=!![];}function getVoiceQueueAgents(_0x43fc6f,_0x4fbea4,_0x2fccd5,_0x16f3f7){var _0x3954a1=_[_0x7673('0x42')](_0x4fbea4,['id',_0x43fc6f['id']]);if(!_0x3954a1)return _0x43fc6f;return _0x3954a1[_0x7673('0x43')]({'raw':!![]})[_0x7673('0x14')](function(_0x1c858d){for(var _0x1396c4=0x0;_0x1396c4<_0x1c858d['length'];_0x1396c4++){var _0x4fcd86=_[_0x7673('0x42')](_0x2fccd5,['id',_0x1c858d[_0x1396c4][_0x7673('0x44')]]);if(!_0x4fcd86){_0x4fcd86={'id':_0x1c858d[_0x1396c4][_0x7673('0x44')],'name':_0x1c858d[_0x1396c4][_0x7673('0x44')],'accountcode':'','online':![]};}var _0x5041c1={'id':_0x4fcd86['id'],'name':_0x4fcd86[_0x7673('0x10')],'internal':_0x4fcd86[_0x7673('0x45')],'online':Boolean(_0x4fcd86[_0x7673('0x46')]),'paused':Boolean(_0x1c858d[_0x1396c4][_0x7673('0x24')])};if(_0x4fcd86[_0x7673('0x47')]===_0x7673('0x23'))updateAgentVoiceStatus(_0x5041c1,_0x43fc6f,_0x16f3f7);if(_0x5041c1[_0x7673('0x46')])_0x43fc6f['loggedInDb']++;if(_0x5041c1['busy'])_0x43fc6f[_0x7673('0x3c')]++;if(_0x5041c1[_0x7673('0x24')]&&!_0x5041c1[_0x7673('0x3c')]&&!_0x5041c1[_0x7673('0x23')])_0x43fc6f['paused']++;_0x43fc6f[_0x7673('0x48')][_0x7673('0x26')](_0x5041c1);}return _0x43fc6f;});}function getQueueAgents(_0x1bef5f,_0x22ecb7,_0x302692){var _0x447809=_0x7673('0x49')+_[_0x7673('0x1c')](_0x302692)+_0x7673('0x4a');var _0x5d7f45=_0x302692+_0x7673('0x4b');return db[_0x447809]['findAll']({'where':{[_[_0x7673('0x1c')](_0x302692)+_0x7673('0x4c')]:_0x1bef5f['id']},'raw':!![]})[_0x7673('0x14')](function(_0xe1d17a){for(var _0x59ba37=0x0;_0x59ba37<_0xe1d17a['length'];_0x59ba37++){var _0x235a3b=_[_0x7673('0x42')](_0x22ecb7,['id',_0xe1d17a[_0x59ba37]['UserId']]);if(!_0x235a3b){_0x235a3b={'id':_0xe1d17a[_0x59ba37][_0x7673('0x44')],'name':_0xe1d17a[_0x59ba37]['UserId'],'online':![],['pauseField']:![]};}var _0x6739bb={'id':_0x235a3b['id'],'name':_0x235a3b['name'],'online':Boolean(_0x235a3b['online']),'paused':Boolean(_0x235a3b[_0x5d7f45])};if(_0x6739bb['online'])_0x1bef5f[_0x7673('0x3b')]++;_0x1bef5f[_0x7673('0x48')]['push'](_0x6739bb);}return _0x1bef5f;});}function isIdle(_0x872bf0){return _0x872bf0===_0x7673('0x4d')||_0x872bf0===_0x7673('0x4e')||_0x872bf0===_0x7673('0x4f')||_0x872bf0===_0x7673('0x50')||_[_0x7673('0x51')](_0x872bf0);}function isAgentPaused(_0x545ef8,_0x5cebc1){var _0x45bce0=[_0x545ef8[_0x7673('0x52')],_0x545ef8['faxPause'],_0x545ef8[_0x7673('0x53')],_0x545ef8[_0x7673('0x54')],_0x545ef8[_0x7673('0x55')],_0x545ef8['voicePause'],_0x545ef8['whatsappPause']];if(!_0x5cebc1)return _[_0x7673('0x56')](_0x45bce0);var _0xfae5f0=_[_0x7673('0x57')](_0x45bce0);return _0xfae5f0[_0x7673('0x3e')]>0x0&&_0xfae5f0[_0x7673('0x3e')]<_0x45bce0[_0x7673('0x3e')]?!![]:![];}function isAgentIdle(_0x42210c){if(_0x42210c[_0x7673('0x47')]!==_0x7673('0x4d')&&_0x42210c[_0x7673('0x58')]){_0x42210c['voiceStatus']=_0x7673('0x59');return![];}return _[_0x7673('0x56')]([_0x42210c[_0x7673('0x5a')],_0x42210c[_0x7673('0x5b')],_0x42210c[_0x7673('0x5c')],_0x42210c[_0x7673('0x5d')],_0x42210c[_0x7673('0x5e')],_0x42210c[_0x7673('0x47')],_0x42210c[_0x7673('0x5f')]],isIdle);}function getAgentStatus(_0x110f3a){var _0x48f23c='unknown';if(isAgentPaused(_0x110f3a))_0x48f23c='pause';else if(isAgentPaused(_0x110f3a,!![]))_0x48f23c='*pause';else if(isAgentIdle(_0x110f3a))_0x48f23c=_0x7673('0x4d');else _0x48f23c=_0x7673('0x3c');return _0x48f23c;}exports[_0x7673('0x60')]=function(_0x367a48,_0x872f85){var _0x5f2cc5={'count':0x0,'rows':[]},_0x4c55c9={},_0x324169,_0x23fe9f,_0x52b65d=[_0x7673('0x61'),_0x7673('0x46'),'lastLoginAt','lastPauseAt','pauseType',_0x7673('0x62'),'internal',_0x7673('0x63'),'chatPause',_0x7673('0x54'),_0x7673('0x53'),_0x7673('0x55'),_0x7673('0x64'),_0x7673('0x65'),_0x7673('0x58'),'chatCapacity',_0x7673('0x66'),_0x7673('0x67'),_0x7673('0x68'),_0x7673('0x69'),'faxCapacity','chatCurrentCapacity',_0x7673('0x6a'),_0x7673('0x6b'),'smsCurrentCapacity',_0x7673('0x6c'),_0x7673('0x6d'),_0x7673('0x5a'),'openchannelStatus',_0x7673('0x5c'),_0x7673('0x5e'),_0x7673('0x5f'),'faxStatus',_0x7673('0x47'),_0x7673('0x6e'),_0x7673('0x6f'),_0x7673('0x70'),_0x7673('0x71'),_0x7673('0x72'),_0x7673('0x73'),_0x7673('0x74'),'queue','destconnectedlinenum','screenrecording',_0x7673('0x75'),_0x7673('0x76'),_0x7673('0x77')],_0x4789ec=[_0x7673('0x52'),_0x7673('0x54'),_0x7673('0x53'),_0x7673('0x55'),_0x7673('0x64'),'faxPause','voicePause',_0x7673('0x46')];Promise[_0x7673('0x78')]()[_0x7673('0x14')](function(){var _0x290e29=_[_0x7673('0x39')](db['User'][_0x7673('0x79')],function(_0x44c3ee){return{'name':_0x44c3ee[_0x7673('0x7a')],'type':_0x44c3ee[_0x7673('0x7b')][_0x7673('0x7c')]};});_0x367a48[_0x7673('0x7d')][_0x7673('0x7e')]=_0x7673('0x7f');_0x367a48[_0x7673('0x7d')][_0x7673('0x46')]=!![];_0x4c55c9=qs[_0x7673('0x80')](_0x290e29,_0x367a48);_0x4c55c9[_0x7673('0x81')]=!![];if(_0x367a48[_0x7673('0x82')][_0x7673('0x7e')]==='user'){var _0x4f16be={'params':{'id':_0x367a48['user']['userProfileId']},'query':{'section':_0x7673('0x13'),'role':_0x7673('0x7f'),'online':!![],'nolimit':_0x367a48[_0x7673('0x7d')][_0x7673('0x83')],'sort':_0x367a48[_0x7673('0x7d')][_0x7673('0x84')],'filter':_0x367a48[_0x7673('0x7d')][_0x7673('0x57')]},'raw':!![]};return db[_0x7673('0x85')][_0x7673('0x86')](_0x4f16be);}return db[_0x7673('0x49')][_0x7673('0x87')](_0x4c55c9);})[_0x7673('0x14')](function(_0x3b2e7a){_0x5f2cc5[_0x7673('0xa')]=_0x3b2e7a[_0x7673('0xa')];_0x324169=_0x3b2e7a[_0x7673('0x88')];return getRealtimeAgents();})[_0x7673('0x14')](function(_0x4b9e93){_0x23fe9f=_0x4b9e93[_0x7673('0x88')];return _0x324169['map'](function(_0x9d64c5){var _0x39afff=_[_0x7673('0x42')](_0x23fe9f,['id',_0x9d64c5['id']]);if(_0x39afff)_[_0x7673('0x19')](_0x9d64c5,_[_0x7673('0x89')](_['omit'](_0x39afff,_0x4789ec),_0x52b65d));_0x9d64c5[_0x7673('0x8a')]=getAgentStatus(_0x9d64c5);return _0x9d64c5;});})[_0x7673('0x14')](function(_0x2294e7){if(_0x367a48[_0x7673('0x7d')]['globalStatusFilter']){var _0x2bf5f0=_['filter'](_0x2294e7,[_0x7673('0x8a'),_0x367a48['query'][_0x7673('0x8b')]]);if(_0x367a48[_0x7673('0x7d')]['pauseTypeFilter']){_0x2bf5f0=_[_0x7673('0x57')](_0x2bf5f0,['pauseType',_0x367a48[_0x7673('0x7d')][_0x7673('0x8c')]]);}}_0x5f2cc5[_0x7673('0x88')]=_0x2bf5f0||_0x2294e7;return _0x5f2cc5;})[_0x7673('0x14')](respondWithFilteredResult(_0x872f85,_0x4c55c9))['catch'](handleError(_0x872f85,null));};exports[_0x7673('0x8d')]=function(_0x40d28a,_0x4a8cbd){var _0x2ce07e=[_0x7673('0x8e'),'chat',_0x7673('0x8f'),'openchannel',_0x7673('0x90'),_0x7673('0x91'),_0x7673('0x1b')];var _0x487381={'count':0x0,'rows':[]},_0x2d0d98={},_0x5246ed,_0x16bd3c,_0x46a12c,_0x539baa,_0x2fd3ee;Promise[_0x7673('0x78')]()[_0x7673('0x14')](function(){if(_0x40d28a[_0x7673('0x7d')][_0x7673('0x92')]){if(!_[_0x7673('0x93')](_0x2ce07e,_0x40d28a[_0x7673('0x7d')][_0x7673('0x92')][_0x7673('0x94')]()))throw new Error(_0x7673('0x95'));_0x5246ed=_0x40d28a[_0x7673('0x7d')][_0x7673('0x92')][_0x7673('0x94')]();}var _0x131047=_[_0x7673('0x1c')](_0x5246ed)+_0x7673('0x4a');var _0x1411ee=_[_0x7673('0x39')](db[_0x131047][_0x7673('0x79')],function(_0x5f3b27){return{'name':_0x5f3b27[_0x7673('0x7a')],'type':_0x5f3b27[_0x7673('0x7b')][_0x7673('0x7c')]};});_0x2d0d98=qs[_0x7673('0x80')](_0x1411ee,_0x40d28a);if(_0x40d28a[_0x7673('0x82')][_0x7673('0x7e')]===_0x7673('0x82')){var _0x157d1f={'params':{'id':_0x40d28a[_0x7673('0x82')][_0x7673('0x96')]},'query':{'section':_0x5246ed===_0x7673('0x1b')&&_0x40d28a[_0x7673('0x7d')]['type']==='outbound'?_0x7673('0x97'):_['startCase'](_0x5246ed)+_0x7673('0x1d'),'type':_0x40d28a[_0x7673('0x7d')][_0x7673('0x7b')],'nolimit':!![],'sort':_0x7673('0x10'),'filter':_0x40d28a[_0x7673('0x7d')][_0x7673('0x57')]}};return db[_0x7673('0x85')][_0x7673('0x86')](_0x157d1f);}return db[_0x131047][_0x7673('0x87')](_0x2d0d98);})['then'](function(_0x146b15){_0x487381[_0x7673('0xa')]=_0x146b15[_0x7673('0xa')];_0x16bd3c=_0x146b15[_0x7673('0x88')];return getRealtimeQueues(_0x40d28a,_0x5246ed);})[_0x7673('0x14')](function(_0x1a8ff6){_0x539baa=_0x1a8ff6[_0x7673('0x88')];return getRealtimeAgents();})[_0x7673('0x14')](function(_0x290111){_0x46a12c=_0x290111[_0x7673('0x88')];if(_0x5246ed!='voice')return;return getRealtimeVoiceQueueChannels();})[_0x7673('0x14')](function(_0x1eb1c9){_0x2fd3ee=_0x1eb1c9?_0x1eb1c9['rows']:[];return initializeQueues(_0x16bd3c,_0x539baa,_0x5246ed,_0x40d28a['query'][_0x7673('0x7b')]);})[_0x7673('0x14')](function(_0x592a4e){var _0x46c27b=_0x592a4e[_0x7673('0x39')](function(_0x89db9c){if(_0x5246ed==='voice')return getVoiceQueueAgents(_0x89db9c,_0x16bd3c,_0x46a12c,_0x2fd3ee);else return getQueueAgents(_0x89db9c,_0x46a12c,_0x5246ed);});return Promise['all'](_0x46c27b);})[_0x7673('0x14')](function(_0x3becb5){_0x487381[_0x7673('0x88')]=_0x3becb5;return _0x487381;})[_0x7673('0x14')](respondWithFilteredResult(_0x4a8cbd,_0x2d0d98))[_0x7673('0x1a')](handleError(_0x4a8cbd,null));}; \ No newline at end of file +var _0x3bed=['dialMethod','Trunk','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','predictiveIntervalAvailable','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','map','get','agents','paused','loggedInDb','talking','busy','merge','pick','filter','queue','length','internal','find','UserId','accountcode','voiceStatus','User','Pause','findAll','startCase','QueueId','online','unknown','unavailable','ringing','chatPause','faxPause','mailPause','smsPause','voicePause','whatsappPause','idle','pause','every','chatStatus','smsStatus','whatsappStatus','*pause','getAgents','userpic','lastLoginAt','pauseType','address','openchannelCapacity','smsCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatusTime','openchannelStatusTime','mailStatusTime','whatsappStatusTime','faxStatusTime','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','openchannelPause','rawAttributes','fieldName','type','key','role','agent','getOptions','raw','user','userProfileId','query','nolimit','sort','UserProfile','getResources','findAndCountAll','rows','globalStatusFilter','globalStatus','pauseTypeFilter','getQueues','mail','chat','sms','openchannel','fax','resolve','channel','includes','toLowerCase','Invalid\x20channel','Queue','QueueCampaigns','all','lodash','jayson/promise','../../components/parsers/qs','../../config/logger','api','client','http','offset','undefined','limit','count','set','Content-Range','json','error','stack','name','status','send','request','Agents','then','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','voice','Queues','format','catch','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','available','waiting','outbound','push','originated','message','dialActive'];(function(_0x3830c9,_0x5bac14){var _0x73c1ae=function(_0xc9f53){while(--_0xc9f53){_0x3830c9['push'](_0x3830c9['shift']());}};_0x73c1ae(++_0x5bac14);}(_0x3bed,0x192));var _0xd3be=function(_0xb971a9,_0xbe6b9c){_0xb971a9=_0xb971a9-0x0;var _0x1920fd=_0x3bed[_0xb971a9];return _0x1920fd;};'use strict';var util=require('util');var _=require(_0xd3be('0x0'));var jayson=require(_0xd3be('0x1'));var qs=require(_0xd3be('0x2'));var logger=require(_0xd3be('0x3'))(_0xd3be('0x4'));var db=require('../../mysqldb')['db'];var amiClient=jayson[_0xd3be('0x5')][_0xd3be('0x6')]({'port':0x232a});var routingClient=jayson[_0xd3be('0x5')][_0xd3be('0x6')]({'port':0x232c});function respondWithFilteredResult(_0x23e3dc,_0x150765){return function(_0x52c382){if(_0x52c382){var _0x55f27c=typeof _0x150765[_0xd3be('0x7')]===_0xd3be('0x8')&&typeof _0x150765[_0xd3be('0x9')]==='undefined';var _0x302906=_0x52c382[_0xd3be('0xa')];var _0x327484=_0x55f27c?0x0:_0x150765[_0xd3be('0x7')];var _0x21da66=_0x55f27c?_0x52c382['count']:_0x150765[_0xd3be('0x7')]+_0x150765['limit'];var _0x583e5c;if(_0x21da66>=_0x302906){_0x21da66=_0x302906;_0x583e5c=0xc8;}else{_0x583e5c=0xce;}_0x23e3dc['status'](_0x583e5c);return _0x23e3dc[_0xd3be('0xb')](_0xd3be('0xc'),_0x327484+'-'+_0x21da66+'/'+_0x302906)[_0xd3be('0xd')](_0x52c382);}return null;};}function handleError(_0x4cac25,_0x57f304){_0x57f304=_0x57f304||0x1f4;return function(_0x38744f){logger[_0xd3be('0xe')](_0x38744f[_0xd3be('0xf')]);if(_0x38744f[_0xd3be('0x10')]){delete _0x38744f[_0xd3be('0x10')];}_0x4cac25[_0xd3be('0x11')](_0x57f304)[_0xd3be('0x12')](_0x38744f);};}function getRealtimeAgents(){return new Promise(function(_0x24f557,_0x5c9b39){return amiClient[_0xd3be('0x13')](_0xd3be('0x14'),{})[_0xd3be('0x15')](function(_0x4a13fc){if(_0x4a13fc[_0xd3be('0xe')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');var _0x52f7e1=_0x4a13fc[_0xd3be('0x16')];return routingClient['request'](_0xd3be('0x14'),{})[_0xd3be('0x15')](function(_0x2d6c29){if(_0x2d6c29[_0xd3be('0xe')])throw new Error(_0xd3be('0x17'));var _0x1c6905=_0x2d6c29[_0xd3be('0x16')];return _0x24f557(_['merge']({},_0x52f7e1,_0x1c6905));});})['catch'](function(_0x24e399){_0x5c9b39(_0x24e399);});});}function getRealtimeQueues(_0x2506c7,_0x198754){return new Promise(function(_0x13accb,_0x1a3031){var _0x56d417=_0x198754===_0xd3be('0x18')?amiClient:routingClient;return _0x56d417['request'](_['startCase'](_0x198754)+_0xd3be('0x19'),_0x2506c7)['then'](function(_0x12ce45){if(_0x12ce45[_0xd3be('0xe')])throw new Error(util[_0xd3be('0x1a')]('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x198754));return _0x13accb(_0x12ce45[_0xd3be('0x16')]);})[_0xd3be('0x1b')](function(_0x7794b9){_0x1a3031(_0x7794b9);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x350bd3,_0x465021){return amiClient[_0xd3be('0x13')]('VoiceQueuesChannels',{})[_0xd3be('0x15')](function(_0x21f16e){if(_0x21f16e[_0xd3be('0xe')])throw new Error(_0xd3be('0x1c'));return _0x350bd3(_0x21f16e[_0xd3be('0x16')]);})[_0xd3be('0x1b')](function(_0x5c25dd){_0x465021(_0x5c25dd);});});}function initializeQueues(_0x4b94c4,_0xe173da,_0x2aca11,_0x1eb9c1){var _0x5357f0=['loggedIn',_0xd3be('0x1d'),_0xd3be('0x1e'),'talking','paused'];if(_0x2aca11===_0xd3be('0x18')&&_0x1eb9c1===_0xd3be('0x1f')){_0x5357f0[_0xd3be('0x20')]('pTalking',_0xd3be('0x21'),_0xd3be('0x22'),_0xd3be('0x23'),_0xd3be('0x24'),_0xd3be('0x25'),'startPredictive',_0xd3be('0x26'),_0xd3be('0x27'),_0xd3be('0x28'),_0xd3be('0x29'),_0xd3be('0x2a'),_0xd3be('0x2b'),_0xd3be('0x2c'),'dialPredictiveIntervalMinThreshold',_0xd3be('0x2d'),'predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls',_0xd3be('0x2e'),_0xd3be('0x2f'),'predictiveIntervalAvgHoldtime',_0xd3be('0x30'));}return _0x4b94c4[_0xd3be('0x31')](function(_0x39d376){var _0xe43fbd=_0x39d376[_0xd3be('0x32')]({'plain':!![]});_0xe43fbd[_0xd3be('0x33')]=[];_0xe43fbd[_0xd3be('0x34')]=0x0;_0xe43fbd[_0xd3be('0x35')]=0x0;_0xe43fbd['loggedIn']=0x0;_0xe43fbd[_0xd3be('0x1d')]=0x0;_0xe43fbd[_0xd3be('0x1e')]=0x0;if(_0x2aca11===_0xd3be('0x18')){_0xe43fbd[_0xd3be('0x36')]=0x0;_0xe43fbd[_0xd3be('0x37')]=0x0;if(_0x1eb9c1===_0xd3be('0x1f')){_0xe43fbd['pTalking']=0x0;_0xe43fbd[_0xd3be('0x21')]=0x0;}}var _0x145146=_['find'](_0xe173da,['id',_0xe43fbd['id']]);if(_0x145146)_[_0xd3be('0x38')](_0xe43fbd,_[_0xd3be('0x39')](_0x145146,_0x5357f0));return _0xe43fbd;});}function updateAgentVoiceStatus(_0x146a61,_0x1b8eaa,_0x572029){var _0x2615ab=_[_0xd3be('0x3a')](_0x572029,[_0xd3be('0x3b'),_0x1b8eaa[_0xd3be('0x10')]]);if(_0x2615ab[_0xd3be('0x3c')]===0x0)return _0x146a61['busy']=!![];if(_['some'](_0x2615ab,['connectedlinenum',_0x146a61[_0xd3be('0x3d')]['toString']()]))return _0x146a61[_0xd3be('0x36')]=!![];if(!_0x146a61[_0xd3be('0x36')])return _0x146a61[_0xd3be('0x37')]=!![];}function getVoiceQueueAgents(_0x5f4166,_0x584a02,_0x31f64a,_0x17fca8){var _0x125b50=_[_0xd3be('0x3e')](_0x584a02,['id',_0x5f4166['id']]);if(!_0x125b50)return _0x5f4166;return _0x125b50['getMembers']({'raw':!![]})['then'](function(_0x5b60cd){for(var _0x3b7f3a=0x0;_0x3b7f3a<_0x5b60cd['length'];_0x3b7f3a++){var _0x2541d7=_['find'](_0x31f64a,['id',_0x5b60cd[_0x3b7f3a][_0xd3be('0x3f')]]);if(!_0x2541d7){_0x2541d7={'id':_0x5b60cd[_0x3b7f3a]['UserId'],'name':_0x5b60cd[_0x3b7f3a]['UserId'],'accountcode':'','online':![]};}var _0x5c9263={'id':_0x2541d7['id'],'name':_0x2541d7[_0xd3be('0x10')],'internal':_0x2541d7[_0xd3be('0x40')],'online':Boolean(_0x2541d7['online']),'paused':Boolean(_0x5b60cd[_0x3b7f3a]['paused'])};if(_0x2541d7[_0xd3be('0x41')]===_0xd3be('0x36'))updateAgentVoiceStatus(_0x5c9263,_0x5f4166,_0x17fca8);if(_0x5c9263['online'])_0x5f4166['loggedInDb']++;if(_0x5c9263[_0xd3be('0x37')])_0x5f4166['busy']++;if(_0x5c9263['paused']&&!_0x5c9263[_0xd3be('0x37')]&&!_0x5c9263['talking'])_0x5f4166[_0xd3be('0x34')]++;_0x5f4166['agents'][_0xd3be('0x20')](_0x5c9263);}return _0x5f4166;});}function getQueueAgents(_0x44b67f,_0x46b751,_0x103fbc){var _0x3bfcac=_0xd3be('0x42')+_['startCase'](_0x103fbc)+'Queue';var _0x1b06ac=_0x103fbc+_0xd3be('0x43');return db[_0x3bfcac][_0xd3be('0x44')]({'where':{[_[_0xd3be('0x45')](_0x103fbc)+_0xd3be('0x46')]:_0x44b67f['id']},'raw':!![]})[_0xd3be('0x15')](function(_0x20f2fd){for(var _0x46f3dc=0x0;_0x46f3dc<_0x20f2fd[_0xd3be('0x3c')];_0x46f3dc++){var _0x50fb3c=_[_0xd3be('0x3e')](_0x46b751,['id',_0x20f2fd[_0x46f3dc][_0xd3be('0x3f')]]);if(!_0x50fb3c){_0x50fb3c={'id':_0x20f2fd[_0x46f3dc][_0xd3be('0x3f')],'name':_0x20f2fd[_0x46f3dc][_0xd3be('0x3f')],'online':![],['pauseField']:![]};}var _0x198eb0={'id':_0x50fb3c['id'],'name':_0x50fb3c[_0xd3be('0x10')],'online':Boolean(_0x50fb3c[_0xd3be('0x47')]),'paused':Boolean(_0x50fb3c[_0x1b06ac])};if(_0x198eb0[_0xd3be('0x47')])_0x44b67f[_0xd3be('0x35')]++;_0x44b67f[_0xd3be('0x33')][_0xd3be('0x20')](_0x198eb0);}return _0x44b67f;});}function isIdle(_0x1103df){return _0x1103df==='idle'||_0x1103df===_0xd3be('0x48')||_0x1103df===_0xd3be('0x49')||_0x1103df===_0xd3be('0x4a')||_['isNil'](_0x1103df);}function isAgentPaused(_0x17ca4b,_0x4e2738){var _0x189029=[_0x17ca4b[_0xd3be('0x4b')],_0x17ca4b[_0xd3be('0x4c')],_0x17ca4b[_0xd3be('0x4d')],_0x17ca4b['openchannelPause'],_0x17ca4b[_0xd3be('0x4e')],_0x17ca4b[_0xd3be('0x4f')],_0x17ca4b[_0xd3be('0x50')]];if(!_0x4e2738)return _['every'](_0x189029);var _0x2dcabf=_[_0xd3be('0x3a')](_0x189029);return _0x2dcabf[_0xd3be('0x3c')]>0x0&&_0x2dcabf[_0xd3be('0x3c')]<_0x189029[_0xd3be('0x3c')]?!![]:![];}function isAgentIdle(_0x2a30a1){if(_0x2a30a1['voiceStatus']!==_0xd3be('0x51')&&_0x2a30a1['voicePause']){_0x2a30a1[_0xd3be('0x41')]=_0xd3be('0x52');return![];}return _[_0xd3be('0x53')]([_0x2a30a1[_0xd3be('0x54')],_0x2a30a1['faxStatus'],_0x2a30a1['mailStatus'],_0x2a30a1['openchannelStatus'],_0x2a30a1[_0xd3be('0x55')],_0x2a30a1[_0xd3be('0x41')],_0x2a30a1[_0xd3be('0x56')]],isIdle);}function getAgentStatus(_0x4a731b){var _0x51635c='unknown';if(isAgentPaused(_0x4a731b))_0x51635c=_0xd3be('0x52');else if(isAgentPaused(_0x4a731b,!![]))_0x51635c=_0xd3be('0x57');else if(isAgentIdle(_0x4a731b))_0x51635c=_0xd3be('0x51');else _0x51635c=_0xd3be('0x37');return _0x51635c;}exports[_0xd3be('0x58')]=function(_0x37616f,_0xc89a0e){var _0x1b1663={'count':0x0,'rows':[]},_0x155bd9={},_0x4bc594,_0x36b676,_0xff7ef7=[_0xd3be('0x59'),_0xd3be('0x47'),_0xd3be('0x5a'),'lastPauseAt',_0xd3be('0x5b'),'lastPauseAt',_0xd3be('0x3d'),_0xd3be('0x5c'),'chatPause','openchannelPause',_0xd3be('0x4d'),_0xd3be('0x4e'),_0xd3be('0x50'),_0xd3be('0x4c'),'voicePause','chatCapacity',_0xd3be('0x5d'),'mailCapacity',_0xd3be('0x5e'),'whatsappCapacity',_0xd3be('0x5f'),_0xd3be('0x60'),_0xd3be('0x61'),_0xd3be('0x62'),_0xd3be('0x63'),_0xd3be('0x64'),_0xd3be('0x65'),'chatStatus','openchannelStatus','mailStatus','smsStatus',_0xd3be('0x56'),'faxStatus',_0xd3be('0x41'),_0xd3be('0x66'),_0xd3be('0x67'),_0xd3be('0x68'),'smsStatusTime',_0xd3be('0x69'),_0xd3be('0x6a'),'voiceStatusTime',_0xd3be('0x3b'),'destconnectedlinenum',_0xd3be('0x6b'),_0xd3be('0x6c'),_0xd3be('0x6d'),_0xd3be('0x6e')],_0x4e3eee=[_0xd3be('0x4b'),_0xd3be('0x6f'),_0xd3be('0x4d'),'smsPause','whatsappPause',_0xd3be('0x4c'),'voicePause',_0xd3be('0x47')];Promise['resolve']()['then'](function(){var _0x5051de=_[_0xd3be('0x31')](db['User'][_0xd3be('0x70')],function(_0x4374f1){return{'name':_0x4374f1[_0xd3be('0x71')],'type':_0x4374f1[_0xd3be('0x72')][_0xd3be('0x73')]};});_0x37616f['query'][_0xd3be('0x74')]=_0xd3be('0x75');_0x37616f['query'][_0xd3be('0x47')]=!![];_0x155bd9=qs[_0xd3be('0x76')](_0x5051de,_0x37616f);_0x155bd9[_0xd3be('0x77')]=!![];if(_0x37616f[_0xd3be('0x78')]['role']===_0xd3be('0x78')){var _0x32e5e7={'params':{'id':_0x37616f[_0xd3be('0x78')][_0xd3be('0x79')]},'query':{'section':_0xd3be('0x14'),'role':'agent','online':!![],'nolimit':_0x37616f[_0xd3be('0x7a')][_0xd3be('0x7b')],'sort':_0x37616f[_0xd3be('0x7a')][_0xd3be('0x7c')],'filter':_0x37616f['query']['filter']},'raw':!![]};return db[_0xd3be('0x7d')][_0xd3be('0x7e')](_0x32e5e7);}return db['User'][_0xd3be('0x7f')](_0x155bd9);})[_0xd3be('0x15')](function(_0x49caae){_0x1b1663['count']=_0x49caae['count'];_0x4bc594=_0x49caae[_0xd3be('0x80')];return getRealtimeAgents();})['then'](function(_0x37d8de){_0x36b676=_0x37d8de[_0xd3be('0x80')];return _0x4bc594[_0xd3be('0x31')](function(_0x39e0c5){var _0x2ffcb9=_[_0xd3be('0x3e')](_0x36b676,['id',_0x39e0c5['id']]);if(_0x2ffcb9)_['merge'](_0x39e0c5,_[_0xd3be('0x39')](_['omit'](_0x2ffcb9,_0x4e3eee),_0xff7ef7));_0x39e0c5['globalStatus']=getAgentStatus(_0x39e0c5);return _0x39e0c5;});})[_0xd3be('0x15')](function(_0x200933){if(_0x37616f['query'][_0xd3be('0x81')]){var _0x367937=_[_0xd3be('0x3a')](_0x200933,[_0xd3be('0x82'),_0x37616f[_0xd3be('0x7a')][_0xd3be('0x81')]]);if(_0x37616f['query'][_0xd3be('0x83')]){_0x367937=_[_0xd3be('0x3a')](_0x367937,[_0xd3be('0x5b'),_0x37616f[_0xd3be('0x7a')][_0xd3be('0x83')]]);}}_0x1b1663['rows']=_0x367937||_0x200933;return _0x1b1663;})[_0xd3be('0x15')](respondWithFilteredResult(_0xc89a0e,_0x155bd9))[_0xd3be('0x1b')](handleError(_0xc89a0e,null));};exports[_0xd3be('0x84')]=function(_0x5038e7,_0x15e1e0){var _0x202317=[_0xd3be('0x85'),_0xd3be('0x86'),_0xd3be('0x87'),_0xd3be('0x88'),_0xd3be('0x89'),'whatsapp',_0xd3be('0x18')];var _0x534827={'count':0x0,'rows':[]},_0x35d66e={},_0x3ede70,_0x49ed26,_0x4e6f9c,_0x46573d,_0x429164;Promise[_0xd3be('0x8a')]()['then'](function(){if(_0x5038e7['query'][_0xd3be('0x8b')]){if(!_[_0xd3be('0x8c')](_0x202317,_0x5038e7['query'][_0xd3be('0x8b')][_0xd3be('0x8d')]()))throw new Error(_0xd3be('0x8e'));_0x3ede70=_0x5038e7['query'][_0xd3be('0x8b')][_0xd3be('0x8d')]();}var _0xe1c49c=_[_0xd3be('0x45')](_0x3ede70)+_0xd3be('0x8f');var _0x382c37=_['map'](db[_0xe1c49c][_0xd3be('0x70')],function(_0x1ab679){return{'name':_0x1ab679[_0xd3be('0x71')],'type':_0x1ab679[_0xd3be('0x72')][_0xd3be('0x73')]};});_0x35d66e=qs['getOptions'](_0x382c37,_0x5038e7);if(_0x5038e7['user'][_0xd3be('0x74')]===_0xd3be('0x78')){var _0x3091dd={'params':{'id':_0x5038e7[_0xd3be('0x78')][_0xd3be('0x79')]},'query':{'section':_0x3ede70===_0xd3be('0x18')&&_0x5038e7[_0xd3be('0x7a')][_0xd3be('0x72')]===_0xd3be('0x1f')?_0xd3be('0x90'):_[_0xd3be('0x45')](_0x3ede70)+_0xd3be('0x19'),'type':_0x5038e7['query']['type'],'nolimit':!![],'sort':_0xd3be('0x10'),'filter':_0x5038e7['query'][_0xd3be('0x3a')]}};return db[_0xd3be('0x7d')][_0xd3be('0x7e')](_0x3091dd);}return db[_0xe1c49c][_0xd3be('0x7f')](_0x35d66e);})[_0xd3be('0x15')](function(_0x482cc1){_0x534827[_0xd3be('0xa')]=_0x482cc1['count'];_0x49ed26=_0x482cc1[_0xd3be('0x80')];return getRealtimeQueues(_0x5038e7,_0x3ede70);})['then'](function(_0x573354){_0x46573d=_0x573354['rows'];return getRealtimeAgents();})[_0xd3be('0x15')](function(_0x35c2c7){_0x4e6f9c=_0x35c2c7[_0xd3be('0x80')];if(_0x3ede70!='voice')return;return getRealtimeVoiceQueueChannels();})[_0xd3be('0x15')](function(_0x31fa06){_0x429164=_0x31fa06?_0x31fa06['rows']:[];return initializeQueues(_0x49ed26,_0x46573d,_0x3ede70,_0x5038e7[_0xd3be('0x7a')][_0xd3be('0x72')]);})['then'](function(_0x1124a1){var _0x16b504=_0x1124a1[_0xd3be('0x31')](function(_0x330afb){if(_0x3ede70===_0xd3be('0x18'))return getVoiceQueueAgents(_0x330afb,_0x49ed26,_0x4e6f9c,_0x429164);else return getQueueAgents(_0x330afb,_0x4e6f9c,_0x3ede70);});return Promise[_0xd3be('0x91')](_0x16b504);})[_0xd3be('0x15')](function(_0x255c57){_0x534827[_0xd3be('0x80')]=_0x255c57;return _0x534827;})[_0xd3be('0x15')](respondWithFilteredResult(_0x15e1e0,_0x35d66e))[_0xd3be('0x1b')](handleError(_0x15e1e0,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 50a927e..3d694c7 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0xa404eb,_0x485915){var _0x4c74b1=function(_0xfb0c92){while(--_0xfb0c92){_0xa404eb['push'](_0xa404eb['shift']());}};_0x4c74b1(++_0x485915);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2ff762,_0x342c0b){_0x2ff762=_0x2ff762-0x0;var _0x158b02=_0xcb91[_0x2ff762];return _0x158b02;};'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(_0x3a8ec5,_0x378f44){var _0x483caf=function(_0x559670){while(--_0x559670){_0x3a8ec5['push'](_0x3a8ec5['shift']());}};_0x483caf(++_0x378f44);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'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/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 2268a67..39034d2 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 _0x812d=['STRING','DATE','exports','INTEGER'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x812d,0x6e));var _0xd812=function(_0x472f99,_0x252de3){_0x472f99=_0x472f99-0x0;var _0x17c483=_0x812d[_0x472f99];return _0x17c483;};'use strict';var Sequelize=require('sequelize');module[_0xd812('0x0')]={'state':{'type':Sequelize[_0xd812('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xd812('0x2')]},'scheduledat':{'type':Sequelize[_0xd812('0x3')]},'uniqueid':{'type':Sequelize[_0xd812('0x2')]},'starttime':{'type':Sequelize[_0xd812('0x3')]},'responsetime':{'type':Sequelize[_0xd812('0x3')]},'ringtime':{'type':Sequelize[_0xd812('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xd812('0x2')]},'membername':{'type':Sequelize[_0xd812('0x2')]}}; \ No newline at end of file +var _0x15c6=['DATE','sequelize','exports','INTEGER','STRING'];(function(_0x361cef,_0x4098a1){var _0x49c01e=function(_0x13ac63){while(--_0x13ac63){_0x361cef['push'](_0x361cef['shift']());}};_0x49c01e(++_0x4098a1);}(_0x15c6,0x1cd));var _0x615c=function(_0x4fb9ed,_0x187ea0){_0x4fb9ed=_0x4fb9ed-0x0;var _0x263645=_0x15c6[_0x4fb9ed];return _0x263645;};'use strict';var Sequelize=require(_0x615c('0x0'));module[_0x615c('0x1')]={'state':{'type':Sequelize[_0x615c('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x615c('0x3')]},'scheduledat':{'type':Sequelize[_0x615c('0x4')]},'uniqueid':{'type':Sequelize[_0x615c('0x3')]},'starttime':{'type':Sequelize[_0x615c('0x4')]},'responsetime':{'type':Sequelize[_0x615c('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x615c('0x3')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index ce3ae22..51952c4 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 _0x44f3=['./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x441853,_0x525833){var _0x290547=function(_0x34865b){while(--_0x34865b){_0x441853['push'](_0x441853['shift']());}};_0x290547(++_0x525833);}(_0x44f3,0x13d));var _0x344f=function(_0x5f5512,_0x4e17fe){_0x5f5512=_0x5f5512-0x0;var _0x11a869=_0x44f3[_0x5f5512];return _0x11a869;};'use strict';var _=require(_0x344f('0x0'));var util=require(_0x344f('0x1'));var logger=require(_0x344f('0x2'))('api');var moment=require(_0x344f('0x3'));var BPromise=require(_0x344f('0x4'));var rp=require(_0x344f('0x5'));var fs=require('fs');var path=require(_0x344f('0x6'));var rimraf=require(_0x344f('0x7'));var config=require('../../config/environment');var attributes=require(_0x344f('0x8'));module[_0x344f('0x9')]=function(_0x43e5fc,_0x55b9b0){return _0x43e5fc[_0x344f('0xa')](_0x344f('0xb'),attributes,{'tableName':_0x344f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb040=['./reportAgentPreview.attributes','ReportAgentPreview','report_agent_preview','lodash','util','moment','bluebird','request-promise','path','rimraf'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xb040,0x189));var _0x0b04=function(_0x38f02f,_0x33288a){_0x38f02f=_0x38f02f-0x0;var _0x54f533=_0xb040[_0x38f02f];return _0x54f533;};'use strict';var _=require(_0x0b04('0x0'));var util=require(_0x0b04('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0b04('0x2'));var BPromise=require(_0x0b04('0x3'));var rp=require(_0x0b04('0x4'));var fs=require('fs');var path=require(_0x0b04('0x5'));var rimraf=require(_0x0b04('0x6'));var config=require('../../config/environment');var attributes=require(_0x0b04('0x7'));module['exports']=function(_0x1722ea,_0x33e9d6){return _0x1722ea['define'](_0x0b04('0x8'),attributes,{'tableName':_0x0b04('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 dfa1bce..5b0227b 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 _0x4b57=['options','raw','stringify','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','then','info','ReportAgentPreview,\x20%s,\x20%s','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','CreateReportAgentPreview','ReportAgentPreview','body'];(function(_0x5cbf0e,_0x4cd140){var _0x1c76f8=function(_0xcc9be4){while(--_0xcc9be4){_0x5cbf0e['push'](_0x5cbf0e['shift']());}};_0x1c76f8(++_0x4cd140);}(_0x4b57,0x19b));var _0x74b5=function(_0x5e2751,_0x518a55){_0x5e2751=_0x5e2751-0x0;var _0x139a39=_0x4b57[_0x5e2751];return _0x139a39;};'use strict';var _=require(_0x74b5('0x0'));var util=require(_0x74b5('0x1'));var moment=require(_0x74b5('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x74b5('0x3'));var db=require(_0x74b5('0x4'))['db'];var utils=require(_0x74b5('0x5'));var logger=require(_0x74b5('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x74b5('0x7')][_0x74b5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2b82c3,_0x25af93,_0x41b1e4){return new BPromise(function(_0x2bddfc,_0x29a537){return client['request'](_0x2b82c3,_0x41b1e4)[_0x74b5('0x9')](function(_0x2b6f17){logger[_0x74b5('0xa')](_0x74b5('0xb'),_0x25af93,'request\x20sent');logger[_0x74b5('0xc')](_0x74b5('0xd'),_0x25af93,_0x74b5('0xe'),JSON['stringify'](_0x2b6f17));if(_0x2b6f17[_0x74b5('0xf')]){if(_0x2b6f17[_0x74b5('0xf')]['code']===0x1f4){logger[_0x74b5('0xf')]('ReportAgentPreview,\x20%s,\x20%s',_0x25af93,_0x2b6f17[_0x74b5('0xf')][_0x74b5('0x10')]);return _0x29a537(_0x2b6f17[_0x74b5('0xf')][_0x74b5('0x10')]);}logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x25af93,_0x2b6f17[_0x74b5('0xf')][_0x74b5('0x10')]);return _0x2bddfc(_0x2b6f17[_0x74b5('0xf')][_0x74b5('0x10')]);}else{logger[_0x74b5('0xa')](_0x74b5('0xb'),_0x25af93,_0x74b5('0xe'));_0x2bddfc(_0x2b6f17['result'][_0x74b5('0x10')]);}})[_0x74b5('0x11')](function(_0x900402){logger[_0x74b5('0xf')]('ReportAgentPreview,\x20%s,\x20%s',_0x25af93,_0x900402);_0x29a537(_0x900402);});});}exports[_0x74b5('0x12')]=function(_0x17f66c){var _0x3f59b0=this;return new Promise(function(_0x456283,_0x2cb257){return db[_0x74b5('0x13')]['create'](_0x17f66c[_0x74b5('0x14')],{'raw':_0x17f66c[_0x74b5('0x15')]?_0x17f66c[_0x74b5('0x15')][_0x74b5('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x269976){logger[_0x74b5('0xa')]('CreateReportAgentPreview',_0x17f66c);logger[_0x74b5('0xc')]('CreateReportAgentPreview',_0x17f66c,JSON[_0x74b5('0x17')](_0x269976));_0x456283(_0x269976);})[_0x74b5('0x11')](function(_0x2775fb){logger['error'](_0x74b5('0x12'),_0x2775fb[_0x74b5('0x10')],_0x17f66c);_0x2cb257(_0x3f59b0[_0x74b5('0xf')](0x1f4,_0x2775fb[_0x74b5('0x10')]));});});}; \ No newline at end of file +var _0xfa57=['CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x3b1b23,_0x21bccd){var _0x1efc85=function(_0x102a95){while(--_0x102a95){_0x3b1b23['push'](_0x3b1b23['shift']());}};_0x1efc85(++_0x21bccd);}(_0xfa57,0xe6));var _0x7fa5=function(_0x24a5b0,_0x521a8c){_0x24a5b0=_0x24a5b0-0x0;var _0x3d7fff=_0xfa57[_0x24a5b0];return _0x3d7fff;};'use strict';var _=require(_0x7fa5('0x0'));var util=require(_0x7fa5('0x1'));var moment=require(_0x7fa5('0x2'));var BPromise=require(_0x7fa5('0x3'));var rs=require(_0x7fa5('0x4'));var fs=require('fs');var Redis=require(_0x7fa5('0x5'));var db=require(_0x7fa5('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x7fa5('0x7'))(_0x7fa5('0x8'));var config=require(_0x7fa5('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x120d1e,_0x38dafa,_0x282ed4){return new BPromise(function(_0x20d2be,_0x5d2d4a){return client[_0x7fa5('0xa')](_0x120d1e,_0x282ed4)[_0x7fa5('0xb')](function(_0xc8e7bc){logger[_0x7fa5('0xc')](_0x7fa5('0xd'),_0x38dafa,_0x7fa5('0xe'));logger[_0x7fa5('0xf')](_0x7fa5('0x10'),_0x38dafa,_0x7fa5('0xe'),JSON[_0x7fa5('0x11')](_0xc8e7bc));if(_0xc8e7bc[_0x7fa5('0x12')]){if(_0xc8e7bc[_0x7fa5('0x12')][_0x7fa5('0x13')]===0x1f4){logger[_0x7fa5('0x12')](_0x7fa5('0xd'),_0x38dafa,_0xc8e7bc['error'][_0x7fa5('0x14')]);return _0x5d2d4a(_0xc8e7bc['error'][_0x7fa5('0x14')]);}logger[_0x7fa5('0x12')](_0x7fa5('0xd'),_0x38dafa,_0xc8e7bc['error'][_0x7fa5('0x14')]);return _0x20d2be(_0xc8e7bc[_0x7fa5('0x12')][_0x7fa5('0x14')]);}else{logger[_0x7fa5('0xc')](_0x7fa5('0xd'),_0x38dafa,_0x7fa5('0xe'));_0x20d2be(_0xc8e7bc['result'][_0x7fa5('0x14')]);}})[_0x7fa5('0x15')](function(_0x15dd2a){logger['error'](_0x7fa5('0xd'),_0x38dafa,_0x15dd2a);_0x5d2d4a(_0x15dd2a);});});}exports[_0x7fa5('0x16')]=function(_0x3f2b34){var _0x4f74d8=this;return new Promise(function(_0x287aa4,_0x80d320){return db[_0x7fa5('0x17')][_0x7fa5('0x18')](_0x3f2b34[_0x7fa5('0x19')],{'raw':_0x3f2b34[_0x7fa5('0x1a')]?_0x3f2b34[_0x7fa5('0x1a')][_0x7fa5('0x1b')]===undefined?!![]:![]:!![]})[_0x7fa5('0xb')](function(_0x49400c){logger[_0x7fa5('0xc')](_0x7fa5('0x16'),_0x3f2b34);logger[_0x7fa5('0xf')](_0x7fa5('0x16'),_0x3f2b34,JSON[_0x7fa5('0x11')](_0x49400c));_0x287aa4(_0x49400c);})[_0x7fa5('0x15')](function(_0x276820){logger[_0x7fa5('0x12')](_0x7fa5('0x16'),_0x276820[_0x7fa5('0x14')],_0x3f2b34);_0x80d320(_0x4f74d8[_0x7fa5('0x12')](0x1f4,_0x276820[_0x7fa5('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 8ee4835..5d700b0 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 _0xc482=['trunks','/campaigns','campaigns','faxAccounts','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','/whatsapp/queues/waitinginteractions','post','/mail/queues/:id/notify','mail','showMailQueues','/chat/queues/:id/notify','queueNotify','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','/fax/queues/:id','/openchannel/queues/:id/notify','openchannel','showOpenchannelQueues','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','util','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','smsQueues','/whatsapp/queues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','updateVoiceQueue','outbound','/outbound/channels','outboundChannels','put','/agents/:id/capacity','telephones','/trunks'];(function(_0x791ad1,_0x342b62){var _0xb93874=function(_0x3f12b7){while(--_0x3f12b7){_0x791ad1['push'](_0x791ad1['shift']());}};_0xb93874(++_0x342b62);}(_0xc482,0x1d2));var _0x2c48=function(_0x4d5f8d,_0x4d502b){_0x4d5f8d=_0x4d5f8d-0x0;var _0x578390=_0xc482[_0x4d5f8d];return _0x578390;};'use strict';var multer=require('multer');var util=require(_0x2c48('0x0'));var path=require('path');var express=require('express');var router=express[_0x2c48('0x1')]();var auth=require(_0x2c48('0x2'));var controller=require(_0x2c48('0x3'));router[_0x2c48('0x4')](_0x2c48('0x5'),auth[_0x2c48('0x6')](),controller[_0x2c48('0x7')]);router['get'](_0x2c48('0x8'),auth[_0x2c48('0x6')](),controller[_0x2c48('0x9')]);router[_0x2c48('0x4')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0x2c48('0x6')](),controller['voiceChannelStopMixMonitor']);router[_0x2c48('0x4')]('/voice/queues',auth[_0x2c48('0x6')](),controller['voiceQueues']);router[_0x2c48('0x4')]('/chat/queues',auth[_0x2c48('0x6')](),controller[_0x2c48('0xa')]);router[_0x2c48('0x4')](_0x2c48('0xb'),auth['isAuthenticated'](),controller[_0x2c48('0xc')]);router[_0x2c48('0x4')](_0x2c48('0xd'),auth[_0x2c48('0x6')](),controller[_0x2c48('0xe')]);router[_0x2c48('0x4')](_0x2c48('0xf'),auth[_0x2c48('0x6')](),controller[_0x2c48('0x10')]);router['get']('/sms/queues',auth['isAuthenticated'](),controller[_0x2c48('0x11')]);router['get'](_0x2c48('0x12'),auth[_0x2c48('0x6')](),controller['whatsappQueues']);router[_0x2c48('0x4')](_0x2c48('0x13'),auth[_0x2c48('0x6')](),controller[_0x2c48('0x14')]);router[_0x2c48('0x4')](_0x2c48('0x15'),auth['isAuthenticated'](),controller[_0x2c48('0x16')]);router[_0x2c48('0x4')]('/voice/queues/channels',auth[_0x2c48('0x6')](),controller['voiceQueuesChannels']);router[_0x2c48('0x4')](_0x2c48('0x17'),auth[_0x2c48('0x6')](),controller[_0x2c48('0x18')]);router[_0x2c48('0x4')](_0x2c48('0x19'),auth[_0x2c48('0x6')](),controller[_0x2c48('0x1a')]);router[_0x2c48('0x4')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x2c48('0x6')](),controller[_0x2c48('0x1b')]);router[_0x2c48('0x4')](_0x2c48('0x1c'),auth[_0x2c48('0x6')](),controller[_0x2c48('0x1d')]);router['put'](_0x2c48('0x1c'),auth['isAuthenticated'](),controller[_0x2c48('0x1e')]);router[_0x2c48('0x4')]('/outbound',auth[_0x2c48('0x6')](),controller[_0x2c48('0x1f')]);router[_0x2c48('0x4')](_0x2c48('0x20'),auth[_0x2c48('0x6')](),controller[_0x2c48('0x21')]);router[_0x2c48('0x4')]('/agents',auth[_0x2c48('0x6')](),controller['agents']);router[_0x2c48('0x22')](_0x2c48('0x23'),auth[_0x2c48('0x6')](),controller['agentCapacity']);router['get']('/telephones',auth[_0x2c48('0x6')](),controller[_0x2c48('0x24')]);router[_0x2c48('0x4')](_0x2c48('0x25'),auth[_0x2c48('0x6')](),controller[_0x2c48('0x26')]);router[_0x2c48('0x4')](_0x2c48('0x27'),auth['isAuthenticated'](),controller[_0x2c48('0x28')]);router[_0x2c48('0x4')]('/fax/accounts',auth['isAuthenticated'](),controller[_0x2c48('0x29')]);router[_0x2c48('0x4')]('/chat/queues/waitinginteractions',auth[_0x2c48('0x6')](),controller['chatQueuesWaitingInteractions']);router[_0x2c48('0x4')](_0x2c48('0x2a'),auth[_0x2c48('0x6')](),controller[_0x2c48('0x2b')]);router[_0x2c48('0x4')](_0x2c48('0x2c'),auth['isAuthenticated'](),controller[_0x2c48('0x2d')]);router[_0x2c48('0x4')](_0x2c48('0x2e'),auth['isAuthenticated'](),controller[_0x2c48('0x2f')]);router[_0x2c48('0x4')](_0x2c48('0x30'),auth[_0x2c48('0x6')](),controller['smsQueuesWaitingInteractions']);router[_0x2c48('0x4')](_0x2c48('0x31'),auth['isAuthenticated'](),controller['whatsappQueuesWaitingInteractions']);router[_0x2c48('0x4')]('/fax/queues/waitinginteractions',auth[_0x2c48('0x6')](),controller['faxQueuesWaitingInteractions']);router[_0x2c48('0x32')](_0x2c48('0x33'),auth[_0x2c48('0x6')](),controller['queueNotify'](_0x2c48('0x34')));router[_0x2c48('0x4')]('/mail/queues/:id',auth[_0x2c48('0x6')](),controller[_0x2c48('0x35')]);router[_0x2c48('0x32')](_0x2c48('0x36'),auth[_0x2c48('0x6')](),controller[_0x2c48('0x37')]('chat'));router[_0x2c48('0x4')](_0x2c48('0x38'),auth['isAuthenticated'](),controller[_0x2c48('0x39')]);router['post'](_0x2c48('0x3a'),auth[_0x2c48('0x6')](),controller['queueNotify']('fax'));router[_0x2c48('0x4')](_0x2c48('0x3b'),auth[_0x2c48('0x6')](),controller['showFaxQueues']);router[_0x2c48('0x32')](_0x2c48('0x3c'),auth[_0x2c48('0x6')](),controller[_0x2c48('0x37')](_0x2c48('0x3d')));router[_0x2c48('0x4')]('/openchannel/queues/:id',auth[_0x2c48('0x6')](),controller[_0x2c48('0x3e')]);router[_0x2c48('0x32')]('/sms/queues/:id/notify',auth[_0x2c48('0x6')](),controller[_0x2c48('0x37')](_0x2c48('0x3f')));router[_0x2c48('0x32')](_0x2c48('0x40'),auth[_0x2c48('0x6')](),controller[_0x2c48('0x37')](_0x2c48('0x41')));router[_0x2c48('0x4')](_0x2c48('0x42'),auth[_0x2c48('0x6')](),controller['showSmsQueues']);router['get'](_0x2c48('0x43'),auth[_0x2c48('0x6')](),controller[_0x2c48('0x44')]);router[_0x2c48('0x32')](_0x2c48('0x45'),auth[_0x2c48('0x6')](),controller[_0x2c48('0x46')]);module[_0x2c48('0x47')]=router; \ No newline at end of file +var _0x8149=['/agents/:id/notify','agentNotify','exports','path','express','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','/fax/queues','voiceQueuesPreview','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannelHangup','put','/voice/queues/:id','updateVoiceQueue','/outbound','outbound','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','telephones','/trunks','/fax/accounts','faxAccounts','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues'];(function(_0x4dcc12,_0x344082){var _0x46f066=function(_0x165d78){while(--_0x165d78){_0x4dcc12['push'](_0x4dcc12['shift']());}};_0x46f066(++_0x344082);}(_0x8149,0x9d));var _0x9814=function(_0x259a6b,_0x391bd7){_0x259a6b=_0x259a6b-0x0;var _0x742738=_0x8149[_0x259a6b];return _0x742738;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9814('0x0'));var express=require(_0x9814('0x1'));var router=express['Router']();var auth=require(_0x9814('0x2'));var controller=require(_0x9814('0x3'));router[_0x9814('0x4')](_0x9814('0x5'),auth[_0x9814('0x6')](),controller[_0x9814('0x7')]);router['get'](_0x9814('0x8'),auth[_0x9814('0x6')](),controller['voiceChannelMixMonitor']);router[_0x9814('0x4')](_0x9814('0x9'),auth['isAuthenticated'](),controller[_0x9814('0xa')]);router[_0x9814('0x4')]('/voice/queues',auth[_0x9814('0x6')](),controller['voiceQueues']);router[_0x9814('0x4')](_0x9814('0xb'),auth[_0x9814('0x6')](),controller[_0x9814('0xc')]);router[_0x9814('0x4')](_0x9814('0xd'),auth['isAuthenticated'](),controller[_0x9814('0xe')]);router['get'](_0x9814('0xf'),auth[_0x9814('0x6')](),controller[_0x9814('0x10')]);router[_0x9814('0x4')](_0x9814('0x11'),auth[_0x9814('0x6')](),controller[_0x9814('0x12')]);router[_0x9814('0x4')](_0x9814('0x13'),auth[_0x9814('0x6')](),controller[_0x9814('0x14')]);router[_0x9814('0x4')](_0x9814('0x15'),auth['isAuthenticated'](),controller['whatsappQueues']);router['get'](_0x9814('0x16'),auth['isAuthenticated'](),controller['faxQueues']);router[_0x9814('0x4')]('/voice/queues/preview/:id',auth[_0x9814('0x6')](),controller[_0x9814('0x17')]);router[_0x9814('0x4')]('/voice/queues/channels',auth[_0x9814('0x6')](),controller[_0x9814('0x18')]);router[_0x9814('0x4')](_0x9814('0x19'),auth[_0x9814('0x6')](),controller['voiceQueuesChannel']);router['get']('/voice/queues/channels/:uniqueid/hangup',auth[_0x9814('0x6')](),controller[_0x9814('0x1a')]);router[_0x9814('0x4')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth['isAuthenticated'](),controller['voiceQueuesChannelRedirect']);router['get']('/voice/queues/:id',auth['isAuthenticated'](),controller['showVoiceQueues']);router[_0x9814('0x1b')](_0x9814('0x1c'),auth[_0x9814('0x6')](),controller[_0x9814('0x1d')]);router[_0x9814('0x4')](_0x9814('0x1e'),auth[_0x9814('0x6')](),controller[_0x9814('0x1f')]);router[_0x9814('0x4')]('/outbound/channels',auth[_0x9814('0x6')](),controller[_0x9814('0x20')]);router[_0x9814('0x4')](_0x9814('0x21'),auth['isAuthenticated'](),controller[_0x9814('0x22')]);router['put'](_0x9814('0x23'),auth[_0x9814('0x6')](),controller[_0x9814('0x24')]);router[_0x9814('0x4')]('/telephones',auth[_0x9814('0x6')](),controller[_0x9814('0x25')]);router['get'](_0x9814('0x26'),auth[_0x9814('0x6')](),controller['trunks']);router[_0x9814('0x4')]('/campaigns',auth[_0x9814('0x6')](),controller['campaigns']);router[_0x9814('0x4')](_0x9814('0x27'),auth[_0x9814('0x6')](),controller[_0x9814('0x28')]);router[_0x9814('0x4')]('/chat/queues/waitinginteractions',auth[_0x9814('0x6')](),controller['chatQueuesWaitingInteractions']);router['get']('/mail/queues/waitinginteractions',auth[_0x9814('0x6')](),controller[_0x9814('0x29')]);router[_0x9814('0x4')](_0x9814('0x2a'),auth[_0x9814('0x6')](),controller[_0x9814('0x2b')]);router[_0x9814('0x4')]('/openchannel/queues/:id/waitinginteractions',auth['isAuthenticated'](),controller[_0x9814('0x2c')]);router[_0x9814('0x4')](_0x9814('0x2d'),auth[_0x9814('0x6')](),controller[_0x9814('0x2e')]);router['get'](_0x9814('0x2f'),auth[_0x9814('0x6')](),controller[_0x9814('0x30')]);router[_0x9814('0x4')](_0x9814('0x31'),auth[_0x9814('0x6')](),controller['faxQueuesWaitingInteractions']);router[_0x9814('0x32')](_0x9814('0x33'),auth[_0x9814('0x6')](),controller[_0x9814('0x34')](_0x9814('0x35')));router[_0x9814('0x4')](_0x9814('0x36'),auth[_0x9814('0x6')](),controller['showMailQueues']);router['post'](_0x9814('0x37'),auth[_0x9814('0x6')](),controller[_0x9814('0x34')](_0x9814('0x38')));router[_0x9814('0x4')](_0x9814('0x39'),auth[_0x9814('0x6')](),controller[_0x9814('0x3a')]);router[_0x9814('0x32')](_0x9814('0x3b'),auth[_0x9814('0x6')](),controller[_0x9814('0x34')](_0x9814('0x3c')));router[_0x9814('0x4')](_0x9814('0x3d'),auth[_0x9814('0x6')](),controller[_0x9814('0x3e')]);router[_0x9814('0x32')](_0x9814('0x3f'),auth['isAuthenticated'](),controller[_0x9814('0x34')](_0x9814('0x40')));router[_0x9814('0x4')](_0x9814('0x41'),auth[_0x9814('0x6')](),controller[_0x9814('0x42')]);router[_0x9814('0x32')](_0x9814('0x43'),auth[_0x9814('0x6')](),controller[_0x9814('0x34')]('sms'));router[_0x9814('0x32')](_0x9814('0x44'),auth[_0x9814('0x6')](),controller['queueNotify'](_0x9814('0x45')));router[_0x9814('0x4')](_0x9814('0x46'),auth[_0x9814('0x6')](),controller[_0x9814('0x47')]);router['get'](_0x9814('0x48'),auth['isAuthenticated'](),controller[_0x9814('0x49')]);router[_0x9814('0x32')](_0x9814('0x4a'),auth['isAuthenticated'](),controller[_0x9814('0x4b')]);module[_0x9814('0x4c')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index eb9d85f..b325a58 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 _0x7217=['mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','rows','map','value','filter','indexOf','queue_id','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','capitalize','chat','Website','Account','Queue','Message','findOne','messageId','Interaction','queue','MessageId','InteractionId','From','QueueId','TransferReport','create','Start','channel','Channel\x20field\x20is\x20mandatory','\x20Message\x20not\x20found','update','agentTransferTimeout','*,*,*,*','bluebird','lodash','util','../../mysqldb','../../config/logger','api','http','client','request','then','error','code','message','result','catch','json','sendStatus','stack','send','isNil','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','VoiceQueuesChannelRedirect','outboundChannels','agents','Agents','agentCapacity','body','interaction','user','name','hasOwnProperty','MemberReport','findAll','length','format','updateAttributes','findOrCreate','SIP/%s','INTERACTION','YYYY-MM-DD\x20HH:mm:ss','agent','internal','AgentCapacity','capacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','ChatQueues','showChatQueues','MailQueues','mailAccounts','OpenchannelQueues','showOpenchannelQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x7217,0x19e));var _0x7721=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0x7217[_0xf0bcac];return _0x4e4c65;};'use strict';var BPromise=require(_0x7721('0x0'));var moment=require('moment');var _=require(_0x7721('0x1'));var util=require(_0x7721('0x2'));var db=require(_0x7721('0x3'))['db'];var logger=require(_0x7721('0x4'))(_0x7721('0x5'));var jayson=require('jayson/promise');var amiClient=jayson['client'][_0x7721('0x6')]({'port':0x232a});var mailClient=jayson[_0x7721('0x7')][_0x7721('0x6')]({'port':0x232b});var routingClient=jayson[_0x7721('0x7')][_0x7721('0x6')]({'port':0x232c});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){var _0x3e6368=_0x21f680?_0x21f680:amiClient;return _0x3e6368[_0x7721('0x8')](_0xf7ff37,_0x18ab6b)[_0x7721('0x9')](function(_0x138740){if(_0x138740[_0x7721('0xa')]){if(_0x138740['error'][_0x7721('0xb')]===0x1f4){return _0x2f99ed(_0x138740[_0x7721('0xa')][_0x7721('0xc')]);}return _0x225610(_0x138740[_0x7721('0xa')][_0x7721('0xc')]);}else{_0x225610(_0x138740[_0x7721('0xd')]);}})[_0x7721('0xe')](function(_0x27b36b){_0x2f99ed(_0x27b36b);});});}function respondWithResult(_0x55b4ca,_0x2911ec){_0x2911ec=_0x2911ec||0xc8;return function(_0x199930){if(_0x199930){return _0x55b4ca['status'](_0x2911ec)[_0x7721('0xf')](_0x199930);}return _0x55b4ca[_0x7721('0x10')](0x194);};}function handleError(_0x3f01c5,_0x2e9752){_0x2e9752=_0x2e9752||0x1f4;return function(_0x5069da){logger[_0x7721('0xa')](_0x5069da[_0x7721('0x11')]);if(_0x5069da['name']){delete _0x5069da['name'];}_0x3f01c5['status'](_0x2e9752)[_0x7721('0x12')](_0x5069da);};}function findById(_0x25a628){return function(_0x3cc909){if(!_[_0x7721('0x13')](_0x25a628)&&!_['isNil'](_0x3cc909)&&!_[_0x7721('0x13')](_0x3cc909['rows'])){return _[_0x7721('0x14')](_0x3cc909['rows'],function(_0xfec626){return _0xfec626['id']==_0x25a628;});}return null;};}exports[_0x7721('0x15')]=function(_0x3ab5a5,_0x3e140d){return respondWithRpcPromise(_0x7721('0x16'),_0x3ab5a5[_0x7721('0x17')])[_0x7721('0x9')](respondWithResult(_0x3e140d,null))[_0x7721('0xe')](handleError(_0x3e140d,null));};exports[_0x7721('0x18')]=function(_0xaeccc4,_0x4ce1db){return respondWithRpcPromise(_0x7721('0x19'),_[_0x7721('0x1a')](_0xaeccc4[_0x7721('0x17')],_0xaeccc4[_0x7721('0x1b')]))['then'](respondWithResult(_0x4ce1db,null))[_0x7721('0xe')](handleError(_0x4ce1db,null));};exports['voiceChannelStopMixMonitor']=function(_0xb9e9dd,_0x288e3a){return respondWithRpcPromise(_0x7721('0x1c'),_[_0x7721('0x1a')](_0xb9e9dd[_0x7721('0x17')],_0xb9e9dd[_0x7721('0x1b')]))[_0x7721('0x9')](respondWithResult(_0x288e3a,null))['catch'](handleError(_0x288e3a,null));};exports[_0x7721('0x1d')]=function(_0x1abedb,_0x125564){return respondWithRpcPromise(_0x7721('0x1e'),_0x1abedb[_0x7721('0x17')])[_0x7721('0x9')](respondWithResult(_0x125564,null))[_0x7721('0xe')](handleError(_0x125564,null));};exports[_0x7721('0x1f')]=function(_0x40f367,_0x52316e){return respondWithRpcPromise(_0x7721('0x1e'),_0x40f367['query'])['then'](findById(_0x40f367[_0x7721('0x1b')]['id']))[_0x7721('0x9')](respondWithResult(_0x52316e,null))[_0x7721('0xe')](handleError(_0x52316e,null));};exports[_0x7721('0x20')]=function(_0x1ea4d,_0x37b9f0){return respondWithRpcPromise(_0x7721('0x21'),_[_0x7721('0x1a')](_0x1ea4d['body'],_0x1ea4d[_0x7721('0x1b')]))[_0x7721('0x9')](respondWithResult(_0x37b9f0,null))['catch'](handleError(_0x37b9f0,null));};exports['voiceQueuesPreview']=function(_0xfde9ec,_0x220bbf){return respondWithRpcPromise('VoiceQueuesPreview',_[_0x7721('0x1a')](_0xfde9ec[_0x7721('0x17')],_0xfde9ec[_0x7721('0x1b')]))['then'](respondWithResult(_0x220bbf,null))[_0x7721('0xe')](handleError(_0x220bbf,null));};exports[_0x7721('0x22')]=function(_0x1492d4,_0x3f15e2){return respondWithRpcPromise(_0x7721('0x23'),_0x1492d4['query'])[_0x7721('0x9')](respondWithResult(_0x3f15e2,null))[_0x7721('0xe')](handleError(_0x3f15e2,null));};exports[_0x7721('0x24')]=function(_0x5c5b33,_0x35de7a){return respondWithRpcPromise(_0x7721('0x25'),_['merge'](_0x5c5b33[_0x7721('0x17')],_0x5c5b33['params']))[_0x7721('0x9')](respondWithResult(_0x35de7a,null))[_0x7721('0xe')](handleError(_0x35de7a,null));};exports[_0x7721('0x26')]=function(_0x1d894b,_0x1c84c0){return respondWithRpcPromise(_0x7721('0x27'),_[_0x7721('0x1a')](_0x1d894b[_0x7721('0x17')],_0x1d894b[_0x7721('0x1b')]))[_0x7721('0x9')](respondWithResult(_0x1c84c0,null))[_0x7721('0xe')](handleError(_0x1c84c0,null));};exports['voiceQueuesChannelRedirect']=function(_0xd1df68,_0x5e6663){return respondWithRpcPromise(_0x7721('0x28'),_[_0x7721('0x1a')](_0xd1df68[_0x7721('0x17')],_0xd1df68[_0x7721('0x1b')]))[_0x7721('0x9')](respondWithResult(_0x5e6663,null))[_0x7721('0xe')](handleError(_0x5e6663,null));};exports['outbound']=function(_0x557c34,_0x4cadef){return respondWithRpcPromise('Outbound',_0x557c34[_0x7721('0x17')])[_0x7721('0x9')](respondWithResult(_0x4cadef,null))[_0x7721('0xe')](handleError(_0x4cadef,null));};exports[_0x7721('0x29')]=function(_0x4a90ce,_0xa389fa){return respondWithRpcPromise('OutboundChannels',_0x4a90ce[_0x7721('0x17')])[_0x7721('0x9')](respondWithResult(_0xa389fa,null))['catch'](handleError(_0xa389fa,null));};exports[_0x7721('0x2a')]=function(_0x3a47c8,_0x4e77ff){var _0x4d0111;return respondWithRpcPromise(_0x7721('0x2b'),_0x3a47c8[_0x7721('0x17')])[_0x7721('0x9')](function(_0x15e34d){_0x4d0111=_0x15e34d;return respondWithRpcPromise('Agents',_0x3a47c8[_0x7721('0x17')],routingClient);})[_0x7721('0x9')](function(_0x40ce8c){return _[_0x7721('0x1a')]({},_0x40ce8c,_0x4d0111);})[_0x7721('0x9')](respondWithResult(_0x4e77ff,null))['catch'](handleError(_0x4e77ff,null));};exports[_0x7721('0x2c')]=function(_0x4a2c28,_0xaa3216){if(_0x4a2c28['body']&&_0x4a2c28[_0x7721('0x2d')][_0x7721('0x2e')]&&_0x4a2c28[_0x7721('0x2f')]&&_0x4a2c28['user'][_0x7721('0x30')]){for(var _0x11d853 in _0x4a2c28[_0x7721('0x2d')]['interaction']){if(_0x4a2c28[_0x7721('0x2d')][_0x7721('0x2e')][_0x7721('0x31')](_0x11d853)){db[_0x7721('0x32')][_0x7721('0x33')]({'where':{'channel':_0x11d853,'membername':_0x4a2c28[_0x7721('0x2f')][_0x7721('0x30')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x4a2c28['body'][_0x7721('0x2e')][_0x11d853]&&_0x4a2c28[_0x7721('0x2d')][_0x7721('0x2e')][_0x11d853][_0x7721('0x34')]?{'$notIn':_0x4a2c28[_0x7721('0x2d')][_0x7721('0x2e')][_0x11d853]}:{'$ne':null}}})[_0x7721('0x9')](function(_0x2966fe){var _0xa601bc=moment()[_0x7721('0x35')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x578867=0x0,_0x5ed70d=_0x2966fe[_0x7721('0x34')];_0x578867<_0x5ed70d;_0x578867+=0x1){_0x2966fe[_0x578867][_0x7721('0x36')]({'exitAt':_0xa601bc});}});for(var _0x219c9f=0x0;_0x219c9f<_0x4a2c28['body'][_0x7721('0x2e')][_0x11d853][_0x7721('0x34')];_0x219c9f+=0x1){db['MemberReport'][_0x7721('0x37')]({'where':{'channel':_0x11d853,'membername':_0x4a2c28['user'][_0x7721('0x30')],'type':'INTERACTION','uniqueid':_0x4a2c28[_0x7721('0x2d')][_0x7721('0x2e')][_0x11d853][_0x219c9f],'exitAt':null},'defaults':{'channel':_0x11d853,'membername':_0x4a2c28[_0x7721('0x2f')]['name'],'interface':_[_0x7721('0x13')](_0x4a2c28[_0x7721('0x2f')]['interface'])?util[_0x7721('0x35')](_0x7721('0x38'),_0x4a2c28[_0x7721('0x2f')]['name']):_0x4a2c28[_0x7721('0x2f')]['interface'],'type':_0x7721('0x39'),'enterAt':moment()[_0x7721('0x35')](_0x7721('0x3a')),'role':_0x7721('0x3b'),'internal':_0x4a2c28[_0x7721('0x2f')][_0x7721('0x3c')],'uniqueid':_0x4a2c28[_0x7721('0x2d')][_0x7721('0x2e')][_0x11d853][_0x219c9f]}});}}}}return respondWithRpcPromise(_0x7721('0x3d'),{'id':_0x4a2c28[_0x7721('0x1b')]['id'],'capacity':_0x4a2c28[_0x7721('0x2d')][_0x7721('0x3e')]},routingClient)[_0x7721('0x9')](respondWithResult(_0xaa3216,null))[_0x7721('0xe')](handleError(_0xaa3216,null));};exports[_0x7721('0x3f')]=function(_0x5b741d,_0x474f32){return respondWithRpcPromise(_0x7721('0x40'),_0x5b741d[_0x7721('0x17')])[_0x7721('0x9')](respondWithResult(_0x474f32,null))[_0x7721('0xe')](handleError(_0x474f32,null));};exports[_0x7721('0x41')]=function(_0x267f5e,_0x57484c){return respondWithRpcPromise(_0x7721('0x42'),_0x267f5e[_0x7721('0x17')])[_0x7721('0x9')](respondWithResult(_0x57484c,null))[_0x7721('0xe')](handleError(_0x57484c,null));};exports[_0x7721('0x43')]=function(_0x9c0d4,_0x7fbd6c){return respondWithRpcPromise(_0x7721('0x44'),_0x9c0d4[_0x7721('0x17')])[_0x7721('0x9')](respondWithResult(_0x7fbd6c,null))[_0x7721('0xe')](handleError(_0x7fbd6c,null));};exports['chatQueues']=function(_0x421c27,_0xadb365){return respondWithRpcPromise(_0x7721('0x45'),_0x421c27[_0x7721('0x17')],routingClient)[_0x7721('0x9')](respondWithResult(_0xadb365,null))[_0x7721('0xe')](handleError(_0xadb365,null));};exports[_0x7721('0x46')]=function(_0x36fe6f,_0x360882){return respondWithRpcPromise(_0x7721('0x45'),_0x36fe6f[_0x7721('0x17')],routingClient)[_0x7721('0x9')](findById(_0x36fe6f[_0x7721('0x1b')]['id']))[_0x7721('0x9')](respondWithResult(_0x360882,null))[_0x7721('0xe')](handleError(_0x360882,null));};exports['mailQueues']=function(_0x50e9e9,_0x4e112e){return respondWithRpcPromise(_0x7721('0x47'),_0x50e9e9['query'],routingClient)['then'](respondWithResult(_0x4e112e,null))['catch'](handleError(_0x4e112e,null));};exports['showMailQueues']=function(_0x47925a,_0x219181){return respondWithRpcPromise(_0x7721('0x47'),_0x47925a['query'],routingClient)[_0x7721('0x9')](findById(_0x47925a['params']['id']))['then'](respondWithResult(_0x219181,null))['catch'](handleError(_0x219181,null));};exports[_0x7721('0x48')]=function(_0x4f0d38,_0x48e7e3){return respondWithRpcPromise('MailAccounts',_0x4f0d38[_0x7721('0x17')],mailClient)[_0x7721('0x9')](respondWithResult(_0x48e7e3,null))[_0x7721('0xe')](handleError(_0x48e7e3,null));};exports['openchannelQueues']=function(_0x2a025c,_0x1f1890){return respondWithRpcPromise(_0x7721('0x49'),_0x2a025c[_0x7721('0x17')],routingClient)[_0x7721('0x9')](respondWithResult(_0x1f1890,null))[_0x7721('0xe')](handleError(_0x1f1890,null));};exports[_0x7721('0x4a')]=function(_0x3e3301,_0x127f46){return respondWithRpcPromise(_0x7721('0x49'),_0x3e3301[_0x7721('0x17')],routingClient)[_0x7721('0x9')](findById(_0x3e3301[_0x7721('0x1b')]['id']))[_0x7721('0x9')](respondWithResult(_0x127f46,null))[_0x7721('0xe')](handleError(_0x127f46,null));};exports['smsQueues']=function(_0x233e5d,_0x2c93b0){return respondWithRpcPromise(_0x7721('0x4b'),_0x233e5d[_0x7721('0x17')],routingClient)['then'](respondWithResult(_0x2c93b0,null))[_0x7721('0xe')](handleError(_0x2c93b0,null));};exports[_0x7721('0x4c')]=function(_0x4c8284,_0x3e7df3){return respondWithRpcPromise('SmsQueues',_0x4c8284[_0x7721('0x17')],routingClient)[_0x7721('0x9')](findById(_0x4c8284[_0x7721('0x1b')]['id']))[_0x7721('0x9')](respondWithResult(_0x3e7df3,null))[_0x7721('0xe')](handleError(_0x3e7df3,null));};exports[_0x7721('0x4d')]=function(_0x3121e0,_0x167ce7){return respondWithRpcPromise(_0x7721('0x4e'),_0x3121e0['query'],routingClient)[_0x7721('0x9')](respondWithResult(_0x167ce7,null))[_0x7721('0xe')](handleError(_0x167ce7,null));};exports[_0x7721('0x4f')]=function(_0x3a11e2,_0x56a988){return respondWithRpcPromise(_0x7721('0x4e'),_0x3a11e2[_0x7721('0x17')],routingClient)['then'](findById(_0x3a11e2[_0x7721('0x1b')]['id']))[_0x7721('0x9')](respondWithResult(_0x56a988,null))['catch'](handleError(_0x56a988,null));};exports[_0x7721('0x50')]=function(_0x565c49,_0x14b543){return respondWithRpcPromise(_0x7721('0x51'),_0x565c49[_0x7721('0x17')],routingClient)[_0x7721('0x9')](respondWithResult(_0x14b543,null))[_0x7721('0xe')](handleError(_0x14b543,null));};exports[_0x7721('0x52')]=function(_0x258c57,_0x5dca04){return respondWithRpcPromise(_0x7721('0x51'),_0x258c57[_0x7721('0x17')],routingClient)[_0x7721('0x9')](findById(_0x258c57['params']['id']))['then'](respondWithResult(_0x5dca04,null))['catch'](handleError(_0x5dca04,null));};exports['faxAccounts']=function(_0x5e966f,_0x1fc5f7){return respondWithRpcPromise(_0x7721('0x53'),_0x5e966f['query'])[_0x7721('0x9')](respondWithResult(_0x1fc5f7,null))[_0x7721('0xe')](handleError(_0x1fc5f7,null));};exports[_0x7721('0x54')]=function(_0x4593e1,_0x53ebb1){return respondWithRpcPromise(_0x7721('0x55'),_0x4593e1[_0x7721('0x17')],routingClient)[_0x7721('0x9')](respondWithResult(_0x53ebb1,null))[_0x7721('0xe')](handleError(_0x53ebb1,null));};exports[_0x7721('0x56')]=function(_0x53adb1,_0x29ac64){return respondWithRpcPromise(_0x7721('0x57'),_0x53adb1[_0x7721('0x17')],routingClient)['then'](respondWithResult(_0x29ac64,null))['catch'](handleError(_0x29ac64,null));};exports[_0x7721('0x58')]=function(_0x752564,_0x423040){return respondWithRpcPromise(_0x7721('0x59'),_0x752564[_0x7721('0x17')],routingClient)['then'](respondWithResult(_0x423040,null))['catch'](handleError(_0x423040,null));};exports[_0x7721('0x5a')]=function(_0x1bd97e,_0x68de4){return respondWithRpcPromise(_0x7721('0x59'),_0x1bd97e[_0x7721('0x17')],routingClient)[_0x7721('0x9')](function(_0x34187f){if(_0x1bd97e['query'][_0x7721('0x5b')]!==undefined){var _0x413185=_(_0x34187f[_0x7721('0x5c')])['filter']([_0x1bd97e[_0x7721('0x17')][_0x7721('0x5b')],_0x1bd97e[_0x7721('0x1b')]['id']])[_0x7721('0x5d')]('queue_id')['uniq']()[_0x7721('0x5e')]();return _0x34187f[_0x7721('0x5c')][_0x7721('0x5f')](function(_0x42c849){return _0x413185[_0x7721('0x60')](_0x42c849[_0x7721('0x61')])>-0x1;});}else{return _0x34187f['rows'][_0x7721('0x5f')](function(_0x42bb5a){return _0x42bb5a[_0x7721('0x61')]===parseInt(_0x1bd97e['params']['id']);});}})[_0x7721('0x9')](respondWithResult(_0x68de4,null))[_0x7721('0xe')](handleError(_0x68de4,null));};exports[_0x7721('0x62')]=function(_0xc20188,_0x457d7f){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0xc20188[_0x7721('0x17')],routingClient)['then'](respondWithResult(_0x457d7f,null))[_0x7721('0xe')](handleError(_0x457d7f,null));};exports[_0x7721('0x63')]=function(_0x2d5433,_0x7f0598){return respondWithRpcPromise(_0x7721('0x64'),_0x2d5433[_0x7721('0x17')],routingClient)[_0x7721('0x9')](respondWithResult(_0x7f0598,null))[_0x7721('0xe')](handleError(_0x7f0598,null));};exports[_0x7721('0x65')]=function(_0x3b78f5,_0x2c74d8){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x3b78f5[_0x7721('0x17')],routingClient)[_0x7721('0x9')](respondWithResult(_0x2c74d8,null))[_0x7721('0xe')](handleError(_0x2c74d8,null));};exports['queueNotify']=function(_0x94af20){return function(_0x26b2cc,_0x139517){var _0xc9761e,_0xcd9f0d;var _0x594059=_[_0x7721('0x66')](_0x94af20);var _0x22f15a=_0x94af20===_0x7721('0x67')?_0x7721('0x68'):_0x7721('0x69');return db[_0x594059+_0x7721('0x6a')]['findOne']({'raw':!![],'where':{'id':_0x26b2cc[_0x7721('0x1b')]['id']}})[_0x7721('0x9')](function(_0x480a03){if(_[_0x7721('0x13')](_0x480a03)){throw new Error(_0x594059+'\x20Queue\x20not\x20found');}_0xc9761e=_0x480a03;return db[_0x594059+_0x7721('0x6b')][_0x7721('0x6c')]({'where':{'id':_0x26b2cc['body'][_0x7721('0x6d')]},'include':[{'model':db[_0x594059+'Interaction'],'as':'Interaction'},{'model':db[_0x594059+_0x22f15a],'as':'Account'}]});})[_0x7721('0x9')](function(_0x20f12e){if(_[_0x7721('0x13')](_0x20f12e)){throw new Error(_0x594059+'\x20Message\x20not\x20found');}_0xcd9f0d=_0x20f12e;return _0x20f12e['update']({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x355aa8={'uniqueid':_0x94af20+'.'+_0xcd9f0d['id']+'.'+_0xcd9f0d[_0x7721('0x6e')]['id'],'FromUserId':_0x26b2cc[_0x7721('0x2f')]['id'],'type':_0x7721('0x6f')};_0x355aa8[_0x594059+_0x7721('0x70')]=_0xcd9f0d['id'];_0x355aa8[_0x594059+_0x7721('0x71')]=_0xcd9f0d['Interaction']['id'];_0x355aa8[_0x7721('0x72')+_0x594059+_0x22f15a+'Id']=_0xcd9f0d[_0x7721('0x69')]['id'];_0x355aa8['To'+_0x594059+_0x7721('0x73')]=_0xc9761e['id'];return db[_0x594059+_0x7721('0x74')][_0x7721('0x75')](_0x355aa8);})[_0x7721('0x9')](function(){return respondWithRpcPromise(_0x7721('0x76'),{'channel':_0x94af20,'interaction':_0xcd9f0d[_0x7721('0x6e')],'message':_0xcd9f0d,'account':_0xcd9f0d[_0x7721('0x69')],'applications':[{'id':0x0,'priority':0x1,'app':_0x7721('0x6f'),'appdata':_0xc9761e[_0x7721('0x30')]+','+(_0xcd9f0d[_0x7721('0x69')]['queueTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x7721('0x9')](respondWithResult(_0x139517,null))[_0x7721('0xe')](handleError(_0x139517,null));};};exports['agentNotify']=function(_0x167e05,_0x570cf4){var _0x4e3c93,_0x154b4b;if(_['isNil'](_0x167e05['body'][_0x7721('0x77')])){throw new Error(_0x7721('0x78'));}var _0x28e123=_0x167e05[_0x7721('0x2d')][_0x7721('0x77')];var _0x494c5e=_[_0x7721('0x66')](_0x28e123);var _0xcf2c06=_0x28e123===_0x7721('0x67')?_0x7721('0x68'):'Account';return db['User'][_0x7721('0x6c')]({'raw':!![],'where':{'id':_0x167e05[_0x7721('0x1b')]['id'],'role':'agent'}})[_0x7721('0x9')](function(_0x13dc8a){if(_['isNil'](_0x13dc8a)){throw new Error('Agent\x20not\x20found');}_0x4e3c93=_0x13dc8a;return db[_0x494c5e+_0x7721('0x6b')][_0x7721('0x6c')]({'where':{'id':_0x167e05[_0x7721('0x2d')][_0x7721('0x6d')]},'include':[{'model':db[_0x494c5e+_0x7721('0x6e')],'as':_0x7721('0x6e')},{'model':db[_0x494c5e+_0xcf2c06],'as':_0x7721('0x69')}]});})[_0x7721('0x9')](function(_0x59de30){if(_[_0x7721('0x13')](_0x59de30)){throw new Error(_0x494c5e+_0x7721('0x79'));}_0x154b4b=_0x59de30;return _0x59de30[_0x7721('0x7a')]({'read':0x0,'readAt':null,'UserId':null});})[_0x7721('0x9')](function(){var _0xe1c795={'uniqueid':_0x28e123+'.'+_0x154b4b['id']+'.'+_0x154b4b[_0x7721('0x6e')]['id'],'FromUserId':_0x167e05[_0x7721('0x2f')]['id'],'type':'queue','ToUserId':_0x4e3c93['id']};_0xe1c795[_0x494c5e+_0x7721('0x70')]=_0x154b4b['id'];_0xe1c795[_0x494c5e+_0x7721('0x71')]=_0x154b4b['Interaction']['id'];_0xe1c795[_0x7721('0x72')+_0x494c5e+_0xcf2c06+'Id']=_0x154b4b[_0x7721('0x69')]['id'];return db[_0x494c5e+_0x7721('0x74')][_0x7721('0x75')](_0xe1c795);})[_0x7721('0x9')](function(){return respondWithRpcPromise(_0x7721('0x76'),{'channel':_0x28e123,'interaction':_0x154b4b[_0x7721('0x6e')],'message':_0x154b4b,'account':_0x154b4b[_0x7721('0x69')],'applications':[{'id':0x0,'priority':0x1,'app':_0x7721('0x3b'),'appdata':_0x4e3c93[_0x7721('0x30')]+','+(_0x154b4b['Account'][_0x7721('0x7b')]||0x12c),'interval':_0x7721('0x7c')}]},routingClient);})[_0x7721('0x9')](respondWithResult(_0x570cf4,null))[_0x7721('0xe')](handleError(_0x570cf4,null));}; \ No newline at end of file +var _0x2d17=['jayson/promise','http','request','then','error','code','message','result','catch','status','json','sendStatus','stack','name','send','isNil','find','rows','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','merge','params','voiceQueues','VoiceQueues','UpdateVoiceQueue','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','Agents','agentCapacity','interaction','user','body','MemberReport','findAll','length','findOrCreate','INTERACTION','interface','SIP/%s','format','YYYY-MM-DD\x20HH:mm:ss','internal','capacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','whatsappQueues','WhatsappQueues','faxQueues','FaxQueues','faxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','uniq','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','capitalize','chat','Account','Queue','\x20Queue\x20not\x20found','findOne','messageId','Interaction','\x20Message\x20not\x20found','update','queue','InteractionId','From','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Website','User','agent','Agent\x20not\x20found','Message','agentTransferTimeout','bluebird','moment','util','../../mysqldb','api'];(function(_0x3128c8,_0x5edbf0){var _0x5ea178=function(_0x5daac2){while(--_0x5daac2){_0x3128c8['push'](_0x3128c8['shift']());}};_0x5ea178(++_0x5edbf0);}(_0x2d17,0x17e));var _0x72d1=function(_0x10a22e,_0x59f0c2){_0x10a22e=_0x10a22e-0x0;var _0x7a972a=_0x2d17[_0x10a22e];return _0x7a972a;};'use strict';var BPromise=require(_0x72d1('0x0'));var moment=require(_0x72d1('0x1'));var _=require('lodash');var util=require(_0x72d1('0x2'));var db=require(_0x72d1('0x3'))['db'];var logger=require('../../config/logger')(_0x72d1('0x4'));var jayson=require(_0x72d1('0x5'));var amiClient=jayson['client'][_0x72d1('0x6')]({'port':0x232a});var mailClient=jayson['client'][_0x72d1('0x6')]({'port':0x232b});var routingClient=jayson['client'][_0x72d1('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x239d1f,_0x5b40a9,_0x477264){return new BPromise(function(_0x422f5a,_0x19e248){var _0x4e7f3e=_0x477264?_0x477264:amiClient;return _0x4e7f3e[_0x72d1('0x7')](_0x239d1f,_0x5b40a9)[_0x72d1('0x8')](function(_0x283775){if(_0x283775['error']){if(_0x283775[_0x72d1('0x9')][_0x72d1('0xa')]===0x1f4){return _0x19e248(_0x283775[_0x72d1('0x9')][_0x72d1('0xb')]);}return _0x422f5a(_0x283775[_0x72d1('0x9')][_0x72d1('0xb')]);}else{_0x422f5a(_0x283775[_0x72d1('0xc')]);}})[_0x72d1('0xd')](function(_0x273ccf){_0x19e248(_0x273ccf);});});}function respondWithResult(_0x2f5a78,_0x5ad4df){_0x5ad4df=_0x5ad4df||0xc8;return function(_0x3cd1ae){if(_0x3cd1ae){return _0x2f5a78[_0x72d1('0xe')](_0x5ad4df)[_0x72d1('0xf')](_0x3cd1ae);}return _0x2f5a78[_0x72d1('0x10')](0x194);};}function handleError(_0x22ac6f,_0x685a27){_0x685a27=_0x685a27||0x1f4;return function(_0x143718){logger[_0x72d1('0x9')](_0x143718[_0x72d1('0x11')]);if(_0x143718[_0x72d1('0x12')]){delete _0x143718[_0x72d1('0x12')];}_0x22ac6f[_0x72d1('0xe')](_0x685a27)[_0x72d1('0x13')](_0x143718);};}function findById(_0x491af4){return function(_0x46fa3d){if(!_['isNil'](_0x491af4)&&!_[_0x72d1('0x14')](_0x46fa3d)&&!_[_0x72d1('0x14')](_0x46fa3d['rows'])){return _[_0x72d1('0x15')](_0x46fa3d[_0x72d1('0x16')],function(_0x1ca18d){return _0x1ca18d['id']==_0x491af4;});}return null;};}exports['voiceChannels']=function(_0x4925f6,_0x313d7b){return respondWithRpcPromise(_0x72d1('0x17'),_0x4925f6[_0x72d1('0x18')])[_0x72d1('0x8')](respondWithResult(_0x313d7b,null))[_0x72d1('0xd')](handleError(_0x313d7b,null));};exports[_0x72d1('0x19')]=function(_0x1e2411,_0x5c7982){return respondWithRpcPromise(_0x72d1('0x1a'),_['merge'](_0x1e2411['query'],_0x1e2411['params']))['then'](respondWithResult(_0x5c7982,null))[_0x72d1('0xd')](handleError(_0x5c7982,null));};exports[_0x72d1('0x1b')]=function(_0x573c98,_0x2a421a){return respondWithRpcPromise(_0x72d1('0x1c'),_[_0x72d1('0x1d')](_0x573c98[_0x72d1('0x18')],_0x573c98[_0x72d1('0x1e')]))['then'](respondWithResult(_0x2a421a,null))['catch'](handleError(_0x2a421a,null));};exports[_0x72d1('0x1f')]=function(_0x36bc65,_0x2f661){return respondWithRpcPromise(_0x72d1('0x20'),_0x36bc65[_0x72d1('0x18')])[_0x72d1('0x8')](respondWithResult(_0x2f661,null))[_0x72d1('0xd')](handleError(_0x2f661,null));};exports['showVoiceQueues']=function(_0x57ec9e,_0x1ba258){return respondWithRpcPromise('VoiceQueues',_0x57ec9e[_0x72d1('0x18')])[_0x72d1('0x8')](findById(_0x57ec9e[_0x72d1('0x1e')]['id']))['then'](respondWithResult(_0x1ba258,null))[_0x72d1('0xd')](handleError(_0x1ba258,null));};exports['updateVoiceQueue']=function(_0x707cd0,_0x20055f){return respondWithRpcPromise(_0x72d1('0x21'),_[_0x72d1('0x1d')](_0x707cd0['body'],_0x707cd0[_0x72d1('0x1e')]))['then'](respondWithResult(_0x20055f,null))[_0x72d1('0xd')](handleError(_0x20055f,null));};exports[_0x72d1('0x22')]=function(_0x5cec3f,_0x14d653){return respondWithRpcPromise(_0x72d1('0x23'),_[_0x72d1('0x1d')](_0x5cec3f[_0x72d1('0x18')],_0x5cec3f[_0x72d1('0x1e')]))['then'](respondWithResult(_0x14d653,null))[_0x72d1('0xd')](handleError(_0x14d653,null));};exports[_0x72d1('0x24')]=function(_0x9efc2f,_0x482033){return respondWithRpcPromise(_0x72d1('0x25'),_0x9efc2f[_0x72d1('0x18')])['then'](respondWithResult(_0x482033,null))[_0x72d1('0xd')](handleError(_0x482033,null));};exports[_0x72d1('0x26')]=function(_0x437d79,_0x5a63d9){return respondWithRpcPromise(_0x72d1('0x27'),_['merge'](_0x437d79[_0x72d1('0x18')],_0x437d79[_0x72d1('0x1e')]))[_0x72d1('0x8')](respondWithResult(_0x5a63d9,null))[_0x72d1('0xd')](handleError(_0x5a63d9,null));};exports[_0x72d1('0x28')]=function(_0xc9798a,_0x3ed5de){return respondWithRpcPromise(_0x72d1('0x29'),_[_0x72d1('0x1d')](_0xc9798a[_0x72d1('0x18')],_0xc9798a[_0x72d1('0x1e')]))['then'](respondWithResult(_0x3ed5de,null))[_0x72d1('0xd')](handleError(_0x3ed5de,null));};exports[_0x72d1('0x2a')]=function(_0x4acab,_0x325209){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0x72d1('0x1d')](_0x4acab[_0x72d1('0x18')],_0x4acab[_0x72d1('0x1e')]))['then'](respondWithResult(_0x325209,null))[_0x72d1('0xd')](handleError(_0x325209,null));};exports[_0x72d1('0x2b')]=function(_0x163538,_0x5b897f){return respondWithRpcPromise(_0x72d1('0x2c'),_0x163538[_0x72d1('0x18')])[_0x72d1('0x8')](respondWithResult(_0x5b897f,null))['catch'](handleError(_0x5b897f,null));};exports[_0x72d1('0x2d')]=function(_0x40cdbd,_0x1e083e){return respondWithRpcPromise(_0x72d1('0x2e'),_0x40cdbd[_0x72d1('0x18')])[_0x72d1('0x8')](respondWithResult(_0x1e083e,null))[_0x72d1('0xd')](handleError(_0x1e083e,null));};exports['agents']=function(_0x12646c,_0x3ae4b5){var _0x440ac5;return respondWithRpcPromise(_0x72d1('0x2f'),_0x12646c[_0x72d1('0x18')])[_0x72d1('0x8')](function(_0x2f3080){_0x440ac5=_0x2f3080;return respondWithRpcPromise(_0x72d1('0x2f'),_0x12646c['query'],routingClient);})[_0x72d1('0x8')](function(_0x1a6dd4){return _[_0x72d1('0x1d')]({},_0x1a6dd4,_0x440ac5);})[_0x72d1('0x8')](respondWithResult(_0x3ae4b5,null))[_0x72d1('0xd')](handleError(_0x3ae4b5,null));};exports[_0x72d1('0x30')]=function(_0xb911fa,_0x3620df){if(_0xb911fa['body']&&_0xb911fa['body'][_0x72d1('0x31')]&&_0xb911fa[_0x72d1('0x32')]&&_0xb911fa[_0x72d1('0x32')][_0x72d1('0x12')]){for(var _0x5a6bc4 in _0xb911fa[_0x72d1('0x33')][_0x72d1('0x31')]){if(_0xb911fa['body'][_0x72d1('0x31')]['hasOwnProperty'](_0x5a6bc4)){db[_0x72d1('0x34')][_0x72d1('0x35')]({'where':{'channel':_0x5a6bc4,'membername':_0xb911fa['user'][_0x72d1('0x12')],'type':'INTERACTION','exitAt':null,'uniqueid':_0xb911fa['body']['interaction'][_0x5a6bc4]&&_0xb911fa[_0x72d1('0x33')]['interaction'][_0x5a6bc4][_0x72d1('0x36')]?{'$notIn':_0xb911fa[_0x72d1('0x33')][_0x72d1('0x31')][_0x5a6bc4]}:{'$ne':null}}})['then'](function(_0x4a5c1c){var _0x263fcb=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x2cb03d=0x0,_0x397f31=_0x4a5c1c[_0x72d1('0x36')];_0x2cb03d<_0x397f31;_0x2cb03d+=0x1){_0x4a5c1c[_0x2cb03d]['updateAttributes']({'exitAt':_0x263fcb});}});for(var _0x4f772d=0x0;_0x4f772d<_0xb911fa['body']['interaction'][_0x5a6bc4][_0x72d1('0x36')];_0x4f772d+=0x1){db[_0x72d1('0x34')][_0x72d1('0x37')]({'where':{'channel':_0x5a6bc4,'membername':_0xb911fa[_0x72d1('0x32')][_0x72d1('0x12')],'type':_0x72d1('0x38'),'uniqueid':_0xb911fa[_0x72d1('0x33')][_0x72d1('0x31')][_0x5a6bc4][_0x4f772d],'exitAt':null},'defaults':{'channel':_0x5a6bc4,'membername':_0xb911fa[_0x72d1('0x32')]['name'],'interface':_[_0x72d1('0x14')](_0xb911fa[_0x72d1('0x32')][_0x72d1('0x39')])?util['format'](_0x72d1('0x3a'),_0xb911fa[_0x72d1('0x32')][_0x72d1('0x12')]):_0xb911fa['user'][_0x72d1('0x39')],'type':_0x72d1('0x38'),'enterAt':moment()[_0x72d1('0x3b')](_0x72d1('0x3c')),'role':'agent','internal':_0xb911fa['user'][_0x72d1('0x3d')],'uniqueid':_0xb911fa[_0x72d1('0x33')][_0x72d1('0x31')][_0x5a6bc4][_0x4f772d]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0xb911fa[_0x72d1('0x1e')]['id'],'capacity':_0xb911fa[_0x72d1('0x33')][_0x72d1('0x3e')]},routingClient)[_0x72d1('0x8')](respondWithResult(_0x3620df,null))[_0x72d1('0xd')](handleError(_0x3620df,null));};exports[_0x72d1('0x3f')]=function(_0x3146cf,_0xebe855){return respondWithRpcPromise(_0x72d1('0x40'),_0x3146cf[_0x72d1('0x18')])[_0x72d1('0x8')](respondWithResult(_0xebe855,null))['catch'](handleError(_0xebe855,null));};exports[_0x72d1('0x41')]=function(_0x50d4d4,_0x5dd7b0){return respondWithRpcPromise(_0x72d1('0x42'),_0x50d4d4['query'])[_0x72d1('0x8')](respondWithResult(_0x5dd7b0,null))[_0x72d1('0xd')](handleError(_0x5dd7b0,null));};exports[_0x72d1('0x43')]=function(_0x162248,_0x473a7b){return respondWithRpcPromise(_0x72d1('0x44'),_0x162248[_0x72d1('0x18')])[_0x72d1('0x8')](respondWithResult(_0x473a7b,null))[_0x72d1('0xd')](handleError(_0x473a7b,null));};exports[_0x72d1('0x45')]=function(_0x14f9de,_0x52102e){return respondWithRpcPromise(_0x72d1('0x46'),_0x14f9de[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](respondWithResult(_0x52102e,null))['catch'](handleError(_0x52102e,null));};exports['showChatQueues']=function(_0x32f1ea,_0x140f0b){return respondWithRpcPromise(_0x72d1('0x46'),_0x32f1ea[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](findById(_0x32f1ea['params']['id']))[_0x72d1('0x8')](respondWithResult(_0x140f0b,null))['catch'](handleError(_0x140f0b,null));};exports[_0x72d1('0x47')]=function(_0x41c6a6,_0x20daf0){return respondWithRpcPromise(_0x72d1('0x48'),_0x41c6a6[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](respondWithResult(_0x20daf0,null))[_0x72d1('0xd')](handleError(_0x20daf0,null));};exports[_0x72d1('0x49')]=function(_0x384f0a,_0x3a2dfe){return respondWithRpcPromise(_0x72d1('0x48'),_0x384f0a[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](findById(_0x384f0a[_0x72d1('0x1e')]['id']))[_0x72d1('0x8')](respondWithResult(_0x3a2dfe,null))[_0x72d1('0xd')](handleError(_0x3a2dfe,null));};exports[_0x72d1('0x4a')]=function(_0x5e63cc,_0x1b40e8){return respondWithRpcPromise(_0x72d1('0x4b'),_0x5e63cc[_0x72d1('0x18')],mailClient)[_0x72d1('0x8')](respondWithResult(_0x1b40e8,null))[_0x72d1('0xd')](handleError(_0x1b40e8,null));};exports[_0x72d1('0x4c')]=function(_0x4e2d85,_0x1aec3d){return respondWithRpcPromise(_0x72d1('0x4d'),_0x4e2d85[_0x72d1('0x18')],routingClient)['then'](respondWithResult(_0x1aec3d,null))['catch'](handleError(_0x1aec3d,null));};exports[_0x72d1('0x4e')]=function(_0x5f4614,_0x28896f){return respondWithRpcPromise(_0x72d1('0x4d'),_0x5f4614[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](findById(_0x5f4614[_0x72d1('0x1e')]['id']))[_0x72d1('0x8')](respondWithResult(_0x28896f,null))[_0x72d1('0xd')](handleError(_0x28896f,null));};exports[_0x72d1('0x4f')]=function(_0x28e42b,_0x48cd1e){return respondWithRpcPromise('SmsQueues',_0x28e42b[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](respondWithResult(_0x48cd1e,null))[_0x72d1('0xd')](handleError(_0x48cd1e,null));};exports['showSmsQueues']=function(_0x31bfda,_0x333671){return respondWithRpcPromise('SmsQueues',_0x31bfda[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](findById(_0x31bfda[_0x72d1('0x1e')]['id']))[_0x72d1('0x8')](respondWithResult(_0x333671,null))[_0x72d1('0xd')](handleError(_0x333671,null));};exports[_0x72d1('0x50')]=function(_0x102574,_0x7925ec){return respondWithRpcPromise(_0x72d1('0x51'),_0x102574[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](respondWithResult(_0x7925ec,null))[_0x72d1('0xd')](handleError(_0x7925ec,null));};exports['showWhatsappQueues']=function(_0x55f49f,_0x15e0e0){return respondWithRpcPromise(_0x72d1('0x51'),_0x55f49f[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](findById(_0x55f49f[_0x72d1('0x1e')]['id']))[_0x72d1('0x8')](respondWithResult(_0x15e0e0,null))[_0x72d1('0xd')](handleError(_0x15e0e0,null));};exports[_0x72d1('0x52')]=function(_0x488a14,_0x837b6b){return respondWithRpcPromise('FaxQueues',_0x488a14[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](respondWithResult(_0x837b6b,null))['catch'](handleError(_0x837b6b,null));};exports['showFaxQueues']=function(_0xfd39ab,_0x14d59b){return respondWithRpcPromise(_0x72d1('0x53'),_0xfd39ab[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](findById(_0xfd39ab[_0x72d1('0x1e')]['id']))[_0x72d1('0x8')](respondWithResult(_0x14d59b,null))['catch'](handleError(_0x14d59b,null));};exports[_0x72d1('0x54')]=function(_0x24bd82,_0x336ca3){return respondWithRpcPromise('FaxAccounts',_0x24bd82[_0x72d1('0x18')])['then'](respondWithResult(_0x336ca3,null))[_0x72d1('0xd')](handleError(_0x336ca3,null));};exports[_0x72d1('0x55')]=function(_0x5158ff,_0x3c0a7e){return respondWithRpcPromise(_0x72d1('0x56'),_0x5158ff['query'],routingClient)[_0x72d1('0x8')](respondWithResult(_0x3c0a7e,null))[_0x72d1('0xd')](handleError(_0x3c0a7e,null));};exports[_0x72d1('0x57')]=function(_0x132a43,_0x4a52ec){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x132a43['query'],routingClient)[_0x72d1('0x8')](respondWithResult(_0x4a52ec,null))[_0x72d1('0xd')](handleError(_0x4a52ec,null));};exports[_0x72d1('0x58')]=function(_0x240159,_0x146b06){return respondWithRpcPromise(_0x72d1('0x59'),_0x240159['query'],routingClient)['then'](respondWithResult(_0x146b06,null))[_0x72d1('0xd')](handleError(_0x146b06,null));};exports[_0x72d1('0x5a')]=function(_0x36827e,_0x3ef7a3){return respondWithRpcPromise(_0x72d1('0x59'),_0x36827e[_0x72d1('0x18')],routingClient)['then'](function(_0x23f0e3){if(_0x36827e[_0x72d1('0x18')][_0x72d1('0x5b')]!==undefined){var _0x53e57b=_(_0x23f0e3[_0x72d1('0x16')])[_0x72d1('0x5c')]([_0x36827e[_0x72d1('0x18')][_0x72d1('0x5b')],_0x36827e[_0x72d1('0x1e')]['id']])[_0x72d1('0x5d')](_0x72d1('0x5e'))[_0x72d1('0x5f')]()['value']();return _0x23f0e3[_0x72d1('0x16')][_0x72d1('0x5c')](function(_0x24f5eb){return _0x53e57b[_0x72d1('0x60')](_0x24f5eb['queue_id'])>-0x1;});}else{return _0x23f0e3['rows'][_0x72d1('0x5c')](function(_0x2932bb){return _0x2932bb['queue_id']===parseInt(_0x36827e[_0x72d1('0x1e')]['id']);});}})[_0x72d1('0x8')](respondWithResult(_0x3ef7a3,null))[_0x72d1('0xd')](handleError(_0x3ef7a3,null));};exports[_0x72d1('0x61')]=function(_0x35b9bb,_0x1d1e22){return respondWithRpcPromise(_0x72d1('0x62'),_0x35b9bb[_0x72d1('0x18')],routingClient)['then'](respondWithResult(_0x1d1e22,null))[_0x72d1('0xd')](handleError(_0x1d1e22,null));};exports[_0x72d1('0x63')]=function(_0x38bfd3,_0x3cbe00){return respondWithRpcPromise(_0x72d1('0x64'),_0x38bfd3[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](respondWithResult(_0x3cbe00,null))[_0x72d1('0xd')](handleError(_0x3cbe00,null));};exports['faxQueuesWaitingInteractions']=function(_0x47585e,_0x466634){return respondWithRpcPromise(_0x72d1('0x65'),_0x47585e[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](respondWithResult(_0x466634,null))[_0x72d1('0xd')](handleError(_0x466634,null));};exports['queueNotify']=function(_0x1c6547){return function(_0x369153,_0x4a6607){var _0x266fbc,_0x4057ec;var _0x239cdb=_[_0x72d1('0x66')](_0x1c6547);var _0x27c651=_0x1c6547===_0x72d1('0x67')?'Website':_0x72d1('0x68');return db[_0x239cdb+_0x72d1('0x69')]['findOne']({'raw':!![],'where':{'id':_0x369153['params']['id']}})[_0x72d1('0x8')](function(_0x291b67){if(_[_0x72d1('0x14')](_0x291b67)){throw new Error(_0x239cdb+_0x72d1('0x6a'));}_0x266fbc=_0x291b67;return db[_0x239cdb+'Message'][_0x72d1('0x6b')]({'where':{'id':_0x369153[_0x72d1('0x33')][_0x72d1('0x6c')]},'include':[{'model':db[_0x239cdb+_0x72d1('0x6d')],'as':_0x72d1('0x6d')},{'model':db[_0x239cdb+_0x27c651],'as':_0x72d1('0x68')}]});})[_0x72d1('0x8')](function(_0x14a215){if(_['isNil'](_0x14a215)){throw new Error(_0x239cdb+_0x72d1('0x6e'));}_0x4057ec=_0x14a215;return _0x14a215[_0x72d1('0x6f')]({'read':0x0,'readAt':null,'UserId':null});})[_0x72d1('0x8')](function(){var _0x1b06f3={'uniqueid':_0x1c6547+'.'+_0x4057ec['id']+'.'+_0x4057ec['Interaction']['id'],'FromUserId':_0x369153[_0x72d1('0x32')]['id'],'type':_0x72d1('0x70')};_0x1b06f3[_0x239cdb+'MessageId']=_0x4057ec['id'];_0x1b06f3[_0x239cdb+_0x72d1('0x71')]=_0x4057ec['Interaction']['id'];_0x1b06f3[_0x72d1('0x72')+_0x239cdb+_0x27c651+'Id']=_0x4057ec['Account']['id'];_0x1b06f3['To'+_0x239cdb+_0x72d1('0x73')]=_0x266fbc['id'];return db[_0x239cdb+_0x72d1('0x74')][_0x72d1('0x75')](_0x1b06f3);})[_0x72d1('0x8')](function(){return respondWithRpcPromise(_0x72d1('0x76'),{'channel':_0x1c6547,'interaction':_0x4057ec['Interaction'],'message':_0x4057ec,'account':_0x4057ec[_0x72d1('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0x72d1('0x70'),'appdata':_0x266fbc[_0x72d1('0x12')]+','+(_0x4057ec['Account'][_0x72d1('0x77')]||0x12c),'interval':_0x72d1('0x78')}]},routingClient);})['then'](respondWithResult(_0x4a6607,null))[_0x72d1('0xd')](handleError(_0x4a6607,null));};};exports[_0x72d1('0x79')]=function(_0x8d4f0d,_0x5c262e){var _0x1d0db0,_0x39d961;if(_[_0x72d1('0x14')](_0x8d4f0d['body'][_0x72d1('0x7a')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x38a32c=_0x8d4f0d['body'][_0x72d1('0x7a')];var _0x2d45c9=_[_0x72d1('0x66')](_0x38a32c);var _0x21ad86=_0x38a32c==='chat'?_0x72d1('0x7b'):_0x72d1('0x68');return db[_0x72d1('0x7c')][_0x72d1('0x6b')]({'raw':!![],'where':{'id':_0x8d4f0d['params']['id'],'role':_0x72d1('0x7d')}})[_0x72d1('0x8')](function(_0x430905){if(_[_0x72d1('0x14')](_0x430905)){throw new Error(_0x72d1('0x7e'));}_0x1d0db0=_0x430905;return db[_0x2d45c9+_0x72d1('0x7f')][_0x72d1('0x6b')]({'where':{'id':_0x8d4f0d['body']['messageId']},'include':[{'model':db[_0x2d45c9+'Interaction'],'as':_0x72d1('0x6d')},{'model':db[_0x2d45c9+_0x21ad86],'as':'Account'}]});})[_0x72d1('0x8')](function(_0x8f4603){if(_['isNil'](_0x8f4603)){throw new Error(_0x2d45c9+_0x72d1('0x6e'));}_0x39d961=_0x8f4603;return _0x8f4603['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x72d1('0x8')](function(){var _0x378cf0={'uniqueid':_0x38a32c+'.'+_0x39d961['id']+'.'+_0x39d961[_0x72d1('0x6d')]['id'],'FromUserId':_0x8d4f0d[_0x72d1('0x32')]['id'],'type':'queue','ToUserId':_0x1d0db0['id']};_0x378cf0[_0x2d45c9+'MessageId']=_0x39d961['id'];_0x378cf0[_0x2d45c9+_0x72d1('0x71')]=_0x39d961['Interaction']['id'];_0x378cf0['From'+_0x2d45c9+_0x21ad86+'Id']=_0x39d961['Account']['id'];return db[_0x2d45c9+_0x72d1('0x74')][_0x72d1('0x75')](_0x378cf0);})[_0x72d1('0x8')](function(){return respondWithRpcPromise(_0x72d1('0x76'),{'channel':_0x38a32c,'interaction':_0x39d961[_0x72d1('0x6d')],'message':_0x39d961,'account':_0x39d961[_0x72d1('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0x72d1('0x7d'),'appdata':_0x1d0db0['name']+','+(_0x39d961['Account'][_0x72d1('0x80')]||0x12c),'interval':_0x72d1('0x78')}]},routingClient);})['then'](respondWithResult(_0x5c262e,null))[_0x72d1('0xd')](handleError(_0x5c262e,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index b47e3e2..a8bc868 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 _0x01bb=['get','isAuthenticated','index','/:id','show','/:id/run','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller'];(function(_0x3fd354,_0x177eee){var _0x2b6979=function(_0x433198){while(--_0x433198){_0x3fd354['push'](_0x3fd354['shift']());}};_0x2b6979(++_0x177eee);}(_0x01bb,0x166));var _0xb01b=function(_0x2d90d5,_0x446b76){_0x2d90d5=_0x2d90d5-0x0;var _0x1890c3=_0x01bb[_0x2d90d5];return _0x1890c3;};'use strict';var multer=require(_0xb01b('0x0'));var util=require(_0xb01b('0x1'));var path=require(_0xb01b('0x2'));var timeout=require(_0xb01b('0x3'));var express=require('express');var router=express[_0xb01b('0x4')]();var fs_extra=require(_0xb01b('0x5'));var auth=require(_0xb01b('0x6'));var interaction=require(_0xb01b('0x7'));var config=require(_0xb01b('0x8'));var controller=require(_0xb01b('0x9'));router[_0xb01b('0xa')]('/',auth[_0xb01b('0xb')](),controller[_0xb01b('0xc')]);router[_0xb01b('0xa')](_0xb01b('0xd'),auth[_0xb01b('0xb')](),controller[_0xb01b('0xe')]);router[_0xb01b('0xa')](_0xb01b('0xf'),auth['isAuthenticated'](),controller['run']);router[_0xb01b('0x10')]('/',auth[_0xb01b('0xb')](),controller[_0xb01b('0x11')]);router[_0xb01b('0x12')]('/:id',auth[_0xb01b('0xb')](),controller[_0xb01b('0x13')]);router[_0xb01b('0x14')]('/:id',auth[_0xb01b('0xb')](),controller[_0xb01b('0x15')]);module[_0xb01b('0x16')]=router; \ No newline at end of file +var _0xf375=['put','delete','destroy','exports','multer','util','connect-timeout','express','Router','./schedule.controller','get','isAuthenticated','/:id','show','/:id/run','post','create'];(function(_0x4f3684,_0x51913d){var _0x3b73d7=function(_0x3dfb5d){while(--_0x3dfb5d){_0x4f3684['push'](_0x4f3684['shift']());}};_0x3b73d7(++_0x51913d);}(_0xf375,0x6a));var _0x5f37=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xf375[_0x21a9d9];return _0x46adce;};'use strict';var multer=require(_0x5f37('0x0'));var util=require(_0x5f37('0x1'));var path=require('path');var timeout=require(_0x5f37('0x2'));var express=require(_0x5f37('0x3'));var router=express[_0x5f37('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5f37('0x5'));router[_0x5f37('0x6')]('/',auth[_0x5f37('0x7')](),controller['index']);router[_0x5f37('0x6')](_0x5f37('0x8'),auth[_0x5f37('0x7')](),controller[_0x5f37('0x9')]);router['get'](_0x5f37('0xa'),auth[_0x5f37('0x7')](),controller['run']);router[_0x5f37('0xb')]('/',auth[_0x5f37('0x7')](),controller[_0x5f37('0xc')]);router[_0x5f37('0xd')](_0x5f37('0x8'),auth[_0x5f37('0x7')](),controller['update']);router[_0x5f37('0xe')](_0x5f37('0x8'),auth[_0x5f37('0x7')](),controller[_0x5f37('0xf')]);module[_0x5f37('0x10')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index d0278e4..0c9c8f0 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 _0xfbb2=['months','days','minutes','pdf','custom','BOOLEAN','exports','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters'];(function(_0x55a4cf,_0x3abd98){var _0xaaff92=function(_0x439fa9){while(--_0x439fa9){_0x55a4cf['push'](_0x55a4cf['shift']());}};_0xaaff92(++_0x3abd98);}(_0xfbb2,0x1f0));var _0x2fbb=function(_0x1b999f,_0xada878){_0x1b999f=_0x1b999f-0x0;var _0x51d27a=_0xfbb2[_0x1b999f];return _0x51d27a;};'use strict';var Sequelize=require('sequelize');module[_0x2fbb('0x0')]={'name':{'type':Sequelize[_0x2fbb('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x2fbb('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2fbb('0x2')},'startAt':{'type':Sequelize[_0x2fbb('0x3')],'allowNull':![]},'endAt':{'type':Sequelize[_0x2fbb('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x2fbb('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x2fbb('0x5')](_0x2fbb('0x6'),_0x2fbb('0x7'),_0x2fbb('0x8'),'weeks',_0x2fbb('0x9'),'hours',_0x2fbb('0xa')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0x2fbb('0x5')]('csv',_0x2fbb('0xb'),'xlsx'),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0x2fbb('0x5')](_0x2fbb('0xc'),'default'),'allowNull':![],'defaultValue':_0x2fbb('0xc')},'sendMail':{'type':Sequelize[_0x2fbb('0xd')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0x2fbb('0xd')],'defaultValue':!![]}}; \ No newline at end of file +var _0x6efc=['weeks','days','hours','minutes','ENUM','pdf','csv','custom','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','INTEGER','years','quarters','months'];(function(_0x5a7f65,_0x3a6f0a){var _0x5bea13=function(_0x14576f){while(--_0x14576f){_0x5a7f65['push'](_0x5a7f65['shift']());}};_0x5bea13(++_0x3a6f0a);}(_0x6efc,0x14d));var _0xc6ef=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6efc[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xc6ef('0x0'));module[_0xc6ef('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xc6ef('0x2')]},'active':{'type':Sequelize[_0xc6ef('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xc6ef('0x2')],'allowNull':![],'defaultValue':_0xc6ef('0x4')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xc6ef('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0xc6ef('0x6'),_0xc6ef('0x7'),_0xc6ef('0x8'),_0xc6ef('0x9'),_0xc6ef('0xa'),_0xc6ef('0xb'),_0xc6ef('0xc')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0xc6ef('0xd')]('csv',_0xc6ef('0xe'),'xlsx'),'allowNull':![],'defaultValue':_0xc6ef('0xf')},'type':{'type':Sequelize[_0xc6ef('0xd')]('custom','default'),'allowNull':![],'defaultValue':_0xc6ef('0x10')},'sendMail':{'type':Sequelize[_0xc6ef('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xc6ef('0x2')]},'cc':{'type':Sequelize[_0xc6ef('0x11')]},'bcc':{'type':Sequelize[_0xc6ef('0x11')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 1216920..8219963 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 _0x4c07=['name','send','map','Schedule','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','includeAll','include','rows','show','params','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','../../config/schedule','run','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','destroy','get','Scheduler','UserProfileResource','error','stack'];(function(_0x145170,_0x5f05c7){var _0x5adf7b=function(_0x1c7f00){while(--_0x1c7f00){_0x145170['push'](_0x145170['shift']());}};_0x5adf7b(++_0x5f05c7);}(_0x4c07,0x174));var _0x74c0=function(_0x419550,_0x15cdf1){_0x419550=_0x419550-0x0;var _0x55f9ef=_0x4c07[_0x419550];return _0x55f9ef;};'use strict';var emlformat=require(_0x74c0('0x0'));var rimraf=require(_0x74c0('0x1'));var zipdir=require(_0x74c0('0x2'));var jsonpatch=require(_0x74c0('0x3'));var rp=require(_0x74c0('0x4'));var moment=require(_0x74c0('0x5'));var BPromise=require(_0x74c0('0x6'));var Mustache=require(_0x74c0('0x7'));var util=require(_0x74c0('0x8'));var path=require(_0x74c0('0x9'));var sox=require(_0x74c0('0xa'));var csv=require(_0x74c0('0xb'));var ejs=require(_0x74c0('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x74c0('0xd'));var crypto=require(_0x74c0('0xe'));var jsforce=require(_0x74c0('0xf'));var deskjs=require(_0x74c0('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x74c0('0x11'));var authService=require(_0x74c0('0x12'));var qs=require(_0x74c0('0x13'));var as=require(_0x74c0('0x14'));var hardwareService=require(_0x74c0('0x15'));var logger=require(_0x74c0('0x16'))('api');var utils=require(_0x74c0('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x74c0('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1cabc1,_0x47132c){_0x47132c=_0x47132c||0xcc;return function(_0x1a1fb0){if(_0x1a1fb0){return _0x1cabc1[_0x74c0('0x19')](_0x47132c);}return _0x1cabc1['status'](_0x47132c)['end']();};}function respondWithResult(_0x50dbd9,_0x5c20f0){_0x5c20f0=_0x5c20f0||0xc8;return function(_0x10e1f2){if(_0x10e1f2){return _0x50dbd9[_0x74c0('0x1a')](_0x5c20f0)[_0x74c0('0x1b')](_0x10e1f2);}};}function respondWithFilteredResult(_0x40e0b9,_0x438e5a){return function(_0x2907c9){if(_0x2907c9){var _0xde3433=typeof _0x438e5a[_0x74c0('0x1c')]===_0x74c0('0x1d')&&typeof _0x438e5a['limit']===_0x74c0('0x1d');var _0x5870e6=_0x2907c9[_0x74c0('0x1e')];var _0x387453=_0xde3433?0x0:_0x438e5a[_0x74c0('0x1c')];var _0x2078f0=_0xde3433?_0x2907c9[_0x74c0('0x1e')]:_0x438e5a[_0x74c0('0x1c')]+_0x438e5a[_0x74c0('0x1f')];var _0x458958;if(_0x2078f0>=_0x5870e6){_0x2078f0=_0x5870e6;_0x458958=0xc8;}else{_0x458958=0xce;}_0x40e0b9[_0x74c0('0x1a')](_0x458958);return _0x40e0b9['set'](_0x74c0('0x20'),_0x387453+'-'+_0x2078f0+'/'+_0x5870e6)[_0x74c0('0x1b')](_0x2907c9);}return null;};}function patchUpdates(_0x412c17){return function(_0x164aa2){try{jsonpatch[_0x74c0('0x21')](_0x164aa2,_0x412c17,!![]);}catch(_0x1e1c86){return BPromise[_0x74c0('0x22')](_0x1e1c86);}return _0x164aa2['save']();};}function saveUpdates(_0x266e18,_0x503239){return function(_0x323756){if(_0x323756){return _0x323756[_0x74c0('0x23')](_0x266e18)[_0x74c0('0x24')](function(_0x3df935){return _0x3df935;});}return null;};}function removeEntity(_0x4edb5f,_0x411dc7){return function(_0x275b98){if(_0x275b98){return _0x275b98[_0x74c0('0x25')]()[_0x74c0('0x24')](function(){var _0x5f36b5=_0x275b98[_0x74c0('0x26')]({'plain':!![]});var _0x4ef4a6=_0x74c0('0x27');return db[_0x74c0('0x28')][_0x74c0('0x25')]({'where':{'type':_0x4ef4a6,'resourceId':_0x5f36b5['id']}})[_0x74c0('0x24')](function(){return _0x275b98;});})[_0x74c0('0x24')](function(){_0x4edb5f[_0x74c0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b1d9d,_0x38e607){return function(_0x5d57a8){if(!_0x5d57a8){_0x1b1d9d[_0x74c0('0x19')](0x194);}return _0x5d57a8;};}function handleError(_0x136219,_0xd65bb7){_0xd65bb7=_0xd65bb7||0x1f4;return function(_0x2e9080){logger[_0x74c0('0x29')](_0x2e9080[_0x74c0('0x2a')]);if(_0x2e9080[_0x74c0('0x2b')]){delete _0x2e9080[_0x74c0('0x2b')];}_0x136219[_0x74c0('0x1a')](_0xd65bb7)[_0x74c0('0x2c')](_0x2e9080);};}exports['index']=function(_0x4f576a,_0x1cd996){var _0x2f634a={},_0x952a13={},_0x3981f0={'count':0x0,'rows':[]};var _0x59ffe7=_[_0x74c0('0x2d')](db[_0x74c0('0x2e')][_0x74c0('0x2f')],function(_0x1e2434){return{'name':_0x1e2434[_0x74c0('0x30')],'type':_0x1e2434[_0x74c0('0x31')][_0x74c0('0x32')]};});_0x952a13[_0x74c0('0x33')]=_[_0x74c0('0x2d')](_0x59ffe7,_0x74c0('0x2b'));_0x952a13['query']=_[_0x74c0('0x34')](_0x4f576a['query']);_0x952a13[_0x74c0('0x35')]=_[_0x74c0('0x36')](_0x952a13[_0x74c0('0x33')],_0x952a13[_0x74c0('0x37')]);_0x2f634a['attributes']=_[_0x74c0('0x36')](_0x952a13[_0x74c0('0x33')],qs['fields'](_0x4f576a[_0x74c0('0x37')][_0x74c0('0x38')]));_0x2f634a[_0x74c0('0x39')]=_0x2f634a[_0x74c0('0x39')][_0x74c0('0x3a')]?_0x2f634a[_0x74c0('0x39')]:_0x952a13['model'];if(!_0x4f576a['query'][_0x74c0('0x3b')](_0x74c0('0x3c'))){_0x2f634a['limit']=qs[_0x74c0('0x1f')](_0x4f576a[_0x74c0('0x37')]['limit']);_0x2f634a['offset']=qs[_0x74c0('0x1c')](_0x4f576a[_0x74c0('0x37')][_0x74c0('0x1c')]);}_0x2f634a[_0x74c0('0x3d')]=qs['sort'](_0x4f576a['query'][_0x74c0('0x3e')]);_0x2f634a[_0x74c0('0x3f')]=qs[_0x74c0('0x35')](_['pick'](_0x4f576a[_0x74c0('0x37')],_0x952a13[_0x74c0('0x35')]),_0x59ffe7);if(_0x4f576a['query']['filter']){_0x2f634a[_0x74c0('0x3f')]=_[_0x74c0('0x40')](_0x2f634a[_0x74c0('0x3f')],{'$or':_[_0x74c0('0x2d')](_0x59ffe7,function(_0x5d9762){if(_0x5d9762[_0x74c0('0x31')]!==_0x74c0('0x41')){var _0x12bfc0={};_0x12bfc0[_0x5d9762['name']]={'$like':'%'+_0x4f576a[_0x74c0('0x37')]['filter']+'%'};return _0x12bfc0;}})});}_0x2f634a=_[_0x74c0('0x40')]({},_0x2f634a,_0x4f576a[_0x74c0('0x42')]);var _0x2805b9={'where':_0x2f634a[_0x74c0('0x3f')]};return db[_0x74c0('0x2e')][_0x74c0('0x1e')](_0x2805b9)[_0x74c0('0x24')](function(_0x4639f2){_0x3981f0[_0x74c0('0x1e')]=_0x4639f2;if(_0x4f576a[_0x74c0('0x37')][_0x74c0('0x43')]){_0x2f634a[_0x74c0('0x44')]=[{'all':!![]}];}return db[_0x74c0('0x2e')]['findAll'](_0x2f634a);})[_0x74c0('0x24')](function(_0x238fcc){_0x3981f0[_0x74c0('0x45')]=_0x238fcc;return _0x3981f0;})[_0x74c0('0x24')](respondWithFilteredResult(_0x1cd996,_0x2f634a))['catch'](handleError(_0x1cd996,null));};exports[_0x74c0('0x46')]=function(_0xb4e61c,_0xc5ce1f){var _0x12c085={'raw':![],'where':{'id':_0xb4e61c[_0x74c0('0x47')]['id']}},_0x5ec1fe={};_0x5ec1fe['model']=_[_0x74c0('0x34')](db['Schedule'][_0x74c0('0x2f')]);_0x5ec1fe[_0x74c0('0x37')]=_[_0x74c0('0x34')](_0xb4e61c[_0x74c0('0x37')]);_0x5ec1fe['filters']=_[_0x74c0('0x36')](_0x5ec1fe[_0x74c0('0x33')],_0x5ec1fe[_0x74c0('0x37')]);_0x12c085[_0x74c0('0x39')]=_[_0x74c0('0x36')](_0x5ec1fe[_0x74c0('0x33')],qs[_0x74c0('0x38')](_0xb4e61c[_0x74c0('0x37')][_0x74c0('0x38')]));_0x12c085[_0x74c0('0x39')]=_0x12c085['attributes']['length']?_0x12c085[_0x74c0('0x39')]:_0x5ec1fe[_0x74c0('0x33')];if(_0xb4e61c['query'][_0x74c0('0x43')]){_0x12c085[_0x74c0('0x44')]=[{'all':!![]}];}_0x12c085=_[_0x74c0('0x40')]({},_0x12c085,_0xb4e61c[_0x74c0('0x42')]);return db['Schedule']['find'](_0x12c085)[_0x74c0('0x24')](handleEntityNotFound(_0xc5ce1f,null))['then'](respondWithResult(_0xc5ce1f,null))[_0x74c0('0x48')](handleError(_0xc5ce1f,null));};exports['create']=function(_0x5e9e6e,_0x124111){return db[_0x74c0('0x2e')][_0x74c0('0x49')](_0x5e9e6e[_0x74c0('0x4a')],{})[_0x74c0('0x24')](function(_0x36e839){var _0x2daab2=_0x5e9e6e[_0x74c0('0x4b')][_0x74c0('0x26')]({'plain':!![]});if(!_0x2daab2)throw new Error(_0x74c0('0x4c'));if(_0x2daab2[_0x74c0('0x4d')]===_0x74c0('0x4b')){var _0x172cc9=_0x36e839[_0x74c0('0x26')]({'plain':!![]});var _0x349e5c=_0x74c0('0x27');return db['UserProfileSection'][_0x74c0('0x4e')]({'where':{'name':_0x349e5c,'userProfileId':_0x2daab2[_0x74c0('0x4f')]},'raw':!![]})['then'](function(_0x50a6b4){if(_0x50a6b4&&_0x50a6b4['autoAssociation']===0x0){return db[_0x74c0('0x28')][_0x74c0('0x49')]({'name':_0x172cc9['name'],'resourceId':_0x172cc9['id'],'type':_0x50a6b4[_0x74c0('0x2b')],'sectionId':_0x50a6b4['id']},{})[_0x74c0('0x24')](function(){return _0x36e839;});}else{return _0x36e839;}})[_0x74c0('0x48')](function(_0x2a366a){logger[_0x74c0('0x29')](_0x74c0('0x50'),_0x2a366a);throw _0x2a366a;});}return _0x36e839;})[_0x74c0('0x24')](respondWithResult(_0x124111,0xc9))[_0x74c0('0x48')](handleError(_0x124111,null));};exports[_0x74c0('0x23')]=function(_0x1dfbe7,_0x4c7472){if(_0x1dfbe7['body']['id']){delete _0x1dfbe7[_0x74c0('0x4a')]['id'];}return db['Schedule']['find']({'where':{'id':_0x1dfbe7['params']['id']}})[_0x74c0('0x24')](handleEntityNotFound(_0x4c7472,null))['then'](saveUpdates(_0x1dfbe7[_0x74c0('0x4a')],null))[_0x74c0('0x24')](respondWithResult(_0x4c7472,null))[_0x74c0('0x48')](handleError(_0x4c7472,null));};exports['destroy']=function(_0x51f949,_0x5c6832){return db[_0x74c0('0x2e')][_0x74c0('0x4e')]({'where':{'id':_0x51f949[_0x74c0('0x47')]['id']}})[_0x74c0('0x24')](handleEntityNotFound(_0x5c6832,null))[_0x74c0('0x24')](removeEntity(_0x5c6832,null))[_0x74c0('0x48')](handleError(_0x5c6832,null));};exports['run']=function(_0x32bc88,_0xd81069,_0x8e0fe7){var _0x1d0217=require(_0x74c0('0x51'));return db[_0x74c0('0x2e')]['find']({'where':{'id':_0x32bc88[_0x74c0('0x47')]['id']},'raw':!![]})[_0x74c0('0x24')](handleEntityNotFound(_0xd81069,null))[_0x74c0('0x24')](function(){_0x1d0217[_0x74c0('0x52')](_0x32bc88[_0x74c0('0x47')]['id']);})[_0x74c0('0x24')](respondWithStatusCode(_0xd81069,null))['catch'](handleError(_0xd81069,null));}; \ No newline at end of file +var _0xa150=['moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','destroy','UserProfileResource','then','stack','name','status','index','rawAttributes','type','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','Schedule','includeAll','catch','show','params','keys','include','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Scheduler','UserProfileSection','userProfileId','autoAssociation','error','body','run','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x32623b,_0x4a0bca){var _0x1cf4e3=function(_0x571500){while(--_0x571500){_0x32623b['push'](_0x32623b['shift']());}};_0x1cf4e3(++_0x4a0bca);}(_0xa150,0x190));var _0x0a15=function(_0x138d27,_0x21d292){_0x138d27=_0x138d27-0x0;var _0x386fae=_0xa150[_0x138d27];return _0x386fae;};'use strict';var emlformat=require(_0x0a15('0x0'));var rimraf=require(_0x0a15('0x1'));var zipdir=require(_0x0a15('0x2'));var jsonpatch=require(_0x0a15('0x3'));var rp=require(_0x0a15('0x4'));var moment=require(_0x0a15('0x5'));var BPromise=require(_0x0a15('0x6'));var Mustache=require(_0x0a15('0x7'));var util=require('util');var path=require(_0x0a15('0x8'));var sox=require(_0x0a15('0x9'));var csv=require(_0x0a15('0xa'));var ejs=require(_0x0a15('0xb'));var fs=require('fs');var fs_extra=require(_0x0a15('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0a15('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0a15('0xe'));var toCsv=require(_0x0a15('0xa'));var querystring=require(_0x0a15('0xf'));var Papa=require(_0x0a15('0x10'));var Redis=require(_0x0a15('0x11'));var authService=require(_0x0a15('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0a15('0x13'));var hardwareService=require(_0x0a15('0x14'));var logger=require(_0x0a15('0x15'))(_0x0a15('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a15('0x17'));var db=require(_0x0a15('0x18'))['db'];function respondWithStatusCode(_0x95cad2,_0x31c3f4){_0x31c3f4=_0x31c3f4||0xcc;return function(_0x522b93){if(_0x522b93){return _0x95cad2[_0x0a15('0x19')](_0x31c3f4);}return _0x95cad2['status'](_0x31c3f4)[_0x0a15('0x1a')]();};}function respondWithResult(_0x3f5b5e,_0x177c7b){_0x177c7b=_0x177c7b||0xc8;return function(_0x33ab0f){if(_0x33ab0f){return _0x3f5b5e['status'](_0x177c7b)[_0x0a15('0x1b')](_0x33ab0f);}};}function respondWithFilteredResult(_0x4c3ca3,_0x4554d3){return function(_0x52ced8){if(_0x52ced8){var _0x10355d=typeof _0x4554d3['offset']===_0x0a15('0x1c')&&typeof _0x4554d3[_0x0a15('0x1d')]===_0x0a15('0x1c');var _0x5573d5=_0x52ced8[_0x0a15('0x1e')];var _0x318baa=_0x10355d?0x0:_0x4554d3['offset'];var _0x26af99=_0x10355d?_0x52ced8[_0x0a15('0x1e')]:_0x4554d3[_0x0a15('0x1f')]+_0x4554d3[_0x0a15('0x1d')];var _0x1a6527;if(_0x26af99>=_0x5573d5){_0x26af99=_0x5573d5;_0x1a6527=0xc8;}else{_0x1a6527=0xce;}_0x4c3ca3['status'](_0x1a6527);return _0x4c3ca3[_0x0a15('0x20')](_0x0a15('0x21'),_0x318baa+'-'+_0x26af99+'/'+_0x5573d5)[_0x0a15('0x1b')](_0x52ced8);}return null;};}function patchUpdates(_0x433884){return function(_0x36e82e){try{jsonpatch[_0x0a15('0x22')](_0x36e82e,_0x433884,!![]);}catch(_0x34d854){return BPromise['reject'](_0x34d854);}return _0x36e82e[_0x0a15('0x23')]();};}function saveUpdates(_0xf98d0,_0x30106e){return function(_0x12a17b){if(_0x12a17b){return _0x12a17b[_0x0a15('0x24')](_0xf98d0)['then'](function(_0x396eb0){return _0x396eb0;});}return null;};}function removeEntity(_0x5aaffe,_0x5f4338){return function(_0x507f82){if(_0x507f82){return _0x507f82[_0x0a15('0x25')]()['then'](function(){var _0x2339ec=_0x507f82['get']({'plain':!![]});var _0x59b7b5='Scheduler';return db[_0x0a15('0x26')]['destroy']({'where':{'type':_0x59b7b5,'resourceId':_0x2339ec['id']}})[_0x0a15('0x27')](function(){return _0x507f82;});})[_0x0a15('0x27')](function(){_0x5aaffe['status'](0xcc)[_0x0a15('0x1a')]();});}};}function handleEntityNotFound(_0x6edba2,_0x1e8e63){return function(_0x1377af){if(!_0x1377af){_0x6edba2[_0x0a15('0x19')](0x194);}return _0x1377af;};}function handleError(_0x13bfb9,_0x53b8ad){_0x53b8ad=_0x53b8ad||0x1f4;return function(_0x467f98){logger['error'](_0x467f98[_0x0a15('0x28')]);if(_0x467f98['name']){delete _0x467f98[_0x0a15('0x29')];}_0x13bfb9[_0x0a15('0x2a')](_0x53b8ad)['send'](_0x467f98);};}exports[_0x0a15('0x2b')]=function(_0x281d55,_0x1fe634){var _0x2b11d0={},_0x328527={},_0x5d1e89={'count':0x0,'rows':[]};var _0x5c24bd=_['map'](db['Schedule'][_0x0a15('0x2c')],function(_0x264210){return{'name':_0x264210['fieldName'],'type':_0x264210[_0x0a15('0x2d')]['key']};});_0x328527[_0x0a15('0x2e')]=_['map'](_0x5c24bd,_0x0a15('0x29'));_0x328527[_0x0a15('0x2f')]=_['keys'](_0x281d55[_0x0a15('0x2f')]);_0x328527[_0x0a15('0x30')]=_['intersection'](_0x328527[_0x0a15('0x2e')],_0x328527[_0x0a15('0x2f')]);_0x2b11d0['attributes']=_[_0x0a15('0x31')](_0x328527[_0x0a15('0x2e')],qs[_0x0a15('0x32')](_0x281d55[_0x0a15('0x2f')][_0x0a15('0x32')]));_0x2b11d0['attributes']=_0x2b11d0[_0x0a15('0x33')][_0x0a15('0x34')]?_0x2b11d0[_0x0a15('0x33')]:_0x328527[_0x0a15('0x2e')];if(!_0x281d55[_0x0a15('0x2f')]['hasOwnProperty'](_0x0a15('0x35'))){_0x2b11d0[_0x0a15('0x1d')]=qs[_0x0a15('0x1d')](_0x281d55[_0x0a15('0x2f')]['limit']);_0x2b11d0[_0x0a15('0x1f')]=qs[_0x0a15('0x1f')](_0x281d55[_0x0a15('0x2f')][_0x0a15('0x1f')]);}_0x2b11d0[_0x0a15('0x36')]=qs[_0x0a15('0x37')](_0x281d55['query'][_0x0a15('0x37')]);_0x2b11d0[_0x0a15('0x38')]=qs[_0x0a15('0x30')](_[_0x0a15('0x39')](_0x281d55['query'],_0x328527[_0x0a15('0x30')]),_0x5c24bd);if(_0x281d55[_0x0a15('0x2f')][_0x0a15('0x3a')]){_0x2b11d0[_0x0a15('0x38')]=_['merge'](_0x2b11d0[_0x0a15('0x38')],{'$or':_['map'](_0x5c24bd,function(_0x248d33){if(_0x248d33[_0x0a15('0x2d')]!==_0x0a15('0x3b')){var _0x522b35={};_0x522b35[_0x248d33[_0x0a15('0x29')]]={'$like':'%'+_0x281d55[_0x0a15('0x2f')][_0x0a15('0x3a')]+'%'};return _0x522b35;}})});}_0x2b11d0=_[_0x0a15('0x3c')]({},_0x2b11d0,_0x281d55[_0x0a15('0x3d')]);var _0x32e824={'where':_0x2b11d0[_0x0a15('0x38')]};return db[_0x0a15('0x3e')]['count'](_0x32e824)[_0x0a15('0x27')](function(_0x19f019){_0x5d1e89[_0x0a15('0x1e')]=_0x19f019;if(_0x281d55[_0x0a15('0x2f')][_0x0a15('0x3f')]){_0x2b11d0['include']=[{'all':!![]}];}return db['Schedule']['findAll'](_0x2b11d0);})[_0x0a15('0x27')](function(_0x42ebea){_0x5d1e89['rows']=_0x42ebea;return _0x5d1e89;})[_0x0a15('0x27')](respondWithFilteredResult(_0x1fe634,_0x2b11d0))[_0x0a15('0x40')](handleError(_0x1fe634,null));};exports[_0x0a15('0x41')]=function(_0x4a667d,_0x3ee956){var _0xa0f658={'raw':![],'where':{'id':_0x4a667d[_0x0a15('0x42')]['id']}},_0x5c9b4b={};_0x5c9b4b[_0x0a15('0x2e')]=_[_0x0a15('0x43')](db[_0x0a15('0x3e')][_0x0a15('0x2c')]);_0x5c9b4b[_0x0a15('0x2f')]=_[_0x0a15('0x43')](_0x4a667d[_0x0a15('0x2f')]);_0x5c9b4b[_0x0a15('0x30')]=_[_0x0a15('0x31')](_0x5c9b4b[_0x0a15('0x2e')],_0x5c9b4b['query']);_0xa0f658[_0x0a15('0x33')]=_['intersection'](_0x5c9b4b[_0x0a15('0x2e')],qs[_0x0a15('0x32')](_0x4a667d[_0x0a15('0x2f')]['fields']));_0xa0f658['attributes']=_0xa0f658[_0x0a15('0x33')]['length']?_0xa0f658['attributes']:_0x5c9b4b[_0x0a15('0x2e')];if(_0x4a667d[_0x0a15('0x2f')][_0x0a15('0x3f')]){_0xa0f658[_0x0a15('0x44')]=[{'all':!![]}];}_0xa0f658=_[_0x0a15('0x3c')]({},_0xa0f658,_0x4a667d[_0x0a15('0x3d')]);return db[_0x0a15('0x3e')][_0x0a15('0x45')](_0xa0f658)[_0x0a15('0x27')](handleEntityNotFound(_0x3ee956,null))[_0x0a15('0x27')](respondWithResult(_0x3ee956,null))['catch'](handleError(_0x3ee956,null));};exports[_0x0a15('0x46')]=function(_0x3ebc80,_0x248bea){return db[_0x0a15('0x3e')][_0x0a15('0x46')](_0x3ebc80['body'],{})[_0x0a15('0x27')](function(_0x10683e){var _0x56525c=_0x3ebc80['user'][_0x0a15('0x47')]({'plain':!![]});if(!_0x56525c)throw new Error(_0x0a15('0x48'));if(_0x56525c['role']===_0x0a15('0x49')){var _0x447c0d=_0x10683e['get']({'plain':!![]});var _0xd827e6=_0x0a15('0x4a');return db[_0x0a15('0x4b')][_0x0a15('0x45')]({'where':{'name':_0xd827e6,'userProfileId':_0x56525c[_0x0a15('0x4c')]},'raw':!![]})[_0x0a15('0x27')](function(_0x141329){if(_0x141329&&_0x141329[_0x0a15('0x4d')]===0x0){return db[_0x0a15('0x26')][_0x0a15('0x46')]({'name':_0x447c0d[_0x0a15('0x29')],'resourceId':_0x447c0d['id'],'type':_0x141329[_0x0a15('0x29')],'sectionId':_0x141329['id']},{})[_0x0a15('0x27')](function(){return _0x10683e;});}else{return _0x10683e;}})[_0x0a15('0x40')](function(_0x2f5bbc){logger[_0x0a15('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2f5bbc);throw _0x2f5bbc;});}return _0x10683e;})[_0x0a15('0x27')](respondWithResult(_0x248bea,0xc9))[_0x0a15('0x40')](handleError(_0x248bea,null));};exports[_0x0a15('0x24')]=function(_0x96e9f9,_0x177dfa){if(_0x96e9f9[_0x0a15('0x4f')]['id']){delete _0x96e9f9[_0x0a15('0x4f')]['id'];}return db[_0x0a15('0x3e')][_0x0a15('0x45')]({'where':{'id':_0x96e9f9[_0x0a15('0x42')]['id']}})[_0x0a15('0x27')](handleEntityNotFound(_0x177dfa,null))[_0x0a15('0x27')](saveUpdates(_0x96e9f9[_0x0a15('0x4f')],null))[_0x0a15('0x27')](respondWithResult(_0x177dfa,null))[_0x0a15('0x40')](handleError(_0x177dfa,null));};exports['destroy']=function(_0x2e30ef,_0x3a13ad){return db[_0x0a15('0x3e')][_0x0a15('0x45')]({'where':{'id':_0x2e30ef[_0x0a15('0x42')]['id']}})[_0x0a15('0x27')](handleEntityNotFound(_0x3a13ad,null))[_0x0a15('0x27')](removeEntity(_0x3a13ad,null))[_0x0a15('0x40')](handleError(_0x3a13ad,null));};exports[_0x0a15('0x50')]=function(_0x57d262,_0x361d13,_0x2be6d9){var _0x497afd=require('../../config/schedule');return db[_0x0a15('0x3e')][_0x0a15('0x45')]({'where':{'id':_0x57d262['params']['id']},'raw':!![]})[_0x0a15('0x27')](handleEntityNotFound(_0x361d13,null))['then'](function(){_0x497afd[_0x0a15('0x50')](_0x57d262['params']['id']);})[_0x0a15('0x27')](respondWithStatusCode(_0x361d13,null))[_0x0a15('0x40')](handleError(_0x361d13,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 3d55226..0974a97 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 _0xc15e=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./schedule.attributes','define','Schedule','tools_schedules','util'];(function(_0x22093a,_0xa7acf1){var _0x2f4989=function(_0x5bf12b){while(--_0x5bf12b){_0x22093a['push'](_0x22093a['shift']());}};_0x2f4989(++_0xa7acf1);}(_0xc15e,0x1d3));var _0xec15=function(_0x1baa30,_0x6639f0){_0x1baa30=_0x1baa30-0x0;var _0x381894=_0xc15e[_0x1baa30];return _0x381894;};'use strict';var _=require('lodash');var util=require(_0xec15('0x0'));var logger=require(_0xec15('0x1'))(_0xec15('0x2'));var moment=require(_0xec15('0x3'));var BPromise=require(_0xec15('0x4'));var rp=require(_0xec15('0x5'));var fs=require('fs');var path=require(_0xec15('0x6'));var rimraf=require(_0xec15('0x7'));var config=require(_0xec15('0x8'));var attributes=require(_0xec15('0x9'));module['exports']=function(_0x2b0b5a,_0x35d3a4){return _0x2b0b5a[_0xec15('0xa')](_0xec15('0xb'),attributes,{'tableName':_0xec15('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6120=['rimraf','../../config/environment','./schedule.attributes','exports','define','Schedule','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x6120,0x10e));var _0x0612=function(_0x2b8760,_0x37ae41){_0x2b8760=_0x2b8760-0x0;var _0x41bd30=_0x6120[_0x2b8760];return _0x41bd30;};'use strict';var _=require(_0x0612('0x0'));var util=require(_0x0612('0x1'));var logger=require(_0x0612('0x2'))(_0x0612('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0612('0x4'));var fs=require('fs');var path=require(_0x0612('0x5'));var rimraf=require(_0x0612('0x6'));var config=require(_0x0612('0x7'));var attributes=require(_0x0612('0x8'));module[_0x0612('0x9')]=function(_0x3abb0b,_0x1d1328){return _0x3abb0b[_0x0612('0xa')](_0x0612('0xb'),attributes,{'tableName':'tools_schedules','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 2cf3088..90ac966 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 _0x0ecb=['stringify','error','Schedule,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x0ecb,0x1af));var _0xb0ec=function(_0xf104db,_0x3bb494){_0xf104db=_0xf104db-0x0;var _0xab56c5=_0x0ecb[_0xf104db];return _0xab56c5;};'use strict';var _=require(_0xb0ec('0x0'));var util=require(_0xb0ec('0x1'));var moment=require(_0xb0ec('0x2'));var BPromise=require(_0xb0ec('0x3'));var rs=require(_0xb0ec('0x4'));var fs=require('fs');var Redis=require(_0xb0ec('0x5'));var db=require(_0xb0ec('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xb0ec('0x7'))(_0xb0ec('0x8'));var config=require(_0xb0ec('0x9'));var jayson=require(_0xb0ec('0xa'));var client=jayson[_0xb0ec('0xb')][_0xb0ec('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x48756d,_0x5871b9,_0x4e246f){return new BPromise(function(_0x4e890f,_0x2b3487){return client[_0xb0ec('0xd')](_0x48756d,_0x4e246f)[_0xb0ec('0xe')](function(_0x1c0cb8){logger[_0xb0ec('0xf')]('Schedule,\x20%s,\x20%s',_0x5871b9,_0xb0ec('0x10'));logger[_0xb0ec('0x11')](_0xb0ec('0x12'),_0x5871b9,'request\x20sent',JSON[_0xb0ec('0x13')](_0x1c0cb8));if(_0x1c0cb8[_0xb0ec('0x14')]){if(_0x1c0cb8[_0xb0ec('0x14')]['code']===0x1f4){logger[_0xb0ec('0x14')](_0xb0ec('0x15'),_0x5871b9,_0x1c0cb8['error'][_0xb0ec('0x16')]);return _0x2b3487(_0x1c0cb8[_0xb0ec('0x14')][_0xb0ec('0x16')]);}logger[_0xb0ec('0x14')](_0xb0ec('0x15'),_0x5871b9,_0x1c0cb8['error']['message']);return _0x4e890f(_0x1c0cb8[_0xb0ec('0x14')][_0xb0ec('0x16')]);}else{logger['info'](_0xb0ec('0x15'),_0x5871b9,_0xb0ec('0x10'));_0x4e890f(_0x1c0cb8[_0xb0ec('0x17')]['message']);}})[_0xb0ec('0x18')](function(_0x326a34){logger[_0xb0ec('0x14')](_0xb0ec('0x15'),_0x5871b9,_0x326a34);_0x2b3487(_0x326a34);});});} \ No newline at end of file +var _0xe678=['../../config/environment','jayson/promise','http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','bluebird','ioredis','../../config/logger'];(function(_0x5a4257,_0x3ae34d){var _0x3746a7=function(_0x31fff0){while(--_0x31fff0){_0x5a4257['push'](_0x5a4257['shift']());}};_0x3746a7(++_0x3ae34d);}(_0xe678,0x12f));var _0x8e67=function(_0x1bea8c,_0x2bc951){_0x1bea8c=_0x1bea8c-0x0;var _0x1d1dd6=_0xe678[_0x1bea8c];return _0x1d1dd6;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x8e67('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8e67('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8e67('0x2'))('rpc');var config=require(_0x8e67('0x3'));var jayson=require(_0x8e67('0x4'));var client=jayson['client'][_0x8e67('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x5c677c,_0x360687,_0x5d0b5e){return new BPromise(function(_0x192037,_0x2993cb){return client[_0x8e67('0x6')](_0x5c677c,_0x5d0b5e)[_0x8e67('0x7')](function(_0x5e727f){logger[_0x8e67('0x8')](_0x8e67('0x9'),_0x360687,_0x8e67('0xa'));logger[_0x8e67('0xb')](_0x8e67('0xc'),_0x360687,_0x8e67('0xa'),JSON[_0x8e67('0xd')](_0x5e727f));if(_0x5e727f[_0x8e67('0xe')]){if(_0x5e727f['error'][_0x8e67('0xf')]===0x1f4){logger[_0x8e67('0xe')]('Schedule,\x20%s,\x20%s',_0x360687,_0x5e727f[_0x8e67('0xe')][_0x8e67('0x10')]);return _0x2993cb(_0x5e727f[_0x8e67('0xe')][_0x8e67('0x10')]);}logger['error'](_0x8e67('0x9'),_0x360687,_0x5e727f[_0x8e67('0xe')][_0x8e67('0x10')]);return _0x192037(_0x5e727f[_0x8e67('0xe')][_0x8e67('0x10')]);}else{logger[_0x8e67('0x8')](_0x8e67('0x9'),_0x360687,_0x8e67('0xa'));_0x192037(_0x5e727f['result'][_0x8e67('0x10')]);}})[_0x8e67('0x11')](function(_0x4cd911){logger[_0x8e67('0xe')](_0x8e67('0x9'),_0x360687,_0x4cd911);_0x2993cb(_0x4cd911);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 6cec0a5..6b05124 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 _0xf726=['get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5d9867,_0x5e9030){var _0x7d2118=function(_0x2e5149){while(--_0x2e5149){_0x5d9867['push'](_0x5d9867['shift']());}};_0x7d2118(++_0x5e9030);}(_0xf726,0x18f));var _0x6f72=function(_0x4db561,_0x521d0d){_0x4db561=_0x4db561-0x0;var _0x299980=_0xf726[_0x4db561];return _0x299980;};'use strict';var multer=require(_0x6f72('0x0'));var util=require(_0x6f72('0x1'));var path=require(_0x6f72('0x2'));var timeout=require(_0x6f72('0x3'));var express=require(_0x6f72('0x4'));var router=express[_0x6f72('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x6f72('0x6'));var interaction=require(_0x6f72('0x7'));var config=require(_0x6f72('0x8'));var controller=require('./screenRecording.controller');router[_0x6f72('0x9')]('/',auth[_0x6f72('0xa')](),controller[_0x6f72('0xb')]);router[_0x6f72('0x9')](_0x6f72('0xc'),auth[_0x6f72('0xa')](),controller[_0x6f72('0xd')]);router[_0x6f72('0x9')](_0x6f72('0xe'),auth[_0x6f72('0xa')](),controller[_0x6f72('0xf')]);router[_0x6f72('0x9')](_0x6f72('0x10'),auth[_0x6f72('0xa')](),controller[_0x6f72('0x11')]);router[_0x6f72('0x12')]('/',auth[_0x6f72('0xa')](),controller[_0x6f72('0x13')]);router[_0x6f72('0x14')](_0x6f72('0xe'),auth[_0x6f72('0xa')](),controller[_0x6f72('0x15')]);router[_0x6f72('0x16')](_0x6f72('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x6f72('0x17')]=router; \ No newline at end of file +var _0x6bcd=['delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./screenRecording.controller','isAuthenticated','index','get','/describe','/:id','show','/:id/download','download','post','put','update'];(function(_0x335137,_0x536888){var _0x188ada=function(_0x963946){while(--_0x963946){_0x335137['push'](_0x335137['shift']());}};_0x188ada(++_0x536888);}(_0x6bcd,0x14d));var _0xd6bc=function(_0x45e0fc,_0x5eaa25){_0x45e0fc=_0x45e0fc-0x0;var _0x450d09=_0x6bcd[_0x45e0fc];return _0x450d09;};'use strict';var multer=require(_0xd6bc('0x0'));var util=require(_0xd6bc('0x1'));var path=require(_0xd6bc('0x2'));var timeout=require(_0xd6bc('0x3'));var express=require(_0xd6bc('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd6bc('0x5'));var interaction=require(_0xd6bc('0x6'));var config=require('../../config/environment');var controller=require(_0xd6bc('0x7'));router['get']('/',auth[_0xd6bc('0x8')](),controller[_0xd6bc('0x9')]);router[_0xd6bc('0xa')](_0xd6bc('0xb'),auth[_0xd6bc('0x8')](),controller['describe']);router[_0xd6bc('0xa')](_0xd6bc('0xc'),auth[_0xd6bc('0x8')](),controller[_0xd6bc('0xd')]);router[_0xd6bc('0xa')](_0xd6bc('0xe'),auth[_0xd6bc('0x8')](),controller[_0xd6bc('0xf')]);router[_0xd6bc('0x10')]('/',auth[_0xd6bc('0x8')](),controller['create']);router[_0xd6bc('0x11')](_0xd6bc('0xc'),auth['isAuthenticated'](),controller[_0xd6bc('0x12')]);router[_0xd6bc('0x13')](_0xd6bc('0xc'),auth[_0xd6bc('0x8')](),controller[_0xd6bc('0x14')]);module[_0xd6bc('0x15')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 2822d41..abb51f0 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 _0x20de=['format','MM-DD-YYYY\x20HH:mm','sequelize','path','../../config/environment','exports','VIRTUAL','getDataValue','value','extname','STRING','INTEGER','setDataValue','startedAt','closedAt','duration','DATE','toString'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x20de,0x134));var _0xe20d=function(_0x2283dc,_0x2fcfc5){_0x2283dc=_0x2283dc-0x0;var _0x16db90=_0x20de[_0x2283dc];return _0x16db90;};'use strict';var Sequelize=require(_0xe20d('0x0'));var moment=require('moment');var path=require(_0xe20d('0x1'));var config=require(_0xe20d('0x2'));module[_0xe20d('0x3')]={'format':{'type':Sequelize[_0xe20d('0x4')],'get':function(){return this[_0xe20d('0x5')](_0xe20d('0x6'))?path[_0xe20d('0x7')](this[_0xe20d('0x5')](_0xe20d('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0xe20d('0x8')]},'channel':{'type':Sequelize[_0xe20d('0x8')]},'value':{'type':Sequelize['STRING'],'set':function(_0x374faa){var _0x5a5ac2=_0x374faa['replace'](/\\/g,'/');this['setDataValue'](_0xe20d('0x6'),_0x5a5ac2);}},'rating':{'type':Sequelize[_0xe20d('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xe20d('0x9')],'set':function(_0x50f487){this[_0xe20d('0xa')](_0xe20d('0xb'),moment()['subtract'](_0x50f487,'ms'));this[_0xe20d('0xa')](_0xe20d('0xc'),moment());this['setDataValue'](_0xe20d('0xd'),_0x50f487);}},'startedAt':{'type':Sequelize[_0xe20d('0xe')],'get':function(){return moment(this[_0xe20d('0x5')](_0xe20d('0xb')))['format']('MM-DD-YYYY\x20HH:mm')[_0xe20d('0xf')]();}},'closedAt':{'type':Sequelize[_0xe20d('0xe')],'get':function(){return moment(this[_0xe20d('0x5')](_0xe20d('0xc')))[_0xe20d('0x10')](_0xe20d('0x11'))[_0xe20d('0xf')]();}},'createdAt':{'type':Sequelize[_0xe20d('0xe')],'get':function(){return moment(this[_0xe20d('0x5')]('createdAt'))[_0xe20d('0x10')]('MM-DD-YYYY\x20HH:mm')[_0xe20d('0xf')]();}},'updatedAt':{'type':Sequelize[_0xe20d('0xe')],'get':function(){return moment(this[_0xe20d('0x5')]('updatedAt'))[_0xe20d('0x10')]('MM-DD-YYYY\x20HH:mm')[_0xe20d('0xf')]();}}}; \ No newline at end of file +var _0x0c6b=['closedAt','duration','format','MM-DD-YYYY\x20HH:mm','toString','DATE','createdAt','sequelize','path','../../config/environment','exports','VIRTUAL','getDataValue','value','extname','STRING','setDataValue','startedAt','subtract'];(function(_0x22407e,_0x2a8907){var _0x846747=function(_0x120acd){while(--_0x120acd){_0x22407e['push'](_0x22407e['shift']());}};_0x846747(++_0x2a8907);}(_0x0c6b,0x1bc));var _0xb0c6=function(_0x3ab45a,_0x1f147a){_0x3ab45a=_0x3ab45a-0x0;var _0x46b76b=_0x0c6b[_0x3ab45a];return _0x46b76b;};'use strict';var Sequelize=require(_0xb0c6('0x0'));var moment=require('moment');var path=require(_0xb0c6('0x1'));var config=require(_0xb0c6('0x2'));module[_0xb0c6('0x3')]={'format':{'type':Sequelize[_0xb0c6('0x4')],'get':function(){return this[_0xb0c6('0x5')](_0xb0c6('0x6'))?path[_0xb0c6('0x7')](this[_0xb0c6('0x5')](_0xb0c6('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0xb0c6('0x8')]},'channel':{'type':Sequelize[_0xb0c6('0x8')]},'value':{'type':Sequelize['STRING'],'set':function(_0x590ef9){var _0x5ec174=_0x590ef9['replace'](/\\/g,'/');this[_0xb0c6('0x9')](_0xb0c6('0x6'),_0x5ec174);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x2beb18){this[_0xb0c6('0x9')](_0xb0c6('0xa'),moment()[_0xb0c6('0xb')](_0x2beb18,'ms'));this[_0xb0c6('0x9')](_0xb0c6('0xc'),moment());this[_0xb0c6('0x9')](_0xb0c6('0xd'),_0x2beb18);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xb0c6('0x5')]('startedAt'))[_0xb0c6('0xe')](_0xb0c6('0xf'))[_0xb0c6('0x10')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xb0c6('0x5')](_0xb0c6('0xc')))[_0xb0c6('0xe')](_0xb0c6('0xf'))[_0xb0c6('0x10')]();}},'createdAt':{'type':Sequelize[_0xb0c6('0x11')],'get':function(){return moment(this[_0xb0c6('0x5')](_0xb0c6('0x12')))['format'](_0xb0c6('0xf'))[_0xb0c6('0x10')]();}},'updatedAt':{'type':Sequelize[_0xb0c6('0x11')],'get':function(){return moment(this[_0xb0c6('0x5')]('updatedAt'))[_0xb0c6('0xe')](_0xb0c6('0xf'))[_0xb0c6('0x10')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index ed9c693..963811c 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 _0x5075=['send','Not\x20found','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','info','File:\x20\x22','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','save','update','then','destroy','end','error','name','index','map','ScreenRecording','rawAttributes','fieldName','model','differenceBy','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','createdAt','closedAt','value','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ScreenRecording\x20not\x20found','filename','extname','unlink','message'];(function(_0x31ed02,_0x4871a4){var _0x3417ed=function(_0x58c634){while(--_0x58c634){_0x31ed02['push'](_0x31ed02['shift']());}};_0x3417ed(++_0x4871a4);}(_0x5075,0x73));var _0x5507=function(_0x5adb18,_0x222326){_0x5adb18=_0x5adb18-0x0;var _0x420c98=_0x5075[_0x5adb18];return _0x420c98;};'use strict';var emlformat=require(_0x5507('0x0'));var rimraf=require(_0x5507('0x1'));var zipdir=require(_0x5507('0x2'));var jsonpatch=require(_0x5507('0x3'));var rp=require(_0x5507('0x4'));var moment=require(_0x5507('0x5'));var BPromise=require(_0x5507('0x6'));var Mustache=require('mustache');var util=require(_0x5507('0x7'));var path=require(_0x5507('0x8'));var sox=require(_0x5507('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5507('0xa'));var _=require(_0x5507('0xb'));var squel=require('squel');var crypto=require(_0x5507('0xc'));var jsforce=require(_0x5507('0xd'));var deskjs=require(_0x5507('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5507('0xf'));var Redis=require(_0x5507('0x10'));var authService=require(_0x5507('0x11'));var qs=require(_0x5507('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5507('0x13'));var logger=require(_0x5507('0x14'))('api');var utils=require(_0x5507('0x15'));var config=require(_0x5507('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x5507('0x17'))['db'];function respondWithStatusCode(_0x2a2ea0,_0x32c872){_0x32c872=_0x32c872||0xcc;return function(_0x267f27){if(_0x267f27){return _0x2a2ea0[_0x5507('0x18')](_0x32c872);}return _0x2a2ea0[_0x5507('0x19')](_0x32c872)['end']();};}function respondWithResult(_0x9cc3f9,_0x2b7c43){_0x2b7c43=_0x2b7c43||0xc8;return function(_0xc828e5){if(_0xc828e5){return _0x9cc3f9[_0x5507('0x19')](_0x2b7c43)['json'](_0xc828e5);}};}function respondWithFilteredResult(_0x49e400,_0x10d7b9){return function(_0x2dfd06){if(_0x2dfd06){var _0x1ab167=typeof _0x10d7b9[_0x5507('0x1a')]===_0x5507('0x1b')&&typeof _0x10d7b9[_0x5507('0x1c')]===_0x5507('0x1b');var _0x3d1619=_0x2dfd06[_0x5507('0x1d')];var _0x233b6a=_0x1ab167?0x0:_0x10d7b9[_0x5507('0x1a')];var _0x3822dd=_0x1ab167?_0x2dfd06['count']:_0x10d7b9[_0x5507('0x1a')]+_0x10d7b9[_0x5507('0x1c')];var _0x4054c6;if(_0x3822dd>=_0x3d1619){_0x3822dd=_0x3d1619;_0x4054c6=0xc8;}else{_0x4054c6=0xce;}_0x49e400[_0x5507('0x19')](_0x4054c6);return _0x49e400['set'](_0x5507('0x1e'),_0x233b6a+'-'+_0x3822dd+'/'+_0x3d1619)[_0x5507('0x1f')](_0x2dfd06);}return null;};}function patchUpdates(_0x1a54b0){return function(_0x3ca1f7){try{jsonpatch[_0x5507('0x20')](_0x3ca1f7,_0x1a54b0,!![]);}catch(_0x1be8b1){return BPromise['reject'](_0x1be8b1);}return _0x3ca1f7[_0x5507('0x21')]();};}function saveUpdates(_0x105535,_0x1f6325){return function(_0xa3e2cf){if(_0xa3e2cf){return _0xa3e2cf[_0x5507('0x22')](_0x105535)[_0x5507('0x23')](function(_0x1fcc8d){return _0x1fcc8d;});}return null;};}function removeEntity(_0x10f149,_0x398911){return function(_0xa47641){if(_0xa47641){return _0xa47641[_0x5507('0x24')]()[_0x5507('0x23')](function(){_0x10f149[_0x5507('0x19')](0xcc)[_0x5507('0x25')]();});}};}function handleEntityNotFound(_0x1a2203,_0x4915ed){return function(_0x4e8906){if(!_0x4e8906){_0x1a2203['sendStatus'](0x194);}return _0x4e8906;};}function handleError(_0x26335e,_0x4ea271){_0x4ea271=_0x4ea271||0x1f4;return function(_0xa66a01){logger[_0x5507('0x26')](_0xa66a01['stack']);if(_0xa66a01['name']){delete _0xa66a01[_0x5507('0x27')];}_0x26335e[_0x5507('0x19')](_0x4ea271)['send'](_0xa66a01);};}exports[_0x5507('0x28')]=function(_0x24574b,_0x85d383){var _0x38f4d9={},_0x1e5ce6={},_0x14fdea={'count':0x0,'rows':[]};var _0x55e889=_[_0x5507('0x29')](db[_0x5507('0x2a')][_0x5507('0x2b')],function(_0x38f0f5){return{'name':_0x38f0f5[_0x5507('0x2c')],'type':_0x38f0f5['type']['key']};});_0x1e5ce6[_0x5507('0x2d')]=_[_0x5507('0x2e')](_[_0x5507('0x29')](_0x55e889,_0x5507('0x27')),['format']);_0x1e5ce6[_0x5507('0x2f')]=_[_0x5507('0x30')](_0x24574b[_0x5507('0x2f')]);_0x1e5ce6[_0x5507('0x31')]=_[_0x5507('0x32')](_0x1e5ce6[_0x5507('0x2d')],_0x1e5ce6[_0x5507('0x2f')]);_0x38f4d9[_0x5507('0x33')]=_['intersection'](_0x1e5ce6[_0x5507('0x2d')],qs[_0x5507('0x34')](_0x24574b[_0x5507('0x2f')]['fields']));_0x38f4d9['attributes']=_0x38f4d9[_0x5507('0x33')][_0x5507('0x35')]?_0x38f4d9[_0x5507('0x33')]:_0x1e5ce6[_0x5507('0x2d')];if(!_0x24574b[_0x5507('0x2f')]['hasOwnProperty']('nolimit')){_0x38f4d9[_0x5507('0x1c')]=qs[_0x5507('0x1c')](_0x24574b[_0x5507('0x2f')][_0x5507('0x1c')]);_0x38f4d9['offset']=qs['offset'](_0x24574b[_0x5507('0x2f')]['offset']);}_0x38f4d9[_0x5507('0x36')]=qs[_0x5507('0x37')](_0x24574b[_0x5507('0x2f')][_0x5507('0x37')]);_0x38f4d9[_0x5507('0x38')]=qs[_0x5507('0x31')](_[_0x5507('0x39')](_0x24574b[_0x5507('0x2f')],_0x1e5ce6[_0x5507('0x31')]),_0x55e889);if(_0x24574b[_0x5507('0x2f')]['filter']){_0x38f4d9['where']=_['merge'](_0x38f4d9['where'],{'$or':_[_0x5507('0x29')](_0x55e889,function(_0x2cf512){if(_0x2cf512[_0x5507('0x3a')]!==_0x5507('0x3b')){var _0x2b32a5={};_0x2b32a5[_0x2cf512[_0x5507('0x27')]]={'$like':'%'+_0x24574b[_0x5507('0x2f')][_0x5507('0x3c')]+'%'};return _0x2b32a5;}})});}_0x38f4d9=_[_0x5507('0x3d')]({},_0x38f4d9,_0x24574b[_0x5507('0x3e')]);var _0x3ec0ed={'where':_0x38f4d9[_0x5507('0x38')]};return db[_0x5507('0x2a')][_0x5507('0x1d')](_0x3ec0ed)['then'](function(_0x53b3f3){_0x14fdea['count']=_0x53b3f3;if(_0x24574b[_0x5507('0x2f')][_0x5507('0x3f')]){_0x38f4d9[_0x5507('0x40')]=[{'all':!![]}];}return db[_0x5507('0x2a')][_0x5507('0x41')](_0x38f4d9);})[_0x5507('0x23')](function(_0x340c4c){_0x14fdea[_0x5507('0x42')]=_0x340c4c;return _0x14fdea;})[_0x5507('0x23')](respondWithFilteredResult(_0x85d383,_0x38f4d9))[_0x5507('0x43')](handleError(_0x85d383,null));};exports[_0x5507('0x44')]=function(_0x192a00,_0x24d7b5){var _0x25496b={'raw':![],'where':{'id':_0x192a00[_0x5507('0x45')]['id']}},_0x1b3006={};_0x1b3006[_0x5507('0x2d')]=_[_0x5507('0x30')](db[_0x5507('0x2a')]['rawAttributes']);_0x1b3006[_0x5507('0x2f')]=_[_0x5507('0x30')](_0x192a00['query']);_0x1b3006['filters']=_[_0x5507('0x32')](_0x1b3006[_0x5507('0x2d')],_0x1b3006[_0x5507('0x2f')]);_0x25496b[_0x5507('0x33')]=_[_0x5507('0x32')](_0x1b3006['model'],qs[_0x5507('0x34')](_0x192a00[_0x5507('0x2f')][_0x5507('0x34')]));_0x25496b['attributes']=_0x25496b[_0x5507('0x33')][_0x5507('0x35')]?_0x25496b[_0x5507('0x33')]:_0x1b3006[_0x5507('0x2d')];if(_0x192a00[_0x5507('0x2f')]['includeAll']){_0x25496b[_0x5507('0x40')]=[{'all':!![]}];}_0x25496b=_['merge']({},_0x25496b,_0x192a00[_0x5507('0x3e')]);return db[_0x5507('0x2a')][_0x5507('0x46')](_0x25496b)[_0x5507('0x23')](handleEntityNotFound(_0x24d7b5,null))[_0x5507('0x23')](respondWithResult(_0x24d7b5,null))[_0x5507('0x43')](handleError(_0x24d7b5,null));};exports[_0x5507('0x47')]=function(_0x3452e4,_0x549cf0){return db[_0x5507('0x2a')][_0x5507('0x47')](_0x3452e4['body'],{})['then'](respondWithResult(_0x549cf0,0xc9))['catch'](handleError(_0x549cf0,null));};exports[_0x5507('0x22')]=function(_0x5961fd,_0x403d03){if(_0x5961fd['body']['id']){delete _0x5961fd[_0x5507('0x48')]['id'];}delete _0x5961fd['body']['duration'];delete _0x5961fd[_0x5507('0x48')][_0x5507('0x49')];delete _0x5961fd[_0x5507('0x48')][_0x5507('0x4a')];delete _0x5961fd[_0x5507('0x48')][_0x5507('0x4b')];return db['ScreenRecording'][_0x5507('0x46')]({'where':{'id':_0x5961fd[_0x5507('0x45')]['id']}})[_0x5507('0x23')](handleEntityNotFound(_0x403d03,null))['then'](saveUpdates(_0x5961fd[_0x5507('0x48')],null))[_0x5507('0x23')](respondWithResult(_0x403d03,null))[_0x5507('0x43')](handleError(_0x403d03,null));};exports[_0x5507('0x4c')]=function(_0x300c9f,_0x3af70f){return db[_0x5507('0x2a')][_0x5507('0x4c')]()[_0x5507('0x23')](respondWithResult(_0x3af70f,null))[_0x5507('0x43')](handleError(_0x3af70f,null));};exports[_0x5507('0x4d')]=function(_0x49a2f8,_0x570928,_0x1992fa){var _0x5d7753=require(_0x5507('0x4e'));var _0x1b34c8=![];var _0xce851d={};if(_0x49a2f8[_0x5507('0x2f')][_0x5507('0x3a')]&&_0x49a2f8[_0x5507('0x2f')][_0x5507('0x3a')]===_0x5507('0x4f')){_0xce851d[_0x5507('0x4f')]=_0x49a2f8[_0x5507('0x45')]['id'];}else{_0xce851d['id']=_0x49a2f8[_0x5507('0x45')]['id'];}return db[_0x5507('0x2a')][_0x5507('0x46')]({'where':_0xce851d,'attributes':['id',_0x5507('0x4b')],'raw':!![]})['then'](handleEntityNotFound(_0x570928,null))[_0x5507('0x23')](function(_0x56e0cd){if(_0x56e0cd){var _0x5af5f5=path[_0x5507('0x50')](config[_0x5507('0x51')],_0x5507('0x52'),_0x56e0cd[_0x5507('0x4b')]);var _0x52b9f2=util[_0x5507('0x53')](_0x5507('0x54'),_0x5af5f5);if(fs[_0x5507('0x55')](_0x52b9f2)){_0x1b34c8=!![];return _0x5d7753[_0x5507('0x56')](_0x52b9f2,_0x5af5f5,config[_0x5507('0x57')][_0x5507('0x58')])['then'](function(){return _0x56e0cd;});}return _0x56e0cd;}})[_0x5507('0x23')](function(_0x46e589){if(_0x46e589){var _0x3a2f9f=path['join'](config['root'],_0x5507('0x52'),_0x46e589['value']);if(!fs[_0x5507('0x55')](_0x3a2f9f)){throw new db[(_0x5507('0x59'))]['ValidationError'](_0x5507('0x5a'));}if(_0x46e589[_0x5507('0x5b')]){return _0x570928[_0x5507('0x4d')](_0x3a2f9f,_0x46e589[_0x5507('0x5b')]+path[_0x5507('0x5c')](_0x3a2f9f),function(){if(_0x1b34c8){fs[_0x5507('0x5d')](_0x3a2f9f);}});}else{return _0x570928[_0x5507('0x4d')](_0x3a2f9f,function(_0x2928f2){if(_0x1b34c8){fs[_0x5507('0x5d')](_0x3a2f9f);}});}}})[_0x5507('0x43')](function(_0x1453f1){if(_0x1453f1[_0x5507('0x5e')]==='ScreenRecording\x20not\x20found'){_0x570928[_0x5507('0x19')](0x194)[_0x5507('0x5f')](_0x5507('0x60'));}else{return handleError(_0x570928,null);}});};exports[_0x5507('0x24')]=function(_0x3c4422,_0x5183ae){return db[_0x5507('0x2a')]['find']({'where':{'id':_0x3c4422[_0x5507('0x45')]['id']}})[_0x5507('0x23')](function(_0x241733){if(_['isNil'](_0x241733)){throw new ReferenceError(_0x5507('0x61'));}return _0x241733;})[_0x5507('0x23')](function(_0x2a9672){var _0x56632b=path[_0x5507('0x50')](config['root'],_0x5507('0x52'),_0x2a9672['value']);logger['info'](_0x5507('0x62'),_0x56632b);if(!_[_0x5507('0x63')](_0x2a9672[_0x5507('0x4b')])&&fs[_0x5507('0x55')](_0x56632b)){logger[_0x5507('0x64')](_0x5507('0x65')+_0x56632b+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x56632b);}_0x56632b=_0x56632b+_0x5507('0x66');if(!_[_0x5507('0x63')](_0x2a9672[_0x5507('0x4b')])&&fs[_0x5507('0x55')](_0x56632b)){logger['info'](_0x5507('0x65')+_0x56632b+_0x5507('0x67'));fs[_0x5507('0x68')](_0x56632b);}return _0x2a9672;})[_0x5507('0x23')](function(_0x296cf5){if(!_0x296cf5)throw new InternalError();return _0x296cf5[_0x5507('0x24')]();})[_0x5507('0x23')](function(){_0x5183ae['status'](0xcc)[_0x5507('0x25')]();})[_0x5507('0x43')](handleError(_0x5183ae,null));}; \ No newline at end of file +var _0x33c5=['download','uniqueid','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','ScreenRecording\x20not\x20found','filename','unlink','message','Not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','rimraf','zip-dir','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','ScreenRecording','type','key','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','length','order','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','show','params','include','find','catch','create','body','duration','createdAt','closedAt','value','describe'];(function(_0x13bdf2,_0x220793){var _0x5583df=function(_0x2ee7a1){while(--_0x2ee7a1){_0x13bdf2['push'](_0x13bdf2['shift']());}};_0x5583df(++_0x220793);}(_0x33c5,0xe6));var _0x533c=function(_0x1dc24d,_0x541fa4){_0x1dc24d=_0x1dc24d-0x0;var _0x5d7fb2=_0x33c5[_0x1dc24d];return _0x5d7fb2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x533c('0x0'));var zipdir=require(_0x533c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x533c('0x2'));var moment=require(_0x533c('0x3'));var BPromise=require(_0x533c('0x4'));var Mustache=require(_0x533c('0x5'));var util=require(_0x533c('0x6'));var path=require('path');var sox=require(_0x533c('0x7'));var csv=require(_0x533c('0x8'));var ejs=require(_0x533c('0x9'));var fs=require('fs');var fs_extra=require(_0x533c('0xa'));var _=require(_0x533c('0xb'));var squel=require(_0x533c('0xc'));var crypto=require(_0x533c('0xd'));var jsforce=require(_0x533c('0xe'));var deskjs=require(_0x533c('0xf'));var toCsv=require(_0x533c('0x8'));var querystring=require(_0x533c('0x10'));var Papa=require(_0x533c('0x11'));var Redis=require(_0x533c('0x12'));var authService=require(_0x533c('0x13'));var qs=require(_0x533c('0x14'));var as=require(_0x533c('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x533c('0x16'))(_0x533c('0x17'));var utils=require(_0x533c('0x18'));var config=require(_0x533c('0x19'));var licenseUtil=require(_0x533c('0x1a'));var db=require(_0x533c('0x1b'))['db'];function respondWithStatusCode(_0x530e10,_0x5c9462){_0x5c9462=_0x5c9462||0xcc;return function(_0xf93007){if(_0xf93007){return _0x530e10[_0x533c('0x1c')](_0x5c9462);}return _0x530e10[_0x533c('0x1d')](_0x5c9462)[_0x533c('0x1e')]();};}function respondWithResult(_0x1a2a83,_0x8d7c66){_0x8d7c66=_0x8d7c66||0xc8;return function(_0xa616ca){if(_0xa616ca){return _0x1a2a83['status'](_0x8d7c66)[_0x533c('0x1f')](_0xa616ca);}};}function respondWithFilteredResult(_0x7c1d33,_0x3f4a5c){return function(_0x3e544f){if(_0x3e544f){var _0x56dfb7=typeof _0x3f4a5c[_0x533c('0x20')]===_0x533c('0x21')&&typeof _0x3f4a5c[_0x533c('0x22')]===_0x533c('0x21');var _0x2854ab=_0x3e544f[_0x533c('0x23')];var _0x1f0a72=_0x56dfb7?0x0:_0x3f4a5c[_0x533c('0x20')];var _0x1f9f85=_0x56dfb7?_0x3e544f[_0x533c('0x23')]:_0x3f4a5c[_0x533c('0x20')]+_0x3f4a5c[_0x533c('0x22')];var _0x78dd72;if(_0x1f9f85>=_0x2854ab){_0x1f9f85=_0x2854ab;_0x78dd72=0xc8;}else{_0x78dd72=0xce;}_0x7c1d33[_0x533c('0x1d')](_0x78dd72);return _0x7c1d33[_0x533c('0x24')](_0x533c('0x25'),_0x1f0a72+'-'+_0x1f9f85+'/'+_0x2854ab)[_0x533c('0x1f')](_0x3e544f);}return null;};}function patchUpdates(_0x2bc58f){return function(_0x4ba0bd){try{jsonpatch[_0x533c('0x26')](_0x4ba0bd,_0x2bc58f,!![]);}catch(_0x51785c){return BPromise['reject'](_0x51785c);}return _0x4ba0bd[_0x533c('0x27')]();};}function saveUpdates(_0x36d4e4,_0x5f5090){return function(_0x21dfd3){if(_0x21dfd3){return _0x21dfd3[_0x533c('0x28')](_0x36d4e4)[_0x533c('0x29')](function(_0x3dd249){return _0x3dd249;});}return null;};}function removeEntity(_0x5ebbe0,_0x3762f7){return function(_0x42c87b){if(_0x42c87b){return _0x42c87b[_0x533c('0x2a')]()[_0x533c('0x29')](function(){_0x5ebbe0[_0x533c('0x1d')](0xcc)[_0x533c('0x1e')]();});}};}function handleEntityNotFound(_0xb51a5,_0x43f669){return function(_0xb1c937){if(!_0xb1c937){_0xb51a5[_0x533c('0x1c')](0x194);}return _0xb1c937;};}function handleError(_0x4d47d0,_0x11d775){_0x11d775=_0x11d775||0x1f4;return function(_0xfab4da){logger['error'](_0xfab4da[_0x533c('0x2b')]);if(_0xfab4da['name']){delete _0xfab4da[_0x533c('0x2c')];}_0x4d47d0[_0x533c('0x1d')](_0x11d775)[_0x533c('0x2d')](_0xfab4da);};}exports[_0x533c('0x2e')]=function(_0x425f60,_0x146a8e){var _0x212d1b={},_0x38d886={},_0x3c559b={'count':0x0,'rows':[]};var _0x2fc7fa=_[_0x533c('0x2f')](db[_0x533c('0x30')]['rawAttributes'],function(_0x370263){return{'name':_0x370263['fieldName'],'type':_0x370263[_0x533c('0x31')][_0x533c('0x32')]};});_0x38d886[_0x533c('0x33')]=_[_0x533c('0x34')](_[_0x533c('0x2f')](_0x2fc7fa,_0x533c('0x2c')),[_0x533c('0x35')]);_0x38d886[_0x533c('0x36')]=_[_0x533c('0x37')](_0x425f60[_0x533c('0x36')]);_0x38d886[_0x533c('0x38')]=_[_0x533c('0x39')](_0x38d886[_0x533c('0x33')],_0x38d886[_0x533c('0x36')]);_0x212d1b[_0x533c('0x3a')]=_['intersection'](_0x38d886[_0x533c('0x33')],qs[_0x533c('0x3b')](_0x425f60[_0x533c('0x36')][_0x533c('0x3b')]));_0x212d1b['attributes']=_0x212d1b[_0x533c('0x3a')][_0x533c('0x3c')]?_0x212d1b[_0x533c('0x3a')]:_0x38d886[_0x533c('0x33')];if(!_0x425f60[_0x533c('0x36')]['hasOwnProperty']('nolimit')){_0x212d1b['limit']=qs['limit'](_0x425f60['query'][_0x533c('0x22')]);_0x212d1b['offset']=qs[_0x533c('0x20')](_0x425f60['query'][_0x533c('0x20')]);}_0x212d1b[_0x533c('0x3d')]=qs[_0x533c('0x3e')](_0x425f60['query'][_0x533c('0x3e')]);_0x212d1b[_0x533c('0x3f')]=qs[_0x533c('0x38')](_['pick'](_0x425f60[_0x533c('0x36')],_0x38d886[_0x533c('0x38')]),_0x2fc7fa);if(_0x425f60[_0x533c('0x36')]['filter']){_0x212d1b[_0x533c('0x3f')]=_[_0x533c('0x40')](_0x212d1b[_0x533c('0x3f')],{'$or':_[_0x533c('0x2f')](_0x2fc7fa,function(_0x454dbc){if(_0x454dbc[_0x533c('0x31')]!==_0x533c('0x41')){var _0x2dbd81={};_0x2dbd81[_0x454dbc[_0x533c('0x2c')]]={'$like':'%'+_0x425f60[_0x533c('0x36')][_0x533c('0x42')]+'%'};return _0x2dbd81;}})});}_0x212d1b=_['merge']({},_0x212d1b,_0x425f60[_0x533c('0x43')]);var _0x784493={'where':_0x212d1b[_0x533c('0x3f')]};return db[_0x533c('0x30')][_0x533c('0x23')](_0x784493)[_0x533c('0x29')](function(_0x5d2bf9){_0x3c559b[_0x533c('0x23')]=_0x5d2bf9;if(_0x425f60[_0x533c('0x36')][_0x533c('0x44')]){_0x212d1b['include']=[{'all':!![]}];}return db[_0x533c('0x30')][_0x533c('0x45')](_0x212d1b);})[_0x533c('0x29')](function(_0x1abd47){_0x3c559b['rows']=_0x1abd47;return _0x3c559b;})[_0x533c('0x29')](respondWithFilteredResult(_0x146a8e,_0x212d1b))['catch'](handleError(_0x146a8e,null));};exports[_0x533c('0x46')]=function(_0x39034e,_0x55a372){var _0x3f4015={'raw':![],'where':{'id':_0x39034e[_0x533c('0x47')]['id']}},_0x3f1e47={};_0x3f1e47['model']=_['keys'](db['ScreenRecording']['rawAttributes']);_0x3f1e47[_0x533c('0x36')]=_['keys'](_0x39034e[_0x533c('0x36')]);_0x3f1e47['filters']=_[_0x533c('0x39')](_0x3f1e47['model'],_0x3f1e47[_0x533c('0x36')]);_0x3f4015[_0x533c('0x3a')]=_['intersection'](_0x3f1e47[_0x533c('0x33')],qs[_0x533c('0x3b')](_0x39034e[_0x533c('0x36')][_0x533c('0x3b')]));_0x3f4015[_0x533c('0x3a')]=_0x3f4015['attributes'][_0x533c('0x3c')]?_0x3f4015[_0x533c('0x3a')]:_0x3f1e47[_0x533c('0x33')];if(_0x39034e[_0x533c('0x36')]['includeAll']){_0x3f4015[_0x533c('0x48')]=[{'all':!![]}];}_0x3f4015=_[_0x533c('0x40')]({},_0x3f4015,_0x39034e['options']);return db['ScreenRecording'][_0x533c('0x49')](_0x3f4015)['then'](handleEntityNotFound(_0x55a372,null))[_0x533c('0x29')](respondWithResult(_0x55a372,null))[_0x533c('0x4a')](handleError(_0x55a372,null));};exports[_0x533c('0x4b')]=function(_0x471c59,_0xe9354a){return db[_0x533c('0x30')][_0x533c('0x4b')](_0x471c59[_0x533c('0x4c')],{})['then'](respondWithResult(_0xe9354a,0xc9))[_0x533c('0x4a')](handleError(_0xe9354a,null));};exports[_0x533c('0x28')]=function(_0xaaf682,_0x57c6c6){if(_0xaaf682[_0x533c('0x4c')]['id']){delete _0xaaf682[_0x533c('0x4c')]['id'];}delete _0xaaf682['body'][_0x533c('0x4d')];delete _0xaaf682['body'][_0x533c('0x4e')];delete _0xaaf682[_0x533c('0x4c')][_0x533c('0x4f')];delete _0xaaf682[_0x533c('0x4c')][_0x533c('0x50')];return db[_0x533c('0x30')][_0x533c('0x49')]({'where':{'id':_0xaaf682['params']['id']}})[_0x533c('0x29')](handleEntityNotFound(_0x57c6c6,null))[_0x533c('0x29')](saveUpdates(_0xaaf682[_0x533c('0x4c')],null))[_0x533c('0x29')](respondWithResult(_0x57c6c6,null))[_0x533c('0x4a')](handleError(_0x57c6c6,null));};exports[_0x533c('0x51')]=function(_0x3eb174,_0x50d5a2){return db['ScreenRecording']['describe']()['then'](respondWithResult(_0x50d5a2,null))[_0x533c('0x4a')](handleError(_0x50d5a2,null));};exports[_0x533c('0x52')]=function(_0x5c5dd0,_0xac086b,_0x1da579){var _0x2f6794=require('../../components/encryptor');var _0x1de19e=![];var _0x564a31={};if(_0x5c5dd0['query'][_0x533c('0x31')]&&_0x5c5dd0[_0x533c('0x36')][_0x533c('0x31')]===_0x533c('0x53')){_0x564a31[_0x533c('0x53')]=_0x5c5dd0[_0x533c('0x47')]['id'];}else{_0x564a31['id']=_0x5c5dd0[_0x533c('0x47')]['id'];}return db['ScreenRecording'][_0x533c('0x49')]({'where':_0x564a31,'attributes':['id','value'],'raw':!![]})[_0x533c('0x29')](handleEntityNotFound(_0xac086b,null))[_0x533c('0x29')](function(_0x274686){if(_0x274686){var _0x2c7600=path[_0x533c('0x54')](config[_0x533c('0x55')],_0x533c('0x56'),_0x274686[_0x533c('0x50')]);var _0x58f528=util[_0x533c('0x35')](_0x533c('0x57'),_0x2c7600);if(fs[_0x533c('0x58')](_0x58f528)){_0x1de19e=!![];return _0x2f6794[_0x533c('0x59')](_0x58f528,_0x2c7600,config[_0x533c('0x5a')][_0x533c('0x5b')])['then'](function(){return _0x274686;});}return _0x274686;}})[_0x533c('0x29')](function(_0x554a9f){if(_0x554a9f){var _0x43383e=path[_0x533c('0x54')](config[_0x533c('0x55')],_0x533c('0x56'),_0x554a9f[_0x533c('0x50')]);if(!fs[_0x533c('0x58')](_0x43383e)){throw new db['Sequelize']['ValidationError'](_0x533c('0x5c'));}if(_0x554a9f[_0x533c('0x5d')]){return _0xac086b[_0x533c('0x52')](_0x43383e,_0x554a9f[_0x533c('0x5d')]+path['extname'](_0x43383e),function(){if(_0x1de19e){fs[_0x533c('0x5e')](_0x43383e);}});}else{return _0xac086b[_0x533c('0x52')](_0x43383e,function(_0x8e04c7){if(_0x1de19e){fs[_0x533c('0x5e')](_0x43383e);}});}}})[_0x533c('0x4a')](function(_0x2f2863){if(_0x2f2863[_0x533c('0x5f')]===_0x533c('0x5c')){_0xac086b[_0x533c('0x1d')](0x194)[_0x533c('0x2d')](_0x533c('0x60'));}else{return handleError(_0xac086b,null);}});};exports[_0x533c('0x2a')]=function(_0x13a7f2,_0xea6ea2){return db[_0x533c('0x30')][_0x533c('0x49')]({'where':{'id':_0x13a7f2[_0x533c('0x47')]['id']}})['then'](function(_0x31bba1){if(_['isNil'](_0x31bba1)){throw new ReferenceError('Entity\x20not\x20found');}return _0x31bba1;})[_0x533c('0x29')](function(_0xb23f94){var _0x965b85=path[_0x533c('0x54')](config[_0x533c('0x55')],_0x533c('0x56'),_0xb23f94[_0x533c('0x50')]);logger['info'](_0x533c('0x61'),_0x965b85);if(!_[_0x533c('0x62')](_0xb23f94['value'])&&fs[_0x533c('0x58')](_0x965b85)){logger[_0x533c('0x63')](_0x533c('0x64')+_0x965b85+_0x533c('0x65'));fs['unlinkSync'](_0x965b85);}_0x965b85=_0x965b85+_0x533c('0x66');if(!_[_0x533c('0x62')](_0xb23f94['value'])&&fs[_0x533c('0x58')](_0x965b85)){logger[_0x533c('0x63')]('File:\x20\x22'+_0x965b85+_0x533c('0x65'));fs[_0x533c('0x67')](_0x965b85);}return _0xb23f94;})['then'](function(_0x444f46){if(!_0x444f46)throw new InternalError();return _0x444f46['destroy']();})['then'](function(){_0xea6ea2[_0x533c('0x1d')](0xcc)[_0x533c('0x1e')]();})[_0x533c('0x4a')](handleError(_0xea6ea2,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index fccd897..cfb1615 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 _0x33d2=['path','rimraf','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','bluebird','request-promise'];(function(_0xf67a90,_0x2eb2f3){var _0x648b2=function(_0x298232){while(--_0x298232){_0xf67a90['push'](_0xf67a90['shift']());}};_0x648b2(++_0x2eb2f3);}(_0x33d2,0xae));var _0x233d=function(_0x3113b1,_0x42646c){_0x3113b1=_0x3113b1-0x0;var _0x4d45a8=_0x33d2[_0x3113b1];return _0x4d45a8;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x233d('0x0'));var rp=require(_0x233d('0x1'));var fs=require('fs');var path=require(_0x233d('0x2'));var rimraf=require(_0x233d('0x3'));var config=require(_0x233d('0x4'));var attributes=require(_0x233d('0x5'));module[_0x233d('0x6')]=function(_0x316566,_0x54c769){return _0x316566[_0x233d('0x7')](_0x233d('0x8'),attributes,{'tableName':_0x233d('0x9'),'paranoid':![],'indexes':[{'name':_0x233d('0xa'),'fields':[_0x233d('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x733f=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','interactionid','lodash'];(function(_0xa927fa,_0x398c20){var _0x77bf78=function(_0x11d422){while(--_0x11d422){_0xa927fa['push'](_0xa927fa['shift']());}};_0x77bf78(++_0x398c20);}(_0x733f,0xb5));var _0xf733=function(_0x115844,_0x75e9ad){_0x115844=_0x115844-0x0;var _0xc21943=_0x733f[_0x115844];return _0xc21943;};'use strict';var _=require(_0xf733('0x0'));var util=require('util');var logger=require(_0xf733('0x1'))(_0xf733('0x2'));var moment=require(_0xf733('0x3'));var BPromise=require(_0xf733('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf733('0x5'));var rimraf=require(_0xf733('0x6'));var config=require(_0xf733('0x7'));var attributes=require(_0xf733('0x8'));module[_0xf733('0x9')]=function(_0x28b46a,_0x3acba4){return _0x28b46a[_0xf733('0xa')](_0xf733('0xb'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':'interactionid','fields':[_0xf733('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 e083f5a..34b26e9 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 _0x0dfc=['ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x4979f0,_0x1f63b9){var _0x53c2a0=function(_0x44736f){while(--_0x44736f){_0x4979f0['push'](_0x4979f0['shift']());}};_0x53c2a0(++_0x1f63b9);}(_0x0dfc,0x190));var _0xc0df=function(_0x32a2ee,_0x255a68){_0x32a2ee=_0x32a2ee-0x0;var _0x52c28f=_0x0dfc[_0x32a2ee];return _0x52c28f;};'use strict';var _=require('lodash');var util=require(_0xc0df('0x0'));var moment=require('moment');var BPromise=require(_0xc0df('0x1'));var rs=require(_0xc0df('0x2'));var fs=require('fs');var Redis=require(_0xc0df('0x3'));var db=require(_0xc0df('0x4'))['db'];var utils=require(_0xc0df('0x5'));var logger=require(_0xc0df('0x6'))(_0xc0df('0x7'));var config=require('../../config/environment');var jayson=require(_0xc0df('0x8'));var client=jayson[_0xc0df('0x9')][_0xc0df('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59cd55,_0x5abd7c,_0x688fcd){return new BPromise(function(_0x22a4e5,_0x1475ad){return client[_0xc0df('0xb')](_0x59cd55,_0x688fcd)[_0xc0df('0xc')](function(_0x1baef2){logger[_0xc0df('0xd')](_0xc0df('0xe'),_0x5abd7c,_0xc0df('0xf'));logger[_0xc0df('0x10')](_0xc0df('0x11'),_0x5abd7c,'request\x20sent',JSON[_0xc0df('0x12')](_0x1baef2));if(_0x1baef2[_0xc0df('0x13')]){if(_0x1baef2[_0xc0df('0x13')]['code']===0x1f4){logger[_0xc0df('0x13')](_0xc0df('0xe'),_0x5abd7c,_0x1baef2[_0xc0df('0x13')]['message']);return _0x1475ad(_0x1baef2[_0xc0df('0x13')][_0xc0df('0x14')]);}logger[_0xc0df('0x13')]('ScreenRecording,\x20%s,\x20%s',_0x5abd7c,_0x1baef2[_0xc0df('0x13')]['message']);return _0x22a4e5(_0x1baef2[_0xc0df('0x13')][_0xc0df('0x14')]);}else{logger[_0xc0df('0xd')]('ScreenRecording,\x20%s,\x20%s',_0x5abd7c,'request\x20sent');_0x22a4e5(_0x1baef2[_0xc0df('0x15')]['message']);}})[_0xc0df('0x16')](function(_0x1ec4f0){logger[_0xc0df('0x13')](_0xc0df('0xe'),_0x5abd7c,_0x1ec4f0);_0x1475ad(_0x1ec4f0);});});} \ No newline at end of file +var _0xc577=['../../config/environment','jayson/promise','client','http','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0xc577,0x12f));var _0x7c57=function(_0x5e6cb8,_0x1d1eb5){_0x5e6cb8=_0x5e6cb8-0x0;var _0x41754f=_0xc577[_0x5e6cb8];return _0x41754f;};'use strict';var _=require(_0x7c57('0x0'));var util=require(_0x7c57('0x1'));var moment=require(_0x7c57('0x2'));var BPromise=require(_0x7c57('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7c57('0x4'));var db=require(_0x7c57('0x5'))['db'];var utils=require(_0x7c57('0x6'));var logger=require(_0x7c57('0x7'))(_0x7c57('0x8'));var config=require(_0x7c57('0x9'));var jayson=require(_0x7c57('0xa'));var client=jayson[_0x7c57('0xb')][_0x7c57('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x157005,_0x1659d2,_0x55ae99){return new BPromise(function(_0x288a5a,_0x47183e){return client[_0x7c57('0xd')](_0x157005,_0x55ae99)[_0x7c57('0xe')](function(_0x45e482){logger[_0x7c57('0xf')](_0x7c57('0x10'),_0x1659d2,_0x7c57('0x11'));logger[_0x7c57('0x12')](_0x7c57('0x13'),_0x1659d2,'request\x20sent',JSON['stringify'](_0x45e482));if(_0x45e482['error']){if(_0x45e482[_0x7c57('0x14')][_0x7c57('0x15')]===0x1f4){logger['error'](_0x7c57('0x10'),_0x1659d2,_0x45e482[_0x7c57('0x14')][_0x7c57('0x16')]);return _0x47183e(_0x45e482[_0x7c57('0x14')][_0x7c57('0x16')]);}logger['error'](_0x7c57('0x10'),_0x1659d2,_0x45e482['error']['message']);return _0x288a5a(_0x45e482['error']['message']);}else{logger[_0x7c57('0xf')](_0x7c57('0x10'),_0x1659d2,_0x7c57('0x11'));_0x288a5a(_0x45e482['result']['message']);}})[_0x7c57('0x17')](function(_0x4fbf47){logger[_0x7c57('0x14')](_0x7c57('0x10'),_0x1659d2,_0x4fbf47);_0x47183e(_0x4fbf47);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index d22cb48..99d6442 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 _0x349f=['file','addLogo','addLogoLogin','preferred','addPreferred','favicon','addFavicon','put','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./setting.controller','get','isAuthenticated','index','/now','getDate','/:id','show','/:id/logo','/:id/logo_login','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','logo','extname','originalname','post','single'];(function(_0x284646,_0xa50982){var _0x401ff8=function(_0x4504b8){while(--_0x4504b8){_0x284646['push'](_0x284646['shift']());}};_0x401ff8(++_0xa50982);}(_0x349f,0x158));var _0xf349=function(_0x1c0fa0,_0x2493a6){_0x1c0fa0=_0x1c0fa0-0x0;var _0x3516db=_0x349f[_0x1c0fa0];return _0x3516db;};'use strict';var multer=require('multer');var util=require(_0xf349('0x0'));var path=require(_0xf349('0x1'));var timeout=require(_0xf349('0x2'));var express=require(_0xf349('0x3'));var router=express[_0xf349('0x4')]();var fs_extra=require(_0xf349('0x5'));var auth=require(_0xf349('0x6'));var interaction=require(_0xf349('0x7'));var config=require('../../config/environment');var controller=require(_0xf349('0x8'));router[_0xf349('0x9')]('/',auth[_0xf349('0xa')](),controller[_0xf349('0xb')]);router['get'](_0xf349('0xc'),controller[_0xf349('0xd')]);router['get'](_0xf349('0xe'),controller[_0xf349('0xf')]);router[_0xf349('0x9')](_0xf349('0x10'),controller['getLogo']);router[_0xf349('0x9')](_0xf349('0x11'),controller['getLogoLogin']);router[_0xf349('0x9')]('/:id/gdpr',controller[_0xf349('0x12')]);router[_0xf349('0x9')](_0xf349('0x13'),controller[_0xf349('0x14')]);router['get'](_0xf349('0x15'),controller[_0xf349('0x16')]);var upload=multer({'storage':multer[_0xf349('0x17')]({'destination':function(_0x1d1c51,_0xb91744,_0x1ede20){_0x1ede20(null,path[_0xf349('0x18')](config[_0xf349('0x19')],_0xf349('0x1a')));},'filename':function(_0xd9e48a,_0x42ce0f,_0x51374f){_0x51374f(null,util[_0xf349('0x1b')](_0xf349('0x1c'),_0xf349('0x1d'),path[_0xf349('0x1e')](_0x42ce0f[_0xf349('0x1f')])));}})});router[_0xf349('0x20')]('/:id/logo',upload[_0xf349('0x21')](_0xf349('0x22')),controller[_0xf349('0x23')]);var upload=multer({'storage':multer[_0xf349('0x17')]({'destination':function(_0x280308,_0x14d737,_0x2360f2){_0x2360f2(null,path[_0xf349('0x18')](config['root'],'server/files/images/logos/'));},'filename':function(_0x16d662,_0xc9665c,_0x213352){_0x213352(null,util[_0xf349('0x1b')](_0xf349('0x1c'),'logologin',path[_0xf349('0x1e')](_0xc9665c['originalname'])));}})});router[_0xf349('0x20')](_0xf349('0x11'),upload[_0xf349('0x21')](_0xf349('0x22')),controller[_0xf349('0x24')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4f98e7,_0x383b8c,_0x40adde){_0x40adde(null,path[_0xf349('0x18')](config[_0xf349('0x19')],'server/files/images/logos/'));},'filename':function(_0x30e6e3,_0x34a8f1,_0x27ae7e){_0x27ae7e(null,util[_0xf349('0x1b')]('%s%s',_0xf349('0x25'),path[_0xf349('0x1e')](_0x34a8f1[_0xf349('0x1f')])));}})});router[_0xf349('0x20')](_0xf349('0x13'),upload['single'](_0xf349('0x22')),controller[_0xf349('0x26')]);var upload=multer({'storage':multer[_0xf349('0x17')]({'destination':function(_0x5f1aad,_0x2d9b8c,_0x2f7726){_0x2f7726(null,path[_0xf349('0x18')](config['root'],_0xf349('0x1a')));},'filename':function(_0x2b82e0,_0x3ff658,_0x48ebce){_0x48ebce(null,util[_0xf349('0x1b')](_0xf349('0x1c'),_0xf349('0x27'),path[_0xf349('0x1e')](_0x3ff658[_0xf349('0x1f')])));}})});router['post'](_0xf349('0x15'),upload[_0xf349('0x21')](_0xf349('0x22')),controller[_0xf349('0x28')]);router[_0xf349('0x29')](_0xf349('0xe'),auth[_0xf349('0xa')](),controller['update']);module['exports']=router; \ No newline at end of file +var _0xb347=['addPreferred','favicon','addFavicon','update','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./setting.controller','isAuthenticated','get','/now','getDate','/:id','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','getFavicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','extname','originalname','post','/:id/logo','single','addLogo','logologin','file','addLogoLogin','preferred'];(function(_0x2549c8,_0x461046){var _0x2f5231=function(_0x4302f4){while(--_0x4302f4){_0x2549c8['push'](_0x2549c8['shift']());}};_0x2f5231(++_0x461046);}(_0xb347,0x188));var _0x7b34=function(_0x38a3f8,_0x3482ec){_0x38a3f8=_0x38a3f8-0x0;var _0x2a8ac1=_0xb347[_0x38a3f8];return _0x2a8ac1;};'use strict';var multer=require(_0x7b34('0x0'));var util=require(_0x7b34('0x1'));var path=require(_0x7b34('0x2'));var timeout=require('connect-timeout');var express=require(_0x7b34('0x3'));var router=express[_0x7b34('0x4')]();var fs_extra=require(_0x7b34('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7b34('0x6'));var config=require(_0x7b34('0x7'));var controller=require(_0x7b34('0x8'));router['get']('/',auth[_0x7b34('0x9')](),controller['index']);router[_0x7b34('0xa')](_0x7b34('0xb'),controller[_0x7b34('0xc')]);router[_0x7b34('0xa')](_0x7b34('0xd'),controller['show']);router['get']('/:id/logo',controller[_0x7b34('0xe')]);router[_0x7b34('0xa')](_0x7b34('0xf'),controller[_0x7b34('0x10')]);router[_0x7b34('0xa')](_0x7b34('0x11'),controller[_0x7b34('0x12')]);router['get'](_0x7b34('0x13'),controller[_0x7b34('0x14')]);router[_0x7b34('0xa')]('/:id/favicon',controller[_0x7b34('0x15')]);var upload=multer({'storage':multer[_0x7b34('0x16')]({'destination':function(_0x5d2fac,_0x25c5ca,_0x1031ca){_0x1031ca(null,path[_0x7b34('0x17')](config[_0x7b34('0x18')],_0x7b34('0x19')));},'filename':function(_0x36d8a5,_0x52a197,_0x3410fb){_0x3410fb(null,util[_0x7b34('0x1a')](_0x7b34('0x1b'),'logo',path[_0x7b34('0x1c')](_0x52a197[_0x7b34('0x1d')])));}})});router[_0x7b34('0x1e')](_0x7b34('0x1f'),upload[_0x7b34('0x20')]('file'),controller[_0x7b34('0x21')]);var upload=multer({'storage':multer[_0x7b34('0x16')]({'destination':function(_0x16a179,_0x50db52,_0x341145){_0x341145(null,path[_0x7b34('0x17')](config[_0x7b34('0x18')],_0x7b34('0x19')));},'filename':function(_0x2efa24,_0x287d92,_0x264ccb){_0x264ccb(null,util[_0x7b34('0x1a')](_0x7b34('0x1b'),_0x7b34('0x22'),path['extname'](_0x287d92[_0x7b34('0x1d')])));}})});router[_0x7b34('0x1e')]('/:id/logo_login',upload[_0x7b34('0x20')](_0x7b34('0x23')),controller[_0x7b34('0x24')]);var upload=multer({'storage':multer[_0x7b34('0x16')]({'destination':function(_0x28c74c,_0x1331fd,_0x1760af){_0x1760af(null,path['join'](config[_0x7b34('0x18')],_0x7b34('0x19')));},'filename':function(_0x4dbe02,_0x248457,_0x3d5351){_0x3d5351(null,util['format']('%s%s',_0x7b34('0x25'),path['extname'](_0x248457['originalname'])));}})});router[_0x7b34('0x1e')](_0x7b34('0x13'),upload[_0x7b34('0x20')](_0x7b34('0x23')),controller[_0x7b34('0x26')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x45e7a2,_0xeaf52f,_0x446f7d){_0x446f7d(null,path[_0x7b34('0x17')](config[_0x7b34('0x18')],_0x7b34('0x19')));},'filename':function(_0x40ea15,_0x37b0ff,_0x30c547){_0x30c547(null,util['format']('%s%s',_0x7b34('0x27'),path[_0x7b34('0x1c')](_0x37b0ff['originalname'])));}})});router[_0x7b34('0x1e')]('/:id/favicon',upload[_0x7b34('0x20')]('file'),controller[_0x7b34('0x28')]);router['put'](_0x7b34('0xd'),auth[_0x7b34('0x9')](),controller[_0x7b34('0x29')]);module[_0x7b34('0x2a')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index a6b9099..a7c6deb 100644 --- a/server/api/setting/setting.attributes.js +++ b/server/api/setting/setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x40042d,_0x3ce810){var _0x3889a1=function(_0x2fdcbb){while(--_0x2fdcbb){_0x40042d['push'](_0x40042d['shift']());}};_0x3889a1(++_0x3ce810);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]}}; \ No newline at end of file +var _0xd8b0=['alternate','UNSIGNED','sequelize','exports','min_mailbox','INTEGER','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0d8b('0x2'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x0d8b('0x3')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0d8b('0x4')],'defaultValue':_0x0d8b('0x5')},'logo':{'type':Sequelize[_0x0d8b('0x4')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize[_0x0d8b('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0d8b('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0d8b('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x0d8b('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x0d8b('0x4')]},'turnaddr':{'type':Sequelize['STRING']},'turnusername':{'type':Sequelize[_0x0d8b('0x4')]},'turnpassword':{'type':Sequelize[_0x0d8b('0x4')]},'pageTitle':{'type':Sequelize[_0x0d8b('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0d8b('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0d8b('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0d8b('0x3')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0d8b('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0d8b('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0x0d8b('0x6')],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x0d8b('0x3')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0d8b('0x3')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0d8b('0x3')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0d8b('0x4')],'defaultValue':_0x0d8b('0x7')},'chatTimeout':{'type':Sequelize[_0x0d8b('0x3')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0d8b('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x0d8b('0x4')]},'defaultPreferred':{'type':Sequelize[_0x0d8b('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0d8b('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0d8b('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0d8b('0x3')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0d8b('0x3')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0d8b('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0d8b('0x3')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x0d8b('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0d8b('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x0d8b('0x3')]},'transcribeRegion':{'type':Sequelize[_0x0d8b('0x4')]},'sentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x0d8b('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0d8b('0x3')]},'sentimentRegion':{'type':Sequelize[_0x0d8b('0x4')]},'language':{'type':Sequelize[_0x0d8b('0x4')]},'bucket':{'type':Sequelize[_0x0d8b('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0d8b('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0d8b('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0d8b('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)[_0x0d8b('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0d8b('0x3')](0x2)[_0x0d8b('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0d8b('0x3')](0x2)[_0x0d8b('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0d8b('0x3')](0x2)[_0x0d8b('0x8')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0d8b('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0d8b('0x3')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0d8b('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0d8b('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 fe09562..2601a95 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 _0x1e19=['end','json','offset','undefined','limit','count','set','apply','reject','update','destroy','stack','name','map','Setting','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filters','merge','VIRTUAL','options','include','findAll','rows','show','params','includeAll','find','body','file','filename','logo','addLogoLogin','../../config/license/util','getLogo','preferred','favicon','defaultLogo','defaultFavicon','existsSync','join','toLower','root','upperFirst','custom','default_logo.svg','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','server/files/images/logos','getLicense','loginLogo','defaultPreferred','default_loginLogo.svg','default','gdpr','securePassword','addPreferred','getPreferred','defaultLoginLogo','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','send','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status'];(function(_0x165786,_0x390c1c){var _0x4c805a=function(_0x21ef39){while(--_0x21ef39){_0x165786['push'](_0x165786['shift']());}};_0x4c805a(++_0x390c1c);}(_0x1e19,0x1c9));var _0x91e1=function(_0x5ddf27,_0x5d6857){_0x5ddf27=_0x5ddf27-0x0;var _0xd8a2b8=_0x1e19[_0x5ddf27];return _0xd8a2b8;};'use strict';var emlformat=require(_0x91e1('0x0'));var rimraf=require(_0x91e1('0x1'));var zipdir=require(_0x91e1('0x2'));var jsonpatch=require(_0x91e1('0x3'));var rp=require(_0x91e1('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x91e1('0x5'));var sox=require(_0x91e1('0x6'));var csv=require(_0x91e1('0x7'));var ejs=require(_0x91e1('0x8'));var fs=require('fs');var fs_extra=require(_0x91e1('0x9'));var _=require('lodash');var squel=require(_0x91e1('0xa'));var crypto=require('crypto');var jsforce=require(_0x91e1('0xb'));var deskjs=require(_0x91e1('0xc'));var toCsv=require(_0x91e1('0x7'));var querystring=require(_0x91e1('0xd'));var Papa=require(_0x91e1('0xe'));var Redis=require('ioredis');var authService=require(_0x91e1('0xf'));var qs=require(_0x91e1('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x91e1('0x11'));var logger=require(_0x91e1('0x12'))(_0x91e1('0x13'));var utils=require(_0x91e1('0x14'));var config=require(_0x91e1('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require(_0x91e1('0x16'));var client=jayson[_0x91e1('0x17')][_0x91e1('0x18')]({'port':0x232a});function respondWithRpcPromise(_0xc8b555,_0xb0f9e0,_0x8e8cf7,_0x23da39){return new BPromise(function(_0x3fb2e4,_0x511333){var _0x16119d=_0x23da39||client;return _0x16119d[_0x91e1('0x19')](_0xc8b555,_0x8e8cf7)[_0x91e1('0x1a')](function(_0x1d0bca){logger[_0x91e1('0x1b')](_0x91e1('0x1c'),_0xb0f9e0,'request\x20sent');logger[_0x91e1('0x1d')]('Setting,\x20%s,\x20%s,\x20%s',_0xb0f9e0,_0x91e1('0x1e'),JSON[_0x91e1('0x1f')](_0x1d0bca));if(_0x1d0bca['error']){if(_0x1d0bca[_0x91e1('0x20')][_0x91e1('0x21')]===0x1f4){logger[_0x91e1('0x20')]('Setting,\x20%s,\x20%s',_0xb0f9e0,_0x1d0bca['error'][_0x91e1('0x22')]);return _0x511333(_0x1d0bca['error'][_0x91e1('0x22')]);}logger[_0x91e1('0x20')](_0x91e1('0x1c'),_0xb0f9e0,_0x1d0bca[_0x91e1('0x20')][_0x91e1('0x22')]);return _0x3fb2e4(_0x1d0bca[_0x91e1('0x20')][_0x91e1('0x22')]);}else{logger[_0x91e1('0x1b')](_0x91e1('0x1c'),_0xb0f9e0,_0x91e1('0x1e'));_0x3fb2e4(_0x1d0bca[_0x91e1('0x23')]['message']);}})[_0x91e1('0x24')](function(_0x3e39e3){logger[_0x91e1('0x20')]('Setting,\x20%s,\x20%s',_0xb0f9e0,_0x3e39e3);_0x511333(_0x3e39e3);});});}function respondWithStatusCode(_0x477d6c,_0xccc5ad){_0xccc5ad=_0xccc5ad||0xcc;return function(_0x3c7631){if(_0x3c7631){return _0x477d6c[_0x91e1('0x25')](_0xccc5ad);}return _0x477d6c[_0x91e1('0x26')](_0xccc5ad)[_0x91e1('0x27')]();};}function respondWithResult(_0x24a885,_0xe97618){_0xe97618=_0xe97618||0xc8;return function(_0xca52f1){if(_0xca52f1){return _0x24a885[_0x91e1('0x26')](_0xe97618)[_0x91e1('0x28')](_0xca52f1);}};}function respondWithFilteredResult(_0xaacfcd,_0x3dbb13){return function(_0xf3bbb8){if(_0xf3bbb8){var _0x17bebd=typeof _0x3dbb13[_0x91e1('0x29')]===_0x91e1('0x2a')&&typeof _0x3dbb13[_0x91e1('0x2b')]===_0x91e1('0x2a');var _0x178e6b=_0xf3bbb8['count'];var _0x19f84d=_0x17bebd?0x0:_0x3dbb13[_0x91e1('0x29')];var _0x5bae2b=_0x17bebd?_0xf3bbb8[_0x91e1('0x2c')]:_0x3dbb13['offset']+_0x3dbb13['limit'];var _0xb08207;if(_0x5bae2b>=_0x178e6b){_0x5bae2b=_0x178e6b;_0xb08207=0xc8;}else{_0xb08207=0xce;}_0xaacfcd[_0x91e1('0x26')](_0xb08207);return _0xaacfcd[_0x91e1('0x2d')]('Content-Range',_0x19f84d+'-'+_0x5bae2b+'/'+_0x178e6b)[_0x91e1('0x28')](_0xf3bbb8);}return null;};}function patchUpdates(_0xad968d){return function(_0x1237ab){try{jsonpatch[_0x91e1('0x2e')](_0x1237ab,_0xad968d,!![]);}catch(_0x1fe96a){return BPromise[_0x91e1('0x2f')](_0x1fe96a);}return _0x1237ab['save']();};}function saveUpdates(_0x598b6b,_0x8328d6){return function(_0x131a47){if(_0x131a47){return _0x131a47[_0x91e1('0x30')](_0x598b6b)[_0x91e1('0x1a')](function(_0x164312){return _0x164312;});}return null;};}function removeEntity(_0x545c94,_0x12e26f){return function(_0xdf6718){if(_0xdf6718){return _0xdf6718[_0x91e1('0x31')]()[_0x91e1('0x1a')](function(){_0x545c94[_0x91e1('0x26')](0xcc)[_0x91e1('0x27')]();});}};}function handleEntityNotFound(_0x7eb2cc,_0x3f969c){return function(_0x449df1){if(!_0x449df1){_0x7eb2cc[_0x91e1('0x25')](0x194);}return _0x449df1;};}function handleError(_0x10bd07,_0x48a6e0){_0x48a6e0=_0x48a6e0||0x1f4;return function(_0x1247c1){logger[_0x91e1('0x20')](_0x1247c1[_0x91e1('0x32')]);if(_0x1247c1[_0x91e1('0x33')]){delete _0x1247c1[_0x91e1('0x33')];}_0x10bd07['status'](_0x48a6e0)['send'](_0x1247c1);};}exports['index']=function(_0x294016,_0x1905e0){var _0x605a81={},_0x4eaa5c={},_0x5bfa14={'count':0x0,'rows':[]};var _0x2e3335=_[_0x91e1('0x34')](db[_0x91e1('0x35')][_0x91e1('0x36')],function(_0x389def){return{'name':_0x389def[_0x91e1('0x37')],'type':_0x389def[_0x91e1('0x38')][_0x91e1('0x39')]};});_0x4eaa5c[_0x91e1('0x3a')]=_['map'](_0x2e3335,_0x91e1('0x33'));_0x4eaa5c['query']=_[_0x91e1('0x3b')](_0x294016[_0x91e1('0x3c')]);_0x4eaa5c['filters']=_[_0x91e1('0x3d')](_0x4eaa5c[_0x91e1('0x3a')],_0x4eaa5c[_0x91e1('0x3c')]);_0x605a81['attributes']=_['intersection'](_0x4eaa5c[_0x91e1('0x3a')],qs['fields'](_0x294016[_0x91e1('0x3c')][_0x91e1('0x3e')]));_0x605a81[_0x91e1('0x3f')]=_0x605a81[_0x91e1('0x3f')][_0x91e1('0x40')]?_0x605a81[_0x91e1('0x3f')]:_0x4eaa5c['model'];if(!_0x294016[_0x91e1('0x3c')][_0x91e1('0x41')]('nolimit')){_0x605a81[_0x91e1('0x2b')]=qs[_0x91e1('0x2b')](_0x294016[_0x91e1('0x3c')]['limit']);_0x605a81[_0x91e1('0x29')]=qs['offset'](_0x294016[_0x91e1('0x3c')]['offset']);}_0x605a81['order']=qs[_0x91e1('0x42')](_0x294016[_0x91e1('0x3c')][_0x91e1('0x42')]);_0x605a81[_0x91e1('0x43')]=qs['filters'](_[_0x91e1('0x44')](_0x294016[_0x91e1('0x3c')],_0x4eaa5c[_0x91e1('0x45')]),_0x2e3335);if(_0x294016['query']['filter']){_0x605a81[_0x91e1('0x43')]=_[_0x91e1('0x46')](_0x605a81[_0x91e1('0x43')],{'$or':_['map'](_0x2e3335,function(_0x523662){if(_0x523662[_0x91e1('0x38')]!==_0x91e1('0x47')){var _0x3ff621={};_0x3ff621[_0x523662[_0x91e1('0x33')]]={'$like':'%'+_0x294016['query']['filter']+'%'};return _0x3ff621;}})});}_0x605a81=_[_0x91e1('0x46')]({},_0x605a81,_0x294016[_0x91e1('0x48')]);var _0x55eba5={'where':_0x605a81['where']};return db[_0x91e1('0x35')][_0x91e1('0x2c')](_0x55eba5)[_0x91e1('0x1a')](function(_0xcd2870){_0x5bfa14[_0x91e1('0x2c')]=_0xcd2870;if(_0x294016['query']['includeAll']){_0x605a81[_0x91e1('0x49')]=[{'all':!![]}];}return db[_0x91e1('0x35')][_0x91e1('0x4a')](_0x605a81);})[_0x91e1('0x1a')](function(_0x1a928b){_0x5bfa14[_0x91e1('0x4b')]=_0x1a928b;return _0x5bfa14;})[_0x91e1('0x1a')](respondWithFilteredResult(_0x1905e0,_0x605a81))['catch'](handleError(_0x1905e0,null));};exports[_0x91e1('0x4c')]=function(_0x287665,_0x1e252e){var _0x117d9f={'raw':![],'where':{'id':_0x287665[_0x91e1('0x4d')]['id']}},_0x481598={};_0x481598['model']=_[_0x91e1('0x3b')](db['Setting'][_0x91e1('0x36')]);_0x481598[_0x91e1('0x3c')]=_[_0x91e1('0x3b')](_0x287665[_0x91e1('0x3c')]);_0x481598[_0x91e1('0x45')]=_[_0x91e1('0x3d')](_0x481598[_0x91e1('0x3a')],_0x481598[_0x91e1('0x3c')]);_0x117d9f[_0x91e1('0x3f')]=_[_0x91e1('0x3d')](_0x481598[_0x91e1('0x3a')],qs['fields'](_0x287665[_0x91e1('0x3c')]['fields']));_0x117d9f['attributes']=_0x117d9f[_0x91e1('0x3f')][_0x91e1('0x40')]?_0x117d9f[_0x91e1('0x3f')]:_0x481598[_0x91e1('0x3a')];if(_0x287665['query'][_0x91e1('0x4e')]){_0x117d9f[_0x91e1('0x49')]=[{'all':!![]}];}_0x117d9f=_['merge']({},_0x117d9f,_0x287665[_0x91e1('0x48')]);return db[_0x91e1('0x35')][_0x91e1('0x4f')](_0x117d9f)[_0x91e1('0x1a')](handleEntityNotFound(_0x1e252e,null))[_0x91e1('0x1a')](respondWithResult(_0x1e252e,null))[_0x91e1('0x24')](handleError(_0x1e252e,null));};exports['update']=function(_0x60527d,_0x2e9417){if(_0x60527d['body']['id']){delete _0x60527d[_0x91e1('0x50')]['id'];}return db[_0x91e1('0x35')][_0x91e1('0x4f')]({'where':{'id':_0x60527d[_0x91e1('0x4d')]['id']}})[_0x91e1('0x1a')](handleEntityNotFound(_0x2e9417,null))['then'](saveUpdates(_0x60527d[_0x91e1('0x50')],null))['then'](respondWithResult(_0x2e9417,null))[_0x91e1('0x24')](handleError(_0x2e9417,null));};exports['addLogo']=function(_0xf578bb,_0x2eb5fe,_0x394571){if(_0xf578bb[_0x91e1('0x51')]&&_0xf578bb['file'][_0x91e1('0x52')]){_0xf578bb['body'][_0x91e1('0x53')]=_0xf578bb[_0x91e1('0x51')][_0x91e1('0x52')];}return db[_0x91e1('0x35')][_0x91e1('0x4f')]({'where':{'id':_0xf578bb[_0x91e1('0x4d')]['id']}})[_0x91e1('0x1a')](handleEntityNotFound(_0x2eb5fe,null))['then'](saveUpdates(_0xf578bb[_0x91e1('0x50')],null))[_0x91e1('0x1a')](respondWithResult(_0x2eb5fe,null))[_0x91e1('0x24')](handleError(_0x2eb5fe,null));};exports[_0x91e1('0x54')]=function(_0x465909,_0x107cc6,_0x50acbb){if(_0x465909[_0x91e1('0x51')]&&_0x465909[_0x91e1('0x51')][_0x91e1('0x52')]){_0x465909[_0x91e1('0x50')]['loginLogo']=_0x465909[_0x91e1('0x51')]['filename'];}return db[_0x91e1('0x35')]['find']({'where':{'id':_0x465909['params']['id']}})['then'](handleEntityNotFound(_0x107cc6,null))[_0x91e1('0x1a')](saveUpdates(_0x465909[_0x91e1('0x50')],null))[_0x91e1('0x1a')](respondWithResult(_0x107cc6,null))[_0x91e1('0x24')](handleError(_0x107cc6,null));};var utilLicense=require(_0x91e1('0x55'));exports[_0x91e1('0x56')]=function(_0xdead19,_0x212203,_0x59e001){var _0x5b5352='server/files/images/logos';var _0x573bb2={'custom':![]};return utilLicense['getLicense']()[_0x91e1('0x1a')](function(_0xfc923f){if(_0xfc923f){_0x573bb2=_0xfc923f;}return db['Setting'][_0x91e1('0x4f')]({'where':{'id':_0xdead19[_0x91e1('0x4d')]['id']},'attributes':[_0x91e1('0x53'),'loginLogo',_0x91e1('0x57'),_0x91e1('0x58'),_0x91e1('0x59'),'defaultLoginLogo','defaultPreferred',_0x91e1('0x5a')],'raw':!![]});})['then'](handleEntityNotFound(_0x212203,null))['then'](function(_0x2c088c){if(_0x2c088c){var _0x4c93cb=_0x2c088c['logo']&&fs[_0x91e1('0x5b')](path[_0x91e1('0x5c')](config['root'],_0x5b5352,_[_0x91e1('0x5d')](_0x2c088c['logo'])))?path['join'](config[_0x91e1('0x5e')],_0x5b5352,_[_0x91e1('0x5d')](_0x2c088c[_0x91e1('0x53')])):path['join'](config[_0x91e1('0x5e')],_0x5b5352,_[_0x91e1('0x5d')]('default_logo.svg'));var _0xe7ba4f='default'+_[_0x91e1('0x5f')](_0x91e1('0x53'));if(_0x2c088c[_0xe7ba4f]||!_0x573bb2[_0x91e1('0x60')]){_0x4c93cb=path[_0x91e1('0x5c')](config[_0x91e1('0x5e')],_0x5b5352,_[_0x91e1('0x5d')](_0x91e1('0x61')));}if(!fs[_0x91e1('0x5b')](_0x4c93cb)){throw new db[(_0x91e1('0x62'))][(_0x91e1('0x63'))](_['upperFirst'](_0x91e1('0x53'))+_0x91e1('0x64'));}return _0x212203[_0x91e1('0x65')](_0x4c93cb);}})['catch'](handleError(_0x212203,null));};var utilLicense=require(_0x91e1('0x55'));exports[_0x91e1('0x66')]=function(_0x3f0444,_0x15cfea,_0x21b04b){var _0x4d1299=_0x91e1('0x67');var _0x598882={'custom':![]};return utilLicense[_0x91e1('0x68')]()[_0x91e1('0x1a')](function(_0x3e0fc7){if(_0x3e0fc7){_0x598882=_0x3e0fc7;}return db[_0x91e1('0x35')][_0x91e1('0x4f')]({'where':{'id':_0x3f0444['params']['id']},'attributes':[_0x91e1('0x53'),_0x91e1('0x69'),'preferred',_0x91e1('0x58'),'defaultLogo','defaultLoginLogo',_0x91e1('0x6a'),_0x91e1('0x5a')],'raw':!![]});})[_0x91e1('0x1a')](handleEntityNotFound(_0x15cfea,null))[_0x91e1('0x1a')](function(_0x4aadb5){if(_0x4aadb5){var _0x590890=_0x4aadb5['loginLogo']&&fs[_0x91e1('0x5b')](path[_0x91e1('0x5c')](config[_0x91e1('0x5e')],_0x4d1299,_[_0x91e1('0x5d')](_0x4aadb5[_0x91e1('0x69')])))?path[_0x91e1('0x5c')](config[_0x91e1('0x5e')],_0x4d1299,_['toLower'](_0x4aadb5[_0x91e1('0x69')])):path[_0x91e1('0x5c')](config['root'],_0x4d1299,_['toLower'](_0x91e1('0x6b')));var _0x475a89=_0x91e1('0x6c')+_[_0x91e1('0x5f')](_0x91e1('0x69'));if(_0x4aadb5[_0x475a89]||!_0x598882[_0x91e1('0x60')]){_0x590890=path[_0x91e1('0x5c')](config[_0x91e1('0x5e')],_0x4d1299,_[_0x91e1('0x5d')](_0x91e1('0x6b')));}if(!fs[_0x91e1('0x5b')](_0x590890)){throw new db[(_0x91e1('0x62'))][(_0x91e1('0x63'))](_[_0x91e1('0x5f')](_0x91e1('0x69'))+_0x91e1('0x64'));}return _0x15cfea[_0x91e1('0x65')](_0x590890);}})[_0x91e1('0x24')](handleError(_0x15cfea,null));};exports[_0x91e1('0x6d')]=function(_0x1c0080,_0x4802f9){return db[_0x91e1('0x35')][_0x91e1('0x4f')]({'where':{'id':_0x1c0080[_0x91e1('0x4d')]['id']},'attributes':[_0x91e1('0x6e')]})['then'](respondWithResult(_0x4802f9,null))['catch'](handleError(_0x4802f9,null));};exports[_0x91e1('0x6f')]=function(_0x5b29bc,_0x1dcb76,_0x118e4b){if(_0x5b29bc[_0x91e1('0x51')]&&_0x5b29bc[_0x91e1('0x51')][_0x91e1('0x52')]){_0x5b29bc['body'][_0x91e1('0x57')]=_0x5b29bc['file']['filename'];}return db[_0x91e1('0x35')][_0x91e1('0x4f')]({'where':{'id':_0x5b29bc[_0x91e1('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1dcb76,null))['then'](saveUpdates(_0x5b29bc['body'],null))[_0x91e1('0x1a')](respondWithResult(_0x1dcb76,null))[_0x91e1('0x24')](handleError(_0x1dcb76,null));};var utilLicense=require(_0x91e1('0x55'));exports[_0x91e1('0x70')]=function(_0x1317f1,_0x55956a,_0xb1189e){var _0x5a9dc6=_0x91e1('0x67');var _0x17cb45={'custom':![]};return utilLicense[_0x91e1('0x68')]()['then'](function(_0xf84b46){if(_0xf84b46){_0x17cb45=_0xf84b46;}return db[_0x91e1('0x35')]['find']({'where':{'id':_0x1317f1[_0x91e1('0x4d')]['id']},'attributes':[_0x91e1('0x53'),'loginLogo',_0x91e1('0x57'),_0x91e1('0x58'),_0x91e1('0x59'),_0x91e1('0x71'),'defaultPreferred',_0x91e1('0x5a')],'raw':!![]});})[_0x91e1('0x1a')](handleEntityNotFound(_0x55956a,null))['then'](function(_0x330a9c){if(_0x330a9c){var _0x38203c=_0x330a9c[_0x91e1('0x57')]&&fs[_0x91e1('0x5b')](path['join'](config['root'],_0x5a9dc6,_[_0x91e1('0x5d')](_0x330a9c[_0x91e1('0x57')])))?path['join'](config[_0x91e1('0x5e')],_0x5a9dc6,_['toLower'](_0x330a9c[_0x91e1('0x57')])):path[_0x91e1('0x5c')](config['root'],_0x5a9dc6,_['toLower'](_0x91e1('0x72')));var _0x53e133=_0x91e1('0x6c')+_[_0x91e1('0x5f')](_0x91e1('0x57'));if(_0x330a9c[_0x53e133]||!_0x17cb45[_0x91e1('0x60')]||!_0x17cb45['preferred']){_0x38203c=path[_0x91e1('0x5c')](config[_0x91e1('0x5e')],_0x5a9dc6,_[_0x91e1('0x5d')]('default_preferred.png'));}if(!fs['existsSync'](_0x38203c)){throw new db[(_0x91e1('0x62'))][(_0x91e1('0x63'))](_[_0x91e1('0x5f')](_0x91e1('0x57'))+_0x91e1('0x64'));}return _0x55956a[_0x91e1('0x65')](_0x38203c);}})[_0x91e1('0x24')](handleError(_0x55956a,null));};exports[_0x91e1('0x73')]=function(_0x513711,_0x26afbd,_0x1d69ab){if(_0x513711[_0x91e1('0x51')]&&_0x513711[_0x91e1('0x51')][_0x91e1('0x52')]){_0x513711[_0x91e1('0x50')][_0x91e1('0x58')]=_0x513711[_0x91e1('0x51')][_0x91e1('0x52')];}return db[_0x91e1('0x35')][_0x91e1('0x4f')]({'where':{'id':_0x513711['params']['id']}})[_0x91e1('0x1a')](handleEntityNotFound(_0x26afbd,null))[_0x91e1('0x1a')](saveUpdates(_0x513711[_0x91e1('0x50')],null))[_0x91e1('0x1a')](respondWithResult(_0x26afbd,null))[_0x91e1('0x24')](handleError(_0x26afbd,null));};var utilLicense=require(_0x91e1('0x55'));exports[_0x91e1('0x74')]=function(_0x4d15b7,_0x8c6f86,_0x23852a){var _0x1ef985='server/files/images/logos';var _0x256a3b={'custom':![]};return utilLicense['getLicense']()[_0x91e1('0x1a')](function(_0x37578b){if(_0x37578b){_0x256a3b=_0x37578b;}return db[_0x91e1('0x35')][_0x91e1('0x4f')]({'where':{'id':_0x4d15b7[_0x91e1('0x4d')]['id']},'attributes':[_0x91e1('0x53'),_0x91e1('0x69'),_0x91e1('0x57'),'favicon',_0x91e1('0x59'),_0x91e1('0x71'),'defaultPreferred',_0x91e1('0x5a')],'raw':!![]});})[_0x91e1('0x1a')](handleEntityNotFound(_0x8c6f86,null))[_0x91e1('0x1a')](function(_0x130e4a){if(_0x130e4a){var _0x37d0c2=_0x130e4a[_0x91e1('0x58')]&&fs[_0x91e1('0x5b')](path[_0x91e1('0x5c')](config['root'],_0x1ef985,_[_0x91e1('0x5d')](_0x130e4a['favicon'])))?path['join'](config[_0x91e1('0x5e')],_0x1ef985,_['toLower'](_0x130e4a[_0x91e1('0x58')])):path[_0x91e1('0x5c')](config[_0x91e1('0x5e')],_0x1ef985,_[_0x91e1('0x5d')](_0x91e1('0x75')));var _0x18118e='default'+_[_0x91e1('0x5f')](_0x91e1('0x58'));if(_0x130e4a[_0x18118e]||!_0x256a3b[_0x91e1('0x60')]){_0x37d0c2=path[_0x91e1('0x5c')](config[_0x91e1('0x5e')],_0x1ef985,_['toLower'](_0x91e1('0x75')));}if(!fs[_0x91e1('0x5b')](_0x37d0c2)){throw new db['Sequelize'][(_0x91e1('0x63'))](_[_0x91e1('0x5f')](_0x91e1('0x58'))+_0x91e1('0x64'));}return _0x8c6f86[_0x91e1('0x65')](_0x37d0c2);}})['catch'](handleError(_0x8c6f86,null));};exports[_0x91e1('0x76')]=function(_0x2d5d4e,_0x13cf54){var _0xb4cdc4={'offset':moment()[_0x91e1('0x77')]()};_0xb4cdc4[_0x91e1('0x78')]=moment()[_0x91e1('0x77')](_0xb4cdc4[_0x91e1('0x29')])[_0x91e1('0x79')](_0x91e1('0x7a'));return _0x13cf54[_0x91e1('0x26')](0xc8)[_0x91e1('0x7b')](_0xb4cdc4);}; \ No newline at end of file +var _0x27c9=['attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','filter','include','findAll','rows','catch','show','params','rawAttributes','model','includeAll','options','find','body','addLogo','file','filename','loginLogo','../../config/license/util','getLogo','server/files/images/logos','logo','preferred','favicon','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','toLower','join','root','default_logo.svg','default','upperFirst','custom','Sequelize','ValidationError','\x20not\x20found','getLogoLogin','getLicense','defaultLogo','default_loginLogo.svg','download','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','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','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','message','result','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','destroy','stack','name','send','Setting','fieldName','type','key','map','query','filters','intersection'];(function(_0x5b27da,_0x4a6532){var _0x3254f4=function(_0x4194c6){while(--_0x4194c6){_0x5b27da['push'](_0x5b27da['shift']());}};_0x3254f4(++_0x4a6532);}(_0x27c9,0x1af));var _0x927c=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x27c9[_0x432682];return _0x463d05;};'use strict';var emlformat=require(_0x927c('0x0'));var rimraf=require(_0x927c('0x1'));var zipdir=require(_0x927c('0x2'));var jsonpatch=require(_0x927c('0x3'));var rp=require('request-promise');var moment=require(_0x927c('0x4'));var BPromise=require(_0x927c('0x5'));var Mustache=require('mustache');var util=require(_0x927c('0x6'));var path=require(_0x927c('0x7'));var sox=require(_0x927c('0x8'));var csv=require(_0x927c('0x9'));var ejs=require(_0x927c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x927c('0xb'));var squel=require(_0x927c('0xc'));var crypto=require(_0x927c('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x927c('0xe'));var toCsv=require(_0x927c('0x9'));var querystring=require(_0x927c('0xf'));var Papa=require('papaparse');var Redis=require(_0x927c('0x10'));var authService=require(_0x927c('0x11'));var qs=require(_0x927c('0x12'));var as=require(_0x927c('0x13'));var hardwareService=require(_0x927c('0x14'));var logger=require(_0x927c('0x15'))(_0x927c('0x16'));var utils=require(_0x927c('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x927c('0x18'))['db'];var jayson=require(_0x927c('0x19'));var client=jayson[_0x927c('0x1a')][_0x927c('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x4c5d45,_0x175494,_0x4ffdc6,_0x4dd414){return new BPromise(function(_0x3011c5,_0x5c8549){var _0x3751a2=_0x4dd414||client;return _0x3751a2[_0x927c('0x1c')](_0x4c5d45,_0x4ffdc6)[_0x927c('0x1d')](function(_0x3e7d43){logger[_0x927c('0x1e')](_0x927c('0x1f'),_0x175494,_0x927c('0x20'));logger[_0x927c('0x21')](_0x927c('0x22'),_0x175494,_0x927c('0x20'),JSON['stringify'](_0x3e7d43));if(_0x3e7d43[_0x927c('0x23')]){if(_0x3e7d43[_0x927c('0x23')]['code']===0x1f4){logger[_0x927c('0x23')](_0x927c('0x1f'),_0x175494,_0x3e7d43['error'][_0x927c('0x24')]);return _0x5c8549(_0x3e7d43[_0x927c('0x23')][_0x927c('0x24')]);}logger[_0x927c('0x23')](_0x927c('0x1f'),_0x175494,_0x3e7d43['error']['message']);return _0x3011c5(_0x3e7d43['error'][_0x927c('0x24')]);}else{logger[_0x927c('0x1e')](_0x927c('0x1f'),_0x175494,_0x927c('0x20'));_0x3011c5(_0x3e7d43[_0x927c('0x25')][_0x927c('0x24')]);}})['catch'](function(_0x18a437){logger[_0x927c('0x23')](_0x927c('0x1f'),_0x175494,_0x18a437);_0x5c8549(_0x18a437);});});}function respondWithStatusCode(_0x271158,_0x72e3a0){_0x72e3a0=_0x72e3a0||0xcc;return function(_0x1f672a){if(_0x1f672a){return _0x271158['sendStatus'](_0x72e3a0);}return _0x271158[_0x927c('0x26')](_0x72e3a0)[_0x927c('0x27')]();};}function respondWithResult(_0x46273e,_0x40cf57){_0x40cf57=_0x40cf57||0xc8;return function(_0x52851b){if(_0x52851b){return _0x46273e[_0x927c('0x26')](_0x40cf57)[_0x927c('0x28')](_0x52851b);}};}function respondWithFilteredResult(_0xad49c0,_0xaa518a){return function(_0x32727f){if(_0x32727f){var _0x4c194b=typeof _0xaa518a[_0x927c('0x29')]===_0x927c('0x2a')&&typeof _0xaa518a[_0x927c('0x2b')]==='undefined';var _0x1e020a=_0x32727f[_0x927c('0x2c')];var _0x1116ca=_0x4c194b?0x0:_0xaa518a[_0x927c('0x29')];var _0x86ffe5=_0x4c194b?_0x32727f[_0x927c('0x2c')]:_0xaa518a[_0x927c('0x29')]+_0xaa518a['limit'];var _0x2d80c9;if(_0x86ffe5>=_0x1e020a){_0x86ffe5=_0x1e020a;_0x2d80c9=0xc8;}else{_0x2d80c9=0xce;}_0xad49c0[_0x927c('0x26')](_0x2d80c9);return _0xad49c0[_0x927c('0x2d')](_0x927c('0x2e'),_0x1116ca+'-'+_0x86ffe5+'/'+_0x1e020a)[_0x927c('0x28')](_0x32727f);}return null;};}function patchUpdates(_0x2577cf){return function(_0x31fd00){try{jsonpatch[_0x927c('0x2f')](_0x31fd00,_0x2577cf,!![]);}catch(_0x38a026){return BPromise[_0x927c('0x30')](_0x38a026);}return _0x31fd00['save']();};}function saveUpdates(_0x953a7e,_0x93f673){return function(_0x2482df){if(_0x2482df){return _0x2482df['update'](_0x953a7e)[_0x927c('0x1d')](function(_0x26b7be){return _0x26b7be;});}return null;};}function removeEntity(_0x536f65,_0xed9e08){return function(_0x5a3d48){if(_0x5a3d48){return _0x5a3d48[_0x927c('0x31')]()[_0x927c('0x1d')](function(){_0x536f65[_0x927c('0x26')](0xcc)[_0x927c('0x27')]();});}};}function handleEntityNotFound(_0x4fa200,_0x3f07ce){return function(_0x5363cc){if(!_0x5363cc){_0x4fa200['sendStatus'](0x194);}return _0x5363cc;};}function handleError(_0x3168bd,_0x537b5f){_0x537b5f=_0x537b5f||0x1f4;return function(_0xf14b96){logger['error'](_0xf14b96[_0x927c('0x32')]);if(_0xf14b96[_0x927c('0x33')]){delete _0xf14b96[_0x927c('0x33')];}_0x3168bd[_0x927c('0x26')](_0x537b5f)[_0x927c('0x34')](_0xf14b96);};}exports['index']=function(_0x1e010a,_0x11e3f0){var _0x2dc51c={},_0x55e093={},_0xe8b53a={'count':0x0,'rows':[]};var _0x49b72a=_['map'](db[_0x927c('0x35')]['rawAttributes'],function(_0x5acaa2){return{'name':_0x5acaa2[_0x927c('0x36')],'type':_0x5acaa2[_0x927c('0x37')][_0x927c('0x38')]};});_0x55e093['model']=_[_0x927c('0x39')](_0x49b72a,_0x927c('0x33'));_0x55e093[_0x927c('0x3a')]=_['keys'](_0x1e010a[_0x927c('0x3a')]);_0x55e093[_0x927c('0x3b')]=_[_0x927c('0x3c')](_0x55e093['model'],_0x55e093[_0x927c('0x3a')]);_0x2dc51c[_0x927c('0x3d')]=_[_0x927c('0x3c')](_0x55e093['model'],qs[_0x927c('0x3e')](_0x1e010a[_0x927c('0x3a')][_0x927c('0x3e')]));_0x2dc51c['attributes']=_0x2dc51c['attributes'][_0x927c('0x3f')]?_0x2dc51c[_0x927c('0x3d')]:_0x55e093['model'];if(!_0x1e010a['query'][_0x927c('0x40')]('nolimit')){_0x2dc51c[_0x927c('0x2b')]=qs[_0x927c('0x2b')](_0x1e010a[_0x927c('0x3a')]['limit']);_0x2dc51c[_0x927c('0x29')]=qs['offset'](_0x1e010a[_0x927c('0x3a')][_0x927c('0x29')]);}_0x2dc51c[_0x927c('0x41')]=qs[_0x927c('0x42')](_0x1e010a[_0x927c('0x3a')]['sort']);_0x2dc51c[_0x927c('0x43')]=qs[_0x927c('0x3b')](_[_0x927c('0x44')](_0x1e010a['query'],_0x55e093['filters']),_0x49b72a);if(_0x1e010a['query']['filter']){_0x2dc51c['where']=_[_0x927c('0x45')](_0x2dc51c[_0x927c('0x43')],{'$or':_[_0x927c('0x39')](_0x49b72a,function(_0x3ee9f8){if(_0x3ee9f8[_0x927c('0x37')]!=='VIRTUAL'){var _0x76a7c2={};_0x76a7c2[_0x3ee9f8['name']]={'$like':'%'+_0x1e010a[_0x927c('0x3a')][_0x927c('0x46')]+'%'};return _0x76a7c2;}})});}_0x2dc51c=_[_0x927c('0x45')]({},_0x2dc51c,_0x1e010a['options']);var _0x4d2549={'where':_0x2dc51c[_0x927c('0x43')]};return db[_0x927c('0x35')][_0x927c('0x2c')](_0x4d2549)['then'](function(_0x514233){_0xe8b53a[_0x927c('0x2c')]=_0x514233;if(_0x1e010a[_0x927c('0x3a')]['includeAll']){_0x2dc51c[_0x927c('0x47')]=[{'all':!![]}];}return db[_0x927c('0x35')][_0x927c('0x48')](_0x2dc51c);})[_0x927c('0x1d')](function(_0x4375d2){_0xe8b53a[_0x927c('0x49')]=_0x4375d2;return _0xe8b53a;})[_0x927c('0x1d')](respondWithFilteredResult(_0x11e3f0,_0x2dc51c))[_0x927c('0x4a')](handleError(_0x11e3f0,null));};exports[_0x927c('0x4b')]=function(_0x44b3da,_0x4f0bb4){var _0x372d00={'raw':![],'where':{'id':_0x44b3da[_0x927c('0x4c')]['id']}},_0xc3845b={};_0xc3845b['model']=_['keys'](db[_0x927c('0x35')][_0x927c('0x4d')]);_0xc3845b['query']=_['keys'](_0x44b3da[_0x927c('0x3a')]);_0xc3845b[_0x927c('0x3b')]=_['intersection'](_0xc3845b[_0x927c('0x4e')],_0xc3845b[_0x927c('0x3a')]);_0x372d00['attributes']=_[_0x927c('0x3c')](_0xc3845b[_0x927c('0x4e')],qs[_0x927c('0x3e')](_0x44b3da[_0x927c('0x3a')]['fields']));_0x372d00[_0x927c('0x3d')]=_0x372d00[_0x927c('0x3d')][_0x927c('0x3f')]?_0x372d00[_0x927c('0x3d')]:_0xc3845b[_0x927c('0x4e')];if(_0x44b3da['query'][_0x927c('0x4f')]){_0x372d00[_0x927c('0x47')]=[{'all':!![]}];}_0x372d00=_['merge']({},_0x372d00,_0x44b3da[_0x927c('0x50')]);return db['Setting'][_0x927c('0x51')](_0x372d00)[_0x927c('0x1d')](handleEntityNotFound(_0x4f0bb4,null))['then'](respondWithResult(_0x4f0bb4,null))[_0x927c('0x4a')](handleError(_0x4f0bb4,null));};exports['update']=function(_0x388283,_0x4ec5f7){if(_0x388283[_0x927c('0x52')]['id']){delete _0x388283[_0x927c('0x52')]['id'];}return db[_0x927c('0x35')]['find']({'where':{'id':_0x388283[_0x927c('0x4c')]['id']}})[_0x927c('0x1d')](handleEntityNotFound(_0x4ec5f7,null))['then'](saveUpdates(_0x388283['body'],null))[_0x927c('0x1d')](respondWithResult(_0x4ec5f7,null))[_0x927c('0x4a')](handleError(_0x4ec5f7,null));};exports[_0x927c('0x53')]=function(_0x19d6cd,_0x5b2a72,_0x2777c9){if(_0x19d6cd[_0x927c('0x54')]&&_0x19d6cd['file']['filename']){_0x19d6cd[_0x927c('0x52')]['logo']=_0x19d6cd[_0x927c('0x54')][_0x927c('0x55')];}return db['Setting'][_0x927c('0x51')]({'where':{'id':_0x19d6cd['params']['id']}})[_0x927c('0x1d')](handleEntityNotFound(_0x5b2a72,null))[_0x927c('0x1d')](saveUpdates(_0x19d6cd[_0x927c('0x52')],null))[_0x927c('0x1d')](respondWithResult(_0x5b2a72,null))[_0x927c('0x4a')](handleError(_0x5b2a72,null));};exports['addLogoLogin']=function(_0x2a5fd3,_0x468071,_0xd81870){if(_0x2a5fd3['file']&&_0x2a5fd3[_0x927c('0x54')]['filename']){_0x2a5fd3['body'][_0x927c('0x56')]=_0x2a5fd3['file'][_0x927c('0x55')];}return db[_0x927c('0x35')][_0x927c('0x51')]({'where':{'id':_0x2a5fd3[_0x927c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x468071,null))[_0x927c('0x1d')](saveUpdates(_0x2a5fd3[_0x927c('0x52')],null))['then'](respondWithResult(_0x468071,null))[_0x927c('0x4a')](handleError(_0x468071,null));};var utilLicense=require(_0x927c('0x57'));exports[_0x927c('0x58')]=function(_0x2debe0,_0x632842,_0x111f6a){var _0x1cf120=_0x927c('0x59');var _0x23e561={'custom':![]};return utilLicense['getLicense']()[_0x927c('0x1d')](function(_0x14d173){if(_0x14d173){_0x23e561=_0x14d173;}return db['Setting'][_0x927c('0x51')]({'where':{'id':_0x2debe0[_0x927c('0x4c')]['id']},'attributes':[_0x927c('0x5a'),_0x927c('0x56'),_0x927c('0x5b'),_0x927c('0x5c'),'defaultLogo',_0x927c('0x5d'),_0x927c('0x5e'),_0x927c('0x5f')],'raw':!![]});})[_0x927c('0x1d')](handleEntityNotFound(_0x632842,null))['then'](function(_0x17294e){if(_0x17294e){var _0x25d597=_0x17294e['logo']&&fs[_0x927c('0x60')](path['join'](config['root'],_0x1cf120,_[_0x927c('0x61')](_0x17294e['logo'])))?path[_0x927c('0x62')](config['root'],_0x1cf120,_[_0x927c('0x61')](_0x17294e[_0x927c('0x5a')])):path['join'](config[_0x927c('0x63')],_0x1cf120,_[_0x927c('0x61')](_0x927c('0x64')));var _0x440116=_0x927c('0x65')+_[_0x927c('0x66')](_0x927c('0x5a'));if(_0x17294e[_0x440116]||!_0x23e561[_0x927c('0x67')]){_0x25d597=path[_0x927c('0x62')](config['root'],_0x1cf120,_['toLower']('default_logo.svg'));}if(!fs[_0x927c('0x60')](_0x25d597)){throw new db[(_0x927c('0x68'))][(_0x927c('0x69'))](_[_0x927c('0x66')](_0x927c('0x5a'))+_0x927c('0x6a'));}return _0x632842['download'](_0x25d597);}})[_0x927c('0x4a')](handleError(_0x632842,null));};var utilLicense=require(_0x927c('0x57'));exports[_0x927c('0x6b')]=function(_0x10bb11,_0x12752e,_0xc5f6f){var _0x5ba8fc=_0x927c('0x59');var _0x383802={'custom':![]};return utilLicense[_0x927c('0x6c')]()[_0x927c('0x1d')](function(_0x7086fd){if(_0x7086fd){_0x383802=_0x7086fd;}return db['Setting'][_0x927c('0x51')]({'where':{'id':_0x10bb11[_0x927c('0x4c')]['id']},'attributes':[_0x927c('0x5a'),'loginLogo',_0x927c('0x5b'),'favicon',_0x927c('0x6d'),_0x927c('0x5d'),_0x927c('0x5e'),'defaultFavicon'],'raw':!![]});})[_0x927c('0x1d')](handleEntityNotFound(_0x12752e,null))[_0x927c('0x1d')](function(_0xe52835){if(_0xe52835){var _0x2e7812=_0xe52835[_0x927c('0x56')]&&fs[_0x927c('0x60')](path['join'](config[_0x927c('0x63')],_0x5ba8fc,_['toLower'](_0xe52835['loginLogo'])))?path[_0x927c('0x62')](config['root'],_0x5ba8fc,_[_0x927c('0x61')](_0xe52835['loginLogo'])):path[_0x927c('0x62')](config['root'],_0x5ba8fc,_[_0x927c('0x61')](_0x927c('0x6e')));var _0x127f29='default'+_['upperFirst'](_0x927c('0x56'));if(_0xe52835[_0x127f29]||!_0x383802['custom']){_0x2e7812=path[_0x927c('0x62')](config['root'],_0x5ba8fc,_[_0x927c('0x61')](_0x927c('0x6e')));}if(!fs[_0x927c('0x60')](_0x2e7812)){throw new db[(_0x927c('0x68'))]['ValidationError'](_['upperFirst'](_0x927c('0x56'))+_0x927c('0x6a'));}return _0x12752e[_0x927c('0x6f')](_0x2e7812);}})[_0x927c('0x4a')](handleError(_0x12752e,null));};exports[_0x927c('0x70')]=function(_0x2b2428,_0x4f42e5){return db[_0x927c('0x35')]['find']({'where':{'id':_0x2b2428[_0x927c('0x4c')]['id']},'attributes':[_0x927c('0x71')]})[_0x927c('0x1d')](respondWithResult(_0x4f42e5,null))['catch'](handleError(_0x4f42e5,null));};exports[_0x927c('0x72')]=function(_0x552204,_0x279a9e,_0xddda73){if(_0x552204[_0x927c('0x54')]&&_0x552204[_0x927c('0x54')][_0x927c('0x55')]){_0x552204['body']['preferred']=_0x552204['file']['filename'];}return db[_0x927c('0x35')][_0x927c('0x51')]({'where':{'id':_0x552204[_0x927c('0x4c')]['id']}})[_0x927c('0x1d')](handleEntityNotFound(_0x279a9e,null))['then'](saveUpdates(_0x552204['body'],null))['then'](respondWithResult(_0x279a9e,null))[_0x927c('0x4a')](handleError(_0x279a9e,null));};var utilLicense=require(_0x927c('0x57'));exports[_0x927c('0x73')]=function(_0x2fa970,_0x5e1262,_0x11a3ab){var _0x4b562a=_0x927c('0x59');var _0x1c8e81={'custom':![]};return utilLicense[_0x927c('0x6c')]()[_0x927c('0x1d')](function(_0x596e4e){if(_0x596e4e){_0x1c8e81=_0x596e4e;}return db[_0x927c('0x35')][_0x927c('0x51')]({'where':{'id':_0x2fa970[_0x927c('0x4c')]['id']},'attributes':[_0x927c('0x5a'),_0x927c('0x56'),_0x927c('0x5b'),_0x927c('0x5c'),_0x927c('0x6d'),_0x927c('0x5d'),_0x927c('0x5e'),_0x927c('0x5f')],'raw':!![]});})[_0x927c('0x1d')](handleEntityNotFound(_0x5e1262,null))[_0x927c('0x1d')](function(_0x555b5c){if(_0x555b5c){var _0x58cc17=_0x555b5c[_0x927c('0x5b')]&&fs['existsSync'](path[_0x927c('0x62')](config[_0x927c('0x63')],_0x4b562a,_['toLower'](_0x555b5c[_0x927c('0x5b')])))?path[_0x927c('0x62')](config[_0x927c('0x63')],_0x4b562a,_[_0x927c('0x61')](_0x555b5c[_0x927c('0x5b')])):path[_0x927c('0x62')](config[_0x927c('0x63')],_0x4b562a,_[_0x927c('0x61')](_0x927c('0x74')));var _0x599cbd=_0x927c('0x65')+_[_0x927c('0x66')](_0x927c('0x5b'));if(_0x555b5c[_0x599cbd]||!_0x1c8e81[_0x927c('0x67')]||!_0x1c8e81[_0x927c('0x5b')]){_0x58cc17=path[_0x927c('0x62')](config[_0x927c('0x63')],_0x4b562a,_['toLower']('default_preferred.png'));}if(!fs[_0x927c('0x60')](_0x58cc17)){throw new db[(_0x927c('0x68'))][(_0x927c('0x69'))](_[_0x927c('0x66')](_0x927c('0x5b'))+_0x927c('0x6a'));}return _0x5e1262['download'](_0x58cc17);}})['catch'](handleError(_0x5e1262,null));};exports[_0x927c('0x75')]=function(_0x34378f,_0x29e59f,_0x462ea0){if(_0x34378f[_0x927c('0x54')]&&_0x34378f[_0x927c('0x54')][_0x927c('0x55')]){_0x34378f['body']['favicon']=_0x34378f['file'][_0x927c('0x55')];}return db['Setting']['find']({'where':{'id':_0x34378f[_0x927c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x29e59f,null))[_0x927c('0x1d')](saveUpdates(_0x34378f[_0x927c('0x52')],null))[_0x927c('0x1d')](respondWithResult(_0x29e59f,null))[_0x927c('0x4a')](handleError(_0x29e59f,null));};var utilLicense=require(_0x927c('0x57'));exports[_0x927c('0x76')]=function(_0x1b41a1,_0x52ea4c,_0x16b8d8){var _0x42920a='server/files/images/logos';var _0x1bed9e={'custom':![]};return utilLicense[_0x927c('0x6c')]()[_0x927c('0x1d')](function(_0x472dc2){if(_0x472dc2){_0x1bed9e=_0x472dc2;}return db[_0x927c('0x35')][_0x927c('0x51')]({'where':{'id':_0x1b41a1['params']['id']},'attributes':[_0x927c('0x5a'),_0x927c('0x56'),_0x927c('0x5b'),_0x927c('0x5c'),_0x927c('0x6d'),_0x927c('0x5d'),_0x927c('0x5e'),_0x927c('0x5f')],'raw':!![]});})[_0x927c('0x1d')](handleEntityNotFound(_0x52ea4c,null))['then'](function(_0x15ebc6){if(_0x15ebc6){var _0x14e200=_0x15ebc6[_0x927c('0x5c')]&&fs[_0x927c('0x60')](path[_0x927c('0x62')](config[_0x927c('0x63')],_0x42920a,_[_0x927c('0x61')](_0x15ebc6['favicon'])))?path[_0x927c('0x62')](config[_0x927c('0x63')],_0x42920a,_[_0x927c('0x61')](_0x15ebc6[_0x927c('0x5c')])):path[_0x927c('0x62')](config[_0x927c('0x63')],_0x42920a,_[_0x927c('0x61')](_0x927c('0x77')));var _0x2cddce=_0x927c('0x65')+_[_0x927c('0x66')](_0x927c('0x5c'));if(_0x15ebc6[_0x2cddce]||!_0x1bed9e[_0x927c('0x67')]){_0x14e200=path[_0x927c('0x62')](config[_0x927c('0x63')],_0x42920a,_[_0x927c('0x61')](_0x927c('0x77')));}if(!fs['existsSync'](_0x14e200)){throw new db['Sequelize']['ValidationError'](_[_0x927c('0x66')](_0x927c('0x5c'))+_0x927c('0x6a'));}return _0x52ea4c[_0x927c('0x6f')](_0x14e200);}})[_0x927c('0x4a')](handleError(_0x52ea4c,null));};exports['getDate']=function(_0x3d68c7,_0x332085){var _0x34f1a0={'offset':moment()['utcOffset']()};_0x34f1a0['now']=moment()[_0x927c('0x78')](_0x34f1a0[_0x927c('0x29')])[_0x927c('0x79')](_0x927c('0x7a'));return _0x332085[_0x927c('0x26')](0xc8)[_0x927c('0x34')](_0x34f1a0);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 0bc7620..07df002 100644 --- a/server/api/setting/setting.model.js +++ b/server/api/setting/setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['./setting.attributes','exports','define','settings','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x5c14f6,_0x2979d8){var _0x4949b3=function(_0xcc4206){while(--_0xcc4206){_0x5c14f6['push'](_0x5c14f6['shift']());}};_0x4949b3(++_0x2979d8);}(_0x55ca,0x126));var _0xa55c=function(_0x7a8be9,_0x1caf02){_0x7a8be9=_0x7a8be9-0x0;var _0x4bab19=_0x55ca[_0x7a8be9];return _0x4bab19;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('Setting',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe14b=['bluebird','path','./setting.attributes','exports','define','Setting','settings','lodash','util','moment'];(function(_0x23b0aa,_0x25dbf7){var _0x5e9ea5=function(_0x14b59b){while(--_0x14b59b){_0x23b0aa['push'](_0x23b0aa['shift']());}};_0x5e9ea5(++_0x25dbf7);}(_0xe14b,0x93));var _0xbe14=function(_0x52d5a1,_0xff05d5){_0x52d5a1=_0x52d5a1-0x0;var _0x176c31=_0xe14b[_0x52d5a1];return _0x176c31;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 1501689..948665d 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 _0xe7bf=['message','result','catch','ShowSetting','Setting','find','raw','options','where','map','include','model','attributes','info','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','Setting,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code'];(function(_0x532f9e,_0x28cbce){var _0x589278=function(_0x27c3c2){while(--_0x27c3c2){_0x532f9e['push'](_0x532f9e['shift']());}};_0x589278(++_0x28cbce);}(_0xe7bf,0x18e));var _0xfe7b=function(_0x25e98d,_0x289e3b){_0x25e98d=_0x25e98d-0x0;var _0x311366=_0xe7bf[_0x25e98d];return _0x311366;};'use strict';var _=require(_0xfe7b('0x0'));var util=require(_0xfe7b('0x1'));var moment=require(_0xfe7b('0x2'));var BPromise=require(_0xfe7b('0x3'));var rs=require(_0xfe7b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfe7b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfe7b('0x6'))('rpc');var config=require(_0xfe7b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xfe7b('0x8')][_0xfe7b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4b073c,_0x19fdb9,_0x105747){return new BPromise(function(_0x4ecfbc,_0x59a998){return client[_0xfe7b('0xa')](_0x4b073c,_0x105747)[_0xfe7b('0xb')](function(_0x5360da){logger['info'](_0xfe7b('0xc'),_0x19fdb9,'request\x20sent');logger[_0xfe7b('0xd')]('Setting,\x20%s,\x20%s,\x20%s',_0x19fdb9,_0xfe7b('0xe'),JSON[_0xfe7b('0xf')](_0x5360da));if(_0x5360da['error']){if(_0x5360da[_0xfe7b('0x10')][_0xfe7b('0x11')]===0x1f4){logger['error'](_0xfe7b('0xc'),_0x19fdb9,_0x5360da['error'][_0xfe7b('0x12')]);return _0x59a998(_0x5360da[_0xfe7b('0x10')][_0xfe7b('0x12')]);}logger[_0xfe7b('0x10')]('Setting,\x20%s,\x20%s',_0x19fdb9,_0x5360da[_0xfe7b('0x10')][_0xfe7b('0x12')]);return _0x4ecfbc(_0x5360da['error'][_0xfe7b('0x12')]);}else{logger['info'](_0xfe7b('0xc'),_0x19fdb9,_0xfe7b('0xe'));_0x4ecfbc(_0x5360da[_0xfe7b('0x13')][_0xfe7b('0x12')]);}})[_0xfe7b('0x14')](function(_0x4b1ad7){logger[_0xfe7b('0x10')](_0xfe7b('0xc'),_0x19fdb9,_0x4b1ad7);_0x59a998(_0x4b1ad7);});});}exports[_0xfe7b('0x15')]=function(_0x1575c0){var _0x20d59a=this;return new Promise(function(_0x8f9de2,_0xf02963){return db[_0xfe7b('0x16')][_0xfe7b('0x17')]({'raw':_0x1575c0['options']?_0x1575c0['options'][_0xfe7b('0x18')]===undefined?!![]:![]:!![],'where':_0x1575c0[_0xfe7b('0x19')]?_0x1575c0[_0xfe7b('0x19')][_0xfe7b('0x1a')]||null:null,'attributes':_0x1575c0[_0xfe7b('0x19')]?_0x1575c0[_0xfe7b('0x19')]['attributes']||null:null,'include':_0x1575c0[_0xfe7b('0x19')]?_0x1575c0[_0xfe7b('0x19')]['include']?_[_0xfe7b('0x1b')](_0x1575c0[_0xfe7b('0x19')][_0xfe7b('0x1c')],function(_0x48498a){return{'model':db[_0x48498a[_0xfe7b('0x1d')]],'as':_0x48498a['as'],'attributes':_0x48498a[_0xfe7b('0x1e')],'include':_0x48498a[_0xfe7b('0x1c')]?_['map'](_0x48498a[_0xfe7b('0x1c')],function(_0x3008f7){return{'model':db[_0x3008f7[_0xfe7b('0x1d')]],'as':_0x3008f7['as'],'attributes':_0x3008f7[_0xfe7b('0x1e')],'include':_0x3008f7['include']?_[_0xfe7b('0x1b')](_0x3008f7[_0xfe7b('0x1c')],function(_0x2205d7){return{'model':db[_0x2205d7[_0xfe7b('0x1d')]],'as':_0x2205d7['as'],'attributes':_0x2205d7['attributes']};}):[]};}):[]};}):[]:[]})[_0xfe7b('0xb')](function(_0x126f91){logger[_0xfe7b('0x1f')](_0xfe7b('0x15'),_0x1575c0);logger[_0xfe7b('0xd')](_0xfe7b('0x15'),_0x1575c0,JSON[_0xfe7b('0xf')](_0x126f91));_0x8f9de2(_0x126f91);})[_0xfe7b('0x14')](function(_0x2ef82e){logger[_0xfe7b('0x10')](_0xfe7b('0x15'),_0x2ef82e[_0xfe7b('0x12')],_0x1575c0);_0xf02963(_0x20d59a[_0xfe7b('0x10')](0x1f4,_0x2ef82e['message']));});});}; \ No newline at end of file +var _0x90cd=['bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','Setting','find','options','attributes','include','map','model','ShowSetting','lodash','util','moment'];(function(_0x47e3f8,_0x517bcd){var _0x4742d5=function(_0x2a4f20){while(--_0x2a4f20){_0x47e3f8['push'](_0x47e3f8['shift']());}};_0x4742d5(++_0x517bcd);}(_0x90cd,0xb7));var _0xd90c=function(_0x54fedc,_0x23d477){_0x54fedc=_0x54fedc-0x0;var _0x5164d0=_0x90cd[_0x54fedc];return _0x5164d0;};'use strict';var _=require(_0xd90c('0x0'));var util=require(_0xd90c('0x1'));var moment=require(_0xd90c('0x2'));var BPromise=require(_0xd90c('0x3'));var rs=require(_0xd90c('0x4'));var fs=require('fs');var Redis=require(_0xd90c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd90c('0x6'));var logger=require('../../config/logger')(_0xd90c('0x7'));var config=require(_0xd90c('0x8'));var jayson=require(_0xd90c('0x9'));var client=jayson[_0xd90c('0xa')][_0xd90c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x35f108,_0x149fb3,_0x1793fc){return new BPromise(function(_0x2bfbc4,_0x2dd1d2){return client[_0xd90c('0xc')](_0x35f108,_0x1793fc)[_0xd90c('0xd')](function(_0x15844a){logger[_0xd90c('0xe')](_0xd90c('0xf'),_0x149fb3,'request\x20sent');logger[_0xd90c('0x10')](_0xd90c('0x11'),_0x149fb3,'request\x20sent',JSON[_0xd90c('0x12')](_0x15844a));if(_0x15844a[_0xd90c('0x13')]){if(_0x15844a[_0xd90c('0x13')]['code']===0x1f4){logger[_0xd90c('0x13')](_0xd90c('0xf'),_0x149fb3,_0x15844a[_0xd90c('0x13')]['message']);return _0x2dd1d2(_0x15844a[_0xd90c('0x13')][_0xd90c('0x14')]);}logger[_0xd90c('0x13')]('Setting,\x20%s,\x20%s',_0x149fb3,_0x15844a[_0xd90c('0x13')]['message']);return _0x2bfbc4(_0x15844a['error'][_0xd90c('0x14')]);}else{logger[_0xd90c('0xe')](_0xd90c('0xf'),_0x149fb3,'request\x20sent');_0x2bfbc4(_0x15844a[_0xd90c('0x15')]['message']);}})[_0xd90c('0x16')](function(_0x5843d2){logger[_0xd90c('0x13')](_0xd90c('0xf'),_0x149fb3,_0x5843d2);_0x2dd1d2(_0x5843d2);});});}exports['ShowSetting']=function(_0x3e645b){var _0xde20ed=this;return new Promise(function(_0x264778,_0x378449){return db[_0xd90c('0x17')][_0xd90c('0x18')]({'raw':_0x3e645b['options']?_0x3e645b['options']['raw']===undefined?!![]:![]:!![],'where':_0x3e645b['options']?_0x3e645b[_0xd90c('0x19')]['where']||null:null,'attributes':_0x3e645b[_0xd90c('0x19')]?_0x3e645b[_0xd90c('0x19')][_0xd90c('0x1a')]||null:null,'include':_0x3e645b[_0xd90c('0x19')]?_0x3e645b['options'][_0xd90c('0x1b')]?_[_0xd90c('0x1c')](_0x3e645b[_0xd90c('0x19')]['include'],function(_0x12cf87){return{'model':db[_0x12cf87[_0xd90c('0x1d')]],'as':_0x12cf87['as'],'attributes':_0x12cf87[_0xd90c('0x1a')],'include':_0x12cf87['include']?_['map'](_0x12cf87['include'],function(_0x437288){return{'model':db[_0x437288['model']],'as':_0x437288['as'],'attributes':_0x437288['attributes'],'include':_0x437288[_0xd90c('0x1b')]?_[_0xd90c('0x1c')](_0x437288[_0xd90c('0x1b')],function(_0x479213){return{'model':db[_0x479213['model']],'as':_0x479213['as'],'attributes':_0x479213['attributes']};}):[]};}):[]};}):[]:[]})[_0xd90c('0xd')](function(_0x1575aa){logger[_0xd90c('0xe')](_0xd90c('0x1e'),_0x3e645b);logger[_0xd90c('0x10')](_0xd90c('0x1e'),_0x3e645b,JSON[_0xd90c('0x12')](_0x1575aa));_0x264778(_0x1575aa);})[_0xd90c('0x16')](function(_0x4e4b2c){logger[_0xd90c('0x13')]('ShowSetting',_0x4e4b2c[_0xd90c('0x14')],_0x3e645b);_0x378449(_0xde20ed[_0xd90c('0x13')](0x1f4,_0x4e4b2c[_0xd90c('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 447a9e7..0293bd6 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(_0x25a0b9,_0x86e28f){var _0x30b9ab=function(_0x883a4){while(--_0x883a4){_0x25a0b9['push'](_0x25a0b9['shift']());}};_0x30b9ab(++_0x86e28f);}(_0xe14b,0x93));var _0xbe14=function(_0x36d315,_0x5afd6d){_0x36d315=_0x36d315-0x0;var _0x2018b2=_0xe14b[_0x36d315];return _0x2018b2;};'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 _0x5fc3=['/:id','show','getDispositions','/:id/canned_answers','/:id/applications','getInteractions','/:id/status','statusGet','post','create','/:id/dispositions','addAnswer','/:id/notify','/:id/send','send','status','/:id/users','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','describe'];(function(_0x5db977,_0x3bb74a){var _0x2e2b20=function(_0x566980){while(--_0x566980){_0x5db977['push'](_0x5db977['shift']());}};_0x2e2b20(++_0x3bb74a);}(_0x5fc3,0xa8));var _0x35fc=function(_0x40b493,_0x4050de){_0x40b493=_0x40b493-0x0;var _0x548365=_0x5fc3[_0x40b493];return _0x548365;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/dispositions',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getAnswers']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getApplications']);router[_0x35fc('0x9')]('/:id/interactions',auth[_0x35fc('0xa')](),controller[_0x35fc('0x11')]);router[_0x35fc('0x9')](_0x35fc('0x12'),controller[_0x35fc('0x13')]);router['get']('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x14')]('/',auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x14')](_0x35fc('0x16'),auth[_0x35fc('0xa')](),controller['addDisposition']);router[_0x35fc('0x14')](_0x35fc('0xf'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x14')](_0x35fc('0x18'),controller['notify']);router[_0x35fc('0x14')](_0x35fc('0x10'),auth[_0x35fc('0xa')](),controller['addApplications']);router[_0x35fc('0x14')](_0x35fc('0x19'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x1a')]);router[_0x35fc('0x14')](_0x35fc('0x12'),controller[_0x35fc('0x1b')]);router[_0x35fc('0x14')](_0x35fc('0x1c'),auth[_0x35fc('0xa')](),controller['addAgents']);router[_0x35fc('0x1d')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x1e')]);router[_0x35fc('0x1f')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0x20')]);router['delete'](_0x35fc('0x16'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x21')]);router['delete'](_0x35fc('0xf'),auth['isAuthenticated'](),controller[_0x35fc('0x22')]);router[_0x35fc('0x1f')]('/:id/users',auth['isAuthenticated'](),controller[_0x35fc('0x23')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 7fae44d..ec76af7 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 _0x3a47=['randomstring','exports','STRING','name','generate','ENUM','twilio','connectel','clickatell','csc','infobip','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize'];(function(_0x4eaafe,_0x5d6567){var _0x4efb4e=function(_0x5b0d28){while(--_0x5b0d28){_0x4eaafe['push'](_0x4eaafe['shift']());}};_0x4efb4e(++_0x5d6567);}(_0x3a47,0x109));var _0x73a4=function(_0xedabc1,_0x10d534){_0xedabc1=_0xedabc1-0x0;var _0x36c4db=_0x3a47[_0xedabc1];return _0x36c4db;};'use strict';var Sequelize=require(_0x73a4('0x0'));var rs=require(_0x73a4('0x1'));module[_0x73a4('0x2')]={'name':{'type':Sequelize[_0x73a4('0x3')],'unique':_0x73a4('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x73a4('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x73a4('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x73a4('0x3')],'defaultValue':function(){return rs[_0x73a4('0x5')]();}},'phone':{'type':Sequelize[_0x73a4('0x3')]},'type':{'type':Sequelize[_0x73a4('0x6')](_0x73a4('0x7'),'skebby',_0x73a4('0x8'),'clicksend','plivo',_0x73a4('0x9'),'bandwidth',_0x73a4('0xa'),_0x73a4('0xb'),'intelepeer')},'accountSid':{'type':Sequelize[_0x73a4('0x3')]},'authId':{'type':Sequelize[_0x73a4('0x3')]},'authToken':{'type':Sequelize[_0x73a4('0x3')]},'smsMethod':{'type':Sequelize[_0x73a4('0x6')]('SI','TI','GP')},'username':{'type':Sequelize[_0x73a4('0x3')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0x73a4('0x3')]},'applicationId':{'type':Sequelize[_0x73a4('0x3')]},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0x73a4('0x3')]},'deliveryReport':{'type':Sequelize[_0x73a4('0xc')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x73a4('0xd')],'defaultValue':function(){return _0x73a4('0xe');}},'notificationSound':{'type':Sequelize[_0x73a4('0xc')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x73a4('0xc')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x73a4('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x73a4('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x73a4('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x73a4('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x73a4('0xc')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2f9948){if(!_0x2f9948)this[_0x73a4('0x10')](_0x73a4('0x11'),null);this['setDataValue'](_0x73a4('0x12'),_0x2f9948);}}}; \ No newline at end of file +var _0x00ce=['infobip','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','exports','STRING','name','ENUM','twilio','skebby','plivo','clickatell','csc'];(function(_0x2d0ddd,_0x1b9b91){var _0x27db88=function(_0x139eed){while(--_0x139eed){_0x2d0ddd['push'](_0x2d0ddd['shift']());}};_0x27db88(++_0x1b9b91);}(_0x00ce,0x1d5));var _0xe00c=function(_0x324ac2,_0x549f01){_0x324ac2=_0x324ac2-0x0;var _0x48e30c=_0x00ce[_0x324ac2];return _0x48e30c;};'use strict';var Sequelize=require(_0xe00c('0x0'));var rs=require(_0xe00c('0x1'));module[_0xe00c('0x2')]={'name':{'type':Sequelize[_0xe00c('0x3')],'unique':_0xe00c('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0xe00c('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xe00c('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xe00c('0x5')](_0xe00c('0x6'),_0xe00c('0x7'),'connectel','clicksend',_0xe00c('0x8'),_0xe00c('0x9'),'bandwidth',_0xe00c('0xa'),_0xe00c('0xb'),_0xe00c('0xc'))},'accountSid':{'type':Sequelize[_0xe00c('0x3')]},'authId':{'type':Sequelize[_0xe00c('0x3')]},'authToken':{'type':Sequelize[_0xe00c('0x3')]},'smsMethod':{'type':Sequelize[_0xe00c('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0xe00c('0x3')]},'password':{'type':Sequelize[_0xe00c('0x3')]},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize[_0xe00c('0x3')]},'accountId':{'type':Sequelize[_0xe00c('0x3')]},'senderString':{'type':Sequelize[_0xe00c('0x3')]},'deliveryReport':{'type':Sequelize[_0xe00c('0xd')],'defaultValue':![]},'description':{'type':Sequelize[_0xe00c('0x3')]},'notificationTemplate':{'type':Sequelize[_0xe00c('0xe')],'defaultValue':function(){return _0xe00c('0xf');}},'notificationSound':{'type':Sequelize[_0xe00c('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xe00c('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xe00c('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xe00c('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xe00c('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe00c('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe00c('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xe00c('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe00c('0x10')],'comment':_0xe00c('0x11')},'mandatoryDisposition':{'type':Sequelize[_0xe00c('0xd')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x28b8ed){if(!_0x28b8ed)this[_0xe00c('0x12')](_0xe00c('0x13'),null);this['setDataValue']('mandatoryDisposition',_0x28b8ed);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 16f06bf..0f212f3 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 _0x0840=['name','send','index','Pause','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','VIRTUAL','SmsAccount','includeAll','include','findAll','rows','params','mandatoryDispositionPause','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsAccounts','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','order','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','notify','sms','account','applications','orderBy','Applications','priority','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','mobile','from','From','Body','MessageSid','skebby','sender','text','connectel','messageId','plivo','Text','MessageUUID','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','refid','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','omit','SmsInteraction','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','User','unshift','Start','startRouting','receiveMessage','entity\x20found','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','text/xml','\x0a','addApplications','sequelize','transaction','READ_COMMITTED','SmsApplication','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','ListId','out','Messages','spread','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','clicksend','message_id','status_code','infobip','groupName','intelepeer','redif','error_code','DELIVERED','DELIVERED_TO_GATEWAY','message-delivered','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','http','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','get','UserProfileResource','stack'];(function(_0x2c96f6,_0x877207){var _0x6d4808=function(_0x567e0c){while(--_0x567e0c){_0x2c96f6['push'](_0x2c96f6['shift']());}};_0x6d4808(++_0x877207);}(_0x0840,0xb0));var _0x0084=function(_0x51beba,_0x202d19){_0x51beba=_0x51beba-0x0;var _0x167ee0=_0x0840[_0x51beba];return _0x167ee0;};'use strict';var emlformat=require(_0x0084('0x0'));var rimraf=require(_0x0084('0x1'));var zipdir=require(_0x0084('0x2'));var jsonpatch=require(_0x0084('0x3'));var rp=require(_0x0084('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0084('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x0084('0x6'));var ejs=require(_0x0084('0x7'));var fs=require('fs');var fs_extra=require(_0x0084('0x8'));var _=require('lodash');var squel=require(_0x0084('0x9'));var crypto=require(_0x0084('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x0084('0xb'));var toCsv=require(_0x0084('0x6'));var querystring=require('querystring');var Papa=require(_0x0084('0xc'));var Redis=require('ioredis');var authService=require(_0x0084('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0084('0xe'))(_0x0084('0xf'));var utils=require(_0x0084('0x10'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0084('0x11'))['db'];config[_0x0084('0x12')]=_[_0x0084('0x13')](config['redis'],{'host':_0x0084('0x14'),'port':0x18eb});var socket=require(_0x0084('0x15'))(new Redis(config[_0x0084('0x12')]));require('./smsAccount.socket')[_0x0084('0x16')](socket);var jayson=require(_0x0084('0x17'));var client=jayson['client'][_0x0084('0x18')]({'port':0x232c});function respondWithRpcPromise(_0x47439c,_0x5bf211,_0x28f2f1,_0x4da231){return new BPromise(function(_0x5a5411,_0x57b750){var _0x33d7ae=_0x4da231||client;return _0x33d7ae['request'](_0x47439c,_0x28f2f1)[_0x0084('0x19')](function(_0x5f07cb){logger[_0x0084('0x1a')](_0x0084('0x1b'),_0x5bf211,_0x0084('0x1c'));logger['debug'](_0x0084('0x1d'),_0x5bf211,_0x0084('0x1c'),JSON[_0x0084('0x1e')](_0x5f07cb));if(_0x5f07cb['error']){if(_0x5f07cb['error'][_0x0084('0x1f')]===0x1f4){logger[_0x0084('0x20')](_0x0084('0x1b'),_0x5bf211,_0x5f07cb['error'][_0x0084('0x21')]);return _0x57b750(_0x5f07cb['error'][_0x0084('0x21')]);}logger[_0x0084('0x20')](_0x0084('0x1b'),_0x5bf211,_0x5f07cb[_0x0084('0x20')][_0x0084('0x21')]);return _0x5a5411(_0x5f07cb['error'][_0x0084('0x21')]);}else{logger[_0x0084('0x1a')]('SmsAccount,\x20%s,\x20%s',_0x5bf211,'request\x20sent');_0x5a5411(_0x5f07cb[_0x0084('0x22')][_0x0084('0x21')]);}})[_0x0084('0x23')](function(_0x3b9ccc){logger[_0x0084('0x20')](_0x0084('0x1b'),_0x5bf211,_0x3b9ccc);_0x57b750(_0x3b9ccc);});});}function respondWithStatusCode(_0x43cc72,_0x1dce14){_0x1dce14=_0x1dce14||0xcc;return function(_0x5bec1c){if(_0x5bec1c){return _0x43cc72[_0x0084('0x24')](_0x1dce14);}return _0x43cc72[_0x0084('0x25')](_0x1dce14)[_0x0084('0x26')]();};}function respondWithResult(_0x433b31,_0x5a0e4b){_0x5a0e4b=_0x5a0e4b||0xc8;return function(_0x37a10f){if(_0x37a10f){return _0x433b31[_0x0084('0x25')](_0x5a0e4b)[_0x0084('0x27')](_0x37a10f);}};}function respondWithFilteredResult(_0x5134d7,_0x37fb1f){return function(_0x30a41e){if(_0x30a41e){var _0x3d26f5=typeof _0x37fb1f[_0x0084('0x28')]===_0x0084('0x29')&&typeof _0x37fb1f[_0x0084('0x2a')]===_0x0084('0x29');var _0x2ce154=_0x30a41e[_0x0084('0x2b')];var _0x306feb=_0x3d26f5?0x0:_0x37fb1f[_0x0084('0x28')];var _0x1d2369=_0x3d26f5?_0x30a41e['count']:_0x37fb1f[_0x0084('0x28')]+_0x37fb1f[_0x0084('0x2a')];var _0x2fd447;if(_0x1d2369>=_0x2ce154){_0x1d2369=_0x2ce154;_0x2fd447=0xc8;}else{_0x2fd447=0xce;}_0x5134d7[_0x0084('0x25')](_0x2fd447);return _0x5134d7[_0x0084('0x2c')](_0x0084('0x2d'),_0x306feb+'-'+_0x1d2369+'/'+_0x2ce154)['json'](_0x30a41e);}return null;};}function patchUpdates(_0x13bc08){return function(_0x13dba0){try{jsonpatch['apply'](_0x13dba0,_0x13bc08,!![]);}catch(_0x51b684){return BPromise[_0x0084('0x2e')](_0x51b684);}return _0x13dba0[_0x0084('0x2f')]();};}function saveUpdates(_0x293802,_0x35e9cb){return function(_0x1233bd){if(_0x1233bd){return _0x1233bd[_0x0084('0x30')](_0x293802)['then'](function(_0x12a1f5){return _0x12a1f5;});}return null;};}function removeEntity(_0x3b3014,_0x495c3a){return function(_0x572ac2){if(_0x572ac2){return _0x572ac2[_0x0084('0x31')]()['then'](function(){var _0x14ebe8=_0x572ac2[_0x0084('0x32')]({'plain':!![]});var _0x2d5f8f='SmsAccounts';return db[_0x0084('0x33')][_0x0084('0x31')]({'where':{'type':_0x2d5f8f,'resourceId':_0x14ebe8['id']}})[_0x0084('0x19')](function(){return _0x572ac2;});})[_0x0084('0x19')](function(){_0x3b3014[_0x0084('0x25')](0xcc)[_0x0084('0x26')]();});}};}function handleEntityNotFound(_0x2db9d7,_0x50a030){return function(_0x4cd23c){if(!_0x4cd23c){_0x2db9d7[_0x0084('0x24')](0x194);}return _0x4cd23c;};}function handleError(_0x35d748,_0x5b48cd){_0x5b48cd=_0x5b48cd||0x1f4;return function(_0x24fafe){logger['error'](_0x24fafe[_0x0084('0x34')]);if(_0x24fafe[_0x0084('0x35')]){delete _0x24fafe[_0x0084('0x35')];}_0x35d748['status'](_0x5b48cd)[_0x0084('0x36')](_0x24fafe);};}exports[_0x0084('0x37')]=function(_0x4ddfbe,_0xb263d6){var _0x1d2cc4={'include':[{'model':db[_0x0084('0x38')],'as':'mandatoryDispositionPause'}]},_0x3b355a={},_0x4ed38d={'count':0x0,'rows':[]};var _0x4cf434=_['map'](db['SmsAccount'][_0x0084('0x39')],function(_0x3c4d94){return{'name':_0x3c4d94[_0x0084('0x3a')],'type':_0x3c4d94['type'][_0x0084('0x3b')]};});_0x3b355a['model']=_['map'](_0x4cf434,'name');_0x3b355a[_0x0084('0x3c')]=_[_0x0084('0x3d')](_0x4ddfbe['query']);_0x3b355a[_0x0084('0x3e')]=_[_0x0084('0x3f')](_0x3b355a[_0x0084('0x40')],_0x3b355a['query']);_0x1d2cc4[_0x0084('0x41')]=_[_0x0084('0x3f')](_0x3b355a[_0x0084('0x40')],qs[_0x0084('0x42')](_0x4ddfbe[_0x0084('0x3c')]['fields']));_0x1d2cc4[_0x0084('0x41')]=_0x1d2cc4[_0x0084('0x41')][_0x0084('0x43')]?_0x1d2cc4[_0x0084('0x41')]:_0x3b355a['model'];if(!_0x4ddfbe['query'][_0x0084('0x44')](_0x0084('0x45'))){_0x1d2cc4[_0x0084('0x2a')]=qs[_0x0084('0x2a')](_0x4ddfbe[_0x0084('0x3c')][_0x0084('0x2a')]);_0x1d2cc4['offset']=qs[_0x0084('0x28')](_0x4ddfbe[_0x0084('0x3c')]['offset']);}_0x1d2cc4['order']=qs[_0x0084('0x46')](_0x4ddfbe['query']['sort']);_0x1d2cc4[_0x0084('0x47')]=qs[_0x0084('0x3e')](_[_0x0084('0x48')](_0x4ddfbe[_0x0084('0x3c')],_0x3b355a[_0x0084('0x3e')]),_0x4cf434);if(_0x4ddfbe['query'][_0x0084('0x49')]){_0x1d2cc4[_0x0084('0x47')]=_[_0x0084('0x4a')](_0x1d2cc4[_0x0084('0x47')],{'$or':_[_0x0084('0x4b')](_0x4cf434,function(_0xf611c7){if(_0xf611c7[_0x0084('0x4c')]!==_0x0084('0x4d')){var _0x1f0f02={};_0x1f0f02[_0xf611c7[_0x0084('0x35')]]={'$like':'%'+_0x4ddfbe[_0x0084('0x3c')][_0x0084('0x49')]+'%'};return _0x1f0f02;}})});}_0x1d2cc4=_[_0x0084('0x4a')]({},_0x1d2cc4,_0x4ddfbe['options']);var _0x6e28f1={'where':_0x1d2cc4['where']};return db[_0x0084('0x4e')][_0x0084('0x2b')](_0x6e28f1)[_0x0084('0x19')](function(_0x458524){_0x4ed38d[_0x0084('0x2b')]=_0x458524;if(_0x4ddfbe[_0x0084('0x3c')][_0x0084('0x4f')]){_0x1d2cc4[_0x0084('0x50')]=[{'all':!![]}];}return db['SmsAccount'][_0x0084('0x51')](_0x1d2cc4);})[_0x0084('0x19')](function(_0x5c3d1f){_0x4ed38d[_0x0084('0x52')]=_0x5c3d1f;return _0x4ed38d;})['then'](respondWithFilteredResult(_0xb263d6,_0x1d2cc4))[_0x0084('0x23')](handleError(_0xb263d6,null));};exports['show']=function(_0x4e8e9e,_0x45a0fb){var _0x37f6e5={'raw':![],'where':{'id':_0x4e8e9e[_0x0084('0x53')]['id']},'include':[{'model':db[_0x0084('0x38')],'as':_0x0084('0x54')}]},_0x504b70={};_0x504b70[_0x0084('0x40')]=_[_0x0084('0x3d')](db[_0x0084('0x4e')][_0x0084('0x39')]);_0x504b70['query']=_[_0x0084('0x3d')](_0x4e8e9e['query']);_0x504b70['filters']=_[_0x0084('0x3f')](_0x504b70[_0x0084('0x40')],_0x504b70[_0x0084('0x3c')]);_0x37f6e5['attributes']=_[_0x0084('0x3f')](_0x504b70[_0x0084('0x40')],qs['fields'](_0x4e8e9e[_0x0084('0x3c')]['fields']));_0x37f6e5['attributes']=_0x37f6e5[_0x0084('0x41')][_0x0084('0x43')]?_0x37f6e5[_0x0084('0x41')]:_0x504b70[_0x0084('0x40')];if(_0x4e8e9e[_0x0084('0x3c')][_0x0084('0x4f')]){_0x37f6e5['include']=[{'all':!![]}];}_0x37f6e5=_['merge']({},_0x37f6e5,_0x4e8e9e[_0x0084('0x55')]);return db[_0x0084('0x4e')][_0x0084('0x56')](_0x37f6e5)[_0x0084('0x19')](handleEntityNotFound(_0x45a0fb,null))['then'](respondWithResult(_0x45a0fb,null))[_0x0084('0x23')](handleError(_0x45a0fb,null));};exports[_0x0084('0x57')]=function(_0x799eff,_0x451d4b){return db[_0x0084('0x4e')][_0x0084('0x57')](_0x799eff[_0x0084('0x58')],{})['then'](function(_0x321283){var _0x336a7f=_0x799eff[_0x0084('0x59')]['get']({'plain':!![]});if(!_0x336a7f)throw new Error(_0x0084('0x5a'));if(_0x336a7f[_0x0084('0x5b')]===_0x0084('0x59')){var _0x540b37=_0x321283['get']({'plain':!![]});var _0x422dc7=_0x0084('0x5c');return db[_0x0084('0x5d')][_0x0084('0x56')]({'where':{'name':_0x422dc7,'userProfileId':_0x336a7f['userProfileId']},'raw':!![]})[_0x0084('0x19')](function(_0x443328){if(_0x443328&&_0x443328[_0x0084('0x5e')]===0x0){return db['UserProfileResource'][_0x0084('0x57')]({'name':_0x540b37[_0x0084('0x35')],'resourceId':_0x540b37['id'],'type':_0x443328[_0x0084('0x35')],'sectionId':_0x443328['id']},{})[_0x0084('0x19')](function(){return _0x321283;});}else{return _0x321283;}})['catch'](function(_0x5d24ce){logger[_0x0084('0x20')](_0x0084('0x5f'),_0x5d24ce);throw _0x5d24ce;});}return _0x321283;})[_0x0084('0x19')](respondWithResult(_0x451d4b,0xc9))[_0x0084('0x23')](handleError(_0x451d4b,null));};exports['update']=function(_0x2954cc,_0x5e4e1d){if(_0x2954cc[_0x0084('0x58')]['id']){delete _0x2954cc['body']['id'];}return db[_0x0084('0x4e')][_0x0084('0x56')]({'where':{'id':_0x2954cc[_0x0084('0x53')]['id']},'include':[{'model':db['Pause'],'as':_0x0084('0x54')}]})[_0x0084('0x19')](handleEntityNotFound(_0x5e4e1d,null))[_0x0084('0x19')](saveUpdates(_0x2954cc[_0x0084('0x58')],null))[_0x0084('0x19')](respondWithResult(_0x5e4e1d,null))[_0x0084('0x23')](handleError(_0x5e4e1d,null));};exports['destroy']=function(_0x304f7a,_0x5de056){return db['SmsAccount'][_0x0084('0x56')]({'where':{'id':_0x304f7a[_0x0084('0x53')]['id']}})['then'](handleEntityNotFound(_0x5de056,null))['then'](removeEntity(_0x5de056,null))['catch'](handleError(_0x5de056,null));};exports[_0x0084('0x60')]=function(_0x10e78a,_0x24ab30){return db['SmsAccount'][_0x0084('0x60')]()['then'](respondWithResult(_0x24ab30,null))[_0x0084('0x23')](handleError(_0x24ab30,null));};exports[_0x0084('0x61')]=function(_0x24aeba,_0x45134a,_0xb9b134){if(_0x24aeba[_0x0084('0x58')]['id']){delete _0x24aeba[_0x0084('0x58')]['id'];}return db[_0x0084('0x4e')][_0x0084('0x56')]({'where':{'id':_0x24aeba[_0x0084('0x53')]['id']}})[_0x0084('0x19')](handleEntityNotFound(_0x45134a,null))[_0x0084('0x19')](function(_0x328a26){if(_0x328a26){_0x24aeba['body'][_0x0084('0x62')]=_0x328a26['id'];return db[_0x0084('0x63')][_0x0084('0x57')](_0x24aeba['body']);}})[_0x0084('0x19')](respondWithResult(_0x45134a,null))[_0x0084('0x23')](handleError(_0x45134a,null));};exports[_0x0084('0x64')]=function(_0x26670d,_0x2f6d3e,_0x16414c){var _0x2604d3={'raw':![],'where':{}};var _0x1e2467={};var _0x3689bd={'count':0x0,'rows':[]};return db[_0x0084('0x4e')][_0x0084('0x65')]({'where':{'id':_0x26670d[_0x0084('0x53')]['id']}})[_0x0084('0x19')](handleEntityNotFound(_0x2f6d3e,null))[_0x0084('0x19')](function(_0xc6cf16){if(_0xc6cf16){_0x1e2467[_0x0084('0x40')]=_[_0x0084('0x3d')](db['Disposition'][_0x0084('0x39')]);_0x1e2467[_0x0084('0x3c')]=_['keys'](_0x26670d[_0x0084('0x3c')]);_0x1e2467['filters']=_[_0x0084('0x3f')](_0x1e2467['model'],_0x1e2467[_0x0084('0x3c')]);_0x2604d3['attributes']=_['intersection'](_0x1e2467[_0x0084('0x40')],qs[_0x0084('0x42')](_0x26670d[_0x0084('0x3c')][_0x0084('0x42')]));_0x2604d3[_0x0084('0x41')]=_0x2604d3['attributes'][_0x0084('0x43')]?_0x2604d3['attributes']:_0x1e2467['model'];if(!_0x26670d['query'][_0x0084('0x44')]('nolimit')){_0x2604d3[_0x0084('0x2a')]=qs['limit'](_0x26670d[_0x0084('0x3c')]['limit']);_0x2604d3['offset']=qs[_0x0084('0x28')](_0x26670d[_0x0084('0x3c')][_0x0084('0x28')]);}_0x2604d3[_0x0084('0x66')]=qs[_0x0084('0x46')](_0x26670d[_0x0084('0x3c')][_0x0084('0x46')]);_0x2604d3[_0x0084('0x47')]=qs[_0x0084('0x3e')](_[_0x0084('0x48')](_0x26670d[_0x0084('0x3c')],_0x1e2467[_0x0084('0x3e')]));_0x2604d3[_0x0084('0x47')][_0x0084('0x62')]=_0xc6cf16['id'];if(_0x26670d[_0x0084('0x3c')][_0x0084('0x49')]){_0x2604d3[_0x0084('0x47')]=_['merge'](_0x2604d3[_0x0084('0x47')],{'$or':_[_0x0084('0x4b')](_0x2604d3[_0x0084('0x41')],function(_0x1238e9){var _0x4c6102={};_0x4c6102[_0x1238e9]={'$like':'%'+_0x26670d[_0x0084('0x3c')][_0x0084('0x49')]+'%'};return _0x4c6102;})});}_0x2604d3=_[_0x0084('0x4a')]({},_0x2604d3,_0x26670d[_0x0084('0x55')]);return db['Disposition'][_0x0084('0x2b')]({'where':_0x2604d3[_0x0084('0x47')]})[_0x0084('0x19')](function(_0x108cd0){_0x3689bd[_0x0084('0x2b')]=_0x108cd0;if(_0x26670d[_0x0084('0x3c')][_0x0084('0x4f')]){_0x2604d3[_0x0084('0x50')]=[{'all':!![]}];}return db[_0x0084('0x63')][_0x0084('0x51')](_0x2604d3);})[_0x0084('0x19')](function(_0x2d52a5){_0x3689bd[_0x0084('0x52')]=_0x2d52a5;return _0x3689bd;});}})[_0x0084('0x19')](respondWithFilteredResult(_0x2f6d3e,_0x2604d3))[_0x0084('0x23')](handleError(_0x2f6d3e,null));};exports[_0x0084('0x67')]=function(_0x31b6f2,_0x214747,_0x1c7e3b){return db[_0x0084('0x4e')][_0x0084('0x56')]({'where':{'id':_0x31b6f2[_0x0084('0x53')]['id']}})[_0x0084('0x19')](handleEntityNotFound(_0x214747,null))['then'](function(_0x20ef6f){if(_0x20ef6f){return _0x20ef6f[_0x0084('0x67')](_0x31b6f2['query'][_0x0084('0x68')]);}})[_0x0084('0x19')](respondWithStatusCode(_0x214747,null))['catch'](handleError(_0x214747,null));};exports['addAnswer']=function(_0x5b06e4,_0x4f0e52,_0x56348e){if(_0x5b06e4[_0x0084('0x58')]['id']){delete _0x5b06e4[_0x0084('0x58')]['id'];}return db[_0x0084('0x4e')][_0x0084('0x56')]({'where':{'id':_0x5b06e4[_0x0084('0x53')]['id']}})[_0x0084('0x19')](handleEntityNotFound(_0x4f0e52,null))[_0x0084('0x19')](function(_0xa5db05){if(_0xa5db05){_0x5b06e4[_0x0084('0x58')]['SmsAccountId']=_0xa5db05['id'];return db[_0x0084('0x69')][_0x0084('0x57')](_0x5b06e4[_0x0084('0x58')]);}})[_0x0084('0x19')](respondWithResult(_0x4f0e52,null))[_0x0084('0x23')](handleError(_0x4f0e52,null));};exports[_0x0084('0x6a')]=function(_0x20c13f,_0x196d5e,_0x5c8ba6){var _0x4e137b={'raw':![],'where':{}};var _0x3a38f9={};var _0x407d44={'count':0x0,'rows':[]};return db[_0x0084('0x4e')][_0x0084('0x65')]({'where':{'id':_0x20c13f['params']['id']}})[_0x0084('0x19')](handleEntityNotFound(_0x196d5e,null))[_0x0084('0x19')](function(_0x16f8a7){if(_0x16f8a7){_0x3a38f9[_0x0084('0x40')]=_['keys'](db[_0x0084('0x69')]['rawAttributes']);_0x3a38f9['query']=_['keys'](_0x20c13f[_0x0084('0x3c')]);_0x3a38f9[_0x0084('0x3e')]=_[_0x0084('0x3f')](_0x3a38f9[_0x0084('0x40')],_0x3a38f9[_0x0084('0x3c')]);_0x4e137b[_0x0084('0x41')]=_[_0x0084('0x3f')](_0x3a38f9[_0x0084('0x40')],qs['fields'](_0x20c13f[_0x0084('0x3c')][_0x0084('0x42')]));_0x4e137b['attributes']=_0x4e137b[_0x0084('0x41')][_0x0084('0x43')]?_0x4e137b[_0x0084('0x41')]:_0x3a38f9[_0x0084('0x40')];if(!_0x20c13f[_0x0084('0x3c')][_0x0084('0x44')]('nolimit')){_0x4e137b['limit']=qs[_0x0084('0x2a')](_0x20c13f[_0x0084('0x3c')][_0x0084('0x2a')]);_0x4e137b[_0x0084('0x28')]=qs[_0x0084('0x28')](_0x20c13f[_0x0084('0x3c')][_0x0084('0x28')]);}_0x4e137b[_0x0084('0x66')]=qs['sort'](_0x20c13f[_0x0084('0x3c')]['sort']);_0x4e137b[_0x0084('0x47')]=qs['filters'](_['pick'](_0x20c13f[_0x0084('0x3c')],_0x3a38f9[_0x0084('0x3e')]));_0x4e137b[_0x0084('0x47')][_0x0084('0x62')]=_0x16f8a7['id'];if(_0x20c13f[_0x0084('0x3c')][_0x0084('0x49')]){_0x4e137b[_0x0084('0x47')]=_[_0x0084('0x4a')](_0x4e137b[_0x0084('0x47')],{'$or':_[_0x0084('0x4b')](_0x4e137b['attributes'],function(_0x44475f){var _0x3ddd72={};_0x3ddd72[_0x44475f]={'$like':'%'+_0x20c13f['query']['filter']+'%'};return _0x3ddd72;})});}_0x4e137b=_['merge']({},_0x4e137b,_0x20c13f[_0x0084('0x55')]);return db[_0x0084('0x69')]['count']({'where':_0x4e137b[_0x0084('0x47')]})[_0x0084('0x19')](function(_0x94f305){_0x407d44[_0x0084('0x2b')]=_0x94f305;if(_0x20c13f[_0x0084('0x3c')][_0x0084('0x4f')]){_0x4e137b[_0x0084('0x50')]=[{'all':!![]}];}return db[_0x0084('0x69')][_0x0084('0x51')](_0x4e137b);})[_0x0084('0x19')](function(_0xe4d45e){_0x407d44[_0x0084('0x52')]=_0xe4d45e;return _0x407d44;});}})[_0x0084('0x19')](respondWithFilteredResult(_0x196d5e,_0x4e137b))[_0x0084('0x23')](handleError(_0x196d5e,null));};exports[_0x0084('0x6b')]=function(_0xc35a7b,_0x4e0a17,_0xea438f){return db[_0x0084('0x4e')][_0x0084('0x56')]({'where':{'id':_0xc35a7b[_0x0084('0x53')]['id']}})['then'](handleEntityNotFound(_0x4e0a17,null))[_0x0084('0x19')](function(_0x33c174){if(_0x33c174){return _0x33c174[_0x0084('0x6b')](_0xc35a7b[_0x0084('0x3c')][_0x0084('0x68')]);}})[_0x0084('0x19')](respondWithStatusCode(_0x4e0a17,null))[_0x0084('0x23')](handleError(_0x4e0a17,null));};exports[_0x0084('0x6c')]=function(_0x3d6c39,_0x59d926,_0x21c970){var _0x291ebb={'channel':_0x0084('0x6d')};var _0x44ce64=[];var _0x53abdc=[];var _0x53b834={};return db['SmsAccount']['find']({'where':{'id':_0x3d6c39[_0x0084('0x53')]['id']},'include':[{'model':db['SmsApplication'],'as':'Applications'}]})[_0x0084('0x19')](handleEntityNotFound(_0x59d926,null))[_0x0084('0x19')](function(_0x18b947){_0x291ebb[_0x0084('0x6e')]=_0x18b947;_0x291ebb[_0x0084('0x6f')]=_[_0x0084('0x70')](_0x18b947[_0x0084('0x71')],[_0x0084('0x72')],[_0x0084('0x73')]);if(_0x291ebb[_0x0084('0x6e')][_0x0084('0x71')]){delete _0x291ebb[_0x0084('0x6e')][_0x0084('0x71')];}return db[_0x0084('0x74')][_0x0084('0x60')]();})[_0x0084('0x19')](function(_0x451bd1){if(!_0x451bd1){throw new db[(_0x0084('0x75'))][(_0x0084('0x76'))](_0x0084('0x77'));}_0x44ce64=_[_0x0084('0x78')](_['keys'](_0x451bd1),['createdAt','updatedAt']);_0x53abdc=_[_0x0084('0x78')](_['keys'](_0x451bd1),[_0x0084('0x79'),_0x0084('0x7a'),_0x0084('0x7b'),'ListId']);_0x291ebb[_0x0084('0x58')]={'mapKey':_0x0084('0x7c')};if(_0x291ebb[_0x0084('0x6e')][_0x0084('0x4c')]){switch(_0x291ebb[_0x0084('0x6e')]['type']){case'twilio':_0x291ebb[_0x0084('0x58')][_0x0084('0x7d')]=_0x3d6c39[_0x0084('0x58')][_0x0084('0x7e')];_0x291ebb['body']['body']=_0x3d6c39[_0x0084('0x58')][_0x0084('0x7f')];_0x291ebb[_0x0084('0x58')]['messageId']=_0x3d6c39['body'][_0x0084('0x80')];break;case _0x0084('0x81'):_0x291ebb['body'][_0x0084('0x7d')]='+'+_0x3d6c39[_0x0084('0x58')][_0x0084('0x82')];_0x291ebb[_0x0084('0x58')]['body']=_0x3d6c39[_0x0084('0x58')][_0x0084('0x83')];break;case _0x0084('0x84'):_0x291ebb[_0x0084('0x58')][_0x0084('0x7d')]=_0x3d6c39['body'][_0x0084('0x7d')];_0x291ebb[_0x0084('0x58')][_0x0084('0x58')]=_0x3d6c39['body'][_0x0084('0x21')];break;case'clicksend':_0x291ebb[_0x0084('0x58')][_0x0084('0x7d')]=_0x3d6c39['body'][_0x0084('0x7d')];_0x291ebb[_0x0084('0x58')][_0x0084('0x58')]=_0x3d6c39[_0x0084('0x58')][_0x0084('0x58')];_0x291ebb[_0x0084('0x58')][_0x0084('0x85')]=_0x3d6c39[_0x0084('0x58')]['message_id'];break;case _0x0084('0x86'):_0x291ebb['body']['from']=_0x3d6c39[_0x0084('0x58')][_0x0084('0x7e')];_0x291ebb[_0x0084('0x58')]['body']=_0x3d6c39[_0x0084('0x58')][_0x0084('0x87')];_0x291ebb[_0x0084('0x58')][_0x0084('0x85')]=_0x3d6c39[_0x0084('0x58')][_0x0084('0x88')];break;case'infobip':_0x291ebb[_0x0084('0x58')]['from']='+'+_0x3d6c39[_0x0084('0x58')][_0x0084('0x89')][0x0][_0x0084('0x7d')];_0x291ebb[_0x0084('0x58')][_0x0084('0x58')]=_0x3d6c39['body'][_0x0084('0x89')][0x0][_0x0084('0x83')];_0x291ebb[_0x0084('0x58')][_0x0084('0x85')]=_0x3d6c39[_0x0084('0x58')]['results'][0x0][_0x0084('0x85')];break;case _0x0084('0x8a'):_0x291ebb['body'][_0x0084('0x7d')]=_0x3d6c39[_0x0084('0x58')][_0x0084('0x8b')];_0x291ebb[_0x0084('0x58')][_0x0084('0x58')]=_0x3d6c39[_0x0084('0x58')][_0x0084('0x8c')][_0x0084('0x21')];break;case _0x0084('0x8d'):_0x291ebb[_0x0084('0x58')][_0x0084('0x7d')]=_0x3d6c39[_0x0084('0x58')][_0x0084('0x8e')];_0x291ebb[_0x0084('0x58')][_0x0084('0x58')]=_0x3d6c39[_0x0084('0x58')][_0x0084('0x83')];_0x291ebb[_0x0084('0x58')][_0x0084('0x85')]=_0x3d6c39[_0x0084('0x58')][_0x0084('0x8f')];break;case _0x0084('0x90'):_0x291ebb[_0x0084('0x58')][_0x0084('0x85')]=_0x3d6c39[_0x0084('0x58')][0x0][_0x0084('0x21')]['id'];_0x291ebb[_0x0084('0x58')][_0x0084('0x7d')]=_0x3d6c39[_0x0084('0x58')][0x0]['message'][_0x0084('0x7d')];_0x291ebb['body']['body']=_0x3d6c39[_0x0084('0x58')][0x0][_0x0084('0x21')][_0x0084('0x83')];break;case'intelepeer':_0x291ebb[_0x0084('0x58')][_0x0084('0x7d')]=_0x3d6c39[_0x0084('0x58')][_0x0084('0x7d')];_0x291ebb[_0x0084('0x58')][_0x0084('0x58')]=_0x3d6c39[_0x0084('0x58')]['message'];_0x291ebb[_0x0084('0x58')][_0x0084('0x85')]=_0x3d6c39[_0x0084('0x58')][_0x0084('0x91')];break;}}if(_0x291ebb['body']['id']){delete _0x291ebb[_0x0084('0x58')]['id'];}if(_['isNil'](_0x291ebb[_0x0084('0x58')][_0x0084('0x7d')])){throw new db['Sequelize']['ValidationError'](_0x0084('0x92'));}if(_[_0x0084('0x93')](_0x291ebb[_0x0084('0x58')][_0x0084('0x58')])||_0x291ebb[_0x0084('0x58')][_0x0084('0x58')]===''){throw new db[(_0x0084('0x75'))][(_0x0084('0x76'))](_0x0084('0x94'));}if(_[_0x0084('0x93')](_0x291ebb['body'][_0x0084('0x95')])){throw new db[(_0x0084('0x75'))]['ValidationError'](_0x0084('0x96')+_0x53abdc);}if(!_[_0x0084('0x97')](_0x53abdc,_0x291ebb[_0x0084('0x58')]['mapKey'])){throw new db[(_0x0084('0x75'))][(_0x0084('0x76'))](_0x0084('0x98')+_0x53abdc);}_0x53b834[_0x291ebb[_0x0084('0x58')][_0x0084('0x95')]]=_0x291ebb['body'][_0x0084('0x7d')];return db[_0x0084('0x99')][_0x0084('0x56')]({'where':{'id':_0x291ebb[_0x0084('0x6e')]['ListId']},'include':[{'model':db[_0x0084('0x74')],'as':_0x0084('0x9a'),'where':_0x53b834,'limit':0x1,'order':[['updatedAt',_0x0084('0x9b')]]}]});})['then'](handleEntityNotFound(_0x59d926,null))[_0x0084('0x19')](function(_0xdc545d){if(_0xdc545d){_0x291ebb['list']=_[_0x0084('0x9c')](_0xdc545d,[_0x0084('0x9a')]);if(_0xdc545d[_0x0084('0x9a')][_0x0084('0x43')]){return _0xdc545d[_0x0084('0x9a')][0x0];}var _0x4c4f44=_[_0x0084('0x13')](_0x291ebb[_0x0084('0x58')],{'firstName':_0x291ebb['body'][_0x0084('0x7d')],'ListId':_0xdc545d['id']});_0x4c4f44[_0x291ebb[_0x0084('0x58')][_0x0084('0x95')]]=_0x291ebb[_0x0084('0x58')]['from'];return db[_0x0084('0x74')]['create'](_0x4c4f44,{'fields':_0x44ce64,'raw':!![]});}})[_0x0084('0x19')](handleEntityNotFound(_0x59d926,null))[_0x0084('0x19')](function(_0x153cce){if(_0x153cce){_0x291ebb['contact']=_0x153cce;var _0x382116={'ContactId':_0x153cce['id'],'phone':_0x291ebb['body'][_0x0084('0x7d')],'SmsAccountId':_0x3d6c39['params']['id']};var _0x16cedd={'ContactId':_0x153cce['id'],'SmsAccountId':_0x3d6c39[_0x0084('0x53')]['id'],'closed':![]};return db[_0x0084('0x9d')]['find']({'where':_0x16cedd})[_0x0084('0x19')](function(_0x2dd578){if(_0x2dd578){return[_0x2dd578,![]];}return db['SmsInteraction'][_0x0084('0x57')](_0x382116)[_0x0084('0x19')](function(_0x31e9bf){return[_0x31e9bf,!![]];});});}})['spread'](function(_0x27f0f8,_0x28196f){_0x291ebb[_0x0084('0x9e')]=_0x27f0f8[_0x0084('0x32')]({'plain':!![]});_0x291ebb[_0x0084('0x9e')][_0x0084('0x9f')]=![];if(_0x28196f){if(_0x291ebb[_0x0084('0x6e')][_0x0084('0xa0')]){_0x291ebb[_0x0084('0x6f')][_0x0084('0xa1')]({'id':0x0,'priority':_0x291ebb[_0x0084('0x6f')]['length']+0x1,'app':_0x0084('0xa2'),'appdata':_0x0084('0xa3'),'interval':_0x0084('0xa4')});}_0x291ebb[_0x0084('0x9e')][_0x0084('0x9f')]=!![];}return db[_0x0084('0xa5')][_0x0084('0x57')]({'phone':_0x291ebb[_0x0084('0x58')][_0x0084('0x7d')],'messageId':_0x291ebb[_0x0084('0x58')][_0x0084('0x85')],'body':_0x291ebb[_0x0084('0x58')][_0x0084('0x58')],'SmsAccountId':_0x3d6c39['params']['id'],'SmsInteractionId':_0x27f0f8['id'],'direction':'in','ContactId':_0x27f0f8[_0x0084('0xa6')],'AttachmentId':_0x291ebb['body'][_0x0084('0xa7')]});})[_0x0084('0x19')](function(_0xa66779){_0x291ebb[_0x0084('0x21')]=_0xa66779;if(_0x291ebb['interaction']['UserId']){return db[_0x0084('0xa8')]['find']({'attributes':['id',_0x0084('0x35')],'where':{'id':_0x291ebb[_0x0084('0x9e')]['UserId']}})[_0x0084('0x19')](function(_0x4b8e92){if(_0x4b8e92){_0x291ebb['applications'][_0x0084('0xa9')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4b8e92['name']+','+(_0x291ebb[_0x0084('0x6e')]['waitForTheAssignedAgent']||0xa),'interval':_0x0084('0xa4')});}return respondWithRpcPromise(_0x0084('0xaa'),_0x0084('0xab'),_0x291ebb);});}return respondWithRpcPromise(_0x0084('0xaa'),'startRouting',_0x291ebb);})[_0x0084('0x19')](function(_0x278bad){if(_0x278bad){var _0xc510a9=0xc8;var _0x807b55=_0x0084('0xac');logger[_0x0084('0x1a')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x807b55,_0xc510a9,_0x0084('0xad'));logger[_0x0084('0xae')](_0x0084('0xaf'),_0x807b55,_0xc510a9,_0x0084('0xad'),JSON[_0x0084('0x1e')](_0x278bad));if(_0x291ebb[_0x0084('0x6e')][_0x0084('0x4c')]===_0x0084('0xb0')){return _0x59d926[_0x0084('0x25')](_0xc510a9)[_0x0084('0x2c')]('Content-Type',_0x0084('0xb1'))[_0x0084('0x36')](_0x0084('0xb2'));}else{return _0x59d926['status'](_0xc510a9)['json'](_0x278bad);}}})[_0x0084('0x23')](handleError(_0x59d926,null));};exports[_0x0084('0xb3')]=function(_0x25115b,_0x1f1ece){var _0x395375=_0x25115b[_0x0084('0x53')]['id'];var _0x47e8e8=_0x25115b[_0x0084('0x58')];var _0x35edaf=0xc8;var _0x336a58=null;return db[_0x0084('0xb4')][_0x0084('0xb5')]({'isolationLevel':db[_0x0084('0xb4')]['Transaction']['ISOLATION_LEVELS'][_0x0084('0xb6')]},function(_0x326669){return db['SmsAccount'][_0x0084('0x65')]({'where':{'id':_0x395375},'transaction':_0x326669})['then'](function(_0x47e4a7){if(_0x47e4a7){return db[_0x0084('0xb7')][_0x0084('0x31')]({'where':{'SmsAccountId':_0x395375},'transaction':_0x326669})[_0x0084('0x19')](function(){var _0x21fc42=_['map'](_0x47e8e8,function(_0x1d7239){_0x1d7239[_0x0084('0x62')]=_0x395375;return _0x1d7239;});return db[_0x0084('0xb7')][_0x0084('0xb8')](_0x21fc42,{'transaction':_0x326669});});}else{_0x35edaf=0x194;_0x336a58=[];}});})['then'](function(){if(_0x35edaf!==0x194){return db[_0x0084('0xb7')][_0x0084('0xb9')]({'where':{'SmsAccountId':_0x395375},'order':_0x0084('0x72')})[_0x0084('0x19')](function(_0x5c5740){_0x336a58=_0x5c5740;});}})[_0x0084('0x23')](function(_0x4c2fca){_0x35edaf=0x1f4;logger[_0x0084('0x20')](_0x4c2fca[_0x0084('0x34')]);if(_0x4c2fca[_0x0084('0x35')]){delete _0x4c2fca[_0x0084('0x35')];}_0x336a58=_0x4c2fca;})['finally'](function(){if(_0x336a58===null){_0x1f1ece['sendStatus'](_0x35edaf);}else{if(_0x35edaf===0x1f4){_0x1f1ece[_0x0084('0x25')](_0x35edaf)[_0x0084('0x36')](_0x336a58);}else{_0x1f1ece[_0x0084('0x25')](_0x35edaf)['json'](_0x336a58);}}});};exports[_0x0084('0xba')]=function(_0x7bfd17,_0x1c49de,_0x5938a7){var _0x29479e={};var _0x176061={};var _0x540220;var _0x127c95;return db['SmsAccount'][_0x0084('0x65')]({'where':{'id':_0x7bfd17[_0x0084('0x53')]['id']}})[_0x0084('0x19')](handleEntityNotFound(_0x1c49de,null))[_0x0084('0x19')](function(_0x1c3dea){if(_0x1c3dea){_0x540220=_0x1c3dea;_0x176061[_0x0084('0x40')]=_[_0x0084('0x3d')](db[_0x0084('0xb7')][_0x0084('0x39')]);_0x176061['query']=_[_0x0084('0x3d')](_0x7bfd17[_0x0084('0x3c')]);_0x176061[_0x0084('0x3e')]=_['intersection'](_0x176061[_0x0084('0x40')],_0x176061['query']);_0x29479e[_0x0084('0x41')]=_[_0x0084('0x3f')](_0x176061['model'],qs[_0x0084('0x42')](_0x7bfd17[_0x0084('0x3c')][_0x0084('0x42')]));_0x29479e['attributes']=_0x29479e[_0x0084('0x41')][_0x0084('0x43')]?_0x29479e[_0x0084('0x41')]:_0x176061[_0x0084('0x40')];_0x29479e[_0x0084('0x66')]=qs['sort'](_0x7bfd17[_0x0084('0x3c')][_0x0084('0x46')]);_0x29479e[_0x0084('0x47')]=qs['filters'](_[_0x0084('0x48')](_0x7bfd17['query'],_0x176061['filters']));if(_0x7bfd17[_0x0084('0x3c')]['filter']){_0x29479e['where']=_['merge'](_0x29479e['where'],{'$or':_[_0x0084('0x4b')](_0x29479e['attributes'],function(_0x286e4f){var _0x39992b={};_0x39992b[_0x286e4f]={'$like':'%'+_0x7bfd17[_0x0084('0x3c')][_0x0084('0x49')]+'%'};return _0x39992b;})});}_0x29479e=_[_0x0084('0x4a')]({},_0x29479e,_0x7bfd17[_0x0084('0x55')]);return _0x540220[_0x0084('0xba')](_0x29479e);}})[_0x0084('0x19')](function(_0x500b49){if(_0x500b49){_0x127c95=_0x500b49['length'];if(!_0x7bfd17['query']['hasOwnProperty']('nolimit')){_0x29479e['limit']=qs[_0x0084('0x2a')](_0x7bfd17[_0x0084('0x3c')][_0x0084('0x2a')]);_0x29479e[_0x0084('0x28')]=qs[_0x0084('0x28')](_0x7bfd17[_0x0084('0x3c')][_0x0084('0x28')]);}return _0x540220[_0x0084('0xba')](_0x29479e);}})[_0x0084('0x19')](function(_0x4d77d9){if(_0x4d77d9){return _0x4d77d9?{'count':_0x127c95,'rows':_0x4d77d9}:null;}})[_0x0084('0x19')](respondWithResult(_0x1c49de,null))['catch'](handleError(_0x1c49de,null));};exports[_0x0084('0xbb')]=function(_0x13e2f3,_0x4e8e8b,_0x15c632){var _0x2089b6={'raw':![],'where':{}};var _0x4732c9={};var _0x23e5c7={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x13e2f3[_0x0084('0x53')]['id']}})['then'](handleEntityNotFound(_0x4e8e8b,null))[_0x0084('0x19')](function(_0xd5bee){if(_0xd5bee){_0x4732c9['model']=_[_0x0084('0x3d')](db['SmsInteraction'][_0x0084('0x39')]);_0x4732c9['query']=_[_0x0084('0x3d')](_0x13e2f3['query']);_0x4732c9[_0x0084('0x3e')]=_['intersection'](_0x4732c9[_0x0084('0x40')],_0x4732c9[_0x0084('0x3c')]);_0x2089b6['attributes']=_[_0x0084('0x3f')](_0x4732c9[_0x0084('0x40')],qs[_0x0084('0x42')](_0x13e2f3[_0x0084('0x3c')][_0x0084('0x42')]));_0x2089b6[_0x0084('0x41')]=_0x2089b6[_0x0084('0x41')][_0x0084('0x43')]?_0x2089b6[_0x0084('0x41')]:_0x4732c9[_0x0084('0x40')];if(!_0x13e2f3['query'][_0x0084('0x44')](_0x0084('0x45'))){_0x2089b6[_0x0084('0x2a')]=qs['limit'](_0x13e2f3[_0x0084('0x3c')][_0x0084('0x2a')]);_0x2089b6[_0x0084('0x28')]=qs[_0x0084('0x28')](_0x13e2f3[_0x0084('0x3c')][_0x0084('0x28')]);}_0x2089b6[_0x0084('0x66')]=qs['sort'](_0x13e2f3['query']['sort']);_0x2089b6[_0x0084('0x47')]=qs[_0x0084('0x3e')](_['pick'](_0x13e2f3['query'],_0x4732c9[_0x0084('0x3e')]));_0x2089b6['where']['SmsAccountId']=_0xd5bee['id'];if(_0x13e2f3['query'][_0x0084('0x49')]){_0x2089b6[_0x0084('0x47')]=_[_0x0084('0x4a')](_0x2089b6['where'],{'$or':_[_0x0084('0x4b')](_0x2089b6[_0x0084('0x41')],function(_0x24a34d){var _0x3efede={};_0x3efede[_0x24a34d]={'$like':'%'+_0x13e2f3[_0x0084('0x3c')][_0x0084('0x49')]+'%'};return _0x3efede;})});}_0x2089b6=_[_0x0084('0x4a')]({},_0x2089b6,_0x13e2f3['options']);return db[_0x0084('0x9d')][_0x0084('0x2b')]({'where':_0x2089b6[_0x0084('0x47')]})[_0x0084('0x19')](function(_0x46b24f){_0x23e5c7['count']=_0x46b24f;if(_0x13e2f3[_0x0084('0x3c')][_0x0084('0x4f')]){_0x2089b6[_0x0084('0x50')]=[{'model':db[_0x0084('0x74')],'as':_0x0084('0xbc'),'required':![]},{'model':db[_0x0084('0xa8')],'as':'Owner','attributes':['name','fullname',_0x0084('0xbd')],'required':![]},{'model':db[_0x0084('0xbe')],'as':_0x0084('0xbf'),'attributes':['id','name',_0x0084('0xc0')],'where':_0x13e2f3[_0x0084('0x3c')][_0x0084('0xc1')]?{'id':_0x13e2f3[_0x0084('0x3c')][_0x0084('0xc1')]}:undefined,'required':_0x13e2f3[_0x0084('0x3c')][_0x0084('0xc1')]?!![]:![]}];}return db[_0x0084('0x9d')][_0x0084('0x51')](_0x2089b6);})[_0x0084('0x19')](function(_0x449cc2){_0x23e5c7['rows']=_0x449cc2;return _0x23e5c7;});}})[_0x0084('0x19')](respondWithFilteredResult(_0x4e8e8b,_0x2089b6))[_0x0084('0x23')](handleError(_0x4e8e8b,null));};exports['send']=function(_0x1db0a5,_0x139567,_0x47d186){var _0x53a15d,_0x1297c8,_0x16ddb2;if(_[_0x0084('0x93')](_0x1db0a5['body'][_0x0084('0x58')])||_0x1db0a5[_0x0084('0x58')][_0x0084('0x58')]===''){throw new db[(_0x0084('0x75'))][(_0x0084('0x76'))](_0x0084('0x94'));}if(_[_0x0084('0x93')](_0x1db0a5['body']['to'])){throw new db[(_0x0084('0x75'))][(_0x0084('0x76'))](_0x0084('0xc2'));}_0x53a15d=_0x1db0a5[_0x0084('0x58')]['to'];return db[_0x0084('0x4e')][_0x0084('0x56')]({'where':{'id':_0x1db0a5['params']['id']},'include':[{'model':db['CmList'],'as':_0x0084('0xc3'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'mobile':_0x53a15d},'limit':0x1,'order':[[_0x0084('0x7a'),_0x0084('0x9b')]]}]}]})[_0x0084('0x19')](handleEntityNotFound(_0x139567,null))[_0x0084('0x19')](function(_0x51ad6a){if(_0x51ad6a&&_0x51ad6a['List']){_0x1297c8=_0x51ad6a[_0x0084('0x32')]({'plain':!![]});if(_0x1297c8[_0x0084('0xc3')]&&_0x1297c8['List'][_0x0084('0x9a')][_0x0084('0x43')]){return _0x1297c8[_0x0084('0xc3')][_0x0084('0x9a')][0x0];}return db[_0x0084('0x74')]['create'](_[_0x0084('0x13')](_0x1db0a5['body'],{'firstName':_0x53a15d,'mobile':_0x53a15d,'phone':_0x53a15d,'ListId':_0x1297c8[_0x0084('0xc4')]}));}})[_0x0084('0x19')](handleEntityNotFound(_0x139567,null))[_0x0084('0x19')](function(_0x5cbbc9){if(_0x5cbbc9){_0x16ddb2=_0x5cbbc9;return db['SmsInteraction'][_0x0084('0x56')]({'where':{'ContactId':_0x16ddb2['id'],'closed':![],'SmsAccountId':_0x1297c8['id']}})['then'](function(_0x344e23){if(_0x344e23){return[_0x344e23,![]];}return db[_0x0084('0x9d')][_0x0084('0x57')]({'UserId':_0x1db0a5[_0x0084('0x59')]['id'],'ContactId':_0x16ddb2['id'],'SmsAccountId':_0x1297c8['id'],'phone':_0x53a15d,'firstMsgDirection':_0x0084('0xc5'),'Messages':[_[_0x0084('0x4a')](_0x1db0a5[_0x0084('0x58')],{'read':![],'body':_0x1db0a5['body'][_0x0084('0x58')],'phone':_0x53a15d,'SmsAccountId':_0x1297c8['id'],'UserId':_0x1db0a5[_0x0084('0x59')]['id'],'ContactId':_0x16ddb2['id']})]},{'include':[{'model':db[_0x0084('0xa5')],'as':_0x0084('0xc6')}]})[_0x0084('0x19')](function(_0x39db05){return[_0x39db05,!![]];});});}})[_0x0084('0xc7')](function(_0x25f2f7,_0x3f5849){if(_0x3f5849){return _0x25f2f7;}return db['SmsMessage'][_0x0084('0x57')](_[_0x0084('0x4a')](_0x1db0a5[_0x0084('0x58')],{'read':![],'body':_0x1db0a5['body'][_0x0084('0x58')],'phone':_0x53a15d,'SmsAccountId':_0x1297c8['id'],'SmsInteractionId':_0x25f2f7['id'],'UserId':_0x1db0a5[_0x0084('0x59')]['id'],'ContactId':_0x16ddb2['id']}))['then'](function(_0x4b03bc){_0x25f2f7[_0x0084('0xc8')][_0x0084('0xc6')]=[];_0x25f2f7[_0x0084('0xc8')][_0x0084('0xc6')][_0x0084('0xa1')](_0x4b03bc['dataValues']);return _0x25f2f7;});})[_0x0084('0x19')](respondWithResult(_0x139567,null))[_0x0084('0x23')](handleError(_0x139567,null));};exports[_0x0084('0x25')]=function(_0x36bcdc,_0x172822,_0x4a7bca){if(_0x36bcdc['body']['id']){delete _0x36bcdc[_0x0084('0x58')]['id'];}var _0x67c06a,_0xb4d550,_0x3ed5ad;return db[_0x0084('0x4e')][_0x0084('0x56')]({'where':{'id':_0x36bcdc[_0x0084('0x53')]['id']}})[_0x0084('0x19')](handleEntityNotFound(_0x172822,null))['then'](function(_0x39e468){if(_0x39e468){_0x3ed5ad=_0x39e468;logger['debug'](_0x0084('0x1d'),_0x0084('0x25'),_0x0084('0xc9'),_0x39e468[_0x0084('0x4c')],util[_0x0084('0xca')](_0x36bcdc[_0x0084('0x58')],{'showHidden':![],'depth':null}));switch(_0x39e468[_0x0084('0x4c')]){case _0x0084('0x81'):if(_0x36bcdc[_0x0084('0x58')][_0x0084('0xcb')]&&_0x36bcdc[_0x0084('0x58')][_0x0084('0x25')]){_0xb4d550=_0x36bcdc[_0x0084('0x58')]['status'];return db['SmsMessage'][_0x0084('0x56')]({'where':{'messageId':_0x36bcdc[_0x0084('0x58')][_0x0084('0xcb')]}});}break;case _0x0084('0x84'):if(_0x36bcdc['body'][_0x0084('0xcc')]&&_0x36bcdc[_0x0084('0x58')][_0x0084('0xcd')]){_0xb4d550=_0x36bcdc[_0x0084('0x58')][_0x0084('0xcd')];return db[_0x0084('0xa5')][_0x0084('0x56')]({'where':{'messageId':_0x36bcdc[_0x0084('0x58')][_0x0084('0xcc')]}});}break;case _0x0084('0xce'):if(_0x36bcdc['body'][_0x0084('0xcf')]&&_0x36bcdc[_0x0084('0x58')][_0x0084('0xd0')]){_0xb4d550=_0x36bcdc[_0x0084('0x58')][_0x0084('0xd0')];return db[_0x0084('0xa5')]['find']({'where':{'messageId':_0x36bcdc['body'][_0x0084('0xcf')]}});}break;case _0x0084('0xd1'):var _0x31dbb8=_0x36bcdc[_0x0084('0x58')][_0x0084('0x89')][0x0];if(_0x31dbb8[_0x0084('0x85')]&&_0x31dbb8[_0x0084('0x25')][_0x0084('0xd2')]==='DELIVERED'){_0xb4d550=_0x31dbb8[_0x0084('0x25')][_0x0084('0xd2')];return db[_0x0084('0xa5')][_0x0084('0x56')]({'where':{'messageId':_0x31dbb8[_0x0084('0x85')]}});}break;case'clickatell':if(_0x36bcdc['body'][_0x0084('0x85')]&&_0x36bcdc[_0x0084('0x58')][_0x0084('0x25')]){_0xb4d550=_0x36bcdc['body'][_0x0084('0x25')];return db['SmsMessage'][_0x0084('0x56')]({'where':{'messageId':_0x36bcdc[_0x0084('0x58')][_0x0084('0x85')]}});}break;case'bandwidth':if(_0x36bcdc[_0x0084('0x58')][0x0][_0x0084('0x21')]['id']){_0xb4d550=_0x36bcdc[_0x0084('0x58')][0x0][_0x0084('0x4c')];return db[_0x0084('0xa5')]['find']({'where':{'messageId':_0x36bcdc[_0x0084('0x58')][0x0][_0x0084('0x21')]['id']}});}break;case _0x0084('0xd3'):if(_0x36bcdc[_0x0084('0x58')]['redif']&&_0x36bcdc[_0x0084('0x58')][_0x0084('0x25')]){_0xb4d550=_0x36bcdc[_0x0084('0x58')][_0x0084('0x25')];return db[_0x0084('0xa5')][_0x0084('0x56')]({'where':{'messageId':_0x36bcdc['body'][_0x0084('0xd4')]}});}break;}}})[_0x0084('0x19')](handleEntityNotFound(_0x172822,null))['then'](function(_0x597d02){if(_0x597d02){_0x67c06a=_0x597d02;switch(_0x3ed5ad[_0x0084('0x4c')]){case'skebby':if(_0xb4d550==='DELIVERED'){return _0x67c06a[_0x0084('0x30')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x0084('0x25'),_0x0084('0x81'),util[_0x0084('0xca')](_0x36bcdc[_0x0084('0x58')],{'showHidden':![],'depth':null}));}break;case _0x0084('0x84'):if(_0xb4d550==='1'){return _0x67c06a['update']({'read':!![]});}else{logger['error'](_0x0084('0x1d'),_0x0084('0x25'),_0x0084('0x81'),util['inspect'](_0x36bcdc[_0x0084('0x58')],{'showHidden':![],'depth':null}));}break;case _0x0084('0xce'):if(!_0x36bcdc[_0x0084('0x58')][_0x0084('0xd5')]&&_0xb4d550>=0xc8&&_0xb4d550<=0xce){return _0x67c06a[_0x0084('0x30')]({'read':!![]});}else{logger[_0x0084('0x20')](_0x0084('0x1d'),_0x0084('0x25'),'clicksend',util[_0x0084('0xca')](_0x36bcdc['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x534500=_0x36bcdc[_0x0084('0x58')]['results'][0x0];if(_0x534500[_0x0084('0x25')][_0x0084('0xd2')]===_0x0084('0xd6')){return _0x67c06a[_0x0084('0x30')]({'read':!![]});}else{logger['error'](_0x0084('0x1d'),_0x0084('0x25'),_0x0084('0xd1'),util[_0x0084('0xca')](_0x36bcdc[_0x0084('0x58')],{'showHidden':![],'depth':null}));}break;case _0x0084('0x8d'):if(_0xb4d550==_0x0084('0xd7')||_0xb4d550=='RECEIVED_BY_RECIPIENT'){return _0x67c06a[_0x0084('0x30')]({'read':!![]});}else{logger['error'](_0x0084('0x1d'),'status',_0x0084('0x8d'),util['inspect'](_0x36bcdc['body'],{'showHidden':![],'depth':null}));}break;case _0x0084('0x90'):if(_0xb4d550==_0x0084('0xd8')){return _0x67c06a[_0x0084('0x30')]({'read':!![]});}else{logger[_0x0084('0x20')](_0x0084('0x1d'),_0x0084('0x25'),_0x0084('0x90'),util[_0x0084('0xca')](_0x36bcdc[_0x0084('0x58')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0xb4d550===_0x0084('0xd9')||_0xb4d550===_0x0084('0xda')){return _0x67c06a[_0x0084('0x30')]({'read':!![]});}else{logger[_0x0084('0x20')](_0x0084('0x1d'),'status','intelepeer',util[_0x0084('0xca')](_0x36bcdc[_0x0084('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x67c06a;}})['then'](respondWithResult(_0x172822,null))[_0x0084('0x23')](handleError(_0x172822,null));};exports[_0x0084('0xdb')]=function(_0x33161f,_0x5bb688,_0x2da57b){var _0x4ea12c,_0x46494e,_0x3469df;return db['SmsAccount'][_0x0084('0x56')]({'where':{'id':_0x33161f[_0x0084('0x53')]['id']}})[_0x0084('0x19')](handleEntityNotFound(_0x5bb688,null))[_0x0084('0x19')](function(_0x3df0a8){if(_0x3df0a8){_0x3469df=_0x3df0a8;logger[_0x0084('0xae')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x0084('0x25'),_0x0084('0xc9'),_0x3df0a8[_0x0084('0x4c')],util['inspect'](_0x33161f['query'],{'showHidden':![],'depth':null}));switch(_0x3df0a8[_0x0084('0x4c')]){case'csc':if(_0x33161f[_0x0084('0x3c')][_0x0084('0xdc')]&&_0x33161f[_0x0084('0x3c')][_0x0084('0xdd')]){_0x46494e=_0x33161f[_0x0084('0x3c')][_0x0084('0xdd')];return db[_0x0084('0xa5')][_0x0084('0x56')]({'where':{'messageId':_0x33161f[_0x0084('0x3c')]['message-id']}});}break;}}})[_0x0084('0x19')](handleEntityNotFound(_0x5bb688,null))[_0x0084('0x19')](function(_0x336ca4){if(_0x336ca4){_0x4ea12c=_0x336ca4;switch(_0x3469df['type']){case _0x0084('0x8a'):if(_0x46494e==='2'||_0x46494e==='6'){return _0x4ea12c['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x0084('0x8a'),util[_0x0084('0xca')](_0x33161f[_0x0084('0x3c')],{'showHidden':![],'depth':null}));};break;}return _0x4ea12c;}})[_0x0084('0x19')](respondWithResult(_0x5bb688,null))[_0x0084('0x23')](handleError(_0x5bb688,null));};exports[_0x0084('0xde')]=function(_0x497c11,_0x5ae753,_0x34d12f){return db[_0x0084('0x4e')]['find']({'where':{'id':_0x497c11[_0x0084('0x53')]['id']}})[_0x0084('0x19')](handleEntityNotFound(_0x5ae753,null))[_0x0084('0x19')](function(_0x357c2b){if(_0x357c2b){return _0x357c2b[_0x0084('0xde')](_0x497c11[_0x0084('0x58')][_0x0084('0x68')],_[_0x0084('0x9c')](_0x497c11[_0x0084('0x58')],[_0x0084('0x68'),'id'])||{})['spread'](function(_0x4f1a2a){for(var _0x508d52=0x0;_0x508d52<_0x497c11[_0x0084('0x58')][_0x0084('0x68')][_0x0084('0x43')];_0x508d52+=0x1){socket[_0x0084('0xdf')](_0x0084('0xe0'),{'UserId':Number(_0x497c11[_0x0084('0x58')][_0x0084('0x68')][_0x508d52]),'SmsAccountId':Number(_0x497c11[_0x0084('0x53')]['id'])});}return _0x4f1a2a;});}})[_0x0084('0x19')](respondWithResult(_0x5ae753,null))[_0x0084('0x23')](handleError(_0x5ae753,null));};exports[_0x0084('0xe1')]=function(_0x539862,_0x56dc34,_0x41afd3){return db[_0x0084('0x4e')][_0x0084('0x56')]({'where':{'id':_0x539862[_0x0084('0x53')]['id']}})[_0x0084('0x19')](handleEntityNotFound(_0x56dc34,null))[_0x0084('0x19')](function(_0x5916a7){if(_0x5916a7){return _0x5916a7[_0x0084('0xe1')](_0x539862[_0x0084('0x3c')][_0x0084('0x68')])[_0x0084('0x19')](function(){if(_[_0x0084('0xe2')](_0x539862[_0x0084('0x3c')][_0x0084('0x68')])){for(var _0x349edb=0x0;_0x349edb<_0x539862[_0x0084('0x3c')][_0x0084('0x68')]['length'];_0x349edb+=0x1){socket[_0x0084('0xdf')](_0x0084('0xe3'),{'UserId':Number(_0x539862['query']['ids'][_0x349edb]),'SmsAccountId':Number(_0x539862['params']['id'])});}}else{socket[_0x0084('0xdf')](_0x0084('0xe3'),{'UserId':Number(_0x539862[_0x0084('0x3c')][_0x0084('0x68')]),'SmsAccountId':Number(_0x539862[_0x0084('0x53')]['id'])});}});}})[_0x0084('0x19')](respondWithStatusCode(_0x56dc34,null))[_0x0084('0x23')](handleError(_0x56dc34,null));};exports[_0x0084('0xe4')]=function(_0x1eded0,_0x505927,_0x2f7d27){var _0x6caa8a={};var _0x2e9d27={};var _0x26f198;var _0x2bb452;return db[_0x0084('0x4e')][_0x0084('0x65')]({'where':{'id':_0x1eded0[_0x0084('0x53')]['id']}})['then'](handleEntityNotFound(_0x505927,null))[_0x0084('0x19')](function(_0x2bdca6){if(_0x2bdca6){_0x26f198=_0x2bdca6;_0x2e9d27[_0x0084('0x40')]=_[_0x0084('0x3d')](db['User'][_0x0084('0x39')]);_0x2e9d27[_0x0084('0x3c')]=_[_0x0084('0x3d')](_0x1eded0[_0x0084('0x3c')]);_0x2e9d27[_0x0084('0x3e')]=_['intersection'](_0x2e9d27['model'],_0x2e9d27[_0x0084('0x3c')]);_0x6caa8a[_0x0084('0x41')]=_['intersection'](_0x2e9d27['model'],qs[_0x0084('0x42')](_0x1eded0['query'][_0x0084('0x42')]));_0x6caa8a[_0x0084('0x41')]=_0x6caa8a[_0x0084('0x41')][_0x0084('0x43')]?_0x6caa8a[_0x0084('0x41')]:_0x2e9d27[_0x0084('0x40')];_0x6caa8a[_0x0084('0x66')]=qs[_0x0084('0x46')](_0x1eded0[_0x0084('0x3c')][_0x0084('0x46')]);_0x6caa8a['where']=qs['filters'](_[_0x0084('0x48')](_0x1eded0[_0x0084('0x3c')],_0x2e9d27[_0x0084('0x3e')]));if(_0x1eded0[_0x0084('0x3c')][_0x0084('0x49')]){_0x6caa8a[_0x0084('0x47')]=_[_0x0084('0x4a')](_0x6caa8a['where'],{'$or':_[_0x0084('0x4b')](_0x6caa8a['attributes'],function(_0x3cb3f2){var _0x3ab286={};_0x3ab286[_0x3cb3f2]={'$like':'%'+_0x1eded0['query'][_0x0084('0x49')]+'%'};return _0x3ab286;})});}_0x6caa8a=_[_0x0084('0x4a')]({},_0x6caa8a,_0x1eded0['options']);return _0x26f198['getAgents'](_0x6caa8a);}})[_0x0084('0x19')](function(_0x50f58d){if(_0x50f58d){_0x2bb452=_0x50f58d[_0x0084('0x43')];if(!_0x1eded0[_0x0084('0x3c')][_0x0084('0x44')](_0x0084('0x45'))){_0x6caa8a['limit']=qs[_0x0084('0x2a')](_0x1eded0[_0x0084('0x3c')][_0x0084('0x2a')]);_0x6caa8a[_0x0084('0x28')]=qs['offset'](_0x1eded0[_0x0084('0x3c')]['offset']);}return _0x26f198[_0x0084('0xe4')](_0x6caa8a);}})[_0x0084('0x19')](function(_0x2a5c5f){if(_0x2a5c5f){return _0x2a5c5f?{'count':_0x2bb452,'rows':_0x2a5c5f}:null;}})['then'](respondWithResult(_0x505927,null))[_0x0084('0x23')](handleError(_0x505927,null));}; \ No newline at end of file +var _0x7ed8=['isNil','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','ListId','Contacts','DESC','contact','SmsInteraction','spread','interaction','created','autoclose','applications','close','unmanaged','SmsMessage','ContactId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','SmsApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','getInteractions','Owner','fullname','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','CmList','List','out','Messages','push','dataValues','skebby_dispatch_id','requestid','statusInt','status_code','infobip','groupName','DELIVERED','intelepeer','redif','inspect','DELIVERED_TO_GATEWAY','DELIVRD','message-id','state','addAgents','ids','emit','userSmsAccount:save','removeAgents','userSmsAccount:remove','getAgents','rimraf','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','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','http','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','set','Content-Range','apply','reject','save','update','destroy','then','SmsAccounts','UserProfileResource','stack','name','send','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','SmsAccount','findAll','rows','show','params','intersection','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Pause','describe','SmsAccountId','Disposition','nolimit','removeDispositions','CannedAnswer','getAnswers','findOne','removeAnswers','notify','sms','Applications','account','orderBy','asc','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','mobile','twilio','from','From','Body','messageId','skebby','text','connectel','clicksend','message_id','Text','MessageUUID','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','refid'];(function(_0x12e084,_0x445d1d){var _0x4f67b2=function(_0x165a60){while(--_0x165a60){_0x12e084['push'](_0x12e084['shift']());}};_0x4f67b2(++_0x445d1d);}(_0x7ed8,0x134));var _0x87ed=function(_0xbb0ae3,_0x3e539f){_0xbb0ae3=_0xbb0ae3-0x0;var _0x26379d=_0x7ed8[_0xbb0ae3];return _0x26379d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x87ed('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x87ed('0x1'));var rp=require(_0x87ed('0x2'));var moment=require(_0x87ed('0x3'));var BPromise=require(_0x87ed('0x4'));var Mustache=require(_0x87ed('0x5'));var util=require(_0x87ed('0x6'));var path=require('path');var sox=require(_0x87ed('0x7'));var csv=require(_0x87ed('0x8'));var ejs=require(_0x87ed('0x9'));var fs=require('fs');var fs_extra=require(_0x87ed('0xa'));var _=require(_0x87ed('0xb'));var squel=require(_0x87ed('0xc'));var crypto=require(_0x87ed('0xd'));var jsforce=require(_0x87ed('0xe'));var deskjs=require(_0x87ed('0xf'));var toCsv=require(_0x87ed('0x8'));var querystring=require(_0x87ed('0x10'));var Papa=require(_0x87ed('0x11'));var Redis=require(_0x87ed('0x12'));var authService=require(_0x87ed('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x87ed('0x14'));var logger=require(_0x87ed('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x87ed('0x16'));var licenseUtil=require(_0x87ed('0x17'));var db=require(_0x87ed('0x18'))['db'];config[_0x87ed('0x19')]=_[_0x87ed('0x1a')](config[_0x87ed('0x19')],{'host':_0x87ed('0x1b'),'port':0x18eb});var socket=require(_0x87ed('0x1c'))(new Redis(config['redis']));require('./smsAccount.socket')['register'](socket);var jayson=require(_0x87ed('0x1d'));var client=jayson[_0x87ed('0x1e')][_0x87ed('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x740245,_0x28cf0c,_0x2b0ac0,_0x1c76a5){return new BPromise(function(_0x4d4820,_0x486a15){var _0x1abbe3=_0x1c76a5||client;return _0x1abbe3['request'](_0x740245,_0x2b0ac0)['then'](function(_0x15e2a9){logger[_0x87ed('0x20')](_0x87ed('0x21'),_0x28cf0c,_0x87ed('0x22'));logger[_0x87ed('0x23')](_0x87ed('0x24'),_0x28cf0c,_0x87ed('0x22'),JSON[_0x87ed('0x25')](_0x15e2a9));if(_0x15e2a9[_0x87ed('0x26')]){if(_0x15e2a9[_0x87ed('0x26')][_0x87ed('0x27')]===0x1f4){logger[_0x87ed('0x26')](_0x87ed('0x21'),_0x28cf0c,_0x15e2a9[_0x87ed('0x26')][_0x87ed('0x28')]);return _0x486a15(_0x15e2a9[_0x87ed('0x26')]['message']);}logger[_0x87ed('0x26')](_0x87ed('0x21'),_0x28cf0c,_0x15e2a9[_0x87ed('0x26')][_0x87ed('0x28')]);return _0x4d4820(_0x15e2a9[_0x87ed('0x26')][_0x87ed('0x28')]);}else{logger[_0x87ed('0x20')](_0x87ed('0x21'),_0x28cf0c,_0x87ed('0x22'));_0x4d4820(_0x15e2a9[_0x87ed('0x29')][_0x87ed('0x28')]);}})[_0x87ed('0x2a')](function(_0x100b19){logger[_0x87ed('0x26')](_0x87ed('0x21'),_0x28cf0c,_0x100b19);_0x486a15(_0x100b19);});});}function respondWithStatusCode(_0x71f807,_0x27a410){_0x27a410=_0x27a410||0xcc;return function(_0x432a7c){if(_0x432a7c){return _0x71f807[_0x87ed('0x2b')](_0x27a410);}return _0x71f807[_0x87ed('0x2c')](_0x27a410)[_0x87ed('0x2d')]();};}function respondWithResult(_0x4bd357,_0x1dcfe2){_0x1dcfe2=_0x1dcfe2||0xc8;return function(_0x105f93){if(_0x105f93){return _0x4bd357['status'](_0x1dcfe2)[_0x87ed('0x2e')](_0x105f93);}};}function respondWithFilteredResult(_0x2c53b6,_0x3af109){return function(_0x710889){if(_0x710889){var _0x248059=typeof _0x3af109[_0x87ed('0x2f')]==='undefined'&&typeof _0x3af109[_0x87ed('0x30')]===_0x87ed('0x31');var _0x2827cd=_0x710889['count'];var _0xfa4627=_0x248059?0x0:_0x3af109['offset'];var _0x2fe01f=_0x248059?_0x710889['count']:_0x3af109[_0x87ed('0x2f')]+_0x3af109['limit'];var _0x2584dc;if(_0x2fe01f>=_0x2827cd){_0x2fe01f=_0x2827cd;_0x2584dc=0xc8;}else{_0x2584dc=0xce;}_0x2c53b6[_0x87ed('0x2c')](_0x2584dc);return _0x2c53b6[_0x87ed('0x32')](_0x87ed('0x33'),_0xfa4627+'-'+_0x2fe01f+'/'+_0x2827cd)['json'](_0x710889);}return null;};}function patchUpdates(_0x716f3e){return function(_0x4c630a){try{jsonpatch[_0x87ed('0x34')](_0x4c630a,_0x716f3e,!![]);}catch(_0x486bc2){return BPromise[_0x87ed('0x35')](_0x486bc2);}return _0x4c630a[_0x87ed('0x36')]();};}function saveUpdates(_0x2eed16,_0x16a670){return function(_0x27d3eb){if(_0x27d3eb){return _0x27d3eb[_0x87ed('0x37')](_0x2eed16)['then'](function(_0x5d07ae){return _0x5d07ae;});}return null;};}function removeEntity(_0x29aa67,_0x973f4e){return function(_0x25c84b){if(_0x25c84b){return _0x25c84b[_0x87ed('0x38')]()[_0x87ed('0x39')](function(){var _0x3584a7=_0x25c84b['get']({'plain':!![]});var _0x2a3908=_0x87ed('0x3a');return db[_0x87ed('0x3b')]['destroy']({'where':{'type':_0x2a3908,'resourceId':_0x3584a7['id']}})[_0x87ed('0x39')](function(){return _0x25c84b;});})[_0x87ed('0x39')](function(){_0x29aa67['status'](0xcc)[_0x87ed('0x2d')]();});}};}function handleEntityNotFound(_0xd50bfc,_0x2a5135){return function(_0x51d848){if(!_0x51d848){_0xd50bfc['sendStatus'](0x194);}return _0x51d848;};}function handleError(_0x586089,_0x2e5ce6){_0x2e5ce6=_0x2e5ce6||0x1f4;return function(_0x362969){logger[_0x87ed('0x26')](_0x362969[_0x87ed('0x3c')]);if(_0x362969[_0x87ed('0x3d')]){delete _0x362969['name'];}_0x586089[_0x87ed('0x2c')](_0x2e5ce6)[_0x87ed('0x3e')](_0x362969);};}exports['index']=function(_0x5104aa,_0x355cf9){var _0x294ace={'include':[{'model':db['Pause'],'as':_0x87ed('0x3f')}]},_0x327e1b={},_0x10bdad={'count':0x0,'rows':[]};var _0x3a9881=_[_0x87ed('0x40')](db['SmsAccount'][_0x87ed('0x41')],function(_0x21b9c1){return{'name':_0x21b9c1[_0x87ed('0x42')],'type':_0x21b9c1[_0x87ed('0x43')][_0x87ed('0x44')]};});_0x327e1b[_0x87ed('0x45')]=_[_0x87ed('0x40')](_0x3a9881,_0x87ed('0x3d'));_0x327e1b[_0x87ed('0x46')]=_[_0x87ed('0x47')](_0x5104aa[_0x87ed('0x46')]);_0x327e1b[_0x87ed('0x48')]=_['intersection'](_0x327e1b['model'],_0x327e1b[_0x87ed('0x46')]);_0x294ace[_0x87ed('0x49')]=_['intersection'](_0x327e1b[_0x87ed('0x45')],qs['fields'](_0x5104aa[_0x87ed('0x46')][_0x87ed('0x4a')]));_0x294ace[_0x87ed('0x49')]=_0x294ace[_0x87ed('0x49')][_0x87ed('0x4b')]?_0x294ace[_0x87ed('0x49')]:_0x327e1b['model'];if(!_0x5104aa[_0x87ed('0x46')][_0x87ed('0x4c')]('nolimit')){_0x294ace[_0x87ed('0x30')]=qs[_0x87ed('0x30')](_0x5104aa[_0x87ed('0x46')]['limit']);_0x294ace[_0x87ed('0x2f')]=qs[_0x87ed('0x2f')](_0x5104aa[_0x87ed('0x46')]['offset']);}_0x294ace[_0x87ed('0x4d')]=qs[_0x87ed('0x4e')](_0x5104aa[_0x87ed('0x46')][_0x87ed('0x4e')]);_0x294ace[_0x87ed('0x4f')]=qs[_0x87ed('0x48')](_[_0x87ed('0x50')](_0x5104aa[_0x87ed('0x46')],_0x327e1b['filters']),_0x3a9881);if(_0x5104aa['query'][_0x87ed('0x51')]){_0x294ace[_0x87ed('0x4f')]=_[_0x87ed('0x52')](_0x294ace[_0x87ed('0x4f')],{'$or':_['map'](_0x3a9881,function(_0x44d632){if(_0x44d632[_0x87ed('0x43')]!==_0x87ed('0x53')){var _0x1a9ce2={};_0x1a9ce2[_0x44d632['name']]={'$like':'%'+_0x5104aa['query'][_0x87ed('0x51')]+'%'};return _0x1a9ce2;}})});}_0x294ace=_[_0x87ed('0x52')]({},_0x294ace,_0x5104aa[_0x87ed('0x54')]);var _0xc86fa0={'where':_0x294ace['where']};return db['SmsAccount'][_0x87ed('0x55')](_0xc86fa0)[_0x87ed('0x39')](function(_0x31ee16){_0x10bdad[_0x87ed('0x55')]=_0x31ee16;if(_0x5104aa[_0x87ed('0x46')][_0x87ed('0x56')]){_0x294ace[_0x87ed('0x57')]=[{'all':!![]}];}return db[_0x87ed('0x58')][_0x87ed('0x59')](_0x294ace);})[_0x87ed('0x39')](function(_0x48823a){_0x10bdad[_0x87ed('0x5a')]=_0x48823a;return _0x10bdad;})[_0x87ed('0x39')](respondWithFilteredResult(_0x355cf9,_0x294ace))[_0x87ed('0x2a')](handleError(_0x355cf9,null));};exports[_0x87ed('0x5b')]=function(_0x336fa0,_0x5d3742){var _0x1c5e68={'raw':![],'where':{'id':_0x336fa0[_0x87ed('0x5c')]['id']},'include':[{'model':db['Pause'],'as':_0x87ed('0x3f')}]},_0x59e277={};_0x59e277[_0x87ed('0x45')]=_[_0x87ed('0x47')](db[_0x87ed('0x58')]['rawAttributes']);_0x59e277['query']=_[_0x87ed('0x47')](_0x336fa0[_0x87ed('0x46')]);_0x59e277[_0x87ed('0x48')]=_['intersection'](_0x59e277[_0x87ed('0x45')],_0x59e277[_0x87ed('0x46')]);_0x1c5e68[_0x87ed('0x49')]=_[_0x87ed('0x5d')](_0x59e277[_0x87ed('0x45')],qs['fields'](_0x336fa0[_0x87ed('0x46')][_0x87ed('0x4a')]));_0x1c5e68[_0x87ed('0x49')]=_0x1c5e68[_0x87ed('0x49')][_0x87ed('0x4b')]?_0x1c5e68[_0x87ed('0x49')]:_0x59e277['model'];if(_0x336fa0[_0x87ed('0x46')][_0x87ed('0x56')]){_0x1c5e68[_0x87ed('0x57')]=[{'all':!![]}];}_0x1c5e68=_[_0x87ed('0x52')]({},_0x1c5e68,_0x336fa0[_0x87ed('0x54')]);return db[_0x87ed('0x58')]['find'](_0x1c5e68)[_0x87ed('0x39')](handleEntityNotFound(_0x5d3742,null))[_0x87ed('0x39')](respondWithResult(_0x5d3742,null))[_0x87ed('0x2a')](handleError(_0x5d3742,null));};exports[_0x87ed('0x5e')]=function(_0x27907f,_0x3979e3){return db[_0x87ed('0x58')][_0x87ed('0x5e')](_0x27907f[_0x87ed('0x5f')],{})[_0x87ed('0x39')](function(_0x26a4fb){var _0x10a036=_0x27907f[_0x87ed('0x60')][_0x87ed('0x61')]({'plain':!![]});if(!_0x10a036)throw new Error(_0x87ed('0x62'));if(_0x10a036[_0x87ed('0x63')]===_0x87ed('0x60')){var _0x13f9d2=_0x26a4fb['get']({'plain':!![]});var _0x1ab9cf=_0x87ed('0x3a');return db[_0x87ed('0x64')][_0x87ed('0x65')]({'where':{'name':_0x1ab9cf,'userProfileId':_0x10a036[_0x87ed('0x66')]},'raw':!![]})[_0x87ed('0x39')](function(_0x1b9a80){if(_0x1b9a80&&_0x1b9a80[_0x87ed('0x67')]===0x0){return db['UserProfileResource'][_0x87ed('0x5e')]({'name':_0x13f9d2[_0x87ed('0x3d')],'resourceId':_0x13f9d2['id'],'type':_0x1b9a80[_0x87ed('0x3d')],'sectionId':_0x1b9a80['id']},{})['then'](function(){return _0x26a4fb;});}else{return _0x26a4fb;}})[_0x87ed('0x2a')](function(_0x4ff4df){logger['error'](_0x87ed('0x68'),_0x4ff4df);throw _0x4ff4df;});}return _0x26a4fb;})[_0x87ed('0x39')](respondWithResult(_0x3979e3,0xc9))['catch'](handleError(_0x3979e3,null));};exports[_0x87ed('0x37')]=function(_0x359390,_0x4bc092){if(_0x359390[_0x87ed('0x5f')]['id']){delete _0x359390[_0x87ed('0x5f')]['id'];}return db['SmsAccount'][_0x87ed('0x65')]({'where':{'id':_0x359390[_0x87ed('0x5c')]['id']},'include':[{'model':db[_0x87ed('0x69')],'as':_0x87ed('0x3f')}]})[_0x87ed('0x39')](handleEntityNotFound(_0x4bc092,null))[_0x87ed('0x39')](saveUpdates(_0x359390[_0x87ed('0x5f')],null))['then'](respondWithResult(_0x4bc092,null))[_0x87ed('0x2a')](handleError(_0x4bc092,null));};exports[_0x87ed('0x38')]=function(_0x2500ba,_0x4ba5f8){return db[_0x87ed('0x58')][_0x87ed('0x65')]({'where':{'id':_0x2500ba[_0x87ed('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4ba5f8,null))[_0x87ed('0x39')](removeEntity(_0x4ba5f8,null))[_0x87ed('0x2a')](handleError(_0x4ba5f8,null));};exports[_0x87ed('0x6a')]=function(_0x29daae,_0x1860d3){return db['SmsAccount']['describe']()[_0x87ed('0x39')](respondWithResult(_0x1860d3,null))[_0x87ed('0x2a')](handleError(_0x1860d3,null));};exports['addDisposition']=function(_0x476a4d,_0x5c2e8f,_0x431065){if(_0x476a4d['body']['id']){delete _0x476a4d[_0x87ed('0x5f')]['id'];}return db[_0x87ed('0x58')]['find']({'where':{'id':_0x476a4d[_0x87ed('0x5c')]['id']}})[_0x87ed('0x39')](handleEntityNotFound(_0x5c2e8f,null))[_0x87ed('0x39')](function(_0x15945b){if(_0x15945b){_0x476a4d[_0x87ed('0x5f')][_0x87ed('0x6b')]=_0x15945b['id'];return db[_0x87ed('0x6c')][_0x87ed('0x5e')](_0x476a4d[_0x87ed('0x5f')]);}})[_0x87ed('0x39')](respondWithResult(_0x5c2e8f,null))[_0x87ed('0x2a')](handleError(_0x5c2e8f,null));};exports['getDispositions']=function(_0x57f5e5,_0x3e17ab,_0x1f9fab){var _0x57e98e={'raw':![],'where':{}};var _0xa3265e={};var _0x558c04={'count':0x0,'rows':[]};return db[_0x87ed('0x58')]['findOne']({'where':{'id':_0x57f5e5['params']['id']}})['then'](handleEntityNotFound(_0x3e17ab,null))[_0x87ed('0x39')](function(_0x432eb6){if(_0x432eb6){_0xa3265e[_0x87ed('0x45')]=_[_0x87ed('0x47')](db[_0x87ed('0x6c')][_0x87ed('0x41')]);_0xa3265e[_0x87ed('0x46')]=_[_0x87ed('0x47')](_0x57f5e5[_0x87ed('0x46')]);_0xa3265e[_0x87ed('0x48')]=_['intersection'](_0xa3265e[_0x87ed('0x45')],_0xa3265e[_0x87ed('0x46')]);_0x57e98e[_0x87ed('0x49')]=_[_0x87ed('0x5d')](_0xa3265e['model'],qs[_0x87ed('0x4a')](_0x57f5e5[_0x87ed('0x46')][_0x87ed('0x4a')]));_0x57e98e[_0x87ed('0x49')]=_0x57e98e['attributes'][_0x87ed('0x4b')]?_0x57e98e[_0x87ed('0x49')]:_0xa3265e[_0x87ed('0x45')];if(!_0x57f5e5[_0x87ed('0x46')][_0x87ed('0x4c')](_0x87ed('0x6d'))){_0x57e98e[_0x87ed('0x30')]=qs[_0x87ed('0x30')](_0x57f5e5['query'][_0x87ed('0x30')]);_0x57e98e[_0x87ed('0x2f')]=qs['offset'](_0x57f5e5['query'][_0x87ed('0x2f')]);}_0x57e98e[_0x87ed('0x4d')]=qs[_0x87ed('0x4e')](_0x57f5e5[_0x87ed('0x46')]['sort']);_0x57e98e[_0x87ed('0x4f')]=qs['filters'](_[_0x87ed('0x50')](_0x57f5e5[_0x87ed('0x46')],_0xa3265e[_0x87ed('0x48')]));_0x57e98e[_0x87ed('0x4f')][_0x87ed('0x6b')]=_0x432eb6['id'];if(_0x57f5e5[_0x87ed('0x46')]['filter']){_0x57e98e['where']=_[_0x87ed('0x52')](_0x57e98e['where'],{'$or':_['map'](_0x57e98e[_0x87ed('0x49')],function(_0x2e8160){var _0x91b1df={};_0x91b1df[_0x2e8160]={'$like':'%'+_0x57f5e5[_0x87ed('0x46')][_0x87ed('0x51')]+'%'};return _0x91b1df;})});}_0x57e98e=_[_0x87ed('0x52')]({},_0x57e98e,_0x57f5e5[_0x87ed('0x54')]);return db[_0x87ed('0x6c')]['count']({'where':_0x57e98e['where']})['then'](function(_0x4dac28){_0x558c04[_0x87ed('0x55')]=_0x4dac28;if(_0x57f5e5[_0x87ed('0x46')][_0x87ed('0x56')]){_0x57e98e[_0x87ed('0x57')]=[{'all':!![]}];}return db['Disposition'][_0x87ed('0x59')](_0x57e98e);})['then'](function(_0x27bf62){_0x558c04[_0x87ed('0x5a')]=_0x27bf62;return _0x558c04;});}})[_0x87ed('0x39')](respondWithFilteredResult(_0x3e17ab,_0x57e98e))['catch'](handleError(_0x3e17ab,null));};exports['removeDispositions']=function(_0x91c7ce,_0x22ba6a,_0x403289){return db[_0x87ed('0x58')][_0x87ed('0x65')]({'where':{'id':_0x91c7ce[_0x87ed('0x5c')]['id']}})[_0x87ed('0x39')](handleEntityNotFound(_0x22ba6a,null))['then'](function(_0x2dd0f9){if(_0x2dd0f9){return _0x2dd0f9[_0x87ed('0x6e')](_0x91c7ce[_0x87ed('0x46')]['ids']);}})[_0x87ed('0x39')](respondWithStatusCode(_0x22ba6a,null))[_0x87ed('0x2a')](handleError(_0x22ba6a,null));};exports['addAnswer']=function(_0x4a2360,_0x1a5e26,_0x1779de){if(_0x4a2360[_0x87ed('0x5f')]['id']){delete _0x4a2360[_0x87ed('0x5f')]['id'];}return db[_0x87ed('0x58')][_0x87ed('0x65')]({'where':{'id':_0x4a2360['params']['id']}})['then'](handleEntityNotFound(_0x1a5e26,null))['then'](function(_0x6e20eb){if(_0x6e20eb){_0x4a2360[_0x87ed('0x5f')][_0x87ed('0x6b')]=_0x6e20eb['id'];return db[_0x87ed('0x6f')][_0x87ed('0x5e')](_0x4a2360[_0x87ed('0x5f')]);}})[_0x87ed('0x39')](respondWithResult(_0x1a5e26,null))[_0x87ed('0x2a')](handleError(_0x1a5e26,null));};exports[_0x87ed('0x70')]=function(_0x799564,_0xfb512c,_0x828f9c){var _0x10557d={'raw':![],'where':{}};var _0x115f82={};var _0x5c4ac6={'count':0x0,'rows':[]};return db['SmsAccount'][_0x87ed('0x71')]({'where':{'id':_0x799564[_0x87ed('0x5c')]['id']}})[_0x87ed('0x39')](handleEntityNotFound(_0xfb512c,null))[_0x87ed('0x39')](function(_0x31d6ad){if(_0x31d6ad){_0x115f82[_0x87ed('0x45')]=_['keys'](db[_0x87ed('0x6f')][_0x87ed('0x41')]);_0x115f82[_0x87ed('0x46')]=_[_0x87ed('0x47')](_0x799564[_0x87ed('0x46')]);_0x115f82['filters']=_[_0x87ed('0x5d')](_0x115f82[_0x87ed('0x45')],_0x115f82['query']);_0x10557d[_0x87ed('0x49')]=_[_0x87ed('0x5d')](_0x115f82['model'],qs[_0x87ed('0x4a')](_0x799564[_0x87ed('0x46')][_0x87ed('0x4a')]));_0x10557d[_0x87ed('0x49')]=_0x10557d[_0x87ed('0x49')][_0x87ed('0x4b')]?_0x10557d[_0x87ed('0x49')]:_0x115f82[_0x87ed('0x45')];if(!_0x799564[_0x87ed('0x46')]['hasOwnProperty'](_0x87ed('0x6d'))){_0x10557d[_0x87ed('0x30')]=qs['limit'](_0x799564[_0x87ed('0x46')][_0x87ed('0x30')]);_0x10557d[_0x87ed('0x2f')]=qs['offset'](_0x799564[_0x87ed('0x46')][_0x87ed('0x2f')]);}_0x10557d[_0x87ed('0x4d')]=qs['sort'](_0x799564['query'][_0x87ed('0x4e')]);_0x10557d[_0x87ed('0x4f')]=qs['filters'](_['pick'](_0x799564[_0x87ed('0x46')],_0x115f82['filters']));_0x10557d['where']['SmsAccountId']=_0x31d6ad['id'];if(_0x799564[_0x87ed('0x46')][_0x87ed('0x51')]){_0x10557d[_0x87ed('0x4f')]=_[_0x87ed('0x52')](_0x10557d[_0x87ed('0x4f')],{'$or':_['map'](_0x10557d[_0x87ed('0x49')],function(_0x7dfe8f){var _0x282ff1={};_0x282ff1[_0x7dfe8f]={'$like':'%'+_0x799564['query'][_0x87ed('0x51')]+'%'};return _0x282ff1;})});}_0x10557d=_[_0x87ed('0x52')]({},_0x10557d,_0x799564[_0x87ed('0x54')]);return db['CannedAnswer']['count']({'where':_0x10557d[_0x87ed('0x4f')]})['then'](function(_0x4ce8a1){_0x5c4ac6[_0x87ed('0x55')]=_0x4ce8a1;if(_0x799564[_0x87ed('0x46')][_0x87ed('0x56')]){_0x10557d[_0x87ed('0x57')]=[{'all':!![]}];}return db[_0x87ed('0x6f')][_0x87ed('0x59')](_0x10557d);})['then'](function(_0x50513d){_0x5c4ac6['rows']=_0x50513d;return _0x5c4ac6;});}})[_0x87ed('0x39')](respondWithFilteredResult(_0xfb512c,_0x10557d))[_0x87ed('0x2a')](handleError(_0xfb512c,null));};exports[_0x87ed('0x72')]=function(_0x401bda,_0x539c26,_0x44cb1f){return db[_0x87ed('0x58')][_0x87ed('0x65')]({'where':{'id':_0x401bda[_0x87ed('0x5c')]['id']}})[_0x87ed('0x39')](handleEntityNotFound(_0x539c26,null))['then'](function(_0x27868d){if(_0x27868d){return _0x27868d[_0x87ed('0x72')](_0x401bda[_0x87ed('0x46')]['ids']);}})[_0x87ed('0x39')](respondWithStatusCode(_0x539c26,null))[_0x87ed('0x2a')](handleError(_0x539c26,null));};exports[_0x87ed('0x73')]=function(_0x5a57b6,_0x5ee127,_0x25266c){var _0x266e5b={'channel':_0x87ed('0x74')};var _0x5e7857=[];var _0x223685=[];var _0x3719bd={};return db[_0x87ed('0x58')][_0x87ed('0x65')]({'where':{'id':_0x5a57b6[_0x87ed('0x5c')]['id']},'include':[{'model':db['SmsApplication'],'as':_0x87ed('0x75')}]})[_0x87ed('0x39')](handleEntityNotFound(_0x5ee127,null))[_0x87ed('0x39')](function(_0x1eb298){_0x266e5b[_0x87ed('0x76')]=_0x1eb298;_0x266e5b['applications']=_[_0x87ed('0x77')](_0x1eb298[_0x87ed('0x75')],['priority'],[_0x87ed('0x78')]);if(_0x266e5b[_0x87ed('0x76')][_0x87ed('0x75')]){delete _0x266e5b['account'][_0x87ed('0x75')];}return db[_0x87ed('0x79')][_0x87ed('0x6a')]();})['then'](function(_0x37fffa){if(!_0x37fffa){throw new db['Sequelize'][(_0x87ed('0x7a'))](_0x87ed('0x7b'));}_0x5e7857=_[_0x87ed('0x7c')](_[_0x87ed('0x47')](_0x37fffa),[_0x87ed('0x7d'),_0x87ed('0x7e')]);_0x223685=_[_0x87ed('0x7c')](_[_0x87ed('0x47')](_0x37fffa),['createdAt','updatedAt',_0x87ed('0x7f'),'ListId']);_0x266e5b[_0x87ed('0x5f')]={'mapKey':_0x87ed('0x80')};if(_0x266e5b[_0x87ed('0x76')]['type']){switch(_0x266e5b[_0x87ed('0x76')][_0x87ed('0x43')]){case _0x87ed('0x81'):_0x266e5b[_0x87ed('0x5f')][_0x87ed('0x82')]=_0x5a57b6['body'][_0x87ed('0x83')];_0x266e5b[_0x87ed('0x5f')][_0x87ed('0x5f')]=_0x5a57b6[_0x87ed('0x5f')][_0x87ed('0x84')];_0x266e5b[_0x87ed('0x5f')][_0x87ed('0x85')]=_0x5a57b6[_0x87ed('0x5f')]['MessageSid'];break;case _0x87ed('0x86'):_0x266e5b[_0x87ed('0x5f')][_0x87ed('0x82')]='+'+_0x5a57b6['body']['sender'];_0x266e5b[_0x87ed('0x5f')][_0x87ed('0x5f')]=_0x5a57b6[_0x87ed('0x5f')][_0x87ed('0x87')];break;case _0x87ed('0x88'):_0x266e5b[_0x87ed('0x5f')][_0x87ed('0x82')]=_0x5a57b6[_0x87ed('0x5f')][_0x87ed('0x82')];_0x266e5b[_0x87ed('0x5f')]['body']=_0x5a57b6[_0x87ed('0x5f')][_0x87ed('0x28')];break;case _0x87ed('0x89'):_0x266e5b[_0x87ed('0x5f')][_0x87ed('0x82')]=_0x5a57b6[_0x87ed('0x5f')][_0x87ed('0x82')];_0x266e5b[_0x87ed('0x5f')][_0x87ed('0x5f')]=_0x5a57b6[_0x87ed('0x5f')]['body'];_0x266e5b['body'][_0x87ed('0x85')]=_0x5a57b6[_0x87ed('0x5f')][_0x87ed('0x8a')];break;case'plivo':_0x266e5b[_0x87ed('0x5f')][_0x87ed('0x82')]=_0x5a57b6[_0x87ed('0x5f')][_0x87ed('0x83')];_0x266e5b[_0x87ed('0x5f')][_0x87ed('0x5f')]=_0x5a57b6[_0x87ed('0x5f')][_0x87ed('0x8b')];_0x266e5b[_0x87ed('0x5f')][_0x87ed('0x85')]=_0x5a57b6[_0x87ed('0x5f')][_0x87ed('0x8c')];break;case'infobip':_0x266e5b[_0x87ed('0x5f')][_0x87ed('0x82')]='+'+_0x5a57b6[_0x87ed('0x5f')]['results'][0x0][_0x87ed('0x82')];_0x266e5b[_0x87ed('0x5f')]['body']=_0x5a57b6[_0x87ed('0x5f')]['results'][0x0]['text'];_0x266e5b['body']['messageId']=_0x5a57b6[_0x87ed('0x5f')][_0x87ed('0x8d')][0x0]['messageId'];break;case _0x87ed('0x8e'):_0x266e5b[_0x87ed('0x5f')][_0x87ed('0x82')]=_0x5a57b6[_0x87ed('0x5f')][_0x87ed('0x8f')];_0x266e5b[_0x87ed('0x5f')]['body']=_0x5a57b6[_0x87ed('0x5f')][_0x87ed('0x90')][_0x87ed('0x28')];break;case _0x87ed('0x91'):_0x266e5b['body']['from']=_0x5a57b6[_0x87ed('0x5f')][_0x87ed('0x92')];_0x266e5b[_0x87ed('0x5f')][_0x87ed('0x5f')]=_0x5a57b6[_0x87ed('0x5f')]['text'];_0x266e5b[_0x87ed('0x5f')]['messageId']=_0x5a57b6[_0x87ed('0x5f')][_0x87ed('0x93')];break;case _0x87ed('0x94'):_0x266e5b[_0x87ed('0x5f')]['messageId']=_0x5a57b6[_0x87ed('0x5f')][0x0][_0x87ed('0x28')]['id'];_0x266e5b[_0x87ed('0x5f')][_0x87ed('0x82')]=_0x5a57b6[_0x87ed('0x5f')][0x0]['message'][_0x87ed('0x82')];_0x266e5b[_0x87ed('0x5f')][_0x87ed('0x5f')]=_0x5a57b6[_0x87ed('0x5f')][0x0][_0x87ed('0x28')][_0x87ed('0x87')];break;case'intelepeer':_0x266e5b[_0x87ed('0x5f')][_0x87ed('0x82')]=_0x5a57b6[_0x87ed('0x5f')]['from'];_0x266e5b[_0x87ed('0x5f')][_0x87ed('0x5f')]=_0x5a57b6['body'][_0x87ed('0x28')];_0x266e5b['body'][_0x87ed('0x85')]=_0x5a57b6[_0x87ed('0x5f')][_0x87ed('0x95')];break;}}if(_0x266e5b[_0x87ed('0x5f')]['id']){delete _0x266e5b[_0x87ed('0x5f')]['id'];}if(_[_0x87ed('0x96')](_0x266e5b[_0x87ed('0x5f')][_0x87ed('0x82')])){throw new db['Sequelize'][(_0x87ed('0x7a'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x266e5b['body'][_0x87ed('0x5f')])||_0x266e5b['body']['body']===''){throw new db[(_0x87ed('0x97'))][(_0x87ed('0x7a'))](_0x87ed('0x98'));}if(_[_0x87ed('0x96')](_0x266e5b['body'][_0x87ed('0x99')])){throw new db[(_0x87ed('0x97'))]['ValidationError'](_0x87ed('0x9a')+_0x223685);}if(!_['includes'](_0x223685,_0x266e5b[_0x87ed('0x5f')]['mapKey'])){throw new db[(_0x87ed('0x97'))][(_0x87ed('0x7a'))](_0x87ed('0x9b')+_0x223685);}_0x3719bd[_0x266e5b['body']['mapKey']]=_0x266e5b[_0x87ed('0x5f')]['from'];return db['CmList'][_0x87ed('0x65')]({'where':{'id':_0x266e5b[_0x87ed('0x76')][_0x87ed('0x9c')]},'include':[{'model':db['CmContact'],'as':_0x87ed('0x9d'),'where':_0x3719bd,'limit':0x1,'order':[[_0x87ed('0x7e'),_0x87ed('0x9e')]]}]});})[_0x87ed('0x39')](handleEntityNotFound(_0x5ee127,null))[_0x87ed('0x39')](function(_0x22144f){if(_0x22144f){_0x266e5b['list']=_['omit'](_0x22144f,[_0x87ed('0x9d')]);if(_0x22144f[_0x87ed('0x9d')]['length']){return _0x22144f[_0x87ed('0x9d')][0x0];}var _0xfe8df8=_['defaults'](_0x266e5b[_0x87ed('0x5f')],{'firstName':_0x266e5b[_0x87ed('0x5f')]['from'],'ListId':_0x22144f['id']});_0xfe8df8[_0x266e5b[_0x87ed('0x5f')][_0x87ed('0x99')]]=_0x266e5b[_0x87ed('0x5f')][_0x87ed('0x82')];return db[_0x87ed('0x79')][_0x87ed('0x5e')](_0xfe8df8,{'fields':_0x5e7857,'raw':!![]});}})[_0x87ed('0x39')](handleEntityNotFound(_0x5ee127,null))[_0x87ed('0x39')](function(_0x189783){if(_0x189783){_0x266e5b[_0x87ed('0x9f')]=_0x189783;var _0x2cff3c={'ContactId':_0x189783['id'],'phone':_0x266e5b['body']['from'],'SmsAccountId':_0x5a57b6[_0x87ed('0x5c')]['id']};var _0x423f5f={'ContactId':_0x189783['id'],'SmsAccountId':_0x5a57b6['params']['id'],'closed':![]};return db[_0x87ed('0xa0')][_0x87ed('0x65')]({'where':_0x423f5f})[_0x87ed('0x39')](function(_0xd16d77){if(_0xd16d77){return[_0xd16d77,![]];}return db['SmsInteraction'][_0x87ed('0x5e')](_0x2cff3c)[_0x87ed('0x39')](function(_0xba6a48){return[_0xba6a48,!![]];});});}})[_0x87ed('0xa1')](function(_0x4fdf8f,_0x213adf){_0x266e5b[_0x87ed('0xa2')]=_0x4fdf8f[_0x87ed('0x61')]({'plain':!![]});_0x266e5b['interaction'][_0x87ed('0xa3')]=![];if(_0x213adf){if(_0x266e5b[_0x87ed('0x76')][_0x87ed('0xa4')]){_0x266e5b[_0x87ed('0xa5')]['push']({'id':0x0,'priority':_0x266e5b[_0x87ed('0xa5')][_0x87ed('0x4b')]+0x1,'app':_0x87ed('0xa6'),'appdata':_0x87ed('0xa7'),'interval':'*,*,*,*'});}_0x266e5b[_0x87ed('0xa2')][_0x87ed('0xa3')]=!![];}return db[_0x87ed('0xa8')][_0x87ed('0x5e')]({'phone':_0x266e5b['body'][_0x87ed('0x82')],'messageId':_0x266e5b['body'][_0x87ed('0x85')],'body':_0x266e5b[_0x87ed('0x5f')][_0x87ed('0x5f')],'SmsAccountId':_0x5a57b6['params']['id'],'SmsInteractionId':_0x4fdf8f['id'],'direction':'in','ContactId':_0x4fdf8f[_0x87ed('0xa9')],'AttachmentId':_0x266e5b[_0x87ed('0x5f')]['AttachmentId']});})['then'](function(_0x34ab1d){_0x266e5b[_0x87ed('0x28')]=_0x34ab1d;if(_0x266e5b['interaction'][_0x87ed('0xaa')]){return db[_0x87ed('0xab')]['find']({'attributes':['id',_0x87ed('0x3d')],'where':{'id':_0x266e5b[_0x87ed('0xa2')][_0x87ed('0xaa')]}})[_0x87ed('0x39')](function(_0x2e2508){if(_0x2e2508){_0x266e5b['applications'][_0x87ed('0xac')]({'id':0x0,'priority':0x0,'app':_0x87ed('0xad'),'appdata':_0x2e2508['name']+','+(_0x266e5b[_0x87ed('0x76')][_0x87ed('0xae')]||0xa),'interval':_0x87ed('0xaf')});}return respondWithRpcPromise(_0x87ed('0xb0'),_0x87ed('0xb1'),_0x266e5b);});}return respondWithRpcPromise(_0x87ed('0xb0'),'startRouting',_0x266e5b);})['then'](function(_0x29940d){if(_0x29940d){var _0x2f7faf=0xc8;var _0x34a5fc='receiveMessage';logger['info'](_0x87ed('0x24'),_0x34a5fc,_0x2f7faf,_0x87ed('0xb2'));logger['debug'](_0x87ed('0xb3'),_0x34a5fc,_0x2f7faf,_0x87ed('0xb2'),JSON[_0x87ed('0x25')](_0x29940d));if(_0x266e5b[_0x87ed('0x76')][_0x87ed('0x43')]==='twilio'){return _0x5ee127[_0x87ed('0x2c')](_0x2f7faf)[_0x87ed('0x32')](_0x87ed('0xb4'),_0x87ed('0xb5'))[_0x87ed('0x3e')]('\x0a');}else{return _0x5ee127['status'](_0x2f7faf)[_0x87ed('0x2e')](_0x29940d);}}})[_0x87ed('0x2a')](handleError(_0x5ee127,null));};exports[_0x87ed('0xb6')]=function(_0x15b245,_0x58a44d){var _0x32ecec=_0x15b245['params']['id'];var _0x41a8c5=_0x15b245[_0x87ed('0x5f')];var _0xfe2cc6=0xc8;var _0x4d4059=null;return db[_0x87ed('0xb7')]['transaction']({'isolationLevel':db[_0x87ed('0xb7')][_0x87ed('0xb8')][_0x87ed('0xb9')][_0x87ed('0xba')]},function(_0x10256c){return db[_0x87ed('0x58')][_0x87ed('0x71')]({'where':{'id':_0x32ecec},'transaction':_0x10256c})['then'](function(_0x207bc9){if(_0x207bc9){return db[_0x87ed('0xbb')][_0x87ed('0x38')]({'where':{'SmsAccountId':_0x32ecec},'transaction':_0x10256c})[_0x87ed('0x39')](function(){var _0x2225ef=_['map'](_0x41a8c5,function(_0x397213){_0x397213[_0x87ed('0x6b')]=_0x32ecec;return _0x397213;});return db[_0x87ed('0xbb')][_0x87ed('0xbc')](_0x2225ef,{'transaction':_0x10256c});});}else{_0xfe2cc6=0x194;_0x4d4059=[];}});})[_0x87ed('0x39')](function(){if(_0xfe2cc6!==0x194){return db['SmsApplication'][_0x87ed('0xbd')]({'where':{'SmsAccountId':_0x32ecec},'order':_0x87ed('0xbe')})[_0x87ed('0x39')](function(_0x120fc2){_0x4d4059=_0x120fc2;});}})['catch'](function(_0x2a0d26){_0xfe2cc6=0x1f4;logger['error'](_0x2a0d26[_0x87ed('0x3c')]);if(_0x2a0d26[_0x87ed('0x3d')]){delete _0x2a0d26['name'];}_0x4d4059=_0x2a0d26;})[_0x87ed('0xbf')](function(){if(_0x4d4059===null){_0x58a44d[_0x87ed('0x2b')](_0xfe2cc6);}else{if(_0xfe2cc6===0x1f4){_0x58a44d[_0x87ed('0x2c')](_0xfe2cc6)[_0x87ed('0x3e')](_0x4d4059);}else{_0x58a44d[_0x87ed('0x2c')](_0xfe2cc6)[_0x87ed('0x2e')](_0x4d4059);}}});};exports[_0x87ed('0xc0')]=function(_0x1f1cc3,_0x19fb79,_0x546ee3){var _0x76e0f9={};var _0x1c2e1a={};var _0xba9f03;var _0x64b22c;return db['SmsAccount'][_0x87ed('0x71')]({'where':{'id':_0x1f1cc3[_0x87ed('0x5c')]['id']}})[_0x87ed('0x39')](handleEntityNotFound(_0x19fb79,null))[_0x87ed('0x39')](function(_0x3bf877){if(_0x3bf877){_0xba9f03=_0x3bf877;_0x1c2e1a['model']=_[_0x87ed('0x47')](db['SmsApplication'][_0x87ed('0x41')]);_0x1c2e1a['query']=_['keys'](_0x1f1cc3[_0x87ed('0x46')]);_0x1c2e1a['filters']=_[_0x87ed('0x5d')](_0x1c2e1a['model'],_0x1c2e1a[_0x87ed('0x46')]);_0x76e0f9[_0x87ed('0x49')]=_[_0x87ed('0x5d')](_0x1c2e1a['model'],qs[_0x87ed('0x4a')](_0x1f1cc3[_0x87ed('0x46')][_0x87ed('0x4a')]));_0x76e0f9[_0x87ed('0x49')]=_0x76e0f9[_0x87ed('0x49')][_0x87ed('0x4b')]?_0x76e0f9[_0x87ed('0x49')]:_0x1c2e1a[_0x87ed('0x45')];_0x76e0f9[_0x87ed('0x4d')]=qs[_0x87ed('0x4e')](_0x1f1cc3[_0x87ed('0x46')][_0x87ed('0x4e')]);_0x76e0f9['where']=qs[_0x87ed('0x48')](_['pick'](_0x1f1cc3[_0x87ed('0x46')],_0x1c2e1a[_0x87ed('0x48')]));if(_0x1f1cc3[_0x87ed('0x46')][_0x87ed('0x51')]){_0x76e0f9[_0x87ed('0x4f')]=_[_0x87ed('0x52')](_0x76e0f9[_0x87ed('0x4f')],{'$or':_[_0x87ed('0x40')](_0x76e0f9['attributes'],function(_0x4b6e00){var _0x3971b6={};_0x3971b6[_0x4b6e00]={'$like':'%'+_0x1f1cc3['query'][_0x87ed('0x51')]+'%'};return _0x3971b6;})});}_0x76e0f9=_[_0x87ed('0x52')]({},_0x76e0f9,_0x1f1cc3[_0x87ed('0x54')]);return _0xba9f03[_0x87ed('0xc0')](_0x76e0f9);}})['then'](function(_0x4c5ff4){if(_0x4c5ff4){_0x64b22c=_0x4c5ff4[_0x87ed('0x4b')];if(!_0x1f1cc3[_0x87ed('0x46')][_0x87ed('0x4c')](_0x87ed('0x6d'))){_0x76e0f9[_0x87ed('0x30')]=qs[_0x87ed('0x30')](_0x1f1cc3[_0x87ed('0x46')][_0x87ed('0x30')]);_0x76e0f9[_0x87ed('0x2f')]=qs['offset'](_0x1f1cc3[_0x87ed('0x46')][_0x87ed('0x2f')]);}return _0xba9f03[_0x87ed('0xc0')](_0x76e0f9);}})[_0x87ed('0x39')](function(_0x45b3a1){if(_0x45b3a1){return _0x45b3a1?{'count':_0x64b22c,'rows':_0x45b3a1}:null;}})['then'](respondWithResult(_0x19fb79,null))['catch'](handleError(_0x19fb79,null));};exports[_0x87ed('0xc1')]=function(_0x577b02,_0x5122b1,_0x35bd94){var _0x2c7930={'raw':![],'where':{}};var _0x529803={};var _0x3b694f={'count':0x0,'rows':[]};return db[_0x87ed('0x58')][_0x87ed('0x71')]({'where':{'id':_0x577b02['params']['id']}})['then'](handleEntityNotFound(_0x5122b1,null))['then'](function(_0x31fcce){if(_0x31fcce){_0x529803[_0x87ed('0x45')]=_[_0x87ed('0x47')](db['SmsInteraction'][_0x87ed('0x41')]);_0x529803[_0x87ed('0x46')]=_[_0x87ed('0x47')](_0x577b02['query']);_0x529803[_0x87ed('0x48')]=_['intersection'](_0x529803[_0x87ed('0x45')],_0x529803[_0x87ed('0x46')]);_0x2c7930[_0x87ed('0x49')]=_[_0x87ed('0x5d')](_0x529803[_0x87ed('0x45')],qs[_0x87ed('0x4a')](_0x577b02[_0x87ed('0x46')][_0x87ed('0x4a')]));_0x2c7930[_0x87ed('0x49')]=_0x2c7930[_0x87ed('0x49')][_0x87ed('0x4b')]?_0x2c7930[_0x87ed('0x49')]:_0x529803[_0x87ed('0x45')];if(!_0x577b02[_0x87ed('0x46')][_0x87ed('0x4c')](_0x87ed('0x6d'))){_0x2c7930['limit']=qs[_0x87ed('0x30')](_0x577b02[_0x87ed('0x46')]['limit']);_0x2c7930[_0x87ed('0x2f')]=qs[_0x87ed('0x2f')](_0x577b02[_0x87ed('0x46')][_0x87ed('0x2f')]);}_0x2c7930[_0x87ed('0x4d')]=qs['sort'](_0x577b02['query'][_0x87ed('0x4e')]);_0x2c7930['where']=qs[_0x87ed('0x48')](_[_0x87ed('0x50')](_0x577b02[_0x87ed('0x46')],_0x529803[_0x87ed('0x48')]));_0x2c7930[_0x87ed('0x4f')][_0x87ed('0x6b')]=_0x31fcce['id'];if(_0x577b02[_0x87ed('0x46')]['filter']){_0x2c7930[_0x87ed('0x4f')]=_[_0x87ed('0x52')](_0x2c7930[_0x87ed('0x4f')],{'$or':_[_0x87ed('0x40')](_0x2c7930[_0x87ed('0x49')],function(_0x1f164d){var _0x44596e={};_0x44596e[_0x1f164d]={'$like':'%'+_0x577b02[_0x87ed('0x46')][_0x87ed('0x51')]+'%'};return _0x44596e;})});}_0x2c7930=_[_0x87ed('0x52')]({},_0x2c7930,_0x577b02[_0x87ed('0x54')]);return db['SmsInteraction'][_0x87ed('0x55')]({'where':_0x2c7930[_0x87ed('0x4f')]})[_0x87ed('0x39')](function(_0x538f66){_0x3b694f[_0x87ed('0x55')]=_0x538f66;if(_0x577b02[_0x87ed('0x46')]['includeAll']){_0x2c7930[_0x87ed('0x57')]=[{'model':db[_0x87ed('0x79')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x87ed('0xc2'),'attributes':['name',_0x87ed('0xc3'),_0x87ed('0xc4')],'required':![]},{'model':db[_0x87ed('0xc5')],'as':_0x87ed('0xc6'),'attributes':['id',_0x87ed('0x3d'),_0x87ed('0xc7')],'where':_0x577b02[_0x87ed('0x46')]['tag']?{'id':_0x577b02[_0x87ed('0x46')][_0x87ed('0xc8')]}:undefined,'required':_0x577b02[_0x87ed('0x46')][_0x87ed('0xc8')]?!![]:![]}];}return db[_0x87ed('0xa0')]['findAll'](_0x2c7930);})[_0x87ed('0x39')](function(_0x52a454){_0x3b694f['rows']=_0x52a454;return _0x3b694f;});}})[_0x87ed('0x39')](respondWithFilteredResult(_0x5122b1,_0x2c7930))[_0x87ed('0x2a')](handleError(_0x5122b1,null));};exports[_0x87ed('0x3e')]=function(_0x3f09b1,_0x143716,_0x149996){var _0x28005f,_0x36dc0a,_0x3a88ac;if(_[_0x87ed('0x96')](_0x3f09b1['body'][_0x87ed('0x5f')])||_0x3f09b1[_0x87ed('0x5f')]['body']===''){throw new db[(_0x87ed('0x97'))]['ValidationError'](_0x87ed('0x98'));}if(_[_0x87ed('0x96')](_0x3f09b1['body']['to'])){throw new db[(_0x87ed('0x97'))][(_0x87ed('0x7a'))](_0x87ed('0xc9'));}_0x28005f=_0x3f09b1[_0x87ed('0x5f')]['to'];return db[_0x87ed('0x58')][_0x87ed('0x65')]({'where':{'id':_0x3f09b1[_0x87ed('0x5c')]['id']},'include':[{'model':db[_0x87ed('0xca')],'as':_0x87ed('0xcb'),'include':[{'model':db['CmContact'],'as':_0x87ed('0x9d'),'where':{'mobile':_0x28005f},'limit':0x1,'order':[[_0x87ed('0x7e'),_0x87ed('0x9e')]]}]}]})['then'](handleEntityNotFound(_0x143716,null))[_0x87ed('0x39')](function(_0x24e738){if(_0x24e738&&_0x24e738[_0x87ed('0xcb')]){_0x36dc0a=_0x24e738['get']({'plain':!![]});if(_0x36dc0a[_0x87ed('0xcb')]&&_0x36dc0a[_0x87ed('0xcb')][_0x87ed('0x9d')][_0x87ed('0x4b')]){return _0x36dc0a[_0x87ed('0xcb')][_0x87ed('0x9d')][0x0];}return db[_0x87ed('0x79')]['create'](_[_0x87ed('0x1a')](_0x3f09b1['body'],{'firstName':_0x28005f,'mobile':_0x28005f,'phone':_0x28005f,'ListId':_0x36dc0a['ListId']}));}})[_0x87ed('0x39')](handleEntityNotFound(_0x143716,null))[_0x87ed('0x39')](function(_0x1f66e8){if(_0x1f66e8){_0x3a88ac=_0x1f66e8;return db[_0x87ed('0xa0')][_0x87ed('0x65')]({'where':{'ContactId':_0x3a88ac['id'],'closed':![],'SmsAccountId':_0x36dc0a['id']}})['then'](function(_0x2c8fb4){if(_0x2c8fb4){return[_0x2c8fb4,![]];}return db[_0x87ed('0xa0')][_0x87ed('0x5e')]({'UserId':_0x3f09b1[_0x87ed('0x60')]['id'],'ContactId':_0x3a88ac['id'],'SmsAccountId':_0x36dc0a['id'],'phone':_0x28005f,'firstMsgDirection':_0x87ed('0xcc'),'Messages':[_['merge'](_0x3f09b1[_0x87ed('0x5f')],{'read':![],'body':_0x3f09b1['body'][_0x87ed('0x5f')],'phone':_0x28005f,'SmsAccountId':_0x36dc0a['id'],'UserId':_0x3f09b1[_0x87ed('0x60')]['id'],'ContactId':_0x3a88ac['id']})]},{'include':[{'model':db[_0x87ed('0xa8')],'as':_0x87ed('0xcd')}]})[_0x87ed('0x39')](function(_0x425fad){return[_0x425fad,!![]];});});}})[_0x87ed('0xa1')](function(_0x5a9df0,_0x47db25){if(_0x47db25){return _0x5a9df0;}return db['SmsMessage'][_0x87ed('0x5e')](_[_0x87ed('0x52')](_0x3f09b1[_0x87ed('0x5f')],{'read':![],'body':_0x3f09b1[_0x87ed('0x5f')][_0x87ed('0x5f')],'phone':_0x28005f,'SmsAccountId':_0x36dc0a['id'],'SmsInteractionId':_0x5a9df0['id'],'UserId':_0x3f09b1[_0x87ed('0x60')]['id'],'ContactId':_0x3a88ac['id']}))[_0x87ed('0x39')](function(_0x31f35e){_0x5a9df0['dataValues']['Messages']=[];_0x5a9df0['dataValues'][_0x87ed('0xcd')][_0x87ed('0xce')](_0x31f35e[_0x87ed('0xcf')]);return _0x5a9df0;});})[_0x87ed('0x39')](respondWithResult(_0x143716,null))['catch'](handleError(_0x143716,null));};exports[_0x87ed('0x2c')]=function(_0x140ca2,_0x21f404,_0x320733){if(_0x140ca2[_0x87ed('0x5f')]['id']){delete _0x140ca2[_0x87ed('0x5f')]['id'];}var _0x41c1aa,_0x4f10dd,_0x32699d;return db['SmsAccount'][_0x87ed('0x65')]({'where':{'id':_0x140ca2[_0x87ed('0x5c')]['id']}})[_0x87ed('0x39')](handleEntityNotFound(_0x21f404,null))[_0x87ed('0x39')](function(_0x4720fa){if(_0x4720fa){_0x32699d=_0x4720fa;logger[_0x87ed('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x87ed('0x2c'),'received\x20delivery\x20report\x20from',_0x4720fa[_0x87ed('0x43')],util['inspect'](_0x140ca2['body'],{'showHidden':![],'depth':null}));switch(_0x4720fa[_0x87ed('0x43')]){case'skebby':if(_0x140ca2[_0x87ed('0x5f')][_0x87ed('0xd0')]&&_0x140ca2[_0x87ed('0x5f')][_0x87ed('0x2c')]){_0x4f10dd=_0x140ca2[_0x87ed('0x5f')][_0x87ed('0x2c')];return db[_0x87ed('0xa8')][_0x87ed('0x65')]({'where':{'messageId':_0x140ca2['body'][_0x87ed('0xd0')]}});}break;case'connectel':if(_0x140ca2['body'][_0x87ed('0xd1')]&&_0x140ca2[_0x87ed('0x5f')][_0x87ed('0xd2')]){_0x4f10dd=_0x140ca2[_0x87ed('0x5f')]['statusInt'];return db[_0x87ed('0xa8')][_0x87ed('0x65')]({'where':{'messageId':_0x140ca2[_0x87ed('0x5f')][_0x87ed('0xd1')]}});}break;case _0x87ed('0x89'):if(_0x140ca2[_0x87ed('0x5f')][_0x87ed('0x8a')]&&_0x140ca2[_0x87ed('0x5f')][_0x87ed('0xd3')]){_0x4f10dd=_0x140ca2[_0x87ed('0x5f')][_0x87ed('0xd3')];return db[_0x87ed('0xa8')]['find']({'where':{'messageId':_0x140ca2['body']['message_id']}});}break;case _0x87ed('0xd4'):var _0x5e66fd=_0x140ca2[_0x87ed('0x5f')][_0x87ed('0x8d')][0x0];if(_0x5e66fd[_0x87ed('0x85')]&&_0x5e66fd[_0x87ed('0x2c')][_0x87ed('0xd5')]===_0x87ed('0xd6')){_0x4f10dd=_0x5e66fd['status'][_0x87ed('0xd5')];return db[_0x87ed('0xa8')][_0x87ed('0x65')]({'where':{'messageId':_0x5e66fd[_0x87ed('0x85')]}});}break;case _0x87ed('0x91'):if(_0x140ca2[_0x87ed('0x5f')][_0x87ed('0x85')]&&_0x140ca2['body'][_0x87ed('0x2c')]){_0x4f10dd=_0x140ca2['body'][_0x87ed('0x2c')];return db[_0x87ed('0xa8')]['find']({'where':{'messageId':_0x140ca2['body']['messageId']}});}break;case _0x87ed('0x94'):if(_0x140ca2['body'][0x0][_0x87ed('0x28')]['id']){_0x4f10dd=_0x140ca2[_0x87ed('0x5f')][0x0]['type'];return db[_0x87ed('0xa8')][_0x87ed('0x65')]({'where':{'messageId':_0x140ca2[_0x87ed('0x5f')][0x0]['message']['id']}});}break;case _0x87ed('0xd7'):if(_0x140ca2[_0x87ed('0x5f')]['redif']&&_0x140ca2[_0x87ed('0x5f')][_0x87ed('0x2c')]){_0x4f10dd=_0x140ca2[_0x87ed('0x5f')]['status'];return db[_0x87ed('0xa8')][_0x87ed('0x65')]({'where':{'messageId':_0x140ca2[_0x87ed('0x5f')][_0x87ed('0xd8')]}});}break;}}})[_0x87ed('0x39')](handleEntityNotFound(_0x21f404,null))[_0x87ed('0x39')](function(_0x40d26d){if(_0x40d26d){_0x41c1aa=_0x40d26d;switch(_0x32699d[_0x87ed('0x43')]){case'skebby':if(_0x4f10dd===_0x87ed('0xd6')){return _0x41c1aa[_0x87ed('0x37')]({'read':!![]});}else{logger[_0x87ed('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x87ed('0x2c'),_0x87ed('0x86'),util['inspect'](_0x140ca2[_0x87ed('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x87ed('0x88'):if(_0x4f10dd==='1'){return _0x41c1aa[_0x87ed('0x37')]({'read':!![]});}else{logger[_0x87ed('0x26')](_0x87ed('0x24'),_0x87ed('0x2c'),_0x87ed('0x86'),util[_0x87ed('0xd9')](_0x140ca2['body'],{'showHidden':![],'depth':null}));}break;case _0x87ed('0x89'):if(!_0x140ca2[_0x87ed('0x5f')]['error_code']&&_0x4f10dd>=0xc8&&_0x4f10dd<=0xce){return _0x41c1aa[_0x87ed('0x37')]({'read':!![]});}else{logger[_0x87ed('0x26')](_0x87ed('0x24'),'status','clicksend',util['inspect'](_0x140ca2[_0x87ed('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x87ed('0xd4'):var _0x1f1b4c=_0x140ca2[_0x87ed('0x5f')][_0x87ed('0x8d')][0x0];if(_0x1f1b4c['status'][_0x87ed('0xd5')]===_0x87ed('0xd6')){return _0x41c1aa[_0x87ed('0x37')]({'read':!![]});}else{logger['error'](_0x87ed('0x24'),'status',_0x87ed('0xd4'),util[_0x87ed('0xd9')](_0x140ca2[_0x87ed('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x87ed('0x91'):if(_0x4f10dd==_0x87ed('0xda')||_0x4f10dd=='RECEIVED_BY_RECIPIENT'){return _0x41c1aa[_0x87ed('0x37')]({'read':!![]});}else{logger[_0x87ed('0x26')](_0x87ed('0x24'),_0x87ed('0x2c'),_0x87ed('0x91'),util[_0x87ed('0xd9')](_0x140ca2['body'],{'showHidden':![],'depth':null}));}break;case _0x87ed('0x94'):if(_0x4f10dd=='message-delivered'){return _0x41c1aa[_0x87ed('0x37')]({'read':!![]});}else{logger[_0x87ed('0x26')](_0x87ed('0x24'),_0x87ed('0x2c'),_0x87ed('0x94'),util[_0x87ed('0xd9')](_0x140ca2[_0x87ed('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x87ed('0xd7'):if(_0x4f10dd===_0x87ed('0xdb')||_0x4f10dd==='ACCEPTD'){return _0x41c1aa[_0x87ed('0x37')]({'read':!![]});}else{logger[_0x87ed('0x26')](_0x87ed('0x24'),_0x87ed('0x2c'),_0x87ed('0xd7'),util['inspect'](_0x140ca2[_0x87ed('0x5f')],{'showHidden':![],'depth':null}));}break;}return _0x41c1aa;}})['then'](respondWithResult(_0x21f404,null))[_0x87ed('0x2a')](handleError(_0x21f404,null));};exports['statusGet']=function(_0x416723,_0xa5b2a3,_0x4366a8){var _0x3053ff,_0x514bfe,_0x56ae88;return db[_0x87ed('0x58')][_0x87ed('0x65')]({'where':{'id':_0x416723[_0x87ed('0x5c')]['id']}})[_0x87ed('0x39')](handleEntityNotFound(_0xa5b2a3,null))['then'](function(_0x3ede1f){if(_0x3ede1f){_0x56ae88=_0x3ede1f;logger['debug'](_0x87ed('0x24'),_0x87ed('0x2c'),'received\x20delivery\x20report\x20from',_0x3ede1f[_0x87ed('0x43')],util[_0x87ed('0xd9')](_0x416723['query'],{'showHidden':![],'depth':null}));switch(_0x3ede1f[_0x87ed('0x43')]){case _0x87ed('0x8e'):if(_0x416723[_0x87ed('0x46')][_0x87ed('0xdc')]&&_0x416723[_0x87ed('0x46')]['state']){_0x514bfe=_0x416723[_0x87ed('0x46')][_0x87ed('0xdd')];return db[_0x87ed('0xa8')][_0x87ed('0x65')]({'where':{'messageId':_0x416723[_0x87ed('0x46')][_0x87ed('0xdc')]}});}break;}}})[_0x87ed('0x39')](handleEntityNotFound(_0xa5b2a3,null))[_0x87ed('0x39')](function(_0x890209){if(_0x890209){_0x3053ff=_0x890209;switch(_0x56ae88[_0x87ed('0x43')]){case'csc':if(_0x514bfe==='2'||_0x514bfe==='6'){return _0x3053ff[_0x87ed('0x37')]({'read':!![]});}else{logger[_0x87ed('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x87ed('0x2c'),_0x87ed('0x8e'),util[_0x87ed('0xd9')](_0x416723[_0x87ed('0x46')],{'showHidden':![],'depth':null}));};break;}return _0x3053ff;}})[_0x87ed('0x39')](respondWithResult(_0xa5b2a3,null))['catch'](handleError(_0xa5b2a3,null));};exports[_0x87ed('0xde')]=function(_0x114d75,_0x5e8471,_0x41ad47){return db[_0x87ed('0x58')][_0x87ed('0x65')]({'where':{'id':_0x114d75['params']['id']}})[_0x87ed('0x39')](handleEntityNotFound(_0x5e8471,null))[_0x87ed('0x39')](function(_0x1ce420){if(_0x1ce420){return _0x1ce420[_0x87ed('0xde')](_0x114d75[_0x87ed('0x5f')][_0x87ed('0xdf')],_['omit'](_0x114d75['body'],['ids','id'])||{})[_0x87ed('0xa1')](function(_0x51833c){for(var _0x2a46d1=0x0;_0x2a46d1<_0x114d75[_0x87ed('0x5f')][_0x87ed('0xdf')][_0x87ed('0x4b')];_0x2a46d1+=0x1){socket[_0x87ed('0xe0')](_0x87ed('0xe1'),{'UserId':Number(_0x114d75[_0x87ed('0x5f')][_0x87ed('0xdf')][_0x2a46d1]),'SmsAccountId':Number(_0x114d75[_0x87ed('0x5c')]['id'])});}return _0x51833c;});}})[_0x87ed('0x39')](respondWithResult(_0x5e8471,null))[_0x87ed('0x2a')](handleError(_0x5e8471,null));};exports['removeAgents']=function(_0x54e421,_0x19a938,_0x42e12e){return db['SmsAccount']['find']({'where':{'id':_0x54e421[_0x87ed('0x5c')]['id']}})[_0x87ed('0x39')](handleEntityNotFound(_0x19a938,null))['then'](function(_0x5d6b54){if(_0x5d6b54){return _0x5d6b54[_0x87ed('0xe2')](_0x54e421['query'][_0x87ed('0xdf')])['then'](function(){if(_['isArray'](_0x54e421['query']['ids'])){for(var _0xa6b98c=0x0;_0xa6b98c<_0x54e421[_0x87ed('0x46')]['ids'][_0x87ed('0x4b')];_0xa6b98c+=0x1){socket[_0x87ed('0xe0')](_0x87ed('0xe3'),{'UserId':Number(_0x54e421[_0x87ed('0x46')][_0x87ed('0xdf')][_0xa6b98c]),'SmsAccountId':Number(_0x54e421[_0x87ed('0x5c')]['id'])});}}else{socket[_0x87ed('0xe0')](_0x87ed('0xe3'),{'UserId':Number(_0x54e421[_0x87ed('0x46')]['ids']),'SmsAccountId':Number(_0x54e421[_0x87ed('0x5c')]['id'])});}});}})['then'](respondWithStatusCode(_0x19a938,null))['catch'](handleError(_0x19a938,null));};exports[_0x87ed('0xe4')]=function(_0x5171aa,_0x5541db,_0x1ca9af){var _0x43e30d={};var _0x586ae9={};var _0x1fb29f;var _0x32d20d;return db[_0x87ed('0x58')][_0x87ed('0x71')]({'where':{'id':_0x5171aa[_0x87ed('0x5c')]['id']}})[_0x87ed('0x39')](handleEntityNotFound(_0x5541db,null))[_0x87ed('0x39')](function(_0x313ef7){if(_0x313ef7){_0x1fb29f=_0x313ef7;_0x586ae9[_0x87ed('0x45')]=_[_0x87ed('0x47')](db[_0x87ed('0xab')][_0x87ed('0x41')]);_0x586ae9[_0x87ed('0x46')]=_[_0x87ed('0x47')](_0x5171aa[_0x87ed('0x46')]);_0x586ae9['filters']=_['intersection'](_0x586ae9[_0x87ed('0x45')],_0x586ae9['query']);_0x43e30d[_0x87ed('0x49')]=_[_0x87ed('0x5d')](_0x586ae9[_0x87ed('0x45')],qs[_0x87ed('0x4a')](_0x5171aa['query']['fields']));_0x43e30d[_0x87ed('0x49')]=_0x43e30d[_0x87ed('0x49')][_0x87ed('0x4b')]?_0x43e30d[_0x87ed('0x49')]:_0x586ae9[_0x87ed('0x45')];_0x43e30d['order']=qs[_0x87ed('0x4e')](_0x5171aa['query']['sort']);_0x43e30d[_0x87ed('0x4f')]=qs['filters'](_[_0x87ed('0x50')](_0x5171aa['query'],_0x586ae9[_0x87ed('0x48')]));if(_0x5171aa[_0x87ed('0x46')][_0x87ed('0x51')]){_0x43e30d['where']=_[_0x87ed('0x52')](_0x43e30d[_0x87ed('0x4f')],{'$or':_['map'](_0x43e30d[_0x87ed('0x49')],function(_0x251914){var _0x1fb163={};_0x1fb163[_0x251914]={'$like':'%'+_0x5171aa['query']['filter']+'%'};return _0x1fb163;})});}_0x43e30d=_[_0x87ed('0x52')]({},_0x43e30d,_0x5171aa[_0x87ed('0x54')]);return _0x1fb29f[_0x87ed('0xe4')](_0x43e30d);}})['then'](function(_0xa0022b){if(_0xa0022b){_0x32d20d=_0xa0022b[_0x87ed('0x4b')];if(!_0x5171aa[_0x87ed('0x46')]['hasOwnProperty']('nolimit')){_0x43e30d[_0x87ed('0x30')]=qs[_0x87ed('0x30')](_0x5171aa[_0x87ed('0x46')]['limit']);_0x43e30d[_0x87ed('0x2f')]=qs[_0x87ed('0x2f')](_0x5171aa[_0x87ed('0x46')][_0x87ed('0x2f')]);}return _0x1fb29f[_0x87ed('0xe4')](_0x43e30d);}})[_0x87ed('0x39')](function(_0x2e0b0d){if(_0x2e0b0d){return _0x2e0b0d?{'count':_0x32d20d,'rows':_0x2e0b0d}:null;}})[_0x87ed('0x39')](respondWithResult(_0x5541db,null))[_0x87ed('0x2a')](handleError(_0x5541db,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 36aad26..9a8ada2 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 _0x80a3=['emit','hasOwnProperty','hook','events','../../mysqldb','SmsAccount','update','remove'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x80a3,0x13b));var _0x380a=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0x80a3[_0x37c22c];return _0x119d79;};'use strict';var EventEmitter=require(_0x380a('0x0'));var SmsAccount=require(_0x380a('0x1'))['db'][_0x380a('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x380a('0x3'),'afterDestroy':_0x380a('0x4')};function emitEvent(_0x1d0187){return function(_0x46807a,_0x234763,_0x39888e){SmsAccountEvents[_0x380a('0x5')](_0x1d0187+':'+_0x46807a['id'],_0x46807a);SmsAccountEvents['emit'](_0x1d0187,_0x46807a);_0x39888e(null);};}for(var e in events){if(events[_0x380a('0x6')](e)){var event=events[e];SmsAccount[_0x380a('0x7')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file +var _0xe301=['remove','emit','hook','exports','events','../../mysqldb','SmsAccount','save','update'];(function(_0xbde851,_0x2628f6){var _0x3fadbe=function(_0x365118){while(--_0x365118){_0xbde851['push'](_0xbde851['shift']());}};_0x3fadbe(++_0x2628f6);}(_0xe301,0x163));var _0x1e30=function(_0x4d063a,_0x253bff){_0x4d063a=_0x4d063a-0x0;var _0x333040=_0xe301[_0x4d063a];return _0x333040;};'use strict';var EventEmitter=require(_0x1e30('0x0'));var SmsAccount=require(_0x1e30('0x1'))['db'][_0x1e30('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1e30('0x3'),'afterUpdate':_0x1e30('0x4'),'afterDestroy':_0x1e30('0x5')};function emitEvent(_0x5dea26){return function(_0x4cd325,_0x401e97,_0x12acbb){SmsAccountEvents[_0x1e30('0x6')](_0x5dea26+':'+_0x4cd325['id'],_0x4cd325);SmsAccountEvents[_0x1e30('0x6')](_0x5dea26,_0x4cd325);_0x12acbb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0x1e30('0x7')](e,emitEvent(event));}}module[_0x1e30('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 890f6cf..961cfb7 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 _0xfd9e=['lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports','define','SmsAccount','sms_accounts'];(function(_0x4953da,_0x5adaca){var _0x2d3780=function(_0x458f36){while(--_0x458f36){_0x4953da['push'](_0x4953da['shift']());}};_0x2d3780(++_0x5adaca);}(_0xfd9e,0x1d4));var _0xefd9=function(_0x1eb3f6,_0x3f8dc7){_0x1eb3f6=_0x1eb3f6-0x0;var _0x511f68=_0xfd9e[_0x1eb3f6];return _0x511f68;};'use strict';var _=require(_0xefd9('0x0'));var util=require(_0xefd9('0x1'));var logger=require(_0xefd9('0x2'))(_0xefd9('0x3'));var moment=require('moment');var BPromise=require(_0xefd9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xefd9('0x5'));var rimraf=require(_0xefd9('0x6'));var config=require(_0xefd9('0x7'));var attributes=require('./smsAccount.attributes');module[_0xefd9('0x8')]=function(_0x516026,_0x2e3c27){return _0x516026[_0xefd9('0x9')](_0xefd9('0xa'),attributes,{'tableName':_0xefd9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x626d=['request-promise','path','rimraf','../../config/environment','./smsAccount.attributes','define','SmsAccount','sms_accounts','../../config/logger','moment'];(function(_0x3179d0,_0x33fa89){var _0x1bc5e3=function(_0x3a1a78){while(--_0x3a1a78){_0x3179d0['push'](_0x3179d0['shift']());}};_0x1bc5e3(++_0x33fa89);}(_0x626d,0x80));var _0xd626=function(_0x5a984c,_0x442206){_0x5a984c=_0x5a984c-0x0;var _0x1d8785=_0x626d[_0x5a984c];return _0x1d8785;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd626('0x0'))('api');var moment=require(_0xd626('0x1'));var BPromise=require('bluebird');var rp=require(_0xd626('0x2'));var fs=require('fs');var path=require(_0xd626('0x3'));var rimraf=require(_0xd626('0x4'));var config=require(_0xd626('0x5'));var attributes=require(_0xd626('0x6'));module['exports']=function(_0x8298d3,_0x4b042a){return _0x8298d3[_0xd626('0x7')](_0xd626('0x8'),attributes,{'tableName':_0xd626('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index 58e0deb..bfa9bb8 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 _0x5397=['model','ShowSmsAccount','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','./smsAccount.socket','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','find','options','attributes','include','map'];(function(_0x163fec,_0x2e0c0d){var _0x312832=function(_0x285516){while(--_0x285516){_0x163fec['push'](_0x163fec['shift']());}};_0x312832(++_0x2e0c0d);}(_0x5397,0xea));var _0x7539=function(_0x3352b4,_0x48fb7e){_0x3352b4=_0x3352b4-0x0;var _0x3cd6bf=_0x5397[_0x3352b4];return _0x3cd6bf;};'use strict';var _=require('lodash');var util=require(_0x7539('0x0'));var moment=require(_0x7539('0x1'));var BPromise=require(_0x7539('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7539('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7539('0x4'))(_0x7539('0x5'));var config=require(_0x7539('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x7539('0x7')][_0x7539('0x8')]({'port':0x232a});config['redis']=_[_0x7539('0x9')](config[_0x7539('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7539('0xa')]));require(_0x7539('0xb'))['register'](socket);function respondWithRpcPromise(_0x2a65c4,_0x4733ad,_0x2a074d){return new BPromise(function(_0x37ba67,_0x255a27){return client['request'](_0x2a65c4,_0x2a074d)[_0x7539('0xc')](function(_0x45e49c){logger[_0x7539('0xd')](_0x7539('0xe'),_0x4733ad,_0x7539('0xf'));logger[_0x7539('0x10')](_0x7539('0x11'),_0x4733ad,_0x7539('0xf'),JSON[_0x7539('0x12')](_0x45e49c));if(_0x45e49c[_0x7539('0x13')]){if(_0x45e49c['error']['code']===0x1f4){logger['error'](_0x7539('0xe'),_0x4733ad,_0x45e49c[_0x7539('0x13')][_0x7539('0x14')]);return _0x255a27(_0x45e49c[_0x7539('0x13')][_0x7539('0x14')]);}logger['error']('SmsAccount,\x20%s,\x20%s',_0x4733ad,_0x45e49c[_0x7539('0x13')][_0x7539('0x14')]);return _0x37ba67(_0x45e49c[_0x7539('0x13')][_0x7539('0x14')]);}else{logger[_0x7539('0xd')](_0x7539('0xe'),_0x4733ad,_0x7539('0xf'));_0x37ba67(_0x45e49c['result'][_0x7539('0x14')]);}})[_0x7539('0x15')](function(_0x5d029e){logger['error'](_0x7539('0xe'),_0x4733ad,_0x5d029e);_0x255a27(_0x5d029e);});});}exports['ShowSmsAccount']=function(_0x19f071){var _0x169a11=this;return new Promise(function(_0x2e608e,_0x4a97ef){return db['SmsAccount'][_0x7539('0x16')]({'raw':_0x19f071[_0x7539('0x17')]?_0x19f071[_0x7539('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x19f071[_0x7539('0x17')]?_0x19f071['options']['where']||null:null,'attributes':_0x19f071[_0x7539('0x17')]?_0x19f071['options'][_0x7539('0x18')]||null:null,'include':_0x19f071['options']?_0x19f071[_0x7539('0x17')][_0x7539('0x19')]?_[_0x7539('0x1a')](_0x19f071[_0x7539('0x17')][_0x7539('0x19')],function(_0x85ea45){return{'model':db[_0x85ea45[_0x7539('0x1b')]],'as':_0x85ea45['as'],'attributes':_0x85ea45[_0x7539('0x18')],'include':_0x85ea45[_0x7539('0x19')]?_['map'](_0x85ea45[_0x7539('0x19')],function(_0x20627d){return{'model':db[_0x20627d['model']],'as':_0x20627d['as'],'attributes':_0x20627d[_0x7539('0x18')],'include':_0x20627d[_0x7539('0x19')]?_['map'](_0x20627d['include'],function(_0x17b651){return{'model':db[_0x17b651[_0x7539('0x1b')]],'as':_0x17b651['as'],'attributes':_0x17b651[_0x7539('0x18')]};}):[]};}):[]};}):[]:[]})[_0x7539('0xc')](function(_0x21c68c){logger[_0x7539('0xd')](_0x7539('0x1c'),_0x19f071);logger[_0x7539('0x10')](_0x7539('0x1c'),_0x19f071,JSON[_0x7539('0x12')](_0x21c68c));_0x2e608e(_0x21c68c);})['catch'](function(_0x1e0853){logger[_0x7539('0x13')](_0x7539('0x1c'),_0x1e0853[_0x7539('0x14')],_0x19f071);_0x4a97ef(_0x169a11[_0x7539('0x13')](0x1f4,_0x1e0853[_0x7539('0x14')]));});});}; \ No newline at end of file +var _0x83b1=['request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ShowSmsAccount','SmsAccount','find','options','attributes','include','map','then','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','request','info','SmsAccount,\x20%s,\x20%s'];(function(_0x506d1a,_0x564d78){var _0xbfdf21=function(_0x2272c5){while(--_0x2272c5){_0x506d1a['push'](_0x506d1a['shift']());}};_0xbfdf21(++_0x564d78);}(_0x83b1,0xa4));var _0x183b=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x83b1[_0x5b561d];return _0x431060;};'use strict';var _=require(_0x183b('0x0'));var util=require(_0x183b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x183b('0x2'));var fs=require('fs');var Redis=require(_0x183b('0x3'));var db=require(_0x183b('0x4'))['db'];var utils=require(_0x183b('0x5'));var logger=require(_0x183b('0x6'))(_0x183b('0x7'));var config=require(_0x183b('0x8'));var jayson=require(_0x183b('0x9'));var client=jayson[_0x183b('0xa')][_0x183b('0xb')]({'port':0x232a});config[_0x183b('0xc')]=_[_0x183b('0xd')](config[_0x183b('0xc')],{'host':_0x183b('0xe'),'port':0x18eb});var socket=require(_0x183b('0xf'))(new Redis(config[_0x183b('0xc')]));require(_0x183b('0x10'))[_0x183b('0x11')](socket);function respondWithRpcPromise(_0x439a59,_0x6190a3,_0x209b82){return new BPromise(function(_0x260f75,_0x184203){return client[_0x183b('0x12')](_0x439a59,_0x209b82)['then'](function(_0x12d8a6){logger[_0x183b('0x13')](_0x183b('0x14'),_0x6190a3,_0x183b('0x15'));logger[_0x183b('0x16')](_0x183b('0x17'),_0x6190a3,_0x183b('0x15'),JSON[_0x183b('0x18')](_0x12d8a6));if(_0x12d8a6[_0x183b('0x19')]){if(_0x12d8a6['error'][_0x183b('0x1a')]===0x1f4){logger[_0x183b('0x19')](_0x183b('0x14'),_0x6190a3,_0x12d8a6['error'][_0x183b('0x1b')]);return _0x184203(_0x12d8a6[_0x183b('0x19')][_0x183b('0x1b')]);}logger['error'](_0x183b('0x14'),_0x6190a3,_0x12d8a6[_0x183b('0x19')][_0x183b('0x1b')]);return _0x260f75(_0x12d8a6[_0x183b('0x19')]['message']);}else{logger[_0x183b('0x13')](_0x183b('0x14'),_0x6190a3,_0x183b('0x15'));_0x260f75(_0x12d8a6['result'][_0x183b('0x1b')]);}})[_0x183b('0x1c')](function(_0x5f3809){logger[_0x183b('0x19')]('SmsAccount,\x20%s,\x20%s',_0x6190a3,_0x5f3809);_0x184203(_0x5f3809);});});}exports[_0x183b('0x1d')]=function(_0x14a307){var _0x5efa1c=this;return new Promise(function(_0x30f1e7,_0x50be65){return db[_0x183b('0x1e')][_0x183b('0x1f')]({'raw':_0x14a307[_0x183b('0x20')]?_0x14a307[_0x183b('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x14a307['options']?_0x14a307['options']['where']||null:null,'attributes':_0x14a307[_0x183b('0x20')]?_0x14a307[_0x183b('0x20')][_0x183b('0x21')]||null:null,'include':_0x14a307['options']?_0x14a307[_0x183b('0x20')][_0x183b('0x22')]?_[_0x183b('0x23')](_0x14a307['options'][_0x183b('0x22')],function(_0x5872c9){return{'model':db[_0x5872c9['model']],'as':_0x5872c9['as'],'attributes':_0x5872c9['attributes'],'include':_0x5872c9[_0x183b('0x22')]?_[_0x183b('0x23')](_0x5872c9[_0x183b('0x22')],function(_0x5a7450){return{'model':db[_0x5a7450['model']],'as':_0x5a7450['as'],'attributes':_0x5a7450[_0x183b('0x21')],'include':_0x5a7450['include']?_[_0x183b('0x23')](_0x5a7450[_0x183b('0x22')],function(_0x395f18){return{'model':db[_0x395f18['model']],'as':_0x395f18['as'],'attributes':_0x395f18[_0x183b('0x21')]};}):[]};}):[]};}):[]:[]})[_0x183b('0x24')](function(_0xe935f){logger[_0x183b('0x13')](_0x183b('0x1d'),_0x14a307);logger[_0x183b('0x16')]('ShowSmsAccount',_0x14a307,JSON[_0x183b('0x18')](_0xe935f));_0x30f1e7(_0xe935f);})[_0x183b('0x1c')](function(_0x5ae0a2){logger[_0x183b('0x19')](_0x183b('0x1d'),_0x5ae0a2[_0x183b('0x1b')],_0x14a307);_0x50be65(_0x5efa1c[_0x183b('0x19')](0x1f4,_0x5ae0a2[_0x183b('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index e3c0e31..57677d8 100644 --- a/server/api/smsAccount/smsAccount.socket.js +++ b/server/api/smsAccount/smsAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'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(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'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 a878552..d4e3b29 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 _0x55ca=['update','delete','/:id','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','show','create'];(function(_0x168e03,_0x21885f){var _0x12ba32=function(_0x23bcc){while(--_0x23bcc){_0x168e03['push'](_0x168e03['shift']());}};_0x12ba32(++_0x21885f);}(_0x55ca,0x126));var _0xa55c=function(_0x456a4b,_0x51df8){_0x456a4b=_0x456a4b-0x0;var _0x42957c=_0x55ca[_0x456a4b];return _0x42957c;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['post']('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0xb')]);router['put']('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xc')]);router[_0xa55c('0xd')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);module[_0xa55c('0x10')]=router; \ No newline at end of file +var _0xe14b=['/:id','create','put','exports','multer','util','express','Router','../../components/auth/service','./smsApplication.controller','get','isAuthenticated','index'];(function(_0x19b052,_0x346d97){var _0x1b64d6=function(_0x1cdffa){while(--_0x1cdffa){_0x19b052['push'](_0x19b052['shift']());}};_0x1b64d6(++_0x346d97);}(_0xe14b,0x93));var _0xbe14=function(_0xc74c4,_0x32fe57){_0xc74c4=_0xc74c4-0x0;var _0x5828b6=_0xe14b[_0xc74c4];return _0x5828b6;};'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 diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index bc6d39e..b2e0816 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 _0xc8b7=['noop','TEXT','*,*,*,*','sequelize','STRING'];(function(_0x5d2ebd,_0x10656e){var _0x47032f=function(_0x193534){while(--_0x193534){_0x5d2ebd['push'](_0x5d2ebd['shift']());}};_0x47032f(++_0x10656e);}(_0xc8b7,0x1c5));var _0x7c8b=function(_0x5dc02f,_0x314407){_0x5dc02f=_0x5dc02f-0x0;var _0x240b65=_0xc8b7[_0x5dc02f];return _0x240b65;};'use strict';var Sequelize=require(_0x7c8b('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x7c8b('0x1')],'allowNull':![],'defaultValue':_0x7c8b('0x2')},'appdata':{'type':Sequelize[_0x7c8b('0x3')]()},'description':{'type':Sequelize[_0x7c8b('0x1')]},'interval':{'type':Sequelize[_0x7c8b('0x1')],'defaultValue':_0x7c8b('0x4')}}; \ No newline at end of file +var _0x8b3d=['noop','TEXT','*,*,*,*','exports','INTEGER','STRING'];(function(_0x3566ea,_0x50e87d){var _0x24c0b9=function(_0x1f22a5){while(--_0x1f22a5){_0x3566ea['push'](_0x3566ea['shift']());}};_0x24c0b9(++_0x50e87d);}(_0x8b3d,0x19b));var _0xd8b3=function(_0x130271,_0xfb24a3){_0x130271=_0x130271-0x0;var _0x10c22f=_0x8b3d[_0x130271];return _0x10c22f;};'use strict';var Sequelize=require('sequelize');module[_0xd8b3('0x0')]={'priority':{'type':Sequelize[_0xd8b3('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xd8b3('0x2')],'allowNull':![],'defaultValue':_0xd8b3('0x3')},'appdata':{'type':Sequelize[_0xd8b3('0x4')]()},'description':{'type':Sequelize[_0xd8b3('0x2')]},'interval':{'type':Sequelize[_0xd8b3('0x2')],'defaultValue':_0xd8b3('0x5')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 302d953..273dd1c 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 _0xc859=['includeAll','create','body','update','find','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','SmsApplication','include','rows','catch','show','params','keys'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc859,0xe3));var _0x9c85=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xc859[_0x543084];return _0x306a57;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9c85('0x0'));var jsonpatch=require(_0x9c85('0x1'));var rp=require(_0x9c85('0x2'));var moment=require(_0x9c85('0x3'));var BPromise=require(_0x9c85('0x4'));var Mustache=require('mustache');var util=require(_0x9c85('0x5'));var path=require(_0x9c85('0x6'));var sox=require(_0x9c85('0x7'));var csv=require(_0x9c85('0x8'));var ejs=require(_0x9c85('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9c85('0xa'));var crypto=require(_0x9c85('0xb'));var jsforce=require(_0x9c85('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9c85('0x8'));var querystring=require(_0x9c85('0xd'));var Papa=require('papaparse');var Redis=require(_0x9c85('0xe'));var authService=require(_0x9c85('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9c85('0x10'));var logger=require(_0x9c85('0x11'))(_0x9c85('0x12'));var utils=require(_0x9c85('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x9c85('0x14'));var db=require(_0x9c85('0x15'))['db'];function respondWithStatusCode(_0x9eb3d0,_0x191f1f){_0x191f1f=_0x191f1f||0xcc;return function(_0x4fe511){if(_0x4fe511){return _0x9eb3d0[_0x9c85('0x16')](_0x191f1f);}return _0x9eb3d0[_0x9c85('0x17')](_0x191f1f)[_0x9c85('0x18')]();};}function respondWithResult(_0x3423b0,_0x33e693){_0x33e693=_0x33e693||0xc8;return function(_0xd7b1f8){if(_0xd7b1f8){return _0x3423b0[_0x9c85('0x17')](_0x33e693)[_0x9c85('0x19')](_0xd7b1f8);}};}function respondWithFilteredResult(_0x41eace,_0x5829fd){return function(_0x364559){if(_0x364559){var _0x2108a2=typeof _0x5829fd[_0x9c85('0x1a')]===_0x9c85('0x1b')&&typeof _0x5829fd[_0x9c85('0x1c')]===_0x9c85('0x1b');var _0x49edd7=_0x364559['count'];var _0x1b47b1=_0x2108a2?0x0:_0x5829fd[_0x9c85('0x1a')];var _0x3af829=_0x2108a2?_0x364559[_0x9c85('0x1d')]:_0x5829fd[_0x9c85('0x1a')]+_0x5829fd[_0x9c85('0x1c')];var _0x353adc;if(_0x3af829>=_0x49edd7){_0x3af829=_0x49edd7;_0x353adc=0xc8;}else{_0x353adc=0xce;}_0x41eace[_0x9c85('0x17')](_0x353adc);return _0x41eace[_0x9c85('0x1e')](_0x9c85('0x1f'),_0x1b47b1+'-'+_0x3af829+'/'+_0x49edd7)[_0x9c85('0x19')](_0x364559);}return null;};}function patchUpdates(_0x415d71){return function(_0x47a0dd){try{jsonpatch[_0x9c85('0x20')](_0x47a0dd,_0x415d71,!![]);}catch(_0x5ffba9){return BPromise[_0x9c85('0x21')](_0x5ffba9);}return _0x47a0dd[_0x9c85('0x22')]();};}function saveUpdates(_0x3119c8,_0x11812b){return function(_0x1b3c03){if(_0x1b3c03){return _0x1b3c03['update'](_0x3119c8)[_0x9c85('0x23')](function(_0xed28bb){return _0xed28bb;});}return null;};}function removeEntity(_0x569076,_0x254c24){return function(_0x2c5083){if(_0x2c5083){return _0x2c5083[_0x9c85('0x24')]()[_0x9c85('0x23')](function(){_0x569076[_0x9c85('0x17')](0xcc)[_0x9c85('0x18')]();});}};}function handleEntityNotFound(_0x376776,_0x43f4a7){return function(_0x2ee975){if(!_0x2ee975){_0x376776[_0x9c85('0x16')](0x194);}return _0x2ee975;};}function handleError(_0x3424ec,_0x3a2d59){_0x3a2d59=_0x3a2d59||0x1f4;return function(_0x1fa345){logger[_0x9c85('0x25')](_0x1fa345[_0x9c85('0x26')]);if(_0x1fa345[_0x9c85('0x27')]){delete _0x1fa345['name'];}_0x3424ec[_0x9c85('0x17')](_0x3a2d59)['send'](_0x1fa345);};}exports[_0x9c85('0x28')]=function(_0x21f197,_0x4d979b){var _0xf7f733={},_0x54c70e={},_0x472751={'count':0x0,'rows':[]};var _0x2fcec1=_[_0x9c85('0x29')](db['SmsApplication'][_0x9c85('0x2a')],function(_0x4dbac0){return{'name':_0x4dbac0[_0x9c85('0x2b')],'type':_0x4dbac0[_0x9c85('0x2c')][_0x9c85('0x2d')]};});_0x54c70e[_0x9c85('0x2e')]=_[_0x9c85('0x29')](_0x2fcec1,'name');_0x54c70e[_0x9c85('0x2f')]=_['keys'](_0x21f197[_0x9c85('0x2f')]);_0x54c70e['filters']=_[_0x9c85('0x30')](_0x54c70e[_0x9c85('0x2e')],_0x54c70e[_0x9c85('0x2f')]);_0xf7f733['attributes']=_[_0x9c85('0x30')](_0x54c70e[_0x9c85('0x2e')],qs['fields'](_0x21f197[_0x9c85('0x2f')][_0x9c85('0x31')]));_0xf7f733['attributes']=_0xf7f733[_0x9c85('0x32')][_0x9c85('0x33')]?_0xf7f733[_0x9c85('0x32')]:_0x54c70e['model'];if(!_0x21f197[_0x9c85('0x2f')][_0x9c85('0x34')](_0x9c85('0x35'))){_0xf7f733[_0x9c85('0x1c')]=qs['limit'](_0x21f197[_0x9c85('0x2f')][_0x9c85('0x1c')]);_0xf7f733[_0x9c85('0x1a')]=qs[_0x9c85('0x1a')](_0x21f197[_0x9c85('0x2f')][_0x9c85('0x1a')]);}_0xf7f733[_0x9c85('0x36')]=qs[_0x9c85('0x37')](_0x21f197[_0x9c85('0x2f')]['sort']);_0xf7f733['where']=qs[_0x9c85('0x38')](_['pick'](_0x21f197[_0x9c85('0x2f')],_0x54c70e[_0x9c85('0x38')]),_0x2fcec1);if(_0x21f197[_0x9c85('0x2f')][_0x9c85('0x39')]){_0xf7f733[_0x9c85('0x3a')]=_[_0x9c85('0x3b')](_0xf7f733['where'],{'$or':_[_0x9c85('0x29')](_0x2fcec1,function(_0x354073){if(_0x354073['type']!==_0x9c85('0x3c')){var _0x4a735b={};_0x4a735b[_0x354073[_0x9c85('0x27')]]={'$like':'%'+_0x21f197['query']['filter']+'%'};return _0x4a735b;}})});}_0xf7f733=_['merge']({},_0xf7f733,_0x21f197[_0x9c85('0x3d')]);var _0x6d571b={'where':_0xf7f733['where']};return db[_0x9c85('0x3e')][_0x9c85('0x1d')](_0x6d571b)['then'](function(_0x508121){_0x472751[_0x9c85('0x1d')]=_0x508121;if(_0x21f197['query']['includeAll']){_0xf7f733[_0x9c85('0x3f')]=[{'all':!![]}];}return db['SmsApplication']['findAll'](_0xf7f733);})[_0x9c85('0x23')](function(_0x255689){_0x472751[_0x9c85('0x40')]=_0x255689;return _0x472751;})[_0x9c85('0x23')](respondWithFilteredResult(_0x4d979b,_0xf7f733))[_0x9c85('0x41')](handleError(_0x4d979b,null));};exports[_0x9c85('0x42')]=function(_0x2baee3,_0x281b3c){var _0x1439a1={'raw':!![],'where':{'id':_0x2baee3[_0x9c85('0x43')]['id']}},_0xc8ced5={};_0xc8ced5[_0x9c85('0x2e')]=_[_0x9c85('0x44')](db[_0x9c85('0x3e')][_0x9c85('0x2a')]);_0xc8ced5[_0x9c85('0x2f')]=_[_0x9c85('0x44')](_0x2baee3[_0x9c85('0x2f')]);_0xc8ced5['filters']=_[_0x9c85('0x30')](_0xc8ced5[_0x9c85('0x2e')],_0xc8ced5['query']);_0x1439a1[_0x9c85('0x32')]=_[_0x9c85('0x30')](_0xc8ced5[_0x9c85('0x2e')],qs[_0x9c85('0x31')](_0x2baee3['query']['fields']));_0x1439a1[_0x9c85('0x32')]=_0x1439a1[_0x9c85('0x32')][_0x9c85('0x33')]?_0x1439a1['attributes']:_0xc8ced5[_0x9c85('0x2e')];if(_0x2baee3['query'][_0x9c85('0x45')]){_0x1439a1['include']=[{'all':!![]}];}_0x1439a1=_[_0x9c85('0x3b')]({},_0x1439a1,_0x2baee3[_0x9c85('0x3d')]);return db[_0x9c85('0x3e')]['find'](_0x1439a1)['then'](handleEntityNotFound(_0x281b3c,null))['then'](respondWithResult(_0x281b3c,null))['catch'](handleError(_0x281b3c,null));};exports[_0x9c85('0x46')]=function(_0x3d856f,_0x465dfc){return db['SmsApplication'][_0x9c85('0x46')](_0x3d856f[_0x9c85('0x47')],{})[_0x9c85('0x23')](respondWithResult(_0x465dfc,0xc9))[_0x9c85('0x41')](handleError(_0x465dfc,null));};exports[_0x9c85('0x48')]=function(_0x43d9fc,_0x2f25a1){if(_0x43d9fc[_0x9c85('0x47')]['id']){delete _0x43d9fc[_0x9c85('0x47')]['id'];}return db[_0x9c85('0x3e')][_0x9c85('0x49')]({'where':{'id':_0x43d9fc[_0x9c85('0x43')]['id']}})['then'](handleEntityNotFound(_0x2f25a1,null))[_0x9c85('0x23')](saveUpdates(_0x43d9fc[_0x9c85('0x47')],null))[_0x9c85('0x23')](respondWithResult(_0x2f25a1,null))['catch'](handleError(_0x2f25a1,null));};exports[_0x9c85('0x24')]=function(_0x54763c,_0xbcbf9e){return db[_0x9c85('0x3e')][_0x9c85('0x49')]({'where':{'id':_0x54763c[_0x9c85('0x43')]['id']}})[_0x9c85('0x23')](handleEntityNotFound(_0xbcbf9e,null))[_0x9c85('0x23')](removeEntity(_0xbcbf9e,null))['catch'](handleError(_0xbcbf9e,null));}; \ No newline at end of file +var _0xfa0a=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','offset','undefined','count','limit','status','json','apply','reject','save','destroy','then','sendStatus','error','stack','name','send','index','map','SmsApplication','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','length','find','catch','create','body'];(function(_0x167fa5,_0x2001cb){var _0x233dc2=function(_0x53ec43){while(--_0x53ec43){_0x167fa5['push'](_0x167fa5['shift']());}};_0x233dc2(++_0x2001cb);}(_0xfa0a,0x138));var _0xafa0=function(_0x2cc8bb,_0x5f2607){_0x2cc8bb=_0x2cc8bb-0x0;var _0x140e40=_0xfa0a[_0x2cc8bb];return _0x140e40;};'use strict';var emlformat=require(_0xafa0('0x0'));var rimraf=require(_0xafa0('0x1'));var zipdir=require(_0xafa0('0x2'));var jsonpatch=require(_0xafa0('0x3'));var rp=require(_0xafa0('0x4'));var moment=require('moment');var BPromise=require(_0xafa0('0x5'));var Mustache=require(_0xafa0('0x6'));var util=require('util');var path=require(_0xafa0('0x7'));var sox=require(_0xafa0('0x8'));var csv=require(_0xafa0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xafa0('0xa'));var _=require('lodash');var squel=require(_0xafa0('0xb'));var crypto=require(_0xafa0('0xc'));var jsforce=require(_0xafa0('0xd'));var deskjs=require(_0xafa0('0xe'));var toCsv=require('to-csv');var querystring=require(_0xafa0('0xf'));var Papa=require(_0xafa0('0x10'));var Redis=require(_0xafa0('0x11'));var authService=require(_0xafa0('0x12'));var qs=require(_0xafa0('0x13'));var as=require(_0xafa0('0x14'));var hardwareService=require(_0xafa0('0x15'));var logger=require('../../config/logger')(_0xafa0('0x16'));var utils=require(_0xafa0('0x17'));var config=require(_0xafa0('0x18'));var licenseUtil=require(_0xafa0('0x19'));var db=require(_0xafa0('0x1a'))['db'];function respondWithStatusCode(_0x280802,_0x6a841d){_0x6a841d=_0x6a841d||0xcc;return function(_0x316738){if(_0x316738){return _0x280802['sendStatus'](_0x6a841d);}return _0x280802['status'](_0x6a841d)[_0xafa0('0x1b')]();};}function respondWithResult(_0x59de25,_0x142d21){_0x142d21=_0x142d21||0xc8;return function(_0x2172bf){if(_0x2172bf){return _0x59de25['status'](_0x142d21)['json'](_0x2172bf);}};}function respondWithFilteredResult(_0x30615e,_0x45c391){return function(_0x50a326){if(_0x50a326){var _0xa1077b=typeof _0x45c391[_0xafa0('0x1c')]===_0xafa0('0x1d')&&typeof _0x45c391['limit']==='undefined';var _0xd75e65=_0x50a326[_0xafa0('0x1e')];var _0x2364d2=_0xa1077b?0x0:_0x45c391[_0xafa0('0x1c')];var _0x166146=_0xa1077b?_0x50a326[_0xafa0('0x1e')]:_0x45c391[_0xafa0('0x1c')]+_0x45c391[_0xafa0('0x1f')];var _0x301280;if(_0x166146>=_0xd75e65){_0x166146=_0xd75e65;_0x301280=0xc8;}else{_0x301280=0xce;}_0x30615e[_0xafa0('0x20')](_0x301280);return _0x30615e['set']('Content-Range',_0x2364d2+'-'+_0x166146+'/'+_0xd75e65)[_0xafa0('0x21')](_0x50a326);}return null;};}function patchUpdates(_0xd826bd){return function(_0x2b5791){try{jsonpatch[_0xafa0('0x22')](_0x2b5791,_0xd826bd,!![]);}catch(_0x4efc68){return BPromise[_0xafa0('0x23')](_0x4efc68);}return _0x2b5791[_0xafa0('0x24')]();};}function saveUpdates(_0x5e5159,_0x2af25f){return function(_0x42c5c0){if(_0x42c5c0){return _0x42c5c0['update'](_0x5e5159)['then'](function(_0x3f65f3){return _0x3f65f3;});}return null;};}function removeEntity(_0x1eb08b,_0x3d1f18){return function(_0x35d2e6){if(_0x35d2e6){return _0x35d2e6[_0xafa0('0x25')]()[_0xafa0('0x26')](function(){_0x1eb08b[_0xafa0('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x404290,_0x4b30c9){return function(_0xa532a0){if(!_0xa532a0){_0x404290[_0xafa0('0x27')](0x194);}return _0xa532a0;};}function handleError(_0x101d21,_0x2ef387){_0x2ef387=_0x2ef387||0x1f4;return function(_0x345b53){logger[_0xafa0('0x28')](_0x345b53[_0xafa0('0x29')]);if(_0x345b53[_0xafa0('0x2a')]){delete _0x345b53[_0xafa0('0x2a')];}_0x101d21['status'](_0x2ef387)[_0xafa0('0x2b')](_0x345b53);};}exports[_0xafa0('0x2c')]=function(_0xaf9147,_0x1906cd){var _0x1149f3={},_0x4c3670={},_0x953723={'count':0x0,'rows':[]};var _0x243b98=_[_0xafa0('0x2d')](db[_0xafa0('0x2e')][_0xafa0('0x2f')],function(_0x1b0fd3){return{'name':_0x1b0fd3[_0xafa0('0x30')],'type':_0x1b0fd3[_0xafa0('0x31')][_0xafa0('0x32')]};});_0x4c3670[_0xafa0('0x33')]=_[_0xafa0('0x2d')](_0x243b98,'name');_0x4c3670[_0xafa0('0x34')]=_['keys'](_0xaf9147[_0xafa0('0x34')]);_0x4c3670[_0xafa0('0x35')]=_[_0xafa0('0x36')](_0x4c3670[_0xafa0('0x33')],_0x4c3670['query']);_0x1149f3[_0xafa0('0x37')]=_[_0xafa0('0x36')](_0x4c3670[_0xafa0('0x33')],qs['fields'](_0xaf9147[_0xafa0('0x34')][_0xafa0('0x38')]));_0x1149f3['attributes']=_0x1149f3[_0xafa0('0x37')]['length']?_0x1149f3[_0xafa0('0x37')]:_0x4c3670[_0xafa0('0x33')];if(!_0xaf9147[_0xafa0('0x34')][_0xafa0('0x39')](_0xafa0('0x3a'))){_0x1149f3[_0xafa0('0x1f')]=qs[_0xafa0('0x1f')](_0xaf9147[_0xafa0('0x34')][_0xafa0('0x1f')]);_0x1149f3['offset']=qs[_0xafa0('0x1c')](_0xaf9147[_0xafa0('0x34')][_0xafa0('0x1c')]);}_0x1149f3['order']=qs[_0xafa0('0x3b')](_0xaf9147['query'][_0xafa0('0x3b')]);_0x1149f3[_0xafa0('0x3c')]=qs[_0xafa0('0x35')](_[_0xafa0('0x3d')](_0xaf9147[_0xafa0('0x34')],_0x4c3670[_0xafa0('0x35')]),_0x243b98);if(_0xaf9147[_0xafa0('0x34')][_0xafa0('0x3e')]){_0x1149f3['where']=_[_0xafa0('0x3f')](_0x1149f3[_0xafa0('0x3c')],{'$or':_[_0xafa0('0x2d')](_0x243b98,function(_0x5ab1f1){if(_0x5ab1f1[_0xafa0('0x31')]!==_0xafa0('0x40')){var _0x8534fe={};_0x8534fe[_0x5ab1f1[_0xafa0('0x2a')]]={'$like':'%'+_0xaf9147[_0xafa0('0x34')][_0xafa0('0x3e')]+'%'};return _0x8534fe;}})});}_0x1149f3=_[_0xafa0('0x3f')]({},_0x1149f3,_0xaf9147[_0xafa0('0x41')]);var _0x24fae3={'where':_0x1149f3[_0xafa0('0x3c')]};return db[_0xafa0('0x2e')][_0xafa0('0x1e')](_0x24fae3)[_0xafa0('0x26')](function(_0x2af0c2){_0x953723[_0xafa0('0x1e')]=_0x2af0c2;if(_0xaf9147[_0xafa0('0x34')][_0xafa0('0x42')]){_0x1149f3[_0xafa0('0x43')]=[{'all':!![]}];}return db[_0xafa0('0x2e')][_0xafa0('0x44')](_0x1149f3);})[_0xafa0('0x26')](function(_0x256d55){_0x953723[_0xafa0('0x45')]=_0x256d55;return _0x953723;})['then'](respondWithFilteredResult(_0x1906cd,_0x1149f3))['catch'](handleError(_0x1906cd,null));};exports[_0xafa0('0x46')]=function(_0x197b2f,_0x6f69fb){var _0x7b435c={'raw':!![],'where':{'id':_0x197b2f[_0xafa0('0x47')]['id']}},_0x5cd532={};_0x5cd532[_0xafa0('0x33')]=_[_0xafa0('0x48')](db[_0xafa0('0x2e')][_0xafa0('0x2f')]);_0x5cd532[_0xafa0('0x34')]=_[_0xafa0('0x48')](_0x197b2f[_0xafa0('0x34')]);_0x5cd532[_0xafa0('0x35')]=_[_0xafa0('0x36')](_0x5cd532[_0xafa0('0x33')],_0x5cd532[_0xafa0('0x34')]);_0x7b435c[_0xafa0('0x37')]=_[_0xafa0('0x36')](_0x5cd532[_0xafa0('0x33')],qs[_0xafa0('0x38')](_0x197b2f[_0xafa0('0x34')][_0xafa0('0x38')]));_0x7b435c[_0xafa0('0x37')]=_0x7b435c[_0xafa0('0x37')][_0xafa0('0x49')]?_0x7b435c['attributes']:_0x5cd532[_0xafa0('0x33')];if(_0x197b2f[_0xafa0('0x34')][_0xafa0('0x42')]){_0x7b435c['include']=[{'all':!![]}];}_0x7b435c=_['merge']({},_0x7b435c,_0x197b2f[_0xafa0('0x41')]);return db[_0xafa0('0x2e')][_0xafa0('0x4a')](_0x7b435c)[_0xafa0('0x26')](handleEntityNotFound(_0x6f69fb,null))['then'](respondWithResult(_0x6f69fb,null))[_0xafa0('0x4b')](handleError(_0x6f69fb,null));};exports[_0xafa0('0x4c')]=function(_0x241eb6,_0x17b35e){return db[_0xafa0('0x2e')][_0xafa0('0x4c')](_0x241eb6[_0xafa0('0x4d')],{})[_0xafa0('0x26')](respondWithResult(_0x17b35e,0xc9))[_0xafa0('0x4b')](handleError(_0x17b35e,null));};exports['update']=function(_0x23fe04,_0xa7cc3e){if(_0x23fe04[_0xafa0('0x4d')]['id']){delete _0x23fe04['body']['id'];}return db[_0xafa0('0x2e')][_0xafa0('0x4a')]({'where':{'id':_0x23fe04['params']['id']}})[_0xafa0('0x26')](handleEntityNotFound(_0xa7cc3e,null))['then'](saveUpdates(_0x23fe04[_0xafa0('0x4d')],null))[_0xafa0('0x26')](respondWithResult(_0xa7cc3e,null))[_0xafa0('0x4b')](handleError(_0xa7cc3e,null));};exports[_0xafa0('0x25')]=function(_0x33f555,_0x4dfeb5){return db[_0xafa0('0x2e')][_0xafa0('0x4a')]({'where':{'id':_0x33f555[_0xafa0('0x47')]['id']}})[_0xafa0('0x26')](handleEntityNotFound(_0x4dfeb5,null))[_0xafa0('0x26')](removeEntity(_0x4dfeb5,null))[_0xafa0('0x4b')](handleError(_0x4dfeb5,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 0290a75..ce6fbd5 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 _0x75b4=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','utf8mb4'];(function(_0x292660,_0x132cb4){var _0x509609=function(_0x436c6f){while(--_0x436c6f){_0x292660['push'](_0x292660['shift']());}};_0x509609(++_0x132cb4);}(_0x75b4,0x1c0));var _0x475b=function(_0x14597a,_0x156278){_0x14597a=_0x14597a-0x0;var _0x1d160e=_0x75b4[_0x14597a];return _0x1d160e;};'use strict';var _=require('lodash');var util=require(_0x475b('0x0'));var logger=require(_0x475b('0x1'))('api');var moment=require(_0x475b('0x2'));var BPromise=require(_0x475b('0x3'));var rp=require(_0x475b('0x4'));var fs=require('fs');var path=require(_0x475b('0x5'));var rimraf=require(_0x475b('0x6'));var config=require(_0x475b('0x7'));var attributes=require(_0x475b('0x8'));module[_0x475b('0x9')]=function(_0x4f147e,_0x332577){return _0x4f147e[_0x475b('0xa')](_0x475b('0xb'),attributes,{'tableName':_0x475b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x475b('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x5bb0=['exports','sms_applications','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./smsApplication.attributes'];(function(_0x319bfd,_0x390591){var _0x4a85ed=function(_0x16652c){while(--_0x16652c){_0x319bfd['push'](_0x319bfd['shift']());}};_0x4a85ed(++_0x390591);}(_0x5bb0,0x16f));var _0x05bb=function(_0x17af64,_0xccf925){_0x17af64=_0x17af64-0x0;var _0x5de38c=_0x5bb0[_0x17af64];return _0x5de38c;};'use strict';var _=require(_0x05bb('0x0'));var util=require(_0x05bb('0x1'));var logger=require(_0x05bb('0x2'))(_0x05bb('0x3'));var moment=require(_0x05bb('0x4'));var BPromise=require(_0x05bb('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x05bb('0x6'));var rimraf=require(_0x05bb('0x7'));var config=require(_0x05bb('0x8'));var attributes=require(_0x05bb('0x9'));module[_0x05bb('0xa')]=function(_0x3af485,_0x4550ee){return _0x3af485['define']('SmsApplication',attributes,{'tableName':_0x05bb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x05bb('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index dba88a6..696df52 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 _0x17a7=['SmsApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','then','info'];(function(_0x1a6bde,_0x3e8809){var _0x490911=function(_0x1da913){while(--_0x1da913){_0x1a6bde['push'](_0x1a6bde['shift']());}};_0x490911(++_0x3e8809);}(_0x17a7,0xc2));var _0x717a=function(_0x425cee,_0xcbcf3e){_0x425cee=_0x425cee-0x0;var _0x24483c=_0x17a7[_0x425cee];return _0x24483c;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x717a('0x0'));var rs=require(_0x717a('0x1'));var fs=require('fs');var Redis=require(_0x717a('0x2'));var db=require(_0x717a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x717a('0x4'))('rpc');var config=require(_0x717a('0x5'));var jayson=require(_0x717a('0x6'));var client=jayson['client'][_0x717a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1ca7a6,_0xd7d2ce,_0x311738){return new BPromise(function(_0x536824,_0x1066d4){return client['request'](_0x1ca7a6,_0x311738)[_0x717a('0x8')](function(_0x567130){logger[_0x717a('0x9')](_0x717a('0xa'),_0xd7d2ce,_0x717a('0xb'));logger['debug']('SmsApplication,\x20%s,\x20%s,\x20%s',_0xd7d2ce,_0x717a('0xb'),JSON[_0x717a('0xc')](_0x567130));if(_0x567130[_0x717a('0xd')]){if(_0x567130[_0x717a('0xd')][_0x717a('0xe')]===0x1f4){logger['error'](_0x717a('0xa'),_0xd7d2ce,_0x567130['error'][_0x717a('0xf')]);return _0x1066d4(_0x567130['error']['message']);}logger['error']('SmsApplication,\x20%s,\x20%s',_0xd7d2ce,_0x567130[_0x717a('0xd')]['message']);return _0x536824(_0x567130[_0x717a('0xd')]['message']);}else{logger[_0x717a('0x9')]('SmsApplication,\x20%s,\x20%s',_0xd7d2ce,_0x717a('0xb'));_0x536824(_0x567130[_0x717a('0x10')][_0x717a('0xf')]);}})['catch'](function(_0x186b4d){logger['error'](_0x717a('0xa'),_0xd7d2ce,_0x186b4d);_0x1066d4(_0x186b4d);});});} \ No newline at end of file +var _0x5eed=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3c7f1b,_0x43b3d0){var _0x525f59=function(_0x4e5585){while(--_0x4e5585){_0x3c7f1b['push'](_0x3c7f1b['shift']());}};_0x525f59(++_0x43b3d0);}(_0x5eed,0x10a));var _0xd5ee=function(_0x1ea17e,_0x5afb9f){_0x1ea17e=_0x1ea17e-0x0;var _0x2756d4=_0x5eed[_0x1ea17e];return _0x2756d4;};'use strict';var _=require(_0xd5ee('0x0'));var util=require(_0xd5ee('0x1'));var moment=require(_0xd5ee('0x2'));var BPromise=require(_0xd5ee('0x3'));var rs=require(_0xd5ee('0x4'));var fs=require('fs');var Redis=require(_0xd5ee('0x5'));var db=require(_0xd5ee('0x6'))['db'];var utils=require(_0xd5ee('0x7'));var logger=require(_0xd5ee('0x8'))(_0xd5ee('0x9'));var config=require('../../config/environment');var jayson=require(_0xd5ee('0xa'));var client=jayson[_0xd5ee('0xb')][_0xd5ee('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x38b0e3,_0x458212,_0x181790){return new BPromise(function(_0x162bb5,_0x217e70){return client['request'](_0x38b0e3,_0x181790)['then'](function(_0x4e6495){logger[_0xd5ee('0xd')](_0xd5ee('0xe'),_0x458212,_0xd5ee('0xf'));logger[_0xd5ee('0x10')](_0xd5ee('0x11'),_0x458212,_0xd5ee('0xf'),JSON[_0xd5ee('0x12')](_0x4e6495));if(_0x4e6495[_0xd5ee('0x13')]){if(_0x4e6495['error'][_0xd5ee('0x14')]===0x1f4){logger[_0xd5ee('0x13')]('SmsApplication,\x20%s,\x20%s',_0x458212,_0x4e6495[_0xd5ee('0x13')][_0xd5ee('0x15')]);return _0x217e70(_0x4e6495[_0xd5ee('0x13')][_0xd5ee('0x15')]);}logger[_0xd5ee('0x13')]('SmsApplication,\x20%s,\x20%s',_0x458212,_0x4e6495['error']['message']);return _0x162bb5(_0x4e6495[_0xd5ee('0x13')][_0xd5ee('0x15')]);}else{logger['info']('SmsApplication,\x20%s,\x20%s',_0x458212,_0xd5ee('0xf'));_0x162bb5(_0x4e6495[_0xd5ee('0x16')]['message']);}})[_0xd5ee('0x17')](function(_0x460f22){logger[_0xd5ee('0x13')](_0xd5ee('0xe'),_0x458212,_0x460f22);_0x217e70(_0x460f22);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 980896b..b78ea0b 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 _0xac4a=['util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./smsInteraction.controller','isAuthenticated','get','describe','getMessages','/:id/download','download','create','post','/:id/messages','addMessage','tracked','sms','smsinteraction:addtags','addTags','put','/:id','smsinteraction:update','update','delete','destroy','/:id/tags','removeTags','exports','multer'];(function(_0x1ee2a0,_0x5ea6e1){var _0x58998f=function(_0x5c1acc){while(--_0x5c1acc){_0x1ee2a0['push'](_0x1ee2a0['shift']());}};_0x58998f(++_0x5ea6e1);}(_0xac4a,0x13f));var _0xaac4=function(_0x36e3cc,_0x49d13d){_0x36e3cc=_0x36e3cc-0x0;var _0x182110=_0xac4a[_0x36e3cc];return _0x182110;};'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')]('/describe',auth[_0xaac4('0x9')](),controller[_0xaac4('0xb')]);router['get']('/:id',auth[_0xaac4('0x9')](),controller['show']);router[_0xaac4('0xa')]('/:id/messages',auth['isAuthenticated'](),controller[_0xaac4('0xc')]);router[_0xaac4('0xa')](_0xaac4('0xd'),auth[_0xaac4('0x9')](),controller[_0xaac4('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xaac4('0xf')]);router[_0xaac4('0x10')](_0xaac4('0x11'),auth['isAuthenticated'](),controller[_0xaac4('0x12')]);router[_0xaac4('0x10')]('/:id/tags',auth[_0xaac4('0x9')](),interaction[_0xaac4('0x13')](_0xaac4('0x14'),_0xaac4('0x15')),controller[_0xaac4('0x16')]);router[_0xaac4('0x17')](_0xaac4('0x18'),auth[_0xaac4('0x9')](),interaction[_0xaac4('0x13')](_0xaac4('0x14'),_0xaac4('0x19')),controller[_0xaac4('0x1a')]);router[_0xaac4('0x1b')]('/:id',auth[_0xaac4('0x9')](),interaction['tracked'](_0xaac4('0x14'),'smsinteraction:destroy'),controller[_0xaac4('0x1c')]);router[_0xaac4('0x1b')](_0xaac4('0x1d'),auth[_0xaac4('0x9')](),controller[_0xaac4('0x1e')]);module[_0xaac4('0x1f')]=router; \ No newline at end of file +var _0xea28=['put','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','/:id/tags','removeTags','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/messages','/:id/download','download','create','post','tracked','sms','smsinteraction:addtags','addTags'];(function(_0xc35b34,_0x314794){var _0x37c016=function(_0x4ebadf){while(--_0x4ebadf){_0xc35b34['push'](_0xc35b34['shift']());}};_0x37c016(++_0x314794);}(_0xea28,0x13a));var _0x8ea2=function(_0x3ff518,_0x60d0d4){_0x3ff518=_0x3ff518-0x0;var _0x4ff3e2=_0xea28[_0x3ff518];return _0x4ff3e2;};'use strict';var multer=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var path=require(_0x8ea2('0x2'));var timeout=require(_0x8ea2('0x3'));var express=require(_0x8ea2('0x4'));var router=express[_0x8ea2('0x5')]();var fs_extra=require(_0x8ea2('0x6'));var auth=require(_0x8ea2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8ea2('0x8'));var controller=require(_0x8ea2('0x9'));router[_0x8ea2('0xa')]('/',auth['isAuthenticated'](),controller[_0x8ea2('0xb')]);router[_0x8ea2('0xa')](_0x8ea2('0xc'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0xe')]);router[_0x8ea2('0xa')](_0x8ea2('0xf'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x10')]);router[_0x8ea2('0xa')](_0x8ea2('0x11'),auth[_0x8ea2('0xd')](),controller['getMessages']);router['get'](_0x8ea2('0x12'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x13')]);router['post']('/',auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x14')]);router[_0x8ea2('0x15')](_0x8ea2('0x11'),auth[_0x8ea2('0xd')](),controller['addMessage']);router[_0x8ea2('0x15')]('/:id/tags',auth['isAuthenticated'](),interaction[_0x8ea2('0x16')](_0x8ea2('0x17'),_0x8ea2('0x18')),controller[_0x8ea2('0x19')]);router[_0x8ea2('0x1a')](_0x8ea2('0xf'),auth[_0x8ea2('0xd')](),interaction[_0x8ea2('0x16')](_0x8ea2('0x17'),_0x8ea2('0x1b')),controller[_0x8ea2('0x1c')]);router[_0x8ea2('0x1d')](_0x8ea2('0xf'),auth[_0x8ea2('0xd')](),interaction[_0x8ea2('0x16')](_0x8ea2('0x17'),_0x8ea2('0x1e')),controller[_0x8ea2('0x1f')]);router[_0x8ea2('0x1d')](_0x8ea2('0x20'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x21')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 514fb3d..b4bdbeb 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 _0xaeab=['DATE','STRING','ENUM','out','BOOLEAN','sequelize','exports'];(function(_0x155f62,_0x202c4a){var _0x527218=function(_0x1c9f40){while(--_0x1c9f40){_0x155f62['push'](_0x155f62['shift']());}};_0x527218(++_0x202c4a);}(_0xaeab,0x91));var _0xbaea=function(_0x51b36a,_0x15efab){_0x51b36a=_0x51b36a-0x0;var _0x5dad92=_0xaeab[_0x51b36a];return _0x5dad92;};'use strict';var Sequelize=require(_0xbaea('0x0'));var moment=require('moment');module[_0xbaea('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xbaea('0x2')]},'disposition':{'type':Sequelize[_0xbaea('0x3')]},'secondDisposition':{'type':Sequelize[_0xbaea('0x3')]},'thirdDisposition':{'type':Sequelize[_0xbaea('0x3')]},'note':{'type':Sequelize[_0xbaea('0x3')]},'phone':{'type':Sequelize[_0xbaea('0x3')]},'read1stAt':{'type':Sequelize[_0xbaea('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xbaea('0x4')]('in',_0xbaea('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xbaea('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xbaea('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xbaea('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0x7edb=['out','moment','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x21bd75,_0x5bc5dc){var _0x7da7ba=function(_0x549f1f){while(--_0x549f1f){_0x21bd75['push'](_0x21bd75['shift']());}};_0x7da7ba(++_0x5bc5dc);}(_0x7edb,0x158));var _0xb7ed=function(_0x1b3311,_0x88ea69){_0x1b3311=_0x1b3311-0x0;var _0x2350fa=_0x7edb[_0x1b3311];return _0x2350fa;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xb7ed('0x0'));module[_0xb7ed('0x1')]={'closed':{'type':Sequelize[_0xb7ed('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb7ed('0x3')]},'disposition':{'type':Sequelize[_0xb7ed('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xb7ed('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xb7ed('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xb7ed('0x5')]('in',_0xb7ed('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xb7ed('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xb7ed('0x5')]('in',_0xb7ed('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xb7ed('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 e077de7..273c6ec 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 _0x42c3=['Messages','secret','Account','get','mkdirSync','Owner','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','direction','out','renderFile','views','downloadInteraction.ejs','.pdf','Sms','log','err','eml-format','rimraf','fast-json-patch','request-promise','bluebird','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsInteraction.socket','sendStatus','status','json','undefined','offset','count','limit','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','Users','map','fullname','Tags','TagIds','split','forEach','push','catch','waiting','talking','answered','unmanaged','closed','UserId','index','SmsInteraction','rawAttributes','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','Contact','operator','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','body','some','compact','isEmpty','SmsAccountId','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','order','contactName','DESC','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','i.SmsAccountId\x20IN\x20?','role','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','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','c.email','c.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','rows','show','intersection','includeAll','options','create','params','describe','addMessage','SmsMessage','getMessages','findOne','format','include','findAll','setTags','ids','spread','Tag','emit','smsInteractionTags:save','removeTags','unix','root','server','files','tmp','attachments','join','transcript-%d-%s.zip','firstName','lastName'];(function(_0x5782db,_0xa537d6){var _0x19d5c9=function(_0x1c4fc8){while(--_0x1c4fc8){_0x5782db['push'](_0x5782db['shift']());}};_0x19d5c9(++_0xa537d6);}(_0x42c3,0xf7));var _0x342c=function(_0x5aca76,_0x19926e){_0x5aca76=_0x5aca76-0x0;var _0x969ced=_0x42c3[_0x5aca76];return _0x969ced;};'use strict';var emlformat=require(_0x342c('0x0'));var rimraf=require(_0x342c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x342c('0x2'));var rp=require(_0x342c('0x3'));var moment=require('moment');var BPromise=require(_0x342c('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x342c('0x5'));var csv=require(_0x342c('0x6'));var ejs=require(_0x342c('0x7'));var fs=require('fs');var fs_extra=require(_0x342c('0x8'));var _=require('lodash');var squel=require(_0x342c('0x9'));var crypto=require(_0x342c('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x342c('0xb'));var Papa=require(_0x342c('0xc'));var Redis=require(_0x342c('0xd'));var authService=require(_0x342c('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x342c('0xf'));var pdf=require(_0x342c('0x10'));var hardwareService=require(_0x342c('0x11'));var logger=require('../../config/logger')(_0x342c('0x12'));var utils=require(_0x342c('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x342c('0x14'));var db=require(_0x342c('0x15'))['db'];config[_0x342c('0x16')]=_[_0x342c('0x17')](config['redis'],{'host':_0x342c('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x342c('0x16')]));require(_0x342c('0x19'))['register'](socket);function respondWithStatusCode(_0x5f3e03,_0x40bba9){_0x40bba9=_0x40bba9||0xcc;return function(_0x456751){if(_0x456751){return _0x5f3e03[_0x342c('0x1a')](_0x40bba9);}return _0x5f3e03['status'](_0x40bba9)['end']();};}function respondWithResult(_0x135f65,_0x598892){_0x598892=_0x598892||0xc8;return function(_0x3c3086){if(_0x3c3086){return _0x135f65[_0x342c('0x1b')](_0x598892)[_0x342c('0x1c')](_0x3c3086);}};}function respondWithFilteredResult(_0xa6dd06,_0x47f5f0){return function(_0x97de37){if(_0x97de37){var _0x894ad9=typeof _0x47f5f0['offset']===_0x342c('0x1d')&&typeof _0x47f5f0['limit']===_0x342c('0x1d');var _0x16ff4e=_0x97de37['count'];var _0x188574=_0x894ad9?0x0:_0x47f5f0[_0x342c('0x1e')];var _0x5ea0fc=_0x894ad9?_0x97de37[_0x342c('0x1f')]:_0x47f5f0['offset']+_0x47f5f0[_0x342c('0x20')];var _0x4bc141;if(_0x5ea0fc>=_0x16ff4e){_0x5ea0fc=_0x16ff4e;_0x4bc141=0xc8;}else{_0x4bc141=0xce;}_0xa6dd06[_0x342c('0x1b')](_0x4bc141);return _0xa6dd06[_0x342c('0x21')](_0x342c('0x22'),_0x188574+'-'+_0x5ea0fc+'/'+_0x16ff4e)[_0x342c('0x1c')](_0x97de37);}return null;};}function patchUpdates(_0x2c3514){return function(_0x2637c0){try{jsonpatch[_0x342c('0x23')](_0x2637c0,_0x2c3514,!![]);}catch(_0x4b86ba){return BPromise[_0x342c('0x24')](_0x4b86ba);}return _0x2637c0[_0x342c('0x25')]();};}function saveUpdates(_0x559ad1,_0x28f4b2){return function(_0x1a9ee2){if(_0x1a9ee2){return _0x1a9ee2[_0x342c('0x26')](_0x559ad1)[_0x342c('0x27')](function(_0x40c9d0){return _0x40c9d0;});}return null;};}function removeEntity(_0x523785,_0x1ddb44){return function(_0x1533ae){if(_0x1533ae){return _0x1533ae['destroy']()[_0x342c('0x27')](function(){_0x523785[_0x342c('0x1b')](0xcc)[_0x342c('0x28')]();});}};}function handleEntityNotFound(_0x5d756e,_0x1b1bdb){return function(_0x173e41){if(!_0x173e41){_0x5d756e[_0x342c('0x1a')](0x194);}return _0x173e41;};}function handleError(_0x2b9783,_0x34ae6c){_0x34ae6c=_0x34ae6c||0x1f4;return function(_0x43cc73){logger[_0x342c('0x29')](_0x43cc73[_0x342c('0x2a')]);if(_0x43cc73[_0x342c('0x2b')]){delete _0x43cc73[_0x342c('0x2b')];}_0x2b9783[_0x342c('0x1b')](_0x34ae6c)['send'](_0x43cc73);};}function getInteractionUsers(_0x52bc92,_0x13ac7d){return new BPromise(function(_0x206e37,_0x32ef9c){try{if(_0x13ac7d[_0x52bc92['id']]){_0x52bc92[_0x342c('0x2c')]=_[_0x342c('0x2d')](_0x13ac7d[_0x52bc92['id']],function(_0x24b280){return{'id':_0x24b280['id'],'fullname':_0x24b280[_0x342c('0x2e')]};});}}catch(_0x25696d){_0x32ef9c(_0x25696d);}_0x206e37(_0x52bc92);});}function getInteractionTags(_0x59e63b,_0x3316e8){return new BPromise(function(_0x5af89e,_0x1b7d78){try{if(_0x59e63b['TagIds']){_0x59e63b[_0x342c('0x2f')]=[];_0x59e63b[_0x342c('0x30')][_0x342c('0x31')](',')[_0x342c('0x32')](function(_0x1802d0){_0x59e63b[_0x342c('0x2f')][_0x342c('0x33')](_0x3316e8[_0x1802d0]);});}delete _0x59e63b['TagIds'];}catch(_0x5d31da){_0x1b7d78(_0x5d31da);}_0x5af89e(_0x59e63b);});}function updateSmsInteraction(_0x170f1f,_0x301b6c,_0x35a20d){return new BPromise(function(_0x2d457c,_0x39a291){return getInteractionUsers(_0x170f1f,_0x35a20d)['then'](function(_0x286ff3){return getInteractionTags(_0x286ff3,_0x301b6c);})[_0x342c('0x27')](function(_0x1baddc){return getStateInteraction(_0x1baddc);})[_0x342c('0x27')](function(_0x771e54){_0x2d457c(_0x771e54);})[_0x342c('0x34')](function(_0x523d42){_0x39a291(_0x523d42);});});}function getStateInteraction(_0x54aadd){return new BPromise(function(_0x246348){_0x54aadd[_0x342c('0x35')]=0x0;_0x54aadd[_0x342c('0x36')]=0x0;_0x54aadd[_0x342c('0x37')]=0x0;_0x54aadd[_0x342c('0x38')]=0x0;_0x54aadd['total']=0x0;if(!_0x54aadd[_0x342c('0x39')]&&!_0x54aadd['UserId']){_0x54aadd['waiting']+=0x1;}if(!_0x54aadd[_0x342c('0x39')]&&_0x54aadd['UserId']){_0x54aadd[_0x342c('0x36')]+=0x1;if(_0x54aadd[_0x342c('0x35')]){_0x54aadd[_0x342c('0x35')]-=0x1;}}if(_0x54aadd['closed']&&_0x54aadd[_0x342c('0x3a')]){_0x54aadd[_0x342c('0x37')]+=0x1;if(_0x54aadd[_0x342c('0x36')]){_0x54aadd[_0x342c('0x36')]-=0x1;}}if(_0x54aadd[_0x342c('0x39')]&&!_0x54aadd[_0x342c('0x3a')]){_0x54aadd[_0x342c('0x38')]+=0x1;if(_0x54aadd[_0x342c('0x35')]){_0x54aadd['waiting']-=0x1;}}_0x54aadd['total']+=0x1;_0x246348(_0x54aadd);});}exports[_0x342c('0x3b')]=function(_0x15b20a,_0x1d7696){var _0x5dc0b3={},_0x2101dd={},_0x5a10dd={'count':0x0,'rows':[]};var _0x99cb4a=_[_0x342c('0x2d')](db[_0x342c('0x3c')][_0x342c('0x3d')],function(_0x50c342){return{'name':_0x50c342['fieldName'],'type':_0x50c342[_0x342c('0x3e')][_0x342c('0x3f')]};});_0x2101dd[_0x342c('0x40')]=_[_0x342c('0x2d')](_0x99cb4a,'name');_0x2101dd[_0x342c('0x41')]=_[_0x342c('0x42')](_0x15b20a['query']);_0x2101dd[_0x342c('0x43')]=_['intersection'](_0x2101dd[_0x342c('0x40')],_0x2101dd[_0x342c('0x41')]);_0x5dc0b3[_0x342c('0x44')]=_['intersection'](_0x2101dd[_0x342c('0x40')],qs[_0x342c('0x45')](_0x15b20a['query'][_0x342c('0x45')]));_0x5dc0b3[_0x342c('0x44')]=_0x5dc0b3[_0x342c('0x44')][_0x342c('0x46')]?_0x5dc0b3[_0x342c('0x44')]:_0x2101dd['model'];if(!_0x15b20a[_0x342c('0x41')][_0x342c('0x47')]('nolimit')){_0x5dc0b3[_0x342c('0x20')]=qs['limit'](_0x15b20a[_0x342c('0x41')]['limit']);_0x5dc0b3[_0x342c('0x1e')]=qs['offset'](_0x15b20a['query'][_0x342c('0x1e')]);}_0x5dc0b3['order']=qs[_0x342c('0x48')](_0x15b20a[_0x342c('0x41')][_0x342c('0x48')]);_0x5dc0b3[_0x342c('0x49')]=qs[_0x342c('0x43')](_[_0x342c('0x4a')](_0x15b20a[_0x342c('0x41')],_0x2101dd['filters']),_0x99cb4a);var _0x350eff=[];var _0x3eeeca=squel[_0x342c('0x4b')]()[_0x342c('0x4c')]('id')[_0x342c('0x4c')](_0x342c('0x2b'))['field'](_0x342c('0x4d'))[_0x342c('0x4e')](_0x342c('0x4f'));var _0x411464=squel[_0x342c('0x4b')]()['field'](_0x342c('0x50'))[_0x342c('0x4c')](_0x342c('0x51'))[_0x342c('0x4c')](_0x342c('0x52'))[_0x342c('0x4e')](_0x342c('0x53'),'ui')[_0x342c('0x54')]('users','u',_0x342c('0x55'));var _0x459225=squel[_0x342c('0x4b')]()['from']('sms_interactions','i')[_0x342c('0x54')](_0x342c('0x56'),'c',_0x342c('0x57'))[_0x342c('0x54')](_0x342c('0x58'),'o',_0x342c('0x59'))[_0x342c('0x54')](_0x342c('0x5a'),'a',_0x342c('0x5b'))[_0x342c('0x54')](_0x342c('0x5c'),'me',_0x342c('0x5d'))['left_join'](_0x342c('0x5e'),'it',_0x342c('0x5f'))['left_join'](_0x342c('0x4f'),'t',_0x342c('0x60'));var _0x620b15=squel[_0x342c('0x61')]();var _0xa113d9=[];var _0x40bd0d=squel[_0x342c('0x61')]();var _0x4c6dfe;if(_0x15b20a['query']['search']){_0x4c6dfe=as[_0x342c('0x62')](_0x15b20a['query']['search']);var _0x4070d9=_0x4c6dfe[_0x342c('0x63')];for(var _0x4d954e=0x0;_0x4d954e<_0x4c6dfe['conditions'][_0x342c('0x46')];_0x4d954e++){var _0x4c3147=_0x4c6dfe[_0x342c('0x64')][_0x4d954e];var _0x1b3b33='i';var _0x454311=_[_0x342c('0x65')](_0x99cb4a,[_0x342c('0x2b'),_0x4c3147['field']]);if(!_0x454311){switch(_0x4c3147[_0x342c('0x4c')]){case _0x342c('0x66'):if(_0x4c3147[_0x342c('0x67')]==0x1){_0x459225[_0x342c('0x68')]('`'+_0x4c3147[_0x342c('0x4c')]+_0x342c('0x69'));}else{_0x459225[_0x342c('0x68')]('`'+_0x4c3147['field']+'`\x20>\x200');}break;case _0x342c('0x6a'):if(_0x4c3147[_0x342c('0x6b')]==='$substring'){if(_0x4c3147['value'][_0x342c('0x31')]('\x20')['length']>0x1){_0x620b15[_0x4070d9]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x4c3147['value']),null);}else{var _0x2ff81f='%'+_0x4c3147[_0x342c('0x67')]+'%';_0x620b15[_0x4070d9](_0x342c('0x6c'),_0x2ff81f,_0x2ff81f,_0x2ff81f);}}else{_0x454311=_[_0x342c('0x65')](_0x99cb4a,[_0x342c('0x2b'),_0x342c('0x6d')]);_0x4c3147[_0x342c('0x4c')]=_0x342c('0x6d');_0x592647=as[_0x342c('0x6e')](_0x1b3b33,_0x454311[_0x342c('0x3e')],_0x4c3147);_0x620b15[_0x4070d9](_0x592647[_0x342c('0x6f')],_0x592647[_0x342c('0x67')][_0x342c('0x70')],_0x592647['value'][_0x342c('0x28')]);}break;case'Tag':var _0xff75a5=_0x4c3147['value'][_0x342c('0x31')](',')[_0x342c('0x2d')](function(_0x440ee3){return Number(_0x440ee3);});_0xff75a5[_0x342c('0x32')](function(_0x572013){_0x40bd0d['or'](_0x342c('0x71'),'%,'+_0x572013+',%');});_0xa113d9=_[_0x342c('0x72')](_0xa113d9,_0xff75a5);break;case _0x342c('0x73'):if(_0x4c3147[_0x342c('0x6b')]==='$substring'){_0x620b15[_0x4070d9]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x4c3147[_0x342c('0x67')]+'%',null);}else{_0x454311=_['find'](_0x99cb4a,[_0x342c('0x2b'),_0x342c('0x3a')]);_0x4c3147[_0x342c('0x4c')]=_0x342c('0x3a');_0x592647=as['buildExpression'](_0x1b3b33,_0x454311[_0x342c('0x3e')],_0x4c3147);_0x620b15[_0x4070d9](_0x592647[_0x342c('0x6f')],_0x592647[_0x342c('0x67')]['start'],_0x592647[_0x342c('0x67')][_0x342c('0x28')]);}break;case _0x342c('0x74'):_0x592647=as[_0x342c('0x6e')]('me',null,_0x4c3147);_0x620b15[_0x4070d9](_0x592647[_0x342c('0x6f')],_0x592647[_0x342c('0x67')][_0x342c('0x70')],_0x592647[_0x342c('0x67')][_0x342c('0x28')]);break;}}else{var _0x592647=as['buildExpression'](_0x1b3b33,_0x454311[_0x342c('0x3e')],_0x4c3147);_0x620b15[_0x4070d9](_0x592647[_0x342c('0x6f')],_0x592647[_0x342c('0x67')]['start'],_0x592647[_0x342c('0x67')]['end']);}}}else{var _0x4822fd=_(_0x15b20a[_0x342c('0x41')])[_0x342c('0x42')]()[_0x342c('0x2d')](function(_0x236f21){return _[_0x342c('0x75')](_0x99cb4a,['name',_0x236f21])?_0x236f21:undefined;})[_0x342c('0x76')]()[_0x342c('0x67')]();if(!_[_0x342c('0x77')](_0x4822fd)){_0x4822fd[_0x342c('0x32')](function(_0x37daaf){if(_0x37daaf===_0x342c('0x78')){_0x459225[_0x342c('0x49')]('i.SmsAccountId\x20IN\x20?',[]['concat'](_0x15b20a[_0x342c('0x41')][_0x37daaf]));}else if(_0x37daaf===_0x342c('0x79')){var _0x3f694e=JSON['parse'](_0x15b20a[_0x342c('0x41')][_0x37daaf])[_0x342c('0x7a')];var _0x1676fe=JSON[_0x342c('0x7b')](_0x15b20a['query'][_0x37daaf])[_0x342c('0x7c')];_0x459225[_0x342c('0x49')](_0x342c('0x7d'),_0x3f694e,_0x1676fe);}else{if(_0x15b20a['query'][_0x37daaf]==='null'){_0x459225[_0x342c('0x49')]('i.'+_0x37daaf+_0x342c('0x7e'));}else{_0x459225[_0x342c('0x49')]('i.'+_0x37daaf+_0x342c('0x7f'),_0x15b20a[_0x342c('0x41')][_0x37daaf]);}}});}if(_0x15b20a[_0x342c('0x41')][_0x342c('0x80')]){if(_0x15b20a[_0x342c('0x41')][_0x342c('0x80')]==0x1){_0x459225[_0x342c('0x68')](_0x342c('0x81'));}else{_0x459225['having']('`unreadMessages`\x20>\x200');}}if(_0x15b20a[_0x342c('0x41')]['tag']){_0xa113d9=_[_0x342c('0x82')](_0x15b20a['query'][_0x342c('0x83')])?_0x15b20a[_0x342c('0x41')]['tag']:new Array(_0x15b20a[_0x342c('0x41')][_0x342c('0x83')]);_0xa113d9[_0x342c('0x32')](function(_0x19bf87){_0x40bd0d['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x19bf87+',%');});}if(_0x15b20a['query'][_0x342c('0x84')]){var _0x4bdaa4=_0x15b20a[_0x342c('0x41')][_0x342c('0x84')][_0x342c('0x85')]('\x5c','\x5c\x5c')[_0x342c('0x85')](/'/g,'\x27\x27');if(qs[_0x342c('0x86')](_0x4bdaa4)){_0x620b15['or'](_0x342c('0x87'),_0x4bdaa4+'%')['or'](_0x342c('0x88'),_0x4bdaa4+'%');}else{_0x620b15['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x4bdaa4))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x4bdaa4+'%');}}}_0x459225[_0x342c('0x49')](_0x620b15);_0x459225[_0x342c('0x89')](_0x342c('0x8a'));var _0x153599={'type':db[_0x342c('0x8b')][_0x342c('0x8c')][_0x342c('0x8d')],'raw':!![]};var _0x1698fb=_0x459225[_0x342c('0x8e')]();_0x1698fb[_0x342c('0x4c')](_0x342c('0x8a'));_0x1698fb[_0x342c('0x4c')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x5dc0b3[_0x342c('0x8f')]){_0x5dc0b3['order'][_0x342c('0x32')](function(_0x3ff75c){var _0x4cd46e=_0x3ff75c[0x0]===_0x342c('0x90')?_0x3ff75c[0x0]:'i.'+_0x3ff75c[0x0];_0x459225[_0x342c('0x8f')](_0x4cd46e,_0x3ff75c[0x1]===_0x342c('0x91')?![]:!![]);});}if(!_[_0x342c('0x77')](_0xa113d9)){_0x459225['having'](_0x40bd0d);_0x1698fb[_0x342c('0x49')](_0x342c('0x92'),_0xa113d9);}BPromise[_0x342c('0x93')]()[_0x342c('0x27')](function(){if(!_0x4c6dfe){if(_0x15b20a[_0x342c('0x41')][_0x342c('0x78')])return;_0x1698fb['where'](_0x342c('0x94'));_0x459225[_0x342c('0x49')](_0x342c('0x94'));return;}if(_0x15b20a[_0x342c('0x95')]['role']!==_0x342c('0x96'))return;return _0x15b20a['user'][_0x342c('0x97')]({'attributes':['id'],'raw':!![]})[_0x342c('0x27')](function(_0x505798){if(_[_0x342c('0x77')](_0x505798)){_0x1698fb[_0x342c('0x49')]('i.SmsAccountId\x20IS\x20NULL');_0x459225[_0x342c('0x49')](_0x342c('0x98'));}else{_0x1698fb['where'](_0x342c('0x99'),_[_0x342c('0x2d')](_0x505798,'id'));_0x459225[_0x342c('0x49')](_0x342c('0x99'),_['map'](_0x505798,'id'));}});})[_0x342c('0x27')](function(){if(_0x15b20a[_0x342c('0x95')][_0x342c('0x9a')]==='agent'&&!_0x4c6dfe&&!_0x15b20a['query'][_0x342c('0x78')])return[];return db[_0x342c('0x9b')]['query'](_0x1698fb[_0x342c('0x9c')](),_0x153599);})['then'](function(_0x4a5b8a){_0x5a10dd[_0x342c('0x1f')]=_0x4a5b8a[_0x342c('0x46')];if(_0x5a10dd['count']===0x0)return[];return db['sequelize'][_0x342c('0x41')](_0x3eeeca[_0x342c('0x9c')](),_0x153599)['then'](function(_0x4f3c96){_0x350eff=_[_0x342c('0x9d')](_0x4f3c96,'id');_0x153599=_[_0x342c('0x9e')](_0x153599,{'model':db[_0x342c('0x3c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x15b20a['query'][_0x342c('0x45')]){_0x5dc0b3[_0x342c('0x44')][_0x342c('0x32')](function(_0x32c644){_0x459225[_0x342c('0x4c')]('i.'+_0x32c644);});}else{_0x459225[_0x342c('0x4c')](_0x342c('0x9f'),'unreadMessages');_0x459225[_0x342c('0x4c')]('a.key','Account.key');_0x459225[_0x342c('0x4c')](_0x342c('0xa0'),_0x342c('0xa1'));_0x459225[_0x342c('0x4c')](_0x342c('0xa2'),_0x342c('0x90'));_0x459225['field'](_0x342c('0xa3'));_0x459225[_0x342c('0x4c')](_0x342c('0xa4'),_0x342c('0xa5'));_0x459225[_0x342c('0x4c')](_0x342c('0xa6'),_0x342c('0xa7'));_0x459225[_0x342c('0x4c')](_0x342c('0xa8'),'Contact.email');_0x459225[_0x342c('0x4c')](_0x342c('0xa9'),'Contact.phone');_0x459225[_0x342c('0x4c')]('c.mobile',_0x342c('0xaa'));_0x459225[_0x342c('0x4c')](_0x342c('0xab'),_0x342c('0xac'));_0x459225['field'](_0x342c('0xad'),_0x342c('0xae'));_0x459225[_0x342c('0x4c')]('o.internal','Owner.internal');_0x459225['field'](_0x342c('0xaf'),_0x342c('0x30'));}if(_0x5dc0b3['limit'])_0x459225[_0x342c('0x20')](_0x5dc0b3[_0x342c('0x20')]);if(_0x5dc0b3[_0x342c('0x1e')])_0x459225['offset'](_0x5dc0b3['offset']);return db[_0x342c('0x9b')][_0x342c('0x41')](_0x459225[_0x342c('0x9c')](),_0x153599);})[_0x342c('0x27')](function(_0x1f66a2){if(_0x1f66a2[_0x342c('0x46')]>0x0)_0x411464[_0x342c('0x49')](_0x342c('0xb0'),_['map'](_0x1f66a2,'id'));return db[_0x342c('0x9b')][_0x342c('0x41')](_0x411464['toString'](),_0x153599)['then'](function(_0x39ae28){var _0x1aaaa4=_[_0x342c('0xb1')](_0x39ae28,_0x342c('0xb2'));var _0x24a770=[];_0x1f66a2[_0x342c('0x32')](function(_0x4291ee){_0x24a770['push'](updateSmsInteraction(_0x4291ee,_0x350eff,_0x1aaaa4));});return BPromise['all'](_0x24a770);});});})[_0x342c('0x27')](function(_0x52652f){_0x5a10dd[_0x342c('0xb3')]=_0x52652f;return _0x5a10dd;})[_0x342c('0x27')](respondWithFilteredResult(_0x1d7696,_0x5dc0b3))[_0x342c('0x34')](handleError(_0x1d7696,null));};exports[_0x342c('0xb4')]=function(_0x22b0d3,_0x480a10){var _0x4e370a={'raw':![],'where':{'id':_0x22b0d3['params']['id']}},_0x145a30={};_0x145a30[_0x342c('0x40')]=_['keys'](db['SmsInteraction'][_0x342c('0x3d')]);_0x145a30[_0x342c('0x41')]=_[_0x342c('0x42')](_0x22b0d3['query']);_0x145a30[_0x342c('0x43')]=_[_0x342c('0xb5')](_0x145a30[_0x342c('0x40')],_0x145a30[_0x342c('0x41')]);_0x4e370a[_0x342c('0x44')]=_[_0x342c('0xb5')](_0x145a30['model'],qs[_0x342c('0x45')](_0x22b0d3[_0x342c('0x41')][_0x342c('0x45')]));_0x4e370a['attributes']=_0x4e370a[_0x342c('0x44')][_0x342c('0x46')]?_0x4e370a['attributes']:_0x145a30[_0x342c('0x40')];if(_0x22b0d3[_0x342c('0x41')][_0x342c('0xb6')]){_0x4e370a['include']=[{'all':!![]}];}_0x4e370a=_[_0x342c('0x9e')]({},_0x4e370a,_0x22b0d3[_0x342c('0xb7')]);return db[_0x342c('0x3c')]['find'](_0x4e370a)[_0x342c('0x27')](handleEntityNotFound(_0x480a10,null))[_0x342c('0x27')](respondWithResult(_0x480a10,null))[_0x342c('0x34')](handleError(_0x480a10,null));};exports['create']=function(_0x49268f,_0x12c6cf){return db[_0x342c('0x3c')][_0x342c('0xb8')](_0x49268f[_0x342c('0x74')],{})['then'](respondWithResult(_0x12c6cf,0xc9))[_0x342c('0x34')](handleError(_0x12c6cf,null));};exports['update']=function(_0x113027,_0x5be05b){if(_0x113027['body']['id']){delete _0x113027[_0x342c('0x74')]['id'];}return db['SmsInteraction'][_0x342c('0x65')]({'where':{'id':_0x113027[_0x342c('0xb9')]['id']}})['then'](handleEntityNotFound(_0x5be05b,null))[_0x342c('0x27')](saveUpdates(_0x113027[_0x342c('0x74')],null))['then'](respondWithResult(_0x5be05b,null))[_0x342c('0x34')](handleError(_0x5be05b,null));};exports['destroy']=function(_0x4c1ec3,_0x53cf33){return db[_0x342c('0x3c')][_0x342c('0x65')]({'where':{'id':_0x4c1ec3[_0x342c('0xb9')]['id']}})['then'](handleEntityNotFound(_0x53cf33,null))[_0x342c('0x27')](removeEntity(_0x53cf33,null))['catch'](handleError(_0x53cf33,null));};exports[_0x342c('0xba')]=function(_0x3a1e0c,_0x305a02){return db[_0x342c('0x3c')][_0x342c('0xba')]()[_0x342c('0x27')](respondWithResult(_0x305a02,null))['catch'](handleError(_0x305a02,null));};exports[_0x342c('0xbb')]=function(_0x5645e0,_0x33ad0f,_0x396198){return db[_0x342c('0xbc')]['find']({'where':{'id':_0x5645e0[_0x342c('0xb9')]['id']}})[_0x342c('0x27')](handleEntityNotFound(_0x33ad0f,null))[_0x342c('0x27')](function(_0x5179ea){if(_0x5179ea){return _0x5179ea[_0x342c('0xbb')](_0x5645e0[_0x342c('0x74')]['ids'],_['omit'](_0x5645e0[_0x342c('0x74')],['ids','id'])||{});}})[_0x342c('0x27')](respondWithResult(_0x33ad0f,null))[_0x342c('0x34')](handleError(_0x33ad0f,null));};exports[_0x342c('0xbd')]=function(_0x2b8979,_0x3449a4,_0x55fe2d){var _0x563148={'raw':![],'where':{}};var _0x1aad40={};var _0x5a4766={'count':0x0,'rows':[]};return db[_0x342c('0x3c')][_0x342c('0xbe')]({'where':{'id':_0x2b8979[_0x342c('0xb9')]['id']}})['then'](handleEntityNotFound(_0x3449a4,null))[_0x342c('0x27')](function(_0x1656a5){if(_0x1656a5){_0x1aad40[_0x342c('0x40')]=_[_0x342c('0x42')](db[_0x342c('0xbc')][_0x342c('0x3d')]);_0x1aad40[_0x342c('0x41')]=_[_0x342c('0x42')](_0x2b8979['query']);_0x1aad40[_0x342c('0x43')]=_[_0x342c('0xb5')](_0x1aad40[_0x342c('0x40')],_0x1aad40[_0x342c('0x41')]);_0x563148[_0x342c('0x44')]=_[_0x342c('0xb5')](_0x1aad40['model'],qs[_0x342c('0x45')](_0x2b8979[_0x342c('0x41')]['fields']));_0x563148[_0x342c('0x44')]=_0x563148[_0x342c('0x44')][_0x342c('0x46')]?_0x563148[_0x342c('0x44')]:_0x1aad40[_0x342c('0x40')];if(!_0x2b8979['query'][_0x342c('0x47')]('nolimit')){_0x563148['limit']=qs[_0x342c('0x20')](_0x2b8979[_0x342c('0x41')]['limit']);_0x563148[_0x342c('0x1e')]=qs[_0x342c('0x1e')](_0x2b8979[_0x342c('0x41')]['offset']);}_0x563148[_0x342c('0x8f')]=qs[_0x342c('0x48')](_0x2b8979[_0x342c('0x41')]['sort']);_0x563148['where']=qs[_0x342c('0x43')](_[_0x342c('0x4a')](_0x2b8979[_0x342c('0x41')],_0x1aad40['filters']));_0x563148[_0x342c('0x49')][_0x342c('0xb2')]=_0x1656a5['id'];if(_0x2b8979[_0x342c('0x41')][_0x342c('0x84')]){_0x563148['where']=_[_0x342c('0x9e')](_0x563148[_0x342c('0x49')],{'$or':_[_0x342c('0x2d')](_0x563148[_0x342c('0x44')],function(_0x4a7053){var _0x580a9c={};_0x580a9c[_0x4a7053]={'$like':'%'+_0x2b8979[_0x342c('0x41')][_0x342c('0x84')]+'%'};return _0x580a9c;})});}if(_0x2b8979[_0x342c('0x41')][_0x342c('0x7a')]){var _0x55cd53=_0x2b8979[_0x342c('0x41')][_0x342c('0x7a')][_0x342c('0x31')](',');var _0x3d6c63={};_0x3d6c63[_0x55cd53[0x0]]={'$gte':moment(_0x55cd53[0x1])[_0x342c('0xbf')]('YYYY-MM-DD\x20HH:mm:ss')};_0x563148['where']=_[_0x342c('0x9e')](_0x563148[_0x342c('0x49')],_0x3d6c63);}_0x563148=_[_0x342c('0x9e')]({},_0x563148,_0x2b8979[_0x342c('0xb7')]);return db[_0x342c('0xbc')][_0x342c('0x1f')]({'where':_0x563148[_0x342c('0x49')]})[_0x342c('0x27')](function(_0x44d7fe){_0x5a4766[_0x342c('0x1f')]=_0x44d7fe;if(_0x2b8979['query'][_0x342c('0xb6')]){_0x563148[_0x342c('0xc0')]=[{'all':!![]}];}return db['SmsMessage'][_0x342c('0xc1')](_0x563148);})[_0x342c('0x27')](function(_0x3816e4){_0x5a4766[_0x342c('0xb3')]=_0x3816e4;return _0x5a4766;});}})[_0x342c('0x27')](respondWithFilteredResult(_0x3449a4,_0x563148))['catch'](handleError(_0x3449a4,null));};exports['addTags']=function(_0x9ea9ee,_0x33d2d1,_0x318876){return db[_0x342c('0x3c')][_0x342c('0x65')]({'where':{'id':_0x9ea9ee[_0x342c('0xb9')]['id']}})[_0x342c('0x27')](handleEntityNotFound(_0x33d2d1,null))[_0x342c('0x27')](function(_0xd432d2){if(_0xd432d2){return _0xd432d2[_0x342c('0xc2')](_0x9ea9ee[_0x342c('0x74')][_0x342c('0xc3')],_['omit'](_0x9ea9ee['body'],[_0x342c('0xc3'),'id'])||{})[_0x342c('0xc4')](function(){return db[_0x342c('0xc5')][_0x342c('0xc1')]({'attributes':['id','name',_0x342c('0x4d')],'where':{'id':_0x9ea9ee[_0x342c('0x74')][_0x342c('0xc3')]}});})['then'](function(_0x56fce6){socket[_0x342c('0xc6')](_0x342c('0xc7'),{'id':Number(_0x9ea9ee[_0x342c('0xb9')]['id']),'tags':_0x56fce6||[]});return{'id':Number(_0x9ea9ee[_0x342c('0xb9')]['id']),'tags':_0x56fce6||[]};});}})[_0x342c('0x27')](respondWithResult(_0x33d2d1,null))[_0x342c('0x34')](handleError(_0x33d2d1,null));};exports[_0x342c('0xc8')]=function(_0x4e71dc,_0x269d5a,_0x16384f){return db[_0x342c('0x3c')][_0x342c('0x65')]({'where':{'id':_0x4e71dc[_0x342c('0xb9')]['id']}})[_0x342c('0x27')](handleEntityNotFound(_0x269d5a,null))['then'](function(_0x4ebf62){if(_0x4ebf62){return _0x4ebf62['removeTags'](_0x4e71dc[_0x342c('0x41')][_0x342c('0xc3')]);}})[_0x342c('0x27')](respondWithStatusCode(_0x269d5a,null))[_0x342c('0x34')](handleError(_0x269d5a,null));};exports['download']=function(_0x223d8f,_0x25b42a){var _0x4a1625=moment()[_0x342c('0xc9')]()[_0x342c('0x9c')]();var _0x351dc7=path['join'](config[_0x342c('0xca')],_0x342c('0xcb'),_0x342c('0xcc'),_0x342c('0xcd'));var _0xc4a5a8=path['join'](config[_0x342c('0xca')],_0x342c('0xcb'),_0x342c('0xcc'),_0x342c('0xce'));var _0x2e9319=path[_0x342c('0xcf')](_0x351dc7,_0x4a1625);var _0x3f1501=util[_0x342c('0xbf')](_0x342c('0xd0'),_0x223d8f[_0x342c('0xb9')]['id'],_0x4a1625);var _0x5ecfb0=path['join'](_0x351dc7,_0x3f1501);var _0x65616b=[];_0x65616b['push']({'model':db[_0x342c('0x73')],'as':_0x342c('0x73'),'attributes':['id','fullname'],'raw':!![]});_0x65616b['push']({'model':db['CmContact'],'as':_0x342c('0x6a'),'attributes':['id',_0x342c('0xd1'),_0x342c('0xd2')],'raw':!![]});var _0x1aafdf=[{'model':db[_0x342c('0xbc')],'as':_0x342c('0xd3'),'attributes':['id','body',_0x342c('0x79'),'direction',_0x342c('0xd4'),_0x342c('0x80')],'include':_0x65616b}];_0x1aafdf['push']({'model':db['SmsAccount'],'as':_0x342c('0xd5'),'attributes':['id','name']});_0x1aafdf[_0x342c('0x33')]({'model':db[_0x342c('0x73')],'as':'Owner','attributes':['id',_0x342c('0x2e')]});return db['SmsInteraction'][_0x342c('0x65')]({'where':{'id':_0x223d8f[_0x342c('0xb9')]['id']},'include':_0x1aafdf})[_0x342c('0x27')](handleEntityNotFound(_0x25b42a,null))[_0x342c('0x27')](function(_0x5618e4){if(_0x5618e4){var _0x3c9099=_0x5618e4[_0x342c('0xd6')]({'plain':!![]});fs[_0x342c('0xd7')](_0x2e9319);var _0x21d3b7={'channel':'Sms','account':_0x3c9099[_0x342c('0xd5')][_0x342c('0x2b')],'agent':_0x3c9099[_0x342c('0xd8')]?_0x3c9099['Owner'][_0x342c('0x2e')]:_0x342c('0xd9'),'createdAt':moment(_0x3c9099[_0x342c('0x79')])[_0x342c('0xbf')](_0x342c('0xda'))[_0x342c('0x9c')](),'closedAt':_0x3c9099[_0x342c('0x39')]?moment(_0x3c9099[_0x342c('0xdb')])[_0x342c('0xbf')](_0x342c('0xda'))[_0x342c('0x9c')]():'','disposition':_0x3c9099['disposition'],'messages':_(_0x3c9099[_0x342c('0xd3')])[_0x342c('0x84')]({'secret':![]})['map'](function(_0x51604f){return{'date':moment(_0x51604f[_0x342c('0x79')])[_0x342c('0xbf')](_0x342c('0xda'))[_0x342c('0x9c')](),'sender':_0x51604f[_0x342c('0xdc')]==='out'?_0x51604f[_0x342c('0x73')]?_0x51604f[_0x342c('0x73')][_0x342c('0x2e')]:'System':_0x51604f[_0x342c('0x6a')][_0x342c('0xd1')]+(_0x51604f['Contact'][_0x342c('0xd2')]?'\x20'+_0x51604f[_0x342c('0x6a')]['lastName']:''),'body':_0x51604f[_0x342c('0x74')],'direction':_0x51604f['direction']===_0x342c('0xdd')?'A':'C','secret':_0x51604f[_0x342c('0xd4')],'read':_0x51604f[_0x342c('0x80')]};})[_0x342c('0x67')]()};return ejs[_0x342c('0xde')](path[_0x342c('0xcf')](config['root'],_0x342c('0xcb'),_0x342c('0xdf'),_0x342c('0xe0')),{'interaction':_0x21d3b7})[_0x342c('0x27')](function(_0x4eb843){var _0x54963c=path['join'](_0x2e9319,'transcript-'+_0x3c9099['id']+'-'+_0x4a1625+_0x342c('0xe1'));var _0x51e30b={'path':_0x54963c,'channel':_0x342c('0xe2'),'interactionId':_0x3c9099['id']};return pdf['createPdfFromHTML'](_0x4eb843,_0x51e30b);})['then'](function(){return new BPromise(function(_0x1c810c,_0x5c1bb2){zipdir(_0x2e9319,{'saveTo':_0x5ecfb0},function(_0x2536b1,_0x3a0e06){if(_0x2536b1)return _0x5c1bb2(_0x2536b1);return _0x1c810c(_0x3a0e06);});})[_0x342c('0x27')](function(){return new BPromise(function(_0x4590cd,_0x51e854){rimraf(_0x2e9319,function(_0x5c01a7){if(_0x5c01a7)_0x51e854(_0x5c01a7);return _0x4590cd();});});})[_0x342c('0x27')](function(){return _0x25b42a['download'](_0x5ecfb0,_0x3f1501,function(_0x4cd543){if(_0x4cd543){console[_0x342c('0xe3')](_0x342c('0xe4'),_0x4cd543);}else{fs['unlinkSync'](_0x5ecfb0);}});});});}else{return _0x25b42a[_0x342c('0x1a')](0xc8);}})[_0x342c('0x34')](handleError(_0x25b42a,null));}; \ No newline at end of file +var _0xd8df=['operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','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','buildExpression','keys','isEmpty','i.SmsAccountId\x20IN\x20?','createdAt','parse','$gte','null','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','order','DESC','t.id\x20IN\x20?','resolve','then','SmsAccountId','user','role','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','rows','show','params','includeAll','include','options','create','describe','addMessage','ids','omit','getMessages','findOne','nolimit','format','YYYY-MM-DD\x20HH:mm:ss','SmsMessage','setTags','spread','findAll','color','emit','smsInteractionTags:save','removeTags','download','unix','join','root','server','files','attachments','CmContact','Contact','lastName','Messages','direction','SmsAccount','Account','Owner','get','mkdirSync','Sms','closedAt','out','System','firstName','secret','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','err','unlinkSync','sendStatus','eml-format','rimraf','zip-dir','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','register','status','end','json','undefined','count','offset','limit','apply','reject','save','update','stack','name','send','Users','fullname','TagIds','Tags','split','forEach','push','catch','waiting','talking','total','UserId','closed','answered','index','map','SmsInteraction','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','sort','where','filters','pick','select','field','from','tools_tags','u.id','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','it.SmsInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd8df,0x163));var _0xfd8d=function(_0x1d370d,_0x2aae43){_0x1d370d=_0x1d370d-0x0;var _0x87aa91=_0xd8df[_0x1d370d];return _0x87aa91;};'use strict';var emlformat=require(_0xfd8d('0x0'));var rimraf=require(_0xfd8d('0x1'));var zipdir=require(_0xfd8d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfd8d('0x3'));var Mustache=require(_0xfd8d('0x4'));var util=require(_0xfd8d('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xfd8d('0x6'));var ejs=require(_0xfd8d('0x7'));var fs=require('fs');var fs_extra=require(_0xfd8d('0x8'));var _=require(_0xfd8d('0x9'));var squel=require(_0xfd8d('0xa'));var crypto=require(_0xfd8d('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xfd8d('0xc'));var toCsv=require(_0xfd8d('0x6'));var querystring=require(_0xfd8d('0xd'));var Papa=require('papaparse');var Redis=require(_0xfd8d('0xe'));var authService=require(_0xfd8d('0xf'));var qs=require(_0xfd8d('0x10'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xfd8d('0x11'));var hardwareService=require(_0xfd8d('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xfd8d('0x13'));var config=require(_0xfd8d('0x14'));var licenseUtil=require(_0xfd8d('0x15'));var db=require('../../mysqldb')['db'];config[_0xfd8d('0x16')]=_[_0xfd8d('0x17')](config[_0xfd8d('0x16')],{'host':_0xfd8d('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsInteraction.socket')[_0xfd8d('0x19')](socket);function respondWithStatusCode(_0x4259ae,_0x467951){_0x467951=_0x467951||0xcc;return function(_0x4d18e1){if(_0x4d18e1){return _0x4259ae['sendStatus'](_0x467951);}return _0x4259ae[_0xfd8d('0x1a')](_0x467951)[_0xfd8d('0x1b')]();};}function respondWithResult(_0x3926e3,_0x369a24){_0x369a24=_0x369a24||0xc8;return function(_0x734e8f){if(_0x734e8f){return _0x3926e3[_0xfd8d('0x1a')](_0x369a24)[_0xfd8d('0x1c')](_0x734e8f);}};}function respondWithFilteredResult(_0x50d11b,_0x22edcf){return function(_0x2ec838){if(_0x2ec838){var _0x202293=typeof _0x22edcf['offset']===_0xfd8d('0x1d')&&typeof _0x22edcf['limit']===_0xfd8d('0x1d');var _0x16f6f=_0x2ec838[_0xfd8d('0x1e')];var _0x507d4f=_0x202293?0x0:_0x22edcf[_0xfd8d('0x1f')];var _0x53a489=_0x202293?_0x2ec838['count']:_0x22edcf[_0xfd8d('0x1f')]+_0x22edcf[_0xfd8d('0x20')];var _0x317f54;if(_0x53a489>=_0x16f6f){_0x53a489=_0x16f6f;_0x317f54=0xc8;}else{_0x317f54=0xce;}_0x50d11b['status'](_0x317f54);return _0x50d11b['set']('Content-Range',_0x507d4f+'-'+_0x53a489+'/'+_0x16f6f)[_0xfd8d('0x1c')](_0x2ec838);}return null;};}function patchUpdates(_0x55abfb){return function(_0x5ae4ab){try{jsonpatch[_0xfd8d('0x21')](_0x5ae4ab,_0x55abfb,!![]);}catch(_0x13f695){return BPromise[_0xfd8d('0x22')](_0x13f695);}return _0x5ae4ab[_0xfd8d('0x23')]();};}function saveUpdates(_0x41765a,_0x3470b5){return function(_0x275faa){if(_0x275faa){return _0x275faa[_0xfd8d('0x24')](_0x41765a)['then'](function(_0x54396f){return _0x54396f;});}return null;};}function removeEntity(_0x546828,_0x272182){return function(_0x17adf4){if(_0x17adf4){return _0x17adf4['destroy']()['then'](function(){_0x546828[_0xfd8d('0x1a')](0xcc)[_0xfd8d('0x1b')]();});}};}function handleEntityNotFound(_0x3249d4,_0x459914){return function(_0x4cd33e){if(!_0x4cd33e){_0x3249d4['sendStatus'](0x194);}return _0x4cd33e;};}function handleError(_0x4c98ea,_0x240864){_0x240864=_0x240864||0x1f4;return function(_0x15b08c){logger['error'](_0x15b08c[_0xfd8d('0x25')]);if(_0x15b08c['name']){delete _0x15b08c[_0xfd8d('0x26')];}_0x4c98ea[_0xfd8d('0x1a')](_0x240864)[_0xfd8d('0x27')](_0x15b08c);};}function getInteractionUsers(_0x2bd8df,_0x14c84c){return new BPromise(function(_0x527842,_0x1e00ce){try{if(_0x14c84c[_0x2bd8df['id']]){_0x2bd8df[_0xfd8d('0x28')]=_['map'](_0x14c84c[_0x2bd8df['id']],function(_0x4c2f6d){return{'id':_0x4c2f6d['id'],'fullname':_0x4c2f6d[_0xfd8d('0x29')]};});}}catch(_0x3592fb){_0x1e00ce(_0x3592fb);}_0x527842(_0x2bd8df);});}function getInteractionTags(_0x41270d,_0x4f29a9){return new BPromise(function(_0x587772,_0xb4f887){try{if(_0x41270d[_0xfd8d('0x2a')]){_0x41270d[_0xfd8d('0x2b')]=[];_0x41270d[_0xfd8d('0x2a')][_0xfd8d('0x2c')](',')[_0xfd8d('0x2d')](function(_0x16dc72){_0x41270d[_0xfd8d('0x2b')][_0xfd8d('0x2e')](_0x4f29a9[_0x16dc72]);});}delete _0x41270d[_0xfd8d('0x2a')];}catch(_0xe91dd3){_0xb4f887(_0xe91dd3);}_0x587772(_0x41270d);});}function updateSmsInteraction(_0x3f5c11,_0x59fbee,_0x25b677){return new BPromise(function(_0x49a037,_0x54adbf){return getInteractionUsers(_0x3f5c11,_0x25b677)['then'](function(_0x52680f){return getInteractionTags(_0x52680f,_0x59fbee);})['then'](function(_0x17deb3){return getStateInteraction(_0x17deb3);})['then'](function(_0x6ebbda){_0x49a037(_0x6ebbda);})[_0xfd8d('0x2f')](function(_0x1bd3a4){_0x54adbf(_0x1bd3a4);});});}function getStateInteraction(_0x573044){return new BPromise(function(_0x437b8c){_0x573044[_0xfd8d('0x30')]=0x0;_0x573044[_0xfd8d('0x31')]=0x0;_0x573044['answered']=0x0;_0x573044['unmanaged']=0x0;_0x573044[_0xfd8d('0x32')]=0x0;if(!_0x573044['closed']&&!_0x573044[_0xfd8d('0x33')]){_0x573044['waiting']+=0x1;}if(!_0x573044[_0xfd8d('0x34')]&&_0x573044[_0xfd8d('0x33')]){_0x573044[_0xfd8d('0x31')]+=0x1;if(_0x573044['waiting']){_0x573044[_0xfd8d('0x30')]-=0x1;}}if(_0x573044[_0xfd8d('0x34')]&&_0x573044[_0xfd8d('0x33')]){_0x573044[_0xfd8d('0x35')]+=0x1;if(_0x573044['talking']){_0x573044[_0xfd8d('0x31')]-=0x1;}}if(_0x573044[_0xfd8d('0x34')]&&!_0x573044[_0xfd8d('0x33')]){_0x573044['unmanaged']+=0x1;if(_0x573044[_0xfd8d('0x30')]){_0x573044[_0xfd8d('0x30')]-=0x1;}}_0x573044['total']+=0x1;_0x437b8c(_0x573044);});}exports[_0xfd8d('0x36')]=function(_0x2f30ac,_0x5dfdc3){var _0x1db7bd={},_0x4c5fea={},_0x5879d6={'count':0x0,'rows':[]};var _0x511cb1=_[_0xfd8d('0x37')](db[_0xfd8d('0x38')][_0xfd8d('0x39')],function(_0x1ba1a4){return{'name':_0x1ba1a4[_0xfd8d('0x3a')],'type':_0x1ba1a4[_0xfd8d('0x3b')][_0xfd8d('0x3c')]};});_0x4c5fea[_0xfd8d('0x3d')]=_[_0xfd8d('0x37')](_0x511cb1,'name');_0x4c5fea['query']=_['keys'](_0x2f30ac[_0xfd8d('0x3e')]);_0x4c5fea['filters']=_['intersection'](_0x4c5fea[_0xfd8d('0x3d')],_0x4c5fea['query']);_0x1db7bd[_0xfd8d('0x3f')]=_[_0xfd8d('0x40')](_0x4c5fea[_0xfd8d('0x3d')],qs['fields'](_0x2f30ac[_0xfd8d('0x3e')][_0xfd8d('0x41')]));_0x1db7bd['attributes']=_0x1db7bd[_0xfd8d('0x3f')][_0xfd8d('0x42')]?_0x1db7bd['attributes']:_0x4c5fea['model'];if(!_0x2f30ac[_0xfd8d('0x3e')][_0xfd8d('0x43')]('nolimit')){_0x1db7bd[_0xfd8d('0x20')]=qs[_0xfd8d('0x20')](_0x2f30ac[_0xfd8d('0x3e')]['limit']);_0x1db7bd[_0xfd8d('0x1f')]=qs['offset'](_0x2f30ac[_0xfd8d('0x3e')]['offset']);}_0x1db7bd['order']=qs['sort'](_0x2f30ac[_0xfd8d('0x3e')][_0xfd8d('0x44')]);_0x1db7bd[_0xfd8d('0x45')]=qs[_0xfd8d('0x46')](_[_0xfd8d('0x47')](_0x2f30ac[_0xfd8d('0x3e')],_0x4c5fea['filters']),_0x511cb1);var _0x3b112f=[];var _0x23b717=squel[_0xfd8d('0x48')]()[_0xfd8d('0x49')]('id')[_0xfd8d('0x49')](_0xfd8d('0x26'))[_0xfd8d('0x49')]('color')[_0xfd8d('0x4a')](_0xfd8d('0x4b'));var _0x3ace9d=squel['select']()['field'](_0xfd8d('0x4c'))[_0xfd8d('0x49')](_0xfd8d('0x4d'))[_0xfd8d('0x49')](_0xfd8d('0x4e'))[_0xfd8d('0x4a')](_0xfd8d('0x4f'),'ui')[_0xfd8d('0x50')]('users','u','u.id\x20=\x20ui.UserId');var _0x5ef9c7=squel[_0xfd8d('0x48')]()[_0xfd8d('0x4a')]('sms_interactions','i')[_0xfd8d('0x50')](_0xfd8d('0x51'),'c',_0xfd8d('0x52'))['left_join'](_0xfd8d('0x53'),'o',_0xfd8d('0x54'))[_0xfd8d('0x50')](_0xfd8d('0x55'),'a',_0xfd8d('0x56'))[_0xfd8d('0x50')](_0xfd8d('0x57'),'me',_0xfd8d('0x58'))['left_join'](_0xfd8d('0x59'),'it',_0xfd8d('0x5a'))[_0xfd8d('0x50')](_0xfd8d('0x4b'),'t','t.id\x20=\x20it.TagId');var _0x65aa60=squel[_0xfd8d('0x5b')]();var _0x51a061=[];var _0x33857a=squel['expr']();var _0x3b0c7e;if(_0x2f30ac[_0xfd8d('0x3e')][_0xfd8d('0x5c')]){_0x3b0c7e=as[_0xfd8d('0x5d')](_0x2f30ac[_0xfd8d('0x3e')][_0xfd8d('0x5c')]);var _0x560e74=_0x3b0c7e[_0xfd8d('0x5e')];for(var _0x3404e8=0x0;_0x3404e8<_0x3b0c7e['conditions'][_0xfd8d('0x42')];_0x3404e8++){var _0x59b267=_0x3b0c7e[_0xfd8d('0x5f')][_0x3404e8];var _0x39efa0='i';var _0xe0ca30=_[_0xfd8d('0x60')](_0x511cb1,[_0xfd8d('0x26'),_0x59b267['field']]);if(!_0xe0ca30){switch(_0x59b267['field']){case _0xfd8d('0x61'):if(_0x59b267[_0xfd8d('0x62')]==0x1){_0x5ef9c7[_0xfd8d('0x63')]('`'+_0x59b267['field']+_0xfd8d('0x64'));}else{_0x5ef9c7[_0xfd8d('0x63')]('`'+_0x59b267['field']+'`\x20>\x200');}break;case'Contact':if(_0x59b267[_0xfd8d('0x65')]===_0xfd8d('0x66')){if(_0x59b267['value'][_0xfd8d('0x2c')]('\x20')[_0xfd8d('0x42')]>0x1){_0x65aa60[_0x560e74]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xfd8d('0x67')](_0x59b267[_0xfd8d('0x62')]),null);}else{var _0x315c96='%'+_0x59b267[_0xfd8d('0x62')]+'%';_0x65aa60[_0x560e74](_0xfd8d('0x68'),_0x315c96,_0x315c96,_0x315c96);}}else{_0xe0ca30=_['find'](_0x511cb1,[_0xfd8d('0x26'),_0xfd8d('0x69')]);_0x59b267['field']='ContactId';_0x42d893=as['buildExpression'](_0x39efa0,_0xe0ca30['type'],_0x59b267);_0x65aa60[_0x560e74](_0x42d893[_0xfd8d('0x6a')],_0x42d893[_0xfd8d('0x62')][_0xfd8d('0x6b')],_0x42d893[_0xfd8d('0x62')][_0xfd8d('0x1b')]);}break;case _0xfd8d('0x6c'):var _0x50ad62=_0x59b267[_0xfd8d('0x62')][_0xfd8d('0x2c')](',')[_0xfd8d('0x37')](function(_0x395fa8){return Number(_0x395fa8);});_0x50ad62[_0xfd8d('0x2d')](function(_0x4991df){_0x33857a['or'](_0xfd8d('0x6d'),'%,'+_0x4991df+',%');});_0x51a061=_[_0xfd8d('0x6e')](_0x51a061,_0x50ad62);break;case _0xfd8d('0x6f'):if(_0x59b267[_0xfd8d('0x65')]===_0xfd8d('0x66')){_0x65aa60[_0x560e74](_0xfd8d('0x70'),'%'+_0x59b267['value']+'%',null);}else{_0xe0ca30=_[_0xfd8d('0x60')](_0x511cb1,[_0xfd8d('0x26'),_0xfd8d('0x33')]);_0x59b267[_0xfd8d('0x49')]=_0xfd8d('0x33');_0x42d893=as['buildExpression'](_0x39efa0,_0xe0ca30[_0xfd8d('0x3b')],_0x59b267);_0x65aa60[_0x560e74](_0x42d893['text'],_0x42d893[_0xfd8d('0x62')][_0xfd8d('0x6b')],_0x42d893[_0xfd8d('0x62')]['end']);}break;case _0xfd8d('0x71'):_0x42d893=as[_0xfd8d('0x72')]('me',null,_0x59b267);_0x65aa60[_0x560e74](_0x42d893[_0xfd8d('0x6a')],_0x42d893['value'][_0xfd8d('0x6b')],_0x42d893[_0xfd8d('0x62')][_0xfd8d('0x1b')]);break;}}else{var _0x42d893=as[_0xfd8d('0x72')](_0x39efa0,_0xe0ca30[_0xfd8d('0x3b')],_0x59b267);_0x65aa60[_0x560e74](_0x42d893[_0xfd8d('0x6a')],_0x42d893[_0xfd8d('0x62')][_0xfd8d('0x6b')],_0x42d893['value'][_0xfd8d('0x1b')]);}}}else{var _0x3b10d8=_(_0x2f30ac[_0xfd8d('0x3e')])[_0xfd8d('0x73')]()[_0xfd8d('0x37')](function(_0xa06fd3){return _['some'](_0x511cb1,['name',_0xa06fd3])?_0xa06fd3:undefined;})['compact']()[_0xfd8d('0x62')]();if(!_[_0xfd8d('0x74')](_0x3b10d8)){_0x3b10d8[_0xfd8d('0x2d')](function(_0x23c863){if(_0x23c863==='SmsAccountId'){_0x5ef9c7[_0xfd8d('0x45')](_0xfd8d('0x75'),[]['concat'](_0x2f30ac[_0xfd8d('0x3e')][_0x23c863]));}else if(_0x23c863===_0xfd8d('0x76')){var _0x12a8c8=JSON[_0xfd8d('0x77')](_0x2f30ac[_0xfd8d('0x3e')][_0x23c863])[_0xfd8d('0x78')];var _0x4729c9=JSON[_0xfd8d('0x77')](_0x2f30ac[_0xfd8d('0x3e')][_0x23c863])['$lte'];_0x5ef9c7[_0xfd8d('0x45')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x12a8c8,_0x4729c9);}else{if(_0x2f30ac[_0xfd8d('0x3e')][_0x23c863]===_0xfd8d('0x79')){_0x5ef9c7[_0xfd8d('0x45')]('i.'+_0x23c863+'\x20IS\x20NULL');}else{_0x5ef9c7[_0xfd8d('0x45')]('i.'+_0x23c863+'\x20=\x20?',_0x2f30ac[_0xfd8d('0x3e')][_0x23c863]);}}});}if(_0x2f30ac[_0xfd8d('0x3e')][_0xfd8d('0x7a')]){if(_0x2f30ac[_0xfd8d('0x3e')][_0xfd8d('0x7a')]==0x1){_0x5ef9c7[_0xfd8d('0x63')]('`unreadMessages`\x20=\x200');}else{_0x5ef9c7[_0xfd8d('0x63')](_0xfd8d('0x7b'));}}if(_0x2f30ac[_0xfd8d('0x3e')][_0xfd8d('0x7c')]){_0x51a061=_[_0xfd8d('0x7d')](_0x2f30ac[_0xfd8d('0x3e')][_0xfd8d('0x7c')])?_0x2f30ac['query']['tag']:new Array(_0x2f30ac['query']['tag']);_0x51a061[_0xfd8d('0x2d')](function(_0x81c4ad){_0x33857a['or'](_0xfd8d('0x6d'),'%,'+_0x81c4ad+',%');});}if(_0x2f30ac[_0xfd8d('0x3e')][_0xfd8d('0x7e')]){var _0x100d79=_0x2f30ac[_0xfd8d('0x3e')][_0xfd8d('0x7e')][_0xfd8d('0x7f')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xfd8d('0x80')](_0x100d79)){_0x65aa60['or'](_0xfd8d('0x81'),_0x100d79+'%')['or'](_0xfd8d('0x82'),_0x100d79+'%');}else{_0x65aa60['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xfd8d('0x67')](_0x100d79))['or'](_0xfd8d('0x83'),_0x100d79+'%');}}}_0x5ef9c7[_0xfd8d('0x45')](_0x65aa60);_0x5ef9c7[_0xfd8d('0x84')](_0xfd8d('0x85'));var _0x36c96f={'type':db[_0xfd8d('0x86')]['QueryTypes'][_0xfd8d('0x87')],'raw':!![]};var _0x3916d0=_0x5ef9c7['clone']();_0x3916d0['field'](_0xfd8d('0x85'));_0x3916d0[_0xfd8d('0x49')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xfd8d('0x61'));if(_0x1db7bd['order']){_0x1db7bd[_0xfd8d('0x88')][_0xfd8d('0x2d')](function(_0x153307){var _0x4a3c26=_0x153307[0x0]==='contactName'?_0x153307[0x0]:'i.'+_0x153307[0x0];_0x5ef9c7[_0xfd8d('0x88')](_0x4a3c26,_0x153307[0x1]===_0xfd8d('0x89')?![]:!![]);});}if(!_['isEmpty'](_0x51a061)){_0x5ef9c7[_0xfd8d('0x63')](_0x33857a);_0x3916d0['where'](_0xfd8d('0x8a'),_0x51a061);}BPromise[_0xfd8d('0x8b')]()[_0xfd8d('0x8c')](function(){if(!_0x3b0c7e){if(_0x2f30ac[_0xfd8d('0x3e')][_0xfd8d('0x8d')])return;_0x3916d0['where']('i.SmsAccountId\x20IS\x20NOT\x20NULL');_0x5ef9c7[_0xfd8d('0x45')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x2f30ac[_0xfd8d('0x8e')][_0xfd8d('0x8f')]!==_0xfd8d('0x90'))return;return _0x2f30ac['user'][_0xfd8d('0x91')]({'attributes':['id'],'raw':!![]})[_0xfd8d('0x8c')](function(_0x33650f){if(_[_0xfd8d('0x74')](_0x33650f)){_0x3916d0['where'](_0xfd8d('0x92'));_0x5ef9c7[_0xfd8d('0x45')](_0xfd8d('0x92'));}else{_0x3916d0[_0xfd8d('0x45')]('i.SmsAccountId\x20IN\x20?',_['map'](_0x33650f,'id'));_0x5ef9c7['where'](_0xfd8d('0x75'),_[_0xfd8d('0x37')](_0x33650f,'id'));}});})['then'](function(){if(_0x2f30ac[_0xfd8d('0x8e')][_0xfd8d('0x8f')]==='agent'&&!_0x3b0c7e&&!_0x2f30ac['query'][_0xfd8d('0x8d')])return[];return db[_0xfd8d('0x93')][_0xfd8d('0x3e')](_0x3916d0['toString'](),_0x36c96f);})['then'](function(_0x2cb889){_0x5879d6[_0xfd8d('0x1e')]=_0x2cb889[_0xfd8d('0x42')];if(_0x5879d6['count']===0x0)return[];return db[_0xfd8d('0x93')]['query'](_0x23b717[_0xfd8d('0x94')](),_0x36c96f)['then'](function(_0x1a8da4){_0x3b112f=_[_0xfd8d('0x95')](_0x1a8da4,'id');_0x36c96f=_[_0xfd8d('0x96')](_0x36c96f,{'model':db[_0xfd8d('0x38')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2f30ac[_0xfd8d('0x3e')][_0xfd8d('0x41')]){_0x1db7bd[_0xfd8d('0x3f')][_0xfd8d('0x2d')](function(_0x1bd289){_0x5ef9c7[_0xfd8d('0x49')]('i.'+_0x1bd289);});}else{_0x5ef9c7[_0xfd8d('0x49')](_0xfd8d('0x97'),'unreadMessages');_0x5ef9c7['field'](_0xfd8d('0x98'),_0xfd8d('0x99'));_0x5ef9c7[_0xfd8d('0x49')](_0xfd8d('0x9a'),_0xfd8d('0x9b'));_0x5ef9c7[_0xfd8d('0x49')](_0xfd8d('0x9c'),'contactName');_0x5ef9c7[_0xfd8d('0x49')]('i.*');_0x5ef9c7[_0xfd8d('0x49')](_0xfd8d('0x9d'),'Contact.firstName');_0x5ef9c7[_0xfd8d('0x49')](_0xfd8d('0x9e'),_0xfd8d('0x9f'));_0x5ef9c7[_0xfd8d('0x49')](_0xfd8d('0xa0'),'Contact.email');_0x5ef9c7[_0xfd8d('0x49')](_0xfd8d('0xa1'),_0xfd8d('0xa2'));_0x5ef9c7[_0xfd8d('0x49')](_0xfd8d('0xa3'),_0xfd8d('0xa4'));_0x5ef9c7[_0xfd8d('0x49')]('c.fax',_0xfd8d('0xa5'));_0x5ef9c7[_0xfd8d('0x49')](_0xfd8d('0xa6'),_0xfd8d('0xa7'));_0x5ef9c7[_0xfd8d('0x49')]('o.internal',_0xfd8d('0xa8'));_0x5ef9c7['field'](_0xfd8d('0xa9'),_0xfd8d('0x2a'));}if(_0x1db7bd[_0xfd8d('0x20')])_0x5ef9c7[_0xfd8d('0x20')](_0x1db7bd[_0xfd8d('0x20')]);if(_0x1db7bd['offset'])_0x5ef9c7[_0xfd8d('0x1f')](_0x1db7bd['offset']);return db[_0xfd8d('0x93')][_0xfd8d('0x3e')](_0x5ef9c7['toString'](),_0x36c96f);})['then'](function(_0x183bc8){if(_0x183bc8[_0xfd8d('0x42')]>0x0)_0x3ace9d[_0xfd8d('0x45')](_0xfd8d('0xaa'),_[_0xfd8d('0x37')](_0x183bc8,'id'));return db['sequelize'][_0xfd8d('0x3e')](_0x3ace9d[_0xfd8d('0x94')](),_0x36c96f)['then'](function(_0x5454f1){var _0x25ea86=_[_0xfd8d('0xab')](_0x5454f1,_0xfd8d('0xac'));var _0x46f5cc=[];_0x183bc8[_0xfd8d('0x2d')](function(_0xcff0d1){_0x46f5cc[_0xfd8d('0x2e')](updateSmsInteraction(_0xcff0d1,_0x3b112f,_0x25ea86));});return BPromise[_0xfd8d('0xad')](_0x46f5cc);});});})['then'](function(_0x53d26d){_0x5879d6[_0xfd8d('0xae')]=_0x53d26d;return _0x5879d6;})['then'](respondWithFilteredResult(_0x5dfdc3,_0x1db7bd))[_0xfd8d('0x2f')](handleError(_0x5dfdc3,null));};exports[_0xfd8d('0xaf')]=function(_0x533733,_0x4ae157){var _0x35a2b8={'raw':![],'where':{'id':_0x533733[_0xfd8d('0xb0')]['id']}},_0x5d00a9={};_0x5d00a9[_0xfd8d('0x3d')]=_[_0xfd8d('0x73')](db[_0xfd8d('0x38')][_0xfd8d('0x39')]);_0x5d00a9[_0xfd8d('0x3e')]=_[_0xfd8d('0x73')](_0x533733['query']);_0x5d00a9[_0xfd8d('0x46')]=_[_0xfd8d('0x40')](_0x5d00a9[_0xfd8d('0x3d')],_0x5d00a9['query']);_0x35a2b8['attributes']=_[_0xfd8d('0x40')](_0x5d00a9[_0xfd8d('0x3d')],qs[_0xfd8d('0x41')](_0x533733['query'][_0xfd8d('0x41')]));_0x35a2b8[_0xfd8d('0x3f')]=_0x35a2b8['attributes'][_0xfd8d('0x42')]?_0x35a2b8[_0xfd8d('0x3f')]:_0x5d00a9[_0xfd8d('0x3d')];if(_0x533733[_0xfd8d('0x3e')][_0xfd8d('0xb1')]){_0x35a2b8[_0xfd8d('0xb2')]=[{'all':!![]}];}_0x35a2b8=_[_0xfd8d('0x96')]({},_0x35a2b8,_0x533733[_0xfd8d('0xb3')]);return db[_0xfd8d('0x38')][_0xfd8d('0x60')](_0x35a2b8)[_0xfd8d('0x8c')](handleEntityNotFound(_0x4ae157,null))[_0xfd8d('0x8c')](respondWithResult(_0x4ae157,null))[_0xfd8d('0x2f')](handleError(_0x4ae157,null));};exports[_0xfd8d('0xb4')]=function(_0x1d3c68,_0x16d92d){return db['SmsInteraction'][_0xfd8d('0xb4')](_0x1d3c68[_0xfd8d('0x71')],{})['then'](respondWithResult(_0x16d92d,0xc9))['catch'](handleError(_0x16d92d,null));};exports[_0xfd8d('0x24')]=function(_0x56e7f7,_0x16bbb9){if(_0x56e7f7[_0xfd8d('0x71')]['id']){delete _0x56e7f7[_0xfd8d('0x71')]['id'];}return db[_0xfd8d('0x38')]['find']({'where':{'id':_0x56e7f7[_0xfd8d('0xb0')]['id']}})['then'](handleEntityNotFound(_0x16bbb9,null))[_0xfd8d('0x8c')](saveUpdates(_0x56e7f7[_0xfd8d('0x71')],null))[_0xfd8d('0x8c')](respondWithResult(_0x16bbb9,null))[_0xfd8d('0x2f')](handleError(_0x16bbb9,null));};exports['destroy']=function(_0x3959bd,_0x2b2ce8){return db[_0xfd8d('0x38')]['find']({'where':{'id':_0x3959bd[_0xfd8d('0xb0')]['id']}})['then'](handleEntityNotFound(_0x2b2ce8,null))[_0xfd8d('0x8c')](removeEntity(_0x2b2ce8,null))[_0xfd8d('0x2f')](handleError(_0x2b2ce8,null));};exports[_0xfd8d('0xb5')]=function(_0x84ffa8,_0x2b1548){return db[_0xfd8d('0x38')][_0xfd8d('0xb5')]()[_0xfd8d('0x8c')](respondWithResult(_0x2b1548,null))[_0xfd8d('0x2f')](handleError(_0x2b1548,null));};exports[_0xfd8d('0xb6')]=function(_0x36fed2,_0x4b8100,_0x5e338b){return db['SmsMessage'][_0xfd8d('0x60')]({'where':{'id':_0x36fed2['params']['id']}})[_0xfd8d('0x8c')](handleEntityNotFound(_0x4b8100,null))[_0xfd8d('0x8c')](function(_0x33012e){if(_0x33012e){return _0x33012e[_0xfd8d('0xb6')](_0x36fed2[_0xfd8d('0x71')][_0xfd8d('0xb7')],_[_0xfd8d('0xb8')](_0x36fed2[_0xfd8d('0x71')],['ids','id'])||{});}})[_0xfd8d('0x8c')](respondWithResult(_0x4b8100,null))[_0xfd8d('0x2f')](handleError(_0x4b8100,null));};exports[_0xfd8d('0xb9')]=function(_0x1c295f,_0x3b3dca,_0x228f9b){var _0x304eed={'raw':![],'where':{}};var _0x2b5d1c={};var _0x253f2c={'count':0x0,'rows':[]};return db[_0xfd8d('0x38')][_0xfd8d('0xba')]({'where':{'id':_0x1c295f[_0xfd8d('0xb0')]['id']}})['then'](handleEntityNotFound(_0x3b3dca,null))[_0xfd8d('0x8c')](function(_0x100352){if(_0x100352){_0x2b5d1c['model']=_[_0xfd8d('0x73')](db['SmsMessage'][_0xfd8d('0x39')]);_0x2b5d1c[_0xfd8d('0x3e')]=_[_0xfd8d('0x73')](_0x1c295f[_0xfd8d('0x3e')]);_0x2b5d1c[_0xfd8d('0x46')]=_['intersection'](_0x2b5d1c['model'],_0x2b5d1c[_0xfd8d('0x3e')]);_0x304eed[_0xfd8d('0x3f')]=_[_0xfd8d('0x40')](_0x2b5d1c['model'],qs['fields'](_0x1c295f[_0xfd8d('0x3e')][_0xfd8d('0x41')]));_0x304eed['attributes']=_0x304eed[_0xfd8d('0x3f')]['length']?_0x304eed[_0xfd8d('0x3f')]:_0x2b5d1c[_0xfd8d('0x3d')];if(!_0x1c295f[_0xfd8d('0x3e')]['hasOwnProperty'](_0xfd8d('0xbb'))){_0x304eed[_0xfd8d('0x20')]=qs['limit'](_0x1c295f[_0xfd8d('0x3e')][_0xfd8d('0x20')]);_0x304eed['offset']=qs[_0xfd8d('0x1f')](_0x1c295f[_0xfd8d('0x3e')][_0xfd8d('0x1f')]);}_0x304eed[_0xfd8d('0x88')]=qs[_0xfd8d('0x44')](_0x1c295f[_0xfd8d('0x3e')][_0xfd8d('0x44')]);_0x304eed['where']=qs[_0xfd8d('0x46')](_[_0xfd8d('0x47')](_0x1c295f[_0xfd8d('0x3e')],_0x2b5d1c[_0xfd8d('0x46')]));_0x304eed[_0xfd8d('0x45')][_0xfd8d('0xac')]=_0x100352['id'];if(_0x1c295f[_0xfd8d('0x3e')]['filter']){_0x304eed['where']=_[_0xfd8d('0x96')](_0x304eed['where'],{'$or':_[_0xfd8d('0x37')](_0x304eed[_0xfd8d('0x3f')],function(_0x38e3c6){var _0x46d288={};_0x46d288[_0x38e3c6]={'$like':'%'+_0x1c295f[_0xfd8d('0x3e')]['filter']+'%'};return _0x46d288;})});}if(_0x1c295f[_0xfd8d('0x3e')]['$gte']){var _0x210ab2=_0x1c295f[_0xfd8d('0x3e')]['$gte']['split'](',');var _0x53710a={};_0x53710a[_0x210ab2[0x0]]={'$gte':moment(_0x210ab2[0x1])[_0xfd8d('0xbc')](_0xfd8d('0xbd'))};_0x304eed[_0xfd8d('0x45')]=_[_0xfd8d('0x96')](_0x304eed[_0xfd8d('0x45')],_0x53710a);}_0x304eed=_[_0xfd8d('0x96')]({},_0x304eed,_0x1c295f['options']);return db['SmsMessage'][_0xfd8d('0x1e')]({'where':_0x304eed[_0xfd8d('0x45')]})[_0xfd8d('0x8c')](function(_0x41dc96){_0x253f2c['count']=_0x41dc96;if(_0x1c295f[_0xfd8d('0x3e')][_0xfd8d('0xb1')]){_0x304eed[_0xfd8d('0xb2')]=[{'all':!![]}];}return db[_0xfd8d('0xbe')]['findAll'](_0x304eed);})[_0xfd8d('0x8c')](function(_0x740b3d){_0x253f2c['rows']=_0x740b3d;return _0x253f2c;});}})['then'](respondWithFilteredResult(_0x3b3dca,_0x304eed))[_0xfd8d('0x2f')](handleError(_0x3b3dca,null));};exports['addTags']=function(_0x33e46f,_0x58f2fe,_0x59d370){return db['SmsInteraction'][_0xfd8d('0x60')]({'where':{'id':_0x33e46f['params']['id']}})[_0xfd8d('0x8c')](handleEntityNotFound(_0x58f2fe,null))['then'](function(_0x7b73a1){if(_0x7b73a1){return _0x7b73a1[_0xfd8d('0xbf')](_0x33e46f[_0xfd8d('0x71')][_0xfd8d('0xb7')],_[_0xfd8d('0xb8')](_0x33e46f['body'],['ids','id'])||{})[_0xfd8d('0xc0')](function(){return db['Tag'][_0xfd8d('0xc1')]({'attributes':['id',_0xfd8d('0x26'),_0xfd8d('0xc2')],'where':{'id':_0x33e46f['body'][_0xfd8d('0xb7')]}});})['then'](function(_0x4267c2){socket[_0xfd8d('0xc3')](_0xfd8d('0xc4'),{'id':Number(_0x33e46f[_0xfd8d('0xb0')]['id']),'tags':_0x4267c2||[]});return{'id':Number(_0x33e46f['params']['id']),'tags':_0x4267c2||[]};});}})[_0xfd8d('0x8c')](respondWithResult(_0x58f2fe,null))[_0xfd8d('0x2f')](handleError(_0x58f2fe,null));};exports[_0xfd8d('0xc5')]=function(_0x2f8282,_0x10dd7e,_0x27a3b6){return db[_0xfd8d('0x38')]['find']({'where':{'id':_0x2f8282[_0xfd8d('0xb0')]['id']}})[_0xfd8d('0x8c')](handleEntityNotFound(_0x10dd7e,null))[_0xfd8d('0x8c')](function(_0x4a991d){if(_0x4a991d){return _0x4a991d[_0xfd8d('0xc5')](_0x2f8282['query']['ids']);}})[_0xfd8d('0x8c')](respondWithStatusCode(_0x10dd7e,null))['catch'](handleError(_0x10dd7e,null));};exports[_0xfd8d('0xc6')]=function(_0x4fdf04,_0x5046f7){var _0x120604=moment()[_0xfd8d('0xc7')]()['toString']();var _0x34b396=path[_0xfd8d('0xc8')](config[_0xfd8d('0xc9')],_0xfd8d('0xca'),_0xfd8d('0xcb'),'tmp');var _0x91545a=path[_0xfd8d('0xc8')](config[_0xfd8d('0xc9')],_0xfd8d('0xca'),_0xfd8d('0xcb'),_0xfd8d('0xcc'));var _0x262166=path[_0xfd8d('0xc8')](_0x34b396,_0x120604);var _0x15f658=util[_0xfd8d('0xbc')]('transcript-%d-%s.zip',_0x4fdf04[_0xfd8d('0xb0')]['id'],_0x120604);var _0x270e4a=path[_0xfd8d('0xc8')](_0x34b396,_0x15f658);var _0x2c5342=[];_0x2c5342[_0xfd8d('0x2e')]({'model':db[_0xfd8d('0x6f')],'as':_0xfd8d('0x6f'),'attributes':['id','fullname'],'raw':!![]});_0x2c5342[_0xfd8d('0x2e')]({'model':db[_0xfd8d('0xcd')],'as':_0xfd8d('0xce'),'attributes':['id','firstName',_0xfd8d('0xcf')],'raw':!![]});var _0x2a4bd0=[{'model':db[_0xfd8d('0xbe')],'as':_0xfd8d('0xd0'),'attributes':['id',_0xfd8d('0x71'),_0xfd8d('0x76'),_0xfd8d('0xd1'),'secret',_0xfd8d('0x7a')],'include':_0x2c5342}];_0x2a4bd0[_0xfd8d('0x2e')]({'model':db[_0xfd8d('0xd2')],'as':_0xfd8d('0xd3'),'attributes':['id',_0xfd8d('0x26')]});_0x2a4bd0[_0xfd8d('0x2e')]({'model':db[_0xfd8d('0x6f')],'as':_0xfd8d('0xd4'),'attributes':['id',_0xfd8d('0x29')]});return db[_0xfd8d('0x38')][_0xfd8d('0x60')]({'where':{'id':_0x4fdf04['params']['id']},'include':_0x2a4bd0})[_0xfd8d('0x8c')](handleEntityNotFound(_0x5046f7,null))['then'](function(_0x5616b0){if(_0x5616b0){var _0x27500a=_0x5616b0[_0xfd8d('0xd5')]({'plain':!![]});fs[_0xfd8d('0xd6')](_0x262166);var _0x4dab1c={'channel':_0xfd8d('0xd7'),'account':_0x27500a['Account'][_0xfd8d('0x26')],'agent':_0x27500a[_0xfd8d('0xd4')]?_0x27500a[_0xfd8d('0xd4')]['fullname']:'N.A.','createdAt':moment(_0x27500a[_0xfd8d('0x76')])[_0xfd8d('0xbc')](_0xfd8d('0xbd'))['toString'](),'closedAt':_0x27500a[_0xfd8d('0x34')]?moment(_0x27500a[_0xfd8d('0xd8')])['format'](_0xfd8d('0xbd'))[_0xfd8d('0x94')]():'','disposition':_0x27500a['disposition'],'messages':_(_0x27500a[_0xfd8d('0xd0')])[_0xfd8d('0x7e')]({'secret':![]})[_0xfd8d('0x37')](function(_0xfbea96){return{'date':moment(_0xfbea96[_0xfd8d('0x76')])['format'](_0xfd8d('0xbd'))[_0xfd8d('0x94')](),'sender':_0xfbea96[_0xfd8d('0xd1')]===_0xfd8d('0xd9')?_0xfbea96[_0xfd8d('0x6f')]?_0xfbea96[_0xfd8d('0x6f')][_0xfd8d('0x29')]:_0xfd8d('0xda'):_0xfbea96[_0xfd8d('0xce')][_0xfd8d('0xdb')]+(_0xfbea96[_0xfd8d('0xce')][_0xfd8d('0xcf')]?'\x20'+_0xfbea96['Contact'][_0xfd8d('0xcf')]:''),'body':_0xfbea96[_0xfd8d('0x71')],'direction':_0xfbea96[_0xfd8d('0xd1')]===_0xfd8d('0xd9')?'A':'C','secret':_0xfbea96[_0xfd8d('0xdc')],'read':_0xfbea96[_0xfd8d('0x7a')]};})['value']()};return ejs['renderFile'](path['join'](config['root'],_0xfd8d('0xca'),_0xfd8d('0xdd'),_0xfd8d('0xde')),{'interaction':_0x4dab1c})['then'](function(_0x13fd82){var _0x9b4138=path[_0xfd8d('0xc8')](_0x262166,_0xfd8d('0xdf')+_0x27500a['id']+'-'+_0x120604+'.pdf');var _0x146fc4={'path':_0x9b4138,'channel':_0xfd8d('0xd7'),'interactionId':_0x27500a['id']};return pdf[_0xfd8d('0xe0')](_0x13fd82,_0x146fc4);})[_0xfd8d('0x8c')](function(){return new BPromise(function(_0x126197,_0x37dc84){zipdir(_0x262166,{'saveTo':_0x270e4a},function(_0x1e799a,_0x2f82a3){if(_0x1e799a)return _0x37dc84(_0x1e799a);return _0x126197(_0x2f82a3);});})[_0xfd8d('0x8c')](function(){return new BPromise(function(_0x296e88,_0x2fc80a){rimraf(_0x262166,function(_0x428f1f){if(_0x428f1f)_0x2fc80a(_0x428f1f);return _0x296e88();});});})[_0xfd8d('0x8c')](function(){return _0x5046f7[_0xfd8d('0xc6')](_0x270e4a,_0x15f658,function(_0x59c9e9){if(_0x59c9e9){console['log'](_0xfd8d('0xe1'),_0x59c9e9);}else{fs[_0xfd8d('0xe2')](_0x270e4a);}});});});}else{return _0x5046f7[_0xfd8d('0xe3')](0xc8);}})[_0xfd8d('0x2f')](handleError(_0x5046f7,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index dd2501b..d195742 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 _0x57ca=['remove','getUsers','then','setDataValue','Users','unreadMessages','emit','hasOwnProperty','exports','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update'];(function(_0x5bfb78,_0x22e3ff){var _0x4efd00=function(_0x5c9496){while(--_0x5c9496){_0x5bfb78['push'](_0x5bfb78['shift']());}};_0x4efd00(++_0x22e3ff);}(_0x57ca,0x108));var _0xa57c=function(_0x51f764,_0x4c5c26){_0x51f764=_0x51f764-0x0;var _0x40eee9=_0x57ca[_0x51f764];return _0x40eee9;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0xa57c('0x0'))['db'][_0xa57c('0x1')];var SmsMessage=require('../../mysqldb')['db'][_0xa57c('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xa57c('0x3')](0x0);var events={'afterCreate':_0xa57c('0x4'),'afterUpdate':_0xa57c('0x5'),'afterDestroy':_0xa57c('0x6')};function emitEvent(_0x48be2d){return function(_0x40ba22,_0x1c3e31,_0x113dcf){_0x40ba22[_0xa57c('0x7')]({'attributes':['id'],'raw':!![]})[_0xa57c('0x8')](function(_0x314574){_0x40ba22[_0xa57c('0x9')](_0xa57c('0xa'),_0x314574['map'](function(_0x13dad8){return{'id':_0x13dad8['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x40ba22['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa57c('0x8')](function(_0x932dcc){_0x40ba22['setDataValue'](_0xa57c('0xb'),_0x932dcc['length']);SmsInteractionEvents[_0xa57c('0xc')](_0x48be2d+':'+_0x40ba22['id'],_0x40ba22);SmsInteractionEvents[_0xa57c('0xc')](_0x48be2d,_0x40ba22);_0x113dcf(null);})['catch'](_0x113dcf(null));};}for(var e in events){if(events[_0xa57c('0xd')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0xa57c('0xe')]=SmsInteractionEvents; \ No newline at end of file +var _0x583c=['../../mysqldb','SmsInteraction','setMaxListeners','save','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','emit','hasOwnProperty','hook','events'];(function(_0x17dd52,_0x532e39){var _0x47fbb4=function(_0x184d24){while(--_0x184d24){_0x17dd52['push'](_0x17dd52['shift']());}};_0x47fbb4(++_0x532e39);}(_0x583c,0x12b));var _0xc583=function(_0x270adf,_0x1daaa3){_0x270adf=_0x270adf-0x0;var _0x29eda9=_0x583c[_0x270adf];return _0x29eda9;};'use strict';var EventEmitter=require(_0xc583('0x0'));var SmsInteraction=require(_0xc583('0x1'))['db'][_0xc583('0x2')];var SmsMessage=require(_0xc583('0x1'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xc583('0x3')](0x0);var events={'afterCreate':_0xc583('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x13b8a7){return function(_0xf03852,_0x5b7292,_0xd3a750){_0xf03852[_0xc583('0x5')]({'attributes':['id'],'raw':!![]})[_0xc583('0x6')](function(_0x1dd37c){_0xf03852['setDataValue'](_0xc583('0x7'),_0x1dd37c[_0xc583('0x8')](function(_0x5b456e){return{'id':_0x5b456e['id']};}));return SmsMessage[_0xc583('0x9')]({'where':{'SmsInteractionId':_0xf03852['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc583('0x6')](function(_0x25f8d3){_0xf03852[_0xc583('0xa')](_0xc583('0xb'),_0x25f8d3['length']);SmsInteractionEvents[_0xc583('0xc')](_0x13b8a7+':'+_0xf03852['id'],_0xf03852);SmsInteractionEvents[_0xc583('0xc')](_0x13b8a7,_0xf03852);_0xd3a750(null);})['catch'](_0xd3a750(null));};}for(var e in events){if(events[_0xc583('0xd')](e)){var event=events[e];SmsInteraction[_0xc583('0xe')](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 fd18c94..265b8f7 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 _0x9b23=['format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','moment','request-promise','path','rimraf','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','changed','closed','closedAt'];(function(_0x4715c5,_0x5494e3){var _0x4755f0=function(_0x2a6065){while(--_0x2a6065){_0x4715c5['push'](_0x4715c5['shift']());}};_0x4755f0(++_0x5494e3);}(_0x9b23,0x1e2));var _0x39b2=function(_0x183c8b,_0xb6275c){_0x183c8b=_0x183c8b-0x0;var _0x138039=_0x9b23[_0x183c8b];return _0x138039;};'use strict';var _=require(_0x39b2('0x0'));var util=require(_0x39b2('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x39b2('0x2'));var BPromise=require('bluebird');var rp=require(_0x39b2('0x3'));var fs=require('fs');var path=require(_0x39b2('0x4'));var rimraf=require(_0x39b2('0x5'));var config=require('../../config/environment');var attributes=require(_0x39b2('0x6'));module[_0x39b2('0x7')]=function(_0x26a898,_0x1cffce){return _0x26a898[_0x39b2('0x8')](_0x39b2('0x9'),attributes,{'tableName':_0x39b2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x509bf8,_0x53e614,_0x41e8eb){if(_0x509bf8[_0x39b2('0xb')](_0x39b2('0xc'))){_0x509bf8[_0x39b2('0xd')]=moment()[_0x39b2('0xe')](_0x39b2('0xf'));}_0x41e8eb(null,_0x509bf8);}}});}; \ No newline at end of file +var _0x4aba=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','changed','closed'];(function(_0x403138,_0x37e366){var _0x9ed73a=function(_0x30f89e){while(--_0x30f89e){_0x403138['push'](_0x403138['shift']());}};_0x9ed73a(++_0x37e366);}(_0x4aba,0x173));var _0xa4ab=function(_0x21a387,_0x2cda9e){_0x21a387=_0x21a387-0x0;var _0x19806a=_0x4aba[_0x21a387];return _0x19806a;};'use strict';var _=require(_0xa4ab('0x0'));var util=require('util');var logger=require(_0xa4ab('0x1'))(_0xa4ab('0x2'));var moment=require('moment');var BPromise=require(_0xa4ab('0x3'));var rp=require(_0xa4ab('0x4'));var fs=require('fs');var path=require(_0xa4ab('0x5'));var rimraf=require('rimraf');var config=require(_0xa4ab('0x6'));var attributes=require(_0xa4ab('0x7'));module[_0xa4ab('0x8')]=function(_0x2d0dd0,_0x25a9ee){return _0x2d0dd0[_0xa4ab('0x9')](_0xa4ab('0xa'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x7aaf3,_0x157756,_0x5dd0de){if(_0x7aaf3[_0xa4ab('0xb')](_0xa4ab('0xc'))){_0x7aaf3[_0xa4ab('0xd')]=moment()[_0xa4ab('0xe')](_0xa4ab('0xf'));}_0x5dd0de(null,_0x7aaf3);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index b159f95..564129c 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 _0x21e4=['ioredis','../../mysqldb','../../config/logger','rpc','http','redis','defaults','socket.io-emitter','./smsInteraction.socket','request','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','SmsInteraction,\x20%s,\x20%s,\x20%s','error','code','message','catch','body','options','where','attributes','limit','then','UpdateSmsInteraction','debug','stringify','AddTagsToSmsInteraction','SmsInteraction','find','ids','spread','AddTags','lodash','moment','bluebird'];(function(_0x827916,_0x44fdef){var _0xfdcb3d=function(_0x359d83){while(--_0x359d83){_0x827916['push'](_0x827916['shift']());}};_0xfdcb3d(++_0x44fdef);}(_0x21e4,0x189));var _0x421e=function(_0x49f25c,_0x1d902f){_0x49f25c=_0x49f25c-0x0;var _0x206221=_0x21e4[_0x49f25c];return _0x206221;};'use strict';var _=require(_0x421e('0x0'));var util=require('util');var moment=require(_0x421e('0x1'));var BPromise=require(_0x421e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x421e('0x3'));var db=require(_0x421e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x421e('0x5'))(_0x421e('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x421e('0x7')]({'port':0x232a});config[_0x421e('0x8')]=_[_0x421e('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x421e('0xa'))(new Redis(config[_0x421e('0x8')]));require(_0x421e('0xb'))['register'](socket);function respondWithRpcPromise(_0x938d52,_0x251008,_0x268fd7){return new BPromise(function(_0x3b0364,_0x31fc8a){return client[_0x421e('0xc')](_0x938d52,_0x268fd7)['then'](function(_0x2b48cb){logger[_0x421e('0xd')](_0x421e('0xe'),_0x251008,_0x421e('0xf'));logger['debug'](_0x421e('0x10'),_0x251008,'request\x20sent',JSON['stringify'](_0x2b48cb));if(_0x2b48cb[_0x421e('0x11')]){if(_0x2b48cb[_0x421e('0x11')][_0x421e('0x12')]===0x1f4){logger[_0x421e('0x11')](_0x421e('0xe'),_0x251008,_0x2b48cb[_0x421e('0x11')]['message']);return _0x31fc8a(_0x2b48cb[_0x421e('0x11')][_0x421e('0x13')]);}logger[_0x421e('0x11')](_0x421e('0xe'),_0x251008,_0x2b48cb['error'][_0x421e('0x13')]);return _0x3b0364(_0x2b48cb[_0x421e('0x11')][_0x421e('0x13')]);}else{logger['info'](_0x421e('0xe'),_0x251008,_0x421e('0xf'));_0x3b0364(_0x2b48cb['result']['message']);}})[_0x421e('0x14')](function(_0x5d56b2){logger[_0x421e('0x11')](_0x421e('0xe'),_0x251008,_0x5d56b2);_0x31fc8a(_0x5d56b2);});});}exports['UpdateSmsInteraction']=function(_0x129746){var _0x8a8c1a=this;return new Promise(function(_0x4d5f67,_0x2752f1){return db['SmsInteraction']['update'](_0x129746[_0x421e('0x15')],{'raw':_0x129746['options']?_0x129746[_0x421e('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x129746[_0x421e('0x16')]?_0x129746['options'][_0x421e('0x17')]||null:null,'attributes':_0x129746[_0x421e('0x16')]?_0x129746[_0x421e('0x16')][_0x421e('0x18')]||null:null,'limit':_0x129746[_0x421e('0x16')]?_0x129746[_0x421e('0x16')][_0x421e('0x19')]||null:null})[_0x421e('0x1a')](function(_0x3da9ef){logger[_0x421e('0xd')](_0x421e('0x1b'),_0x129746);logger[_0x421e('0x1c')](_0x421e('0x1b'),_0x129746,JSON[_0x421e('0x1d')](_0x3da9ef));_0x4d5f67(_0x3da9ef);})[_0x421e('0x14')](function(_0x591b4f){logger[_0x421e('0x11')]('UpdateSmsInteraction',_0x591b4f[_0x421e('0x13')],_0x129746);_0x2752f1(_0x8a8c1a['error'](0x1f4,_0x591b4f['message']));});});};exports[_0x421e('0x1e')]=function(_0xdb7d15){return new Promise(function(_0x40e47a,_0x4a389c){return db[_0x421e('0x1f')][_0x421e('0x20')]({'where':_0xdb7d15[_0x421e('0x16')]?_0xdb7d15[_0x421e('0x16')][_0x421e('0x17')]||null:null})['then'](function(_0x3304eb){if(_0x3304eb){return _0x3304eb['addTags'](_0xdb7d15[_0x421e('0x15')][_0x421e('0x21')],_['omit'](_0xdb7d15[_0x421e('0x15')],[_0x421e('0x21'),'id'])||{});}})[_0x421e('0x22')](function(_0x524493){logger['info'](_0x421e('0x23'),_0xdb7d15);logger['debug'](_0x421e('0x23'),_0xdb7d15,JSON['stringify'](_0x524493));_0x40e47a(_0x524493);})['catch'](function(_0x37418c){logger[_0x421e('0x11')](_0x421e('0x23'),_0x37418c[_0x421e('0x13')],_0xdb7d15);_0x4a389c(_this[_0x421e('0x11')](0x1f4,_0x37418c[_0x421e('0x13')]));});});}; \ No newline at end of file +var _0x3819=['body','options','raw','where','attributes','limit','then','stringify','catch','AddTagsToSmsInteraction','find','addTags','omit','ids','spread','AddTags','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','SmsInteraction,\x20%s,\x20%s,\x20%s','error','message','result','UpdateSmsInteraction','SmsInteraction','update'];(function(_0x3b0918,_0xbcb095){var _0x1a9c27=function(_0x25d71d){while(--_0x25d71d){_0x3b0918['push'](_0x3b0918['shift']());}};_0x1a9c27(++_0xbcb095);}(_0x3819,0xf2));var _0x9381=function(_0x51cc83,_0x3123bc){_0x51cc83=_0x51cc83-0x0;var _0x44691d=_0x3819[_0x51cc83];return _0x44691d;};'use strict';var _=require(_0x9381('0x0'));var util=require(_0x9381('0x1'));var moment=require(_0x9381('0x2'));var BPromise=require(_0x9381('0x3'));var rs=require(_0x9381('0x4'));var fs=require('fs');var Redis=require(_0x9381('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9381('0x6'));var logger=require(_0x9381('0x7'))(_0x9381('0x8'));var config=require('../../config/environment');var jayson=require(_0x9381('0x9'));var client=jayson[_0x9381('0xa')][_0x9381('0xb')]({'port':0x232a});config[_0x9381('0xc')]=_[_0x9381('0xd')](config[_0x9381('0xc')],{'host':_0x9381('0xe'),'port':0x18eb});var socket=require(_0x9381('0xf'))(new Redis(config[_0x9381('0xc')]));require('./smsInteraction.socket')[_0x9381('0x10')](socket);function respondWithRpcPromise(_0x55ee1e,_0xbc053b,_0x3746d5){return new BPromise(function(_0x2f9610,_0x1f4a00){return client[_0x9381('0x11')](_0x55ee1e,_0x3746d5)['then'](function(_0x525f95){logger[_0x9381('0x12')](_0x9381('0x13'),_0xbc053b,_0x9381('0x14'));logger['debug'](_0x9381('0x15'),_0xbc053b,_0x9381('0x14'),JSON['stringify'](_0x525f95));if(_0x525f95['error']){if(_0x525f95[_0x9381('0x16')]['code']===0x1f4){logger[_0x9381('0x16')](_0x9381('0x13'),_0xbc053b,_0x525f95[_0x9381('0x16')][_0x9381('0x17')]);return _0x1f4a00(_0x525f95[_0x9381('0x16')][_0x9381('0x17')]);}logger['error'](_0x9381('0x13'),_0xbc053b,_0x525f95[_0x9381('0x16')][_0x9381('0x17')]);return _0x2f9610(_0x525f95['error'][_0x9381('0x17')]);}else{logger[_0x9381('0x12')](_0x9381('0x13'),_0xbc053b,_0x9381('0x14'));_0x2f9610(_0x525f95[_0x9381('0x18')]['message']);}})['catch'](function(_0x107a7c){logger[_0x9381('0x16')](_0x9381('0x13'),_0xbc053b,_0x107a7c);_0x1f4a00(_0x107a7c);});});}exports[_0x9381('0x19')]=function(_0x14521e){var _0x1c1e69=this;return new Promise(function(_0x11894f,_0x190734){return db[_0x9381('0x1a')][_0x9381('0x1b')](_0x14521e[_0x9381('0x1c')],{'raw':_0x14521e['options']?_0x14521e[_0x9381('0x1d')][_0x9381('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14521e[_0x9381('0x1d')]?_0x14521e[_0x9381('0x1d')][_0x9381('0x1f')]||null:null,'attributes':_0x14521e[_0x9381('0x1d')]?_0x14521e[_0x9381('0x1d')][_0x9381('0x20')]||null:null,'limit':_0x14521e[_0x9381('0x1d')]?_0x14521e[_0x9381('0x1d')][_0x9381('0x21')]||null:null})[_0x9381('0x22')](function(_0x32a091){logger[_0x9381('0x12')](_0x9381('0x19'),_0x14521e);logger['debug'](_0x9381('0x19'),_0x14521e,JSON[_0x9381('0x23')](_0x32a091));_0x11894f(_0x32a091);})[_0x9381('0x24')](function(_0x361988){logger[_0x9381('0x16')](_0x9381('0x19'),_0x361988['message'],_0x14521e);_0x190734(_0x1c1e69['error'](0x1f4,_0x361988[_0x9381('0x17')]));});});};exports[_0x9381('0x25')]=function(_0x576c3d){return new Promise(function(_0x4a0a52,_0x3330a7){return db[_0x9381('0x1a')][_0x9381('0x26')]({'where':_0x576c3d[_0x9381('0x1d')]?_0x576c3d[_0x9381('0x1d')][_0x9381('0x1f')]||null:null})[_0x9381('0x22')](function(_0x4d34d4){if(_0x4d34d4){return _0x4d34d4[_0x9381('0x27')](_0x576c3d[_0x9381('0x1c')]['ids'],_[_0x9381('0x28')](_0x576c3d[_0x9381('0x1c')],[_0x9381('0x29'),'id'])||{});}})[_0x9381('0x2a')](function(_0x267882){logger[_0x9381('0x12')](_0x9381('0x2b'),_0x576c3d);logger[_0x9381('0x2c')](_0x9381('0x2b'),_0x576c3d,JSON[_0x9381('0x23')](_0x267882));_0x4a0a52(_0x267882);})['catch'](function(_0x2261f9){logger[_0x9381('0x16')](_0x9381('0x2b'),_0x2261f9[_0x9381('0x17')],_0x576c3d);_0x3330a7(_this[_0x9381('0x16')](0x1f4,_0x2261f9[_0x9381('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 8008267..da13707 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 _0xc7ca=['register','length','smsInteraction:','./smsInteraction.events','remove','update','emit'];(function(_0x44e0a9,_0x59eee7){var _0x4ceee4=function(_0x2947d4){while(--_0x2947d4){_0x44e0a9['push'](_0x44e0a9['shift']());}};_0x4ceee4(++_0x59eee7);}(_0xc7ca,0x13e));var _0xac7c=function(_0x251a53,_0x1bce50){_0x251a53=_0x251a53-0x0;var _0x47a5d8=_0xc7ca[_0x251a53];return _0x47a5d8;};'use strict';var SmsInteractionEvents=require(_0xac7c('0x0'));var events=['save',_0xac7c('0x1'),_0xac7c('0x2')];function createListener(_0x13d317,_0x304781){return function(_0x299c2a){_0x304781[_0xac7c('0x3')](_0x13d317,_0x299c2a);};}function removeListener(_0x2f659b,_0x4f7563){return function(){SmsInteractionEvents['removeListener'](_0x2f659b,_0x4f7563);};}exports[_0xac7c('0x4')]=function(_0x6c584f){for(var _0x26af55=0x0,_0x4bb2ec=events[_0xac7c('0x5')];_0x26af55<_0x4bb2ec;_0x26af55++){var _0x175fb7=events[_0x26af55];var _0x3fd7c9=createListener(_0xac7c('0x6')+_0x175fb7,_0x6c584f);SmsInteractionEvents['on'](_0x175fb7,_0x3fd7c9);}}; \ No newline at end of file +var _0x61be=['smsInteraction:','./smsInteraction.events','remove','update','removeListener','register','length'];(function(_0x318155,_0x56e72e){var _0x352470=function(_0x253313){while(--_0x253313){_0x318155['push'](_0x318155['shift']());}};_0x352470(++_0x56e72e);}(_0x61be,0x190));var _0xe61b=function(_0x303986,_0x5c751c){_0x303986=_0x303986-0x0;var _0x4c4431=_0x61be[_0x303986];return _0x4c4431;};'use strict';var SmsInteractionEvents=require(_0xe61b('0x0'));var events=['save',_0xe61b('0x1'),_0xe61b('0x2')];function createListener(_0x1275c7,_0x6f6ff5){return function(_0x492298){_0x6f6ff5['emit'](_0x1275c7,_0x492298);};}function removeListener(_0x4e30fd,_0x3c0756){return function(){SmsInteractionEvents[_0xe61b('0x3')](_0x4e30fd,_0x3c0756);};}exports[_0xe61b('0x4')]=function(_0x32fc9c){for(var _0x3ed1a5=0x0,_0x1074fd=events[_0xe61b('0x5')];_0x3ed1a5<_0x1074fd;_0x3ed1a5++){var _0x57debb=events[_0x3ed1a5];var _0x3c662b=createListener(_0xe61b('0x6')+_0x57debb,_0x32fc9c);SmsInteractionEvents['on'](_0x57debb,_0x3c662b);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 45b53e2..d155d1f 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 _0x47f5=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','describe','/:id','show','post','tracked','sms','smsmessage:create','create','status','put','/:id/accept','accept','/:id/reject','reject','multer','util','path','express'];(function(_0xd5f773,_0x25c1f8){var _0x4ffeae=function(_0xa46b5e){while(--_0xa46b5e){_0xd5f773['push'](_0xd5f773['shift']());}};_0x4ffeae(++_0x25c1f8);}(_0x47f5,0x1be));var _0x547f=function(_0x4cf8d4,_0x5aee73){_0x4cf8d4=_0x4cf8d4-0x0;var _0x2c1beb=_0x47f5[_0x4cf8d4];return _0x2c1beb;};'use strict';var multer=require(_0x547f('0x0'));var util=require(_0x547f('0x1'));var path=require(_0x547f('0x2'));var timeout=require('connect-timeout');var express=require(_0x547f('0x3'));var router=express[_0x547f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x547f('0x5'));var interaction=require(_0x547f('0x6'));var config=require(_0x547f('0x7'));var controller=require(_0x547f('0x8'));router[_0x547f('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x547f('0x9')]('/describe',auth[_0x547f('0xa')](),controller[_0x547f('0xb')]);router['get'](_0x547f('0xc'),auth[_0x547f('0xa')](),controller[_0x547f('0xd')]);router[_0x547f('0xe')]('/',auth[_0x547f('0xa')](),interaction[_0x547f('0xf')](_0x547f('0x10'),_0x547f('0x11')),controller[_0x547f('0x12')]);router['post']('/:id/status',controller[_0x547f('0x13')]);router[_0x547f('0x14')](_0x547f('0xc'),auth[_0x547f('0xa')](),controller['update']);router[_0x547f('0x14')](_0x547f('0x15'),auth[_0x547f('0xa')](),controller[_0x547f('0x16')]);router[_0x547f('0x14')](_0x547f('0x17'),auth['isAuthenticated'](),controller[_0x547f('0x18')]);router['delete'](_0x547f('0xc'),auth[_0x547f('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xd6ab=['/:id/reject','reject','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','show','post','tracked','sms','smsmessage:create','put','/:id','update','/:id/accept','accept'];(function(_0x9ad37c,_0x27f705){var _0x461b47=function(_0xcfe774){while(--_0xcfe774){_0x9ad37c['push'](_0x9ad37c['shift']());}};_0x461b47(++_0x27f705);}(_0xd6ab,0x124));var _0xbd6a=function(_0x51fe15,_0x138833){_0x51fe15=_0x51fe15-0x0;var _0x103d3f=_0xd6ab[_0x51fe15];return _0x103d3f;};'use strict';var multer=require(_0xbd6a('0x0'));var util=require(_0xbd6a('0x1'));var path=require(_0xbd6a('0x2'));var timeout=require(_0xbd6a('0x3'));var express=require(_0xbd6a('0x4'));var router=express[_0xbd6a('0x5')]();var fs_extra=require(_0xbd6a('0x6'));var auth=require(_0xbd6a('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./smsMessage.controller');router[_0xbd6a('0x8')]('/',auth[_0xbd6a('0x9')](),controller['index']);router[_0xbd6a('0x8')]('/describe',auth[_0xbd6a('0x9')](),controller['describe']);router[_0xbd6a('0x8')]('/:id',auth[_0xbd6a('0x9')](),controller[_0xbd6a('0xa')]);router[_0xbd6a('0xb')]('/',auth[_0xbd6a('0x9')](),interaction[_0xbd6a('0xc')](_0xbd6a('0xd'),_0xbd6a('0xe')),controller['create']);router[_0xbd6a('0xb')]('/:id/status',controller['status']);router[_0xbd6a('0xf')](_0xbd6a('0x10'),auth[_0xbd6a('0x9')](),controller[_0xbd6a('0x11')]);router[_0xbd6a('0xf')](_0xbd6a('0x12'),auth['isAuthenticated'](),controller[_0xbd6a('0x13')]);router[_0xbd6a('0xf')](_0xbd6a('0x14'),auth[_0xbd6a('0x9')](),controller[_0xbd6a('0x15')]);router['delete']('/:id',auth[_0xbd6a('0x9')](),controller[_0xbd6a('0x16')]);module[_0xbd6a('0x17')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 655961c..11cc95c 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 _0x34d8=['exports','TEXT','out','STRING','DATE','sequelize'];(function(_0x39cc51,_0x332d8a){var _0x24247f=function(_0x5cc18d){while(--_0x5cc18d){_0x39cc51['push'](_0x39cc51['shift']());}};_0x24247f(++_0x332d8a);}(_0x34d8,0x167));var _0x834d=function(_0x39ae72,_0x48ff7b){_0x39ae72=_0x39ae72-0x0;var _0x3fc9c2=_0x34d8[_0x39ae72];return _0x3fc9c2;};'use strict';var Sequelize=require(_0x834d('0x0'));module[_0x834d('0x1')]={'body':{'type':Sequelize[_0x834d('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x834d('0x3')),'defaultValue':_0x834d('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0x834d('0x4')](0xbe)},'phone':{'type':Sequelize[_0x834d('0x4')]},'readAt':{'type':Sequelize[_0x834d('0x5')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x834d('0x4')]},'providerResponse':{'type':Sequelize[_0x834d('0x2')]}}; \ No newline at end of file +var _0xed41=['out','STRING','DATE','BOOLEAN','TEXT','sequelize','exports','medium','ENUM'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0xed41,0x19a));var _0x1ed4=function(_0x102320,_0x3c6ec1){_0x102320=_0x102320-0x0;var _0x16c398=_0xed41[_0x102320];return _0x16c398;};'use strict';var Sequelize=require(_0x1ed4('0x0'));module[_0x1ed4('0x1')]={'body':{'type':Sequelize['TEXT'](_0x1ed4('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x1ed4('0x3')]('in',_0x1ed4('0x4')),'defaultValue':_0x1ed4('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x1ed4('0x5')](0xbe)},'phone':{'type':Sequelize[_0x1ed4('0x5')]},'readAt':{'type':Sequelize[_0x1ed4('0x6')]},'secret':{'type':Sequelize[_0x1ed4('0x7')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x1ed4('0x5')]},'providerResponse':{'type':Sequelize[_0x1ed4('0x8')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 504320e..044476d 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 _0xd781=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','stack','name','send','index','map','SmsMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','filter','options','findAll','rows','show','params','include','body','find','describe','sms-interactions','accept','sms','read','readAt','format','UserId','agent','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','interface','SIP/%s','channel','motionChannel','event','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','RejectMessage','rejectMessage','ContactId','internal','EventManager','rejectmessage','SmsAccount','SmsAccountId','inspect','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','plivo','indexOf','sent','Status','plivio','results','groupName','infobip','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x4c5277,_0x12737d){var _0x583792=function(_0x355148){while(--_0x355148){_0x4c5277['push'](_0x4c5277['shift']());}};_0x583792(++_0x12737d);}(_0xd781,0x1bb));var _0x1d78=function(_0x2a8351,_0x44bc70){_0x2a8351=_0x2a8351-0x0;var _0xfce7fb=_0xd781[_0x2a8351];return _0xfce7fb;};'use strict';var emlformat=require(_0x1d78('0x0'));var rimraf=require(_0x1d78('0x1'));var zipdir=require(_0x1d78('0x2'));var jsonpatch=require(_0x1d78('0x3'));var rp=require('request-promise');var moment=require(_0x1d78('0x4'));var BPromise=require(_0x1d78('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1d78('0x6'));var sox=require(_0x1d78('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1d78('0x8'));var _=require(_0x1d78('0x9'));var squel=require(_0x1d78('0xa'));var crypto=require(_0x1d78('0xb'));var jsforce=require(_0x1d78('0xc'));var deskjs=require(_0x1d78('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1d78('0xe'));var Redis=require(_0x1d78('0xf'));var authService=require(_0x1d78('0x10'));var qs=require(_0x1d78('0x11'));var as=require(_0x1d78('0x12'));var hardwareService=require(_0x1d78('0x13'));var logger=require(_0x1d78('0x14'))(_0x1d78('0x15'));var utils=require(_0x1d78('0x16'));var config=require(_0x1d78('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x1d78('0x18'))['db'];config[_0x1d78('0x19')]=_[_0x1d78('0x1a')](config[_0x1d78('0x19')],{'host':_0x1d78('0x1b'),'port':0x18eb});var socket=require(_0x1d78('0x1c'))(new Redis(config[_0x1d78('0x19')]));require(_0x1d78('0x1d'))[_0x1d78('0x1e')](socket);var jayson=require(_0x1d78('0x1f'));var client=jayson[_0x1d78('0x20')][_0x1d78('0x21')]({'port':0x232c});var client9002=jayson['client'][_0x1d78('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x814b87,_0x42f3ec,_0x180fc5,_0x1c2976){return new BPromise(function(_0xeb382e,_0x28b319){var _0x47e54d=_0x1c2976||client;return _0x47e54d[_0x1d78('0x22')](_0x814b87,_0x180fc5)[_0x1d78('0x23')](function(_0x28a79f){logger[_0x1d78('0x24')](_0x1d78('0x25'),_0x42f3ec,_0x1d78('0x26'));logger[_0x1d78('0x27')](_0x1d78('0x28'),_0x42f3ec,_0x1d78('0x26'),JSON[_0x1d78('0x29')](_0x28a79f));if(_0x28a79f[_0x1d78('0x2a')]){if(_0x28a79f['error']['code']===0x1f4){logger[_0x1d78('0x2a')](_0x1d78('0x25'),_0x42f3ec,_0x28a79f[_0x1d78('0x2a')][_0x1d78('0x2b')]);return _0x28b319(_0x28a79f[_0x1d78('0x2a')][_0x1d78('0x2b')]);}logger['error'](_0x1d78('0x25'),_0x42f3ec,_0x28a79f[_0x1d78('0x2a')][_0x1d78('0x2b')]);return _0xeb382e(_0x28a79f[_0x1d78('0x2a')]['message']);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x42f3ec,_0x1d78('0x26'));_0xeb382e(_0x28a79f[_0x1d78('0x2c')][_0x1d78('0x2b')]);}})[_0x1d78('0x2d')](function(_0x382722){logger[_0x1d78('0x2a')](_0x1d78('0x25'),_0x42f3ec,_0x382722);_0x28b319(_0x382722);});});}function respondWithStatusCode(_0x9e14f,_0x29cc83){_0x29cc83=_0x29cc83||0xcc;return function(_0x7d2e53){if(_0x7d2e53){return _0x9e14f[_0x1d78('0x2e')](_0x29cc83);}return _0x9e14f[_0x1d78('0x2f')](_0x29cc83)[_0x1d78('0x30')]();};}function respondWithResult(_0x3018ca,_0x216f88){_0x216f88=_0x216f88||0xc8;return function(_0x1c6558){if(_0x1c6558){return _0x3018ca[_0x1d78('0x2f')](_0x216f88)['json'](_0x1c6558);}};}function respondWithFilteredResult(_0x2400d2,_0x110935){return function(_0x3e44f5){if(_0x3e44f5){var _0x46f179=typeof _0x110935['offset']===_0x1d78('0x31')&&typeof _0x110935[_0x1d78('0x32')]==='undefined';var _0x163b1f=_0x3e44f5[_0x1d78('0x33')];var _0x46a042=_0x46f179?0x0:_0x110935[_0x1d78('0x34')];var _0x104217=_0x46f179?_0x3e44f5[_0x1d78('0x33')]:_0x110935['offset']+_0x110935[_0x1d78('0x32')];var _0x6cf938;if(_0x104217>=_0x163b1f){_0x104217=_0x163b1f;_0x6cf938=0xc8;}else{_0x6cf938=0xce;}_0x2400d2['status'](_0x6cf938);return _0x2400d2[_0x1d78('0x35')](_0x1d78('0x36'),_0x46a042+'-'+_0x104217+'/'+_0x163b1f)[_0x1d78('0x37')](_0x3e44f5);}return null;};}function patchUpdates(_0x3bea8b){return function(_0x53cf5d){try{jsonpatch[_0x1d78('0x38')](_0x53cf5d,_0x3bea8b,!![]);}catch(_0x470e16){return BPromise[_0x1d78('0x39')](_0x470e16);}return _0x53cf5d[_0x1d78('0x3a')]();};}function saveUpdates(_0x3a054c,_0x4dd436){return function(_0x550ffb){if(_0x550ffb){return _0x550ffb[_0x1d78('0x3b')](_0x3a054c)['then'](function(_0x1439c1){return _0x1439c1;});}return null;};}function removeEntity(_0x373b67,_0x5c325a){return function(_0x2eb407){if(_0x2eb407){return _0x2eb407[_0x1d78('0x3c')]()['then'](function(){_0x373b67[_0x1d78('0x2f')](0xcc)[_0x1d78('0x30')]();});}};}function handleEntityNotFound(_0x540769,_0x588b68){return function(_0x4172f5){if(!_0x4172f5){_0x540769['sendStatus'](0x194);}return _0x4172f5;};}function handleError(_0x5a42af,_0xde17ba){_0xde17ba=_0xde17ba||0x1f4;return function(_0x383c03){logger[_0x1d78('0x2a')](_0x383c03[_0x1d78('0x3d')]);if(_0x383c03[_0x1d78('0x3e')]){delete _0x383c03[_0x1d78('0x3e')];}_0x5a42af['status'](_0xde17ba)[_0x1d78('0x3f')](_0x383c03);};}exports[_0x1d78('0x40')]=function(_0xb6873e,_0x5dddb2){var _0x5be36b={},_0x382dd8={},_0x3bb56a={'count':0x0,'rows':[]};var _0x15aa4a=_[_0x1d78('0x41')](db[_0x1d78('0x42')][_0x1d78('0x43')],function(_0x25fa85){return{'name':_0x25fa85[_0x1d78('0x44')],'type':_0x25fa85[_0x1d78('0x45')][_0x1d78('0x46')]};});_0x382dd8[_0x1d78('0x47')]=_['map'](_0x15aa4a,'name');_0x382dd8[_0x1d78('0x48')]=_[_0x1d78('0x49')](_0xb6873e['query']);_0x382dd8[_0x1d78('0x4a')]=_['intersection'](_0x382dd8[_0x1d78('0x47')],_0x382dd8['query']);_0x5be36b[_0x1d78('0x4b')]=_[_0x1d78('0x4c')](_0x382dd8[_0x1d78('0x47')],qs[_0x1d78('0x4d')](_0xb6873e[_0x1d78('0x48')][_0x1d78('0x4d')]));_0x5be36b[_0x1d78('0x4b')]=_0x5be36b[_0x1d78('0x4b')][_0x1d78('0x4e')]?_0x5be36b['attributes']:_0x382dd8[_0x1d78('0x47')];if(!_0xb6873e[_0x1d78('0x48')][_0x1d78('0x4f')](_0x1d78('0x50'))){_0x5be36b[_0x1d78('0x32')]=qs[_0x1d78('0x32')](_0xb6873e[_0x1d78('0x48')][_0x1d78('0x32')]);_0x5be36b['offset']=qs[_0x1d78('0x34')](_0xb6873e[_0x1d78('0x48')][_0x1d78('0x34')]);}_0x5be36b[_0x1d78('0x51')]=qs[_0x1d78('0x52')](_0xb6873e['query']['sort']);_0x5be36b['where']=qs[_0x1d78('0x4a')](_[_0x1d78('0x53')](_0xb6873e[_0x1d78('0x48')],_0x382dd8[_0x1d78('0x4a')]),_0x15aa4a);if(_0xb6873e[_0x1d78('0x48')]['filter']){_0x5be36b[_0x1d78('0x54')]=_[_0x1d78('0x55')](_0x5be36b[_0x1d78('0x54')],{'$or':_[_0x1d78('0x41')](_0x15aa4a,function(_0x401ba7){if(_0x401ba7[_0x1d78('0x45')]!=='VIRTUAL'){var _0x3349fe={};_0x3349fe[_0x401ba7[_0x1d78('0x3e')]]={'$like':'%'+_0xb6873e[_0x1d78('0x48')][_0x1d78('0x56')]+'%'};return _0x3349fe;}})});}_0x5be36b=_[_0x1d78('0x55')]({},_0x5be36b,_0xb6873e[_0x1d78('0x57')]);var _0x14d705={'where':_0x5be36b[_0x1d78('0x54')]};return db[_0x1d78('0x42')][_0x1d78('0x33')](_0x14d705)[_0x1d78('0x23')](function(_0x13e4d2){_0x3bb56a[_0x1d78('0x33')]=_0x13e4d2;if(_0xb6873e[_0x1d78('0x48')]['includeAll']){_0x5be36b['include']=[{'all':!![]}];}return db[_0x1d78('0x42')][_0x1d78('0x58')](_0x5be36b);})[_0x1d78('0x23')](function(_0xbbef3b){_0x3bb56a[_0x1d78('0x59')]=_0xbbef3b;return _0x3bb56a;})[_0x1d78('0x23')](respondWithFilteredResult(_0x5dddb2,_0x5be36b))[_0x1d78('0x2d')](handleError(_0x5dddb2,null));};exports[_0x1d78('0x5a')]=function(_0x5bd085,_0xa66dd7){var _0x39df44={'raw':!![],'where':{'id':_0x5bd085[_0x1d78('0x5b')]['id']}},_0x3ef63d={};_0x3ef63d['model']=_[_0x1d78('0x49')](db[_0x1d78('0x42')][_0x1d78('0x43')]);_0x3ef63d[_0x1d78('0x48')]=_[_0x1d78('0x49')](_0x5bd085[_0x1d78('0x48')]);_0x3ef63d[_0x1d78('0x4a')]=_[_0x1d78('0x4c')](_0x3ef63d[_0x1d78('0x47')],_0x3ef63d['query']);_0x39df44[_0x1d78('0x4b')]=_[_0x1d78('0x4c')](_0x3ef63d['model'],qs[_0x1d78('0x4d')](_0x5bd085[_0x1d78('0x48')]['fields']));_0x39df44[_0x1d78('0x4b')]=_0x39df44[_0x1d78('0x4b')][_0x1d78('0x4e')]?_0x39df44[_0x1d78('0x4b')]:_0x3ef63d[_0x1d78('0x47')];if(_0x5bd085[_0x1d78('0x48')]['includeAll']){_0x39df44[_0x1d78('0x5c')]=[{'all':!![]}];}_0x39df44=_[_0x1d78('0x55')]({},_0x39df44,_0x5bd085['options']);return db['SmsMessage']['find'](_0x39df44)[_0x1d78('0x23')](handleEntityNotFound(_0xa66dd7,null))[_0x1d78('0x23')](respondWithResult(_0xa66dd7,null))[_0x1d78('0x2d')](handleError(_0xa66dd7,null));};exports['create']=function(_0x140655,_0x5c83b2){return db[_0x1d78('0x42')]['create'](_0x140655[_0x1d78('0x5d')],{})[_0x1d78('0x23')](respondWithResult(_0x5c83b2,0xc9))[_0x1d78('0x2d')](handleError(_0x5c83b2,null));};exports[_0x1d78('0x3b')]=function(_0x464ecd,_0x34fff4){if(_0x464ecd['body']['id']){delete _0x464ecd[_0x1d78('0x5d')]['id'];}return db[_0x1d78('0x42')][_0x1d78('0x5e')]({'where':{'id':_0x464ecd[_0x1d78('0x5b')]['id']}})[_0x1d78('0x23')](handleEntityNotFound(_0x34fff4,null))[_0x1d78('0x23')](saveUpdates(_0x464ecd['body'],null))[_0x1d78('0x23')](respondWithResult(_0x34fff4,null))[_0x1d78('0x2d')](handleError(_0x34fff4,null));};exports[_0x1d78('0x3c')]=function(_0x337e8d,_0x22e49c){return db[_0x1d78('0x42')][_0x1d78('0x5e')]({'where':{'id':_0x337e8d[_0x1d78('0x5b')]['id']}})[_0x1d78('0x23')](handleEntityNotFound(_0x22e49c,null))[_0x1d78('0x23')](removeEntity(_0x22e49c,null))[_0x1d78('0x2d')](handleError(_0x22e49c,null));};exports['describe']=function(_0x1f6113,_0x1ddf7e){return db['SmsMessage'][_0x1d78('0x5f')]()[_0x1d78('0x23')](respondWithResult(_0x1ddf7e,null))[_0x1d78('0x2d')](handleError(_0x1ddf7e,null));};var interaction_log=require('../../config/logger')(_0x1d78('0x60'));exports[_0x1d78('0x61')]=function(_0x54cbc0,_0x3630aa,_0x28bcf3){var _0x5caab1={'agent':{},'channel':_0x1d78('0x62')};if(_0x54cbc0[_0x1d78('0x5d')]['id']){delete _0x54cbc0[_0x1d78('0x5d')]['id'];}_0x54cbc0[_0x1d78('0x5d')][_0x1d78('0x63')]=!![];_0x54cbc0[_0x1d78('0x5d')][_0x1d78('0x64')]=moment()[_0x1d78('0x65')]('YYYY-MM-DD\x20HH:mm:ss');_0x54cbc0[_0x1d78('0x5d')][_0x1d78('0x66')]=_0x54cbc0[_0x1d78('0x5d')][_0x1d78('0x66')]||_0x54cbc0['user']['id'];_0x5caab1[_0x1d78('0x67')]['id']=_0x54cbc0[_0x1d78('0x5d')][_0x1d78('0x66')];return db[_0x1d78('0x42')][_0x1d78('0x5e')]({'where':{'id':_0x54cbc0[_0x1d78('0x5b')]['id'],'UserId':null}})[_0x1d78('0x23')](handleEntityNotFound(_0x3630aa,null))[_0x1d78('0x23')](saveUpdates(_0x54cbc0[_0x1d78('0x5d')],null))[_0x1d78('0x23')](function(_0x1f3993){if(_0x1f3993){_0x5caab1['message']=_0x1f3993[_0x1d78('0x68')]({'plain':!![]});return db[_0x1d78('0x69')][_0x1d78('0x5e')]({'where':{'id':_0x1f3993[_0x1d78('0x6a')]}});}return null;})[_0x1d78('0x23')](handleEntityNotFound(_0x3630aa,null))[_0x1d78('0x23')](function(_0x186504){if(_0x186504){return _0x186504[_0x1d78('0x3b')]({'UserId':_0x54cbc0[_0x1d78('0x5d')][_0x1d78('0x66')],'read1stAt':_[_0x1d78('0x6b')](_0x186504[_0x1d78('0x6c')])?moment()['format'](_0x1d78('0x6d')):undefined});}return null;})[_0x1d78('0x23')](function(_0x34114d){if(_0x34114d){_0x5caab1['interaction']=_0x34114d['get']({'plain':!![]});interaction_log[_0x1d78('0x24')](_0x1d78('0x6e'),_0x54cbc0[_0x1d78('0x6f')]['id'],_0x54cbc0['user'][_0x1d78('0x3e')],_0x54cbc0[_0x1d78('0x6f')][_0x1d78('0x70')],_0x5caab1['interaction']['id'],_0x54cbc0['body']?JSON[_0x1d78('0x29')](_0x54cbc0['body']):_0x1d78('0x71'));return respondWithRpcPromise(_0x1d78('0x72'),_0x1d78('0x73'),_0x5caab1);}return null;})[_0x1d78('0x23')](function(_0xaccffc){var _0x59510f=_0x1d78('0x74')+_0xaccffc['message']['ContactId'];return db[_0x1d78('0x75')][_0x1d78('0x48')](_0x59510f,{'type':db[_0x1d78('0x76')][_0x1d78('0x77')][_0x1d78('0x78')],'raw':!![]})[_0x1d78('0x23')](function(_0x4f6b79){return _0x4f6b79;});})[_0x1d78('0x23')](function(_0x3279f6){if(_0x3279f6){_0x5caab1['message'][_0x1d78('0x79')]=_0x3279f6[0x0];if(!_0x54cbc0[_0x1d78('0x5d')][_0x1d78('0x66')])return;return db[_0x1d78('0x7a')][_0x1d78('0x5e')]({'where':{'id':_0x54cbc0[_0x1d78('0x5d')][_0x1d78('0x66')],'role':_0x1d78('0x67')},'attributes':['id',_0x1d78('0x3e'),_0x1d78('0x7b'),_0x1d78('0x7c'),'internal'],'raw':!![]});}return null;})[_0x1d78('0x23')](function(_0x5a48ed){if(!_0x5a48ed)return null;_0x5caab1[_0x1d78('0x2b')][_0x1d78('0x67')]=_0x5a48ed;return _0x5caab1;})[_0x1d78('0x23')](function(_0x20cbf9){if(_0x20cbf9){if(_0x54cbc0[_0x1d78('0x5d')]['manual']){_0x5caab1['message'][_0x1d78('0x7d')]=util['format'](_0x1d78('0x7e'),_0x54cbc0['user'][_0x1d78('0x3e')]);_0x5caab1[_0x1d78('0x2b')][_0x1d78('0x7f')]=_0x5caab1['channel'];_0x5caab1[_0x1d78('0x2b')][_0x1d78('0x80')]=_0x5caab1[_0x1d78('0x7f')];_0x5caab1['message'][_0x1d78('0x81')]=_0x1d78('0x61');return respondWithRpcPromise('EventManager','EventManager',{'event':_0x1d78('0x82'),'message':_0x5caab1[_0x1d78('0x2b')]},client9002)[_0x1d78('0x23')](function(){return _0x5caab1;});}return _0x5caab1;}return null;})['then'](respondWithResult(_0x3630aa,null))[_0x1d78('0x2d')](handleError(_0x3630aa,null));};var interaction_log=require('../../config/logger')('sms-interactions');exports[_0x1d78('0x39')]=function(_0x52179c,_0x27f7a0,_0x693fe7){var _0x161cb4={'agent':{},'channel':_0x1d78('0x62')};if(_0x52179c[_0x1d78('0x5d')]['id']){delete _0x52179c['body']['id'];}_0x52179c[_0x1d78('0x5d')][_0x1d78('0x66')]=_0x52179c['body'][_0x1d78('0x66')]||_0x52179c[_0x1d78('0x6f')]['id'];_0x161cb4['agent']['id']=_0x52179c[_0x1d78('0x5d')]['UserId'];return db[_0x1d78('0x42')][_0x1d78('0x5e')]({'where':{'id':_0x52179c[_0x1d78('0x5b')]['id'],'UserId':null}})[_0x1d78('0x23')](handleEntityNotFound(_0x27f7a0,null))['then'](function(_0x144118){if(_0x144118){_0x161cb4[_0x1d78('0x2b')]=_0x144118[_0x1d78('0x68')]({'plain':!![]});return db[_0x1d78('0x69')][_0x1d78('0x5e')]({'where':{'id':_0x144118['SmsInteractionId']}});}return null;})[_0x1d78('0x23')](handleEntityNotFound(_0x27f7a0,null))[_0x1d78('0x23')](function(_0x5eaf8b){if(_0x5eaf8b){_0x161cb4['interaction']=_0x5eaf8b[_0x1d78('0x68')]({'plain':!![]});interaction_log[_0x1d78('0x24')](_0x1d78('0x83'),_0x52179c[_0x1d78('0x6f')]['id'],_0x52179c[_0x1d78('0x6f')][_0x1d78('0x3e')],_0x52179c[_0x1d78('0x6f')][_0x1d78('0x70')],_0x161cb4[_0x1d78('0x84')]['id'],_0x52179c[_0x1d78('0x5d')]?JSON[_0x1d78('0x29')](_0x52179c[_0x1d78('0x5d')]):_0x1d78('0x71'));return respondWithRpcPromise(_0x1d78('0x85'),_0x1d78('0x86'),_0x161cb4);}return null;})['then'](function(_0x4a1e21){var _0x169f70='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4a1e21[_0x1d78('0x2b')][_0x1d78('0x87')];return db[_0x1d78('0x75')][_0x1d78('0x48')](_0x169f70,{'type':db['Sequelize']['QueryTypes'][_0x1d78('0x78')],'raw':!![]})[_0x1d78('0x23')](function(_0x1c43c6){return _0x1c43c6;});})[_0x1d78('0x23')](function(_0x4996e4){if(_0x4996e4){_0x161cb4[_0x1d78('0x2b')][_0x1d78('0x79')]=_0x4996e4[0x0];if(!_0x52179c[_0x1d78('0x5d')][_0x1d78('0x66')])return;return db[_0x1d78('0x7a')][_0x1d78('0x5e')]({'where':{'id':_0x52179c[_0x1d78('0x5d')][_0x1d78('0x66')],'role':_0x1d78('0x67')},'attributes':['id','name',_0x1d78('0x7b'),_0x1d78('0x7c'),_0x1d78('0x88')],'raw':!![]});}return null;})[_0x1d78('0x23')](function(_0x4751cd){if(!_0x4751cd)return null;_0x161cb4[_0x1d78('0x2b')][_0x1d78('0x67')]=_0x4751cd;return _0x161cb4;})[_0x1d78('0x23')](function(_0x48fa0a){if(_0x48fa0a){_0x48fa0a[_0x1d78('0x2b')]['interface']=util['format']('SIP/%s',_0x52179c[_0x1d78('0x6f')][_0x1d78('0x3e')]);_0x48fa0a[_0x1d78('0x2b')]['channel']=_0x161cb4['channel'];_0x48fa0a['message'][_0x1d78('0x80')]=_0x161cb4['channel'];_0x48fa0a[_0x1d78('0x2b')][_0x1d78('0x81')]=_0x1d78('0x39');respondWithRpcPromise(_0x1d78('0x89'),'EventManager',{'event':_0x1d78('0x8a'),'message':_0x48fa0a[_0x1d78('0x2b')]},client9002);return _0x161cb4;}return null;})[_0x1d78('0x23')](respondWithResult(_0x27f7a0,null))['catch'](handleError(_0x27f7a0,null));};exports[_0x1d78('0x2f')]=function(_0x18870e,_0x38092e,_0x488e54){if(_0x18870e[_0x1d78('0x5d')]['id']){delete _0x18870e[_0x1d78('0x5d')]['id'];}var _0x162f2c;return db[_0x1d78('0x42')]['find']({'where':{'id':_0x18870e[_0x1d78('0x5b')]['id']}})[_0x1d78('0x23')](handleEntityNotFound(_0x38092e,null))[_0x1d78('0x23')](function(_0x400c1e){if(_0x400c1e){_0x162f2c=_0x400c1e;return db[_0x1d78('0x8b')]['find']({'where':{'id':_0x400c1e[_0x1d78('0x8c')]}});}})[_0x1d78('0x23')](handleEntityNotFound(_0x38092e,null))[_0x1d78('0x23')](function(_0x59cf12){if(_0x59cf12){logger[_0x1d78('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1d78('0x2f'),'received\x20delivery\x20report\x20from',_0x59cf12[_0x1d78('0x45')],util[_0x1d78('0x8d')](_0x18870e['body'],{'showHidden':![],'depth':null}));switch(_0x59cf12[_0x1d78('0x45')]){case'twilio':if(_0x18870e[_0x1d78('0x5d')]['MessageSid']&&_0x18870e[_0x1d78('0x5d')][_0x1d78('0x8e')]===_0x162f2c[_0x1d78('0x8f')]){return _0x162f2c[_0x1d78('0x3b')]({'read':!![]});}else{logger[_0x1d78('0x2a')](_0x1d78('0x90'),_0x1d78('0x2f'),_0x1d78('0x91'),util[_0x1d78('0x8d')](_0x18870e[_0x1d78('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x1d78('0x92'):if(_0x18870e[_0x1d78('0x5d')]['MessageUUID']&&_0x18870e['body']['MessageUUID']===_0x162f2c['messageId']&&_[_0x1d78('0x93')]([_0x1d78('0x94'),'delivered'],_0x18870e[_0x1d78('0x5d')][_0x1d78('0x95')])>=0x0){return _0x162f2c[_0x1d78('0x3b')]({'read':!![]});}else{logger[_0x1d78('0x2a')](_0x1d78('0x90'),_0x1d78('0x2f'),_0x1d78('0x96'),util[_0x1d78('0x8d')](_0x18870e[_0x1d78('0x5d')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x1f839d=_0x18870e[_0x1d78('0x5d')][_0x1d78('0x97')][0x0];if(_0x1f839d[_0x1d78('0x2f')][_0x1d78('0x98')]==='DELIVERED'){return _0x162f2c[_0x1d78('0x3b')]({'read':!![]});}else{logger[_0x1d78('0x2a')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1d78('0x2f'),_0x1d78('0x99'),util[_0x1d78('0x8d')](_0x18870e[_0x1d78('0x5d')],{'showHidden':![],'depth':null}));}break;}return _0x162f2c;}})[_0x1d78('0x23')](respondWithResult(_0x38092e,null))['catch'](handleError(_0x38092e,null));}; \ No newline at end of file +var _0xa509=['interface','channel','motionChannel','event','EventManager','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','QueryTypes','SELECT','SIP/%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','indexOf','delivered','Status','plivio','infobip','results','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','lodash','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./smsMessage.socket','register','client','http','request','then','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','status','end','json','offset','undefined','count','Content-Range','reject','save','update','destroy','stack','name','send','index','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','SmsMessage','includeAll','include','findAll','rows','show','params','keys','rawAttributes','find','create','body','describe','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','SmsInteractionId','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','contact','User','fullname','email','internal','manual'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0xa509,0x12f));var _0x9a50=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa509[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x9a50('0x0'));var rimraf=require(_0x9a50('0x1'));var zipdir=require(_0x9a50('0x2'));var jsonpatch=require(_0x9a50('0x3'));var rp=require('request-promise');var moment=require(_0x9a50('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9a50('0x5'));var util=require(_0x9a50('0x6'));var path=require(_0x9a50('0x7'));var sox=require(_0x9a50('0x8'));var csv=require('to-csv');var ejs=require(_0x9a50('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9a50('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9a50('0xb'));var querystring=require(_0x9a50('0xc'));var Papa=require(_0x9a50('0xd'));var Redis=require(_0x9a50('0xe'));var authService=require(_0x9a50('0xf'));var qs=require(_0x9a50('0x10'));var as=require(_0x9a50('0x11'));var hardwareService=require(_0x9a50('0x12'));var logger=require(_0x9a50('0x13'))(_0x9a50('0x14'));var utils=require(_0x9a50('0x15'));var config=require(_0x9a50('0x16'));var licenseUtil=require(_0x9a50('0x17'));var db=require(_0x9a50('0x18'))['db'];config[_0x9a50('0x19')]=_[_0x9a50('0x1a')](config[_0x9a50('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9a50('0x19')]));require(_0x9a50('0x1b'))[_0x9a50('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x9a50('0x1d')]['http']({'port':0x232c});var client9002=jayson[_0x9a50('0x1d')][_0x9a50('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x5c854f,_0xe639b3,_0x52eceb,_0x583d69){return new BPromise(function(_0x9c0cc7,_0x5ef73e){var _0x1c58e4=_0x583d69||client;return _0x1c58e4[_0x9a50('0x1f')](_0x5c854f,_0x52eceb)[_0x9a50('0x20')](function(_0x4f39e0){logger['info'](_0x9a50('0x21'),_0xe639b3,_0x9a50('0x22'));logger[_0x9a50('0x23')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe639b3,_0x9a50('0x22'),JSON[_0x9a50('0x24')](_0x4f39e0));if(_0x4f39e0[_0x9a50('0x25')]){if(_0x4f39e0['error'][_0x9a50('0x26')]===0x1f4){logger['error'](_0x9a50('0x21'),_0xe639b3,_0x4f39e0[_0x9a50('0x25')][_0x9a50('0x27')]);return _0x5ef73e(_0x4f39e0[_0x9a50('0x25')][_0x9a50('0x27')]);}logger[_0x9a50('0x25')]('SmsMessage,\x20%s,\x20%s',_0xe639b3,_0x4f39e0[_0x9a50('0x25')][_0x9a50('0x27')]);return _0x9c0cc7(_0x4f39e0[_0x9a50('0x25')]['message']);}else{logger[_0x9a50('0x28')](_0x9a50('0x21'),_0xe639b3,_0x9a50('0x22'));_0x9c0cc7(_0x4f39e0['result'][_0x9a50('0x27')]);}})[_0x9a50('0x29')](function(_0x1fc74a){logger[_0x9a50('0x25')](_0x9a50('0x21'),_0xe639b3,_0x1fc74a);_0x5ef73e(_0x1fc74a);});});}function respondWithStatusCode(_0x497cf0,_0x231e4a){_0x231e4a=_0x231e4a||0xcc;return function(_0x5b3a2d){if(_0x5b3a2d){return _0x497cf0['sendStatus'](_0x231e4a);}return _0x497cf0[_0x9a50('0x2a')](_0x231e4a)[_0x9a50('0x2b')]();};}function respondWithResult(_0x4ab3bc,_0x652ed5){_0x652ed5=_0x652ed5||0xc8;return function(_0x324309){if(_0x324309){return _0x4ab3bc[_0x9a50('0x2a')](_0x652ed5)[_0x9a50('0x2c')](_0x324309);}};}function respondWithFilteredResult(_0x4da435,_0x10f7d9){return function(_0xacaf3c){if(_0xacaf3c){var _0x2eb6e3=typeof _0x10f7d9[_0x9a50('0x2d')]===_0x9a50('0x2e')&&typeof _0x10f7d9['limit']===_0x9a50('0x2e');var _0x6710ba=_0xacaf3c['count'];var _0x7b86d8=_0x2eb6e3?0x0:_0x10f7d9['offset'];var _0x364ec8=_0x2eb6e3?_0xacaf3c[_0x9a50('0x2f')]:_0x10f7d9[_0x9a50('0x2d')]+_0x10f7d9['limit'];var _0xfeeb69;if(_0x364ec8>=_0x6710ba){_0x364ec8=_0x6710ba;_0xfeeb69=0xc8;}else{_0xfeeb69=0xce;}_0x4da435[_0x9a50('0x2a')](_0xfeeb69);return _0x4da435['set'](_0x9a50('0x30'),_0x7b86d8+'-'+_0x364ec8+'/'+_0x6710ba)[_0x9a50('0x2c')](_0xacaf3c);}return null;};}function patchUpdates(_0x2a334d){return function(_0x56ffc2){try{jsonpatch['apply'](_0x56ffc2,_0x2a334d,!![]);}catch(_0x225cde){return BPromise[_0x9a50('0x31')](_0x225cde);}return _0x56ffc2[_0x9a50('0x32')]();};}function saveUpdates(_0xc512e2,_0x4e7e14){return function(_0x18a0dd){if(_0x18a0dd){return _0x18a0dd[_0x9a50('0x33')](_0xc512e2)[_0x9a50('0x20')](function(_0x48a2d8){return _0x48a2d8;});}return null;};}function removeEntity(_0x1a41bf,_0x2d00b9){return function(_0x5d8e0b){if(_0x5d8e0b){return _0x5d8e0b[_0x9a50('0x34')]()[_0x9a50('0x20')](function(){_0x1a41bf[_0x9a50('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e71a7,_0x9bca8a){return function(_0x48d3b8){if(!_0x48d3b8){_0x2e71a7['sendStatus'](0x194);}return _0x48d3b8;};}function handleError(_0x2a6ddb,_0xb5998){_0xb5998=_0xb5998||0x1f4;return function(_0x5da069){logger[_0x9a50('0x25')](_0x5da069[_0x9a50('0x35')]);if(_0x5da069[_0x9a50('0x36')]){delete _0x5da069[_0x9a50('0x36')];}_0x2a6ddb[_0x9a50('0x2a')](_0xb5998)[_0x9a50('0x37')](_0x5da069);};}exports[_0x9a50('0x38')]=function(_0x28dced,_0x567711){var _0xfb6fc={},_0xc363c1={},_0x2a02b3={'count':0x0,'rows':[]};var _0x260ccf=_['map'](db['SmsMessage']['rawAttributes'],function(_0x1a785c){return{'name':_0x1a785c[_0x9a50('0x39')],'type':_0x1a785c[_0x9a50('0x3a')][_0x9a50('0x3b')]};});_0xc363c1[_0x9a50('0x3c')]=_['map'](_0x260ccf,_0x9a50('0x36'));_0xc363c1[_0x9a50('0x3d')]=_['keys'](_0x28dced[_0x9a50('0x3d')]);_0xc363c1[_0x9a50('0x3e')]=_[_0x9a50('0x3f')](_0xc363c1['model'],_0xc363c1[_0x9a50('0x3d')]);_0xfb6fc[_0x9a50('0x40')]=_[_0x9a50('0x3f')](_0xc363c1['model'],qs['fields'](_0x28dced[_0x9a50('0x3d')][_0x9a50('0x41')]));_0xfb6fc[_0x9a50('0x40')]=_0xfb6fc['attributes'][_0x9a50('0x42')]?_0xfb6fc[_0x9a50('0x40')]:_0xc363c1['model'];if(!_0x28dced['query'][_0x9a50('0x43')](_0x9a50('0x44'))){_0xfb6fc[_0x9a50('0x45')]=qs[_0x9a50('0x45')](_0x28dced['query'][_0x9a50('0x45')]);_0xfb6fc['offset']=qs[_0x9a50('0x2d')](_0x28dced[_0x9a50('0x3d')][_0x9a50('0x2d')]);}_0xfb6fc[_0x9a50('0x46')]=qs[_0x9a50('0x47')](_0x28dced[_0x9a50('0x3d')]['sort']);_0xfb6fc[_0x9a50('0x48')]=qs[_0x9a50('0x3e')](_[_0x9a50('0x49')](_0x28dced[_0x9a50('0x3d')],_0xc363c1[_0x9a50('0x3e')]),_0x260ccf);if(_0x28dced[_0x9a50('0x3d')]['filter']){_0xfb6fc[_0x9a50('0x48')]=_[_0x9a50('0x4a')](_0xfb6fc[_0x9a50('0x48')],{'$or':_['map'](_0x260ccf,function(_0x36bae4){if(_0x36bae4[_0x9a50('0x3a')]!==_0x9a50('0x4b')){var _0xcd2982={};_0xcd2982[_0x36bae4[_0x9a50('0x36')]]={'$like':'%'+_0x28dced[_0x9a50('0x3d')][_0x9a50('0x4c')]+'%'};return _0xcd2982;}})});}_0xfb6fc=_[_0x9a50('0x4a')]({},_0xfb6fc,_0x28dced[_0x9a50('0x4d')]);var _0x1c8210={'where':_0xfb6fc['where']};return db[_0x9a50('0x4e')][_0x9a50('0x2f')](_0x1c8210)['then'](function(_0x29c5ef){_0x2a02b3[_0x9a50('0x2f')]=_0x29c5ef;if(_0x28dced[_0x9a50('0x3d')][_0x9a50('0x4f')]){_0xfb6fc[_0x9a50('0x50')]=[{'all':!![]}];}return db[_0x9a50('0x4e')][_0x9a50('0x51')](_0xfb6fc);})[_0x9a50('0x20')](function(_0x3b1c11){_0x2a02b3[_0x9a50('0x52')]=_0x3b1c11;return _0x2a02b3;})['then'](respondWithFilteredResult(_0x567711,_0xfb6fc))[_0x9a50('0x29')](handleError(_0x567711,null));};exports[_0x9a50('0x53')]=function(_0xf34d84,_0x13af58){var _0x4d8a30={'raw':!![],'where':{'id':_0xf34d84[_0x9a50('0x54')]['id']}},_0x4f2a0f={};_0x4f2a0f[_0x9a50('0x3c')]=_[_0x9a50('0x55')](db[_0x9a50('0x4e')][_0x9a50('0x56')]);_0x4f2a0f['query']=_[_0x9a50('0x55')](_0xf34d84[_0x9a50('0x3d')]);_0x4f2a0f['filters']=_[_0x9a50('0x3f')](_0x4f2a0f['model'],_0x4f2a0f[_0x9a50('0x3d')]);_0x4d8a30[_0x9a50('0x40')]=_[_0x9a50('0x3f')](_0x4f2a0f[_0x9a50('0x3c')],qs['fields'](_0xf34d84[_0x9a50('0x3d')][_0x9a50('0x41')]));_0x4d8a30[_0x9a50('0x40')]=_0x4d8a30[_0x9a50('0x40')][_0x9a50('0x42')]?_0x4d8a30['attributes']:_0x4f2a0f['model'];if(_0xf34d84[_0x9a50('0x3d')][_0x9a50('0x4f')]){_0x4d8a30[_0x9a50('0x50')]=[{'all':!![]}];}_0x4d8a30=_['merge']({},_0x4d8a30,_0xf34d84[_0x9a50('0x4d')]);return db['SmsMessage'][_0x9a50('0x57')](_0x4d8a30)[_0x9a50('0x20')](handleEntityNotFound(_0x13af58,null))['then'](respondWithResult(_0x13af58,null))['catch'](handleError(_0x13af58,null));};exports[_0x9a50('0x58')]=function(_0x24357c,_0x1e67d2){return db['SmsMessage']['create'](_0x24357c['body'],{})[_0x9a50('0x20')](respondWithResult(_0x1e67d2,0xc9))[_0x9a50('0x29')](handleError(_0x1e67d2,null));};exports[_0x9a50('0x33')]=function(_0x371e6e,_0x129ee6){if(_0x371e6e['body']['id']){delete _0x371e6e['body']['id'];}return db[_0x9a50('0x4e')][_0x9a50('0x57')]({'where':{'id':_0x371e6e[_0x9a50('0x54')]['id']}})[_0x9a50('0x20')](handleEntityNotFound(_0x129ee6,null))[_0x9a50('0x20')](saveUpdates(_0x371e6e[_0x9a50('0x59')],null))[_0x9a50('0x20')](respondWithResult(_0x129ee6,null))[_0x9a50('0x29')](handleError(_0x129ee6,null));};exports['destroy']=function(_0x174765,_0x280b61){return db[_0x9a50('0x4e')][_0x9a50('0x57')]({'where':{'id':_0x174765[_0x9a50('0x54')]['id']}})[_0x9a50('0x20')](handleEntityNotFound(_0x280b61,null))[_0x9a50('0x20')](removeEntity(_0x280b61,null))[_0x9a50('0x29')](handleError(_0x280b61,null));};exports[_0x9a50('0x5a')]=function(_0x3afd8c,_0x10bd3a){return db[_0x9a50('0x4e')][_0x9a50('0x5a')]()[_0x9a50('0x20')](respondWithResult(_0x10bd3a,null))[_0x9a50('0x29')](handleError(_0x10bd3a,null));};var interaction_log=require(_0x9a50('0x13'))(_0x9a50('0x5b'));exports[_0x9a50('0x5c')]=function(_0x5603a6,_0x5efee5,_0x337264){var _0x10d754={'agent':{},'channel':_0x9a50('0x5d')};if(_0x5603a6[_0x9a50('0x59')]['id']){delete _0x5603a6[_0x9a50('0x59')]['id'];}_0x5603a6[_0x9a50('0x59')][_0x9a50('0x5e')]=!![];_0x5603a6[_0x9a50('0x59')][_0x9a50('0x5f')]=moment()[_0x9a50('0x60')](_0x9a50('0x61'));_0x5603a6[_0x9a50('0x59')][_0x9a50('0x62')]=_0x5603a6[_0x9a50('0x59')]['UserId']||_0x5603a6[_0x9a50('0x63')]['id'];_0x10d754[_0x9a50('0x64')]['id']=_0x5603a6[_0x9a50('0x59')][_0x9a50('0x62')];return db[_0x9a50('0x4e')][_0x9a50('0x57')]({'where':{'id':_0x5603a6[_0x9a50('0x54')]['id'],'UserId':null}})[_0x9a50('0x20')](handleEntityNotFound(_0x5efee5,null))[_0x9a50('0x20')](saveUpdates(_0x5603a6[_0x9a50('0x59')],null))[_0x9a50('0x20')](function(_0x83dbbd){if(_0x83dbbd){_0x10d754[_0x9a50('0x27')]=_0x83dbbd[_0x9a50('0x65')]({'plain':!![]});return db[_0x9a50('0x66')][_0x9a50('0x57')]({'where':{'id':_0x83dbbd[_0x9a50('0x67')]}});}return null;})[_0x9a50('0x20')](handleEntityNotFound(_0x5efee5,null))[_0x9a50('0x20')](function(_0x5592b3){if(_0x5592b3){return _0x5592b3['update']({'UserId':_0x5603a6['body'][_0x9a50('0x62')],'read1stAt':_['isNil'](_0x5592b3['read1stAt'])?moment()[_0x9a50('0x60')](_0x9a50('0x61')):undefined});}return null;})['then'](function(_0x1aac3a){if(_0x1aac3a){_0x10d754[_0x9a50('0x68')]=_0x1aac3a[_0x9a50('0x65')]({'plain':!![]});interaction_log[_0x9a50('0x28')](_0x9a50('0x69'),_0x5603a6[_0x9a50('0x63')]['id'],_0x5603a6[_0x9a50('0x63')][_0x9a50('0x36')],_0x5603a6[_0x9a50('0x63')][_0x9a50('0x6a')],_0x10d754[_0x9a50('0x68')]['id'],_0x5603a6[_0x9a50('0x59')]?JSON[_0x9a50('0x24')](_0x5603a6[_0x9a50('0x59')]):_0x9a50('0x6b'));return respondWithRpcPromise(_0x9a50('0x6c'),_0x9a50('0x6d'),_0x10d754);}return null;})['then'](function(_0x18b330){var _0x539d8d=_0x9a50('0x6e')+_0x18b330[_0x9a50('0x27')][_0x9a50('0x6f')];return db[_0x9a50('0x70')]['query'](_0x539d8d,{'type':db[_0x9a50('0x71')]['QueryTypes']['SELECT'],'raw':!![]})[_0x9a50('0x20')](function(_0xdd580e){return _0xdd580e;});})[_0x9a50('0x20')](function(_0x474a82){if(_0x474a82){_0x10d754['message'][_0x9a50('0x72')]=_0x474a82[0x0];if(!_0x5603a6['body'][_0x9a50('0x62')])return;return db[_0x9a50('0x73')][_0x9a50('0x57')]({'where':{'id':_0x5603a6[_0x9a50('0x59')][_0x9a50('0x62')],'role':_0x9a50('0x64')},'attributes':['id',_0x9a50('0x36'),_0x9a50('0x74'),_0x9a50('0x75'),_0x9a50('0x76')],'raw':!![]});}return null;})[_0x9a50('0x20')](function(_0x35c81a){if(!_0x35c81a)return null;_0x10d754[_0x9a50('0x27')]['agent']=_0x35c81a;return _0x10d754;})[_0x9a50('0x20')](function(_0x16c563){if(_0x16c563){if(_0x5603a6[_0x9a50('0x59')][_0x9a50('0x77')]){_0x10d754[_0x9a50('0x27')][_0x9a50('0x78')]=util[_0x9a50('0x60')]('SIP/%s',_0x5603a6['user'][_0x9a50('0x36')]);_0x10d754['message']['channel']=_0x10d754[_0x9a50('0x79')];_0x10d754[_0x9a50('0x27')][_0x9a50('0x7a')]=_0x10d754[_0x9a50('0x79')];_0x10d754['message'][_0x9a50('0x7b')]=_0x9a50('0x5c');return respondWithRpcPromise(_0x9a50('0x7c'),'EventManager',{'event':'acceptmessage','message':_0x10d754[_0x9a50('0x27')]},client9002)[_0x9a50('0x20')](function(){return _0x10d754;});}return _0x10d754;}return null;})[_0x9a50('0x20')](respondWithResult(_0x5efee5,null))[_0x9a50('0x29')](handleError(_0x5efee5,null));};var interaction_log=require('../../config/logger')('sms-interactions');exports[_0x9a50('0x31')]=function(_0x54974c,_0x3e2c25,_0x5490cd){var _0x316fef={'agent':{},'channel':_0x9a50('0x5d')};if(_0x54974c[_0x9a50('0x59')]['id']){delete _0x54974c[_0x9a50('0x59')]['id'];}_0x54974c['body'][_0x9a50('0x62')]=_0x54974c['body']['UserId']||_0x54974c[_0x9a50('0x63')]['id'];_0x316fef[_0x9a50('0x64')]['id']=_0x54974c[_0x9a50('0x59')][_0x9a50('0x62')];return db['SmsMessage']['find']({'where':{'id':_0x54974c[_0x9a50('0x54')]['id'],'UserId':null}})[_0x9a50('0x20')](handleEntityNotFound(_0x3e2c25,null))['then'](function(_0x39eecb){if(_0x39eecb){_0x316fef[_0x9a50('0x27')]=_0x39eecb[_0x9a50('0x65')]({'plain':!![]});return db[_0x9a50('0x66')][_0x9a50('0x57')]({'where':{'id':_0x39eecb[_0x9a50('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x3e2c25,null))[_0x9a50('0x20')](function(_0x45e7bf){if(_0x45e7bf){_0x316fef[_0x9a50('0x68')]=_0x45e7bf[_0x9a50('0x65')]({'plain':!![]});interaction_log[_0x9a50('0x28')](_0x9a50('0x7d'),_0x54974c['user']['id'],_0x54974c[_0x9a50('0x63')]['name'],_0x54974c[_0x9a50('0x63')][_0x9a50('0x6a')],_0x316fef[_0x9a50('0x68')]['id'],_0x54974c[_0x9a50('0x59')]?JSON[_0x9a50('0x24')](_0x54974c[_0x9a50('0x59')]):_0x9a50('0x6b'));return respondWithRpcPromise('RejectMessage',_0x9a50('0x7e'),_0x316fef);}return null;})[_0x9a50('0x20')](function(_0x2f6450){var _0x230ac7=_0x9a50('0x6e')+_0x2f6450[_0x9a50('0x27')][_0x9a50('0x6f')];return db[_0x9a50('0x70')]['query'](_0x230ac7,{'type':db['Sequelize'][_0x9a50('0x7f')][_0x9a50('0x80')],'raw':!![]})[_0x9a50('0x20')](function(_0x4cf9f6){return _0x4cf9f6;});})['then'](function(_0x219e70){if(_0x219e70){_0x316fef[_0x9a50('0x27')]['contact']=_0x219e70[0x0];if(!_0x54974c['body'][_0x9a50('0x62')])return;return db[_0x9a50('0x73')][_0x9a50('0x57')]({'where':{'id':_0x54974c['body']['UserId'],'role':'agent'},'attributes':['id',_0x9a50('0x36'),_0x9a50('0x74'),_0x9a50('0x75'),_0x9a50('0x76')],'raw':!![]});}return null;})[_0x9a50('0x20')](function(_0x558a79){if(!_0x558a79)return null;_0x316fef[_0x9a50('0x27')][_0x9a50('0x64')]=_0x558a79;return _0x316fef;})['then'](function(_0x5ae4d7){if(_0x5ae4d7){_0x5ae4d7[_0x9a50('0x27')][_0x9a50('0x78')]=util[_0x9a50('0x60')](_0x9a50('0x81'),_0x54974c[_0x9a50('0x63')]['name']);_0x5ae4d7[_0x9a50('0x27')][_0x9a50('0x79')]=_0x316fef[_0x9a50('0x79')];_0x5ae4d7[_0x9a50('0x27')]['motionChannel']=_0x316fef[_0x9a50('0x79')];_0x5ae4d7[_0x9a50('0x27')][_0x9a50('0x7b')]=_0x9a50('0x31');respondWithRpcPromise(_0x9a50('0x7c'),_0x9a50('0x7c'),{'event':'rejectmessage','message':_0x5ae4d7['message']},client9002);return _0x316fef;}return null;})[_0x9a50('0x20')](respondWithResult(_0x3e2c25,null))['catch'](handleError(_0x3e2c25,null));};exports[_0x9a50('0x2a')]=function(_0x1ecc43,_0x45b673,_0x283bf2){if(_0x1ecc43[_0x9a50('0x59')]['id']){delete _0x1ecc43[_0x9a50('0x59')]['id'];}var _0x2b012b;return db[_0x9a50('0x4e')][_0x9a50('0x57')]({'where':{'id':_0x1ecc43[_0x9a50('0x54')]['id']}})[_0x9a50('0x20')](handleEntityNotFound(_0x45b673,null))[_0x9a50('0x20')](function(_0x28dc2e){if(_0x28dc2e){_0x2b012b=_0x28dc2e;return db['SmsAccount']['find']({'where':{'id':_0x28dc2e['SmsAccountId']}});}})[_0x9a50('0x20')](handleEntityNotFound(_0x45b673,null))['then'](function(_0x4e154d){if(_0x4e154d){logger[_0x9a50('0x23')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9a50('0x2a'),_0x9a50('0x82'),_0x4e154d[_0x9a50('0x3a')],util[_0x9a50('0x83')](_0x1ecc43['body'],{'showHidden':![],'depth':null}));switch(_0x4e154d[_0x9a50('0x3a')]){case _0x9a50('0x84'):if(_0x1ecc43['body']['MessageSid']&&_0x1ecc43['body'][_0x9a50('0x85')]===_0x2b012b['messageId']){return _0x2b012b[_0x9a50('0x33')]({'read':!![]});}else{logger[_0x9a50('0x25')](_0x9a50('0x86'),_0x9a50('0x2a'),_0x9a50('0x84'),util[_0x9a50('0x83')](_0x1ecc43['body'],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x1ecc43[_0x9a50('0x59')]['MessageUUID']&&_0x1ecc43['body']['MessageUUID']===_0x2b012b['messageId']&&_[_0x9a50('0x87')](['sent',_0x9a50('0x88')],_0x1ecc43[_0x9a50('0x59')][_0x9a50('0x89')])>=0x0){return _0x2b012b[_0x9a50('0x33')]({'read':!![]});}else{logger[_0x9a50('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x9a50('0x2a'),_0x9a50('0x8a'),util['inspect'](_0x1ecc43[_0x9a50('0x59')],{'showHidden':![],'depth':null}));}break;case _0x9a50('0x8b'):var _0x3cb2e2=_0x1ecc43['body'][_0x9a50('0x8c')][0x0];if(_0x3cb2e2[_0x9a50('0x2a')]['groupName']==='DELIVERED'){return _0x2b012b[_0x9a50('0x33')]({'read':!![]});}else{logger['error'](_0x9a50('0x86'),_0x9a50('0x2a'),_0x9a50('0x8b'),util[_0x9a50('0x83')](_0x1ecc43[_0x9a50('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x2b012b;}})[_0x9a50('0x20')](respondWithResult(_0x45b673,null))['catch'](handleError(_0x45b673,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index c08d241..ef13e0a 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 _0x6031=['save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsMessage','setMaxListeners'];(function(_0x3c04d7,_0x472801){var _0x2fb24=function(_0x335b91){while(--_0x335b91){_0x3c04d7['push'](_0x3c04d7['shift']());}};_0x2fb24(++_0x472801);}(_0x6031,0x1c8));var _0x1603=function(_0x474117,_0x1eaba5){_0x474117=_0x474117-0x0;var _0x2240ab=_0x6031[_0x474117];return _0x2240ab;};'use strict';var EventEmitter=require(_0x1603('0x0'));var SmsMessage=require(_0x1603('0x1'))['db'][_0x1603('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x1603('0x3')](0x0);var events={'afterCreate':_0x1603('0x4'),'afterUpdate':'update','afterDestroy':_0x1603('0x5')};function emitEvent(_0x29d182){return function(_0x307e0b,_0x26ae23,_0x3399c2){SmsMessageEvents['emit'](_0x29d182+':'+_0x307e0b['id'],_0x307e0b);SmsMessageEvents[_0x1603('0x6')](_0x29d182,_0x307e0b);_0x3399c2(null);};}for(var e in events){if(events[_0x1603('0x7')](e)){var event=events[e];SmsMessage[_0x1603('0x8')](e,emitEvent(event));}}module[_0x1603('0x9')]=SmsMessageEvents; \ No newline at end of file +var _0xcfb1=['emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xcfb1,0x1bc));var _0x1cfb=function(_0x1342bb,_0x522400){_0x1342bb=_0x1342bb-0x0;var _0x3a91de=_0xcfb1[_0x1342bb];return _0x3a91de;};'use strict';var EventEmitter=require(_0x1cfb('0x0'));var SmsMessage=require(_0x1cfb('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x1cfb('0x2')](0x0);var events={'afterCreate':_0x1cfb('0x3'),'afterUpdate':_0x1cfb('0x4'),'afterDestroy':_0x1cfb('0x5')};function emitEvent(_0x78cf2e){return function(_0x190f3d,_0x1dbc67,_0x5b21f8){SmsMessageEvents[_0x1cfb('0x6')](_0x78cf2e+':'+_0x190f3d['id'],_0x190f3d);SmsMessageEvents[_0x1cfb('0x6')](_0x78cf2e,_0x190f3d);_0x5b21f8(null);};}for(var e in events){if(events[_0x1cfb('0x7')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0x1cfb('0x8')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index f27f8ea..9329cf3 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 _0x4994=['applicationId','toString','bandwidth','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','finally','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','UserId','isNil','findOne','SmsInteractionId','then','update','createdAt','catch','out','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','remote','/api/sms/messages/','/status?token=','sid','error','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','&password=','GET','split','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','requestid','connectel','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','senderString','format','%s:%s','Basic\x20%s','base64','http_code','data','head','message_id','clickSend','Missing\x20parameters:\x20username,\x20password','plivo','authId','token','message_uuid','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','text','timestamp','keys','sort','length','apiKey','createHash','digest','signature=','/external/get/send.php?','id_sms','csc','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','Missing\x20parameters:\x20apiKey','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages'];(function(_0xc78bac,_0x27db46){var _0x75044c=function(_0x1e2fbc){while(--_0x1e2fbc){_0xc78bac['push'](_0xc78bac['shift']());}};_0x75044c(++_0x27db46);}(_0x4994,0x187));var _0x4499=function(_0x580295,_0x146417){_0x580295=_0x580295-0x0;var _0x1b32a6=_0x4994[_0x580295];return _0x1b32a6;};'use strict';var _=require(_0x4499('0x0'));var util=require(_0x4499('0x1'));var logger=require(_0x4499('0x2'))(_0x4499('0x3'));var moment=require(_0x4499('0x4'));var BPromise=require(_0x4499('0x5'));var rp=require(_0x4499('0x6'));var fs=require('fs');var path=require(_0x4499('0x7'));var rimraf=require(_0x4499('0x8'));var config=require(_0x4499('0x9'));var attributes=require('./smsMessage.attributes');module[_0x4499('0xa')]=function(_0x249228,_0x5bf854){return _0x249228[_0x4499('0xb')]('SmsMessage',attributes,{'tableName':_0x4499('0xc'),'paranoid':![],'indexes':[{'name':_0x4499('0xd'),'fields':[_0x4499('0xd')]},{'name':_0x4499('0xe'),'fields':[_0x4499('0xf')],'type':_0x4499('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x28bfa2,_0x54db47,_0x340550){var _0x11c0b1=_0x249228[_0x4499('0x11')];var _0x28a00a=_0x28bfa2[_0x4499('0x12')]({'plain':!![]});if(_0x28a00a[_0x4499('0x13')][_0x4499('0x14')]()==='in'||_0x28a00a[_0x4499('0x13')][_0x4499('0x14')]()==='out'&&!_0x28a00a[_0x4499('0x15')]&&!_['isNil'](_0x28a00a[_0x4499('0x16')])&&!_[_0x4499('0x17')](_0x28a00a['SmsInteractionId'])){_0x11c0b1['SmsInteraction'][_0x4499('0x18')]({'where':{'id':_0x28a00a[_0x4499('0x19')]}})[_0x4499('0x1a')](function(_0x11c4b0){if(_0x11c4b0){_0x11c4b0[_0x4499('0x1b')]({'lastMsgAt':_0x28a00a[_0x4499('0x1c')],'lastMsgDirection':_0x28a00a[_0x4499('0x13')][_0x4499('0x14')]()});}})[_0x4499('0x1d')](function(_0x139b17){console['error'](_0x139b17);});}if(_0x28a00a[_0x4499('0x13')]===_0x4499('0x1e')&&!_0x28a00a[_0x4499('0x15')]){var _0x3d7256;_0x11c0b1[_0x4499('0x1f')][_0x4499('0x20')]({'where':{'id':_0x28a00a[_0x4499('0x21')]},'raw':!![]})[_0x4499('0x1a')](function(_0x14d8f5){_0x3d7256=_0x14d8f5;if(_0x3d7256&&_0x3d7256[_0x4499('0x22')]){switch(_0x3d7256['type']){case _0x4499('0x23'):var _0x5047da=require(_0x4499('0x23'));if(_0x3d7256[_0x4499('0x24')]&&_0x3d7256[_0x4499('0x25')]&&_0x3d7256[_0x4499('0x26')]){var _0x1208cb=new _0x5047da(_0x3d7256[_0x4499('0x24')],_0x3d7256[_0x4499('0x25')]);_0x1208cb[_0x4499('0x27')]['create']({'body':_0x28a00a[_0x4499('0xf')],'to':_0x28a00a[_0x4499('0x26')],'from':_0x3d7256[_0x4499('0x26')],'statusCallback':_0x3d7256[_0x4499('0x28')]+_0x4499('0x29')+_0x28a00a['id']+_0x4499('0x2a')+_0x3d7256['token']})[_0x4499('0x1a')](function(_0x5c6e18){if(_0x5c6e18[_0x4499('0x2b')]){return _0x28bfa2[_0x4499('0x1b')]({'messageId':_0x5c6e18['sid']});}})[_0x4499('0x1d')](function(_0x70ae24){logger[_0x4499('0x2c')](_0x4499('0x2d'),_0x4499('0x2e'),_0x4499('0x23'),util[_0x4499('0x2f')](_0x70ae24,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','twilio',_0x4499('0x30'));}break;case _0x4499('0x31'):var _0xf8c855=_0x4499('0x32');if(_0x3d7256[_0x4499('0x33')]&&_0x3d7256[_0x4499('0x34')]){var _0x14aa85={'recipient':[_0x28a00a[_0x4499('0x26')]],'message':_0x28a00a[_0x4499('0xf')],'message_type':_0x3d7256[_0x4499('0x35')]};if(_0x3d7256[_0x4499('0x35')]&&_0x3d7256['smsMethod']!=='SI'){_0x14aa85[_0x4499('0x36')]=_0x3d7256[_0x4499('0x26')];}var _0x2ad78f={'url':_0xf8c855+'login?username='+_0x3d7256['username']+_0x4499('0x37')+_0x3d7256[_0x4499('0x34')],'method':_0x4499('0x38')};rp(_0x2ad78f)[_0x4499('0x1a')](function(_0x32c3e8){var _0x571666=_0x32c3e8[_0x4499('0x39')](';');var _0x775899={'user_key':_0x571666[0x0],'session_key':_0x571666[0x1]};_0x2ad78f={'url':_0xf8c855+_0x4499('0x3a'),'method':_0x4499('0x3b'),'headers':{'user_key':_0x775899[_0x4499('0x3c')],'Session_key':_0x775899[_0x4499('0x3d')]},'json':!![],'body':_0x14aa85};return rp(_0x2ad78f);})['then'](function(_0x134d02){if(_0x134d02[_0x4499('0x3e')]>=0x1){var _0x18ddf0={'messageId':_0x134d02[_0x4499('0x3f')]};if(_0x3d7256['smsMethod']!=='GP'||!_0x3d7256[_0x4499('0x40')]){_0x18ddf0[_0x4499('0x41')]=!![];}return _0x28bfa2[_0x4499('0x1b')](_0x18ddf0);}else{return logger[_0x4499('0x2c')](_0x4499('0x2d'),_0x4499('0x2e'),'skebby',util[_0x4499('0x2f')](_0x134d02,{'showHidden':![],'depth':null}));}})[_0x4499('0x1d')](function(_0x588a8e){return logger[_0x4499('0x2c')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','skebby',util[_0x4499('0x2f')](_0x588a8e,{'showHidden':![],'depth':null}));});}else{logger[_0x4499('0x2c')](_0x4499('0x2d'),_0x4499('0x2e'),_0x4499('0x31'),'Missing\x20parameters:\x20username,\x20password');}break;case'connectel':if(_0x3d7256[_0x4499('0x25')]){var _0x4fc9dd={'recipient':_0x28a00a[_0x4499('0x26')],'message':_0x28a00a['body'],'sender':_0x3d7256['senderString']||_0x3d7256[_0x4499('0x26')],'authorization':_0x3d7256[_0x4499('0x25')]};var _0x54db47={'method':'POST','uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x4fc9dd,'json':!![]};rp(_0x54db47)['then'](function(_0x10e775){var _0x516242={'messageId':_0x10e775[_0x4499('0x42')]};if(!_0x3d7256[_0x4499('0x40')]){_0x516242['read']=!![];}return _0x28bfa2[_0x4499('0x1b')](_0x516242);})[_0x4499('0x1d')](function(_0x9404b){logger[_0x4499('0x2c')](_0x4499('0x2d'),_0x4499('0x2e'),_0x4499('0x43'),util[_0x4499('0x2f')](_0x9404b,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4499('0x2e'),_0x4499('0x43'),_0x4499('0x44'));}break;case _0x4499('0x45'):if(_0x3d7256['username']&&_0x3d7256[_0x4499('0x34')]){var _0x4fc9dd={'messages':[{'source':_0x4499('0x46'),'to':_0x28a00a[_0x4499('0x26')],'body':_0x28a00a['body'],'from':_0x3d7256[_0x4499('0x47')]||_0x3d7256['phone']}]};var _0x22c038=util[_0x4499('0x48')](_0x4499('0x49'),_0x3d7256[_0x4499('0x33')],_0x3d7256[_0x4499('0x34')]);var _0x54db47={'method':_0x4499('0x3b'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x4fc9dd,'headers':{'Authorization':util[_0x4499('0x48')](_0x4499('0x4a'),new Buffer(_0x22c038)['toString'](_0x4499('0x4b')))},'json':!![]};rp(_0x54db47)[_0x4499('0x1a')](function(_0x1fd749){if(_0x1fd749[_0x4499('0x4c')]>=0xc8&&_0x1fd749['http_code']<=0xce){if(_0x1fd749['data']&&_0x1fd749[_0x4499('0x4d')]['queued_count']>0x0){var _0x300328=_[_0x4499('0x4e')](_0x1fd749[_0x4499('0x4d')][_0x4499('0x27')]);var _0xa71439={'messageId':_0x300328[_0x4499('0x4f')]};if(!_0x3d7256[_0x4499('0x40')]){_0xa71439['read']=!![];}return _0x28bfa2[_0x4499('0x1b')](_0xa71439);}else{logger[_0x4499('0x2c')](_0x4499('0x2d'),_0x4499('0x2e'),_0x4499('0x50'),util[_0x4499('0x2f')](_0x1fd749,{'showHidden':![],'depth':null}));}}else{logger['error'](_0x4499('0x2d'),_0x4499('0x2e'),_0x4499('0x50'),util[_0x4499('0x2f')](_0x1fd749,{'showHidden':![],'depth':null}));}})['catch'](function(_0xbeba11){logger[_0x4499('0x2c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4499('0x2e'),_0x4499('0x50'),util['inspect'](_0xbeba11,{'showHidden':![],'depth':null}));});}else{logger[_0x4499('0x2c')](_0x4499('0x2d'),'afterCreate',_0x4499('0x50'),_0x4499('0x51'));}break;case _0x4499('0x52'):if(_0x3d7256[_0x4499('0x53')]&&_0x3d7256[_0x4499('0x25')]){var _0x4fc9dd={'dst':_0x28a00a[_0x4499('0x26')],'text':_0x28a00a[_0x4499('0xf')],'src':_0x3d7256[_0x4499('0x47')]||_0x3d7256[_0x4499('0x26')],'url':_0x3d7256[_0x4499('0x28')]+_0x4499('0x29')+_0x28a00a['id']+'/status?token='+_0x3d7256[_0x4499('0x54')]};var _0x22c038=util[_0x4499('0x48')](_0x4499('0x49'),_0x3d7256[_0x4499('0x53')],_0x3d7256[_0x4499('0x25')]);var _0x54db47={'method':'POST','uri':util[_0x4499('0x48')]('https://api.plivo.com/v1/Account/%s/Message/',_0x3d7256[_0x4499('0x53')]),'body':_0x4fc9dd,'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x22c038)['toString'](_0x4499('0x4b')))},'json':!![]};rp(_0x54db47)[_0x4499('0x1a')](function(_0x53238b){var _0x2e68b8={'messageId':_0x53238b[_0x4499('0x55')][0x0]};return _0x28bfa2[_0x4499('0x1b')](_0x2e68b8);})[_0x4499('0x1d')](function(_0xe49c3e){logger[_0x4499('0x2c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4499('0x2e'),_0x4499('0x52'),util['inspect'](_0xe49c3e,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x4499('0x2d'),_0x4499('0x2e'),_0x4499('0x52'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case _0x4499('0x56'):if(_0x3d7256[_0x4499('0x33')]&&_0x3d7256['password']){if(_0x3d7256[_0x4499('0x57')]){var _0x6b4ad={'method':_0x4499('0x3b'),'uri':_0x3d7256[_0x4499('0x57')]+_0x4499('0x58'),'body':{'username':_0x3d7256[_0x4499('0x33')],'password':_0x3d7256[_0x4499('0x34')]},'json':!![]};return rp(_0x6b4ad)[_0x4499('0x1a')](function(_0x14747c){var _0x58e448={'method':'POST','uri':_0x3d7256[_0x4499('0x57')]+_0x4499('0x59'),'body':{'messages':[{'from':_0x3d7256[_0x4499('0x26')],'destinations':[{'to':_0x28a00a[_0x4499('0x26')]}],'text':_0x28a00a[_0x4499('0xf')],'notifyUrl':_0x3d7256['remote']+_0x4499('0x29')+_0x28a00a['id']+_0x4499('0x2a')+_0x3d7256[_0x4499('0x54')],'notifyContentType':_0x4499('0x5a'),'callbackData':_0x3d7256[_0x4499('0x26')]+';'+_0x28a00a[_0x4499('0xf')]}]},'headers':{'Authorization':_0x4499('0x5b')+_0x14747c[_0x4499('0x54')]},'json':!![]};return rp(_0x58e448)[_0x4499('0x1a')](function(_0x4cdc2a){if(_0x4cdc2a[_0x4499('0x27')]){var _0x269a05={'messageId':_0x4cdc2a['messages'][0x0][_0x4499('0xd')]};if(!_0x3d7256[_0x4499('0x40')]){_0x269a05[_0x4499('0x41')]=!![];}return _0x28bfa2['update'](_0x269a05);}else{return logger[_0x4499('0x2c')](_0x4499('0x2d'),_0x4499('0x2e'),_0x4499('0x56'),util['inspect'](_0x4cdc2a,{'showHidden':![],'depth':null}));}});})[_0x4499('0x1d')](function(_0x40409d){return logger[_0x4499('0x2c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4499('0x2e'),_0x4499('0x56'),util[_0x4499('0x2f')](_0x40409d,{'showHidden':![],'depth':null}));});}else{logger[_0x4499('0x2c')](_0x4499('0x2d'),_0x4499('0x2e'),_0x4499('0x56'),_0x4499('0x5c'));}}else{logger[_0x4499('0x2c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4499('0x2e'),_0x4499('0x56'),_0x4499('0x51'));}break;case'csc':var _0x3cff2b=require('crypto');if(_0x3d7256['apiKey']){var _0x29dc76={};_0x29dc76['login']=_0x3d7256['username'];_0x29dc76['phone']=_0x28a00a[_0x4499('0x26')];_0x29dc76[_0x4499('0x36')]=_0x3d7256[_0x4499('0x26')];_0x29dc76[_0x4499('0x5d')]=_0x28a00a[_0x4499('0xf')];_0x29dc76[_0x4499('0x5e')]=+new Date();var _0x36599a='';var _0x227ab8='';var _0x27da51=Object[_0x4499('0x5f')](_0x29dc76);_0x27da51[_0x4499('0x60')]();for(var _0x3987de=0x0;_0x3987de<_0x27da51[_0x4499('0x61')];_0x3987de++){if(_0x36599a!=''){_0x36599a+='&';}_0x36599a+=_0x27da51[_0x3987de]+'='+encodeURIComponent(_0x29dc76[_0x27da51[_0x3987de]]);_0x227ab8+=_0x29dc76[_0x27da51[_0x3987de]];}_0x227ab8+=_0x3d7256[_0x4499('0x62')];_0x227ab8=_0x3cff2b[_0x4499('0x63')]('md5')[_0x4499('0x1b')](_0x227ab8)[_0x4499('0x64')]('hex');if(_0x36599a!==''){_0x36599a+='&';}_0x36599a+=_0x4499('0x65')+_0x227ab8;var _0x2ad78f={'method':_0x4499('0x38'),'uri':_0x3d7256[_0x4499('0x57')]+_0x4499('0x66')+_0x36599a,'json':!![]};return rp(_0x2ad78f)[_0x4499('0x1a')](function(_0x3f464c){var _0x9c5a65=Object[_0x4499('0x5f')](_0x3f464c);if(_0x3f464c[_0x9c5a65[0x0]]['error']&&parseInt(_0x3f464c[_0x9c5a65[0x0]][_0x4499('0x2c')])===0x0){var _0xce5f26={'messageId':_0x3f464c[_0x9c5a65[0x0]][_0x4499('0x67')]};if(!_0x3d7256[_0x4499('0x40')]){_0xce5f26[_0x4499('0x41')]=!![];}return _0x28bfa2[_0x4499('0x1b')](_0xce5f26);}else{return logger[_0x4499('0x2c')](_0x4499('0x2d'),'afterCreate','csc',util[_0x4499('0x2f')](_0x3f464c['error'],{'showHidden':![],'depth':null}));}})['catch'](function(_0x79977c){return logger[_0x4499('0x2c')](_0x4499('0x2d'),_0x4499('0x2e'),_0x4499('0x68'),util[_0x4499('0x2f')](_0x79977c,{'showHidden':![],'depth':null}));});}else{logger[_0x4499('0x2c')](_0x4499('0x2d'),_0x4499('0x2e'),_0x4499('0x68'),'Missing\x20parameters:\x20apiKey');}break;case _0x4499('0x69'):if(_0x3d7256[_0x4499('0x62')]){var _0x33302f={'method':_0x4499('0x3b'),'uri':_0x4499('0x6a'),'headers':{'Authorization':_0x3d7256[_0x4499('0x62')]},'body':{'content':_0x28a00a['body'],'to':[_0x28a00a[_0x4499('0x26')]],'from':_0x3d7256['phone'],'binary':![],'clientMessageId':_0x4499('0x6b'),'charset':_0x4499('0x6c')},'json':!![]};rp(_0x33302f)['then'](function(_0x1c1f43){if(!_0x1c1f43[_0x4499('0x2c')]){var _0x493aa0={'messageId':_0x1c1f43[_0x4499('0x27')][0x0]['apiMessageId']};if(!_0x3d7256['deliveryReport']){_0x493aa0[_0x4499('0x41')]=!![];}return _0x28bfa2[_0x4499('0x1b')](_0x493aa0);}else{return logger[_0x4499('0x2c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4499('0x2e'),_0x4499('0x69'),util[_0x4499('0x2f')](_0x1c1f43[_0x4499('0x2c')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x46d385){return logger[_0x4499('0x2c')](_0x4499('0x2d'),_0x4499('0x2e'),_0x4499('0x69'),util[_0x4499('0x2f')](_0x46d385,{'showHidden':![],'depth':null}));});}else{logger[_0x4499('0x2c')](_0x4499('0x2d'),'afterCreate',_0x4499('0x69'),_0x4499('0x6d'));}break;case'bandwidth':if(_0x3d7256[_0x4499('0x33')]&&_0x3d7256[_0x4499('0x34')]){var _0x22c038=util[_0x4499('0x48')]('%s:%s',_0x3d7256[_0x4499('0x33')],_0x3d7256[_0x4499('0x34')]);var _0x54db47={'method':_0x4499('0x3b'),'uri':_0x4499('0x6e')+_0x3d7256[_0x4499('0x6f')]+_0x4499('0x70'),'body':{'to':[_0x28a00a[_0x4499('0x26')]],'text':_0x28a00a[_0x4499('0xf')],'from':_0x3d7256[_0x4499('0x26')],'applicationId':_0x3d7256[_0x4499('0x71')]},'headers':{'Authorization':util['format'](_0x4499('0x4a'),new Buffer(_0x22c038)[_0x4499('0x72')](_0x4499('0x4b')))},'json':!![]};rp(_0x54db47)['then'](function(_0x5180ff){if(_0x5180ff['id']){var _0x1e7cf4={'messageId':_0x5180ff['id']};return _0x28bfa2[_0x4499('0x1b')](_0x1e7cf4);}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x4499('0x73'),util['inspect'](_0x5180ff,{'showHidden':![],'depth':null}));}})['catch'](function(_0xf399f9){logger[_0x4499('0x2c')](_0x4499('0x2d'),_0x4499('0x2e'),_0x4499('0x73'),util[_0x4499('0x2f')](_0xf399f9,{'showHidden':![],'depth':null}));});}else{logger[_0x4499('0x2c')](_0x4499('0x2d'),_0x4499('0x2e'),_0x4499('0x73'),_0x4499('0x51'));}break;case _0x4499('0x74'):if(_0x3d7256[_0x4499('0x62')]){var _0x2d39ee={};var _0x2ad78f={'method':_0x4499('0x3b'),'uri':_0x4499('0x75'),'headers':{'Authorization':_0x4499('0x76')+_0x3d7256['apiKey'],'Content-Type':_0x4499('0x5a')},'body':{'from':_0x3d7256[_0x4499('0x26')],'to':_0x28a00a[_0x4499('0x26')],'text':_0x28a00a[_0x4499('0xf')]},'json':!![]};return rp(_0x2ad78f)[_0x4499('0x1a')](function(_0xe7ae3d){if(_0xe7ae3d['code']==0xca){_0x2d39ee[_0x4499('0x77')]=_0xe7ae3d;var _0x2035e1={'method':_0x4499('0x3b'),'uri':_0x4499('0x78'),'headers':{'Authorization':_0x4499('0x76')+_0x3d7256['apiKey'],'Content-Type':'application/json'},'body':{'refid':_0x2d39ee[_0x4499('0x77')][_0x4499('0x79')]},'json':!![]};return rp(_0x2035e1)['then'](function(_0x52c825){_0x2d39ee[_0x4499('0x7a')]=_0x52c825;var _0x5312e3={'messageId':_0x2d39ee['message']['refid'],'read':!![]};return _0x28bfa2[_0x4499('0x1b')](_0x5312e3);});}else{return logger[_0x4499('0x2c')](_0x4499('0x2d'),'afterCreate',_0x4499('0x74'),util['inspect'](_0xe7ae3d,{'showHidden':![],'depth':null}));}})[_0x4499('0x1d')](function(_0x489124){return logger[_0x4499('0x2c')](_0x4499('0x2d'),_0x4499('0x2e'),_0x4499('0x74'),util[_0x4499('0x2f')](_0x489124,{'showHidden':![],'depth':null}));});}else{return logger[_0x4499('0x2c')](_0x4499('0x2d'),_0x4499('0x2e'),'intelepeer',_0x4499('0x7b'));}break;}}})[_0x4499('0x7c')](function(){_0x340550();});}else{_0x340550();}}},'charset':_0x4499('0x7d'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xb87b=['fti_sms_messages','body','FULLTEXT','models','direction','toLowerCase','secret','SmsInteraction','findOne','SmsInteractionId','then','update','catch','error','out','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','create','phone','/api/sms/messages/','/status?token=','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','login?username=','sms','POST','user_key','total_sent','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','Missing\x20parameters:\x20authToken','clicksend','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','http_code','data','queued_count','head','messages','message_id','clickSend','authId','remote','token','format','%s:%s','toString','base64','message_uuid','plivo','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','csc','crypto','apiKey','login','sender','text','timestamp','keys','sort','md5','digest','hex','signature=','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','applicationId','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','application/json','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','intelepeer','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','sms_messages','messageId'];(function(_0x44303a,_0x52df10){var _0x50af17=function(_0x2f5cdf){while(--_0x2f5cdf){_0x44303a['push'](_0x44303a['shift']());}};_0x50af17(++_0x52df10);}(_0xb87b,0x6e));var _0xbb87=function(_0x72cdb8,_0x4ba431){_0x72cdb8=_0x72cdb8-0x0;var _0x13248a=_0xb87b[_0x72cdb8];return _0x13248a;};'use strict';var _=require(_0xbb87('0x0'));var util=require(_0xbb87('0x1'));var logger=require(_0xbb87('0x2'))(_0xbb87('0x3'));var moment=require(_0xbb87('0x4'));var BPromise=require(_0xbb87('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbb87('0x6'));var rimraf=require(_0xbb87('0x7'));var config=require(_0xbb87('0x8'));var attributes=require(_0xbb87('0x9'));module[_0xbb87('0xa')]=function(_0x308a12,_0x1abd2d){return _0x308a12[_0xbb87('0xb')]('SmsMessage',attributes,{'tableName':_0xbb87('0xc'),'paranoid':![],'indexes':[{'name':_0xbb87('0xd'),'fields':[_0xbb87('0xd')]},{'name':_0xbb87('0xe'),'fields':[_0xbb87('0xf')],'type':_0xbb87('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x259655,_0x5d4ab6,_0x269103){var _0x3998ca=_0x308a12[_0xbb87('0x11')];var _0x425747=_0x259655['get']({'plain':!![]});if(_0x425747[_0xbb87('0x12')][_0xbb87('0x13')]()==='in'||_0x425747['direction'][_0xbb87('0x13')]()==='out'&&!_0x425747[_0xbb87('0x14')]&&!_['isNil'](_0x425747['UserId'])&&!_['isNil'](_0x425747['SmsInteractionId'])){_0x3998ca[_0xbb87('0x15')][_0xbb87('0x16')]({'where':{'id':_0x425747[_0xbb87('0x17')]}})[_0xbb87('0x18')](function(_0x5a081f){if(_0x5a081f){_0x5a081f[_0xbb87('0x19')]({'lastMsgAt':_0x425747['createdAt'],'lastMsgDirection':_0x425747['direction'][_0xbb87('0x13')]()});}})[_0xbb87('0x1a')](function(_0x2ea0ab){console[_0xbb87('0x1b')](_0x2ea0ab);});}if(_0x425747[_0xbb87('0x12')]===_0xbb87('0x1c')&&!_0x425747[_0xbb87('0x14')]){var _0x76db2c;_0x3998ca[_0xbb87('0x1d')][_0xbb87('0x1e')]({'where':{'id':_0x425747[_0xbb87('0x1f')]},'raw':!![]})[_0xbb87('0x18')](function(_0x3c9f65){_0x76db2c=_0x3c9f65;if(_0x76db2c&&_0x76db2c[_0xbb87('0x20')]){switch(_0x76db2c[_0xbb87('0x20')]){case _0xbb87('0x21'):var _0x1dd81a=require(_0xbb87('0x21'));if(_0x76db2c[_0xbb87('0x22')]&&_0x76db2c['authToken']&&_0x76db2c['phone']){var _0x4132b0=new _0x1dd81a(_0x76db2c['accountSid'],_0x76db2c[_0xbb87('0x23')]);_0x4132b0['messages'][_0xbb87('0x24')]({'body':_0x425747[_0xbb87('0xf')],'to':_0x425747[_0xbb87('0x25')],'from':_0x76db2c['phone'],'statusCallback':_0x76db2c['remote']+_0xbb87('0x26')+_0x425747['id']+_0xbb87('0x27')+_0x76db2c['token']})[_0xbb87('0x18')](function(_0x5bbb1b){if(_0x5bbb1b[_0xbb87('0x28')]){return _0x259655[_0xbb87('0x19')]({'messageId':_0x5bbb1b['sid']});}})[_0xbb87('0x1a')](function(_0x58a432){logger[_0xbb87('0x1b')](_0xbb87('0x29'),_0xbb87('0x2a'),'twilio',util[_0xbb87('0x2b')](_0x58a432,{'showHidden':![],'depth':null}));});}else{logger[_0xbb87('0x1b')](_0xbb87('0x29'),_0xbb87('0x2a'),_0xbb87('0x21'),_0xbb87('0x2c'));}break;case _0xbb87('0x2d'):var _0x5b4091=_0xbb87('0x2e');if(_0x76db2c[_0xbb87('0x2f')]&&_0x76db2c[_0xbb87('0x30')]){var _0x4f2157={'recipient':[_0x425747[_0xbb87('0x25')]],'message':_0x425747[_0xbb87('0xf')],'message_type':_0x76db2c[_0xbb87('0x31')]};if(_0x76db2c[_0xbb87('0x31')]&&_0x76db2c['smsMethod']!=='SI'){_0x4f2157['sender']=_0x76db2c[_0xbb87('0x25')];}var _0x1e8436={'url':_0x5b4091+_0xbb87('0x32')+_0x76db2c[_0xbb87('0x2f')]+'&password='+_0x76db2c[_0xbb87('0x30')],'method':'GET'};rp(_0x1e8436)[_0xbb87('0x18')](function(_0x122370){var _0x33f2b7=_0x122370['split'](';');var _0xc22bff={'user_key':_0x33f2b7[0x0],'session_key':_0x33f2b7[0x1]};_0x1e8436={'url':_0x5b4091+_0xbb87('0x33'),'method':_0xbb87('0x34'),'headers':{'user_key':_0xc22bff[_0xbb87('0x35')],'Session_key':_0xc22bff['session_key']},'json':!![],'body':_0x4f2157};return rp(_0x1e8436);})[_0xbb87('0x18')](function(_0x28cba3){if(_0x28cba3[_0xbb87('0x36')]>=0x1){var _0x2e9274={'messageId':_0x28cba3['internal_order_id']};if(_0x76db2c[_0xbb87('0x31')]!=='GP'||!_0x76db2c[_0xbb87('0x37')]){_0x2e9274[_0xbb87('0x38')]=!![];}return _0x259655[_0xbb87('0x19')](_0x2e9274);}else{return logger[_0xbb87('0x1b')](_0xbb87('0x29'),'afterCreate','skebby',util['inspect'](_0x28cba3,{'showHidden':![],'depth':null}));}})['catch'](function(_0x5bc331){return logger[_0xbb87('0x1b')](_0xbb87('0x29'),_0xbb87('0x2a'),_0xbb87('0x2d'),util[_0xbb87('0x2b')](_0x5bc331,{'showHidden':![],'depth':null}));});}else{logger[_0xbb87('0x1b')](_0xbb87('0x29'),_0xbb87('0x2a'),'skebby',_0xbb87('0x39'));}break;case _0xbb87('0x3a'):if(_0x76db2c[_0xbb87('0x23')]){var _0x391939={'recipient':_0x425747['phone'],'message':_0x425747[_0xbb87('0xf')],'sender':_0x76db2c[_0xbb87('0x3b')]||_0x76db2c[_0xbb87('0x25')],'authorization':_0x76db2c[_0xbb87('0x23')]};var _0x5d4ab6={'method':_0xbb87('0x34'),'uri':_0xbb87('0x3c'),'body':_0x391939,'json':!![]};rp(_0x5d4ab6)[_0xbb87('0x18')](function(_0x28291f){var _0x4141f2={'messageId':_0x28291f['requestid']};if(!_0x76db2c['deliveryReport']){_0x4141f2[_0xbb87('0x38')]=!![];}return _0x259655[_0xbb87('0x19')](_0x4141f2);})[_0xbb87('0x1a')](function(_0x4add8e){logger['error'](_0xbb87('0x29'),'afterCreate','connectel',util[_0xbb87('0x2b')](_0x4add8e,{'showHidden':![],'depth':null}));});}else{logger[_0xbb87('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xbb87('0x2a'),_0xbb87('0x3a'),_0xbb87('0x3d'));}break;case _0xbb87('0x3e'):if(_0x76db2c['username']&&_0x76db2c['password']){var _0x391939={'messages':[{'source':'xCALLY\x20Motion','to':_0x425747[_0xbb87('0x25')],'body':_0x425747['body'],'from':_0x76db2c[_0xbb87('0x3b')]||_0x76db2c[_0xbb87('0x25')]}]};var _0x1418b4=util['format']('%s:%s',_0x76db2c[_0xbb87('0x2f')],_0x76db2c[_0xbb87('0x30')]);var _0x5d4ab6={'method':_0xbb87('0x34'),'uri':_0xbb87('0x3f'),'body':_0x391939,'headers':{'Authorization':util['format'](_0xbb87('0x40'),new Buffer(_0x1418b4)['toString']('base64'))},'json':!![]};rp(_0x5d4ab6)[_0xbb87('0x18')](function(_0x5af5ea){if(_0x5af5ea[_0xbb87('0x41')]>=0xc8&&_0x5af5ea['http_code']<=0xce){if(_0x5af5ea[_0xbb87('0x42')]&&_0x5af5ea['data'][_0xbb87('0x43')]>0x0){var _0x3d4845=_[_0xbb87('0x44')](_0x5af5ea[_0xbb87('0x42')][_0xbb87('0x45')]);var _0x9c3bfc={'messageId':_0x3d4845[_0xbb87('0x46')]};if(!_0x76db2c[_0xbb87('0x37')]){_0x9c3bfc[_0xbb87('0x38')]=!![];}return _0x259655[_0xbb87('0x19')](_0x9c3bfc);}else{logger[_0xbb87('0x1b')](_0xbb87('0x29'),_0xbb87('0x2a'),_0xbb87('0x47'),util['inspect'](_0x5af5ea,{'showHidden':![],'depth':null}));}}else{logger[_0xbb87('0x1b')](_0xbb87('0x29'),_0xbb87('0x2a'),'clickSend',util['inspect'](_0x5af5ea,{'showHidden':![],'depth':null}));}})[_0xbb87('0x1a')](function(_0x5e1206){logger['error'](_0xbb87('0x29'),_0xbb87('0x2a'),'clickSend',util['inspect'](_0x5e1206,{'showHidden':![],'depth':null}));});}else{logger[_0xbb87('0x1b')](_0xbb87('0x29'),'afterCreate','clickSend','Missing\x20parameters:\x20username,\x20password');}break;case'plivo':if(_0x76db2c[_0xbb87('0x48')]&&_0x76db2c[_0xbb87('0x23')]){var _0x391939={'dst':_0x425747['phone'],'text':_0x425747[_0xbb87('0xf')],'src':_0x76db2c[_0xbb87('0x3b')]||_0x76db2c[_0xbb87('0x25')],'url':_0x76db2c[_0xbb87('0x49')]+'/api/sms/messages/'+_0x425747['id']+'/status?token='+_0x76db2c[_0xbb87('0x4a')]};var _0x1418b4=util[_0xbb87('0x4b')](_0xbb87('0x4c'),_0x76db2c[_0xbb87('0x48')],_0x76db2c['authToken']);var _0x5d4ab6={'method':_0xbb87('0x34'),'uri':util['format']('https://api.plivo.com/v1/Account/%s/Message/',_0x76db2c[_0xbb87('0x48')]),'body':_0x391939,'headers':{'Authorization':util[_0xbb87('0x4b')](_0xbb87('0x40'),new Buffer(_0x1418b4)[_0xbb87('0x4d')](_0xbb87('0x4e')))},'json':!![]};rp(_0x5d4ab6)[_0xbb87('0x18')](function(_0x2164e3){var _0x53437c={'messageId':_0x2164e3[_0xbb87('0x4f')][0x0]};return _0x259655[_0xbb87('0x19')](_0x53437c);})[_0xbb87('0x1a')](function(_0x514b05){logger[_0xbb87('0x1b')](_0xbb87('0x29'),_0xbb87('0x2a'),_0xbb87('0x50'),util[_0xbb87('0x2b')](_0x514b05,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xbb87('0x29'),'afterCreate',_0xbb87('0x50'),_0xbb87('0x51'));}break;case _0xbb87('0x52'):if(_0x76db2c['username']&&_0x76db2c[_0xbb87('0x30')]){if(_0x76db2c[_0xbb87('0x53')]){var _0x5c63da={'method':_0xbb87('0x34'),'uri':_0x76db2c[_0xbb87('0x53')]+_0xbb87('0x54'),'body':{'username':_0x76db2c[_0xbb87('0x2f')],'password':_0x76db2c[_0xbb87('0x30')]},'json':!![]};return rp(_0x5c63da)[_0xbb87('0x18')](function(_0x5cd359){var _0x2f95f5={'method':_0xbb87('0x34'),'uri':_0x76db2c[_0xbb87('0x53')]+_0xbb87('0x55'),'body':{'messages':[{'from':_0x76db2c[_0xbb87('0x25')],'destinations':[{'to':_0x425747[_0xbb87('0x25')]}],'text':_0x425747[_0xbb87('0xf')],'notifyUrl':_0x76db2c['remote']+_0xbb87('0x26')+_0x425747['id']+_0xbb87('0x27')+_0x76db2c[_0xbb87('0x4a')],'notifyContentType':'application/json','callbackData':_0x76db2c[_0xbb87('0x25')]+';'+_0x425747[_0xbb87('0xf')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x5cd359[_0xbb87('0x4a')]},'json':!![]};return rp(_0x2f95f5)[_0xbb87('0x18')](function(_0x49fa5f){if(_0x49fa5f[_0xbb87('0x45')]){var _0xd66ba1={'messageId':_0x49fa5f[_0xbb87('0x45')][0x0][_0xbb87('0xd')]};if(!_0x76db2c[_0xbb87('0x37')]){_0xd66ba1[_0xbb87('0x38')]=!![];}return _0x259655[_0xbb87('0x19')](_0xd66ba1);}else{return logger[_0xbb87('0x1b')](_0xbb87('0x29'),_0xbb87('0x2a'),_0xbb87('0x52'),util[_0xbb87('0x2b')](_0x49fa5f,{'showHidden':![],'depth':null}));}});})[_0xbb87('0x1a')](function(_0x7653de){return logger['error'](_0xbb87('0x29'),'afterCreate',_0xbb87('0x52'),util[_0xbb87('0x2b')](_0x7653de,{'showHidden':![],'depth':null}));});}else{logger[_0xbb87('0x1b')](_0xbb87('0x29'),'afterCreate',_0xbb87('0x52'),'Missing\x20parameters:\x20base_url');}}else{logger[_0xbb87('0x1b')](_0xbb87('0x29'),_0xbb87('0x2a'),_0xbb87('0x52'),_0xbb87('0x39'));}break;case _0xbb87('0x56'):var _0x29076a=require(_0xbb87('0x57'));if(_0x76db2c[_0xbb87('0x58')]){var _0x3f7fc2={};_0x3f7fc2[_0xbb87('0x59')]=_0x76db2c[_0xbb87('0x2f')];_0x3f7fc2['phone']=_0x425747['phone'];_0x3f7fc2[_0xbb87('0x5a')]=_0x76db2c[_0xbb87('0x25')];_0x3f7fc2[_0xbb87('0x5b')]=_0x425747[_0xbb87('0xf')];_0x3f7fc2[_0xbb87('0x5c')]=+new Date();var _0x4df218='';var _0x356359='';var _0x3e356a=Object[_0xbb87('0x5d')](_0x3f7fc2);_0x3e356a[_0xbb87('0x5e')]();for(var _0x3b2024=0x0;_0x3b2024<_0x3e356a['length'];_0x3b2024++){if(_0x4df218!=''){_0x4df218+='&';}_0x4df218+=_0x3e356a[_0x3b2024]+'='+encodeURIComponent(_0x3f7fc2[_0x3e356a[_0x3b2024]]);_0x356359+=_0x3f7fc2[_0x3e356a[_0x3b2024]];}_0x356359+=_0x76db2c[_0xbb87('0x58')];_0x356359=_0x29076a['createHash'](_0xbb87('0x5f'))[_0xbb87('0x19')](_0x356359)[_0xbb87('0x60')](_0xbb87('0x61'));if(_0x4df218!==''){_0x4df218+='&';}_0x4df218+=_0xbb87('0x62')+_0x356359;var _0x1e8436={'method':'GET','uri':_0x76db2c['baseUrl']+_0xbb87('0x63')+_0x4df218,'json':!![]};return rp(_0x1e8436)['then'](function(_0xa62daa){var _0x12f4a3=Object[_0xbb87('0x5d')](_0xa62daa);if(_0xa62daa[_0x12f4a3[0x0]][_0xbb87('0x1b')]&&parseInt(_0xa62daa[_0x12f4a3[0x0]][_0xbb87('0x1b')])===0x0){var _0x390aaf={'messageId':_0xa62daa[_0x12f4a3[0x0]][_0xbb87('0x64')]};if(!_0x76db2c['deliveryReport']){_0x390aaf[_0xbb87('0x38')]=!![];}return _0x259655[_0xbb87('0x19')](_0x390aaf);}else{return logger[_0xbb87('0x1b')](_0xbb87('0x29'),_0xbb87('0x2a'),_0xbb87('0x56'),util[_0xbb87('0x2b')](_0xa62daa['error'],{'showHidden':![],'depth':null}));}})[_0xbb87('0x1a')](function(_0x35bcdf){return logger[_0xbb87('0x1b')](_0xbb87('0x29'),_0xbb87('0x2a'),_0xbb87('0x56'),util[_0xbb87('0x2b')](_0x35bcdf,{'showHidden':![],'depth':null}));});}else{logger[_0xbb87('0x1b')](_0xbb87('0x29'),_0xbb87('0x2a'),'csc',_0xbb87('0x65'));}break;case _0xbb87('0x66'):if(_0x76db2c['apiKey']){var _0x125be3={'method':'POST','uri':_0xbb87('0x67'),'headers':{'Authorization':_0x76db2c[_0xbb87('0x58')]},'body':{'content':_0x425747[_0xbb87('0xf')],'to':[_0x425747['phone']],'from':_0x76db2c['phone'],'binary':![],'clientMessageId':_0xbb87('0x68'),'charset':_0xbb87('0x69')},'json':!![]};rp(_0x125be3)['then'](function(_0x309e0c){if(!_0x309e0c[_0xbb87('0x1b')]){var _0x14c421={'messageId':_0x309e0c[_0xbb87('0x45')][0x0][_0xbb87('0x6a')]};if(!_0x76db2c[_0xbb87('0x37')]){_0x14c421[_0xbb87('0x38')]=!![];}return _0x259655['update'](_0x14c421);}else{return logger[_0xbb87('0x1b')](_0xbb87('0x29'),_0xbb87('0x2a'),_0xbb87('0x66'),util[_0xbb87('0x2b')](_0x309e0c[_0xbb87('0x1b')],{'showHidden':![],'depth':null}));}})[_0xbb87('0x1a')](function(_0x1d869d){return logger['error'](_0xbb87('0x29'),_0xbb87('0x2a'),_0xbb87('0x66'),util[_0xbb87('0x2b')](_0x1d869d,{'showHidden':![],'depth':null}));});}else{logger[_0xbb87('0x1b')](_0xbb87('0x29'),_0xbb87('0x2a'),_0xbb87('0x66'),_0xbb87('0x65'));}break;case _0xbb87('0x6b'):if(_0x76db2c['username']&&_0x76db2c['password']){var _0x1418b4=util[_0xbb87('0x4b')](_0xbb87('0x4c'),_0x76db2c[_0xbb87('0x2f')],_0x76db2c[_0xbb87('0x30')]);var _0x5d4ab6={'method':'POST','uri':_0xbb87('0x6c')+_0x76db2c[_0xbb87('0x6d')]+'/messages','body':{'to':[_0x425747[_0xbb87('0x25')]],'text':_0x425747[_0xbb87('0xf')],'from':_0x76db2c[_0xbb87('0x25')],'applicationId':_0x76db2c[_0xbb87('0x6e')]},'headers':{'Authorization':util[_0xbb87('0x4b')]('Basic\x20%s',new Buffer(_0x1418b4)['toString'](_0xbb87('0x4e')))},'json':!![]};rp(_0x5d4ab6)['then'](function(_0x14fd09){if(_0x14fd09['id']){var _0x4a8d84={'messageId':_0x14fd09['id']};return _0x259655[_0xbb87('0x19')](_0x4a8d84);}else{logger['error'](_0xbb87('0x29'),_0xbb87('0x2a'),_0xbb87('0x6b'),util[_0xbb87('0x2b')](_0x14fd09,{'showHidden':![],'depth':null}));}})[_0xbb87('0x1a')](function(_0xa7eeec){logger[_0xbb87('0x1b')](_0xbb87('0x29'),_0xbb87('0x2a'),_0xbb87('0x6b'),util[_0xbb87('0x2b')](_0xa7eeec,{'showHidden':![],'depth':null}));});}else{logger[_0xbb87('0x1b')](_0xbb87('0x29'),_0xbb87('0x2a'),_0xbb87('0x6b'),_0xbb87('0x39'));}break;case'intelepeer':if(_0x76db2c[_0xbb87('0x58')]){var _0x232407={};var _0x1e8436={'method':'POST','uri':_0xbb87('0x6f'),'headers':{'Authorization':_0xbb87('0x70')+_0x76db2c[_0xbb87('0x58')],'Content-Type':_0xbb87('0x71')},'body':{'from':_0x76db2c[_0xbb87('0x25')],'to':_0x425747[_0xbb87('0x25')],'text':_0x425747[_0xbb87('0xf')]},'json':!![]};return rp(_0x1e8436)[_0xbb87('0x18')](function(_0x1469a9){if(_0x1469a9[_0xbb87('0x72')]==0xca){_0x232407[_0xbb87('0x73')]=_0x1469a9;var _0x5363e8={'method':_0xbb87('0x34'),'uri':_0xbb87('0x74'),'headers':{'Authorization':_0xbb87('0x70')+_0x76db2c[_0xbb87('0x58')],'Content-Type':'application/json'},'body':{'refid':_0x232407[_0xbb87('0x73')][_0xbb87('0x75')]},'json':!![]};return rp(_0x5363e8)[_0xbb87('0x18')](function(_0x3796d7){_0x232407[_0xbb87('0x76')]=_0x3796d7;var _0x1f1fde={'messageId':_0x232407['message'][_0xbb87('0x75')],'read':!![]};return _0x259655['update'](_0x1f1fde);});}else{return logger[_0xbb87('0x1b')](_0xbb87('0x29'),_0xbb87('0x2a'),_0xbb87('0x77'),util['inspect'](_0x1469a9,{'showHidden':![],'depth':null}));}})[_0xbb87('0x1a')](function(_0x8786c4){return logger[_0xbb87('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','intelepeer',util[_0xbb87('0x2b')](_0x8786c4,{'showHidden':![],'depth':null}));});}else{return logger[_0xbb87('0x1b')](_0xbb87('0x29'),_0xbb87('0x2a'),'intelepeer',_0xbb87('0x78'));}break;}}})[_0xbb87('0x79')](function(){_0x269103();});}else{_0x269103();}}},'charset':_0xbb87('0x7a'),'collate':_0xbb87('0x7b')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index db861a8..fad3533 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 _0xeac4=['SmsMessage','options','raw','CreateSmsMessage','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./smsMessage.socket','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x548d7d,_0x2d41fc){var _0xb1c878=function(_0x570f09){while(--_0x570f09){_0x548d7d['push'](_0x548d7d['shift']());}};_0xb1c878(++_0x2d41fc);}(_0xeac4,0x125));var _0x4eac=function(_0x39e02f,_0x2f4a3c){_0x39e02f=_0x39e02f-0x0;var _0x9cf183=_0xeac4[_0x39e02f];return _0x9cf183;};'use strict';var _=require(_0x4eac('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4eac('0x1'));var rs=require(_0x4eac('0x2'));var fs=require('fs');var Redis=require(_0x4eac('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4eac('0x4'));var logger=require(_0x4eac('0x5'))('rpc');var config=require(_0x4eac('0x6'));var jayson=require(_0x4eac('0x7'));var client=jayson[_0x4eac('0x8')][_0x4eac('0x9')]({'port':0x232a});config[_0x4eac('0xa')]=_[_0x4eac('0xb')](config[_0x4eac('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x4eac('0xc'))(new Redis(config[_0x4eac('0xa')]));require(_0x4eac('0xd'))[_0x4eac('0xe')](socket);function respondWithRpcPromise(_0x51d12e,_0x255622,_0x478529){return new BPromise(function(_0x563c78,_0x56ecc0){return client[_0x4eac('0xf')](_0x51d12e,_0x478529)[_0x4eac('0x10')](function(_0x337ae1){logger[_0x4eac('0x11')](_0x4eac('0x12'),_0x255622,_0x4eac('0x13'));logger[_0x4eac('0x14')](_0x4eac('0x15'),_0x255622,'request\x20sent',JSON[_0x4eac('0x16')](_0x337ae1));if(_0x337ae1[_0x4eac('0x17')]){if(_0x337ae1[_0x4eac('0x17')][_0x4eac('0x18')]===0x1f4){logger[_0x4eac('0x17')]('SmsMessage,\x20%s,\x20%s',_0x255622,_0x337ae1[_0x4eac('0x17')][_0x4eac('0x19')]);return _0x56ecc0(_0x337ae1[_0x4eac('0x17')]['message']);}logger[_0x4eac('0x17')]('SmsMessage,\x20%s,\x20%s',_0x255622,_0x337ae1[_0x4eac('0x17')]['message']);return _0x563c78(_0x337ae1[_0x4eac('0x17')][_0x4eac('0x19')]);}else{logger[_0x4eac('0x11')](_0x4eac('0x12'),_0x255622,_0x4eac('0x13'));_0x563c78(_0x337ae1[_0x4eac('0x1a')][_0x4eac('0x19')]);}})['catch'](function(_0x2e9887){logger[_0x4eac('0x17')](_0x4eac('0x12'),_0x255622,_0x2e9887);_0x56ecc0(_0x2e9887);});});}exports['CreateSmsMessage']=function(_0x3187bf){var _0x1b6880=this;return new Promise(function(_0x5e1179,_0x18754c){return db[_0x4eac('0x1b')]['create'](_0x3187bf['body'],{'raw':_0x3187bf[_0x4eac('0x1c')]?_0x3187bf[_0x4eac('0x1c')][_0x4eac('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x16cbcc){logger[_0x4eac('0x11')](_0x4eac('0x1e'),_0x3187bf);logger[_0x4eac('0x14')](_0x4eac('0x1e'),_0x3187bf,JSON[_0x4eac('0x16')](_0x16cbcc));_0x5e1179(_0x16cbcc);})[_0x4eac('0x1f')](function(_0x3f5dd7){logger[_0x4eac('0x17')](_0x4eac('0x1e'),_0x3f5dd7[_0x4eac('0x19')],_0x3187bf);_0x18754c(_0x1b6880[_0x4eac('0x17')](0x1f4,_0x3f5dd7[_0x4eac('0x19')]));});});}; \ No newline at end of file +var _0x11e7=['SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSmsMessage','SmsMessage','body','options','raw','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','socket.io-emitter','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent'];(function(_0xd6c85b,_0x57091b){var _0xbe0e1e=function(_0x285c9a){while(--_0x285c9a){_0xd6c85b['push'](_0xd6c85b['shift']());}};_0xbe0e1e(++_0x57091b);}(_0x11e7,0x80));var _0x711e=function(_0x53af92,_0xc4f3be){_0x53af92=_0x53af92-0x0;var _0x557326=_0x11e7[_0x53af92];return _0x557326;};'use strict';var _=require(_0x711e('0x0'));var util=require(_0x711e('0x1'));var moment=require('moment');var BPromise=require(_0x711e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x711e('0x3'));var db=require(_0x711e('0x4'))['db'];var utils=require(_0x711e('0x5'));var logger=require(_0x711e('0x6'))(_0x711e('0x7'));var config=require('../../config/environment');var jayson=require(_0x711e('0x8'));var client=jayson['client'][_0x711e('0x9')]({'port':0x232a});config[_0x711e('0xa')]=_['defaults'](config[_0x711e('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x711e('0xb'))(new Redis(config[_0x711e('0xa')]));require('./smsMessage.socket')['register'](socket);function respondWithRpcPromise(_0x1e6cc1,_0x389e6b,_0x39e4c5){return new BPromise(function(_0x4f266a,_0x23230e){return client[_0x711e('0xc')](_0x1e6cc1,_0x39e4c5)[_0x711e('0xd')](function(_0x5e5635){logger[_0x711e('0xe')](_0x711e('0xf'),_0x389e6b,_0x711e('0x10'));logger['debug'](_0x711e('0x11'),_0x389e6b,_0x711e('0x10'),JSON[_0x711e('0x12')](_0x5e5635));if(_0x5e5635['error']){if(_0x5e5635[_0x711e('0x13')][_0x711e('0x14')]===0x1f4){logger[_0x711e('0x13')](_0x711e('0xf'),_0x389e6b,_0x5e5635['error']['message']);return _0x23230e(_0x5e5635['error'][_0x711e('0x15')]);}logger[_0x711e('0x13')](_0x711e('0xf'),_0x389e6b,_0x5e5635[_0x711e('0x13')]['message']);return _0x4f266a(_0x5e5635[_0x711e('0x13')]['message']);}else{logger['info'](_0x711e('0xf'),_0x389e6b,_0x711e('0x10'));_0x4f266a(_0x5e5635[_0x711e('0x16')][_0x711e('0x15')]);}})[_0x711e('0x17')](function(_0x347039){logger[_0x711e('0x13')](_0x711e('0xf'),_0x389e6b,_0x347039);_0x23230e(_0x347039);});});}exports[_0x711e('0x18')]=function(_0x1f9c8b){var _0x138e7d=this;return new Promise(function(_0x59e5fa,_0x2ef00f){return db[_0x711e('0x19')]['create'](_0x1f9c8b[_0x711e('0x1a')],{'raw':_0x1f9c8b[_0x711e('0x1b')]?_0x1f9c8b[_0x711e('0x1b')][_0x711e('0x1c')]===undefined?!![]:![]:!![]})[_0x711e('0xd')](function(_0x7e9370){logger['info'](_0x711e('0x18'),_0x1f9c8b);logger['debug']('CreateSmsMessage',_0x1f9c8b,JSON['stringify'](_0x7e9370));_0x59e5fa(_0x7e9370);})[_0x711e('0x17')](function(_0x589657){logger[_0x711e('0x13')](_0x711e('0x18'),_0x589657[_0x711e('0x15')],_0x1f9c8b);_0x2ef00f(_0x138e7d[_0x711e('0x13')](0x1f4,_0x589657[_0x711e('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index fca658d..d5c3a51 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 _0xe427=['register','length','smsMessage:','./smsMessage.events','save','remove','update','emit','removeListener'];(function(_0x52e716,_0x48170f){var _0x1fdc6b=function(_0x2d3738){while(--_0x2d3738){_0x52e716['push'](_0x52e716['shift']());}};_0x1fdc6b(++_0x48170f);}(_0xe427,0x198));var _0x7e42=function(_0x588ef5,_0x6f790f){_0x588ef5=_0x588ef5-0x0;var _0x379991=_0xe427[_0x588ef5];return _0x379991;};'use strict';var SmsMessageEvents=require(_0x7e42('0x0'));var events=[_0x7e42('0x1'),_0x7e42('0x2'),_0x7e42('0x3')];function createListener(_0x5c35e9,_0x213f55){return function(_0x156666){_0x213f55[_0x7e42('0x4')](_0x5c35e9,_0x156666);};}function removeListener(_0x507500,_0xf0bcf8){return function(){SmsMessageEvents[_0x7e42('0x5')](_0x507500,_0xf0bcf8);};}exports[_0x7e42('0x6')]=function(_0x3bf87d){for(var _0x24eaa3=0x0,_0x1b5cd1=events[_0x7e42('0x7')];_0x24eaa3<_0x1b5cd1;_0x24eaa3++){var _0x26712a=events[_0x24eaa3];var _0x232e69=createListener(_0x7e42('0x8')+_0x26712a,_0x3bf87d);SmsMessageEvents['on'](_0x26712a,_0x232e69);}}; \ No newline at end of file +var _0xeadc=['register','smsMessage:','./smsMessage.events','update','removeListener'];(function(_0x4a5494,_0x3ad336){var _0x57cbb5=function(_0xa5a1ac){while(--_0xa5a1ac){_0x4a5494['push'](_0x4a5494['shift']());}};_0x57cbb5(++_0x3ad336);}(_0xeadc,0x10b));var _0xcead=function(_0x59af1e,_0x4cbf72){_0x59af1e=_0x59af1e-0x0;var _0x3e346b=_0xeadc[_0x59af1e];return _0x3e346b;};'use strict';var SmsMessageEvents=require(_0xcead('0x0'));var events=['save','remove',_0xcead('0x1')];function createListener(_0x3a98a1,_0x3b9f6c){return function(_0x48164f){_0x3b9f6c['emit'](_0x3a98a1,_0x48164f);};}function removeListener(_0xa14567,_0x1a33bd){return function(){SmsMessageEvents[_0xcead('0x2')](_0xa14567,_0x1a33bd);};}exports[_0xcead('0x3')]=function(_0x27cd88){for(var _0x2e4541=0x0,_0x85ddfa=events['length'];_0x2e4541<_0x85ddfa;_0x2e4541++){var _0x3736e6=events[_0x2e4541];var _0x12f19c=createListener(_0xcead('0x4')+_0x3736e6,_0x27cd88);SmsMessageEvents['on'](_0x3736e6,_0x12f19c);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 5315637..2edde67 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 _0x2a65=['destroy','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete'];(function(_0x2125e9,_0x21d8c0){var _0x499201=function(_0x49b9ca){while(--_0x49b9ca){_0x2125e9['push'](_0x2125e9['shift']());}};_0x499201(++_0x21d8c0);}(_0x2a65,0xb7));var _0x52a6=function(_0x234ae1,_0x42bdd6){_0x234ae1=_0x234ae1-0x0;var _0x227ba0=_0x2a65[_0x234ae1];return _0x227ba0;};'use strict';var multer=require(_0x52a6('0x0'));var util=require(_0x52a6('0x1'));var path=require(_0x52a6('0x2'));var timeout=require(_0x52a6('0x3'));var express=require(_0x52a6('0x4'));var router=express[_0x52a6('0x5')]();var fs_extra=require(_0x52a6('0x6'));var auth=require(_0x52a6('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x52a6('0x8'));var controller=require('./smsQueue.controller');router[_0x52a6('0x9')]('/',auth[_0x52a6('0xa')](),controller['index']);router[_0x52a6('0x9')](_0x52a6('0xb'),auth[_0x52a6('0xa')](),controller[_0x52a6('0xc')]);router['get'](_0x52a6('0xd'),auth[_0x52a6('0xa')](),controller['show']);router[_0x52a6('0x9')](_0x52a6('0xe'),auth[_0x52a6('0xa')](),controller[_0x52a6('0xf')]);router[_0x52a6('0x9')](_0x52a6('0x10'),auth[_0x52a6('0xa')](),controller[_0x52a6('0x11')]);router[_0x52a6('0x9')](_0x52a6('0x12'),auth[_0x52a6('0xa')](),controller[_0x52a6('0x13')]);router[_0x52a6('0x14')]('/',auth[_0x52a6('0xa')](),controller[_0x52a6('0x15')]);router[_0x52a6('0x14')]('/:id/teams',auth[_0x52a6('0xa')](),controller[_0x52a6('0x16')]);router[_0x52a6('0x14')](_0x52a6('0x12'),auth['isAuthenticated'](),controller[_0x52a6('0x17')]);router[_0x52a6('0x18')]('/:id',auth[_0x52a6('0xa')](),controller[_0x52a6('0x19')]);router[_0x52a6('0x1a')]('/:id',auth[_0x52a6('0xa')](),controller[_0x52a6('0x1b')]);router['delete'](_0x52a6('0x10'),auth[_0x52a6('0xa')](),controller[_0x52a6('0x1c')]);router[_0x52a6('0x1a')](_0x52a6('0x12'),auth[_0x52a6('0xa')](),controller[_0x52a6('0x1d')]);module['exports']=router; \ No newline at end of file +var _0x6947=['getTeams','/:id/users','post','addTeams','put','destroy','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams'];(function(_0x5c8b05,_0x1c93d0){var _0x1cefdf=function(_0x11a64a){while(--_0x11a64a){_0x5c8b05['push'](_0x5c8b05['shift']());}};_0x1cefdf(++_0x1c93d0);}(_0x6947,0x18d));var _0x7694=function(_0x4da9e1,_0x28c369){_0x4da9e1=_0x4da9e1-0x0;var _0x241da2=_0x6947[_0x4da9e1];return _0x241da2;};'use strict';var multer=require(_0x7694('0x0'));var util=require(_0x7694('0x1'));var path=require(_0x7694('0x2'));var timeout=require(_0x7694('0x3'));var express=require(_0x7694('0x4'));var router=express['Router']();var fs_extra=require(_0x7694('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7694('0x6'));var config=require(_0x7694('0x7'));var controller=require(_0x7694('0x8'));router[_0x7694('0x9')]('/',auth[_0x7694('0xa')](),controller[_0x7694('0xb')]);router['get'](_0x7694('0xc'),auth[_0x7694('0xa')](),controller[_0x7694('0xd')]);router[_0x7694('0x9')](_0x7694('0xe'),auth[_0x7694('0xa')](),controller[_0x7694('0xf')]);router['get'](_0x7694('0x10'),auth[_0x7694('0xa')](),controller[_0x7694('0x11')]);router[_0x7694('0x9')](_0x7694('0x12'),auth[_0x7694('0xa')](),controller[_0x7694('0x13')]);router['get'](_0x7694('0x14'),auth[_0x7694('0xa')](),controller['getAgents']);router[_0x7694('0x15')]('/',auth[_0x7694('0xa')](),controller['create']);router[_0x7694('0x15')](_0x7694('0x12'),auth[_0x7694('0xa')](),controller[_0x7694('0x16')]);router[_0x7694('0x15')](_0x7694('0x14'),auth[_0x7694('0xa')](),controller['addAgents']);router[_0x7694('0x17')](_0x7694('0xe'),auth[_0x7694('0xa')](),controller['update']);router['delete'](_0x7694('0xe'),auth['isAuthenticated'](),controller[_0x7694('0x18')]);router[_0x7694('0x19')](_0x7694('0x12'),auth[_0x7694('0xa')](),controller['removeTeams']);router[_0x7694('0x19')](_0x7694('0x14'),auth[_0x7694('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 4f65f8c..33569f4 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 _0x893c=['rrmemory','beepall','exports','STRING','name','ENUM'];(function(_0x3cc9d9,_0x69ed38){var _0x1a425d=function(_0x44d109){while(--_0x44d109){_0x3cc9d9['push'](_0x3cc9d9['shift']());}};_0x1a425d(++_0x69ed38);}(_0x893c,0x1ca));var _0xc893=function(_0x37f8ad,_0x5c3a37){_0x37f8ad=_0x37f8ad-0x0;var _0x12bd86=_0x893c[_0x37f8ad];return _0x12bd86;};'use strict';var Sequelize=require('sequelize');module[_0xc893('0x0')]={'name':{'type':Sequelize[_0xc893('0x1')],'unique':_0xc893('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc893('0x3')](_0xc893('0x4'),_0xc893('0x5'),'roundrobin')}}; \ No newline at end of file +var _0x46b2=['INTEGER','ENUM','beepall','roundrobin','STRING'];(function(_0x5da63e,_0x4d3503){var _0x442aca=function(_0x6d5bca){while(--_0x6d5bca){_0x5da63e['push'](_0x5da63e['shift']());}};_0x442aca(++_0x4d3503);}(_0x46b2,0xc7));var _0x246b=function(_0x169b56,_0x5711d5){_0x169b56=_0x169b56-0x0;var _0x598972=_0x46b2[_0x169b56];return _0x598972;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x246b('0x0')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x246b('0x0')]},'timeout':{'type':Sequelize[_0x246b('0x1')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x246b('0x2')]('rrmemory',_0x246b('0x3'),_0x246b('0x4'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 7b72013..02808ba 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 _0x6caf=['request-promise','moment','bluebird','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/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','socket.io-emitter','./smsQueue.socket','register','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','SmsQueues','UserProfileResource','sendStatus','error','stack','send','index','map','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','VIRTUAL','name','filter','options','SmsQueue','catch','show','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','findOne','UserSmsQueue','SmsQueueId','findAll','UserId','smsPause','updatedAt','rows','format','%s/%s','SIP','createdAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','User','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','TeamId','includes','all','compact','value','isEmpty','removeAgents','userSmsQueue:remove','addAgents','spread','userSmsQueue:save','isArray','getAgents','eml-format','rimraf','zip-dir'];(function(_0x32e694,_0x562b83){var _0x5e4a45=function(_0x436037){while(--_0x436037){_0x32e694['push'](_0x32e694['shift']());}};_0x5e4a45(++_0x562b83);}(_0x6caf,0x90));var _0xf6ca=function(_0x2dd390,_0x1bc894){_0x2dd390=_0x2dd390-0x0;var _0x3afe47=_0x6caf[_0x2dd390];return _0x3afe47;};'use strict';var emlformat=require(_0xf6ca('0x0'));var rimraf=require(_0xf6ca('0x1'));var zipdir=require(_0xf6ca('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf6ca('0x3'));var moment=require(_0xf6ca('0x4'));var BPromise=require(_0xf6ca('0x5'));var Mustache=require(_0xf6ca('0x6'));var util=require(_0xf6ca('0x7'));var path=require(_0xf6ca('0x8'));var sox=require(_0xf6ca('0x9'));var csv=require('to-csv');var ejs=require(_0xf6ca('0xa'));var fs=require('fs');var fs_extra=require(_0xf6ca('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf6ca('0xc'));var jsforce=require(_0xf6ca('0xd'));var deskjs=require(_0xf6ca('0xe'));var toCsv=require(_0xf6ca('0xf'));var querystring=require(_0xf6ca('0x10'));var Papa=require(_0xf6ca('0x11'));var Redis=require(_0xf6ca('0x12'));var authService=require(_0xf6ca('0x13'));var qs=require(_0xf6ca('0x14'));var as=require(_0xf6ca('0x15'));var hardwareService=require(_0xf6ca('0x16'));var logger=require(_0xf6ca('0x17'))(_0xf6ca('0x18'));var utils=require(_0xf6ca('0x19'));var config=require(_0xf6ca('0x1a'));var licenseUtil=require(_0xf6ca('0x1b'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xf6ca('0x1c')](config[_0xf6ca('0x1d')],{'host':'localhost','port':0x18eb});var socket=require(_0xf6ca('0x1e'))(new Redis(config[_0xf6ca('0x1d')]));require(_0xf6ca('0x1f'))[_0xf6ca('0x20')](socket);function respondWithStatusCode(_0x2cd085,_0x39ff56){_0x39ff56=_0x39ff56||0xcc;return function(_0x5102ac){if(_0x5102ac){return _0x2cd085['sendStatus'](_0x39ff56);}return _0x2cd085['status'](_0x39ff56)[_0xf6ca('0x21')]();};}function respondWithResult(_0x16dd40,_0x16e990){_0x16e990=_0x16e990||0xc8;return function(_0x3f0367){if(_0x3f0367){return _0x16dd40[_0xf6ca('0x22')](_0x16e990)[_0xf6ca('0x23')](_0x3f0367);}};}function respondWithFilteredResult(_0x52e0ee,_0x5029c9){return function(_0x557b45){if(_0x557b45){var _0x186612=typeof _0x5029c9[_0xf6ca('0x24')]===_0xf6ca('0x25')&&typeof _0x5029c9[_0xf6ca('0x26')]===_0xf6ca('0x25');var _0xc6fa15=_0x557b45[_0xf6ca('0x27')];var _0x61e681=_0x186612?0x0:_0x5029c9['offset'];var _0x2beb4b=_0x186612?_0x557b45[_0xf6ca('0x27')]:_0x5029c9[_0xf6ca('0x24')]+_0x5029c9[_0xf6ca('0x26')];var _0x4b1cdb;if(_0x2beb4b>=_0xc6fa15){_0x2beb4b=_0xc6fa15;_0x4b1cdb=0xc8;}else{_0x4b1cdb=0xce;}_0x52e0ee[_0xf6ca('0x22')](_0x4b1cdb);return _0x52e0ee[_0xf6ca('0x28')](_0xf6ca('0x29'),_0x61e681+'-'+_0x2beb4b+'/'+_0xc6fa15)[_0xf6ca('0x23')](_0x557b45);}return null;};}function patchUpdates(_0x543f90){return function(_0xad3750){try{jsonpatch['apply'](_0xad3750,_0x543f90,!![]);}catch(_0x55ab30){return BPromise[_0xf6ca('0x2a')](_0x55ab30);}return _0xad3750[_0xf6ca('0x2b')]();};}function saveUpdates(_0x3d2561,_0xd469e2){return function(_0x4a14ae){if(_0x4a14ae){return _0x4a14ae[_0xf6ca('0x2c')](_0x3d2561)[_0xf6ca('0x2d')](function(_0x1aeb98){return _0x1aeb98;});}return null;};}function removeEntity(_0x65f7b9,_0x1d6600){return function(_0x2285cd){if(_0x2285cd){return _0x2285cd[_0xf6ca('0x2e')]()[_0xf6ca('0x2d')](function(){var _0x3727a4=_0x2285cd[_0xf6ca('0x2f')]({'plain':!![]});var _0x1ff412=_0xf6ca('0x30');return db[_0xf6ca('0x31')][_0xf6ca('0x2e')]({'where':{'type':_0x1ff412,'resourceId':_0x3727a4['id']}})[_0xf6ca('0x2d')](function(){return _0x2285cd;});})[_0xf6ca('0x2d')](function(){_0x65f7b9[_0xf6ca('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51118b,_0x4a006a){return function(_0x2b12e4){if(!_0x2b12e4){_0x51118b[_0xf6ca('0x32')](0x194);}return _0x2b12e4;};}function handleError(_0x201995,_0x3822a7){_0x3822a7=_0x3822a7||0x1f4;return function(_0x2c268){logger[_0xf6ca('0x33')](_0x2c268[_0xf6ca('0x34')]);if(_0x2c268['name']){delete _0x2c268['name'];}_0x201995['status'](_0x3822a7)[_0xf6ca('0x35')](_0x2c268);};}exports[_0xf6ca('0x36')]=function(_0x283c7e,_0x18b9d4){var _0x5d44e2={},_0x54e127={},_0x2fac80={'count':0x0,'rows':[]};var _0xac5ac7=_[_0xf6ca('0x37')](db['SmsQueue'][_0xf6ca('0x38')],function(_0x2ecc4e){return{'name':_0x2ecc4e[_0xf6ca('0x39')],'type':_0x2ecc4e[_0xf6ca('0x3a')]['key']};});_0x54e127[_0xf6ca('0x3b')]=_['map'](_0xac5ac7,'name');_0x54e127[_0xf6ca('0x3c')]=_[_0xf6ca('0x3d')](_0x283c7e[_0xf6ca('0x3c')]);_0x54e127['filters']=_[_0xf6ca('0x3e')](_0x54e127[_0xf6ca('0x3b')],_0x54e127[_0xf6ca('0x3c')]);_0x5d44e2[_0xf6ca('0x3f')]=_['intersection'](_0x54e127[_0xf6ca('0x3b')],qs[_0xf6ca('0x40')](_0x283c7e[_0xf6ca('0x3c')][_0xf6ca('0x40')]));_0x5d44e2[_0xf6ca('0x3f')]=_0x5d44e2[_0xf6ca('0x3f')][_0xf6ca('0x41')]?_0x5d44e2[_0xf6ca('0x3f')]:_0x54e127[_0xf6ca('0x3b')];if(!_0x283c7e['query'][_0xf6ca('0x42')](_0xf6ca('0x43'))){_0x5d44e2['limit']=qs[_0xf6ca('0x26')](_0x283c7e[_0xf6ca('0x3c')]['limit']);_0x5d44e2[_0xf6ca('0x24')]=qs['offset'](_0x283c7e[_0xf6ca('0x3c')][_0xf6ca('0x24')]);}_0x5d44e2[_0xf6ca('0x44')]=qs[_0xf6ca('0x45')](_0x283c7e[_0xf6ca('0x3c')][_0xf6ca('0x45')]);_0x5d44e2['where']=qs[_0xf6ca('0x46')](_[_0xf6ca('0x47')](_0x283c7e['query'],_0x54e127['filters']),_0xac5ac7);if(_0x283c7e[_0xf6ca('0x3c')]['filter']){_0x5d44e2[_0xf6ca('0x48')]=_[_0xf6ca('0x49')](_0x5d44e2[_0xf6ca('0x48')],{'$or':_[_0xf6ca('0x37')](_0xac5ac7,function(_0x46c378){if(_0x46c378[_0xf6ca('0x3a')]!==_0xf6ca('0x4a')){var _0x169a85={};_0x169a85[_0x46c378[_0xf6ca('0x4b')]]={'$like':'%'+_0x283c7e[_0xf6ca('0x3c')][_0xf6ca('0x4c')]+'%'};return _0x169a85;}})});}_0x5d44e2=_[_0xf6ca('0x49')]({},_0x5d44e2,_0x283c7e[_0xf6ca('0x4d')]);var _0x40508b={'where':_0x5d44e2[_0xf6ca('0x48')]};return db[_0xf6ca('0x4e')][_0xf6ca('0x27')](_0x40508b)['then'](function(_0xd613ba){_0x2fac80[_0xf6ca('0x27')]=_0xd613ba;if(_0x283c7e[_0xf6ca('0x3c')]['includeAll']){_0x5d44e2['include']=[{'all':!![]}];}return db['SmsQueue']['findAll'](_0x5d44e2);})['then'](function(_0x45a7da){_0x2fac80['rows']=_0x45a7da;return _0x2fac80;})[_0xf6ca('0x2d')](respondWithFilteredResult(_0x18b9d4,_0x5d44e2))[_0xf6ca('0x4f')](handleError(_0x18b9d4,null));};exports[_0xf6ca('0x50')]=function(_0x5c9407,_0x511155){var _0x2c83c9={'raw':!![],'where':{'id':_0x5c9407['params']['id']}},_0x5adfca={};_0x5adfca[_0xf6ca('0x3b')]=_['keys'](db[_0xf6ca('0x4e')][_0xf6ca('0x38')]);_0x5adfca[_0xf6ca('0x3c')]=_[_0xf6ca('0x3d')](_0x5c9407[_0xf6ca('0x3c')]);_0x5adfca[_0xf6ca('0x46')]=_[_0xf6ca('0x3e')](_0x5adfca[_0xf6ca('0x3b')],_0x5adfca[_0xf6ca('0x3c')]);_0x2c83c9[_0xf6ca('0x3f')]=_[_0xf6ca('0x3e')](_0x5adfca[_0xf6ca('0x3b')],qs['fields'](_0x5c9407[_0xf6ca('0x3c')][_0xf6ca('0x40')]));_0x2c83c9[_0xf6ca('0x3f')]=_0x2c83c9['attributes'][_0xf6ca('0x41')]?_0x2c83c9[_0xf6ca('0x3f')]:_0x5adfca['model'];if(_0x5c9407['query']['includeAll']){_0x2c83c9[_0xf6ca('0x51')]=[{'all':!![]}];}_0x2c83c9=_['merge']({},_0x2c83c9,_0x5c9407[_0xf6ca('0x4d')]);return db[_0xf6ca('0x4e')][_0xf6ca('0x52')](_0x2c83c9)['then'](handleEntityNotFound(_0x511155,null))['then'](respondWithResult(_0x511155,null))[_0xf6ca('0x4f')](handleError(_0x511155,null));};exports[_0xf6ca('0x53')]=function(_0x470c69,_0x2d792){return db[_0xf6ca('0x4e')][_0xf6ca('0x53')](_0x470c69[_0xf6ca('0x54')],{})['then'](function(_0x35c260){var _0x2fffaa=_0x470c69[_0xf6ca('0x55')][_0xf6ca('0x2f')]({'plain':!![]});if(!_0x2fffaa)throw new Error(_0xf6ca('0x56'));if(_0x2fffaa[_0xf6ca('0x57')]===_0xf6ca('0x55')){var _0x457b3a=_0x35c260[_0xf6ca('0x2f')]({'plain':!![]});var _0x197df3='SmsQueues';return db[_0xf6ca('0x58')][_0xf6ca('0x52')]({'where':{'name':_0x197df3,'userProfileId':_0x2fffaa[_0xf6ca('0x59')]},'raw':!![]})[_0xf6ca('0x2d')](function(_0x12f556){if(_0x12f556&&_0x12f556['autoAssociation']===0x0){return db[_0xf6ca('0x31')][_0xf6ca('0x53')]({'name':_0x457b3a[_0xf6ca('0x4b')],'resourceId':_0x457b3a['id'],'type':_0x12f556['name'],'sectionId':_0x12f556['id']},{})['then'](function(){return _0x35c260;});}else{return _0x35c260;}})[_0xf6ca('0x4f')](function(_0x4fac85){logger[_0xf6ca('0x33')](_0xf6ca('0x5a'),_0x4fac85);throw _0x4fac85;});}return _0x35c260;})[_0xf6ca('0x2d')](respondWithResult(_0x2d792,0xc9))[_0xf6ca('0x4f')](handleError(_0x2d792,null));};exports[_0xf6ca('0x2c')]=function(_0xccba24,_0x496196){if(_0xccba24[_0xf6ca('0x54')]['id']){delete _0xccba24['body']['id'];}return db['SmsQueue'][_0xf6ca('0x52')]({'where':{'id':_0xccba24['params']['id']}})['then'](handleEntityNotFound(_0x496196,null))[_0xf6ca('0x2d')](saveUpdates(_0xccba24[_0xf6ca('0x54')],null))[_0xf6ca('0x2d')](respondWithResult(_0x496196,null))['catch'](handleError(_0x496196,null));};exports[_0xf6ca('0x2e')]=function(_0x3cd965,_0xafbb18){return db['SmsQueue'][_0xf6ca('0x52')]({'where':{'id':_0x3cd965[_0xf6ca('0x5b')]['id']}})[_0xf6ca('0x2d')](handleEntityNotFound(_0xafbb18,null))[_0xf6ca('0x2d')](removeEntity(_0xafbb18,null))[_0xf6ca('0x4f')](handleError(_0xafbb18,null));};exports['describe']=function(_0x15da69,_0x14bdf4){return db[_0xf6ca('0x4e')][_0xf6ca('0x5c')]()[_0xf6ca('0x2d')](respondWithResult(_0x14bdf4,null))[_0xf6ca('0x4f')](handleError(_0x14bdf4,null));};exports['getMembers']=function(_0x177452,_0x20eb4c,_0x23879d){var _0x18a3e2={'raw':!![],'where':{}},_0x14ac73={},_0x9046d4;return db['SmsQueue'][_0xf6ca('0x5d')]({'where':{'id':_0x177452[_0xf6ca('0x5b')]['id']}})[_0xf6ca('0x2d')](handleEntityNotFound(_0x20eb4c,null))[_0xf6ca('0x2d')](function(_0x5b29ca){if(_0x5b29ca){_0x9046d4=_0x5b29ca[_0xf6ca('0x2f')]({'plain':!![]});_0x14ac73['model']=_['keys'](db[_0xf6ca('0x5e')][_0xf6ca('0x38')]);_0x14ac73[_0xf6ca('0x3c')]=_[_0xf6ca('0x3d')](_0x177452[_0xf6ca('0x3c')]);_0x14ac73[_0xf6ca('0x46')]=_[_0xf6ca('0x3e')](_0x14ac73[_0xf6ca('0x3b')],_0x14ac73[_0xf6ca('0x3c')]);_0x18a3e2[_0xf6ca('0x3f')]=_[_0xf6ca('0x3e')](_0x14ac73[_0xf6ca('0x3b')],qs[_0xf6ca('0x40')](_0x177452['query'][_0xf6ca('0x40')]));_0x18a3e2['attributes']=_0x18a3e2[_0xf6ca('0x3f')][_0xf6ca('0x41')]?_0x18a3e2[_0xf6ca('0x3f')]:_0x14ac73[_0xf6ca('0x3b')];if(!_0x177452[_0xf6ca('0x3c')][_0xf6ca('0x42')](_0xf6ca('0x43'))){_0x18a3e2[_0xf6ca('0x26')]=qs[_0xf6ca('0x26')](_0x177452[_0xf6ca('0x3c')]['limit']);_0x18a3e2[_0xf6ca('0x24')]=qs[_0xf6ca('0x24')](_0x177452[_0xf6ca('0x3c')][_0xf6ca('0x24')]);}_0x18a3e2[_0xf6ca('0x44')]=qs[_0xf6ca('0x45')](_0x177452[_0xf6ca('0x3c')]['sort']);_0x18a3e2[_0xf6ca('0x48')]=qs['filters'](_['pick'](_0x177452[_0xf6ca('0x3c')],_0x14ac73[_0xf6ca('0x46')]));_0x18a3e2[_0xf6ca('0x48')][_0xf6ca('0x5f')]=_0x5b29ca['id'];if(_0x177452[_0xf6ca('0x3c')]['filter']){_0x18a3e2['where']=_[_0xf6ca('0x49')](_0x18a3e2[_0xf6ca('0x48')],{'$or':_[_0xf6ca('0x37')](_0x18a3e2['attributes'],function(_0x259416){var _0x2cddbb={};_0x2cddbb[_0x259416]={'$like':'%'+_0x177452[_0xf6ca('0x3c')][_0xf6ca('0x4c')]+'%'};return _0x2cddbb;})});}_0x18a3e2=_[_0xf6ca('0x49')]({},_0x18a3e2,_0x177452['options']);return db[_0xf6ca('0x5e')][_0xf6ca('0x60')](_0x18a3e2);}})[_0xf6ca('0x2d')](function(_0x4b56c2){if(_0x4b56c2){return db['User']['findAndCountAll']({'where':{'id':_['map'](_0x4b56c2,_0xf6ca('0x61')),'role':'agent'},'attributes':['id',_0xf6ca('0x4b'),_0xf6ca('0x62'),_0xf6ca('0x63'),'createdAt']});}})['then'](function(_0x7a4928){if(_0x7a4928){return{'count':_0x7a4928['count'],'rows':_[_0xf6ca('0x37')](_0x7a4928[_0xf6ca('0x64')],function(_0x150d7d){return{'membername':_0x150d7d[_0xf6ca('0x4b')],'UserId':_0x150d7d['id'],'queue_name':_0x9046d4['name'],'SmsQueueId':_0x9046d4['id'],'interface':util[_0xf6ca('0x65')](_0xf6ca('0x66'),_0xf6ca('0x67'),_0x150d7d['name']),'penalty':0x0,'paused':_0x150d7d['smsPause'],'createdAt':_0x150d7d[_0xf6ca('0x68')],'updatedAt':_0x150d7d['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xf6ca('0x2d')](respondWithFilteredResult(_0x20eb4c,_0x18a3e2))[_0xf6ca('0x4f')](handleError(_0x20eb4c,null));};exports[_0xf6ca('0x69')]=function(_0x486a8b,_0x51053c,_0x52e6f8){var _0x226c4d={};var _0x27576f={};var _0x4946d6;var _0x5b0b13;return db[_0xf6ca('0x4e')][_0xf6ca('0x5d')]({'where':{'id':_0x486a8b[_0xf6ca('0x5b')]['id']}})[_0xf6ca('0x2d')](handleEntityNotFound(_0x51053c,null))[_0xf6ca('0x2d')](function(_0x3b9d25){if(_0x3b9d25){_0x4946d6=_0x3b9d25;_0x27576f[_0xf6ca('0x3b')]=_['keys'](db[_0xf6ca('0x6a')][_0xf6ca('0x38')]);_0x27576f[_0xf6ca('0x3c')]=_[_0xf6ca('0x3d')](_0x486a8b[_0xf6ca('0x3c')]);_0x27576f[_0xf6ca('0x46')]=_['intersection'](_0x27576f[_0xf6ca('0x3b')],_0x27576f['query']);_0x226c4d[_0xf6ca('0x3f')]=_[_0xf6ca('0x3e')](_0x27576f[_0xf6ca('0x3b')],qs[_0xf6ca('0x40')](_0x486a8b['query'][_0xf6ca('0x40')]));_0x226c4d['attributes']=_0x226c4d[_0xf6ca('0x3f')][_0xf6ca('0x41')]?_0x226c4d[_0xf6ca('0x3f')]:_0x27576f['model'];_0x226c4d[_0xf6ca('0x44')]=qs[_0xf6ca('0x45')](_0x486a8b[_0xf6ca('0x3c')][_0xf6ca('0x45')]);_0x226c4d[_0xf6ca('0x48')]=qs[_0xf6ca('0x46')](_[_0xf6ca('0x47')](_0x486a8b['query'],_0x27576f[_0xf6ca('0x46')]));if(_0x486a8b[_0xf6ca('0x3c')][_0xf6ca('0x4c')]){_0x226c4d['where']=_[_0xf6ca('0x49')](_0x226c4d[_0xf6ca('0x48')],{'$or':_['map'](_0x226c4d[_0xf6ca('0x3f')],function(_0xc776f2){var _0x95aa27={};_0x95aa27[_0xc776f2]={'$like':'%'+_0x486a8b[_0xf6ca('0x3c')][_0xf6ca('0x4c')]+'%'};return _0x95aa27;})});}_0x226c4d=_[_0xf6ca('0x49')]({},_0x226c4d,_0x486a8b['options']);return _0x4946d6[_0xf6ca('0x69')](_0x226c4d);}})[_0xf6ca('0x2d')](function(_0x401db4){if(_0x401db4){_0x5b0b13=_0x401db4[_0xf6ca('0x41')];if(!_0x486a8b['query'][_0xf6ca('0x42')](_0xf6ca('0x43'))){_0x226c4d[_0xf6ca('0x26')]=qs[_0xf6ca('0x26')](_0x486a8b[_0xf6ca('0x3c')][_0xf6ca('0x26')]);_0x226c4d[_0xf6ca('0x24')]=qs['offset'](_0x486a8b[_0xf6ca('0x3c')][_0xf6ca('0x24')]);}return _0x4946d6['getTeams'](_0x226c4d);}})[_0xf6ca('0x2d')](function(_0x1bc609){if(_0x1bc609){return _0x1bc609?{'count':_0x5b0b13,'rows':_0x1bc609}:null;}})['then'](respondWithResult(_0x51053c,null))[_0xf6ca('0x4f')](handleError(_0x51053c,null));};exports[_0xf6ca('0x6b')]=function(_0x31cc77,_0x1f1f35,_0x3810a8){var _0x3bba05=_0x31cc77[_0xf6ca('0x54')][_0xf6ca('0x6c')];return db[_0xf6ca('0x6a')][_0xf6ca('0x60')]({'where':{'id':_0x3bba05},'attributes':['id'],'include':[{'model':db['User'],'as':_0xf6ca('0x6d'),'attributes':['id',_0xf6ca('0x4b'),_0xf6ca('0x6e'),_0xf6ca('0x6f'),_0xf6ca('0x70')],'raw':!![]}]})['then'](function(_0x39efa8){if(_0x39efa8){var _0x4cb4c2=_['flatMap'](_0x39efa8,function(_0x50bbe2){var _0x2851ec=_0x50bbe2[_0xf6ca('0x2f')]({'plain':!![]});return _0x2851ec[_0xf6ca('0x6d')];});return db[_0xf6ca('0x4e')][_0xf6ca('0x52')]({'where':{'id':_0x31cc77[_0xf6ca('0x5b')]['id']}})[_0xf6ca('0x2d')](function(_0x2683c6){return db[_0xf6ca('0x71')][_0xf6ca('0x72')](function(_0x2e6bdf){return _0x2683c6['addTeams'](_0x3bba05,{'transaction':_0x2e6bdf})[_0xf6ca('0x2d')](function(){return BPromise[_0xf6ca('0x73')](_0x4cb4c2,function(_0x4ab657){return db[_0xf6ca('0x5e')][_0xf6ca('0x74')]({'where':{'UserId':_0x4ab657['id'],'SmsQueueId':_0x31cc77[_0xf6ca('0x5b')]['id']},'transaction':_0x2e6bdf});});})[_0xf6ca('0x2d')](function(){_0x4cb4c2[_0xf6ca('0x75')](function(_0x3d7770){socket[_0xf6ca('0x76')]('userSmsQueue:save',{'UserId':_0x3d7770['id'],'SmsQueueId':_0x2683c6['id']});});});});});}})[_0xf6ca('0x2d')](respondWithStatusCode(_0x1f1f35,null))['catch'](handleError(_0x1f1f35,null));};exports[_0xf6ca('0x77')]=function(_0x491cbf,_0x1982c4,_0x4befc0){return db['Team'][_0xf6ca('0x60')]({'where':{'id':_0x491cbf['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xf6ca('0x78')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xf6ca('0x2d')](handleEntityNotFound(_0x1982c4,null))[_0xf6ca('0x2d')](function(_0x505b1f){var _0x2d6491=_[_0xf6ca('0x37')](_0x505b1f,'id');var _0x1664f5=[];var _0x215a06=[];var _0x5e7026=squel['select']();_0x5e7026[_0xf6ca('0x79')](_0xf6ca('0x7a'))[_0xf6ca('0x7b')](_0xf6ca('0x7c'),'tq')[_0xf6ca('0x7d')](_0xf6ca('0x7e'),'ut',_0xf6ca('0x7f'))[_0xf6ca('0x48')](_0xf6ca('0x80'),_0x491cbf[_0xf6ca('0x5b')]['id']);for(var _0x237dff=0x0;_0x237dff<_0x505b1f['length'];_0x237dff+=0x1){let _0x5a130c=_0x505b1f[_0x237dff];for(var _0xc1f072=0x0;_0xc1f072<_0x5a130c[_0xf6ca('0x6d')][_0xf6ca('0x41')];_0xc1f072+=0x1){let _0x452e1a=_0x5a130c[_0xf6ca('0x6d')][_0xc1f072];var _0x2a9386=_0x5e7026[_0xf6ca('0x81')]();_0x2a9386[_0xf6ca('0x48')](_0xf6ca('0x82'),_0x452e1a['id']);_0x215a06[_0xf6ca('0x83')](db[_0xf6ca('0x71')][_0xf6ca('0x3c')](_0x2a9386[_0xf6ca('0x84')](),{'type':db[_0xf6ca('0x71')]['QueryTypes'][_0xf6ca('0x85')]})[_0xf6ca('0x2d')](function(_0xb69954){if(_0xb69954[_0xf6ca('0x41')]===0x1){return _0x452e1a['id'];}else{var _0x33dfbf=_['every'](_[_0xf6ca('0x37')](_0xb69954,_0xf6ca('0x86')),function(_0x1f7786){return _[_0xf6ca('0x87')](_0x2d6491,_0x1f7786);});if(_0x33dfbf){return _0x452e1a['id'];}}}));}}return BPromise[_0xf6ca('0x88')](_0x215a06)[_0xf6ca('0x2d')](function(_0x8a8e3c){_0x1664f5=_(_0x1664f5)['union'](_0x8a8e3c)[_0xf6ca('0x89')]()[_0xf6ca('0x8a')]();return db['SmsQueue'][_0xf6ca('0x52')]({'where':{'id':_0x491cbf[_0xf6ca('0x5b')]['id']}})['then'](function(_0x4aa20d){return db[_0xf6ca('0x71')]['transaction'](function(_0x1790c7){return _0x4aa20d[_0xf6ca('0x77')](_0x491cbf[_0xf6ca('0x3c')][_0xf6ca('0x6c')],{'transaction':_0x1790c7})[_0xf6ca('0x2d')](function(){if(!_[_0xf6ca('0x8b')](_0x1664f5)){return _0x4aa20d[_0xf6ca('0x8c')](_0x1664f5,{'transaction':_0x1790c7});}})[_0xf6ca('0x2d')](function(){_0x1664f5[_0xf6ca('0x75')](function(_0x200adb){socket[_0xf6ca('0x76')](_0xf6ca('0x8d'),{'UserId':_0x200adb,'SmsQueueId':_0x4aa20d['id']});});});});});});})[_0xf6ca('0x2d')](respondWithStatusCode(_0x1982c4,null))[_0xf6ca('0x4f')](handleError(_0x1982c4,null));};exports[_0xf6ca('0x8e')]=function(_0x290f3b,_0x6f6c5e,_0x356bbe){return db[_0xf6ca('0x4e')][_0xf6ca('0x52')]({'where':{'id':_0x290f3b[_0xf6ca('0x5b')]['id']}})['then'](handleEntityNotFound(_0x6f6c5e,null))[_0xf6ca('0x2d')](function(_0x5d8416){if(_0x5d8416){return _0x5d8416[_0xf6ca('0x8e')](_0x290f3b['body'][_0xf6ca('0x6c')],_['omit'](_0x290f3b[_0xf6ca('0x54')],[_0xf6ca('0x6c'),'id'])||{})[_0xf6ca('0x8f')](function(_0x30b333){for(var _0x31857f=0x0;_0x31857f<_0x290f3b[_0xf6ca('0x54')][_0xf6ca('0x6c')][_0xf6ca('0x41')];_0x31857f+=0x1){socket[_0xf6ca('0x76')](_0xf6ca('0x90'),{'UserId':Number(_0x290f3b[_0xf6ca('0x54')][_0xf6ca('0x6c')][_0x31857f]),'SmsQueueId':Number(_0x290f3b[_0xf6ca('0x5b')]['id'])});}return _0x30b333;});}})[_0xf6ca('0x2d')](respondWithResult(_0x6f6c5e,null))[_0xf6ca('0x4f')](handleError(_0x6f6c5e,null));};exports['removeAgents']=function(_0x44490e,_0x3789d2,_0x5c7dd1){return db['SmsQueue']['find']({'where':{'id':_0x44490e[_0xf6ca('0x5b')]['id']}})['then'](handleEntityNotFound(_0x3789d2,null))[_0xf6ca('0x2d')](function(_0x55eb94){if(_0x55eb94){return _0x55eb94['removeAgents'](_0x44490e[_0xf6ca('0x3c')][_0xf6ca('0x6c')])[_0xf6ca('0x2d')](function(){if(_[_0xf6ca('0x91')](_0x44490e['query'][_0xf6ca('0x6c')])){for(var _0xdc12ac=0x0;_0xdc12ac<_0x44490e[_0xf6ca('0x3c')]['ids'][_0xf6ca('0x41')];_0xdc12ac+=0x1){socket[_0xf6ca('0x76')](_0xf6ca('0x8d'),{'UserId':Number(_0x44490e[_0xf6ca('0x3c')][_0xf6ca('0x6c')][_0xdc12ac]),'SmsQueueId':Number(_0x44490e[_0xf6ca('0x5b')]['id'])});}}else{socket[_0xf6ca('0x76')](_0xf6ca('0x8d'),{'UserId':Number(_0x44490e[_0xf6ca('0x3c')][_0xf6ca('0x6c')]),'SmsQueueId':Number(_0x44490e['params']['id'])});}});}})[_0xf6ca('0x2d')](respondWithStatusCode(_0x3789d2,null))[_0xf6ca('0x4f')](handleError(_0x3789d2,null));};exports[_0xf6ca('0x92')]=function(_0x7f3ba9,_0x3c40bb,_0x2584ba){var _0xdd99f={};var _0x355a00={};var _0x594d75;var _0x346c45;return db[_0xf6ca('0x4e')][_0xf6ca('0x5d')]({'where':{'id':_0x7f3ba9[_0xf6ca('0x5b')]['id']}})[_0xf6ca('0x2d')](handleEntityNotFound(_0x3c40bb,null))[_0xf6ca('0x2d')](function(_0x3358d1){if(_0x3358d1){_0x594d75=_0x3358d1;_0x355a00['model']=_['keys'](db[_0xf6ca('0x78')]['rawAttributes']);_0x355a00[_0xf6ca('0x3c')]=_[_0xf6ca('0x3d')](_0x7f3ba9[_0xf6ca('0x3c')]);_0x355a00[_0xf6ca('0x46')]=_[_0xf6ca('0x3e')](_0x355a00[_0xf6ca('0x3b')],_0x355a00[_0xf6ca('0x3c')]);_0xdd99f[_0xf6ca('0x3f')]=_[_0xf6ca('0x3e')](_0x355a00[_0xf6ca('0x3b')],qs[_0xf6ca('0x40')](_0x7f3ba9['query'][_0xf6ca('0x40')]));_0xdd99f[_0xf6ca('0x3f')]=_0xdd99f[_0xf6ca('0x3f')][_0xf6ca('0x41')]?_0xdd99f[_0xf6ca('0x3f')]:_0x355a00['model'];_0xdd99f[_0xf6ca('0x44')]=qs[_0xf6ca('0x45')](_0x7f3ba9[_0xf6ca('0x3c')][_0xf6ca('0x45')]);_0xdd99f[_0xf6ca('0x48')]=qs['filters'](_[_0xf6ca('0x47')](_0x7f3ba9[_0xf6ca('0x3c')],_0x355a00[_0xf6ca('0x46')]));if(_0x7f3ba9[_0xf6ca('0x3c')][_0xf6ca('0x4c')]){_0xdd99f[_0xf6ca('0x48')]=_[_0xf6ca('0x49')](_0xdd99f[_0xf6ca('0x48')],{'$or':_[_0xf6ca('0x37')](_0xdd99f[_0xf6ca('0x3f')],function(_0x58b0db){var _0x4c3ad5={};_0x4c3ad5[_0x58b0db]={'$like':'%'+_0x7f3ba9[_0xf6ca('0x3c')][_0xf6ca('0x4c')]+'%'};return _0x4c3ad5;})});}_0xdd99f=_[_0xf6ca('0x49')]({},_0xdd99f,_0x7f3ba9[_0xf6ca('0x4d')]);return _0x594d75[_0xf6ca('0x92')](_0xdd99f);}})[_0xf6ca('0x2d')](function(_0x159d0c){if(_0x159d0c){_0x346c45=_0x159d0c['length'];if(!_0x7f3ba9[_0xf6ca('0x3c')][_0xf6ca('0x42')]('nolimit')){_0xdd99f['limit']=qs[_0xf6ca('0x26')](_0x7f3ba9[_0xf6ca('0x3c')][_0xf6ca('0x26')]);_0xdd99f[_0xf6ca('0x24')]=qs[_0xf6ca('0x24')](_0x7f3ba9[_0xf6ca('0x3c')]['offset']);}return _0x594d75['getAgents'](_0xdd99f);}})[_0xf6ca('0x2d')](function(_0x69b7bf){if(_0x69b7bf){return _0x69b7bf?{'count':_0x346c45,'rows':_0x69b7bf}:null;}})[_0xf6ca('0x2d')](respondWithResult(_0x3c40bb,null))[_0xf6ca('0x4f')](handleError(_0x3c40bb,null));}; \ No newline at end of file +var _0x834b=['ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','get','SmsQueues','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','type','filter','options','SmsQueue','findAll','catch','params','keys','includeAll','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','getMembers','findOne','UserSmsQueue','User','UserId','agent','updatedAt','createdAt','rows','format','%s/%s','SIP','smsPause','getTeams','Team','ids','online','interface','flatMap','Agents','transaction','addTeams','each','forEach','emit','removeTeams','select','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','sequelize','SELECT','every','TeamId','all','union','compact','value','isEmpty','removeAgents','userSmsQueue:remove','addAgents','spread','userSmsQueue:save','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x834b,0x113));var _0xb834=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x834b[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require(_0xb834('0x0'));var rimraf=require(_0xb834('0x1'));var zipdir=require(_0xb834('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb834('0x3'));var moment=require(_0xb834('0x4'));var BPromise=require(_0xb834('0x5'));var Mustache=require(_0xb834('0x6'));var util=require(_0xb834('0x7'));var path=require(_0xb834('0x8'));var sox=require(_0xb834('0x9'));var csv=require(_0xb834('0xa'));var ejs=require(_0xb834('0xb'));var fs=require('fs');var fs_extra=require(_0xb834('0xc'));var _=require(_0xb834('0xd'));var squel=require(_0xb834('0xe'));var crypto=require(_0xb834('0xf'));var jsforce=require(_0xb834('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xb834('0xa'));var querystring=require(_0xb834('0x11'));var Papa=require(_0xb834('0x12'));var Redis=require(_0xb834('0x13'));var authService=require(_0xb834('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xb834('0x15'));var hardwareService=require(_0xb834('0x16'));var logger=require(_0xb834('0x17'))('api');var utils=require(_0xb834('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb834('0x19'));var db=require('../../mysqldb')['db'];config[_0xb834('0x1a')]=_[_0xb834('0x1b')](config[_0xb834('0x1a')],{'host':_0xb834('0x1c'),'port':0x18eb});var socket=require(_0xb834('0x1d'))(new Redis(config['redis']));require(_0xb834('0x1e'))[_0xb834('0x1f')](socket);function respondWithStatusCode(_0x36038f,_0x53515c){_0x53515c=_0x53515c||0xcc;return function(_0x1388df){if(_0x1388df){return _0x36038f[_0xb834('0x20')](_0x53515c);}return _0x36038f[_0xb834('0x21')](_0x53515c)[_0xb834('0x22')]();};}function respondWithResult(_0x45eb2c,_0x2fa219){_0x2fa219=_0x2fa219||0xc8;return function(_0x300a8c){if(_0x300a8c){return _0x45eb2c[_0xb834('0x21')](_0x2fa219)[_0xb834('0x23')](_0x300a8c);}};}function respondWithFilteredResult(_0x3b7389,_0x26ada9){return function(_0x3a0db9){if(_0x3a0db9){var _0x516826=typeof _0x26ada9[_0xb834('0x24')]===_0xb834('0x25')&&typeof _0x26ada9[_0xb834('0x26')]==='undefined';var _0x38193f=_0x3a0db9[_0xb834('0x27')];var _0x5bc247=_0x516826?0x0:_0x26ada9[_0xb834('0x24')];var _0x4226cb=_0x516826?_0x3a0db9[_0xb834('0x27')]:_0x26ada9['offset']+_0x26ada9['limit'];var _0x36600c;if(_0x4226cb>=_0x38193f){_0x4226cb=_0x38193f;_0x36600c=0xc8;}else{_0x36600c=0xce;}_0x3b7389[_0xb834('0x21')](_0x36600c);return _0x3b7389[_0xb834('0x28')](_0xb834('0x29'),_0x5bc247+'-'+_0x4226cb+'/'+_0x38193f)[_0xb834('0x23')](_0x3a0db9);}return null;};}function patchUpdates(_0x1c2bf1){return function(_0x1ce1e2){try{jsonpatch[_0xb834('0x2a')](_0x1ce1e2,_0x1c2bf1,!![]);}catch(_0x3a6a66){return BPromise['reject'](_0x3a6a66);}return _0x1ce1e2[_0xb834('0x2b')]();};}function saveUpdates(_0x531dae,_0x3b220d){return function(_0x1df4b7){if(_0x1df4b7){return _0x1df4b7['update'](_0x531dae)[_0xb834('0x2c')](function(_0x15b04c){return _0x15b04c;});}return null;};}function removeEntity(_0x414e67,_0x1d03ea){return function(_0x312e74){if(_0x312e74){return _0x312e74[_0xb834('0x2d')]()[_0xb834('0x2c')](function(){var _0x3750ce=_0x312e74[_0xb834('0x2e')]({'plain':!![]});var _0x6f8c7a=_0xb834('0x2f');return db[_0xb834('0x30')][_0xb834('0x2d')]({'where':{'type':_0x6f8c7a,'resourceId':_0x3750ce['id']}})[_0xb834('0x2c')](function(){return _0x312e74;});})['then'](function(){_0x414e67[_0xb834('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b277c,_0x225733){return function(_0x2f0239){if(!_0x2f0239){_0x3b277c[_0xb834('0x20')](0x194);}return _0x2f0239;};}function handleError(_0x12a175,_0x2cbd54){_0x2cbd54=_0x2cbd54||0x1f4;return function(_0xe0cf38){logger[_0xb834('0x31')](_0xe0cf38[_0xb834('0x32')]);if(_0xe0cf38[_0xb834('0x33')]){delete _0xe0cf38[_0xb834('0x33')];}_0x12a175['status'](_0x2cbd54)[_0xb834('0x34')](_0xe0cf38);};}exports[_0xb834('0x35')]=function(_0x399964,_0x9cf08f){var _0x21c408={},_0x3e00b0={},_0x278ea3={'count':0x0,'rows':[]};var _0x4184e8=_[_0xb834('0x36')](db['SmsQueue'][_0xb834('0x37')],function(_0x191244){return{'name':_0x191244[_0xb834('0x38')],'type':_0x191244['type']['key']};});_0x3e00b0[_0xb834('0x39')]=_[_0xb834('0x36')](_0x4184e8,'name');_0x3e00b0[_0xb834('0x3a')]=_['keys'](_0x399964[_0xb834('0x3a')]);_0x3e00b0[_0xb834('0x3b')]=_[_0xb834('0x3c')](_0x3e00b0[_0xb834('0x39')],_0x3e00b0[_0xb834('0x3a')]);_0x21c408[_0xb834('0x3d')]=_[_0xb834('0x3c')](_0x3e00b0[_0xb834('0x39')],qs['fields'](_0x399964['query'][_0xb834('0x3e')]));_0x21c408[_0xb834('0x3d')]=_0x21c408[_0xb834('0x3d')][_0xb834('0x3f')]?_0x21c408[_0xb834('0x3d')]:_0x3e00b0['model'];if(!_0x399964[_0xb834('0x3a')][_0xb834('0x40')](_0xb834('0x41'))){_0x21c408[_0xb834('0x26')]=qs['limit'](_0x399964[_0xb834('0x3a')]['limit']);_0x21c408[_0xb834('0x24')]=qs[_0xb834('0x24')](_0x399964[_0xb834('0x3a')]['offset']);}_0x21c408[_0xb834('0x42')]=qs['sort'](_0x399964[_0xb834('0x3a')][_0xb834('0x43')]);_0x21c408['where']=qs['filters'](_[_0xb834('0x44')](_0x399964[_0xb834('0x3a')],_0x3e00b0[_0xb834('0x3b')]),_0x4184e8);if(_0x399964[_0xb834('0x3a')]['filter']){_0x21c408[_0xb834('0x45')]=_[_0xb834('0x46')](_0x21c408[_0xb834('0x45')],{'$or':_[_0xb834('0x36')](_0x4184e8,function(_0x1f57f1){if(_0x1f57f1[_0xb834('0x47')]!=='VIRTUAL'){var _0x339ca1={};_0x339ca1[_0x1f57f1[_0xb834('0x33')]]={'$like':'%'+_0x399964[_0xb834('0x3a')][_0xb834('0x48')]+'%'};return _0x339ca1;}})});}_0x21c408=_['merge']({},_0x21c408,_0x399964[_0xb834('0x49')]);var _0x300260={'where':_0x21c408[_0xb834('0x45')]};return db[_0xb834('0x4a')][_0xb834('0x27')](_0x300260)[_0xb834('0x2c')](function(_0x47d10a){_0x278ea3[_0xb834('0x27')]=_0x47d10a;if(_0x399964['query']['includeAll']){_0x21c408['include']=[{'all':!![]}];}return db[_0xb834('0x4a')][_0xb834('0x4b')](_0x21c408);})[_0xb834('0x2c')](function(_0x30636c){_0x278ea3['rows']=_0x30636c;return _0x278ea3;})[_0xb834('0x2c')](respondWithFilteredResult(_0x9cf08f,_0x21c408))[_0xb834('0x4c')](handleError(_0x9cf08f,null));};exports['show']=function(_0x4c5edc,_0x6dd9bc){var _0x54d015={'raw':!![],'where':{'id':_0x4c5edc[_0xb834('0x4d')]['id']}},_0x2f3780={};_0x2f3780['model']=_[_0xb834('0x4e')](db['SmsQueue'][_0xb834('0x37')]);_0x2f3780[_0xb834('0x3a')]=_[_0xb834('0x4e')](_0x4c5edc[_0xb834('0x3a')]);_0x2f3780[_0xb834('0x3b')]=_[_0xb834('0x3c')](_0x2f3780['model'],_0x2f3780[_0xb834('0x3a')]);_0x54d015[_0xb834('0x3d')]=_[_0xb834('0x3c')](_0x2f3780['model'],qs[_0xb834('0x3e')](_0x4c5edc[_0xb834('0x3a')][_0xb834('0x3e')]));_0x54d015[_0xb834('0x3d')]=_0x54d015['attributes'][_0xb834('0x3f')]?_0x54d015['attributes']:_0x2f3780[_0xb834('0x39')];if(_0x4c5edc[_0xb834('0x3a')][_0xb834('0x4f')]){_0x54d015['include']=[{'all':!![]}];}_0x54d015=_[_0xb834('0x46')]({},_0x54d015,_0x4c5edc['options']);return db[_0xb834('0x4a')]['find'](_0x54d015)[_0xb834('0x2c')](handleEntityNotFound(_0x6dd9bc,null))[_0xb834('0x2c')](respondWithResult(_0x6dd9bc,null))['catch'](handleError(_0x6dd9bc,null));};exports['create']=function(_0x57aa59,_0x3827ad){return db[_0xb834('0x4a')][_0xb834('0x50')](_0x57aa59['body'],{})[_0xb834('0x2c')](function(_0x251033){var _0x4588c0=_0x57aa59[_0xb834('0x51')]['get']({'plain':!![]});if(!_0x4588c0)throw new Error(_0xb834('0x52'));if(_0x4588c0[_0xb834('0x53')]===_0xb834('0x51')){var _0xcfb312=_0x251033[_0xb834('0x2e')]({'plain':!![]});var _0x1e2e1a=_0xb834('0x2f');return db['UserProfileSection'][_0xb834('0x54')]({'where':{'name':_0x1e2e1a,'userProfileId':_0x4588c0[_0xb834('0x55')]},'raw':!![]})[_0xb834('0x2c')](function(_0x3be9bc){if(_0x3be9bc&&_0x3be9bc[_0xb834('0x56')]===0x0){return db[_0xb834('0x30')]['create']({'name':_0xcfb312[_0xb834('0x33')],'resourceId':_0xcfb312['id'],'type':_0x3be9bc['name'],'sectionId':_0x3be9bc['id']},{})['then'](function(){return _0x251033;});}else{return _0x251033;}})[_0xb834('0x4c')](function(_0x54abf5){logger['error'](_0xb834('0x57'),_0x54abf5);throw _0x54abf5;});}return _0x251033;})['then'](respondWithResult(_0x3827ad,0xc9))[_0xb834('0x4c')](handleError(_0x3827ad,null));};exports[_0xb834('0x58')]=function(_0x5958a9,_0x51852a){if(_0x5958a9[_0xb834('0x59')]['id']){delete _0x5958a9['body']['id'];}return db[_0xb834('0x4a')][_0xb834('0x54')]({'where':{'id':_0x5958a9[_0xb834('0x4d')]['id']}})[_0xb834('0x2c')](handleEntityNotFound(_0x51852a,null))['then'](saveUpdates(_0x5958a9[_0xb834('0x59')],null))[_0xb834('0x2c')](respondWithResult(_0x51852a,null))[_0xb834('0x4c')](handleError(_0x51852a,null));};exports['destroy']=function(_0x801a20,_0x3eda48){return db['SmsQueue'][_0xb834('0x54')]({'where':{'id':_0x801a20['params']['id']}})[_0xb834('0x2c')](handleEntityNotFound(_0x3eda48,null))[_0xb834('0x2c')](removeEntity(_0x3eda48,null))[_0xb834('0x4c')](handleError(_0x3eda48,null));};exports[_0xb834('0x5a')]=function(_0x14cfcb,_0x259b51){return db['SmsQueue'][_0xb834('0x5a')]()['then'](respondWithResult(_0x259b51,null))[_0xb834('0x4c')](handleError(_0x259b51,null));};exports[_0xb834('0x5b')]=function(_0x2dc619,_0x499340,_0x5201e7){var _0x58a770={'raw':!![],'where':{}},_0x422a14={},_0x32f5a9;return db['SmsQueue'][_0xb834('0x5c')]({'where':{'id':_0x2dc619[_0xb834('0x4d')]['id']}})[_0xb834('0x2c')](handleEntityNotFound(_0x499340,null))['then'](function(_0x5caec5){if(_0x5caec5){_0x32f5a9=_0x5caec5[_0xb834('0x2e')]({'plain':!![]});_0x422a14[_0xb834('0x39')]=_[_0xb834('0x4e')](db[_0xb834('0x5d')][_0xb834('0x37')]);_0x422a14['query']=_[_0xb834('0x4e')](_0x2dc619[_0xb834('0x3a')]);_0x422a14[_0xb834('0x3b')]=_[_0xb834('0x3c')](_0x422a14[_0xb834('0x39')],_0x422a14[_0xb834('0x3a')]);_0x58a770[_0xb834('0x3d')]=_[_0xb834('0x3c')](_0x422a14[_0xb834('0x39')],qs[_0xb834('0x3e')](_0x2dc619[_0xb834('0x3a')][_0xb834('0x3e')]));_0x58a770[_0xb834('0x3d')]=_0x58a770['attributes'][_0xb834('0x3f')]?_0x58a770['attributes']:_0x422a14['model'];if(!_0x2dc619['query']['hasOwnProperty'](_0xb834('0x41'))){_0x58a770[_0xb834('0x26')]=qs['limit'](_0x2dc619[_0xb834('0x3a')][_0xb834('0x26')]);_0x58a770[_0xb834('0x24')]=qs[_0xb834('0x24')](_0x2dc619[_0xb834('0x3a')][_0xb834('0x24')]);}_0x58a770[_0xb834('0x42')]=qs[_0xb834('0x43')](_0x2dc619[_0xb834('0x3a')][_0xb834('0x43')]);_0x58a770['where']=qs[_0xb834('0x3b')](_[_0xb834('0x44')](_0x2dc619['query'],_0x422a14[_0xb834('0x3b')]));_0x58a770[_0xb834('0x45')]['SmsQueueId']=_0x5caec5['id'];if(_0x2dc619[_0xb834('0x3a')][_0xb834('0x48')]){_0x58a770['where']=_['merge'](_0x58a770[_0xb834('0x45')],{'$or':_[_0xb834('0x36')](_0x58a770[_0xb834('0x3d')],function(_0x2fab84){var _0x246b29={};_0x246b29[_0x2fab84]={'$like':'%'+_0x2dc619[_0xb834('0x3a')][_0xb834('0x48')]+'%'};return _0x246b29;})});}_0x58a770=_[_0xb834('0x46')]({},_0x58a770,_0x2dc619[_0xb834('0x49')]);return db[_0xb834('0x5d')][_0xb834('0x4b')](_0x58a770);}})[_0xb834('0x2c')](function(_0x1d9558){if(_0x1d9558){return db[_0xb834('0x5e')]['findAndCountAll']({'where':{'id':_[_0xb834('0x36')](_0x1d9558,_0xb834('0x5f')),'role':_0xb834('0x60')},'attributes':['id',_0xb834('0x33'),'smsPause',_0xb834('0x61'),_0xb834('0x62')]});}})['then'](function(_0x4635e0){if(_0x4635e0){return{'count':_0x4635e0['count'],'rows':_[_0xb834('0x36')](_0x4635e0[_0xb834('0x63')],function(_0x359a50){return{'membername':_0x359a50[_0xb834('0x33')],'UserId':_0x359a50['id'],'queue_name':_0x32f5a9[_0xb834('0x33')],'SmsQueueId':_0x32f5a9['id'],'interface':util[_0xb834('0x64')](_0xb834('0x65'),_0xb834('0x66'),_0x359a50[_0xb834('0x33')]),'penalty':0x0,'paused':_0x359a50[_0xb834('0x67')],'createdAt':_0x359a50['createdAt'],'updatedAt':_0x359a50[_0xb834('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb834('0x2c')](respondWithFilteredResult(_0x499340,_0x58a770))[_0xb834('0x4c')](handleError(_0x499340,null));};exports[_0xb834('0x68')]=function(_0x5b57d5,_0x5ef90e,_0x1c3a9a){var _0xc364f0={};var _0x6aabc3={};var _0x2b73d5;var _0x44e266;return db[_0xb834('0x4a')][_0xb834('0x5c')]({'where':{'id':_0x5b57d5[_0xb834('0x4d')]['id']}})[_0xb834('0x2c')](handleEntityNotFound(_0x5ef90e,null))[_0xb834('0x2c')](function(_0x1e7867){if(_0x1e7867){_0x2b73d5=_0x1e7867;_0x6aabc3['model']=_[_0xb834('0x4e')](db[_0xb834('0x69')][_0xb834('0x37')]);_0x6aabc3['query']=_[_0xb834('0x4e')](_0x5b57d5['query']);_0x6aabc3[_0xb834('0x3b')]=_[_0xb834('0x3c')](_0x6aabc3[_0xb834('0x39')],_0x6aabc3[_0xb834('0x3a')]);_0xc364f0[_0xb834('0x3d')]=_[_0xb834('0x3c')](_0x6aabc3[_0xb834('0x39')],qs[_0xb834('0x3e')](_0x5b57d5[_0xb834('0x3a')][_0xb834('0x3e')]));_0xc364f0[_0xb834('0x3d')]=_0xc364f0[_0xb834('0x3d')][_0xb834('0x3f')]?_0xc364f0[_0xb834('0x3d')]:_0x6aabc3['model'];_0xc364f0[_0xb834('0x42')]=qs[_0xb834('0x43')](_0x5b57d5[_0xb834('0x3a')][_0xb834('0x43')]);_0xc364f0[_0xb834('0x45')]=qs[_0xb834('0x3b')](_['pick'](_0x5b57d5[_0xb834('0x3a')],_0x6aabc3[_0xb834('0x3b')]));if(_0x5b57d5['query']['filter']){_0xc364f0[_0xb834('0x45')]=_[_0xb834('0x46')](_0xc364f0[_0xb834('0x45')],{'$or':_['map'](_0xc364f0['attributes'],function(_0x216802){var _0x470cc2={};_0x470cc2[_0x216802]={'$like':'%'+_0x5b57d5['query'][_0xb834('0x48')]+'%'};return _0x470cc2;})});}_0xc364f0=_[_0xb834('0x46')]({},_0xc364f0,_0x5b57d5[_0xb834('0x49')]);return _0x2b73d5[_0xb834('0x68')](_0xc364f0);}})['then'](function(_0x20d5f1){if(_0x20d5f1){_0x44e266=_0x20d5f1[_0xb834('0x3f')];if(!_0x5b57d5['query'][_0xb834('0x40')](_0xb834('0x41'))){_0xc364f0[_0xb834('0x26')]=qs[_0xb834('0x26')](_0x5b57d5[_0xb834('0x3a')]['limit']);_0xc364f0[_0xb834('0x24')]=qs[_0xb834('0x24')](_0x5b57d5['query'][_0xb834('0x24')]);}return _0x2b73d5['getTeams'](_0xc364f0);}})[_0xb834('0x2c')](function(_0x2358ab){if(_0x2358ab){return _0x2358ab?{'count':_0x44e266,'rows':_0x2358ab}:null;}})[_0xb834('0x2c')](respondWithResult(_0x5ef90e,null))[_0xb834('0x4c')](handleError(_0x5ef90e,null));};exports['addTeams']=function(_0x76b2d,_0x410e28,_0x16ebc6){var _0x2cc16d=_0x76b2d['body'][_0xb834('0x6a')];return db[_0xb834('0x69')]['findAll']({'where':{'id':_0x2cc16d},'attributes':['id'],'include':[{'model':db[_0xb834('0x5e')],'as':'Agents','attributes':['id','name',_0xb834('0x6b'),'voicePause',_0xb834('0x6c')],'raw':!![]}]})[_0xb834('0x2c')](function(_0x2bead6){if(_0x2bead6){var _0x482fb9=_[_0xb834('0x6d')](_0x2bead6,function(_0x2319bc){var _0x2a3056=_0x2319bc['get']({'plain':!![]});return _0x2a3056[_0xb834('0x6e')];});return db[_0xb834('0x4a')][_0xb834('0x54')]({'where':{'id':_0x76b2d[_0xb834('0x4d')]['id']}})[_0xb834('0x2c')](function(_0x19bed7){return db['sequelize'][_0xb834('0x6f')](function(_0x52f765){return _0x19bed7[_0xb834('0x70')](_0x2cc16d,{'transaction':_0x52f765})[_0xb834('0x2c')](function(){return BPromise[_0xb834('0x71')](_0x482fb9,function(_0x43c420){return db['UserSmsQueue']['findOrCreate']({'where':{'UserId':_0x43c420['id'],'SmsQueueId':_0x76b2d['params']['id']},'transaction':_0x52f765});});})[_0xb834('0x2c')](function(){_0x482fb9[_0xb834('0x72')](function(_0x2e5d87){socket[_0xb834('0x73')]('userSmsQueue:save',{'UserId':_0x2e5d87['id'],'SmsQueueId':_0x19bed7['id']});});});});});}})[_0xb834('0x2c')](respondWithStatusCode(_0x410e28,null))['catch'](handleError(_0x410e28,null));};exports[_0xb834('0x74')]=function(_0x45db70,_0x4b05b9,_0x5c92e6){return db[_0xb834('0x69')][_0xb834('0x4b')]({'where':{'id':_0x45db70['query'][_0xb834('0x6a')]},'attributes':['id'],'include':[{'model':db[_0xb834('0x5e')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4b05b9,null))[_0xb834('0x2c')](function(_0x198827){var _0x99911=_['map'](_0x198827,'id');var _0x2bfdca=[];var _0x437c0a=[];var _0x19422f=squel[_0xb834('0x75')]();_0x19422f['field'](_0xb834('0x76'))[_0xb834('0x77')](_0xb834('0x78'),'tq')[_0xb834('0x79')](_0xb834('0x7a'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xb834('0x45')](_0xb834('0x7b'),_0x45db70[_0xb834('0x4d')]['id']);for(var _0x581a2b=0x0;_0x581a2b<_0x198827[_0xb834('0x3f')];_0x581a2b+=0x1){let _0x2bffa3=_0x198827[_0x581a2b];for(var _0x5ddfd8=0x0;_0x5ddfd8<_0x2bffa3[_0xb834('0x6e')]['length'];_0x5ddfd8+=0x1){let _0x4decc6=_0x2bffa3['Agents'][_0x5ddfd8];var _0x23934e=_0x19422f[_0xb834('0x7c')]();_0x23934e[_0xb834('0x45')](_0xb834('0x7d'),_0x4decc6['id']);_0x437c0a[_0xb834('0x7e')](db['sequelize'][_0xb834('0x3a')](_0x23934e[_0xb834('0x7f')](),{'type':db[_0xb834('0x80')]['QueryTypes'][_0xb834('0x81')]})[_0xb834('0x2c')](function(_0x30734e){if(_0x30734e[_0xb834('0x3f')]===0x1){return _0x4decc6['id'];}else{var _0x5b2520=_[_0xb834('0x82')](_[_0xb834('0x36')](_0x30734e,_0xb834('0x83')),function(_0x2962ee){return _['includes'](_0x99911,_0x2962ee);});if(_0x5b2520){return _0x4decc6['id'];}}}));}}return BPromise[_0xb834('0x84')](_0x437c0a)[_0xb834('0x2c')](function(_0x27d685){_0x2bfdca=_(_0x2bfdca)[_0xb834('0x85')](_0x27d685)[_0xb834('0x86')]()[_0xb834('0x87')]();return db[_0xb834('0x4a')][_0xb834('0x54')]({'where':{'id':_0x45db70['params']['id']}})[_0xb834('0x2c')](function(_0x1c9a8e){return db['sequelize'][_0xb834('0x6f')](function(_0x323a53){return _0x1c9a8e[_0xb834('0x74')](_0x45db70[_0xb834('0x3a')][_0xb834('0x6a')],{'transaction':_0x323a53})[_0xb834('0x2c')](function(){if(!_[_0xb834('0x88')](_0x2bfdca)){return _0x1c9a8e[_0xb834('0x89')](_0x2bfdca,{'transaction':_0x323a53});}})['then'](function(){_0x2bfdca[_0xb834('0x72')](function(_0x46fa4c){socket[_0xb834('0x73')](_0xb834('0x8a'),{'UserId':_0x46fa4c,'SmsQueueId':_0x1c9a8e['id']});});});});});});})['then'](respondWithStatusCode(_0x4b05b9,null))['catch'](handleError(_0x4b05b9,null));};exports[_0xb834('0x8b')]=function(_0x16b41d,_0xa3128,_0x48bb8e){return db['SmsQueue'][_0xb834('0x54')]({'where':{'id':_0x16b41d[_0xb834('0x4d')]['id']}})['then'](handleEntityNotFound(_0xa3128,null))[_0xb834('0x2c')](function(_0x191851){if(_0x191851){return _0x191851[_0xb834('0x8b')](_0x16b41d[_0xb834('0x59')]['ids'],_['omit'](_0x16b41d[_0xb834('0x59')],[_0xb834('0x6a'),'id'])||{})[_0xb834('0x8c')](function(_0x1b07c8){for(var _0x27e5db=0x0;_0x27e5db<_0x16b41d[_0xb834('0x59')]['ids'][_0xb834('0x3f')];_0x27e5db+=0x1){socket['emit'](_0xb834('0x8d'),{'UserId':Number(_0x16b41d['body'][_0xb834('0x6a')][_0x27e5db]),'SmsQueueId':Number(_0x16b41d['params']['id'])});}return _0x1b07c8;});}})[_0xb834('0x2c')](respondWithResult(_0xa3128,null))['catch'](handleError(_0xa3128,null));};exports[_0xb834('0x89')]=function(_0x15ad0c,_0x1530a7,_0x268314){return db[_0xb834('0x4a')][_0xb834('0x54')]({'where':{'id':_0x15ad0c[_0xb834('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1530a7,null))[_0xb834('0x2c')](function(_0x60d3f){if(_0x60d3f){return _0x60d3f[_0xb834('0x89')](_0x15ad0c[_0xb834('0x3a')][_0xb834('0x6a')])[_0xb834('0x2c')](function(){if(_['isArray'](_0x15ad0c[_0xb834('0x3a')]['ids'])){for(var _0x2fdad4=0x0;_0x2fdad4<_0x15ad0c[_0xb834('0x3a')][_0xb834('0x6a')][_0xb834('0x3f')];_0x2fdad4+=0x1){socket[_0xb834('0x73')]('userSmsQueue:remove',{'UserId':Number(_0x15ad0c[_0xb834('0x3a')][_0xb834('0x6a')][_0x2fdad4]),'SmsQueueId':Number(_0x15ad0c[_0xb834('0x4d')]['id'])});}}else{socket[_0xb834('0x73')](_0xb834('0x8a'),{'UserId':Number(_0x15ad0c[_0xb834('0x3a')][_0xb834('0x6a')]),'SmsQueueId':Number(_0x15ad0c['params']['id'])});}});}})['then'](respondWithStatusCode(_0x1530a7,null))['catch'](handleError(_0x1530a7,null));};exports[_0xb834('0x8e')]=function(_0x4cd9e5,_0xa3f748,_0x4a0ff3){var _0x2f84e3={};var _0x148e16={};var _0x57c50c;var _0xb7cdc5;return db[_0xb834('0x4a')][_0xb834('0x5c')]({'where':{'id':_0x4cd9e5[_0xb834('0x4d')]['id']}})[_0xb834('0x2c')](handleEntityNotFound(_0xa3f748,null))['then'](function(_0x42a7a0){if(_0x42a7a0){_0x57c50c=_0x42a7a0;_0x148e16['model']=_[_0xb834('0x4e')](db['User'][_0xb834('0x37')]);_0x148e16['query']=_[_0xb834('0x4e')](_0x4cd9e5[_0xb834('0x3a')]);_0x148e16[_0xb834('0x3b')]=_['intersection'](_0x148e16['model'],_0x148e16[_0xb834('0x3a')]);_0x2f84e3[_0xb834('0x3d')]=_['intersection'](_0x148e16[_0xb834('0x39')],qs[_0xb834('0x3e')](_0x4cd9e5['query'][_0xb834('0x3e')]));_0x2f84e3[_0xb834('0x3d')]=_0x2f84e3['attributes'][_0xb834('0x3f')]?_0x2f84e3['attributes']:_0x148e16['model'];_0x2f84e3[_0xb834('0x42')]=qs['sort'](_0x4cd9e5[_0xb834('0x3a')][_0xb834('0x43')]);_0x2f84e3[_0xb834('0x45')]=qs['filters'](_[_0xb834('0x44')](_0x4cd9e5[_0xb834('0x3a')],_0x148e16[_0xb834('0x3b')]));if(_0x4cd9e5[_0xb834('0x3a')][_0xb834('0x48')]){_0x2f84e3[_0xb834('0x45')]=_[_0xb834('0x46')](_0x2f84e3[_0xb834('0x45')],{'$or':_[_0xb834('0x36')](_0x2f84e3[_0xb834('0x3d')],function(_0x36a75b){var _0x218887={};_0x218887[_0x36a75b]={'$like':'%'+_0x4cd9e5['query'][_0xb834('0x48')]+'%'};return _0x218887;})});}_0x2f84e3=_[_0xb834('0x46')]({},_0x2f84e3,_0x4cd9e5[_0xb834('0x49')]);return _0x57c50c[_0xb834('0x8e')](_0x2f84e3);}})[_0xb834('0x2c')](function(_0x356d0f){if(_0x356d0f){_0xb7cdc5=_0x356d0f[_0xb834('0x3f')];if(!_0x4cd9e5['query'][_0xb834('0x40')](_0xb834('0x41'))){_0x2f84e3[_0xb834('0x26')]=qs[_0xb834('0x26')](_0x4cd9e5[_0xb834('0x3a')][_0xb834('0x26')]);_0x2f84e3[_0xb834('0x24')]=qs['offset'](_0x4cd9e5[_0xb834('0x3a')][_0xb834('0x24')]);}return _0x57c50c['getAgents'](_0x2f84e3);}})['then'](function(_0x2db8aa){if(_0x2db8aa){return _0x2db8aa?{'count':_0xb7cdc5,'rows':_0x2db8aa}:null;}})['then'](respondWithResult(_0xa3f748,null))[_0xb834('0x4c')](handleError(_0xa3f748,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index d11a6aa..c4bfaa6 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 _0x004d=['exports','events','../../mysqldb','SmsQueue','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x5e4581,_0x439910){var _0x2a2433=function(_0x12d199){while(--_0x12d199){_0x5e4581['push'](_0x5e4581['shift']());}};_0x2a2433(++_0x439910);}(_0x004d,0x83));var _0xd004=function(_0x5e5bdc,_0x4cd0a5){_0x5e5bdc=_0x5e5bdc-0x0;var _0x4469cc=_0x004d[_0x5e5bdc];return _0x4469cc;};'use strict';var EventEmitter=require(_0xd004('0x0'));var SmsQueue=require(_0xd004('0x1'))['db'][_0xd004('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xd004('0x3')](0x0);var events={'afterCreate':_0xd004('0x4'),'afterUpdate':_0xd004('0x5'),'afterDestroy':'remove'};function emitEvent(_0x241abc){return function(_0x319c9b,_0x14d71d,_0x252922){SmsQueueEvents[_0xd004('0x6')](_0x241abc+':'+_0x319c9b['id'],_0x319c9b);SmsQueueEvents[_0xd004('0x6')](_0x241abc,_0x319c9b);_0x252922(null);};}for(var e in events){if(events[_0xd004('0x7')](e)){var event=events[e];SmsQueue[_0xd004('0x8')](e,emitEvent(event));}}module[_0xd004('0x9')]=SmsQueueEvents; \ No newline at end of file +var _0xc72e=['SmsQueue','setMaxListeners','save','update','emit','exports','../../mysqldb'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xc72e,0x1c6));var _0xec72=function(_0x2d51d6,_0x4f3ff8){_0x2d51d6=_0x2d51d6-0x0;var _0x52e24c=_0xc72e[_0x2d51d6];return _0x52e24c;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0xec72('0x0'))['db'][_0xec72('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xec72('0x2')](0x0);var events={'afterCreate':_0xec72('0x3'),'afterUpdate':_0xec72('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3ed589){return function(_0x5eae18,_0x5d4044,_0x2dd5dd){SmsQueueEvents[_0xec72('0x5')](_0x3ed589+':'+_0x5eae18['id'],_0x5eae18);SmsQueueEvents[_0xec72('0x5')](_0x3ed589,_0x5eae18);_0x2dd5dd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0xec72('0x6')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 817867d..4a860f0 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 _0xf0cd=['../../config/environment','./smsQueue.attributes','exports','define','SmsQueue','sms_queues','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x246c40,_0x2eeeb9){var _0x26b95e=function(_0x21f2af){while(--_0x21f2af){_0x246c40['push'](_0x246c40['shift']());}};_0x26b95e(++_0x2eeeb9);}(_0xf0cd,0x148));var _0xdf0c=function(_0x5298e7,_0x20f266){_0x5298e7=_0x5298e7-0x0;var _0x103e14=_0xf0cd[_0x5298e7];return _0x103e14;};'use strict';var _=require(_0xdf0c('0x0'));var util=require(_0xdf0c('0x1'));var logger=require(_0xdf0c('0x2'))(_0xdf0c('0x3'));var moment=require(_0xdf0c('0x4'));var BPromise=require(_0xdf0c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdf0c('0x6'));var rimraf=require(_0xdf0c('0x7'));var config=require(_0xdf0c('0x8'));var attributes=require(_0xdf0c('0x9'));module[_0xdf0c('0xa')]=function(_0x597f9e,_0x462ab7){return _0x597f9e[_0xdf0c('0xb')](_0xdf0c('0xc'),attributes,{'tableName':_0xdf0c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x237c=['SmsQueue','api','bluebird','request-promise','path','rimraf','./smsQueue.attributes','exports'];(function(_0xfd9989,_0x14a1dd){var _0x159b58=function(_0x30f921){while(--_0x30f921){_0xfd9989['push'](_0xfd9989['shift']());}};_0x159b58(++_0x14a1dd);}(_0x237c,0x151));var _0xc237=function(_0x58dbef,_0x544d36){_0x58dbef=_0x58dbef-0x0;var _0x4f704d=_0x237c[_0x58dbef];return _0x4f704d;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xc237('0x0'));var moment=require('moment');var BPromise=require(_0xc237('0x1'));var rp=require(_0xc237('0x2'));var fs=require('fs');var path=require(_0xc237('0x3'));var rimraf=require(_0xc237('0x4'));var config=require('../../config/environment');var attributes=require(_0xc237('0x5'));module[_0xc237('0x6')]=function(_0x55808d,_0x585dc0){return _0x55808d['define'](_0xc237('0x7'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index da203e4..3d678fe 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 _0xe4c5=['SmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','SmsQueue','findAll','options','raw','where','attributes','include','model','map','then','GetSmsQueue','stringify','catch','find','ShowSmsQueue','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','http','redis','defaults','socket.io-emitter','./smsQueue.socket','register','request','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xe4c5,0x1d0));var _0x5e4c=function(_0x3254fa,_0x1761e8){_0x3254fa=_0x3254fa-0x0;var _0x29faae=_0xe4c5[_0x3254fa];return _0x29faae;};'use strict';var _=require('lodash');var util=require(_0x5e4c('0x0'));var moment=require('moment');var BPromise=require(_0x5e4c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5e4c('0x2'));var db=require(_0x5e4c('0x3'))['db'];var utils=require(_0x5e4c('0x4'));var logger=require(_0x5e4c('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x5e4c('0x6')]({'port':0x232a});config[_0x5e4c('0x7')]=_[_0x5e4c('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5e4c('0x9'))(new Redis(config['redis']));require(_0x5e4c('0xa'))[_0x5e4c('0xb')](socket);function respondWithRpcPromise(_0x667c88,_0x465f3f,_0x23641b){return new BPromise(function(_0x27c58d,_0xfcc410){return client[_0x5e4c('0xc')](_0x667c88,_0x23641b)['then'](function(_0x52e7dd){logger[_0x5e4c('0xd')](_0x5e4c('0xe'),_0x465f3f,_0x5e4c('0xf'));logger[_0x5e4c('0x10')](_0x5e4c('0x11'),_0x465f3f,'request\x20sent',JSON['stringify'](_0x52e7dd));if(_0x52e7dd['error']){if(_0x52e7dd[_0x5e4c('0x12')][_0x5e4c('0x13')]===0x1f4){logger[_0x5e4c('0x12')](_0x5e4c('0xe'),_0x465f3f,_0x52e7dd[_0x5e4c('0x12')][_0x5e4c('0x14')]);return _0xfcc410(_0x52e7dd[_0x5e4c('0x12')][_0x5e4c('0x14')]);}logger[_0x5e4c('0x12')](_0x5e4c('0xe'),_0x465f3f,_0x52e7dd[_0x5e4c('0x12')][_0x5e4c('0x14')]);return _0x27c58d(_0x52e7dd[_0x5e4c('0x12')][_0x5e4c('0x14')]);}else{logger[_0x5e4c('0xd')]('SmsQueue,\x20%s,\x20%s',_0x465f3f,_0x5e4c('0xf'));_0x27c58d(_0x52e7dd[_0x5e4c('0x15')]['message']);}})['catch'](function(_0x1ea962){logger[_0x5e4c('0x12')](_0x5e4c('0xe'),_0x465f3f,_0x1ea962);_0xfcc410(_0x1ea962);});});}exports['GetSmsQueue']=function(_0x3ad347){var _0x2e8135=this;return new Promise(function(_0x2d0254,_0x1e87f0){return db[_0x5e4c('0x16')][_0x5e4c('0x17')]({'raw':_0x3ad347[_0x5e4c('0x18')]?_0x3ad347[_0x5e4c('0x18')][_0x5e4c('0x19')]===undefined?!![]:![]:!![],'where':_0x3ad347[_0x5e4c('0x18')]?_0x3ad347[_0x5e4c('0x18')][_0x5e4c('0x1a')]||null:null,'attributes':_0x3ad347[_0x5e4c('0x18')]?_0x3ad347[_0x5e4c('0x18')][_0x5e4c('0x1b')]||null:null,'limit':_0x3ad347[_0x5e4c('0x18')]?_0x3ad347[_0x5e4c('0x18')]['limit']||null:null,'include':_0x3ad347['options']?_0x3ad347[_0x5e4c('0x18')]['include']?_['map'](_0x3ad347['options'][_0x5e4c('0x1c')],function(_0x35c587){return{'model':db[_0x35c587[_0x5e4c('0x1d')]],'as':_0x35c587['as'],'attributes':_0x35c587[_0x5e4c('0x1b')],'include':_0x35c587[_0x5e4c('0x1c')]?_[_0x5e4c('0x1e')](_0x35c587[_0x5e4c('0x1c')],function(_0x4780ef){return{'model':db[_0x4780ef[_0x5e4c('0x1d')]],'as':_0x4780ef['as'],'attributes':_0x4780ef[_0x5e4c('0x1b')],'include':_0x4780ef[_0x5e4c('0x1c')]?_[_0x5e4c('0x1e')](_0x4780ef[_0x5e4c('0x1c')],function(_0xd9e8b2){return{'model':db[_0xd9e8b2['model']],'as':_0xd9e8b2['as'],'attributes':_0xd9e8b2[_0x5e4c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x5e4c('0x1f')](function(_0x5c4532){logger[_0x5e4c('0xd')](_0x5e4c('0x20'),_0x3ad347);logger[_0x5e4c('0x10')](_0x5e4c('0x20'),_0x3ad347,JSON[_0x5e4c('0x21')](_0x5c4532));_0x2d0254(_0x5c4532);})[_0x5e4c('0x22')](function(_0x1f4c35){logger['error'](_0x5e4c('0x20'),_0x1f4c35[_0x5e4c('0x14')],_0x3ad347);_0x1e87f0(_0x2e8135[_0x5e4c('0x12')](0x1f4,_0x1f4c35[_0x5e4c('0x14')]));});});};exports['ShowSmsQueue']=function(_0x249760){var _0x5127cd=this;return new Promise(function(_0x57e450,_0x3fa800){return db[_0x5e4c('0x16')][_0x5e4c('0x23')]({'raw':_0x249760[_0x5e4c('0x18')]?_0x249760[_0x5e4c('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x249760[_0x5e4c('0x18')]?_0x249760[_0x5e4c('0x18')][_0x5e4c('0x1a')]||null:null,'attributes':_0x249760[_0x5e4c('0x18')]?_0x249760[_0x5e4c('0x18')][_0x5e4c('0x1b')]||null:null,'include':_0x249760['options']?_0x249760[_0x5e4c('0x18')]['include']?_['map'](_0x249760['options'][_0x5e4c('0x1c')],function(_0x4d1798){return{'model':db[_0x4d1798[_0x5e4c('0x1d')]],'as':_0x4d1798['as'],'attributes':_0x4d1798[_0x5e4c('0x1b')],'include':_0x4d1798[_0x5e4c('0x1c')]?_['map'](_0x4d1798[_0x5e4c('0x1c')],function(_0x2f87bc){return{'model':db[_0x2f87bc[_0x5e4c('0x1d')]],'as':_0x2f87bc['as'],'attributes':_0x2f87bc[_0x5e4c('0x1b')],'include':_0x2f87bc[_0x5e4c('0x1c')]?_[_0x5e4c('0x1e')](_0x2f87bc[_0x5e4c('0x1c')],function(_0x437287){return{'model':db[_0x437287['model']],'as':_0x437287['as'],'attributes':_0x437287['attributes']};}):[]};}):[]};}):[]:[]})[_0x5e4c('0x1f')](function(_0x363455){logger['info'](_0x5e4c('0x24'),_0x249760);logger[_0x5e4c('0x10')]('ShowSmsQueue',_0x249760,JSON[_0x5e4c('0x21')](_0x363455));_0x57e450(_0x363455);})[_0x5e4c('0x22')](function(_0x57a629){logger['error']('ShowSmsQueue',_0x57a629[_0x5e4c('0x14')],_0x249760);_0x3fa800(_0x5127cd[_0x5e4c('0x12')](0x1f4,_0x57a629[_0x5e4c('0x14')]));});});}; \ No newline at end of file +var _0x1a81=['where','debug','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','then','info','request\x20sent','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsQueue,\x20%s,\x20%s','message','result','catch','SmsQueue','findAll','options','attributes','map','include','model','GetSmsQueue','ShowSmsQueue','raw'];(function(_0x2bd589,_0x29eab4){var _0x476382=function(_0x1d226b){while(--_0x1d226b){_0x2bd589['push'](_0x2bd589['shift']());}};_0x476382(++_0x29eab4);}(_0x1a81,0x1e3));var _0x11a8=function(_0x31488b,_0x340a56){_0x31488b=_0x31488b-0x0;var _0xb14149=_0x1a81[_0x31488b];return _0xb14149;};'use strict';var _=require('lodash');var util=require(_0x11a8('0x0'));var moment=require('moment');var BPromise=require(_0x11a8('0x1'));var rs=require(_0x11a8('0x2'));var fs=require('fs');var Redis=require(_0x11a8('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x11a8('0x4'));var logger=require('../../config/logger')(_0x11a8('0x5'));var config=require(_0x11a8('0x6'));var jayson=require(_0x11a8('0x7'));var client=jayson[_0x11a8('0x8')]['http']({'port':0x232a});config[_0x11a8('0x9')]=_[_0x11a8('0xa')](config['redis'],{'host':_0x11a8('0xb'),'port':0x18eb});var socket=require(_0x11a8('0xc'))(new Redis(config['redis']));require('./smsQueue.socket')[_0x11a8('0xd')](socket);function respondWithRpcPromise(_0x4bf7d4,_0x7438f2,_0x10b5a0){return new BPromise(function(_0x140631,_0x111597){return client['request'](_0x4bf7d4,_0x10b5a0)[_0x11a8('0xe')](function(_0x18c879){logger[_0x11a8('0xf')]('SmsQueue,\x20%s,\x20%s',_0x7438f2,_0x11a8('0x10'));logger['debug'](_0x11a8('0x11'),_0x7438f2,_0x11a8('0x10'),JSON[_0x11a8('0x12')](_0x18c879));if(_0x18c879[_0x11a8('0x13')]){if(_0x18c879['error'][_0x11a8('0x14')]===0x1f4){logger[_0x11a8('0x13')](_0x11a8('0x15'),_0x7438f2,_0x18c879[_0x11a8('0x13')][_0x11a8('0x16')]);return _0x111597(_0x18c879['error'][_0x11a8('0x16')]);}logger[_0x11a8('0x13')](_0x11a8('0x15'),_0x7438f2,_0x18c879[_0x11a8('0x13')]['message']);return _0x140631(_0x18c879[_0x11a8('0x13')][_0x11a8('0x16')]);}else{logger[_0x11a8('0xf')](_0x11a8('0x15'),_0x7438f2,_0x11a8('0x10'));_0x140631(_0x18c879[_0x11a8('0x17')][_0x11a8('0x16')]);}})[_0x11a8('0x18')](function(_0x4b1229){logger[_0x11a8('0x13')]('SmsQueue,\x20%s,\x20%s',_0x7438f2,_0x4b1229);_0x111597(_0x4b1229);});});}exports['GetSmsQueue']=function(_0x16f43e){var _0x5de0bd=this;return new Promise(function(_0x177e71,_0x7eead){return db[_0x11a8('0x19')][_0x11a8('0x1a')]({'raw':_0x16f43e[_0x11a8('0x1b')]?_0x16f43e['options']['raw']===undefined?!![]:![]:!![],'where':_0x16f43e['options']?_0x16f43e[_0x11a8('0x1b')]['where']||null:null,'attributes':_0x16f43e['options']?_0x16f43e[_0x11a8('0x1b')][_0x11a8('0x1c')]||null:null,'limit':_0x16f43e['options']?_0x16f43e[_0x11a8('0x1b')]['limit']||null:null,'include':_0x16f43e[_0x11a8('0x1b')]?_0x16f43e['options']['include']?_[_0x11a8('0x1d')](_0x16f43e['options'][_0x11a8('0x1e')],function(_0x397810){return{'model':db[_0x397810[_0x11a8('0x1f')]],'as':_0x397810['as'],'attributes':_0x397810[_0x11a8('0x1c')],'include':_0x397810[_0x11a8('0x1e')]?_[_0x11a8('0x1d')](_0x397810[_0x11a8('0x1e')],function(_0x538772){return{'model':db[_0x538772[_0x11a8('0x1f')]],'as':_0x538772['as'],'attributes':_0x538772[_0x11a8('0x1c')],'include':_0x538772[_0x11a8('0x1e')]?_['map'](_0x538772['include'],function(_0xb67b16){return{'model':db[_0xb67b16[_0x11a8('0x1f')]],'as':_0xb67b16['as'],'attributes':_0xb67b16['attributes']};}):[]};}):[]};}):[]:[]})[_0x11a8('0xe')](function(_0x230ab8){logger[_0x11a8('0xf')]('GetSmsQueue',_0x16f43e);logger['debug'](_0x11a8('0x20'),_0x16f43e,JSON[_0x11a8('0x12')](_0x230ab8));_0x177e71(_0x230ab8);})[_0x11a8('0x18')](function(_0x1b965f){logger[_0x11a8('0x13')](_0x11a8('0x20'),_0x1b965f['message'],_0x16f43e);_0x7eead(_0x5de0bd['error'](0x1f4,_0x1b965f[_0x11a8('0x16')]));});});};exports[_0x11a8('0x21')]=function(_0x4c8a2c){var _0x2af7dc=this;return new Promise(function(_0x226389,_0x210bb4){return db[_0x11a8('0x19')]['find']({'raw':_0x4c8a2c[_0x11a8('0x1b')]?_0x4c8a2c[_0x11a8('0x1b')][_0x11a8('0x22')]===undefined?!![]:![]:!![],'where':_0x4c8a2c['options']?_0x4c8a2c['options'][_0x11a8('0x23')]||null:null,'attributes':_0x4c8a2c[_0x11a8('0x1b')]?_0x4c8a2c['options']['attributes']||null:null,'include':_0x4c8a2c[_0x11a8('0x1b')]?_0x4c8a2c[_0x11a8('0x1b')][_0x11a8('0x1e')]?_['map'](_0x4c8a2c['options'][_0x11a8('0x1e')],function(_0x289735){return{'model':db[_0x289735[_0x11a8('0x1f')]],'as':_0x289735['as'],'attributes':_0x289735[_0x11a8('0x1c')],'include':_0x289735[_0x11a8('0x1e')]?_[_0x11a8('0x1d')](_0x289735['include'],function(_0x1946a6){return{'model':db[_0x1946a6[_0x11a8('0x1f')]],'as':_0x1946a6['as'],'attributes':_0x1946a6[_0x11a8('0x1c')],'include':_0x1946a6['include']?_[_0x11a8('0x1d')](_0x1946a6['include'],function(_0x5d75c1){return{'model':db[_0x5d75c1[_0x11a8('0x1f')]],'as':_0x5d75c1['as'],'attributes':_0x5d75c1[_0x11a8('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x258aa5){logger[_0x11a8('0xf')]('ShowSmsQueue',_0x4c8a2c);logger[_0x11a8('0x24')](_0x11a8('0x21'),_0x4c8a2c,JSON[_0x11a8('0x12')](_0x258aa5));_0x226389(_0x258aa5);})[_0x11a8('0x18')](function(_0x5d2556){logger[_0x11a8('0x13')](_0x11a8('0x21'),_0x5d2556[_0x11a8('0x16')],_0x4c8a2c);_0x210bb4(_0x2af7dc[_0x11a8('0x13')](0x1f4,_0x5d2556[_0x11a8('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 4eca085..5a76a35 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 _0xb221=['./smsQueue.events','save','remove','update','emit','smsQueue:'];(function(_0x310504,_0x26ad95){var _0x5b36d0=function(_0x253f28){while(--_0x253f28){_0x310504['push'](_0x310504['shift']());}};_0x5b36d0(++_0x26ad95);}(_0xb221,0xba));var _0x1b22=function(_0x334564,_0x4a14ca){_0x334564=_0x334564-0x0;var _0x35f756=_0xb221[_0x334564];return _0x35f756;};'use strict';var SmsQueueEvents=require(_0x1b22('0x0'));var events=[_0x1b22('0x1'),_0x1b22('0x2'),_0x1b22('0x3')];function createListener(_0x1297c6,_0xd61075){return function(_0x1f4d40){_0xd61075[_0x1b22('0x4')](_0x1297c6,_0x1f4d40);};}function removeListener(_0x17be42,_0x19877c){return function(){SmsQueueEvents['removeListener'](_0x17be42,_0x19877c);};}exports['register']=function(_0x32fb71){for(var _0x1b975d=0x0,_0x43f3ef=events['length'];_0x1b975d<_0x43f3ef;_0x1b975d++){var _0x1768a2=events[_0x1b975d];var _0x1dda27=createListener(_0x1b22('0x5')+_0x1768a2,_0x32fb71);SmsQueueEvents['on'](_0x1768a2,_0x1dda27);}}; \ No newline at end of file +var _0xf7a8=['smsQueue:','save','remove','emit','register','length'];(function(_0xecd857,_0xe8475c){var _0x48c002=function(_0x4c6f6b){while(--_0x4c6f6b){_0xecd857['push'](_0xecd857['shift']());}};_0x48c002(++_0xe8475c);}(_0xf7a8,0x1e7));var _0x8f7a=function(_0x46698b,_0x17368a){_0x46698b=_0x46698b-0x0;var _0x500334=_0xf7a8[_0x46698b];return _0x500334;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0x8f7a('0x0'),_0x8f7a('0x1'),'update'];function createListener(_0x3394c7,_0x5b1f78){return function(_0x253504){_0x5b1f78[_0x8f7a('0x2')](_0x3394c7,_0x253504);};}function removeListener(_0x21f61c,_0x42bf6a){return function(){SmsQueueEvents['removeListener'](_0x21f61c,_0x42bf6a);};}exports[_0x8f7a('0x3')]=function(_0x1fafcd){for(var _0x187cc3=0x0,_0x3ade3c=events[_0x8f7a('0x4')];_0x187cc3<_0x3ade3c;_0x187cc3++){var _0x5b04b5=events[_0x187cc3];var _0x1859ee=createListener(_0x8f7a('0x5')+_0x5b04b5,_0x1fafcd);SmsQueueEvents['on'](_0x5b04b5,_0x1859ee);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 983e804..86c8134 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 _0xe64b=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','path'];(function(_0xcaf556,_0x3b5a91){var _0xe19350=function(_0x294772){while(--_0x294772){_0xcaf556['push'](_0xcaf556['shift']());}};_0xe19350(++_0x3b5a91);}(_0xe64b,0xc4));var _0xbe64=function(_0x27f09c,_0x396420){_0x27f09c=_0x27f09c-0x0;var _0xa89f72=_0xe64b[_0x27f09c];return _0xa89f72;};'use strict';var multer=require(_0xbe64('0x0'));var util=require('util');var path=require(_0xbe64('0x1'));var timeout=require(_0xbe64('0x2'));var express=require('express');var router=express[_0xbe64('0x3')]();var fs_extra=require(_0xbe64('0x4'));var auth=require(_0xbe64('0x5'));var interaction=require(_0xbe64('0x6'));var config=require(_0xbe64('0x7'));var controller=require(_0xbe64('0x8'));router[_0xbe64('0x9')]('/',auth[_0xbe64('0xa')](),controller['index']);router[_0xbe64('0x9')](_0xbe64('0xb'),auth['isAuthenticated'](),controller[_0xbe64('0xc')]);router[_0xbe64('0x9')](_0xbe64('0xd'),auth['isAuthenticated'](),controller[_0xbe64('0xe')]);router[_0xbe64('0xf')]('/',auth[_0xbe64('0xa')](),controller[_0xbe64('0x10')]);router[_0xbe64('0x11')](_0xbe64('0xd'),auth[_0xbe64('0xa')](),controller[_0xbe64('0x12')]);router[_0xbe64('0x13')](_0xbe64('0xd'),auth[_0xbe64('0xa')](),controller[_0xbe64('0x14')]);module[_0xbe64('0x15')]=router; \ No newline at end of file +var _0xa108=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','post','put','update','delete','destroy','exports','multer','connect-timeout'];(function(_0x32f78b,_0x4d91be){var _0x3e1bd7=function(_0x463c15){while(--_0x463c15){_0x32f78b['push'](_0x32f78b['shift']());}};_0x3e1bd7(++_0x4d91be);}(_0xa108,0x130));var _0x8a10=function(_0x2e6ae0,_0x2237f8){_0x2e6ae0=_0x2e6ae0-0x0;var _0x1af0e6=_0xa108[_0x2e6ae0];return _0x1af0e6;};'use strict';var multer=require(_0x8a10('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8a10('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8a10('0x2'));var auth=require(_0x8a10('0x3'));var interaction=require(_0x8a10('0x4'));var config=require(_0x8a10('0x5'));var controller=require('./smsQueueReport.controller');router[_0x8a10('0x6')]('/',auth[_0x8a10('0x7')](),controller['index']);router['get']('/describe',auth[_0x8a10('0x7')](),controller[_0x8a10('0x8')]);router[_0x8a10('0x6')](_0x8a10('0x9'),auth['isAuthenticated'](),controller[_0x8a10('0xa')]);router[_0x8a10('0xb')]('/',auth[_0x8a10('0x7')](),controller['create']);router[_0x8a10('0xc')]('/:id',auth[_0x8a10('0x7')](),controller[_0x8a10('0xd')]);router[_0x8a10('0xe')](_0x8a10('0x9'),auth[_0x8a10('0x7')](),controller[_0x8a10('0xf')]);module[_0x8a10('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index b6297b8..452d37b 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 _0x4dca=['sequelize','exports','STRING','DATE','moment'];(function(_0x59bf44,_0x3c0e48){var _0xedd937=function(_0x4f6d37){while(--_0x4f6d37){_0x59bf44['push'](_0x59bf44['shift']());}};_0xedd937(++_0x3c0e48);}(_0x4dca,0x14e));var _0xa4dc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4dca[_0x20a584];return _0x4b41a8;};'use strict';var moment=require(_0xa4dc('0x0'));var Sequelize=require(_0xa4dc('0x1'));module[_0xa4dc('0x2')]={'uniqueid':{'type':Sequelize[_0xa4dc('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xa4dc('0x3')]},'joinAt':{'type':Sequelize[_0xa4dc('0x4')]},'leaveAt':{'type':Sequelize[_0xa4dc('0x4')]},'acceptAt':{'type':Sequelize[_0xa4dc('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xa4dc('0x3')]}}; \ No newline at end of file +var _0xa857=['DATE','moment','STRING'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0xa857,0x73));var _0x7a85=function(_0x286af1,_0x564c1f){_0x286af1=_0x286af1-0x0;var _0x2fb073=_0xa857[_0x286af1];return _0x2fb073;};'use strict';var moment=require(_0x7a85('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x7a85('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x7a85('0x1')]},'joinAt':{'type':Sequelize[_0x7a85('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x7a85('0x2')]},'reason':{'type':Sequelize[_0x7a85('0x1')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index d7bf6c3..77dcea0 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 _0xa38b=['nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','SmsQueueReport','findAll','catch','show','params','length','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','error','send','index','map','rawAttributes','fieldName','name','query','keys','filters','intersection','model','attributes','fields'];(function(_0x1b3a9e,_0x3b6e29){var _0x53cdc2=function(_0x4b14ec){while(--_0x4b14ec){_0x1b3a9e['push'](_0x1b3a9e['shift']());}};_0x53cdc2(++_0x3b6e29);}(_0xa38b,0x12b));var _0xba38=function(_0x1cd384,_0x2df121){_0x1cd384=_0x1cd384-0x0;var _0x314f1f=_0xa38b[_0x1cd384];return _0x314f1f;};'use strict';var emlformat=require(_0xba38('0x0'));var rimraf=require(_0xba38('0x1'));var zipdir=require(_0xba38('0x2'));var jsonpatch=require(_0xba38('0x3'));var rp=require(_0xba38('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xba38('0x5'));var util=require(_0xba38('0x6'));var path=require(_0xba38('0x7'));var sox=require('sox');var csv=require(_0xba38('0x8'));var ejs=require(_0xba38('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xba38('0xa'));var squel=require(_0xba38('0xb'));var crypto=require(_0xba38('0xc'));var jsforce=require(_0xba38('0xd'));var deskjs=require(_0xba38('0xe'));var toCsv=require(_0xba38('0x8'));var querystring=require('querystring');var Papa=require(_0xba38('0xf'));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(_0xba38('0x10'));var logger=require(_0xba38('0x11'))(_0xba38('0x12'));var utils=require(_0xba38('0x13'));var config=require(_0xba38('0x14'));var licenseUtil=require(_0xba38('0x15'));var db=require(_0xba38('0x16'))['db'];function respondWithStatusCode(_0x341b87,_0x526218){_0x526218=_0x526218||0xcc;return function(_0x44928d){if(_0x44928d){return _0x341b87[_0xba38('0x17')](_0x526218);}return _0x341b87[_0xba38('0x18')](_0x526218)[_0xba38('0x19')]();};}function respondWithResult(_0x5c7183,_0x3297e3){_0x3297e3=_0x3297e3||0xc8;return function(_0x931a36){if(_0x931a36){return _0x5c7183[_0xba38('0x18')](_0x3297e3)[_0xba38('0x1a')](_0x931a36);}};}function respondWithFilteredResult(_0x11a597,_0x2576f2){return function(_0x544b75){if(_0x544b75){var _0x2ab6df=typeof _0x2576f2[_0xba38('0x1b')]==='undefined'&&typeof _0x2576f2['limit']==='undefined';var _0x58cc6d=_0x544b75[_0xba38('0x1c')];var _0x1fd932=_0x2ab6df?0x0:_0x2576f2['offset'];var _0x3d3c36=_0x2ab6df?_0x544b75[_0xba38('0x1c')]:_0x2576f2['offset']+_0x2576f2['limit'];var _0x2f3c10;if(_0x3d3c36>=_0x58cc6d){_0x3d3c36=_0x58cc6d;_0x2f3c10=0xc8;}else{_0x2f3c10=0xce;}_0x11a597[_0xba38('0x18')](_0x2f3c10);return _0x11a597[_0xba38('0x1d')](_0xba38('0x1e'),_0x1fd932+'-'+_0x3d3c36+'/'+_0x58cc6d)[_0xba38('0x1a')](_0x544b75);}return null;};}function patchUpdates(_0x351ffc){return function(_0x4757ee){try{jsonpatch[_0xba38('0x1f')](_0x4757ee,_0x351ffc,!![]);}catch(_0x42f82f){return BPromise[_0xba38('0x20')](_0x42f82f);}return _0x4757ee[_0xba38('0x21')]();};}function saveUpdates(_0x363476,_0x442174){return function(_0xf6b301){if(_0xf6b301){return _0xf6b301[_0xba38('0x22')](_0x363476)[_0xba38('0x23')](function(_0x61547a){return _0x61547a;});}return null;};}function removeEntity(_0x10f18b,_0x5b3ae6){return function(_0x394cd1){if(_0x394cd1){return _0x394cd1[_0xba38('0x24')]()[_0xba38('0x23')](function(){_0x10f18b[_0xba38('0x18')](0xcc)[_0xba38('0x19')]();});}};}function handleEntityNotFound(_0x261ff6,_0x36a762){return function(_0x3e49ad){if(!_0x3e49ad){_0x261ff6[_0xba38('0x17')](0x194);}return _0x3e49ad;};}function handleError(_0x46a2ab,_0x11803a){_0x11803a=_0x11803a||0x1f4;return function(_0x41aa8e){logger[_0xba38('0x25')](_0x41aa8e['stack']);if(_0x41aa8e['name']){delete _0x41aa8e['name'];}_0x46a2ab[_0xba38('0x18')](_0x11803a)[_0xba38('0x26')](_0x41aa8e);};}exports[_0xba38('0x27')]=function(_0xadb475,_0xbadd9d){var _0x554f30={},_0x552938={},_0x4f3127={'count':0x0,'rows':[]};var _0x30948a=_[_0xba38('0x28')](db['SmsQueueReport'][_0xba38('0x29')],function(_0x5821f8){return{'name':_0x5821f8[_0xba38('0x2a')],'type':_0x5821f8['type']['key']};});_0x552938['model']=_[_0xba38('0x28')](_0x30948a,_0xba38('0x2b'));_0x552938[_0xba38('0x2c')]=_[_0xba38('0x2d')](_0xadb475[_0xba38('0x2c')]);_0x552938[_0xba38('0x2e')]=_[_0xba38('0x2f')](_0x552938[_0xba38('0x30')],_0x552938['query']);_0x554f30[_0xba38('0x31')]=_[_0xba38('0x2f')](_0x552938['model'],qs[_0xba38('0x32')](_0xadb475[_0xba38('0x2c')][_0xba38('0x32')]));_0x554f30[_0xba38('0x31')]=_0x554f30['attributes']['length']?_0x554f30[_0xba38('0x31')]:_0x552938['model'];if(!_0xadb475[_0xba38('0x2c')]['hasOwnProperty'](_0xba38('0x33'))){_0x554f30[_0xba38('0x34')]=qs[_0xba38('0x34')](_0xadb475[_0xba38('0x2c')][_0xba38('0x34')]);_0x554f30[_0xba38('0x1b')]=qs['offset'](_0xadb475[_0xba38('0x2c')][_0xba38('0x1b')]);}_0x554f30[_0xba38('0x35')]=qs[_0xba38('0x36')](_0xadb475['query'][_0xba38('0x36')]);_0x554f30[_0xba38('0x37')]=qs[_0xba38('0x2e')](_[_0xba38('0x38')](_0xadb475[_0xba38('0x2c')],_0x552938[_0xba38('0x2e')]),_0x30948a);if(_0xadb475[_0xba38('0x2c')][_0xba38('0x39')]){_0x554f30['where']=_[_0xba38('0x3a')](_0x554f30[_0xba38('0x37')],{'$or':_[_0xba38('0x28')](_0x30948a,function(_0x31ec48){if(_0x31ec48[_0xba38('0x3b')]!==_0xba38('0x3c')){var _0x54cb99={};_0x54cb99[_0x31ec48[_0xba38('0x2b')]]={'$like':'%'+_0xadb475[_0xba38('0x2c')][_0xba38('0x39')]+'%'};return _0x54cb99;}})});}_0x554f30=_[_0xba38('0x3a')]({},_0x554f30,_0xadb475['options']);var _0xbcbc42={'where':_0x554f30[_0xba38('0x37')]};return db[_0xba38('0x3d')][_0xba38('0x1c')](_0xbcbc42)[_0xba38('0x23')](function(_0x1357f1){_0x4f3127[_0xba38('0x1c')]=_0x1357f1;if(_0xadb475[_0xba38('0x2c')]['includeAll']){_0x554f30['include']=[{'all':!![]}];}return db[_0xba38('0x3d')][_0xba38('0x3e')](_0x554f30);})[_0xba38('0x23')](function(_0x415cfa){_0x4f3127['rows']=_0x415cfa;return _0x4f3127;})[_0xba38('0x23')](respondWithFilteredResult(_0xbadd9d,_0x554f30))[_0xba38('0x3f')](handleError(_0xbadd9d,null));};exports[_0xba38('0x40')]=function(_0x37981c,_0x391357){var _0x90e3a5={'raw':!![],'where':{'id':_0x37981c[_0xba38('0x41')]['id']}},_0x51adda={};_0x51adda[_0xba38('0x30')]=_[_0xba38('0x2d')](db[_0xba38('0x3d')][_0xba38('0x29')]);_0x51adda[_0xba38('0x2c')]=_[_0xba38('0x2d')](_0x37981c[_0xba38('0x2c')]);_0x51adda['filters']=_[_0xba38('0x2f')](_0x51adda['model'],_0x51adda[_0xba38('0x2c')]);_0x90e3a5[_0xba38('0x31')]=_[_0xba38('0x2f')](_0x51adda[_0xba38('0x30')],qs['fields'](_0x37981c[_0xba38('0x2c')][_0xba38('0x32')]));_0x90e3a5[_0xba38('0x31')]=_0x90e3a5[_0xba38('0x31')][_0xba38('0x42')]?_0x90e3a5[_0xba38('0x31')]:_0x51adda['model'];if(_0x37981c[_0xba38('0x2c')]['includeAll']){_0x90e3a5['include']=[{'all':!![]}];}_0x90e3a5=_[_0xba38('0x3a')]({},_0x90e3a5,_0x37981c['options']);return db[_0xba38('0x3d')][_0xba38('0x43')](_0x90e3a5)[_0xba38('0x23')](handleEntityNotFound(_0x391357,null))[_0xba38('0x23')](respondWithResult(_0x391357,null))[_0xba38('0x3f')](handleError(_0x391357,null));};exports['create']=function(_0x531fe0,_0x554c5b){return db[_0xba38('0x3d')]['create'](_0x531fe0[_0xba38('0x44')],{})[_0xba38('0x23')](respondWithResult(_0x554c5b,0xc9))[_0xba38('0x3f')](handleError(_0x554c5b,null));};exports['update']=function(_0x5161a0,_0x4a7370){if(_0x5161a0[_0xba38('0x44')]['id']){delete _0x5161a0[_0xba38('0x44')]['id'];}return db['SmsQueueReport'][_0xba38('0x43')]({'where':{'id':_0x5161a0[_0xba38('0x41')]['id']}})[_0xba38('0x23')](handleEntityNotFound(_0x4a7370,null))[_0xba38('0x23')](saveUpdates(_0x5161a0[_0xba38('0x44')],null))['then'](respondWithResult(_0x4a7370,null))[_0xba38('0x3f')](handleError(_0x4a7370,null));};exports[_0xba38('0x24')]=function(_0x30e1ce,_0x165a82){return db[_0xba38('0x3d')][_0xba38('0x43')]({'where':{'id':_0x30e1ce[_0xba38('0x41')]['id']}})[_0xba38('0x23')](handleEntityNotFound(_0x165a82,null))[_0xba38('0x23')](removeEntity(_0x165a82,null))[_0xba38('0x3f')](handleError(_0x165a82,null));};exports[_0xba38('0x45')]=function(_0x37d6f3,_0x42ad82){return db[_0xba38('0x3d')][_0xba38('0x45')]()[_0xba38('0x23')](respondWithResult(_0x42ad82,null))[_0xba38('0x3f')](handleError(_0x42ad82,null));}; \ No newline at end of file +var _0xad5e=['params','keys','includeAll','include','create','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','error','name','SmsQueueReport','rawAttributes','fieldName','key','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','map','type','VIRTUAL','merge','options','findAll','catch','show'];(function(_0x363c68,_0x57b1f8){var _0x47aaa4=function(_0x57a3ec){while(--_0x57a3ec){_0x363c68['push'](_0x363c68['shift']());}};_0x47aaa4(++_0x57b1f8);}(_0xad5e,0x94));var _0xead5=function(_0xbaf094,_0x2f86ad){_0xbaf094=_0xbaf094-0x0;var _0x3974fd=_0xad5e[_0xbaf094];return _0x3974fd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xead5('0x0'));var zipdir=require(_0xead5('0x1'));var jsonpatch=require(_0xead5('0x2'));var rp=require(_0xead5('0x3'));var moment=require('moment');var BPromise=require(_0xead5('0x4'));var Mustache=require('mustache');var util=require(_0xead5('0x5'));var path=require('path');var sox=require(_0xead5('0x6'));var csv=require(_0xead5('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xead5('0x8'));var _=require('lodash');var squel=require(_0xead5('0x9'));var crypto=require(_0xead5('0xa'));var jsforce=require(_0xead5('0xb'));var deskjs=require(_0xead5('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xead5('0xd'));var Redis=require('ioredis');var authService=require(_0xead5('0xe'));var qs=require(_0xead5('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xead5('0x10'));var logger=require(_0xead5('0x11'))(_0xead5('0x12'));var utils=require('../../config/utils');var config=require(_0xead5('0x13'));var licenseUtil=require(_0xead5('0x14'));var db=require(_0xead5('0x15'))['db'];function respondWithStatusCode(_0x1d0b90,_0x274817){_0x274817=_0x274817||0xcc;return function(_0x24870c){if(_0x24870c){return _0x1d0b90[_0xead5('0x16')](_0x274817);}return _0x1d0b90[_0xead5('0x17')](_0x274817)[_0xead5('0x18')]();};}function respondWithResult(_0x1c8c0d,_0x2f7ee0){_0x2f7ee0=_0x2f7ee0||0xc8;return function(_0x547968){if(_0x547968){return _0x1c8c0d[_0xead5('0x17')](_0x2f7ee0)[_0xead5('0x19')](_0x547968);}};}function respondWithFilteredResult(_0x2cdb30,_0x3fa17a){return function(_0x13bbbe){if(_0x13bbbe){var _0x2abbff=typeof _0x3fa17a[_0xead5('0x1a')]===_0xead5('0x1b')&&typeof _0x3fa17a[_0xead5('0x1c')]==='undefined';var _0x4831e4=_0x13bbbe[_0xead5('0x1d')];var _0x16d40e=_0x2abbff?0x0:_0x3fa17a[_0xead5('0x1a')];var _0xb15a6f=_0x2abbff?_0x13bbbe['count']:_0x3fa17a[_0xead5('0x1a')]+_0x3fa17a['limit'];var _0x2deaeb;if(_0xb15a6f>=_0x4831e4){_0xb15a6f=_0x4831e4;_0x2deaeb=0xc8;}else{_0x2deaeb=0xce;}_0x2cdb30['status'](_0x2deaeb);return _0x2cdb30['set'](_0xead5('0x1e'),_0x16d40e+'-'+_0xb15a6f+'/'+_0x4831e4)[_0xead5('0x19')](_0x13bbbe);}return null;};}function patchUpdates(_0x5c726a){return function(_0x3aeb20){try{jsonpatch['apply'](_0x3aeb20,_0x5c726a,!![]);}catch(_0x2076c4){return BPromise[_0xead5('0x1f')](_0x2076c4);}return _0x3aeb20['save']();};}function saveUpdates(_0x1acf6a,_0x35d534){return function(_0xaabb){if(_0xaabb){return _0xaabb[_0xead5('0x20')](_0x1acf6a)[_0xead5('0x21')](function(_0x5c8084){return _0x5c8084;});}return null;};}function removeEntity(_0xc7a2ae,_0x4e1cb4){return function(_0x54287b){if(_0x54287b){return _0x54287b[_0xead5('0x22')]()[_0xead5('0x21')](function(){_0xc7a2ae['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x528e9b,_0x273884){return function(_0xda5df8){if(!_0xda5df8){_0x528e9b[_0xead5('0x16')](0x194);}return _0xda5df8;};}function handleError(_0x4376bb,_0x1d0764){_0x1d0764=_0x1d0764||0x1f4;return function(_0x279718){logger[_0xead5('0x23')](_0x279718['stack']);if(_0x279718[_0xead5('0x24')]){delete _0x279718[_0xead5('0x24')];}_0x4376bb[_0xead5('0x17')](_0x1d0764)['send'](_0x279718);};}exports['index']=function(_0x7c901b,_0x4aaf9b){var _0x1b7c9e={},_0x151d01={},_0x30c94e={'count':0x0,'rows':[]};var _0x2c4316=_['map'](db[_0xead5('0x25')][_0xead5('0x26')],function(_0x4242ef){return{'name':_0x4242ef[_0xead5('0x27')],'type':_0x4242ef['type'][_0xead5('0x28')]};});_0x151d01[_0xead5('0x29')]=_['map'](_0x2c4316,_0xead5('0x24'));_0x151d01[_0xead5('0x2a')]=_['keys'](_0x7c901b[_0xead5('0x2a')]);_0x151d01['filters']=_['intersection'](_0x151d01[_0xead5('0x29')],_0x151d01['query']);_0x1b7c9e[_0xead5('0x2b')]=_[_0xead5('0x2c')](_0x151d01[_0xead5('0x29')],qs[_0xead5('0x2d')](_0x7c901b['query'][_0xead5('0x2d')]));_0x1b7c9e[_0xead5('0x2b')]=_0x1b7c9e[_0xead5('0x2b')][_0xead5('0x2e')]?_0x1b7c9e[_0xead5('0x2b')]:_0x151d01['model'];if(!_0x7c901b['query'][_0xead5('0x2f')](_0xead5('0x30'))){_0x1b7c9e['limit']=qs[_0xead5('0x1c')](_0x7c901b[_0xead5('0x2a')][_0xead5('0x1c')]);_0x1b7c9e[_0xead5('0x1a')]=qs[_0xead5('0x1a')](_0x7c901b[_0xead5('0x2a')][_0xead5('0x1a')]);}_0x1b7c9e[_0xead5('0x31')]=qs[_0xead5('0x32')](_0x7c901b[_0xead5('0x2a')][_0xead5('0x32')]);_0x1b7c9e['where']=qs['filters'](_['pick'](_0x7c901b[_0xead5('0x2a')],_0x151d01[_0xead5('0x33')]),_0x2c4316);if(_0x7c901b['query'][_0xead5('0x34')]){_0x1b7c9e[_0xead5('0x35')]=_['merge'](_0x1b7c9e[_0xead5('0x35')],{'$or':_[_0xead5('0x36')](_0x2c4316,function(_0x1b8a6a){if(_0x1b8a6a[_0xead5('0x37')]!==_0xead5('0x38')){var _0x17388c={};_0x17388c[_0x1b8a6a['name']]={'$like':'%'+_0x7c901b[_0xead5('0x2a')][_0xead5('0x34')]+'%'};return _0x17388c;}})});}_0x1b7c9e=_[_0xead5('0x39')]({},_0x1b7c9e,_0x7c901b[_0xead5('0x3a')]);var _0xc47ec0={'where':_0x1b7c9e[_0xead5('0x35')]};return db['SmsQueueReport'][_0xead5('0x1d')](_0xc47ec0)['then'](function(_0x8f94ab){_0x30c94e['count']=_0x8f94ab;if(_0x7c901b[_0xead5('0x2a')]['includeAll']){_0x1b7c9e['include']=[{'all':!![]}];}return db[_0xead5('0x25')][_0xead5('0x3b')](_0x1b7c9e);})[_0xead5('0x21')](function(_0x5cb2a9){_0x30c94e['rows']=_0x5cb2a9;return _0x30c94e;})[_0xead5('0x21')](respondWithFilteredResult(_0x4aaf9b,_0x1b7c9e))[_0xead5('0x3c')](handleError(_0x4aaf9b,null));};exports[_0xead5('0x3d')]=function(_0x3acf2f,_0x37eea9){var _0x568b5d={'raw':!![],'where':{'id':_0x3acf2f[_0xead5('0x3e')]['id']}},_0x1ddd3d={};_0x1ddd3d[_0xead5('0x29')]=_[_0xead5('0x3f')](db[_0xead5('0x25')]['rawAttributes']);_0x1ddd3d['query']=_[_0xead5('0x3f')](_0x3acf2f['query']);_0x1ddd3d[_0xead5('0x33')]=_[_0xead5('0x2c')](_0x1ddd3d[_0xead5('0x29')],_0x1ddd3d['query']);_0x568b5d[_0xead5('0x2b')]=_[_0xead5('0x2c')](_0x1ddd3d[_0xead5('0x29')],qs['fields'](_0x3acf2f[_0xead5('0x2a')][_0xead5('0x2d')]));_0x568b5d[_0xead5('0x2b')]=_0x568b5d[_0xead5('0x2b')][_0xead5('0x2e')]?_0x568b5d['attributes']:_0x1ddd3d[_0xead5('0x29')];if(_0x3acf2f[_0xead5('0x2a')][_0xead5('0x40')]){_0x568b5d[_0xead5('0x41')]=[{'all':!![]}];}_0x568b5d=_[_0xead5('0x39')]({},_0x568b5d,_0x3acf2f[_0xead5('0x3a')]);return db[_0xead5('0x25')]['find'](_0x568b5d)[_0xead5('0x21')](handleEntityNotFound(_0x37eea9,null))[_0xead5('0x21')](respondWithResult(_0x37eea9,null))[_0xead5('0x3c')](handleError(_0x37eea9,null));};exports['create']=function(_0x5431dd,_0x596203){return db['SmsQueueReport'][_0xead5('0x42')](_0x5431dd[_0xead5('0x43')],{})[_0xead5('0x21')](respondWithResult(_0x596203,0xc9))[_0xead5('0x3c')](handleError(_0x596203,null));};exports['update']=function(_0x39cc32,_0x15c8b0){if(_0x39cc32[_0xead5('0x43')]['id']){delete _0x39cc32[_0xead5('0x43')]['id'];}return db[_0xead5('0x25')][_0xead5('0x44')]({'where':{'id':_0x39cc32[_0xead5('0x3e')]['id']}})[_0xead5('0x21')](handleEntityNotFound(_0x15c8b0,null))[_0xead5('0x21')](saveUpdates(_0x39cc32['body'],null))['then'](respondWithResult(_0x15c8b0,null))['catch'](handleError(_0x15c8b0,null));};exports[_0xead5('0x22')]=function(_0x3cf246,_0x353794){return db[_0xead5('0x25')][_0xead5('0x44')]({'where':{'id':_0x3cf246['params']['id']}})[_0xead5('0x21')](handleEntityNotFound(_0x353794,null))['then'](removeEntity(_0x353794,null))[_0xead5('0x3c')](handleError(_0x353794,null));};exports[_0xead5('0x45')]=function(_0x217321,_0x37611a){return db['SmsQueueReport'][_0xead5('0x45')]()[_0xead5('0x21')](respondWithResult(_0x37611a,null))[_0xead5('0x3c')](handleError(_0x37611a,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 24cd84d..23f77bc 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 _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid','lodash','util'];(function(_0x49b076,_0x4fb74e){var _0xa3609=function(_0x474e71){while(--_0x474e71){_0x49b076['push'](_0x49b076['shift']());}};_0xa3609(++_0x4fb74e);}(_0xe706,0xa3));var _0x6e70=function(_0x569998,_0x361b8d){_0x569998=_0x569998-0x0;var _0x2f8256=_0xe706[_0x569998];return _0x2f8256;};'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 _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','define','SmsQueueReport','uniqueid','lodash'];(function(_0x3cebba,_0xe200a5){var _0x1be3a1=function(_0x5b4084){while(--_0x5b4084){_0x3cebba['push'](_0x3cebba['shift']());}};_0x1be3a1(++_0xe200a5);}(_0xb7e7,0x121));var _0x7b7e=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xb7e7[_0x13d07a];return _0x5ee0ee;};'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 diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index ca605c2..2e61ac6 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 _0x466d=['jayson/promise','http','request','then','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','SmsQueueReport,\x20%s,\x20%s','message','info','catch','create','body','options','raw','CreateSmsQueueReport','UpdateSmsQueueReport','SmsQueueReport','attributes','limit','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1233d3,_0x4cd067){var _0x43217e=function(_0x1153ba){while(--_0x1153ba){_0x1233d3['push'](_0x1233d3['shift']());}};_0x43217e(++_0x4cd067);}(_0x466d,0x1e7));var _0xd466=function(_0x435fa1,_0x58550a){_0x435fa1=_0x435fa1-0x0;var _0x845f9f=_0x466d[_0x435fa1];return _0x845f9f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd466('0x0'));var BPromise=require(_0xd466('0x1'));var rs=require(_0xd466('0x2'));var fs=require('fs');var Redis=require(_0xd466('0x3'));var db=require(_0xd466('0x4'))['db'];var utils=require(_0xd466('0x5'));var logger=require(_0xd466('0x6'))(_0xd466('0x7'));var config=require(_0xd466('0x8'));var jayson=require(_0xd466('0x9'));var client=jayson['client'][_0xd466('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4f6973,_0x20aa5f,_0x22c960){return new BPromise(function(_0x3463e1,_0x18878e){return client[_0xd466('0xb')](_0x4f6973,_0x22c960)[_0xd466('0xc')](function(_0x1a3ecf){logger['info']('SmsQueueReport,\x20%s,\x20%s',_0x20aa5f,'request\x20sent');logger[_0xd466('0xd')](_0xd466('0xe'),_0x20aa5f,_0xd466('0xf'),JSON[_0xd466('0x10')](_0x1a3ecf));if(_0x1a3ecf['error']){if(_0x1a3ecf[_0xd466('0x11')]['code']===0x1f4){logger['error'](_0xd466('0x12'),_0x20aa5f,_0x1a3ecf[_0xd466('0x11')][_0xd466('0x13')]);return _0x18878e(_0x1a3ecf[_0xd466('0x11')][_0xd466('0x13')]);}logger[_0xd466('0x11')](_0xd466('0x12'),_0x20aa5f,_0x1a3ecf[_0xd466('0x11')][_0xd466('0x13')]);return _0x3463e1(_0x1a3ecf['error'][_0xd466('0x13')]);}else{logger[_0xd466('0x14')](_0xd466('0x12'),_0x20aa5f,_0xd466('0xf'));_0x3463e1(_0x1a3ecf['result'][_0xd466('0x13')]);}})[_0xd466('0x15')](function(_0x5d75d3){logger[_0xd466('0x11')](_0xd466('0x12'),_0x20aa5f,_0x5d75d3);_0x18878e(_0x5d75d3);});});}exports['CreateSmsQueueReport']=function(_0x540b80){var _0x199a86=this;return new Promise(function(_0x2a1485,_0xe17b81){return db['SmsQueueReport'][_0xd466('0x16')](_0x540b80[_0xd466('0x17')],{'raw':_0x540b80[_0xd466('0x18')]?_0x540b80[_0xd466('0x18')][_0xd466('0x19')]===undefined?!![]:![]:!![]})[_0xd466('0xc')](function(_0x2f6b2a){logger[_0xd466('0x14')](_0xd466('0x1a'),_0x540b80);logger[_0xd466('0xd')](_0xd466('0x1a'),_0x540b80,JSON[_0xd466('0x10')](_0x2f6b2a));_0x2a1485(_0x2f6b2a);})['catch'](function(_0x37081d){logger['error']('CreateSmsQueueReport',_0x37081d[_0xd466('0x13')],_0x540b80);_0xe17b81(_0x199a86[_0xd466('0x11')](0x1f4,_0x37081d['message']));});});};exports[_0xd466('0x1b')]=function(_0x51f82d){var _0x1c33df=this;return new Promise(function(_0x2aab2b,_0x214d4e){return db[_0xd466('0x1c')]['update'](_0x51f82d[_0xd466('0x17')],{'raw':_0x51f82d[_0xd466('0x18')]?_0x51f82d['options'][_0xd466('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x51f82d[_0xd466('0x18')]?_0x51f82d[_0xd466('0x18')]['where']||null:null,'attributes':_0x51f82d['options']?_0x51f82d[_0xd466('0x18')][_0xd466('0x1d')]||null:null,'limit':_0x51f82d[_0xd466('0x18')]?_0x51f82d[_0xd466('0x18')][_0xd466('0x1e')]||null:null})['then'](function(_0x391f80){logger['info'](_0xd466('0x1b'),_0x51f82d);logger['debug']('UpdateSmsQueueReport',_0x51f82d,JSON[_0xd466('0x10')](_0x391f80));_0x2aab2b(_0x391f80);})[_0xd466('0x15')](function(_0x5d62ad){logger[_0xd466('0x11')]('UpdateSmsQueueReport',_0x5d62ad['message'],_0x51f82d);_0x214d4e(_0x1c33df[_0xd466('0x11')](0x1f4,_0x5d62ad[_0xd466('0x13')]));});});}; \ No newline at end of file +var _0x04f3=['stringify','UpdateSmsQueueReport','update','where','attributes','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','http','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateSmsQueueReport','SmsQueueReport','create','options','then'];(function(_0x1fb5cf,_0x5d6858){var _0x2c39bc=function(_0x1d5569){while(--_0x1d5569){_0x1fb5cf['push'](_0x1fb5cf['shift']());}};_0x2c39bc(++_0x5d6858);}(_0x04f3,0x1b5));var _0x304f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x04f3[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x304f('0x0'));var util=require(_0x304f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x304f('0x2'));var fs=require('fs');var Redis=require(_0x304f('0x3'));var db=require(_0x304f('0x4'))['db'];var utils=require(_0x304f('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x304f('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x304f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5d005b,_0xa8bdbb,_0x2bad3d){return new BPromise(function(_0x11ca17,_0x422495){return client['request'](_0x5d005b,_0x2bad3d)['then'](function(_0xcd83a8){logger[_0x304f('0x8')](_0x304f('0x9'),_0xa8bdbb,_0x304f('0xa'));logger[_0x304f('0xb')](_0x304f('0xc'),_0xa8bdbb,_0x304f('0xa'),JSON['stringify'](_0xcd83a8));if(_0xcd83a8[_0x304f('0xd')]){if(_0xcd83a8[_0x304f('0xd')]['code']===0x1f4){logger[_0x304f('0xd')]('SmsQueueReport,\x20%s,\x20%s',_0xa8bdbb,_0xcd83a8[_0x304f('0xd')][_0x304f('0xe')]);return _0x422495(_0xcd83a8[_0x304f('0xd')][_0x304f('0xe')]);}logger['error'](_0x304f('0x9'),_0xa8bdbb,_0xcd83a8[_0x304f('0xd')][_0x304f('0xe')]);return _0x11ca17(_0xcd83a8[_0x304f('0xd')]['message']);}else{logger['info'](_0x304f('0x9'),_0xa8bdbb,_0x304f('0xa'));_0x11ca17(_0xcd83a8[_0x304f('0xf')][_0x304f('0xe')]);}})[_0x304f('0x10')](function(_0x31a725){logger[_0x304f('0xd')](_0x304f('0x9'),_0xa8bdbb,_0x31a725);_0x422495(_0x31a725);});});}exports[_0x304f('0x11')]=function(_0x3f54da){var _0x140b38=this;return new Promise(function(_0x149b69,_0xefd43b){return db[_0x304f('0x12')][_0x304f('0x13')](_0x3f54da['body'],{'raw':_0x3f54da[_0x304f('0x14')]?_0x3f54da[_0x304f('0x14')]['raw']===undefined?!![]:![]:!![]})[_0x304f('0x15')](function(_0x161c3f){logger[_0x304f('0x8')](_0x304f('0x11'),_0x3f54da);logger['debug'](_0x304f('0x11'),_0x3f54da,JSON[_0x304f('0x16')](_0x161c3f));_0x149b69(_0x161c3f);})[_0x304f('0x10')](function(_0x3dc35c){logger[_0x304f('0xd')](_0x304f('0x11'),_0x3dc35c[_0x304f('0xe')],_0x3f54da);_0xefd43b(_0x140b38['error'](0x1f4,_0x3dc35c[_0x304f('0xe')]));});});};exports[_0x304f('0x17')]=function(_0x3e068e){var _0x2c5fa7=this;return new Promise(function(_0x21dcac,_0x334fdd){return db[_0x304f('0x12')][_0x304f('0x18')](_0x3e068e['body'],{'raw':_0x3e068e[_0x304f('0x14')]?_0x3e068e[_0x304f('0x14')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e068e[_0x304f('0x14')]?_0x3e068e[_0x304f('0x14')][_0x304f('0x19')]||null:null,'attributes':_0x3e068e[_0x304f('0x14')]?_0x3e068e[_0x304f('0x14')][_0x304f('0x1a')]||null:null,'limit':_0x3e068e[_0x304f('0x14')]?_0x3e068e['options']['limit']||null:null})['then'](function(_0x4e8cc2){logger[_0x304f('0x8')](_0x304f('0x17'),_0x3e068e);logger[_0x304f('0xb')](_0x304f('0x17'),_0x3e068e,JSON[_0x304f('0x16')](_0x4e8cc2));_0x21dcac(_0x4e8cc2);})[_0x304f('0x10')](function(_0x544d78){logger[_0x304f('0xd')]('UpdateSmsQueueReport',_0x544d78[_0x304f('0xe')],_0x3e068e);_0x334fdd(_0x2c5fa7[_0x304f('0xd')](0x1f4,_0x544d78[_0x304f('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 52e9f05..43e6666 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 _0xeec6=['isAuthenticated','index','/describe','describe','get','show','post','/:id','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xeec6,0x1c2));var _0x6eec=function(_0x34ecbf,_0x210898){_0x34ecbf=_0x34ecbf-0x0;var _0x115f8a=_0xeec6[_0x34ecbf];return _0x115f8a;};'use strict';var multer=require(_0x6eec('0x0'));var util=require(_0x6eec('0x1'));var path=require(_0x6eec('0x2'));var timeout=require(_0x6eec('0x3'));var express=require('express');var router=express[_0x6eec('0x4')]();var fs_extra=require(_0x6eec('0x5'));var auth=require(_0x6eec('0x6'));var interaction=require(_0x6eec('0x7'));var config=require(_0x6eec('0x8'));var controller=require(_0x6eec('0x9'));router['get']('/',auth[_0x6eec('0xa')](),controller[_0x6eec('0xb')]);router['get'](_0x6eec('0xc'),auth[_0x6eec('0xa')](),controller[_0x6eec('0xd')]);router[_0x6eec('0xe')]('/:id',auth[_0x6eec('0xa')](),controller[_0x6eec('0xf')]);router[_0x6eec('0x10')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x6eec('0x11'),auth[_0x6eec('0xa')](),controller['update']);router['delete'](_0x6eec('0x11'),auth['isAuthenticated'](),controller[_0x6eec('0x12')]);module[_0x6eec('0x13')]=router; \ No newline at end of file +var _0xcb81=['connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','index','isAuthenticated','describe','create','put','/:id','update','delete','destroy','exports','multer','util'];(function(_0x45d5ef,_0x10c29b){var _0x474d19=function(_0xc182bf){while(--_0xc182bf){_0x45d5ef['push'](_0x45d5ef['shift']());}};_0x474d19(++_0x10c29b);}(_0xcb81,0x154));var _0x1cb8=function(_0x4b6830,_0x2bf6fb){_0x4b6830=_0x4b6830-0x0;var _0x239e4a=_0xcb81[_0x4b6830];return _0x239e4a;};'use strict';var multer=require(_0x1cb8('0x0'));var util=require(_0x1cb8('0x1'));var path=require('path');var timeout=require(_0x1cb8('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1cb8('0x3'));var interaction=require(_0x1cb8('0x4'));var config=require(_0x1cb8('0x5'));var controller=require(_0x1cb8('0x6'));router[_0x1cb8('0x7')]('/',auth['isAuthenticated'](),controller[_0x1cb8('0x8')]);router[_0x1cb8('0x7')]('/describe',auth[_0x1cb8('0x9')](),controller[_0x1cb8('0xa')]);router[_0x1cb8('0x7')]('/:id',auth[_0x1cb8('0x9')](),controller['show']);router['post']('/',auth[_0x1cb8('0x9')](),controller[_0x1cb8('0xb')]);router[_0x1cb8('0xc')](_0x1cb8('0xd'),auth[_0x1cb8('0x9')](),controller[_0x1cb8('0xe')]);router[_0x1cb8('0xf')](_0x1cb8('0xd'),auth['isAuthenticated'](),controller[_0x1cb8('0x10')]);module[_0x1cb8('0x11')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 2c9c231..3e0d8ab 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 _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x35194c,_0x172367){var _0x5d2c90=function(_0xe16004){while(--_0xe16004){_0x35194c['push'](_0x35194c['shift']());}};_0x5d2c90(++_0x172367);}(_0xaa88,0x137));var _0x8aa8=function(_0x307086,_0x3bfe4e){_0x307086=_0x307086-0x0;var _0x699043=_0xaa88[_0x307086];return _0x699043;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file +var _0xe706=['NOW','moment','sequelize','exports','ENUM','account','agent','queue','DATE'];(function(_0x4db66e,_0x596244){var _0x207f6c=function(_0x1f027f){while(--_0x1f027f){_0x4db66e['push'](_0x4db66e['shift']());}};_0x207f6c(++_0x596244);}(_0xe706,0xa3));var _0x6e70=function(_0x153738,_0xe704c1){_0x153738=_0x153738-0x0;var _0x3028d9=_0xe706[_0x153738];return _0x3028d9;};'use strict';var moment=require(_0x6e70('0x0'));var Sequelize=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6e70('0x3')](_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6')),'allowNull':![],'defaultValue':_0x6e70('0x6')},'transferredAt':{'type':Sequelize[_0x6e70('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x6e70('0x8')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 0f3e011..2e5a39b 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 _0x038b=['../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','name','send','index','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','params','SmsTransferReport','find','catch','body','describe','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x038b,0x113));var _0xb038=function(_0x34f9b2,_0x131926){_0x34f9b2=_0x34f9b2-0x0;var _0xc28efb=_0x038b[_0x34f9b2];return _0xc28efb;};'use strict';var emlformat=require(_0xb038('0x0'));var rimraf=require(_0xb038('0x1'));var zipdir=require(_0xb038('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb038('0x3'));var Mustache=require(_0xb038('0x4'));var util=require(_0xb038('0x5'));var path=require(_0xb038('0x6'));var sox=require(_0xb038('0x7'));var csv=require('to-csv');var ejs=require(_0xb038('0x8'));var fs=require('fs');var fs_extra=require(_0xb038('0x9'));var _=require(_0xb038('0xa'));var squel=require(_0xb038('0xb'));var crypto=require('crypto');var jsforce=require(_0xb038('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xb038('0xd'));var querystring=require(_0xb038('0xe'));var Papa=require('papaparse');var Redis=require(_0xb038('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb038('0x10'));var as=require(_0xb038('0x11'));var hardwareService=require(_0xb038('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xb038('0x13'));var config=require(_0xb038('0x14'));var licenseUtil=require(_0xb038('0x15'));var db=require(_0xb038('0x16'))['db'];function respondWithStatusCode(_0x2775ef,_0x3c8250){_0x3c8250=_0x3c8250||0xcc;return function(_0x328b95){if(_0x328b95){return _0x2775ef['sendStatus'](_0x3c8250);}return _0x2775ef['status'](_0x3c8250)[_0xb038('0x17')]();};}function respondWithResult(_0x41d15b,_0x450f19){_0x450f19=_0x450f19||0xc8;return function(_0x4ccc37){if(_0x4ccc37){return _0x41d15b[_0xb038('0x18')](_0x450f19)[_0xb038('0x19')](_0x4ccc37);}};}function respondWithFilteredResult(_0x4fb8ca,_0x543aac){return function(_0x33d53e){if(_0x33d53e){var _0x222c1e=typeof _0x543aac[_0xb038('0x1a')]===_0xb038('0x1b')&&typeof _0x543aac[_0xb038('0x1c')]===_0xb038('0x1b');var _0x3290e3=_0x33d53e[_0xb038('0x1d')];var _0x46dc9f=_0x222c1e?0x0:_0x543aac[_0xb038('0x1a')];var _0x4f4749=_0x222c1e?_0x33d53e[_0xb038('0x1d')]:_0x543aac[_0xb038('0x1a')]+_0x543aac[_0xb038('0x1c')];var _0x237939;if(_0x4f4749>=_0x3290e3){_0x4f4749=_0x3290e3;_0x237939=0xc8;}else{_0x237939=0xce;}_0x4fb8ca[_0xb038('0x18')](_0x237939);return _0x4fb8ca[_0xb038('0x1e')](_0xb038('0x1f'),_0x46dc9f+'-'+_0x4f4749+'/'+_0x3290e3)[_0xb038('0x19')](_0x33d53e);}return null;};}function patchUpdates(_0x15e89b){return function(_0x172786){try{jsonpatch[_0xb038('0x20')](_0x172786,_0x15e89b,!![]);}catch(_0x11a8ba){return BPromise[_0xb038('0x21')](_0x11a8ba);}return _0x172786[_0xb038('0x22')]();};}function saveUpdates(_0x30097b,_0x525b33){return function(_0x551857){if(_0x551857){return _0x551857[_0xb038('0x23')](_0x30097b)[_0xb038('0x24')](function(_0x1abdfe){return _0x1abdfe;});}return null;};}function removeEntity(_0x2a60e9,_0x934785){return function(_0x4c24a){if(_0x4c24a){return _0x4c24a[_0xb038('0x25')]()[_0xb038('0x24')](function(){_0x2a60e9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x18f78e,_0x1bb157){return function(_0x17b7f5){if(!_0x17b7f5){_0x18f78e[_0xb038('0x26')](0x194);}return _0x17b7f5;};}function handleError(_0x449eaa,_0x550915){_0x550915=_0x550915||0x1f4;return function(_0x441d08){logger['error'](_0x441d08['stack']);if(_0x441d08[_0xb038('0x27')]){delete _0x441d08['name'];}_0x449eaa[_0xb038('0x18')](_0x550915)[_0xb038('0x28')](_0x441d08);};}exports[_0xb038('0x29')]=function(_0x238594,_0x43c622){var _0x580dfc={},_0x481b76={},_0x319163={'count':0x0,'rows':[]};var _0x445d15=_[_0xb038('0x2a')](db['SmsTransferReport'][_0xb038('0x2b')],function(_0x4d1329){return{'name':_0x4d1329[_0xb038('0x2c')],'type':_0x4d1329[_0xb038('0x2d')]['key']};});_0x481b76['model']=_[_0xb038('0x2a')](_0x445d15,_0xb038('0x27'));_0x481b76[_0xb038('0x2e')]=_[_0xb038('0x2f')](_0x238594[_0xb038('0x2e')]);_0x481b76[_0xb038('0x30')]=_[_0xb038('0x31')](_0x481b76[_0xb038('0x32')],_0x481b76[_0xb038('0x2e')]);_0x580dfc[_0xb038('0x33')]=_[_0xb038('0x31')](_0x481b76[_0xb038('0x32')],qs[_0xb038('0x34')](_0x238594[_0xb038('0x2e')][_0xb038('0x34')]));_0x580dfc['attributes']=_0x580dfc['attributes'][_0xb038('0x35')]?_0x580dfc[_0xb038('0x33')]:_0x481b76['model'];if(!_0x238594['query'][_0xb038('0x36')](_0xb038('0x37'))){_0x580dfc[_0xb038('0x1c')]=qs[_0xb038('0x1c')](_0x238594[_0xb038('0x2e')][_0xb038('0x1c')]);_0x580dfc['offset']=qs[_0xb038('0x1a')](_0x238594[_0xb038('0x2e')][_0xb038('0x1a')]);}_0x580dfc[_0xb038('0x38')]=qs[_0xb038('0x39')](_0x238594[_0xb038('0x2e')][_0xb038('0x39')]);_0x580dfc[_0xb038('0x3a')]=qs[_0xb038('0x30')](_[_0xb038('0x3b')](_0x238594['query'],_0x481b76[_0xb038('0x30')]),_0x445d15);if(_0x238594['query'][_0xb038('0x3c')]){_0x580dfc[_0xb038('0x3a')]=_['merge'](_0x580dfc['where'],{'$or':_[_0xb038('0x2a')](_0x445d15,function(_0x2368c9){if(_0x2368c9[_0xb038('0x2d')]!==_0xb038('0x3d')){var _0x1eb76a={};_0x1eb76a[_0x2368c9[_0xb038('0x27')]]={'$like':'%'+_0x238594['query'][_0xb038('0x3c')]+'%'};return _0x1eb76a;}})});}_0x580dfc=_[_0xb038('0x3e')]({},_0x580dfc,_0x238594[_0xb038('0x3f')]);var _0x14c2ac={'where':_0x580dfc[_0xb038('0x3a')]};return db['SmsTransferReport'][_0xb038('0x1d')](_0x14c2ac)[_0xb038('0x24')](function(_0x458859){_0x319163[_0xb038('0x1d')]=_0x458859;if(_0x238594['query'][_0xb038('0x40')]){_0x580dfc[_0xb038('0x41')]=[{'all':!![]}];}return db['SmsTransferReport'][_0xb038('0x42')](_0x580dfc);})[_0xb038('0x24')](function(_0x5e537b){_0x319163[_0xb038('0x43')]=_0x5e537b;return _0x319163;})[_0xb038('0x24')](respondWithFilteredResult(_0x43c622,_0x580dfc))['catch'](handleError(_0x43c622,null));};exports['show']=function(_0x21e555,_0xe0ad65){var _0x1be3c3={'raw':!![],'where':{'id':_0x21e555[_0xb038('0x44')]['id']}},_0x49a0e6={};_0x49a0e6['model']=_[_0xb038('0x2f')](db['SmsTransferReport'][_0xb038('0x2b')]);_0x49a0e6['query']=_[_0xb038('0x2f')](_0x21e555[_0xb038('0x2e')]);_0x49a0e6[_0xb038('0x30')]=_[_0xb038('0x31')](_0x49a0e6['model'],_0x49a0e6[_0xb038('0x2e')]);_0x1be3c3[_0xb038('0x33')]=_[_0xb038('0x31')](_0x49a0e6[_0xb038('0x32')],qs[_0xb038('0x34')](_0x21e555['query'][_0xb038('0x34')]));_0x1be3c3['attributes']=_0x1be3c3[_0xb038('0x33')][_0xb038('0x35')]?_0x1be3c3[_0xb038('0x33')]:_0x49a0e6['model'];if(_0x21e555[_0xb038('0x2e')]['includeAll']){_0x1be3c3[_0xb038('0x41')]=[{'all':!![]}];}_0x1be3c3=_[_0xb038('0x3e')]({},_0x1be3c3,_0x21e555['options']);return db[_0xb038('0x45')][_0xb038('0x46')](_0x1be3c3)[_0xb038('0x24')](handleEntityNotFound(_0xe0ad65,null))[_0xb038('0x24')](respondWithResult(_0xe0ad65,null))[_0xb038('0x47')](handleError(_0xe0ad65,null));};exports['create']=function(_0x3ae5fc,_0x46ee0c){return db['SmsTransferReport']['create'](_0x3ae5fc[_0xb038('0x48')],{})[_0xb038('0x24')](respondWithResult(_0x46ee0c,0xc9))[_0xb038('0x47')](handleError(_0x46ee0c,null));};exports[_0xb038('0x23')]=function(_0x21553e,_0x477aeb){if(_0x21553e['body']['id']){delete _0x21553e[_0xb038('0x48')]['id'];}return db[_0xb038('0x45')]['find']({'where':{'id':_0x21553e[_0xb038('0x44')]['id']}})['then'](handleEntityNotFound(_0x477aeb,null))[_0xb038('0x24')](saveUpdates(_0x21553e[_0xb038('0x48')],null))['then'](respondWithResult(_0x477aeb,null))['catch'](handleError(_0x477aeb,null));};exports[_0xb038('0x25')]=function(_0x3ba2a8,_0x2bab29){return db[_0xb038('0x45')][_0xb038('0x46')]({'where':{'id':_0x3ba2a8['params']['id']}})[_0xb038('0x24')](handleEntityNotFound(_0x2bab29,null))['then'](removeEntity(_0x2bab29,null))['catch'](handleError(_0x2bab29,null));};exports[_0xb038('0x49')]=function(_0x27d195,_0x4bffdc){return db[_0xb038('0x45')]['describe']()['then'](respondWithResult(_0x4bffdc,null))[_0xb038('0x47')](handleError(_0x4bffdc,null));}; \ No newline at end of file +var _0x0c08=['reject','save','update','then','end','name','send','index','map','SmsTransferReport','fieldName','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','rawAttributes','keys','intersection','find','create','body','params','destroy','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','Content-Range'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x0c08,0x15a));var _0x80c0=function(_0x37862a,_0x2bc98e){_0x37862a=_0x37862a-0x0;var _0x5b0104=_0x0c08[_0x37862a];return _0x5b0104;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x80c0('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x80c0('0x1'));var rp=require(_0x80c0('0x2'));var moment=require(_0x80c0('0x3'));var BPromise=require(_0x80c0('0x4'));var Mustache=require(_0x80c0('0x5'));var util=require(_0x80c0('0x6'));var path=require(_0x80c0('0x7'));var sox=require(_0x80c0('0x8'));var csv=require(_0x80c0('0x9'));var ejs=require(_0x80c0('0xa'));var fs=require('fs');var fs_extra=require(_0x80c0('0xb'));var _=require(_0x80c0('0xc'));var squel=require(_0x80c0('0xd'));var crypto=require(_0x80c0('0xe'));var jsforce=require(_0x80c0('0xf'));var deskjs=require(_0x80c0('0x10'));var toCsv=require(_0x80c0('0x9'));var querystring=require(_0x80c0('0x11'));var Papa=require(_0x80c0('0x12'));var Redis=require(_0x80c0('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x80c0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x80c0('0x15'))(_0x80c0('0x16'));var utils=require('../../config/utils');var config=require(_0x80c0('0x17'));var licenseUtil=require(_0x80c0('0x18'));var db=require(_0x80c0('0x19'))['db'];function respondWithStatusCode(_0x49f022,_0x3685ef){_0x3685ef=_0x3685ef||0xcc;return function(_0x5b02c9){if(_0x5b02c9){return _0x49f022[_0x80c0('0x1a')](_0x3685ef);}return _0x49f022['status'](_0x3685ef)['end']();};}function respondWithResult(_0x586920,_0x473f51){_0x473f51=_0x473f51||0xc8;return function(_0xc53896){if(_0xc53896){return _0x586920[_0x80c0('0x1b')](_0x473f51)[_0x80c0('0x1c')](_0xc53896);}};}function respondWithFilteredResult(_0xc576a1,_0x5848a2){return function(_0x1b06dd){if(_0x1b06dd){var _0x5639ad=typeof _0x5848a2[_0x80c0('0x1d')]==='undefined'&&typeof _0x5848a2['limit']===_0x80c0('0x1e');var _0xf728ab=_0x1b06dd[_0x80c0('0x1f')];var _0x59322e=_0x5639ad?0x0:_0x5848a2[_0x80c0('0x1d')];var _0x4adbc8=_0x5639ad?_0x1b06dd['count']:_0x5848a2[_0x80c0('0x1d')]+_0x5848a2[_0x80c0('0x20')];var _0x4602c4;if(_0x4adbc8>=_0xf728ab){_0x4adbc8=_0xf728ab;_0x4602c4=0xc8;}else{_0x4602c4=0xce;}_0xc576a1[_0x80c0('0x1b')](_0x4602c4);return _0xc576a1['set'](_0x80c0('0x21'),_0x59322e+'-'+_0x4adbc8+'/'+_0xf728ab)[_0x80c0('0x1c')](_0x1b06dd);}return null;};}function patchUpdates(_0xe5795d){return function(_0x3a92c1){try{jsonpatch['apply'](_0x3a92c1,_0xe5795d,!![]);}catch(_0x5f1676){return BPromise[_0x80c0('0x22')](_0x5f1676);}return _0x3a92c1[_0x80c0('0x23')]();};}function saveUpdates(_0x28f5cd,_0x30c904){return function(_0x1a6115){if(_0x1a6115){return _0x1a6115[_0x80c0('0x24')](_0x28f5cd)['then'](function(_0xa36a0d){return _0xa36a0d;});}return null;};}function removeEntity(_0x2984e7,_0x20569b){return function(_0x48dce0){if(_0x48dce0){return _0x48dce0['destroy']()[_0x80c0('0x25')](function(){_0x2984e7[_0x80c0('0x1b')](0xcc)[_0x80c0('0x26')]();});}};}function handleEntityNotFound(_0x235a49,_0x244746){return function(_0x31977e){if(!_0x31977e){_0x235a49[_0x80c0('0x1a')](0x194);}return _0x31977e;};}function handleError(_0x295283,_0x12d6dd){_0x12d6dd=_0x12d6dd||0x1f4;return function(_0x3dab8b){logger['error'](_0x3dab8b['stack']);if(_0x3dab8b[_0x80c0('0x27')]){delete _0x3dab8b['name'];}_0x295283[_0x80c0('0x1b')](_0x12d6dd)[_0x80c0('0x28')](_0x3dab8b);};}exports[_0x80c0('0x29')]=function(_0x50efd8,_0x7a26f0){var _0x2865c9={},_0x2c2a86={},_0x4dbb7f={'count':0x0,'rows':[]};var _0x13b050=_[_0x80c0('0x2a')](db[_0x80c0('0x2b')]['rawAttributes'],function(_0x235640){return{'name':_0x235640[_0x80c0('0x2c')],'type':_0x235640[_0x80c0('0x2d')][_0x80c0('0x2e')]};});_0x2c2a86[_0x80c0('0x2f')]=_[_0x80c0('0x2a')](_0x13b050,'name');_0x2c2a86[_0x80c0('0x30')]=_['keys'](_0x50efd8[_0x80c0('0x30')]);_0x2c2a86[_0x80c0('0x31')]=_['intersection'](_0x2c2a86['model'],_0x2c2a86[_0x80c0('0x30')]);_0x2865c9[_0x80c0('0x32')]=_['intersection'](_0x2c2a86[_0x80c0('0x2f')],qs[_0x80c0('0x33')](_0x50efd8[_0x80c0('0x30')][_0x80c0('0x33')]));_0x2865c9[_0x80c0('0x32')]=_0x2865c9[_0x80c0('0x32')][_0x80c0('0x34')]?_0x2865c9[_0x80c0('0x32')]:_0x2c2a86[_0x80c0('0x2f')];if(!_0x50efd8[_0x80c0('0x30')][_0x80c0('0x35')](_0x80c0('0x36'))){_0x2865c9[_0x80c0('0x20')]=qs['limit'](_0x50efd8[_0x80c0('0x30')][_0x80c0('0x20')]);_0x2865c9['offset']=qs['offset'](_0x50efd8['query'][_0x80c0('0x1d')]);}_0x2865c9[_0x80c0('0x37')]=qs[_0x80c0('0x38')](_0x50efd8['query']['sort']);_0x2865c9[_0x80c0('0x39')]=qs[_0x80c0('0x31')](_[_0x80c0('0x3a')](_0x50efd8[_0x80c0('0x30')],_0x2c2a86[_0x80c0('0x31')]),_0x13b050);if(_0x50efd8[_0x80c0('0x30')][_0x80c0('0x3b')]){_0x2865c9[_0x80c0('0x39')]=_[_0x80c0('0x3c')](_0x2865c9[_0x80c0('0x39')],{'$or':_[_0x80c0('0x2a')](_0x13b050,function(_0x22330e){if(_0x22330e[_0x80c0('0x2d')]!==_0x80c0('0x3d')){var _0x120931={};_0x120931[_0x22330e[_0x80c0('0x27')]]={'$like':'%'+_0x50efd8['query']['filter']+'%'};return _0x120931;}})});}_0x2865c9=_['merge']({},_0x2865c9,_0x50efd8[_0x80c0('0x3e')]);var _0x1806ef={'where':_0x2865c9['where']};return db[_0x80c0('0x2b')]['count'](_0x1806ef)['then'](function(_0x30bd2b){_0x4dbb7f[_0x80c0('0x1f')]=_0x30bd2b;if(_0x50efd8[_0x80c0('0x30')][_0x80c0('0x3f')]){_0x2865c9['include']=[{'all':!![]}];}return db[_0x80c0('0x2b')]['findAll'](_0x2865c9);})[_0x80c0('0x25')](function(_0x3b2744){_0x4dbb7f[_0x80c0('0x40')]=_0x3b2744;return _0x4dbb7f;})[_0x80c0('0x25')](respondWithFilteredResult(_0x7a26f0,_0x2865c9))[_0x80c0('0x41')](handleError(_0x7a26f0,null));};exports[_0x80c0('0x42')]=function(_0x32ea12,_0x403929){var _0x1166d7={'raw':!![],'where':{'id':_0x32ea12['params']['id']}},_0x337e67={};_0x337e67['model']=_['keys'](db['SmsTransferReport'][_0x80c0('0x43')]);_0x337e67['query']=_[_0x80c0('0x44')](_0x32ea12[_0x80c0('0x30')]);_0x337e67[_0x80c0('0x31')]=_['intersection'](_0x337e67[_0x80c0('0x2f')],_0x337e67[_0x80c0('0x30')]);_0x1166d7[_0x80c0('0x32')]=_[_0x80c0('0x45')](_0x337e67[_0x80c0('0x2f')],qs[_0x80c0('0x33')](_0x32ea12[_0x80c0('0x30')][_0x80c0('0x33')]));_0x1166d7[_0x80c0('0x32')]=_0x1166d7[_0x80c0('0x32')][_0x80c0('0x34')]?_0x1166d7[_0x80c0('0x32')]:_0x337e67['model'];if(_0x32ea12[_0x80c0('0x30')]['includeAll']){_0x1166d7['include']=[{'all':!![]}];}_0x1166d7=_['merge']({},_0x1166d7,_0x32ea12[_0x80c0('0x3e')]);return db[_0x80c0('0x2b')][_0x80c0('0x46')](_0x1166d7)['then'](handleEntityNotFound(_0x403929,null))[_0x80c0('0x25')](respondWithResult(_0x403929,null))[_0x80c0('0x41')](handleError(_0x403929,null));};exports[_0x80c0('0x47')]=function(_0x51c024,_0x283152){return db[_0x80c0('0x2b')]['create'](_0x51c024['body'],{})[_0x80c0('0x25')](respondWithResult(_0x283152,0xc9))[_0x80c0('0x41')](handleError(_0x283152,null));};exports[_0x80c0('0x24')]=function(_0x1adf2b,_0x15631c){if(_0x1adf2b[_0x80c0('0x48')]['id']){delete _0x1adf2b[_0x80c0('0x48')]['id'];}return db[_0x80c0('0x2b')][_0x80c0('0x46')]({'where':{'id':_0x1adf2b[_0x80c0('0x49')]['id']}})[_0x80c0('0x25')](handleEntityNotFound(_0x15631c,null))['then'](saveUpdates(_0x1adf2b[_0x80c0('0x48')],null))[_0x80c0('0x25')](respondWithResult(_0x15631c,null))[_0x80c0('0x41')](handleError(_0x15631c,null));};exports[_0x80c0('0x4a')]=function(_0x5546fe,_0x4786ab){return db[_0x80c0('0x2b')][_0x80c0('0x46')]({'where':{'id':_0x5546fe[_0x80c0('0x49')]['id']}})[_0x80c0('0x25')](handleEntityNotFound(_0x4786ab,null))['then'](removeEntity(_0x4786ab,null))[_0x80c0('0x41')](handleError(_0x4786ab,null));};exports[_0x80c0('0x4b')]=function(_0x5aaebc,_0x3ae044){return db['SmsTransferReport'][_0x80c0('0x4b')]()[_0x80c0('0x25')](respondWithResult(_0x3ae044,null))[_0x80c0('0x41')](handleError(_0x3ae044,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index bcf6b08..e1dce8e 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 _0xf4a7=['../../config/logger','api','moment','rimraf','../../config/environment','exports','define','report_sms_transfer','uniqueid','util'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xf4a7,0x117));var _0x7f4a=function(_0x3d0303,_0xdf6b39){_0x3d0303=_0x3d0303-0x0;var _0x116762=_0xf4a7[_0x3d0303];return _0x116762;};'use strict';var _=require('lodash');var util=require(_0x7f4a('0x0'));var logger=require(_0x7f4a('0x1'))(_0x7f4a('0x2'));var moment=require(_0x7f4a('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7f4a('0x4'));var config=require(_0x7f4a('0x5'));var attributes=require('./smsTransferReport.attributes');module[_0x7f4a('0x6')]=function(_0x28585d,_0x2a9878){return _0x28585d[_0x7f4a('0x7')]('SmsTransferReport',attributes,{'tableName':_0x7f4a('0x8'),'paranoid':![],'indexes':[{'name':_0x7f4a('0x9'),'fields':[_0x7f4a('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc96c=['util','moment','bluebird','request-promise','rimraf','../../config/environment','./smsTransferReport.attributes','exports','SmsTransferReport','uniqueid'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xc96c,0x14a));var _0xcc96=function(_0x542f45,_0x37468a){_0x542f45=_0x542f45-0x0;var _0x38c609=_0xc96c[_0x542f45];return _0x38c609;};'use strict';var _=require('lodash');var util=require(_0xcc96('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xcc96('0x1'));var BPromise=require(_0xcc96('0x2'));var rp=require(_0xcc96('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcc96('0x4'));var config=require(_0xcc96('0x5'));var attributes=require(_0xcc96('0x6'));module[_0xcc96('0x7')]=function(_0x32cba9,_0x5e3ce3){return _0x32cba9['define'](_0xcc96('0x8'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0xcc96('0x9'),'fields':[_0xcc96('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index f35b1f0..bcf0c82 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 _0x4074=['jayson/promise','client','http','request','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4074,0xf0));var _0x4407=function(_0x2e3e28,_0x31c26f){_0x2e3e28=_0x2e3e28-0x0;var _0x5cf030=_0x4074[_0x2e3e28];return _0x5cf030;};'use strict';var _=require(_0x4407('0x0'));var util=require(_0x4407('0x1'));var moment=require(_0x4407('0x2'));var BPromise=require('bluebird');var rs=require(_0x4407('0x3'));var fs=require('fs');var Redis=require(_0x4407('0x4'));var db=require(_0x4407('0x5'))['db'];var utils=require(_0x4407('0x6'));var logger=require(_0x4407('0x7'))(_0x4407('0x8'));var config=require(_0x4407('0x9'));var jayson=require(_0x4407('0xa'));var client=jayson[_0x4407('0xb')][_0x4407('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4933cf,_0x988538,_0x5f0699){return new BPromise(function(_0x414f0a,_0x3c1aee){return client[_0x4407('0xd')](_0x4933cf,_0x5f0699)['then'](function(_0x5e70a5){logger['info'](_0x4407('0xe'),_0x988538,_0x4407('0xf'));logger[_0x4407('0x10')](_0x4407('0x11'),_0x988538,_0x4407('0xf'),JSON[_0x4407('0x12')](_0x5e70a5));if(_0x5e70a5[_0x4407('0x13')]){if(_0x5e70a5[_0x4407('0x13')][_0x4407('0x14')]===0x1f4){logger[_0x4407('0x13')](_0x4407('0xe'),_0x988538,_0x5e70a5['error'][_0x4407('0x15')]);return _0x3c1aee(_0x5e70a5[_0x4407('0x13')]['message']);}logger[_0x4407('0x13')]('SmsTransferReport,\x20%s,\x20%s',_0x988538,_0x5e70a5[_0x4407('0x13')][_0x4407('0x15')]);return _0x414f0a(_0x5e70a5[_0x4407('0x13')][_0x4407('0x15')]);}else{logger[_0x4407('0x16')](_0x4407('0xe'),_0x988538,_0x4407('0xf'));_0x414f0a(_0x5e70a5[_0x4407('0x17')]['message']);}})[_0x4407('0x18')](function(_0x65b20b){logger[_0x4407('0x13')](_0x4407('0xe'),_0x988538,_0x65b20b);_0x3c1aee(_0x65b20b);});});} \ No newline at end of file +var _0x9a6b=['SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x1e4005,_0x6d4dfc){var _0x168ca9=function(_0x902410){while(--_0x902410){_0x1e4005['push'](_0x1e4005['shift']());}};_0x168ca9(++_0x6d4dfc);}(_0x9a6b,0x77));var _0xb9a6=function(_0x471aa6,_0x5ec092){_0x471aa6=_0x471aa6-0x0;var _0x5c87b5=_0x9a6b[_0x471aa6];return _0x5c87b5;};'use strict';var _=require(_0xb9a6('0x0'));var util=require(_0xb9a6('0x1'));var moment=require(_0xb9a6('0x2'));var BPromise=require(_0xb9a6('0x3'));var rs=require(_0xb9a6('0x4'));var fs=require('fs');var Redis=require(_0xb9a6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb9a6('0x6'));var logger=require('../../config/logger')(_0xb9a6('0x7'));var config=require(_0xb9a6('0x8'));var jayson=require(_0xb9a6('0x9'));var client=jayson[_0xb9a6('0xa')][_0xb9a6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x555d54,_0x1b85cc,_0x2afba5){return new BPromise(function(_0x15cb33,_0x301a01){return client['request'](_0x555d54,_0x2afba5)[_0xb9a6('0xc')](function(_0x451771){logger['info'](_0xb9a6('0xd'),_0x1b85cc,_0xb9a6('0xe'));logger[_0xb9a6('0xf')](_0xb9a6('0x10'),_0x1b85cc,'request\x20sent',JSON['stringify'](_0x451771));if(_0x451771['error']){if(_0x451771[_0xb9a6('0x11')]['code']===0x1f4){logger[_0xb9a6('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x1b85cc,_0x451771[_0xb9a6('0x11')][_0xb9a6('0x12')]);return _0x301a01(_0x451771[_0xb9a6('0x11')][_0xb9a6('0x12')]);}logger[_0xb9a6('0x11')](_0xb9a6('0xd'),_0x1b85cc,_0x451771[_0xb9a6('0x11')][_0xb9a6('0x12')]);return _0x15cb33(_0x451771[_0xb9a6('0x11')]['message']);}else{logger[_0xb9a6('0x13')](_0xb9a6('0xd'),_0x1b85cc,_0xb9a6('0xe'));_0x15cb33(_0x451771[_0xb9a6('0x14')]['message']);}})[_0xb9a6('0x15')](function(_0x3d0516){logger[_0xb9a6('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x1b85cc,_0x3d0516);_0x301a01(_0x3d0516);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 3d805d3..0312eb0 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 _0x8aac=['file','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','diskStorage','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','extname','single'];(function(_0x17c244,_0x3d1155){var _0x17343e=function(_0x8c1373){while(--_0x8c1373){_0x17c244['push'](_0x17c244['shift']());}};_0x17343e(++_0x3d1155);}(_0x8aac,0xec));var _0xc8aa=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8aac[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xc8aa('0x0'));var util=require(_0xc8aa('0x1'));var path=require(_0xc8aa('0x2'));var timeout=require(_0xc8aa('0x3'));var express=require(_0xc8aa('0x4'));var router=express[_0xc8aa('0x5')]();var fs_extra=require(_0xc8aa('0x6'));var auth=require(_0xc8aa('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xc8aa('0x8'));var controller=require('./sound.controller');router[_0xc8aa('0x9')]('/',auth[_0xc8aa('0xa')](),controller[_0xc8aa('0xb')]);router['get'](_0xc8aa('0xc'),auth['isAuthenticated'](),controller[_0xc8aa('0xd')]);router[_0xc8aa('0x9')](_0xc8aa('0xe'),auth['isAuthenticated'](),controller[_0xc8aa('0xf')]);var upload=multer({'storage':multer[_0xc8aa('0x10')]({'destination':function(_0x1c680c,_0x3c0e46,_0x4ca43e){_0x4ca43e(null,path['join'](config[_0xc8aa('0x11')],_0xc8aa('0x12')));},'filename':function(_0x36a6d8,_0xa4d56,_0xad6622){_0xa4d56[_0xc8aa('0x13')]=_0xa4d56[_0xc8aa('0x13')][_0xc8aa('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xad6622(null,util[_0xc8aa('0x15')](_0xc8aa('0x16'),path['basename'](_0xa4d56['originalname'],path[_0xc8aa('0x17')](_0xa4d56[_0xc8aa('0x13')])),Date['now'](),path[_0xc8aa('0x17')](_0xa4d56[_0xc8aa('0x13')])));}})});router['post']('/',upload[_0xc8aa('0x18')](_0xc8aa('0x19')),controller['create']);router[_0xc8aa('0x1a')](_0xc8aa('0xc'),auth[_0xc8aa('0xa')](),controller['update']);router[_0xc8aa('0x1b')](_0xc8aa('0xc'),auth[_0xc8aa('0xa')](),controller[_0xc8aa('0x1b')]);module[_0xc8aa('0x1c')]=router; \ No newline at end of file +var _0xec18=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','isAuthenticated','index','get','/:id','show','/:id/download','diskStorage','join','replace','%s-%s%s','basename','originalname','extname','single','file','put','delete','exports','multer','util','path'];(function(_0x360c8f,_0x4b7958){var _0x25ec55=function(_0x105a4b){while(--_0x105a4b){_0x360c8f['push'](_0x360c8f['shift']());}};_0x25ec55(++_0x4b7958);}(_0xec18,0xa5));var _0x8ec1=function(_0x26b681,_0x445dc6){_0x26b681=_0x26b681-0x0;var _0x3a8f68=_0xec18[_0x26b681];return _0x3a8f68;};'use strict';var multer=require(_0x8ec1('0x0'));var util=require(_0x8ec1('0x1'));var path=require(_0x8ec1('0x2'));var timeout=require(_0x8ec1('0x3'));var express=require('express');var router=express[_0x8ec1('0x4')]();var fs_extra=require(_0x8ec1('0x5'));var auth=require(_0x8ec1('0x6'));var interaction=require(_0x8ec1('0x7'));var config=require(_0x8ec1('0x8'));var controller=require(_0x8ec1('0x9'));router['get']('/',auth[_0x8ec1('0xa')](),controller[_0x8ec1('0xb')]);router[_0x8ec1('0xc')](_0x8ec1('0xd'),auth[_0x8ec1('0xa')](),controller[_0x8ec1('0xe')]);router['get'](_0x8ec1('0xf'),auth[_0x8ec1('0xa')](),controller['download']);var upload=multer({'storage':multer[_0x8ec1('0x10')]({'destination':function(_0x275346,_0x3b4dc7,_0x1a41f4){_0x1a41f4(null,path[_0x8ec1('0x11')](config['root'],'server/files/sounds/original/'));},'filename':function(_0x11c5d8,_0x3cba4f,_0x1d2e26){_0x3cba4f['originalname']=_0x3cba4f['originalname'][_0x8ec1('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1d2e26(null,util['format'](_0x8ec1('0x13'),path[_0x8ec1('0x14')](_0x3cba4f[_0x8ec1('0x15')],path[_0x8ec1('0x16')](_0x3cba4f[_0x8ec1('0x15')])),Date['now'](),path[_0x8ec1('0x16')](_0x3cba4f[_0x8ec1('0x15')])));}})});router['post']('/',upload[_0x8ec1('0x17')](_0x8ec1('0x18')),controller['create']);router[_0x8ec1('0x19')](_0x8ec1('0xd'),auth[_0x8ec1('0xa')](),controller['update']);router['delete'](_0x8ec1('0xd'),auth[_0x8ec1('0xa')](),controller[_0x8ec1('0x1a')]);module[_0x8ec1('0x1b')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 8f999a1..4490db5 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 _0x5cb1=['sequelize','exports','STRING','name','FLOAT','BIGINT','INTEGER'];(function(_0x5db1ce,_0x57ab66){var _0xb62cbb=function(_0x33b753){while(--_0x33b753){_0x5db1ce['push'](_0x5db1ce['shift']());}};_0xb62cbb(++_0x57ab66);}(_0x5cb1,0x1ea));var _0x15cb=function(_0x108831,_0x5e4f70){_0x108831=_0x108831-0x0;var _0x4da77a=_0x5cb1[_0x108831];return _0x4da77a;};'use strict';var Sequelize=require(_0x15cb('0x0'));module[_0x15cb('0x1')]={'name':{'type':Sequelize[_0x15cb('0x2')],'unique':_0x15cb('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0x15cb('0x2')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0x15cb('0x2')]},'original_format':{'type':Sequelize[_0x15cb('0x2')]},'original_duration':{'type':Sequelize[_0x15cb('0x4')]},'original_sampleCount':{'type':Sequelize[_0x15cb('0x5')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0x15cb('0x5')]},'original_sampleRate':{'type':Sequelize[_0x15cb('0x6')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0x15cb('0x4')]},'converted_sampleCount':{'type':Sequelize[_0x15cb('0x5')]},'converted_channelCount':{'type':Sequelize[_0x15cb('0x6')]},'converted_bitRate':{'type':Sequelize[_0x15cb('0x5')]},'converted_sampleRate':{'type':Sequelize[_0x15cb('0x6')]}}; \ No newline at end of file +var _0xc5e7=['INTEGER','FLOAT','sequelize','exports','STRING','name','BIGINT'];(function(_0x35b7d4,_0x5a5c43){var _0x4e8cee=function(_0x66859c){while(--_0x66859c){_0x35b7d4['push'](_0x35b7d4['shift']());}};_0x4e8cee(++_0x5a5c43);}(_0xc5e7,0xd4));var _0x7c5e=function(_0x4e97f9,_0x5b0835){_0x4e97f9=_0x4e97f9-0x0;var _0x283896=_0xc5e7[_0x4e97f9];return _0x283896;};'use strict';var Sequelize=require(_0x7c5e('0x0'));module[_0x7c5e('0x1')]={'name':{'type':Sequelize[_0x7c5e('0x2')],'unique':_0x7c5e('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0x7c5e('0x2')]},'display_name':{'type':Sequelize[_0x7c5e('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x7c5e('0x2')]},'original_format':{'type':Sequelize[_0x7c5e('0x2')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0x7c5e('0x4')]},'original_channelCount':{'type':Sequelize[_0x7c5e('0x5')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0x7c5e('0x5')]},'converted_format':{'type':Sequelize[_0x7c5e('0x2')]},'converted_duration':{'type':Sequelize[_0x7c5e('0x6')]},'converted_sampleCount':{'type':Sequelize[_0x7c5e('0x4')]},'converted_channelCount':{'type':Sequelize[_0x7c5e('0x5')]},'converted_bitRate':{'type':Sequelize[_0x7c5e('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x7c5e('0x5')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index f1fcfb3..7a48ed2 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 _0xc476=['length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','includeAll','find','download','converted_format','existsSync','join','root','server/files/sounds/converted','save_name','Sequelize','Sound\x20not\x20found','format','create','basename','file','originalname','filename','extname','substring','wav','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','src','duration','original_sampleCount','sampleCount','original_channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','converted_duration','converted_sampleCount','converted_channelCount','channelCount','converted_bitRate','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','%s.%s','original_format','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','get','UserProfileResource','then','end','error','name','send','index','map','Sound','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0x1e8ee2,_0x858d8d){var _0x486fbf=function(_0x563829){while(--_0x563829){_0x1e8ee2['push'](_0x1e8ee2['shift']());}};_0x486fbf(++_0x858d8d);}(_0xc476,0x138));var _0x6c47=function(_0x5d96a8,_0x5b788d){_0x5d96a8=_0x5d96a8-0x0;var _0x2431df=_0xc476[_0x5d96a8];return _0x2431df;};'use strict';var emlformat=require(_0x6c47('0x0'));var rimraf=require(_0x6c47('0x1'));var zipdir=require(_0x6c47('0x2'));var jsonpatch=require(_0x6c47('0x3'));var rp=require('request-promise');var moment=require(_0x6c47('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6c47('0x5'));var util=require(_0x6c47('0x6'));var path=require(_0x6c47('0x7'));var sox=require(_0x6c47('0x8'));var csv=require(_0x6c47('0x9'));var ejs=require(_0x6c47('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6c47('0xb'));var squel=require(_0x6c47('0xc'));var crypto=require(_0x6c47('0xd'));var jsforce=require(_0x6c47('0xe'));var deskjs=require(_0x6c47('0xf'));var toCsv=require(_0x6c47('0x9'));var querystring=require('querystring');var Papa=require(_0x6c47('0x10'));var Redis=require(_0x6c47('0x11'));var authService=require(_0x6c47('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6c47('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x6c47('0x14'));var licenseUtil=require(_0x6c47('0x15'));var db=require(_0x6c47('0x16'))['db'];function respondWithStatusCode(_0x5c18ae,_0x369750){_0x369750=_0x369750||0xcc;return function(_0x16b3f1){if(_0x16b3f1){return _0x5c18ae[_0x6c47('0x17')](_0x369750);}return _0x5c18ae[_0x6c47('0x18')](_0x369750)['end']();};}function respondWithResult(_0x3c2c06,_0x114140){_0x114140=_0x114140||0xc8;return function(_0x15982d){if(_0x15982d){return _0x3c2c06['status'](_0x114140)['json'](_0x15982d);}};}function respondWithFilteredResult(_0xdde0bd,_0x1edb26){return function(_0x10ce9c){if(_0x10ce9c){var _0x501d2a=typeof _0x1edb26[_0x6c47('0x19')]==='undefined'&&typeof _0x1edb26[_0x6c47('0x1a')]==='undefined';var _0x420c26=_0x10ce9c[_0x6c47('0x1b')];var _0x292cf9=_0x501d2a?0x0:_0x1edb26[_0x6c47('0x19')];var _0x5e0800=_0x501d2a?_0x10ce9c[_0x6c47('0x1b')]:_0x1edb26['offset']+_0x1edb26[_0x6c47('0x1a')];var _0x3f41ca;if(_0x5e0800>=_0x420c26){_0x5e0800=_0x420c26;_0x3f41ca=0xc8;}else{_0x3f41ca=0xce;}_0xdde0bd[_0x6c47('0x18')](_0x3f41ca);return _0xdde0bd[_0x6c47('0x1c')](_0x6c47('0x1d'),_0x292cf9+'-'+_0x5e0800+'/'+_0x420c26)[_0x6c47('0x1e')](_0x10ce9c);}return null;};}function patchUpdates(_0x537489){return function(_0x2da2ab){try{jsonpatch[_0x6c47('0x1f')](_0x2da2ab,_0x537489,!![]);}catch(_0x4608db){return BPromise[_0x6c47('0x20')](_0x4608db);}return _0x2da2ab[_0x6c47('0x21')]();};}function saveUpdates(_0x21abc7,_0x345060){return function(_0x3c2d31){if(_0x3c2d31){return _0x3c2d31[_0x6c47('0x22')](_0x21abc7)['then'](function(_0x2c12ab){return _0x2c12ab;});}return null;};}function removeEntity(_0x4eb205,_0x7d7394){return function(_0x29255d){if(_0x29255d){return _0x29255d[_0x6c47('0x23')]()['then'](function(){var _0x43c531=_0x29255d[_0x6c47('0x24')]({'plain':!![]});var _0x539004='Sounds';return db[_0x6c47('0x25')][_0x6c47('0x23')]({'where':{'type':_0x539004,'resourceId':_0x43c531['id']}})[_0x6c47('0x26')](function(){return _0x29255d;});})[_0x6c47('0x26')](function(){_0x4eb205[_0x6c47('0x18')](0xcc)[_0x6c47('0x27')]();});}};}function handleEntityNotFound(_0x9e91d8,_0x435b27){return function(_0x26fa26){if(!_0x26fa26){_0x9e91d8[_0x6c47('0x17')](0x194);}return _0x26fa26;};}function handleError(_0x12997f,_0x41542f){_0x41542f=_0x41542f||0x1f4;return function(_0x40521){logger[_0x6c47('0x28')](_0x40521['stack']);if(_0x40521[_0x6c47('0x29')]){delete _0x40521[_0x6c47('0x29')];}_0x12997f[_0x6c47('0x18')](_0x41542f)[_0x6c47('0x2a')](_0x40521);};}exports[_0x6c47('0x2b')]=function(_0x5455fb,_0x49fa8e){var _0x313250={},_0x474434={},_0x12603d={'count':0x0,'rows':[]};var _0x4af516=_[_0x6c47('0x2c')](db[_0x6c47('0x2d')][_0x6c47('0x2e')],function(_0x13fa9e){return{'name':_0x13fa9e[_0x6c47('0x2f')],'type':_0x13fa9e[_0x6c47('0x30')][_0x6c47('0x31')]};});_0x474434[_0x6c47('0x32')]=_[_0x6c47('0x2c')](_0x4af516,'name');_0x474434[_0x6c47('0x33')]=_[_0x6c47('0x34')](_0x5455fb[_0x6c47('0x33')]);_0x474434[_0x6c47('0x35')]=_[_0x6c47('0x36')](_0x474434['model'],_0x474434[_0x6c47('0x33')]);_0x313250[_0x6c47('0x37')]=_[_0x6c47('0x36')](_0x474434[_0x6c47('0x32')],qs['fields'](_0x5455fb['query'][_0x6c47('0x38')]));_0x313250[_0x6c47('0x37')]=_0x313250[_0x6c47('0x37')][_0x6c47('0x39')]?_0x313250[_0x6c47('0x37')]:_0x474434[_0x6c47('0x32')];if(!_0x5455fb[_0x6c47('0x33')][_0x6c47('0x3a')]('nolimit')){_0x313250[_0x6c47('0x1a')]=qs['limit'](_0x5455fb[_0x6c47('0x33')][_0x6c47('0x1a')]);_0x313250[_0x6c47('0x19')]=qs[_0x6c47('0x19')](_0x5455fb[_0x6c47('0x33')][_0x6c47('0x19')]);}_0x313250['order']=qs[_0x6c47('0x3b')](_0x5455fb['query']['sort']);_0x313250[_0x6c47('0x3c')]=qs[_0x6c47('0x35')](_[_0x6c47('0x3d')](_0x5455fb[_0x6c47('0x33')],_0x474434[_0x6c47('0x35')]),_0x4af516);if(_0x5455fb['query'][_0x6c47('0x3e')]){_0x313250[_0x6c47('0x3c')]=_[_0x6c47('0x3f')](_0x313250[_0x6c47('0x3c')],{'$or':_[_0x6c47('0x2c')](_0x4af516,function(_0x21ebca){if(_0x21ebca[_0x6c47('0x30')]!==_0x6c47('0x40')){var _0x122333={};_0x122333[_0x21ebca[_0x6c47('0x29')]]={'$like':'%'+_0x5455fb['query'][_0x6c47('0x3e')]+'%'};return _0x122333;}})});}_0x313250=_[_0x6c47('0x3f')]({},_0x313250,_0x5455fb['options']);var _0x29beb8={'where':_0x313250[_0x6c47('0x3c')]};return db[_0x6c47('0x2d')][_0x6c47('0x1b')](_0x29beb8)[_0x6c47('0x26')](function(_0x2d48e5){_0x12603d['count']=_0x2d48e5;if(_0x5455fb[_0x6c47('0x33')]['includeAll']){_0x313250[_0x6c47('0x41')]=[{'all':!![]}];}return db[_0x6c47('0x2d')][_0x6c47('0x42')](_0x313250);})[_0x6c47('0x26')](function(_0x3a7f98){_0x12603d[_0x6c47('0x43')]=_0x3a7f98;return _0x12603d;})[_0x6c47('0x26')](respondWithFilteredResult(_0x49fa8e,_0x313250))[_0x6c47('0x44')](handleError(_0x49fa8e,null));};exports[_0x6c47('0x45')]=function(_0xcc0476,_0x4f22b6){var _0x28ecaa={'raw':!![],'where':{'id':_0xcc0476[_0x6c47('0x46')]['id']}},_0xf2e85f={};_0xf2e85f[_0x6c47('0x32')]=_[_0x6c47('0x34')](db[_0x6c47('0x2d')][_0x6c47('0x2e')]);_0xf2e85f['query']=_[_0x6c47('0x34')](_0xcc0476[_0x6c47('0x33')]);_0xf2e85f[_0x6c47('0x35')]=_[_0x6c47('0x36')](_0xf2e85f[_0x6c47('0x32')],_0xf2e85f[_0x6c47('0x33')]);_0x28ecaa[_0x6c47('0x37')]=_['intersection'](_0xf2e85f['model'],qs[_0x6c47('0x38')](_0xcc0476['query'][_0x6c47('0x38')]));_0x28ecaa[_0x6c47('0x37')]=_0x28ecaa[_0x6c47('0x37')]['length']?_0x28ecaa['attributes']:_0xf2e85f[_0x6c47('0x32')];if(_0xcc0476[_0x6c47('0x33')][_0x6c47('0x47')]){_0x28ecaa['include']=[{'all':!![]}];}_0x28ecaa=_[_0x6c47('0x3f')]({},_0x28ecaa,_0xcc0476['options']);return db[_0x6c47('0x2d')][_0x6c47('0x48')](_0x28ecaa)['then'](handleEntityNotFound(_0x4f22b6,null))[_0x6c47('0x26')](respondWithResult(_0x4f22b6,null))['catch'](handleError(_0x4f22b6,null));};exports[_0x6c47('0x49')]=function(_0x52b8a3,_0x13b4f0,_0x3a6ed7){return db['Sound']['find']({'where':{'id':_0x52b8a3[_0x6c47('0x46')]['id']},'attributes':[_0x6c47('0x29'),'save_name',_0x6c47('0x4a')],'raw':!![]})['then'](handleEntityNotFound(_0x13b4f0,null))[_0x6c47('0x26')](function(_0x1d632d){if(_0x1d632d){if(!fs[_0x6c47('0x4b')](path[_0x6c47('0x4c')](config[_0x6c47('0x4d')],_0x6c47('0x4e'),_0x1d632d[_0x6c47('0x4f')]+'.'+_0x1d632d[_0x6c47('0x4a')]))){throw new db[(_0x6c47('0x50'))]['ValidationError'](_0x6c47('0x51'));}return _0x13b4f0[_0x6c47('0x49')](path[_0x6c47('0x4c')](config[_0x6c47('0x4d')],_0x6c47('0x4e'),util[_0x6c47('0x52')]('%s.%s',_0x1d632d[_0x6c47('0x4f')],_0x1d632d['converted_format'])),util['format']('%s.%s',_0x1d632d[_0x6c47('0x29')],_0x1d632d[_0x6c47('0x4a')]));}return null;})[_0x6c47('0x44')](handleError(_0x13b4f0,null));};exports[_0x6c47('0x53')]=function(_0x28989c,_0x269825,_0x20062e){var _0xf20130={'name':path[_0x6c47('0x54')](_0x28989c[_0x6c47('0x55')][_0x6c47('0x56')],path['extname'](_0x28989c[_0x6c47('0x55')][_0x6c47('0x56')])),'save_name':path[_0x6c47('0x54')](_0x28989c[_0x6c47('0x55')][_0x6c47('0x57')],path[_0x6c47('0x58')](_0x28989c[_0x6c47('0x55')][_0x6c47('0x57')])),'original_format':path[_0x6c47('0x58')](_0x28989c[_0x6c47('0x55')][_0x6c47('0x56')])[_0x6c47('0x59')](0x1),'converted_format':_0x6c47('0x5a')};var _0x53d578=path[_0x6c47('0x4c')](config['root'],'server/files/sounds/original',_0x28989c['file'][_0x6c47('0x57')]);var _0x59b8a7=path[_0x6c47('0x4c')](config[_0x6c47('0x4d')],_0x6c47('0x4e'),util[_0x6c47('0x52')]('%s.%s',path['basename'](_0x28989c[_0x6c47('0x55')][_0x6c47('0x57')],path[_0x6c47('0x58')](_0x28989c[_0x6c47('0x55')][_0x6c47('0x57')])),_0xf20130[_0x6c47('0x4a')]));logger['info'](_0x6c47('0x5b'),_0x53d578);logger['info'](_0x6c47('0x5c'),_0x59b8a7);try{fs[_0x6c47('0x5d')](_0x53d578,parseInt(_0x6c47('0x5e'),0x8));var _0x14598e=sox[_0x6c47('0x5f')](_0x53d578,_0x59b8a7,{'sampleRate':0x1f40,'format':_0x6c47('0x5a'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x14598e['on']('error',function(_0x2be6a7){fs[_0x6c47('0x60')](_0x53d578);_0x269825['status'](0x1f4)['send'](_0x2be6a7);});_0x14598e['on'](_0x6c47('0x61'),function(_0x51ad65){_0xf20130['original_duration']=isNaN(_0x51ad65['duration'])?null:_0x51ad65[_0x6c47('0x62')]*0x3e8;_0xf20130[_0x6c47('0x63')]=isNaN(_0x51ad65['sampleCount'])?null:_0x51ad65[_0x6c47('0x64')];_0xf20130[_0x6c47('0x65')]=isNaN(_0x51ad65['channelCount'])?null:_0x51ad65['channelCount'];_0xf20130[_0x6c47('0x66')]=isNaN(_0x51ad65[_0x6c47('0x67')])?null:_0x51ad65[_0x6c47('0x67')];_0xf20130[_0x6c47('0x68')]=isNaN(_0x51ad65[_0x6c47('0x69')])?null:_0x51ad65['sampleRate'];});_0x14598e['on']('dest',function(_0x52f211){_0xf20130[_0x6c47('0x6a')]=isNaN(_0x52f211[_0x6c47('0x62')])?null:_0x52f211[_0x6c47('0x62')]*0x3e8;_0xf20130[_0x6c47('0x6b')]=isNaN(_0x52f211['sampleCount'])?null:_0x52f211['sampleCount'];_0xf20130[_0x6c47('0x6c')]=isNaN(_0x52f211['channelCount'])?null:_0x52f211[_0x6c47('0x6d')];_0xf20130[_0x6c47('0x6e')]=isNaN(_0x52f211[_0x6c47('0x67')])?null:_0x52f211[_0x6c47('0x67')];_0xf20130['converted_sampleRate']=isNaN(_0x52f211[_0x6c47('0x69')])?null:_0x52f211['sampleRate'];});_0x14598e['on'](_0x6c47('0x27'),function(){fs[_0x6c47('0x5d')](_0x59b8a7,parseInt(_0x6c47('0x5e'),0x8));return db[_0x6c47('0x2d')][_0x6c47('0x53')](_0xf20130)['then'](function(_0x2a274f){var _0x5aa51d={'role':_0x28989c['body']['role'],'userProfileId':_0x28989c[_0x6c47('0x6f')][_0x6c47('0x70')]};if(!_0x5aa51d)throw new Error(_0x6c47('0x71'));if(_0x5aa51d[_0x6c47('0x72')]==='user'){var _0x3f902d=_0x2a274f[_0x6c47('0x24')]({'plain':!![]});return db[_0x6c47('0x73')][_0x6c47('0x48')]({'where':{'name':'Sounds','userProfileId':_0x5aa51d[_0x6c47('0x70')]},'raw':!![]})[_0x6c47('0x26')](function(_0x1b7e82){if(_0x1b7e82&&_0x1b7e82[_0x6c47('0x74')]===0x0){return db[_0x6c47('0x25')][_0x6c47('0x53')]({'name':_0x3f902d[_0x6c47('0x29')],'resourceId':_0x3f902d['id'],'type':_0x1b7e82['name'],'sectionId':_0x1b7e82['id']},{})['then'](function(){return _0x2a274f;});}else{return _0x2a274f;}})[_0x6c47('0x44')](function(_0x23f50b){logger[_0x6c47('0x28')](_0x6c47('0x75'),_0x23f50b);throw _0x23f50b;});}return _0x2a274f;})[_0x6c47('0x26')](respondWithResult(_0x269825,null))[_0x6c47('0x44')](handleError(_0x269825,null));});_0x14598e[_0x6c47('0x76')]();}catch(_0x38fa1f){_0x269825[_0x6c47('0x18')](0x1f4)[_0x6c47('0x2a')](_0x38fa1f);}};exports['update']=function(_0x150a95,_0x336e92,_0x308c71){return db[_0x6c47('0x2d')][_0x6c47('0x48')]({'where':{'id':_0x150a95[_0x6c47('0x46')]['id']}})[_0x6c47('0x26')](handleEntityNotFound(_0x336e92,null))[_0x6c47('0x26')](saveUpdates(_[_0x6c47('0x3d')](_0x150a95['body'],[_0x6c47('0x29'),_0x6c47('0x77')]),null))[_0x6c47('0x26')](respondWithResult(_0x336e92,null))[_0x6c47('0x44')](handleError(_0x336e92,null));};exports[_0x6c47('0x78')]=function(_0x58b02e,_0x1d8deb,_0xfde0f3){return db[_0x6c47('0x2d')][_0x6c47('0x48')]({'where':{'id':_0x58b02e[_0x6c47('0x46')]['id']}})[_0x6c47('0x26')](function(_0x2893ae){if(_0x2893ae){return _0x2893ae['destroy']();}})[_0x6c47('0x26')](function(_0x4d37e0){var _0x1ddebb=path['join'](config[_0x6c47('0x4d')],'server/files/sounds/original',util[_0x6c47('0x52')](_0x6c47('0x79'),_0x4d37e0[_0x6c47('0x4f')],_0x4d37e0[_0x6c47('0x7a')]));var _0x244149=path[_0x6c47('0x4c')](config[_0x6c47('0x4d')],_0x6c47('0x4e'),util['format'](_0x6c47('0x79'),_0x4d37e0[_0x6c47('0x4f')],_0x4d37e0['converted_format']));fs[_0x6c47('0x60')](_0x1ddebb);fs[_0x6c47('0x60')](_0x244149);return _0x4d37e0;})[_0x6c47('0x26')](function(_0x5c2ea7){if(_0x5c2ea7){return _0x1d8deb[_0x6c47('0x18')](0xcc)[_0x6c47('0x27')]();}})[_0x6c47('0x26')](handleEntityNotFound(_0x1d8deb,null))[_0x6c47('0x44')](handleError(_0x1d8deb,null));}; \ No newline at end of file +var _0xb45f=['unlinkSync','duration','original_sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','sampleCount','converted_channelCount','converted_bitRate','chmodSync','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','update','pick','description','original_format','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','apply','save','then','destroy','get','Sounds','UserProfileResource','error','name','send','map','rawAttributes','type','key','keys','query','filters','intersection','model','attributes','fields','nolimit','order','sort','where','merge','VIRTUAL','filter','options','Sound','includeAll','include','findAll','catch','params','length','find','existsSync','join','root','save_name','converted_format','server/files/sounds/converted','format','%s.%s','create','basename','file','extname','originalname','filename','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','0777','transcode'];(function(_0x44888d,_0x5e9dac){var _0x4e5509=function(_0x11f98c){while(--_0x11f98c){_0x44888d['push'](_0x44888d['shift']());}};_0x4e5509(++_0x5e9dac);}(_0xb45f,0x182));var _0xfb45=function(_0x535439,_0x301fe4){_0x535439=_0x535439-0x0;var _0x20a8cb=_0xb45f[_0x535439];return _0x20a8cb;};'use strict';var emlformat=require(_0xfb45('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfb45('0x1'));var jsonpatch=require(_0xfb45('0x2'));var rp=require(_0xfb45('0x3'));var moment=require('moment');var BPromise=require(_0xfb45('0x4'));var Mustache=require(_0xfb45('0x5'));var util=require(_0xfb45('0x6'));var path=require(_0xfb45('0x7'));var sox=require(_0xfb45('0x8'));var csv=require(_0xfb45('0x9'));var ejs=require(_0xfb45('0xa'));var fs=require('fs');var fs_extra=require(_0xfb45('0xb'));var _=require(_0xfb45('0xc'));var squel=require(_0xfb45('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfb45('0xe'));var toCsv=require(_0xfb45('0x9'));var querystring=require(_0xfb45('0xf'));var Papa=require(_0xfb45('0x10'));var Redis=require(_0xfb45('0x11'));var authService=require(_0xfb45('0x12'));var qs=require(_0xfb45('0x13'));var as=require(_0xfb45('0x14'));var hardwareService=require(_0xfb45('0x15'));var logger=require(_0xfb45('0x16'))('api');var utils=require(_0xfb45('0x17'));var config=require(_0xfb45('0x18'));var licenseUtil=require(_0xfb45('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c1470,_0x442995){_0x442995=_0x442995||0xcc;return function(_0x39f948){if(_0x39f948){return _0x5c1470[_0xfb45('0x1a')](_0x442995);}return _0x5c1470[_0xfb45('0x1b')](_0x442995)[_0xfb45('0x1c')]();};}function respondWithResult(_0xd79f3,_0x285a35){_0x285a35=_0x285a35||0xc8;return function(_0x292ab4){if(_0x292ab4){return _0xd79f3[_0xfb45('0x1b')](_0x285a35)['json'](_0x292ab4);}};}function respondWithFilteredResult(_0x5524ff,_0x30ebdb){return function(_0x53fac2){if(_0x53fac2){var _0x396033=typeof _0x30ebdb[_0xfb45('0x1d')]===_0xfb45('0x1e')&&typeof _0x30ebdb[_0xfb45('0x1f')]===_0xfb45('0x1e');var _0x3a3e8e=_0x53fac2['count'];var _0x46ea74=_0x396033?0x0:_0x30ebdb[_0xfb45('0x1d')];var _0x203a2a=_0x396033?_0x53fac2[_0xfb45('0x20')]:_0x30ebdb[_0xfb45('0x1d')]+_0x30ebdb[_0xfb45('0x1f')];var _0xd627b1;if(_0x203a2a>=_0x3a3e8e){_0x203a2a=_0x3a3e8e;_0xd627b1=0xc8;}else{_0xd627b1=0xce;}_0x5524ff[_0xfb45('0x1b')](_0xd627b1);return _0x5524ff['set']('Content-Range',_0x46ea74+'-'+_0x203a2a+'/'+_0x3a3e8e)['json'](_0x53fac2);}return null;};}function patchUpdates(_0x3b3942){return function(_0x2af9a6){try{jsonpatch[_0xfb45('0x21')](_0x2af9a6,_0x3b3942,!![]);}catch(_0x421ca7){return BPromise['reject'](_0x421ca7);}return _0x2af9a6[_0xfb45('0x22')]();};}function saveUpdates(_0x166e87,_0x3dbacc){return function(_0x3b3dba){if(_0x3b3dba){return _0x3b3dba['update'](_0x166e87)[_0xfb45('0x23')](function(_0x380e78){return _0x380e78;});}return null;};}function removeEntity(_0xd7657a,_0x4de4d7){return function(_0xe387d1){if(_0xe387d1){return _0xe387d1[_0xfb45('0x24')]()[_0xfb45('0x23')](function(){var _0x178e99=_0xe387d1[_0xfb45('0x25')]({'plain':!![]});var _0x3f3c26=_0xfb45('0x26');return db[_0xfb45('0x27')]['destroy']({'where':{'type':_0x3f3c26,'resourceId':_0x178e99['id']}})['then'](function(){return _0xe387d1;});})['then'](function(){_0xd7657a[_0xfb45('0x1b')](0xcc)[_0xfb45('0x1c')]();});}};}function handleEntityNotFound(_0x4b2118,_0x3c2755){return function(_0x33ee5a){if(!_0x33ee5a){_0x4b2118[_0xfb45('0x1a')](0x194);}return _0x33ee5a;};}function handleError(_0x51d5a7,_0x5c2f65){_0x5c2f65=_0x5c2f65||0x1f4;return function(_0x2efd11){logger[_0xfb45('0x28')](_0x2efd11['stack']);if(_0x2efd11['name']){delete _0x2efd11[_0xfb45('0x29')];}_0x51d5a7[_0xfb45('0x1b')](_0x5c2f65)[_0xfb45('0x2a')](_0x2efd11);};}exports['index']=function(_0xf216f7,_0x3b03e4){var _0x4a5470={},_0x26e8fc={},_0x30c900={'count':0x0,'rows':[]};var _0x25256f=_[_0xfb45('0x2b')](db['Sound'][_0xfb45('0x2c')],function(_0x2d6bb0){return{'name':_0x2d6bb0['fieldName'],'type':_0x2d6bb0[_0xfb45('0x2d')][_0xfb45('0x2e')]};});_0x26e8fc['model']=_['map'](_0x25256f,_0xfb45('0x29'));_0x26e8fc['query']=_[_0xfb45('0x2f')](_0xf216f7[_0xfb45('0x30')]);_0x26e8fc[_0xfb45('0x31')]=_[_0xfb45('0x32')](_0x26e8fc[_0xfb45('0x33')],_0x26e8fc[_0xfb45('0x30')]);_0x4a5470[_0xfb45('0x34')]=_['intersection'](_0x26e8fc[_0xfb45('0x33')],qs[_0xfb45('0x35')](_0xf216f7['query'][_0xfb45('0x35')]));_0x4a5470[_0xfb45('0x34')]=_0x4a5470[_0xfb45('0x34')]['length']?_0x4a5470['attributes']:_0x26e8fc[_0xfb45('0x33')];if(!_0xf216f7[_0xfb45('0x30')]['hasOwnProperty'](_0xfb45('0x36'))){_0x4a5470[_0xfb45('0x1f')]=qs['limit'](_0xf216f7[_0xfb45('0x30')][_0xfb45('0x1f')]);_0x4a5470['offset']=qs[_0xfb45('0x1d')](_0xf216f7[_0xfb45('0x30')][_0xfb45('0x1d')]);}_0x4a5470[_0xfb45('0x37')]=qs['sort'](_0xf216f7[_0xfb45('0x30')][_0xfb45('0x38')]);_0x4a5470[_0xfb45('0x39')]=qs[_0xfb45('0x31')](_['pick'](_0xf216f7[_0xfb45('0x30')],_0x26e8fc[_0xfb45('0x31')]),_0x25256f);if(_0xf216f7[_0xfb45('0x30')]['filter']){_0x4a5470['where']=_[_0xfb45('0x3a')](_0x4a5470[_0xfb45('0x39')],{'$or':_[_0xfb45('0x2b')](_0x25256f,function(_0x9ffcdc){if(_0x9ffcdc[_0xfb45('0x2d')]!==_0xfb45('0x3b')){var _0x464744={};_0x464744[_0x9ffcdc['name']]={'$like':'%'+_0xf216f7[_0xfb45('0x30')][_0xfb45('0x3c')]+'%'};return _0x464744;}})});}_0x4a5470=_[_0xfb45('0x3a')]({},_0x4a5470,_0xf216f7[_0xfb45('0x3d')]);var _0x5ded06={'where':_0x4a5470['where']};return db[_0xfb45('0x3e')]['count'](_0x5ded06)['then'](function(_0x25e016){_0x30c900['count']=_0x25e016;if(_0xf216f7[_0xfb45('0x30')][_0xfb45('0x3f')]){_0x4a5470[_0xfb45('0x40')]=[{'all':!![]}];}return db[_0xfb45('0x3e')][_0xfb45('0x41')](_0x4a5470);})['then'](function(_0x45312b){_0x30c900['rows']=_0x45312b;return _0x30c900;})[_0xfb45('0x23')](respondWithFilteredResult(_0x3b03e4,_0x4a5470))[_0xfb45('0x42')](handleError(_0x3b03e4,null));};exports['show']=function(_0x18c27c,_0x4b788e){var _0x587862={'raw':!![],'where':{'id':_0x18c27c[_0xfb45('0x43')]['id']}},_0x2f3776={};_0x2f3776['model']=_[_0xfb45('0x2f')](db['Sound']['rawAttributes']);_0x2f3776[_0xfb45('0x30')]=_['keys'](_0x18c27c[_0xfb45('0x30')]);_0x2f3776[_0xfb45('0x31')]=_[_0xfb45('0x32')](_0x2f3776[_0xfb45('0x33')],_0x2f3776[_0xfb45('0x30')]);_0x587862[_0xfb45('0x34')]=_['intersection'](_0x2f3776[_0xfb45('0x33')],qs[_0xfb45('0x35')](_0x18c27c[_0xfb45('0x30')][_0xfb45('0x35')]));_0x587862[_0xfb45('0x34')]=_0x587862[_0xfb45('0x34')][_0xfb45('0x44')]?_0x587862[_0xfb45('0x34')]:_0x2f3776[_0xfb45('0x33')];if(_0x18c27c['query']['includeAll']){_0x587862[_0xfb45('0x40')]=[{'all':!![]}];}_0x587862=_[_0xfb45('0x3a')]({},_0x587862,_0x18c27c['options']);return db['Sound'][_0xfb45('0x45')](_0x587862)[_0xfb45('0x23')](handleEntityNotFound(_0x4b788e,null))['then'](respondWithResult(_0x4b788e,null))['catch'](handleError(_0x4b788e,null));};exports['download']=function(_0x1a37c4,_0x3c6f53,_0x320fc1){return db['Sound']['find']({'where':{'id':_0x1a37c4[_0xfb45('0x43')]['id']},'attributes':[_0xfb45('0x29'),'save_name','converted_format'],'raw':!![]})[_0xfb45('0x23')](handleEntityNotFound(_0x3c6f53,null))[_0xfb45('0x23')](function(_0x1d345a){if(_0x1d345a){if(!fs[_0xfb45('0x46')](path[_0xfb45('0x47')](config[_0xfb45('0x48')],'server/files/sounds/converted',_0x1d345a[_0xfb45('0x49')]+'.'+_0x1d345a[_0xfb45('0x4a')]))){throw new db['Sequelize']['ValidationError']('Sound\x20not\x20found');}return _0x3c6f53['download'](path['join'](config[_0xfb45('0x48')],_0xfb45('0x4b'),util[_0xfb45('0x4c')](_0xfb45('0x4d'),_0x1d345a[_0xfb45('0x49')],_0x1d345a['converted_format'])),util[_0xfb45('0x4c')](_0xfb45('0x4d'),_0x1d345a[_0xfb45('0x29')],_0x1d345a[_0xfb45('0x4a')]));}return null;})[_0xfb45('0x42')](handleError(_0x3c6f53,null));};exports[_0xfb45('0x4e')]=function(_0x3b0b03,_0x396a26,_0x28f765){var _0x17670c={'name':path[_0xfb45('0x4f')](_0x3b0b03[_0xfb45('0x50')]['originalname'],path[_0xfb45('0x51')](_0x3b0b03[_0xfb45('0x50')][_0xfb45('0x52')])),'save_name':path[_0xfb45('0x4f')](_0x3b0b03[_0xfb45('0x50')][_0xfb45('0x53')],path[_0xfb45('0x51')](_0x3b0b03['file'][_0xfb45('0x53')])),'original_format':path['extname'](_0x3b0b03[_0xfb45('0x50')][_0xfb45('0x52')])['substring'](0x1),'converted_format':_0xfb45('0x54')};var _0x7aaaa8=path[_0xfb45('0x47')](config[_0xfb45('0x48')],_0xfb45('0x55'),_0x3b0b03[_0xfb45('0x50')][_0xfb45('0x53')]);var _0x5cded3=path['join'](config[_0xfb45('0x48')],'server/files/sounds/converted',util['format'](_0xfb45('0x4d'),path[_0xfb45('0x4f')](_0x3b0b03[_0xfb45('0x50')][_0xfb45('0x53')],path['extname'](_0x3b0b03['file']['filename'])),_0x17670c[_0xfb45('0x4a')]));logger[_0xfb45('0x56')](_0xfb45('0x57'),_0x7aaaa8);logger[_0xfb45('0x56')]('Sound\x20upload\x20destination:\x20%s',_0x5cded3);try{fs['chmodSync'](_0x7aaaa8,parseInt(_0xfb45('0x58'),0x8));var _0x1fc5a8=sox[_0xfb45('0x59')](_0x7aaaa8,_0x5cded3,{'sampleRate':0x1f40,'format':_0xfb45('0x54'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1fc5a8['on'](_0xfb45('0x28'),function(_0x58b606){fs[_0xfb45('0x5a')](_0x7aaaa8);_0x396a26[_0xfb45('0x1b')](0x1f4)[_0xfb45('0x2a')](_0x58b606);});_0x1fc5a8['on']('src',function(_0xc79105){_0x17670c['original_duration']=isNaN(_0xc79105[_0xfb45('0x5b')])?null:_0xc79105[_0xfb45('0x5b')]*0x3e8;_0x17670c[_0xfb45('0x5c')]=isNaN(_0xc79105['sampleCount'])?null:_0xc79105['sampleCount'];_0x17670c[_0xfb45('0x5d')]=isNaN(_0xc79105[_0xfb45('0x5e')])?null:_0xc79105[_0xfb45('0x5e')];_0x17670c[_0xfb45('0x5f')]=isNaN(_0xc79105['bitRate'])?null:_0xc79105[_0xfb45('0x60')];_0x17670c[_0xfb45('0x61')]=isNaN(_0xc79105[_0xfb45('0x62')])?null:_0xc79105[_0xfb45('0x62')];});_0x1fc5a8['on'](_0xfb45('0x63'),function(_0xc44681){_0x17670c[_0xfb45('0x64')]=isNaN(_0xc44681[_0xfb45('0x5b')])?null:_0xc44681[_0xfb45('0x5b')]*0x3e8;_0x17670c[_0xfb45('0x65')]=isNaN(_0xc44681['sampleCount'])?null:_0xc44681[_0xfb45('0x66')];_0x17670c[_0xfb45('0x67')]=isNaN(_0xc44681['channelCount'])?null:_0xc44681[_0xfb45('0x5e')];_0x17670c[_0xfb45('0x68')]=isNaN(_0xc44681[_0xfb45('0x60')])?null:_0xc44681[_0xfb45('0x60')];_0x17670c['converted_sampleRate']=isNaN(_0xc44681[_0xfb45('0x62')])?null:_0xc44681[_0xfb45('0x62')];});_0x1fc5a8['on'](_0xfb45('0x1c'),function(){fs[_0xfb45('0x69')](_0x5cded3,parseInt('0777',0x8));return db[_0xfb45('0x3e')][_0xfb45('0x4e')](_0x17670c)[_0xfb45('0x23')](function(_0x27ae89){var _0x1396c8={'role':_0x3b0b03[_0xfb45('0x6a')][_0xfb45('0x6b')],'userProfileId':_0x3b0b03[_0xfb45('0x6a')][_0xfb45('0x6c')]};if(!_0x1396c8)throw new Error(_0xfb45('0x6d'));if(_0x1396c8['role']===_0xfb45('0x6e')){var _0x527dbf=_0x27ae89[_0xfb45('0x25')]({'plain':!![]});return db[_0xfb45('0x6f')][_0xfb45('0x45')]({'where':{'name':'Sounds','userProfileId':_0x1396c8[_0xfb45('0x6c')]},'raw':!![]})['then'](function(_0x505428){if(_0x505428&&_0x505428[_0xfb45('0x70')]===0x0){return db[_0xfb45('0x27')][_0xfb45('0x4e')]({'name':_0x527dbf[_0xfb45('0x29')],'resourceId':_0x527dbf['id'],'type':_0x505428['name'],'sectionId':_0x505428['id']},{})[_0xfb45('0x23')](function(){return _0x27ae89;});}else{return _0x27ae89;}})['catch'](function(_0x1f0c13){logger['error'](_0xfb45('0x71'),_0x1f0c13);throw _0x1f0c13;});}return _0x27ae89;})[_0xfb45('0x23')](respondWithResult(_0x396a26,null))['catch'](handleError(_0x396a26,null));});_0x1fc5a8[_0xfb45('0x72')]();}catch(_0x3abc61){_0x396a26[_0xfb45('0x1b')](0x1f4)[_0xfb45('0x2a')](_0x3abc61);}};exports[_0xfb45('0x73')]=function(_0x18ce5c,_0x260a5b,_0x59a456){return db[_0xfb45('0x3e')][_0xfb45('0x45')]({'where':{'id':_0x18ce5c[_0xfb45('0x43')]['id']}})[_0xfb45('0x23')](handleEntityNotFound(_0x260a5b,null))[_0xfb45('0x23')](saveUpdates(_[_0xfb45('0x74')](_0x18ce5c[_0xfb45('0x6a')],[_0xfb45('0x29'),_0xfb45('0x75')]),null))[_0xfb45('0x23')](respondWithResult(_0x260a5b,null))[_0xfb45('0x42')](handleError(_0x260a5b,null));};exports['delete']=function(_0xeb8d61,_0x1c6be3,_0x4339cf){return db['Sound'][_0xfb45('0x45')]({'where':{'id':_0xeb8d61[_0xfb45('0x43')]['id']}})['then'](function(_0x342940){if(_0x342940){return _0x342940[_0xfb45('0x24')]();}})[_0xfb45('0x23')](function(_0x3ce998){var _0x424ee8=path['join'](config[_0xfb45('0x48')],_0xfb45('0x55'),util[_0xfb45('0x4c')]('%s.%s',_0x3ce998[_0xfb45('0x49')],_0x3ce998[_0xfb45('0x76')]));var _0x44540b=path[_0xfb45('0x47')](config[_0xfb45('0x48')],'server/files/sounds/converted',util[_0xfb45('0x4c')](_0xfb45('0x4d'),_0x3ce998[_0xfb45('0x49')],_0x3ce998[_0xfb45('0x4a')]));fs[_0xfb45('0x5a')](_0x424ee8);fs[_0xfb45('0x5a')](_0x44540b);return _0x3ce998;})[_0xfb45('0x23')](function(_0x13927a){if(_0x13927a){return _0x1c6be3[_0xfb45('0x1b')](0xcc)['end']();}})['then'](handleEntityNotFound(_0x1c6be3,null))[_0xfb45('0x42')](handleError(_0x1c6be3,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index bb5139b..7551cf2 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 _0x974b=['request-promise','path','rimraf','../../config/environment','exports','define','Sound','tools_sounds','lodash','util','../../config/logger','api'];(function(_0x4d80d6,_0x391850){var _0x4f40b0=function(_0x37c218){while(--_0x37c218){_0x4d80d6['push'](_0x4d80d6['shift']());}};_0x4f40b0(++_0x391850);}(_0x974b,0x188));var _0xb974=function(_0x15a9cb,_0x2c5d45){_0x15a9cb=_0x15a9cb-0x0;var _0x4036e4=_0x974b[_0x15a9cb];return _0x4036e4;};'use strict';var _=require(_0xb974('0x0'));var util=require(_0xb974('0x1'));var logger=require(_0xb974('0x2'))(_0xb974('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb974('0x4'));var fs=require('fs');var path=require(_0xb974('0x5'));var rimraf=require(_0xb974('0x6'));var config=require(_0xb974('0x7'));var attributes=require('./sound.attributes');module[_0xb974('0x8')]=function(_0xdb5caa,_0x1ffeba){return _0xdb5caa[_0xb974('0x9')](_0xb974('0xa'),attributes,{'tableName':_0xb974('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x12c9=['util','../../config/logger','api','path','rimraf','../../config/environment','./sound.attributes','exports','define','Sound','tools_sounds'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x12c9,0x113));var _0x912c=function(_0x704082,_0x2649c4){_0x704082=_0x704082-0x0;var _0x6a0d9c=_0x12c9[_0x704082];return _0x6a0d9c;};'use strict';var _=require('lodash');var util=require(_0x912c('0x0'));var logger=require(_0x912c('0x1'))(_0x912c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x912c('0x3'));var rimraf=require(_0x912c('0x4'));var config=require(_0x912c('0x5'));var attributes=require(_0x912c('0x6'));module[_0x912c('0x7')]=function(_0x4c57ac,_0x2493e4){return _0x4c57ac[_0x912c('0x8')](_0x912c('0x9'),attributes,{'tableName':_0x912c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index 8ac554b..b7acbe8 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 _0x7f04=['lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','request','info','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','Sound,\x20%s,\x20%s','message','result','catch','options','raw','where','attributes','include','map','model','then','ShowSound'];(function(_0x481b8b,_0x3f4b43){var _0xa551f3=function(_0x1b5c8a){while(--_0x1b5c8a){_0x481b8b['push'](_0x481b8b['shift']());}};_0xa551f3(++_0x3f4b43);}(_0x7f04,0xe8));var _0x47f0=function(_0x50f17d,_0x260de1){_0x50f17d=_0x50f17d-0x0;var _0x207fb8=_0x7f04[_0x50f17d];return _0x207fb8;};'use strict';var _=require(_0x47f0('0x0'));var util=require(_0x47f0('0x1'));var moment=require(_0x47f0('0x2'));var BPromise=require(_0x47f0('0x3'));var rs=require(_0x47f0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x47f0('0x5'));var logger=require(_0x47f0('0x6'))(_0x47f0('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x15e78e,_0x47fbb7,_0xdd3880){return new BPromise(function(_0xa18374,_0x457899){return client[_0x47f0('0x8')](_0x15e78e,_0xdd3880)['then'](function(_0x2447b2){logger[_0x47f0('0x9')]('Sound,\x20%s,\x20%s',_0x47fbb7,_0x47f0('0xa'));logger[_0x47f0('0xb')](_0x47f0('0xc'),_0x47fbb7,'request\x20sent',JSON[_0x47f0('0xd')](_0x2447b2));if(_0x2447b2[_0x47f0('0xe')]){if(_0x2447b2[_0x47f0('0xe')][_0x47f0('0xf')]===0x1f4){logger[_0x47f0('0xe')](_0x47f0('0x10'),_0x47fbb7,_0x2447b2[_0x47f0('0xe')][_0x47f0('0x11')]);return _0x457899(_0x2447b2[_0x47f0('0xe')][_0x47f0('0x11')]);}logger['error'](_0x47f0('0x10'),_0x47fbb7,_0x2447b2[_0x47f0('0xe')]['message']);return _0xa18374(_0x2447b2[_0x47f0('0xe')][_0x47f0('0x11')]);}else{logger[_0x47f0('0x9')](_0x47f0('0x10'),_0x47fbb7,_0x47f0('0xa'));_0xa18374(_0x2447b2[_0x47f0('0x12')]['message']);}})[_0x47f0('0x13')](function(_0x3e68b3){logger[_0x47f0('0xe')](_0x47f0('0x10'),_0x47fbb7,_0x3e68b3);_0x457899(_0x3e68b3);});});}exports['ShowSound']=function(_0x3af952){var _0x2e0596=this;return new Promise(function(_0x3a17ad,_0x1739e8){return db['Sound']['find']({'raw':_0x3af952[_0x47f0('0x14')]?_0x3af952[_0x47f0('0x14')][_0x47f0('0x15')]===undefined?!![]:![]:!![],'where':_0x3af952['options']?_0x3af952['options'][_0x47f0('0x16')]||null:null,'attributes':_0x3af952[_0x47f0('0x14')]?_0x3af952['options'][_0x47f0('0x17')]||null:null,'include':_0x3af952[_0x47f0('0x14')]?_0x3af952[_0x47f0('0x14')][_0x47f0('0x18')]?_[_0x47f0('0x19')](_0x3af952['options'][_0x47f0('0x18')],function(_0x54f259){return{'model':db[_0x54f259[_0x47f0('0x1a')]],'as':_0x54f259['as'],'attributes':_0x54f259['attributes'],'include':_0x54f259['include']?_[_0x47f0('0x19')](_0x54f259['include'],function(_0x8a89e){return{'model':db[_0x8a89e[_0x47f0('0x1a')]],'as':_0x8a89e['as'],'attributes':_0x8a89e['attributes'],'include':_0x8a89e['include']?_['map'](_0x8a89e['include'],function(_0x4281cd){return{'model':db[_0x4281cd[_0x47f0('0x1a')]],'as':_0x4281cd['as'],'attributes':_0x4281cd[_0x47f0('0x17')]};}):[]};}):[]};}):[]:[]})[_0x47f0('0x1b')](function(_0x458378){logger[_0x47f0('0x9')](_0x47f0('0x1c'),_0x3af952);logger['debug']('ShowSound',_0x3af952,JSON['stringify'](_0x458378));_0x3a17ad(_0x458378);})['catch'](function(_0x1ec18c){logger[_0x47f0('0xe')](_0x47f0('0x1c'),_0x1ec18c[_0x47f0('0x11')],_0x3af952);_0x1739e8(_0x2e0596['error'](0x1f4,_0x1ec18c[_0x47f0('0x11')]));});});}; \ No newline at end of file +var _0xe5e9=['raw','include','map','model','attributes','then','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','Sound,\x20%s,\x20%s','debug','Sound,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','ShowSound','find','options'];(function(_0x3e91a9,_0x53c466){var _0x25c9ad=function(_0x69ee2d){while(--_0x69ee2d){_0x3e91a9['push'](_0x3e91a9['shift']());}};_0x25c9ad(++_0x53c466);}(_0xe5e9,0x126));var _0x9e5e=function(_0x161341,_0x1c054d){_0x161341=_0x161341-0x0;var _0x5e06c3=_0xe5e9[_0x161341];return _0x5e06c3;};'use strict';var _=require(_0x9e5e('0x0'));var util=require(_0x9e5e('0x1'));var moment=require(_0x9e5e('0x2'));var BPromise=require('bluebird');var rs=require(_0x9e5e('0x3'));var fs=require('fs');var Redis=require(_0x9e5e('0x4'));var db=require(_0x9e5e('0x5'))['db'];var utils=require(_0x9e5e('0x6'));var logger=require(_0x9e5e('0x7'))(_0x9e5e('0x8'));var config=require(_0x9e5e('0x9'));var jayson=require(_0x9e5e('0xa'));var client=jayson[_0x9e5e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c9b2c,_0x44d1bd,_0x1cbd8b){return new BPromise(function(_0x5c83b6,_0x35da5d){return client[_0x9e5e('0xc')](_0x5c9b2c,_0x1cbd8b)['then'](function(_0x5c7583){logger[_0x9e5e('0xd')](_0x9e5e('0xe'),_0x44d1bd,'request\x20sent');logger[_0x9e5e('0xf')](_0x9e5e('0x10'),_0x44d1bd,_0x9e5e('0x11'),JSON[_0x9e5e('0x12')](_0x5c7583));if(_0x5c7583[_0x9e5e('0x13')]){if(_0x5c7583[_0x9e5e('0x13')]['code']===0x1f4){logger['error'](_0x9e5e('0xe'),_0x44d1bd,_0x5c7583[_0x9e5e('0x13')][_0x9e5e('0x14')]);return _0x35da5d(_0x5c7583[_0x9e5e('0x13')][_0x9e5e('0x14')]);}logger[_0x9e5e('0x13')](_0x9e5e('0xe'),_0x44d1bd,_0x5c7583['error']['message']);return _0x5c83b6(_0x5c7583['error']['message']);}else{logger['info'](_0x9e5e('0xe'),_0x44d1bd,'request\x20sent');_0x5c83b6(_0x5c7583[_0x9e5e('0x15')][_0x9e5e('0x14')]);}})[_0x9e5e('0x16')](function(_0x28a4ed){logger['error'](_0x9e5e('0xe'),_0x44d1bd,_0x28a4ed);_0x35da5d(_0x28a4ed);});});}exports[_0x9e5e('0x17')]=function(_0x44808d){var _0x1b16db=this;return new Promise(function(_0x41bd27,_0x280545){return db['Sound'][_0x9e5e('0x18')]({'raw':_0x44808d[_0x9e5e('0x19')]?_0x44808d['options'][_0x9e5e('0x1a')]===undefined?!![]:![]:!![],'where':_0x44808d[_0x9e5e('0x19')]?_0x44808d[_0x9e5e('0x19')]['where']||null:null,'attributes':_0x44808d['options']?_0x44808d['options']['attributes']||null:null,'include':_0x44808d[_0x9e5e('0x19')]?_0x44808d[_0x9e5e('0x19')][_0x9e5e('0x1b')]?_[_0x9e5e('0x1c')](_0x44808d['options'][_0x9e5e('0x1b')],function(_0x7e125c){return{'model':db[_0x7e125c[_0x9e5e('0x1d')]],'as':_0x7e125c['as'],'attributes':_0x7e125c[_0x9e5e('0x1e')],'include':_0x7e125c[_0x9e5e('0x1b')]?_[_0x9e5e('0x1c')](_0x7e125c[_0x9e5e('0x1b')],function(_0x5838ac){return{'model':db[_0x5838ac[_0x9e5e('0x1d')]],'as':_0x5838ac['as'],'attributes':_0x5838ac[_0x9e5e('0x1e')],'include':_0x5838ac['include']?_['map'](_0x5838ac['include'],function(_0x31ed2c){return{'model':db[_0x31ed2c['model']],'as':_0x31ed2c['as'],'attributes':_0x31ed2c[_0x9e5e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x9e5e('0x1f')](function(_0x350761){logger['info'](_0x9e5e('0x17'),_0x44808d);logger[_0x9e5e('0xf')](_0x9e5e('0x17'),_0x44808d,JSON[_0x9e5e('0x12')](_0x350761));_0x41bd27(_0x350761);})['catch'](function(_0x577f3d){logger[_0x9e5e('0x13')](_0x9e5e('0x17'),_0x577f3d[_0x9e5e('0x14')],_0x44808d);_0x280545(_0x1b16db['error'](0x1f4,_0x577f3d[_0x9e5e('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index d1359b9..9ade50b 100644 --- a/server/api/squareMessage/index.js +++ b/server/api/squareMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['update','delete','destroy','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','create','put','/:id'];(function(_0x309e57,_0xe1c277){var _0x313c98=function(_0x2e6cd6){while(--_0x2e6cd6){_0x309e57['push'](_0x309e57['shift']());}};_0x313c98(++_0xe1c277);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./squareMessage.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['post']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xb')]);router[_0x0d8b('0xc')](_0x0d8b('0xd'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xd'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);module['exports']=router; \ No newline at end of file +var _0xda3f=['../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','util','path','fs-extra','../../components/interaction/service'];(function(_0x306086,_0x494520){var _0x2f805d=function(_0x562512){while(--_0x562512){_0x306086['push'](_0x306086['shift']());}};_0x2f805d(++_0x494520);}(_0xda3f,0xec));var _0xfda3=function(_0x860626,_0x446b0e){_0x860626=_0x860626-0x0;var _0x5f2eb3=_0xda3f[_0x860626];return _0x5f2eb3;};'use strict';var multer=require('multer');var util=require(_0xfda3('0x0'));var path=require(_0xfda3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xfda3('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xfda3('0x3'));var config=require(_0xfda3('0x4'));var controller=require('./squareMessage.controller');router[_0xfda3('0x5')]('/',auth[_0xfda3('0x6')](),controller['index']);router['get'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x8')]);router[_0xfda3('0x9')]('/',auth[_0xfda3('0x6')](),controller[_0xfda3('0xa')]);router[_0xfda3('0xb')](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xc')]);router[_0xfda3('0xd')](_0xfda3('0x7'),auth['isAuthenticated'](),controller[_0xfda3('0xe')]);module[_0xfda3('0xf')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 4c1c5c9..01d2530 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 _0xf998=['out','sequelize','exports','STRING','TEXT'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xf998,0x173));var _0x8f99=function(_0x22b95b,_0x2c695e){_0x22b95b=_0x22b95b-0x0;var _0x32728b=_0xf998[_0x22b95b];return _0x32728b;};'use strict';var Sequelize=require(_0x8f99('0x0'));module[_0x8f99('0x1')]={'uniqueid':{'type':Sequelize[_0x8f99('0x2')]},'body':{'type':Sequelize[_0x8f99('0x3')]('medium'),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0x8f99('0x4')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x8f99('0x3')]}}; \ No newline at end of file +var _0xa6eb=['medium','out','sequelize','exports','TEXT'];(function(_0x294889,_0x1e84d1){var _0x5a518e=function(_0x243c04){while(--_0x243c04){_0x294889['push'](_0x294889['shift']());}};_0x5a518e(++_0x1e84d1);}(_0xa6eb,0x10b));var _0xba6e=function(_0x3c7b9b,_0x3dedfd){_0x3c7b9b=_0x3c7b9b-0x0;var _0xb3c0c9=_0xa6eb[_0x3c7b9b];return _0xb3c0c9;};'use strict';var Sequelize=require(_0xba6e('0x0'));module[_0xba6e('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0xba6e('0x2')](_0xba6e('0x3')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xba6e('0x4'),'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 d2362ba..e6db5eb 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 _0x8893=['merge','type','options','includeAll','SquareMessage','findAll','catch','show','keys','rawAttributes','include','find','create','body','params','destroy','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','key','model','filters','intersection','query','attributes','fields','length','nolimit','sort','where','pick','filter'];(function(_0x238921,_0x584094){var _0x3a4eb6=function(_0x1f58f2){while(--_0x1f58f2){_0x238921['push'](_0x238921['shift']());}};_0x3a4eb6(++_0x584094);}(_0x8893,0x1ae));var _0x3889=function(_0x2f2306,_0x3acb45){_0x2f2306=_0x2f2306-0x0;var _0x377d53=_0x8893[_0x2f2306];return _0x377d53;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3889('0x0'));var zipdir=require(_0x3889('0x1'));var jsonpatch=require(_0x3889('0x2'));var rp=require('request-promise');var moment=require(_0x3889('0x3'));var BPromise=require(_0x3889('0x4'));var Mustache=require(_0x3889('0x5'));var util=require(_0x3889('0x6'));var path=require('path');var sox=require(_0x3889('0x7'));var csv=require(_0x3889('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3889('0x9'));var squel=require('squel');var crypto=require(_0x3889('0xa'));var jsforce=require(_0x3889('0xb'));var deskjs=require(_0x3889('0xc'));var toCsv=require(_0x3889('0x8'));var querystring=require('querystring');var Papa=require(_0x3889('0xd'));var Redis=require(_0x3889('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x3889('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3889('0x10'));var logger=require(_0x3889('0x11'))(_0x3889('0x12'));var utils=require(_0x3889('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x3889('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2458df,_0x1e22a4){_0x1e22a4=_0x1e22a4||0xcc;return function(_0x322d07){if(_0x322d07){return _0x2458df[_0x3889('0x15')](_0x1e22a4);}return _0x2458df['status'](_0x1e22a4)[_0x3889('0x16')]();};}function respondWithResult(_0x457d82,_0x441f42){_0x441f42=_0x441f42||0xc8;return function(_0x3ab901){if(_0x3ab901){return _0x457d82[_0x3889('0x17')](_0x441f42)['json'](_0x3ab901);}};}function respondWithFilteredResult(_0x9c77b5,_0x20499e){return function(_0x243325){if(_0x243325){var _0x49925c=typeof _0x20499e[_0x3889('0x18')]===_0x3889('0x19')&&typeof _0x20499e[_0x3889('0x1a')]===_0x3889('0x19');var _0x513a47=_0x243325[_0x3889('0x1b')];var _0x4b24bb=_0x49925c?0x0:_0x20499e['offset'];var _0x28744c=_0x49925c?_0x243325[_0x3889('0x1b')]:_0x20499e[_0x3889('0x18')]+_0x20499e['limit'];var _0x25f183;if(_0x28744c>=_0x513a47){_0x28744c=_0x513a47;_0x25f183=0xc8;}else{_0x25f183=0xce;}_0x9c77b5['status'](_0x25f183);return _0x9c77b5[_0x3889('0x1c')](_0x3889('0x1d'),_0x4b24bb+'-'+_0x28744c+'/'+_0x513a47)['json'](_0x243325);}return null;};}function patchUpdates(_0x519415){return function(_0x27ca78){try{jsonpatch[_0x3889('0x1e')](_0x27ca78,_0x519415,!![]);}catch(_0x4a2fca){return BPromise[_0x3889('0x1f')](_0x4a2fca);}return _0x27ca78['save']();};}function saveUpdates(_0x2e96fc,_0x3154c0){return function(_0x134547){if(_0x134547){return _0x134547[_0x3889('0x20')](_0x2e96fc)['then'](function(_0x30ec08){return _0x30ec08;});}return null;};}function removeEntity(_0x497b58,_0x5ded5f){return function(_0x32a7b3){if(_0x32a7b3){return _0x32a7b3['destroy']()[_0x3889('0x21')](function(){_0x497b58[_0x3889('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x22d7bd,_0x45bcb2){return function(_0xc6b0b6){if(!_0xc6b0b6){_0x22d7bd[_0x3889('0x15')](0x194);}return _0xc6b0b6;};}function handleError(_0xaa5c54,_0xcfcee){_0xcfcee=_0xcfcee||0x1f4;return function(_0x4b3e55){logger[_0x3889('0x22')](_0x4b3e55[_0x3889('0x23')]);if(_0x4b3e55[_0x3889('0x24')]){delete _0x4b3e55[_0x3889('0x24')];}_0xaa5c54[_0x3889('0x17')](_0xcfcee)[_0x3889('0x25')](_0x4b3e55);};}exports[_0x3889('0x26')]=function(_0x675a,_0x7791e3){var _0x550b3d={},_0x59ee1d={},_0x31c832={'count':0x0,'rows':[]};var _0x3fee51=_[_0x3889('0x27')](db['SquareMessage']['rawAttributes'],function(_0x3e11d6){return{'name':_0x3e11d6['fieldName'],'type':_0x3e11d6['type'][_0x3889('0x28')]};});_0x59ee1d[_0x3889('0x29')]=_[_0x3889('0x27')](_0x3fee51,_0x3889('0x24'));_0x59ee1d['query']=_['keys'](_0x675a['query']);_0x59ee1d[_0x3889('0x2a')]=_[_0x3889('0x2b')](_0x59ee1d[_0x3889('0x29')],_0x59ee1d[_0x3889('0x2c')]);_0x550b3d[_0x3889('0x2d')]=_[_0x3889('0x2b')](_0x59ee1d[_0x3889('0x29')],qs[_0x3889('0x2e')](_0x675a['query']['fields']));_0x550b3d[_0x3889('0x2d')]=_0x550b3d[_0x3889('0x2d')][_0x3889('0x2f')]?_0x550b3d['attributes']:_0x59ee1d['model'];if(!_0x675a[_0x3889('0x2c')]['hasOwnProperty'](_0x3889('0x30'))){_0x550b3d[_0x3889('0x1a')]=qs[_0x3889('0x1a')](_0x675a[_0x3889('0x2c')][_0x3889('0x1a')]);_0x550b3d['offset']=qs[_0x3889('0x18')](_0x675a['query'][_0x3889('0x18')]);}_0x550b3d['order']=qs['sort'](_0x675a['query'][_0x3889('0x31')]);_0x550b3d[_0x3889('0x32')]=qs[_0x3889('0x2a')](_[_0x3889('0x33')](_0x675a['query'],_0x59ee1d['filters']),_0x3fee51);if(_0x675a[_0x3889('0x2c')][_0x3889('0x34')]){_0x550b3d['where']=_[_0x3889('0x35')](_0x550b3d[_0x3889('0x32')],{'$or':_[_0x3889('0x27')](_0x3fee51,function(_0x85dbe3){if(_0x85dbe3[_0x3889('0x36')]!=='VIRTUAL'){var _0x54b8ae={};_0x54b8ae[_0x85dbe3[_0x3889('0x24')]]={'$like':'%'+_0x675a[_0x3889('0x2c')][_0x3889('0x34')]+'%'};return _0x54b8ae;}})});}_0x550b3d=_[_0x3889('0x35')]({},_0x550b3d,_0x675a[_0x3889('0x37')]);var _0x229935={'where':_0x550b3d[_0x3889('0x32')]};return db['SquareMessage']['count'](_0x229935)[_0x3889('0x21')](function(_0x542620){_0x31c832[_0x3889('0x1b')]=_0x542620;if(_0x675a[_0x3889('0x2c')][_0x3889('0x38')]){_0x550b3d['include']=[{'all':!![]}];}return db[_0x3889('0x39')][_0x3889('0x3a')](_0x550b3d);})[_0x3889('0x21')](function(_0x3620e7){_0x31c832['rows']=_0x3620e7;return _0x31c832;})[_0x3889('0x21')](respondWithFilteredResult(_0x7791e3,_0x550b3d))[_0x3889('0x3b')](handleError(_0x7791e3,null));};exports[_0x3889('0x3c')]=function(_0x1e0a12,_0x5bf631){var _0x10b199={'raw':!![],'where':{'id':_0x1e0a12['params']['id']}},_0x37687c={};_0x37687c[_0x3889('0x29')]=_[_0x3889('0x3d')](db[_0x3889('0x39')][_0x3889('0x3e')]);_0x37687c[_0x3889('0x2c')]=_[_0x3889('0x3d')](_0x1e0a12[_0x3889('0x2c')]);_0x37687c[_0x3889('0x2a')]=_['intersection'](_0x37687c[_0x3889('0x29')],_0x37687c[_0x3889('0x2c')]);_0x10b199[_0x3889('0x2d')]=_[_0x3889('0x2b')](_0x37687c['model'],qs[_0x3889('0x2e')](_0x1e0a12[_0x3889('0x2c')][_0x3889('0x2e')]));_0x10b199[_0x3889('0x2d')]=_0x10b199['attributes']['length']?_0x10b199[_0x3889('0x2d')]:_0x37687c[_0x3889('0x29')];if(_0x1e0a12[_0x3889('0x2c')][_0x3889('0x38')]){_0x10b199[_0x3889('0x3f')]=[{'all':!![]}];}_0x10b199=_[_0x3889('0x35')]({},_0x10b199,_0x1e0a12[_0x3889('0x37')]);return db[_0x3889('0x39')][_0x3889('0x40')](_0x10b199)[_0x3889('0x21')](handleEntityNotFound(_0x5bf631,null))[_0x3889('0x21')](respondWithResult(_0x5bf631,null))['catch'](handleError(_0x5bf631,null));};exports[_0x3889('0x41')]=function(_0x2ab7ec,_0x5a373a){return db[_0x3889('0x39')][_0x3889('0x41')](_0x2ab7ec[_0x3889('0x42')],{})[_0x3889('0x21')](respondWithResult(_0x5a373a,0xc9))['catch'](handleError(_0x5a373a,null));};exports[_0x3889('0x20')]=function(_0x353b7d,_0x662d8d){if(_0x353b7d[_0x3889('0x42')]['id']){delete _0x353b7d[_0x3889('0x42')]['id'];}return db[_0x3889('0x39')]['find']({'where':{'id':_0x353b7d[_0x3889('0x43')]['id']}})['then'](handleEntityNotFound(_0x662d8d,null))['then'](saveUpdates(_0x353b7d[_0x3889('0x42')],null))[_0x3889('0x21')](respondWithResult(_0x662d8d,null))[_0x3889('0x3b')](handleError(_0x662d8d,null));};exports[_0x3889('0x44')]=function(_0xfa86a7,_0x40c013){return db['SquareMessage']['find']({'where':{'id':_0xfa86a7[_0x3889('0x43')]['id']}})[_0x3889('0x21')](handleEntityNotFound(_0x40c013,null))[_0x3889('0x21')](removeEntity(_0x40c013,null))[_0x3889('0x3b')](handleError(_0x40c013,null));}; \ No newline at end of file +var _0x782f=['rows','catch','show','params','include','find','create','body','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','stack','name','send','index','SquareMessage','rawAttributes','fieldName','type','key','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','sort','where','filter','VIRTUAL','merge','includeAll'];(function(_0x5c70d0,_0xfeac42){var _0x484491=function(_0x533149){while(--_0x533149){_0x5c70d0['push'](_0x5c70d0['shift']());}};_0x484491(++_0xfeac42);}(_0x782f,0x1f2));var _0xf782=function(_0x5ecc37,_0x3954a8){_0x5ecc37=_0x5ecc37-0x0;var _0x446d15=_0x782f[_0x5ecc37];return _0x446d15;};'use strict';var emlformat=require(_0xf782('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf782('0x1'));var rp=require(_0xf782('0x2'));var moment=require(_0xf782('0x3'));var BPromise=require(_0xf782('0x4'));var Mustache=require(_0xf782('0x5'));var util=require(_0xf782('0x6'));var path=require('path');var sox=require(_0xf782('0x7'));var csv=require(_0xf782('0x8'));var ejs=require(_0xf782('0x9'));var fs=require('fs');var fs_extra=require(_0xf782('0xa'));var _=require(_0xf782('0xb'));var squel=require('squel');var crypto=require(_0xf782('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf782('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf782('0xe'));var qs=require(_0xf782('0xf'));var as=require(_0xf782('0x10'));var hardwareService=require(_0xf782('0x11'));var logger=require(_0xf782('0x12'))(_0xf782('0x13'));var utils=require(_0xf782('0x14'));var config=require(_0xf782('0x15'));var licenseUtil=require(_0xf782('0x16'));var db=require(_0xf782('0x17'))['db'];function respondWithStatusCode(_0x22ebfa,_0x358bd4){_0x358bd4=_0x358bd4||0xcc;return function(_0x51c487){if(_0x51c487){return _0x22ebfa[_0xf782('0x18')](_0x358bd4);}return _0x22ebfa[_0xf782('0x19')](_0x358bd4)[_0xf782('0x1a')]();};}function respondWithResult(_0x4a51e1,_0x29fbca){_0x29fbca=_0x29fbca||0xc8;return function(_0x443343){if(_0x443343){return _0x4a51e1[_0xf782('0x19')](_0x29fbca)[_0xf782('0x1b')](_0x443343);}};}function respondWithFilteredResult(_0x379624,_0x25b136){return function(_0x4d292e){if(_0x4d292e){var _0x575907=typeof _0x25b136[_0xf782('0x1c')]===_0xf782('0x1d')&&typeof _0x25b136[_0xf782('0x1e')]===_0xf782('0x1d');var _0x1d71c5=_0x4d292e[_0xf782('0x1f')];var _0x304993=_0x575907?0x0:_0x25b136['offset'];var _0x4a4997=_0x575907?_0x4d292e['count']:_0x25b136[_0xf782('0x1c')]+_0x25b136['limit'];var _0x1cfe27;if(_0x4a4997>=_0x1d71c5){_0x4a4997=_0x1d71c5;_0x1cfe27=0xc8;}else{_0x1cfe27=0xce;}_0x379624[_0xf782('0x19')](_0x1cfe27);return _0x379624[_0xf782('0x20')](_0xf782('0x21'),_0x304993+'-'+_0x4a4997+'/'+_0x1d71c5)[_0xf782('0x1b')](_0x4d292e);}return null;};}function patchUpdates(_0x56f3ce){return function(_0x124067){try{jsonpatch[_0xf782('0x22')](_0x124067,_0x56f3ce,!![]);}catch(_0x574087){return BPromise[_0xf782('0x23')](_0x574087);}return _0x124067['save']();};}function saveUpdates(_0x44a02f,_0x5a2e14){return function(_0x71efa6){if(_0x71efa6){return _0x71efa6['update'](_0x44a02f)[_0xf782('0x24')](function(_0x4dca34){return _0x4dca34;});}return null;};}function removeEntity(_0x59e8c6,_0x512ff5){return function(_0x538675){if(_0x538675){return _0x538675[_0xf782('0x25')]()['then'](function(){_0x59e8c6[_0xf782('0x19')](0xcc)[_0xf782('0x1a')]();});}};}function handleEntityNotFound(_0x399ad9,_0xe07f30){return function(_0x28dc56){if(!_0x28dc56){_0x399ad9[_0xf782('0x18')](0x194);}return _0x28dc56;};}function handleError(_0x10bf94,_0xfb5a71){_0xfb5a71=_0xfb5a71||0x1f4;return function(_0x2e4b9e){logger['error'](_0x2e4b9e[_0xf782('0x26')]);if(_0x2e4b9e['name']){delete _0x2e4b9e[_0xf782('0x27')];}_0x10bf94['status'](_0xfb5a71)[_0xf782('0x28')](_0x2e4b9e);};}exports[_0xf782('0x29')]=function(_0x17da37,_0x2daefb){var _0x4cf367={},_0x132b0c={},_0x559e17={'count':0x0,'rows':[]};var _0x31e66f=_['map'](db[_0xf782('0x2a')][_0xf782('0x2b')],function(_0x46ff3d){return{'name':_0x46ff3d[_0xf782('0x2c')],'type':_0x46ff3d[_0xf782('0x2d')][_0xf782('0x2e')]};});_0x132b0c[_0xf782('0x2f')]=_['map'](_0x31e66f,_0xf782('0x27'));_0x132b0c['query']=_[_0xf782('0x30')](_0x17da37['query']);_0x132b0c[_0xf782('0x31')]=_['intersection'](_0x132b0c[_0xf782('0x2f')],_0x132b0c[_0xf782('0x32')]);_0x4cf367[_0xf782('0x33')]=_[_0xf782('0x34')](_0x132b0c['model'],qs['fields'](_0x17da37[_0xf782('0x32')][_0xf782('0x35')]));_0x4cf367['attributes']=_0x4cf367[_0xf782('0x33')][_0xf782('0x36')]?_0x4cf367[_0xf782('0x33')]:_0x132b0c[_0xf782('0x2f')];if(!_0x17da37[_0xf782('0x32')][_0xf782('0x37')]('nolimit')){_0x4cf367[_0xf782('0x1e')]=qs[_0xf782('0x1e')](_0x17da37['query'][_0xf782('0x1e')]);_0x4cf367[_0xf782('0x1c')]=qs[_0xf782('0x1c')](_0x17da37[_0xf782('0x32')][_0xf782('0x1c')]);}_0x4cf367['order']=qs['sort'](_0x17da37[_0xf782('0x32')][_0xf782('0x38')]);_0x4cf367[_0xf782('0x39')]=qs[_0xf782('0x31')](_['pick'](_0x17da37['query'],_0x132b0c[_0xf782('0x31')]),_0x31e66f);if(_0x17da37[_0xf782('0x32')][_0xf782('0x3a')]){_0x4cf367[_0xf782('0x39')]=_['merge'](_0x4cf367['where'],{'$or':_['map'](_0x31e66f,function(_0xf63a45){if(_0xf63a45[_0xf782('0x2d')]!==_0xf782('0x3b')){var _0x21a8e2={};_0x21a8e2[_0xf63a45[_0xf782('0x27')]]={'$like':'%'+_0x17da37[_0xf782('0x32')]['filter']+'%'};return _0x21a8e2;}})});}_0x4cf367=_[_0xf782('0x3c')]({},_0x4cf367,_0x17da37['options']);var _0x21a9d8={'where':_0x4cf367['where']};return db[_0xf782('0x2a')]['count'](_0x21a9d8)[_0xf782('0x24')](function(_0x591531){_0x559e17[_0xf782('0x1f')]=_0x591531;if(_0x17da37[_0xf782('0x32')][_0xf782('0x3d')]){_0x4cf367['include']=[{'all':!![]}];}return db[_0xf782('0x2a')]['findAll'](_0x4cf367);})[_0xf782('0x24')](function(_0x135aee){_0x559e17[_0xf782('0x3e')]=_0x135aee;return _0x559e17;})[_0xf782('0x24')](respondWithFilteredResult(_0x2daefb,_0x4cf367))[_0xf782('0x3f')](handleError(_0x2daefb,null));};exports[_0xf782('0x40')]=function(_0xfec2c3,_0x36a13f){var _0x410383={'raw':!![],'where':{'id':_0xfec2c3[_0xf782('0x41')]['id']}},_0x63ea7d={};_0x63ea7d[_0xf782('0x2f')]=_['keys'](db[_0xf782('0x2a')][_0xf782('0x2b')]);_0x63ea7d[_0xf782('0x32')]=_[_0xf782('0x30')](_0xfec2c3[_0xf782('0x32')]);_0x63ea7d[_0xf782('0x31')]=_[_0xf782('0x34')](_0x63ea7d[_0xf782('0x2f')],_0x63ea7d['query']);_0x410383[_0xf782('0x33')]=_[_0xf782('0x34')](_0x63ea7d[_0xf782('0x2f')],qs[_0xf782('0x35')](_0xfec2c3[_0xf782('0x32')][_0xf782('0x35')]));_0x410383[_0xf782('0x33')]=_0x410383[_0xf782('0x33')][_0xf782('0x36')]?_0x410383['attributes']:_0x63ea7d[_0xf782('0x2f')];if(_0xfec2c3[_0xf782('0x32')][_0xf782('0x3d')]){_0x410383[_0xf782('0x42')]=[{'all':!![]}];}_0x410383=_[_0xf782('0x3c')]({},_0x410383,_0xfec2c3['options']);return db[_0xf782('0x2a')][_0xf782('0x43')](_0x410383)['then'](handleEntityNotFound(_0x36a13f,null))[_0xf782('0x24')](respondWithResult(_0x36a13f,null))['catch'](handleError(_0x36a13f,null));};exports[_0xf782('0x44')]=function(_0xbb87f2,_0x234ee5){return db[_0xf782('0x2a')][_0xf782('0x44')](_0xbb87f2['body'],{})[_0xf782('0x24')](respondWithResult(_0x234ee5,0xc9))[_0xf782('0x3f')](handleError(_0x234ee5,null));};exports['update']=function(_0x1b370c,_0xf71bd6){if(_0x1b370c[_0xf782('0x45')]['id']){delete _0x1b370c[_0xf782('0x45')]['id'];}return db[_0xf782('0x2a')]['find']({'where':{'id':_0x1b370c['params']['id']}})['then'](handleEntityNotFound(_0xf71bd6,null))['then'](saveUpdates(_0x1b370c[_0xf782('0x45')],null))['then'](respondWithResult(_0xf71bd6,null))[_0xf782('0x3f')](handleError(_0xf71bd6,null));};exports['destroy']=function(_0x34d427,_0x31fefe){return db[_0xf782('0x2a')][_0xf782('0x43')]({'where':{'id':_0x34d427['params']['id']}})[_0xf782('0x24')](handleEntityNotFound(_0x31fefe,null))['then'](removeEntity(_0x31fefe,null))[_0xf782('0x3f')](handleError(_0x31fefe,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 4b252e3..84b3a0b 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 _0x47dc=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','define','SquareMessage','square_messages','lodash','util'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x47dc,0xca));var _0xc47d=function(_0x1ee780,_0x39ef31){_0x1ee780=_0x1ee780-0x0;var _0x40ef69=_0x47dc[_0x1ee780];return _0x40ef69;};'use strict';var _=require(_0xc47d('0x0'));var util=require(_0xc47d('0x1'));var logger=require(_0xc47d('0x2'))(_0xc47d('0x3'));var moment=require(_0xc47d('0x4'));var BPromise=require(_0xc47d('0x5'));var rp=require(_0xc47d('0x6'));var fs=require('fs');var path=require(_0xc47d('0x7'));var rimraf=require(_0xc47d('0x8'));var config=require('../../config/environment');var attributes=require('./squareMessage.attributes');module['exports']=function(_0x51420,_0x3ae517){return _0x51420[_0xc47d('0x9')](_0xc47d('0xa'),attributes,{'tableName':_0xc47d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x359d=['SquareMessage','util','api','moment','bluebird','request-promise','path','rimraf','exports'];(function(_0xc1801d,_0x4aeb72){var _0x462352=function(_0x3b59cd){while(--_0x3b59cd){_0xc1801d['push'](_0xc1801d['shift']());}};_0x462352(++_0x4aeb72);}(_0x359d,0xeb));var _0xd359=function(_0x539fb2,_0x5b6718){_0x539fb2=_0x539fb2-0x0;var _0x4d583d=_0x359d[_0x539fb2];return _0x4d583d;};'use strict';var _=require('lodash');var util=require(_0xd359('0x0'));var logger=require('../../config/logger')(_0xd359('0x1'));var moment=require(_0xd359('0x2'));var BPromise=require(_0xd359('0x3'));var rp=require(_0xd359('0x4'));var fs=require('fs');var path=require(_0xd359('0x5'));var rimraf=require(_0xd359('0x6'));var config=require('../../config/environment');var attributes=require('./squareMessage.attributes');module[_0xd359('0x7')]=function(_0x49c4d9,_0x1e1fa7){return _0x49c4d9['define'](_0xd359('0x8'),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 acf6204..a8dbf47 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 _0x57e9=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','CreateSquareMessage','SquareMessage','create','body','options','raw','catch','lodash','util','moment'];(function(_0x8c63b2,_0x5e32cf){var _0x41fb36=function(_0x30ac90){while(--_0x30ac90){_0x8c63b2['push'](_0x8c63b2['shift']());}};_0x41fb36(++_0x5e32cf);}(_0x57e9,0x14d));var _0x957e=function(_0x375d48,_0x438722){_0x375d48=_0x375d48-0x0;var _0x4e7d12=_0x57e9[_0x375d48];return _0x4e7d12;};'use strict';var _=require(_0x957e('0x0'));var util=require(_0x957e('0x1'));var moment=require(_0x957e('0x2'));var BPromise=require(_0x957e('0x3'));var rs=require(_0x957e('0x4'));var fs=require('fs');var Redis=require(_0x957e('0x5'));var db=require(_0x957e('0x6'))['db'];var utils=require(_0x957e('0x7'));var logger=require(_0x957e('0x8'))(_0x957e('0x9'));var config=require(_0x957e('0xa'));var jayson=require(_0x957e('0xb'));var client=jayson[_0x957e('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b7ef9,_0x5b9f79,_0x27d662){return new BPromise(function(_0x45f783,_0xf209a9){return client['request'](_0x2b7ef9,_0x27d662)[_0x957e('0xd')](function(_0x266746){logger[_0x957e('0xe')](_0x957e('0xf'),_0x5b9f79,_0x957e('0x10'));logger['debug'](_0x957e('0x11'),_0x5b9f79,_0x957e('0x10'),JSON[_0x957e('0x12')](_0x266746));if(_0x266746['error']){if(_0x266746[_0x957e('0x13')]['code']===0x1f4){logger[_0x957e('0x13')](_0x957e('0xf'),_0x5b9f79,_0x266746[_0x957e('0x13')]['message']);return _0xf209a9(_0x266746[_0x957e('0x13')][_0x957e('0x14')]);}logger[_0x957e('0x13')](_0x957e('0xf'),_0x5b9f79,_0x266746[_0x957e('0x13')]['message']);return _0x45f783(_0x266746[_0x957e('0x13')][_0x957e('0x14')]);}else{logger[_0x957e('0xe')]('SquareMessage,\x20%s,\x20%s',_0x5b9f79,_0x957e('0x10'));_0x45f783(_0x266746['result'][_0x957e('0x14')]);}})['catch'](function(_0x73acc9){logger['error']('SquareMessage,\x20%s,\x20%s',_0x5b9f79,_0x73acc9);_0xf209a9(_0x73acc9);});});}exports[_0x957e('0x15')]=function(_0x4157c3){var _0x5095dc=this;return new Promise(function(_0x29115b,_0x25b526){return db[_0x957e('0x16')][_0x957e('0x17')](_0x4157c3[_0x957e('0x18')],{'raw':_0x4157c3['options']?_0x4157c3[_0x957e('0x19')][_0x957e('0x1a')]===undefined?!![]:![]:!![]})[_0x957e('0xd')](function(_0x15b24e){logger['info'](_0x957e('0x15'),_0x4157c3);logger['debug']('CreateSquareMessage',_0x4157c3,JSON[_0x957e('0x12')](_0x15b24e));_0x29115b(_0x15b24e);})[_0x957e('0x1b')](function(_0x503ce9){logger[_0x957e('0x13')]('CreateSquareMessage',_0x503ce9[_0x957e('0x14')],_0x4157c3);_0x25b526(_0x5095dc[_0x957e('0x13')](0x1f4,_0x503ce9[_0x957e('0x14')]));});});}; \ No newline at end of file +var _0x2222=['body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','CreateSquareMessage','SquareMessage','create'];(function(_0x355b68,_0x4ae2ba){var _0x1bf0ce=function(_0x553278){while(--_0x553278){_0x355b68['push'](_0x355b68['shift']());}};_0x1bf0ce(++_0x4ae2ba);}(_0x2222,0x1f0));var _0x2222=function(_0x27a7a0,_0x42c153){_0x27a7a0=_0x27a7a0-0x0;var _0x56cc00=_0x2222[_0x27a7a0];return _0x56cc00;};'use strict';var _=require(_0x2222('0x0'));var util=require(_0x2222('0x1'));var moment=require(_0x2222('0x2'));var BPromise=require(_0x2222('0x3'));var rs=require(_0x2222('0x4'));var fs=require('fs');var Redis=require(_0x2222('0x5'));var db=require(_0x2222('0x6'))['db'];var utils=require(_0x2222('0x7'));var logger=require(_0x2222('0x8'))(_0x2222('0x9'));var config=require(_0x2222('0xa'));var jayson=require(_0x2222('0xb'));var client=jayson[_0x2222('0xc')][_0x2222('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x35ebff,_0x3fb97d,_0x76a414){return new BPromise(function(_0x2706b9,_0x524ede){return client[_0x2222('0xe')](_0x35ebff,_0x76a414)['then'](function(_0x2d6a96){logger[_0x2222('0xf')](_0x2222('0x10'),_0x3fb97d,_0x2222('0x11'));logger[_0x2222('0x12')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x3fb97d,'request\x20sent',JSON['stringify'](_0x2d6a96));if(_0x2d6a96['error']){if(_0x2d6a96[_0x2222('0x13')][_0x2222('0x14')]===0x1f4){logger[_0x2222('0x13')](_0x2222('0x10'),_0x3fb97d,_0x2d6a96[_0x2222('0x13')][_0x2222('0x15')]);return _0x524ede(_0x2d6a96[_0x2222('0x13')][_0x2222('0x15')]);}logger[_0x2222('0x13')]('SquareMessage,\x20%s,\x20%s',_0x3fb97d,_0x2d6a96[_0x2222('0x13')][_0x2222('0x15')]);return _0x2706b9(_0x2d6a96['error']['message']);}else{logger[_0x2222('0xf')]('SquareMessage,\x20%s,\x20%s',_0x3fb97d,_0x2222('0x11'));_0x2706b9(_0x2d6a96['result'][_0x2222('0x15')]);}})[_0x2222('0x16')](function(_0x305628){logger[_0x2222('0x13')](_0x2222('0x10'),_0x3fb97d,_0x305628);_0x524ede(_0x305628);});});}exports[_0x2222('0x17')]=function(_0x7d2bf2){var _0x3d0f02=this;return new Promise(function(_0x4d2b5c,_0x572d5c){return db[_0x2222('0x18')][_0x2222('0x19')](_0x7d2bf2[_0x2222('0x1a')],{'raw':_0x7d2bf2['options']?_0x7d2bf2[_0x2222('0x1b')][_0x2222('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x1863d6){logger[_0x2222('0xf')](_0x2222('0x17'),_0x7d2bf2);logger[_0x2222('0x12')](_0x2222('0x17'),_0x7d2bf2,JSON['stringify'](_0x1863d6));_0x4d2b5c(_0x1863d6);})[_0x2222('0x16')](function(_0x2dfc52){logger['error'](_0x2222('0x17'),_0x2dfc52[_0x2222('0x15')],_0x7d2bf2);_0x572d5c(_0x3d0f02['error'](0x1f4,_0x2dfc52[_0x2222('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index a127c8a..4164dd8 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 _0xf40e=['update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','/:id/test','15s','test','post','create','put'];(function(_0xe6e78c,_0x582369){var _0x2a09c8=function(_0x470ccc){while(--_0x470ccc){_0xe6e78c['push'](_0xe6e78c['shift']());}};_0x2a09c8(++_0x582369);}(_0xf40e,0x1b8));var _0xef40=function(_0x3ecbf7,_0x1dc747){_0x3ecbf7=_0x3ecbf7-0x0;var _0x144bf2=_0xf40e[_0x3ecbf7];return _0x144bf2;};'use strict';var multer=require(_0xef40('0x0'));var util=require('util');var path=require(_0xef40('0x1'));var timeout=require(_0xef40('0x2'));var express=require(_0xef40('0x3'));var router=express[_0xef40('0x4')]();var fs_extra=require(_0xef40('0x5'));var auth=require(_0xef40('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xef40('0x7'));var controller=require(_0xef40('0x8'));router[_0xef40('0x9')]('/',auth[_0xef40('0xa')](),controller[_0xef40('0xb')]);router[_0xef40('0x9')](_0xef40('0xc'),auth[_0xef40('0xa')](),controller[_0xef40('0xd')]);router[_0xef40('0x9')](_0xef40('0xe'),auth['isAuthenticated'](),timeout(_0xef40('0xf')),controller[_0xef40('0x10')]);router[_0xef40('0x11')]('/',auth['isAuthenticated'](),controller[_0xef40('0x12')]);router[_0xef40('0x13')](_0xef40('0xc'),auth['isAuthenticated'](),controller[_0xef40('0x14')]);router[_0xef40('0x15')](_0xef40('0xc'),auth[_0xef40('0xa')](),controller['destroy']);module[_0xef40('0x16')]=router; \ No newline at end of file +var _0x3086=['destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','isAuthenticated','index','get','/:id','show','/:id/test','post','create','put','update'];(function(_0x5c587a,_0x4dba89){var _0x28d19e=function(_0x4e8056){while(--_0x4e8056){_0x5c587a['push'](_0x5c587a['shift']());}};_0x28d19e(++_0x4dba89);}(_0x3086,0x18e));var _0x6308=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x3086[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require(_0x6308('0x0'));var util=require(_0x6308('0x1'));var path=require(_0x6308('0x2'));var timeout=require('connect-timeout');var express=require(_0x6308('0x3'));var router=express[_0x6308('0x4')]();var fs_extra=require(_0x6308('0x5'));var auth=require(_0x6308('0x6'));var interaction=require(_0x6308('0x7'));var config=require(_0x6308('0x8'));var controller=require(_0x6308('0x9'));router['get']('/',auth[_0x6308('0xa')](),controller[_0x6308('0xb')]);router[_0x6308('0xc')](_0x6308('0xd'),auth['isAuthenticated'](),controller[_0x6308('0xe')]);router[_0x6308('0xc')](_0x6308('0xf'),auth[_0x6308('0xa')](),timeout('15s'),controller['test']);router[_0x6308('0x10')]('/',auth[_0x6308('0xa')](),controller[_0x6308('0x11')]);router[_0x6308('0x12')](_0x6308('0xd'),auth[_0x6308('0xa')](),controller[_0x6308('0x13')]);router['delete'](_0x6308('0xd'),auth['isAuthenticated'](),controller[_0x6308('0x14')]);module[_0x6308('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 29e37d4..e470c91 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 _0x883b=['sequelize','exports','STRING','name'];(function(_0x298b54,_0x437f0b){var _0x2c9272=function(_0xf4c912){while(--_0xf4c912){_0x298b54['push'](_0x298b54['shift']());}};_0x2c9272(++_0x437f0b);}(_0x883b,0x64));var _0xb883=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x883b[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xb883('0x0'));module[_0xb883('0x1')]={'name':{'type':Sequelize[_0xb883('0x2')],'unique':_0xb883('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0xb883('0x2')]},'description':{'type':Sequelize[_0xb883('0x2')]}}; \ No newline at end of file +var _0x4af5=['exports','STRING','sequelize'];(function(_0xe8e1b0,_0x324e50){var _0x6e714a=function(_0x16c036){while(--_0x16c036){_0xe8e1b0['push'](_0xe8e1b0['shift']());}};_0x6e714a(++_0x324e50);}(_0x4af5,0x1f1));var _0x54af=function(_0x14499b,_0x4aa513){_0x14499b=_0x14499b-0x0;var _0x316bc4=_0x4af5[_0x14499b];return _0x316bc4;};'use strict';var Sequelize=require(_0x54af('0x0'));module[_0x54af('0x1')]={'name':{'type':Sequelize[_0x54af('0x2')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0x54af('0x2')]},'description':{'type':Sequelize[_0x54af('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 0951db3..e72044c 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 _0x00b6=['test','dsn','odbc','openSync','closeSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','UserProfileResource','error','name','send','index','SquareOdbc','rawAttributes','fieldName','type','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','ODBC','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy'];(function(_0x2f48d4,_0x29b0fd){var _0x515c6f=function(_0x4b71c9){while(--_0x4b71c9){_0x2f48d4['push'](_0x2f48d4['shift']());}};_0x515c6f(++_0x29b0fd);}(_0x00b6,0x113));var _0x600b=function(_0x5a636f,_0x3fec2b){_0x5a636f=_0x5a636f-0x0;var _0x6a8cfb=_0x00b6[_0x5a636f];return _0x6a8cfb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x600b('0x0'));var zipdir=require(_0x600b('0x1'));var jsonpatch=require(_0x600b('0x2'));var rp=require(_0x600b('0x3'));var moment=require(_0x600b('0x4'));var BPromise=require(_0x600b('0x5'));var Mustache=require(_0x600b('0x6'));var util=require(_0x600b('0x7'));var path=require('path');var sox=require(_0x600b('0x8'));var csv=require(_0x600b('0x9'));var ejs=require(_0x600b('0xa'));var fs=require('fs');var fs_extra=require(_0x600b('0xb'));var _=require('lodash');var squel=require(_0x600b('0xc'));var crypto=require(_0x600b('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x600b('0x9'));var querystring=require(_0x600b('0xe'));var Papa=require(_0x600b('0xf'));var Redis=require(_0x600b('0x10'));var authService=require(_0x600b('0x11'));var qs=require(_0x600b('0x12'));var as=require(_0x600b('0x13'));var hardwareService=require(_0x600b('0x14'));var logger=require(_0x600b('0x15'))(_0x600b('0x16'));var utils=require(_0x600b('0x17'));var config=require(_0x600b('0x18'));var licenseUtil=require(_0x600b('0x19'));var db=require(_0x600b('0x1a'))['db'];function respondWithStatusCode(_0x390d61,_0x41c617){_0x41c617=_0x41c617||0xcc;return function(_0xc7f37e){if(_0xc7f37e){return _0x390d61[_0x600b('0x1b')](_0x41c617);}return _0x390d61[_0x600b('0x1c')](_0x41c617)[_0x600b('0x1d')]();};}function respondWithResult(_0x37cbab,_0x5ab3f9){_0x5ab3f9=_0x5ab3f9||0xc8;return function(_0x3bc451){if(_0x3bc451){return _0x37cbab[_0x600b('0x1c')](_0x5ab3f9)[_0x600b('0x1e')](_0x3bc451);}};}function respondWithFilteredResult(_0x5362e4,_0xc77ece){return function(_0x1f40ba){if(_0x1f40ba){var _0x498ff6=typeof _0xc77ece[_0x600b('0x1f')]===_0x600b('0x20')&&typeof _0xc77ece[_0x600b('0x21')]==='undefined';var _0x74a1d0=_0x1f40ba[_0x600b('0x22')];var _0x1edc71=_0x498ff6?0x0:_0xc77ece[_0x600b('0x1f')];var _0x2cc77c=_0x498ff6?_0x1f40ba[_0x600b('0x22')]:_0xc77ece['offset']+_0xc77ece['limit'];var _0x3acdcc;if(_0x2cc77c>=_0x74a1d0){_0x2cc77c=_0x74a1d0;_0x3acdcc=0xc8;}else{_0x3acdcc=0xce;}_0x5362e4[_0x600b('0x1c')](_0x3acdcc);return _0x5362e4[_0x600b('0x23')](_0x600b('0x24'),_0x1edc71+'-'+_0x2cc77c+'/'+_0x74a1d0)[_0x600b('0x1e')](_0x1f40ba);}return null;};}function patchUpdates(_0x5d92ec){return function(_0x184fdc){try{jsonpatch[_0x600b('0x25')](_0x184fdc,_0x5d92ec,!![]);}catch(_0x14f997){return BPromise['reject'](_0x14f997);}return _0x184fdc[_0x600b('0x26')]();};}function saveUpdates(_0x53c3b7,_0x292a98){return function(_0x34b545){if(_0x34b545){return _0x34b545[_0x600b('0x27')](_0x53c3b7)[_0x600b('0x28')](function(_0x4bca5d){return _0x4bca5d;});}return null;};}function removeEntity(_0x4f10ee,_0x3bb776){return function(_0x44a847){if(_0x44a847){return _0x44a847['destroy']()['then'](function(){var _0x3a724e=_0x44a847['get']({'plain':!![]});var _0xb94cb='ODBC';return db[_0x600b('0x29')]['destroy']({'where':{'type':_0xb94cb,'resourceId':_0x3a724e['id']}})[_0x600b('0x28')](function(){return _0x44a847;});})[_0x600b('0x28')](function(){_0x4f10ee[_0x600b('0x1c')](0xcc)[_0x600b('0x1d')]();});}};}function handleEntityNotFound(_0x5387cd,_0x1016a3){return function(_0x38dc67){if(!_0x38dc67){_0x5387cd[_0x600b('0x1b')](0x194);}return _0x38dc67;};}function handleError(_0x325223,_0x394415){_0x394415=_0x394415||0x1f4;return function(_0xfc3e46){logger[_0x600b('0x2a')](_0xfc3e46['stack']);if(_0xfc3e46[_0x600b('0x2b')]){delete _0xfc3e46[_0x600b('0x2b')];}_0x325223[_0x600b('0x1c')](_0x394415)[_0x600b('0x2c')](_0xfc3e46);};}exports[_0x600b('0x2d')]=function(_0x422aac,_0x4ce6ac){var _0x224f91={},_0x4a73b4={},_0x5c029b={'count':0x0,'rows':[]};var _0x354361=_['map'](db[_0x600b('0x2e')][_0x600b('0x2f')],function(_0x58b5b2){return{'name':_0x58b5b2[_0x600b('0x30')],'type':_0x58b5b2[_0x600b('0x31')]['key']};});_0x4a73b4[_0x600b('0x32')]=_[_0x600b('0x33')](_0x354361,'name');_0x4a73b4[_0x600b('0x34')]=_[_0x600b('0x35')](_0x422aac[_0x600b('0x34')]);_0x4a73b4['filters']=_[_0x600b('0x36')](_0x4a73b4[_0x600b('0x32')],_0x4a73b4[_0x600b('0x34')]);_0x224f91[_0x600b('0x37')]=_[_0x600b('0x36')](_0x4a73b4[_0x600b('0x32')],qs[_0x600b('0x38')](_0x422aac[_0x600b('0x34')][_0x600b('0x38')]));_0x224f91[_0x600b('0x37')]=_0x224f91[_0x600b('0x37')][_0x600b('0x39')]?_0x224f91[_0x600b('0x37')]:_0x4a73b4[_0x600b('0x32')];if(!_0x422aac[_0x600b('0x34')][_0x600b('0x3a')](_0x600b('0x3b'))){_0x224f91['limit']=qs[_0x600b('0x21')](_0x422aac[_0x600b('0x34')]['limit']);_0x224f91['offset']=qs[_0x600b('0x1f')](_0x422aac[_0x600b('0x34')]['offset']);}_0x224f91[_0x600b('0x3c')]=qs[_0x600b('0x3d')](_0x422aac[_0x600b('0x34')][_0x600b('0x3d')]);_0x224f91[_0x600b('0x3e')]=qs[_0x600b('0x3f')](_[_0x600b('0x40')](_0x422aac[_0x600b('0x34')],_0x4a73b4[_0x600b('0x3f')]),_0x354361);if(_0x422aac[_0x600b('0x34')][_0x600b('0x41')]){_0x224f91[_0x600b('0x3e')]=_['merge'](_0x224f91[_0x600b('0x3e')],{'$or':_['map'](_0x354361,function(_0x44c5bb){if(_0x44c5bb['type']!==_0x600b('0x42')){var _0x3dc041={};_0x3dc041[_0x44c5bb[_0x600b('0x2b')]]={'$like':'%'+_0x422aac[_0x600b('0x34')][_0x600b('0x41')]+'%'};return _0x3dc041;}})});}_0x224f91=_[_0x600b('0x43')]({},_0x224f91,_0x422aac[_0x600b('0x44')]);var _0x4aba4f={'where':_0x224f91[_0x600b('0x3e')]};return db[_0x600b('0x2e')]['count'](_0x4aba4f)[_0x600b('0x28')](function(_0x1243c5){_0x5c029b['count']=_0x1243c5;if(_0x422aac[_0x600b('0x34')][_0x600b('0x45')]){_0x224f91[_0x600b('0x46')]=[{'all':!![]}];}return db[_0x600b('0x2e')][_0x600b('0x47')](_0x224f91);})['then'](function(_0x10d7f9){_0x5c029b['rows']=_0x10d7f9;return _0x5c029b;})[_0x600b('0x28')](respondWithFilteredResult(_0x4ce6ac,_0x224f91))[_0x600b('0x48')](handleError(_0x4ce6ac,null));};exports['show']=function(_0x2e93b4,_0x53830c){var _0x15f387={'raw':!![],'where':{'id':_0x2e93b4[_0x600b('0x49')]['id']}},_0x7fa4a5={};_0x7fa4a5[_0x600b('0x32')]=_[_0x600b('0x35')](db[_0x600b('0x2e')][_0x600b('0x2f')]);_0x7fa4a5[_0x600b('0x34')]=_[_0x600b('0x35')](_0x2e93b4[_0x600b('0x34')]);_0x7fa4a5[_0x600b('0x3f')]=_[_0x600b('0x36')](_0x7fa4a5[_0x600b('0x32')],_0x7fa4a5['query']);_0x15f387[_0x600b('0x37')]=_['intersection'](_0x7fa4a5[_0x600b('0x32')],qs[_0x600b('0x38')](_0x2e93b4[_0x600b('0x34')][_0x600b('0x38')]));_0x15f387['attributes']=_0x15f387[_0x600b('0x37')][_0x600b('0x39')]?_0x15f387[_0x600b('0x37')]:_0x7fa4a5[_0x600b('0x32')];if(_0x2e93b4['query'][_0x600b('0x45')]){_0x15f387['include']=[{'all':!![]}];}_0x15f387=_['merge']({},_0x15f387,_0x2e93b4[_0x600b('0x44')]);return db[_0x600b('0x2e')][_0x600b('0x4a')](_0x15f387)[_0x600b('0x28')](handleEntityNotFound(_0x53830c,null))['then'](respondWithResult(_0x53830c,null))[_0x600b('0x48')](handleError(_0x53830c,null));};exports[_0x600b('0x4b')]=function(_0x1f7d4c,_0x2c5f92){return db[_0x600b('0x2e')][_0x600b('0x4b')](_0x1f7d4c[_0x600b('0x4c')],{})['then'](function(_0x4cf8ce){var _0x2c28d5=_0x1f7d4c[_0x600b('0x4d')][_0x600b('0x4e')]({'plain':!![]});if(!_0x2c28d5)throw new Error(_0x600b('0x4f'));if(_0x2c28d5['role']==='user'){var _0x2fb784=_0x4cf8ce[_0x600b('0x4e')]({'plain':!![]});var _0x4235ec=_0x600b('0x50');return db[_0x600b('0x51')][_0x600b('0x4a')]({'where':{'name':_0x4235ec,'userProfileId':_0x2c28d5['userProfileId']},'raw':!![]})[_0x600b('0x28')](function(_0x20fc51){if(_0x20fc51&&_0x20fc51[_0x600b('0x52')]===0x0){return db[_0x600b('0x29')][_0x600b('0x4b')]({'name':_0x2fb784[_0x600b('0x2b')],'resourceId':_0x2fb784['id'],'type':_0x20fc51['name'],'sectionId':_0x20fc51['id']},{})[_0x600b('0x28')](function(){return _0x4cf8ce;});}else{return _0x4cf8ce;}})[_0x600b('0x48')](function(_0x209392){logger[_0x600b('0x2a')](_0x600b('0x53'),_0x209392);throw _0x209392;});}return _0x4cf8ce;})[_0x600b('0x28')](respondWithResult(_0x2c5f92,0xc9))[_0x600b('0x48')](handleError(_0x2c5f92,null));};exports[_0x600b('0x27')]=function(_0x4ae875,_0x417330){if(_0x4ae875['body']['id']){delete _0x4ae875['body']['id'];}return db[_0x600b('0x2e')]['find']({'where':{'id':_0x4ae875[_0x600b('0x49')]['id']}})[_0x600b('0x28')](handleEntityNotFound(_0x417330,null))[_0x600b('0x28')](saveUpdates(_0x4ae875[_0x600b('0x4c')],null))[_0x600b('0x28')](respondWithResult(_0x417330,null))[_0x600b('0x48')](handleError(_0x417330,null));};exports[_0x600b('0x54')]=function(_0x241229,_0x4d0fd5){return db[_0x600b('0x2e')][_0x600b('0x4a')]({'where':{'id':_0x241229['params']['id']}})['then'](handleEntityNotFound(_0x4d0fd5,null))['then'](removeEntity(_0x4d0fd5,null))[_0x600b('0x48')](handleError(_0x4d0fd5,null));};exports[_0x600b('0x55')]=function(_0x37b2ca,_0x278ef9,_0x2bc3f1){var _0x4bbe27;return db['SquareOdbc'][_0x600b('0x4a')]({'where':{'id':_0x37b2ca[_0x600b('0x49')]['id']},'attributes':['id',_0x600b('0x56')]})[_0x600b('0x28')](handleEntityNotFound(_0x278ef9,null))[_0x600b('0x28')](function(_0x59ed32){if(_0x59ed32){var _0xfc53f=require(_0x600b('0x57'))();_0xfc53f[_0x600b('0x58')](_0x59ed32[_0x600b('0x56')]);_0xfc53f[_0x600b('0x59')]();return _0x59ed32;}})[_0x600b('0x28')](respondWithResult(_0x278ef9,null))[_0x600b('0x48')](handleError(_0x278ef9,null));}; \ No newline at end of file +var _0x1ecb=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','ODBC','UserProfileResource','error','stack','name','send','index','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','filter','options','SquareOdbc','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','odbc','openSync','dsn','closeSync','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1ecb,0x148));var _0xb1ec=function(_0x8c605e,_0x18660d){_0x8c605e=_0x8c605e-0x0;var _0x243717=_0x1ecb[_0x8c605e];return _0x243717;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb1ec('0x0'));var zipdir=require(_0xb1ec('0x1'));var jsonpatch=require(_0xb1ec('0x2'));var rp=require('request-promise');var moment=require(_0xb1ec('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb1ec('0x4'));var util=require(_0xb1ec('0x5'));var path=require(_0xb1ec('0x6'));var sox=require(_0xb1ec('0x7'));var csv=require('to-csv');var ejs=require(_0xb1ec('0x8'));var fs=require('fs');var fs_extra=require(_0xb1ec('0x9'));var _=require('lodash');var squel=require(_0xb1ec('0xa'));var crypto=require(_0xb1ec('0xb'));var jsforce=require(_0xb1ec('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb1ec('0xd'));var authService=require(_0xb1ec('0xe'));var qs=require(_0xb1ec('0xf'));var as=require(_0xb1ec('0x10'));var hardwareService=require(_0xb1ec('0x11'));var logger=require('../../config/logger')(_0xb1ec('0x12'));var utils=require(_0xb1ec('0x13'));var config=require(_0xb1ec('0x14'));var licenseUtil=require(_0xb1ec('0x15'));var db=require(_0xb1ec('0x16'))['db'];function respondWithStatusCode(_0x302721,_0x516f2e){_0x516f2e=_0x516f2e||0xcc;return function(_0x45a620){if(_0x45a620){return _0x302721[_0xb1ec('0x17')](_0x516f2e);}return _0x302721[_0xb1ec('0x18')](_0x516f2e)[_0xb1ec('0x19')]();};}function respondWithResult(_0x226609,_0x4f215f){_0x4f215f=_0x4f215f||0xc8;return function(_0x113496){if(_0x113496){return _0x226609[_0xb1ec('0x18')](_0x4f215f)[_0xb1ec('0x1a')](_0x113496);}};}function respondWithFilteredResult(_0x468de6,_0x2c24bc){return function(_0x36a1a8){if(_0x36a1a8){var _0x2dad16=typeof _0x2c24bc[_0xb1ec('0x1b')]===_0xb1ec('0x1c')&&typeof _0x2c24bc[_0xb1ec('0x1d')]==='undefined';var _0x4ac7cc=_0x36a1a8[_0xb1ec('0x1e')];var _0x32d4ea=_0x2dad16?0x0:_0x2c24bc['offset'];var _0x54d9e8=_0x2dad16?_0x36a1a8[_0xb1ec('0x1e')]:_0x2c24bc[_0xb1ec('0x1b')]+_0x2c24bc[_0xb1ec('0x1d')];var _0xe10619;if(_0x54d9e8>=_0x4ac7cc){_0x54d9e8=_0x4ac7cc;_0xe10619=0xc8;}else{_0xe10619=0xce;}_0x468de6[_0xb1ec('0x18')](_0xe10619);return _0x468de6[_0xb1ec('0x1f')](_0xb1ec('0x20'),_0x32d4ea+'-'+_0x54d9e8+'/'+_0x4ac7cc)[_0xb1ec('0x1a')](_0x36a1a8);}return null;};}function patchUpdates(_0x37905d){return function(_0x17bba8){try{jsonpatch['apply'](_0x17bba8,_0x37905d,!![]);}catch(_0x1ec3e7){return BPromise[_0xb1ec('0x21')](_0x1ec3e7);}return _0x17bba8[_0xb1ec('0x22')]();};}function saveUpdates(_0x51fb6d,_0x48393e){return function(_0x6a880f){if(_0x6a880f){return _0x6a880f[_0xb1ec('0x23')](_0x51fb6d)[_0xb1ec('0x24')](function(_0xd463fb){return _0xd463fb;});}return null;};}function removeEntity(_0x122587,_0x2b76d8){return function(_0x4becf3){if(_0x4becf3){return _0x4becf3[_0xb1ec('0x25')]()[_0xb1ec('0x24')](function(){var _0x2d80d0=_0x4becf3['get']({'plain':!![]});var _0x4a61af=_0xb1ec('0x26');return db[_0xb1ec('0x27')][_0xb1ec('0x25')]({'where':{'type':_0x4a61af,'resourceId':_0x2d80d0['id']}})['then'](function(){return _0x4becf3;});})[_0xb1ec('0x24')](function(){_0x122587[_0xb1ec('0x18')](0xcc)[_0xb1ec('0x19')]();});}};}function handleEntityNotFound(_0x25403,_0x48d71a){return function(_0x34a3bc){if(!_0x34a3bc){_0x25403['sendStatus'](0x194);}return _0x34a3bc;};}function handleError(_0x5bc56d,_0x58ebe9){_0x58ebe9=_0x58ebe9||0x1f4;return function(_0x6c2024){logger[_0xb1ec('0x28')](_0x6c2024[_0xb1ec('0x29')]);if(_0x6c2024[_0xb1ec('0x2a')]){delete _0x6c2024[_0xb1ec('0x2a')];}_0x5bc56d['status'](_0x58ebe9)[_0xb1ec('0x2b')](_0x6c2024);};}exports[_0xb1ec('0x2c')]=function(_0x2ccc27,_0x291096){var _0x5e33c4={},_0x14a932={},_0x497897={'count':0x0,'rows':[]};var _0x410f9f=_['map'](db['SquareOdbc']['rawAttributes'],function(_0x5cb4d8){return{'name':_0x5cb4d8[_0xb1ec('0x2d')],'type':_0x5cb4d8['type'][_0xb1ec('0x2e')]};});_0x14a932[_0xb1ec('0x2f')]=_[_0xb1ec('0x30')](_0x410f9f,'name');_0x14a932['query']=_[_0xb1ec('0x31')](_0x2ccc27[_0xb1ec('0x32')]);_0x14a932[_0xb1ec('0x33')]=_[_0xb1ec('0x34')](_0x14a932['model'],_0x14a932[_0xb1ec('0x32')]);_0x5e33c4[_0xb1ec('0x35')]=_['intersection'](_0x14a932['model'],qs[_0xb1ec('0x36')](_0x2ccc27[_0xb1ec('0x32')][_0xb1ec('0x36')]));_0x5e33c4['attributes']=_0x5e33c4[_0xb1ec('0x35')]['length']?_0x5e33c4[_0xb1ec('0x35')]:_0x14a932['model'];if(!_0x2ccc27[_0xb1ec('0x32')][_0xb1ec('0x37')]('nolimit')){_0x5e33c4[_0xb1ec('0x1d')]=qs['limit'](_0x2ccc27[_0xb1ec('0x32')]['limit']);_0x5e33c4[_0xb1ec('0x1b')]=qs[_0xb1ec('0x1b')](_0x2ccc27[_0xb1ec('0x32')][_0xb1ec('0x1b')]);}_0x5e33c4[_0xb1ec('0x38')]=qs[_0xb1ec('0x39')](_0x2ccc27[_0xb1ec('0x32')][_0xb1ec('0x39')]);_0x5e33c4[_0xb1ec('0x3a')]=qs['filters'](_[_0xb1ec('0x3b')](_0x2ccc27[_0xb1ec('0x32')],_0x14a932[_0xb1ec('0x33')]),_0x410f9f);if(_0x2ccc27['query']['filter']){_0x5e33c4[_0xb1ec('0x3a')]=_[_0xb1ec('0x3c')](_0x5e33c4[_0xb1ec('0x3a')],{'$or':_[_0xb1ec('0x30')](_0x410f9f,function(_0x43b00d){if(_0x43b00d[_0xb1ec('0x3d')]!==_0xb1ec('0x3e')){var _0x4c9ebe={};_0x4c9ebe[_0x43b00d[_0xb1ec('0x2a')]]={'$like':'%'+_0x2ccc27['query'][_0xb1ec('0x3f')]+'%'};return _0x4c9ebe;}})});}_0x5e33c4=_[_0xb1ec('0x3c')]({},_0x5e33c4,_0x2ccc27[_0xb1ec('0x40')]);var _0xb60e5e={'where':_0x5e33c4[_0xb1ec('0x3a')]};return db[_0xb1ec('0x41')]['count'](_0xb60e5e)[_0xb1ec('0x24')](function(_0x27df3d){_0x497897[_0xb1ec('0x1e')]=_0x27df3d;if(_0x2ccc27[_0xb1ec('0x32')][_0xb1ec('0x42')]){_0x5e33c4[_0xb1ec('0x43')]=[{'all':!![]}];}return db[_0xb1ec('0x41')]['findAll'](_0x5e33c4);})[_0xb1ec('0x24')](function(_0x1dd565){_0x497897[_0xb1ec('0x44')]=_0x1dd565;return _0x497897;})[_0xb1ec('0x24')](respondWithFilteredResult(_0x291096,_0x5e33c4))[_0xb1ec('0x45')](handleError(_0x291096,null));};exports[_0xb1ec('0x46')]=function(_0x2fbed0,_0x3e9e11){var _0x2a9f91={'raw':!![],'where':{'id':_0x2fbed0[_0xb1ec('0x47')]['id']}},_0xd88ddb={};_0xd88ddb[_0xb1ec('0x2f')]=_[_0xb1ec('0x31')](db[_0xb1ec('0x41')][_0xb1ec('0x48')]);_0xd88ddb[_0xb1ec('0x32')]=_[_0xb1ec('0x31')](_0x2fbed0[_0xb1ec('0x32')]);_0xd88ddb[_0xb1ec('0x33')]=_[_0xb1ec('0x34')](_0xd88ddb['model'],_0xd88ddb['query']);_0x2a9f91[_0xb1ec('0x35')]=_[_0xb1ec('0x34')](_0xd88ddb['model'],qs[_0xb1ec('0x36')](_0x2fbed0['query'][_0xb1ec('0x36')]));_0x2a9f91[_0xb1ec('0x35')]=_0x2a9f91[_0xb1ec('0x35')]['length']?_0x2a9f91[_0xb1ec('0x35')]:_0xd88ddb[_0xb1ec('0x2f')];if(_0x2fbed0[_0xb1ec('0x32')]['includeAll']){_0x2a9f91[_0xb1ec('0x43')]=[{'all':!![]}];}_0x2a9f91=_[_0xb1ec('0x3c')]({},_0x2a9f91,_0x2fbed0[_0xb1ec('0x40')]);return db[_0xb1ec('0x41')][_0xb1ec('0x49')](_0x2a9f91)[_0xb1ec('0x24')](handleEntityNotFound(_0x3e9e11,null))[_0xb1ec('0x24')](respondWithResult(_0x3e9e11,null))['catch'](handleError(_0x3e9e11,null));};exports[_0xb1ec('0x4a')]=function(_0x4c142b,_0x737a44){return db['SquareOdbc']['create'](_0x4c142b[_0xb1ec('0x4b')],{})[_0xb1ec('0x24')](function(_0x4c9add){var _0x273763=_0x4c142b[_0xb1ec('0x4c')][_0xb1ec('0x4d')]({'plain':!![]});if(!_0x273763)throw new Error(_0xb1ec('0x4e'));if(_0x273763['role']==='user'){var _0x2b9737=_0x4c9add[_0xb1ec('0x4d')]({'plain':!![]});var _0x113174='ODBC';return db['UserProfileSection'][_0xb1ec('0x49')]({'where':{'name':_0x113174,'userProfileId':_0x273763[_0xb1ec('0x4f')]},'raw':!![]})['then'](function(_0x98b238){if(_0x98b238&&_0x98b238[_0xb1ec('0x50')]===0x0){return db[_0xb1ec('0x27')][_0xb1ec('0x4a')]({'name':_0x2b9737[_0xb1ec('0x2a')],'resourceId':_0x2b9737['id'],'type':_0x98b238['name'],'sectionId':_0x98b238['id']},{})[_0xb1ec('0x24')](function(){return _0x4c9add;});}else{return _0x4c9add;}})[_0xb1ec('0x45')](function(_0x582d1d){logger[_0xb1ec('0x28')](_0xb1ec('0x51'),_0x582d1d);throw _0x582d1d;});}return _0x4c9add;})[_0xb1ec('0x24')](respondWithResult(_0x737a44,0xc9))[_0xb1ec('0x45')](handleError(_0x737a44,null));};exports[_0xb1ec('0x23')]=function(_0x5935d0,_0x350208){if(_0x5935d0[_0xb1ec('0x4b')]['id']){delete _0x5935d0[_0xb1ec('0x4b')]['id'];}return db[_0xb1ec('0x41')][_0xb1ec('0x49')]({'where':{'id':_0x5935d0[_0xb1ec('0x47')]['id']}})[_0xb1ec('0x24')](handleEntityNotFound(_0x350208,null))[_0xb1ec('0x24')](saveUpdates(_0x5935d0[_0xb1ec('0x4b')],null))[_0xb1ec('0x24')](respondWithResult(_0x350208,null))[_0xb1ec('0x45')](handleError(_0x350208,null));};exports[_0xb1ec('0x25')]=function(_0x1ee3cb,_0x310681){return db[_0xb1ec('0x41')][_0xb1ec('0x49')]({'where':{'id':_0x1ee3cb[_0xb1ec('0x47')]['id']}})[_0xb1ec('0x24')](handleEntityNotFound(_0x310681,null))[_0xb1ec('0x24')](removeEntity(_0x310681,null))['catch'](handleError(_0x310681,null));};exports['test']=function(_0x37fc74,_0x4cc25d,_0xc72876){var _0xb4591c;return db[_0xb1ec('0x41')]['find']({'where':{'id':_0x37fc74['params']['id']},'attributes':['id','dsn']})[_0xb1ec('0x24')](handleEntityNotFound(_0x4cc25d,null))[_0xb1ec('0x24')](function(_0x1fb034){if(_0x1fb034){var _0x1ecd73=require(_0xb1ec('0x52'))();_0x1ecd73[_0xb1ec('0x53')](_0x1fb034[_0xb1ec('0x54')]);_0x1ecd73[_0xb1ec('0x55')]();return _0x1fb034;}})[_0xb1ec('0x24')](respondWithResult(_0x4cc25d,null))[_0xb1ec('0x45')](handleError(_0x4cc25d,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 4e1e280..e5f3204 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 _0x0bbe=['../../config/environment','./squareOdbc.attributes','define','SquareOdbc','square_odbc','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3f3c3c,_0x49fe3b){var _0xa71e80=function(_0x56dbb5){while(--_0x56dbb5){_0x3f3c3c['push'](_0x3f3c3c['shift']());}};_0xa71e80(++_0x49fe3b);}(_0x0bbe,0x1b2));var _0xe0bb=function(_0x31b0de,_0x2d8988){_0x31b0de=_0x31b0de-0x0;var _0x4de47f=_0x0bbe[_0x31b0de];return _0x4de47f;};'use strict';var _=require(_0xe0bb('0x0'));var util=require(_0xe0bb('0x1'));var logger=require(_0xe0bb('0x2'))(_0xe0bb('0x3'));var moment=require(_0xe0bb('0x4'));var BPromise=require(_0xe0bb('0x5'));var rp=require(_0xe0bb('0x6'));var fs=require('fs');var path=require(_0xe0bb('0x7'));var rimraf=require('rimraf');var config=require(_0xe0bb('0x8'));var attributes=require(_0xe0bb('0x9'));module['exports']=function(_0x59a2ec,_0x2a9065){return _0x59a2ec[_0xe0bb('0xa')](_0xe0bb('0xb'),attributes,{'tableName':_0xe0bb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbbe1=['lodash','util','../../config/logger','api','request-promise','path','rimraf','./squareOdbc.attributes','define','square_odbc'];(function(_0x3adf99,_0x37dc7a){var _0x42db48=function(_0x36a368){while(--_0x36a368){_0x3adf99['push'](_0x3adf99['shift']());}};_0x42db48(++_0x37dc7a);}(_0xbbe1,0x10e));var _0x1bbe=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xbbe1[_0xf50820];return _0x2a9b10;};'use strict';var _=require(_0x1bbe('0x0'));var util=require(_0x1bbe('0x1'));var logger=require(_0x1bbe('0x2'))(_0x1bbe('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1bbe('0x4'));var fs=require('fs');var path=require(_0x1bbe('0x5'));var rimraf=require(_0x1bbe('0x6'));var config=require('../../config/environment');var attributes=require(_0x1bbe('0x7'));module['exports']=function(_0x3d4a74,_0xa1e4c5){return _0x3d4a74[_0x1bbe('0x8')]('SquareOdbc',attributes,{'tableName':_0x1bbe('0x9'),'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 fedd3b0..08ae5a7 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 _0xd250=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','SquareOdbc','find','options','where','include','model','attributes','map','ShowSquareOdbc','lodash'];(function(_0xac7746,_0x1eb275){var _0x54abba=function(_0x27db0b){while(--_0x27db0b){_0xac7746['push'](_0xac7746['shift']());}};_0x54abba(++_0x1eb275);}(_0xd250,0x1a3));var _0x0d25=function(_0x28b0a4,_0x2ea758){_0x28b0a4=_0x28b0a4-0x0;var _0x105ce6=_0xd250[_0x28b0a4];return _0x105ce6;};'use strict';var _=require(_0x0d25('0x0'));var util=require(_0x0d25('0x1'));var moment=require(_0x0d25('0x2'));var BPromise=require(_0x0d25('0x3'));var rs=require(_0x0d25('0x4'));var fs=require('fs');var Redis=require(_0x0d25('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0d25('0x6'));var logger=require(_0x0d25('0x7'))(_0x0d25('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d25('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x48dd5a,_0x20a875,_0x271a12){return new BPromise(function(_0x19cac0,_0x4a423e){return client['request'](_0x48dd5a,_0x271a12)[_0x0d25('0xa')](function(_0x182a93){logger[_0x0d25('0xb')](_0x0d25('0xc'),_0x20a875,_0x0d25('0xd'));logger[_0x0d25('0xe')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x20a875,_0x0d25('0xd'),JSON[_0x0d25('0xf')](_0x182a93));if(_0x182a93[_0x0d25('0x10')]){if(_0x182a93['error'][_0x0d25('0x11')]===0x1f4){logger[_0x0d25('0x10')](_0x0d25('0xc'),_0x20a875,_0x182a93['error']['message']);return _0x4a423e(_0x182a93[_0x0d25('0x10')]['message']);}logger[_0x0d25('0x10')](_0x0d25('0xc'),_0x20a875,_0x182a93['error'][_0x0d25('0x12')]);return _0x19cac0(_0x182a93['error'][_0x0d25('0x12')]);}else{logger[_0x0d25('0xb')]('SquareOdbc,\x20%s,\x20%s',_0x20a875,'request\x20sent');_0x19cac0(_0x182a93[_0x0d25('0x13')][_0x0d25('0x12')]);}})[_0x0d25('0x14')](function(_0x15b37e){logger[_0x0d25('0x10')](_0x0d25('0xc'),_0x20a875,_0x15b37e);_0x4a423e(_0x15b37e);});});}exports['ShowSquareOdbc']=function(_0x46602e){var _0x29d89b=this;return new Promise(function(_0x4246ea,_0x4f3322){return db[_0x0d25('0x15')][_0x0d25('0x16')]({'raw':_0x46602e[_0x0d25('0x17')]?_0x46602e[_0x0d25('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x46602e[_0x0d25('0x17')]?_0x46602e[_0x0d25('0x17')][_0x0d25('0x18')]||null:null,'attributes':_0x46602e['options']?_0x46602e[_0x0d25('0x17')]['attributes']||null:null,'include':_0x46602e[_0x0d25('0x17')]?_0x46602e[_0x0d25('0x17')]['include']?_['map'](_0x46602e[_0x0d25('0x17')][_0x0d25('0x19')],function(_0x19b902){return{'model':db[_0x19b902[_0x0d25('0x1a')]],'as':_0x19b902['as'],'attributes':_0x19b902[_0x0d25('0x1b')],'include':_0x19b902[_0x0d25('0x19')]?_[_0x0d25('0x1c')](_0x19b902[_0x0d25('0x19')],function(_0x53c459){return{'model':db[_0x53c459[_0x0d25('0x1a')]],'as':_0x53c459['as'],'attributes':_0x53c459['attributes'],'include':_0x53c459['include']?_[_0x0d25('0x1c')](_0x53c459['include'],function(_0x2f8462){return{'model':db[_0x2f8462[_0x0d25('0x1a')]],'as':_0x2f8462['as'],'attributes':_0x2f8462['attributes']};}):[]};}):[]};}):[]:[]})[_0x0d25('0xa')](function(_0x1f9d0c){logger[_0x0d25('0xb')](_0x0d25('0x1d'),_0x46602e);logger[_0x0d25('0xe')](_0x0d25('0x1d'),_0x46602e,JSON[_0x0d25('0xf')](_0x1f9d0c));_0x4246ea(_0x1f9d0c);})['catch'](function(_0x1ce440){logger[_0x0d25('0x10')](_0x0d25('0x1d'),_0x1ce440[_0x0d25('0x12')],_0x46602e);_0x4f3322(_0x29d89b['error'](0x1f4,_0x1ce440[_0x0d25('0x12')]));});});}; \ No newline at end of file +var _0x1a3b=['jayson/promise','client','http','request','info','SquareOdbc,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','ShowSquareOdbc','options','raw','where','attributes','map','include','model','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x41fd84,_0x1f67be){var _0x3f3862=function(_0x6ec685){while(--_0x6ec685){_0x41fd84['push'](_0x41fd84['shift']());}};_0x3f3862(++_0x1f67be);}(_0x1a3b,0x12d));var _0xb1a3=function(_0x1c2c2b,_0x4edc25){_0x1c2c2b=_0x1c2c2b-0x0;var _0x142695=_0x1a3b[_0x1c2c2b];return _0x142695;};'use strict';var _=require(_0xb1a3('0x0'));var util=require('util');var moment=require(_0xb1a3('0x1'));var BPromise=require(_0xb1a3('0x2'));var rs=require(_0xb1a3('0x3'));var fs=require('fs');var Redis=require(_0xb1a3('0x4'));var db=require(_0xb1a3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb1a3('0x6'))(_0xb1a3('0x7'));var config=require(_0xb1a3('0x8'));var jayson=require(_0xb1a3('0x9'));var client=jayson[_0xb1a3('0xa')][_0xb1a3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x331591,_0x1d3a6e,_0x4e4d72){return new BPromise(function(_0x4ff489,_0x2cfa77){return client[_0xb1a3('0xc')](_0x331591,_0x4e4d72)['then'](function(_0x276bde){logger[_0xb1a3('0xd')](_0xb1a3('0xe'),_0x1d3a6e,'request\x20sent');logger[_0xb1a3('0xf')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x1d3a6e,_0xb1a3('0x10'),JSON[_0xb1a3('0x11')](_0x276bde));if(_0x276bde[_0xb1a3('0x12')]){if(_0x276bde[_0xb1a3('0x12')][_0xb1a3('0x13')]===0x1f4){logger[_0xb1a3('0x12')](_0xb1a3('0xe'),_0x1d3a6e,_0x276bde[_0xb1a3('0x12')]['message']);return _0x2cfa77(_0x276bde[_0xb1a3('0x12')][_0xb1a3('0x14')]);}logger['error'](_0xb1a3('0xe'),_0x1d3a6e,_0x276bde['error'][_0xb1a3('0x14')]);return _0x4ff489(_0x276bde[_0xb1a3('0x12')][_0xb1a3('0x14')]);}else{logger['info'](_0xb1a3('0xe'),_0x1d3a6e,_0xb1a3('0x10'));_0x4ff489(_0x276bde[_0xb1a3('0x15')][_0xb1a3('0x14')]);}})[_0xb1a3('0x16')](function(_0xc8f053){logger[_0xb1a3('0x12')](_0xb1a3('0xe'),_0x1d3a6e,_0xc8f053);_0x2cfa77(_0xc8f053);});});}exports[_0xb1a3('0x17')]=function(_0x44e58a){var _0x180117=this;return new Promise(function(_0x454153,_0x44163d){return db['SquareOdbc']['find']({'raw':_0x44e58a['options']?_0x44e58a[_0xb1a3('0x18')][_0xb1a3('0x19')]===undefined?!![]:![]:!![],'where':_0x44e58a[_0xb1a3('0x18')]?_0x44e58a[_0xb1a3('0x18')][_0xb1a3('0x1a')]||null:null,'attributes':_0x44e58a[_0xb1a3('0x18')]?_0x44e58a[_0xb1a3('0x18')][_0xb1a3('0x1b')]||null:null,'include':_0x44e58a[_0xb1a3('0x18')]?_0x44e58a[_0xb1a3('0x18')]['include']?_[_0xb1a3('0x1c')](_0x44e58a[_0xb1a3('0x18')][_0xb1a3('0x1d')],function(_0x401783){return{'model':db[_0x401783[_0xb1a3('0x1e')]],'as':_0x401783['as'],'attributes':_0x401783[_0xb1a3('0x1b')],'include':_0x401783[_0xb1a3('0x1d')]?_[_0xb1a3('0x1c')](_0x401783[_0xb1a3('0x1d')],function(_0x4220e3){return{'model':db[_0x4220e3[_0xb1a3('0x1e')]],'as':_0x4220e3['as'],'attributes':_0x4220e3[_0xb1a3('0x1b')],'include':_0x4220e3[_0xb1a3('0x1d')]?_[_0xb1a3('0x1c')](_0x4220e3[_0xb1a3('0x1d')],function(_0x5d1f27){return{'model':db[_0x5d1f27[_0xb1a3('0x1e')]],'as':_0x5d1f27['as'],'attributes':_0x5d1f27[_0xb1a3('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x117b51){logger['info'](_0xb1a3('0x17'),_0x44e58a);logger[_0xb1a3('0xf')]('ShowSquareOdbc',_0x44e58a,JSON[_0xb1a3('0x11')](_0x117b51));_0x454153(_0x117b51);})[_0xb1a3('0x16')](function(_0x95ff18){logger[_0xb1a3('0x12')](_0xb1a3('0x17'),_0x95ff18[_0xb1a3('0x14')],_0x44e58a);_0x44163d(_0x180117[_0xb1a3('0x12')](0x1f4,_0x95ff18[_0xb1a3('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 66aaacf..e177856 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 _0x6bc4=['fs-extra','../../components/auth/service','../../components/interaction/service','./squareProject.controller','get','index','/:id','isAuthenticated','show','getUsers','post','/:id/users','addUsers','put','delete','removeUsers','util','connect-timeout','express','Router'];(function(_0x277721,_0x46971e){var _0x286051=function(_0x130c98){while(--_0x130c98){_0x277721['push'](_0x277721['shift']());}};_0x286051(++_0x46971e);}(_0x6bc4,0x164));var _0x46bc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6bc4[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x46bc('0x0'));var path=require('path');var timeout=require(_0x46bc('0x1'));var express=require(_0x46bc('0x2'));var router=express[_0x46bc('0x3')]();var fs_extra=require(_0x46bc('0x4'));var auth=require(_0x46bc('0x5'));var interaction=require(_0x46bc('0x6'));var config=require('../../config/environment');var controller=require(_0x46bc('0x7'));router[_0x46bc('0x8')]('/',auth['isAuthenticated'](),controller[_0x46bc('0x9')]);router[_0x46bc('0x8')](_0x46bc('0xa'),auth[_0x46bc('0xb')](),controller[_0x46bc('0xc')]);router[_0x46bc('0x8')]('/:id/users',auth[_0x46bc('0xb')](),controller[_0x46bc('0xd')]);router['post']('/',auth[_0x46bc('0xb')](),controller['create']);router[_0x46bc('0xe')](_0x46bc('0xf'),auth['isAuthenticated'](),controller[_0x46bc('0x10')]);router[_0x46bc('0x11')]('/:id',auth[_0x46bc('0xb')](),controller['update']);router[_0x46bc('0x12')](_0x46bc('0xa'),auth[_0x46bc('0xb')](),controller['destroy']);router[_0x46bc('0x12')](_0x46bc('0xf'),auth[_0x46bc('0xb')](),controller[_0x46bc('0x13')]);module['exports']=router; \ No newline at end of file +var _0x1df7=['get','isAuthenticated','show','/:id/users','getUsers','post','create','addUsers','put','update','delete','destroy','removeUsers','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x1df7,0x6e));var _0x71df=function(_0x542c73,_0x307b9c){_0x542c73=_0x542c73-0x0;var _0x7d5f0e=_0x1df7[_0x542c73];return _0x7d5f0e;};'use strict';var multer=require('multer');var util=require(_0x71df('0x0'));var path=require(_0x71df('0x1'));var timeout=require(_0x71df('0x2'));var express=require(_0x71df('0x3'));var router=express[_0x71df('0x4')]();var fs_extra=require(_0x71df('0x5'));var auth=require(_0x71df('0x6'));var interaction=require(_0x71df('0x7'));var config=require(_0x71df('0x8'));var controller=require(_0x71df('0x9'));router[_0x71df('0xa')]('/',auth[_0x71df('0xb')](),controller['index']);router[_0x71df('0xa')]('/:id',auth[_0x71df('0xb')](),controller[_0x71df('0xc')]);router['get'](_0x71df('0xd'),auth['isAuthenticated'](),controller[_0x71df('0xe')]);router[_0x71df('0xf')]('/',auth['isAuthenticated'](),controller[_0x71df('0x10')]);router[_0x71df('0xf')](_0x71df('0xd'),auth['isAuthenticated'](),controller[_0x71df('0x11')]);router[_0x71df('0x12')]('/:id',auth[_0x71df('0xb')](),controller[_0x71df('0x13')]);router[_0x71df('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x71df('0x15')]);router[_0x71df('0x14')]('/:id/users',auth[_0x71df('0xb')](),controller[_0x71df('0x16')]);module[_0x71df('0x17')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 9bd567c..284ddc2 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 _0x4abd=['exports','STRING','name','TEXT','long','getDataValue','preproduction','utf8','BLOB','toString','DATE'];(function(_0x151e3e,_0x32b18b){var _0x4f1640=function(_0x123c44){while(--_0x123c44){_0x151e3e['push'](_0x151e3e['shift']());}};_0x4f1640(++_0x32b18b);}(_0x4abd,0x9a));var _0xd4ab=function(_0x402b1f,_0x3df329){_0x402b1f=_0x402b1f-0x0;var _0x5d22f2=_0x4abd[_0x402b1f];return _0x5d22f2;};'use strict';var Sequelize=require('sequelize');module[_0xd4ab('0x0')]={'name':{'type':Sequelize[_0xd4ab('0x1')],'unique':_0xd4ab('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0xd4ab('0x3')]},'preproduction':{'type':Sequelize['BLOB'](_0xd4ab('0x4')),'get':function(){if(this[_0xd4ab('0x5')]('preproduction')){return this[_0xd4ab('0x5')](_0xd4ab('0x6'))['toString'](_0xd4ab('0x7'));}}},'production':{'type':Sequelize[_0xd4ab('0x8')](_0xd4ab('0x4')),'get':function(){if(this['getDataValue']('production')){return this['getDataValue']('production')[_0xd4ab('0x9')]('utf8');}}},'savedAt':{'type':Sequelize[_0xd4ab('0xa')]},'publishedAt':{'type':Sequelize[_0xd4ab('0xa')]}}; \ No newline at end of file +var _0x8135=['getDataValue','toString','long','utf8','DATE','exports','name','STRING','TEXT','BLOB','preproduction'];(function(_0x42a595,_0x2ba811){var _0x158276=function(_0x24766b){while(--_0x24766b){_0x42a595['push'](_0x42a595['shift']());}};_0x158276(++_0x2ba811);}(_0x8135,0x73));var _0x5813=function(_0x4236db,_0x4a53f4){_0x4236db=_0x4236db-0x0;var _0x16f203=_0x8135[_0x4236db];return _0x16f203;};'use strict';var Sequelize=require('sequelize');module[_0x5813('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x5813('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0x5813('0x2')]},'notes':{'type':Sequelize[_0x5813('0x3')]},'preproduction':{'type':Sequelize[_0x5813('0x4')]('long'),'get':function(){if(this['getDataValue'](_0x5813('0x5'))){return this[_0x5813('0x6')](_0x5813('0x5'))[_0x5813('0x7')]('utf8');}}},'production':{'type':Sequelize[_0x5813('0x4')](_0x5813('0x8')),'get':function(){if(this[_0x5813('0x6')]('production')){return this[_0x5813('0x6')]('production')['toString'](_0x5813('0x9'));}}},'savedAt':{'type':Sequelize[_0x5813('0xa')]},'publishedAt':{'type':Sequelize[_0x5813('0xa')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index c8d3a2e..89b4b4f 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 _0xfda2=['stack','name','send','index','map','SquareProject','rawAttributes','type','key','keys','query','intersection','model','attributes','fields','hasOwnProperty','sort','where','filters','pick','filter','VIRTUAL','merge','count','includeAll','include','rows','catch','show','params','length','options','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SquareProjects','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','getUsers','User','order','nolimit','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','defaults','redis','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','set','Content-Range','json','save','update','then','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfda2,0x1bc));var _0x2fda=function(_0x17e2a6,_0x2863de){_0x17e2a6=_0x17e2a6-0x0;var _0x42b005=_0xfda2[_0x17e2a6];return _0x42b005;};'use strict';var emlformat=require(_0x2fda('0x0'));var rimraf=require(_0x2fda('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2fda('0x2'));var rp=require(_0x2fda('0x3'));var moment=require(_0x2fda('0x4'));var BPromise=require(_0x2fda('0x5'));var Mustache=require(_0x2fda('0x6'));var util=require(_0x2fda('0x7'));var path=require(_0x2fda('0x8'));var sox=require(_0x2fda('0x9'));var csv=require(_0x2fda('0xa'));var ejs=require(_0x2fda('0xb'));var fs=require('fs');var fs_extra=require(_0x2fda('0xc'));var _=require(_0x2fda('0xd'));var squel=require(_0x2fda('0xe'));var crypto=require(_0x2fda('0xf'));var jsforce=require(_0x2fda('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x2fda('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2fda('0x11'));var authService=require(_0x2fda('0x12'));var qs=require(_0x2fda('0x13'));var as=require(_0x2fda('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2fda('0x15'))(_0x2fda('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2fda('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x2fda('0x18')](config[_0x2fda('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x2fda('0x1a'))(new Redis(config[_0x2fda('0x19')]));require('./squareProject.socket')[_0x2fda('0x1b')](socket);function respondWithStatusCode(_0x4db817,_0x3328ed){_0x3328ed=_0x3328ed||0xcc;return function(_0x140c9c){if(_0x140c9c){return _0x4db817[_0x2fda('0x1c')](_0x3328ed);}return _0x4db817[_0x2fda('0x1d')](_0x3328ed)[_0x2fda('0x1e')]();};}function respondWithResult(_0x509571,_0x3d0fbc){_0x3d0fbc=_0x3d0fbc||0xc8;return function(_0x69a5b9){if(_0x69a5b9){return _0x509571['status'](_0x3d0fbc)['json'](_0x69a5b9);}};}function respondWithFilteredResult(_0x1e0148,_0x1652e0){return function(_0x20ba7a){if(_0x20ba7a){var _0x54429c=typeof _0x1652e0[_0x2fda('0x1f')]===_0x2fda('0x20')&&typeof _0x1652e0[_0x2fda('0x21')]===_0x2fda('0x20');var _0x3e3b58=_0x20ba7a['count'];var _0xd8a321=_0x54429c?0x0:_0x1652e0[_0x2fda('0x1f')];var _0x3e6df7=_0x54429c?_0x20ba7a['count']:_0x1652e0[_0x2fda('0x1f')]+_0x1652e0[_0x2fda('0x21')];var _0xa9a28f;if(_0x3e6df7>=_0x3e3b58){_0x3e6df7=_0x3e3b58;_0xa9a28f=0xc8;}else{_0xa9a28f=0xce;}_0x1e0148[_0x2fda('0x1d')](_0xa9a28f);return _0x1e0148[_0x2fda('0x22')](_0x2fda('0x23'),_0xd8a321+'-'+_0x3e6df7+'/'+_0x3e3b58)[_0x2fda('0x24')](_0x20ba7a);}return null;};}function patchUpdates(_0x4ae377){return function(_0xa6f72d){try{jsonpatch['apply'](_0xa6f72d,_0x4ae377,!![]);}catch(_0x2505b3){return BPromise['reject'](_0x2505b3);}return _0xa6f72d[_0x2fda('0x25')]();};}function saveUpdates(_0x5396aa,_0x4fc2e3){return function(_0x5ea982){if(_0x5ea982){return _0x5ea982[_0x2fda('0x26')](_0x5396aa)[_0x2fda('0x27')](function(_0x46ad18){return _0x46ad18;});}return null;};}function removeEntity(_0x16b12a,_0x12ac3a){return function(_0x30e9f1){if(_0x30e9f1){return _0x30e9f1['destroy']()['then'](function(){var _0x126938=_0x30e9f1['get']({'plain':!![]});var _0x231d05='SquareProjects';return db['UserProfileResource']['destroy']({'where':{'type':_0x231d05,'resourceId':_0x126938['id']}})[_0x2fda('0x27')](function(){return _0x30e9f1;});})[_0x2fda('0x27')](function(){_0x16b12a[_0x2fda('0x1d')](0xcc)[_0x2fda('0x1e')]();});}};}function handleEntityNotFound(_0x6d59a1,_0x557ae6){return function(_0xabf8e){if(!_0xabf8e){_0x6d59a1[_0x2fda('0x1c')](0x194);}return _0xabf8e;};}function handleError(_0x3505de,_0x38ff8d){_0x38ff8d=_0x38ff8d||0x1f4;return function(_0x1554cc){logger[_0x2fda('0x28')](_0x1554cc[_0x2fda('0x29')]);if(_0x1554cc[_0x2fda('0x2a')]){delete _0x1554cc['name'];}_0x3505de[_0x2fda('0x1d')](_0x38ff8d)[_0x2fda('0x2b')](_0x1554cc);};}exports[_0x2fda('0x2c')]=function(_0x564b86,_0x143324){var _0x1f3c87={},_0x32228c={},_0x3ec82f={'count':0x0,'rows':[]};var _0x2bffdf=_[_0x2fda('0x2d')](db[_0x2fda('0x2e')][_0x2fda('0x2f')],function(_0x2c1669){return{'name':_0x2c1669['fieldName'],'type':_0x2c1669[_0x2fda('0x30')][_0x2fda('0x31')]};});_0x32228c['model']=_[_0x2fda('0x2d')](_0x2bffdf,_0x2fda('0x2a'));_0x32228c['query']=_[_0x2fda('0x32')](_0x564b86[_0x2fda('0x33')]);_0x32228c['filters']=_[_0x2fda('0x34')](_0x32228c[_0x2fda('0x35')],_0x32228c[_0x2fda('0x33')]);_0x1f3c87[_0x2fda('0x36')]=_['intersection'](_0x32228c['model'],qs['fields'](_0x564b86[_0x2fda('0x33')][_0x2fda('0x37')]));_0x1f3c87[_0x2fda('0x36')]=_0x1f3c87[_0x2fda('0x36')]['length']?_0x1f3c87['attributes']:_0x32228c[_0x2fda('0x35')];if(!_0x564b86['query'][_0x2fda('0x38')]('nolimit')){_0x1f3c87[_0x2fda('0x21')]=qs[_0x2fda('0x21')](_0x564b86[_0x2fda('0x33')][_0x2fda('0x21')]);_0x1f3c87[_0x2fda('0x1f')]=qs[_0x2fda('0x1f')](_0x564b86[_0x2fda('0x33')][_0x2fda('0x1f')]);}_0x1f3c87['order']=qs[_0x2fda('0x39')](_0x564b86[_0x2fda('0x33')][_0x2fda('0x39')]);_0x1f3c87[_0x2fda('0x3a')]=qs[_0x2fda('0x3b')](_[_0x2fda('0x3c')](_0x564b86[_0x2fda('0x33')],_0x32228c[_0x2fda('0x3b')]),_0x2bffdf);if(_0x564b86[_0x2fda('0x33')][_0x2fda('0x3d')]){_0x1f3c87[_0x2fda('0x3a')]=_['merge'](_0x1f3c87['where'],{'$or':_[_0x2fda('0x2d')](_0x2bffdf,function(_0x534f33){if(_0x534f33[_0x2fda('0x30')]!==_0x2fda('0x3e')){var _0x296c14={};_0x296c14[_0x534f33['name']]={'$like':'%'+_0x564b86['query']['filter']+'%'};return _0x296c14;}})});}_0x1f3c87=_[_0x2fda('0x3f')]({},_0x1f3c87,_0x564b86['options']);var _0x25595a={'where':_0x1f3c87[_0x2fda('0x3a')]};return db['SquareProject'][_0x2fda('0x40')](_0x25595a)['then'](function(_0x13a8f9){_0x3ec82f['count']=_0x13a8f9;if(_0x564b86[_0x2fda('0x33')][_0x2fda('0x41')]){_0x1f3c87[_0x2fda('0x42')]=[{'all':!![]}];}return db['SquareProject']['findAll'](_0x1f3c87);})[_0x2fda('0x27')](function(_0x191740){_0x3ec82f[_0x2fda('0x43')]=_0x191740;return _0x3ec82f;})[_0x2fda('0x27')](respondWithFilteredResult(_0x143324,_0x1f3c87))[_0x2fda('0x44')](handleError(_0x143324,null));};exports[_0x2fda('0x45')]=function(_0x17fc9e,_0x1fe2d0){var _0x35c9ce={'raw':![],'where':{'id':_0x17fc9e[_0x2fda('0x46')]['id']}},_0x4c7fb1={};_0x4c7fb1['model']=_[_0x2fda('0x32')](db[_0x2fda('0x2e')]['rawAttributes']);_0x4c7fb1[_0x2fda('0x33')]=_[_0x2fda('0x32')](_0x17fc9e[_0x2fda('0x33')]);_0x4c7fb1[_0x2fda('0x3b')]=_[_0x2fda('0x34')](_0x4c7fb1[_0x2fda('0x35')],_0x4c7fb1[_0x2fda('0x33')]);_0x35c9ce[_0x2fda('0x36')]=_['intersection'](_0x4c7fb1[_0x2fda('0x35')],qs[_0x2fda('0x37')](_0x17fc9e['query']['fields']));_0x35c9ce['attributes']=_0x35c9ce[_0x2fda('0x36')][_0x2fda('0x47')]?_0x35c9ce[_0x2fda('0x36')]:_0x4c7fb1['model'];if(_0x17fc9e['query']['includeAll']){_0x35c9ce[_0x2fda('0x42')]=[{'all':!![]}];}_0x35c9ce=_[_0x2fda('0x3f')]({},_0x35c9ce,_0x17fc9e[_0x2fda('0x48')]);return db[_0x2fda('0x2e')][_0x2fda('0x49')](_0x35c9ce)[_0x2fda('0x27')](handleEntityNotFound(_0x1fe2d0,null))[_0x2fda('0x27')](respondWithResult(_0x1fe2d0,null))['catch'](handleError(_0x1fe2d0,null));};exports[_0x2fda('0x4a')]=function(_0xdd48d9,_0x3a8ddb){return db[_0x2fda('0x2e')]['create'](_0xdd48d9[_0x2fda('0x4b')],{})[_0x2fda('0x27')](function(_0x4ea5c6){var _0x254791=_0xdd48d9['user'][_0x2fda('0x4c')]({'plain':!![]});if(!_0x254791)throw new Error(_0x2fda('0x4d'));if(_0x254791[_0x2fda('0x4e')]==='user'){var _0x4bfbed=_0x4ea5c6['get']({'plain':!![]});var _0x1a8ee2=_0x2fda('0x4f');return db[_0x2fda('0x50')]['find']({'where':{'name':_0x1a8ee2,'userProfileId':_0x254791[_0x2fda('0x51')]},'raw':!![]})[_0x2fda('0x27')](function(_0x4f6f8c){if(_0x4f6f8c&&_0x4f6f8c[_0x2fda('0x52')]===0x0){return db[_0x2fda('0x53')][_0x2fda('0x4a')]({'name':_0x4bfbed[_0x2fda('0x2a')],'resourceId':_0x4bfbed['id'],'type':_0x4f6f8c['name'],'sectionId':_0x4f6f8c['id']},{})[_0x2fda('0x27')](function(){return _0x4ea5c6;});}else{return _0x4ea5c6;}})[_0x2fda('0x44')](function(_0x2b70d3){logger[_0x2fda('0x28')](_0x2fda('0x54'),_0x2b70d3);throw _0x2b70d3;});}return _0x4ea5c6;})[_0x2fda('0x27')](respondWithResult(_0x3a8ddb,0xc9))[_0x2fda('0x44')](handleError(_0x3a8ddb,null));};exports[_0x2fda('0x26')]=function(_0xb6fb8d,_0xecc870){if(_0xb6fb8d[_0x2fda('0x4b')]['id']){delete _0xb6fb8d[_0x2fda('0x4b')]['id'];}return db[_0x2fda('0x2e')]['find']({'where':{'id':_0xb6fb8d[_0x2fda('0x46')]['id']}})[_0x2fda('0x27')](handleEntityNotFound(_0xecc870,null))[_0x2fda('0x27')](saveUpdates(_0xb6fb8d[_0x2fda('0x4b')],null))[_0x2fda('0x27')](respondWithResult(_0xecc870,null))[_0x2fda('0x44')](handleError(_0xecc870,null));};exports[_0x2fda('0x55')]=function(_0x1d1515,_0x74954a){return db[_0x2fda('0x2e')][_0x2fda('0x49')]({'where':{'id':_0x1d1515[_0x2fda('0x46')]['id']}})[_0x2fda('0x27')](handleEntityNotFound(_0x74954a,null))[_0x2fda('0x27')](removeEntity(_0x74954a,null))[_0x2fda('0x44')](handleError(_0x74954a,null));};exports['addUsers']=function(_0x1f5887,_0x1045c0,_0x35410f){return db[_0x2fda('0x2e')][_0x2fda('0x49')]({'where':{'id':_0x1f5887['params']['id']}})[_0x2fda('0x27')](handleEntityNotFound(_0x1045c0,null))['then'](function(_0x33a146){if(_0x33a146){return _0x33a146[_0x2fda('0x56')](_0x1f5887['body'][_0x2fda('0x57')],_[_0x2fda('0x58')](_0x1f5887[_0x2fda('0x4b')],[_0x2fda('0x57'),'id'])||{});}})['then'](respondWithResult(_0x1045c0,null))[_0x2fda('0x44')](handleError(_0x1045c0,null));};exports[_0x2fda('0x59')]=function(_0x42d228,_0x3c447b,_0x2ae9ee){return db[_0x2fda('0x2e')][_0x2fda('0x49')]({'where':{'id':_0x42d228[_0x2fda('0x46')]['id']}})[_0x2fda('0x27')](handleEntityNotFound(_0x3c447b,null))[_0x2fda('0x27')](function(_0x28b482){if(_0x28b482){return _0x28b482[_0x2fda('0x59')](_0x42d228[_0x2fda('0x33')][_0x2fda('0x57')])[_0x2fda('0x27')](function(){if(_[_0x2fda('0x5a')](_0x42d228['query'][_0x2fda('0x57')])){for(var _0x3d2d6e=0x0;_0x3d2d6e<_0x42d228[_0x2fda('0x33')][_0x2fda('0x57')]['length'];_0x3d2d6e+=0x1){socket[_0x2fda('0x5b')](_0x2fda('0x5c'),{'UserId':Number(_0x42d228[_0x2fda('0x33')][_0x2fda('0x57')][_0x3d2d6e]),'SquareProjectId':Number(_0x42d228[_0x2fda('0x46')]['id'])});}}else{socket[_0x2fda('0x5b')](_0x2fda('0x5c'),{'UserId':Number(_0x42d228[_0x2fda('0x33')]['ids']),'SquareProjectId':Number(_0x42d228[_0x2fda('0x46')]['id'])});}});}})[_0x2fda('0x27')](respondWithStatusCode(_0x3c447b,null))['catch'](handleError(_0x3c447b,null));};exports[_0x2fda('0x5d')]=function(_0x3b3ac6,_0x4749c6,_0x44c5ad){var _0x2c8685={};var _0x5af640={};var _0xc2e7af;var _0x57e9b6;return db[_0x2fda('0x2e')]['findOne']({'where':{'id':_0x3b3ac6[_0x2fda('0x46')]['id']}})[_0x2fda('0x27')](handleEntityNotFound(_0x4749c6,null))[_0x2fda('0x27')](function(_0x3da06b){if(_0x3da06b){_0xc2e7af=_0x3da06b;_0x5af640['model']=_[_0x2fda('0x32')](db[_0x2fda('0x5e')]['rawAttributes']);_0x5af640[_0x2fda('0x33')]=_[_0x2fda('0x32')](_0x3b3ac6[_0x2fda('0x33')]);_0x5af640['filters']=_['intersection'](_0x5af640[_0x2fda('0x35')],_0x5af640['query']);_0x2c8685[_0x2fda('0x36')]=_[_0x2fda('0x34')](_0x5af640['model'],qs['fields'](_0x3b3ac6[_0x2fda('0x33')]['fields']));_0x2c8685['attributes']=_0x2c8685[_0x2fda('0x36')]['length']?_0x2c8685[_0x2fda('0x36')]:_0x5af640[_0x2fda('0x35')];_0x2c8685[_0x2fda('0x5f')]=qs[_0x2fda('0x39')](_0x3b3ac6[_0x2fda('0x33')][_0x2fda('0x39')]);_0x2c8685['where']=qs['filters'](_['pick'](_0x3b3ac6[_0x2fda('0x33')],_0x5af640['filters']));if(_0x3b3ac6[_0x2fda('0x33')][_0x2fda('0x3d')]){_0x2c8685[_0x2fda('0x3a')]=_['merge'](_0x2c8685[_0x2fda('0x3a')],{'$or':_[_0x2fda('0x2d')](_0x2c8685[_0x2fda('0x36')],function(_0x54463a){var _0x405cde={};_0x405cde[_0x54463a]={'$like':'%'+_0x3b3ac6[_0x2fda('0x33')][_0x2fda('0x3d')]+'%'};return _0x405cde;})});}_0x2c8685=_[_0x2fda('0x3f')]({},_0x2c8685,_0x3b3ac6[_0x2fda('0x48')]);return _0xc2e7af['getUsers'](_0x2c8685);}})[_0x2fda('0x27')](function(_0x35f6d9){if(_0x35f6d9){_0x57e9b6=_0x35f6d9[_0x2fda('0x47')];if(!_0x3b3ac6[_0x2fda('0x33')][_0x2fda('0x38')](_0x2fda('0x60'))){_0x2c8685[_0x2fda('0x21')]=qs['limit'](_0x3b3ac6[_0x2fda('0x33')][_0x2fda('0x21')]);_0x2c8685[_0x2fda('0x1f')]=qs[_0x2fda('0x1f')](_0x3b3ac6[_0x2fda('0x33')][_0x2fda('0x1f')]);}return _0xc2e7af[_0x2fda('0x5d')](_0x2c8685);}})[_0x2fda('0x27')](function(_0x155fc0){if(_0x155fc0){return _0x155fc0?{'count':_0x57e9b6,'rows':_0x155fc0}:null;}})['then'](respondWithResult(_0x4749c6,null))[_0x2fda('0x44')](handleError(_0x4749c6,null));}; \ No newline at end of file +var _0x41ad=['fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','VIRTUAL','merge','options','SquareProject','count','includeAll','rows','catch','params','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','SquareProjects','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addUsers','ids','omit','removeUsers','emit','userSquareProject:remove','getUsers','User','sort','filter','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','get','sendStatus','error','stack','name','send','index','map','rawAttributes'];(function(_0x41609a,_0x232cb0){var _0x468097=function(_0x1d02e4){while(--_0x1d02e4){_0x41609a['push'](_0x41609a['shift']());}};_0x468097(++_0x232cb0);}(_0x41ad,0x154));var _0xd41a=function(_0x24445c,_0x184058){_0x24445c=_0x24445c-0x0;var _0x54b013=_0x41ad[_0x24445c];return _0x54b013;};'use strict';var emlformat=require(_0xd41a('0x0'));var rimraf=require(_0xd41a('0x1'));var zipdir=require(_0xd41a('0x2'));var jsonpatch=require(_0xd41a('0x3'));var rp=require(_0xd41a('0x4'));var moment=require(_0xd41a('0x5'));var BPromise=require(_0xd41a('0x6'));var Mustache=require(_0xd41a('0x7'));var util=require(_0xd41a('0x8'));var path=require(_0xd41a('0x9'));var sox=require(_0xd41a('0xa'));var csv=require('to-csv');var ejs=require(_0xd41a('0xb'));var fs=require('fs');var fs_extra=require(_0xd41a('0xc'));var _=require(_0xd41a('0xd'));var squel=require(_0xd41a('0xe'));var crypto=require(_0xd41a('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xd41a('0x10'));var toCsv=require(_0xd41a('0x11'));var querystring=require(_0xd41a('0x12'));var Papa=require('papaparse');var Redis=require(_0xd41a('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd41a('0x14'));var logger=require(_0xd41a('0x15'))(_0xd41a('0x16'));var utils=require(_0xd41a('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xd41a('0x18'));var db=require(_0xd41a('0x19'))['db'];config[_0xd41a('0x1a')]=_[_0xd41a('0x1b')](config[_0xd41a('0x1a')],{'host':_0xd41a('0x1c'),'port':0x18eb});var socket=require(_0xd41a('0x1d'))(new Redis(config[_0xd41a('0x1a')]));require('./squareProject.socket')['register'](socket);function respondWithStatusCode(_0x400d0a,_0x14f92e){_0x14f92e=_0x14f92e||0xcc;return function(_0x338379){if(_0x338379){return _0x400d0a['sendStatus'](_0x14f92e);}return _0x400d0a[_0xd41a('0x1e')](_0x14f92e)[_0xd41a('0x1f')]();};}function respondWithResult(_0x2ea3ef,_0x2a2420){_0x2a2420=_0x2a2420||0xc8;return function(_0x1b3db2){if(_0x1b3db2){return _0x2ea3ef['status'](_0x2a2420)[_0xd41a('0x20')](_0x1b3db2);}};}function respondWithFilteredResult(_0x2ebf80,_0x30a146){return function(_0x46c253){if(_0x46c253){var _0x3f7868=typeof _0x30a146[_0xd41a('0x21')]===_0xd41a('0x22')&&typeof _0x30a146[_0xd41a('0x23')]==='undefined';var _0x37a269=_0x46c253['count'];var _0x5ed1f5=_0x3f7868?0x0:_0x30a146[_0xd41a('0x21')];var _0x5cbd9a=_0x3f7868?_0x46c253['count']:_0x30a146[_0xd41a('0x21')]+_0x30a146['limit'];var _0x19fa1d;if(_0x5cbd9a>=_0x37a269){_0x5cbd9a=_0x37a269;_0x19fa1d=0xc8;}else{_0x19fa1d=0xce;}_0x2ebf80[_0xd41a('0x1e')](_0x19fa1d);return _0x2ebf80[_0xd41a('0x24')](_0xd41a('0x25'),_0x5ed1f5+'-'+_0x5cbd9a+'/'+_0x37a269)[_0xd41a('0x20')](_0x46c253);}return null;};}function patchUpdates(_0x203aa8){return function(_0x31f150){try{jsonpatch[_0xd41a('0x26')](_0x31f150,_0x203aa8,!![]);}catch(_0x2e9809){return BPromise['reject'](_0x2e9809);}return _0x31f150[_0xd41a('0x27')]();};}function saveUpdates(_0x1f9f2b,_0x31322a){return function(_0x1400f1){if(_0x1400f1){return _0x1400f1[_0xd41a('0x28')](_0x1f9f2b)[_0xd41a('0x29')](function(_0x3c9ec7){return _0x3c9ec7;});}return null;};}function removeEntity(_0x34b4ae,_0x4be9ef){return function(_0x56da5f){if(_0x56da5f){return _0x56da5f[_0xd41a('0x2a')]()[_0xd41a('0x29')](function(){var _0x4dd779=_0x56da5f[_0xd41a('0x2b')]({'plain':!![]});var _0x5b553a='SquareProjects';return db['UserProfileResource']['destroy']({'where':{'type':_0x5b553a,'resourceId':_0x4dd779['id']}})[_0xd41a('0x29')](function(){return _0x56da5f;});})['then'](function(){_0x34b4ae[_0xd41a('0x1e')](0xcc)[_0xd41a('0x1f')]();});}};}function handleEntityNotFound(_0x8dec0b,_0x1d41b2){return function(_0x22cead){if(!_0x22cead){_0x8dec0b[_0xd41a('0x2c')](0x194);}return _0x22cead;};}function handleError(_0x31e04c,_0xb7a820){_0xb7a820=_0xb7a820||0x1f4;return function(_0x392f89){logger[_0xd41a('0x2d')](_0x392f89[_0xd41a('0x2e')]);if(_0x392f89[_0xd41a('0x2f')]){delete _0x392f89['name'];}_0x31e04c[_0xd41a('0x1e')](_0xb7a820)[_0xd41a('0x30')](_0x392f89);};}exports[_0xd41a('0x31')]=function(_0x162370,_0x57b451){var _0x4430c5={},_0x50d339={},_0x2558e3={'count':0x0,'rows':[]};var _0x1bd86d=_[_0xd41a('0x32')](db['SquareProject'][_0xd41a('0x33')],function(_0x393e67){return{'name':_0x393e67[_0xd41a('0x34')],'type':_0x393e67['type'][_0xd41a('0x35')]};});_0x50d339[_0xd41a('0x36')]=_[_0xd41a('0x32')](_0x1bd86d,_0xd41a('0x2f'));_0x50d339[_0xd41a('0x37')]=_[_0xd41a('0x38')](_0x162370[_0xd41a('0x37')]);_0x50d339[_0xd41a('0x39')]=_[_0xd41a('0x3a')](_0x50d339[_0xd41a('0x36')],_0x50d339[_0xd41a('0x37')]);_0x4430c5[_0xd41a('0x3b')]=_[_0xd41a('0x3a')](_0x50d339['model'],qs[_0xd41a('0x3c')](_0x162370[_0xd41a('0x37')][_0xd41a('0x3c')]));_0x4430c5[_0xd41a('0x3b')]=_0x4430c5[_0xd41a('0x3b')][_0xd41a('0x3d')]?_0x4430c5['attributes']:_0x50d339[_0xd41a('0x36')];if(!_0x162370[_0xd41a('0x37')][_0xd41a('0x3e')]('nolimit')){_0x4430c5[_0xd41a('0x23')]=qs[_0xd41a('0x23')](_0x162370[_0xd41a('0x37')][_0xd41a('0x23')]);_0x4430c5[_0xd41a('0x21')]=qs[_0xd41a('0x21')](_0x162370[_0xd41a('0x37')]['offset']);}_0x4430c5[_0xd41a('0x3f')]=qs['sort'](_0x162370[_0xd41a('0x37')]['sort']);_0x4430c5[_0xd41a('0x40')]=qs[_0xd41a('0x39')](_[_0xd41a('0x41')](_0x162370[_0xd41a('0x37')],_0x50d339[_0xd41a('0x39')]),_0x1bd86d);if(_0x162370[_0xd41a('0x37')]['filter']){_0x4430c5[_0xd41a('0x40')]=_['merge'](_0x4430c5[_0xd41a('0x40')],{'$or':_[_0xd41a('0x32')](_0x1bd86d,function(_0x2b5032){if(_0x2b5032['type']!==_0xd41a('0x42')){var _0x4e2918={};_0x4e2918[_0x2b5032['name']]={'$like':'%'+_0x162370[_0xd41a('0x37')]['filter']+'%'};return _0x4e2918;}})});}_0x4430c5=_[_0xd41a('0x43')]({},_0x4430c5,_0x162370[_0xd41a('0x44')]);var _0xe51491={'where':_0x4430c5[_0xd41a('0x40')]};return db[_0xd41a('0x45')][_0xd41a('0x46')](_0xe51491)[_0xd41a('0x29')](function(_0x57a3c8){_0x2558e3['count']=_0x57a3c8;if(_0x162370['query'][_0xd41a('0x47')]){_0x4430c5['include']=[{'all':!![]}];}return db['SquareProject']['findAll'](_0x4430c5);})[_0xd41a('0x29')](function(_0x36efed){_0x2558e3[_0xd41a('0x48')]=_0x36efed;return _0x2558e3;})['then'](respondWithFilteredResult(_0x57b451,_0x4430c5))[_0xd41a('0x49')](handleError(_0x57b451,null));};exports['show']=function(_0x7671d1,_0x18dfe3){var _0x51d0ab={'raw':![],'where':{'id':_0x7671d1[_0xd41a('0x4a')]['id']}},_0x5d2ed1={};_0x5d2ed1[_0xd41a('0x36')]=_[_0xd41a('0x38')](db['SquareProject'][_0xd41a('0x33')]);_0x5d2ed1[_0xd41a('0x37')]=_[_0xd41a('0x38')](_0x7671d1[_0xd41a('0x37')]);_0x5d2ed1['filters']=_['intersection'](_0x5d2ed1[_0xd41a('0x36')],_0x5d2ed1[_0xd41a('0x37')]);_0x51d0ab['attributes']=_[_0xd41a('0x3a')](_0x5d2ed1['model'],qs[_0xd41a('0x3c')](_0x7671d1[_0xd41a('0x37')][_0xd41a('0x3c')]));_0x51d0ab[_0xd41a('0x3b')]=_0x51d0ab[_0xd41a('0x3b')][_0xd41a('0x3d')]?_0x51d0ab[_0xd41a('0x3b')]:_0x5d2ed1[_0xd41a('0x36')];if(_0x7671d1[_0xd41a('0x37')]['includeAll']){_0x51d0ab[_0xd41a('0x4b')]=[{'all':!![]}];}_0x51d0ab=_[_0xd41a('0x43')]({},_0x51d0ab,_0x7671d1['options']);return db[_0xd41a('0x45')][_0xd41a('0x4c')](_0x51d0ab)[_0xd41a('0x29')](handleEntityNotFound(_0x18dfe3,null))[_0xd41a('0x29')](respondWithResult(_0x18dfe3,null))[_0xd41a('0x49')](handleError(_0x18dfe3,null));};exports[_0xd41a('0x4d')]=function(_0x4525fc,_0x354a20){return db[_0xd41a('0x45')][_0xd41a('0x4d')](_0x4525fc['body'],{})[_0xd41a('0x29')](function(_0x321e9c){var _0x1688c3=_0x4525fc['user'][_0xd41a('0x2b')]({'plain':!![]});if(!_0x1688c3)throw new Error(_0xd41a('0x4e'));if(_0x1688c3['role']===_0xd41a('0x4f')){var _0x303620=_0x321e9c[_0xd41a('0x2b')]({'plain':!![]});var _0xadc5d7=_0xd41a('0x50');return db[_0xd41a('0x51')]['find']({'where':{'name':_0xadc5d7,'userProfileId':_0x1688c3[_0xd41a('0x52')]},'raw':!![]})[_0xd41a('0x29')](function(_0x5b0ac0){if(_0x5b0ac0&&_0x5b0ac0[_0xd41a('0x53')]===0x0){return db[_0xd41a('0x54')]['create']({'name':_0x303620[_0xd41a('0x2f')],'resourceId':_0x303620['id'],'type':_0x5b0ac0['name'],'sectionId':_0x5b0ac0['id']},{})[_0xd41a('0x29')](function(){return _0x321e9c;});}else{return _0x321e9c;}})['catch'](function(_0x5b08e6){logger['error'](_0xd41a('0x55'),_0x5b08e6);throw _0x5b08e6;});}return _0x321e9c;})['then'](respondWithResult(_0x354a20,0xc9))[_0xd41a('0x49')](handleError(_0x354a20,null));};exports[_0xd41a('0x28')]=function(_0xed095d,_0x4229d3){if(_0xed095d[_0xd41a('0x56')]['id']){delete _0xed095d[_0xd41a('0x56')]['id'];}return db['SquareProject']['find']({'where':{'id':_0xed095d[_0xd41a('0x4a')]['id']}})[_0xd41a('0x29')](handleEntityNotFound(_0x4229d3,null))[_0xd41a('0x29')](saveUpdates(_0xed095d['body'],null))['then'](respondWithResult(_0x4229d3,null))['catch'](handleError(_0x4229d3,null));};exports[_0xd41a('0x2a')]=function(_0x59a75a,_0x2cf8a8){return db['SquareProject']['find']({'where':{'id':_0x59a75a[_0xd41a('0x4a')]['id']}})[_0xd41a('0x29')](handleEntityNotFound(_0x2cf8a8,null))[_0xd41a('0x29')](removeEntity(_0x2cf8a8,null))[_0xd41a('0x49')](handleError(_0x2cf8a8,null));};exports[_0xd41a('0x57')]=function(_0x59c986,_0x7f94a9,_0x3e5182){return db[_0xd41a('0x45')][_0xd41a('0x4c')]({'where':{'id':_0x59c986[_0xd41a('0x4a')]['id']}})[_0xd41a('0x29')](handleEntityNotFound(_0x7f94a9,null))[_0xd41a('0x29')](function(_0x797a8){if(_0x797a8){return _0x797a8[_0xd41a('0x57')](_0x59c986[_0xd41a('0x56')][_0xd41a('0x58')],_[_0xd41a('0x59')](_0x59c986[_0xd41a('0x56')],['ids','id'])||{});}})[_0xd41a('0x29')](respondWithResult(_0x7f94a9,null))[_0xd41a('0x49')](handleError(_0x7f94a9,null));};exports[_0xd41a('0x5a')]=function(_0x309fd0,_0x373187,_0x54cba2){return db[_0xd41a('0x45')]['find']({'where':{'id':_0x309fd0[_0xd41a('0x4a')]['id']}})[_0xd41a('0x29')](handleEntityNotFound(_0x373187,null))[_0xd41a('0x29')](function(_0x4e772f){if(_0x4e772f){return _0x4e772f['removeUsers'](_0x309fd0[_0xd41a('0x37')][_0xd41a('0x58')])['then'](function(){if(_['isArray'](_0x309fd0[_0xd41a('0x37')][_0xd41a('0x58')])){for(var _0x2bcbdf=0x0;_0x2bcbdf<_0x309fd0['query'][_0xd41a('0x58')][_0xd41a('0x3d')];_0x2bcbdf+=0x1){socket[_0xd41a('0x5b')](_0xd41a('0x5c'),{'UserId':Number(_0x309fd0[_0xd41a('0x37')][_0xd41a('0x58')][_0x2bcbdf]),'SquareProjectId':Number(_0x309fd0[_0xd41a('0x4a')]['id'])});}}else{socket[_0xd41a('0x5b')]('userSquareProject:remove',{'UserId':Number(_0x309fd0[_0xd41a('0x37')]['ids']),'SquareProjectId':Number(_0x309fd0['params']['id'])});}});}})[_0xd41a('0x29')](respondWithStatusCode(_0x373187,null))[_0xd41a('0x49')](handleError(_0x373187,null));};exports[_0xd41a('0x5d')]=function(_0x3a4c54,_0x14ed8b,_0xcc47d4){var _0x203f01={};var _0x48ace2={};var _0x56a3d9;var _0x5889d7;return db[_0xd41a('0x45')]['findOne']({'where':{'id':_0x3a4c54['params']['id']}})[_0xd41a('0x29')](handleEntityNotFound(_0x14ed8b,null))[_0xd41a('0x29')](function(_0xb0fc89){if(_0xb0fc89){_0x56a3d9=_0xb0fc89;_0x48ace2['model']=_[_0xd41a('0x38')](db[_0xd41a('0x5e')][_0xd41a('0x33')]);_0x48ace2[_0xd41a('0x37')]=_[_0xd41a('0x38')](_0x3a4c54[_0xd41a('0x37')]);_0x48ace2[_0xd41a('0x39')]=_['intersection'](_0x48ace2['model'],_0x48ace2['query']);_0x203f01['attributes']=_[_0xd41a('0x3a')](_0x48ace2[_0xd41a('0x36')],qs[_0xd41a('0x3c')](_0x3a4c54[_0xd41a('0x37')][_0xd41a('0x3c')]));_0x203f01[_0xd41a('0x3b')]=_0x203f01['attributes']['length']?_0x203f01[_0xd41a('0x3b')]:_0x48ace2['model'];_0x203f01[_0xd41a('0x3f')]=qs[_0xd41a('0x5f')](_0x3a4c54['query'][_0xd41a('0x5f')]);_0x203f01[_0xd41a('0x40')]=qs[_0xd41a('0x39')](_['pick'](_0x3a4c54[_0xd41a('0x37')],_0x48ace2[_0xd41a('0x39')]));if(_0x3a4c54[_0xd41a('0x37')][_0xd41a('0x60')]){_0x203f01['where']=_[_0xd41a('0x43')](_0x203f01[_0xd41a('0x40')],{'$or':_[_0xd41a('0x32')](_0x203f01[_0xd41a('0x3b')],function(_0x540c1d){var _0x1de875={};_0x1de875[_0x540c1d]={'$like':'%'+_0x3a4c54[_0xd41a('0x37')][_0xd41a('0x60')]+'%'};return _0x1de875;})});}_0x203f01=_['merge']({},_0x203f01,_0x3a4c54[_0xd41a('0x44')]);return _0x56a3d9[_0xd41a('0x5d')](_0x203f01);}})[_0xd41a('0x29')](function(_0x259710){if(_0x259710){_0x5889d7=_0x259710[_0xd41a('0x3d')];if(!_0x3a4c54[_0xd41a('0x37')][_0xd41a('0x3e')](_0xd41a('0x61'))){_0x203f01[_0xd41a('0x23')]=qs[_0xd41a('0x23')](_0x3a4c54[_0xd41a('0x37')]['limit']);_0x203f01[_0xd41a('0x21')]=qs['offset'](_0x3a4c54[_0xd41a('0x37')][_0xd41a('0x21')]);}return _0x56a3d9[_0xd41a('0x5d')](_0x203f01);}})[_0xd41a('0x29')](function(_0x146422){if(_0x146422){return _0x146422?{'count':_0x5889d7,'rows':_0x146422}:null;}})[_0xd41a('0x29')](respondWithResult(_0x14ed8b,null))[_0xd41a('0x49')](handleError(_0x14ed8b,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index e1037f7..b5092f4 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 _0x5467=['events','SquareProject','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x59fc33,_0x2e182d){var _0x39066f=function(_0x4d843d){while(--_0x4d843d){_0x59fc33['push'](_0x59fc33['shift']());}};_0x39066f(++_0x2e182d);}(_0x5467,0x80));var _0x7546=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x5467[_0x5c351c];return _0x26f3b3;};'use strict';var EventEmitter=require(_0x7546('0x0'));var SquareProject=require('../../mysqldb')['db'][_0x7546('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7546('0x2'),'afterUpdate':_0x7546('0x3'),'afterDestroy':_0x7546('0x4')};function emitEvent(_0x1f8cf3){return function(_0x30015b,_0x2e51a8,_0x220864){SquareProjectEvents[_0x7546('0x5')](_0x1f8cf3+':'+_0x30015b['id'],_0x30015b);SquareProjectEvents[_0x7546('0x5')](_0x1f8cf3,_0x30015b);_0x220864(null);};}for(var e in events){if(events[_0x7546('0x6')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0x7546('0x7')]=SquareProjectEvents; \ No newline at end of file +var _0xda77=['emit','hook','exports','events','../../mysqldb','SquareProject','save','update','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xda77,0x123));var _0x7da7=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0xda77[_0x1c8c28];return _0x1f59b4;};'use strict';var EventEmitter=require(_0x7da7('0x0'));var SquareProject=require(_0x7da7('0x1'))['db'][_0x7da7('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7da7('0x3'),'afterUpdate':_0x7da7('0x4'),'afterDestroy':_0x7da7('0x5')};function emitEvent(_0x8699c4){return function(_0x12fdca,_0x3f6e76,_0x5356c0){SquareProjectEvents['emit'](_0x8699c4+':'+_0x12fdca['id'],_0x12fdca);SquareProjectEvents[_0x7da7('0x6')](_0x8699c4,_0x12fdca);_0x5356c0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x7da7('0x7')](e,emitEvent(event));}}module[_0x7da7('0x8')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 1bdae86..8f4b23e 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 _0x07f2=['production','publishedAt','format','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./squareProject.attributes','exports','SquareProject','preproduction','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x5abd53,_0x18f1ec){var _0x6419bc=function(_0x5cba36){while(--_0x5cba36){_0x5abd53['push'](_0x5abd53['shift']());}};_0x6419bc(++_0x18f1ec);}(_0x07f2,0xa8));var _0x207f=function(_0x51d74e,_0x250c05){_0x51d74e=_0x51d74e-0x0;var _0x27a3b5=_0x07f2[_0x51d74e];return _0x27a3b5;};'use strict';var _=require('lodash');var util=require(_0x207f('0x0'));var logger=require(_0x207f('0x1'))(_0x207f('0x2'));var moment=require('moment');var BPromise=require(_0x207f('0x3'));var rp=require(_0x207f('0x4'));var fs=require('fs');var path=require(_0x207f('0x5'));var rimraf=require(_0x207f('0x6'));var config=require('../../config/environment');var attributes=require(_0x207f('0x7'));module[_0x207f('0x8')]=function(_0x3470df,_0x54210c){return _0x3470df['define'](_0x207f('0x9'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2aa961,_0xfc636,_0x1e796e){if(_0x2aa961['changed'](_0x207f('0xa'))){_0x2aa961['savedAt']=moment()['format'](_0x207f('0xb'));}if(_0x2aa961['changed'](_0x207f('0xc'))){_0x2aa961[_0x207f('0xd')]=moment()[_0x207f('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1e796e(null,_0x2aa961);}}});}; \ No newline at end of file +var _0x8689=['../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','changed','production','publishedAt'];(function(_0x2714ad,_0x4c160c){var _0x3f6158=function(_0x1c1bfc){while(--_0x1c1bfc){_0x2714ad['push'](_0x2714ad['shift']());}};_0x3f6158(++_0x4c160c);}(_0x8689,0x99));var _0x9868=function(_0x331f3d,_0x1930c9){_0x331f3d=_0x331f3d-0x0;var _0x2e03d7=_0x8689[_0x331f3d];return _0x2e03d7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9868('0x0'))(_0x9868('0x1'));var moment=require(_0x9868('0x2'));var BPromise=require('bluebird');var rp=require(_0x9868('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9868('0x4'));var config=require(_0x9868('0x5'));var attributes=require(_0x9868('0x6'));module[_0x9868('0x7')]=function(_0x32c8f9,_0x1d8f1d){return _0x32c8f9[_0x9868('0x8')](_0x9868('0x9'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x397363,_0x197493,_0x2ea846){if(_0x397363['changed'](_0x9868('0xa'))){_0x397363[_0x9868('0xb')]=moment()[_0x9868('0xc')](_0x9868('0xd'));}if(_0x397363[_0x9868('0xe')](_0x9868('0xf'))){_0x397363[_0x9868('0x10')]=moment()[_0x9868('0xc')](_0x9868('0xd'));}_0x2ea846(null,_0x397363);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 20c5a95..1957537 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 _0x3211=['then','info','debug','stringify','error','code','message','SquareProject,\x20%s,\x20%s','result','catch','SquareProject','find','options','attributes','include','map','model','ShowSquareProject','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','redis','localhost','socket.io-emitter','./squareProject.socket','register','request'];(function(_0xa6cc5c,_0x239c99){var _0x44803d=function(_0x515b6e){while(--_0x515b6e){_0xa6cc5c['push'](_0xa6cc5c['shift']());}};_0x44803d(++_0x239c99);}(_0x3211,0xf9));var _0x1321=function(_0x3694d1,_0x53f8a4){_0x3694d1=_0x3694d1-0x0;var _0x1d92e3=_0x3211[_0x3694d1];return _0x1d92e3;};'use strict';var _=require(_0x1321('0x0'));var util=require(_0x1321('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1321('0x2'));var fs=require('fs');var Redis=require(_0x1321('0x3'));var db=require(_0x1321('0x4'))['db'];var utils=require(_0x1321('0x5'));var logger=require(_0x1321('0x6'))('rpc');var config=require(_0x1321('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1321('0x8')]({'port':0x232a});config['redis']=_['defaults'](config[_0x1321('0x9')],{'host':_0x1321('0xa'),'port':0x18eb});var socket=require(_0x1321('0xb'))(new Redis(config[_0x1321('0x9')]));require(_0x1321('0xc'))[_0x1321('0xd')](socket);function respondWithRpcPromise(_0xa06779,_0x13c965,_0x165112){return new BPromise(function(_0x25eaae,_0x292381){return client[_0x1321('0xe')](_0xa06779,_0x165112)[_0x1321('0xf')](function(_0x7b6d62){logger[_0x1321('0x10')]('SquareProject,\x20%s,\x20%s',_0x13c965,'request\x20sent');logger[_0x1321('0x11')]('SquareProject,\x20%s,\x20%s,\x20%s',_0x13c965,'request\x20sent',JSON[_0x1321('0x12')](_0x7b6d62));if(_0x7b6d62[_0x1321('0x13')]){if(_0x7b6d62[_0x1321('0x13')][_0x1321('0x14')]===0x1f4){logger[_0x1321('0x13')]('SquareProject,\x20%s,\x20%s',_0x13c965,_0x7b6d62[_0x1321('0x13')][_0x1321('0x15')]);return _0x292381(_0x7b6d62[_0x1321('0x13')][_0x1321('0x15')]);}logger[_0x1321('0x13')](_0x1321('0x16'),_0x13c965,_0x7b6d62[_0x1321('0x13')]['message']);return _0x25eaae(_0x7b6d62[_0x1321('0x13')][_0x1321('0x15')]);}else{logger[_0x1321('0x10')](_0x1321('0x16'),_0x13c965,'request\x20sent');_0x25eaae(_0x7b6d62[_0x1321('0x17')][_0x1321('0x15')]);}})[_0x1321('0x18')](function(_0x2851a5){logger[_0x1321('0x13')](_0x1321('0x16'),_0x13c965,_0x2851a5);_0x292381(_0x2851a5);});});}exports['ShowSquareProject']=function(_0x50c03f){var _0x363d21=this;return new Promise(function(_0x4c3587,_0x95e459){return db[_0x1321('0x19')][_0x1321('0x1a')]({'raw':_0x50c03f[_0x1321('0x1b')]?_0x50c03f['options']['raw']===undefined?!![]:![]:!![],'where':_0x50c03f[_0x1321('0x1b')]?_0x50c03f[_0x1321('0x1b')]['where']||null:null,'attributes':_0x50c03f[_0x1321('0x1b')]?_0x50c03f[_0x1321('0x1b')][_0x1321('0x1c')]||null:null,'include':_0x50c03f['options']?_0x50c03f[_0x1321('0x1b')][_0x1321('0x1d')]?_[_0x1321('0x1e')](_0x50c03f[_0x1321('0x1b')][_0x1321('0x1d')],function(_0x548e06){return{'model':db[_0x548e06[_0x1321('0x1f')]],'as':_0x548e06['as'],'attributes':_0x548e06[_0x1321('0x1c')],'include':_0x548e06[_0x1321('0x1d')]?_[_0x1321('0x1e')](_0x548e06[_0x1321('0x1d')],function(_0x16fb3a){return{'model':db[_0x16fb3a[_0x1321('0x1f')]],'as':_0x16fb3a['as'],'attributes':_0x16fb3a[_0x1321('0x1c')],'include':_0x16fb3a[_0x1321('0x1d')]?_[_0x1321('0x1e')](_0x16fb3a[_0x1321('0x1d')],function(_0x190df){return{'model':db[_0x190df[_0x1321('0x1f')]],'as':_0x190df['as'],'attributes':_0x190df[_0x1321('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x1321('0xf')](function(_0x2a77b9){logger[_0x1321('0x10')](_0x1321('0x20'),_0x50c03f);logger[_0x1321('0x11')](_0x1321('0x20'),_0x50c03f,JSON[_0x1321('0x12')](_0x2a77b9));_0x4c3587(_0x2a77b9);})['catch'](function(_0x1d0217){logger[_0x1321('0x13')]('ShowSquareProject',_0x1d0217[_0x1321('0x15')],_0x50c03f);_0x95e459(_0x363d21['error'](0x1f4,_0x1d0217[_0x1321('0x15')]));});});}; \ No newline at end of file +var _0xd3e0=['error','code','message','request\x20sent','catch','ShowSquareProject','options','raw','attributes','map','include','model','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','./squareProject.socket','register','request','then','info','SquareProject,\x20%s,\x20%s','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2e8dfb,_0x57d353){var _0x20ec45=function(_0x8cb5d8){while(--_0x8cb5d8){_0x2e8dfb['push'](_0x2e8dfb['shift']());}};_0x20ec45(++_0x57d353);}(_0xd3e0,0xd8));var _0x0d3e=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xd3e0[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x0d3e('0x0'));var util=require(_0x0d3e('0x1'));var moment=require(_0x0d3e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d3e('0x3'));var db=require(_0x0d3e('0x4'))['db'];var utils=require(_0x0d3e('0x5'));var logger=require(_0x0d3e('0x6'))(_0x0d3e('0x7'));var config=require(_0x0d3e('0x8'));var jayson=require(_0x0d3e('0x9'));var client=jayson[_0x0d3e('0xa')][_0x0d3e('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x0d3e('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0d3e('0xd'))[_0x0d3e('0xe')](socket);function respondWithRpcPromise(_0x44e372,_0x20ea75,_0x20f1e6){return new BPromise(function(_0x19b77b,_0x248e3f){return client[_0x0d3e('0xf')](_0x44e372,_0x20f1e6)[_0x0d3e('0x10')](function(_0x4adbb3){logger[_0x0d3e('0x11')](_0x0d3e('0x12'),_0x20ea75,'request\x20sent');logger[_0x0d3e('0x13')](_0x0d3e('0x14'),_0x20ea75,'request\x20sent',JSON[_0x0d3e('0x15')](_0x4adbb3));if(_0x4adbb3['error']){if(_0x4adbb3[_0x0d3e('0x16')][_0x0d3e('0x17')]===0x1f4){logger[_0x0d3e('0x16')](_0x0d3e('0x12'),_0x20ea75,_0x4adbb3[_0x0d3e('0x16')][_0x0d3e('0x18')]);return _0x248e3f(_0x4adbb3[_0x0d3e('0x16')][_0x0d3e('0x18')]);}logger['error'](_0x0d3e('0x12'),_0x20ea75,_0x4adbb3[_0x0d3e('0x16')][_0x0d3e('0x18')]);return _0x19b77b(_0x4adbb3[_0x0d3e('0x16')][_0x0d3e('0x18')]);}else{logger[_0x0d3e('0x11')](_0x0d3e('0x12'),_0x20ea75,_0x0d3e('0x19'));_0x19b77b(_0x4adbb3['result'][_0x0d3e('0x18')]);}})[_0x0d3e('0x1a')](function(_0x4727d9){logger[_0x0d3e('0x16')]('SquareProject,\x20%s,\x20%s',_0x20ea75,_0x4727d9);_0x248e3f(_0x4727d9);});});}exports[_0x0d3e('0x1b')]=function(_0x5b663e){var _0x3030bc=this;return new Promise(function(_0x397927,_0xf7c81e){return db['SquareProject']['find']({'raw':_0x5b663e[_0x0d3e('0x1c')]?_0x5b663e[_0x0d3e('0x1c')][_0x0d3e('0x1d')]===undefined?!![]:![]:!![],'where':_0x5b663e[_0x0d3e('0x1c')]?_0x5b663e[_0x0d3e('0x1c')]['where']||null:null,'attributes':_0x5b663e[_0x0d3e('0x1c')]?_0x5b663e[_0x0d3e('0x1c')][_0x0d3e('0x1e')]||null:null,'include':_0x5b663e[_0x0d3e('0x1c')]?_0x5b663e[_0x0d3e('0x1c')]['include']?_[_0x0d3e('0x1f')](_0x5b663e[_0x0d3e('0x1c')][_0x0d3e('0x20')],function(_0x1e82a1){return{'model':db[_0x1e82a1[_0x0d3e('0x21')]],'as':_0x1e82a1['as'],'attributes':_0x1e82a1['attributes'],'include':_0x1e82a1[_0x0d3e('0x20')]?_[_0x0d3e('0x1f')](_0x1e82a1[_0x0d3e('0x20')],function(_0x4f5798){return{'model':db[_0x4f5798[_0x0d3e('0x21')]],'as':_0x4f5798['as'],'attributes':_0x4f5798['attributes'],'include':_0x4f5798['include']?_[_0x0d3e('0x1f')](_0x4f5798['include'],function(_0x51b5f1){return{'model':db[_0x51b5f1[_0x0d3e('0x21')]],'as':_0x51b5f1['as'],'attributes':_0x51b5f1['attributes']};}):[]};}):[]};}):[]:[]})[_0x0d3e('0x10')](function(_0x328a00){logger[_0x0d3e('0x11')](_0x0d3e('0x1b'),_0x5b663e);logger[_0x0d3e('0x13')](_0x0d3e('0x1b'),_0x5b663e,JSON[_0x0d3e('0x15')](_0x328a00));_0x397927(_0x328a00);})[_0x0d3e('0x1a')](function(_0x1680a9){logger[_0x0d3e('0x16')]('ShowSquareProject',_0x1680a9[_0x0d3e('0x18')],_0x5b663e);_0xf7c81e(_0x3030bc[_0x0d3e('0x16')](0x1f4,_0x1680a9[_0x0d3e('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 5abb904..c2b837a 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 _0x6214=['length','squareProject:','save','remove','update','emit','removeListener'];(function(_0x345da2,_0x2200d0){var _0x2a79ba=function(_0x392d32){while(--_0x392d32){_0x345da2['push'](_0x345da2['shift']());}};_0x2a79ba(++_0x2200d0);}(_0x6214,0xaa));var _0x4621=function(_0x503950,_0x5022eb){_0x503950=_0x503950-0x0;var _0x1657a9=_0x6214[_0x503950];return _0x1657a9;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x4621('0x0'),_0x4621('0x1'),_0x4621('0x2')];function createListener(_0x2e9faf,_0x245fb2){return function(_0x34acdd){_0x245fb2[_0x4621('0x3')](_0x2e9faf,_0x34acdd);};}function removeListener(_0x3aba9d,_0x4479fc){return function(){SquareProjectEvents[_0x4621('0x4')](_0x3aba9d,_0x4479fc);};}exports['register']=function(_0x18a235){for(var _0xae5cad=0x0,_0x5dcf05=events[_0x4621('0x5')];_0xae5cad<_0x5dcf05;_0xae5cad++){var _0x2f251f=events[_0xae5cad];var _0x1d5115=createListener(_0x4621('0x6')+_0x2f251f,_0x18a235);SquareProjectEvents['on'](_0x2f251f,_0x1d5115);}}; \ No newline at end of file +var _0xc222=['emit','removeListener','register','length','squareProject:','remove','update'];(function(_0x54cb5d,_0x3927ed){var _0x15c55a=function(_0x12f082){while(--_0x12f082){_0x54cb5d['push'](_0x54cb5d['shift']());}};_0x15c55a(++_0x3927ed);}(_0xc222,0x1e8));var _0x2c22=function(_0x441544,_0x3cc7d2){_0x441544=_0x441544-0x0;var _0x5aaaf9=_0xc222[_0x441544];return _0x5aaaf9;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=['save',_0x2c22('0x0'),_0x2c22('0x1')];function createListener(_0x1964c7,_0x4e4a1f){return function(_0x4459a4){_0x4e4a1f[_0x2c22('0x2')](_0x1964c7,_0x4459a4);};}function removeListener(_0x2011e2,_0x2e7e41){return function(){SquareProjectEvents[_0x2c22('0x3')](_0x2011e2,_0x2e7e41);};}exports[_0x2c22('0x4')]=function(_0x4a19f7){for(var _0x118719=0x0,_0x3cfb53=events[_0x2c22('0x5')];_0x118719<_0x3cfb53;_0x118719++){var _0x45352a=events[_0x118719];var _0x31016b=createListener(_0x2c22('0x6')+_0x45352a,_0x4a19f7);SquareProjectEvents['on'](_0x45352a,_0x31016b);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 5e626df..94cdd94 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 _0xabce=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','show','download','post','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x18ae26,_0x26f836){var _0x2c638a=function(_0x5bcc90){while(--_0x5bcc90){_0x18ae26['push'](_0x18ae26['shift']());}};_0x2c638a(++_0x26f836);}(_0xabce,0x103));var _0xeabc=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xabce[_0x1035c1];return _0x308d67;};'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('./squareRecording.controller');router['get']('/',auth[_0xeabc('0x8')](),controller['index']);router[_0xeabc('0x9')]('/:id',auth[_0xeabc('0x8')](),controller[_0xeabc('0xa')]);router[_0xeabc('0x9')]('/:id/download',auth[_0xeabc('0x8')](),controller[_0xeabc('0xb')]);router[_0xeabc('0xc')]('/',auth[_0xeabc('0x8')](),controller[_0xeabc('0xd')]);router[_0xeabc('0xe')](_0xeabc('0xf'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x10')]);router[_0xeabc('0x11')](_0xeabc('0xf'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x12')]);module[_0xeabc('0x13')]=router; \ No newline at end of file +var _0xc4aa=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./squareRecording.controller','get','isAuthenticated','index','/:id','/:id/download','download','create','put','delete'];(function(_0xae63c1,_0x325802){var _0x4f3ca9=function(_0x48ab0c){while(--_0x48ab0c){_0xae63c1['push'](_0xae63c1['shift']());}};_0x4f3ca9(++_0x325802);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xc4aa[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac4a('0x6'));var controller=require(_0xac4a('0x7'));router[_0xac4a('0x8')]('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router[_0xac4a('0x8')](_0xac4a('0xb'),auth[_0xac4a('0x9')](),controller['show']);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router['post']('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xe')]);router[_0xac4a('0xf')]('/:id',auth[_0xac4a('0x9')](),controller['update']);router[_0xac4a('0x10')]('/:id',auth[_0xac4a('0x9')](),controller[_0xac4a('0x11')]);module[_0xac4a('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 1c92a95..03dab71 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 _0xdbf5=['lastIndexOf','exports','STRING','VIRTUAL','savePath'];(function(_0x2fa4c2,_0x38948a){var _0x2c7c71=function(_0x186d02){while(--_0x186d02){_0x2fa4c2['push'](_0x2fa4c2['shift']());}};_0x2c7c71(++_0x38948a);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x146eab,_0x56107c){_0x146eab=_0x146eab-0x0;var _0x964ce7=_0xdbf5[_0x146eab];return _0x964ce7;};'use strict';var Sequelize=require('sequelize');module[_0x5dbf('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x5dbf('0x1')]},'context':{'type':Sequelize[_0x5dbf('0x1')]},'extension':{'type':Sequelize[_0x5dbf('0x1')]},'priority':{'type':Sequelize[_0x5dbf('0x1')]},'accountcode':{'type':Sequelize[_0x5dbf('0x1')]},'dnid':{'type':Sequelize[_0x5dbf('0x1')]},'projectName':{'type':Sequelize[_0x5dbf('0x1')]},'saveName':{'type':Sequelize[_0x5dbf('0x1')]},'filename':{'type':Sequelize[_0x5dbf('0x1')]},'savePath':{'type':Sequelize[_0x5dbf('0x1')]},'format':{'type':Sequelize[_0x5dbf('0x2')],'get':function(){var _0x88128e='';var _0x93e657=this['getDataValue'](_0x5dbf('0x3'));if(_0x93e657){_0x88128e=_0x93e657['substring'](_0x93e657[_0x5dbf('0x4')]('.'));}return _0x88128e;}}}; \ No newline at end of file +var _0x3eea=['getDataValue','substring','sequelize','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x714842,_0x5bdad2){_0x714842=_0x714842-0x0;var _0x53f80c=_0x3eea[_0x714842];return _0x53f80c;};'use strict';var Sequelize=require(_0xa3ee('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xa3ee('0x1')]},'callerid':{'type':Sequelize[_0xa3ee('0x1')]},'calleridname':{'type':Sequelize[_0xa3ee('0x1')]},'context':{'type':Sequelize[_0xa3ee('0x1')]},'extension':{'type':Sequelize[_0xa3ee('0x1')]},'priority':{'type':Sequelize[_0xa3ee('0x1')]},'accountcode':{'type':Sequelize[_0xa3ee('0x1')]},'dnid':{'type':Sequelize[_0xa3ee('0x1')]},'projectName':{'type':Sequelize[_0xa3ee('0x1')]},'saveName':{'type':Sequelize[_0xa3ee('0x1')]},'filename':{'type':Sequelize[_0xa3ee('0x1')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize['VIRTUAL'],'get':function(){var _0x4183ee='';var _0x4e4588=this[_0xa3ee('0x2')]('savePath');if(_0x4e4588){_0x4183ee=_0x4e4588[_0xa3ee('0x3')](_0x4e4588['lastIndexOf']('.'));}return _0x4183ee;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 139e780..eaa67ad 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 _0x44b0=['save','update','destroy','then','stack','name','send','index','map','SquareRecording','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','keys','rawAttributes','create','body','params','download','../../components/encryptor','uniqueid','find','savePath','filename','format','%s.cypher','decryptFile','secrets','recording','existsSync','Sequelize','SquareRecording\x20not\x20found','unlink','message','Not\x20found','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x44b0,0x161));var _0x044b=function(_0x331123,_0x40de4f){_0x331123=_0x331123-0x0;var _0x1eab9f=_0x44b0[_0x331123];return _0x1eab9f;};'use strict';var emlformat=require(_0x044b('0x0'));var rimraf=require(_0x044b('0x1'));var zipdir=require(_0x044b('0x2'));var jsonpatch=require(_0x044b('0x3'));var rp=require(_0x044b('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x044b('0x5'));var util=require('util');var path=require(_0x044b('0x6'));var sox=require(_0x044b('0x7'));var csv=require(_0x044b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x044b('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x044b('0xa'));var deskjs=require(_0x044b('0xb'));var toCsv=require(_0x044b('0x8'));var querystring=require(_0x044b('0xc'));var Papa=require(_0x044b('0xd'));var Redis=require('ioredis');var authService=require(_0x044b('0xe'));var qs=require(_0x044b('0xf'));var as=require(_0x044b('0x10'));var hardwareService=require(_0x044b('0x11'));var logger=require(_0x044b('0x12'))(_0x044b('0x13'));var utils=require(_0x044b('0x14'));var config=require(_0x044b('0x15'));var licenseUtil=require(_0x044b('0x16'));var db=require(_0x044b('0x17'))['db'];function respondWithStatusCode(_0x5f4239,_0x2f56c4){_0x2f56c4=_0x2f56c4||0xcc;return function(_0x4dfca0){if(_0x4dfca0){return _0x5f4239[_0x044b('0x18')](_0x2f56c4);}return _0x5f4239[_0x044b('0x19')](_0x2f56c4)[_0x044b('0x1a')]();};}function respondWithResult(_0x1f1e45,_0x3d5f37){_0x3d5f37=_0x3d5f37||0xc8;return function(_0x26edf8){if(_0x26edf8){return _0x1f1e45['status'](_0x3d5f37)[_0x044b('0x1b')](_0x26edf8);}};}function respondWithFilteredResult(_0xe89021,_0x2dbc00){return function(_0x23d104){if(_0x23d104){var _0x1d09de=typeof _0x2dbc00[_0x044b('0x1c')]===_0x044b('0x1d')&&typeof _0x2dbc00[_0x044b('0x1e')]===_0x044b('0x1d');var _0x58b955=_0x23d104['count'];var _0x466e45=_0x1d09de?0x0:_0x2dbc00[_0x044b('0x1c')];var _0x3dba26=_0x1d09de?_0x23d104[_0x044b('0x1f')]:_0x2dbc00[_0x044b('0x1c')]+_0x2dbc00['limit'];var _0x52b822;if(_0x3dba26>=_0x58b955){_0x3dba26=_0x58b955;_0x52b822=0xc8;}else{_0x52b822=0xce;}_0xe89021[_0x044b('0x19')](_0x52b822);return _0xe89021['set'](_0x044b('0x20'),_0x466e45+'-'+_0x3dba26+'/'+_0x58b955)[_0x044b('0x1b')](_0x23d104);}return null;};}function patchUpdates(_0x1809ba){return function(_0x3b3356){try{jsonpatch[_0x044b('0x21')](_0x3b3356,_0x1809ba,!![]);}catch(_0x6064a1){return BPromise[_0x044b('0x22')](_0x6064a1);}return _0x3b3356[_0x044b('0x23')]();};}function saveUpdates(_0x5ae1d5,_0x656f01){return function(_0x597577){if(_0x597577){return _0x597577[_0x044b('0x24')](_0x5ae1d5)['then'](function(_0x5c5a58){return _0x5c5a58;});}return null;};}function removeEntity(_0x368803,_0x241798){return function(_0x2602c4){if(_0x2602c4){return _0x2602c4[_0x044b('0x25')]()[_0x044b('0x26')](function(){_0x368803[_0x044b('0x19')](0xcc)[_0x044b('0x1a')]();});}};}function handleEntityNotFound(_0xa2975d,_0xc7d216){return function(_0x3ecf27){if(!_0x3ecf27){_0xa2975d[_0x044b('0x18')](0x194);}return _0x3ecf27;};}function handleError(_0x596a1e,_0xea761f){_0xea761f=_0xea761f||0x1f4;return function(_0x38e027){logger['error'](_0x38e027[_0x044b('0x27')]);if(_0x38e027[_0x044b('0x28')]){delete _0x38e027[_0x044b('0x28')];}_0x596a1e[_0x044b('0x19')](_0xea761f)[_0x044b('0x29')](_0x38e027);};}exports[_0x044b('0x2a')]=function(_0x3afb23,_0x3d29fe){var _0x420bc2={},_0x1a1f0e={},_0x5d8f0b={'count':0x0,'rows':[]};var _0x2c8091=_[_0x044b('0x2b')](db[_0x044b('0x2c')]['rawAttributes'],function(_0x2d20a5){return{'name':_0x2d20a5[_0x044b('0x2d')],'type':_0x2d20a5[_0x044b('0x2e')][_0x044b('0x2f')]};});_0x1a1f0e[_0x044b('0x30')]=_[_0x044b('0x2b')](_0x2c8091,'name');_0x1a1f0e[_0x044b('0x31')]=_['keys'](_0x3afb23[_0x044b('0x31')]);_0x1a1f0e[_0x044b('0x32')]=_[_0x044b('0x33')](_0x1a1f0e['model'],_0x1a1f0e['query']);_0x420bc2['attributes']=_[_0x044b('0x33')](_0x1a1f0e['model'],qs[_0x044b('0x34')](_0x3afb23['query'][_0x044b('0x34')]));_0x420bc2['attributes']=_0x420bc2[_0x044b('0x35')][_0x044b('0x36')]?_0x420bc2[_0x044b('0x35')]:_0x1a1f0e[_0x044b('0x30')];if(!_0x3afb23['query'][_0x044b('0x37')](_0x044b('0x38'))){_0x420bc2['limit']=qs[_0x044b('0x1e')](_0x3afb23[_0x044b('0x31')][_0x044b('0x1e')]);_0x420bc2[_0x044b('0x1c')]=qs[_0x044b('0x1c')](_0x3afb23[_0x044b('0x31')][_0x044b('0x1c')]);}_0x420bc2[_0x044b('0x39')]=qs[_0x044b('0x3a')](_0x3afb23[_0x044b('0x31')][_0x044b('0x3a')]);_0x420bc2[_0x044b('0x3b')]=qs[_0x044b('0x32')](_['pick'](_0x3afb23[_0x044b('0x31')],_0x1a1f0e[_0x044b('0x32')]),_0x2c8091);if(_0x3afb23[_0x044b('0x31')][_0x044b('0x3c')]){_0x420bc2[_0x044b('0x3b')]=_[_0x044b('0x3d')](_0x420bc2[_0x044b('0x3b')],{'$or':_[_0x044b('0x2b')](_0x2c8091,function(_0x37b63f){if(_0x37b63f[_0x044b('0x2e')]!=='VIRTUAL'){var _0x40e43c={};_0x40e43c[_0x37b63f['name']]={'$like':'%'+_0x3afb23[_0x044b('0x31')]['filter']+'%'};return _0x40e43c;}})});}_0x420bc2=_[_0x044b('0x3d')]({},_0x420bc2,_0x3afb23[_0x044b('0x3e')]);var _0x65d74={'where':_0x420bc2['where']};return db[_0x044b('0x2c')][_0x044b('0x1f')](_0x65d74)[_0x044b('0x26')](function(_0x56f6da){_0x5d8f0b[_0x044b('0x1f')]=_0x56f6da;if(_0x3afb23[_0x044b('0x31')][_0x044b('0x3f')]){_0x420bc2[_0x044b('0x40')]=[{'all':!![]}];}return db[_0x044b('0x2c')][_0x044b('0x41')](_0x420bc2);})[_0x044b('0x26')](function(_0x143f5e){_0x5d8f0b[_0x044b('0x42')]=_0x143f5e;return _0x5d8f0b;})[_0x044b('0x26')](respondWithFilteredResult(_0x3d29fe,_0x420bc2))[_0x044b('0x43')](handleError(_0x3d29fe,null));};exports['show']=function(_0x46a0b7,_0x35c36d){var _0x86d7d9={'raw':!![],'where':{'id':_0x46a0b7['params']['id']}},_0x4e0979={};_0x4e0979['model']=_[_0x044b('0x44')](db[_0x044b('0x2c')][_0x044b('0x45')]);_0x4e0979[_0x044b('0x31')]=_[_0x044b('0x44')](_0x46a0b7[_0x044b('0x31')]);_0x4e0979[_0x044b('0x32')]=_[_0x044b('0x33')](_0x4e0979[_0x044b('0x30')],_0x4e0979[_0x044b('0x31')]);_0x86d7d9[_0x044b('0x35')]=_[_0x044b('0x33')](_0x4e0979[_0x044b('0x30')],qs[_0x044b('0x34')](_0x46a0b7['query'][_0x044b('0x34')]));_0x86d7d9[_0x044b('0x35')]=_0x86d7d9['attributes']['length']?_0x86d7d9['attributes']:_0x4e0979[_0x044b('0x30')];if(_0x46a0b7[_0x044b('0x31')][_0x044b('0x3f')]){_0x86d7d9[_0x044b('0x40')]=[{'all':!![]}];}_0x86d7d9=_[_0x044b('0x3d')]({},_0x86d7d9,_0x46a0b7['options']);return db['SquareRecording']['find'](_0x86d7d9)[_0x044b('0x26')](handleEntityNotFound(_0x35c36d,null))['then'](respondWithResult(_0x35c36d,null))[_0x044b('0x43')](handleError(_0x35c36d,null));};exports[_0x044b('0x46')]=function(_0x5d6d4a,_0x2fbf30){return db[_0x044b('0x2c')][_0x044b('0x46')](_0x5d6d4a['body'],{})[_0x044b('0x26')](respondWithResult(_0x2fbf30,0xc9))['catch'](handleError(_0x2fbf30,null));};exports['update']=function(_0x20acc0,_0x35c8cf){if(_0x20acc0[_0x044b('0x47')]['id']){delete _0x20acc0[_0x044b('0x47')]['id'];}return db[_0x044b('0x2c')]['find']({'where':{'id':_0x20acc0[_0x044b('0x48')]['id']}})[_0x044b('0x26')](handleEntityNotFound(_0x35c8cf,null))['then'](saveUpdates(_0x20acc0[_0x044b('0x47')],null))[_0x044b('0x26')](respondWithResult(_0x35c8cf,null))[_0x044b('0x43')](handleError(_0x35c8cf,null));};exports[_0x044b('0x49')]=function(_0x3e176c,_0x41d70e,_0x4a2564){var _0x190c4f=require(_0x044b('0x4a'));var _0x5bda13=![];var _0x4f3e3c={};if(_0x3e176c[_0x044b('0x31')][_0x044b('0x2e')]&&_0x3e176c[_0x044b('0x31')]['type']===_0x044b('0x4b')){_0x4f3e3c[_0x044b('0x4b')]=_0x3e176c[_0x044b('0x48')]['id'];}else{_0x4f3e3c['id']=_0x3e176c[_0x044b('0x48')]['id'];}return db[_0x044b('0x2c')][_0x044b('0x4c')]({'where':_0x4f3e3c,'attributes':['id',_0x044b('0x4d'),_0x044b('0x4e')],'raw':!![]})['then'](handleEntityNotFound(_0x41d70e,null))[_0x044b('0x26')](function(_0x4446cc){if(_0x4446cc){var _0x1b5b18=_0x4446cc[_0x044b('0x4d')];var _0x1ff925=util[_0x044b('0x4f')](_0x044b('0x50'),_0x1b5b18);if(fs['existsSync'](_0x1ff925)){_0x5bda13=!![];return _0x190c4f[_0x044b('0x51')](_0x1ff925,_0x1b5b18,config[_0x044b('0x52')][_0x044b('0x53')])[_0x044b('0x26')](function(){return _0x4446cc;});}return _0x4446cc;}})[_0x044b('0x26')](function(_0x2c6458){if(_0x2c6458){var _0x1a1bc0=_0x2c6458[_0x044b('0x4d')];if(!fs[_0x044b('0x54')](_0x1a1bc0)){throw new db[(_0x044b('0x55'))]['ValidationError'](_0x044b('0x56'));}if(_0x2c6458[_0x044b('0x4e')]){return _0x41d70e[_0x044b('0x49')](_0x1a1bc0,_0x2c6458[_0x044b('0x4e')]+path['extname'](_0x1a1bc0),function(){if(_0x5bda13){fs[_0x044b('0x57')](_0x1a1bc0);}});}else{return _0x41d70e[_0x044b('0x49')](_0x1a1bc0,function(_0x37fc7){if(_0x5bda13){fs[_0x044b('0x57')](_0x1a1bc0);}});}}})[_0x044b('0x43')](function(_0x52a2f2){if(_0x52a2f2[_0x044b('0x58')]==='SquareRecording\x20not\x20found'){_0x41d70e[_0x044b('0x19')](0x194)[_0x044b('0x29')](_0x044b('0x59'));}else{return handleError(_0x41d70e,null);}});};exports[_0x044b('0x25')]=function(_0x847469,_0xa3481b){return db[_0x044b('0x2c')][_0x044b('0x4c')]({'where':{'id':_0x847469[_0x044b('0x48')]['id']}})[_0x044b('0x26')](function(_0x42bf7c){if(_['isNil'](_0x42bf7c)){throw new ReferenceError(_0x044b('0x5a'));}return _0x42bf7c;})[_0x044b('0x26')](function(_0x51c13d){var _0x44c91e=_0x51c13d['savePath'];logger[_0x044b('0x5b')](_0x044b('0x5c'),_0x44c91e);if(!_[_0x044b('0x5d')](_0x51c13d['savePath'])&&fs['existsSync'](_0x44c91e)){logger[_0x044b('0x5b')](_0x044b('0x5e')+_0x44c91e+_0x044b('0x5f'));fs[_0x044b('0x60')](_0x44c91e);}_0x44c91e=_0x44c91e+'.cypher';if(!_['isNil'](_0x51c13d['savePath'])&&fs['existsSync'](_0x44c91e)){logger[_0x044b('0x5b')](_0x044b('0x5e')+_0x44c91e+_0x044b('0x5f'));fs[_0x044b('0x60')](_0x44c91e);}return _0x51c13d;})[_0x044b('0x26')](function(_0x3f0680){if(!_0x3f0680)throw new InternalError();return _0x3f0680[_0x044b('0x25')]();})[_0x044b('0x26')](function(){_0xa3481b[_0x044b('0x19')](0xcc)[_0x044b('0x1a')]();})[_0x044b('0x43')](handleError(_0xa3481b,null));}; \ No newline at end of file +var _0x9b08=['type','key','model','map','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','catch','show','keys','options','find','create','body','params','download','../../components/encryptor','uniqueid','filename','savePath','format','%s.cypher','existsSync','decryptFile','secrets','recording','ValidationError','SquareRecording\x20not\x20found','extname','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','end','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','SquareRecording','rawAttributes','fieldName'];(function(_0x1e92f5,_0x25d782){var _0x1afa8a=function(_0x12b53b){while(--_0x12b53b){_0x1e92f5['push'](_0x1e92f5['shift']());}};_0x1afa8a(++_0x25d782);}(_0x9b08,0x1c5));var _0x89b0=function(_0x31bab3,_0x44554f){_0x31bab3=_0x31bab3-0x0;var _0x4fd382=_0x9b08[_0x31bab3];return _0x4fd382;};'use strict';var emlformat=require(_0x89b0('0x0'));var rimraf=require(_0x89b0('0x1'));var zipdir=require(_0x89b0('0x2'));var jsonpatch=require(_0x89b0('0x3'));var rp=require(_0x89b0('0x4'));var moment=require('moment');var BPromise=require(_0x89b0('0x5'));var Mustache=require(_0x89b0('0x6'));var util=require(_0x89b0('0x7'));var path=require(_0x89b0('0x8'));var sox=require(_0x89b0('0x9'));var csv=require(_0x89b0('0xa'));var ejs=require(_0x89b0('0xb'));var fs=require('fs');var fs_extra=require(_0x89b0('0xc'));var _=require(_0x89b0('0xd'));var squel=require(_0x89b0('0xe'));var crypto=require(_0x89b0('0xf'));var jsforce=require(_0x89b0('0x10'));var deskjs=require(_0x89b0('0x11'));var toCsv=require(_0x89b0('0xa'));var querystring=require(_0x89b0('0x12'));var Papa=require(_0x89b0('0x13'));var Redis=require(_0x89b0('0x14'));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')(_0x89b0('0x15'));var utils=require(_0x89b0('0x16'));var config=require(_0x89b0('0x17'));var licenseUtil=require(_0x89b0('0x18'));var db=require(_0x89b0('0x19'))['db'];function respondWithStatusCode(_0x5da10e,_0x360bba){_0x360bba=_0x360bba||0xcc;return function(_0x12940a){if(_0x12940a){return _0x5da10e[_0x89b0('0x1a')](_0x360bba);}return _0x5da10e[_0x89b0('0x1b')](_0x360bba)['end']();};}function respondWithResult(_0x3d35b7,_0xdc07db){_0xdc07db=_0xdc07db||0xc8;return function(_0x134436){if(_0x134436){return _0x3d35b7['status'](_0xdc07db)[_0x89b0('0x1c')](_0x134436);}};}function respondWithFilteredResult(_0x396c5f,_0x4d86fe){return function(_0x556e43){if(_0x556e43){var _0x9fb10f=typeof _0x4d86fe[_0x89b0('0x1d')]===_0x89b0('0x1e')&&typeof _0x4d86fe[_0x89b0('0x1f')]==='undefined';var _0x446d37=_0x556e43[_0x89b0('0x20')];var _0x3c159a=_0x9fb10f?0x0:_0x4d86fe[_0x89b0('0x1d')];var _0x58e404=_0x9fb10f?_0x556e43[_0x89b0('0x20')]:_0x4d86fe[_0x89b0('0x1d')]+_0x4d86fe['limit'];var _0x47c79e;if(_0x58e404>=_0x446d37){_0x58e404=_0x446d37;_0x47c79e=0xc8;}else{_0x47c79e=0xce;}_0x396c5f['status'](_0x47c79e);return _0x396c5f[_0x89b0('0x21')](_0x89b0('0x22'),_0x3c159a+'-'+_0x58e404+'/'+_0x446d37)['json'](_0x556e43);}return null;};}function patchUpdates(_0x59e29d){return function(_0x41d57d){try{jsonpatch[_0x89b0('0x23')](_0x41d57d,_0x59e29d,!![]);}catch(_0x4113d5){return BPromise['reject'](_0x4113d5);}return _0x41d57d[_0x89b0('0x24')]();};}function saveUpdates(_0x138af3,_0x5458df){return function(_0x49167d){if(_0x49167d){return _0x49167d[_0x89b0('0x25')](_0x138af3)[_0x89b0('0x26')](function(_0x1b6d0e){return _0x1b6d0e;});}return null;};}function removeEntity(_0x311b60,_0x1acf10){return function(_0x548efe){if(_0x548efe){return _0x548efe[_0x89b0('0x27')]()[_0x89b0('0x26')](function(){_0x311b60[_0x89b0('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47de8d,_0x713466){return function(_0x42e4a0){if(!_0x42e4a0){_0x47de8d[_0x89b0('0x1a')](0x194);}return _0x42e4a0;};}function handleError(_0x261b06,_0x1658c8){_0x1658c8=_0x1658c8||0x1f4;return function(_0x452f09){logger[_0x89b0('0x28')](_0x452f09[_0x89b0('0x29')]);if(_0x452f09[_0x89b0('0x2a')]){delete _0x452f09['name'];}_0x261b06[_0x89b0('0x1b')](_0x1658c8)[_0x89b0('0x2b')](_0x452f09);};}exports['index']=function(_0x48b662,_0x3149ec){var _0x2e9204={},_0x3e8d0c={},_0x2463f0={'count':0x0,'rows':[]};var _0x2faeac=_['map'](db[_0x89b0('0x2c')][_0x89b0('0x2d')],function(_0x4e11b6){return{'name':_0x4e11b6[_0x89b0('0x2e')],'type':_0x4e11b6[_0x89b0('0x2f')][_0x89b0('0x30')]};});_0x3e8d0c[_0x89b0('0x31')]=_[_0x89b0('0x32')](_0x2faeac,'name');_0x3e8d0c[_0x89b0('0x33')]=_['keys'](_0x48b662[_0x89b0('0x33')]);_0x3e8d0c[_0x89b0('0x34')]=_['intersection'](_0x3e8d0c[_0x89b0('0x31')],_0x3e8d0c[_0x89b0('0x33')]);_0x2e9204[_0x89b0('0x35')]=_[_0x89b0('0x36')](_0x3e8d0c[_0x89b0('0x31')],qs[_0x89b0('0x37')](_0x48b662[_0x89b0('0x33')][_0x89b0('0x37')]));_0x2e9204['attributes']=_0x2e9204[_0x89b0('0x35')]['length']?_0x2e9204[_0x89b0('0x35')]:_0x3e8d0c['model'];if(!_0x48b662[_0x89b0('0x33')][_0x89b0('0x38')](_0x89b0('0x39'))){_0x2e9204[_0x89b0('0x1f')]=qs[_0x89b0('0x1f')](_0x48b662[_0x89b0('0x33')][_0x89b0('0x1f')]);_0x2e9204[_0x89b0('0x1d')]=qs[_0x89b0('0x1d')](_0x48b662[_0x89b0('0x33')][_0x89b0('0x1d')]);}_0x2e9204[_0x89b0('0x3a')]=qs[_0x89b0('0x3b')](_0x48b662[_0x89b0('0x33')]['sort']);_0x2e9204[_0x89b0('0x3c')]=qs[_0x89b0('0x34')](_[_0x89b0('0x3d')](_0x48b662['query'],_0x3e8d0c[_0x89b0('0x34')]),_0x2faeac);if(_0x48b662[_0x89b0('0x33')][_0x89b0('0x3e')]){_0x2e9204[_0x89b0('0x3c')]=_['merge'](_0x2e9204['where'],{'$or':_[_0x89b0('0x32')](_0x2faeac,function(_0x3d23a4){if(_0x3d23a4[_0x89b0('0x2f')]!=='VIRTUAL'){var _0x42a5f0={};_0x42a5f0[_0x3d23a4['name']]={'$like':'%'+_0x48b662[_0x89b0('0x33')][_0x89b0('0x3e')]+'%'};return _0x42a5f0;}})});}_0x2e9204=_[_0x89b0('0x3f')]({},_0x2e9204,_0x48b662['options']);var _0x4c58c5={'where':_0x2e9204['where']};return db['SquareRecording'][_0x89b0('0x20')](_0x4c58c5)['then'](function(_0x2f2031){_0x2463f0[_0x89b0('0x20')]=_0x2f2031;if(_0x48b662[_0x89b0('0x33')][_0x89b0('0x40')]){_0x2e9204[_0x89b0('0x41')]=[{'all':!![]}];}return db[_0x89b0('0x2c')][_0x89b0('0x42')](_0x2e9204);})['then'](function(_0x4df5a8){_0x2463f0['rows']=_0x4df5a8;return _0x2463f0;})['then'](respondWithFilteredResult(_0x3149ec,_0x2e9204))[_0x89b0('0x43')](handleError(_0x3149ec,null));};exports[_0x89b0('0x44')]=function(_0x258653,_0x4d81dc){var _0x3c2b69={'raw':!![],'where':{'id':_0x258653['params']['id']}},_0x1d4f65={};_0x1d4f65[_0x89b0('0x31')]=_[_0x89b0('0x45')](db[_0x89b0('0x2c')]['rawAttributes']);_0x1d4f65['query']=_[_0x89b0('0x45')](_0x258653[_0x89b0('0x33')]);_0x1d4f65[_0x89b0('0x34')]=_[_0x89b0('0x36')](_0x1d4f65[_0x89b0('0x31')],_0x1d4f65[_0x89b0('0x33')]);_0x3c2b69['attributes']=_['intersection'](_0x1d4f65[_0x89b0('0x31')],qs[_0x89b0('0x37')](_0x258653['query']['fields']));_0x3c2b69['attributes']=_0x3c2b69[_0x89b0('0x35')]['length']?_0x3c2b69[_0x89b0('0x35')]:_0x1d4f65[_0x89b0('0x31')];if(_0x258653['query'][_0x89b0('0x40')]){_0x3c2b69['include']=[{'all':!![]}];}_0x3c2b69=_[_0x89b0('0x3f')]({},_0x3c2b69,_0x258653[_0x89b0('0x46')]);return db['SquareRecording'][_0x89b0('0x47')](_0x3c2b69)[_0x89b0('0x26')](handleEntityNotFound(_0x4d81dc,null))[_0x89b0('0x26')](respondWithResult(_0x4d81dc,null))[_0x89b0('0x43')](handleError(_0x4d81dc,null));};exports[_0x89b0('0x48')]=function(_0x42a61,_0x43b638){return db[_0x89b0('0x2c')][_0x89b0('0x48')](_0x42a61[_0x89b0('0x49')],{})[_0x89b0('0x26')](respondWithResult(_0x43b638,0xc9))[_0x89b0('0x43')](handleError(_0x43b638,null));};exports[_0x89b0('0x25')]=function(_0x43b645,_0x448bc2){if(_0x43b645[_0x89b0('0x49')]['id']){delete _0x43b645[_0x89b0('0x49')]['id'];}return db[_0x89b0('0x2c')][_0x89b0('0x47')]({'where':{'id':_0x43b645[_0x89b0('0x4a')]['id']}})[_0x89b0('0x26')](handleEntityNotFound(_0x448bc2,null))['then'](saveUpdates(_0x43b645[_0x89b0('0x49')],null))['then'](respondWithResult(_0x448bc2,null))['catch'](handleError(_0x448bc2,null));};exports[_0x89b0('0x4b')]=function(_0x1beb40,_0x2faebf,_0x44083d){var _0x2df545=require(_0x89b0('0x4c'));var _0x2c769e=![];var _0x2e8130={};if(_0x1beb40[_0x89b0('0x33')][_0x89b0('0x2f')]&&_0x1beb40['query'][_0x89b0('0x2f')]==='uniqueid'){_0x2e8130[_0x89b0('0x4d')]=_0x1beb40[_0x89b0('0x4a')]['id'];}else{_0x2e8130['id']=_0x1beb40[_0x89b0('0x4a')]['id'];}return db[_0x89b0('0x2c')]['find']({'where':_0x2e8130,'attributes':['id','savePath',_0x89b0('0x4e')],'raw':!![]})[_0x89b0('0x26')](handleEntityNotFound(_0x2faebf,null))[_0x89b0('0x26')](function(_0x34f94c){if(_0x34f94c){var _0x389116=_0x34f94c[_0x89b0('0x4f')];var _0xbe89c4=util[_0x89b0('0x50')](_0x89b0('0x51'),_0x389116);if(fs[_0x89b0('0x52')](_0xbe89c4)){_0x2c769e=!![];return _0x2df545[_0x89b0('0x53')](_0xbe89c4,_0x389116,config[_0x89b0('0x54')][_0x89b0('0x55')])[_0x89b0('0x26')](function(){return _0x34f94c;});}return _0x34f94c;}})[_0x89b0('0x26')](function(_0xc8aa3){if(_0xc8aa3){var _0x17cc1e=_0xc8aa3['savePath'];if(!fs[_0x89b0('0x52')](_0x17cc1e)){throw new db['Sequelize'][(_0x89b0('0x56'))](_0x89b0('0x57'));}if(_0xc8aa3[_0x89b0('0x4e')]){return _0x2faebf['download'](_0x17cc1e,_0xc8aa3[_0x89b0('0x4e')]+path[_0x89b0('0x58')](_0x17cc1e),function(){if(_0x2c769e){fs['unlink'](_0x17cc1e);}});}else{return _0x2faebf['download'](_0x17cc1e,function(_0x3379ac){if(_0x2c769e){fs['unlink'](_0x17cc1e);}});}}})['catch'](function(_0x2af73e){if(_0x2af73e[_0x89b0('0x59')]===_0x89b0('0x57')){_0x2faebf[_0x89b0('0x1b')](0x194)[_0x89b0('0x2b')](_0x89b0('0x5a'));}else{return handleError(_0x2faebf,null);}});};exports[_0x89b0('0x27')]=function(_0x45ae00,_0x30b67b){return db[_0x89b0('0x2c')]['find']({'where':{'id':_0x45ae00[_0x89b0('0x4a')]['id']}})[_0x89b0('0x26')](function(_0x169df1){if(_[_0x89b0('0x5b')](_0x169df1)){throw new ReferenceError(_0x89b0('0x5c'));}return _0x169df1;})[_0x89b0('0x26')](function(_0x3eccfa){var _0x459ce0=_0x3eccfa[_0x89b0('0x4f')];logger[_0x89b0('0x5d')](_0x89b0('0x5e'),_0x459ce0);if(!_[_0x89b0('0x5b')](_0x3eccfa['savePath'])&&fs['existsSync'](_0x459ce0)){logger['info'](_0x89b0('0x5f')+_0x459ce0+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x89b0('0x60')](_0x459ce0);}_0x459ce0=_0x459ce0+_0x89b0('0x61');if(!_['isNil'](_0x3eccfa[_0x89b0('0x4f')])&&fs[_0x89b0('0x52')](_0x459ce0)){logger[_0x89b0('0x5d')]('File:\x20\x22'+_0x459ce0+_0x89b0('0x62'));fs[_0x89b0('0x60')](_0x459ce0);}return _0x3eccfa;})[_0x89b0('0x26')](function(_0x1789c2){if(!_0x1789c2)throw new InternalError();return _0x1789c2[_0x89b0('0x27')]();})[_0x89b0('0x26')](function(){_0x30b67b[_0x89b0('0x1b')](0xcc)[_0x89b0('0x63')]();})['catch'](handleError(_0x30b67b,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 74f7753..6d8ed6c 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 _0xcb04=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SquareRecording','square_recordings'];(function(_0x52fe71,_0x496a16){var _0xfa726c=function(_0x590704){while(--_0x590704){_0x52fe71['push'](_0x52fe71['shift']());}};_0xfa726c(++_0x496a16);}(_0xcb04,0x9a));var _0x4cb0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xcb04[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x4cb0('0x0'));var util=require(_0x4cb0('0x1'));var logger=require(_0x4cb0('0x2'))(_0x4cb0('0x3'));var moment=require(_0x4cb0('0x4'));var BPromise=require(_0x4cb0('0x5'));var rp=require(_0x4cb0('0x6'));var fs=require('fs');var path=require(_0x4cb0('0x7'));var rimraf=require(_0x4cb0('0x8'));var config=require(_0x4cb0('0x9'));var attributes=require('./squareRecording.attributes');module[_0x4cb0('0xa')]=function(_0x2fb566,_0x247e05){return _0x2fb566[_0x4cb0('0xb')](_0x4cb0('0xc'),attributes,{'tableName':_0x4cb0('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5458=['../../config/environment','exports','define','square_recordings','lodash','util','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x1bc64d,_0x41c6c5){var _0x546913=function(_0x201d14){while(--_0x201d14){_0x1bc64d['push'](_0x1bc64d['shift']());}};_0x546913(++_0x41c6c5);}(_0x5458,0x1c7));var _0x8545=function(_0x2405b6,_0x5be88c){_0x2405b6=_0x2405b6-0x0;var _0x5eaa81=_0x5458[_0x2405b6];return _0x5eaa81;};'use strict';var _=require(_0x8545('0x0'));var util=require(_0x8545('0x1'));var logger=require(_0x8545('0x2'))('api');var moment=require(_0x8545('0x3'));var BPromise=require(_0x8545('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8545('0x5'));var rimraf=require(_0x8545('0x6'));var config=require(_0x8545('0x7'));var attributes=require('./squareRecording.attributes');module[_0x8545('0x8')]=function(_0x2bd13a,_0x10792f){return _0x2bd13a[_0x8545('0x9')]('SquareRecording',attributes,{'tableName':_0x8545('0xa'),'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 511e179..19496a4 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 _0x3237=['error','code','SquareRecording,\x20%s,\x20%s','message','info','catch','CreateSquareRecording','create','body','options','raw','then','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','request\x20sent','SquareRecording,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5d5544,_0x833fd5){var _0x52dd10=function(_0x49eac8){while(--_0x49eac8){_0x5d5544['push'](_0x5d5544['shift']());}};_0x52dd10(++_0x833fd5);}(_0x3237,0x1d8));var _0x7323=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x3237[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7323('0x0'));var util=require(_0x7323('0x1'));var moment=require('moment');var BPromise=require(_0x7323('0x2'));var rs=require(_0x7323('0x3'));var fs=require('fs');var Redis=require(_0x7323('0x4'));var db=require(_0x7323('0x5'))['db'];var utils=require(_0x7323('0x6'));var logger=require(_0x7323('0x7'))(_0x7323('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7323('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d90ee,_0x2bc227,_0x1ac30f){return new BPromise(function(_0x53f22c,_0x30ba3d){return client[_0x7323('0xa')](_0x3d90ee,_0x1ac30f)['then'](function(_0x12dc81){logger['info']('SquareRecording,\x20%s,\x20%s',_0x2bc227,_0x7323('0xb'));logger['debug'](_0x7323('0xc'),_0x2bc227,_0x7323('0xb'),JSON[_0x7323('0xd')](_0x12dc81));if(_0x12dc81[_0x7323('0xe')]){if(_0x12dc81[_0x7323('0xe')][_0x7323('0xf')]===0x1f4){logger[_0x7323('0xe')](_0x7323('0x10'),_0x2bc227,_0x12dc81[_0x7323('0xe')][_0x7323('0x11')]);return _0x30ba3d(_0x12dc81[_0x7323('0xe')][_0x7323('0x11')]);}logger[_0x7323('0xe')](_0x7323('0x10'),_0x2bc227,_0x12dc81[_0x7323('0xe')][_0x7323('0x11')]);return _0x53f22c(_0x12dc81[_0x7323('0xe')][_0x7323('0x11')]);}else{logger[_0x7323('0x12')](_0x7323('0x10'),_0x2bc227,'request\x20sent');_0x53f22c(_0x12dc81['result'][_0x7323('0x11')]);}})[_0x7323('0x13')](function(_0x58992a){logger[_0x7323('0xe')](_0x7323('0x10'),_0x2bc227,_0x58992a);_0x30ba3d(_0x58992a);});});}exports[_0x7323('0x14')]=function(_0x4d593a){var _0x586d7e=this;return new Promise(function(_0x298872,_0x40d2db){return db['SquareRecording'][_0x7323('0x15')](_0x4d593a[_0x7323('0x16')],{'raw':_0x4d593a[_0x7323('0x17')]?_0x4d593a[_0x7323('0x17')][_0x7323('0x18')]===undefined?!![]:![]:!![]})[_0x7323('0x19')](function(_0x62fbf3){logger['info']('CreateSquareRecording',_0x4d593a);logger[_0x7323('0x1a')](_0x7323('0x14'),_0x4d593a,JSON[_0x7323('0xd')](_0x62fbf3));_0x298872(_0x62fbf3);})['catch'](function(_0x8dc197){logger[_0x7323('0xe')](_0x7323('0x14'),_0x8dc197[_0x7323('0x11')],_0x4d593a);_0x40d2db(_0x586d7e[_0x7323('0xe')](0x1f4,_0x8dc197[_0x7323('0x11')]));});});}; \ No newline at end of file +var _0xd714=['catch','CreateSquareRecording','SquareRecording','create','body','options','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x3a9c7d,_0x162e95){var _0x246333=function(_0x33d2c5){while(--_0x33d2c5){_0x3a9c7d['push'](_0x3a9c7d['shift']());}};_0x246333(++_0x162e95);}(_0xd714,0x66));var _0x4d71=function(_0x27bcf5,_0x236765){_0x27bcf5=_0x27bcf5-0x0;var _0x4ce4cf=_0xd714[_0x27bcf5];return _0x4ce4cf;};'use strict';var _=require(_0x4d71('0x0'));var util=require(_0x4d71('0x1'));var moment=require(_0x4d71('0x2'));var BPromise=require(_0x4d71('0x3'));var rs=require(_0x4d71('0x4'));var fs=require('fs');var Redis=require(_0x4d71('0x5'));var db=require(_0x4d71('0x6'))['db'];var utils=require(_0x4d71('0x7'));var logger=require(_0x4d71('0x8'))(_0x4d71('0x9'));var config=require(_0x4d71('0xa'));var jayson=require(_0x4d71('0xb'));var client=jayson[_0x4d71('0xc')][_0x4d71('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5789d1,_0x218d49,_0x21156e){return new BPromise(function(_0x3203ac,_0x334e21){return client[_0x4d71('0xe')](_0x5789d1,_0x21156e)[_0x4d71('0xf')](function(_0x17ec22){logger[_0x4d71('0x10')](_0x4d71('0x11'),_0x218d49,_0x4d71('0x12'));logger[_0x4d71('0x13')](_0x4d71('0x14'),_0x218d49,'request\x20sent',JSON[_0x4d71('0x15')](_0x17ec22));if(_0x17ec22[_0x4d71('0x16')]){if(_0x17ec22[_0x4d71('0x16')][_0x4d71('0x17')]===0x1f4){logger[_0x4d71('0x16')]('SquareRecording,\x20%s,\x20%s',_0x218d49,_0x17ec22[_0x4d71('0x16')]['message']);return _0x334e21(_0x17ec22[_0x4d71('0x16')]['message']);}logger[_0x4d71('0x16')](_0x4d71('0x11'),_0x218d49,_0x17ec22[_0x4d71('0x16')][_0x4d71('0x18')]);return _0x3203ac(_0x17ec22['error']['message']);}else{logger[_0x4d71('0x10')](_0x4d71('0x11'),_0x218d49,'request\x20sent');_0x3203ac(_0x17ec22[_0x4d71('0x19')]['message']);}})[_0x4d71('0x1a')](function(_0x4d26ff){logger[_0x4d71('0x16')](_0x4d71('0x11'),_0x218d49,_0x4d26ff);_0x334e21(_0x4d26ff);});});}exports[_0x4d71('0x1b')]=function(_0x489180){var _0x832741=this;return new Promise(function(_0x1b7ec7,_0x59d6a5){return db[_0x4d71('0x1c')][_0x4d71('0x1d')](_0x489180[_0x4d71('0x1e')],{'raw':_0x489180[_0x4d71('0x1f')]?_0x489180[_0x4d71('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0x4d71('0xf')](function(_0xd506e){logger[_0x4d71('0x10')](_0x4d71('0x1b'),_0x489180);logger['debug'](_0x4d71('0x1b'),_0x489180,JSON[_0x4d71('0x15')](_0xd506e));_0x1b7ec7(_0xd506e);})[_0x4d71('0x1a')](function(_0x1b0ea6){logger[_0x4d71('0x16')]('CreateSquareRecording',_0x1b0ea6[_0x4d71('0x18')],_0x489180);_0x59d6a5(_0x832741[_0x4d71('0x16')](0x1f4,_0x1b0ea6[_0x4d71('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 7de152d..753aefc 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(_0x4cfaf5,_0x2cd513){var _0x2bbc2f=function(_0x128003){while(--_0x128003){_0x4cfaf5['push'](_0x4cfaf5['shift']());}};_0x2bbc2f(++_0x2cd513);}(_0xe706,0xa3));var _0x6e70=function(_0x33bf01,_0x1898f9){_0x33bf01=_0x33bf01-0x0;var _0x1d1cd2=_0xe706[_0x33bf01];return _0x1d1cd2;};'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(_0x14be84,_0x4cd101){var _0x4a5fa4=function(_0x4ee004){while(--_0x4ee004){_0x14be84['push'](_0x14be84['shift']());}};_0x4a5fa4(++_0x4cd101);}(_0xbaf0,0x12a));var _0x0baf=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xbaf0[_0x4cf98e];return _0x1623ac;};'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 fa626c8..d59b00c 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 _0x3f56=['sequelize','exports','STRING','DATE','BOOLEAN'];(function(_0x413bb9,_0x4d9464){var _0x3a4b7a=function(_0xb846e0){while(--_0xb846e0){_0x413bb9['push'](_0x413bb9['shift']());}};_0x3a4b7a(++_0x4d9464);}(_0x3f56,0x122));var _0x63f5=function(_0x5c195b,_0x350efc){_0x5c195b=_0x5c195b-0x0;var _0x44307c=_0x3f56[_0x5c195b];return _0x44307c;};'use strict';var Sequelize=require(_0x63f5('0x0'));module[_0x63f5('0x1')]={'network':{'type':Sequelize[_0x63f5('0x2')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x63f5('0x2')]},'channel':{'type':Sequelize[_0x63f5('0x2')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x63f5('0x2')]},'uniqueid':{'type':Sequelize[_0x63f5('0x2')]},'version':{'type':Sequelize[_0x63f5('0x2')]},'callerid':{'type':Sequelize[_0x63f5('0x2')]},'calleridname':{'type':Sequelize[_0x63f5('0x2')]},'callingpres':{'type':Sequelize[_0x63f5('0x2')]},'callingani2':{'type':Sequelize[_0x63f5('0x2')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0x63f5('0x2')]},'dnid':{'type':Sequelize[_0x63f5('0x2')]},'rdnis':{'type':Sequelize[_0x63f5('0x2')]},'context':{'type':Sequelize[_0x63f5('0x2')]},'extension':{'type':Sequelize[_0x63f5('0x2')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x63f5('0x2')]},'accountcode':{'type':Sequelize[_0x63f5('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0x63f5('0x2')]},'joinAt':{'type':Sequelize[_0x63f5('0x3')]},'leaveAt':{'type':Sequelize[_0x63f5('0x3')]},'bot':{'type':Sequelize[_0x63f5('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x80cd=['DATE','BOOLEAN','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x80cd,0x146));var _0xd80c=function(_0x2ef8c1,_0x2f72f4){_0x2ef8c1=_0x2ef8c1-0x0;var _0x288305=_0x80cd[_0x2ef8c1];return _0x288305;};'use strict';var Sequelize=require('sequelize');module[_0xd80c('0x0')]={'network':{'type':Sequelize[_0xd80c('0x1')]},'network_script':{'type':Sequelize[_0xd80c('0x1')]},'request':{'type':Sequelize[_0xd80c('0x1')]},'channel':{'type':Sequelize[_0xd80c('0x1')]},'language':{'type':Sequelize[_0xd80c('0x1')]},'type':{'type':Sequelize[_0xd80c('0x1')]},'uniqueid':{'type':Sequelize[_0xd80c('0x1')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xd80c('0x1')]},'calleridname':{'type':Sequelize[_0xd80c('0x1')]},'callingpres':{'type':Sequelize[_0xd80c('0x1')]},'callingani2':{'type':Sequelize[_0xd80c('0x1')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0xd80c('0x1')]},'dnid':{'type':Sequelize[_0xd80c('0x1')]},'rdnis':{'type':Sequelize[_0xd80c('0x1')]},'context':{'type':Sequelize[_0xd80c('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xd80c('0x1')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0xd80c('0x1')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xd80c('0x2')]},'leaveAt':{'type':Sequelize[_0xd80c('0x2')]},'bot':{'type':Sequelize[_0xd80c('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index cb1d558..36b2f5c 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 _0xf7fa=['where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','update','then','destroy','name','send','index','map','SquareReport','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter'];(function(_0x267268,_0x378d3){var _0x45cd05=function(_0x100bcc){while(--_0x100bcc){_0x267268['push'](_0x267268['shift']());}};_0x45cd05(++_0x378d3);}(_0xf7fa,0x196));var _0xaf7f=function(_0x518469,_0x66b9ec){_0x518469=_0x518469-0x0;var _0x1b8f07=_0xf7fa[_0x518469];return _0x1b8f07;};'use strict';var emlformat=require(_0xaf7f('0x0'));var rimraf=require(_0xaf7f('0x1'));var zipdir=require(_0xaf7f('0x2'));var jsonpatch=require(_0xaf7f('0x3'));var rp=require(_0xaf7f('0x4'));var moment=require(_0xaf7f('0x5'));var BPromise=require(_0xaf7f('0x6'));var Mustache=require('mustache');var util=require(_0xaf7f('0x7'));var path=require(_0xaf7f('0x8'));var sox=require(_0xaf7f('0x9'));var csv=require(_0xaf7f('0xa'));var ejs=require(_0xaf7f('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaf7f('0xc'));var squel=require(_0xaf7f('0xd'));var crypto=require(_0xaf7f('0xe'));var jsforce=require(_0xaf7f('0xf'));var deskjs=require(_0xaf7f('0x10'));var toCsv=require('to-csv');var querystring=require(_0xaf7f('0x11'));var Papa=require(_0xaf7f('0x12'));var Redis=require(_0xaf7f('0x13'));var authService=require(_0xaf7f('0x14'));var qs=require(_0xaf7f('0x15'));var as=require(_0xaf7f('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaf7f('0x17'))('api');var utils=require(_0xaf7f('0x18'));var config=require(_0xaf7f('0x19'));var licenseUtil=require(_0xaf7f('0x1a'));var db=require(_0xaf7f('0x1b'))['db'];function respondWithStatusCode(_0xc0e7eb,_0x1196da){_0x1196da=_0x1196da||0xcc;return function(_0x4c1bc1){if(_0x4c1bc1){return _0xc0e7eb[_0xaf7f('0x1c')](_0x1196da);}return _0xc0e7eb[_0xaf7f('0x1d')](_0x1196da)[_0xaf7f('0x1e')]();};}function respondWithResult(_0x82f950,_0x1bba8a){_0x1bba8a=_0x1bba8a||0xc8;return function(_0x5f256d){if(_0x5f256d){return _0x82f950['status'](_0x1bba8a)[_0xaf7f('0x1f')](_0x5f256d);}};}function respondWithFilteredResult(_0x1c5c95,_0x5f3159){return function(_0x183bb6){if(_0x183bb6){var _0x3cc881=typeof _0x5f3159[_0xaf7f('0x20')]===_0xaf7f('0x21')&&typeof _0x5f3159['limit']==='undefined';var _0x36951d=_0x183bb6[_0xaf7f('0x22')];var _0x381378=_0x3cc881?0x0:_0x5f3159[_0xaf7f('0x20')];var _0x3df73a=_0x3cc881?_0x183bb6[_0xaf7f('0x22')]:_0x5f3159[_0xaf7f('0x20')]+_0x5f3159[_0xaf7f('0x23')];var _0x188c70;if(_0x3df73a>=_0x36951d){_0x3df73a=_0x36951d;_0x188c70=0xc8;}else{_0x188c70=0xce;}_0x1c5c95['status'](_0x188c70);return _0x1c5c95[_0xaf7f('0x24')]('Content-Range',_0x381378+'-'+_0x3df73a+'/'+_0x36951d)['json'](_0x183bb6);}return null;};}function patchUpdates(_0x5b7fa9){return function(_0x422f5e){try{jsonpatch[_0xaf7f('0x25')](_0x422f5e,_0x5b7fa9,!![]);}catch(_0x158b3){return BPromise[_0xaf7f('0x26')](_0x158b3);}return _0x422f5e['save']();};}function saveUpdates(_0x5d7ca7,_0x1d314d){return function(_0x22565b){if(_0x22565b){return _0x22565b[_0xaf7f('0x27')](_0x5d7ca7)[_0xaf7f('0x28')](function(_0xee35b5){return _0xee35b5;});}return null;};}function removeEntity(_0x3a2722,_0x154e69){return function(_0x13e464){if(_0x13e464){return _0x13e464[_0xaf7f('0x29')]()['then'](function(){_0x3a2722[_0xaf7f('0x1d')](0xcc)[_0xaf7f('0x1e')]();});}};}function handleEntityNotFound(_0xa6a8d4,_0x459f3f){return function(_0x328905){if(!_0x328905){_0xa6a8d4[_0xaf7f('0x1c')](0x194);}return _0x328905;};}function handleError(_0x279b7e,_0x5dbd8b){_0x5dbd8b=_0x5dbd8b||0x1f4;return function(_0x175cdb){logger['error'](_0x175cdb['stack']);if(_0x175cdb[_0xaf7f('0x2a')]){delete _0x175cdb[_0xaf7f('0x2a')];}_0x279b7e[_0xaf7f('0x1d')](_0x5dbd8b)[_0xaf7f('0x2b')](_0x175cdb);};}exports[_0xaf7f('0x2c')]=function(_0x220a23,_0x1d62ff){var _0x34b82c={},_0x3d0731={},_0xda2a23={'count':0x0,'rows':[]};var _0x525a29=_[_0xaf7f('0x2d')](db[_0xaf7f('0x2e')]['rawAttributes'],function(_0x4d0d20){return{'name':_0x4d0d20['fieldName'],'type':_0x4d0d20[_0xaf7f('0x2f')][_0xaf7f('0x30')]};});_0x3d0731[_0xaf7f('0x31')]=_[_0xaf7f('0x2d')](_0x525a29,'name');_0x3d0731['query']=_[_0xaf7f('0x32')](_0x220a23[_0xaf7f('0x33')]);_0x3d0731[_0xaf7f('0x34')]=_['intersection'](_0x3d0731[_0xaf7f('0x31')],_0x3d0731[_0xaf7f('0x33')]);_0x34b82c['attributes']=_[_0xaf7f('0x35')](_0x3d0731[_0xaf7f('0x31')],qs[_0xaf7f('0x36')](_0x220a23[_0xaf7f('0x33')][_0xaf7f('0x36')]));_0x34b82c[_0xaf7f('0x37')]=_0x34b82c[_0xaf7f('0x37')][_0xaf7f('0x38')]?_0x34b82c[_0xaf7f('0x37')]:_0x3d0731['model'];if(!_0x220a23['query'][_0xaf7f('0x39')]('nolimit')){_0x34b82c['limit']=qs[_0xaf7f('0x23')](_0x220a23[_0xaf7f('0x33')][_0xaf7f('0x23')]);_0x34b82c['offset']=qs['offset'](_0x220a23[_0xaf7f('0x33')][_0xaf7f('0x20')]);}_0x34b82c[_0xaf7f('0x3a')]=qs['sort'](_0x220a23['query'][_0xaf7f('0x3b')]);_0x34b82c['where']=qs['filters'](_[_0xaf7f('0x3c')](_0x220a23[_0xaf7f('0x33')],_0x3d0731[_0xaf7f('0x34')]),_0x525a29);if(_0x220a23[_0xaf7f('0x33')][_0xaf7f('0x3d')]){_0x34b82c[_0xaf7f('0x3e')]=_[_0xaf7f('0x3f')](_0x34b82c['where'],{'$or':_[_0xaf7f('0x2d')](_0x525a29,function(_0x1f0c93){if(_0x1f0c93[_0xaf7f('0x2f')]!==_0xaf7f('0x40')){var _0x353a17={};_0x353a17[_0x1f0c93[_0xaf7f('0x2a')]]={'$like':'%'+_0x220a23[_0xaf7f('0x33')][_0xaf7f('0x3d')]+'%'};return _0x353a17;}})});}_0x34b82c=_[_0xaf7f('0x3f')]({},_0x34b82c,_0x220a23[_0xaf7f('0x41')]);var _0x39d8fa={'where':_0x34b82c[_0xaf7f('0x3e')]};return db['SquareReport'][_0xaf7f('0x22')](_0x39d8fa)[_0xaf7f('0x28')](function(_0x2aa7d7){_0xda2a23[_0xaf7f('0x22')]=_0x2aa7d7;if(_0x220a23['query'][_0xaf7f('0x42')]){_0x34b82c[_0xaf7f('0x43')]=[{'all':!![]}];}return db[_0xaf7f('0x2e')][_0xaf7f('0x44')](_0x34b82c);})[_0xaf7f('0x28')](function(_0x4c476e){_0xda2a23[_0xaf7f('0x45')]=_0x4c476e;return _0xda2a23;})[_0xaf7f('0x28')](respondWithFilteredResult(_0x1d62ff,_0x34b82c))[_0xaf7f('0x46')](handleError(_0x1d62ff,null));};exports[_0xaf7f('0x47')]=function(_0x5af571,_0x2fa6f2){var _0x73ed15={'raw':!![],'where':{'id':_0x5af571[_0xaf7f('0x48')]['id']}},_0x10ad32={};_0x10ad32[_0xaf7f('0x31')]=_['keys'](db['SquareReport'][_0xaf7f('0x49')]);_0x10ad32['query']=_[_0xaf7f('0x32')](_0x5af571[_0xaf7f('0x33')]);_0x10ad32[_0xaf7f('0x34')]=_[_0xaf7f('0x35')](_0x10ad32['model'],_0x10ad32[_0xaf7f('0x33')]);_0x73ed15['attributes']=_[_0xaf7f('0x35')](_0x10ad32[_0xaf7f('0x31')],qs['fields'](_0x5af571[_0xaf7f('0x33')][_0xaf7f('0x36')]));_0x73ed15[_0xaf7f('0x37')]=_0x73ed15['attributes'][_0xaf7f('0x38')]?_0x73ed15['attributes']:_0x10ad32['model'];if(_0x5af571['query'][_0xaf7f('0x42')]){_0x73ed15[_0xaf7f('0x43')]=[{'all':!![]}];}_0x73ed15=_[_0xaf7f('0x3f')]({},_0x73ed15,_0x5af571[_0xaf7f('0x41')]);return db['SquareReport'][_0xaf7f('0x4a')](_0x73ed15)[_0xaf7f('0x28')](handleEntityNotFound(_0x2fa6f2,null))[_0xaf7f('0x28')](respondWithResult(_0x2fa6f2,null))[_0xaf7f('0x46')](handleError(_0x2fa6f2,null));};exports[_0xaf7f('0x4b')]=function(_0xd16f81,_0x5f33d6){return db[_0xaf7f('0x2e')][_0xaf7f('0x4b')](_0xd16f81[_0xaf7f('0x4c')],{})['then'](respondWithResult(_0x5f33d6,0xc9))[_0xaf7f('0x46')](handleError(_0x5f33d6,null));};exports[_0xaf7f('0x27')]=function(_0x13952a,_0x153c4a){if(_0x13952a[_0xaf7f('0x4c')]['id']){delete _0x13952a[_0xaf7f('0x4c')]['id'];}return db[_0xaf7f('0x2e')][_0xaf7f('0x4a')]({'where':{'id':_0x13952a['params']['id']}})[_0xaf7f('0x28')](handleEntityNotFound(_0x153c4a,null))[_0xaf7f('0x28')](saveUpdates(_0x13952a['body'],null))[_0xaf7f('0x28')](respondWithResult(_0x153c4a,null))[_0xaf7f('0x46')](handleError(_0x153c4a,null));};exports[_0xaf7f('0x29')]=function(_0x57fc3d,_0x4d7b3f){return db[_0xaf7f('0x2e')][_0xaf7f('0x4a')]({'where':{'id':_0x57fc3d[_0xaf7f('0x48')]['id']}})[_0xaf7f('0x28')](handleEntityNotFound(_0x4d7b3f,null))[_0xaf7f('0x28')](removeEntity(_0x4d7b3f,null))['catch'](handleError(_0x4d7b3f,null));};exports[_0xaf7f('0x4d')]=function(_0x2b6e7c,_0x9b046b){return db['SquareReport'][_0xaf7f('0x4d')]()[_0xaf7f('0x28')](respondWithResult(_0x9b046b,null))['catch'](handleError(_0x9b046b,null));}; \ No newline at end of file +var _0x5ab8=['ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','sendStatus','stack','name','index','SquareReport','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','rows','catch','show','params','rawAttributes','include','create','update','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x1f5ab3,_0x2d2473){var _0x2bd0d7=function(_0x41c41b){while(--_0x41c41b){_0x1f5ab3['push'](_0x1f5ab3['shift']());}};_0x2bd0d7(++_0x2d2473);}(_0x5ab8,0x1ab));var _0x85ab=function(_0x47a328,_0x1dd386){_0x47a328=_0x47a328-0x0;var _0x183fcd=_0x5ab8[_0x47a328];return _0x183fcd;};'use strict';var emlformat=require(_0x85ab('0x0'));var rimraf=require(_0x85ab('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x85ab('0x2'));var rp=require(_0x85ab('0x3'));var moment=require(_0x85ab('0x4'));var BPromise=require(_0x85ab('0x5'));var Mustache=require(_0x85ab('0x6'));var util=require(_0x85ab('0x7'));var path=require(_0x85ab('0x8'));var sox=require(_0x85ab('0x9'));var csv=require(_0x85ab('0xa'));var ejs=require(_0x85ab('0xb'));var fs=require('fs');var fs_extra=require(_0x85ab('0xc'));var _=require(_0x85ab('0xd'));var squel=require('squel');var crypto=require(_0x85ab('0xe'));var jsforce=require(_0x85ab('0xf'));var deskjs=require(_0x85ab('0x10'));var toCsv=require(_0x85ab('0xa'));var querystring=require(_0x85ab('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x85ab('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x85ab('0x13'))(_0x85ab('0x14'));var utils=require('../../config/utils');var config=require(_0x85ab('0x15'));var licenseUtil=require(_0x85ab('0x16'));var db=require(_0x85ab('0x17'))['db'];function respondWithStatusCode(_0x1b63d2,_0x5c24aa){_0x5c24aa=_0x5c24aa||0xcc;return function(_0x24b63d){if(_0x24b63d){return _0x1b63d2['sendStatus'](_0x5c24aa);}return _0x1b63d2[_0x85ab('0x18')](_0x5c24aa)[_0x85ab('0x19')]();};}function respondWithResult(_0x24eb1a,_0x3a8a3f){_0x3a8a3f=_0x3a8a3f||0xc8;return function(_0x43fb56){if(_0x43fb56){return _0x24eb1a[_0x85ab('0x18')](_0x3a8a3f)[_0x85ab('0x1a')](_0x43fb56);}};}function respondWithFilteredResult(_0x3be38a,_0x1905e2){return function(_0x1ca343){if(_0x1ca343){var _0x1ab343=typeof _0x1905e2['offset']==='undefined'&&typeof _0x1905e2['limit']===_0x85ab('0x1b');var _0xc4bc1a=_0x1ca343[_0x85ab('0x1c')];var _0xf2a2c5=_0x1ab343?0x0:_0x1905e2['offset'];var _0x39436c=_0x1ab343?_0x1ca343[_0x85ab('0x1c')]:_0x1905e2[_0x85ab('0x1d')]+_0x1905e2[_0x85ab('0x1e')];var _0x32c1e9;if(_0x39436c>=_0xc4bc1a){_0x39436c=_0xc4bc1a;_0x32c1e9=0xc8;}else{_0x32c1e9=0xce;}_0x3be38a[_0x85ab('0x18')](_0x32c1e9);return _0x3be38a[_0x85ab('0x1f')](_0x85ab('0x20'),_0xf2a2c5+'-'+_0x39436c+'/'+_0xc4bc1a)[_0x85ab('0x1a')](_0x1ca343);}return null;};}function patchUpdates(_0x52183b){return function(_0xe9ca49){try{jsonpatch[_0x85ab('0x21')](_0xe9ca49,_0x52183b,!![]);}catch(_0x3a8be2){return BPromise[_0x85ab('0x22')](_0x3a8be2);}return _0xe9ca49[_0x85ab('0x23')]();};}function saveUpdates(_0x1704b0,_0x508adc){return function(_0x5c9600){if(_0x5c9600){return _0x5c9600['update'](_0x1704b0)[_0x85ab('0x24')](function(_0x7eb6c3){return _0x7eb6c3;});}return null;};}function removeEntity(_0x44f988,_0x3d9ae4){return function(_0x5955c2){if(_0x5955c2){return _0x5955c2[_0x85ab('0x25')]()[_0x85ab('0x24')](function(){_0x44f988[_0x85ab('0x18')](0xcc)[_0x85ab('0x19')]();});}};}function handleEntityNotFound(_0x5bfd09,_0x200a58){return function(_0x23e044){if(!_0x23e044){_0x5bfd09[_0x85ab('0x26')](0x194);}return _0x23e044;};}function handleError(_0x3a503a,_0x5bcf5b){_0x5bcf5b=_0x5bcf5b||0x1f4;return function(_0x48056d){logger['error'](_0x48056d[_0x85ab('0x27')]);if(_0x48056d[_0x85ab('0x28')]){delete _0x48056d[_0x85ab('0x28')];}_0x3a503a[_0x85ab('0x18')](_0x5bcf5b)['send'](_0x48056d);};}exports[_0x85ab('0x29')]=function(_0x1f8845,_0xff87c){var _0x5d4f4b={},_0x51360d={},_0x34ed29={'count':0x0,'rows':[]};var _0xa8dae1=_['map'](db[_0x85ab('0x2a')]['rawAttributes'],function(_0x90c070){return{'name':_0x90c070[_0x85ab('0x2b')],'type':_0x90c070[_0x85ab('0x2c')]['key']};});_0x51360d[_0x85ab('0x2d')]=_['map'](_0xa8dae1,_0x85ab('0x28'));_0x51360d[_0x85ab('0x2e')]=_[_0x85ab('0x2f')](_0x1f8845[_0x85ab('0x2e')]);_0x51360d[_0x85ab('0x30')]=_['intersection'](_0x51360d['model'],_0x51360d[_0x85ab('0x2e')]);_0x5d4f4b[_0x85ab('0x31')]=_[_0x85ab('0x32')](_0x51360d['model'],qs['fields'](_0x1f8845[_0x85ab('0x2e')][_0x85ab('0x33')]));_0x5d4f4b[_0x85ab('0x31')]=_0x5d4f4b[_0x85ab('0x31')][_0x85ab('0x34')]?_0x5d4f4b[_0x85ab('0x31')]:_0x51360d['model'];if(!_0x1f8845[_0x85ab('0x2e')]['hasOwnProperty']('nolimit')){_0x5d4f4b[_0x85ab('0x1e')]=qs[_0x85ab('0x1e')](_0x1f8845[_0x85ab('0x2e')]['limit']);_0x5d4f4b[_0x85ab('0x1d')]=qs[_0x85ab('0x1d')](_0x1f8845[_0x85ab('0x2e')]['offset']);}_0x5d4f4b[_0x85ab('0x35')]=qs['sort'](_0x1f8845[_0x85ab('0x2e')][_0x85ab('0x36')]);_0x5d4f4b[_0x85ab('0x37')]=qs[_0x85ab('0x30')](_[_0x85ab('0x38')](_0x1f8845[_0x85ab('0x2e')],_0x51360d[_0x85ab('0x30')]),_0xa8dae1);if(_0x1f8845[_0x85ab('0x2e')][_0x85ab('0x39')]){_0x5d4f4b['where']=_['merge'](_0x5d4f4b[_0x85ab('0x37')],{'$or':_['map'](_0xa8dae1,function(_0x512f8e){if(_0x512f8e[_0x85ab('0x2c')]!==_0x85ab('0x3a')){var _0x3ba8c0={};_0x3ba8c0[_0x512f8e[_0x85ab('0x28')]]={'$like':'%'+_0x1f8845[_0x85ab('0x2e')][_0x85ab('0x39')]+'%'};return _0x3ba8c0;}})});}_0x5d4f4b=_[_0x85ab('0x3b')]({},_0x5d4f4b,_0x1f8845[_0x85ab('0x3c')]);var _0x37be34={'where':_0x5d4f4b[_0x85ab('0x37')]};return db[_0x85ab('0x2a')][_0x85ab('0x1c')](_0x37be34)[_0x85ab('0x24')](function(_0xebc470){_0x34ed29[_0x85ab('0x1c')]=_0xebc470;if(_0x1f8845[_0x85ab('0x2e')][_0x85ab('0x3d')]){_0x5d4f4b['include']=[{'all':!![]}];}return db[_0x85ab('0x2a')]['findAll'](_0x5d4f4b);})['then'](function(_0xbcddc7){_0x34ed29[_0x85ab('0x3e')]=_0xbcddc7;return _0x34ed29;})['then'](respondWithFilteredResult(_0xff87c,_0x5d4f4b))[_0x85ab('0x3f')](handleError(_0xff87c,null));};exports[_0x85ab('0x40')]=function(_0x1e18ea,_0x9d0373){var _0x43dca3={'raw':!![],'where':{'id':_0x1e18ea[_0x85ab('0x41')]['id']}},_0x29d6a5={};_0x29d6a5[_0x85ab('0x2d')]=_[_0x85ab('0x2f')](db[_0x85ab('0x2a')][_0x85ab('0x42')]);_0x29d6a5[_0x85ab('0x2e')]=_[_0x85ab('0x2f')](_0x1e18ea[_0x85ab('0x2e')]);_0x29d6a5[_0x85ab('0x30')]=_[_0x85ab('0x32')](_0x29d6a5[_0x85ab('0x2d')],_0x29d6a5['query']);_0x43dca3[_0x85ab('0x31')]=_[_0x85ab('0x32')](_0x29d6a5[_0x85ab('0x2d')],qs[_0x85ab('0x33')](_0x1e18ea[_0x85ab('0x2e')]['fields']));_0x43dca3[_0x85ab('0x31')]=_0x43dca3[_0x85ab('0x31')][_0x85ab('0x34')]?_0x43dca3['attributes']:_0x29d6a5[_0x85ab('0x2d')];if(_0x1e18ea[_0x85ab('0x2e')][_0x85ab('0x3d')]){_0x43dca3[_0x85ab('0x43')]=[{'all':!![]}];}_0x43dca3=_[_0x85ab('0x3b')]({},_0x43dca3,_0x1e18ea['options']);return db[_0x85ab('0x2a')]['find'](_0x43dca3)[_0x85ab('0x24')](handleEntityNotFound(_0x9d0373,null))[_0x85ab('0x24')](respondWithResult(_0x9d0373,null))['catch'](handleError(_0x9d0373,null));};exports[_0x85ab('0x44')]=function(_0x521ad4,_0x3b7424){return db['SquareReport'][_0x85ab('0x44')](_0x521ad4['body'],{})['then'](respondWithResult(_0x3b7424,0xc9))[_0x85ab('0x3f')](handleError(_0x3b7424,null));};exports[_0x85ab('0x45')]=function(_0xa7116e,_0x913fa1){if(_0xa7116e['body']['id']){delete _0xa7116e[_0x85ab('0x46')]['id'];}return db[_0x85ab('0x2a')]['find']({'where':{'id':_0xa7116e[_0x85ab('0x41')]['id']}})[_0x85ab('0x24')](handleEntityNotFound(_0x913fa1,null))[_0x85ab('0x24')](saveUpdates(_0xa7116e['body'],null))[_0x85ab('0x24')](respondWithResult(_0x913fa1,null))[_0x85ab('0x3f')](handleError(_0x913fa1,null));};exports['destroy']=function(_0x3a2663,_0x3a7401){return db['SquareReport'][_0x85ab('0x47')]({'where':{'id':_0x3a2663[_0x85ab('0x41')]['id']}})[_0x85ab('0x24')](handleEntityNotFound(_0x3a7401,null))[_0x85ab('0x24')](removeEntity(_0x3a7401,null))[_0x85ab('0x3f')](handleError(_0x3a7401,null));};exports[_0x85ab('0x48')]=function(_0x15ef52,_0x35b53d){return db[_0x85ab('0x2a')]['describe']()[_0x85ab('0x24')](respondWithResult(_0x35b53d,null))[_0x85ab('0x3f')](handleError(_0x35b53d,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 5aa82b6..5eab496 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 _0x4ee6=['moment','bluebird','request-promise','rimraf','SquareReport','report_square','uid_pname','uniqueid','project_name','leaveAt','util','api'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x4ee6,0xe2));var _0x64ee=function(_0x2b0796,_0x2ec10b){_0x2b0796=_0x2b0796-0x0;var _0x459687=_0x4ee6[_0x2b0796];return _0x459687;};'use strict';var _=require('lodash');var util=require(_0x64ee('0x0'));var logger=require('../../config/logger')(_0x64ee('0x1'));var moment=require(_0x64ee('0x2'));var BPromise=require(_0x64ee('0x3'));var rp=require(_0x64ee('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x64ee('0x5'));var config=require('../../config/environment');var attributes=require('./squareReport.attributes');module['exports']=function(_0x2f4a27,_0x42329d){return _0x2f4a27['define'](_0x64ee('0x6'),attributes,{'tableName':_0x64ee('0x7'),'paranoid':![],'indexes':[{'name':_0x64ee('0x8'),'fields':[_0x64ee('0x9'),_0x64ee('0xa')]},{'name':'leaveAt','fields':[_0x64ee('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdecb=['leaveAt','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./squareReport.attributes','define','uid_pname','uniqueid','project_name'];(function(_0x4aba57,_0x4affe8){var _0x1d8285=function(_0x321496){while(--_0x321496){_0x4aba57['push'](_0x4aba57['shift']());}};_0x1d8285(++_0x4affe8);}(_0xdecb,0x6a));var _0xbdec=function(_0x41b76d,_0x4a4755){_0x41b76d=_0x41b76d-0x0;var _0x2a4657=_0xdecb[_0x41b76d];return _0x2a4657;};'use strict';var _=require(_0xbdec('0x0'));var util=require(_0xbdec('0x1'));var logger=require(_0xbdec('0x2'))(_0xbdec('0x3'));var moment=require(_0xbdec('0x4'));var BPromise=require(_0xbdec('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbdec('0x6'));var rimraf=require(_0xbdec('0x7'));var config=require(_0xbdec('0x8'));var attributes=require(_0xbdec('0x9'));module['exports']=function(_0x540b97,_0x43c90c){return _0x540b97[_0xbdec('0xa')]('SquareReport',attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0xbdec('0xb'),'fields':[_0xbdec('0xc'),_0xbdec('0xd')]},{'name':_0xbdec('0xe'),'fields':[_0xbdec('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 136db9d..474f89d 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 _0x71b7=['CreateSquareReport','SquareReport','create','options','raw','UpdateSquareReport','update','body','attributes','limit','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareReport,\x20%s,\x20%s','message','result','catch'];(function(_0x2089b3,_0x31fbde){var _0x181087=function(_0x31d19b){while(--_0x31d19b){_0x2089b3['push'](_0x2089b3['shift']());}};_0x181087(++_0x31fbde);}(_0x71b7,0x181));var _0x771b=function(_0x542e14,_0x5dfd4b){_0x542e14=_0x542e14-0x0;var _0xe3bbb=_0x71b7[_0x542e14];return _0xe3bbb;};'use strict';var _=require(_0x771b('0x0'));var util=require(_0x771b('0x1'));var moment=require(_0x771b('0x2'));var BPromise=require(_0x771b('0x3'));var rs=require(_0x771b('0x4'));var fs=require('fs');var Redis=require(_0x771b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x771b('0x6'));var logger=require(_0x771b('0x7'))('rpc');var config=require(_0x771b('0x8'));var jayson=require(_0x771b('0x9'));var client=jayson[_0x771b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a6c99,_0x5c63c9,_0x3bda6f){return new BPromise(function(_0x480e67,_0x16fc44){return client[_0x771b('0xb')](_0x3a6c99,_0x3bda6f)[_0x771b('0xc')](function(_0x586a8c){logger[_0x771b('0xd')]('SquareReport,\x20%s,\x20%s',_0x5c63c9,_0x771b('0xe'));logger['debug'](_0x771b('0xf'),_0x5c63c9,_0x771b('0xe'),JSON[_0x771b('0x10')](_0x586a8c));if(_0x586a8c[_0x771b('0x11')]){if(_0x586a8c['error'][_0x771b('0x12')]===0x1f4){logger[_0x771b('0x11')](_0x771b('0x13'),_0x5c63c9,_0x586a8c[_0x771b('0x11')][_0x771b('0x14')]);return _0x16fc44(_0x586a8c[_0x771b('0x11')][_0x771b('0x14')]);}logger[_0x771b('0x11')](_0x771b('0x13'),_0x5c63c9,_0x586a8c[_0x771b('0x11')][_0x771b('0x14')]);return _0x480e67(_0x586a8c[_0x771b('0x11')][_0x771b('0x14')]);}else{logger['info'](_0x771b('0x13'),_0x5c63c9,_0x771b('0xe'));_0x480e67(_0x586a8c[_0x771b('0x15')][_0x771b('0x14')]);}})[_0x771b('0x16')](function(_0x2b61bf){logger[_0x771b('0x11')]('SquareReport,\x20%s,\x20%s',_0x5c63c9,_0x2b61bf);_0x16fc44(_0x2b61bf);});});}exports[_0x771b('0x17')]=function(_0x2f729d){var _0x14c02e=this;return new Promise(function(_0x53dee4,_0x207791){return db[_0x771b('0x18')][_0x771b('0x19')](_0x2f729d['body'],{'raw':_0x2f729d[_0x771b('0x1a')]?_0x2f729d[_0x771b('0x1a')][_0x771b('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x29872c){logger[_0x771b('0xd')]('CreateSquareReport',_0x2f729d);logger['debug'](_0x771b('0x17'),_0x2f729d,JSON[_0x771b('0x10')](_0x29872c));_0x53dee4(_0x29872c);})[_0x771b('0x16')](function(_0x3c2fb5){logger['error'](_0x771b('0x17'),_0x3c2fb5['message'],_0x2f729d);_0x207791(_0x14c02e['error'](0x1f4,_0x3c2fb5[_0x771b('0x14')]));});});};exports[_0x771b('0x1c')]=function(_0x248260){var _0x15406b=this;return new Promise(function(_0x158f8e,_0x170273){return db[_0x771b('0x18')][_0x771b('0x1d')](_0x248260[_0x771b('0x1e')],{'raw':_0x248260['options']?_0x248260[_0x771b('0x1a')][_0x771b('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x248260['options']?_0x248260['options']['where']||null:null,'attributes':_0x248260['options']?_0x248260['options'][_0x771b('0x1f')]||null:null,'limit':_0x248260[_0x771b('0x1a')]?_0x248260['options'][_0x771b('0x20')]||null:null})[_0x771b('0xc')](function(_0x481436){logger[_0x771b('0xd')](_0x771b('0x1c'),_0x248260);logger[_0x771b('0x21')](_0x771b('0x1c'),_0x248260,JSON[_0x771b('0x10')](_0x481436));_0x158f8e(_0x481436);})[_0x771b('0x16')](function(_0x1fcec9){logger[_0x771b('0x11')]('UpdateSquareReport',_0x1fcec9[_0x771b('0x14')],_0x248260);_0x170273(_0x15406b['error'](0x1f4,_0x1fcec9['message']));});});}; \ No newline at end of file +var _0x3077=['error','code','message','result','catch','CreateSquareReport','create','options','raw','debug','UpdateSquareReport','SquareReport','update','body','where','limit','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3077,0x15a));var _0x7307=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0x3077[_0x138f59];return _0x3d114d;};'use strict';var _=require(_0x7307('0x0'));var util=require(_0x7307('0x1'));var moment=require('moment');var BPromise=require(_0x7307('0x2'));var rs=require(_0x7307('0x3'));var fs=require('fs');var Redis=require(_0x7307('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7307('0x5'));var logger=require(_0x7307('0x6'))('rpc');var config=require(_0x7307('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7307('0x8')][_0x7307('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4b4c24,_0x959cb5,_0x18ff4a){return new BPromise(function(_0x2ef0eb,_0x7fa9bc){return client[_0x7307('0xa')](_0x4b4c24,_0x18ff4a)[_0x7307('0xb')](function(_0x28180a){logger[_0x7307('0xc')](_0x7307('0xd'),_0x959cb5,_0x7307('0xe'));logger['debug'](_0x7307('0xf'),_0x959cb5,'request\x20sent',JSON[_0x7307('0x10')](_0x28180a));if(_0x28180a['error']){if(_0x28180a[_0x7307('0x11')][_0x7307('0x12')]===0x1f4){logger[_0x7307('0x11')](_0x7307('0xd'),_0x959cb5,_0x28180a[_0x7307('0x11')][_0x7307('0x13')]);return _0x7fa9bc(_0x28180a[_0x7307('0x11')][_0x7307('0x13')]);}logger[_0x7307('0x11')](_0x7307('0xd'),_0x959cb5,_0x28180a[_0x7307('0x11')]['message']);return _0x2ef0eb(_0x28180a[_0x7307('0x11')][_0x7307('0x13')]);}else{logger['info'](_0x7307('0xd'),_0x959cb5,_0x7307('0xe'));_0x2ef0eb(_0x28180a[_0x7307('0x14')][_0x7307('0x13')]);}})[_0x7307('0x15')](function(_0x161238){logger[_0x7307('0x11')](_0x7307('0xd'),_0x959cb5,_0x161238);_0x7fa9bc(_0x161238);});});}exports[_0x7307('0x16')]=function(_0x228a72){var _0x4f2654=this;return new Promise(function(_0x75ecd8,_0x350b7f){return db['SquareReport'][_0x7307('0x17')](_0x228a72['body'],{'raw':_0x228a72[_0x7307('0x18')]?_0x228a72[_0x7307('0x18')][_0x7307('0x19')]===undefined?!![]:![]:!![]})[_0x7307('0xb')](function(_0x56c8d9){logger['info'](_0x7307('0x16'),_0x228a72);logger[_0x7307('0x1a')]('CreateSquareReport',_0x228a72,JSON[_0x7307('0x10')](_0x56c8d9));_0x75ecd8(_0x56c8d9);})[_0x7307('0x15')](function(_0xd6983e){logger[_0x7307('0x11')](_0x7307('0x16'),_0xd6983e[_0x7307('0x13')],_0x228a72);_0x350b7f(_0x4f2654[_0x7307('0x11')](0x1f4,_0xd6983e[_0x7307('0x13')]));});});};exports[_0x7307('0x1b')]=function(_0x2a2bee){var _0x5190e3=this;return new Promise(function(_0x54a220,_0x174397){return db[_0x7307('0x1c')][_0x7307('0x1d')](_0x2a2bee[_0x7307('0x1e')],{'raw':_0x2a2bee[_0x7307('0x18')]?_0x2a2bee['options'][_0x7307('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a2bee['options']?_0x2a2bee['options'][_0x7307('0x1f')]||null:null,'attributes':_0x2a2bee[_0x7307('0x18')]?_0x2a2bee[_0x7307('0x18')]['attributes']||null:null,'limit':_0x2a2bee['options']?_0x2a2bee['options'][_0x7307('0x20')]||null:null})[_0x7307('0xb')](function(_0x1ff2f2){logger[_0x7307('0xc')](_0x7307('0x1b'),_0x2a2bee);logger[_0x7307('0x1a')]('UpdateSquareReport',_0x2a2bee,JSON[_0x7307('0x10')](_0x1ff2f2));_0x54a220(_0x1ff2f2);})[_0x7307('0x15')](function(_0x4ead99){logger['error'](_0x7307('0x1b'),_0x4ead99[_0x7307('0x13')],_0x2a2bee);_0x174397(_0x5190e3[_0x7307('0x11')](0x1f4,_0x4ead99[_0x7307('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 7c2da74..824d1e2 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 _0x58b9=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./squareReportDetail.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','util'];(function(_0x59ca87,_0x542bcd){var _0x2e0714=function(_0x26fb49){while(--_0x26fb49){_0x59ca87['push'](_0x59ca87['shift']());}};_0x2e0714(++_0x542bcd);}(_0x58b9,0x18b));var _0x958b=function(_0x303982,_0x18a2e6){_0x303982=_0x303982-0x0;var _0x2842d0=_0x58b9[_0x303982];return _0x2842d0;};'use strict';var multer=require('multer');var util=require(_0x958b('0x0'));var path=require(_0x958b('0x1'));var timeout=require(_0x958b('0x2'));var express=require(_0x958b('0x3'));var router=express[_0x958b('0x4')]();var fs_extra=require(_0x958b('0x5'));var auth=require(_0x958b('0x6'));var interaction=require(_0x958b('0x7'));var config=require('../../config/environment');var controller=require(_0x958b('0x8'));router[_0x958b('0x9')]('/',auth[_0x958b('0xa')](),controller[_0x958b('0xb')]);router[_0x958b('0x9')](_0x958b('0xc'),auth[_0x958b('0xa')](),controller[_0x958b('0xd')]);router[_0x958b('0x9')](_0x958b('0xe'),auth[_0x958b('0xa')](),controller[_0x958b('0xf')]);router[_0x958b('0x10')]('/',auth[_0x958b('0xa')](),controller[_0x958b('0x11')]);router['put'](_0x958b('0xe'),auth[_0x958b('0xa')](),controller[_0x958b('0x12')]);router[_0x958b('0x13')](_0x958b('0xe'),auth[_0x958b('0xa')](),controller[_0x958b('0x14')]);module[_0x958b('0x15')]=router; \ No newline at end of file +var _0x9fde=['post','create','put','/:id','update','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe'];(function(_0xb645af,_0x3d10cb){var _0xf3ad17=function(_0xd9b483){while(--_0xd9b483){_0xb645af['push'](_0xb645af['shift']());}};_0xf3ad17(++_0x3d10cb);}(_0x9fde,0x1b8));var _0xe9fd=function(_0x3bb5b4,_0x128455){_0x3bb5b4=_0x3bb5b4-0x0;var _0x586c60=_0x9fde[_0x3bb5b4];return _0x586c60;};'use strict';var multer=require('multer');var util=require(_0xe9fd('0x0'));var path=require(_0xe9fd('0x1'));var timeout=require('connect-timeout');var express=require(_0xe9fd('0x2'));var router=express[_0xe9fd('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe9fd('0x4'));var interaction=require(_0xe9fd('0x5'));var config=require('../../config/environment');var controller=require('./squareReportDetail.controller');router[_0xe9fd('0x6')]('/',auth[_0xe9fd('0x7')](),controller['index']);router[_0xe9fd('0x6')](_0xe9fd('0x8'),auth[_0xe9fd('0x7')](),controller[_0xe9fd('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0xe9fd('0xa')]('/',auth[_0xe9fd('0x7')](),controller[_0xe9fd('0xb')]);router[_0xe9fd('0xc')](_0xe9fd('0xd'),auth[_0xe9fd('0x7')](),controller[_0xe9fd('0xe')]);router[_0xe9fd('0xf')]('/:id',auth[_0xe9fd('0x7')](),controller[_0xe9fd('0x10')]);module[_0xe9fd('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 3608740..dfdf913 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 _0x96db=['TEXT','sequelize','exports','STRING'];(function(_0x1943d9,_0x245bb8){var _0x4b4f3f=function(_0x3bba90){while(--_0x3bba90){_0x1943d9['push'](_0x1943d9['shift']());}};_0x4b4f3f(++_0x245bb8);}(_0x96db,0xa9));var _0xb96d=function(_0x4ce028,_0x526d4b){_0x4ce028=_0x4ce028-0x0;var _0x583d0c=_0x96db[_0x4ce028];return _0x583d0c;};'use strict';var Sequelize=require(_0xb96d('0x0'));module[_0xb96d('0x1')]={'uniqueid':{'type':Sequelize[_0xb96d('0x2')]},'node':{'type':Sequelize[_0xb96d('0x2')]},'application':{'type':Sequelize[_0xb96d('0x2')]},'data':{'type':Sequelize[_0xb96d('0x3')]},'project_name':{'type':Sequelize[_0xb96d('0x2')]},'callerid':{'type':Sequelize[_0xb96d('0x2')]}}; \ No newline at end of file +var _0xceb0=['STRING'];(function(_0x2d6c01,_0x1a66dd){var _0x706454=function(_0x4b6d93){while(--_0x4b6d93){_0x2d6c01['push'](_0x2d6c01['shift']());}};_0x706454(++_0x1a66dd);}(_0xceb0,0x173));var _0x0ceb=function(_0xe559b5,_0x5a6dc9){_0xe559b5=_0xe559b5-0x0;var _0xe92601=_0xceb0[_0xe559b5];return _0xe92601;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0x0ceb('0x0')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x0ceb('0x0')]},'callerid':{'type':Sequelize[_0x0ceb('0x0')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index d096b34..3b47f5e 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 _0xa73e=['mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','include','rows','params','includeAll','find','catch','update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird'];(function(_0x43b2cb,_0x503983){var _0x487945=function(_0x2393b7){while(--_0x2393b7){_0x43b2cb['push'](_0x43b2cb['shift']());}};_0x487945(++_0x503983);}(_0xa73e,0x90));var _0xea73=function(_0x21d293,_0x4b0bef){_0x21d293=_0x21d293-0x0;var _0x438d56=_0xa73e[_0x21d293];return _0x438d56;};'use strict';var emlformat=require(_0xea73('0x0'));var rimraf=require(_0xea73('0x1'));var zipdir=require(_0xea73('0x2'));var jsonpatch=require(_0xea73('0x3'));var rp=require('request-promise');var moment=require(_0xea73('0x4'));var BPromise=require(_0xea73('0x5'));var Mustache=require(_0xea73('0x6'));var util=require(_0xea73('0x7'));var path=require(_0xea73('0x8'));var sox=require(_0xea73('0x9'));var csv=require(_0xea73('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xea73('0xb'));var _=require(_0xea73('0xc'));var squel=require(_0xea73('0xd'));var crypto=require(_0xea73('0xe'));var jsforce=require(_0xea73('0xf'));var deskjs=require(_0xea73('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xea73('0x11'));var Redis=require(_0xea73('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xea73('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xea73('0x14'));var logger=require(_0xea73('0x15'))(_0xea73('0x16'));var utils=require(_0xea73('0x17'));var config=require(_0xea73('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xea73('0x19'))['db'];function respondWithStatusCode(_0x1f7b27,_0x7d7c56){_0x7d7c56=_0x7d7c56||0xcc;return function(_0x3151c1){if(_0x3151c1){return _0x1f7b27['sendStatus'](_0x7d7c56);}return _0x1f7b27['status'](_0x7d7c56)[_0xea73('0x1a')]();};}function respondWithResult(_0x522ddd,_0x5e87cd){_0x5e87cd=_0x5e87cd||0xc8;return function(_0x1cf847){if(_0x1cf847){return _0x522ddd[_0xea73('0x1b')](_0x5e87cd)[_0xea73('0x1c')](_0x1cf847);}};}function respondWithFilteredResult(_0x49cc27,_0x51c798){return function(_0x4660d5){if(_0x4660d5){var _0x220e1b=typeof _0x51c798['offset']==='undefined'&&typeof _0x51c798[_0xea73('0x1d')]==='undefined';var _0x539f09=_0x4660d5[_0xea73('0x1e')];var _0x3dad65=_0x220e1b?0x0:_0x51c798['offset'];var _0x2790f0=_0x220e1b?_0x4660d5[_0xea73('0x1e')]:_0x51c798[_0xea73('0x1f')]+_0x51c798[_0xea73('0x1d')];var _0xd9360d;if(_0x2790f0>=_0x539f09){_0x2790f0=_0x539f09;_0xd9360d=0xc8;}else{_0xd9360d=0xce;}_0x49cc27['status'](_0xd9360d);return _0x49cc27[_0xea73('0x20')](_0xea73('0x21'),_0x3dad65+'-'+_0x2790f0+'/'+_0x539f09)[_0xea73('0x1c')](_0x4660d5);}return null;};}function patchUpdates(_0x278d80){return function(_0x418c36){try{jsonpatch[_0xea73('0x22')](_0x418c36,_0x278d80,!![]);}catch(_0x344bcb){return BPromise[_0xea73('0x23')](_0x344bcb);}return _0x418c36[_0xea73('0x24')]();};}function saveUpdates(_0x599af5,_0x5dea6d){return function(_0x58dc63){if(_0x58dc63){return _0x58dc63['update'](_0x599af5)[_0xea73('0x25')](function(_0x216e5b){return _0x216e5b;});}return null;};}function removeEntity(_0x1a2199,_0x2c3579){return function(_0x4bdbf0){if(_0x4bdbf0){return _0x4bdbf0[_0xea73('0x26')]()[_0xea73('0x25')](function(){_0x1a2199[_0xea73('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xef5ea1,_0x2212d1){return function(_0xda334c){if(!_0xda334c){_0xef5ea1[_0xea73('0x27')](0x194);}return _0xda334c;};}function handleError(_0x5c4936,_0x569bba){_0x569bba=_0x569bba||0x1f4;return function(_0x3912db){logger[_0xea73('0x28')](_0x3912db['stack']);if(_0x3912db['name']){delete _0x3912db[_0xea73('0x29')];}_0x5c4936[_0xea73('0x1b')](_0x569bba)[_0xea73('0x2a')](_0x3912db);};}exports[_0xea73('0x2b')]=function(_0x1c30bf,_0x5d699f){var _0x4ee9ed={},_0x413486={},_0x21f7d0={'count':0x0,'rows':[]};var _0x1a0a19=_[_0xea73('0x2c')](db[_0xea73('0x2d')][_0xea73('0x2e')],function(_0x490403){return{'name':_0x490403[_0xea73('0x2f')],'type':_0x490403[_0xea73('0x30')][_0xea73('0x31')]};});_0x413486[_0xea73('0x32')]=_[_0xea73('0x2c')](_0x1a0a19,_0xea73('0x29'));_0x413486[_0xea73('0x33')]=_[_0xea73('0x34')](_0x1c30bf['query']);_0x413486[_0xea73('0x35')]=_[_0xea73('0x36')](_0x413486['model'],_0x413486[_0xea73('0x33')]);_0x4ee9ed['attributes']=_[_0xea73('0x36')](_0x413486[_0xea73('0x32')],qs[_0xea73('0x37')](_0x1c30bf[_0xea73('0x33')][_0xea73('0x37')]));_0x4ee9ed[_0xea73('0x38')]=_0x4ee9ed[_0xea73('0x38')][_0xea73('0x39')]?_0x4ee9ed[_0xea73('0x38')]:_0x413486[_0xea73('0x32')];if(!_0x1c30bf['query'][_0xea73('0x3a')](_0xea73('0x3b'))){_0x4ee9ed[_0xea73('0x1d')]=qs[_0xea73('0x1d')](_0x1c30bf[_0xea73('0x33')][_0xea73('0x1d')]);_0x4ee9ed[_0xea73('0x1f')]=qs[_0xea73('0x1f')](_0x1c30bf[_0xea73('0x33')]['offset']);}_0x4ee9ed['order']=qs['sort'](_0x1c30bf[_0xea73('0x33')][_0xea73('0x3c')]);_0x4ee9ed[_0xea73('0x3d')]=qs[_0xea73('0x35')](_['pick'](_0x1c30bf['query'],_0x413486[_0xea73('0x35')]),_0x1a0a19);if(_0x1c30bf[_0xea73('0x33')][_0xea73('0x3e')]){_0x4ee9ed[_0xea73('0x3d')]=_[_0xea73('0x3f')](_0x4ee9ed['where'],{'$or':_['map'](_0x1a0a19,function(_0x5d9e88){if(_0x5d9e88[_0xea73('0x30')]!==_0xea73('0x40')){var _0x38434a={};_0x38434a[_0x5d9e88[_0xea73('0x29')]]={'$like':'%'+_0x1c30bf['query'][_0xea73('0x3e')]+'%'};return _0x38434a;}})});}_0x4ee9ed=_[_0xea73('0x3f')]({},_0x4ee9ed,_0x1c30bf[_0xea73('0x41')]);var _0x5c8f88={'where':_0x4ee9ed[_0xea73('0x3d')]};return db['SquareDetailsReport'][_0xea73('0x1e')](_0x5c8f88)[_0xea73('0x25')](function(_0x5c950d){_0x21f7d0['count']=_0x5c950d;if(_0x1c30bf[_0xea73('0x33')]['includeAll']){_0x4ee9ed[_0xea73('0x42')]=[{'all':!![]}];}return db[_0xea73('0x2d')]['findAll'](_0x4ee9ed);})[_0xea73('0x25')](function(_0x51a7cb){_0x21f7d0[_0xea73('0x43')]=_0x51a7cb;return _0x21f7d0;})[_0xea73('0x25')](respondWithFilteredResult(_0x5d699f,_0x4ee9ed))['catch'](handleError(_0x5d699f,null));};exports['show']=function(_0x1784c6,_0x53aae5){var _0x1099fe={'raw':!![],'where':{'id':_0x1784c6[_0xea73('0x44')]['id']}},_0x13f7c5={};_0x13f7c5['model']=_[_0xea73('0x34')](db[_0xea73('0x2d')][_0xea73('0x2e')]);_0x13f7c5[_0xea73('0x33')]=_[_0xea73('0x34')](_0x1784c6[_0xea73('0x33')]);_0x13f7c5[_0xea73('0x35')]=_[_0xea73('0x36')](_0x13f7c5[_0xea73('0x32')],_0x13f7c5[_0xea73('0x33')]);_0x1099fe[_0xea73('0x38')]=_['intersection'](_0x13f7c5[_0xea73('0x32')],qs[_0xea73('0x37')](_0x1784c6['query'][_0xea73('0x37')]));_0x1099fe[_0xea73('0x38')]=_0x1099fe['attributes'][_0xea73('0x39')]?_0x1099fe[_0xea73('0x38')]:_0x13f7c5[_0xea73('0x32')];if(_0x1784c6[_0xea73('0x33')][_0xea73('0x45')]){_0x1099fe[_0xea73('0x42')]=[{'all':!![]}];}_0x1099fe=_[_0xea73('0x3f')]({},_0x1099fe,_0x1784c6[_0xea73('0x41')]);return db[_0xea73('0x2d')][_0xea73('0x46')](_0x1099fe)[_0xea73('0x25')](handleEntityNotFound(_0x53aae5,null))['then'](respondWithResult(_0x53aae5,null))['catch'](handleError(_0x53aae5,null));};exports['create']=function(_0x11bdf0,_0x461c1){return db['SquareDetailsReport']['create'](_0x11bdf0['body'],{})[_0xea73('0x25')](respondWithResult(_0x461c1,0xc9))[_0xea73('0x47')](handleError(_0x461c1,null));};exports[_0xea73('0x48')]=function(_0x1e2ae6,_0x12d342){if(_0x1e2ae6[_0xea73('0x49')]['id']){delete _0x1e2ae6['body']['id'];}return db[_0xea73('0x2d')][_0xea73('0x46')]({'where':{'id':_0x1e2ae6[_0xea73('0x44')]['id']}})[_0xea73('0x25')](handleEntityNotFound(_0x12d342,null))[_0xea73('0x25')](saveUpdates(_0x1e2ae6[_0xea73('0x49')],null))[_0xea73('0x25')](respondWithResult(_0x12d342,null))[_0xea73('0x47')](handleError(_0x12d342,null));};exports[_0xea73('0x26')]=function(_0x57f271,_0x2cce42){return db[_0xea73('0x2d')]['find']({'where':{'id':_0x57f271[_0xea73('0x44')]['id']}})[_0xea73('0x25')](handleEntityNotFound(_0x2cce42,null))[_0xea73('0x25')](removeEntity(_0x2cce42,null))['catch'](handleError(_0x2cce42,null));};exports[_0xea73('0x4a')]=function(_0x2f4a21,_0x13d5d1){return db[_0xea73('0x2d')][_0xea73('0x4a')]()[_0xea73('0x25')](respondWithResult(_0x13d5d1,null))['catch'](handleError(_0x13d5d1,null));}; \ No newline at end of file +var _0xc258=['describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','find','body','catch'];(function(_0x326e49,_0x26f4c8){var _0x521a97=function(_0x4045f5){while(--_0x4045f5){_0x326e49['push'](_0x326e49['shift']());}};_0x521a97(++_0x26f4c8);}(_0xc258,0x173));var _0x8c25=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc258[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8c25('0x0'));var jsonpatch=require(_0x8c25('0x1'));var rp=require(_0x8c25('0x2'));var moment=require(_0x8c25('0x3'));var BPromise=require(_0x8c25('0x4'));var Mustache=require('mustache');var util=require(_0x8c25('0x5'));var path=require(_0x8c25('0x6'));var sox=require('sox');var csv=require(_0x8c25('0x7'));var ejs=require(_0x8c25('0x8'));var fs=require('fs');var fs_extra=require(_0x8c25('0x9'));var _=require(_0x8c25('0xa'));var squel=require(_0x8c25('0xb'));var crypto=require('crypto');var jsforce=require(_0x8c25('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8c25('0x7'));var querystring=require(_0x8c25('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8c25('0xe'));var qs=require(_0x8c25('0xf'));var as=require(_0x8c25('0x10'));var hardwareService=require(_0x8c25('0x11'));var logger=require('../../config/logger')(_0x8c25('0x12'));var utils=require(_0x8c25('0x13'));var config=require(_0x8c25('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x8c25('0x15'))['db'];function respondWithStatusCode(_0x3829a3,_0x254e6c){_0x254e6c=_0x254e6c||0xcc;return function(_0xddd6fd){if(_0xddd6fd){return _0x3829a3[_0x8c25('0x16')](_0x254e6c);}return _0x3829a3[_0x8c25('0x17')](_0x254e6c)['end']();};}function respondWithResult(_0x261920,_0x4d8b2b){_0x4d8b2b=_0x4d8b2b||0xc8;return function(_0x2ab716){if(_0x2ab716){return _0x261920[_0x8c25('0x17')](_0x4d8b2b)['json'](_0x2ab716);}};}function respondWithFilteredResult(_0x4211e3,_0x46480d){return function(_0xa5ba50){if(_0xa5ba50){var _0x1e5ad8=typeof _0x46480d[_0x8c25('0x18')]===_0x8c25('0x19')&&typeof _0x46480d['limit']==='undefined';var _0x5d78ca=_0xa5ba50[_0x8c25('0x1a')];var _0x573973=_0x1e5ad8?0x0:_0x46480d['offset'];var _0x4d680f=_0x1e5ad8?_0xa5ba50[_0x8c25('0x1a')]:_0x46480d['offset']+_0x46480d[_0x8c25('0x1b')];var _0xc54a8e;if(_0x4d680f>=_0x5d78ca){_0x4d680f=_0x5d78ca;_0xc54a8e=0xc8;}else{_0xc54a8e=0xce;}_0x4211e3['status'](_0xc54a8e);return _0x4211e3[_0x8c25('0x1c')](_0x8c25('0x1d'),_0x573973+'-'+_0x4d680f+'/'+_0x5d78ca)[_0x8c25('0x1e')](_0xa5ba50);}return null;};}function patchUpdates(_0x4f6d96){return function(_0x4ef670){try{jsonpatch[_0x8c25('0x1f')](_0x4ef670,_0x4f6d96,!![]);}catch(_0x335b78){return BPromise[_0x8c25('0x20')](_0x335b78);}return _0x4ef670[_0x8c25('0x21')]();};}function saveUpdates(_0x1409aa,_0x452cd5){return function(_0x3c4f95){if(_0x3c4f95){return _0x3c4f95[_0x8c25('0x22')](_0x1409aa)[_0x8c25('0x23')](function(_0x1abfd4){return _0x1abfd4;});}return null;};}function removeEntity(_0x136eda,_0x4e3055){return function(_0x301a73){if(_0x301a73){return _0x301a73[_0x8c25('0x24')]()['then'](function(){_0x136eda['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2fb5c1,_0x168c6f){return function(_0x4ff49b){if(!_0x4ff49b){_0x2fb5c1[_0x8c25('0x16')](0x194);}return _0x4ff49b;};}function handleError(_0x5ec20e,_0x5b605e){_0x5b605e=_0x5b605e||0x1f4;return function(_0x11af96){logger[_0x8c25('0x25')](_0x11af96[_0x8c25('0x26')]);if(_0x11af96[_0x8c25('0x27')]){delete _0x11af96[_0x8c25('0x27')];}_0x5ec20e[_0x8c25('0x17')](_0x5b605e)[_0x8c25('0x28')](_0x11af96);};}exports[_0x8c25('0x29')]=function(_0xb92463,_0x23b4da){var _0x50d1f3={},_0x172b36={},_0x351728={'count':0x0,'rows':[]};var _0x311928=_[_0x8c25('0x2a')](db[_0x8c25('0x2b')][_0x8c25('0x2c')],function(_0x129def){return{'name':_0x129def[_0x8c25('0x2d')],'type':_0x129def[_0x8c25('0x2e')][_0x8c25('0x2f')]};});_0x172b36[_0x8c25('0x30')]=_[_0x8c25('0x2a')](_0x311928,'name');_0x172b36[_0x8c25('0x31')]=_[_0x8c25('0x32')](_0xb92463[_0x8c25('0x31')]);_0x172b36[_0x8c25('0x33')]=_[_0x8c25('0x34')](_0x172b36[_0x8c25('0x30')],_0x172b36[_0x8c25('0x31')]);_0x50d1f3[_0x8c25('0x35')]=_[_0x8c25('0x34')](_0x172b36[_0x8c25('0x30')],qs[_0x8c25('0x36')](_0xb92463['query'][_0x8c25('0x36')]));_0x50d1f3[_0x8c25('0x35')]=_0x50d1f3[_0x8c25('0x35')][_0x8c25('0x37')]?_0x50d1f3[_0x8c25('0x35')]:_0x172b36[_0x8c25('0x30')];if(!_0xb92463[_0x8c25('0x31')]['hasOwnProperty'](_0x8c25('0x38'))){_0x50d1f3[_0x8c25('0x1b')]=qs[_0x8c25('0x1b')](_0xb92463[_0x8c25('0x31')][_0x8c25('0x1b')]);_0x50d1f3[_0x8c25('0x18')]=qs[_0x8c25('0x18')](_0xb92463[_0x8c25('0x31')][_0x8c25('0x18')]);}_0x50d1f3[_0x8c25('0x39')]=qs['sort'](_0xb92463[_0x8c25('0x31')][_0x8c25('0x3a')]);_0x50d1f3[_0x8c25('0x3b')]=qs['filters'](_[_0x8c25('0x3c')](_0xb92463[_0x8c25('0x31')],_0x172b36[_0x8c25('0x33')]),_0x311928);if(_0xb92463[_0x8c25('0x31')][_0x8c25('0x3d')]){_0x50d1f3[_0x8c25('0x3b')]=_[_0x8c25('0x3e')](_0x50d1f3['where'],{'$or':_[_0x8c25('0x2a')](_0x311928,function(_0x2b9c64){if(_0x2b9c64[_0x8c25('0x2e')]!==_0x8c25('0x3f')){var _0x43ea03={};_0x43ea03[_0x2b9c64[_0x8c25('0x27')]]={'$like':'%'+_0xb92463[_0x8c25('0x31')][_0x8c25('0x3d')]+'%'};return _0x43ea03;}})});}_0x50d1f3=_[_0x8c25('0x3e')]({},_0x50d1f3,_0xb92463[_0x8c25('0x40')]);var _0x488960={'where':_0x50d1f3[_0x8c25('0x3b')]};return db[_0x8c25('0x2b')][_0x8c25('0x1a')](_0x488960)[_0x8c25('0x23')](function(_0x1cfe4b){_0x351728[_0x8c25('0x1a')]=_0x1cfe4b;if(_0xb92463[_0x8c25('0x31')][_0x8c25('0x41')]){_0x50d1f3['include']=[{'all':!![]}];}return db[_0x8c25('0x2b')][_0x8c25('0x42')](_0x50d1f3);})['then'](function(_0xbbecfc){_0x351728[_0x8c25('0x43')]=_0xbbecfc;return _0x351728;})['then'](respondWithFilteredResult(_0x23b4da,_0x50d1f3))['catch'](handleError(_0x23b4da,null));};exports[_0x8c25('0x44')]=function(_0x40ed76,_0x3e5c67){var _0x9507d5={'raw':!![],'where':{'id':_0x40ed76[_0x8c25('0x45')]['id']}},_0x9406c={};_0x9406c[_0x8c25('0x30')]=_['keys'](db[_0x8c25('0x2b')][_0x8c25('0x2c')]);_0x9406c['query']=_['keys'](_0x40ed76['query']);_0x9406c[_0x8c25('0x33')]=_[_0x8c25('0x34')](_0x9406c[_0x8c25('0x30')],_0x9406c['query']);_0x9507d5[_0x8c25('0x35')]=_[_0x8c25('0x34')](_0x9406c[_0x8c25('0x30')],qs[_0x8c25('0x36')](_0x40ed76[_0x8c25('0x31')][_0x8c25('0x36')]));_0x9507d5[_0x8c25('0x35')]=_0x9507d5[_0x8c25('0x35')][_0x8c25('0x37')]?_0x9507d5[_0x8c25('0x35')]:_0x9406c[_0x8c25('0x30')];if(_0x40ed76[_0x8c25('0x31')][_0x8c25('0x41')]){_0x9507d5['include']=[{'all':!![]}];}_0x9507d5=_[_0x8c25('0x3e')]({},_0x9507d5,_0x40ed76[_0x8c25('0x40')]);return db[_0x8c25('0x2b')][_0x8c25('0x46')](_0x9507d5)[_0x8c25('0x23')](handleEntityNotFound(_0x3e5c67,null))['then'](respondWithResult(_0x3e5c67,null))['catch'](handleError(_0x3e5c67,null));};exports['create']=function(_0x39d5b8,_0xc9892e){return db[_0x8c25('0x2b')]['create'](_0x39d5b8[_0x8c25('0x47')],{})[_0x8c25('0x23')](respondWithResult(_0xc9892e,0xc9))[_0x8c25('0x48')](handleError(_0xc9892e,null));};exports[_0x8c25('0x22')]=function(_0x2b1c81,_0x41683f){if(_0x2b1c81[_0x8c25('0x47')]['id']){delete _0x2b1c81[_0x8c25('0x47')]['id'];}return db['SquareDetailsReport'][_0x8c25('0x46')]({'where':{'id':_0x2b1c81['params']['id']}})[_0x8c25('0x23')](handleEntityNotFound(_0x41683f,null))[_0x8c25('0x23')](saveUpdates(_0x2b1c81[_0x8c25('0x47')],null))[_0x8c25('0x23')](respondWithResult(_0x41683f,null))[_0x8c25('0x48')](handleError(_0x41683f,null));};exports['destroy']=function(_0x2862a6,_0x2f1a0b){return db[_0x8c25('0x2b')][_0x8c25('0x46')]({'where':{'id':_0x2862a6['params']['id']}})[_0x8c25('0x23')](handleEntityNotFound(_0x2f1a0b,null))[_0x8c25('0x23')](removeEntity(_0x2f1a0b,null))[_0x8c25('0x48')](handleError(_0x2f1a0b,null));};exports[_0x8c25('0x49')]=function(_0x2a417f,_0x26f38f){return db[_0x8c25('0x2b')][_0x8c25('0x49')]()['then'](respondWithResult(_0x26f38f,null))[_0x8c25('0x48')](handleError(_0x26f38f,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 0ddee57..4248f37 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 _0x7909=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./squareReportDetail.attributes','exports','define','lodash'];(function(_0x16274b,_0x27e5e1){var _0x4bd2f7=function(_0x597b56){while(--_0x597b56){_0x16274b['push'](_0x16274b['shift']());}};_0x4bd2f7(++_0x27e5e1);}(_0x7909,0xd0));var _0x9790=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x7909[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0x9790('0x0'));var util=require('util');var logger=require(_0x9790('0x1'))(_0x9790('0x2'));var moment=require(_0x9790('0x3'));var BPromise=require(_0x9790('0x4'));var rp=require(_0x9790('0x5'));var fs=require('fs');var path=require(_0x9790('0x6'));var rimraf=require(_0x9790('0x7'));var config=require('../../config/environment');var attributes=require(_0x9790('0x8'));module[_0x9790('0x9')]=function(_0x1db32a,_0x4672f3){return _0x1db32a[_0x9790('0xa')]('SquareDetailsReport',attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7441=['rimraf','../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x7441,0x19a));var _0x1744=function(_0x213203,_0x11a304){_0x213203=_0x213203-0x0;var _0x117051=_0x7441[_0x213203];return _0x117051;};'use strict';var _=require(_0x1744('0x0'));var util=require(_0x1744('0x1'));var logger=require(_0x1744('0x2'))(_0x1744('0x3'));var moment=require('moment');var BPromise=require(_0x1744('0x4'));var rp=require(_0x1744('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1744('0x6'));var config=require(_0x1744('0x7'));var attributes=require(_0x1744('0x8'));module[_0x1744('0x9')]=function(_0x2314fd,_0x48d936){return _0x2314fd[_0x1744('0xa')](_0x1744('0xb'),attributes,{'tableName':_0x1744('0xc'),'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 891a4c1..b367143 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 _0x1eba=['SquareDetailsReport','create','body','options','raw','debug','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','SquareDetailsReport,\x20%s,\x20%s','message','result','CreateSquareDetailsReport'];(function(_0x4d1b89,_0x417942){var _0x4038fc=function(_0x3f30c2){while(--_0x3f30c2){_0x4d1b89['push'](_0x4d1b89['shift']());}};_0x4038fc(++_0x417942);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x4f2c3a,_0x6bde90){_0x4f2c3a=_0x4f2c3a-0x0;var _0x17d91c=_0x1eba[_0x4f2c3a];return _0x17d91c;};'use strict';var _=require(_0xa1eb('0x0'));var util=require(_0xa1eb('0x1'));var moment=require(_0xa1eb('0x2'));var BPromise=require(_0xa1eb('0x3'));var rs=require(_0xa1eb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa1eb('0x5'));var logger=require(_0xa1eb('0x6'))(_0xa1eb('0x7'));var config=require(_0xa1eb('0x8'));var jayson=require(_0xa1eb('0x9'));var client=jayson[_0xa1eb('0xa')][_0xa1eb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2bfbb0,_0x39a5a3,_0x7d2982){return new BPromise(function(_0x2aebb6,_0x9d7113){return client['request'](_0x2bfbb0,_0x7d2982)[_0xa1eb('0xc')](function(_0x4d4aaf){logger[_0xa1eb('0xd')]('SquareDetailsReport,\x20%s,\x20%s',_0x39a5a3,_0xa1eb('0xe'));logger['debug'](_0xa1eb('0xf'),_0x39a5a3,'request\x20sent',JSON[_0xa1eb('0x10')](_0x4d4aaf));if(_0x4d4aaf[_0xa1eb('0x11')]){if(_0x4d4aaf[_0xa1eb('0x11')]['code']===0x1f4){logger[_0xa1eb('0x11')](_0xa1eb('0x12'),_0x39a5a3,_0x4d4aaf['error'][_0xa1eb('0x13')]);return _0x9d7113(_0x4d4aaf['error']['message']);}logger[_0xa1eb('0x11')]('SquareDetailsReport,\x20%s,\x20%s',_0x39a5a3,_0x4d4aaf[_0xa1eb('0x11')][_0xa1eb('0x13')]);return _0x2aebb6(_0x4d4aaf[_0xa1eb('0x11')][_0xa1eb('0x13')]);}else{logger[_0xa1eb('0xd')](_0xa1eb('0x12'),_0x39a5a3,_0xa1eb('0xe'));_0x2aebb6(_0x4d4aaf[_0xa1eb('0x14')][_0xa1eb('0x13')]);}})['catch'](function(_0xbd6a6b){logger['error'](_0xa1eb('0x12'),_0x39a5a3,_0xbd6a6b);_0x9d7113(_0xbd6a6b);});});}exports[_0xa1eb('0x15')]=function(_0x33c4e3){var _0x1a5d2c=this;return new Promise(function(_0x49bfaa,_0x1dd621){return db[_0xa1eb('0x16')][_0xa1eb('0x17')](_0x33c4e3[_0xa1eb('0x18')],{'raw':_0x33c4e3[_0xa1eb('0x19')]?_0x33c4e3[_0xa1eb('0x19')][_0xa1eb('0x1a')]===undefined?!![]:![]:!![]})[_0xa1eb('0xc')](function(_0x4fc14a){logger[_0xa1eb('0xd')]('CreateSquareDetailsReport',_0x33c4e3);logger[_0xa1eb('0x1b')](_0xa1eb('0x15'),_0x33c4e3,JSON[_0xa1eb('0x10')](_0x4fc14a));_0x49bfaa(_0x4fc14a);})[_0xa1eb('0x1c')](function(_0x5e7a34){logger['error'](_0xa1eb('0x15'),_0x5e7a34[_0xa1eb('0x13')],_0x33c4e3);_0x1dd621(_0x1a5d2c['error'](0x1f4,_0x5e7a34[_0xa1eb('0x13')]));});});}; \ No newline at end of file +var _0xc901=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','code','message','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','stringify','catch','lodash','ioredis'];(function(_0x404b62,_0xbb4734){var _0x33a774=function(_0x239751){while(--_0x239751){_0x404b62['push'](_0x404b62['shift']());}};_0x33a774(++_0xbb4734);}(_0xc901,0x142));var _0x1c90=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc901[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x1c90('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1c90('0x1'));var db=require(_0x1c90('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x1c90('0x3'))(_0x1c90('0x4'));var config=require(_0x1c90('0x5'));var jayson=require(_0x1c90('0x6'));var client=jayson[_0x1c90('0x7')][_0x1c90('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x912860,_0x12c07d,_0x423cfb){return new BPromise(function(_0x19196f,_0x514386){return client[_0x1c90('0x9')](_0x912860,_0x423cfb)[_0x1c90('0xa')](function(_0x38cd18){logger[_0x1c90('0xb')](_0x1c90('0xc'),_0x12c07d,_0x1c90('0xd'));logger[_0x1c90('0xe')](_0x1c90('0xf'),_0x12c07d,'request\x20sent',JSON['stringify'](_0x38cd18));if(_0x38cd18[_0x1c90('0x10')]){if(_0x38cd18[_0x1c90('0x10')][_0x1c90('0x11')]===0x1f4){logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x12c07d,_0x38cd18[_0x1c90('0x10')][_0x1c90('0x12')]);return _0x514386(_0x38cd18['error'][_0x1c90('0x12')]);}logger[_0x1c90('0x10')](_0x1c90('0xc'),_0x12c07d,_0x38cd18['error'][_0x1c90('0x12')]);return _0x19196f(_0x38cd18['error'][_0x1c90('0x12')]);}else{logger[_0x1c90('0xb')](_0x1c90('0xc'),_0x12c07d,_0x1c90('0xd'));_0x19196f(_0x38cd18['result'][_0x1c90('0x12')]);}})['catch'](function(_0x2d3c90){logger[_0x1c90('0x10')]('SquareDetailsReport,\x20%s,\x20%s',_0x12c07d,_0x2d3c90);_0x514386(_0x2d3c90);});});}exports[_0x1c90('0x13')]=function(_0x4ec354){var _0x582246=this;return new Promise(function(_0x128bf0,_0x5dd488){return db[_0x1c90('0x14')][_0x1c90('0x15')](_0x4ec354[_0x1c90('0x16')],{'raw':_0x4ec354[_0x1c90('0x17')]?_0x4ec354['options'][_0x1c90('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x525997){logger[_0x1c90('0xb')](_0x1c90('0x13'),_0x4ec354);logger['debug'](_0x1c90('0x13'),_0x4ec354,JSON[_0x1c90('0x19')](_0x525997));_0x128bf0(_0x525997);})[_0x1c90('0x1a')](function(_0x4074fd){logger[_0x1c90('0x10')](_0x1c90('0x13'),_0x4074fd['message'],_0x4ec354);_0x5dd488(_0x582246[_0x1c90('0x10')](0x1f4,_0x4074fd[_0x1c90('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 3c40392..cec68c7 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 _0x7358=['Router','get','isAuthenticated','killProcess','exports','express'];(function(_0x4093c7,_0x14622c){var _0x571176=function(_0x49151b){while(--_0x49151b){_0x4093c7['push'](_0x4093c7['shift']());}};_0x571176(++_0x14622c);}(_0x7358,0x161));var _0x8735=function(_0x2e9606,_0x2f6b71){_0x2e9606=_0x2e9606-0x0;var _0x53ec9b=_0x7358[_0x2e9606];return _0x53ec9b;};'use strict';var express=require(_0x8735('0x0'));var router=express[_0x8735('0x1')]();var auth=require('../../components/auth/service');var controller=require('./system.controller');router[_0x8735('0x2')]('/',auth[_0x8735('0x3')](),controller['index']);router[_0x8735('0x2')]('/process/:pid/kill',auth[_0x8735('0x3')](),controller[_0x8735('0x4')]);module[_0x8735('0x5')]=router; \ No newline at end of file +var _0xf1ba=['./system.controller','get','isAuthenticated','/process/:pid/kill','killProcess','exports','express','Router','../../components/auth/service'];(function(_0xbf09ab,_0x251a19){var _0x2a9aef=function(_0x22d793){while(--_0x22d793){_0xbf09ab['push'](_0xbf09ab['shift']());}};_0x2a9aef(++_0x251a19);}(_0xf1ba,0xf0));var _0xaf1b=function(_0x3f4c28,_0x40fb8f){_0x3f4c28=_0x3f4c28-0x0;var _0x4f46ca=_0xf1ba[_0x3f4c28];return _0x4f46ca;};'use strict';var express=require(_0xaf1b('0x0'));var router=express[_0xaf1b('0x1')]();var auth=require(_0xaf1b('0x2'));var controller=require(_0xaf1b('0x3'));router[_0xaf1b('0x4')]('/',auth[_0xaf1b('0x5')](),controller['index']);router[_0xaf1b('0x4')](_0xaf1b('0x6'),auth['isAuthenticated'](),controller[_0xaf1b('0x7')]);module[_0xaf1b('0x8')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index efec028..3beabcf 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 _0x2ccb=['format','kill','pid','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','../../config/logger','api','util','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','catch','json','killProcess','components/import/cm','params','then','split','length','indexOf'];(function(_0x35f687,_0x4238ea){var _0x108ffd=function(_0x5190d8){while(--_0x5190d8){_0x35f687['push'](_0x35f687['shift']());}};_0x108ffd(++_0x4238ea);}(_0x2ccb,0x1a5));var _0xb2cc=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x2ccb[_0x53ccf2];return _0x5a2964;};'use strict';var info=require(_0xb2cc('0x0'));var exec=require(_0xb2cc('0x1'))['exec'];var logger=require(_0xb2cc('0x2'))(_0xb2cc('0x3'));var util=require(_0xb2cc('0x4'));var BPromise=require('bluebird');var _=require('lodash');function handleError(_0x4aa565,_0x47c727,_0x352c5f){_0x47c727=_0x47c727||0x1f4;return function(_0xb3f9de){logger[_0xb2cc('0x5')](_0xb2cc('0x6'),_0x352c5f,_0x47c727,util[_0xb2cc('0x7')](_0xb3f9de,{'showHidden':![],'depth':null}));delete _0xb3f9de[_0xb2cc('0x8')];_0x4aa565[_0xb2cc('0x9')](_0x47c727)[_0xb2cc('0xa')](_0xb3f9de);};}exports[_0xb2cc('0xb')]=function(_0x4d727e,_0x474b1a){return info['getAllData']()['then'](function(_0x33694c){return _0x474b1a[_0xb2cc('0x9')](0xc8)['json'](_0x33694c);})[_0xb2cc('0xc')](function(_0x2e28dd){return _0x474b1a['status'](0x1f4)[_0xb2cc('0xd')](_0x2e28dd);});};exports[_0xb2cc('0xe')]=function(_0x1f8826,_0x55269a){var _0xcefb5d=[_0xb2cc('0xf')];return new BPromise(function(_0x394fbe,_0x2b1901){return exec(util['format']('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x1f8826[_0xb2cc('0x10')]['pid']),function(_0x15afb9,_0x388620,_0x3a8414){if(_0x15afb9){return _0x2b1901(_0x15afb9);}return _0x394fbe(_0x388620);});})[_0xb2cc('0x11')](function(_0x5a0760){var _0x451118=![];var _0x148c09=_0x5a0760[_0xb2cc('0x12')](/\n/);for(var _0x2c4053=0x0,_0x5e9ced=_0xcefb5d[_0xb2cc('0x13')];_0x2c4053<_0x5e9ced,_0x451118===![];_0x2c4053+=0x1){if(_0x5a0760[_0xb2cc('0x14')](_0xcefb5d[_0x2c4053])>=0x0){_0x451118=!![];}}if(!_0x451118){throw new Error(util[_0xb2cc('0x15')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x1f8826['params']['pid']));}process[_0xb2cc('0x16')](_0x1f8826['params'][_0xb2cc('0x17')],_0xb2cc('0x18'));return _0x55269a[_0xb2cc('0x9')](0xc8)[_0xb2cc('0xd')]({'message':util['format'](_0xb2cc('0x19'),_0x1f8826['params']['pid'])});})[_0xb2cc('0xc')](handleError(_0x55269a,null,_0xb2cc('0xe')));}; \ No newline at end of file +var _0x0539=['bluebird','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','index','getAllData','then','json','catch','status','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','child_process','exec','../../config/logger','api','util'];(function(_0x17f145,_0x3422bb){var _0x2d5420=function(_0x3eb38b){while(--_0x3eb38b){_0x17f145['push'](_0x17f145['shift']());}};_0x2d5420(++_0x3422bb);}(_0x0539,0x167));var _0x9053=function(_0x1d64ca,_0x33ef2a){_0x1d64ca=_0x1d64ca-0x0;var _0x14e41c=_0x0539[_0x1d64ca];return _0x14e41c;};'use strict';var info=require('systeminformation');var exec=require(_0x9053('0x0'))[_0x9053('0x1')];var logger=require(_0x9053('0x2'))(_0x9053('0x3'));var util=require(_0x9053('0x4'));var BPromise=require(_0x9053('0x5'));var _=require(_0x9053('0x6'));function handleError(_0x343fb3,_0x2d82b8,_0x1fb383){_0x2d82b8=_0x2d82b8||0x1f4;return function(_0x1a44e1){logger['error'](_0x9053('0x7'),_0x1fb383,_0x2d82b8,util[_0x9053('0x8')](_0x1a44e1,{'showHidden':![],'depth':null}));delete _0x1a44e1['name'];_0x343fb3['status'](_0x2d82b8)['send'](_0x1a44e1);};}exports[_0x9053('0x9')]=function(_0x1b78b2,_0x4f5823){return info[_0x9053('0xa')]()[_0x9053('0xb')](function(_0x18005a){return _0x4f5823['status'](0xc8)[_0x9053('0xc')](_0x18005a);})[_0x9053('0xd')](function(_0x46fc2a){return _0x4f5823[_0x9053('0xe')](0x1f4)['json'](_0x46fc2a);});};exports[_0x9053('0xf')]=function(_0x4ad2b3,_0xd32b9a){var _0x1d6e46=[_0x9053('0x10')];return new BPromise(function(_0x5df978,_0x775c72){return exec(util[_0x9053('0x11')](_0x9053('0x12'),_0x4ad2b3[_0x9053('0x13')][_0x9053('0x14')]),function(_0x2be589,_0x1809ed,_0x2ca49f){if(_0x2be589){return _0x775c72(_0x2be589);}return _0x5df978(_0x1809ed);});})[_0x9053('0xb')](function(_0x187cd8){var _0x1f9c40=![];var _0x4d234=_0x187cd8[_0x9053('0x15')](/\n/);for(var _0x21e4d7=0x0,_0x4837b5=_0x1d6e46[_0x9053('0x16')];_0x21e4d7<_0x4837b5,_0x1f9c40===![];_0x21e4d7+=0x1){if(_0x187cd8[_0x9053('0x17')](_0x1d6e46[_0x21e4d7])>=0x0){_0x1f9c40=!![];}}if(!_0x1f9c40){throw new Error(util[_0x9053('0x11')](_0x9053('0x18'),_0x4ad2b3['params']['pid']));}process[_0x9053('0x19')](_0x4ad2b3['params']['pid'],_0x9053('0x1a'));return _0xd32b9a[_0x9053('0xe')](0xc8)[_0x9053('0xc')]({'message':util[_0x9053('0x11')](_0x9053('0x1b'),_0x4ad2b3[_0x9053('0x13')][_0x9053('0x14')])});})['catch'](handleError(_0xd32b9a,null,_0x9053('0xf')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 6729c05..9d7afec 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 _0x3b90=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./tag.controller','isAuthenticated','index','get','/:id','show','post','update','delete','destroy','exports'];(function(_0x5275b8,_0x51e5dd){var _0x568a9b=function(_0x583a71){while(--_0x583a71){_0x5275b8['push'](_0x5275b8['shift']());}};_0x568a9b(++_0x51e5dd);}(_0x3b90,0x143));var _0x03b9=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x3b90[_0x278e3c];return _0x3e2d9b;};'use strict';var multer=require('multer');var util=require(_0x03b9('0x0'));var path=require(_0x03b9('0x1'));var timeout=require(_0x03b9('0x2'));var express=require(_0x03b9('0x3'));var router=express[_0x03b9('0x4')]();var fs_extra=require(_0x03b9('0x5'));var auth=require(_0x03b9('0x6'));var interaction=require(_0x03b9('0x7'));var config=require('../../config/environment');var controller=require(_0x03b9('0x8'));router['get']('/',auth[_0x03b9('0x9')](),controller[_0x03b9('0xa')]);router[_0x03b9('0xb')](_0x03b9('0xc'),auth[_0x03b9('0x9')](),controller[_0x03b9('0xd')]);router[_0x03b9('0xe')]('/',auth[_0x03b9('0x9')](),controller['create']);router['put']('/:id',auth[_0x03b9('0x9')](),controller[_0x03b9('0xf')]);router[_0x03b9('0x10')](_0x03b9('0xc'),auth['isAuthenticated'](),controller[_0x03b9('0x11')]);module[_0x03b9('0x12')]=router; \ No newline at end of file +var _0xb876=['util','path','connect-timeout','Router','../../components/auth/service','./tag.controller','index','get','show','post','create','put','/:id','isAuthenticated','update','delete','destroy','exports'];(function(_0x4ece3b,_0x26c642){var _0x176a4c=function(_0x2d1f0d){while(--_0x2d1f0d){_0x4ece3b['push'](_0x4ece3b['shift']());}};_0x176a4c(++_0x26c642);}(_0xb876,0xb4));var _0x6b87=function(_0x52c67e,_0x3c237a){_0x52c67e=_0x52c67e-0x0;var _0x3f68dc=_0xb876[_0x52c67e];return _0x3f68dc;};'use strict';var multer=require('multer');var util=require(_0x6b87('0x0'));var path=require(_0x6b87('0x1'));var timeout=require(_0x6b87('0x2'));var express=require('express');var router=express[_0x6b87('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6b87('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6b87('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x6b87('0x6')]);router[_0x6b87('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x6b87('0x8')]);router[_0x6b87('0x9')]('/',auth['isAuthenticated'](),controller[_0x6b87('0xa')]);router[_0x6b87('0xb')](_0x6b87('0xc'),auth[_0x6b87('0xd')](),controller[_0x6b87('0xe')]);router[_0x6b87('0xf')](_0x6b87('0xc'),auth[_0x6b87('0xd')](),controller[_0x6b87('0x10')]);module[_0x6b87('0x11')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index b930043..1a866b3 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 _0x84a0=['name','#0091EA','sequelize','exports','STRING'];(function(_0x399ba6,_0x4ac58d){var _0x30ee57=function(_0x1df79a){while(--_0x1df79a){_0x399ba6['push'](_0x399ba6['shift']());}};_0x30ee57(++_0x4ac58d);}(_0x84a0,0x66));var _0x084a=function(_0x368161,_0x56df36){_0x368161=_0x368161-0x0;var _0x5f50e2=_0x84a0[_0x368161];return _0x5f50e2;};'use strict';var Sequelize=require(_0x084a('0x0'));module[_0x084a('0x1')]={'name':{'type':Sequelize[_0x084a('0x2')],'unique':_0x084a('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x084a('0x4')},'description':{'type':Sequelize[_0x084a('0x2')]}}; \ No newline at end of file +var _0xb7aa=['name','#0091EA','sequelize','exports','STRING'];(function(_0x47de66,_0xfc1685){var _0x295b17=function(_0x4c39f8){while(--_0x4c39f8){_0x47de66['push'](_0x47de66['shift']());}};_0x295b17(++_0xfc1685);}(_0xb7aa,0x11a));var _0xab7a=function(_0xdbfea3,_0x36fcd8){_0xdbfea3=_0xdbfea3-0x0;var _0x3777d3=_0xb7aa[_0xdbfea3];return _0x3777d3;};'use strict';var Sequelize=require(_0xab7a('0x0'));module[_0xab7a('0x1')]={'name':{'type':Sequelize[_0xab7a('0x2')],'unique':_0xab7a('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xab7a('0x2')],'defaultValue':_0xab7a('0x4')},'description':{'type':Sequelize[_0xab7a('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 9e303ee..9f9c063 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 _0x0eaa=['Tag','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','merge','map','VIRTUAL','filter','options','includeAll','include','findAll','show','params','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','Tags','UserProfileResource','error','stack','name','index'];(function(_0x5b5912,_0x3fa616){var _0x35c566=function(_0x50b2d3){while(--_0x50b2d3){_0x5b5912['push'](_0x5b5912['shift']());}};_0x35c566(++_0x3fa616);}(_0x0eaa,0x1c5));var _0xa0ea=function(_0x46fc6c,_0x297637){_0x46fc6c=_0x46fc6c-0x0;var _0x18694f=_0x0eaa[_0x46fc6c];return _0x18694f;};'use strict';var emlformat=require(_0xa0ea('0x0'));var rimraf=require(_0xa0ea('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa0ea('0x2'));var moment=require(_0xa0ea('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa0ea('0x4'));var util=require(_0xa0ea('0x5'));var path=require(_0xa0ea('0x6'));var sox=require(_0xa0ea('0x7'));var csv=require(_0xa0ea('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa0ea('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa0ea('0xa'));var jsforce=require(_0xa0ea('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa0ea('0xc'));var Papa=require(_0xa0ea('0xd'));var Redis=require(_0xa0ea('0xe'));var authService=require(_0xa0ea('0xf'));var qs=require(_0xa0ea('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa0ea('0x11'));var logger=require(_0xa0ea('0x12'))(_0xa0ea('0x13'));var utils=require(_0xa0ea('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa0ea('0x15'));var db=require(_0xa0ea('0x16'))['db'];function respondWithStatusCode(_0x43b1b5,_0x41216c){_0x41216c=_0x41216c||0xcc;return function(_0x3eda1d){if(_0x3eda1d){return _0x43b1b5['sendStatus'](_0x41216c);}return _0x43b1b5[_0xa0ea('0x17')](_0x41216c)[_0xa0ea('0x18')]();};}function respondWithResult(_0x58c0fa,_0x3970e5){_0x3970e5=_0x3970e5||0xc8;return function(_0x183062){if(_0x183062){return _0x58c0fa[_0xa0ea('0x17')](_0x3970e5)[_0xa0ea('0x19')](_0x183062);}};}function respondWithFilteredResult(_0x4d7f34,_0x128680){return function(_0x67dc10){if(_0x67dc10){var _0x4274c2=typeof _0x128680[_0xa0ea('0x1a')]===_0xa0ea('0x1b')&&typeof _0x128680[_0xa0ea('0x1c')]===_0xa0ea('0x1b');var _0x324555=_0x67dc10[_0xa0ea('0x1d')];var _0x405f7f=_0x4274c2?0x0:_0x128680['offset'];var _0x4ca082=_0x4274c2?_0x67dc10[_0xa0ea('0x1d')]:_0x128680[_0xa0ea('0x1a')]+_0x128680[_0xa0ea('0x1c')];var _0x1887c3;if(_0x4ca082>=_0x324555){_0x4ca082=_0x324555;_0x1887c3=0xc8;}else{_0x1887c3=0xce;}_0x4d7f34[_0xa0ea('0x17')](_0x1887c3);return _0x4d7f34[_0xa0ea('0x1e')](_0xa0ea('0x1f'),_0x405f7f+'-'+_0x4ca082+'/'+_0x324555)['json'](_0x67dc10);}return null;};}function patchUpdates(_0x916f1){return function(_0x2f8518){try{jsonpatch[_0xa0ea('0x20')](_0x2f8518,_0x916f1,!![]);}catch(_0x592dec){return BPromise[_0xa0ea('0x21')](_0x592dec);}return _0x2f8518[_0xa0ea('0x22')]();};}function saveUpdates(_0x45fda4,_0x12cda2){return function(_0x2b5af5){if(_0x2b5af5){return _0x2b5af5[_0xa0ea('0x23')](_0x45fda4)['then'](function(_0x35faa4){return _0x35faa4;});}return null;};}function removeEntity(_0x5c0ec3,_0x4d494e){return function(_0x259175){if(_0x259175){return _0x259175[_0xa0ea('0x24')]()[_0xa0ea('0x25')](function(){var _0x51b5e0=_0x259175[_0xa0ea('0x26')]({'plain':!![]});var _0x5d2d73=_0xa0ea('0x27');return db[_0xa0ea('0x28')][_0xa0ea('0x24')]({'where':{'type':_0x5d2d73,'resourceId':_0x51b5e0['id']}})[_0xa0ea('0x25')](function(){return _0x259175;});})[_0xa0ea('0x25')](function(){_0x5c0ec3[_0xa0ea('0x17')](0xcc)[_0xa0ea('0x18')]();});}};}function handleEntityNotFound(_0x287728,_0x380e09){return function(_0x208c8){if(!_0x208c8){_0x287728['sendStatus'](0x194);}return _0x208c8;};}function handleError(_0x15534e,_0x4f1acd){_0x4f1acd=_0x4f1acd||0x1f4;return function(_0x21640c){logger[_0xa0ea('0x29')](_0x21640c[_0xa0ea('0x2a')]);if(_0x21640c[_0xa0ea('0x2b')]){delete _0x21640c[_0xa0ea('0x2b')];}_0x15534e[_0xa0ea('0x17')](_0x4f1acd)['send'](_0x21640c);};}exports[_0xa0ea('0x2c')]=function(_0x5903ff,_0x210ce3){var _0x5db75e={},_0x35186b={},_0x1cb9f1={'count':0x0,'rows':[]};var _0x43a306=_['map'](db[_0xa0ea('0x2d')][_0xa0ea('0x2e')],function(_0x502df5){return{'name':_0x502df5[_0xa0ea('0x2f')],'type':_0x502df5[_0xa0ea('0x30')][_0xa0ea('0x31')]};});_0x35186b['model']=_['map'](_0x43a306,_0xa0ea('0x2b'));_0x35186b[_0xa0ea('0x32')]=_[_0xa0ea('0x33')](_0x5903ff['query']);_0x35186b[_0xa0ea('0x34')]=_[_0xa0ea('0x35')](_0x35186b[_0xa0ea('0x36')],_0x35186b[_0xa0ea('0x32')]);_0x5db75e[_0xa0ea('0x37')]=_['intersection'](_0x35186b['model'],qs[_0xa0ea('0x38')](_0x5903ff['query'][_0xa0ea('0x38')]));_0x5db75e[_0xa0ea('0x37')]=_0x5db75e[_0xa0ea('0x37')][_0xa0ea('0x39')]?_0x5db75e[_0xa0ea('0x37')]:_0x35186b['model'];if(!_0x5903ff[_0xa0ea('0x32')][_0xa0ea('0x3a')](_0xa0ea('0x3b'))){_0x5db75e[_0xa0ea('0x1c')]=qs[_0xa0ea('0x1c')](_0x5903ff[_0xa0ea('0x32')][_0xa0ea('0x1c')]);_0x5db75e[_0xa0ea('0x1a')]=qs[_0xa0ea('0x1a')](_0x5903ff[_0xa0ea('0x32')]['offset']);}_0x5db75e[_0xa0ea('0x3c')]=qs['sort'](_0x5903ff[_0xa0ea('0x32')]['sort']);_0x5db75e[_0xa0ea('0x3d')]=qs['filters'](_[_0xa0ea('0x3e')](_0x5903ff[_0xa0ea('0x32')],_0x35186b[_0xa0ea('0x34')]),_0x43a306);if(_0x5903ff[_0xa0ea('0x32')]['filter']){_0x5db75e[_0xa0ea('0x3d')]=_[_0xa0ea('0x3f')](_0x5db75e[_0xa0ea('0x3d')],{'$or':_[_0xa0ea('0x40')](_0x43a306,function(_0x2f1a35){if(_0x2f1a35[_0xa0ea('0x30')]!==_0xa0ea('0x41')){var _0x24ac13={};_0x24ac13[_0x2f1a35[_0xa0ea('0x2b')]]={'$like':'%'+_0x5903ff['query'][_0xa0ea('0x42')]+'%'};return _0x24ac13;}})});}_0x5db75e=_['merge']({},_0x5db75e,_0x5903ff[_0xa0ea('0x43')]);var _0x2b4fb4={'where':_0x5db75e[_0xa0ea('0x3d')]};return db[_0xa0ea('0x2d')][_0xa0ea('0x1d')](_0x2b4fb4)[_0xa0ea('0x25')](function(_0x209081){_0x1cb9f1[_0xa0ea('0x1d')]=_0x209081;if(_0x5903ff[_0xa0ea('0x32')][_0xa0ea('0x44')]){_0x5db75e[_0xa0ea('0x45')]=[{'all':!![]}];}return db[_0xa0ea('0x2d')][_0xa0ea('0x46')](_0x5db75e);})[_0xa0ea('0x25')](function(_0x3139ad){_0x1cb9f1['rows']=_0x3139ad;return _0x1cb9f1;})[_0xa0ea('0x25')](respondWithFilteredResult(_0x210ce3,_0x5db75e))['catch'](handleError(_0x210ce3,null));};exports[_0xa0ea('0x47')]=function(_0x59e305,_0x52ef60){var _0x5c3e6c={'raw':!![],'where':{'id':_0x59e305[_0xa0ea('0x48')]['id']}},_0x53606e={};_0x53606e[_0xa0ea('0x36')]=_['keys'](db[_0xa0ea('0x2d')][_0xa0ea('0x2e')]);_0x53606e[_0xa0ea('0x32')]=_['keys'](_0x59e305['query']);_0x53606e['filters']=_[_0xa0ea('0x35')](_0x53606e[_0xa0ea('0x36')],_0x53606e[_0xa0ea('0x32')]);_0x5c3e6c[_0xa0ea('0x37')]=_[_0xa0ea('0x35')](_0x53606e[_0xa0ea('0x36')],qs[_0xa0ea('0x38')](_0x59e305[_0xa0ea('0x32')][_0xa0ea('0x38')]));_0x5c3e6c[_0xa0ea('0x37')]=_0x5c3e6c[_0xa0ea('0x37')][_0xa0ea('0x39')]?_0x5c3e6c['attributes']:_0x53606e[_0xa0ea('0x36')];if(_0x59e305[_0xa0ea('0x32')][_0xa0ea('0x44')]){_0x5c3e6c[_0xa0ea('0x45')]=[{'all':!![]}];}_0x5c3e6c=_['merge']({},_0x5c3e6c,_0x59e305['options']);return db[_0xa0ea('0x2d')][_0xa0ea('0x49')](_0x5c3e6c)[_0xa0ea('0x25')](handleEntityNotFound(_0x52ef60,null))[_0xa0ea('0x25')](respondWithResult(_0x52ef60,null))[_0xa0ea('0x4a')](handleError(_0x52ef60,null));};exports[_0xa0ea('0x4b')]=function(_0x219540,_0x361210){return db[_0xa0ea('0x2d')][_0xa0ea('0x4b')](_0x219540['body'],{})[_0xa0ea('0x25')](function(_0x20061e){var _0x3fd22b=_0x219540[_0xa0ea('0x4c')][_0xa0ea('0x26')]({'plain':!![]});if(!_0x3fd22b)throw new Error(_0xa0ea('0x4d'));if(_0x3fd22b[_0xa0ea('0x4e')]==='user'){var _0x140155=_0x20061e[_0xa0ea('0x26')]({'plain':!![]});var _0x4e8e57=_0xa0ea('0x27');return db['UserProfileSection'][_0xa0ea('0x49')]({'where':{'name':_0x4e8e57,'userProfileId':_0x3fd22b[_0xa0ea('0x4f')]},'raw':!![]})[_0xa0ea('0x25')](function(_0x362613){if(_0x362613&&_0x362613[_0xa0ea('0x50')]===0x0){return db['UserProfileResource'][_0xa0ea('0x4b')]({'name':_0x140155['name'],'resourceId':_0x140155['id'],'type':_0x362613[_0xa0ea('0x2b')],'sectionId':_0x362613['id']},{})['then'](function(){return _0x20061e;});}else{return _0x20061e;}})[_0xa0ea('0x4a')](function(_0x18c602){logger['error'](_0xa0ea('0x51'),_0x18c602);throw _0x18c602;});}return _0x20061e;})[_0xa0ea('0x25')](respondWithResult(_0x361210,0xc9))[_0xa0ea('0x4a')](handleError(_0x361210,null));};exports['update']=function(_0x2b4d7c,_0x4853fe){if(_0x2b4d7c[_0xa0ea('0x52')]['id']){delete _0x2b4d7c[_0xa0ea('0x52')]['id'];}return db[_0xa0ea('0x2d')][_0xa0ea('0x49')]({'where':{'id':_0x2b4d7c[_0xa0ea('0x48')]['id']}})['then'](handleEntityNotFound(_0x4853fe,null))[_0xa0ea('0x25')](saveUpdates(_0x2b4d7c['body'],null))['then'](respondWithResult(_0x4853fe,null))[_0xa0ea('0x4a')](handleError(_0x4853fe,null));};exports[_0xa0ea('0x24')]=function(_0x6059b4,_0x4c8aa7){return db[_0xa0ea('0x2d')][_0xa0ea('0x49')]({'where':{'id':_0x6059b4[_0xa0ea('0x48')]['id']}})[_0xa0ea('0x25')](handleEntityNotFound(_0x4c8aa7,null))[_0xa0ea('0x25')](removeEntity(_0x4c8aa7,null))[_0xa0ea('0x4a')](handleError(_0x4c8aa7,null));}; \ No newline at end of file +var _0xadb8=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','Tags','UserProfileResource','end','sendStatus','error','stack','name','send','Tag','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','nolimit','order','where','pick','merge','VIRTUAL','filter','includeAll','include','params','options','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis'];(function(_0xe32bc8,_0x44287e){var _0x1ff259=function(_0x4706d6){while(--_0x4706d6){_0xe32bc8['push'](_0xe32bc8['shift']());}};_0x1ff259(++_0x44287e);}(_0xadb8,0x1d0));var _0x8adb=function(_0x2b85d5,_0x3115b7){_0x2b85d5=_0x2b85d5-0x0;var _0xe8c96f=_0xadb8[_0x2b85d5];return _0xe8c96f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8adb('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8adb('0x1'));var moment=require(_0x8adb('0x2'));var BPromise=require(_0x8adb('0x3'));var Mustache=require(_0x8adb('0x4'));var util=require(_0x8adb('0x5'));var path=require(_0x8adb('0x6'));var sox=require(_0x8adb('0x7'));var csv=require('to-csv');var ejs=require(_0x8adb('0x8'));var fs=require('fs');var fs_extra=require(_0x8adb('0x9'));var _=require(_0x8adb('0xa'));var squel=require(_0x8adb('0xb'));var crypto=require(_0x8adb('0xc'));var jsforce=require(_0x8adb('0xd'));var deskjs=require(_0x8adb('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8adb('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8adb('0x10'));var logger=require(_0x8adb('0x11'))(_0x8adb('0x12'));var utils=require(_0x8adb('0x13'));var config=require(_0x8adb('0x14'));var licenseUtil=require(_0x8adb('0x15'));var db=require(_0x8adb('0x16'))['db'];function respondWithStatusCode(_0x2828f1,_0x2d6b55){_0x2d6b55=_0x2d6b55||0xcc;return function(_0x8c6c39){if(_0x8c6c39){return _0x2828f1['sendStatus'](_0x2d6b55);}return _0x2828f1['status'](_0x2d6b55)['end']();};}function respondWithResult(_0x122b37,_0x4ff3c3){_0x4ff3c3=_0x4ff3c3||0xc8;return function(_0xe9280c){if(_0xe9280c){return _0x122b37[_0x8adb('0x17')](_0x4ff3c3)[_0x8adb('0x18')](_0xe9280c);}};}function respondWithFilteredResult(_0x52e1d9,_0x20add0){return function(_0x117054){if(_0x117054){var _0x1096fb=typeof _0x20add0[_0x8adb('0x19')]===_0x8adb('0x1a')&&typeof _0x20add0[_0x8adb('0x1b')]==='undefined';var _0xc01052=_0x117054[_0x8adb('0x1c')];var _0x4ba298=_0x1096fb?0x0:_0x20add0['offset'];var _0x18897e=_0x1096fb?_0x117054[_0x8adb('0x1c')]:_0x20add0[_0x8adb('0x19')]+_0x20add0[_0x8adb('0x1b')];var _0x46bce0;if(_0x18897e>=_0xc01052){_0x18897e=_0xc01052;_0x46bce0=0xc8;}else{_0x46bce0=0xce;}_0x52e1d9[_0x8adb('0x17')](_0x46bce0);return _0x52e1d9[_0x8adb('0x1d')](_0x8adb('0x1e'),_0x4ba298+'-'+_0x18897e+'/'+_0xc01052)[_0x8adb('0x18')](_0x117054);}return null;};}function patchUpdates(_0x2a322d){return function(_0x36c62a){try{jsonpatch[_0x8adb('0x1f')](_0x36c62a,_0x2a322d,!![]);}catch(_0x4a1a84){return BPromise['reject'](_0x4a1a84);}return _0x36c62a[_0x8adb('0x20')]();};}function saveUpdates(_0x3d37db,_0x4f33e7){return function(_0x37b0a4){if(_0x37b0a4){return _0x37b0a4[_0x8adb('0x21')](_0x3d37db)[_0x8adb('0x22')](function(_0x184c2a){return _0x184c2a;});}return null;};}function removeEntity(_0x11c2e8,_0x28d5cd){return function(_0x542156){if(_0x542156){return _0x542156[_0x8adb('0x23')]()[_0x8adb('0x22')](function(){var _0x234ef2=_0x542156['get']({'plain':!![]});var _0x5c8c18=_0x8adb('0x24');return db[_0x8adb('0x25')][_0x8adb('0x23')]({'where':{'type':_0x5c8c18,'resourceId':_0x234ef2['id']}})[_0x8adb('0x22')](function(){return _0x542156;});})[_0x8adb('0x22')](function(){_0x11c2e8['status'](0xcc)[_0x8adb('0x26')]();});}};}function handleEntityNotFound(_0x16f724,_0x18f94e){return function(_0x44f242){if(!_0x44f242){_0x16f724[_0x8adb('0x27')](0x194);}return _0x44f242;};}function handleError(_0x4aca77,_0x3faee9){_0x3faee9=_0x3faee9||0x1f4;return function(_0x5c5a7b){logger[_0x8adb('0x28')](_0x5c5a7b[_0x8adb('0x29')]);if(_0x5c5a7b[_0x8adb('0x2a')]){delete _0x5c5a7b[_0x8adb('0x2a')];}_0x4aca77['status'](_0x3faee9)[_0x8adb('0x2b')](_0x5c5a7b);};}exports['index']=function(_0x2c582b,_0x1ac23e){var _0x12f552={},_0x13a887={},_0x56f8a4={'count':0x0,'rows':[]};var _0x279cd8=_['map'](db[_0x8adb('0x2c')]['rawAttributes'],function(_0x1d4962){return{'name':_0x1d4962[_0x8adb('0x2d')],'type':_0x1d4962[_0x8adb('0x2e')][_0x8adb('0x2f')]};});_0x13a887[_0x8adb('0x30')]=_[_0x8adb('0x31')](_0x279cd8,'name');_0x13a887['query']=_[_0x8adb('0x32')](_0x2c582b[_0x8adb('0x33')]);_0x13a887[_0x8adb('0x34')]=_[_0x8adb('0x35')](_0x13a887[_0x8adb('0x30')],_0x13a887[_0x8adb('0x33')]);_0x12f552[_0x8adb('0x36')]=_[_0x8adb('0x35')](_0x13a887[_0x8adb('0x30')],qs[_0x8adb('0x37')](_0x2c582b[_0x8adb('0x33')][_0x8adb('0x37')]));_0x12f552[_0x8adb('0x36')]=_0x12f552['attributes'][_0x8adb('0x38')]?_0x12f552[_0x8adb('0x36')]:_0x13a887['model'];if(!_0x2c582b[_0x8adb('0x33')]['hasOwnProperty'](_0x8adb('0x39'))){_0x12f552[_0x8adb('0x1b')]=qs[_0x8adb('0x1b')](_0x2c582b[_0x8adb('0x33')][_0x8adb('0x1b')]);_0x12f552['offset']=qs[_0x8adb('0x19')](_0x2c582b['query'][_0x8adb('0x19')]);}_0x12f552[_0x8adb('0x3a')]=qs['sort'](_0x2c582b[_0x8adb('0x33')]['sort']);_0x12f552[_0x8adb('0x3b')]=qs['filters'](_[_0x8adb('0x3c')](_0x2c582b[_0x8adb('0x33')],_0x13a887[_0x8adb('0x34')]),_0x279cd8);if(_0x2c582b['query']['filter']){_0x12f552[_0x8adb('0x3b')]=_[_0x8adb('0x3d')](_0x12f552['where'],{'$or':_[_0x8adb('0x31')](_0x279cd8,function(_0x13589b){if(_0x13589b[_0x8adb('0x2e')]!==_0x8adb('0x3e')){var _0x922b58={};_0x922b58[_0x13589b[_0x8adb('0x2a')]]={'$like':'%'+_0x2c582b[_0x8adb('0x33')][_0x8adb('0x3f')]+'%'};return _0x922b58;}})});}_0x12f552=_['merge']({},_0x12f552,_0x2c582b['options']);var _0x3f69b3={'where':_0x12f552[_0x8adb('0x3b')]};return db[_0x8adb('0x2c')][_0x8adb('0x1c')](_0x3f69b3)['then'](function(_0x29d16d){_0x56f8a4['count']=_0x29d16d;if(_0x2c582b[_0x8adb('0x33')][_0x8adb('0x40')]){_0x12f552[_0x8adb('0x41')]=[{'all':!![]}];}return db[_0x8adb('0x2c')]['findAll'](_0x12f552);})['then'](function(_0x213c23){_0x56f8a4['rows']=_0x213c23;return _0x56f8a4;})[_0x8adb('0x22')](respondWithFilteredResult(_0x1ac23e,_0x12f552))['catch'](handleError(_0x1ac23e,null));};exports['show']=function(_0x18984a,_0x24feeb){var _0x5061d9={'raw':!![],'where':{'id':_0x18984a[_0x8adb('0x42')]['id']}},_0x3fb9e0={};_0x3fb9e0[_0x8adb('0x30')]=_[_0x8adb('0x32')](db[_0x8adb('0x2c')]['rawAttributes']);_0x3fb9e0[_0x8adb('0x33')]=_['keys'](_0x18984a[_0x8adb('0x33')]);_0x3fb9e0[_0x8adb('0x34')]=_['intersection'](_0x3fb9e0['model'],_0x3fb9e0[_0x8adb('0x33')]);_0x5061d9['attributes']=_[_0x8adb('0x35')](_0x3fb9e0[_0x8adb('0x30')],qs[_0x8adb('0x37')](_0x18984a[_0x8adb('0x33')]['fields']));_0x5061d9[_0x8adb('0x36')]=_0x5061d9[_0x8adb('0x36')]['length']?_0x5061d9['attributes']:_0x3fb9e0[_0x8adb('0x30')];if(_0x18984a[_0x8adb('0x33')][_0x8adb('0x40')]){_0x5061d9['include']=[{'all':!![]}];}_0x5061d9=_[_0x8adb('0x3d')]({},_0x5061d9,_0x18984a[_0x8adb('0x43')]);return db[_0x8adb('0x2c')][_0x8adb('0x44')](_0x5061d9)[_0x8adb('0x22')](handleEntityNotFound(_0x24feeb,null))[_0x8adb('0x22')](respondWithResult(_0x24feeb,null))[_0x8adb('0x45')](handleError(_0x24feeb,null));};exports[_0x8adb('0x46')]=function(_0xc2861b,_0xe725e9){return db[_0x8adb('0x2c')][_0x8adb('0x46')](_0xc2861b['body'],{})[_0x8adb('0x22')](function(_0x33c28c){var _0x35ef9d=_0xc2861b[_0x8adb('0x47')][_0x8adb('0x48')]({'plain':!![]});if(!_0x35ef9d)throw new Error(_0x8adb('0x49'));if(_0x35ef9d[_0x8adb('0x4a')]===_0x8adb('0x47')){var _0x276af8=_0x33c28c[_0x8adb('0x48')]({'plain':!![]});var _0x52daa7=_0x8adb('0x24');return db[_0x8adb('0x4b')][_0x8adb('0x44')]({'where':{'name':_0x52daa7,'userProfileId':_0x35ef9d[_0x8adb('0x4c')]},'raw':!![]})[_0x8adb('0x22')](function(_0x12b242){if(_0x12b242&&_0x12b242[_0x8adb('0x4d')]===0x0){return db[_0x8adb('0x25')]['create']({'name':_0x276af8[_0x8adb('0x2a')],'resourceId':_0x276af8['id'],'type':_0x12b242[_0x8adb('0x2a')],'sectionId':_0x12b242['id']},{})[_0x8adb('0x22')](function(){return _0x33c28c;});}else{return _0x33c28c;}})[_0x8adb('0x45')](function(_0x4bba0e){logger[_0x8adb('0x28')](_0x8adb('0x4e'),_0x4bba0e);throw _0x4bba0e;});}return _0x33c28c;})[_0x8adb('0x22')](respondWithResult(_0xe725e9,0xc9))[_0x8adb('0x45')](handleError(_0xe725e9,null));};exports['update']=function(_0x415dc0,_0x34eb4d){if(_0x415dc0[_0x8adb('0x4f')]['id']){delete _0x415dc0[_0x8adb('0x4f')]['id'];}return db[_0x8adb('0x2c')][_0x8adb('0x44')]({'where':{'id':_0x415dc0[_0x8adb('0x42')]['id']}})[_0x8adb('0x22')](handleEntityNotFound(_0x34eb4d,null))[_0x8adb('0x22')](saveUpdates(_0x415dc0[_0x8adb('0x4f')],null))[_0x8adb('0x22')](respondWithResult(_0x34eb4d,null))[_0x8adb('0x45')](handleError(_0x34eb4d,null));};exports['destroy']=function(_0x4329b0,_0x492a60){return db['Tag'][_0x8adb('0x44')]({'where':{'id':_0x4329b0[_0x8adb('0x42')]['id']}})['then'](handleEntityNotFound(_0x492a60,null))[_0x8adb('0x22')](removeEntity(_0x492a60,null))[_0x8adb('0x45')](handleError(_0x492a60,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index aab7a4b..0b646cf 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 _0xafe5=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes','exports','define','Tag','tools_tags'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xafe5,0x1dc));var _0x5afe=function(_0x25726d,_0xd4d48c){_0x25726d=_0x25726d-0x0;var _0x4b055e=_0xafe5[_0x25726d];return _0x4b055e;};'use strict';var _=require(_0x5afe('0x0'));var util=require(_0x5afe('0x1'));var logger=require(_0x5afe('0x2'))('api');var moment=require(_0x5afe('0x3'));var BPromise=require(_0x5afe('0x4'));var rp=require(_0x5afe('0x5'));var fs=require('fs');var path=require(_0x5afe('0x6'));var rimraf=require(_0x5afe('0x7'));var config=require(_0x5afe('0x8'));var attributes=require(_0x5afe('0x9'));module[_0x5afe('0xa')]=function(_0x8de111,_0x4483ef){return _0x8de111[_0x5afe('0xb')](_0x5afe('0xc'),attributes,{'tableName':_0x5afe('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5efc=['bluebird','request-promise','path','rimraf','./tag.attributes','exports','Tag','tools_tags','api','moment'];(function(_0x1eb3f6,_0x3f8dc7){var _0x511f68=function(_0x33d351){while(--_0x33d351){_0x1eb3f6['push'](_0x1eb3f6['shift']());}};_0x511f68(++_0x3f8dc7);}(_0x5efc,0x184));var _0xc5ef=function(_0x2e16b5,_0x8d9512){_0x2e16b5=_0x2e16b5-0x0;var _0x4bd305=_0x5efc[_0x2e16b5];return _0x4bd305;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xc5ef('0x0'));var moment=require(_0xc5ef('0x1'));var BPromise=require(_0xc5ef('0x2'));var rp=require(_0xc5ef('0x3'));var fs=require('fs');var path=require(_0xc5ef('0x4'));var rimraf=require(_0xc5ef('0x5'));var config=require('../../config/environment');var attributes=require(_0xc5ef('0x6'));module[_0xc5ef('0x7')]=function(_0x5757f8,_0x4470c6){return _0x5757f8['define'](_0xc5ef('0x8'),attributes,{'tableName':_0xc5ef('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index 15b706c..1b666de 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 _0xda55=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash'];(function(_0x2cde51,_0x41b85c){var _0x37177e=function(_0x5a68f4){while(--_0x5a68f4){_0x2cde51['push'](_0x2cde51['shift']());}};_0x37177e(++_0x41b85c);}(_0xda55,0x6d));var _0x5da5=function(_0x4bb581,_0x6f7037){_0x4bb581=_0x4bb581-0x0;var _0x316bf5=_0xda55[_0x4bb581];return _0x316bf5;};'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')]('Tag,\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);});});} \ No newline at end of file +var _0x207c=['message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','http','request','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','error'];(function(_0x2922da,_0xc4f951){var _0x4e08db=function(_0x499a79){while(--_0x499a79){_0x2922da['push'](_0x2922da['shift']());}};_0x4e08db(++_0xc4f951);}(_0x207c,0x1e8));var _0xc207=function(_0x2806f6,_0x294105){_0x2806f6=_0x2806f6-0x0;var _0x32ebb1=_0x207c[_0x2806f6];return _0x32ebb1;};'use strict';var _=require('lodash');var util=require(_0xc207('0x0'));var moment=require(_0xc207('0x1'));var BPromise=require(_0xc207('0x2'));var rs=require(_0xc207('0x3'));var fs=require('fs');var Redis=require(_0xc207('0x4'));var db=require(_0xc207('0x5'))['db'];var utils=require(_0xc207('0x6'));var logger=require('../../config/logger')(_0xc207('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xc207('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x314561,_0x3395e4,_0x59ff6f){return new BPromise(function(_0x25cb97,_0xad159b){return client[_0xc207('0x9')](_0x314561,_0x59ff6f)['then'](function(_0xffae6c){logger[_0xc207('0xa')](_0xc207('0xb'),_0x3395e4,_0xc207('0xc'));logger[_0xc207('0xd')](_0xc207('0xe'),_0x3395e4,'request\x20sent',JSON['stringify'](_0xffae6c));if(_0xffae6c['error']){if(_0xffae6c[_0xc207('0xf')]['code']===0x1f4){logger[_0xc207('0xf')](_0xc207('0xb'),_0x3395e4,_0xffae6c['error'][_0xc207('0x10')]);return _0xad159b(_0xffae6c[_0xc207('0xf')][_0xc207('0x10')]);}logger[_0xc207('0xf')](_0xc207('0xb'),_0x3395e4,_0xffae6c['error'][_0xc207('0x10')]);return _0x25cb97(_0xffae6c[_0xc207('0xf')][_0xc207('0x10')]);}else{logger[_0xc207('0xa')]('Tag,\x20%s,\x20%s',_0x3395e4,'request\x20sent');_0x25cb97(_0xffae6c['result'][_0xc207('0x10')]);}})[_0xc207('0x11')](function(_0x3d9c7b){logger[_0xc207('0xf')]('Tag,\x20%s,\x20%s',_0x3395e4,_0x3d9c7b);_0xad159b(_0x3d9c7b);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index bfe698e..aa6a45f 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(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'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(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js index a08dc64..18e87c5 100644 --- a/server/api/team/team.attributes.js +++ b/server/api/team/team.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7e7=['STRING','sequelize'];(function(_0x202d24,_0x5e8641){var _0x2b3a8e=function(_0x4c7c4a){while(--_0x4c7c4a){_0x202d24['push'](_0x202d24['shift']());}};_0x2b3a8e(++_0x5e8641);}(_0xb7e7,0x121));var _0x7b7e=function(_0x5d80de,_0x2cf15d){_0x5d80de=_0x5d80de-0x0;var _0x1c7556=_0xb7e7[_0x5d80de];return _0x1c7556;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file +var _0x2032=['name','exports','STRING'];(function(_0xc4effa,_0x562121){var _0xe1d89b=function(_0x19e4f5){while(--_0x19e4f5){_0xc4effa['push'](_0xc4effa['shift']());}};_0xe1d89b(++_0x562121);}(_0x2032,0xd9));var _0x2203=function(_0x564b05,_0x2371f1){_0x564b05=_0x564b05-0x0;var _0x58b7af=_0x2032[_0x564b05];return _0x58b7af;};'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/team/team.controller.js b/server/api/team/team.controller.js index cebc762..4a7a810 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 _0xc9dd=['fieldName','type','model','keys','filters','attributes','intersection','query','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','fields','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Teams','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','destroy','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','sequelize','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','QueryTypes','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','getQueues','findOne','channel','isValidChannel','capitalize','toLowerCase','addQueues','ValidationError','Unknown\x20channel','Queues','addAgents','ids','Voice','Chat','Mail','Sms','Whatsapp','through','penalty','defaults','TeamVoiceQueue','Queue','findOrCreate','emit','Queue:save','QueueId','User','online','voicePause','interface','UserVoiceQueueRt','upsert','format','SIP/%s','all','isArray','Fax','Queue:remove','removeAgents','getAgents','eml-format','fast-json-patch','request-promise','moment','util','path','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','sendStatus','end','status','offset','undefined','limit','count','set','json','apply','reject','save','update','then','error','stack','name','send','index','map','Team','rawAttributes'];(function(_0x404f55,_0x2814e3){var _0x395a9e=function(_0x5846e9){while(--_0x5846e9){_0x404f55['push'](_0x404f55['shift']());}};_0x395a9e(++_0x2814e3);}(_0xc9dd,0x104));var _0xdc9d=function(_0x4c5375,_0x36b3a3){_0x4c5375=_0x4c5375-0x0;var _0x1aa619=_0xc9dd[_0x4c5375];return _0x1aa619;};'use strict';var emlformat=require(_0xdc9d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xdc9d('0x1'));var rp=require(_0xdc9d('0x2'));var moment=require(_0xdc9d('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xdc9d('0x4'));var path=require(_0xdc9d('0x5'));var sox=require('sox');var csv=require(_0xdc9d('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdc9d('0x7'));var _=require(_0xdc9d('0x8'));var squel=require(_0xdc9d('0x9'));var crypto=require(_0xdc9d('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xdc9d('0x6'));var querystring=require(_0xdc9d('0xb'));var Papa=require(_0xdc9d('0xc'));var Redis=require(_0xdc9d('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xdc9d('0xe'));var as=require(_0xdc9d('0xf'));var hardwareService=require(_0xdc9d('0x10'));var logger=require(_0xdc9d('0x11'))(_0xdc9d('0x12'));var utils=require(_0xdc9d('0x13'));var config=require(_0xdc9d('0x14'));var licenseUtil=require(_0xdc9d('0x15'));var db=require(_0xdc9d('0x16'))['db'];config[_0xdc9d('0x17')]=_['defaults'](config['redis'],{'host':_0xdc9d('0x18'),'port':0x18eb});var socket=require(_0xdc9d('0x19'))(new Redis(config[_0xdc9d('0x17')]));require('./team.socket')['register'](socket);function respondWithStatusCode(_0x10d34b,_0x1bf2e0){_0x1bf2e0=_0x1bf2e0||0xcc;return function(_0x4f09b4){if(_0x4f09b4){return _0x10d34b[_0xdc9d('0x1a')](_0x1bf2e0);}return _0x10d34b['status'](_0x1bf2e0)[_0xdc9d('0x1b')]();};}function respondWithResult(_0x2b48af,_0x15f499){_0x15f499=_0x15f499||0xc8;return function(_0x14d492){if(_0x14d492){return _0x2b48af[_0xdc9d('0x1c')](_0x15f499)['json'](_0x14d492);}};}function respondWithFilteredResult(_0x28675d,_0x3ae2ca){return function(_0x3b8906){if(_0x3b8906){var _0xb9464b=typeof _0x3ae2ca[_0xdc9d('0x1d')]===_0xdc9d('0x1e')&&typeof _0x3ae2ca[_0xdc9d('0x1f')]===_0xdc9d('0x1e');var _0x50dd8d=_0x3b8906[_0xdc9d('0x20')];var _0x13d166=_0xb9464b?0x0:_0x3ae2ca[_0xdc9d('0x1d')];var _0x5ee1a3=_0xb9464b?_0x3b8906['count']:_0x3ae2ca[_0xdc9d('0x1d')]+_0x3ae2ca[_0xdc9d('0x1f')];var _0x7ce5f6;if(_0x5ee1a3>=_0x50dd8d){_0x5ee1a3=_0x50dd8d;_0x7ce5f6=0xc8;}else{_0x7ce5f6=0xce;}_0x28675d[_0xdc9d('0x1c')](_0x7ce5f6);return _0x28675d[_0xdc9d('0x21')]('Content-Range',_0x13d166+'-'+_0x5ee1a3+'/'+_0x50dd8d)[_0xdc9d('0x22')](_0x3b8906);}return null;};}function patchUpdates(_0x2b452a){return function(_0x369bad){try{jsonpatch[_0xdc9d('0x23')](_0x369bad,_0x2b452a,!![]);}catch(_0x1e9e2d){return BPromise[_0xdc9d('0x24')](_0x1e9e2d);}return _0x369bad[_0xdc9d('0x25')]();};}function saveUpdates(_0x45e8c1,_0x579a74){return function(_0x5a43c8){if(_0x5a43c8){return _0x5a43c8[_0xdc9d('0x26')](_0x45e8c1)[_0xdc9d('0x27')](function(_0x4a1eec){return _0x4a1eec;});}return null;};}function handleEntityNotFound(_0x248c83,_0x168072){return function(_0x3dfbaf){if(!_0x3dfbaf){_0x248c83[_0xdc9d('0x1a')](0x194);}return _0x3dfbaf;};}function handleError(_0x34d6e7,_0x4bf932){_0x4bf932=_0x4bf932||0x1f4;return function(_0x27be89){logger[_0xdc9d('0x28')](_0x27be89[_0xdc9d('0x29')]);if(_0x27be89[_0xdc9d('0x2a')]){delete _0x27be89['name'];}_0x34d6e7['status'](_0x4bf932)[_0xdc9d('0x2b')](_0x27be89);};}exports[_0xdc9d('0x2c')]=function(_0x3ddf58,_0x45df3e){var _0x34ea7f={},_0x295b48={},_0x5ea094={'count':0x0,'rows':[]};var _0xa2bff6=_[_0xdc9d('0x2d')](db[_0xdc9d('0x2e')][_0xdc9d('0x2f')],function(_0x4bf5c5){return{'name':_0x4bf5c5[_0xdc9d('0x30')],'type':_0x4bf5c5[_0xdc9d('0x31')]['key']};});_0x295b48[_0xdc9d('0x32')]=_[_0xdc9d('0x2d')](_0xa2bff6,_0xdc9d('0x2a'));_0x295b48['query']=_[_0xdc9d('0x33')](_0x3ddf58['query']);_0x295b48[_0xdc9d('0x34')]=_['intersection'](_0x295b48['model'],_0x295b48['query']);_0x34ea7f[_0xdc9d('0x35')]=_[_0xdc9d('0x36')](_0x295b48[_0xdc9d('0x32')],qs['fields'](_0x3ddf58[_0xdc9d('0x37')]['fields']));_0x34ea7f['attributes']=_0x34ea7f[_0xdc9d('0x35')][_0xdc9d('0x38')]?_0x34ea7f['attributes']:_0x295b48[_0xdc9d('0x32')];if(!_0x3ddf58[_0xdc9d('0x37')][_0xdc9d('0x39')](_0xdc9d('0x3a'))){_0x34ea7f[_0xdc9d('0x1f')]=qs[_0xdc9d('0x1f')](_0x3ddf58[_0xdc9d('0x37')][_0xdc9d('0x1f')]);_0x34ea7f['offset']=qs[_0xdc9d('0x1d')](_0x3ddf58[_0xdc9d('0x37')]['offset']);}_0x34ea7f[_0xdc9d('0x3b')]=qs[_0xdc9d('0x3c')](_0x3ddf58[_0xdc9d('0x37')][_0xdc9d('0x3c')]);_0x34ea7f[_0xdc9d('0x3d')]=qs[_0xdc9d('0x34')](_[_0xdc9d('0x3e')](_0x3ddf58[_0xdc9d('0x37')],_0x295b48[_0xdc9d('0x34')]),_0xa2bff6);if(_0x3ddf58[_0xdc9d('0x37')][_0xdc9d('0x3f')]){_0x34ea7f[_0xdc9d('0x3d')]=_['merge'](_0x34ea7f[_0xdc9d('0x3d')],{'$or':_[_0xdc9d('0x2d')](_0xa2bff6,function(_0x18969d){if(_0x18969d[_0xdc9d('0x31')]!==_0xdc9d('0x40')){var _0x331e22={};_0x331e22[_0x18969d[_0xdc9d('0x2a')]]={'$like':'%'+_0x3ddf58[_0xdc9d('0x37')]['filter']+'%'};return _0x331e22;}})});}_0x34ea7f=_[_0xdc9d('0x41')]({},_0x34ea7f,_0x3ddf58[_0xdc9d('0x42')]);var _0x5984b3={'where':_0x34ea7f[_0xdc9d('0x3d')]};return db['Team'][_0xdc9d('0x20')](_0x5984b3)[_0xdc9d('0x27')](function(_0x49ec1d){_0x5ea094[_0xdc9d('0x20')]=_0x49ec1d;if(_0x3ddf58[_0xdc9d('0x37')][_0xdc9d('0x43')]){_0x34ea7f['include']=[{'all':!![]}];}return db[_0xdc9d('0x2e')][_0xdc9d('0x44')](_0x34ea7f);})[_0xdc9d('0x27')](function(_0x900296){_0x5ea094[_0xdc9d('0x45')]=_0x900296;return _0x5ea094;})['then'](respondWithFilteredResult(_0x45df3e,_0x34ea7f))[_0xdc9d('0x46')](handleError(_0x45df3e,null));};exports[_0xdc9d('0x47')]=function(_0x55a308,_0x265fb3){var _0x52e157={'raw':![],'where':{'id':_0x55a308[_0xdc9d('0x48')]['id']}},_0x40c764={};_0x40c764[_0xdc9d('0x32')]=_[_0xdc9d('0x33')](db[_0xdc9d('0x2e')][_0xdc9d('0x2f')]);_0x40c764[_0xdc9d('0x37')]=_['keys'](_0x55a308[_0xdc9d('0x37')]);_0x40c764[_0xdc9d('0x34')]=_[_0xdc9d('0x36')](_0x40c764['model'],_0x40c764[_0xdc9d('0x37')]);_0x52e157[_0xdc9d('0x35')]=_[_0xdc9d('0x36')](_0x40c764[_0xdc9d('0x32')],qs[_0xdc9d('0x49')](_0x55a308[_0xdc9d('0x37')]['fields']));_0x52e157[_0xdc9d('0x35')]=_0x52e157[_0xdc9d('0x35')][_0xdc9d('0x38')]?_0x52e157[_0xdc9d('0x35')]:_0x40c764[_0xdc9d('0x32')];if(_0x55a308[_0xdc9d('0x37')]['includeAll']){_0x52e157['include']=[{'all':!![]}];}_0x52e157=_[_0xdc9d('0x41')]({},_0x52e157,_0x55a308['options']);return db[_0xdc9d('0x2e')]['find'](_0x52e157)[_0xdc9d('0x27')](handleEntityNotFound(_0x265fb3,null))[_0xdc9d('0x27')](respondWithResult(_0x265fb3,null))['catch'](handleError(_0x265fb3,null));};exports[_0xdc9d('0x4a')]=function(_0x2845c1,_0x1ee3a7){return db[_0xdc9d('0x2e')]['create'](_0x2845c1[_0xdc9d('0x4b')],{})[_0xdc9d('0x27')](function(_0x4d3a3c){var _0x209eeb=_0x2845c1[_0xdc9d('0x4c')]['get']({'plain':!![]});if(!_0x209eeb)throw new Error(_0xdc9d('0x4d'));if(_0x209eeb[_0xdc9d('0x4e')]===_0xdc9d('0x4c')){var _0x477a2e=_0x4d3a3c[_0xdc9d('0x4f')]({'plain':!![]});var _0x27c2e2=_0xdc9d('0x50');return db['UserProfileSection']['find']({'where':{'name':_0x27c2e2,'userProfileId':_0x209eeb[_0xdc9d('0x51')]},'raw':!![]})['then'](function(_0x4329a9){if(_0x4329a9&&_0x4329a9[_0xdc9d('0x52')]===0x0){return db[_0xdc9d('0x53')]['create']({'name':_0x477a2e[_0xdc9d('0x2a')],'resourceId':_0x477a2e['id'],'type':_0x4329a9[_0xdc9d('0x2a')],'sectionId':_0x4329a9['id']},{})['then'](function(){return _0x4d3a3c;});}else{return _0x4d3a3c;}})['catch'](function(_0x3c2218){logger[_0xdc9d('0x28')](_0xdc9d('0x54'),_0x3c2218);throw _0x3c2218;});}return _0x4d3a3c;})[_0xdc9d('0x27')](respondWithResult(_0x1ee3a7,0xc9))[_0xdc9d('0x46')](handleError(_0x1ee3a7,null));};exports[_0xdc9d('0x26')]=function(_0x221e90,_0x465b7e){if(_0x221e90['body']['id']){delete _0x221e90[_0xdc9d('0x4b')]['id'];}return db[_0xdc9d('0x2e')][_0xdc9d('0x55')]({'where':{'id':_0x221e90[_0xdc9d('0x48')]['id']}})[_0xdc9d('0x27')](handleEntityNotFound(_0x465b7e,null))[_0xdc9d('0x27')](saveUpdates(_0x221e90['body'],null))[_0xdc9d('0x27')](respondWithResult(_0x465b7e,null))[_0xdc9d('0x46')](handleError(_0x465b7e,null));};exports[_0xdc9d('0x56')]=function(_0x4ff056,_0x75a627){var _0x1a068c=_0x4ff056[_0xdc9d('0x48')]['id'];var _0x181cd0=[];return db['sequelize'][_0xdc9d('0x57')](function(_0x4f9f95){var _0x4b18d3=_0xdc9d('0x58')+_0x1a068c;return db['sequelize']['query'](_0x4b18d3,{'type':db[_0xdc9d('0x59')]['QueryTypes'][_0xdc9d('0x5a')],'raw':!![],'transaction':_0x4f9f95})[_0xdc9d('0x27')](function(_0x43553c){_0x181cd0=_[_0xdc9d('0x2d')](_0x43553c,function(_0x259867){return Number(_0x259867[_0xdc9d('0x5b')]);});})[_0xdc9d('0x27')](function(){var _0x21adba=_0xdc9d('0x5c')+_0x1a068c;return db[_0xdc9d('0x5d')]['query'](_0x21adba,{'type':db[_0xdc9d('0x59')]['QueryTypes'][_0xdc9d('0x5a')],'raw':!![],'transaction':_0x4f9f95});})['then'](function(_0x55ac64){var _0x567dcf=_[_0xdc9d('0x2d')](_0x55ac64,function(_0x20dad8){return Number(_0x20dad8['VoiceQueueId']);});return db[_0xdc9d('0x5e')][_0xdc9d('0x56')]({'where':{'UserId':{'$in':_0x181cd0},'VoiceQueueId':{'$in':_0x567dcf}},'transaction':_0x4f9f95});})[_0xdc9d('0x27')](function(){var _0x3fa3b8=_0xdc9d('0x5f')+_0x1a068c;return db['sequelize'][_0xdc9d('0x37')](_0x3fa3b8,{'type':db[_0xdc9d('0x59')]['QueryTypes'][_0xdc9d('0x5a')],'raw':!![],'transaction':_0x4f9f95});})['then'](function(_0x444fd4){var _0x2c6490=_['map'](_0x444fd4,function(_0x36b8f8){return Number(_0x36b8f8[_0xdc9d('0x60')]);});return db[_0xdc9d('0x61')][_0xdc9d('0x56')]({'where':{'UserId':{'$in':_0x181cd0},'MailQueueId':{'$in':_0x2c6490}},'transaction':_0x4f9f95});})[_0xdc9d('0x27')](function(){var _0x5207a8='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x1a068c;return db[_0xdc9d('0x5d')][_0xdc9d('0x37')](_0x5207a8,{'type':db[_0xdc9d('0x59')][_0xdc9d('0x62')][_0xdc9d('0x5a')],'raw':!![],'transaction':_0x4f9f95});})[_0xdc9d('0x27')](function(_0x423647){var _0x10d9e7=_['map'](_0x423647,function(_0x15a464){return Number(_0x15a464[_0xdc9d('0x63')]);});return db[_0xdc9d('0x64')][_0xdc9d('0x56')]({'where':{'UserId':{'$in':_0x181cd0},'SmsQueueId':{'$in':_0x10d9e7}},'transaction':_0x4f9f95});})['then'](function(){var _0x528347=_0xdc9d('0x65')+_0x1a068c;return db[_0xdc9d('0x5d')][_0xdc9d('0x37')](_0x528347,{'type':db[_0xdc9d('0x59')][_0xdc9d('0x62')]['SELECT'],'raw':!![],'transaction':_0x4f9f95});})[_0xdc9d('0x27')](function(_0x97ddbf){var _0x7a4610=_[_0xdc9d('0x2d')](_0x97ddbf,function(_0x5a001a){return Number(_0x5a001a[_0xdc9d('0x66')]);});return db[_0xdc9d('0x67')][_0xdc9d('0x56')]({'where':{'UserId':{'$in':_0x181cd0},'ChatQueueId':{'$in':_0x7a4610}},'transaction':_0x4f9f95});})[_0xdc9d('0x27')](function(){var _0xf7f8cf=_0xdc9d('0x68')+_0x1a068c;return db[_0xdc9d('0x5d')][_0xdc9d('0x37')](_0xf7f8cf,{'type':db[_0xdc9d('0x59')][_0xdc9d('0x62')][_0xdc9d('0x5a')],'raw':!![],'transaction':_0x4f9f95});})[_0xdc9d('0x27')](function(_0x57c0d1){var _0x222a99=_[_0xdc9d('0x2d')](_0x57c0d1,function(_0xa2a07d){return Number(_0xa2a07d['FaxQueueId']);});return db[_0xdc9d('0x69')][_0xdc9d('0x56')]({'where':{'UserId':{'$in':_0x181cd0},'FaxQueueId':{'$in':_0x222a99}},'transaction':_0x4f9f95});})[_0xdc9d('0x27')](function(){var _0x38e2df=_0xdc9d('0x6a')+_0x1a068c;return db[_0xdc9d('0x5d')][_0xdc9d('0x37')](_0x38e2df,{'type':db[_0xdc9d('0x59')]['QueryTypes'][_0xdc9d('0x5a')],'raw':!![],'transaction':_0x4f9f95});})[_0xdc9d('0x27')](function(_0x389b49){var _0x533621=_[_0xdc9d('0x2d')](_0x389b49,function(_0x5d8907){return Number(_0x5d8907['OpenchannelQueueId']);});return db[_0xdc9d('0x6b')][_0xdc9d('0x56')]({'where':{'UserId':{'$in':_0x181cd0},'OpenchannelQueueId':{'$in':_0x533621}},'transaction':_0x4f9f95});})[_0xdc9d('0x27')](function(){var _0x23dd49=_0xdc9d('0x6c')+_0x1a068c;return db[_0xdc9d('0x5d')][_0xdc9d('0x37')](_0x23dd49,{'type':db[_0xdc9d('0x59')]['QueryTypes'][_0xdc9d('0x5a')],'raw':!![],'transaction':_0x4f9f95});})[_0xdc9d('0x27')](function(_0x1ffd1e){var _0x94d6f1=_[_0xdc9d('0x2d')](_0x1ffd1e,function(_0x222b65){return Number(_0x222b65[_0xdc9d('0x6d')]);});return db[_0xdc9d('0x6e')]['destroy']({'where':{'UserId':{'$in':_0x181cd0},'WhatsappQueueId':{'$in':_0x94d6f1}},'transaction':_0x4f9f95});})[_0xdc9d('0x27')](function(){return db[_0xdc9d('0x6f')][_0xdc9d('0x55')]({'where':{'TeamId':_0x1a068c}});})[_0xdc9d('0x27')](function(_0x5d7c29){if(_0x5d7c29===null){return;}return db[_0xdc9d('0x70')][_0xdc9d('0x56')]({'where':{'UserId':{'$in':_0x181cd0},'VoicePrefixId':_0x5d7c29[_0xdc9d('0x71')]},'transaction':_0x4f9f95});})[_0xdc9d('0x27')](function(){return db[_0xdc9d('0x2e')][_0xdc9d('0x56')]({'where':{'id':_0x1a068c},'cascade':!![],'transaction':_0x4f9f95});})['then'](function(_0x2ac0f4){if(_0x2ac0f4===0x0){_0x75a627[_0xdc9d('0x1a')](0x194);}else{return db[_0xdc9d('0x53')]['destroy']({'where':{'type':_0xdc9d('0x50'),'resourceId':_0x1a068c},'cascade':!![],'transaction':_0x4f9f95})[_0xdc9d('0x27')](function(){_0x75a627['status'](0xcc)[_0xdc9d('0x1b')]();});}})['catch'](function(_0x481cde){_0x75a627['status'](0x1f4)[_0xdc9d('0x2b')](_0x481cde);});});};exports[_0xdc9d('0x72')]=function(_0x3a68af,_0x18fb34,_0x3bbd3){return db[_0xdc9d('0x2e')][_0xdc9d('0x73')]({'where':{'id':_0x3a68af[_0xdc9d('0x48')]['id']}})[_0xdc9d('0x27')](handleEntityNotFound(_0x18fb34,null))[_0xdc9d('0x27')](function(_0x30ff0c){if(!_0x3a68af['query'][_0xdc9d('0x74')]||!utils[_0xdc9d('0x75')](_0x3a68af[_0xdc9d('0x37')][_0xdc9d('0x74')])){throw new db['Sequelize']['ValidationError']('Unknown\x20channel');}var _0x8cd8c8={};var _0x54d39a={};_0x54d39a[_0xdc9d('0x32')]=_[_0xdc9d('0x33')](db[_[_0xdc9d('0x76')](_0x3a68af[_0xdc9d('0x37')][_0xdc9d('0x74')][_0xdc9d('0x77')]())+'Queue']['rawAttributes']);_0x54d39a['query']=_[_0xdc9d('0x33')](_0x3a68af[_0xdc9d('0x37')]);_0x54d39a[_0xdc9d('0x34')]=_['intersection'](_0x54d39a[_0xdc9d('0x32')],_0x54d39a[_0xdc9d('0x37')]);_0x8cd8c8[_0xdc9d('0x35')]=_[_0xdc9d('0x36')](_0x54d39a['model'],qs['fields'](_0x3a68af[_0xdc9d('0x37')][_0xdc9d('0x49')]));_0x8cd8c8[_0xdc9d('0x35')]=_0x8cd8c8[_0xdc9d('0x35')]['length']?_0x8cd8c8[_0xdc9d('0x35')]:_0x54d39a[_0xdc9d('0x32')];_0x8cd8c8['limit']=qs[_0xdc9d('0x1f')](_0x3a68af[_0xdc9d('0x37')]['limit']);_0x8cd8c8[_0xdc9d('0x1d')]=qs[_0xdc9d('0x1d')](_0x3a68af[_0xdc9d('0x37')][_0xdc9d('0x1d')]);_0x8cd8c8[_0xdc9d('0x3b')]=qs['sort'](_0x3a68af[_0xdc9d('0x37')][_0xdc9d('0x3c')]);_0x8cd8c8[_0xdc9d('0x3d')]=qs['filters'](_[_0xdc9d('0x3e')](_0x3a68af[_0xdc9d('0x37')],_0x54d39a[_0xdc9d('0x34')]));_0x8cd8c8=_[_0xdc9d('0x41')]({},_0x8cd8c8,_0x3a68af[_0xdc9d('0x42')]);return _0x30ff0c[_0xdc9d('0x4f')+_['capitalize'](_0x3a68af[_0xdc9d('0x37')][_0xdc9d('0x74')][_0xdc9d('0x77')]())+'Queues'](_0x8cd8c8);})[_0xdc9d('0x27')](respondWithResult(_0x18fb34,null))['catch'](handleError(_0x18fb34,null));};exports[_0xdc9d('0x78')]=function(_0x235b97,_0x19bba6,_0x1cecb3){return db[_0xdc9d('0x2e')][_0xdc9d('0x73')]({'where':{'id':_0x235b97[_0xdc9d('0x48')]['id']}})[_0xdc9d('0x27')](function(_0x4c4fae){if(_0x4c4fae){if(!_0x235b97[_0xdc9d('0x4b')][_0xdc9d('0x74')]||!utils[_0xdc9d('0x75')](_0x235b97[_0xdc9d('0x4b')][_0xdc9d('0x74')])){throw new db[(_0xdc9d('0x59'))][(_0xdc9d('0x79'))](_0xdc9d('0x7a'));}return _0x4c4fae['add'+_[_0xdc9d('0x76')](_0x235b97[_0xdc9d('0x4b')][_0xdc9d('0x74')][_0xdc9d('0x77')]())+_0xdc9d('0x7b')](_0x235b97[_0xdc9d('0x4b')]['ids']);}return null;})[_0xdc9d('0x27')](handleEntityNotFound(_0x19bba6,null))[_0xdc9d('0x27')](respondWithStatusCode(_0x19bba6,null))[_0xdc9d('0x46')](handleError(_0x19bba6,null));};exports['removeQueues']=function(_0x5efb6e,_0x590f42,_0x175d57){return db[_0xdc9d('0x2e')][_0xdc9d('0x73')]({'where':{'id':_0x5efb6e[_0xdc9d('0x48')]['id']}})[_0xdc9d('0x27')](function(_0x22a984){if(_0x22a984){if(!_0x5efb6e[_0xdc9d('0x37')][_0xdc9d('0x74')]||!utils[_0xdc9d('0x75')](_0x5efb6e[_0xdc9d('0x37')][_0xdc9d('0x74')])){throw new db[(_0xdc9d('0x59'))]['ValidationError']('Unknown\x20channel');}return _0x22a984['remove'+_[_0xdc9d('0x76')](_0x5efb6e['query']['channel'][_0xdc9d('0x77')]())+_0xdc9d('0x7b')](_0x5efb6e['query']['ids']);}return null;})['then'](handleEntityNotFound(_0x590f42,null))[_0xdc9d('0x27')](respondWithStatusCode(_0x590f42,null))[_0xdc9d('0x46')](handleError(_0x590f42,null));};exports[_0xdc9d('0x7c')]=function(_0x4fece0,_0x5190ab){var _0x2a8b6d=_['isArray'](_0x4fece0[_0xdc9d('0x4b')][_0xdc9d('0x7d')])?_0x4fece0[_0xdc9d('0x4b')][_0xdc9d('0x7d')]:[_0x4fece0[_0xdc9d('0x4b')][_0xdc9d('0x7d')]];var _0x1f3a1e=_0x4fece0['params']['id'];return db['Team'][_0xdc9d('0x55')]({'where':{'id':_0x1f3a1e}})[_0xdc9d('0x27')](handleEntityNotFound(_0x5190ab,null))[_0xdc9d('0x27')](function(_0x18626a){if(_0x18626a){var _0x46503a=[_0xdc9d('0x7e'),_0xdc9d('0x7f'),_0xdc9d('0x80'),_0xdc9d('0x81'),'Fax','Openchannel',_0xdc9d('0x82')];return db[_0xdc9d('0x5d')]['transaction'](function(_0x2fe0e7){var _0xba075a=_[_0xdc9d('0x2d')](_0x46503a,function(_0x288bd1){var _0x38cb49={'attributes':['id',_0xdc9d('0x2a')]};if(_0x288bd1===_0xdc9d('0x7e')){_0x38cb49[_0xdc9d('0x83')]={'attributes':[_0xdc9d('0x84')]};}return _0x18626a[_0xdc9d('0x4f')+_0x288bd1+_0xdc9d('0x7b')](_0x38cb49)[_0xdc9d('0x27')](function(_0x282772){var _0x1b6ae2=_[_0xdc9d('0x2d')](_0x282772,function(_0x4798f6){var _0x44bb6e=_[_0xdc9d('0x2d')](_0x2a8b6d,function(_0x552a3c){var _0x4657fd={'where':{'UserId':_0x552a3c,[_0x288bd1+'QueueId']:_0x4798f6['id']},'transaction':_0x2fe0e7};if(_0x288bd1==='Voice'){_0x4657fd[_0xdc9d('0x85')]={'penalty':_0x4798f6[_0xdc9d('0x86')][_0xdc9d('0x84')]};}return db['User'+_0x288bd1+_0xdc9d('0x87')][_0xdc9d('0x88')](_0x4657fd)['then'](function(){socket[_0xdc9d('0x89')](_0xdc9d('0x4c')+_0x288bd1+_0xdc9d('0x8a'),{'UserId':_0x552a3c,[_0x288bd1+_0xdc9d('0x8b')]:_0x4798f6['id']});if(_0x288bd1!=='Voice'){return;}return db[_0xdc9d('0x8c')][_0xdc9d('0x44')]({'where':{'id':_0x2a8b6d,'online':0x1},'attributes':['id','name',_0xdc9d('0x8d'),_0xdc9d('0x8e'),_0xdc9d('0x8f')],'raw':!![]})['then'](function(_0x21269e){var _0x7c645b=_[_0xdc9d('0x2d')](_0x21269e,function(_0x17828f){return db[_0xdc9d('0x90')][_0xdc9d('0x91')]({'membername':_0x17828f[_0xdc9d('0x2a')],'UserId':_0x17828f['id'],'queue_name':_0x4798f6[_0xdc9d('0x2a')],'VoiceQueueId':_0x4798f6['id'],'interface':_['isNil'](_0x17828f[_0xdc9d('0x8f')])?util[_0xdc9d('0x92')](_0xdc9d('0x93'),_0x17828f[_0xdc9d('0x2a')]):_0x17828f[_0xdc9d('0x8f')],'paused':_0x17828f[_0xdc9d('0x8e')]||![],'penalty':_0x4798f6[_0xdc9d('0x86')][_0xdc9d('0x84')]},{'transaction':_0x2fe0e7});});return Promise['all'](_0x7c645b);});});});return Promise[_0xdc9d('0x94')](_0x44bb6e);});return Promise[_0xdc9d('0x94')](_0x1b6ae2);})[_0xdc9d('0x27')](function(){return db['TeamVoicePrefix']['findOne']({'where':{'teamId':_0x1f3a1e}})[_0xdc9d('0x27')](function(_0x27d46f){if(_0x27d46f){var _0xbdb181=_[_0xdc9d('0x2d')](_0x2a8b6d,function(_0x4bba72){db['UserVoicePrefix'][_0xdc9d('0x91')]({'UserId':_0x4bba72,'VoicePrefixId':_0x27d46f[_0xdc9d('0x71')]});});return Promise[_0xdc9d('0x94')](_0xbdb181);}});});});return Promise[_0xdc9d('0x94')](_0xba075a)[_0xdc9d('0x27')](function(){return _0x18626a[_0xdc9d('0x7c')](_0x2a8b6d,{'transaction':_0x2fe0e7})['spread'](function(_0x120630){return _0x120630;});});});}})[_0xdc9d('0x27')](respondWithResult(_0x5190ab,null))[_0xdc9d('0x46')](handleError(_0x5190ab,null));};exports['removeAgents']=function(_0x4bccf0,_0x3aa427){var _0x689585=_[_0xdc9d('0x95')](_0x4bccf0[_0xdc9d('0x37')][_0xdc9d('0x7d')])?_0x4bccf0[_0xdc9d('0x37')][_0xdc9d('0x7d')]:[_0x4bccf0[_0xdc9d('0x37')][_0xdc9d('0x7d')]];var _0x4b3fa1=_0x4bccf0['params']['id'];return db[_0xdc9d('0x2e')][_0xdc9d('0x55')]({'where':{'id':_0x4b3fa1}})['then'](handleEntityNotFound(_0x3aa427,null))[_0xdc9d('0x27')](function(_0x50c769){if(_0x50c769){var _0x2ea896=['Voice',_0xdc9d('0x7f'),_0xdc9d('0x80'),_0xdc9d('0x81'),_0xdc9d('0x96'),'Openchannel',_0xdc9d('0x82')];return db[_0xdc9d('0x5d')][_0xdc9d('0x57')](function(_0xcf8126){var _0x27ffdd=_['map'](_0x2ea896,function(_0xbed79d){var _0x5cbeeb={'attributes':['id','name']};return _0x50c769['get'+_0xbed79d+'Queues'](_0x5cbeeb)[_0xdc9d('0x27')](function(_0x378326){var _0x1a9a62=_[_0xdc9d('0x2d')](_0x378326,function(_0x42c76f){return _0x42c76f['removeAgents'](_0x689585,{'transaction':_0xcf8126})[_0xdc9d('0x27')](function(){var _0x5f43c6=_[_0xdc9d('0x2d')](_0x689585,function(_0xde41b7){socket[_0xdc9d('0x89')](_0xdc9d('0x4c')+_0xbed79d+_0xdc9d('0x97'),{'UserId':Number(_0xde41b7),[_0xbed79d+_0xdc9d('0x8b')]:_0x42c76f['id']});if(_0xbed79d!==_0xdc9d('0x7e')){return;}return db[_0xdc9d('0x90')][_0xdc9d('0x56')]({'where':{'VoiceQueueId':_0x42c76f['id'],'UserId':_0xde41b7},'transaction':_0xcf8126});});return Promise[_0xdc9d('0x94')](_0x5f43c6);});});return Promise[_0xdc9d('0x94')](_0x1a9a62);});});return Promise[_0xdc9d('0x94')](_0x27ffdd)[_0xdc9d('0x27')](function(){return _0x50c769[_0xdc9d('0x98')](_0x689585,{'transaction':_0xcf8126});})['then'](function(){return db['TeamVoicePrefix']['findOne']({'where':{'teamId':_0x4b3fa1}})[_0xdc9d('0x27')](function(_0x113448){if(_0x113448){var _0x3d81f5=_[_0xdc9d('0x2d')](_0x689585,function(_0x2f0648){db[_0xdc9d('0x70')][_0xdc9d('0x56')]({'where':{'UserId':_0x2f0648,'VoicePrefixId':_0x113448[_0xdc9d('0x71')]}});});return Promise[_0xdc9d('0x94')](_0x3d81f5);}});});});}})[_0xdc9d('0x27')](respondWithStatusCode(_0x3aa427,null))[_0xdc9d('0x46')](handleError(_0x3aa427,null));};exports[_0xdc9d('0x99')]=function(_0x2b2e5a,_0x7e7881,_0x2d39e1){var _0x5df077={};var _0x1db3dc={};var _0x45b2ad;var _0x27d787;return db['Team']['findOne']({'where':{'id':_0x2b2e5a['params']['id']}})[_0xdc9d('0x27')](handleEntityNotFound(_0x7e7881,null))[_0xdc9d('0x27')](function(_0x3c5454){if(_0x3c5454){_0x45b2ad=_0x3c5454;_0x1db3dc[_0xdc9d('0x32')]=_[_0xdc9d('0x33')](db[_0xdc9d('0x8c')][_0xdc9d('0x2f')]);_0x1db3dc[_0xdc9d('0x37')]=_['keys'](_0x2b2e5a[_0xdc9d('0x37')]);_0x1db3dc[_0xdc9d('0x34')]=_[_0xdc9d('0x36')](_0x1db3dc[_0xdc9d('0x32')],_0x1db3dc[_0xdc9d('0x37')]);_0x5df077[_0xdc9d('0x35')]=_['intersection'](_0x1db3dc[_0xdc9d('0x32')],qs['fields'](_0x2b2e5a['query']['fields']));_0x5df077[_0xdc9d('0x35')]=_0x5df077[_0xdc9d('0x35')][_0xdc9d('0x38')]?_0x5df077[_0xdc9d('0x35')]:_0x1db3dc[_0xdc9d('0x32')];_0x5df077[_0xdc9d('0x3b')]=qs[_0xdc9d('0x3c')](_0x2b2e5a[_0xdc9d('0x37')]['sort']);_0x5df077[_0xdc9d('0x3d')]=qs[_0xdc9d('0x34')](_[_0xdc9d('0x3e')](_0x2b2e5a[_0xdc9d('0x37')],_0x1db3dc[_0xdc9d('0x34')]));if(_0x2b2e5a[_0xdc9d('0x37')][_0xdc9d('0x3f')]){_0x5df077[_0xdc9d('0x3d')]=_['merge'](_0x5df077[_0xdc9d('0x3d')],{'$or':_[_0xdc9d('0x2d')](_0x5df077[_0xdc9d('0x35')],function(_0xdab58f){var _0x1fdeac={};_0x1fdeac[_0xdab58f]={'$like':'%'+_0x2b2e5a['query'][_0xdc9d('0x3f')]+'%'};return _0x1fdeac;})});}_0x5df077=_[_0xdc9d('0x41')]({},_0x5df077,_0x2b2e5a[_0xdc9d('0x42')]);return _0x45b2ad[_0xdc9d('0x99')](_0x5df077);}})[_0xdc9d('0x27')](function(_0x412a86){if(_0x412a86){_0x27d787=_0x412a86[_0xdc9d('0x38')];if(!_0x2b2e5a[_0xdc9d('0x37')][_0xdc9d('0x39')]('nolimit')){_0x5df077[_0xdc9d('0x1f')]=qs[_0xdc9d('0x1f')](_0x2b2e5a[_0xdc9d('0x37')][_0xdc9d('0x1f')]);_0x5df077[_0xdc9d('0x1d')]=qs[_0xdc9d('0x1d')](_0x2b2e5a[_0xdc9d('0x37')][_0xdc9d('0x1d')]);}return _0x45b2ad[_0xdc9d('0x99')](_0x5df077);}})[_0xdc9d('0x27')](function(_0x547197){if(_0x547197){return _0x547197?{'count':_0x27d787,'rows':_0x547197}:null;}})[_0xdc9d('0x27')](respondWithResult(_0x7e7881,null))[_0xdc9d('0x46')](handleError(_0x7e7881,null));}; \ No newline at end of file +var _0x0a36=['UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserProfileResource','getQueues','findOne','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','Queues','addQueues','add','ids','removeQueues','remove','addAgents','Chat','Mail','Sms','Fax','Openchannel','Whatsapp','Voice','through','QueueId','TeamVoiceQueue','penalty','User','findOrCreate','emit','Queue:save','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','all','UserVoicePrefix','spread','isArray','transaction','removeAgents','Queue:remove','VoicePrefixId','getAgents','rawAttributes','zip-dir','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./team.socket','register','sendStatus','status','end','limit','count','offset','set','Content-Range','json','save','stack','name','send','index','map','Team','fieldName','type','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','then','rows','catch','params','intersection','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','Sequelize','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','sequelize','VoiceQueueId','UserVoiceQueue','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId'];(function(_0x597484,_0x199340){var _0x218e64=function(_0x390d55){while(--_0x390d55){_0x597484['push'](_0x597484['shift']());}};_0x218e64(++_0x199340);}(_0x0a36,0x174));var _0x60a3=function(_0x497b1e,_0x586379){_0x497b1e=_0x497b1e-0x0;var _0x3f72e1=_0x0a36[_0x497b1e];return _0x3f72e1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x60a3('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x60a3('0x1'));var BPromise=require(_0x60a3('0x2'));var Mustache=require(_0x60a3('0x3'));var util=require(_0x60a3('0x4'));var path=require(_0x60a3('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x60a3('0x6'));var fs=require('fs');var fs_extra=require(_0x60a3('0x7'));var _=require(_0x60a3('0x8'));var squel=require(_0x60a3('0x9'));var crypto=require(_0x60a3('0xa'));var jsforce=require(_0x60a3('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x60a3('0xc'));var querystring=require(_0x60a3('0xd'));var Papa=require(_0x60a3('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x60a3('0xf'));var as=require(_0x60a3('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x60a3('0x11'))(_0x60a3('0x12'));var utils=require(_0x60a3('0x13'));var config=require(_0x60a3('0x14'));var licenseUtil=require(_0x60a3('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x60a3('0x16')](config[_0x60a3('0x17')],{'host':_0x60a3('0x18'),'port':0x18eb});var socket=require(_0x60a3('0x19'))(new Redis(config[_0x60a3('0x17')]));require(_0x60a3('0x1a'))[_0x60a3('0x1b')](socket);function respondWithStatusCode(_0x3f4e2d,_0x1b2c4a){_0x1b2c4a=_0x1b2c4a||0xcc;return function(_0x3afabb){if(_0x3afabb){return _0x3f4e2d[_0x60a3('0x1c')](_0x1b2c4a);}return _0x3f4e2d[_0x60a3('0x1d')](_0x1b2c4a)[_0x60a3('0x1e')]();};}function respondWithResult(_0x31ca5c,_0x249f84){_0x249f84=_0x249f84||0xc8;return function(_0x2bb9a9){if(_0x2bb9a9){return _0x31ca5c[_0x60a3('0x1d')](_0x249f84)['json'](_0x2bb9a9);}};}function respondWithFilteredResult(_0x5ce7a1,_0x57f577){return function(_0x3c3942){if(_0x3c3942){var _0x146b53=typeof _0x57f577['offset']==='undefined'&&typeof _0x57f577[_0x60a3('0x1f')]==='undefined';var _0x195b76=_0x3c3942[_0x60a3('0x20')];var _0x41ef6b=_0x146b53?0x0:_0x57f577[_0x60a3('0x21')];var _0x4ba936=_0x146b53?_0x3c3942[_0x60a3('0x20')]:_0x57f577['offset']+_0x57f577['limit'];var _0x461295;if(_0x4ba936>=_0x195b76){_0x4ba936=_0x195b76;_0x461295=0xc8;}else{_0x461295=0xce;}_0x5ce7a1[_0x60a3('0x1d')](_0x461295);return _0x5ce7a1[_0x60a3('0x22')](_0x60a3('0x23'),_0x41ef6b+'-'+_0x4ba936+'/'+_0x195b76)[_0x60a3('0x24')](_0x3c3942);}return null;};}function patchUpdates(_0x1db35a){return function(_0x19de54){try{jsonpatch['apply'](_0x19de54,_0x1db35a,!![]);}catch(_0x33c6ce){return BPromise['reject'](_0x33c6ce);}return _0x19de54[_0x60a3('0x25')]();};}function saveUpdates(_0x489144,_0xe62df6){return function(_0x493d0c){if(_0x493d0c){return _0x493d0c['update'](_0x489144)['then'](function(_0x4b5680){return _0x4b5680;});}return null;};}function handleEntityNotFound(_0x5c6bc7,_0x87cf22){return function(_0x5195be){if(!_0x5195be){_0x5c6bc7['sendStatus'](0x194);}return _0x5195be;};}function handleError(_0x113118,_0x5e4236){_0x5e4236=_0x5e4236||0x1f4;return function(_0x23420b){logger['error'](_0x23420b[_0x60a3('0x26')]);if(_0x23420b['name']){delete _0x23420b[_0x60a3('0x27')];}_0x113118[_0x60a3('0x1d')](_0x5e4236)[_0x60a3('0x28')](_0x23420b);};}exports[_0x60a3('0x29')]=function(_0xe0911a,_0x5219e3){var _0x317626={},_0xcd3c05={},_0x2e2a45={'count':0x0,'rows':[]};var _0x24cbd9=_[_0x60a3('0x2a')](db[_0x60a3('0x2b')]['rawAttributes'],function(_0x9d45fa){return{'name':_0x9d45fa[_0x60a3('0x2c')],'type':_0x9d45fa[_0x60a3('0x2d')][_0x60a3('0x2e')]};});_0xcd3c05[_0x60a3('0x2f')]=_[_0x60a3('0x2a')](_0x24cbd9,_0x60a3('0x27'));_0xcd3c05[_0x60a3('0x30')]=_[_0x60a3('0x31')](_0xe0911a[_0x60a3('0x30')]);_0xcd3c05[_0x60a3('0x32')]=_['intersection'](_0xcd3c05[_0x60a3('0x2f')],_0xcd3c05[_0x60a3('0x30')]);_0x317626['attributes']=_['intersection'](_0xcd3c05[_0x60a3('0x2f')],qs['fields'](_0xe0911a[_0x60a3('0x30')][_0x60a3('0x33')]));_0x317626[_0x60a3('0x34')]=_0x317626[_0x60a3('0x34')][_0x60a3('0x35')]?_0x317626['attributes']:_0xcd3c05['model'];if(!_0xe0911a[_0x60a3('0x30')][_0x60a3('0x36')](_0x60a3('0x37'))){_0x317626[_0x60a3('0x1f')]=qs[_0x60a3('0x1f')](_0xe0911a[_0x60a3('0x30')][_0x60a3('0x1f')]);_0x317626[_0x60a3('0x21')]=qs['offset'](_0xe0911a['query'][_0x60a3('0x21')]);}_0x317626[_0x60a3('0x38')]=qs[_0x60a3('0x39')](_0xe0911a['query'][_0x60a3('0x39')]);_0x317626[_0x60a3('0x3a')]=qs[_0x60a3('0x32')](_[_0x60a3('0x3b')](_0xe0911a[_0x60a3('0x30')],_0xcd3c05['filters']),_0x24cbd9);if(_0xe0911a[_0x60a3('0x30')][_0x60a3('0x3c')]){_0x317626['where']=_[_0x60a3('0x3d')](_0x317626[_0x60a3('0x3a')],{'$or':_[_0x60a3('0x2a')](_0x24cbd9,function(_0x22a788){if(_0x22a788['type']!=='VIRTUAL'){var _0x33e76c={};_0x33e76c[_0x22a788[_0x60a3('0x27')]]={'$like':'%'+_0xe0911a[_0x60a3('0x30')]['filter']+'%'};return _0x33e76c;}})});}_0x317626=_[_0x60a3('0x3d')]({},_0x317626,_0xe0911a[_0x60a3('0x3e')]);var _0x15ddc3={'where':_0x317626['where']};return db[_0x60a3('0x2b')][_0x60a3('0x20')](_0x15ddc3)['then'](function(_0x305836){_0x2e2a45[_0x60a3('0x20')]=_0x305836;if(_0xe0911a['query'][_0x60a3('0x3f')]){_0x317626[_0x60a3('0x40')]=[{'all':!![]}];}return db['Team'][_0x60a3('0x41')](_0x317626);})[_0x60a3('0x42')](function(_0x2c6fd8){_0x2e2a45[_0x60a3('0x43')]=_0x2c6fd8;return _0x2e2a45;})[_0x60a3('0x42')](respondWithFilteredResult(_0x5219e3,_0x317626))[_0x60a3('0x44')](handleError(_0x5219e3,null));};exports['show']=function(_0x2d5cf8,_0x49e101){var _0x2e408c={'raw':![],'where':{'id':_0x2d5cf8[_0x60a3('0x45')]['id']}},_0xd745b0={};_0xd745b0['model']=_[_0x60a3('0x31')](db['Team']['rawAttributes']);_0xd745b0[_0x60a3('0x30')]=_[_0x60a3('0x31')](_0x2d5cf8[_0x60a3('0x30')]);_0xd745b0[_0x60a3('0x32')]=_[_0x60a3('0x46')](_0xd745b0[_0x60a3('0x2f')],_0xd745b0['query']);_0x2e408c[_0x60a3('0x34')]=_[_0x60a3('0x46')](_0xd745b0[_0x60a3('0x2f')],qs[_0x60a3('0x33')](_0x2d5cf8['query'][_0x60a3('0x33')]));_0x2e408c[_0x60a3('0x34')]=_0x2e408c[_0x60a3('0x34')]['length']?_0x2e408c[_0x60a3('0x34')]:_0xd745b0[_0x60a3('0x2f')];if(_0x2d5cf8[_0x60a3('0x30')][_0x60a3('0x3f')]){_0x2e408c[_0x60a3('0x40')]=[{'all':!![]}];}_0x2e408c=_['merge']({},_0x2e408c,_0x2d5cf8['options']);return db[_0x60a3('0x2b')][_0x60a3('0x47')](_0x2e408c)[_0x60a3('0x42')](handleEntityNotFound(_0x49e101,null))[_0x60a3('0x42')](respondWithResult(_0x49e101,null))[_0x60a3('0x44')](handleError(_0x49e101,null));};exports[_0x60a3('0x48')]=function(_0x52cac9,_0x20b7c2){return db['Team'][_0x60a3('0x48')](_0x52cac9[_0x60a3('0x49')],{})[_0x60a3('0x42')](function(_0x36eb19){var _0x31c1c8=_0x52cac9[_0x60a3('0x4a')][_0x60a3('0x4b')]({'plain':!![]});if(!_0x31c1c8)throw new Error(_0x60a3('0x4c'));if(_0x31c1c8[_0x60a3('0x4d')]==='user'){var _0xe5cd48=_0x36eb19['get']({'plain':!![]});var _0x19cdce=_0x60a3('0x4e');return db[_0x60a3('0x4f')][_0x60a3('0x47')]({'where':{'name':_0x19cdce,'userProfileId':_0x31c1c8[_0x60a3('0x50')]},'raw':!![]})['then'](function(_0x1a9a0e){if(_0x1a9a0e&&_0x1a9a0e[_0x60a3('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0xe5cd48[_0x60a3('0x27')],'resourceId':_0xe5cd48['id'],'type':_0x1a9a0e[_0x60a3('0x27')],'sectionId':_0x1a9a0e['id']},{})[_0x60a3('0x42')](function(){return _0x36eb19;});}else{return _0x36eb19;}})[_0x60a3('0x44')](function(_0xd0ad){logger['error'](_0x60a3('0x52'),_0xd0ad);throw _0xd0ad;});}return _0x36eb19;})[_0x60a3('0x42')](respondWithResult(_0x20b7c2,0xc9))[_0x60a3('0x44')](handleError(_0x20b7c2,null));};exports['update']=function(_0x3aa7a4,_0x5d850c){if(_0x3aa7a4[_0x60a3('0x49')]['id']){delete _0x3aa7a4[_0x60a3('0x49')]['id'];}return db['Team'][_0x60a3('0x47')]({'where':{'id':_0x3aa7a4[_0x60a3('0x45')]['id']}})[_0x60a3('0x42')](handleEntityNotFound(_0x5d850c,null))[_0x60a3('0x42')](saveUpdates(_0x3aa7a4[_0x60a3('0x49')],null))[_0x60a3('0x42')](respondWithResult(_0x5d850c,null))['catch'](handleError(_0x5d850c,null));};exports[_0x60a3('0x53')]=function(_0x7bcb58,_0x366e06){var _0x7e348b=_0x7bcb58['params']['id'];var _0x166de3=[];return db['sequelize']['transaction'](function(_0x4a2dd4){var _0x45e6df='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x7e348b;return db['sequelize'][_0x60a3('0x30')](_0x45e6df,{'type':db[_0x60a3('0x54')][_0x60a3('0x55')][_0x60a3('0x56')],'raw':!![],'transaction':_0x4a2dd4})[_0x60a3('0x42')](function(_0x649201){_0x166de3=_[_0x60a3('0x2a')](_0x649201,function(_0x42e239){return Number(_0x42e239[_0x60a3('0x57')]);});})[_0x60a3('0x42')](function(){var _0x485a3f=_0x60a3('0x58')+_0x7e348b;return db[_0x60a3('0x59')][_0x60a3('0x30')](_0x485a3f,{'type':db[_0x60a3('0x54')][_0x60a3('0x55')][_0x60a3('0x56')],'raw':!![],'transaction':_0x4a2dd4});})[_0x60a3('0x42')](function(_0x17403e){var _0x284d89=_['map'](_0x17403e,function(_0x1b3b18){return Number(_0x1b3b18[_0x60a3('0x5a')]);});return db[_0x60a3('0x5b')][_0x60a3('0x53')]({'where':{'UserId':{'$in':_0x166de3},'VoiceQueueId':{'$in':_0x284d89}},'transaction':_0x4a2dd4});})[_0x60a3('0x42')](function(){var _0xba5048='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x7e348b;return db[_0x60a3('0x59')][_0x60a3('0x30')](_0xba5048,{'type':db[_0x60a3('0x54')]['QueryTypes'][_0x60a3('0x56')],'raw':!![],'transaction':_0x4a2dd4});})[_0x60a3('0x42')](function(_0xe5e5c){var _0x14b413=_['map'](_0xe5e5c,function(_0x299810){return Number(_0x299810[_0x60a3('0x5c')]);});return db[_0x60a3('0x5d')][_0x60a3('0x53')]({'where':{'UserId':{'$in':_0x166de3},'MailQueueId':{'$in':_0x14b413}},'transaction':_0x4a2dd4});})[_0x60a3('0x42')](function(){var _0x5036b9=_0x60a3('0x5e')+_0x7e348b;return db[_0x60a3('0x59')][_0x60a3('0x30')](_0x5036b9,{'type':db[_0x60a3('0x54')][_0x60a3('0x55')][_0x60a3('0x56')],'raw':!![],'transaction':_0x4a2dd4});})[_0x60a3('0x42')](function(_0x50e70c){var _0x99a8c7=_[_0x60a3('0x2a')](_0x50e70c,function(_0x3a6efe){return Number(_0x3a6efe[_0x60a3('0x5f')]);});return db[_0x60a3('0x60')][_0x60a3('0x53')]({'where':{'UserId':{'$in':_0x166de3},'SmsQueueId':{'$in':_0x99a8c7}},'transaction':_0x4a2dd4});})['then'](function(){var _0x2ac340=_0x60a3('0x61')+_0x7e348b;return db[_0x60a3('0x59')][_0x60a3('0x30')](_0x2ac340,{'type':db[_0x60a3('0x54')][_0x60a3('0x55')]['SELECT'],'raw':!![],'transaction':_0x4a2dd4});})[_0x60a3('0x42')](function(_0x4e0687){var _0x4cfc5f=_[_0x60a3('0x2a')](_0x4e0687,function(_0x3265a7){return Number(_0x3265a7['ChatQueueId']);});return db[_0x60a3('0x62')][_0x60a3('0x53')]({'where':{'UserId':{'$in':_0x166de3},'ChatQueueId':{'$in':_0x4cfc5f}},'transaction':_0x4a2dd4});})[_0x60a3('0x42')](function(){var _0x4efa80=_0x60a3('0x63')+_0x7e348b;return db['sequelize'][_0x60a3('0x30')](_0x4efa80,{'type':db['Sequelize']['QueryTypes'][_0x60a3('0x56')],'raw':!![],'transaction':_0x4a2dd4});})[_0x60a3('0x42')](function(_0x2e630b){var _0x442cce=_['map'](_0x2e630b,function(_0x4d54e4){return Number(_0x4d54e4[_0x60a3('0x64')]);});return db['UserFaxQueue'][_0x60a3('0x53')]({'where':{'UserId':{'$in':_0x166de3},'FaxQueueId':{'$in':_0x442cce}},'transaction':_0x4a2dd4});})[_0x60a3('0x42')](function(){var _0x4da0c5=_0x60a3('0x65')+_0x7e348b;return db[_0x60a3('0x59')][_0x60a3('0x30')](_0x4da0c5,{'type':db[_0x60a3('0x54')]['QueryTypes'][_0x60a3('0x56')],'raw':!![],'transaction':_0x4a2dd4});})[_0x60a3('0x42')](function(_0x406135){var _0xed3bcd=_[_0x60a3('0x2a')](_0x406135,function(_0x110458){return Number(_0x110458['OpenchannelQueueId']);});return db['UserOpenchannelQueue'][_0x60a3('0x53')]({'where':{'UserId':{'$in':_0x166de3},'OpenchannelQueueId':{'$in':_0xed3bcd}},'transaction':_0x4a2dd4});})['then'](function(){var _0x18750f=_0x60a3('0x66')+_0x7e348b;return db[_0x60a3('0x59')][_0x60a3('0x30')](_0x18750f,{'type':db['Sequelize']['QueryTypes'][_0x60a3('0x56')],'raw':!![],'transaction':_0x4a2dd4});})[_0x60a3('0x42')](function(_0x4c50ef){var _0x5c8ed4=_[_0x60a3('0x2a')](_0x4c50ef,function(_0x403533){return Number(_0x403533[_0x60a3('0x67')]);});return db[_0x60a3('0x68')]['destroy']({'where':{'UserId':{'$in':_0x166de3},'WhatsappQueueId':{'$in':_0x5c8ed4}},'transaction':_0x4a2dd4});})[_0x60a3('0x42')](function(){return db[_0x60a3('0x69')][_0x60a3('0x47')]({'where':{'TeamId':_0x7e348b}});})[_0x60a3('0x42')](function(_0x77bac0){if(_0x77bac0===null){return;}return db['UserVoicePrefix']['destroy']({'where':{'UserId':{'$in':_0x166de3},'VoicePrefixId':_0x77bac0['VoicePrefixId']},'transaction':_0x4a2dd4});})[_0x60a3('0x42')](function(){return db[_0x60a3('0x2b')][_0x60a3('0x53')]({'where':{'id':_0x7e348b},'cascade':!![],'transaction':_0x4a2dd4});})['then'](function(_0x35cf46){if(_0x35cf46===0x0){_0x366e06[_0x60a3('0x1c')](0x194);}else{return db[_0x60a3('0x6a')][_0x60a3('0x53')]({'where':{'type':'Teams','resourceId':_0x7e348b},'cascade':!![],'transaction':_0x4a2dd4})[_0x60a3('0x42')](function(){_0x366e06[_0x60a3('0x1d')](0xcc)['end']();});}})[_0x60a3('0x44')](function(_0x10c0f3){_0x366e06['status'](0x1f4)[_0x60a3('0x28')](_0x10c0f3);});});};exports[_0x60a3('0x6b')]=function(_0x147bcf,_0x316f96,_0x3d395b){return db['Team'][_0x60a3('0x6c')]({'where':{'id':_0x147bcf[_0x60a3('0x45')]['id']}})[_0x60a3('0x42')](handleEntityNotFound(_0x316f96,null))[_0x60a3('0x42')](function(_0x57daa7){if(!_0x147bcf[_0x60a3('0x30')][_0x60a3('0x6d')]||!utils[_0x60a3('0x6e')](_0x147bcf[_0x60a3('0x30')][_0x60a3('0x6d')])){throw new db['Sequelize'][(_0x60a3('0x6f'))](_0x60a3('0x70'));}var _0x40dbe8={};var _0x311f12={};_0x311f12[_0x60a3('0x2f')]=_['keys'](db[_[_0x60a3('0x71')](_0x147bcf[_0x60a3('0x30')][_0x60a3('0x6d')][_0x60a3('0x72')]())+_0x60a3('0x73')]['rawAttributes']);_0x311f12[_0x60a3('0x30')]=_['keys'](_0x147bcf[_0x60a3('0x30')]);_0x311f12[_0x60a3('0x32')]=_['intersection'](_0x311f12['model'],_0x311f12[_0x60a3('0x30')]);_0x40dbe8[_0x60a3('0x34')]=_[_0x60a3('0x46')](_0x311f12[_0x60a3('0x2f')],qs['fields'](_0x147bcf[_0x60a3('0x30')][_0x60a3('0x33')]));_0x40dbe8[_0x60a3('0x34')]=_0x40dbe8['attributes']['length']?_0x40dbe8[_0x60a3('0x34')]:_0x311f12[_0x60a3('0x2f')];_0x40dbe8[_0x60a3('0x1f')]=qs[_0x60a3('0x1f')](_0x147bcf[_0x60a3('0x30')][_0x60a3('0x1f')]);_0x40dbe8['offset']=qs[_0x60a3('0x21')](_0x147bcf[_0x60a3('0x30')][_0x60a3('0x21')]);_0x40dbe8['order']=qs[_0x60a3('0x39')](_0x147bcf[_0x60a3('0x30')][_0x60a3('0x39')]);_0x40dbe8['where']=qs[_0x60a3('0x32')](_[_0x60a3('0x3b')](_0x147bcf[_0x60a3('0x30')],_0x311f12[_0x60a3('0x32')]));_0x40dbe8=_['merge']({},_0x40dbe8,_0x147bcf['options']);return _0x57daa7[_0x60a3('0x4b')+_[_0x60a3('0x71')](_0x147bcf['query'][_0x60a3('0x6d')]['toLowerCase']())+_0x60a3('0x74')](_0x40dbe8);})[_0x60a3('0x42')](respondWithResult(_0x316f96,null))[_0x60a3('0x44')](handleError(_0x316f96,null));};exports[_0x60a3('0x75')]=function(_0x2fe29e,_0x5286a8,_0x48119b){return db['Team']['findOne']({'where':{'id':_0x2fe29e['params']['id']}})['then'](function(_0x5c076b){if(_0x5c076b){if(!_0x2fe29e[_0x60a3('0x49')]['channel']||!utils[_0x60a3('0x6e')](_0x2fe29e[_0x60a3('0x49')]['channel'])){throw new db[(_0x60a3('0x54'))][(_0x60a3('0x6f'))](_0x60a3('0x70'));}return _0x5c076b[_0x60a3('0x76')+_['capitalize'](_0x2fe29e[_0x60a3('0x49')]['channel'][_0x60a3('0x72')]())+'Queues'](_0x2fe29e[_0x60a3('0x49')][_0x60a3('0x77')]);}return null;})[_0x60a3('0x42')](handleEntityNotFound(_0x5286a8,null))[_0x60a3('0x42')](respondWithStatusCode(_0x5286a8,null))[_0x60a3('0x44')](handleError(_0x5286a8,null));};exports[_0x60a3('0x78')]=function(_0x30d591,_0x353aaa,_0x54c02a){return db[_0x60a3('0x2b')][_0x60a3('0x6c')]({'where':{'id':_0x30d591[_0x60a3('0x45')]['id']}})[_0x60a3('0x42')](function(_0x39a106){if(_0x39a106){if(!_0x30d591[_0x60a3('0x30')][_0x60a3('0x6d')]||!utils[_0x60a3('0x6e')](_0x30d591[_0x60a3('0x30')]['channel'])){throw new db[(_0x60a3('0x54'))][(_0x60a3('0x6f'))](_0x60a3('0x70'));}return _0x39a106[_0x60a3('0x79')+_[_0x60a3('0x71')](_0x30d591[_0x60a3('0x30')][_0x60a3('0x6d')]['toLowerCase']())+_0x60a3('0x74')](_0x30d591[_0x60a3('0x30')][_0x60a3('0x77')]);}return null;})[_0x60a3('0x42')](handleEntityNotFound(_0x353aaa,null))['then'](respondWithStatusCode(_0x353aaa,null))[_0x60a3('0x44')](handleError(_0x353aaa,null));};exports[_0x60a3('0x7a')]=function(_0x517295,_0x80555){var _0x19be05=_['isArray'](_0x517295[_0x60a3('0x49')]['ids'])?_0x517295[_0x60a3('0x49')]['ids']:[_0x517295[_0x60a3('0x49')]['ids']];var _0x6f1164=_0x517295[_0x60a3('0x45')]['id'];return db[_0x60a3('0x2b')][_0x60a3('0x47')]({'where':{'id':_0x6f1164}})[_0x60a3('0x42')](handleEntityNotFound(_0x80555,null))[_0x60a3('0x42')](function(_0x57f0af){if(_0x57f0af){var _0x65e2b4=['Voice',_0x60a3('0x7b'),_0x60a3('0x7c'),_0x60a3('0x7d'),_0x60a3('0x7e'),_0x60a3('0x7f'),_0x60a3('0x80')];return db[_0x60a3('0x59')]['transaction'](function(_0xf0a2e9){var _0x4a39b0=_['map'](_0x65e2b4,function(_0x2fba1f){var _0x58cfd5={'attributes':['id',_0x60a3('0x27')]};if(_0x2fba1f===_0x60a3('0x81')){_0x58cfd5[_0x60a3('0x82')]={'attributes':['penalty']};}return _0x57f0af[_0x60a3('0x4b')+_0x2fba1f+_0x60a3('0x74')](_0x58cfd5)[_0x60a3('0x42')](function(_0x12b00b){var _0x374c32=_[_0x60a3('0x2a')](_0x12b00b,function(_0x188936){var _0xb1740e=_[_0x60a3('0x2a')](_0x19be05,function(_0x1a809b){var _0x511492={'where':{'UserId':_0x1a809b,[_0x2fba1f+_0x60a3('0x83')]:_0x188936['id']},'transaction':_0xf0a2e9};if(_0x2fba1f===_0x60a3('0x81')){_0x511492['defaults']={'penalty':_0x188936[_0x60a3('0x84')][_0x60a3('0x85')]};}return db[_0x60a3('0x86')+_0x2fba1f+_0x60a3('0x73')][_0x60a3('0x87')](_0x511492)[_0x60a3('0x42')](function(){socket[_0x60a3('0x88')](_0x60a3('0x4a')+_0x2fba1f+_0x60a3('0x89'),{'UserId':_0x1a809b,[_0x2fba1f+_0x60a3('0x83')]:_0x188936['id']});if(_0x2fba1f!==_0x60a3('0x81')){return;}return db[_0x60a3('0x86')][_0x60a3('0x41')]({'where':{'id':_0x19be05,'online':0x1},'attributes':['id',_0x60a3('0x27'),_0x60a3('0x8a'),_0x60a3('0x8b'),_0x60a3('0x8c')],'raw':!![]})[_0x60a3('0x42')](function(_0x38c14b){var _0x1880f0=_['map'](_0x38c14b,function(_0x588cf7){return db[_0x60a3('0x8d')][_0x60a3('0x8e')]({'membername':_0x588cf7[_0x60a3('0x27')],'UserId':_0x588cf7['id'],'queue_name':_0x188936[_0x60a3('0x27')],'VoiceQueueId':_0x188936['id'],'interface':_[_0x60a3('0x8f')](_0x588cf7[_0x60a3('0x8c')])?util[_0x60a3('0x90')](_0x60a3('0x91'),_0x588cf7[_0x60a3('0x27')]):_0x588cf7[_0x60a3('0x8c')],'paused':_0x588cf7[_0x60a3('0x8b')]||![],'penalty':_0x188936[_0x60a3('0x84')]['penalty']},{'transaction':_0xf0a2e9});});return Promise[_0x60a3('0x92')](_0x1880f0);});});});return Promise[_0x60a3('0x92')](_0xb1740e);});return Promise[_0x60a3('0x92')](_0x374c32);})[_0x60a3('0x42')](function(){return db[_0x60a3('0x69')][_0x60a3('0x6c')]({'where':{'teamId':_0x6f1164}})[_0x60a3('0x42')](function(_0x2b8b44){if(_0x2b8b44){var _0x460ab4=_['map'](_0x19be05,function(_0xc4a1a4){db[_0x60a3('0x93')][_0x60a3('0x8e')]({'UserId':_0xc4a1a4,'VoicePrefixId':_0x2b8b44['VoicePrefixId']});});return Promise[_0x60a3('0x92')](_0x460ab4);}});});});return Promise['all'](_0x4a39b0)[_0x60a3('0x42')](function(){return _0x57f0af[_0x60a3('0x7a')](_0x19be05,{'transaction':_0xf0a2e9})[_0x60a3('0x94')](function(_0x317ce6){return _0x317ce6;});});});}})[_0x60a3('0x42')](respondWithResult(_0x80555,null))[_0x60a3('0x44')](handleError(_0x80555,null));};exports['removeAgents']=function(_0xa01280,_0x56517d){var _0x1e916e=_[_0x60a3('0x95')](_0xa01280['query'][_0x60a3('0x77')])?_0xa01280[_0x60a3('0x30')][_0x60a3('0x77')]:[_0xa01280[_0x60a3('0x30')][_0x60a3('0x77')]];var _0x15796b=_0xa01280['params']['id'];return db['Team'][_0x60a3('0x47')]({'where':{'id':_0x15796b}})['then'](handleEntityNotFound(_0x56517d,null))[_0x60a3('0x42')](function(_0x49c61a){if(_0x49c61a){var _0xd3934c=[_0x60a3('0x81'),_0x60a3('0x7b'),'Mail',_0x60a3('0x7d'),_0x60a3('0x7e'),_0x60a3('0x7f'),_0x60a3('0x80')];return db['sequelize'][_0x60a3('0x96')](function(_0x427c06){var _0x5cfc03=_[_0x60a3('0x2a')](_0xd3934c,function(_0x1949af){var _0x260a29={'attributes':['id','name']};return _0x49c61a[_0x60a3('0x4b')+_0x1949af+_0x60a3('0x74')](_0x260a29)[_0x60a3('0x42')](function(_0x414c67){var _0xb82dda=_[_0x60a3('0x2a')](_0x414c67,function(_0x340171){return _0x340171[_0x60a3('0x97')](_0x1e916e,{'transaction':_0x427c06})[_0x60a3('0x42')](function(){var _0x3c0611=_[_0x60a3('0x2a')](_0x1e916e,function(_0x4a54bd){socket[_0x60a3('0x88')](_0x60a3('0x4a')+_0x1949af+_0x60a3('0x98'),{'UserId':Number(_0x4a54bd),[_0x1949af+_0x60a3('0x83')]:_0x340171['id']});if(_0x1949af!==_0x60a3('0x81')){return;}return db['UserVoiceQueueRt'][_0x60a3('0x53')]({'where':{'VoiceQueueId':_0x340171['id'],'UserId':_0x4a54bd},'transaction':_0x427c06});});return Promise['all'](_0x3c0611);});});return Promise['all'](_0xb82dda);});});return Promise[_0x60a3('0x92')](_0x5cfc03)[_0x60a3('0x42')](function(){return _0x49c61a[_0x60a3('0x97')](_0x1e916e,{'transaction':_0x427c06});})[_0x60a3('0x42')](function(){return db[_0x60a3('0x69')][_0x60a3('0x6c')]({'where':{'teamId':_0x15796b}})['then'](function(_0x5049ec){if(_0x5049ec){var _0x447f43=_[_0x60a3('0x2a')](_0x1e916e,function(_0x29e99c){db[_0x60a3('0x93')]['destroy']({'where':{'UserId':_0x29e99c,'VoicePrefixId':_0x5049ec[_0x60a3('0x99')]}});});return Promise['all'](_0x447f43);}});});});}})[_0x60a3('0x42')](respondWithStatusCode(_0x56517d,null))['catch'](handleError(_0x56517d,null));};exports[_0x60a3('0x9a')]=function(_0x5e86d9,_0x15a052,_0x4e9c7a){var _0x4ff1d4={};var _0x646c3e={};var _0x20ac1a;var _0x1ea0d5;return db[_0x60a3('0x2b')][_0x60a3('0x6c')]({'where':{'id':_0x5e86d9[_0x60a3('0x45')]['id']}})['then'](handleEntityNotFound(_0x15a052,null))[_0x60a3('0x42')](function(_0x185835){if(_0x185835){_0x20ac1a=_0x185835;_0x646c3e[_0x60a3('0x2f')]=_[_0x60a3('0x31')](db[_0x60a3('0x86')][_0x60a3('0x9b')]);_0x646c3e[_0x60a3('0x30')]=_[_0x60a3('0x31')](_0x5e86d9[_0x60a3('0x30')]);_0x646c3e['filters']=_[_0x60a3('0x46')](_0x646c3e[_0x60a3('0x2f')],_0x646c3e[_0x60a3('0x30')]);_0x4ff1d4[_0x60a3('0x34')]=_[_0x60a3('0x46')](_0x646c3e[_0x60a3('0x2f')],qs[_0x60a3('0x33')](_0x5e86d9['query'][_0x60a3('0x33')]));_0x4ff1d4[_0x60a3('0x34')]=_0x4ff1d4['attributes']['length']?_0x4ff1d4[_0x60a3('0x34')]:_0x646c3e[_0x60a3('0x2f')];_0x4ff1d4[_0x60a3('0x38')]=qs[_0x60a3('0x39')](_0x5e86d9[_0x60a3('0x30')][_0x60a3('0x39')]);_0x4ff1d4['where']=qs[_0x60a3('0x32')](_[_0x60a3('0x3b')](_0x5e86d9['query'],_0x646c3e[_0x60a3('0x32')]));if(_0x5e86d9[_0x60a3('0x30')][_0x60a3('0x3c')]){_0x4ff1d4['where']=_['merge'](_0x4ff1d4[_0x60a3('0x3a')],{'$or':_[_0x60a3('0x2a')](_0x4ff1d4[_0x60a3('0x34')],function(_0x2c71a8){var _0x197a3e={};_0x197a3e[_0x2c71a8]={'$like':'%'+_0x5e86d9[_0x60a3('0x30')]['filter']+'%'};return _0x197a3e;})});}_0x4ff1d4=_['merge']({},_0x4ff1d4,_0x5e86d9['options']);return _0x20ac1a[_0x60a3('0x9a')](_0x4ff1d4);}})[_0x60a3('0x42')](function(_0x55bc26){if(_0x55bc26){_0x1ea0d5=_0x55bc26['length'];if(!_0x5e86d9[_0x60a3('0x30')][_0x60a3('0x36')]('nolimit')){_0x4ff1d4[_0x60a3('0x1f')]=qs['limit'](_0x5e86d9[_0x60a3('0x30')][_0x60a3('0x1f')]);_0x4ff1d4[_0x60a3('0x21')]=qs[_0x60a3('0x21')](_0x5e86d9[_0x60a3('0x30')][_0x60a3('0x21')]);}return _0x20ac1a[_0x60a3('0x9a')](_0x4ff1d4);}})['then'](function(_0x56816a){if(_0x56816a){return _0x56816a?{'count':_0x1ea0d5,'rows':_0x56816a}:null;}})[_0x60a3('0x42')](respondWithResult(_0x15a052,null))[_0x60a3('0x44')](handleError(_0x15a052,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index d3a326f..5cedc7a 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 _0x269d=['setMaxListeners','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','Team'];(function(_0x179d47,_0x21361b){var _0x56e254=function(_0x20833d){while(--_0x20833d){_0x179d47['push'](_0x179d47['shift']());}};_0x56e254(++_0x21361b);}(_0x269d,0xf0));var _0xd269=function(_0xdc3cea,_0x42bf80){_0xdc3cea=_0xdc3cea-0x0;var _0x23a31b=_0x269d[_0xdc3cea];return _0x23a31b;};'use strict';var EventEmitter=require(_0xd269('0x0'));var Team=require(_0xd269('0x1'))['db'][_0xd269('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0xd269('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd269('0x4'),'afterDestroy':_0xd269('0x5')};function emitEvent(_0x5df9a8){return function(_0xd2646,_0x6972a6,_0x222a25){TeamEvents[_0xd269('0x6')](_0x5df9a8+':'+_0xd2646['id'],_0xd2646);TeamEvents[_0xd269('0x6')](_0x5df9a8,_0xd2646);_0x222a25(null);};}for(var e in events){if(events[_0xd269('0x7')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0xd269('0x8')]=TeamEvents; \ No newline at end of file +var _0xa894=['emit','hasOwnProperty','events','../../mysqldb','Team','setMaxListeners','update'];(function(_0x36436d,_0x20292c){var _0x34615d=function(_0x5447af){while(--_0x5447af){_0x36436d['push'](_0x36436d['shift']());}};_0x34615d(++_0x20292c);}(_0xa894,0x1de));var _0x4a89=function(_0x521df7,_0x277fd6){_0x521df7=_0x521df7-0x0;var _0x4b57b5=_0xa894[_0x521df7];return _0x4b57b5;};'use strict';var EventEmitter=require(_0x4a89('0x0'));var Team=require(_0x4a89('0x1'))['db'][_0x4a89('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x4a89('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4a89('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4d2909){return function(_0x1b4ba1,_0x24fdd2,_0x55a89b){TeamEvents['emit'](_0x4d2909+':'+_0x1b4ba1['id'],_0x1b4ba1);TeamEvents[_0x4a89('0x5')](_0x4d2909,_0x1b4ba1);_0x55a89b(null);};}for(var e in events){if(events[_0x4a89('0x6')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 15d8b6b..748a899 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 _0x27a9=['lodash','util','../../config/logger','api','request-promise','rimraf','Team','teams'];(function(_0x356d98,_0x223501){var _0x2192db=function(_0xac4fee){while(--_0xac4fee){_0x356d98['push'](_0x356d98['shift']());}};_0x2192db(++_0x223501);}(_0x27a9,0xd0));var _0x927a=function(_0x26ec36,_0x376167){_0x26ec36=_0x26ec36-0x0;var _0x23e220=_0x27a9[_0x26ec36];return _0x23e220;};'use strict';var _=require(_0x927a('0x0'));var util=require(_0x927a('0x1'));var logger=require(_0x927a('0x2'))(_0x927a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x927a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x927a('0x5'));var config=require('../../config/environment');var attributes=require('./team.attributes');module['exports']=function(_0x14d28c,_0x4e2ce1){return _0x14d28c['define'](_0x927a('0x6'),attributes,{'tableName':_0x927a('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa994=['rimraf','../../config/environment','./team.attributes','define','teams','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1ed7f7,_0x5e3e5c){var _0x227d28=function(_0x2548ad){while(--_0x2548ad){_0x1ed7f7['push'](_0x1ed7f7['shift']());}};_0x227d28(++_0x5e3e5c);}(_0xa994,0x14f));var _0x4a99=function(_0x2c77ae,_0x2f874f){_0x2c77ae=_0x2c77ae-0x0;var _0x1bb2a4=_0xa994[_0x2c77ae];return _0x1bb2a4;};'use strict';var _=require('lodash');var util=require(_0x4a99('0x0'));var logger=require(_0x4a99('0x1'))(_0x4a99('0x2'));var moment=require(_0x4a99('0x3'));var BPromise=require(_0x4a99('0x4'));var rp=require(_0x4a99('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4a99('0x6'));var config=require(_0x4a99('0x7'));var attributes=require(_0x4a99('0x8'));module['exports']=function(_0x363119,_0x34d173){return _0x363119[_0x4a99('0x9')]('Team',attributes,{'tableName':_0x4a99('0xa'),'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 13bfd90..abfb875 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 _0x9497=['defaults','redis','socket.io-emitter','./team.socket','register','request','then','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','Team,\x20%s,\x20%s','error','message','result','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x4c4d07,_0x56516f){var _0x562455=function(_0x1e1df5){while(--_0x1e1df5){_0x4c4d07['push'](_0x4c4d07['shift']());}};_0x562455(++_0x56516f);}(_0x9497,0x15f));var _0x7949=function(_0x441125,_0x2a5910){_0x441125=_0x441125-0x0;var _0x3a3cd0=_0x9497[_0x441125];return _0x3a3cd0;};'use strict';var _=require('lodash');var util=require(_0x7949('0x0'));var moment=require('moment');var BPromise=require(_0x7949('0x1'));var rs=require(_0x7949('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7949('0x3'));var logger=require(_0x7949('0x4'))(_0x7949('0x5'));var config=require('../../config/environment');var jayson=require(_0x7949('0x6'));var client=jayson[_0x7949('0x7')][_0x7949('0x8')]({'port':0x232a});config['redis']=_[_0x7949('0x9')](config[_0x7949('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x7949('0xb'))(new Redis(config[_0x7949('0xa')]));require(_0x7949('0xc'))[_0x7949('0xd')](socket);function respondWithRpcPromise(_0x2ec08e,_0x3eab15,_0xebd380){return new BPromise(function(_0x522214,_0x548eea){return client[_0x7949('0xe')](_0x2ec08e,_0xebd380)[_0x7949('0xf')](function(_0x1c1862){logger['info']('Team,\x20%s,\x20%s',_0x3eab15,_0x7949('0x10'));logger[_0x7949('0x11')](_0x7949('0x12'),_0x3eab15,_0x7949('0x10'),JSON[_0x7949('0x13')](_0x1c1862));if(_0x1c1862['error']){if(_0x1c1862['error']['code']===0x1f4){logger['error'](_0x7949('0x14'),_0x3eab15,_0x1c1862[_0x7949('0x15')][_0x7949('0x16')]);return _0x548eea(_0x1c1862['error'][_0x7949('0x16')]);}logger[_0x7949('0x15')]('Team,\x20%s,\x20%s',_0x3eab15,_0x1c1862[_0x7949('0x15')][_0x7949('0x16')]);return _0x522214(_0x1c1862[_0x7949('0x15')][_0x7949('0x16')]);}else{logger['info'](_0x7949('0x14'),_0x3eab15,'request\x20sent');_0x522214(_0x1c1862[_0x7949('0x17')]['message']);}})['catch'](function(_0x39d23a){logger[_0x7949('0x15')]('Team,\x20%s,\x20%s',_0x3eab15,_0x39d23a);_0x548eea(_0x39d23a);});});} \ No newline at end of file +var _0xa858=['info','Team,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./team.socket','register','request','then'];(function(_0x49a762,_0x366bba){var _0x55c3a5=function(_0x39bbbf){while(--_0x39bbbf){_0x49a762['push'](_0x49a762['shift']());}};_0x55c3a5(++_0x366bba);}(_0xa858,0x175));var _0x8a85=function(_0x54799,_0x139c2a){_0x54799=_0x54799-0x0;var _0x26a54b=_0xa858[_0x54799];return _0x26a54b;};'use strict';var _=require(_0x8a85('0x0'));var util=require('util');var moment=require(_0x8a85('0x1'));var BPromise=require(_0x8a85('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a85('0x3'));var db=require(_0x8a85('0x4'))['db'];var utils=require(_0x8a85('0x5'));var logger=require(_0x8a85('0x6'))(_0x8a85('0x7'));var config=require('../../config/environment');var jayson=require(_0x8a85('0x8'));var client=jayson[_0x8a85('0x9')][_0x8a85('0xa')]({'port':0x232a});config[_0x8a85('0xb')]=_[_0x8a85('0xc')](config['redis'],{'host':_0x8a85('0xd'),'port':0x18eb});var socket=require(_0x8a85('0xe'))(new Redis(config[_0x8a85('0xb')]));require(_0x8a85('0xf'))[_0x8a85('0x10')](socket);function respondWithRpcPromise(_0x112501,_0x10112d,_0x21e4db){return new BPromise(function(_0x12257f,_0x43d1e4){return client[_0x8a85('0x11')](_0x112501,_0x21e4db)[_0x8a85('0x12')](function(_0x38affa){logger[_0x8a85('0x13')](_0x8a85('0x14'),_0x10112d,_0x8a85('0x15'));logger[_0x8a85('0x16')]('Team,\x20%s,\x20%s,\x20%s',_0x10112d,_0x8a85('0x15'),JSON[_0x8a85('0x17')](_0x38affa));if(_0x38affa[_0x8a85('0x18')]){if(_0x38affa[_0x8a85('0x18')]['code']===0x1f4){logger['error']('Team,\x20%s,\x20%s',_0x10112d,_0x38affa[_0x8a85('0x18')]['message']);return _0x43d1e4(_0x38affa[_0x8a85('0x18')][_0x8a85('0x19')]);}logger[_0x8a85('0x18')](_0x8a85('0x14'),_0x10112d,_0x38affa['error'][_0x8a85('0x19')]);return _0x12257f(_0x38affa[_0x8a85('0x18')][_0x8a85('0x19')]);}else{logger['info'](_0x8a85('0x14'),_0x10112d,_0x8a85('0x15'));_0x12257f(_0x38affa[_0x8a85('0x1a')][_0x8a85('0x19')]);}})[_0x8a85('0x1b')](function(_0x5b3f48){logger[_0x8a85('0x18')](_0x8a85('0x14'),_0x10112d,_0x5b3f48);_0x43d1e4(_0x5b3f48);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 009392d..7213072 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 _0xeaef=['save','remove','update','emit','register','length','./team.events'];(function(_0x2c9967,_0x514917){var _0x261dcc=function(_0x36eaa6){while(--_0x36eaa6){_0x2c9967['push'](_0x2c9967['shift']());}};_0x261dcc(++_0x514917);}(_0xeaef,0xfb));var _0xfeae=function(_0x46878c,_0x284c4b){_0x46878c=_0x46878c-0x0;var _0x3cbe13=_0xeaef[_0x46878c];return _0x3cbe13;};'use strict';var TeamEvents=require(_0xfeae('0x0'));var events=[_0xfeae('0x1'),_0xfeae('0x2'),_0xfeae('0x3')];function createListener(_0xb584c2,_0x4017a9){return function(_0x5c2e18){_0x4017a9[_0xfeae('0x4')](_0xb584c2,_0x5c2e18);};}function removeListener(_0x1fe568,_0x3eb9ee){return function(){TeamEvents['removeListener'](_0x1fe568,_0x3eb9ee);};}exports[_0xfeae('0x5')]=function(_0x769966){for(var _0x2ac280=0x0,_0x4571f8=events[_0xfeae('0x6')];_0x2ac280<_0x4571f8;_0x2ac280++){var _0x587a6d=events[_0x2ac280];var _0x5dcb74=createListener('team:'+_0x587a6d,_0x769966);TeamEvents['on'](_0x587a6d,_0x5dcb74);}}; \ No newline at end of file +var _0xf4d4=['remove','emit','removeListener','register','length','./team.events','save'];(function(_0x59b661,_0xf20b42){var _0x2bd02c=function(_0x52f4fa){while(--_0x52f4fa){_0x59b661['push'](_0x59b661['shift']());}};_0x2bd02c(++_0xf20b42);}(_0xf4d4,0xf3));var _0x4f4d=function(_0x5381cb,_0x87467c){_0x5381cb=_0x5381cb-0x0;var _0x5c5715=_0xf4d4[_0x5381cb];return _0x5c5715;};'use strict';var TeamEvents=require(_0x4f4d('0x0'));var events=[_0x4f4d('0x1'),_0x4f4d('0x2'),'update'];function createListener(_0x81e6a1,_0x20a196){return function(_0x105103){_0x20a196[_0x4f4d('0x3')](_0x81e6a1,_0x105103);};}function removeListener(_0x46e994,_0x1654c8){return function(){TeamEvents[_0x4f4d('0x4')](_0x46e994,_0x1654c8);};}exports[_0x4f4d('0x5')]=function(_0x4f43b7){for(var _0x6c46f1=0x0,_0x4e2c31=events[_0x4f4d('0x6')];_0x6c46f1<_0x4e2c31;_0x6c46f1++){var _0x4cab19=events[_0x6c46f1];var _0x4d3b45=createListener('team:'+_0x4cab19,_0x4f43b7);TeamEvents['on'](_0x4cab19,_0x4d3b45);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 1095030..d33ffc9 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 _0xdbe1=['INTEGER','sequelize'];(function(_0x366b86,_0x7b551f){var _0x38ff6f=function(_0x3ce5bf){while(--_0x3ce5bf){_0x366b86['push'](_0x366b86['shift']());}};_0x38ff6f(++_0x7b551f);}(_0xdbe1,0x137));var _0x1dbe=function(_0x4ca11d,_0x460c30){_0x4ca11d=_0x4ca11d-0x0;var _0x14507a=_0xdbe1[_0x4ca11d];return _0x14507a;};'use strict';var Sequelize=require(_0x1dbe('0x0'));module['exports']={'TeamId':{'type':Sequelize[_0x1dbe('0x1')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x0b30=['sequelize','exports','INTEGER'];(function(_0x803af5,_0x57beec){var _0x3f70d5=function(_0x81cbca){while(--_0x81cbca){_0x803af5['push'](_0x803af5['shift']());}};_0x3f70d5(++_0x57beec);}(_0x0b30,0x1a7));var _0x00b3=function(_0x42ef57,_0x54b80a){_0x42ef57=_0x42ef57-0x0;var _0x353f41=_0x0b30[_0x42ef57];return _0x353f41;};'use strict';var Sequelize=require(_0x00b3('0x0'));module[_0x00b3('0x1')]={'TeamId':{'type':Sequelize[_0x00b3('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x00b3('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 1922714..f7b1f36 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 _0x4dfc=['define','team_has_voice_prefixes','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xf7fa47,_0x324cdc){var _0x44625b=function(_0x460bb1){while(--_0x460bb1){_0xf7fa47['push'](_0xf7fa47['shift']());}};_0x44625b(++_0x324cdc);}(_0x4dfc,0xda));var _0xc4df=function(_0x40001a,_0x57f2ae){_0x40001a=_0x40001a-0x0;var _0x4cec45=_0x4dfc[_0x40001a];return _0x4cec45;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xc4df('0x0'));var moment=require(_0xc4df('0x1'));var BPromise=require(_0xc4df('0x2'));var rp=require(_0xc4df('0x3'));var fs=require('fs');var path=require(_0xc4df('0x4'));var rimraf=require(_0xc4df('0x5'));var config=require(_0xc4df('0x6'));var attributes=require('./teamVoicePrefix.attributes');module['exports']=function(_0x5814de,_0x27d2b2){return _0x5814de[_0xc4df('0x7')]('TeamVoicePrefix',attributes,{'tableName':_0xc4df('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbd5f=['./teamVoicePrefix.attributes','exports','define','team_has_voice_prefixes','lodash','util','../../config/logger','moment','request-promise','rimraf','../../config/environment'];(function(_0x51c6a5,_0x11950b){var _0x5e753a=function(_0x211f22){while(--_0x211f22){_0x51c6a5['push'](_0x51c6a5['shift']());}};_0x5e753a(++_0x11950b);}(_0xbd5f,0x1c7));var _0xfbd5=function(_0x56c6d4,_0x2ad88f){_0x56c6d4=_0x56c6d4-0x0;var _0xbca8e8=_0xbd5f[_0x56c6d4];return _0xbca8e8;};'use strict';var _=require(_0xfbd5('0x0'));var util=require(_0xfbd5('0x1'));var logger=require(_0xfbd5('0x2'))('api');var moment=require(_0xfbd5('0x3'));var BPromise=require('bluebird');var rp=require(_0xfbd5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfbd5('0x5'));var config=require(_0xfbd5('0x6'));var attributes=require(_0xfbd5('0x7'));module[_0xfbd5('0x8')]=function(_0x26f5ea,_0x9df06e){return _0x26f5ea[_0xfbd5('0x9')]('TeamVoicePrefix',attributes,{'tableName':_0xfbd5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 7011204..04a6590 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x3830d9,_0x475918){var _0x501cc7=function(_0x30f342){while(--_0x30f342){_0x3830d9['push'](_0x3830d9['shift']());}};_0x501cc7(++_0x475918);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x44dba1,_0x270ad5){var _0x2fbd3f=function(_0x5e0865){while(--_0x5e0865){_0x44dba1['push'](_0x44dba1['shift']());}};_0x2fbd3f(++_0x270ad5);}(_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 5374dbd..a53eac3 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 _0xd68d=['exports','sequelize'];(function(_0x407839,_0x3819c8){var _0x1e8e86=function(_0x2f4967){while(--_0x2f4967){_0x407839['push'](_0x407839['shift']());}};_0x1e8e86(++_0x3819c8);}(_0xd68d,0x7f));var _0xdd68=function(_0x293a43,_0x1942a0){_0x293a43=_0x293a43-0x0;var _0x2e2b5f=_0xd68d[_0x293a43];return _0x2e2b5f;};'use strict';var Sequelize=require(_0xdd68('0x0'));module[_0xdd68('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x20d7=['INTEGER'];(function(_0xcddd86,_0x515eec){var _0x17a53f=function(_0x2b241f){while(--_0x2b241f){_0xcddd86['push'](_0xcddd86['shift']());}};_0x17a53f(++_0x515eec);}(_0x20d7,0x146));var _0x720d=function(_0x458e8d,_0x3a36ae){_0x458e8d=_0x458e8d-0x0;var _0x153306=_0x20d7[_0x458e8d];return _0x153306;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x720d('0x0')],'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 a2af197..6960d7a 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 _0x6364=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','TeamVoiceQueue'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0x6364,0x8f));var _0x4636=function(_0x294c8d,_0xe935b0){_0x294c8d=_0x294c8d-0x0;var _0x4d90c9=_0x6364[_0x294c8d];return _0x4d90c9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4636('0x0'))(_0x4636('0x1'));var moment=require(_0x4636('0x2'));var BPromise=require(_0x4636('0x3'));var rp=require(_0x4636('0x4'));var fs=require('fs');var path=require(_0x4636('0x5'));var rimraf=require(_0x4636('0x6'));var config=require(_0x4636('0x7'));var attributes=require('./teamVoiceQueue.attributes');module[_0x4636('0x8')]=function(_0x30201f,_0x3e0ed6){return _0x30201f[_0x4636('0x9')](_0x4636('0xa'),attributes,{'tableName':'team_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb2b5=['exports','define','moment','bluebird','rimraf','../../config/environment','./teamVoiceQueue.attributes'];(function(_0x55ccd3,_0x329758){var _0x2d26dd=function(_0x1bcda0){while(--_0x1bcda0){_0x55ccd3['push'](_0x55ccd3['shift']());}};_0x2d26dd(++_0x329758);}(_0xb2b5,0xa3));var _0x5b2b=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xb2b5[_0x17b6e3];return _0x3906f3;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x5b2b('0x0'));var BPromise=require(_0x5b2b('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5b2b('0x2'));var config=require(_0x5b2b('0x3'));var attributes=require(_0x5b2b('0x4'));module[_0x5b2b('0x5')]=function(_0x49d9f6,_0x30c3e2){return _0x49d9f6[_0x5b2b('0x6')]('TeamVoiceQueue',attributes,{'tableName':'team_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index 9898aad..5b91222 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 _0x0624=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x6529f4,_0x1db7e5){var _0x4ab89b=function(_0x350507){while(--_0x350507){_0x6529f4['push'](_0x6529f4['shift']());}};_0x4ab89b(++_0x1db7e5);}(_0x0624,0x132));var _0x4062=function(_0x326f49,_0x3d3983){_0x326f49=_0x326f49-0x0;var _0x210343=_0x0624[_0x326f49];return _0x210343;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4062('0x0'));var fs=require('fs');var Redis=require(_0x4062('0x1'));var db=require(_0x4062('0x2'))['db'];var utils=require(_0x4062('0x3'));var logger=require(_0x4062('0x4'))(_0x4062('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4062('0x6')][_0x4062('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2f4928,_0xdff88c,_0x27794b){return new BPromise(function(_0x5d19e8,_0x75ce4e){return client['request'](_0x2f4928,_0x27794b)[_0x4062('0x8')](function(_0x35663b){logger[_0x4062('0x9')](_0x4062('0xa'),_0xdff88c,_0x4062('0xb'));logger[_0x4062('0xc')](_0x4062('0xd'),_0xdff88c,'request\x20sent',JSON[_0x4062('0xe')](_0x35663b));if(_0x35663b['error']){if(_0x35663b[_0x4062('0xf')][_0x4062('0x10')]===0x1f4){logger[_0x4062('0xf')](_0x4062('0xa'),_0xdff88c,_0x35663b[_0x4062('0xf')]['message']);return _0x75ce4e(_0x35663b[_0x4062('0xf')][_0x4062('0x11')]);}logger['error'](_0x4062('0xa'),_0xdff88c,_0x35663b[_0x4062('0xf')][_0x4062('0x11')]);return _0x5d19e8(_0x35663b['error']['message']);}else{logger[_0x4062('0x9')](_0x4062('0xa'),_0xdff88c,'request\x20sent');_0x5d19e8(_0x35663b['result']['message']);}})['catch'](function(_0x437432){logger['error'](_0x4062('0xa'),_0xdff88c,_0x437432);_0x75ce4e(_0x437432);});});} \ No newline at end of file +var _0x5e0e=['randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird'];(function(_0x24392f,_0x15a3e5){var _0x591e33=function(_0xe0ccea){while(--_0xe0ccea){_0x24392f['push'](_0x24392f['shift']());}};_0x591e33(++_0x15a3e5);}(_0x5e0e,0x147));var _0xe5e0=function(_0x15fc07,_0x41cc0c){_0x15fc07=_0x15fc07-0x0;var _0x3d2c0f=_0x5e0e[_0x15fc07];return _0x3d2c0f;};'use strict';var _=require(_0xe5e0('0x0'));var util=require('util');var moment=require(_0xe5e0('0x1'));var BPromise=require(_0xe5e0('0x2'));var rs=require(_0xe5e0('0x3'));var fs=require('fs');var Redis=require(_0xe5e0('0x4'));var db=require(_0xe5e0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe5e0('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe5e0('0x7'));var client=jayson[_0xe5e0('0x8')][_0xe5e0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x11f8e2,_0x3564ab,_0x1a817e){return new BPromise(function(_0xa07105,_0x56610e){return client[_0xe5e0('0xa')](_0x11f8e2,_0x1a817e)[_0xe5e0('0xb')](function(_0x577d0f){logger[_0xe5e0('0xc')](_0xe5e0('0xd'),_0x3564ab,_0xe5e0('0xe'));logger[_0xe5e0('0xf')](_0xe5e0('0x10'),_0x3564ab,'request\x20sent',JSON[_0xe5e0('0x11')](_0x577d0f));if(_0x577d0f[_0xe5e0('0x12')]){if(_0x577d0f[_0xe5e0('0x12')][_0xe5e0('0x13')]===0x1f4){logger[_0xe5e0('0x12')]('TeamVoiceQueue,\x20%s,\x20%s',_0x3564ab,_0x577d0f[_0xe5e0('0x12')]['message']);return _0x56610e(_0x577d0f['error']['message']);}logger[_0xe5e0('0x12')](_0xe5e0('0xd'),_0x3564ab,_0x577d0f['error'][_0xe5e0('0x14')]);return _0xa07105(_0x577d0f['error'][_0xe5e0('0x14')]);}else{logger['info']('TeamVoiceQueue,\x20%s,\x20%s',_0x3564ab,_0xe5e0('0xe'));_0xa07105(_0x577d0f[_0xe5e0('0x15')][_0xe5e0('0x14')]);}})['catch'](function(_0x37d605){logger[_0xe5e0('0x12')](_0xe5e0('0xd'),_0x3564ab,_0x37d605);_0x56610e(_0x37d605);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index b5f9b75..92d3660 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 _0x89fb=['get','index','/:id','show','post','isAuthenticated','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0x89fb,0x14b));var _0xb89f=function(_0x32ee17,_0x485d22){_0x32ee17=_0x32ee17-0x0;var _0x25f09b=_0x89fb[_0x32ee17];return _0x25f09b;};'use strict';var multer=require('multer');var util=require(_0xb89f('0x0'));var path=require(_0xb89f('0x1'));var timeout=require(_0xb89f('0x2'));var express=require(_0xb89f('0x3'));var router=express[_0xb89f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb89f('0x5'));var interaction=require(_0xb89f('0x6'));var config=require(_0xb89f('0x7'));var controller=require(_0xb89f('0x8'));router[_0xb89f('0x9')]('/',auth['isAuthenticated'](),controller[_0xb89f('0xa')]);router['get'](_0xb89f('0xb'),auth['isAuthenticated'](),controller[_0xb89f('0xc')]);router[_0xb89f('0xd')]('/',auth[_0xb89f('0xe')](),controller['create']);router[_0xb89f('0xf')](_0xb89f('0xb'),auth[_0xb89f('0xe')](),controller[_0xb89f('0x10')]);router[_0xb89f('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xb89f('0x12')]);module[_0xb89f('0x13')]=router; \ No newline at end of file +var _0xaf6e=['put','/:id','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','post','create'];(function(_0x52ad14,_0x633d3){var _0xf951b7=function(_0x2c8992){while(--_0x2c8992){_0x52ad14['push'](_0x52ad14['shift']());}};_0xf951b7(++_0x633d3);}(_0xaf6e,0x16e));var _0xeaf6=function(_0x4ad0fb,_0x1f5006){_0x4ad0fb=_0x4ad0fb-0x0;var _0x3a8780=_0xaf6e[_0x4ad0fb];return _0x3a8780;};'use strict';var multer=require(_0xeaf6('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xeaf6('0x1'));var express=require(_0xeaf6('0x2'));var router=express[_0xeaf6('0x3')]();var fs_extra=require(_0xeaf6('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xeaf6('0x5'));var config=require(_0xeaf6('0x6'));var controller=require(_0xeaf6('0x7'));router[_0xeaf6('0x8')]('/',auth[_0xeaf6('0x9')](),controller['index']);router['get']('/:id',auth[_0xeaf6('0x9')](),controller['show']);router[_0xeaf6('0xa')]('/',auth['isAuthenticated'](),controller[_0xeaf6('0xb')]);router[_0xeaf6('0xc')](_0xeaf6('0xd'),auth[_0xeaf6('0x9')](),controller[_0xeaf6('0xe')]);router[_0xeaf6('0xf')](_0xeaf6('0xd'),auth[_0xeaf6('0x9')](),controller[_0xeaf6('0x10')]);module[_0xeaf6('0x11')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index f4a13e1..41b86a6 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 _0x57b4=['STRING','TEXT','exports'];(function(_0x4c7c33,_0xf64b20){var _0x25dc37=function(_0x2fa519){while(--_0x2fa519){_0x4c7c33['push'](_0x4c7c33['shift']());}};_0x25dc37(++_0xf64b20);}(_0x57b4,0x68));var _0x457b=function(_0xa0fbb9,_0x12c36e){_0xa0fbb9=_0xa0fbb9-0x0;var _0x14ac26=_0x57b4[_0xa0fbb9];return _0x14ac26;};'use strict';var Sequelize=require('sequelize');module[_0x457b('0x0')]={'name':{'type':Sequelize[_0x457b('0x1')]},'description':{'type':Sequelize[_0x457b('0x1')]},'html':{'type':Sequelize[_0x457b('0x2')]}}; \ No newline at end of file +var _0x27d3=['TEXT','sequelize','exports','STRING'];(function(_0x4d18d4,_0x28df77){var _0x487995=function(_0xb66b7a){while(--_0xb66b7a){_0x4d18d4['push'](_0x4d18d4['shift']());}};_0x487995(++_0x28df77);}(_0x27d3,0xf5));var _0x327d=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x27d3[_0xc4001c];return _0x49f7bc;};'use strict';var Sequelize=require(_0x327d('0x0'));module[_0x327d('0x1')]={'name':{'type':Sequelize[_0x327d('0x2')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x327d('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 0b96005..00cc3f1 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 _0x2af9=['map','Template','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','pick','filter','merge','options','findAll','catch','show','includeAll','include','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','end','offset','undefined','limit','count','status','set','Content-Range','json','apply','reject','save','then','destroy','get','Templates','UserProfileResource','sendStatus','error','stack','name'];(function(_0x7b41fc,_0xc1b8a7){var _0x1dbcd5=function(_0x41fe33){while(--_0x41fe33){_0x7b41fc['push'](_0x7b41fc['shift']());}};_0x1dbcd5(++_0xc1b8a7);}(_0x2af9,0x1a8));var _0x92af=function(_0x52dcde,_0x165900){_0x52dcde=_0x52dcde-0x0;var _0xb30748=_0x2af9[_0x52dcde];return _0xb30748;};'use strict';var emlformat=require(_0x92af('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x92af('0x1'));var jsonpatch=require(_0x92af('0x2'));var rp=require(_0x92af('0x3'));var moment=require(_0x92af('0x4'));var BPromise=require(_0x92af('0x5'));var Mustache=require('mustache');var util=require(_0x92af('0x6'));var path=require('path');var sox=require(_0x92af('0x7'));var csv=require(_0x92af('0x8'));var ejs=require(_0x92af('0x9'));var fs=require('fs');var fs_extra=require(_0x92af('0xa'));var _=require(_0x92af('0xb'));var squel=require('squel');var crypto=require(_0x92af('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x92af('0xd'));var toCsv=require(_0x92af('0x8'));var querystring=require(_0x92af('0xe'));var Papa=require(_0x92af('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x92af('0x10'));var as=require(_0x92af('0x11'));var hardwareService=require(_0x92af('0x12'));var logger=require(_0x92af('0x13'))(_0x92af('0x14'));var utils=require('../../config/utils');var config=require(_0x92af('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x92af('0x16'))['db'];function respondWithStatusCode(_0x170b46,_0x410649){_0x410649=_0x410649||0xcc;return function(_0x196cda){if(_0x196cda){return _0x170b46['sendStatus'](_0x410649);}return _0x170b46['status'](_0x410649)[_0x92af('0x17')]();};}function respondWithResult(_0xda2b8,_0x5ccf49){_0x5ccf49=_0x5ccf49||0xc8;return function(_0x390f78){if(_0x390f78){return _0xda2b8['status'](_0x5ccf49)['json'](_0x390f78);}};}function respondWithFilteredResult(_0x2519df,_0xcd37c6){return function(_0x25647c){if(_0x25647c){var _0x21dfe9=typeof _0xcd37c6[_0x92af('0x18')]===_0x92af('0x19')&&typeof _0xcd37c6[_0x92af('0x1a')]===_0x92af('0x19');var _0xdb2b8=_0x25647c[_0x92af('0x1b')];var _0x46ea04=_0x21dfe9?0x0:_0xcd37c6[_0x92af('0x18')];var _0x5ab1c9=_0x21dfe9?_0x25647c['count']:_0xcd37c6['offset']+_0xcd37c6[_0x92af('0x1a')];var _0x5cfe81;if(_0x5ab1c9>=_0xdb2b8){_0x5ab1c9=_0xdb2b8;_0x5cfe81=0xc8;}else{_0x5cfe81=0xce;}_0x2519df[_0x92af('0x1c')](_0x5cfe81);return _0x2519df[_0x92af('0x1d')](_0x92af('0x1e'),_0x46ea04+'-'+_0x5ab1c9+'/'+_0xdb2b8)[_0x92af('0x1f')](_0x25647c);}return null;};}function patchUpdates(_0x1fc4a3){return function(_0x322e10){try{jsonpatch[_0x92af('0x20')](_0x322e10,_0x1fc4a3,!![]);}catch(_0x551307){return BPromise[_0x92af('0x21')](_0x551307);}return _0x322e10[_0x92af('0x22')]();};}function saveUpdates(_0x18201c,_0x5f3317){return function(_0x1d2995){if(_0x1d2995){return _0x1d2995['update'](_0x18201c)[_0x92af('0x23')](function(_0x36515d){return _0x36515d;});}return null;};}function removeEntity(_0xa3401c,_0x4d9cfa){return function(_0xfe1c5c){if(_0xfe1c5c){return _0xfe1c5c[_0x92af('0x24')]()[_0x92af('0x23')](function(){var _0x5ef132=_0xfe1c5c[_0x92af('0x25')]({'plain':!![]});var _0x123026=_0x92af('0x26');return db[_0x92af('0x27')]['destroy']({'where':{'type':_0x123026,'resourceId':_0x5ef132['id']}})[_0x92af('0x23')](function(){return _0xfe1c5c;});})[_0x92af('0x23')](function(){_0xa3401c[_0x92af('0x1c')](0xcc)[_0x92af('0x17')]();});}};}function handleEntityNotFound(_0x24601f,_0x3414ce){return function(_0x5eed4d){if(!_0x5eed4d){_0x24601f[_0x92af('0x28')](0x194);}return _0x5eed4d;};}function handleError(_0x4090fc,_0x1c9073){_0x1c9073=_0x1c9073||0x1f4;return function(_0x593292){logger[_0x92af('0x29')](_0x593292[_0x92af('0x2a')]);if(_0x593292[_0x92af('0x2b')]){delete _0x593292[_0x92af('0x2b')];}_0x4090fc[_0x92af('0x1c')](_0x1c9073)['send'](_0x593292);};}exports['index']=function(_0x645b6b,_0x207002){var _0x49c171={},_0x5a390b={},_0xc4249d={'count':0x0,'rows':[]};var _0x2f789d=_[_0x92af('0x2c')](db[_0x92af('0x2d')][_0x92af('0x2e')],function(_0x6bc606){return{'name':_0x6bc606['fieldName'],'type':_0x6bc606[_0x92af('0x2f')][_0x92af('0x30')]};});_0x5a390b[_0x92af('0x31')]=_[_0x92af('0x2c')](_0x2f789d,'name');_0x5a390b[_0x92af('0x32')]=_[_0x92af('0x33')](_0x645b6b[_0x92af('0x32')]);_0x5a390b[_0x92af('0x34')]=_[_0x92af('0x35')](_0x5a390b['model'],_0x5a390b[_0x92af('0x32')]);_0x49c171[_0x92af('0x36')]=_[_0x92af('0x35')](_0x5a390b[_0x92af('0x31')],qs[_0x92af('0x37')](_0x645b6b[_0x92af('0x32')]['fields']));_0x49c171[_0x92af('0x36')]=_0x49c171['attributes'][_0x92af('0x38')]?_0x49c171[_0x92af('0x36')]:_0x5a390b['model'];if(!_0x645b6b[_0x92af('0x32')]['hasOwnProperty']('nolimit')){_0x49c171[_0x92af('0x1a')]=qs[_0x92af('0x1a')](_0x645b6b['query'][_0x92af('0x1a')]);_0x49c171[_0x92af('0x18')]=qs['offset'](_0x645b6b[_0x92af('0x32')][_0x92af('0x18')]);}_0x49c171[_0x92af('0x39')]=qs['sort'](_0x645b6b['query']['sort']);_0x49c171['where']=qs[_0x92af('0x34')](_[_0x92af('0x3a')](_0x645b6b[_0x92af('0x32')],_0x5a390b[_0x92af('0x34')]),_0x2f789d);if(_0x645b6b[_0x92af('0x32')][_0x92af('0x3b')]){_0x49c171['where']=_[_0x92af('0x3c')](_0x49c171['where'],{'$or':_['map'](_0x2f789d,function(_0x502237){if(_0x502237[_0x92af('0x2f')]!=='VIRTUAL'){var _0x551cb1={};_0x551cb1[_0x502237[_0x92af('0x2b')]]={'$like':'%'+_0x645b6b[_0x92af('0x32')][_0x92af('0x3b')]+'%'};return _0x551cb1;}})});}_0x49c171=_['merge']({},_0x49c171,_0x645b6b[_0x92af('0x3d')]);var _0x44f065={'where':_0x49c171['where']};return db[_0x92af('0x2d')][_0x92af('0x1b')](_0x44f065)['then'](function(_0x5731c0){_0xc4249d[_0x92af('0x1b')]=_0x5731c0;if(_0x645b6b[_0x92af('0x32')]['includeAll']){_0x49c171['include']=[{'all':!![]}];}return db[_0x92af('0x2d')][_0x92af('0x3e')](_0x49c171);})[_0x92af('0x23')](function(_0x554d7c){_0xc4249d['rows']=_0x554d7c;return _0xc4249d;})[_0x92af('0x23')](respondWithFilteredResult(_0x207002,_0x49c171))[_0x92af('0x3f')](handleError(_0x207002,null));};exports[_0x92af('0x40')]=function(_0x79876f,_0x20c182){var _0x38a371={'raw':!![],'where':{'id':_0x79876f['params']['id']}},_0x128d93={};_0x128d93[_0x92af('0x31')]=_[_0x92af('0x33')](db[_0x92af('0x2d')][_0x92af('0x2e')]);_0x128d93[_0x92af('0x32')]=_[_0x92af('0x33')](_0x79876f['query']);_0x128d93[_0x92af('0x34')]=_[_0x92af('0x35')](_0x128d93[_0x92af('0x31')],_0x128d93[_0x92af('0x32')]);_0x38a371[_0x92af('0x36')]=_['intersection'](_0x128d93[_0x92af('0x31')],qs[_0x92af('0x37')](_0x79876f[_0x92af('0x32')][_0x92af('0x37')]));_0x38a371[_0x92af('0x36')]=_0x38a371['attributes']['length']?_0x38a371['attributes']:_0x128d93[_0x92af('0x31')];if(_0x79876f['query'][_0x92af('0x41')]){_0x38a371[_0x92af('0x42')]=[{'all':!![]}];}_0x38a371=_[_0x92af('0x3c')]({},_0x38a371,_0x79876f['options']);return db[_0x92af('0x2d')][_0x92af('0x43')](_0x38a371)[_0x92af('0x23')](handleEntityNotFound(_0x20c182,null))[_0x92af('0x23')](respondWithResult(_0x20c182,null))[_0x92af('0x3f')](handleError(_0x20c182,null));};exports['create']=function(_0x3bdf81,_0x193b76){return db[_0x92af('0x2d')][_0x92af('0x44')](_0x3bdf81[_0x92af('0x45')],{})[_0x92af('0x23')](function(_0x3b91ad){var _0x315c42=_0x3bdf81[_0x92af('0x46')][_0x92af('0x25')]({'plain':!![]});if(!_0x315c42)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x315c42[_0x92af('0x47')]===_0x92af('0x46')){var _0x525d82=_0x3b91ad[_0x92af('0x25')]({'plain':!![]});var _0x336364=_0x92af('0x26');return db[_0x92af('0x48')]['find']({'where':{'name':_0x336364,'userProfileId':_0x315c42[_0x92af('0x49')]},'raw':!![]})['then'](function(_0x579452){if(_0x579452&&_0x579452[_0x92af('0x4a')]===0x0){return db[_0x92af('0x27')][_0x92af('0x44')]({'name':_0x525d82['name'],'resourceId':_0x525d82['id'],'type':_0x579452['name'],'sectionId':_0x579452['id']},{})[_0x92af('0x23')](function(){return _0x3b91ad;});}else{return _0x3b91ad;}})[_0x92af('0x3f')](function(_0x1466dc){logger[_0x92af('0x29')](_0x92af('0x4b'),_0x1466dc);throw _0x1466dc;});}return _0x3b91ad;})[_0x92af('0x23')](respondWithResult(_0x193b76,0xc9))[_0x92af('0x3f')](handleError(_0x193b76,null));};exports[_0x92af('0x4c')]=function(_0x1fa1dd,_0x279fb5){if(_0x1fa1dd[_0x92af('0x45')]['id']){delete _0x1fa1dd[_0x92af('0x45')]['id'];}return db[_0x92af('0x2d')][_0x92af('0x43')]({'where':{'id':_0x1fa1dd[_0x92af('0x4d')]['id']}})[_0x92af('0x23')](handleEntityNotFound(_0x279fb5,null))[_0x92af('0x23')](saveUpdates(_0x1fa1dd[_0x92af('0x45')],null))[_0x92af('0x23')](respondWithResult(_0x279fb5,null))[_0x92af('0x3f')](handleError(_0x279fb5,null));};exports['destroy']=function(_0x513875,_0x44b82e){return db[_0x92af('0x2d')][_0x92af('0x43')]({'where':{'id':_0x513875[_0x92af('0x4d')]['id']}})['then'](handleEntityNotFound(_0x44b82e,null))['then'](removeEntity(_0x44b82e,null))['catch'](handleError(_0x44b82e,null));}; \ No newline at end of file +var _0xa59a=['findAll','rows','show','params','length','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','then','destroy','get','Templates','UserProfileResource','error','stack','name','index','rawAttributes','fieldName','type','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','where','VIRTUAL','filter','merge','Template','includeAll','include'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa59a,0x113));var _0xaa59=function(_0x411da2,_0x2fd462){_0x411da2=_0x411da2-0x0;var _0x2c4954=_0xa59a[_0x411da2];return _0x2c4954;};'use strict';var emlformat=require(_0xaa59('0x0'));var rimraf=require(_0xaa59('0x1'));var zipdir=require(_0xaa59('0x2'));var jsonpatch=require(_0xaa59('0x3'));var rp=require(_0xaa59('0x4'));var moment=require(_0xaa59('0x5'));var BPromise=require(_0xaa59('0x6'));var Mustache=require('mustache');var util=require(_0xaa59('0x7'));var path=require(_0xaa59('0x8'));var sox=require(_0xaa59('0x9'));var csv=require(_0xaa59('0xa'));var ejs=require(_0xaa59('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xaa59('0xc'));var jsforce=require(_0xaa59('0xd'));var deskjs=require(_0xaa59('0xe'));var toCsv=require('to-csv');var querystring=require(_0xaa59('0xf'));var Papa=require(_0xaa59('0x10'));var Redis=require(_0xaa59('0x11'));var authService=require(_0xaa59('0x12'));var qs=require(_0xaa59('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xaa59('0x14'))('api');var utils=require(_0xaa59('0x15'));var config=require(_0xaa59('0x16'));var licenseUtil=require(_0xaa59('0x17'));var db=require(_0xaa59('0x18'))['db'];function respondWithStatusCode(_0x35964d,_0x59df7d){_0x59df7d=_0x59df7d||0xcc;return function(_0xdc0d90){if(_0xdc0d90){return _0x35964d[_0xaa59('0x19')](_0x59df7d);}return _0x35964d[_0xaa59('0x1a')](_0x59df7d)[_0xaa59('0x1b')]();};}function respondWithResult(_0xb8f902,_0x595984){_0x595984=_0x595984||0xc8;return function(_0x2b4826){if(_0x2b4826){return _0xb8f902[_0xaa59('0x1a')](_0x595984)[_0xaa59('0x1c')](_0x2b4826);}};}function respondWithFilteredResult(_0x53f40b,_0x595711){return function(_0xeb1f43){if(_0xeb1f43){var _0xe955a2=typeof _0x595711[_0xaa59('0x1d')]==='undefined'&&typeof _0x595711[_0xaa59('0x1e')]===_0xaa59('0x1f');var _0x3ec4f3=_0xeb1f43[_0xaa59('0x20')];var _0x2c4639=_0xe955a2?0x0:_0x595711['offset'];var _0x3cf160=_0xe955a2?_0xeb1f43['count']:_0x595711[_0xaa59('0x1d')]+_0x595711['limit'];var _0x4feb2e;if(_0x3cf160>=_0x3ec4f3){_0x3cf160=_0x3ec4f3;_0x4feb2e=0xc8;}else{_0x4feb2e=0xce;}_0x53f40b[_0xaa59('0x1a')](_0x4feb2e);return _0x53f40b[_0xaa59('0x21')](_0xaa59('0x22'),_0x2c4639+'-'+_0x3cf160+'/'+_0x3ec4f3)[_0xaa59('0x1c')](_0xeb1f43);}return null;};}function patchUpdates(_0x2be633){return function(_0x479455){try{jsonpatch[_0xaa59('0x23')](_0x479455,_0x2be633,!![]);}catch(_0x1a071c){return BPromise[_0xaa59('0x24')](_0x1a071c);}return _0x479455['save']();};}function saveUpdates(_0x17ae91,_0x509b0f){return function(_0x1f327a){if(_0x1f327a){return _0x1f327a['update'](_0x17ae91)[_0xaa59('0x25')](function(_0x5bdd04){return _0x5bdd04;});}return null;};}function removeEntity(_0x2bbf7a,_0x2d229b){return function(_0x2acd02){if(_0x2acd02){return _0x2acd02[_0xaa59('0x26')]()['then'](function(){var _0x37e182=_0x2acd02[_0xaa59('0x27')]({'plain':!![]});var _0x494bc0=_0xaa59('0x28');return db[_0xaa59('0x29')]['destroy']({'where':{'type':_0x494bc0,'resourceId':_0x37e182['id']}})['then'](function(){return _0x2acd02;});})[_0xaa59('0x25')](function(){_0x2bbf7a['status'](0xcc)[_0xaa59('0x1b')]();});}};}function handleEntityNotFound(_0x1de675,_0x357f49){return function(_0x4d29ea){if(!_0x4d29ea){_0x1de675[_0xaa59('0x19')](0x194);}return _0x4d29ea;};}function handleError(_0x4fa31a,_0x388d56){_0x388d56=_0x388d56||0x1f4;return function(_0xf270ce){logger[_0xaa59('0x2a')](_0xf270ce[_0xaa59('0x2b')]);if(_0xf270ce['name']){delete _0xf270ce[_0xaa59('0x2c')];}_0x4fa31a['status'](_0x388d56)['send'](_0xf270ce);};}exports[_0xaa59('0x2d')]=function(_0x599c6d,_0x31d30d){var _0x4e7eba={},_0x38223b={},_0x90a510={'count':0x0,'rows':[]};var _0x1735cd=_['map'](db['Template'][_0xaa59('0x2e')],function(_0x476aa3){return{'name':_0x476aa3[_0xaa59('0x2f')],'type':_0x476aa3[_0xaa59('0x30')]['key']};});_0x38223b[_0xaa59('0x31')]=_[_0xaa59('0x32')](_0x1735cd,_0xaa59('0x2c'));_0x38223b[_0xaa59('0x33')]=_[_0xaa59('0x34')](_0x599c6d['query']);_0x38223b['filters']=_[_0xaa59('0x35')](_0x38223b['model'],_0x38223b['query']);_0x4e7eba[_0xaa59('0x36')]=_['intersection'](_0x38223b[_0xaa59('0x31')],qs['fields'](_0x599c6d[_0xaa59('0x33')][_0xaa59('0x37')]));_0x4e7eba[_0xaa59('0x36')]=_0x4e7eba['attributes']['length']?_0x4e7eba[_0xaa59('0x36')]:_0x38223b[_0xaa59('0x31')];if(!_0x599c6d[_0xaa59('0x33')][_0xaa59('0x38')](_0xaa59('0x39'))){_0x4e7eba[_0xaa59('0x1e')]=qs['limit'](_0x599c6d[_0xaa59('0x33')][_0xaa59('0x1e')]);_0x4e7eba[_0xaa59('0x1d')]=qs['offset'](_0x599c6d['query'][_0xaa59('0x1d')]);}_0x4e7eba[_0xaa59('0x3a')]=qs[_0xaa59('0x3b')](_0x599c6d['query'][_0xaa59('0x3b')]);_0x4e7eba['where']=qs[_0xaa59('0x3c')](_[_0xaa59('0x3d')](_0x599c6d['query'],_0x38223b[_0xaa59('0x3c')]),_0x1735cd);if(_0x599c6d[_0xaa59('0x33')]['filter']){_0x4e7eba['where']=_['merge'](_0x4e7eba[_0xaa59('0x3e')],{'$or':_[_0xaa59('0x32')](_0x1735cd,function(_0x133d3c){if(_0x133d3c['type']!==_0xaa59('0x3f')){var _0x405ef={};_0x405ef[_0x133d3c[_0xaa59('0x2c')]]={'$like':'%'+_0x599c6d[_0xaa59('0x33')][_0xaa59('0x40')]+'%'};return _0x405ef;}})});}_0x4e7eba=_[_0xaa59('0x41')]({},_0x4e7eba,_0x599c6d['options']);var _0x75785c={'where':_0x4e7eba[_0xaa59('0x3e')]};return db[_0xaa59('0x42')][_0xaa59('0x20')](_0x75785c)[_0xaa59('0x25')](function(_0x57cf10){_0x90a510[_0xaa59('0x20')]=_0x57cf10;if(_0x599c6d[_0xaa59('0x33')][_0xaa59('0x43')]){_0x4e7eba[_0xaa59('0x44')]=[{'all':!![]}];}return db[_0xaa59('0x42')][_0xaa59('0x45')](_0x4e7eba);})[_0xaa59('0x25')](function(_0x5c4719){_0x90a510[_0xaa59('0x46')]=_0x5c4719;return _0x90a510;})['then'](respondWithFilteredResult(_0x31d30d,_0x4e7eba))['catch'](handleError(_0x31d30d,null));};exports[_0xaa59('0x47')]=function(_0xc18c55,_0x6e053e){var _0x195752={'raw':!![],'where':{'id':_0xc18c55[_0xaa59('0x48')]['id']}},_0x1575c7={};_0x1575c7['model']=_[_0xaa59('0x34')](db[_0xaa59('0x42')][_0xaa59('0x2e')]);_0x1575c7['query']=_['keys'](_0xc18c55[_0xaa59('0x33')]);_0x1575c7[_0xaa59('0x3c')]=_[_0xaa59('0x35')](_0x1575c7['model'],_0x1575c7['query']);_0x195752[_0xaa59('0x36')]=_[_0xaa59('0x35')](_0x1575c7[_0xaa59('0x31')],qs['fields'](_0xc18c55['query'][_0xaa59('0x37')]));_0x195752[_0xaa59('0x36')]=_0x195752[_0xaa59('0x36')][_0xaa59('0x49')]?_0x195752[_0xaa59('0x36')]:_0x1575c7['model'];if(_0xc18c55['query'][_0xaa59('0x43')]){_0x195752[_0xaa59('0x44')]=[{'all':!![]}];}_0x195752=_[_0xaa59('0x41')]({},_0x195752,_0xc18c55['options']);return db[_0xaa59('0x42')]['find'](_0x195752)[_0xaa59('0x25')](handleEntityNotFound(_0x6e053e,null))['then'](respondWithResult(_0x6e053e,null))[_0xaa59('0x4a')](handleError(_0x6e053e,null));};exports[_0xaa59('0x4b')]=function(_0xf0d4ab,_0x4e73a1){return db[_0xaa59('0x42')][_0xaa59('0x4b')](_0xf0d4ab[_0xaa59('0x4c')],{})[_0xaa59('0x25')](function(_0x53b10d){var _0x136228=_0xf0d4ab[_0xaa59('0x4d')][_0xaa59('0x27')]({'plain':!![]});if(!_0x136228)throw new Error(_0xaa59('0x4e'));if(_0x136228[_0xaa59('0x4f')]===_0xaa59('0x4d')){var _0x499264=_0x53b10d[_0xaa59('0x27')]({'plain':!![]});var _0x1f0da3=_0xaa59('0x28');return db[_0xaa59('0x50')]['find']({'where':{'name':_0x1f0da3,'userProfileId':_0x136228[_0xaa59('0x51')]},'raw':!![]})[_0xaa59('0x25')](function(_0x8a3c7){if(_0x8a3c7&&_0x8a3c7[_0xaa59('0x52')]===0x0){return db[_0xaa59('0x29')][_0xaa59('0x4b')]({'name':_0x499264[_0xaa59('0x2c')],'resourceId':_0x499264['id'],'type':_0x8a3c7[_0xaa59('0x2c')],'sectionId':_0x8a3c7['id']},{})[_0xaa59('0x25')](function(){return _0x53b10d;});}else{return _0x53b10d;}})[_0xaa59('0x4a')](function(_0x3fc9b0){logger[_0xaa59('0x2a')](_0xaa59('0x53'),_0x3fc9b0);throw _0x3fc9b0;});}return _0x53b10d;})['then'](respondWithResult(_0x4e73a1,0xc9))['catch'](handleError(_0x4e73a1,null));};exports[_0xaa59('0x54')]=function(_0x3c6530,_0x2db18e){if(_0x3c6530[_0xaa59('0x4c')]['id']){delete _0x3c6530[_0xaa59('0x4c')]['id'];}return db['Template'][_0xaa59('0x55')]({'where':{'id':_0x3c6530[_0xaa59('0x48')]['id']}})['then'](handleEntityNotFound(_0x2db18e,null))[_0xaa59('0x25')](saveUpdates(_0x3c6530['body'],null))['then'](respondWithResult(_0x2db18e,null))[_0xaa59('0x4a')](handleError(_0x2db18e,null));};exports[_0xaa59('0x26')]=function(_0x2da972,_0x5c2f46){return db[_0xaa59('0x42')][_0xaa59('0x55')]({'where':{'id':_0x2da972[_0xaa59('0x48')]['id']}})[_0xaa59('0x25')](handleEntityNotFound(_0x5c2f46,null))[_0xaa59('0x25')](removeEntity(_0x5c2f46,null))[_0xaa59('0x4a')](handleError(_0x5c2f46,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index bfb1892..9baad49 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 _0xf1ef=['path','rimraf','../../config/environment','exports','Template','tools_templates','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x322247,_0x41e311){var _0x138a47=function(_0x245112){while(--_0x245112){_0x322247['push'](_0x322247['shift']());}};_0x138a47(++_0x41e311);}(_0xf1ef,0x102));var _0xff1e=function(_0x38a61e,_0xf150e3){_0x38a61e=_0x38a61e-0x0;var _0x14cd0f=_0xf1ef[_0x38a61e];return _0x14cd0f;};'use strict';var _=require(_0xff1e('0x0'));var util=require(_0xff1e('0x1'));var logger=require(_0xff1e('0x2'))(_0xff1e('0x3'));var moment=require('moment');var BPromise=require(_0xff1e('0x4'));var rp=require(_0xff1e('0x5'));var fs=require('fs');var path=require(_0xff1e('0x6'));var rimraf=require(_0xff1e('0x7'));var config=require(_0xff1e('0x8'));var attributes=require('./template.attributes');module[_0xff1e('0x9')]=function(_0x46ea73,_0x92437b){return _0x46ea73['define'](_0xff1e('0xa'),attributes,{'tableName':_0xff1e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf425=['path','rimraf','../../config/environment','./template.attributes','define','Template','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x16eb19,_0x58cea4){var _0x312a25=function(_0x343702){while(--_0x343702){_0x16eb19['push'](_0x16eb19['shift']());}};_0x312a25(++_0x58cea4);}(_0xf425,0x131));var _0x5f42=function(_0x139a25,_0x1707d7){_0x139a25=_0x139a25-0x0;var _0x330a62=_0xf425[_0x139a25];return _0x330a62;};'use strict';var _=require(_0x5f42('0x0'));var util=require(_0x5f42('0x1'));var logger=require(_0x5f42('0x2'))(_0x5f42('0x3'));var moment=require(_0x5f42('0x4'));var BPromise=require(_0x5f42('0x5'));var rp=require(_0x5f42('0x6'));var fs=require('fs');var path=require(_0x5f42('0x7'));var rimraf=require(_0x5f42('0x8'));var config=require(_0x5f42('0x9'));var attributes=require(_0x5f42('0xa'));module['exports']=function(_0x2ccef0,_0x132fd3){return _0x2ccef0[_0x5f42('0xb')](_0x5f42('0xc'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index be1db31..f13441a 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 _0x52f1=['code','message','catch','GetTemplate','Template','findAll','options','attributes','limit','include','map','model','then','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','request','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5ddec9,_0x209a36){var _0x5abb94=function(_0x5816db){while(--_0x5816db){_0x5ddec9['push'](_0x5ddec9['shift']());}};_0x5abb94(++_0x209a36);}(_0x52f1,0x1ed));var _0x152f=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x52f1[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x152f('0x0'));var util=require(_0x152f('0x1'));var moment=require(_0x152f('0x2'));var BPromise=require(_0x152f('0x3'));var rs=require(_0x152f('0x4'));var fs=require('fs');var Redis=require(_0x152f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x152f('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x152f('0x7'));var jayson=require(_0x152f('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5030e8,_0xdda76b,_0x1f4f1f){return new BPromise(function(_0x1aa8fc,_0x37bc94){return client[_0x152f('0x9')](_0x5030e8,_0x1f4f1f)['then'](function(_0x527814){logger[_0x152f('0xa')](_0x152f('0xb'),_0xdda76b,_0x152f('0xc'));logger[_0x152f('0xd')](_0x152f('0xe'),_0xdda76b,_0x152f('0xc'),JSON[_0x152f('0xf')](_0x527814));if(_0x527814[_0x152f('0x10')]){if(_0x527814['error'][_0x152f('0x11')]===0x1f4){logger['error']('Template,\x20%s,\x20%s',_0xdda76b,_0x527814['error'][_0x152f('0x12')]);return _0x37bc94(_0x527814[_0x152f('0x10')][_0x152f('0x12')]);}logger[_0x152f('0x10')](_0x152f('0xb'),_0xdda76b,_0x527814[_0x152f('0x10')][_0x152f('0x12')]);return _0x1aa8fc(_0x527814['error'][_0x152f('0x12')]);}else{logger['info'](_0x152f('0xb'),_0xdda76b,'request\x20sent');_0x1aa8fc(_0x527814['result'][_0x152f('0x12')]);}})[_0x152f('0x13')](function(_0x484019){logger[_0x152f('0x10')](_0x152f('0xb'),_0xdda76b,_0x484019);_0x37bc94(_0x484019);});});}exports[_0x152f('0x14')]=function(_0x8996c1){var _0xd1e96a=this;return new Promise(function(_0x31e0cb,_0x5ad06d){return db[_0x152f('0x15')][_0x152f('0x16')]({'raw':_0x8996c1['options']?_0x8996c1[_0x152f('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x8996c1[_0x152f('0x17')]?_0x8996c1[_0x152f('0x17')]['where']||null:null,'attributes':_0x8996c1[_0x152f('0x17')]?_0x8996c1['options'][_0x152f('0x18')]||null:null,'limit':_0x8996c1[_0x152f('0x17')]?_0x8996c1[_0x152f('0x17')][_0x152f('0x19')]||null:null,'include':_0x8996c1[_0x152f('0x17')]?_0x8996c1[_0x152f('0x17')][_0x152f('0x1a')]?_[_0x152f('0x1b')](_0x8996c1[_0x152f('0x17')][_0x152f('0x1a')],function(_0x4cd219){return{'model':db[_0x4cd219[_0x152f('0x1c')]],'as':_0x4cd219['as'],'attributes':_0x4cd219[_0x152f('0x18')],'include':_0x4cd219[_0x152f('0x1a')]?_['map'](_0x4cd219[_0x152f('0x1a')],function(_0x48fc35){return{'model':db[_0x48fc35[_0x152f('0x1c')]],'as':_0x48fc35['as'],'attributes':_0x48fc35['attributes'],'include':_0x48fc35[_0x152f('0x1a')]?_[_0x152f('0x1b')](_0x48fc35['include'],function(_0xc1c22a){return{'model':db[_0xc1c22a[_0x152f('0x1c')]],'as':_0xc1c22a['as'],'attributes':_0xc1c22a[_0x152f('0x18')]};}):[]};}):[]};}):[]:[]})[_0x152f('0x1d')](function(_0x564e53){logger['info'](_0x152f('0x14'),_0x8996c1);logger[_0x152f('0xd')]('GetTemplate',_0x8996c1,JSON[_0x152f('0xf')](_0x564e53));_0x31e0cb(_0x564e53);})[_0x152f('0x13')](function(_0x4a24dd){logger[_0x152f('0x10')]('GetTemplate',_0x4a24dd[_0x152f('0x12')],_0x8996c1);_0x5ad06d(_0xd1e96a[_0x152f('0x10')](0x1f4,_0x4a24dd[_0x152f('0x12')]));});});}; \ No newline at end of file +var _0xe6b6=['util','moment','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','Template,\x20%s,\x20%s','message','catch','GetTemplate','Template','findAll','options','raw','where','attributes','include','map','model'];(function(_0x1a6299,_0xbd3231){var _0x35fdd6=function(_0xbef107){while(--_0xbef107){_0x1a6299['push'](_0x1a6299['shift']());}};_0x35fdd6(++_0xbd3231);}(_0xe6b6,0x150));var _0x6e6b=function(_0x255f95,_0x5be4d8){_0x255f95=_0x255f95-0x0;var _0x52ab79=_0xe6b6[_0x255f95];return _0x52ab79;};'use strict';var _=require('lodash');var util=require(_0x6e6b('0x0'));var moment=require(_0x6e6b('0x1'));var BPromise=require('bluebird');var rs=require(_0x6e6b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6e6b('0x3'));var logger=require('../../config/logger')(_0x6e6b('0x4'));var config=require(_0x6e6b('0x5'));var jayson=require(_0x6e6b('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1bb636,_0x4bc5a0,_0x3d3b77){return new BPromise(function(_0x506791,_0x54c293){return client[_0x6e6b('0x7')](_0x1bb636,_0x3d3b77)[_0x6e6b('0x8')](function(_0x24c462){logger[_0x6e6b('0x9')]('Template,\x20%s,\x20%s',_0x4bc5a0,_0x6e6b('0xa'));logger[_0x6e6b('0xb')]('Template,\x20%s,\x20%s,\x20%s',_0x4bc5a0,'request\x20sent',JSON[_0x6e6b('0xc')](_0x24c462));if(_0x24c462[_0x6e6b('0xd')]){if(_0x24c462['error'][_0x6e6b('0xe')]===0x1f4){logger[_0x6e6b('0xd')](_0x6e6b('0xf'),_0x4bc5a0,_0x24c462[_0x6e6b('0xd')][_0x6e6b('0x10')]);return _0x54c293(_0x24c462[_0x6e6b('0xd')][_0x6e6b('0x10')]);}logger[_0x6e6b('0xd')]('Template,\x20%s,\x20%s',_0x4bc5a0,_0x24c462[_0x6e6b('0xd')][_0x6e6b('0x10')]);return _0x506791(_0x24c462['error']['message']);}else{logger['info']('Template,\x20%s,\x20%s',_0x4bc5a0,_0x6e6b('0xa'));_0x506791(_0x24c462['result'][_0x6e6b('0x10')]);}})[_0x6e6b('0x11')](function(_0x5eee11){logger['error']('Template,\x20%s,\x20%s',_0x4bc5a0,_0x5eee11);_0x54c293(_0x5eee11);});});}exports[_0x6e6b('0x12')]=function(_0x28c4cd){var _0x13365f=this;return new Promise(function(_0x41c45d,_0x167321){return db[_0x6e6b('0x13')][_0x6e6b('0x14')]({'raw':_0x28c4cd[_0x6e6b('0x15')]?_0x28c4cd[_0x6e6b('0x15')][_0x6e6b('0x16')]===undefined?!![]:![]:!![],'where':_0x28c4cd[_0x6e6b('0x15')]?_0x28c4cd['options'][_0x6e6b('0x17')]||null:null,'attributes':_0x28c4cd[_0x6e6b('0x15')]?_0x28c4cd[_0x6e6b('0x15')][_0x6e6b('0x18')]||null:null,'limit':_0x28c4cd[_0x6e6b('0x15')]?_0x28c4cd[_0x6e6b('0x15')]['limit']||null:null,'include':_0x28c4cd[_0x6e6b('0x15')]?_0x28c4cd[_0x6e6b('0x15')][_0x6e6b('0x19')]?_[_0x6e6b('0x1a')](_0x28c4cd[_0x6e6b('0x15')][_0x6e6b('0x19')],function(_0x460def){return{'model':db[_0x460def['model']],'as':_0x460def['as'],'attributes':_0x460def['attributes'],'include':_0x460def[_0x6e6b('0x19')]?_[_0x6e6b('0x1a')](_0x460def[_0x6e6b('0x19')],function(_0x40741f){return{'model':db[_0x40741f[_0x6e6b('0x1b')]],'as':_0x40741f['as'],'attributes':_0x40741f[_0x6e6b('0x18')],'include':_0x40741f[_0x6e6b('0x19')]?_['map'](_0x40741f[_0x6e6b('0x19')],function(_0x22005e){return{'model':db[_0x22005e[_0x6e6b('0x1b')]],'as':_0x22005e['as'],'attributes':_0x22005e[_0x6e6b('0x18')]};}):[]};}):[]};}):[]:[]})[_0x6e6b('0x8')](function(_0x45e43f){logger[_0x6e6b('0x9')](_0x6e6b('0x12'),_0x28c4cd);logger['debug']('GetTemplate',_0x28c4cd,JSON[_0x6e6b('0xc')](_0x45e43f));_0x41c45d(_0x45e43f);})[_0x6e6b('0x11')](function(_0x5be539){logger['error'](_0x6e6b('0x12'),_0x5be539[_0x6e6b('0x10')],_0x28c4cd);_0x167321(_0x13365f[_0x6e6b('0xd')](0x1f4,_0x5be539[_0x6e6b('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 2f60ac3..d2621b4 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 _0x3c1f=['/:id/all_conditions','getAllConditions','/:id/any_conditions','/:id/actions','getActions','post','create','addAllCondition','addAction','put','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','/:id','show'];(function(_0x1ece88,_0x30be0d){var _0x25e220=function(_0x189362){while(--_0x189362){_0x1ece88['push'](_0x1ece88['shift']());}};_0x25e220(++_0x30be0d);}(_0x3c1f,0x1ce));var _0xf3c1=function(_0x20d423,_0x499ba5){_0x20d423=_0x20d423-0x0;var _0x8b2691=_0x3c1f[_0x20d423];return _0x8b2691;};'use strict';var multer=require(_0xf3c1('0x0'));var util=require('util');var path=require(_0xf3c1('0x1'));var timeout=require(_0xf3c1('0x2'));var express=require(_0xf3c1('0x3'));var router=express['Router']();var fs_extra=require(_0xf3c1('0x4'));var auth=require(_0xf3c1('0x5'));var interaction=require(_0xf3c1('0x6'));var config=require(_0xf3c1('0x7'));var controller=require(_0xf3c1('0x8'));router[_0xf3c1('0x9')]('/',auth[_0xf3c1('0xa')](),controller[_0xf3c1('0xb')]);router[_0xf3c1('0x9')](_0xf3c1('0xc'),auth['isAuthenticated'](),controller[_0xf3c1('0xd')]);router[_0xf3c1('0x9')](_0xf3c1('0xe'),auth[_0xf3c1('0xa')](),controller[_0xf3c1('0xf')]);router[_0xf3c1('0x9')](_0xf3c1('0x10'),auth[_0xf3c1('0xa')](),controller['getAnyConditions']);router[_0xf3c1('0x9')](_0xf3c1('0x11'),auth[_0xf3c1('0xa')](),controller[_0xf3c1('0x12')]);router[_0xf3c1('0x13')]('/',auth[_0xf3c1('0xa')](),controller[_0xf3c1('0x14')]);router['post'](_0xf3c1('0xe'),auth[_0xf3c1('0xa')](),controller[_0xf3c1('0x15')]);router[_0xf3c1('0x13')](_0xf3c1('0x10'),auth[_0xf3c1('0xa')](),controller['addAnyCondition']);router[_0xf3c1('0x13')](_0xf3c1('0x11'),auth[_0xf3c1('0xa')](),controller[_0xf3c1('0x16')]);router[_0xf3c1('0x17')](_0xf3c1('0xc'),auth[_0xf3c1('0xa')](),controller[_0xf3c1('0x18')]);router[_0xf3c1('0x19')](_0xf3c1('0xc'),auth[_0xf3c1('0xa')](),controller[_0xf3c1('0x1a')]);module[_0xf3c1('0x1b')]=router; \ No newline at end of file +var _0x4cdc=['destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','/:id','show','getAllConditions','/:id/any_conditions','getAnyConditions','getActions','create','post','/:id/all_conditions','addAllCondition','addAnyCondition','addAction','put'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x4cdc,0x13a));var _0xc4cd=function(_0x147797,_0x55fb85){_0x147797=_0x147797-0x0;var _0x4ad15a=_0x4cdc[_0x147797];return _0x4ad15a;};'use strict';var multer=require(_0xc4cd('0x0'));var util=require(_0xc4cd('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc4cd('0x2'));var router=express[_0xc4cd('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc4cd('0x4'));var interaction=require(_0xc4cd('0x5'));var config=require(_0xc4cd('0x6'));var controller=require(_0xc4cd('0x7'));router[_0xc4cd('0x8')]('/',auth[_0xc4cd('0x9')](),controller[_0xc4cd('0xa')]);router[_0xc4cd('0x8')](_0xc4cd('0xb'),auth['isAuthenticated'](),controller[_0xc4cd('0xc')]);router[_0xc4cd('0x8')]('/:id/all_conditions',auth[_0xc4cd('0x9')](),controller[_0xc4cd('0xd')]);router['get'](_0xc4cd('0xe'),auth[_0xc4cd('0x9')](),controller[_0xc4cd('0xf')]);router[_0xc4cd('0x8')]('/:id/actions',auth[_0xc4cd('0x9')](),controller[_0xc4cd('0x10')]);router['post']('/',auth[_0xc4cd('0x9')](),controller[_0xc4cd('0x11')]);router[_0xc4cd('0x12')](_0xc4cd('0x13'),auth['isAuthenticated'](),controller[_0xc4cd('0x14')]);router[_0xc4cd('0x12')](_0xc4cd('0xe'),auth[_0xc4cd('0x9')](),controller[_0xc4cd('0x15')]);router[_0xc4cd('0x12')]('/:id/actions',auth[_0xc4cd('0x9')](),controller[_0xc4cd('0x16')]);router[_0xc4cd('0x17')](_0xc4cd('0xb'),auth[_0xc4cd('0x9')](),controller['update']);router['delete'](_0xc4cd('0xb'),auth[_0xc4cd('0x9')](),controller[_0xc4cd('0x18')]);module[_0xc4cd('0x19')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 822a52f..e47e1cb 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 _0x92e3=['BOOLEAN','sequelize','exports','STRING'];(function(_0x25c441,_0x1c0b0c){var _0x2b717d=function(_0x63f698){while(--_0x63f698){_0x25c441['push'](_0x25c441['shift']());}};_0x2b717d(++_0x1c0b0c);}(_0x92e3,0x199));var _0x392e=function(_0x1912a2,_0x1134d9){_0x1912a2=_0x1912a2-0x0;var _0x36af53=_0x92e3[_0x1912a2];return _0x36af53;};'use strict';var Sequelize=require(_0x392e('0x0'));module[_0x392e('0x1')]={'name':{'type':Sequelize[_0x392e('0x2')]},'channel':{'type':Sequelize[_0x392e('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x392e('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xb93e=['sequelize','exports','BOOLEAN'];(function(_0x2e39bd,_0x49ea5a){var _0x2ac9c6=function(_0x4f834b){while(--_0x4f834b){_0x2e39bd['push'](_0x2e39bd['shift']());}};_0x2ac9c6(++_0x49ea5a);}(_0xb93e,0x1a4));var _0xeb93=function(_0x18bc16,_0x76e09d){_0x18bc16=_0x18bc16-0x0;var _0x5120ff=_0xb93e[_0x18bc16];return _0x5120ff;};'use strict';var Sequelize=require(_0xeb93('0x0'));module[_0xeb93('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xeb93('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 f6f3544..cb301e8 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 _0x95d0=['../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','Content-Range','json','reject','save','destroy','then','get','Triggers','UserProfileResource','end','error','stack','name','send','index','map','Trigger','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','include','findAll','rows','catch','params','includeAll','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','update','body','addAllCondition','TriggerAllId','Condition','TriggerAnyId','getAllConditions','findOne','order','length','nolimit','getAnyConditions','addAction','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils'];(function(_0x5c1755,_0x8731f6){var _0x3399b0=function(_0x38f8f5){while(--_0x38f8f5){_0x5c1755['push'](_0x5c1755['shift']());}};_0x3399b0(++_0x8731f6);}(_0x95d0,0x16e));var _0x095d=function(_0x458689,_0xed0bae){_0x458689=_0x458689-0x0;var _0x53c928=_0x95d0[_0x458689];return _0x53c928;};'use strict';var emlformat=require(_0x095d('0x0'));var rimraf=require(_0x095d('0x1'));var zipdir=require(_0x095d('0x2'));var jsonpatch=require(_0x095d('0x3'));var rp=require(_0x095d('0x4'));var moment=require(_0x095d('0x5'));var BPromise=require(_0x095d('0x6'));var Mustache=require(_0x095d('0x7'));var util=require(_0x095d('0x8'));var path=require(_0x095d('0x9'));var sox=require(_0x095d('0xa'));var csv=require(_0x095d('0xb'));var ejs=require(_0x095d('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x095d('0xd'));var squel=require(_0x095d('0xe'));var crypto=require(_0x095d('0xf'));var jsforce=require(_0x095d('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x095d('0xb'));var querystring=require(_0x095d('0x11'));var Papa=require(_0x095d('0x12'));var Redis=require(_0x095d('0x13'));var authService=require(_0x095d('0x14'));var qs=require(_0x095d('0x15'));var as=require(_0x095d('0x16'));var hardwareService=require(_0x095d('0x17'));var logger=require(_0x095d('0x18'))('api');var utils=require(_0x095d('0x19'));var config=require(_0x095d('0x1a'));var licenseUtil=require(_0x095d('0x1b'));var db=require(_0x095d('0x1c'))['db'];function respondWithStatusCode(_0x4ecf8e,_0xc8677){_0xc8677=_0xc8677||0xcc;return function(_0x2dcb50){if(_0x2dcb50){return _0x4ecf8e['sendStatus'](_0xc8677);}return _0x4ecf8e[_0x095d('0x1d')](_0xc8677)['end']();};}function respondWithResult(_0x3abf09,_0x723fc2){_0x723fc2=_0x723fc2||0xc8;return function(_0x5cad7d){if(_0x5cad7d){return _0x3abf09[_0x095d('0x1d')](_0x723fc2)['json'](_0x5cad7d);}};}function respondWithFilteredResult(_0x3a23b4,_0x34f5c8){return function(_0x67a226){if(_0x67a226){var _0x5566d2=typeof _0x34f5c8[_0x095d('0x1e')]===_0x095d('0x1f')&&typeof _0x34f5c8[_0x095d('0x20')]===_0x095d('0x1f');var _0x5a90e5=_0x67a226['count'];var _0x426b77=_0x5566d2?0x0:_0x34f5c8['offset'];var _0x3419d1=_0x5566d2?_0x67a226[_0x095d('0x21')]:_0x34f5c8[_0x095d('0x1e')]+_0x34f5c8[_0x095d('0x20')];var _0x5f16a1;if(_0x3419d1>=_0x5a90e5){_0x3419d1=_0x5a90e5;_0x5f16a1=0xc8;}else{_0x5f16a1=0xce;}_0x3a23b4[_0x095d('0x1d')](_0x5f16a1);return _0x3a23b4['set'](_0x095d('0x22'),_0x426b77+'-'+_0x3419d1+'/'+_0x5a90e5)[_0x095d('0x23')](_0x67a226);}return null;};}function patchUpdates(_0x47f472){return function(_0x173370){try{jsonpatch['apply'](_0x173370,_0x47f472,!![]);}catch(_0x3860fa){return BPromise[_0x095d('0x24')](_0x3860fa);}return _0x173370[_0x095d('0x25')]();};}function saveUpdates(_0x2f7575,_0x41c245){return function(_0x220e90){if(_0x220e90){return _0x220e90['update'](_0x2f7575)['then'](function(_0x41c0f9){return _0x41c0f9;});}return null;};}function removeEntity(_0x4f87a8,_0x5ab47d){return function(_0x2338e1){if(_0x2338e1){return _0x2338e1[_0x095d('0x26')]()[_0x095d('0x27')](function(){var _0x5627fd=_0x2338e1[_0x095d('0x28')]({'plain':!![]});var _0x5f515a=_0x095d('0x29');return db[_0x095d('0x2a')]['destroy']({'where':{'type':_0x5f515a,'resourceId':_0x5627fd['id']}})['then'](function(){return _0x2338e1;});})[_0x095d('0x27')](function(){_0x4f87a8[_0x095d('0x1d')](0xcc)[_0x095d('0x2b')]();});}};}function handleEntityNotFound(_0x193bbb,_0x597a93){return function(_0x36ecf6){if(!_0x36ecf6){_0x193bbb['sendStatus'](0x194);}return _0x36ecf6;};}function handleError(_0x3a2946,_0x371200){_0x371200=_0x371200||0x1f4;return function(_0x49f346){logger[_0x095d('0x2c')](_0x49f346[_0x095d('0x2d')]);if(_0x49f346[_0x095d('0x2e')]){delete _0x49f346[_0x095d('0x2e')];}_0x3a2946['status'](_0x371200)[_0x095d('0x2f')](_0x49f346);};}exports[_0x095d('0x30')]=function(_0x1f0e11,_0x419489){var _0x4f2c6f={},_0x116672={},_0x20415a={'count':0x0,'rows':[]};var _0x5b239f=_[_0x095d('0x31')](db[_0x095d('0x32')][_0x095d('0x33')],function(_0xfa2057){return{'name':_0xfa2057[_0x095d('0x34')],'type':_0xfa2057[_0x095d('0x35')]['key']};});_0x116672[_0x095d('0x36')]=_[_0x095d('0x31')](_0x5b239f,'name');_0x116672[_0x095d('0x37')]=_[_0x095d('0x38')](_0x1f0e11[_0x095d('0x37')]);_0x116672[_0x095d('0x39')]=_[_0x095d('0x3a')](_0x116672[_0x095d('0x36')],_0x116672[_0x095d('0x37')]);_0x4f2c6f['attributes']=_['intersection'](_0x116672['model'],qs[_0x095d('0x3b')](_0x1f0e11[_0x095d('0x37')][_0x095d('0x3b')]));_0x4f2c6f[_0x095d('0x3c')]=_0x4f2c6f[_0x095d('0x3c')]['length']?_0x4f2c6f[_0x095d('0x3c')]:_0x116672[_0x095d('0x36')];if(!_0x1f0e11[_0x095d('0x37')][_0x095d('0x3d')]('nolimit')){_0x4f2c6f['limit']=qs[_0x095d('0x20')](_0x1f0e11[_0x095d('0x37')][_0x095d('0x20')]);_0x4f2c6f[_0x095d('0x1e')]=qs[_0x095d('0x1e')](_0x1f0e11[_0x095d('0x37')][_0x095d('0x1e')]);}_0x4f2c6f['order']=qs[_0x095d('0x3e')](_0x1f0e11['query']['sort']);_0x4f2c6f[_0x095d('0x3f')]=qs['filters'](_[_0x095d('0x40')](_0x1f0e11[_0x095d('0x37')],_0x116672[_0x095d('0x39')]),_0x5b239f);if(_0x1f0e11[_0x095d('0x37')]['filter']){_0x4f2c6f['where']=_[_0x095d('0x41')](_0x4f2c6f[_0x095d('0x3f')],{'$or':_['map'](_0x5b239f,function(_0x703266){if(_0x703266[_0x095d('0x35')]!==_0x095d('0x42')){var _0x3e88df={};_0x3e88df[_0x703266[_0x095d('0x2e')]]={'$like':'%'+_0x1f0e11[_0x095d('0x37')][_0x095d('0x43')]+'%'};return _0x3e88df;}})});}_0x4f2c6f=_[_0x095d('0x41')]({},_0x4f2c6f,_0x1f0e11['options']);var _0x265b33={'where':_0x4f2c6f[_0x095d('0x3f')]};return db[_0x095d('0x32')][_0x095d('0x21')](_0x265b33)[_0x095d('0x27')](function(_0x337cca){_0x20415a['count']=_0x337cca;if(_0x1f0e11[_0x095d('0x37')]['includeAll']){_0x4f2c6f[_0x095d('0x44')]=[{'all':!![]}];}return db['Trigger'][_0x095d('0x45')](_0x4f2c6f);})[_0x095d('0x27')](function(_0x5d6582){_0x20415a[_0x095d('0x46')]=_0x5d6582;return _0x20415a;})[_0x095d('0x27')](respondWithFilteredResult(_0x419489,_0x4f2c6f))[_0x095d('0x47')](handleError(_0x419489,null));};exports['show']=function(_0x5af404,_0x5ca7dc){var _0x4b13b9={'raw':![],'where':{'id':_0x5af404[_0x095d('0x48')]['id']}},_0x18fb08={};_0x18fb08[_0x095d('0x36')]=_['keys'](db['Trigger'][_0x095d('0x33')]);_0x18fb08[_0x095d('0x37')]=_['keys'](_0x5af404[_0x095d('0x37')]);_0x18fb08['filters']=_['intersection'](_0x18fb08[_0x095d('0x36')],_0x18fb08[_0x095d('0x37')]);_0x4b13b9[_0x095d('0x3c')]=_[_0x095d('0x3a')](_0x18fb08[_0x095d('0x36')],qs[_0x095d('0x3b')](_0x5af404[_0x095d('0x37')][_0x095d('0x3b')]));_0x4b13b9[_0x095d('0x3c')]=_0x4b13b9[_0x095d('0x3c')]['length']?_0x4b13b9[_0x095d('0x3c')]:_0x18fb08['model'];if(_0x5af404[_0x095d('0x37')][_0x095d('0x49')]){_0x4b13b9['include']=[{'all':!![]}];}_0x4b13b9=_[_0x095d('0x41')]({},_0x4b13b9,_0x5af404[_0x095d('0x4a')]);return db[_0x095d('0x32')][_0x095d('0x4b')](_0x4b13b9)[_0x095d('0x27')](handleEntityNotFound(_0x5ca7dc,null))['then'](respondWithResult(_0x5ca7dc,null))[_0x095d('0x47')](handleError(_0x5ca7dc,null));};exports[_0x095d('0x4c')]=function(_0xa6d62a,_0x49a6e2){return db[_0x095d('0x32')][_0x095d('0x4c')](_0xa6d62a['body'],{})[_0x095d('0x27')](function(_0x1f8a47){var _0x38465b=_0xa6d62a[_0x095d('0x4d')][_0x095d('0x28')]({'plain':!![]});if(!_0x38465b)throw new Error(_0x095d('0x4e'));if(_0x38465b[_0x095d('0x4f')]==='user'){var _0x2b1194=_0x1f8a47[_0x095d('0x28')]({'plain':!![]});var _0x295770=_0x095d('0x29');return db[_0x095d('0x50')][_0x095d('0x4b')]({'where':{'name':_0x295770,'userProfileId':_0x38465b[_0x095d('0x51')]},'raw':!![]})['then'](function(_0x2aeb30){if(_0x2aeb30&&_0x2aeb30[_0x095d('0x52')]===0x0){return db[_0x095d('0x2a')][_0x095d('0x4c')]({'name':_0x2b1194[_0x095d('0x2e')],'resourceId':_0x2b1194['id'],'type':_0x2aeb30[_0x095d('0x2e')],'sectionId':_0x2aeb30['id']},{})[_0x095d('0x27')](function(){return _0x1f8a47;});}else{return _0x1f8a47;}})[_0x095d('0x47')](function(_0x574b6d){logger[_0x095d('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x574b6d);throw _0x574b6d;});}return _0x1f8a47;})['then'](respondWithResult(_0x49a6e2,0xc9))[_0x095d('0x47')](handleError(_0x49a6e2,null));};exports[_0x095d('0x53')]=function(_0x15acc1,_0x309eb5){if(_0x15acc1['body']['id']){delete _0x15acc1[_0x095d('0x54')]['id'];}return db[_0x095d('0x32')][_0x095d('0x4b')]({'where':{'id':_0x15acc1['params']['id']}})[_0x095d('0x27')](handleEntityNotFound(_0x309eb5,null))[_0x095d('0x27')](saveUpdates(_0x15acc1[_0x095d('0x54')],null))['then'](respondWithResult(_0x309eb5,null))[_0x095d('0x47')](handleError(_0x309eb5,null));};exports[_0x095d('0x26')]=function(_0x38fc8f,_0xf15a2b){return db[_0x095d('0x32')][_0x095d('0x4b')]({'where':{'id':_0x38fc8f[_0x095d('0x48')]['id']}})[_0x095d('0x27')](handleEntityNotFound(_0xf15a2b,null))[_0x095d('0x27')](removeEntity(_0xf15a2b,null))[_0x095d('0x47')](handleError(_0xf15a2b,null));};exports[_0x095d('0x55')]=function(_0x2d64b9,_0x516ce5,_0x1c4306){if(_0x2d64b9[_0x095d('0x54')]['id']){delete _0x2d64b9[_0x095d('0x54')]['id'];}return db[_0x095d('0x32')][_0x095d('0x4b')]({'where':{'id':_0x2d64b9['params']['id']}})['then'](handleEntityNotFound(_0x516ce5,null))[_0x095d('0x27')](function(_0x4c29d8){if(_0x4c29d8){_0x2d64b9[_0x095d('0x54')][_0x095d('0x56')]=_0x4c29d8['id'];return db[_0x095d('0x57')][_0x095d('0x4c')](_0x2d64b9[_0x095d('0x54')]);}})[_0x095d('0x27')](respondWithResult(_0x516ce5,null))[_0x095d('0x47')](handleError(_0x516ce5,null));};exports['addAnyCondition']=function(_0x456c68,_0x2e5ae9,_0x556599){if(_0x456c68[_0x095d('0x54')]['id']){delete _0x456c68['body']['id'];}return db['Trigger'][_0x095d('0x4b')]({'where':{'id':_0x456c68[_0x095d('0x48')]['id']}})[_0x095d('0x27')](handleEntityNotFound(_0x2e5ae9,null))[_0x095d('0x27')](function(_0x56c16f){if(_0x56c16f){_0x456c68['body'][_0x095d('0x58')]=_0x56c16f['id'];return db[_0x095d('0x57')][_0x095d('0x4c')](_0x456c68[_0x095d('0x54')]);}})[_0x095d('0x27')](respondWithResult(_0x2e5ae9,null))[_0x095d('0x47')](handleError(_0x2e5ae9,null));};exports[_0x095d('0x59')]=function(_0x254203,_0x33b8b4,_0x1277b9){var _0x4072d6={};var _0x88c4d={};var _0x4ba93a;var _0x4dd526;return db['Trigger'][_0x095d('0x5a')]({'where':{'id':_0x254203['params']['id']}})[_0x095d('0x27')](handleEntityNotFound(_0x33b8b4,null))[_0x095d('0x27')](function(_0x484e25){if(_0x484e25){_0x4ba93a=_0x484e25;_0x88c4d[_0x095d('0x36')]=_['keys'](db[_0x095d('0x57')][_0x095d('0x33')]);_0x88c4d[_0x095d('0x37')]=_[_0x095d('0x38')](_0x254203[_0x095d('0x37')]);_0x88c4d[_0x095d('0x39')]=_['intersection'](_0x88c4d[_0x095d('0x36')],_0x88c4d[_0x095d('0x37')]);_0x4072d6[_0x095d('0x3c')]=_['intersection'](_0x88c4d['model'],qs[_0x095d('0x3b')](_0x254203[_0x095d('0x37')][_0x095d('0x3b')]));_0x4072d6[_0x095d('0x3c')]=_0x4072d6[_0x095d('0x3c')]['length']?_0x4072d6[_0x095d('0x3c')]:_0x88c4d[_0x095d('0x36')];_0x4072d6[_0x095d('0x5b')]=qs[_0x095d('0x3e')](_0x254203['query'][_0x095d('0x3e')]);_0x4072d6[_0x095d('0x3f')]=qs[_0x095d('0x39')](_[_0x095d('0x40')](_0x254203[_0x095d('0x37')],_0x88c4d[_0x095d('0x39')]));if(_0x254203[_0x095d('0x37')][_0x095d('0x43')]){_0x4072d6[_0x095d('0x3f')]=_[_0x095d('0x41')](_0x4072d6[_0x095d('0x3f')],{'$or':_[_0x095d('0x31')](_0x4072d6['attributes'],function(_0x25d986){var _0x58f995={};_0x58f995[_0x25d986]={'$like':'%'+_0x254203['query'][_0x095d('0x43')]+'%'};return _0x58f995;})});}_0x4072d6=_[_0x095d('0x41')]({},_0x4072d6,_0x254203['options']);return _0x4ba93a[_0x095d('0x59')](_0x4072d6);}})['then'](function(_0x2b4eec){if(_0x2b4eec){_0x4dd526=_0x2b4eec[_0x095d('0x5c')];if(!_0x254203[_0x095d('0x37')][_0x095d('0x3d')](_0x095d('0x5d'))){_0x4072d6[_0x095d('0x20')]=qs[_0x095d('0x20')](_0x254203['query']['limit']);_0x4072d6['offset']=qs['offset'](_0x254203[_0x095d('0x37')][_0x095d('0x1e')]);}return _0x4ba93a[_0x095d('0x59')](_0x4072d6);}})[_0x095d('0x27')](function(_0x4df738){if(_0x4df738){return _0x4df738?{'count':_0x4dd526,'rows':_0x4df738}:null;}})[_0x095d('0x27')](respondWithResult(_0x33b8b4,null))['catch'](handleError(_0x33b8b4,null));};exports['getAnyConditions']=function(_0xb6c1e1,_0x157ff0,_0x3b702f){var _0x3aba1b={};var _0x266f5f={};var _0x486e28;var _0x49272f;return db[_0x095d('0x32')][_0x095d('0x5a')]({'where':{'id':_0xb6c1e1[_0x095d('0x48')]['id']}})[_0x095d('0x27')](handleEntityNotFound(_0x157ff0,null))[_0x095d('0x27')](function(_0x166516){if(_0x166516){_0x486e28=_0x166516;_0x266f5f[_0x095d('0x36')]=_['keys'](db[_0x095d('0x57')][_0x095d('0x33')]);_0x266f5f[_0x095d('0x37')]=_[_0x095d('0x38')](_0xb6c1e1[_0x095d('0x37')]);_0x266f5f[_0x095d('0x39')]=_[_0x095d('0x3a')](_0x266f5f[_0x095d('0x36')],_0x266f5f[_0x095d('0x37')]);_0x3aba1b[_0x095d('0x3c')]=_[_0x095d('0x3a')](_0x266f5f[_0x095d('0x36')],qs[_0x095d('0x3b')](_0xb6c1e1['query'][_0x095d('0x3b')]));_0x3aba1b[_0x095d('0x3c')]=_0x3aba1b[_0x095d('0x3c')][_0x095d('0x5c')]?_0x3aba1b[_0x095d('0x3c')]:_0x266f5f[_0x095d('0x36')];_0x3aba1b['order']=qs[_0x095d('0x3e')](_0xb6c1e1[_0x095d('0x37')][_0x095d('0x3e')]);_0x3aba1b[_0x095d('0x3f')]=qs['filters'](_[_0x095d('0x40')](_0xb6c1e1[_0x095d('0x37')],_0x266f5f['filters']));if(_0xb6c1e1[_0x095d('0x37')][_0x095d('0x43')]){_0x3aba1b[_0x095d('0x3f')]=_[_0x095d('0x41')](_0x3aba1b[_0x095d('0x3f')],{'$or':_[_0x095d('0x31')](_0x3aba1b[_0x095d('0x3c')],function(_0x4e6d47){var _0xa77438={};_0xa77438[_0x4e6d47]={'$like':'%'+_0xb6c1e1[_0x095d('0x37')][_0x095d('0x43')]+'%'};return _0xa77438;})});}_0x3aba1b=_[_0x095d('0x41')]({},_0x3aba1b,_0xb6c1e1['options']);return _0x486e28[_0x095d('0x5e')](_0x3aba1b);}})[_0x095d('0x27')](function(_0x521afc){if(_0x521afc){_0x49272f=_0x521afc['length'];if(!_0xb6c1e1['query'][_0x095d('0x3d')](_0x095d('0x5d'))){_0x3aba1b[_0x095d('0x20')]=qs[_0x095d('0x20')](_0xb6c1e1[_0x095d('0x37')][_0x095d('0x20')]);_0x3aba1b[_0x095d('0x1e')]=qs[_0x095d('0x1e')](_0xb6c1e1['query'][_0x095d('0x1e')]);}return _0x486e28['getAnyConditions'](_0x3aba1b);}})[_0x095d('0x27')](function(_0x260de1){if(_0x260de1){return _0x260de1?{'count':_0x49272f,'rows':_0x260de1}:null;}})[_0x095d('0x27')](respondWithResult(_0x157ff0,null))[_0x095d('0x47')](handleError(_0x157ff0,null));};exports[_0x095d('0x5f')]=function(_0x5ea178,_0x5e6872,_0x580d49){if(_0x5ea178[_0x095d('0x54')]['id']){delete _0x5ea178[_0x095d('0x54')]['id'];}return db[_0x095d('0x32')][_0x095d('0x4b')]({'where':{'id':_0x5ea178[_0x095d('0x48')]['id']}})[_0x095d('0x27')](handleEntityNotFound(_0x5e6872,null))[_0x095d('0x27')](function(_0x197b88){if(_0x197b88){_0x5ea178[_0x095d('0x54')]['TriggerId']=_0x197b88['id'];return db['Action'][_0x095d('0x4c')](_0x5ea178['body']);}})['then'](respondWithResult(_0x5e6872,null))[_0x095d('0x47')](handleError(_0x5e6872,null));};exports['getActions']=function(_0x6c218c,_0x42ee78,_0x4ccdf8){var _0x21d36c={};var _0x3af5d5={};var _0x4e3bf5;var _0x3cd608;return db[_0x095d('0x32')]['findOne']({'where':{'id':_0x6c218c['params']['id']}})['then'](handleEntityNotFound(_0x42ee78,null))[_0x095d('0x27')](function(_0x4c81ce){if(_0x4c81ce){_0x4e3bf5=_0x4c81ce;_0x3af5d5[_0x095d('0x36')]=_[_0x095d('0x38')](db[_0x095d('0x60')][_0x095d('0x33')]);_0x3af5d5[_0x095d('0x37')]=_[_0x095d('0x38')](_0x6c218c[_0x095d('0x37')]);_0x3af5d5[_0x095d('0x39')]=_['intersection'](_0x3af5d5[_0x095d('0x36')],_0x3af5d5['query']);_0x21d36c[_0x095d('0x3c')]=_['intersection'](_0x3af5d5[_0x095d('0x36')],qs[_0x095d('0x3b')](_0x6c218c[_0x095d('0x37')][_0x095d('0x3b')]));_0x21d36c[_0x095d('0x3c')]=_0x21d36c['attributes'][_0x095d('0x5c')]?_0x21d36c[_0x095d('0x3c')]:_0x3af5d5[_0x095d('0x36')];_0x21d36c[_0x095d('0x5b')]=qs['sort'](_0x6c218c['query'][_0x095d('0x3e')]);_0x21d36c[_0x095d('0x3f')]=qs['filters'](_[_0x095d('0x40')](_0x6c218c[_0x095d('0x37')],_0x3af5d5[_0x095d('0x39')]));if(_0x6c218c[_0x095d('0x37')][_0x095d('0x43')]){_0x21d36c[_0x095d('0x3f')]=_[_0x095d('0x41')](_0x21d36c[_0x095d('0x3f')],{'$or':_[_0x095d('0x31')](_0x21d36c[_0x095d('0x3c')],function(_0x4827be){var _0xa5011a={};_0xa5011a[_0x4827be]={'$like':'%'+_0x6c218c['query'][_0x095d('0x43')]+'%'};return _0xa5011a;})});}_0x21d36c=_[_0x095d('0x41')]({},_0x21d36c,_0x6c218c['options']);return _0x4e3bf5[_0x095d('0x61')](_0x21d36c);}})[_0x095d('0x27')](function(_0x35f6db){if(_0x35f6db){_0x3cd608=_0x35f6db[_0x095d('0x5c')];if(!_0x6c218c[_0x095d('0x37')][_0x095d('0x3d')](_0x095d('0x5d'))){_0x21d36c['limit']=qs[_0x095d('0x20')](_0x6c218c['query'][_0x095d('0x20')]);_0x21d36c['offset']=qs[_0x095d('0x1e')](_0x6c218c[_0x095d('0x37')]['offset']);}return _0x4e3bf5['getActions'](_0x21d36c);}})[_0x095d('0x27')](function(_0xb059ac){if(_0xb059ac){return _0xb059ac?{'count':_0x3cd608,'rows':_0xb059ac}:null;}})[_0x095d('0x27')](respondWithResult(_0x42ee78,null))[_0x095d('0x47')](handleError(_0x42ee78,null));}; \ No newline at end of file +var _0x37d5=['VIRTUAL','options','includeAll','include','rows','catch','params','rawAttributes','find','create','body','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','Condition','getAllConditions','length','order','findOne','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','limit','set','apply','save','update','then','get','Triggers','UserProfileResource','destroy','stack','name','send','index','map','Trigger','fieldName','type','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x37d5,0x132));var _0x537d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x37d5[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x537d('0x0'));var rimraf=require(_0x537d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x537d('0x2'));var rp=require(_0x537d('0x3'));var moment=require(_0x537d('0x4'));var BPromise=require(_0x537d('0x5'));var Mustache=require(_0x537d('0x6'));var util=require(_0x537d('0x7'));var path=require(_0x537d('0x8'));var sox=require(_0x537d('0x9'));var csv=require(_0x537d('0xa'));var ejs=require(_0x537d('0xb'));var fs=require('fs');var fs_extra=require(_0x537d('0xc'));var _=require(_0x537d('0xd'));var squel=require(_0x537d('0xe'));var crypto=require(_0x537d('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x537d('0xa'));var querystring=require(_0x537d('0x10'));var Papa=require(_0x537d('0x11'));var Redis=require(_0x537d('0x12'));var authService=require(_0x537d('0x13'));var qs=require(_0x537d('0x14'));var as=require(_0x537d('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x537d('0x16'))(_0x537d('0x17'));var utils=require('../../config/utils');var config=require(_0x537d('0x18'));var licenseUtil=require(_0x537d('0x19'));var db=require(_0x537d('0x1a'))['db'];function respondWithStatusCode(_0x41bc7a,_0x4f0580){_0x4f0580=_0x4f0580||0xcc;return function(_0x68cdaa){if(_0x68cdaa){return _0x41bc7a[_0x537d('0x1b')](_0x4f0580);}return _0x41bc7a['status'](_0x4f0580)[_0x537d('0x1c')]();};}function respondWithResult(_0x31347f,_0x1594e9){_0x1594e9=_0x1594e9||0xc8;return function(_0x2bd303){if(_0x2bd303){return _0x31347f[_0x537d('0x1d')](_0x1594e9)[_0x537d('0x1e')](_0x2bd303);}};}function respondWithFilteredResult(_0x56f9a1,_0x23c42d){return function(_0x20747f){if(_0x20747f){var _0x577e4c=typeof _0x23c42d['offset']===_0x537d('0x1f')&&typeof _0x23c42d['limit']===_0x537d('0x1f');var _0x578c1e=_0x20747f['count'];var _0x5222c5=_0x577e4c?0x0:_0x23c42d['offset'];var _0x537f3d=_0x577e4c?_0x20747f[_0x537d('0x20')]:_0x23c42d[_0x537d('0x21')]+_0x23c42d[_0x537d('0x22')];var _0xbbe80e;if(_0x537f3d>=_0x578c1e){_0x537f3d=_0x578c1e;_0xbbe80e=0xc8;}else{_0xbbe80e=0xce;}_0x56f9a1[_0x537d('0x1d')](_0xbbe80e);return _0x56f9a1[_0x537d('0x23')]('Content-Range',_0x5222c5+'-'+_0x537f3d+'/'+_0x578c1e)[_0x537d('0x1e')](_0x20747f);}return null;};}function patchUpdates(_0x385d9d){return function(_0x1f8f20){try{jsonpatch[_0x537d('0x24')](_0x1f8f20,_0x385d9d,!![]);}catch(_0x5e6f6f){return BPromise['reject'](_0x5e6f6f);}return _0x1f8f20[_0x537d('0x25')]();};}function saveUpdates(_0x59d4ba,_0x14cfb9){return function(_0x2a4d73){if(_0x2a4d73){return _0x2a4d73[_0x537d('0x26')](_0x59d4ba)[_0x537d('0x27')](function(_0x170118){return _0x170118;});}return null;};}function removeEntity(_0x3699de,_0x1979ef){return function(_0xb81ca9){if(_0xb81ca9){return _0xb81ca9['destroy']()['then'](function(){var _0x49ab53=_0xb81ca9[_0x537d('0x28')]({'plain':!![]});var _0x114a69=_0x537d('0x29');return db[_0x537d('0x2a')][_0x537d('0x2b')]({'where':{'type':_0x114a69,'resourceId':_0x49ab53['id']}})[_0x537d('0x27')](function(){return _0xb81ca9;});})[_0x537d('0x27')](function(){_0x3699de[_0x537d('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x451ef2,_0x59d0f6){return function(_0x306393){if(!_0x306393){_0x451ef2[_0x537d('0x1b')](0x194);}return _0x306393;};}function handleError(_0x5e2c68,_0x4dcbe2){_0x4dcbe2=_0x4dcbe2||0x1f4;return function(_0x85f4be){logger['error'](_0x85f4be[_0x537d('0x2c')]);if(_0x85f4be[_0x537d('0x2d')]){delete _0x85f4be[_0x537d('0x2d')];}_0x5e2c68['status'](_0x4dcbe2)[_0x537d('0x2e')](_0x85f4be);};}exports[_0x537d('0x2f')]=function(_0x3e0cda,_0x28723a){var _0x3e10ee={},_0x5a4df8={},_0x278d1f={'count':0x0,'rows':[]};var _0x205330=_[_0x537d('0x30')](db[_0x537d('0x31')]['rawAttributes'],function(_0x13cb36){return{'name':_0x13cb36[_0x537d('0x32')],'type':_0x13cb36[_0x537d('0x33')]['key']};});_0x5a4df8[_0x537d('0x34')]=_[_0x537d('0x30')](_0x205330,_0x537d('0x2d'));_0x5a4df8['query']=_[_0x537d('0x35')](_0x3e0cda[_0x537d('0x36')]);_0x5a4df8[_0x537d('0x37')]=_['intersection'](_0x5a4df8[_0x537d('0x34')],_0x5a4df8[_0x537d('0x36')]);_0x3e10ee[_0x537d('0x38')]=_[_0x537d('0x39')](_0x5a4df8[_0x537d('0x34')],qs[_0x537d('0x3a')](_0x3e0cda[_0x537d('0x36')][_0x537d('0x3a')]));_0x3e10ee[_0x537d('0x38')]=_0x3e10ee[_0x537d('0x38')]['length']?_0x3e10ee[_0x537d('0x38')]:_0x5a4df8[_0x537d('0x34')];if(!_0x3e0cda[_0x537d('0x36')][_0x537d('0x3b')](_0x537d('0x3c'))){_0x3e10ee[_0x537d('0x22')]=qs[_0x537d('0x22')](_0x3e0cda['query'][_0x537d('0x22')]);_0x3e10ee[_0x537d('0x21')]=qs[_0x537d('0x21')](_0x3e0cda[_0x537d('0x36')][_0x537d('0x21')]);}_0x3e10ee['order']=qs['sort'](_0x3e0cda[_0x537d('0x36')][_0x537d('0x3d')]);_0x3e10ee[_0x537d('0x3e')]=qs['filters'](_[_0x537d('0x3f')](_0x3e0cda[_0x537d('0x36')],_0x5a4df8[_0x537d('0x37')]),_0x205330);if(_0x3e0cda['query'][_0x537d('0x40')]){_0x3e10ee[_0x537d('0x3e')]=_[_0x537d('0x41')](_0x3e10ee[_0x537d('0x3e')],{'$or':_[_0x537d('0x30')](_0x205330,function(_0x3c7b0f){if(_0x3c7b0f[_0x537d('0x33')]!==_0x537d('0x42')){var _0x3c05ad={};_0x3c05ad[_0x3c7b0f[_0x537d('0x2d')]]={'$like':'%'+_0x3e0cda[_0x537d('0x36')]['filter']+'%'};return _0x3c05ad;}})});}_0x3e10ee=_['merge']({},_0x3e10ee,_0x3e0cda[_0x537d('0x43')]);var _0x3a60c5={'where':_0x3e10ee[_0x537d('0x3e')]};return db['Trigger'][_0x537d('0x20')](_0x3a60c5)['then'](function(_0x458e96){_0x278d1f[_0x537d('0x20')]=_0x458e96;if(_0x3e0cda[_0x537d('0x36')][_0x537d('0x44')]){_0x3e10ee[_0x537d('0x45')]=[{'all':!![]}];}return db[_0x537d('0x31')]['findAll'](_0x3e10ee);})[_0x537d('0x27')](function(_0x1249f2){_0x278d1f[_0x537d('0x46')]=_0x1249f2;return _0x278d1f;})[_0x537d('0x27')](respondWithFilteredResult(_0x28723a,_0x3e10ee))[_0x537d('0x47')](handleError(_0x28723a,null));};exports['show']=function(_0xd47497,_0x29806b){var _0x374b4f={'raw':![],'where':{'id':_0xd47497[_0x537d('0x48')]['id']}},_0x341c7b={};_0x341c7b['model']=_[_0x537d('0x35')](db['Trigger'][_0x537d('0x49')]);_0x341c7b[_0x537d('0x36')]=_[_0x537d('0x35')](_0xd47497[_0x537d('0x36')]);_0x341c7b['filters']=_['intersection'](_0x341c7b['model'],_0x341c7b[_0x537d('0x36')]);_0x374b4f[_0x537d('0x38')]=_['intersection'](_0x341c7b[_0x537d('0x34')],qs[_0x537d('0x3a')](_0xd47497[_0x537d('0x36')][_0x537d('0x3a')]));_0x374b4f[_0x537d('0x38')]=_0x374b4f[_0x537d('0x38')]['length']?_0x374b4f[_0x537d('0x38')]:_0x341c7b[_0x537d('0x34')];if(_0xd47497[_0x537d('0x36')][_0x537d('0x44')]){_0x374b4f[_0x537d('0x45')]=[{'all':!![]}];}_0x374b4f=_[_0x537d('0x41')]({},_0x374b4f,_0xd47497[_0x537d('0x43')]);return db[_0x537d('0x31')][_0x537d('0x4a')](_0x374b4f)[_0x537d('0x27')](handleEntityNotFound(_0x29806b,null))['then'](respondWithResult(_0x29806b,null))[_0x537d('0x47')](handleError(_0x29806b,null));};exports[_0x537d('0x4b')]=function(_0x143e32,_0x536968){return db[_0x537d('0x31')][_0x537d('0x4b')](_0x143e32[_0x537d('0x4c')],{})[_0x537d('0x27')](function(_0xcc7d32){var _0x5c3977=_0x143e32[_0x537d('0x4d')][_0x537d('0x28')]({'plain':!![]});if(!_0x5c3977)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5c3977['role']===_0x537d('0x4d')){var _0x471813=_0xcc7d32['get']({'plain':!![]});var _0x29ad32=_0x537d('0x29');return db['UserProfileSection'][_0x537d('0x4a')]({'where':{'name':_0x29ad32,'userProfileId':_0x5c3977[_0x537d('0x4e')]},'raw':!![]})['then'](function(_0x47e601){if(_0x47e601&&_0x47e601[_0x537d('0x4f')]===0x0){return db[_0x537d('0x2a')]['create']({'name':_0x471813[_0x537d('0x2d')],'resourceId':_0x471813['id'],'type':_0x47e601[_0x537d('0x2d')],'sectionId':_0x47e601['id']},{})['then'](function(){return _0xcc7d32;});}else{return _0xcc7d32;}})[_0x537d('0x47')](function(_0x2da8c1){logger['error'](_0x537d('0x50'),_0x2da8c1);throw _0x2da8c1;});}return _0xcc7d32;})[_0x537d('0x27')](respondWithResult(_0x536968,0xc9))[_0x537d('0x47')](handleError(_0x536968,null));};exports[_0x537d('0x26')]=function(_0x499e93,_0x10eefd){if(_0x499e93[_0x537d('0x4c')]['id']){delete _0x499e93[_0x537d('0x4c')]['id'];}return db[_0x537d('0x31')][_0x537d('0x4a')]({'where':{'id':_0x499e93[_0x537d('0x48')]['id']}})[_0x537d('0x27')](handleEntityNotFound(_0x10eefd,null))[_0x537d('0x27')](saveUpdates(_0x499e93[_0x537d('0x4c')],null))[_0x537d('0x27')](respondWithResult(_0x10eefd,null))[_0x537d('0x47')](handleError(_0x10eefd,null));};exports['destroy']=function(_0x4fc478,_0x572ed6){return db[_0x537d('0x31')][_0x537d('0x4a')]({'where':{'id':_0x4fc478[_0x537d('0x48')]['id']}})[_0x537d('0x27')](handleEntityNotFound(_0x572ed6,null))['then'](removeEntity(_0x572ed6,null))[_0x537d('0x47')](handleError(_0x572ed6,null));};exports[_0x537d('0x51')]=function(_0x12d906,_0x2c4e9d,_0x4185ba){if(_0x12d906[_0x537d('0x4c')]['id']){delete _0x12d906[_0x537d('0x4c')]['id'];}return db[_0x537d('0x31')][_0x537d('0x4a')]({'where':{'id':_0x12d906[_0x537d('0x48')]['id']}})[_0x537d('0x27')](handleEntityNotFound(_0x2c4e9d,null))[_0x537d('0x27')](function(_0x2edae8){if(_0x2edae8){_0x12d906[_0x537d('0x4c')][_0x537d('0x52')]=_0x2edae8['id'];return db[_0x537d('0x53')][_0x537d('0x4b')](_0x12d906['body']);}})[_0x537d('0x27')](respondWithResult(_0x2c4e9d,null))[_0x537d('0x47')](handleError(_0x2c4e9d,null));};exports['addAnyCondition']=function(_0x514bba,_0xd918f2,_0x422025){if(_0x514bba['body']['id']){delete _0x514bba['body']['id'];}return db[_0x537d('0x31')]['find']({'where':{'id':_0x514bba['params']['id']}})[_0x537d('0x27')](handleEntityNotFound(_0xd918f2,null))[_0x537d('0x27')](function(_0x4c2c59){if(_0x4c2c59){_0x514bba[_0x537d('0x4c')]['TriggerAnyId']=_0x4c2c59['id'];return db[_0x537d('0x53')][_0x537d('0x4b')](_0x514bba[_0x537d('0x4c')]);}})[_0x537d('0x27')](respondWithResult(_0xd918f2,null))[_0x537d('0x47')](handleError(_0xd918f2,null));};exports[_0x537d('0x54')]=function(_0x5c5abc,_0x29f788,_0x50effa){var _0x3b7777={};var _0x7ddab3={};var _0x5a2b07;var _0x222b98;return db[_0x537d('0x31')]['findOne']({'where':{'id':_0x5c5abc['params']['id']}})[_0x537d('0x27')](handleEntityNotFound(_0x29f788,null))[_0x537d('0x27')](function(_0x434e36){if(_0x434e36){_0x5a2b07=_0x434e36;_0x7ddab3[_0x537d('0x34')]=_[_0x537d('0x35')](db[_0x537d('0x53')][_0x537d('0x49')]);_0x7ddab3[_0x537d('0x36')]=_[_0x537d('0x35')](_0x5c5abc[_0x537d('0x36')]);_0x7ddab3[_0x537d('0x37')]=_[_0x537d('0x39')](_0x7ddab3['model'],_0x7ddab3[_0x537d('0x36')]);_0x3b7777[_0x537d('0x38')]=_[_0x537d('0x39')](_0x7ddab3[_0x537d('0x34')],qs[_0x537d('0x3a')](_0x5c5abc[_0x537d('0x36')][_0x537d('0x3a')]));_0x3b7777['attributes']=_0x3b7777[_0x537d('0x38')][_0x537d('0x55')]?_0x3b7777['attributes']:_0x7ddab3[_0x537d('0x34')];_0x3b7777[_0x537d('0x56')]=qs[_0x537d('0x3d')](_0x5c5abc['query'][_0x537d('0x3d')]);_0x3b7777[_0x537d('0x3e')]=qs['filters'](_['pick'](_0x5c5abc[_0x537d('0x36')],_0x7ddab3[_0x537d('0x37')]));if(_0x5c5abc['query'][_0x537d('0x40')]){_0x3b7777[_0x537d('0x3e')]=_[_0x537d('0x41')](_0x3b7777[_0x537d('0x3e')],{'$or':_[_0x537d('0x30')](_0x3b7777['attributes'],function(_0x187530){var _0x37f144={};_0x37f144[_0x187530]={'$like':'%'+_0x5c5abc[_0x537d('0x36')]['filter']+'%'};return _0x37f144;})});}_0x3b7777=_['merge']({},_0x3b7777,_0x5c5abc['options']);return _0x5a2b07['getAllConditions'](_0x3b7777);}})[_0x537d('0x27')](function(_0xb6368d){if(_0xb6368d){_0x222b98=_0xb6368d[_0x537d('0x55')];if(!_0x5c5abc[_0x537d('0x36')][_0x537d('0x3b')]('nolimit')){_0x3b7777[_0x537d('0x22')]=qs['limit'](_0x5c5abc[_0x537d('0x36')][_0x537d('0x22')]);_0x3b7777[_0x537d('0x21')]=qs[_0x537d('0x21')](_0x5c5abc['query'][_0x537d('0x21')]);}return _0x5a2b07[_0x537d('0x54')](_0x3b7777);}})[_0x537d('0x27')](function(_0x81c6fa){if(_0x81c6fa){return _0x81c6fa?{'count':_0x222b98,'rows':_0x81c6fa}:null;}})['then'](respondWithResult(_0x29f788,null))['catch'](handleError(_0x29f788,null));};exports['getAnyConditions']=function(_0x4dbc5b,_0x315a90,_0x5f4b51){var _0x3d4c4d={};var _0x4c3735={};var _0x5073f6;var _0x4bf121;return db[_0x537d('0x31')][_0x537d('0x57')]({'where':{'id':_0x4dbc5b[_0x537d('0x48')]['id']}})[_0x537d('0x27')](handleEntityNotFound(_0x315a90,null))[_0x537d('0x27')](function(_0xf2edb4){if(_0xf2edb4){_0x5073f6=_0xf2edb4;_0x4c3735[_0x537d('0x34')]=_[_0x537d('0x35')](db['Condition']['rawAttributes']);_0x4c3735[_0x537d('0x36')]=_[_0x537d('0x35')](_0x4dbc5b['query']);_0x4c3735[_0x537d('0x37')]=_['intersection'](_0x4c3735[_0x537d('0x34')],_0x4c3735[_0x537d('0x36')]);_0x3d4c4d[_0x537d('0x38')]=_['intersection'](_0x4c3735[_0x537d('0x34')],qs['fields'](_0x4dbc5b[_0x537d('0x36')][_0x537d('0x3a')]));_0x3d4c4d[_0x537d('0x38')]=_0x3d4c4d[_0x537d('0x38')][_0x537d('0x55')]?_0x3d4c4d[_0x537d('0x38')]:_0x4c3735[_0x537d('0x34')];_0x3d4c4d[_0x537d('0x56')]=qs['sort'](_0x4dbc5b[_0x537d('0x36')][_0x537d('0x3d')]);_0x3d4c4d['where']=qs['filters'](_[_0x537d('0x3f')](_0x4dbc5b[_0x537d('0x36')],_0x4c3735[_0x537d('0x37')]));if(_0x4dbc5b[_0x537d('0x36')][_0x537d('0x40')]){_0x3d4c4d[_0x537d('0x3e')]=_[_0x537d('0x41')](_0x3d4c4d[_0x537d('0x3e')],{'$or':_[_0x537d('0x30')](_0x3d4c4d[_0x537d('0x38')],function(_0x127495){var _0x5a6fe0={};_0x5a6fe0[_0x127495]={'$like':'%'+_0x4dbc5b[_0x537d('0x36')][_0x537d('0x40')]+'%'};return _0x5a6fe0;})});}_0x3d4c4d=_[_0x537d('0x41')]({},_0x3d4c4d,_0x4dbc5b[_0x537d('0x43')]);return _0x5073f6[_0x537d('0x58')](_0x3d4c4d);}})['then'](function(_0x4af10e){if(_0x4af10e){_0x4bf121=_0x4af10e[_0x537d('0x55')];if(!_0x4dbc5b[_0x537d('0x36')][_0x537d('0x3b')]('nolimit')){_0x3d4c4d[_0x537d('0x22')]=qs[_0x537d('0x22')](_0x4dbc5b[_0x537d('0x36')][_0x537d('0x22')]);_0x3d4c4d[_0x537d('0x21')]=qs['offset'](_0x4dbc5b['query'][_0x537d('0x21')]);}return _0x5073f6[_0x537d('0x58')](_0x3d4c4d);}})[_0x537d('0x27')](function(_0x6d317d){if(_0x6d317d){return _0x6d317d?{'count':_0x4bf121,'rows':_0x6d317d}:null;}})[_0x537d('0x27')](respondWithResult(_0x315a90,null))[_0x537d('0x47')](handleError(_0x315a90,null));};exports[_0x537d('0x59')]=function(_0x18ea5b,_0x182996,_0x1f5c03){if(_0x18ea5b[_0x537d('0x4c')]['id']){delete _0x18ea5b['body']['id'];}return db[_0x537d('0x31')][_0x537d('0x4a')]({'where':{'id':_0x18ea5b[_0x537d('0x48')]['id']}})[_0x537d('0x27')](handleEntityNotFound(_0x182996,null))[_0x537d('0x27')](function(_0x3d7746){if(_0x3d7746){_0x18ea5b[_0x537d('0x4c')][_0x537d('0x5a')]=_0x3d7746['id'];return db[_0x537d('0x5b')][_0x537d('0x4b')](_0x18ea5b[_0x537d('0x4c')]);}})[_0x537d('0x27')](respondWithResult(_0x182996,null))[_0x537d('0x47')](handleError(_0x182996,null));};exports['getActions']=function(_0x275a08,_0x2d1fdc,_0x313d8a){var _0x27e76b={};var _0x2d6958={};var _0x3c87ed;var _0x40f75d;return db['Trigger']['findOne']({'where':{'id':_0x275a08['params']['id']}})[_0x537d('0x27')](handleEntityNotFound(_0x2d1fdc,null))[_0x537d('0x27')](function(_0x212ab4){if(_0x212ab4){_0x3c87ed=_0x212ab4;_0x2d6958['model']=_[_0x537d('0x35')](db[_0x537d('0x5b')]['rawAttributes']);_0x2d6958[_0x537d('0x36')]=_[_0x537d('0x35')](_0x275a08['query']);_0x2d6958['filters']=_[_0x537d('0x39')](_0x2d6958[_0x537d('0x34')],_0x2d6958[_0x537d('0x36')]);_0x27e76b['attributes']=_[_0x537d('0x39')](_0x2d6958[_0x537d('0x34')],qs[_0x537d('0x3a')](_0x275a08[_0x537d('0x36')]['fields']));_0x27e76b[_0x537d('0x38')]=_0x27e76b[_0x537d('0x38')]['length']?_0x27e76b['attributes']:_0x2d6958[_0x537d('0x34')];_0x27e76b['order']=qs[_0x537d('0x3d')](_0x275a08[_0x537d('0x36')][_0x537d('0x3d')]);_0x27e76b['where']=qs[_0x537d('0x37')](_[_0x537d('0x3f')](_0x275a08['query'],_0x2d6958[_0x537d('0x37')]));if(_0x275a08[_0x537d('0x36')][_0x537d('0x40')]){_0x27e76b['where']=_[_0x537d('0x41')](_0x27e76b['where'],{'$or':_[_0x537d('0x30')](_0x27e76b[_0x537d('0x38')],function(_0x2c2e83){var _0x5e7827={};_0x5e7827[_0x2c2e83]={'$like':'%'+_0x275a08[_0x537d('0x36')][_0x537d('0x40')]+'%'};return _0x5e7827;})});}_0x27e76b=_[_0x537d('0x41')]({},_0x27e76b,_0x275a08[_0x537d('0x43')]);return _0x3c87ed[_0x537d('0x5c')](_0x27e76b);}})[_0x537d('0x27')](function(_0x2eb3e6){if(_0x2eb3e6){_0x40f75d=_0x2eb3e6[_0x537d('0x55')];if(!_0x275a08[_0x537d('0x36')]['hasOwnProperty'](_0x537d('0x3c'))){_0x27e76b[_0x537d('0x22')]=qs[_0x537d('0x22')](_0x275a08['query']['limit']);_0x27e76b[_0x537d('0x21')]=qs[_0x537d('0x21')](_0x275a08[_0x537d('0x36')][_0x537d('0x21')]);}return _0x3c87ed['getActions'](_0x27e76b);}})[_0x537d('0x27')](function(_0x50204c){if(_0x50204c){return _0x50204c?{'count':_0x40f75d,'rows':_0x50204c}:null;}})[_0x537d('0x27')](respondWithResult(_0x2d1fdc,null))[_0x537d('0x47')](handleError(_0x2d1fdc,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 8196594..715eae3 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 _0x447b=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trigger.attributes','exports','Trigger'];(function(_0x8858ba,_0x325ac0){var _0x4b68af=function(_0xc276d0){while(--_0xc276d0){_0x8858ba['push'](_0x8858ba['shift']());}};_0x4b68af(++_0x325ac0);}(_0x447b,0xe4));var _0xb447=function(_0x56e672,_0x588aba){_0x56e672=_0x56e672-0x0;var _0x56f540=_0x447b[_0x56e672];return _0x56f540;};'use strict';var _=require(_0xb447('0x0'));var util=require(_0xb447('0x1'));var logger=require('../../config/logger')(_0xb447('0x2'));var moment=require(_0xb447('0x3'));var BPromise=require(_0xb447('0x4'));var rp=require(_0xb447('0x5'));var fs=require('fs');var path=require(_0xb447('0x6'));var rimraf=require(_0xb447('0x7'));var config=require(_0xb447('0x8'));var attributes=require(_0xb447('0x9'));module[_0xb447('0xa')]=function(_0x1f132a,_0x514a91){return _0x1f132a['define'](_0xb447('0xb'),attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa276=['Trigger','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x36eb51,_0x3aceff){var _0x4b677f=function(_0x354620){while(--_0x354620){_0x36eb51['push'](_0x36eb51['shift']());}};_0x4b677f(++_0x3aceff);}(_0xa276,0x9a));var _0x6a27=function(_0x105038,_0x4ead89){_0x105038=_0x105038-0x0;var _0x382c50=_0xa276[_0x105038];return _0x382c50;};'use strict';var _=require('lodash');var util=require(_0x6a27('0x0'));var logger=require(_0x6a27('0x1'))('api');var moment=require(_0x6a27('0x2'));var BPromise=require(_0x6a27('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6a27('0x4'));var rimraf=require(_0x6a27('0x5'));var config=require(_0x6a27('0x6'));var attributes=require('./trigger.attributes');module[_0x6a27('0x7')]=function(_0x321087,_0x41c595){return _0x321087['define'](_0x6a27('0x8'),attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index f583f72..f14e8ba 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 _0x9487=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTrigger','Trigger','options','raw','where','attributes','limit','map','model','include','ShowTrigger','find','util','moment','randomstring'];(function(_0x40e935,_0x1bc1c8){var _0x522618=function(_0x4bf6a2){while(--_0x4bf6a2){_0x40e935['push'](_0x40e935['shift']());}};_0x522618(++_0x1bc1c8);}(_0x9487,0xac));var _0x7948=function(_0x41d5b9,_0x2b41c9){_0x41d5b9=_0x41d5b9-0x0;var _0x2b8f47=_0x9487[_0x41d5b9];return _0x2b8f47;};'use strict';var _=require('lodash');var util=require(_0x7948('0x0'));var moment=require(_0x7948('0x1'));var BPromise=require('bluebird');var rs=require(_0x7948('0x2'));var fs=require('fs');var Redis=require(_0x7948('0x3'));var db=require(_0x7948('0x4'))['db'];var utils=require(_0x7948('0x5'));var logger=require(_0x7948('0x6'))(_0x7948('0x7'));var config=require(_0x7948('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7948('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1a6030,_0x503e04,_0x3985df){return new BPromise(function(_0x472fb5,_0x2bd719){return client[_0x7948('0xa')](_0x1a6030,_0x3985df)[_0x7948('0xb')](function(_0x5eb56f){logger[_0x7948('0xc')](_0x7948('0xd'),_0x503e04,_0x7948('0xe'));logger[_0x7948('0xf')](_0x7948('0x10'),_0x503e04,_0x7948('0xe'),JSON[_0x7948('0x11')](_0x5eb56f));if(_0x5eb56f[_0x7948('0x12')]){if(_0x5eb56f[_0x7948('0x12')][_0x7948('0x13')]===0x1f4){logger[_0x7948('0x12')]('Trigger,\x20%s,\x20%s',_0x503e04,_0x5eb56f[_0x7948('0x12')][_0x7948('0x14')]);return _0x2bd719(_0x5eb56f['error'][_0x7948('0x14')]);}logger[_0x7948('0x12')]('Trigger,\x20%s,\x20%s',_0x503e04,_0x5eb56f[_0x7948('0x12')]['message']);return _0x472fb5(_0x5eb56f['error'][_0x7948('0x14')]);}else{logger[_0x7948('0xc')](_0x7948('0xd'),_0x503e04,'request\x20sent');_0x472fb5(_0x5eb56f[_0x7948('0x15')]['message']);}})[_0x7948('0x16')](function(_0x45b0af){logger[_0x7948('0x12')](_0x7948('0xd'),_0x503e04,_0x45b0af);_0x2bd719(_0x45b0af);});});}exports[_0x7948('0x17')]=function(_0x7ef133){var _0x1f9baf=this;return new Promise(function(_0x6b7d25,_0x598d84){return db[_0x7948('0x18')]['findAll']({'raw':_0x7ef133['options']?_0x7ef133[_0x7948('0x19')][_0x7948('0x1a')]===undefined?!![]:![]:!![],'where':_0x7ef133[_0x7948('0x19')]?_0x7ef133[_0x7948('0x19')][_0x7948('0x1b')]||null:null,'attributes':_0x7ef133[_0x7948('0x19')]?_0x7ef133[_0x7948('0x19')][_0x7948('0x1c')]||null:null,'limit':_0x7ef133[_0x7948('0x19')]?_0x7ef133['options'][_0x7948('0x1d')]||null:null,'include':_0x7ef133[_0x7948('0x19')]?_0x7ef133[_0x7948('0x19')]['include']?_[_0x7948('0x1e')](_0x7ef133['options']['include'],function(_0x491aa0){return{'model':db[_0x491aa0[_0x7948('0x1f')]],'as':_0x491aa0['as'],'attributes':_0x491aa0['attributes'],'include':_0x491aa0[_0x7948('0x20')]?_[_0x7948('0x1e')](_0x491aa0[_0x7948('0x20')],function(_0x1fbc99){return{'model':db[_0x1fbc99['model']],'as':_0x1fbc99['as'],'attributes':_0x1fbc99[_0x7948('0x1c')],'include':_0x1fbc99[_0x7948('0x20')]?_[_0x7948('0x1e')](_0x1fbc99[_0x7948('0x20')],function(_0x5ec1fd){return{'model':db[_0x5ec1fd['model']],'as':_0x5ec1fd['as'],'attributes':_0x5ec1fd[_0x7948('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b979f){logger[_0x7948('0xc')](_0x7948('0x17'),_0x7ef133);logger['debug'](_0x7948('0x17'),_0x7ef133,JSON[_0x7948('0x11')](_0x4b979f));_0x6b7d25(_0x4b979f);})[_0x7948('0x16')](function(_0x964377){logger[_0x7948('0x12')](_0x7948('0x17'),_0x964377[_0x7948('0x14')],_0x7ef133);_0x598d84(_0x1f9baf['error'](0x1f4,_0x964377[_0x7948('0x14')]));});});};exports[_0x7948('0x21')]=function(_0x3f6edf){var _0x331c57=this;return new Promise(function(_0x589b48,_0x8ff50c){return db[_0x7948('0x18')][_0x7948('0x22')]({'raw':_0x3f6edf[_0x7948('0x19')]?_0x3f6edf[_0x7948('0x19')][_0x7948('0x1a')]===undefined?!![]:![]:!![],'where':_0x3f6edf[_0x7948('0x19')]?_0x3f6edf['options']['where']||null:null,'attributes':_0x3f6edf[_0x7948('0x19')]?_0x3f6edf[_0x7948('0x19')]['attributes']||null:null,'include':_0x3f6edf[_0x7948('0x19')]?_0x3f6edf[_0x7948('0x19')][_0x7948('0x20')]?_[_0x7948('0x1e')](_0x3f6edf['options'][_0x7948('0x20')],function(_0x1364b5){return{'model':db[_0x1364b5[_0x7948('0x1f')]],'as':_0x1364b5['as'],'attributes':_0x1364b5[_0x7948('0x1c')],'include':_0x1364b5[_0x7948('0x20')]?_[_0x7948('0x1e')](_0x1364b5[_0x7948('0x20')],function(_0x1852a1){return{'model':db[_0x1852a1[_0x7948('0x1f')]],'as':_0x1852a1['as'],'attributes':_0x1852a1['attributes'],'include':_0x1852a1[_0x7948('0x20')]?_[_0x7948('0x1e')](_0x1852a1[_0x7948('0x20')],function(_0x448c92){return{'model':db[_0x448c92[_0x7948('0x1f')]],'as':_0x448c92['as'],'attributes':_0x448c92['attributes']};}):[]};}):[]};}):[]:[]})[_0x7948('0xb')](function(_0x5a9372){logger[_0x7948('0xc')](_0x7948('0x21'),_0x3f6edf);logger[_0x7948('0xf')](_0x7948('0x21'),_0x3f6edf,JSON['stringify'](_0x5a9372));_0x589b48(_0x5a9372);})[_0x7948('0x16')](function(_0x3069d3){logger[_0x7948('0x12')](_0x7948('0x21'),_0x3069d3['message'],_0x3f6edf);_0x8ff50c(_0x331c57[_0x7948('0x12')](0x1f4,_0x3069d3[_0x7948('0x14')]));});});}; \ No newline at end of file +var _0x9ba8=['client','http','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetTrigger','Trigger','options','attributes','include','map','model','ShowTrigger','find','raw','where','stringify','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x402e33,_0x527907){var _0x4f83dc=function(_0x27b86b){while(--_0x27b86b){_0x402e33['push'](_0x402e33['shift']());}};_0x4f83dc(++_0x527907);}(_0x9ba8,0x78));var _0x89ba=function(_0x38c0b2,_0x6a67a5){_0x38c0b2=_0x38c0b2-0x0;var _0x283c00=_0x9ba8[_0x38c0b2];return _0x283c00;};'use strict';var _=require(_0x89ba('0x0'));var util=require(_0x89ba('0x1'));var moment=require('moment');var BPromise=require(_0x89ba('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x89ba('0x3'));var db=require(_0x89ba('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x89ba('0x5'))(_0x89ba('0x6'));var config=require('../../config/environment');var jayson=require(_0x89ba('0x7'));var client=jayson[_0x89ba('0x8')][_0x89ba('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2466b8,_0x467222,_0x242a07){return new BPromise(function(_0x5f0b4c,_0x23464d){return client['request'](_0x2466b8,_0x242a07)[_0x89ba('0xa')](function(_0x1872b5){logger[_0x89ba('0xb')](_0x89ba('0xc'),_0x467222,_0x89ba('0xd'));logger[_0x89ba('0xe')]('Trigger,\x20%s,\x20%s,\x20%s',_0x467222,_0x89ba('0xd'),JSON['stringify'](_0x1872b5));if(_0x1872b5[_0x89ba('0xf')]){if(_0x1872b5[_0x89ba('0xf')][_0x89ba('0x10')]===0x1f4){logger[_0x89ba('0xf')]('Trigger,\x20%s,\x20%s',_0x467222,_0x1872b5[_0x89ba('0xf')][_0x89ba('0x11')]);return _0x23464d(_0x1872b5[_0x89ba('0xf')][_0x89ba('0x11')]);}logger[_0x89ba('0xf')](_0x89ba('0xc'),_0x467222,_0x1872b5[_0x89ba('0xf')][_0x89ba('0x11')]);return _0x5f0b4c(_0x1872b5[_0x89ba('0xf')][_0x89ba('0x11')]);}else{logger[_0x89ba('0xb')](_0x89ba('0xc'),_0x467222,_0x89ba('0xd'));_0x5f0b4c(_0x1872b5[_0x89ba('0x12')][_0x89ba('0x11')]);}})[_0x89ba('0x13')](function(_0x4af2ec){logger[_0x89ba('0xf')](_0x89ba('0xc'),_0x467222,_0x4af2ec);_0x23464d(_0x4af2ec);});});}exports[_0x89ba('0x14')]=function(_0x12984c){var _0x45a225=this;return new Promise(function(_0x3c510c,_0x1db985){return db[_0x89ba('0x15')]['findAll']({'raw':_0x12984c[_0x89ba('0x16')]?_0x12984c[_0x89ba('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x12984c[_0x89ba('0x16')]?_0x12984c[_0x89ba('0x16')]['where']||null:null,'attributes':_0x12984c[_0x89ba('0x16')]?_0x12984c[_0x89ba('0x16')][_0x89ba('0x17')]||null:null,'limit':_0x12984c['options']?_0x12984c['options']['limit']||null:null,'include':_0x12984c[_0x89ba('0x16')]?_0x12984c[_0x89ba('0x16')][_0x89ba('0x18')]?_[_0x89ba('0x19')](_0x12984c[_0x89ba('0x16')]['include'],function(_0x365944){return{'model':db[_0x365944[_0x89ba('0x1a')]],'as':_0x365944['as'],'attributes':_0x365944[_0x89ba('0x17')],'include':_0x365944['include']?_[_0x89ba('0x19')](_0x365944['include'],function(_0x469ece){return{'model':db[_0x469ece[_0x89ba('0x1a')]],'as':_0x469ece['as'],'attributes':_0x469ece[_0x89ba('0x17')],'include':_0x469ece[_0x89ba('0x18')]?_[_0x89ba('0x19')](_0x469ece[_0x89ba('0x18')],function(_0x188cdf){return{'model':db[_0x188cdf['model']],'as':_0x188cdf['as'],'attributes':_0x188cdf['attributes']};}):[]};}):[]};}):[]:[]})[_0x89ba('0xa')](function(_0x486c33){logger[_0x89ba('0xb')](_0x89ba('0x14'),_0x12984c);logger['debug'](_0x89ba('0x14'),_0x12984c,JSON['stringify'](_0x486c33));_0x3c510c(_0x486c33);})[_0x89ba('0x13')](function(_0x277184){logger[_0x89ba('0xf')](_0x89ba('0x14'),_0x277184['message'],_0x12984c);_0x1db985(_0x45a225[_0x89ba('0xf')](0x1f4,_0x277184[_0x89ba('0x11')]));});});};exports[_0x89ba('0x1b')]=function(_0x18b141){var _0x350740=this;return new Promise(function(_0x3fe50c,_0x333015){return db[_0x89ba('0x15')][_0x89ba('0x1c')]({'raw':_0x18b141[_0x89ba('0x16')]?_0x18b141['options'][_0x89ba('0x1d')]===undefined?!![]:![]:!![],'where':_0x18b141[_0x89ba('0x16')]?_0x18b141[_0x89ba('0x16')][_0x89ba('0x1e')]||null:null,'attributes':_0x18b141[_0x89ba('0x16')]?_0x18b141[_0x89ba('0x16')][_0x89ba('0x17')]||null:null,'include':_0x18b141[_0x89ba('0x16')]?_0x18b141['options'][_0x89ba('0x18')]?_[_0x89ba('0x19')](_0x18b141[_0x89ba('0x16')]['include'],function(_0x367a24){return{'model':db[_0x367a24[_0x89ba('0x1a')]],'as':_0x367a24['as'],'attributes':_0x367a24[_0x89ba('0x17')],'include':_0x367a24[_0x89ba('0x18')]?_[_0x89ba('0x19')](_0x367a24[_0x89ba('0x18')],function(_0x2fb014){return{'model':db[_0x2fb014['model']],'as':_0x2fb014['as'],'attributes':_0x2fb014['attributes'],'include':_0x2fb014[_0x89ba('0x18')]?_['map'](_0x2fb014[_0x89ba('0x18')],function(_0x4339eb){return{'model':db[_0x4339eb[_0x89ba('0x1a')]],'as':_0x4339eb['as'],'attributes':_0x4339eb[_0x89ba('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xf74609){logger[_0x89ba('0xb')](_0x89ba('0x1b'),_0x18b141);logger[_0x89ba('0xe')](_0x89ba('0x1b'),_0x18b141,JSON[_0x89ba('0x1f')](_0xf74609));_0x3fe50c(_0xf74609);})['catch'](function(_0x28cba7){logger['error'](_0x89ba('0x1b'),_0x28cba7[_0x89ba('0x11')],_0x18b141);_0x333015(_0x350740[_0x89ba('0xf')](0x1f4,_0x28cba7[_0x89ba('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 10c44e3..d1bb276 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 _0xd66e=['/:id','/:id/clone','clone','post','create','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','index'];(function(_0x431feb,_0x394297){var _0x5b2a85=function(_0x4e869e){while(--_0x4e869e){_0x431feb['push'](_0x431feb['shift']());}};_0x5b2a85(++_0x394297);}(_0xd66e,0x1ed));var _0xed66=function(_0x38a045,_0x402d6b){_0x38a045=_0x38a045-0x0;var _0x45c34c=_0xd66e[_0x38a045];return _0x45c34c;};'use strict';var multer=require(_0xed66('0x0'));var util=require('util');var path=require(_0xed66('0x1'));var timeout=require('connect-timeout');var express=require(_0xed66('0x2'));var router=express[_0xed66('0x3')]();var fs_extra=require(_0xed66('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xed66('0x5'));var config=require(_0xed66('0x6'));var controller=require(_0xed66('0x7'));router[_0xed66('0x8')]('/',auth[_0xed66('0x9')](),controller[_0xed66('0xa')]);router['get'](_0xed66('0xb'),auth[_0xed66('0x9')](),controller['show']);router['post'](_0xed66('0xc'),auth[_0xed66('0x9')](),controller[_0xed66('0xd')]);router[_0xed66('0xe')]('/',auth['isAuthenticated'](),controller[_0xed66('0xf')]);router[_0xed66('0x10')](_0xed66('0xb'),auth['isAuthenticated'](),controller[_0xed66('0x11')]);router[_0xed66('0x12')](_0xed66('0xb'),auth[_0xed66('0x9')](),controller[_0xed66('0x13')]);module[_0xed66('0x14')]=router; \ No newline at end of file +var _0x9084=['show','post','/:id/clone','clone','update','/:id','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','index','isAuthenticated'];(function(_0x43de22,_0x1eced6){var _0x4b15ee=function(_0x6e36da){while(--_0x6e36da){_0x43de22['push'](_0x43de22['shift']());}};_0x4b15ee(++_0x1eced6);}(_0x9084,0x1aa));var _0x4908=function(_0x238d68,_0x125056){_0x238d68=_0x238d68-0x0;var _0x131417=_0x9084[_0x238d68];return _0x131417;};'use strict';var multer=require(_0x4908('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4908('0x1'));var router=express[_0x4908('0x2')]();var fs_extra=require(_0x4908('0x3'));var auth=require(_0x4908('0x4'));var interaction=require(_0x4908('0x5'));var config=require(_0x4908('0x6'));var controller=require(_0x4908('0x7'));router[_0x4908('0x8')]('/',auth['isAuthenticated'](),controller[_0x4908('0x9')]);router[_0x4908('0x8')]('/:id',auth[_0x4908('0xa')](),controller[_0x4908('0xb')]);router[_0x4908('0xc')](_0x4908('0xd'),auth[_0x4908('0xa')](),controller[_0x4908('0xe')]);router[_0x4908('0xc')]('/',auth[_0x4908('0xa')](),controller['create']);router['put']('/:id',auth[_0x4908('0xa')](),controller[_0x4908('0xf')]);router['delete'](_0x4908('0x10'),auth[_0x4908('0xa')](),controller[_0x4908('0x11')]);module[_0x4908('0x12')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 089f107..8c44421 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 _0x75bd=['nonat','update,nonat','BOOLEAN','exports','STRING','name','ENUM','friend','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','getDataValue','split','info','shortinfo','inband','auto','rfc2833','update','outgoing','setDataValue','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','yes','port,invite','insecure','never','\x22\x22\x20<>','INTEGER','always','accept','refuse','originate','uas','pai','fingerprint','certificate','passive','actpass','dynamic'];(function(_0x265389,_0x4eb531){var _0x28fa82=function(_0x5f27b3){while(--_0x5f27b3){_0x265389['push'](_0x265389['shift']());}};_0x28fa82(++_0x4eb531);}(_0x75bd,0xf3));var _0xd75b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x75bd[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0xd75b('0x0')]={'name':{'type':Sequelize[_0xd75b('0x1')],'allowNull':![],'unique':_0xd75b('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xd75b('0x3')](_0xd75b('0x4'),'user','peer'),'allowNull':![],'defaultValue':_0xd75b('0x4')},'context':{'type':Sequelize[_0xd75b('0x1')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0xd75b('0x3')]('ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN',_0xd75b('0x5'),_0xd75b('0x6'),_0xd75b('0x7'),_0xd75b('0x8'),_0xd75b('0x9'),_0xd75b('0xa'))},'deny':{'type':Sequelize[_0xd75b('0x1')]},'permit':{'type':Sequelize[_0xd75b('0x1')]},'secret':{'type':Sequelize[_0xd75b('0x1')]},'md5secret':{'type':Sequelize[_0xd75b('0x1')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0xd75b('0x1')],'defaultValue':_0xd75b('0xb'),'set':function(_0x6d2fb5){this['setDataValue'](_0xd75b('0xc'),_0x6d2fb5?_0x6d2fb5[_0xd75b('0xd')](','):null);},'get':function(){return this[_0xd75b('0xe')](_0xd75b('0xc'))?this[_0xd75b('0xe')](_0xd75b('0xc'))[_0xd75b('0xf')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM']('rfc2833',_0xd75b('0x10'),_0xd75b('0x11'),_0xd75b('0x12'),_0xd75b('0x13')),'defaultValue':_0xd75b('0x14')},'directmedia':{'type':Sequelize['ENUM']('yes','no','nonat',_0xd75b('0x15'),_0xd75b('0x16')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xd75b('0x3')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xd75b('0x1')]},'directmediadeny':{'type':Sequelize[_0xd75b('0x1')]},'nat':{'type':Sequelize['STRING'],'defaultValue':'force_rport,comedia','set':function(_0x25195b){this[_0xd75b('0x17')]('nat',_0x25195b?_0x25195b[_0xd75b('0xd')](','):null);},'get':function(){return this['getDataValue'](_0xd75b('0x18'))?this[_0xd75b('0xe')](_0xd75b('0x18'))['split'](','):null;},'comment':_0xd75b('0x19')},'callgroup':{'type':Sequelize[_0xd75b('0x1')]},'namedcallgroup':{'type':Sequelize[_0xd75b('0x1')]},'pickupgroup':{'type':Sequelize[_0xd75b('0x1')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xd75b('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xd75b('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xd75b('0x1')],'defaultValue':'all'},'allow':{'type':Sequelize[_0xd75b('0x1')],'allowNull':![],'defaultValue':_0xd75b('0x1a'),'set':function(_0x150434){this[_0xd75b('0x17')](_0xd75b('0x1b'),_0x150434?_0x150434['join'](';'):_0xd75b('0x1a'));},'get':function(){return this[_0xd75b('0xe')](_0xd75b('0x1b'))?this[_0xd75b('0xe')](_0xd75b('0x1b'))[_0xd75b('0xf')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0xd75b('0x3')](_0xd75b('0x1c'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0xd75b('0x1d'),'set':function(_0x521ee6){this['setDataValue'](_0xd75b('0x1e'),_0x521ee6?_0x521ee6[_0xd75b('0xd')](','):null);},'get':function(){return this[_0xd75b('0xe')](_0xd75b('0x1e'))?this[_0xd75b('0xe')](_0xd75b('0x1e'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0xd75b('0x3')](_0xd75b('0x1c'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0xd75b('0x1c'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xd75b('0x3')](_0xd75b('0x1c'),'no',_0xd75b('0x1f'))},'promiscredir':{'type':Sequelize[_0xd75b('0x3')](_0xd75b('0x1c'),'no')},'useclientcode':{'type':Sequelize[_0xd75b('0x3')]('yes','no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0xd75b('0x1')]},'callerid':{'type':Sequelize[_0xd75b('0x1')],'defaultValue':_0xd75b('0x20')},'amaflags':{'type':Sequelize[_0xd75b('0x1')]},'callcounter':{'type':Sequelize[_0xd75b('0x3')](_0xd75b('0x1c'),'no'),'defaultValue':_0xd75b('0x1c')},'busylevel':{'type':Sequelize[_0xd75b('0x21')](0xb)},'allowoverlap':{'type':Sequelize[_0xd75b('0x3')](_0xd75b('0x1c'),'no')},'allowsubscribe':{'type':Sequelize[_0xd75b('0x3')](_0xd75b('0x1c'),'no')},'allowtransfer':{'type':Sequelize[_0xd75b('0x3')](_0xd75b('0x1c'),'no')},'ignoresdpversion':{'type':Sequelize[_0xd75b('0x3')]('yes','no')},'subscribecontext':{'type':Sequelize[_0xd75b('0x1')]},'template':{'type':Sequelize[_0xd75b('0x1')]},'videosupport':{'type':Sequelize[_0xd75b('0x3')](_0xd75b('0x1c'),'no',_0xd75b('0x22')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xd75b('0x21')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xd75b('0x3')]('yes','no')},'mailbox':{'type':Sequelize[_0xd75b('0x1')]},'session_timers':{'type':Sequelize['ENUM'](_0xd75b('0x23'),_0xd75b('0x24'),_0xd75b('0x25'))},'session_expires':{'type':Sequelize[_0xd75b('0x21')](0xb)},'session_minse':{'type':Sequelize[_0xd75b('0x21')](0xb)},'session_refresher':{'type':Sequelize[_0xd75b('0x3')]('uac',_0xd75b('0x26')),'defaultValue':_0xd75b('0x26')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0xd75b('0x1')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xd75b('0x21')](0x5)},'qualify':{'type':Sequelize['ENUM'](_0xd75b('0x1c'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0xd75b('0x21')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0xd75b('0x1')]},'rtptimeout':{'type':Sequelize[_0xd75b('0x21')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xd75b('0x21')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xd75b('0x21')](0xb)},'sendrpid':{'type':Sequelize[_0xd75b('0x3')](_0xd75b('0x1c'),'no',_0xd75b('0x27')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xd75b('0x1')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0xd75b('0x21')](0xb)},'qualifyfreq':{'type':Sequelize[_0xd75b('0x21')](0xb)},'contactpermit':{'type':Sequelize[_0xd75b('0x1')]},'contactdeny':{'type':Sequelize[_0xd75b('0x1')]},'contactacl':{'type':Sequelize[_0xd75b('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0xd75b('0x1')]},'use_q850_reason':{'type':Sequelize[_0xd75b('0x1')]},'maxforwards':{'type':Sequelize[_0xd75b('0x21')](0xb)},'encryption':{'type':Sequelize['ENUM'](_0xd75b('0x1c'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xd75b('0x3')](_0xd75b('0x1c'),'no')},'force_avp':{'type':Sequelize['ENUM'](_0xd75b('0x1c'),'no')},'icesupport':{'type':Sequelize['ENUM'](_0xd75b('0x1c'),'no')},'dtlsenable':{'type':Sequelize[_0xd75b('0x3')]('yes','no')},'dtlsverify':{'type':Sequelize[_0xd75b('0x3')](_0xd75b('0x1c'),'no',_0xd75b('0x28'),_0xd75b('0x29'))},'dtlsrekey':{'type':Sequelize[_0xd75b('0x21')](0xb)},'dtlscertfile':{'type':Sequelize[_0xd75b('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0xd75b('0x1')]},'dtlscipher':{'type':Sequelize[_0xd75b('0x1')]},'dtlscafile':{'type':Sequelize[_0xd75b('0x1')]},'dtlscapath':{'type':Sequelize[_0xd75b('0x1')]},'dtlssetup':{'type':Sequelize['ENUM']('active',_0xd75b('0x2a'),_0xd75b('0x2b')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xd75b('0x1')]},'usereqphone':{'type':Sequelize[_0xd75b('0x3')](_0xd75b('0x1c'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xd75b('0x1')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xd75b('0x3')]('yes','no')},'subscribemwi':{'type':Sequelize['ENUM'](_0xd75b('0x1c'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0xd75b('0x1')]},'mohsuggest':{'type':Sequelize[_0xd75b('0x1')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd75b('0x1')]},'host':{'type':Sequelize[_0xd75b('0x1')],'defaultValue':_0xd75b('0x2c')},'canreinvite':{'type':Sequelize[_0xd75b('0x3')](_0xd75b('0x1c'),'no',_0xd75b('0x2d'),'update',_0xd75b('0x2e')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xd75b('0x1')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xd75b('0x2f')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file +var _0xbca9=['sequelize','exports','name','ENUM','friend','peer','ALLOWED_NOT_SCREENED','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','STRING','udp','setDataValue','transport','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','nonat','update','outgoing','yes','force_rport,comedia','join','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','always','accept','refuse','originate','uas','pai','fingerprint','dynamic','BOOLEAN'];(function(_0x4ab760,_0x426fad){var _0x1df3ff=function(_0x3b6e2f){while(--_0x3b6e2f){_0x4ab760['push'](_0x4ab760['shift']());}};_0x1df3ff(++_0x426fad);}(_0xbca9,0x84));var _0x9bca=function(_0x347471,_0x1c9a02){_0x347471=_0x347471-0x0;var _0x422b6a=_0xbca9[_0x347471];return _0x422b6a;};'use strict';var Sequelize=require(_0x9bca('0x0'));module[_0x9bca('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x9bca('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x9bca('0x3')](_0x9bca('0x4'),'user',_0x9bca('0x5')),'allowNull':![],'defaultValue':_0x9bca('0x4')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0x9bca('0x3')](_0x9bca('0x6'),'ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN',_0x9bca('0x7'),_0x9bca('0x8'),_0x9bca('0x9'),_0x9bca('0xa'),_0x9bca('0xb'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0x9bca('0xc')]},'md5secret':{'type':Sequelize[_0x9bca('0xc')]},'remotesecret':{'type':Sequelize[_0x9bca('0xc')]},'transport':{'type':Sequelize[_0x9bca('0xc')],'defaultValue':_0x9bca('0xd'),'set':function(_0x40f1d1){this[_0x9bca('0xe')](_0x9bca('0xf'),_0x40f1d1?_0x40f1d1['join'](','):null);},'get':function(){return this[_0x9bca('0x10')](_0x9bca('0xf'))?this['getDataValue']('transport')['split'](','):null;},'comment':_0x9bca('0x11')},'dtmfmode':{'type':Sequelize[_0x9bca('0x3')](_0x9bca('0x12'),'info','shortinfo','inband','auto'),'defaultValue':_0x9bca('0x12')},'directmedia':{'type':Sequelize['ENUM']('yes','no',_0x9bca('0x13'),_0x9bca('0x14'),_0x9bca('0x15')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x9bca('0x16'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x9bca('0xc')]},'directmediadeny':{'type':Sequelize[_0x9bca('0xc')]},'nat':{'type':Sequelize['STRING'],'defaultValue':_0x9bca('0x17'),'set':function(_0x209cca){this[_0x9bca('0xe')]('nat',_0x209cca?_0x209cca[_0x9bca('0x18')](','):null);},'get':function(){return this[_0x9bca('0x10')](_0x9bca('0x19'))?this[_0x9bca('0x10')](_0x9bca('0x19'))['split'](','):null;},'comment':_0x9bca('0x1a')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x9bca('0xc')]},'pickupgroup':{'type':Sequelize[_0x9bca('0xc')]},'namedpickupgroup':{'type':Sequelize[_0x9bca('0xc')]},'language':{'type':Sequelize[_0x9bca('0xc')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0x9bca('0xc')],'defaultValue':_0x9bca('0x1b')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x428441){this[_0x9bca('0xe')](_0x9bca('0x1c'),_0x428441?_0x428441[_0x9bca('0x18')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x9bca('0x10')](_0x9bca('0x1c'))?this[_0x9bca('0x10')](_0x9bca('0x1c'))[_0x9bca('0x1d')](';'):null;},'comment':_0x9bca('0x1e')},'autoframing':{'type':Sequelize[_0x9bca('0x3')]('yes','no')},'insecure':{'type':Sequelize[_0x9bca('0xc')],'defaultValue':_0x9bca('0x1f'),'set':function(_0x1ae2c0){this[_0x9bca('0xe')]('insecure',_0x1ae2c0?_0x1ae2c0['join'](','):null);},'get':function(){return this[_0x9bca('0x10')](_0x9bca('0x20'))?this['getDataValue']('insecure')[_0x9bca('0x1d')](','):null;},'comment':_0x9bca('0x21')},'trustrpid':{'type':Sequelize[_0x9bca('0x3')](_0x9bca('0x16'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x9bca('0x16'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x9bca('0x3')]('yes','no','never')},'promiscredir':{'type':Sequelize[_0x9bca('0x3')](_0x9bca('0x16'),'no')},'useclientcode':{'type':Sequelize[_0x9bca('0x3')](_0x9bca('0x16'),'no')},'accountcode':{'type':Sequelize[_0x9bca('0x22')](0xb)},'setvar':{'type':Sequelize[_0x9bca('0xc')]},'callerid':{'type':Sequelize[_0x9bca('0xc')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x9bca('0xc')]},'callcounter':{'type':Sequelize[_0x9bca('0x3')](_0x9bca('0x16'),'no'),'defaultValue':_0x9bca('0x16')},'busylevel':{'type':Sequelize[_0x9bca('0x22')](0xb)},'allowoverlap':{'type':Sequelize[_0x9bca('0x3')](_0x9bca('0x16'),'no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0x9bca('0x16'),'no')},'allowtransfer':{'type':Sequelize[_0x9bca('0x3')](_0x9bca('0x16'),'no')},'ignoresdpversion':{'type':Sequelize[_0x9bca('0x3')]('yes','no')},'subscribecontext':{'type':Sequelize[_0x9bca('0xc')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize['ENUM'](_0x9bca('0x16'),'no',_0x9bca('0x23')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x9bca('0x22')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x9bca('0x3')](_0x9bca('0x16'),'no')},'mailbox':{'type':Sequelize[_0x9bca('0xc')]},'session_timers':{'type':Sequelize[_0x9bca('0x3')](_0x9bca('0x24'),_0x9bca('0x25'),_0x9bca('0x26'))},'session_expires':{'type':Sequelize[_0x9bca('0x22')](0xb)},'session_minse':{'type':Sequelize[_0x9bca('0x22')](0xb)},'session_refresher':{'type':Sequelize['ENUM']('uac',_0x9bca('0x27')),'defaultValue':_0x9bca('0x27')},'t38pt_usertpsource':{'type':Sequelize[_0x9bca('0xc')]},'regexten':{'type':Sequelize[_0x9bca('0xc')]},'fromdomain':{'type':Sequelize[_0x9bca('0xc')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize['ENUM'](_0x9bca('0x16'),'no'),'defaultValue':_0x9bca('0x16')},'keepalive':{'type':Sequelize[_0x9bca('0x22')](0xb)},'defaultip':{'type':Sequelize[_0x9bca('0xc')]},'defaultuser':{'type':Sequelize[_0x9bca('0xc')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x9bca('0x22')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x9bca('0x22')](0xb)},'sendrpid':{'type':Sequelize[_0x9bca('0x3')](_0x9bca('0x16'),'no',_0x9bca('0x28')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x9bca('0xc')]},'callbackextension':{'type':Sequelize[_0x9bca('0xc')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0x9bca('0x22')](0xb)},'qualifyfreq':{'type':Sequelize[_0x9bca('0x22')](0xb)},'contactpermit':{'type':Sequelize[_0x9bca('0xc')]},'contactdeny':{'type':Sequelize[_0x9bca('0xc')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0x9bca('0xc')]},'use_q850_reason':{'type':Sequelize[_0x9bca('0xc')]},'maxforwards':{'type':Sequelize[_0x9bca('0x22')](0xb)},'encryption':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x9bca('0x3')](_0x9bca('0x16'),'no')},'force_avp':{'type':Sequelize['ENUM']('yes','no')},'icesupport':{'type':Sequelize[_0x9bca('0x3')](_0x9bca('0x16'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x9bca('0x16'),'no')},'dtlsverify':{'type':Sequelize[_0x9bca('0x3')](_0x9bca('0x16'),'no',_0x9bca('0x29'),'certificate')},'dtlsrekey':{'type':Sequelize[_0x9bca('0x22')](0xb)},'dtlscertfile':{'type':Sequelize[_0x9bca('0xc')]},'dtlsprivatekey':{'type':Sequelize[_0x9bca('0xc')]},'dtlscipher':{'type':Sequelize[_0x9bca('0xc')]},'dtlscafile':{'type':Sequelize[_0x9bca('0xc')]},'dtlscapath':{'type':Sequelize[_0x9bca('0xc')]},'dtlssetup':{'type':Sequelize['ENUM']('active','passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x9bca('0xc')]},'usereqphone':{'type':Sequelize[_0x9bca('0x3')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x9bca('0xc')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x9bca('0x22')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x9bca('0x3')]('yes','no')},'subscribemwi':{'type':Sequelize[_0x9bca('0x3')](_0x9bca('0x16'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0x9bca('0xc')]},'mohsuggest':{'type':Sequelize[_0x9bca('0xc')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9bca('0xc')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0x9bca('0x2a')},'canreinvite':{'type':Sequelize[_0x9bca('0x3')](_0x9bca('0x16'),'no',_0x9bca('0x13'),_0x9bca('0x14'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0x9bca('0xc')]},'otherFields':{'type':Sequelize[_0x9bca('0xc')]},'active':{'type':Sequelize[_0x9bca('0x2b')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x9bca('0xc')],'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 f09702c..6d5698c 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 _0x6aa7=['sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','params','length','includeAll','clone','find','get','createdAt','body','omit','updatedAt','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/trunk.ejs','render','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','autoAssociation','update','utf8','server/files/templates/registry.ejs','writeFileSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','http','then','Trunk,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','Trunks','UserProfileResource','stack','name','index','map','Trunk','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','order'];(function(_0x962ac4,_0x664462){var _0x817882=function(_0x1841de){while(--_0x1841de){_0x962ac4['push'](_0x962ac4['shift']());}};_0x817882(++_0x664462);}(_0x6aa7,0x178));var _0x76aa=function(_0x58bb15,_0x1408b8){_0x58bb15=_0x58bb15-0x0;var _0x5561ec=_0x6aa7[_0x58bb15];return _0x5561ec;};'use strict';var emlformat=require(_0x76aa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x76aa('0x1'));var jsonpatch=require(_0x76aa('0x2'));var rp=require(_0x76aa('0x3'));var moment=require(_0x76aa('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x76aa('0x5'));var util=require(_0x76aa('0x6'));var path=require(_0x76aa('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x76aa('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x76aa('0x9'));var squel=require(_0x76aa('0xa'));var crypto=require(_0x76aa('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x76aa('0xc'));var toCsv=require(_0x76aa('0xd'));var querystring=require(_0x76aa('0xe'));var Papa=require('papaparse');var Redis=require(_0x76aa('0xf'));var authService=require(_0x76aa('0x10'));var qs=require(_0x76aa('0x11'));var as=require(_0x76aa('0x12'));var hardwareService=require(_0x76aa('0x13'));var logger=require(_0x76aa('0x14'))(_0x76aa('0x15'));var utils=require(_0x76aa('0x16'));var config=require(_0x76aa('0x17'));var licenseUtil=require(_0x76aa('0x18'));var db=require('../../mysqldb')['db'];var jayson=require(_0x76aa('0x19'));var client=jayson['client'][_0x76aa('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x12dde0,_0x3f8f6b,_0x8e44ed,_0x10432c){return new BPromise(function(_0x4e309f,_0x5f5b59){var _0x2b3b4f=_0x10432c||client;return _0x2b3b4f['request'](_0x12dde0,_0x8e44ed)[_0x76aa('0x1b')](function(_0x319bf1){logger['info'](_0x76aa('0x1c'),_0x3f8f6b,'request\x20sent');logger[_0x76aa('0x1d')]('Trunk,\x20%s,\x20%s,\x20%s',_0x3f8f6b,_0x76aa('0x1e'),JSON[_0x76aa('0x1f')](_0x319bf1));if(_0x319bf1[_0x76aa('0x20')]){if(_0x319bf1[_0x76aa('0x20')][_0x76aa('0x21')]===0x1f4){logger[_0x76aa('0x20')]('Trunk,\x20%s,\x20%s',_0x3f8f6b,_0x319bf1['error'][_0x76aa('0x22')]);return _0x5f5b59(_0x319bf1[_0x76aa('0x20')][_0x76aa('0x22')]);}logger[_0x76aa('0x20')](_0x76aa('0x1c'),_0x3f8f6b,_0x319bf1[_0x76aa('0x20')][_0x76aa('0x22')]);return _0x4e309f(_0x319bf1[_0x76aa('0x20')][_0x76aa('0x22')]);}else{logger['info'](_0x76aa('0x1c'),_0x3f8f6b,_0x76aa('0x1e'));_0x4e309f(_0x319bf1[_0x76aa('0x23')]['message']);}})[_0x76aa('0x24')](function(_0x189cb6){logger[_0x76aa('0x20')](_0x76aa('0x1c'),_0x3f8f6b,_0x189cb6);_0x5f5b59(_0x189cb6);});});}function respondWithStatusCode(_0x29c50c,_0xc1044c){_0xc1044c=_0xc1044c||0xcc;return function(_0x3cd039){if(_0x3cd039){return _0x29c50c[_0x76aa('0x25')](_0xc1044c);}return _0x29c50c[_0x76aa('0x26')](_0xc1044c)[_0x76aa('0x27')]();};}function respondWithResult(_0x37f1ab,_0x26b75e){_0x26b75e=_0x26b75e||0xc8;return function(_0x3599a9){if(_0x3599a9){return _0x37f1ab['status'](_0x26b75e)[_0x76aa('0x28')](_0x3599a9);}};}function respondWithFilteredResult(_0x1d6d15,_0x25c614){return function(_0x2e7ab4){if(_0x2e7ab4){var _0xa1e6=typeof _0x25c614[_0x76aa('0x29')]===_0x76aa('0x2a')&&typeof _0x25c614[_0x76aa('0x2b')]===_0x76aa('0x2a');var _0x1bdc3d=_0x2e7ab4['count'];var _0x3fcb7f=_0xa1e6?0x0:_0x25c614['offset'];var _0x994550=_0xa1e6?_0x2e7ab4[_0x76aa('0x2c')]:_0x25c614[_0x76aa('0x29')]+_0x25c614[_0x76aa('0x2b')];var _0x1eecd9;if(_0x994550>=_0x1bdc3d){_0x994550=_0x1bdc3d;_0x1eecd9=0xc8;}else{_0x1eecd9=0xce;}_0x1d6d15[_0x76aa('0x26')](_0x1eecd9);return _0x1d6d15[_0x76aa('0x2d')](_0x76aa('0x2e'),_0x3fcb7f+'-'+_0x994550+'/'+_0x1bdc3d)[_0x76aa('0x28')](_0x2e7ab4);}return null;};}function patchUpdates(_0x3ea05a){return function(_0x5edcd8){try{jsonpatch[_0x76aa('0x2f')](_0x5edcd8,_0x3ea05a,!![]);}catch(_0x5532c7){return BPromise[_0x76aa('0x30')](_0x5532c7);}return _0x5edcd8[_0x76aa('0x31')]();};}function saveUpdates(_0x458ac3,_0x38ecd1){return function(_0x35a705){if(_0x35a705){return _0x35a705['update'](_0x458ac3)[_0x76aa('0x1b')](function(_0x25a11f){return _0x25a11f;});}return null;};}function removeEntity(_0x5a0f72,_0x2ee338){return function(_0x58d860){if(_0x58d860){return _0x58d860[_0x76aa('0x32')]()['then'](function(){var _0x8479a3=_0x58d860['get']({'plain':!![]});var _0x58f135=_0x76aa('0x33');return db[_0x76aa('0x34')][_0x76aa('0x32')]({'where':{'type':_0x58f135,'resourceId':_0x8479a3['id']}})[_0x76aa('0x1b')](function(){return _0x58d860;});})['then'](function(){_0x5a0f72['status'](0xcc)[_0x76aa('0x27')]();});}};}function handleEntityNotFound(_0x1c7b6f,_0x58127c){return function(_0x23e2fd){if(!_0x23e2fd){_0x1c7b6f[_0x76aa('0x25')](0x194);}return _0x23e2fd;};}function handleError(_0x5b57d8,_0x9ce5f4){_0x9ce5f4=_0x9ce5f4||0x1f4;return function(_0x5c77f1){logger['error'](_0x5c77f1[_0x76aa('0x35')]);if(_0x5c77f1[_0x76aa('0x36')]){delete _0x5c77f1[_0x76aa('0x36')];}_0x5b57d8[_0x76aa('0x26')](_0x9ce5f4)['send'](_0x5c77f1);};}exports[_0x76aa('0x37')]=function(_0x1c22f7,_0x2eea79){var _0x4e131a={},_0x113770={},_0x1638db={'count':0x0,'rows':[]};var _0x2f7726=_[_0x76aa('0x38')](db[_0x76aa('0x39')][_0x76aa('0x3a')],function(_0x878903){return{'name':_0x878903[_0x76aa('0x3b')],'type':_0x878903[_0x76aa('0x3c')]['key']};});_0x113770[_0x76aa('0x3d')]=_[_0x76aa('0x38')](_0x2f7726,_0x76aa('0x36'));_0x113770[_0x76aa('0x3e')]=_[_0x76aa('0x3f')](_0x1c22f7[_0x76aa('0x3e')]);_0x113770['filters']=_['intersection'](_0x113770[_0x76aa('0x3d')],_0x113770[_0x76aa('0x3e')]);_0x4e131a[_0x76aa('0x40')]=_[_0x76aa('0x41')](_0x113770['model'],qs[_0x76aa('0x42')](_0x1c22f7[_0x76aa('0x3e')][_0x76aa('0x42')]));_0x4e131a[_0x76aa('0x40')]=_0x4e131a[_0x76aa('0x40')]['length']?_0x4e131a[_0x76aa('0x40')]:_0x113770['model'];if(!_0x1c22f7[_0x76aa('0x3e')]['hasOwnProperty']('nolimit')){_0x4e131a['limit']=qs[_0x76aa('0x2b')](_0x1c22f7['query']['limit']);_0x4e131a['offset']=qs[_0x76aa('0x29')](_0x1c22f7[_0x76aa('0x3e')][_0x76aa('0x29')]);}_0x4e131a[_0x76aa('0x43')]=qs[_0x76aa('0x44')](_0x1c22f7['query'][_0x76aa('0x44')]);_0x4e131a[_0x76aa('0x45')]=qs[_0x76aa('0x46')](_[_0x76aa('0x47')](_0x1c22f7[_0x76aa('0x3e')],_0x113770['filters']),_0x2f7726);if(_0x1c22f7[_0x76aa('0x3e')][_0x76aa('0x48')]){_0x4e131a['where']=_[_0x76aa('0x49')](_0x4e131a['where'],{'$or':_[_0x76aa('0x38')](_0x2f7726,function(_0x24ea05){if(_0x24ea05[_0x76aa('0x3c')]!==_0x76aa('0x4a')){var _0x2d0bc4={};_0x2d0bc4[_0x24ea05[_0x76aa('0x36')]]={'$like':'%'+_0x1c22f7[_0x76aa('0x3e')][_0x76aa('0x48')]+'%'};return _0x2d0bc4;}})});}_0x4e131a=_[_0x76aa('0x49')]({},_0x4e131a,_0x1c22f7[_0x76aa('0x4b')]);var _0x5e4967={'where':_0x4e131a[_0x76aa('0x45')]};return db['Trunk'][_0x76aa('0x2c')](_0x5e4967)[_0x76aa('0x1b')](function(_0x5e95f5){_0x1638db[_0x76aa('0x2c')]=_0x5e95f5;if(_0x1c22f7['query']['includeAll']){_0x4e131a[_0x76aa('0x4c')]=[{'all':!![]}];}return db['Trunk'][_0x76aa('0x4d')](_0x4e131a);})[_0x76aa('0x1b')](function(_0x4315b3){_0x1638db[_0x76aa('0x4e')]=_0x4315b3;return _0x1638db;})[_0x76aa('0x1b')](respondWithFilteredResult(_0x2eea79,_0x4e131a))[_0x76aa('0x24')](handleError(_0x2eea79,null));};exports['show']=function(_0x564546,_0x2fcf8f){var _0x1eafb2={'raw':![],'where':{'id':_0x564546[_0x76aa('0x4f')]['id']}},_0x1708d4={};_0x1708d4[_0x76aa('0x3d')]=_[_0x76aa('0x3f')](db['Trunk'][_0x76aa('0x3a')]);_0x1708d4[_0x76aa('0x3e')]=_[_0x76aa('0x3f')](_0x564546['query']);_0x1708d4[_0x76aa('0x46')]=_['intersection'](_0x1708d4[_0x76aa('0x3d')],_0x1708d4['query']);_0x1eafb2[_0x76aa('0x40')]=_[_0x76aa('0x41')](_0x1708d4[_0x76aa('0x3d')],qs[_0x76aa('0x42')](_0x564546[_0x76aa('0x3e')][_0x76aa('0x42')]));_0x1eafb2[_0x76aa('0x40')]=_0x1eafb2['attributes'][_0x76aa('0x50')]?_0x1eafb2['attributes']:_0x1708d4[_0x76aa('0x3d')];if(_0x564546[_0x76aa('0x3e')][_0x76aa('0x51')]){_0x1eafb2[_0x76aa('0x4c')]=[{'all':!![]}];}_0x1eafb2=_[_0x76aa('0x49')]({},_0x1eafb2,_0x564546[_0x76aa('0x4b')]);return db[_0x76aa('0x39')]['find'](_0x1eafb2)[_0x76aa('0x1b')](handleEntityNotFound(_0x2fcf8f,null))[_0x76aa('0x1b')](respondWithResult(_0x2fcf8f,null))[_0x76aa('0x24')](handleError(_0x2fcf8f,null));};exports[_0x76aa('0x52')]=function(_0x5c742c,_0xb9401b){var _0x163440={'where':{'id':_0x5c742c[_0x76aa('0x4f')]['id']}},_0x8dc601={};_0x8dc601[_0x76aa('0x3d')]=_[_0x76aa('0x3f')](db['Trunk'][_0x76aa('0x3a')]);_0x163440[_0x76aa('0x40')]=_[_0x76aa('0x41')](_0x8dc601[_0x76aa('0x3d')],qs[_0x76aa('0x42')](_0x5c742c[_0x76aa('0x3e')][_0x76aa('0x42')]));_0x163440['attributes']=_0x163440['attributes'][_0x76aa('0x50')]?_0x163440[_0x76aa('0x40')]:_0x8dc601['model'];if(_0x5c742c[_0x76aa('0x3e')][_0x76aa('0x51')]){_0x163440['include']=[{'all':!![]}];}_0x163440=_[_0x76aa('0x49')]({},_0x163440,_0x5c742c[_0x76aa('0x4b')]);return db[_0x76aa('0x39')][_0x76aa('0x53')](_0x163440)[_0x76aa('0x1b')](handleEntityNotFound(_0xb9401b,null))[_0x76aa('0x1b')](function(_0x3376ec){if(_0x3376ec){var _0x30573a=_0x3376ec[_0x76aa('0x54')]({'plain':!![]});_0x30573a=qs['omit'](_0x30573a,['id',_0x76aa('0x55'),'updatedAt']);_0x5c742c[_0x76aa('0x56')]=_[_0x76aa('0x57')](_0x5c742c[_0x76aa('0x56')],['id',_0x76aa('0x55'),_0x76aa('0x58')]);return db[_0x76aa('0x39')][_0x76aa('0x59')](_[_0x76aa('0x49')](_0x30573a,_0x5c742c[_0x76aa('0x56')]),{'include':_0x5c742c['query'][_0x76aa('0x51')]?[{'all':!![]}]:undefined})[_0x76aa('0x1b')](function(_0x5c542b){var _0xe5957d=_0x5c742c[_0x76aa('0x5a')][_0x76aa('0x54')]({'plain':!![]});if(!_0xe5957d)throw new Error(_0x76aa('0x5b'));if(_0xe5957d[_0x76aa('0x5c')]==='user'){var _0x364d05=_0x5c542b['get']({'plain':!![]});var _0x35bd2b=_0x76aa('0x33');return db[_0x76aa('0x5d')][_0x76aa('0x53')]({'where':{'name':_0x35bd2b,'userProfileId':_0xe5957d[_0x76aa('0x5e')]},'raw':!![]})[_0x76aa('0x1b')](function(_0x2bfb46){if(_0x2bfb46&&_0x2bfb46['autoAssociation']===0x0){return db[_0x76aa('0x34')][_0x76aa('0x59')]({'name':_0x364d05['name'],'resourceId':_0x364d05['id'],'type':_0x2bfb46['name'],'sectionId':_0x2bfb46['id']},{})[_0x76aa('0x1b')](function(){return _0x5c542b;});}else{return _0x5c542b;}})[_0x76aa('0x24')](function(_0x5295a7){logger[_0x76aa('0x20')](_0x76aa('0x5f'),_0x5295a7);throw _0x5295a7;});}return _0x5c542b;});}})[_0x76aa('0x1b')](respondWithResult(_0xb9401b,0xc9))['catch'](handleError(_0xb9401b,null));};exports[_0x76aa('0x59')]=function(_0x47f733,_0xf31e1f,_0x1178e5){var _0x2315cf;return db[_0x76aa('0x39')]['create'](_0x47f733['body'],{'raw':!![]})[_0x76aa('0x1b')](function(_0x4dfeb3){_0x2315cf=_0x4dfeb3;return db[_0x76aa('0x39')][_0x76aa('0x4d')]({'raw':!![]});})[_0x76aa('0x1b')](function(_0x43a2af){var _0x2dd320=fs[_0x76aa('0x60')](path[_0x76aa('0x61')](config[_0x76aa('0x62')],_0x76aa('0x63')),'utf8');var _0x7d02e7=fs[_0x76aa('0x60')](path[_0x76aa('0x61')](config[_0x76aa('0x62')],'server/files/templates/registry.ejs'),'utf8');var _0x557c11=ejs[_0x76aa('0x64')](_0x2dd320,{'trunks':_0x43a2af||[]});fs['writeFileSync'](_0x76aa('0x65'),_0x557c11);if(_0x2315cf[_0x76aa('0x66')]){var _0x38faff=ejs[_0x76aa('0x64')](_0x7d02e7,{'trunks':_0x43a2af||[]});fs['writeFileSync'](_0x76aa('0x67'),_0x38faff);}})['then'](function(){return respondWithRpcPromise(_0x76aa('0x68'),_0x76aa('0x59'),{'module':_0x76aa('0x69')});})[_0x76aa('0x1b')](function(){var _0x1037fb=_0x47f733['user'][_0x76aa('0x54')]({'plain':!![]});if(!_0x1037fb)throw new Error(_0x76aa('0x5b'));if(_0x1037fb[_0x76aa('0x5c')]===_0x76aa('0x5a')){var _0x32c1de=_0x2315cf[_0x76aa('0x54')]({'plain':!![]});return db[_0x76aa('0x5d')][_0x76aa('0x53')]({'where':{'name':'Trunks','userProfileId':_0x1037fb[_0x76aa('0x5e')]},'raw':!![]})[_0x76aa('0x1b')](function(_0x48136a){if(_0x48136a&&_0x48136a[_0x76aa('0x6a')]===0x0){return db[_0x76aa('0x34')][_0x76aa('0x59')]({'name':_0x32c1de[_0x76aa('0x36')],'resourceId':_0x32c1de['id'],'type':_0x48136a[_0x76aa('0x36')],'sectionId':_0x48136a['id']},{})[_0x76aa('0x1b')](function(){return _0x2315cf;});}else{return _0x2315cf;}})[_0x76aa('0x24')](function(_0x5dc923){logger[_0x76aa('0x20')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5dc923);throw _0x5dc923;});}return _0x2315cf;})['then'](respondWithResult(_0xf31e1f,0xc9))[_0x76aa('0x24')](handleError(_0xf31e1f,null));};exports[_0x76aa('0x6b')]=function(_0x5d8947,_0x5d1de1,_0x36da4d){var _0x14b5a2;return db[_0x76aa('0x39')]['find']({'where':{'id':_0x5d8947['params']['id']}})[_0x76aa('0x1b')](handleEntityNotFound(_0x5d1de1,null))[_0x76aa('0x1b')](saveUpdates(_0x5d8947[_0x76aa('0x56')],null))['then'](function(_0xb70589){if(_0xb70589){_0x14b5a2=_0xb70589;return db['Trunk'][_0x76aa('0x4d')]({'raw':!![]});}})[_0x76aa('0x1b')](function(_0x383290){if(_0x383290){var _0x325ffa=fs[_0x76aa('0x60')](path['join'](config['root'],_0x76aa('0x63')),_0x76aa('0x6c'));var _0x19ebb7=fs['readFileSync'](path[_0x76aa('0x61')](config[_0x76aa('0x62')],_0x76aa('0x6d')),_0x76aa('0x6c'));var _0x303b78=ejs['render'](_0x325ffa,{'trunks':_0x383290||[]});fs[_0x76aa('0x6e')]('/etc/asterisk/sip_xcally_trunks.conf',_0x303b78);var _0x213f7f=ejs[_0x76aa('0x64')](_0x19ebb7,{'trunks':_0x383290||[]});fs[_0x76aa('0x6e')](_0x76aa('0x67'),_0x213f7f);return respondWithRpcPromise(_0x76aa('0x68'),_0x76aa('0x6b'),{'module':'chan_sip.so'});}return null;})['then'](function(_0x547411){if(_0x547411){return _0x14b5a2;}})['then'](respondWithResult(_0x5d1de1,null))['catch'](handleError(_0x5d1de1,null));};exports[_0x76aa('0x32')]=function(_0x22f44f,_0x52c5be,_0x5c2c91){var _0x4f01e9;return db[_0x76aa('0x39')][_0x76aa('0x53')]({'where':{'id':_0x22f44f[_0x76aa('0x4f')]['id']}})['then'](handleEntityNotFound(_0x52c5be,null))['then'](removeEntity(_0x52c5be,null))[_0x76aa('0x1b')](function(){return db[_0x76aa('0x39')][_0x76aa('0x4d')]({'raw':!![]});})[_0x76aa('0x1b')](function(_0x354c7b){var _0x55e526=fs['readFileSync'](path[_0x76aa('0x61')](config['root'],'server/files/templates/trunk.ejs'),'utf8');var _0x4673e6=fs[_0x76aa('0x60')](path['join'](config[_0x76aa('0x62')],_0x76aa('0x6d')),'utf8');var _0x22063f=ejs[_0x76aa('0x64')](_0x55e526,{'trunks':_0x354c7b});var _0x11d91f=ejs[_0x76aa('0x64')](_0x4673e6,{'trunks':_0x354c7b});fs[_0x76aa('0x6e')](_0x76aa('0x65'),_0x22063f);fs[_0x76aa('0x6e')](_0x76aa('0x67'),_0x11d91f);return respondWithRpcPromise(_0x76aa('0x68'),'destroy',{'module':_0x76aa('0x69')});})[_0x76aa('0x24')](handleError(_0x52c5be,null));}; \ No newline at end of file +var _0x24ca=['lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','info','Trunk,\x20%s,\x20%s','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','get','Trunks','UserProfileResource','destroy','then','end','name','send','map','Trunk','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','params','rawAttributes','keys','find','clone','length','omit','createdAt','updatedAt','create','user','role','userProfileId','autoAssociation','body','join','root','server/files/templates/trunk.ejs','readFileSync','server/files/templates/registry.ejs','utf8','writeFileSync','registry','render','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','/etc/asterisk/sip_xcally_trunks.conf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x2065f7,_0x2f3111){var _0xdbb6fe=function(_0x53e4a9){while(--_0x53e4a9){_0x2065f7['push'](_0x2065f7['shift']());}};_0xdbb6fe(++_0x2f3111);}(_0x24ca,0x1bc));var _0xa24c=function(_0x576266,_0x4002b0){_0x576266=_0x576266-0x0;var _0x18234f=_0x24ca[_0x576266];return _0x18234f;};'use strict';var emlformat=require(_0xa24c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa24c('0x1'));var jsonpatch=require(_0xa24c('0x2'));var rp=require(_0xa24c('0x3'));var moment=require('moment');var BPromise=require(_0xa24c('0x4'));var Mustache=require(_0xa24c('0x5'));var util=require(_0xa24c('0x6'));var path=require(_0xa24c('0x7'));var sox=require(_0xa24c('0x8'));var csv=require(_0xa24c('0x9'));var ejs=require(_0xa24c('0xa'));var fs=require('fs');var fs_extra=require(_0xa24c('0xb'));var _=require(_0xa24c('0xc'));var squel=require(_0xa24c('0xd'));var crypto=require(_0xa24c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa24c('0xf'));var toCsv=require(_0xa24c('0x9'));var querystring=require(_0xa24c('0x10'));var Papa=require('papaparse');var Redis=require(_0xa24c('0x11'));var authService=require(_0xa24c('0x12'));var qs=require(_0xa24c('0x13'));var as=require(_0xa24c('0x14'));var hardwareService=require(_0xa24c('0x15'));var logger=require(_0xa24c('0x16'))(_0xa24c('0x17'));var utils=require(_0xa24c('0x18'));var config=require(_0xa24c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa24c('0x1a'))['db'];var jayson=require(_0xa24c('0x1b'));var client=jayson[_0xa24c('0x1c')][_0xa24c('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x5a9486,_0x3ad0bf,_0x3c23fc,_0x26ff28){return new BPromise(function(_0x2fcd8b,_0x1cb08e){var _0x2d185c=_0x26ff28||client;return _0x2d185c[_0xa24c('0x1e')](_0x5a9486,_0x3c23fc)['then'](function(_0x47a063){logger[_0xa24c('0x1f')](_0xa24c('0x20'),_0x3ad0bf,'request\x20sent');logger['debug'](_0xa24c('0x21'),_0x3ad0bf,_0xa24c('0x22'),JSON['stringify'](_0x47a063));if(_0x47a063[_0xa24c('0x23')]){if(_0x47a063['error'][_0xa24c('0x24')]===0x1f4){logger[_0xa24c('0x23')](_0xa24c('0x20'),_0x3ad0bf,_0x47a063[_0xa24c('0x23')]['message']);return _0x1cb08e(_0x47a063[_0xa24c('0x23')][_0xa24c('0x25')]);}logger[_0xa24c('0x23')]('Trunk,\x20%s,\x20%s',_0x3ad0bf,_0x47a063['error']['message']);return _0x2fcd8b(_0x47a063['error'][_0xa24c('0x25')]);}else{logger[_0xa24c('0x1f')](_0xa24c('0x20'),_0x3ad0bf,_0xa24c('0x22'));_0x2fcd8b(_0x47a063['result'][_0xa24c('0x25')]);}})['catch'](function(_0x224bca){logger[_0xa24c('0x23')]('Trunk,\x20%s,\x20%s',_0x3ad0bf,_0x224bca);_0x1cb08e(_0x224bca);});});}function respondWithStatusCode(_0x346ee8,_0x363d52){_0x363d52=_0x363d52||0xcc;return function(_0x43a0c0){if(_0x43a0c0){return _0x346ee8[_0xa24c('0x26')](_0x363d52);}return _0x346ee8[_0xa24c('0x27')](_0x363d52)['end']();};}function respondWithResult(_0xec9167,_0x5cc9cb){_0x5cc9cb=_0x5cc9cb||0xc8;return function(_0x2365f9){if(_0x2365f9){return _0xec9167[_0xa24c('0x27')](_0x5cc9cb)[_0xa24c('0x28')](_0x2365f9);}};}function respondWithFilteredResult(_0x51dc3f,_0x1beb55){return function(_0x31c4d9){if(_0x31c4d9){var _0x14fd5a=typeof _0x1beb55[_0xa24c('0x29')]===_0xa24c('0x2a')&&typeof _0x1beb55[_0xa24c('0x2b')]===_0xa24c('0x2a');var _0x5b23f4=_0x31c4d9[_0xa24c('0x2c')];var _0x28675f=_0x14fd5a?0x0:_0x1beb55[_0xa24c('0x29')];var _0x12dbdc=_0x14fd5a?_0x31c4d9['count']:_0x1beb55[_0xa24c('0x29')]+_0x1beb55[_0xa24c('0x2b')];var _0x97c08;if(_0x12dbdc>=_0x5b23f4){_0x12dbdc=_0x5b23f4;_0x97c08=0xc8;}else{_0x97c08=0xce;}_0x51dc3f['status'](_0x97c08);return _0x51dc3f[_0xa24c('0x2d')](_0xa24c('0x2e'),_0x28675f+'-'+_0x12dbdc+'/'+_0x5b23f4)[_0xa24c('0x28')](_0x31c4d9);}return null;};}function patchUpdates(_0x4ae35c){return function(_0x245fb2){try{jsonpatch['apply'](_0x245fb2,_0x4ae35c,!![]);}catch(_0x1102ab){return BPromise[_0xa24c('0x2f')](_0x1102ab);}return _0x245fb2[_0xa24c('0x30')]();};}function saveUpdates(_0x5d025a,_0x1f52f8){return function(_0x53f90){if(_0x53f90){return _0x53f90[_0xa24c('0x31')](_0x5d025a)['then'](function(_0x1c1ed3){return _0x1c1ed3;});}return null;};}function removeEntity(_0x57c340,_0xa20091){return function(_0x42ba21){if(_0x42ba21){return _0x42ba21['destroy']()['then'](function(){var _0x20a276=_0x42ba21[_0xa24c('0x32')]({'plain':!![]});var _0x182e86=_0xa24c('0x33');return db[_0xa24c('0x34')][_0xa24c('0x35')]({'where':{'type':_0x182e86,'resourceId':_0x20a276['id']}})[_0xa24c('0x36')](function(){return _0x42ba21;});})['then'](function(){_0x57c340[_0xa24c('0x27')](0xcc)[_0xa24c('0x37')]();});}};}function handleEntityNotFound(_0x12825d,_0xbd24c0){return function(_0xc6337b){if(!_0xc6337b){_0x12825d[_0xa24c('0x26')](0x194);}return _0xc6337b;};}function handleError(_0x86902f,_0x81d471){_0x81d471=_0x81d471||0x1f4;return function(_0x1ea166){logger[_0xa24c('0x23')](_0x1ea166['stack']);if(_0x1ea166[_0xa24c('0x38')]){delete _0x1ea166[_0xa24c('0x38')];}_0x86902f[_0xa24c('0x27')](_0x81d471)[_0xa24c('0x39')](_0x1ea166);};}exports['index']=function(_0x56a485,_0x19a65f){var _0x56ef4d={},_0xb690b5={},_0x13f272={'count':0x0,'rows':[]};var _0x22a316=_[_0xa24c('0x3a')](db[_0xa24c('0x3b')]['rawAttributes'],function(_0x532875){return{'name':_0x532875[_0xa24c('0x3c')],'type':_0x532875[_0xa24c('0x3d')][_0xa24c('0x3e')]};});_0xb690b5[_0xa24c('0x3f')]=_[_0xa24c('0x3a')](_0x22a316,_0xa24c('0x38'));_0xb690b5['query']=_['keys'](_0x56a485[_0xa24c('0x40')]);_0xb690b5[_0xa24c('0x41')]=_[_0xa24c('0x42')](_0xb690b5[_0xa24c('0x3f')],_0xb690b5[_0xa24c('0x40')]);_0x56ef4d['attributes']=_[_0xa24c('0x42')](_0xb690b5[_0xa24c('0x3f')],qs['fields'](_0x56a485['query'][_0xa24c('0x43')]));_0x56ef4d[_0xa24c('0x44')]=_0x56ef4d[_0xa24c('0x44')]['length']?_0x56ef4d['attributes']:_0xb690b5[_0xa24c('0x3f')];if(!_0x56a485[_0xa24c('0x40')][_0xa24c('0x45')](_0xa24c('0x46'))){_0x56ef4d[_0xa24c('0x2b')]=qs[_0xa24c('0x2b')](_0x56a485[_0xa24c('0x40')][_0xa24c('0x2b')]);_0x56ef4d['offset']=qs['offset'](_0x56a485[_0xa24c('0x40')][_0xa24c('0x29')]);}_0x56ef4d[_0xa24c('0x47')]=qs['sort'](_0x56a485[_0xa24c('0x40')][_0xa24c('0x48')]);_0x56ef4d[_0xa24c('0x49')]=qs[_0xa24c('0x41')](_[_0xa24c('0x4a')](_0x56a485[_0xa24c('0x40')],_0xb690b5[_0xa24c('0x41')]),_0x22a316);if(_0x56a485[_0xa24c('0x40')][_0xa24c('0x4b')]){_0x56ef4d[_0xa24c('0x49')]=_['merge'](_0x56ef4d[_0xa24c('0x49')],{'$or':_[_0xa24c('0x3a')](_0x22a316,function(_0x39a6cd){if(_0x39a6cd['type']!==_0xa24c('0x4c')){var _0x247d2c={};_0x247d2c[_0x39a6cd[_0xa24c('0x38')]]={'$like':'%'+_0x56a485[_0xa24c('0x40')][_0xa24c('0x4b')]+'%'};return _0x247d2c;}})});}_0x56ef4d=_[_0xa24c('0x4d')]({},_0x56ef4d,_0x56a485[_0xa24c('0x4e')]);var _0x46f725={'where':_0x56ef4d[_0xa24c('0x49')]};return db[_0xa24c('0x3b')][_0xa24c('0x2c')](_0x46f725)['then'](function(_0x29a84d){_0x13f272[_0xa24c('0x2c')]=_0x29a84d;if(_0x56a485[_0xa24c('0x40')][_0xa24c('0x4f')]){_0x56ef4d[_0xa24c('0x50')]=[{'all':!![]}];}return db[_0xa24c('0x3b')][_0xa24c('0x51')](_0x56ef4d);})[_0xa24c('0x36')](function(_0x184179){_0x13f272['rows']=_0x184179;return _0x13f272;})['then'](respondWithFilteredResult(_0x19a65f,_0x56ef4d))[_0xa24c('0x52')](handleError(_0x19a65f,null));};exports['show']=function(_0xc078ef,_0x1f436c){var _0x4ec677={'raw':![],'where':{'id':_0xc078ef[_0xa24c('0x53')]['id']}},_0x24b3df={};_0x24b3df[_0xa24c('0x3f')]=_['keys'](db['Trunk'][_0xa24c('0x54')]);_0x24b3df['query']=_[_0xa24c('0x55')](_0xc078ef[_0xa24c('0x40')]);_0x24b3df[_0xa24c('0x41')]=_[_0xa24c('0x42')](_0x24b3df[_0xa24c('0x3f')],_0x24b3df[_0xa24c('0x40')]);_0x4ec677[_0xa24c('0x44')]=_[_0xa24c('0x42')](_0x24b3df[_0xa24c('0x3f')],qs[_0xa24c('0x43')](_0xc078ef['query'][_0xa24c('0x43')]));_0x4ec677[_0xa24c('0x44')]=_0x4ec677[_0xa24c('0x44')]['length']?_0x4ec677['attributes']:_0x24b3df['model'];if(_0xc078ef[_0xa24c('0x40')]['includeAll']){_0x4ec677[_0xa24c('0x50')]=[{'all':!![]}];}_0x4ec677=_[_0xa24c('0x4d')]({},_0x4ec677,_0xc078ef['options']);return db[_0xa24c('0x3b')][_0xa24c('0x56')](_0x4ec677)[_0xa24c('0x36')](handleEntityNotFound(_0x1f436c,null))[_0xa24c('0x36')](respondWithResult(_0x1f436c,null))[_0xa24c('0x52')](handleError(_0x1f436c,null));};exports[_0xa24c('0x57')]=function(_0x3816f7,_0xbeab78){var _0x518c2a={'where':{'id':_0x3816f7['params']['id']}},_0x172645={};_0x172645['model']=_['keys'](db['Trunk']['rawAttributes']);_0x518c2a[_0xa24c('0x44')]=_['intersection'](_0x172645[_0xa24c('0x3f')],qs[_0xa24c('0x43')](_0x3816f7[_0xa24c('0x40')][_0xa24c('0x43')]));_0x518c2a[_0xa24c('0x44')]=_0x518c2a[_0xa24c('0x44')][_0xa24c('0x58')]?_0x518c2a[_0xa24c('0x44')]:_0x172645[_0xa24c('0x3f')];if(_0x3816f7[_0xa24c('0x40')][_0xa24c('0x4f')]){_0x518c2a[_0xa24c('0x50')]=[{'all':!![]}];}_0x518c2a=_[_0xa24c('0x4d')]({},_0x518c2a,_0x3816f7[_0xa24c('0x4e')]);return db[_0xa24c('0x3b')]['find'](_0x518c2a)[_0xa24c('0x36')](handleEntityNotFound(_0xbeab78,null))[_0xa24c('0x36')](function(_0x5264a7){if(_0x5264a7){var _0x1e08bb=_0x5264a7[_0xa24c('0x32')]({'plain':!![]});_0x1e08bb=qs[_0xa24c('0x59')](_0x1e08bb,['id',_0xa24c('0x5a'),'updatedAt']);_0x3816f7['body']=_[_0xa24c('0x59')](_0x3816f7['body'],['id','createdAt',_0xa24c('0x5b')]);return db[_0xa24c('0x3b')][_0xa24c('0x5c')](_[_0xa24c('0x4d')](_0x1e08bb,_0x3816f7['body']),{'include':_0x3816f7['query'][_0xa24c('0x4f')]?[{'all':!![]}]:undefined})['then'](function(_0x52a895){var _0xfcc193=_0x3816f7[_0xa24c('0x5d')][_0xa24c('0x32')]({'plain':!![]});if(!_0xfcc193)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xfcc193[_0xa24c('0x5e')]===_0xa24c('0x5d')){var _0x5c3285=_0x52a895[_0xa24c('0x32')]({'plain':!![]});var _0x3f306d=_0xa24c('0x33');return db['UserProfileSection'][_0xa24c('0x56')]({'where':{'name':_0x3f306d,'userProfileId':_0xfcc193[_0xa24c('0x5f')]},'raw':!![]})[_0xa24c('0x36')](function(_0x7aab6e){if(_0x7aab6e&&_0x7aab6e[_0xa24c('0x60')]===0x0){return db['UserProfileResource'][_0xa24c('0x5c')]({'name':_0x5c3285[_0xa24c('0x38')],'resourceId':_0x5c3285['id'],'type':_0x7aab6e[_0xa24c('0x38')],'sectionId':_0x7aab6e['id']},{})[_0xa24c('0x36')](function(){return _0x52a895;});}else{return _0x52a895;}})[_0xa24c('0x52')](function(_0x2ca3fa){logger[_0xa24c('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ca3fa);throw _0x2ca3fa;});}return _0x52a895;});}})[_0xa24c('0x36')](respondWithResult(_0xbeab78,0xc9))[_0xa24c('0x52')](handleError(_0xbeab78,null));};exports['create']=function(_0xb1048a,_0x3e455b,_0x14da5e){var _0xb460b4;return db[_0xa24c('0x3b')][_0xa24c('0x5c')](_0xb1048a[_0xa24c('0x61')],{'raw':!![]})[_0xa24c('0x36')](function(_0x38cc30){_0xb460b4=_0x38cc30;return db[_0xa24c('0x3b')]['findAll']({'raw':!![]});})[_0xa24c('0x36')](function(_0x3a4abd){var _0x3b894f=fs['readFileSync'](path[_0xa24c('0x62')](config[_0xa24c('0x63')],_0xa24c('0x64')),'utf8');var _0x3ac3a0=fs[_0xa24c('0x65')](path[_0xa24c('0x62')](config[_0xa24c('0x63')],_0xa24c('0x66')),_0xa24c('0x67'));var _0x4f9b56=ejs['render'](_0x3b894f,{'trunks':_0x3a4abd||[]});fs[_0xa24c('0x68')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4f9b56);if(_0xb460b4[_0xa24c('0x69')]){var _0x1879ae=ejs[_0xa24c('0x6a')](_0x3ac3a0,{'trunks':_0x3a4abd||[]});fs[_0xa24c('0x68')](_0xa24c('0x6b'),_0x1879ae);}})['then'](function(){return respondWithRpcPromise(_0xa24c('0x6c'),_0xa24c('0x5c'),{'module':_0xa24c('0x6d')});})[_0xa24c('0x36')](function(){var _0x987aca=_0xb1048a[_0xa24c('0x5d')]['get']({'plain':!![]});if(!_0x987aca)throw new Error(_0xa24c('0x6e'));if(_0x987aca[_0xa24c('0x5e')]===_0xa24c('0x5d')){var _0x5b9ad7=_0xb460b4['get']({'plain':!![]});return db[_0xa24c('0x6f')]['find']({'where':{'name':_0xa24c('0x33'),'userProfileId':_0x987aca[_0xa24c('0x5f')]},'raw':!![]})[_0xa24c('0x36')](function(_0x180da2){if(_0x180da2&&_0x180da2['autoAssociation']===0x0){return db[_0xa24c('0x34')][_0xa24c('0x5c')]({'name':_0x5b9ad7['name'],'resourceId':_0x5b9ad7['id'],'type':_0x180da2[_0xa24c('0x38')],'sectionId':_0x180da2['id']},{})[_0xa24c('0x36')](function(){return _0xb460b4;});}else{return _0xb460b4;}})[_0xa24c('0x52')](function(_0x3e0c08){logger[_0xa24c('0x23')](_0xa24c('0x70'),_0x3e0c08);throw _0x3e0c08;});}return _0xb460b4;})[_0xa24c('0x36')](respondWithResult(_0x3e455b,0xc9))[_0xa24c('0x52')](handleError(_0x3e455b,null));};exports['update']=function(_0x12508e,_0x3c2726,_0x2cae90){var _0x28c3ff;return db[_0xa24c('0x3b')][_0xa24c('0x56')]({'where':{'id':_0x12508e[_0xa24c('0x53')]['id']}})[_0xa24c('0x36')](handleEntityNotFound(_0x3c2726,null))[_0xa24c('0x36')](saveUpdates(_0x12508e[_0xa24c('0x61')],null))[_0xa24c('0x36')](function(_0x5b0127){if(_0x5b0127){_0x28c3ff=_0x5b0127;return db[_0xa24c('0x3b')][_0xa24c('0x51')]({'raw':!![]});}})['then'](function(_0x141ccf){if(_0x141ccf){var _0x3f212f=fs[_0xa24c('0x65')](path['join'](config['root'],_0xa24c('0x64')),_0xa24c('0x67'));var _0x53928f=fs[_0xa24c('0x65')](path[_0xa24c('0x62')](config[_0xa24c('0x63')],_0xa24c('0x66')),_0xa24c('0x67'));var _0x336898=ejs['render'](_0x3f212f,{'trunks':_0x141ccf||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_trunks.conf',_0x336898);var _0x263dab=ejs['render'](_0x53928f,{'trunks':_0x141ccf||[]});fs['writeFileSync'](_0xa24c('0x6b'),_0x263dab);return respondWithRpcPromise(_0xa24c('0x6c'),_0xa24c('0x31'),{'module':_0xa24c('0x6d')});}return null;})[_0xa24c('0x36')](function(_0x45b2fe){if(_0x45b2fe){return _0x28c3ff;}})[_0xa24c('0x36')](respondWithResult(_0x3c2726,null))[_0xa24c('0x52')](handleError(_0x3c2726,null));};exports[_0xa24c('0x35')]=function(_0x4ee10d,_0x3897ca,_0xa077c8){var _0x16e1db;return db[_0xa24c('0x3b')][_0xa24c('0x56')]({'where':{'id':_0x4ee10d[_0xa24c('0x53')]['id']}})[_0xa24c('0x36')](handleEntityNotFound(_0x3897ca,null))[_0xa24c('0x36')](removeEntity(_0x3897ca,null))[_0xa24c('0x36')](function(){return db[_0xa24c('0x3b')][_0xa24c('0x51')]({'raw':!![]});})[_0xa24c('0x36')](function(_0x4ecbe9){var _0x1fe0f3=fs[_0xa24c('0x65')](path['join'](config[_0xa24c('0x63')],_0xa24c('0x64')),_0xa24c('0x67'));var _0x4af78f=fs[_0xa24c('0x65')](path[_0xa24c('0x62')](config['root'],_0xa24c('0x66')),_0xa24c('0x67'));var _0x4c108f=ejs['render'](_0x1fe0f3,{'trunks':_0x4ecbe9});var _0x124d52=ejs[_0xa24c('0x6a')](_0x4af78f,{'trunks':_0x4ecbe9});fs[_0xa24c('0x68')](_0xa24c('0x71'),_0x4c108f);fs['writeFileSync'](_0xa24c('0x6b'),_0x124d52);return respondWithRpcPromise(_0xa24c('0x6c'),_0xa24c('0x35'),{'module':'chan_sip.so'});})['catch'](handleError(_0x3897ca,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index d905e99..cd4f1fa 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 _0x1ebb=['moment','bluebird','path','rimraf','../../config/environment','define','tools_trunks','util','../../config/logger'];(function(_0x4dd063,_0x386d0c){var _0x2b8747=function(_0x282e72){while(--_0x282e72){_0x4dd063['push'](_0x4dd063['shift']());}};_0x2b8747(++_0x386d0c);}(_0x1ebb,0xcd));var _0xb1eb=function(_0x32ab00,_0x358cb3){_0x32ab00=_0x32ab00-0x0;var _0x1b4890=_0x1ebb[_0x32ab00];return _0x1b4890;};'use strict';var _=require('lodash');var util=require(_0xb1eb('0x0'));var logger=require(_0xb1eb('0x1'))('api');var moment=require(_0xb1eb('0x2'));var BPromise=require(_0xb1eb('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb1eb('0x4'));var rimraf=require(_0xb1eb('0x5'));var config=require(_0xb1eb('0x6'));var attributes=require('./trunk.attributes');module['exports']=function(_0x37c771,_0x35e97d){return _0x37c771[_0xb1eb('0x7')]('Trunk',attributes,{'tableName':_0xb1eb('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7e92=['define','Trunk','tools_trunks','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x275f5d,_0x42d453){var _0x4be5b6=function(_0x4ffbf0){while(--_0x4ffbf0){_0x275f5d['push'](_0x275f5d['shift']());}};_0x4be5b6(++_0x42d453);}(_0x7e92,0x1bf));var _0x27e9=function(_0x53b30d,_0x27ae6f){_0x53b30d=_0x53b30d-0x0;var _0x1a5b33=_0x7e92[_0x53b30d];return _0x1a5b33;};'use strict';var _=require(_0x27e9('0x0'));var util=require(_0x27e9('0x1'));var logger=require('../../config/logger')(_0x27e9('0x2'));var moment=require(_0x27e9('0x3'));var BPromise=require(_0x27e9('0x4'));var rp=require(_0x27e9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x27e9('0x6'));var config=require(_0x27e9('0x7'));var attributes=require('./trunk.attributes');module[_0x27e9('0x8')]=function(_0x4ece9d,_0x59e816){return _0x4ece9d[_0x27e9('0x9')](_0x27e9('0xa'),attributes,{'tableName':_0x27e9('0xb'),'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 c23bfd8..78f251c 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 _0x405a=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetTrunk','Trunk','findAll','options','where','attributes','limit','include','map','model','catch','find','raw','ShowTrunk','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x405a,0x1d3));var _0xa405=function(_0x644ecd,_0x397f36){_0x644ecd=_0x644ecd-0x0;var _0x1c66ce=_0x405a[_0x644ecd];return _0x1c66ce;};'use strict';var _=require('lodash');var util=require(_0xa405('0x0'));var moment=require(_0xa405('0x1'));var BPromise=require(_0xa405('0x2'));var rs=require(_0xa405('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa405('0x4'));var logger=require(_0xa405('0x5'))(_0xa405('0x6'));var config=require(_0xa405('0x7'));var jayson=require(_0xa405('0x8'));var client=jayson[_0xa405('0x9')][_0xa405('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb99331,_0x1f8464,_0x24800a){return new BPromise(function(_0x1397e0,_0x388d57){return client[_0xa405('0xb')](_0xb99331,_0x24800a)[_0xa405('0xc')](function(_0x49fa68){logger[_0xa405('0xd')](_0xa405('0xe'),_0x1f8464,_0xa405('0xf'));logger[_0xa405('0x10')](_0xa405('0x11'),_0x1f8464,'request\x20sent',JSON[_0xa405('0x12')](_0x49fa68));if(_0x49fa68['error']){if(_0x49fa68[_0xa405('0x13')][_0xa405('0x14')]===0x1f4){logger[_0xa405('0x13')]('Trunk,\x20%s,\x20%s',_0x1f8464,_0x49fa68[_0xa405('0x13')][_0xa405('0x15')]);return _0x388d57(_0x49fa68[_0xa405('0x13')]['message']);}logger[_0xa405('0x13')]('Trunk,\x20%s,\x20%s',_0x1f8464,_0x49fa68['error']['message']);return _0x1397e0(_0x49fa68[_0xa405('0x13')][_0xa405('0x15')]);}else{logger[_0xa405('0xd')](_0xa405('0xe'),_0x1f8464,_0xa405('0xf'));_0x1397e0(_0x49fa68['result'][_0xa405('0x15')]);}})['catch'](function(_0x1941e4){logger['error'](_0xa405('0xe'),_0x1f8464,_0x1941e4);_0x388d57(_0x1941e4);});});}exports[_0xa405('0x16')]=function(_0x205165){var _0x549c04=this;return new Promise(function(_0x4f42ef,_0x57953b){return db[_0xa405('0x17')][_0xa405('0x18')]({'raw':_0x205165[_0xa405('0x19')]?_0x205165[_0xa405('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x205165[_0xa405('0x19')]?_0x205165[_0xa405('0x19')][_0xa405('0x1a')]||null:null,'attributes':_0x205165[_0xa405('0x19')]?_0x205165[_0xa405('0x19')][_0xa405('0x1b')]||null:null,'limit':_0x205165[_0xa405('0x19')]?_0x205165[_0xa405('0x19')][_0xa405('0x1c')]||null:null,'include':_0x205165[_0xa405('0x19')]?_0x205165[_0xa405('0x19')]['include']?_['map'](_0x205165[_0xa405('0x19')][_0xa405('0x1d')],function(_0xb8e461){return{'model':db[_0xb8e461['model']],'as':_0xb8e461['as'],'attributes':_0xb8e461['attributes'],'include':_0xb8e461[_0xa405('0x1d')]?_[_0xa405('0x1e')](_0xb8e461['include'],function(_0x5d9169){return{'model':db[_0x5d9169[_0xa405('0x1f')]],'as':_0x5d9169['as'],'attributes':_0x5d9169[_0xa405('0x1b')],'include':_0x5d9169['include']?_['map'](_0x5d9169[_0xa405('0x1d')],function(_0x160d8d){return{'model':db[_0x160d8d['model']],'as':_0x160d8d['as'],'attributes':_0x160d8d[_0xa405('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xa405('0xc')](function(_0x6e113){logger[_0xa405('0xd')](_0xa405('0x16'),_0x205165);logger[_0xa405('0x10')]('GetTrunk',_0x205165,JSON[_0xa405('0x12')](_0x6e113));_0x4f42ef(_0x6e113);})[_0xa405('0x20')](function(_0x4111ec){logger[_0xa405('0x13')](_0xa405('0x16'),_0x4111ec[_0xa405('0x15')],_0x205165);_0x57953b(_0x549c04[_0xa405('0x13')](0x1f4,_0x4111ec[_0xa405('0x15')]));});});};exports['ShowTrunk']=function(_0x22f3a9){var _0x132033=this;return new Promise(function(_0x267bd3,_0x51d826){return db[_0xa405('0x17')][_0xa405('0x21')]({'raw':_0x22f3a9[_0xa405('0x19')]?_0x22f3a9[_0xa405('0x19')][_0xa405('0x22')]===undefined?!![]:![]:!![],'where':_0x22f3a9[_0xa405('0x19')]?_0x22f3a9[_0xa405('0x19')][_0xa405('0x1a')]||null:null,'attributes':_0x22f3a9[_0xa405('0x19')]?_0x22f3a9[_0xa405('0x19')]['attributes']||null:null,'include':_0x22f3a9[_0xa405('0x19')]?_0x22f3a9[_0xa405('0x19')][_0xa405('0x1d')]?_[_0xa405('0x1e')](_0x22f3a9[_0xa405('0x19')][_0xa405('0x1d')],function(_0x1b95c1){return{'model':db[_0x1b95c1[_0xa405('0x1f')]],'as':_0x1b95c1['as'],'attributes':_0x1b95c1[_0xa405('0x1b')],'include':_0x1b95c1[_0xa405('0x1d')]?_[_0xa405('0x1e')](_0x1b95c1[_0xa405('0x1d')],function(_0x216a44){return{'model':db[_0x216a44[_0xa405('0x1f')]],'as':_0x216a44['as'],'attributes':_0x216a44[_0xa405('0x1b')],'include':_0x216a44[_0xa405('0x1d')]?_['map'](_0x216a44[_0xa405('0x1d')],function(_0x114d7e){return{'model':db[_0x114d7e[_0xa405('0x1f')]],'as':_0x114d7e['as'],'attributes':_0x114d7e[_0xa405('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xa405('0xc')](function(_0x117a99){logger[_0xa405('0xd')](_0xa405('0x23'),_0x22f3a9);logger[_0xa405('0x10')]('ShowTrunk',_0x22f3a9,JSON[_0xa405('0x12')](_0x117a99));_0x267bd3(_0x117a99);})[_0xa405('0x20')](function(_0x4a4e0f){logger[_0xa405('0x13')](_0xa405('0x23'),_0x4a4e0f[_0xa405('0x15')],_0x22f3a9);_0x51d826(_0x132033[_0xa405('0x13')](0x1f4,_0x4a4e0f['message']));});});}; \ No newline at end of file +var _0x4cd6=['info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTrunk','Trunk','options','raw','where','attributes','limit','include','map','model','then','ShowTrunk','find','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','http','request'];(function(_0x509550,_0x532724){var _0x1b598b=function(_0x4caea2){while(--_0x4caea2){_0x509550['push'](_0x509550['shift']());}};_0x1b598b(++_0x532724);}(_0x4cd6,0x1c5));var _0x64cd=function(_0x18425b,_0x4e1dc7){_0x18425b=_0x18425b-0x0;var _0xefa5ae=_0x4cd6[_0x18425b];return _0xefa5ae;};'use strict';var _=require(_0x64cd('0x0'));var util=require(_0x64cd('0x1'));var moment=require('moment');var BPromise=require(_0x64cd('0x2'));var rs=require(_0x64cd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x64cd('0x4'))['db'];var utils=require(_0x64cd('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x64cd('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x64cd('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x48df49,_0x105c8b,_0x23d110){return new BPromise(function(_0x5ab7fd,_0x5b6ce2){return client[_0x64cd('0x8')](_0x48df49,_0x23d110)['then'](function(_0x579f7a){logger[_0x64cd('0x9')](_0x64cd('0xa'),_0x105c8b,_0x64cd('0xb'));logger[_0x64cd('0xc')](_0x64cd('0xd'),_0x105c8b,_0x64cd('0xb'),JSON[_0x64cd('0xe')](_0x579f7a));if(_0x579f7a[_0x64cd('0xf')]){if(_0x579f7a[_0x64cd('0xf')][_0x64cd('0x10')]===0x1f4){logger[_0x64cd('0xf')](_0x64cd('0xa'),_0x105c8b,_0x579f7a[_0x64cd('0xf')][_0x64cd('0x11')]);return _0x5b6ce2(_0x579f7a[_0x64cd('0xf')][_0x64cd('0x11')]);}logger[_0x64cd('0xf')](_0x64cd('0xa'),_0x105c8b,_0x579f7a['error'][_0x64cd('0x11')]);return _0x5ab7fd(_0x579f7a['error'][_0x64cd('0x11')]);}else{logger[_0x64cd('0x9')](_0x64cd('0xa'),_0x105c8b,_0x64cd('0xb'));_0x5ab7fd(_0x579f7a[_0x64cd('0x12')][_0x64cd('0x11')]);}})[_0x64cd('0x13')](function(_0x3c1e6a){logger[_0x64cd('0xf')](_0x64cd('0xa'),_0x105c8b,_0x3c1e6a);_0x5b6ce2(_0x3c1e6a);});});}exports[_0x64cd('0x14')]=function(_0x40a5ee){var _0x274e75=this;return new Promise(function(_0x4d3246,_0x466f45){return db[_0x64cd('0x15')]['findAll']({'raw':_0x40a5ee[_0x64cd('0x16')]?_0x40a5ee['options'][_0x64cd('0x17')]===undefined?!![]:![]:!![],'where':_0x40a5ee[_0x64cd('0x16')]?_0x40a5ee[_0x64cd('0x16')][_0x64cd('0x18')]||null:null,'attributes':_0x40a5ee['options']?_0x40a5ee[_0x64cd('0x16')][_0x64cd('0x19')]||null:null,'limit':_0x40a5ee[_0x64cd('0x16')]?_0x40a5ee[_0x64cd('0x16')][_0x64cd('0x1a')]||null:null,'include':_0x40a5ee[_0x64cd('0x16')]?_0x40a5ee[_0x64cd('0x16')][_0x64cd('0x1b')]?_[_0x64cd('0x1c')](_0x40a5ee[_0x64cd('0x16')]['include'],function(_0x2e658a){return{'model':db[_0x2e658a[_0x64cd('0x1d')]],'as':_0x2e658a['as'],'attributes':_0x2e658a[_0x64cd('0x19')],'include':_0x2e658a[_0x64cd('0x1b')]?_[_0x64cd('0x1c')](_0x2e658a[_0x64cd('0x1b')],function(_0x21c23d){return{'model':db[_0x21c23d[_0x64cd('0x1d')]],'as':_0x21c23d['as'],'attributes':_0x21c23d[_0x64cd('0x19')],'include':_0x21c23d[_0x64cd('0x1b')]?_['map'](_0x21c23d[_0x64cd('0x1b')],function(_0x407ad6){return{'model':db[_0x407ad6[_0x64cd('0x1d')]],'as':_0x407ad6['as'],'attributes':_0x407ad6['attributes']};}):[]};}):[]};}):[]:[]})[_0x64cd('0x1e')](function(_0x6505e0){logger[_0x64cd('0x9')]('GetTrunk',_0x40a5ee);logger[_0x64cd('0xc')](_0x64cd('0x14'),_0x40a5ee,JSON['stringify'](_0x6505e0));_0x4d3246(_0x6505e0);})[_0x64cd('0x13')](function(_0x1a93f2){logger[_0x64cd('0xf')](_0x64cd('0x14'),_0x1a93f2[_0x64cd('0x11')],_0x40a5ee);_0x466f45(_0x274e75[_0x64cd('0xf')](0x1f4,_0x1a93f2[_0x64cd('0x11')]));});});};exports[_0x64cd('0x1f')]=function(_0xe719b3){var _0x34c021=this;return new Promise(function(_0x5dfab0,_0x1bb7ad){return db['Trunk'][_0x64cd('0x20')]({'raw':_0xe719b3['options']?_0xe719b3[_0x64cd('0x16')][_0x64cd('0x17')]===undefined?!![]:![]:!![],'where':_0xe719b3['options']?_0xe719b3[_0x64cd('0x16')]['where']||null:null,'attributes':_0xe719b3[_0x64cd('0x16')]?_0xe719b3['options'][_0x64cd('0x19')]||null:null,'include':_0xe719b3[_0x64cd('0x16')]?_0xe719b3[_0x64cd('0x16')][_0x64cd('0x1b')]?_[_0x64cd('0x1c')](_0xe719b3[_0x64cd('0x16')][_0x64cd('0x1b')],function(_0x303a25){return{'model':db[_0x303a25[_0x64cd('0x1d')]],'as':_0x303a25['as'],'attributes':_0x303a25[_0x64cd('0x19')],'include':_0x303a25[_0x64cd('0x1b')]?_[_0x64cd('0x1c')](_0x303a25[_0x64cd('0x1b')],function(_0x134a91){return{'model':db[_0x134a91['model']],'as':_0x134a91['as'],'attributes':_0x134a91[_0x64cd('0x19')],'include':_0x134a91[_0x64cd('0x1b')]?_[_0x64cd('0x1c')](_0x134a91[_0x64cd('0x1b')],function(_0x4be637){return{'model':db[_0x4be637[_0x64cd('0x1d')]],'as':_0x4be637['as'],'attributes':_0x4be637[_0x64cd('0x19')]};}):[]};}):[]};}):[]:[]})[_0x64cd('0x1e')](function(_0x392811){logger['info']('ShowTrunk',_0xe719b3);logger[_0x64cd('0xc')](_0x64cd('0x1f'),_0xe719b3,JSON[_0x64cd('0xe')](_0x392811));_0x5dfab0(_0x392811);})['catch'](function(_0x2a9311){logger[_0x64cd('0xf')](_0x64cd('0x1f'),_0x2a9311['message'],_0xe719b3);_0x1bb7ad(_0x34c021[_0x64cd('0xf')](0x1f4,_0x2a9311['message']));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index b60f456..9d82611 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 _0x9a80=['%s-%s','now','originalname','single','file','/:id/login','login','/:id/logout','/:id/pause','addTeams','addMailInteractions','addFaxInteractions','/:id/sms_interactions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','/:id/openchannel_accounts','addOpenchannelAccounts','addChatWebsites','/:id/whatsapp_accounts','addSquareProjects','createApiKey','/:id','update','put','/:id/password','changePassword','delete','removeQueues','removeTeams','destroy','/:id/chat_interactions','/:id/fax_interactions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','removeApiKey','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./user.controller','get','isAuthenticated','/describe','describe','/presence','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','getVoiceQueuesRt','getGroups','getRecordings','/:id/screen_recordings','/:id/chat/interactions','/:id/openchannel/interactions','getOpenchannelInteractions','getMailInteractions','/:id/sms/interactions','/:id/fax/interactions','getFaxInteractions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','getWhatsappAccounts','/:id/square_projects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','addContacts','post','bulkCreate','/:id/queues','addQueues','diskStorage','join','root','server/files/images/','format'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x9a80,0x109));var _0x09a8=function(_0x56c446,_0xdb355a){_0x56c446=_0x56c446-0x0;var _0x4da4d1=_0x9a80[_0x56c446];return _0x4da4d1;};'use strict';var multer=require('multer');var util=require(_0x09a8('0x0'));var path=require(_0x09a8('0x1'));var timeout=require(_0x09a8('0x2'));var express=require(_0x09a8('0x3'));var router=express[_0x09a8('0x4')]();var fs_extra=require(_0x09a8('0x5'));var auth=require(_0x09a8('0x6'));var interaction=require(_0x09a8('0x7'));var config=require('../../config/environment');var controller=require(_0x09a8('0x8'));router[_0x09a8('0x9')]('/',auth[_0x09a8('0xa')](),controller['index']);router[_0x09a8('0x9')](_0x09a8('0xb'),auth[_0x09a8('0xa')](),controller[_0x09a8('0xc')]);router[_0x09a8('0x9')]('/whoami',auth[_0x09a8('0xa')](),controller['whoami']);router[_0x09a8('0x9')](_0x09a8('0xd'),auth[_0x09a8('0xa')](),controller['getPresence']);router[_0x09a8('0x9')]('/:id',auth[_0x09a8('0xa')](),controller[_0x09a8('0xe')]);router['get'](_0x09a8('0xf'),controller[_0x09a8('0x10')]);router['get'](_0x09a8('0x11'),auth[_0x09a8('0xa')](),controller[_0x09a8('0x12')]);router['get'](_0x09a8('0x13'),auth[_0x09a8('0xa')](),controller[_0x09a8('0x14')]);router[_0x09a8('0x9')]('/:id/queues',auth[_0x09a8('0xa')](),controller['getQueues']);router['get']('/:id/queues_rt',auth[_0x09a8('0xa')](),controller[_0x09a8('0x15')]);router[_0x09a8('0x9')]('/:id/groups',auth[_0x09a8('0xa')](),controller[_0x09a8('0x16')]);router[_0x09a8('0x9')]('/:id/recordings',auth['isAuthenticated'](),controller[_0x09a8('0x17')]);router['get'](_0x09a8('0x18'),auth[_0x09a8('0xa')](),controller['getScreenRecordings']);router['get'](_0x09a8('0x19'),auth['isAuthenticated'](),controller['getChatInteractions']);router[_0x09a8('0x9')](_0x09a8('0x1a'),auth['isAuthenticated'](),controller[_0x09a8('0x1b')]);router[_0x09a8('0x9')]('/:id/mail/interactions',auth[_0x09a8('0xa')](),controller[_0x09a8('0x1c')]);router[_0x09a8('0x9')](_0x09a8('0x1d'),auth[_0x09a8('0xa')](),controller['getSmsInteractions']);router[_0x09a8('0x9')](_0x09a8('0x1e'),auth['isAuthenticated'](),controller[_0x09a8('0x1f')]);router[_0x09a8('0x9')]('/:id/whatsapp/interactions',auth[_0x09a8('0xa')](),controller[_0x09a8('0x20')]);router[_0x09a8('0x9')](_0x09a8('0x21'),auth[_0x09a8('0xa')](),controller[_0x09a8('0x22')]);router[_0x09a8('0x9')](_0x09a8('0x23'),auth[_0x09a8('0xa')](),controller[_0x09a8('0x24')]);router[_0x09a8('0x9')](_0x09a8('0x25'),auth[_0x09a8('0xa')](),controller['getAgents']);router[_0x09a8('0x9')](_0x09a8('0x26'),auth[_0x09a8('0xa')](),controller[_0x09a8('0x27')]);router['get'](_0x09a8('0x28'),auth[_0x09a8('0xa')](),controller[_0x09a8('0x29')]);router[_0x09a8('0x9')](_0x09a8('0x2a'),auth['isAuthenticated'](),controller[_0x09a8('0x2b')]);router[_0x09a8('0x9')]('/:id/openchannel_accounts',auth[_0x09a8('0xa')](),controller[_0x09a8('0x2c')]);router['get'](_0x09a8('0x2d'),auth[_0x09a8('0xa')](),controller[_0x09a8('0x2e')]);router['get'](_0x09a8('0x2f'),auth[_0x09a8('0xa')](),controller[_0x09a8('0x30')]);router[_0x09a8('0x9')]('/:id/whatsapp_accounts',auth[_0x09a8('0xa')](),controller[_0x09a8('0x31')]);router[_0x09a8('0x9')](_0x09a8('0x32'),auth['isAuthenticated'](),controller['getSquareProjects']);router[_0x09a8('0x9')](_0x09a8('0x33'),auth[_0x09a8('0xa')](),controller[_0x09a8('0x34')]);router[_0x09a8('0x9')](_0x09a8('0x35'),auth[_0x09a8('0xa')](),controller[_0x09a8('0x36')]);router['post']('/:id/contacts',auth[_0x09a8('0xa')](),controller[_0x09a8('0x37')]);router['post']('/',auth[_0x09a8('0xa')](),controller['create']);router[_0x09a8('0x38')]('/create_many',auth[_0x09a8('0xa')](),controller[_0x09a8('0x39')]);router[_0x09a8('0x38')](_0x09a8('0x3a'),auth[_0x09a8('0xa')](),controller[_0x09a8('0x3b')]);var upload=multer({'storage':multer[_0x09a8('0x3c')]({'destination':function(_0x17bbab,_0x27501b,_0x2ba23c){_0x2ba23c(null,path[_0x09a8('0x3d')](config[_0x09a8('0x3e')],_0x09a8('0x3f')));},'filename':function(_0x435010,_0x13de17,_0x4790c2){_0x4790c2(null,util[_0x09a8('0x40')](_0x09a8('0x41'),Date[_0x09a8('0x42')](),_0x13de17[_0x09a8('0x43')]));}})});router[_0x09a8('0x38')](_0x09a8('0xf'),upload[_0x09a8('0x44')](_0x09a8('0x45')),controller['addAvatar']);router[_0x09a8('0x38')](_0x09a8('0x46'),auth[_0x09a8('0xa')](),controller[_0x09a8('0x47')]);router[_0x09a8('0x38')](_0x09a8('0x48'),auth[_0x09a8('0xa')](),controller['logout']);router[_0x09a8('0x38')](_0x09a8('0x49'),auth[_0x09a8('0xa')](),controller['pause']);router[_0x09a8('0x38')]('/:id/unpause',auth[_0x09a8('0xa')](),controller['unpause']);router['post'](_0x09a8('0x21'),auth[_0x09a8('0xa')](),controller[_0x09a8('0x4a')]);router[_0x09a8('0x38')]('/:id/chat_interactions',auth[_0x09a8('0xa')](),controller['addChatInteractions']);router[_0x09a8('0x38')]('/:id/mail_interactions',auth[_0x09a8('0xa')](),controller[_0x09a8('0x4b')]);router[_0x09a8('0x38')]('/:id/fax_interactions',auth[_0x09a8('0xa')](),controller[_0x09a8('0x4c')]);router[_0x09a8('0x38')](_0x09a8('0x4d'),auth[_0x09a8('0xa')](),controller['addSmsInteractions']);router['post'](_0x09a8('0x4e'),auth['isAuthenticated'](),controller[_0x09a8('0x4f')]);router[_0x09a8('0x38')](_0x09a8('0x50'),auth['isAuthenticated'](),controller[_0x09a8('0x51')]);router['post'](_0x09a8('0x28'),auth[_0x09a8('0xa')](),controller[_0x09a8('0x52')]);router[_0x09a8('0x38')](_0x09a8('0x2a'),auth['isAuthenticated'](),controller[_0x09a8('0x53')]);router['post'](_0x09a8('0x54'),auth[_0x09a8('0xa')](),controller[_0x09a8('0x55')]);router[_0x09a8('0x38')](_0x09a8('0x2d'),auth[_0x09a8('0xa')](),controller['addSmsAccounts']);router[_0x09a8('0x38')](_0x09a8('0x2f'),auth[_0x09a8('0xa')](),controller[_0x09a8('0x56')]);router[_0x09a8('0x38')](_0x09a8('0x57'),auth[_0x09a8('0xa')](),controller['addWhatsappAccounts']);router['post'](_0x09a8('0x32'),auth[_0x09a8('0xa')](),controller[_0x09a8('0x58')]);router[_0x09a8('0x38')]('/:id/api_key',auth[_0x09a8('0xa')](),controller[_0x09a8('0x59')]);router['put'](_0x09a8('0x5a'),auth[_0x09a8('0xa')](),controller[_0x09a8('0x5b')]);router[_0x09a8('0x5c')](_0x09a8('0x5d'),auth['isAuthenticated'](),controller[_0x09a8('0x5e')]);router[_0x09a8('0x5f')](_0x09a8('0x3a'),auth[_0x09a8('0xa')](),controller[_0x09a8('0x60')]);router[_0x09a8('0x5f')]('/:id/teams',auth[_0x09a8('0xa')](),controller[_0x09a8('0x61')]);router[_0x09a8('0x5f')](_0x09a8('0x5a'),auth['isAuthenticated'](),controller[_0x09a8('0x62')]);router[_0x09a8('0x5f')](_0x09a8('0x63'),auth[_0x09a8('0xa')](),controller['removeChatInteractions']);router[_0x09a8('0x5f')]('/:id/mail_interactions',auth[_0x09a8('0xa')](),controller['removeMailInteractions']);router['delete'](_0x09a8('0x64'),auth[_0x09a8('0xa')](),controller['removeFaxInteractions']);router['delete'](_0x09a8('0x4d'),auth[_0x09a8('0xa')](),controller['removeSmsInteractions']);router[_0x09a8('0x5f')](_0x09a8('0x4e'),auth[_0x09a8('0xa')](),controller['removeOpenchannelInteractions']);router[_0x09a8('0x5f')]('/:id/whatsapp_interactions',auth['isAuthenticated'](),controller['removeWhatsappInteractions']);router[_0x09a8('0x5f')](_0x09a8('0x28'),auth[_0x09a8('0xa')](),controller[_0x09a8('0x65')]);router[_0x09a8('0x5f')](_0x09a8('0x2a'),auth[_0x09a8('0xa')](),controller[_0x09a8('0x66')]);router[_0x09a8('0x5f')](_0x09a8('0x54'),auth[_0x09a8('0xa')](),controller[_0x09a8('0x67')]);router['delete'](_0x09a8('0x2d'),auth[_0x09a8('0xa')](),controller[_0x09a8('0x68')]);router[_0x09a8('0x5f')](_0x09a8('0x2f'),auth[_0x09a8('0xa')](),controller[_0x09a8('0x69')]);router[_0x09a8('0x5f')]('/:id/whatsapp_accounts',auth[_0x09a8('0xa')](),controller[_0x09a8('0x6a')]);router[_0x09a8('0x5f')](_0x09a8('0x32'),auth[_0x09a8('0xa')](),controller[_0x09a8('0x6b')]);router[_0x09a8('0x5f')](_0x09a8('0x35'),auth[_0x09a8('0xa')](),controller[_0x09a8('0x6c')]);module[_0x09a8('0x6d')]=router; \ No newline at end of file +var _0xa005=['originalname','file','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','/:id/teams','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addWhatsappInteractions','addFaxAccounts','/:id/mail_accounts','/:id/openchannel_accounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','addSquareProjects','/:id/api_key','createApiKey','put','/:id','delete','removeQueues','removeTeams','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','/:id/whatsapp_interactions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeSmsAccounts','removeChatWebsites','removeSquareProjects','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','whoami','/presence','getPresence','show','/:id/avatar','getAvatar','getOpenTabs','/:id/contacts','getContacts','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','getTeams','getLists','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getOpenchannelAccounts','/:id/sms_accounts','/:id/chat_websites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','getScheduledCalls','getApiKey','post','addContacts','create','/create_many','/:id/queues','addQueues','join','server/files/images/','format','%s-%s','now'];(function(_0x365d50,_0x11f4ee){var _0x5c2d23=function(_0x624e9d){while(--_0x624e9d){_0x365d50['push'](_0x365d50['shift']());}};_0x5c2d23(++_0x11f4ee);}(_0xa005,0x18e));var _0x5a00=function(_0x53a7a8,_0xed2bff){_0x53a7a8=_0x53a7a8-0x0;var _0x555f71=_0xa005[_0x53a7a8];return _0x555f71;};'use strict';var multer=require(_0x5a00('0x0'));var util=require(_0x5a00('0x1'));var path=require(_0x5a00('0x2'));var timeout=require(_0x5a00('0x3'));var express=require(_0x5a00('0x4'));var router=express[_0x5a00('0x5')]();var fs_extra=require(_0x5a00('0x6'));var auth=require(_0x5a00('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x5a00('0x8'));var controller=require(_0x5a00('0x9'));router[_0x5a00('0xa')]('/',auth[_0x5a00('0xb')](),controller[_0x5a00('0xc')]);router['get'](_0x5a00('0xd'),auth[_0x5a00('0xb')](),controller[_0x5a00('0xe')]);router[_0x5a00('0xa')]('/whoami',auth[_0x5a00('0xb')](),controller[_0x5a00('0xf')]);router[_0x5a00('0xa')](_0x5a00('0x10'),auth[_0x5a00('0xb')](),controller[_0x5a00('0x11')]);router[_0x5a00('0xa')]('/:id',auth[_0x5a00('0xb')](),controller[_0x5a00('0x12')]);router[_0x5a00('0xa')](_0x5a00('0x13'),controller[_0x5a00('0x14')]);router[_0x5a00('0xa')]('/:id/open_tabs',auth[_0x5a00('0xb')](),controller[_0x5a00('0x15')]);router[_0x5a00('0xa')](_0x5a00('0x16'),auth[_0x5a00('0xb')](),controller[_0x5a00('0x17')]);router[_0x5a00('0xa')]('/:id/queues',auth['isAuthenticated'](),controller[_0x5a00('0x18')]);router[_0x5a00('0xa')](_0x5a00('0x19'),auth[_0x5a00('0xb')](),controller[_0x5a00('0x1a')]);router['get']('/:id/groups',auth['isAuthenticated'](),controller['getGroups']);router['get']('/:id/recordings',auth[_0x5a00('0xb')](),controller['getRecordings']);router[_0x5a00('0xa')](_0x5a00('0x1b'),auth['isAuthenticated'](),controller[_0x5a00('0x1c')]);router['get'](_0x5a00('0x1d'),auth[_0x5a00('0xb')](),controller[_0x5a00('0x1e')]);router[_0x5a00('0xa')](_0x5a00('0x1f'),auth['isAuthenticated'](),controller[_0x5a00('0x20')]);router[_0x5a00('0xa')](_0x5a00('0x21'),auth[_0x5a00('0xb')](),controller['getMailInteractions']);router[_0x5a00('0xa')](_0x5a00('0x22'),auth['isAuthenticated'](),controller[_0x5a00('0x23')]);router[_0x5a00('0xa')](_0x5a00('0x24'),auth[_0x5a00('0xb')](),controller[_0x5a00('0x25')]);router[_0x5a00('0xa')](_0x5a00('0x26'),auth[_0x5a00('0xb')](),controller[_0x5a00('0x27')]);router['get']('/:id/teams',auth['isAuthenticated'](),controller[_0x5a00('0x28')]);router[_0x5a00('0xa')]('/:id/lists',auth[_0x5a00('0xb')](),controller[_0x5a00('0x29')]);router[_0x5a00('0xa')]('/:id/agents',auth[_0x5a00('0xb')](),controller[_0x5a00('0x2a')]);router[_0x5a00('0xa')](_0x5a00('0x2b'),auth[_0x5a00('0xb')](),controller[_0x5a00('0x2c')]);router[_0x5a00('0xa')](_0x5a00('0x2d'),auth[_0x5a00('0xb')](),controller['getFaxAccounts']);router[_0x5a00('0xa')]('/:id/mail_accounts',auth[_0x5a00('0xb')](),controller['getMailAccounts']);router['get']('/:id/openchannel_accounts',auth['isAuthenticated'](),controller[_0x5a00('0x2e')]);router[_0x5a00('0xa')](_0x5a00('0x2f'),auth[_0x5a00('0xb')](),controller['getSmsAccounts']);router['get'](_0x5a00('0x30'),auth[_0x5a00('0xb')](),controller['getChatWebsites']);router[_0x5a00('0xa')](_0x5a00('0x31'),auth[_0x5a00('0xb')](),controller[_0x5a00('0x32')]);router['get'](_0x5a00('0x33'),auth[_0x5a00('0xb')](),controller[_0x5a00('0x34')]);router[_0x5a00('0xa')]('/:id/scheduled_calls',auth[_0x5a00('0xb')](),controller[_0x5a00('0x35')]);router[_0x5a00('0xa')]('/:id/api_key',auth[_0x5a00('0xb')](),controller[_0x5a00('0x36')]);router[_0x5a00('0x37')](_0x5a00('0x16'),auth[_0x5a00('0xb')](),controller[_0x5a00('0x38')]);router[_0x5a00('0x37')]('/',auth['isAuthenticated'](),controller[_0x5a00('0x39')]);router[_0x5a00('0x37')](_0x5a00('0x3a'),auth['isAuthenticated'](),controller['bulkCreate']);router[_0x5a00('0x37')](_0x5a00('0x3b'),auth['isAuthenticated'](),controller[_0x5a00('0x3c')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5a25ae,_0x310bb4,_0x4bae14){_0x4bae14(null,path[_0x5a00('0x3d')](config['root'],_0x5a00('0x3e')));},'filename':function(_0x4137cc,_0x27f71e,_0x4e2eab){_0x4e2eab(null,util[_0x5a00('0x3f')](_0x5a00('0x40'),Date[_0x5a00('0x41')](),_0x27f71e[_0x5a00('0x42')]));}})});router[_0x5a00('0x37')](_0x5a00('0x13'),upload['single'](_0x5a00('0x43')),controller[_0x5a00('0x44')]);router[_0x5a00('0x37')](_0x5a00('0x45'),auth['isAuthenticated'](),controller[_0x5a00('0x46')]);router[_0x5a00('0x37')](_0x5a00('0x47'),auth[_0x5a00('0xb')](),controller[_0x5a00('0x48')]);router[_0x5a00('0x37')](_0x5a00('0x49'),auth['isAuthenticated'](),controller[_0x5a00('0x4a')]);router['post'](_0x5a00('0x4b'),auth[_0x5a00('0xb')](),controller[_0x5a00('0x4c')]);router['post'](_0x5a00('0x4d'),auth['isAuthenticated'](),controller[_0x5a00('0x4e')]);router[_0x5a00('0x37')](_0x5a00('0x4f'),auth[_0x5a00('0xb')](),controller[_0x5a00('0x50')]);router[_0x5a00('0x37')](_0x5a00('0x51'),auth[_0x5a00('0xb')](),controller[_0x5a00('0x52')]);router['post'](_0x5a00('0x53'),auth[_0x5a00('0xb')](),controller[_0x5a00('0x54')]);router['post']('/:id/sms_interactions',auth[_0x5a00('0xb')](),controller[_0x5a00('0x55')]);router[_0x5a00('0x37')](_0x5a00('0x56'),auth['isAuthenticated'](),controller[_0x5a00('0x57')]);router[_0x5a00('0x37')]('/:id/whatsapp_interactions',auth[_0x5a00('0xb')](),controller[_0x5a00('0x58')]);router[_0x5a00('0x37')]('/:id/fax_accounts',auth[_0x5a00('0xb')](),controller[_0x5a00('0x59')]);router['post'](_0x5a00('0x5a'),auth[_0x5a00('0xb')](),controller['addMailAccounts']);router['post'](_0x5a00('0x5b'),auth[_0x5a00('0xb')](),controller[_0x5a00('0x5c')]);router[_0x5a00('0x37')](_0x5a00('0x2f'),auth[_0x5a00('0xb')](),controller[_0x5a00('0x5d')]);router[_0x5a00('0x37')](_0x5a00('0x30'),auth[_0x5a00('0xb')](),controller[_0x5a00('0x5e')]);router[_0x5a00('0x37')](_0x5a00('0x31'),auth[_0x5a00('0xb')](),controller[_0x5a00('0x5f')]);router[_0x5a00('0x37')](_0x5a00('0x33'),auth[_0x5a00('0xb')](),controller[_0x5a00('0x60')]);router[_0x5a00('0x37')](_0x5a00('0x61'),auth[_0x5a00('0xb')](),controller[_0x5a00('0x62')]);router[_0x5a00('0x63')](_0x5a00('0x64'),auth[_0x5a00('0xb')](),controller['update']);router['put']('/:id/password',auth['isAuthenticated'](),controller['changePassword']);router[_0x5a00('0x65')](_0x5a00('0x3b'),auth[_0x5a00('0xb')](),controller[_0x5a00('0x66')]);router['delete']('/:id/teams',auth[_0x5a00('0xb')](),controller[_0x5a00('0x67')]);router[_0x5a00('0x65')](_0x5a00('0x64'),auth[_0x5a00('0xb')](),controller['destroy']);router[_0x5a00('0x65')]('/:id/chat_interactions',auth[_0x5a00('0xb')](),controller[_0x5a00('0x68')]);router[_0x5a00('0x65')](_0x5a00('0x51'),auth['isAuthenticated'](),controller[_0x5a00('0x69')]);router[_0x5a00('0x65')]('/:id/fax_interactions',auth[_0x5a00('0xb')](),controller[_0x5a00('0x6a')]);router[_0x5a00('0x65')]('/:id/sms_interactions',auth[_0x5a00('0xb')](),controller[_0x5a00('0x6b')]);router[_0x5a00('0x65')](_0x5a00('0x56'),auth[_0x5a00('0xb')](),controller['removeOpenchannelInteractions']);router[_0x5a00('0x65')](_0x5a00('0x6c'),auth['isAuthenticated'](),controller[_0x5a00('0x6d')]);router[_0x5a00('0x65')](_0x5a00('0x2d'),auth[_0x5a00('0xb')](),controller[_0x5a00('0x6e')]);router[_0x5a00('0x65')](_0x5a00('0x5a'),auth['isAuthenticated'](),controller[_0x5a00('0x6f')]);router['delete'](_0x5a00('0x5b'),auth[_0x5a00('0xb')](),controller['removeOpenchannelAccounts']);router[_0x5a00('0x65')](_0x5a00('0x2f'),auth['isAuthenticated'](),controller[_0x5a00('0x70')]);router[_0x5a00('0x65')](_0x5a00('0x30'),auth[_0x5a00('0xb')](),controller[_0x5a00('0x71')]);router[_0x5a00('0x65')]('/:id/whatsapp_accounts',auth[_0x5a00('0xb')](),controller['removeWhatsappAccounts']);router[_0x5a00('0x65')](_0x5a00('0x33'),auth[_0x5a00('0xb')](),controller[_0x5a00('0x72')]);router['delete'](_0x5a00('0x61'),auth[_0x5a00('0xb')](),controller['removeApiKey']);module[_0x5a00('0x73')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 53885f0..7a61206 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 _0xfe63=['ENUM','admin','user','agent','telephone','INTEGER','internal','BOOLEAN','DEFAULT\x20PAUSE','dynamic','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','yes','nonat','outgoing','force_rport,comedia','nat','all','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','accept','refuse','originate','uac','uas','fingerprint','active','passive','update','update,nonat','DATE','TEXT','isArray','udp','encryption','avpf','icesupport','dtlsenable','dtlssetup','dtlsprivatekey','rtcp_mux','wss','force_avp','dtlsverify','actpass','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','sequelize','moment','lodash','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','callerid','format','\x22%s\x22\x20<%s>','getDataValue','email','toLowerCase'];(function(_0x408d10,_0x56f1d8){var _0x4aca55=function(_0x184e85){while(--_0x184e85){_0x408d10['push'](_0x408d10['shift']());}};_0x4aca55(++_0x56f1d8);}(_0xfe63,0x1b8));var _0x3fe6=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xfe63[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0x3fe6('0x0'));var moment=require(_0x3fe6('0x1'));var util=require('util');var _=require(_0x3fe6('0x2'));module[_0x3fe6('0x3')]={'name':{'type':Sequelize[_0x3fe6('0x4')],'allowNull':![],'unique':_0x3fe6('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0xa0716b){this[_0x3fe6('0x6')](_0x3fe6('0x5'),_0xa0716b);this['setDataValue'](_0x3fe6('0x7'),_0xa0716b);},'comment':_0x3fe6('0x8')},'fullname':{'type':Sequelize[_0x3fe6('0x4')],'allowNull':![],'set':function(_0x4fcad7){this[_0x3fe6('0x6')]('fullname',_0x4fcad7);this[_0x3fe6('0x6')](_0x3fe6('0x9'),util[_0x3fe6('0xa')](_0x3fe6('0xb'),_0x4fcad7,this[_0x3fe6('0xc')]('internal')));}},'alias':{'type':Sequelize[_0x3fe6('0x4')]},'email':{'type':Sequelize[_0x3fe6('0x4')],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x4706a9){if(_0x4706a9){this[_0x3fe6('0x6')](_0x3fe6('0xd'),_0x4706a9[_0x3fe6('0xe')]());}}},'role':{'type':Sequelize[_0x3fe6('0xf')](_0x3fe6('0x10'),_0x3fe6('0x11'),_0x3fe6('0x12'),_0x3fe6('0x13')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':'local'},'internal':{'type':Sequelize[_0x3fe6('0x14')](0xb),'allowNull':![],'unique':_0x3fe6('0x15'),'set':function(_0x36d9e9){this['setDataValue'](_0x3fe6('0x15'),_0x36d9e9);this[_0x3fe6('0x6')]('accountcode',_0x36d9e9);this[_0x3fe6('0x6')](_0x3fe6('0x9'),util[_0x3fe6('0xa')]('\x22%s\x22\x20<%s>',this[_0x3fe6('0xc')]('fullname'),_0x36d9e9));}},'salt':{'type':Sequelize[_0x3fe6('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x3fe6('0x4')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize[_0x3fe6('0x4')]},'userpic':{'type':Sequelize[_0x3fe6('0x4')]},'city':{'type':Sequelize[_0x3fe6('0x4')]},'country':{'type':Sequelize[_0x3fe6('0x4')]},'online':{'type':Sequelize[_0x3fe6('0x16')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x3fe6('0x16')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x3fe6('0x16')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x3fe6('0x16')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x3fe6('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x3fe6('0x4')],'defaultValue':_0x3fe6('0x17')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x3fe6('0x14')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x3fe6('0x14')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x3fe6('0x14')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x3fe6('0x14')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x3fe6('0x14')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x3fe6('0x14')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x3fe6('0x16')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x3fe6('0x16')],'defaultValue':![]},'description':{'type':Sequelize[_0x3fe6('0x4')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x3fe6('0x18')},'ipaddr':{'type':Sequelize[_0x3fe6('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0x3fe6('0x14')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x3fe6('0x14')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x3fe6('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x3fe6('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x3fe6('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x3fe6('0x14')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x3fe6('0xf')](_0x3fe6('0x19'),_0x3fe6('0x11'),'peer'),'allowNull':!![],'defaultValue':_0x3fe6('0x19')},'context':{'type':Sequelize[_0x3fe6('0x4')],'allowNull':!![],'defaultValue':_0x3fe6('0x1a')},'callingpres':{'type':Sequelize['ENUM'](_0x3fe6('0x1b'),_0x3fe6('0x1c'),_0x3fe6('0x1d'),_0x3fe6('0x1e'),_0x3fe6('0x1f'),_0x3fe6('0x20'),_0x3fe6('0x21'),_0x3fe6('0x22')),'allowNull':!![]},'deny':{'type':Sequelize[_0x3fe6('0x4')],'allowNull':!![]},'permit':{'type':Sequelize[_0x3fe6('0x4')],'allowNull':!![]},'secret':{'type':Sequelize[_0x3fe6('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x3fe6('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0x3fe6('0x4')],'allowNull':!![],'defaultValue':'udp','set':function(_0x196014){this['setDataValue'](_0x3fe6('0x23'),_0x196014?_0x196014[_0x3fe6('0x24')](','):null);},'get':function(){return this[_0x3fe6('0xc')]('transport')?this[_0x3fe6('0xc')](_0x3fe6('0x23'))[_0x3fe6('0x25')](','):null;},'comment':_0x3fe6('0x26')},'dtmfmode':{'type':Sequelize[_0x3fe6('0xf')](_0x3fe6('0x27'),_0x3fe6('0x28'),_0x3fe6('0x29'),'inband','auto'),'allowNull':!![],'defaultValue':_0x3fe6('0x27')},'directmedia':{'type':Sequelize[_0x3fe6('0xf')](_0x3fe6('0x2a'),'no',_0x3fe6('0x2b'),'update',_0x3fe6('0x2c')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x3fe6('0xf')](_0x3fe6('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x3fe6('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x3fe6('0x4')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x3fe6('0x2d'),'set':function(_0x1b210b){this[_0x3fe6('0x6')](_0x3fe6('0x2e'),_0x1b210b?_0x1b210b[_0x3fe6('0x24')](','):null);},'get':function(){return this[_0x3fe6('0xc')](_0x3fe6('0x2e'))?this[_0x3fe6('0xc')]('nat')[_0x3fe6('0x25')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x3fe6('0x4')]},'namedcallgroup':{'type':Sequelize[_0x3fe6('0x4')]},'pickupgroup':{'type':Sequelize[_0x3fe6('0x4')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x3fe6('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x3fe6('0x4')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3fe6('0x2f')},'allow':{'type':Sequelize[_0x3fe6('0x4')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x12411c){this[_0x3fe6('0x6')]('allow',_0x12411c?_0x12411c[_0x3fe6('0x24')](';'):'ulaw;alaw;gsm');},'get':function(){return this['getDataValue'](_0x3fe6('0x30'))?this['getDataValue'](_0x3fe6('0x30'))[_0x3fe6('0x25')](';'):null;},'comment':_0x3fe6('0x31')},'autoframing':{'type':Sequelize[_0x3fe6('0xf')](_0x3fe6('0x2a'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x3fe6('0x4')],'allowNull':!![],'set':function(_0x398953){this['setDataValue']('insecure',_0x398953?_0x398953[_0x3fe6('0x24')](','):null);},'get':function(){return this[_0x3fe6('0xc')](_0x3fe6('0x32'))?this['getDataValue'](_0x3fe6('0x32'))['split'](','):null;},'comment':_0x3fe6('0x33')},'trustrpid':{'type':Sequelize[_0x3fe6('0xf')](_0x3fe6('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x3fe6('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x3fe6('0xf')](_0x3fe6('0x2a'),'no',_0x3fe6('0x34')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x3fe6('0xf')](_0x3fe6('0x2a'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x3fe6('0xf')](_0x3fe6('0x2a'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x3fe6('0x14')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0x3fe6('0x4')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x3fe6('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x3fe6('0xf')](_0x3fe6('0x2a'),'no'),'allowNull':!![],'defaultValue':_0x3fe6('0x2a')},'busylevel':{'type':Sequelize[_0x3fe6('0x14')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0x3fe6('0x2a'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x3fe6('0xf')](_0x3fe6('0x2a'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x3fe6('0xf')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x3fe6('0xf')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x3fe6('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0x3fe6('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x3fe6('0xf')](_0x3fe6('0x2a'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x3fe6('0x14')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x3fe6('0xf')](_0x3fe6('0x2a'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x3fe6('0xf')](_0x3fe6('0x35'),_0x3fe6('0x36'),_0x3fe6('0x37')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x3fe6('0x14')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x3fe6('0x14')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0x3fe6('0x38'),_0x3fe6('0x39')),'allowNull':!![],'defaultValue':_0x3fe6('0x39')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0x3fe6('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x3fe6('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x3fe6('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x3fe6('0xf')]('yes','no'),'allowNull':!![],'defaultValue':_0x3fe6('0x2a')},'keepalive':{'type':Sequelize[_0x3fe6('0x14')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x3fe6('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x3fe6('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x3fe6('0x14')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x3fe6('0x14')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x3fe6('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0x3fe6('0x14')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x3fe6('0x14')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x3fe6('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x3fe6('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x3fe6('0x14')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x3fe6('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x3fe6('0x2a'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x3fe6('0xf')](_0x3fe6('0x2a'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x3fe6('0xf')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x3fe6('0x2a'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x3fe6('0xf')](_0x3fe6('0x2a'),'no',_0x3fe6('0x3a'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x3fe6('0x14')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x3fe6('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x3fe6('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x3fe6('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x3fe6('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM'](_0x3fe6('0x3b'),_0x3fe6('0x3c'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x3fe6('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0x3fe6('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x3fe6('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x3fe6('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x3fe6('0xf')](_0x3fe6('0x2a'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x3fe6('0xf')](_0x3fe6('0x2a'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x3fe6('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x3fe6('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x3fe6('0xf')]('yes','no',_0x3fe6('0x2b'),_0x3fe6('0x3d'),_0x3fe6('0x3e')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x3fe6('0x16')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x3fe6('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0x3fe6('0x3f')]},'passwordResetAt':{'type':Sequelize[_0x3fe6('0x3f')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x3fe6('0x40')]},'showWebBar':{'type':Sequelize[_0x3fe6('0x14')],'defaultValue':0x0,'set':function(_0x351b6f){this[_0x3fe6('0x6')]('showWebBar',_0x351b6f);var _0x170912=this['get']({'plain':!![]});switch(_0x351b6f){case 0x0:case 0x1:var _0x1b1c89=_0x170912[_0x3fe6('0x23')]?_[_0x3fe6('0x41')](_0x170912['transport'])?_0x170912[_0x3fe6('0x23')][_0x3fe6('0x24')]():_0x170912[_0x3fe6('0x23')]:_0x3fe6('0x42');if(_0x1b1c89==='wss'){_0x1b1c89=_0x3fe6('0x42');}this['setDataValue'](_0x3fe6('0x23'),_0x1b1c89);this[_0x3fe6('0x6')](_0x3fe6('0x43'),'no');this['setDataValue'](_0x3fe6('0x44'),null);this['setDataValue']('force_avp',null);this['setDataValue'](_0x3fe6('0x45'),null);this['setDataValue'](_0x3fe6('0x46'),null);this[_0x3fe6('0x6')]('dtlsverify',null);this[_0x3fe6('0x6')](_0x3fe6('0x47'),null);this[_0x3fe6('0x6')]('dtlscertfile',null);this[_0x3fe6('0x6')](_0x3fe6('0x48'),null);this[_0x3fe6('0x6')](_0x3fe6('0x49'),'no');break;case 0x2:this['setDataValue'](_0x3fe6('0x23'),_0x3fe6('0x4a'));this[_0x3fe6('0x6')](_0x3fe6('0x43'),_0x3fe6('0x2a'));this[_0x3fe6('0x6')]('avpf','yes');this['setDataValue'](_0x3fe6('0x4b'),'yes');this[_0x3fe6('0x6')](_0x3fe6('0x45'),_0x3fe6('0x2a'));this[_0x3fe6('0x6')](_0x3fe6('0x46'),_0x3fe6('0x2a'));this['setDataValue'](_0x3fe6('0x4c'),'no');this[_0x3fe6('0x6')](_0x3fe6('0x47'),_0x3fe6('0x4d'));this['setDataValue']('dtlscertfile',_0x170912[_0x3fe6('0x4e')]||_0x3fe6('0x4f'));this[_0x3fe6('0x6')](_0x3fe6('0x48'),_0x170912[_0x3fe6('0x48')]||_0x3fe6('0x50'));this['setDataValue']('rtcp_mux',_0x3fe6('0x2a'));break;default:}}},'permissions':{'type':Sequelize[_0x3fe6('0x40')],'set':function(_0x3be979){this['setDataValue'](_0x3fe6('0x51'),_0x3be979?_0x3be979['join'](','):[]);},'get':function(){return this[_0x3fe6('0xc')]('permissions')?_['map'](this['getDataValue']('permissions')[_0x3fe6('0x25')](','),function(_0x4773ff){return parseInt(_0x4773ff,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x3fe6('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x3fe6('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x3fe6('0x4')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x3fe6('0x16')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x3fe6('0x16')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x3fe6('0x16')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x3fe6('0x16')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x3fe6('0x14')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x3fe6('0x14')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x3fe6('0xf')](_0x3fe6('0x2a'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x3fe6('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0x3fe6('0x16')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x3fe6('0x16')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x3fe6('0x52')],'get':function(){return this[_0x3fe6('0xc')](_0x3fe6('0x53'))?this[_0x3fe6('0xc')](_0x3fe6('0x53')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x3fe6('0x16')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x3fe6('0x16')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x3fe6('0x16')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x3fe6('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x28d0e0){if(typeof _0x28d0e0===_0x3fe6('0x54')){var _0x4cb81c=_0x28d0e0==='1'?!![]:_0x28d0e0==='0'?![]:_0x28d0e0===_0x3fe6('0x55')?!![]:_0x28d0e0==='false'?![]:![];this[_0x3fe6('0x6')](_0x3fe6('0x56'),_0x4cb81c);}else{this[_0x3fe6('0x6')]('screenrecording',_0x28d0e0);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x9688c2){this[_0x3fe6('0x6')](_0x3fe6('0x57'),_0x9688c2);if(_0x9688c2===!![]){this[_0x3fe6('0x6')](_0x3fe6('0x58'),moment());this['setDataValue'](_0x3fe6('0x59'),0x0);}else{this[_0x3fe6('0x6')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0x3fe6('0x3f')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x3fe6('0x16')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x3fe6('0x14')](0x5)[_0x3fe6('0x5a')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x3fe6('0x16')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x3fe6('0x16')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x3fe6('0x16')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x3fe6('0x16')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x3fe6('0x16')],'defaultValue':![]}}; \ No newline at end of file +var _0x3cff=['STRING','name','defaultuser','fullname','callerid','\x22%s\x22\x20<%s>','internal','email','setDataValue','ENUM','admin','user','telephone','INTEGER','format','getDataValue','BOOLEAN','DATE','DEFAULT\x20PAUSE','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','join','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','\x22\x22\x20<>','always','accept','refuse','originate','uas','fingerprint','certificate','active','passive','TEXT','get','isArray','wss','encryption','avpf','icesupport','dtlsverify','dtlssetup','dtlsprivatekey','rtcp_mux','force_avp','dtlsenable','actpass','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','UNSIGNED','sequelize','moment','lodash','exports'];(function(_0x1484d6,_0x287c78){var _0xd03c54=function(_0x53c791){while(--_0x53c791){_0x1484d6['push'](_0x1484d6['shift']());}};_0xd03c54(++_0x287c78);}(_0x3cff,0x160));var _0xf3cf=function(_0x1635fe,_0x5f1d9f){_0x1635fe=_0x1635fe-0x0;var _0x3c512a=_0x3cff[_0x1635fe];return _0x3c512a;};'use strict';var Sequelize=require(_0xf3cf('0x0'));var moment=require(_0xf3cf('0x1'));var util=require('util');var _=require(_0xf3cf('0x2'));module[_0xf3cf('0x3')]={'name':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':![],'unique':_0xf3cf('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x2344c6){this['setDataValue'](_0xf3cf('0x5'),_0x2344c6);this['setDataValue'](_0xf3cf('0x6'),_0x2344c6);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':![],'set':function(_0x16d6b8){this['setDataValue'](_0xf3cf('0x7'),_0x16d6b8);this['setDataValue'](_0xf3cf('0x8'),util['format'](_0xf3cf('0x9'),_0x16d6b8,this['getDataValue'](_0xf3cf('0xa'))));}},'alias':{'type':Sequelize[_0xf3cf('0x4')]},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xf3cf('0xb'),'validate':{'isEmail':!![]},'set':function(_0x5a9b6a){if(_0x5a9b6a){this[_0xf3cf('0xc')](_0xf3cf('0xb'),_0x5a9b6a['toLowerCase']());}}},'role':{'type':Sequelize[_0xf3cf('0xd')](_0xf3cf('0xe'),_0xf3cf('0xf'),'agent',_0xf3cf('0x10')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':'local'},'internal':{'type':Sequelize[_0xf3cf('0x11')](0xb),'allowNull':![],'unique':_0xf3cf('0xa'),'set':function(_0x1fc8dc){this[_0xf3cf('0xc')](_0xf3cf('0xa'),_0x1fc8dc);this[_0xf3cf('0xc')]('accountcode',_0x1fc8dc);this[_0xf3cf('0xc')](_0xf3cf('0x8'),util[_0xf3cf('0x12')](_0xf3cf('0x9'),this[_0xf3cf('0x13')](_0xf3cf('0x7')),_0x1fc8dc));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xf3cf('0x4')]},'mobile':{'type':Sequelize[_0xf3cf('0x4')]},'address':{'type':Sequelize[_0xf3cf('0x4')]},'zipcode':{'type':Sequelize[_0xf3cf('0x4')]},'userpic':{'type':Sequelize[_0xf3cf('0x4')]},'city':{'type':Sequelize[_0xf3cf('0x4')]},'country':{'type':Sequelize[_0xf3cf('0x4')]},'online':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xf3cf('0x15')]},'voicePause':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xf3cf('0x4')],'defaultValue':_0xf3cf('0x16')},'lastPauseAt':{'type':Sequelize[_0xf3cf('0x15')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xf3cf('0x11')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xf3cf('0x11')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xf3cf('0x11')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xf3cf('0x11')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xf3cf('0x11')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xf3cf('0x11')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':![]},'description':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'host':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0xf3cf('0x11')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xf3cf('0x11')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0xf3cf('0x11')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xf3cf('0xd')]('friend',_0xf3cf('0xf'),'peer'),'allowNull':!![],'defaultValue':_0xf3cf('0x17')},'context':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![],'defaultValue':_0xf3cf('0x18')},'callingpres':{'type':Sequelize['ENUM'](_0xf3cf('0x19'),_0xf3cf('0x1a'),_0xf3cf('0x1b'),'ALLOWED',_0xf3cf('0x1c'),_0xf3cf('0x1d'),_0xf3cf('0x1e'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'permit':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'secret':{'type':Sequelize['STRING'],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![],'defaultValue':_0xf3cf('0x1f'),'set':function(_0x6810fd){this['setDataValue']('transport',_0x6810fd?_0x6810fd[_0xf3cf('0x20')](','):null);},'get':function(){return this['getDataValue'](_0xf3cf('0x21'))?this['getDataValue']('transport')['split'](','):null;},'comment':_0xf3cf('0x22')},'dtmfmode':{'type':Sequelize[_0xf3cf('0xd')](_0xf3cf('0x23'),_0xf3cf('0x24'),_0xf3cf('0x25'),_0xf3cf('0x26'),_0xf3cf('0x27')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM'](_0xf3cf('0x28'),'no',_0xf3cf('0x29'),_0xf3cf('0x2a'),_0xf3cf('0x2b')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0xf3cf('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![],'defaultValue':_0xf3cf('0x2c'),'set':function(_0x30b3a0){this[_0xf3cf('0xc')](_0xf3cf('0x2d'),_0x30b3a0?_0x30b3a0[_0xf3cf('0x20')](','):null);},'get':function(){return this['getDataValue'](_0xf3cf('0x2d'))?this[_0xf3cf('0x13')](_0xf3cf('0x2d'))[_0xf3cf('0x2e')](','):null;},'comment':_0xf3cf('0x2f')},'callgroup':{'type':Sequelize[_0xf3cf('0x4')]},'namedcallgroup':{'type':Sequelize[_0xf3cf('0x4')]},'pickupgroup':{'type':Sequelize[_0xf3cf('0x4')]},'namedpickupgroup':{'type':Sequelize[_0xf3cf('0x4')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xf3cf('0x4')]},'disallow':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':![],'defaultValue':_0xf3cf('0x30')},'allow':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x1eb49b){this['setDataValue'](_0xf3cf('0x31'),_0x1eb49b?_0x1eb49b['join'](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0xf3cf('0x13')](_0xf3cf('0x31'))?this[_0xf3cf('0x13')](_0xf3cf('0x31'))['split'](';'):null;},'comment':_0xf3cf('0x32')},'autoframing':{'type':Sequelize[_0xf3cf('0xd')](_0xf3cf('0x28'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![],'set':function(_0x5106bf){this['setDataValue'](_0xf3cf('0x33'),_0x5106bf?_0x5106bf['join'](','):null);},'get':function(){return this[_0xf3cf('0x13')](_0xf3cf('0x33'))?this[_0xf3cf('0x13')](_0xf3cf('0x33'))[_0xf3cf('0x2e')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0xf3cf('0xd')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xf3cf('0xd')](_0xf3cf('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xf3cf('0xd')]('yes','no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0xf3cf('0x28'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xf3cf('0xd')](_0xf3cf('0x28'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xf3cf('0x11')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xf3cf('0x34')},'amaflags':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xf3cf('0xd')](_0xf3cf('0x28'),'no'),'allowNull':!![],'defaultValue':_0xf3cf('0x28')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xf3cf('0xd')](_0xf3cf('0x28'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xf3cf('0xd')](_0xf3cf('0x28'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xf3cf('0xd')](_0xf3cf('0x28'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xf3cf('0xd')](_0xf3cf('0x28'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xf3cf('0xd')](_0xf3cf('0x28'),'no',_0xf3cf('0x35')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xf3cf('0x11')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0xf3cf('0x28'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0xf3cf('0x36'),_0xf3cf('0x37'),_0xf3cf('0x38')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xf3cf('0x11')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xf3cf('0xd')]('uac',_0xf3cf('0x39')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xf3cf('0xd')]('yes','no'),'allowNull':!![],'defaultValue':_0xf3cf('0x28')},'keepalive':{'type':Sequelize[_0xf3cf('0x11')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xf3cf('0x11')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xf3cf('0x11')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xf3cf('0x11')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xf3cf('0xd')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0xf3cf('0x11')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xf3cf('0x11')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xf3cf('0x11')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xf3cf('0xd')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xf3cf('0xd')](_0xf3cf('0x28'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xf3cf('0xd')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xf3cf('0xd')](_0xf3cf('0x28'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0xf3cf('0x28'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xf3cf('0xd')](_0xf3cf('0x28'),'no',_0xf3cf('0x3a'),_0xf3cf('0x3b')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xf3cf('0xd')](_0xf3cf('0x3c'),_0xf3cf('0x3d'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0xf3cf('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xf3cf('0x11')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xf3cf('0xd')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xf3cf('0xd')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0xf3cf('0x28'),'no',_0xf3cf('0x29'),'update','update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xf3cf('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0xf3cf('0x15')]},'passwordResetAt':{'type':Sequelize[_0xf3cf('0x15')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xf3cf('0x3e')]},'showWebBar':{'type':Sequelize[_0xf3cf('0x11')],'defaultValue':0x0,'set':function(_0x5eb0c2){this['setDataValue']('showWebBar',_0x5eb0c2);var _0x5deabb=this[_0xf3cf('0x3f')]({'plain':!![]});switch(_0x5eb0c2){case 0x0:case 0x1:var _0x41bef0=_0x5deabb[_0xf3cf('0x21')]?_[_0xf3cf('0x40')](_0x5deabb['transport'])?_0x5deabb[_0xf3cf('0x21')][_0xf3cf('0x20')]():_0x5deabb[_0xf3cf('0x21')]:_0xf3cf('0x1f');if(_0x41bef0===_0xf3cf('0x41')){_0x41bef0='udp';}this['setDataValue'](_0xf3cf('0x21'),_0x41bef0);this[_0xf3cf('0xc')](_0xf3cf('0x42'),'no');this['setDataValue'](_0xf3cf('0x43'),null);this[_0xf3cf('0xc')]('force_avp',null);this[_0xf3cf('0xc')](_0xf3cf('0x44'),null);this[_0xf3cf('0xc')]('dtlsenable',null);this['setDataValue'](_0xf3cf('0x45'),null);this['setDataValue'](_0xf3cf('0x46'),null);this[_0xf3cf('0xc')]('dtlscertfile',null);this[_0xf3cf('0xc')](_0xf3cf('0x47'),null);this[_0xf3cf('0xc')](_0xf3cf('0x48'),'no');break;case 0x2:this[_0xf3cf('0xc')](_0xf3cf('0x21'),_0xf3cf('0x41'));this[_0xf3cf('0xc')](_0xf3cf('0x42'),_0xf3cf('0x28'));this[_0xf3cf('0xc')](_0xf3cf('0x43'),'yes');this['setDataValue'](_0xf3cf('0x49'),'yes');this[_0xf3cf('0xc')](_0xf3cf('0x44'),'yes');this['setDataValue'](_0xf3cf('0x4a'),_0xf3cf('0x28'));this[_0xf3cf('0xc')](_0xf3cf('0x45'),'no');this[_0xf3cf('0xc')]('dtlssetup',_0xf3cf('0x4b'));this[_0xf3cf('0xc')](_0xf3cf('0x4c'),_0x5deabb['dtlscertfile']||_0xf3cf('0x4d'));this[_0xf3cf('0xc')](_0xf3cf('0x47'),_0x5deabb[_0xf3cf('0x47')]||_0xf3cf('0x4e'));this[_0xf3cf('0xc')](_0xf3cf('0x48'),'yes');break;default:}}},'permissions':{'type':Sequelize[_0xf3cf('0x3e')],'set':function(_0x571088){this[_0xf3cf('0xc')](_0xf3cf('0x4f'),_0x571088?_0x571088[_0xf3cf('0x20')](','):[]);},'get':function(){return this[_0xf3cf('0x13')](_0xf3cf('0x4f'))?_['map'](this['getDataValue'](_0xf3cf('0x4f'))[_0xf3cf('0x2e')](','),function(_0x340294){return parseInt(_0x340294,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xf3cf('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xf3cf('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0xf3cf('0x4')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xf3cf('0x11')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xf3cf('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xf3cf('0x11')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xf3cf('0xd')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xf3cf('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xf3cf('0x50')],'get':function(){return this[_0xf3cf('0x13')](_0xf3cf('0x51'))?this['getDataValue'](_0xf3cf('0x51')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':![]},'interface':{'type':Sequelize[_0xf3cf('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':![],'set':function(_0x42cd48){if(typeof _0x42cd48===_0xf3cf('0x52')){var _0x20f329=_0x42cd48==='1'?!![]:_0x42cd48==='0'?![]:_0x42cd48===_0xf3cf('0x53')?!![]:_0x42cd48===_0xf3cf('0x54')?![]:![];this['setDataValue'](_0xf3cf('0x55'),_0x20f329);}else{this[_0xf3cf('0xc')](_0xf3cf('0x55'),_0x42cd48);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x5949ea){this[_0xf3cf('0xc')](_0xf3cf('0x56'),_0x5949ea);if(_0x5949ea===!![]){this[_0xf3cf('0xc')](_0xf3cf('0x57'),moment());this[_0xf3cf('0xc')]('loginAttempts',0x0);}else{this[_0xf3cf('0xc')](_0xf3cf('0x57'),null);}}},'blockedAt':{'type':Sequelize[_0xf3cf('0x15')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':!![]},'wssPort':{'type':Sequelize['INTEGER'](0x5)[_0xf3cf('0x58')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 194f190..1a59ab8 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 _0xfcf0=['SELECT','from','mailbox','VoiceMail','fullname','email','permissions','102','113','104','105','106','107','108','100','111','114','115','create','user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Unauthorized','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','UserProfileSection','isEmpty','compact','changePassword','newPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','oldPassword','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','enforcePasswordHistory','previousPasswords','validatePasswordHistory','passwordHistoryLimit','updatePasswordsHistory','addQueues','online','loginInPause','voicePause','isValidChannel','add','capitalize','toLowerCase','penalty','spread','QueueId','emit','Queue:save','VoiceQueue','interface','SIP/%s','UserVoiceQueueRt','upsert','channel','Unknown\x20channel','remove','Queues','isArray','Queue:remove','voice','addAvatar','filename','getAvatar','server/files/images/logos/default_profile.png','userpic','download','join','root','server/files/images/','getOpenTabs','ChatOpenTabs','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','getContacts','findOne','sort','where','pick','options','hasOwnProperty','CmList','Tag','color','tag','nolimit','getQueues','order','Unknown\x20role','Queue','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','getWhatsappInteractions','WhatsappInteraction','mobile','format','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','headers','connection','remoteAddress','socket','getVoiceQueues','each','forEach','update','YYYY-MM-DD\x20HH:mm:ss','PAUSE','LOGININPAUSE','MemberReport','bulkCreate','concat','isMiddleware','resolve','logout','pause','updateAttributes','getChannels','type','DEFAULT\x20PAUSE','chatPause','faxPause','openchannelPause','smsPause','pauseType','lastPauseAt','unpause','manual','Pause','QueuePause','getTeams','Team','addTeams','setDataValue','Voice','getChatQueues','Chat','getSmsQueues','Sms','getWhatsappQueues','Whatsapp','getFaxQueues','Fax','getOpenchannelQueues','Openchannel','flatten','transaction','addAgent','getDataValue','UserVoicePrefix','removeTeams','getMailQueues','Mail','removeAgent','TeamVoicePrefix','VoicePrefixId','getLists','getAgents','values','addChatInteractions','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','VoicePrefix','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','WhatsappAccount','getWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$and','$or','$gt','$gte','$lt','$lte','$eq','$not','$notBetween','$in','$notIn','$notLike','$iLike','$notILike','$like','$overlap','$contains','$contained','$any','firstName','lastName','phone','CmContact','dialActive','getApiKey','retrieveApiKey','token','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','generateApiKey','iat','nonce','removeApiKey','apiKeyNonce','apiKeyIat','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getPresence','teams','queues','inbound','lower','toString','asc','desc','substring','orderBy','result','client','offline','idle','unknown','unavailable','ringing','voiceStatus','busy','slice','charAt','toUpperCase','select','field','ui.','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','OpenTabs','moment','bluebird','path','lodash','squel','jayson/promise','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','./user.socket','register','defaults','localhost','http','request','info','User,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','status','end','offset','undefined','limit','count','set','Content-Range','json','destroy','get','role','admin','Users','Agents','agent','Telephones','telephone','filter','map','value','includes','find','name','UserProfileResource','then','index','User','rawAttributes','fieldName','key','salt','getOptions','includeAll','include','attributes','findAll','rows','openTabs','true','chat','dataValues','push','sms','fax','mail','openchannel','all','catch','show','params','model','differenceBy','keys','password','query','filters','intersection','fields','length','merge','whatsapp','body','describe','addContacts','ids','omit','findById','securePassword','validatePasswordPattern','max','internal','isNil','min_internal','sequelize'];(function(_0x4db7c1,_0x40baeb){var _0x41fa35=function(_0x363797){while(--_0x363797){_0x4db7c1['push'](_0x4db7c1['shift']());}};_0x41fa35(++_0x40baeb);}(_0xfcf0,0x138));var _0x0fcf=function(_0x575a38,_0x2e83d7){_0x575a38=_0x575a38-0x0;var _0x5a7bdd=_0xfcf0[_0x575a38];return _0x5a7bdd;};'use strict';var moment=require(_0x0fcf('0x0'));var BPromise=require(_0x0fcf('0x1'));var util=require('util');var path=require(_0x0fcf('0x2'));var fs=require('fs');var _=require(_0x0fcf('0x3'));var squel=require(_0x0fcf('0x4'));var jayson=require(_0x0fcf('0x5'));var Redis=require('ioredis');var authService=require(_0x0fcf('0x6'));var qs=require(_0x0fcf('0x7'));var logger=require(_0x0fcf('0x8'))(_0x0fcf('0x9'));var utils=require(_0x0fcf('0xa'));var config=require(_0x0fcf('0xb'));var licenseUtil=require(_0x0fcf('0xc'));var db=require(_0x0fcf('0xd'))['db'];var socket=require('socket.io-emitter')(new Redis(config[_0x0fcf('0xe')]));require(_0x0fcf('0xf'))[_0x0fcf('0x10')](socket);config['redis']=_[_0x0fcf('0x11')](config[_0x0fcf('0xe')],{'host':_0x0fcf('0x12'),'port':0x18eb});var client=jayson['client'][_0x0fcf('0x13')]({'port':0x232a});var values;function respondWithRpcPromise(_0x5c29ed,_0x1be284,_0x2317cf,_0x201a58){return new BPromise(function(_0x48619c,_0x5f40fb){var _0x29336a=_0x201a58||client;return _0x29336a[_0x0fcf('0x14')](_0x5c29ed,_0x2317cf)['then'](function(_0x20153d){logger[_0x0fcf('0x15')](_0x0fcf('0x16'),_0x1be284,_0x0fcf('0x17'));logger[_0x0fcf('0x18')]('User,\x20%s,\x20%s,\x20%s',_0x1be284,_0x0fcf('0x17'),JSON[_0x0fcf('0x19')](_0x20153d));if(_0x20153d[_0x0fcf('0x1a')]){if(_0x20153d['error'][_0x0fcf('0x1b')]===0x1f4){logger[_0x0fcf('0x1a')](_0x0fcf('0x16'),_0x1be284,_0x20153d[_0x0fcf('0x1a')]['message']);return _0x5f40fb(_0x20153d[_0x0fcf('0x1a')][_0x0fcf('0x1c')]);}logger[_0x0fcf('0x1a')](_0x0fcf('0x16'),_0x1be284,_0x20153d[_0x0fcf('0x1a')]['message']);return _0x48619c(_0x20153d[_0x0fcf('0x1a')][_0x0fcf('0x1c')]);}else{logger['info'](_0x0fcf('0x16'),_0x1be284,_0x0fcf('0x17'));_0x48619c(_0x20153d['result'][_0x0fcf('0x1c')]);}})['catch'](function(_0x3fc9e6){logger[_0x0fcf('0x1a')]('User,\x20%s,\x20%s',_0x1be284,_0x3fc9e6);_0x5f40fb(_0x3fc9e6);});});}function respondWithStatusCode(_0x457880,_0x3f28d0){_0x3f28d0=_0x3f28d0||0xcc;return function(_0x29dbdf){if(_0x29dbdf){return _0x457880['sendStatus'](_0x3f28d0);}return _0x457880[_0x0fcf('0x1d')](_0x3f28d0)[_0x0fcf('0x1e')]();};}function respondWithResult(_0x196d30,_0x41b20b){_0x41b20b=_0x41b20b||0xc8;return function(_0x18af5c){if(_0x18af5c){return _0x196d30[_0x0fcf('0x1d')](_0x41b20b)['json'](_0x18af5c);}};}function respondWithFilteredResult(_0x2eef74,_0x253641){return function(_0x6021b4){if(_0x6021b4){var _0xd6f8b5=typeof _0x253641[_0x0fcf('0x1f')]===_0x0fcf('0x20')&&typeof _0x253641[_0x0fcf('0x21')]===_0x0fcf('0x20');var _0x117510=_0x6021b4['count'];var _0x18965e=_0xd6f8b5?0x0:_0x253641[_0x0fcf('0x1f')];var _0x41b7a2=_0xd6f8b5?_0x6021b4[_0x0fcf('0x22')]:_0x253641[_0x0fcf('0x1f')]+_0x253641[_0x0fcf('0x21')];var _0x2730b0;if(_0x41b7a2>=_0x117510){_0x41b7a2=_0x117510;_0x2730b0=0xc8;}else{_0x2730b0=0xce;}_0x2eef74['status'](_0x2730b0);return _0x2eef74[_0x0fcf('0x23')](_0x0fcf('0x24'),_0x18965e+'-'+_0x41b7a2+'/'+_0x117510)[_0x0fcf('0x25')](_0x6021b4);}return null;};}function saveUpdates(_0x35180d){return function(_0x49fd0e){if(_0x49fd0e){return _0x49fd0e['update'](_0x35180d)['then'](function(_0x428194){return _0x428194;});}return null;};}function removeEntity(_0x50b7df){return function(_0x26c3bc){if(_0x26c3bc){return _0x26c3bc[_0x0fcf('0x26')]()['then'](function(){var _0xdfd3ec=_0x26c3bc[_0x0fcf('0x27')]({'plain':!![]});if(_0xdfd3ec[_0x0fcf('0x28')]===_0x0fcf('0x29'))return;var _0xc58b86=[{'name':_0x0fcf('0x2a'),'value':'user','ignore':!![]},{'name':_0x0fcf('0x2b'),'value':_0x0fcf('0x2c'),'ignore':![]},{'name':_0x0fcf('0x2d'),'value':_0x0fcf('0x2e'),'ignore':![]}];var _0x19488a=_(_0xc58b86)[_0x0fcf('0x2f')]('ignore')[_0x0fcf('0x30')](_0x0fcf('0x31'))[_0x0fcf('0x31')]();if(_[_0x0fcf('0x32')](_0x19488a,_0xdfd3ec[_0x0fcf('0x28')])){return;}var _0x477c71=_[_0x0fcf('0x33')](_0xc58b86,[_0x0fcf('0x31'),_0xdfd3ec[_0x0fcf('0x28')]])[_0x0fcf('0x34')];return db[_0x0fcf('0x35')][_0x0fcf('0x26')]({'where':{'type':_0x477c71,'resourceId':_0xdfd3ec['id']}})[_0x0fcf('0x36')](function(){return _0x26c3bc;});})[_0x0fcf('0x36')](function(){_0x50b7df['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x40101a){return function(_0x4ccbdf){if(!_0x4ccbdf){_0x40101a['sendStatus'](0x194);}return _0x4ccbdf;};}function handleError(_0x1a1e07,_0x254d6a){_0x254d6a=_0x254d6a||0x1f4;return function(_0x3721ab){logger['error'](_0x3721ab['stack']);if(_0x3721ab[_0x0fcf('0x34')]){delete _0x3721ab[_0x0fcf('0x34')];}_0x1a1e07[_0x0fcf('0x1d')](_0x254d6a)['send'](_0x3721ab);};}exports[_0x0fcf('0x37')]=function(_0x1d2f3b,_0x29067e){var _0x4e139d={},_0x4c75e6={'count':0x0,'rows':[]};var _0x536d21=_(db[_0x0fcf('0x38')][_0x0fcf('0x39')])[_0x0fcf('0x30')](function(_0x3ae8fa){return{'name':_0x3ae8fa[_0x0fcf('0x3a')],'type':_0x3ae8fa['type'][_0x0fcf('0x3b')]};})[_0x0fcf('0x2f')](function(_0xb4087){return!_['includes'](['password',_0x0fcf('0x3c')],_0xb4087[_0x0fcf('0x34')]);})[_0x0fcf('0x31')]();_0x4e139d=qs[_0x0fcf('0x3d')](_0x536d21,_0x1d2f3b);var _0x43e0f9={'where':_0x4e139d['where']};return db[_0x0fcf('0x38')][_0x0fcf('0x22')](_0x43e0f9)[_0x0fcf('0x36')](function(_0x11134c){_0x4c75e6['count']=_0x11134c;if(_0x1d2f3b['query'][_0x0fcf('0x3e')]){_0x4e139d[_0x0fcf('0x3f')]=[{'all':!![]}];}if(!_['includes'](_0x4e139d[_0x0fcf('0x40')],'id')){_0x4e139d[_0x0fcf('0x40')]['push']('id');}return db[_0x0fcf('0x38')][_0x0fcf('0x41')](_0x4e139d);})[_0x0fcf('0x36')](function(_0x1f322b){_0x4c75e6[_0x0fcf('0x42')]=_0x1f322b;if(_0x1d2f3b['query'][_0x0fcf('0x43')]===_0x0fcf('0x44')){var _0x5994af=[];for(var _0x48b3f1=0x0;_0x48b3f1<_0x4c75e6[_0x0fcf('0x42')]['length'];_0x48b3f1++){_0x5994af['push'](get_open_tabs(_0x0fcf('0x45'),_0x4c75e6[_0x0fcf('0x42')][_0x48b3f1][_0x0fcf('0x46')]));_0x5994af[_0x0fcf('0x47')](get_open_tabs(_0x0fcf('0x48'),_0x4c75e6[_0x0fcf('0x42')][_0x48b3f1][_0x0fcf('0x46')]));_0x5994af[_0x0fcf('0x47')](get_open_tabs(_0x0fcf('0x49'),_0x4c75e6[_0x0fcf('0x42')][_0x48b3f1]['dataValues']));_0x5994af[_0x0fcf('0x47')](get_open_tabs(_0x0fcf('0x4a'),_0x4c75e6[_0x0fcf('0x42')][_0x48b3f1]['dataValues']));_0x5994af['push'](get_open_tabs(_0x0fcf('0x4b'),_0x4c75e6[_0x0fcf('0x42')][_0x48b3f1][_0x0fcf('0x46')]));_0x5994af[_0x0fcf('0x47')](get_open_tabs('whatsapp',_0x4c75e6['rows'][_0x48b3f1][_0x0fcf('0x46')]));}return BPromise[_0x0fcf('0x4c')](_0x5994af)[_0x0fcf('0x36')](function(_0x1fb83d){return _0x4c75e6;});}else{return _0x4c75e6;}})[_0x0fcf('0x36')](respondWithFilteredResult(_0x29067e,_0x4e139d))[_0x0fcf('0x4d')](handleError(_0x29067e,null));};exports[_0x0fcf('0x4e')]=function(_0xc7ae,_0x4c4f56){var _0x5a0ced={'raw':![],'where':{'id':_0xc7ae[_0x0fcf('0x4f')]['id']}},_0x259c91={};_0x259c91[_0x0fcf('0x50')]=_[_0x0fcf('0x51')](_[_0x0fcf('0x52')](db[_0x0fcf('0x38')]['rawAttributes']),[_0x0fcf('0x53'),_0x0fcf('0x3c')]);_0x259c91['query']=_[_0x0fcf('0x52')](_0xc7ae[_0x0fcf('0x54')]);_0x259c91[_0x0fcf('0x55')]=_[_0x0fcf('0x56')](_0x259c91['model'],_0x259c91[_0x0fcf('0x54')]);_0x5a0ced[_0x0fcf('0x40')]=_[_0x0fcf('0x56')](_0x259c91[_0x0fcf('0x50')],qs[_0x0fcf('0x57')](_0xc7ae[_0x0fcf('0x54')][_0x0fcf('0x57')]));_0x5a0ced[_0x0fcf('0x40')]=_0x5a0ced[_0x0fcf('0x40')][_0x0fcf('0x58')]?_0x5a0ced[_0x0fcf('0x40')]:_0x259c91[_0x0fcf('0x50')];if(_0xc7ae[_0x0fcf('0x54')][_0x0fcf('0x3e')]){_0x5a0ced['include']=[{'all':!![]}];}_0x5a0ced=_[_0x0fcf('0x59')]({},_0x5a0ced,_0xc7ae['options']);if(!_[_0x0fcf('0x32')](_0x5a0ced[_0x0fcf('0x40')],'id')){_0x5a0ced[_0x0fcf('0x40')][_0x0fcf('0x47')]('id');}return db[_0x0fcf('0x38')]['find'](_0x5a0ced)[_0x0fcf('0x36')](handleEntityNotFound(_0x4c4f56,null))['then'](function(_0x48b60a){var _0x2de3ef=[];values=_0x48b60a;if(_0xc7ae['query'][_0x0fcf('0x43')]===_0x0fcf('0x44')){_0x2de3ef['push'](get_open_tabs(_0x0fcf('0x45'),_0x48b60a[_0x0fcf('0x46')]));_0x2de3ef[_0x0fcf('0x47')](get_open_tabs(_0x0fcf('0x48'),_0x48b60a[_0x0fcf('0x46')]));_0x2de3ef['push'](get_open_tabs('openchannel',_0x48b60a[_0x0fcf('0x46')]));_0x2de3ef['push'](get_open_tabs(_0x0fcf('0x5a'),_0x48b60a[_0x0fcf('0x46')]));_0x2de3ef['push'](get_open_tabs('fax',_0x48b60a[_0x0fcf('0x46')]));_0x2de3ef[_0x0fcf('0x47')](get_open_tabs(_0x0fcf('0x4a'),_0x48b60a['dataValues']));return BPromise[_0x0fcf('0x4c')](_0x2de3ef);}else{return values;}})['then'](function(_0x2ed8d8){return values;})[_0x0fcf('0x36')](respondWithResult(_0x4c4f56,null))[_0x0fcf('0x4d')](handleError(_0x4c4f56,null));};exports['update']=function(_0x1362d7,_0x29c0b8){if(_0x1362d7[_0x0fcf('0x5b')]['id']){delete _0x1362d7[_0x0fcf('0x5b')]['id'];}delete _0x1362d7[_0x0fcf('0x5b')][_0x0fcf('0x28')];return db[_0x0fcf('0x38')][_0x0fcf('0x33')]({'where':{'id':_0x1362d7[_0x0fcf('0x4f')]['id']}})[_0x0fcf('0x36')](handleEntityNotFound(_0x29c0b8,null))[_0x0fcf('0x36')](saveUpdates(_0x1362d7['body'],null))[_0x0fcf('0x36')](respondWithResult(_0x29c0b8,null))[_0x0fcf('0x4d')](handleError(_0x29c0b8,null));};exports[_0x0fcf('0x5c')]=function(_0x13b5c5,_0xa42e82){return db[_0x0fcf('0x38')][_0x0fcf('0x5c')]()['then'](respondWithResult(_0xa42e82,null))['catch'](handleError(_0xa42e82,null));};exports[_0x0fcf('0x5d')]=function(_0x38c2e0,_0x58607c){return db[_0x0fcf('0x38')][_0x0fcf('0x33')]({'where':{'id':_0x38c2e0[_0x0fcf('0x4f')]['id']}})[_0x0fcf('0x36')](handleEntityNotFound(_0x58607c,null))['then'](function(_0x540859){if(_0x540859){return _0x540859[_0x0fcf('0x5d')](_0x38c2e0[_0x0fcf('0x5b')][_0x0fcf('0x5e')],_[_0x0fcf('0x5f')](_0x38c2e0[_0x0fcf('0x5b')],['ids','id'])||{});}})[_0x0fcf('0x36')](respondWithResult(_0x58607c,null))[_0x0fcf('0x4d')](handleError(_0x58607c,null));};function validateUser(_0xa634f3){return new BPromise(function(_0x3f3ad8,_0x1974e2){if(_0xa634f3['internal'])return _0x3f3ad8(_0xa634f3);return db['Setting'][_0x0fcf('0x60')](0x1)[_0x0fcf('0x36')](function(_0x8c2777){if(_0x8c2777[_0x0fcf('0x61')])authService[_0x0fcf('0x62')](_0xa634f3[_0x0fcf('0x53')]);db[_0x0fcf('0x38')][_0x0fcf('0x63')](_0x0fcf('0x64'))[_0x0fcf('0x36')](function(_0x5d54f0){if(_[_0x0fcf('0x65')](_0x5d54f0)){_0xa634f3[_0x0fcf('0x64')]=_0x8c2777[_0x0fcf('0x66')]||0x1;return;}if(_[_0x0fcf('0x65')](_0x8c2777[_0x0fcf('0x66')])||_0x8c2777[_0x0fcf('0x66')]===_0x5d54f0){_0xa634f3[_0x0fcf('0x64')]=_0x5d54f0+0x1;return;}if(_0x8c2777[_0x0fcf('0x66')]>_0x5d54f0){_0xa634f3[_0x0fcf('0x64')]=_0x8c2777['min_internal'];return;}return db['sequelize']['query']('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0x0fcf('0x67')]['QueryTypes'][_0x0fcf('0x68')]})[_0x0fcf('0x36')](function(_0x3da414){if(_0x3da414&&_0x3da414['length']){for(var _0x5ab5c6=0x0,_0x44eaac=_0x3da414[_0x0fcf('0x58')];_0x5ab5c6<_0x44eaac&&_['isNil'](_0xa634f3[_0x0fcf('0x64')]);_0x5ab5c6++){if(_0x8c2777[_0x0fcf('0x66')]<=_0x3da414[_0x5ab5c6]['from']){_0xa634f3[_0x0fcf('0x64')]=_0x3da414[_0x5ab5c6][_0x0fcf('0x69')];}else if(_0x8c2777[_0x0fcf('0x66')]>_0x3da414[_0x5ab5c6][_0x0fcf('0x69')]&&_0x8c2777[_0x0fcf('0x66')]<=_0x3da414[_0x5ab5c6]['to']){_0xa634f3[_0x0fcf('0x64')]=_0x8c2777[_0x0fcf('0x66')];}}}if(_['isNil'](_0xa634f3[_0x0fcf('0x64')])){_0xa634f3[_0x0fcf('0x64')]=_0x5d54f0+0x1;}return _0x3f3ad8(_0xa634f3);});});})[_0x0fcf('0x4d')](function(_0x41fcac){_0x1974e2(_0x41fcac);});});}function updateUser(_0x294504){return new BPromise(function(_0x31f658,_0x498d14){try{if(_0x294504['voicemail']){_0x294504[_0x0fcf('0x6a')]=_0x294504[_0x0fcf('0x64')];_0x294504[_0x0fcf('0x6b')]={'mailbox':_0x294504[_0x0fcf('0x64')],'password':_0x294504['password'],'fullname':_0x294504[_0x0fcf('0x6c')],'email':_0x294504[_0x0fcf('0x6d')]};}if(_0x294504[_0x0fcf('0x28')]===_0x0fcf('0x2c')){if(!_0x294504[_0x0fcf('0x6e')])_0x294504['permissions']=['101',_0x0fcf('0x6f'),'103',_0x0fcf('0x70'),'110',_0x0fcf('0x71'),_0x0fcf('0x72'),_0x0fcf('0x73'),_0x0fcf('0x74'),_0x0fcf('0x75'),'109',_0x0fcf('0x76'),_0x0fcf('0x77'),_0x0fcf('0x78'),_0x0fcf('0x79')];}_0x31f658(_0x294504);}catch(_0x4c7555){_0x498d14(_0x4c7555);}});}exports[_0x0fcf('0x7a')]=function(_0x5ba384,_0x2a6084){if(_0x5ba384['user'][_0x0fcf('0x28')]===_0x0fcf('0x2c'))throw new Error('Unauthorized');if(_0x5ba384[_0x0fcf('0x5b')][_0x0fcf('0x28')]===_0x0fcf('0x7b')&&_0x5ba384['user']['role']!=='admin'){throw new Error(_0x0fcf('0x7c'));}if(_0x5ba384['body'][_0x0fcf('0x28')]===_0x0fcf('0x29')&&_0x5ba384[_0x0fcf('0x7b')][_0x0fcf('0x28')]!==_0x0fcf('0x29')){throw new Error(_0x0fcf('0x7d'));}return licenseUtil[_0x0fcf('0x7e')]([_0x5ba384[_0x0fcf('0x5b')]])[_0x0fcf('0x36')](function(){return validateUser(_0x5ba384['body']);})[_0x0fcf('0x36')](function(_0x231563){return updateUser(_0x231563)[_0x0fcf('0x36')](function(_0x20cd3f){if(_0x20cd3f[_0x0fcf('0x28')]===_0x0fcf('0x29')){_0x20cd3f[_0x0fcf('0x7f')]=_0x5ba384[_0x0fcf('0x7b')]['settingsEnabled'];delete _0x20cd3f[_0x0fcf('0x80')];}return _0x20cd3f;});})[_0x0fcf('0x36')](function(_0x1da8dd){return db[_0x0fcf('0x38')][_0x0fcf('0x7a')](_0x1da8dd,{'include':[{'model':db[_0x0fcf('0x6b')],'as':_0x0fcf('0x6b')}]});})['then'](function(_0x2d9214){if(_0x5ba384['body'][_0x0fcf('0x28')]===_0x0fcf('0x7b'))return _0x2d9214;if(_0x5ba384[_0x0fcf('0x7b')]['role']!=='user')return _0x2d9214;return db['UserProfileSection']['find']({'where':{'name':_0x2d9214[_0x0fcf('0x28')]===_0x0fcf('0x2c')?_0x0fcf('0x2b'):_0x0fcf('0x2d'),'userProfileId':_0x5ba384[_0x0fcf('0x7b')][_0x0fcf('0x80')]},'raw':!![]})[_0x0fcf('0x36')](function(_0x3490eb){if(!_0x3490eb||_0x3490eb[_0x0fcf('0x81')]!=0x0)return _0x2d9214;return db[_0x0fcf('0x35')][_0x0fcf('0x7a')]({'name':_0x2d9214['name'],'resourceId':_0x2d9214['id'],'type':_0x3490eb[_0x0fcf('0x34')],'sectionId':_0x3490eb['id']},{})[_0x0fcf('0x36')](function(){return _0x2d9214;});})['catch'](function(_0x2af8de){logger['error'](_0x0fcf('0x82'),_0x2af8de);throw _0x2af8de;});})[_0x0fcf('0x36')](respondWithResult(_0x2a6084,0xc9))['catch'](handleError(_0x2a6084,null));};exports['bulkCreate']=function(_0x36d4e5,_0x3785b4){var _0x4a6adc=_0x36d4e5[_0x0fcf('0x5b')];var _0x3cf7b7=[];if(_0x36d4e5[_0x0fcf('0x7b')][_0x0fcf('0x28')]===_0x0fcf('0x2c'))throw new Error(_0x0fcf('0x83'));if(_[_0x0fcf('0x84')](_0x4a6adc,[_0x0fcf('0x28'),'user'])&&_0x36d4e5[_0x0fcf('0x7b')][_0x0fcf('0x28')]!==_0x0fcf('0x29')){throw new Error(_0x0fcf('0x7c'));}if(_['some'](_0x4a6adc,[_0x0fcf('0x28'),'admin'])&&_0x36d4e5['user']['role']!==_0x0fcf('0x29')){throw new Error(_0x0fcf('0x85'));}return licenseUtil[_0x0fcf('0x7e')](_0x4a6adc)[_0x0fcf('0x36')](function(){return validateUser(_0x4a6adc[0x0]);})[_0x0fcf('0x36')](function(){for(var _0x777b71=0x1;_0x777b71<_0x4a6adc[_0x0fcf('0x58')];_0x777b71++){var _0x31b008=_0x4a6adc[_0x777b71-0x1][_0x0fcf('0x64')];if(!_0x4a6adc[_0x777b71]['internal'])_0x4a6adc[_0x777b71][_0x0fcf('0x64')]=_0x31b008+0x1;_0x3cf7b7[_0x0fcf('0x47')](validateUser(_0x4a6adc[_0x777b71]));}return BPromise[_0x0fcf('0x4c')](_0x3cf7b7);})[_0x0fcf('0x36')](function(){_0x3cf7b7=[];for(var _0x1d83bb=0x0;_0x1d83bb<_0x4a6adc[_0x0fcf('0x58')];_0x1d83bb++){_0x3cf7b7[_0x0fcf('0x47')](updateUser(_0x4a6adc[_0x1d83bb]));}return BPromise[_0x0fcf('0x4c')](_0x3cf7b7);})[_0x0fcf('0x36')](function(){return BPromise['each'](_0x4a6adc,function(_0x56e098){return db['User'][_0x0fcf('0x7a')](_0x56e098,{'include':[{'model':db[_0x0fcf('0x6b')],'as':_0x0fcf('0x6b')}]})[_0x0fcf('0x36')](function(_0x52e2e6){_0x56e098['id']=_0x52e2e6['id'];return _0x56e098;});});})['then'](function(_0x5c7fd7){if(_0x36d4e5[_0x0fcf('0x5b')]['role']===_0x0fcf('0x7b'))return _0x5c7fd7;if(_0x36d4e5['user'][_0x0fcf('0x28')]!=='user')return _0x5c7fd7;var _0x30edd0=_['some'](_0x5c7fd7,function(_0x4f729f){return _0x4f729f[_0x0fcf('0x28')]==='agent'||_0x4f729f[_0x0fcf('0x28')]===_0x0fcf('0x2e');});if(!_0x30edd0)return _0x5c7fd7;return db[_0x0fcf('0x86')][_0x0fcf('0x41')]({'where':{'name':{'$or':[_0x0fcf('0x2b'),_0x0fcf('0x2d')]},'userProfileId':_0x36d4e5[_0x0fcf('0x7b')][_0x0fcf('0x80')]},'raw':!![]})[_0x0fcf('0x36')](function(_0x1ad06d){if(_[_0x0fcf('0x87')](_0x1ad06d)||!_[_0x0fcf('0x84')](_0x1ad06d,[_0x0fcf('0x81'),0x0]))return _0x5c7fd7;_0x3cf7b7=[];var _0x57a1c0=_(_0x1ad06d)[_0x0fcf('0x30')](function(_0x3bc4a5){if(_0x3bc4a5[_0x0fcf('0x81')]===0x1)return;return _0x3bc4a5[_0x0fcf('0x34')]===_0x0fcf('0x2b')?_0x0fcf('0x2c'):_0x0fcf('0x2e');})[_0x0fcf('0x88')]()[_0x0fcf('0x31')]();for(var _0x50a5bb=0x0;_0x50a5bb<_0x5c7fd7[_0x0fcf('0x58')];_0x50a5bb++){if(!_[_0x0fcf('0x32')](_0x57a1c0,_0x5c7fd7[_0x50a5bb][_0x0fcf('0x28')]))return;var _0x319770=_0x5c7fd7[_0x50a5bb][_0x0fcf('0x28')]===_0x0fcf('0x2c')?_0x0fcf('0x2b'):_0x0fcf('0x2d');_0x3cf7b7[_0x0fcf('0x47')](db[_0x0fcf('0x35')][_0x0fcf('0x7a')]({'name':_0x5c7fd7[_0x50a5bb][_0x0fcf('0x34')],'resourceId':_0x5c7fd7[_0x50a5bb]['id'],'type':_0x319770,'sectionId':_[_0x0fcf('0x33')](_0x1ad06d,['name',_0x319770])['id']},{}));}return BPromise[_0x0fcf('0x4c')](_0x3cf7b7);});})[_0x0fcf('0x36')](respondWithResult(_0x3785b4,0xc9))['catch'](handleError(_0x3785b4,null));};exports[_0x0fcf('0x89')]=function(_0x39b86f,_0x2b087b){if(_0x39b86f[_0x0fcf('0x5b')]['id']){delete _0x39b86f[_0x0fcf('0x5b')]['id'];}return db['User']['find']({'where':{'id':_0x39b86f['params']['id']}})[_0x0fcf('0x36')](function(_0x4b0216){if(!_0x4b0216)return null;if(_0x4b0216['id']===_0x39b86f[_0x0fcf('0x7b')]['id']){if(!_0x39b86f[_0x0fcf('0x5b')]['oldPassword']||!_0x39b86f[_0x0fcf('0x5b')][_0x0fcf('0x8a')]){throw new db[(_0x0fcf('0x8b'))][(_0x0fcf('0x8c'))](_0x0fcf('0x8d'));}if(!_0x4b0216[_0x0fcf('0x8e')](_0x39b86f[_0x0fcf('0x5b')][_0x0fcf('0x8f')])){throw new db[(_0x0fcf('0x8b'))]['ValidationError'](_0x0fcf('0x90'));}if(_0x39b86f[_0x0fcf('0x5b')][_0x0fcf('0x8f')]===_0x39b86f['body'][_0x0fcf('0x8a')]){throw new db[(_0x0fcf('0x8b'))][(_0x0fcf('0x8c'))](_0x0fcf('0x91'));}}else if(_0x39b86f[_0x0fcf('0x7b')][_0x0fcf('0x28')]===_0x0fcf('0x29')){if(!_0x39b86f['body'][_0x0fcf('0x8a')]){throw new db[(_0x0fcf('0x8b'))][(_0x0fcf('0x8c'))](_0x0fcf('0x92'));}}else if(_0x39b86f['user'][_0x0fcf('0x28')]==='user'){if(!_0x39b86f[_0x0fcf('0x5b')][_0x0fcf('0x8a')]){throw new db['Sequelize']['ValidationError'](_0x0fcf('0x92'));}if(_0x4b0216[_0x0fcf('0x28')]!==_0x0fcf('0x2c')){throw new db[(_0x0fcf('0x8b'))][(_0x0fcf('0x8c'))](_0x0fcf('0x83'));}}else{throw new db[(_0x0fcf('0x8b'))][(_0x0fcf('0x8c'))](_0x0fcf('0x83'));}return _0x4b0216;})[_0x0fcf('0x36')](handleEntityNotFound(_0x2b087b,null))['then'](function(_0x144354){return db['Setting']['findOne']({'attributes':['id',_0x0fcf('0x61'),'enforcePasswordHistory','passwordHistoryLimit']})['then'](function(_0x22c9d9){if(_0x22c9d9[_0x0fcf('0x61')])authService[_0x0fcf('0x62')](_0x39b86f[_0x0fcf('0x5b')][_0x0fcf('0x8a')]);if(!_0x22c9d9[_0x0fcf('0x93')]||!_0x144354[_0x0fcf('0x94')])return _0x144354;authService[_0x0fcf('0x95')](_0x39b86f[_0x0fcf('0x5b')]['newPassword'],_0x144354[_0x0fcf('0x94')],_0x22c9d9[_0x0fcf('0x96')]);return _0x144354;})[_0x0fcf('0x36')](saveUpdates({'password':_0x39b86f[_0x0fcf('0x5b')][_0x0fcf('0x8a')],'passwordResetAt':_0x39b86f[_0x0fcf('0x7b')]['id']==_0x39b86f['params']['id']?moment():null,'previousPasswords':authService[_0x0fcf('0x97')](_0x39b86f[_0x0fcf('0x5b')][_0x0fcf('0x8a')],_0x144354[_0x0fcf('0x94')])},null));})[_0x0fcf('0x36')](respondWithResult(_0x2b087b,null))['catch'](handleError(_0x2b087b,null));};exports[_0x0fcf('0x98')]=function(_0x2476e0,_0x1e259b){var _0x3465ee=_0x2476e0[_0x0fcf('0x5b')]['channel'];return db[_0x0fcf('0x38')][_0x0fcf('0x33')]({'where':{'id':_0x2476e0[_0x0fcf('0x4f')]['id']},'attributes':['id',_0x0fcf('0x34'),'role',_0x0fcf('0x99'),_0x0fcf('0x9a'),_0x0fcf('0x9b'),'interface']})['then'](handleEntityNotFound(_0x1e259b,null))[_0x0fcf('0x36')](function(_0x16afe3){if(_0x16afe3){if(!utils[_0x0fcf('0x9c')](_0x3465ee)){throw new db[(_0x0fcf('0x8b'))][(_0x0fcf('0x8c'))]('Unknown\x20channel');}return _0x16afe3[_0x0fcf('0x9d')+_[_0x0fcf('0x9e')](_0x3465ee[_0x0fcf('0x9f')]())+'Queues'](_0x2476e0[_0x0fcf('0x5b')][_0x0fcf('0x5e')],{'penalty':_0x2476e0['body'][_0x0fcf('0xa0')]||0x0})[_0x0fcf('0xa1')](function(_0x40562e){for(var _0x449f55=0x0;_0x449f55<_0x2476e0[_0x0fcf('0x5b')]['ids'][_0x0fcf('0x58')];_0x449f55+=0x1){var _0x492839={'UserId':Number(_0x2476e0[_0x0fcf('0x4f')]['id'])};_0x492839[_['capitalize'](_0x3465ee['toLowerCase']())+_0x0fcf('0xa2')]=Number(_0x2476e0[_0x0fcf('0x5b')][_0x0fcf('0x5e')][_0x449f55]);socket[_0x0fcf('0xa3')](_0x0fcf('0x7b')+_[_0x0fcf('0x9e')](_0x3465ee[_0x0fcf('0x9f')]())+_0x0fcf('0xa4'),_0x492839);}return _0x40562e;})[_0x0fcf('0x36')](function(){if(_0x3465ee==='voice'){return db[_0x0fcf('0xa5')][_0x0fcf('0x41')]({'where':{'id':_0x2476e0[_0x0fcf('0x5b')][_0x0fcf('0x5e')]||[]},'raw':!![],'attributes':['id',_0x0fcf('0x34')]});}})[_0x0fcf('0x36')](function(_0x210aaf){var _0x4c62dd=_0x16afe3[_0x0fcf('0x27')]({'plain':!![]});var _0x12df1c=[];if(_0x3465ee==='voice'&&_0x4c62dd[_0x0fcf('0x28')]==='agent'&&_0x4c62dd[_0x0fcf('0x99')]){for(var _0x5947c5=0x0;_0x5947c5<_0x210aaf[_0x0fcf('0x58')];_0x5947c5+=0x1){_0x12df1c[_0x0fcf('0x47')]({'membername':_0x4c62dd[_0x0fcf('0x34')],'UserId':_0x4c62dd['id'],'queue_name':_0x210aaf[_0x5947c5][_0x0fcf('0x34')],'VoiceQueueId':_0x210aaf[_0x5947c5]['id'],'interface':_[_0x0fcf('0x65')](_0x4c62dd[_0x0fcf('0xa6')])?util['format'](_0x0fcf('0xa7'),_0x4c62dd[_0x0fcf('0x34')]):_0x4c62dd[_0x0fcf('0xa6')],'paused':_0x4c62dd[_0x0fcf('0x9b')]||![],'penalty':_0x2476e0[_0x0fcf('0x5b')]['penalty']||0x0});}return BPromise['each'](_0x12df1c,function(_0x3211be){return db[_0x0fcf('0xa8')][_0x0fcf('0xa9')](_0x3211be);});}return _0x16afe3;});}})[_0x0fcf('0x36')](respondWithStatusCode(_0x1e259b,null))[_0x0fcf('0x4d')](handleError(_0x1e259b,null));};exports['removeQueues']=function(_0x2d6360,_0x4297af){var _0x4919d4;return db['User'][_0x0fcf('0x33')]({'where':{'id':_0x2d6360[_0x0fcf('0x4f')]['id']},'attributes':['id',_0x0fcf('0x34'),_0x0fcf('0x28')]})[_0x0fcf('0x36')](handleEntityNotFound(_0x4297af,null))[_0x0fcf('0x36')](function(_0x38aba9){if(_0x38aba9){_0x4919d4=_0x38aba9;if(!_0x2d6360[_0x0fcf('0x54')][_0x0fcf('0xaa')]||!utils[_0x0fcf('0x9c')](_0x2d6360[_0x0fcf('0x54')][_0x0fcf('0xaa')])){throw new db[(_0x0fcf('0x8b'))][(_0x0fcf('0x8c'))](_0x0fcf('0xab'));}return _0x38aba9[_0x0fcf('0xac')+_['capitalize'](_0x2d6360['query'][_0x0fcf('0xaa')][_0x0fcf('0x9f')]())+_0x0fcf('0xad')](_0x2d6360[_0x0fcf('0x54')][_0x0fcf('0x5e')]);}})[_0x0fcf('0x36')](function(_0x518070){if(_[_0x0fcf('0xae')](_0x2d6360['query'][_0x0fcf('0x5e')])){for(var _0x5f4613=0x0;_0x5f4613<_0x2d6360['query'][_0x0fcf('0x5e')][_0x0fcf('0x58')];_0x5f4613+=0x1){var _0xe72ed8={'UserId':Number(_0x2d6360['params']['id'])};_0xe72ed8[_['capitalize'](_0x2d6360[_0x0fcf('0x54')][_0x0fcf('0xaa')][_0x0fcf('0x9f')]())+_0x0fcf('0xa2')]=Number(_0x2d6360[_0x0fcf('0x54')]['ids'][_0x5f4613]);socket[_0x0fcf('0xa3')](_0x0fcf('0x7b')+_[_0x0fcf('0x9e')](_0x2d6360[_0x0fcf('0x54')][_0x0fcf('0xaa')][_0x0fcf('0x9f')]())+_0x0fcf('0xaf'),_0xe72ed8);}}else{var _0xe72ed8={'UserId':Number(_0x2d6360[_0x0fcf('0x4f')]['id'])};_0xe72ed8[_[_0x0fcf('0x9e')](_0x2d6360[_0x0fcf('0x54')][_0x0fcf('0xaa')][_0x0fcf('0x9f')]())+_0x0fcf('0xa2')]=Number(_0x2d6360[_0x0fcf('0x54')][_0x0fcf('0x5e')]);socket['emit']('user'+_['capitalize'](_0x2d6360[_0x0fcf('0x54')]['channel'][_0x0fcf('0x9f')]())+_0x0fcf('0xaf'),_0xe72ed8);}return _0x518070;})['then'](function(){if(_0x2d6360[_0x0fcf('0x54')]['channel']===_0x0fcf('0xb0')){return db['UserVoiceQueueRt'][_0x0fcf('0x26')]({'where':{'UserId':_0x2d6360[_0x0fcf('0x4f')]['id'],'VoiceQueueId':_0x2d6360[_0x0fcf('0x54')][_0x0fcf('0x5e')]},'individualHooks':!![]})[_0x0fcf('0x36')](function(){return _0x4919d4;});}return _0x4919d4;})[_0x0fcf('0x36')](respondWithStatusCode(_0x4297af,null))['catch'](handleError(_0x4297af,null));};exports[_0x0fcf('0xb1')]=function(_0x337d09,_0x5ab604){_0x337d09[_0x0fcf('0x5b')]['userpic']=_0x337d09['file'][_0x0fcf('0xb2')];return db[_0x0fcf('0x38')][_0x0fcf('0x33')]({'where':{'id':_0x337d09[_0x0fcf('0x4f')]['id']}})[_0x0fcf('0x36')](handleEntityNotFound(_0x5ab604,null))[_0x0fcf('0x36')](saveUpdates(_0x337d09[_0x0fcf('0x5b')],null))[_0x0fcf('0x36')](respondWithResult(_0x5ab604,null))['catch'](handleError(_0x5ab604,null));};exports[_0x0fcf('0xb3')]=function(_0x35e2b0,_0x233a76){var _0x300647=path['join'](config['root'],_0x0fcf('0xb4'));return db[_0x0fcf('0x38')][_0x0fcf('0x33')]({'where':{'id':_0x35e2b0[_0x0fcf('0x4f')]['id']},'attributes':['id',_0x0fcf('0xb5')],'raw':!![]})['then'](handleEntityNotFound(_0x233a76,null))['then'](function(_0x310652){if(_0x310652){if(_[_0x0fcf('0x65')](_0x310652[_0x0fcf('0xb5')])){return _0x233a76[_0x0fcf('0xb6')](_0x300647);}else{if(!fs['existsSync'](path[_0x0fcf('0xb7')](config[_0x0fcf('0xb8')],'server/files/images/',_0x310652[_0x0fcf('0xb5')]))){return _0x233a76[_0x0fcf('0xb6')](_0x300647);}return _0x233a76['download'](path[_0x0fcf('0xb7')](config[_0x0fcf('0xb8')],_0x0fcf('0xb9'),_0x310652[_0x0fcf('0xb5')]));}}})[_0x0fcf('0x4d')](handleError(_0x233a76,null));};exports[_0x0fcf('0xba')]=function(_0x3f7a64,_0x5efa26){return db[_0x0fcf('0x38')][_0x0fcf('0x33')]({'where':{'id':_0x3f7a64[_0x0fcf('0x4f')]['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x5efa26,null))[_0x0fcf('0x36')](function(_0x22c391){var _0x41e1b5=[];values=_0x22c391[_0x0fcf('0x46')];_0x41e1b5[_0x0fcf('0x47')](get_open_tabs(_0x0fcf('0x45'),_0x22c391[_0x0fcf('0x46')]));_0x41e1b5[_0x0fcf('0x47')](get_open_tabs(_0x0fcf('0x48'),_0x22c391[_0x0fcf('0x46')]));_0x41e1b5[_0x0fcf('0x47')](get_open_tabs('openchannel',_0x22c391[_0x0fcf('0x46')]));_0x41e1b5['push'](get_open_tabs(_0x0fcf('0x5a'),_0x22c391[_0x0fcf('0x46')]));_0x41e1b5[_0x0fcf('0x47')](get_open_tabs('fax',_0x22c391[_0x0fcf('0x46')]));_0x41e1b5['push'](get_open_tabs(_0x0fcf('0x4a'),_0x22c391['dataValues']));return BPromise[_0x0fcf('0x4c')](_0x41e1b5);})[_0x0fcf('0x36')](function(_0x56bbcd){var _0x2003a6=[];if(_0x56bbcd){for(var _0x300d2a=0x0;_0x300d2a=_0x3496c3){_0x558fd2=_0x3496c3;_0x439173=0xc8;}else{_0x439173=0xce;}_0x4093a4[_0x3d94('0x19')](_0x439173);return _0x4093a4[_0x3d94('0x1f')](_0x3d94('0x20'),_0x5b3b31+'-'+_0x558fd2+'/'+_0x3496c3)['json'](_0x27f978);}return null;};}function saveUpdates(_0x584c4a){return function(_0x362642){if(_0x362642){return _0x362642['update'](_0x584c4a)['then'](function(_0x23d20d){return _0x23d20d;});}return null;};}function removeEntity(_0x58c0d0){return function(_0x19bfd4){if(_0x19bfd4){return _0x19bfd4[_0x3d94('0x21')]()[_0x3d94('0x22')](function(){var _0x4cef9c=_0x19bfd4[_0x3d94('0x23')]({'plain':!![]});if(_0x4cef9c['role']===_0x3d94('0x24'))return;var _0x53db78=[{'name':_0x3d94('0x25'),'value':_0x3d94('0x26'),'ignore':!![]},{'name':_0x3d94('0x27'),'value':_0x3d94('0x28'),'ignore':![]},{'name':'Telephones','value':_0x3d94('0x29'),'ignore':![]}];var _0x51f634=_(_0x53db78)[_0x3d94('0x2a')](_0x3d94('0x2b'))['map']('value')[_0x3d94('0x2c')]();if(_[_0x3d94('0x2d')](_0x51f634,_0x4cef9c[_0x3d94('0x2e')])){return;}var _0x5cdb2e=_[_0x3d94('0x2f')](_0x53db78,[_0x3d94('0x2c'),_0x4cef9c['role']])[_0x3d94('0x30')];return db[_0x3d94('0x31')][_0x3d94('0x21')]({'where':{'type':_0x5cdb2e,'resourceId':_0x4cef9c['id']}})[_0x3d94('0x22')](function(){return _0x19bfd4;});})[_0x3d94('0x22')](function(){_0x58c0d0['status'](0xcc)[_0x3d94('0x32')]();});}};}function handleEntityNotFound(_0x42b742){return function(_0x41579e){if(!_0x41579e){_0x42b742[_0x3d94('0x18')](0x194);}return _0x41579e;};}function handleError(_0xb493f1,_0x441523){_0x441523=_0x441523||0x1f4;return function(_0x546658){logger['error'](_0x546658[_0x3d94('0x33')]);if(_0x546658[_0x3d94('0x30')]){delete _0x546658[_0x3d94('0x30')];}_0xb493f1[_0x3d94('0x19')](_0x441523)[_0x3d94('0x34')](_0x546658);};}exports[_0x3d94('0x35')]=function(_0x2ef743,_0x12c01a){var _0x2e7b97={},_0x2235f9={'count':0x0,'rows':[]};var _0x4e2244=_(db[_0x3d94('0x36')][_0x3d94('0x37')])[_0x3d94('0x38')](function(_0xcc289a){return{'name':_0xcc289a['fieldName'],'type':_0xcc289a[_0x3d94('0x39')][_0x3d94('0x3a')]};})[_0x3d94('0x2a')](function(_0x29eaa4){return!_[_0x3d94('0x2d')](['password',_0x3d94('0x3b')],_0x29eaa4[_0x3d94('0x30')]);})[_0x3d94('0x2c')]();_0x2e7b97=qs['getOptions'](_0x4e2244,_0x2ef743);var _0x4eee4d={'where':_0x2e7b97['where']};return db['User'][_0x3d94('0x1e')](_0x4eee4d)[_0x3d94('0x22')](function(_0x2ebcb1){_0x2235f9[_0x3d94('0x1e')]=_0x2ebcb1;if(_0x2ef743[_0x3d94('0x3c')][_0x3d94('0x3d')]){_0x2e7b97[_0x3d94('0x3e')]=[{'all':!![]}];}if(!_['includes'](_0x2e7b97['attributes'],'id')){_0x2e7b97[_0x3d94('0x3f')][_0x3d94('0x40')]('id');}return db['User'][_0x3d94('0x41')](_0x2e7b97);})['then'](function(_0x1361fb){_0x2235f9[_0x3d94('0x42')]=_0x1361fb;if(_0x2ef743[_0x3d94('0x3c')][_0x3d94('0x43')]===_0x3d94('0x44')){var _0x5a9263=[];for(var _0x3e0da8=0x0;_0x3e0da8<_0x2235f9[_0x3d94('0x42')][_0x3d94('0x45')];_0x3e0da8++){_0x5a9263['push'](get_open_tabs(_0x3d94('0x46'),_0x2235f9['rows'][_0x3e0da8]['dataValues']));_0x5a9263[_0x3d94('0x40')](get_open_tabs(_0x3d94('0x47'),_0x2235f9[_0x3d94('0x42')][_0x3e0da8][_0x3d94('0x48')]));_0x5a9263['push'](get_open_tabs(_0x3d94('0x49'),_0x2235f9['rows'][_0x3e0da8][_0x3d94('0x48')]));_0x5a9263[_0x3d94('0x40')](get_open_tabs(_0x3d94('0x4a'),_0x2235f9[_0x3d94('0x42')][_0x3e0da8][_0x3d94('0x48')]));_0x5a9263[_0x3d94('0x40')](get_open_tabs(_0x3d94('0x4b'),_0x2235f9['rows'][_0x3e0da8][_0x3d94('0x48')]));_0x5a9263[_0x3d94('0x40')](get_open_tabs('whatsapp',_0x2235f9['rows'][_0x3e0da8][_0x3d94('0x48')]));}return BPromise[_0x3d94('0x4c')](_0x5a9263)['then'](function(_0x3c8571){return _0x2235f9;});}else{return _0x2235f9;}})[_0x3d94('0x22')](respondWithFilteredResult(_0x12c01a,_0x2e7b97))[_0x3d94('0x17')](handleError(_0x12c01a,null));};exports[_0x3d94('0x4d')]=function(_0x30ce31,_0x237056){var _0x197243={'raw':![],'where':{'id':_0x30ce31[_0x3d94('0x4e')]['id']}},_0x12babd={};_0x12babd[_0x3d94('0x4f')]=_[_0x3d94('0x50')](_[_0x3d94('0x51')](db[_0x3d94('0x36')][_0x3d94('0x37')]),[_0x3d94('0x52'),'salt']);_0x12babd[_0x3d94('0x3c')]=_[_0x3d94('0x51')](_0x30ce31[_0x3d94('0x3c')]);_0x12babd[_0x3d94('0x53')]=_[_0x3d94('0x54')](_0x12babd[_0x3d94('0x4f')],_0x12babd[_0x3d94('0x3c')]);_0x197243[_0x3d94('0x3f')]=_[_0x3d94('0x54')](_0x12babd['model'],qs[_0x3d94('0x55')](_0x30ce31['query'][_0x3d94('0x55')]));_0x197243[_0x3d94('0x3f')]=_0x197243['attributes'][_0x3d94('0x45')]?_0x197243['attributes']:_0x12babd['model'];if(_0x30ce31[_0x3d94('0x3c')]['includeAll']){_0x197243[_0x3d94('0x3e')]=[{'all':!![]}];}_0x197243=_[_0x3d94('0x56')]({},_0x197243,_0x30ce31['options']);if(!_[_0x3d94('0x2d')](_0x197243['attributes'],'id')){_0x197243['attributes'][_0x3d94('0x40')]('id');}return db[_0x3d94('0x36')][_0x3d94('0x2f')](_0x197243)[_0x3d94('0x22')](handleEntityNotFound(_0x237056,null))[_0x3d94('0x22')](function(_0x3e49f5){var _0x137052=[];values=_0x3e49f5;if(_0x30ce31[_0x3d94('0x3c')][_0x3d94('0x43')]==='true'){_0x137052[_0x3d94('0x40')](get_open_tabs(_0x3d94('0x46'),_0x3e49f5[_0x3d94('0x48')]));_0x137052[_0x3d94('0x40')](get_open_tabs(_0x3d94('0x47'),_0x3e49f5[_0x3d94('0x48')]));_0x137052[_0x3d94('0x40')](get_open_tabs(_0x3d94('0x4b'),_0x3e49f5[_0x3d94('0x48')]));_0x137052[_0x3d94('0x40')](get_open_tabs(_0x3d94('0x57'),_0x3e49f5['dataValues']));_0x137052[_0x3d94('0x40')](get_open_tabs('fax',_0x3e49f5[_0x3d94('0x48')]));_0x137052[_0x3d94('0x40')](get_open_tabs(_0x3d94('0x4a'),_0x3e49f5[_0x3d94('0x48')]));return BPromise[_0x3d94('0x4c')](_0x137052);}else{return values;}})[_0x3d94('0x22')](function(_0x1c503d){return values;})[_0x3d94('0x22')](respondWithResult(_0x237056,null))[_0x3d94('0x17')](handleError(_0x237056,null));};exports['update']=function(_0x519ada,_0x46bff3){if(_0x519ada['body']['id']){delete _0x519ada[_0x3d94('0x58')]['id'];}delete _0x519ada[_0x3d94('0x58')]['role'];return db[_0x3d94('0x36')][_0x3d94('0x2f')]({'where':{'id':_0x519ada[_0x3d94('0x4e')]['id']}})[_0x3d94('0x22')](handleEntityNotFound(_0x46bff3,null))[_0x3d94('0x22')](saveUpdates(_0x519ada[_0x3d94('0x58')],null))[_0x3d94('0x22')](respondWithResult(_0x46bff3,null))['catch'](handleError(_0x46bff3,null));};exports[_0x3d94('0x59')]=function(_0x351ea6,_0x368581){return db['User'][_0x3d94('0x59')]()[_0x3d94('0x22')](respondWithResult(_0x368581,null))[_0x3d94('0x17')](handleError(_0x368581,null));};exports[_0x3d94('0x5a')]=function(_0x5cdfb0,_0x5292cc){return db[_0x3d94('0x36')][_0x3d94('0x2f')]({'where':{'id':_0x5cdfb0[_0x3d94('0x4e')]['id']}})[_0x3d94('0x22')](handleEntityNotFound(_0x5292cc,null))['then'](function(_0x1c12da){if(_0x1c12da){return _0x1c12da[_0x3d94('0x5a')](_0x5cdfb0['body'][_0x3d94('0x5b')],_[_0x3d94('0x5c')](_0x5cdfb0[_0x3d94('0x58')],['ids','id'])||{});}})[_0x3d94('0x22')](respondWithResult(_0x5292cc,null))[_0x3d94('0x17')](handleError(_0x5292cc,null));};function validateUser(_0x585531){return new BPromise(function(_0x5747a8,_0x11eeaa){if(_0x585531[_0x3d94('0x5d')])return _0x5747a8(_0x585531);return db['Setting']['findById'](0x1)['then'](function(_0x3ac9ea){if(_0x3ac9ea[_0x3d94('0x5e')])authService[_0x3d94('0x5f')](_0x585531[_0x3d94('0x52')]);db[_0x3d94('0x36')]['max'](_0x3d94('0x5d'))[_0x3d94('0x22')](function(_0x170d06){if(_[_0x3d94('0x60')](_0x170d06)){_0x585531[_0x3d94('0x5d')]=_0x3ac9ea[_0x3d94('0x61')]||0x1;return;}if(_['isNil'](_0x3ac9ea[_0x3d94('0x61')])||_0x3ac9ea['min_internal']===_0x170d06){_0x585531[_0x3d94('0x5d')]=_0x170d06+0x1;return;}if(_0x3ac9ea[_0x3d94('0x61')]>_0x170d06){_0x585531[_0x3d94('0x5d')]=_0x3ac9ea[_0x3d94('0x61')];return;}return db[_0x3d94('0x62')][_0x3d94('0x3c')]('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db['sequelize'][_0x3d94('0x63')]['SELECT']})['then'](function(_0x5c5fb2){if(_0x5c5fb2&&_0x5c5fb2[_0x3d94('0x45')]){for(var _0x262a6a=0x0,_0x222963=_0x5c5fb2[_0x3d94('0x45')];_0x262a6a<_0x222963&&_[_0x3d94('0x60')](_0x585531[_0x3d94('0x5d')]);_0x262a6a++){if(_0x3ac9ea[_0x3d94('0x61')]<=_0x5c5fb2[_0x262a6a][_0x3d94('0x64')]){_0x585531['internal']=_0x5c5fb2[_0x262a6a][_0x3d94('0x64')];}else if(_0x3ac9ea['min_internal']>_0x5c5fb2[_0x262a6a][_0x3d94('0x64')]&&_0x3ac9ea[_0x3d94('0x61')]<=_0x5c5fb2[_0x262a6a]['to']){_0x585531[_0x3d94('0x5d')]=_0x3ac9ea['min_internal'];}}}if(_['isNil'](_0x585531['internal'])){_0x585531[_0x3d94('0x5d')]=_0x170d06+0x1;}return _0x5747a8(_0x585531);});});})[_0x3d94('0x17')](function(_0x2c9c83){_0x11eeaa(_0x2c9c83);});});}function updateUser(_0x1c7ea5){return new BPromise(function(_0x2382df,_0x51b90e){try{if(_0x1c7ea5['voicemail']){_0x1c7ea5[_0x3d94('0x65')]=_0x1c7ea5[_0x3d94('0x5d')];_0x1c7ea5[_0x3d94('0x66')]={'mailbox':_0x1c7ea5['internal'],'password':_0x1c7ea5[_0x3d94('0x52')],'fullname':_0x1c7ea5['fullname'],'email':_0x1c7ea5[_0x3d94('0x67')]};}if(_0x1c7ea5[_0x3d94('0x2e')]===_0x3d94('0x28')){if(!_0x1c7ea5[_0x3d94('0x68')])_0x1c7ea5[_0x3d94('0x68')]=[_0x3d94('0x69'),_0x3d94('0x6a'),_0x3d94('0x6b'),_0x3d94('0x6c'),_0x3d94('0x6d'),_0x3d94('0x6e'),_0x3d94('0x6f'),_0x3d94('0x70'),'107',_0x3d94('0x71'),_0x3d94('0x72'),_0x3d94('0x73'),_0x3d94('0x74'),'114',_0x3d94('0x75')];}_0x2382df(_0x1c7ea5);}catch(_0x5e03b0){_0x51b90e(_0x5e03b0);}});}exports['create']=function(_0x307dda,_0x55fed9){if(_0x307dda[_0x3d94('0x26')][_0x3d94('0x2e')]==='agent')throw new Error(_0x3d94('0x76'));if(_0x307dda['body'][_0x3d94('0x2e')]===_0x3d94('0x26')&&_0x307dda['user']['role']!=='admin'){throw new Error(_0x3d94('0x77'));}if(_0x307dda['body']['role']===_0x3d94('0x24')&&_0x307dda[_0x3d94('0x26')][_0x3d94('0x2e')]!==_0x3d94('0x24')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0x3d94('0x78')]([_0x307dda[_0x3d94('0x58')]])[_0x3d94('0x22')](function(){return validateUser(_0x307dda[_0x3d94('0x58')]);})[_0x3d94('0x22')](function(_0x200cc2){return updateUser(_0x200cc2)['then'](function(_0x467ccb){if(_0x467ccb[_0x3d94('0x2e')]===_0x3d94('0x24')){_0x467ccb[_0x3d94('0x79')]=_0x307dda[_0x3d94('0x26')][_0x3d94('0x79')];delete _0x467ccb[_0x3d94('0x7a')];}return _0x467ccb;});})[_0x3d94('0x22')](function(_0x4b3ed5){return db['User'][_0x3d94('0x7b')](_0x4b3ed5,{'include':[{'model':db[_0x3d94('0x66')],'as':_0x3d94('0x66')}]});})['then'](function(_0x43a00e){if(_0x307dda[_0x3d94('0x58')][_0x3d94('0x2e')]===_0x3d94('0x26'))return _0x43a00e;if(_0x307dda[_0x3d94('0x26')]['role']!=='user')return _0x43a00e;return db[_0x3d94('0x7c')][_0x3d94('0x2f')]({'where':{'name':_0x43a00e[_0x3d94('0x2e')]===_0x3d94('0x28')?_0x3d94('0x27'):_0x3d94('0x7d'),'userProfileId':_0x307dda[_0x3d94('0x26')][_0x3d94('0x7a')]},'raw':!![]})[_0x3d94('0x22')](function(_0x35caf5){if(!_0x35caf5||_0x35caf5[_0x3d94('0x7e')]!=0x0)return _0x43a00e;return db[_0x3d94('0x31')][_0x3d94('0x7b')]({'name':_0x43a00e['name'],'resourceId':_0x43a00e['id'],'type':_0x35caf5[_0x3d94('0x30')],'sectionId':_0x35caf5['id']},{})[_0x3d94('0x22')](function(){return _0x43a00e;});})['catch'](function(_0x5d3d6e){logger[_0x3d94('0x14')](_0x3d94('0x7f'),_0x5d3d6e);throw _0x5d3d6e;});})[_0x3d94('0x22')](respondWithResult(_0x55fed9,0xc9))[_0x3d94('0x17')](handleError(_0x55fed9,null));};exports['bulkCreate']=function(_0x482e99,_0x1f3171){var _0x2ec7d9=_0x482e99[_0x3d94('0x58')];var _0x22283d=[];if(_0x482e99[_0x3d94('0x26')]['role']===_0x3d94('0x28'))throw new Error('Unauthorized');if(_[_0x3d94('0x80')](_0x2ec7d9,[_0x3d94('0x2e'),_0x3d94('0x26')])&&_0x482e99['user'][_0x3d94('0x2e')]!==_0x3d94('0x24')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0x3d94('0x80')](_0x2ec7d9,['role',_0x3d94('0x24')])&&_0x482e99[_0x3d94('0x26')][_0x3d94('0x2e')]!=='admin'){throw new Error(_0x3d94('0x81'));}return licenseUtil[_0x3d94('0x78')](_0x2ec7d9)[_0x3d94('0x22')](function(){return validateUser(_0x2ec7d9[0x0]);})['then'](function(){for(var _0x3e091a=0x1;_0x3e091a<_0x2ec7d9[_0x3d94('0x45')];_0x3e091a++){var _0x259484=_0x2ec7d9[_0x3e091a-0x1][_0x3d94('0x5d')];if(!_0x2ec7d9[_0x3e091a][_0x3d94('0x5d')])_0x2ec7d9[_0x3e091a][_0x3d94('0x5d')]=_0x259484+0x1;_0x22283d[_0x3d94('0x40')](validateUser(_0x2ec7d9[_0x3e091a]));}return BPromise[_0x3d94('0x4c')](_0x22283d);})['then'](function(){_0x22283d=[];for(var _0x217564=0x0;_0x217564<_0x2ec7d9[_0x3d94('0x45')];_0x217564++){_0x22283d[_0x3d94('0x40')](updateUser(_0x2ec7d9[_0x217564]));}return BPromise[_0x3d94('0x4c')](_0x22283d);})[_0x3d94('0x22')](function(){return BPromise[_0x3d94('0x82')](_0x2ec7d9,function(_0x5716fd){return db[_0x3d94('0x36')][_0x3d94('0x7b')](_0x5716fd,{'include':[{'model':db[_0x3d94('0x66')],'as':'VoiceMail'}]})[_0x3d94('0x22')](function(_0x4c6c49){_0x5716fd['id']=_0x4c6c49['id'];return _0x5716fd;});});})[_0x3d94('0x22')](function(_0x3ed74f){if(_0x482e99['body'][_0x3d94('0x2e')]===_0x3d94('0x26'))return _0x3ed74f;if(_0x482e99['user']['role']!==_0x3d94('0x26'))return _0x3ed74f;var _0x36e87c=_['some'](_0x3ed74f,function(_0x5007ef){return _0x5007ef['role']===_0x3d94('0x28')||_0x5007ef[_0x3d94('0x2e')]===_0x3d94('0x29');});if(!_0x36e87c)return _0x3ed74f;return db[_0x3d94('0x7c')][_0x3d94('0x41')]({'where':{'name':{'$or':['Agents',_0x3d94('0x7d')]},'userProfileId':_0x482e99[_0x3d94('0x26')][_0x3d94('0x7a')]},'raw':!![]})['then'](function(_0x2f90c4){if(_['isEmpty'](_0x2f90c4)||!_[_0x3d94('0x80')](_0x2f90c4,[_0x3d94('0x7e'),0x0]))return _0x3ed74f;_0x22283d=[];var _0x25015e=_(_0x2f90c4)[_0x3d94('0x38')](function(_0x4527e1){if(_0x4527e1['autoAssociation']===0x1)return;return _0x4527e1['name']===_0x3d94('0x27')?_0x3d94('0x28'):'telephone';})[_0x3d94('0x83')]()['value']();for(var _0x34f1ce=0x0;_0x34f1ce<_0x3ed74f[_0x3d94('0x45')];_0x34f1ce++){if(!_[_0x3d94('0x2d')](_0x25015e,_0x3ed74f[_0x34f1ce]['role']))return;var _0x406528=_0x3ed74f[_0x34f1ce]['role']===_0x3d94('0x28')?_0x3d94('0x27'):_0x3d94('0x7d');_0x22283d[_0x3d94('0x40')](db['UserProfileResource']['create']({'name':_0x3ed74f[_0x34f1ce][_0x3d94('0x30')],'resourceId':_0x3ed74f[_0x34f1ce]['id'],'type':_0x406528,'sectionId':_[_0x3d94('0x2f')](_0x2f90c4,[_0x3d94('0x30'),_0x406528])['id']},{}));}return BPromise[_0x3d94('0x4c')](_0x22283d);});})['then'](respondWithResult(_0x1f3171,0xc9))[_0x3d94('0x17')](handleError(_0x1f3171,null));};exports['changePassword']=function(_0x49c674,_0x543b1a){if(_0x49c674[_0x3d94('0x58')]['id']){delete _0x49c674[_0x3d94('0x58')]['id'];}return db[_0x3d94('0x36')][_0x3d94('0x2f')]({'where':{'id':_0x49c674[_0x3d94('0x4e')]['id']}})[_0x3d94('0x22')](function(_0x33af12){if(!_0x33af12)return null;if(_0x33af12['id']===_0x49c674[_0x3d94('0x26')]['id']){if(!_0x49c674[_0x3d94('0x58')][_0x3d94('0x84')]||!_0x49c674[_0x3d94('0x58')][_0x3d94('0x85')]){throw new db[(_0x3d94('0x86'))][(_0x3d94('0x87'))](_0x3d94('0x88'));}if(!_0x33af12['authenticate'](_0x49c674['body'][_0x3d94('0x84')])){throw new db[(_0x3d94('0x86'))][(_0x3d94('0x87'))](_0x3d94('0x89'));}if(_0x49c674[_0x3d94('0x58')][_0x3d94('0x84')]===_0x49c674[_0x3d94('0x58')]['newPassword']){throw new db[(_0x3d94('0x86'))][(_0x3d94('0x87'))](_0x3d94('0x8a'));}}else if(_0x49c674[_0x3d94('0x26')][_0x3d94('0x2e')]===_0x3d94('0x24')){if(!_0x49c674['body']['newPassword']){throw new db[(_0x3d94('0x86'))]['ValidationError'](_0x3d94('0x8b'));}}else if(_0x49c674[_0x3d94('0x26')][_0x3d94('0x2e')]===_0x3d94('0x26')){if(!_0x49c674[_0x3d94('0x58')][_0x3d94('0x85')]){throw new db[(_0x3d94('0x86'))][(_0x3d94('0x87'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x33af12[_0x3d94('0x2e')]!==_0x3d94('0x28')){throw new db[(_0x3d94('0x86'))][(_0x3d94('0x87'))](_0x3d94('0x76'));}}else{throw new db[(_0x3d94('0x86'))][(_0x3d94('0x87'))](_0x3d94('0x76'));}return _0x33af12;})[_0x3d94('0x22')](handleEntityNotFound(_0x543b1a,null))[_0x3d94('0x22')](function(_0x285a35){return db[_0x3d94('0x8c')][_0x3d94('0x8d')]({'attributes':['id',_0x3d94('0x5e'),_0x3d94('0x8e'),_0x3d94('0x8f')]})[_0x3d94('0x22')](function(_0x252c96){if(_0x252c96[_0x3d94('0x5e')])authService[_0x3d94('0x5f')](_0x49c674[_0x3d94('0x58')]['newPassword']);if(!_0x252c96[_0x3d94('0x8e')]||!_0x285a35[_0x3d94('0x90')])return _0x285a35;authService[_0x3d94('0x91')](_0x49c674[_0x3d94('0x58')][_0x3d94('0x85')],_0x285a35[_0x3d94('0x90')],_0x252c96['passwordHistoryLimit']);return _0x285a35;})[_0x3d94('0x22')](saveUpdates({'password':_0x49c674[_0x3d94('0x58')][_0x3d94('0x85')],'passwordResetAt':_0x49c674[_0x3d94('0x26')]['id']==_0x49c674[_0x3d94('0x4e')]['id']?moment():null,'previousPasswords':authService[_0x3d94('0x92')](_0x49c674['body'][_0x3d94('0x85')],_0x285a35[_0x3d94('0x90')])},null));})['then'](respondWithResult(_0x543b1a,null))['catch'](handleError(_0x543b1a,null));};exports['addQueues']=function(_0x3e1139,_0x77b79d){var _0x20b52d=_0x3e1139[_0x3d94('0x58')][_0x3d94('0x93')];return db['User'][_0x3d94('0x2f')]({'where':{'id':_0x3e1139[_0x3d94('0x4e')]['id']},'attributes':['id',_0x3d94('0x30'),_0x3d94('0x2e'),_0x3d94('0x94'),_0x3d94('0x95'),'voicePause',_0x3d94('0x96')]})['then'](handleEntityNotFound(_0x77b79d,null))[_0x3d94('0x22')](function(_0xb970e1){if(_0xb970e1){if(!utils[_0x3d94('0x97')](_0x20b52d)){throw new db[(_0x3d94('0x86'))]['ValidationError'](_0x3d94('0x98'));}return _0xb970e1[_0x3d94('0x99')+_[_0x3d94('0x9a')](_0x20b52d[_0x3d94('0x9b')]())+'Queues'](_0x3e1139['body'][_0x3d94('0x5b')],{'penalty':_0x3e1139[_0x3d94('0x58')][_0x3d94('0x9c')]||0x0})['spread'](function(_0x2fac35){for(var _0x5ac055=0x0;_0x5ac055<_0x3e1139['body'][_0x3d94('0x5b')][_0x3d94('0x45')];_0x5ac055+=0x1){var _0x4ae177={'UserId':Number(_0x3e1139[_0x3d94('0x4e')]['id'])};_0x4ae177[_[_0x3d94('0x9a')](_0x20b52d[_0x3d94('0x9b')]())+'QueueId']=Number(_0x3e1139[_0x3d94('0x58')][_0x3d94('0x5b')][_0x5ac055]);socket['emit']('user'+_[_0x3d94('0x9a')](_0x20b52d[_0x3d94('0x9b')]())+_0x3d94('0x9d'),_0x4ae177);}return _0x2fac35;})[_0x3d94('0x22')](function(){if(_0x20b52d===_0x3d94('0x9e')){return db[_0x3d94('0x9f')]['findAll']({'where':{'id':_0x3e1139['body']['ids']||[]},'raw':!![],'attributes':['id','name']});}})[_0x3d94('0x22')](function(_0x3950d1){var _0xe2f687=_0xb970e1[_0x3d94('0x23')]({'plain':!![]});var _0x283705=[];if(_0x20b52d===_0x3d94('0x9e')&&_0xe2f687[_0x3d94('0x2e')]===_0x3d94('0x28')&&_0xe2f687[_0x3d94('0x94')]){for(var _0x414b82=0x0;_0x414b82<_0x3950d1[_0x3d94('0x45')];_0x414b82+=0x1){_0x283705['push']({'membername':_0xe2f687[_0x3d94('0x30')],'UserId':_0xe2f687['id'],'queue_name':_0x3950d1[_0x414b82]['name'],'VoiceQueueId':_0x3950d1[_0x414b82]['id'],'interface':_[_0x3d94('0x60')](_0xe2f687[_0x3d94('0x96')])?util[_0x3d94('0xa0')](_0x3d94('0xa1'),_0xe2f687[_0x3d94('0x30')]):_0xe2f687[_0x3d94('0x96')],'paused':_0xe2f687[_0x3d94('0xa2')]||![],'penalty':_0x3e1139[_0x3d94('0x58')]['penalty']||0x0});}return BPromise[_0x3d94('0x82')](_0x283705,function(_0x11ae22){return db[_0x3d94('0xa3')][_0x3d94('0xa4')](_0x11ae22);});}return _0xb970e1;});}})[_0x3d94('0x22')](respondWithStatusCode(_0x77b79d,null))[_0x3d94('0x17')](handleError(_0x77b79d,null));};exports[_0x3d94('0xa5')]=function(_0x1b7ad4,_0x483e7a){var _0x2f82cb;return db[_0x3d94('0x36')][_0x3d94('0x2f')]({'where':{'id':_0x1b7ad4[_0x3d94('0x4e')]['id']},'attributes':['id',_0x3d94('0x30'),_0x3d94('0x2e')]})[_0x3d94('0x22')](handleEntityNotFound(_0x483e7a,null))[_0x3d94('0x22')](function(_0x5ace4e){if(_0x5ace4e){_0x2f82cb=_0x5ace4e;if(!_0x1b7ad4[_0x3d94('0x3c')][_0x3d94('0x93')]||!utils['isValidChannel'](_0x1b7ad4[_0x3d94('0x3c')][_0x3d94('0x93')])){throw new db[(_0x3d94('0x86'))][(_0x3d94('0x87'))](_0x3d94('0x98'));}return _0x5ace4e[_0x3d94('0xa6')+_[_0x3d94('0x9a')](_0x1b7ad4[_0x3d94('0x3c')][_0x3d94('0x93')][_0x3d94('0x9b')]())+_0x3d94('0xa7')](_0x1b7ad4[_0x3d94('0x3c')][_0x3d94('0x5b')]);}})[_0x3d94('0x22')](function(_0x186c79){if(_[_0x3d94('0xa8')](_0x1b7ad4[_0x3d94('0x3c')][_0x3d94('0x5b')])){for(var _0x2f6440=0x0;_0x2f6440<_0x1b7ad4[_0x3d94('0x3c')][_0x3d94('0x5b')][_0x3d94('0x45')];_0x2f6440+=0x1){var _0x41fd2c={'UserId':Number(_0x1b7ad4[_0x3d94('0x4e')]['id'])};_0x41fd2c[_[_0x3d94('0x9a')](_0x1b7ad4['query']['channel'][_0x3d94('0x9b')]())+'QueueId']=Number(_0x1b7ad4['query'][_0x3d94('0x5b')][_0x2f6440]);socket[_0x3d94('0xa9')](_0x3d94('0x26')+_[_0x3d94('0x9a')](_0x1b7ad4[_0x3d94('0x3c')]['channel'][_0x3d94('0x9b')]())+'Queue:remove',_0x41fd2c);}}else{var _0x41fd2c={'UserId':Number(_0x1b7ad4[_0x3d94('0x4e')]['id'])};_0x41fd2c[_[_0x3d94('0x9a')](_0x1b7ad4[_0x3d94('0x3c')][_0x3d94('0x93')][_0x3d94('0x9b')]())+_0x3d94('0xaa')]=Number(_0x1b7ad4[_0x3d94('0x3c')][_0x3d94('0x5b')]);socket[_0x3d94('0xa9')](_0x3d94('0x26')+_[_0x3d94('0x9a')](_0x1b7ad4[_0x3d94('0x3c')][_0x3d94('0x93')][_0x3d94('0x9b')]())+'Queue:remove',_0x41fd2c);}return _0x186c79;})['then'](function(){if(_0x1b7ad4['query'][_0x3d94('0x93')]===_0x3d94('0x9e')){return db['UserVoiceQueueRt'][_0x3d94('0x21')]({'where':{'UserId':_0x1b7ad4[_0x3d94('0x4e')]['id'],'VoiceQueueId':_0x1b7ad4['query'][_0x3d94('0x5b')]},'individualHooks':!![]})[_0x3d94('0x22')](function(){return _0x2f82cb;});}return _0x2f82cb;})[_0x3d94('0x22')](respondWithStatusCode(_0x483e7a,null))[_0x3d94('0x17')](handleError(_0x483e7a,null));};exports[_0x3d94('0xab')]=function(_0x478f09,_0x36df43){_0x478f09[_0x3d94('0x58')][_0x3d94('0xac')]=_0x478f09[_0x3d94('0xad')][_0x3d94('0xae')];return db[_0x3d94('0x36')][_0x3d94('0x2f')]({'where':{'id':_0x478f09[_0x3d94('0x4e')]['id']}})[_0x3d94('0x22')](handleEntityNotFound(_0x36df43,null))['then'](saveUpdates(_0x478f09[_0x3d94('0x58')],null))[_0x3d94('0x22')](respondWithResult(_0x36df43,null))[_0x3d94('0x17')](handleError(_0x36df43,null));};exports[_0x3d94('0xaf')]=function(_0x258a63,_0x359d07){var _0x4bb2f8=path['join'](config[_0x3d94('0xb0')],_0x3d94('0xb1'));return db['User'][_0x3d94('0x2f')]({'where':{'id':_0x258a63[_0x3d94('0x4e')]['id']},'attributes':['id',_0x3d94('0xac')],'raw':!![]})[_0x3d94('0x22')](handleEntityNotFound(_0x359d07,null))[_0x3d94('0x22')](function(_0x5c192c){if(_0x5c192c){if(_[_0x3d94('0x60')](_0x5c192c['userpic'])){return _0x359d07[_0x3d94('0xb2')](_0x4bb2f8);}else{if(!fs['existsSync'](path['join'](config[_0x3d94('0xb0')],_0x3d94('0xb3'),_0x5c192c[_0x3d94('0xac')]))){return _0x359d07[_0x3d94('0xb2')](_0x4bb2f8);}return _0x359d07[_0x3d94('0xb2')](path['join'](config[_0x3d94('0xb0')],'server/files/images/',_0x5c192c['userpic']));}}})['catch'](handleError(_0x359d07,null));};exports[_0x3d94('0xb4')]=function(_0x5dcf61,_0x67afd6){return db[_0x3d94('0x36')][_0x3d94('0x2f')]({'where':{'id':_0x5dcf61[_0x3d94('0x4e')]['id']},'attributes':['id']})[_0x3d94('0x22')](handleEntityNotFound(_0x67afd6,null))['then'](function(_0x1067f1){var _0x3956f9=[];values=_0x1067f1[_0x3d94('0x48')];_0x3956f9[_0x3d94('0x40')](get_open_tabs(_0x3d94('0x46'),_0x1067f1[_0x3d94('0x48')]));_0x3956f9['push'](get_open_tabs(_0x3d94('0x47'),_0x1067f1['dataValues']));_0x3956f9['push'](get_open_tabs(_0x3d94('0x4b'),_0x1067f1['dataValues']));_0x3956f9[_0x3d94('0x40')](get_open_tabs(_0x3d94('0x57'),_0x1067f1[_0x3d94('0x48')]));_0x3956f9['push'](get_open_tabs('fax',_0x1067f1[_0x3d94('0x48')]));_0x3956f9['push'](get_open_tabs(_0x3d94('0x4a'),_0x1067f1[_0x3d94('0x48')]));return BPromise['all'](_0x3956f9);})[_0x3d94('0x22')](function(_0x927882){var _0x302510=[];if(_0x927882){for(var _0x2f0128=0x0;_0x2f0128=_0x2ffa48[_0x15e4('0x54')]){throw new Error(_0x15e4('0x55'));}})[_0x15e4('0xf')](function(){if(_0x4e86cd){return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x4e86cd[_0x15e4('0x2d')]},'individualHooks':!![]});}})[_0x15e4('0xf')](function(){if(_0x4e86cd){return _0x4e86cd[_0x15e4('0x56')]({'raw':!![]});}})[_0x15e4('0xf')](function(_0xcda284){if(_0x4e86cd){if(_0xcda284){var _0x452919=[];_0x53114e=_0xcda284;if(_0x53114e[_0x15e4('0x2f')]){for(var _0xdf5bd4=0x0;_0xdf5bd4<_0x53114e[_0x15e4('0x2f')];_0xdf5bd4++){_0x452919[_0x15e4('0x35')](db[_0x15e4('0x29')][_0x15e4('0x57')]({'membername':_0x4e86cd[_0x15e4('0x2d')],'UserId':_0x4e86cd['id'],'queue_name':_0x53114e[_0xdf5bd4][_0x15e4('0x2d')],'VoiceQueueId':_0x53114e[_0xdf5bd4]['id'],'interface':_0x3883f9,'paused':_0x4e86cd[_0x15e4('0x4f')]||![],'penalty':_0x53114e[_0xdf5bd4][_0x15e4('0x58')]||0x0}));}return BPromise[_0x15e4('0x49')](_0x452919);}}}})[_0x15e4('0xf')](function(){if(_0x4e86cd){return db[_0x15e4('0x2b')]['findAll']({'where':{'membername':_0x4e86cd['name'],'exitAt':null}});}})[_0x15e4('0xf')](function(_0x4ed606){if(_0x4e86cd){if(_0x4ed606&&_0x4ed606['length']){var _0x2740a4=[];_0x4ed606[_0x15e4('0x34')](function(_0x4e9415){_0x2740a4[_0x15e4('0x35')](_0x4e9415['update']({'exitAt':moment()[_0x15e4('0x30')](_0x15e4('0x31'))}));});return BPromise['all'](_0x2740a4);}}})[_0x15e4('0xf')](function(_0x452f8a){if(_0x4e86cd){var _0x17af6d=[];var _0x51bf17=[];var _0x156388=utils[_0x15e4('0x33')]();var _0x44c22c={'membername':_0x4e86cd[_0x15e4('0x2d')],'interface':_0x3883f9,'enterAt':moment()['format'](_0x15e4('0x31')),'role':_0x4e86cd['role'],'internal':_0x4e86cd[_0x15e4('0x27')]};_0x156388[_0x15e4('0x34')](function(_0x40ae72){_0x17af6d[_0x15e4('0x35')](_[_0x15e4('0x59')]({'channel':_0x40ae72,'type':_0x15e4('0x5a'),'data1':_0x15e4('0x5b'),'data2':_0x3883f9},_0x44c22c));if(_0x4e86cd[_0x15e4('0x4f')]){_0x51bf17[_0x15e4('0x35')](_['merge']({'channel':_0x40ae72,'type':_0x15e4('0x2e'),'data1':_0x15e4('0x5c')},_0x44c22c));}});return db[_0x15e4('0x2b')][_0x15e4('0x3b')](_0x17af6d[_0x15e4('0x5d')](_0x51bf17),{'individualHooks':!![]});}})[_0x15e4('0xf')](function(){if(_0x4e86cd){return _0x4e86cd[_0x15e4('0x2a')]({'online':!![],'lastLoginAt':moment()[_0x15e4('0x30')](_0x15e4('0x31')),'voicePause':_0x4e86cd['loginInPause']||![],'mailPause':_0x4e86cd[_0x15e4('0x4f')]||![],'chatPause':_0x4e86cd[_0x15e4('0x4f')]||![],'faxPause':_0x4e86cd[_0x15e4('0x4f')]||![],'smsPause':_0x4e86cd[_0x15e4('0x4f')]||![],'openchannelPause':_0x4e86cd[_0x15e4('0x4f')]||![],'pauseType':_0x4e86cd[_0x15e4('0x4f')]?'LOGININPAUSE':null,'lastPauseAt':moment()[_0x15e4('0x30')](_0x15e4('0x31')),'interface':_0x3883f9});}})['then'](function(_0xb61ce7){_0x55e59f(_0xb61ce7);})[_0x15e4('0x18')](function(_0x2cd085){_0x177c9a(_0xc1eaa6[_0x15e4('0x16')](0x1f4,_0x2cd085[_0x15e4('0x17')]));});});}; \ No newline at end of file +var _0x0bd6=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','defaults','redis','socket.io-emitter','register','request','info','User,\x20%s,\x20%s','User,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','GetUser','User','findAll','options','raw','attributes','include','map','model','then','debug','ShowUser','find','where','name','internal','interface','UserVoiceQueueRt','update','MemberReport','PAUSE','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','getChannels','forEach','push','isNil','format','SIP/%s','body','type','DEFAULT\x20PAUSE','uniqueid','bulkCreate','UnpauseUser','findOne','channel','isValidChannel','Unknown\x20channel','voice','mail','chat','fax','sms','whatsapp','system','set','all','LogoutUser','destroy','role','mobile','phone','loginInPause','count','agent','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','UserVoiceQueue.penalty','merge','LOGIN','callysquare','LOGININPAUSE'];(function(_0x4c43c9,_0xf8822a){var _0x52b44f=function(_0x59e00d){while(--_0x59e00d){_0x4c43c9['push'](_0x4c43c9['shift']());}};_0x52b44f(++_0xf8822a);}(_0x0bd6,0x174));var _0x60bd=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x0bd6[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x60bd('0x0'));var util=require('util');var moment=require(_0x60bd('0x1'));var BPromise=require(_0x60bd('0x2'));var rs=require(_0x60bd('0x3'));var fs=require('fs');var Redis=require(_0x60bd('0x4'));var db=require(_0x60bd('0x5'))['db'];var utils=require(_0x60bd('0x6'));var logger=require(_0x60bd('0x7'))(_0x60bd('0x8'));var config=require('../../config/environment');var jayson=require(_0x60bd('0x9'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x60bd('0xa')](config[_0x60bd('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x60bd('0xc'))(new Redis(config[_0x60bd('0xb')]));require('./user.socket')[_0x60bd('0xd')](socket);function respondWithRpcPromise(_0x187b2f,_0x28f5d,_0x3d9087){return new BPromise(function(_0x8ef558,_0xeafb82){return client[_0x60bd('0xe')](_0x187b2f,_0x3d9087)['then'](function(_0x41ba31){logger[_0x60bd('0xf')](_0x60bd('0x10'),_0x28f5d,'request\x20sent');logger['debug'](_0x60bd('0x11'),_0x28f5d,_0x60bd('0x12'),JSON[_0x60bd('0x13')](_0x41ba31));if(_0x41ba31['error']){if(_0x41ba31['error'][_0x60bd('0x14')]===0x1f4){logger[_0x60bd('0x15')](_0x60bd('0x10'),_0x28f5d,_0x41ba31['error'][_0x60bd('0x16')]);return _0xeafb82(_0x41ba31[_0x60bd('0x15')]['message']);}logger[_0x60bd('0x15')](_0x60bd('0x10'),_0x28f5d,_0x41ba31[_0x60bd('0x15')][_0x60bd('0x16')]);return _0x8ef558(_0x41ba31['error'][_0x60bd('0x16')]);}else{logger[_0x60bd('0xf')](_0x60bd('0x10'),_0x28f5d,_0x60bd('0x12'));_0x8ef558(_0x41ba31[_0x60bd('0x17')]['message']);}})[_0x60bd('0x18')](function(_0x1ea866){logger[_0x60bd('0x15')]('User,\x20%s,\x20%s',_0x28f5d,_0x1ea866);_0xeafb82(_0x1ea866);});});}exports[_0x60bd('0x19')]=function(_0x2901ef){var _0xbe89ea=this;return new Promise(function(_0x517df9,_0x90fb72){return db[_0x60bd('0x1a')][_0x60bd('0x1b')]({'raw':_0x2901ef[_0x60bd('0x1c')]?_0x2901ef['options'][_0x60bd('0x1d')]===undefined?!![]:![]:!![],'where':_0x2901ef[_0x60bd('0x1c')]?_0x2901ef['options']['where']||null:null,'attributes':_0x2901ef[_0x60bd('0x1c')]?_0x2901ef['options'][_0x60bd('0x1e')]||null:null,'limit':_0x2901ef[_0x60bd('0x1c')]?_0x2901ef[_0x60bd('0x1c')]['limit']||null:null,'include':_0x2901ef[_0x60bd('0x1c')]?_0x2901ef[_0x60bd('0x1c')][_0x60bd('0x1f')]?_[_0x60bd('0x20')](_0x2901ef[_0x60bd('0x1c')][_0x60bd('0x1f')],function(_0xf6eade){return{'model':db[_0xf6eade[_0x60bd('0x21')]],'as':_0xf6eade['as'],'attributes':_0xf6eade[_0x60bd('0x1e')],'include':_0xf6eade['include']?_[_0x60bd('0x20')](_0xf6eade['include'],function(_0x3d84fb){return{'model':db[_0x3d84fb[_0x60bd('0x21')]],'as':_0x3d84fb['as'],'attributes':_0x3d84fb[_0x60bd('0x1e')],'include':_0x3d84fb[_0x60bd('0x1f')]?_[_0x60bd('0x20')](_0x3d84fb['include'],function(_0x5e4073){return{'model':db[_0x5e4073[_0x60bd('0x21')]],'as':_0x5e4073['as'],'attributes':_0x5e4073[_0x60bd('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x60bd('0x22')](function(_0x4f4f35){logger[_0x60bd('0xf')](_0x60bd('0x19'),_0x2901ef);logger[_0x60bd('0x23')](_0x60bd('0x19'),_0x2901ef,JSON[_0x60bd('0x13')](_0x4f4f35));_0x517df9(_0x4f4f35);})[_0x60bd('0x18')](function(_0x549573){logger[_0x60bd('0x15')](_0x60bd('0x19'),_0x549573[_0x60bd('0x16')],_0x2901ef);_0x90fb72(_0xbe89ea[_0x60bd('0x15')](0x1f4,_0x549573[_0x60bd('0x16')]));});});};exports[_0x60bd('0x24')]=function(_0x1425a4){var _0x4019b8=this;return new Promise(function(_0x21c06f,_0xb8196f){return db['User'][_0x60bd('0x25')]({'raw':_0x1425a4['options']?_0x1425a4['options'][_0x60bd('0x1d')]===undefined?!![]:![]:!![],'where':_0x1425a4[_0x60bd('0x1c')]?_0x1425a4[_0x60bd('0x1c')]['where']||null:null,'attributes':_0x1425a4[_0x60bd('0x1c')]?_0x1425a4['options']['attributes']||null:null,'include':_0x1425a4[_0x60bd('0x1c')]?_0x1425a4[_0x60bd('0x1c')]['include']?_[_0x60bd('0x20')](_0x1425a4[_0x60bd('0x1c')][_0x60bd('0x1f')],function(_0x4297e0){return{'model':db[_0x4297e0[_0x60bd('0x21')]],'as':_0x4297e0['as'],'attributes':_0x4297e0[_0x60bd('0x1e')],'include':_0x4297e0[_0x60bd('0x1f')]?_[_0x60bd('0x20')](_0x4297e0[_0x60bd('0x1f')],function(_0x12eb14){return{'model':db[_0x12eb14['model']],'as':_0x12eb14['as'],'attributes':_0x12eb14[_0x60bd('0x1e')],'include':_0x12eb14[_0x60bd('0x1f')]?_['map'](_0x12eb14['include'],function(_0x4fb940){return{'model':db[_0x4fb940['model']],'as':_0x4fb940['as'],'attributes':_0x4fb940['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4bd7c4){logger[_0x60bd('0xf')](_0x60bd('0x24'),_0x1425a4);logger[_0x60bd('0x23')](_0x60bd('0x24'),_0x1425a4,JSON[_0x60bd('0x13')](_0x4bd7c4));_0x21c06f(_0x4bd7c4);})[_0x60bd('0x18')](function(_0x173b85){logger[_0x60bd('0x15')](_0x60bd('0x24'),_0x173b85[_0x60bd('0x16')],_0x1425a4);_0xb8196f(_0x4019b8[_0x60bd('0x15')](0x1f4,_0x173b85['message']));});});};exports['PauseUser']=function(_0x462bc6){var _0x5721fb=this;return new Promise(function(_0x1ff4ec,_0xcc688d){var _0x5f0e49;return db[_0x60bd('0x1a')][_0x60bd('0x25')]({'where':_0x462bc6['options'][_0x60bd('0x26')]||{},'attributes':['id',_0x60bd('0x27'),'role',_0x60bd('0x28'),_0x60bd('0x29')]})[_0x60bd('0x22')](function(_0x6be086){if(_0x6be086){_0x5f0e49=_0x6be086;return db[_0x60bd('0x2a')][_0x60bd('0x2b')]({'paused':0x1},{'where':{'UserId':_0x5f0e49['id']},'individualHooks':!![]});}})['then'](function(){if(_0x5f0e49){return db[_0x60bd('0x2c')]['findAll']({'where':{'membername':_0x5f0e49[_0x60bd('0x27')],'type':_0x60bd('0x2d'),'exitAt':null}});}})[_0x60bd('0x22')](function(_0x2d4d0b){if(_0x5f0e49){if(_0x2d4d0b&&_0x2d4d0b['length']){var _0x33f07d=moment()['format'](_0x60bd('0x2e'));for(var _0x5ab633=0x0,_0x376450=_0x2d4d0b[_0x60bd('0x2f')];_0x5ab633<_0x376450;_0x5ab633++){_0x2d4d0b[_0x5ab633][_0x60bd('0x30')]({'exitAt':_0x33f07d});}}}})[_0x60bd('0x22')](function(){if(_0x5f0e49){var _0x2bdd22=[];var _0x30ee39=utils[_0x60bd('0x31')]();_0x30ee39[_0x60bd('0x32')](function(_0x54edeb){_0x2bdd22[_0x60bd('0x33')]({'channel':_0x54edeb,'membername':_0x5f0e49[_0x60bd('0x27')],'interface':_[_0x60bd('0x34')](_0x5f0e49[_0x60bd('0x29')])?util[_0x60bd('0x35')](_0x60bd('0x36'),_0x5f0e49[_0x60bd('0x27')]):_0x5f0e49[_0x60bd('0x29')],'type':_0x60bd('0x2d'),'enterAt':moment()[_0x60bd('0x35')](_0x60bd('0x2e')),'data1':_0x462bc6[_0x60bd('0x37')][_0x60bd('0x38')]||_0x60bd('0x39'),'role':_0x5f0e49['role'],'internal':_0x5f0e49[_0x60bd('0x28')],'uniqueid':_0x462bc6['body'][_0x60bd('0x3a')]||null});});return db[_0x60bd('0x2c')][_0x60bd('0x3b')](_0x2bdd22,{'individualHooks':!![]});}})[_0x60bd('0x22')](function(){if(_0x5f0e49){return _0x5f0e49[_0x60bd('0x2b')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x462bc6[_0x60bd('0x37')][_0x60bd('0x38')]||_0x60bd('0x39'),'lastPauseAt':moment()[_0x60bd('0x35')](_0x60bd('0x2e'))});}})[_0x60bd('0x22')](function(_0x271922){_0x1ff4ec(_0x271922);})[_0x60bd('0x18')](function(_0xfa267d){_0xcc688d(_0x5721fb['error'](0x1f4,_0xfa267d[_0x60bd('0x16')]));});});};exports[_0x60bd('0x3c')]=function(_0x5d09dd){var _0x4092bb=this;return new Promise(function(_0xd51aac,_0x474ae5){var _0x1b96c1;return db[_0x60bd('0x1a')][_0x60bd('0x3d')]({'where':_0x5d09dd['options'][_0x60bd('0x26')]||{},'attributes':['id',_0x60bd('0x27')]})[_0x60bd('0x22')](function(_0x3793ae){if(_0x3793ae){_0x1b96c1=_0x3793ae;if(_0x5d09dd[_0x60bd('0x37')][_0x60bd('0x3e')]&&!utils[_0x60bd('0x3f')](_0x5d09dd['body'][_0x60bd('0x3e')])){throw new Error(_0x60bd('0x40'));}switch(_0x5d09dd[_0x60bd('0x37')]['channel']){case _0x60bd('0x41'):return db['UserVoiceQueueRt']['update']({'paused':0x0},{'where':{'UserId':_0x1b96c1['id']}})['then'](function(){return db['MemberReport'][_0x60bd('0x25')]({'where':{'channel':_0x5d09dd[_0x60bd('0x37')]['channel'],'membername':_0x1b96c1['name'],'type':_0x60bd('0x2d'),'exitAt':null}});})[_0x60bd('0x22')](function(_0x593218){if(_0x593218){return _0x593218[_0x60bd('0x2b')]({'exitAt':moment()['format'](_0x60bd('0x2e')),'data2':'system'},{'individualHooks':!![]});}return null;})[_0x60bd('0x22')](function(){return _0x1b96c1[_0x60bd('0x2b')]({'voicePause':![]});});case _0x60bd('0x42'):case _0x60bd('0x43'):case _0x60bd('0x44'):case _0x60bd('0x45'):case'openchannel':case _0x60bd('0x46'):return db['MemberReport']['find']({'where':{'channel':_0x5d09dd[_0x60bd('0x37')][_0x60bd('0x3e')],'membername':_0x1b96c1[_0x60bd('0x27')],'type':_0x60bd('0x2d'),'exitAt':null}})['then'](function(_0x27a8ed){return _0x27a8ed[_0x60bd('0x2b')]({'exitAt':moment()[_0x60bd('0x35')](_0x60bd('0x2e')),'data2':_0x60bd('0x47')},{'individualHooks':!![]});})[_0x60bd('0x22')](function(){var _0x29983e={};_[_0x60bd('0x48')](_0x29983e,util['format']('%s%s',_0x5d09dd[_0x60bd('0x37')][_0x60bd('0x3e')],'Pause'),![]);return _0x1b96c1[_0x60bd('0x2b')](_0x29983e);});default:return db[_0x60bd('0x2a')][_0x60bd('0x2b')]({'paused':0x0},{'where':{'UserId':_0x1b96c1['id']}})['then'](function(){return db[_0x60bd('0x2c')][_0x60bd('0x1b')]({'where':{'membername':_0x1b96c1[_0x60bd('0x27')],'type':_0x60bd('0x2d'),'exitAt':null}});})[_0x60bd('0x22')](function(_0x2a4f5c){var _0x4a6fec=[];_0x2a4f5c[_0x60bd('0x32')](function(_0x45ac5e){_0x4a6fec['push'](_0x45ac5e[_0x60bd('0x2b')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x60bd('0x47')}));});return BPromise[_0x60bd('0x49')](_0x4a6fec);})[_0x60bd('0x22')](function(){return _0x1b96c1[_0x60bd('0x2b')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})['then'](function(_0x437b1d){_0xd51aac(_0x437b1d);})[_0x60bd('0x18')](function(_0x1793ad){_0x474ae5(_0x4092bb[_0x60bd('0x15')](0x1f4,_0x1793ad['message']));});});};exports[_0x60bd('0x4a')]=function(_0x7c6ad1){var _0x10560e=this;return new Promise(function(_0x5a4850,_0x1b2913){var _0x40c8de;return db['User']['findOne']({'where':_0x7c6ad1[_0x60bd('0x1c')][_0x60bd('0x26')]||{},'attributes':['id',_0x60bd('0x27')]})[_0x60bd('0x22')](function(_0x1e3a67){if(_0x1e3a67){_0x40c8de=_0x1e3a67;return db[_0x60bd('0x2a')][_0x60bd('0x4b')]({'where':{'membername':_0x40c8de['name']},'individualHooks':!![]});}})[_0x60bd('0x22')](function(){if(_0x40c8de){return db[_0x60bd('0x2c')][_0x60bd('0x1b')]({'where':{'membername':_0x40c8de[_0x60bd('0x27')],'exitAt':null}});}})[_0x60bd('0x22')](function(_0x60c4e3){if(_0x40c8de){if(_0x60c4e3&&_0x60c4e3[_0x60bd('0x2f')]){var _0x15267f=[];_0x60c4e3[_0x60bd('0x32')](function(_0x5af57a){_0x15267f[_0x60bd('0x33')](_0x5af57a[_0x60bd('0x2b')]({'exitAt':moment()[_0x60bd('0x35')](_0x60bd('0x2e'))}));});return BPromise[_0x60bd('0x49')](_0x15267f);}}})[_0x60bd('0x22')](function(){if(_0x40c8de){return _0x40c8de['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x60bd('0x22')](function(_0x43945a){_0x5a4850(_0x43945a);})[_0x60bd('0x18')](function(_0x30abb9){_0x1b2913(_0x10560e['error'](0x1f4,_0x30abb9[_0x60bd('0x16')]));});});};exports['LoginUser']=function(_0x1571b0){var _0x50b104=this;return new Promise(function(_0x281f05,_0x1c6e43){var _0x2d08b4;var _0xec3990;var _0x5ca4a4;var _0x203f18;return db[_0x60bd('0x1a')][_0x60bd('0x3d')]({'where':_0x1571b0[_0x60bd('0x1c')][_0x60bd('0x26')]||{},'attributes':['id',_0x60bd('0x27'),_0x60bd('0x4c'),_0x60bd('0x4d'),_0x60bd('0x4e'),'internal',_0x60bd('0x4f'),_0x60bd('0x29')]})[_0x60bd('0x22')](function(_0x514402){if(_0x514402){_0x2d08b4=_0x514402;_0x203f18=_0x1571b0['body'][_0x60bd('0x29')]?_0x1571b0['body']['interface']:util['format'](_0x60bd('0x36'),_0x2d08b4[_0x60bd('0x27')]);return db[_0x60bd('0x1a')][_0x60bd('0x50')]({'where':{'role':_0x60bd('0x51'),'online':!![],'id':{'$ne':_0x2d08b4['id']}}});}})[_0x60bd('0x22')](function(_0x41497e){if(_0x41497e){_0x5ca4a4=_0x41497e;return require(_0x60bd('0x52'))[_0x60bd('0x53')]();}})[_0x60bd('0x22')](function(_0x2ed32b){if(_0x2ed32b&&_0x2ed32b[_0x60bd('0x54')]&&_0x5ca4a4>=_0x2ed32b['agents']){throw new Error(_0x60bd('0x55'));}})[_0x60bd('0x22')](function(){if(_0x2d08b4){return db[_0x60bd('0x2a')][_0x60bd('0x4b')]({'where':{'membername':_0x2d08b4[_0x60bd('0x27')]},'individualHooks':!![]});}})[_0x60bd('0x22')](function(){if(_0x2d08b4){return _0x2d08b4[_0x60bd('0x56')]({'raw':!![]});}})[_0x60bd('0x22')](function(_0x43010a){if(_0x2d08b4){if(_0x43010a){var _0x540b9c=[];_0xec3990=_0x43010a;if(_0xec3990['length']){for(var _0x1dd618=0x0;_0x1dd618<_0xec3990[_0x60bd('0x2f')];_0x1dd618++){_0x540b9c[_0x60bd('0x33')](db[_0x60bd('0x2a')][_0x60bd('0x57')]({'membername':_0x2d08b4[_0x60bd('0x27')],'UserId':_0x2d08b4['id'],'queue_name':_0xec3990[_0x1dd618][_0x60bd('0x27')],'VoiceQueueId':_0xec3990[_0x1dd618]['id'],'interface':_0x203f18,'paused':_0x2d08b4[_0x60bd('0x4f')]||![],'penalty':_0xec3990[_0x1dd618][_0x60bd('0x58')]||0x0}));}return BPromise[_0x60bd('0x49')](_0x540b9c);}}}})[_0x60bd('0x22')](function(){if(_0x2d08b4){return db['MemberReport']['findAll']({'where':{'membername':_0x2d08b4['name'],'exitAt':null}});}})[_0x60bd('0x22')](function(_0x5ab7a8){if(_0x2d08b4){if(_0x5ab7a8&&_0x5ab7a8[_0x60bd('0x2f')]){var _0x23e5a0=[];_0x5ab7a8['forEach'](function(_0x246ee7){_0x23e5a0[_0x60bd('0x33')](_0x246ee7[_0x60bd('0x2b')]({'exitAt':moment()[_0x60bd('0x35')](_0x60bd('0x2e'))}));});return BPromise['all'](_0x23e5a0);}}})[_0x60bd('0x22')](function(_0x58c22e){if(_0x2d08b4){var _0x2afe40=[];var _0x10004f=[];var _0x32bf37=utils['getChannels']();var _0xf6ce6a={'membername':_0x2d08b4[_0x60bd('0x27')],'interface':_0x203f18,'enterAt':moment()[_0x60bd('0x35')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x2d08b4[_0x60bd('0x4c')],'internal':_0x2d08b4['internal']};_0x32bf37[_0x60bd('0x32')](function(_0x10915f){_0x2afe40[_0x60bd('0x33')](_[_0x60bd('0x59')]({'channel':_0x10915f,'type':_0x60bd('0x5a'),'data1':_0x60bd('0x5b'),'data2':_0x203f18},_0xf6ce6a));if(_0x2d08b4[_0x60bd('0x4f')]){_0x10004f['push'](_[_0x60bd('0x59')]({'channel':_0x10915f,'type':_0x60bd('0x2d'),'data1':_0x60bd('0x5c')},_0xf6ce6a));}});return db[_0x60bd('0x2c')]['bulkCreate'](_0x2afe40['concat'](_0x10004f),{'individualHooks':!![]});}})['then'](function(){if(_0x2d08b4){return _0x2d08b4[_0x60bd('0x2b')]({'online':!![],'lastLoginAt':moment()[_0x60bd('0x35')](_0x60bd('0x2e')),'voicePause':_0x2d08b4[_0x60bd('0x4f')]||![],'mailPause':_0x2d08b4[_0x60bd('0x4f')]||![],'chatPause':_0x2d08b4[_0x60bd('0x4f')]||![],'faxPause':_0x2d08b4[_0x60bd('0x4f')]||![],'smsPause':_0x2d08b4['loginInPause']||![],'openchannelPause':_0x2d08b4[_0x60bd('0x4f')]||![],'pauseType':_0x2d08b4[_0x60bd('0x4f')]?_0x60bd('0x5c'):null,'lastPauseAt':moment()[_0x60bd('0x35')](_0x60bd('0x2e')),'interface':_0x203f18});}})[_0x60bd('0x22')](function(_0x79b864){_0x281f05(_0x79b864);})[_0x60bd('0x18')](function(_0x2c1119){_0x1c6e43(_0x50b104['error'](0x1f4,_0x2c1119[_0x60bd('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 3bcfbae..185dc1f 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 _0xa7c2=['save','remove','update','emit','removeListener','length'];(function(_0x31abee,_0x11ff0c){var _0x3c1761=function(_0x2b5062){while(--_0x2b5062){_0x31abee['push'](_0x31abee['shift']());}};_0x3c1761(++_0x11ff0c);}(_0xa7c2,0x132));var _0x2a7c=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0xa7c2[_0x17928f];return _0x500b63;};'use strict';var UserEvents=require('./user.events');var events=[_0x2a7c('0x0'),_0x2a7c('0x1'),_0x2a7c('0x2')];function createListener(_0x2cae7e,_0x3484a0){return function(_0x5f106c){_0x3484a0[_0x2a7c('0x3')](_0x2cae7e,_0x5f106c);};}function removeListener(_0x50fc08,_0x41b288){return function(){UserEvents[_0x2a7c('0x4')](_0x50fc08,_0x41b288);};}exports['register']=function(_0x94112d){for(var _0x388f63=0x0,_0x3acc61=events[_0x2a7c('0x5')];_0x388f63<_0x3acc61;_0x388f63++){var _0x370499=events[_0x388f63];var _0x4f31b1=createListener('user:'+_0x370499,_0x94112d);UserEvents['on'](_0x370499,_0x4f31b1);}}; \ No newline at end of file +var _0x7e19=['user:','./user.events','remove','update','emit','removeListener','length'];(function(_0x5c0ce8,_0x250f42){var _0x4c6573=function(_0x19f738){while(--_0x19f738){_0x5c0ce8['push'](_0x5c0ce8['shift']());}};_0x4c6573(++_0x250f42);}(_0x7e19,0x119));var _0x97e1=function(_0x41deb8,_0x458105){_0x41deb8=_0x41deb8-0x0;var _0x1e2084=_0x7e19[_0x41deb8];return _0x1e2084;};'use strict';var UserEvents=require(_0x97e1('0x0'));var events=['save',_0x97e1('0x1'),_0x97e1('0x2')];function createListener(_0x2553a3,_0x2f5f3b){return function(_0x3d3061){_0x2f5f3b[_0x97e1('0x3')](_0x2553a3,_0x3d3061);};}function removeListener(_0x1478a4,_0x224fb0){return function(){UserEvents[_0x97e1('0x4')](_0x1478a4,_0x224fb0);};}exports['register']=function(_0x5d420f){for(var _0x6c28b2=0x0,_0x384901=events[_0x97e1('0x5')];_0x6c28b2<_0x384901;_0x6c28b2++){var _0x49d543=events[_0x6c28b2];var _0x7d000f=createListener(_0x97e1('0x6')+_0x49d543,_0x5d420f);UserEvents['on'](_0x49d543,_0x7d000f);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 734a027..d0ff70a 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(_0x2a5ace,_0x307b93){var _0x14fc7a=function(_0x44169b){while(--_0x44169b){_0x2a5ace['push'](_0x2a5ace['shift']());}};_0x14fc7a(++_0x307b93);}(_0x70e0,0x17b));var _0x070e=function(_0x4533fb,_0x1ae0e5){_0x4533fb=_0x4533fb-0x0;var _0x5dd0de=_0x70e0[_0x4533fb];return _0x5dd0de;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x2a85b4,_0x55f76c){var _0xa8b434=function(_0x107ebd){while(--_0x107ebd){_0x2a85b4['push'](_0x2a85b4['shift']());}};_0xa8b434(++_0x55f76c);}(_0xedd9,0xfc));var _0x9edd=function(_0x5426e0,_0x429fc5){_0x5426e0=_0x5426e0-0x0;var _0x4ac62b=_0xedd9[_0x5426e0];return _0x4ac62b;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 46d5898..6997454 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 _0xb1c4=['INTEGER','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb1c4,0x8f));var _0x4b1c=function(_0x427ea0,_0xb5b769){_0x427ea0=_0x427ea0-0x0;var _0x4bca5e=_0xb1c4[_0x427ea0];return _0x4bca5e;};'use strict';var Sequelize=require('sequelize');module[_0x4b1c('0x0')]={'penalty':{'type':Sequelize[_0x4b1c('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa1aa=['INTEGER'];(function(_0x25594a,_0x186137){var _0x185b3a=function(_0x45a9da){while(--_0x45a9da){_0x25594a['push'](_0x25594a['shift']());}};_0x185b3a(++_0x186137);}(_0xa1aa,0x88));var _0xaa1a=function(_0x3d070c,_0x3d6517){_0x3d070c=_0x3d070c-0x0;var _0x309eff=_0xa1aa[_0x3d070c];return _0x309eff;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0xaa1a('0x0')],'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 6b3366e..def4778 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 _0x3d8b=['UserChatQueue','user_has_chat_queues','lodash','util','request-promise','rimraf','./userChatQueue.attributes','exports','define'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x3d8b,0x13d));var _0xb3d8=function(_0xd67a10,_0x6a40be){_0xd67a10=_0xd67a10-0x0;var _0x2b835c=_0x3d8b[_0xd67a10];return _0x2b835c;};'use strict';var _=require(_0xb3d8('0x0'));var util=require(_0xb3d8('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb3d8('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb3d8('0x3'));var config=require('../../config/environment');var attributes=require(_0xb3d8('0x4'));module[_0xb3d8('0x5')]=function(_0x188f38,_0x23da7d){return _0x188f38[_0xb3d8('0x6')](_0xb3d8('0x7'),attributes,{'tableName':_0xb3d8('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x92ad=['UserChatQueue','lodash','util','../../config/logger','moment','bluebird','../../config/environment','./userChatQueue.attributes'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x92ad,0xe9));var _0xd92a=function(_0x12955f,_0x55e03c){_0x12955f=_0x12955f-0x0;var _0x363db6=_0x92ad[_0x12955f];return _0x363db6;};'use strict';var _=require(_0xd92a('0x0'));var util=require(_0xd92a('0x1'));var logger=require(_0xd92a('0x2'))('api');var moment=require(_0xd92a('0x3'));var BPromise=require(_0xd92a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd92a('0x5'));var attributes=require(_0xd92a('0x6'));module['exports']=function(_0x407966,_0x540d67){return _0x407966['define'](_0xd92a('0x7'),attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index 1258249..c5e843b 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 _0xe55a=['../../config/logger','jayson/promise','client','http','request','then','UserChatQueue,\x20%s,\x20%s','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xe55a,0xb8));var _0xae55=function(_0x9dd9d9,_0x2dbd0b){_0x9dd9d9=_0x9dd9d9-0x0;var _0x5c0492=_0xe55a[_0x9dd9d9];return _0x5c0492;};'use strict';var _=require(_0xae55('0x0'));var util=require(_0xae55('0x1'));var moment=require('moment');var BPromise=require(_0xae55('0x2'));var rs=require(_0xae55('0x3'));var fs=require('fs');var Redis=require(_0xae55('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xae55('0x5'));var logger=require(_0xae55('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xae55('0x7'));var client=jayson[_0xae55('0x8')][_0xae55('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1bfc54,_0x513c5c,_0x2ec4da){return new BPromise(function(_0x388262,_0x2ee8e0){return client[_0xae55('0xa')](_0x1bfc54,_0x2ec4da)[_0xae55('0xb')](function(_0x501e36){logger['info'](_0xae55('0xc'),_0x513c5c,'request\x20sent');logger['debug'](_0xae55('0xd'),_0x513c5c,_0xae55('0xe'),JSON['stringify'](_0x501e36));if(_0x501e36[_0xae55('0xf')]){if(_0x501e36[_0xae55('0xf')][_0xae55('0x10')]===0x1f4){logger['error'](_0xae55('0xc'),_0x513c5c,_0x501e36['error'][_0xae55('0x11')]);return _0x2ee8e0(_0x501e36[_0xae55('0xf')][_0xae55('0x11')]);}logger[_0xae55('0xf')](_0xae55('0xc'),_0x513c5c,_0x501e36['error']['message']);return _0x388262(_0x501e36[_0xae55('0xf')][_0xae55('0x11')]);}else{logger['info'](_0xae55('0xc'),_0x513c5c,_0xae55('0xe'));_0x388262(_0x501e36[_0xae55('0x12')][_0xae55('0x11')]);}})['catch'](function(_0x51edba){logger[_0xae55('0xf')]('UserChatQueue,\x20%s,\x20%s',_0x513c5c,_0x51edba);_0x2ee8e0(_0x51edba);});});} \ No newline at end of file +var _0xda4f=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xda4f,0xed));var _0xfda4=function(_0x557331,_0x2a317e){_0x557331=_0x557331-0x0;var _0x1911b8=_0xda4f[_0x557331];return _0x1911b8;};'use strict';var _=require(_0xfda4('0x0'));var util=require(_0xfda4('0x1'));var moment=require('moment');var BPromise=require(_0xfda4('0x2'));var rs=require(_0xfda4('0x3'));var fs=require('fs');var Redis=require(_0xfda4('0x4'));var db=require(_0xfda4('0x5'))['db'];var utils=require(_0xfda4('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xfda4('0x7'));var jayson=require(_0xfda4('0x8'));var client=jayson[_0xfda4('0x9')][_0xfda4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50d6da,_0x1f548b,_0x171482){return new BPromise(function(_0x3bd4fb,_0x54a42e){return client['request'](_0x50d6da,_0x171482)[_0xfda4('0xb')](function(_0x56a278){logger[_0xfda4('0xc')](_0xfda4('0xd'),_0x1f548b,_0xfda4('0xe'));logger[_0xfda4('0xf')](_0xfda4('0x10'),_0x1f548b,_0xfda4('0xe'),JSON['stringify'](_0x56a278));if(_0x56a278[_0xfda4('0x11')]){if(_0x56a278['error'][_0xfda4('0x12')]===0x1f4){logger['error'](_0xfda4('0xd'),_0x1f548b,_0x56a278[_0xfda4('0x11')]['message']);return _0x54a42e(_0x56a278[_0xfda4('0x11')][_0xfda4('0x13')]);}logger[_0xfda4('0x11')](_0xfda4('0xd'),_0x1f548b,_0x56a278[_0xfda4('0x11')][_0xfda4('0x13')]);return _0x3bd4fb(_0x56a278[_0xfda4('0x11')][_0xfda4('0x13')]);}else{logger[_0xfda4('0xc')](_0xfda4('0xd'),_0x1f548b,_0xfda4('0xe'));_0x3bd4fb(_0x56a278[_0xfda4('0x14')][_0xfda4('0x13')]);}})[_0xfda4('0x15')](function(_0x163715){logger[_0xfda4('0x11')](_0xfda4('0xd'),_0x1f548b,_0x163715);_0x54a42e(_0x163715);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index e8c54e7..f17308b 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x3f3e9b,_0x4d0694){var _0x2ca093=function(_0x423c6c){while(--_0x423c6c){_0x3f3e9b['push'](_0x3f3e9b['shift']());}};_0x2ca093(++_0x4d0694);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x49d41c,_0x2bdc35){_0x49d41c=_0x49d41c-0x0;var _0xb64c5f=_0xcb91[_0x49d41c];return _0xb64c5f;};'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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x42e8f1,_0x2206e0){var _0x87ff38=function(_0x51a319){while(--_0x51a319){_0x42e8f1['push'](_0x42e8f1['shift']());}};_0x87ff38(++_0x2206e0);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3861f7,_0x995b22){_0x3861f7=_0x3861f7-0x0;var _0x50879f=_0xcb91[_0x3861f7];return _0x50879f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 23a2f70..971615d 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 _0xa095=['STRING','INTEGER'];(function(_0x22342c,_0x218835){var _0xd3b434=function(_0x45b259){while(--_0x45b259){_0x22342c['push'](_0x22342c['shift']());}};_0xd3b434(++_0x218835);}(_0xa095,0x7f));var _0x5a09=function(_0x361e5d,_0x15e1a4){_0x361e5d=_0x361e5d-0x0;var _0x4c303d=_0xa095[_0x361e5d];return _0x4c303d;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x5a09('0x0')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x5a09('0x0')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x5a09('0x1')]}}; \ No newline at end of file +var _0x2371=['INTEGER','sequelize','exports'];(function(_0x4bb94b,_0x50628a){var _0x36dcc6=function(_0x3ea436){while(--_0x3ea436){_0x4bb94b['push'](_0x4bb94b['shift']());}};_0x36dcc6(++_0x50628a);}(_0x2371,0xfd));var _0x1237=function(_0x523adf,_0x3e1620){_0x523adf=_0x523adf-0x0;var _0x283870=_0x2371[_0x523adf];return _0x283870;};'use strict';var Sequelize=require(_0x1237('0x0'));module[_0x1237('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x1237('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 52f8394..153ef02 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 _0x83c5=['api','moment','bluebird','path','rimraf','../../config/environment','./userFaxQueue.attributes','define','UserFaxQueue','user_has_fax_queues','lodash','util'];(function(_0x2a7fa8,_0x413c0e){var _0xf7e306=function(_0x9af322){while(--_0x9af322){_0x2a7fa8['push'](_0x2a7fa8['shift']());}};_0xf7e306(++_0x413c0e);}(_0x83c5,0x1c6));var _0x583c=function(_0x1a58d1,_0xa90685){_0x1a58d1=_0x1a58d1-0x0;var _0x101adc=_0x83c5[_0x1a58d1];return _0x101adc;};'use strict';var _=require(_0x583c('0x0'));var util=require(_0x583c('0x1'));var logger=require('../../config/logger')(_0x583c('0x2'));var moment=require(_0x583c('0x3'));var BPromise=require(_0x583c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x583c('0x5'));var rimraf=require(_0x583c('0x6'));var config=require(_0x583c('0x7'));var attributes=require(_0x583c('0x8'));module['exports']=function(_0x20e733,_0x1f63fe){return _0x20e733[_0x583c('0x9')](_0x583c('0xa'),attributes,{'tableName':_0x583c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x68f2=['./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x1194ad,_0x435140){var _0x5f374d=function(_0x522ce7){while(--_0x522ce7){_0x1194ad['push'](_0x1194ad['shift']());}};_0x5f374d(++_0x435140);}(_0x68f2,0x198));var _0x268f=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x68f2[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x268f('0x0'));var util=require('util');var logger=require(_0x268f('0x1'))(_0x268f('0x2'));var moment=require(_0x268f('0x3'));var BPromise=require(_0x268f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x268f('0x5'));var rimraf=require(_0x268f('0x6'));var config=require(_0x268f('0x7'));var attributes=require(_0x268f('0x8'));module[_0x268f('0x9')]=function(_0x4b1fd1,_0x30e197){return _0x4b1fd1[_0x268f('0xa')](_0x268f('0xb'),attributes,{'tableName':_0x268f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index 3c17290..9530439 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 _0xaa03=['../../config/environment','jayson/promise','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x307193,_0x154718){var _0x20ae48=function(_0x489a2c){while(--_0x489a2c){_0x307193['push'](_0x307193['shift']());}};_0x20ae48(++_0x154718);}(_0xaa03,0xa9));var _0x3aa0=function(_0x178db1,_0x4790c6){_0x178db1=_0x178db1-0x0;var _0x39257d=_0xaa03[_0x178db1];return _0x39257d;};'use strict';var _=require('lodash');var util=require(_0x3aa0('0x0'));var moment=require(_0x3aa0('0x1'));var BPromise=require('bluebird');var rs=require(_0x3aa0('0x2'));var fs=require('fs');var Redis=require(_0x3aa0('0x3'));var db=require(_0x3aa0('0x4'))['db'];var utils=require(_0x3aa0('0x5'));var logger=require('../../config/logger')(_0x3aa0('0x6'));var config=require(_0x3aa0('0x7'));var jayson=require(_0x3aa0('0x8'));var client=jayson[_0x3aa0('0x9')][_0x3aa0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5dbd7f,_0x31b5f5,_0x16da93){return new BPromise(function(_0x42317a,_0x49395a){return client[_0x3aa0('0xb')](_0x5dbd7f,_0x16da93)[_0x3aa0('0xc')](function(_0x413155){logger[_0x3aa0('0xd')](_0x3aa0('0xe'),_0x31b5f5,'request\x20sent');logger['debug']('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x31b5f5,_0x3aa0('0xf'),JSON[_0x3aa0('0x10')](_0x413155));if(_0x413155[_0x3aa0('0x11')]){if(_0x413155[_0x3aa0('0x11')][_0x3aa0('0x12')]===0x1f4){logger[_0x3aa0('0x11')](_0x3aa0('0xe'),_0x31b5f5,_0x413155[_0x3aa0('0x11')]['message']);return _0x49395a(_0x413155[_0x3aa0('0x11')][_0x3aa0('0x13')]);}logger['error'](_0x3aa0('0xe'),_0x31b5f5,_0x413155['error'][_0x3aa0('0x13')]);return _0x42317a(_0x413155[_0x3aa0('0x11')][_0x3aa0('0x13')]);}else{logger[_0x3aa0('0xd')]('UserFaxQueue,\x20%s,\x20%s',_0x31b5f5,_0x3aa0('0xf'));_0x42317a(_0x413155[_0x3aa0('0x14')][_0x3aa0('0x13')]);}})[_0x3aa0('0x15')](function(_0x261d14){logger[_0x3aa0('0x11')](_0x3aa0('0xe'),_0x31b5f5,_0x261d14);_0x49395a(_0x261d14);});});} \ No newline at end of file +var _0xd6aa=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x1b0893,_0x12827a){var _0x2042cc=function(_0x52719f){while(--_0x52719f){_0x1b0893['push'](_0x1b0893['shift']());}};_0x2042cc(++_0x12827a);}(_0xd6aa,0x1b1));var _0xad6a=function(_0x454bbb,_0x45aead){_0x454bbb=_0x454bbb-0x0;var _0x545e77=_0xd6aa[_0x454bbb];return _0x545e77;};'use strict';var _=require(_0xad6a('0x0'));var util=require(_0xad6a('0x1'));var moment=require(_0xad6a('0x2'));var BPromise=require(_0xad6a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xad6a('0x4'))['db'];var utils=require(_0xad6a('0x5'));var logger=require(_0xad6a('0x6'))(_0xad6a('0x7'));var config=require(_0xad6a('0x8'));var jayson=require(_0xad6a('0x9'));var client=jayson[_0xad6a('0xa')][_0xad6a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3b5945,_0x991f10,_0x5497b6){return new BPromise(function(_0x1f4a2e,_0xfd35b7){return client[_0xad6a('0xc')](_0x3b5945,_0x5497b6)[_0xad6a('0xd')](function(_0x55ad81){logger[_0xad6a('0xe')](_0xad6a('0xf'),_0x991f10,'request\x20sent');logger[_0xad6a('0x10')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x991f10,_0xad6a('0x11'),JSON[_0xad6a('0x12')](_0x55ad81));if(_0x55ad81['error']){if(_0x55ad81[_0xad6a('0x13')]['code']===0x1f4){logger[_0xad6a('0x13')](_0xad6a('0xf'),_0x991f10,_0x55ad81[_0xad6a('0x13')][_0xad6a('0x14')]);return _0xfd35b7(_0x55ad81[_0xad6a('0x13')][_0xad6a('0x14')]);}logger[_0xad6a('0x13')]('UserFaxQueue,\x20%s,\x20%s',_0x991f10,_0x55ad81[_0xad6a('0x13')][_0xad6a('0x14')]);return _0x1f4a2e(_0x55ad81[_0xad6a('0x13')][_0xad6a('0x14')]);}else{logger[_0xad6a('0xe')]('UserFaxQueue,\x20%s,\x20%s',_0x991f10,_0xad6a('0x11'));_0x1f4a2e(_0x55ad81[_0xad6a('0x15')][_0xad6a('0x14')]);}})[_0xad6a('0x16')](function(_0x3a612f){logger[_0xad6a('0x13')](_0xad6a('0xf'),_0x991f10,_0x3a612f);_0xfd35b7(_0x3a612f);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index c313407..167e868 100644 --- a/server/api/userMailQueue/index.js +++ b/server/api/userMailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x3c6f37,_0x1bed6d){var _0x5b15df=function(_0x4c9597){while(--_0x4c9597){_0x3c6f37['push'](_0x3c6f37['shift']());}};_0x5b15df(++_0x1bed6d);}(_0xe706,0xa3));var _0x6e70=function(_0x19a90e,_0xe14b0b){_0x19a90e=_0x19a90e-0x0;var _0xa49b11=_0xe706[_0x19a90e];return _0xa49b11;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x5e122b,_0x266363){var _0x359e9e=function(_0x2653e5){while(--_0x2653e5){_0x5e122b['push'](_0x5e122b['shift']());}};_0x359e9e(++_0x266363);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('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 1dcd0a5..8f4587d 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 _0xcadc=['INTEGER','sequelize'];(function(_0x522017,_0x9ef0f3){var _0xdeeb50=function(_0x28971f){while(--_0x28971f){_0x522017['push'](_0x522017['shift']());}};_0xdeeb50(++_0x9ef0f3);}(_0xcadc,0x153));var _0xccad=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xcadc[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0xccad('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xccad('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x16ab=['INTEGER','exports'];(function(_0x1b87a5,_0x5875ef){var _0x212666=function(_0x49f640){while(--_0x49f640){_0x1b87a5['push'](_0x1b87a5['shift']());}};_0x212666(++_0x5875ef);}(_0x16ab,0xed));var _0xb16a=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0x16ab[_0x1deb03];return _0x189fe7;};'use strict';var Sequelize=require('sequelize');module[_0xb16a('0x0')]={'penalty':{'type':Sequelize[_0xb16a('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index c7e3206..f284f15 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 _0xf6bb=['exports','define','UserMailQueue','user_has_mail_queues','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./userMailQueue.attributes'];(function(_0x12e0ce,_0xbaf6e2){var _0x8af99=function(_0x5bfebb){while(--_0x5bfebb){_0x12e0ce['push'](_0x12e0ce['shift']());}};_0x8af99(++_0xbaf6e2);}(_0xf6bb,0xa0));var _0xbf6b=function(_0x2adfb1,_0x406e6e){_0x2adfb1=_0x2adfb1-0x0;var _0xa52d45=_0xf6bb[_0x2adfb1];return _0xa52d45;};'use strict';var _=require(_0xbf6b('0x0'));var util=require(_0xbf6b('0x1'));var logger=require(_0xbf6b('0x2'))(_0xbf6b('0x3'));var moment=require(_0xbf6b('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbf6b('0x5'));var rimraf=require(_0xbf6b('0x6'));var config=require(_0xbf6b('0x7'));var attributes=require(_0xbf6b('0x8'));module[_0xbf6b('0x9')]=function(_0x4c6109,_0x35fc9a){return _0x4c6109[_0xbf6b('0xa')](_0xbf6b('0xb'),attributes,{'tableName':_0xbf6b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5bce=['rimraf','exports','define','UserMailQueue','user_has_mail_queues','lodash','util','moment','bluebird','request-promise'];(function(_0x194b25,_0x4bedc4){var _0x107ac5=function(_0x13bcce){while(--_0x13bcce){_0x194b25['push'](_0x194b25['shift']());}};_0x107ac5(++_0x4bedc4);}(_0x5bce,0x1db));var _0xe5bc=function(_0x427d3a,_0x23724c){_0x427d3a=_0x427d3a-0x0;var _0xe5c521=_0x5bce[_0x427d3a];return _0xe5c521;};'use strict';var _=require(_0xe5bc('0x0'));var util=require(_0xe5bc('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe5bc('0x2'));var BPromise=require(_0xe5bc('0x3'));var rp=require(_0xe5bc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe5bc('0x5'));var config=require('../../config/environment');var attributes=require('./userMailQueue.attributes');module[_0xe5bc('0x6')]=function(_0x1aaa29,_0xfd392f){return _0x1aaa29[_0xe5bc('0x7')](_0xe5bc('0x8'),attributes,{'tableName':_0xe5bc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index 4424487..0079a1e 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 _0x6aa7=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1eeb93,_0x34a11f){var _0x51610c=function(_0x2389f6){while(--_0x2389f6){_0x1eeb93['push'](_0x1eeb93['shift']());}};_0x51610c(++_0x34a11f);}(_0x6aa7,0x178));var _0x76aa=function(_0x476307,_0x2c8d1d){_0x476307=_0x476307-0x0;var _0xae40ba=_0x6aa7[_0x476307];return _0xae40ba;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32dee5,_0x36d12b,_0xa9b695){return new BPromise(function(_0x56d6bc,_0x3dae33){return client[_0x76aa('0x9')](_0x32dee5,_0xa9b695)[_0x76aa('0xa')](function(_0x557d69){logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,_0x76aa('0xd'));logger[_0x76aa('0xe')](_0x76aa('0xf'),_0x36d12b,_0x76aa('0xd'),JSON[_0x76aa('0x10')](_0x557d69));if(_0x557d69[_0x76aa('0x11')]){if(_0x557d69[_0x76aa('0x11')][_0x76aa('0x12')]===0x1f4){logger['error'](_0x76aa('0xc'),_0x36d12b,_0x557d69['error'][_0x76aa('0x13')]);return _0x3dae33(_0x557d69[_0x76aa('0x11')][_0x76aa('0x13')]);}logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x557d69['error']['message']);return _0x56d6bc(_0x557d69[_0x76aa('0x11')]['message']);}else{logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,'request\x20sent');_0x56d6bc(_0x557d69[_0x76aa('0x14')]['message']);}})[_0x76aa('0x15')](function(_0x5181d2){logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x5181d2);_0x3dae33(_0x5181d2);});});} \ No newline at end of file +var _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserMailQueue,\x20%s,\x20%s','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x58afd5,_0x534a48){var _0x3e503b=function(_0x27ba44){while(--_0x27ba44){_0x58afd5['push'](_0x58afd5['shift']());}};_0x3e503b(++_0x534a48);}(_0x7217,0x19e));var _0x7721=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0x7217[_0x3c2a69];return _0x596bc8;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('UserMailQueue,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('UserMailQueue,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index bf68837..1b173a5 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 _0xc80a=['post','sendUserNotification','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userNotification.controller'];(function(_0x32709d,_0x2fd7bd){var _0x1e8938=function(_0x558d07){while(--_0x558d07){_0x32709d['push'](_0x32709d['shift']());}};_0x1e8938(++_0x2fd7bd);}(_0xc80a,0x19b));var _0xac80=function(_0x69c0c2,_0x2af0bf){_0x69c0c2=_0x69c0c2-0x0;var _0x3422f6=_0xc80a[_0x69c0c2];return _0x3422f6;};'use strict';var multer=require('multer');var util=require(_0xac80('0x0'));var path=require(_0xac80('0x1'));var timeout=require(_0xac80('0x2'));var express=require(_0xac80('0x3'));var router=express[_0xac80('0x4')]();var fs_extra=require(_0xac80('0x5'));var auth=require(_0xac80('0x6'));var interaction=require(_0xac80('0x7'));var config=require('../../config/environment');var controller=require(_0xac80('0x8'));router[_0xac80('0x9')]('/',auth['isAuthenticated'](),controller[_0xac80('0xa')]);module[_0xac80('0xb')]=router; \ No newline at end of file +var _0x3eac=['express','fs-extra','../../components/auth/service','../../components/interaction/service','./userNotification.controller','post','isAuthenticated','sendUserNotification','multer','util','path','connect-timeout'];(function(_0x3c3ae5,_0x111cfe){var _0x3734be=function(_0x5200cc){while(--_0x5200cc){_0x3c3ae5['push'](_0x3c3ae5['shift']());}};_0x3734be(++_0x111cfe);}(_0x3eac,0x98));var _0xc3ea=function(_0x22ffbf,_0x16f31e){_0x22ffbf=_0x22ffbf-0x0;var _0x360c17=_0x3eac[_0x22ffbf];return _0x360c17;};'use strict';var multer=require(_0xc3ea('0x0'));var util=require(_0xc3ea('0x1'));var path=require(_0xc3ea('0x2'));var timeout=require(_0xc3ea('0x3'));var express=require(_0xc3ea('0x4'));var router=express['Router']();var fs_extra=require(_0xc3ea('0x5'));var auth=require(_0xc3ea('0x6'));var interaction=require(_0xc3ea('0x7'));var config=require('../../config/environment');var controller=require(_0xc3ea('0x8'));router[_0xc3ea('0x9')]('/',auth[_0xc3ea('0xa')](),controller[_0xc3ea('0xb')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index cd3888c..95009a7 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 _0x6656=['exports','STRING','TEXT','sequelize'];(function(_0x2dc09d,_0x1ead06){var _0x258e4d=function(_0x2bc1f7){while(--_0x2bc1f7){_0x2dc09d['push'](_0x2dc09d['shift']());}};_0x258e4d(++_0x1ead06);}(_0x6656,0x97));var _0x6665=function(_0x1f0724,_0x3a58bf){_0x1f0724=_0x1f0724-0x0;var _0x253ffb=_0x6656[_0x1f0724];return _0x253ffb;};'use strict';var Sequelize=require(_0x6665('0x0'));module[_0x6665('0x1')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0x6665('0x2')]},'recipientsId':{'type':Sequelize[_0x6665('0x3')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file +var _0xe95b=['sequelize','TEXT','STRING','BOOLEAN'];(function(_0x293e39,_0x34315f){var _0x118450=function(_0x1efd24){while(--_0x1efd24){_0x293e39['push'](_0x293e39['shift']());}};_0x118450(++_0x34315f);}(_0xe95b,0x17c));var _0xbe95=function(_0x101be1,_0x3aff82){_0x101be1=_0x101be1-0x0;var _0x10b96c=_0xe95b[_0x101be1];return _0x10b96c;};'use strict';var Sequelize=require(_0xbe95('0x0'));module['exports']={'body':{'type':Sequelize[_0xbe95('0x1')]},'senderName':{'type':Sequelize[_0xbe95('0x2')]},'recipientsId':{'type':Sequelize[_0xbe95('0x1')]},'recipientsDescription':{'type':Sequelize[_0xbe95('0x2')]},'beep':{'type':Sequelize[_0xbe95('0x3')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 15785a1..e9841b0 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 _0x2b54=['push','union','flatten','findOne','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','sendUserNotification','body','hasOwnProperty','TemplateId','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Sequelize','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','some','includes','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','beep','SenderId','recipientsId','sortBy','join','UserNotification','create','forEach','recipient','emit','userNotification:send','catch','text','Template','html','Invalid\x20\x27TemplateId\x27\x20parameter','startCase','model','toLowerCase','User','ids','queue','replace','Queue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2b54,0x150));var _0x42b5=function(_0x57e0b2,_0x16214f){_0x57e0b2=_0x57e0b2-0x0;var _0xfc1513=_0x2b54[_0x57e0b2];return _0xfc1513;};'use strict';var emlformat=require(_0x42b5('0x0'));var rimraf=require(_0x42b5('0x1'));var zipdir=require(_0x42b5('0x2'));var jsonpatch=require(_0x42b5('0x3'));var rp=require(_0x42b5('0x4'));var moment=require(_0x42b5('0x5'));var BPromise=require(_0x42b5('0x6'));var Mustache=require('mustache');var util=require(_0x42b5('0x7'));var path=require(_0x42b5('0x8'));var sox=require(_0x42b5('0x9'));var csv=require(_0x42b5('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x42b5('0xb'));var _=require(_0x42b5('0xc'));var squel=require(_0x42b5('0xd'));var crypto=require(_0x42b5('0xe'));var jsforce=require(_0x42b5('0xf'));var deskjs=require(_0x42b5('0x10'));var toCsv=require('to-csv');var querystring=require(_0x42b5('0x11'));var Papa=require(_0x42b5('0x12'));var Redis=require(_0x42b5('0x13'));var authService=require(_0x42b5('0x14'));var qs=require(_0x42b5('0x15'));var as=require(_0x42b5('0x16'));var hardwareService=require(_0x42b5('0x17'));var logger=require(_0x42b5('0x18'))('api');var utils=require(_0x42b5('0x19'));var config=require(_0x42b5('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x42b5('0x1b'))['db'];config[_0x42b5('0x1c')]=_[_0x42b5('0x1d')](config[_0x42b5('0x1c')],{'host':_0x42b5('0x1e'),'port':0x18eb});var socket=require(_0x42b5('0x1f'))(new Redis(config[_0x42b5('0x1c')]));require(_0x42b5('0x20'))[_0x42b5('0x21')](socket);function respondWithStatusCode(_0x39b2ed,_0x1681a1){_0x1681a1=_0x1681a1||0xcc;return function(_0x2bca1e){if(_0x2bca1e){return _0x39b2ed[_0x42b5('0x22')](_0x1681a1);}return _0x39b2ed['status'](_0x1681a1)[_0x42b5('0x23')]();};}function respondWithResult(_0x184e0f,_0x5e1f0d){_0x5e1f0d=_0x5e1f0d||0xc8;return function(_0x21b7a8){if(_0x21b7a8){return _0x184e0f[_0x42b5('0x24')](_0x5e1f0d)[_0x42b5('0x25')](_0x21b7a8);}};}function respondWithFilteredResult(_0x249a91,_0x121873){return function(_0x4de0a9){if(_0x4de0a9){var _0x36a9ad=typeof _0x121873[_0x42b5('0x26')]===_0x42b5('0x27')&&typeof _0x121873[_0x42b5('0x28')]===_0x42b5('0x27');var _0x4854b0=_0x4de0a9[_0x42b5('0x29')];var _0x191167=_0x36a9ad?0x0:_0x121873[_0x42b5('0x26')];var _0x6946cb=_0x36a9ad?_0x4de0a9[_0x42b5('0x29')]:_0x121873[_0x42b5('0x26')]+_0x121873[_0x42b5('0x28')];var _0x3c03eb;if(_0x6946cb>=_0x4854b0){_0x6946cb=_0x4854b0;_0x3c03eb=0xc8;}else{_0x3c03eb=0xce;}_0x249a91[_0x42b5('0x24')](_0x3c03eb);return _0x249a91[_0x42b5('0x2a')](_0x42b5('0x2b'),_0x191167+'-'+_0x6946cb+'/'+_0x4854b0)[_0x42b5('0x25')](_0x4de0a9);}return null;};}function patchUpdates(_0x198f31){return function(_0x2a3fe5){try{jsonpatch[_0x42b5('0x2c')](_0x2a3fe5,_0x198f31,!![]);}catch(_0x8d17b6){return BPromise[_0x42b5('0x2d')](_0x8d17b6);}return _0x2a3fe5[_0x42b5('0x2e')]();};}function saveUpdates(_0x3728c6,_0x173d7d){return function(_0x367175){if(_0x367175){return _0x367175[_0x42b5('0x2f')](_0x3728c6)[_0x42b5('0x30')](function(_0x364bfb){return _0x364bfb;});}return null;};}function removeEntity(_0x3ab976,_0x552304){return function(_0x555647){if(_0x555647){return _0x555647[_0x42b5('0x31')]()[_0x42b5('0x30')](function(){_0x3ab976[_0x42b5('0x24')](0xcc)[_0x42b5('0x23')]();});}};}function handleEntityNotFound(_0x12b76c,_0x47d0d4){return function(_0x5d2772){if(!_0x5d2772){_0x12b76c[_0x42b5('0x22')](0x194);}return _0x5d2772;};}function handleError(_0x1e6ccc,_0x552b70){_0x552b70=_0x552b70||0x1f4;return function(_0xa95850){logger[_0x42b5('0x32')](_0xa95850[_0x42b5('0x33')]);if(_0xa95850[_0x42b5('0x34')]){delete _0xa95850[_0x42b5('0x34')];}_0x1e6ccc['status'](_0x552b70)[_0x42b5('0x35')](_0xa95850);};}exports[_0x42b5('0x36')]=function(_0x189029,_0x22fa24,_0x39add9){if(!_0x189029[_0x42b5('0x37')][_0x42b5('0x38')]('text')&&!_0x189029[_0x42b5('0x37')][_0x42b5('0x38')](_0x42b5('0x39'))){throw new db['Sequelize'][(_0x42b5('0x3a'))](_0x42b5('0x3b'));}else{if(_0x189029['body'][_0x42b5('0x38')](_0x42b5('0x39'))&&!_0x189029['body'][_0x42b5('0x38')](_0x42b5('0x3c'))){throw new db[(_0x42b5('0x3d'))][(_0x42b5('0x3a'))](_0x42b5('0x3e'));}if(!_0x189029['body'][_0x42b5('0x38')](_0x42b5('0x3f'))){throw new db[(_0x42b5('0x3d'))][(_0x42b5('0x3a'))](_0x42b5('0x40'));}else{try{var _0xbd9584=JSON[_0x42b5('0x41')](_0x189029['body'][_0x42b5('0x3f')]);}catch(_0x9f8b01){logger[_0x42b5('0x32')](_0x9f8b01);throw new db[(_0x42b5('0x3d'))]['ValidationError'](_0x42b5('0x42'));}var _0x5e2480=[_0x42b5('0x43'),_0x42b5('0x44'),_0x42b5('0x45'),_0x42b5('0x46'),_0x42b5('0x47'),_0x42b5('0x48'),_0x42b5('0x49'),'team','user'];if(_[_0x42b5('0x4a')](_0xbd9584,function(_0x11ea3f){return!_[_0x42b5('0x4b')](_0x5e2480,_0x11ea3f['model']['toLowerCase']());})){throw new db['Sequelize']['ValidationError'](_0x42b5('0x4c'));}}}var _0x5966ac={};_0x5966ac[_0x42b5('0x4d')]=_0x189029['body'][_0x42b5('0x38')]('senderName')?_0x189029[_0x42b5('0x37')][_0x42b5('0x4d')]:_0x189029['user'][_0x42b5('0x4e')];_0x5966ac[_0x42b5('0x4f')]=_['isEmpty'](_0x189029['body'][_0x42b5('0x4f')])?null:_0x189029[_0x42b5('0x37')]['recipientsDescription'];_0x5966ac[_0x42b5('0x50')]=_0x189029[_0x42b5('0x37')][_0x42b5('0x50')]||![];_0x5966ac[_0x42b5('0x51')]=_0x189029['user']['id'];return getContent(_0x189029[_0x42b5('0x37')])[_0x42b5('0x30')](function(_0x4c7157){_0x5966ac[_0x42b5('0x37')]=_0x4c7157;return getRecipients(_0xbd9584);})[_0x42b5('0x30')](function(_0x3dec0b){_0x5966ac[_0x42b5('0x52')]=_[_0x42b5('0x53')](_0x3dec0b)[_0x42b5('0x54')](',');return db['sequelize']['transaction'](function(_0x18398b){return db[_0x42b5('0x55')][_0x42b5('0x56')](_0x5966ac,{'raw':!![],'transaction':_0x18398b})['then'](function(_0x195302){var _0x351c59={'sender':_0x5966ac[_0x42b5('0x4d')],'description':_0x5966ac[_0x42b5('0x4f')],'content':_0x5966ac['body'],'beep':_0x5966ac['beep']};_0x3dec0b[_0x42b5('0x57')](function(_0x2673bd){_0x351c59[_0x42b5('0x58')]=_0x2673bd;socket[_0x42b5('0x59')](_0x42b5('0x5a'),_0x351c59);});return _0x195302;});});})[_0x42b5('0x30')](respondWithResult(_0x22fa24,0xc9))[_0x42b5('0x5b')](handleError(_0x22fa24,null));};function getContent(_0x1eea18){return new BPromise(function(_0x4fea94,_0x366335){if(_0x1eea18[_0x42b5('0x5c')]){_0x4fea94(_0x1eea18[_0x42b5('0x5c')]);return;}return db[_0x42b5('0x5d')]['findOne']({'attributes':[_0x42b5('0x5e')],'where':{'id':_0x1eea18[_0x42b5('0x39')]},'raw':!![]})['then'](function(_0x254cd5){if(!_0x254cd5)throw new db[(_0x42b5('0x3d'))]['ValidationError'](_0x42b5('0x5f'));var _0x2f5609=Mustache['render'](_0x254cd5[_0x42b5('0x5e')],_0x1eea18[_0x42b5('0x3c')]);_0x4fea94(_0x2f5609);})['catch'](function(_0x4bce78){_0x366335(_0x4bce78);});});}function getRecipients(_0x667845){return new BPromise(function(_0xabe839,_0x5bb4c8){var _0x2b6151=[];var _0x10c112=[];_0x667845[_0x42b5('0x57')](function(_0x138400){var _0x9efc1c=_[_0x42b5('0x60')](_0x138400[_0x42b5('0x61')][_0x42b5('0x62')]());if(_0x9efc1c===_0x42b5('0x63')){_0x2b6151=_['union'](_0x2b6151,_0x138400[_0x42b5('0x64')]);}else{if(_[_0x42b5('0x4b')](_0x9efc1c,_0x42b5('0x65')))_0x9efc1c=_0x9efc1c[_0x42b5('0x66')](_0x42b5('0x65'),_0x42b5('0x67'));_0x138400[_0x42b5('0x64')][_0x42b5('0x57')](function(_0x1a86f8){_0x10c112[_0x42b5('0x68')](getAgents(_0x9efc1c,_0x1a86f8));});}});return BPromise['all'](_0x10c112)['then'](function(_0x20717f){_0x2b6151=_[_0x42b5('0x69')](_0x2b6151,_[_0x42b5('0x6a')](_0x20717f));_0xabe839(_0x2b6151);})[_0x42b5('0x5b')](function(_0x2619ea){_0x5bb4c8(_0x2619ea);});});}function getAgents(_0x328dd5,_0x3e41e6){return new BPromise(function(_0x4930fd,_0x1baa93){return db[_0x328dd5][_0x42b5('0x6b')]({'where':{'id':_0x3e41e6}})[_0x42b5('0x30')](function(_0x280cc0){return _0x280cc0[_0x42b5('0x6c')]({'attributes':['id'],'raw':!![]})[_0x42b5('0x30')](function(_0x3ce5a7){var _0x55dd39=_[_0x42b5('0x6d')](_0x3ce5a7,'id');_0x4930fd(_0x55dd39);});})[_0x42b5('0x5b')](function(_0x27f16c){_0x1baa93(_0x27f16c);});});} \ No newline at end of file +var _0x1509=['../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','redis','defaults','localhost','./userNotification.socket','register','sendStatus','end','status','json','offset','undefined','count','limit','set','reject','save','update','then','stack','name','send','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','error','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','includes','model','toLowerCase','senderName','fullname','isEmpty','recipientsDescription','beep','SenderId','sortBy','join','sequelize','transaction','UserNotification','forEach','recipient','emit','userNotification:send','catch','Template','render','html','startCase','User','union','queue','replace','push','all','flatten','findOne','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/parsers/qs'];(function(_0x360581,_0x208bdc){var _0x3c0f5c=function(_0x5007d5){while(--_0x5007d5){_0x360581['push'](_0x360581['shift']());}};_0x3c0f5c(++_0x208bdc);}(_0x1509,0x167));var _0x9150=function(_0x2f896f,_0x41f4e9){_0x2f896f=_0x2f896f-0x0;var _0x3b344a=_0x1509[_0x2f896f];return _0x3b344a;};'use strict';var emlformat=require(_0x9150('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9150('0x1'));var rp=require(_0x9150('0x2'));var moment=require(_0x9150('0x3'));var BPromise=require(_0x9150('0x4'));var Mustache=require(_0x9150('0x5'));var util=require(_0x9150('0x6'));var path=require(_0x9150('0x7'));var sox=require(_0x9150('0x8'));var csv=require(_0x9150('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9150('0xa'));var _=require(_0x9150('0xb'));var squel=require(_0x9150('0xc'));var crypto=require(_0x9150('0xd'));var jsforce=require(_0x9150('0xe'));var deskjs=require(_0x9150('0xf'));var toCsv=require(_0x9150('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9150('0x10'));var as=require(_0x9150('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x9150('0x12'));var licenseUtil=require(_0x9150('0x13'));var db=require('../../mysqldb')['db'];config[_0x9150('0x14')]=_[_0x9150('0x15')](config[_0x9150('0x14')],{'host':_0x9150('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9150('0x17'))[_0x9150('0x18')](socket);function respondWithStatusCode(_0x440475,_0x32d3d9){_0x32d3d9=_0x32d3d9||0xcc;return function(_0x24e0b8){if(_0x24e0b8){return _0x440475[_0x9150('0x19')](_0x32d3d9);}return _0x440475['status'](_0x32d3d9)[_0x9150('0x1a')]();};}function respondWithResult(_0x55a93b,_0x25c9ae){_0x25c9ae=_0x25c9ae||0xc8;return function(_0x360e84){if(_0x360e84){return _0x55a93b[_0x9150('0x1b')](_0x25c9ae)[_0x9150('0x1c')](_0x360e84);}};}function respondWithFilteredResult(_0x46146f,_0x1856f3){return function(_0x521fc3){if(_0x521fc3){var _0x33cb11=typeof _0x1856f3[_0x9150('0x1d')]===_0x9150('0x1e')&&typeof _0x1856f3['limit']===_0x9150('0x1e');var _0x44740f=_0x521fc3[_0x9150('0x1f')];var _0x219010=_0x33cb11?0x0:_0x1856f3[_0x9150('0x1d')];var _0x17e6c5=_0x33cb11?_0x521fc3['count']:_0x1856f3[_0x9150('0x1d')]+_0x1856f3[_0x9150('0x20')];var _0x43f603;if(_0x17e6c5>=_0x44740f){_0x17e6c5=_0x44740f;_0x43f603=0xc8;}else{_0x43f603=0xce;}_0x46146f[_0x9150('0x1b')](_0x43f603);return _0x46146f[_0x9150('0x21')]('Content-Range',_0x219010+'-'+_0x17e6c5+'/'+_0x44740f)[_0x9150('0x1c')](_0x521fc3);}return null;};}function patchUpdates(_0x5cf1b3){return function(_0x2bdf42){try{jsonpatch['apply'](_0x2bdf42,_0x5cf1b3,!![]);}catch(_0x14011e){return BPromise[_0x9150('0x22')](_0x14011e);}return _0x2bdf42[_0x9150('0x23')]();};}function saveUpdates(_0x317b69,_0x570ced){return function(_0x4f741e){if(_0x4f741e){return _0x4f741e[_0x9150('0x24')](_0x317b69)[_0x9150('0x25')](function(_0x3937b9){return _0x3937b9;});}return null;};}function removeEntity(_0x1cd651,_0x3532e0){return function(_0x26d075){if(_0x26d075){return _0x26d075['destroy']()['then'](function(){_0x1cd651[_0x9150('0x1b')](0xcc)[_0x9150('0x1a')]();});}};}function handleEntityNotFound(_0x5b9995,_0x29505d){return function(_0x46f588){if(!_0x46f588){_0x5b9995['sendStatus'](0x194);}return _0x46f588;};}function handleError(_0x56c378,_0x3e91d8){_0x3e91d8=_0x3e91d8||0x1f4;return function(_0x55f6b1){logger['error'](_0x55f6b1[_0x9150('0x26')]);if(_0x55f6b1[_0x9150('0x27')]){delete _0x55f6b1[_0x9150('0x27')];}_0x56c378['status'](_0x3e91d8)[_0x9150('0x28')](_0x55f6b1);};}exports['sendUserNotification']=function(_0x145878,_0x4df466,_0x50a654){if(!_0x145878[_0x9150('0x29')][_0x9150('0x2a')](_0x9150('0x2b'))&&!_0x145878['body']['hasOwnProperty'](_0x9150('0x2c'))){throw new db[(_0x9150('0x2d'))][(_0x9150('0x2e'))](_0x9150('0x2f'));}else{if(_0x145878['body'][_0x9150('0x2a')](_0x9150('0x2c'))&&!_0x145878[_0x9150('0x29')][_0x9150('0x2a')](_0x9150('0x30'))){throw new db['Sequelize'][(_0x9150('0x2e'))](_0x9150('0x31'));}if(!_0x145878[_0x9150('0x29')]['hasOwnProperty'](_0x9150('0x32'))){throw new db[(_0x9150('0x2d'))][(_0x9150('0x2e'))](_0x9150('0x33'));}else{try{var _0x194b52=JSON['parse'](_0x145878['body'][_0x9150('0x32')]);}catch(_0xe5c2c){logger[_0x9150('0x34')](_0xe5c2c);throw new db[(_0x9150('0x2d'))]['ValidationError'](_0x9150('0x35'));}var _0x3c347b=[_0x9150('0x36'),_0x9150('0x37'),_0x9150('0x38'),'openchannelqueue',_0x9150('0x39'),_0x9150('0x3a'),_0x9150('0x3b'),_0x9150('0x3c'),_0x9150('0x3d')];if(_[_0x9150('0x3e')](_0x194b52,function(_0x4e3c5e){return!_[_0x9150('0x3f')](_0x3c347b,_0x4e3c5e[_0x9150('0x40')][_0x9150('0x41')]());})){throw new db[(_0x9150('0x2d'))][(_0x9150('0x2e'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x15748a={};_0x15748a[_0x9150('0x42')]=_0x145878[_0x9150('0x29')][_0x9150('0x2a')](_0x9150('0x42'))?_0x145878[_0x9150('0x29')]['senderName']:_0x145878[_0x9150('0x3d')][_0x9150('0x43')];_0x15748a['recipientsDescription']=_[_0x9150('0x44')](_0x145878[_0x9150('0x29')][_0x9150('0x45')])?null:_0x145878[_0x9150('0x29')][_0x9150('0x45')];_0x15748a[_0x9150('0x46')]=_0x145878[_0x9150('0x29')][_0x9150('0x46')]||![];_0x15748a[_0x9150('0x47')]=_0x145878['user']['id'];return getContent(_0x145878[_0x9150('0x29')])[_0x9150('0x25')](function(_0x4baa7e){_0x15748a[_0x9150('0x29')]=_0x4baa7e;return getRecipients(_0x194b52);})['then'](function(_0xce1dcc){_0x15748a['recipientsId']=_[_0x9150('0x48')](_0xce1dcc)[_0x9150('0x49')](',');return db[_0x9150('0x4a')][_0x9150('0x4b')](function(_0x2040e2){return db[_0x9150('0x4c')]['create'](_0x15748a,{'raw':!![],'transaction':_0x2040e2})[_0x9150('0x25')](function(_0x441135){var _0x220ff1={'sender':_0x15748a[_0x9150('0x42')],'description':_0x15748a[_0x9150('0x45')],'content':_0x15748a[_0x9150('0x29')],'beep':_0x15748a[_0x9150('0x46')]};_0xce1dcc[_0x9150('0x4d')](function(_0x3a8821){_0x220ff1[_0x9150('0x4e')]=_0x3a8821;socket[_0x9150('0x4f')](_0x9150('0x50'),_0x220ff1);});return _0x441135;});});})[_0x9150('0x25')](respondWithResult(_0x4df466,0xc9))[_0x9150('0x51')](handleError(_0x4df466,null));};function getContent(_0x4f5adf){return new BPromise(function(_0x3f4c23,_0x398069){if(_0x4f5adf['text']){_0x3f4c23(_0x4f5adf['text']);return;}return db[_0x9150('0x52')]['findOne']({'attributes':['html'],'where':{'id':_0x4f5adf['TemplateId']},'raw':!![]})[_0x9150('0x25')](function(_0x4d27d7){if(!_0x4d27d7)throw new db[(_0x9150('0x2d'))][(_0x9150('0x2e'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x2468b1=Mustache[_0x9150('0x53')](_0x4d27d7[_0x9150('0x54')],_0x4f5adf[_0x9150('0x30')]);_0x3f4c23(_0x2468b1);})[_0x9150('0x51')](function(_0x1a1beb){_0x398069(_0x1a1beb);});});}function getRecipients(_0x26b195){return new BPromise(function(_0x17864a,_0x1dd439){var _0x2bf67e=[];var _0x55800c=[];_0x26b195['forEach'](function(_0x2843d7){var _0x3f2699=_[_0x9150('0x55')](_0x2843d7[_0x9150('0x40')][_0x9150('0x41')]());if(_0x3f2699===_0x9150('0x56')){_0x2bf67e=_[_0x9150('0x57')](_0x2bf67e,_0x2843d7['ids']);}else{if(_[_0x9150('0x3f')](_0x3f2699,_0x9150('0x58')))_0x3f2699=_0x3f2699[_0x9150('0x59')](_0x9150('0x58'),'Queue');_0x2843d7['ids'][_0x9150('0x4d')](function(_0x19c49c){_0x55800c[_0x9150('0x5a')](getAgents(_0x3f2699,_0x19c49c));});}});return BPromise[_0x9150('0x5b')](_0x55800c)[_0x9150('0x25')](function(_0x6db169){_0x2bf67e=_[_0x9150('0x57')](_0x2bf67e,_[_0x9150('0x5c')](_0x6db169));_0x17864a(_0x2bf67e);})[_0x9150('0x51')](function(_0x308200){_0x1dd439(_0x308200);});});}function getAgents(_0x38ec0e,_0xc7a69f){return new BPromise(function(_0x358b97,_0x323150){return db[_0x38ec0e][_0x9150('0x5d')]({'where':{'id':_0xc7a69f}})['then'](function(_0x367cb8){return _0x367cb8['getAgents']({'attributes':['id'],'raw':!![]})[_0x9150('0x25')](function(_0x5cd306){var _0x222547=_['map'](_0x5cd306,'id');_0x358b97(_0x222547);});})[_0x9150('0x51')](function(_0x4dd1c0){_0x323150(_0x4dd1c0);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 7ea51f4..8f49346 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 _0xb88e=['update','emit','hook','events','../../mysqldb','UserNotification','setMaxListeners'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0xb88e,0x1c3));var _0xeb88=function(_0x486ba0,_0x4eaf00){_0x486ba0=_0x486ba0-0x0;var _0x8f437d=_0xb88e[_0x486ba0];return _0x8f437d;};'use strict';var EventEmitter=require(_0xeb88('0x0'));var UserNotification=require(_0xeb88('0x1'))['db'][_0xeb88('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xeb88('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xeb88('0x4'),'afterDestroy':'remove'};function emitEvent(_0x37176b){return function(_0x22fb0e,_0x4c800c,_0x505a88){UserNotificationEvents[_0xeb88('0x5')](_0x37176b+':'+_0x22fb0e['id'],_0x22fb0e);UserNotificationEvents[_0xeb88('0x5')](_0x37176b,_0x22fb0e);_0x505a88(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification[_0xeb88('0x6')](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file +var _0xca23=['../../mysqldb','UserNotification','setMaxListeners','remove','emit','exports','events'];(function(_0x5a0f5c,_0x241ba6){var _0x29d96b=function(_0x4eb553){while(--_0x4eb553){_0x5a0f5c['push'](_0x5a0f5c['shift']());}};_0x29d96b(++_0x241ba6);}(_0xca23,0x125));var _0x3ca2=function(_0x36ed3c,_0x44a00a){_0x36ed3c=_0x36ed3c-0x0;var _0x52a2e0=_0xca23[_0x36ed3c];return _0x52a2e0;};'use strict';var EventEmitter=require(_0x3ca2('0x0'));var UserNotification=require(_0x3ca2('0x1'))['db'][_0x3ca2('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x3ca2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x3ca2('0x4')};function emitEvent(_0x16cf76){return function(_0x3ab19c,_0x24a9d7,_0x3f16e8){UserNotificationEvents[_0x3ca2('0x5')](_0x16cf76+':'+_0x3ab19c['id'],_0x3ab19c);UserNotificationEvents[_0x3ca2('0x5')](_0x16cf76,_0x3ab19c);_0x3f16e8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0x3ca2('0x6')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 1cc062b..a9f2c6b 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 _0x7a76=['request-promise','path','rimraf','../../config/environment','./userNotification.attributes','exports','UserNotification','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x512402,_0x684888){var _0x5aa70c=function(_0x3d1b2a){while(--_0x3d1b2a){_0x512402['push'](_0x512402['shift']());}};_0x5aa70c(++_0x684888);}(_0x7a76,0x6b));var _0x67a7=function(_0x17c483,_0xc69535){_0x17c483=_0x17c483-0x0;var _0x112bdb=_0x7a76[_0x17c483];return _0x112bdb;};'use strict';var _=require(_0x67a7('0x0'));var util=require(_0x67a7('0x1'));var logger=require(_0x67a7('0x2'))(_0x67a7('0x3'));var moment=require(_0x67a7('0x4'));var BPromise=require('bluebird');var rp=require(_0x67a7('0x5'));var fs=require('fs');var path=require(_0x67a7('0x6'));var rimraf=require(_0x67a7('0x7'));var config=require(_0x67a7('0x8'));var attributes=require(_0x67a7('0x9'));module[_0x67a7('0xa')]=function(_0x2d9c5e,_0x49cc09){return _0x2d9c5e['define'](_0x67a7('0xb'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x67a7('0xc'),'collate':_0x67a7('0xd')});}; \ No newline at end of file +var _0x00fc=['lodash','util','api','moment','request-promise','path','../../config/environment','./userNotification.attributes','define','userNotifications','utf8mb4'];(function(_0x3d9939,_0x3bb2b){var _0x269bd8=function(_0x11dbc5){while(--_0x11dbc5){_0x3d9939['push'](_0x3d9939['shift']());}};_0x269bd8(++_0x3bb2b);}(_0x00fc,0xd1));var _0xc00f=function(_0x3299d1,_0x545733){_0x3299d1=_0x3299d1-0x0;var _0x44356e=_0x00fc[_0x3299d1];return _0x44356e;};'use strict';var _=require(_0xc00f('0x0'));var util=require(_0xc00f('0x1'));var logger=require('../../config/logger')(_0xc00f('0x2'));var moment=require(_0xc00f('0x3'));var BPromise=require('bluebird');var rp=require(_0xc00f('0x4'));var fs=require('fs');var path=require(_0xc00f('0x5'));var rimraf=require('rimraf');var config=require(_0xc00f('0x6'));var attributes=require(_0xc00f('0x7'));module['exports']=function(_0xa980cb,_0x13ec82){return _0xa980cb[_0xc00f('0x8')]('UserNotification',attributes,{'tableName':_0xc00f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc00f('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 1898a0b..2072074 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 _0xdb57=['socket.io-emitter','./userNotification.socket','then','info','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','UserNotification,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults'];(function(_0x4e3006,_0x338ef5){var _0x215bda=function(_0x29f761){while(--_0x29f761){_0x4e3006['push'](_0x4e3006['shift']());}};_0x215bda(++_0x338ef5);}(_0xdb57,0x71));var _0x7db5=function(_0x54817f,_0x4e5ce5){_0x54817f=_0x54817f-0x0;var _0x3717ab=_0xdb57[_0x54817f];return _0x3717ab;};'use strict';var _=require(_0x7db5('0x0'));var util=require(_0x7db5('0x1'));var moment=require(_0x7db5('0x2'));var BPromise=require(_0x7db5('0x3'));var rs=require(_0x7db5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7db5('0x5'));var logger=require(_0x7db5('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7db5('0x7'));var client=jayson[_0x7db5('0x8')][_0x7db5('0x9')]({'port':0x232a});config[_0x7db5('0xa')]=_[_0x7db5('0xb')](config[_0x7db5('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x7db5('0xc'))(new Redis(config[_0x7db5('0xa')]));require(_0x7db5('0xd'))['register'](socket);function respondWithRpcPromise(_0x2eb152,_0x5527a7,_0x240385){return new BPromise(function(_0x1b5582,_0x334ae0){return client['request'](_0x2eb152,_0x240385)[_0x7db5('0xe')](function(_0x4bf894){logger[_0x7db5('0xf')]('UserNotification,\x20%s,\x20%s',_0x5527a7,_0x7db5('0x10'));logger[_0x7db5('0x11')](_0x7db5('0x12'),_0x5527a7,_0x7db5('0x10'),JSON[_0x7db5('0x13')](_0x4bf894));if(_0x4bf894[_0x7db5('0x14')]){if(_0x4bf894[_0x7db5('0x14')][_0x7db5('0x15')]===0x1f4){logger[_0x7db5('0x14')](_0x7db5('0x16'),_0x5527a7,_0x4bf894[_0x7db5('0x14')][_0x7db5('0x17')]);return _0x334ae0(_0x4bf894[_0x7db5('0x14')][_0x7db5('0x17')]);}logger['error'](_0x7db5('0x16'),_0x5527a7,_0x4bf894['error'][_0x7db5('0x17')]);return _0x1b5582(_0x4bf894[_0x7db5('0x14')][_0x7db5('0x17')]);}else{logger[_0x7db5('0xf')]('UserNotification,\x20%s,\x20%s',_0x5527a7,_0x7db5('0x10'));_0x1b5582(_0x4bf894[_0x7db5('0x18')][_0x7db5('0x17')]);}})['catch'](function(_0x732089){logger[_0x7db5('0x14')](_0x7db5('0x16'),_0x5527a7,_0x732089);_0x334ae0(_0x732089);});});} \ No newline at end of file +var _0xe630=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./userNotification.socket','then','info','UserNotification,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','lodash','util','bluebird','randomstring','ioredis'];(function(_0x3a9635,_0x1ab817){var _0x10d08c=function(_0x222242){while(--_0x222242){_0x3a9635['push'](_0x3a9635['shift']());}};_0x10d08c(++_0x1ab817);}(_0xe630,0x1f3));var _0x0e63=function(_0x2a0503,_0x5a4b2f){_0x2a0503=_0x2a0503-0x0;var _0x2c1e6c=_0xe630[_0x2a0503];return _0x2c1e6c;};'use strict';var _=require(_0x0e63('0x0'));var util=require(_0x0e63('0x1'));var moment=require('moment');var BPromise=require(_0x0e63('0x2'));var rs=require(_0x0e63('0x3'));var fs=require('fs');var Redis=require(_0x0e63('0x4'));var db=require(_0x0e63('0x5'))['db'];var utils=require(_0x0e63('0x6'));var logger=require('../../config/logger')(_0x0e63('0x7'));var config=require(_0x0e63('0x8'));var jayson=require(_0x0e63('0x9'));var client=jayson[_0x0e63('0xa')][_0x0e63('0xb')]({'port':0x232a});config[_0x0e63('0xc')]=_[_0x0e63('0xd')](config[_0x0e63('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0e63('0xe'))['register'](socket);function respondWithRpcPromise(_0x551d62,_0x2f6e56,_0x39b2f0){return new BPromise(function(_0x4021dc,_0x254920){return client['request'](_0x551d62,_0x39b2f0)[_0x0e63('0xf')](function(_0x1cd486){logger[_0x0e63('0x10')](_0x0e63('0x11'),_0x2f6e56,'request\x20sent');logger[_0x0e63('0x12')]('UserNotification,\x20%s,\x20%s,\x20%s',_0x2f6e56,_0x0e63('0x13'),JSON['stringify'](_0x1cd486));if(_0x1cd486[_0x0e63('0x14')]){if(_0x1cd486['error'][_0x0e63('0x15')]===0x1f4){logger[_0x0e63('0x14')]('UserNotification,\x20%s,\x20%s',_0x2f6e56,_0x1cd486[_0x0e63('0x14')][_0x0e63('0x16')]);return _0x254920(_0x1cd486[_0x0e63('0x14')]['message']);}logger[_0x0e63('0x14')]('UserNotification,\x20%s,\x20%s',_0x2f6e56,_0x1cd486[_0x0e63('0x14')][_0x0e63('0x16')]);return _0x4021dc(_0x1cd486[_0x0e63('0x14')]['message']);}else{logger[_0x0e63('0x10')](_0x0e63('0x11'),_0x2f6e56,_0x0e63('0x13'));_0x4021dc(_0x1cd486[_0x0e63('0x17')][_0x0e63('0x16')]);}})['catch'](function(_0xe0fab4){logger[_0x0e63('0x14')]('UserNotification,\x20%s,\x20%s',_0x2f6e56,_0xe0fab4);_0x254920(_0xe0fab4);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 9f26bc8..a82a9cb 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 _0x680e=['removeListener','register','length','./userNotification.events','save','update','emit'];(function(_0x4dc7b9,_0x319d5a){var _0x3ab114=function(_0x51a9df){while(--_0x51a9df){_0x4dc7b9['push'](_0x4dc7b9['shift']());}};_0x3ab114(++_0x319d5a);}(_0x680e,0x1d8));var _0xe680=function(_0x1e2d0b,_0x590873){_0x1e2d0b=_0x1e2d0b-0x0;var _0x272dc5=_0x680e[_0x1e2d0b];return _0x272dc5;};'use strict';var UserNotificationEvents=require(_0xe680('0x0'));var events=[_0xe680('0x1'),'remove',_0xe680('0x2')];function createListener(_0x300b18,_0xb69911){return function(_0x4e7de6){_0xb69911[_0xe680('0x3')](_0x300b18,_0x4e7de6);};}function removeListener(_0x25d006,_0x58c41d){return function(){UserNotificationEvents[_0xe680('0x4')](_0x25d006,_0x58c41d);};}exports[_0xe680('0x5')]=function(_0x474d1b){for(var _0x3e987f=0x0,_0x5c94fe=events[_0xe680('0x6')];_0x3e987f<_0x5c94fe;_0x3e987f++){var _0x442d89=events[_0x3e987f];var _0x32a058=createListener('userNotification:'+_0x442d89,_0x474d1b);UserNotificationEvents['on'](_0x442d89,_0x32a058);}}; \ No newline at end of file +var _0xccdd=['emit','register','userNotification:','save','remove'];(function(_0x290258,_0x1476b3){var _0x43de3b=function(_0x51290c){while(--_0x51290c){_0x290258['push'](_0x290258['shift']());}};_0x43de3b(++_0x1476b3);}(_0xccdd,0xe4));var _0xdccd=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xccdd[_0x4b369d];return _0x571a98;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0xdccd('0x0'),_0xdccd('0x1'),'update'];function createListener(_0x2bb62c,_0x1f13dc){return function(_0x2b00b1){_0x1f13dc[_0xdccd('0x2')](_0x2bb62c,_0x2b00b1);};}function removeListener(_0x2aa278,_0x1e2f5e){return function(){UserNotificationEvents['removeListener'](_0x2aa278,_0x1e2f5e);};}exports[_0xdccd('0x3')]=function(_0x19a528){for(var _0x4aed77=0x0,_0xe71712=events['length'];_0x4aed77<_0xe71712;_0x4aed77++){var _0x37f293=events[_0x4aed77];var _0x5819bb=createListener(_0xdccd('0x4')+_0x37f293,_0x19a528);UserNotificationEvents['on'](_0x37f293,_0x5819bb);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index d9ca31b..727103f 100644 --- a/server/api/userOpenchannelQueue/index.js +++ b/server/api/userOpenchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x5a702f,_0x3261c8){var _0x227f7f=function(_0x3ab078){while(--_0x3ab078){_0x5a702f['push'](_0x5a702f['shift']());}};_0x227f7f(++_0x3261c8);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xcb91[_0x53ccf2];return _0x5a2964;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x40478a,_0x17ed24){var _0x417d31=function(_0xc723ee){while(--_0xc723ee){_0x40478a['push'](_0x40478a['shift']());}};_0x417d31(++_0x17ed24);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 213bfff..103a8b1 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 _0xa8f1=['exports','INTEGER'];(function(_0x30e8c9,_0x2921eb){var _0x1dc43=function(_0x2fb732){while(--_0x2fb732){_0x30e8c9['push'](_0x30e8c9['shift']());}};_0x1dc43(++_0x2921eb);}(_0xa8f1,0x19e));var _0x1a8f=function(_0x37091d,_0x3c5931){_0x37091d=_0x37091d-0x0;var _0x1c970c=_0xa8f1[_0x37091d];return _0x1c970c;};'use strict';var Sequelize=require('sequelize');module[_0x1a8f('0x0')]={'penalty':{'type':Sequelize[_0x1a8f('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc2fc=['exports','INTEGER','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc2fc,0xda));var _0xcc2f=function(_0x2f1723,_0x2a45ec){_0x2f1723=_0x2f1723-0x0;var _0x41b56a=_0xc2fc[_0x2f1723];return _0x41b56a;};'use strict';var Sequelize=require(_0xcc2f('0x0'));module[_0xcc2f('0x1')]={'penalty':{'type':Sequelize[_0xcc2f('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 5865ea9..2819743 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 _0x25d2=['UserOpenchannelQueue','util','moment','bluebird','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','define'];(function(_0xd23ddf,_0x443a35){var _0x4600ba=function(_0x423f30){while(--_0x423f30){_0xd23ddf['push'](_0xd23ddf['shift']());}};_0x4600ba(++_0x443a35);}(_0x25d2,0xd9));var _0x225d=function(_0x358d2e,_0x3a2731){_0x358d2e=_0x358d2e-0x0;var _0x272d3a=_0x25d2[_0x358d2e];return _0x272d3a;};'use strict';var _=require('lodash');var util=require(_0x225d('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x225d('0x1'));var BPromise=require(_0x225d('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x225d('0x3'));var rimraf=require(_0x225d('0x4'));var config=require(_0x225d('0x5'));var attributes=require(_0x225d('0x6'));module['exports']=function(_0x49d1de,_0x9e47fd){return _0x49d1de[_0x225d('0x7')](_0x225d('0x8'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf263=['../../config/logger','api','bluebird','request-promise','path','rimraf','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','util'];(function(_0xb1cf84,_0x813740){var _0x4bad2e=function(_0x53e6f2){while(--_0x53e6f2){_0xb1cf84['push'](_0xb1cf84['shift']());}};_0x4bad2e(++_0x813740);}(_0xf263,0x107));var _0x3f26=function(_0x837dad,_0x1d9098){_0x837dad=_0x837dad-0x0;var _0x1d62d3=_0xf263[_0x837dad];return _0x1d62d3;};'use strict';var _=require('lodash');var util=require(_0x3f26('0x0'));var logger=require(_0x3f26('0x1'))(_0x3f26('0x2'));var moment=require('moment');var BPromise=require(_0x3f26('0x3'));var rp=require(_0x3f26('0x4'));var fs=require('fs');var path=require(_0x3f26('0x5'));var rimraf=require(_0x3f26('0x6'));var config=require('../../config/environment');var attributes=require(_0x3f26('0x7'));module[_0x3f26('0x8')]=function(_0x4fec16,_0x4fd387){return _0x4fec16[_0x3f26('0x9')](_0x3f26('0xa'),attributes,{'tableName':_0x3f26('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index d920490..73e7d88 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 _0x096c=['catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x597a74,_0x1f6e12){var _0x1a76a8=function(_0x560979){while(--_0x560979){_0x597a74['push'](_0x597a74['shift']());}};_0x1a76a8(++_0x1f6e12);}(_0x096c,0x188));var _0xc096=function(_0x7e80c,_0x17e38d){_0x7e80c=_0x7e80c-0x0;var _0x236d90=_0x096c[_0x7e80c];return _0x236d90;};'use strict';var _=require('lodash');var util=require(_0xc096('0x0'));var moment=require(_0xc096('0x1'));var BPromise=require(_0xc096('0x2'));var rs=require(_0xc096('0x3'));var fs=require('fs');var Redis=require(_0xc096('0x4'));var db=require(_0xc096('0x5'))['db'];var utils=require(_0xc096('0x6'));var logger=require(_0xc096('0x7'))(_0xc096('0x8'));var config=require('../../config/environment');var jayson=require(_0xc096('0x9'));var client=jayson['client'][_0xc096('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3d2069,_0x32ce53,_0x39bac6){return new BPromise(function(_0x4eb475,_0x1ba545){return client[_0xc096('0xb')](_0x3d2069,_0x39bac6)[_0xc096('0xc')](function(_0x307125){logger['info'](_0xc096('0xd'),_0x32ce53,_0xc096('0xe'));logger['debug'](_0xc096('0xf'),_0x32ce53,_0xc096('0xe'),JSON[_0xc096('0x10')](_0x307125));if(_0x307125[_0xc096('0x11')]){if(_0x307125[_0xc096('0x11')][_0xc096('0x12')]===0x1f4){logger[_0xc096('0x11')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x32ce53,_0x307125['error'][_0xc096('0x13')]);return _0x1ba545(_0x307125[_0xc096('0x11')]['message']);}logger[_0xc096('0x11')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x32ce53,_0x307125[_0xc096('0x11')]['message']);return _0x4eb475(_0x307125[_0xc096('0x11')][_0xc096('0x13')]);}else{logger[_0xc096('0x14')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x32ce53,'request\x20sent');_0x4eb475(_0x307125[_0xc096('0x15')][_0xc096('0x13')]);}})[_0xc096('0x16')](function(_0xd0dc09){logger[_0xc096('0x11')](_0xc096('0xd'),_0x32ce53,_0xd0dc09);_0x1ba545(_0xd0dc09);});});} \ No newline at end of file +var _0xe624=['message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5a04f3,_0x356611){var _0x4079e6=function(_0x1e2a07){while(--_0x1e2a07){_0x5a04f3['push'](_0x5a04f3['shift']());}};_0x4079e6(++_0x356611);}(_0xe624,0x7c));var _0x4e62=function(_0x44c8cb,_0x2e28c7){_0x44c8cb=_0x44c8cb-0x0;var _0x3bf406=_0xe624[_0x44c8cb];return _0x3bf406;};'use strict';var _=require('lodash');var util=require(_0x4e62('0x0'));var moment=require(_0x4e62('0x1'));var BPromise=require(_0x4e62('0x2'));var rs=require(_0x4e62('0x3'));var fs=require('fs');var Redis=require(_0x4e62('0x4'));var db=require(_0x4e62('0x5'))['db'];var utils=require(_0x4e62('0x6'));var logger=require(_0x4e62('0x7'))(_0x4e62('0x8'));var config=require('../../config/environment');var jayson=require(_0x4e62('0x9'));var client=jayson['client'][_0x4e62('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5212b1,_0xf83f0d,_0x14b51a){return new BPromise(function(_0x4865a2,_0x3bc2ce){return client[_0x4e62('0xb')](_0x5212b1,_0x14b51a)[_0x4e62('0xc')](function(_0x15b8e6){logger['info'](_0x4e62('0xd'),_0xf83f0d,_0x4e62('0xe'));logger[_0x4e62('0xf')](_0x4e62('0x10'),_0xf83f0d,_0x4e62('0xe'),JSON[_0x4e62('0x11')](_0x15b8e6));if(_0x15b8e6[_0x4e62('0x12')]){if(_0x15b8e6['error'][_0x4e62('0x13')]===0x1f4){logger[_0x4e62('0x12')](_0x4e62('0xd'),_0xf83f0d,_0x15b8e6['error']['message']);return _0x3bc2ce(_0x15b8e6['error']['message']);}logger[_0x4e62('0x12')](_0x4e62('0xd'),_0xf83f0d,_0x15b8e6[_0x4e62('0x12')][_0x4e62('0x14')]);return _0x4865a2(_0x15b8e6['error'][_0x4e62('0x14')]);}else{logger[_0x4e62('0x15')](_0x4e62('0xd'),_0xf83f0d,'request\x20sent');_0x4865a2(_0x15b8e6[_0x4e62('0x16')][_0x4e62('0x14')]);}})[_0x4e62('0x17')](function(_0x49b0ac){logger[_0x4e62('0x12')](_0x4e62('0xd'),_0xf83f0d,_0x49b0ac);_0x3bc2ce(_0x49b0ac);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index a136291..b9fe0ad 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 _0x457b=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/sections','/:id/resources','getResources','post','create','clone','addSections','addResources','update','destroy','delete','removeSections','removeResources','exports'];(function(_0x4efa79,_0x5ffafa){var _0x2a630f=function(_0x1533b8){while(--_0x1533b8){_0x4efa79['push'](_0x4efa79['shift']());}};_0x2a630f(++_0x5ffafa);}(_0x457b,0x1d1));var _0xb457=function(_0x919445,_0x5467dc){_0x919445=_0x919445-0x0;var _0x511b3e=_0x457b[_0x919445];return _0x511b3e;};'use strict';var multer=require(_0xb457('0x0'));var util=require(_0xb457('0x1'));var path=require('path');var timeout=require(_0xb457('0x2'));var express=require(_0xb457('0x3'));var router=express[_0xb457('0x4')]();var fs_extra=require(_0xb457('0x5'));var auth=require(_0xb457('0x6'));var interaction=require(_0xb457('0x7'));var config=require(_0xb457('0x8'));var controller=require(_0xb457('0x9'));router[_0xb457('0xa')]('/',auth['isAuthenticated'](),controller[_0xb457('0xb')]);router[_0xb457('0xa')](_0xb457('0xc'),auth[_0xb457('0xd')](),controller[_0xb457('0xe')]);router[_0xb457('0xa')](_0xb457('0xf'),auth[_0xb457('0xd')](),controller[_0xb457('0x10')]);router[_0xb457('0xa')](_0xb457('0x11'),auth[_0xb457('0xd')](),controller['getSections']);router[_0xb457('0xa')](_0xb457('0x12'),auth['isAuthenticated'](),controller[_0xb457('0x13')]);router[_0xb457('0x14')]('/',auth[_0xb457('0xd')](),controller[_0xb457('0x15')]);router[_0xb457('0x14')]('/:id/clone',auth[_0xb457('0xd')](),controller[_0xb457('0x16')]);router[_0xb457('0x14')](_0xb457('0x11'),auth[_0xb457('0xd')](),controller[_0xb457('0x17')]);router['post']('/:id/resources',auth[_0xb457('0xd')](),controller[_0xb457('0x18')]);router['put']('/:id',auth[_0xb457('0xd')](),controller[_0xb457('0x19')]);router['delete'](_0xb457('0xf'),auth[_0xb457('0xd')](),controller[_0xb457('0x1a')]);router[_0xb457('0x1b')](_0xb457('0x11'),auth[_0xb457('0xd')](),controller[_0xb457('0x1c')]);router[_0xb457('0x1b')](_0xb457('0x12'),auth[_0xb457('0xd')](),controller[_0xb457('0x1d')]);module[_0xb457('0x1e')]=router; \ No newline at end of file +var _0x0588=['update','delete','destroy','/:id/resources','removeResources','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./userProfile.controller','get','isAuthenticated','index','describe','/:id','show','/:id/sections','getSections','post','create','/:id/clone','clone','addSections','addResources','put'];(function(_0x511093,_0x2266d8){var _0x577e1d=function(_0x25da86){while(--_0x25da86){_0x511093['push'](_0x511093['shift']());}};_0x577e1d(++_0x2266d8);}(_0x0588,0xd8));var _0x8058=function(_0x402fa3,_0x3f887b){_0x402fa3=_0x402fa3-0x0;var _0x344170=_0x0588[_0x402fa3];return _0x344170;};'use strict';var multer=require(_0x8058('0x0'));var util=require(_0x8058('0x1'));var path=require(_0x8058('0x2'));var timeout=require(_0x8058('0x3'));var express=require(_0x8058('0x4'));var router=express[_0x8058('0x5')]();var fs_extra=require(_0x8058('0x6'));var auth=require(_0x8058('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8058('0x8'));router[_0x8058('0x9')]('/',auth[_0x8058('0xa')](),controller[_0x8058('0xb')]);router[_0x8058('0x9')]('/describe',auth[_0x8058('0xa')](),controller[_0x8058('0xc')]);router[_0x8058('0x9')](_0x8058('0xd'),auth['isAuthenticated'](),controller[_0x8058('0xe')]);router[_0x8058('0x9')](_0x8058('0xf'),auth[_0x8058('0xa')](),controller[_0x8058('0x10')]);router[_0x8058('0x9')]('/:id/resources',auth[_0x8058('0xa')](),controller['getResources']);router[_0x8058('0x11')]('/',auth[_0x8058('0xa')](),controller[_0x8058('0x12')]);router[_0x8058('0x11')](_0x8058('0x13'),auth[_0x8058('0xa')](),controller[_0x8058('0x14')]);router[_0x8058('0x11')]('/:id/sections',auth[_0x8058('0xa')](),controller[_0x8058('0x15')]);router['post']('/:id/resources',auth[_0x8058('0xa')](),controller[_0x8058('0x16')]);router[_0x8058('0x17')](_0x8058('0xd'),auth[_0x8058('0xa')](),controller[_0x8058('0x18')]);router[_0x8058('0x19')](_0x8058('0xd'),auth[_0x8058('0xa')](),controller[_0x8058('0x1a')]);router[_0x8058('0x19')](_0x8058('0xf'),auth[_0x8058('0xa')](),controller['removeSections']);router[_0x8058('0x19')](_0x8058('0x1b'),auth['isAuthenticated'](),controller[_0x8058('0x1c')]);module[_0x8058('0x1d')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 2553462..c5c98c0 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 _0xae1b=['getDataValue','BOOLEAN','sequelize','STRING','setDataValue','crudPermissions','join'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0xae1b,0x191));var _0xbae1=function(_0x213d6a,_0x889774){_0x213d6a=_0x213d6a-0x0;var _0x726dfd=_0xae1b[_0x213d6a];return _0x726dfd;};'use strict';var Sequelize=require(_0xbae1('0x0'));module['exports']={'name':{'type':Sequelize[_0xbae1('0x1')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0xbae1('0x1')],'set':function(_0x29c36a){this[_0xbae1('0x2')](_0xbae1('0x3'),_0x29c36a?_0x29c36a[_0xbae1('0x4')](''):[]);},'get':function(){return this[_0xbae1('0x5')](_0xbae1('0x3'))?this[_0xbae1('0x5')]('crudPermissions')['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xbae1('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xbae1('0x6')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xbae1('0x6')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xbae1('0x6')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xe560=['sequelize','exports','STRING','setDataValue','crudPermissions','join','getDataValue','split','BOOLEAN'];(function(_0x294cf1,_0x5d6a40){var _0x334402=function(_0x5b07f0){while(--_0x5b07f0){_0x294cf1['push'](_0x294cf1['shift']());}};_0x334402(++_0x5d6a40);}(_0xe560,0xe1));var _0x0e56=function(_0x3b601a,_0x1fcc08){_0x3b601a=_0x3b601a-0x0;var _0x3b4d2b=_0xe560[_0x3b601a];return _0x3b4d2b;};'use strict';var Sequelize=require(_0x0e56('0x0'));module[_0x0e56('0x1')]={'name':{'type':Sequelize[_0x0e56('0x2')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x0e56('0x2')],'set':function(_0xfd822a){this[_0x0e56('0x3')](_0x0e56('0x4'),_0xfd822a?_0xfd822a[_0x0e56('0x5')](''):[]);},'get':function(){return this[_0x0e56('0x6')](_0x0e56('0x4'))?this[_0x0e56('0x6')](_0x0e56('0x4'))[_0x0e56('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x0e56('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x0e56('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x0e56('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x0e56('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x0e56('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x0e56('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x0e56('0x8')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 714adc9..efbb096 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 _0x6b1b=['map','keys','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','create','body','catch','clone','omit','createdAt','sequelize','transaction','get','each','autoAssociation','UserProfileResource','updatedAt','sectionId','UserProfileSection','update','destroy','describe','addSections','userProfileId','push','ids','getSections','enabled','includes','isEmpty','subsections','findOne','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','section','Missing\x20section\x20parameter','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','json','undefined','limit','count','offset','apply','reject','save','then','end','error','name','send','index','UserProfile','rawAttributes','fieldName','type','key','model'];(function(_0x710815,_0x520da8){var _0x5b3b89=function(_0x2e1a8e){while(--_0x2e1a8e){_0x710815['push'](_0x710815['shift']());}};_0x5b3b89(++_0x520da8);}(_0x6b1b,0x1e7));var _0xb6b1=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0x6b1b[_0x411add];return _0x238242;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb6b1('0x0'));var zipdir=require(_0xb6b1('0x1'));var jsonpatch=require(_0xb6b1('0x2'));var rp=require('request-promise');var moment=require(_0xb6b1('0x3'));var BPromise=require(_0xb6b1('0x4'));var Mustache=require(_0xb6b1('0x5'));var util=require(_0xb6b1('0x6'));var path=require(_0xb6b1('0x7'));var sox=require(_0xb6b1('0x8'));var csv=require(_0xb6b1('0x9'));var ejs=require(_0xb6b1('0xa'));var fs=require('fs');var fs_extra=require(_0xb6b1('0xb'));var _=require(_0xb6b1('0xc'));var squel=require(_0xb6b1('0xd'));var crypto=require('crypto');var jsforce=require(_0xb6b1('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb6b1('0xf'));var Papa=require('papaparse');var Redis=require(_0xb6b1('0x10'));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(_0xb6b1('0x11'))(_0xb6b1('0x12'));var utils=require('../../config/utils');var config=require(_0xb6b1('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xb6b1('0x14')]=_[_0xb6b1('0x15')](config[_0xb6b1('0x14')],{'host':_0xb6b1('0x16'),'port':0x18eb});var socket=require(_0xb6b1('0x17'))(new Redis(config[_0xb6b1('0x14')]));require(_0xb6b1('0x18'))[_0xb6b1('0x19')](socket);function respondWithStatusCode(_0x2a4d72,_0x218c98){_0x218c98=_0x218c98||0xcc;return function(_0x2629db){if(_0x2629db){return _0x2a4d72[_0xb6b1('0x1a')](_0x218c98);}return _0x2a4d72['status'](_0x218c98)['end']();};}function respondWithResult(_0x513207,_0x51f25f){_0x51f25f=_0x51f25f||0xc8;return function(_0xee229d){if(_0xee229d){return _0x513207[_0xb6b1('0x1b')](_0x51f25f)[_0xb6b1('0x1c')](_0xee229d);}};}function respondWithFilteredResult(_0x2b72e5,_0x32e395){return function(_0x51fb33){if(_0x51fb33){var _0x47a204=typeof _0x32e395['offset']===_0xb6b1('0x1d')&&typeof _0x32e395[_0xb6b1('0x1e')]===_0xb6b1('0x1d');var _0x11e8ae=_0x51fb33[_0xb6b1('0x1f')];var _0x3fc9b1=_0x47a204?0x0:_0x32e395['offset'];var _0x4e132a=_0x47a204?_0x51fb33[_0xb6b1('0x1f')]:_0x32e395[_0xb6b1('0x20')]+_0x32e395['limit'];var _0x5ced4c;if(_0x4e132a>=_0x11e8ae){_0x4e132a=_0x11e8ae;_0x5ced4c=0xc8;}else{_0x5ced4c=0xce;}_0x2b72e5[_0xb6b1('0x1b')](_0x5ced4c);return _0x2b72e5['set']('Content-Range',_0x3fc9b1+'-'+_0x4e132a+'/'+_0x11e8ae)[_0xb6b1('0x1c')](_0x51fb33);}return null;};}function patchUpdates(_0x2086ea){return function(_0x36ac63){try{jsonpatch[_0xb6b1('0x21')](_0x36ac63,_0x2086ea,!![]);}catch(_0x164952){return BPromise[_0xb6b1('0x22')](_0x164952);}return _0x36ac63[_0xb6b1('0x23')]();};}function saveUpdates(_0x3b1ff7,_0x472585){return function(_0x20066f){if(_0x20066f){return _0x20066f['update'](_0x3b1ff7)[_0xb6b1('0x24')](function(_0x4f1e2e){return _0x4f1e2e;});}return null;};}function removeEntity(_0xd8e094,_0x5864d6){return function(_0xdbcb77){if(_0xdbcb77){return _0xdbcb77['destroy']()[_0xb6b1('0x24')](function(){_0xd8e094[_0xb6b1('0x1b')](0xcc)[_0xb6b1('0x25')]();});}};}function handleEntityNotFound(_0x178401,_0x13e841){return function(_0x188627){if(!_0x188627){_0x178401[_0xb6b1('0x1a')](0x194);}return _0x188627;};}function handleError(_0xd3c6da,_0x1a16ad){_0x1a16ad=_0x1a16ad||0x1f4;return function(_0x5a523c){logger[_0xb6b1('0x26')](_0x5a523c['stack']);if(_0x5a523c[_0xb6b1('0x27')]){delete _0x5a523c[_0xb6b1('0x27')];}_0xd3c6da[_0xb6b1('0x1b')](_0x1a16ad)[_0xb6b1('0x28')](_0x5a523c);};}exports[_0xb6b1('0x29')]=function(_0x12f369,_0x206b7f){var _0x59094f={},_0x427797={},_0x2ccd37={'count':0x0,'rows':[]};var _0x1791a2=_['map'](db[_0xb6b1('0x2a')][_0xb6b1('0x2b')],function(_0x5ed56c){return{'name':_0x5ed56c[_0xb6b1('0x2c')],'type':_0x5ed56c[_0xb6b1('0x2d')][_0xb6b1('0x2e')]};});_0x427797[_0xb6b1('0x2f')]=_[_0xb6b1('0x30')](_0x1791a2,_0xb6b1('0x27'));_0x427797['query']=_[_0xb6b1('0x31')](_0x12f369[_0xb6b1('0x32')]);_0x427797['filters']=_[_0xb6b1('0x33')](_0x427797['model'],_0x427797[_0xb6b1('0x32')]);_0x59094f[_0xb6b1('0x34')]=_[_0xb6b1('0x33')](_0x427797[_0xb6b1('0x2f')],qs[_0xb6b1('0x35')](_0x12f369[_0xb6b1('0x32')]['fields']));_0x59094f[_0xb6b1('0x34')]=_0x59094f[_0xb6b1('0x34')][_0xb6b1('0x36')]?_0x59094f[_0xb6b1('0x34')]:_0x427797['model'];if(!_0x12f369['query']['hasOwnProperty'](_0xb6b1('0x37'))){_0x59094f[_0xb6b1('0x1e')]=qs[_0xb6b1('0x1e')](_0x12f369[_0xb6b1('0x32')][_0xb6b1('0x1e')]);_0x59094f[_0xb6b1('0x20')]=qs[_0xb6b1('0x20')](_0x12f369[_0xb6b1('0x32')][_0xb6b1('0x20')]);}_0x59094f[_0xb6b1('0x38')]=qs[_0xb6b1('0x39')](_0x12f369[_0xb6b1('0x32')]['sort']);_0x59094f[_0xb6b1('0x3a')]=qs[_0xb6b1('0x3b')](_[_0xb6b1('0x3c')](_0x12f369[_0xb6b1('0x32')],_0x427797[_0xb6b1('0x3b')]),_0x1791a2);if(_0x12f369[_0xb6b1('0x32')][_0xb6b1('0x3d')]){_0x59094f[_0xb6b1('0x3a')]=_[_0xb6b1('0x3e')](_0x59094f[_0xb6b1('0x3a')],{'$or':_[_0xb6b1('0x30')](_0x1791a2,function(_0x56470a){if(_0x56470a[_0xb6b1('0x2d')]!==_0xb6b1('0x3f')){var _0x3090ac={};_0x3090ac[_0x56470a[_0xb6b1('0x27')]]={'$like':'%'+_0x12f369[_0xb6b1('0x32')][_0xb6b1('0x3d')]+'%'};return _0x3090ac;}})});}_0x59094f=_[_0xb6b1('0x3e')]({},_0x59094f,_0x12f369[_0xb6b1('0x40')]);var _0x51e68c={'where':_0x59094f['where']};return db[_0xb6b1('0x2a')][_0xb6b1('0x1f')](_0x51e68c)[_0xb6b1('0x24')](function(_0x541eb5){_0x2ccd37[_0xb6b1('0x1f')]=_0x541eb5;if(_0x12f369[_0xb6b1('0x32')][_0xb6b1('0x41')]){_0x59094f[_0xb6b1('0x42')]=[{'all':!![]}];}return db[_0xb6b1('0x2a')][_0xb6b1('0x43')](_0x59094f);})[_0xb6b1('0x24')](function(_0x339edf){_0x2ccd37['rows']=_0x339edf;return _0x2ccd37;})[_0xb6b1('0x24')](respondWithFilteredResult(_0x206b7f,_0x59094f))['catch'](handleError(_0x206b7f,null));};exports[_0xb6b1('0x44')]=function(_0x23b85b,_0x11cc74){var _0x3ef3bf={'raw':![],'where':{'id':_0x23b85b[_0xb6b1('0x45')]['id']}},_0x2911b0={};_0x2911b0['model']=_[_0xb6b1('0x31')](db[_0xb6b1('0x2a')]['rawAttributes']);_0x2911b0[_0xb6b1('0x32')]=_['keys'](_0x23b85b[_0xb6b1('0x32')]);_0x2911b0[_0xb6b1('0x3b')]=_[_0xb6b1('0x33')](_0x2911b0[_0xb6b1('0x2f')],_0x2911b0[_0xb6b1('0x32')]);_0x3ef3bf[_0xb6b1('0x34')]=_[_0xb6b1('0x33')](_0x2911b0[_0xb6b1('0x2f')],qs[_0xb6b1('0x35')](_0x23b85b['query']['fields']));_0x3ef3bf[_0xb6b1('0x34')]=_0x3ef3bf[_0xb6b1('0x34')]['length']?_0x3ef3bf[_0xb6b1('0x34')]:_0x2911b0[_0xb6b1('0x2f')];if(_0x23b85b[_0xb6b1('0x32')][_0xb6b1('0x41')]){_0x3ef3bf[_0xb6b1('0x42')]=[{'all':!![]}];}_0x3ef3bf=_['merge']({},_0x3ef3bf,_0x23b85b[_0xb6b1('0x40')]);return db[_0xb6b1('0x2a')][_0xb6b1('0x46')](_0x3ef3bf)[_0xb6b1('0x24')](handleEntityNotFound(_0x11cc74,null))['then'](respondWithResult(_0x11cc74,null))['catch'](handleError(_0x11cc74,null));};exports[_0xb6b1('0x47')]=function(_0x5bd5e9,_0x2be9e7){return db[_0xb6b1('0x2a')]['create'](_0x5bd5e9[_0xb6b1('0x48')],{})['then'](respondWithResult(_0x2be9e7,0xc9))[_0xb6b1('0x49')](handleError(_0x2be9e7,null));};exports[_0xb6b1('0x4a')]=function(_0xbd7cec,_0x1b41bb){var _0x3019f1={'where':{'id':_0xbd7cec[_0xb6b1('0x45')]['id']}},_0xc63bf5={};_0xc63bf5[_0xb6b1('0x2f')]=_[_0xb6b1('0x31')](db[_0xb6b1('0x2a')]['rawAttributes']);_0x3019f1[_0xb6b1('0x34')]=_[_0xb6b1('0x33')](_0xc63bf5[_0xb6b1('0x2f')],qs[_0xb6b1('0x35')](_0xbd7cec[_0xb6b1('0x32')][_0xb6b1('0x35')]));_0x3019f1[_0xb6b1('0x34')]=_0x3019f1[_0xb6b1('0x34')][_0xb6b1('0x36')]?_0x3019f1['attributes']:_0xc63bf5[_0xb6b1('0x2f')];if(_0xbd7cec['query']['includeAll']){_0x3019f1[_0xb6b1('0x42')]=[{'all':!![]}];}_0x3019f1=_[_0xb6b1('0x3e')]({},_0x3019f1,_0xbd7cec['options']);return db[_0xb6b1('0x2a')][_0xb6b1('0x46')](_0x3019f1)[_0xb6b1('0x24')](handleEntityNotFound(_0x1b41bb,null))['then'](function(_0xec473f){if(_0xec473f){var _0x549e26=_0xec473f['get']({'plain':!![]});_0x549e26=qs[_0xb6b1('0x4b')](_0x549e26,['id',_0xb6b1('0x4c'),'updatedAt','crudPermissions']);_0xbd7cec['body']=_[_0xb6b1('0x4b')](_0xbd7cec['body'],['id','createdAt','updatedAt']);return db[_0xb6b1('0x4d')][_0xb6b1('0x4e')](function(_0x15aefa){return db[_0xb6b1('0x2a')][_0xb6b1('0x47')](_[_0xb6b1('0x3e')](_0x549e26,_0xbd7cec['body']),{'include':_0xbd7cec[_0xb6b1('0x32')][_0xb6b1('0x41')]?[{'all':!![]}]:undefined,'transaction':_0x15aefa})['then'](function(_0x5cf2bf){var _0x47180=_0x5cf2bf[_0xb6b1('0x4f')]({'plain':!![]});return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0xbd7cec[_0xb6b1('0x45')]['id']},'raw':!![]})['then'](function(_0x463482){if(_0x463482){return BPromise[_0xb6b1('0x50')](_0x463482,function(_0x4a07ed){return new BPromise(function(_0x14add3,_0x30f8e5){if(_0x4a07ed[_0xb6b1('0x51')]===null||_0x4a07ed[_0xb6b1('0x51')]===0x1)_0x14add3(null);return db[_0xb6b1('0x52')][_0xb6b1('0x43')]({'where':{'sectionId':_0x4a07ed['id']},'raw':!![]})[_0xb6b1('0x24')](function(_0x35aae0){var _0x10ef87=_[_0xb6b1('0x30')](_0x35aae0,function(_0x4de50b){return qs[_0xb6b1('0x4b')](_0x4de50b,['id',_0xb6b1('0x4c'),_0xb6b1('0x53'),_0xb6b1('0x54')]);});_0x14add3(_0x10ef87);})['catch'](function(_0x431dd9){_0x30f8e5(_0x431dd9);});})[_0xb6b1('0x24')](function(_0x2da39e){var _0xa150da=qs[_0xb6b1('0x4b')](_0x4a07ed,['id',_0xb6b1('0x4c'),_0xb6b1('0x53')]);_0xa150da['userProfileId']=_0x47180['id'];if(_0x2da39e)_0xa150da['Resources']=_0x2da39e;return _0xa150da;})[_0xb6b1('0x24')](function(_0x51c2ed){return db[_0xb6b1('0x55')][_0xb6b1('0x47')](_0x51c2ed,{'include':[{'model':db[_0xb6b1('0x52')],'as':'Resources'}],'raw':!![],'transaction':_0x15aefa});});})[_0xb6b1('0x24')](function(){return _0x47180;});}});});});}})[_0xb6b1('0x24')](respondWithResult(_0x1b41bb,0xc9))[_0xb6b1('0x49')](handleError(_0x1b41bb,null));};exports[_0xb6b1('0x56')]=function(_0x463112,_0x48791c){if(_0x463112['body']['id']){delete _0x463112[_0xb6b1('0x48')]['id'];}return db[_0xb6b1('0x2a')][_0xb6b1('0x46')]({'where':{'id':_0x463112[_0xb6b1('0x45')]['id']}})[_0xb6b1('0x24')](handleEntityNotFound(_0x48791c,null))[_0xb6b1('0x24')](saveUpdates(_0x463112[_0xb6b1('0x48')],null))[_0xb6b1('0x24')](respondWithResult(_0x48791c,null))[_0xb6b1('0x49')](handleError(_0x48791c,null));};exports[_0xb6b1('0x57')]=function(_0x1d6a5a,_0xd4f074){return db['UserProfile'][_0xb6b1('0x46')]({'where':{'id':_0x1d6a5a['params']['id']}})[_0xb6b1('0x24')](handleEntityNotFound(_0xd4f074,null))[_0xb6b1('0x24')](removeEntity(_0xd4f074,null))[_0xb6b1('0x49')](handleError(_0xd4f074,null));};exports['describe']=function(_0x2239b2,_0x4c795a){return db['UserProfile'][_0xb6b1('0x58')]()['then'](respondWithResult(_0x4c795a,null))[_0xb6b1('0x49')](handleError(_0x4c795a,null));};exports[_0xb6b1('0x59')]=function(_0x509667,_0x2780b0){var _0x58fddf=_0x509667[_0xb6b1('0x48')];return db[_0xb6b1('0x2a')][_0xb6b1('0x46')]({'where':{'id':_0x509667['params']['id']}})[_0xb6b1('0x24')](handleEntityNotFound(_0x2780b0,null))['then'](function(_0x20f2f2){if(_0x20f2f2){return db[_0xb6b1('0x4d')][_0xb6b1('0x4e')](function(_0xa740a5){return db['UserProfileSection'][_0xb6b1('0x57')]({'where':{'userProfileId':_0x509667[_0xb6b1('0x45')]['id'],'sectionId':_[_0xb6b1('0x30')](_0x58fddf,function(_0xb611fa){return _0xb611fa[_0xb6b1('0x54')];})},'transaction':_0xa740a5})[_0xb6b1('0x24')](function(){var _0x5e3014=_[_0xb6b1('0x30')](_0x58fddf,function(_0x26fbd8){_0x26fbd8[_0xb6b1('0x5a')]=_0x509667[_0xb6b1('0x45')]['id'];return _0x26fbd8;});var _0x52010b=[];return BPromise[_0xb6b1('0x50')](_0x5e3014,function(_0x1c4bde){return db['UserProfileSection']['create'](_0x1c4bde,{'include':[{'model':db['UserProfileResource'],'as':'Resources'}],'raw':!![],'transaction':_0xa740a5})[_0xb6b1('0x24')](function(_0x439b23){_0x52010b[_0xb6b1('0x5b')](_0x439b23[_0xb6b1('0x4f')]({'plain':!![]}));});})[_0xb6b1('0x24')](function(){return _0x52010b;});});});}})[_0xb6b1('0x24')](function(_0x31b0df){return _0x31b0df;})['then'](respondWithResult(_0x2780b0,null))[_0xb6b1('0x49')](handleError(_0x2780b0,null));};exports['removeSections']=function(_0x49be58,_0x15a64f){var _0x28213e;return db['UserProfile'][_0xb6b1('0x46')]({'where':{'id':_0x49be58[_0xb6b1('0x45')]['id']},'attributes':['id',_0xb6b1('0x27')]})[_0xb6b1('0x24')](handleEntityNotFound(_0x15a64f,null))[_0xb6b1('0x24')](function(_0x5516c7){if(_0x5516c7){_0x28213e=_0x5516c7;return db[_0xb6b1('0x55')][_0xb6b1('0x57')]({'where':{'userProfileId':_0x49be58['params']['id'],'sectionId':_0x49be58['query'][_0xb6b1('0x5c')]}});}})[_0xb6b1('0x24')](function(){return _0x28213e;})[_0xb6b1('0x24')](respondWithStatusCode(_0x15a64f,null))[_0xb6b1('0x49')](handleError(_0x15a64f,null));};exports[_0xb6b1('0x5d')]=function(_0x28860e,_0x17b225){var _0x1c7f8b=[];var _0x4189ec=[];return db['UserProfileSection'][_0xb6b1('0x43')]({'where':{'userProfileId':_0x28860e['params']['id']},'raw':!![]})[_0xb6b1('0x24')](function(_0x3fa8e3){_0x1c7f8b=_[_0xb6b1('0x3d')](_0x3fa8e3,function(_0x500945){return _0x500945[_0xb6b1('0x5e')]===0x1||_[_0xb6b1('0x5f')]([0x3eb,0x709],_0x500945['sectionId']);});if(!_[_0xb6b1('0x60')](_0x1c7f8b)){return _[_0xb6b1('0x30')](_0x1c7f8b,function(_0x4c79dc){return _0x4c79dc[_0xb6b1('0x54')];});}else{return;}})['then'](function(_0x95c84b){if(_0x95c84b)_0x4189ec=_0x95c84b;if(_['includes'](_0x4189ec,0x64)){var _0x300508=_[_0xb6b1('0x46')](_0x1c7f8b,{'sectionId':0x64});return hasDefaultDashboard(_0x300508)[_0xb6b1('0x24')](function(_0xc27ba8){return _[_0xb6b1('0x30')](_0x1c7f8b,function(_0x58d0fa){if(_0x58d0fa[_0xb6b1('0x54')]===0x64){_0x58d0fa[_0xb6b1('0x61')]=_0xc27ba8;}return _0x58d0fa;});});}else{return;}})[_0xb6b1('0x24')](function(_0x45574e){if(_0x45574e)_0x1c7f8b=_0x45574e;if(_[_0xb6b1('0x5f')](_0x4189ec,0x3eb)){var _0x2d8447=_[_0xb6b1('0x46')](_0x1c7f8b,{'sectionId':0x3eb});return getCustomDashboards(_0x2d8447)[_0xb6b1('0x24')](function(_0x8e1139){return _[_0xb6b1('0x30')](_0x1c7f8b,function(_0x326133){if(_0x2d8447[_0xb6b1('0x5e')]){if(_0x326133['sectionId']===0x3eb){_0x326133[_0xb6b1('0x61')]=_0x8e1139;}}else{if(_0x326133[_0xb6b1('0x54')]===0x64){_0x326133['subsections']=_0x8e1139;}}return _0x326133;});});}else{return;}})[_0xb6b1('0x24')](function(_0x23298c){if(_0x23298c)_0x1c7f8b=_0x23298c;if(_['includes'](_0x4189ec,0x709)){var _0x3d8119=_['find'](_0x1c7f8b,{'sectionId':0x709});return getPlugins(_0x3d8119)[_0xb6b1('0x24')](function(_0x5a0b18){if(_0x3d8119[_0xb6b1('0x5e')]){return _['map'](_0x1c7f8b,function(_0x53f086){if(_0x53f086[_0xb6b1('0x54')]===0x709){_0x53f086[_0xb6b1('0x61')]=_0x5a0b18;}return _0x53f086;});}else{var _0x51f5db={'sectionId':0x76c,'enabled':0x1,'subsections':_0x5a0b18};var _0x6b16fc=_[_0xb6b1('0x30')](_0x1c7f8b);_0x6b16fc[_0xb6b1('0x5b')](_0x51f5db);return _0x6b16fc;}});}else{return;}})[_0xb6b1('0x24')](function(_0x292dbe){if(_0x292dbe)_0x1c7f8b=_0x292dbe;return _[_0xb6b1('0x3d')](_0x1c7f8b,[_0xb6b1('0x5e'),0x1]);})[_0xb6b1('0x24')](respondWithResult(_0x17b225,null))[_0xb6b1('0x49')](handleError(_0x17b225,null));};function hasDefaultDashboard(_0x267c1d){var _0x28231c=[0x65];return new BPromise(function(_0x18a71f,_0x521366){try{if(_0x267c1d[_0xb6b1('0x51')]){_0x18a71f(_0x28231c);}else{return db[_0xb6b1('0x52')][_0xb6b1('0x62')]({'where':{'sectionId':_0x267c1d['id']},'raw':!![]})[_0xb6b1('0x24')](function(_0x489898){_0x489898?_0x18a71f(_0x28231c):_0x18a71f();});}}catch(_0x1ee829){_0x521366(_0x1ee829);}});}function getCustomDashboards(_0x2be41a){var _0x15818e=[];return new BPromise(function(_0x25ff4a,_0x320376){try{if(_0x2be41a[_0xb6b1('0x51')]){return db['Dashboard'][_0xb6b1('0x43')]({'raw':!![]})[_0xb6b1('0x24')](function(_0xe96200){_0xe96200[_0xb6b1('0x63')](function(_0x176461){_0x15818e[_0xb6b1('0x5b')](_0x176461['id']+0x1869f);});_0x25ff4a(_0x15818e);});}else{return db[_0xb6b1('0x52')][_0xb6b1('0x43')]({'where':{'sectionId':_0x2be41a['id']},'raw':!![]})[_0xb6b1('0x24')](function(_0x464fe2){_0x464fe2[_0xb6b1('0x63')](function(_0x54fa89){_0x15818e['push'](_0x54fa89[_0xb6b1('0x64')]+0x1869f);});_0x25ff4a(_0x15818e);});}}catch(_0x57feb3){_0x320376(_0x57feb3);}});}function getPlugins(_0x10d789){var _0x4175f7=[];return new BPromise(function(_0x36d30b,_0x32b89e){try{if(_0x10d789[_0xb6b1('0x51')]){return db[_0xb6b1('0x65')]['findAll']({'raw':!![]})[_0xb6b1('0x24')](function(_0x1fa035){_0x1fa035[_0xb6b1('0x63')](function(_0x53a6ff){_0x4175f7[_0xb6b1('0x5b')](_0x53a6ff['id']+0x15b38);});_0x36d30b(_0x4175f7);});}else{return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x10d789['id']},'raw':!![]})[_0xb6b1('0x24')](function(_0x320c96){_0x320c96[_0xb6b1('0x63')](function(_0xf5dbf9){_0x4175f7[_0xb6b1('0x5b')](_0xf5dbf9[_0xb6b1('0x64')]+0x15b38);});_0x36d30b(_0x4175f7);});}}catch(_0x48b430){_0x32b89e(_0x48b430);}});}exports[_0xb6b1('0x66')]=function(_0x4720d0,_0x32e96f){return db[_0xb6b1('0x2a')]['find']({'where':{'id':_0x4720d0['params']['id']}})[_0xb6b1('0x24')](handleEntityNotFound(_0x32e96f,null))['then'](function(_0x287dc3){if(_0x287dc3){return db['sequelize'][_0xb6b1('0x4e')](function(_0x516f87){return db['UserProfileSection'][_0xb6b1('0x43')]({'where':{'userProfileId':_0x4720d0[_0xb6b1('0x45')]['id']},'attributes':['id'],'raw':!![]})[_0xb6b1('0x24')](function(_0x1e57ed){if(_0x1e57ed){return db[_0xb6b1('0x55')]['destroy']({'where':{'userProfileId':_0x4720d0[_0xb6b1('0x45')]['id'],'id':_[_0xb6b1('0x30')](_0x1e57ed,function(_0x1b0ca9){return _0x1b0ca9['id'];})},'transaction':_0x516f87});}})[_0xb6b1('0x24')](function(_0x523037){var _0xb668af=_['map'](_0x4720d0[_0xb6b1('0x48')],function(_0x48167c){_0x48167c[_0xb6b1('0x5a')]=_0x4720d0['params']['id'];return _0x48167c;});return db['UserProfileSection']['bulkCreate'](_0xb668af,{'raw':!![],'transaction':_0x516f87});})['then'](function(_0x15053a){var _0x505f16=_[_0xb6b1('0x3d')](_[_0xb6b1('0x30')](_0x15053a,function(_0x15ca42){return _0x15ca42[_0xb6b1('0x4f')]({'plain':!![]});}),{'includeAll':![]});if(_0x505f16){return db['UserProfileSection'][_0xb6b1('0x43')]({'where':{'userProfileId':_0x4720d0[_0xb6b1('0x45')]['id'],'sectionId':_['map'](_0x505f16,function(_0x55fb2f){return _0x55fb2f['sectionId'];})},'attributes':['id',_0xb6b1('0x54')],'raw':!![]})['then'](function(_0x3267c8){var _0x490f9f=_[_0xb6b1('0x30')](_0x4720d0['body'],function(_0xe90d81){_0xe90d81['userProfileId']=_0x4720d0['params']['id'];return _0xe90d81;});return db[_0xb6b1('0x52')][_0xb6b1('0x67')](_0x490f9f,{'raw':!![],'transaction':_0x516f87});});}})[_0xb6b1('0x49')](handleError(_0x32e96f,null));});}})[_0xb6b1('0x24')](function(_0xb25776){var _0x2ca465=_['map'](_0xb25776,function(_0x2e40d3){return _0x2e40d3[_0xb6b1('0x4f')]({'plain':!![]});});})['then'](respondWithResult(_0x32e96f,null))[_0xb6b1('0x49')](handleError(_0x32e96f,null));};exports[_0xb6b1('0x68')]=function(_0x450da0,_0x5236a3,_0x36f39e){return db[_0xb6b1('0x2a')][_0xb6b1('0x46')]({'where':{'id':_0x450da0[_0xb6b1('0x45')]['id']}})[_0xb6b1('0x24')](handleEntityNotFound(_0x5236a3,null))[_0xb6b1('0x24')](function(_0x1392c5){if(_0x1392c5){return _0x1392c5[_0xb6b1('0x68')](_0x450da0[_0xb6b1('0x32')][_0xb6b1('0x5c')]);}})[_0xb6b1('0x24')](respondWithStatusCode(_0x5236a3,null))['catch'](handleError(_0x5236a3,null));};exports['getResources']=function(_0x54fb1e,_0x160166){var _0x535d47={};if(!_0x54fb1e[_0xb6b1('0x32')][_0xb6b1('0x69')])throw new Error(_0xb6b1('0x6a'));if(!_0x54fb1e[_0xb6b1('0x32')]['hasOwnProperty'](_0xb6b1('0x37'))){_0x535d47['limit']=qs['limit'](_0x54fb1e['query'][_0xb6b1('0x1e')]);_0x535d47[_0xb6b1('0x20')]=qs[_0xb6b1('0x20')](_0x54fb1e[_0xb6b1('0x32')][_0xb6b1('0x20')]);}return db[_0xb6b1('0x2a')][_0xb6b1('0x46')]({'where':{'id':_0x54fb1e['params']['id']}})['then'](function(_0x474a40){if(!_0x474a40)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x54fb1e[_0xb6b1('0x45')]['id']);return db['UserProfile']['getResources'](_0x54fb1e);})['then'](respondWithFilteredResult(_0x160166,_0x535d47))['catch'](handleError(_0x160166,null));}; \ No newline at end of file +var _0x8a9a=['where','pick','filter','merge','type','VIRTUAL','options','findAll','rows','catch','show','params','fields','includeAll','create','body','clone','include','find','get','omit','crudPermissions','createdAt','updatedAt','sequelize','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','describe','addSections','push','removeSections','ids','getSections','enabled','includes','subsections','findOne','Dashboard','forEach','resourceId','Plugin','addResources','removeResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','getResources','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./userProfile.socket','sendStatus','end','status','json','limit','count','offset','Content-Range','apply','then','destroy','error','name','index','UserProfile','rawAttributes','fieldName','model','map','keys','query','filters','intersection','attributes','length','hasOwnProperty','order','sort'];(function(_0x4d0bbb,_0x20ba67){var _0x45526a=function(_0x88d947){while(--_0x88d947){_0x4d0bbb['push'](_0x4d0bbb['shift']());}};_0x45526a(++_0x20ba67);}(_0x8a9a,0x17f));var _0xa8a9=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x8a9a[_0xb0f7c3];return _0x28ea68;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa8a9('0x0'));var zipdir=require(_0xa8a9('0x1'));var jsonpatch=require(_0xa8a9('0x2'));var rp=require(_0xa8a9('0x3'));var moment=require(_0xa8a9('0x4'));var BPromise=require(_0xa8a9('0x5'));var Mustache=require(_0xa8a9('0x6'));var util=require(_0xa8a9('0x7'));var path=require(_0xa8a9('0x8'));var sox=require(_0xa8a9('0x9'));var csv=require(_0xa8a9('0xa'));var ejs=require(_0xa8a9('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa8a9('0xc'));var squel=require('squel');var crypto=require(_0xa8a9('0xd'));var jsforce=require(_0xa8a9('0xe'));var deskjs=require(_0xa8a9('0xf'));var toCsv=require(_0xa8a9('0xa'));var querystring=require(_0xa8a9('0x10'));var Papa=require('papaparse');var Redis=require(_0xa8a9('0x11'));var authService=require(_0xa8a9('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa8a9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa8a9('0x14'))(_0xa8a9('0x15'));var utils=require('../../config/utils');var config=require(_0xa8a9('0x16'));var licenseUtil=require(_0xa8a9('0x17'));var db=require(_0xa8a9('0x18'))['db'];config[_0xa8a9('0x19')]=_[_0xa8a9('0x1a')](config[_0xa8a9('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xa8a9('0x1b'))(new Redis(config[_0xa8a9('0x19')]));require(_0xa8a9('0x1c'))['register'](socket);function respondWithStatusCode(_0x4f35e6,_0x37ea5c){_0x37ea5c=_0x37ea5c||0xcc;return function(_0x1d145e){if(_0x1d145e){return _0x4f35e6[_0xa8a9('0x1d')](_0x37ea5c);}return _0x4f35e6['status'](_0x37ea5c)[_0xa8a9('0x1e')]();};}function respondWithResult(_0x35be8c,_0x557f45){_0x557f45=_0x557f45||0xc8;return function(_0x4b7219){if(_0x4b7219){return _0x35be8c[_0xa8a9('0x1f')](_0x557f45)[_0xa8a9('0x20')](_0x4b7219);}};}function respondWithFilteredResult(_0x91e6d8,_0x35fb9){return function(_0x46a89d){if(_0x46a89d){var _0x4456aa=typeof _0x35fb9['offset']==='undefined'&&typeof _0x35fb9[_0xa8a9('0x21')]==='undefined';var _0x5248fa=_0x46a89d[_0xa8a9('0x22')];var _0x12f932=_0x4456aa?0x0:_0x35fb9[_0xa8a9('0x23')];var _0x3a2207=_0x4456aa?_0x46a89d[_0xa8a9('0x22')]:_0x35fb9[_0xa8a9('0x23')]+_0x35fb9[_0xa8a9('0x21')];var _0x3c37f9;if(_0x3a2207>=_0x5248fa){_0x3a2207=_0x5248fa;_0x3c37f9=0xc8;}else{_0x3c37f9=0xce;}_0x91e6d8[_0xa8a9('0x1f')](_0x3c37f9);return _0x91e6d8['set'](_0xa8a9('0x24'),_0x12f932+'-'+_0x3a2207+'/'+_0x5248fa)['json'](_0x46a89d);}return null;};}function patchUpdates(_0x32721b){return function(_0x58b2f0){try{jsonpatch[_0xa8a9('0x25')](_0x58b2f0,_0x32721b,!![]);}catch(_0x1229d0){return BPromise['reject'](_0x1229d0);}return _0x58b2f0['save']();};}function saveUpdates(_0x5d3ec8,_0x4b2ad1){return function(_0xcca967){if(_0xcca967){return _0xcca967['update'](_0x5d3ec8)[_0xa8a9('0x26')](function(_0x5276bd){return _0x5276bd;});}return null;};}function removeEntity(_0x284b55,_0x16abed){return function(_0x32f687){if(_0x32f687){return _0x32f687[_0xa8a9('0x27')]()[_0xa8a9('0x26')](function(){_0x284b55[_0xa8a9('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c210b,_0x4d6c65){return function(_0x45578f){if(!_0x45578f){_0x3c210b[_0xa8a9('0x1d')](0x194);}return _0x45578f;};}function handleError(_0x476365,_0x1d8db6){_0x1d8db6=_0x1d8db6||0x1f4;return function(_0x21b380){logger[_0xa8a9('0x28')](_0x21b380['stack']);if(_0x21b380[_0xa8a9('0x29')]){delete _0x21b380[_0xa8a9('0x29')];}_0x476365[_0xa8a9('0x1f')](_0x1d8db6)['send'](_0x21b380);};}exports[_0xa8a9('0x2a')]=function(_0x3f2f30,_0x4af312){var _0x4d42fc={},_0x5c9246={},_0x5b4022={'count':0x0,'rows':[]};var _0x294137=_['map'](db[_0xa8a9('0x2b')][_0xa8a9('0x2c')],function(_0x26e330){return{'name':_0x26e330[_0xa8a9('0x2d')],'type':_0x26e330['type']['key']};});_0x5c9246[_0xa8a9('0x2e')]=_[_0xa8a9('0x2f')](_0x294137,_0xa8a9('0x29'));_0x5c9246['query']=_[_0xa8a9('0x30')](_0x3f2f30[_0xa8a9('0x31')]);_0x5c9246[_0xa8a9('0x32')]=_[_0xa8a9('0x33')](_0x5c9246[_0xa8a9('0x2e')],_0x5c9246['query']);_0x4d42fc[_0xa8a9('0x34')]=_[_0xa8a9('0x33')](_0x5c9246[_0xa8a9('0x2e')],qs['fields'](_0x3f2f30[_0xa8a9('0x31')]['fields']));_0x4d42fc['attributes']=_0x4d42fc['attributes'][_0xa8a9('0x35')]?_0x4d42fc['attributes']:_0x5c9246[_0xa8a9('0x2e')];if(!_0x3f2f30[_0xa8a9('0x31')][_0xa8a9('0x36')]('nolimit')){_0x4d42fc[_0xa8a9('0x21')]=qs[_0xa8a9('0x21')](_0x3f2f30['query']['limit']);_0x4d42fc[_0xa8a9('0x23')]=qs[_0xa8a9('0x23')](_0x3f2f30['query'][_0xa8a9('0x23')]);}_0x4d42fc[_0xa8a9('0x37')]=qs['sort'](_0x3f2f30[_0xa8a9('0x31')][_0xa8a9('0x38')]);_0x4d42fc[_0xa8a9('0x39')]=qs['filters'](_[_0xa8a9('0x3a')](_0x3f2f30[_0xa8a9('0x31')],_0x5c9246[_0xa8a9('0x32')]),_0x294137);if(_0x3f2f30['query'][_0xa8a9('0x3b')]){_0x4d42fc['where']=_[_0xa8a9('0x3c')](_0x4d42fc['where'],{'$or':_[_0xa8a9('0x2f')](_0x294137,function(_0x579081){if(_0x579081[_0xa8a9('0x3d')]!==_0xa8a9('0x3e')){var _0x57fc5b={};_0x57fc5b[_0x579081[_0xa8a9('0x29')]]={'$like':'%'+_0x3f2f30['query'][_0xa8a9('0x3b')]+'%'};return _0x57fc5b;}})});}_0x4d42fc=_[_0xa8a9('0x3c')]({},_0x4d42fc,_0x3f2f30[_0xa8a9('0x3f')]);var _0x1aaeda={'where':_0x4d42fc[_0xa8a9('0x39')]};return db[_0xa8a9('0x2b')][_0xa8a9('0x22')](_0x1aaeda)['then'](function(_0x1e05f6){_0x5b4022[_0xa8a9('0x22')]=_0x1e05f6;if(_0x3f2f30[_0xa8a9('0x31')]['includeAll']){_0x4d42fc['include']=[{'all':!![]}];}return db['UserProfile'][_0xa8a9('0x40')](_0x4d42fc);})[_0xa8a9('0x26')](function(_0x210056){_0x5b4022[_0xa8a9('0x41')]=_0x210056;return _0x5b4022;})[_0xa8a9('0x26')](respondWithFilteredResult(_0x4af312,_0x4d42fc))[_0xa8a9('0x42')](handleError(_0x4af312,null));};exports[_0xa8a9('0x43')]=function(_0x2f5650,_0x4cbc17){var _0xdaa921={'raw':![],'where':{'id':_0x2f5650[_0xa8a9('0x44')]['id']}},_0x2368c7={};_0x2368c7[_0xa8a9('0x2e')]=_[_0xa8a9('0x30')](db[_0xa8a9('0x2b')]['rawAttributes']);_0x2368c7[_0xa8a9('0x31')]=_[_0xa8a9('0x30')](_0x2f5650[_0xa8a9('0x31')]);_0x2368c7['filters']=_[_0xa8a9('0x33')](_0x2368c7[_0xa8a9('0x2e')],_0x2368c7[_0xa8a9('0x31')]);_0xdaa921[_0xa8a9('0x34')]=_['intersection'](_0x2368c7[_0xa8a9('0x2e')],qs['fields'](_0x2f5650[_0xa8a9('0x31')][_0xa8a9('0x45')]));_0xdaa921[_0xa8a9('0x34')]=_0xdaa921[_0xa8a9('0x34')][_0xa8a9('0x35')]?_0xdaa921[_0xa8a9('0x34')]:_0x2368c7['model'];if(_0x2f5650[_0xa8a9('0x31')][_0xa8a9('0x46')]){_0xdaa921['include']=[{'all':!![]}];}_0xdaa921=_[_0xa8a9('0x3c')]({},_0xdaa921,_0x2f5650['options']);return db[_0xa8a9('0x2b')]['find'](_0xdaa921)[_0xa8a9('0x26')](handleEntityNotFound(_0x4cbc17,null))[_0xa8a9('0x26')](respondWithResult(_0x4cbc17,null))[_0xa8a9('0x42')](handleError(_0x4cbc17,null));};exports[_0xa8a9('0x47')]=function(_0x13455b,_0x3d5d7e){return db[_0xa8a9('0x2b')]['create'](_0x13455b[_0xa8a9('0x48')],{})[_0xa8a9('0x26')](respondWithResult(_0x3d5d7e,0xc9))['catch'](handleError(_0x3d5d7e,null));};exports[_0xa8a9('0x49')]=function(_0x333628,_0x4b8792){var _0x2716ef={'where':{'id':_0x333628[_0xa8a9('0x44')]['id']}},_0x50dca6={};_0x50dca6[_0xa8a9('0x2e')]=_[_0xa8a9('0x30')](db['UserProfile'][_0xa8a9('0x2c')]);_0x2716ef[_0xa8a9('0x34')]=_['intersection'](_0x50dca6[_0xa8a9('0x2e')],qs[_0xa8a9('0x45')](_0x333628[_0xa8a9('0x31')][_0xa8a9('0x45')]));_0x2716ef[_0xa8a9('0x34')]=_0x2716ef[_0xa8a9('0x34')][_0xa8a9('0x35')]?_0x2716ef[_0xa8a9('0x34')]:_0x50dca6[_0xa8a9('0x2e')];if(_0x333628['query'][_0xa8a9('0x46')]){_0x2716ef[_0xa8a9('0x4a')]=[{'all':!![]}];}_0x2716ef=_[_0xa8a9('0x3c')]({},_0x2716ef,_0x333628[_0xa8a9('0x3f')]);return db[_0xa8a9('0x2b')][_0xa8a9('0x4b')](_0x2716ef)[_0xa8a9('0x26')](handleEntityNotFound(_0x4b8792,null))[_0xa8a9('0x26')](function(_0x503556){if(_0x503556){var _0x4969c8=_0x503556[_0xa8a9('0x4c')]({'plain':!![]});_0x4969c8=qs[_0xa8a9('0x4d')](_0x4969c8,['id','createdAt','updatedAt',_0xa8a9('0x4e')]);_0x333628['body']=_[_0xa8a9('0x4d')](_0x333628['body'],['id',_0xa8a9('0x4f'),_0xa8a9('0x50')]);return db[_0xa8a9('0x51')][_0xa8a9('0x52')](function(_0x29a729){return db['UserProfile'][_0xa8a9('0x47')](_[_0xa8a9('0x3c')](_0x4969c8,_0x333628[_0xa8a9('0x48')]),{'include':_0x333628['query']['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x29a729})[_0xa8a9('0x26')](function(_0xd85ab9){var _0x9c2873=_0xd85ab9['get']({'plain':!![]});return db[_0xa8a9('0x53')][_0xa8a9('0x40')]({'where':{'userProfileId':_0x333628[_0xa8a9('0x44')]['id']},'raw':!![]})['then'](function(_0x1243d2){if(_0x1243d2){return BPromise[_0xa8a9('0x54')](_0x1243d2,function(_0x4d2ffb){return new BPromise(function(_0x580aa3,_0x2e800e){if(_0x4d2ffb[_0xa8a9('0x55')]===null||_0x4d2ffb[_0xa8a9('0x55')]===0x1)_0x580aa3(null);return db[_0xa8a9('0x56')][_0xa8a9('0x40')]({'where':{'sectionId':_0x4d2ffb['id']},'raw':!![]})[_0xa8a9('0x26')](function(_0x358585){var _0x37c53f=_[_0xa8a9('0x2f')](_0x358585,function(_0x34acb1){return qs[_0xa8a9('0x4d')](_0x34acb1,['id',_0xa8a9('0x4f'),_0xa8a9('0x50'),_0xa8a9('0x57')]);});_0x580aa3(_0x37c53f);})[_0xa8a9('0x42')](function(_0x2294c9){_0x2e800e(_0x2294c9);});})[_0xa8a9('0x26')](function(_0x6376c){var _0x4827d0=qs[_0xa8a9('0x4d')](_0x4d2ffb,['id',_0xa8a9('0x4f'),'updatedAt']);_0x4827d0[_0xa8a9('0x58')]=_0x9c2873['id'];if(_0x6376c)_0x4827d0['Resources']=_0x6376c;return _0x4827d0;})[_0xa8a9('0x26')](function(_0x254134){return db[_0xa8a9('0x53')][_0xa8a9('0x47')](_0x254134,{'include':[{'model':db[_0xa8a9('0x56')],'as':_0xa8a9('0x59')}],'raw':!![],'transaction':_0x29a729});});})[_0xa8a9('0x26')](function(){return _0x9c2873;});}});});});}})[_0xa8a9('0x26')](respondWithResult(_0x4b8792,0xc9))[_0xa8a9('0x42')](handleError(_0x4b8792,null));};exports['update']=function(_0x2ab7e3,_0x577ccf){if(_0x2ab7e3[_0xa8a9('0x48')]['id']){delete _0x2ab7e3['body']['id'];}return db[_0xa8a9('0x2b')][_0xa8a9('0x4b')]({'where':{'id':_0x2ab7e3[_0xa8a9('0x44')]['id']}})[_0xa8a9('0x26')](handleEntityNotFound(_0x577ccf,null))['then'](saveUpdates(_0x2ab7e3[_0xa8a9('0x48')],null))['then'](respondWithResult(_0x577ccf,null))[_0xa8a9('0x42')](handleError(_0x577ccf,null));};exports[_0xa8a9('0x27')]=function(_0x1e2d1a,_0x34a659){return db['UserProfile'][_0xa8a9('0x4b')]({'where':{'id':_0x1e2d1a[_0xa8a9('0x44')]['id']}})['then'](handleEntityNotFound(_0x34a659,null))[_0xa8a9('0x26')](removeEntity(_0x34a659,null))['catch'](handleError(_0x34a659,null));};exports[_0xa8a9('0x5a')]=function(_0x21d056,_0x41869d){return db[_0xa8a9('0x2b')]['describe']()[_0xa8a9('0x26')](respondWithResult(_0x41869d,null))[_0xa8a9('0x42')](handleError(_0x41869d,null));};exports[_0xa8a9('0x5b')]=function(_0x37384f,_0x37acd4){var _0x3877a2=_0x37384f[_0xa8a9('0x48')];return db[_0xa8a9('0x2b')][_0xa8a9('0x4b')]({'where':{'id':_0x37384f[_0xa8a9('0x44')]['id']}})[_0xa8a9('0x26')](handleEntityNotFound(_0x37acd4,null))[_0xa8a9('0x26')](function(_0x291927){if(_0x291927){return db['sequelize'][_0xa8a9('0x52')](function(_0x232b0d){return db['UserProfileSection'][_0xa8a9('0x27')]({'where':{'userProfileId':_0x37384f[_0xa8a9('0x44')]['id'],'sectionId':_[_0xa8a9('0x2f')](_0x3877a2,function(_0x5eb04e){return _0x5eb04e['sectionId'];})},'transaction':_0x232b0d})['then'](function(){var _0x1c4ee1=_['map'](_0x3877a2,function(_0x2b25e7){_0x2b25e7[_0xa8a9('0x58')]=_0x37384f[_0xa8a9('0x44')]['id'];return _0x2b25e7;});var _0x2b9dd0=[];return BPromise['each'](_0x1c4ee1,function(_0x1ac9e7){return db[_0xa8a9('0x53')][_0xa8a9('0x47')](_0x1ac9e7,{'include':[{'model':db['UserProfileResource'],'as':_0xa8a9('0x59')}],'raw':!![],'transaction':_0x232b0d})[_0xa8a9('0x26')](function(_0x16b7a9){_0x2b9dd0[_0xa8a9('0x5c')](_0x16b7a9[_0xa8a9('0x4c')]({'plain':!![]}));});})[_0xa8a9('0x26')](function(){return _0x2b9dd0;});});});}})[_0xa8a9('0x26')](function(_0x117c72){return _0x117c72;})['then'](respondWithResult(_0x37acd4,null))[_0xa8a9('0x42')](handleError(_0x37acd4,null));};exports[_0xa8a9('0x5d')]=function(_0x3e129d,_0x154724){var _0x836e83;return db[_0xa8a9('0x2b')][_0xa8a9('0x4b')]({'where':{'id':_0x3e129d[_0xa8a9('0x44')]['id']},'attributes':['id',_0xa8a9('0x29')]})[_0xa8a9('0x26')](handleEntityNotFound(_0x154724,null))['then'](function(_0x234c1e){if(_0x234c1e){_0x836e83=_0x234c1e;return db[_0xa8a9('0x53')][_0xa8a9('0x27')]({'where':{'userProfileId':_0x3e129d[_0xa8a9('0x44')]['id'],'sectionId':_0x3e129d[_0xa8a9('0x31')][_0xa8a9('0x5e')]}});}})[_0xa8a9('0x26')](function(){return _0x836e83;})[_0xa8a9('0x26')](respondWithStatusCode(_0x154724,null))[_0xa8a9('0x42')](handleError(_0x154724,null));};exports[_0xa8a9('0x5f')]=function(_0x5a593,_0x1b5925){var _0x105bbf=[];var _0x45836e=[];return db[_0xa8a9('0x53')][_0xa8a9('0x40')]({'where':{'userProfileId':_0x5a593[_0xa8a9('0x44')]['id']},'raw':!![]})['then'](function(_0x4db23e){_0x105bbf=_['filter'](_0x4db23e,function(_0x2e05ae){return _0x2e05ae[_0xa8a9('0x60')]===0x1||_[_0xa8a9('0x61')]([0x3eb,0x709],_0x2e05ae['sectionId']);});if(!_['isEmpty'](_0x105bbf)){return _['map'](_0x105bbf,function(_0xc6542e){return _0xc6542e[_0xa8a9('0x57')];});}else{return;}})['then'](function(_0x595636){if(_0x595636)_0x45836e=_0x595636;if(_[_0xa8a9('0x61')](_0x45836e,0x64)){var _0x1a718f=_[_0xa8a9('0x4b')](_0x105bbf,{'sectionId':0x64});return hasDefaultDashboard(_0x1a718f)[_0xa8a9('0x26')](function(_0x418107){return _[_0xa8a9('0x2f')](_0x105bbf,function(_0x537c4a){if(_0x537c4a[_0xa8a9('0x57')]===0x64){_0x537c4a['subsections']=_0x418107;}return _0x537c4a;});});}else{return;}})['then'](function(_0x5dc5e4){if(_0x5dc5e4)_0x105bbf=_0x5dc5e4;if(_[_0xa8a9('0x61')](_0x45836e,0x3eb)){var _0x46938b=_[_0xa8a9('0x4b')](_0x105bbf,{'sectionId':0x3eb});return getCustomDashboards(_0x46938b)[_0xa8a9('0x26')](function(_0x2b0b15){return _[_0xa8a9('0x2f')](_0x105bbf,function(_0x4796ab){if(_0x46938b[_0xa8a9('0x60')]){if(_0x4796ab['sectionId']===0x3eb){_0x4796ab[_0xa8a9('0x62')]=_0x2b0b15;}}else{if(_0x4796ab[_0xa8a9('0x57')]===0x64){_0x4796ab[_0xa8a9('0x62')]=_0x2b0b15;}}return _0x4796ab;});});}else{return;}})['then'](function(_0x4cec72){if(_0x4cec72)_0x105bbf=_0x4cec72;if(_['includes'](_0x45836e,0x709)){var _0xcc9c62=_[_0xa8a9('0x4b')](_0x105bbf,{'sectionId':0x709});return getPlugins(_0xcc9c62)[_0xa8a9('0x26')](function(_0x2e12c6){if(_0xcc9c62['enabled']){return _[_0xa8a9('0x2f')](_0x105bbf,function(_0x57ca67){if(_0x57ca67['sectionId']===0x709){_0x57ca67['subsections']=_0x2e12c6;}return _0x57ca67;});}else{var _0x5b41b5={'sectionId':0x76c,'enabled':0x1,'subsections':_0x2e12c6};var _0x313f6e=_[_0xa8a9('0x2f')](_0x105bbf);_0x313f6e[_0xa8a9('0x5c')](_0x5b41b5);return _0x313f6e;}});}else{return;}})[_0xa8a9('0x26')](function(_0x341e64){if(_0x341e64)_0x105bbf=_0x341e64;return _['filter'](_0x105bbf,[_0xa8a9('0x60'),0x1]);})[_0xa8a9('0x26')](respondWithResult(_0x1b5925,null))['catch'](handleError(_0x1b5925,null));};function hasDefaultDashboard(_0x57aa43){var _0x165a1c=[0x65];return new BPromise(function(_0x69452,_0x5f9c83){try{if(_0x57aa43[_0xa8a9('0x55')]){_0x69452(_0x165a1c);}else{return db[_0xa8a9('0x56')][_0xa8a9('0x63')]({'where':{'sectionId':_0x57aa43['id']},'raw':!![]})[_0xa8a9('0x26')](function(_0x48712d){_0x48712d?_0x69452(_0x165a1c):_0x69452();});}}catch(_0x13739b){_0x5f9c83(_0x13739b);}});}function getCustomDashboards(_0x3930a0){var _0x476716=[];return new BPromise(function(_0x258735,_0x2ff2a2){try{if(_0x3930a0[_0xa8a9('0x55')]){return db[_0xa8a9('0x64')][_0xa8a9('0x40')]({'raw':!![]})[_0xa8a9('0x26')](function(_0x412c68){_0x412c68[_0xa8a9('0x65')](function(_0x3a9e9f){_0x476716['push'](_0x3a9e9f['id']+0x1869f);});_0x258735(_0x476716);});}else{return db[_0xa8a9('0x56')][_0xa8a9('0x40')]({'where':{'sectionId':_0x3930a0['id']},'raw':!![]})[_0xa8a9('0x26')](function(_0x2ee59c){_0x2ee59c[_0xa8a9('0x65')](function(_0x55549){_0x476716[_0xa8a9('0x5c')](_0x55549[_0xa8a9('0x66')]+0x1869f);});_0x258735(_0x476716);});}}catch(_0x13d629){_0x2ff2a2(_0x13d629);}});}function getPlugins(_0x4fbdcb){var _0x47d134=[];return new BPromise(function(_0x349057,_0x3a6cac){try{if(_0x4fbdcb[_0xa8a9('0x55')]){return db[_0xa8a9('0x67')]['findAll']({'raw':!![]})[_0xa8a9('0x26')](function(_0x42618a){_0x42618a['forEach'](function(_0x3e7ca8){_0x47d134[_0xa8a9('0x5c')](_0x3e7ca8['id']+0x15b38);});_0x349057(_0x47d134);});}else{return db[_0xa8a9('0x56')]['findAll']({'where':{'sectionId':_0x4fbdcb['id']},'raw':!![]})['then'](function(_0x138043){_0x138043[_0xa8a9('0x65')](function(_0x2a0ff1){_0x47d134[_0xa8a9('0x5c')](_0x2a0ff1['resourceId']+0x15b38);});_0x349057(_0x47d134);});}}catch(_0x4e63db){_0x3a6cac(_0x4e63db);}});}exports[_0xa8a9('0x68')]=function(_0x5ca60c,_0x5dcc1d){return db[_0xa8a9('0x2b')]['find']({'where':{'id':_0x5ca60c[_0xa8a9('0x44')]['id']}})[_0xa8a9('0x26')](handleEntityNotFound(_0x5dcc1d,null))[_0xa8a9('0x26')](function(_0x163437){if(_0x163437){return db[_0xa8a9('0x51')][_0xa8a9('0x52')](function(_0x15c6c7){return db[_0xa8a9('0x53')][_0xa8a9('0x40')]({'where':{'userProfileId':_0x5ca60c[_0xa8a9('0x44')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x18785d){if(_0x18785d){return db[_0xa8a9('0x53')][_0xa8a9('0x27')]({'where':{'userProfileId':_0x5ca60c[_0xa8a9('0x44')]['id'],'id':_[_0xa8a9('0x2f')](_0x18785d,function(_0x34efd5){return _0x34efd5['id'];})},'transaction':_0x15c6c7});}})[_0xa8a9('0x26')](function(_0x172774){var _0x17fa46=_[_0xa8a9('0x2f')](_0x5ca60c[_0xa8a9('0x48')],function(_0x2e1384){_0x2e1384[_0xa8a9('0x58')]=_0x5ca60c[_0xa8a9('0x44')]['id'];return _0x2e1384;});return db[_0xa8a9('0x53')]['bulkCreate'](_0x17fa46,{'raw':!![],'transaction':_0x15c6c7});})[_0xa8a9('0x26')](function(_0x12e58c){var _0x2a821d=_['filter'](_[_0xa8a9('0x2f')](_0x12e58c,function(_0x5ad422){return _0x5ad422[_0xa8a9('0x4c')]({'plain':!![]});}),{'includeAll':![]});if(_0x2a821d){return db[_0xa8a9('0x53')][_0xa8a9('0x40')]({'where':{'userProfileId':_0x5ca60c[_0xa8a9('0x44')]['id'],'sectionId':_[_0xa8a9('0x2f')](_0x2a821d,function(_0x431197){return _0x431197[_0xa8a9('0x57')];})},'attributes':['id',_0xa8a9('0x57')],'raw':!![]})[_0xa8a9('0x26')](function(_0x32efa5){var _0x5b4568=_[_0xa8a9('0x2f')](_0x5ca60c[_0xa8a9('0x48')],function(_0x4e45df){_0x4e45df[_0xa8a9('0x58')]=_0x5ca60c[_0xa8a9('0x44')]['id'];return _0x4e45df;});return db[_0xa8a9('0x56')]['bulkCreate'](_0x5b4568,{'raw':!![],'transaction':_0x15c6c7});});}})['catch'](handleError(_0x5dcc1d,null));});}})[_0xa8a9('0x26')](function(_0x5c8146){var _0x414fe0=_['map'](_0x5c8146,function(_0x5bc38a){return _0x5bc38a[_0xa8a9('0x4c')]({'plain':!![]});});})[_0xa8a9('0x26')](respondWithResult(_0x5dcc1d,null))[_0xa8a9('0x42')](handleError(_0x5dcc1d,null));};exports['removeResources']=function(_0x3b3d82,_0x296d33,_0x9b64d3){return db['UserProfile'][_0xa8a9('0x4b')]({'where':{'id':_0x3b3d82[_0xa8a9('0x44')]['id']}})[_0xa8a9('0x26')](handleEntityNotFound(_0x296d33,null))[_0xa8a9('0x26')](function(_0x3244e7){if(_0x3244e7){return _0x3244e7[_0xa8a9('0x69')](_0x3b3d82[_0xa8a9('0x31')]['ids']);}})[_0xa8a9('0x26')](respondWithStatusCode(_0x296d33,null))[_0xa8a9('0x42')](handleError(_0x296d33,null));};exports['getResources']=function(_0x3ba241,_0x2f7ba6){var _0x5e098d={};if(!_0x3ba241['query'][_0xa8a9('0x6a')])throw new Error(_0xa8a9('0x6b'));if(!_0x3ba241['query'][_0xa8a9('0x36')]('nolimit')){_0x5e098d['limit']=qs[_0xa8a9('0x21')](_0x3ba241[_0xa8a9('0x31')]['limit']);_0x5e098d[_0xa8a9('0x23')]=qs[_0xa8a9('0x23')](_0x3ba241['query'][_0xa8a9('0x23')]);}return db[_0xa8a9('0x2b')][_0xa8a9('0x4b')]({'where':{'id':_0x3ba241['params']['id']}})[_0xa8a9('0x26')](function(_0x241585){if(!_0x241585)throw new Error(_0xa8a9('0x6c')+_0x3ba241[_0xa8a9('0x44')]['id']);return db[_0xa8a9('0x2b')][_0xa8a9('0x6d')](_0x3ba241);})[_0xa8a9('0x26')](respondWithFilteredResult(_0x2f7ba6,_0x5e098d))[_0xa8a9('0x42')](handleError(_0x2f7ba6,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 32b1476..eed031f 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 _0x3e0c=['exports','events','../../mysqldb','UserProfile','save','update','remove'];(function(_0x3e5b6a,_0x1a63ae){var _0x33e82e=function(_0x44062d){while(--_0x44062d){_0x3e5b6a['push'](_0x3e5b6a['shift']());}};_0x33e82e(++_0x1a63ae);}(_0x3e0c,0x16d));var _0xc3e0=function(_0x2c9d30,_0xb7653e){_0x2c9d30=_0x2c9d30-0x0;var _0x2ca878=_0x3e0c[_0x2c9d30];return _0x2ca878;};'use strict';var EventEmitter=require(_0xc3e0('0x0'));var UserProfile=require(_0xc3e0('0x1'))['db'][_0xc3e0('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc3e0('0x3'),'afterUpdate':_0xc3e0('0x4'),'afterDestroy':_0xc3e0('0x5')};function emitEvent(_0x2ba135){return function(_0xba1d4c,_0x49e5b7,_0x88cddb){UserProfileEvents['emit'](_0x2ba135+':'+_0xba1d4c['id'],_0xba1d4c);UserProfileEvents['emit'](_0x2ba135,_0xba1d4c);_0x88cddb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0xc3e0('0x6')]=UserProfileEvents; \ No newline at end of file +var _0xdeb3=['remove','emit','hook','../../mysqldb','UserProfile','setMaxListeners'];(function(_0x329fb5,_0x28ade7){var _0x51f575=function(_0xb55309){while(--_0xb55309){_0x329fb5['push'](_0x329fb5['shift']());}};_0x51f575(++_0x28ade7);}(_0xdeb3,0xb7));var _0x3deb=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xdeb3[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0x3deb('0x0'))['db'][_0x3deb('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x3deb('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x3deb('0x3')};function emitEvent(_0x2e9b78){return function(_0x365134,_0x3114e7,_0x23bc12){UserProfileEvents['emit'](_0x2e9b78+':'+_0x365134['id'],_0x365134);UserProfileEvents[_0x3deb('0x4')](_0x2e9b78,_0x365134);_0x23bc12(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0x3deb('0x5')](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index b466d43..5591b35 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 _0x0424=['squareprojects','childModel','SquareProject','SquareOdbc','squarerecordings','SquareRecording','projectName','projects','JscriptyProject','contacts','CmContact','parentSections','ListId','lists','CmCompany','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','User','role','agent','Telephones','telephone','VoiceQueues','queue','VoiceQueue','type','inbound','QueueCampaigns','outbound','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelAccount','smsaccounts','SmsAccount','WhatsappQueue','WhatsappAccount','teams','Team','agents','Users','admin','user','zendeskaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','dispositions','customdashboards','Interval','pauses','Pause','scheduler','Schedule','sounds','Sound','tags','Template','triggers','Trigger','variables','Variable','plugins','Plugin','extractedreports','AnalyticExtractedReport','Reports','reportId','metrics','AnalyticMetric','charAt','slice','Sequelize','QueryTypes','SELECT','select','InteractionId','from','user_has_','_interactions','where','sequelize','OpenTabs','UserProfile','user_profiles','query','Invalid\x20section\x20\x27','isEmpty','length','push','params','all','ignore','find','autoAssociation','keys','filters','intersection','attributes','fields','nolimit','limit','offset','order','sort','pick','merge','key','VIRTUAL','foreignKey','forEach','includeAll','include','custom','CustomReports','count','Tag','Tags','tag','ThroughTags','color','rows','true','chat','dataValues','sms','fax','mail','openchannel','../../components/parsers/qs','squel','exports','models','filter','field','findAll','then','map','catch','value','model','associatedResources','name','resolve','UserProfileResource','resourceId'];(function(_0x43f651,_0x1e0cab){var _0x19a8d9=function(_0x4245d2){while(--_0x4245d2){_0x43f651['push'](_0x43f651['shift']());}};_0x19a8d9(++_0x1e0cab);}(_0x0424,0x159));var _0x4042=function(_0x2a7812,_0x1ce83a){_0x2a7812=_0x2a7812-0x0;var _0x3e1342=_0x0424[_0x2a7812];return _0x3e1342;};'use strict';var _=require('lodash');var attributes=require('./userProfile.attributes');var qs=require(_0x4042('0x0'));var squel=require(_0x4042('0x1'));module[_0x4042('0x2')]=function(_0x292a62){var _0x53f080=_0x292a62[_0x4042('0x3')];function _0x519987(_0x491eae,_0x20d8df){return new Promise(function(_0x24fdfd,_0x472795){if(!_0x20d8df)return _0x24fdfd(null);var _0xc0fba0=_0x20d8df[_0x4042('0x4')]?{[_0x20d8df[_0x4042('0x4')][_0x4042('0x5')]]:_0x20d8df['filter']['value']}:undefined;return _0x53f080[_0x491eae][_0x4042('0x6')]({'where':_0xc0fba0,'raw':!![]})[_0x4042('0x7')](function(_0x103e4a){_0x20d8df['associatedResources']=_[_0x4042('0x8')](_0x103e4a,'id');_0x24fdfd(_0x20d8df);})[_0x4042('0x9')](function(_0x2376a4){_0x472795(_0x2376a4);});});}function _0x2cbc75(_0x1c2984,_0x424961){return new Promise(function(_0x380aa0,_0x3b5a73){var _0x4af3ba=_0x1c2984[_0x4042('0x4')]?{[_0x1c2984[_0x4042('0x4')]['field']]:_0x1c2984[_0x4042('0x4')][_0x4042('0xa')]}:undefined;return _0x53f080[_0x1c2984[_0x4042('0xb')]][_0x4042('0x6')]({'where':_0x4af3ba,'raw':!![]})[_0x4042('0x7')](function(_0x1ff3ca){_0x424961[_0x4042('0xc')]=_['map'](_0x1ff3ca,function(_0x1029cf){return _0x1029cf[_0x4042('0xd')];});_0x380aa0(_0x424961);})['catch'](function(_0x28087d){_0x3b5a73(_0x28087d);});});}function _0x3f99f8(_0x43dcb5,_0x1c3328,_0x31e765){if(!_0x1c3328)return Promise[_0x4042('0xe')](null);return new Promise(function(_0x62cb76,_0x10cb93){return _0x53f080[_0x4042('0xf')]['findAll']({'where':{'sectionId':_0x1c3328['id']},'raw':!![]})[_0x4042('0x7')](function(_0x4fe024){if(_0x43dcb5[_0x4042('0x5')]&&_0x43dcb5['field']!=='id'){_0x1c3328[_0x4042('0xc')]=_[_0x4042('0x8')](_0x4fe024,function(_0x212520){return _0x212520[_0x43dcb5[_0x4042('0x5')]];});}else{if(_0x31e765==='AnalyticExtractedReport'){_0x1c3328[_0x4042('0xc')]=_[_0x4042('0x8')](_0x4fe024,function(_0x14d36c){return{'id':_0x14d36c[_0x4042('0x10')],'type':_0x14d36c['type']};});}else{_0x1c3328[_0x4042('0xc')]=_[_0x4042('0x8')](_0x4fe024,function(_0xd6fe6c){return _0xd6fe6c[_0x4042('0x10')];});}}_0x62cb76(_0x1c3328);})[_0x4042('0x9')](function(_0x548093){_0x10cb93(_0x548093);});});}function _0x1f9d4a(_0x6d12a5,_0x519f2c){var _0x1daee8={'parentSections':[]};switch(_0x6d12a5['toLowerCase']()){case _0x4042('0x11'):_0x1daee8[_0x4042('0x12')]=_0x4042('0x13');break;case'odbc':_0x1daee8[_0x4042('0x12')]=_0x4042('0x14');break;case _0x4042('0x15'):_0x1daee8[_0x4042('0x12')]=_0x4042('0x16');_0x1daee8['parentSections']=[{'name':'SquareProjects','field':_0x4042('0xd'),'foreignKey':_0x4042('0x17')}];break;case _0x4042('0x18'):_0x1daee8[_0x4042('0x12')]=_0x4042('0x19');break;case _0x4042('0x1a'):_0x1daee8['childModel']=_0x4042('0x1b');_0x1daee8[_0x4042('0x1c')]=[{'name':'Lists','field':'id','foreignKey':_0x4042('0x1d')}];break;case _0x4042('0x1e'):_0x1daee8[_0x4042('0x12')]='CmList';break;case'companies':_0x1daee8[_0x4042('0x12')]=_0x4042('0x1f');break;case'globalcustomfields':_0x1daee8[_0x4042('0x12')]=_0x4042('0x20');break;case _0x4042('0x21'):_0x1daee8[_0x4042('0x12')]=_0x4042('0x22');break;case _0x4042('0x23'):_0x1daee8[_0x4042('0x12')]=_0x4042('0x24');break;case _0x4042('0x25'):_0x1daee8['childModel']=_0x4042('0x26');break;case _0x4042('0x27'):_0x1daee8['childModel']=_0x4042('0x28');break;case _0x4042('0x29'):case'internalroutes':case _0x4042('0x2a'):_0x1daee8[_0x4042('0x12')]=_0x4042('0x2b');break;case _0x4042('0x2c'):_0x1daee8[_0x4042('0x12')]=_0x4042('0x2d');break;case _0x4042('0x2e'):_0x1daee8[_0x4042('0x12')]=_0x4042('0x2f');break;case _0x4042('0x30'):_0x1daee8[_0x4042('0x12')]=_0x4042('0x31');_0x1daee8[_0x4042('0x1c')]=[{'name':_0x4042('0x32'),'field':_0x4042('0xd'),'foreignKey':_0x4042('0x33'),'model':_0x4042('0x34'),'filter':{'field':_0x4042('0x35'),'value':[_0x4042('0x36')]}},{'name':_0x4042('0x37'),'field':_0x4042('0xd'),'foreignKey':'membername','model':_0x4042('0x34'),'filter':{'field':_0x4042('0x35'),'value':[_0x4042('0x38')]}},{'name':_0x4042('0x39'),'field':'name','foreignKey':_0x4042('0x3a'),'model':_0x4042('0x3b'),'filter':{'field':_0x4042('0x3c'),'value':[_0x4042('0x3d')]}},{'name':_0x4042('0x3e'),'field':_0x4042('0xd'),'foreignKey':_0x4042('0x3a'),'model':_0x4042('0x3b'),'filter':{'field':_0x4042('0x3c'),'value':[_0x4042('0x3f')]}}];break;case'musiconholds':_0x1daee8[_0x4042('0x12')]=_0x4042('0x40');break;case _0x4042('0x41'):_0x1daee8[_0x4042('0x12')]=_0x4042('0x42');break;case _0x4042('0x43'):_0x1daee8[_0x4042('0x12')]=_0x4042('0x44');break;case'ivrcampaigns':_0x1daee8['childModel']=_0x4042('0x45');break;case _0x4042('0x46'):_0x1daee8[_0x4042('0x12')]=_0x4042('0x47');break;case _0x4042('0x48'):_0x1daee8[_0x4042('0x12')]=_0x4042('0x49');break;case _0x4042('0x4a'):_0x1daee8[_0x4042('0x12')]=_0x4042('0x4b');break;case _0x4042('0x4c'):_0x1daee8[_0x4042('0x12')]='OpenchannelQueue';break;case'openchannelaccounts':_0x1daee8[_0x4042('0x12')]=_0x4042('0x4d');break;case'smsqueues':_0x1daee8[_0x4042('0x12')]='SmsQueue';break;case _0x4042('0x4e'):_0x1daee8[_0x4042('0x12')]=_0x4042('0x4f');break;case'whatsappqueues':_0x1daee8[_0x4042('0x12')]=_0x4042('0x50');break;case'whatsappaccounts':_0x1daee8[_0x4042('0x12')]=_0x4042('0x51');break;case _0x4042('0x52'):_0x1daee8[_0x4042('0x12')]=_0x4042('0x53');break;case'voicequeues':case'queuecampaigns':_0x1daee8['childModel']=_0x4042('0x3b');if(_0x519f2c){_0x1daee8[_0x4042('0x1c')]=[{'name':'VoiceQueues'},{'name':'QueueCampaigns'}];}break;case'users':case _0x4042('0x54'):case'telephones':_0x1daee8['childModel']=_0x4042('0x34');if(_0x519f2c){_0x1daee8[_0x4042('0x1c')]=[{'name':_0x4042('0x55'),'filter':{'field':_0x4042('0x35'),'value':[_0x4042('0x56'),_0x4042('0x57')]},'ignore':!![]},{'name':_0x4042('0x32')},{'name':_0x4042('0x37')}];}break;case _0x4042('0x58'):_0x1daee8['childModel']='ZendeskAccount';break;case'salesforceaccounts':_0x1daee8['childModel']=_0x4042('0x59');break;case _0x4042('0x5a'):_0x1daee8[_0x4042('0x12')]=_0x4042('0x5b');break;case _0x4042('0x5c'):_0x1daee8[_0x4042('0x12')]=_0x4042('0x5d');break;case _0x4042('0x5e'):_0x1daee8['childModel']=_0x4042('0x5f');break;case _0x4042('0x60'):_0x1daee8[_0x4042('0x12')]=_0x4042('0x61');break;case _0x4042('0x62'):_0x1daee8[_0x4042('0x12')]=_0x4042('0x34');break;case'cannedanswers':_0x1daee8['childModel']='CannedAnswer';break;case _0x4042('0x63'):_0x1daee8[_0x4042('0x12')]='Disposition';break;case _0x4042('0x64'):_0x1daee8[_0x4042('0x12')]='Dashboard';break;case'intervals':_0x1daee8[_0x4042('0x12')]=_0x4042('0x65');break;case _0x4042('0x66'):_0x1daee8[_0x4042('0x12')]=_0x4042('0x67');break;case _0x4042('0x68'):_0x1daee8[_0x4042('0x12')]=_0x4042('0x69');break;case _0x4042('0x6a'):_0x1daee8[_0x4042('0x12')]=_0x4042('0x6b');break;case _0x4042('0x6c'):_0x1daee8[_0x4042('0x12')]='Tag';break;case'templates':_0x1daee8[_0x4042('0x12')]=_0x4042('0x6d');break;case _0x4042('0x6e'):_0x1daee8['childModel']=_0x4042('0x6f');break;case'trunks':_0x1daee8[_0x4042('0x12')]='Trunk';break;case _0x4042('0x70'):_0x1daee8[_0x4042('0x12')]=_0x4042('0x71');break;case _0x4042('0x72'):_0x1daee8[_0x4042('0x12')]=_0x4042('0x73');break;case _0x4042('0x74'):_0x1daee8[_0x4042('0x12')]=_0x4042('0x75');_0x1daee8['parentSections']=[{'name':_0x4042('0x76'),'field':'id','foreignKey':_0x4042('0x77')}];break;case _0x4042('0x78'):_0x1daee8[_0x4042('0x12')]=_0x4042('0x79');break;}return _0x1daee8;}function _0x211d7e(_0x4b4617,_0x143985){var _0x263b54=_0x4b4617[_0x4042('0x7a')](0x0)['toUpperCase']()+_0x4b4617[_0x4042('0x7b')](0x1);var _0x3703f6={'type':_0x53f080[_0x4042('0x7c')][_0x4042('0x7d')][_0x4042('0x7e')],'raw':!![]};return new Promise(function(_0x3959eb,_0x3c6185){var _0xf7b32b=squel[_0x4042('0x7f')]()[_0x4042('0x5')]('ui.'+_0x263b54+_0x4042('0x80'),'id')['field']('ui.createdAt')[_0x4042('0x81')](_0x4042('0x82')+_0x4b4617+_0x4042('0x83'),'ui')[_0x4042('0x84')]('ui.UserId\x20=\x20?',_0x143985['id']);return _0x53f080[_0x4042('0x85')]['query'](_0xf7b32b['toString'](),_0x3703f6)[_0x4042('0x7')](function(_0x4c0381){_0x143985[_0x263b54+_0x4042('0x86')]=_0x4c0381;_0x3959eb(_0x4c0381);})[_0x4042('0x9')](function(_0xced3c2){_0x3c6185(_0xced3c2);});});}return _0x292a62['define'](_0x4042('0x87'),attributes,{'tableName':_0x4042('0x88'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x52461a){var _0x38d226={'raw':![],'where':{}};var _0x28c9b0={};var _0x52def0={'count':0x0,'rows':[]};var _0x48d0a8=_0x52461a['query']['section'];var _0xe750c1=_0x52461a[_0x4042('0x89')]['mergeResources']||![];var _0x403ffa=_0x1f9d4a(_0x48d0a8,_0xe750c1);if(!_0x403ffa[_0x4042('0x12')])throw new Error(_0x4042('0x8a')+_0x48d0a8+'\x27');var _0x1bd48e=[{'name':_0x48d0a8}];if(!_[_0x4042('0x8b')](_0x403ffa[_0x4042('0x1c')]))_0x1bd48e=_0x403ffa[_0x4042('0x1c')];var _0x47d50c=[];for(var _0x882a1b=0x0;_0x882a1b<_0x1bd48e[_0x4042('0x8c')];_0x882a1b++){_0x47d50c[_0x4042('0x8d')](_0x53f080['UserProfileSection']['find']({'where':{'userProfileId':_0x52461a[_0x4042('0x8e')]['id'],'name':_0x1bd48e[_0x882a1b]['name']},'raw':!![]}));}return Promise[_0x4042('0x8f')](_0x47d50c)[_0x4042('0x7')](function(_0x196dee){var _0xd4abae=_[_0x4042('0x4')](_0x196dee,function(_0x4b4994){return _0x4b4994?_0x4b4994:undefined;});var _0x5b728b=_[_0x4042('0x4')](_0x1bd48e,[_0x4042('0x90'),!![]]);var _0x3bb5dd=_['isEmpty'](_0xd4abae)&&_[_0x4042('0x8b')](_0x5b728b)?null:_['union'](_0x5b728b,_0xd4abae);if(!_0x3bb5dd)return null;var _0x2a75c8=[];for(var _0x51a453=0x0;_0x51a453<_0x3bb5dd[_0x4042('0x8c')];_0x51a453++){var _0x5bda8f=_[_0x4042('0x91')](_0x1bd48e,function(_0x3e27f7){return _0x3bb5dd[_0x51a453]?_0x3e27f7[_0x4042('0xd')]===_0x3bb5dd[_0x51a453][_0x4042('0xd')]:null;});if(_0x5bda8f){if(_0x3bb5dd[_0x51a453][_0x4042('0x90')]){_0x2a75c8['push'](_0x519987(_0x403ffa[_0x4042('0x12')],_0x3bb5dd[_0x51a453]));}else{if(!_0x3bb5dd[_0x51a453][_0x4042('0x92')]){_0x2a75c8[_0x4042('0x8d')](_0x3f99f8(_0x5bda8f,_0x3bb5dd[_0x51a453],_0x403ffa[_0x4042('0x12')]));}else{if(_0x5bda8f[_0x4042('0xb')]){_0x2a75c8[_0x4042('0x8d')](_0x2cbc75(_0x5bda8f,_0x3bb5dd[_0x51a453]));}}}}}return Promise[_0x4042('0x8f')](_0x2a75c8);})[_0x4042('0x7')](function(_0x6a11bd){var _0x191469=_0x6a11bd;var _0x4e7042=null;if(_0x191469){_0x4e7042=_0x191469[_0x4042('0x8c')]===0x1?_0x191469[0x0]:null;}if(!_0x4e7042&&!_0x191469)return _0x52def0;var _0x2a7d79=_0x53f080[_0x403ffa[_0x4042('0x12')]]['rawAttributes'];_0x28c9b0[_0x4042('0xb')]=_[_0x4042('0x93')](_0x2a7d79);_0x28c9b0[_0x4042('0x89')]=_[_0x4042('0x93')](_0x52461a['query']);_0x28c9b0[_0x4042('0x94')]=_[_0x4042('0x95')](_0x28c9b0[_0x4042('0xb')],_0x28c9b0['query']);_0x38d226[_0x4042('0x96')]=_[_0x4042('0x95')](_0x28c9b0[_0x4042('0xb')],qs[_0x4042('0x97')](_0x52461a[_0x4042('0x89')][_0x4042('0x97')]));_0x38d226[_0x4042('0x96')]=_0x38d226[_0x4042('0x96')][_0x4042('0x8c')]?_0x38d226[_0x4042('0x96')]:_0x28c9b0[_0x4042('0xb')];if(!_0x52461a[_0x4042('0x89')]['hasOwnProperty'](_0x4042('0x98'))){_0x38d226[_0x4042('0x99')]=qs['limit'](_0x52461a['query']['limit']);_0x38d226[_0x4042('0x9a')]=qs[_0x4042('0x9a')](_0x52461a['query'][_0x4042('0x9a')]);}_0x38d226[_0x4042('0x9b')]=qs['sort'](_0x52461a[_0x4042('0x89')][_0x4042('0x9c')]);_0x38d226[_0x4042('0x84')]=qs['filters'](_[_0x4042('0x9d')](_0x52461a[_0x4042('0x89')],_0x28c9b0[_0x4042('0x94')]));if(_0x52461a[_0x4042('0x89')][_0x4042('0x4')]){_0x38d226[_0x4042('0x84')]=_[_0x4042('0x9e')](_0x38d226['where'],{'$or':_[_0x4042('0x8')](_0x2a7d79,function(_0x134099){if(_0x134099[_0x4042('0x3c')][_0x4042('0x9f')]!==_0x4042('0xa0')){var _0x51b7cb={};_0x51b7cb[_0x134099[_0x4042('0x5')]]={'$like':'%'+_0x52461a[_0x4042('0x89')][_0x4042('0x4')]+'%'};return _0x51b7cb;}})});}var _0x3a3e03=[];var _0x5c898c=null;var _0x437f8b={};if(_0x4e7042){_0x5c898c=_[_0x4042('0x91')](_0x1bd48e,[_0x4042('0xd'),_0x4e7042['name']]);if(_0x5c898c[_0x4042('0x5')]){_0x437f8b={};if(_0x403ffa[_0x4042('0x12')]===_0x4042('0x75')){_0x437f8b[_0x5c898c[_0x4042('0xa1')]]=_[_0x4042('0x8')](_0x4e7042[_0x4042('0xc')],'id');}else{_0x437f8b[_0x5c898c[_0x4042('0xa1')]]=_0x4e7042[_0x4042('0xc')];}_0x3a3e03[_0x4042('0x8d')](_0x437f8b);}else{_0x38d226[_0x4042('0x84')]['id']=_0x4e7042[_0x4042('0xc')];}}else{for(var _0x4554ed=0x0;_0x4554ed<_0x191469['length'];_0x4554ed++){_0x5c898c=_[_0x4042('0x91')](_0x1bd48e,[_0x4042('0xd'),_0x191469[_0x4554ed][_0x4042('0xd')]]);if(_0x5c898c[_0x4042('0x5')]){_0x437f8b={};_0x437f8b[_0x5c898c['foreignKey']]=_0x191469[_0x4554ed][_0x4042('0xc')];_0x3a3e03[_0x4042('0x8d')](_0x437f8b);}else{if(!_0x38d226[_0x4042('0x84')]['id'])_0x38d226[_0x4042('0x84')]['id']=[];_0x191469[_0x4554ed][_0x4042('0xc')][_0x4042('0xa2')](function(_0x27fd25){_0x38d226[_0x4042('0x84')]['id']['push'](_0x27fd25);});}}}if(!_['isEmpty'](_0x3a3e03)){_0x38d226[_0x4042('0x84')]=_[_0x4042('0x9e')](_0x38d226[_0x4042('0x84')],{'$and':{'$or':_0x3a3e03}});}_0x38d226=_['merge']({},_0x38d226,_0x52461a['options']);if(_0x4e7042&&!_0x4e7042[_0x4042('0x92')]&&_0x403ffa['childModel']==='AnalyticExtractedReport'){if(_0x52461a[_0x4042('0x89')][_0x4042('0xa3')]){_0x38d226[_0x4042('0xa4')]=[{'all':!![]}];}return _0x53f080[_0x403ffa[_0x4042('0x12')]]['findAll'](_0x38d226)[_0x4042('0x7')](function(_0x4d4f87){var _0x5e2a18=[];_0x4d4f87[_0x4042('0xa2')](function(_0x13db49){var _0x96ec1b;switch(_0x13db49['reportType']){case'default':_0x96ec1b=_['find'](_0x4e7042['associatedResources'],function(_0x4c36d0){return _0x4c36d0['id']===_0x13db49[_0x4042('0x77')]&&_0x4c36d0[_0x4042('0x3c')]==='DefaultReports';});break;case _0x4042('0xa5'):_0x96ec1b=_[_0x4042('0x91')](_0x4e7042['associatedResources'],function(_0x370e87){return _0x370e87['id']===_0x13db49[_0x4042('0x77')]&&_0x370e87[_0x4042('0x3c')]===_0x4042('0xa6');});break;}if(_0x96ec1b)_0x5e2a18[_0x4042('0x8d')](_0x13db49);});_0x52def0[_0x4042('0xa7')]=_0x5e2a18[_0x4042('0x8c')];_0x52def0['rows']=_0x5e2a18;return _0x52def0;});}else{return _0x53f080[_0x403ffa['childModel']][_0x4042('0xa7')]({'where':_0x38d226['where']})[_0x4042('0x7')](function(_0x13b774){_0x52def0[_0x4042('0xa7')]=_0x13b774;if(_0x52461a['query'][_0x4042('0xa3')]){if(_0x403ffa['childModel']==='CmContact'){_0x38d226[_0x4042('0xa4')]=[{'model':_0x53f080[_0x4042('0xa8')],'as':_0x4042('0xa9'),'attributes':['id','name','color'],'required':_0x52461a[_0x4042('0x89')][_0x4042('0xaa')]?!![]:![]},{'model':_0x53f080[_0x4042('0xa8')],'as':_0x4042('0xab'),'attributes':['id',_0x4042('0xd'),_0x4042('0xac')],'through':_0x52461a['query'][_0x4042('0xaa')]?{'attributes':[],'where':{'TagId':_0x52461a[_0x4042('0x89')][_0x4042('0xaa')]||undefined}}:{},'required':_0x52461a['query']['tag']?!![]:![]}];}else{_0x38d226[_0x4042('0xa4')]=[{'all':!![]}];}}return _0x53f080[_0x403ffa['childModel']]['findAll'](_0x38d226);})[_0x4042('0x7')](function(_0x367506){_0x52def0[_0x4042('0xad')]=_0x367506;if(_0x48d0a8===_0x4042('0x32')&&_0x52461a[_0x4042('0x89')]['openTabs']===_0x4042('0xae')){var _0x48e256=[];for(var _0x5bf95b=0x0;_0x5bf95b<_0x52def0[_0x4042('0xad')][_0x4042('0x8c')];_0x5bf95b++){_0x48e256[_0x4042('0x8d')](_0x211d7e(_0x4042('0xaf'),_0x52def0[_0x4042('0xad')][_0x5bf95b][_0x4042('0xb0')]));_0x48e256[_0x4042('0x8d')](_0x211d7e(_0x4042('0xb1'),_0x52def0['rows'][_0x5bf95b][_0x4042('0xb0')]));_0x48e256[_0x4042('0x8d')](_0x211d7e(_0x4042('0xb2'),_0x52def0[_0x4042('0xad')][_0x5bf95b]['dataValues']));_0x48e256[_0x4042('0x8d')](_0x211d7e(_0x4042('0xb3'),_0x52def0[_0x4042('0xad')][_0x5bf95b][_0x4042('0xb0')]));_0x48e256[_0x4042('0x8d')](_0x211d7e(_0x4042('0xb4'),_0x52def0[_0x4042('0xad')][_0x5bf95b][_0x4042('0xb0')]));_0x48e256[_0x4042('0x8d')](_0x211d7e('whatsapp',_0x52def0[_0x4042('0xad')][_0x5bf95b]['dataValues']));}return Promise[_0x4042('0x8f')](_0x48e256)['then'](function(){return _0x52def0;});}return _0x52def0;});}});}}});}; \ No newline at end of file +var _0xb016=['SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','Lists','ListId','lists','CmList','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','voicemails','VoiceMail','voicerecordings','Agents','name','membername','User','role','agent','Telephones','telephone','VoiceQueues','queue','VoiceQueue','QueueCampaigns','outbound','musiconholds','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','MailSubstatus','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','Team','voicequeues','queuecampaigns','users','agents','telephones','admin','user','zendeskaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','deskaccounts','vtigeraccounts','cannedanswers','dispositions','Disposition','Dashboard','Interval','pauses','Sound','Tag','Template','triggers','Trigger','variables','Variable','Plugin','extractedreports','Reports','reportId','AnalyticMetric','charAt','toUpperCase','Sequelize','QueryTypes','select','ui.','InteractionId','ui.createdAt','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','toString','define','UserProfile','user_profiles','section','Invalid\x20section\x20\x27','isEmpty','push','UserProfileSection','find','all','ignore','union','length','autoAssociation','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','offset','order','sort','key','VIRTUAL','foreignKey','forEach','merge','options','includeAll','include','reportType','default','custom','CustomReports','count','rows','CmContact','Tags','color','tag','ThroughTags','openTabs','true','chat','dataValues','sms','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','exports','models','field','filter','then','associatedResources','map','catch','value','model','resolve','UserProfileResource','findAll','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','SquareProject','odbc'];(function(_0x112c59,_0x2782c9){var _0xc0fb8c=function(_0x52174a){while(--_0x52174a){_0x112c59['push'](_0x112c59['shift']());}};_0xc0fb8c(++_0x2782c9);}(_0xb016,0x159));var _0x6b01=function(_0x26d746,_0x226d1d){_0x26d746=_0x26d746-0x0;var _0x1bcc6a=_0xb016[_0x26d746];return _0x1bcc6a;};'use strict';var _=require(_0x6b01('0x0'));var attributes=require(_0x6b01('0x1'));var qs=require('../../components/parsers/qs');var squel=require('squel');module[_0x6b01('0x2')]=function(_0x531b6a){var _0x160a7d=_0x531b6a[_0x6b01('0x3')];function _0x161b59(_0x3b9de1,_0x5964ca){return new Promise(function(_0x1b7dd6,_0x65407a){if(!_0x5964ca)return _0x1b7dd6(null);var _0x192b2d=_0x5964ca['filter']?{[_0x5964ca['filter'][_0x6b01('0x4')]]:_0x5964ca[_0x6b01('0x5')]['value']}:undefined;return _0x160a7d[_0x3b9de1]['findAll']({'where':_0x192b2d,'raw':!![]})[_0x6b01('0x6')](function(_0x1cb3a6){_0x5964ca[_0x6b01('0x7')]=_[_0x6b01('0x8')](_0x1cb3a6,'id');_0x1b7dd6(_0x5964ca);})[_0x6b01('0x9')](function(_0x5bed15){_0x65407a(_0x5bed15);});});}function _0x4b4a4d(_0x4627ef,_0x24049f){return new Promise(function(_0x2660c7,_0x5a8817){var _0x200614=_0x4627ef['filter']?{[_0x4627ef['filter'][_0x6b01('0x4')]]:_0x4627ef['filter'][_0x6b01('0xa')]}:undefined;return _0x160a7d[_0x4627ef[_0x6b01('0xb')]]['findAll']({'where':_0x200614,'raw':!![]})[_0x6b01('0x6')](function(_0x4ea5fa){_0x24049f['associatedResources']=_['map'](_0x4ea5fa,function(_0x3d4666){return _0x3d4666['name'];});_0x2660c7(_0x24049f);})['catch'](function(_0x3a259f){_0x5a8817(_0x3a259f);});});}function _0x327e86(_0x20dd83,_0x41efa3,_0x3d7045){if(!_0x41efa3)return Promise[_0x6b01('0xc')](null);return new Promise(function(_0x122769,_0x33ffe8){return _0x160a7d[_0x6b01('0xd')][_0x6b01('0xe')]({'where':{'sectionId':_0x41efa3['id']},'raw':!![]})[_0x6b01('0x6')](function(_0x4f2d08){if(_0x20dd83[_0x6b01('0x4')]&&_0x20dd83[_0x6b01('0x4')]!=='id'){_0x41efa3[_0x6b01('0x7')]=_[_0x6b01('0x8')](_0x4f2d08,function(_0x5a7d75){return _0x5a7d75[_0x20dd83[_0x6b01('0x4')]];});}else{if(_0x3d7045===_0x6b01('0xf')){_0x41efa3[_0x6b01('0x7')]=_['map'](_0x4f2d08,function(_0x3029e2){return{'id':_0x3029e2[_0x6b01('0x10')],'type':_0x3029e2[_0x6b01('0x11')]};});}else{_0x41efa3[_0x6b01('0x7')]=_[_0x6b01('0x8')](_0x4f2d08,function(_0x181b09){return _0x181b09[_0x6b01('0x10')];});}}_0x122769(_0x41efa3);})['catch'](function(_0x7caa07){_0x33ffe8(_0x7caa07);});});}function _0xcf9200(_0x42c990,_0x51243c){var _0x399808={'parentSections':[]};switch(_0x42c990[_0x6b01('0x12')]()){case _0x6b01('0x13'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x15');break;case _0x6b01('0x16'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x17');break;case _0x6b01('0x18'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x19');_0x399808[_0x6b01('0x1a')]=[{'name':_0x6b01('0x1b'),'field':'name','foreignKey':_0x6b01('0x1c')}];break;case _0x6b01('0x1d'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x1e');break;case _0x6b01('0x1f'):_0x399808['childModel']='CmContact';_0x399808[_0x6b01('0x1a')]=[{'name':_0x6b01('0x20'),'field':'id','foreignKey':_0x6b01('0x21')}];break;case _0x6b01('0x22'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x23');break;case'companies':_0x399808[_0x6b01('0x14')]='CmCompany';break;case _0x6b01('0x24'):_0x399808['childModel']=_0x6b01('0x25');break;case _0x6b01('0x26'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x27');break;case _0x6b01('0x28'):_0x399808['childModel']=_0x6b01('0x29');break;case _0x6b01('0x2a'):_0x399808[_0x6b01('0x14')]='FaxQueue';break;case'faxaccounts':_0x399808[_0x6b01('0x14')]='FaxAccount';break;case _0x6b01('0x2b'):case _0x6b01('0x2c'):case _0x6b01('0x2d'):_0x399808['childModel']=_0x6b01('0x2e');break;case _0x6b01('0x2f'):_0x399808[_0x6b01('0x14')]='VoiceContext';break;case _0x6b01('0x30'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x31');break;case _0x6b01('0x32'):_0x399808[_0x6b01('0x14')]='VoiceRecording';_0x399808[_0x6b01('0x1a')]=[{'name':_0x6b01('0x33'),'field':_0x6b01('0x34'),'foreignKey':_0x6b01('0x35'),'model':_0x6b01('0x36'),'filter':{'field':_0x6b01('0x37'),'value':[_0x6b01('0x38')]}},{'name':_0x6b01('0x39'),'field':'name','foreignKey':_0x6b01('0x35'),'model':'User','filter':{'field':_0x6b01('0x37'),'value':[_0x6b01('0x3a')]}},{'name':_0x6b01('0x3b'),'field':_0x6b01('0x34'),'foreignKey':_0x6b01('0x3c'),'model':_0x6b01('0x3d'),'filter':{'field':_0x6b01('0x11'),'value':['inbound']}},{'name':_0x6b01('0x3e'),'field':_0x6b01('0x34'),'foreignKey':_0x6b01('0x3c'),'model':_0x6b01('0x3d'),'filter':{'field':_0x6b01('0x11'),'value':[_0x6b01('0x3f')]}}];break;case _0x6b01('0x40'):_0x399808[_0x6b01('0x14')]='VoiceMusicOnHold';break;case _0x6b01('0x41'):_0x399808['childModel']=_0x6b01('0x42');break;case _0x6b01('0x43'):_0x399808['childModel']=_0x6b01('0x44');break;case _0x6b01('0x45'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x46');break;case _0x6b01('0x47'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x48');break;case _0x6b01('0x49'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x4a');break;case'mailsubstatuses':_0x399808[_0x6b01('0x14')]=_0x6b01('0x4b');break;case'openchannelqueues':_0x399808['childModel']=_0x6b01('0x4c');break;case _0x6b01('0x4d'):_0x399808['childModel']=_0x6b01('0x4e');break;case _0x6b01('0x4f'):_0x399808['childModel']=_0x6b01('0x50');break;case'smsaccounts':_0x399808[_0x6b01('0x14')]=_0x6b01('0x51');break;case _0x6b01('0x52'):_0x399808['childModel']=_0x6b01('0x53');break;case _0x6b01('0x54'):_0x399808['childModel']='WhatsappAccount';break;case'teams':_0x399808[_0x6b01('0x14')]=_0x6b01('0x55');break;case _0x6b01('0x56'):case _0x6b01('0x57'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x3d');if(_0x51243c){_0x399808['parentSections']=[{'name':_0x6b01('0x3b')},{'name':_0x6b01('0x3e')}];}break;case _0x6b01('0x58'):case _0x6b01('0x59'):case _0x6b01('0x5a'):_0x399808[_0x6b01('0x14')]='User';if(_0x51243c){_0x399808[_0x6b01('0x1a')]=[{'name':'Users','filter':{'field':'role','value':[_0x6b01('0x5b'),_0x6b01('0x5c')]},'ignore':!![]},{'name':'Agents'},{'name':_0x6b01('0x39')}];}break;case _0x6b01('0x5d'):_0x399808[_0x6b01('0x14')]='ZendeskAccount';break;case'salesforceaccounts':_0x399808['childModel']=_0x6b01('0x5e');break;case _0x6b01('0x5f'):_0x399808['childModel']=_0x6b01('0x60');break;case'sugarcrmaccounts':_0x399808['childModel']='SugarcrmAccount';break;case _0x6b01('0x61'):_0x399808[_0x6b01('0x14')]='DeskAccount';break;case'zohoaccounts':_0x399808[_0x6b01('0x14')]='ZohoAccount';break;case _0x6b01('0x62'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x36');break;case _0x6b01('0x63'):_0x399808[_0x6b01('0x14')]='CannedAnswer';break;case _0x6b01('0x64'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x65');break;case'customdashboards':_0x399808[_0x6b01('0x14')]=_0x6b01('0x66');break;case'intervals':_0x399808[_0x6b01('0x14')]=_0x6b01('0x67');break;case _0x6b01('0x68'):_0x399808[_0x6b01('0x14')]='Pause';break;case'scheduler':_0x399808[_0x6b01('0x14')]='Schedule';break;case'sounds':_0x399808[_0x6b01('0x14')]=_0x6b01('0x69');break;case'tags':_0x399808[_0x6b01('0x14')]=_0x6b01('0x6a');break;case'templates':_0x399808[_0x6b01('0x14')]=_0x6b01('0x6b');break;case _0x6b01('0x6c'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x6d');break;case'trunks':_0x399808[_0x6b01('0x14')]='Trunk';break;case _0x6b01('0x6e'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x6f');break;case'plugins':_0x399808[_0x6b01('0x14')]=_0x6b01('0x70');break;case _0x6b01('0x71'):_0x399808[_0x6b01('0x14')]='AnalyticExtractedReport';_0x399808[_0x6b01('0x1a')]=[{'name':_0x6b01('0x72'),'field':'id','foreignKey':_0x6b01('0x73')}];break;case'metrics':_0x399808['childModel']=_0x6b01('0x74');break;}return _0x399808;}function _0x1aefc2(_0x11cbcc,_0x4e1702){var _0x21b99f=_0x11cbcc[_0x6b01('0x75')](0x0)[_0x6b01('0x76')]()+_0x11cbcc['slice'](0x1);var _0x54b3ae={'type':_0x160a7d[_0x6b01('0x77')][_0x6b01('0x78')]['SELECT'],'raw':!![]};return new Promise(function(_0x3e16e8,_0x3faa54){var _0xe6d027=squel[_0x6b01('0x79')]()[_0x6b01('0x4')](_0x6b01('0x7a')+_0x21b99f+_0x6b01('0x7b'),'id')[_0x6b01('0x4')](_0x6b01('0x7c'))['from'](_0x6b01('0x7d')+_0x11cbcc+_0x6b01('0x7e'),'ui')[_0x6b01('0x7f')](_0x6b01('0x80'),_0x4e1702['id']);return _0x160a7d[_0x6b01('0x81')][_0x6b01('0x82')](_0xe6d027[_0x6b01('0x83')](),_0x54b3ae)[_0x6b01('0x6')](function(_0x281e55){_0x4e1702[_0x21b99f+'OpenTabs']=_0x281e55;_0x3e16e8(_0x281e55);})[_0x6b01('0x9')](function(_0x25b39b){_0x3faa54(_0x25b39b);});});}return _0x531b6a[_0x6b01('0x84')](_0x6b01('0x85'),attributes,{'tableName':_0x6b01('0x86'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x1dda2f){var _0x4c84cc={'raw':![],'where':{}};var _0x523102={};var _0x38ae38={'count':0x0,'rows':[]};var _0x270128=_0x1dda2f[_0x6b01('0x82')][_0x6b01('0x87')];var _0x728ae2=_0x1dda2f[_0x6b01('0x82')]['mergeResources']||![];var _0x2bd87d=_0xcf9200(_0x270128,_0x728ae2);if(!_0x2bd87d[_0x6b01('0x14')])throw new Error(_0x6b01('0x88')+_0x270128+'\x27');var _0x44c3d1=[{'name':_0x270128}];if(!_[_0x6b01('0x89')](_0x2bd87d[_0x6b01('0x1a')]))_0x44c3d1=_0x2bd87d[_0x6b01('0x1a')];var _0x582bff=[];for(var _0x3ea965=0x0;_0x3ea965<_0x44c3d1['length'];_0x3ea965++){_0x582bff[_0x6b01('0x8a')](_0x160a7d[_0x6b01('0x8b')][_0x6b01('0x8c')]({'where':{'userProfileId':_0x1dda2f['params']['id'],'name':_0x44c3d1[_0x3ea965][_0x6b01('0x34')]},'raw':!![]}));}return Promise[_0x6b01('0x8d')](_0x582bff)[_0x6b01('0x6')](function(_0x14742e){var _0xa29570=_[_0x6b01('0x5')](_0x14742e,function(_0xdb2660){return _0xdb2660?_0xdb2660:undefined;});var _0x17481f=_[_0x6b01('0x5')](_0x44c3d1,[_0x6b01('0x8e'),!![]]);var _0x350e68=_[_0x6b01('0x89')](_0xa29570)&&_[_0x6b01('0x89')](_0x17481f)?null:_[_0x6b01('0x8f')](_0x17481f,_0xa29570);if(!_0x350e68)return null;var _0x207e0a=[];for(var _0x13ceac=0x0;_0x13ceac<_0x350e68[_0x6b01('0x90')];_0x13ceac++){var _0x3f077f=_[_0x6b01('0x8c')](_0x44c3d1,function(_0x4a8fcb){return _0x350e68[_0x13ceac]?_0x4a8fcb[_0x6b01('0x34')]===_0x350e68[_0x13ceac][_0x6b01('0x34')]:null;});if(_0x3f077f){if(_0x350e68[_0x13ceac][_0x6b01('0x8e')]){_0x207e0a[_0x6b01('0x8a')](_0x161b59(_0x2bd87d[_0x6b01('0x14')],_0x350e68[_0x13ceac]));}else{if(!_0x350e68[_0x13ceac][_0x6b01('0x91')]){_0x207e0a[_0x6b01('0x8a')](_0x327e86(_0x3f077f,_0x350e68[_0x13ceac],_0x2bd87d[_0x6b01('0x14')]));}else{if(_0x3f077f[_0x6b01('0xb')]){_0x207e0a[_0x6b01('0x8a')](_0x4b4a4d(_0x3f077f,_0x350e68[_0x13ceac]));}}}}}return Promise[_0x6b01('0x8d')](_0x207e0a);})[_0x6b01('0x6')](function(_0x468a0b){var _0x30171f=_0x468a0b;var _0x1a0bb7=null;if(_0x30171f){_0x1a0bb7=_0x30171f['length']===0x1?_0x30171f[0x0]:null;}if(!_0x1a0bb7&&!_0x30171f)return _0x38ae38;var _0xbcba19=_0x160a7d[_0x2bd87d[_0x6b01('0x14')]][_0x6b01('0x92')];_0x523102[_0x6b01('0xb')]=_[_0x6b01('0x93')](_0xbcba19);_0x523102[_0x6b01('0x82')]=_[_0x6b01('0x93')](_0x1dda2f[_0x6b01('0x82')]);_0x523102[_0x6b01('0x94')]=_[_0x6b01('0x95')](_0x523102[_0x6b01('0xb')],_0x523102[_0x6b01('0x82')]);_0x4c84cc[_0x6b01('0x96')]=_[_0x6b01('0x95')](_0x523102[_0x6b01('0xb')],qs[_0x6b01('0x97')](_0x1dda2f[_0x6b01('0x82')][_0x6b01('0x97')]));_0x4c84cc[_0x6b01('0x96')]=_0x4c84cc[_0x6b01('0x96')]['length']?_0x4c84cc['attributes']:_0x523102['model'];if(!_0x1dda2f['query'][_0x6b01('0x98')]('nolimit')){_0x4c84cc['limit']=qs['limit'](_0x1dda2f[_0x6b01('0x82')]['limit']);_0x4c84cc[_0x6b01('0x99')]=qs[_0x6b01('0x99')](_0x1dda2f[_0x6b01('0x82')][_0x6b01('0x99')]);}_0x4c84cc[_0x6b01('0x9a')]=qs['sort'](_0x1dda2f['query'][_0x6b01('0x9b')]);_0x4c84cc[_0x6b01('0x7f')]=qs[_0x6b01('0x94')](_['pick'](_0x1dda2f[_0x6b01('0x82')],_0x523102[_0x6b01('0x94')]));if(_0x1dda2f[_0x6b01('0x82')][_0x6b01('0x5')]){_0x4c84cc[_0x6b01('0x7f')]=_['merge'](_0x4c84cc[_0x6b01('0x7f')],{'$or':_['map'](_0xbcba19,function(_0x1a03e4){if(_0x1a03e4[_0x6b01('0x11')][_0x6b01('0x9c')]!==_0x6b01('0x9d')){var _0x16a427={};_0x16a427[_0x1a03e4['field']]={'$like':'%'+_0x1dda2f[_0x6b01('0x82')][_0x6b01('0x5')]+'%'};return _0x16a427;}})});}var _0xb133fc=[];var _0x8b2514=null;var _0x4dbd69={};if(_0x1a0bb7){_0x8b2514=_[_0x6b01('0x8c')](_0x44c3d1,[_0x6b01('0x34'),_0x1a0bb7[_0x6b01('0x34')]]);if(_0x8b2514[_0x6b01('0x4')]){_0x4dbd69={};if(_0x2bd87d[_0x6b01('0x14')]===_0x6b01('0xf')){_0x4dbd69[_0x8b2514['foreignKey']]=_['map'](_0x1a0bb7['associatedResources'],'id');}else{_0x4dbd69[_0x8b2514[_0x6b01('0x9e')]]=_0x1a0bb7[_0x6b01('0x7')];}_0xb133fc['push'](_0x4dbd69);}else{_0x4c84cc[_0x6b01('0x7f')]['id']=_0x1a0bb7[_0x6b01('0x7')];}}else{for(var _0x34c971=0x0;_0x34c971<_0x30171f[_0x6b01('0x90')];_0x34c971++){_0x8b2514=_['find'](_0x44c3d1,[_0x6b01('0x34'),_0x30171f[_0x34c971]['name']]);if(_0x8b2514[_0x6b01('0x4')]){_0x4dbd69={};_0x4dbd69[_0x8b2514['foreignKey']]=_0x30171f[_0x34c971][_0x6b01('0x7')];_0xb133fc['push'](_0x4dbd69);}else{if(!_0x4c84cc[_0x6b01('0x7f')]['id'])_0x4c84cc[_0x6b01('0x7f')]['id']=[];_0x30171f[_0x34c971][_0x6b01('0x7')][_0x6b01('0x9f')](function(_0x12b0d8){_0x4c84cc[_0x6b01('0x7f')]['id'][_0x6b01('0x8a')](_0x12b0d8);});}}}if(!_['isEmpty'](_0xb133fc)){_0x4c84cc[_0x6b01('0x7f')]=_['merge'](_0x4c84cc[_0x6b01('0x7f')],{'$and':{'$or':_0xb133fc}});}_0x4c84cc=_[_0x6b01('0xa0')]({},_0x4c84cc,_0x1dda2f[_0x6b01('0xa1')]);if(_0x1a0bb7&&!_0x1a0bb7[_0x6b01('0x91')]&&_0x2bd87d[_0x6b01('0x14')]===_0x6b01('0xf')){if(_0x1dda2f[_0x6b01('0x82')][_0x6b01('0xa2')]){_0x4c84cc[_0x6b01('0xa3')]=[{'all':!![]}];}return _0x160a7d[_0x2bd87d[_0x6b01('0x14')]][_0x6b01('0xe')](_0x4c84cc)['then'](function(_0x1e9300){var _0x4091a8=[];_0x1e9300[_0x6b01('0x9f')](function(_0x41c2a9){var _0x5ac0b6;switch(_0x41c2a9[_0x6b01('0xa4')]){case _0x6b01('0xa5'):_0x5ac0b6=_[_0x6b01('0x8c')](_0x1a0bb7[_0x6b01('0x7')],function(_0x3c4424){return _0x3c4424['id']===_0x41c2a9['reportId']&&_0x3c4424[_0x6b01('0x11')]==='DefaultReports';});break;case _0x6b01('0xa6'):_0x5ac0b6=_[_0x6b01('0x8c')](_0x1a0bb7[_0x6b01('0x7')],function(_0x7b8545){return _0x7b8545['id']===_0x41c2a9[_0x6b01('0x73')]&&_0x7b8545[_0x6b01('0x11')]===_0x6b01('0xa7');});break;}if(_0x5ac0b6)_0x4091a8[_0x6b01('0x8a')](_0x41c2a9);});_0x38ae38[_0x6b01('0xa8')]=_0x4091a8[_0x6b01('0x90')];_0x38ae38[_0x6b01('0xa9')]=_0x4091a8;return _0x38ae38;});}else{return _0x160a7d[_0x2bd87d[_0x6b01('0x14')]][_0x6b01('0xa8')]({'where':_0x4c84cc[_0x6b01('0x7f')]})['then'](function(_0x2f180){_0x38ae38['count']=_0x2f180;if(_0x1dda2f['query'][_0x6b01('0xa2')]){if(_0x2bd87d[_0x6b01('0x14')]===_0x6b01('0xaa')){_0x4c84cc[_0x6b01('0xa3')]=[{'model':_0x160a7d['Tag'],'as':_0x6b01('0xab'),'attributes':['id',_0x6b01('0x34'),_0x6b01('0xac')],'required':_0x1dda2f['query'][_0x6b01('0xad')]?!![]:![]},{'model':_0x160a7d[_0x6b01('0x6a')],'as':_0x6b01('0xae'),'attributes':['id',_0x6b01('0x34'),_0x6b01('0xac')],'through':_0x1dda2f[_0x6b01('0x82')][_0x6b01('0xad')]?{'attributes':[],'where':{'TagId':_0x1dda2f[_0x6b01('0x82')]['tag']||undefined}}:{},'required':_0x1dda2f[_0x6b01('0x82')][_0x6b01('0xad')]?!![]:![]}];}else{_0x4c84cc[_0x6b01('0xa3')]=[{'all':!![]}];}}return _0x160a7d[_0x2bd87d[_0x6b01('0x14')]]['findAll'](_0x4c84cc);})['then'](function(_0x33fa1d){_0x38ae38[_0x6b01('0xa9')]=_0x33fa1d;if(_0x270128===_0x6b01('0x33')&&_0x1dda2f[_0x6b01('0x82')][_0x6b01('0xaf')]===_0x6b01('0xb0')){var _0x1343af=[];for(var _0x29c507=0x0;_0x29c507<_0x38ae38['rows'][_0x6b01('0x90')];_0x29c507++){_0x1343af[_0x6b01('0x8a')](_0x1aefc2(_0x6b01('0xb1'),_0x38ae38[_0x6b01('0xa9')][_0x29c507][_0x6b01('0xb2')]));_0x1343af[_0x6b01('0x8a')](_0x1aefc2(_0x6b01('0xb3'),_0x38ae38['rows'][_0x29c507][_0x6b01('0xb2')]));_0x1343af['push'](_0x1aefc2(_0x6b01('0xb4'),_0x38ae38[_0x6b01('0xa9')][_0x29c507][_0x6b01('0xb2')]));_0x1343af[_0x6b01('0x8a')](_0x1aefc2(_0x6b01('0xb5'),_0x38ae38['rows'][_0x29c507][_0x6b01('0xb2')]));_0x1343af['push'](_0x1aefc2(_0x6b01('0xb6'),_0x38ae38[_0x6b01('0xa9')][_0x29c507]['dataValues']));_0x1343af[_0x6b01('0x8a')](_0x1aefc2(_0x6b01('0xb7'),_0x38ae38[_0x6b01('0xa9')][_0x29c507][_0x6b01('0xb2')]));}return Promise[_0x6b01('0x8d')](_0x1343af)['then'](function(){return _0x38ae38;});}return _0x38ae38;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 995096d..feea4d6 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 _0xf963=['defaults','socket.io-emitter','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','lodash','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis'];(function(_0x1fce61,_0x35ef2a){var _0x4660ab=function(_0x52cd17){while(--_0x52cd17){_0x1fce61['push'](_0x1fce61['shift']());}};_0x4660ab(++_0x35ef2a);}(_0xf963,0x11d));var _0x3f96=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xf963[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x3f96('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3f96('0x1'));var rs=require(_0x3f96('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3f96('0x3'));var logger=require(_0x3f96('0x4'))(_0x3f96('0x5'));var config=require(_0x3f96('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3f96('0x7')]['http']({'port':0x232a});config[_0x3f96('0x8')]=_[_0x3f96('0x9')](config[_0x3f96('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x3f96('0xa'))(new Redis(config[_0x3f96('0x8')]));require('./userProfile.socket')['register'](socket);function respondWithRpcPromise(_0x588a00,_0x4b889d,_0xc70e27){return new BPromise(function(_0x3342b8,_0x1b7d40){return client[_0x3f96('0xb')](_0x588a00,_0xc70e27)[_0x3f96('0xc')](function(_0x4a7573){logger[_0x3f96('0xd')](_0x3f96('0xe'),_0x4b889d,_0x3f96('0xf'));logger[_0x3f96('0x10')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x4b889d,_0x3f96('0xf'),JSON['stringify'](_0x4a7573));if(_0x4a7573[_0x3f96('0x11')]){if(_0x4a7573[_0x3f96('0x11')][_0x3f96('0x12')]===0x1f4){logger['error'](_0x3f96('0xe'),_0x4b889d,_0x4a7573['error'][_0x3f96('0x13')]);return _0x1b7d40(_0x4a7573['error']['message']);}logger['error'](_0x3f96('0xe'),_0x4b889d,_0x4a7573[_0x3f96('0x11')][_0x3f96('0x13')]);return _0x3342b8(_0x4a7573[_0x3f96('0x11')]['message']);}else{logger[_0x3f96('0xd')](_0x3f96('0xe'),_0x4b889d,_0x3f96('0xf'));_0x3342b8(_0x4a7573['result'][_0x3f96('0x13')]);}})[_0x3f96('0x14')](function(_0x184724){logger['error'](_0x3f96('0xe'),_0x4b889d,_0x184724);_0x1b7d40(_0x184724);});});} \ No newline at end of file +var _0xdfa0=['jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','request','then','info','UserProfile,\x20%s,\x20%s','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x10ac9d,_0x129feb){var _0x482435=function(_0x31177c){while(--_0x31177c){_0x10ac9d['push'](_0x10ac9d['shift']());}};_0x482435(++_0x129feb);}(_0xdfa0,0x69));var _0x0dfa=function(_0x28d7ee,_0x3ce274){_0x28d7ee=_0x28d7ee-0x0;var _0x3e618d=_0xdfa0[_0x28d7ee];return _0x3e618d;};'use strict';var _=require(_0x0dfa('0x0'));var util=require('util');var moment=require(_0x0dfa('0x1'));var BPromise=require(_0x0dfa('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0dfa('0x3'));var db=require(_0x0dfa('0x4'))['db'];var utils=require(_0x0dfa('0x5'));var logger=require('../../config/logger')(_0x0dfa('0x6'));var config=require('../../config/environment');var jayson=require(_0x0dfa('0x7'));var client=jayson[_0x0dfa('0x8')]['http']({'port':0x232a});config[_0x0dfa('0x9')]=_[_0x0dfa('0xa')](config[_0x0dfa('0x9')],{'host':_0x0dfa('0xb'),'port':0x18eb});var socket=require(_0x0dfa('0xc'))(new Redis(config['redis']));require(_0x0dfa('0xd'))[_0x0dfa('0xe')](socket);function respondWithRpcPromise(_0x6c9373,_0x5cddf5,_0x438b20){return new BPromise(function(_0x520ec9,_0x260ffb){return client[_0x0dfa('0xf')](_0x6c9373,_0x438b20)[_0x0dfa('0x10')](function(_0x4c7ce4){logger[_0x0dfa('0x11')](_0x0dfa('0x12'),_0x5cddf5,'request\x20sent');logger[_0x0dfa('0x13')](_0x0dfa('0x14'),_0x5cddf5,'request\x20sent',JSON[_0x0dfa('0x15')](_0x4c7ce4));if(_0x4c7ce4[_0x0dfa('0x16')]){if(_0x4c7ce4[_0x0dfa('0x16')][_0x0dfa('0x17')]===0x1f4){logger[_0x0dfa('0x16')](_0x0dfa('0x12'),_0x5cddf5,_0x4c7ce4['error'][_0x0dfa('0x18')]);return _0x260ffb(_0x4c7ce4[_0x0dfa('0x16')][_0x0dfa('0x18')]);}logger[_0x0dfa('0x16')](_0x0dfa('0x12'),_0x5cddf5,_0x4c7ce4[_0x0dfa('0x16')][_0x0dfa('0x18')]);return _0x520ec9(_0x4c7ce4[_0x0dfa('0x16')][_0x0dfa('0x18')]);}else{logger[_0x0dfa('0x11')](_0x0dfa('0x12'),_0x5cddf5,_0x0dfa('0x19'));_0x520ec9(_0x4c7ce4[_0x0dfa('0x1a')][_0x0dfa('0x18')]);}})[_0x0dfa('0x1b')](function(_0x5b9529){logger[_0x0dfa('0x16')](_0x0dfa('0x12'),_0x5cddf5,_0x5b9529);_0x260ffb(_0x5b9529);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index fdcf6ed..2959504 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 _0x19c7=['save','remove','register','length','./userProfile.events'];(function(_0x4f4f05,_0x8d8959){var _0xd2c5c0=function(_0x1b88b1){while(--_0x1b88b1){_0x4f4f05['push'](_0x4f4f05['shift']());}};_0xd2c5c0(++_0x8d8959);}(_0x19c7,0x86));var _0x719c=function(_0x4cab61,_0x1e3ce8){_0x4cab61=_0x4cab61-0x0;var _0x332c8e=_0x19c7[_0x4cab61];return _0x332c8e;};'use strict';var UserProfileEvents=require(_0x719c('0x0'));var events=[_0x719c('0x1'),_0x719c('0x2'),'update'];function createListener(_0x334d07,_0x4a3874){return function(_0x2508b6){_0x4a3874['emit'](_0x334d07,_0x2508b6);};}function removeListener(_0x2751dc,_0x2ecb82){return function(){UserProfileEvents['removeListener'](_0x2751dc,_0x2ecb82);};}exports[_0x719c('0x3')]=function(_0x844720){for(var _0xb595de=0x0,_0xdcbef9=events[_0x719c('0x4')];_0xb595de<_0xdcbef9;_0xb595de++){var _0x9538a7=events[_0xb595de];var _0x41da27=createListener('userProfile:'+_0x9538a7,_0x844720);UserProfileEvents['on'](_0x9538a7,_0x41da27);}}; \ No newline at end of file +var _0xcd2d=['removeListener','register','userProfile:','./userProfile.events','save','remove','emit'];(function(_0x8ca8ae,_0x30fac3){var _0x2817bb=function(_0x20eb93){while(--_0x20eb93){_0x8ca8ae['push'](_0x8ca8ae['shift']());}};_0x2817bb(++_0x30fac3);}(_0xcd2d,0x130));var _0xdcd2=function(_0x3d52c9,_0x21c2db){_0x3d52c9=_0x3d52c9-0x0;var _0x5a944c=_0xcd2d[_0x3d52c9];return _0x5a944c;};'use strict';var UserProfileEvents=require(_0xdcd2('0x0'));var events=[_0xdcd2('0x1'),_0xdcd2('0x2'),'update'];function createListener(_0x199b13,_0x3814a7){return function(_0x40143d){_0x3814a7[_0xdcd2('0x3')](_0x199b13,_0x40143d);};}function removeListener(_0x1f49f0,_0x209f22){return function(){UserProfileEvents[_0xdcd2('0x4')](_0x1f49f0,_0x209f22);};}exports[_0xdcd2('0x5')]=function(_0x3aea2b){for(var _0x1a40b3=0x0,_0x58f557=events['length'];_0x1a40b3<_0x58f557;_0x1a40b3++){var _0x520e12=events[_0x1a40b3];var _0x4a9846=createListener(_0xdcd2('0x6')+_0x520e12,_0x3aea2b);UserProfileEvents['on'](_0x520e12,_0x4a9846);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 047b5a6..7351dd6 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 _0xc46f=['index','/describe','show','create','put','/:id','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated'];(function(_0x5c3725,_0x498e30){var _0x631749=function(_0x1597ef){while(--_0x1597ef){_0x5c3725['push'](_0x5c3725['shift']());}};_0x631749(++_0x498e30);}(_0xc46f,0x15d));var _0xfc46=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xc46f[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0xfc46('0x0'));var util=require(_0xfc46('0x1'));var path=require(_0xfc46('0x2'));var timeout=require('connect-timeout');var express=require(_0xfc46('0x3'));var router=express[_0xfc46('0x4')]();var fs_extra=require(_0xfc46('0x5'));var auth=require(_0xfc46('0x6'));var interaction=require(_0xfc46('0x7'));var config=require(_0xfc46('0x8'));var controller=require(_0xfc46('0x9'));router[_0xfc46('0xa')]('/',auth[_0xfc46('0xb')](),controller[_0xfc46('0xc')]);router[_0xfc46('0xa')](_0xfc46('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0xfc46('0xa')]('/:id',auth[_0xfc46('0xb')](),controller[_0xfc46('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xfc46('0xf')]);router[_0xfc46('0x10')](_0xfc46('0x11'),auth[_0xfc46('0xb')](),controller['update']);router['delete'](_0xfc46('0x11'),auth['isAuthenticated'](),controller[_0xfc46('0x12')]);module['exports']=router; \ No newline at end of file +var _0x6809=['../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','/describe','describe','show','post','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x432374,_0x5d2bf4){var _0x529d1b=function(_0x44313c){while(--_0x44313c){_0x432374['push'](_0x432374['shift']());}};_0x529d1b(++_0x5d2bf4);}(_0x6809,0x143));var _0x9680=function(_0x49c68e,_0x1c1673){_0x49c68e=_0x49c68e-0x0;var _0x33032b=_0x6809[_0x49c68e];return _0x33032b;};'use strict';var multer=require(_0x9680('0x0'));var util=require('util');var path=require(_0x9680('0x1'));var timeout=require(_0x9680('0x2'));var express=require(_0x9680('0x3'));var router=express[_0x9680('0x4')]();var fs_extra=require(_0x9680('0x5'));var auth=require(_0x9680('0x6'));var interaction=require(_0x9680('0x7'));var config=require(_0x9680('0x8'));var controller=require(_0x9680('0x9'));router[_0x9680('0xa')]('/',auth[_0x9680('0xb')](),controller['index']);router['get'](_0x9680('0xc'),auth[_0x9680('0xb')](),controller[_0x9680('0xd')]);router[_0x9680('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x9680('0xe')]);router[_0x9680('0xf')]('/',auth[_0x9680('0xb')](),controller['create']);router[_0x9680('0x10')](_0x9680('0x11'),auth[_0x9680('0xb')](),controller[_0x9680('0x12')]);router[_0x9680('0x13')]('/:id',auth[_0x9680('0xb')](),controller[_0x9680('0x14')]);module[_0x9680('0x15')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 02193b3..2df9ec3 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 _0x6df3=['sequelize','exports','INTEGER','STRING'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0x6df3,0x154));var _0x36df=function(_0x427b22,_0x398eb9){_0x427b22=_0x427b22-0x0;var _0x512153=_0x6df3[_0x427b22];return _0x512153;};'use strict';var Sequelize=require(_0x36df('0x0'));module[_0x36df('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0x36df('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x36df('0x3')],'allowNull':![]}}; \ No newline at end of file +var _0x7e61=['STRING','INTEGER','sequelize','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7e61,0xaa));var _0x17e6=function(_0x43560c,_0x20e398){_0x43560c=_0x43560c-0x0;var _0x310501=_0x7e61[_0x43560c];return _0x310501;};'use strict';var Sequelize=require(_0x17e6('0x0'));module[_0x17e6('0x1')]={'name':{'type':Sequelize[_0x17e6('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x17e6('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x17e6('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index c5026fa..7e7defb 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 _0x5f2f=['offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','stack','name','send','index','UserProfileResource','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','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status'];(function(_0x11bdad,_0x1e1e51){var _0x577fdd=function(_0x59a5fb){while(--_0x59a5fb){_0x11bdad['push'](_0x11bdad['shift']());}};_0x577fdd(++_0x1e1e51);}(_0x5f2f,0x73));var _0xf5f2=function(_0x46ebb3,_0x23ce46){_0x46ebb3=_0x46ebb3-0x0;var _0x3e0919=_0x5f2f[_0x46ebb3];return _0x3e0919;};'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));};exports['describe']=function(_0x22b645,_0xe0ce7f){return db[_0xf5f2('0x29')][_0xf5f2('0x46')]()['then'](respondWithResult(_0xe0ce7f,null))['catch'](handleError(_0xe0ce7f,null));}; \ No newline at end of file +var _0x4975=['to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','fieldName','type','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','sort','pick','filter','where','map','VIRTUAL','options','UserProfileResource','count','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x36ed95,_0x5ebabc){var _0x4147d4=function(_0x2a1c29){while(--_0x2a1c29){_0x36ed95['push'](_0x36ed95['shift']());}};_0x4147d4(++_0x5ebabc);}(_0x4975,0x86));var _0x5497=function(_0x13aa8d,_0x2ecbb3){_0x13aa8d=_0x13aa8d-0x0;var _0x1e36e6=_0x4975[_0x13aa8d];return _0x1e36e6;};'use strict';var emlformat=require(_0x5497('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5497('0x1'));var jsonpatch=require(_0x5497('0x2'));var rp=require(_0x5497('0x3'));var moment=require(_0x5497('0x4'));var BPromise=require(_0x5497('0x5'));var Mustache=require(_0x5497('0x6'));var util=require(_0x5497('0x7'));var path=require(_0x5497('0x8'));var sox=require(_0x5497('0x9'));var csv=require(_0x5497('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5497('0xb'));var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xa'));var querystring=require('querystring');var Papa=require(_0x5497('0xf'));var Redis=require(_0x5497('0x10'));var authService=require(_0x5497('0x11'));var qs=require(_0x5497('0x12'));var as=require(_0x5497('0x13'));var hardwareService=require(_0x5497('0x14'));var logger=require(_0x5497('0x15'))(_0x5497('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5497('0x17'))['db'];function respondWithStatusCode(_0x1b23df,_0x1bb794){_0x1bb794=_0x1bb794||0xcc;return function(_0x984990){if(_0x984990){return _0x1b23df[_0x5497('0x18')](_0x1bb794);}return _0x1b23df[_0x5497('0x19')](_0x1bb794)[_0x5497('0x1a')]();};}function respondWithResult(_0xaca97d,_0x363a5b){_0x363a5b=_0x363a5b||0xc8;return function(_0x1a4c74){if(_0x1a4c74){return _0xaca97d['status'](_0x363a5b)[_0x5497('0x1b')](_0x1a4c74);}};}function respondWithFilteredResult(_0x4fb8e9,_0x4237a9){return function(_0x2bfd8a){if(_0x2bfd8a){var _0x19e5f3=typeof _0x4237a9[_0x5497('0x1c')]===_0x5497('0x1d')&&typeof _0x4237a9[_0x5497('0x1e')]===_0x5497('0x1d');var _0x575f6b=_0x2bfd8a['count'];var _0x3f4d20=_0x19e5f3?0x0:_0x4237a9[_0x5497('0x1c')];var _0x3a47fd=_0x19e5f3?_0x2bfd8a['count']:_0x4237a9[_0x5497('0x1c')]+_0x4237a9[_0x5497('0x1e')];var _0x18e8a8;if(_0x3a47fd>=_0x575f6b){_0x3a47fd=_0x575f6b;_0x18e8a8=0xc8;}else{_0x18e8a8=0xce;}_0x4fb8e9[_0x5497('0x19')](_0x18e8a8);return _0x4fb8e9[_0x5497('0x1f')](_0x5497('0x20'),_0x3f4d20+'-'+_0x3a47fd+'/'+_0x575f6b)[_0x5497('0x1b')](_0x2bfd8a);}return null;};}function patchUpdates(_0x10226f){return function(_0x2e3960){try{jsonpatch[_0x5497('0x21')](_0x2e3960,_0x10226f,!![]);}catch(_0x186065){return BPromise['reject'](_0x186065);}return _0x2e3960[_0x5497('0x22')]();};}function saveUpdates(_0x4d1b27,_0x19200a){return function(_0xd0868d){if(_0xd0868d){return _0xd0868d[_0x5497('0x23')](_0x4d1b27)[_0x5497('0x24')](function(_0x35ecd9){return _0x35ecd9;});}return null;};}function removeEntity(_0x3b2fbc,_0x5018fa){return function(_0x54043a){if(_0x54043a){return _0x54043a[_0x5497('0x25')]()[_0x5497('0x24')](function(){_0x3b2fbc[_0x5497('0x19')](0xcc)[_0x5497('0x1a')]();});}};}function handleEntityNotFound(_0x5223b5,_0x13b7a4){return function(_0x57268c){if(!_0x57268c){_0x5223b5[_0x5497('0x18')](0x194);}return _0x57268c;};}function handleError(_0x16a2b4,_0x429d36){_0x429d36=_0x429d36||0x1f4;return function(_0x34a1a5){logger[_0x5497('0x26')](_0x34a1a5[_0x5497('0x27')]);if(_0x34a1a5['name']){delete _0x34a1a5[_0x5497('0x28')];}_0x16a2b4['status'](_0x429d36)['send'](_0x34a1a5);};}exports['index']=function(_0x39a2b7,_0x48d146){var _0x5e9356={},_0xc3465={},_0xb14593={'count':0x0,'rows':[]};var _0x1cf908=_['map'](db['UserProfileResource']['rawAttributes'],function(_0x371874){return{'name':_0x371874[_0x5497('0x29')],'type':_0x371874[_0x5497('0x2a')]['key']};});_0xc3465['model']=_['map'](_0x1cf908,_0x5497('0x28'));_0xc3465['query']=_[_0x5497('0x2b')](_0x39a2b7[_0x5497('0x2c')]);_0xc3465[_0x5497('0x2d')]=_['intersection'](_0xc3465[_0x5497('0x2e')],_0xc3465[_0x5497('0x2c')]);_0x5e9356['attributes']=_[_0x5497('0x2f')](_0xc3465[_0x5497('0x2e')],qs[_0x5497('0x30')](_0x39a2b7['query'][_0x5497('0x30')]));_0x5e9356[_0x5497('0x31')]=_0x5e9356[_0x5497('0x31')][_0x5497('0x32')]?_0x5e9356[_0x5497('0x31')]:_0xc3465['model'];if(!_0x39a2b7[_0x5497('0x2c')][_0x5497('0x33')]('nolimit')){_0x5e9356[_0x5497('0x1e')]=qs[_0x5497('0x1e')](_0x39a2b7[_0x5497('0x2c')][_0x5497('0x1e')]);_0x5e9356[_0x5497('0x1c')]=qs[_0x5497('0x1c')](_0x39a2b7['query'][_0x5497('0x1c')]);}_0x5e9356['order']=qs[_0x5497('0x34')](_0x39a2b7[_0x5497('0x2c')][_0x5497('0x34')]);_0x5e9356['where']=qs['filters'](_[_0x5497('0x35')](_0x39a2b7[_0x5497('0x2c')],_0xc3465[_0x5497('0x2d')]),_0x1cf908);if(_0x39a2b7[_0x5497('0x2c')][_0x5497('0x36')]){_0x5e9356[_0x5497('0x37')]=_['merge'](_0x5e9356[_0x5497('0x37')],{'$or':_[_0x5497('0x38')](_0x1cf908,function(_0x3de8fe){if(_0x3de8fe[_0x5497('0x2a')]!==_0x5497('0x39')){var _0x468902={};_0x468902[_0x3de8fe[_0x5497('0x28')]]={'$like':'%'+_0x39a2b7[_0x5497('0x2c')][_0x5497('0x36')]+'%'};return _0x468902;}})});}_0x5e9356=_['merge']({},_0x5e9356,_0x39a2b7[_0x5497('0x3a')]);var _0x32fa2b={'where':_0x5e9356[_0x5497('0x37')]};return db[_0x5497('0x3b')][_0x5497('0x3c')](_0x32fa2b)[_0x5497('0x24')](function(_0x4299be){_0xb14593['count']=_0x4299be;if(_0x39a2b7[_0x5497('0x2c')][_0x5497('0x3d')]){_0x5e9356[_0x5497('0x3e')]=[{'all':!![]}];}return db[_0x5497('0x3b')][_0x5497('0x3f')](_0x5e9356);})[_0x5497('0x24')](function(_0x114471){_0xb14593['rows']=_0x114471;return _0xb14593;})[_0x5497('0x24')](respondWithFilteredResult(_0x48d146,_0x5e9356))[_0x5497('0x40')](handleError(_0x48d146,null));};exports[_0x5497('0x41')]=function(_0x1e6389,_0x20e947){var _0xd90608={'raw':![],'where':{'id':_0x1e6389[_0x5497('0x42')]['id']}},_0xc1a999={};_0xc1a999[_0x5497('0x2e')]=_[_0x5497('0x2b')](db['UserProfileResource'][_0x5497('0x43')]);_0xc1a999['query']=_[_0x5497('0x2b')](_0x1e6389[_0x5497('0x2c')]);_0xc1a999[_0x5497('0x2d')]=_[_0x5497('0x2f')](_0xc1a999[_0x5497('0x2e')],_0xc1a999['query']);_0xd90608[_0x5497('0x31')]=_[_0x5497('0x2f')](_0xc1a999['model'],qs[_0x5497('0x30')](_0x1e6389['query'][_0x5497('0x30')]));_0xd90608['attributes']=_0xd90608[_0x5497('0x31')][_0x5497('0x32')]?_0xd90608[_0x5497('0x31')]:_0xc1a999[_0x5497('0x2e')];if(_0x1e6389[_0x5497('0x2c')]['includeAll']){_0xd90608['include']=[{'all':!![]}];}_0xd90608=_['merge']({},_0xd90608,_0x1e6389['options']);return db[_0x5497('0x3b')][_0x5497('0x44')](_0xd90608)[_0x5497('0x24')](handleEntityNotFound(_0x20e947,null))[_0x5497('0x24')](respondWithResult(_0x20e947,null))[_0x5497('0x40')](handleError(_0x20e947,null));};exports[_0x5497('0x45')]=function(_0xc78abe,_0x466287){return db[_0x5497('0x3b')]['create'](_0xc78abe[_0x5497('0x46')],{})[_0x5497('0x24')](respondWithResult(_0x466287,0xc9))[_0x5497('0x40')](handleError(_0x466287,null));};exports['update']=function(_0x3e4da2,_0x530475){if(_0x3e4da2[_0x5497('0x46')]['id']){delete _0x3e4da2[_0x5497('0x46')]['id'];}return db[_0x5497('0x3b')]['find']({'where':{'id':_0x3e4da2[_0x5497('0x42')]['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x530475,null))['then'](saveUpdates(_0x3e4da2[_0x5497('0x46')],null))['then'](respondWithResult(_0x530475,null))[_0x5497('0x40')](handleError(_0x530475,null));};exports['destroy']=function(_0x416f76,_0x400860){return db[_0x5497('0x3b')][_0x5497('0x44')]({'where':{'id':_0x416f76[_0x5497('0x42')]['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x400860,null))[_0x5497('0x24')](removeEntity(_0x400860,null))[_0x5497('0x40')](handleError(_0x400860,null));};exports['describe']=function(_0x1f73eb,_0x5b2c22){return db['UserProfileResource'][_0x5497('0x47')]()[_0x5497('0x24')](respondWithResult(_0x5b2c22,null))['catch'](handleError(_0x5b2c22,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 30361b4..cccdecf 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 _0x68d9=['compositeIndex','resourceId','sectionId','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./userProfileResource.attributes','UserProfileResource'];(function(_0x397d61,_0x1f2002){var _0x270833=function(_0x330677){while(--_0x330677){_0x397d61['push'](_0x397d61['shift']());}};_0x270833(++_0x1f2002);}(_0x68d9,0xe0));var _0x968d=function(_0x909d82,_0x522a5e){_0x909d82=_0x909d82-0x0;var _0x7baec1=_0x68d9[_0x909d82];return _0x7baec1;};'use strict';var _=require(_0x968d('0x0'));var util=require('util');var logger=require(_0x968d('0x1'))(_0x968d('0x2'));var moment=require(_0x968d('0x3'));var BPromise=require(_0x968d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x968d('0x5'));var rimraf=require(_0x968d('0x6'));var config=require(_0x968d('0x7'));var attributes=require(_0x968d('0x8'));module['exports']=function(_0x1f44fa,_0x13326e){return _0x1f44fa['define'](_0x968d('0x9'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0x968d('0xa'),'fields':[_0x968d('0xb'),_0x968d('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8f09=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','user_profile_has_resources','compositeIndex','sectionId','util'];(function(_0x57de8c,_0x1e0f17){var _0x43a392=function(_0x37066e){while(--_0x37066e){_0x57de8c['push'](_0x57de8c['shift']());}};_0x43a392(++_0x1e0f17);}(_0x8f09,0xe9));var _0x98f0=function(_0x16ff08,_0x5851c6){_0x16ff08=_0x16ff08-0x0;var _0x59c1ed=_0x8f09[_0x16ff08];return _0x59c1ed;};'use strict';var _=require('lodash');var util=require(_0x98f0('0x0'));var logger=require(_0x98f0('0x1'))(_0x98f0('0x2'));var moment=require(_0x98f0('0x3'));var BPromise=require(_0x98f0('0x4'));var rp=require(_0x98f0('0x5'));var fs=require('fs');var path=require(_0x98f0('0x6'));var rimraf=require(_0x98f0('0x7'));var config=require('../../config/environment');var attributes=require('./userProfileResource.attributes');module[_0x98f0('0x8')]=function(_0xff1dd3,_0x588c39){return _0xff1dd3[_0x98f0('0x9')]('UserProfileResource',attributes,{'tableName':_0x98f0('0xa'),'paranoid':![],'indexes':[{'name':_0x98f0('0xb'),'fields':['resourceId',_0x98f0('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 3b32e62..8b18b08 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 _0xc2c9=['result','catch','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','UserProfileResource,\x20%s,\x20%s','UserProfileResource,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message'];(function(_0x2daef6,_0xcac228){var _0x62d030=function(_0x26a7d6){while(--_0x26a7d6){_0x2daef6['push'](_0x2daef6['shift']());}};_0x62d030(++_0xcac228);}(_0xc2c9,0x16a));var _0x9c2c=function(_0x474363,_0x359b4b){_0x474363=_0x474363-0x0;var _0x5ced04=_0xc2c9[_0x474363];return _0x5ced04;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9c2c('0x0'));var BPromise=require(_0x9c2c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9c2c('0x2'))['db'];var utils=require(_0x9c2c('0x3'));var logger=require(_0x9c2c('0x4'))(_0x9c2c('0x5'));var config=require(_0x9c2c('0x6'));var jayson=require(_0x9c2c('0x7'));var client=jayson[_0x9c2c('0x8')][_0x9c2c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x17519b,_0x3d17ef,_0x3f0622){return new BPromise(function(_0x217132,_0x261e02){return client[_0x9c2c('0xa')](_0x17519b,_0x3f0622)['then'](function(_0x2f68e2){logger[_0x9c2c('0xb')](_0x9c2c('0xc'),_0x3d17ef,'request\x20sent');logger['debug'](_0x9c2c('0xd'),_0x3d17ef,_0x9c2c('0xe'),JSON['stringify'](_0x2f68e2));if(_0x2f68e2[_0x9c2c('0xf')]){if(_0x2f68e2[_0x9c2c('0xf')][_0x9c2c('0x10')]===0x1f4){logger[_0x9c2c('0xf')](_0x9c2c('0xc'),_0x3d17ef,_0x2f68e2[_0x9c2c('0xf')]['message']);return _0x261e02(_0x2f68e2[_0x9c2c('0xf')]['message']);}logger['error'](_0x9c2c('0xc'),_0x3d17ef,_0x2f68e2[_0x9c2c('0xf')][_0x9c2c('0x11')]);return _0x217132(_0x2f68e2['error'][_0x9c2c('0x11')]);}else{logger[_0x9c2c('0xb')](_0x9c2c('0xc'),_0x3d17ef,_0x9c2c('0xe'));_0x217132(_0x2f68e2[_0x9c2c('0x12')][_0x9c2c('0x11')]);}})[_0x9c2c('0x13')](function(_0x58b3a5){logger[_0x9c2c('0xf')](_0x9c2c('0xc'),_0x3d17ef,_0x58b3a5);_0x261e02(_0x58b3a5);});});} \ No newline at end of file +var _0x0c10=['message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','error'];(function(_0x3c48e2,_0x11b592){var _0x1c9aeb=function(_0x3374a7){while(--_0x3374a7){_0x3c48e2['push'](_0x3c48e2['shift']());}};_0x1c9aeb(++_0x11b592);}(_0x0c10,0xc8));var _0x00c1=function(_0x2ddd52,_0x4e3b17){_0x2ddd52=_0x2ddd52-0x0;var _0x4bb4ec=_0x0c10[_0x2ddd52];return _0x4bb4ec;};'use strict';var _=require('lodash');var util=require(_0x00c1('0x0'));var moment=require(_0x00c1('0x1'));var BPromise=require(_0x00c1('0x2'));var rs=require(_0x00c1('0x3'));var fs=require('fs');var Redis=require(_0x00c1('0x4'));var db=require(_0x00c1('0x5'))['db'];var utils=require(_0x00c1('0x6'));var logger=require(_0x00c1('0x7'))('rpc');var config=require(_0x00c1('0x8'));var jayson=require(_0x00c1('0x9'));var client=jayson[_0x00c1('0xa')][_0x00c1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5f18ba,_0x4dc2f2,_0x240c31){return new BPromise(function(_0x446310,_0xe55699){return client[_0x00c1('0xc')](_0x5f18ba,_0x240c31)[_0x00c1('0xd')](function(_0x282d2e){logger[_0x00c1('0xe')](_0x00c1('0xf'),_0x4dc2f2,_0x00c1('0x10'));logger[_0x00c1('0x11')](_0x00c1('0x12'),_0x4dc2f2,'request\x20sent',JSON['stringify'](_0x282d2e));if(_0x282d2e[_0x00c1('0x13')]){if(_0x282d2e[_0x00c1('0x13')]['code']===0x1f4){logger['error'](_0x00c1('0xf'),_0x4dc2f2,_0x282d2e['error']['message']);return _0xe55699(_0x282d2e[_0x00c1('0x13')][_0x00c1('0x14')]);}logger[_0x00c1('0x13')]('UserProfileResource,\x20%s,\x20%s',_0x4dc2f2,_0x282d2e['error'][_0x00c1('0x14')]);return _0x446310(_0x282d2e['error']['message']);}else{logger[_0x00c1('0xe')](_0x00c1('0xf'),_0x4dc2f2,'request\x20sent');_0x446310(_0x282d2e['result'][_0x00c1('0x14')]);}})[_0x00c1('0x15')](function(_0x56fae9){logger[_0x00c1('0x13')]('UserProfileResource,\x20%s,\x20%s',_0x4dc2f2,_0x56fae9);_0xe55699(_0x56fae9);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index af021ac..c0d6f9e 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 _0x2dfb=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfileSection.controller','get','isAuthenticated','/describe','describe','show','post','put','/:id','update','destroy','exports','multer','path','connect-timeout'];(function(_0x55f5e1,_0x387db8){var _0x53d50f=function(_0x573f01){while(--_0x573f01){_0x55f5e1['push'](_0x55f5e1['shift']());}};_0x53d50f(++_0x387db8);}(_0x2dfb,0x1a1));var _0xb2df=function(_0x2c7945,_0x35fa40){_0x2c7945=_0x2c7945-0x0;var _0x2a9a75=_0x2dfb[_0x2c7945];return _0x2a9a75;};'use strict';var multer=require(_0xb2df('0x0'));var util=require('util');var path=require(_0xb2df('0x1'));var timeout=require(_0xb2df('0x2'));var express=require(_0xb2df('0x3'));var router=express[_0xb2df('0x4')]();var fs_extra=require(_0xb2df('0x5'));var auth=require(_0xb2df('0x6'));var interaction=require(_0xb2df('0x7'));var config=require('../../config/environment');var controller=require(_0xb2df('0x8'));router[_0xb2df('0x9')]('/',auth[_0xb2df('0xa')](),controller['index']);router[_0xb2df('0x9')](_0xb2df('0xb'),auth[_0xb2df('0xa')](),controller[_0xb2df('0xc')]);router[_0xb2df('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xb2df('0xd')]);router[_0xb2df('0xe')]('/',auth[_0xb2df('0xa')](),controller['create']);router[_0xb2df('0xf')](_0xb2df('0x10'),auth[_0xb2df('0xa')](),controller[_0xb2df('0x11')]);router['delete'](_0xb2df('0x10'),auth['isAuthenticated'](),controller[_0xb2df('0x12')]);module[_0xb2df('0x13')]=router; \ No newline at end of file +var _0xbdce=['exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete','destroy'];(function(_0x4a3bd9,_0x4c6ea8){var _0x45b132=function(_0x8cf988){while(--_0x8cf988){_0x4a3bd9['push'](_0x4a3bd9['shift']());}};_0x45b132(++_0x4c6ea8);}(_0xbdce,0x1cf));var _0xebdc=function(_0x2af819,_0x2a4711){_0x2af819=_0x2af819-0x0;var _0x1797d2=_0xbdce[_0x2af819];return _0x1797d2;};'use strict';var multer=require(_0xebdc('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xebdc('0x1'));var express=require(_0xebdc('0x2'));var router=express[_0xebdc('0x3')]();var fs_extra=require(_0xebdc('0x4'));var auth=require(_0xebdc('0x5'));var interaction=require(_0xebdc('0x6'));var config=require(_0xebdc('0x7'));var controller=require(_0xebdc('0x8'));router[_0xebdc('0x9')]('/',auth[_0xebdc('0xa')](),controller[_0xebdc('0xb')]);router[_0xebdc('0x9')](_0xebdc('0xc'),auth[_0xebdc('0xa')](),controller[_0xebdc('0xd')]);router[_0xebdc('0x9')](_0xebdc('0xe'),auth['isAuthenticated'](),controller[_0xebdc('0xf')]);router[_0xebdc('0x10')]('/',auth[_0xebdc('0xa')](),controller[_0xebdc('0x11')]);router[_0xebdc('0x12')](_0xebdc('0xe'),auth[_0xebdc('0xa')](),controller['update']);router[_0xebdc('0x13')](_0xebdc('0xe'),auth[_0xebdc('0xa')](),controller[_0xebdc('0x14')]);module[_0xebdc('0x15')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index df833a7..656c51e 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 _0x1eba=['join','getDataValue','split','sequelize','exports','STRING','INTEGER','setDataValue','crudPermissions'];(function(_0x29f90e,_0x136dbd){var _0x2ed1e2=function(_0x6e8ba0){while(--_0x6e8ba0){_0x29f90e['push'](_0x29f90e['shift']());}};_0x2ed1e2(++_0x136dbd);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x1eba[_0x47e7cb];return _0x2a8874;};'use strict';var Sequelize=require(_0xa1eb('0x0'));module[_0xa1eb('0x1')]={'name':{'type':Sequelize[_0xa1eb('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0xa1eb('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xa1eb('0x3')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xa1eb('0x2')],'set':function(_0x34be5a){this[_0xa1eb('0x4')](_0xa1eb('0x5'),_0x34be5a?_0x34be5a[_0xa1eb('0x6')](''):[]);},'get':function(){return this[_0xa1eb('0x7')](_0xa1eb('0x5'))?this[_0xa1eb('0x7')](_0xa1eb('0x5'))[_0xa1eb('0x8')](''):[];}}}; \ No newline at end of file +var _0x4fc2=['split','sequelize','exports','STRING','BOOLEAN','setDataValue','crudPermissions','getDataValue'];(function(_0x462999,_0x24d200){var _0x4b1366=function(_0x1fa353){while(--_0x1fa353){_0x462999['push'](_0x462999['shift']());}};_0x4b1366(++_0x24d200);}(_0x4fc2,0x111));var _0x24fc=function(_0x2b11c8,_0x20be4f){_0x2b11c8=_0x2b11c8-0x0;var _0x4c0768=_0x4fc2[_0x2b11c8];return _0x4c0768;};'use strict';var Sequelize=require(_0x24fc('0x0'));module[_0x24fc('0x1')]={'name':{'type':Sequelize[_0x24fc('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x24fc('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x24fc('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x24fc('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x24fc('0x2')],'set':function(_0x541ad2){this[_0x24fc('0x4')](_0x24fc('0x5'),_0x541ad2?_0x541ad2['join'](''):[]);},'get':function(){return this[_0x24fc('0x6')](_0x24fc('0x5'))?this['getDataValue'](_0x24fc('0x5'))[_0x24fc('0x7')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 553f088..05c5a91 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 _0x4a30=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','UserProfileSection','then','includeAll','findAll','catch','show','params','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','offset','limit','undefined','count','set','Content-Range','json','reject','save','update','destroy','end','error','name','status','send','index','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes'];(function(_0x563ae3,_0x1df974){var _0x1138cc=function(_0xa0d0b5){while(--_0xa0d0b5){_0x563ae3['push'](_0x563ae3['shift']());}};_0x1138cc(++_0x1df974);}(_0x4a30,0x187));var _0x04a3=function(_0x25d045,_0xf2dc23){_0x25d045=_0x25d045-0x0;var _0xb0a183=_0x4a30[_0x25d045];return _0xb0a183;};'use strict';var emlformat=require(_0x04a3('0x0'));var rimraf=require(_0x04a3('0x1'));var zipdir=require(_0x04a3('0x2'));var jsonpatch=require(_0x04a3('0x3'));var rp=require(_0x04a3('0x4'));var moment=require(_0x04a3('0x5'));var BPromise=require(_0x04a3('0x6'));var Mustache=require('mustache');var util=require(_0x04a3('0x7'));var path=require(_0x04a3('0x8'));var sox=require(_0x04a3('0x9'));var csv=require(_0x04a3('0xa'));var ejs=require(_0x04a3('0xb'));var fs=require('fs');var fs_extra=require(_0x04a3('0xc'));var _=require(_0x04a3('0xd'));var squel=require(_0x04a3('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x04a3('0xf'));var toCsv=require('to-csv');var querystring=require(_0x04a3('0x10'));var Papa=require(_0x04a3('0x11'));var Redis=require(_0x04a3('0x12'));var authService=require(_0x04a3('0x13'));var qs=require(_0x04a3('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x04a3('0x15'))(_0x04a3('0x16'));var utils=require('../../config/utils');var config=require(_0x04a3('0x17'));var licenseUtil=require(_0x04a3('0x18'));var db=require(_0x04a3('0x19'))['db'];function respondWithStatusCode(_0x5a5b2e,_0x5735e7){_0x5735e7=_0x5735e7||0xcc;return function(_0x548f94){if(_0x548f94){return _0x5a5b2e['sendStatus'](_0x5735e7);}return _0x5a5b2e['status'](_0x5735e7)['end']();};}function respondWithResult(_0x509b15,_0x4fb00b){_0x4fb00b=_0x4fb00b||0xc8;return function(_0x168ca7){if(_0x168ca7){return _0x509b15['status'](_0x4fb00b)['json'](_0x168ca7);}};}function respondWithFilteredResult(_0x49ef02,_0x3640e3){return function(_0x5c58f4){if(_0x5c58f4){var _0x20ded7=typeof _0x3640e3[_0x04a3('0x1a')]==='undefined'&&typeof _0x3640e3[_0x04a3('0x1b')]===_0x04a3('0x1c');var _0x5bb6d5=_0x5c58f4[_0x04a3('0x1d')];var _0x23c9fb=_0x20ded7?0x0:_0x3640e3[_0x04a3('0x1a')];var _0x5ef211=_0x20ded7?_0x5c58f4[_0x04a3('0x1d')]:_0x3640e3['offset']+_0x3640e3[_0x04a3('0x1b')];var _0x101dbc;if(_0x5ef211>=_0x5bb6d5){_0x5ef211=_0x5bb6d5;_0x101dbc=0xc8;}else{_0x101dbc=0xce;}_0x49ef02['status'](_0x101dbc);return _0x49ef02[_0x04a3('0x1e')](_0x04a3('0x1f'),_0x23c9fb+'-'+_0x5ef211+'/'+_0x5bb6d5)[_0x04a3('0x20')](_0x5c58f4);}return null;};}function patchUpdates(_0x2732ae){return function(_0x58b0db){try{jsonpatch['apply'](_0x58b0db,_0x2732ae,!![]);}catch(_0x503ff9){return BPromise[_0x04a3('0x21')](_0x503ff9);}return _0x58b0db[_0x04a3('0x22')]();};}function saveUpdates(_0x222ddc,_0x42ddbb){return function(_0x52da8e){if(_0x52da8e){return _0x52da8e[_0x04a3('0x23')](_0x222ddc)['then'](function(_0x532b69){return _0x532b69;});}return null;};}function removeEntity(_0x13d70a,_0x269deb){return function(_0xa3a0b7){if(_0xa3a0b7){return _0xa3a0b7[_0x04a3('0x24')]()['then'](function(){_0x13d70a['status'](0xcc)[_0x04a3('0x25')]();});}};}function handleEntityNotFound(_0x333373,_0x543fe5){return function(_0x5afab7){if(!_0x5afab7){_0x333373['sendStatus'](0x194);}return _0x5afab7;};}function handleError(_0x57ec89,_0x314c95){_0x314c95=_0x314c95||0x1f4;return function(_0x2a53ea){logger[_0x04a3('0x26')](_0x2a53ea['stack']);if(_0x2a53ea[_0x04a3('0x27')]){delete _0x2a53ea[_0x04a3('0x27')];}_0x57ec89[_0x04a3('0x28')](_0x314c95)[_0x04a3('0x29')](_0x2a53ea);};}exports[_0x04a3('0x2a')]=function(_0x4a85b0,_0xa95db6){var _0x52e217={},_0x501fe8={},_0x43f832={'count':0x0,'rows':[]};var _0x23f9f5=_['map'](db['UserProfileSection'][_0x04a3('0x2b')],function(_0xb8c460){return{'name':_0xb8c460['fieldName'],'type':_0xb8c460[_0x04a3('0x2c')][_0x04a3('0x2d')]};});_0x501fe8[_0x04a3('0x2e')]=_['map'](_0x23f9f5,_0x04a3('0x27'));_0x501fe8[_0x04a3('0x2f')]=_[_0x04a3('0x30')](_0x4a85b0[_0x04a3('0x2f')]);_0x501fe8[_0x04a3('0x31')]=_[_0x04a3('0x32')](_0x501fe8['model'],_0x501fe8['query']);_0x52e217['attributes']=_[_0x04a3('0x32')](_0x501fe8['model'],qs[_0x04a3('0x33')](_0x4a85b0[_0x04a3('0x2f')][_0x04a3('0x33')]));_0x52e217['attributes']=_0x52e217[_0x04a3('0x34')][_0x04a3('0x35')]?_0x52e217['attributes']:_0x501fe8['model'];if(!_0x4a85b0[_0x04a3('0x2f')][_0x04a3('0x36')](_0x04a3('0x37'))){_0x52e217[_0x04a3('0x1b')]=qs[_0x04a3('0x1b')](_0x4a85b0[_0x04a3('0x2f')]['limit']);_0x52e217[_0x04a3('0x1a')]=qs[_0x04a3('0x1a')](_0x4a85b0['query'][_0x04a3('0x1a')]);}_0x52e217[_0x04a3('0x38')]=qs[_0x04a3('0x39')](_0x4a85b0[_0x04a3('0x2f')]['sort']);_0x52e217[_0x04a3('0x3a')]=qs['filters'](_[_0x04a3('0x3b')](_0x4a85b0[_0x04a3('0x2f')],_0x501fe8[_0x04a3('0x31')]),_0x23f9f5);if(_0x4a85b0[_0x04a3('0x2f')][_0x04a3('0x3c')]){_0x52e217[_0x04a3('0x3a')]=_[_0x04a3('0x3d')](_0x52e217[_0x04a3('0x3a')],{'$or':_['map'](_0x23f9f5,function(_0x2e46c){if(_0x2e46c[_0x04a3('0x2c')]!==_0x04a3('0x3e')){var _0x4dc441={};_0x4dc441[_0x2e46c[_0x04a3('0x27')]]={'$like':'%'+_0x4a85b0['query'][_0x04a3('0x3c')]+'%'};return _0x4dc441;}})});}_0x52e217=_[_0x04a3('0x3d')]({},_0x52e217,_0x4a85b0[_0x04a3('0x3f')]);var _0x21a7b4={'where':_0x52e217[_0x04a3('0x3a')]};return db[_0x04a3('0x40')][_0x04a3('0x1d')](_0x21a7b4)[_0x04a3('0x41')](function(_0x4f45a9){_0x43f832[_0x04a3('0x1d')]=_0x4f45a9;if(_0x4a85b0[_0x04a3('0x2f')][_0x04a3('0x42')]){_0x52e217['include']=[{'all':!![]}];}return db[_0x04a3('0x40')][_0x04a3('0x43')](_0x52e217);})[_0x04a3('0x41')](function(_0x302f93){_0x43f832['rows']=_0x302f93;return _0x43f832;})[_0x04a3('0x41')](respondWithFilteredResult(_0xa95db6,_0x52e217))[_0x04a3('0x44')](handleError(_0xa95db6,null));};exports[_0x04a3('0x45')]=function(_0x55a643,_0x489ffb){var _0xbea6c9={'raw':![],'where':{'id':_0x55a643[_0x04a3('0x46')]['id']}},_0x24f294={};_0x24f294[_0x04a3('0x2e')]=_[_0x04a3('0x30')](db['UserProfileSection'][_0x04a3('0x2b')]);_0x24f294[_0x04a3('0x2f')]=_['keys'](_0x55a643[_0x04a3('0x2f')]);_0x24f294['filters']=_['intersection'](_0x24f294[_0x04a3('0x2e')],_0x24f294[_0x04a3('0x2f')]);_0xbea6c9[_0x04a3('0x34')]=_['intersection'](_0x24f294['model'],qs[_0x04a3('0x33')](_0x55a643[_0x04a3('0x2f')][_0x04a3('0x33')]));_0xbea6c9[_0x04a3('0x34')]=_0xbea6c9[_0x04a3('0x34')][_0x04a3('0x35')]?_0xbea6c9[_0x04a3('0x34')]:_0x24f294[_0x04a3('0x2e')];if(_0x55a643[_0x04a3('0x2f')][_0x04a3('0x42')]){_0xbea6c9['include']=[{'all':!![]}];}_0xbea6c9=_[_0x04a3('0x3d')]({},_0xbea6c9,_0x55a643['options']);return db['UserProfileSection']['find'](_0xbea6c9)[_0x04a3('0x41')](handleEntityNotFound(_0x489ffb,null))['then'](respondWithResult(_0x489ffb,null))[_0x04a3('0x44')](handleError(_0x489ffb,null));};exports[_0x04a3('0x47')]=function(_0x23da36,_0x2fb0c8){return db['UserProfileSection'][_0x04a3('0x47')](_0x23da36['body'],{})[_0x04a3('0x41')](respondWithResult(_0x2fb0c8,0xc9))[_0x04a3('0x44')](handleError(_0x2fb0c8,null));};exports[_0x04a3('0x23')]=function(_0x1a7c5d,_0x4dc883){if(_0x1a7c5d[_0x04a3('0x48')]['id']){delete _0x1a7c5d[_0x04a3('0x48')]['id'];}return db[_0x04a3('0x40')][_0x04a3('0x49')]({'where':{'id':_0x1a7c5d[_0x04a3('0x46')]['id']}})['then'](handleEntityNotFound(_0x4dc883,null))[_0x04a3('0x41')](saveUpdates(_0x1a7c5d[_0x04a3('0x48')],null))[_0x04a3('0x41')](respondWithResult(_0x4dc883,null))[_0x04a3('0x44')](handleError(_0x4dc883,null));};exports[_0x04a3('0x24')]=function(_0x2ff559,_0x49a6a1){return db[_0x04a3('0x40')][_0x04a3('0x49')]({'where':{'id':_0x2ff559['params']['id']}})[_0x04a3('0x41')](handleEntityNotFound(_0x49a6a1,null))['then'](removeEntity(_0x49a6a1,null))['catch'](handleError(_0x49a6a1,null));};exports['describe']=function(_0x22d539,_0x2fb11a){return db[_0x04a3('0x40')]['describe']()[_0x04a3('0x41')](respondWithResult(_0x2fb11a,null))['catch'](handleError(_0x2fb11a,null));}; \ No newline at end of file +var _0x062e=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','error','stack','name','map','UserProfileSection','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','type','merge','options','includeAll','include','rows','show','params','find','catch','create','body','destroy','describe','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x3525f8,_0x675b35){var _0x4c4511=function(_0x55c3fd){while(--_0x55c3fd){_0x3525f8['push'](_0x3525f8['shift']());}};_0x4c4511(++_0x675b35);}(_0x062e,0x195));var _0xe062=function(_0x4c689a,_0x1620de){_0x4c689a=_0x4c689a-0x0;var _0x5ba1dd=_0x062e[_0x4c689a];return _0x5ba1dd;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe062('0x0'));var rp=require('request-promise');var moment=require(_0xe062('0x1'));var BPromise=require(_0xe062('0x2'));var Mustache=require(_0xe062('0x3'));var util=require(_0xe062('0x4'));var path=require(_0xe062('0x5'));var sox=require(_0xe062('0x6'));var csv=require(_0xe062('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe062('0x8'));var crypto=require(_0xe062('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe062('0x7'));var querystring=require(_0xe062('0xa'));var Papa=require(_0xe062('0xb'));var Redis=require(_0xe062('0xc'));var authService=require(_0xe062('0xd'));var qs=require(_0xe062('0xe'));var as=require(_0xe062('0xf'));var hardwareService=require(_0xe062('0x10'));var logger=require(_0xe062('0x11'))(_0xe062('0x12'));var utils=require(_0xe062('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xe062('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x22ed7a,_0x31813c){_0x31813c=_0x31813c||0xcc;return function(_0x24a7d7){if(_0x24a7d7){return _0x22ed7a[_0xe062('0x15')](_0x31813c);}return _0x22ed7a[_0xe062('0x16')](_0x31813c)[_0xe062('0x17')]();};}function respondWithResult(_0x9565f8,_0x2d02cd){_0x2d02cd=_0x2d02cd||0xc8;return function(_0x26deeb){if(_0x26deeb){return _0x9565f8['status'](_0x2d02cd)[_0xe062('0x18')](_0x26deeb);}};}function respondWithFilteredResult(_0x3012f8,_0x5cc596){return function(_0x32c2fa){if(_0x32c2fa){var _0x4b70e7=typeof _0x5cc596[_0xe062('0x19')]===_0xe062('0x1a')&&typeof _0x5cc596[_0xe062('0x1b')]===_0xe062('0x1a');var _0x201f8a=_0x32c2fa[_0xe062('0x1c')];var _0x43aff4=_0x4b70e7?0x0:_0x5cc596['offset'];var _0x390b94=_0x4b70e7?_0x32c2fa['count']:_0x5cc596[_0xe062('0x19')]+_0x5cc596[_0xe062('0x1b')];var _0x51b677;if(_0x390b94>=_0x201f8a){_0x390b94=_0x201f8a;_0x51b677=0xc8;}else{_0x51b677=0xce;}_0x3012f8['status'](_0x51b677);return _0x3012f8['set'](_0xe062('0x1d'),_0x43aff4+'-'+_0x390b94+'/'+_0x201f8a)[_0xe062('0x18')](_0x32c2fa);}return null;};}function patchUpdates(_0x30b7ee){return function(_0x2fa8c1){try{jsonpatch[_0xe062('0x1e')](_0x2fa8c1,_0x30b7ee,!![]);}catch(_0x7d9dcc){return BPromise[_0xe062('0x1f')](_0x7d9dcc);}return _0x2fa8c1['save']();};}function saveUpdates(_0x4d3226,_0x5a8aef){return function(_0x10cb24){if(_0x10cb24){return _0x10cb24[_0xe062('0x20')](_0x4d3226)[_0xe062('0x21')](function(_0x4823c9){return _0x4823c9;});}return null;};}function removeEntity(_0x5ad507,_0x3a40c1){return function(_0x5e81de){if(_0x5e81de){return _0x5e81de['destroy']()[_0xe062('0x21')](function(){_0x5ad507[_0xe062('0x16')](0xcc)[_0xe062('0x17')]();});}};}function handleEntityNotFound(_0x383ecf,_0x2d3851){return function(_0x578de6){if(!_0x578de6){_0x383ecf[_0xe062('0x15')](0x194);}return _0x578de6;};}function handleError(_0x6bd041,_0x1c159d){_0x1c159d=_0x1c159d||0x1f4;return function(_0x543a66){logger[_0xe062('0x22')](_0x543a66[_0xe062('0x23')]);if(_0x543a66[_0xe062('0x24')]){delete _0x543a66['name'];}_0x6bd041[_0xe062('0x16')](_0x1c159d)['send'](_0x543a66);};}exports['index']=function(_0x4563e1,_0x5d1d5b){var _0x1474ff={},_0x2d4eb2={},_0x46b86a={'count':0x0,'rows':[]};var _0x2edf7b=_[_0xe062('0x25')](db[_0xe062('0x26')][_0xe062('0x27')],function(_0x551303){return{'name':_0x551303[_0xe062('0x28')],'type':_0x551303['type'][_0xe062('0x29')]};});_0x2d4eb2[_0xe062('0x2a')]=_[_0xe062('0x25')](_0x2edf7b,_0xe062('0x24'));_0x2d4eb2[_0xe062('0x2b')]=_[_0xe062('0x2c')](_0x4563e1[_0xe062('0x2b')]);_0x2d4eb2[_0xe062('0x2d')]=_[_0xe062('0x2e')](_0x2d4eb2[_0xe062('0x2a')],_0x2d4eb2[_0xe062('0x2b')]);_0x1474ff['attributes']=_[_0xe062('0x2e')](_0x2d4eb2[_0xe062('0x2a')],qs['fields'](_0x4563e1[_0xe062('0x2b')][_0xe062('0x2f')]));_0x1474ff[_0xe062('0x30')]=_0x1474ff[_0xe062('0x30')][_0xe062('0x31')]?_0x1474ff[_0xe062('0x30')]:_0x2d4eb2[_0xe062('0x2a')];if(!_0x4563e1[_0xe062('0x2b')]['hasOwnProperty'](_0xe062('0x32'))){_0x1474ff[_0xe062('0x1b')]=qs[_0xe062('0x1b')](_0x4563e1['query'][_0xe062('0x1b')]);_0x1474ff['offset']=qs[_0xe062('0x19')](_0x4563e1[_0xe062('0x2b')][_0xe062('0x19')]);}_0x1474ff[_0xe062('0x33')]=qs[_0xe062('0x34')](_0x4563e1[_0xe062('0x2b')]['sort']);_0x1474ff[_0xe062('0x35')]=qs[_0xe062('0x2d')](_[_0xe062('0x36')](_0x4563e1[_0xe062('0x2b')],_0x2d4eb2[_0xe062('0x2d')]),_0x2edf7b);if(_0x4563e1[_0xe062('0x2b')][_0xe062('0x37')]){_0x1474ff['where']=_['merge'](_0x1474ff['where'],{'$or':_[_0xe062('0x25')](_0x2edf7b,function(_0x23718e){if(_0x23718e[_0xe062('0x38')]!=='VIRTUAL'){var _0x199d25={};_0x199d25[_0x23718e[_0xe062('0x24')]]={'$like':'%'+_0x4563e1['query']['filter']+'%'};return _0x199d25;}})});}_0x1474ff=_[_0xe062('0x39')]({},_0x1474ff,_0x4563e1[_0xe062('0x3a')]);var _0x4676f1={'where':_0x1474ff[_0xe062('0x35')]};return db['UserProfileSection'][_0xe062('0x1c')](_0x4676f1)['then'](function(_0x4cf1fb){_0x46b86a[_0xe062('0x1c')]=_0x4cf1fb;if(_0x4563e1[_0xe062('0x2b')][_0xe062('0x3b')]){_0x1474ff[_0xe062('0x3c')]=[{'all':!![]}];}return db['UserProfileSection']['findAll'](_0x1474ff);})[_0xe062('0x21')](function(_0x1becce){_0x46b86a[_0xe062('0x3d')]=_0x1becce;return _0x46b86a;})['then'](respondWithFilteredResult(_0x5d1d5b,_0x1474ff))['catch'](handleError(_0x5d1d5b,null));};exports[_0xe062('0x3e')]=function(_0x4f3f20,_0x5c3301){var _0x5f026d={'raw':![],'where':{'id':_0x4f3f20[_0xe062('0x3f')]['id']}},_0x343e52={};_0x343e52[_0xe062('0x2a')]=_[_0xe062('0x2c')](db['UserProfileSection'][_0xe062('0x27')]);_0x343e52[_0xe062('0x2b')]=_[_0xe062('0x2c')](_0x4f3f20[_0xe062('0x2b')]);_0x343e52[_0xe062('0x2d')]=_[_0xe062('0x2e')](_0x343e52[_0xe062('0x2a')],_0x343e52['query']);_0x5f026d[_0xe062('0x30')]=_['intersection'](_0x343e52[_0xe062('0x2a')],qs[_0xe062('0x2f')](_0x4f3f20['query']['fields']));_0x5f026d[_0xe062('0x30')]=_0x5f026d[_0xe062('0x30')][_0xe062('0x31')]?_0x5f026d[_0xe062('0x30')]:_0x343e52['model'];if(_0x4f3f20['query']['includeAll']){_0x5f026d[_0xe062('0x3c')]=[{'all':!![]}];}_0x5f026d=_[_0xe062('0x39')]({},_0x5f026d,_0x4f3f20[_0xe062('0x3a')]);return db[_0xe062('0x26')][_0xe062('0x40')](_0x5f026d)[_0xe062('0x21')](handleEntityNotFound(_0x5c3301,null))[_0xe062('0x21')](respondWithResult(_0x5c3301,null))[_0xe062('0x41')](handleError(_0x5c3301,null));};exports[_0xe062('0x42')]=function(_0x1faa7e,_0x5c6271){return db[_0xe062('0x26')]['create'](_0x1faa7e['body'],{})[_0xe062('0x21')](respondWithResult(_0x5c6271,0xc9))['catch'](handleError(_0x5c6271,null));};exports[_0xe062('0x20')]=function(_0x447460,_0x582d07){if(_0x447460[_0xe062('0x43')]['id']){delete _0x447460[_0xe062('0x43')]['id'];}return db['UserProfileSection']['find']({'where':{'id':_0x447460[_0xe062('0x3f')]['id']}})[_0xe062('0x21')](handleEntityNotFound(_0x582d07,null))[_0xe062('0x21')](saveUpdates(_0x447460['body'],null))[_0xe062('0x21')](respondWithResult(_0x582d07,null))[_0xe062('0x41')](handleError(_0x582d07,null));};exports[_0xe062('0x44')]=function(_0x1825f5,_0x5f2252){return db['UserProfileSection'][_0xe062('0x40')]({'where':{'id':_0x1825f5['params']['id']}})['then'](handleEntityNotFound(_0x5f2252,null))[_0xe062('0x21')](removeEntity(_0x5f2252,null))[_0xe062('0x41')](handleError(_0x5f2252,null));};exports[_0xe062('0x45')]=function(_0x372088,_0x2712c2){return db[_0xe062('0x26')][_0xe062('0x45')]()['then'](respondWithResult(_0x2712c2,null))['catch'](handleError(_0x2712c2,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index bdf3dd1..e1f7e80 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 _0xa541=['util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','compositeIndex','sectionId','userProfileId','lodash'];(function(_0x13bf2b,_0x2c10d3){var _0x2cd230=function(_0x4ebf0d){while(--_0x4ebf0d){_0x13bf2b['push'](_0x13bf2b['shift']());}};_0x2cd230(++_0x2c10d3);}(_0xa541,0xcb));var _0x1a54=function(_0x1130b6,_0xb58cb8){_0x1130b6=_0x1130b6-0x0;var _0x1da4ff=_0xa541[_0x1130b6];return _0x1da4ff;};'use strict';var _=require(_0x1a54('0x0'));var util=require(_0x1a54('0x1'));var logger=require(_0x1a54('0x2'))('api');var moment=require('moment');var BPromise=require(_0x1a54('0x3'));var rp=require(_0x1a54('0x4'));var fs=require('fs');var path=require(_0x1a54('0x5'));var rimraf=require(_0x1a54('0x6'));var config=require(_0x1a54('0x7'));var attributes=require(_0x1a54('0x8'));module['exports']=function(_0x4166e8,_0x17a35f){return _0x4166e8['define']('UserProfileSection',attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0x1a54('0x9'),'fields':[_0x1a54('0xa'),_0x1a54('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4b8c=['lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId'];(function(_0x43afbb,_0x448109){var _0xa9ddec=function(_0x4e965f){while(--_0x4e965f){_0x43afbb['push'](_0x43afbb['shift']());}};_0xa9ddec(++_0x448109);}(_0x4b8c,0xa8));var _0xc4b8=function(_0x522104,_0x260bde){_0x522104=_0x522104-0x0;var _0x552027=_0x4b8c[_0x522104];return _0x552027;};'use strict';var _=require(_0xc4b8('0x0'));var util=require(_0xc4b8('0x1'));var logger=require(_0xc4b8('0x2'))(_0xc4b8('0x3'));var moment=require(_0xc4b8('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc4b8('0x5'));var rimraf=require(_0xc4b8('0x6'));var config=require(_0xc4b8('0x7'));var attributes=require('./userProfileSection.attributes');module[_0xc4b8('0x8')]=function(_0x2e9528,_0x17fc81){return _0x2e9528['define'](_0xc4b8('0x9'),attributes,{'tableName':_0xc4b8('0xa'),'paranoid':![],'indexes':[{'name':_0xc4b8('0xb'),'fields':[_0xc4b8('0xc'),_0xc4b8('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 665d63a..c527250 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 _0x2792=['request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','moment','bluebird','randomstring','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s'];(function(_0x4934a8,_0x4a10e5){var _0x1ab798=function(_0x1d298d){while(--_0x1d298d){_0x4934a8['push'](_0x4934a8['shift']());}};_0x1ab798(++_0x4a10e5);}(_0x2792,0x183));var _0x2279=function(_0x3bca2d,_0x1af8f4){_0x3bca2d=_0x3bca2d-0x0;var _0x144a7c=_0x2792[_0x3bca2d];return _0x144a7c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2279('0x0'));var BPromise=require(_0x2279('0x1'));var rs=require(_0x2279('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2279('0x3'));var config=require(_0x2279('0x4'));var jayson=require(_0x2279('0x5'));var client=jayson[_0x2279('0x6')][_0x2279('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5b1625,_0x278884,_0x1e9d5a){return new BPromise(function(_0x23fa43,_0x52f538){return client[_0x2279('0x8')](_0x5b1625,_0x1e9d5a)[_0x2279('0x9')](function(_0x2eec3f){logger[_0x2279('0xa')](_0x2279('0xb'),_0x278884,_0x2279('0xc'));logger[_0x2279('0xd')](_0x2279('0xe'),_0x278884,_0x2279('0xc'),JSON[_0x2279('0xf')](_0x2eec3f));if(_0x2eec3f[_0x2279('0x10')]){if(_0x2eec3f['error'][_0x2279('0x11')]===0x1f4){logger[_0x2279('0x10')](_0x2279('0xb'),_0x278884,_0x2eec3f['error'][_0x2279('0x12')]);return _0x52f538(_0x2eec3f[_0x2279('0x10')][_0x2279('0x12')]);}logger[_0x2279('0x10')](_0x2279('0xb'),_0x278884,_0x2eec3f[_0x2279('0x10')][_0x2279('0x12')]);return _0x23fa43(_0x2eec3f['error']['message']);}else{logger[_0x2279('0xa')]('UserProfileSection,\x20%s,\x20%s',_0x278884,_0x2279('0xc'));_0x23fa43(_0x2eec3f['result'][_0x2279('0x12')]);}})['catch'](function(_0xdd33e0){logger[_0x2279('0x10')]('UserProfileSection,\x20%s,\x20%s',_0x278884,_0xdd33e0);_0x52f538(_0xdd33e0);});});} \ No newline at end of file +var _0xc362=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird'];(function(_0x29982b,_0x594e0){var _0xb1f0a9=function(_0x3d824c){while(--_0x3d824c){_0x29982b['push'](_0x29982b['shift']());}};_0xb1f0a9(++_0x594e0);}(_0xc362,0x82));var _0x2c36=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc362[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x2c36('0x0'));var moment=require('moment');var BPromise=require(_0x2c36('0x1'));var rs=require(_0x2c36('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2c36('0x3'))['db'];var utils=require(_0x2c36('0x4'));var logger=require(_0x2c36('0x5'))(_0x2c36('0x6'));var config=require('../../config/environment');var jayson=require(_0x2c36('0x7'));var client=jayson[_0x2c36('0x8')][_0x2c36('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5e3bd5,_0x9487e9,_0x339327){return new BPromise(function(_0x6ffceb,_0x45bdec){return client[_0x2c36('0xa')](_0x5e3bd5,_0x339327)[_0x2c36('0xb')](function(_0x501e97){logger[_0x2c36('0xc')](_0x2c36('0xd'),_0x9487e9,_0x2c36('0xe'));logger['debug'](_0x2c36('0xf'),_0x9487e9,_0x2c36('0xe'),JSON[_0x2c36('0x10')](_0x501e97));if(_0x501e97[_0x2c36('0x11')]){if(_0x501e97[_0x2c36('0x11')][_0x2c36('0x12')]===0x1f4){logger[_0x2c36('0x11')](_0x2c36('0xd'),_0x9487e9,_0x501e97['error']['message']);return _0x45bdec(_0x501e97[_0x2c36('0x11')][_0x2c36('0x13')]);}logger[_0x2c36('0x11')](_0x2c36('0xd'),_0x9487e9,_0x501e97[_0x2c36('0x11')][_0x2c36('0x13')]);return _0x6ffceb(_0x501e97[_0x2c36('0x11')][_0x2c36('0x13')]);}else{logger['info'](_0x2c36('0xd'),_0x9487e9,_0x2c36('0xe'));_0x6ffceb(_0x501e97[_0x2c36('0x14')][_0x2c36('0x13')]);}})[_0x2c36('0x15')](function(_0x22cb9a){logger[_0x2c36('0x11')]('UserProfileSection,\x20%s,\x20%s',_0x9487e9,_0x22cb9a);_0x45bdec(_0x22cb9a);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 45bfd6e..e7baf5c 100644 --- a/server/api/userSmsQueue/index.js +++ b/server/api/userSmsQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x16fa84,_0x3820e3){var _0x464f8d=function(_0x2de795){while(--_0x2de795){_0x16fa84['push'](_0x16fa84['shift']());}};_0x464f8d(++_0x3820e3);}(_0x70e0,0x17b));var _0x070e=function(_0x1348bd,_0x5956de){_0x1348bd=_0x1348bd-0x0;var _0x53ca2a=_0x70e0[_0x1348bd];return _0x53ca2a;};'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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x32096b,_0x425f04){var _0xfdc092=function(_0x4c970a){while(--_0x4c970a){_0x32096b['push'](_0x32096b['shift']());}};_0xfdc092(++_0x425f04);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 84d729b..09f7a88 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 _0xd326=['INTEGER','sequelize'];(function(_0xc77819,_0x139fdc){var _0x1c9434=function(_0x11d15d){while(--_0x11d15d){_0xc77819['push'](_0xc77819['shift']());}};_0x1c9434(++_0x139fdc);}(_0xd326,0xa7));var _0x6d32=function(_0x2ee1ea,_0x2240b2){_0x2ee1ea=_0x2ee1ea-0x0;var _0x5f3acf=_0xd326[_0x2ee1ea];return _0x5f3acf;};'use strict';var Sequelize=require(_0x6d32('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x6d32('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc556=['INTEGER','sequelize'];(function(_0x14feed,_0x49d56d){var _0x3e939c=function(_0x3685e7){while(--_0x3685e7){_0x14feed['push'](_0x14feed['shift']());}};_0x3e939c(++_0x49d56d);}(_0xc556,0xc3));var _0x6c55=function(_0x35ef47,_0x4590ae){_0x35ef47=_0x35ef47-0x0;var _0x3a8b18=_0xc556[_0x35ef47];return _0x3a8b18;};'use strict';var Sequelize=require(_0x6c55('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x6c55('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 012f25a..3de264f 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 _0x82d8=['define','UserSmsQueue','user_has_sms_queues','lodash','../../config/logger','bluebird','path','./userSmsQueue.attributes','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x82d8,0xff));var _0x882d=function(_0x4b7117,_0x387bcc){_0x4b7117=_0x4b7117-0x0;var _0x49cd21=_0x82d8[_0x4b7117];return _0x49cd21;};'use strict';var _=require(_0x882d('0x0'));var util=require('util');var logger=require(_0x882d('0x1'))('api');var moment=require('moment');var BPromise=require(_0x882d('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x882d('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x882d('0x4'));module[_0x882d('0x5')]=function(_0x19f644,_0xa928f7){return _0x19f644[_0x882d('0x6')](_0x882d('0x7'),attributes,{'tableName':_0x882d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd117=['request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x16dbfd,_0x2f9431){var _0x382254=function(_0x19dade){while(--_0x19dade){_0x16dbfd['push'](_0x16dbfd['shift']());}};_0x382254(++_0x2f9431);}(_0xd117,0x182));var _0x7d11=function(_0xf2726b,_0x87deb7){_0xf2726b=_0xf2726b-0x0;var _0xa61a5=_0xd117[_0xf2726b];return _0xa61a5;};'use strict';var _=require(_0x7d11('0x0'));var util=require(_0x7d11('0x1'));var logger=require(_0x7d11('0x2'))(_0x7d11('0x3'));var moment=require(_0x7d11('0x4'));var BPromise=require(_0x7d11('0x5'));var rp=require(_0x7d11('0x6'));var fs=require('fs');var path=require(_0x7d11('0x7'));var rimraf=require(_0x7d11('0x8'));var config=require(_0x7d11('0x9'));var attributes=require(_0x7d11('0xa'));module[_0x7d11('0xb')]=function(_0x27d7e8,_0x40c3c4){return _0x27d7e8[_0x7d11('0xc')](_0x7d11('0xd'),attributes,{'tableName':'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 127b631..20bd1b2 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 _0xb208=['then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','code','message','error','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x217605,_0x347798){var _0x13b50e=function(_0x462e40){while(--_0x462e40){_0x217605['push'](_0x217605['shift']());}};_0x13b50e(++_0x347798);}(_0xb208,0x135));var _0x8b20=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xb208[_0x432682];return _0x463d05;};'use strict';var _=require(_0x8b20('0x0'));var util=require(_0x8b20('0x1'));var moment=require('moment');var BPromise=require(_0x8b20('0x2'));var rs=require(_0x8b20('0x3'));var fs=require('fs');var Redis=require(_0x8b20('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8b20('0x5'));var logger=require(_0x8b20('0x6'))(_0x8b20('0x7'));var config=require(_0x8b20('0x8'));var jayson=require(_0x8b20('0x9'));var client=jayson[_0x8b20('0xa')][_0x8b20('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5598c1,_0x29729c,_0x5d4534){return new BPromise(function(_0x154f13,_0x27c40d){return client[_0x8b20('0xc')](_0x5598c1,_0x5d4534)[_0x8b20('0xd')](function(_0x21f90d){logger[_0x8b20('0xe')](_0x8b20('0xf'),_0x29729c,_0x8b20('0x10'));logger[_0x8b20('0x11')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x29729c,_0x8b20('0x10'),JSON['stringify'](_0x21f90d));if(_0x21f90d['error']){if(_0x21f90d['error'][_0x8b20('0x12')]===0x1f4){logger['error'](_0x8b20('0xf'),_0x29729c,_0x21f90d['error'][_0x8b20('0x13')]);return _0x27c40d(_0x21f90d[_0x8b20('0x14')]['message']);}logger[_0x8b20('0x14')](_0x8b20('0xf'),_0x29729c,_0x21f90d['error'][_0x8b20('0x13')]);return _0x154f13(_0x21f90d[_0x8b20('0x14')]['message']);}else{logger['info'](_0x8b20('0xf'),_0x29729c,'request\x20sent');_0x154f13(_0x21f90d[_0x8b20('0x15')][_0x8b20('0x13')]);}})[_0x8b20('0x16')](function(_0x69a5f8){logger[_0x8b20('0x14')](_0x8b20('0xf'),_0x29729c,_0x69a5f8);_0x27c40d(_0x69a5f8);});});} \ No newline at end of file +var _0x5aea=['jayson/promise','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x470f97,_0x5b2035){var _0x32873e=function(_0x1fc7d7){while(--_0x1fc7d7){_0x470f97['push'](_0x470f97['shift']());}};_0x32873e(++_0x5b2035);}(_0x5aea,0x194));var _0xa5ae=function(_0x4adaf7,_0x2df54d){_0x4adaf7=_0x4adaf7-0x0;var _0x2e958b=_0x5aea[_0x4adaf7];return _0x2e958b;};'use strict';var _=require(_0xa5ae('0x0'));var util=require(_0xa5ae('0x1'));var moment=require(_0xa5ae('0x2'));var BPromise=require(_0xa5ae('0x3'));var rs=require(_0xa5ae('0x4'));var fs=require('fs');var Redis=require(_0xa5ae('0x5'));var db=require(_0xa5ae('0x6'))['db'];var utils=require(_0xa5ae('0x7'));var logger=require(_0xa5ae('0x8'))('rpc');var config=require(_0xa5ae('0x9'));var jayson=require(_0xa5ae('0xa'));var client=jayson['client'][_0xa5ae('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x456433,_0x2deae8,_0x4d1799){return new BPromise(function(_0x14223f,_0x41d3e2){return client[_0xa5ae('0xc')](_0x456433,_0x4d1799)[_0xa5ae('0xd')](function(_0x259942){logger[_0xa5ae('0xe')](_0xa5ae('0xf'),_0x2deae8,'request\x20sent');logger[_0xa5ae('0x10')](_0xa5ae('0x11'),_0x2deae8,_0xa5ae('0x12'),JSON['stringify'](_0x259942));if(_0x259942['error']){if(_0x259942[_0xa5ae('0x13')][_0xa5ae('0x14')]===0x1f4){logger[_0xa5ae('0x13')](_0xa5ae('0xf'),_0x2deae8,_0x259942['error']['message']);return _0x41d3e2(_0x259942[_0xa5ae('0x13')][_0xa5ae('0x15')]);}logger[_0xa5ae('0x13')](_0xa5ae('0xf'),_0x2deae8,_0x259942[_0xa5ae('0x13')]['message']);return _0x14223f(_0x259942[_0xa5ae('0x13')][_0xa5ae('0x15')]);}else{logger[_0xa5ae('0xe')](_0xa5ae('0xf'),_0x2deae8,'request\x20sent');_0x14223f(_0x259942['result'][_0xa5ae('0x15')]);}})[_0xa5ae('0x16')](function(_0x54b8a3){logger[_0xa5ae('0x13')](_0xa5ae('0xf'),_0x2deae8,_0x54b8a3);_0x41d3e2(_0x54b8a3);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 4585623..627d8ee 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 _0x01ee=['exports','INTEGER','sequelize'];(function(_0x1bc17f,_0x7ce6f4){var _0x4c41f7=function(_0x130ff8){while(--_0x130ff8){_0x1bc17f['push'](_0x1bc17f['shift']());}};_0x4c41f7(++_0x7ce6f4);}(_0x01ee,0xb0));var _0xe01e=function(_0xb7d0de,_0x405f33){_0xb7d0de=_0xb7d0de-0x0;var _0x57096b=_0x01ee[_0xb7d0de];return _0x57096b;};'use strict';var Sequelize=require(_0xe01e('0x0'));module[_0xe01e('0x1')]={'UserId':{'type':Sequelize[_0xe01e('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xe01e('0x2')]}}; \ No newline at end of file +var _0xa6fc=['exports','INTEGER'];(function(_0x4e8c3b,_0x3d2c83){var _0x5c5980=function(_0x16d111){while(--_0x16d111){_0x4e8c3b['push'](_0x4e8c3b['shift']());}};_0x5c5980(++_0x3d2c83);}(_0xa6fc,0x13c));var _0xca6f=function(_0x438bee,_0x31a3b5){_0x438bee=_0x438bee-0x0;var _0x4c0da2=_0xa6fc[_0x438bee];return _0x4c0da2;};'use strict';var Sequelize=require('sequelize');module[_0xca6f('0x0')]={'UserId':{'type':Sequelize[_0xca6f('0x1')]},'VoicePrefixId':{'type':Sequelize[_0xca6f('0x1')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 2654036..e2797c7 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(_0x2a0881,_0x164e1b){var _0x43ebca=function(_0x5abb2f){while(--_0x5abb2f){_0x2a0881['push'](_0x2a0881['shift']());}};_0x43ebca(++_0x164e1b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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(_0x1c9270,_0xd5cd19){var _0x285e51=function(_0x174e75){while(--_0x174e75){_0x1c9270['push'](_0x1c9270['shift']());}};_0x285e51(++_0xd5cd19);}(_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':'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 48eff44..9115520 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x14392f,_0x2cf9ae){var _0x3a5177=function(_0x3e47a7){while(--_0x3e47a7){_0x14392f['push'](_0x14392f['shift']());}};_0x3a5177(++_0x2cf9ae);}(_0xe706,0xa3));var _0x6e70=function(_0x57172c,_0x1df512){_0x57172c=_0x57172c-0x0;var _0x38e8a4=_0xe706[_0x57172c];return _0x38e8a4;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x4568f5,_0x5a9d87){var _0x598af5=function(_0x3fd2f6){while(--_0x3fd2f6){_0x4568f5['push'](_0x4568f5['shift']());}};_0x598af5(++_0x5a9d87);}(_0xe706,0xa3));var _0x6e70=function(_0x2c4a45,_0x8836e3){_0x2c4a45=_0x2c4a45-0x0;var _0x51c36e=_0xe706[_0x2c4a45];return _0x51c36e;};'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/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index aacd7f4..cbec150 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 _0xec52=['exports'];(function(_0xd98def,_0x19ebc7){var _0x55b182=function(_0x1d3372){while(--_0x1d3372){_0xd98def['push'](_0xd98def['shift']());}};_0x55b182(++_0x19ebc7);}(_0xec52,0x179));var _0x2ec5=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xec52[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require('sequelize');module[_0x2ec5('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xe58d=['INTEGER','sequelize','exports'];(function(_0x20c9d6,_0x160bea){var _0x3b8794=function(_0x56f346){while(--_0x56f346){_0x20c9d6['push'](_0x20c9d6['shift']());}};_0x3b8794(++_0x160bea);}(_0xe58d,0xac));var _0xde58=function(_0x5ef711,_0x3b45f8){_0x5ef711=_0x5ef711-0x0;var _0xb96bd7=_0xe58d[_0x5ef711];return _0xb96bd7;};'use strict';var Sequelize=require(_0xde58('0x0'));module[_0xde58('0x1')]={'penalty':{'type':Sequelize[_0xde58('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 195857f..3732297 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 _0xa7bd=['api','moment','bluebird','request-promise','rimraf','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues','util','../../config/logger'];(function(_0x272894,_0x562fb6){var _0x527bf9=function(_0x2ddf19){while(--_0x2ddf19){_0x272894['push'](_0x272894['shift']());}};_0x527bf9(++_0x562fb6);}(_0xa7bd,0xee));var _0xda7b=function(_0x43a6cd,_0x503d1a){_0x43a6cd=_0x43a6cd-0x0;var _0x5acb36=_0xa7bd[_0x43a6cd];return _0x5acb36;};'use strict';var _=require('lodash');var util=require(_0xda7b('0x0'));var logger=require(_0xda7b('0x1'))(_0xda7b('0x2'));var moment=require(_0xda7b('0x3'));var BPromise=require(_0xda7b('0x4'));var rp=require(_0xda7b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xda7b('0x6'));var config=require('../../config/environment');var attributes=require(_0xda7b('0x7'));module[_0xda7b('0x8')]=function(_0x11a0eb,_0x2c75f7){return _0x11a0eb[_0xda7b('0x9')](_0xda7b('0xa'),attributes,{'tableName':_0xda7b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3176=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','lodash','util','../../config/logger','api'];(function(_0x27be68,_0x23f689){var _0x276c14=function(_0x643f90){while(--_0x643f90){_0x27be68['push'](_0x27be68['shift']());}};_0x276c14(++_0x23f689);}(_0x3176,0x1d8));var _0x6317=function(_0x300da3,_0x4cb1c8){_0x300da3=_0x300da3-0x0;var _0x2bf5f0=_0x3176[_0x300da3];return _0x2bf5f0;};'use strict';var _=require(_0x6317('0x0'));var util=require(_0x6317('0x1'));var logger=require(_0x6317('0x2'))(_0x6317('0x3'));var moment=require(_0x6317('0x4'));var BPromise=require(_0x6317('0x5'));var rp=require(_0x6317('0x6'));var fs=require('fs');var path=require(_0x6317('0x7'));var rimraf=require(_0x6317('0x8'));var config=require(_0x6317('0x9'));var attributes=require(_0x6317('0xa'));module[_0x6317('0xb')]=function(_0x46f4c9,_0x354521){return _0x46f4c9[_0x6317('0xc')](_0x6317('0xd'),attributes,{'tableName':'user_has_voice_queues','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 dfb0886..d1df050 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 _0xfdeb=['lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','UserVoiceQueue,\x20%s,\x20%s','result','catch'];(function(_0x4ba9e0,_0x7406fc){var _0x5a4127=function(_0x882af2){while(--_0x882af2){_0x4ba9e0['push'](_0x4ba9e0['shift']());}};_0x5a4127(++_0x7406fc);}(_0xfdeb,0x170));var _0xbfde=function(_0x257642,_0x270a80){_0x257642=_0x257642-0x0;var _0x3d813b=_0xfdeb[_0x257642];return _0x3d813b;};'use strict';var _=require(_0xbfde('0x0'));var util=require(_0xbfde('0x1'));var moment=require(_0xbfde('0x2'));var BPromise=require(_0xbfde('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbfde('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbfde('0x5'));var logger=require(_0xbfde('0x6'))('rpc');var config=require(_0xbfde('0x7'));var jayson=require(_0xbfde('0x8'));var client=jayson[_0xbfde('0x9')][_0xbfde('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1fff61,_0x2e5724,_0x4b66e2){return new BPromise(function(_0x29a745,_0x33985f){return client[_0xbfde('0xb')](_0x1fff61,_0x4b66e2)[_0xbfde('0xc')](function(_0x42c8d4){logger[_0xbfde('0xd')]('UserVoiceQueue,\x20%s,\x20%s',_0x2e5724,_0xbfde('0xe'));logger[_0xbfde('0xf')](_0xbfde('0x10'),_0x2e5724,_0xbfde('0xe'),JSON[_0xbfde('0x11')](_0x42c8d4));if(_0x42c8d4[_0xbfde('0x12')]){if(_0x42c8d4[_0xbfde('0x12')]['code']===0x1f4){logger[_0xbfde('0x12')]('UserVoiceQueue,\x20%s,\x20%s',_0x2e5724,_0x42c8d4[_0xbfde('0x12')][_0xbfde('0x13')]);return _0x33985f(_0x42c8d4[_0xbfde('0x12')][_0xbfde('0x13')]);}logger[_0xbfde('0x12')]('UserVoiceQueue,\x20%s,\x20%s',_0x2e5724,_0x42c8d4[_0xbfde('0x12')][_0xbfde('0x13')]);return _0x29a745(_0x42c8d4['error']['message']);}else{logger[_0xbfde('0xd')](_0xbfde('0x14'),_0x2e5724,_0xbfde('0xe'));_0x29a745(_0x42c8d4[_0xbfde('0x15')]['message']);}})[_0xbfde('0x16')](function(_0x3ac306){logger[_0xbfde('0x12')]('UserVoiceQueue,\x20%s,\x20%s',_0x2e5724,_0x3ac306);_0x33985f(_0x3ac306);});});} \ No newline at end of file +var _0xf7f1=['request','then','info','request\x20sent','error','code','UserVoiceQueue,\x20%s,\x20%s','message','catch','lodash','util','moment','ioredis','../../config/utils','rpc','../../config/environment','client','http'];(function(_0x3cb21e,_0x11849a){var _0xeacd6a=function(_0xef5a2e){while(--_0xef5a2e){_0x3cb21e['push'](_0x3cb21e['shift']());}};_0xeacd6a(++_0x11849a);}(_0xf7f1,0x1cb));var _0x1f7f=function(_0x500c8e,_0x3221d3){_0x500c8e=_0x500c8e-0x0;var _0x15ff69=_0xf7f1[_0x500c8e];return _0x15ff69;};'use strict';var _=require(_0x1f7f('0x0'));var util=require(_0x1f7f('0x1'));var moment=require(_0x1f7f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1f7f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1f7f('0x4'));var logger=require('../../config/logger')(_0x1f7f('0x5'));var config=require(_0x1f7f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1f7f('0x7')][_0x1f7f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x34826b,_0x1c1a73,_0x96a60f){return new BPromise(function(_0x29dfe0,_0x4faaa0){return client[_0x1f7f('0x9')](_0x34826b,_0x96a60f)[_0x1f7f('0xa')](function(_0x50ee76){logger[_0x1f7f('0xb')]('UserVoiceQueue,\x20%s,\x20%s',_0x1c1a73,_0x1f7f('0xc'));logger['debug']('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x1c1a73,_0x1f7f('0xc'),JSON['stringify'](_0x50ee76));if(_0x50ee76['error']){if(_0x50ee76[_0x1f7f('0xd')][_0x1f7f('0xe')]===0x1f4){logger[_0x1f7f('0xd')](_0x1f7f('0xf'),_0x1c1a73,_0x50ee76['error'][_0x1f7f('0x10')]);return _0x4faaa0(_0x50ee76[_0x1f7f('0xd')][_0x1f7f('0x10')]);}logger[_0x1f7f('0xd')]('UserVoiceQueue,\x20%s,\x20%s',_0x1c1a73,_0x50ee76[_0x1f7f('0xd')][_0x1f7f('0x10')]);return _0x29dfe0(_0x50ee76[_0x1f7f('0xd')][_0x1f7f('0x10')]);}else{logger['info']('UserVoiceQueue,\x20%s,\x20%s',_0x1c1a73,_0x1f7f('0xc'));_0x29dfe0(_0x50ee76['result'][_0x1f7f('0x10')]);}})[_0x1f7f('0x11')](function(_0x584981){logger['error'](_0x1f7f('0xf'),_0x1c1a73,_0x584981);_0x4faaa0(_0x584981);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 2d1e1d3..9037b4f 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x1159d3,_0x51f60d){var _0x26d2ae=function(_0x207dd1){while(--_0x207dd1){_0x1159d3['push'](_0x1159d3['shift']());}};_0x26d2ae(++_0x51f60d);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x17a607,_0x483d05){var _0x42d0a6=function(_0x47c931){while(--_0x47c931){_0x17a607['push'](_0x17a607['shift']());}};_0x42d0a6(++_0x483d05);}(_0x70e0,0x17b));var _0x070e=function(_0x2ee743,_0xaa50be){_0x2ee743=_0x2ee743-0x0;var _0x4416b5=_0x70e0[_0x2ee743];return _0x4416b5;};'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/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 8b2cb3e..8a436bf 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 _0x29eb=['STRING','Required\x20by\x20Asterisk','queue_interface','sequelize','exports','INTEGER'];(function(_0x46490d,_0x4e8493){var _0x203203=function(_0x1eca03){while(--_0x1eca03){_0x46490d['push'](_0x46490d['shift']());}};_0x203203(++_0x4e8493);}(_0x29eb,0x1c5));var _0xb29e=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0x29eb[_0x3fba9f];return _0x192cf1;};'use strict';var Sequelize=require(_0xb29e('0x0'));module[_0xb29e('0x1')]={'uniqueid':{'type':Sequelize[_0xb29e('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0xb29e('0x3')],'allowNull':![],'comment':_0xb29e('0x4')},'UserId':{'type':Sequelize[_0xb29e('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb29e('0x5'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0xb29e('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0xb29e('0x3')],'allowNull':![],'unique':_0xb29e('0x5'),'comment':_0xb29e('0x4')},'penalty':{'type':Sequelize[_0xb29e('0x2')](0xb),'defaultValue':0x0,'comment':_0xb29e('0x4')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xb29e('0x4')}}; \ No newline at end of file +var _0x030a=['STRING','queue_interface','sequelize','exports','Required\x20by\x20Asterisk','INTEGER'];(function(_0x4e91c0,_0x1e4d49){var _0x89adbe=function(_0x3ce1c9){while(--_0x3ce1c9){_0x4e91c0['push'](_0x4e91c0['shift']());}};_0x89adbe(++_0x1e4d49);}(_0x030a,0xc2));var _0xa030=function(_0x546f9f,_0xcce640){_0x546f9f=_0x546f9f-0x0;var _0x3513dd=_0x030a[_0x546f9f];return _0x3513dd;};'use strict';var Sequelize=require(_0xa030('0x0'));module[_0xa030('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0xa030('0x2')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0xa030('0x2')},'UserId':{'type':Sequelize[_0xa030('0x3')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xa030('0x4')],'allowNull':![],'unique':_0xa030('0x5'),'comment':_0xa030('0x2')},'VoiceQueueId':{'type':Sequelize[_0xa030('0x3')],'allowNull':![]},'interface':{'type':Sequelize[_0xa030('0x4')],'allowNull':![],'unique':'queue_interface','comment':_0xa030('0x2')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xa030('0x2')},'paused':{'type':Sequelize[_0xa030('0x3')](0xb),'defaultValue':0x0,'comment':_0xa030('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index cc87a21..0b0c559 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 _0xea9f=['../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','hasOwnProperty','hook','exports','events'];(function(_0x2834be,_0x50ecbb){var _0x5d4db7=function(_0x40417f){while(--_0x40417f){_0x2834be['push'](_0x2834be['shift']());}};_0x5d4db7(++_0x50ecbb);}(_0xea9f,0x97));var _0xfea9=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xea9f[_0xfae23b];return _0x200640;};'use strict';var EventEmitter=require(_0xfea9('0x0'));var UserVoiceQueueRt=require(_0xfea9('0x1'))['db'][_0xfea9('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xfea9('0x3')](0x0);var events={'afterCreate':_0xfea9('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4353a7){return function(_0x180db4,_0x4e8317,_0x46d92d){UserVoiceQueueRtEvents['emit'](_0x4353a7+':'+_0x180db4['id'],_0x180db4);UserVoiceQueueRtEvents['emit'](_0x4353a7,_0x180db4);_0x46d92d(null);};}for(var e in events){if(events[_0xfea9('0x5')](e)){var event=events[e];UserVoiceQueueRt[_0xfea9('0x6')](e,emitEvent(event));}}module[_0xfea9('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xe13c=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','update'];(function(_0x474fc6,_0x15055e){var _0x2ba4cd=function(_0x505aa9){while(--_0x505aa9){_0x474fc6['push'](_0x474fc6['shift']());}};_0x2ba4cd(++_0x15055e);}(_0xe13c,0xac));var _0xce13=function(_0x49a541,_0x507ed8){_0x49a541=_0x49a541-0x0;var _0x45ad77=_0xe13c[_0x49a541];return _0x45ad77;};'use strict';var EventEmitter=require(_0xce13('0x0'));var UserVoiceQueueRt=require(_0xce13('0x1'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xce13('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xce13('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2fdb36){return function(_0x144bdf,_0x3af493,_0x1c5228){UserVoiceQueueRtEvents[_0xce13('0x4')](_0x2fdb36+':'+_0x144bdf['id'],_0x144bdf);UserVoiceQueueRtEvents[_0xce13('0x4')](_0x2fdb36,_0x144bdf);_0x1c5228(null);};}for(var e in events){if(events[_0xce13('0x5')](e)){var event=events[e];UserVoiceQueueRt[_0xce13('0x6')](e,emitEvent(event));}}module[_0xce13('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 e06f744..a04f929 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 _0x4178=['user_has_voice_queues_rt','util','../../config/logger','api','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','UserVoiceQueueRt'];(function(_0x4ca564,_0x392ac3){var _0x294006=function(_0x26c4d0){while(--_0x26c4d0){_0x4ca564['push'](_0x4ca564['shift']());}};_0x294006(++_0x392ac3);}(_0x4178,0x123));var _0x8417=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x4178[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0x8417('0x0'));var logger=require(_0x8417('0x1'))(_0x8417('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8417('0x3'));var rimraf=require(_0x8417('0x4'));var config=require(_0x8417('0x5'));var attributes=require(_0x8417('0x6'));module[_0x8417('0x7')]=function(_0x45aa97,_0x465482){return _0x45aa97['define'](_0x8417('0x8'),attributes,{'tableName':_0x8417('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e25=['bluebird','path','rimraf','../../config/environment','exports','UserVoiceQueueRt','../../config/logger','api','moment'];(function(_0x424a9a,_0x2dd9af){var _0xa7831c=function(_0x512534){while(--_0x512534){_0x424a9a['push'](_0x424a9a['shift']());}};_0xa7831c(++_0x2dd9af);}(_0x3e25,0xde));var _0x53e2=function(_0x22861f,_0x5395be){_0x22861f=_0x22861f-0x0;var _0x1a7580=_0x3e25[_0x22861f];return _0x1a7580;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x53e2('0x0'))(_0x53e2('0x1'));var moment=require(_0x53e2('0x2'));var BPromise=require(_0x53e2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x53e2('0x4'));var rimraf=require(_0x53e2('0x5'));var config=require(_0x53e2('0x6'));var attributes=require('./userVoiceQueueRt.attributes');module[_0x53e2('0x7')]=function(_0x417f2c,_0x127289){return _0x417f2c['define'](_0x53e2('0x8'),attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index ca9f2ad..368d6d4 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 _0xd6a7=['socket.io-emitter','register','request','then','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','GetVoiceQueueRtPauses','findAll','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0xd547cd,_0x3ad91f){var _0x1e3cff=function(_0x313e02){while(--_0x313e02){_0xd547cd['push'](_0xd547cd['shift']());}};_0x1e3cff(++_0x3ad91f);}(_0xd6a7,0xb4));var _0x7d6a=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xd6a7[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var util=require(_0x7d6a('0x0'));var moment=require(_0x7d6a('0x1'));var BPromise=require(_0x7d6a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7d6a('0x3'));var db=require(_0x7d6a('0x4'))['db'];var utils=require(_0x7d6a('0x5'));var logger=require(_0x7d6a('0x6'))(_0x7d6a('0x7'));var config=require(_0x7d6a('0x8'));var jayson=require(_0x7d6a('0x9'));var client=jayson[_0x7d6a('0xa')][_0x7d6a('0xb')]({'port':0x232a});config[_0x7d6a('0xc')]=_[_0x7d6a('0xd')](config[_0x7d6a('0xc')],{'host':_0x7d6a('0xe'),'port':0x18eb});var socket=require(_0x7d6a('0xf'))(new Redis(config[_0x7d6a('0xc')]));require('./userVoiceQueueRt.socket')[_0x7d6a('0x10')](socket);function respondWithRpcPromise(_0x5b62ed,_0x1862ae,_0x2ab2bb){return new BPromise(function(_0x20bff7,_0x56131e){return client[_0x7d6a('0x11')](_0x5b62ed,_0x2ab2bb)[_0x7d6a('0x12')](function(_0x270eca){logger['info'](_0x7d6a('0x13'),_0x1862ae,_0x7d6a('0x14'));logger[_0x7d6a('0x15')](_0x7d6a('0x16'),_0x1862ae,_0x7d6a('0x14'),JSON['stringify'](_0x270eca));if(_0x270eca[_0x7d6a('0x17')]){if(_0x270eca['error'][_0x7d6a('0x18')]===0x1f4){logger[_0x7d6a('0x17')](_0x7d6a('0x13'),_0x1862ae,_0x270eca['error'][_0x7d6a('0x19')]);return _0x56131e(_0x270eca[_0x7d6a('0x17')][_0x7d6a('0x19')]);}logger['error'](_0x7d6a('0x13'),_0x1862ae,_0x270eca[_0x7d6a('0x17')][_0x7d6a('0x19')]);return _0x20bff7(_0x270eca[_0x7d6a('0x17')][_0x7d6a('0x19')]);}else{logger[_0x7d6a('0x1a')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x1862ae,_0x7d6a('0x14'));_0x20bff7(_0x270eca[_0x7d6a('0x1b')][_0x7d6a('0x19')]);}})[_0x7d6a('0x1c')](function(_0x6c1d1){logger[_0x7d6a('0x17')](_0x7d6a('0x13'),_0x1862ae,_0x6c1d1);_0x56131e(_0x6c1d1);});});}exports[_0x7d6a('0x1d')]=function(_0xb38aab){var _0x2794c6=this;return new Promise(function(_0x31275b,_0x1148fc){return db['UserVoiceQueueRt'][_0x7d6a('0x1e')]({'raw':_0xb38aab[_0x7d6a('0x1f')]?_0xb38aab[_0x7d6a('0x1f')][_0x7d6a('0x20')]===undefined?!![]:![]:!![],'where':_0xb38aab[_0x7d6a('0x1f')]?_0xb38aab[_0x7d6a('0x1f')][_0x7d6a('0x21')]||null:null,'attributes':[[db[_0x7d6a('0x22')]['fn'](_0x7d6a('0x23'),db['sequelize']['fn']('IF',db[_0x7d6a('0x22')][_0x7d6a('0x24')](_0x7d6a('0x25')))),_0x7d6a('0x26')]]})[_0x7d6a('0x12')](function(_0x4d9437){logger['info'](_0x7d6a('0x1d'),_0xb38aab);logger['debug']('GetVoiceQueueRtPauses',_0xb38aab,JSON['stringify'](_0x4d9437));_0x31275b(_0x4d9437);})['catch'](function(_0x15c56f){logger[_0x7d6a('0x17')](_0x7d6a('0x1d'),_0x15c56f[_0x7d6a('0x19')],_0xb38aab);_0x1148fc(_0x2794c6['error'](0x1f4,_0x15c56f[_0x7d6a('0x19')]));});});}; \ No newline at end of file +var _0x7f71=['code','message','info','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','options','raw','sequelize','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','stringify','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','client','http','redis','defaults','localhost','./userVoiceQueueRt.socket','register','request','then','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error'];(function(_0x34a403,_0x2069ae){var _0x4fee1a=function(_0x52dd0f){while(--_0x52dd0f){_0x34a403['push'](_0x34a403['shift']());}};_0x4fee1a(++_0x2069ae);}(_0x7f71,0x84));var _0x17f7=function(_0x639430,_0x3c1d15){_0x639430=_0x639430-0x0;var _0x282adb=_0x7f71[_0x639430];return _0x282adb;};'use strict';var _=require(_0x17f7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x17f7('0x1'));var fs=require('fs');var Redis=require(_0x17f7('0x2'));var db=require(_0x17f7('0x3'))['db'];var utils=require(_0x17f7('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x17f7('0x5')][_0x17f7('0x6')]({'port':0x232a});config[_0x17f7('0x7')]=_[_0x17f7('0x8')](config[_0x17f7('0x7')],{'host':_0x17f7('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x17f7('0xa'))[_0x17f7('0xb')](socket);function respondWithRpcPromise(_0xfafd55,_0x6664d3,_0x32b4ab){return new BPromise(function(_0x4f38cf,_0x428152){return client[_0x17f7('0xc')](_0xfafd55,_0x32b4ab)[_0x17f7('0xd')](function(_0x19cabb){logger['info'](_0x17f7('0xe'),_0x6664d3,_0x17f7('0xf'));logger['debug'](_0x17f7('0x10'),_0x6664d3,_0x17f7('0xf'),JSON['stringify'](_0x19cabb));if(_0x19cabb[_0x17f7('0x11')]){if(_0x19cabb[_0x17f7('0x11')][_0x17f7('0x12')]===0x1f4){logger['error'](_0x17f7('0xe'),_0x6664d3,_0x19cabb['error'][_0x17f7('0x13')]);return _0x428152(_0x19cabb[_0x17f7('0x11')][_0x17f7('0x13')]);}logger['error'](_0x17f7('0xe'),_0x6664d3,_0x19cabb['error'][_0x17f7('0x13')]);return _0x4f38cf(_0x19cabb[_0x17f7('0x11')]['message']);}else{logger[_0x17f7('0x14')](_0x17f7('0xe'),_0x6664d3,_0x17f7('0xf'));_0x4f38cf(_0x19cabb['result'][_0x17f7('0x13')]);}})[_0x17f7('0x15')](function(_0x44a7d8){logger[_0x17f7('0x11')](_0x17f7('0xe'),_0x6664d3,_0x44a7d8);_0x428152(_0x44a7d8);});});}exports[_0x17f7('0x16')]=function(_0x19098e){var _0x45ce9e=this;return new Promise(function(_0x528bef,_0x21532b){return db[_0x17f7('0x17')]['findAll']({'raw':_0x19098e[_0x17f7('0x18')]?_0x19098e[_0x17f7('0x18')][_0x17f7('0x19')]===undefined?!![]:![]:!![],'where':_0x19098e[_0x17f7('0x18')]?_0x19098e[_0x17f7('0x18')]['where']||null:null,'attributes':[[db[_0x17f7('0x1a')]['fn']('COUNT',db[_0x17f7('0x1a')]['fn']('IF',db['sequelize']['literal'](_0x17f7('0x1b')))),_0x17f7('0x1c')]]})[_0x17f7('0xd')](function(_0x3a9884){logger[_0x17f7('0x14')](_0x17f7('0x16'),_0x19098e);logger['debug']('GetVoiceQueueRtPauses',_0x19098e,JSON[_0x17f7('0x1d')](_0x3a9884));_0x528bef(_0x3a9884);})[_0x17f7('0x15')](function(_0x12578d){logger[_0x17f7('0x11')]('GetVoiceQueueRtPauses',_0x12578d[_0x17f7('0x13')],_0x19098e);_0x21532b(_0x45ce9e[_0x17f7('0x11')](0x1f4,_0x12578d[_0x17f7('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 9e160da..125816b 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 _0x44e8=['update','removeListener','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events'];(function(_0x3c1a10,_0xcf6340){var _0x42dacf=function(_0x5ae59c){while(--_0x5ae59c){_0x3c1a10['push'](_0x3c1a10['shift']());}};_0x42dacf(++_0xcf6340);}(_0x44e8,0xd7));var _0x844e=function(_0x37e8f2,_0x5bb7b6){_0x37e8f2=_0x37e8f2-0x0;var _0x3b71c3=_0x44e8[_0x37e8f2];return _0x3b71c3;};'use strict';var UserVoiceQueueRtEvents=require(_0x844e('0x0'));var events=['save','remove',_0x844e('0x1')];function createListener(_0x21307e,_0x2afcef){return function(_0x164ecc){_0x2afcef['emit'](_0x21307e,_0x164ecc);};}function removeListener(_0x3a8b3c,_0x167368){return function(){UserVoiceQueueRtEvents[_0x844e('0x2')](_0x3a8b3c,_0x167368);};}exports[_0x844e('0x3')]=function(_0x5c8f67){for(var _0x2f6539=0x0,_0x238796=events[_0x844e('0x4')];_0x2f6539<_0x238796;_0x2f6539++){var _0x11cbd6=events[_0x2f6539];var _0x571b91=createListener(_0x844e('0x5')+_0x11cbd6,_0x5c8f67);UserVoiceQueueRtEvents['on'](_0x11cbd6,_0x571b91);}}; \ No newline at end of file +var _0xbf4e=['userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove','update','emit','removeListener','register','length'];(function(_0x453e2b,_0x4f1258){var _0x50f306=function(_0x397f14){while(--_0x397f14){_0x453e2b['push'](_0x453e2b['shift']());}};_0x50f306(++_0x4f1258);}(_0xbf4e,0x172));var _0xebf4=function(_0x2be171,_0x3e825d){_0x2be171=_0x2be171-0x0;var _0x2ebcdd=_0xbf4e[_0x2be171];return _0x2ebcdd;};'use strict';var UserVoiceQueueRtEvents=require(_0xebf4('0x0'));var events=[_0xebf4('0x1'),_0xebf4('0x2'),_0xebf4('0x3')];function createListener(_0x3a521c,_0xf442ec){return function(_0x48dfb5){_0xf442ec[_0xebf4('0x4')](_0x3a521c,_0x48dfb5);};}function removeListener(_0x5d2ad5,_0x59cc54){return function(){UserVoiceQueueRtEvents[_0xebf4('0x5')](_0x5d2ad5,_0x59cc54);};}exports[_0xebf4('0x6')]=function(_0x5adea8){for(var _0x412bbe=0x0,_0x995254=events[_0xebf4('0x7')];_0x412bbe<_0x995254;_0x412bbe++){var _0x48764f=events[_0x412bbe];var _0x2f17c0=createListener(_0xebf4('0x8')+_0x48764f,_0x5adea8);UserVoiceQueueRtEvents['on'](_0x48764f,_0x2f17c0);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 0202951..ea108b5 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x1fbde3,_0x59da39){var _0x2b092f=function(_0x18bd24){while(--_0x18bd24){_0x1fbde3['push'](_0x1fbde3['shift']());}};_0x2b092f(++_0x59da39);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x1e5a85,_0x28b6b2){var _0x5f361c=function(_0x5a60bb){while(--_0x5a60bb){_0x1e5a85['push'](_0x1e5a85['shift']());}};_0x5f361c(++_0x28b6b2);}(_0x70e0,0x17b));var _0x070e=function(_0x1e1efe,_0xac288b){_0x1e1efe=_0x1e1efe-0x0;var _0x10e4bb=_0x70e0[_0x1e1efe];return _0x10e4bb;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 0cc7c48..6a87d45 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 _0x5dcd=['exports','INTEGER','sequelize'];(function(_0x4eb832,_0x324bff){var _0x2e5927=function(_0x4687ce){while(--_0x4687ce){_0x4eb832['push'](_0x4eb832['shift']());}};_0x2e5927(++_0x324bff);}(_0x5dcd,0xf8));var _0xd5dc=function(_0x2bb4b0,_0x4057da){_0x2bb4b0=_0x2bb4b0-0x0;var _0xa9d999=_0x5dcd[_0x2bb4b0];return _0xa9d999;};'use strict';var Sequelize=require(_0xd5dc('0x0'));module[_0xd5dc('0x1')]={'penalty':{'type':Sequelize[_0xd5dc('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3fe9=['sequelize','exports'];(function(_0x30fb8d,_0xd2a5b3){var _0x1c0cf2=function(_0x780297){while(--_0x780297){_0x30fb8d['push'](_0x30fb8d['shift']());}};_0x1c0cf2(++_0xd2a5b3);}(_0x3fe9,0x106));var _0x93fe=function(_0x3b6a75,_0x32c18c){_0x3b6a75=_0x3b6a75-0x0;var _0x5b713e=_0x3fe9[_0x3b6a75];return _0x5b713e;};'use strict';var Sequelize=require(_0x93fe('0x0'));module[_0x93fe('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'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 ea1aea7..14ebfcd 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 _0xa103=['request-promise','path','../../config/environment','./userWhatsappQueue.attributes','define','UserWhatsappQueue','lodash','util','../../config/logger'];(function(_0x20352e,_0x1ee2ac){var _0x5a9319=function(_0x168ac4){while(--_0x168ac4){_0x20352e['push'](_0x20352e['shift']());}};_0x5a9319(++_0x1ee2ac);}(_0xa103,0x1da));var _0x3a10=function(_0x15f3b3,_0x555804){_0x15f3b3=_0x15f3b3-0x0;var _0x377af5=_0xa103[_0x15f3b3];return _0x377af5;};'use strict';var _=require(_0x3a10('0x0'));var util=require(_0x3a10('0x1'));var logger=require(_0x3a10('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3a10('0x3'));var fs=require('fs');var path=require(_0x3a10('0x4'));var rimraf=require('rimraf');var config=require(_0x3a10('0x5'));var attributes=require(_0x3a10('0x6'));module['exports']=function(_0x3cf9be,_0x7f2196){return _0x3cf9be[_0x3a10('0x7')](_0x3a10('0x8'),attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xac4d=['user_has_whatsapp_queues','lodash','util','../../config/logger','moment','request-promise','path','rimraf','./userWhatsappQueue.attributes','exports','UserWhatsappQueue'];(function(_0x288b1a,_0x427f8f){var _0x2b873f=function(_0x5b7fb8){while(--_0x5b7fb8){_0x288b1a['push'](_0x288b1a['shift']());}};_0x2b873f(++_0x427f8f);}(_0xac4d,0x182));var _0xdac4=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xac4d[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0xdac4('0x0'));var util=require(_0xdac4('0x1'));var logger=require(_0xdac4('0x2'))('api');var moment=require(_0xdac4('0x3'));var BPromise=require('bluebird');var rp=require(_0xdac4('0x4'));var fs=require('fs');var path=require(_0xdac4('0x5'));var rimraf=require(_0xdac4('0x6'));var config=require('../../config/environment');var attributes=require(_0xdac4('0x7'));module[_0xdac4('0x8')]=function(_0x5a67b5,_0x59238c){return _0x5a67b5['define'](_0xdac4('0x9'),attributes,{'tableName':_0xdac4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js index bf0ae91..50658ed 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 _0xfd5e=['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','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x3c6bc1,_0x5d46d8){var _0x318f0b=function(_0x4261c1){while(--_0x4261c1){_0x3c6bc1['push'](_0x3c6bc1['shift']());}};_0x318f0b(++_0x5d46d8);}(_0xfd5e,0x107));var _0xefd5=function(_0x52bdd5,_0x9ec0b1){_0x52bdd5=_0x52bdd5-0x0;var _0x468f78=_0xfd5e[_0x52bdd5];return _0x468f78;};'use strict';var _=require('lodash');var util=require(_0xefd5('0x0'));var moment=require(_0xefd5('0x1'));var BPromise=require(_0xefd5('0x2'));var rs=require(_0xefd5('0x3'));var fs=require('fs');var Redis=require(_0xefd5('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xefd5('0x5'))('rpc');var config=require(_0xefd5('0x6'));var jayson=require(_0xefd5('0x7'));var client=jayson[_0xefd5('0x8')][_0xefd5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x48585f,_0x1e8cad,_0x2cd4fa){return new BPromise(function(_0x51f213,_0x31444e){return client[_0xefd5('0xa')](_0x48585f,_0x2cd4fa)[_0xefd5('0xb')](function(_0x4cd471){logger[_0xefd5('0xc')](_0xefd5('0xd'),_0x1e8cad,'request\x20sent');logger[_0xefd5('0xe')](_0xefd5('0xf'),_0x1e8cad,_0xefd5('0x10'),JSON[_0xefd5('0x11')](_0x4cd471));if(_0x4cd471['error']){if(_0x4cd471[_0xefd5('0x12')][_0xefd5('0x13')]===0x1f4){logger[_0xefd5('0x12')](_0xefd5('0xd'),_0x1e8cad,_0x4cd471[_0xefd5('0x12')][_0xefd5('0x14')]);return _0x31444e(_0x4cd471[_0xefd5('0x12')][_0xefd5('0x14')]);}logger[_0xefd5('0x12')](_0xefd5('0xd'),_0x1e8cad,_0x4cd471[_0xefd5('0x12')]['message']);return _0x51f213(_0x4cd471[_0xefd5('0x12')][_0xefd5('0x14')]);}else{logger['info']('UserWhatsappQueue,\x20%s,\x20%s',_0x1e8cad,_0xefd5('0x10'));_0x51f213(_0x4cd471[_0xefd5('0x15')]['message']);}})[_0xefd5('0x16')](function(_0x26cc81){logger[_0xefd5('0x12')](_0xefd5('0xd'),_0x1e8cad,_0x26cc81);_0x31444e(_0x26cc81);});});} \ No newline at end of file +var _0xfa4c=['catch','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserWhatsappQueue,\x20%s,\x20%s','message','info','result'];(function(_0x2fb87c,_0x2dee49){var _0x43038b=function(_0x7e5396){while(--_0x7e5396){_0x2fb87c['push'](_0x2fb87c['shift']());}};_0x43038b(++_0x2dee49);}(_0xfa4c,0x1b9));var _0xcfa4=function(_0x56e19b,_0x53f5c5){_0x56e19b=_0x56e19b-0x0;var _0x4d47c8=_0xfa4c[_0x56e19b];return _0x4d47c8;};'use strict';var _=require('lodash');var util=require(_0xcfa4('0x0'));var moment=require(_0xcfa4('0x1'));var BPromise=require(_0xcfa4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcfa4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xcfa4('0x4'));var logger=require(_0xcfa4('0x5'))('rpc');var config=require(_0xcfa4('0x6'));var jayson=require(_0xcfa4('0x7'));var client=jayson[_0xcfa4('0x8')][_0xcfa4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x377adb,_0x19d1dc,_0x10f103){return new BPromise(function(_0x68b813,_0xf4913){return client[_0xcfa4('0xa')](_0x377adb,_0x10f103)['then'](function(_0x103d57){logger['info']('UserWhatsappQueue,\x20%s,\x20%s',_0x19d1dc,_0xcfa4('0xb'));logger[_0xcfa4('0xc')](_0xcfa4('0xd'),_0x19d1dc,'request\x20sent',JSON[_0xcfa4('0xe')](_0x103d57));if(_0x103d57[_0xcfa4('0xf')]){if(_0x103d57[_0xcfa4('0xf')][_0xcfa4('0x10')]===0x1f4){logger['error'](_0xcfa4('0x11'),_0x19d1dc,_0x103d57[_0xcfa4('0xf')][_0xcfa4('0x12')]);return _0xf4913(_0x103d57['error']['message']);}logger[_0xcfa4('0xf')](_0xcfa4('0x11'),_0x19d1dc,_0x103d57[_0xcfa4('0xf')][_0xcfa4('0x12')]);return _0x68b813(_0x103d57[_0xcfa4('0xf')][_0xcfa4('0x12')]);}else{logger[_0xcfa4('0x13')](_0xcfa4('0x11'),_0x19d1dc,_0xcfa4('0xb'));_0x68b813(_0x103d57[_0xcfa4('0x14')][_0xcfa4('0x12')]);}})[_0xcfa4('0x15')](function(_0x218d89){logger[_0xcfa4('0xf')](_0xcfa4('0x11'),_0x19d1dc,_0x218d89);_0xf4913(_0x218d89);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 28e818f..3ada762 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 _0xe13a=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','destroy','exports','util','path','connect-timeout','express'];(function(_0x39aaec,_0x20f7dc){var _0x280c63=function(_0x5b5b13){while(--_0x5b5b13){_0x39aaec['push'](_0x39aaec['shift']());}};_0x280c63(++_0x20f7dc);}(_0xe13a,0x178));var _0xae13=function(_0x1de6fa,_0x335f59){_0x1de6fa=_0x1de6fa-0x0;var _0x2832cf=_0xe13a[_0x1de6fa];return _0x2832cf;};'use strict';var multer=require('multer');var util=require(_0xae13('0x0'));var path=require(_0xae13('0x1'));var timeout=require(_0xae13('0x2'));var express=require(_0xae13('0x3'));var router=express['Router']();var fs_extra=require(_0xae13('0x4'));var auth=require(_0xae13('0x5'));var interaction=require(_0xae13('0x6'));var config=require(_0xae13('0x7'));var controller=require(_0xae13('0x8'));router[_0xae13('0x9')]('/',auth[_0xae13('0xa')](),controller[_0xae13('0xb')]);router[_0xae13('0x9')]('/:id',auth[_0xae13('0xa')](),controller[_0xae13('0xc')]);router[_0xae13('0xd')]('/',auth[_0xae13('0xa')](),controller[_0xae13('0xe')]);router[_0xae13('0xf')](_0xae13('0x10'),auth[_0xae13('0xa')](),controller[_0xae13('0x11')]);router['delete'](_0xae13('0x10'),auth[_0xae13('0xa')](),controller[_0xae13('0x12')]);module[_0xae13('0x13')]=router; \ No newline at end of file +var _0x47d6=['update','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./variable.controller','get','index','/:id','isAuthenticated','show','post','create','put'];(function(_0x58133a,_0x22538b){var _0x47ca83=function(_0x29fbef){while(--_0x29fbef){_0x58133a['push'](_0x58133a['shift']());}};_0x47ca83(++_0x22538b);}(_0x47d6,0x1de));var _0x647d=function(_0x395d33,_0x28dafa){_0x395d33=_0x395d33-0x0;var _0x4aa0cf=_0x47d6[_0x395d33];return _0x4aa0cf;};'use strict';var multer=require(_0x647d('0x0'));var util=require(_0x647d('0x1'));var path=require(_0x647d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x647d('0x3')]();var fs_extra=require(_0x647d('0x4'));var auth=require(_0x647d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x647d('0x6'));var controller=require(_0x647d('0x7'));router[_0x647d('0x8')]('/',auth['isAuthenticated'](),controller[_0x647d('0x9')]);router[_0x647d('0x8')](_0x647d('0xa'),auth[_0x647d('0xb')](),controller[_0x647d('0xc')]);router[_0x647d('0xd')]('/',auth[_0x647d('0xb')](),controller[_0x647d('0xe')]);router[_0x647d('0xf')](_0x647d('0xa'),auth[_0x647d('0xb')](),controller[_0x647d('0x10')]);router['delete'](_0x647d('0xa'),auth[_0x647d('0xb')](),controller[_0x647d('0x11')]);module[_0x647d('0x12')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index daadd99..dd667bf 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 _0x921c=['exports','STRING','name','sequelize'];(function(_0x3363af,_0x47676b){var _0x521aff=function(_0x136135){while(--_0x136135){_0x3363af['push'](_0x3363af['shift']());}};_0x521aff(++_0x47676b);}(_0x921c,0x1ab));var _0xc921=function(_0x90e173,_0x1e0f36){_0x90e173=_0x90e173-0x0;var _0x46bcc1=_0x921c[_0x90e173];return _0x46bcc1;};'use strict';var Sequelize=require(_0xc921('0x0'));module[_0xc921('0x1')]={'name':{'type':Sequelize[_0xc921('0x2')],'unique':_0xc921('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xc921('0x2')]}}; \ No newline at end of file +var _0xa994=['sequelize','exports','STRING','name'];(function(_0x1026e7,_0x5f5307){var _0x5af29c=function(_0x308cf2){while(--_0x308cf2){_0x1026e7['push'](_0x1026e7['shift']());}};_0x5af29c(++_0x5f5307);}(_0xa994,0x108));var _0x4a99=function(_0x30dc13,_0x4b6ed5){_0x30dc13=_0x30dc13-0x0;var _0x2c56f5=_0xa994[_0x30dc13];return _0x2c56f5;};'use strict';var Sequelize=require(_0x4a99('0x0'));module[_0x4a99('0x1')]={'name':{'type':Sequelize[_0x4a99('0x2')],'unique':_0x4a99('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x4a99('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 7df638b..daa3403 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 _0xaa06=['sort','filters','pick','filter','where','merge','options','includeAll','findAll','rows','params','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','eml-format','zip-dir','fast-json-patch','moment','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','map','Variable','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xaa06,0x1a0));var _0x6aa0=function(_0x5aac57,_0xe7869f){_0x5aac57=_0x5aac57-0x0;var _0xd73b54=_0xaa06[_0x5aac57];return _0xd73b54;};'use strict';var emlformat=require(_0x6aa0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6aa0('0x1'));var jsonpatch=require(_0x6aa0('0x2'));var rp=require('request-promise');var moment=require(_0x6aa0('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6aa0('0x4'));var path=require(_0x6aa0('0x5'));var sox=require(_0x6aa0('0x6'));var csv=require('to-csv');var ejs=require(_0x6aa0('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6aa0('0x8'));var squel=require(_0x6aa0('0x9'));var crypto=require(_0x6aa0('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x6aa0('0xb'));var toCsv=require(_0x6aa0('0xc'));var querystring=require('querystring');var Papa=require(_0x6aa0('0xd'));var Redis=require(_0x6aa0('0xe'));var authService=require(_0x6aa0('0xf'));var qs=require(_0x6aa0('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6aa0('0x11'));var logger=require(_0x6aa0('0x12'))(_0x6aa0('0x13'));var utils=require(_0x6aa0('0x14'));var config=require(_0x6aa0('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6aa0('0x16'))['db'];function respondWithStatusCode(_0x57d559,_0x5028b0){_0x5028b0=_0x5028b0||0xcc;return function(_0xa9070f){if(_0xa9070f){return _0x57d559['sendStatus'](_0x5028b0);}return _0x57d559[_0x6aa0('0x17')](_0x5028b0)[_0x6aa0('0x18')]();};}function respondWithResult(_0x35bdc3,_0x2196be){_0x2196be=_0x2196be||0xc8;return function(_0x1c4e08){if(_0x1c4e08){return _0x35bdc3[_0x6aa0('0x17')](_0x2196be)[_0x6aa0('0x19')](_0x1c4e08);}};}function respondWithFilteredResult(_0x44c51f,_0x3ddf48){return function(_0x30d362){if(_0x30d362){var _0x53f7e8=typeof _0x3ddf48[_0x6aa0('0x1a')]===_0x6aa0('0x1b')&&typeof _0x3ddf48[_0x6aa0('0x1c')]==='undefined';var _0x4062c2=_0x30d362[_0x6aa0('0x1d')];var _0x51852b=_0x53f7e8?0x0:_0x3ddf48['offset'];var _0x428d58=_0x53f7e8?_0x30d362[_0x6aa0('0x1d')]:_0x3ddf48[_0x6aa0('0x1a')]+_0x3ddf48[_0x6aa0('0x1c')];var _0x13e6a0;if(_0x428d58>=_0x4062c2){_0x428d58=_0x4062c2;_0x13e6a0=0xc8;}else{_0x13e6a0=0xce;}_0x44c51f[_0x6aa0('0x17')](_0x13e6a0);return _0x44c51f[_0x6aa0('0x1e')](_0x6aa0('0x1f'),_0x51852b+'-'+_0x428d58+'/'+_0x4062c2)['json'](_0x30d362);}return null;};}function patchUpdates(_0x51d083){return function(_0x395145){try{jsonpatch[_0x6aa0('0x20')](_0x395145,_0x51d083,!![]);}catch(_0x55174b){return BPromise[_0x6aa0('0x21')](_0x55174b);}return _0x395145['save']();};}function saveUpdates(_0x2a8312,_0x4c7f6b){return function(_0x22f422){if(_0x22f422){return _0x22f422[_0x6aa0('0x22')](_0x2a8312)[_0x6aa0('0x23')](function(_0x2e1c4d){return _0x2e1c4d;});}return null;};}function removeEntity(_0x1ef124,_0x3df5dc){return function(_0x4b7762){if(_0x4b7762){return _0x4b7762[_0x6aa0('0x24')]()[_0x6aa0('0x23')](function(){var _0x9085a5=_0x4b7762[_0x6aa0('0x25')]({'plain':!![]});var _0x35b06e='Variables';return db[_0x6aa0('0x26')][_0x6aa0('0x24')]({'where':{'type':_0x35b06e,'resourceId':_0x9085a5['id']}})[_0x6aa0('0x23')](function(){return _0x4b7762;});})[_0x6aa0('0x23')](function(){_0x1ef124['status'](0xcc)[_0x6aa0('0x18')]();});}};}function handleEntityNotFound(_0xf56c8,_0x117cf1){return function(_0x357530){if(!_0x357530){_0xf56c8[_0x6aa0('0x27')](0x194);}return _0x357530;};}function handleError(_0x3a9460,_0x195df4){_0x195df4=_0x195df4||0x1f4;return function(_0x36a976){logger[_0x6aa0('0x28')](_0x36a976[_0x6aa0('0x29')]);if(_0x36a976[_0x6aa0('0x2a')]){delete _0x36a976[_0x6aa0('0x2a')];}_0x3a9460['status'](_0x195df4)['send'](_0x36a976);};}exports['index']=function(_0x28b472,_0x100e52){var _0x5a8a70={},_0x1eb7eb={},_0x522669={'count':0x0,'rows':[]};var _0x2f994c=_[_0x6aa0('0x2b')](db[_0x6aa0('0x2c')][_0x6aa0('0x2d')],function(_0x5dd0a0){return{'name':_0x5dd0a0['fieldName'],'type':_0x5dd0a0[_0x6aa0('0x2e')][_0x6aa0('0x2f')]};});_0x1eb7eb[_0x6aa0('0x30')]=_['map'](_0x2f994c,_0x6aa0('0x2a'));_0x1eb7eb[_0x6aa0('0x31')]=_[_0x6aa0('0x32')](_0x28b472[_0x6aa0('0x31')]);_0x1eb7eb['filters']=_[_0x6aa0('0x33')](_0x1eb7eb[_0x6aa0('0x30')],_0x1eb7eb[_0x6aa0('0x31')]);_0x5a8a70[_0x6aa0('0x34')]=_[_0x6aa0('0x33')](_0x1eb7eb[_0x6aa0('0x30')],qs[_0x6aa0('0x35')](_0x28b472['query']['fields']));_0x5a8a70[_0x6aa0('0x34')]=_0x5a8a70[_0x6aa0('0x34')][_0x6aa0('0x36')]?_0x5a8a70[_0x6aa0('0x34')]:_0x1eb7eb[_0x6aa0('0x30')];if(!_0x28b472[_0x6aa0('0x31')][_0x6aa0('0x37')](_0x6aa0('0x38'))){_0x5a8a70[_0x6aa0('0x1c')]=qs[_0x6aa0('0x1c')](_0x28b472['query']['limit']);_0x5a8a70[_0x6aa0('0x1a')]=qs[_0x6aa0('0x1a')](_0x28b472[_0x6aa0('0x31')]['offset']);}_0x5a8a70[_0x6aa0('0x39')]=qs[_0x6aa0('0x3a')](_0x28b472['query']['sort']);_0x5a8a70['where']=qs[_0x6aa0('0x3b')](_[_0x6aa0('0x3c')](_0x28b472[_0x6aa0('0x31')],_0x1eb7eb[_0x6aa0('0x3b')]),_0x2f994c);if(_0x28b472[_0x6aa0('0x31')][_0x6aa0('0x3d')]){_0x5a8a70[_0x6aa0('0x3e')]=_[_0x6aa0('0x3f')](_0x5a8a70[_0x6aa0('0x3e')],{'$or':_[_0x6aa0('0x2b')](_0x2f994c,function(_0x1e0fef){if(_0x1e0fef['type']!=='VIRTUAL'){var _0x4a0f70={};_0x4a0f70[_0x1e0fef[_0x6aa0('0x2a')]]={'$like':'%'+_0x28b472[_0x6aa0('0x31')]['filter']+'%'};return _0x4a0f70;}})});}_0x5a8a70=_['merge']({},_0x5a8a70,_0x28b472[_0x6aa0('0x40')]);var _0x178972={'where':_0x5a8a70[_0x6aa0('0x3e')]};return db[_0x6aa0('0x2c')]['count'](_0x178972)[_0x6aa0('0x23')](function(_0x53effa){_0x522669[_0x6aa0('0x1d')]=_0x53effa;if(_0x28b472[_0x6aa0('0x31')][_0x6aa0('0x41')]){_0x5a8a70['include']=[{'all':!![]}];}return db[_0x6aa0('0x2c')][_0x6aa0('0x42')](_0x5a8a70);})[_0x6aa0('0x23')](function(_0x34206b){_0x522669[_0x6aa0('0x43')]=_0x34206b;return _0x522669;})[_0x6aa0('0x23')](respondWithFilteredResult(_0x100e52,_0x5a8a70))['catch'](handleError(_0x100e52,null));};exports['show']=function(_0x262e4c,_0x22d279){var _0x116ff9={'raw':!![],'where':{'id':_0x262e4c[_0x6aa0('0x44')]['id']}},_0x2f0183={};_0x2f0183[_0x6aa0('0x30')]=_[_0x6aa0('0x32')](db['Variable'][_0x6aa0('0x2d')]);_0x2f0183[_0x6aa0('0x31')]=_[_0x6aa0('0x32')](_0x262e4c[_0x6aa0('0x31')]);_0x2f0183[_0x6aa0('0x3b')]=_[_0x6aa0('0x33')](_0x2f0183[_0x6aa0('0x30')],_0x2f0183['query']);_0x116ff9[_0x6aa0('0x34')]=_[_0x6aa0('0x33')](_0x2f0183[_0x6aa0('0x30')],qs['fields'](_0x262e4c['query'][_0x6aa0('0x35')]));_0x116ff9[_0x6aa0('0x34')]=_0x116ff9[_0x6aa0('0x34')]['length']?_0x116ff9[_0x6aa0('0x34')]:_0x2f0183['model'];if(_0x262e4c[_0x6aa0('0x31')]['includeAll']){_0x116ff9['include']=[{'all':!![]}];}_0x116ff9=_[_0x6aa0('0x3f')]({},_0x116ff9,_0x262e4c[_0x6aa0('0x40')]);return db[_0x6aa0('0x2c')][_0x6aa0('0x45')](_0x116ff9)[_0x6aa0('0x23')](handleEntityNotFound(_0x22d279,null))['then'](respondWithResult(_0x22d279,null))[_0x6aa0('0x46')](handleError(_0x22d279,null));};exports[_0x6aa0('0x47')]=function(_0x2f88a0,_0x33fd0c){return db[_0x6aa0('0x2c')][_0x6aa0('0x47')](_0x2f88a0[_0x6aa0('0x48')],{})[_0x6aa0('0x23')](function(_0x504cac){var _0x35d32b=_0x2f88a0[_0x6aa0('0x49')]['get']({'plain':!![]});if(!_0x35d32b)throw new Error(_0x6aa0('0x4a'));if(_0x35d32b[_0x6aa0('0x4b')]==='user'){var _0x4213d0=_0x504cac[_0x6aa0('0x25')]({'plain':!![]});var _0x5b2ce8='Variables';return db['UserProfileSection']['find']({'where':{'name':_0x5b2ce8,'userProfileId':_0x35d32b[_0x6aa0('0x4c')]},'raw':!![]})[_0x6aa0('0x23')](function(_0x3e6bca){if(_0x3e6bca&&_0x3e6bca[_0x6aa0('0x4d')]===0x0){return db[_0x6aa0('0x26')][_0x6aa0('0x47')]({'name':_0x4213d0[_0x6aa0('0x2a')],'resourceId':_0x4213d0['id'],'type':_0x3e6bca[_0x6aa0('0x2a')],'sectionId':_0x3e6bca['id']},{})[_0x6aa0('0x23')](function(){return _0x504cac;});}else{return _0x504cac;}})[_0x6aa0('0x46')](function(_0x44068a){logger['error'](_0x6aa0('0x4e'),_0x44068a);throw _0x44068a;});}return _0x504cac;})[_0x6aa0('0x23')](respondWithResult(_0x33fd0c,0xc9))['catch'](handleError(_0x33fd0c,null));};exports['update']=function(_0xed6e21,_0x36a5b9){if(_0xed6e21[_0x6aa0('0x48')]['id']){delete _0xed6e21[_0x6aa0('0x48')]['id'];}return db[_0x6aa0('0x2c')]['find']({'where':{'id':_0xed6e21[_0x6aa0('0x44')]['id']}})[_0x6aa0('0x23')](handleEntityNotFound(_0x36a5b9,null))[_0x6aa0('0x23')](saveUpdates(_0xed6e21[_0x6aa0('0x48')],null))[_0x6aa0('0x23')](respondWithResult(_0x36a5b9,null))['catch'](handleError(_0x36a5b9,null));};exports['destroy']=function(_0x5da460,_0x23233b){return db[_0x6aa0('0x2c')]['find']({'where':{'id':_0x5da460[_0x6aa0('0x44')]['id']}})[_0x6aa0('0x23')](handleEntityNotFound(_0x23233b,null))[_0x6aa0('0x23')](removeEntity(_0x23233b,null))[_0x6aa0('0x46')](handleError(_0x23233b,null));}; \ No newline at end of file +var _0x653c=['update','then','destroy','get','Variables','UserProfileResource','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','Variable','findAll','rows','params','keys','length','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','save'];(function(_0x40abc,_0x24e02a){var _0x4ec5a7=function(_0x526254){while(--_0x526254){_0x40abc['push'](_0x40abc['shift']());}};_0x4ec5a7(++_0x24e02a);}(_0x653c,0x84));var _0xc653=function(_0x5ce379,_0x4feabd){_0x5ce379=_0x5ce379-0x0;var _0x260107=_0x653c[_0x5ce379];return _0x260107;};'use strict';var emlformat=require(_0xc653('0x0'));var rimraf=require(_0xc653('0x1'));var zipdir=require(_0xc653('0x2'));var jsonpatch=require(_0xc653('0x3'));var rp=require(_0xc653('0x4'));var moment=require(_0xc653('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xc653('0x6'));var sox=require(_0xc653('0x7'));var csv=require('to-csv');var ejs=require(_0xc653('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc653('0x9'));var squel=require(_0xc653('0xa'));var crypto=require('crypto');var jsforce=require(_0xc653('0xb'));var deskjs=require(_0xc653('0xc'));var toCsv=require(_0xc653('0xd'));var querystring=require(_0xc653('0xe'));var Papa=require(_0xc653('0xf'));var Redis=require(_0xc653('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc653('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc653('0x12'))('api');var utils=require(_0xc653('0x13'));var config=require(_0xc653('0x14'));var licenseUtil=require(_0xc653('0x15'));var db=require(_0xc653('0x16'))['db'];function respondWithStatusCode(_0x8c2f8d,_0x262000){_0x262000=_0x262000||0xcc;return function(_0x594fbc){if(_0x594fbc){return _0x8c2f8d[_0xc653('0x17')](_0x262000);}return _0x8c2f8d[_0xc653('0x18')](_0x262000)[_0xc653('0x19')]();};}function respondWithResult(_0x174297,_0x281686){_0x281686=_0x281686||0xc8;return function(_0x38086d){if(_0x38086d){return _0x174297['status'](_0x281686)[_0xc653('0x1a')](_0x38086d);}};}function respondWithFilteredResult(_0x5eacdd,_0xb67ce9){return function(_0x40b08e){if(_0x40b08e){var _0x2a639e=typeof _0xb67ce9['offset']===_0xc653('0x1b')&&typeof _0xb67ce9['limit']===_0xc653('0x1b');var _0x3a648d=_0x40b08e[_0xc653('0x1c')];var _0x768896=_0x2a639e?0x0:_0xb67ce9[_0xc653('0x1d')];var _0x2aea11=_0x2a639e?_0x40b08e[_0xc653('0x1c')]:_0xb67ce9[_0xc653('0x1d')]+_0xb67ce9['limit'];var _0x272aae;if(_0x2aea11>=_0x3a648d){_0x2aea11=_0x3a648d;_0x272aae=0xc8;}else{_0x272aae=0xce;}_0x5eacdd[_0xc653('0x18')](_0x272aae);return _0x5eacdd[_0xc653('0x1e')](_0xc653('0x1f'),_0x768896+'-'+_0x2aea11+'/'+_0x3a648d)[_0xc653('0x1a')](_0x40b08e);}return null;};}function patchUpdates(_0x3115da){return function(_0x24f1ba){try{jsonpatch[_0xc653('0x20')](_0x24f1ba,_0x3115da,!![]);}catch(_0x4cd22e){return BPromise['reject'](_0x4cd22e);}return _0x24f1ba[_0xc653('0x21')]();};}function saveUpdates(_0x5053a7,_0x546ec5){return function(_0xb006b5){if(_0xb006b5){return _0xb006b5[_0xc653('0x22')](_0x5053a7)[_0xc653('0x23')](function(_0x58c691){return _0x58c691;});}return null;};}function removeEntity(_0x4b99d0,_0x4c691e){return function(_0x46fc08){if(_0x46fc08){return _0x46fc08[_0xc653('0x24')]()[_0xc653('0x23')](function(){var _0x111ef1=_0x46fc08[_0xc653('0x25')]({'plain':!![]});var _0x4cd438=_0xc653('0x26');return db[_0xc653('0x27')][_0xc653('0x24')]({'where':{'type':_0x4cd438,'resourceId':_0x111ef1['id']}})[_0xc653('0x23')](function(){return _0x46fc08;});})[_0xc653('0x23')](function(){_0x4b99d0[_0xc653('0x18')](0xcc)[_0xc653('0x19')]();});}};}function handleEntityNotFound(_0x34c1af,_0x2ac653){return function(_0x308b4a){if(!_0x308b4a){_0x34c1af[_0xc653('0x17')](0x194);}return _0x308b4a;};}function handleError(_0xb35a14,_0x18bddb){_0x18bddb=_0x18bddb||0x1f4;return function(_0x414689){logger['error'](_0x414689[_0xc653('0x28')]);if(_0x414689[_0xc653('0x29')]){delete _0x414689[_0xc653('0x29')];}_0xb35a14['status'](_0x18bddb)[_0xc653('0x2a')](_0x414689);};}exports[_0xc653('0x2b')]=function(_0x6c7abb,_0xf2fa6b){var _0x57c7eb={},_0x356fb6={},_0x544160={'count':0x0,'rows':[]};var _0x314bff=_[_0xc653('0x2c')](db['Variable'][_0xc653('0x2d')],function(_0x59af4b){return{'name':_0x59af4b['fieldName'],'type':_0x59af4b[_0xc653('0x2e')][_0xc653('0x2f')]};});_0x356fb6[_0xc653('0x30')]=_[_0xc653('0x2c')](_0x314bff,'name');_0x356fb6[_0xc653('0x31')]=_['keys'](_0x6c7abb[_0xc653('0x31')]);_0x356fb6[_0xc653('0x32')]=_[_0xc653('0x33')](_0x356fb6[_0xc653('0x30')],_0x356fb6[_0xc653('0x31')]);_0x57c7eb[_0xc653('0x34')]=_['intersection'](_0x356fb6[_0xc653('0x30')],qs[_0xc653('0x35')](_0x6c7abb[_0xc653('0x31')][_0xc653('0x35')]));_0x57c7eb[_0xc653('0x34')]=_0x57c7eb[_0xc653('0x34')]['length']?_0x57c7eb['attributes']:_0x356fb6[_0xc653('0x30')];if(!_0x6c7abb[_0xc653('0x31')][_0xc653('0x36')](_0xc653('0x37'))){_0x57c7eb['limit']=qs['limit'](_0x6c7abb[_0xc653('0x31')][_0xc653('0x38')]);_0x57c7eb['offset']=qs[_0xc653('0x1d')](_0x6c7abb['query']['offset']);}_0x57c7eb[_0xc653('0x39')]=qs[_0xc653('0x3a')](_0x6c7abb[_0xc653('0x31')][_0xc653('0x3a')]);_0x57c7eb[_0xc653('0x3b')]=qs['filters'](_[_0xc653('0x3c')](_0x6c7abb[_0xc653('0x31')],_0x356fb6[_0xc653('0x32')]),_0x314bff);if(_0x6c7abb['query'][_0xc653('0x3d')]){_0x57c7eb[_0xc653('0x3b')]=_[_0xc653('0x3e')](_0x57c7eb[_0xc653('0x3b')],{'$or':_[_0xc653('0x2c')](_0x314bff,function(_0xff7a6c){if(_0xff7a6c[_0xc653('0x2e')]!==_0xc653('0x3f')){var _0x41379b={};_0x41379b[_0xff7a6c[_0xc653('0x29')]]={'$like':'%'+_0x6c7abb[_0xc653('0x31')]['filter']+'%'};return _0x41379b;}})});}_0x57c7eb=_['merge']({},_0x57c7eb,_0x6c7abb[_0xc653('0x40')]);var _0x59ad77={'where':_0x57c7eb[_0xc653('0x3b')]};return db[_0xc653('0x41')][_0xc653('0x1c')](_0x59ad77)[_0xc653('0x23')](function(_0x18e251){_0x544160[_0xc653('0x1c')]=_0x18e251;if(_0x6c7abb[_0xc653('0x31')]['includeAll']){_0x57c7eb['include']=[{'all':!![]}];}return db[_0xc653('0x41')][_0xc653('0x42')](_0x57c7eb);})[_0xc653('0x23')](function(_0x449511){_0x544160[_0xc653('0x43')]=_0x449511;return _0x544160;})['then'](respondWithFilteredResult(_0xf2fa6b,_0x57c7eb))['catch'](handleError(_0xf2fa6b,null));};exports['show']=function(_0x17ee01,_0x49b4e8){var _0x4ee0bf={'raw':!![],'where':{'id':_0x17ee01[_0xc653('0x44')]['id']}},_0x3c5ef8={};_0x3c5ef8[_0xc653('0x30')]=_[_0xc653('0x45')](db[_0xc653('0x41')][_0xc653('0x2d')]);_0x3c5ef8[_0xc653('0x31')]=_['keys'](_0x17ee01[_0xc653('0x31')]);_0x3c5ef8[_0xc653('0x32')]=_[_0xc653('0x33')](_0x3c5ef8[_0xc653('0x30')],_0x3c5ef8['query']);_0x4ee0bf[_0xc653('0x34')]=_['intersection'](_0x3c5ef8[_0xc653('0x30')],qs[_0xc653('0x35')](_0x17ee01[_0xc653('0x31')][_0xc653('0x35')]));_0x4ee0bf['attributes']=_0x4ee0bf[_0xc653('0x34')][_0xc653('0x46')]?_0x4ee0bf[_0xc653('0x34')]:_0x3c5ef8['model'];if(_0x17ee01[_0xc653('0x31')][_0xc653('0x47')]){_0x4ee0bf[_0xc653('0x48')]=[{'all':!![]}];}_0x4ee0bf=_[_0xc653('0x3e')]({},_0x4ee0bf,_0x17ee01[_0xc653('0x40')]);return db['Variable'][_0xc653('0x49')](_0x4ee0bf)[_0xc653('0x23')](handleEntityNotFound(_0x49b4e8,null))[_0xc653('0x23')](respondWithResult(_0x49b4e8,null))['catch'](handleError(_0x49b4e8,null));};exports[_0xc653('0x4a')]=function(_0x469df5,_0x2373f8){return db[_0xc653('0x41')][_0xc653('0x4a')](_0x469df5[_0xc653('0x4b')],{})['then'](function(_0xabf5a9){var _0x195984=_0x469df5[_0xc653('0x4c')][_0xc653('0x25')]({'plain':!![]});if(!_0x195984)throw new Error(_0xc653('0x4d'));if(_0x195984[_0xc653('0x4e')]===_0xc653('0x4c')){var _0x4bb3f7=_0xabf5a9[_0xc653('0x25')]({'plain':!![]});var _0x85c50d='Variables';return db[_0xc653('0x4f')]['find']({'where':{'name':_0x85c50d,'userProfileId':_0x195984['userProfileId']},'raw':!![]})[_0xc653('0x23')](function(_0x57813e){if(_0x57813e&&_0x57813e[_0xc653('0x50')]===0x0){return db['UserProfileResource'][_0xc653('0x4a')]({'name':_0x4bb3f7[_0xc653('0x29')],'resourceId':_0x4bb3f7['id'],'type':_0x57813e[_0xc653('0x29')],'sectionId':_0x57813e['id']},{})[_0xc653('0x23')](function(){return _0xabf5a9;});}else{return _0xabf5a9;}})['catch'](function(_0x346097){logger[_0xc653('0x51')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x346097);throw _0x346097;});}return _0xabf5a9;})[_0xc653('0x23')](respondWithResult(_0x2373f8,0xc9))['catch'](handleError(_0x2373f8,null));};exports['update']=function(_0xb5e8c1,_0x5ca2cf){if(_0xb5e8c1['body']['id']){delete _0xb5e8c1[_0xc653('0x4b')]['id'];}return db[_0xc653('0x41')][_0xc653('0x49')]({'where':{'id':_0xb5e8c1[_0xc653('0x44')]['id']}})[_0xc653('0x23')](handleEntityNotFound(_0x5ca2cf,null))[_0xc653('0x23')](saveUpdates(_0xb5e8c1[_0xc653('0x4b')],null))[_0xc653('0x23')](respondWithResult(_0x5ca2cf,null))[_0xc653('0x52')](handleError(_0x5ca2cf,null));};exports[_0xc653('0x24')]=function(_0x5cad3f,_0x497fc2){return db[_0xc653('0x41')][_0xc653('0x49')]({'where':{'id':_0x5cad3f[_0xc653('0x44')]['id']}})['then'](handleEntityNotFound(_0x497fc2,null))[_0xc653('0x23')](removeEntity(_0x497fc2,null))['catch'](handleError(_0x497fc2,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 7f15b33..6759c75 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 _0x457f=['api','moment','bluebird','path','rimraf','./variable.attributes','exports','tools_variables','lodash','util','../../config/logger'];(function(_0x19b774,_0x1c9b5b){var _0x158528=function(_0x2a4b7b){while(--_0x2a4b7b){_0x19b774['push'](_0x19b774['shift']());}};_0x158528(++_0x1c9b5b);}(_0x457f,0x1e1));var _0xf457=function(_0x15ddfe,_0x5625a8){_0x15ddfe=_0x15ddfe-0x0;var _0x38b9df=_0x457f[_0x15ddfe];return _0x38b9df;};'use strict';var _=require(_0xf457('0x0'));var util=require(_0xf457('0x1'));var logger=require(_0xf457('0x2'))(_0xf457('0x3'));var moment=require(_0xf457('0x4'));var BPromise=require(_0xf457('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf457('0x6'));var rimraf=require(_0xf457('0x7'));var config=require('../../config/environment');var attributes=require(_0xf457('0x8'));module[_0xf457('0x9')]=function(_0x141cfb,_0x4eea55){return _0x141cfb['define']('Variable',attributes,{'tableName':_0xf457('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6f7c=['path','rimraf','exports','define','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x161cca,_0x2fc882){var _0x3629c1=function(_0x51f20a){while(--_0x51f20a){_0x161cca['push'](_0x161cca['shift']());}};_0x3629c1(++_0x2fc882);}(_0x6f7c,0x199));var _0xc6f7=function(_0x521e54,_0x5bbbc5){_0x521e54=_0x521e54-0x0;var _0x4badcc=_0x6f7c[_0x521e54];return _0x4badcc;};'use strict';var _=require(_0xc6f7('0x0'));var util=require(_0xc6f7('0x1'));var logger=require(_0xc6f7('0x2'))('api');var moment=require('moment');var BPromise=require(_0xc6f7('0x3'));var rp=require(_0xc6f7('0x4'));var fs=require('fs');var path=require(_0xc6f7('0x5'));var rimraf=require(_0xc6f7('0x6'));var config=require('../../config/environment');var attributes=require('./variable.attributes');module[_0xc6f7('0x7')]=function(_0x4c097a,_0x56e489){return _0x4c097a[_0xc6f7('0x8')]('Variable',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 ec2a76c..7182dcd 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 _0xf494=['where','attributes','include','map','model','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','Variable,\x20%s,\x20%s,\x20%s','error','message','catch','ShowVariable','find','options','raw'];(function(_0x10526e,_0x485586){var _0x20e8a5=function(_0x522e48){while(--_0x522e48){_0x10526e['push'](_0x10526e['shift']());}};_0x20e8a5(++_0x485586);}(_0xf494,0x1c6));var _0x4f49=function(_0x278561,_0x215445){_0x278561=_0x278561-0x0;var _0x1a4a6d=_0xf494[_0x278561];return _0x1a4a6d;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});}exports[_0x4f49('0x16')]=function(_0x4e85df){var _0x49cdaf=this;return new Promise(function(_0x5bb23b,_0x560592){return db['Variable'][_0x4f49('0x17')]({'raw':_0x4e85df[_0x4f49('0x18')]?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x19')]===undefined?!![]:![]:!![],'where':_0x4e85df['options']?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x1a')]||null:null,'attributes':_0x4e85df[_0x4f49('0x18')]?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x1b')]||null:null,'include':_0x4e85df['options']?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x1c')]?_[_0x4f49('0x1d')](_0x4e85df['options'][_0x4f49('0x1c')],function(_0x1d70a7){return{'model':db[_0x1d70a7[_0x4f49('0x1e')]],'as':_0x1d70a7['as'],'attributes':_0x1d70a7[_0x4f49('0x1b')],'include':_0x1d70a7[_0x4f49('0x1c')]?_[_0x4f49('0x1d')](_0x1d70a7['include'],function(_0x4e9041){return{'model':db[_0x4e9041[_0x4f49('0x1e')]],'as':_0x4e9041['as'],'attributes':_0x4e9041[_0x4f49('0x1b')],'include':_0x4e9041['include']?_[_0x4f49('0x1d')](_0x4e9041[_0x4f49('0x1c')],function(_0x35f8e0){return{'model':db[_0x35f8e0['model']],'as':_0x35f8e0['as'],'attributes':_0x35f8e0[_0x4f49('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4f49('0xe')](function(_0x298785){logger[_0x4f49('0xf')](_0x4f49('0x16'),_0x4e85df);logger[_0x4f49('0x1f')]('ShowVariable',_0x4e85df,JSON['stringify'](_0x298785));_0x5bb23b(_0x298785);})[_0x4f49('0x15')](function(_0x2c00ee){logger[_0x4f49('0x13')]('ShowVariable',_0x2c00ee[_0x4f49('0x14')],_0x4e85df);_0x560592(_0x49cdaf[_0x4f49('0x13')](0x1f4,_0x2c00ee[_0x4f49('0x14')]));});});}; \ No newline at end of file +var _0x55ca=['options','where','attributes','include','map','model','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowVariable','Variable','find'];(function(_0x31e0a2,_0x1b51ab){var _0x19d493=function(_0x55d390){while(--_0x55d390){_0x31e0a2['push'](_0x31e0a2['shift']());}};_0x19d493(++_0x1b51ab);}(_0x55ca,0x126));var _0xa55c=function(_0x2972cf,_0x343fde){_0x2972cf=_0x2972cf-0x0;var _0x4c173f=_0x55ca[_0x2972cf];return _0x4c173f;};'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')]('Variable,\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')]('Variable,\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);});});}exports[_0xa55c('0x17')]=function(_0x24783b){var _0x4cee3c=this;return new Promise(function(_0x3d4c9e,_0x104a99){return db[_0xa55c('0x18')][_0xa55c('0x19')]({'raw':_0x24783b[_0xa55c('0x1a')]?_0x24783b[_0xa55c('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x24783b['options']?_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1b')]||null:null,'attributes':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1c')]||null:null,'include':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1d')],function(_0x234372){return{'model':db[_0x234372['model']],'as':_0x234372['as'],'attributes':_0x234372[_0xa55c('0x1c')],'include':_0x234372['include']?_['map'](_0x234372['include'],function(_0x19ae88){return{'model':db[_0x19ae88['model']],'as':_0x19ae88['as'],'attributes':_0x19ae88[_0xa55c('0x1c')],'include':_0x19ae88[_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x19ae88[_0xa55c('0x1d')],function(_0x2313a9){return{'model':db[_0x2313a9[_0xa55c('0x1f')]],'as':_0x2313a9['as'],'attributes':_0x2313a9[_0xa55c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa55c('0xb')](function(_0x192df2){logger[_0xa55c('0x14')](_0xa55c('0x17'),_0x24783b);logger['debug'](_0xa55c('0x17'),_0x24783b,JSON[_0xa55c('0x10')](_0x192df2));_0x3d4c9e(_0x192df2);})[_0xa55c('0x16')](function(_0x906caa){logger['error'](_0xa55c('0x17'),_0x906caa[_0xa55c('0x13')],_0x24783b);_0x104a99(_0x4cee3c[_0xa55c('0x11')](0x1f4,_0x906caa[_0xa55c('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 1260e68..334dc3d 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 _0x31d3=['pull','restart','/migrations','migrations','Router','./version.controller','get','index','/fetch','fetch','/reset','isAuthenticated','canUpdate','reset','/pull'];(function(_0x164813,_0x2acce1){var _0x5605f5=function(_0x2b5fab){while(--_0x2b5fab){_0x164813['push'](_0x164813['shift']());}};_0x5605f5(++_0x2acce1);}(_0x31d3,0xf4));var _0x331d=function(_0x486f4a,_0x478dc7){_0x486f4a=_0x486f4a-0x0;var _0x135d99=_0x31d3[_0x486f4a];return _0x135d99;};'use strict';var express=require('express');var router=express[_0x331d('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x331d('0x1'));router[_0x331d('0x2')]('/',controller[_0x331d('0x3')]);router[_0x331d('0x2')](_0x331d('0x4'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x331d('0x5')]);router['get'](_0x331d('0x6'),auth[_0x331d('0x7')](),auth[_0x331d('0x8')](),controller[_0x331d('0x9')]);router['get'](_0x331d('0xa'),auth['isAuthenticated'](),auth[_0x331d('0x8')](),controller[_0x331d('0xb')]);router[_0x331d('0x2')]('/restart',auth[_0x331d('0x7')](),controller[_0x331d('0xc')]);router[_0x331d('0x2')](_0x331d('0xd'),controller[_0x331d('0xe')]);module['exports']=router; \ No newline at end of file +var _0xf57d=['isAuthenticated','canUpdate','fetch','/reset','/pull','/migrations','migrations','Router','../../components/auth/service','./version.controller','get'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf57d,0xc2));var _0xdf57=function(_0x16ca4a,_0x1ed3e7){_0x16ca4a=_0x16ca4a-0x0;var _0x48f844=_0xf57d[_0x16ca4a];return _0x48f844;};'use strict';var express=require('express');var router=express[_0xdf57('0x0')]();var auth=require(_0xdf57('0x1'));var controller=require(_0xdf57('0x2'));router[_0xdf57('0x3')]('/',controller['index']);router[_0xdf57('0x3')]('/fetch',auth[_0xdf57('0x4')](),auth[_0xdf57('0x5')](),controller[_0xdf57('0x6')]);router[_0xdf57('0x3')](_0xdf57('0x7'),auth[_0xdf57('0x4')](),auth[_0xdf57('0x5')](),controller['reset']);router[_0xdf57('0x3')](_0xdf57('0x8'),auth[_0xdf57('0x4')](),auth[_0xdf57('0x5')](),controller['pull']);router[_0xdf57('0x3')]('/restart',auth[_0xdf57('0x4')](),controller['restart']);router[_0xdf57('0x3')](_0xdf57('0x9'),controller[_0xdf57('0xa')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 19101ba..86f67ba 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 _0x1ae7=['root','index','query','tags','latest','2.0.0','status','json','fetch','origin','master','error','git\x20fetch','git\x20fetch\x20origin\x20master','reset','FETCH_HEAD','info','npm\x20install\x20--production','restart','pm2\x20restart\x20motion\x20%s','catch','migrations','readdirSync','join','server','length','replace','.js','exports','push','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/logger','update','simple-git'];(function(_0x57f38a,_0x52377d){var _0x36694a=function(_0x594c6b){while(--_0x594c6b){_0x57f38a['push'](_0x57f38a['shift']());}};_0x36694a(++_0x52377d);}(_0x1ae7,0x101));var _0x71ae=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x1ae7[_0x37bd26];return _0xe83dc4;};'use strict';var Umzug=require(_0x71ae('0x0'));var path=require(_0x71ae('0x1'));var fs=require('fs');var _=require(_0x71ae('0x2'));var pkginfo=require(_0x71ae('0x3'))(module,_0x71ae('0x4'));var compareVersions=require(_0x71ae('0x5'));var exec=require(_0x71ae('0x6'))[_0x71ae('0x7')];var db=require(_0x71ae('0x8'))['db'];var config=require(_0x71ae('0x9'));var pm2=require('../../config/pm2');var logger=require(_0x71ae('0xa'))(_0x71ae('0xb'));var git=require(_0x71ae('0xc'))(config[_0x71ae('0xd')]);exports[_0x71ae('0xe')]=function(_0x546285,_0xeba1e2){var _0x56610c={'current':module['exports'][_0x71ae('0x4')],'phonebar':0x2};if(_0x546285[_0x71ae('0xf')]&&_0x546285['query']['latest']){return git['fetch']()[_0x71ae('0x10')](function(_0xb3c8ce,_0x220546){_0x56610c[_0x71ae('0x11')]=(_0xb3c8ce?module['exports'][_0x71ae('0x4')]:_0x220546[_0x71ae('0x11')])||_0x71ae('0x12');return _0xeba1e2[_0x71ae('0x13')](0xc8)[_0x71ae('0x14')](_0x56610c);});}else{return _0xeba1e2[_0x71ae('0x13')](0xc8)[_0x71ae('0x14')](_0x56610c);}};exports[_0x71ae('0x15')]=function(_0x2d1b71,_0x279917){return git[_0x71ae('0x15')]([_0x71ae('0x16'),_0x71ae('0x17')],function(_0x55944f){if(_0x55944f){logger[_0x71ae('0x18')](_0x55944f);return _0x279917[_0x71ae('0x13')](0x1f4)[_0x71ae('0x14')](_0x55944f);}logger['info'](_0x71ae('0x19'));return _0x279917['status'](0xc8)[_0x71ae('0x14')]({'output':_0x71ae('0x1a')});});};exports[_0x71ae('0x1b')]=function(_0x185fcb,_0x38b387){return git['reset'](['--hard',_0x71ae('0x1c')],function(_0x285e70){if(_0x285e70){logger['error'](_0x285e70);return _0x38b387[_0x71ae('0x13')](0x1f4)['json'](_0x285e70);}logger[_0x71ae('0x1d')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x38b387[_0x71ae('0x13')](0xc8)[_0x71ae('0x14')]({'output':'git\x20reset\x20--hard'});});};exports['pull']=function(_0x5f1d1c,_0x38fd76){exec(_0x71ae('0x1e'),function(_0x131b32,_0x448fea,_0x4266a8){logger['info'](_0x448fea);logger[_0x71ae('0x1d')](_0x4266a8);if(_0x131b32){logger[_0x71ae('0x18')](_0x131b32);return _0x38fd76[_0x71ae('0x13')](0x1f4)['json'](_0x131b32);}return _0x38fd76[_0x71ae('0x13')](0xc8)[_0x71ae('0x14')]({'output':_0x448fea});});};exports[_0x71ae('0x1f')]=function(_0x901ed9,_0x5414b6){return pm2[_0x71ae('0x1f')]('motion2')['then'](function(_0x1c9fc5){logger['info'](_0x71ae('0x20'),_0x1c9fc5);return _0x5414b6[_0x71ae('0x13')](0xc8)['json']({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0x71ae('0x21')](function(_0x346cee){logger[_0x71ae('0x18')](_0x346cee);return _0x5414b6['status'](0x1f4)[_0x71ae('0x14')](_0x346cee);});};exports[_0x71ae('0x22')]=function(_0x30a2ad,_0x438d54){var _0x2bccbe=fs[_0x71ae('0x23')](path[_0x71ae('0x24')](config[_0x71ae('0xd')],_0x71ae('0x25'),_0x71ae('0x22')));var _0x54a0a2=[];for(var _0x2440f1=0x0;_0x2440f1<_0x2bccbe[_0x71ae('0x26')];_0x2440f1++){var _0x1835d2=_0x2bccbe[_0x2440f1][_0x71ae('0x27')](_0x71ae('0x28'),'');if(compareVersions(module[_0x71ae('0x29')]['version'],_0x1835d2)===-0x1){_0x54a0a2[_0x71ae('0x2a')](_0x1835d2);}}if(_0x54a0a2[_0x71ae('0x26')]){var _0x5c46ff=_0x54a0a2['sort'](compareVersions);var _0x2e47e2=new Umzug({'storage':_0x71ae('0x2b'),'storageOptions':{'model':db[_0x71ae('0x2c')],'modelName':'Migration','columnName':_0x71ae('0x4')},'migrations':{'params':[db['sequelize'][_0x71ae('0x2d')](),db[_0x71ae('0x2b')][_0x71ae('0x2e')],function(){throw new Error(_0x71ae('0x2f'));}],'path':path[_0x71ae('0x24')](config['root'],_0x71ae('0x25'),'migrations'),'pattern':/\.js$/}});_0x2e47e2['up']({'migrations':_[_0x71ae('0x30')](_0x5c46ff,function(_0x376ada){return _0x376ada+_0x71ae('0x28');})})['then'](function(){return _0x438d54[_0x71ae('0x13')](0xc8)[_0x71ae('0x14')]({'output':_0x71ae('0x31')+module[_0x71ae('0x29')][_0x71ae('0x4')]+_0x71ae('0x32')+_[_0x71ae('0x33')](_0x5c46ff),'migrations':_[_0x71ae('0x24')](_0x5c46ff)});})['catch'](function(_0x504b2c){if(_0x504b2c instanceof db['sequelize'][_0x71ae('0x34')]){return _0x438d54[_0x71ae('0x13')](0xc8)[_0x71ae('0x14')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x438d54['status'](0x1f4)[_0x71ae('0x14')](_0x504b2c);}});}else{return _0x438d54[_0x71ae('0x13')](0xc8)[_0x71ae('0x14')]({'output':_0x71ae('0x35')});}}; \ No newline at end of file +var _0x1854=['git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','readdirSync','length','replace','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','server','map','.js','then','last','UniqueConstraintError','Database\x20already\x20up-to-date','lodash','child_process','../../config/environment','../../config/pm2','../../config/logger','simple-git','root','index','exports','version','query','tags','json','status','fetch','master','error','info'];(function(_0x174870,_0x398b8a){var _0x352f5b=function(_0x412121){while(--_0x412121){_0x174870['push'](_0x174870['shift']());}};_0x352f5b(++_0x398b8a);}(_0x1854,0x114));var _0x4185=function(_0x398294,_0x5ceb9d){_0x398294=_0x398294-0x0;var _0x2a872d=_0x1854[_0x398294];return _0x2a872d;};'use strict';var Umzug=require('umzug');var path=require('path');var fs=require('fs');var _=require(_0x4185('0x0'));var pkginfo=require('pkginfo')(module,'version');var compareVersions=require('compare-versions');var exec=require(_0x4185('0x1'))['exec'];var db=require('../../mysqldb')['db'];var config=require(_0x4185('0x2'));var pm2=require(_0x4185('0x3'));var logger=require(_0x4185('0x4'))('update');var git=require(_0x4185('0x5'))(config[_0x4185('0x6')]);exports[_0x4185('0x7')]=function(_0x35f091,_0x51551a){var _0x760ba7={'current':module[_0x4185('0x8')][_0x4185('0x9')],'phonebar':0x2};if(_0x35f091[_0x4185('0xa')]&&_0x35f091[_0x4185('0xa')]['latest']){return git['fetch']()[_0x4185('0xb')](function(_0x210002,_0x1567f7){_0x760ba7['latest']=(_0x210002?module[_0x4185('0x8')]['version']:_0x1567f7['latest'])||'2.0.0';return _0x51551a['status'](0xc8)[_0x4185('0xc')](_0x760ba7);});}else{return _0x51551a[_0x4185('0xd')](0xc8)['json'](_0x760ba7);}};exports[_0x4185('0xe')]=function(_0x1322fd,_0x16e0c0){return git[_0x4185('0xe')](['origin',_0x4185('0xf')],function(_0x447488){if(_0x447488){logger[_0x4185('0x10')](_0x447488);return _0x16e0c0[_0x4185('0xd')](0x1f4)['json'](_0x447488);}logger[_0x4185('0x11')](_0x4185('0x12'));return _0x16e0c0[_0x4185('0xd')](0xc8)['json']({'output':_0x4185('0x13')});});};exports[_0x4185('0x14')]=function(_0x34a098,_0x1b5e2c){return git[_0x4185('0x14')]([_0x4185('0x15'),_0x4185('0x16')],function(_0x45dcb5){if(_0x45dcb5){logger['error'](_0x45dcb5);return _0x1b5e2c[_0x4185('0xd')](0x1f4)[_0x4185('0xc')](_0x45dcb5);}logger['info'](_0x4185('0x17'));return _0x1b5e2c[_0x4185('0xd')](0xc8)[_0x4185('0xc')]({'output':_0x4185('0x18')});});};exports[_0x4185('0x19')]=function(_0x2b4c6f,_0x4a0d8b){exec(_0x4185('0x1a'),function(_0x451f3b,_0x24fb58,_0x50b32e){logger[_0x4185('0x11')](_0x24fb58);logger[_0x4185('0x11')](_0x50b32e);if(_0x451f3b){logger['error'](_0x451f3b);return _0x4a0d8b['status'](0x1f4)[_0x4185('0xc')](_0x451f3b);}return _0x4a0d8b[_0x4185('0xd')](0xc8)['json']({'output':_0x24fb58});});};exports['restart']=function(_0xce87dd,_0x3c40e4){return pm2[_0x4185('0x1b')](_0x4185('0x1c'))['then'](function(_0x778059){logger[_0x4185('0x11')](_0x4185('0x1d'),_0x778059);return _0x3c40e4[_0x4185('0xd')](0xc8)[_0x4185('0xc')]({'output':_0x4185('0x1e')});})['catch'](function(_0x1bfff7){logger[_0x4185('0x10')](_0x1bfff7);return _0x3c40e4['status'](0x1f4)['json'](_0x1bfff7);});};exports[_0x4185('0x1f')]=function(_0x4b48cd,_0x388e20){var _0x184c8c=fs[_0x4185('0x20')](path['join'](config['root'],'server',_0x4185('0x1f')));var _0x5b057a=[];for(var _0x17db18=0x0;_0x17db18<_0x184c8c[_0x4185('0x21')];_0x17db18++){var _0x225a03=_0x184c8c[_0x17db18][_0x4185('0x22')]('.js','');if(compareVersions(module[_0x4185('0x8')][_0x4185('0x9')],_0x225a03)===-0x1){_0x5b057a['push'](_0x225a03);}}if(_0x5b057a['length']){var _0x3c9e63=_0x5b057a[_0x4185('0x23')](compareVersions);var _0x50bc90=new Umzug({'storage':_0x4185('0x24'),'storageOptions':{'model':db['Migration'],'modelName':_0x4185('0x25'),'columnName':'version'},'migrations':{'params':[db['sequelize'][_0x4185('0x26')](),db[_0x4185('0x24')][_0x4185('0x27')],function(){throw new Error(_0x4185('0x28'));}],'path':path[_0x4185('0x29')](config[_0x4185('0x6')],_0x4185('0x2a'),_0x4185('0x1f')),'pattern':/\.js$/}});_0x50bc90['up']({'migrations':_[_0x4185('0x2b')](_0x3c9e63,function(_0x23411b){return _0x23411b+_0x4185('0x2c');})})[_0x4185('0x2d')](function(){return _0x388e20[_0x4185('0xd')](0xc8)['json']({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x4185('0x8')][_0x4185('0x9')]+'\x20to\x20'+_[_0x4185('0x2e')](_0x3c9e63),'migrations':_['join'](_0x3c9e63)});})['catch'](function(_0x4ba38c){if(_0x4ba38c instanceof db[_0x4185('0x24')][_0x4185('0x2f')]){return _0x388e20['status'](0xc8)[_0x4185('0xc')]({'output':_0x4185('0x30')});}else{return _0x388e20['status'](0x1f4)['json'](_0x4ba38c);}});}else{return _0x388e20['status'](0xc8)['json']({'output':_0x4185('0x30')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 7cabf0d..47d247f 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 _0xe699=['update','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put'];(function(_0xcb4af1,_0x1284e4){var _0x582348=function(_0x2b3e12){while(--_0x2b3e12){_0xcb4af1['push'](_0xcb4af1['shift']());}};_0x582348(++_0x1284e4);}(_0xe699,0x19f));var _0x9e69=function(_0x3775aa,_0x162518){_0x3775aa=_0x3775aa-0x0;var _0x413917=_0xe699[_0x3775aa];return _0x413917;};'use strict';var multer=require(_0x9e69('0x0'));var util=require('util');var path=require(_0x9e69('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9e69('0x2')]();var fs_extra=require(_0x9e69('0x3'));var auth=require(_0x9e69('0x4'));var interaction=require(_0x9e69('0x5'));var config=require(_0x9e69('0x6'));var controller=require(_0x9e69('0x7'));router[_0x9e69('0x8')]('/',auth[_0x9e69('0x9')](),controller[_0x9e69('0xa')]);router['get'](_0x9e69('0xb'),auth[_0x9e69('0x9')](),controller['describe']);router['get'](_0x9e69('0xc'),auth[_0x9e69('0x9')](),controller[_0x9e69('0xd')]);router[_0x9e69('0xe')]('/',auth[_0x9e69('0x9')](),controller[_0x9e69('0xf')]);router[_0x9e69('0x10')](_0x9e69('0xc'),auth[_0x9e69('0x9')](),controller[_0x9e69('0x11')]);router['delete'](_0x9e69('0xc'),auth[_0x9e69('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x5225=['update','delete','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','post','create','/:id'];(function(_0x5c0e6a,_0x2f4d54){var _0x442b5f=function(_0x2f2b94){while(--_0x2f2b94){_0x5c0e6a['push'](_0x5c0e6a['shift']());}};_0x442b5f(++_0x2f4d54);}(_0x5225,0xd2));var _0x5522=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x5225[_0x5f0089];return _0x193892;};'use strict';var multer=require(_0x5522('0x0'));var util=require('util');var path=require(_0x5522('0x1'));var timeout=require('connect-timeout');var express=require(_0x5522('0x2'));var router=express['Router']();var fs_extra=require(_0x5522('0x3'));var auth=require(_0x5522('0x4'));var interaction=require(_0x5522('0x5'));var config=require(_0x5522('0x6'));var controller=require('./voiceAgentReport.controller');router[_0x5522('0x7')]('/',auth[_0x5522('0x8')](),controller[_0x5522('0x9')]);router[_0x5522('0x7')](_0x5522('0xa'),auth[_0x5522('0x8')](),controller['describe']);router[_0x5522('0x7')]('/:id',auth[_0x5522('0x8')](),controller['show']);router[_0x5522('0xb')]('/',auth['isAuthenticated'](),controller[_0x5522('0xc')]);router['put'](_0x5522('0xd'),auth['isAuthenticated'](),controller[_0x5522('0xe')]);router[_0x5522('0xf')](_0x5522('0xd'),auth[_0x5522('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index f718543..ab115c7 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 _0xc7da=['DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING'];(function(_0x22ad50,_0x456b90){var _0x3e8eb3=function(_0x1343ca){while(--_0x1343ca){_0x22ad50['push'](_0x22ad50['shift']());}};_0x3e8eb3(++_0x456b90);}(_0xc7da,0xf2));var _0xac7d=function(_0x1e035d,_0x3e4451){_0x1e035d=_0x1e035d-0x0;var _0x542f86=_0xc7da[_0x1e035d];return _0x542f86;};'use strict';var Sequelize=require(_0xac7d('0x0'));module[_0xac7d('0x1')]={'type':{'type':Sequelize[_0xac7d('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xac7d('0x2')]},'calleridname':{'type':Sequelize[_0xac7d('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xac7d('0x2')]},'membername':{'type':Sequelize[_0xac7d('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0xac7d('0x3')]},'agentcompleteAt':{'type':Sequelize[_0xac7d('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0xac7d('0x3')]},'agentdumpAt':{'type':Sequelize[_0xac7d('0x3')]},'holdtime':{'type':Sequelize[_0xac7d('0x4')]},'agentcomplete':{'type':Sequelize[_0xac7d('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xac7d('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xac7d('0x4')]},'agentacw':{'type':Sequelize[_0xac7d('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xac7d('0x4')]},'reason':{'type':Sequelize[_0xac7d('0x2')]},'lastevent':{'type':Sequelize[_0xac7d('0x2')]},'channel':{'type':Sequelize[_0xac7d('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xac7d('0x2')]},'connectedlinenum':{'type':Sequelize[_0xac7d('0x2')]},'connectedlinename':{'type':Sequelize[_0xac7d('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xac7d('0x2')]},'context':{'type':Sequelize[_0xac7d('0x2')]},'exten':{'type':Sequelize[_0xac7d('0x2')]},'priority':{'type':Sequelize[_0xac7d('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xac7d('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0xac7d('0x2')]},'destcalleridnum':{'type':Sequelize[_0xac7d('0x2')]},'destcalleridname':{'type':Sequelize[_0xac7d('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xac7d('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xac7d('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xac7d('0x2')]},'destexten':{'type':Sequelize[_0xac7d('0x2')]},'destpriority':{'type':Sequelize[_0xac7d('0x2')]},'destuniqueid':{'type':Sequelize[_0xac7d('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0xac7d('0x2')]},'transfer':{'type':Sequelize[_0xac7d('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xac7d('0x2')],'comment':_0xac7d('0x6')},'transferexten':{'type':Sequelize[_0xac7d('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0xac7d('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xdeb3=['INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','exports','STRING','DATE'];(function(_0x534c33,_0x120ebc){var _0x22b732=function(_0x2ecd80){while(--_0x2ecd80){_0x534c33['push'](_0x534c33['shift']());}};_0x22b732(++_0x120ebc);}(_0xdeb3,0xb7));var _0x3deb=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xdeb3[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require('sequelize');module[_0x3deb('0x0')]={'type':{'type':Sequelize[_0x3deb('0x1')]},'uniqueid':{'type':Sequelize[_0x3deb('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x3deb('0x1')]},'interface':{'type':Sequelize[_0x3deb('0x1')]},'membername':{'type':Sequelize[_0x3deb('0x1')]},'agentcalledAt':{'type':Sequelize[_0x3deb('0x2')]},'agentconnectAt':{'type':Sequelize[_0x3deb('0x2')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x3deb('0x2')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x3deb('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x3deb('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x3deb('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x3deb('0x3')]},'agentacw':{'type':Sequelize[_0x3deb('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x3deb('0x3')]},'reason':{'type':Sequelize[_0x3deb('0x1')]},'lastevent':{'type':Sequelize[_0x3deb('0x1')]},'channel':{'type':Sequelize[_0x3deb('0x1')]},'channelstate':{'type':Sequelize[_0x3deb('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x3deb('0x1')]},'language':{'type':Sequelize[_0x3deb('0x1')]},'accountcode':{'type':Sequelize[_0x3deb('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x3deb('0x1')]},'priority':{'type':Sequelize[_0x3deb('0x1')]},'destchannel':{'type':Sequelize[_0x3deb('0x1')]},'destchannelstate':{'type':Sequelize[_0x3deb('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x3deb('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x3deb('0x1')]},'destlanguage':{'type':Sequelize[_0x3deb('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x3deb('0x1')]},'destexten':{'type':Sequelize[_0x3deb('0x1')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x3deb('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x3deb('0x1')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x3deb('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x3deb('0x5')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0x3deb('0x3')],'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 70ddfef..24fc20d 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(_0x31a371,_0x50828e){var _0x2a5bd6=function(_0x2fb481){while(--_0x2fb481){_0x31a371['push'](_0x31a371['shift']());}};_0x2a5bd6(++_0x50828e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'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(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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 866d754..3c39001 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 _0xc3a8=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports','define','VoiceAgentReport','report_agent','destuniqueid','lodash','util'];(function(_0x16b08f,_0x36b3e4){var _0x1c7583=function(_0x473892){while(--_0x473892){_0x16b08f['push'](_0x16b08f['shift']());}};_0x1c7583(++_0x36b3e4);}(_0xc3a8,0xe8));var _0x8c3a=function(_0x282ccc,_0x5d66a1){_0x282ccc=_0x282ccc-0x0;var _0x27c2dd=_0xc3a8[_0x282ccc];return _0x27c2dd;};'use strict';var _=require(_0x8c3a('0x0'));var util=require(_0x8c3a('0x1'));var logger=require(_0x8c3a('0x2'))('api');var moment=require(_0x8c3a('0x3'));var BPromise=require('bluebird');var rp=require(_0x8c3a('0x4'));var fs=require('fs');var path=require(_0x8c3a('0x5'));var rimraf=require(_0x8c3a('0x6'));var config=require(_0x8c3a('0x7'));var attributes=require('./voiceAgentReport.attributes');module[_0x8c3a('0x8')]=function(_0x2477f9,_0x18a92a){return _0x2477f9[_0x8c3a('0x9')](_0x8c3a('0xa'),attributes,{'tableName':_0x8c3a('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid',_0x8c3a('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb717=['uniqueid','destuniqueid','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xb717,0x1b4));var _0x7b71=function(_0x2badde,_0x7760ed){_0x2badde=_0x2badde-0x0;var _0x5348e1=_0xb717[_0x2badde];return _0x5348e1;};'use strict';var _=require(_0x7b71('0x0'));var util=require('util');var logger=require(_0x7b71('0x1'))('api');var moment=require(_0x7b71('0x2'));var BPromise=require(_0x7b71('0x3'));var rp=require(_0x7b71('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b71('0x5'));var config=require(_0x7b71('0x6'));var attributes=require(_0x7b71('0x7'));module[_0x7b71('0x8')]=function(_0x3d3643,_0x593c15){return _0x3d3643[_0x7b71('0x9')](_0x7b71('0xa'),attributes,{'tableName':_0x7b71('0xb'),'paranoid':![],'indexes':[{'fields':[_0x7b71('0xc'),_0x7b71('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index e2bd2b7..ebba362 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 _0x1f5e=['result','VoiceAgentReport','create','body','options','CreateVoiceAgentReport','debug','catch','where','limit','UpdateVoiceAgentReport','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','VoiceAgentReport,\x20%s,\x20%s','message'];(function(_0x2b91c5,_0x3b6db5){var _0xbd5531=function(_0x54783d){while(--_0x54783d){_0x2b91c5['push'](_0x2b91c5['shift']());}};_0xbd5531(++_0x3b6db5);}(_0x1f5e,0x68));var _0xe1f5=function(_0x1d66da,_0x94431){_0x1d66da=_0x1d66da-0x0;var _0x2ece6b=_0x1f5e[_0x1d66da];return _0x2ece6b;};'use strict';var _=require('lodash');var util=require(_0xe1f5('0x0'));var moment=require('moment');var BPromise=require(_0xe1f5('0x1'));var rs=require(_0xe1f5('0x2'));var fs=require('fs');var Redis=require(_0xe1f5('0x3'));var db=require(_0xe1f5('0x4'))['db'];var utils=require(_0xe1f5('0x5'));var logger=require(_0xe1f5('0x6'))(_0xe1f5('0x7'));var config=require(_0xe1f5('0x8'));var jayson=require(_0xe1f5('0x9'));var client=jayson[_0xe1f5('0xa')][_0xe1f5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f3d12,_0x2e3226,_0x2252f5){return new BPromise(function(_0x443a74,_0x4b6e83){return client['request'](_0x1f3d12,_0x2252f5)[_0xe1f5('0xc')](function(_0x148276){logger[_0xe1f5('0xd')]('VoiceAgentReport,\x20%s,\x20%s',_0x2e3226,_0xe1f5('0xe'));logger['debug'](_0xe1f5('0xf'),_0x2e3226,_0xe1f5('0xe'),JSON[_0xe1f5('0x10')](_0x148276));if(_0x148276[_0xe1f5('0x11')]){if(_0x148276[_0xe1f5('0x11')]['code']===0x1f4){logger['error'](_0xe1f5('0x12'),_0x2e3226,_0x148276[_0xe1f5('0x11')][_0xe1f5('0x13')]);return _0x4b6e83(_0x148276[_0xe1f5('0x11')]['message']);}logger[_0xe1f5('0x11')](_0xe1f5('0x12'),_0x2e3226,_0x148276[_0xe1f5('0x11')][_0xe1f5('0x13')]);return _0x443a74(_0x148276[_0xe1f5('0x11')][_0xe1f5('0x13')]);}else{logger[_0xe1f5('0xd')]('VoiceAgentReport,\x20%s,\x20%s',_0x2e3226,'request\x20sent');_0x443a74(_0x148276[_0xe1f5('0x14')][_0xe1f5('0x13')]);}})['catch'](function(_0xed14bf){logger[_0xe1f5('0x11')]('VoiceAgentReport,\x20%s,\x20%s',_0x2e3226,_0xed14bf);_0x4b6e83(_0xed14bf);});});}exports['CreateVoiceAgentReport']=function(_0x488e5b){var _0x551faf=this;return new Promise(function(_0x2c83c0,_0x59ed21){return db[_0xe1f5('0x15')][_0xe1f5('0x16')](_0x488e5b[_0xe1f5('0x17')],{'raw':_0x488e5b[_0xe1f5('0x18')]?_0x488e5b[_0xe1f5('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xe1f5('0xc')](function(_0x31b465){logger[_0xe1f5('0xd')](_0xe1f5('0x19'),_0x488e5b);logger[_0xe1f5('0x1a')](_0xe1f5('0x19'),_0x488e5b,JSON['stringify'](_0x31b465));_0x2c83c0(_0x31b465);})[_0xe1f5('0x1b')](function(_0xa6b093){logger[_0xe1f5('0x11')](_0xe1f5('0x19'),_0xa6b093[_0xe1f5('0x13')],_0x488e5b);_0x59ed21(_0x551faf['error'](0x1f4,_0xa6b093[_0xe1f5('0x13')]));});});};exports['UpdateVoiceAgentReport']=function(_0x193a1b){var _0x53b44e=this;return new Promise(function(_0x2e8b3a,_0x56ee1b){return db['VoiceAgentReport']['update'](_0x193a1b[_0xe1f5('0x17')],{'raw':_0x193a1b['options']?_0x193a1b[_0xe1f5('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x193a1b[_0xe1f5('0x18')]?_0x193a1b[_0xe1f5('0x18')][_0xe1f5('0x1c')]||null:null,'attributes':_0x193a1b[_0xe1f5('0x18')]?_0x193a1b[_0xe1f5('0x18')]['attributes']||null:null,'limit':_0x193a1b[_0xe1f5('0x18')]?_0x193a1b[_0xe1f5('0x18')][_0xe1f5('0x1d')]||null:null})[_0xe1f5('0xc')](function(_0x2e3a4b){logger['info'](_0xe1f5('0x1e'),_0x193a1b);logger[_0xe1f5('0x1a')](_0xe1f5('0x1e'),_0x193a1b,JSON[_0xe1f5('0x10')](_0x2e3a4b));_0x2e8b3a(_0x2e3a4b);})['catch'](function(_0xccb66f){logger[_0xe1f5('0x11')]('UpdateVoiceAgentReport',_0xccb66f['message'],_0x193a1b);_0x56ee1b(_0x53b44e[_0xe1f5('0x11')](0x1f4,_0xccb66f[_0xe1f5('0x13')]));});});}; \ No newline at end of file +var _0x99ac=['message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','debug','UpdateVoiceAgentReport','update','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error'];(function(_0x271aa2,_0x48801c){var _0x563a4d=function(_0x35b884){while(--_0x35b884){_0x271aa2['push'](_0x271aa2['shift']());}};_0x563a4d(++_0x48801c);}(_0x99ac,0x177));var _0xc99a=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0x99ac[_0x87b0ff];return _0x3bc0b2;};'use strict';var _=require(_0xc99a('0x0'));var util=require('util');var moment=require(_0xc99a('0x1'));var BPromise=require(_0xc99a('0x2'));var rs=require(_0xc99a('0x3'));var fs=require('fs');var Redis=require(_0xc99a('0x4'));var db=require(_0xc99a('0x5'))['db'];var utils=require(_0xc99a('0x6'));var logger=require('../../config/logger')(_0xc99a('0x7'));var config=require(_0xc99a('0x8'));var jayson=require(_0xc99a('0x9'));var client=jayson[_0xc99a('0xa')][_0xc99a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4df994,_0xcec79,_0x34912f){return new BPromise(function(_0x41371b,_0x1c8e49){return client[_0xc99a('0xc')](_0x4df994,_0x34912f)[_0xc99a('0xd')](function(_0x15ad9e){logger[_0xc99a('0xe')](_0xc99a('0xf'),_0xcec79,'request\x20sent');logger['debug'](_0xc99a('0x10'),_0xcec79,_0xc99a('0x11'),JSON[_0xc99a('0x12')](_0x15ad9e));if(_0x15ad9e['error']){if(_0x15ad9e['error'][_0xc99a('0x13')]===0x1f4){logger['error'](_0xc99a('0xf'),_0xcec79,_0x15ad9e[_0xc99a('0x14')][_0xc99a('0x15')]);return _0x1c8e49(_0x15ad9e[_0xc99a('0x14')][_0xc99a('0x15')]);}logger[_0xc99a('0x14')](_0xc99a('0xf'),_0xcec79,_0x15ad9e[_0xc99a('0x14')][_0xc99a('0x15')]);return _0x41371b(_0x15ad9e[_0xc99a('0x14')][_0xc99a('0x15')]);}else{logger[_0xc99a('0xe')](_0xc99a('0xf'),_0xcec79,_0xc99a('0x11'));_0x41371b(_0x15ad9e[_0xc99a('0x16')][_0xc99a('0x15')]);}})[_0xc99a('0x17')](function(_0x32a441){logger[_0xc99a('0x14')](_0xc99a('0xf'),_0xcec79,_0x32a441);_0x1c8e49(_0x32a441);});});}exports[_0xc99a('0x18')]=function(_0x5dfb60){var _0x2aff49=this;return new Promise(function(_0x12a7f3,_0x57f31a){return db[_0xc99a('0x19')][_0xc99a('0x1a')](_0x5dfb60[_0xc99a('0x1b')],{'raw':_0x5dfb60[_0xc99a('0x1c')]?_0x5dfb60['options'][_0xc99a('0x1d')]===undefined?!![]:![]:!![]})[_0xc99a('0xd')](function(_0x5cbedb){logger[_0xc99a('0xe')]('CreateVoiceAgentReport',_0x5dfb60);logger[_0xc99a('0x1e')](_0xc99a('0x18'),_0x5dfb60,JSON[_0xc99a('0x12')](_0x5cbedb));_0x12a7f3(_0x5cbedb);})[_0xc99a('0x17')](function(_0x27a916){logger[_0xc99a('0x14')](_0xc99a('0x18'),_0x27a916[_0xc99a('0x15')],_0x5dfb60);_0x57f31a(_0x2aff49[_0xc99a('0x14')](0x1f4,_0x27a916[_0xc99a('0x15')]));});});};exports[_0xc99a('0x1f')]=function(_0x2c9254){var _0x12f892=this;return new Promise(function(_0x48716c,_0x1d378c){return db[_0xc99a('0x19')][_0xc99a('0x20')](_0x2c9254['body'],{'raw':_0x2c9254[_0xc99a('0x1c')]?_0x2c9254[_0xc99a('0x1c')][_0xc99a('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c9254[_0xc99a('0x1c')]?_0x2c9254[_0xc99a('0x1c')][_0xc99a('0x21')]||null:null,'attributes':_0x2c9254['options']?_0x2c9254['options'][_0xc99a('0x22')]||null:null,'limit':_0x2c9254['options']?_0x2c9254[_0xc99a('0x1c')][_0xc99a('0x23')]||null:null})[_0xc99a('0xd')](function(_0x445d64){logger[_0xc99a('0xe')](_0xc99a('0x1f'),_0x2c9254);logger['debug'](_0xc99a('0x1f'),_0x2c9254,JSON['stringify'](_0x445d64));_0x48716c(_0x445d64);})[_0xc99a('0x17')](function(_0x3d5608){logger[_0xc99a('0x14')](_0xc99a('0x1f'),_0x3d5608['message'],_0x2c9254);_0x1d378c(_0x12f892[_0xc99a('0x14')](0x1f4,_0x3d5608[_0xc99a('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index e56b8d9..82bf641 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 _0x1cb9=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceCallReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put'];(function(_0x59cdaa,_0x29ed37){var _0x585b50=function(_0x3bac1f){while(--_0x3bac1f){_0x59cdaa['push'](_0x59cdaa['shift']());}};_0x585b50(++_0x29ed37);}(_0x1cb9,0x14e));var _0x91cb=function(_0x50ba67,_0x25db93){_0x50ba67=_0x50ba67-0x0;var _0xb53931=_0x1cb9[_0x50ba67];return _0xb53931;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var timeout=require(_0x91cb('0x2'));var express=require(_0x91cb('0x3'));var router=express[_0x91cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91cb('0x5'));var interaction=require(_0x91cb('0x6'));var config=require('../../config/environment');var controller=require(_0x91cb('0x7'));router[_0x91cb('0x8')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0xa')]);router[_0x91cb('0x8')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0xc')]);router['get'](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0xe')]);router[_0x91cb('0xf')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0x10')]);router[_0x91cb('0x11')](_0x91cb('0xd'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x12')]);router[_0x91cb('0x13')](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0x14')]);module[_0x91cb('0x15')]=router; \ No newline at end of file +var _0x425d=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceCallReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0xbacfad,_0x52a356){var _0x32c2f9=function(_0x4fabec){while(--_0x4fabec){_0xbacfad['push'](_0xbacfad['shift']());}};_0x32c2f9(++_0x52a356);}(_0x425d,0x1e0));var _0xd425=function(_0x1af577,_0x1bd440){_0x1af577=_0x1af577-0x0;var _0x18ec4f=_0x425d[_0x1af577];return _0x18ec4f;};'use strict';var multer=require(_0xd425('0x0'));var util=require('util');var path=require(_0xd425('0x1'));var timeout=require(_0xd425('0x2'));var express=require(_0xd425('0x3'));var router=express[_0xd425('0x4')]();var fs_extra=require(_0xd425('0x5'));var auth=require(_0xd425('0x6'));var interaction=require(_0xd425('0x7'));var config=require('../../config/environment');var controller=require(_0xd425('0x8'));router[_0xd425('0x9')]('/',auth[_0xd425('0xa')](),controller[_0xd425('0xb')]);router[_0xd425('0x9')](_0xd425('0xc'),auth['isAuthenticated'](),controller[_0xd425('0xd')]);router[_0xd425('0x9')](_0xd425('0xe'),auth[_0xd425('0xa')](),controller[_0xd425('0xf')]);router[_0xd425('0x10')]('/',auth[_0xd425('0xa')](),controller[_0xd425('0x11')]);router[_0xd425('0x12')](_0xd425('0xe'),auth[_0xd425('0xa')](),controller[_0xd425('0x13')]);router[_0xd425('0x14')](_0xd425('0xe'),auth[_0xd425('0xa')](),controller[_0xd425('0x15')]);module[_0xd425('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 33d9f15..927a667 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 _0xdd4f=['DATE','INTEGER','sequelize','inbound','internal','inbound-fax','outbound-fax','dialer','STRING','TEXT'];(function(_0x16b6b7,_0x36292f){var _0x504f96=function(_0x42dbad){while(--_0x42dbad){_0x16b6b7['push'](_0x16b6b7['shift']());}};_0x504f96(++_0x36292f);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x3f39bf,_0x2470da){_0x3f39bf=_0x3f39bf-0x0;var _0x314a83=_0xdd4f[_0x3f39bf];return _0x314a83;};'use strict';var Sequelize=require(_0xfdd4('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0xfdd4('0x1'),_0xfdd4('0x2'),'outbound',_0xfdd4('0x3'),_0xfdd4('0x4'),_0xfdd4('0x5'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xfdd4('0x6')]},'source':{'type':Sequelize[_0xfdd4('0x6')]},'destination':{'type':Sequelize[_0xfdd4('0x6')]},'destinationcontext':{'type':Sequelize[_0xfdd4('0x6')]},'callerid':{'type':Sequelize[_0xfdd4('0x6')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0xfdd4('0x6')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xfdd4('0x7')]},'starttime':{'type':Sequelize[_0xfdd4('0x8')]},'systemanswertime':{'type':Sequelize[_0xfdd4('0x8')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xfdd4('0x8')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0xfdd4('0x9')]},'mohtime':{'type':Sequelize[_0xfdd4('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xfdd4('0x6')]},'amaflags':{'type':Sequelize[_0xfdd4('0x6')]},'userfield':{'type':Sequelize[_0xfdd4('0x6')]},'userDisposition':{'type':Sequelize[_0xfdd4('0x6')]},'userSecondDisposition':{'type':Sequelize[_0xfdd4('0x6')]},'userThirdDisposition':{'type':Sequelize[_0xfdd4('0x6')]},'note':{'type':Sequelize[_0xfdd4('0x6')]},'prefix':{'type':Sequelize[_0xfdd4('0x6')]},'routeid':{'type':Sequelize[_0xfdd4('0x9')]},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x93e9=['internal','outbound','dialer','TEXT','DATE','INTEGER','sequelize','exports','STRING','ENUM','inbound'];(function(_0x4f5ae4,_0x4d1def){var _0x51d865=function(_0x1180ea){while(--_0x1180ea){_0x4f5ae4['push'](_0x4f5ae4['shift']());}};_0x51d865(++_0x4d1def);}(_0x93e9,0xcc));var _0x993e=function(_0x418c70,_0x87f331){_0x418c70=_0x418c70-0x0;var _0x4243ff=_0x93e9[_0x418c70];return _0x4243ff;};'use strict';var Sequelize=require(_0x993e('0x0'));module[_0x993e('0x1')]={'uniqueid':{'type':Sequelize[_0x993e('0x2')]},'type':{'type':Sequelize[_0x993e('0x3')](_0x993e('0x4'),_0x993e('0x5'),_0x993e('0x6'),'inbound-fax','outbound-fax',_0x993e('0x7'))},'tag':{'type':Sequelize[_0x993e('0x2')]},'accountcode':{'type':Sequelize[_0x993e('0x2')]},'source':{'type':Sequelize[_0x993e('0x2')]},'destination':{'type':Sequelize[_0x993e('0x2')]},'destinationcontext':{'type':Sequelize[_0x993e('0x2')]},'callerid':{'type':Sequelize[_0x993e('0x2')]},'channel':{'type':Sequelize[_0x993e('0x2')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x993e('0x2')]},'lastdata':{'type':Sequelize[_0x993e('0x8')]},'starttime':{'type':Sequelize[_0x993e('0x9')]},'systemanswertime':{'type':Sequelize[_0x993e('0x9')]},'answertime':{'type':Sequelize[_0x993e('0x9')]},'endtime':{'type':Sequelize[_0x993e('0x9')]},'duration':{'type':Sequelize[_0x993e('0xa')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x993e('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x993e('0x2')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0x993e('0x2')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize[_0x993e('0x2')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0x993e('0xa')]},'sipcallid':{'type':Sequelize[_0x993e('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 20fde10..4bcebf3 100644 --- a/server/api/voiceCallReport/voiceCallReport.controller.js +++ b/server/api/voiceCallReport/voiceCallReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f66=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','VoiceCallReport','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','fullname','alias','User','rows','catch','show','params','find','create','body','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x5f66[_0x4243a3];return _0x1b2a33;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'attributes':['id',_0x65f6('0x23'),_0x65f6('0x3c'),_0x65f6('0x3d')],'model':db[_0x65f6('0x3e')],'as':_0x65f6('0x3e')}];}return db[_0x65f6('0x27')]['findAll'](_0x4ac04b);})[_0x65f6('0x21')](function(_0x400ed2){_0x266cfe[_0x65f6('0x3f')]=_0x400ed2;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))[_0x65f6('0x40')](handleError(_0x559330,null));};exports[_0x65f6('0x41')]=function(_0xe0b72d,_0x2e91e8){var _0x461393={'raw':!![],'where':{'id':_0xe0b72d[_0x65f6('0x42')]['id']}},_0x2abbed={};_0x2abbed[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x2abbed[_0x65f6('0x2c')]=_['keys'](_0xe0b72d[_0x65f6('0x2c')]);_0x2abbed[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],_0x2abbed['query']);_0x461393[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],qs['fields'](_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x2f')]));_0x461393[_0x65f6('0x30')]=_0x461393[_0x65f6('0x30')]['length']?_0x461393[_0x65f6('0x30')]:_0x2abbed['model'];if(_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x461393['include']=[{'all':!![]}];}_0x461393=_[_0x65f6('0x37')]({},_0x461393,_0xe0b72d['options']);return db[_0x65f6('0x27')][_0x65f6('0x43')](_0x461393)[_0x65f6('0x21')](handleEntityNotFound(_0x2e91e8,null))[_0x65f6('0x21')](respondWithResult(_0x2e91e8,null))[_0x65f6('0x40')](handleError(_0x2e91e8,null));};exports[_0x65f6('0x44')]=function(_0x4d30c5,_0x51bf6c){return db[_0x65f6('0x27')][_0x65f6('0x44')](_0x4d30c5[_0x65f6('0x45')],{})[_0x65f6('0x21')](respondWithResult(_0x51bf6c,0xc9))[_0x65f6('0x40')](handleError(_0x51bf6c,null));};exports[_0x65f6('0x20')]=function(_0x149c28,_0x41690c){return db[_0x65f6('0x27')]['find']({'where':{'id':_0x149c28[_0x65f6('0x42')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x41690c,null))[_0x65f6('0x21')](removeEntity(_0x41690c,null))['catch'](handleError(_0x41690c,null));};exports[_0x65f6('0x46')]=function(_0x42d453,_0x49ba5a){return db[_0x65f6('0x27')][_0x65f6('0x46')]()['then'](respondWithResult(_0x49ba5a,null))[_0x65f6('0x40')](handleError(_0x49ba5a,null));};exports['update']=function(_0x247be3,_0x3b241f){if(_0x247be3[_0x65f6('0x45')]['uniqueid']){delete _0x247be3[_0x65f6('0x45')][_0x65f6('0x47')];}return db['VoiceCallReport'][_0x65f6('0x43')]({'where':{'uniqueid':_0x247be3[_0x65f6('0x42')]['id'],'UserId':{'$or':[null,_0x247be3['user']['id']]}}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b241f,null))[_0x65f6('0x21')](saveUpdates(_0x247be3[_0x65f6('0x45')],null))[_0x65f6('0x21')](respondWithResult(_0x3b241f,null))[_0x65f6('0x40')](handleError(_0x3b241f,null));}; \ No newline at end of file +var _0x2032=['../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','alias','User','rows','catch','show','params','keys','rawAttributes','includeAll','include','create','body','find','describe','uniqueid','user','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2032,0xd9));var _0x2203=function(_0x5da478,_0x51b401){_0x5da478=_0x5da478-0x0;var _0x50d04b=_0x2032[_0x5da478];return _0x50d04b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];function respondWithStatusCode(_0x4b9376,_0x583bc7){_0x583bc7=_0x583bc7||0xcc;return function(_0x585c76){if(_0x585c76){return _0x4b9376['sendStatus'](_0x583bc7);}return _0x4b9376['status'](_0x583bc7)[_0x2203('0x18')]();};}function respondWithResult(_0x538b30,_0x592e47){_0x592e47=_0x592e47||0xc8;return function(_0x21a3af){if(_0x21a3af){return _0x538b30[_0x2203('0x19')](_0x592e47)[_0x2203('0x1a')](_0x21a3af);}};}function respondWithFilteredResult(_0x41af85,_0x226209){return function(_0x3fe0a8){if(_0x3fe0a8){var _0x2c36e6=typeof _0x226209[_0x2203('0x1b')]===_0x2203('0x1c')&&typeof _0x226209[_0x2203('0x1d')]==='undefined';var _0x280eda=_0x3fe0a8[_0x2203('0x1e')];var _0x4893ff=_0x2c36e6?0x0:_0x226209[_0x2203('0x1b')];var _0x8906e1=_0x2c36e6?_0x3fe0a8['count']:_0x226209[_0x2203('0x1b')]+_0x226209['limit'];var _0x2904ba;if(_0x8906e1>=_0x280eda){_0x8906e1=_0x280eda;_0x2904ba=0xc8;}else{_0x2904ba=0xce;}_0x41af85[_0x2203('0x19')](_0x2904ba);return _0x41af85[_0x2203('0x1f')](_0x2203('0x20'),_0x4893ff+'-'+_0x8906e1+'/'+_0x280eda)[_0x2203('0x1a')](_0x3fe0a8);}return null;};}function patchUpdates(_0x449039){return function(_0x538c23){try{jsonpatch[_0x2203('0x21')](_0x538c23,_0x449039,!![]);}catch(_0x50822b){return BPromise['reject'](_0x50822b);}return _0x538c23[_0x2203('0x22')]();};}function saveUpdates(_0x496d82,_0x3b8ef9){return function(_0x5bfe61){if(_0x5bfe61){return _0x5bfe61['update'](_0x496d82)[_0x2203('0x23')](function(_0x5e29cd){return _0x5e29cd;});}return null;};}function removeEntity(_0x5c8da9,_0x226374){return function(_0x2718f5){if(_0x2718f5){return _0x2718f5[_0x2203('0x24')]()[_0x2203('0x23')](function(){_0x5c8da9[_0x2203('0x19')](0xcc)[_0x2203('0x18')]();});}};}function handleEntityNotFound(_0x49c12,_0x250349){return function(_0x576378){if(!_0x576378){_0x49c12[_0x2203('0x25')](0x194);}return _0x576378;};}function handleError(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0x1f4;return function(_0x5f11bf){logger[_0x2203('0x26')](_0x5f11bf[_0x2203('0x27')]);if(_0x5f11bf['name']){delete _0x5f11bf[_0x2203('0x28')];}_0x36b958[_0x2203('0x19')](_0x39a11a)[_0x2203('0x29')](_0x5f11bf);};}exports[_0x2203('0x2a')]=function(_0x28ae02,_0x1df508){var _0x9c53f={},_0x5a95c1={},_0x34b8ba={'count':0x0,'rows':[]};var _0x616ed8=_[_0x2203('0x2b')](db[_0x2203('0x2c')]['rawAttributes'],function(_0x3a8e23){return{'name':_0x3a8e23[_0x2203('0x2d')],'type':_0x3a8e23[_0x2203('0x2e')][_0x2203('0x2f')]};});_0x5a95c1['model']=_[_0x2203('0x2b')](_0x616ed8,_0x2203('0x28'));_0x5a95c1['query']=_['keys'](_0x28ae02[_0x2203('0x30')]);_0x5a95c1['filters']=_['intersection'](_0x5a95c1[_0x2203('0x31')],_0x5a95c1[_0x2203('0x30')]);_0x9c53f[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5a95c1[_0x2203('0x31')],qs['fields'](_0x28ae02[_0x2203('0x30')][_0x2203('0x34')]));_0x9c53f['attributes']=_0x9c53f[_0x2203('0x32')][_0x2203('0x35')]?_0x9c53f[_0x2203('0x32')]:_0x5a95c1[_0x2203('0x31')];if(!_0x28ae02[_0x2203('0x30')][_0x2203('0x36')](_0x2203('0x37'))){_0x9c53f[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x28ae02['query'][_0x2203('0x1d')]);_0x9c53f[_0x2203('0x1b')]=qs['offset'](_0x28ae02['query'][_0x2203('0x1b')]);}_0x9c53f['order']=qs[_0x2203('0x38')](_0x28ae02[_0x2203('0x30')][_0x2203('0x38')]);_0x9c53f['where']=qs['filters'](_[_0x2203('0x39')](_0x28ae02['query'],_0x5a95c1[_0x2203('0x3a')]),_0x616ed8);if(_0x28ae02['query'][_0x2203('0x3b')]){_0x9c53f['where']=_[_0x2203('0x3c')](_0x9c53f[_0x2203('0x3d')],{'$or':_[_0x2203('0x2b')](_0x616ed8,function(_0x40a793){if(_0x40a793[_0x2203('0x2e')]!=='VIRTUAL'){var _0x5f1561={};_0x5f1561[_0x40a793['name']]={'$like':'%'+_0x28ae02[_0x2203('0x30')][_0x2203('0x3b')]+'%'};return _0x5f1561;}})});}_0x9c53f=_[_0x2203('0x3c')]({},_0x9c53f,_0x28ae02[_0x2203('0x3e')]);var _0x3283fb={'where':_0x9c53f[_0x2203('0x3d')]};return db[_0x2203('0x2c')]['count'](_0x3283fb)[_0x2203('0x23')](function(_0x1b12c3){_0x34b8ba[_0x2203('0x1e')]=_0x1b12c3;if(_0x28ae02[_0x2203('0x30')]['includeAll']){_0x9c53f['include']=[{'attributes':['id',_0x2203('0x28'),'fullname',_0x2203('0x3f')],'model':db[_0x2203('0x40')],'as':_0x2203('0x40')}];}return db['VoiceCallReport']['findAll'](_0x9c53f);})[_0x2203('0x23')](function(_0x3739f6){_0x34b8ba[_0x2203('0x41')]=_0x3739f6;return _0x34b8ba;})[_0x2203('0x23')](respondWithFilteredResult(_0x1df508,_0x9c53f))[_0x2203('0x42')](handleError(_0x1df508,null));};exports[_0x2203('0x43')]=function(_0x5cd573,_0x15d3b6){var _0x165a3f={'raw':!![],'where':{'id':_0x5cd573[_0x2203('0x44')]['id']}},_0x3a866c={};_0x3a866c[_0x2203('0x31')]=_[_0x2203('0x45')](db[_0x2203('0x2c')][_0x2203('0x46')]);_0x3a866c[_0x2203('0x30')]=_[_0x2203('0x45')](_0x5cd573['query']);_0x3a866c[_0x2203('0x3a')]=_[_0x2203('0x33')](_0x3a866c[_0x2203('0x31')],_0x3a866c[_0x2203('0x30')]);_0x165a3f['attributes']=_['intersection'](_0x3a866c[_0x2203('0x31')],qs['fields'](_0x5cd573[_0x2203('0x30')][_0x2203('0x34')]));_0x165a3f[_0x2203('0x32')]=_0x165a3f[_0x2203('0x32')]['length']?_0x165a3f[_0x2203('0x32')]:_0x3a866c[_0x2203('0x31')];if(_0x5cd573['query'][_0x2203('0x47')]){_0x165a3f[_0x2203('0x48')]=[{'all':!![]}];}_0x165a3f=_[_0x2203('0x3c')]({},_0x165a3f,_0x5cd573[_0x2203('0x3e')]);return db['VoiceCallReport']['find'](_0x165a3f)[_0x2203('0x23')](handleEntityNotFound(_0x15d3b6,null))['then'](respondWithResult(_0x15d3b6,null))['catch'](handleError(_0x15d3b6,null));};exports[_0x2203('0x49')]=function(_0x33b7b5,_0x1a2665){return db['VoiceCallReport']['create'](_0x33b7b5[_0x2203('0x4a')],{})[_0x2203('0x23')](respondWithResult(_0x1a2665,0xc9))[_0x2203('0x42')](handleError(_0x1a2665,null));};exports[_0x2203('0x24')]=function(_0x225b0e,_0x21fd78){return db['VoiceCallReport'][_0x2203('0x4b')]({'where':{'id':_0x225b0e['params']['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x21fd78,null))[_0x2203('0x23')](removeEntity(_0x21fd78,null))[_0x2203('0x42')](handleError(_0x21fd78,null));};exports[_0x2203('0x4c')]=function(_0x58b9bb,_0x506795){return db[_0x2203('0x2c')][_0x2203('0x4c')]()[_0x2203('0x23')](respondWithResult(_0x506795,null))[_0x2203('0x42')](handleError(_0x506795,null));};exports['update']=function(_0x4de47a,_0x49999a){if(_0x4de47a[_0x2203('0x4a')][_0x2203('0x4d')]){delete _0x4de47a['body'][_0x2203('0x4d')];}return db[_0x2203('0x2c')]['find']({'where':{'uniqueid':_0x4de47a[_0x2203('0x44')]['id'],'UserId':{'$or':[null,_0x4de47a[_0x2203('0x4e')]['id']]}}})[_0x2203('0x23')](handleEntityNotFound(_0x49999a,null))[_0x2203('0x23')](saveUpdates(_0x4de47a['body'],null))[_0x2203('0x23')](respondWithResult(_0x49999a,null))['catch'](handleError(_0x49999a,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index ec8f936..9e979ae 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 _0x8c77=['rimraf','define','VoiceCallReport','report_call','uniqueid','lodash','api','moment','bluebird','path'];(function(_0x37fdff,_0x1856ca){var _0x3844fb=function(_0x5262f4){while(--_0x5262f4){_0x37fdff['push'](_0x37fdff['shift']());}};_0x3844fb(++_0x1856ca);}(_0x8c77,0xcd));var _0x78c7=function(_0x347ecd,_0x40297e){_0x347ecd=_0x347ecd-0x0;var _0x5d667a=_0x8c77[_0x347ecd];return _0x5d667a;};'use strict';var _=require(_0x78c7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x78c7('0x1'));var moment=require(_0x78c7('0x2'));var BPromise=require(_0x78c7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x78c7('0x4'));var rimraf=require(_0x78c7('0x5'));var config=require('../../config/environment');var attributes=require('./voiceCallReport.attributes');module['exports']=function(_0x53739e,_0x533a19){return _0x53739e[_0x78c7('0x6')](_0x78c7('0x7'),attributes,{'tableName':_0x78c7('0x8'),'paranoid':![],'indexes':[{'fields':[_0x78c7('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcc17=['rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5d4070,_0x2f0d87){var _0xfadfa8=function(_0x295d71){while(--_0x295d71){_0x5d4070['push'](_0x5d4070['shift']());}};_0xfadfa8(++_0x2f0d87);}(_0xcc17,0x174));var _0x7cc1=function(_0x568496,_0x565afd){_0x568496=_0x568496-0x0;var _0x26c5c1=_0xcc17[_0x568496];return _0x26c5c1;};'use strict';var _=require(_0x7cc1('0x0'));var util=require(_0x7cc1('0x1'));var logger=require(_0x7cc1('0x2'))(_0x7cc1('0x3'));var moment=require(_0x7cc1('0x4'));var BPromise=require(_0x7cc1('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7cc1('0x6'));var config=require(_0x7cc1('0x7'));var attributes=require(_0x7cc1('0x8'));module[_0x7cc1('0x9')]=function(_0x28d630,_0x54a6cc){return _0x28d630[_0x7cc1('0xa')](_0x7cc1('0xb'),attributes,{'tableName':_0x7cc1('0xc'),'paranoid':![],'indexes':[{'fields':[_0x7cc1('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 6ddcd4b..da35e3a 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 _0xbc3a=['options','raw','attributes','model','include','map','debug','GetVoiceCallReport','stringify','CreateVoiceCallReport','VoiceCallReport','create','body','UpdateVoiceCallReport','update','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','VoiceCallReport,\x20%s,\x20%s','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch'];(function(_0x120dfb,_0x191f16){var _0x112102=function(_0x1c2129){while(--_0x1c2129){_0x120dfb['push'](_0x120dfb['shift']());}};_0x112102(++_0x191f16);}(_0xbc3a,0x182));var _0xabc3=function(_0x557138,_0x426875){_0x557138=_0x557138-0x0;var _0x1727e1=_0xbc3a[_0x557138];return _0x1727e1;};'use strict';var _=require(_0xabc3('0x0'));var util=require(_0xabc3('0x1'));var moment=require(_0xabc3('0x2'));var BPromise=require(_0xabc3('0x3'));var rs=require(_0xabc3('0x4'));var fs=require('fs');var Redis=require(_0xabc3('0x5'));var db=require(_0xabc3('0x6'))['db'];var utils=require(_0xabc3('0x7'));var logger=require(_0xabc3('0x8'))(_0xabc3('0x9'));var config=require(_0xabc3('0xa'));var jayson=require(_0xabc3('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x579c70,_0x45b55a,_0x31accb){return new BPromise(function(_0x34980d,_0x4a7517){return client['request'](_0x579c70,_0x31accb)[_0xabc3('0xc')](function(_0x5918c0){logger['info'](_0xabc3('0xd'),_0x45b55a,'request\x20sent');logger['debug'](_0xabc3('0xe'),_0x45b55a,_0xabc3('0xf'),JSON['stringify'](_0x5918c0));if(_0x5918c0[_0xabc3('0x10')]){if(_0x5918c0[_0xabc3('0x10')]['code']===0x1f4){logger[_0xabc3('0x10')](_0xabc3('0xd'),_0x45b55a,_0x5918c0['error']['message']);return _0x4a7517(_0x5918c0[_0xabc3('0x10')][_0xabc3('0x11')]);}logger['error'](_0xabc3('0xd'),_0x45b55a,_0x5918c0['error'][_0xabc3('0x11')]);return _0x34980d(_0x5918c0['error']['message']);}else{logger[_0xabc3('0x12')](_0xabc3('0xd'),_0x45b55a,_0xabc3('0xf'));_0x34980d(_0x5918c0[_0xabc3('0x13')][_0xabc3('0x11')]);}})[_0xabc3('0x14')](function(_0x130da9){logger[_0xabc3('0x10')](_0xabc3('0xd'),_0x45b55a,_0x130da9);_0x4a7517(_0x130da9);});});}exports['GetVoiceCallReport']=function(_0x16b914){var _0x78d5a=this;return new Promise(function(_0x2e118c,_0x1d233e){return db['VoiceCallReport']['findAll']({'raw':_0x16b914[_0xabc3('0x15')]?_0x16b914[_0xabc3('0x15')][_0xabc3('0x16')]===undefined?!![]:![]:!![],'where':_0x16b914[_0xabc3('0x15')]?_0x16b914[_0xabc3('0x15')]['where']||null:null,'attributes':_0x16b914[_0xabc3('0x15')]?_0x16b914['options'][_0xabc3('0x17')]||null:null,'limit':_0x16b914[_0xabc3('0x15')]?_0x16b914[_0xabc3('0x15')]['limit']||null:null,'include':_0x16b914[_0xabc3('0x15')]?_0x16b914['options']['include']?_['map'](_0x16b914[_0xabc3('0x15')]['include'],function(_0x429e29){return{'model':db[_0x429e29[_0xabc3('0x18')]],'as':_0x429e29['as'],'attributes':_0x429e29['attributes'],'include':_0x429e29[_0xabc3('0x19')]?_['map'](_0x429e29[_0xabc3('0x19')],function(_0x2cbd88){return{'model':db[_0x2cbd88[_0xabc3('0x18')]],'as':_0x2cbd88['as'],'attributes':_0x2cbd88[_0xabc3('0x17')],'include':_0x2cbd88['include']?_[_0xabc3('0x1a')](_0x2cbd88[_0xabc3('0x19')],function(_0x2dba79){return{'model':db[_0x2dba79[_0xabc3('0x18')]],'as':_0x2dba79['as'],'attributes':_0x2dba79[_0xabc3('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2ed48f){logger[_0xabc3('0x12')]('GetVoiceCallReport',_0x16b914);logger[_0xabc3('0x1b')](_0xabc3('0x1c'),_0x16b914,JSON[_0xabc3('0x1d')](_0x2ed48f));_0x2e118c(_0x2ed48f);})['catch'](function(_0x2e107c){logger[_0xabc3('0x10')]('GetVoiceCallReport',_0x2e107c[_0xabc3('0x11')],_0x16b914);_0x1d233e(_0x78d5a[_0xabc3('0x10')](0x1f4,_0x2e107c[_0xabc3('0x11')]));});});};exports[_0xabc3('0x1e')]=function(_0x2d0bf2){var _0x2677cf=this;return new Promise(function(_0x39b2b3,_0xaf6ab0){return db[_0xabc3('0x1f')][_0xabc3('0x20')](_0x2d0bf2[_0xabc3('0x21')],{'raw':_0x2d0bf2[_0xabc3('0x15')]?_0x2d0bf2['options'][_0xabc3('0x16')]===undefined?!![]:![]:!![]})[_0xabc3('0xc')](function(_0x7cecb){logger['info'](_0xabc3('0x1e'),_0x2d0bf2);logger[_0xabc3('0x1b')](_0xabc3('0x1e'),_0x2d0bf2,JSON[_0xabc3('0x1d')](_0x7cecb));_0x39b2b3(_0x7cecb);})[_0xabc3('0x14')](function(_0x5e2d15){logger[_0xabc3('0x10')]('CreateVoiceCallReport',_0x5e2d15[_0xabc3('0x11')],_0x2d0bf2);_0xaf6ab0(_0x2677cf[_0xabc3('0x10')](0x1f4,_0x5e2d15[_0xabc3('0x11')]));});});};exports[_0xabc3('0x22')]=function(_0x57fd4b){var _0x2823c6=this;return new Promise(function(_0x3671a6,_0x471846){return db[_0xabc3('0x1f')][_0xabc3('0x23')](_0x57fd4b[_0xabc3('0x21')],{'raw':_0x57fd4b[_0xabc3('0x15')]?_0x57fd4b[_0xabc3('0x15')][_0xabc3('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57fd4b[_0xabc3('0x15')]?_0x57fd4b['options']['where']||null:null,'attributes':_0x57fd4b[_0xabc3('0x15')]?_0x57fd4b[_0xabc3('0x15')][_0xabc3('0x17')]||null:null,'limit':_0x57fd4b[_0xabc3('0x15')]?_0x57fd4b[_0xabc3('0x15')][_0xabc3('0x24')]||null:null})[_0xabc3('0xc')](function(_0x5225be){logger['info'](_0xabc3('0x22'),_0x57fd4b);logger[_0xabc3('0x1b')](_0xabc3('0x22'),_0x57fd4b,JSON[_0xabc3('0x1d')](_0x5225be));_0x3671a6(_0x5225be);})[_0xabc3('0x14')](function(_0x360ec5){logger[_0xabc3('0x10')](_0xabc3('0x22'),_0x360ec5[_0xabc3('0x11')],_0x57fd4b);_0x471846(_0x2823c6[_0xabc3('0x10')](0x1f4,_0x360ec5[_0xabc3('0x11')]));});});}; \ No newline at end of file +var _0x9258=['findAll','options','raw','where','attributes','map','include','model','GetVoiceCallReport','create','body','CreateVoiceCallReport','stringify','UpdateVoiceCallReport','update','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','code','error','message','VoiceCallReport,\x20%s,\x20%s','catch'];(function(_0x1c408d,_0x53610d){var _0x201428=function(_0x4adfa9){while(--_0x4adfa9){_0x1c408d['push'](_0x1c408d['shift']());}};_0x201428(++_0x53610d);}(_0x9258,0xce));var _0x8925=function(_0x5771da,_0x113531){_0x5771da=_0x5771da-0x0;var _0x373c70=_0x9258[_0x5771da];return _0x373c70;};'use strict';var _=require(_0x8925('0x0'));var util=require(_0x8925('0x1'));var moment=require(_0x8925('0x2'));var BPromise=require('bluebird');var rs=require(_0x8925('0x3'));var fs=require('fs');var Redis=require(_0x8925('0x4'));var db=require(_0x8925('0x5'))['db'];var utils=require(_0x8925('0x6'));var logger=require(_0x8925('0x7'))('rpc');var config=require(_0x8925('0x8'));var jayson=require(_0x8925('0x9'));var client=jayson[_0x8925('0xa')][_0x8925('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d27d2,_0x10fc12,_0x31270b){return new BPromise(function(_0x5a53e7,_0x500096){return client[_0x8925('0xc')](_0x1d27d2,_0x31270b)[_0x8925('0xd')](function(_0x21e491){logger[_0x8925('0xe')]('VoiceCallReport,\x20%s,\x20%s',_0x10fc12,_0x8925('0xf'));logger[_0x8925('0x10')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x10fc12,'request\x20sent',JSON['stringify'](_0x21e491));if(_0x21e491['error']){if(_0x21e491['error'][_0x8925('0x11')]===0x1f4){logger[_0x8925('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0x10fc12,_0x21e491[_0x8925('0x12')]['message']);return _0x500096(_0x21e491[_0x8925('0x12')][_0x8925('0x13')]);}logger['error'](_0x8925('0x14'),_0x10fc12,_0x21e491[_0x8925('0x12')][_0x8925('0x13')]);return _0x5a53e7(_0x21e491[_0x8925('0x12')]['message']);}else{logger[_0x8925('0xe')](_0x8925('0x14'),_0x10fc12,'request\x20sent');_0x5a53e7(_0x21e491['result'][_0x8925('0x13')]);}})[_0x8925('0x15')](function(_0x1445df){logger['error'](_0x8925('0x14'),_0x10fc12,_0x1445df);_0x500096(_0x1445df);});});}exports['GetVoiceCallReport']=function(_0x3fcfc2){var _0x47a3ee=this;return new Promise(function(_0x729052,_0x6e3dfa){return db['VoiceCallReport'][_0x8925('0x16')]({'raw':_0x3fcfc2[_0x8925('0x17')]?_0x3fcfc2[_0x8925('0x17')][_0x8925('0x18')]===undefined?!![]:![]:!![],'where':_0x3fcfc2[_0x8925('0x17')]?_0x3fcfc2[_0x8925('0x17')][_0x8925('0x19')]||null:null,'attributes':_0x3fcfc2[_0x8925('0x17')]?_0x3fcfc2['options'][_0x8925('0x1a')]||null:null,'limit':_0x3fcfc2['options']?_0x3fcfc2[_0x8925('0x17')]['limit']||null:null,'include':_0x3fcfc2[_0x8925('0x17')]?_0x3fcfc2[_0x8925('0x17')]['include']?_[_0x8925('0x1b')](_0x3fcfc2['options'][_0x8925('0x1c')],function(_0x5867de){return{'model':db[_0x5867de[_0x8925('0x1d')]],'as':_0x5867de['as'],'attributes':_0x5867de['attributes'],'include':_0x5867de[_0x8925('0x1c')]?_[_0x8925('0x1b')](_0x5867de[_0x8925('0x1c')],function(_0x28cbc5){return{'model':db[_0x28cbc5['model']],'as':_0x28cbc5['as'],'attributes':_0x28cbc5['attributes'],'include':_0x28cbc5[_0x8925('0x1c')]?_[_0x8925('0x1b')](_0x28cbc5[_0x8925('0x1c')],function(_0x4620fe){return{'model':db[_0x4620fe[_0x8925('0x1d')]],'as':_0x4620fe['as'],'attributes':_0x4620fe['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x936750){logger[_0x8925('0xe')](_0x8925('0x1e'),_0x3fcfc2);logger['debug'](_0x8925('0x1e'),_0x3fcfc2,JSON['stringify'](_0x936750));_0x729052(_0x936750);})[_0x8925('0x15')](function(_0x13197e){logger[_0x8925('0x12')]('GetVoiceCallReport',_0x13197e[_0x8925('0x13')],_0x3fcfc2);_0x6e3dfa(_0x47a3ee[_0x8925('0x12')](0x1f4,_0x13197e[_0x8925('0x13')]));});});};exports['CreateVoiceCallReport']=function(_0x34cb69){var _0x49cd60=this;return new Promise(function(_0x76bf03,_0x4ec0d6){return db['VoiceCallReport'][_0x8925('0x1f')](_0x34cb69[_0x8925('0x20')],{'raw':_0x34cb69[_0x8925('0x17')]?_0x34cb69[_0x8925('0x17')][_0x8925('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x5aa149){logger['info'](_0x8925('0x21'),_0x34cb69);logger[_0x8925('0x10')](_0x8925('0x21'),_0x34cb69,JSON[_0x8925('0x22')](_0x5aa149));_0x76bf03(_0x5aa149);})[_0x8925('0x15')](function(_0x4193da){logger[_0x8925('0x12')](_0x8925('0x21'),_0x4193da[_0x8925('0x13')],_0x34cb69);_0x4ec0d6(_0x49cd60['error'](0x1f4,_0x4193da[_0x8925('0x13')]));});});};exports[_0x8925('0x23')]=function(_0x8ecd5b){var _0x1b4d45=this;return new Promise(function(_0x50c89e,_0x4bacf2){return db['VoiceCallReport'][_0x8925('0x24')](_0x8ecd5b[_0x8925('0x20')],{'raw':_0x8ecd5b[_0x8925('0x17')]?_0x8ecd5b[_0x8925('0x17')][_0x8925('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8ecd5b[_0x8925('0x17')]?_0x8ecd5b['options'][_0x8925('0x19')]||null:null,'attributes':_0x8ecd5b['options']?_0x8ecd5b[_0x8925('0x17')][_0x8925('0x1a')]||null:null,'limit':_0x8ecd5b['options']?_0x8ecd5b[_0x8925('0x17')][_0x8925('0x25')]||null:null})[_0x8925('0xd')](function(_0x37ea7e){logger[_0x8925('0xe')](_0x8925('0x23'),_0x8ecd5b);logger[_0x8925('0x10')]('UpdateVoiceCallReport',_0x8ecd5b,JSON[_0x8925('0x22')](_0x37ea7e));_0x50c89e(_0x37ea7e);})[_0x8925('0x15')](function(_0x2815de){logger['error'](_0x8925('0x23'),_0x2815de[_0x8925('0x13')],_0x8ecd5b);_0x4bacf2(_0x1b4d45[_0x8925('0x12')](0x1f4,_0x2815de[_0x8925('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 4933007..625d4ce 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 _0xf255=['/:id','isAuthenticated','show','create','put','update','delete','exports','util','express','fs-extra','../../config/environment','./voiceChanSpy.controller','get','index'];(function(_0x146683,_0x3d6f84){var _0x35f6a5=function(_0x42c037){while(--_0x42c037){_0x146683['push'](_0x146683['shift']());}};_0x35f6a5(++_0x3d6f84);}(_0xf255,0xad));var _0x5f25=function(_0x5712cc,_0x5db7dd){_0x5712cc=_0x5712cc-0x0;var _0x15561a=_0xf255[_0x5712cc];return _0x15561a;};'use strict';var multer=require('multer');var util=require(_0x5f25('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5f25('0x1'));var router=express['Router']();var fs_extra=require(_0x5f25('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5f25('0x3'));var controller=require(_0x5f25('0x4'));router[_0x5f25('0x5')]('/',auth['isAuthenticated'](),controller[_0x5f25('0x6')]);router['get'](_0x5f25('0x7'),auth[_0x5f25('0x8')](),controller[_0x5f25('0x9')]);router['post']('/',auth[_0x5f25('0x8')](),controller[_0x5f25('0xa')]);router[_0x5f25('0xb')](_0x5f25('0x7'),auth['isAuthenticated'](),controller[_0x5f25('0xc')]);router[_0x5f25('0xd')](_0x5f25('0x7'),auth[_0x5f25('0x8')](),controller['destroy']);module[_0x5f25('0xe')]=router; \ No newline at end of file +var _0x7120=['post','create','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','/:id'];(function(_0x6b5f38,_0x4437d5){var _0x1ab696=function(_0x37d94d){while(--_0x37d94d){_0x6b5f38['push'](_0x6b5f38['shift']());}};_0x1ab696(++_0x4437d5);}(_0x7120,0x181));var _0x0712=function(_0x25ec96,_0x2ac486){_0x25ec96=_0x25ec96-0x0;var _0x1bab62=_0x7120[_0x25ec96];return _0x1bab62;};'use strict';var multer=require('multer');var util=require(_0x0712('0x0'));var path=require('path');var timeout=require(_0x0712('0x1'));var express=require(_0x0712('0x2'));var router=express[_0x0712('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0712('0x4'));var interaction=require(_0x0712('0x5'));var config=require(_0x0712('0x6'));var controller=require(_0x0712('0x7'));router[_0x0712('0x8')]('/',auth[_0x0712('0x9')](),controller['index']);router['get'](_0x0712('0xa'),auth[_0x0712('0x9')](),controller['show']);router[_0x0712('0xb')]('/',auth['isAuthenticated'](),controller[_0x0712('0xc')]);router[_0x0712('0xd')](_0x0712('0xa'),auth['isAuthenticated'](),controller[_0x0712('0xe')]);router[_0x0712('0xf')](_0x0712('0xa'),auth[_0x0712('0x9')](),controller[_0x0712('0x10')]);module[_0x0712('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 321c0e5..fbe6e91 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 _0x0e16=['BOOLEAN','STRING','name','setDataValue','options','join','getDataValue'];(function(_0x72b52e,_0x5ec917){var _0x239e22=function(_0x3deac3){while(--_0x3deac3){_0x72b52e['push'](_0x72b52e['shift']());}};_0x239e22(++_0x5ec917);}(_0x0e16,0xda));var _0x60e1=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0x0e16[_0x487b0c];return _0x1adbdc;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x60e1('0x0')]},'prefix':{'type':Sequelize[_0x60e1('0x0')],'unique':_0x60e1('0x1'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0xdbc90c){this[_0x60e1('0x2')](_0x60e1('0x3'),_0xdbc90c?_0xdbc90c[_0x60e1('0x4')](''):[]);},'get':function(){return this[_0x60e1('0x5')](_0x60e1('0x3'))?this[_0x60e1('0x5')](_0x60e1('0x3'))['split'](''):[];}},'auth':{'type':Sequelize[_0x60e1('0x6')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0x60e1('0x6')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x60e1('0x0')]},'description':{'type':Sequelize[_0x60e1('0x0')]}}; \ No newline at end of file +var _0x7555=['exports','STRING','join','getDataValue','options','split','BOOLEAN','sequelize'];(function(_0x397bfb,_0x589665){var _0x16c9b9=function(_0x13ce8a){while(--_0x13ce8a){_0x397bfb['push'](_0x397bfb['shift']());}};_0x16c9b9(++_0x589665);}(_0x7555,0x15f));var _0x5755=function(_0x27f81a,_0x42c7db){_0x27f81a=_0x27f81a-0x0;var _0x25b63f=_0x7555[_0x27f81a];return _0x25b63f;};'use strict';var Sequelize=require(_0x5755('0x0'));module[_0x5755('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x5755('0x2')],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0x5755('0x2')],'set':function(_0x14a180){this['setDataValue']('options',_0x14a180?_0x14a180[_0x5755('0x3')](''):[]);},'get':function(){return this[_0x5755('0x4')](_0x5755('0x5'))?this[_0x5755('0x4')](_0x5755('0x5'))[_0x5755('0x6')](''):[];}},'auth':{'type':Sequelize[_0x5755('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0x5755('0x2')]},'record':{'type':Sequelize[_0x5755('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x5755('0x2')]},'description':{'type':Sequelize[_0x5755('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index b34ae0f..4e75052 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 _0xc298=['crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','then','ChanSpies','UserProfileResource','error','name','send','map','VoiceChanSpy','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel'];(function(_0x116df7,_0x5281f9){var _0x44f755=function(_0x48d30c){while(--_0x48d30c){_0x116df7['push'](_0x116df7['shift']());}};_0x44f755(++_0x5281f9);}(_0xc298,0x143));var _0x8c29=function(_0x242ddd,_0x2d3347){_0x242ddd=_0x242ddd-0x0;var _0x3811c8=_0xc298[_0x242ddd];return _0x3811c8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8c29('0x0'));var zipdir=require(_0x8c29('0x1'));var jsonpatch=require(_0x8c29('0x2'));var rp=require(_0x8c29('0x3'));var moment=require(_0x8c29('0x4'));var BPromise=require(_0x8c29('0x5'));var Mustache=require('mustache');var util=require(_0x8c29('0x6'));var path=require(_0x8c29('0x7'));var sox=require(_0x8c29('0x8'));var csv=require(_0x8c29('0x9'));var ejs=require(_0x8c29('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8c29('0xb'));var squel=require(_0x8c29('0xc'));var crypto=require(_0x8c29('0xd'));var jsforce=require(_0x8c29('0xe'));var deskjs=require(_0x8c29('0xf'));var toCsv=require(_0x8c29('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8c29('0x10'));var qs=require(_0x8c29('0x11'));var as=require(_0x8c29('0x12'));var hardwareService=require(_0x8c29('0x13'));var logger=require(_0x8c29('0x14'))(_0x8c29('0x15'));var utils=require(_0x8c29('0x16'));var config=require(_0x8c29('0x17'));var licenseUtil=require(_0x8c29('0x18'));var db=require(_0x8c29('0x19'))['db'];function respondWithStatusCode(_0xd82e60,_0x1dc424){_0x1dc424=_0x1dc424||0xcc;return function(_0x3023d2){if(_0x3023d2){return _0xd82e60[_0x8c29('0x1a')](_0x1dc424);}return _0xd82e60[_0x8c29('0x1b')](_0x1dc424)[_0x8c29('0x1c')]();};}function respondWithResult(_0x5a9eb8,_0x3dc480){_0x3dc480=_0x3dc480||0xc8;return function(_0xcdae4d){if(_0xcdae4d){return _0x5a9eb8['status'](_0x3dc480)['json'](_0xcdae4d);}};}function respondWithFilteredResult(_0x17d84b,_0xe87c50){return function(_0x4929b9){if(_0x4929b9){var _0x24add4=typeof _0xe87c50[_0x8c29('0x1d')]===_0x8c29('0x1e')&&typeof _0xe87c50['limit']===_0x8c29('0x1e');var _0x37fc8e=_0x4929b9[_0x8c29('0x1f')];var _0x6324b8=_0x24add4?0x0:_0xe87c50[_0x8c29('0x1d')];var _0x21ada9=_0x24add4?_0x4929b9['count']:_0xe87c50[_0x8c29('0x1d')]+_0xe87c50[_0x8c29('0x20')];var _0x41e389;if(_0x21ada9>=_0x37fc8e){_0x21ada9=_0x37fc8e;_0x41e389=0xc8;}else{_0x41e389=0xce;}_0x17d84b[_0x8c29('0x1b')](_0x41e389);return _0x17d84b[_0x8c29('0x21')](_0x8c29('0x22'),_0x6324b8+'-'+_0x21ada9+'/'+_0x37fc8e)[_0x8c29('0x23')](_0x4929b9);}return null;};}function patchUpdates(_0x10810c){return function(_0x5c62a0){try{jsonpatch['apply'](_0x5c62a0,_0x10810c,!![]);}catch(_0x2702a1){return BPromise[_0x8c29('0x24')](_0x2702a1);}return _0x5c62a0[_0x8c29('0x25')]();};}function saveUpdates(_0x513efd,_0x5a61f3){return function(_0x3fb320){if(_0x3fb320){return _0x3fb320[_0x8c29('0x26')](_0x513efd)[_0x8c29('0x27')](function(_0x157e61){return _0x157e61;});}return null;};}function removeEntity(_0x34cf21,_0x507124){return function(_0x40431d){if(_0x40431d){return _0x40431d['destroy']()[_0x8c29('0x27')](function(){var _0x4f5c8d=_0x40431d['get']({'plain':!![]});var _0x2c7979=_0x8c29('0x28');return db[_0x8c29('0x29')]['destroy']({'where':{'type':_0x2c7979,'resourceId':_0x4f5c8d['id']}})[_0x8c29('0x27')](function(){return _0x40431d;});})['then'](function(){_0x34cf21['status'](0xcc)[_0x8c29('0x1c')]();});}};}function handleEntityNotFound(_0x4f0e29,_0x2a46e4){return function(_0x6fa9a9){if(!_0x6fa9a9){_0x4f0e29['sendStatus'](0x194);}return _0x6fa9a9;};}function handleError(_0x1056e9,_0x151d93){_0x151d93=_0x151d93||0x1f4;return function(_0x4eee54){logger[_0x8c29('0x2a')](_0x4eee54['stack']);if(_0x4eee54['name']){delete _0x4eee54[_0x8c29('0x2b')];}_0x1056e9[_0x8c29('0x1b')](_0x151d93)[_0x8c29('0x2c')](_0x4eee54);};}exports['index']=function(_0x38890d,_0xde770a){var _0x4f5c05={},_0x3dd1e4={},_0x2e12b1={'count':0x0,'rows':[]};var _0x515a98=_[_0x8c29('0x2d')](db[_0x8c29('0x2e')][_0x8c29('0x2f')],function(_0x327d1d){return{'name':_0x327d1d[_0x8c29('0x30')],'type':_0x327d1d['type'][_0x8c29('0x31')]};});_0x3dd1e4[_0x8c29('0x32')]=_[_0x8c29('0x2d')](_0x515a98,_0x8c29('0x2b'));_0x3dd1e4[_0x8c29('0x33')]=_[_0x8c29('0x34')](_0x38890d[_0x8c29('0x33')]);_0x3dd1e4['filters']=_[_0x8c29('0x35')](_0x3dd1e4[_0x8c29('0x32')],_0x3dd1e4[_0x8c29('0x33')]);_0x4f5c05['attributes']=_[_0x8c29('0x35')](_0x3dd1e4[_0x8c29('0x32')],qs['fields'](_0x38890d[_0x8c29('0x33')][_0x8c29('0x36')]));_0x4f5c05['attributes']=_0x4f5c05[_0x8c29('0x37')][_0x8c29('0x38')]?_0x4f5c05[_0x8c29('0x37')]:_0x3dd1e4[_0x8c29('0x32')];if(!_0x38890d['query'][_0x8c29('0x39')](_0x8c29('0x3a'))){_0x4f5c05[_0x8c29('0x20')]=qs[_0x8c29('0x20')](_0x38890d[_0x8c29('0x33')]['limit']);_0x4f5c05[_0x8c29('0x1d')]=qs[_0x8c29('0x1d')](_0x38890d[_0x8c29('0x33')][_0x8c29('0x1d')]);}_0x4f5c05[_0x8c29('0x3b')]=qs[_0x8c29('0x3c')](_0x38890d[_0x8c29('0x33')][_0x8c29('0x3c')]);_0x4f5c05[_0x8c29('0x3d')]=qs[_0x8c29('0x3e')](_['pick'](_0x38890d[_0x8c29('0x33')],_0x3dd1e4[_0x8c29('0x3e')]),_0x515a98);if(_0x38890d['query'][_0x8c29('0x3f')]){_0x4f5c05[_0x8c29('0x3d')]=_[_0x8c29('0x40')](_0x4f5c05['where'],{'$or':_[_0x8c29('0x2d')](_0x515a98,function(_0x3ddef3){if(_0x3ddef3['type']!==_0x8c29('0x41')){var _0x1e6307={};_0x1e6307[_0x3ddef3[_0x8c29('0x2b')]]={'$like':'%'+_0x38890d[_0x8c29('0x33')][_0x8c29('0x3f')]+'%'};return _0x1e6307;}})});}_0x4f5c05=_['merge']({},_0x4f5c05,_0x38890d[_0x8c29('0x42')]);var _0xe5d19d={'where':_0x4f5c05[_0x8c29('0x3d')]};return db[_0x8c29('0x2e')][_0x8c29('0x1f')](_0xe5d19d)[_0x8c29('0x27')](function(_0x187da3){_0x2e12b1['count']=_0x187da3;if(_0x38890d[_0x8c29('0x33')][_0x8c29('0x43')]){_0x4f5c05[_0x8c29('0x44')]=[{'all':!![]}];}return db[_0x8c29('0x2e')]['findAll'](_0x4f5c05);})['then'](function(_0x127ad1){_0x2e12b1[_0x8c29('0x45')]=_0x127ad1;return _0x2e12b1;})['then'](respondWithFilteredResult(_0xde770a,_0x4f5c05))[_0x8c29('0x46')](handleError(_0xde770a,null));};exports[_0x8c29('0x47')]=function(_0x28255f,_0x208dde){var _0x134f19={'raw':![],'where':{'id':_0x28255f[_0x8c29('0x48')]['id']}},_0x48c050={};_0x48c050['model']=_['keys'](db['VoiceChanSpy'][_0x8c29('0x2f')]);_0x48c050[_0x8c29('0x33')]=_[_0x8c29('0x34')](_0x28255f['query']);_0x48c050[_0x8c29('0x3e')]=_[_0x8c29('0x35')](_0x48c050['model'],_0x48c050[_0x8c29('0x33')]);_0x134f19[_0x8c29('0x37')]=_[_0x8c29('0x35')](_0x48c050[_0x8c29('0x32')],qs['fields'](_0x28255f['query']['fields']));_0x134f19[_0x8c29('0x37')]=_0x134f19[_0x8c29('0x37')]['length']?_0x134f19['attributes']:_0x48c050[_0x8c29('0x32')];if(_0x28255f[_0x8c29('0x33')][_0x8c29('0x43')]){_0x134f19[_0x8c29('0x44')]=[{'all':!![]}];}_0x134f19=_[_0x8c29('0x40')]({},_0x134f19,_0x28255f[_0x8c29('0x42')]);return db[_0x8c29('0x2e')]['find'](_0x134f19)[_0x8c29('0x27')](handleEntityNotFound(_0x208dde,null))[_0x8c29('0x27')](respondWithResult(_0x208dde,null))[_0x8c29('0x46')](handleError(_0x208dde,null));};exports[_0x8c29('0x49')]=function(_0x1ba6e2,_0x577459){return db[_0x8c29('0x2e')][_0x8c29('0x49')](_0x1ba6e2[_0x8c29('0x4a')],{})['then'](function(_0x3b0a04){var _0x3434b3=_0x1ba6e2[_0x8c29('0x4b')][_0x8c29('0x4c')]({'plain':!![]});if(!_0x3434b3)throw new Error(_0x8c29('0x4d'));if(_0x3434b3['role']===_0x8c29('0x4b')){var _0x11b351=_0x3b0a04[_0x8c29('0x4c')]({'plain':!![]});var _0x51cdd4='ChanSpies';return db[_0x8c29('0x4e')][_0x8c29('0x4f')]({'where':{'name':_0x51cdd4,'userProfileId':_0x3434b3[_0x8c29('0x50')]},'raw':!![]})[_0x8c29('0x27')](function(_0x4e65e3){if(_0x4e65e3&&_0x4e65e3[_0x8c29('0x51')]===0x0){return db[_0x8c29('0x29')][_0x8c29('0x49')]({'name':_0x11b351[_0x8c29('0x2b')],'resourceId':_0x11b351['id'],'type':_0x4e65e3[_0x8c29('0x2b')],'sectionId':_0x4e65e3['id']},{})[_0x8c29('0x27')](function(){return _0x3b0a04;});}else{return _0x3b0a04;}})[_0x8c29('0x46')](function(_0x4aba6f){logger[_0x8c29('0x2a')](_0x8c29('0x52'),_0x4aba6f);throw _0x4aba6f;});}return _0x3b0a04;})[_0x8c29('0x27')](respondWithResult(_0x577459,0xc9))[_0x8c29('0x46')](handleError(_0x577459,null));};exports[_0x8c29('0x26')]=function(_0x33ac58,_0x358f69){if(_0x33ac58[_0x8c29('0x4a')]['id']){delete _0x33ac58[_0x8c29('0x4a')]['id'];}return db['VoiceChanSpy'][_0x8c29('0x4f')]({'where':{'id':_0x33ac58[_0x8c29('0x48')]['id']}})[_0x8c29('0x27')](handleEntityNotFound(_0x358f69,null))[_0x8c29('0x27')](saveUpdates(_0x33ac58['body'],null))['then'](respondWithResult(_0x358f69,null))[_0x8c29('0x46')](handleError(_0x358f69,null));};exports[_0x8c29('0x53')]=function(_0x4bbe80,_0x4d58de){return db['VoiceChanSpy'][_0x8c29('0x4f')]({'where':{'id':_0x4bbe80[_0x8c29('0x48')]['id']}})['then'](handleEntityNotFound(_0x4d58de,null))[_0x8c29('0x27')](removeEntity(_0x4d58de,null))[_0x8c29('0x46')](handleError(_0x4d58de,null));}; \ No newline at end of file +var _0x24a6=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','VoiceChanSpy','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','includeAll','include','rows','catch','show','params','keys','length','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChanSpies','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x24a6,0x14f));var _0x624a=function(_0x8c9f1f,_0x47aae7){_0x8c9f1f=_0x8c9f1f-0x0;var _0x1e9ed4=_0x24a6[_0x8c9f1f];return _0x1e9ed4;};'use strict';var emlformat=require(_0x624a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x624a('0x1'));var jsonpatch=require(_0x624a('0x2'));var rp=require(_0x624a('0x3'));var moment=require(_0x624a('0x4'));var BPromise=require(_0x624a('0x5'));var Mustache=require(_0x624a('0x6'));var util=require(_0x624a('0x7'));var path=require(_0x624a('0x8'));var sox=require(_0x624a('0x9'));var csv=require(_0x624a('0xa'));var ejs=require(_0x624a('0xb'));var fs=require('fs');var fs_extra=require(_0x624a('0xc'));var _=require(_0x624a('0xd'));var squel=require(_0x624a('0xe'));var crypto=require(_0x624a('0xf'));var jsforce=require(_0x624a('0x10'));var deskjs=require(_0x624a('0x11'));var toCsv=require(_0x624a('0xa'));var querystring=require(_0x624a('0x12'));var Papa=require(_0x624a('0x13'));var Redis=require(_0x624a('0x14'));var authService=require(_0x624a('0x15'));var qs=require(_0x624a('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x624a('0x17'))(_0x624a('0x18'));var utils=require(_0x624a('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x624a('0x1a'));var db=require(_0x624a('0x1b'))['db'];function respondWithStatusCode(_0x5f0954,_0x50d1aa){_0x50d1aa=_0x50d1aa||0xcc;return function(_0x5406ce){if(_0x5406ce){return _0x5f0954[_0x624a('0x1c')](_0x50d1aa);}return _0x5f0954['status'](_0x50d1aa)[_0x624a('0x1d')]();};}function respondWithResult(_0x89e2fd,_0xe310b4){_0xe310b4=_0xe310b4||0xc8;return function(_0x1e6ffd){if(_0x1e6ffd){return _0x89e2fd['status'](_0xe310b4)[_0x624a('0x1e')](_0x1e6ffd);}};}function respondWithFilteredResult(_0x4935f4,_0x424200){return function(_0x195bfc){if(_0x195bfc){var _0x53005e=typeof _0x424200[_0x624a('0x1f')]===_0x624a('0x20')&&typeof _0x424200[_0x624a('0x21')]===_0x624a('0x20');var _0xce9cd5=_0x195bfc[_0x624a('0x22')];var _0x364867=_0x53005e?0x0:_0x424200[_0x624a('0x1f')];var _0x35342c=_0x53005e?_0x195bfc[_0x624a('0x22')]:_0x424200['offset']+_0x424200[_0x624a('0x21')];var _0x5c6901;if(_0x35342c>=_0xce9cd5){_0x35342c=_0xce9cd5;_0x5c6901=0xc8;}else{_0x5c6901=0xce;}_0x4935f4[_0x624a('0x23')](_0x5c6901);return _0x4935f4['set'](_0x624a('0x24'),_0x364867+'-'+_0x35342c+'/'+_0xce9cd5)[_0x624a('0x1e')](_0x195bfc);}return null;};}function patchUpdates(_0x415af0){return function(_0x200fdc){try{jsonpatch[_0x624a('0x25')](_0x200fdc,_0x415af0,!![]);}catch(_0x54e669){return BPromise[_0x624a('0x26')](_0x54e669);}return _0x200fdc[_0x624a('0x27')]();};}function saveUpdates(_0x156d32,_0x22beca){return function(_0x5dfeec){if(_0x5dfeec){return _0x5dfeec[_0x624a('0x28')](_0x156d32)[_0x624a('0x29')](function(_0x264349){return _0x264349;});}return null;};}function removeEntity(_0x4ba881,_0x4aee03){return function(_0x56834b){if(_0x56834b){return _0x56834b[_0x624a('0x2a')]()[_0x624a('0x29')](function(){var _0x31279d=_0x56834b[_0x624a('0x2b')]({'plain':!![]});var _0x51a817='ChanSpies';return db[_0x624a('0x2c')][_0x624a('0x2a')]({'where':{'type':_0x51a817,'resourceId':_0x31279d['id']}})['then'](function(){return _0x56834b;});})[_0x624a('0x29')](function(){_0x4ba881[_0x624a('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5366c4,_0x585126){return function(_0x41993c){if(!_0x41993c){_0x5366c4[_0x624a('0x1c')](0x194);}return _0x41993c;};}function handleError(_0x49ae13,_0x57d2d5){_0x57d2d5=_0x57d2d5||0x1f4;return function(_0x59917f){logger[_0x624a('0x2d')](_0x59917f[_0x624a('0x2e')]);if(_0x59917f[_0x624a('0x2f')]){delete _0x59917f['name'];}_0x49ae13[_0x624a('0x23')](_0x57d2d5)[_0x624a('0x30')](_0x59917f);};}exports['index']=function(_0x466af4,_0x59df8f){var _0x209ca5={},_0x1e775b={},_0x22140a={'count':0x0,'rows':[]};var _0x4619a8=_['map'](db[_0x624a('0x31')][_0x624a('0x32')],function(_0x5e8983){return{'name':_0x5e8983[_0x624a('0x33')],'type':_0x5e8983[_0x624a('0x34')][_0x624a('0x35')]};});_0x1e775b[_0x624a('0x36')]=_[_0x624a('0x37')](_0x4619a8,_0x624a('0x2f'));_0x1e775b['query']=_['keys'](_0x466af4[_0x624a('0x38')]);_0x1e775b[_0x624a('0x39')]=_[_0x624a('0x3a')](_0x1e775b['model'],_0x1e775b[_0x624a('0x38')]);_0x209ca5['attributes']=_['intersection'](_0x1e775b['model'],qs[_0x624a('0x3b')](_0x466af4['query'][_0x624a('0x3b')]));_0x209ca5['attributes']=_0x209ca5[_0x624a('0x3c')]['length']?_0x209ca5['attributes']:_0x1e775b[_0x624a('0x36')];if(!_0x466af4[_0x624a('0x38')][_0x624a('0x3d')](_0x624a('0x3e'))){_0x209ca5[_0x624a('0x21')]=qs[_0x624a('0x21')](_0x466af4[_0x624a('0x38')][_0x624a('0x21')]);_0x209ca5[_0x624a('0x1f')]=qs[_0x624a('0x1f')](_0x466af4['query'][_0x624a('0x1f')]);}_0x209ca5[_0x624a('0x3f')]=qs[_0x624a('0x40')](_0x466af4[_0x624a('0x38')][_0x624a('0x40')]);_0x209ca5['where']=qs[_0x624a('0x39')](_[_0x624a('0x41')](_0x466af4[_0x624a('0x38')],_0x1e775b[_0x624a('0x39')]),_0x4619a8);if(_0x466af4[_0x624a('0x38')][_0x624a('0x42')]){_0x209ca5['where']=_[_0x624a('0x43')](_0x209ca5[_0x624a('0x44')],{'$or':_[_0x624a('0x37')](_0x4619a8,function(_0x51d189){if(_0x51d189[_0x624a('0x34')]!=='VIRTUAL'){var _0x49db9c={};_0x49db9c[_0x51d189[_0x624a('0x2f')]]={'$like':'%'+_0x466af4[_0x624a('0x38')][_0x624a('0x42')]+'%'};return _0x49db9c;}})});}_0x209ca5=_['merge']({},_0x209ca5,_0x466af4['options']);var _0x142eb3={'where':_0x209ca5[_0x624a('0x44')]};return db['VoiceChanSpy'][_0x624a('0x22')](_0x142eb3)[_0x624a('0x29')](function(_0x574651){_0x22140a[_0x624a('0x22')]=_0x574651;if(_0x466af4[_0x624a('0x38')][_0x624a('0x45')]){_0x209ca5[_0x624a('0x46')]=[{'all':!![]}];}return db['VoiceChanSpy']['findAll'](_0x209ca5);})['then'](function(_0x23168b){_0x22140a[_0x624a('0x47')]=_0x23168b;return _0x22140a;})[_0x624a('0x29')](respondWithFilteredResult(_0x59df8f,_0x209ca5))[_0x624a('0x48')](handleError(_0x59df8f,null));};exports[_0x624a('0x49')]=function(_0x241883,_0x28a512){var _0x5f28aa={'raw':![],'where':{'id':_0x241883[_0x624a('0x4a')]['id']}},_0x2193fb={};_0x2193fb['model']=_['keys'](db[_0x624a('0x31')]['rawAttributes']);_0x2193fb[_0x624a('0x38')]=_[_0x624a('0x4b')](_0x241883[_0x624a('0x38')]);_0x2193fb['filters']=_[_0x624a('0x3a')](_0x2193fb[_0x624a('0x36')],_0x2193fb[_0x624a('0x38')]);_0x5f28aa[_0x624a('0x3c')]=_[_0x624a('0x3a')](_0x2193fb['model'],qs[_0x624a('0x3b')](_0x241883[_0x624a('0x38')][_0x624a('0x3b')]));_0x5f28aa['attributes']=_0x5f28aa[_0x624a('0x3c')][_0x624a('0x4c')]?_0x5f28aa[_0x624a('0x3c')]:_0x2193fb[_0x624a('0x36')];if(_0x241883[_0x624a('0x38')][_0x624a('0x45')]){_0x5f28aa['include']=[{'all':!![]}];}_0x5f28aa=_[_0x624a('0x43')]({},_0x5f28aa,_0x241883['options']);return db['VoiceChanSpy']['find'](_0x5f28aa)[_0x624a('0x29')](handleEntityNotFound(_0x28a512,null))[_0x624a('0x29')](respondWithResult(_0x28a512,null))[_0x624a('0x48')](handleError(_0x28a512,null));};exports[_0x624a('0x4d')]=function(_0x5312ec,_0x18c318){return db[_0x624a('0x31')][_0x624a('0x4d')](_0x5312ec['body'],{})['then'](function(_0x12d767){var _0x22a46d=_0x5312ec[_0x624a('0x4e')][_0x624a('0x2b')]({'plain':!![]});if(!_0x22a46d)throw new Error(_0x624a('0x4f'));if(_0x22a46d[_0x624a('0x50')]==='user'){var _0x351dc9=_0x12d767[_0x624a('0x2b')]({'plain':!![]});var _0x4ca80b=_0x624a('0x51');return db[_0x624a('0x52')][_0x624a('0x53')]({'where':{'name':_0x4ca80b,'userProfileId':_0x22a46d[_0x624a('0x54')]},'raw':!![]})[_0x624a('0x29')](function(_0x12bc21){if(_0x12bc21&&_0x12bc21['autoAssociation']===0x0){return db[_0x624a('0x2c')][_0x624a('0x4d')]({'name':_0x351dc9['name'],'resourceId':_0x351dc9['id'],'type':_0x12bc21[_0x624a('0x2f')],'sectionId':_0x12bc21['id']},{})[_0x624a('0x29')](function(){return _0x12d767;});}else{return _0x12d767;}})[_0x624a('0x48')](function(_0x52fc4e){logger[_0x624a('0x2d')](_0x624a('0x55'),_0x52fc4e);throw _0x52fc4e;});}return _0x12d767;})[_0x624a('0x29')](respondWithResult(_0x18c318,0xc9))['catch'](handleError(_0x18c318,null));};exports['update']=function(_0x590c83,_0x38429f){if(_0x590c83[_0x624a('0x56')]['id']){delete _0x590c83[_0x624a('0x56')]['id'];}return db[_0x624a('0x31')][_0x624a('0x53')]({'where':{'id':_0x590c83['params']['id']}})[_0x624a('0x29')](handleEntityNotFound(_0x38429f,null))[_0x624a('0x29')](saveUpdates(_0x590c83[_0x624a('0x56')],null))[_0x624a('0x29')](respondWithResult(_0x38429f,null))['catch'](handleError(_0x38429f,null));};exports['destroy']=function(_0x4e610,_0x33ccf1){return db['VoiceChanSpy']['find']({'where':{'id':_0x4e610[_0x624a('0x4a')]['id']}})[_0x624a('0x29')](handleEntityNotFound(_0x33ccf1,null))[_0x624a('0x29')](removeEntity(_0x33ccf1,null))['catch'](handleError(_0x33ccf1,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 31165dc..44493df 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 _0x02fc=['context','from-sip','%s%s','prefix','system','push','merge','Set','CDR(type)=%s','record','MixMonitor','format','${UNIQUEID}.%s,a','recordingFormat','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','StopMixMonitor','concat','internal','User','findAll','agent','then','catch','exports','define','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','destroy','length','lodash','bluebird','./voiceChanSpy.attributes'];(function(_0x294f8a,_0x5b93aa){var _0x2ed787=function(_0x5644c8){while(--_0x5644c8){_0x294f8a['push'](_0x294f8a['shift']());}};_0x2ed787(++_0x5b93aa);}(_0x02fc,0x10e));var _0xc02f=function(_0x5a45f4,_0x102353){_0x5a45f4=_0x5a45f4-0x0;var _0x57682f=_0x02fc[_0x5a45f4];return _0x57682f;};'use strict';var _=require(_0xc02f('0x0'));var util=require('util');var BPromise=require(_0xc02f('0x1'));var attributes=require(_0xc02f('0x2'));var getUserApplications=function(_0x41ba59,_0x4feed1,_0x29642c){var _0x660b27=0x1;var _0x109200=[];var _0x1d9e93={'context':_0x4feed1[_0xc02f('0x3')]||_0xc02f('0x4'),'exten':util['format'](_0xc02f('0x5'),_0x41ba59[_0xc02f('0x6')],_0x29642c),'type':_0xc02f('0x7'),'isApp':![],'ChanSpyId':_0x41ba59['id'],'UserId':_0x4feed1['id']};_0x109200[_0xc02f('0x8')](_[_0xc02f('0x9')]({'app':_0xc02f('0xa'),'appdata':util['format'](_0xc02f('0xb'),'chanspy'),'priority':_0x660b27++},_0x1d9e93));if(_0x41ba59[_0xc02f('0xc')]){_0x109200[_0xc02f('0x8')](_[_0xc02f('0x9')]({'app':_0xc02f('0xd'),'appdata':util[_0xc02f('0xe')](_0xc02f('0xf'),_0x41ba59[_0xc02f('0x10')]),'priority':_0x660b27++},_0x1d9e93));}if(_0x41ba59['auth']){_0x109200[_0xc02f('0x8')](_[_0xc02f('0x9')]({'app':_0xc02f('0x11'),'appdata':_0x41ba59[_0xc02f('0x12')],'priority':_0x660b27++},_0x1d9e93));}_0x109200[_0xc02f('0x8')](_[_0xc02f('0x9')]({'app':_0xc02f('0x13'),'appdata':util[_0xc02f('0xe')](_0xc02f('0x14'),_0x4feed1[_0xc02f('0x15')],_0x41ba59[_0xc02f('0x16')]?_0x41ba59['options']['join'](''):''),'priority':_0x660b27++},_0x1d9e93));if(_0x41ba59[_0xc02f('0xc')]){_0x109200[_0xc02f('0x8')](_['merge']({'app':_0xc02f('0x17'),'priority':_0x660b27++},_0x1d9e93));}return _0x109200;};var getChanSpyApplications=function(_0x6b3a59,_0x28ee45){var _0x809c81=[];for(var _0x3bbaab=0x0,_0x49d43d=0x1;_0x3bbaab<_0x28ee45['length'];_0x3bbaab++,_0x49d43d=0x1){_0x809c81=_0x809c81[_0xc02f('0x18')](getUserApplications(_0x6b3a59,_0x28ee45[_0x3bbaab],_0x28ee45[_0x3bbaab][_0xc02f('0x19')]));if(_0x28ee45[_0x3bbaab]['internal']!=_0x28ee45[_0x3bbaab][_0xc02f('0x15')]){_0x809c81=_0x809c81[_0xc02f('0x18')](getUserApplications(_0x6b3a59,_0x28ee45[_0x3bbaab],_0x28ee45[_0x3bbaab][_0xc02f('0x15')]));}}return _0x809c81;};var getChanSpyPromise=function(_0x50af06,_0x5e100d){return new BPromise(function(_0xe58a49,_0x4b414a){return _0x50af06[_0xc02f('0x1a')][_0xc02f('0x1b')]({'attributes':['id','name','internal'],'where':{'role':_0xc02f('0x1c'),'chanspy':!![]},'raw':!![]})[_0xc02f('0x1d')](function(_0x1f610e){if(_0x1f610e){return _0xe58a49(getChanSpyApplications(_0x5e100d,_0x1f610e));}return _0xe58a49([]);})[_0xc02f('0x1e')](function(_0x19cd5e){_0x4b414a(_0x19cd5e);});});};module[_0xc02f('0x1f')]=function(_0x45af64,_0x2adec2){var _0x4ca4f6=_0x45af64['models'];return _0x45af64[_0xc02f('0x20')](_0xc02f('0x21'),attributes,{'tableName':_0xc02f('0x22'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x66d201,_0x13b365,_0x360a37){return getChanSpyPromise(_0x4ca4f6,_0x66d201)[_0xc02f('0x1d')](function(_0x3e2d6d){if(_0x3e2d6d&&_0x3e2d6d['length']){return _0x4ca4f6[_0xc02f('0x23')][_0xc02f('0x24')](_0x3e2d6d);}})[_0xc02f('0x1d')](function(){_0x360a37();})['catch'](function(_0x276c6c){_0x360a37(_0x276c6c);});},'afterUpdate':function(_0x597bb7,_0x3cbb6a,_0x1976b7){return _0x4ca4f6[_0xc02f('0x23')][_0xc02f('0x25')]({'where':{'ChanSpyId':_0x597bb7['id']}})[_0xc02f('0x1d')](function(){return getChanSpyPromise(_0x4ca4f6,_0x597bb7);})[_0xc02f('0x1d')](function(_0x5a2130){if(_0x5a2130&&_0x5a2130[_0xc02f('0x26')]){return _0x4ca4f6[_0xc02f('0x23')][_0xc02f('0x24')](_0x5a2130);}})['then'](function(){_0x1976b7();})[_0xc02f('0x1e')](function(_0x3b7365){_0x1976b7(_0x3b7365);});},'afterDestroy':function(_0x2c517f,_0x37bba4,_0x5bfffd){return _0x4ca4f6[_0xc02f('0x23')][_0xc02f('0x25')]({'where':{'ChanSpyId':_0x2c517f['id']}})[_0xc02f('0x1d')](function(){_0x5bfffd();})['catch'](function(_0x58b644){_0x5bfffd(_0x58b644);});}}});}; \ No newline at end of file +var _0x95fb=['${UNIQUEID}.%s,a','recordingFormat','auth','password','ChanSpy','name','options','join','record','concat','internal','findAll','agent','then','catch','exports','models','VoiceChanSpy','voice_chanspy','length','VoiceExtension','bulkCreate','destroy','lodash','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','push','merge','Set','MixMonitor'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x95fb,0x1c7));var _0xb95f=function(_0x3ffe90,_0x10b4df){_0x3ffe90=_0x3ffe90-0x0;var _0x3a7367=_0x95fb[_0x3ffe90];return _0x3a7367;};'use strict';var _=require(_0xb95f('0x0'));var util=require('util');var BPromise=require(_0xb95f('0x1'));var attributes=require(_0xb95f('0x2'));var getUserApplications=function(_0x41eb38,_0x583f7b,_0x463af2){var _0x42e465=0x1;var _0x1a311e=[];var _0xc2f14c={'context':_0x583f7b[_0xb95f('0x3')]||_0xb95f('0x4'),'exten':util[_0xb95f('0x5')](_0xb95f('0x6'),_0x41eb38[_0xb95f('0x7')],_0x463af2),'type':_0xb95f('0x8'),'isApp':![],'ChanSpyId':_0x41eb38['id'],'UserId':_0x583f7b['id']};_0x1a311e[_0xb95f('0x9')](_[_0xb95f('0xa')]({'app':_0xb95f('0xb'),'appdata':util['format']('CDR(type)=%s','chanspy'),'priority':_0x42e465++},_0xc2f14c));if(_0x41eb38['record']){_0x1a311e[_0xb95f('0x9')](_['merge']({'app':_0xb95f('0xc'),'appdata':util[_0xb95f('0x5')](_0xb95f('0xd'),_0x41eb38[_0xb95f('0xe')]),'priority':_0x42e465++},_0xc2f14c));}if(_0x41eb38[_0xb95f('0xf')]){_0x1a311e[_0xb95f('0x9')](_[_0xb95f('0xa')]({'app':'Authenticate','appdata':_0x41eb38[_0xb95f('0x10')],'priority':_0x42e465++},_0xc2f14c));}_0x1a311e[_0xb95f('0x9')](_[_0xb95f('0xa')]({'app':_0xb95f('0x11'),'appdata':util[_0xb95f('0x5')]('SIP/%s,%s',_0x583f7b[_0xb95f('0x12')],_0x41eb38['options']?_0x41eb38[_0xb95f('0x13')][_0xb95f('0x14')](''):''),'priority':_0x42e465++},_0xc2f14c));if(_0x41eb38[_0xb95f('0x15')]){_0x1a311e['push'](_[_0xb95f('0xa')]({'app':'StopMixMonitor','priority':_0x42e465++},_0xc2f14c));}return _0x1a311e;};var getChanSpyApplications=function(_0x3c43e2,_0x1dcf99){var _0xce4aaf=[];for(var _0x261a75=0x0,_0x5ac763=0x1;_0x261a75<_0x1dcf99['length'];_0x261a75++,_0x5ac763=0x1){_0xce4aaf=_0xce4aaf[_0xb95f('0x16')](getUserApplications(_0x3c43e2,_0x1dcf99[_0x261a75],_0x1dcf99[_0x261a75][_0xb95f('0x17')]));if(_0x1dcf99[_0x261a75]['internal']!=_0x1dcf99[_0x261a75][_0xb95f('0x12')]){_0xce4aaf=_0xce4aaf[_0xb95f('0x16')](getUserApplications(_0x3c43e2,_0x1dcf99[_0x261a75],_0x1dcf99[_0x261a75][_0xb95f('0x12')]));}}return _0xce4aaf;};var getChanSpyPromise=function(_0x47346a,_0x5608d5){return new BPromise(function(_0x14e77b,_0x4ee210){return _0x47346a['User'][_0xb95f('0x18')]({'attributes':['id',_0xb95f('0x12'),_0xb95f('0x17')],'where':{'role':_0xb95f('0x19'),'chanspy':!![]},'raw':!![]})[_0xb95f('0x1a')](function(_0xe22b73){if(_0xe22b73){return _0x14e77b(getChanSpyApplications(_0x5608d5,_0xe22b73));}return _0x14e77b([]);})[_0xb95f('0x1b')](function(_0x12bc33){_0x4ee210(_0x12bc33);});});};module[_0xb95f('0x1c')]=function(_0x453b00,_0x36d71e){var _0x2aa5df=_0x453b00[_0xb95f('0x1d')];return _0x453b00['define'](_0xb95f('0x1e'),attributes,{'tableName':_0xb95f('0x1f'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x36095a,_0x1bf617,_0x1a0f0f){return getChanSpyPromise(_0x2aa5df,_0x36095a)[_0xb95f('0x1a')](function(_0x4e6d46){if(_0x4e6d46&&_0x4e6d46[_0xb95f('0x20')]){return _0x2aa5df[_0xb95f('0x21')]['bulkCreate'](_0x4e6d46);}})[_0xb95f('0x1a')](function(){_0x1a0f0f();})[_0xb95f('0x1b')](function(_0x1208d5){_0x1a0f0f(_0x1208d5);});},'afterUpdate':function(_0x308d79,_0x4d3f7e,_0x3e840d){return _0x2aa5df[_0xb95f('0x21')]['destroy']({'where':{'ChanSpyId':_0x308d79['id']}})[_0xb95f('0x1a')](function(){return getChanSpyPromise(_0x2aa5df,_0x308d79);})['then'](function(_0x1f9cb1){if(_0x1f9cb1&&_0x1f9cb1['length']){return _0x2aa5df[_0xb95f('0x21')][_0xb95f('0x22')](_0x1f9cb1);}})['then'](function(){_0x3e840d();})['catch'](function(_0xc3dd6){_0x3e840d(_0xc3dd6);});},'afterDestroy':function(_0x1de2bd,_0x2c3eee,_0x4a63a1){return _0x2aa5df[_0xb95f('0x21')][_0xb95f('0x23')]({'where':{'ChanSpyId':_0x1de2bd['id']}})[_0xb95f('0x1a')](function(){_0x4a63a1();})[_0xb95f('0x1b')](function(_0x1ada0f){_0x4a63a1(_0x1ada0f);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 6fc5637..7d7c6cb 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 _0xb821=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','message','util','moment','ioredis'];(function(_0x21f83c,_0x309e0c){var _0x4a15f2=function(_0x3ef5c6){while(--_0x3ef5c6){_0x21f83c['push'](_0x21f83c['shift']());}};_0x4a15f2(++_0x309e0c);}(_0xb821,0xa7));var _0x1b82=function(_0x79bffb,_0x708de5){_0x79bffb=_0x79bffb-0x0;var _0x2f2d35=_0xb821[_0x79bffb];return _0x2f2d35;};'use strict';var _=require('lodash');var util=require(_0x1b82('0x0'));var moment=require(_0x1b82('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1b82('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1b82('0x3'))(_0x1b82('0x4'));var config=require(_0x1b82('0x5'));var jayson=require(_0x1b82('0x6'));var client=jayson['client'][_0x1b82('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x192434,_0x202a5f,_0x3632dd){return new BPromise(function(_0x18f45f,_0x7b87e8){return client[_0x1b82('0x8')](_0x192434,_0x3632dd)[_0x1b82('0x9')](function(_0x141673){logger['info'](_0x1b82('0xa'),_0x202a5f,_0x1b82('0xb'));logger[_0x1b82('0xc')](_0x1b82('0xd'),_0x202a5f,_0x1b82('0xb'),JSON[_0x1b82('0xe')](_0x141673));if(_0x141673[_0x1b82('0xf')]){if(_0x141673[_0x1b82('0xf')]['code']===0x1f4){logger[_0x1b82('0xf')](_0x1b82('0xa'),_0x202a5f,_0x141673[_0x1b82('0xf')][_0x1b82('0x10')]);return _0x7b87e8(_0x141673['error'][_0x1b82('0x10')]);}logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0x202a5f,_0x141673[_0x1b82('0xf')]['message']);return _0x18f45f(_0x141673[_0x1b82('0xf')][_0x1b82('0x10')]);}else{logger['info'](_0x1b82('0xa'),_0x202a5f,'request\x20sent');_0x18f45f(_0x141673['result'][_0x1b82('0x10')]);}})['catch'](function(_0x111247){logger[_0x1b82('0xf')](_0x1b82('0xa'),_0x202a5f,_0x111247);_0x7b87e8(_0x111247);});});} \ No newline at end of file +var _0x6b24=['client','request','then','info','VoiceChanSpy,\x20%s,\x20%s','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment','bluebird','randomstring','../../config/logger','../../config/environment'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x6b24,0x1ce));var _0x46b2=function(_0x1d3577,_0x17a32e){_0x1d3577=_0x1d3577-0x0;var _0x277d9a=_0x6b24[_0x1d3577];return _0x277d9a;};'use strict';var _=require('lodash');var util=require(_0x46b2('0x0'));var moment=require(_0x46b2('0x1'));var BPromise=require(_0x46b2('0x2'));var rs=require(_0x46b2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x46b2('0x4'))('rpc');var config=require(_0x46b2('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x46b2('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x512905,_0x326eb7,_0x233ccf){return new BPromise(function(_0x1f81b8,_0x1531c){return client[_0x46b2('0x7')](_0x512905,_0x233ccf)[_0x46b2('0x8')](function(_0x3144df){logger[_0x46b2('0x9')](_0x46b2('0xa'),_0x326eb7,'request\x20sent');logger['debug'](_0x46b2('0xb'),_0x326eb7,_0x46b2('0xc'),JSON[_0x46b2('0xd')](_0x3144df));if(_0x3144df['error']){if(_0x3144df[_0x46b2('0xe')][_0x46b2('0xf')]===0x1f4){logger[_0x46b2('0xe')]('VoiceChanSpy,\x20%s,\x20%s',_0x326eb7,_0x3144df[_0x46b2('0xe')][_0x46b2('0x10')]);return _0x1531c(_0x3144df[_0x46b2('0xe')][_0x46b2('0x10')]);}logger[_0x46b2('0xe')](_0x46b2('0xa'),_0x326eb7,_0x3144df[_0x46b2('0xe')][_0x46b2('0x10')]);return _0x1f81b8(_0x3144df[_0x46b2('0xe')][_0x46b2('0x10')]);}else{logger['info'](_0x46b2('0xa'),_0x326eb7,_0x46b2('0xc'));_0x1f81b8(_0x3144df['result'][_0x46b2('0x10')]);}})[_0x46b2('0x11')](function(_0xe3d3d9){logger[_0x46b2('0xe')](_0x46b2('0xa'),_0x326eb7,_0xe3d3d9);_0x1531c(_0xe3d3d9);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 712ed8c..85b53b1 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 _0x30bc=['../../config/environment','./voiceContext.controller','get','index','/:id','show','post','isAuthenticated','create','update','delete','destroy','exports','util','connect-timeout'];(function(_0x2915d9,_0x4ca676){var _0x1bd3d1=function(_0x1225af){while(--_0x1225af){_0x2915d9['push'](_0x2915d9['shift']());}};_0x1bd3d1(++_0x4ca676);}(_0x30bc,0x1ed));var _0xc30b=function(_0x4456a2,_0x376ff2){_0x4456a2=_0x4456a2-0x0;var _0xf36b56=_0x30bc[_0x4456a2];return _0xf36b56;};'use strict';var multer=require('multer');var util=require(_0xc30b('0x0'));var path=require('path');var timeout=require(_0xc30b('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc30b('0x2'));var controller=require(_0xc30b('0x3'));router[_0xc30b('0x4')]('/',auth['isAuthenticated'](),controller[_0xc30b('0x5')]);router[_0xc30b('0x4')](_0xc30b('0x6'),auth['isAuthenticated'](),controller[_0xc30b('0x7')]);router[_0xc30b('0x8')]('/',auth[_0xc30b('0x9')](),controller[_0xc30b('0xa')]);router['put'](_0xc30b('0x6'),auth[_0xc30b('0x9')](),controller[_0xc30b('0xb')]);router[_0xc30b('0xc')](_0xc30b('0x6'),auth[_0xc30b('0x9')](),controller[_0xc30b('0xd')]);module[_0xc30b('0xe')]=router; \ No newline at end of file +var _0xac28=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','post','create','put','/:id','delete','exports','connect-timeout','express'];(function(_0x872f6f,_0x5efe7b){var _0x59a5f4=function(_0x147463){while(--_0x147463){_0x872f6f['push'](_0x872f6f['shift']());}};_0x59a5f4(++_0x5efe7b);}(_0xac28,0x193));var _0x8ac2=function(_0x4b0cfe,_0x129539){_0x4b0cfe=_0x4b0cfe-0x0;var _0x1d37c8=_0xac28[_0x4b0cfe];return _0x1d37c8;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x8ac2('0x0'));var express=require(_0x8ac2('0x1'));var router=express[_0x8ac2('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x8ac2('0x3'));var interaction=require(_0x8ac2('0x4'));var config=require(_0x8ac2('0x5'));var controller=require(_0x8ac2('0x6'));router[_0x8ac2('0x7')]('/',auth[_0x8ac2('0x8')](),controller['index']);router['get']('/:id',auth[_0x8ac2('0x8')](),controller['show']);router[_0x8ac2('0x9')]('/',auth[_0x8ac2('0x8')](),controller[_0x8ac2('0xa')]);router[_0x8ac2('0xb')](_0x8ac2('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x8ac2('0xd')]('/:id',auth[_0x8ac2('0x8')](),controller['destroy']);module[_0x8ac2('0xe')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 79d5754..52958c8 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 _0x1101=['sequelize','exports','BOOLEAN'];(function(_0x5e684e,_0x80be66){var _0x29d5fe=function(_0x4766ed){while(--_0x4766ed){_0x5e684e['push'](_0x5e684e['shift']());}};_0x29d5fe(++_0x80be66);}(_0x1101,0x69));var _0x1110=function(_0x53f734,_0x7d757b){_0x53f734=_0x53f734-0x0;var _0xcd34f7=_0x1101[_0x53f734];return _0xcd34f7;};'use strict';var Sequelize=require(_0x1110('0x0'));module[_0x1110('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x1110('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x70e7=['BOOLEAN','exports','STRING'];(function(_0x491789,_0x433ba7){var _0x46bba2=function(_0x494da7){while(--_0x494da7){_0x491789['push'](_0x491789['shift']());}};_0x46bba2(++_0x433ba7);}(_0x70e7,0xdc));var _0x770e=function(_0x53ebbc,_0x4845e2){_0x53ebbc=_0x53ebbc-0x0;var _0x47e7a5=_0x70e7[_0x53ebbc];return _0x47e7a5;};'use strict';var Sequelize=require('sequelize');module[_0x770e('0x0')]={'name':{'type':Sequelize[_0x770e('0x1')],'unique':'name'},'description':{'type':Sequelize[_0x770e('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x770e('0x2')],'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 5ac14c2..3685b58 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 _0x8b51=['catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','Contexts','UserProfileResource','stack','name','send','index','map','VoiceContext','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','includeAll','include','rows','show','length','options','create','body','findAll','join','root','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','server/files/templates/context.ejs','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','info','VoiceContext,\x20%s,\x20%s','request\x20sent','error','code','message'];(function(_0x3086db,_0xad3299){var _0x4c9094=function(_0x48be29){while(--_0x48be29){_0x3086db['push'](_0x3086db['shift']());}};_0x4c9094(++_0xad3299);}(_0x8b51,0x1dc));var _0x18b5=function(_0x3cddf2,_0x9f40cd){_0x3cddf2=_0x3cddf2-0x0;var _0x2deef3=_0x8b51[_0x3cddf2];return _0x2deef3;};'use strict';var emlformat=require(_0x18b5('0x0'));var rimraf=require(_0x18b5('0x1'));var zipdir=require(_0x18b5('0x2'));var jsonpatch=require(_0x18b5('0x3'));var rp=require(_0x18b5('0x4'));var moment=require('moment');var BPromise=require(_0x18b5('0x5'));var Mustache=require(_0x18b5('0x6'));var util=require(_0x18b5('0x7'));var path=require(_0x18b5('0x8'));var sox=require(_0x18b5('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x18b5('0xa'));var squel=require(_0x18b5('0xb'));var crypto=require('crypto');var jsforce=require(_0x18b5('0xc'));var deskjs=require(_0x18b5('0xd'));var toCsv=require(_0x18b5('0xe'));var querystring=require('querystring');var Papa=require(_0x18b5('0xf'));var Redis=require(_0x18b5('0x10'));var authService=require(_0x18b5('0x11'));var qs=require(_0x18b5('0x12'));var as=require(_0x18b5('0x13'));var hardwareService=require(_0x18b5('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x18b5('0x15'));var licenseUtil=require(_0x18b5('0x16'));var db=require(_0x18b5('0x17'))['db'];var jayson=require(_0x18b5('0x18'));var client=jayson[_0x18b5('0x19')][_0x18b5('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x1625a0,_0x43f362,_0x21dc18,_0x4fd9b9){return new BPromise(function(_0xd5af50,_0xe65e17){var _0x19e3f4=_0x4fd9b9||client;return _0x19e3f4[_0x18b5('0x1b')](_0x1625a0,_0x21dc18)['then'](function(_0x1cb3f5){logger[_0x18b5('0x1c')](_0x18b5('0x1d'),_0x43f362,_0x18b5('0x1e'));logger['debug']('VoiceContext,\x20%s,\x20%s,\x20%s',_0x43f362,'request\x20sent',JSON['stringify'](_0x1cb3f5));if(_0x1cb3f5[_0x18b5('0x1f')]){if(_0x1cb3f5[_0x18b5('0x1f')][_0x18b5('0x20')]===0x1f4){logger['error'](_0x18b5('0x1d'),_0x43f362,_0x1cb3f5['error'][_0x18b5('0x21')]);return _0xe65e17(_0x1cb3f5['error'][_0x18b5('0x21')]);}logger[_0x18b5('0x1f')]('VoiceContext,\x20%s,\x20%s',_0x43f362,_0x1cb3f5['error'][_0x18b5('0x21')]);return _0xd5af50(_0x1cb3f5[_0x18b5('0x1f')]['message']);}else{logger[_0x18b5('0x1c')]('VoiceContext,\x20%s,\x20%s',_0x43f362,_0x18b5('0x1e'));_0xd5af50(_0x1cb3f5['result'][_0x18b5('0x21')]);}})[_0x18b5('0x22')](function(_0x5b2659){logger[_0x18b5('0x1f')](_0x18b5('0x1d'),_0x43f362,_0x5b2659);_0xe65e17(_0x5b2659);});});}function respondWithStatusCode(_0xeb3121,_0xc94aca){_0xc94aca=_0xc94aca||0xcc;return function(_0x2dc77f){if(_0x2dc77f){return _0xeb3121[_0x18b5('0x23')](_0xc94aca);}return _0xeb3121[_0x18b5('0x24')](_0xc94aca)['end']();};}function respondWithResult(_0x21314b,_0x1de037){_0x1de037=_0x1de037||0xc8;return function(_0x4ce3bc){if(_0x4ce3bc){return _0x21314b[_0x18b5('0x24')](_0x1de037)[_0x18b5('0x25')](_0x4ce3bc);}};}function respondWithFilteredResult(_0x3dbeda,_0x16eec3){return function(_0xdf11af){if(_0xdf11af){var _0x4465ab=typeof _0x16eec3[_0x18b5('0x26')]===_0x18b5('0x27')&&typeof _0x16eec3[_0x18b5('0x28')]===_0x18b5('0x27');var _0x3c7a83=_0xdf11af[_0x18b5('0x29')];var _0x47a768=_0x4465ab?0x0:_0x16eec3['offset'];var _0x5f1c81=_0x4465ab?_0xdf11af[_0x18b5('0x29')]:_0x16eec3[_0x18b5('0x26')]+_0x16eec3[_0x18b5('0x28')];var _0x21af30;if(_0x5f1c81>=_0x3c7a83){_0x5f1c81=_0x3c7a83;_0x21af30=0xc8;}else{_0x21af30=0xce;}_0x3dbeda[_0x18b5('0x24')](_0x21af30);return _0x3dbeda[_0x18b5('0x2a')](_0x18b5('0x2b'),_0x47a768+'-'+_0x5f1c81+'/'+_0x3c7a83)[_0x18b5('0x25')](_0xdf11af);}return null;};}function patchUpdates(_0x27a655){return function(_0x300fcf){try{jsonpatch[_0x18b5('0x2c')](_0x300fcf,_0x27a655,!![]);}catch(_0x3bcc1a){return BPromise[_0x18b5('0x2d')](_0x3bcc1a);}return _0x300fcf[_0x18b5('0x2e')]();};}function saveUpdates(_0x388b8a,_0x1972e7){return function(_0x1a750d){if(_0x1a750d){return _0x1a750d[_0x18b5('0x2f')](_0x388b8a)['then'](function(_0x37d47b){return _0x37d47b;});}return null;};}function removeEntity(_0xf6f957,_0x54ab29){return function(_0x46664f){if(_0x46664f){return _0x46664f[_0x18b5('0x30')]()[_0x18b5('0x31')](function(){var _0x42eec9=_0x46664f[_0x18b5('0x32')]({'plain':!![]});var _0x3fde88=_0x18b5('0x33');return db[_0x18b5('0x34')][_0x18b5('0x30')]({'where':{'type':_0x3fde88,'resourceId':_0x42eec9['id']}})[_0x18b5('0x31')](function(){return _0x46664f;});})[_0x18b5('0x31')](function(){_0xf6f957[_0x18b5('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26ce84,_0x2e3464){return function(_0x16a68f){if(!_0x16a68f){_0x26ce84[_0x18b5('0x23')](0x194);}return _0x16a68f;};}function handleError(_0x2a4719,_0x525afe){_0x525afe=_0x525afe||0x1f4;return function(_0x45a24d){logger['error'](_0x45a24d[_0x18b5('0x35')]);if(_0x45a24d['name']){delete _0x45a24d[_0x18b5('0x36')];}_0x2a4719[_0x18b5('0x24')](_0x525afe)[_0x18b5('0x37')](_0x45a24d);};}exports[_0x18b5('0x38')]=function(_0x5eb723,_0x3d9ea8){var _0x49a11e={},_0x1fdc95={},_0x554ca7={'count':0x0,'rows':[]};var _0x320160=_[_0x18b5('0x39')](db[_0x18b5('0x3a')][_0x18b5('0x3b')],function(_0x384af0){return{'name':_0x384af0['fieldName'],'type':_0x384af0[_0x18b5('0x3c')][_0x18b5('0x3d')]};});_0x1fdc95[_0x18b5('0x3e')]=_[_0x18b5('0x39')](_0x320160,_0x18b5('0x36'));_0x1fdc95[_0x18b5('0x3f')]=_[_0x18b5('0x40')](_0x5eb723[_0x18b5('0x3f')]);_0x1fdc95['filters']=_['intersection'](_0x1fdc95['model'],_0x1fdc95[_0x18b5('0x3f')]);_0x49a11e['attributes']=_[_0x18b5('0x41')](_0x1fdc95['model'],qs['fields'](_0x5eb723[_0x18b5('0x3f')][_0x18b5('0x42')]));_0x49a11e['attributes']=_0x49a11e[_0x18b5('0x43')]['length']?_0x49a11e['attributes']:_0x1fdc95[_0x18b5('0x3e')];if(!_0x5eb723[_0x18b5('0x3f')][_0x18b5('0x44')](_0x18b5('0x45'))){_0x49a11e[_0x18b5('0x28')]=qs[_0x18b5('0x28')](_0x5eb723[_0x18b5('0x3f')][_0x18b5('0x28')]);_0x49a11e[_0x18b5('0x26')]=qs[_0x18b5('0x26')](_0x5eb723[_0x18b5('0x3f')][_0x18b5('0x26')]);}_0x49a11e[_0x18b5('0x46')]=qs[_0x18b5('0x47')](_0x5eb723[_0x18b5('0x3f')][_0x18b5('0x47')]);_0x49a11e[_0x18b5('0x48')]=qs[_0x18b5('0x49')](_['pick'](_0x5eb723[_0x18b5('0x3f')],_0x1fdc95[_0x18b5('0x49')]),_0x320160);if(_0x5eb723[_0x18b5('0x3f')][_0x18b5('0x4a')]){_0x49a11e[_0x18b5('0x48')]=_['merge'](_0x49a11e[_0x18b5('0x48')],{'$or':_[_0x18b5('0x39')](_0x320160,function(_0x58cc63){if(_0x58cc63[_0x18b5('0x3c')]!==_0x18b5('0x4b')){var _0x317852={};_0x317852[_0x58cc63[_0x18b5('0x36')]]={'$like':'%'+_0x5eb723[_0x18b5('0x3f')]['filter']+'%'};return _0x317852;}})});}_0x49a11e=_[_0x18b5('0x4c')]({},_0x49a11e,_0x5eb723['options']);var _0x30fd94={'where':_0x49a11e[_0x18b5('0x48')]};return db['VoiceContext'][_0x18b5('0x29')](_0x30fd94)[_0x18b5('0x31')](function(_0x76ee43){_0x554ca7[_0x18b5('0x29')]=_0x76ee43;if(_0x5eb723['query'][_0x18b5('0x4d')]){_0x49a11e[_0x18b5('0x4e')]=[{'all':!![]}];}return db[_0x18b5('0x3a')]['findAll'](_0x49a11e);})[_0x18b5('0x31')](function(_0x627f05){_0x554ca7[_0x18b5('0x4f')]=_0x627f05;return _0x554ca7;})[_0x18b5('0x31')](respondWithFilteredResult(_0x3d9ea8,_0x49a11e))[_0x18b5('0x22')](handleError(_0x3d9ea8,null));};exports[_0x18b5('0x50')]=function(_0xa62e90,_0x167b2c){var _0x4bdef8={'raw':![],'where':{'id':_0xa62e90['params']['id']}},_0x27d7e2={};_0x27d7e2[_0x18b5('0x3e')]=_[_0x18b5('0x40')](db[_0x18b5('0x3a')][_0x18b5('0x3b')]);_0x27d7e2[_0x18b5('0x3f')]=_['keys'](_0xa62e90[_0x18b5('0x3f')]);_0x27d7e2[_0x18b5('0x49')]=_[_0x18b5('0x41')](_0x27d7e2[_0x18b5('0x3e')],_0x27d7e2[_0x18b5('0x3f')]);_0x4bdef8[_0x18b5('0x43')]=_[_0x18b5('0x41')](_0x27d7e2['model'],qs[_0x18b5('0x42')](_0xa62e90[_0x18b5('0x3f')][_0x18b5('0x42')]));_0x4bdef8[_0x18b5('0x43')]=_0x4bdef8[_0x18b5('0x43')][_0x18b5('0x51')]?_0x4bdef8[_0x18b5('0x43')]:_0x27d7e2[_0x18b5('0x3e')];if(_0xa62e90['query']['includeAll']){_0x4bdef8[_0x18b5('0x4e')]=[{'all':!![]}];}_0x4bdef8=_[_0x18b5('0x4c')]({},_0x4bdef8,_0xa62e90[_0x18b5('0x52')]);return db[_0x18b5('0x3a')]['find'](_0x4bdef8)[_0x18b5('0x31')](handleEntityNotFound(_0x167b2c,null))[_0x18b5('0x31')](respondWithResult(_0x167b2c,null))[_0x18b5('0x22')](handleError(_0x167b2c,null));};exports[_0x18b5('0x53')]=function(_0x5ce76f,_0x3784e4,_0x3bad7d){var _0x6b3b12;return db['VoiceContext'][_0x18b5('0x53')](_0x5ce76f[_0x18b5('0x54')],{'raw':!![]})[_0x18b5('0x31')](function(_0x317bc0){_0x6b3b12=_0x317bc0;return db['VoiceContext'][_0x18b5('0x55')]({'raw':!![]});})[_0x18b5('0x31')](function(_0x2da45c){var _0x1b3a10=fs['readFileSync'](path[_0x18b5('0x56')](config[_0x18b5('0x57')],'server/files/templates/context.ejs'),_0x18b5('0x58'));var _0xccb525=ejs[_0x18b5('0x59')](_0x1b3a10,{'contexts':_0x2da45c||[]});fs[_0x18b5('0x5a')](_0x18b5('0x5b'),_0xccb525);})[_0x18b5('0x31')](function(){return respondWithRpcPromise(_0x18b5('0x5c'),_0x18b5('0x53'),{'module':_0x18b5('0x5d')});})['then'](function(){var _0x32effc=_0x5ce76f[_0x18b5('0x5e')][_0x18b5('0x32')]({'plain':!![]});if(!_0x32effc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x32effc[_0x18b5('0x5f')]===_0x18b5('0x5e')){var _0x6a6f35=_0x6b3b12[_0x18b5('0x32')]({'plain':!![]});return db[_0x18b5('0x60')][_0x18b5('0x61')]({'where':{'name':_0x18b5('0x33'),'userProfileId':_0x32effc[_0x18b5('0x62')]},'raw':!![]})[_0x18b5('0x31')](function(_0x2d9459){if(_0x2d9459&&_0x2d9459['autoAssociation']===0x0){return db['UserProfileResource'][_0x18b5('0x53')]({'name':_0x6a6f35['name'],'resourceId':_0x6a6f35['id'],'type':_0x2d9459['name'],'sectionId':_0x2d9459['id']},{})['then'](function(){return _0x6b3b12;});}else{return _0x6b3b12;}})[_0x18b5('0x22')](function(_0x55b780){logger[_0x18b5('0x1f')](_0x18b5('0x63'),_0x55b780);throw _0x55b780;});}return _0x6b3b12;})[_0x18b5('0x31')](respondWithResult(_0x3784e4,0xc9))[_0x18b5('0x22')](handleError(_0x3784e4,null));};exports[_0x18b5('0x2f')]=function(_0x1e4c5a,_0x88357d,_0x2854db){var _0x465986;return db[_0x18b5('0x3a')]['find']({'where':{'id':_0x1e4c5a['params']['id']}})[_0x18b5('0x31')](handleEntityNotFound(_0x88357d,null))[_0x18b5('0x31')](saveUpdates(_0x1e4c5a['body'],null))[_0x18b5('0x31')](function(_0x553f8a){if(_0x553f8a){_0x465986=_0x553f8a;return db[_0x18b5('0x3a')][_0x18b5('0x55')]({'raw':!![]});}})[_0x18b5('0x31')](function(_0x1c25e1){var _0x1510ea=fs[_0x18b5('0x64')](path[_0x18b5('0x56')](config[_0x18b5('0x57')],_0x18b5('0x65')),'utf8');var _0x54d633=ejs['render'](_0x1510ea,{'contexts':_0x1c25e1||[]});fs[_0x18b5('0x5a')](_0x18b5('0x5b'),_0x54d633);})['then'](function(){return respondWithRpcPromise(_0x18b5('0x5c'),'update',{'module':'chan_sip.so'});})['then'](function(){return _0x465986;})[_0x18b5('0x31')](respondWithResult(_0x88357d,null))[_0x18b5('0x22')](handleError(_0x88357d,null));};exports[_0x18b5('0x30')]=function(_0xeedfcb,_0x4a8ddc,_0x4d3ebe){var _0x1b6cb2;return db[_0x18b5('0x3a')][_0x18b5('0x61')]({'where':{'id':_0xeedfcb['params']['id']}})[_0x18b5('0x31')](handleEntityNotFound(_0x4a8ddc,null))[_0x18b5('0x31')](removeEntity(_0x4a8ddc,null))[_0x18b5('0x31')](function(){return db[_0x18b5('0x3a')][_0x18b5('0x55')]({'raw':!![]});})['then'](function(_0x57ff75){var _0x558e27=fs['readFileSync'](path[_0x18b5('0x56')](config[_0x18b5('0x57')],_0x18b5('0x65')),'utf8');var _0x4cbdc9=ejs[_0x18b5('0x59')](_0x558e27,{'contexts':_0x57ff75});fs[_0x18b5('0x5a')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x4cbdc9);return respondWithRpcPromise('Reload',_0x18b5('0x30'),{'module':_0x18b5('0x5d')});})['catch'](handleError(_0x4a8ddc,null));}; \ No newline at end of file +var _0xb21f=['info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','reject','update','then','get','Contexts','UserProfileResource','destroy','stack','name','send','index','map','VoiceContext','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','create','body','readFileSync','join','root','utf8','writeFileSync','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','/etc/asterisk/extensions_xcally_contexts.conf','server/files/templates/context.ejs','render','eml-format','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/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http'];(function(_0x37c5ac,_0x578dcd){var _0x5895ae=function(_0x38ab6b){while(--_0x38ab6b){_0x37c5ac['push'](_0x37c5ac['shift']());}};_0x5895ae(++_0x578dcd);}(_0xb21f,0x182));var _0xfb21=function(_0x4d35f3,_0x19ba66){_0x4d35f3=_0x4d35f3-0x0;var _0x382fea=_0xb21f[_0x4d35f3];return _0x382fea;};'use strict';var emlformat=require(_0xfb21('0x0'));var rimraf=require(_0xfb21('0x1'));var zipdir=require(_0xfb21('0x2'));var jsonpatch=require(_0xfb21('0x3'));var rp=require('request-promise');var moment=require(_0xfb21('0x4'));var BPromise=require(_0xfb21('0x5'));var Mustache=require('mustache');var util=require(_0xfb21('0x6'));var path=require(_0xfb21('0x7'));var sox=require(_0xfb21('0x8'));var csv=require(_0xfb21('0x9'));var ejs=require(_0xfb21('0xa'));var fs=require('fs');var fs_extra=require(_0xfb21('0xb'));var _=require('lodash');var squel=require(_0xfb21('0xc'));var crypto=require(_0xfb21('0xd'));var jsforce=require(_0xfb21('0xe'));var deskjs=require(_0xfb21('0xf'));var toCsv=require(_0xfb21('0x9'));var querystring=require('querystring');var Papa=require(_0xfb21('0x10'));var Redis=require(_0xfb21('0x11'));var authService=require(_0xfb21('0x12'));var qs=require(_0xfb21('0x13'));var as=require(_0xfb21('0x14'));var hardwareService=require(_0xfb21('0x15'));var logger=require(_0xfb21('0x16'))(_0xfb21('0x17'));var utils=require(_0xfb21('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xfb21('0x19'));var db=require(_0xfb21('0x1a'))['db'];var jayson=require(_0xfb21('0x1b'));var client=jayson[_0xfb21('0x1c')][_0xfb21('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x20ae9f,_0x44e0e8,_0x240976,_0x375639){return new BPromise(function(_0x57c7f0,_0xa8ab81){var _0x437251=_0x375639||client;return _0x437251['request'](_0x20ae9f,_0x240976)['then'](function(_0x43a02b){logger[_0xfb21('0x1e')](_0xfb21('0x1f'),_0x44e0e8,_0xfb21('0x20'));logger[_0xfb21('0x21')](_0xfb21('0x22'),_0x44e0e8,'request\x20sent',JSON[_0xfb21('0x23')](_0x43a02b));if(_0x43a02b[_0xfb21('0x24')]){if(_0x43a02b[_0xfb21('0x24')][_0xfb21('0x25')]===0x1f4){logger[_0xfb21('0x24')](_0xfb21('0x1f'),_0x44e0e8,_0x43a02b['error'][_0xfb21('0x26')]);return _0xa8ab81(_0x43a02b['error'][_0xfb21('0x26')]);}logger[_0xfb21('0x24')](_0xfb21('0x1f'),_0x44e0e8,_0x43a02b[_0xfb21('0x24')][_0xfb21('0x26')]);return _0x57c7f0(_0x43a02b[_0xfb21('0x24')][_0xfb21('0x26')]);}else{logger[_0xfb21('0x1e')]('VoiceContext,\x20%s,\x20%s',_0x44e0e8,_0xfb21('0x20'));_0x57c7f0(_0x43a02b[_0xfb21('0x27')]['message']);}})[_0xfb21('0x28')](function(_0x500c67){logger[_0xfb21('0x24')](_0xfb21('0x1f'),_0x44e0e8,_0x500c67);_0xa8ab81(_0x500c67);});});}function respondWithStatusCode(_0x46f5c3,_0xf1524e){_0xf1524e=_0xf1524e||0xcc;return function(_0x45d83f){if(_0x45d83f){return _0x46f5c3[_0xfb21('0x29')](_0xf1524e);}return _0x46f5c3[_0xfb21('0x2a')](_0xf1524e)[_0xfb21('0x2b')]();};}function respondWithResult(_0x3489da,_0x65f73a){_0x65f73a=_0x65f73a||0xc8;return function(_0x4c3c12){if(_0x4c3c12){return _0x3489da[_0xfb21('0x2a')](_0x65f73a)['json'](_0x4c3c12);}};}function respondWithFilteredResult(_0x1c2666,_0x18ea7a){return function(_0x4880c2){if(_0x4880c2){var _0x5b8dfc=typeof _0x18ea7a[_0xfb21('0x2c')]===_0xfb21('0x2d')&&typeof _0x18ea7a[_0xfb21('0x2e')]===_0xfb21('0x2d');var _0x5d6cf6=_0x4880c2[_0xfb21('0x2f')];var _0x18d541=_0x5b8dfc?0x0:_0x18ea7a[_0xfb21('0x2c')];var _0x3acdac=_0x5b8dfc?_0x4880c2['count']:_0x18ea7a[_0xfb21('0x2c')]+_0x18ea7a[_0xfb21('0x2e')];var _0x4168be;if(_0x3acdac>=_0x5d6cf6){_0x3acdac=_0x5d6cf6;_0x4168be=0xc8;}else{_0x4168be=0xce;}_0x1c2666[_0xfb21('0x2a')](_0x4168be);return _0x1c2666['set'](_0xfb21('0x30'),_0x18d541+'-'+_0x3acdac+'/'+_0x5d6cf6)[_0xfb21('0x31')](_0x4880c2);}return null;};}function patchUpdates(_0x53b1cb){return function(_0x55b140){try{jsonpatch['apply'](_0x55b140,_0x53b1cb,!![]);}catch(_0x3d2355){return BPromise[_0xfb21('0x32')](_0x3d2355);}return _0x55b140['save']();};}function saveUpdates(_0x58b781,_0x4c606b){return function(_0xc655dd){if(_0xc655dd){return _0xc655dd[_0xfb21('0x33')](_0x58b781)[_0xfb21('0x34')](function(_0x34f515){return _0x34f515;});}return null;};}function removeEntity(_0x3899c3,_0x584039){return function(_0x4d2d70){if(_0x4d2d70){return _0x4d2d70['destroy']()[_0xfb21('0x34')](function(){var _0x237f38=_0x4d2d70[_0xfb21('0x35')]({'plain':!![]});var _0x5bf83c=_0xfb21('0x36');return db[_0xfb21('0x37')][_0xfb21('0x38')]({'where':{'type':_0x5bf83c,'resourceId':_0x237f38['id']}})[_0xfb21('0x34')](function(){return _0x4d2d70;});})[_0xfb21('0x34')](function(){_0x3899c3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x8c89b4,_0x479426){return function(_0x58ce70){if(!_0x58ce70){_0x8c89b4[_0xfb21('0x29')](0x194);}return _0x58ce70;};}function handleError(_0x1011c4,_0x3688ce){_0x3688ce=_0x3688ce||0x1f4;return function(_0x35f1ba){logger[_0xfb21('0x24')](_0x35f1ba[_0xfb21('0x39')]);if(_0x35f1ba[_0xfb21('0x3a')]){delete _0x35f1ba[_0xfb21('0x3a')];}_0x1011c4['status'](_0x3688ce)[_0xfb21('0x3b')](_0x35f1ba);};}exports[_0xfb21('0x3c')]=function(_0x45a522,_0xb12f56){var _0x110292={},_0x544b3f={},_0x11d5f4={'count':0x0,'rows':[]};var _0x3d8f6c=_[_0xfb21('0x3d')](db[_0xfb21('0x3e')]['rawAttributes'],function(_0x497bce){return{'name':_0x497bce[_0xfb21('0x3f')],'type':_0x497bce[_0xfb21('0x40')]['key']};});_0x544b3f['model']=_['map'](_0x3d8f6c,'name');_0x544b3f[_0xfb21('0x41')]=_[_0xfb21('0x42')](_0x45a522[_0xfb21('0x41')]);_0x544b3f[_0xfb21('0x43')]=_[_0xfb21('0x44')](_0x544b3f[_0xfb21('0x45')],_0x544b3f[_0xfb21('0x41')]);_0x110292[_0xfb21('0x46')]=_[_0xfb21('0x44')](_0x544b3f['model'],qs['fields'](_0x45a522[_0xfb21('0x41')][_0xfb21('0x47')]));_0x110292[_0xfb21('0x46')]=_0x110292[_0xfb21('0x46')][_0xfb21('0x48')]?_0x110292[_0xfb21('0x46')]:_0x544b3f['model'];if(!_0x45a522[_0xfb21('0x41')]['hasOwnProperty']('nolimit')){_0x110292[_0xfb21('0x2e')]=qs[_0xfb21('0x2e')](_0x45a522['query'][_0xfb21('0x2e')]);_0x110292[_0xfb21('0x2c')]=qs[_0xfb21('0x2c')](_0x45a522['query'][_0xfb21('0x2c')]);}_0x110292[_0xfb21('0x49')]=qs[_0xfb21('0x4a')](_0x45a522['query'][_0xfb21('0x4a')]);_0x110292['where']=qs['filters'](_[_0xfb21('0x4b')](_0x45a522[_0xfb21('0x41')],_0x544b3f[_0xfb21('0x43')]),_0x3d8f6c);if(_0x45a522[_0xfb21('0x41')][_0xfb21('0x4c')]){_0x110292['where']=_[_0xfb21('0x4d')](_0x110292[_0xfb21('0x4e')],{'$or':_[_0xfb21('0x3d')](_0x3d8f6c,function(_0x438d66){if(_0x438d66[_0xfb21('0x40')]!==_0xfb21('0x4f')){var _0x38d10d={};_0x38d10d[_0x438d66['name']]={'$like':'%'+_0x45a522[_0xfb21('0x41')][_0xfb21('0x4c')]+'%'};return _0x38d10d;}})});}_0x110292=_['merge']({},_0x110292,_0x45a522[_0xfb21('0x50')]);var _0x227ffa={'where':_0x110292[_0xfb21('0x4e')]};return db[_0xfb21('0x3e')][_0xfb21('0x2f')](_0x227ffa)['then'](function(_0x16377b){_0x11d5f4[_0xfb21('0x2f')]=_0x16377b;if(_0x45a522[_0xfb21('0x41')][_0xfb21('0x51')]){_0x110292[_0xfb21('0x52')]=[{'all':!![]}];}return db['VoiceContext'][_0xfb21('0x53')](_0x110292);})[_0xfb21('0x34')](function(_0x38fed7){_0x11d5f4[_0xfb21('0x54')]=_0x38fed7;return _0x11d5f4;})[_0xfb21('0x34')](respondWithFilteredResult(_0xb12f56,_0x110292))[_0xfb21('0x28')](handleError(_0xb12f56,null));};exports[_0xfb21('0x55')]=function(_0x18b1ce,_0x17680f){var _0xbc86dd={'raw':![],'where':{'id':_0x18b1ce[_0xfb21('0x56')]['id']}},_0x1ff5f4={};_0x1ff5f4['model']=_[_0xfb21('0x42')](db[_0xfb21('0x3e')][_0xfb21('0x57')]);_0x1ff5f4[_0xfb21('0x41')]=_[_0xfb21('0x42')](_0x18b1ce['query']);_0x1ff5f4[_0xfb21('0x43')]=_[_0xfb21('0x44')](_0x1ff5f4[_0xfb21('0x45')],_0x1ff5f4[_0xfb21('0x41')]);_0xbc86dd[_0xfb21('0x46')]=_[_0xfb21('0x44')](_0x1ff5f4[_0xfb21('0x45')],qs['fields'](_0x18b1ce[_0xfb21('0x41')]['fields']));_0xbc86dd[_0xfb21('0x46')]=_0xbc86dd[_0xfb21('0x46')][_0xfb21('0x48')]?_0xbc86dd[_0xfb21('0x46')]:_0x1ff5f4[_0xfb21('0x45')];if(_0x18b1ce[_0xfb21('0x41')]['includeAll']){_0xbc86dd['include']=[{'all':!![]}];}_0xbc86dd=_[_0xfb21('0x4d')]({},_0xbc86dd,_0x18b1ce[_0xfb21('0x50')]);return db[_0xfb21('0x3e')][_0xfb21('0x58')](_0xbc86dd)[_0xfb21('0x34')](handleEntityNotFound(_0x17680f,null))['then'](respondWithResult(_0x17680f,null))['catch'](handleError(_0x17680f,null));};exports[_0xfb21('0x59')]=function(_0xf73ae3,_0x4913b6,_0x10d6b3){var _0x106c33;return db[_0xfb21('0x3e')][_0xfb21('0x59')](_0xf73ae3[_0xfb21('0x5a')],{'raw':!![]})['then'](function(_0x81ac7){_0x106c33=_0x81ac7;return db[_0xfb21('0x3e')][_0xfb21('0x53')]({'raw':!![]});})[_0xfb21('0x34')](function(_0x4664cb){var _0x5ec2c8=fs[_0xfb21('0x5b')](path[_0xfb21('0x5c')](config[_0xfb21('0x5d')],'server/files/templates/context.ejs'),_0xfb21('0x5e'));var _0x383312=ejs['render'](_0x5ec2c8,{'contexts':_0x4664cb||[]});fs[_0xfb21('0x5f')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x383312);})[_0xfb21('0x34')](function(){return respondWithRpcPromise(_0xfb21('0x60'),_0xfb21('0x59'),{'module':_0xfb21('0x61')});})[_0xfb21('0x34')](function(){var _0x58fa06=_0xf73ae3[_0xfb21('0x62')][_0xfb21('0x35')]({'plain':!![]});if(!_0x58fa06)throw new Error(_0xfb21('0x63'));if(_0x58fa06['role']==='user'){var _0x517252=_0x106c33['get']({'plain':!![]});return db[_0xfb21('0x64')]['find']({'where':{'name':_0xfb21('0x36'),'userProfileId':_0x58fa06['userProfileId']},'raw':!![]})['then'](function(_0x557cbc){if(_0x557cbc&&_0x557cbc['autoAssociation']===0x0){return db[_0xfb21('0x37')][_0xfb21('0x59')]({'name':_0x517252[_0xfb21('0x3a')],'resourceId':_0x517252['id'],'type':_0x557cbc[_0xfb21('0x3a')],'sectionId':_0x557cbc['id']},{})[_0xfb21('0x34')](function(){return _0x106c33;});}else{return _0x106c33;}})[_0xfb21('0x28')](function(_0x3d7d36){logger[_0xfb21('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3d7d36);throw _0x3d7d36;});}return _0x106c33;})['then'](respondWithResult(_0x4913b6,0xc9))[_0xfb21('0x28')](handleError(_0x4913b6,null));};exports['update']=function(_0x500103,_0x43fb57,_0x162084){var _0x410f4a;return db[_0xfb21('0x3e')][_0xfb21('0x58')]({'where':{'id':_0x500103['params']['id']}})[_0xfb21('0x34')](handleEntityNotFound(_0x43fb57,null))[_0xfb21('0x34')](saveUpdates(_0x500103['body'],null))[_0xfb21('0x34')](function(_0x42bc7f){if(_0x42bc7f){_0x410f4a=_0x42bc7f;return db['VoiceContext']['findAll']({'raw':!![]});}})['then'](function(_0x3858be){var _0x24f29c=fs[_0xfb21('0x5b')](path['join'](config[_0xfb21('0x5d')],'server/files/templates/context.ejs'),_0xfb21('0x5e'));var _0xd15036=ejs['render'](_0x24f29c,{'contexts':_0x3858be||[]});fs[_0xfb21('0x5f')](_0xfb21('0x65'),_0xd15036);})[_0xfb21('0x34')](function(){return respondWithRpcPromise(_0xfb21('0x60'),_0xfb21('0x33'),{'module':_0xfb21('0x61')});})['then'](function(){return _0x410f4a;})[_0xfb21('0x34')](respondWithResult(_0x43fb57,null))['catch'](handleError(_0x43fb57,null));};exports[_0xfb21('0x38')]=function(_0x3f501b,_0xab394a,_0xc4fb7e){var _0x3939a9;return db[_0xfb21('0x3e')][_0xfb21('0x58')]({'where':{'id':_0x3f501b[_0xfb21('0x56')]['id']}})[_0xfb21('0x34')](handleEntityNotFound(_0xab394a,null))['then'](removeEntity(_0xab394a,null))[_0xfb21('0x34')](function(){return db['VoiceContext'][_0xfb21('0x53')]({'raw':!![]});})['then'](function(_0x40065a){var _0x16708f=fs[_0xfb21('0x5b')](path[_0xfb21('0x5c')](config[_0xfb21('0x5d')],_0xfb21('0x66')),_0xfb21('0x5e'));var _0x5b1902=ejs[_0xfb21('0x67')](_0x16708f,{'contexts':_0x40065a});fs['writeFileSync'](_0xfb21('0x65'),_0x5b1902);return respondWithRpcPromise(_0xfb21('0x60'),'destroy',{'module':_0xfb21('0x61')});})['catch'](handleError(_0xab394a,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index c4d24f6..2e35043 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 _0x73b1=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','VoiceContext','voice_contexts'];(function(_0x48f034,_0x80194c){var _0x1b9cec=function(_0x3c61e6){while(--_0x3c61e6){_0x48f034['push'](_0x48f034['shift']());}};_0x1b9cec(++_0x80194c);}(_0x73b1,0x160));var _0x173b=function(_0x5053fa,_0x4b445f){_0x5053fa=_0x5053fa-0x0;var _0x2147d4=_0x73b1[_0x5053fa];return _0x2147d4;};'use strict';var _=require('lodash');var util=require(_0x173b('0x0'));var logger=require(_0x173b('0x1'))(_0x173b('0x2'));var moment=require(_0x173b('0x3'));var BPromise=require(_0x173b('0x4'));var rp=require(_0x173b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x173b('0x6'));var config=require(_0x173b('0x7'));var attributes=require('./voiceContext.attributes');module[_0x173b('0x8')]=function(_0x491e42,_0x323671){return _0x491e42['define'](_0x173b('0x9'),attributes,{'tableName':_0x173b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb2f3=['rimraf','../../config/environment','./voiceContext.attributes','exports','define','voice_contexts','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2f8530,_0x5cbd67){var _0x5e814e=function(_0x490b29){while(--_0x490b29){_0x2f8530['push'](_0x2f8530['shift']());}};_0x5e814e(++_0x5cbd67);}(_0xb2f3,0xfd));var _0x3b2f=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0xb2f3[_0x1589dd];return _0x1bddd1;};'use strict';var _=require(_0x3b2f('0x0'));var util=require(_0x3b2f('0x1'));var logger=require(_0x3b2f('0x2'))(_0x3b2f('0x3'));var moment=require(_0x3b2f('0x4'));var BPromise=require(_0x3b2f('0x5'));var rp=require(_0x3b2f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3b2f('0x7'));var config=require(_0x3b2f('0x8'));var attributes=require(_0x3b2f('0x9'));module[_0x3b2f('0xa')]=function(_0x1879cf,_0xa38042){return _0x1879cf[_0x3b2f('0xb')]('VoiceContext',attributes,{'tableName':_0x3b2f('0xc'),'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 4d93be3..1bf4907 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 _0x9563=['message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x9563,0x1e7));var _0x3956=function(_0x102dd8,_0x679f5c){_0x102dd8=_0x102dd8-0x0;var _0x9b3e20=_0x9563[_0x102dd8];return _0x9b3e20;};'use strict';var _=require(_0x3956('0x0'));var util=require(_0x3956('0x1'));var moment=require('moment');var BPromise=require(_0x3956('0x2'));var rs=require(_0x3956('0x3'));var fs=require('fs');var Redis=require(_0x3956('0x4'));var db=require(_0x3956('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3956('0x6'));var config=require('../../config/environment');var jayson=require(_0x3956('0x7'));var client=jayson[_0x3956('0x8')][_0x3956('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xba3e4b,_0x47bdbc,_0x234e06){return new BPromise(function(_0xf1e100,_0x2863cd){return client[_0x3956('0xa')](_0xba3e4b,_0x234e06)[_0x3956('0xb')](function(_0x4dd27f){logger['info'](_0x3956('0xc'),_0x47bdbc,_0x3956('0xd'));logger[_0x3956('0xe')](_0x3956('0xf'),_0x47bdbc,'request\x20sent',JSON[_0x3956('0x10')](_0x4dd27f));if(_0x4dd27f[_0x3956('0x11')]){if(_0x4dd27f[_0x3956('0x11')][_0x3956('0x12')]===0x1f4){logger[_0x3956('0x11')](_0x3956('0xc'),_0x47bdbc,_0x4dd27f[_0x3956('0x11')][_0x3956('0x13')]);return _0x2863cd(_0x4dd27f[_0x3956('0x11')]['message']);}logger['error']('VoiceContext,\x20%s,\x20%s',_0x47bdbc,_0x4dd27f[_0x3956('0x11')][_0x3956('0x13')]);return _0xf1e100(_0x4dd27f['error'][_0x3956('0x13')]);}else{logger[_0x3956('0x14')](_0x3956('0xc'),_0x47bdbc,_0x3956('0xd'));_0xf1e100(_0x4dd27f[_0x3956('0x15')][_0x3956('0x13')]);}})[_0x3956('0x16')](function(_0x458b4a){logger[_0x3956('0x11')](_0x3956('0xc'),_0x47bdbc,_0x458b4a);_0x2863cd(_0x458b4a);});});} \ No newline at end of file +var _0x8185=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','result','catch'];(function(_0x1e8aa5,_0x2e2902){var _0x5f0af9=function(_0x4b3b43){while(--_0x4b3b43){_0x1e8aa5['push'](_0x1e8aa5['shift']());}};_0x5f0af9(++_0x2e2902);}(_0x8185,0xb8));var _0x5818=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x8185[_0x1694f5];return _0x5b4321;};'use strict';var _=require(_0x5818('0x0'));var util=require(_0x5818('0x1'));var moment=require(_0x5818('0x2'));var BPromise=require('bluebird');var rs=require(_0x5818('0x3'));var fs=require('fs');var Redis=require(_0x5818('0x4'));var db=require(_0x5818('0x5'))['db'];var utils=require(_0x5818('0x6'));var logger=require(_0x5818('0x7'))('rpc');var config=require(_0x5818('0x8'));var jayson=require(_0x5818('0x9'));var client=jayson[_0x5818('0xa')][_0x5818('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x412c57,_0x3fe728,_0x1e011e){return new BPromise(function(_0x9201ee,_0x115c1a){return client[_0x5818('0xc')](_0x412c57,_0x1e011e)['then'](function(_0xa55dee){logger[_0x5818('0xd')]('VoiceContext,\x20%s,\x20%s',_0x3fe728,_0x5818('0xe'));logger[_0x5818('0xf')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x3fe728,'request\x20sent',JSON[_0x5818('0x10')](_0xa55dee));if(_0xa55dee[_0x5818('0x11')]){if(_0xa55dee['error'][_0x5818('0x12')]===0x1f4){logger[_0x5818('0x11')](_0x5818('0x13'),_0x3fe728,_0xa55dee['error'][_0x5818('0x14')]);return _0x115c1a(_0xa55dee[_0x5818('0x11')][_0x5818('0x14')]);}logger[_0x5818('0x11')](_0x5818('0x13'),_0x3fe728,_0xa55dee['error'][_0x5818('0x14')]);return _0x9201ee(_0xa55dee[_0x5818('0x11')][_0x5818('0x14')]);}else{logger[_0x5818('0xd')](_0x5818('0x13'),_0x3fe728,_0x5818('0xe'));_0x9201ee(_0xa55dee[_0x5818('0x15')]['message']);}})[_0x5818('0x16')](function(_0x556345){logger['error'](_0x5818('0x13'),_0x3fe728,_0x556345);_0x115c1a(_0x556345);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index b3bade0..2c9bd3c 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 _0x5bc5=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x5a92a2,_0x258978){var _0x47cf0c=function(_0x5d0c43){while(--_0x5d0c43){_0x5a92a2['push'](_0x5a92a2['shift']());}};_0x47cf0c(++_0x258978);}(_0x5bc5,0xb2));var _0x55bc=function(_0x146837,_0x2aa6a2){_0x146837=_0x146837-0x0;var _0x3d7e60=_0x5bc5[_0x146837];return _0x3d7e60;};'use strict';var multer=require(_0x55bc('0x0'));var util=require(_0x55bc('0x1'));var path=require(_0x55bc('0x2'));var timeout=require(_0x55bc('0x3'));var express=require(_0x55bc('0x4'));var router=express[_0x55bc('0x5')]();var fs_extra=require(_0x55bc('0x6'));var auth=require(_0x55bc('0x7'));var interaction=require(_0x55bc('0x8'));var config=require(_0x55bc('0x9'));var controller=require(_0x55bc('0xa'));router[_0x55bc('0xb')]('/',auth[_0x55bc('0xc')](),controller['index']);router[_0x55bc('0xb')](_0x55bc('0xd'),auth[_0x55bc('0xc')](),controller[_0x55bc('0xe')]);router['get'](_0x55bc('0xf'),auth[_0x55bc('0xc')](),controller[_0x55bc('0x10')]);router[_0x55bc('0x11')]('/',auth[_0x55bc('0xc')](),controller[_0x55bc('0x12')]);router[_0x55bc('0x13')](_0x55bc('0xf'),auth['isAuthenticated'](),controller[_0x55bc('0x14')]);router[_0x55bc('0x15')](_0x55bc('0xf'),auth['isAuthenticated'](),controller[_0x55bc('0x16')]);module['exports']=router; \ No newline at end of file +var _0x16bf=['describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','index','/describe','isAuthenticated'];(function(_0x49fb1c,_0x113891){var _0x36cc02=function(_0x308d72){while(--_0x308d72){_0x49fb1c['push'](_0x49fb1c['shift']());}};_0x36cc02(++_0x113891);}(_0x16bf,0x1be));var _0xf16b=function(_0x5ab045,_0x189773){_0x5ab045=_0x5ab045-0x0;var _0x3b67b4=_0x16bf[_0x5ab045];return _0x3b67b4;};'use strict';var multer=require(_0xf16b('0x0'));var util=require(_0xf16b('0x1'));var path=require(_0xf16b('0x2'));var timeout=require(_0xf16b('0x3'));var express=require(_0xf16b('0x4'));var router=express[_0xf16b('0x5')]();var fs_extra=require(_0xf16b('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf16b('0x7'));var config=require(_0xf16b('0x8'));var controller=require(_0xf16b('0x9'));router[_0xf16b('0xa')]('/',auth['isAuthenticated'](),controller[_0xf16b('0xb')]);router['get'](_0xf16b('0xc'),auth[_0xf16b('0xd')](),controller[_0xf16b('0xe')]);router[_0xf16b('0xa')](_0xf16b('0xf'),auth[_0xf16b('0xd')](),controller['show']);router[_0xf16b('0x10')]('/',auth[_0xf16b('0xd')](),controller[_0xf16b('0x11')]);router[_0xf16b('0x12')](_0xf16b('0xf'),auth[_0xf16b('0xd')](),controller[_0xf16b('0x13')]);router[_0xf16b('0x14')](_0xf16b('0xf'),auth[_0xf16b('0xd')](),controller[_0xf16b('0x15')]);module[_0xf16b('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 5a5798f..cca4ead 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 _0xb821=['DATE','called,connect,complete','exports','STRING','INTEGER'];(function(_0x280e11,_0x136cd0){var _0x1211a6=function(_0x2b4413){while(--_0x2b4413){_0x280e11['push'](_0x280e11['shift']());}};_0x1211a6(++_0x136cd0);}(_0xb821,0xa7));var _0x1b82=function(_0x3f9084,_0x399d36){_0x3f9084=_0x3f9084-0x0;var _0x5b9541=_0xb821[_0x3f9084];return _0x5b9541;};'use strict';var Sequelize=require('sequelize');module[_0x1b82('0x0')]={'privilege':{'type':Sequelize[_0x1b82('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x1b82('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x1b82('0x1')]},'connectedlinename':{'type':Sequelize[_0x1b82('0x1')]},'language':{'type':Sequelize[_0x1b82('0x1')]},'accountcode':{'type':Sequelize[_0x1b82('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x1b82('0x1')]},'priority':{'type':Sequelize[_0x1b82('0x2')]},'uniqueid':{'type':Sequelize[_0x1b82('0x1')]},'linkedid':{'type':Sequelize[_0x1b82('0x1')]},'destchannel':{'type':Sequelize[_0x1b82('0x1')]},'destchannelstate':{'type':Sequelize[_0x1b82('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x1b82('0x1')]},'destcalleridnum':{'type':Sequelize[_0x1b82('0x1')]},'destcalleridname':{'type':Sequelize[_0x1b82('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x1b82('0x1')]},'destlanguage':{'type':Sequelize[_0x1b82('0x1')]},'destaccountcode':{'type':Sequelize[_0x1b82('0x1')]},'destcontext':{'type':Sequelize[_0x1b82('0x1')]},'destexten':{'type':Sequelize[_0x1b82('0x1')]},'destpriority':{'type':Sequelize[_0x1b82('0x2')]},'destuniqueid':{'type':Sequelize[_0x1b82('0x1')]},'destlinkedid':{'type':Sequelize[_0x1b82('0x1')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x1b82('0x1')]},'starttime':{'type':Sequelize[_0x1b82('0x3')]},'answertime':{'type':Sequelize[_0x1b82('0x3')]},'endtime':{'type':Sequelize[_0x1b82('0x3')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0x1b82('0x4')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0x1b82('0x2')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xf3cd=['exports','STRING','INTEGER','DATE','sequelize'];(function(_0x25e56c,_0x3430d3){var _0x37a949=function(_0x1f691c){while(--_0x1f691c){_0x25e56c['push'](_0x25e56c['shift']());}};_0x37a949(++_0x3430d3);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x58cbde,_0x4b0f62){_0x58cbde=_0x58cbde-0x0;var _0x5799f3=_0xf3cd[_0x58cbde];return _0x5799f3;};'use strict';var Sequelize=require(_0xdf3c('0x0'));module[_0xdf3c('0x1')]={'privilege':{'type':Sequelize[_0xdf3c('0x2')]},'channel':{'type':Sequelize[_0xdf3c('0x2')]},'channelstate':{'type':Sequelize[_0xdf3c('0x3')]},'channelstatedesc':{'type':Sequelize[_0xdf3c('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xdf3c('0x2')]},'connectedlinenum':{'type':Sequelize[_0xdf3c('0x2')]},'connectedlinename':{'type':Sequelize[_0xdf3c('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xdf3c('0x2')]},'context':{'type':Sequelize[_0xdf3c('0x2')]},'exten':{'type':Sequelize[_0xdf3c('0x2')]},'priority':{'type':Sequelize[_0xdf3c('0x3')]},'uniqueid':{'type':Sequelize[_0xdf3c('0x2')]},'linkedid':{'type':Sequelize[_0xdf3c('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xdf3c('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xdf3c('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xdf3c('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xdf3c('0x2')]},'destaccountcode':{'type':Sequelize[_0xdf3c('0x2')]},'destcontext':{'type':Sequelize[_0xdf3c('0x2')]},'destexten':{'type':Sequelize[_0xdf3c('0x2')]},'destpriority':{'type':Sequelize[_0xdf3c('0x3')]},'destuniqueid':{'type':Sequelize[_0xdf3c('0x2')]},'destlinkedid':{'type':Sequelize[_0xdf3c('0x2')]},'dialstring':{'type':Sequelize[_0xdf3c('0x2')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xdf3c('0x4')]},'answertime':{'type':Sequelize[_0xdf3c('0x4')]},'endtime':{'type':Sequelize[_0xdf3c('0x4')]},'lastevent':{'type':Sequelize[_0xdf3c('0x2')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0xdf3c('0x3')]},'duration':{'type':Sequelize[_0xdf3c('0x3')]},'holdtime':{'type':Sequelize[_0xdf3c('0x3')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 36160d9..2837d69 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 _0x6cb3=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','type','key','keys','query','filters','model','attributes','intersection','fields','nolimit','limit','order','sort','pick','filter','merge','where','VIRTUAL','include','findAll','rows','catch','show','params','options','find','create','body','eml-format','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0x5abf83,_0x23c39c){var _0x2effe2=function(_0x3a0ef3){while(--_0x3a0ef3){_0x5abf83['push'](_0x5abf83['shift']());}};_0x2effe2(++_0x23c39c);}(_0x6cb3,0x121));var _0x36cb=function(_0x4ae8bd,_0x2c4fd5){_0x4ae8bd=_0x4ae8bd-0x0;var _0x1b56d5=_0x6cb3[_0x4ae8bd];return _0x1b56d5;};'use strict';var emlformat=require(_0x36cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x36cb('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x36cb('0x2'));var moment=require(_0x36cb('0x3'));var BPromise=require(_0x36cb('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x36cb('0x5'));var sox=require(_0x36cb('0x6'));var csv=require(_0x36cb('0x7'));var ejs=require(_0x36cb('0x8'));var fs=require('fs');var fs_extra=require(_0x36cb('0x9'));var _=require(_0x36cb('0xa'));var squel=require(_0x36cb('0xb'));var crypto=require(_0x36cb('0xc'));var jsforce=require(_0x36cb('0xd'));var deskjs=require(_0x36cb('0xe'));var toCsv=require(_0x36cb('0x7'));var querystring=require(_0x36cb('0xf'));var Papa=require(_0x36cb('0x10'));var Redis=require('ioredis');var authService=require(_0x36cb('0x11'));var qs=require(_0x36cb('0x12'));var as=require(_0x36cb('0x13'));var hardwareService=require(_0x36cb('0x14'));var logger=require(_0x36cb('0x15'))(_0x36cb('0x16'));var utils=require(_0x36cb('0x17'));var config=require(_0x36cb('0x18'));var licenseUtil=require(_0x36cb('0x19'));var db=require(_0x36cb('0x1a'))['db'];function respondWithStatusCode(_0x1c91a8,_0x1f9046){_0x1f9046=_0x1f9046||0xcc;return function(_0x282818){if(_0x282818){return _0x1c91a8[_0x36cb('0x1b')](_0x1f9046);}return _0x1c91a8[_0x36cb('0x1c')](_0x1f9046)[_0x36cb('0x1d')]();};}function respondWithResult(_0x4a1b6b,_0x53569d){_0x53569d=_0x53569d||0xc8;return function(_0x431d09){if(_0x431d09){return _0x4a1b6b[_0x36cb('0x1c')](_0x53569d)['json'](_0x431d09);}};}function respondWithFilteredResult(_0x3457fd,_0x22baee){return function(_0x2b6cdd){if(_0x2b6cdd){var _0x40ded2=typeof _0x22baee[_0x36cb('0x1e')]===_0x36cb('0x1f')&&typeof _0x22baee['limit']===_0x36cb('0x1f');var _0x2e6907=_0x2b6cdd['count'];var _0xb65f90=_0x40ded2?0x0:_0x22baee[_0x36cb('0x1e')];var _0x3141b4=_0x40ded2?_0x2b6cdd[_0x36cb('0x20')]:_0x22baee[_0x36cb('0x1e')]+_0x22baee['limit'];var _0x21de86;if(_0x3141b4>=_0x2e6907){_0x3141b4=_0x2e6907;_0x21de86=0xc8;}else{_0x21de86=0xce;}_0x3457fd['status'](_0x21de86);return _0x3457fd['set'](_0x36cb('0x21'),_0xb65f90+'-'+_0x3141b4+'/'+_0x2e6907)[_0x36cb('0x22')](_0x2b6cdd);}return null;};}function patchUpdates(_0x2f362e){return function(_0x4f84b8){try{jsonpatch[_0x36cb('0x23')](_0x4f84b8,_0x2f362e,!![]);}catch(_0x34ec01){return BPromise['reject'](_0x34ec01);}return _0x4f84b8[_0x36cb('0x24')]();};}function saveUpdates(_0x22a2a7,_0x175544){return function(_0x368cba){if(_0x368cba){return _0x368cba[_0x36cb('0x25')](_0x22a2a7)[_0x36cb('0x26')](function(_0x3f7a57){return _0x3f7a57;});}return null;};}function removeEntity(_0x2cd041,_0xeb5fd8){return function(_0x290ab9){if(_0x290ab9){return _0x290ab9[_0x36cb('0x27')]()[_0x36cb('0x26')](function(){_0x2cd041[_0x36cb('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d53fc,_0x38a8d3){return function(_0x1e0fb0){if(!_0x1e0fb0){_0x5d53fc['sendStatus'](0x194);}return _0x1e0fb0;};}function handleError(_0xf5fc33,_0x4371c2){_0x4371c2=_0x4371c2||0x1f4;return function(_0x3b1075){logger[_0x36cb('0x28')](_0x3b1075[_0x36cb('0x29')]);if(_0x3b1075['name']){delete _0x3b1075[_0x36cb('0x2a')];}_0xf5fc33[_0x36cb('0x1c')](_0x4371c2)[_0x36cb('0x2b')](_0x3b1075);};}exports[_0x36cb('0x2c')]=function(_0xe2a8f6,_0x263bd0){var _0x375313={},_0x230f83={},_0x27445f={'count':0x0,'rows':[]};var _0x518903=_[_0x36cb('0x2d')](db[_0x36cb('0x2e')][_0x36cb('0x2f')],function(_0xf5758f){return{'name':_0xf5758f[_0x36cb('0x30')],'type':_0xf5758f[_0x36cb('0x31')][_0x36cb('0x32')]};});_0x230f83['model']=_[_0x36cb('0x2d')](_0x518903,'name');_0x230f83['query']=_[_0x36cb('0x33')](_0xe2a8f6[_0x36cb('0x34')]);_0x230f83[_0x36cb('0x35')]=_['intersection'](_0x230f83[_0x36cb('0x36')],_0x230f83[_0x36cb('0x34')]);_0x375313[_0x36cb('0x37')]=_[_0x36cb('0x38')](_0x230f83[_0x36cb('0x36')],qs['fields'](_0xe2a8f6[_0x36cb('0x34')][_0x36cb('0x39')]));_0x375313[_0x36cb('0x37')]=_0x375313[_0x36cb('0x37')]['length']?_0x375313[_0x36cb('0x37')]:_0x230f83[_0x36cb('0x36')];if(!_0xe2a8f6['query']['hasOwnProperty'](_0x36cb('0x3a'))){_0x375313[_0x36cb('0x3b')]=qs[_0x36cb('0x3b')](_0xe2a8f6[_0x36cb('0x34')]['limit']);_0x375313[_0x36cb('0x1e')]=qs['offset'](_0xe2a8f6[_0x36cb('0x34')]['offset']);}_0x375313[_0x36cb('0x3c')]=qs['sort'](_0xe2a8f6['query'][_0x36cb('0x3d')]);_0x375313['where']=qs[_0x36cb('0x35')](_[_0x36cb('0x3e')](_0xe2a8f6[_0x36cb('0x34')],_0x230f83[_0x36cb('0x35')]),_0x518903);if(_0xe2a8f6[_0x36cb('0x34')][_0x36cb('0x3f')]){_0x375313['where']=_[_0x36cb('0x40')](_0x375313[_0x36cb('0x41')],{'$or':_[_0x36cb('0x2d')](_0x518903,function(_0x3f94cd){if(_0x3f94cd['type']!==_0x36cb('0x42')){var _0x106ffd={};_0x106ffd[_0x3f94cd[_0x36cb('0x2a')]]={'$like':'%'+_0xe2a8f6[_0x36cb('0x34')][_0x36cb('0x3f')]+'%'};return _0x106ffd;}})});}_0x375313=_['merge']({},_0x375313,_0xe2a8f6['options']);var _0x533615={'where':_0x375313[_0x36cb('0x41')]};return db[_0x36cb('0x2e')][_0x36cb('0x20')](_0x533615)[_0x36cb('0x26')](function(_0x1926a6){_0x27445f[_0x36cb('0x20')]=_0x1926a6;if(_0xe2a8f6[_0x36cb('0x34')]['includeAll']){_0x375313[_0x36cb('0x43')]=[{'all':!![]}];}return db[_0x36cb('0x2e')][_0x36cb('0x44')](_0x375313);})[_0x36cb('0x26')](function(_0x195f28){_0x27445f[_0x36cb('0x45')]=_0x195f28;return _0x27445f;})[_0x36cb('0x26')](respondWithFilteredResult(_0x263bd0,_0x375313))[_0x36cb('0x46')](handleError(_0x263bd0,null));};exports[_0x36cb('0x47')]=function(_0x546c2b,_0x32e30d){var _0x17ac57={'raw':!![],'where':{'id':_0x546c2b[_0x36cb('0x48')]['id']}},_0xc934c1={};_0xc934c1[_0x36cb('0x36')]=_[_0x36cb('0x33')](db[_0x36cb('0x2e')][_0x36cb('0x2f')]);_0xc934c1[_0x36cb('0x34')]=_[_0x36cb('0x33')](_0x546c2b[_0x36cb('0x34')]);_0xc934c1[_0x36cb('0x35')]=_[_0x36cb('0x38')](_0xc934c1[_0x36cb('0x36')],_0xc934c1[_0x36cb('0x34')]);_0x17ac57[_0x36cb('0x37')]=_[_0x36cb('0x38')](_0xc934c1[_0x36cb('0x36')],qs[_0x36cb('0x39')](_0x546c2b[_0x36cb('0x34')][_0x36cb('0x39')]));_0x17ac57[_0x36cb('0x37')]=_0x17ac57[_0x36cb('0x37')]['length']?_0x17ac57[_0x36cb('0x37')]:_0xc934c1[_0x36cb('0x36')];if(_0x546c2b[_0x36cb('0x34')]['includeAll']){_0x17ac57[_0x36cb('0x43')]=[{'all':!![]}];}_0x17ac57=_['merge']({},_0x17ac57,_0x546c2b[_0x36cb('0x49')]);return db[_0x36cb('0x2e')][_0x36cb('0x4a')](_0x17ac57)[_0x36cb('0x26')](handleEntityNotFound(_0x32e30d,null))['then'](respondWithResult(_0x32e30d,null))[_0x36cb('0x46')](handleError(_0x32e30d,null));};exports[_0x36cb('0x4b')]=function(_0x23bd33,_0x344458){return db[_0x36cb('0x2e')][_0x36cb('0x4b')](_0x23bd33[_0x36cb('0x4c')],{})[_0x36cb('0x26')](respondWithResult(_0x344458,0xc9))[_0x36cb('0x46')](handleError(_0x344458,null));};exports[_0x36cb('0x25')]=function(_0x496a88,_0x28184c){if(_0x496a88[_0x36cb('0x4c')]['id']){delete _0x496a88[_0x36cb('0x4c')]['id'];}return db[_0x36cb('0x2e')]['find']({'where':{'id':_0x496a88['params']['id']}})[_0x36cb('0x26')](handleEntityNotFound(_0x28184c,null))[_0x36cb('0x26')](saveUpdates(_0x496a88[_0x36cb('0x4c')],null))[_0x36cb('0x26')](respondWithResult(_0x28184c,null))['catch'](handleError(_0x28184c,null));};exports[_0x36cb('0x27')]=function(_0x3969f3,_0x6a1632){return db[_0x36cb('0x2e')][_0x36cb('0x4a')]({'where':{'id':_0x3969f3[_0x36cb('0x48')]['id']}})[_0x36cb('0x26')](handleEntityNotFound(_0x6a1632,null))[_0x36cb('0x26')](removeEntity(_0x6a1632,null))[_0x36cb('0x46')](handleError(_0x6a1632,null));};exports['describe']=function(_0x29148a,_0x2cf8b6){return db[_0x36cb('0x2e')]['describe']()[_0x36cb('0x26')](respondWithResult(_0x2cf8b6,null))[_0x36cb('0x46')](handleError(_0x2cf8b6,null));}; \ No newline at end of file +var _0xae89=['include','findAll','catch','show','params','keys','find','create','body','update','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','end','stack','send','index','VoiceDialReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','name','options','includeAll'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xae89,0x1c7));var _0x9ae8=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xae89[_0x2d8fc2];return _0x3a9e53;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9ae8('0x0'));var zipdir=require(_0x9ae8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9ae8('0x2'));var moment=require(_0x9ae8('0x3'));var BPromise=require(_0x9ae8('0x4'));var Mustache=require(_0x9ae8('0x5'));var util=require(_0x9ae8('0x6'));var path=require(_0x9ae8('0x7'));var sox=require(_0x9ae8('0x8'));var csv=require(_0x9ae8('0x9'));var ejs=require(_0x9ae8('0xa'));var fs=require('fs');var fs_extra=require(_0x9ae8('0xb'));var _=require(_0x9ae8('0xc'));var squel=require('squel');var crypto=require(_0x9ae8('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9ae8('0xe'));var toCsv=require(_0x9ae8('0x9'));var querystring=require('querystring');var Papa=require(_0x9ae8('0xf'));var Redis=require('ioredis');var authService=require(_0x9ae8('0x10'));var qs=require(_0x9ae8('0x11'));var as=require(_0x9ae8('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9ae8('0x13'))(_0x9ae8('0x14'));var utils=require(_0x9ae8('0x15'));var config=require(_0x9ae8('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x9ae8('0x17'))['db'];function respondWithStatusCode(_0x4c9f3f,_0x53c9f0){_0x53c9f0=_0x53c9f0||0xcc;return function(_0xfa29df){if(_0xfa29df){return _0x4c9f3f[_0x9ae8('0x18')](_0x53c9f0);}return _0x4c9f3f[_0x9ae8('0x19')](_0x53c9f0)['end']();};}function respondWithResult(_0x19b091,_0x4be8cc){_0x4be8cc=_0x4be8cc||0xc8;return function(_0x172d2e){if(_0x172d2e){return _0x19b091[_0x9ae8('0x19')](_0x4be8cc)[_0x9ae8('0x1a')](_0x172d2e);}};}function respondWithFilteredResult(_0x4a2197,_0x3caab9){return function(_0x429cf2){if(_0x429cf2){var _0x47d385=typeof _0x3caab9[_0x9ae8('0x1b')]===_0x9ae8('0x1c')&&typeof _0x3caab9[_0x9ae8('0x1d')]===_0x9ae8('0x1c');var _0x4415fe=_0x429cf2[_0x9ae8('0x1e')];var _0x38f65e=_0x47d385?0x0:_0x3caab9[_0x9ae8('0x1b')];var _0x4c398b=_0x47d385?_0x429cf2[_0x9ae8('0x1e')]:_0x3caab9[_0x9ae8('0x1b')]+_0x3caab9[_0x9ae8('0x1d')];var _0x5bf058;if(_0x4c398b>=_0x4415fe){_0x4c398b=_0x4415fe;_0x5bf058=0xc8;}else{_0x5bf058=0xce;}_0x4a2197[_0x9ae8('0x19')](_0x5bf058);return _0x4a2197[_0x9ae8('0x1f')](_0x9ae8('0x20'),_0x38f65e+'-'+_0x4c398b+'/'+_0x4415fe)[_0x9ae8('0x1a')](_0x429cf2);}return null;};}function patchUpdates(_0xbfb266){return function(_0x3dbe69){try{jsonpatch['apply'](_0x3dbe69,_0xbfb266,!![]);}catch(_0x59b02b){return BPromise[_0x9ae8('0x21')](_0x59b02b);}return _0x3dbe69[_0x9ae8('0x22')]();};}function saveUpdates(_0xf94a16,_0x4e8b61){return function(_0x19e8cc){if(_0x19e8cc){return _0x19e8cc['update'](_0xf94a16)[_0x9ae8('0x23')](function(_0x3593d8){return _0x3593d8;});}return null;};}function removeEntity(_0x6ffb20,_0x451b53){return function(_0x416640){if(_0x416640){return _0x416640[_0x9ae8('0x24')]()[_0x9ae8('0x23')](function(){_0x6ffb20['status'](0xcc)[_0x9ae8('0x25')]();});}};}function handleEntityNotFound(_0x7d4b7b,_0x140645){return function(_0x4a2068){if(!_0x4a2068){_0x7d4b7b[_0x9ae8('0x18')](0x194);}return _0x4a2068;};}function handleError(_0x3854c1,_0x5186af){_0x5186af=_0x5186af||0x1f4;return function(_0x275ab5){logger['error'](_0x275ab5[_0x9ae8('0x26')]);if(_0x275ab5['name']){delete _0x275ab5['name'];}_0x3854c1[_0x9ae8('0x19')](_0x5186af)[_0x9ae8('0x27')](_0x275ab5);};}exports[_0x9ae8('0x28')]=function(_0x22a74b,_0x3e184e){var _0x3b9d93={},_0x14a3dd={},_0x2cd11e={'count':0x0,'rows':[]};var _0x2e4b17=_['map'](db[_0x9ae8('0x29')][_0x9ae8('0x2a')],function(_0x4db376){return{'name':_0x4db376[_0x9ae8('0x2b')],'type':_0x4db376[_0x9ae8('0x2c')][_0x9ae8('0x2d')]};});_0x14a3dd[_0x9ae8('0x2e')]=_['map'](_0x2e4b17,'name');_0x14a3dd[_0x9ae8('0x2f')]=_['keys'](_0x22a74b[_0x9ae8('0x2f')]);_0x14a3dd[_0x9ae8('0x30')]=_[_0x9ae8('0x31')](_0x14a3dd[_0x9ae8('0x2e')],_0x14a3dd[_0x9ae8('0x2f')]);_0x3b9d93['attributes']=_['intersection'](_0x14a3dd[_0x9ae8('0x2e')],qs['fields'](_0x22a74b[_0x9ae8('0x2f')][_0x9ae8('0x32')]));_0x3b9d93['attributes']=_0x3b9d93[_0x9ae8('0x33')][_0x9ae8('0x34')]?_0x3b9d93[_0x9ae8('0x33')]:_0x14a3dd[_0x9ae8('0x2e')];if(!_0x22a74b[_0x9ae8('0x2f')][_0x9ae8('0x35')]('nolimit')){_0x3b9d93[_0x9ae8('0x1d')]=qs[_0x9ae8('0x1d')](_0x22a74b[_0x9ae8('0x2f')][_0x9ae8('0x1d')]);_0x3b9d93[_0x9ae8('0x1b')]=qs[_0x9ae8('0x1b')](_0x22a74b[_0x9ae8('0x2f')]['offset']);}_0x3b9d93[_0x9ae8('0x36')]=qs[_0x9ae8('0x37')](_0x22a74b['query'][_0x9ae8('0x37')]);_0x3b9d93[_0x9ae8('0x38')]=qs['filters'](_['pick'](_0x22a74b[_0x9ae8('0x2f')],_0x14a3dd[_0x9ae8('0x30')]),_0x2e4b17);if(_0x22a74b['query'][_0x9ae8('0x39')]){_0x3b9d93['where']=_[_0x9ae8('0x3a')](_0x3b9d93[_0x9ae8('0x38')],{'$or':_['map'](_0x2e4b17,function(_0x8180d6){if(_0x8180d6['type']!==_0x9ae8('0x3b')){var _0x5f2522={};_0x5f2522[_0x8180d6[_0x9ae8('0x3c')]]={'$like':'%'+_0x22a74b[_0x9ae8('0x2f')][_0x9ae8('0x39')]+'%'};return _0x5f2522;}})});}_0x3b9d93=_[_0x9ae8('0x3a')]({},_0x3b9d93,_0x22a74b[_0x9ae8('0x3d')]);var _0x15c3ba={'where':_0x3b9d93[_0x9ae8('0x38')]};return db['VoiceDialReport'][_0x9ae8('0x1e')](_0x15c3ba)[_0x9ae8('0x23')](function(_0x4499e6){_0x2cd11e[_0x9ae8('0x1e')]=_0x4499e6;if(_0x22a74b['query'][_0x9ae8('0x3e')]){_0x3b9d93[_0x9ae8('0x3f')]=[{'all':!![]}];}return db['VoiceDialReport'][_0x9ae8('0x40')](_0x3b9d93);})[_0x9ae8('0x23')](function(_0xd5a1b){_0x2cd11e['rows']=_0xd5a1b;return _0x2cd11e;})[_0x9ae8('0x23')](respondWithFilteredResult(_0x3e184e,_0x3b9d93))[_0x9ae8('0x41')](handleError(_0x3e184e,null));};exports[_0x9ae8('0x42')]=function(_0x51e5f6,_0x42f9c3){var _0x207424={'raw':!![],'where':{'id':_0x51e5f6[_0x9ae8('0x43')]['id']}},_0x7d79ab={};_0x7d79ab[_0x9ae8('0x2e')]=_[_0x9ae8('0x44')](db['VoiceDialReport']['rawAttributes']);_0x7d79ab['query']=_[_0x9ae8('0x44')](_0x51e5f6['query']);_0x7d79ab[_0x9ae8('0x30')]=_['intersection'](_0x7d79ab[_0x9ae8('0x2e')],_0x7d79ab[_0x9ae8('0x2f')]);_0x207424[_0x9ae8('0x33')]=_[_0x9ae8('0x31')](_0x7d79ab[_0x9ae8('0x2e')],qs[_0x9ae8('0x32')](_0x51e5f6[_0x9ae8('0x2f')][_0x9ae8('0x32')]));_0x207424[_0x9ae8('0x33')]=_0x207424[_0x9ae8('0x33')]['length']?_0x207424['attributes']:_0x7d79ab['model'];if(_0x51e5f6[_0x9ae8('0x2f')][_0x9ae8('0x3e')]){_0x207424['include']=[{'all':!![]}];}_0x207424=_[_0x9ae8('0x3a')]({},_0x207424,_0x51e5f6[_0x9ae8('0x3d')]);return db[_0x9ae8('0x29')][_0x9ae8('0x45')](_0x207424)['then'](handleEntityNotFound(_0x42f9c3,null))[_0x9ae8('0x23')](respondWithResult(_0x42f9c3,null))[_0x9ae8('0x41')](handleError(_0x42f9c3,null));};exports[_0x9ae8('0x46')]=function(_0x54ba6d,_0x45de82){return db[_0x9ae8('0x29')][_0x9ae8('0x46')](_0x54ba6d[_0x9ae8('0x47')],{})['then'](respondWithResult(_0x45de82,0xc9))[_0x9ae8('0x41')](handleError(_0x45de82,null));};exports[_0x9ae8('0x48')]=function(_0x4dca6d,_0x3e6657){if(_0x4dca6d['body']['id']){delete _0x4dca6d[_0x9ae8('0x47')]['id'];}return db[_0x9ae8('0x29')][_0x9ae8('0x45')]({'where':{'id':_0x4dca6d[_0x9ae8('0x43')]['id']}})['then'](handleEntityNotFound(_0x3e6657,null))[_0x9ae8('0x23')](saveUpdates(_0x4dca6d['body'],null))[_0x9ae8('0x23')](respondWithResult(_0x3e6657,null))['catch'](handleError(_0x3e6657,null));};exports[_0x9ae8('0x24')]=function(_0x480612,_0x17b735){return db['VoiceDialReport'][_0x9ae8('0x45')]({'where':{'id':_0x480612[_0x9ae8('0x43')]['id']}})[_0x9ae8('0x23')](handleEntityNotFound(_0x17b735,null))[_0x9ae8('0x23')](removeEntity(_0x17b735,null))[_0x9ae8('0x41')](handleError(_0x17b735,null));};exports[_0x9ae8('0x49')]=function(_0x1ca18d,_0x552574){return db[_0x9ae8('0x29')]['describe']()[_0x9ae8('0x23')](respondWithResult(_0x552574,null))[_0x9ae8('0x41')](handleError(_0x552574,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 0afd7d8..9eac714 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 _0xe57e=['report_dial','uniqueid','lodash','../../config/logger','api','moment','path','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport'];(function(_0x5c3027,_0x1c3aa6){var _0x33d2dd=function(_0x2e5565){while(--_0x2e5565){_0x5c3027['push'](_0x5c3027['shift']());}};_0x33d2dd(++_0x1c3aa6);}(_0xe57e,0xf2));var _0xee57=function(_0x4433c4,_0x874f31){_0x4433c4=_0x4433c4-0x0;var _0x36e2a0=_0xe57e[_0x4433c4];return _0x36e2a0;};'use strict';var _=require(_0xee57('0x0'));var util=require('util');var logger=require(_0xee57('0x1'))(_0xee57('0x2'));var moment=require(_0xee57('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xee57('0x4'));var rimraf=require('rimraf');var config=require(_0xee57('0x5'));var attributes=require(_0xee57('0x6'));module[_0xee57('0x7')]=function(_0x4e21c4,_0x491334){return _0x4e21c4[_0xee57('0x8')](_0xee57('0x9'),attributes,{'tableName':_0xee57('0xa'),'paranoid':![],'indexes':[{'fields':[_0xee57('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1b69=['define','VoiceDialReport','report_dial','uniqueid','api','moment','bluebird','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1b69,0x190));var _0x91b6=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0x1b69[_0x288f5e];return _0x476cc9;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x91b6('0x0'));var moment=require(_0x91b6('0x1'));var BPromise=require(_0x91b6('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91b6('0x3'));var rimraf=require(_0x91b6('0x4'));var config=require(_0x91b6('0x5'));var attributes=require(_0x91b6('0x6'));module[_0x91b6('0x7')]=function(_0x1411c6,_0x264272){return _0x1411c6[_0x91b6('0x8')](_0x91b6('0x9'),attributes,{'tableName':_0x91b6('0xa'),'paranoid':![],'indexes':[{'fields':[_0x91b6('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index b29899f..ec1d2fa 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 _0x2986=['result','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','debug','UpdateVoiceDialReport','update','where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','VoiceDialReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info'];(function(_0x4347ec,_0x41c4b8){var _0x4c8314=function(_0x583acd){while(--_0x583acd){_0x4347ec['push'](_0x4347ec['shift']());}};_0x4c8314(++_0x41c4b8);}(_0x2986,0x9a));var _0x6298=function(_0x277f14,_0x1e9cc1){_0x277f14=_0x277f14-0x0;var _0x3df07d=_0x2986[_0x277f14];return _0x3df07d;};'use strict';var _=require('lodash');var util=require(_0x6298('0x0'));var moment=require(_0x6298('0x1'));var BPromise=require(_0x6298('0x2'));var rs=require(_0x6298('0x3'));var fs=require('fs');var Redis=require(_0x6298('0x4'));var db=require(_0x6298('0x5'))['db'];var utils=require(_0x6298('0x6'));var logger=require(_0x6298('0x7'))(_0x6298('0x8'));var config=require('../../config/environment');var jayson=require(_0x6298('0x9'));var client=jayson[_0x6298('0xa')][_0x6298('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x350b3c,_0x4034c1,_0x4debfb){return new BPromise(function(_0x355890,_0x352c72){return client[_0x6298('0xc')](_0x350b3c,_0x4debfb)[_0x6298('0xd')](function(_0x3d693){logger['info'](_0x6298('0xe'),_0x4034c1,'request\x20sent');logger['debug']('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x4034c1,_0x6298('0xf'),JSON[_0x6298('0x10')](_0x3d693));if(_0x3d693['error']){if(_0x3d693[_0x6298('0x11')][_0x6298('0x12')]===0x1f4){logger[_0x6298('0x11')](_0x6298('0xe'),_0x4034c1,_0x3d693[_0x6298('0x11')][_0x6298('0x13')]);return _0x352c72(_0x3d693['error'][_0x6298('0x13')]);}logger[_0x6298('0x11')]('VoiceDialReport,\x20%s,\x20%s',_0x4034c1,_0x3d693['error'][_0x6298('0x13')]);return _0x355890(_0x3d693['error'][_0x6298('0x13')]);}else{logger[_0x6298('0x14')](_0x6298('0xe'),_0x4034c1,_0x6298('0xf'));_0x355890(_0x3d693[_0x6298('0x15')][_0x6298('0x13')]);}})[_0x6298('0x16')](function(_0x30cc33){logger[_0x6298('0x11')]('VoiceDialReport,\x20%s,\x20%s',_0x4034c1,_0x30cc33);_0x352c72(_0x30cc33);});});}exports[_0x6298('0x17')]=function(_0x1c151d){var _0x361132=this;return new Promise(function(_0x2c9599,_0x3f4193){return db[_0x6298('0x18')][_0x6298('0x19')](_0x1c151d[_0x6298('0x1a')],{'raw':_0x1c151d[_0x6298('0x1b')]?_0x1c151d[_0x6298('0x1b')][_0x6298('0x1c')]===undefined?!![]:![]:!![]})[_0x6298('0xd')](function(_0x13644f){logger['info'](_0x6298('0x17'),_0x1c151d);logger[_0x6298('0x1d')](_0x6298('0x17'),_0x1c151d,JSON[_0x6298('0x10')](_0x13644f));_0x2c9599(_0x13644f);})[_0x6298('0x16')](function(_0x189b40){logger[_0x6298('0x11')](_0x6298('0x17'),_0x189b40['message'],_0x1c151d);_0x3f4193(_0x361132[_0x6298('0x11')](0x1f4,_0x189b40[_0x6298('0x13')]));});});};exports[_0x6298('0x1e')]=function(_0x342d2f){var _0x234f11=this;return new Promise(function(_0x22b3ea,_0x48763f){return db[_0x6298('0x18')][_0x6298('0x1f')](_0x342d2f[_0x6298('0x1a')],{'raw':_0x342d2f[_0x6298('0x1b')]?_0x342d2f[_0x6298('0x1b')][_0x6298('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x342d2f[_0x6298('0x1b')]?_0x342d2f['options'][_0x6298('0x20')]||null:null,'attributes':_0x342d2f['options']?_0x342d2f[_0x6298('0x1b')][_0x6298('0x21')]||null:null,'limit':_0x342d2f[_0x6298('0x1b')]?_0x342d2f[_0x6298('0x1b')][_0x6298('0x22')]||null:null})[_0x6298('0xd')](function(_0x357ea1){logger[_0x6298('0x14')](_0x6298('0x1e'),_0x342d2f);logger['debug'](_0x6298('0x1e'),_0x342d2f,JSON[_0x6298('0x10')](_0x357ea1));_0x22b3ea(_0x357ea1);})[_0x6298('0x16')](function(_0x147309){logger[_0x6298('0x11')](_0x6298('0x1e'),_0x147309['message'],_0x342d2f);_0x48763f(_0x234f11[_0x6298('0x11')](0x1f4,_0x147309['message']));});});}; \ No newline at end of file +var _0x87a1=['create','body','options','raw','stringify','catch','UpdateVoiceDialReport','VoiceDialReport','update','where','limit','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','code','VoiceDialReport,\x20%s,\x20%s','message','CreateVoiceDialReport'];(function(_0x1a077a,_0xe2bb6b){var _0x2d6e4c=function(_0x1a95db){while(--_0x1a95db){_0x1a077a['push'](_0x1a077a['shift']());}};_0x2d6e4c(++_0xe2bb6b);}(_0x87a1,0xf2));var _0x187a=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0x87a1[_0x2d8fc2];return _0x3a9e53;};'use strict';var _=require('lodash');var util=require(_0x187a('0x0'));var moment=require(_0x187a('0x1'));var BPromise=require('bluebird');var rs=require(_0x187a('0x2'));var fs=require('fs');var Redis=require(_0x187a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x187a('0x4'));var logger=require(_0x187a('0x5'))(_0x187a('0x6'));var config=require(_0x187a('0x7'));var jayson=require(_0x187a('0x8'));var client=jayson[_0x187a('0x9')][_0x187a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4eea29,_0x62c836,_0x272c68){return new BPromise(function(_0x52c5ea,_0x30a35a){return client[_0x187a('0xb')](_0x4eea29,_0x272c68)[_0x187a('0xc')](function(_0x201f8c){logger[_0x187a('0xd')]('VoiceDialReport,\x20%s,\x20%s',_0x62c836,_0x187a('0xe'));logger[_0x187a('0xf')](_0x187a('0x10'),_0x62c836,_0x187a('0xe'),JSON['stringify'](_0x201f8c));if(_0x201f8c[_0x187a('0x11')]){if(_0x201f8c[_0x187a('0x11')][_0x187a('0x12')]===0x1f4){logger[_0x187a('0x11')](_0x187a('0x13'),_0x62c836,_0x201f8c[_0x187a('0x11')][_0x187a('0x14')]);return _0x30a35a(_0x201f8c[_0x187a('0x11')][_0x187a('0x14')]);}logger[_0x187a('0x11')](_0x187a('0x13'),_0x62c836,_0x201f8c[_0x187a('0x11')][_0x187a('0x14')]);return _0x52c5ea(_0x201f8c[_0x187a('0x11')][_0x187a('0x14')]);}else{logger['info'](_0x187a('0x13'),_0x62c836,_0x187a('0xe'));_0x52c5ea(_0x201f8c['result'][_0x187a('0x14')]);}})['catch'](function(_0x2e0241){logger[_0x187a('0x11')](_0x187a('0x13'),_0x62c836,_0x2e0241);_0x30a35a(_0x2e0241);});});}exports[_0x187a('0x15')]=function(_0x2d3086){var _0x3d7dab=this;return new Promise(function(_0x401242,_0x16e144){return db['VoiceDialReport'][_0x187a('0x16')](_0x2d3086[_0x187a('0x17')],{'raw':_0x2d3086[_0x187a('0x18')]?_0x2d3086[_0x187a('0x18')][_0x187a('0x19')]===undefined?!![]:![]:!![]})[_0x187a('0xc')](function(_0x3d2572){logger[_0x187a('0xd')](_0x187a('0x15'),_0x2d3086);logger[_0x187a('0xf')]('CreateVoiceDialReport',_0x2d3086,JSON[_0x187a('0x1a')](_0x3d2572));_0x401242(_0x3d2572);})[_0x187a('0x1b')](function(_0x1dd6b9){logger['error'](_0x187a('0x15'),_0x1dd6b9[_0x187a('0x14')],_0x2d3086);_0x16e144(_0x3d7dab[_0x187a('0x11')](0x1f4,_0x1dd6b9['message']));});});};exports[_0x187a('0x1c')]=function(_0x45fd97){var _0x33d040=this;return new Promise(function(_0x30d4b6,_0x3f70eb){return db[_0x187a('0x1d')][_0x187a('0x1e')](_0x45fd97[_0x187a('0x17')],{'raw':_0x45fd97[_0x187a('0x18')]?_0x45fd97[_0x187a('0x18')][_0x187a('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45fd97[_0x187a('0x18')]?_0x45fd97[_0x187a('0x18')][_0x187a('0x1f')]||null:null,'attributes':_0x45fd97['options']?_0x45fd97[_0x187a('0x18')]['attributes']||null:null,'limit':_0x45fd97['options']?_0x45fd97[_0x187a('0x18')][_0x187a('0x20')]||null:null})['then'](function(_0x55524b){logger[_0x187a('0xd')](_0x187a('0x1c'),_0x45fd97);logger[_0x187a('0xf')](_0x187a('0x1c'),_0x45fd97,JSON['stringify'](_0x55524b));_0x30d4b6(_0x55524b);})[_0x187a('0x1b')](function(_0x30f68e){logger[_0x187a('0x11')](_0x187a('0x1c'),_0x30f68e[_0x187a('0x14')],_0x45fd97);_0x3f70eb(_0x33d040[_0x187a('0x11')](0x1f4,_0x30f68e[_0x187a('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 87711cc..217184b 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 _0x4127=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceExtension.controller','get','/:id','isAuthenticated','show','post','create','update','multer','util'];(function(_0x1123d3,_0x37e5ba){var _0x455cc8=function(_0x21f0a2){while(--_0x21f0a2){_0x1123d3['push'](_0x1123d3['shift']());}};_0x455cc8(++_0x37e5ba);}(_0x4127,0x1eb));var _0x7412=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x4127[_0x5b561d];return _0x431060;};'use strict';var multer=require(_0x7412('0x0'));var util=require(_0x7412('0x1'));var path=require(_0x7412('0x2'));var timeout=require(_0x7412('0x3'));var express=require(_0x7412('0x4'));var router=express[_0x7412('0x5')]();var fs_extra=require(_0x7412('0x6'));var auth=require(_0x7412('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x7412('0x8'));var controller=require(_0x7412('0x9'));router[_0x7412('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7412('0xa')](_0x7412('0xb'),auth[_0x7412('0xc')](),controller[_0x7412('0xd')]);router[_0x7412('0xe')]('/',auth[_0x7412('0xc')](),controller[_0x7412('0xf')]);router['post']('/:id/applications',auth['isAuthenticated'](),controller['addApplications']);router['put'](_0x7412('0xb'),auth['isAuthenticated'](),controller[_0x7412('0x10')]);router['delete'](_0x7412('0xb'),auth[_0x7412('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xdf4c=['express','fs-extra','../../components/interaction/service','../../config/environment','./voiceExtension.controller','isAuthenticated','index','get','/:id','post','/:id/applications','addApplications','put','delete','destroy','exports','util','connect-timeout'];(function(_0x34b5ca,_0x594010){var _0x2d72c0=function(_0x4ae1d3){while(--_0x4ae1d3){_0x34b5ca['push'](_0x34b5ca['shift']());}};_0x2d72c0(++_0x594010);}(_0xdf4c,0x1c0));var _0xcdf4=function(_0x26f4f5,_0x53419e){_0x26f4f5=_0x26f4f5-0x0;var _0x91bf0a=_0xdf4c[_0x26f4f5];return _0x91bf0a;};'use strict';var multer=require('multer');var util=require(_0xcdf4('0x0'));var path=require('path');var timeout=require(_0xcdf4('0x1'));var express=require(_0xcdf4('0x2'));var router=express['Router']();var fs_extra=require(_0xcdf4('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xcdf4('0x4'));var config=require(_0xcdf4('0x5'));var controller=require(_0xcdf4('0x6'));router['get']('/',auth[_0xcdf4('0x7')](),controller[_0xcdf4('0x8')]);router[_0xcdf4('0x9')](_0xcdf4('0xa'),auth[_0xcdf4('0x7')](),controller['show']);router[_0xcdf4('0xb')]('/',auth[_0xcdf4('0x7')](),controller['create']);router['post'](_0xcdf4('0xc'),auth['isAuthenticated'](),controller[_0xcdf4('0xd')]);router[_0xcdf4('0xe')](_0xcdf4('0xa'),auth[_0xcdf4('0x7')](),controller['update']);router[_0xcdf4('0xf')](_0xcdf4('0xa'),auth['isAuthenticated'](),controller[_0xcdf4('0x10')]);module[_0xcdf4('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 6bd2b37..ddb5eab 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 _0xfbf7=['*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exten','exports','STRING','compositeIndex','NoOp','ENUM','inbound','outbound','internal','outbound-fax','system','any'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfbf7,0xbb));var _0x7fbf=function(_0x457b06,_0x7bb190){_0x457b06=_0x457b06-0x0;var _0x177dcc=_0xfbf7[_0x457b06];return _0x177dcc;};'use strict';var Sequelize=require('sequelize');module[_0x7fbf('0x0')]={'context':{'type':Sequelize[_0x7fbf('0x1')],'allowNull':![],'unique':_0x7fbf('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x7fbf('0x2')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x7fbf('0x1')],'allowNull':![],'defaultValue':_0x7fbf('0x3')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x7fbf('0x4')](_0x7fbf('0x5'),_0x7fbf('0x6'),_0x7fbf('0x7'),'inbound-fax',_0x7fbf('0x8'),_0x7fbf('0x9'),_0x7fbf('0xa')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x7fbf('0x1')],'allowNull':![],'defaultValue':_0x7fbf('0xb')},'IntervalId':{'type':Sequelize[_0x7fbf('0xc')]},'isApp':{'type':Sequelize[_0x7fbf('0xd')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0x7fbf('0xd')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x7fbf('0xc')]},'recordingFormat':{'type':Sequelize[_0x7fbf('0x1')],'defaultValue':_0x7fbf('0xe')},'answer':{'type':Sequelize[_0x7fbf('0xd')],'defaultValue':!![]},'name':{'type':Sequelize[_0x7fbf('0xf')],'get':function(_0x578b44){return this[_0x7fbf('0x10')](_0x7fbf('0x11'));}},'alias':{'type':Sequelize[_0x7fbf('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0xf98a=['BOOLEAN','wav','VIRTUAL','exten','sequelize','compositeIndex','STRING','inbound','outbound','internal','inbound-fax','*,*,*,*','INTEGER'];(function(_0x1b0b13,_0x47562e){var _0x3896ff=function(_0x81cda6){while(--_0x81cda6){_0x1b0b13['push'](_0x1b0b13['shift']());}};_0x3896ff(++_0x47562e);}(_0xf98a,0x93));var _0xaf98=function(_0xba1760,_0x191969){_0xba1760=_0xba1760-0x0;var _0x1f3143=_0xf98a[_0xba1760];return _0x1f3143;};'use strict';var Sequelize=require(_0xaf98('0x0'));module['exports']={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xaf98('0x1'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xaf98('0x2')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0xaf98('0x2')],'allowNull':![],'defaultValue':'1','unique':_0xaf98('0x1')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xaf98('0x2')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize[_0xaf98('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0xaf98('0x3'),_0xaf98('0x4'),_0xaf98('0x5'),_0xaf98('0x6'),'outbound-fax','system','any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xaf98('0x2')],'allowNull':![],'defaultValue':_0xaf98('0x7')},'IntervalId':{'type':Sequelize[_0xaf98('0x8')]},'isApp':{'type':Sequelize[_0xaf98('0x9')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xaf98('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0xaf98('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0xaf98('0x9')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xaf98('0x8')]},'recordingFormat':{'type':Sequelize[_0xaf98('0x2')],'defaultValue':_0xaf98('0xa')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0xaf98('0xb')],'get':function(_0x3e16e5){return this['getDataValue'](_0xaf98('0xc'));}},'alias':{'type':Sequelize[_0xaf98('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 b2d6ba9..31e3ad6 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 _0x857a=['include','rows','show','params','length','catch','body','startsWith','exten','concat','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','inbound','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','recordingFormat','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','bulkCreate','findAndCountAll','finally','ioredis','../../components/parsers/qs','../../config/logger','../../mysqldb','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','status','end','json','undefined','limit','count','offset','set','destroy','then','get','InboundRoutes','OutboundRoutes','outbound','InternalRoutes','internal','filter','value','includes','type','find','UserProfileResource','sendStatus','error','stack','name','send','index','map','VoiceExtension','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','nolimit','order','sort','where','filters','pick','VIRTUAL','merge','options','includeAll'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x857a,0x1f4));var _0xa857=function(_0x6a4e8e,_0x5b375a){_0x6a4e8e=_0x6a4e8e-0x0;var _0x425067=_0x857a[_0x6a4e8e];return _0x425067;};'use strict';var _=require('lodash');var Redis=require(_0xa857('0x0'));var qs=require(_0xa857('0x1'));var logger=require(_0xa857('0x2'))('api');var config=require('../../config/environment');var db=require(_0xa857('0x3'))['db'];config[_0xa857('0x4')]=_['defaults'](config['redis'],{'host':_0xa857('0x5'),'port':0x18eb});var socket=require(_0xa857('0x6'))(new Redis(config[_0xa857('0x4')]));require(_0xa857('0x7'))[_0xa857('0x8')](socket);function respondWithStatusCode(_0x12bd3f,_0x4e1d2b){_0x4e1d2b=_0x4e1d2b||0xcc;return function(_0x273550){if(_0x273550){return _0x12bd3f['sendStatus'](_0x4e1d2b);}return _0x12bd3f[_0xa857('0x9')](_0x4e1d2b)[_0xa857('0xa')]();};}function respondWithResult(_0x4364a9,_0x54288d){_0x54288d=_0x54288d||0xc8;return function(_0x3a2ef5){if(_0x3a2ef5){return _0x4364a9[_0xa857('0x9')](_0x54288d)[_0xa857('0xb')](_0x3a2ef5);}};}function respondWithFilteredResult(_0x1e3904,_0x22f78e){return function(_0x3fffa8){if(_0x3fffa8){var _0x32ded6=typeof _0x22f78e['offset']===_0xa857('0xc')&&typeof _0x22f78e[_0xa857('0xd')]===_0xa857('0xc');var _0x407356=_0x3fffa8[_0xa857('0xe')];var _0x1bb7fd=_0x32ded6?0x0:_0x22f78e[_0xa857('0xf')];var _0x5869d9=_0x32ded6?_0x3fffa8['count']:_0x22f78e['offset']+_0x22f78e['limit'];var _0x1cdee8;if(_0x5869d9>=_0x407356){_0x5869d9=_0x407356;_0x1cdee8=0xc8;}else{_0x1cdee8=0xce;}_0x1e3904['status'](_0x1cdee8);return _0x1e3904[_0xa857('0x10')]('Content-Range',_0x1bb7fd+'-'+_0x5869d9+'/'+_0x407356)['json'](_0x3fffa8);}return null;};}function removeEntity(_0x3e0ef6){return function(_0x5e357e){if(_0x5e357e){return _0x5e357e[_0xa857('0x11')]()[_0xa857('0x12')](function(){var _0x2d37ca=_0x5e357e[_0xa857('0x13')]({'plain':!![]});var _0x1d52bb=[{'name':_0xa857('0x14'),'value':'inbound','ignore':![]},{'name':_0xa857('0x15'),'value':_0xa857('0x16'),'ignore':![]},{'name':_0xa857('0x17'),'value':_0xa857('0x18'),'ignore':![]}];var _0x2ed53b=_(_0x1d52bb)[_0xa857('0x19')]('ignore')['map'](_0xa857('0x1a'))[_0xa857('0x1a')]();if(_[_0xa857('0x1b')](_0x2ed53b,_0x2d37ca[_0xa857('0x1c')])){return;}var _0x2ca5a0=_[_0xa857('0x1d')](_0x1d52bb,[_0xa857('0x1a'),_0x2d37ca['type']])['name'];return db[_0xa857('0x1e')][_0xa857('0x11')]({'where':{'type':_0x2ca5a0,'resourceId':_0x2d37ca['id']}})[_0xa857('0x12')](function(){return _0x5e357e;});})[_0xa857('0x12')](function(){_0x3e0ef6['status'](0xcc)[_0xa857('0xa')]();});}};}function handleEntityNotFound(_0x2a7914){return function(_0x221a09){if(!_0x221a09){_0x2a7914[_0xa857('0x1f')](0x194);}return _0x221a09;};}function handleError(_0x51e9b4,_0x17628a){_0x17628a=_0x17628a||0x1f4;return function(_0x3eca63){logger[_0xa857('0x20')](_0x3eca63[_0xa857('0x21')]);if(_0x3eca63[_0xa857('0x22')]){delete _0x3eca63[_0xa857('0x22')];}_0x51e9b4[_0xa857('0x9')](_0x17628a)[_0xa857('0x23')](_0x3eca63);};}exports[_0xa857('0x24')]=function(_0x12ff97,_0x46c42a){var _0x3c6dde={},_0x43b6a3={},_0x3afee3={'count':0x0,'rows':[]};var _0xd25973=_[_0xa857('0x25')](db[_0xa857('0x26')][_0xa857('0x27')],function(_0x21981a){return{'name':_0x21981a[_0xa857('0x28')],'type':_0x21981a[_0xa857('0x1c')][_0xa857('0x29')]};});_0x43b6a3[_0xa857('0x2a')]=_[_0xa857('0x25')](_0xd25973,_0xa857('0x22'));_0x43b6a3[_0xa857('0x2b')]=_[_0xa857('0x2c')](_0x12ff97[_0xa857('0x2b')]);_0x43b6a3['filters']=_['intersection'](_0x43b6a3[_0xa857('0x2a')],_0x43b6a3[_0xa857('0x2b')]);_0x3c6dde['attributes']=_[_0xa857('0x2d')](_0x43b6a3[_0xa857('0x2a')],qs['fields'](_0x12ff97[_0xa857('0x2b')][_0xa857('0x2e')]));_0x3c6dde[_0xa857('0x2f')]=_0x3c6dde[_0xa857('0x2f')]['length']?_0x3c6dde[_0xa857('0x2f')]:_0x43b6a3['model'];if(!_0x12ff97[_0xa857('0x2b')]['hasOwnProperty'](_0xa857('0x30'))){_0x3c6dde[_0xa857('0xd')]=qs['limit'](_0x12ff97[_0xa857('0x2b')][_0xa857('0xd')]);_0x3c6dde[_0xa857('0xf')]=qs['offset'](_0x12ff97[_0xa857('0x2b')][_0xa857('0xf')]);}_0x3c6dde[_0xa857('0x31')]=qs[_0xa857('0x32')](_0x12ff97[_0xa857('0x2b')]['sort']);_0x3c6dde[_0xa857('0x33')]=qs[_0xa857('0x34')](_[_0xa857('0x35')](_0x12ff97['query'],_0x43b6a3[_0xa857('0x34')]),_0xd25973);if(_0x12ff97['query'][_0xa857('0x19')]){_0x3c6dde[_0xa857('0x33')]=_['merge'](_0x3c6dde[_0xa857('0x33')],{'$or':_[_0xa857('0x25')](_0xd25973,function(_0x173bb5){if(_0x173bb5['type']!==_0xa857('0x36')){var _0x358496={};_0x358496[_0x173bb5[_0xa857('0x22')]]={'$like':'%'+_0x12ff97['query'][_0xa857('0x19')]+'%'};return _0x358496;}})});}_0x3c6dde=_[_0xa857('0x37')]({},_0x3c6dde,_0x12ff97[_0xa857('0x38')]);var _0x474834={'where':_0x3c6dde[_0xa857('0x33')]};return db[_0xa857('0x26')][_0xa857('0xe')](_0x474834)['then'](function(_0xb1be46){_0x3afee3[_0xa857('0xe')]=_0xb1be46;if(_0x12ff97[_0xa857('0x2b')][_0xa857('0x39')]){_0x3c6dde[_0xa857('0x3a')]=[{'all':!![]}];}return db[_0xa857('0x26')]['findAll'](_0x3c6dde);})[_0xa857('0x12')](function(_0x408eaf){_0x3afee3[_0xa857('0x3b')]=_0x408eaf;return _0x3afee3;})[_0xa857('0x12')](respondWithFilteredResult(_0x46c42a,_0x3c6dde))['catch'](handleError(_0x46c42a,null));};exports[_0xa857('0x3c')]=function(_0x1bf64f,_0x3706c5){var _0x7d025e={'raw':![],'where':{'id':_0x1bf64f[_0xa857('0x3d')]['id']}},_0x524470={};_0x524470['model']=_[_0xa857('0x2c')](db[_0xa857('0x26')][_0xa857('0x27')]);_0x524470[_0xa857('0x2b')]=_[_0xa857('0x2c')](_0x1bf64f[_0xa857('0x2b')]);_0x524470[_0xa857('0x34')]=_[_0xa857('0x2d')](_0x524470[_0xa857('0x2a')],_0x524470['query']);_0x7d025e[_0xa857('0x2f')]=_['intersection'](_0x524470[_0xa857('0x2a')],qs['fields'](_0x1bf64f[_0xa857('0x2b')][_0xa857('0x2e')]));_0x7d025e[_0xa857('0x2f')]=_0x7d025e[_0xa857('0x2f')][_0xa857('0x3e')]?_0x7d025e['attributes']:_0x524470['model'];if(_0x1bf64f['query'][_0xa857('0x39')]){_0x7d025e[_0xa857('0x3a')]=[{'all':!![]}];}_0x7d025e=_['merge']({},_0x7d025e,_0x1bf64f[_0xa857('0x38')]);return db[_0xa857('0x26')]['find'](_0x7d025e)[_0xa857('0x12')](handleEntityNotFound(_0x3706c5,null))['then'](respondWithResult(_0x3706c5,null))[_0xa857('0x3f')](handleError(_0x3706c5,null));};exports[_0xa857('0x11')]=function(_0x2bf006,_0xa68261){return db[_0xa857('0x26')]['find']({'where':{'id':_0x2bf006[_0xa857('0x3d')]['id']}})[_0xa857('0x12')](handleEntityNotFound(_0xa68261,null))['then'](removeEntity(_0xa68261,null))[_0xa857('0x3f')](handleError(_0xa68261,null));};exports['create']=function(_0x53f67e,_0x1fb628){if(_0x53f67e[_0xa857('0x40')][_0xa857('0x1c')]===_0xa857('0x16')&&!_[_0xa857('0x41')](_0x53f67e[_0xa857('0x40')][_0xa857('0x42')],'_')){_0x53f67e[_0xa857('0x40')][_0xa857('0x42')]='_'[_0xa857('0x43')](_0x53f67e['body'][_0xa857('0x42')]);}return db['VoiceExtension'][_0xa857('0x44')](_0x53f67e['body'],{'raw':![]})[_0xa857('0x12')](function(_0x2e99f4){var _0x36e78e=_0x53f67e[_0xa857('0x45')][_0xa857('0x13')]({'plain':!![]});if(!_0x36e78e)throw new Error(_0xa857('0x46'));if(_0x36e78e[_0xa857('0x47')]===_0xa857('0x45')){var _0x5076fd=_0x2e99f4[_0xa857('0x13')]({'plain':!![]});var _0x389c25=[{'name':_0xa857('0x14'),'value':_0xa857('0x48')},{'name':'OutboundRoutes','value':_0xa857('0x16')},{'name':_0xa857('0x17'),'value':'internal'}];var _0x594afb=_[_0xa857('0x1d')](_0x389c25,[_0xa857('0x1a'),_0x5076fd[_0xa857('0x1c')]])[_0xa857('0x22')];return db[_0xa857('0x49')]['find']({'where':{'name':_0x594afb,'userProfileId':_0x36e78e[_0xa857('0x4a')]},'raw':!![]})['then'](function(_0x1666ed){if(_0x1666ed&&_0x1666ed[_0xa857('0x4b')]===0x0){return db['UserProfileResource']['create']({'name':_0x5076fd[_0xa857('0x22')],'resourceId':_0x5076fd['id'],'type':_0x1666ed[_0xa857('0x22')],'sectionId':_0x1666ed['id']},{})[_0xa857('0x12')](function(){return _0x2e99f4;});}else{return _0x2e99f4;}})['catch'](function(_0x312e1c){logger[_0xa857('0x20')](_0xa857('0x4c'),_0x312e1c);throw _0x312e1c;});}return _0x2e99f4;})[_0xa857('0x12')](respondWithResult(_0x1fb628,0xc9))[_0xa857('0x3f')](handleError(_0x1fb628,null));};exports[_0xa857('0x4d')]=function(_0x3398c8,_0x25949a){if(_0x3398c8[_0xa857('0x40')]['id']){delete _0x3398c8[_0xa857('0x40')]['id'];}return db[_0xa857('0x26')][_0xa857('0x1d')]({'where':{'id':_0x3398c8[_0xa857('0x3d')]['id']}})[_0xa857('0x12')](handleEntityNotFound(_0x25949a,null))['then'](function(_0x4f302d){if(_0x4f302d){return db[_0xa857('0x26')]['update'](_[_0xa857('0x35')](_0x3398c8[_0xa857('0x40')],[_0xa857('0x42'),_0xa857('0x4e'),'description',_0xa857('0x4f'),'cutdigits','mandatoryDisposition','alias']),{'where':{'context':_0x4f302d[_0xa857('0x4e')],'exten':_0x4f302d[_0xa857('0x42')]},'individualHooks':!![]})[_0xa857('0x12')](function(_0xdb5056){return _0xdb5056;});}return null;})['then'](respondWithStatusCode(_0x25949a,null))['catch'](handleError(_0x25949a,null));};exports[_0xa857('0x50')]=function(_0x2ab479,_0x3f96b7){var _0x357f26=_0x2ab479['params']['id'];var _0x201a35=_0x2ab479[_0xa857('0x40')];var _0x231db1=0xc8;var _0x561f09=null;return db[_0xa857('0x51')][_0xa857('0x52')]({'isolationLevel':db[_0xa857('0x51')][_0xa857('0x53')][_0xa857('0x54')][_0xa857('0x55')]},function(_0x21a4be){return db[_0xa857('0x26')][_0xa857('0x56')]({'where':{'id':_0x357f26},'transaction':_0x21a4be})[_0xa857('0x12')](function(_0xdb9d22){if(_0xdb9d22){return db[_0xa857('0x26')][_0xa857('0x11')]({'where':{'VoiceExtensionId':_0x357f26},'transaction':_0x21a4be})['then'](function(){var _0x2a359a=_[_0xa857('0x25')](_0x201a35,function(_0x591b58){_0x591b58[_0xa857('0x57')]=_0x357f26;_0x591b58[_0xa857('0x58')]=!![];return _0x591b58;});return _0xdb9d22[_0xa857('0x59')](_0x2a359a);})[_0xa857('0x12')](function(_0x4513af){return db[_0xa857('0x26')][_0xa857('0x5a')](_0x4513af,{'transaction':_0x21a4be});});}else{_0x231db1=0x194;_0x561f09=[];}});})['then'](function(){if(_0x231db1!==0x194){return db[_0xa857('0x26')][_0xa857('0x5b')]({'where':{'isApp':!![],'VoiceExtensionId':_0x357f26},'order':'priority'})[_0xa857('0x12')](function(_0x55ca19){_0x561f09=_0x55ca19;});}})[_0xa857('0x3f')](function(_0x17522e){_0x231db1=0x1f4;logger[_0xa857('0x20')](_0x17522e['stack']);if(_0x17522e[_0xa857('0x22')]){delete _0x17522e[_0xa857('0x22')];}_0x561f09=_0x17522e;})[_0xa857('0x5c')](function(){if(_0x561f09===null){_0x3f96b7[_0xa857('0x1f')](_0x231db1);}else{if(_0x231db1===0x1f4){_0x3f96b7[_0xa857('0x9')](_0x231db1)[_0xa857('0x23')](_0x561f09);}else{_0x3f96b7[_0xa857('0x9')](_0x231db1)[_0xa857('0xb')](_0x561f09);}}});}; \ No newline at end of file +var _0x8cc4=['include','VoiceExtension','findAll','rows','catch','show','params','length','options','create','startsWith','body','exten','concat','user','inbound','OutboundRoutes','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','recordingFormat','cutdigits','mandatoryDisposition','alias','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','findOne','isApp','createRouting','bulkCreate','findAndCountAll','priority','finally','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','status','end','json','offset','undefined','count','limit','set','Content-Range','then','get','InboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','value','type','find','name','UserProfileResource','destroy','sendStatus','error','stack','send','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge'];(function(_0x6ff889,_0x1ea004){var _0x5e04fa=function(_0x5fd7){while(--_0x5fd7){_0x6ff889['push'](_0x6ff889['shift']());}};_0x5e04fa(++_0x1ea004);}(_0x8cc4,0x137));var _0x48cc=function(_0x4295bc,_0x55b581){_0x4295bc=_0x4295bc-0x0;var _0x2f0298=_0x8cc4[_0x4295bc];return _0x2f0298;};'use strict';var _=require(_0x48cc('0x0'));var Redis=require(_0x48cc('0x1'));var qs=require(_0x48cc('0x2'));var logger=require(_0x48cc('0x3'))('api');var config=require(_0x48cc('0x4'));var db=require(_0x48cc('0x5'))['db'];config[_0x48cc('0x6')]=_[_0x48cc('0x7')](config[_0x48cc('0x6')],{'host':_0x48cc('0x8'),'port':0x18eb});var socket=require(_0x48cc('0x9'))(new Redis(config[_0x48cc('0x6')]));require(_0x48cc('0xa'))['register'](socket);function respondWithStatusCode(_0x9e87ad,_0x14b11f){_0x14b11f=_0x14b11f||0xcc;return function(_0x471826){if(_0x471826){return _0x9e87ad['sendStatus'](_0x14b11f);}return _0x9e87ad[_0x48cc('0xb')](_0x14b11f)[_0x48cc('0xc')]();};}function respondWithResult(_0x1833c2,_0x7bda9a){_0x7bda9a=_0x7bda9a||0xc8;return function(_0x15bdc0){if(_0x15bdc0){return _0x1833c2[_0x48cc('0xb')](_0x7bda9a)[_0x48cc('0xd')](_0x15bdc0);}};}function respondWithFilteredResult(_0x2c6589,_0x4f3485){return function(_0xabb4c5){if(_0xabb4c5){var _0x4507f8=typeof _0x4f3485[_0x48cc('0xe')]===_0x48cc('0xf')&&typeof _0x4f3485['limit']===_0x48cc('0xf');var _0x450647=_0xabb4c5['count'];var _0x32775d=_0x4507f8?0x0:_0x4f3485[_0x48cc('0xe')];var _0x202d09=_0x4507f8?_0xabb4c5[_0x48cc('0x10')]:_0x4f3485[_0x48cc('0xe')]+_0x4f3485[_0x48cc('0x11')];var _0x35ca34;if(_0x202d09>=_0x450647){_0x202d09=_0x450647;_0x35ca34=0xc8;}else{_0x35ca34=0xce;}_0x2c6589['status'](_0x35ca34);return _0x2c6589[_0x48cc('0x12')](_0x48cc('0x13'),_0x32775d+'-'+_0x202d09+'/'+_0x450647)[_0x48cc('0xd')](_0xabb4c5);}return null;};}function removeEntity(_0x47cc65){return function(_0x4c863c){if(_0x4c863c){return _0x4c863c['destroy']()[_0x48cc('0x14')](function(){var _0x545b9a=_0x4c863c[_0x48cc('0x15')]({'plain':!![]});var _0x114254=[{'name':_0x48cc('0x16'),'value':'inbound','ignore':![]},{'name':'OutboundRoutes','value':_0x48cc('0x17'),'ignore':![]},{'name':_0x48cc('0x18'),'value':_0x48cc('0x19'),'ignore':![]}];var _0x351613=_(_0x114254)[_0x48cc('0x1a')](_0x48cc('0x1b'))[_0x48cc('0x1c')]('value')[_0x48cc('0x1d')]();if(_['includes'](_0x351613,_0x545b9a[_0x48cc('0x1e')])){return;}var _0x5cf851=_[_0x48cc('0x1f')](_0x114254,[_0x48cc('0x1d'),_0x545b9a['type']])[_0x48cc('0x20')];return db[_0x48cc('0x21')][_0x48cc('0x22')]({'where':{'type':_0x5cf851,'resourceId':_0x545b9a['id']}})[_0x48cc('0x14')](function(){return _0x4c863c;});})[_0x48cc('0x14')](function(){_0x47cc65['status'](0xcc)[_0x48cc('0xc')]();});}};}function handleEntityNotFound(_0xeaa6c9){return function(_0x1db8ee){if(!_0x1db8ee){_0xeaa6c9[_0x48cc('0x23')](0x194);}return _0x1db8ee;};}function handleError(_0x4c3397,_0x416e43){_0x416e43=_0x416e43||0x1f4;return function(_0x45fd2a){logger[_0x48cc('0x24')](_0x45fd2a[_0x48cc('0x25')]);if(_0x45fd2a[_0x48cc('0x20')]){delete _0x45fd2a[_0x48cc('0x20')];}_0x4c3397[_0x48cc('0xb')](_0x416e43)[_0x48cc('0x26')](_0x45fd2a);};}exports['index']=function(_0x12515d,_0x57b991){var _0x2ba264={},_0x3054df={},_0x586b89={'count':0x0,'rows':[]};var _0x569716=_['map'](db['VoiceExtension']['rawAttributes'],function(_0x4a501b){return{'name':_0x4a501b['fieldName'],'type':_0x4a501b[_0x48cc('0x1e')]['key']};});_0x3054df[_0x48cc('0x27')]=_[_0x48cc('0x1c')](_0x569716,_0x48cc('0x20'));_0x3054df[_0x48cc('0x28')]=_[_0x48cc('0x29')](_0x12515d[_0x48cc('0x28')]);_0x3054df[_0x48cc('0x2a')]=_['intersection'](_0x3054df[_0x48cc('0x27')],_0x3054df['query']);_0x2ba264[_0x48cc('0x2b')]=_[_0x48cc('0x2c')](_0x3054df[_0x48cc('0x27')],qs[_0x48cc('0x2d')](_0x12515d['query'][_0x48cc('0x2d')]));_0x2ba264[_0x48cc('0x2b')]=_0x2ba264[_0x48cc('0x2b')]['length']?_0x2ba264[_0x48cc('0x2b')]:_0x3054df['model'];if(!_0x12515d[_0x48cc('0x28')][_0x48cc('0x2e')](_0x48cc('0x2f'))){_0x2ba264[_0x48cc('0x11')]=qs[_0x48cc('0x11')](_0x12515d['query'][_0x48cc('0x11')]);_0x2ba264[_0x48cc('0xe')]=qs[_0x48cc('0xe')](_0x12515d['query'][_0x48cc('0xe')]);}_0x2ba264[_0x48cc('0x30')]=qs[_0x48cc('0x31')](_0x12515d['query'][_0x48cc('0x31')]);_0x2ba264['where']=qs[_0x48cc('0x2a')](_[_0x48cc('0x32')](_0x12515d[_0x48cc('0x28')],_0x3054df[_0x48cc('0x2a')]),_0x569716);if(_0x12515d['query']['filter']){_0x2ba264[_0x48cc('0x33')]=_[_0x48cc('0x34')](_0x2ba264[_0x48cc('0x33')],{'$or':_[_0x48cc('0x1c')](_0x569716,function(_0x69fe24){if(_0x69fe24[_0x48cc('0x1e')]!=='VIRTUAL'){var _0x2f8b67={};_0x2f8b67[_0x69fe24[_0x48cc('0x20')]]={'$like':'%'+_0x12515d[_0x48cc('0x28')][_0x48cc('0x1a')]+'%'};return _0x2f8b67;}})});}_0x2ba264=_['merge']({},_0x2ba264,_0x12515d['options']);var _0xad0aa7={'where':_0x2ba264[_0x48cc('0x33')]};return db['VoiceExtension'][_0x48cc('0x10')](_0xad0aa7)[_0x48cc('0x14')](function(_0x445f17){_0x586b89[_0x48cc('0x10')]=_0x445f17;if(_0x12515d['query']['includeAll']){_0x2ba264[_0x48cc('0x35')]=[{'all':!![]}];}return db[_0x48cc('0x36')][_0x48cc('0x37')](_0x2ba264);})[_0x48cc('0x14')](function(_0x45ea36){_0x586b89[_0x48cc('0x38')]=_0x45ea36;return _0x586b89;})[_0x48cc('0x14')](respondWithFilteredResult(_0x57b991,_0x2ba264))[_0x48cc('0x39')](handleError(_0x57b991,null));};exports[_0x48cc('0x3a')]=function(_0x3c030e,_0x10f3da){var _0x24ea98={'raw':![],'where':{'id':_0x3c030e[_0x48cc('0x3b')]['id']}},_0x2741bd={};_0x2741bd[_0x48cc('0x27')]=_[_0x48cc('0x29')](db[_0x48cc('0x36')]['rawAttributes']);_0x2741bd[_0x48cc('0x28')]=_[_0x48cc('0x29')](_0x3c030e[_0x48cc('0x28')]);_0x2741bd[_0x48cc('0x2a')]=_[_0x48cc('0x2c')](_0x2741bd[_0x48cc('0x27')],_0x2741bd[_0x48cc('0x28')]);_0x24ea98[_0x48cc('0x2b')]=_['intersection'](_0x2741bd[_0x48cc('0x27')],qs['fields'](_0x3c030e[_0x48cc('0x28')][_0x48cc('0x2d')]));_0x24ea98['attributes']=_0x24ea98['attributes'][_0x48cc('0x3c')]?_0x24ea98[_0x48cc('0x2b')]:_0x2741bd[_0x48cc('0x27')];if(_0x3c030e[_0x48cc('0x28')]['includeAll']){_0x24ea98['include']=[{'all':!![]}];}_0x24ea98=_[_0x48cc('0x34')]({},_0x24ea98,_0x3c030e[_0x48cc('0x3d')]);return db[_0x48cc('0x36')]['find'](_0x24ea98)[_0x48cc('0x14')](handleEntityNotFound(_0x10f3da,null))[_0x48cc('0x14')](respondWithResult(_0x10f3da,null))[_0x48cc('0x39')](handleError(_0x10f3da,null));};exports['destroy']=function(_0x25de11,_0x4eb025){return db['VoiceExtension'][_0x48cc('0x1f')]({'where':{'id':_0x25de11[_0x48cc('0x3b')]['id']}})[_0x48cc('0x14')](handleEntityNotFound(_0x4eb025,null))[_0x48cc('0x14')](removeEntity(_0x4eb025,null))['catch'](handleError(_0x4eb025,null));};exports[_0x48cc('0x3e')]=function(_0x3db1e9,_0x4e5005){if(_0x3db1e9['body'][_0x48cc('0x1e')]===_0x48cc('0x17')&&!_[_0x48cc('0x3f')](_0x3db1e9[_0x48cc('0x40')]['exten'],'_')){_0x3db1e9[_0x48cc('0x40')][_0x48cc('0x41')]='_'[_0x48cc('0x42')](_0x3db1e9[_0x48cc('0x40')]['exten']);}return db[_0x48cc('0x36')][_0x48cc('0x3e')](_0x3db1e9['body'],{'raw':![]})['then'](function(_0x42ebdc){var _0x1bba14=_0x3db1e9[_0x48cc('0x43')][_0x48cc('0x15')]({'plain':!![]});if(!_0x1bba14)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1bba14['role']===_0x48cc('0x43')){var _0x46d698=_0x42ebdc[_0x48cc('0x15')]({'plain':!![]});var _0x9a8ff8=[{'name':_0x48cc('0x16'),'value':_0x48cc('0x44')},{'name':_0x48cc('0x45'),'value':_0x48cc('0x17')},{'name':_0x48cc('0x18'),'value':_0x48cc('0x19')}];var _0x240b75=_[_0x48cc('0x1f')](_0x9a8ff8,['value',_0x46d698['type']])[_0x48cc('0x20')];return db[_0x48cc('0x46')][_0x48cc('0x1f')]({'where':{'name':_0x240b75,'userProfileId':_0x1bba14['userProfileId']},'raw':!![]})[_0x48cc('0x14')](function(_0x5cd0c9){if(_0x5cd0c9&&_0x5cd0c9['autoAssociation']===0x0){return db[_0x48cc('0x21')][_0x48cc('0x3e')]({'name':_0x46d698[_0x48cc('0x20')],'resourceId':_0x46d698['id'],'type':_0x5cd0c9[_0x48cc('0x20')],'sectionId':_0x5cd0c9['id']},{})['then'](function(){return _0x42ebdc;});}else{return _0x42ebdc;}})[_0x48cc('0x39')](function(_0x35f937){logger[_0x48cc('0x24')](_0x48cc('0x47'),_0x35f937);throw _0x35f937;});}return _0x42ebdc;})['then'](respondWithResult(_0x4e5005,0xc9))[_0x48cc('0x39')](handleError(_0x4e5005,null));};exports[_0x48cc('0x48')]=function(_0xf7b7e2,_0x245a3a){if(_0xf7b7e2['body']['id']){delete _0xf7b7e2[_0x48cc('0x40')]['id'];}return db[_0x48cc('0x36')][_0x48cc('0x1f')]({'where':{'id':_0xf7b7e2[_0x48cc('0x3b')]['id']}})[_0x48cc('0x14')](handleEntityNotFound(_0x245a3a,null))[_0x48cc('0x14')](function(_0x12be1e){if(_0x12be1e){return db[_0x48cc('0x36')][_0x48cc('0x48')](_[_0x48cc('0x32')](_0xf7b7e2[_0x48cc('0x40')],[_0x48cc('0x41'),_0x48cc('0x49'),_0x48cc('0x4a'),_0x48cc('0x4b'),_0x48cc('0x4c'),_0x48cc('0x4d'),_0x48cc('0x4e')]),{'where':{'context':_0x12be1e[_0x48cc('0x49')],'exten':_0x12be1e[_0x48cc('0x41')]},'individualHooks':!![]})['then'](function(_0x402965){return _0x402965;});}return null;})[_0x48cc('0x14')](respondWithStatusCode(_0x245a3a,null))[_0x48cc('0x39')](handleError(_0x245a3a,null));};exports[_0x48cc('0x4f')]=function(_0x3c4ac6,_0x3d8ae2){var _0xa58d81=_0x3c4ac6[_0x48cc('0x3b')]['id'];var _0x5645e2=_0x3c4ac6[_0x48cc('0x40')];var _0x2a369d=0xc8;var _0x10aa9f=null;return db[_0x48cc('0x50')][_0x48cc('0x51')]({'isolationLevel':db[_0x48cc('0x50')][_0x48cc('0x52')]['ISOLATION_LEVELS'][_0x48cc('0x53')]},function(_0x4020a9){return db['VoiceExtension'][_0x48cc('0x54')]({'where':{'id':_0xa58d81},'transaction':_0x4020a9})[_0x48cc('0x14')](function(_0x38c0d5){if(_0x38c0d5){return db[_0x48cc('0x36')]['destroy']({'where':{'VoiceExtensionId':_0xa58d81},'transaction':_0x4020a9})[_0x48cc('0x14')](function(){var _0x3f67ff=_['map'](_0x5645e2,function(_0x54eed3){_0x54eed3['VoiceExtensionId']=_0xa58d81;_0x54eed3[_0x48cc('0x55')]=!![];return _0x54eed3;});return _0x38c0d5[_0x48cc('0x56')](_0x3f67ff);})[_0x48cc('0x14')](function(_0x570853){return db['VoiceExtension'][_0x48cc('0x57')](_0x570853,{'transaction':_0x4020a9});});}else{_0x2a369d=0x194;_0x10aa9f=[];}});})[_0x48cc('0x14')](function(){if(_0x2a369d!==0x194){return db[_0x48cc('0x36')][_0x48cc('0x58')]({'where':{'isApp':!![],'VoiceExtensionId':_0xa58d81},'order':_0x48cc('0x59')})['then'](function(_0x5124f7){_0x10aa9f=_0x5124f7;});}})[_0x48cc('0x39')](function(_0x286758){_0x2a369d=0x1f4;logger['error'](_0x286758[_0x48cc('0x25')]);if(_0x286758['name']){delete _0x286758['name'];}_0x10aa9f=_0x286758;})[_0x48cc('0x5a')](function(){if(_0x10aa9f===null){_0x3d8ae2[_0x48cc('0x23')](_0x2a369d);}else{if(_0x2a369d===0x1f4){_0x3d8ae2[_0x48cc('0xb')](_0x2a369d)[_0x48cc('0x26')](_0x10aa9f);}else{_0x3d8ae2[_0x48cc('0xb')](_0x2a369d)[_0x48cc('0xd')](_0x10aa9f);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 82e251f..2dfb4c4 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 _0x9a63=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x11f7e2,_0x332304){var _0x236c98=function(_0x13942d){while(--_0x13942d){_0x11f7e2['push'](_0x11f7e2['shift']());}};_0x236c98(++_0x332304);}(_0x9a63,0x11c));var _0x39a6=function(_0x161f85,_0x1b1968){_0x161f85=_0x161f85-0x0;var _0x3f98ad=_0x9a63[_0x161f85];return _0x3f98ad;};'use strict';var EventEmitter=require(_0x39a6('0x0'));var VoiceExtension=require(_0x39a6('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x39a6('0x2')](0x0);var events={'afterCreate':_0x39a6('0x3'),'afterUpdate':_0x39a6('0x4'),'afterDestroy':_0x39a6('0x5')};function emitEvent(_0x3055de){return function(_0x504f29,_0x5ee2ca,_0x410723){VoiceExtensionEvents[_0x39a6('0x6')](_0x3055de+':'+_0x504f29['id'],_0x504f29);VoiceExtensionEvents['emit'](_0x3055de,_0x504f29);_0x410723(null);};}for(var e in events){if(events[_0x39a6('0x7')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0x39a6('0x8')]=VoiceExtensionEvents; \ No newline at end of file +var _0xc9f7=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceExtension','setMaxListeners','save','update'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0xc9f7,0x1de));var _0x7c9f=function(_0x36a672,_0x19252e){_0x36a672=_0x36a672-0x0;var _0x2050e4=_0xc9f7[_0x36a672];return _0x2050e4;};'use strict';var EventEmitter=require(_0x7c9f('0x0'));var VoiceExtension=require(_0x7c9f('0x1'))['db'][_0x7c9f('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x7c9f('0x3')](0x0);var events={'afterCreate':_0x7c9f('0x4'),'afterUpdate':_0x7c9f('0x5'),'afterDestroy':_0x7c9f('0x6')};function emitEvent(_0x3c6c13){return function(_0x1e129b,_0x4f026f,_0x495266){VoiceExtensionEvents[_0x7c9f('0x7')](_0x3c6c13+':'+_0x1e129b['id'],_0x1e129b);VoiceExtensionEvents[_0x7c9f('0x7')](_0x3c6c13,_0x1e129b);_0x495266(null);};}for(var e in events){if(events[_0x7c9f('0x8')](e)){var event=events[e];VoiceExtension[_0x7c9f('0x9')](e,emitEvent(event));}}module[_0x7c9f('0xa')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index ace7390..6ecfd5c 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 _0x1636=['callerID','NoOp(No\x20number\x20available)','answer','queue','app','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','appType','outboundDial','appdata','priority','concat','last','catch','define','voice_extensions','get','Hangup','lodash','exports','models','type','Set','context','exten','alias','CDR(routeAlias)=','push','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','No\x20alias\x20set','CDR(destination)=','cutdigits','${EXTEN}','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-PROGRESS=0','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','trunk','timeout','options','split','param','phone','prefix','${EXTEN:','SIP','indexOf','U(xcally-mixmonitor-context)','replace','join','isEmpty','Interval','findAll','interval','then','*,*,*,*','intervals','IntervalId','map','toLowerCase','tag','CDR(tag)=','length','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','Set(CALLERID(all)='];(function(_0x3c6b3b,_0x1f1829){var _0x5e32e6=function(_0x23357e){while(--_0x23357e){_0x3c6b3b['push'](_0x3c6b3b['shift']());}};_0x5e32e6(++_0x1f1829);}(_0x1636,0x1b1));var _0x6163=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x1636[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x6163('0x0'));var attributes=require('./voiceExtension.attributes');module[_0x6163('0x1')]=function(_0x4afed3){var _0x200b8f=_0x4afed3[_0x6163('0x2')];function _0x3fe254(_0x4f208e){var _0x5d81b6=0x2;var _0x3fb2c5=[{'type':_0x4f208e[_0x6163('0x3')],'app':_0x6163('0x4'),'appdata':'CDR(type)='+_0x4f208e[_0x6163('0x3')],'context':_0x4f208e[_0x6163('0x5')],'exten':_0x4f208e[_0x6163('0x6')],'priority':_0x5d81b6++,'VoiceExtensionId':_0x4f208e['id']},{'type':_0x4f208e[_0x6163('0x3')],'app':_0x4f208e[_0x6163('0x7')]?_0x6163('0x4'):'NoOp','appdata':_0x4f208e[_0x6163('0x7')]?_0x6163('0x8')+_0x4f208e[_0x6163('0x7')]:'No\x20alias\x20set','context':_0x4f208e[_0x6163('0x5')],'exten':_0x4f208e[_0x6163('0x6')],'priority':_0x5d81b6++,'VoiceExtensionId':_0x4f208e['id']}];if(_0x4f208e[_0x6163('0x3')]==='inbound'){_0x3fb2c5[_0x6163('0x9')]({'type':'inbound','app':_0x6163('0x4'),'appdata':'CDR(routeid)='+_0x4f208e['id'],'context':_0x4f208e[_0x6163('0x5')],'exten':_0x4f208e['exten'],'priority':_0x5d81b6++,'VoiceExtensionId':_0x4f208e['id']});}_0x3fb2c5[_0x6163('0x9')]({'type':_0x4f208e[_0x6163('0x3')],'app':_0x6163('0x4'),'appdata':_0x6163('0xa'),'context':_0x4f208e[_0x6163('0x5')],'exten':_0x4f208e['exten'],'priority':_0x5d81b6++,'VoiceExtensionId':_0x4f208e['id']},{'type':_0x4f208e[_0x6163('0x3')],'app':_0x6163('0x4'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x4f208e[_0x6163('0x5')],'exten':_0x4f208e['exten'],'priority':_0x5d81b6++,'VoiceExtensionId':_0x4f208e['id']},{'type':_0x4f208e[_0x6163('0x3')],'app':_0x6163('0x4'),'appdata':_0x6163('0xb'),'context':_0x4f208e[_0x6163('0x5')],'exten':_0x4f208e[_0x6163('0x6')],'priority':_0x5d81b6++,'VoiceExtensionId':_0x4f208e['id']});return _0x3fb2c5;}function _0x250e6e(_0x509fb0){var _0x14ded4=0x2;var _0x104521=[{'type':_0x6163('0xc'),'app':'Set','appdata':_0x6163('0xd'),'context':_0x509fb0[_0x6163('0x5')],'exten':_0x509fb0['exten'],'priority':_0x14ded4++,'VoiceExtensionId':_0x509fb0['id']},{'type':_0x6163('0xc'),'app':_0x509fb0[_0x6163('0x7')]?_0x6163('0x4'):'NoOp','appdata':_0x509fb0[_0x6163('0x7')]?_0x6163('0x8')+_0x509fb0[_0x6163('0x7')]:_0x6163('0xe'),'context':_0x509fb0[_0x6163('0x5')],'exten':_0x509fb0[_0x6163('0x6')],'priority':_0x14ded4++,'VoiceExtensionId':_0x509fb0['id']},{'type':'outbound','app':_0x6163('0x4'),'appdata':_0x6163('0xf')+(_0x509fb0[_0x6163('0x10')]?'${EXTEN:'+_0x509fb0[_0x6163('0x10')]+'}':_0x6163('0x11')),'context':_0x509fb0[_0x6163('0x5')],'exten':_0x509fb0[_0x6163('0x6')],'priority':_0x14ded4++,'VoiceExtensionId':_0x509fb0['id']},{'type':_0x6163('0xc'),'app':_0x6163('0x4'),'appdata':_0x6163('0x12')+_0x509fb0['id'],'context':_0x509fb0['context'],'exten':_0x509fb0['exten'],'priority':_0x14ded4++,'VoiceExtensionId':_0x509fb0['id']},{'type':_0x6163('0xc'),'app':_0x6163('0x13'),'appdata':_0x6163('0x14')+(_0x14ded4+0x2)+_0x6163('0x15')+(_0x14ded4+0x1)+')','context':_0x509fb0[_0x6163('0x5')],'exten':_0x509fb0['exten'],'priority':_0x14ded4++,'VoiceExtensionId':_0x509fb0['id']},{'type':'outbound','app':_0x6163('0x4'),'appdata':_0x509fb0['cutdigits']?_0x6163('0x16')+_0x509fb0[_0x6163('0x10')]+'}':_0x6163('0x17'),'context':_0x509fb0[_0x6163('0x5')],'exten':_0x509fb0['exten'],'priority':_0x14ded4++,'VoiceExtensionId':_0x509fb0['id']},{'type':_0x6163('0xc'),'app':_0x6163('0x4'),'appdata':_0x6163('0xa'),'context':_0x509fb0[_0x6163('0x5')],'exten':_0x509fb0[_0x6163('0x6')],'priority':_0x14ded4++,'VoiceExtensionId':_0x509fb0['id']},{'type':'outbound','app':_0x6163('0x4'),'appdata':_0x6163('0x18'),'context':_0x509fb0['context'],'exten':_0x509fb0[_0x6163('0x6')],'priority':_0x14ded4++,'VoiceExtensionId':_0x509fb0['id']},{'type':_0x6163('0xc'),'app':'Set','appdata':_0x6163('0xb'),'context':_0x509fb0['context'],'exten':_0x509fb0[_0x6163('0x6')],'priority':_0x14ded4++,'VoiceExtensionId':_0x509fb0['id']},{'type':_0x6163('0xc'),'app':_0x6163('0x4'),'appdata':_0x6163('0x19')+_0x509fb0['id'],'context':_0x509fb0[_0x6163('0x5')],'exten':_0x509fb0[_0x6163('0x6')],'priority':_0x14ded4++,'VoiceExtensionId':_0x509fb0['id']}];if(_0x509fb0[_0x6163('0x1a')](_0x6163('0x1b'))&&_0x509fb0[_0x6163('0x1b')]!==_0x6163('0x1c')){_0x104521['push']({'type':_0x6163('0xc'),'app':_0x6163('0x4'),'appdata':_0x6163('0x1d'),'context':_0x509fb0[_0x6163('0x5')],'exten':_0x509fb0['exten'],'priority':_0x14ded4++,'VoiceExtensionId':_0x509fb0['id']},{'type':_0x6163('0xc'),'app':_0x6163('0x4'),'appdata':_0x6163('0x1e')+_0x509fb0[_0x6163('0x1b')]||'wav','context':_0x509fb0[_0x6163('0x5')],'exten':_0x509fb0[_0x6163('0x6')],'priority':_0x14ded4++,'VoiceExtensionId':_0x509fb0['id']});}return _0x104521;}function _0x23c524(_0x16fc9f,_0x2a8359){var _0x14b5f2=[{'name':_0x6163('0x1f'),'param':0x0},{'name':_0x6163('0x20'),'param':0x1},{'name':_0x6163('0x21'),'param':0x2},{'name':'url','param':0x3}];var _0x109d0f={};var _0x5256f1=_0x2a8359[_0x6163('0x22')](',');var _0x563286=[];for(var _0x32bebf=0x0;_0x32bebf<_0x14b5f2['length'];_0x32bebf++){switch(_0x14b5f2[_0x32bebf]['name']){case _0x6163('0x1f'):_0x109d0f[_0x6163('0x1f')]=_0x5256f1[_0x14b5f2[_0x32bebf][_0x6163('0x23')]]['split']('/')[0x1];_0x109d0f[_0x6163('0x24')]=_0x5256f1[_0x14b5f2[_0x32bebf][_0x6163('0x23')]][_0x6163('0x22')]('/')[0x2];_0x109d0f[_0x6163('0x25')]=_0x109d0f[_0x6163('0x24')]?_0x109d0f[_0x6163('0x24')][_0x6163('0x22')]('$')[0x0]:undefined;_0x109d0f[_0x6163('0x24')]=_0x16fc9f['cutdigits']?(_0x109d0f['prefix']||'')+_0x6163('0x26')+_0x16fc9f[_0x6163('0x10')]+'}':(_0x109d0f[_0x6163('0x25')]||'')+_0x6163('0x11');_0x563286[_0x14b5f2[_0x32bebf][_0x6163('0x23')]]=[_0x6163('0x27'),_0x109d0f['trunk'],_0x109d0f[_0x6163('0x24')]]['join']('/');break;case _0x6163('0x21'):_0x109d0f[_0x6163('0x21')]=_0x5256f1[_0x14b5f2[_0x32bebf]['param']];if(_0x16fc9f[_0x6163('0x1b')]!==_0x6163('0x1c')){if(_0x109d0f[_0x6163('0x21')][_0x6163('0x28')]('U(xcally-mixmonitor-context)')<0x0){_0x109d0f[_0x6163('0x21')]+=_0x6163('0x29');}}else{_0x109d0f['options']=_0x109d0f[_0x6163('0x21')][_0x6163('0x2a')](_0x6163('0x29'),'');}_0x563286[_0x14b5f2[_0x32bebf][_0x6163('0x23')]]=_0x109d0f[_0x6163('0x21')];break;default:_0x563286[_0x14b5f2[_0x32bebf]['param']]=_0x5256f1[_0x14b5f2[_0x32bebf][_0x6163('0x23')]];}}return _0x563286[_0x6163('0x2b')](',');}function _0x52a2da(_0x249c77,_0x3ef1a4,_0x1f7da3){return new Promise(function(_0x24f780,_0x1d0adb){var _0x57bd1e=[];if(_[_0x6163('0x2c')](_0x3ef1a4))return _0x24f780(_0x57bd1e);_0x200b8f[_0x6163('0x2d')][_0x6163('0x2e')]({'attributes':['id',_0x6163('0x2f'),'IntervalId'],'raw':!![]})[_0x6163('0x30')](function(_0x328604){for(var _0x5b8396=0x0,_0x19c415=0x0;_0x5b8396<_0x3ef1a4['length'];_0x5b8396++,_0x19c415=0x0){var _0x46e5e6=_0x3ef1a4[_0x5b8396];var _0x20458f=[];var _0x3d8656=[];delete _0x46e5e6['id'];if(_0x46e5e6[_0x6163('0x2f')]!==_0x6163('0x31')){_0x46e5e6[_0x6163('0x32')]=[_0x46e5e6[_0x6163('0x2f')]];}else{_0x46e5e6['intervals']=_0x46e5e6[_0x6163('0x33')]?_[_0x6163('0x34')](_['filter'](_0x328604,{'IntervalId':_0x46e5e6[_0x6163('0x33')]}),_0x6163('0x2f')):[];}_0x46e5e6['context']=_0x249c77['context'];_0x46e5e6[_0x6163('0x6')]=_0x249c77[_0x6163('0x6')];if(_0x46e5e6[_0x6163('0x3')])_0x46e5e6[_0x6163('0x3')]=_0x46e5e6['type'][_0x6163('0x35')]();if(_0x249c77[_0x6163('0x3')]===_0x6163('0xc')){if(_0x46e5e6[_0x6163('0x1a')](_0x6163('0x36'))&&_0x46e5e6['tag']&&_0x46e5e6[_0x6163('0x36')]!=='--'){_0x20458f[_0x6163('0x9')]({'type':_0x46e5e6[_0x6163('0x3')][_0x6163('0x35')](),'app':_0x6163('0x4'),'appdata':_0x6163('0x37')+_0x46e5e6[_0x6163('0x36')],'context':_0x249c77[_0x6163('0x5')],'exten':_0x249c77[_0x6163('0x6')],'priority':_0x46e5e6[_0x6163('0x32')][_0x6163('0x38')]+_0x1f7da3+_0x19c415++,'VoiceExtensionId':_0x249c77['id']});}_0x20458f[_0x6163('0x9')]({'type':_0x46e5e6['type'][_0x6163('0x35')](),'app':_0x6163('0x13'),'appdata':_0x6163('0x39')+(_0x46e5e6['callerID']?_0x6163('0x3a')+_0x46e5e6[_0x6163('0x3b')]+')':_0x6163('0x3c')),'context':_0x249c77['context'],'exten':_0x249c77[_0x6163('0x6')],'priority':_0x46e5e6[_0x6163('0x32')][_0x6163('0x38')]+_0x1f7da3+_0x19c415++,'VoiceExtensionId':_0x249c77['id']});}else{if(_0x46e5e6[_0x6163('0x1a')](_0x6163('0x3d'))){if([_0x6163('0x3e'),'playback']['includes'](_0x46e5e6[_0x6163('0x3f')][_0x6163('0x35')]())&&_0x46e5e6['appType']!=='custom'){if(_0x46e5e6[_0x6163('0x3d')]){_0x20458f['push']({'type':_0x46e5e6['type'][_0x6163('0x35')](),'app':_0x6163('0x13'),'appdata':_0x6163('0x40'),'context':_0x249c77[_0x6163('0x5')],'exten':_0x249c77['exten'],'priority':_0x46e5e6[_0x6163('0x32')][_0x6163('0x38')]+_0x1f7da3+_0x19c415++,'VoiceExtensionId':_0x249c77['id']});_0x20458f['push']({'type':_0x46e5e6[_0x6163('0x3')][_0x6163('0x35')](),'app':'Set','appdata':_0x6163('0x41'),'context':_0x249c77['context'],'exten':_0x249c77[_0x6163('0x6')],'priority':_0x46e5e6[_0x6163('0x32')][_0x6163('0x38')]+_0x1f7da3+_0x19c415++,'VoiceExtensionId':_0x249c77['id']});}else{_0x20458f[_0x6163('0x9')]({'type':_0x46e5e6[_0x6163('0x3')][_0x6163('0x35')](),'app':_0x6163('0x13'),'appdata':_0x6163('0x42'),'context':_0x249c77[_0x6163('0x5')],'exten':_0x249c77[_0x6163('0x6')],'priority':_0x46e5e6[_0x6163('0x32')][_0x6163('0x38')]+_0x1f7da3+_0x19c415++,'VoiceExtensionId':_0x249c77['id']});_0x20458f[_0x6163('0x9')]({'type':_0x46e5e6[_0x6163('0x3')][_0x6163('0x35')](),'app':_0x6163('0x4'),'appdata':_0x6163('0x43'),'context':_0x249c77[_0x6163('0x5')],'exten':_0x249c77['exten'],'priority':_0x46e5e6[_0x6163('0x32')][_0x6163('0x38')]+_0x1f7da3+_0x19c415++,'VoiceExtensionId':_0x249c77['id']});}}}}for(var _0x244377=0x0;_0x244377<_0x46e5e6[_0x6163('0x32')][_0x6163('0x38')];_0x244377++){var _0x64ad36=_0x1f7da3+_0x46e5e6[_0x6163('0x32')][_0x6163('0x38')];var _0x256b8d=_0x244377===_0x46e5e6[_0x6163('0x32')][_0x6163('0x38')]-0x1?_0x1f7da3+_0x20458f[_0x6163('0x38')]+_0x3d8656[_0x6163('0x38')]+0x2:_0x1f7da3+_0x244377+0x1;_0x20458f[_0x6163('0x44')](_0x244377,0x0,{'type':_0x249c77[_0x6163('0x3')],'app':_0x6163('0x45'),'appdata':_0x46e5e6[_0x6163('0x32')][_0x244377]+'?'+_0x249c77['context']+_0x6163('0x46')+_0x64ad36+':'+_0x249c77[_0x6163('0x5')]+_0x6163('0x46')+_0x256b8d,'exten':_0x249c77[_0x6163('0x6')],'context':_0x249c77[_0x6163('0x5')],'priority':_0x1f7da3+_0x244377,'VoiceExtensionId':_0x249c77['id']});}if(_0x46e5e6[_0x6163('0x47')]===_0x6163('0x48'))_0x46e5e6[_0x6163('0x49')]=_0x23c524(_0x249c77,_0x46e5e6[_0x6163('0x49')]);_0x46e5e6['priority']=_0x20458f[_0x6163('0x38')]?_['last'](_0x20458f)[_0x6163('0x4a')]+0x1:_0x1f7da3;_0x57bd1e=_[_0x6163('0x4b')](_0x57bd1e,_0x20458f,[_0x46e5e6],_0x3d8656);_0x1f7da3=_[_0x6163('0x4c')](_0x57bd1e)[_0x6163('0x4a')]+0x1;}return _0x24f780(_0x57bd1e);})[_0x6163('0x4d')](function(_0x5388b4){_0x1d0adb(_0x5388b4);});});}return _0x4afed3[_0x6163('0x4e')]('VoiceExtension',attributes,{'tableName':_0x6163('0x4f'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x4b11e2){var _0x43fbb0=this[_0x6163('0x50')]({'plain':!![]});var _0x35b9e7=_0x43fbb0[_0x6163('0x3')]===_0x6163('0xc')?_0x250e6e(_0x43fbb0):_0x3fe254(_0x43fbb0);return _0x52a2da(_0x43fbb0,_0x4b11e2,_['last'](_0x35b9e7)[_0x6163('0x4a')]+0x1)[_0x6163('0x30')](function(_0x11ae70){var _0x314c97=_[_0x6163('0x4b')](_0x35b9e7,_0x11ae70);_0x314c97[_0x6163('0x9')]({'type':_0x43fbb0[_0x6163('0x3')],'app':_0x6163('0x51'),'exten':_0x43fbb0[_0x6163('0x6')],'context':_0x43fbb0['context'],'priority':_[_0x6163('0x4c')](_0x314c97)['priority']+0x1,'VoiceExtensionId':_0x43fbb0['id']});return _0x314c97;});}}});}; \ No newline at end of file +var _0xeec6=['then','length','interval','*,*,*,*','intervals','IntervalId','map','filter','toLowerCase','hasOwnProperty','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','app','appType','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','outboundDial','appdata','priority','concat','last','catch','define','VoiceExtension','voice_extensions','get','lodash','./voiceExtension.attributes','exports','models','type','CDR(type)=','exten','alias','Set','CDR(routeAlias)=','inbound','context','push','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','NoOp','No\x20alias\x20set','cutdigits','${EXTEN:','${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=','trunk','timeout','options','url','split','name','param','prefix','phone','SIP','indexOf','U(xcally-mixmonitor-context)','isEmpty','Interval','findAll'];(function(_0xdb6458,_0x46ca9b){var _0x6014ec=function(_0x1fe58b){while(--_0x1fe58b){_0xdb6458['push'](_0xdb6458['shift']());}};_0x6014ec(++_0x46ca9b);}(_0xeec6,0x1c2));var _0x6eec=function(_0x26d386,_0x1660c0){_0x26d386=_0x26d386-0x0;var _0x4ef9a8=_0xeec6[_0x26d386];return _0x4ef9a8;};'use strict';var _=require(_0x6eec('0x0'));var attributes=require(_0x6eec('0x1'));module[_0x6eec('0x2')]=function(_0x33cc53){var _0x535568=_0x33cc53[_0x6eec('0x3')];function _0x3e4f10(_0x1699ce){var _0x2d7a15=0x2;var _0x3e7b6b=[{'type':_0x1699ce[_0x6eec('0x4')],'app':'Set','appdata':_0x6eec('0x5')+_0x1699ce[_0x6eec('0x4')],'context':_0x1699ce['context'],'exten':_0x1699ce[_0x6eec('0x6')],'priority':_0x2d7a15++,'VoiceExtensionId':_0x1699ce['id']},{'type':_0x1699ce[_0x6eec('0x4')],'app':_0x1699ce[_0x6eec('0x7')]?_0x6eec('0x8'):'NoOp','appdata':_0x1699ce[_0x6eec('0x7')]?_0x6eec('0x9')+_0x1699ce[_0x6eec('0x7')]:'No\x20alias\x20set','context':_0x1699ce['context'],'exten':_0x1699ce['exten'],'priority':_0x2d7a15++,'VoiceExtensionId':_0x1699ce['id']}];if(_0x1699ce[_0x6eec('0x4')]===_0x6eec('0xa')){_0x3e7b6b['push']({'type':'inbound','app':_0x6eec('0x8'),'appdata':'CDR(routeid)='+_0x1699ce['id'],'context':_0x1699ce[_0x6eec('0xb')],'exten':_0x1699ce[_0x6eec('0x6')],'priority':_0x2d7a15++,'VoiceExtensionId':_0x1699ce['id']});}_0x3e7b6b[_0x6eec('0xc')]({'type':_0x1699ce[_0x6eec('0x4')],'app':_0x6eec('0x8'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x1699ce[_0x6eec('0xb')],'exten':_0x1699ce[_0x6eec('0x6')],'priority':_0x2d7a15++,'VoiceExtensionId':_0x1699ce['id']},{'type':_0x1699ce[_0x6eec('0x4')],'app':_0x6eec('0x8'),'appdata':_0x6eec('0xd'),'context':_0x1699ce[_0x6eec('0xb')],'exten':_0x1699ce[_0x6eec('0x6')],'priority':_0x2d7a15++,'VoiceExtensionId':_0x1699ce['id']},{'type':_0x1699ce[_0x6eec('0x4')],'app':_0x6eec('0x8'),'appdata':_0x6eec('0xe'),'context':_0x1699ce['context'],'exten':_0x1699ce[_0x6eec('0x6')],'priority':_0x2d7a15++,'VoiceExtensionId':_0x1699ce['id']});return _0x3e7b6b;}function _0x5f1f33(_0x38c9a4){var _0x45aa3f=0x2;var _0x512619=[{'type':_0x6eec('0xf'),'app':_0x6eec('0x8'),'appdata':_0x6eec('0x10'),'context':_0x38c9a4['context'],'exten':_0x38c9a4[_0x6eec('0x6')],'priority':_0x45aa3f++,'VoiceExtensionId':_0x38c9a4['id']},{'type':_0x6eec('0xf'),'app':_0x38c9a4[_0x6eec('0x7')]?_0x6eec('0x8'):_0x6eec('0x11'),'appdata':_0x38c9a4[_0x6eec('0x7')]?'CDR(routeAlias)='+_0x38c9a4[_0x6eec('0x7')]:_0x6eec('0x12'),'context':_0x38c9a4[_0x6eec('0xb')],'exten':_0x38c9a4[_0x6eec('0x6')],'priority':_0x45aa3f++,'VoiceExtensionId':_0x38c9a4['id']},{'type':_0x6eec('0xf'),'app':_0x6eec('0x8'),'appdata':'CDR(destination)='+(_0x38c9a4[_0x6eec('0x13')]?_0x6eec('0x14')+_0x38c9a4[_0x6eec('0x13')]+'}':_0x6eec('0x15')),'context':_0x38c9a4[_0x6eec('0xb')],'exten':_0x38c9a4[_0x6eec('0x6')],'priority':_0x45aa3f++,'VoiceExtensionId':_0x38c9a4['id']},{'type':'outbound','app':_0x6eec('0x8'),'appdata':_0x6eec('0x16')+_0x38c9a4['id'],'context':_0x38c9a4[_0x6eec('0xb')],'exten':_0x38c9a4[_0x6eec('0x6')],'priority':_0x45aa3f++,'VoiceExtensionId':_0x38c9a4['id']},{'type':_0x6eec('0xf'),'app':_0x6eec('0x17'),'appdata':_0x6eec('0x18')+(_0x45aa3f+0x2)+_0x6eec('0x19')+(_0x45aa3f+0x1)+')','context':_0x38c9a4[_0x6eec('0xb')],'exten':_0x38c9a4['exten'],'priority':_0x45aa3f++,'VoiceExtensionId':_0x38c9a4['id']},{'type':_0x6eec('0xf'),'app':_0x6eec('0x8'),'appdata':_0x38c9a4[_0x6eec('0x13')]?_0x6eec('0x1a')+_0x38c9a4['cutdigits']+'}':_0x6eec('0x1b'),'context':_0x38c9a4[_0x6eec('0xb')],'exten':_0x38c9a4['exten'],'priority':_0x45aa3f++,'VoiceExtensionId':_0x38c9a4['id']},{'type':'outbound','app':_0x6eec('0x8'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x38c9a4[_0x6eec('0xb')],'exten':_0x38c9a4[_0x6eec('0x6')],'priority':_0x45aa3f++,'VoiceExtensionId':_0x38c9a4['id']},{'type':_0x6eec('0xf'),'app':_0x6eec('0x8'),'appdata':_0x6eec('0xd'),'context':_0x38c9a4[_0x6eec('0xb')],'exten':_0x38c9a4[_0x6eec('0x6')],'priority':_0x45aa3f++,'VoiceExtensionId':_0x38c9a4['id']},{'type':_0x6eec('0xf'),'app':_0x6eec('0x8'),'appdata':_0x6eec('0xe'),'context':_0x38c9a4['context'],'exten':_0x38c9a4[_0x6eec('0x6')],'priority':_0x45aa3f++,'VoiceExtensionId':_0x38c9a4['id']},{'type':'outbound','app':_0x6eec('0x8'),'appdata':_0x6eec('0x1c')+_0x38c9a4['id'],'context':_0x38c9a4[_0x6eec('0xb')],'exten':_0x38c9a4['exten'],'priority':_0x45aa3f++,'VoiceExtensionId':_0x38c9a4['id']}];if(_0x38c9a4['hasOwnProperty']('recordingFormat')&&_0x38c9a4[_0x6eec('0x1d')]!==_0x6eec('0x1e')){_0x512619[_0x6eec('0xc')]({'type':_0x6eec('0xf'),'app':_0x6eec('0x8'),'appdata':_0x6eec('0x1f'),'context':_0x38c9a4[_0x6eec('0xb')],'exten':_0x38c9a4[_0x6eec('0x6')],'priority':_0x45aa3f++,'VoiceExtensionId':_0x38c9a4['id']},{'type':_0x6eec('0xf'),'app':_0x6eec('0x8'),'appdata':_0x6eec('0x20')+_0x38c9a4[_0x6eec('0x1d')]||'wav','context':_0x38c9a4[_0x6eec('0xb')],'exten':_0x38c9a4[_0x6eec('0x6')],'priority':_0x45aa3f++,'VoiceExtensionId':_0x38c9a4['id']});}return _0x512619;}function _0x2c83d1(_0x47e169,_0x2ce8c3){var _0x193732=[{'name':_0x6eec('0x21'),'param':0x0},{'name':_0x6eec('0x22'),'param':0x1},{'name':_0x6eec('0x23'),'param':0x2},{'name':_0x6eec('0x24'),'param':0x3}];var _0x4a7699={};var _0x45cfb6=_0x2ce8c3[_0x6eec('0x25')](',');var _0x2f18e9=[];for(var _0x5128ac=0x0;_0x5128ac<_0x193732['length'];_0x5128ac++){switch(_0x193732[_0x5128ac][_0x6eec('0x26')]){case _0x6eec('0x21'):_0x4a7699[_0x6eec('0x21')]=_0x45cfb6[_0x193732[_0x5128ac][_0x6eec('0x27')]][_0x6eec('0x25')]('/')[0x1];_0x4a7699['phone']=_0x45cfb6[_0x193732[_0x5128ac][_0x6eec('0x27')]][_0x6eec('0x25')]('/')[0x2];_0x4a7699[_0x6eec('0x28')]=_0x4a7699[_0x6eec('0x29')]?_0x4a7699[_0x6eec('0x29')][_0x6eec('0x25')]('$')[0x0]:undefined;_0x4a7699[_0x6eec('0x29')]=_0x47e169[_0x6eec('0x13')]?(_0x4a7699['prefix']||'')+_0x6eec('0x14')+_0x47e169[_0x6eec('0x13')]+'}':(_0x4a7699['prefix']||'')+'${EXTEN}';_0x2f18e9[_0x193732[_0x5128ac][_0x6eec('0x27')]]=[_0x6eec('0x2a'),_0x4a7699[_0x6eec('0x21')],_0x4a7699[_0x6eec('0x29')]]['join']('/');break;case'options':_0x4a7699[_0x6eec('0x23')]=_0x45cfb6[_0x193732[_0x5128ac]['param']];if(_0x47e169['recordingFormat']!==_0x6eec('0x1e')){if(_0x4a7699[_0x6eec('0x23')][_0x6eec('0x2b')](_0x6eec('0x2c'))<0x0){_0x4a7699[_0x6eec('0x23')]+='U(xcally-mixmonitor-context)';}}else{_0x4a7699[_0x6eec('0x23')]=_0x4a7699[_0x6eec('0x23')]['replace'](_0x6eec('0x2c'),'');}_0x2f18e9[_0x193732[_0x5128ac][_0x6eec('0x27')]]=_0x4a7699['options'];break;default:_0x2f18e9[_0x193732[_0x5128ac][_0x6eec('0x27')]]=_0x45cfb6[_0x193732[_0x5128ac][_0x6eec('0x27')]];}}return _0x2f18e9['join'](',');}function _0x21115b(_0xb18b55,_0x258ee7,_0x2681f7){return new Promise(function(_0x52af19,_0x7e6b26){var _0x2f797d=[];if(_[_0x6eec('0x2d')](_0x258ee7))return _0x52af19(_0x2f797d);_0x535568[_0x6eec('0x2e')][_0x6eec('0x2f')]({'attributes':['id','interval','IntervalId'],'raw':!![]})[_0x6eec('0x30')](function(_0x3d5c80){for(var _0x3703b5=0x0,_0x18bcc5=0x0;_0x3703b5<_0x258ee7[_0x6eec('0x31')];_0x3703b5++,_0x18bcc5=0x0){var _0x59d7a7=_0x258ee7[_0x3703b5];var _0x194f2e=[];var _0x545f9d=[];delete _0x59d7a7['id'];if(_0x59d7a7[_0x6eec('0x32')]!==_0x6eec('0x33')){_0x59d7a7[_0x6eec('0x34')]=[_0x59d7a7['interval']];}else{_0x59d7a7[_0x6eec('0x34')]=_0x59d7a7[_0x6eec('0x35')]?_[_0x6eec('0x36')](_[_0x6eec('0x37')](_0x3d5c80,{'IntervalId':_0x59d7a7[_0x6eec('0x35')]}),'interval'):[];}_0x59d7a7[_0x6eec('0xb')]=_0xb18b55['context'];_0x59d7a7['exten']=_0xb18b55[_0x6eec('0x6')];if(_0x59d7a7['type'])_0x59d7a7[_0x6eec('0x4')]=_0x59d7a7[_0x6eec('0x4')][_0x6eec('0x38')]();if(_0xb18b55['type']==='outbound'){if(_0x59d7a7[_0x6eec('0x39')](_0x6eec('0x3a'))&&_0x59d7a7[_0x6eec('0x3a')]&&_0x59d7a7[_0x6eec('0x3a')]!=='--'){_0x194f2e[_0x6eec('0xc')]({'type':_0x59d7a7[_0x6eec('0x4')][_0x6eec('0x38')](),'app':_0x6eec('0x8'),'appdata':_0x6eec('0x3b')+_0x59d7a7[_0x6eec('0x3a')],'context':_0xb18b55['context'],'exten':_0xb18b55['exten'],'priority':_0x59d7a7[_0x6eec('0x34')][_0x6eec('0x31')]+_0x2681f7+_0x18bcc5++,'VoiceExtensionId':_0xb18b55['id']});}_0x194f2e[_0x6eec('0xc')]({'type':_0x59d7a7['type'][_0x6eec('0x38')](),'app':_0x6eec('0x17'),'appdata':_0x6eec('0x3c')+(_0x59d7a7[_0x6eec('0x3d')]?_0x6eec('0x3e')+_0x59d7a7[_0x6eec('0x3d')]+')':_0x6eec('0x3f')),'context':_0xb18b55[_0x6eec('0xb')],'exten':_0xb18b55['exten'],'priority':_0x59d7a7[_0x6eec('0x34')][_0x6eec('0x31')]+_0x2681f7+_0x18bcc5++,'VoiceExtensionId':_0xb18b55['id']});}else{if(_0x59d7a7[_0x6eec('0x39')](_0x6eec('0x40'))){if(['queue','playback']['includes'](_0x59d7a7[_0x6eec('0x41')][_0x6eec('0x38')]())&&_0x59d7a7[_0x6eec('0x42')]!==_0x6eec('0x43')){if(_0x59d7a7['answer']){_0x194f2e['push']({'type':_0x59d7a7[_0x6eec('0x4')][_0x6eec('0x38')](),'app':_0x6eec('0x17'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0xb18b55[_0x6eec('0xb')],'exten':_0xb18b55[_0x6eec('0x6')],'priority':_0x59d7a7[_0x6eec('0x34')][_0x6eec('0x31')]+_0x2681f7+_0x18bcc5++,'VoiceExtensionId':_0xb18b55['id']});_0x194f2e[_0x6eec('0xc')]({'type':_0x59d7a7[_0x6eec('0x4')][_0x6eec('0x38')](),'app':_0x6eec('0x8'),'appdata':_0x6eec('0x44'),'context':_0xb18b55['context'],'exten':_0xb18b55[_0x6eec('0x6')],'priority':_0x59d7a7['intervals'][_0x6eec('0x31')]+_0x2681f7+_0x18bcc5++,'VoiceExtensionId':_0xb18b55['id']});}else{_0x194f2e[_0x6eec('0xc')]({'type':_0x59d7a7[_0x6eec('0x4')][_0x6eec('0x38')](),'app':_0x6eec('0x17'),'appdata':_0x6eec('0x45'),'context':_0xb18b55[_0x6eec('0xb')],'exten':_0xb18b55['exten'],'priority':_0x59d7a7[_0x6eec('0x34')]['length']+_0x2681f7+_0x18bcc5++,'VoiceExtensionId':_0xb18b55['id']});_0x194f2e[_0x6eec('0xc')]({'type':_0x59d7a7['type'][_0x6eec('0x38')](),'app':_0x6eec('0x8'),'appdata':_0x6eec('0x46'),'context':_0xb18b55[_0x6eec('0xb')],'exten':_0xb18b55[_0x6eec('0x6')],'priority':_0x59d7a7[_0x6eec('0x34')][_0x6eec('0x31')]+_0x2681f7+_0x18bcc5++,'VoiceExtensionId':_0xb18b55['id']});}}}}for(var _0x2982a8=0x0;_0x2982a8<_0x59d7a7[_0x6eec('0x34')][_0x6eec('0x31')];_0x2982a8++){var _0x49885e=_0x2681f7+_0x59d7a7['intervals'][_0x6eec('0x31')];var _0x42242d=_0x2982a8===_0x59d7a7[_0x6eec('0x34')][_0x6eec('0x31')]-0x1?_0x2681f7+_0x194f2e[_0x6eec('0x31')]+_0x545f9d['length']+0x2:_0x2681f7+_0x2982a8+0x1;_0x194f2e[_0x6eec('0x47')](_0x2982a8,0x0,{'type':_0xb18b55[_0x6eec('0x4')],'app':'GotoIfTime','appdata':_0x59d7a7['intervals'][_0x2982a8]+'?'+_0xb18b55['context']+_0x6eec('0x48')+_0x49885e+':'+_0xb18b55[_0x6eec('0xb')]+',${EXTEN},'+_0x42242d,'exten':_0xb18b55[_0x6eec('0x6')],'context':_0xb18b55[_0x6eec('0xb')],'priority':_0x2681f7+_0x2982a8,'VoiceExtensionId':_0xb18b55['id']});}if(_0x59d7a7['appType']===_0x6eec('0x49'))_0x59d7a7[_0x6eec('0x4a')]=_0x2c83d1(_0xb18b55,_0x59d7a7[_0x6eec('0x4a')]);_0x59d7a7[_0x6eec('0x4b')]=_0x194f2e['length']?_['last'](_0x194f2e)[_0x6eec('0x4b')]+0x1:_0x2681f7;_0x2f797d=_[_0x6eec('0x4c')](_0x2f797d,_0x194f2e,[_0x59d7a7],_0x545f9d);_0x2681f7=_[_0x6eec('0x4d')](_0x2f797d)[_0x6eec('0x4b')]+0x1;}return _0x52af19(_0x2f797d);})[_0x6eec('0x4e')](function(_0x3d0525){_0x7e6b26(_0x3d0525);});});}return _0x33cc53[_0x6eec('0x4f')](_0x6eec('0x50'),attributes,{'tableName':_0x6eec('0x51'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x416d9a){var _0x42f435=this[_0x6eec('0x52')]({'plain':!![]});var _0x2799ca=_0x42f435[_0x6eec('0x4')]===_0x6eec('0xf')?_0x5f1f33(_0x42f435):_0x3e4f10(_0x42f435);return _0x21115b(_0x42f435,_0x416d9a,_[_0x6eec('0x4d')](_0x2799ca)[_0x6eec('0x4b')]+0x1)['then'](function(_0x2ef374){var _0x2236f7=_['concat'](_0x2799ca,_0x2ef374);_0x2236f7[_0x6eec('0xc')]({'type':_0x42f435[_0x6eec('0x4')],'app':'Hangup','exten':_0x42f435[_0x6eec('0x6')],'context':_0x42f435[_0x6eec('0xb')],'priority':_[_0x6eec('0x4d')](_0x2236f7)[_0x6eec('0x4b')]+0x1,'VoiceExtensionId':_0x42f435['id']});return _0x2236f7;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 46b4bb3..e631003 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 _0x75a2=['request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetVoiceExtension','options','raw','where','attributes','limit','include','map','model','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','redis','defaults','localhost','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s'];(function(_0x119629,_0x246787){var _0x49a771=function(_0x23624c){while(--_0x23624c){_0x119629['push'](_0x119629['shift']());}};_0x49a771(++_0x246787);}(_0x75a2,0x187));var _0x275a=function(_0x22c7bb,_0x4d71dc){_0x22c7bb=_0x22c7bb-0x0;var _0x19c653=_0x75a2[_0x22c7bb];return _0x19c653;};'use strict';var _=require(_0x275a('0x0'));var util=require(_0x275a('0x1'));var moment=require(_0x275a('0x2'));var BPromise=require('bluebird');var rs=require(_0x275a('0x3'));var fs=require('fs');var Redis=require(_0x275a('0x4'));var db=require(_0x275a('0x5'))['db'];var utils=require(_0x275a('0x6'));var logger=require('../../config/logger')(_0x275a('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x275a('0x8')]=_[_0x275a('0x9')](config[_0x275a('0x8')],{'host':_0x275a('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x275a('0xb'))[_0x275a('0xc')](socket);function respondWithRpcPromise(_0x56e1c2,_0x4bb07c,_0x4aaece){return new BPromise(function(_0x2d77df,_0x3961da){return client[_0x275a('0xd')](_0x56e1c2,_0x4aaece)[_0x275a('0xe')](function(_0x59b769){logger[_0x275a('0xf')](_0x275a('0x10'),_0x4bb07c,_0x275a('0x11'));logger[_0x275a('0x12')](_0x275a('0x13'),_0x4bb07c,_0x275a('0x11'),JSON['stringify'](_0x59b769));if(_0x59b769[_0x275a('0x14')]){if(_0x59b769[_0x275a('0x14')]['code']===0x1f4){logger['error'](_0x275a('0x10'),_0x4bb07c,_0x59b769[_0x275a('0x14')][_0x275a('0x15')]);return _0x3961da(_0x59b769[_0x275a('0x14')][_0x275a('0x15')]);}logger[_0x275a('0x14')](_0x275a('0x10'),_0x4bb07c,_0x59b769[_0x275a('0x14')][_0x275a('0x15')]);return _0x2d77df(_0x59b769['error']['message']);}else{logger[_0x275a('0xf')](_0x275a('0x10'),_0x4bb07c,'request\x20sent');_0x2d77df(_0x59b769[_0x275a('0x16')]['message']);}})[_0x275a('0x17')](function(_0x236619){logger['error'](_0x275a('0x10'),_0x4bb07c,_0x236619);_0x3961da(_0x236619);});});}exports[_0x275a('0x18')]=function(_0x4a0ddb){var _0x4fb1ad=this;return new Promise(function(_0x260e41,_0x456c61){return db['VoiceExtension']['findAll']({'raw':_0x4a0ddb['options']?_0x4a0ddb[_0x275a('0x19')][_0x275a('0x1a')]===undefined?!![]:![]:!![],'where':_0x4a0ddb[_0x275a('0x19')]?_0x4a0ddb[_0x275a('0x19')][_0x275a('0x1b')]||null:null,'attributes':_0x4a0ddb['options']?_0x4a0ddb[_0x275a('0x19')][_0x275a('0x1c')]||null:null,'limit':_0x4a0ddb[_0x275a('0x19')]?_0x4a0ddb[_0x275a('0x19')][_0x275a('0x1d')]||null:null,'include':_0x4a0ddb['options']?_0x4a0ddb[_0x275a('0x19')][_0x275a('0x1e')]?_[_0x275a('0x1f')](_0x4a0ddb[_0x275a('0x19')][_0x275a('0x1e')],function(_0x2bfe4d){return{'model':db[_0x2bfe4d[_0x275a('0x20')]],'as':_0x2bfe4d['as'],'attributes':_0x2bfe4d[_0x275a('0x1c')],'include':_0x2bfe4d[_0x275a('0x1e')]?_[_0x275a('0x1f')](_0x2bfe4d['include'],function(_0x3b7fea){return{'model':db[_0x3b7fea[_0x275a('0x20')]],'as':_0x3b7fea['as'],'attributes':_0x3b7fea['attributes'],'include':_0x3b7fea[_0x275a('0x1e')]?_[_0x275a('0x1f')](_0x3b7fea[_0x275a('0x1e')],function(_0xa5048b){return{'model':db[_0xa5048b['model']],'as':_0xa5048b['as'],'attributes':_0xa5048b[_0x275a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x275a('0xe')](function(_0x14b7c5){logger[_0x275a('0xf')](_0x275a('0x18'),_0x4a0ddb);logger[_0x275a('0x12')](_0x275a('0x18'),_0x4a0ddb,JSON[_0x275a('0x21')](_0x14b7c5));_0x260e41(_0x14b7c5);})[_0x275a('0x17')](function(_0x2b4683){logger['error'](_0x275a('0x18'),_0x2b4683[_0x275a('0x15')],_0x4a0ddb);_0x456c61(_0x4fb1ad['error'](0x1f4,_0x2b4683[_0x275a('0x15')]));});});}; \ No newline at end of file +var _0xf9d5=['model','attributes','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','then','info','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','error','code','VoiceExtension,\x20%s,\x20%s','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','where','include','map'];(function(_0x32cd64,_0x58a56a){var _0x127d82=function(_0x1f2c0a){while(--_0x1f2c0a){_0x32cd64['push'](_0x32cd64['shift']());}};_0x127d82(++_0x58a56a);}(_0xf9d5,0x122));var _0x5f9d=function(_0xc129bd,_0x576bd2){_0xc129bd=_0xc129bd-0x0;var _0x26034d=_0xf9d5[_0xc129bd];return _0x26034d;};'use strict';var _=require('lodash');var util=require(_0x5f9d('0x0'));var moment=require(_0x5f9d('0x1'));var BPromise=require('bluebird');var rs=require(_0x5f9d('0x2'));var fs=require('fs');var Redis=require(_0x5f9d('0x3'));var db=require(_0x5f9d('0x4'))['db'];var utils=require(_0x5f9d('0x5'));var logger=require(_0x5f9d('0x6'))(_0x5f9d('0x7'));var config=require(_0x5f9d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5f9d('0x9')]['http']({'port':0x232a});config[_0x5f9d('0xa')]=_[_0x5f9d('0xb')](config['redis'],{'host':_0x5f9d('0xc'),'port':0x18eb});var socket=require(_0x5f9d('0xd'))(new Redis(config[_0x5f9d('0xa')]));require(_0x5f9d('0xe'))[_0x5f9d('0xf')](socket);function respondWithRpcPromise(_0x9757ba,_0x54e472,_0x156129){return new BPromise(function(_0x211098,_0x597974){return client['request'](_0x9757ba,_0x156129)[_0x5f9d('0x10')](function(_0x261a17){logger[_0x5f9d('0x11')]('VoiceExtension,\x20%s,\x20%s',_0x54e472,_0x5f9d('0x12'));logger[_0x5f9d('0x13')](_0x5f9d('0x14'),_0x54e472,_0x5f9d('0x12'),JSON['stringify'](_0x261a17));if(_0x261a17[_0x5f9d('0x15')]){if(_0x261a17[_0x5f9d('0x15')][_0x5f9d('0x16')]===0x1f4){logger['error'](_0x5f9d('0x17'),_0x54e472,_0x261a17[_0x5f9d('0x15')]['message']);return _0x597974(_0x261a17['error'][_0x5f9d('0x18')]);}logger[_0x5f9d('0x15')](_0x5f9d('0x17'),_0x54e472,_0x261a17[_0x5f9d('0x15')][_0x5f9d('0x18')]);return _0x211098(_0x261a17['error']['message']);}else{logger['info'](_0x5f9d('0x17'),_0x54e472,'request\x20sent');_0x211098(_0x261a17[_0x5f9d('0x19')]['message']);}})[_0x5f9d('0x1a')](function(_0x453285){logger[_0x5f9d('0x15')]('VoiceExtension,\x20%s,\x20%s',_0x54e472,_0x453285);_0x597974(_0x453285);});});}exports[_0x5f9d('0x1b')]=function(_0x16de94){var _0x3a2999=this;return new Promise(function(_0x1e51d7,_0x320182){return db[_0x5f9d('0x1c')][_0x5f9d('0x1d')]({'raw':_0x16de94[_0x5f9d('0x1e')]?_0x16de94[_0x5f9d('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x16de94['options']?_0x16de94['options'][_0x5f9d('0x1f')]||null:null,'attributes':_0x16de94['options']?_0x16de94[_0x5f9d('0x1e')]['attributes']||null:null,'limit':_0x16de94[_0x5f9d('0x1e')]?_0x16de94['options']['limit']||null:null,'include':_0x16de94['options']?_0x16de94[_0x5f9d('0x1e')][_0x5f9d('0x20')]?_[_0x5f9d('0x21')](_0x16de94[_0x5f9d('0x1e')]['include'],function(_0x379d2d){return{'model':db[_0x379d2d[_0x5f9d('0x22')]],'as':_0x379d2d['as'],'attributes':_0x379d2d[_0x5f9d('0x23')],'include':_0x379d2d[_0x5f9d('0x20')]?_[_0x5f9d('0x21')](_0x379d2d[_0x5f9d('0x20')],function(_0x2d66cc){return{'model':db[_0x2d66cc[_0x5f9d('0x22')]],'as':_0x2d66cc['as'],'attributes':_0x2d66cc[_0x5f9d('0x23')],'include':_0x2d66cc[_0x5f9d('0x20')]?_['map'](_0x2d66cc[_0x5f9d('0x20')],function(_0x1b9054){return{'model':db[_0x1b9054[_0x5f9d('0x22')]],'as':_0x1b9054['as'],'attributes':_0x1b9054[_0x5f9d('0x23')]};}):[]};}):[]};}):[]:[]})[_0x5f9d('0x10')](function(_0x24233e){logger[_0x5f9d('0x11')](_0x5f9d('0x1b'),_0x16de94);logger[_0x5f9d('0x13')]('GetVoiceExtension',_0x16de94,JSON['stringify'](_0x24233e));_0x1e51d7(_0x24233e);})['catch'](function(_0x118f77){logger['error'](_0x5f9d('0x1b'),_0x118f77['message'],_0x16de94);_0x320182(_0x3a2999[_0x5f9d('0x15')](0x1f4,_0x118f77['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index a7fdf2c..7a53c5c 100644 --- a/server/api/voiceExtension/voiceExtension.socket.js +++ b/server/api/voiceExtension/voiceExtension.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['removeListener','register','length','voiceExtension:','./voiceExtension.events','save','remove','update','emit'];(function(_0x24259d,_0x64a194){var _0x5a701=function(_0x204516){while(--_0x204516){_0x24259d['push'](_0x24259d['shift']());}};_0x5a701(++_0x64a194);}(_0x814b,0x1a2));var _0xb814=function(_0x8d695e,_0x394999){_0x8d695e=_0x8d695e-0x0;var _0x3d156e=_0x814b[_0x8d695e];return _0x3d156e;};'use strict';var VoiceExtensionEvents=require(_0xb814('0x0'));var events=[_0xb814('0x1'),_0xb814('0x2'),_0xb814('0x3')];function createListener(_0xfbb64b,_0x477725){return function(_0x4a98af){_0x477725[_0xb814('0x4')](_0xfbb64b,_0x4a98af);};}function removeListener(_0x3e1e9,_0x258866){return function(){VoiceExtensionEvents[_0xb814('0x5')](_0x3e1e9,_0x258866);};}exports[_0xb814('0x6')]=function(_0x322a70){for(var _0x53e507=0x0,_0x3b0829=events[_0xb814('0x7')];_0x53e507<_0x3b0829;_0x53e507++){var _0x5c8539=events[_0x53e507];var _0x271af9=createListener(_0xb814('0x8')+_0x5c8539,_0x322a70);VoiceExtensionEvents['on'](_0x5c8539,_0x271af9);}}; \ No newline at end of file +var _0xf494=['save','remove','emit','removeListener','register','voiceExtension:','./voiceExtension.events'];(function(_0x29336a,_0x9df524){var _0x3433ea=function(_0x4240ce){while(--_0x4240ce){_0x29336a['push'](_0x29336a['shift']());}};_0x3433ea(++_0x9df524);}(_0xf494,0x1c6));var _0x4f49=function(_0x4a9909,_0x49ea07){_0x4a9909=_0x4a9909-0x0;var _0x2c82f3=_0xf494[_0x4a9909];return _0x2c82f3;};'use strict';var VoiceExtensionEvents=require(_0x4f49('0x0'));var events=[_0x4f49('0x1'),_0x4f49('0x2'),'update'];function createListener(_0x3aeeb8,_0x1d54cc){return function(_0x423b25){_0x1d54cc[_0x4f49('0x3')](_0x3aeeb8,_0x423b25);};}function removeListener(_0x20c0d7,_0x2a15fb){return function(){VoiceExtensionEvents[_0x4f49('0x4')](_0x20c0d7,_0x2a15fb);};}exports[_0x4f49('0x5')]=function(_0xc5e778){for(var _0x413530=0x0,_0x42b0e8=events['length'];_0x413530<_0x42b0e8;_0x413530++){var _0x58e9a0=events[_0x413530];var _0x169c95=createListener(_0x4f49('0x6')+_0x58e9a0,_0xc5e778);VoiceExtensionEvents['on'](_0x58e9a0,_0x169c95);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 7ce6a3f..aafecde 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 _0x8ace=['isAuthenticated','index','/:id','/:id/messages','getMessages','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get'];(function(_0x2e3107,_0x25f970){var _0x833d69=function(_0x420e78){while(--_0x420e78){_0x2e3107['push'](_0x2e3107['shift']());}};_0x833d69(++_0x25f970);}(_0x8ace,0x1bc));var _0xe8ac=function(_0x2979d3,_0x54ff61){_0x2979d3=_0x2979d3-0x0;var _0x2a9a36=_0x8ace[_0x2979d3];return _0x2a9a36;};'use strict';var multer=require(_0xe8ac('0x0'));var util=require(_0xe8ac('0x1'));var path=require(_0xe8ac('0x2'));var timeout=require(_0xe8ac('0x3'));var express=require(_0xe8ac('0x4'));var router=express[_0xe8ac('0x5')]();var fs_extra=require(_0xe8ac('0x6'));var auth=require(_0xe8ac('0x7'));var interaction=require(_0xe8ac('0x8'));var config=require(_0xe8ac('0x9'));var controller=require(_0xe8ac('0xa'));router[_0xe8ac('0xb')]('/',auth[_0xe8ac('0xc')](),controller[_0xe8ac('0xd')]);router['get'](_0xe8ac('0xe'),auth[_0xe8ac('0xc')](),controller['show']);router['get'](_0xe8ac('0xf'),auth['isAuthenticated'](),controller[_0xe8ac('0x10')]);router[_0xe8ac('0x11')]('/',auth[_0xe8ac('0xc')](),controller[_0xe8ac('0x12')]);router[_0xe8ac('0x13')](_0xe8ac('0xe'),auth['isAuthenticated'](),controller[_0xe8ac('0x14')]);router[_0xe8ac('0x15')](_0xe8ac('0xe'),auth['isAuthenticated'](),controller[_0xe8ac('0x16')]);module[_0xe8ac('0x17')]=router; \ No newline at end of file +var _0x0a6b=['fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMail.controller','isAuthenticated','index','/:id','show','getMessages','post','create','delete','destroy','exports','multer','express'];(function(_0x14f050,_0x46bc3e){var _0x17e2b7=function(_0x42b3e9){while(--_0x42b3e9){_0x14f050['push'](_0x14f050['shift']());}};_0x17e2b7(++_0x46bc3e);}(_0x0a6b,0x18e));var _0xb0a6=function(_0x5a0a64,_0x5c418d){_0x5a0a64=_0x5a0a64-0x0;var _0x35d769=_0x0a6b[_0x5a0a64];return _0x35d769;};'use strict';var multer=require(_0xb0a6('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb0a6('0x1'));var router=express['Router']();var fs_extra=require(_0xb0a6('0x2'));var auth=require(_0xb0a6('0x3'));var interaction=require(_0xb0a6('0x4'));var config=require('../../config/environment');var controller=require(_0xb0a6('0x5'));router['get']('/',auth[_0xb0a6('0x6')](),controller[_0xb0a6('0x7')]);router['get'](_0xb0a6('0x8'),auth[_0xb0a6('0x6')](),controller[_0xb0a6('0x9')]);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0xb0a6('0xa')]);router[_0xb0a6('0xb')]('/',auth[_0xb0a6('0x6')](),controller[_0xb0a6('0xc')]);router['put'](_0xb0a6('0x8'),auth[_0xb0a6('0x6')](),controller['update']);router[_0xb0a6('0xd')](_0xb0a6('0x8'),auth[_0xb0a6('0x6')](),controller[_0xb0a6('0xe')]);module[_0xb0a6('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index b942c68..1b59e01 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 _0x438c=['central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','email','string','trim'];(function(_0x3f6c29,_0x370d86){var _0x4af959=function(_0x263612){while(--_0x263612){_0x3f6c29['push'](_0x3f6c29['shift']());}};_0x4af959(++_0x370d86);}(_0x438c,0x1a8));var _0xc438=function(_0x2a3343,_0x41d09e){_0x2a3343=_0x2a3343-0x0;var _0x17c1f8=_0x438c[_0x2a3343];return _0x17c1f8;};'use strict';var Sequelize=require(_0xc438('0x0'));module[_0xc438('0x1')]={'customer_id':{'type':Sequelize[_0xc438('0x2')]},'context':{'type':Sequelize['STRING'],'defaultValue':_0xc438('0x3'),'unique':_0xc438('0x4')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0xc438('0x4')},'password':{'type':Sequelize[_0xc438('0x2')]},'fullname':{'type':Sequelize[_0xc438('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x472eb1){this['setDataValue'](_0xc438('0x5'),typeof _0x472eb1===_0xc438('0x6')&&_0x472eb1[_0xc438('0x7')]()?_0x472eb1[_0xc438('0x7')]():null);}},'pager':{'type':Sequelize[_0xc438('0x2')]},'tz':{'type':Sequelize[_0xc438('0x2')],'defaultValue':_0xc438('0x8')},'attach':{'type':Sequelize[_0xc438('0x9')](_0xc438('0xa'),'no'),'defaultValue':_0xc438('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0xc438('0x9')](_0xc438('0xa'),'no'),'defaultValue':_0xc438('0xa'),'allowNull':![]},'dialout':{'type':Sequelize[_0xc438('0x2')]},'callback':{'type':Sequelize[_0xc438('0x2')]},'review':{'type':Sequelize[_0xc438('0x9')](_0xc438('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xc438('0x9')](_0xc438('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xc438('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xc438('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xc438('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xc438('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0xc438('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xc438('0x9')](_0xc438('0xa'),'no'),'defaultValue':_0xc438('0xa'),'allowNull':![]},'forcename':{'type':Sequelize[_0xc438('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xc438('0x9')](_0xc438('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xc438('0x9')](_0xc438('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0xc438('0xc')},'emailsubject':{'type':Sequelize[_0xc438('0x2')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xc438('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xc438('0xe')](_0xc438('0xf'))+_0xc438('0x10')+this[_0xc438('0xe')](_0xc438('0x11'));}}}; \ No newline at end of file +var _0x9b66=['sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','getDataValue','fullname','\x20-\x20','mailbox'];(function(_0x31eb67,_0x9bc8c0){var _0x2a8cb8=function(_0xac1c5d){while(--_0xac1c5d){_0x31eb67['push'](_0x31eb67['shift']());}};_0x2a8cb8(++_0x9bc8c0);}(_0x9b66,0x18c));var _0x69b6=function(_0x50c144,_0x19cab2){_0x50c144=_0x50c144-0x0;var _0x231f97=_0x9b66[_0x50c144];return _0x231f97;};'use strict';var Sequelize=require(_0x69b6('0x0'));module[_0x69b6('0x1')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x69b6('0x2')],'defaultValue':_0x69b6('0x3'),'unique':_0x69b6('0x4')},'mailbox':{'type':Sequelize[_0x69b6('0x2')],'defaultValue':'','allowNull':![],'unique':_0x69b6('0x4')},'password':{'type':Sequelize[_0x69b6('0x2')]},'fullname':{'type':Sequelize[_0x69b6('0x2')]},'email':{'type':Sequelize[_0x69b6('0x2')],'validate':{'isEmail':!![]},'set':function(_0x5f1523){this[_0x69b6('0x5')](_0x69b6('0x6'),typeof _0x5f1523===_0x69b6('0x7')&&_0x5f1523['trim']()?_0x5f1523['trim']():null);}},'pager':{'type':Sequelize[_0x69b6('0x2')]},'tz':{'type':Sequelize[_0x69b6('0x2')],'defaultValue':_0x69b6('0x8')},'attach':{'type':Sequelize[_0x69b6('0x9')]('yes','no'),'defaultValue':_0x69b6('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0x69b6('0x9')](_0x69b6('0xa'),'no'),'defaultValue':_0x69b6('0xa'),'allowNull':![]},'dialout':{'type':Sequelize[_0x69b6('0x2')]},'callback':{'type':Sequelize[_0x69b6('0x2')]},'review':{'type':Sequelize['ENUM'](_0x69b6('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x69b6('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x69b6('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x69b6('0x9')](_0x69b6('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x69b6('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x69b6('0x9')](_0x69b6('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0x69b6('0xa'),'no'),'defaultValue':_0x69b6('0xa'),'allowNull':![]},'forcename':{'type':Sequelize[_0x69b6('0x9')](_0x69b6('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x69b6('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x69b6('0x9')](_0x69b6('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x69b6('0xc')},'emailsubject':{'type':Sequelize[_0x69b6('0x2')]},'emailbody':{'type':Sequelize[_0x69b6('0x2')]},'maxsecs':{'type':Sequelize[_0x69b6('0xd')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x69b6('0xe')](_0x69b6('0xf'))+_0x69b6('0x10')+this[_0x69b6('0xe')](_0x69b6('0x11'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 6dd3d1b..af1ebf2 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 _0x91a7=['status','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','get','Voicemails','error','stack','name','send','index','map','VoiceMail','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filter','merge','includeAll','catch','show','params','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','body','getMessages','findOne','VoiceMailMessage','order','mailbox','options','findAndCountAll','rimraf','zip-dir','fast-json-patch','moment','mustache','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end'];(function(_0x12a2a6,_0x374ff1){var _0x1754ae=function(_0x49d787){while(--_0x49d787){_0x12a2a6['push'](_0x12a2a6['shift']());}};_0x1754ae(++_0x374ff1);}(_0x91a7,0xe7));var _0x791a=function(_0x1cf7c4,_0x447806){_0x1cf7c4=_0x1cf7c4-0x0;var _0x53d4d5=_0x91a7[_0x1cf7c4];return _0x53d4d5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x791a('0x0'));var zipdir=require(_0x791a('0x1'));var jsonpatch=require(_0x791a('0x2'));var rp=require('request-promise');var moment=require(_0x791a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x791a('0x4'));var util=require('util');var path=require('path');var sox=require(_0x791a('0x5'));var csv=require(_0x791a('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x791a('0x7'));var _=require('lodash');var squel=require(_0x791a('0x8'));var crypto=require(_0x791a('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x791a('0xa'));var toCsv=require(_0x791a('0x6'));var querystring=require(_0x791a('0xb'));var Papa=require(_0x791a('0xc'));var Redis=require(_0x791a('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x791a('0xe'));var as=require(_0x791a('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x791a('0x10'))(_0x791a('0x11'));var utils=require(_0x791a('0x12'));var config=require(_0x791a('0x13'));var licenseUtil=require(_0x791a('0x14'));var db=require(_0x791a('0x15'))['db'];function respondWithStatusCode(_0x53dc41,_0x5daecd){_0x5daecd=_0x5daecd||0xcc;return function(_0xc92016){if(_0xc92016){return _0x53dc41[_0x791a('0x16')](_0x5daecd);}return _0x53dc41['status'](_0x5daecd)[_0x791a('0x17')]();};}function respondWithResult(_0x3a2ec6,_0x5d5b11){_0x5d5b11=_0x5d5b11||0xc8;return function(_0x2887f0){if(_0x2887f0){return _0x3a2ec6[_0x791a('0x18')](_0x5d5b11)[_0x791a('0x19')](_0x2887f0);}};}function respondWithFilteredResult(_0x5cdf2,_0x55e845){return function(_0x2ce2e0){if(_0x2ce2e0){var _0x575d11=typeof _0x55e845[_0x791a('0x1a')]===_0x791a('0x1b')&&typeof _0x55e845['limit']===_0x791a('0x1b');var _0x5bea2e=_0x2ce2e0[_0x791a('0x1c')];var _0x52941d=_0x575d11?0x0:_0x55e845['offset'];var _0x588d00=_0x575d11?_0x2ce2e0[_0x791a('0x1c')]:_0x55e845['offset']+_0x55e845['limit'];var _0x39c60b;if(_0x588d00>=_0x5bea2e){_0x588d00=_0x5bea2e;_0x39c60b=0xc8;}else{_0x39c60b=0xce;}_0x5cdf2[_0x791a('0x18')](_0x39c60b);return _0x5cdf2[_0x791a('0x1d')](_0x791a('0x1e'),_0x52941d+'-'+_0x588d00+'/'+_0x5bea2e)['json'](_0x2ce2e0);}return null;};}function patchUpdates(_0x189c0d){return function(_0xcb5e66){try{jsonpatch[_0x791a('0x1f')](_0xcb5e66,_0x189c0d,!![]);}catch(_0x280f1e){return BPromise['reject'](_0x280f1e);}return _0xcb5e66[_0x791a('0x20')]();};}function saveUpdates(_0x2054c6,_0x25bae5){return function(_0x9e17b5){if(_0x9e17b5){return _0x9e17b5[_0x791a('0x21')](_0x2054c6)[_0x791a('0x22')](function(_0x2241a0){return _0x2241a0;});}return null;};}function removeEntity(_0x45a67d,_0x323c6a){return function(_0xe8e452){if(_0xe8e452){return _0xe8e452[_0x791a('0x23')]()['then'](function(){var _0x1102c9=_0xe8e452[_0x791a('0x24')]({'plain':!![]});var _0x380329=_0x791a('0x25');return db['UserProfileResource'][_0x791a('0x23')]({'where':{'type':_0x380329,'resourceId':_0x1102c9['id']}})[_0x791a('0x22')](function(){return _0xe8e452;});})['then'](function(){_0x45a67d[_0x791a('0x18')](0xcc)[_0x791a('0x17')]();});}};}function handleEntityNotFound(_0x16dbaf,_0x4c1626){return function(_0x29194d){if(!_0x29194d){_0x16dbaf[_0x791a('0x16')](0x194);}return _0x29194d;};}function handleError(_0x2b0784,_0x395376){_0x395376=_0x395376||0x1f4;return function(_0x4f423){logger[_0x791a('0x26')](_0x4f423[_0x791a('0x27')]);if(_0x4f423[_0x791a('0x28')]){delete _0x4f423['name'];}_0x2b0784[_0x791a('0x18')](_0x395376)[_0x791a('0x29')](_0x4f423);};}exports[_0x791a('0x2a')]=function(_0x59d2c0,_0x1cdda9){var _0x5df656={},_0xc59f5e={},_0x2e4ec8={'count':0x0,'rows':[]};var _0xcde862=_[_0x791a('0x2b')](db[_0x791a('0x2c')][_0x791a('0x2d')],function(_0x15ff6e){return{'name':_0x15ff6e['fieldName'],'type':_0x15ff6e[_0x791a('0x2e')][_0x791a('0x2f')]};});_0xc59f5e[_0x791a('0x30')]=_[_0x791a('0x2b')](_0xcde862,_0x791a('0x28'));_0xc59f5e['query']=_[_0x791a('0x31')](_0x59d2c0[_0x791a('0x32')]);_0xc59f5e[_0x791a('0x33')]=_[_0x791a('0x34')](_0xc59f5e[_0x791a('0x30')],_0xc59f5e['query']);_0x5df656[_0x791a('0x35')]=_[_0x791a('0x34')](_0xc59f5e[_0x791a('0x30')],qs[_0x791a('0x36')](_0x59d2c0[_0x791a('0x32')]['fields']));_0x5df656[_0x791a('0x35')]=_0x5df656['attributes'][_0x791a('0x37')]?_0x5df656['attributes']:_0xc59f5e['model'];if(!_0x59d2c0[_0x791a('0x32')][_0x791a('0x38')](_0x791a('0x39'))){_0x5df656[_0x791a('0x3a')]=qs[_0x791a('0x3a')](_0x59d2c0[_0x791a('0x32')][_0x791a('0x3a')]);_0x5df656['offset']=qs[_0x791a('0x1a')](_0x59d2c0['query'][_0x791a('0x1a')]);}_0x5df656['order']=qs[_0x791a('0x3b')](_0x59d2c0[_0x791a('0x32')]['sort']);_0x5df656[_0x791a('0x3c')]=qs[_0x791a('0x33')](_['pick'](_0x59d2c0[_0x791a('0x32')],_0xc59f5e[_0x791a('0x33')]),_0xcde862);if(_0x59d2c0[_0x791a('0x32')][_0x791a('0x3d')]){_0x5df656[_0x791a('0x3c')]=_[_0x791a('0x3e')](_0x5df656[_0x791a('0x3c')],{'$or':_[_0x791a('0x2b')](_0xcde862,function(_0xc0fb63){if(_0xc0fb63[_0x791a('0x2e')]!=='VIRTUAL'){var _0x15f066={};_0x15f066[_0xc0fb63[_0x791a('0x28')]]={'$like':'%'+_0x59d2c0[_0x791a('0x32')]['filter']+'%'};return _0x15f066;}})});}_0x5df656=_[_0x791a('0x3e')]({},_0x5df656,_0x59d2c0['options']);var _0x5bad7d={'where':_0x5df656['where']};return db[_0x791a('0x2c')][_0x791a('0x1c')](_0x5bad7d)['then'](function(_0x415c44){_0x2e4ec8[_0x791a('0x1c')]=_0x415c44;if(_0x59d2c0[_0x791a('0x32')][_0x791a('0x3f')]){_0x5df656['include']=[{'all':!![]}];}return db['VoiceMail']['findAll'](_0x5df656);})[_0x791a('0x22')](function(_0x216dd3){_0x2e4ec8['rows']=_0x216dd3;return _0x2e4ec8;})[_0x791a('0x22')](respondWithFilteredResult(_0x1cdda9,_0x5df656))[_0x791a('0x40')](handleError(_0x1cdda9,null));};exports[_0x791a('0x41')]=function(_0x954164,_0x508727){var _0x11263d={'raw':!![],'where':{'id':_0x954164[_0x791a('0x42')]['id']}},_0x5911db={};_0x5911db[_0x791a('0x30')]=_[_0x791a('0x31')](db[_0x791a('0x2c')][_0x791a('0x2d')]);_0x5911db['query']=_[_0x791a('0x31')](_0x954164[_0x791a('0x32')]);_0x5911db[_0x791a('0x33')]=_[_0x791a('0x34')](_0x5911db[_0x791a('0x30')],_0x5911db['query']);_0x11263d[_0x791a('0x35')]=_[_0x791a('0x34')](_0x5911db['model'],qs['fields'](_0x954164[_0x791a('0x32')][_0x791a('0x36')]));_0x11263d[_0x791a('0x35')]=_0x11263d['attributes']['length']?_0x11263d[_0x791a('0x35')]:_0x5911db[_0x791a('0x30')];if(_0x954164['query'][_0x791a('0x3f')]){_0x11263d[_0x791a('0x43')]=[{'all':!![]}];}_0x11263d=_[_0x791a('0x3e')]({},_0x11263d,_0x954164['options']);return db['VoiceMail'][_0x791a('0x44')](_0x11263d)[_0x791a('0x22')](handleEntityNotFound(_0x508727,null))[_0x791a('0x22')](respondWithResult(_0x508727,null))[_0x791a('0x40')](handleError(_0x508727,null));};exports['create']=function(_0x2d7c7d,_0x9f768a){return db[_0x791a('0x2c')][_0x791a('0x45')](_0x2d7c7d['body'],{})[_0x791a('0x22')](function(_0x19654d){var _0xe0696b=_0x2d7c7d[_0x791a('0x46')][_0x791a('0x24')]({'plain':!![]});if(!_0xe0696b)throw new Error(_0x791a('0x47'));if(_0xe0696b[_0x791a('0x48')]==='user'){var _0xdcb1b=_0x19654d[_0x791a('0x24')]({'plain':!![]});var _0x4bffa6=_0x791a('0x25');return db[_0x791a('0x49')]['find']({'where':{'name':_0x4bffa6,'userProfileId':_0xe0696b[_0x791a('0x4a')]},'raw':!![]})[_0x791a('0x22')](function(_0x12178e){if(_0x12178e&&_0x12178e[_0x791a('0x4b')]===0x0){return db[_0x791a('0x4c')]['create']({'name':_0xdcb1b['name'],'resourceId':_0xdcb1b['id'],'type':_0x12178e['name'],'sectionId':_0x12178e['id']},{})[_0x791a('0x22')](function(){return _0x19654d;});}else{return _0x19654d;}})['catch'](function(_0x4c7555){logger[_0x791a('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4c7555);throw _0x4c7555;});}return _0x19654d;})[_0x791a('0x22')](respondWithResult(_0x9f768a,0xc9))[_0x791a('0x40')](handleError(_0x9f768a,null));};exports['update']=function(_0x5166b5,_0x3599f6){if(_0x5166b5['body']['id']){delete _0x5166b5[_0x791a('0x4d')]['id'];}return db[_0x791a('0x2c')][_0x791a('0x44')]({'where':{'id':_0x5166b5['params']['id']}})[_0x791a('0x22')](handleEntityNotFound(_0x3599f6,null))[_0x791a('0x22')](saveUpdates(_0x5166b5['body'],null))[_0x791a('0x22')](respondWithResult(_0x3599f6,null))[_0x791a('0x40')](handleError(_0x3599f6,null));};exports[_0x791a('0x23')]=function(_0x34d53c,_0x450ad8){return db[_0x791a('0x2c')]['find']({'where':{'id':_0x34d53c['params']['id']}})[_0x791a('0x22')](handleEntityNotFound(_0x450ad8,null))['then'](removeEntity(_0x450ad8,null))[_0x791a('0x40')](handleError(_0x450ad8,null));};exports[_0x791a('0x4e')]=function(_0x18ad89,_0xf11dea,_0x3b760c){return db[_0x791a('0x2c')][_0x791a('0x4f')]({'where':{'id':_0x18ad89['params']['id']}})[_0x791a('0x22')](handleEntityNotFound(_0xf11dea,null))[_0x791a('0x22')](function(_0xc34c5b){var _0x1a4376;var _0x2d671f={},_0xe062f1={};_0xe062f1[_0x791a('0x30')]=_['keys'](db[_0x791a('0x50')]['rawAttributes']);_0xe062f1['query']=_[_0x791a('0x31')](_0x18ad89[_0x791a('0x32')]);_0xe062f1[_0x791a('0x33')]=_[_0x791a('0x34')](_0xe062f1[_0x791a('0x30')],_0xe062f1[_0x791a('0x32')]);_0x2d671f[_0x791a('0x35')]=_[_0x791a('0x34')](_0xe062f1[_0x791a('0x30')],qs[_0x791a('0x36')](_0x18ad89[_0x791a('0x32')][_0x791a('0x36')]));_0x2d671f[_0x791a('0x35')]=_0x2d671f[_0x791a('0x35')][_0x791a('0x37')]?_0x2d671f[_0x791a('0x35')]:_0xe062f1[_0x791a('0x30')];if(!_0x18ad89[_0x791a('0x32')][_0x791a('0x38')](_0x791a('0x39'))){_0x2d671f['limit']=qs[_0x791a('0x3a')](_0x18ad89[_0x791a('0x32')][_0x791a('0x3a')]);_0x2d671f[_0x791a('0x1a')]=qs[_0x791a('0x1a')](_0x18ad89['query'][_0x791a('0x1a')]);}_0x2d671f[_0x791a('0x51')]=qs[_0x791a('0x3b')](_0x18ad89[_0x791a('0x32')]['sort']);_0x2d671f[_0x791a('0x3c')]=qs['filters'](_['pick'](_0x18ad89['query'],_0xe062f1['filters']));if(_0x18ad89[_0x791a('0x32')][_0x791a('0x3d')]){_0x2d671f[_0x791a('0x3c')]=_[_0x791a('0x3e')](_0x2d671f[_0x791a('0x3c')],{'$or':_[_0x791a('0x2b')](_0x2d671f[_0x791a('0x35')],function(_0x5dca78){var _0x522cb8={};_0x522cb8[_0x5dca78]={'$like':'%'+_0x18ad89[_0x791a('0x32')][_0x791a('0x3d')]+'%'};return _0x522cb8;})});}_0x2d671f['where']=_['merge'](_0x2d671f[_0x791a('0x3c')],{'mailboxuser':_0xc34c5b[_0x791a('0x52')]});_0x2d671f=_['merge']({},_0x2d671f,_0x18ad89[_0x791a('0x53')]);return db[_0x791a('0x50')][_0x791a('0x54')](_0x2d671f)[_0x791a('0x22')](respondWithFilteredResult(_0xf11dea,_0x2d671f));})['catch'](handleError(_0xf11dea,null));}; \ No newline at end of file +var _0x3f8c=['create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getMessages','findAndCountAll','zip-dir','fast-json-patch','request-promise','moment','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','Content-Range','reject','save','update','then','Voicemails','UserProfileResource','destroy','error','stack','name','index','map','VoiceMail','rawAttributes','fieldName','type','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','catch'];(function(_0x20c2ab,_0x1ab893){var _0x58fefd=function(_0x46eec4){while(--_0x46eec4){_0x20c2ab['push'](_0x20c2ab['shift']());}};_0x58fefd(++_0x1ab893);}(_0x3f8c,0x104));var _0xc3f8=function(_0x4e36f2,_0x57d095){_0x4e36f2=_0x4e36f2-0x0;var _0x2d99e9=_0x3f8c[_0x4e36f2];return _0x2d99e9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc3f8('0x0'));var jsonpatch=require(_0xc3f8('0x1'));var rp=require(_0xc3f8('0x2'));var moment=require(_0xc3f8('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xc3f8('0x4'));var ejs=require(_0xc3f8('0x5'));var fs=require('fs');var fs_extra=require(_0xc3f8('0x6'));var _=require(_0xc3f8('0x7'));var squel=require(_0xc3f8('0x8'));var crypto=require(_0xc3f8('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xc3f8('0xa'));var toCsv=require(_0xc3f8('0x4'));var querystring=require(_0xc3f8('0xb'));var Papa=require(_0xc3f8('0xc'));var Redis=require(_0xc3f8('0xd'));var authService=require(_0xc3f8('0xe'));var qs=require(_0xc3f8('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc3f8('0x10'));var logger=require(_0xc3f8('0x11'))(_0xc3f8('0x12'));var utils=require(_0xc3f8('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xc3f8('0x14'));var db=require(_0xc3f8('0x15'))['db'];function respondWithStatusCode(_0x256e3d,_0x155c80){_0x155c80=_0x155c80||0xcc;return function(_0x511763){if(_0x511763){return _0x256e3d[_0xc3f8('0x16')](_0x155c80);}return _0x256e3d[_0xc3f8('0x17')](_0x155c80)[_0xc3f8('0x18')]();};}function respondWithResult(_0x44632a,_0x6155e9){_0x6155e9=_0x6155e9||0xc8;return function(_0x47754c){if(_0x47754c){return _0x44632a[_0xc3f8('0x17')](_0x6155e9)[_0xc3f8('0x19')](_0x47754c);}};}function respondWithFilteredResult(_0x12b141,_0x2fd8e8){return function(_0x3cb28a){if(_0x3cb28a){var _0x2a9f64=typeof _0x2fd8e8[_0xc3f8('0x1a')]==='undefined'&&typeof _0x2fd8e8[_0xc3f8('0x1b')]==='undefined';var _0x51807b=_0x3cb28a[_0xc3f8('0x1c')];var _0x2e7c0f=_0x2a9f64?0x0:_0x2fd8e8[_0xc3f8('0x1a')];var _0xb4ab67=_0x2a9f64?_0x3cb28a['count']:_0x2fd8e8[_0xc3f8('0x1a')]+_0x2fd8e8[_0xc3f8('0x1b')];var _0x5df6f9;if(_0xb4ab67>=_0x51807b){_0xb4ab67=_0x51807b;_0x5df6f9=0xc8;}else{_0x5df6f9=0xce;}_0x12b141[_0xc3f8('0x17')](_0x5df6f9);return _0x12b141['set'](_0xc3f8('0x1d'),_0x2e7c0f+'-'+_0xb4ab67+'/'+_0x51807b)[_0xc3f8('0x19')](_0x3cb28a);}return null;};}function patchUpdates(_0x3b2e98){return function(_0x53ada5){try{jsonpatch['apply'](_0x53ada5,_0x3b2e98,!![]);}catch(_0x113cd2){return BPromise[_0xc3f8('0x1e')](_0x113cd2);}return _0x53ada5[_0xc3f8('0x1f')]();};}function saveUpdates(_0x25a4c7,_0x6522e9){return function(_0x251bf7){if(_0x251bf7){return _0x251bf7[_0xc3f8('0x20')](_0x25a4c7)[_0xc3f8('0x21')](function(_0x49aeea){return _0x49aeea;});}return null;};}function removeEntity(_0x571f92,_0x4b83f0){return function(_0x2559a4){if(_0x2559a4){return _0x2559a4['destroy']()[_0xc3f8('0x21')](function(){var _0x3f196d=_0x2559a4['get']({'plain':!![]});var _0x4569c2=_0xc3f8('0x22');return db[_0xc3f8('0x23')][_0xc3f8('0x24')]({'where':{'type':_0x4569c2,'resourceId':_0x3f196d['id']}})[_0xc3f8('0x21')](function(){return _0x2559a4;});})[_0xc3f8('0x21')](function(){_0x571f92[_0xc3f8('0x17')](0xcc)[_0xc3f8('0x18')]();});}};}function handleEntityNotFound(_0x21b002,_0xbea3b8){return function(_0x22c8e6){if(!_0x22c8e6){_0x21b002[_0xc3f8('0x16')](0x194);}return _0x22c8e6;};}function handleError(_0x238ff5,_0x429fd8){_0x429fd8=_0x429fd8||0x1f4;return function(_0x59e4dd){logger[_0xc3f8('0x25')](_0x59e4dd[_0xc3f8('0x26')]);if(_0x59e4dd[_0xc3f8('0x27')]){delete _0x59e4dd['name'];}_0x238ff5[_0xc3f8('0x17')](_0x429fd8)['send'](_0x59e4dd);};}exports[_0xc3f8('0x28')]=function(_0x32343e,_0x47ab53){var _0x48b32e={},_0x21a225={},_0x25df65={'count':0x0,'rows':[]};var _0xd32b09=_[_0xc3f8('0x29')](db[_0xc3f8('0x2a')][_0xc3f8('0x2b')],function(_0x680047){return{'name':_0x680047[_0xc3f8('0x2c')],'type':_0x680047[_0xc3f8('0x2d')][_0xc3f8('0x2e')]};});_0x21a225['model']=_[_0xc3f8('0x29')](_0xd32b09,_0xc3f8('0x27'));_0x21a225[_0xc3f8('0x2f')]=_[_0xc3f8('0x30')](_0x32343e[_0xc3f8('0x2f')]);_0x21a225['filters']=_['intersection'](_0x21a225[_0xc3f8('0x31')],_0x21a225[_0xc3f8('0x2f')]);_0x48b32e[_0xc3f8('0x32')]=_[_0xc3f8('0x33')](_0x21a225[_0xc3f8('0x31')],qs['fields'](_0x32343e[_0xc3f8('0x2f')][_0xc3f8('0x34')]));_0x48b32e[_0xc3f8('0x32')]=_0x48b32e['attributes'][_0xc3f8('0x35')]?_0x48b32e[_0xc3f8('0x32')]:_0x21a225[_0xc3f8('0x31')];if(!_0x32343e['query'][_0xc3f8('0x36')](_0xc3f8('0x37'))){_0x48b32e['limit']=qs[_0xc3f8('0x1b')](_0x32343e[_0xc3f8('0x2f')][_0xc3f8('0x1b')]);_0x48b32e[_0xc3f8('0x1a')]=qs[_0xc3f8('0x1a')](_0x32343e[_0xc3f8('0x2f')]['offset']);}_0x48b32e[_0xc3f8('0x38')]=qs[_0xc3f8('0x39')](_0x32343e[_0xc3f8('0x2f')][_0xc3f8('0x39')]);_0x48b32e[_0xc3f8('0x3a')]=qs['filters'](_[_0xc3f8('0x3b')](_0x32343e[_0xc3f8('0x2f')],_0x21a225[_0xc3f8('0x3c')]),_0xd32b09);if(_0x32343e['query'][_0xc3f8('0x3d')]){_0x48b32e[_0xc3f8('0x3a')]=_[_0xc3f8('0x3e')](_0x48b32e[_0xc3f8('0x3a')],{'$or':_['map'](_0xd32b09,function(_0x306182){if(_0x306182[_0xc3f8('0x2d')]!==_0xc3f8('0x3f')){var _0x37b104={};_0x37b104[_0x306182['name']]={'$like':'%'+_0x32343e[_0xc3f8('0x2f')]['filter']+'%'};return _0x37b104;}})});}_0x48b32e=_['merge']({},_0x48b32e,_0x32343e[_0xc3f8('0x40')]);var _0x1f3aef={'where':_0x48b32e[_0xc3f8('0x3a')]};return db[_0xc3f8('0x2a')]['count'](_0x1f3aef)['then'](function(_0x361a85){_0x25df65[_0xc3f8('0x1c')]=_0x361a85;if(_0x32343e[_0xc3f8('0x2f')][_0xc3f8('0x41')]){_0x48b32e[_0xc3f8('0x42')]=[{'all':!![]}];}return db[_0xc3f8('0x2a')][_0xc3f8('0x43')](_0x48b32e);})[_0xc3f8('0x21')](function(_0x13d8dc){_0x25df65[_0xc3f8('0x44')]=_0x13d8dc;return _0x25df65;})[_0xc3f8('0x21')](respondWithFilteredResult(_0x47ab53,_0x48b32e))['catch'](handleError(_0x47ab53,null));};exports[_0xc3f8('0x45')]=function(_0x22e9b3,_0x4b327f){var _0x1aff20={'raw':!![],'where':{'id':_0x22e9b3['params']['id']}},_0x172f1a={};_0x172f1a[_0xc3f8('0x31')]=_[_0xc3f8('0x30')](db[_0xc3f8('0x2a')][_0xc3f8('0x2b')]);_0x172f1a[_0xc3f8('0x2f')]=_[_0xc3f8('0x30')](_0x22e9b3[_0xc3f8('0x2f')]);_0x172f1a[_0xc3f8('0x3c')]=_[_0xc3f8('0x33')](_0x172f1a[_0xc3f8('0x31')],_0x172f1a[_0xc3f8('0x2f')]);_0x1aff20['attributes']=_[_0xc3f8('0x33')](_0x172f1a[_0xc3f8('0x31')],qs['fields'](_0x22e9b3[_0xc3f8('0x2f')][_0xc3f8('0x34')]));_0x1aff20[_0xc3f8('0x32')]=_0x1aff20[_0xc3f8('0x32')]['length']?_0x1aff20['attributes']:_0x172f1a[_0xc3f8('0x31')];if(_0x22e9b3[_0xc3f8('0x2f')][_0xc3f8('0x41')]){_0x1aff20['include']=[{'all':!![]}];}_0x1aff20=_[_0xc3f8('0x3e')]({},_0x1aff20,_0x22e9b3[_0xc3f8('0x40')]);return db[_0xc3f8('0x2a')][_0xc3f8('0x46')](_0x1aff20)[_0xc3f8('0x21')](handleEntityNotFound(_0x4b327f,null))['then'](respondWithResult(_0x4b327f,null))[_0xc3f8('0x47')](handleError(_0x4b327f,null));};exports[_0xc3f8('0x48')]=function(_0x5961ab,_0x1becae){return db[_0xc3f8('0x2a')][_0xc3f8('0x48')](_0x5961ab[_0xc3f8('0x49')],{})[_0xc3f8('0x21')](function(_0x3045bc){var _0x1ca7c9=_0x5961ab['user'][_0xc3f8('0x4a')]({'plain':!![]});if(!_0x1ca7c9)throw new Error(_0xc3f8('0x4b'));if(_0x1ca7c9['role']===_0xc3f8('0x4c')){var _0x2e9f93=_0x3045bc[_0xc3f8('0x4a')]({'plain':!![]});var _0x33e5c5=_0xc3f8('0x22');return db[_0xc3f8('0x4d')][_0xc3f8('0x46')]({'where':{'name':_0x33e5c5,'userProfileId':_0x1ca7c9['userProfileId']},'raw':!![]})[_0xc3f8('0x21')](function(_0x2c6999){if(_0x2c6999&&_0x2c6999[_0xc3f8('0x4e')]===0x0){return db[_0xc3f8('0x23')][_0xc3f8('0x48')]({'name':_0x2e9f93[_0xc3f8('0x27')],'resourceId':_0x2e9f93['id'],'type':_0x2c6999[_0xc3f8('0x27')],'sectionId':_0x2c6999['id']},{})[_0xc3f8('0x21')](function(){return _0x3045bc;});}else{return _0x3045bc;}})['catch'](function(_0x51249a){logger[_0xc3f8('0x25')](_0xc3f8('0x4f'),_0x51249a);throw _0x51249a;});}return _0x3045bc;})['then'](respondWithResult(_0x1becae,0xc9))['catch'](handleError(_0x1becae,null));};exports[_0xc3f8('0x20')]=function(_0x4b4adb,_0x1b1e13){if(_0x4b4adb[_0xc3f8('0x49')]['id']){delete _0x4b4adb[_0xc3f8('0x49')]['id'];}return db['VoiceMail'][_0xc3f8('0x46')]({'where':{'id':_0x4b4adb['params']['id']}})['then'](handleEntityNotFound(_0x1b1e13,null))[_0xc3f8('0x21')](saveUpdates(_0x4b4adb['body'],null))[_0xc3f8('0x21')](respondWithResult(_0x1b1e13,null))[_0xc3f8('0x47')](handleError(_0x1b1e13,null));};exports[_0xc3f8('0x24')]=function(_0x490f37,_0xcb45c1){return db[_0xc3f8('0x2a')][_0xc3f8('0x46')]({'where':{'id':_0x490f37[_0xc3f8('0x50')]['id']}})[_0xc3f8('0x21')](handleEntityNotFound(_0xcb45c1,null))['then'](removeEntity(_0xcb45c1,null))['catch'](handleError(_0xcb45c1,null));};exports[_0xc3f8('0x51')]=function(_0x326dcc,_0x2f1b68,_0x3a268d){return db[_0xc3f8('0x2a')]['findOne']({'where':{'id':_0x326dcc[_0xc3f8('0x50')]['id']}})['then'](handleEntityNotFound(_0x2f1b68,null))[_0xc3f8('0x21')](function(_0x337029){var _0x163264;var _0xd5d6a7={},_0x5c6f6e={};_0x5c6f6e[_0xc3f8('0x31')]=_['keys'](db['VoiceMailMessage']['rawAttributes']);_0x5c6f6e['query']=_[_0xc3f8('0x30')](_0x326dcc[_0xc3f8('0x2f')]);_0x5c6f6e[_0xc3f8('0x3c')]=_[_0xc3f8('0x33')](_0x5c6f6e[_0xc3f8('0x31')],_0x5c6f6e[_0xc3f8('0x2f')]);_0xd5d6a7[_0xc3f8('0x32')]=_[_0xc3f8('0x33')](_0x5c6f6e['model'],qs[_0xc3f8('0x34')](_0x326dcc[_0xc3f8('0x2f')][_0xc3f8('0x34')]));_0xd5d6a7[_0xc3f8('0x32')]=_0xd5d6a7[_0xc3f8('0x32')]['length']?_0xd5d6a7[_0xc3f8('0x32')]:_0x5c6f6e[_0xc3f8('0x31')];if(!_0x326dcc[_0xc3f8('0x2f')][_0xc3f8('0x36')](_0xc3f8('0x37'))){_0xd5d6a7['limit']=qs[_0xc3f8('0x1b')](_0x326dcc[_0xc3f8('0x2f')][_0xc3f8('0x1b')]);_0xd5d6a7[_0xc3f8('0x1a')]=qs[_0xc3f8('0x1a')](_0x326dcc[_0xc3f8('0x2f')]['offset']);}_0xd5d6a7[_0xc3f8('0x38')]=qs[_0xc3f8('0x39')](_0x326dcc[_0xc3f8('0x2f')]['sort']);_0xd5d6a7[_0xc3f8('0x3a')]=qs[_0xc3f8('0x3c')](_['pick'](_0x326dcc['query'],_0x5c6f6e[_0xc3f8('0x3c')]));if(_0x326dcc[_0xc3f8('0x2f')]['filter']){_0xd5d6a7[_0xc3f8('0x3a')]=_[_0xc3f8('0x3e')](_0xd5d6a7[_0xc3f8('0x3a')],{'$or':_[_0xc3f8('0x29')](_0xd5d6a7[_0xc3f8('0x32')],function(_0x30a23a){var _0x1e62ec={};_0x1e62ec[_0x30a23a]={'$like':'%'+_0x326dcc[_0xc3f8('0x2f')]['filter']+'%'};return _0x1e62ec;})});}_0xd5d6a7['where']=_[_0xc3f8('0x3e')](_0xd5d6a7['where'],{'mailboxuser':_0x337029['mailbox']});_0xd5d6a7=_['merge']({},_0xd5d6a7,_0x326dcc['options']);return db['VoiceMailMessage'][_0xc3f8('0x52')](_0xd5d6a7)[_0xc3f8('0x21')](respondWithFilteredResult(_0x2f1b68,_0xd5d6a7));})[_0xc3f8('0x47')](handleError(_0x2f1b68,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 2e37566..6ddb3c7 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 _0x9480=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox','context'];(function(_0x3e7de4,_0x574164){var _0x1511b2=function(_0x2b2c5b){while(--_0x2b2c5b){_0x3e7de4['push'](_0x3e7de4['shift']());}};_0x1511b2(++_0x574164);}(_0x9480,0x11d));var _0x0948=function(_0x5ea2b1,_0x50f848){_0x5ea2b1=_0x5ea2b1-0x0;var _0x1773c0=_0x9480[_0x5ea2b1];return _0x1773c0;};'use strict';var _=require(_0x0948('0x0'));var util=require(_0x0948('0x1'));var logger=require('../../config/logger')(_0x0948('0x2'));var moment=require(_0x0948('0x3'));var BPromise=require(_0x0948('0x4'));var rp=require(_0x0948('0x5'));var fs=require('fs');var path=require(_0x0948('0x6'));var rimraf=require('rimraf');var config=require(_0x0948('0x7'));var attributes=require(_0x0948('0x8'));module[_0x0948('0x9')]=function(_0x522434,_0x3fdc4a){return _0x522434[_0x0948('0xa')](_0x0948('0xb'),attributes,{'tableName':_0x0948('0xc'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x0948('0xd'),_0x0948('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x25fa=['mailbox_context','mailbox','context','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail'];(function(_0x4da1fb,_0x5141ac){var _0x44b642=function(_0x5c0745){while(--_0x5c0745){_0x4da1fb['push'](_0x4da1fb['shift']());}};_0x44b642(++_0x5141ac);}(_0x25fa,0x7b));var _0xa25f=function(_0x3b49a0,_0x479050){_0x3b49a0=_0x3b49a0-0x0;var _0xf946bd=_0x25fa[_0x3b49a0];return _0xf946bd;};'use strict';var _=require(_0xa25f('0x0'));var util=require('util');var logger=require(_0xa25f('0x1'))(_0xa25f('0x2'));var moment=require(_0xa25f('0x3'));var BPromise=require('bluebird');var rp=require(_0xa25f('0x4'));var fs=require('fs');var path=require(_0xa25f('0x5'));var rimraf=require(_0xa25f('0x6'));var config=require(_0xa25f('0x7'));var attributes=require(_0xa25f('0x8'));module[_0xa25f('0x9')]=function(_0x52f886,_0x19132c){return _0x52f886[_0xa25f('0xa')](_0xa25f('0xb'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0xa25f('0xc'),'fields':[_0xa25f('0xd'),_0xa25f('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 1b41cad..9f16bbe 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 _0x9e65=['request\x20sent','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','VoiceMail,\x20%s,\x20%s'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x9e65,0x123));var _0x59e6=function(_0x568f96,_0x32d489){_0x568f96=_0x568f96-0x0;var _0x5a053a=_0x9e65[_0x568f96];return _0x5a053a;};'use strict';var _=require(_0x59e6('0x0'));var util=require(_0x59e6('0x1'));var moment=require('moment');var BPromise=require(_0x59e6('0x2'));var rs=require(_0x59e6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x59e6('0x4'))['db'];var utils=require(_0x59e6('0x5'));var logger=require('../../config/logger')(_0x59e6('0x6'));var config=require(_0x59e6('0x7'));var jayson=require(_0x59e6('0x8'));var client=jayson[_0x59e6('0x9')][_0x59e6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x31250e,_0x3bbe7c,_0x1357e9){return new BPromise(function(_0x12d602,_0x299f81){return client['request'](_0x31250e,_0x1357e9)[_0x59e6('0xb')](function(_0x362e16){logger['info'](_0x59e6('0xc'),_0x3bbe7c,'request\x20sent');logger['debug']('VoiceMail,\x20%s,\x20%s,\x20%s',_0x3bbe7c,_0x59e6('0xd'),JSON[_0x59e6('0xe')](_0x362e16));if(_0x362e16['error']){if(_0x362e16['error']['code']===0x1f4){logger[_0x59e6('0xf')](_0x59e6('0xc'),_0x3bbe7c,_0x362e16[_0x59e6('0xf')][_0x59e6('0x10')]);return _0x299f81(_0x362e16[_0x59e6('0xf')][_0x59e6('0x10')]);}logger[_0x59e6('0xf')](_0x59e6('0xc'),_0x3bbe7c,_0x362e16[_0x59e6('0xf')][_0x59e6('0x10')]);return _0x12d602(_0x362e16[_0x59e6('0xf')]['message']);}else{logger['info'](_0x59e6('0xc'),_0x3bbe7c,_0x59e6('0xd'));_0x12d602(_0x362e16[_0x59e6('0x11')]['message']);}})[_0x59e6('0x12')](function(_0x2167e6){logger[_0x59e6('0xf')]('VoiceMail,\x20%s,\x20%s',_0x3bbe7c,_0x2167e6);_0x299f81(_0x2167e6);});});} \ No newline at end of file +var _0xc4a4=['debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','info','VoiceMail,\x20%s,\x20%s','request\x20sent'];(function(_0x1346b9,_0x698f66){var _0x172e06=function(_0x291214){while(--_0x291214){_0x1346b9['push'](_0x1346b9['shift']());}};_0x172e06(++_0x698f66);}(_0xc4a4,0xd6));var _0x4c4a=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xc4a4[_0x21aec3];return _0x288bbc;};'use strict';var _=require(_0x4c4a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4c4a('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x4c4a('0x2'));var logger=require('../../config/logger')('rpc');var config=require(_0x4c4a('0x3'));var jayson=require(_0x4c4a('0x4'));var client=jayson[_0x4c4a('0x5')][_0x4c4a('0x6')]({'port':0x232a});function respondWithRpcPromise(_0xa6cd95,_0x44998a,_0x532db2){return new BPromise(function(_0x586c06,_0x50b702){return client['request'](_0xa6cd95,_0x532db2)['then'](function(_0x52ec6e){logger[_0x4c4a('0x7')](_0x4c4a('0x8'),_0x44998a,_0x4c4a('0x9'));logger[_0x4c4a('0xa')](_0x4c4a('0xb'),_0x44998a,_0x4c4a('0x9'),JSON[_0x4c4a('0xc')](_0x52ec6e));if(_0x52ec6e[_0x4c4a('0xd')]){if(_0x52ec6e['error']['code']===0x1f4){logger[_0x4c4a('0xd')]('VoiceMail,\x20%s,\x20%s',_0x44998a,_0x52ec6e[_0x4c4a('0xd')]['message']);return _0x50b702(_0x52ec6e[_0x4c4a('0xd')][_0x4c4a('0xe')]);}logger[_0x4c4a('0xd')]('VoiceMail,\x20%s,\x20%s',_0x44998a,_0x52ec6e[_0x4c4a('0xd')][_0x4c4a('0xe')]);return _0x586c06(_0x52ec6e['error'][_0x4c4a('0xe')]);}else{logger[_0x4c4a('0x7')](_0x4c4a('0x8'),_0x44998a,_0x4c4a('0x9'));_0x586c06(_0x52ec6e['result'][_0x4c4a('0xe')]);}})[_0x4c4a('0xf')](function(_0x59d370){logger['error'](_0x4c4a('0x8'),_0x44998a,_0x59d370);_0x50b702(_0x59d370);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 5c88b5d..aab9e16 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 _0xca3a=['get','isAuthenticated','show','/:id/download','download','post','create','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment'];(function(_0x4ab968,_0x5d5d1d){var _0x1557ef=function(_0x116812){while(--_0x116812){_0x4ab968['push'](_0x4ab968['shift']());}};_0x1557ef(++_0x5d5d1d);}(_0xca3a,0x1df));var _0xaca3=function(_0x16772b,_0x1f0b93){_0x16772b=_0x16772b-0x0;var _0x4a49cd=_0xca3a[_0x16772b];return _0x4a49cd;};'use strict';var multer=require(_0xaca3('0x0'));var util=require(_0xaca3('0x1'));var path=require(_0xaca3('0x2'));var timeout=require(_0xaca3('0x3'));var express=require('express');var router=express[_0xaca3('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xaca3('0x5'));var config=require(_0xaca3('0x6'));var controller=require('./voiceMailMessage.controller');router[_0xaca3('0x7')]('/',auth[_0xaca3('0x8')](),controller['index']);router[_0xaca3('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xaca3('0x9')]);router[_0xaca3('0x7')](_0xaca3('0xa'),auth['isAuthenticated'](),controller[_0xaca3('0xb')]);router[_0xaca3('0xc')]('/',auth['isAuthenticated'](),controller[_0xaca3('0xd')]);router['put'](_0xaca3('0xe'),auth['isAuthenticated'](),controller['update']);router[_0xaca3('0xf')](_0xaca3('0xe'),auth[_0xaca3('0x8')](),controller[_0xaca3('0x10')]);module[_0xaca3('0x11')]=router; \ No newline at end of file +var _0x5e40=['../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/download','download','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x25f0da,_0x416b28){var _0x1d7a3d=function(_0x103569){while(--_0x103569){_0x25f0da['push'](_0x25f0da['shift']());}};_0x1d7a3d(++_0x416b28);}(_0x5e40,0x1f2));var _0x05e4=function(_0x33cb97,_0x2be8e8){_0x33cb97=_0x33cb97-0x0;var _0xe85595=_0x5e40[_0x33cb97];return _0xe85595;};'use strict';var multer=require(_0x05e4('0x0'));var util=require(_0x05e4('0x1'));var path=require(_0x05e4('0x2'));var timeout=require(_0x05e4('0x3'));var express=require('express');var router=express[_0x05e4('0x4')]();var fs_extra=require(_0x05e4('0x5'));var auth=require(_0x05e4('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x05e4('0x7'));var controller=require('./voiceMailMessage.controller');router['get']('/',auth[_0x05e4('0x8')](),controller[_0x05e4('0x9')]);router[_0x05e4('0xa')](_0x05e4('0xb'),auth[_0x05e4('0x8')](),controller[_0x05e4('0xc')]);router['get'](_0x05e4('0xd'),auth['isAuthenticated'](),controller[_0x05e4('0xe')]);router[_0x05e4('0xf')]('/',auth[_0x05e4('0x8')](),controller[_0x05e4('0x10')]);router[_0x05e4('0x11')](_0x05e4('0xb'),auth[_0x05e4('0x8')](),controller['update']);router[_0x05e4('0x12')](_0x05e4('0xb'),auth[_0x05e4('0x8')](),controller[_0x05e4('0x13')]);module[_0x05e4('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 9fba232..c1a0820 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 _0x0d61=['sequelize','exports','VIRTUAL','INTEGER','STRING','BLOB','long','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x0d61,0xfc));var _0x10d6=function(_0xfe1663,_0x38231e){_0xfe1663=_0xfe1663-0x0;var _0x2b8973=_0x0d61[_0xfe1663];return _0x2b8973;};'use strict';var Sequelize=require(_0x10d6('0x0'));module[_0x10d6('0x1')]={'name':{'type':Sequelize[_0x10d6('0x2')],'get':function(_0x48522a){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0x10d6('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x10d6('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0x10d6('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0x10d6('0x4')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0x10d6('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x10d6('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x10d6('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0x10d6('0x5')](_0x10d6('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0x10d6('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0x10d6('0x7')](_0x10d6('0x8'))}}; \ No newline at end of file +var _0xf417=['INTEGER','STRING','BLOB','long','TIMESTAMP','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','exports','getDataValue'];(function(_0x26dbab,_0x1d24c8){var _0x53de6d=function(_0x23e76e){while(--_0x23e76e){_0x26dbab['push'](_0x26dbab['shift']());}};_0x53de6d(++_0x1d24c8);}(_0xf417,0x1b6));var _0x7f41=function(_0x26b2a2,_0x50428a){_0x26b2a2=_0x26b2a2-0x0;var _0x139d27=_0xf417[_0x26b2a2];return _0x139d27;};'use strict';var Sequelize=require('sequelize');module[_0x7f41('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x2bfe5b){return this[_0x7f41('0x1')]('id');}},'msgnum':{'type':Sequelize[_0x7f41('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x7f41('0x3')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x7f41('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0x7f41('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0x7f41('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0x7f41('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x7f41('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x7f41('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0x7f41('0x4')](_0x7f41('0x5')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x7f41('0x3')],'defaultValue':''},'stamp':{'type':_0x7f41('0x6'),'defaultValue':Sequelize['literal'](_0x7f41('0x7'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 92d992a..aa0792f 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 _0x9fec=['nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','update','body','download','msg_id','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','then','destroy','sendStatus','error','stack','name','send','index','map','VoiceMailMessage','rawAttributes','type','model','differenceBy','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x4fa903,_0x4bb87d){var _0x556e84=function(_0x261c70){while(--_0x261c70){_0x4fa903['push'](_0x4fa903['shift']());}};_0x556e84(++_0x4bb87d);}(_0x9fec,0x123));var _0xc9fe=function(_0x1f530d,_0x18a19e){_0x1f530d=_0x1f530d-0x0;var _0x22103f=_0x9fec[_0x1f530d];return _0x22103f;};'use strict';var emlformat=require(_0xc9fe('0x0'));var rimraf=require(_0xc9fe('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc9fe('0x2'));var moment=require(_0xc9fe('0x3'));var BPromise=require(_0xc9fe('0x4'));var Mustache=require('mustache');var util=require(_0xc9fe('0x5'));var path=require(_0xc9fe('0x6'));var sox=require(_0xc9fe('0x7'));var csv=require(_0xc9fe('0x8'));var ejs=require(_0xc9fe('0x9'));var fs=require('fs');var fs_extra=require(_0xc9fe('0xa'));var _=require(_0xc9fe('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc9fe('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xc9fe('0x8'));var querystring=require(_0xc9fe('0xd'));var Papa=require(_0xc9fe('0xe'));var Redis=require(_0xc9fe('0xf'));var authService=require(_0xc9fe('0x10'));var qs=require(_0xc9fe('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc9fe('0x12'));var logger=require(_0xc9fe('0x13'))(_0xc9fe('0x14'));var utils=require('../../config/utils');var config=require(_0xc9fe('0x15'));var licenseUtil=require(_0xc9fe('0x16'));var db=require(_0xc9fe('0x17'))['db'];function respondWithStatusCode(_0x474998,_0x3e4cab){_0x3e4cab=_0x3e4cab||0xcc;return function(_0x2adcc5){if(_0x2adcc5){return _0x474998['sendStatus'](_0x3e4cab);}return _0x474998['status'](_0x3e4cab)[_0xc9fe('0x18')]();};}function respondWithResult(_0x31fe3c,_0x250f19){_0x250f19=_0x250f19||0xc8;return function(_0x1aba0c){if(_0x1aba0c){return _0x31fe3c[_0xc9fe('0x19')](_0x250f19)[_0xc9fe('0x1a')](_0x1aba0c);}};}function respondWithFilteredResult(_0x298a35,_0x5d1b7a){return function(_0x1e6779){if(_0x1e6779){var _0x44c329=typeof _0x5d1b7a[_0xc9fe('0x1b')]==='undefined'&&typeof _0x5d1b7a[_0xc9fe('0x1c')]===_0xc9fe('0x1d');var _0x3da9d1=_0x1e6779[_0xc9fe('0x1e')];var _0x252a8c=_0x44c329?0x0:_0x5d1b7a[_0xc9fe('0x1b')];var _0xb06daf=_0x44c329?_0x1e6779[_0xc9fe('0x1e')]:_0x5d1b7a[_0xc9fe('0x1b')]+_0x5d1b7a[_0xc9fe('0x1c')];var _0x58268f;if(_0xb06daf>=_0x3da9d1){_0xb06daf=_0x3da9d1;_0x58268f=0xc8;}else{_0x58268f=0xce;}_0x298a35[_0xc9fe('0x19')](_0x58268f);return _0x298a35[_0xc9fe('0x1f')](_0xc9fe('0x20'),_0x252a8c+'-'+_0xb06daf+'/'+_0x3da9d1)[_0xc9fe('0x1a')](_0x1e6779);}return null;};}function patchUpdates(_0x3e1521){return function(_0x243dc0){try{jsonpatch['apply'](_0x243dc0,_0x3e1521,!![]);}catch(_0x408eba){return BPromise[_0xc9fe('0x21')](_0x408eba);}return _0x243dc0[_0xc9fe('0x22')]();};}function saveUpdates(_0x594355,_0x485b1d){return function(_0x4ad890){if(_0x4ad890){return _0x4ad890['update'](_0x594355)[_0xc9fe('0x23')](function(_0x3d6277){return _0x3d6277;});}return null;};}function removeEntity(_0x520185,_0x1f729e){return function(_0x29df97){if(_0x29df97){return _0x29df97[_0xc9fe('0x24')]()[_0xc9fe('0x23')](function(){_0x520185[_0xc9fe('0x19')](0xcc)[_0xc9fe('0x18')]();});}};}function handleEntityNotFound(_0x50e2af,_0xb382f5){return function(_0xf7fb93){if(!_0xf7fb93){_0x50e2af[_0xc9fe('0x25')](0x194);}return _0xf7fb93;};}function handleError(_0x19399c,_0x107b37){_0x107b37=_0x107b37||0x1f4;return function(_0x766933){logger[_0xc9fe('0x26')](_0x766933[_0xc9fe('0x27')]);if(_0x766933[_0xc9fe('0x28')]){delete _0x766933[_0xc9fe('0x28')];}_0x19399c['status'](_0x107b37)[_0xc9fe('0x29')](_0x766933);};}exports[_0xc9fe('0x2a')]=function(_0x4a4813,_0x133fc0){var _0x30bc7f={},_0x55bb41={},_0xc407d4={'count':0x0,'rows':[]};var _0x62a3cd=_[_0xc9fe('0x2b')](db[_0xc9fe('0x2c')][_0xc9fe('0x2d')],function(_0x53cce3){return{'name':_0x53cce3['fieldName'],'type':_0x53cce3[_0xc9fe('0x2e')]['key']};});_0x55bb41[_0xc9fe('0x2f')]=_[_0xc9fe('0x30')](_['map'](_0x62a3cd,_0xc9fe('0x28')),[_0xc9fe('0x28')]);_0x55bb41[_0xc9fe('0x31')]=_[_0xc9fe('0x32')](_0x4a4813[_0xc9fe('0x31')]);_0x55bb41[_0xc9fe('0x33')]=_[_0xc9fe('0x34')](_0x55bb41[_0xc9fe('0x2f')],_0x55bb41[_0xc9fe('0x31')]);_0x30bc7f[_0xc9fe('0x35')]=_[_0xc9fe('0x34')](_0x55bb41[_0xc9fe('0x2f')],qs[_0xc9fe('0x36')](_0x4a4813['query']['fields']));_0x30bc7f[_0xc9fe('0x35')]=_0x30bc7f[_0xc9fe('0x35')][_0xc9fe('0x37')]?_0x30bc7f[_0xc9fe('0x35')]:_0x55bb41[_0xc9fe('0x2f')];if(!_0x4a4813[_0xc9fe('0x31')][_0xc9fe('0x38')](_0xc9fe('0x39'))){_0x30bc7f['limit']=qs['limit'](_0x4a4813[_0xc9fe('0x31')][_0xc9fe('0x1c')]);_0x30bc7f[_0xc9fe('0x1b')]=qs[_0xc9fe('0x1b')](_0x4a4813['query'][_0xc9fe('0x1b')]);}_0x30bc7f[_0xc9fe('0x3a')]=qs[_0xc9fe('0x3b')](_0x4a4813[_0xc9fe('0x31')]['sort']);_0x30bc7f[_0xc9fe('0x3c')]=qs['filters'](_[_0xc9fe('0x3d')](_0x4a4813['query'],_0x55bb41[_0xc9fe('0x33')]),_0x62a3cd);if(_0x4a4813[_0xc9fe('0x31')][_0xc9fe('0x3e')]){_0x30bc7f['where']=_[_0xc9fe('0x3f')](_0x30bc7f['where'],{'$or':_['map'](_0x62a3cd,function(_0x4ca3f4){if(_0x4ca3f4[_0xc9fe('0x2e')]!==_0xc9fe('0x40')){var _0x43e6d6={};_0x43e6d6[_0x4ca3f4['name']]={'$like':'%'+_0x4a4813[_0xc9fe('0x31')]['filter']+'%'};return _0x43e6d6;}})});}_0x30bc7f=_[_0xc9fe('0x3f')]({},_0x30bc7f,_0x4a4813[_0xc9fe('0x41')]);var _0x2983a6={'where':_0x30bc7f[_0xc9fe('0x3c')]};return db[_0xc9fe('0x2c')][_0xc9fe('0x1e')](_0x2983a6)[_0xc9fe('0x23')](function(_0x3271ed){_0xc407d4[_0xc9fe('0x1e')]=_0x3271ed;if(_0x4a4813[_0xc9fe('0x31')]['includeAll']){_0x30bc7f[_0xc9fe('0x42')]=[{'all':!![]}];}return db[_0xc9fe('0x2c')][_0xc9fe('0x43')](_0x30bc7f);})['then'](function(_0x1bd540){_0xc407d4[_0xc9fe('0x44')]=_0x1bd540;return _0xc407d4;})[_0xc9fe('0x23')](respondWithFilteredResult(_0x133fc0,_0x30bc7f))[_0xc9fe('0x45')](handleError(_0x133fc0,null));};exports[_0xc9fe('0x46')]=function(_0x53676b,_0xf7474){var _0x5610bf={'raw':!![],'where':{'id':_0x53676b[_0xc9fe('0x47')]['id']}},_0x22a69e={};_0x22a69e[_0xc9fe('0x2f')]=_['keys'](db[_0xc9fe('0x2c')][_0xc9fe('0x2d')]);_0x22a69e[_0xc9fe('0x31')]=_[_0xc9fe('0x32')](_0x53676b['query']);_0x22a69e[_0xc9fe('0x33')]=_['intersection'](_0x22a69e[_0xc9fe('0x2f')],_0x22a69e[_0xc9fe('0x31')]);_0x5610bf[_0xc9fe('0x35')]=_['intersection'](_0x22a69e['model'],qs[_0xc9fe('0x36')](_0x53676b[_0xc9fe('0x31')]['fields']));_0x5610bf[_0xc9fe('0x35')]=_0x5610bf[_0xc9fe('0x35')][_0xc9fe('0x37')]?_0x5610bf['attributes']:_0x22a69e['model'];if(_0x53676b[_0xc9fe('0x31')][_0xc9fe('0x48')]){_0x5610bf[_0xc9fe('0x42')]=[{'all':!![]}];}_0x5610bf=_[_0xc9fe('0x3f')]({},_0x5610bf,_0x53676b['options']);return db[_0xc9fe('0x2c')][_0xc9fe('0x49')](_0x5610bf)[_0xc9fe('0x23')](handleEntityNotFound(_0xf7474,null))[_0xc9fe('0x23')](respondWithResult(_0xf7474,null))[_0xc9fe('0x45')](handleError(_0xf7474,null));};exports[_0xc9fe('0x4a')]=function(_0x12cff8,_0x2ac053){return db[_0xc9fe('0x2c')][_0xc9fe('0x4a')](_0x12cff8['body'],{})[_0xc9fe('0x23')](respondWithResult(_0x2ac053,0xc9))[_0xc9fe('0x45')](handleError(_0x2ac053,null));};exports[_0xc9fe('0x4b')]=function(_0x4e3bea,_0xfd9ea9){if(_0x4e3bea[_0xc9fe('0x4c')]['id']){delete _0x4e3bea[_0xc9fe('0x4c')]['id'];}return db[_0xc9fe('0x2c')][_0xc9fe('0x49')]({'where':{'id':_0x4e3bea['params']['id']}})[_0xc9fe('0x23')](handleEntityNotFound(_0xfd9ea9,null))['then'](saveUpdates(_0x4e3bea['body'],null))[_0xc9fe('0x23')](respondWithResult(_0xfd9ea9,null))[_0xc9fe('0x45')](handleError(_0xfd9ea9,null));};exports['destroy']=function(_0x1d0a41,_0x5bbaeb){return db[_0xc9fe('0x2c')][_0xc9fe('0x49')]({'where':{'id':_0x1d0a41[_0xc9fe('0x47')]['id']}})[_0xc9fe('0x23')](handleEntityNotFound(_0x5bbaeb,null))[_0xc9fe('0x23')](removeEntity(_0x5bbaeb,null))['catch'](handleError(_0x5bbaeb,null));};exports[_0xc9fe('0x4d')]=function(_0x2713ef,_0x2b65a3,_0x12d93e){return db[_0xc9fe('0x2c')][_0xc9fe('0x49')]({'where':{'id':_0x2713ef[_0xc9fe('0x47')]['id']},'attributes':['id','recording',_0xc9fe('0x4e')]})[_0xc9fe('0x23')](handleEntityNotFound(_0x2b65a3,null))[_0xc9fe('0x23')](function(_0x3c2b5e){if(_0x3c2b5e){if(!_0x3c2b5e[_0xc9fe('0x4f')]){throw new db[(_0xc9fe('0x50'))][(_0xc9fe('0x51'))](_0xc9fe('0x52'));}var _0x2377a2={'Content-Type':_0xc9fe('0x53'),'Content-Disposition':_0xc9fe('0x54')};if(_0x3c2b5e[_0xc9fe('0x4e')]){_0x2377a2[_0xc9fe('0x55')]=_0xc9fe('0x56')+_0x3c2b5e[_0xc9fe('0x4e')]+'.wav\x22';}_0x2b65a3['set'](_0x2377a2);return _0x2b65a3[_0xc9fe('0x29')](new Buffer(_0x3c2b5e[_0xc9fe('0x4f')]));}})['catch'](handleError(_0x2b65a3,null));}; \ No newline at end of file +var _0x5480=['set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','VoiceMailMessage','rawAttributes','key','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','show','params','find','create','body','catch','recording','Sequelize','ValidationError','audio/wav','attachment','msg_id','eml-format','rimraf','request-promise','moment','mustache','util','path','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x5480,0xcf));var _0x0548=function(_0x4953da,_0x5adaca){_0x4953da=_0x4953da-0x0;var _0x2d3780=_0x5480[_0x4953da];return _0x2d3780;};'use strict';var emlformat=require(_0x0548('0x0'));var rimraf=require(_0x0548('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0548('0x2'));var moment=require(_0x0548('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0548('0x4'));var util=require(_0x0548('0x5'));var path=require(_0x0548('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(_0x0548('0x7'));var squel=require('squel');var crypto=require(_0x0548('0x8'));var jsforce=require(_0x0548('0x9'));var deskjs=require(_0x0548('0xa'));var toCsv=require(_0x0548('0xb'));var querystring=require(_0x0548('0xc'));var Papa=require(_0x0548('0xd'));var Redis=require(_0x0548('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x0548('0xf'));var as=require(_0x0548('0x10'));var hardwareService=require(_0x0548('0x11'));var logger=require('../../config/logger')(_0x0548('0x12'));var utils=require(_0x0548('0x13'));var config=require(_0x0548('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x0548('0x15'))['db'];function respondWithStatusCode(_0x3c1953,_0x2ae5a1){_0x2ae5a1=_0x2ae5a1||0xcc;return function(_0x379206){if(_0x379206){return _0x3c1953[_0x0548('0x16')](_0x2ae5a1);}return _0x3c1953[_0x0548('0x17')](_0x2ae5a1)[_0x0548('0x18')]();};}function respondWithResult(_0x4b80b3,_0x55724f){_0x55724f=_0x55724f||0xc8;return function(_0x3798c2){if(_0x3798c2){return _0x4b80b3[_0x0548('0x17')](_0x55724f)[_0x0548('0x19')](_0x3798c2);}};}function respondWithFilteredResult(_0x176b31,_0x19608a){return function(_0x2965e){if(_0x2965e){var _0x3cc19b=typeof _0x19608a[_0x0548('0x1a')]===_0x0548('0x1b')&&typeof _0x19608a[_0x0548('0x1c')]===_0x0548('0x1b');var _0x907c14=_0x2965e[_0x0548('0x1d')];var _0x269aef=_0x3cc19b?0x0:_0x19608a[_0x0548('0x1a')];var _0x17200e=_0x3cc19b?_0x2965e[_0x0548('0x1d')]:_0x19608a[_0x0548('0x1a')]+_0x19608a[_0x0548('0x1c')];var _0x4224b7;if(_0x17200e>=_0x907c14){_0x17200e=_0x907c14;_0x4224b7=0xc8;}else{_0x4224b7=0xce;}_0x176b31[_0x0548('0x17')](_0x4224b7);return _0x176b31[_0x0548('0x1e')](_0x0548('0x1f'),_0x269aef+'-'+_0x17200e+'/'+_0x907c14)[_0x0548('0x19')](_0x2965e);}return null;};}function patchUpdates(_0x575d34){return function(_0x4e4d51){try{jsonpatch[_0x0548('0x20')](_0x4e4d51,_0x575d34,!![]);}catch(_0x4f3f8b){return BPromise[_0x0548('0x21')](_0x4f3f8b);}return _0x4e4d51[_0x0548('0x22')]();};}function saveUpdates(_0x16de47,_0x4a0bac){return function(_0x2ddafb){if(_0x2ddafb){return _0x2ddafb[_0x0548('0x23')](_0x16de47)[_0x0548('0x24')](function(_0x4e559f){return _0x4e559f;});}return null;};}function removeEntity(_0x1a5de5,_0xd8245b){return function(_0x464a5a){if(_0x464a5a){return _0x464a5a[_0x0548('0x25')]()['then'](function(){_0x1a5de5[_0x0548('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2acf24,_0x353f76){return function(_0x344b66){if(!_0x344b66){_0x2acf24[_0x0548('0x16')](0x194);}return _0x344b66;};}function handleError(_0x1b2ac8,_0x5576a1){_0x5576a1=_0x5576a1||0x1f4;return function(_0x337c36){logger[_0x0548('0x26')](_0x337c36[_0x0548('0x27')]);if(_0x337c36[_0x0548('0x28')]){delete _0x337c36[_0x0548('0x28')];}_0x1b2ac8['status'](_0x5576a1)[_0x0548('0x29')](_0x337c36);};}exports[_0x0548('0x2a')]=function(_0x35938a,_0x4d2b81){var _0x220e0c={},_0x345220={},_0x1678ff={'count':0x0,'rows':[]};var _0x3651be=_[_0x0548('0x2b')](db[_0x0548('0x2c')][_0x0548('0x2d')],function(_0x5ba723){return{'name':_0x5ba723['fieldName'],'type':_0x5ba723['type'][_0x0548('0x2e')]};});_0x345220['model']=_['differenceBy'](_[_0x0548('0x2b')](_0x3651be,_0x0548('0x28')),[_0x0548('0x28')]);_0x345220[_0x0548('0x2f')]=_[_0x0548('0x30')](_0x35938a[_0x0548('0x2f')]);_0x345220['filters']=_[_0x0548('0x31')](_0x345220[_0x0548('0x32')],_0x345220['query']);_0x220e0c[_0x0548('0x33')]=_[_0x0548('0x31')](_0x345220[_0x0548('0x32')],qs[_0x0548('0x34')](_0x35938a[_0x0548('0x2f')]['fields']));_0x220e0c[_0x0548('0x33')]=_0x220e0c[_0x0548('0x33')][_0x0548('0x35')]?_0x220e0c[_0x0548('0x33')]:_0x345220['model'];if(!_0x35938a[_0x0548('0x2f')]['hasOwnProperty'](_0x0548('0x36'))){_0x220e0c[_0x0548('0x1c')]=qs[_0x0548('0x1c')](_0x35938a['query'][_0x0548('0x1c')]);_0x220e0c['offset']=qs[_0x0548('0x1a')](_0x35938a['query'][_0x0548('0x1a')]);}_0x220e0c[_0x0548('0x37')]=qs['sort'](_0x35938a[_0x0548('0x2f')][_0x0548('0x38')]);_0x220e0c[_0x0548('0x39')]=qs[_0x0548('0x3a')](_['pick'](_0x35938a[_0x0548('0x2f')],_0x345220[_0x0548('0x3a')]),_0x3651be);if(_0x35938a[_0x0548('0x2f')][_0x0548('0x3b')]){_0x220e0c[_0x0548('0x39')]=_[_0x0548('0x3c')](_0x220e0c[_0x0548('0x39')],{'$or':_[_0x0548('0x2b')](_0x3651be,function(_0x3292a3){if(_0x3292a3[_0x0548('0x3d')]!==_0x0548('0x3e')){var _0x5086c8={};_0x5086c8[_0x3292a3['name']]={'$like':'%'+_0x35938a[_0x0548('0x2f')]['filter']+'%'};return _0x5086c8;}})});}_0x220e0c=_[_0x0548('0x3c')]({},_0x220e0c,_0x35938a[_0x0548('0x3f')]);var _0x474c52={'where':_0x220e0c[_0x0548('0x39')]};return db[_0x0548('0x2c')][_0x0548('0x1d')](_0x474c52)['then'](function(_0x51151d){_0x1678ff[_0x0548('0x1d')]=_0x51151d;if(_0x35938a[_0x0548('0x2f')][_0x0548('0x40')]){_0x220e0c[_0x0548('0x41')]=[{'all':!![]}];}return db[_0x0548('0x2c')][_0x0548('0x42')](_0x220e0c);})[_0x0548('0x24')](function(_0x26b239){_0x1678ff['rows']=_0x26b239;return _0x1678ff;})[_0x0548('0x24')](respondWithFilteredResult(_0x4d2b81,_0x220e0c))['catch'](handleError(_0x4d2b81,null));};exports[_0x0548('0x43')]=function(_0xb64a98,_0x387de9){var _0x136219={'raw':!![],'where':{'id':_0xb64a98[_0x0548('0x44')]['id']}},_0x1eddf0={};_0x1eddf0[_0x0548('0x32')]=_[_0x0548('0x30')](db[_0x0548('0x2c')][_0x0548('0x2d')]);_0x1eddf0['query']=_['keys'](_0xb64a98[_0x0548('0x2f')]);_0x1eddf0['filters']=_[_0x0548('0x31')](_0x1eddf0[_0x0548('0x32')],_0x1eddf0['query']);_0x136219[_0x0548('0x33')]=_[_0x0548('0x31')](_0x1eddf0[_0x0548('0x32')],qs[_0x0548('0x34')](_0xb64a98['query'][_0x0548('0x34')]));_0x136219[_0x0548('0x33')]=_0x136219[_0x0548('0x33')][_0x0548('0x35')]?_0x136219['attributes']:_0x1eddf0[_0x0548('0x32')];if(_0xb64a98[_0x0548('0x2f')][_0x0548('0x40')]){_0x136219[_0x0548('0x41')]=[{'all':!![]}];}_0x136219=_['merge']({},_0x136219,_0xb64a98['options']);return db[_0x0548('0x2c')][_0x0548('0x45')](_0x136219)['then'](handleEntityNotFound(_0x387de9,null))['then'](respondWithResult(_0x387de9,null))['catch'](handleError(_0x387de9,null));};exports[_0x0548('0x46')]=function(_0x5e7931,_0x2ee15d){return db[_0x0548('0x2c')][_0x0548('0x46')](_0x5e7931[_0x0548('0x47')],{})[_0x0548('0x24')](respondWithResult(_0x2ee15d,0xc9))[_0x0548('0x48')](handleError(_0x2ee15d,null));};exports[_0x0548('0x23')]=function(_0x536291,_0x5a07e2){if(_0x536291[_0x0548('0x47')]['id']){delete _0x536291[_0x0548('0x47')]['id'];}return db['VoiceMailMessage']['find']({'where':{'id':_0x536291[_0x0548('0x44')]['id']}})['then'](handleEntityNotFound(_0x5a07e2,null))['then'](saveUpdates(_0x536291[_0x0548('0x47')],null))[_0x0548('0x24')](respondWithResult(_0x5a07e2,null))[_0x0548('0x48')](handleError(_0x5a07e2,null));};exports[_0x0548('0x25')]=function(_0x183a21,_0xf502b3){return db[_0x0548('0x2c')][_0x0548('0x45')]({'where':{'id':_0x183a21[_0x0548('0x44')]['id']}})[_0x0548('0x24')](handleEntityNotFound(_0xf502b3,null))[_0x0548('0x24')](removeEntity(_0xf502b3,null))['catch'](handleError(_0xf502b3,null));};exports['download']=function(_0x15b881,_0x1c5277,_0x430deb){return db[_0x0548('0x2c')]['find']({'where':{'id':_0x15b881[_0x0548('0x44')]['id']},'attributes':['id',_0x0548('0x49'),'msg_id']})[_0x0548('0x24')](handleEntityNotFound(_0x1c5277,null))['then'](function(_0x1664de){if(_0x1664de){if(!_0x1664de['recording']){throw new db[(_0x0548('0x4a'))][(_0x0548('0x4b'))]('VoiceMailMessage\x20not\x20found');}var _0xb470cf={'Content-Type':_0x0548('0x4c'),'Content-Disposition':_0x0548('0x4d')};if(_0x1664de[_0x0548('0x4e')]){_0xb470cf['Content-Disposition']='attachment;\x20filename=\x22'+_0x1664de[_0x0548('0x4e')]+'.wav\x22';}_0x1c5277['set'](_0xb470cf);return _0x1c5277[_0x0548('0x29')](new Buffer(_0x1664de[_0x0548('0x49')]));}})[_0x0548('0x48')](handleError(_0x1c5277,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index fc3caf2..6abca58 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 _0xe96e=['voice_voicemail_messages','dir','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./voiceMailMessage.attributes','define'];(function(_0x26e727,_0x3e65be){var _0x563800=function(_0xbcf999){while(--_0xbcf999){_0x26e727['push'](_0x26e727['shift']());}};_0x563800(++_0x3e65be);}(_0xe96e,0x1ca));var _0xee96=function(_0x3d0c97,_0x2dd9f4){_0x3d0c97=_0x3d0c97-0x0;var _0x4504b3=_0xe96e[_0x3d0c97];return _0x4504b3;};'use strict';var _=require(_0xee96('0x0'));var util=require(_0xee96('0x1'));var logger=require(_0xee96('0x2'))(_0xee96('0x3'));var moment=require(_0xee96('0x4'));var BPromise=require('bluebird');var rp=require(_0xee96('0x5'));var fs=require('fs');var path=require(_0xee96('0x6'));var rimraf=require('rimraf');var config=require(_0xee96('0x7'));var attributes=require(_0xee96('0x8'));module['exports']=function(_0x2eee9,_0x1f5ad8){return _0x2eee9[_0xee96('0x9')]('VoiceMailMessage',attributes,{'tableName':_0xee96('0xa'),'paranoid':![],'indexes':[{'name':_0xee96('0xb'),'fields':[_0xee96('0xb')]}],'timestamps':![]});}; \ No newline at end of file +var _0x2123=['bluebird','request-promise','path','../../config/environment','define','dir','util','moment'];(function(_0x4f7736,_0x559966){var _0x444cbd=function(_0x2b3603){while(--_0x2b3603){_0x4f7736['push'](_0x4f7736['shift']());}};_0x444cbd(++_0x559966);}(_0x2123,0x116));var _0x3212=function(_0x1ff454,_0x12372d){_0x1ff454=_0x1ff454-0x0;var _0x5dcf92=_0x2123[_0x1ff454];return _0x5dcf92;};'use strict';var _=require('lodash');var util=require(_0x3212('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x3212('0x1'));var BPromise=require(_0x3212('0x2'));var rp=require(_0x3212('0x3'));var fs=require('fs');var path=require(_0x3212('0x4'));var rimraf=require('rimraf');var config=require(_0x3212('0x5'));var attributes=require('./voiceMailMessage.attributes');module['exports']=function(_0x14b7c0,_0x36bfb8){return _0x14b7c0[_0x3212('0x6')]('VoiceMailMessage',attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x3212('0x7'),'fields':[_0x3212('0x7')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index e1a4ebc..b7026bf 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 _0xe48b=['message','VoiceMailMessage,\x20%s,\x20%s','result','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','error'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0xe48b,0x143));var _0xbe48=function(_0x2a6f4,_0x898186){_0x2a6f4=_0x2a6f4-0x0;var _0x378e5d=_0xe48b[_0x2a6f4];return _0x378e5d;};'use strict';var _=require('lodash');var util=require(_0xbe48('0x0'));var moment=require(_0xbe48('0x1'));var BPromise=require(_0xbe48('0x2'));var rs=require(_0xbe48('0x3'));var fs=require('fs');var Redis=require(_0xbe48('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbe48('0x5'))(_0xbe48('0x6'));var config=require(_0xbe48('0x7'));var jayson=require(_0xbe48('0x8'));var client=jayson[_0xbe48('0x9')][_0xbe48('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x276d31,_0x359e26,_0x194737){return new BPromise(function(_0x36a0ee,_0x3312df){return client['request'](_0x276d31,_0x194737)[_0xbe48('0xb')](function(_0x13923f){logger[_0xbe48('0xc')]('VoiceMailMessage,\x20%s,\x20%s',_0x359e26,_0xbe48('0xd'));logger[_0xbe48('0xe')](_0xbe48('0xf'),_0x359e26,_0xbe48('0xd'),JSON['stringify'](_0x13923f));if(_0x13923f[_0xbe48('0x10')]){if(_0x13923f['error']['code']===0x1f4){logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x359e26,_0x13923f[_0xbe48('0x10')][_0xbe48('0x11')]);return _0x3312df(_0x13923f['error'][_0xbe48('0x11')]);}logger[_0xbe48('0x10')](_0xbe48('0x12'),_0x359e26,_0x13923f[_0xbe48('0x10')]['message']);return _0x36a0ee(_0x13923f[_0xbe48('0x10')][_0xbe48('0x11')]);}else{logger['info'](_0xbe48('0x12'),_0x359e26,_0xbe48('0xd'));_0x36a0ee(_0x13923f[_0xbe48('0x13')]['message']);}})['catch'](function(_0x205fee){logger[_0xbe48('0x10')]('VoiceMailMessage,\x20%s,\x20%s',_0x359e26,_0x205fee);_0x3312df(_0x205fee);});});} \ No newline at end of file +var _0x9948=['result','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','error','code','VoiceMailMessage,\x20%s,\x20%s','message'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x9948,0x65));var _0x8994=function(_0x316716,_0x412e5d){_0x316716=_0x316716-0x0;var _0x1b23a2=_0x9948[_0x316716];return _0x1b23a2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8994('0x0'));var BPromise=require(_0x8994('0x1'));var rs=require(_0x8994('0x2'));var fs=require('fs');var Redis=require(_0x8994('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8994('0x4'));var logger=require(_0x8994('0x5'))(_0x8994('0x6'));var config=require(_0x8994('0x7'));var jayson=require(_0x8994('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x13ac91,_0xef485a,_0xd7db04){return new BPromise(function(_0x2c9cb9,_0x5b5109){return client[_0x8994('0x9')](_0x13ac91,_0xd7db04)[_0x8994('0xa')](function(_0x25e5e8){logger[_0x8994('0xb')]('VoiceMailMessage,\x20%s,\x20%s',_0xef485a,_0x8994('0xc'));logger[_0x8994('0xd')](_0x8994('0xe'),_0xef485a,_0x8994('0xc'),JSON['stringify'](_0x25e5e8));if(_0x25e5e8[_0x8994('0xf')]){if(_0x25e5e8[_0x8994('0xf')][_0x8994('0x10')]===0x1f4){logger[_0x8994('0xf')](_0x8994('0x11'),_0xef485a,_0x25e5e8[_0x8994('0xf')][_0x8994('0x12')]);return _0x5b5109(_0x25e5e8['error'][_0x8994('0x12')]);}logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0xef485a,_0x25e5e8[_0x8994('0xf')]['message']);return _0x2c9cb9(_0x25e5e8[_0x8994('0xf')][_0x8994('0x12')]);}else{logger[_0x8994('0xb')](_0x8994('0x11'),_0xef485a,_0x8994('0xc'));_0x2c9cb9(_0x25e5e8[_0x8994('0x13')]['message']);}})['catch'](function(_0x200bc7){logger[_0x8994('0xf')](_0x8994('0x11'),_0xef485a,_0x200bc7);_0x5b5109(_0x200bc7);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 54367aa..64af600 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 _0xa9aa=['./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id','/:id/sounds','getSounds','post','create','put','update','delete','destroy','/:id/sounds/:id2','removeSound','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x275c70,_0x175071){var _0x1425cd=function(_0x3e3dad){while(--_0x3e3dad){_0x275c70['push'](_0x275c70['shift']());}};_0x1425cd(++_0x175071);}(_0xa9aa,0x178));var _0xaa9a=function(_0x2c0f7b,_0x3507bc){_0x2c0f7b=_0x2c0f7b-0x0;var _0x2670e9=_0xa9aa[_0x2c0f7b];return _0x2670e9;};'use strict';var multer=require('multer');var util=require(_0xaa9a('0x0'));var path=require('path');var timeout=require(_0xaa9a('0x1'));var express=require(_0xaa9a('0x2'));var router=express[_0xaa9a('0x3')]();var fs_extra=require(_0xaa9a('0x4'));var auth=require(_0xaa9a('0x5'));var interaction=require(_0xaa9a('0x6'));var config=require(_0xaa9a('0x7'));var controller=require(_0xaa9a('0x8'));router[_0xaa9a('0x9')]('/',auth[_0xaa9a('0xa')](),controller[_0xaa9a('0xb')]);router['get'](_0xaa9a('0xc'),auth[_0xaa9a('0xa')](),controller['show']);router[_0xaa9a('0x9')](_0xaa9a('0xd'),auth[_0xaa9a('0xa')](),controller[_0xaa9a('0xe')]);router[_0xaa9a('0xf')]('/',auth[_0xaa9a('0xa')](),controller[_0xaa9a('0x10')]);router[_0xaa9a('0xf')](_0xaa9a('0xd'),auth[_0xaa9a('0xa')](),controller['addSound']);router[_0xaa9a('0x11')](_0xaa9a('0xc'),auth['isAuthenticated'](),controller[_0xaa9a('0x12')]);router[_0xaa9a('0x13')]('/:id',auth[_0xaa9a('0xa')](),controller[_0xaa9a('0x14')]);router[_0xaa9a('0x13')](_0xaa9a('0x15'),auth['isAuthenticated'](),controller[_0xaa9a('0x16')]);module[_0xaa9a('0x17')]=router; \ No newline at end of file +var _0x262f=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','show','/:id/sounds','getSounds','create','addSound','put','/:id','update','destroy','/:id/sounds/:id2','removeSound','exports','path','connect-timeout','express','fs-extra'];(function(_0x166e96,_0x55191d){var _0x553d73=function(_0x586142){while(--_0x586142){_0x166e96['push'](_0x166e96['shift']());}};_0x553d73(++_0x55191d);}(_0x262f,0x19a));var _0xf262=function(_0xa92013,_0x3b2577){_0xa92013=_0xa92013-0x0;var _0x49fdfa=_0x262f[_0xa92013];return _0x49fdfa;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf262('0x0'));var timeout=require(_0xf262('0x1'));var express=require(_0xf262('0x2'));var router=express['Router']();var fs_extra=require(_0xf262('0x3'));var auth=require(_0xf262('0x4'));var interaction=require(_0xf262('0x5'));var config=require(_0xf262('0x6'));var controller=require(_0xf262('0x7'));router[_0xf262('0x8')]('/',auth[_0xf262('0x9')](),controller[_0xf262('0xa')]);router[_0xf262('0x8')]('/:id',auth[_0xf262('0x9')](),controller[_0xf262('0xb')]);router[_0xf262('0x8')](_0xf262('0xc'),auth[_0xf262('0x9')](),controller[_0xf262('0xd')]);router['post']('/',auth[_0xf262('0x9')](),controller[_0xf262('0xe')]);router['post']('/:id/sounds',auth[_0xf262('0x9')](),controller[_0xf262('0xf')]);router[_0xf262('0x10')](_0xf262('0x11'),auth['isAuthenticated'](),controller[_0xf262('0x12')]);router['delete'](_0xf262('0x11'),auth[_0xf262('0x9')](),controller[_0xf262('0x13')]);router['delete'](_0xf262('0x14'),auth[_0xf262('0x9')](),controller[_0xf262('0x15')]);module[_0xf262('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 8630d28..ed95a0d 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 _0xf159=['files','mp3nb','quietmp3nb','quietmp3','mp3','TIMESTAMP','BOOLEAN','sequelize','exports','STRING'];(function(_0x29cd3d,_0x575338){var _0x5ac833=function(_0x18e8e5){while(--_0x18e8e5){_0x29cd3d['push'](_0x29cd3d['shift']());}};_0x5ac833(++_0x575338);}(_0xf159,0xe3));var _0x9f15=function(_0xaac300,_0x12ac7a){_0xaac300=_0xaac300-0x0;var _0xe005ae=_0xf159[_0xaac300];return _0xe005ae;};'use strict';var Sequelize=require(_0x9f15('0x0'));module[_0x9f15('0x1')]={'name':{'type':Sequelize[_0x9f15('0x2')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize['ENUM']('custom',_0x9f15('0x3'),_0x9f15('0x4'),_0x9f15('0x5'),_0x9f15('0x6'),_0x9f15('0x7')),'allowNull':!![],'defaultValue':_0x9f15('0x3')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x9f15('0x2')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0x9f15('0x2')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0x9f15('0x2')],'allowNull':!![]},'stamp':{'type':_0x9f15('0x8')},'defaultEntry':{'type':Sequelize[_0x9f15('0x9')],'defaultValue':0x0}}; \ No newline at end of file +var _0x338b=['exports','name','ENUM','files','mp3nb','quietmp3nb','mp3','STRING','alpha','TIMESTAMP'];(function(_0x4bacb6,_0x2b299d){var _0x58c029=function(_0x2faaf5){while(--_0x2faaf5){_0x4bacb6['push'](_0x4bacb6['shift']());}};_0x58c029(++_0x2b299d);}(_0x338b,0x140));var _0xb338=function(_0x107296,_0x2a96dc){_0x107296=_0x107296-0x0;var _0x5d8061=_0x338b[_0x107296];return _0x5d8061;};'use strict';var Sequelize=require('sequelize');module[_0xb338('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb338('0x1')},'mode':{'type':Sequelize[_0xb338('0x2')]('custom',_0xb338('0x3'),_0xb338('0x4'),_0xb338('0x5'),'quietmp3',_0xb338('0x6')),'allowNull':!![],'defaultValue':_0xb338('0x3')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0xb338('0x7')],'allowNull':!![]},'digit':{'type':Sequelize[_0xb338('0x7')],'allowNull':!![]},'sort':{'type':Sequelize[_0xb338('0x7')],'allowNull':!![],'defaultValue':_0xb338('0x8')},'format':{'type':Sequelize[_0xb338('0x7')],'allowNull':!![]},'stamp':{'type':_0xb338('0x9')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index e17a832..61145c7 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 _0xe68e=['VIRTUAL','includeAll','include','findAll','rows','catch','params','options','find','update','body','create','sequelize','transaction','mode','files','directory','join','server/files/moh','mkdirSync','0777','user','get','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','createdAt','root','format','%s.%s','basename','extname','symlinkSync','removeSound','id2','getSounds','nolimit','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','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/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','MusicOnHolds','UserProfileResource','error','name','send','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge'];(function(_0xca5147,_0x54f447){var _0x27bc3c=function(_0x2175f1){while(--_0x2175f1){_0xca5147['push'](_0xca5147['shift']());}};_0x27bc3c(++_0x54f447);}(_0xe68e,0x110));var _0xee68=function(_0x3b3017,_0x531959){_0x3b3017=_0x3b3017-0x0;var _0xd8fd8d=_0xe68e[_0x3b3017];return _0xd8fd8d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xee68('0x0'));var zipdir=require(_0xee68('0x1'));var jsonpatch=require(_0xee68('0x2'));var rp=require(_0xee68('0x3'));var moment=require(_0xee68('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xee68('0x5'));var path=require('path');var sox=require(_0xee68('0x6'));var csv=require(_0xee68('0x7'));var ejs=require(_0xee68('0x8'));var fs=require('fs');var fs_extra=require(_0xee68('0x9'));var _=require(_0xee68('0xa'));var squel=require(_0xee68('0xb'));var crypto=require(_0xee68('0xc'));var jsforce=require(_0xee68('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xee68('0x7'));var querystring=require(_0xee68('0xe'));var Papa=require(_0xee68('0xf'));var Redis=require(_0xee68('0x10'));var authService=require(_0xee68('0x11'));var qs=require(_0xee68('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xee68('0x13'));var logger=require(_0xee68('0x14'))('api');var utils=require(_0xee68('0x15'));var config=require(_0xee68('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xee68('0x17'))['db'];function respondWithStatusCode(_0x2fad25,_0x3f1c21){_0x3f1c21=_0x3f1c21||0xcc;return function(_0x4f5edd){if(_0x4f5edd){return _0x2fad25[_0xee68('0x18')](_0x3f1c21);}return _0x2fad25[_0xee68('0x19')](_0x3f1c21)[_0xee68('0x1a')]();};}function respondWithResult(_0x449bff,_0x371aca){_0x371aca=_0x371aca||0xc8;return function(_0x4ec9d3){if(_0x4ec9d3){return _0x449bff['status'](_0x371aca)[_0xee68('0x1b')](_0x4ec9d3);}};}function respondWithFilteredResult(_0x154426,_0x561f25){return function(_0x1823c8){if(_0x1823c8){var _0x6f15f2=typeof _0x561f25[_0xee68('0x1c')]==='undefined'&&typeof _0x561f25[_0xee68('0x1d')]===_0xee68('0x1e');var _0xb5717a=_0x1823c8['count'];var _0x464833=_0x6f15f2?0x0:_0x561f25['offset'];var _0x5393ec=_0x6f15f2?_0x1823c8[_0xee68('0x1f')]:_0x561f25[_0xee68('0x1c')]+_0x561f25[_0xee68('0x1d')];var _0x378526;if(_0x5393ec>=_0xb5717a){_0x5393ec=_0xb5717a;_0x378526=0xc8;}else{_0x378526=0xce;}_0x154426[_0xee68('0x19')](_0x378526);return _0x154426[_0xee68('0x20')](_0xee68('0x21'),_0x464833+'-'+_0x5393ec+'/'+_0xb5717a)[_0xee68('0x1b')](_0x1823c8);}return null;};}function patchUpdates(_0x20ed27){return function(_0x52609e){try{jsonpatch[_0xee68('0x22')](_0x52609e,_0x20ed27,!![]);}catch(_0x45c353){return BPromise[_0xee68('0x23')](_0x45c353);}return _0x52609e[_0xee68('0x24')]();};}function saveUpdates(_0x391b5f,_0x5e0109){return function(_0x3b00a0){if(_0x3b00a0){return _0x3b00a0['update'](_0x391b5f)[_0xee68('0x25')](function(_0x258520){return _0x258520;});}return null;};}function removeEntity(_0x255a6b,_0x4f7e30){return function(_0x2973f8){if(_0x2973f8){return _0x2973f8[_0xee68('0x26')]()[_0xee68('0x25')](function(){var _0x3f378f=_0x2973f8['get']({'plain':!![]});var _0x1e5061=_0xee68('0x27');return db[_0xee68('0x28')][_0xee68('0x26')]({'where':{'type':_0x1e5061,'resourceId':_0x3f378f['id']}})[_0xee68('0x25')](function(){return _0x2973f8;});})[_0xee68('0x25')](function(){_0x255a6b[_0xee68('0x19')](0xcc)[_0xee68('0x1a')]();});}};}function handleEntityNotFound(_0x30c450,_0x234ee7){return function(_0x3f5a9f){if(!_0x3f5a9f){_0x30c450['sendStatus'](0x194);}return _0x3f5a9f;};}function handleError(_0x47f43d,_0x11424e){_0x11424e=_0x11424e||0x1f4;return function(_0x30081a){logger[_0xee68('0x29')](_0x30081a['stack']);if(_0x30081a[_0xee68('0x2a')]){delete _0x30081a['name'];}_0x47f43d[_0xee68('0x19')](_0x11424e)[_0xee68('0x2b')](_0x30081a);};}exports['index']=function(_0x43bb63,_0x9e77c6){var _0x1cfb3c={},_0x3e0f51={},_0xb7055c={'count':0x0,'rows':[]};var _0x41251d=_['map'](db[_0xee68('0x2c')][_0xee68('0x2d')],function(_0x45b7ed){return{'name':_0x45b7ed[_0xee68('0x2e')],'type':_0x45b7ed[_0xee68('0x2f')][_0xee68('0x30')]};});_0x3e0f51[_0xee68('0x31')]=_[_0xee68('0x32')](_0x41251d,_0xee68('0x2a'));_0x3e0f51['query']=_[_0xee68('0x33')](_0x43bb63[_0xee68('0x34')]);_0x3e0f51[_0xee68('0x35')]=_[_0xee68('0x36')](_0x3e0f51[_0xee68('0x31')],_0x3e0f51[_0xee68('0x34')]);_0x1cfb3c[_0xee68('0x37')]=_[_0xee68('0x36')](_0x3e0f51[_0xee68('0x31')],qs['fields'](_0x43bb63['query'][_0xee68('0x38')]));_0x1cfb3c[_0xee68('0x37')]=_0x1cfb3c[_0xee68('0x37')][_0xee68('0x39')]?_0x1cfb3c[_0xee68('0x37')]:_0x3e0f51['model'];if(!_0x43bb63[_0xee68('0x34')][_0xee68('0x3a')]('nolimit')){_0x1cfb3c[_0xee68('0x1d')]=qs[_0xee68('0x1d')](_0x43bb63[_0xee68('0x34')][_0xee68('0x1d')]);_0x1cfb3c['offset']=qs[_0xee68('0x1c')](_0x43bb63[_0xee68('0x34')][_0xee68('0x1c')]);}_0x1cfb3c[_0xee68('0x3b')]=qs[_0xee68('0x3c')](_0x43bb63[_0xee68('0x34')][_0xee68('0x3c')]);delete _0x43bb63[_0xee68('0x34')][_0xee68('0x3c')];_0x1cfb3c[_0xee68('0x3d')]=qs[_0xee68('0x35')](_['pick'](_0x43bb63['query'],_0x3e0f51[_0xee68('0x35')]),_0x41251d);if(_0x43bb63[_0xee68('0x34')][_0xee68('0x3e')]){_0x1cfb3c['where']=_[_0xee68('0x3f')](_0x1cfb3c['where'],{'$or':_[_0xee68('0x32')](_0x41251d,function(_0x2e783a){if(_0x2e783a[_0xee68('0x2f')]!==_0xee68('0x40')){var _0x5eedc7={};_0x5eedc7[_0x2e783a[_0xee68('0x2a')]]={'$like':'%'+_0x43bb63['query'][_0xee68('0x3e')]+'%'};return _0x5eedc7;}})});}_0x1cfb3c=_['merge']({},_0x1cfb3c,_0x43bb63['options']);var _0x2516fe={'where':_0x1cfb3c['where']};return db[_0xee68('0x2c')][_0xee68('0x1f')](_0x2516fe)[_0xee68('0x25')](function(_0xcc62b3){_0xb7055c['count']=_0xcc62b3;if(_0x43bb63[_0xee68('0x34')][_0xee68('0x41')]){_0x1cfb3c[_0xee68('0x42')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0xee68('0x43')](_0x1cfb3c);})[_0xee68('0x25')](function(_0x5ce5f0){_0xb7055c[_0xee68('0x44')]=_0x5ce5f0;return _0xb7055c;})[_0xee68('0x25')](respondWithFilteredResult(_0x9e77c6,_0x1cfb3c))[_0xee68('0x45')](handleError(_0x9e77c6,null));};exports['show']=function(_0x297801,_0x43cf61){var _0x53ae8c={'raw':![],'where':{'id':_0x297801[_0xee68('0x46')]['id']}},_0x464cdd={};_0x464cdd[_0xee68('0x31')]=_[_0xee68('0x33')](db[_0xee68('0x2c')]['rawAttributes']);_0x464cdd[_0xee68('0x34')]=_[_0xee68('0x33')](_0x297801['query']);_0x464cdd[_0xee68('0x35')]=_['intersection'](_0x464cdd[_0xee68('0x31')],_0x464cdd[_0xee68('0x34')]);_0x53ae8c[_0xee68('0x37')]=_['intersection'](_0x464cdd[_0xee68('0x31')],qs[_0xee68('0x38')](_0x297801[_0xee68('0x34')]['fields']));_0x53ae8c[_0xee68('0x37')]=_0x53ae8c[_0xee68('0x37')][_0xee68('0x39')]?_0x53ae8c[_0xee68('0x37')]:_0x464cdd[_0xee68('0x31')];if(_0x297801['query']['includeAll']){_0x53ae8c['include']=[{'all':!![]}];}_0x53ae8c=_['merge']({},_0x53ae8c,_0x297801[_0xee68('0x47')]);return db[_0xee68('0x2c')][_0xee68('0x48')](_0x53ae8c)['then'](handleEntityNotFound(_0x43cf61,null))[_0xee68('0x25')](respondWithResult(_0x43cf61,null))['catch'](handleError(_0x43cf61,null));};exports[_0xee68('0x49')]=function(_0x1484e6,_0x447e93){if(_0x1484e6[_0xee68('0x4a')]['id']){delete _0x1484e6[_0xee68('0x4a')]['id'];}return db[_0xee68('0x2c')][_0xee68('0x48')]({'where':{'id':_0x1484e6['params']['id']}})[_0xee68('0x25')](handleEntityNotFound(_0x447e93,null))[_0xee68('0x25')](saveUpdates(_0x1484e6[_0xee68('0x4a')],null))[_0xee68('0x25')](respondWithResult(_0x447e93,null))[_0xee68('0x45')](handleError(_0x447e93,null));};exports[_0xee68('0x4b')]=function(_0x309180,_0x2fcfe8,_0x4adc71){return db[_0xee68('0x4c')][_0xee68('0x4d')](function(_0x408c39){if(_0x309180[_0xee68('0x4a')][_0xee68('0x4e')]===_0xee68('0x4f')){_0x309180[_0xee68('0x4a')][_0xee68('0x50')]=path[_0xee68('0x51')](config['root'],_0xee68('0x52'),_0x309180[_0xee68('0x4a')][_0xee68('0x2a')]);}return db['VoiceMusicOnHold']['create'](_0x309180[_0xee68('0x4a')],{'transaction':_0x408c39})[_0xee68('0x25')](function(_0x4dfa07){if(_0x309180[_0xee68('0x4a')]['mode']===_0xee68('0x4f')){fs[_0xee68('0x53')](_0x4dfa07[_0xee68('0x50')],parseInt(_0xee68('0x54'),0x8));}var _0x3b2bcb=_0x309180[_0xee68('0x55')][_0xee68('0x56')]({'plain':!![]});if(!_0x3b2bcb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3b2bcb[_0xee68('0x57')]===_0xee68('0x55')){var _0x40517e=_0x4dfa07[_0xee68('0x56')]({'plain':!![]});return db['UserProfileSection'][_0xee68('0x48')]({'where':{'name':_0xee68('0x27'),'userProfileId':_0x3b2bcb[_0xee68('0x58')]},'raw':!![]})[_0xee68('0x25')](function(_0x1127ae){if(_0x1127ae&&_0x1127ae['autoAssociation']===0x0){return db[_0xee68('0x28')][_0xee68('0x4b')]({'name':_0x40517e['name'],'resourceId':_0x40517e['id'],'type':_0x1127ae['name'],'sectionId':_0x1127ae['id']},{})['then'](function(){return _0x4dfa07;});}else{return _0x4dfa07;}})[_0xee68('0x45')](function(_0x324a76){logger[_0xee68('0x29')](_0xee68('0x59'),_0x324a76);});}return _0x4dfa07;});})['then'](respondWithResult(_0x2fcfe8,0xc9))[_0xee68('0x45')](handleError(_0x2fcfe8,null));};exports['destroy']=function(_0x410647,_0x21c5b5,_0x2bfd23){var _0x5aab54;return db[_0xee68('0x2c')][_0xee68('0x48')]({'where':{'id':_0x410647[_0xee68('0x46')]['id']}})[_0xee68('0x25')](function(_0x362958){if(_0x362958){return db['sequelize'][_0xee68('0x4d')](function(_0x2101e8){return _0x362958[_0xee68('0x26')]({'transaction':_0x2101e8,'raw':!![]})[_0xee68('0x25')](function(_0x1e4778){if(_0x1e4778['directory']){fs['readdirSync'](_0x1e4778[_0xee68('0x50')])[_0xee68('0x5a')](function(_0x353bae){fs[_0xee68('0x5b')](path[_0xee68('0x51')](_0x1e4778[_0xee68('0x50')],_0x353bae));});fs[_0xee68('0x5c')](_0x1e4778['directory']);}return _0x1e4778;});})[_0xee68('0x45')](function(_0x3a46f4){throw new db[(_0xee68('0x5d'))][(_0xee68('0x5e'))](_0x3a46f4[_0xee68('0x5f')]);});}})['then'](handleEntityNotFound(_0x21c5b5,null))[_0xee68('0x25')](removeEntity(_0x21c5b5,null))[_0xee68('0x45')](handleError(_0x21c5b5,null));};exports[_0xee68('0x60')]=function(_0xff72c7,_0xbd4f73,_0x51e911){return db[_0xee68('0x4c')]['transaction'](function(_0x2b557a){var _0x3656af;return db[_0xee68('0x2c')][_0xee68('0x48')]({'where':{'id':_0xff72c7[_0xee68('0x46')]['id']}})['then'](function(_0x60d9de){if(_0x60d9de){_0x3656af=_0x60d9de;return _0x60d9de[_0xee68('0x60')](_0xff72c7[_0xee68('0x4a')]['id'],{'transaction':_0x2b557a});}})[_0xee68('0x25')](function(_0x36a431){if(_0x36a431){return db[_0xee68('0x61')][_0xee68('0x62')]({'where':{'id':_0xff72c7[_0xee68('0x4a')]['id']},'attributes':['id',_0xee68('0x2a'),_0xee68('0x63'),_0xee68('0x64'),_0xee68('0x65')],'raw':!![]});}})['then'](function(_0x4b53b3){if(_0x4b53b3){var _0x4f5ab1=path[_0xee68('0x51')](config[_0xee68('0x66')],'server/files/sounds/converted',util[_0xee68('0x67')](_0xee68('0x68'),path[_0xee68('0x69')](_0x4b53b3[_0xee68('0x63')],path[_0xee68('0x6a')](_0x4b53b3[_0xee68('0x63')])),_0x4b53b3[_0xee68('0x64')]));var _0x4263ae=path[_0xee68('0x51')](config[_0xee68('0x66')],_0xee68('0x52'),_0x3656af['name'],util[_0xee68('0x67')](_0xee68('0x68'),_0x4b53b3[_0xee68('0x2a')],_0x4b53b3['converted_format']));fs[_0xee68('0x6b')](_0x4f5ab1,_0x4263ae);return _0x4b53b3;}})[_0xee68('0x45')](function(_0xf804f8){throw new db[(_0xee68('0x5d'))][(_0xee68('0x5e'))](_0xf804f8[_0xee68('0x5f')]);});})['then'](handleEntityNotFound(_0xbd4f73,null))[_0xee68('0x25')](respondWithResult(_0xbd4f73,0xc9))[_0xee68('0x45')](handleError(_0xbd4f73,null));};exports[_0xee68('0x6c')]=function(_0x459034,_0x29ef75,_0x319ea7){return db['sequelize'][_0xee68('0x4d')](function(_0x28b951){var _0x44bac9;return db[_0xee68('0x2c')][_0xee68('0x62')]({'where':{'id':_0x459034[_0xee68('0x46')]['id']}})[_0xee68('0x25')](handleEntityNotFound(_0x29ef75,null))[_0xee68('0x25')](function(_0x23e62e){if(_0x23e62e){_0x44bac9=_0x23e62e;return _0x23e62e[_0xee68('0x6c')](_0x459034[_0xee68('0x46')][_0xee68('0x6d')]);}})[_0xee68('0x25')](function(_0x549e95){if(_0x549e95){return db[_0xee68('0x61')][_0xee68('0x62')]({'where':{'id':_0x459034[_0xee68('0x46')][_0xee68('0x6d')]},'attributes':['id',_0xee68('0x2a'),_0xee68('0x63'),_0xee68('0x64'),'createdAt'],'raw':!![]});}})[_0xee68('0x25')](function(_0x92ea6f){if(_0x92ea6f){fs[_0xee68('0x5b')](path[_0xee68('0x51')](_0x44bac9[_0xee68('0x50')],util['format'](_0xee68('0x68'),_0x92ea6f[_0xee68('0x2a')],_0x92ea6f[_0xee68('0x64')])));return _0x92ea6f;}})[_0xee68('0x45')](function(_0x1cdb56){throw new db[(_0xee68('0x5d'))][(_0xee68('0x5e'))](_0x1cdb56['message']);});})['then'](handleEntityNotFound(_0x29ef75,null))[_0xee68('0x25')](respondWithStatusCode(_0x29ef75,0xcc))['catch'](handleError(_0x29ef75,null));};exports[_0xee68('0x6e')]=function(_0x428140,_0x3adc8f,_0x52dea2){var _0x232a19={};var _0x53446={};var _0x4d5162;var _0x5b43f7;return db[_0xee68('0x2c')][_0xee68('0x62')]({'where':{'id':_0x428140[_0xee68('0x46')]['id']}})['then'](handleEntityNotFound(_0x3adc8f,null))['then'](function(_0xba4b12){if(_0xba4b12){_0x4d5162=_0xba4b12;_0x53446[_0xee68('0x31')]=_[_0xee68('0x33')](db[_0xee68('0x61')]['rawAttributes']);_0x53446[_0xee68('0x34')]=_['keys'](_0x428140[_0xee68('0x34')]);_0x53446[_0xee68('0x35')]=_['intersection'](_0x53446['model'],_0x53446[_0xee68('0x34')]);_0x232a19[_0xee68('0x37')]=_[_0xee68('0x36')](_0x53446[_0xee68('0x31')],qs['fields'](_0x428140[_0xee68('0x34')][_0xee68('0x38')]));_0x232a19[_0xee68('0x37')]=_0x232a19[_0xee68('0x37')][_0xee68('0x39')]?_0x232a19[_0xee68('0x37')]:_0x53446['model'];_0x232a19[_0xee68('0x3b')]=qs['sort'](_0x428140['query']['sort']);_0x232a19['where']=qs[_0xee68('0x35')](_['pick'](_0x428140[_0xee68('0x34')],_0x53446['filters']));if(_0x428140[_0xee68('0x34')][_0xee68('0x3e')]){_0x232a19['where']=_['merge'](_0x232a19[_0xee68('0x3d')],{'$or':_[_0xee68('0x32')](_0x232a19['attributes'],function(_0x13a87e){var _0x29013d={};_0x29013d[_0x13a87e]={'$like':'%'+_0x428140['query'][_0xee68('0x3e')]+'%'};return _0x29013d;})});}_0x232a19=_[_0xee68('0x3f')]({},_0x232a19,_0x428140[_0xee68('0x47')]);return _0x4d5162['getSounds'](_0x232a19);}})[_0xee68('0x25')](function(_0x16be18){if(_0x16be18){_0x5b43f7=_0x16be18['length'];if(!_0x428140[_0xee68('0x34')]['hasOwnProperty'](_0xee68('0x6f'))){_0x232a19[_0xee68('0x1d')]=qs[_0xee68('0x1d')](_0x428140[_0xee68('0x34')][_0xee68('0x1d')]);_0x232a19[_0xee68('0x1c')]=qs[_0xee68('0x1c')](_0x428140['query'][_0xee68('0x1c')]);}return _0x4d5162[_0xee68('0x6e')](_0x232a19);}})[_0xee68('0x25')](function(_0x352c37){if(_0x352c37){return _0x352c37?{'count':_0x5b43f7,'rows':_0x352c37}:null;}})['then'](respondWithResult(_0x3adc8f,null))[_0xee68('0x45')](handleError(_0x3adc8f,null));}; \ No newline at end of file +var _0xf7ae=['map','VoiceMusicOnHold','fieldName','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','rawAttributes','filters','include','find','body','transaction','mode','directory','join','server/files/moh','create','mkdirSync','0777','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','MusicOnHolds','userProfileId','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','sequelize','unlinkSync','Sequelize','ValidationError','addSound','findOne','save_name','converted_format','root','format','%s.%s','basename','extname','symlinkSync','message','removeSound','Sound','id2','createdAt','getSounds','order','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','apply','reject','save','update','then','get','UserProfileResource','error','stack','send','index'];(function(_0x259552,_0x3d56ed){var _0x23821c=function(_0x52d3c9){while(--_0x52d3c9){_0x259552['push'](_0x259552['shift']());}};_0x23821c(++_0x3d56ed);}(_0xf7ae,0x127));var _0xef7a=function(_0x2b4757,_0x2ae3bd){_0x2b4757=_0x2b4757-0x0;var _0x46f419=_0xf7ae[_0x2b4757];return _0x46f419;};'use strict';var emlformat=require(_0xef7a('0x0'));var rimraf=require(_0xef7a('0x1'));var zipdir=require(_0xef7a('0x2'));var jsonpatch=require(_0xef7a('0x3'));var rp=require(_0xef7a('0x4'));var moment=require(_0xef7a('0x5'));var BPromise=require(_0xef7a('0x6'));var Mustache=require(_0xef7a('0x7'));var util=require(_0xef7a('0x8'));var path=require(_0xef7a('0x9'));var sox=require('sox');var csv=require(_0xef7a('0xa'));var ejs=require(_0xef7a('0xb'));var fs=require('fs');var fs_extra=require(_0xef7a('0xc'));var _=require(_0xef7a('0xd'));var squel=require(_0xef7a('0xe'));var crypto=require(_0xef7a('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xef7a('0x10'));var toCsv=require(_0xef7a('0xa'));var querystring=require('querystring');var Papa=require(_0xef7a('0x11'));var Redis=require(_0xef7a('0x12'));var authService=require(_0xef7a('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xef7a('0x14'));var hardwareService=require(_0xef7a('0x15'));var logger=require(_0xef7a('0x16'))(_0xef7a('0x17'));var utils=require(_0xef7a('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xef7a('0x19'));var db=require(_0xef7a('0x1a'))['db'];function respondWithStatusCode(_0x352630,_0x4fe883){_0x4fe883=_0x4fe883||0xcc;return function(_0x8a20f5){if(_0x8a20f5){return _0x352630[_0xef7a('0x1b')](_0x4fe883);}return _0x352630['status'](_0x4fe883)[_0xef7a('0x1c')]();};}function respondWithResult(_0x316b10,_0x23e962){_0x23e962=_0x23e962||0xc8;return function(_0x447144){if(_0x447144){return _0x316b10[_0xef7a('0x1d')](_0x23e962)[_0xef7a('0x1e')](_0x447144);}};}function respondWithFilteredResult(_0x104841,_0x4c6f3e){return function(_0x34b729){if(_0x34b729){var _0x35636d=typeof _0x4c6f3e['offset']===_0xef7a('0x1f')&&typeof _0x4c6f3e[_0xef7a('0x20')]===_0xef7a('0x1f');var _0xc411f1=_0x34b729['count'];var _0x20d6a0=_0x35636d?0x0:_0x4c6f3e[_0xef7a('0x21')];var _0x4afc91=_0x35636d?_0x34b729[_0xef7a('0x22')]:_0x4c6f3e[_0xef7a('0x21')]+_0x4c6f3e[_0xef7a('0x20')];var _0x14d5ee;if(_0x4afc91>=_0xc411f1){_0x4afc91=_0xc411f1;_0x14d5ee=0xc8;}else{_0x14d5ee=0xce;}_0x104841['status'](_0x14d5ee);return _0x104841[_0xef7a('0x23')]('Content-Range',_0x20d6a0+'-'+_0x4afc91+'/'+_0xc411f1)['json'](_0x34b729);}return null;};}function patchUpdates(_0x100dbc){return function(_0x15743d){try{jsonpatch[_0xef7a('0x24')](_0x15743d,_0x100dbc,!![]);}catch(_0x49c9b5){return BPromise[_0xef7a('0x25')](_0x49c9b5);}return _0x15743d[_0xef7a('0x26')]();};}function saveUpdates(_0xeba5c0,_0x5431ce){return function(_0x27c7ec){if(_0x27c7ec){return _0x27c7ec[_0xef7a('0x27')](_0xeba5c0)[_0xef7a('0x28')](function(_0x5e10e1){return _0x5e10e1;});}return null;};}function removeEntity(_0x239f8b,_0xb25465){return function(_0x3cd67a){if(_0x3cd67a){return _0x3cd67a['destroy']()[_0xef7a('0x28')](function(){var _0x5d31c1=_0x3cd67a[_0xef7a('0x29')]({'plain':!![]});var _0x36a6bd='MusicOnHolds';return db[_0xef7a('0x2a')]['destroy']({'where':{'type':_0x36a6bd,'resourceId':_0x5d31c1['id']}})[_0xef7a('0x28')](function(){return _0x3cd67a;});})[_0xef7a('0x28')](function(){_0x239f8b['status'](0xcc)[_0xef7a('0x1c')]();});}};}function handleEntityNotFound(_0x498f8c,_0x3ae874){return function(_0x5c9ffc){if(!_0x5c9ffc){_0x498f8c['sendStatus'](0x194);}return _0x5c9ffc;};}function handleError(_0x198de2,_0x1f32df){_0x1f32df=_0x1f32df||0x1f4;return function(_0x44b32a){logger[_0xef7a('0x2b')](_0x44b32a[_0xef7a('0x2c')]);if(_0x44b32a['name']){delete _0x44b32a['name'];}_0x198de2['status'](_0x1f32df)[_0xef7a('0x2d')](_0x44b32a);};}exports[_0xef7a('0x2e')]=function(_0x544613,_0x45cca1){var _0x351853={},_0x12c777={},_0x44ec8b={'count':0x0,'rows':[]};var _0x333efc=_[_0xef7a('0x2f')](db[_0xef7a('0x30')]['rawAttributes'],function(_0x380ccd){return{'name':_0x380ccd[_0xef7a('0x31')],'type':_0x380ccd['type']['key']};});_0x12c777[_0xef7a('0x32')]=_[_0xef7a('0x2f')](_0x333efc,_0xef7a('0x33'));_0x12c777[_0xef7a('0x34')]=_[_0xef7a('0x35')](_0x544613[_0xef7a('0x34')]);_0x12c777['filters']=_[_0xef7a('0x36')](_0x12c777[_0xef7a('0x32')],_0x12c777['query']);_0x351853[_0xef7a('0x37')]=_[_0xef7a('0x36')](_0x12c777[_0xef7a('0x32')],qs['fields'](_0x544613[_0xef7a('0x34')][_0xef7a('0x38')]));_0x351853[_0xef7a('0x37')]=_0x351853[_0xef7a('0x37')][_0xef7a('0x39')]?_0x351853[_0xef7a('0x37')]:_0x12c777[_0xef7a('0x32')];if(!_0x544613[_0xef7a('0x34')][_0xef7a('0x3a')](_0xef7a('0x3b'))){_0x351853[_0xef7a('0x20')]=qs[_0xef7a('0x20')](_0x544613[_0xef7a('0x34')][_0xef7a('0x20')]);_0x351853[_0xef7a('0x21')]=qs[_0xef7a('0x21')](_0x544613['query'][_0xef7a('0x21')]);}_0x351853['order']=qs[_0xef7a('0x3c')](_0x544613['query'][_0xef7a('0x3c')]);delete _0x544613[_0xef7a('0x34')]['sort'];_0x351853[_0xef7a('0x3d')]=qs['filters'](_[_0xef7a('0x3e')](_0x544613[_0xef7a('0x34')],_0x12c777['filters']),_0x333efc);if(_0x544613['query'][_0xef7a('0x3f')]){_0x351853['where']=_[_0xef7a('0x40')](_0x351853[_0xef7a('0x3d')],{'$or':_[_0xef7a('0x2f')](_0x333efc,function(_0x57d37e){if(_0x57d37e['type']!==_0xef7a('0x41')){var _0x4e3be1={};_0x4e3be1[_0x57d37e[_0xef7a('0x33')]]={'$like':'%'+_0x544613['query']['filter']+'%'};return _0x4e3be1;}})});}_0x351853=_[_0xef7a('0x40')]({},_0x351853,_0x544613[_0xef7a('0x42')]);var _0x1c85df={'where':_0x351853[_0xef7a('0x3d')]};return db[_0xef7a('0x30')][_0xef7a('0x22')](_0x1c85df)[_0xef7a('0x28')](function(_0x347824){_0x44ec8b[_0xef7a('0x22')]=_0x347824;if(_0x544613['query'][_0xef7a('0x43')]){_0x351853['include']=[{'all':!![]}];}return db[_0xef7a('0x30')][_0xef7a('0x44')](_0x351853);})[_0xef7a('0x28')](function(_0xd2c15){_0x44ec8b[_0xef7a('0x45')]=_0xd2c15;return _0x44ec8b;})[_0xef7a('0x28')](respondWithFilteredResult(_0x45cca1,_0x351853))['catch'](handleError(_0x45cca1,null));};exports[_0xef7a('0x46')]=function(_0xad2bf3,_0x48174a){var _0x56da99={'raw':![],'where':{'id':_0xad2bf3[_0xef7a('0x47')]['id']}},_0x1d8ea1={};_0x1d8ea1[_0xef7a('0x32')]=_[_0xef7a('0x35')](db[_0xef7a('0x30')][_0xef7a('0x48')]);_0x1d8ea1[_0xef7a('0x34')]=_['keys'](_0xad2bf3[_0xef7a('0x34')]);_0x1d8ea1[_0xef7a('0x49')]=_['intersection'](_0x1d8ea1[_0xef7a('0x32')],_0x1d8ea1['query']);_0x56da99[_0xef7a('0x37')]=_['intersection'](_0x1d8ea1[_0xef7a('0x32')],qs['fields'](_0xad2bf3[_0xef7a('0x34')][_0xef7a('0x38')]));_0x56da99['attributes']=_0x56da99['attributes']['length']?_0x56da99['attributes']:_0x1d8ea1[_0xef7a('0x32')];if(_0xad2bf3[_0xef7a('0x34')][_0xef7a('0x43')]){_0x56da99[_0xef7a('0x4a')]=[{'all':!![]}];}_0x56da99=_['merge']({},_0x56da99,_0xad2bf3['options']);return db[_0xef7a('0x30')][_0xef7a('0x4b')](_0x56da99)['then'](handleEntityNotFound(_0x48174a,null))['then'](respondWithResult(_0x48174a,null))['catch'](handleError(_0x48174a,null));};exports[_0xef7a('0x27')]=function(_0x548121,_0x547336){if(_0x548121[_0xef7a('0x4c')]['id']){delete _0x548121['body']['id'];}return db[_0xef7a('0x30')]['find']({'where':{'id':_0x548121[_0xef7a('0x47')]['id']}})[_0xef7a('0x28')](handleEntityNotFound(_0x547336,null))[_0xef7a('0x28')](saveUpdates(_0x548121['body'],null))[_0xef7a('0x28')](respondWithResult(_0x547336,null))['catch'](handleError(_0x547336,null));};exports['create']=function(_0xfb0b37,_0x649f1f,_0x1d873d){return db['sequelize'][_0xef7a('0x4d')](function(_0x20d88a){if(_0xfb0b37[_0xef7a('0x4c')][_0xef7a('0x4e')]==='files'){_0xfb0b37[_0xef7a('0x4c')][_0xef7a('0x4f')]=path[_0xef7a('0x50')](config['root'],_0xef7a('0x51'),_0xfb0b37[_0xef7a('0x4c')][_0xef7a('0x33')]);}return db[_0xef7a('0x30')][_0xef7a('0x52')](_0xfb0b37[_0xef7a('0x4c')],{'transaction':_0x20d88a})[_0xef7a('0x28')](function(_0x4afed5){if(_0xfb0b37['body'][_0xef7a('0x4e')]==='files'){fs[_0xef7a('0x53')](_0x4afed5[_0xef7a('0x4f')],parseInt(_0xef7a('0x54'),0x8));}var _0x3aa766=_0xfb0b37['user'][_0xef7a('0x29')]({'plain':!![]});if(!_0x3aa766)throw new Error(_0xef7a('0x55'));if(_0x3aa766[_0xef7a('0x56')]==='user'){var _0x5c0b52=_0x4afed5[_0xef7a('0x29')]({'plain':!![]});return db[_0xef7a('0x57')][_0xef7a('0x4b')]({'where':{'name':_0xef7a('0x58'),'userProfileId':_0x3aa766[_0xef7a('0x59')]},'raw':!![]})[_0xef7a('0x28')](function(_0x2001f4){if(_0x2001f4&&_0x2001f4['autoAssociation']===0x0){return db['UserProfileResource'][_0xef7a('0x52')]({'name':_0x5c0b52['name'],'resourceId':_0x5c0b52['id'],'type':_0x2001f4[_0xef7a('0x33')],'sectionId':_0x2001f4['id']},{})[_0xef7a('0x28')](function(){return _0x4afed5;});}else{return _0x4afed5;}})[_0xef7a('0x5a')](function(_0x2edaca){logger[_0xef7a('0x2b')](_0xef7a('0x5b'),_0x2edaca);});}return _0x4afed5;});})[_0xef7a('0x28')](respondWithResult(_0x649f1f,0xc9))[_0xef7a('0x5a')](handleError(_0x649f1f,null));};exports[_0xef7a('0x5c')]=function(_0x2bab76,_0x4fdcbf,_0xce0a83){var _0xb2b210;return db['VoiceMusicOnHold']['find']({'where':{'id':_0x2bab76[_0xef7a('0x47')]['id']}})[_0xef7a('0x28')](function(_0x1d5134){if(_0x1d5134){return db[_0xef7a('0x5d')][_0xef7a('0x4d')](function(_0x205fbd){return _0x1d5134[_0xef7a('0x5c')]({'transaction':_0x205fbd,'raw':!![]})[_0xef7a('0x28')](function(_0x4b1c3){if(_0x4b1c3['directory']){fs['readdirSync'](_0x4b1c3[_0xef7a('0x4f')])['forEach'](function(_0x86924a){fs[_0xef7a('0x5e')](path[_0xef7a('0x50')](_0x4b1c3[_0xef7a('0x4f')],_0x86924a));});fs['rmdirSync'](_0x4b1c3[_0xef7a('0x4f')]);}return _0x4b1c3;});})[_0xef7a('0x5a')](function(_0x3ce1a6){throw new db[(_0xef7a('0x5f'))][(_0xef7a('0x60'))](_0x3ce1a6['message']);});}})['then'](handleEntityNotFound(_0x4fdcbf,null))[_0xef7a('0x28')](removeEntity(_0x4fdcbf,null))[_0xef7a('0x5a')](handleError(_0x4fdcbf,null));};exports[_0xef7a('0x61')]=function(_0x33326c,_0x143796,_0x3221b8){return db[_0xef7a('0x5d')]['transaction'](function(_0x3cae85){var _0x587938;return db['VoiceMusicOnHold']['find']({'where':{'id':_0x33326c[_0xef7a('0x47')]['id']}})[_0xef7a('0x28')](function(_0x3b47f2){if(_0x3b47f2){_0x587938=_0x3b47f2;return _0x3b47f2['addSound'](_0x33326c['body']['id'],{'transaction':_0x3cae85});}})[_0xef7a('0x28')](function(_0x56e224){if(_0x56e224){return db['Sound'][_0xef7a('0x62')]({'where':{'id':_0x33326c['body']['id']},'attributes':['id',_0xef7a('0x33'),_0xef7a('0x63'),_0xef7a('0x64'),'createdAt'],'raw':!![]});}})[_0xef7a('0x28')](function(_0x137e4c){if(_0x137e4c){var _0xb1862=path[_0xef7a('0x50')](config[_0xef7a('0x65')],'server/files/sounds/converted',util[_0xef7a('0x66')](_0xef7a('0x67'),path[_0xef7a('0x68')](_0x137e4c[_0xef7a('0x63')],path[_0xef7a('0x69')](_0x137e4c[_0xef7a('0x63')])),_0x137e4c[_0xef7a('0x64')]));var _0x4949e7=path[_0xef7a('0x50')](config[_0xef7a('0x65')],'server/files/moh',_0x587938[_0xef7a('0x33')],util[_0xef7a('0x66')]('%s.%s',_0x137e4c[_0xef7a('0x33')],_0x137e4c[_0xef7a('0x64')]));fs[_0xef7a('0x6a')](_0xb1862,_0x4949e7);return _0x137e4c;}})['catch'](function(_0x1ee950){throw new db[(_0xef7a('0x5f'))]['ValidationError'](_0x1ee950[_0xef7a('0x6b')]);});})[_0xef7a('0x28')](handleEntityNotFound(_0x143796,null))[_0xef7a('0x28')](respondWithResult(_0x143796,0xc9))['catch'](handleError(_0x143796,null));};exports['removeSound']=function(_0x2f6758,_0x4047c6,_0x2b1d13){return db[_0xef7a('0x5d')]['transaction'](function(_0xebb941){var _0x4aba29;return db[_0xef7a('0x30')][_0xef7a('0x62')]({'where':{'id':_0x2f6758[_0xef7a('0x47')]['id']}})[_0xef7a('0x28')](handleEntityNotFound(_0x4047c6,null))[_0xef7a('0x28')](function(_0x53f17f){if(_0x53f17f){_0x4aba29=_0x53f17f;return _0x53f17f[_0xef7a('0x6c')](_0x2f6758['params']['id2']);}})[_0xef7a('0x28')](function(_0x56239a){if(_0x56239a){return db[_0xef7a('0x6d')][_0xef7a('0x62')]({'where':{'id':_0x2f6758[_0xef7a('0x47')][_0xef7a('0x6e')]},'attributes':['id','name',_0xef7a('0x63'),_0xef7a('0x64'),_0xef7a('0x6f')],'raw':!![]});}})[_0xef7a('0x28')](function(_0x331340){if(_0x331340){fs[_0xef7a('0x5e')](path[_0xef7a('0x50')](_0x4aba29[_0xef7a('0x4f')],util[_0xef7a('0x66')](_0xef7a('0x67'),_0x331340[_0xef7a('0x33')],_0x331340[_0xef7a('0x64')])));return _0x331340;}})[_0xef7a('0x5a')](function(_0x53bff1){throw new db[(_0xef7a('0x5f'))][(_0xef7a('0x60'))](_0x53bff1[_0xef7a('0x6b')]);});})[_0xef7a('0x28')](handleEntityNotFound(_0x4047c6,null))[_0xef7a('0x28')](respondWithStatusCode(_0x4047c6,0xcc))[_0xef7a('0x5a')](handleError(_0x4047c6,null));};exports[_0xef7a('0x70')]=function(_0x6f9cba,_0xdefc47,_0x1de2a7){var _0x171196={};var _0xb6726a={};var _0x5c9429;var _0x12affd;return db['VoiceMusicOnHold'][_0xef7a('0x62')]({'where':{'id':_0x6f9cba['params']['id']}})['then'](handleEntityNotFound(_0xdefc47,null))['then'](function(_0x488968){if(_0x488968){_0x5c9429=_0x488968;_0xb6726a[_0xef7a('0x32')]=_[_0xef7a('0x35')](db[_0xef7a('0x6d')][_0xef7a('0x48')]);_0xb6726a['query']=_['keys'](_0x6f9cba[_0xef7a('0x34')]);_0xb6726a[_0xef7a('0x49')]=_[_0xef7a('0x36')](_0xb6726a[_0xef7a('0x32')],_0xb6726a['query']);_0x171196['attributes']=_[_0xef7a('0x36')](_0xb6726a[_0xef7a('0x32')],qs[_0xef7a('0x38')](_0x6f9cba[_0xef7a('0x34')][_0xef7a('0x38')]));_0x171196[_0xef7a('0x37')]=_0x171196[_0xef7a('0x37')][_0xef7a('0x39')]?_0x171196['attributes']:_0xb6726a[_0xef7a('0x32')];_0x171196[_0xef7a('0x71')]=qs[_0xef7a('0x3c')](_0x6f9cba[_0xef7a('0x34')][_0xef7a('0x3c')]);_0x171196[_0xef7a('0x3d')]=qs[_0xef7a('0x49')](_[_0xef7a('0x3e')](_0x6f9cba[_0xef7a('0x34')],_0xb6726a[_0xef7a('0x49')]));if(_0x6f9cba[_0xef7a('0x34')][_0xef7a('0x3f')]){_0x171196[_0xef7a('0x3d')]=_[_0xef7a('0x40')](_0x171196[_0xef7a('0x3d')],{'$or':_[_0xef7a('0x2f')](_0x171196[_0xef7a('0x37')],function(_0x452cf7){var _0x29b79d={};_0x29b79d[_0x452cf7]={'$like':'%'+_0x6f9cba['query'][_0xef7a('0x3f')]+'%'};return _0x29b79d;})});}_0x171196=_[_0xef7a('0x40')]({},_0x171196,_0x6f9cba[_0xef7a('0x42')]);return _0x5c9429[_0xef7a('0x70')](_0x171196);}})['then'](function(_0x9eb8b3){if(_0x9eb8b3){_0x12affd=_0x9eb8b3[_0xef7a('0x39')];if(!_0x6f9cba['query'][_0xef7a('0x3a')](_0xef7a('0x3b'))){_0x171196[_0xef7a('0x20')]=qs[_0xef7a('0x20')](_0x6f9cba[_0xef7a('0x34')][_0xef7a('0x20')]);_0x171196[_0xef7a('0x21')]=qs[_0xef7a('0x21')](_0x6f9cba[_0xef7a('0x34')][_0xef7a('0x21')]);}return _0x5c9429[_0xef7a('0x70')](_0x171196);}})[_0xef7a('0x28')](function(_0x1a2ad9){if(_0x1a2ad9){return _0x1a2ad9?{'count':_0x12affd,'rows':_0x1a2ad9}:null;}})[_0xef7a('0x28')](respondWithResult(_0xdefc47,null))[_0xef7a('0x5a')](handleError(_0xdefc47,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 788b4d1..90bc364 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 _0x4457=['voice_musiconhold','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold'];(function(_0xc14031,_0x2f2167){var _0x9ce02d=function(_0x6a2342){while(--_0x6a2342){_0xc14031['push'](_0xc14031['shift']());}};_0x9ce02d(++_0x2f2167);}(_0x4457,0xa9));var _0x7445=function(_0x4b140a,_0x3d82ed){_0x4b140a=_0x4b140a-0x0;var _0x1d3b60=_0x4457[_0x4b140a];return _0x1d3b60;};'use strict';var _=require('lodash');var util=require(_0x7445('0x0'));var logger=require(_0x7445('0x1'))(_0x7445('0x2'));var moment=require(_0x7445('0x3'));var BPromise=require('bluebird');var rp=require(_0x7445('0x4'));var fs=require('fs');var path=require(_0x7445('0x5'));var rimraf=require('rimraf');var config=require(_0x7445('0x6'));var attributes=require(_0x7445('0x7'));module[_0x7445('0x8')]=function(_0x417aeb,_0x519b57){return _0x417aeb[_0x7445('0x9')](_0x7445('0xa'),attributes,{'tableName':_0x7445('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc5df=['../../config/environment','exports','define','voice_musiconhold','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0xc5df,0x1cc));var _0xfc5d=function(_0x2723be,_0x74d706){_0x2723be=_0x2723be-0x0;var _0xeacc25=_0xc5df[_0x2723be];return _0xeacc25;};'use strict';var _=require(_0xfc5d('0x0'));var util=require(_0xfc5d('0x1'));var logger=require('../../config/logger')(_0xfc5d('0x2'));var moment=require(_0xfc5d('0x3'));var BPromise=require(_0xfc5d('0x4'));var rp=require(_0xfc5d('0x5'));var fs=require('fs');var path=require(_0xfc5d('0x6'));var rimraf=require(_0xfc5d('0x7'));var config=require(_0xfc5d('0x8'));var attributes=require('./voiceMusicOnHold.attributes');module[_0xfc5d('0x9')]=function(_0x1afa6a,_0x3e5562){return _0x1afa6a[_0xfc5d('0xa')]('VoiceMusicOnHold',attributes,{'tableName':_0xfc5d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index 765ace3..d25949f 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s'];(function(_0x3caaee,_0x4d9c4f){var _0x173209=function(_0x3e4981){while(--_0x3e4981){_0x3caaee['push'](_0x3caaee['shift']());}};_0x173209(++_0x4d9c4f);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x152449,_0x49f41d){_0x152449=_0x152449-0x0;var _0x5b58b2=_0xcb91[_0x152449];return _0x5b58b2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file +var _0x0713=['VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x16a87e,_0x558078){var _0x12ea77=function(_0x319882){while(--_0x319882){_0x16a87e['push'](_0x16a87e['shift']());}};_0x12ea77(++_0x558078);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 4da503e..2076203 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 _0xb1dc=['post','addAgents','/:id/teams','addTeams','update','delete','destroy','removeAgents','removeTeams','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/:id','show','/:id/users','getAgents','getTeams'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xb1dc,0x133));var _0xcb1d=function(_0x4067ac,_0x363603){_0x4067ac=_0x4067ac-0x0;var _0x53d74d=_0xb1dc[_0x4067ac];return _0x53d74d;};'use strict';var multer=require('multer');var util=require(_0xcb1d('0x0'));var path=require('path');var timeout=require(_0xcb1d('0x1'));var express=require(_0xcb1d('0x2'));var router=express[_0xcb1d('0x3')]();var fs_extra=require(_0xcb1d('0x4'));var auth=require(_0xcb1d('0x5'));var interaction=require(_0xcb1d('0x6'));var config=require(_0xcb1d('0x7'));var controller=require(_0xcb1d('0x8'));router[_0xcb1d('0x9')]('/',auth[_0xcb1d('0xa')](),controller[_0xcb1d('0xb')]);router[_0xcb1d('0x9')]('/describe',auth[_0xcb1d('0xa')](),controller['describe']);router[_0xcb1d('0x9')](_0xcb1d('0xc'),auth[_0xcb1d('0xa')](),controller[_0xcb1d('0xd')]);router[_0xcb1d('0x9')](_0xcb1d('0xe'),auth[_0xcb1d('0xa')](),controller[_0xcb1d('0xf')]);router[_0xcb1d('0x9')]('/:id/teams',auth[_0xcb1d('0xa')](),controller[_0xcb1d('0x10')]);router[_0xcb1d('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0xcb1d('0x11')]('/:id/users',auth[_0xcb1d('0xa')](),controller[_0xcb1d('0x12')]);router[_0xcb1d('0x11')](_0xcb1d('0x13'),auth['isAuthenticated'](),controller[_0xcb1d('0x14')]);router['put'](_0xcb1d('0xc'),auth['isAuthenticated'](),controller[_0xcb1d('0x15')]);router[_0xcb1d('0x16')](_0xcb1d('0xc'),auth[_0xcb1d('0xa')](),controller[_0xcb1d('0x17')]);router[_0xcb1d('0x16')](_0xcb1d('0xe'),auth['isAuthenticated'](),controller[_0xcb1d('0x18')]);router['delete'](_0xcb1d('0x13'),auth['isAuthenticated'](),controller[_0xcb1d('0x19')]);module[_0xcb1d('0x1a')]=router; \ No newline at end of file +var _0x0bde=['Router','fs-extra','../../components/auth/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/users','create','addAgents','post','/:id/teams','addTeams','put','destroy','delete','removeTeams','exports','util','connect-timeout','express'];(function(_0x12f59c,_0x13d956){var _0x2db43e=function(_0x1743fb){while(--_0x1743fb){_0x12f59c['push'](_0x12f59c['shift']());}};_0x2db43e(++_0x13d956);}(_0x0bde,0xe7));var _0xe0bd=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0bde[_0x122ef9];return _0x42fba0;};'use strict';var multer=require('multer');var util=require(_0xe0bd('0x0'));var path=require('path');var timeout=require(_0xe0bd('0x1'));var express=require(_0xe0bd('0x2'));var router=express[_0xe0bd('0x3')]();var fs_extra=require(_0xe0bd('0x4'));var auth=require(_0xe0bd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe0bd('0x6'));var controller=require(_0xe0bd('0x7'));router[_0xe0bd('0x8')]('/',auth[_0xe0bd('0x9')](),controller[_0xe0bd('0xa')]);router[_0xe0bd('0x8')](_0xe0bd('0xb'),auth['isAuthenticated'](),controller[_0xe0bd('0xc')]);router[_0xe0bd('0x8')](_0xe0bd('0xd'),auth[_0xe0bd('0x9')](),controller[_0xe0bd('0xe')]);router[_0xe0bd('0x8')](_0xe0bd('0xf'),auth[_0xe0bd('0x9')](),controller['getAgents']);router['get']('/:id/teams',auth[_0xe0bd('0x9')](),controller['getTeams']);router['post']('/',auth[_0xe0bd('0x9')](),controller[_0xe0bd('0x10')]);router['post'](_0xe0bd('0xf'),auth['isAuthenticated'](),controller[_0xe0bd('0x11')]);router[_0xe0bd('0x12')](_0xe0bd('0x13'),auth[_0xe0bd('0x9')](),controller[_0xe0bd('0x14')]);router[_0xe0bd('0x15')](_0xe0bd('0xd'),auth[_0xe0bd('0x9')](),controller['update']);router['delete']('/:id',auth[_0xe0bd('0x9')](),controller[_0xe0bd('0x16')]);router[_0xe0bd('0x17')](_0xe0bd('0xf'),auth[_0xe0bd('0x9')](),controller['removeAgents']);router['delete'](_0xe0bd('0x13'),auth['isAuthenticated'](),controller[_0xe0bd('0x18')]);module[_0xe0bd('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 1a101f3..8fefc5a 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 _0x5eeb=['sequelize','exports','STRING','name','VIRTUAL','system-','getDataValue'];(function(_0x3ded1b,_0x56de41){var _0x2fb179=function(_0x51613e){while(--_0x51613e){_0x3ded1b['push'](_0x3ded1b['shift']());}};_0x2fb179(++_0x56de41);}(_0x5eeb,0x149));var _0xb5ee=function(_0x352e09,_0x37a7da){_0x352e09=_0x352e09-0x0;var _0x1b7094=_0x5eeb[_0x352e09];return _0x1b7094;};'use strict';var Sequelize=require(_0xb5ee('0x0'));module[_0xb5ee('0x1')]={'name':{'type':Sequelize[_0xb5ee('0x2')],'allowNull':![],'unique':_0xb5ee('0x3')},'prefix':{'type':Sequelize[_0xb5ee('0x4')],'get':function(_0x20168b){return _0xb5ee('0x5')+this[_0xb5ee('0x6')]('name')+'-';}},'description':{'type':Sequelize[_0xb5ee('0x2')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xf042=['VIRTUAL','system-','STRING','sequelize','exports','name'];(function(_0xa2dcd4,_0x4850de){var _0xa3f789=function(_0xc2b0fe){while(--_0xc2b0fe){_0xa2dcd4['push'](_0xa2dcd4['shift']());}};_0xa3f789(++_0x4850de);}(_0xf042,0xcf));var _0x2f04=function(_0x370c14,_0x507a12){_0x370c14=_0x370c14-0x0;var _0x1e6a3c=_0xf042[_0x370c14];return _0x1e6a3c;};'use strict';var Sequelize=require(_0x2f04('0x0'));module[_0x2f04('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x2f04('0x2')},'prefix':{'type':Sequelize[_0x2f04('0x3')],'get':function(_0x532a69){return _0x2f04('0x4')+this['getDataValue'](_0x2f04('0x2'))+'-';}},'description':{'type':Sequelize[_0x2f04('0x5')]},'callerIdAll':{'type':Sequelize[_0x2f04('0x5')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index f1ed861..5b77d6f 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 _0x8e3f=['charAt','update','system-','findById','addAgents','ids','omit','userVoicePrefix:save','isArray','emit','userVoicePrefix:remove','getAgents','findOne','User','getTeams','online','voicePause','interface','flatMap','get','Agents','addTeams','each','UserVoicePrefix','forEach','Team','select','field','tq.TeamId','join','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','QueryTypes','every','includes','all','union','compact','removeTeams','isEmpty','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./voicePrefix.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','VoicePrefixes','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VoicePrefix','findAll','catch','includeAll','include','find','params','describe','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','context','from-sip','exten','app','description','Voice\x20Prefix\x20Extension','priority','prefix','NoOp','VoicePrefixId','bulkCreate','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','${EXTEN:'];(function(_0x72b8cf,_0x25adab){var _0xb93b10=function(_0x30bdc0){while(--_0x30bdc0){_0x72b8cf['push'](_0x72b8cf['shift']());}};_0xb93b10(++_0x25adab);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x8e3f[_0x57b54c];return _0x59cc19;};'use strict';var emlformat=require(_0xf8e3('0x0'));var rimraf=require(_0xf8e3('0x1'));var zipdir=require(_0xf8e3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf8e3('0x3'));var moment=require(_0xf8e3('0x4'));var BPromise=require(_0xf8e3('0x5'));var Mustache=require('mustache');var util=require(_0xf8e3('0x6'));var path=require(_0xf8e3('0x7'));var sox=require('sox');var csv=require(_0xf8e3('0x8'));var ejs=require(_0xf8e3('0x9'));var fs=require('fs');var fs_extra=require(_0xf8e3('0xa'));var _=require(_0xf8e3('0xb'));var squel=require('squel');var crypto=require(_0xf8e3('0xc'));var jsforce=require(_0xf8e3('0xd'));var deskjs=require(_0xf8e3('0xe'));var toCsv=require(_0xf8e3('0x8'));var querystring=require(_0xf8e3('0xf'));var Papa=require(_0xf8e3('0x10'));var Redis=require(_0xf8e3('0x11'));var authService=require(_0xf8e3('0x12'));var qs=require(_0xf8e3('0x13'));var as=require(_0xf8e3('0x14'));var hardwareService=require(_0xf8e3('0x15'));var logger=require(_0xf8e3('0x16'))('api');var utils=require(_0xf8e3('0x17'));var config=require(_0xf8e3('0x18'));var licenseUtil=require(_0xf8e3('0x19'));var db=require('../../mysqldb')['db'];config[_0xf8e3('0x1a')]=_[_0xf8e3('0x1b')](config[_0xf8e3('0x1a')],{'host':_0xf8e3('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf8e3('0x1a')]));require(_0xf8e3('0x1d'))[_0xf8e3('0x1e')](socket);function respondWithStatusCode(_0x4af736,_0x44f631){_0x44f631=_0x44f631||0xcc;return function(_0x5136c6){if(_0x5136c6){return _0x4af736[_0xf8e3('0x1f')](_0x44f631);}return _0x4af736[_0xf8e3('0x20')](_0x44f631)[_0xf8e3('0x21')]();};}function respondWithResult(_0x570ee3,_0x529c92){_0x529c92=_0x529c92||0xc8;return function(_0x564f43){if(_0x564f43){return _0x570ee3[_0xf8e3('0x20')](_0x529c92)[_0xf8e3('0x22')](_0x564f43);}};}function respondWithFilteredResult(_0x3b01ac,_0x110a78){return function(_0x11d4cc){if(_0x11d4cc){var _0x7a81c3=typeof _0x110a78[_0xf8e3('0x23')]===_0xf8e3('0x24')&&typeof _0x110a78[_0xf8e3('0x25')]==='undefined';var _0x20cc64=_0x11d4cc[_0xf8e3('0x26')];var _0x24e8d6=_0x7a81c3?0x0:_0x110a78[_0xf8e3('0x23')];var _0x3128ad=_0x7a81c3?_0x11d4cc[_0xf8e3('0x26')]:_0x110a78[_0xf8e3('0x23')]+_0x110a78[_0xf8e3('0x25')];var _0x5b99b1;if(_0x3128ad>=_0x20cc64){_0x3128ad=_0x20cc64;_0x5b99b1=0xc8;}else{_0x5b99b1=0xce;}_0x3b01ac[_0xf8e3('0x20')](_0x5b99b1);return _0x3b01ac[_0xf8e3('0x27')](_0xf8e3('0x28'),_0x24e8d6+'-'+_0x3128ad+'/'+_0x20cc64)[_0xf8e3('0x22')](_0x11d4cc);}return null;};}function patchUpdates(_0x4a1e5f){return function(_0x39df34){try{jsonpatch['apply'](_0x39df34,_0x4a1e5f,!![]);}catch(_0x286059){return BPromise[_0xf8e3('0x29')](_0x286059);}return _0x39df34[_0xf8e3('0x2a')]();};}function saveUpdates(_0x2dc856,_0x1f4b68){return function(_0x3ac384){if(_0x3ac384){return _0x3ac384['update'](_0x2dc856)[_0xf8e3('0x2b')](function(_0x2fc674){return _0x2fc674;});}return null;};}function removeEntity(_0x3373ca,_0x417b42){return function(_0x1f1363){if(_0x1f1363){return _0x1f1363[_0xf8e3('0x2c')]()[_0xf8e3('0x2b')](function(){var _0x157a2d=_0x1f1363['get']({'plain':!![]});var _0x356e0a=_0xf8e3('0x2d');return db[_0xf8e3('0x2e')][_0xf8e3('0x2c')]({'where':{'type':_0x356e0a,'resourceId':_0x157a2d['id']}})[_0xf8e3('0x2b')](function(){return _0x1f1363;});})[_0xf8e3('0x2b')](function(){_0x3373ca[_0xf8e3('0x20')](0xcc)[_0xf8e3('0x21')]();});}};}function handleEntityNotFound(_0x4f2ae9,_0x21e1c0){return function(_0x243e28){if(!_0x243e28){_0x4f2ae9[_0xf8e3('0x1f')](0x194);}return _0x243e28;};}function handleError(_0x28b2f2,_0x567153){_0x567153=_0x567153||0x1f4;return function(_0x2e507c){logger[_0xf8e3('0x2f')](_0x2e507c[_0xf8e3('0x30')]);if(_0x2e507c[_0xf8e3('0x31')]){delete _0x2e507c[_0xf8e3('0x31')];}_0x28b2f2[_0xf8e3('0x20')](_0x567153)[_0xf8e3('0x32')](_0x2e507c);};}exports[_0xf8e3('0x33')]=function(_0x50ad3f,_0x2c07bf){var _0x527337={},_0x4acd6c={},_0x5d2dd5={'count':0x0,'rows':[]};var _0x5cc1ed=_[_0xf8e3('0x34')](db['VoicePrefix'][_0xf8e3('0x35')],function(_0x41faaa){return{'name':_0x41faaa[_0xf8e3('0x36')],'type':_0x41faaa[_0xf8e3('0x37')]['key']};});_0x4acd6c['model']=_[_0xf8e3('0x34')](_0x5cc1ed,_0xf8e3('0x31'));_0x4acd6c[_0xf8e3('0x38')]=_[_0xf8e3('0x39')](_0x50ad3f[_0xf8e3('0x38')]);_0x4acd6c[_0xf8e3('0x3a')]=_['intersection'](_0x4acd6c[_0xf8e3('0x3b')],_0x4acd6c['query']);_0x527337['attributes']=_[_0xf8e3('0x3c')](_0x4acd6c[_0xf8e3('0x3b')],qs[_0xf8e3('0x3d')](_0x50ad3f[_0xf8e3('0x38')]['fields']));_0x527337['attributes']=_0x527337[_0xf8e3('0x3e')][_0xf8e3('0x3f')]?_0x527337['attributes']:_0x4acd6c[_0xf8e3('0x3b')];if(!_0x50ad3f[_0xf8e3('0x38')][_0xf8e3('0x40')](_0xf8e3('0x41'))){_0x527337['limit']=qs['limit'](_0x50ad3f['query'][_0xf8e3('0x25')]);_0x527337[_0xf8e3('0x23')]=qs[_0xf8e3('0x23')](_0x50ad3f[_0xf8e3('0x38')]['offset']);}_0x527337[_0xf8e3('0x42')]=qs['sort'](_0x50ad3f[_0xf8e3('0x38')][_0xf8e3('0x43')]);_0x527337[_0xf8e3('0x44')]=qs[_0xf8e3('0x3a')](_[_0xf8e3('0x45')](_0x50ad3f[_0xf8e3('0x38')],_0x4acd6c[_0xf8e3('0x3a')]),_0x5cc1ed);if(_0x50ad3f[_0xf8e3('0x38')][_0xf8e3('0x46')]){_0x527337['where']=_[_0xf8e3('0x47')](_0x527337['where'],{'$or':_[_0xf8e3('0x34')](_0x5cc1ed,function(_0x1e8917){if(_0x1e8917[_0xf8e3('0x37')]!==_0xf8e3('0x48')){var _0x64bfc6={};_0x64bfc6[_0x1e8917[_0xf8e3('0x31')]]={'$like':'%'+_0x50ad3f[_0xf8e3('0x38')][_0xf8e3('0x46')]+'%'};return _0x64bfc6;}})});}_0x527337=_['merge']({},_0x527337,_0x50ad3f[_0xf8e3('0x49')]);var _0x108b81={'where':_0x527337[_0xf8e3('0x44')]};return db[_0xf8e3('0x4a')][_0xf8e3('0x26')](_0x108b81)[_0xf8e3('0x2b')](function(_0x792190){_0x5d2dd5[_0xf8e3('0x26')]=_0x792190;if(_0x50ad3f['query']['includeAll']){_0x527337['include']=[{'all':!![]}];}return db[_0xf8e3('0x4a')][_0xf8e3('0x4b')](_0x527337);})['then'](function(_0x181908){_0x5d2dd5['rows']=_0x181908;return _0x5d2dd5;})[_0xf8e3('0x2b')](respondWithFilteredResult(_0x2c07bf,_0x527337))[_0xf8e3('0x4c')](handleError(_0x2c07bf,null));};exports['show']=function(_0x1fb64d,_0x4b0791){var _0x679519={'raw':![],'where':{'id':_0x1fb64d['params']['id']}},_0x6875a6={};_0x6875a6[_0xf8e3('0x3b')]=_[_0xf8e3('0x39')](db[_0xf8e3('0x4a')][_0xf8e3('0x35')]);_0x6875a6['query']=_['keys'](_0x1fb64d['query']);_0x6875a6[_0xf8e3('0x3a')]=_[_0xf8e3('0x3c')](_0x6875a6[_0xf8e3('0x3b')],_0x6875a6['query']);_0x679519[_0xf8e3('0x3e')]=_['intersection'](_0x6875a6[_0xf8e3('0x3b')],qs[_0xf8e3('0x3d')](_0x1fb64d['query']['fields']));_0x679519[_0xf8e3('0x3e')]=_0x679519[_0xf8e3('0x3e')][_0xf8e3('0x3f')]?_0x679519[_0xf8e3('0x3e')]:_0x6875a6[_0xf8e3('0x3b')];if(_0x1fb64d[_0xf8e3('0x38')][_0xf8e3('0x4d')]){_0x679519[_0xf8e3('0x4e')]=[{'all':!![]}];}_0x679519=_[_0xf8e3('0x47')]({},_0x679519,_0x1fb64d[_0xf8e3('0x49')]);return db[_0xf8e3('0x4a')]['find'](_0x679519)[_0xf8e3('0x2b')](handleEntityNotFound(_0x4b0791,null))[_0xf8e3('0x2b')](respondWithResult(_0x4b0791,null))[_0xf8e3('0x4c')](handleError(_0x4b0791,null));};exports[_0xf8e3('0x2c')]=function(_0x385a8f,_0x3256e6){return db['VoicePrefix'][_0xf8e3('0x4f')]({'where':{'id':_0x385a8f[_0xf8e3('0x50')]['id']}})[_0xf8e3('0x2b')](handleEntityNotFound(_0x3256e6,null))[_0xf8e3('0x2b')](removeEntity(_0x3256e6,null))[_0xf8e3('0x4c')](handleError(_0x3256e6,null));};exports[_0xf8e3('0x51')]=function(_0x5855f2,_0x260f67){return db[_0xf8e3('0x4a')][_0xf8e3('0x51')]()[_0xf8e3('0x2b')](respondWithResult(_0x260f67,null))[_0xf8e3('0x4c')](handleError(_0x260f67,null));};exports[_0xf8e3('0x52')]=function(_0x5990fc,_0x394e45){var _0x1f425f;return db[_0xf8e3('0x53')][_0xf8e3('0x54')](function(_0x452b00){return db['VoicePrefix'][_0xf8e3('0x52')](_0x5990fc[_0xf8e3('0x55')],{'transaction':_0x452b00})[_0xf8e3('0x2b')](function(_0x53c897){_0x1f425f=_0x53c897['get']({'plain':!![]});return db[_0xf8e3('0x56')][_0xf8e3('0x4f')]({'where':{'id':_0x1f425f[_0xf8e3('0x57')]},'raw':!![]})[_0xf8e3('0x2b')](function(_0x58ad2f){return createVoicePrefixExtensions(_0x1f425f,_0x58ad2f,_0x452b00);});});})[_0xf8e3('0x2b')](function(){var _0x16bddb=_0x5990fc['user']['get']({'plain':!![]});if(!_0x16bddb)throw new Error(_0xf8e3('0x58'));if(_0x16bddb[_0xf8e3('0x59')]===_0xf8e3('0x5a')){var _0x505477=_0x1f425f;return db['UserProfileSection']['find']({'where':{'name':_0xf8e3('0x2d'),'userProfileId':_0x16bddb[_0xf8e3('0x5b')]},'raw':!![]})['then'](function(_0x4937fc){if(_0x4937fc&&_0x4937fc['autoAssociation']===0x0){return db[_0xf8e3('0x2e')][_0xf8e3('0x52')]({'name':_0x505477['name'],'resourceId':_0x505477['id'],'type':_0x4937fc[_0xf8e3('0x31')],'sectionId':_0x4937fc['id']},{})[_0xf8e3('0x2b')](function(){return _0x1f425f;});}else{return _0x1f425f;}})[_0xf8e3('0x4c')](function(_0x560f42){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x560f42);throw _0x560f42;});}return _0x1f425f;})['then'](respondWithResult(_0x394e45,null))[_0xf8e3('0x4c')](handleError(_0x394e45,null));};function Extension(_0x3b120a,_0x3ef144,_0x447efe,_0x442349){this[_0xf8e3('0x5c')]=_0xf8e3('0x5d');this[_0xf8e3('0x5e')]=_0x3b120a;this[_0xf8e3('0x5f')]=_0x447efe;this['type']='system';this[_0xf8e3('0x60')]=_0xf8e3('0x61');this[_0xf8e3('0x62')]=_0x3ef144;this['appdata']=_0x442349;}function createVoicePrefixExtensions(_0x234b06,_0x131c0b,_0x4879c7){return new BPromise(function(_0x48bb3f,_0x256cd5){var _0x4763eb=new Extension(formatPrefixName(_0x234b06[_0xf8e3('0x63')]),0x1,_0xf8e3('0x64'),'Voice\x20Prefix');_0x4763eb['VoicePrefixId']=_0x234b06['id'];return db[_0xf8e3('0x56')][_0xf8e3('0x52')](_0x4763eb,{'transaction':_0x4879c7})[_0xf8e3('0x2b')](function(_0x392d99){var _0x4f1ddb=_0x392d99['get']({'plain':!![]});var _0x324ad5=_[_0xf8e3('0x34')](addVoicePrefixExtensions(_0x234b06,_0x131c0b),function(_0x56a07e){_0x56a07e[_0xf8e3('0x57')]=_0x4f1ddb['id'];_0x56a07e[_0xf8e3('0x65')]=_0x234b06['id'];return _0x56a07e;});return db[_0xf8e3('0x56')][_0xf8e3('0x66')](_0x324ad5,{'transaction':_0x4879c7})['then'](function(_0x11ebb2){if(!_0x11ebb2){return _0x256cd5('Extensions\x20creation\x20failed');}else{return _0x48bb3f(_0x11ebb2);}})[_0xf8e3('0x4c')](function(_0x1cad38){return _0x256cd5(_0x1cad38);});});;});};function addVoicePrefixExtensions(_0x5cbdc6,_0x2ec4f6){var _0x31568b=[];var _0x55418c=formatPrefixName(_0x5cbdc6[_0xf8e3('0x63')]);_0x31568b[_0xf8e3('0x67')](new Extension(_0x55418c,0x2,_0xf8e3('0x68'),_0xf8e3('0x69')+_0x5cbdc6['name']));if(_0x5cbdc6[_0xf8e3('0x6a')]){_0x31568b[_0xf8e3('0x67')](new Extension(_0x55418c,0x3,_0xf8e3('0x68'),_0xf8e3('0x6b')+_0x5cbdc6[_0xf8e3('0x6a')]));}else{_0x31568b[_0xf8e3('0x67')](new Extension(_0x55418c,0x3,_0xf8e3('0x64'),_0xf8e3('0x6c')));}_0x31568b[_0xf8e3('0x67')](new Extension(_0x55418c,0x4,_0xf8e3('0x6d'),_0x2ec4f6[_0xf8e3('0x5c')]+','+_0xf8e3('0x6e')+(0x8+_0x5cbdc6['name']['length'])+'}'+','+0x1));return _0x31568b;}function formatPrefixName(_0x2f6cf4){var _0x32eaab='_';for(var _0x5ccdb2=0x0;_0x5ccdb2<_0x2f6cf4[_0xf8e3('0x3f')];_0x5ccdb2++){if(_0x2f6cf4[_0xf8e3('0x6f')](_0x5ccdb2)=='-'){_0x32eaab+=_0x2f6cf4[_0xf8e3('0x6f')](_0x5ccdb2);}else{_0x32eaab+='['+_0x2f6cf4[_0xf8e3('0x6f')](_0x5ccdb2)+']';}}_0x32eaab+='.';return _0x32eaab;}exports[_0xf8e3('0x70')]=function(_0x5804eb,_0x3e501c,_0x1dcd23){var _0x52e996=_0x5804eb[_0xf8e3('0x55')];_0x52e996['prefix']=_0xf8e3('0x71')+_0x52e996['name']+'-';return db[_0xf8e3('0x53')][_0xf8e3('0x54')](function(_0x45361d){return db[_0xf8e3('0x4a')][_0xf8e3('0x70')](_0x52e996,{'where':{'id':_0x52e996['id']},'transaction':_0x45361d})['then'](function(){return db[_0xf8e3('0x56')][_0xf8e3('0x2c')]({'where':{'VoicePrefixId':_0x52e996['id']},'transaction':_0x45361d})[_0xf8e3('0x2b')](function(){return db[_0xf8e3('0x56')][_0xf8e3('0x4f')]({'where':{'id':_0x52e996[_0xf8e3('0x57')]},'raw':!![]})[_0xf8e3('0x2b')](function(_0x2ccd34){return createVoicePrefixExtensions(_0x52e996,_0x2ccd34,_0x45361d);});});});})[_0xf8e3('0x2b')](function(){return db[_0xf8e3('0x4a')][_0xf8e3('0x72')](_0x52e996['id']);})[_0xf8e3('0x2b')](respondWithResult(_0x3e501c,null))['catch'](handleError(_0x3e501c,null));};exports[_0xf8e3('0x73')]=function(_0x280f06,_0x3dc049,_0x4b69db){return db[_0xf8e3('0x4a')][_0xf8e3('0x4f')]({'where':{'id':_0x280f06[_0xf8e3('0x50')]['id']}})[_0xf8e3('0x2b')](handleEntityNotFound(_0x3dc049,null))[_0xf8e3('0x2b')](function(_0x40174a){if(_0x40174a){return _0x40174a[_0xf8e3('0x73')](_0x280f06[_0xf8e3('0x55')][_0xf8e3('0x74')],_[_0xf8e3('0x75')](_0x280f06[_0xf8e3('0x55')],[_0xf8e3('0x74'),'id'])||{})['spread'](function(_0x118cc6){for(var _0xf7cb3a=0x0;_0xf7cb3a<_0x280f06[_0xf8e3('0x55')][_0xf8e3('0x74')]['length'];_0xf7cb3a+=0x1){socket['emit'](_0xf8e3('0x76'),{'UserId':Number(_0x280f06[_0xf8e3('0x55')]['ids'][_0xf7cb3a]),'VoicePrefixId':Number(_0x280f06['params']['id'])});}return _0x118cc6;});}})[_0xf8e3('0x2b')](respondWithResult(_0x3dc049,null))[_0xf8e3('0x4c')](handleError(_0x3dc049,null));};exports['removeAgents']=function(_0x2a2c6,_0xca5962,_0x16e69a){return db[_0xf8e3('0x4a')][_0xf8e3('0x4f')]({'where':{'id':_0x2a2c6['params']['id']}})[_0xf8e3('0x2b')](handleEntityNotFound(_0xca5962,null))[_0xf8e3('0x2b')](function(_0x54db4e){if(_0x54db4e){return _0x54db4e['removeAgents'](_0x2a2c6[_0xf8e3('0x38')][_0xf8e3('0x74')])[_0xf8e3('0x2b')](function(){if(_[_0xf8e3('0x77')](_0x2a2c6[_0xf8e3('0x38')][_0xf8e3('0x74')])){for(var _0x3823b9=0x0;_0x3823b9<_0x2a2c6[_0xf8e3('0x38')]['ids'][_0xf8e3('0x3f')];_0x3823b9+=0x1){socket[_0xf8e3('0x78')](_0xf8e3('0x79'),{'UserId':Number(_0x2a2c6[_0xf8e3('0x38')][_0xf8e3('0x74')][_0x3823b9]),'VoicePrefixId':Number(_0x2a2c6[_0xf8e3('0x50')]['id'])});}}else{socket['emit'](_0xf8e3('0x79'),{'UserId':Number(_0x2a2c6[_0xf8e3('0x38')][_0xf8e3('0x74')]),'VoicePrefixId':Number(_0x2a2c6['params']['id'])});}});}})['then'](respondWithStatusCode(_0xca5962,null))[_0xf8e3('0x4c')](handleError(_0xca5962,null));};exports[_0xf8e3('0x7a')]=function(_0x25805c,_0xc01ac,_0x4659ed){var _0x5b8840={};var _0x25bf6c={};var _0x1f5a80;var _0x1bfe33;return db[_0xf8e3('0x4a')][_0xf8e3('0x7b')]({'where':{'id':_0x25805c[_0xf8e3('0x50')]['id']}})[_0xf8e3('0x2b')](handleEntityNotFound(_0xc01ac,null))[_0xf8e3('0x2b')](function(_0x40b66c){if(_0x40b66c){_0x1f5a80=_0x40b66c;_0x25bf6c['model']=_[_0xf8e3('0x39')](db[_0xf8e3('0x7c')][_0xf8e3('0x35')]);_0x25bf6c[_0xf8e3('0x38')]=_[_0xf8e3('0x39')](_0x25805c[_0xf8e3('0x38')]);_0x25bf6c[_0xf8e3('0x3a')]=_['intersection'](_0x25bf6c['model'],_0x25bf6c[_0xf8e3('0x38')]);_0x5b8840[_0xf8e3('0x3e')]=_['intersection'](_0x25bf6c[_0xf8e3('0x3b')],qs[_0xf8e3('0x3d')](_0x25805c[_0xf8e3('0x38')][_0xf8e3('0x3d')]));_0x5b8840[_0xf8e3('0x3e')]=_0x5b8840[_0xf8e3('0x3e')][_0xf8e3('0x3f')]?_0x5b8840['attributes']:_0x25bf6c[_0xf8e3('0x3b')];_0x5b8840[_0xf8e3('0x42')]=qs[_0xf8e3('0x43')](_0x25805c[_0xf8e3('0x38')][_0xf8e3('0x43')]);_0x5b8840[_0xf8e3('0x44')]=qs[_0xf8e3('0x3a')](_[_0xf8e3('0x45')](_0x25805c[_0xf8e3('0x38')],_0x25bf6c[_0xf8e3('0x3a')]));if(_0x25805c[_0xf8e3('0x38')]['filter']){_0x5b8840['where']=_[_0xf8e3('0x47')](_0x5b8840['where'],{'$or':_[_0xf8e3('0x34')](_0x5b8840['attributes'],function(_0x1a3843){var _0x1b2249={};_0x1b2249[_0x1a3843]={'$like':'%'+_0x25805c[_0xf8e3('0x38')]['filter']+'%'};return _0x1b2249;})});}_0x5b8840=_[_0xf8e3('0x47')]({},_0x5b8840,_0x25805c[_0xf8e3('0x49')]);return _0x1f5a80[_0xf8e3('0x7a')](_0x5b8840);}})[_0xf8e3('0x2b')](function(_0x3619cd){if(_0x3619cd){_0x1bfe33=_0x3619cd['length'];if(!_0x25805c[_0xf8e3('0x38')]['hasOwnProperty'](_0xf8e3('0x41'))){_0x5b8840[_0xf8e3('0x25')]=qs[_0xf8e3('0x25')](_0x25805c[_0xf8e3('0x38')][_0xf8e3('0x25')]);_0x5b8840[_0xf8e3('0x23')]=qs[_0xf8e3('0x23')](_0x25805c['query'][_0xf8e3('0x23')]);}return _0x1f5a80[_0xf8e3('0x7a')](_0x5b8840);}})[_0xf8e3('0x2b')](function(_0x1a9ba6){if(_0x1a9ba6){return _0x1a9ba6?{'count':_0x1bfe33,'rows':_0x1a9ba6}:null;}})['then'](respondWithResult(_0xc01ac,null))[_0xf8e3('0x4c')](handleError(_0xc01ac,null));};exports[_0xf8e3('0x7d')]=function(_0x3f7c0e,_0x2da8fb,_0x22fa2f){var _0x18fbd2={};var _0x477589={};var _0x1bb12c;var _0x4a5ad8;return db['VoicePrefix'][_0xf8e3('0x7b')]({'where':{'id':_0x3f7c0e[_0xf8e3('0x50')]['id']}})[_0xf8e3('0x2b')](handleEntityNotFound(_0x2da8fb,null))[_0xf8e3('0x2b')](function(_0x131625){if(_0x131625){_0x1bb12c=_0x131625;_0x477589[_0xf8e3('0x3b')]=_[_0xf8e3('0x39')](db['Team'][_0xf8e3('0x35')]);_0x477589['query']=_[_0xf8e3('0x39')](_0x3f7c0e[_0xf8e3('0x38')]);_0x477589[_0xf8e3('0x3a')]=_[_0xf8e3('0x3c')](_0x477589['model'],_0x477589[_0xf8e3('0x38')]);_0x18fbd2['attributes']=_['intersection'](_0x477589[_0xf8e3('0x3b')],qs[_0xf8e3('0x3d')](_0x3f7c0e[_0xf8e3('0x38')][_0xf8e3('0x3d')]));_0x18fbd2['attributes']=_0x18fbd2['attributes'][_0xf8e3('0x3f')]?_0x18fbd2[_0xf8e3('0x3e')]:_0x477589['model'];_0x18fbd2['order']=qs[_0xf8e3('0x43')](_0x3f7c0e[_0xf8e3('0x38')]['sort']);_0x18fbd2[_0xf8e3('0x44')]=qs[_0xf8e3('0x3a')](_[_0xf8e3('0x45')](_0x3f7c0e[_0xf8e3('0x38')],_0x477589[_0xf8e3('0x3a')]));if(_0x3f7c0e[_0xf8e3('0x38')][_0xf8e3('0x46')]){_0x18fbd2['where']=_[_0xf8e3('0x47')](_0x18fbd2[_0xf8e3('0x44')],{'$or':_['map'](_0x18fbd2[_0xf8e3('0x3e')],function(_0x4a8866){var _0x1ca81d={};_0x1ca81d[_0x4a8866]={'$like':'%'+_0x3f7c0e[_0xf8e3('0x38')][_0xf8e3('0x46')]+'%'};return _0x1ca81d;})});}_0x18fbd2=_['merge']({},_0x18fbd2,_0x3f7c0e[_0xf8e3('0x49')]);return _0x1bb12c['getTeams'](_0x18fbd2);}})[_0xf8e3('0x2b')](function(_0x41ca1b){if(_0x41ca1b){_0x4a5ad8=_0x41ca1b[_0xf8e3('0x3f')];if(!_0x3f7c0e[_0xf8e3('0x38')]['hasOwnProperty']('nolimit')){_0x18fbd2[_0xf8e3('0x25')]=qs[_0xf8e3('0x25')](_0x3f7c0e[_0xf8e3('0x38')][_0xf8e3('0x25')]);_0x18fbd2[_0xf8e3('0x23')]=qs[_0xf8e3('0x23')](_0x3f7c0e['query'][_0xf8e3('0x23')]);}return _0x1bb12c[_0xf8e3('0x7d')](_0x18fbd2);}})[_0xf8e3('0x2b')](function(_0x348e59){if(_0x348e59){return _0x348e59?{'count':_0x4a5ad8,'rows':_0x348e59}:null;}})['then'](respondWithResult(_0x2da8fb,null))[_0xf8e3('0x4c')](handleError(_0x2da8fb,null));};exports['addTeams']=function(_0x3b51c7,_0xf88bb2,_0x4b27e3){var _0x108168=_0x3b51c7['body'][_0xf8e3('0x74')];var _0x3fba66;return db['Team'][_0xf8e3('0x4b')]({'where':{'id':_0x108168},'attributes':['id'],'include':[{'model':db[_0xf8e3('0x7c')],'as':'Agents','attributes':['id',_0xf8e3('0x31'),_0xf8e3('0x7e'),_0xf8e3('0x7f'),_0xf8e3('0x80')],'raw':!![]}]})[_0xf8e3('0x2b')](function(_0x3b79e1){if(_0x3b79e1){_0x3fba66=_0x3b79e1;var _0x13f467=_[_0xf8e3('0x81')](_0x3b79e1,function(_0x29c04b){var _0x271ed0=_0x29c04b[_0xf8e3('0x82')]({'plain':!![]});return _0x271ed0[_0xf8e3('0x83')];});return db['VoicePrefix'][_0xf8e3('0x4f')]({'where':{'id':_0x3b51c7[_0xf8e3('0x50')]['id']}})[_0xf8e3('0x2b')](function(_0x48230e){return db[_0xf8e3('0x53')][_0xf8e3('0x54')](function(_0x7e83fd){return _0x48230e[_0xf8e3('0x84')](_0x108168,{'transaction':_0x7e83fd})[_0xf8e3('0x2b')](function(){return BPromise[_0xf8e3('0x85')](_0x3fba66,function(_0x6d4c09){return db['TeamVoicePrefix']['upsert']({'TeamId':_0x6d4c09['id'],'VoicePrefixId':_0x3b51c7[_0xf8e3('0x50')]['id']},{'transaction':_0x7e83fd});});})[_0xf8e3('0x2b')](function(){return BPromise['each'](_0x13f467,function(_0x1a85cf){return db[_0xf8e3('0x86')]['findOrCreate']({'where':{'UserId':_0x1a85cf['id'],'VoicePrefixId':_0x3b51c7[_0xf8e3('0x50')]['id']},'transaction':_0x7e83fd});});})[_0xf8e3('0x2b')](function(){_0x13f467[_0xf8e3('0x87')](function(_0x27d0b6){socket[_0xf8e3('0x78')]('userVoicePrefix:save',{'UserId':_0x27d0b6['id'],'VoicePrefixId':_0x48230e['id']});});});});});}})[_0xf8e3('0x2b')](respondWithStatusCode(_0xf88bb2,null))[_0xf8e3('0x4c')](handleError(_0xf88bb2,null));};exports['removeTeams']=function(_0x4f02bb,_0x237eb6,_0xd9e796){return db[_0xf8e3('0x88')][_0xf8e3('0x4b')]({'where':{'id':_0x4f02bb[_0xf8e3('0x38')][_0xf8e3('0x74')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xf8e3('0x83'),'attributes':['id'],'raw':!![]}]})[_0xf8e3('0x2b')](handleEntityNotFound(_0x237eb6,null))['then'](function(_0x5ae078){var _0x512d8d=_[_0xf8e3('0x34')](_0x5ae078,'id');var _0x186e42=[];var _0x417af2=[];var _0x29f5d0=squel[_0xf8e3('0x89')]();_0x29f5d0[_0xf8e3('0x8a')](_0xf8e3('0x8b'))['from']('team_has_voice_prefixes','tq')[_0xf8e3('0x8c')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xf8e3('0x44')](_0xf8e3('0x8d'),_0x4f02bb['params']['id']);for(var _0x1cff32=0x0;_0x1cff32<_0x5ae078[_0xf8e3('0x3f')];_0x1cff32+=0x1){let _0x876d0c=_0x5ae078[_0x1cff32];for(var _0x2c4060=0x0;_0x2c4060<_0x876d0c[_0xf8e3('0x83')][_0xf8e3('0x3f')];_0x2c4060+=0x1){let _0x1b8e99=_0x876d0c[_0xf8e3('0x83')][_0x2c4060];var _0x107896=_0x29f5d0[_0xf8e3('0x8e')]();_0x107896[_0xf8e3('0x44')](_0xf8e3('0x8f'),_0x1b8e99['id']);_0x417af2[_0xf8e3('0x67')](db[_0xf8e3('0x53')][_0xf8e3('0x38')](_0x107896['toString'](),{'type':db[_0xf8e3('0x53')][_0xf8e3('0x90')]['SELECT']})[_0xf8e3('0x2b')](function(_0x4e8329){if(_0x4e8329['length']===0x1){return _0x1b8e99['id'];}else{var _0x5a66ee=_[_0xf8e3('0x91')](_[_0xf8e3('0x34')](_0x4e8329,'TeamId'),function(_0x207393){return _[_0xf8e3('0x92')](_0x512d8d,_0x207393);});if(_0x5a66ee){return _0x1b8e99['id'];}}}));}}return BPromise[_0xf8e3('0x93')](_0x417af2)['then'](function(_0x3a39a8){_0x186e42=_(_0x186e42)[_0xf8e3('0x94')](_0x3a39a8)[_0xf8e3('0x95')]()['value']();return db[_0xf8e3('0x4a')][_0xf8e3('0x4f')]({'where':{'id':_0x4f02bb[_0xf8e3('0x50')]['id']}})['then'](function(_0x42d800){return db[_0xf8e3('0x53')][_0xf8e3('0x54')](function(_0x13782d){return _0x42d800[_0xf8e3('0x96')](_0x4f02bb[_0xf8e3('0x38')]['ids'],{'transaction':_0x13782d})[_0xf8e3('0x2b')](function(){if(!_[_0xf8e3('0x97')](_0x186e42)){return _0x42d800['removeAgents'](_0x186e42,{'transaction':_0x13782d});}})[_0xf8e3('0x2b')](function(){_0x186e42[_0xf8e3('0x87')](function(_0xcf534f){socket[_0xf8e3('0x78')]('userVoicePrefix:remove',{'UserId':_0xcf534f,'VoicePrefixId':_0x42d800['id']});});});});});});})[_0xf8e3('0x2b')](respondWithStatusCode(_0x237eb6,null))['catch'](handleError(_0x237eb6,null));}; \ No newline at end of file +var _0x1a37=['User','getTeams','Team','hasOwnProperty','addTeams','findAll','online','interface','Agents','each','upsert','findOrCreate','forEach','removeTeams','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','toString','QueryTypes','every','includes','all','union','compact','value','isEmpty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','get','VoicePrefixes','UserProfileResource','destroy','end','error','name','send','index','map','VoicePrefix','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','length','find','describe','create','transaction','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','exten','Voice\x20Prefix\x20Extension','priority','appdata','prefix','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','NoOp','${EXTEN:','charAt','sequelize','addAgents','omit','ids','spread','emit','userVoicePrefix:save','removeAgents','userVoicePrefix:remove','getAgents','findOne'];(function(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0x1a37,0xb4));var _0x71a3=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x1a37[_0x465a0c];return _0x1e202e;};'use strict';var emlformat=require(_0x71a3('0x0'));var rimraf=require(_0x71a3('0x1'));var zipdir=require(_0x71a3('0x2'));var jsonpatch=require(_0x71a3('0x3'));var rp=require(_0x71a3('0x4'));var moment=require(_0x71a3('0x5'));var BPromise=require(_0x71a3('0x6'));var Mustache=require(_0x71a3('0x7'));var util=require(_0x71a3('0x8'));var path=require(_0x71a3('0x9'));var sox=require('sox');var csv=require(_0x71a3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x71a3('0xb'));var _=require(_0x71a3('0xc'));var squel=require(_0x71a3('0xd'));var crypto=require(_0x71a3('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x71a3('0xf'));var Redis=require(_0x71a3('0x10'));var authService=require(_0x71a3('0x11'));var qs=require(_0x71a3('0x12'));var as=require(_0x71a3('0x13'));var hardwareService=require(_0x71a3('0x14'));var logger=require(_0x71a3('0x15'))(_0x71a3('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x71a3('0x17'))['db'];config[_0x71a3('0x18')]=_[_0x71a3('0x19')](config[_0x71a3('0x18')],{'host':_0x71a3('0x1a'),'port':0x18eb});var socket=require(_0x71a3('0x1b'))(new Redis(config[_0x71a3('0x18')]));require(_0x71a3('0x1c'))[_0x71a3('0x1d')](socket);function respondWithStatusCode(_0x203ee1,_0x21a34d){_0x21a34d=_0x21a34d||0xcc;return function(_0x5a40c3){if(_0x5a40c3){return _0x203ee1[_0x71a3('0x1e')](_0x21a34d);}return _0x203ee1[_0x71a3('0x1f')](_0x21a34d)['end']();};}function respondWithResult(_0x4aa918,_0x41fe1c){_0x41fe1c=_0x41fe1c||0xc8;return function(_0x3a1c81){if(_0x3a1c81){return _0x4aa918[_0x71a3('0x1f')](_0x41fe1c)[_0x71a3('0x20')](_0x3a1c81);}};}function respondWithFilteredResult(_0x1af1bc,_0x318ff6){return function(_0x5d4dee){if(_0x5d4dee){var _0x656cd2=typeof _0x318ff6[_0x71a3('0x21')]==='undefined'&&typeof _0x318ff6['limit']===_0x71a3('0x22');var _0x250db3=_0x5d4dee[_0x71a3('0x23')];var _0x1c4ec2=_0x656cd2?0x0:_0x318ff6[_0x71a3('0x21')];var _0x596328=_0x656cd2?_0x5d4dee[_0x71a3('0x23')]:_0x318ff6[_0x71a3('0x21')]+_0x318ff6[_0x71a3('0x24')];var _0x3ea036;if(_0x596328>=_0x250db3){_0x596328=_0x250db3;_0x3ea036=0xc8;}else{_0x3ea036=0xce;}_0x1af1bc[_0x71a3('0x1f')](_0x3ea036);return _0x1af1bc['set'](_0x71a3('0x25'),_0x1c4ec2+'-'+_0x596328+'/'+_0x250db3)['json'](_0x5d4dee);}return null;};}function patchUpdates(_0x3bf78e){return function(_0x35d1d4){try{jsonpatch[_0x71a3('0x26')](_0x35d1d4,_0x3bf78e,!![]);}catch(_0x21899d){return BPromise[_0x71a3('0x27')](_0x21899d);}return _0x35d1d4[_0x71a3('0x28')]();};}function saveUpdates(_0x5f33c5,_0x26e6e7){return function(_0x299d1d){if(_0x299d1d){return _0x299d1d[_0x71a3('0x29')](_0x5f33c5)[_0x71a3('0x2a')](function(_0xb0f3aa){return _0xb0f3aa;});}return null;};}function removeEntity(_0x4fd214,_0x107fbd){return function(_0x2b414d){if(_0x2b414d){return _0x2b414d['destroy']()[_0x71a3('0x2a')](function(){var _0x515519=_0x2b414d[_0x71a3('0x2b')]({'plain':!![]});var _0x2fd3b6=_0x71a3('0x2c');return db[_0x71a3('0x2d')][_0x71a3('0x2e')]({'where':{'type':_0x2fd3b6,'resourceId':_0x515519['id']}})[_0x71a3('0x2a')](function(){return _0x2b414d;});})[_0x71a3('0x2a')](function(){_0x4fd214[_0x71a3('0x1f')](0xcc)[_0x71a3('0x2f')]();});}};}function handleEntityNotFound(_0x3fc578,_0x3ea7aa){return function(_0x228afa){if(!_0x228afa){_0x3fc578['sendStatus'](0x194);}return _0x228afa;};}function handleError(_0x26fd9f,_0x1719e6){_0x1719e6=_0x1719e6||0x1f4;return function(_0x334db0){logger[_0x71a3('0x30')](_0x334db0['stack']);if(_0x334db0[_0x71a3('0x31')]){delete _0x334db0[_0x71a3('0x31')];}_0x26fd9f[_0x71a3('0x1f')](_0x1719e6)[_0x71a3('0x32')](_0x334db0);};}exports[_0x71a3('0x33')]=function(_0xa82e46,_0x1d09bd){var _0x5af615={},_0x2ccd54={},_0x3c16ef={'count':0x0,'rows':[]};var _0x3aaf63=_[_0x71a3('0x34')](db[_0x71a3('0x35')][_0x71a3('0x36')],function(_0x425d83){return{'name':_0x425d83[_0x71a3('0x37')],'type':_0x425d83[_0x71a3('0x38')][_0x71a3('0x39')]};});_0x2ccd54[_0x71a3('0x3a')]=_[_0x71a3('0x34')](_0x3aaf63,_0x71a3('0x31'));_0x2ccd54['query']=_['keys'](_0xa82e46[_0x71a3('0x3b')]);_0x2ccd54[_0x71a3('0x3c')]=_['intersection'](_0x2ccd54[_0x71a3('0x3a')],_0x2ccd54[_0x71a3('0x3b')]);_0x5af615['attributes']=_[_0x71a3('0x3d')](_0x2ccd54[_0x71a3('0x3a')],qs[_0x71a3('0x3e')](_0xa82e46[_0x71a3('0x3b')][_0x71a3('0x3e')]));_0x5af615[_0x71a3('0x3f')]=_0x5af615[_0x71a3('0x3f')]['length']?_0x5af615[_0x71a3('0x3f')]:_0x2ccd54[_0x71a3('0x3a')];if(!_0xa82e46[_0x71a3('0x3b')]['hasOwnProperty'](_0x71a3('0x40'))){_0x5af615[_0x71a3('0x24')]=qs[_0x71a3('0x24')](_0xa82e46[_0x71a3('0x3b')][_0x71a3('0x24')]);_0x5af615['offset']=qs['offset'](_0xa82e46[_0x71a3('0x3b')][_0x71a3('0x21')]);}_0x5af615[_0x71a3('0x41')]=qs[_0x71a3('0x42')](_0xa82e46[_0x71a3('0x3b')]['sort']);_0x5af615[_0x71a3('0x43')]=qs[_0x71a3('0x3c')](_[_0x71a3('0x44')](_0xa82e46['query'],_0x2ccd54[_0x71a3('0x3c')]),_0x3aaf63);if(_0xa82e46['query'][_0x71a3('0x45')]){_0x5af615[_0x71a3('0x43')]=_[_0x71a3('0x46')](_0x5af615[_0x71a3('0x43')],{'$or':_[_0x71a3('0x34')](_0x3aaf63,function(_0x38912c){if(_0x38912c[_0x71a3('0x38')]!==_0x71a3('0x47')){var _0x31ba66={};_0x31ba66[_0x38912c[_0x71a3('0x31')]]={'$like':'%'+_0xa82e46['query'][_0x71a3('0x45')]+'%'};return _0x31ba66;}})});}_0x5af615=_['merge']({},_0x5af615,_0xa82e46[_0x71a3('0x48')]);var _0x1ed84d={'where':_0x5af615[_0x71a3('0x43')]};return db[_0x71a3('0x35')]['count'](_0x1ed84d)[_0x71a3('0x2a')](function(_0x4b4fde){_0x3c16ef['count']=_0x4b4fde;if(_0xa82e46[_0x71a3('0x3b')][_0x71a3('0x49')]){_0x5af615[_0x71a3('0x4a')]=[{'all':!![]}];}return db[_0x71a3('0x35')]['findAll'](_0x5af615);})[_0x71a3('0x2a')](function(_0x615c6f){_0x3c16ef[_0x71a3('0x4b')]=_0x615c6f;return _0x3c16ef;})[_0x71a3('0x2a')](respondWithFilteredResult(_0x1d09bd,_0x5af615))[_0x71a3('0x4c')](handleError(_0x1d09bd,null));};exports[_0x71a3('0x4d')]=function(_0x371aa5,_0x262afe){var _0x3ba2c1={'raw':![],'where':{'id':_0x371aa5[_0x71a3('0x4e')]['id']}},_0x3a18c4={};_0x3a18c4[_0x71a3('0x3a')]=_[_0x71a3('0x4f')](db[_0x71a3('0x35')][_0x71a3('0x36')]);_0x3a18c4[_0x71a3('0x3b')]=_['keys'](_0x371aa5[_0x71a3('0x3b')]);_0x3a18c4[_0x71a3('0x3c')]=_['intersection'](_0x3a18c4[_0x71a3('0x3a')],_0x3a18c4[_0x71a3('0x3b')]);_0x3ba2c1[_0x71a3('0x3f')]=_[_0x71a3('0x3d')](_0x3a18c4[_0x71a3('0x3a')],qs['fields'](_0x371aa5['query'][_0x71a3('0x3e')]));_0x3ba2c1[_0x71a3('0x3f')]=_0x3ba2c1['attributes'][_0x71a3('0x50')]?_0x3ba2c1[_0x71a3('0x3f')]:_0x3a18c4[_0x71a3('0x3a')];if(_0x371aa5[_0x71a3('0x3b')][_0x71a3('0x49')]){_0x3ba2c1[_0x71a3('0x4a')]=[{'all':!![]}];}_0x3ba2c1=_['merge']({},_0x3ba2c1,_0x371aa5[_0x71a3('0x48')]);return db['VoicePrefix'][_0x71a3('0x51')](_0x3ba2c1)[_0x71a3('0x2a')](handleEntityNotFound(_0x262afe,null))[_0x71a3('0x2a')](respondWithResult(_0x262afe,null))[_0x71a3('0x4c')](handleError(_0x262afe,null));};exports[_0x71a3('0x2e')]=function(_0x48fcd7,_0x263706){return db[_0x71a3('0x35')][_0x71a3('0x51')]({'where':{'id':_0x48fcd7['params']['id']}})[_0x71a3('0x2a')](handleEntityNotFound(_0x263706,null))['then'](removeEntity(_0x263706,null))[_0x71a3('0x4c')](handleError(_0x263706,null));};exports[_0x71a3('0x52')]=function(_0x5c6450,_0x30cea2){return db[_0x71a3('0x35')][_0x71a3('0x52')]()[_0x71a3('0x2a')](respondWithResult(_0x30cea2,null))[_0x71a3('0x4c')](handleError(_0x30cea2,null));};exports[_0x71a3('0x53')]=function(_0x13a9ed,_0x479a8a){var _0x2d4a2e;return db['sequelize'][_0x71a3('0x54')](function(_0x480e90){return db[_0x71a3('0x35')][_0x71a3('0x53')](_0x13a9ed[_0x71a3('0x55')],{'transaction':_0x480e90})[_0x71a3('0x2a')](function(_0x599059){_0x2d4a2e=_0x599059['get']({'plain':!![]});return db[_0x71a3('0x56')][_0x71a3('0x51')]({'where':{'id':_0x2d4a2e[_0x71a3('0x57')]},'raw':!![]})[_0x71a3('0x2a')](function(_0x4d9181){return createVoicePrefixExtensions(_0x2d4a2e,_0x4d9181,_0x480e90);});});})['then'](function(){var _0x464a25=_0x13a9ed[_0x71a3('0x58')][_0x71a3('0x2b')]({'plain':!![]});if(!_0x464a25)throw new Error(_0x71a3('0x59'));if(_0x464a25[_0x71a3('0x5a')]==='user'){var _0x421b6a=_0x2d4a2e;return db[_0x71a3('0x5b')][_0x71a3('0x51')]({'where':{'name':_0x71a3('0x2c'),'userProfileId':_0x464a25[_0x71a3('0x5c')]},'raw':!![]})[_0x71a3('0x2a')](function(_0x2eb690){if(_0x2eb690&&_0x2eb690[_0x71a3('0x5d')]===0x0){return db['UserProfileResource'][_0x71a3('0x53')]({'name':_0x421b6a[_0x71a3('0x31')],'resourceId':_0x421b6a['id'],'type':_0x2eb690[_0x71a3('0x31')],'sectionId':_0x2eb690['id']},{})['then'](function(){return _0x2d4a2e;});}else{return _0x2d4a2e;}})[_0x71a3('0x4c')](function(_0x3dd655){logger[_0x71a3('0x30')](_0x71a3('0x5e'),_0x3dd655);throw _0x3dd655;});}return _0x2d4a2e;})[_0x71a3('0x2a')](respondWithResult(_0x479a8a,null))[_0x71a3('0x4c')](handleError(_0x479a8a,null));};function Extension(_0x453b78,_0x302dab,_0x3ebf59,_0x11b951){this['context']=_0x71a3('0x5f');this[_0x71a3('0x60')]=_0x453b78;this['app']=_0x3ebf59;this[_0x71a3('0x38')]='system';this['description']=_0x71a3('0x61');this[_0x71a3('0x62')]=_0x302dab;this[_0x71a3('0x63')]=_0x11b951;}function createVoicePrefixExtensions(_0x3ac98c,_0x3910e3,_0x5cffd2){return new BPromise(function(_0x121b2d,_0x2b88f8){var _0x52b5c3=new Extension(formatPrefixName(_0x3ac98c[_0x71a3('0x64')]),0x1,'NoOp',_0x71a3('0x65'));_0x52b5c3[_0x71a3('0x66')]=_0x3ac98c['id'];return db['VoiceExtension']['create'](_0x52b5c3,{'transaction':_0x5cffd2})[_0x71a3('0x2a')](function(_0x39f38b){var _0x4d703a=_0x39f38b[_0x71a3('0x2b')]({'plain':!![]});var _0x97ed1b=_[_0x71a3('0x34')](addVoicePrefixExtensions(_0x3ac98c,_0x3910e3),function(_0x516526){_0x516526[_0x71a3('0x57')]=_0x4d703a['id'];_0x516526[_0x71a3('0x66')]=_0x3ac98c['id'];return _0x516526;});return db[_0x71a3('0x56')][_0x71a3('0x67')](_0x97ed1b,{'transaction':_0x5cffd2})[_0x71a3('0x2a')](function(_0x85c7ed){if(!_0x85c7ed){return _0x2b88f8(_0x71a3('0x68'));}else{return _0x121b2d(_0x85c7ed);}})[_0x71a3('0x4c')](function(_0xe03bb5){return _0x2b88f8(_0xe03bb5);});});;});};function addVoicePrefixExtensions(_0x4b6b75,_0x4e5ab1){var _0x11a2d7=[];var _0x84b636=formatPrefixName(_0x4b6b75['prefix']);_0x11a2d7[_0x71a3('0x69')](new Extension(_0x84b636,0x2,_0x71a3('0x6a'),_0x71a3('0x6b')+_0x4b6b75[_0x71a3('0x31')]));if(_0x4b6b75[_0x71a3('0x6c')]){_0x11a2d7[_0x71a3('0x69')](new Extension(_0x84b636,0x3,_0x71a3('0x6a'),_0x71a3('0x6d')+_0x4b6b75[_0x71a3('0x6c')]));}else{_0x11a2d7['push'](new Extension(_0x84b636,0x3,_0x71a3('0x6e'),'No\x20callerid\x20available'));}_0x11a2d7[_0x71a3('0x69')](new Extension(_0x84b636,0x4,'goto',_0x4e5ab1['context']+','+_0x71a3('0x6f')+(0x8+_0x4b6b75['name'][_0x71a3('0x50')])+'}'+','+0x1));return _0x11a2d7;}function formatPrefixName(_0x271e37){var _0x239d18='_';for(var _0x4aa296=0x0;_0x4aa296<_0x271e37[_0x71a3('0x50')];_0x4aa296++){if(_0x271e37[_0x71a3('0x70')](_0x4aa296)=='-'){_0x239d18+=_0x271e37['charAt'](_0x4aa296);}else{_0x239d18+='['+_0x271e37[_0x71a3('0x70')](_0x4aa296)+']';}}_0x239d18+='.';return _0x239d18;}exports[_0x71a3('0x29')]=function(_0x44a6e3,_0x1450cc,_0x4430f2){var _0xd8a124=_0x44a6e3[_0x71a3('0x55')];_0xd8a124[_0x71a3('0x64')]='system-'+_0xd8a124['name']+'-';return db[_0x71a3('0x71')][_0x71a3('0x54')](function(_0x1b3c9b){return db['VoicePrefix'][_0x71a3('0x29')](_0xd8a124,{'where':{'id':_0xd8a124['id']},'transaction':_0x1b3c9b})[_0x71a3('0x2a')](function(){return db['VoiceExtension'][_0x71a3('0x2e')]({'where':{'VoicePrefixId':_0xd8a124['id']},'transaction':_0x1b3c9b})['then'](function(){return db[_0x71a3('0x56')][_0x71a3('0x51')]({'where':{'id':_0xd8a124[_0x71a3('0x57')]},'raw':!![]})[_0x71a3('0x2a')](function(_0x528c4b){return createVoicePrefixExtensions(_0xd8a124,_0x528c4b,_0x1b3c9b);});});});})[_0x71a3('0x2a')](function(){return db[_0x71a3('0x35')]['findById'](_0xd8a124['id']);})[_0x71a3('0x2a')](respondWithResult(_0x1450cc,null))[_0x71a3('0x4c')](handleError(_0x1450cc,null));};exports[_0x71a3('0x72')]=function(_0x693a55,_0x21e7a2,_0x22c62d){return db[_0x71a3('0x35')][_0x71a3('0x51')]({'where':{'id':_0x693a55[_0x71a3('0x4e')]['id']}})[_0x71a3('0x2a')](handleEntityNotFound(_0x21e7a2,null))[_0x71a3('0x2a')](function(_0x19e7d1){if(_0x19e7d1){return _0x19e7d1['addAgents'](_0x693a55[_0x71a3('0x55')]['ids'],_[_0x71a3('0x73')](_0x693a55[_0x71a3('0x55')],[_0x71a3('0x74'),'id'])||{})[_0x71a3('0x75')](function(_0x3031da){for(var _0x206636=0x0;_0x206636<_0x693a55[_0x71a3('0x55')][_0x71a3('0x74')][_0x71a3('0x50')];_0x206636+=0x1){socket[_0x71a3('0x76')](_0x71a3('0x77'),{'UserId':Number(_0x693a55[_0x71a3('0x55')][_0x71a3('0x74')][_0x206636]),'VoicePrefixId':Number(_0x693a55[_0x71a3('0x4e')]['id'])});}return _0x3031da;});}})[_0x71a3('0x2a')](respondWithResult(_0x21e7a2,null))[_0x71a3('0x4c')](handleError(_0x21e7a2,null));};exports[_0x71a3('0x78')]=function(_0x295ff4,_0x6c9bb6,_0x49c6d5){return db[_0x71a3('0x35')][_0x71a3('0x51')]({'where':{'id':_0x295ff4[_0x71a3('0x4e')]['id']}})[_0x71a3('0x2a')](handleEntityNotFound(_0x6c9bb6,null))[_0x71a3('0x2a')](function(_0x1483ea){if(_0x1483ea){return _0x1483ea[_0x71a3('0x78')](_0x295ff4['query'][_0x71a3('0x74')])['then'](function(){if(_['isArray'](_0x295ff4['query']['ids'])){for(var _0x579faf=0x0;_0x579faf<_0x295ff4['query'][_0x71a3('0x74')][_0x71a3('0x50')];_0x579faf+=0x1){socket[_0x71a3('0x76')](_0x71a3('0x79'),{'UserId':Number(_0x295ff4[_0x71a3('0x3b')][_0x71a3('0x74')][_0x579faf]),'VoicePrefixId':Number(_0x295ff4[_0x71a3('0x4e')]['id'])});}}else{socket[_0x71a3('0x76')](_0x71a3('0x79'),{'UserId':Number(_0x295ff4[_0x71a3('0x3b')][_0x71a3('0x74')]),'VoicePrefixId':Number(_0x295ff4[_0x71a3('0x4e')]['id'])});}});}})[_0x71a3('0x2a')](respondWithStatusCode(_0x6c9bb6,null))['catch'](handleError(_0x6c9bb6,null));};exports[_0x71a3('0x7a')]=function(_0x18e375,_0x27cad5,_0x3898fa){var _0x38f928={};var _0x4af495={};var _0x50bf5e;var _0x4f2bec;return db['VoicePrefix'][_0x71a3('0x7b')]({'where':{'id':_0x18e375[_0x71a3('0x4e')]['id']}})[_0x71a3('0x2a')](handleEntityNotFound(_0x27cad5,null))['then'](function(_0x157527){if(_0x157527){_0x50bf5e=_0x157527;_0x4af495[_0x71a3('0x3a')]=_[_0x71a3('0x4f')](db[_0x71a3('0x7c')][_0x71a3('0x36')]);_0x4af495[_0x71a3('0x3b')]=_[_0x71a3('0x4f')](_0x18e375[_0x71a3('0x3b')]);_0x4af495[_0x71a3('0x3c')]=_['intersection'](_0x4af495[_0x71a3('0x3a')],_0x4af495[_0x71a3('0x3b')]);_0x38f928['attributes']=_[_0x71a3('0x3d')](_0x4af495['model'],qs[_0x71a3('0x3e')](_0x18e375[_0x71a3('0x3b')][_0x71a3('0x3e')]));_0x38f928[_0x71a3('0x3f')]=_0x38f928[_0x71a3('0x3f')]['length']?_0x38f928[_0x71a3('0x3f')]:_0x4af495[_0x71a3('0x3a')];_0x38f928['order']=qs[_0x71a3('0x42')](_0x18e375[_0x71a3('0x3b')][_0x71a3('0x42')]);_0x38f928['where']=qs[_0x71a3('0x3c')](_[_0x71a3('0x44')](_0x18e375[_0x71a3('0x3b')],_0x4af495['filters']));if(_0x18e375['query'][_0x71a3('0x45')]){_0x38f928[_0x71a3('0x43')]=_[_0x71a3('0x46')](_0x38f928['where'],{'$or':_[_0x71a3('0x34')](_0x38f928['attributes'],function(_0x158136){var _0x405040={};_0x405040[_0x158136]={'$like':'%'+_0x18e375[_0x71a3('0x3b')]['filter']+'%'};return _0x405040;})});}_0x38f928=_[_0x71a3('0x46')]({},_0x38f928,_0x18e375['options']);return _0x50bf5e[_0x71a3('0x7a')](_0x38f928);}})[_0x71a3('0x2a')](function(_0x333ab6){if(_0x333ab6){_0x4f2bec=_0x333ab6[_0x71a3('0x50')];if(!_0x18e375[_0x71a3('0x3b')]['hasOwnProperty'](_0x71a3('0x40'))){_0x38f928[_0x71a3('0x24')]=qs['limit'](_0x18e375['query'][_0x71a3('0x24')]);_0x38f928[_0x71a3('0x21')]=qs[_0x71a3('0x21')](_0x18e375['query'][_0x71a3('0x21')]);}return _0x50bf5e[_0x71a3('0x7a')](_0x38f928);}})[_0x71a3('0x2a')](function(_0x2fab3e){if(_0x2fab3e){return _0x2fab3e?{'count':_0x4f2bec,'rows':_0x2fab3e}:null;}})[_0x71a3('0x2a')](respondWithResult(_0x27cad5,null))[_0x71a3('0x4c')](handleError(_0x27cad5,null));};exports[_0x71a3('0x7d')]=function(_0x4ca034,_0x1b3b05,_0xd87f34){var _0x3e8cce={};var _0x2fc088={};var _0x5776c8;var _0xdb80f1;return db[_0x71a3('0x35')][_0x71a3('0x7b')]({'where':{'id':_0x4ca034[_0x71a3('0x4e')]['id']}})[_0x71a3('0x2a')](handleEntityNotFound(_0x1b3b05,null))[_0x71a3('0x2a')](function(_0x12a46c){if(_0x12a46c){_0x5776c8=_0x12a46c;_0x2fc088[_0x71a3('0x3a')]=_['keys'](db[_0x71a3('0x7e')]['rawAttributes']);_0x2fc088[_0x71a3('0x3b')]=_[_0x71a3('0x4f')](_0x4ca034[_0x71a3('0x3b')]);_0x2fc088[_0x71a3('0x3c')]=_['intersection'](_0x2fc088['model'],_0x2fc088['query']);_0x3e8cce[_0x71a3('0x3f')]=_[_0x71a3('0x3d')](_0x2fc088[_0x71a3('0x3a')],qs[_0x71a3('0x3e')](_0x4ca034[_0x71a3('0x3b')][_0x71a3('0x3e')]));_0x3e8cce[_0x71a3('0x3f')]=_0x3e8cce[_0x71a3('0x3f')][_0x71a3('0x50')]?_0x3e8cce[_0x71a3('0x3f')]:_0x2fc088['model'];_0x3e8cce[_0x71a3('0x41')]=qs[_0x71a3('0x42')](_0x4ca034[_0x71a3('0x3b')][_0x71a3('0x42')]);_0x3e8cce[_0x71a3('0x43')]=qs[_0x71a3('0x3c')](_['pick'](_0x4ca034[_0x71a3('0x3b')],_0x2fc088['filters']));if(_0x4ca034[_0x71a3('0x3b')]['filter']){_0x3e8cce[_0x71a3('0x43')]=_[_0x71a3('0x46')](_0x3e8cce['where'],{'$or':_[_0x71a3('0x34')](_0x3e8cce['attributes'],function(_0x3d59f8){var _0x4aca5f={};_0x4aca5f[_0x3d59f8]={'$like':'%'+_0x4ca034[_0x71a3('0x3b')][_0x71a3('0x45')]+'%'};return _0x4aca5f;})});}_0x3e8cce=_['merge']({},_0x3e8cce,_0x4ca034[_0x71a3('0x48')]);return _0x5776c8[_0x71a3('0x7d')](_0x3e8cce);}})[_0x71a3('0x2a')](function(_0xf0bded){if(_0xf0bded){_0xdb80f1=_0xf0bded[_0x71a3('0x50')];if(!_0x4ca034[_0x71a3('0x3b')][_0x71a3('0x7f')](_0x71a3('0x40'))){_0x3e8cce['limit']=qs[_0x71a3('0x24')](_0x4ca034[_0x71a3('0x3b')][_0x71a3('0x24')]);_0x3e8cce['offset']=qs[_0x71a3('0x21')](_0x4ca034[_0x71a3('0x3b')][_0x71a3('0x21')]);}return _0x5776c8['getTeams'](_0x3e8cce);}})['then'](function(_0x2149ee){if(_0x2149ee){return _0x2149ee?{'count':_0xdb80f1,'rows':_0x2149ee}:null;}})[_0x71a3('0x2a')](respondWithResult(_0x1b3b05,null))['catch'](handleError(_0x1b3b05,null));};exports[_0x71a3('0x80')]=function(_0x844dba,_0x15d28b,_0x3137b9){var _0x902b73=_0x844dba[_0x71a3('0x55')][_0x71a3('0x74')];var _0x5709ba;return db[_0x71a3('0x7e')][_0x71a3('0x81')]({'where':{'id':_0x902b73},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x71a3('0x31'),_0x71a3('0x82'),'voicePause',_0x71a3('0x83')],'raw':!![]}]})[_0x71a3('0x2a')](function(_0x32f347){if(_0x32f347){_0x5709ba=_0x32f347;var _0x57b620=_['flatMap'](_0x32f347,function(_0x41d926){var _0x1f7ecd=_0x41d926[_0x71a3('0x2b')]({'plain':!![]});return _0x1f7ecd[_0x71a3('0x84')];});return db[_0x71a3('0x35')][_0x71a3('0x51')]({'where':{'id':_0x844dba[_0x71a3('0x4e')]['id']}})[_0x71a3('0x2a')](function(_0x17636b){return db['sequelize'][_0x71a3('0x54')](function(_0x5c63d0){return _0x17636b[_0x71a3('0x80')](_0x902b73,{'transaction':_0x5c63d0})[_0x71a3('0x2a')](function(){return BPromise[_0x71a3('0x85')](_0x5709ba,function(_0x474438){return db['TeamVoicePrefix'][_0x71a3('0x86')]({'TeamId':_0x474438['id'],'VoicePrefixId':_0x844dba[_0x71a3('0x4e')]['id']},{'transaction':_0x5c63d0});});})[_0x71a3('0x2a')](function(){return BPromise[_0x71a3('0x85')](_0x57b620,function(_0x26635c){return db['UserVoicePrefix'][_0x71a3('0x87')]({'where':{'UserId':_0x26635c['id'],'VoicePrefixId':_0x844dba[_0x71a3('0x4e')]['id']},'transaction':_0x5c63d0});});})['then'](function(){_0x57b620[_0x71a3('0x88')](function(_0x4cde32){socket[_0x71a3('0x76')](_0x71a3('0x77'),{'UserId':_0x4cde32['id'],'VoicePrefixId':_0x17636b['id']});});});});});}})[_0x71a3('0x2a')](respondWithStatusCode(_0x15d28b,null))[_0x71a3('0x4c')](handleError(_0x15d28b,null));};exports[_0x71a3('0x89')]=function(_0x5d880f,_0x3b8781,_0x5b6dac){return db[_0x71a3('0x7e')][_0x71a3('0x81')]({'where':{'id':_0x5d880f[_0x71a3('0x3b')][_0x71a3('0x74')]},'attributes':['id'],'include':[{'model':db[_0x71a3('0x7c')],'as':_0x71a3('0x84'),'attributes':['id'],'raw':!![]}]})[_0x71a3('0x2a')](handleEntityNotFound(_0x3b8781,null))[_0x71a3('0x2a')](function(_0x408b2a){var _0x2f7b7c=_[_0x71a3('0x34')](_0x408b2a,'id');var _0x2bd265=[];var _0x3d1710=[];var _0x17951c=squel['select']();_0x17951c['field']('tq.TeamId')[_0x71a3('0x8a')]('team_has_voice_prefixes','tq')[_0x71a3('0x8b')](_0x71a3('0x8c'),'ut',_0x71a3('0x8d'))[_0x71a3('0x43')]('VoicePrefixId\x20=\x20?',_0x5d880f[_0x71a3('0x4e')]['id']);for(var _0x44ac81=0x0;_0x44ac81<_0x408b2a[_0x71a3('0x50')];_0x44ac81+=0x1){let _0x3de32c=_0x408b2a[_0x44ac81];for(var _0x29e932=0x0;_0x29e932<_0x3de32c[_0x71a3('0x84')][_0x71a3('0x50')];_0x29e932+=0x1){let _0x15e9f7=_0x3de32c[_0x71a3('0x84')][_0x29e932];var _0x554aa2=_0x17951c[_0x71a3('0x8e')]();_0x554aa2['where']('ut.UserId\x20=\x20?',_0x15e9f7['id']);_0x3d1710[_0x71a3('0x69')](db[_0x71a3('0x71')][_0x71a3('0x3b')](_0x554aa2[_0x71a3('0x8f')](),{'type':db[_0x71a3('0x71')][_0x71a3('0x90')]['SELECT']})[_0x71a3('0x2a')](function(_0x1fca5c){if(_0x1fca5c[_0x71a3('0x50')]===0x1){return _0x15e9f7['id'];}else{var _0x47167a=_[_0x71a3('0x91')](_[_0x71a3('0x34')](_0x1fca5c,'TeamId'),function(_0x4b62e8){return _[_0x71a3('0x92')](_0x2f7b7c,_0x4b62e8);});if(_0x47167a){return _0x15e9f7['id'];}}}));}}return BPromise[_0x71a3('0x93')](_0x3d1710)[_0x71a3('0x2a')](function(_0x52f2f1){_0x2bd265=_(_0x2bd265)[_0x71a3('0x94')](_0x52f2f1)[_0x71a3('0x95')]()[_0x71a3('0x96')]();return db['VoicePrefix']['find']({'where':{'id':_0x5d880f[_0x71a3('0x4e')]['id']}})[_0x71a3('0x2a')](function(_0x4aef3e){return db[_0x71a3('0x71')][_0x71a3('0x54')](function(_0x292568){return _0x4aef3e[_0x71a3('0x89')](_0x5d880f['query'][_0x71a3('0x74')],{'transaction':_0x292568})[_0x71a3('0x2a')](function(){if(!_[_0x71a3('0x97')](_0x2bd265)){return _0x4aef3e[_0x71a3('0x78')](_0x2bd265,{'transaction':_0x292568});}})[_0x71a3('0x2a')](function(){_0x2bd265[_0x71a3('0x88')](function(_0x3a66f8){socket[_0x71a3('0x76')](_0x71a3('0x79'),{'UserId':_0x3a66f8,'VoicePrefixId':_0x4aef3e['id']});});});});});});})[_0x71a3('0x2a')](respondWithStatusCode(_0x3b8781,null))[_0x71a3('0x4c')](handleError(_0x3b8781,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 224079a..c72b803 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 _0xea8f=['setMaxListeners','save','emit','exports','VoicePrefix'];(function(_0x523e56,_0x346270){var _0x32a8ed=function(_0x206900){while(--_0x206900){_0x523e56['push'](_0x523e56['shift']());}};_0x32a8ed(++_0x346270);}(_0xea8f,0x1bc));var _0xfea8=function(_0x15c8be,_0x4e2bf7){_0x15c8be=_0x15c8be-0x0;var _0x44b051=_0xea8f[_0x15c8be];return _0x44b051;};'use strict';var EventEmitter=require('events');var VoicePrefix=require('../../mysqldb')['db'][_0xfea8('0x0')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xfea8('0x1')](0x0);var events={'afterCreate':_0xfea8('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x369b23){return function(_0x56801a,_0x487f97,_0x5c3a21){VoicePrefixEvents['emit'](_0x369b23+':'+_0x56801a['id'],_0x56801a);VoicePrefixEvents[_0xfea8('0x3')](_0x369b23,_0x56801a);_0x5c3a21(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0xfea8('0x4')]=VoicePrefixEvents; \ No newline at end of file +var _0xc97a=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoicePrefix','setMaxListeners'];(function(_0x242b1d,_0xe6b10c){var _0x5193f6=function(_0x45f24c){while(--_0x45f24c){_0x242b1d['push'](_0x242b1d['shift']());}};_0x5193f6(++_0xe6b10c);}(_0xc97a,0x125));var _0xac97=function(_0x23a039,_0x5de798){_0x23a039=_0x23a039-0x0;var _0x5c0531=_0xc97a[_0x23a039];return _0x5c0531;};'use strict';var EventEmitter=require(_0xac97('0x0'));var VoicePrefix=require(_0xac97('0x1'))['db'][_0xac97('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xac97('0x3')](0x0);var events={'afterCreate':_0xac97('0x4'),'afterUpdate':_0xac97('0x5'),'afterDestroy':_0xac97('0x6')};function emitEvent(_0x522bb4){return function(_0x5493cb,_0x1cf0fa,_0x2c5961){VoicePrefixEvents['emit'](_0x522bb4+':'+_0x5493cb['id'],_0x5493cb);VoicePrefixEvents[_0xac97('0x7')](_0x522bb4,_0x5493cb);_0x2c5961(null);};}for(var e in events){if(events[_0xac97('0x8')](e)){var event=events[e];VoicePrefix[_0xac97('0x9')](e,emitEvent(event));}}module[_0xac97('0xa')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 6b02236..85bde67 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 _0x044a=['define','VoicePrefix','voice_prefixes','lodash','util','moment','path','rimraf','../../config/environment'];(function(_0x344e99,_0x530098){var _0x172d28=function(_0x1e68f4){while(--_0x1e68f4){_0x344e99['push'](_0x344e99['shift']());}};_0x172d28(++_0x530098);}(_0x044a,0x1aa));var _0xa044=function(_0x57e0c0,_0x50805f){_0x57e0c0=_0x57e0c0-0x0;var _0x5e8883=_0x044a[_0x57e0c0];return _0x5e8883;};'use strict';var _=require(_0xa044('0x0'));var util=require(_0xa044('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xa044('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa044('0x3'));var rimraf=require(_0xa044('0x4'));var config=require(_0xa044('0x5'));var attributes=require('./voicePrefix.attributes');module['exports']=function(_0x5f58eb,_0x2f03de){return _0x5f58eb[_0xa044('0x6')](_0xa044('0x7'),attributes,{'tableName':_0xa044('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xde52=['voice_prefixes','lodash','../../config/logger','api','bluebird','rimraf','../../config/environment','./voicePrefix.attributes','exports','define'];(function(_0x737a1f,_0x235fef){var _0x16eba1=function(_0x292aa8){while(--_0x292aa8){_0x737a1f['push'](_0x737a1f['shift']());}};_0x16eba1(++_0x235fef);}(_0xde52,0x1a5));var _0x2de5=function(_0x3bc61f,_0x137218){_0x3bc61f=_0x3bc61f-0x0;var _0x4e52b4=_0xde52[_0x3bc61f];return _0x4e52b4;};'use strict';var _=require(_0x2de5('0x0'));var util=require('util');var logger=require(_0x2de5('0x1'))(_0x2de5('0x2'));var moment=require('moment');var BPromise=require(_0x2de5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2de5('0x4'));var config=require(_0x2de5('0x5'));var attributes=require(_0x2de5('0x6'));module[_0x2de5('0x7')]=function(_0xb4363f,_0x1c201b){return _0xb4363f[_0x2de5('0x8')]('VoicePrefix',attributes,{'tableName':_0x2de5('0x9'),'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 502e262..23e794e 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 _0xe5e3=['code','message','catch','util','moment','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','defaults','localhost','socket.io-emitter','redis','./voicePrefix.socket','register','request','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe5e3,0x17a));var _0x3e5e=function(_0x1ea058,_0x53e78e){_0x1ea058=_0x1ea058-0x0;var _0x1f775e=_0xe5e3[_0x1ea058];return _0x1f775e;};'use strict';var _=require('lodash');var util=require(_0x3e5e('0x0'));var moment=require(_0x3e5e('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3e5e('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x3e5e('0x3'));var logger=require(_0x3e5e('0x4'))('rpc');var config=require(_0x3e5e('0x5'));var jayson=require(_0x3e5e('0x6'));var client=jayson['client'][_0x3e5e('0x7')]({'port':0x232a});config['redis']=_[_0x3e5e('0x8')](config['redis'],{'host':_0x3e5e('0x9'),'port':0x18eb});var socket=require(_0x3e5e('0xa'))(new Redis(config[_0x3e5e('0xb')]));require(_0x3e5e('0xc'))[_0x3e5e('0xd')](socket);function respondWithRpcPromise(_0x2921fc,_0x16f64b,_0x270567){return new BPromise(function(_0x19b93c,_0x135011){return client[_0x3e5e('0xe')](_0x2921fc,_0x270567)['then'](function(_0x83263a){logger[_0x3e5e('0xf')](_0x3e5e('0x10'),_0x16f64b,_0x3e5e('0x11'));logger[_0x3e5e('0x12')](_0x3e5e('0x13'),_0x16f64b,_0x3e5e('0x11'),JSON[_0x3e5e('0x14')](_0x83263a));if(_0x83263a[_0x3e5e('0x15')]){if(_0x83263a[_0x3e5e('0x15')][_0x3e5e('0x16')]===0x1f4){logger[_0x3e5e('0x15')](_0x3e5e('0x10'),_0x16f64b,_0x83263a[_0x3e5e('0x15')]['message']);return _0x135011(_0x83263a[_0x3e5e('0x15')][_0x3e5e('0x17')]);}logger['error']('VoicePrefix,\x20%s,\x20%s',_0x16f64b,_0x83263a[_0x3e5e('0x15')][_0x3e5e('0x17')]);return _0x19b93c(_0x83263a[_0x3e5e('0x15')][_0x3e5e('0x17')]);}else{logger[_0x3e5e('0xf')](_0x3e5e('0x10'),_0x16f64b,_0x3e5e('0x11'));_0x19b93c(_0x83263a['result'][_0x3e5e('0x17')]);}})[_0x3e5e('0x18')](function(_0x295e8c){logger[_0x3e5e('0x15')](_0x3e5e('0x10'),_0x16f64b,_0x295e8c);_0x135011(_0x295e8c);});});} \ No newline at end of file +var _0x964b=['result','lodash','util','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','request','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x1f93d0,_0x431b88){var _0x21348a=function(_0x137621){while(--_0x137621){_0x1f93d0['push'](_0x1f93d0['shift']());}};_0x21348a(++_0x431b88);}(_0x964b,0x112));var _0xb964=function(_0x419592,_0x1178b7){_0x419592=_0x419592-0x0;var _0x53801e=_0x964b[_0x419592];return _0x53801e;};'use strict';var _=require(_0xb964('0x0'));var util=require(_0xb964('0x1'));var moment=require('moment');var BPromise=require(_0xb964('0x2'));var rs=require(_0xb964('0x3'));var fs=require('fs');var Redis=require(_0xb964('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb964('0x5'))('rpc');var config=require(_0xb964('0x6'));var jayson=require(_0xb964('0x7'));var client=jayson[_0xb964('0x8')][_0xb964('0x9')]({'port':0x232a});config[_0xb964('0xa')]=_[_0xb964('0xb')](config[_0xb964('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb964('0xa')]));require('./voicePrefix.socket')['register'](socket);function respondWithRpcPromise(_0x295392,_0x4df011,_0x4433a5){return new BPromise(function(_0x38247c,_0x38bae5){return client[_0xb964('0xc')](_0x295392,_0x4433a5)['then'](function(_0x442595){logger[_0xb964('0xd')](_0xb964('0xe'),_0x4df011,_0xb964('0xf'));logger['debug'](_0xb964('0x10'),_0x4df011,'request\x20sent',JSON['stringify'](_0x442595));if(_0x442595[_0xb964('0x11')]){if(_0x442595[_0xb964('0x11')][_0xb964('0x12')]===0x1f4){logger[_0xb964('0x11')](_0xb964('0xe'),_0x4df011,_0x442595[_0xb964('0x11')][_0xb964('0x13')]);return _0x38bae5(_0x442595['error'][_0xb964('0x13')]);}logger['error']('VoicePrefix,\x20%s,\x20%s',_0x4df011,_0x442595[_0xb964('0x11')][_0xb964('0x13')]);return _0x38247c(_0x442595[_0xb964('0x11')][_0xb964('0x13')]);}else{logger[_0xb964('0xd')](_0xb964('0xe'),_0x4df011,_0xb964('0xf'));_0x38247c(_0x442595[_0xb964('0x14')][_0xb964('0x13')]);}})['catch'](function(_0x54da04){logger['error'](_0xb964('0xe'),_0x4df011,_0x54da04);_0x38bae5(_0x54da04);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index c7e4265..f6407d0 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 _0x0b40=['voicePrefix:','save','remove','emit','register'];(function(_0x5a401e,_0x2de782){var _0x2aa2cc=function(_0x1150e7){while(--_0x1150e7){_0x5a401e['push'](_0x5a401e['shift']());}};_0x2aa2cc(++_0x2de782);}(_0x0b40,0xba));var _0x00b4=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x0b40[_0x255d5b];return _0x3e141a;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0x00b4('0x0'),_0x00b4('0x1'),'update'];function createListener(_0x2a5a0f,_0x309480){return function(_0xa2cb7f){_0x309480[_0x00b4('0x2')](_0x2a5a0f,_0xa2cb7f);};}function removeListener(_0x350fba,_0x40d4f4){return function(){VoicePrefixEvents['removeListener'](_0x350fba,_0x40d4f4);};}exports[_0x00b4('0x3')]=function(_0xbcf545){for(var _0x2c44d1=0x0,_0x120157=events['length'];_0x2c44d1<_0x120157;_0x2c44d1++){var _0x445536=events[_0x2c44d1];var _0x20c810=createListener(_0x00b4('0x4')+_0x445536,_0xbcf545);VoicePrefixEvents['on'](_0x445536,_0x20c810);}}; \ No newline at end of file +var _0xe5b5=['length','voicePrefix:','./voicePrefix.events','save','remove','update','emit','removeListener','register'];(function(_0x239b31,_0x44a64d){var _0x41c8be=function(_0x27f031){while(--_0x27f031){_0x239b31['push'](_0x239b31['shift']());}};_0x41c8be(++_0x44a64d);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x4d7f3f,_0x4d2803){_0x4d7f3f=_0x4d7f3f-0x0;var _0x5d67cc=_0xe5b5[_0x4d7f3f];return _0x5d67cc;};'use strict';var VoicePrefixEvents=require(_0x5e5b('0x0'));var events=[_0x5e5b('0x1'),_0x5e5b('0x2'),_0x5e5b('0x3')];function createListener(_0x208070,_0x4263e){return function(_0x33e813){_0x4263e[_0x5e5b('0x4')](_0x208070,_0x33e813);};}function removeListener(_0xf20c6a,_0x20a50c){return function(){VoicePrefixEvents[_0x5e5b('0x5')](_0xf20c6a,_0x20a50c);};}exports[_0x5e5b('0x6')]=function(_0xf1fbe2){for(var _0x11e0e0=0x0,_0x545eb3=events[_0x5e5b('0x7')];_0x11e0e0<_0x545eb3;_0x11e0e0++){var _0xe089b1=events[_0x11e0e0];var _0xcbd478=createListener(_0x5e5b('0x8')+_0xe089b1,_0xf1fbe2);VoicePrefixEvents['on'](_0xe089b1,_0xcbd478);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index a1d1506..9e651a3 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 _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x56a061,_0x53fb1b){var _0x105fa0=function(_0x164d08){while(--_0x164d08){_0x56a061['push'](_0x56a061['shift']());}};_0x105fa0(++_0x53fb1b);}(_0xb10b,0x12a));var _0xbb10=function(_0x37d7f5,_0x478e72){_0x37d7f5=_0x37d7f5-0x0;var _0x582bc7=_0xb10b[_0x37d7f5];return _0x582bc7;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router; \ No newline at end of file +var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x47804a,_0x40a083){var _0x32ba13=function(_0xcf35df){while(--_0xcf35df){_0x47804a['push'](_0x47804a['shift']());}};_0x32ba13(++_0x40a083);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 8ad90ac..82a165d 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 _0xcbcf=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','name','outbound','inbound','STRING','default','ENUM','leastrecent','fewestcalls','rrmemory','wrandom','rrordered','ringall','setDataValue','getDataValue','booked','progressive','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x207e4c,_0x519785){var _0x57b514=function(_0x3782fc){while(--_0x3782fc){_0x207e4c['push'](_0x207e4c['shift']());}};_0x57b514(++_0x519785);}(_0xcbcf,0xae));var _0xfcbc=function(_0x33122b,_0x49a658){_0x33122b=_0x33122b-0x0;var _0x3535e1=_0xcbcf[_0x33122b];return _0x3535e1;};'use strict';var Sequelize=require(_0xfcbc('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xfcbc('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('inbound',_0xfcbc('0x2')),'allowNull':![],'defaultValue':_0xfcbc('0x3')},'musiconhold':{'type':Sequelize[_0xfcbc('0x4')],'defaultValue':_0xfcbc('0x5')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0xfcbc('0x6')]('rr','ringall',_0xfcbc('0x7'),_0xfcbc('0x8'),'random',_0xfcbc('0x9'),'linear',_0xfcbc('0xa'),_0xfcbc('0xb')),'allowNull':![],'defaultValue':_0xfcbc('0xc'),'set':function(_0x20a269){this[_0xfcbc('0xd')]('strategy',_0x20a269?_0x20a269:_0xfcbc('0x9'));},'get':function(){var _0xf73066=this[_0xfcbc('0xe')]('type');var _0x28cfa7=this['getDataValue']('dialMethod');var _0x121a27=this[_0xfcbc('0xe')]('strategy');if(_0xf73066==='inbound'){return _0x121a27;}if(_0x28cfa7==='booked'&&_0x121a27===_0xfcbc('0x9')||_0x28cfa7===_0xfcbc('0xf')&&_0x121a27==='roundrobin'){return _0x121a27;}if(_0x28cfa7===_0xfcbc('0x10')||_0x28cfa7===_0xfcbc('0x11')||_0x28cfa7===_0xfcbc('0x12')){return _0x121a27;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xfcbc('0x4')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0xfcbc('0x13')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xfcbc('0x13')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xfcbc('0x4')]},'weight':{'type':Sequelize[_0xfcbc('0x13')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xfcbc('0x13')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xfcbc('0x6')](_0xfcbc('0x14'),'no'),'defaultValue':_0xfcbc('0x14')},'autopause':{'type':Sequelize[_0xfcbc('0x6')](_0xfcbc('0x14'),'no',_0xfcbc('0x15')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xfcbc('0x13')](0xb)},'autopausebusy':{'type':Sequelize[_0xfcbc('0x6')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xfcbc('0x6')](_0xfcbc('0x14'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xfcbc('0x13')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0xfcbc('0x14'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xfcbc('0x6')](_0xfcbc('0x14'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xfcbc('0x6')](_0xfcbc('0x14'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xfcbc('0x6')](_0xfcbc('0x14'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xfcbc('0x4')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xfcbc('0x4')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xfcbc('0x13')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xfcbc('0x13')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xfcbc('0x6')](_0xfcbc('0x14'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0xfcbc('0x14'),'no'),'defaultValue':_0xfcbc('0x14')},'announce_holdtime':{'type':Sequelize[_0xfcbc('0x6')]('yes','no',_0xfcbc('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xfcbc('0x6')]('yes','no')},'announce_position_limit':{'type':Sequelize[_0xfcbc('0x13')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xfcbc('0x6')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xfcbc('0x4')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xfcbc('0x4')]},'queue_youarenext':{'type':Sequelize[_0xfcbc('0x4')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xfcbc('0x4')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xfcbc('0x4')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xfcbc('0x4')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xfcbc('0x4')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xfcbc('0x4')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xfcbc('0x4')]},'queue_quantity1':{'type':Sequelize[_0xfcbc('0x4')]},'queue_quantity2':{'type':Sequelize[_0xfcbc('0x4')]},'queue_periodic_announce':{'type':Sequelize[_0xfcbc('0x4')]},'queue_less_than':{'type':Sequelize[_0xfcbc('0x4')]},'periodic_announce':{'type':Sequelize[_0xfcbc('0x17')],'set':function(_0x13bf99){this[_0xfcbc('0xd')](_0xfcbc('0x18'),_0x13bf99?_0x13bf99[_0xfcbc('0x19')](','):[]);},'get':function(){return this[_0xfcbc('0xe')](_0xfcbc('0x18'))?this['getDataValue']('periodic_announce')[_0xfcbc('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0xfcbc('0x4')],'defaultValue':_0xfcbc('0x14'),'set':function(_0x48d01b){this['setDataValue'](_0xfcbc('0x1b'),_0x48d01b?_0x48d01b[_0xfcbc('0x19')](','):undefined);},'get':function(){return this['getDataValue'](_0xfcbc('0x1b'))?this[_0xfcbc('0xe')]('joinempty')[_0xfcbc('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x499e17){this[_0xfcbc('0xd')](_0xfcbc('0x1c'),_0x499e17?_0x499e17[_0xfcbc('0x19')](','):undefined);},'get':function(){return this[_0xfcbc('0xe')](_0xfcbc('0x1c'))?this[_0xfcbc('0xe')](_0xfcbc('0x1c'))[_0xfcbc('0x1a')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xfcbc('0x6')](_0xfcbc('0x14'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xfcbc('0x6')](_0xfcbc('0x14'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xfcbc('0x13')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xfcbc('0x4')]},'acw':{'type':Sequelize[_0xfcbc('0x1d')],'defaultValue':0x0,'set':function(_0x41f462){this['setDataValue'](_0xfcbc('0x1e'),_0x41f462);if(_0x41f462){if(this[_0xfcbc('0xe')]('wrapuptime')<0x2){this[_0xfcbc('0xd')](_0xfcbc('0x1f'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xfcbc('0x1d')],'defaultValue':0x0,'comment':_0xfcbc('0x20')},'dialMethod':{'type':Sequelize[_0xfcbc('0x6')](_0xfcbc('0x21'),_0xfcbc('0x10'),_0xfcbc('0x12'),_0xfcbc('0x11'),'booked'),'defaultValue':_0xfcbc('0x10'),'comment':_0xfcbc('0x22')},'dialLimitChannel':{'type':Sequelize[_0xfcbc('0x13')](0x4)[_0xfcbc('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xfcbc('0x24')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xfcbc('0x25')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xfcbc('0x26')},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0xfcbc('0x27'),_0xfcbc('0x28')),'defaultValue':_0xfcbc('0x28'),'comment':_0xfcbc('0x29')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xfcbc('0x2a')](0x2)[_0xfcbc('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xfcbc('0x2b')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0xfcbc('0x23')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xfcbc('0x2c')},'dialOriginateCallerIdName':{'type':Sequelize[_0xfcbc('0x4')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xfcbc('0x13')](0x3)[_0xfcbc('0x23')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfcbc('0x2d')},'dialQueueOptions':{'type':Sequelize[_0xfcbc('0x4')],'defaultValue':_0xfcbc('0x2e'),'comment':_0xfcbc('0x2f')},'dialQueueTimeout':{'type':Sequelize[_0xfcbc('0x13')](0x3)[_0xfcbc('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfcbc('0x30')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0xfcbc('0x31')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xfcbc('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xfcbc('0x13')](0x5)[_0xfcbc('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfcbc('0x32')},'dialBusyMaxRetry':{'type':Sequelize[_0xfcbc('0x13')](0x3)[_0xfcbc('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfcbc('0x33')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfcbc('0x34')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xfcbc('0x13')](0x3)[_0xfcbc('0x23')],'defaultValue':0x3,'comment':_0xfcbc('0x35')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xfcbc('0x13')](0x5)[_0xfcbc('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfcbc('0x36')},'dialGlobalMaxRetry':{'type':Sequelize[_0xfcbc('0x13')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xfcbc('0x37')},'dialTimezone':{'type':Sequelize[_0xfcbc('0x4')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xfcbc('0x4')],'defaultValue':_0xfcbc('0x38')},'dialPrefix':{'type':Sequelize[_0xfcbc('0x4')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xfcbc('0x6')](_0xfcbc('0x39'),_0xfcbc('0x3a'),_0xfcbc('0x3b')),'defaultValue':_0xfcbc('0x39')},'dialAMDActive':{'type':Sequelize[_0xfcbc('0x1d')],'defaultValue':0x0,'comment':_0xfcbc('0x3c')},'dialAMDInitialSilence':{'type':Sequelize[_0xfcbc('0x13')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xfcbc('0x3d')},'dialAMDGreeting':{'type':Sequelize[_0xfcbc('0x13')](0x9)[_0xfcbc('0x23')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xfcbc('0x3e')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xfcbc('0x13')](0x9)[_0xfcbc('0x23')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xfcbc('0x3f')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xfcbc('0x13')](0x9)[_0xfcbc('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xfcbc('0x13')](0x9)[_0xfcbc('0x23')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xfcbc('0x40')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xfcbc('0x13')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xfcbc('0x41')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xfcbc('0x13')](0x9)[_0xfcbc('0x23')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xfcbc('0x42')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xfcbc('0x13')](0x5)[_0xfcbc('0x23')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xfcbc('0x43')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xfcbc('0x13')](0x9)[_0xfcbc('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xfcbc('0x44')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0xfcbc('0x23')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xfcbc('0x45')},'dialRecallInQueue':{'type':Sequelize[_0xfcbc('0x1d')],'defaultValue':0x0,'comment':_0xfcbc('0x46')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xfcbc('0x47'),_0xfcbc('0x48')),'defaultValue':_0xfcbc('0x47')},'dialQueueProject2':{'type':Sequelize[_0xfcbc('0x4')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0xfcbc('0x1d')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xfcbc('0x1d')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xfcbc('0x13')](0x3)[_0xfcbc('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xfcbc('0x49')},'dialCutDigit':{'type':Sequelize[_0xfcbc('0x13')](0x3)[_0xfcbc('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xfcbc('0x4a')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xfcbc('0x13')](0x3)[_0xfcbc('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfcbc('0x4b')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xfcbc('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfcbc('0x4c')},'dialDropMaxRetry':{'type':Sequelize[_0xfcbc('0x13')](0x3)[_0xfcbc('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfcbc('0x4d')},'dialDropRetryFrequency':{'type':Sequelize[_0xfcbc('0x13')](0x5)[_0xfcbc('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfcbc('0x4e')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xfcbc('0x13')](0x3)[_0xfcbc('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfcbc('0x4f')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xfcbc('0x13')](0x5)[_0xfcbc('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfcbc('0x50')},'dialMachineMaxRetry':{'type':Sequelize[_0xfcbc('0x13')](0x3)[_0xfcbc('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xfcbc('0x13')](0x5)[_0xfcbc('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfcbc('0x51')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xfcbc('0x13')](0x3)[_0xfcbc('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xfcbc('0x13')](0x5)[_0xfcbc('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfcbc('0x52')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0xfcbc('0x53')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xfcbc('0x54'),'set':function(_0x3223de){if(!_0x3223de)this[_0xfcbc('0xd')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0xfcbc('0x55'),_0x3223de);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xfcbc('0x13')](0x3)[_0xfcbc('0x23')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xfcbc('0x13')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x7094=['yes','all','once','TEXT','setDataValue','periodic_announce','split','join','joinempty','leavewhenempty','BOOLEAN','Active/Disactive\x20Campaign','preview','predictive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','FLOAT','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#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)','#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\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','sequelize','exports','STRING','name','ENUM','inbound','outbound','leastrecent','fewestcalls','random','wrandom','rrordered','ringall','strategy','rrmemory','getDataValue','type','dialMethod','booked','progressive','power','INTEGER'];(function(_0x519244,_0x5ac0ae){var _0x33d052=function(_0xd6f4a){while(--_0xd6f4a){_0x519244['push'](_0x519244['shift']());}};_0x33d052(++_0x5ac0ae);}(_0x7094,0xda));var _0x4709=function(_0x243487,_0x2fd428){_0x243487=_0x243487-0x0;var _0x2643b1=_0x7094[_0x243487];return _0x2643b1;};'use strict';var Sequelize=require(_0x4709('0x0'));module[_0x4709('0x1')]={'name':{'type':Sequelize[_0x4709('0x2')],'allowNull':![],'unique':_0x4709('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x4709('0x4')](_0x4709('0x5'),_0x4709('0x6')),'allowNull':![],'defaultValue':_0x4709('0x5')},'musiconhold':{'type':Sequelize[_0x4709('0x2')],'defaultValue':'default'},'announce':{'type':Sequelize[_0x4709('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x4709('0x4')]('rr','ringall',_0x4709('0x7'),_0x4709('0x8'),_0x4709('0x9'),'rrmemory','linear',_0x4709('0xa'),_0x4709('0xb')),'allowNull':![],'defaultValue':_0x4709('0xc'),'set':function(_0x3ebda1){this['setDataValue'](_0x4709('0xd'),_0x3ebda1?_0x3ebda1:_0x4709('0xe'));},'get':function(){var _0x26260f=this[_0x4709('0xf')](_0x4709('0x10'));var _0x29d2b7=this['getDataValue'](_0x4709('0x11'));var _0x55b731=this[_0x4709('0xf')]('strategy');if(_0x26260f===_0x4709('0x5')){return _0x55b731;}if(_0x29d2b7==='booked'&&_0x55b731===_0x4709('0xe')||_0x29d2b7===_0x4709('0x12')&&_0x55b731==='roundrobin'){return _0x55b731;}if(_0x29d2b7===_0x4709('0x13')||_0x29d2b7==='predictive'||_0x29d2b7===_0x4709('0x14')){return _0x55b731;}return null;}},'servicelevel':{'type':Sequelize[_0x4709('0x15')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x4709('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x4709('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x4709('0x15')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x4709('0x2')]},'weight':{'type':Sequelize[_0x4709('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x4709('0x15')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0x4709('0x16'),'no'),'defaultValue':_0x4709('0x16')},'autopause':{'type':Sequelize[_0x4709('0x4')](_0x4709('0x16'),'no',_0x4709('0x17')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x4709('0x15')](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0x4709('0x16'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x4709('0x4')](_0x4709('0x16'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x4709('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x4709('0x4')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0x4709('0x16'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x4709('0x4')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x4709('0x4')](_0x4709('0x16'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x4709('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x4709('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x4709('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x4709('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x4709('0x4')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x4709('0x4')](_0x4709('0x16'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0x4709('0x4')]('yes','no',_0x4709('0x18')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x4709('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x4709('0x4')](_0x4709('0x16'),'no')},'announce_position_limit':{'type':Sequelize[_0x4709('0x15')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x4709('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x4709('0x2')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x4709('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x4709('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x4709('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x4709('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x4709('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x4709('0x2')]},'queue_quantity1':{'type':Sequelize[_0x4709('0x2')]},'queue_quantity2':{'type':Sequelize[_0x4709('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x4709('0x2')]},'queue_less_than':{'type':Sequelize[_0x4709('0x2')]},'periodic_announce':{'type':Sequelize[_0x4709('0x19')],'set':function(_0x1ee1ec){this[_0x4709('0x1a')]('periodic_announce',_0x1ee1ec?_0x1ee1ec['join'](','):[]);},'get':function(){return this[_0x4709('0xf')](_0x4709('0x1b'))?this['getDataValue']('periodic_announce')[_0x4709('0x1c')](','):[];}},'joinempty':{'type':Sequelize[_0x4709('0x2')],'defaultValue':'yes','set':function(_0x57656c){this[_0x4709('0x1a')]('joinempty',_0x57656c?_0x57656c[_0x4709('0x1d')](','):undefined);},'get':function(){return this[_0x4709('0xf')]('joinempty')?this[_0x4709('0xf')](_0x4709('0x1e'))[_0x4709('0x1c')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x4709('0x2')],'defaultValue':'no','set':function(_0x2c59b0){this['setDataValue'](_0x4709('0x1f'),_0x2c59b0?_0x2c59b0[_0x4709('0x1d')](','):undefined);},'get':function(){return this['getDataValue'](_0x4709('0x1f'))?this['getDataValue'](_0x4709('0x1f'))[_0x4709('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x4709('0x4')](_0x4709('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x4709('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x4709('0x4')](_0x4709('0x16'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x4709('0x2')]},'description':{'type':Sequelize[_0x4709('0x2')]},'acw':{'type':Sequelize[_0x4709('0x20')],'defaultValue':0x0,'set':function(_0x5d040a){this[_0x4709('0x1a')]('acw',_0x5d040a);if(_0x5d040a){if(this[_0x4709('0xf')]('wrapuptime')<0x2){this['setDataValue']('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0x4709('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x4709('0x21')},'dialMethod':{'type':Sequelize[_0x4709('0x4')](_0x4709('0x22'),_0x4709('0x13'),_0x4709('0x14'),_0x4709('0x23'),_0x4709('0x12')),'defaultValue':_0x4709('0x13'),'comment':_0x4709('0x24')},'dialLimitChannel':{'type':Sequelize[_0x4709('0x15')](0x4)[_0x4709('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x4709('0x26')},'dialLimitQueue':{'type':Sequelize[_0x4709('0x15')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x4709('0x27')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x4709('0x28')},'dialPredictiveOptimization':{'type':Sequelize[_0x4709('0x4')](_0x4709('0x29'),_0x4709('0x2a')),'defaultValue':_0x4709('0x2a'),'comment':_0x4709('0x2b')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x4709('0x2c')](0x2)[_0x4709('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize[_0x4709('0x15')](0x3)[_0x4709('0x25')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x4709('0x2d')},'dialOriginateCallerIdName':{'type':Sequelize[_0x4709('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x4709('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4709('0x2e')},'dialQueueOptions':{'type':Sequelize[_0x4709('0x2')],'defaultValue':_0x4709('0x2f'),'comment':_0x4709('0x30')},'dialQueueTimeout':{'type':Sequelize[_0x4709('0x15')](0x3)[_0x4709('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4709('0x31')},'dialQueueProject':{'type':Sequelize[_0x4709('0x2')],'comment':_0x4709('0x32')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4709('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4709('0x33')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x4709('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x4709('0x15')](0x3)[_0x4709('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4709('0x34')},'dialBusyRetryFrequency':{'type':Sequelize[_0x4709('0x15')](0x5)[_0x4709('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x4709('0x15')](0x3)[_0x4709('0x25')],'defaultValue':0x3,'comment':_0x4709('0x35')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x4709('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4709('0x36')},'dialGlobalMaxRetry':{'type':Sequelize[_0x4709('0x15')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x4709('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x4709('0x37')},'dialPrefix':{'type':Sequelize[_0x4709('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x4709('0x4')](_0x4709('0x38'),_0x4709('0x39'),_0x4709('0x3a')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x4709('0x20')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x4709('0x25')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x4709('0x15')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x4709('0x25')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x4709('0x3b')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x4709('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x4709('0x3c')},'dialAMDMinWordLength':{'type':Sequelize[_0x4709('0x15')](0x9)[_0x4709('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x4709('0x3d')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x4709('0x15')](0x9)[_0x4709('0x25')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x4709('0x3e')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x4709('0x15')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x4709('0x3f')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x4709('0x15')](0x5)[_0x4709('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x4709('0x40')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x4709('0x15')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x4709('0x41')},'dialRecallMeTimeout':{'type':Sequelize[_0x4709('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x4709('0x42')},'dialRecallInQueue':{'type':Sequelize[_0x4709('0x20')],'defaultValue':0x0,'comment':_0x4709('0x43')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x4709('0x44'),'ASC'),'defaultValue':_0x4709('0x44')},'dialQueueProject2':{'type':Sequelize[_0x4709('0x2')],'comment':_0x4709('0x32')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x4709('0x20')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x4709('0x20')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x4709('0x15')](0x3)[_0x4709('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4709('0x45')},'dialCutDigit':{'type':Sequelize[_0x4709('0x15')](0x3)[_0x4709('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4709('0x46')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x4709('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4709('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x4709('0x15')](0x3)[_0x4709('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4709('0x47')},'dialDropRetryFrequency':{'type':Sequelize[_0x4709('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4709('0x48')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4709('0x49')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x4709('0x15')](0x5)[_0x4709('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4709('0x4a')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4709('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x4709('0x15')](0x5)[_0x4709('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4709('0x4b')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x4709('0x15')](0x3)[_0x4709('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4709('0x4c')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x4709('0x15')](0x5)[_0x4709('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4709('0x4d')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4709('0x15')],'allowNull':!![],'comment':_0x4709('0x4e')},'mandatoryDisposition':{'type':Sequelize[_0x4709('0x20')],'defaultValue':![],'comment':_0x4709('0x4f'),'set':function(_0x55db75){if(!_0x55db75)this[_0x4709('0x1a')]('mandatoryDispositionPauseId',null);this[_0x4709('0x1a')]('mandatoryDisposition',_0x55db75);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x4709('0x15')](0x3)[_0x4709('0x25')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x4709('0x15')](0x3)[_0x4709('0x25')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x4709('0x20')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 6997909..d5ba48c 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 _0x088f=['removeTeams','ids','User','field','tq.TeamId','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','removeAgents','UserVoiceQueueRt','addAgents','omit','spread','userVoiceQueue:save','isEmpty','format','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','addLists','dialCheckDuplicateType','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','NOW()','CmListId','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','into','cm_contacts','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','zip-dir','request-promise','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','filter','ignore','map','value','type','name','end','error','stack','index','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','merge','where','options','includeAll','include','findAll','rows','catch','params','VoiceQueue','create','user','find','UserProfileSection','autoAssociation','UserProfileResource','clone','length','updatedAt','body','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','VoiceQueueId','CmHopper','getHopperHistories','CmHopperHistory','nolimit','getHopperFinals','CmHopperFinal','CmHopperBlack','getTeams','Team','addTeams','Agents','online','voicePause','interface','flatMap','forEach','penalty','sequelize','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','isNil','SIP/%s','emit'];(function(_0x487496,_0x249683){var _0x539dc8=function(_0x2c38e1){while(--_0x2c38e1){_0x487496['push'](_0x487496['shift']());}};_0x539dc8(++_0x249683);}(_0x088f,0xf5));var _0xf088=function(_0x54809f,_0x5aeabf){_0x54809f=_0x54809f-0x0;var _0x11e54a=_0x088f[_0x54809f];return _0x11e54a;};'use strict';var emlformat=require(_0xf088('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf088('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf088('0x2'));var moment=require('moment');var BPromise=require(_0xf088('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf088('0x4'));var sox=require(_0xf088('0x5'));var csv=require(_0xf088('0x6'));var ejs=require(_0xf088('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf088('0x8'));var squel=require(_0xf088('0x9'));var crypto=require(_0xf088('0xa'));var jsforce=require(_0xf088('0xb'));var deskjs=require(_0xf088('0xc'));var toCsv=require(_0xf088('0x6'));var querystring=require('querystring');var Papa=require(_0xf088('0xd'));var Redis=require('ioredis');var authService=require(_0xf088('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xf088('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf088('0x10'))(_0xf088('0x11'));var utils=require(_0xf088('0x12'));var config=require(_0xf088('0x13'));var licenseUtil=require(_0xf088('0x14'));var db=require(_0xf088('0x15'))['db'];config[_0xf088('0x16')]=_[_0xf088('0x17')](config[_0xf088('0x16')],{'host':_0xf088('0x18'),'port':0x18eb});var socket=require(_0xf088('0x19'))(new Redis(config['redis']));require(_0xf088('0x1a'))[_0xf088('0x1b')](socket);function respondWithStatusCode(_0x594474,_0x38930b){_0x38930b=_0x38930b||0xcc;return function(_0x13fdfc){if(_0x13fdfc){return _0x594474[_0xf088('0x1c')](_0x38930b);}return _0x594474[_0xf088('0x1d')](_0x38930b)['end']();};}function respondWithResult(_0x115347,_0x22c0a5){_0x22c0a5=_0x22c0a5||0xc8;return function(_0x572f50){if(_0x572f50){return _0x115347[_0xf088('0x1d')](_0x22c0a5)[_0xf088('0x1e')](_0x572f50);}};}function respondWithFilteredResult(_0x36f85f,_0x1c7837){return function(_0x3bfb19){if(_0x3bfb19){var _0x5eeb68=typeof _0x1c7837['offset']===_0xf088('0x1f')&&typeof _0x1c7837[_0xf088('0x20')]===_0xf088('0x1f');var _0x546256=_0x3bfb19[_0xf088('0x21')];var _0x3670f6=_0x5eeb68?0x0:_0x1c7837['offset'];var _0x1ea441=_0x5eeb68?_0x3bfb19[_0xf088('0x21')]:_0x1c7837[_0xf088('0x22')]+_0x1c7837[_0xf088('0x20')];var _0x513a95;if(_0x1ea441>=_0x546256){_0x1ea441=_0x546256;_0x513a95=0xc8;}else{_0x513a95=0xce;}_0x36f85f[_0xf088('0x1d')](_0x513a95);return _0x36f85f[_0xf088('0x23')](_0xf088('0x24'),_0x3670f6+'-'+_0x1ea441+'/'+_0x546256)[_0xf088('0x1e')](_0x3bfb19);}return null;};}function patchUpdates(_0x2509bf){return function(_0x459e09){try{jsonpatch['apply'](_0x459e09,_0x2509bf,!![]);}catch(_0x2ad102){return BPromise[_0xf088('0x25')](_0x2ad102);}return _0x459e09[_0xf088('0x26')]();};}function saveUpdates(_0x353f0b,_0x3b20c9){return function(_0x14e394){if(_0x14e394){return _0x14e394[_0xf088('0x27')](_0x353f0b)[_0xf088('0x28')](function(_0x534731){return _0x534731;});}return null;};}function removeEntity(_0xe82a47,_0x1b2bbd){return function(_0x75ac7c){if(_0x75ac7c){return _0x75ac7c[_0xf088('0x29')]()[_0xf088('0x28')](function(){var _0xc4db5b=_0x75ac7c[_0xf088('0x2a')]({'plain':!![]});var _0x48fe9a=[{'name':_0xf088('0x2b'),'value':_0xf088('0x2c'),'ignore':![]},{'name':_0xf088('0x2d'),'value':'outbound','ignore':![]}];var _0x3e52ec=_(_0x48fe9a)[_0xf088('0x2e')](_0xf088('0x2f'))[_0xf088('0x30')](_0xf088('0x31'))['value']();if(_['includes'](_0x3e52ec,_0xc4db5b[_0xf088('0x32')])){return;}var _0x118401=_['find'](_0x48fe9a,[_0xf088('0x31'),_0xc4db5b[_0xf088('0x32')]])[_0xf088('0x33')];return db['UserProfileResource'][_0xf088('0x29')]({'where':{'type':_0x118401,'resourceId':_0xc4db5b['id']}})[_0xf088('0x28')](function(){return _0x75ac7c;});})[_0xf088('0x28')](function(){_0xe82a47[_0xf088('0x1d')](0xcc)[_0xf088('0x34')]();});}};}function handleEntityNotFound(_0x3facbe,_0x2e0c71){return function(_0x59a99b){if(!_0x59a99b){_0x3facbe[_0xf088('0x1c')](0x194);}return _0x59a99b;};}function handleError(_0x4212d4,_0xd1abd9){_0xd1abd9=_0xd1abd9||0x1f4;return function(_0x1c7b25){logger[_0xf088('0x35')](_0x1c7b25[_0xf088('0x36')]);if(_0x1c7b25[_0xf088('0x33')]){delete _0x1c7b25['name'];}_0x4212d4[_0xf088('0x1d')](_0xd1abd9)['send'](_0x1c7b25);};}exports[_0xf088('0x37')]=function(_0x574406,_0x560845){var _0x1ffcb8={},_0x1c2af8={},_0x113d64={'count':0x0,'rows':[]};var _0xa4658=_[_0xf088('0x30')](db['VoiceQueue'][_0xf088('0x38')],function(_0x12c90f){return{'name':_0x12c90f[_0xf088('0x39')],'type':_0x12c90f[_0xf088('0x32')][_0xf088('0x3a')]};});_0x1c2af8[_0xf088('0x3b')]=_[_0xf088('0x30')](_0xa4658,_0xf088('0x33'));_0x1c2af8[_0xf088('0x3c')]=_[_0xf088('0x3d')](_0x574406[_0xf088('0x3c')]);_0x1c2af8[_0xf088('0x3e')]=_[_0xf088('0x3f')](_0x1c2af8[_0xf088('0x3b')],_0x1c2af8['query']);_0x1ffcb8[_0xf088('0x40')]=_[_0xf088('0x3f')](_0x1c2af8[_0xf088('0x3b')],qs[_0xf088('0x41')](_0x574406[_0xf088('0x3c')][_0xf088('0x41')]));_0x1ffcb8[_0xf088('0x40')]=_0x1ffcb8['attributes']['length']?_0x1ffcb8['attributes']:_0x1c2af8['model'];if(!_0x574406['query'][_0xf088('0x42')]('nolimit')){_0x1ffcb8[_0xf088('0x20')]=qs['limit'](_0x574406[_0xf088('0x3c')][_0xf088('0x20')]);_0x1ffcb8[_0xf088('0x22')]=qs[_0xf088('0x22')](_0x574406[_0xf088('0x3c')][_0xf088('0x22')]);}_0x1ffcb8[_0xf088('0x43')]=qs[_0xf088('0x44')](_0x574406['query'][_0xf088('0x44')]);_0x1ffcb8['where']=qs[_0xf088('0x3e')](_[_0xf088('0x45')](_0x574406['query'],_0x1c2af8['filters']),_0xa4658);if(_0x574406['query']['filter']){_0x1ffcb8['where']=_[_0xf088('0x46')](_0x1ffcb8[_0xf088('0x47')],{'$or':_[_0xf088('0x30')](_0xa4658,function(_0x106e77){if(_0x106e77['type']!=='VIRTUAL'){var _0x31d3c0={};_0x31d3c0[_0x106e77['name']]={'$like':'%'+_0x574406['query'][_0xf088('0x2e')]+'%'};return _0x31d3c0;}})});}_0x1ffcb8=_[_0xf088('0x46')]({},_0x1ffcb8,_0x574406[_0xf088('0x48')]);var _0x3b2ee4={'where':_0x1ffcb8[_0xf088('0x47')]};return db['VoiceQueue'][_0xf088('0x21')](_0x3b2ee4)[_0xf088('0x28')](function(_0x2f80e4){_0x113d64['count']=_0x2f80e4;if(_0x574406[_0xf088('0x3c')][_0xf088('0x49')]){_0x1ffcb8[_0xf088('0x4a')]=[{'all':!![]}];}return db['VoiceQueue'][_0xf088('0x4b')](_0x1ffcb8);})[_0xf088('0x28')](function(_0x32cc2d){_0x113d64[_0xf088('0x4c')]=_0x32cc2d;return _0x113d64;})['then'](respondWithFilteredResult(_0x560845,_0x1ffcb8))[_0xf088('0x4d')](handleError(_0x560845,null));};exports['show']=function(_0x2d0666,_0x379f65){var _0x69a831={'raw':![],'where':{'id':_0x2d0666[_0xf088('0x4e')]['id']}},_0xe841ff={};_0xe841ff[_0xf088('0x3b')]=_[_0xf088('0x3d')](db[_0xf088('0x4f')]['rawAttributes']);_0xe841ff[_0xf088('0x3c')]=_['keys'](_0x2d0666[_0xf088('0x3c')]);_0xe841ff[_0xf088('0x3e')]=_[_0xf088('0x3f')](_0xe841ff[_0xf088('0x3b')],_0xe841ff['query']);_0x69a831[_0xf088('0x40')]=_['intersection'](_0xe841ff[_0xf088('0x3b')],qs[_0xf088('0x41')](_0x2d0666['query'][_0xf088('0x41')]));_0x69a831[_0xf088('0x40')]=_0x69a831[_0xf088('0x40')]['length']?_0x69a831['attributes']:_0xe841ff[_0xf088('0x3b')];if(_0x2d0666['query'][_0xf088('0x49')]){_0x69a831[_0xf088('0x4a')]=[{'all':!![]}];}_0x69a831=_[_0xf088('0x46')]({},_0x69a831,_0x2d0666['options']);return db[_0xf088('0x4f')]['find'](_0x69a831)[_0xf088('0x28')](handleEntityNotFound(_0x379f65,null))[_0xf088('0x28')](respondWithResult(_0x379f65,null))[_0xf088('0x4d')](handleError(_0x379f65,null));};exports[_0xf088('0x50')]=function(_0x9af413,_0x4473b5){return db[_0xf088('0x4f')][_0xf088('0x50')](_0x9af413['body'],{})['then'](function(_0x523fdc){var _0x120869=_0x9af413[_0xf088('0x51')][_0xf088('0x2a')]({'plain':!![]});if(!_0x120869)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x120869['role']==='user'){var _0x587261=_0x523fdc[_0xf088('0x2a')]({'plain':!![]});var _0x4c316a=[{'name':_0xf088('0x2b'),'value':_0xf088('0x2c')},{'name':'QueueCampaigns','value':'outbound'}];var _0x131b14=_[_0xf088('0x52')](_0x4c316a,[_0xf088('0x31'),_0x587261[_0xf088('0x32')]])[_0xf088('0x33')];return db[_0xf088('0x53')]['find']({'where':{'name':_0x131b14,'userProfileId':_0x120869['userProfileId']},'raw':!![]})[_0xf088('0x28')](function(_0x3d0506){if(_0x3d0506&&_0x3d0506[_0xf088('0x54')]===0x0){return db[_0xf088('0x55')][_0xf088('0x50')]({'name':_0x587261[_0xf088('0x33')],'resourceId':_0x587261['id'],'type':_0x3d0506[_0xf088('0x33')],'sectionId':_0x3d0506['id']},{})[_0xf088('0x28')](function(){return _0x523fdc;});}else{return _0x523fdc;}})[_0xf088('0x4d')](function(_0x47872c){logger[_0xf088('0x35')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x47872c);throw _0x47872c;});}return _0x523fdc;})['then'](respondWithResult(_0x4473b5,0xc9))[_0xf088('0x4d')](handleError(_0x4473b5,null));};exports[_0xf088('0x56')]=function(_0x168f83,_0x435b8e){var _0x167338={'where':{'id':_0x168f83[_0xf088('0x4e')]['id']}},_0x33b877={};_0x33b877['model']=_['keys'](db[_0xf088('0x4f')]['rawAttributes']);_0x167338[_0xf088('0x40')]=_[_0xf088('0x3f')](_0x33b877[_0xf088('0x3b')],qs[_0xf088('0x41')](_0x168f83[_0xf088('0x3c')][_0xf088('0x41')]));_0x167338['attributes']=_0x167338[_0xf088('0x40')][_0xf088('0x57')]?_0x167338[_0xf088('0x40')]:_0x33b877[_0xf088('0x3b')];if(_0x168f83[_0xf088('0x3c')][_0xf088('0x49')]){_0x167338[_0xf088('0x4a')]=[{'all':!![]}];}_0x167338=_[_0xf088('0x46')]({},_0x167338,_0x168f83[_0xf088('0x48')]);return db[_0xf088('0x4f')][_0xf088('0x52')](_0x167338)['then'](handleEntityNotFound(_0x435b8e,null))[_0xf088('0x28')](function(_0x37faea){if(_0x37faea){var _0x4b5a78=_0x37faea[_0xf088('0x2a')]({'plain':!![]});_0x4b5a78=qs['omit'](_0x4b5a78,['id','createdAt',_0xf088('0x58')]);_0x168f83['body']=_['omit'](_0x168f83[_0xf088('0x59')],['id',_0xf088('0x5a'),_0xf088('0x58')]);return db['VoiceQueue'][_0xf088('0x50')](_['merge'](_0x4b5a78,_0x168f83[_0xf088('0x59')]),{'include':_0x168f83[_0xf088('0x3c')][_0xf088('0x49')]?[{'all':!![]}]:undefined})['then'](function(_0x78c898){var _0x4ac663=_0x168f83[_0xf088('0x51')][_0xf088('0x2a')]({'plain':!![]});if(!_0x4ac663)throw new Error(_0xf088('0x5b'));if(_0x4ac663[_0xf088('0x5c')]===_0xf088('0x51')){var _0x4710e5=_0x78c898[_0xf088('0x2a')]({'plain':!![]});var _0x256d90=[{'name':_0xf088('0x2b'),'value':_0xf088('0x2c')},{'name':_0xf088('0x2d'),'value':'outbound'}];var _0x3f4b6c=_[_0xf088('0x52')](_0x256d90,[_0xf088('0x31'),_0x4710e5[_0xf088('0x32')]])[_0xf088('0x33')];return db[_0xf088('0x53')][_0xf088('0x52')]({'where':{'name':_0x3f4b6c,'userProfileId':_0x4ac663[_0xf088('0x5d')]},'raw':!![]})['then'](function(_0x46b534){if(_0x46b534&&_0x46b534['autoAssociation']===0x0){return db['UserProfileResource'][_0xf088('0x50')]({'name':_0x4710e5[_0xf088('0x33')],'resourceId':_0x4710e5['id'],'type':_0x46b534[_0xf088('0x33')],'sectionId':_0x46b534['id']},{})['then'](function(){return _0x78c898;});}else{return _0x78c898;}})['catch'](function(_0x796990){logger[_0xf088('0x35')](_0xf088('0x5e'),_0x796990);throw _0x796990;});}return _0x78c898;});}})[_0xf088('0x28')](respondWithResult(_0x435b8e,0xc9))['catch'](handleError(_0x435b8e,null));};exports[_0xf088('0x27')]=function(_0x41b55a,_0x147459){if(_0x41b55a[_0xf088('0x59')]['id']){delete _0x41b55a[_0xf088('0x59')]['id'];}return db['VoiceQueue'][_0xf088('0x52')]({'where':{'id':_0x41b55a[_0xf088('0x4e')]['id']}})['then'](handleEntityNotFound(_0x147459,null))['then'](saveUpdates(_0x41b55a[_0xf088('0x59')],null))[_0xf088('0x28')](respondWithResult(_0x147459,null))['catch'](handleError(_0x147459,null));};exports[_0xf088('0x29')]=function(_0x1a2fb4,_0x4b5125){return db[_0xf088('0x4f')][_0xf088('0x52')]({'where':{'id':_0x1a2fb4[_0xf088('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4b5125,null))[_0xf088('0x28')](removeEntity(_0x4b5125,null))[_0xf088('0x4d')](handleError(_0x4b5125,null));};exports[_0xf088('0x5f')]=function(_0x3ffdcb,_0xd7c6d3,_0xf5ed72){var _0x177cdb={'raw':![],'where':{}};var _0x255d2a={};var _0x550333={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xf088('0x60')]({'where':{'id':_0x3ffdcb[_0xf088('0x4e')]['id']}})[_0xf088('0x28')](handleEntityNotFound(_0xd7c6d3,null))[_0xf088('0x28')](function(_0x396333){if(_0x396333){_0x255d2a['model']=_['keys'](db['CmHopper'][_0xf088('0x38')]);_0x255d2a[_0xf088('0x3c')]=_[_0xf088('0x3d')](_0x3ffdcb[_0xf088('0x3c')]);_0x255d2a[_0xf088('0x3e')]=_[_0xf088('0x3f')](_0x255d2a[_0xf088('0x3b')],_0x255d2a[_0xf088('0x3c')]);_0x177cdb[_0xf088('0x40')]=_[_0xf088('0x3f')](_0x255d2a[_0xf088('0x3b')],qs['fields'](_0x3ffdcb[_0xf088('0x3c')][_0xf088('0x41')]));_0x177cdb[_0xf088('0x40')]=_0x177cdb[_0xf088('0x40')]['length']?_0x177cdb['attributes']:_0x255d2a[_0xf088('0x3b')];if(!_0x3ffdcb[_0xf088('0x3c')]['hasOwnProperty']('nolimit')){_0x177cdb[_0xf088('0x20')]=qs['limit'](_0x3ffdcb[_0xf088('0x3c')][_0xf088('0x20')]);_0x177cdb[_0xf088('0x22')]=qs[_0xf088('0x22')](_0x3ffdcb[_0xf088('0x3c')][_0xf088('0x22')]);}_0x177cdb[_0xf088('0x43')]=qs[_0xf088('0x44')](_0x3ffdcb[_0xf088('0x3c')][_0xf088('0x44')]);_0x177cdb[_0xf088('0x47')]=qs[_0xf088('0x3e')](_[_0xf088('0x45')](_0x3ffdcb[_0xf088('0x3c')],_0x255d2a[_0xf088('0x3e')]));_0x177cdb['where'][_0xf088('0x61')]=_0x396333['id'];if(_0x3ffdcb[_0xf088('0x3c')][_0xf088('0x2e')]){_0x177cdb['where']=_[_0xf088('0x46')](_0x177cdb[_0xf088('0x47')],{'$or':_[_0xf088('0x30')](_0x177cdb[_0xf088('0x40')],function(_0x38595f){var _0x11ad1a={};_0x11ad1a[_0x38595f]={'$like':'%'+_0x3ffdcb[_0xf088('0x3c')][_0xf088('0x2e')]+'%'};return _0x11ad1a;})});}_0x177cdb=_[_0xf088('0x46')]({},_0x177cdb,_0x3ffdcb['options']);return db['CmHopper'][_0xf088('0x21')]({'where':_0x177cdb[_0xf088('0x47')]})['then'](function(_0x299f0d){_0x550333[_0xf088('0x21')]=_0x299f0d;if(_0x3ffdcb['query'][_0xf088('0x49')]){_0x177cdb[_0xf088('0x4a')]=[{'all':!![]}];}return db[_0xf088('0x62')][_0xf088('0x4b')](_0x177cdb);})[_0xf088('0x28')](function(_0x252f25){_0x550333[_0xf088('0x4c')]=_0x252f25;return _0x550333;});}})[_0xf088('0x28')](respondWithFilteredResult(_0xd7c6d3,_0x177cdb))[_0xf088('0x4d')](handleError(_0xd7c6d3,null));};exports[_0xf088('0x63')]=function(_0x5f535e,_0x42531e,_0x13bbd3){var _0x4064cc={'raw':!![],'where':{}};var _0x4a7924={};var _0x2ba787={'count':0x0,'rows':[]};return db[_0xf088('0x4f')][_0xf088('0x60')]({'where':{'id':_0x5f535e[_0xf088('0x4e')]['id']}})[_0xf088('0x28')](handleEntityNotFound(_0x42531e,null))['then'](function(_0x2c772e){if(_0x2c772e){_0x4a7924[_0xf088('0x3b')]=_[_0xf088('0x3d')](db[_0xf088('0x64')][_0xf088('0x38')]);_0x4a7924['query']=_[_0xf088('0x3d')](_0x5f535e[_0xf088('0x3c')]);_0x4a7924['filters']=_['intersection'](_0x4a7924[_0xf088('0x3b')],_0x4a7924[_0xf088('0x3c')]);_0x4064cc[_0xf088('0x40')]=_['intersection'](_0x4a7924[_0xf088('0x3b')],qs[_0xf088('0x41')](_0x5f535e[_0xf088('0x3c')][_0xf088('0x41')]));_0x4064cc[_0xf088('0x40')]=_0x4064cc['attributes'][_0xf088('0x57')]?_0x4064cc[_0xf088('0x40')]:_0x4a7924['model'];if(!_0x5f535e[_0xf088('0x3c')]['hasOwnProperty'](_0xf088('0x65'))){_0x4064cc[_0xf088('0x20')]=qs[_0xf088('0x20')](_0x5f535e['query'][_0xf088('0x20')]);_0x4064cc[_0xf088('0x22')]=qs['offset'](_0x5f535e[_0xf088('0x3c')]['offset']);}_0x4064cc[_0xf088('0x43')]=qs['sort'](_0x5f535e[_0xf088('0x3c')][_0xf088('0x44')]);_0x4064cc[_0xf088('0x47')]=qs[_0xf088('0x3e')](_[_0xf088('0x45')](_0x5f535e[_0xf088('0x3c')],_0x4a7924[_0xf088('0x3e')]));_0x4064cc['where'][_0xf088('0x61')]=_0x2c772e['id'];if(_0x5f535e[_0xf088('0x3c')]['filter']){_0x4064cc[_0xf088('0x47')]=_[_0xf088('0x46')](_0x4064cc['where'],{'$or':_['map'](_0x4064cc[_0xf088('0x40')],function(_0x48f6cf){var _0x47f6f8={};_0x47f6f8[_0x48f6cf]={'$like':'%'+_0x5f535e['query'][_0xf088('0x2e')]+'%'};return _0x47f6f8;})});}_0x4064cc=_['merge']({},_0x4064cc,_0x5f535e[_0xf088('0x48')]);return db[_0xf088('0x64')][_0xf088('0x21')]({'where':_0x4064cc[_0xf088('0x47')]})['then'](function(_0x2eb188){_0x2ba787[_0xf088('0x21')]=_0x2eb188;if(_0x5f535e[_0xf088('0x3c')]['includeAll']){_0x4064cc[_0xf088('0x4a')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xf088('0x4b')](_0x4064cc);})[_0xf088('0x28')](function(_0xb8af6c){_0x2ba787['rows']=_0xb8af6c;return _0x2ba787;});}})[_0xf088('0x28')](respondWithFilteredResult(_0x42531e,_0x4064cc))['catch'](handleError(_0x42531e,null));};exports[_0xf088('0x66')]=function(_0x156381,_0x2f6013,_0x130afb){var _0x2e2bed={'raw':!![],'where':{}};var _0x584920={};var _0x3e41fe={'count':0x0,'rows':[]};return db[_0xf088('0x4f')]['findOne']({'where':{'id':_0x156381['params']['id']}})[_0xf088('0x28')](handleEntityNotFound(_0x2f6013,null))[_0xf088('0x28')](function(_0x2ce86f){if(_0x2ce86f){_0x584920[_0xf088('0x3b')]=_[_0xf088('0x3d')](db[_0xf088('0x67')][_0xf088('0x38')]);_0x584920['query']=_[_0xf088('0x3d')](_0x156381[_0xf088('0x3c')]);_0x584920[_0xf088('0x3e')]=_['intersection'](_0x584920['model'],_0x584920[_0xf088('0x3c')]);_0x2e2bed['attributes']=_[_0xf088('0x3f')](_0x584920[_0xf088('0x3b')],qs['fields'](_0x156381[_0xf088('0x3c')][_0xf088('0x41')]));_0x2e2bed[_0xf088('0x40')]=_0x2e2bed['attributes'][_0xf088('0x57')]?_0x2e2bed[_0xf088('0x40')]:_0x584920[_0xf088('0x3b')];if(!_0x156381[_0xf088('0x3c')][_0xf088('0x42')](_0xf088('0x65'))){_0x2e2bed[_0xf088('0x20')]=qs['limit'](_0x156381[_0xf088('0x3c')][_0xf088('0x20')]);_0x2e2bed[_0xf088('0x22')]=qs[_0xf088('0x22')](_0x156381[_0xf088('0x3c')][_0xf088('0x22')]);}_0x2e2bed['order']=qs['sort'](_0x156381[_0xf088('0x3c')][_0xf088('0x44')]);_0x2e2bed[_0xf088('0x47')]=qs[_0xf088('0x3e')](_[_0xf088('0x45')](_0x156381[_0xf088('0x3c')],_0x584920['filters']));_0x2e2bed[_0xf088('0x47')][_0xf088('0x61')]=_0x2ce86f['id'];if(_0x156381['query'][_0xf088('0x2e')]){_0x2e2bed[_0xf088('0x47')]=_[_0xf088('0x46')](_0x2e2bed['where'],{'$or':_['map'](_0x2e2bed['attributes'],function(_0x3c62bd){var _0x1865cb={};_0x1865cb[_0x3c62bd]={'$like':'%'+_0x156381[_0xf088('0x3c')]['filter']+'%'};return _0x1865cb;})});}_0x2e2bed=_[_0xf088('0x46')]({},_0x2e2bed,_0x156381[_0xf088('0x48')]);return db[_0xf088('0x67')][_0xf088('0x21')]({'where':_0x2e2bed['where']})[_0xf088('0x28')](function(_0x4423aa){_0x3e41fe[_0xf088('0x21')]=_0x4423aa;if(_0x156381[_0xf088('0x3c')][_0xf088('0x49')]){_0x2e2bed[_0xf088('0x4a')]=[{'all':!![]}];}return db[_0xf088('0x67')][_0xf088('0x4b')](_0x2e2bed);})[_0xf088('0x28')](function(_0x56595c){_0x3e41fe[_0xf088('0x4c')]=_0x56595c;return _0x3e41fe;});}})[_0xf088('0x28')](respondWithFilteredResult(_0x2f6013,_0x2e2bed))[_0xf088('0x4d')](handleError(_0x2f6013,null));};exports['getHopperBlacks']=function(_0x3fec3a,_0x35bec6,_0x4ce20a){var _0xea0859={'raw':!![],'where':{}};var _0x3f0d60={};var _0x16324b={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xf088('0x60')]({'where':{'id':_0x3fec3a[_0xf088('0x4e')]['id']}})[_0xf088('0x28')](handleEntityNotFound(_0x35bec6,null))['then'](function(_0x4ac683){if(_0x4ac683){_0x3f0d60[_0xf088('0x3b')]=_[_0xf088('0x3d')](db['CmHopperBlack'][_0xf088('0x38')]);_0x3f0d60[_0xf088('0x3c')]=_['keys'](_0x3fec3a[_0xf088('0x3c')]);_0x3f0d60[_0xf088('0x3e')]=_[_0xf088('0x3f')](_0x3f0d60[_0xf088('0x3b')],_0x3f0d60[_0xf088('0x3c')]);_0xea0859[_0xf088('0x40')]=_['intersection'](_0x3f0d60[_0xf088('0x3b')],qs[_0xf088('0x41')](_0x3fec3a[_0xf088('0x3c')][_0xf088('0x41')]));_0xea0859['attributes']=_0xea0859[_0xf088('0x40')][_0xf088('0x57')]?_0xea0859[_0xf088('0x40')]:_0x3f0d60['model'];if(!_0x3fec3a['query']['hasOwnProperty'](_0xf088('0x65'))){_0xea0859['limit']=qs[_0xf088('0x20')](_0x3fec3a[_0xf088('0x3c')][_0xf088('0x20')]);_0xea0859['offset']=qs['offset'](_0x3fec3a[_0xf088('0x3c')][_0xf088('0x22')]);}_0xea0859[_0xf088('0x43')]=qs[_0xf088('0x44')](_0x3fec3a[_0xf088('0x3c')][_0xf088('0x44')]);_0xea0859[_0xf088('0x47')]=qs['filters'](_[_0xf088('0x45')](_0x3fec3a[_0xf088('0x3c')],_0x3f0d60[_0xf088('0x3e')]));_0xea0859[_0xf088('0x47')][_0xf088('0x61')]=_0x4ac683['id'];if(_0x3fec3a[_0xf088('0x3c')]['filter']){_0xea0859[_0xf088('0x47')]=_[_0xf088('0x46')](_0xea0859[_0xf088('0x47')],{'$or':_[_0xf088('0x30')](_0xea0859[_0xf088('0x40')],function(_0x468e4a){var _0x5854b3={};_0x5854b3[_0x468e4a]={'$like':'%'+_0x3fec3a[_0xf088('0x3c')][_0xf088('0x2e')]+'%'};return _0x5854b3;})});}_0xea0859=_[_0xf088('0x46')]({},_0xea0859,_0x3fec3a[_0xf088('0x48')]);return db[_0xf088('0x68')][_0xf088('0x21')]({'where':_0xea0859['where']})[_0xf088('0x28')](function(_0x213fad){_0x16324b[_0xf088('0x21')]=_0x213fad;if(_0x3fec3a[_0xf088('0x3c')][_0xf088('0x49')]){_0xea0859[_0xf088('0x4a')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xf088('0x4b')](_0xea0859);})[_0xf088('0x28')](function(_0x4b9c33){_0x16324b[_0xf088('0x4c')]=_0x4b9c33;return _0x16324b;});}})[_0xf088('0x28')](respondWithFilteredResult(_0x35bec6,_0xea0859))['catch'](handleError(_0x35bec6,null));};exports[_0xf088('0x69')]=function(_0x5e53b6,_0x55caae,_0x29be9c){var _0x58a818={};var _0x2cb8de={};var _0x193272;var _0x25c64d;return db[_0xf088('0x4f')][_0xf088('0x60')]({'where':{'id':_0x5e53b6[_0xf088('0x4e')]['id']}})[_0xf088('0x28')](handleEntityNotFound(_0x55caae,null))[_0xf088('0x28')](function(_0x221f5a){if(_0x221f5a){_0x193272=_0x221f5a;_0x2cb8de[_0xf088('0x3b')]=_[_0xf088('0x3d')](db[_0xf088('0x6a')][_0xf088('0x38')]);_0x2cb8de[_0xf088('0x3c')]=_[_0xf088('0x3d')](_0x5e53b6[_0xf088('0x3c')]);_0x2cb8de['filters']=_[_0xf088('0x3f')](_0x2cb8de[_0xf088('0x3b')],_0x2cb8de['query']);_0x58a818[_0xf088('0x40')]=_[_0xf088('0x3f')](_0x2cb8de['model'],qs[_0xf088('0x41')](_0x5e53b6[_0xf088('0x3c')][_0xf088('0x41')]));_0x58a818[_0xf088('0x40')]=_0x58a818[_0xf088('0x40')][_0xf088('0x57')]?_0x58a818[_0xf088('0x40')]:_0x2cb8de[_0xf088('0x3b')];_0x58a818[_0xf088('0x43')]=qs[_0xf088('0x44')](_0x5e53b6[_0xf088('0x3c')]['sort']);_0x58a818[_0xf088('0x47')]=qs[_0xf088('0x3e')](_[_0xf088('0x45')](_0x5e53b6[_0xf088('0x3c')],_0x2cb8de[_0xf088('0x3e')]));if(_0x5e53b6['query']['filter']){_0x58a818['where']=_['merge'](_0x58a818['where'],{'$or':_[_0xf088('0x30')](_0x58a818[_0xf088('0x40')],function(_0x62e526){var _0x1fed58={};_0x1fed58[_0x62e526]={'$like':'%'+_0x5e53b6[_0xf088('0x3c')][_0xf088('0x2e')]+'%'};return _0x1fed58;})});}_0x58a818=_[_0xf088('0x46')]({},_0x58a818,_0x5e53b6[_0xf088('0x48')]);return _0x193272[_0xf088('0x69')](_0x58a818);}})[_0xf088('0x28')](function(_0x3057ed){if(_0x3057ed){_0x25c64d=_0x3057ed[_0xf088('0x57')];if(!_0x5e53b6[_0xf088('0x3c')][_0xf088('0x42')](_0xf088('0x65'))){_0x58a818[_0xf088('0x20')]=qs[_0xf088('0x20')](_0x5e53b6['query'][_0xf088('0x20')]);_0x58a818[_0xf088('0x22')]=qs[_0xf088('0x22')](_0x5e53b6[_0xf088('0x3c')]['offset']);}return _0x193272[_0xf088('0x69')](_0x58a818);}})[_0xf088('0x28')](function(_0x442313){if(_0x442313){return _0x442313?{'count':_0x25c64d,'rows':_0x442313}:null;}})[_0xf088('0x28')](respondWithResult(_0x55caae,null))[_0xf088('0x4d')](handleError(_0x55caae,null));};exports[_0xf088('0x6b')]=function(_0x4a0821,_0x4012e,_0x2e38ed){var _0x3860e0=_0x4a0821[_0xf088('0x59')]['teams'];var _0x25c6c0=_[_0xf088('0x30')](_0x3860e0,'id');return db[_0xf088('0x6a')]['findAll']({'where':{'id':_0x25c6c0},'attributes':['id'],'include':[{'model':db['User'],'as':_0xf088('0x6c'),'attributes':['id',_0xf088('0x33'),_0xf088('0x6d'),_0xf088('0x6e'),_0xf088('0x6f')],'raw':!![]}]})[_0xf088('0x28')](function(_0x28ad1b){if(_0x28ad1b){var _0x146afb=_[_0xf088('0x70')](_0x28ad1b,function(_0x46e463){var _0x21aaee=_0x46e463[_0xf088('0x2a')]({'plain':!![]});_0x21aaee[_0xf088('0x6c')][_0xf088('0x71')](function(_0x2760fe){_0x2760fe[_0xf088('0x72')]=_[_0xf088('0x52')](_0x3860e0,{'id':_0x21aaee['id']})[_0xf088('0x72')];});return _0x21aaee[_0xf088('0x6c')];});return db['VoiceQueue']['find']({'where':{'id':_0x4a0821[_0xf088('0x4e')]['id']}})[_0xf088('0x28')](function(_0x580cb1){return db[_0xf088('0x73')][_0xf088('0x74')](function(_0x38cd9f){return _0x580cb1['addTeams'](_0x25c6c0,{'transaction':_0x38cd9f})['then'](function(){return BPromise[_0xf088('0x75')](_0x3860e0,function(_0x1da95e){return db[_0xf088('0x76')][_0xf088('0x77')]({'TeamId':_0x1da95e['id'],'VoiceQueueId':_0x4a0821[_0xf088('0x4e')]['id'],'penalty':_0x1da95e[_0xf088('0x72')]},{'transaction':_0x38cd9f});});})[_0xf088('0x28')](function(){return BPromise[_0xf088('0x75')](_0x146afb,function(_0xc52440){return db[_0xf088('0x78')][_0xf088('0x79')]({'where':{'UserId':_0xc52440['id'],'VoiceQueueId':_0x4a0821[_0xf088('0x4e')]['id']},'defaults':{'penalty':_0xc52440[_0xf088('0x72')]},'transaction':_0x38cd9f});});})[_0xf088('0x28')](function(){return BPromise[_0xf088('0x75')](_[_0xf088('0x2e')](_0x146afb,{'online':!![]}),function(_0x163fe5){return db['UserVoiceQueueRt']['upsert']({'membername':_0x163fe5[_0xf088('0x33')],'UserId':_0x163fe5['id'],'queue_name':_0x580cb1[_0xf088('0x33')],'VoiceQueueId':_0x580cb1['id'],'interface':_[_0xf088('0x7a')](_0x163fe5[_0xf088('0x6f')])?util['format'](_0xf088('0x7b'),_0x163fe5[_0xf088('0x33')]):_0x163fe5[_0xf088('0x6f')],'paused':_0x163fe5[_0xf088('0x6e')]||![],'penalty':_0x163fe5[_0xf088('0x72')]},{'transaction':_0x38cd9f});});})['then'](function(){_0x146afb[_0xf088('0x71')](function(_0x250f24){socket[_0xf088('0x7c')]('userVoiceQueue:save',{'UserId':_0x250f24['id'],'VoiceQueueId':_0x580cb1['id']});});});});});}})[_0xf088('0x28')](respondWithStatusCode(_0x4012e,null))[_0xf088('0x4d')](handleError(_0x4012e,null));};exports[_0xf088('0x7d')]=function(_0x3afe5f,_0x2c4d83,_0xaac6be){return db[_0xf088('0x6a')][_0xf088('0x4b')]({'where':{'id':_0x3afe5f[_0xf088('0x3c')][_0xf088('0x7e')]},'attributes':['id'],'include':[{'model':db[_0xf088('0x7f')],'as':_0xf088('0x6c'),'attributes':['id'],'raw':!![]}]})[_0xf088('0x28')](handleEntityNotFound(_0x2c4d83,null))[_0xf088('0x28')](function(_0x11c2a8){var _0x43bf3d=_[_0xf088('0x30')](_0x11c2a8,'id');var _0x1dd8d2=[];var _0x59f2dd=[];var _0x296821=squel['select']();_0x296821[_0xf088('0x80')](_0xf088('0x81'))['from'](_0xf088('0x82'),'tq')[_0xf088('0x83')](_0xf088('0x84'),'ut',_0xf088('0x85'))[_0xf088('0x47')](_0xf088('0x86'),_0x3afe5f['params']['id']);for(var _0x546cf4=0x0;_0x546cf4<_0x11c2a8[_0xf088('0x57')];_0x546cf4+=0x1){let _0x5044bf=_0x11c2a8[_0x546cf4];for(var _0x12ca09=0x0;_0x12ca09<_0x5044bf[_0xf088('0x6c')][_0xf088('0x57')];_0x12ca09+=0x1){let _0x5ea2c2=_0x5044bf[_0xf088('0x6c')][_0x12ca09];var _0x424265=_0x296821[_0xf088('0x56')]();_0x424265[_0xf088('0x47')]('ut.UserId\x20=\x20?',_0x5ea2c2['id']);_0x59f2dd[_0xf088('0x87')](db[_0xf088('0x73')][_0xf088('0x3c')](_0x424265[_0xf088('0x88')](),{'type':db['sequelize'][_0xf088('0x89')][_0xf088('0x8a')]})[_0xf088('0x28')](function(_0x368b3b){if(_0x368b3b[_0xf088('0x57')]===0x1){return _0x5ea2c2['id'];}else{var _0x1c73ed=_[_0xf088('0x8b')](_[_0xf088('0x30')](_0x368b3b,_0xf088('0x8c')),function(_0x1cf6f4){return _[_0xf088('0x8d')](_0x43bf3d,_0x1cf6f4);});if(_0x1c73ed){return _0x5ea2c2['id'];}}}));}}return BPromise[_0xf088('0x8e')](_0x59f2dd)['then'](function(_0x2b43eb){_0x1dd8d2=_(_0x1dd8d2)[_0xf088('0x8f')](_0x2b43eb)['compact']()['value']();return db['VoiceQueue'][_0xf088('0x52')]({'where':{'id':_0x3afe5f[_0xf088('0x4e')]['id']}})[_0xf088('0x28')](function(_0x3d5cf9){return db[_0xf088('0x73')]['transaction'](function(_0x525006){return _0x3d5cf9['removeTeams'](_0x3afe5f['query'][_0xf088('0x7e')],{'transaction':_0x525006})[_0xf088('0x28')](function(){if(!_['isEmpty'](_0x1dd8d2)){return _0x3d5cf9[_0xf088('0x90')](_0x1dd8d2,{'transaction':_0x525006})['then'](function(){return db[_0xf088('0x91')]['destroy']({'where':{'VoiceQueueId':_0x3afe5f[_0xf088('0x4e')]['id'],'UserId':_0x1dd8d2},'transaction':_0x525006});});}})[_0xf088('0x28')](function(){_0x1dd8d2[_0xf088('0x71')](function(_0x234cd1){socket[_0xf088('0x7c')]('userVoiceQueue:remove',{'UserId':_0x234cd1,'VoiceQueueId':_0x3d5cf9['id']});});});});});});})[_0xf088('0x28')](respondWithStatusCode(_0x2c4d83,null))[_0xf088('0x4d')](handleError(_0x2c4d83,null));};exports[_0xf088('0x92')]=function(_0x10b4f5,_0x208a5a,_0x5ec29d){var _0x31ffe2,_0x547afe;return db[_0xf088('0x4f')][_0xf088('0x52')]({'where':{'id':_0x10b4f5[_0xf088('0x4e')]['id']}})['then'](handleEntityNotFound(_0x208a5a,null))[_0xf088('0x28')](function(_0x570882){if(_0x570882){_0x547afe=_0x570882;return _0x570882[_0xf088('0x92')](_0x10b4f5['body'][_0xf088('0x7e')],_[_0xf088('0x93')](_0x10b4f5[_0xf088('0x59')],['ids','id'])||{})[_0xf088('0x94')](function(_0x3a257f){for(var _0x21468f=0x0;_0x21468f<_0x10b4f5['body']['ids'][_0xf088('0x57')];_0x21468f+=0x1){socket['emit'](_0xf088('0x95'),{'UserId':Number(_0x10b4f5[_0xf088('0x59')][_0xf088('0x7e')][_0x21468f]),'VoiceQueueId':Number(_0x10b4f5[_0xf088('0x4e')]['id'])});}return _0x3a257f;});}})['then'](function(_0x4d6061){_0x31ffe2=_0x4d6061||[];if(_0x547afe){return db[_0xf088('0x7f')][_0xf088('0x4b')]({'where':{'id':_0x10b4f5[_0xf088('0x59')]['ids']},'attributes':['id',_0xf088('0x33'),_0xf088('0x6d'),_0xf088('0x6e'),_0xf088('0x6f')],'raw':!![]});}})[_0xf088('0x28')](function(_0x28a210){if(!_[_0xf088('0x96')](_0x28a210)){var _0x44ae29=[];for(var _0x10bd89=0x0;_0x10bd89<_0x28a210[_0xf088('0x57')];_0x10bd89++){if(_0x28a210[_0x10bd89][_0xf088('0x6d')]){_0x44ae29[_0xf088('0x87')](db['UserVoiceQueueRt'][_0xf088('0x77')]({'membername':_0x28a210[_0x10bd89][_0xf088('0x33')],'UserId':_0x28a210[_0x10bd89]['id'],'queue_name':_0x547afe[_0xf088('0x33')],'VoiceQueueId':_0x547afe['id'],'interface':_[_0xf088('0x7a')](_0x28a210[_0x10bd89][_0xf088('0x6f')])?util[_0xf088('0x97')]('SIP/%s',_0x28a210[_0x10bd89][_0xf088('0x33')]):_0x28a210[_0x10bd89][_0xf088('0x6f')],'paused':_0x28a210[_0x10bd89][_0xf088('0x6e')]||![],'penalty':_0x10b4f5[_0xf088('0x59')][_0xf088('0x72')]||0x0}));}}return BPromise[_0xf088('0x8e')](_0x44ae29);}})[_0xf088('0x28')](function(){return _0x31ffe2;})['then'](respondWithResult(_0x208a5a,null))[_0xf088('0x4d')](handleError(_0x208a5a,null));};exports[_0xf088('0x90')]=function(_0x5d8e4d,_0x2429e4,_0x4e04a4){return db[_0xf088('0x4f')][_0xf088('0x52')]({'where':{'id':_0x5d8e4d[_0xf088('0x4e')]['id']}})[_0xf088('0x28')](handleEntityNotFound(_0x2429e4,null))[_0xf088('0x28')](function(_0x48f078){if(_0x48f078){return _0x48f078[_0xf088('0x90')](_0x5d8e4d[_0xf088('0x3c')][_0xf088('0x7e')])[_0xf088('0x28')](function(){if(_[_0xf088('0x98')](_0x5d8e4d['query'][_0xf088('0x7e')])){for(var _0x3d6d90=0x0;_0x3d6d90<_0x5d8e4d[_0xf088('0x3c')]['ids'][_0xf088('0x57')];_0x3d6d90+=0x1){socket[_0xf088('0x7c')](_0xf088('0x99'),{'UserId':Number(_0x5d8e4d['query'][_0xf088('0x7e')][_0x3d6d90]),'VoiceQueueId':Number(_0x5d8e4d[_0xf088('0x4e')]['id'])});}}else{socket['emit'](_0xf088('0x99'),{'UserId':Number(_0x5d8e4d[_0xf088('0x3c')][_0xf088('0x7e')]),'VoiceQueueId':Number(_0x5d8e4d[_0xf088('0x4e')]['id'])});}});}})['then'](function(_0x16d6cc){return db[_0xf088('0x91')][_0xf088('0x29')]({'where':{'VoiceQueueId':_0x5d8e4d[_0xf088('0x4e')]['id'],'UserId':_0x5d8e4d['query']['ids']}})[_0xf088('0x28')](function(){return _0x16d6cc;});})[_0xf088('0x28')](respondWithStatusCode(_0x2429e4,null))[_0xf088('0x4d')](handleError(_0x2429e4,null));};exports[_0xf088('0x9a')]=function(_0x421b31,_0x20e9b7,_0x440fac){var _0xe0d955={};var _0x14f62d={};var _0x27cf33;var _0x4c829a;return db[_0xf088('0x4f')][_0xf088('0x60')]({'where':{'id':_0x421b31['params']['id']}})[_0xf088('0x28')](handleEntityNotFound(_0x20e9b7,null))[_0xf088('0x28')](function(_0x3e695c){if(_0x3e695c){_0x27cf33=_0x3e695c;_0x14f62d[_0xf088('0x3b')]=_[_0xf088('0x3d')](db[_0xf088('0x7f')][_0xf088('0x38')]);_0x14f62d[_0xf088('0x3c')]=_[_0xf088('0x3d')](_0x421b31[_0xf088('0x3c')]);_0x14f62d['filters']=_['intersection'](_0x14f62d[_0xf088('0x3b')],_0x14f62d['query']);_0xe0d955[_0xf088('0x40')]=_['intersection'](_0x14f62d[_0xf088('0x3b')],qs[_0xf088('0x41')](_0x421b31[_0xf088('0x3c')][_0xf088('0x41')]));_0xe0d955[_0xf088('0x40')]=_0xe0d955[_0xf088('0x40')]['length']?_0xe0d955[_0xf088('0x40')]:_0x14f62d[_0xf088('0x3b')];_0xe0d955['order']=qs[_0xf088('0x44')](_0x421b31[_0xf088('0x3c')][_0xf088('0x44')]);_0xe0d955[_0xf088('0x47')]=qs[_0xf088('0x3e')](_['pick'](_0x421b31[_0xf088('0x3c')],_0x14f62d[_0xf088('0x3e')]));if(_0x421b31[_0xf088('0x3c')]['filter']){_0xe0d955[_0xf088('0x47')]=_[_0xf088('0x46')](_0xe0d955[_0xf088('0x47')],{'$or':_[_0xf088('0x30')](_0xe0d955[_0xf088('0x40')],function(_0x4cfab9){var _0x5dc42f={};_0x5dc42f[_0x4cfab9]={'$like':'%'+_0x421b31[_0xf088('0x3c')][_0xf088('0x2e')]+'%'};return _0x5dc42f;})});}_0xe0d955=_[_0xf088('0x46')]({},_0xe0d955,_0x421b31['options']);return _0x27cf33[_0xf088('0x9a')](_0xe0d955);}})[_0xf088('0x28')](function(_0x3b3736){if(_0x3b3736){_0x4c829a=_0x3b3736[_0xf088('0x57')];if(!_0x421b31[_0xf088('0x3c')][_0xf088('0x42')]('nolimit')){_0xe0d955[_0xf088('0x20')]=qs[_0xf088('0x20')](_0x421b31['query'][_0xf088('0x20')]);_0xe0d955['offset']=qs[_0xf088('0x22')](_0x421b31[_0xf088('0x3c')][_0xf088('0x22')]);}return _0x27cf33[_0xf088('0x9a')](_0xe0d955);}})[_0xf088('0x28')](function(_0x1d8aa2){if(_0x1d8aa2){return _0x1d8aa2?{'count':_0x4c829a,'rows':_0x1d8aa2}:null;}})[_0xf088('0x28')](respondWithResult(_0x20e9b7,null))['catch'](handleError(_0x20e9b7,null));};exports['getMembers']=function(_0x17f624,_0x7172e6,_0x24706b){var _0xa77315={};var _0x41e78f={};var _0x50a4d8;var _0xe808c3;return db['VoiceQueue'][_0xf088('0x60')]({'where':{'id':_0x17f624[_0xf088('0x4e')]['id']}})[_0xf088('0x28')](handleEntityNotFound(_0x7172e6,null))[_0xf088('0x28')](function(_0x469724){if(_0x469724){_0x50a4d8=_0x469724;_0x41e78f[_0xf088('0x3b')]=_[_0xf088('0x3d')](db[_0xf088('0x91')][_0xf088('0x38')]);_0x41e78f[_0xf088('0x3c')]=_[_0xf088('0x3d')](_0x17f624[_0xf088('0x3c')]);_0x41e78f['filters']=_[_0xf088('0x3f')](_0x41e78f[_0xf088('0x3b')],_0x41e78f[_0xf088('0x3c')]);_0xa77315[_0xf088('0x40')]=_[_0xf088('0x3f')](_0x41e78f[_0xf088('0x3b')],qs[_0xf088('0x41')](_0x17f624[_0xf088('0x3c')][_0xf088('0x41')]));_0xa77315[_0xf088('0x40')]=_0xa77315[_0xf088('0x40')][_0xf088('0x57')]?_0xa77315['attributes']:_0x41e78f[_0xf088('0x3b')];_0xa77315['order']=qs['sort'](_0x17f624[_0xf088('0x3c')][_0xf088('0x44')]);_0xa77315[_0xf088('0x47')]=qs[_0xf088('0x3e')](_['pick'](_0x17f624[_0xf088('0x3c')],_0x41e78f[_0xf088('0x3e')]));if(_0x17f624[_0xf088('0x3c')][_0xf088('0x2e')]){_0xa77315['where']=_[_0xf088('0x46')](_0xa77315['where'],{'$or':_[_0xf088('0x30')](_0xa77315['attributes'],function(_0x545f3b){var _0x1962d6={};_0x1962d6[_0x545f3b]={'$like':'%'+_0x17f624[_0xf088('0x3c')]['filter']+'%'};return _0x1962d6;})});}_0xa77315=_[_0xf088('0x46')]({},_0xa77315,_0x17f624[_0xf088('0x48')]);return _0x50a4d8[_0xf088('0x9b')](_0xa77315);}})[_0xf088('0x28')](function(_0x593822){if(_0x593822){_0xe808c3=_0x593822['length'];if(!_0x17f624[_0xf088('0x3c')][_0xf088('0x42')](_0xf088('0x65'))){_0xa77315['limit']=qs[_0xf088('0x20')](_0x17f624[_0xf088('0x3c')][_0xf088('0x20')]);_0xa77315[_0xf088('0x22')]=qs['offset'](_0x17f624[_0xf088('0x3c')]['offset']);}return _0x50a4d8['getMembers'](_0xa77315);}})[_0xf088('0x28')](function(_0x307ff7){return _0x307ff7?{'count':_0xe808c3,'rows':_0x307ff7}:null;})[_0xf088('0x28')](respondWithResult(_0x7172e6,null))[_0xf088('0x4d')](handleError(_0x7172e6,null));};exports[_0xf088('0x9c')]=function(_0x62566d,_0x46c5c4,_0x2e4ed7){var _0x24b12d={};var _0x379626={};var _0x15a00d;var _0x3ce693;return db[_0xf088('0x4f')][_0xf088('0x60')]({'where':{'id':_0x62566d[_0xf088('0x4e')]['id']}})['then'](handleEntityNotFound(_0x46c5c4,null))[_0xf088('0x28')](function(_0x5bd651){if(_0x5bd651){_0x15a00d=_0x5bd651;_0x379626[_0xf088('0x3b')]=_['keys'](db['CmList'][_0xf088('0x38')]);_0x379626['query']=_[_0xf088('0x3d')](_0x62566d['query']);_0x379626[_0xf088('0x3e')]=_['intersection'](_0x379626[_0xf088('0x3b')],_0x379626[_0xf088('0x3c')]);_0x24b12d[_0xf088('0x40')]=_[_0xf088('0x3f')](_0x379626[_0xf088('0x3b')],qs[_0xf088('0x41')](_0x62566d[_0xf088('0x3c')][_0xf088('0x41')]));_0x24b12d[_0xf088('0x40')]=_0x24b12d[_0xf088('0x40')][_0xf088('0x57')]?_0x24b12d[_0xf088('0x40')]:_0x379626[_0xf088('0x3b')];_0x24b12d['order']=qs[_0xf088('0x44')](_0x62566d[_0xf088('0x3c')]['sort']);_0x24b12d[_0xf088('0x47')]=qs['filters'](_[_0xf088('0x45')](_0x62566d[_0xf088('0x3c')],_0x379626['filters']));if(_0x62566d['query'][_0xf088('0x2e')]){_0x24b12d['where']=_[_0xf088('0x46')](_0x24b12d[_0xf088('0x47')],{'$or':_[_0xf088('0x30')](_0x24b12d[_0xf088('0x40')],function(_0x41c2ed){var _0xdd7b5={};_0xdd7b5[_0x41c2ed]={'$like':'%'+_0x62566d['query'][_0xf088('0x2e')]+'%'};return _0xdd7b5;})});}_0x24b12d=_[_0xf088('0x46')]({},_0x24b12d,_0x62566d['options']);return _0x15a00d[_0xf088('0x9c')](_0x24b12d);}})[_0xf088('0x28')](function(_0x165226){if(_0x165226){_0x3ce693=_0x165226['length'];if(!_0x62566d[_0xf088('0x3c')][_0xf088('0x42')](_0xf088('0x65'))){_0x24b12d[_0xf088('0x20')]=qs[_0xf088('0x20')](_0x62566d[_0xf088('0x3c')][_0xf088('0x20')]);_0x24b12d[_0xf088('0x22')]=qs[_0xf088('0x22')](_0x62566d[_0xf088('0x3c')]['offset']);}return _0x15a00d[_0xf088('0x9c')](_0x24b12d);}})[_0xf088('0x28')](function(_0x253a73){if(_0x253a73){return _0x253a73?{'count':_0x3ce693,'rows':_0x253a73}:null;}})['then'](respondWithResult(_0x46c5c4,null))[_0xf088('0x4d')](handleError(_0x46c5c4,null));};exports[_0xf088('0x9d')]=function(_0x49464e,_0x2a51ff,_0x91c4e9){var _0x4939ad,_0x509338;return db[_0xf088('0x4f')][_0xf088('0x52')]({'where':{'id':_0x49464e[_0xf088('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2a51ff,null))['then'](function(_0x48d968){if(_0x48d968){_0x509338=_0x48d968;return _0x48d968[_0xf088('0x9d')](_0x49464e['body'][_0xf088('0x7e')],_[_0xf088('0x93')](_0x49464e['body'],[_0xf088('0x7e'),'id'])||{});}return null;})[_0xf088('0x94')](function(_0xc6bb03){var _0x39e9d1;_0x4939ad=_0xc6bb03||[];var _0x496fd3=[];if(_0xc6bb03){for(var _0x594b5c=0x0;_0x594b5c<_0xc6bb03['length'];_0x594b5c+=0x1){var _0x3d0f76=_0xc6bb03[_0x594b5c][_0xf088('0x2a')]({'plain':!![]});_0x509338[_0xf088('0x9e')]=_0x49464e[_0xf088('0x59')]['dialCheckDuplicateType']?_0x49464e[_0xf088('0x59')]['dialCheckDuplicateType']:_0x509338[_0xf088('0x9e')];switch(_0x509338[_0xf088('0x9e')]){case'always':_0x39e9d1=squel['insert']()['into'](_0xf088('0x9f'))[_0xf088('0xa0')]([_0xf088('0xa1'),_0xf088('0xa2'),_0xf088('0xa3'),_0xf088('0xa4'),'VoiceQueueId',_0xf088('0x5a'),_0xf088('0x58')],squel['select']()[_0xf088('0x80')](_0xf088('0xa1'),_0xf088('0xa1'))[_0xf088('0x80')](_0xf088('0xa5'),_0xf088('0xa2'))[_0xf088('0x80')]('id',_0xf088('0xa3'))[_0xf088('0x80')](_0x3d0f76[_0xf088('0xa6')][_0xf088('0x88')](),_0xf088('0xa4'))['field'](_0x49464e[_0xf088('0x4e')]['id']['toString'](),'VoiceQueueId')['field']('NOW()',_0xf088('0x5a'))[_0xf088('0x80')](_0xf088('0xa5'),_0xf088('0x58'))[_0xf088('0xa7')]('cm_contacts')[_0xf088('0x47')](_0xf088('0xa8'))[_0xf088('0x47')](_0xf088('0xa9'),_0x3d0f76['CmListId'][_0xf088('0x88')]())[_0xf088('0x47')](_0xf088('0xaa'))[_0xf088('0x47')]('phone\x20NOT\x20IN\x20(?)',squel[_0xf088('0xab')]()['field'](_0xf088('0xac'))['from'](_0xf088('0xad'))[_0xf088('0x47')](_0xf088('0x86'),_0x49464e['params']['id'][_0xf088('0x88')]()))[_0xf088('0x47')](_0xf088('0xae'),squel[_0xf088('0xab')]()[_0xf088('0x80')](_0xf088('0xaf'))[_0xf088('0xa7')](_0xf088('0x9f'))[_0xf088('0x47')]('VoiceQueueId\x20=\x20?',_0x49464e[_0xf088('0x4e')]['id'][_0xf088('0x88')]())))[_0xf088('0x88')]();break;case _0xf088('0xb0'):_0x39e9d1=squel['insert']()['into'](_0xf088('0x9f'))[_0xf088('0xa0')]([_0xf088('0xa1'),_0xf088('0xa2'),'ContactId',_0xf088('0xa4'),_0xf088('0x61'),_0xf088('0x5a'),'updatedAt'],squel['select']()['field'](_0xf088('0xa1'),_0xf088('0xa1'))[_0xf088('0x80')]('NOW()',_0xf088('0xa2'))[_0xf088('0x80')]('id',_0xf088('0xa3'))[_0xf088('0x80')](_0x3d0f76[_0xf088('0xa6')][_0xf088('0x88')](),_0xf088('0xa4'))[_0xf088('0x80')](_0x49464e[_0xf088('0x4e')]['id'][_0xf088('0x88')](),_0xf088('0x61'))[_0xf088('0x80')](_0xf088('0xa5'),_0xf088('0x5a'))[_0xf088('0x80')](_0xf088('0xa5'),_0xf088('0x58'))[_0xf088('0xa7')]('cm_contacts')[_0xf088('0x47')]('deletedAt\x20IS\x20NULL')[_0xf088('0x47')](_0xf088('0xa9'),_0x3d0f76[_0xf088('0xa6')][_0xf088('0x88')]())[_0xf088('0x47')](_0xf088('0xaa'))[_0xf088('0x47')]('phone\x20NOT\x20IN\x20(?)',squel[_0xf088('0xab')]()['field']('COALESCE(phone,\x27\x27)')['from'](_0xf088('0x9f'))[_0xf088('0x47')](_0xf088('0x86'),_0x49464e[_0xf088('0x4e')]['id'][_0xf088('0x88')]())))[_0xf088('0x88')]();break;default:_0x39e9d1=squel[_0xf088('0xb1')]()[_0xf088('0xb2')](_0xf088('0x9f'))[_0xf088('0xa0')]([_0xf088('0xa1'),_0xf088('0xa2'),_0xf088('0xa3'),_0xf088('0xa4'),_0xf088('0x61'),_0xf088('0x5a'),_0xf088('0x58')],squel['select']()['field']('phone',_0xf088('0xa1'))[_0xf088('0x80')](_0xf088('0xa5'),'scheduledAt')[_0xf088('0x80')]('id',_0xf088('0xa3'))[_0xf088('0x80')](_0x3d0f76[_0xf088('0xa6')][_0xf088('0x88')](),'ListId')['field'](_0x49464e['params']['id'][_0xf088('0x88')](),_0xf088('0x61'))['field'](_0xf088('0xa5'),_0xf088('0x5a'))[_0xf088('0x80')]('NOW()','updatedAt')[_0xf088('0xa7')](_0xf088('0xb3'))[_0xf088('0x47')]('deletedAt\x20IS\x20NULL')['where'](_0xf088('0xa9'),_0x3d0f76[_0xf088('0xa6')][_0xf088('0x88')]())['where'](_0xf088('0xaa')))[_0xf088('0x88')]();}_0x496fd3[_0xf088('0x87')](db['sequelize'][_0xf088('0x3c')](_0x39e9d1));}return BPromise[_0xf088('0x8e')](_0x496fd3);}})[_0xf088('0x28')](function(){return _0x4939ad;})[_0xf088('0x28')](respondWithResult(_0x2a51ff,null))[_0xf088('0x4d')](handleError(_0x2a51ff,null));};exports['removeLists']=function(_0xe83b5f,_0x261305,_0x2aa1aa){return db[_0xf088('0x4f')][_0xf088('0x52')]({'where':{'id':_0xe83b5f[_0xf088('0x4e')]['id']}})[_0xf088('0x28')](handleEntityNotFound(_0x261305,null))[_0xf088('0x28')](function(_0x2255ca){if(_0x2255ca){return _0x2255ca['removeLists'](_0xe83b5f[_0xf088('0x3c')][_0xf088('0x7e')]);}})['then'](function(_0x5cd1cb){if(_0x5cd1cb){return db[_0xf088('0x62')][_0xf088('0x29')]({'where':{'ListId':_0xe83b5f[_0xf088('0x3c')]['ids'],'VoiceQueueId':_0xe83b5f[_0xf088('0x4e')]['id']}})[_0xf088('0x28')](function(){return _0x5cd1cb;});}})['then'](respondWithStatusCode(_0x261305,null))[_0xf088('0x4d')](handleError(_0x261305,null));};exports[_0xf088('0xb4')]=function(_0x2017b8,_0x5ec918,_0x34c14){var _0x1690f3={};var _0x6deaff={};var _0x331480;var _0x48a9dd;return db['VoiceQueue']['findOne']({'where':{'id':_0x2017b8[_0xf088('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5ec918,null))['then'](function(_0xb7b038){if(_0xb7b038){_0x331480=_0xb7b038;_0x6deaff[_0xf088('0x3b')]=_[_0xf088('0x3d')](db[_0xf088('0xb5')][_0xf088('0x38')]);_0x6deaff[_0xf088('0x3c')]=_['keys'](_0x2017b8['query']);_0x6deaff['filters']=_[_0xf088('0x3f')](_0x6deaff[_0xf088('0x3b')],_0x6deaff[_0xf088('0x3c')]);_0x1690f3[_0xf088('0x40')]=_[_0xf088('0x3f')](_0x6deaff[_0xf088('0x3b')],qs[_0xf088('0x41')](_0x2017b8[_0xf088('0x3c')][_0xf088('0x41')]));_0x1690f3[_0xf088('0x40')]=_0x1690f3[_0xf088('0x40')][_0xf088('0x57')]?_0x1690f3[_0xf088('0x40')]:_0x6deaff['model'];_0x1690f3['order']=qs['sort'](_0x2017b8[_0xf088('0x3c')][_0xf088('0x44')]);_0x1690f3['where']=qs[_0xf088('0x3e')](_[_0xf088('0x45')](_0x2017b8[_0xf088('0x3c')],_0x6deaff[_0xf088('0x3e')]));if(_0x2017b8['query']['filter']){_0x1690f3[_0xf088('0x47')]=_[_0xf088('0x46')](_0x1690f3[_0xf088('0x47')],{'$or':_[_0xf088('0x30')](_0x1690f3['attributes'],function(_0x34bed6){var _0x525e20={};_0x525e20[_0x34bed6]={'$like':'%'+_0x2017b8['query'][_0xf088('0x2e')]+'%'};return _0x525e20;})});}_0x1690f3=_['merge']({},_0x1690f3,_0x2017b8[_0xf088('0x48')]);return _0x331480[_0xf088('0xb4')](_0x1690f3);}})[_0xf088('0x28')](function(_0x41e5b9){if(_0x41e5b9){_0x48a9dd=_0x41e5b9[_0xf088('0x57')];if(!_0x2017b8[_0xf088('0x3c')]['hasOwnProperty'](_0xf088('0x65'))){_0x1690f3['limit']=qs[_0xf088('0x20')](_0x2017b8['query']['limit']);_0x1690f3[_0xf088('0x22')]=qs[_0xf088('0x22')](_0x2017b8[_0xf088('0x3c')][_0xf088('0x22')]);}return _0x331480[_0xf088('0xb4')](_0x1690f3);}})[_0xf088('0x28')](function(_0x3c3dea){if(_0x3c3dea){return _0x3c3dea?{'count':_0x48a9dd,'rows':_0x3c3dea}:null;}})['then'](respondWithResult(_0x5ec918,null))[_0xf088('0x4d')](handleError(_0x5ec918,null));};exports[_0xf088('0xb6')]=function(_0x1a8055,_0x3a37cd,_0x54ce30){var _0x552478,_0x42fb88;return db[_0xf088('0x4f')][_0xf088('0x52')]({'where':{'id':_0x1a8055['params']['id']}})['then'](handleEntityNotFound(_0x3a37cd,null))['then'](function(_0x3bc86e){if(_0x3bc86e){_0x42fb88=_0x3bc86e;return _0x3bc86e['addBlackLists'](_0x1a8055[_0xf088('0x59')][_0xf088('0x7e')],_[_0xf088('0x93')](_0x1a8055['body'],[_0xf088('0x7e'),'id'])||{});}return null;})[_0xf088('0x94')](function(_0x32a17d){var _0x181e18;_0x552478=_0x32a17d||[];var _0x4657ba=[];if(_0x32a17d){for(var _0x310e58=0x0;_0x310e58<_0x32a17d['length'];_0x310e58+=0x1){var _0x2bc693=_0x32a17d[_0x310e58][_0xf088('0x2a')]({'plain':!![]});_0x181e18=squel['insert']()[_0xf088('0xb2')](_0xf088('0xb7'))['fromQuery']([_0xf088('0xa1'),_0xf088('0xa3'),_0xf088('0xa4'),_0xf088('0x61'),_0xf088('0x5a'),_0xf088('0x58')],squel['select']()[_0xf088('0x80')](_0xf088('0xa1'),_0xf088('0xa1'))[_0xf088('0x80')]('id',_0xf088('0xa3'))[_0xf088('0x80')](_0x2bc693['CmListId']['toString'](),_0xf088('0xa4'))[_0xf088('0x80')](_0x1a8055[_0xf088('0x4e')]['id']['toString'](),_0xf088('0x61'))['field'](_0xf088('0xa5'),_0xf088('0x5a'))['field'](_0xf088('0xa5'),_0xf088('0x58'))[_0xf088('0xa7')](_0xf088('0xb3'))[_0xf088('0x47')](_0xf088('0xa8'))['where'](_0xf088('0xa9'),_0x2bc693['CmListId'][_0xf088('0x88')]())[_0xf088('0x47')]('phone\x20IS\x20NOT\x20NULL'))[_0xf088('0x88')]();_0x4657ba[_0xf088('0x87')](db[_0xf088('0x73')][_0xf088('0x3c')](_0x181e18));}return BPromise[_0xf088('0x8e')](_0x4657ba);}})[_0xf088('0x28')](function(){return _0x552478;})[_0xf088('0x28')](respondWithResult(_0x3a37cd,null))[_0xf088('0x4d')](handleError(_0x3a37cd,null));};exports['removeBlackLists']=function(_0x2c8e2f,_0x5ba1f2,_0x3f5b52){return db[_0xf088('0x4f')][_0xf088('0x52')]({'where':{'id':_0x2c8e2f[_0xf088('0x4e')]['id']}})[_0xf088('0x28')](handleEntityNotFound(_0x5ba1f2,null))[_0xf088('0x28')](function(_0x2e77ac){if(_0x2e77ac){return _0x2e77ac[_0xf088('0xb8')](_0x2c8e2f[_0xf088('0x3c')]['ids']);}})[_0xf088('0x28')](function(_0x160ce2){if(_0x160ce2){return db[_0xf088('0x68')][_0xf088('0x29')]({'where':{'ListId':_0x2c8e2f['query'][_0xf088('0x7e')],'VoiceQueueId':_0x2c8e2f[_0xf088('0x4e')]['id']}})[_0xf088('0x28')](function(){return _0x160ce2;});}})[_0xf088('0x28')](respondWithStatusCode(_0x5ba1f2,null))[_0xf088('0x4d')](handleError(_0x5ba1f2,null));}; \ No newline at end of file +var _0x1524=['findOrCreate','UserVoiceQueueRt','interface','format','SIP/%s','ids','select','tq.TeamId','from','team_has_voice_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','SELECT','every','TeamId','union','isEmpty','emit','userVoiceQueue:remove','addAgents','removeAgents','isArray','getAgents','getMembers','getLists','addLists','spread','dialCheckDuplicateType','insert','into','cm_hopper','phone','ListId','NOW()','field','ContactId','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','fromQuery','scheduledAt','phone\x20IS\x20NOT\x20NULL','all','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','util','path','fs-extra','crypto','desk.js','to-csv','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','end','undefined','count','limit','set','json','apply','reject','save','update','then','destroy','get','VoiceQueues','QueueCampaigns','filter','ignore','map','value','includes','find','type','UserProfileResource','error','stack','name','send','index','VoiceQueue','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','merge','options','includeAll','rows','catch','show','params','include','create','user','role','inbound','outbound','userProfileId','clone','omit','createdAt','updatedAt','body','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','CmHopper','VoiceQueueId','findAll','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','teams','User','Agents','online','voicePause','flatMap','forEach','penalty','transaction','addTeams','each','upsert','UserVoiceQueue'];(function(_0x127c7b,_0x1f65e7){var _0x1708eb=function(_0x2033e5){while(--_0x2033e5){_0x127c7b['push'](_0x127c7b['shift']());}};_0x1708eb(++_0x1f65e7);}(_0x1524,0xea));var _0x4152=function(_0x57fd0d,_0x2630ea){_0x57fd0d=_0x57fd0d-0x0;var _0x4b57f6=_0x1524[_0x57fd0d];return _0x4b57f6;};'use strict';var emlformat=require(_0x4152('0x0'));var rimraf=require(_0x4152('0x1'));var zipdir=require(_0x4152('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4152('0x3'));var path=require(_0x4152('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4152('0x5'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x4152('0x6'));var jsforce=require('jsforce');var deskjs=require(_0x4152('0x7'));var toCsv=require(_0x4152('0x8'));var querystring=require(_0x4152('0x9'));var Papa=require('papaparse');var Redis=require(_0x4152('0xa'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4152('0xb'));var logger=require(_0x4152('0xc'))(_0x4152('0xd'));var utils=require(_0x4152('0xe'));var config=require(_0x4152('0xf'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x4152('0x10')]=_['defaults'](config[_0x4152('0x10')],{'host':_0x4152('0x11'),'port':0x18eb});var socket=require(_0x4152('0x12'))(new Redis(config[_0x4152('0x10')]));require(_0x4152('0x13'))[_0x4152('0x14')](socket);function respondWithStatusCode(_0x1e6128,_0xd11ed5){_0xd11ed5=_0xd11ed5||0xcc;return function(_0x47f557){if(_0x47f557){return _0x1e6128[_0x4152('0x15')](_0xd11ed5);}return _0x1e6128[_0x4152('0x16')](_0xd11ed5)[_0x4152('0x17')]();};}function respondWithResult(_0x551309,_0x25d49e){_0x25d49e=_0x25d49e||0xc8;return function(_0x12af35){if(_0x12af35){return _0x551309['status'](_0x25d49e)['json'](_0x12af35);}};}function respondWithFilteredResult(_0x218ef0,_0x2aedba){return function(_0x1f0b8f){if(_0x1f0b8f){var _0x25746e=typeof _0x2aedba['offset']===_0x4152('0x18')&&typeof _0x2aedba['limit']===_0x4152('0x18');var _0x502180=_0x1f0b8f[_0x4152('0x19')];var _0x1f7de2=_0x25746e?0x0:_0x2aedba['offset'];var _0x3813b0=_0x25746e?_0x1f0b8f['count']:_0x2aedba['offset']+_0x2aedba[_0x4152('0x1a')];var _0x4fcb27;if(_0x3813b0>=_0x502180){_0x3813b0=_0x502180;_0x4fcb27=0xc8;}else{_0x4fcb27=0xce;}_0x218ef0[_0x4152('0x16')](_0x4fcb27);return _0x218ef0[_0x4152('0x1b')]('Content-Range',_0x1f7de2+'-'+_0x3813b0+'/'+_0x502180)[_0x4152('0x1c')](_0x1f0b8f);}return null;};}function patchUpdates(_0xe50046){return function(_0x2c54fa){try{jsonpatch[_0x4152('0x1d')](_0x2c54fa,_0xe50046,!![]);}catch(_0x137bb0){return BPromise[_0x4152('0x1e')](_0x137bb0);}return _0x2c54fa[_0x4152('0x1f')]();};}function saveUpdates(_0x5073e3,_0x2ddabc){return function(_0x5e17cb){if(_0x5e17cb){return _0x5e17cb[_0x4152('0x20')](_0x5073e3)[_0x4152('0x21')](function(_0x519972){return _0x519972;});}return null;};}function removeEntity(_0x2eb75a,_0x3e4859){return function(_0x537cee){if(_0x537cee){return _0x537cee[_0x4152('0x22')]()[_0x4152('0x21')](function(){var _0x37998a=_0x537cee[_0x4152('0x23')]({'plain':!![]});var _0x18d979=[{'name':_0x4152('0x24'),'value':'inbound','ignore':![]},{'name':_0x4152('0x25'),'value':'outbound','ignore':![]}];var _0x17cd88=_(_0x18d979)[_0x4152('0x26')](_0x4152('0x27'))[_0x4152('0x28')](_0x4152('0x29'))[_0x4152('0x29')]();if(_[_0x4152('0x2a')](_0x17cd88,_0x37998a['type'])){return;}var _0x19f7a5=_[_0x4152('0x2b')](_0x18d979,['value',_0x37998a[_0x4152('0x2c')]])['name'];return db[_0x4152('0x2d')][_0x4152('0x22')]({'where':{'type':_0x19f7a5,'resourceId':_0x37998a['id']}})[_0x4152('0x21')](function(){return _0x537cee;});})[_0x4152('0x21')](function(){_0x2eb75a[_0x4152('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31f3ee,_0x3d8078){return function(_0x33893b){if(!_0x33893b){_0x31f3ee[_0x4152('0x15')](0x194);}return _0x33893b;};}function handleError(_0x201b2f,_0x42de0e){_0x42de0e=_0x42de0e||0x1f4;return function(_0x19e828){logger[_0x4152('0x2e')](_0x19e828[_0x4152('0x2f')]);if(_0x19e828[_0x4152('0x30')]){delete _0x19e828['name'];}_0x201b2f[_0x4152('0x16')](_0x42de0e)[_0x4152('0x31')](_0x19e828);};}exports[_0x4152('0x32')]=function(_0x410a19,_0x55d04e){var _0x496a49={},_0x22911d={},_0x3a95b1={'count':0x0,'rows':[]};var _0x5d371c=_['map'](db[_0x4152('0x33')][_0x4152('0x34')],function(_0x3dd596){return{'name':_0x3dd596[_0x4152('0x35')],'type':_0x3dd596[_0x4152('0x2c')][_0x4152('0x36')]};});_0x22911d[_0x4152('0x37')]=_[_0x4152('0x28')](_0x5d371c,_0x4152('0x30'));_0x22911d[_0x4152('0x38')]=_[_0x4152('0x39')](_0x410a19[_0x4152('0x38')]);_0x22911d['filters']=_['intersection'](_0x22911d['model'],_0x22911d[_0x4152('0x38')]);_0x496a49[_0x4152('0x3a')]=_[_0x4152('0x3b')](_0x22911d[_0x4152('0x37')],qs[_0x4152('0x3c')](_0x410a19[_0x4152('0x38')][_0x4152('0x3c')]));_0x496a49[_0x4152('0x3a')]=_0x496a49['attributes'][_0x4152('0x3d')]?_0x496a49[_0x4152('0x3a')]:_0x22911d['model'];if(!_0x410a19[_0x4152('0x38')][_0x4152('0x3e')](_0x4152('0x3f'))){_0x496a49[_0x4152('0x1a')]=qs[_0x4152('0x1a')](_0x410a19[_0x4152('0x38')][_0x4152('0x1a')]);_0x496a49[_0x4152('0x40')]=qs[_0x4152('0x40')](_0x410a19[_0x4152('0x38')][_0x4152('0x40')]);}_0x496a49[_0x4152('0x41')]=qs[_0x4152('0x42')](_0x410a19[_0x4152('0x38')][_0x4152('0x42')]);_0x496a49[_0x4152('0x43')]=qs[_0x4152('0x44')](_[_0x4152('0x45')](_0x410a19[_0x4152('0x38')],_0x22911d[_0x4152('0x44')]),_0x5d371c);if(_0x410a19[_0x4152('0x38')][_0x4152('0x26')]){_0x496a49[_0x4152('0x43')]=_[_0x4152('0x46')](_0x496a49[_0x4152('0x43')],{'$or':_[_0x4152('0x28')](_0x5d371c,function(_0x2b801a){if(_0x2b801a[_0x4152('0x2c')]!=='VIRTUAL'){var _0x4cecc0={};_0x4cecc0[_0x2b801a[_0x4152('0x30')]]={'$like':'%'+_0x410a19[_0x4152('0x38')][_0x4152('0x26')]+'%'};return _0x4cecc0;}})});}_0x496a49=_[_0x4152('0x46')]({},_0x496a49,_0x410a19[_0x4152('0x47')]);var _0x18c5b9={'where':_0x496a49[_0x4152('0x43')]};return db[_0x4152('0x33')][_0x4152('0x19')](_0x18c5b9)['then'](function(_0x1f2769){_0x3a95b1[_0x4152('0x19')]=_0x1f2769;if(_0x410a19[_0x4152('0x38')][_0x4152('0x48')]){_0x496a49['include']=[{'all':!![]}];}return db[_0x4152('0x33')]['findAll'](_0x496a49);})[_0x4152('0x21')](function(_0x56d625){_0x3a95b1[_0x4152('0x49')]=_0x56d625;return _0x3a95b1;})['then'](respondWithFilteredResult(_0x55d04e,_0x496a49))[_0x4152('0x4a')](handleError(_0x55d04e,null));};exports[_0x4152('0x4b')]=function(_0xed8ab0,_0x1de6c3){var _0x87cd07={'raw':![],'where':{'id':_0xed8ab0[_0x4152('0x4c')]['id']}},_0x749c0c={};_0x749c0c['model']=_['keys'](db['VoiceQueue'][_0x4152('0x34')]);_0x749c0c[_0x4152('0x38')]=_[_0x4152('0x39')](_0xed8ab0['query']);_0x749c0c[_0x4152('0x44')]=_['intersection'](_0x749c0c[_0x4152('0x37')],_0x749c0c['query']);_0x87cd07['attributes']=_[_0x4152('0x3b')](_0x749c0c[_0x4152('0x37')],qs['fields'](_0xed8ab0['query'][_0x4152('0x3c')]));_0x87cd07[_0x4152('0x3a')]=_0x87cd07[_0x4152('0x3a')][_0x4152('0x3d')]?_0x87cd07[_0x4152('0x3a')]:_0x749c0c['model'];if(_0xed8ab0[_0x4152('0x38')][_0x4152('0x48')]){_0x87cd07[_0x4152('0x4d')]=[{'all':!![]}];}_0x87cd07=_[_0x4152('0x46')]({},_0x87cd07,_0xed8ab0[_0x4152('0x47')]);return db[_0x4152('0x33')]['find'](_0x87cd07)['then'](handleEntityNotFound(_0x1de6c3,null))[_0x4152('0x21')](respondWithResult(_0x1de6c3,null))['catch'](handleError(_0x1de6c3,null));};exports['create']=function(_0xca3087,_0x14015e){return db[_0x4152('0x33')][_0x4152('0x4e')](_0xca3087['body'],{})[_0x4152('0x21')](function(_0x288874){var _0x2a2d68=_0xca3087[_0x4152('0x4f')][_0x4152('0x23')]({'plain':!![]});if(!_0x2a2d68)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2a2d68[_0x4152('0x50')]===_0x4152('0x4f')){var _0x16d620=_0x288874['get']({'plain':!![]});var _0x38f782=[{'name':_0x4152('0x24'),'value':_0x4152('0x51')},{'name':_0x4152('0x25'),'value':_0x4152('0x52')}];var _0x2ecd3b=_[_0x4152('0x2b')](_0x38f782,[_0x4152('0x29'),_0x16d620['type']])[_0x4152('0x30')];return db['UserProfileSection']['find']({'where':{'name':_0x2ecd3b,'userProfileId':_0x2a2d68[_0x4152('0x53')]},'raw':!![]})[_0x4152('0x21')](function(_0x936b57){if(_0x936b57&&_0x936b57['autoAssociation']===0x0){return db['UserProfileResource'][_0x4152('0x4e')]({'name':_0x16d620[_0x4152('0x30')],'resourceId':_0x16d620['id'],'type':_0x936b57['name'],'sectionId':_0x936b57['id']},{})[_0x4152('0x21')](function(){return _0x288874;});}else{return _0x288874;}})['catch'](function(_0x1c5c03){logger[_0x4152('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1c5c03);throw _0x1c5c03;});}return _0x288874;})['then'](respondWithResult(_0x14015e,0xc9))[_0x4152('0x4a')](handleError(_0x14015e,null));};exports[_0x4152('0x54')]=function(_0x103d8e,_0x2051c2){var _0x376a96={'where':{'id':_0x103d8e[_0x4152('0x4c')]['id']}},_0x3a6248={};_0x3a6248[_0x4152('0x37')]=_[_0x4152('0x39')](db[_0x4152('0x33')][_0x4152('0x34')]);_0x376a96[_0x4152('0x3a')]=_[_0x4152('0x3b')](_0x3a6248['model'],qs[_0x4152('0x3c')](_0x103d8e['query'][_0x4152('0x3c')]));_0x376a96['attributes']=_0x376a96[_0x4152('0x3a')][_0x4152('0x3d')]?_0x376a96[_0x4152('0x3a')]:_0x3a6248[_0x4152('0x37')];if(_0x103d8e['query']['includeAll']){_0x376a96[_0x4152('0x4d')]=[{'all':!![]}];}_0x376a96=_[_0x4152('0x46')]({},_0x376a96,_0x103d8e[_0x4152('0x47')]);return db[_0x4152('0x33')][_0x4152('0x2b')](_0x376a96)[_0x4152('0x21')](handleEntityNotFound(_0x2051c2,null))[_0x4152('0x21')](function(_0x54d552){if(_0x54d552){var _0x28c584=_0x54d552[_0x4152('0x23')]({'plain':!![]});_0x28c584=qs[_0x4152('0x55')](_0x28c584,['id',_0x4152('0x56'),_0x4152('0x57')]);_0x103d8e['body']=_['omit'](_0x103d8e['body'],['id',_0x4152('0x56'),_0x4152('0x57')]);return db[_0x4152('0x33')][_0x4152('0x4e')](_[_0x4152('0x46')](_0x28c584,_0x103d8e[_0x4152('0x58')]),{'include':_0x103d8e[_0x4152('0x38')][_0x4152('0x48')]?[{'all':!![]}]:undefined})[_0x4152('0x21')](function(_0x53cc0e){var _0x271acd=_0x103d8e[_0x4152('0x4f')][_0x4152('0x23')]({'plain':!![]});if(!_0x271acd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x271acd[_0x4152('0x50')]===_0x4152('0x4f')){var _0x10a031=_0x53cc0e[_0x4152('0x23')]({'plain':!![]});var _0x4ae16f=[{'name':'VoiceQueues','value':_0x4152('0x51')},{'name':'QueueCampaigns','value':_0x4152('0x52')}];var _0x13976e=_[_0x4152('0x2b')](_0x4ae16f,[_0x4152('0x29'),_0x10a031[_0x4152('0x2c')]])[_0x4152('0x30')];return db['UserProfileSection'][_0x4152('0x2b')]({'where':{'name':_0x13976e,'userProfileId':_0x271acd[_0x4152('0x53')]},'raw':!![]})[_0x4152('0x21')](function(_0x12779d){if(_0x12779d&&_0x12779d[_0x4152('0x59')]===0x0){return db[_0x4152('0x2d')]['create']({'name':_0x10a031[_0x4152('0x30')],'resourceId':_0x10a031['id'],'type':_0x12779d[_0x4152('0x30')],'sectionId':_0x12779d['id']},{})[_0x4152('0x21')](function(){return _0x53cc0e;});}else{return _0x53cc0e;}})[_0x4152('0x4a')](function(_0x19ad67){logger['error'](_0x4152('0x5a'),_0x19ad67);throw _0x19ad67;});}return _0x53cc0e;});}})[_0x4152('0x21')](respondWithResult(_0x2051c2,0xc9))[_0x4152('0x4a')](handleError(_0x2051c2,null));};exports[_0x4152('0x20')]=function(_0x5c50c0,_0xb684dc){if(_0x5c50c0['body']['id']){delete _0x5c50c0[_0x4152('0x58')]['id'];}return db[_0x4152('0x33')][_0x4152('0x2b')]({'where':{'id':_0x5c50c0[_0x4152('0x4c')]['id']}})[_0x4152('0x21')](handleEntityNotFound(_0xb684dc,null))[_0x4152('0x21')](saveUpdates(_0x5c50c0[_0x4152('0x58')],null))['then'](respondWithResult(_0xb684dc,null))[_0x4152('0x4a')](handleError(_0xb684dc,null));};exports[_0x4152('0x22')]=function(_0x1c2551,_0x171de4){return db[_0x4152('0x33')][_0x4152('0x2b')]({'where':{'id':_0x1c2551[_0x4152('0x4c')]['id']}})[_0x4152('0x21')](handleEntityNotFound(_0x171de4,null))[_0x4152('0x21')](removeEntity(_0x171de4,null))[_0x4152('0x4a')](handleError(_0x171de4,null));};exports['getHoppers']=function(_0x5eec07,_0x2f3dc5,_0x16fb5b){var _0x3c5916={'raw':![],'where':{}};var _0x4ddcea={};var _0x1bc525={'count':0x0,'rows':[]};return db[_0x4152('0x33')][_0x4152('0x5b')]({'where':{'id':_0x5eec07[_0x4152('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2f3dc5,null))[_0x4152('0x21')](function(_0x208a1c){if(_0x208a1c){_0x4ddcea[_0x4152('0x37')]=_[_0x4152('0x39')](db[_0x4152('0x5c')][_0x4152('0x34')]);_0x4ddcea[_0x4152('0x38')]=_[_0x4152('0x39')](_0x5eec07['query']);_0x4ddcea[_0x4152('0x44')]=_[_0x4152('0x3b')](_0x4ddcea[_0x4152('0x37')],_0x4ddcea[_0x4152('0x38')]);_0x3c5916[_0x4152('0x3a')]=_[_0x4152('0x3b')](_0x4ddcea[_0x4152('0x37')],qs['fields'](_0x5eec07[_0x4152('0x38')]['fields']));_0x3c5916[_0x4152('0x3a')]=_0x3c5916['attributes']['length']?_0x3c5916[_0x4152('0x3a')]:_0x4ddcea[_0x4152('0x37')];if(!_0x5eec07['query'][_0x4152('0x3e')](_0x4152('0x3f'))){_0x3c5916['limit']=qs['limit'](_0x5eec07['query'][_0x4152('0x1a')]);_0x3c5916['offset']=qs['offset'](_0x5eec07[_0x4152('0x38')][_0x4152('0x40')]);}_0x3c5916[_0x4152('0x41')]=qs[_0x4152('0x42')](_0x5eec07[_0x4152('0x38')][_0x4152('0x42')]);_0x3c5916[_0x4152('0x43')]=qs[_0x4152('0x44')](_['pick'](_0x5eec07[_0x4152('0x38')],_0x4ddcea[_0x4152('0x44')]));_0x3c5916['where'][_0x4152('0x5d')]=_0x208a1c['id'];if(_0x5eec07[_0x4152('0x38')][_0x4152('0x26')]){_0x3c5916[_0x4152('0x43')]=_[_0x4152('0x46')](_0x3c5916['where'],{'$or':_[_0x4152('0x28')](_0x3c5916[_0x4152('0x3a')],function(_0x450665){var _0x10846c={};_0x10846c[_0x450665]={'$like':'%'+_0x5eec07[_0x4152('0x38')]['filter']+'%'};return _0x10846c;})});}_0x3c5916=_[_0x4152('0x46')]({},_0x3c5916,_0x5eec07['options']);return db[_0x4152('0x5c')][_0x4152('0x19')]({'where':_0x3c5916['where']})['then'](function(_0x423c62){_0x1bc525['count']=_0x423c62;if(_0x5eec07[_0x4152('0x38')]['includeAll']){_0x3c5916[_0x4152('0x4d')]=[{'all':!![]}];}return db[_0x4152('0x5c')][_0x4152('0x5e')](_0x3c5916);})[_0x4152('0x21')](function(_0x22a114){_0x1bc525[_0x4152('0x49')]=_0x22a114;return _0x1bc525;});}})['then'](respondWithFilteredResult(_0x2f3dc5,_0x3c5916))[_0x4152('0x4a')](handleError(_0x2f3dc5,null));};exports[_0x4152('0x5f')]=function(_0x2891dc,_0x67cacc,_0x293816){var _0x3b36e2={'raw':!![],'where':{}};var _0x5c4ba8={};var _0x23f82f={'count':0x0,'rows':[]};return db[_0x4152('0x33')][_0x4152('0x5b')]({'where':{'id':_0x2891dc[_0x4152('0x4c')]['id']}})['then'](handleEntityNotFound(_0x67cacc,null))[_0x4152('0x21')](function(_0x50bc12){if(_0x50bc12){_0x5c4ba8[_0x4152('0x37')]=_[_0x4152('0x39')](db[_0x4152('0x60')][_0x4152('0x34')]);_0x5c4ba8[_0x4152('0x38')]=_['keys'](_0x2891dc[_0x4152('0x38')]);_0x5c4ba8[_0x4152('0x44')]=_[_0x4152('0x3b')](_0x5c4ba8[_0x4152('0x37')],_0x5c4ba8[_0x4152('0x38')]);_0x3b36e2['attributes']=_['intersection'](_0x5c4ba8[_0x4152('0x37')],qs['fields'](_0x2891dc[_0x4152('0x38')][_0x4152('0x3c')]));_0x3b36e2[_0x4152('0x3a')]=_0x3b36e2['attributes'][_0x4152('0x3d')]?_0x3b36e2[_0x4152('0x3a')]:_0x5c4ba8[_0x4152('0x37')];if(!_0x2891dc['query'][_0x4152('0x3e')](_0x4152('0x3f'))){_0x3b36e2[_0x4152('0x1a')]=qs['limit'](_0x2891dc[_0x4152('0x38')]['limit']);_0x3b36e2[_0x4152('0x40')]=qs[_0x4152('0x40')](_0x2891dc['query']['offset']);}_0x3b36e2[_0x4152('0x41')]=qs[_0x4152('0x42')](_0x2891dc[_0x4152('0x38')][_0x4152('0x42')]);_0x3b36e2[_0x4152('0x43')]=qs[_0x4152('0x44')](_[_0x4152('0x45')](_0x2891dc['query'],_0x5c4ba8[_0x4152('0x44')]));_0x3b36e2[_0x4152('0x43')][_0x4152('0x5d')]=_0x50bc12['id'];if(_0x2891dc[_0x4152('0x38')][_0x4152('0x26')]){_0x3b36e2[_0x4152('0x43')]=_['merge'](_0x3b36e2['where'],{'$or':_['map'](_0x3b36e2[_0x4152('0x3a')],function(_0x2bc5b7){var _0x223688={};_0x223688[_0x2bc5b7]={'$like':'%'+_0x2891dc[_0x4152('0x38')][_0x4152('0x26')]+'%'};return _0x223688;})});}_0x3b36e2=_[_0x4152('0x46')]({},_0x3b36e2,_0x2891dc['options']);return db['CmHopperHistory'][_0x4152('0x19')]({'where':_0x3b36e2[_0x4152('0x43')]})['then'](function(_0x3e1447){_0x23f82f[_0x4152('0x19')]=_0x3e1447;if(_0x2891dc[_0x4152('0x38')][_0x4152('0x48')]){_0x3b36e2[_0x4152('0x4d')]=[{'all':!![]}];}return db[_0x4152('0x60')]['findAll'](_0x3b36e2);})[_0x4152('0x21')](function(_0x5559e7){_0x23f82f[_0x4152('0x49')]=_0x5559e7;return _0x23f82f;});}})[_0x4152('0x21')](respondWithFilteredResult(_0x67cacc,_0x3b36e2))[_0x4152('0x4a')](handleError(_0x67cacc,null));};exports[_0x4152('0x61')]=function(_0xfa2bfd,_0x217607,_0x1753f0){var _0x2289ee={'raw':!![],'where':{}};var _0x3fa9a6={};var _0x138b61={'count':0x0,'rows':[]};return db[_0x4152('0x33')][_0x4152('0x5b')]({'where':{'id':_0xfa2bfd[_0x4152('0x4c')]['id']}})[_0x4152('0x21')](handleEntityNotFound(_0x217607,null))['then'](function(_0x36c8dd){if(_0x36c8dd){_0x3fa9a6[_0x4152('0x37')]=_[_0x4152('0x39')](db['CmHopperFinal'][_0x4152('0x34')]);_0x3fa9a6[_0x4152('0x38')]=_['keys'](_0xfa2bfd[_0x4152('0x38')]);_0x3fa9a6[_0x4152('0x44')]=_[_0x4152('0x3b')](_0x3fa9a6[_0x4152('0x37')],_0x3fa9a6['query']);_0x2289ee['attributes']=_['intersection'](_0x3fa9a6[_0x4152('0x37')],qs[_0x4152('0x3c')](_0xfa2bfd[_0x4152('0x38')][_0x4152('0x3c')]));_0x2289ee[_0x4152('0x3a')]=_0x2289ee[_0x4152('0x3a')][_0x4152('0x3d')]?_0x2289ee[_0x4152('0x3a')]:_0x3fa9a6[_0x4152('0x37')];if(!_0xfa2bfd[_0x4152('0x38')]['hasOwnProperty'](_0x4152('0x3f'))){_0x2289ee[_0x4152('0x1a')]=qs[_0x4152('0x1a')](_0xfa2bfd[_0x4152('0x38')][_0x4152('0x1a')]);_0x2289ee[_0x4152('0x40')]=qs['offset'](_0xfa2bfd[_0x4152('0x38')][_0x4152('0x40')]);}_0x2289ee['order']=qs['sort'](_0xfa2bfd[_0x4152('0x38')][_0x4152('0x42')]);_0x2289ee[_0x4152('0x43')]=qs['filters'](_[_0x4152('0x45')](_0xfa2bfd['query'],_0x3fa9a6[_0x4152('0x44')]));_0x2289ee[_0x4152('0x43')][_0x4152('0x5d')]=_0x36c8dd['id'];if(_0xfa2bfd['query'][_0x4152('0x26')]){_0x2289ee[_0x4152('0x43')]=_[_0x4152('0x46')](_0x2289ee['where'],{'$or':_[_0x4152('0x28')](_0x2289ee['attributes'],function(_0x28546e){var _0x130433={};_0x130433[_0x28546e]={'$like':'%'+_0xfa2bfd[_0x4152('0x38')][_0x4152('0x26')]+'%'};return _0x130433;})});}_0x2289ee=_[_0x4152('0x46')]({},_0x2289ee,_0xfa2bfd['options']);return db[_0x4152('0x62')][_0x4152('0x19')]({'where':_0x2289ee[_0x4152('0x43')]})[_0x4152('0x21')](function(_0x1b0bd4){_0x138b61['count']=_0x1b0bd4;if(_0xfa2bfd[_0x4152('0x38')][_0x4152('0x48')]){_0x2289ee[_0x4152('0x4d')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x4152('0x5e')](_0x2289ee);})[_0x4152('0x21')](function(_0x216317){_0x138b61[_0x4152('0x49')]=_0x216317;return _0x138b61;});}})[_0x4152('0x21')](respondWithFilteredResult(_0x217607,_0x2289ee))[_0x4152('0x4a')](handleError(_0x217607,null));};exports[_0x4152('0x63')]=function(_0x5e655a,_0x6bf34c,_0xd7f442){var _0x4b1e40={'raw':!![],'where':{}};var _0x49081a={};var _0x4a232b={'count':0x0,'rows':[]};return db[_0x4152('0x33')]['findOne']({'where':{'id':_0x5e655a[_0x4152('0x4c')]['id']}})[_0x4152('0x21')](handleEntityNotFound(_0x6bf34c,null))['then'](function(_0x221d8c){if(_0x221d8c){_0x49081a[_0x4152('0x37')]=_[_0x4152('0x39')](db[_0x4152('0x64')][_0x4152('0x34')]);_0x49081a[_0x4152('0x38')]=_['keys'](_0x5e655a[_0x4152('0x38')]);_0x49081a[_0x4152('0x44')]=_[_0x4152('0x3b')](_0x49081a[_0x4152('0x37')],_0x49081a[_0x4152('0x38')]);_0x4b1e40[_0x4152('0x3a')]=_[_0x4152('0x3b')](_0x49081a[_0x4152('0x37')],qs[_0x4152('0x3c')](_0x5e655a[_0x4152('0x38')][_0x4152('0x3c')]));_0x4b1e40[_0x4152('0x3a')]=_0x4b1e40[_0x4152('0x3a')]['length']?_0x4b1e40[_0x4152('0x3a')]:_0x49081a[_0x4152('0x37')];if(!_0x5e655a['query'][_0x4152('0x3e')](_0x4152('0x3f'))){_0x4b1e40[_0x4152('0x1a')]=qs[_0x4152('0x1a')](_0x5e655a['query']['limit']);_0x4b1e40['offset']=qs[_0x4152('0x40')](_0x5e655a[_0x4152('0x38')][_0x4152('0x40')]);}_0x4b1e40['order']=qs['sort'](_0x5e655a[_0x4152('0x38')][_0x4152('0x42')]);_0x4b1e40[_0x4152('0x43')]=qs[_0x4152('0x44')](_['pick'](_0x5e655a[_0x4152('0x38')],_0x49081a[_0x4152('0x44')]));_0x4b1e40['where']['VoiceQueueId']=_0x221d8c['id'];if(_0x5e655a[_0x4152('0x38')][_0x4152('0x26')]){_0x4b1e40[_0x4152('0x43')]=_['merge'](_0x4b1e40['where'],{'$or':_[_0x4152('0x28')](_0x4b1e40[_0x4152('0x3a')],function(_0x3b6633){var _0x475664={};_0x475664[_0x3b6633]={'$like':'%'+_0x5e655a[_0x4152('0x38')][_0x4152('0x26')]+'%'};return _0x475664;})});}_0x4b1e40=_[_0x4152('0x46')]({},_0x4b1e40,_0x5e655a['options']);return db[_0x4152('0x64')][_0x4152('0x19')]({'where':_0x4b1e40[_0x4152('0x43')]})[_0x4152('0x21')](function(_0x1a34e2){_0x4a232b[_0x4152('0x19')]=_0x1a34e2;if(_0x5e655a[_0x4152('0x38')][_0x4152('0x48')]){_0x4b1e40[_0x4152('0x4d')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x4152('0x5e')](_0x4b1e40);})['then'](function(_0x1ddef2){_0x4a232b['rows']=_0x1ddef2;return _0x4a232b;});}})['then'](respondWithFilteredResult(_0x6bf34c,_0x4b1e40))[_0x4152('0x4a')](handleError(_0x6bf34c,null));};exports[_0x4152('0x65')]=function(_0x5467f6,_0x5273d6,_0xddb82c){var _0x5ee0b6={};var _0x33c5c1={};var _0x50240d;var _0x10043f;return db[_0x4152('0x33')][_0x4152('0x5b')]({'where':{'id':_0x5467f6[_0x4152('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5273d6,null))[_0x4152('0x21')](function(_0xdd9caf){if(_0xdd9caf){_0x50240d=_0xdd9caf;_0x33c5c1[_0x4152('0x37')]=_[_0x4152('0x39')](db[_0x4152('0x66')][_0x4152('0x34')]);_0x33c5c1[_0x4152('0x38')]=_['keys'](_0x5467f6[_0x4152('0x38')]);_0x33c5c1[_0x4152('0x44')]=_['intersection'](_0x33c5c1['model'],_0x33c5c1[_0x4152('0x38')]);_0x5ee0b6[_0x4152('0x3a')]=_[_0x4152('0x3b')](_0x33c5c1['model'],qs[_0x4152('0x3c')](_0x5467f6[_0x4152('0x38')][_0x4152('0x3c')]));_0x5ee0b6[_0x4152('0x3a')]=_0x5ee0b6[_0x4152('0x3a')][_0x4152('0x3d')]?_0x5ee0b6[_0x4152('0x3a')]:_0x33c5c1[_0x4152('0x37')];_0x5ee0b6['order']=qs[_0x4152('0x42')](_0x5467f6['query'][_0x4152('0x42')]);_0x5ee0b6[_0x4152('0x43')]=qs['filters'](_[_0x4152('0x45')](_0x5467f6[_0x4152('0x38')],_0x33c5c1['filters']));if(_0x5467f6[_0x4152('0x38')]['filter']){_0x5ee0b6[_0x4152('0x43')]=_[_0x4152('0x46')](_0x5ee0b6['where'],{'$or':_[_0x4152('0x28')](_0x5ee0b6[_0x4152('0x3a')],function(_0x184332){var _0x1bf995={};_0x1bf995[_0x184332]={'$like':'%'+_0x5467f6[_0x4152('0x38')][_0x4152('0x26')]+'%'};return _0x1bf995;})});}_0x5ee0b6=_['merge']({},_0x5ee0b6,_0x5467f6[_0x4152('0x47')]);return _0x50240d[_0x4152('0x65')](_0x5ee0b6);}})[_0x4152('0x21')](function(_0x31d3cd){if(_0x31d3cd){_0x10043f=_0x31d3cd[_0x4152('0x3d')];if(!_0x5467f6[_0x4152('0x38')][_0x4152('0x3e')]('nolimit')){_0x5ee0b6[_0x4152('0x1a')]=qs[_0x4152('0x1a')](_0x5467f6[_0x4152('0x38')][_0x4152('0x1a')]);_0x5ee0b6[_0x4152('0x40')]=qs[_0x4152('0x40')](_0x5467f6[_0x4152('0x38')][_0x4152('0x40')]);}return _0x50240d[_0x4152('0x65')](_0x5ee0b6);}})['then'](function(_0x40b2cb){if(_0x40b2cb){return _0x40b2cb?{'count':_0x10043f,'rows':_0x40b2cb}:null;}})['then'](respondWithResult(_0x5273d6,null))['catch'](handleError(_0x5273d6,null));};exports['addTeams']=function(_0xc05df1,_0x24c540,_0x278113){var _0x45a0bb=_0xc05df1[_0x4152('0x58')][_0x4152('0x67')];var _0x293440=_[_0x4152('0x28')](_0x45a0bb,'id');return db[_0x4152('0x66')][_0x4152('0x5e')]({'where':{'id':_0x293440},'attributes':['id'],'include':[{'model':db[_0x4152('0x68')],'as':_0x4152('0x69'),'attributes':['id',_0x4152('0x30'),_0x4152('0x6a'),_0x4152('0x6b'),'interface'],'raw':!![]}]})[_0x4152('0x21')](function(_0x1d2510){if(_0x1d2510){var _0x2b252e=_[_0x4152('0x6c')](_0x1d2510,function(_0x25c9d0){var _0x147737=_0x25c9d0[_0x4152('0x23')]({'plain':!![]});_0x147737[_0x4152('0x69')][_0x4152('0x6d')](function(_0x57437b){_0x57437b[_0x4152('0x6e')]=_[_0x4152('0x2b')](_0x45a0bb,{'id':_0x147737['id']})[_0x4152('0x6e')];});return _0x147737['Agents'];});return db[_0x4152('0x33')][_0x4152('0x2b')]({'where':{'id':_0xc05df1[_0x4152('0x4c')]['id']}})['then'](function(_0x242e04){return db['sequelize'][_0x4152('0x6f')](function(_0xd8b26c){return _0x242e04[_0x4152('0x70')](_0x293440,{'transaction':_0xd8b26c})[_0x4152('0x21')](function(){return BPromise[_0x4152('0x71')](_0x45a0bb,function(_0x3e46cf){return db['TeamVoiceQueue'][_0x4152('0x72')]({'TeamId':_0x3e46cf['id'],'VoiceQueueId':_0xc05df1['params']['id'],'penalty':_0x3e46cf[_0x4152('0x6e')]},{'transaction':_0xd8b26c});});})['then'](function(){return BPromise['each'](_0x2b252e,function(_0x30a3e0){return db[_0x4152('0x73')][_0x4152('0x74')]({'where':{'UserId':_0x30a3e0['id'],'VoiceQueueId':_0xc05df1[_0x4152('0x4c')]['id']},'defaults':{'penalty':_0x30a3e0[_0x4152('0x6e')]},'transaction':_0xd8b26c});});})[_0x4152('0x21')](function(){return BPromise[_0x4152('0x71')](_[_0x4152('0x26')](_0x2b252e,{'online':!![]}),function(_0x5386a5){return db[_0x4152('0x75')][_0x4152('0x72')]({'membername':_0x5386a5[_0x4152('0x30')],'UserId':_0x5386a5['id'],'queue_name':_0x242e04[_0x4152('0x30')],'VoiceQueueId':_0x242e04['id'],'interface':_['isNil'](_0x5386a5[_0x4152('0x76')])?util[_0x4152('0x77')](_0x4152('0x78'),_0x5386a5[_0x4152('0x30')]):_0x5386a5[_0x4152('0x76')],'paused':_0x5386a5[_0x4152('0x6b')]||![],'penalty':_0x5386a5['penalty']},{'transaction':_0xd8b26c});});})[_0x4152('0x21')](function(){_0x2b252e[_0x4152('0x6d')](function(_0x270fc0){socket['emit']('userVoiceQueue:save',{'UserId':_0x270fc0['id'],'VoiceQueueId':_0x242e04['id']});});});});});}})[_0x4152('0x21')](respondWithStatusCode(_0x24c540,null))[_0x4152('0x4a')](handleError(_0x24c540,null));};exports['removeTeams']=function(_0x17f574,_0x31e7c5,_0x4534b2){return db[_0x4152('0x66')][_0x4152('0x5e')]({'where':{'id':_0x17f574[_0x4152('0x38')][_0x4152('0x79')]},'attributes':['id'],'include':[{'model':db[_0x4152('0x68')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x4152('0x21')](handleEntityNotFound(_0x31e7c5,null))['then'](function(_0x304be9){var _0x2fed81=_[_0x4152('0x28')](_0x304be9,'id');var _0x316fa8=[];var _0xb75b5f=[];var _0x1f208f=squel[_0x4152('0x7a')]();_0x1f208f['field'](_0x4152('0x7b'))[_0x4152('0x7c')](_0x4152('0x7d'),'tq')['join'](_0x4152('0x7e'),'ut',_0x4152('0x7f'))[_0x4152('0x43')](_0x4152('0x80'),_0x17f574['params']['id']);for(var _0x4d37c3=0x0;_0x4d37c3<_0x304be9[_0x4152('0x3d')];_0x4d37c3+=0x1){let _0x57b8b3=_0x304be9[_0x4d37c3];for(var _0x10be43=0x0;_0x10be43<_0x57b8b3[_0x4152('0x69')]['length'];_0x10be43+=0x1){let _0x1beb92=_0x57b8b3[_0x4152('0x69')][_0x10be43];var _0x47f4d0=_0x1f208f['clone']();_0x47f4d0[_0x4152('0x43')](_0x4152('0x81'),_0x1beb92['id']);_0xb75b5f[_0x4152('0x82')](db[_0x4152('0x83')]['query'](_0x47f4d0['toString'](),{'type':db[_0x4152('0x83')]['QueryTypes'][_0x4152('0x84')]})[_0x4152('0x21')](function(_0xf79ade){if(_0xf79ade['length']===0x1){return _0x1beb92['id'];}else{var _0x51bc2a=_[_0x4152('0x85')](_[_0x4152('0x28')](_0xf79ade,_0x4152('0x86')),function(_0x52e72a){return _['includes'](_0x2fed81,_0x52e72a);});if(_0x51bc2a){return _0x1beb92['id'];}}}));}}return BPromise['all'](_0xb75b5f)[_0x4152('0x21')](function(_0x192542){_0x316fa8=_(_0x316fa8)[_0x4152('0x87')](_0x192542)['compact']()['value']();return db[_0x4152('0x33')]['find']({'where':{'id':_0x17f574['params']['id']}})['then'](function(_0x53f7ca){return db['sequelize']['transaction'](function(_0x5b6cb2){return _0x53f7ca['removeTeams'](_0x17f574['query']['ids'],{'transaction':_0x5b6cb2})[_0x4152('0x21')](function(){if(!_[_0x4152('0x88')](_0x316fa8)){return _0x53f7ca['removeAgents'](_0x316fa8,{'transaction':_0x5b6cb2})[_0x4152('0x21')](function(){return db[_0x4152('0x75')][_0x4152('0x22')]({'where':{'VoiceQueueId':_0x17f574[_0x4152('0x4c')]['id'],'UserId':_0x316fa8},'transaction':_0x5b6cb2});});}})[_0x4152('0x21')](function(){_0x316fa8[_0x4152('0x6d')](function(_0x226243){socket[_0x4152('0x89')](_0x4152('0x8a'),{'UserId':_0x226243,'VoiceQueueId':_0x53f7ca['id']});});});});});});})['then'](respondWithStatusCode(_0x31e7c5,null))['catch'](handleError(_0x31e7c5,null));};exports['addAgents']=function(_0x39c9eb,_0x32b4bc,_0x24d715){var _0x4c5731,_0x50706c;return db[_0x4152('0x33')][_0x4152('0x2b')]({'where':{'id':_0x39c9eb[_0x4152('0x4c')]['id']}})[_0x4152('0x21')](handleEntityNotFound(_0x32b4bc,null))[_0x4152('0x21')](function(_0x14aeec){if(_0x14aeec){_0x50706c=_0x14aeec;return _0x14aeec[_0x4152('0x8b')](_0x39c9eb[_0x4152('0x58')][_0x4152('0x79')],_['omit'](_0x39c9eb[_0x4152('0x58')],['ids','id'])||{})['spread'](function(_0x457470){for(var _0x5f3a26=0x0;_0x5f3a26<_0x39c9eb[_0x4152('0x58')][_0x4152('0x79')][_0x4152('0x3d')];_0x5f3a26+=0x1){socket[_0x4152('0x89')]('userVoiceQueue:save',{'UserId':Number(_0x39c9eb[_0x4152('0x58')][_0x4152('0x79')][_0x5f3a26]),'VoiceQueueId':Number(_0x39c9eb[_0x4152('0x4c')]['id'])});}return _0x457470;});}})[_0x4152('0x21')](function(_0x149362){_0x4c5731=_0x149362||[];if(_0x50706c){return db[_0x4152('0x68')][_0x4152('0x5e')]({'where':{'id':_0x39c9eb['body'][_0x4152('0x79')]},'attributes':['id',_0x4152('0x30'),'online',_0x4152('0x6b'),_0x4152('0x76')],'raw':!![]});}})['then'](function(_0x150896){if(!_[_0x4152('0x88')](_0x150896)){var _0x2e4c1b=[];for(var _0x488eeb=0x0;_0x488eeb<_0x150896[_0x4152('0x3d')];_0x488eeb++){if(_0x150896[_0x488eeb][_0x4152('0x6a')]){_0x2e4c1b[_0x4152('0x82')](db[_0x4152('0x75')]['upsert']({'membername':_0x150896[_0x488eeb]['name'],'UserId':_0x150896[_0x488eeb]['id'],'queue_name':_0x50706c[_0x4152('0x30')],'VoiceQueueId':_0x50706c['id'],'interface':_['isNil'](_0x150896[_0x488eeb][_0x4152('0x76')])?util[_0x4152('0x77')](_0x4152('0x78'),_0x150896[_0x488eeb][_0x4152('0x30')]):_0x150896[_0x488eeb][_0x4152('0x76')],'paused':_0x150896[_0x488eeb][_0x4152('0x6b')]||![],'penalty':_0x39c9eb[_0x4152('0x58')][_0x4152('0x6e')]||0x0}));}}return BPromise['all'](_0x2e4c1b);}})[_0x4152('0x21')](function(){return _0x4c5731;})['then'](respondWithResult(_0x32b4bc,null))[_0x4152('0x4a')](handleError(_0x32b4bc,null));};exports['removeAgents']=function(_0x2a11ed,_0x20db19,_0x234914){return db['VoiceQueue'][_0x4152('0x2b')]({'where':{'id':_0x2a11ed[_0x4152('0x4c')]['id']}})[_0x4152('0x21')](handleEntityNotFound(_0x20db19,null))['then'](function(_0x57aadf){if(_0x57aadf){return _0x57aadf[_0x4152('0x8c')](_0x2a11ed['query'][_0x4152('0x79')])[_0x4152('0x21')](function(){if(_[_0x4152('0x8d')](_0x2a11ed[_0x4152('0x38')][_0x4152('0x79')])){for(var _0x318f6f=0x0;_0x318f6f<_0x2a11ed[_0x4152('0x38')][_0x4152('0x79')]['length'];_0x318f6f+=0x1){socket[_0x4152('0x89')]('userVoiceQueue:remove',{'UserId':Number(_0x2a11ed[_0x4152('0x38')][_0x4152('0x79')][_0x318f6f]),'VoiceQueueId':Number(_0x2a11ed[_0x4152('0x4c')]['id'])});}}else{socket[_0x4152('0x89')](_0x4152('0x8a'),{'UserId':Number(_0x2a11ed['query'][_0x4152('0x79')]),'VoiceQueueId':Number(_0x2a11ed[_0x4152('0x4c')]['id'])});}});}})['then'](function(_0x2460d4){return db['UserVoiceQueueRt'][_0x4152('0x22')]({'where':{'VoiceQueueId':_0x2a11ed[_0x4152('0x4c')]['id'],'UserId':_0x2a11ed['query'][_0x4152('0x79')]}})[_0x4152('0x21')](function(){return _0x2460d4;});})[_0x4152('0x21')](respondWithStatusCode(_0x20db19,null))['catch'](handleError(_0x20db19,null));};exports[_0x4152('0x8e')]=function(_0x23d551,_0x19afdc,_0x103c95){var _0x22a150={};var _0x25655a={};var _0x2430ca;var _0x4566ac;return db[_0x4152('0x33')]['findOne']({'where':{'id':_0x23d551[_0x4152('0x4c')]['id']}})[_0x4152('0x21')](handleEntityNotFound(_0x19afdc,null))[_0x4152('0x21')](function(_0x4c86fc){if(_0x4c86fc){_0x2430ca=_0x4c86fc;_0x25655a[_0x4152('0x37')]=_[_0x4152('0x39')](db[_0x4152('0x68')][_0x4152('0x34')]);_0x25655a['query']=_['keys'](_0x23d551[_0x4152('0x38')]);_0x25655a[_0x4152('0x44')]=_['intersection'](_0x25655a[_0x4152('0x37')],_0x25655a[_0x4152('0x38')]);_0x22a150[_0x4152('0x3a')]=_['intersection'](_0x25655a[_0x4152('0x37')],qs[_0x4152('0x3c')](_0x23d551[_0x4152('0x38')][_0x4152('0x3c')]));_0x22a150[_0x4152('0x3a')]=_0x22a150[_0x4152('0x3a')][_0x4152('0x3d')]?_0x22a150['attributes']:_0x25655a['model'];_0x22a150[_0x4152('0x41')]=qs[_0x4152('0x42')](_0x23d551[_0x4152('0x38')]['sort']);_0x22a150[_0x4152('0x43')]=qs[_0x4152('0x44')](_[_0x4152('0x45')](_0x23d551[_0x4152('0x38')],_0x25655a['filters']));if(_0x23d551[_0x4152('0x38')]['filter']){_0x22a150['where']=_[_0x4152('0x46')](_0x22a150[_0x4152('0x43')],{'$or':_[_0x4152('0x28')](_0x22a150[_0x4152('0x3a')],function(_0x259efd){var _0x4e5b65={};_0x4e5b65[_0x259efd]={'$like':'%'+_0x23d551[_0x4152('0x38')][_0x4152('0x26')]+'%'};return _0x4e5b65;})});}_0x22a150=_['merge']({},_0x22a150,_0x23d551[_0x4152('0x47')]);return _0x2430ca['getAgents'](_0x22a150);}})[_0x4152('0x21')](function(_0x580750){if(_0x580750){_0x4566ac=_0x580750[_0x4152('0x3d')];if(!_0x23d551[_0x4152('0x38')][_0x4152('0x3e')](_0x4152('0x3f'))){_0x22a150[_0x4152('0x1a')]=qs[_0x4152('0x1a')](_0x23d551[_0x4152('0x38')][_0x4152('0x1a')]);_0x22a150[_0x4152('0x40')]=qs[_0x4152('0x40')](_0x23d551[_0x4152('0x38')][_0x4152('0x40')]);}return _0x2430ca[_0x4152('0x8e')](_0x22a150);}})['then'](function(_0x496aad){if(_0x496aad){return _0x496aad?{'count':_0x4566ac,'rows':_0x496aad}:null;}})[_0x4152('0x21')](respondWithResult(_0x19afdc,null))['catch'](handleError(_0x19afdc,null));};exports['getMembers']=function(_0x53e2a9,_0x16d51a,_0x3e0c20){var _0x5ac119={};var _0xafaf81={};var _0x1796af;var _0x322cd5;return db[_0x4152('0x33')][_0x4152('0x5b')]({'where':{'id':_0x53e2a9[_0x4152('0x4c')]['id']}})['then'](handleEntityNotFound(_0x16d51a,null))['then'](function(_0x3586b3){if(_0x3586b3){_0x1796af=_0x3586b3;_0xafaf81['model']=_[_0x4152('0x39')](db[_0x4152('0x75')][_0x4152('0x34')]);_0xafaf81[_0x4152('0x38')]=_[_0x4152('0x39')](_0x53e2a9[_0x4152('0x38')]);_0xafaf81[_0x4152('0x44')]=_[_0x4152('0x3b')](_0xafaf81[_0x4152('0x37')],_0xafaf81[_0x4152('0x38')]);_0x5ac119[_0x4152('0x3a')]=_[_0x4152('0x3b')](_0xafaf81[_0x4152('0x37')],qs[_0x4152('0x3c')](_0x53e2a9[_0x4152('0x38')][_0x4152('0x3c')]));_0x5ac119['attributes']=_0x5ac119[_0x4152('0x3a')][_0x4152('0x3d')]?_0x5ac119[_0x4152('0x3a')]:_0xafaf81[_0x4152('0x37')];_0x5ac119[_0x4152('0x41')]=qs['sort'](_0x53e2a9['query'][_0x4152('0x42')]);_0x5ac119[_0x4152('0x43')]=qs[_0x4152('0x44')](_[_0x4152('0x45')](_0x53e2a9['query'],_0xafaf81[_0x4152('0x44')]));if(_0x53e2a9[_0x4152('0x38')]['filter']){_0x5ac119['where']=_[_0x4152('0x46')](_0x5ac119[_0x4152('0x43')],{'$or':_[_0x4152('0x28')](_0x5ac119[_0x4152('0x3a')],function(_0xdffbe){var _0x22403e={};_0x22403e[_0xdffbe]={'$like':'%'+_0x53e2a9[_0x4152('0x38')]['filter']+'%'};return _0x22403e;})});}_0x5ac119=_['merge']({},_0x5ac119,_0x53e2a9[_0x4152('0x47')]);return _0x1796af[_0x4152('0x8f')](_0x5ac119);}})[_0x4152('0x21')](function(_0xb500bb){if(_0xb500bb){_0x322cd5=_0xb500bb['length'];if(!_0x53e2a9[_0x4152('0x38')][_0x4152('0x3e')](_0x4152('0x3f'))){_0x5ac119[_0x4152('0x1a')]=qs['limit'](_0x53e2a9[_0x4152('0x38')][_0x4152('0x1a')]);_0x5ac119[_0x4152('0x40')]=qs[_0x4152('0x40')](_0x53e2a9[_0x4152('0x38')][_0x4152('0x40')]);}return _0x1796af[_0x4152('0x8f')](_0x5ac119);}})['then'](function(_0x2a1489){return _0x2a1489?{'count':_0x322cd5,'rows':_0x2a1489}:null;})['then'](respondWithResult(_0x16d51a,null))[_0x4152('0x4a')](handleError(_0x16d51a,null));};exports[_0x4152('0x90')]=function(_0xd824b1,_0x4a3bda,_0x336b4b){var _0x3fe0fd={};var _0x508896={};var _0x2328e2;var _0x26705c;return db['VoiceQueue'][_0x4152('0x5b')]({'where':{'id':_0xd824b1['params']['id']}})[_0x4152('0x21')](handleEntityNotFound(_0x4a3bda,null))[_0x4152('0x21')](function(_0xd76174){if(_0xd76174){_0x2328e2=_0xd76174;_0x508896[_0x4152('0x37')]=_[_0x4152('0x39')](db['CmList'][_0x4152('0x34')]);_0x508896[_0x4152('0x38')]=_[_0x4152('0x39')](_0xd824b1['query']);_0x508896[_0x4152('0x44')]=_[_0x4152('0x3b')](_0x508896[_0x4152('0x37')],_0x508896[_0x4152('0x38')]);_0x3fe0fd['attributes']=_[_0x4152('0x3b')](_0x508896[_0x4152('0x37')],qs['fields'](_0xd824b1[_0x4152('0x38')][_0x4152('0x3c')]));_0x3fe0fd['attributes']=_0x3fe0fd[_0x4152('0x3a')]['length']?_0x3fe0fd[_0x4152('0x3a')]:_0x508896[_0x4152('0x37')];_0x3fe0fd[_0x4152('0x41')]=qs[_0x4152('0x42')](_0xd824b1['query']['sort']);_0x3fe0fd[_0x4152('0x43')]=qs['filters'](_[_0x4152('0x45')](_0xd824b1[_0x4152('0x38')],_0x508896['filters']));if(_0xd824b1[_0x4152('0x38')][_0x4152('0x26')]){_0x3fe0fd['where']=_['merge'](_0x3fe0fd[_0x4152('0x43')],{'$or':_['map'](_0x3fe0fd[_0x4152('0x3a')],function(_0x21dfa9){var _0x4a1614={};_0x4a1614[_0x21dfa9]={'$like':'%'+_0xd824b1[_0x4152('0x38')][_0x4152('0x26')]+'%'};return _0x4a1614;})});}_0x3fe0fd=_[_0x4152('0x46')]({},_0x3fe0fd,_0xd824b1[_0x4152('0x47')]);return _0x2328e2['getLists'](_0x3fe0fd);}})['then'](function(_0x2d25e0){if(_0x2d25e0){_0x26705c=_0x2d25e0[_0x4152('0x3d')];if(!_0xd824b1[_0x4152('0x38')][_0x4152('0x3e')](_0x4152('0x3f'))){_0x3fe0fd[_0x4152('0x1a')]=qs['limit'](_0xd824b1[_0x4152('0x38')][_0x4152('0x1a')]);_0x3fe0fd[_0x4152('0x40')]=qs['offset'](_0xd824b1['query']['offset']);}return _0x2328e2[_0x4152('0x90')](_0x3fe0fd);}})[_0x4152('0x21')](function(_0x7fe292){if(_0x7fe292){return _0x7fe292?{'count':_0x26705c,'rows':_0x7fe292}:null;}})[_0x4152('0x21')](respondWithResult(_0x4a3bda,null))[_0x4152('0x4a')](handleError(_0x4a3bda,null));};exports[_0x4152('0x91')]=function(_0xc8dce2,_0x435e0f,_0x4a0a85){var _0x4a3d16,_0x472aeb;return db[_0x4152('0x33')][_0x4152('0x2b')]({'where':{'id':_0xc8dce2['params']['id']}})[_0x4152('0x21')](handleEntityNotFound(_0x435e0f,null))['then'](function(_0x2a8b4a){if(_0x2a8b4a){_0x472aeb=_0x2a8b4a;return _0x2a8b4a['addLists'](_0xc8dce2[_0x4152('0x58')][_0x4152('0x79')],_[_0x4152('0x55')](_0xc8dce2['body'],['ids','id'])||{});}return null;})[_0x4152('0x92')](function(_0x532ec9){var _0x12e413;_0x4a3d16=_0x532ec9||[];var _0x4a1739=[];if(_0x532ec9){for(var _0x1f7140=0x0;_0x1f7140<_0x532ec9[_0x4152('0x3d')];_0x1f7140+=0x1){var _0x221209=_0x532ec9[_0x1f7140]['get']({'plain':!![]});_0x472aeb[_0x4152('0x93')]=_0xc8dce2['body'][_0x4152('0x93')]?_0xc8dce2[_0x4152('0x58')][_0x4152('0x93')]:_0x472aeb['dialCheckDuplicateType'];switch(_0x472aeb[_0x4152('0x93')]){case'always':_0x12e413=squel[_0x4152('0x94')]()[_0x4152('0x95')](_0x4152('0x96'))['fromQuery']([_0x4152('0x97'),'scheduledAt','ContactId',_0x4152('0x98'),_0x4152('0x5d'),_0x4152('0x56'),_0x4152('0x57')],squel[_0x4152('0x7a')]()['field']('phone','phone')['field'](_0x4152('0x99'),'scheduledAt')[_0x4152('0x9a')]('id',_0x4152('0x9b'))['field'](_0x221209[_0x4152('0x9c')]['toString'](),_0x4152('0x98'))['field'](_0xc8dce2[_0x4152('0x4c')]['id'][_0x4152('0x9d')](),_0x4152('0x5d'))[_0x4152('0x9a')](_0x4152('0x99'),_0x4152('0x56'))[_0x4152('0x9a')](_0x4152('0x99'),_0x4152('0x57'))['from'](_0x4152('0x9e'))[_0x4152('0x43')](_0x4152('0x9f'))[_0x4152('0x43')](_0x4152('0xa0'),_0x221209['CmListId']['toString']())['where']('phone\x20IS\x20NOT\x20NULL')['where'](_0x4152('0xa1'),squel[_0x4152('0x7a')]()[_0x4152('0x9a')](_0x4152('0xa2'))[_0x4152('0x7c')](_0x4152('0xa3'))['where'](_0x4152('0x80'),_0xc8dce2['params']['id'][_0x4152('0x9d')]()))[_0x4152('0x43')](_0x4152('0xa1'),squel[_0x4152('0x7a')]()[_0x4152('0x9a')](_0x4152('0xa4'))['from'](_0x4152('0x96'))[_0x4152('0x43')](_0x4152('0x80'),_0xc8dce2[_0x4152('0x4c')]['id']['toString']())))[_0x4152('0x9d')]();break;case'onlyIfOpen':_0x12e413=squel[_0x4152('0x94')]()[_0x4152('0x95')](_0x4152('0x96'))[_0x4152('0xa5')]([_0x4152('0x97'),'scheduledAt','ContactId','ListId','VoiceQueueId','createdAt',_0x4152('0x57')],squel[_0x4152('0x7a')]()[_0x4152('0x9a')](_0x4152('0x97'),_0x4152('0x97'))[_0x4152('0x9a')](_0x4152('0x99'),_0x4152('0xa6'))['field']('id',_0x4152('0x9b'))['field'](_0x221209[_0x4152('0x9c')]['toString'](),_0x4152('0x98'))['field'](_0xc8dce2[_0x4152('0x4c')]['id'][_0x4152('0x9d')](),_0x4152('0x5d'))[_0x4152('0x9a')]('NOW()','createdAt')[_0x4152('0x9a')]('NOW()',_0x4152('0x57'))[_0x4152('0x7c')](_0x4152('0x9e'))[_0x4152('0x43')](_0x4152('0x9f'))[_0x4152('0x43')]('ListId\x20=\x20?',_0x221209[_0x4152('0x9c')][_0x4152('0x9d')]())[_0x4152('0x43')](_0x4152('0xa7'))[_0x4152('0x43')](_0x4152('0xa1'),squel[_0x4152('0x7a')]()[_0x4152('0x9a')]('COALESCE(phone,\x27\x27)')['from'](_0x4152('0x96'))['where'](_0x4152('0x80'),_0xc8dce2['params']['id'][_0x4152('0x9d')]())))[_0x4152('0x9d')]();break;default:_0x12e413=squel[_0x4152('0x94')]()[_0x4152('0x95')]('cm_hopper')[_0x4152('0xa5')]([_0x4152('0x97'),'scheduledAt',_0x4152('0x9b'),_0x4152('0x98'),_0x4152('0x5d'),'createdAt',_0x4152('0x57')],squel[_0x4152('0x7a')]()['field']('phone',_0x4152('0x97'))['field'](_0x4152('0x99'),_0x4152('0xa6'))[_0x4152('0x9a')]('id',_0x4152('0x9b'))[_0x4152('0x9a')](_0x221209['CmListId']['toString'](),_0x4152('0x98'))['field'](_0xc8dce2[_0x4152('0x4c')]['id'][_0x4152('0x9d')](),_0x4152('0x5d'))['field'](_0x4152('0x99'),_0x4152('0x56'))[_0x4152('0x9a')](_0x4152('0x99'),_0x4152('0x57'))[_0x4152('0x7c')](_0x4152('0x9e'))[_0x4152('0x43')](_0x4152('0x9f'))['where'](_0x4152('0xa0'),_0x221209[_0x4152('0x9c')][_0x4152('0x9d')]())['where'](_0x4152('0xa7')))[_0x4152('0x9d')]();}_0x4a1739['push'](db[_0x4152('0x83')][_0x4152('0x38')](_0x12e413));}return BPromise[_0x4152('0xa8')](_0x4a1739);}})[_0x4152('0x21')](function(){return _0x4a3d16;})[_0x4152('0x21')](respondWithResult(_0x435e0f,null))['catch'](handleError(_0x435e0f,null));};exports[_0x4152('0xa9')]=function(_0x599b0d,_0x4ba262,_0x58b2a4){return db[_0x4152('0x33')]['find']({'where':{'id':_0x599b0d[_0x4152('0x4c')]['id']}})[_0x4152('0x21')](handleEntityNotFound(_0x4ba262,null))[_0x4152('0x21')](function(_0x4df35a){if(_0x4df35a){return _0x4df35a['removeLists'](_0x599b0d['query']['ids']);}})[_0x4152('0x21')](function(_0x3e7d34){if(_0x3e7d34){return db[_0x4152('0x5c')]['destroy']({'where':{'ListId':_0x599b0d[_0x4152('0x38')][_0x4152('0x79')],'VoiceQueueId':_0x599b0d[_0x4152('0x4c')]['id']}})[_0x4152('0x21')](function(){return _0x3e7d34;});}})['then'](respondWithStatusCode(_0x4ba262,null))[_0x4152('0x4a')](handleError(_0x4ba262,null));};exports[_0x4152('0xaa')]=function(_0x41ad04,_0x5e5a00,_0x5e035b){var _0x197afe={};var _0x3b98b9={};var _0x4fab40;var _0x3898af;return db[_0x4152('0x33')][_0x4152('0x5b')]({'where':{'id':_0x41ad04['params']['id']}})[_0x4152('0x21')](handleEntityNotFound(_0x5e5a00,null))[_0x4152('0x21')](function(_0x116d43){if(_0x116d43){_0x4fab40=_0x116d43;_0x3b98b9[_0x4152('0x37')]=_[_0x4152('0x39')](db[_0x4152('0xab')][_0x4152('0x34')]);_0x3b98b9[_0x4152('0x38')]=_[_0x4152('0x39')](_0x41ad04[_0x4152('0x38')]);_0x3b98b9['filters']=_[_0x4152('0x3b')](_0x3b98b9[_0x4152('0x37')],_0x3b98b9['query']);_0x197afe[_0x4152('0x3a')]=_[_0x4152('0x3b')](_0x3b98b9[_0x4152('0x37')],qs[_0x4152('0x3c')](_0x41ad04[_0x4152('0x38')][_0x4152('0x3c')]));_0x197afe[_0x4152('0x3a')]=_0x197afe[_0x4152('0x3a')][_0x4152('0x3d')]?_0x197afe[_0x4152('0x3a')]:_0x3b98b9[_0x4152('0x37')];_0x197afe['order']=qs[_0x4152('0x42')](_0x41ad04['query'][_0x4152('0x42')]);_0x197afe[_0x4152('0x43')]=qs[_0x4152('0x44')](_[_0x4152('0x45')](_0x41ad04[_0x4152('0x38')],_0x3b98b9['filters']));if(_0x41ad04[_0x4152('0x38')]['filter']){_0x197afe['where']=_[_0x4152('0x46')](_0x197afe[_0x4152('0x43')],{'$or':_[_0x4152('0x28')](_0x197afe['attributes'],function(_0x5e6cc9){var _0x4dc5e3={};_0x4dc5e3[_0x5e6cc9]={'$like':'%'+_0x41ad04[_0x4152('0x38')][_0x4152('0x26')]+'%'};return _0x4dc5e3;})});}_0x197afe=_[_0x4152('0x46')]({},_0x197afe,_0x41ad04[_0x4152('0x47')]);return _0x4fab40[_0x4152('0xaa')](_0x197afe);}})[_0x4152('0x21')](function(_0x3510d9){if(_0x3510d9){_0x3898af=_0x3510d9[_0x4152('0x3d')];if(!_0x41ad04[_0x4152('0x38')][_0x4152('0x3e')](_0x4152('0x3f'))){_0x197afe[_0x4152('0x1a')]=qs[_0x4152('0x1a')](_0x41ad04[_0x4152('0x38')][_0x4152('0x1a')]);_0x197afe[_0x4152('0x40')]=qs['offset'](_0x41ad04['query'][_0x4152('0x40')]);}return _0x4fab40[_0x4152('0xaa')](_0x197afe);}})[_0x4152('0x21')](function(_0x3d3c29){if(_0x3d3c29){return _0x3d3c29?{'count':_0x3898af,'rows':_0x3d3c29}:null;}})[_0x4152('0x21')](respondWithResult(_0x5e5a00,null))[_0x4152('0x4a')](handleError(_0x5e5a00,null));};exports[_0x4152('0xac')]=function(_0x75eb61,_0x2a98f4,_0x4bd62b){var _0x57bc18,_0x11b2fa;return db[_0x4152('0x33')]['find']({'where':{'id':_0x75eb61[_0x4152('0x4c')]['id']}})[_0x4152('0x21')](handleEntityNotFound(_0x2a98f4,null))[_0x4152('0x21')](function(_0xc17248){if(_0xc17248){_0x11b2fa=_0xc17248;return _0xc17248['addBlackLists'](_0x75eb61[_0x4152('0x58')]['ids'],_[_0x4152('0x55')](_0x75eb61[_0x4152('0x58')],[_0x4152('0x79'),'id'])||{});}return null;})['spread'](function(_0x429b2d){var _0x185cac;_0x57bc18=_0x429b2d||[];var _0x49aa42=[];if(_0x429b2d){for(var _0x37738e=0x0;_0x37738e<_0x429b2d['length'];_0x37738e+=0x1){var _0x250c96=_0x429b2d[_0x37738e][_0x4152('0x23')]({'plain':!![]});_0x185cac=squel[_0x4152('0x94')]()['into'](_0x4152('0xad'))[_0x4152('0xa5')]([_0x4152('0x97'),_0x4152('0x9b'),_0x4152('0x98'),'VoiceQueueId',_0x4152('0x56'),_0x4152('0x57')],squel[_0x4152('0x7a')]()[_0x4152('0x9a')](_0x4152('0x97'),_0x4152('0x97'))[_0x4152('0x9a')]('id',_0x4152('0x9b'))[_0x4152('0x9a')](_0x250c96['CmListId'][_0x4152('0x9d')](),_0x4152('0x98'))[_0x4152('0x9a')](_0x75eb61['params']['id'][_0x4152('0x9d')](),'VoiceQueueId')[_0x4152('0x9a')](_0x4152('0x99'),_0x4152('0x56'))[_0x4152('0x9a')]('NOW()','updatedAt')[_0x4152('0x7c')]('cm_contacts')[_0x4152('0x43')](_0x4152('0x9f'))['where'](_0x4152('0xa0'),_0x250c96[_0x4152('0x9c')][_0x4152('0x9d')]())[_0x4152('0x43')]('phone\x20IS\x20NOT\x20NULL'))[_0x4152('0x9d')]();_0x49aa42['push'](db[_0x4152('0x83')][_0x4152('0x38')](_0x185cac));}return BPromise[_0x4152('0xa8')](_0x49aa42);}})[_0x4152('0x21')](function(){return _0x57bc18;})[_0x4152('0x21')](respondWithResult(_0x2a98f4,null))['catch'](handleError(_0x2a98f4,null));};exports[_0x4152('0xae')]=function(_0x192832,_0x329f11,_0x934ffe){return db[_0x4152('0x33')][_0x4152('0x2b')]({'where':{'id':_0x192832[_0x4152('0x4c')]['id']}})['then'](handleEntityNotFound(_0x329f11,null))['then'](function(_0x14d5d0){if(_0x14d5d0){return _0x14d5d0['removeBlackLists'](_0x192832[_0x4152('0x38')][_0x4152('0x79')]);}})[_0x4152('0x21')](function(_0x237e74){if(_0x237e74){return db[_0x4152('0x64')][_0x4152('0x22')]({'where':{'ListId':_0x192832[_0x4152('0x38')][_0x4152('0x79')],'VoiceQueueId':_0x192832[_0x4152('0x4c')]['id']}})[_0x4152('0x21')](function(){return _0x237e74;});}})[_0x4152('0x21')](respondWithStatusCode(_0x329f11,null))['catch'](handleError(_0x329f11,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 148c001..8bfac90 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 _0xf68f=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x51df00,_0x4ac573){var _0x198328=function(_0x24e0ec){while(--_0x24e0ec){_0x51df00['push'](_0x51df00['shift']());}};_0x198328(++_0x4ac573);}(_0xf68f,0x1a9));var _0xff68=function(_0xbf5e16,_0x146ce3){_0xbf5e16=_0xbf5e16-0x0;var _0x5975a5=_0xf68f[_0xbf5e16];return _0x5975a5;};'use strict';var EventEmitter=require(_0xff68('0x0'));var VoiceQueue=require(_0xff68('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xff68('0x2')](0x0);var events={'afterCreate':_0xff68('0x3'),'afterUpdate':_0xff68('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1568e9){return function(_0x2fb8b7,_0x5edc97,_0x51fef8){VoiceQueueEvents[_0xff68('0x5')](_0x1568e9+':'+_0x2fb8b7['id'],_0x2fb8b7);VoiceQueueEvents['emit'](_0x1568e9,_0x2fb8b7);_0x51fef8(null);};}for(var e in events){if(events[_0xff68('0x6')](e)){var event=events[e];VoiceQueue[_0xff68('0x7')](e,emitEvent(event));}}module[_0xff68('0x8')]=VoiceQueueEvents; \ No newline at end of file +var _0x3426=['emit','hook','exports','events','../../mysqldb','setMaxListeners','update','remove'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x3426,0x15b));var _0x6342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3426[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x6342('0x0'));var VoiceQueue=require(_0x6342('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x6342('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6342('0x3'),'afterDestroy':_0x6342('0x4')};function emitEvent(_0x243212){return function(_0x51f669,_0x2586ce,_0xd4cd16){VoiceQueueEvents[_0x6342('0x5')](_0x243212+':'+_0x51f669['id'],_0x51f669);VoiceQueueEvents[_0x6342('0x5')](_0x243212,_0x51f669);_0xd4cd16(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x6342('0x6')](e,emitEvent(event));}}module[_0x6342('0x7')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index ea4522e..fbd2328 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 _0x3e74=['exports','VoiceQueue','voice_queues','lodash','../../config/logger','api','moment','path','../../config/environment','./voiceQueue.attributes'];(function(_0x568ec8,_0x1e0f23){var _0x52b2be=function(_0x2cb177){while(--_0x2cb177){_0x568ec8['push'](_0x568ec8['shift']());}};_0x52b2be(++_0x1e0f23);}(_0x3e74,0x175));var _0x43e7=function(_0x2daed8,_0x31faed){_0x2daed8=_0x2daed8-0x0;var _0x7c4a69=_0x3e74[_0x2daed8];return _0x7c4a69;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x008c=['define','voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports'];(function(_0x141908,_0x4e61dc){var _0x37e9c9=function(_0x3a557e){while(--_0x3a557e){_0x141908['push'](_0x141908['shift']());}};_0x37e9c9(++_0x4e61dc);}(_0x008c,0x188));var _0xc008=function(_0x477270,_0x4adea6){_0x477270=_0x477270-0x0;var _0x21ae0d=_0x008c[_0x477270];return _0x21ae0d;};'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 5bb96d9..f95a570 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 _0x5754=['redis','./voiceQueue.socket','register','request','then','info','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','VoiceQueue,\x20%s,\x20%s','result','findAll','options','raw','limit','include','map','attributes','model','GetVoiceQueue','ShowVoiceQueue','VoiceQueue','find','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','defaults','localhost','socket.io-emitter'];(function(_0x3b2244,_0x54873f){var _0x2dcc14=function(_0x53d73f){while(--_0x53d73f){_0x3b2244['push'](_0x3b2244['shift']());}};_0x2dcc14(++_0x54873f);}(_0x5754,0xe3));var _0x4575=function(_0x3c3ae9,_0x105122){_0x3c3ae9=_0x3c3ae9-0x0;var _0x481ff7=_0x5754[_0x3c3ae9];return _0x481ff7;};'use strict';var _=require(_0x4575('0x0'));var util=require(_0x4575('0x1'));var moment=require(_0x4575('0x2'));var BPromise=require(_0x4575('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4575('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4575('0x5'))(_0x4575('0x6'));var config=require('../../config/environment');var jayson=require(_0x4575('0x7'));var client=jayson[_0x4575('0x8')][_0x4575('0x9')]({'port':0x232a});config['redis']=_[_0x4575('0xa')](config['redis'],{'host':_0x4575('0xb'),'port':0x18eb});var socket=require(_0x4575('0xc'))(new Redis(config[_0x4575('0xd')]));require(_0x4575('0xe'))[_0x4575('0xf')](socket);function respondWithRpcPromise(_0x160566,_0x13cb87,_0x48540f){return new BPromise(function(_0x534cb3,_0x44ad1b){return client[_0x4575('0x10')](_0x160566,_0x48540f)[_0x4575('0x11')](function(_0xe34f1a){logger[_0x4575('0x12')]('VoiceQueue,\x20%s,\x20%s',_0x13cb87,_0x4575('0x13'));logger[_0x4575('0x14')](_0x4575('0x15'),_0x13cb87,'request\x20sent',JSON[_0x4575('0x16')](_0xe34f1a));if(_0xe34f1a[_0x4575('0x17')]){if(_0xe34f1a[_0x4575('0x17')]['code']===0x1f4){logger['error']('VoiceQueue,\x20%s,\x20%s',_0x13cb87,_0xe34f1a[_0x4575('0x17')][_0x4575('0x18')]);return _0x44ad1b(_0xe34f1a[_0x4575('0x17')][_0x4575('0x18')]);}logger[_0x4575('0x17')]('VoiceQueue,\x20%s,\x20%s',_0x13cb87,_0xe34f1a[_0x4575('0x17')][_0x4575('0x18')]);return _0x534cb3(_0xe34f1a[_0x4575('0x17')]['message']);}else{logger['info'](_0x4575('0x19'),_0x13cb87,_0x4575('0x13'));_0x534cb3(_0xe34f1a[_0x4575('0x1a')][_0x4575('0x18')]);}})['catch'](function(_0x295bc9){logger[_0x4575('0x17')]('VoiceQueue,\x20%s,\x20%s',_0x13cb87,_0x295bc9);_0x44ad1b(_0x295bc9);});});}exports['GetVoiceQueue']=function(_0x38a008){var _0x3a1d7c=this;return new Promise(function(_0x542a78,_0x43179a){return db['VoiceQueue'][_0x4575('0x1b')]({'raw':_0x38a008[_0x4575('0x1c')]?_0x38a008[_0x4575('0x1c')][_0x4575('0x1d')]===undefined?!![]:![]:!![],'where':_0x38a008['options']?_0x38a008[_0x4575('0x1c')]['where']||null:null,'attributes':_0x38a008[_0x4575('0x1c')]?_0x38a008[_0x4575('0x1c')]['attributes']||null:null,'limit':_0x38a008['options']?_0x38a008[_0x4575('0x1c')][_0x4575('0x1e')]||null:null,'include':_0x38a008['options']?_0x38a008[_0x4575('0x1c')][_0x4575('0x1f')]?_[_0x4575('0x20')](_0x38a008[_0x4575('0x1c')][_0x4575('0x1f')],function(_0x408992){return{'model':db[_0x408992['model']],'as':_0x408992['as'],'attributes':_0x408992[_0x4575('0x21')],'include':_0x408992[_0x4575('0x1f')]?_[_0x4575('0x20')](_0x408992[_0x4575('0x1f')],function(_0x4ab6d8){return{'model':db[_0x4ab6d8[_0x4575('0x22')]],'as':_0x4ab6d8['as'],'attributes':_0x4ab6d8['attributes'],'include':_0x4ab6d8[_0x4575('0x1f')]?_['map'](_0x4ab6d8[_0x4575('0x1f')],function(_0x374e15){return{'model':db[_0x374e15[_0x4575('0x22')]],'as':_0x374e15['as'],'attributes':_0x374e15[_0x4575('0x21')]};}):[]};}):[]};}):[]:[]})[_0x4575('0x11')](function(_0x319807){logger['info']('GetVoiceQueue',_0x38a008);logger[_0x4575('0x14')](_0x4575('0x23'),_0x38a008,JSON['stringify'](_0x319807));_0x542a78(_0x319807);})['catch'](function(_0xdd0763){logger['error'](_0x4575('0x23'),_0xdd0763[_0x4575('0x18')],_0x38a008);_0x43179a(_0x3a1d7c['error'](0x1f4,_0xdd0763[_0x4575('0x18')]));});});};exports[_0x4575('0x24')]=function(_0x1bad9b){var _0x5ead8f=this;return new Promise(function(_0x1fd986,_0x5c0913){return db[_0x4575('0x25')][_0x4575('0x26')]({'raw':_0x1bad9b[_0x4575('0x1c')]?_0x1bad9b[_0x4575('0x1c')][_0x4575('0x1d')]===undefined?!![]:![]:!![],'where':_0x1bad9b['options']?_0x1bad9b[_0x4575('0x1c')]['where']||null:null,'attributes':_0x1bad9b['options']?_0x1bad9b[_0x4575('0x1c')]['attributes']||null:null,'include':_0x1bad9b[_0x4575('0x1c')]?_0x1bad9b[_0x4575('0x1c')][_0x4575('0x1f')]?_[_0x4575('0x20')](_0x1bad9b[_0x4575('0x1c')][_0x4575('0x1f')],function(_0x324d1d){return{'model':db[_0x324d1d['model']],'as':_0x324d1d['as'],'attributes':_0x324d1d[_0x4575('0x21')],'include':_0x324d1d[_0x4575('0x1f')]?_[_0x4575('0x20')](_0x324d1d[_0x4575('0x1f')],function(_0x14453d){return{'model':db[_0x14453d[_0x4575('0x22')]],'as':_0x14453d['as'],'attributes':_0x14453d[_0x4575('0x21')],'include':_0x14453d[_0x4575('0x1f')]?_['map'](_0x14453d[_0x4575('0x1f')],function(_0x5c0812){return{'model':db[_0x5c0812[_0x4575('0x22')]],'as':_0x5c0812['as'],'attributes':_0x5c0812[_0x4575('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x10798c){logger[_0x4575('0x12')]('ShowVoiceQueue',_0x1bad9b);logger['debug']('ShowVoiceQueue',_0x1bad9b,JSON[_0x4575('0x16')](_0x10798c));_0x1fd986(_0x10798c);})[_0x4575('0x27')](function(_0x2638c3){logger[_0x4575('0x17')](_0x4575('0x24'),_0x2638c3['message'],_0x1bad9b);_0x5c0913(_0x5ead8f['error'](0x1f4,_0x2638c3['message']));});});}; \ No newline at end of file +var _0xa905=['info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','include','attributes','map','model','catch','ShowVoiceQueue','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','then'];(function(_0x2a0b93,_0x323573){var _0x4fe0e0=function(_0x4654d2){while(--_0x4654d2){_0x2a0b93['push'](_0x2a0b93['shift']());}};_0x4fe0e0(++_0x323573);}(_0xa905,0x13d));var _0x5a90=function(_0x2efe86,_0x4b6c3f){_0x2efe86=_0x2efe86-0x0;var _0x48e01c=_0xa905[_0x2efe86];return _0x48e01c;};'use strict';var _=require('lodash');var util=require(_0x5a90('0x0'));var moment=require(_0x5a90('0x1'));var BPromise=require(_0x5a90('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5a90('0x3'));var db=require(_0x5a90('0x4'))['db'];var utils=require(_0x5a90('0x5'));var logger=require('../../config/logger')(_0x5a90('0x6'));var config=require(_0x5a90('0x7'));var jayson=require(_0x5a90('0x8'));var client=jayson[_0x5a90('0x9')]['http']({'port':0x232a});config[_0x5a90('0xa')]=_[_0x5a90('0xb')](config[_0x5a90('0xa')],{'host':_0x5a90('0xc'),'port':0x18eb});var socket=require(_0x5a90('0xd'))(new Redis(config[_0x5a90('0xa')]));require('./voiceQueue.socket')[_0x5a90('0xe')](socket);function respondWithRpcPromise(_0x4f1f57,_0x449aa7,_0x1f978e){return new BPromise(function(_0x30352e,_0x263205){return client['request'](_0x4f1f57,_0x1f978e)[_0x5a90('0xf')](function(_0x37f33f){logger[_0x5a90('0x10')](_0x5a90('0x11'),_0x449aa7,_0x5a90('0x12'));logger[_0x5a90('0x13')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x449aa7,_0x5a90('0x12'),JSON[_0x5a90('0x14')](_0x37f33f));if(_0x37f33f['error']){if(_0x37f33f[_0x5a90('0x15')][_0x5a90('0x16')]===0x1f4){logger[_0x5a90('0x15')]('VoiceQueue,\x20%s,\x20%s',_0x449aa7,_0x37f33f[_0x5a90('0x15')]['message']);return _0x263205(_0x37f33f['error'][_0x5a90('0x17')]);}logger[_0x5a90('0x15')](_0x5a90('0x11'),_0x449aa7,_0x37f33f[_0x5a90('0x15')][_0x5a90('0x17')]);return _0x30352e(_0x37f33f['error'][_0x5a90('0x17')]);}else{logger[_0x5a90('0x10')](_0x5a90('0x11'),_0x449aa7,_0x5a90('0x12'));_0x30352e(_0x37f33f[_0x5a90('0x18')][_0x5a90('0x17')]);}})['catch'](function(_0xef2b14){logger[_0x5a90('0x15')](_0x5a90('0x11'),_0x449aa7,_0xef2b14);_0x263205(_0xef2b14);});});}exports[_0x5a90('0x19')]=function(_0x5d4fb2){var _0x564d00=this;return new Promise(function(_0x369cab,_0x1acd0c){return db[_0x5a90('0x1a')][_0x5a90('0x1b')]({'raw':_0x5d4fb2[_0x5a90('0x1c')]?_0x5d4fb2['options'][_0x5a90('0x1d')]===undefined?!![]:![]:!![],'where':_0x5d4fb2['options']?_0x5d4fb2[_0x5a90('0x1c')][_0x5a90('0x1e')]||null:null,'attributes':_0x5d4fb2['options']?_0x5d4fb2[_0x5a90('0x1c')]['attributes']||null:null,'limit':_0x5d4fb2[_0x5a90('0x1c')]?_0x5d4fb2[_0x5a90('0x1c')]['limit']||null:null,'include':_0x5d4fb2[_0x5a90('0x1c')]?_0x5d4fb2['options']['include']?_['map'](_0x5d4fb2[_0x5a90('0x1c')][_0x5a90('0x1f')],function(_0x36ef5d){return{'model':db[_0x36ef5d['model']],'as':_0x36ef5d['as'],'attributes':_0x36ef5d[_0x5a90('0x20')],'include':_0x36ef5d[_0x5a90('0x1f')]?_[_0x5a90('0x21')](_0x36ef5d[_0x5a90('0x1f')],function(_0xf7694b){return{'model':db[_0xf7694b['model']],'as':_0xf7694b['as'],'attributes':_0xf7694b['attributes'],'include':_0xf7694b['include']?_[_0x5a90('0x21')](_0xf7694b['include'],function(_0x31a660){return{'model':db[_0x31a660[_0x5a90('0x22')]],'as':_0x31a660['as'],'attributes':_0x31a660[_0x5a90('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23acb3){logger['info'](_0x5a90('0x19'),_0x5d4fb2);logger['debug'](_0x5a90('0x19'),_0x5d4fb2,JSON[_0x5a90('0x14')](_0x23acb3));_0x369cab(_0x23acb3);})[_0x5a90('0x23')](function(_0x564f9a){logger[_0x5a90('0x15')]('GetVoiceQueue',_0x564f9a[_0x5a90('0x17')],_0x5d4fb2);_0x1acd0c(_0x564d00[_0x5a90('0x15')](0x1f4,_0x564f9a[_0x5a90('0x17')]));});});};exports['ShowVoiceQueue']=function(_0x4d3506){var _0x37e5fc=this;return new Promise(function(_0x590ed8,_0x1ca467){return db[_0x5a90('0x1a')]['find']({'raw':_0x4d3506[_0x5a90('0x1c')]?_0x4d3506[_0x5a90('0x1c')][_0x5a90('0x1d')]===undefined?!![]:![]:!![],'where':_0x4d3506[_0x5a90('0x1c')]?_0x4d3506[_0x5a90('0x1c')]['where']||null:null,'attributes':_0x4d3506[_0x5a90('0x1c')]?_0x4d3506['options'][_0x5a90('0x20')]||null:null,'include':_0x4d3506['options']?_0x4d3506[_0x5a90('0x1c')][_0x5a90('0x1f')]?_[_0x5a90('0x21')](_0x4d3506['options'][_0x5a90('0x1f')],function(_0x13ddd5){return{'model':db[_0x13ddd5['model']],'as':_0x13ddd5['as'],'attributes':_0x13ddd5['attributes'],'include':_0x13ddd5[_0x5a90('0x1f')]?_[_0x5a90('0x21')](_0x13ddd5[_0x5a90('0x1f')],function(_0x15c776){return{'model':db[_0x15c776[_0x5a90('0x22')]],'as':_0x15c776['as'],'attributes':_0x15c776[_0x5a90('0x20')],'include':_0x15c776['include']?_[_0x5a90('0x21')](_0x15c776[_0x5a90('0x1f')],function(_0x8ac9ef){return{'model':db[_0x8ac9ef['model']],'as':_0x8ac9ef['as'],'attributes':_0x8ac9ef[_0x5a90('0x20')]};}):[]};}):[]};}):[]:[]})[_0x5a90('0xf')](function(_0x1ef0c6){logger[_0x5a90('0x10')](_0x5a90('0x24'),_0x4d3506);logger['debug']('ShowVoiceQueue',_0x4d3506,JSON[_0x5a90('0x14')](_0x1ef0c6));_0x590ed8(_0x1ef0c6);})[_0x5a90('0x23')](function(_0x3f368e){logger[_0x5a90('0x15')](_0x5a90('0x24'),_0x3f368e[_0x5a90('0x17')],_0x4d3506);_0x1ca467(_0x37e5fc[_0x5a90('0x15')](0x1f4,_0x3f368e['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index c71d923..a11a09c 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 _0x0e93=['remove','emit','removeListener','register','length','voiceQueue:','./voiceQueue.events','save'];(function(_0x1c2478,_0x466bf3){var _0x36c4af=function(_0x3b3541){while(--_0x3b3541){_0x1c2478['push'](_0x1c2478['shift']());}};_0x36c4af(++_0x466bf3);}(_0x0e93,0x13e));var _0x30e9=function(_0x3b2d55,_0x354a2b){_0x3b2d55=_0x3b2d55-0x0;var _0x2565b6=_0x0e93[_0x3b2d55];return _0x2565b6;};'use strict';var VoiceQueueEvents=require(_0x30e9('0x0'));var events=[_0x30e9('0x1'),_0x30e9('0x2'),'update'];function createListener(_0x1b0a3d,_0x5b8f00){return function(_0x1a1cd6){_0x5b8f00[_0x30e9('0x3')](_0x1b0a3d,_0x1a1cd6);};}function removeListener(_0x4e0d9a,_0x28520a){return function(){VoiceQueueEvents[_0x30e9('0x4')](_0x4e0d9a,_0x28520a);};}exports[_0x30e9('0x5')]=function(_0x5e7ac8){for(var _0x1a69c5=0x0,_0x494de8=events[_0x30e9('0x6')];_0x1a69c5<_0x494de8;_0x1a69c5++){var _0x319f57=events[_0x1a69c5];var _0x4e3db2=createListener(_0x30e9('0x7')+_0x319f57,_0x5e7ac8);VoiceQueueEvents['on'](_0x319f57,_0x4e3db2);}}; \ No newline at end of file +var _0x03d3=['update','emit','register','length','remove'];(function(_0x562c2e,_0x5d51b2){var _0x1cadad=function(_0x5544f5){while(--_0x5544f5){_0x562c2e['push'](_0x562c2e['shift']());}};_0x1cadad(++_0x5d51b2);}(_0x03d3,0x144));var _0x303d=function(_0x60787e,_0x5e5ed1){_0x60787e=_0x60787e-0x0;var _0x26e3e9=_0x03d3[_0x60787e];return _0x26e3e9;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=['save',_0x303d('0x0'),_0x303d('0x1')];function createListener(_0x4097da,_0x3c33be){return function(_0x1aabec){_0x3c33be[_0x303d('0x2')](_0x4097da,_0x1aabec);};}function removeListener(_0x34e4ef,_0x22921b){return function(){VoiceQueueEvents['removeListener'](_0x34e4ef,_0x22921b);};}exports[_0x303d('0x3')]=function(_0x138109){for(var _0x3cb248=0x0,_0x51c699=events[_0x303d('0x4')];_0x3cb248<_0x51c699;_0x3cb248++){var _0x19f34e=events[_0x3cb248];var _0x40357d=createListener('voiceQueue:'+_0x19f34e,_0x138109);VoiceQueueEvents['on'](_0x19f34e,_0x40357d);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 58732f6..80667de 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 _0x9e32=['isAuthenticated','get','describe','getVoiceQueuesReport','show','update','delete','/:id','destroy','exports','multer','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x69752e,_0x2579f6){var _0x506a36=function(_0x1793bc){while(--_0x1793bc){_0x69752e['push'](_0x69752e['shift']());}};_0x506a36(++_0x2579f6);}(_0x9e32,0x13a));var _0x29e3=function(_0x129a57,_0x330d03){_0x129a57=_0x129a57-0x0;var _0xa7147c=_0x9e32[_0x129a57];return _0xa7147c;};'use strict';var multer=require(_0x29e3('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x29e3('0x1'));var router=express['Router']();var fs_extra=require(_0x29e3('0x2'));var auth=require(_0x29e3('0x3'));var interaction=require(_0x29e3('0x4'));var config=require(_0x29e3('0x5'));var controller=require('./voiceQueueReport.controller');router['get']('/',auth[_0x29e3('0x6')](),controller['index']);router[_0x29e3('0x7')]('/describe',auth[_0x29e3('0x6')](),controller[_0x29e3('0x8')]);router[_0x29e3('0x7')]('/index',auth['isAuthenticated'](),controller[_0x29e3('0x9')]);router[_0x29e3('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x29e3('0xa')]);router['post']('/',auth[_0x29e3('0x6')](),controller['create']);router['put']('/:id',auth[_0x29e3('0x6')](),controller[_0x29e3('0xb')]);router[_0x29e3('0xc')](_0x29e3('0xd'),auth[_0x29e3('0x6')](),controller[_0x29e3('0xe')]);module[_0x29e3('0xf')]=router; \ No newline at end of file +var _0xc559=['destroy','exports','path','express','Router','fs-extra','../../components/interaction/service','./voiceQueueReport.controller','get','isAuthenticated','/describe','/index','getVoiceQueuesReport','/:id','show','post','create','put','update','delete'];(function(_0x429224,_0x23b47f){var _0x4f5f60=function(_0x2f3d44){while(--_0x2f3d44){_0x429224['push'](_0x429224['shift']());}};_0x4f5f60(++_0x23b47f);}(_0xc559,0x11a));var _0x9c55=function(_0x31b9b5,_0x3ba5e7){_0x31b9b5=_0x31b9b5-0x0;var _0x586f52=_0xc559[_0x31b9b5];return _0x586f52;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9c55('0x0'));var timeout=require('connect-timeout');var express=require(_0x9c55('0x1'));var router=express[_0x9c55('0x2')]();var fs_extra=require(_0x9c55('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x9c55('0x4'));var config=require('../../config/environment');var controller=require(_0x9c55('0x5'));router[_0x9c55('0x6')]('/',auth[_0x9c55('0x7')](),controller['index']);router[_0x9c55('0x6')](_0x9c55('0x8'),auth[_0x9c55('0x7')](),controller['describe']);router[_0x9c55('0x6')](_0x9c55('0x9'),auth['isAuthenticated'](),controller[_0x9c55('0xa')]);router['get'](_0x9c55('0xb'),auth['isAuthenticated'](),controller[_0x9c55('0xc')]);router[_0x9c55('0xd')]('/',auth[_0x9c55('0x7')](),controller[_0x9c55('0xe')]);router[_0x9c55('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x9c55('0x10')]);router[_0x9c55('0x11')](_0x9c55('0xb'),auth[_0x9c55('0x7')](),controller[_0x9c55('0x12')]);module[_0x9c55('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index ae70485..2ce371c 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 _0xff07=['INTEGER','BOOLEAN','DATE','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','getDataValue','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','seconds','queuecallerleaveAt','setDataValue','holdtime'];(function(_0x42523b,_0x20f96d){var _0xb13a51=function(_0x1e2d54){while(--_0x1e2d54){_0x42523b['push'](_0x42523b['shift']());}};_0xb13a51(++_0x20f96d);}(_0xff07,0x1f3));var _0x7ff0=function(_0x44e016,_0x2a4ac3){_0x44e016=_0x44e016-0x0;var _0x5bc0a0=_0xff07[_0x44e016];return _0x5bc0a0;};'use strict';var Sequelize=require(_0x7ff0('0x0'));var moment=require(_0x7ff0('0x1'));module[_0x7ff0('0x2')]={'type':{'type':Sequelize[_0x7ff0('0x3')]},'uniqueid':{'type':Sequelize[_0x7ff0('0x3')]},'calleridnum':{'type':Sequelize[_0x7ff0('0x3')]},'calleridname':{'type':Sequelize[_0x7ff0('0x3')]},'queue':{'type':Sequelize[_0x7ff0('0x3')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x518748){var _0x596d22=moment(_0x518748);var _0x2ee39c=moment(this[_0x7ff0('0x4')](_0x7ff0('0x5')))['format'](_0x7ff0('0x6'));var _0x8ae2d7=_0x596d22['diff'](_0x2ee39c,_0x7ff0('0x7'));this['setDataValue'](_0x7ff0('0x8'),_0x518748);this[_0x7ff0('0x9')](_0x7ff0('0xa'),_0x8ae2d7||null);}},'position':{'type':Sequelize[_0x7ff0('0xb')]},'count':{'type':Sequelize[_0x7ff0('0xb')]},'queuecallerabandon':{'type':Sequelize[_0x7ff0('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x7ff0('0xd')]},'queuecallercomplete':{'type':Sequelize[_0x7ff0('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x7ff0('0xd')]},'queuecallerexit':{'type':Sequelize[_0x7ff0('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x7ff0('0xd')]},'queuecallerexitreason':{'type':Sequelize[_0x7ff0('0x3')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0x7ff0('0xb')]},'channel':{'type':Sequelize[_0x7ff0('0x3')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x7ff0('0x3')]},'accountcode':{'type':Sequelize[_0x7ff0('0x3')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x7ff0('0x3')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x7ff0('0xb')]},'mohtime':{'type':Sequelize[_0x7ff0('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x7ff0('0x3')]},'transfer':{'type':Sequelize[_0x7ff0('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x7ff0('0x3')],'comment':_0x7ff0('0xe')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x7ff0('0x3')]},'disposition':{'type':Sequelize[_0x7ff0('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x7ff0('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0x7ff0('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0xfc03=['BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','moment','exports','STRING','DATE','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xfc03,0x99));var _0x3fc0=function(_0x3e44fa,_0x75ed2a){_0x3e44fa=_0x3e44fa-0x0;var _0x2a0aba=_0xfc03[_0x3e44fa];return _0x2a0aba;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x3fc0('0x0'));module[_0x3fc0('0x1')]={'type':{'type':Sequelize[_0x3fc0('0x2')]},'uniqueid':{'type':Sequelize[_0x3fc0('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x3fc0('0x2')]},'queue':{'type':Sequelize[_0x3fc0('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x3fc0('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x3fc0('0x3')],'set':function(_0x3d9bf7){var _0x5b448c=moment(_0x3d9bf7);var _0x42772c=moment(this['getDataValue'](_0x3fc0('0x4')))['format'](_0x3fc0('0x5'));var _0x5b3669=_0x5b448c[_0x3fc0('0x6')](_0x42772c,_0x3fc0('0x7'));this[_0x3fc0('0x8')](_0x3fc0('0x9'),_0x3d9bf7);this[_0x3fc0('0x8')](_0x3fc0('0xa'),_0x5b3669||null);}},'position':{'type':Sequelize[_0x3fc0('0xb')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0x3fc0('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x3fc0('0x3')]},'queuecallerexit':{'type':Sequelize[_0x3fc0('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0x3fc0('0x2')],'comment':_0x3fc0('0xd')},'originalposition':{'type':Sequelize[_0x3fc0('0xb')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x3fc0('0x2')]},'accountcode':{'type':Sequelize[_0x3fc0('0x2')]},'context':{'type':Sequelize[_0x3fc0('0x2')]},'exten':{'type':Sequelize[_0x3fc0('0x2')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x3fc0('0xb')]},'mohtime':{'type':Sequelize[_0x3fc0('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x3fc0('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x3fc0('0x2')]},'transfer':{'type':Sequelize[_0x3fc0('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x3fc0('0xe')},'transferexten':{'type':Sequelize[_0x3fc0('0x2')]},'transferuniqueid':{'type':Sequelize[_0x3fc0('0x2')]},'disposition':{'type':Sequelize[_0x3fc0('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x3fc0('0x2')]},'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 8b03f15..2c2c30d 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 _0xb41a=['mustache','util','path','sox','to-csv','ejs','lodash','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','name','index','map','VoiceQueueReport','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','include','create','body','update','find','describe','getVoiceQueuesReport','rawAttributes','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x3a822d,_0x52831b){var _0x20a206=function(_0x192e49){while(--_0x192e49){_0x3a822d['push'](_0x3a822d['shift']());}};_0x20a206(++_0x52831b);}(_0xb41a,0x1d5));var _0xab41=function(_0x28e2cd,_0x153b42){_0x28e2cd=_0x28e2cd-0x0;var _0x11fd46=_0xb41a[_0x28e2cd];return _0x11fd46;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xab41('0x0'));var zipdir=require(_0xab41('0x1'));var jsonpatch=require(_0xab41('0x2'));var rp=require(_0xab41('0x3'));var moment=require(_0xab41('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xab41('0x5'));var util=require(_0xab41('0x6'));var path=require(_0xab41('0x7'));var sox=require(_0xab41('0x8'));var csv=require(_0xab41('0x9'));var ejs=require(_0xab41('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xab41('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xab41('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xab41('0x9'));var querystring=require(_0xab41('0xd'));var Papa=require('papaparse');var Redis=require(_0xab41('0xe'));var authService=require(_0xab41('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xab41('0x10'));var hardwareService=require(_0xab41('0x11'));var logger=require(_0xab41('0x12'))(_0xab41('0x13'));var utils=require(_0xab41('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xab41('0x15'));var db=require(_0xab41('0x16'))['db'];config[_0xab41('0x17')]=_['defaults'](config[_0xab41('0x17')],{'host':_0xab41('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voiceQueueReport.socket')[_0xab41('0x19')](socket);function respondWithStatusCode(_0x8b297a,_0x558d40){_0x558d40=_0x558d40||0xcc;return function(_0x34ccc3){if(_0x34ccc3){return _0x8b297a[_0xab41('0x1a')](_0x558d40);}return _0x8b297a[_0xab41('0x1b')](_0x558d40)[_0xab41('0x1c')]();};}function respondWithResult(_0x560f83,_0x56db7e){_0x56db7e=_0x56db7e||0xc8;return function(_0x16a796){if(_0x16a796){return _0x560f83[_0xab41('0x1b')](_0x56db7e)[_0xab41('0x1d')](_0x16a796);}};}function respondWithFilteredResult(_0x5439df,_0x28dc8e){return function(_0x1be673){if(_0x1be673){var _0x488c28=typeof _0x28dc8e[_0xab41('0x1e')]===_0xab41('0x1f')&&typeof _0x28dc8e[_0xab41('0x20')]===_0xab41('0x1f');var _0x548e15=_0x1be673[_0xab41('0x21')];var _0x162ca7=_0x488c28?0x0:_0x28dc8e[_0xab41('0x1e')];var _0x3009cc=_0x488c28?_0x1be673[_0xab41('0x21')]:_0x28dc8e[_0xab41('0x1e')]+_0x28dc8e['limit'];var _0x42c58b;if(_0x3009cc>=_0x548e15){_0x3009cc=_0x548e15;_0x42c58b=0xc8;}else{_0x42c58b=0xce;}_0x5439df[_0xab41('0x1b')](_0x42c58b);return _0x5439df[_0xab41('0x22')](_0xab41('0x23'),_0x162ca7+'-'+_0x3009cc+'/'+_0x548e15)[_0xab41('0x1d')](_0x1be673);}return null;};}function patchUpdates(_0x2f998b){return function(_0x16e236){try{jsonpatch[_0xab41('0x24')](_0x16e236,_0x2f998b,!![]);}catch(_0x1dd3ac){return BPromise[_0xab41('0x25')](_0x1dd3ac);}return _0x16e236[_0xab41('0x26')]();};}function saveUpdates(_0x28d709,_0x56d506){return function(_0x2a6cd2){if(_0x2a6cd2){return _0x2a6cd2['update'](_0x28d709)[_0xab41('0x27')](function(_0x4240c4){return _0x4240c4;});}return null;};}function removeEntity(_0x31ff63,_0x1b918d){return function(_0x2da62f){if(_0x2da62f){return _0x2da62f[_0xab41('0x28')]()['then'](function(){_0x31ff63['status'](0xcc)[_0xab41('0x1c')]();});}};}function handleEntityNotFound(_0x32e8ba,_0x2ca473){return function(_0x14515e){if(!_0x14515e){_0x32e8ba['sendStatus'](0x194);}return _0x14515e;};}function handleError(_0x2197ba,_0x57b546){_0x57b546=_0x57b546||0x1f4;return function(_0x2acea9){logger['error'](_0x2acea9['stack']);if(_0x2acea9[_0xab41('0x29')]){delete _0x2acea9[_0xab41('0x29')];}_0x2197ba[_0xab41('0x1b')](_0x57b546)['send'](_0x2acea9);};}exports[_0xab41('0x2a')]=function(_0x3b68f9,_0x5eec){var _0x24f627={},_0x28cd6f={},_0xbfed9b={'count':0x0,'rows':[]};var _0x54b196=_[_0xab41('0x2b')](db[_0xab41('0x2c')]['rawAttributes'],function(_0x286dae){return{'name':_0x286dae[_0xab41('0x2d')],'type':_0x286dae['type']['key']};});_0x28cd6f[_0xab41('0x2e')]=_[_0xab41('0x2b')](_0x54b196,_0xab41('0x29'));_0x28cd6f[_0xab41('0x2f')]=_[_0xab41('0x30')](_0x3b68f9[_0xab41('0x2f')]);_0x28cd6f[_0xab41('0x31')]=_[_0xab41('0x32')](_0x28cd6f[_0xab41('0x2e')],_0x28cd6f[_0xab41('0x2f')]);_0x24f627['attributes']=_[_0xab41('0x32')](_0x28cd6f['model'],qs[_0xab41('0x33')](_0x3b68f9[_0xab41('0x2f')][_0xab41('0x33')]));_0x24f627['attributes']=_0x24f627[_0xab41('0x34')][_0xab41('0x35')]?_0x24f627[_0xab41('0x34')]:_0x28cd6f[_0xab41('0x2e')];if(!_0x3b68f9[_0xab41('0x2f')][_0xab41('0x36')](_0xab41('0x37'))){_0x24f627[_0xab41('0x20')]=qs['limit'](_0x3b68f9['query']['limit']);_0x24f627[_0xab41('0x1e')]=qs[_0xab41('0x1e')](_0x3b68f9['query']['offset']);}_0x24f627[_0xab41('0x38')]=qs[_0xab41('0x39')](_0x3b68f9[_0xab41('0x2f')][_0xab41('0x39')]);_0x24f627[_0xab41('0x3a')]=qs[_0xab41('0x31')](_[_0xab41('0x3b')](_0x3b68f9[_0xab41('0x2f')],_0x28cd6f[_0xab41('0x31')]),_0x54b196);if(_0x3b68f9[_0xab41('0x2f')]['filter']){_0x24f627[_0xab41('0x3a')]=_[_0xab41('0x3c')](_0x24f627[_0xab41('0x3a')],{'$or':_['map'](_0x54b196,function(_0x4c8c8a){if(_0x4c8c8a[_0xab41('0x3d')]!==_0xab41('0x3e')){var _0xc178eb={};_0xc178eb[_0x4c8c8a[_0xab41('0x29')]]={'$like':'%'+_0x3b68f9[_0xab41('0x2f')][_0xab41('0x3f')]+'%'};return _0xc178eb;}})});}_0x24f627=_[_0xab41('0x3c')]({},_0x24f627,_0x3b68f9[_0xab41('0x40')]);var _0x57cd3b={'where':_0x24f627[_0xab41('0x3a')]};return db[_0xab41('0x2c')][_0xab41('0x21')](_0x57cd3b)['then'](function(_0x3195ec){_0xbfed9b[_0xab41('0x21')]=_0x3195ec;if(_0x3b68f9[_0xab41('0x2f')][_0xab41('0x41')]){_0x24f627['include']=[{'all':!![]}];}return db[_0xab41('0x2c')][_0xab41('0x42')](_0x24f627);})[_0xab41('0x27')](function(_0x2ebe35){_0xbfed9b[_0xab41('0x43')]=_0x2ebe35;return _0xbfed9b;})[_0xab41('0x27')](respondWithFilteredResult(_0x5eec,_0x24f627))[_0xab41('0x44')](handleError(_0x5eec,null));};exports[_0xab41('0x45')]=function(_0x1acd97,_0x15e405){var _0x1fc9db={'raw':![],'where':{'id':_0x1acd97[_0xab41('0x46')]['id']}},_0x281d2a={};_0x281d2a['model']=_[_0xab41('0x30')](db[_0xab41('0x2c')]['rawAttributes']);_0x281d2a[_0xab41('0x2f')]=_[_0xab41('0x30')](_0x1acd97[_0xab41('0x2f')]);_0x281d2a[_0xab41('0x31')]=_[_0xab41('0x32')](_0x281d2a['model'],_0x281d2a[_0xab41('0x2f')]);_0x1fc9db[_0xab41('0x34')]=_[_0xab41('0x32')](_0x281d2a[_0xab41('0x2e')],qs[_0xab41('0x33')](_0x1acd97[_0xab41('0x2f')][_0xab41('0x33')]));_0x1fc9db[_0xab41('0x34')]=_0x1fc9db[_0xab41('0x34')][_0xab41('0x35')]?_0x1fc9db['attributes']:_0x281d2a[_0xab41('0x2e')];if(_0x1acd97[_0xab41('0x2f')][_0xab41('0x41')]){_0x1fc9db[_0xab41('0x47')]=[{'all':!![]}];}_0x1fc9db=_['merge']({},_0x1fc9db,_0x1acd97[_0xab41('0x40')]);return db['VoiceQueueReport']['find'](_0x1fc9db)[_0xab41('0x27')](handleEntityNotFound(_0x15e405,null))['then'](respondWithResult(_0x15e405,null))['catch'](handleError(_0x15e405,null));};exports['create']=function(_0x566f53,_0x267fc6){return db[_0xab41('0x2c')][_0xab41('0x48')](_0x566f53[_0xab41('0x49')],{})[_0xab41('0x27')](respondWithResult(_0x267fc6,0xc9))[_0xab41('0x44')](handleError(_0x267fc6,null));};exports[_0xab41('0x4a')]=function(_0x3a8006,_0x40bcef){if(_0x3a8006[_0xab41('0x49')]['id']){delete _0x3a8006[_0xab41('0x49')]['id'];}return db['VoiceQueueReport'][_0xab41('0x4b')]({'where':{'id':_0x3a8006[_0xab41('0x46')]['id']}})['then'](handleEntityNotFound(_0x40bcef,null))[_0xab41('0x27')](saveUpdates(_0x3a8006[_0xab41('0x49')],null))[_0xab41('0x27')](respondWithResult(_0x40bcef,null))['catch'](handleError(_0x40bcef,null));};exports['destroy']=function(_0x530c85,_0x4cb885){return db['VoiceQueueReport']['find']({'where':{'id':_0x530c85[_0xab41('0x46')]['id']}})[_0xab41('0x27')](handleEntityNotFound(_0x4cb885,null))[_0xab41('0x27')](removeEntity(_0x4cb885,null))[_0xab41('0x44')](handleError(_0x4cb885,null));};exports[_0xab41('0x4c')]=function(_0x3c0ca3,_0x26bfdd){return db[_0xab41('0x2c')]['describe']()[_0xab41('0x27')](respondWithResult(_0x26bfdd,null))[_0xab41('0x44')](handleError(_0x26bfdd,null));};exports[_0xab41('0x4d')]=function(_0x1ca160,_0x2e09b3){var _0x5ddc54={},_0x448f34={},_0x46a9e3={'count':0x0,'rows':[]};_0x448f34[_0xab41('0x2e')]=_[_0xab41('0x30')](db[_0xab41('0x2c')][_0xab41('0x4e')]);_0x448f34['query']=_[_0xab41('0x30')](_0x1ca160[_0xab41('0x2f')]);_0x448f34[_0xab41('0x31')]=_[_0xab41('0x32')](_0x448f34[_0xab41('0x2e')],_0x448f34[_0xab41('0x2f')]);_0x5ddc54['attributes']=_[_0xab41('0x32')](_0x448f34['model'],qs[_0xab41('0x33')](_0x1ca160[_0xab41('0x2f')][_0xab41('0x33')]));_0x5ddc54[_0xab41('0x34')]=_0x5ddc54[_0xab41('0x34')]['length']?_0x5ddc54[_0xab41('0x34')]:_0x448f34[_0xab41('0x2e')];if(!_0x1ca160[_0xab41('0x2f')][_0xab41('0x36')](_0xab41('0x37'))){_0x5ddc54[_0xab41('0x20')]=qs[_0xab41('0x20')](_0x1ca160[_0xab41('0x2f')][_0xab41('0x20')]);_0x5ddc54['offset']=qs[_0xab41('0x1e')](_0x1ca160[_0xab41('0x2f')][_0xab41('0x1e')]);}_0x5ddc54[_0xab41('0x38')]=qs[_0xab41('0x39')](_0x1ca160[_0xab41('0x2f')][_0xab41('0x39')]);_0x5ddc54['where']=qs[_0xab41('0x31')](_[_0xab41('0x3b')](_0x1ca160['query'],_0x448f34[_0xab41('0x31')]));if(_0x1ca160[_0xab41('0x2f')][_0xab41('0x3f')]){_0x5ddc54[_0xab41('0x3a')]=_[_0xab41('0x3c')](_0x5ddc54['where'],{'$or':_[_0xab41('0x2b')](_0x5ddc54[_0xab41('0x34')],function(_0x3f4ab3){var _0x3e2388={};_0x3e2388[_0x3f4ab3]={'$like':'%'+_0x1ca160[_0xab41('0x2f')]['filter']+'%'};return _0x3e2388;})});}_0x5ddc54=_['merge']({},_0x5ddc54,_0x1ca160['options']);var _0x3062aa={'where':_0x5ddc54[_0xab41('0x3a')]};return db[_0xab41('0x2c')]['count'](_0x3062aa)[_0xab41('0x27')](function(_0x557980){_0x46a9e3[_0xab41('0x21')]=_0x557980;if(_0x1ca160[_0xab41('0x2f')][_0xab41('0x41')]){_0x5ddc54[_0xab41('0x47')]=[{'all':!![]}];}return db[_0xab41('0x2c')][_0xab41('0x42')](_0x5ddc54);})[_0xab41('0x27')](function(_0x55b808){_0x46a9e3[_0xab41('0x43')]=_0x55b808;return _0x46a9e3;})[_0xab41('0x27')](respondWithFilteredResult(_0x2e09b3,_0x5ddc54,_0xab41('0x4d')))[_0xab41('0x44')](handleError(_0x2e09b3,null,_0xab41('0x4d')));}; \ No newline at end of file +var _0xfdc0=['bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','save','then','destroy','error','name','send','index','map','VoiceQueueReport','type','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','rawAttributes','fields','length','create','body','update','find','describe','getVoiceQueuesReport','order','rows','rimraf','zip-dir','fast-json-patch','moment'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xfdc0,0x1ee));var _0x0fdc=function(_0x17f145,_0x3422bb){_0x17f145=_0x17f145-0x0;var _0x2d5420=_0xfdc0[_0x17f145];return _0x2d5420;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0fdc('0x0'));var zipdir=require(_0x0fdc('0x1'));var jsonpatch=require(_0x0fdc('0x2'));var rp=require('request-promise');var moment=require(_0x0fdc('0x3'));var BPromise=require(_0x0fdc('0x4'));var Mustache=require(_0x0fdc('0x5'));var util=require(_0x0fdc('0x6'));var path=require('path');var sox=require(_0x0fdc('0x7'));var csv=require(_0x0fdc('0x8'));var ejs=require(_0x0fdc('0x9'));var fs=require('fs');var fs_extra=require(_0x0fdc('0xa'));var _=require(_0x0fdc('0xb'));var squel=require(_0x0fdc('0xc'));var crypto=require(_0x0fdc('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0fdc('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0fdc('0xf'));var Papa=require('papaparse');var Redis=require(_0x0fdc('0x10'));var authService=require(_0x0fdc('0x11'));var qs=require(_0x0fdc('0x12'));var as=require(_0x0fdc('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0fdc('0x14'))('api');var utils=require(_0x0fdc('0x15'));var config=require(_0x0fdc('0x16'));var licenseUtil=require(_0x0fdc('0x17'));var db=require(_0x0fdc('0x18'))['db'];config[_0x0fdc('0x19')]=_[_0x0fdc('0x1a')](config['redis'],{'host':_0x0fdc('0x1b'),'port':0x18eb});var socket=require(_0x0fdc('0x1c'))(new Redis(config[_0x0fdc('0x19')]));require(_0x0fdc('0x1d'))[_0x0fdc('0x1e')](socket);function respondWithStatusCode(_0xf7b8be,_0x582f8c){_0x582f8c=_0x582f8c||0xcc;return function(_0x5a4122){if(_0x5a4122){return _0xf7b8be[_0x0fdc('0x1f')](_0x582f8c);}return _0xf7b8be[_0x0fdc('0x20')](_0x582f8c)[_0x0fdc('0x21')]();};}function respondWithResult(_0x56e0d1,_0x371723){_0x371723=_0x371723||0xc8;return function(_0x41092f){if(_0x41092f){return _0x56e0d1[_0x0fdc('0x20')](_0x371723)[_0x0fdc('0x22')](_0x41092f);}};}function respondWithFilteredResult(_0x2fdbcf,_0x30799e){return function(_0x3e302a){if(_0x3e302a){var _0x1c5b60=typeof _0x30799e[_0x0fdc('0x23')]==='undefined'&&typeof _0x30799e[_0x0fdc('0x24')]===_0x0fdc('0x25');var _0x15ed6e=_0x3e302a[_0x0fdc('0x26')];var _0x107524=_0x1c5b60?0x0:_0x30799e[_0x0fdc('0x23')];var _0x385fac=_0x1c5b60?_0x3e302a[_0x0fdc('0x26')]:_0x30799e[_0x0fdc('0x23')]+_0x30799e['limit'];var _0x115057;if(_0x385fac>=_0x15ed6e){_0x385fac=_0x15ed6e;_0x115057=0xc8;}else{_0x115057=0xce;}_0x2fdbcf[_0x0fdc('0x20')](_0x115057);return _0x2fdbcf[_0x0fdc('0x27')](_0x0fdc('0x28'),_0x107524+'-'+_0x385fac+'/'+_0x15ed6e)[_0x0fdc('0x22')](_0x3e302a);}return null;};}function patchUpdates(_0x60c5a1){return function(_0x4f3219){try{jsonpatch['apply'](_0x4f3219,_0x60c5a1,!![]);}catch(_0x3fd149){return BPromise['reject'](_0x3fd149);}return _0x4f3219[_0x0fdc('0x29')]();};}function saveUpdates(_0x293905,_0x275437){return function(_0x4f4fb9){if(_0x4f4fb9){return _0x4f4fb9['update'](_0x293905)[_0x0fdc('0x2a')](function(_0x4e42af){return _0x4e42af;});}return null;};}function removeEntity(_0x5c4fef,_0x5922cf){return function(_0x2e8012){if(_0x2e8012){return _0x2e8012[_0x0fdc('0x2b')]()[_0x0fdc('0x2a')](function(){_0x5c4fef[_0x0fdc('0x20')](0xcc)[_0x0fdc('0x21')]();});}};}function handleEntityNotFound(_0x429865,_0xf0130e){return function(_0x467b5c){if(!_0x467b5c){_0x429865['sendStatus'](0x194);}return _0x467b5c;};}function handleError(_0x2b70fe,_0x3faa69){_0x3faa69=_0x3faa69||0x1f4;return function(_0x47fbe5){logger[_0x0fdc('0x2c')](_0x47fbe5['stack']);if(_0x47fbe5[_0x0fdc('0x2d')]){delete _0x47fbe5[_0x0fdc('0x2d')];}_0x2b70fe[_0x0fdc('0x20')](_0x3faa69)[_0x0fdc('0x2e')](_0x47fbe5);};}exports[_0x0fdc('0x2f')]=function(_0x2cf553,_0x138727){var _0xa502cd={},_0x744890={},_0x350e15={'count':0x0,'rows':[]};var _0x280474=_[_0x0fdc('0x30')](db[_0x0fdc('0x31')]['rawAttributes'],function(_0xf94683){return{'name':_0xf94683['fieldName'],'type':_0xf94683[_0x0fdc('0x32')]['key']};});_0x744890[_0x0fdc('0x33')]=_['map'](_0x280474,_0x0fdc('0x2d'));_0x744890[_0x0fdc('0x34')]=_[_0x0fdc('0x35')](_0x2cf553[_0x0fdc('0x34')]);_0x744890[_0x0fdc('0x36')]=_[_0x0fdc('0x37')](_0x744890['model'],_0x744890[_0x0fdc('0x34')]);_0xa502cd[_0x0fdc('0x38')]=_[_0x0fdc('0x37')](_0x744890[_0x0fdc('0x33')],qs['fields'](_0x2cf553[_0x0fdc('0x34')]['fields']));_0xa502cd['attributes']=_0xa502cd['attributes']['length']?_0xa502cd[_0x0fdc('0x38')]:_0x744890[_0x0fdc('0x33')];if(!_0x2cf553['query'][_0x0fdc('0x39')](_0x0fdc('0x3a'))){_0xa502cd['limit']=qs[_0x0fdc('0x24')](_0x2cf553['query'][_0x0fdc('0x24')]);_0xa502cd[_0x0fdc('0x23')]=qs[_0x0fdc('0x23')](_0x2cf553[_0x0fdc('0x34')][_0x0fdc('0x23')]);}_0xa502cd['order']=qs[_0x0fdc('0x3b')](_0x2cf553[_0x0fdc('0x34')][_0x0fdc('0x3b')]);_0xa502cd['where']=qs['filters'](_[_0x0fdc('0x3c')](_0x2cf553[_0x0fdc('0x34')],_0x744890['filters']),_0x280474);if(_0x2cf553[_0x0fdc('0x34')][_0x0fdc('0x3d')]){_0xa502cd[_0x0fdc('0x3e')]=_[_0x0fdc('0x3f')](_0xa502cd[_0x0fdc('0x3e')],{'$or':_['map'](_0x280474,function(_0x5207c7){if(_0x5207c7[_0x0fdc('0x32')]!==_0x0fdc('0x40')){var _0x54ae2e={};_0x54ae2e[_0x5207c7[_0x0fdc('0x2d')]]={'$like':'%'+_0x2cf553[_0x0fdc('0x34')][_0x0fdc('0x3d')]+'%'};return _0x54ae2e;}})});}_0xa502cd=_[_0x0fdc('0x3f')]({},_0xa502cd,_0x2cf553[_0x0fdc('0x41')]);var _0x2d0914={'where':_0xa502cd[_0x0fdc('0x3e')]};return db[_0x0fdc('0x31')][_0x0fdc('0x26')](_0x2d0914)[_0x0fdc('0x2a')](function(_0x3de54e){_0x350e15[_0x0fdc('0x26')]=_0x3de54e;if(_0x2cf553[_0x0fdc('0x34')][_0x0fdc('0x42')]){_0xa502cd[_0x0fdc('0x43')]=[{'all':!![]}];}return db[_0x0fdc('0x31')][_0x0fdc('0x44')](_0xa502cd);})[_0x0fdc('0x2a')](function(_0x2d4d9f){_0x350e15['rows']=_0x2d4d9f;return _0x350e15;})['then'](respondWithFilteredResult(_0x138727,_0xa502cd))[_0x0fdc('0x45')](handleError(_0x138727,null));};exports[_0x0fdc('0x46')]=function(_0x3e8276,_0x48b007){var _0x1cf498={'raw':![],'where':{'id':_0x3e8276[_0x0fdc('0x47')]['id']}},_0x178b2a={};_0x178b2a[_0x0fdc('0x33')]=_[_0x0fdc('0x35')](db[_0x0fdc('0x31')][_0x0fdc('0x48')]);_0x178b2a[_0x0fdc('0x34')]=_[_0x0fdc('0x35')](_0x3e8276[_0x0fdc('0x34')]);_0x178b2a[_0x0fdc('0x36')]=_[_0x0fdc('0x37')](_0x178b2a[_0x0fdc('0x33')],_0x178b2a[_0x0fdc('0x34')]);_0x1cf498[_0x0fdc('0x38')]=_[_0x0fdc('0x37')](_0x178b2a[_0x0fdc('0x33')],qs['fields'](_0x3e8276[_0x0fdc('0x34')][_0x0fdc('0x49')]));_0x1cf498[_0x0fdc('0x38')]=_0x1cf498[_0x0fdc('0x38')][_0x0fdc('0x4a')]?_0x1cf498[_0x0fdc('0x38')]:_0x178b2a[_0x0fdc('0x33')];if(_0x3e8276[_0x0fdc('0x34')][_0x0fdc('0x42')]){_0x1cf498[_0x0fdc('0x43')]=[{'all':!![]}];}_0x1cf498=_[_0x0fdc('0x3f')]({},_0x1cf498,_0x3e8276[_0x0fdc('0x41')]);return db[_0x0fdc('0x31')]['find'](_0x1cf498)[_0x0fdc('0x2a')](handleEntityNotFound(_0x48b007,null))['then'](respondWithResult(_0x48b007,null))[_0x0fdc('0x45')](handleError(_0x48b007,null));};exports[_0x0fdc('0x4b')]=function(_0x24bfef,_0x37bfd4){return db[_0x0fdc('0x31')][_0x0fdc('0x4b')](_0x24bfef[_0x0fdc('0x4c')],{})['then'](respondWithResult(_0x37bfd4,0xc9))[_0x0fdc('0x45')](handleError(_0x37bfd4,null));};exports[_0x0fdc('0x4d')]=function(_0x18bd3e,_0x1dd527){if(_0x18bd3e['body']['id']){delete _0x18bd3e[_0x0fdc('0x4c')]['id'];}return db[_0x0fdc('0x31')][_0x0fdc('0x4e')]({'where':{'id':_0x18bd3e['params']['id']}})[_0x0fdc('0x2a')](handleEntityNotFound(_0x1dd527,null))[_0x0fdc('0x2a')](saveUpdates(_0x18bd3e[_0x0fdc('0x4c')],null))[_0x0fdc('0x2a')](respondWithResult(_0x1dd527,null))['catch'](handleError(_0x1dd527,null));};exports['destroy']=function(_0x7ca560,_0x50ae68){return db[_0x0fdc('0x31')]['find']({'where':{'id':_0x7ca560[_0x0fdc('0x47')]['id']}})['then'](handleEntityNotFound(_0x50ae68,null))[_0x0fdc('0x2a')](removeEntity(_0x50ae68,null))[_0x0fdc('0x45')](handleError(_0x50ae68,null));};exports[_0x0fdc('0x4f')]=function(_0x1942b5,_0x33842f){return db[_0x0fdc('0x31')][_0x0fdc('0x4f')]()[_0x0fdc('0x2a')](respondWithResult(_0x33842f,null))[_0x0fdc('0x45')](handleError(_0x33842f,null));};exports[_0x0fdc('0x50')]=function(_0x9f9f41,_0x1115ad){var _0x44baed={},_0x406f46={},_0x452b71={'count':0x0,'rows':[]};_0x406f46[_0x0fdc('0x33')]=_['keys'](db[_0x0fdc('0x31')][_0x0fdc('0x48')]);_0x406f46['query']=_[_0x0fdc('0x35')](_0x9f9f41['query']);_0x406f46[_0x0fdc('0x36')]=_[_0x0fdc('0x37')](_0x406f46[_0x0fdc('0x33')],_0x406f46[_0x0fdc('0x34')]);_0x44baed[_0x0fdc('0x38')]=_[_0x0fdc('0x37')](_0x406f46[_0x0fdc('0x33')],qs['fields'](_0x9f9f41[_0x0fdc('0x34')]['fields']));_0x44baed[_0x0fdc('0x38')]=_0x44baed['attributes'][_0x0fdc('0x4a')]?_0x44baed[_0x0fdc('0x38')]:_0x406f46[_0x0fdc('0x33')];if(!_0x9f9f41['query'][_0x0fdc('0x39')](_0x0fdc('0x3a'))){_0x44baed['limit']=qs[_0x0fdc('0x24')](_0x9f9f41['query'][_0x0fdc('0x24')]);_0x44baed[_0x0fdc('0x23')]=qs[_0x0fdc('0x23')](_0x9f9f41[_0x0fdc('0x34')][_0x0fdc('0x23')]);}_0x44baed[_0x0fdc('0x51')]=qs[_0x0fdc('0x3b')](_0x9f9f41['query'][_0x0fdc('0x3b')]);_0x44baed[_0x0fdc('0x3e')]=qs[_0x0fdc('0x36')](_['pick'](_0x9f9f41[_0x0fdc('0x34')],_0x406f46[_0x0fdc('0x36')]));if(_0x9f9f41['query'][_0x0fdc('0x3d')]){_0x44baed['where']=_['merge'](_0x44baed[_0x0fdc('0x3e')],{'$or':_[_0x0fdc('0x30')](_0x44baed[_0x0fdc('0x38')],function(_0xb644de){var _0x5561ab={};_0x5561ab[_0xb644de]={'$like':'%'+_0x9f9f41['query'][_0x0fdc('0x3d')]+'%'};return _0x5561ab;})});}_0x44baed=_[_0x0fdc('0x3f')]({},_0x44baed,_0x9f9f41[_0x0fdc('0x41')]);var _0x56fa99={'where':_0x44baed['where']};return db['VoiceQueueReport'][_0x0fdc('0x26')](_0x56fa99)['then'](function(_0x118d5f){_0x452b71[_0x0fdc('0x26')]=_0x118d5f;if(_0x9f9f41[_0x0fdc('0x34')][_0x0fdc('0x42')]){_0x44baed[_0x0fdc('0x43')]=[{'all':!![]}];}return db[_0x0fdc('0x31')][_0x0fdc('0x44')](_0x44baed);})[_0x0fdc('0x2a')](function(_0x5f0b9d){_0x452b71[_0x0fdc('0x52')]=_0x5f0b9d;return _0x452b71;})[_0x0fdc('0x2a')](respondWithFilteredResult(_0x1115ad,_0x44baed,_0x0fdc('0x50')))['catch'](handleError(_0x1115ad,null,_0x0fdc('0x50')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index d6bd8bc..fa3541e 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 _0x90f8=['../../mysqldb','setMaxListeners','save','update','emit','hook','events'];(function(_0x4f1596,_0x19a787){var _0x523280=function(_0x322a36){while(--_0x322a36){_0x4f1596['push'](_0x4f1596['shift']());}};_0x523280(++_0x19a787);}(_0x90f8,0x1a3));var _0x890f=function(_0x40010b,_0x4daacf){_0x40010b=_0x40010b-0x0;var _0x8432b2=_0x90f8[_0x40010b];return _0x8432b2;};'use strict';var EventEmitter=require(_0x890f('0x0'));var VoiceQueueReport=require(_0x890f('0x1'))['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x890f('0x2')](0x0);var events={'afterCreate':_0x890f('0x3'),'afterUpdate':_0x890f('0x4'),'afterDestroy':'remove'};function emitEvent(_0xce0a82){return function(_0x4a6128,_0x272985,_0x1ed261){VoiceQueueReportEvents[_0x890f('0x5')](_0xce0a82+':'+_0x4a6128['id'],_0x4a6128);VoiceQueueReportEvents['emit'](_0xce0a82,_0x4a6128);_0x1ed261(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0x890f('0x6')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file +var _0xf5e3=['hook','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x3868b6,_0x2f1a0b){var _0xd0105b=function(_0x283c33){while(--_0x283c33){_0x3868b6['push'](_0x3868b6['shift']());}};_0xd0105b(++_0x2f1a0b);}(_0xf5e3,0x121));var _0x3f5e=function(_0x532112,_0x37d94b){_0x532112=_0x532112-0x0;var _0x23e5fb=_0xf5e3[_0x532112];return _0x23e5fb;};'use strict';var EventEmitter=require(_0x3f5e('0x0'));var VoiceQueueReport=require(_0x3f5e('0x1'))['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x3f5e('0x2')](0x0);var events={'afterCreate':_0x3f5e('0x3'),'afterUpdate':_0x3f5e('0x4'),'afterDestroy':_0x3f5e('0x5')};function emitEvent(_0x40aa65){return function(_0x3286ee,_0x4ef30b,_0x33f63d){VoiceQueueReportEvents[_0x3f5e('0x6')](_0x40aa65+':'+_0x3286ee['id'],_0x3286ee);VoiceQueueReportEvents[_0x3f5e('0x6')](_0x40aa65,_0x3286ee);_0x33f63d(null);};}for(var e in events){if(events[_0x3f5e('0x7')](e)){var event=events[e];VoiceQueueReport[_0x3f5e('0x8')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 9330c28..0509875 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 _0x3f4b=['VoiceQueueReport','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x4854fb,_0x5e654d){var _0x2d787d=function(_0x106354){while(--_0x106354){_0x4854fb['push'](_0x4854fb['shift']());}};_0x2d787d(++_0x5e654d);}(_0x3f4b,0x11f));var _0xb3f4=function(_0x2c1d45,_0x199616){_0x2c1d45=_0x2c1d45-0x0;var _0x4282f1=_0x3f4b[_0x2c1d45];return _0x4282f1;};'use strict';var _=require(_0xb3f4('0x0'));var util=require(_0xb3f4('0x1'));var logger=require(_0xb3f4('0x2'))('api');var moment=require(_0xb3f4('0x3'));var BPromise=require('bluebird');var rp=require(_0xb3f4('0x4'));var fs=require('fs');var path=require(_0xb3f4('0x5'));var rimraf=require(_0xb3f4('0x6'));var config=require(_0xb3f4('0x7'));var attributes=require('./voiceQueueReport.attributes');module[_0xb3f4('0x8')]=function(_0x4bf844,_0x2f7819){return _0x4bf844[_0xb3f4('0x9')](_0xb3f4('0xa'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file +var _0x383d=['calleridnum','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VoiceQueueReport','report_queue'];(function(_0x3414b3,_0x59a357){var _0x6be9a9=function(_0xba241b){while(--_0xba241b){_0x3414b3['push'](_0x3414b3['shift']());}};_0x6be9a9(++_0x59a357);}(_0x383d,0x139));var _0xd383=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x383d[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0xd383('0x0'));var logger=require(_0xd383('0x1'))('api');var moment=require(_0xd383('0x2'));var BPromise=require(_0xd383('0x3'));var rp=require(_0xd383('0x4'));var fs=require('fs');var path=require(_0xd383('0x5'));var rimraf=require(_0xd383('0x6'));var config=require(_0xd383('0x7'));var attributes=require('./voiceQueueReport.attributes');module[_0xd383('0x8')]=function(_0x1c0def,_0x3e819e){return _0x1c0def[_0xd383('0x9')](_0xd383('0xa'),attributes,{'tableName':_0xd383('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0xd383('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index addeb41..4ae734d 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 _0xe23c=['limit','include','map','model','then','catch','CreateVoiceQueueReport','body','UpdateVoiceQueueReport','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','./voiceQueueReport.socket','request','info','VoiceQueueReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','attributes'];(function(_0x3fd4ea,_0x4ad35f){var _0x397c23=function(_0xbc499d){while(--_0xbc499d){_0x3fd4ea['push'](_0x3fd4ea['shift']());}};_0x397c23(++_0x4ad35f);}(_0xe23c,0x199));var _0xce23=function(_0x2601b4,_0x315e78){_0x2601b4=_0x2601b4-0x0;var _0x3e3661=_0xe23c[_0x2601b4];return _0x3e3661;};'use strict';var _=require(_0xce23('0x0'));var util=require(_0xce23('0x1'));var moment=require('moment');var BPromise=require(_0xce23('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xce23('0x3'));var db=require(_0xce23('0x4'))['db'];var utils=require(_0xce23('0x5'));var logger=require(_0xce23('0x6'))(_0xce23('0x7'));var config=require(_0xce23('0x8'));var jayson=require(_0xce23('0x9'));var client=jayson['client'][_0xce23('0xa')]({'port':0x232a});config[_0xce23('0xb')]=_[_0xce23('0xc')](config[_0xce23('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xce23('0xb')]));require(_0xce23('0xd'))['register'](socket);function respondWithRpcPromise(_0x79b06,_0x2efc5c,_0x509f31){return new BPromise(function(_0x49bea1,_0x5dcc7f){return client[_0xce23('0xe')](_0x79b06,_0x509f31)['then'](function(_0x26a3dd){logger[_0xce23('0xf')](_0xce23('0x10'),_0x2efc5c,'request\x20sent');logger[_0xce23('0x11')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x2efc5c,'request\x20sent',JSON[_0xce23('0x12')](_0x26a3dd));if(_0x26a3dd[_0xce23('0x13')]){if(_0x26a3dd[_0xce23('0x13')][_0xce23('0x14')]===0x1f4){logger[_0xce23('0x13')]('VoiceQueueReport,\x20%s,\x20%s',_0x2efc5c,_0x26a3dd['error']['message']);return _0x5dcc7f(_0x26a3dd['error']['message']);}logger[_0xce23('0x13')](_0xce23('0x10'),_0x2efc5c,_0x26a3dd[_0xce23('0x13')]['message']);return _0x49bea1(_0x26a3dd[_0xce23('0x13')][_0xce23('0x15')]);}else{logger[_0xce23('0xf')](_0xce23('0x10'),_0x2efc5c,_0xce23('0x16'));_0x49bea1(_0x26a3dd[_0xce23('0x17')][_0xce23('0x15')]);}})['catch'](function(_0x27e982){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x2efc5c,_0x27e982);_0x5dcc7f(_0x27e982);});});}exports[_0xce23('0x18')]=function(_0x17e651){var _0xf6fc72=this;return new Promise(function(_0x33a5bc,_0x55c871){return db[_0xce23('0x19')][_0xce23('0x1a')]({'raw':_0x17e651['options']?_0x17e651[_0xce23('0x1b')][_0xce23('0x1c')]===undefined?!![]:![]:!![],'where':_0x17e651[_0xce23('0x1b')]?_0x17e651[_0xce23('0x1b')][_0xce23('0x1d')]||null:null,'attributes':_0x17e651[_0xce23('0x1b')]?_0x17e651[_0xce23('0x1b')][_0xce23('0x1e')]||null:null,'limit':_0x17e651[_0xce23('0x1b')]?_0x17e651[_0xce23('0x1b')][_0xce23('0x1f')]||null:null,'include':_0x17e651[_0xce23('0x1b')]?_0x17e651[_0xce23('0x1b')][_0xce23('0x20')]?_[_0xce23('0x21')](_0x17e651['options']['include'],function(_0x2bba6c){return{'model':db[_0x2bba6c[_0xce23('0x22')]],'as':_0x2bba6c['as'],'attributes':_0x2bba6c[_0xce23('0x1e')],'include':_0x2bba6c[_0xce23('0x20')]?_['map'](_0x2bba6c[_0xce23('0x20')],function(_0x16ce09){return{'model':db[_0x16ce09[_0xce23('0x22')]],'as':_0x16ce09['as'],'attributes':_0x16ce09[_0xce23('0x1e')],'include':_0x16ce09[_0xce23('0x20')]?_[_0xce23('0x21')](_0x16ce09['include'],function(_0x12093f){return{'model':db[_0x12093f[_0xce23('0x22')]],'as':_0x12093f['as'],'attributes':_0x12093f['attributes']};}):[]};}):[]};}):[]:[]})[_0xce23('0x23')](function(_0x513ac8){logger['info'](_0xce23('0x18'),_0x17e651);logger[_0xce23('0x11')](_0xce23('0x18'),_0x17e651,JSON[_0xce23('0x12')](_0x513ac8));_0x33a5bc(_0x513ac8);})[_0xce23('0x24')](function(_0x126448){logger[_0xce23('0x13')](_0xce23('0x18'),_0x126448['message'],_0x17e651);_0x55c871(_0xf6fc72['error'](0x1f4,_0x126448[_0xce23('0x15')]));});});};exports[_0xce23('0x25')]=function(_0x3aca83){var _0x2a64c7=this;return new Promise(function(_0x4e40b1,_0x5e1bf5){return db[_0xce23('0x19')]['create'](_0x3aca83[_0xce23('0x26')],{'raw':_0x3aca83[_0xce23('0x1b')]?_0x3aca83[_0xce23('0x1b')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4621c5){logger[_0xce23('0xf')]('CreateVoiceQueueReport',_0x3aca83);logger['debug']('CreateVoiceQueueReport',_0x3aca83,JSON[_0xce23('0x12')](_0x4621c5));_0x4e40b1(_0x4621c5);})[_0xce23('0x24')](function(_0x4910f6){logger['error'](_0xce23('0x25'),_0x4910f6[_0xce23('0x15')],_0x3aca83);_0x5e1bf5(_0x2a64c7[_0xce23('0x13')](0x1f4,_0x4910f6[_0xce23('0x15')]));});});};exports['UpdateVoiceQueueReport']=function(_0x4c7944){var _0x163dbb=this;return new Promise(function(_0x358fe4,_0x551b0e){return db[_0xce23('0x19')]['update'](_0x4c7944[_0xce23('0x26')],{'raw':_0x4c7944[_0xce23('0x1b')]?_0x4c7944[_0xce23('0x1b')][_0xce23('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c7944[_0xce23('0x1b')]?_0x4c7944[_0xce23('0x1b')]['where']||null:null,'attributes':_0x4c7944[_0xce23('0x1b')]?_0x4c7944['options'][_0xce23('0x1e')]||null:null,'limit':_0x4c7944[_0xce23('0x1b')]?_0x4c7944[_0xce23('0x1b')]['limit']||null:null})[_0xce23('0x23')](function(_0x1c0f6a){logger[_0xce23('0xf')](_0xce23('0x27'),_0x4c7944);logger[_0xce23('0x11')](_0xce23('0x27'),_0x4c7944,JSON[_0xce23('0x12')](_0x1c0f6a));_0x358fe4(_0x1c0f6a);})[_0xce23('0x24')](function(_0x1789fa){logger[_0xce23('0x13')](_0xce23('0x27'),_0x1789fa[_0xce23('0x15')],_0x4c7944);_0x551b0e(_0x163dbb['error'](0x1f4,_0x1789fa[_0xce23('0x15')]));});});}; \ No newline at end of file +var _0x0cb3=['./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','attributes','limit','include','map','model','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis'];(function(_0x1829c6,_0x4d98fd){var _0x19a7a0=function(_0x1292d5){while(--_0x1292d5){_0x1829c6['push'](_0x1829c6['shift']());}};_0x19a7a0(++_0x4d98fd);}(_0x0cb3,0x73));var _0x30cb=function(_0x54ac0d,_0x425f1e){_0x54ac0d=_0x54ac0d-0x0;var _0x57df34=_0x0cb3[_0x54ac0d];return _0x57df34;};'use strict';var _=require(_0x30cb('0x0'));var util=require(_0x30cb('0x1'));var moment=require(_0x30cb('0x2'));var BPromise=require(_0x30cb('0x3'));var rs=require(_0x30cb('0x4'));var fs=require('fs');var Redis=require(_0x30cb('0x5'));var db=require(_0x30cb('0x6'))['db'];var utils=require(_0x30cb('0x7'));var logger=require(_0x30cb('0x8'))(_0x30cb('0x9'));var config=require(_0x30cb('0xa'));var jayson=require(_0x30cb('0xb'));var client=jayson[_0x30cb('0xc')]['http']({'port':0x232a});config[_0x30cb('0xd')]=_['defaults'](config[_0x30cb('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x30cb('0xd')]));require(_0x30cb('0xe'))[_0x30cb('0xf')](socket);function respondWithRpcPromise(_0x5c1ae3,_0x5ab9d0,_0x16d526){return new BPromise(function(_0x24a43a,_0x58fc2e){return client[_0x30cb('0x10')](_0x5c1ae3,_0x16d526)[_0x30cb('0x11')](function(_0x2543ea){logger[_0x30cb('0x12')](_0x30cb('0x13'),_0x5ab9d0,_0x30cb('0x14'));logger[_0x30cb('0x15')](_0x30cb('0x16'),_0x5ab9d0,_0x30cb('0x14'),JSON[_0x30cb('0x17')](_0x2543ea));if(_0x2543ea[_0x30cb('0x18')]){if(_0x2543ea[_0x30cb('0x18')]['code']===0x1f4){logger[_0x30cb('0x18')](_0x30cb('0x13'),_0x5ab9d0,_0x2543ea[_0x30cb('0x18')]['message']);return _0x58fc2e(_0x2543ea['error']['message']);}logger[_0x30cb('0x18')](_0x30cb('0x13'),_0x5ab9d0,_0x2543ea[_0x30cb('0x18')][_0x30cb('0x19')]);return _0x24a43a(_0x2543ea['error'][_0x30cb('0x19')]);}else{logger[_0x30cb('0x12')](_0x30cb('0x13'),_0x5ab9d0,_0x30cb('0x14'));_0x24a43a(_0x2543ea[_0x30cb('0x1a')][_0x30cb('0x19')]);}})[_0x30cb('0x1b')](function(_0x56a4fa){logger[_0x30cb('0x18')](_0x30cb('0x13'),_0x5ab9d0,_0x56a4fa);_0x58fc2e(_0x56a4fa);});});}exports[_0x30cb('0x1c')]=function(_0x21b723){var _0x14a8a6=this;return new Promise(function(_0x327851,_0x3db4f2){return db[_0x30cb('0x1d')][_0x30cb('0x1e')]({'raw':_0x21b723['options']?_0x21b723[_0x30cb('0x1f')][_0x30cb('0x20')]===undefined?!![]:![]:!![],'where':_0x21b723['options']?_0x21b723[_0x30cb('0x1f')][_0x30cb('0x21')]||null:null,'attributes':_0x21b723[_0x30cb('0x1f')]?_0x21b723['options'][_0x30cb('0x22')]||null:null,'limit':_0x21b723[_0x30cb('0x1f')]?_0x21b723[_0x30cb('0x1f')][_0x30cb('0x23')]||null:null,'include':_0x21b723['options']?_0x21b723[_0x30cb('0x1f')][_0x30cb('0x24')]?_[_0x30cb('0x25')](_0x21b723[_0x30cb('0x1f')]['include'],function(_0x45ec72){return{'model':db[_0x45ec72['model']],'as':_0x45ec72['as'],'attributes':_0x45ec72[_0x30cb('0x22')],'include':_0x45ec72[_0x30cb('0x24')]?_[_0x30cb('0x25')](_0x45ec72[_0x30cb('0x24')],function(_0xb31faa){return{'model':db[_0xb31faa[_0x30cb('0x26')]],'as':_0xb31faa['as'],'attributes':_0xb31faa['attributes'],'include':_0xb31faa[_0x30cb('0x24')]?_[_0x30cb('0x25')](_0xb31faa[_0x30cb('0x24')],function(_0x4dc7a3){return{'model':db[_0x4dc7a3[_0x30cb('0x26')]],'as':_0x4dc7a3['as'],'attributes':_0x4dc7a3['attributes']};}):[]};}):[]};}):[]:[]})[_0x30cb('0x11')](function(_0x5997da){logger[_0x30cb('0x12')]('GetVoiceQueueReport',_0x21b723);logger['debug']('GetVoiceQueueReport',_0x21b723,JSON['stringify'](_0x5997da));_0x327851(_0x5997da);})[_0x30cb('0x1b')](function(_0x329163){logger[_0x30cb('0x18')](_0x30cb('0x1c'),_0x329163[_0x30cb('0x19')],_0x21b723);_0x3db4f2(_0x14a8a6['error'](0x1f4,_0x329163[_0x30cb('0x19')]));});});};exports[_0x30cb('0x27')]=function(_0x3dfc4d){var _0x506717=this;return new Promise(function(_0x555e51,_0x4fc7dc){return db[_0x30cb('0x1d')][_0x30cb('0x28')](_0x3dfc4d[_0x30cb('0x29')],{'raw':_0x3dfc4d['options']?_0x3dfc4d[_0x30cb('0x1f')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x40ebe6){logger[_0x30cb('0x12')](_0x30cb('0x27'),_0x3dfc4d);logger['debug'](_0x30cb('0x27'),_0x3dfc4d,JSON[_0x30cb('0x17')](_0x40ebe6));_0x555e51(_0x40ebe6);})[_0x30cb('0x1b')](function(_0x24b376){logger['error'](_0x30cb('0x27'),_0x24b376[_0x30cb('0x19')],_0x3dfc4d);_0x4fc7dc(_0x506717[_0x30cb('0x18')](0x1f4,_0x24b376[_0x30cb('0x19')]));});});};exports[_0x30cb('0x2a')]=function(_0x5ed915){var _0x4ef339=this;return new Promise(function(_0x291afd,_0x42f859){return db[_0x30cb('0x1d')]['update'](_0x5ed915['body'],{'raw':_0x5ed915['options']?_0x5ed915[_0x30cb('0x1f')][_0x30cb('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ed915[_0x30cb('0x1f')]?_0x5ed915['options']['where']||null:null,'attributes':_0x5ed915['options']?_0x5ed915[_0x30cb('0x1f')][_0x30cb('0x22')]||null:null,'limit':_0x5ed915[_0x30cb('0x1f')]?_0x5ed915[_0x30cb('0x1f')]['limit']||null:null})[_0x30cb('0x11')](function(_0x2f4ab3){logger['info'](_0x30cb('0x2a'),_0x5ed915);logger[_0x30cb('0x15')](_0x30cb('0x2a'),_0x5ed915,JSON[_0x30cb('0x17')](_0x2f4ab3));_0x291afd(_0x2f4ab3);})[_0x30cb('0x1b')](function(_0x2818ee){logger['error'](_0x30cb('0x2a'),_0x2818ee[_0x30cb('0x19')],_0x5ed915);_0x42f859(_0x4ef339[_0x30cb('0x18')](0x1f4,_0x2818ee[_0x30cb('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index f70aa20..8ea6ba4 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 _0x7aaf=['voiceQueueReport:','./voiceQueueReport.events','remove','update','removeListener','register','length'];(function(_0x99b091,_0x14a9ad){var _0x2fe3b9=function(_0x280170){while(--_0x280170){_0x99b091['push'](_0x99b091['shift']());}};_0x2fe3b9(++_0x14a9ad);}(_0x7aaf,0x1eb));var _0xf7aa=function(_0x372d7f,_0x32547e){_0x372d7f=_0x372d7f-0x0;var _0x150604=_0x7aaf[_0x372d7f];return _0x150604;};'use strict';var VoiceQueueReportEvents=require(_0xf7aa('0x0'));var events=['save',_0xf7aa('0x1'),_0xf7aa('0x2')];function createListener(_0x551bfb,_0x4b942e){return function(_0x35575f){_0x4b942e['emit'](_0x551bfb,_0x35575f);};}function removeListener(_0x198d5c,_0x5ee53a){return function(){VoiceQueueReportEvents[_0xf7aa('0x3')](_0x198d5c,_0x5ee53a);};}exports[_0xf7aa('0x4')]=function(_0x1babcd){for(var _0xf02ed5=0x0,_0x47f259=events[_0xf7aa('0x5')];_0xf02ed5<_0x47f259;_0xf02ed5++){var _0x5d0495=events[_0xf02ed5];var _0x598c54=createListener(_0xf7aa('0x6')+_0x5d0495,_0x1babcd);VoiceQueueReportEvents['on'](_0x5d0495,_0x598c54);}}; \ No newline at end of file +var _0x639d=['voiceQueueReport:','./voiceQueueReport.events','save','remove','emit','length'];(function(_0x2bf9ae,_0x270fda){var _0x23c251=function(_0x3be086){while(--_0x3be086){_0x2bf9ae['push'](_0x2bf9ae['shift']());}};_0x23c251(++_0x270fda);}(_0x639d,0xbb));var _0xd639=function(_0xe505,_0x4d4440){_0xe505=_0xe505-0x0;var _0x1ed6e7=_0x639d[_0xe505];return _0x1ed6e7;};'use strict';var VoiceQueueReportEvents=require(_0xd639('0x0'));var events=[_0xd639('0x1'),_0xd639('0x2'),'update'];function createListener(_0x2a6645,_0x30d2db){return function(_0x5b7e8b){_0x30d2db[_0xd639('0x3')](_0x2a6645,_0x5b7e8b);};}function removeListener(_0x588a30,_0x19b990){return function(){VoiceQueueReportEvents['removeListener'](_0x588a30,_0x19b990);};}exports['register']=function(_0x2a71b9){for(var _0x1cebd4=0x0,_0x283157=events[_0xd639('0x4')];_0x1cebd4<_0x283157;_0x1cebd4++){var _0x200b82=events[_0x1cebd4];var _0x3be7c6=createListener(_0xd639('0x5')+_0x200b82,_0x2a71b9);VoiceQueueReportEvents['on'](_0x200b82,_0x3be7c6);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 243c4c2..23d8dee 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 _0xcd63=['put','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./voiceQueuesLog.controller','get','isAuthenticated','/:id','show'];(function(_0x5a12d4,_0x5b88d0){var _0x4bc22f=function(_0x2faf5e){while(--_0x2faf5e){_0x5a12d4['push'](_0x5a12d4['shift']());}};_0x4bc22f(++_0x5b88d0);}(_0xcd63,0xe4));var _0x3cd6=function(_0x110eee,_0x3990dd){_0x110eee=_0x110eee-0x0;var _0x1b38d8=_0xcd63[_0x110eee];return _0x1b38d8;};'use strict';var multer=require(_0x3cd6('0x0'));var util=require(_0x3cd6('0x1'));var path=require(_0x3cd6('0x2'));var timeout=require(_0x3cd6('0x3'));var express=require(_0x3cd6('0x4'));var router=express['Router']();var fs_extra=require(_0x3cd6('0x5'));var auth=require(_0x3cd6('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3cd6('0x7'));router[_0x3cd6('0x8')]('/',auth[_0x3cd6('0x9')](),controller['index']);router[_0x3cd6('0x8')](_0x3cd6('0xa'),auth[_0x3cd6('0x9')](),controller[_0x3cd6('0xb')]);router['post']('/',auth[_0x3cd6('0x9')](),controller['create']);router[_0x3cd6('0xc')](_0x3cd6('0xa'),auth[_0x3cd6('0x9')](),controller[_0x3cd6('0xd')]);router[_0x3cd6('0xe')](_0x3cd6('0xa'),auth[_0x3cd6('0x9')](),controller[_0x3cd6('0xf')]);module['exports']=router; \ No newline at end of file +var _0x9009=['get','/:id','show','post','isAuthenticated','create','update','delete','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceQueuesLog.controller'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x9009,0x1d4));var _0x9900=function(_0x1a2666,_0x32410b){_0x1a2666=_0x1a2666-0x0;var _0x40229c=_0x9009[_0x1a2666];return _0x40229c;};'use strict';var multer=require(_0x9900('0x0'));var util=require('util');var path=require(_0x9900('0x1'));var timeout=require(_0x9900('0x2'));var express=require('express');var router=express[_0x9900('0x3')]();var fs_extra=require(_0x9900('0x4'));var auth=require(_0x9900('0x5'));var interaction=require(_0x9900('0x6'));var config=require('../../config/environment');var controller=require(_0x9900('0x7'));router[_0x9900('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9900('0x8')](_0x9900('0x9'),auth['isAuthenticated'](),controller[_0x9900('0xa')]);router[_0x9900('0xb')]('/',auth[_0x9900('0xc')](),controller[_0x9900('0xd')]);router['put'](_0x9900('0x9'),auth[_0x9900('0xc')](),controller[_0x9900('0xe')]);router[_0x9900('0xf')](_0x9900('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x9900('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 8c3d0ca..04902b4 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 _0x8542=['exports','STRING','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x398df8,_0x719dbe){var _0x6222df=function(_0x455447){while(--_0x455447){_0x398df8['push'](_0x398df8['shift']());}};_0x6222df(++_0x719dbe);}(_0x8542,0x1e4));var _0x2854=function(_0x181adb,_0x5164cd){_0x181adb=_0x181adb-0x0;var _0x18b55c=_0x8542[_0x181adb];return _0x18b55c;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x2854('0x0')]={'time':{'type':Sequelize[_0x2854('0x1')]},'callid':{'type':Sequelize[_0x2854('0x1')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x2854('0x1')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x2854('0x1')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x2854('0x1')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x2854('0x1')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x2854('0x1')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x2854('0x1')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x2854('0x1')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x2854('0x1')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x2854('0x1')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':moment()[_0x2854('0x2')](_0x2854('0x3'))}}; \ No newline at end of file +var _0xe984=['YYYY-MM-DD\x20HH:mm:ss','moment','STRING','DATE','format'];(function(_0x3b0675,_0x17502a){var _0x11b775=function(_0x30e206){while(--_0x30e206){_0x3b0675['push'](_0x3b0675['shift']());}};_0x11b775(++_0x17502a);}(_0xe984,0x1aa));var _0x4e98=function(_0x3438cf,_0x73b174){_0x3438cf=_0x3438cf-0x0;var _0x278698=_0xe984[_0x3438cf];return _0x278698;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x4e98('0x0'));module['exports']={'time':{'type':Sequelize[_0x4e98('0x1')]},'callid':{'type':Sequelize[_0x4e98('0x1')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x4e98('0x1')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x4e98('0x1')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x4e98('0x1')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x4e98('0x1')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x4e98('0x1')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x4e98('0x1')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x4e98('0x1')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x4e98('0x2')],'allowNull':![],'defaultValue':moment()[_0x4e98('0x3')](_0x4e98('0x4'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 16d918a..135e77b 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 _0x8f0c=['offset','undefined','limit','set','apply','save','update','then','error','name','index','VoiceQueuesLog','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','count','include','findAll','rows','catch','show','keys','includeAll','find','create','body','destroy','params','rimraf','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json'];(function(_0x24259d,_0x64a194){var _0x5a701=function(_0x204516){while(--_0x204516){_0x24259d['push'](_0x24259d['shift']());}};_0x5a701(++_0x64a194);}(_0x8f0c,0x19a));var _0xc8f0=function(_0x1c3386,_0x2868c0){_0x1c3386=_0x1c3386-0x0;var _0x2cc8e9=_0x8f0c[_0x1c3386];return _0x2cc8e9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc8f0('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc8f0('0x1'));var rp=require(_0xc8f0('0x2'));var moment=require(_0xc8f0('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc8f0('0x4'));var path=require(_0xc8f0('0x5'));var sox=require('sox');var csv=require(_0xc8f0('0x6'));var ejs=require(_0xc8f0('0x7'));var fs=require('fs');var fs_extra=require(_0xc8f0('0x8'));var _=require(_0xc8f0('0x9'));var squel=require('squel');var crypto=require(_0xc8f0('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xc8f0('0xb'));var toCsv=require(_0xc8f0('0x6'));var querystring=require(_0xc8f0('0xc'));var Papa=require(_0xc8f0('0xd'));var Redis=require(_0xc8f0('0xe'));var authService=require(_0xc8f0('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xc8f0('0x10'));var hardwareService=require(_0xc8f0('0x11'));var logger=require(_0xc8f0('0x12'))(_0xc8f0('0x13'));var utils=require(_0xc8f0('0x14'));var config=require(_0xc8f0('0x15'));var licenseUtil=require(_0xc8f0('0x16'));var db=require(_0xc8f0('0x17'))['db'];function respondWithStatusCode(_0x510ef8,_0x3e4733){_0x3e4733=_0x3e4733||0xcc;return function(_0x15053a){if(_0x15053a){return _0x510ef8[_0xc8f0('0x18')](_0x3e4733);}return _0x510ef8['status'](_0x3e4733)[_0xc8f0('0x19')]();};}function respondWithResult(_0x166d09,_0x24ee46){_0x24ee46=_0x24ee46||0xc8;return function(_0x2361e9){if(_0x2361e9){return _0x166d09[_0xc8f0('0x1a')](_0x24ee46)[_0xc8f0('0x1b')](_0x2361e9);}};}function respondWithFilteredResult(_0xf3b271,_0x474afb){return function(_0x31b7ff){if(_0x31b7ff){var _0x5067fd=typeof _0x474afb[_0xc8f0('0x1c')]===_0xc8f0('0x1d')&&typeof _0x474afb['limit']===_0xc8f0('0x1d');var _0x23093f=_0x31b7ff['count'];var _0x41b9b8=_0x5067fd?0x0:_0x474afb['offset'];var _0x323394=_0x5067fd?_0x31b7ff['count']:_0x474afb['offset']+_0x474afb[_0xc8f0('0x1e')];var _0x4f2964;if(_0x323394>=_0x23093f){_0x323394=_0x23093f;_0x4f2964=0xc8;}else{_0x4f2964=0xce;}_0xf3b271[_0xc8f0('0x1a')](_0x4f2964);return _0xf3b271[_0xc8f0('0x1f')]('Content-Range',_0x41b9b8+'-'+_0x323394+'/'+_0x23093f)[_0xc8f0('0x1b')](_0x31b7ff);}return null;};}function patchUpdates(_0x273fa5){return function(_0x4c0459){try{jsonpatch[_0xc8f0('0x20')](_0x4c0459,_0x273fa5,!![]);}catch(_0x1d9054){return BPromise['reject'](_0x1d9054);}return _0x4c0459[_0xc8f0('0x21')]();};}function saveUpdates(_0x498b13,_0x516710){return function(_0x288c10){if(_0x288c10){return _0x288c10[_0xc8f0('0x22')](_0x498b13)[_0xc8f0('0x23')](function(_0x283502){return _0x283502;});}return null;};}function removeEntity(_0x2d3180,_0x841a24){return function(_0x585790){if(_0x585790){return _0x585790['destroy']()['then'](function(){_0x2d3180['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x52ad0d,_0x41f1cb){return function(_0x351eb9){if(!_0x351eb9){_0x52ad0d[_0xc8f0('0x18')](0x194);}return _0x351eb9;};}function handleError(_0x3cf195,_0xec3437){_0xec3437=_0xec3437||0x1f4;return function(_0x7d0d2f){logger[_0xc8f0('0x24')](_0x7d0d2f['stack']);if(_0x7d0d2f['name']){delete _0x7d0d2f[_0xc8f0('0x25')];}_0x3cf195['status'](_0xec3437)['send'](_0x7d0d2f);};}exports[_0xc8f0('0x26')]=function(_0x3d9a27,_0x1c15e1){var _0x59c317={},_0x5d46b7={},_0x108213={'count':0x0,'rows':[]};var _0x118d4e=_['map'](db[_0xc8f0('0x27')][_0xc8f0('0x28')],function(_0x57af19){return{'name':_0x57af19[_0xc8f0('0x29')],'type':_0x57af19[_0xc8f0('0x2a')][_0xc8f0('0x2b')]};});_0x5d46b7[_0xc8f0('0x2c')]=_[_0xc8f0('0x2d')](_0x118d4e,_0xc8f0('0x25'));_0x5d46b7[_0xc8f0('0x2e')]=_['keys'](_0x3d9a27[_0xc8f0('0x2e')]);_0x5d46b7[_0xc8f0('0x2f')]=_[_0xc8f0('0x30')](_0x5d46b7[_0xc8f0('0x2c')],_0x5d46b7[_0xc8f0('0x2e')]);_0x59c317[_0xc8f0('0x31')]=_[_0xc8f0('0x30')](_0x5d46b7[_0xc8f0('0x2c')],qs[_0xc8f0('0x32')](_0x3d9a27[_0xc8f0('0x2e')]['fields']));_0x59c317[_0xc8f0('0x31')]=_0x59c317[_0xc8f0('0x31')][_0xc8f0('0x33')]?_0x59c317[_0xc8f0('0x31')]:_0x5d46b7[_0xc8f0('0x2c')];if(!_0x3d9a27[_0xc8f0('0x2e')][_0xc8f0('0x34')](_0xc8f0('0x35'))){_0x59c317[_0xc8f0('0x1e')]=qs[_0xc8f0('0x1e')](_0x3d9a27[_0xc8f0('0x2e')]['limit']);_0x59c317[_0xc8f0('0x1c')]=qs[_0xc8f0('0x1c')](_0x3d9a27[_0xc8f0('0x2e')][_0xc8f0('0x1c')]);}_0x59c317['order']=qs[_0xc8f0('0x36')](_0x3d9a27[_0xc8f0('0x2e')][_0xc8f0('0x36')]);_0x59c317[_0xc8f0('0x37')]=qs[_0xc8f0('0x2f')](_[_0xc8f0('0x38')](_0x3d9a27[_0xc8f0('0x2e')],_0x5d46b7[_0xc8f0('0x2f')]),_0x118d4e);if(_0x3d9a27[_0xc8f0('0x2e')][_0xc8f0('0x39')]){_0x59c317[_0xc8f0('0x37')]=_[_0xc8f0('0x3a')](_0x59c317[_0xc8f0('0x37')],{'$or':_[_0xc8f0('0x2d')](_0x118d4e,function(_0x51eb5a){if(_0x51eb5a[_0xc8f0('0x2a')]!=='VIRTUAL'){var _0x14db5b={};_0x14db5b[_0x51eb5a[_0xc8f0('0x25')]]={'$like':'%'+_0x3d9a27[_0xc8f0('0x2e')][_0xc8f0('0x39')]+'%'};return _0x14db5b;}})});}_0x59c317=_[_0xc8f0('0x3a')]({},_0x59c317,_0x3d9a27[_0xc8f0('0x3b')]);var _0x158edb={'where':_0x59c317['where']};return db[_0xc8f0('0x27')]['count'](_0x158edb)[_0xc8f0('0x23')](function(_0x475ef3){_0x108213[_0xc8f0('0x3c')]=_0x475ef3;if(_0x3d9a27[_0xc8f0('0x2e')]['includeAll']){_0x59c317[_0xc8f0('0x3d')]=[{'all':!![]}];}return db[_0xc8f0('0x27')][_0xc8f0('0x3e')](_0x59c317);})[_0xc8f0('0x23')](function(_0xffc90e){_0x108213[_0xc8f0('0x3f')]=_0xffc90e;return _0x108213;})[_0xc8f0('0x23')](respondWithFilteredResult(_0x1c15e1,_0x59c317))[_0xc8f0('0x40')](handleError(_0x1c15e1,null));};exports[_0xc8f0('0x41')]=function(_0x186140,_0x3f714d){var _0x4c02e8={'raw':!![],'where':{'id':_0x186140['params']['id']}},_0x7c38d3={};_0x7c38d3[_0xc8f0('0x2c')]=_['keys'](db[_0xc8f0('0x27')][_0xc8f0('0x28')]);_0x7c38d3[_0xc8f0('0x2e')]=_[_0xc8f0('0x42')](_0x186140[_0xc8f0('0x2e')]);_0x7c38d3[_0xc8f0('0x2f')]=_['intersection'](_0x7c38d3[_0xc8f0('0x2c')],_0x7c38d3[_0xc8f0('0x2e')]);_0x4c02e8[_0xc8f0('0x31')]=_[_0xc8f0('0x30')](_0x7c38d3[_0xc8f0('0x2c')],qs[_0xc8f0('0x32')](_0x186140['query'][_0xc8f0('0x32')]));_0x4c02e8[_0xc8f0('0x31')]=_0x4c02e8[_0xc8f0('0x31')][_0xc8f0('0x33')]?_0x4c02e8['attributes']:_0x7c38d3['model'];if(_0x186140[_0xc8f0('0x2e')][_0xc8f0('0x43')]){_0x4c02e8[_0xc8f0('0x3d')]=[{'all':!![]}];}_0x4c02e8=_['merge']({},_0x4c02e8,_0x186140['options']);return db[_0xc8f0('0x27')][_0xc8f0('0x44')](_0x4c02e8)[_0xc8f0('0x23')](handleEntityNotFound(_0x3f714d,null))[_0xc8f0('0x23')](respondWithResult(_0x3f714d,null))[_0xc8f0('0x40')](handleError(_0x3f714d,null));};exports['create']=function(_0x98d67a,_0x42a6b){return db[_0xc8f0('0x27')][_0xc8f0('0x45')](_0x98d67a['body'],{})[_0xc8f0('0x23')](respondWithResult(_0x42a6b,0xc9))['catch'](handleError(_0x42a6b,null));};exports[_0xc8f0('0x22')]=function(_0x391d47,_0x5f1bb7){if(_0x391d47[_0xc8f0('0x46')]['id']){delete _0x391d47[_0xc8f0('0x46')]['id'];}return db[_0xc8f0('0x27')]['find']({'where':{'id':_0x391d47['params']['id']}})['then'](handleEntityNotFound(_0x5f1bb7,null))[_0xc8f0('0x23')](saveUpdates(_0x391d47[_0xc8f0('0x46')],null))['then'](respondWithResult(_0x5f1bb7,null))['catch'](handleError(_0x5f1bb7,null));};exports[_0xc8f0('0x47')]=function(_0x3199c0,_0x3f14dd){return db['VoiceQueuesLog']['find']({'where':{'id':_0x3199c0[_0xc8f0('0x48')]['id']}})[_0xc8f0('0x23')](handleEntityNotFound(_0x3f14dd,null))[_0xc8f0('0x23')](removeEntity(_0x3f14dd,null))[_0xc8f0('0x40')](handleError(_0x3f14dd,null));}; \ No newline at end of file +var _0xc297=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','stack','name','index','VoiceQueuesLog','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','options','include','findAll','catch','params','includeAll','merge','find','create','body','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x3c6ae2,_0x5c52d8){var _0x4edda=function(_0x5593eb){while(--_0x5593eb){_0x3c6ae2['push'](_0x3c6ae2['shift']());}};_0x4edda(++_0x5c52d8);}(_0xc297,0x7e));var _0x7c29=function(_0xdc37a1,_0x53ebb9){_0xdc37a1=_0xdc37a1-0x0;var _0x99b4fe=_0xc297[_0xdc37a1];return _0x99b4fe;};'use strict';var emlformat=require(_0x7c29('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7c29('0x1'));var rp=require(_0x7c29('0x2'));var moment=require(_0x7c29('0x3'));var BPromise=require(_0x7c29('0x4'));var Mustache=require(_0x7c29('0x5'));var util=require(_0x7c29('0x6'));var path=require(_0x7c29('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7c29('0x8'));var fs=require('fs');var fs_extra=require(_0x7c29('0x9'));var _=require('lodash');var squel=require(_0x7c29('0xa'));var crypto=require(_0x7c29('0xb'));var jsforce=require(_0x7c29('0xc'));var deskjs=require(_0x7c29('0xd'));var toCsv=require(_0x7c29('0xe'));var querystring=require(_0x7c29('0xf'));var Papa=require(_0x7c29('0x10'));var Redis=require(_0x7c29('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7c29('0x12'));var hardwareService=require(_0x7c29('0x13'));var logger=require(_0x7c29('0x14'))(_0x7c29('0x15'));var utils=require(_0x7c29('0x16'));var config=require(_0x7c29('0x17'));var licenseUtil=require(_0x7c29('0x18'));var db=require(_0x7c29('0x19'))['db'];function respondWithStatusCode(_0x226657,_0x81a64b){_0x81a64b=_0x81a64b||0xcc;return function(_0x46453d){if(_0x46453d){return _0x226657[_0x7c29('0x1a')](_0x81a64b);}return _0x226657[_0x7c29('0x1b')](_0x81a64b)[_0x7c29('0x1c')]();};}function respondWithResult(_0x19e278,_0x7bf253){_0x7bf253=_0x7bf253||0xc8;return function(_0x22156d){if(_0x22156d){return _0x19e278[_0x7c29('0x1b')](_0x7bf253)[_0x7c29('0x1d')](_0x22156d);}};}function respondWithFilteredResult(_0x16028f,_0xccb351){return function(_0x2416e5){if(_0x2416e5){var _0x341b6f=typeof _0xccb351[_0x7c29('0x1e')]===_0x7c29('0x1f')&&typeof _0xccb351[_0x7c29('0x20')]===_0x7c29('0x1f');var _0x245965=_0x2416e5[_0x7c29('0x21')];var _0x488285=_0x341b6f?0x0:_0xccb351[_0x7c29('0x1e')];var _0x3eff54=_0x341b6f?_0x2416e5[_0x7c29('0x21')]:_0xccb351[_0x7c29('0x1e')]+_0xccb351[_0x7c29('0x20')];var _0x4d59e9;if(_0x3eff54>=_0x245965){_0x3eff54=_0x245965;_0x4d59e9=0xc8;}else{_0x4d59e9=0xce;}_0x16028f[_0x7c29('0x1b')](_0x4d59e9);return _0x16028f['set'](_0x7c29('0x22'),_0x488285+'-'+_0x3eff54+'/'+_0x245965)[_0x7c29('0x1d')](_0x2416e5);}return null;};}function patchUpdates(_0x367daa){return function(_0x501d8c){try{jsonpatch['apply'](_0x501d8c,_0x367daa,!![]);}catch(_0x4a1026){return BPromise[_0x7c29('0x23')](_0x4a1026);}return _0x501d8c[_0x7c29('0x24')]();};}function saveUpdates(_0xa25444,_0xcf319b){return function(_0x5cdd0d){if(_0x5cdd0d){return _0x5cdd0d[_0x7c29('0x25')](_0xa25444)[_0x7c29('0x26')](function(_0x3fd7d5){return _0x3fd7d5;});}return null;};}function removeEntity(_0x5ced1d,_0x42249a){return function(_0x25b059){if(_0x25b059){return _0x25b059[_0x7c29('0x27')]()[_0x7c29('0x26')](function(){_0x5ced1d[_0x7c29('0x1b')](0xcc)[_0x7c29('0x1c')]();});}};}function handleEntityNotFound(_0x1f619b,_0x155105){return function(_0x151013){if(!_0x151013){_0x1f619b[_0x7c29('0x1a')](0x194);}return _0x151013;};}function handleError(_0x710152,_0x190334){_0x190334=_0x190334||0x1f4;return function(_0x5bd4d0){logger['error'](_0x5bd4d0[_0x7c29('0x28')]);if(_0x5bd4d0[_0x7c29('0x29')]){delete _0x5bd4d0[_0x7c29('0x29')];}_0x710152[_0x7c29('0x1b')](_0x190334)['send'](_0x5bd4d0);};}exports[_0x7c29('0x2a')]=function(_0x546087,_0x43ce63){var _0x498088={},_0x3f784a={},_0x34495f={'count':0x0,'rows':[]};var _0x3d78e1=_['map'](db[_0x7c29('0x2b')]['rawAttributes'],function(_0x1c9f0e){return{'name':_0x1c9f0e[_0x7c29('0x2c')],'type':_0x1c9f0e[_0x7c29('0x2d')][_0x7c29('0x2e')]};});_0x3f784a[_0x7c29('0x2f')]=_[_0x7c29('0x30')](_0x3d78e1,'name');_0x3f784a[_0x7c29('0x31')]=_[_0x7c29('0x32')](_0x546087['query']);_0x3f784a[_0x7c29('0x33')]=_[_0x7c29('0x34')](_0x3f784a[_0x7c29('0x2f')],_0x3f784a['query']);_0x498088[_0x7c29('0x35')]=_[_0x7c29('0x34')](_0x3f784a[_0x7c29('0x2f')],qs[_0x7c29('0x36')](_0x546087[_0x7c29('0x31')][_0x7c29('0x36')]));_0x498088['attributes']=_0x498088[_0x7c29('0x35')][_0x7c29('0x37')]?_0x498088[_0x7c29('0x35')]:_0x3f784a[_0x7c29('0x2f')];if(!_0x546087[_0x7c29('0x31')][_0x7c29('0x38')](_0x7c29('0x39'))){_0x498088['limit']=qs[_0x7c29('0x20')](_0x546087[_0x7c29('0x31')]['limit']);_0x498088[_0x7c29('0x1e')]=qs[_0x7c29('0x1e')](_0x546087[_0x7c29('0x31')][_0x7c29('0x1e')]);}_0x498088[_0x7c29('0x3a')]=qs[_0x7c29('0x3b')](_0x546087[_0x7c29('0x31')][_0x7c29('0x3b')]);_0x498088[_0x7c29('0x3c')]=qs[_0x7c29('0x33')](_['pick'](_0x546087[_0x7c29('0x31')],_0x3f784a[_0x7c29('0x33')]),_0x3d78e1);if(_0x546087[_0x7c29('0x31')]['filter']){_0x498088[_0x7c29('0x3c')]=_['merge'](_0x498088['where'],{'$or':_['map'](_0x3d78e1,function(_0x54e964){if(_0x54e964[_0x7c29('0x2d')]!==_0x7c29('0x3d')){var _0x2d510e={};_0x2d510e[_0x54e964[_0x7c29('0x29')]]={'$like':'%'+_0x546087[_0x7c29('0x31')][_0x7c29('0x3e')]+'%'};return _0x2d510e;}})});}_0x498088=_['merge']({},_0x498088,_0x546087[_0x7c29('0x3f')]);var _0xe5cbed={'where':_0x498088['where']};return db[_0x7c29('0x2b')][_0x7c29('0x21')](_0xe5cbed)[_0x7c29('0x26')](function(_0x593eee){_0x34495f['count']=_0x593eee;if(_0x546087[_0x7c29('0x31')]['includeAll']){_0x498088[_0x7c29('0x40')]=[{'all':!![]}];}return db[_0x7c29('0x2b')][_0x7c29('0x41')](_0x498088);})[_0x7c29('0x26')](function(_0x2918a6){_0x34495f['rows']=_0x2918a6;return _0x34495f;})[_0x7c29('0x26')](respondWithFilteredResult(_0x43ce63,_0x498088))[_0x7c29('0x42')](handleError(_0x43ce63,null));};exports['show']=function(_0x5a4e7e,_0x396e06){var _0x133557={'raw':!![],'where':{'id':_0x5a4e7e[_0x7c29('0x43')]['id']}},_0x5c8146={};_0x5c8146[_0x7c29('0x2f')]=_[_0x7c29('0x32')](db[_0x7c29('0x2b')]['rawAttributes']);_0x5c8146[_0x7c29('0x31')]=_[_0x7c29('0x32')](_0x5a4e7e['query']);_0x5c8146[_0x7c29('0x33')]=_[_0x7c29('0x34')](_0x5c8146['model'],_0x5c8146['query']);_0x133557[_0x7c29('0x35')]=_['intersection'](_0x5c8146['model'],qs[_0x7c29('0x36')](_0x5a4e7e[_0x7c29('0x31')]['fields']));_0x133557['attributes']=_0x133557[_0x7c29('0x35')]['length']?_0x133557[_0x7c29('0x35')]:_0x5c8146[_0x7c29('0x2f')];if(_0x5a4e7e['query'][_0x7c29('0x44')]){_0x133557[_0x7c29('0x40')]=[{'all':!![]}];}_0x133557=_[_0x7c29('0x45')]({},_0x133557,_0x5a4e7e[_0x7c29('0x3f')]);return db[_0x7c29('0x2b')][_0x7c29('0x46')](_0x133557)['then'](handleEntityNotFound(_0x396e06,null))[_0x7c29('0x26')](respondWithResult(_0x396e06,null))[_0x7c29('0x42')](handleError(_0x396e06,null));};exports[_0x7c29('0x47')]=function(_0x5a2f90,_0x52152e){return db[_0x7c29('0x2b')][_0x7c29('0x47')](_0x5a2f90['body'],{})[_0x7c29('0x26')](respondWithResult(_0x52152e,0xc9))[_0x7c29('0x42')](handleError(_0x52152e,null));};exports[_0x7c29('0x25')]=function(_0x1e1666,_0x289874){if(_0x1e1666[_0x7c29('0x48')]['id']){delete _0x1e1666[_0x7c29('0x48')]['id'];}return db['VoiceQueuesLog'][_0x7c29('0x46')]({'where':{'id':_0x1e1666[_0x7c29('0x43')]['id']}})[_0x7c29('0x26')](handleEntityNotFound(_0x289874,null))[_0x7c29('0x26')](saveUpdates(_0x1e1666['body'],null))[_0x7c29('0x26')](respondWithResult(_0x289874,null))[_0x7c29('0x42')](handleError(_0x289874,null));};exports['destroy']=function(_0x5c58ec,_0x5aee84){return db[_0x7c29('0x2b')][_0x7c29('0x46')]({'where':{'id':_0x5c58ec['params']['id']}})['then'](handleEntityNotFound(_0x5aee84,null))[_0x7c29('0x26')](removeEntity(_0x5aee84,null))[_0x7c29('0x42')](handleError(_0x5aee84,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 6cc26c6..7328179 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 _0x4d5d=['api','moment','request-promise','path','./voiceQueuesLog.attributes','exports','define','event_dtm','event','lodash','util','../../config/logger'];(function(_0x17f209,_0x506ba6){var _0x1cd91c=function(_0x188e24){while(--_0x188e24){_0x17f209['push'](_0x17f209['shift']());}};_0x1cd91c(++_0x506ba6);}(_0x4d5d,0x111));var _0xd4d5=function(_0x5b733d,_0x272606){_0x5b733d=_0x5b733d-0x0;var _0x2b7995=_0x4d5d[_0x5b733d];return _0x2b7995;};'use strict';var _=require(_0xd4d5('0x0'));var util=require(_0xd4d5('0x1'));var logger=require(_0xd4d5('0x2'))(_0xd4d5('0x3'));var moment=require(_0xd4d5('0x4'));var BPromise=require('bluebird');var rp=require(_0xd4d5('0x5'));var fs=require('fs');var path=require(_0xd4d5('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd4d5('0x7'));module[_0xd4d5('0x8')]=function(_0x39c809,_0x2f36f0){return _0x39c809[_0xd4d5('0x9')]('VoiceQueuesLog',attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0xd4d5('0xa'),'fields':[_0xd4d5('0xb'),'dtm']}],'timestamps':![]});}; \ No newline at end of file +var _0x6f5a=['define','voice_queues_log','event_dtm','event','lodash','util','../../config/logger','moment','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports'];(function(_0x3d2536,_0x28d331){var _0x4f3bfe=function(_0x7a4546){while(--_0x7a4546){_0x3d2536['push'](_0x3d2536['shift']());}};_0x4f3bfe(++_0x28d331);}(_0x6f5a,0x1cb));var _0xa6f5=function(_0x17a475,_0x1f3373){_0x17a475=_0x17a475-0x0;var _0x4e81f7=_0x6f5a[_0x17a475];return _0x4e81f7;};'use strict';var _=require(_0xa6f5('0x0'));var util=require(_0xa6f5('0x1'));var logger=require(_0xa6f5('0x2'))('api');var moment=require(_0xa6f5('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa6f5('0x4'));var rimraf=require(_0xa6f5('0x5'));var config=require(_0xa6f5('0x6'));var attributes=require(_0xa6f5('0x7'));module[_0xa6f5('0x8')]=function(_0x4cf735,_0x21be4d){return _0x4cf735[_0xa6f5('0x9')]('VoiceQueuesLog',attributes,{'tableName':_0xa6f5('0xa'),'paranoid':![],'indexes':[{'name':_0xa6f5('0xb'),'fields':[_0xa6f5('0xc'),'dtm']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 704ab9e..747a695 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 _0x054f=['message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x054f,0x1a6));var _0xf054=function(_0xc45ec6,_0x1d6c7e){_0xc45ec6=_0xc45ec6-0x0;var _0x281dc8=_0x054f[_0xc45ec6];return _0x281dc8;};'use strict';var _=require(_0xf054('0x0'));var util=require(_0xf054('0x1'));var moment=require(_0xf054('0x2'));var BPromise=require(_0xf054('0x3'));var rs=require(_0xf054('0x4'));var fs=require('fs');var Redis=require(_0xf054('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf054('0x6'));var logger=require(_0xf054('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf054('0x8'));var client=jayson['client'][_0xf054('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x113205,_0x5a9681,_0x2e8bb8){return new BPromise(function(_0x155c76,_0x13d111){return client[_0xf054('0xa')](_0x113205,_0x2e8bb8)[_0xf054('0xb')](function(_0xfb30a9){logger[_0xf054('0xc')](_0xf054('0xd'),_0x5a9681,_0xf054('0xe'));logger[_0xf054('0xf')](_0xf054('0x10'),_0x5a9681,_0xf054('0xe'),JSON[_0xf054('0x11')](_0xfb30a9));if(_0xfb30a9[_0xf054('0x12')]){if(_0xfb30a9[_0xf054('0x12')]['code']===0x1f4){logger[_0xf054('0x12')](_0xf054('0xd'),_0x5a9681,_0xfb30a9[_0xf054('0x12')][_0xf054('0x13')]);return _0x13d111(_0xfb30a9[_0xf054('0x12')][_0xf054('0x13')]);}logger['error'](_0xf054('0xd'),_0x5a9681,_0xfb30a9[_0xf054('0x12')][_0xf054('0x13')]);return _0x155c76(_0xfb30a9[_0xf054('0x12')]['message']);}else{logger[_0xf054('0xc')](_0xf054('0xd'),_0x5a9681,_0xf054('0xe'));_0x155c76(_0xfb30a9['result'][_0xf054('0x13')]);}})[_0xf054('0x14')](function(_0x47f87c){logger['error'](_0xf054('0xd'),_0x5a9681,_0x47f87c);_0x13d111(_0x47f87c);});});} \ No newline at end of file +var _0x1fee=['jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','code','VoiceQueuesLog,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0xe6ba3b,_0x58e953){var _0x19adbe=function(_0x3ec442){while(--_0x3ec442){_0xe6ba3b['push'](_0xe6ba3b['shift']());}};_0x19adbe(++_0x58e953);}(_0x1fee,0x12e));var _0xe1fe=function(_0x4f9224,_0x50d148){_0x4f9224=_0x4f9224-0x0;var _0x31bd93=_0x1fee[_0x4f9224];return _0x31bd93;};'use strict';var _=require(_0xe1fe('0x0'));var util=require(_0xe1fe('0x1'));var moment=require(_0xe1fe('0x2'));var BPromise=require(_0xe1fe('0x3'));var rs=require(_0xe1fe('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe1fe('0x5'))['db'];var utils=require(_0xe1fe('0x6'));var logger=require(_0xe1fe('0x7'))(_0xe1fe('0x8'));var config=require(_0xe1fe('0x9'));var jayson=require(_0xe1fe('0xa'));var client=jayson[_0xe1fe('0xb')][_0xe1fe('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x48462a,_0x5a25b5,_0xcd0968){return new BPromise(function(_0x40bd2e,_0x56ee79){return client[_0xe1fe('0xd')](_0x48462a,_0xcd0968)['then'](function(_0x245ebc){logger[_0xe1fe('0xe')]('VoiceQueuesLog,\x20%s,\x20%s',_0x5a25b5,_0xe1fe('0xf'));logger[_0xe1fe('0x10')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x5a25b5,_0xe1fe('0xf'),JSON[_0xe1fe('0x11')](_0x245ebc));if(_0x245ebc[_0xe1fe('0x12')]){if(_0x245ebc[_0xe1fe('0x12')][_0xe1fe('0x13')]===0x1f4){logger[_0xe1fe('0x12')](_0xe1fe('0x14'),_0x5a25b5,_0x245ebc[_0xe1fe('0x12')][_0xe1fe('0x15')]);return _0x56ee79(_0x245ebc['error']['message']);}logger[_0xe1fe('0x12')](_0xe1fe('0x14'),_0x5a25b5,_0x245ebc[_0xe1fe('0x12')][_0xe1fe('0x15')]);return _0x40bd2e(_0x245ebc[_0xe1fe('0x12')][_0xe1fe('0x15')]);}else{logger[_0xe1fe('0xe')](_0xe1fe('0x14'),_0x5a25b5,_0xe1fe('0xf'));_0x40bd2e(_0x245ebc[_0xe1fe('0x16')][_0xe1fe('0x15')]);}})[_0xe1fe('0x17')](function(_0x5daa4f){logger[_0xe1fe('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x5a25b5,_0x5daa4f);_0x56ee79(_0x5daa4f);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 33e8c98..e966bde 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 _0xcc5c=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','/:id/downloads','/:id/transcribe','post','runTranscribe','put','update','destroy','exports'];(function(_0x1a4c39,_0x13aade){var _0x55b641=function(_0x222d9f){while(--_0x222d9f){_0x1a4c39['push'](_0x1a4c39['shift']());}};_0x55b641(++_0x13aade);}(_0xcc5c,0xb6));var _0xccc5=function(_0x2c5b19,_0x4f66d2){_0x2c5b19=_0x2c5b19-0x0;var _0x460479=_0xcc5c[_0x2c5b19];return _0x460479;};'use strict';var multer=require(_0xccc5('0x0'));var util=require(_0xccc5('0x1'));var path=require(_0xccc5('0x2'));var timeout=require(_0xccc5('0x3'));var express=require('express');var router=express[_0xccc5('0x4')]();var fs_extra=require(_0xccc5('0x5'));var auth=require(_0xccc5('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xccc5('0x7'));var controller=require(_0xccc5('0x8'));router[_0xccc5('0x9')]('/',auth[_0xccc5('0xa')](),controller[_0xccc5('0xb')]);router[_0xccc5('0x9')](_0xccc5('0xc'),auth['isAuthenticated'](),controller[_0xccc5('0xd')]);router[_0xccc5('0x9')](_0xccc5('0xe'),auth[_0xccc5('0xa')](),controller[_0xccc5('0xf')]);router[_0xccc5('0x9')](_0xccc5('0x10'),auth[_0xccc5('0xa')](),controller[_0xccc5('0x11')]);router['get'](_0xccc5('0x12'),controller['downloads']);router['get'](_0xccc5('0x13'),auth[_0xccc5('0xa')](),controller['downloadTranscribe']);router[_0xccc5('0x14')]('/',auth[_0xccc5('0xa')](),controller['create']);router['post'](_0xccc5('0x13'),auth['isAuthenticated'](),controller[_0xccc5('0x15')]);router[_0xccc5('0x16')]('/:id',auth[_0xccc5('0xa')](),controller[_0xccc5('0x17')]);router['delete'](_0xccc5('0xe'),auth[_0xccc5('0xa')](),controller[_0xccc5('0x18')]);module[_0xccc5('0x19')]=router; \ No newline at end of file +var _0xc8e0=['runTranscribe','put','/:id','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','describe','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','create','post'];(function(_0x26f4a4,_0xeb0dc6){var _0x437404=function(_0x173ca5){while(--_0x173ca5){_0x26f4a4['push'](_0x26f4a4['shift']());}};_0x437404(++_0xeb0dc6);}(_0xc8e0,0x89));var _0x0c8e=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xc8e0[_0x2641f9];return _0x585741;};'use strict';var multer=require('multer');var util=require(_0x0c8e('0x0'));var path=require(_0x0c8e('0x1'));var timeout=require('connect-timeout');var express=require(_0x0c8e('0x2'));var router=express[_0x0c8e('0x3')]();var fs_extra=require(_0x0c8e('0x4'));var auth=require(_0x0c8e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0c8e('0x6'));var controller=require(_0x0c8e('0x7'));router[_0x0c8e('0x8')]('/',auth[_0x0c8e('0x9')](),controller[_0x0c8e('0xa')]);router[_0x0c8e('0x8')]('/describe',auth[_0x0c8e('0x9')](),controller[_0x0c8e('0xb')]);router[_0x0c8e('0x8')]('/:id',auth[_0x0c8e('0x9')](),controller['show']);router[_0x0c8e('0x8')](_0x0c8e('0xc'),auth[_0x0c8e('0x9')](),controller[_0x0c8e('0xd')]);router[_0x0c8e('0x8')](_0x0c8e('0xe'),controller[_0x0c8e('0xf')]);router[_0x0c8e('0x8')](_0x0c8e('0x10'),auth['isAuthenticated'](),controller['downloadTranscribe']);router['post']('/',auth[_0x0c8e('0x9')](),controller[_0x0c8e('0x11')]);router[_0x0c8e('0x12')](_0x0c8e('0x10'),auth[_0x0c8e('0x9')](),controller[_0x0c8e('0x13')]);router[_0x0c8e('0x14')](_0x0c8e('0x15'),auth['isAuthenticated'](),controller[_0x0c8e('0x16')]);router[_0x0c8e('0x17')](_0x0c8e('0x15'),auth['isAuthenticated'](),controller[_0x0c8e('0x18')]);module[_0x0c8e('0x19')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index f5fcc03..2cb414e 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(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'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(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'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 55185b3..6f3bfc3 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 _0x6ee1=['VIRTUAL','merge','include','findAll','rows','catch','params','find','create','body','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','decryptFile','secrets','recording','existsSync','Sequelize','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','downloads','sequelize','MD5','token','$and','push','ValidationError','isNil','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','destroy','listBuckets','createBucket','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','bucket','Bucket','Location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','TranscriptionJobName','transcribeName','TranscriptionJob','TranscriptionJobStatus','findOne','Voice\x20Recording\x20not\x20found','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','transcribeAccountId','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','transcribeStatus','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','aws-sdk','uuid/v4','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','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','sendStatus','error','stack','name','send','index','map','VoiceRecording','rawAttributes','fieldName','key','differenceBy','format','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type'];(function(_0x285e73,_0x5c98e0){var _0x27054=function(_0xa9c5dd){while(--_0xa9c5dd){_0x285e73['push'](_0x285e73['shift']());}};_0x27054(++_0x5c98e0);}(_0x6ee1,0xf7));var _0x16ee=function(_0x261b8a,_0x553ec4){_0x261b8a=_0x261b8a-0x0;var _0x3455e8=_0x6ee1[_0x261b8a];return _0x3455e8;};'use strict';var emlformat=require(_0x16ee('0x0'));var rimraf=require(_0x16ee('0x1'));var zipdir=require(_0x16ee('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x16ee('0x3'));var moment=require('moment');var BPromise=require(_0x16ee('0x4'));var Mustache=require(_0x16ee('0x5'));var util=require(_0x16ee('0x6'));var path=require(_0x16ee('0x7'));var sox=require(_0x16ee('0x8'));var csv=require('to-csv');var ejs=require(_0x16ee('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x16ee('0xa'));var squel=require(_0x16ee('0xb'));var crypto=require(_0x16ee('0xc'));var jsforce=require(_0x16ee('0xd'));var deskjs=require(_0x16ee('0xe'));var toCsv=require('to-csv');var querystring=require(_0x16ee('0xf'));var Papa=require(_0x16ee('0x10'));var AWS=require(_0x16ee('0x11'));var uuidv4=require(_0x16ee('0x12'));var Redis=require(_0x16ee('0x13'));var authService=require(_0x16ee('0x14'));var qs=require(_0x16ee('0x15'));var as=require(_0x16ee('0x16'));var hardwareService=require(_0x16ee('0x17'));var logger=require(_0x16ee('0x18'))(_0x16ee('0x19'));var utils=require(_0x16ee('0x1a'));var config=require(_0x16ee('0x1b'));var licenseUtil=require(_0x16ee('0x1c'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x473714,_0x42b51e){_0x42b51e=_0x42b51e||0xcc;return function(_0x4a1d37){if(_0x4a1d37){return _0x473714['sendStatus'](_0x42b51e);}return _0x473714[_0x16ee('0x1d')](_0x42b51e)[_0x16ee('0x1e')]();};}function respondWithResult(_0x1ba223,_0xedd422){_0xedd422=_0xedd422||0xc8;return function(_0x463aec){if(_0x463aec){return _0x1ba223['status'](_0xedd422)[_0x16ee('0x1f')](_0x463aec);}};}function respondWithFilteredResult(_0x76336d,_0x583de7){return function(_0x439d5c){if(_0x439d5c){var _0x54bc77=typeof _0x583de7['offset']===_0x16ee('0x20')&&typeof _0x583de7[_0x16ee('0x21')]===_0x16ee('0x20');var _0x37a35a=_0x439d5c['count'];var _0x3936a0=_0x54bc77?0x0:_0x583de7['offset'];var _0x253532=_0x54bc77?_0x439d5c[_0x16ee('0x22')]:_0x583de7[_0x16ee('0x23')]+_0x583de7[_0x16ee('0x21')];var _0x155d22;if(_0x253532>=_0x37a35a){_0x253532=_0x37a35a;_0x155d22=0xc8;}else{_0x155d22=0xce;}_0x76336d[_0x16ee('0x1d')](_0x155d22);return _0x76336d[_0x16ee('0x24')](_0x16ee('0x25'),_0x3936a0+'-'+_0x253532+'/'+_0x37a35a)[_0x16ee('0x1f')](_0x439d5c);}return null;};}function patchUpdates(_0x4673eb){return function(_0xda6702){try{jsonpatch[_0x16ee('0x26')](_0xda6702,_0x4673eb,!![]);}catch(_0x1343d6){return BPromise['reject'](_0x1343d6);}return _0xda6702[_0x16ee('0x27')]();};}function saveUpdates(_0x12ac0b,_0x525e38){return function(_0x4682c2){if(_0x4682c2){return _0x4682c2[_0x16ee('0x28')](_0x12ac0b)[_0x16ee('0x29')](function(_0x1239ef){return _0x1239ef;});}return null;};}function removeEntity(_0x554dda,_0x51e58c){return function(_0x1fb774){if(_0x1fb774){return _0x1fb774['destroy']()[_0x16ee('0x29')](function(){_0x554dda[_0x16ee('0x1d')](0xcc)[_0x16ee('0x1e')]();});}};}function handleEntityNotFound(_0x2e7f3d,_0x2102d1){return function(_0x2e69f9){if(!_0x2e69f9){_0x2e7f3d[_0x16ee('0x2a')](0x194);}return _0x2e69f9;};}function handleError(_0x4fad1f,_0x55a239){_0x55a239=_0x55a239||0x1f4;return function(_0x58a2d9){logger[_0x16ee('0x2b')](_0x58a2d9[_0x16ee('0x2c')]);if(_0x58a2d9['name']){delete _0x58a2d9[_0x16ee('0x2d')];}_0x4fad1f['status'](_0x55a239)[_0x16ee('0x2e')](_0x58a2d9);};}exports[_0x16ee('0x2f')]=function(_0x2cf28b,_0x2ddd13){var _0x158544={},_0xc7feb0={},_0x205649={'count':0x0,'rows':[]};var _0xec117c=_[_0x16ee('0x30')](db[_0x16ee('0x31')][_0x16ee('0x32')],function(_0x4f3c31){return{'name':_0x4f3c31[_0x16ee('0x33')],'type':_0x4f3c31['type'][_0x16ee('0x34')]};});_0xc7feb0['model']=_[_0x16ee('0x35')](_[_0x16ee('0x30')](_0xec117c,_0x16ee('0x2d')),[_0x16ee('0x36')]);_0xc7feb0['query']=_[_0x16ee('0x37')](_0x2cf28b[_0x16ee('0x38')]);_0xc7feb0['filters']=_[_0x16ee('0x39')](_0xc7feb0[_0x16ee('0x3a')],_0xc7feb0[_0x16ee('0x38')]);_0x158544[_0x16ee('0x3b')]=_[_0x16ee('0x39')](_0xc7feb0[_0x16ee('0x3a')],qs[_0x16ee('0x3c')](_0x2cf28b[_0x16ee('0x38')][_0x16ee('0x3c')]));_0x158544['attributes']=_0x158544[_0x16ee('0x3b')][_0x16ee('0x3d')]?_0x158544['attributes']:_0xc7feb0[_0x16ee('0x3a')];if(!_0x2cf28b[_0x16ee('0x38')][_0x16ee('0x3e')](_0x16ee('0x3f'))){_0x158544[_0x16ee('0x21')]=qs['limit'](_0x2cf28b[_0x16ee('0x38')]['limit']);_0x158544[_0x16ee('0x23')]=qs[_0x16ee('0x23')](_0x2cf28b[_0x16ee('0x38')][_0x16ee('0x23')]);}_0x158544[_0x16ee('0x40')]=qs[_0x16ee('0x41')](_0x2cf28b[_0x16ee('0x38')][_0x16ee('0x41')]);_0x158544[_0x16ee('0x42')]=qs[_0x16ee('0x43')](_[_0x16ee('0x44')](_0x2cf28b[_0x16ee('0x38')],_0xc7feb0[_0x16ee('0x43')]),_0xec117c);if(_0x2cf28b[_0x16ee('0x38')][_0x16ee('0x45')]){_0x158544[_0x16ee('0x42')]=_['merge'](_0x158544[_0x16ee('0x42')],{'$or':_[_0x16ee('0x30')](_0xec117c,function(_0x20ebfa){if(_0x20ebfa[_0x16ee('0x46')]!==_0x16ee('0x47')){var _0x18b254={};_0x18b254[_0x20ebfa[_0x16ee('0x2d')]]={'$like':'%'+_0x2cf28b[_0x16ee('0x38')][_0x16ee('0x45')]+'%'};return _0x18b254;}})});}_0x158544=_[_0x16ee('0x48')]({},_0x158544,_0x2cf28b['options']);var _0x2d7d99={'where':_0x158544[_0x16ee('0x42')]};return db[_0x16ee('0x31')][_0x16ee('0x22')](_0x2d7d99)[_0x16ee('0x29')](function(_0xeef52a){_0x205649[_0x16ee('0x22')]=_0xeef52a;if(_0x2cf28b[_0x16ee('0x38')]['includeAll']){_0x158544[_0x16ee('0x49')]=[{'all':!![]}];}return db[_0x16ee('0x31')][_0x16ee('0x4a')](_0x158544);})['then'](function(_0x585d30){_0x205649[_0x16ee('0x4b')]=_0x585d30;return _0x205649;})['then'](respondWithFilteredResult(_0x2ddd13,_0x158544))[_0x16ee('0x4c')](handleError(_0x2ddd13,null));};exports['show']=function(_0x55650f,_0xc4f920){var _0x3e93c2={'raw':![],'where':{'id':_0x55650f[_0x16ee('0x4d')]['id']}},_0x11b1e1={};_0x11b1e1['model']=_['keys'](db[_0x16ee('0x31')][_0x16ee('0x32')]);_0x11b1e1['query']=_[_0x16ee('0x37')](_0x55650f[_0x16ee('0x38')]);_0x11b1e1['filters']=_[_0x16ee('0x39')](_0x11b1e1[_0x16ee('0x3a')],_0x11b1e1['query']);_0x3e93c2[_0x16ee('0x3b')]=_[_0x16ee('0x39')](_0x11b1e1['model'],qs[_0x16ee('0x3c')](_0x55650f[_0x16ee('0x38')][_0x16ee('0x3c')]));_0x3e93c2[_0x16ee('0x3b')]=_0x3e93c2['attributes'][_0x16ee('0x3d')]?_0x3e93c2[_0x16ee('0x3b')]:_0x11b1e1[_0x16ee('0x3a')];if(_0x55650f[_0x16ee('0x38')]['includeAll']){_0x3e93c2[_0x16ee('0x49')]=[{'all':!![]}];}_0x3e93c2=_[_0x16ee('0x48')]({},_0x3e93c2,_0x55650f['options']);return db[_0x16ee('0x31')][_0x16ee('0x4e')](_0x3e93c2)[_0x16ee('0x29')](handleEntityNotFound(_0xc4f920,null))[_0x16ee('0x29')](respondWithResult(_0xc4f920,null))[_0x16ee('0x4c')](handleError(_0xc4f920,null));};exports[_0x16ee('0x4f')]=function(_0x4439e7,_0x59caca){return db[_0x16ee('0x31')][_0x16ee('0x4f')](_0x4439e7['body'],{})[_0x16ee('0x29')](respondWithResult(_0x59caca,0xc9))['catch'](handleError(_0x59caca,null));};exports['update']=function(_0x345587,_0x502397){if(_0x345587[_0x16ee('0x50')]['id']){delete _0x345587['body']['id'];}return db[_0x16ee('0x31')][_0x16ee('0x4e')]({'where':{'id':_0x345587['params']['id']}})['then'](handleEntityNotFound(_0x502397,null))[_0x16ee('0x29')](saveUpdates(_0x345587[_0x16ee('0x50')],null))[_0x16ee('0x29')](respondWithResult(_0x502397,null))[_0x16ee('0x4c')](handleError(_0x502397,null));};exports[_0x16ee('0x51')]=function(_0x3fa954,_0x64789f){return db[_0x16ee('0x31')][_0x16ee('0x51')]()['then'](respondWithResult(_0x64789f,null))[_0x16ee('0x4c')](handleError(_0x64789f,null));};exports[_0x16ee('0x52')]=function(_0x4589d9,_0x3e59c2,_0x573155){var _0x566b70=require(_0x16ee('0x53'));var _0x234db0=![];var _0x38e77f={};if(_0x4589d9[_0x16ee('0x38')][_0x16ee('0x46')]&&_0x4589d9[_0x16ee('0x38')][_0x16ee('0x46')]===_0x16ee('0x54')){_0x38e77f[_0x16ee('0x54')]=_0x4589d9['params']['id'];}else{_0x38e77f['id']=_0x4589d9[_0x16ee('0x4d')]['id'];}return db[_0x16ee('0x31')][_0x16ee('0x4e')]({'where':_0x38e77f,'attributes':['id',_0x16ee('0x55')],'raw':!![]})[_0x16ee('0x29')](handleEntityNotFound(_0x3e59c2,null))['then'](function(_0x2433ea){if(_0x2433ea){var _0x46120f=_0x2433ea[_0x16ee('0x55')];var _0x1cc897=util['format'](_0x16ee('0x56'),_0x46120f);if(fs['existsSync'](_0x1cc897)){_0x234db0=!![];return _0x566b70[_0x16ee('0x57')](_0x1cc897,_0x46120f,config[_0x16ee('0x58')][_0x16ee('0x59')])[_0x16ee('0x29')](function(){return _0x2433ea;});}return _0x2433ea;}})[_0x16ee('0x29')](function(_0xab6106){if(_0xab6106){var _0x3ada9f=_0xab6106[_0x16ee('0x55')];if(!fs[_0x16ee('0x5a')](_0x3ada9f)){throw new db[(_0x16ee('0x5b'))]['ValidationError'](_0x16ee('0x5c'));}if(_0xab6106[_0x16ee('0x5d')]){return _0x3e59c2['download'](_0x3ada9f,_0xab6106[_0x16ee('0x5d')]+path[_0x16ee('0x5e')](_0x3ada9f),function(){if(_0x234db0){fs[_0x16ee('0x5f')](_0x3ada9f);}});}else{return _0x3e59c2['download'](_0x3ada9f,function(_0x43d72c){if(_0x234db0){fs[_0x16ee('0x5f')](_0x3ada9f);}});}}})[_0x16ee('0x4c')](function(_0x53f814){if(_0x53f814[_0x16ee('0x60')]===_0x16ee('0x5c')){_0x3e59c2[_0x16ee('0x1d')](0x194)[_0x16ee('0x2e')](_0x16ee('0x61'));}else{return handleError(_0x3e59c2,null);}});};exports[_0x16ee('0x62')]=function(_0x4b19b1,_0x2b52dd,_0xc36e20){var _0x3fda42=require('../../components/encryptor');var _0x46c3bf=![];var _0xf7e8ce={'$and':[db[_0x16ee('0x63')][_0x16ee('0x42')](db[_0x16ee('0x63')]['fn'](_0x16ee('0x64'),db[_0x16ee('0x63')]['col']('uniqueid')),_0x4b19b1[_0x16ee('0x38')][_0x16ee('0x65')])]};if(_0x4b19b1[_0x16ee('0x38')][_0x16ee('0x46')]&&_0x4b19b1[_0x16ee('0x38')][_0x16ee('0x46')]===_0x16ee('0x54')){_0xf7e8ce[_0x16ee('0x66')][_0x16ee('0x67')]({'uniqueid':_0x4b19b1[_0x16ee('0x4d')]['id']});}else{_0xf7e8ce['$and']['push']({'id':_0x4b19b1['params']['id']});}return db[_0x16ee('0x31')][_0x16ee('0x4e')]({'where':_0xf7e8ce,'attributes':['id',_0x16ee('0x55')],'raw':!![]})[_0x16ee('0x29')](handleEntityNotFound(_0x2b52dd,null))[_0x16ee('0x29')](function(_0x1babd0){if(_0x1babd0){var _0x27cb40=util[_0x16ee('0x36')](_0x16ee('0x56'),_0x1babd0[_0x16ee('0x55')]);if(fs[_0x16ee('0x5a')](_0x27cb40)){_0x46c3bf=!![];return _0x3fda42[_0x16ee('0x57')](_0x27cb40,_0x1babd0[_0x16ee('0x55')],config[_0x16ee('0x58')]['recording'])[_0x16ee('0x29')](function(){return _0x1babd0;});}return _0x1babd0;}})[_0x16ee('0x29')](function(_0x5cfff2){if(_0x5cfff2){if(!fs[_0x16ee('0x5a')](_0x5cfff2['value'])){throw new db[(_0x16ee('0x5b'))][(_0x16ee('0x68'))](_0x16ee('0x5c'));}if(_0x5cfff2['filename']){return _0x2b52dd[_0x16ee('0x52')](_0x5cfff2[_0x16ee('0x55')],_0x5cfff2[_0x16ee('0x5d')]+path[_0x16ee('0x5e')](_0x5cfff2[_0x16ee('0x55')]),function(){if(_0x46c3bf){fs[_0x16ee('0x5f')](_0x5cfff2[_0x16ee('0x55')]);}});}else{return _0x2b52dd[_0x16ee('0x52')](_0x5cfff2['value'],function(_0x2e08ea){if(_0x46c3bf){fs[_0x16ee('0x5f')](_0x5cfff2[_0x16ee('0x55')]);}});}}})[_0x16ee('0x4c')](handleError(_0x2b52dd,null));};exports['destroy']=function(_0x337574,_0x2110ac){return db['VoiceRecording']['find']({'where':{'id':_0x337574[_0x16ee('0x4d')]['id']}})[_0x16ee('0x29')](function(_0xa92c87){if(_[_0x16ee('0x69')](_0xa92c87)){throw new ReferenceError(_0x16ee('0x6a'));}return _0xa92c87;})[_0x16ee('0x29')](function(_0xf4811e){var _0x4ab89b=_0xf4811e[_0x16ee('0x55')];logger[_0x16ee('0x6b')]('cancellazione\x20fisica\x20documento\x20%s',_0x4ab89b);if(!_[_0x16ee('0x69')](_0xf4811e[_0x16ee('0x55')])&&fs['existsSync'](_0x4ab89b)){logger['info'](_0x16ee('0x6c')+_0x4ab89b+_0x16ee('0x6d'));fs['unlinkSync'](_0x4ab89b);}_0x4ab89b=_0x4ab89b+_0x16ee('0x6e');if(!_['isNil'](_0xf4811e[_0x16ee('0x55')])&&fs[_0x16ee('0x5a')](_0x4ab89b)){logger[_0x16ee('0x6b')]('File:\x20\x22'+_0x4ab89b+_0x16ee('0x6d'));fs[_0x16ee('0x6f')](_0x4ab89b);}return _0xf4811e;})[_0x16ee('0x29')](function(_0x521e53){if(!_0x521e53)throw new InternalError();return _0x521e53[_0x16ee('0x70')]();})['then'](function(){_0x2110ac['status'](0xcc)[_0x16ee('0x1e')]();})[_0x16ee('0x4c')](handleError(_0x2110ac,null));};function getBucketslist(_0x1eeb12,_0x564567,_0x4f723f){return new Promise(function(_0x34ac8c,_0x690434){var _0x2b1fe8=new AWS['S3']({'accessKeyId':_0x564567,'secretAccessKey':_0x1eeb12,'region':_0x4f723f});_0x2b1fe8[_0x16ee('0x71')]({},function(_0x165a87,_0x3374ea){if(_0x165a87){return _0x690434(_0x165a87);}else{return _0x34ac8c(_0x3374ea);}});});}function createBucket(_0x4375b1,_0x4e43a7,_0x202c0d,_0x228055){return new Promise(function(_0x3fdb75,_0x47d872){var _0x5971cf=new AWS['S3']({'accessKeyId':_0x4e43a7,'secretAccessKey':_0x4375b1,'region':_0x202c0d});_0x5971cf[_0x16ee('0x72')]({'Bucket':_0x228055},function(_0x1e3b4c,_0x568f8d){if(_0x1e3b4c){return _0x47d872(_0x1e3b4c);}else{return _0x3fdb75(_0x568f8d);}});});}function uploadFile(_0x3c559a,_0x1bbc5c,_0x2d1904,_0x5380c4,_0x3d8e95,_0x2de52d){return new Promise(function(_0x462f25,_0x2190eb){var _0x57d5d4=new AWS['S3']({'accessKeyId':_0x1bbc5c,'secretAccessKey':_0x3c559a,'region':_0x2d1904});_0x57d5d4['upload']({'Bucket':_0x5380c4,'Key':_0x3d8e95,'Body':_0x2de52d},function(_0x1b6eb1,_0x521745){if(_0x1b6eb1){return _0x2190eb(_0x1b6eb1);}else{return _0x462f25(_0x521745);}});});}function startTranscribe(_0x2559fe,_0x1ec0af,_0x36b253,_0xa5c5a6,_0x5cf920,_0x35cf4a){return new Promise(function(_0x343180,_0x51ca56){var _0x28abcd=new AWS[(_0x16ee('0x73'))]({'accessKeyId':_0x1ec0af,'secretAccessKey':_0x2559fe,'region':_0x36b253});_0x28abcd[_0x16ee('0x74')]({'TranscriptionJobName':_0xa5c5a6,'LanguageCode':_0x5cf920,'Media':{'MediaFileUri':_0x35cf4a}},function(_0x4accc8,_0x565f83){if(_0x4accc8){return _0x51ca56(_0x4accc8);}else{return _0x343180(_0x565f83);}});});}function transcribe(_0x3f8ec8,_0xfe615a,_0x5b871d,_0x57fe75,_0x1997e3,_0x5218ce,_0x456d2e){return new Promise(function(_0x5cb063,_0x1a88f1){var _0x4e1412={};logger['info'](util[_0x16ee('0x36')](_0x16ee('0x75'),_0x3f8ec8,_0x1997e3));return uploadFile(_0xfe615a,_0x5b871d,_0x57fe75,_0x1997e3,path['basename'](_0x5218ce),fs[_0x16ee('0x76')](_0x5218ce))[_0x16ee('0x29')](function(_0xe55cf1){logger[_0x16ee('0x6b')](util[_0x16ee('0x36')](_0x16ee('0x77'),_0x3f8ec8,_0x1997e3,_0xe55cf1['Location']));_0x4e1412[_0x16ee('0x78')]=_0xe55cf1[_0x16ee('0x79')];_0x4e1412['location']=_0xe55cf1[_0x16ee('0x7a')];logger[_0x16ee('0x6b')](util[_0x16ee('0x36')](_0x16ee('0x7b'),_0x3f8ec8));return startTranscribe(_0xfe615a,_0x5b871d,_0x57fe75,uuidv4(),_0x456d2e,_0xe55cf1[_0x16ee('0x7a')]);})[_0x16ee('0x29')](function(_0x1b2a08){logger[_0x16ee('0x6b')](util[_0x16ee('0x36')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x3f8ec8,_0x1b2a08['TranscriptionJob'][_0x16ee('0x7c')]));_0x4e1412[_0x16ee('0x7d')]=_0x1b2a08[_0x16ee('0x7e')][_0x16ee('0x7c')];_0x4e1412['transcribeStatus']=_0x1b2a08[_0x16ee('0x7e')][_0x16ee('0x7f')];return _0x5cb063(_0x4e1412);})[_0x16ee('0x4c')](function(_0x509313){return _0x1a88f1(_0x509313);});});}exports['runTranscribe']=function(_0xae948b,_0x58b3cd,_0x19fa2c){var _0x49b36e;var _0x22b926;var _0x263f79;var _0x294b90=require(_0x16ee('0x53'));return db[_0x16ee('0x31')][_0x16ee('0x80')]({'where':{'id':_0xae948b[_0x16ee('0x4d')]['id']}})[_0x16ee('0x29')](function(_0xed9d15){if(_0xed9d15){var _0x157742=util[_0x16ee('0x36')](_0x16ee('0x56'),_0xed9d15[_0x16ee('0x55')]);if(fs[_0x16ee('0x5a')](_0x157742)){cypher=!![];return _0x294b90['decryptFile'](_0x157742,_0xed9d15[_0x16ee('0x55')],config['secrets'][_0x16ee('0x59')])[_0x16ee('0x29')](function(){return _0xed9d15;});}return _0xed9d15;}})[_0x16ee('0x29')](function(_0x50ad9b){if(!_0x50ad9b){throw new db[(_0x16ee('0x5b'))][(_0x16ee('0x68'))](_0x16ee('0x81'));}_0x22b926=_0x50ad9b;return db['Setting'][_0x16ee('0x80')]({'where':{'id':0x1}});})[_0x16ee('0x29')](handleEntityNotFound(_0x58b3cd,null))[_0x16ee('0x29')](function(_0x3a0656){if(_0x3a0656){_0x49b36e=_0x3a0656;if(!_0x49b36e['transcribe']||!_0x49b36e['transcribeAccountId']||!_0x49b36e[_0x16ee('0x82')]||!_0x49b36e[_0x16ee('0x83')]||!_0x49b36e[_0x16ee('0x78')]){throw new db[(_0x16ee('0x5b'))][(_0x16ee('0x68'))](_0x16ee('0x84'));}if(_0xae948b['body'][_0x16ee('0x85')]&&(!_0x49b36e[_0x16ee('0x86')]||!_0x49b36e[_0x16ee('0x87')]||!_0x49b36e[_0x16ee('0x88')]||!_0x49b36e[_0x16ee('0x83')]||!_0x49b36e['bucket'])){throw new db['Sequelize'][(_0x16ee('0x68'))](_0x16ee('0x89'));}return db[_0x16ee('0x8a')][_0x16ee('0x80')]({'where':{'id':_0x49b36e[_0x16ee('0x8b')]}});}})['then'](function(_0x30824f){if(!_0x30824f){throw new db[(_0x16ee('0x5b'))][(_0x16ee('0x68'))](_0x16ee('0x8c'));}if(!_0x30824f[_0x16ee('0x8d')]||!_0x30824f[_0x16ee('0x8e')]){throw new db[(_0x16ee('0x5b'))][(_0x16ee('0x68'))](_0x16ee('0x8f'));}_0x263f79=_0x30824f;return getBucketslist(_0x263f79['data1'],_0x263f79[_0x16ee('0x8e')],_0x49b36e[_0x16ee('0x82')]);})[_0x16ee('0x29')](function(_0x2fabf4){if(_0x2fabf4&&_0x2fabf4[_0x16ee('0x90')]){var _0x33c83e=_[_0x16ee('0x4e')](_0x2fabf4[_0x16ee('0x90')],function(_0x11b347){return _0x11b347[_0x16ee('0x91')]===_0x49b36e[_0x16ee('0x78')];});if(!_0x33c83e){logger['info'](util['format'](_0x16ee('0x92'),_0xae948b[_0x16ee('0x4d')]['id'],_0x49b36e[_0x16ee('0x78')]));return createBucket(_0x263f79[_0x16ee('0x8d')],_0x263f79[_0x16ee('0x8e')],_0x49b36e[_0x16ee('0x82')],_0x49b36e[_0x16ee('0x78')]);}logger[_0x16ee('0x6b')](util[_0x16ee('0x36')](_0x16ee('0x93'),_0xae948b[_0x16ee('0x4d')]['id'],_0x49b36e[_0x16ee('0x78')]));return;}})[_0x16ee('0x29')](function(_0x1118cc){if(_0x22b926[_0x16ee('0x94')]==='NEW'){return transcribe(_0xae948b[_0x16ee('0x4d')]['id'],_0x263f79[_0x16ee('0x8d')],_0x263f79[_0x16ee('0x8e')],_0x49b36e[_0x16ee('0x82')],_0x49b36e[_0x16ee('0x78')],_0x22b926[_0x16ee('0x55')],_0x49b36e['language']);}else{logger['info'](util['format']('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0xae948b[_0x16ee('0x4d')]['id']));return{'transcribeStatus':_0x16ee('0x95')};}})['then'](function(_0x42d1a0){if(_0x42d1a0){_0x42d1a0[_0x16ee('0x96')]=_0xae948b[_0x16ee('0x50')][_0x16ee('0x85')];return _0x22b926[_0x16ee('0x97')](_0x42d1a0);}})[_0x16ee('0x29')](respondWithResult(_0x58b3cd,null))[_0x16ee('0x4c')](handleError(_0x58b3cd,null));};function writeFile(_0x243a0e,_0x5ef943){return new Promise(function(_0x236cc9,_0x191a33){fs[_0x16ee('0x98')](_0x5ef943,_0x243a0e,function(_0x154763,_0x103da9){if(_0x154763){return _0x191a33(_0x154763);}else{return _0x236cc9(_0x103da9);}});});}exports[_0x16ee('0x99')]=function(_0x534e58,_0x537041,_0x43469a){return db[_0x16ee('0x31')]['findOne']({'where':{'id':_0x534e58[_0x16ee('0x4d')]['id']}})['then'](handleEntityNotFound(_0x537041))[_0x16ee('0x29')](function(_0x262852){if(_0x262852&&_0x262852[_0x16ee('0x9a')]){var _0x425ea9=_0x262852[_0x16ee('0x9a')];var _0x3e05ac=config[_0x16ee('0x9b')]+_0x16ee('0x9c')+_0x262852['id']+_0x16ee('0x9d');if(fs['existsSync'](_0x3e05ac)){return _0x3e05ac;}return writeFile(_0x425ea9,_0x3e05ac)['then'](function(){return _0x3e05ac;});}else{throw new db[(_0x16ee('0x5b'))][(_0x16ee('0x68'))](_0x16ee('0x9e'));}})[_0x16ee('0x29')](function(_0x44c823){return _0x537041[_0x16ee('0x52')](_0x44c823);})[_0x16ee('0x4c')](handleError(_0x537041));}; \ No newline at end of file +var _0x2379=['Transcribe\x20not\x20configured','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','transcribeRegion','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','tempSentiment','runSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','VoiceRecording','includeAll','include','show','length','find','catch','create','body','params','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','downloads','sequelize','MD5','token','$and','push','secrets','destroy','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','createBucket','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','readFileSync','Location','bucket','Bucket','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','runTranscribe','findOne','Setting','transcribe','transcribeAccountId','language'];(function(_0x1378a7,_0x1519f8){var _0x5a02e4=function(_0x34e162){while(--_0x34e162){_0x1378a7['push'](_0x1378a7['shift']());}};_0x5a02e4(++_0x1519f8);}(_0x2379,0x1eb));var _0x9237=function(_0x425194,_0x2065aa){_0x425194=_0x425194-0x0;var _0x41f2e2=_0x2379[_0x425194];return _0x41f2e2;};'use strict';var emlformat=require(_0x9237('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9237('0x1'));var jsonpatch=require(_0x9237('0x2'));var rp=require(_0x9237('0x3'));var moment=require(_0x9237('0x4'));var BPromise=require(_0x9237('0x5'));var Mustache=require(_0x9237('0x6'));var util=require('util');var path=require(_0x9237('0x7'));var sox=require(_0x9237('0x8'));var csv=require(_0x9237('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9237('0xa'));var _=require(_0x9237('0xb'));var squel=require(_0x9237('0xc'));var crypto=require(_0x9237('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9237('0x9'));var querystring=require(_0x9237('0xe'));var Papa=require(_0x9237('0xf'));var AWS=require(_0x9237('0x10'));var uuidv4=require(_0x9237('0x11'));var Redis=require(_0x9237('0x12'));var authService=require(_0x9237('0x13'));var qs=require(_0x9237('0x14'));var as=require(_0x9237('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9237('0x16'));var utils=require(_0x9237('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x9237('0x18'));var db=require(_0x9237('0x19'))['db'];function respondWithStatusCode(_0x4d6234,_0x52cdfa){_0x52cdfa=_0x52cdfa||0xcc;return function(_0x10f213){if(_0x10f213){return _0x4d6234[_0x9237('0x1a')](_0x52cdfa);}return _0x4d6234[_0x9237('0x1b')](_0x52cdfa)[_0x9237('0x1c')]();};}function respondWithResult(_0x293159,_0x292475){_0x292475=_0x292475||0xc8;return function(_0x11500e){if(_0x11500e){return _0x293159['status'](_0x292475)[_0x9237('0x1d')](_0x11500e);}};}function respondWithFilteredResult(_0x5f1572,_0x3028de){return function(_0x1c105){if(_0x1c105){var _0x1286d9=typeof _0x3028de[_0x9237('0x1e')]==='undefined'&&typeof _0x3028de['limit']===_0x9237('0x1f');var _0x491212=_0x1c105[_0x9237('0x20')];var _0x11591b=_0x1286d9?0x0:_0x3028de['offset'];var _0x4b09d5=_0x1286d9?_0x1c105[_0x9237('0x20')]:_0x3028de[_0x9237('0x1e')]+_0x3028de[_0x9237('0x21')];var _0x561062;if(_0x4b09d5>=_0x491212){_0x4b09d5=_0x491212;_0x561062=0xc8;}else{_0x561062=0xce;}_0x5f1572[_0x9237('0x1b')](_0x561062);return _0x5f1572['set'](_0x9237('0x22'),_0x11591b+'-'+_0x4b09d5+'/'+_0x491212)[_0x9237('0x1d')](_0x1c105);}return null;};}function patchUpdates(_0x3e2d39){return function(_0x65f9ce){try{jsonpatch[_0x9237('0x23')](_0x65f9ce,_0x3e2d39,!![]);}catch(_0xda87bb){return BPromise[_0x9237('0x24')](_0xda87bb);}return _0x65f9ce[_0x9237('0x25')]();};}function saveUpdates(_0x969fd0,_0x25d575){return function(_0x4576d0){if(_0x4576d0){return _0x4576d0[_0x9237('0x26')](_0x969fd0)[_0x9237('0x27')](function(_0x454269){return _0x454269;});}return null;};}function removeEntity(_0x159918,_0x5eaa11){return function(_0x497dd4){if(_0x497dd4){return _0x497dd4['destroy']()[_0x9237('0x27')](function(){_0x159918[_0x9237('0x1b')](0xcc)[_0x9237('0x1c')]();});}};}function handleEntityNotFound(_0x550f2b,_0x4dd0da){return function(_0x35e8de){if(!_0x35e8de){_0x550f2b['sendStatus'](0x194);}return _0x35e8de;};}function handleError(_0xefad92,_0x225181){_0x225181=_0x225181||0x1f4;return function(_0x1df5c2){logger[_0x9237('0x28')](_0x1df5c2[_0x9237('0x29')]);if(_0x1df5c2[_0x9237('0x2a')]){delete _0x1df5c2[_0x9237('0x2a')];}_0xefad92[_0x9237('0x1b')](_0x225181)[_0x9237('0x2b')](_0x1df5c2);};}exports[_0x9237('0x2c')]=function(_0x86d71a,_0x3786a7){var _0x181123={},_0xfd23ea={},_0x508a2f={'count':0x0,'rows':[]};var _0x300118=_[_0x9237('0x2d')](db['VoiceRecording'][_0x9237('0x2e')],function(_0x4b1e88){return{'name':_0x4b1e88[_0x9237('0x2f')],'type':_0x4b1e88[_0x9237('0x30')][_0x9237('0x31')]};});_0xfd23ea[_0x9237('0x32')]=_[_0x9237('0x33')](_['map'](_0x300118,_0x9237('0x2a')),[_0x9237('0x34')]);_0xfd23ea[_0x9237('0x35')]=_[_0x9237('0x36')](_0x86d71a['query']);_0xfd23ea[_0x9237('0x37')]=_[_0x9237('0x38')](_0xfd23ea[_0x9237('0x32')],_0xfd23ea[_0x9237('0x35')]);_0x181123[_0x9237('0x39')]=_[_0x9237('0x38')](_0xfd23ea[_0x9237('0x32')],qs[_0x9237('0x3a')](_0x86d71a[_0x9237('0x35')]['fields']));_0x181123[_0x9237('0x39')]=_0x181123['attributes']['length']?_0x181123[_0x9237('0x39')]:_0xfd23ea['model'];if(!_0x86d71a['query'][_0x9237('0x3b')]('nolimit')){_0x181123[_0x9237('0x21')]=qs['limit'](_0x86d71a['query'][_0x9237('0x21')]);_0x181123[_0x9237('0x1e')]=qs[_0x9237('0x1e')](_0x86d71a['query'][_0x9237('0x1e')]);}_0x181123['order']=qs[_0x9237('0x3c')](_0x86d71a[_0x9237('0x35')][_0x9237('0x3c')]);_0x181123[_0x9237('0x3d')]=qs[_0x9237('0x37')](_[_0x9237('0x3e')](_0x86d71a['query'],_0xfd23ea[_0x9237('0x37')]),_0x300118);if(_0x86d71a[_0x9237('0x35')][_0x9237('0x3f')]){_0x181123[_0x9237('0x3d')]=_[_0x9237('0x40')](_0x181123[_0x9237('0x3d')],{'$or':_[_0x9237('0x2d')](_0x300118,function(_0x27323e){if(_0x27323e['type']!==_0x9237('0x41')){var _0x2ba4c8={};_0x2ba4c8[_0x27323e[_0x9237('0x2a')]]={'$like':'%'+_0x86d71a['query'][_0x9237('0x3f')]+'%'};return _0x2ba4c8;}})});}_0x181123=_[_0x9237('0x40')]({},_0x181123,_0x86d71a[_0x9237('0x42')]);var _0x1d2338={'where':_0x181123[_0x9237('0x3d')]};return db[_0x9237('0x43')]['count'](_0x1d2338)[_0x9237('0x27')](function(_0x12ea7e){_0x508a2f[_0x9237('0x20')]=_0x12ea7e;if(_0x86d71a['query'][_0x9237('0x44')]){_0x181123[_0x9237('0x45')]=[{'all':!![]}];}return db[_0x9237('0x43')]['findAll'](_0x181123);})[_0x9237('0x27')](function(_0x43c270){_0x508a2f['rows']=_0x43c270;return _0x508a2f;})[_0x9237('0x27')](respondWithFilteredResult(_0x3786a7,_0x181123))['catch'](handleError(_0x3786a7,null));};exports[_0x9237('0x46')]=function(_0x11a1de,_0x4d98d4){var _0x525852={'raw':![],'where':{'id':_0x11a1de['params']['id']}},_0x11a5b2={};_0x11a5b2['model']=_[_0x9237('0x36')](db[_0x9237('0x43')][_0x9237('0x2e')]);_0x11a5b2[_0x9237('0x35')]=_[_0x9237('0x36')](_0x11a1de[_0x9237('0x35')]);_0x11a5b2[_0x9237('0x37')]=_[_0x9237('0x38')](_0x11a5b2[_0x9237('0x32')],_0x11a5b2['query']);_0x525852[_0x9237('0x39')]=_[_0x9237('0x38')](_0x11a5b2[_0x9237('0x32')],qs[_0x9237('0x3a')](_0x11a1de[_0x9237('0x35')]['fields']));_0x525852[_0x9237('0x39')]=_0x525852[_0x9237('0x39')][_0x9237('0x47')]?_0x525852['attributes']:_0x11a5b2[_0x9237('0x32')];if(_0x11a1de[_0x9237('0x35')][_0x9237('0x44')]){_0x525852['include']=[{'all':!![]}];}_0x525852=_[_0x9237('0x40')]({},_0x525852,_0x11a1de[_0x9237('0x42')]);return db[_0x9237('0x43')][_0x9237('0x48')](_0x525852)[_0x9237('0x27')](handleEntityNotFound(_0x4d98d4,null))[_0x9237('0x27')](respondWithResult(_0x4d98d4,null))[_0x9237('0x49')](handleError(_0x4d98d4,null));};exports[_0x9237('0x4a')]=function(_0x2b591c,_0x380d69){return db[_0x9237('0x43')][_0x9237('0x4a')](_0x2b591c['body'],{})['then'](respondWithResult(_0x380d69,0xc9))[_0x9237('0x49')](handleError(_0x380d69,null));};exports[_0x9237('0x26')]=function(_0x30c8da,_0x48f616){if(_0x30c8da[_0x9237('0x4b')]['id']){delete _0x30c8da[_0x9237('0x4b')]['id'];}return db[_0x9237('0x43')][_0x9237('0x48')]({'where':{'id':_0x30c8da[_0x9237('0x4c')]['id']}})[_0x9237('0x27')](handleEntityNotFound(_0x48f616,null))[_0x9237('0x27')](saveUpdates(_0x30c8da['body'],null))[_0x9237('0x27')](respondWithResult(_0x48f616,null))['catch'](handleError(_0x48f616,null));};exports[_0x9237('0x4d')]=function(_0x1e0247,_0x502c66){return db['VoiceRecording'][_0x9237('0x4d')]()['then'](respondWithResult(_0x502c66,null))[_0x9237('0x49')](handleError(_0x502c66,null));};exports[_0x9237('0x4e')]=function(_0x3f1b63,_0x349247,_0x20c833){var _0x468845=require(_0x9237('0x4f'));var _0x561dd8=![];var _0x42a450={};if(_0x3f1b63[_0x9237('0x35')][_0x9237('0x30')]&&_0x3f1b63['query']['type']===_0x9237('0x50')){_0x42a450[_0x9237('0x50')]=_0x3f1b63[_0x9237('0x4c')]['id'];}else{_0x42a450['id']=_0x3f1b63['params']['id'];}return db[_0x9237('0x43')][_0x9237('0x48')]({'where':_0x42a450,'attributes':['id',_0x9237('0x51')],'raw':!![]})['then'](handleEntityNotFound(_0x349247,null))[_0x9237('0x27')](function(_0xae8208){if(_0xae8208){var _0x4d5b9e=_0xae8208[_0x9237('0x51')];var _0x377f86=util[_0x9237('0x34')](_0x9237('0x52'),_0x4d5b9e);if(fs[_0x9237('0x53')](_0x377f86)){_0x561dd8=!![];return _0x468845[_0x9237('0x54')](_0x377f86,_0x4d5b9e,config['secrets'][_0x9237('0x55')])[_0x9237('0x27')](function(){return _0xae8208;});}return _0xae8208;}})[_0x9237('0x27')](function(_0x2ea9ab){if(_0x2ea9ab){var _0x1613f0=_0x2ea9ab[_0x9237('0x51')];if(!fs['existsSync'](_0x1613f0)){throw new db[(_0x9237('0x56'))][(_0x9237('0x57'))](_0x9237('0x58'));}if(_0x2ea9ab['filename']){return _0x349247[_0x9237('0x4e')](_0x1613f0,_0x2ea9ab[_0x9237('0x59')]+path[_0x9237('0x5a')](_0x1613f0),function(){if(_0x561dd8){fs[_0x9237('0x5b')](_0x1613f0);}});}else{return _0x349247[_0x9237('0x4e')](_0x1613f0,function(_0x358cae){if(_0x561dd8){fs[_0x9237('0x5b')](_0x1613f0);}});}}})['catch'](function(_0x4b633e){if(_0x4b633e[_0x9237('0x5c')]===_0x9237('0x58')){_0x349247[_0x9237('0x1b')](0x194)[_0x9237('0x2b')](_0x9237('0x5d'));}else{return handleError(_0x349247,null);}});};exports[_0x9237('0x5e')]=function(_0x5e617f,_0x1b0603,_0x445aa7){var _0x1ce7a6=require(_0x9237('0x4f'));var _0x466800=![];var _0x598159={'$and':[db[_0x9237('0x5f')][_0x9237('0x3d')](db[_0x9237('0x5f')]['fn'](_0x9237('0x60'),db[_0x9237('0x5f')]['col'](_0x9237('0x50'))),_0x5e617f['query'][_0x9237('0x61')])]};if(_0x5e617f[_0x9237('0x35')][_0x9237('0x30')]&&_0x5e617f[_0x9237('0x35')][_0x9237('0x30')]===_0x9237('0x50')){_0x598159[_0x9237('0x62')]['push']({'uniqueid':_0x5e617f[_0x9237('0x4c')]['id']});}else{_0x598159['$and'][_0x9237('0x63')]({'id':_0x5e617f[_0x9237('0x4c')]['id']});}return db[_0x9237('0x43')][_0x9237('0x48')]({'where':_0x598159,'attributes':['id',_0x9237('0x51')],'raw':!![]})[_0x9237('0x27')](handleEntityNotFound(_0x1b0603,null))[_0x9237('0x27')](function(_0x338859){if(_0x338859){var _0x31fae4=util['format'](_0x9237('0x52'),_0x338859['value']);if(fs[_0x9237('0x53')](_0x31fae4)){_0x466800=!![];return _0x1ce7a6[_0x9237('0x54')](_0x31fae4,_0x338859[_0x9237('0x51')],config[_0x9237('0x64')][_0x9237('0x55')])['then'](function(){return _0x338859;});}return _0x338859;}})[_0x9237('0x27')](function(_0x4a2b6c){if(_0x4a2b6c){if(!fs[_0x9237('0x53')](_0x4a2b6c[_0x9237('0x51')])){throw new db[(_0x9237('0x56'))][(_0x9237('0x57'))]('VoiceRecording\x20not\x20found');}if(_0x4a2b6c[_0x9237('0x59')]){return _0x1b0603[_0x9237('0x4e')](_0x4a2b6c['value'],_0x4a2b6c[_0x9237('0x59')]+path[_0x9237('0x5a')](_0x4a2b6c[_0x9237('0x51')]),function(){if(_0x466800){fs[_0x9237('0x5b')](_0x4a2b6c[_0x9237('0x51')]);}});}else{return _0x1b0603[_0x9237('0x4e')](_0x4a2b6c[_0x9237('0x51')],function(_0x232233){if(_0x466800){fs['unlink'](_0x4a2b6c[_0x9237('0x51')]);}});}}})[_0x9237('0x49')](handleError(_0x1b0603,null));};exports[_0x9237('0x65')]=function(_0x540c89,_0x5aa133){return db[_0x9237('0x43')]['find']({'where':{'id':_0x540c89['params']['id']}})[_0x9237('0x27')](function(_0x460397){if(_[_0x9237('0x66')](_0x460397)){throw new ReferenceError('Entity\x20not\x20found');}return _0x460397;})['then'](function(_0x2d6657){var _0x54b5ce=_0x2d6657[_0x9237('0x51')];logger[_0x9237('0x67')]('cancellazione\x20fisica\x20documento\x20%s',_0x54b5ce);if(!_[_0x9237('0x66')](_0x2d6657[_0x9237('0x51')])&&fs[_0x9237('0x53')](_0x54b5ce)){logger[_0x9237('0x67')](_0x9237('0x68')+_0x54b5ce+_0x9237('0x69'));fs[_0x9237('0x6a')](_0x54b5ce);}_0x54b5ce=_0x54b5ce+_0x9237('0x6b');if(!_[_0x9237('0x66')](_0x2d6657[_0x9237('0x51')])&&fs['existsSync'](_0x54b5ce)){logger[_0x9237('0x67')]('File:\x20\x22'+_0x54b5ce+_0x9237('0x69'));fs['unlinkSync'](_0x54b5ce);}return _0x2d6657;})[_0x9237('0x27')](function(_0x18aa0e){if(!_0x18aa0e)throw new InternalError();return _0x18aa0e[_0x9237('0x65')]();})[_0x9237('0x27')](function(){_0x5aa133[_0x9237('0x1b')](0xcc)[_0x9237('0x1c')]();})['catch'](handleError(_0x5aa133,null));};function getBucketslist(_0x212301,_0x265f86,_0xc46751){return new Promise(function(_0x56e7d8,_0x2367e5){var _0x3e43df=new AWS['S3']({'accessKeyId':_0x265f86,'secretAccessKey':_0x212301,'region':_0xc46751});_0x3e43df[_0x9237('0x6c')]({},function(_0x1e3667,_0x36b312){if(_0x1e3667){return _0x2367e5(_0x1e3667);}else{return _0x56e7d8(_0x36b312);}});});}function createBucket(_0x3de5e1,_0x4b09c7,_0x3cc8a8,_0x1b7d34){return new Promise(function(_0x2e6102,_0x2b9b20){var _0x4e947b=new AWS['S3']({'accessKeyId':_0x4b09c7,'secretAccessKey':_0x3de5e1,'region':_0x3cc8a8});_0x4e947b[_0x9237('0x6d')]({'Bucket':_0x1b7d34},function(_0x32cf88,_0x3570ab){if(_0x32cf88){return _0x2b9b20(_0x32cf88);}else{return _0x2e6102(_0x3570ab);}});});}function uploadFile(_0x38137a,_0x344a4c,_0x24c27e,_0x4e8d19,_0x8b7ddc,_0x12dc6b){return new Promise(function(_0x5d96ce,_0x6ca411){var _0x55fb0c=new AWS['S3']({'accessKeyId':_0x344a4c,'secretAccessKey':_0x38137a,'region':_0x24c27e});_0x55fb0c['upload']({'Bucket':_0x4e8d19,'Key':_0x8b7ddc,'Body':_0x12dc6b},function(_0x2f2ad8,_0x25188b){if(_0x2f2ad8){return _0x6ca411(_0x2f2ad8);}else{return _0x5d96ce(_0x25188b);}});});}function startTranscribe(_0x18297a,_0x2ce5a5,_0x3fa1e8,_0xefae09,_0x4deec,_0x1f4055){return new Promise(function(_0x2a7cc0,_0x1a07ff){var _0x194729=new AWS[(_0x9237('0x6e'))]({'accessKeyId':_0x2ce5a5,'secretAccessKey':_0x18297a,'region':_0x3fa1e8});_0x194729[_0x9237('0x6f')]({'TranscriptionJobName':_0xefae09,'LanguageCode':_0x4deec,'Media':{'MediaFileUri':_0x1f4055}},function(_0x2f970b,_0x5f1225){if(_0x2f970b){return _0x1a07ff(_0x2f970b);}else{return _0x2a7cc0(_0x5f1225);}});});}function transcribe(_0x18443b,_0x26d584,_0xad9d7a,_0x533dea,_0x4ad46d,_0x128c16,_0x2874bb){return new Promise(function(_0x177daf,_0x32f04a){var _0x40097a={};logger[_0x9237('0x67')](util['format'](_0x9237('0x70'),_0x18443b,_0x4ad46d));return uploadFile(_0x26d584,_0xad9d7a,_0x533dea,_0x4ad46d,path['basename'](_0x128c16),fs[_0x9237('0x71')](_0x128c16))[_0x9237('0x27')](function(_0x3cf01a){logger['info'](util[_0x9237('0x34')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x18443b,_0x4ad46d,_0x3cf01a[_0x9237('0x72')]));_0x40097a[_0x9237('0x73')]=_0x3cf01a[_0x9237('0x74')];_0x40097a['location']=_0x3cf01a[_0x9237('0x72')];logger['info'](util['format'](_0x9237('0x75'),_0x18443b));return startTranscribe(_0x26d584,_0xad9d7a,_0x533dea,uuidv4(),_0x2874bb,_0x3cf01a[_0x9237('0x72')]);})[_0x9237('0x27')](function(_0x33fa71){logger[_0x9237('0x67')](util[_0x9237('0x34')](_0x9237('0x76'),_0x18443b,_0x33fa71[_0x9237('0x77')][_0x9237('0x78')]));_0x40097a[_0x9237('0x79')]=_0x33fa71[_0x9237('0x77')][_0x9237('0x78')];_0x40097a[_0x9237('0x7a')]=_0x33fa71[_0x9237('0x77')]['TranscriptionJobStatus'];return _0x177daf(_0x40097a);})[_0x9237('0x49')](function(_0x2653c1){return _0x32f04a(_0x2653c1);});});}exports[_0x9237('0x7b')]=function(_0x4e1786,_0xd2fb75,_0xc45259){var _0x5cb022;var _0x4b6c05;var _0x45fab5;var _0x189b7a=require(_0x9237('0x4f'));return db[_0x9237('0x43')][_0x9237('0x7c')]({'where':{'id':_0x4e1786['params']['id']}})['then'](function(_0x1d9b1a){if(_0x1d9b1a){var _0x207934=util[_0x9237('0x34')](_0x9237('0x52'),_0x1d9b1a[_0x9237('0x51')]);if(fs[_0x9237('0x53')](_0x207934)){cypher=!![];return _0x189b7a[_0x9237('0x54')](_0x207934,_0x1d9b1a['value'],config[_0x9237('0x64')][_0x9237('0x55')])[_0x9237('0x27')](function(){return _0x1d9b1a;});}return _0x1d9b1a;}})[_0x9237('0x27')](function(_0x1031ef){if(!_0x1031ef){throw new db[(_0x9237('0x56'))][(_0x9237('0x57'))]('Voice\x20Recording\x20not\x20found');}_0x4b6c05=_0x1031ef;return db[_0x9237('0x7d')][_0x9237('0x7c')]({'where':{'id':0x1}});})[_0x9237('0x27')](handleEntityNotFound(_0xd2fb75,null))[_0x9237('0x27')](function(_0x486f29){if(_0x486f29){_0x5cb022=_0x486f29;if(!_0x5cb022[_0x9237('0x7e')]||!_0x5cb022[_0x9237('0x7f')]||!_0x5cb022['transcribeRegion']||!_0x5cb022[_0x9237('0x80')]||!_0x5cb022[_0x9237('0x73')]){throw new db[(_0x9237('0x56'))]['ValidationError'](_0x9237('0x81'));}if(_0x4e1786[_0x9237('0x4b')]['runSentiment']&&(!_0x5cb022['sentiment']||!_0x5cb022[_0x9237('0x82')]||!_0x5cb022[_0x9237('0x83')]||!_0x5cb022[_0x9237('0x80')]||!_0x5cb022['bucket'])){throw new db[(_0x9237('0x56'))][(_0x9237('0x57'))](_0x9237('0x84'));}return db[_0x9237('0x85')]['findOne']({'where':{'id':_0x5cb022['transcribeAccountId']}});}})[_0x9237('0x27')](function(_0x553625){if(!_0x553625){throw new db[(_0x9237('0x56'))][(_0x9237('0x57'))](_0x9237('0x86'));}if(!_0x553625[_0x9237('0x87')]||!_0x553625[_0x9237('0x88')]){throw new db['Sequelize'][(_0x9237('0x57'))](_0x9237('0x89'));}_0x45fab5=_0x553625;return getBucketslist(_0x45fab5[_0x9237('0x87')],_0x45fab5[_0x9237('0x88')],_0x5cb022['transcribeRegion']);})[_0x9237('0x27')](function(_0x3f1b5c){if(_0x3f1b5c&&_0x3f1b5c[_0x9237('0x8a')]){var _0x50afeb=_[_0x9237('0x48')](_0x3f1b5c['Buckets'],function(_0x1746b9){return _0x1746b9[_0x9237('0x8b')]===_0x5cb022[_0x9237('0x73')];});if(!_0x50afeb){logger[_0x9237('0x67')](util[_0x9237('0x34')](_0x9237('0x8c'),_0x4e1786['params']['id'],_0x5cb022['bucket']));return createBucket(_0x45fab5[_0x9237('0x87')],_0x45fab5[_0x9237('0x88')],_0x5cb022[_0x9237('0x8d')],_0x5cb022[_0x9237('0x73')]);}logger['info'](util[_0x9237('0x34')](_0x9237('0x8e'),_0x4e1786['params']['id'],_0x5cb022['bucket']));return;}})[_0x9237('0x27')](function(_0x77be6c){if(_0x4b6c05[_0x9237('0x7a')]===_0x9237('0x8f')){return transcribe(_0x4e1786[_0x9237('0x4c')]['id'],_0x45fab5[_0x9237('0x87')],_0x45fab5[_0x9237('0x88')],_0x5cb022['transcribeRegion'],_0x5cb022[_0x9237('0x73')],_0x4b6c05[_0x9237('0x51')],_0x5cb022[_0x9237('0x80')]);}else{logger[_0x9237('0x67')](util[_0x9237('0x34')](_0x9237('0x90'),_0x4e1786[_0x9237('0x4c')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0x9237('0x27')](function(_0x3d4f30){if(_0x3d4f30){_0x3d4f30[_0x9237('0x91')]=_0x4e1786[_0x9237('0x4b')][_0x9237('0x92')];return _0x4b6c05[_0x9237('0x93')](_0x3d4f30);}})[_0x9237('0x27')](respondWithResult(_0xd2fb75,null))[_0x9237('0x49')](handleError(_0xd2fb75,null));};function writeFile(_0x3afa5a,_0x37921d){return new Promise(function(_0x114959,_0x55acf1){fs[_0x9237('0x94')](_0x37921d,_0x3afa5a,function(_0x223ccc,_0x52c5cf){if(_0x223ccc){return _0x55acf1(_0x223ccc);}else{return _0x114959(_0x52c5cf);}});});}exports[_0x9237('0x95')]=function(_0x16db49,_0x3aafa5,_0x49861f){return db['VoiceRecording'][_0x9237('0x7c')]({'where':{'id':_0x16db49[_0x9237('0x4c')]['id']}})[_0x9237('0x27')](handleEntityNotFound(_0x3aafa5))[_0x9237('0x27')](function(_0x3b10f0){if(_0x3b10f0&&_0x3b10f0[_0x9237('0x96')]){var _0x4adb00=_0x3b10f0['fileText'];var _0x4ec7dc=config[_0x9237('0x97')]+_0x9237('0x98')+_0x3b10f0['id']+_0x9237('0x99');if(fs[_0x9237('0x53')](_0x4ec7dc)){return _0x4ec7dc;}return writeFile(_0x4adb00,_0x4ec7dc)[_0x9237('0x27')](function(){return _0x4ec7dc;});}else{throw new db['Sequelize']['ValidationError'](_0x9237('0x9a'));}})['then'](function(_0x596725){return _0x3aafa5[_0x9237('0x4e')](_0x596725);})[_0x9237('0x49')](handleError(_0x3aafa5));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index bf9b70f..205baf2 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 _0x5fc8=['../../config/environment','./voiceRecording.attributes','exports','define','voice_recordings','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x5fc8,0xae));var _0x85fc=function(_0x58b42f,_0x543714){_0x58b42f=_0x58b42f-0x0;var _0x7687b3=_0x5fc8[_0x58b42f];return _0x7687b3;};'use strict';var _=require(_0x85fc('0x0'));var util=require(_0x85fc('0x1'));var logger=require(_0x85fc('0x2'))(_0x85fc('0x3'));var moment=require(_0x85fc('0x4'));var BPromise=require(_0x85fc('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x85fc('0x6'));var rimraf=require(_0x85fc('0x7'));var config=require(_0x85fc('0x8'));var attributes=require(_0x85fc('0x9'));module[_0x85fc('0xa')]=function(_0x3ab97e,_0x359305){return _0x3ab97e[_0x85fc('0xb')]('VoiceRecording',attributes,{'tableName':_0x85fc('0xc'),'paranoid':![],'indexes':[{'name':_0x85fc('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xfda2=['util','../../config/logger','api','request-promise','path','./voiceRecording.attributes','exports','define','VoiceRecording','voice_recordings','uniqueid','lodash'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0xfda2,0x8f));var _0x2fda=function(_0xdd7932,_0x1c7ea1){_0xdd7932=_0xdd7932-0x0;var _0x12c419=_0xfda2[_0xdd7932];return _0x12c419;};'use strict';var _=require(_0x2fda('0x0'));var util=require(_0x2fda('0x1'));var logger=require(_0x2fda('0x2'))(_0x2fda('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2fda('0x4'));var fs=require('fs');var path=require(_0x2fda('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2fda('0x6'));module[_0x2fda('0x7')]=function(_0x46572a,_0x2c187c){return _0x46572a[_0x2fda('0x8')](_0x2fda('0x9'),attributes,{'tableName':_0x2fda('0xa'),'paranoid':![],'indexes':[{'name':_0x2fda('0xb'),'fields':[_0x2fda('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 0adfdda..7f010b1 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 _0x4975=['catch','VoiceRecording','update','body','options','raw','where','limit','then','UpdateVoiceRecording','CreateVoiceRecording','create','value','format','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x4fda88,_0x1a4d19){var _0xe37511=function(_0x51f461){while(--_0x51f461){_0x4fda88['push'](_0x4fda88['shift']());}};_0xe37511(++_0x1a4d19);}(_0x4975,0x86));var _0x5497=function(_0x3101a5,_0x379c4d){_0x3101a5=_0x3101a5-0x0;var _0x513f49=_0x4975[_0x3101a5];return _0x513f49;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('VoiceRecording,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});}exports['UpdateVoiceRecording']=function(_0x3f4d20){var _0x1bf442=this;return new Promise(function(_0x3a47fd,_0x5d9e24){return db[_0x5497('0x17')][_0x5497('0x18')](_0x3f4d20[_0x5497('0x19')],{'raw':_0x3f4d20[_0x5497('0x1a')]?_0x3f4d20[_0x5497('0x1a')][_0x5497('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f4d20[_0x5497('0x1a')]?_0x3f4d20[_0x5497('0x1a')][_0x5497('0x1c')]||null:null,'attributes':_0x3f4d20[_0x5497('0x1a')]?_0x3f4d20[_0x5497('0x1a')]['attributes']||null:null,'limit':_0x3f4d20[_0x5497('0x1a')]?_0x3f4d20['options'][_0x5497('0x1d')]||null:null})[_0x5497('0x1e')](function(_0x44265c){logger[_0x5497('0xd')](_0x5497('0x1f'),_0x3f4d20);logger[_0x5497('0x10')]('UpdateVoiceRecording',_0x3f4d20,JSON['stringify'](_0x44265c));_0x3a47fd(_0x44265c);})[_0x5497('0x16')](function(_0x34b97f){logger[_0x5497('0x13')](_0x5497('0x1f'),_0x34b97f['message'],_0x3f4d20);_0x5d9e24(_0x1bf442[_0x5497('0x13')](0x1f4,_0x34b97f['message']));});});};exports[_0x5497('0x20')]=function(_0x16a2b4){var _0x429d36=this;return new Promise(function(_0x34a1a5,_0x163a30){var _0x31cd01=require('../../components/encryptor');var _0x4af5f4;return db['Setting']['findOne']({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0x5497('0x1e')](function(_0x48d146){_0x4af5f4=_0x48d146;return db['VoiceRecording'][_0x5497('0x21')](_0x16a2b4[_0x5497('0x19')]);})[_0x5497('0x1e')](function(_0x4c442a){if(_0x4af5f4['callRecordingEncryption']&&fs['existsSync'](_0x4c442a[_0x5497('0x22')])){var _0x471e0b=util[_0x5497('0x23')]('%s.cypher',_0x4c442a['value']);return _0x31cd01['encryptFile'](_0x4c442a[_0x5497('0x22')],_0x471e0b,config['secrets'][_0x5497('0x24')])[_0x5497('0x1e')](function(){fs[_0x5497('0x25')](_0x4c442a['value']);logger[_0x5497('0xd')](_0x5497('0x26'));return _0x4c442a;});}return _0x4c442a;})['then'](function(_0xce7cb2){logger[_0x5497('0xd')](_0x5497('0x20'),_0x16a2b4);logger['debug'](_0x5497('0x20'),_0x16a2b4,JSON[_0x5497('0x12')](_0xce7cb2));_0x34a1a5(_0xce7cb2);})[_0x5497('0x16')](function(_0x362b96){logger[_0x5497('0x13')]('CreateVoiceRecording',_0x362b96[_0x5497('0x14')],_0x16a2b4);_0x163a30(_0x429d36[_0x5497('0x13')](0x1f4,_0x362b96['message']));});});}; \ No newline at end of file +var _0x33af=['error','code','message','result','catch','UpdateVoiceRecording','VoiceRecording','body','options','raw','where','attributes','limit','findOne','callRecordingEncryption','create','existsSync','value','format','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x33155c,_0x3fdde1){var _0x5becf7=function(_0x2f7a2f){while(--_0x2f7a2f){_0x33155c['push'](_0x33155c['shift']());}};_0x5becf7(++_0x3fdde1);}(_0x33af,0xec));var _0xf33a=function(_0x5f3562,_0x212f41){_0x5f3562=_0x5f3562-0x0;var _0x1b39b4=_0x33af[_0x5f3562];return _0x1b39b4;};'use strict';var _=require('lodash');var util=require(_0xf33a('0x0'));var moment=require('moment');var BPromise=require(_0xf33a('0x1'));var rs=require(_0xf33a('0x2'));var fs=require('fs');var Redis=require(_0xf33a('0x3'));var db=require(_0xf33a('0x4'))['db'];var utils=require(_0xf33a('0x5'));var logger=require(_0xf33a('0x6'))('rpc');var config=require(_0xf33a('0x7'));var jayson=require(_0xf33a('0x8'));var client=jayson['client'][_0xf33a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x384b14,_0x1b2b01,_0x2f3730){return new BPromise(function(_0x2baabb,_0x2cb169){return client['request'](_0x384b14,_0x2f3730)[_0xf33a('0xa')](function(_0x14eb0e){logger[_0xf33a('0xb')](_0xf33a('0xc'),_0x1b2b01,_0xf33a('0xd'));logger[_0xf33a('0xe')]('VoiceRecording,\x20%s,\x20%s,\x20%s',_0x1b2b01,'request\x20sent',JSON[_0xf33a('0xf')](_0x14eb0e));if(_0x14eb0e[_0xf33a('0x10')]){if(_0x14eb0e[_0xf33a('0x10')][_0xf33a('0x11')]===0x1f4){logger[_0xf33a('0x10')]('VoiceRecording,\x20%s,\x20%s',_0x1b2b01,_0x14eb0e[_0xf33a('0x10')][_0xf33a('0x12')]);return _0x2cb169(_0x14eb0e['error']['message']);}logger[_0xf33a('0x10')](_0xf33a('0xc'),_0x1b2b01,_0x14eb0e[_0xf33a('0x10')][_0xf33a('0x12')]);return _0x2baabb(_0x14eb0e[_0xf33a('0x10')][_0xf33a('0x12')]);}else{logger[_0xf33a('0xb')](_0xf33a('0xc'),_0x1b2b01,'request\x20sent');_0x2baabb(_0x14eb0e[_0xf33a('0x13')]['message']);}})[_0xf33a('0x14')](function(_0x229389){logger['error'](_0xf33a('0xc'),_0x1b2b01,_0x229389);_0x2cb169(_0x229389);});});}exports[_0xf33a('0x15')]=function(_0x524109){var _0x2946ef=this;return new Promise(function(_0x23d9e2,_0x38d69a){return db[_0xf33a('0x16')]['update'](_0x524109[_0xf33a('0x17')],{'raw':_0x524109[_0xf33a('0x18')]?_0x524109[_0xf33a('0x18')][_0xf33a('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x524109[_0xf33a('0x18')]?_0x524109[_0xf33a('0x18')][_0xf33a('0x1a')]||null:null,'attributes':_0x524109[_0xf33a('0x18')]?_0x524109[_0xf33a('0x18')][_0xf33a('0x1b')]||null:null,'limit':_0x524109['options']?_0x524109[_0xf33a('0x18')][_0xf33a('0x1c')]||null:null})[_0xf33a('0xa')](function(_0x27faa1){logger[_0xf33a('0xb')]('UpdateVoiceRecording',_0x524109);logger[_0xf33a('0xe')]('UpdateVoiceRecording',_0x524109,JSON[_0xf33a('0xf')](_0x27faa1));_0x23d9e2(_0x27faa1);})[_0xf33a('0x14')](function(_0x394468){logger[_0xf33a('0x10')](_0xf33a('0x15'),_0x394468['message'],_0x524109);_0x38d69a(_0x2946ef[_0xf33a('0x10')](0x1f4,_0x394468[_0xf33a('0x12')]));});});};exports['CreateVoiceRecording']=function(_0x4af24a){var _0x16ef31=this;return new Promise(function(_0x5f0a53,_0x5cf981){var _0x38eba2=require('../../components/encryptor');var _0x79d653;return db['Setting'][_0xf33a('0x1d')]({'attributes':['id',_0xf33a('0x1e')],'where':{'id':0x1},'raw':!![]})[_0xf33a('0xa')](function(_0x729fca){_0x79d653=_0x729fca;return db[_0xf33a('0x16')][_0xf33a('0x1f')](_0x4af24a[_0xf33a('0x17')]);})[_0xf33a('0xa')](function(_0x26e81){if(_0x79d653[_0xf33a('0x1e')]&&fs[_0xf33a('0x20')](_0x26e81[_0xf33a('0x21')])){var _0x22c9f2=util[_0xf33a('0x22')](_0xf33a('0x23'),_0x26e81['value']);return _0x38eba2[_0xf33a('0x24')](_0x26e81[_0xf33a('0x21')],_0x22c9f2,config[_0xf33a('0x25')][_0xf33a('0x26')])['then'](function(){fs[_0xf33a('0x27')](_0x26e81[_0xf33a('0x21')]);logger[_0xf33a('0xb')](_0xf33a('0x28'));return _0x26e81;});}return _0x26e81;})[_0xf33a('0xa')](function(_0x109d84){logger['info'](_0xf33a('0x29'),_0x4af24a);logger[_0xf33a('0xe')](_0xf33a('0x29'),_0x4af24a,JSON[_0xf33a('0xf')](_0x109d84));_0x5f0a53(_0x109d84);})[_0xf33a('0x14')](function(_0x57e7be){logger['error'](_0xf33a('0x29'),_0x57e7be['message'],_0x4af24a);_0x5cf981(_0x16ef31['error'](0x1f4,_0x57e7be['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 3dc2f7c..80ebad6 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 _0x8a65=['../../config/environment','get','isAuthenticated','describe','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service'];(function(_0xa66946,_0xceeb03){var _0x22f66e=function(_0x17b1d0){while(--_0x17b1d0){_0xa66946['push'](_0xa66946['shift']());}};_0x22f66e(++_0xceeb03);}(_0x8a65,0x9c));var _0x58a6=function(_0x24a82,_0x836580){_0x24a82=_0x24a82-0x0;var _0x37095d=_0x8a65[_0x24a82];return _0x37095d;};'use strict';var multer=require(_0x58a6('0x0'));var util=require(_0x58a6('0x1'));var path=require(_0x58a6('0x2'));var timeout=require(_0x58a6('0x3'));var express=require('express');var router=express[_0x58a6('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x58a6('0x5'));var config=require(_0x58a6('0x6'));var controller=require('./voiceTransferReport.controller');router[_0x58a6('0x7')]('/',auth[_0x58a6('0x8')](),controller['index']);router['get']('/describe',auth[_0x58a6('0x8')](),controller[_0x58a6('0x9')]);router['get'](_0x58a6('0xa'),auth[_0x58a6('0x8')](),controller[_0x58a6('0xb')]);router[_0x58a6('0xc')]('/',auth[_0x58a6('0x8')](),controller[_0x58a6('0xd')]);router[_0x58a6('0xe')](_0x58a6('0xa'),auth[_0x58a6('0x8')](),controller[_0x58a6('0xf')]);router[_0x58a6('0x10')]('/:id',auth[_0x58a6('0x8')](),controller['destroy']);module[_0x58a6('0x11')]=router; \ No newline at end of file +var _0xb3d2=['/:id','show','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','describe','get'];(function(_0x47a155,_0x51db1c){var _0x4747ff=function(_0x4e6b01){while(--_0x4e6b01){_0x47a155['push'](_0x47a155['shift']());}};_0x4747ff(++_0x51db1c);}(_0xb3d2,0x1dc));var _0x2b3d=function(_0x1ab17e,_0x296bc5){_0x1ab17e=_0x1ab17e-0x0;var _0x47b5ba=_0xb3d2[_0x1ab17e];return _0x47b5ba;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2b3d('0x0'));var timeout=require(_0x2b3d('0x1'));var express=require(_0x2b3d('0x2'));var router=express[_0x2b3d('0x3')]();var fs_extra=require(_0x2b3d('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2b3d('0x5'));var config=require(_0x2b3d('0x6'));var controller=require('./voiceTransferReport.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0x2b3d('0x7')](),controller[_0x2b3d('0x8')]);router[_0x2b3d('0x9')](_0x2b3d('0xa'),auth[_0x2b3d('0x7')](),controller[_0x2b3d('0xb')]);router['post']('/',auth[_0x2b3d('0x7')](),controller[_0x2b3d('0xc')]);router[_0x2b3d('0xd')](_0x2b3d('0xa'),auth[_0x2b3d('0x7')](),controller[_0x2b3d('0xe')]);router[_0x2b3d('0xf')](_0x2b3d('0xa'),auth[_0x2b3d('0x7')](),controller[_0x2b3d('0x10')]);module[_0x2b3d('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index de83dc2..4c2bd9e 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 _0x5a9b=['Yes','sequelize','moment','exports','blind','STRING','ENUM'];(function(_0x350584,_0xaaede9){var _0xafd254=function(_0x5e1768){while(--_0x5e1768){_0x350584['push'](_0x350584['shift']());}};_0xafd254(++_0xaaede9);}(_0x5a9b,0x1b3));var _0xb5a9=function(_0x48a88b,_0x6e9361){_0x48a88b=_0x48a88b-0x0;var _0x5430d8=_0x5a9b[_0x48a88b];return _0x5430d8;};'use strict';var Sequelize=require(_0xb5a9('0x0'));var moment=require(_0xb5a9('0x1'));module[_0xb5a9('0x2')]={'type':{'type':Sequelize['ENUM'](_0xb5a9('0x3'),'attended')},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0xb5a9('0x4')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0xb5a9('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0xb5a9('0x4')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0xb5a9('0x4')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0xb5a9('0x4')]},'transfererlinkedid':{'type':Sequelize[_0xb5a9('0x4')]},'transfereechannel':{'type':Sequelize[_0xb5a9('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0xb5a9('0x4')]},'transfereecalleridname':{'type':Sequelize[_0xb5a9('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xb5a9('0x4')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0xb5a9('0x4')]},'transfereelinkedid':{'type':Sequelize[_0xb5a9('0x4')]},'isexternal':{'type':Sequelize[_0xb5a9('0x5')](_0xb5a9('0x6'),'No')},'context':{'type':Sequelize[_0xb5a9('0x4')]},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6bf2=['blind','attended','STRING','Yes','sequelize','moment','exports','ENUM'];(function(_0xf2725b,_0x41557e){var _0x560c1b=function(_0x1cab1a){while(--_0x1cab1a){_0xf2725b['push'](_0xf2725b['shift']());}};_0x560c1b(++_0x41557e);}(_0x6bf2,0x19c));var _0x26bf=function(_0x41ced9,_0x23afc1){_0x41ced9=_0x41ced9-0x0;var _0x596b12=_0x6bf2[_0x41ced9];return _0x596b12;};'use strict';var Sequelize=require(_0x26bf('0x0'));var moment=require(_0x26bf('0x1'));module[_0x26bf('0x2')]={'type':{'type':Sequelize[_0x26bf('0x3')](_0x26bf('0x4'),_0x26bf('0x5'))},'result':{'type':Sequelize[_0x26bf('0x6')]},'transfererchannel':{'type':Sequelize[_0x26bf('0x6')]},'transferercalleridnum':{'type':Sequelize[_0x26bf('0x6')]},'transferercalleridname':{'type':Sequelize[_0x26bf('0x6')]},'transfererconnectedlinenum':{'type':Sequelize[_0x26bf('0x6')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0x26bf('0x6')]},'transferercontext':{'type':Sequelize[_0x26bf('0x6')]},'transfererexten':{'type':Sequelize[_0x26bf('0x6')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0x26bf('0x6')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0x26bf('0x6')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x26bf('0x6')]},'transfereeconnectedlinename':{'type':Sequelize[_0x26bf('0x6')]},'transfereeaccountcode':{'type':Sequelize[_0x26bf('0x6')]},'transfereecontext':{'type':Sequelize[_0x26bf('0x6')]},'transfereeexten':{'type':Sequelize[_0x26bf('0x6')]},'transfereelinkedid':{'type':Sequelize[_0x26bf('0x6')]},'isexternal':{'type':Sequelize[_0x26bf('0x3')](_0x26bf('0x7'),'No')},'context':{'type':Sequelize[_0x26bf('0x6')]},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 6c84cc0..597bc0a 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 _0x8c24=['nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','index','map','VoiceTransferReport','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x8c24,0x147));var _0x48c2=function(_0x17135e,_0x33ba4a){_0x17135e=_0x17135e-0x0;var _0xba6c61=_0x8c24[_0x17135e];return _0xba6c61;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x48c2('0x0'));var zipdir=require(_0x48c2('0x1'));var jsonpatch=require(_0x48c2('0x2'));var rp=require(_0x48c2('0x3'));var moment=require(_0x48c2('0x4'));var BPromise=require(_0x48c2('0x5'));var Mustache=require(_0x48c2('0x6'));var util=require(_0x48c2('0x7'));var path=require('path');var sox=require(_0x48c2('0x8'));var csv=require('to-csv');var ejs=require(_0x48c2('0x9'));var fs=require('fs');var fs_extra=require(_0x48c2('0xa'));var _=require(_0x48c2('0xb'));var squel=require(_0x48c2('0xc'));var crypto=require(_0x48c2('0xd'));var jsforce=require(_0x48c2('0xe'));var deskjs=require(_0x48c2('0xf'));var toCsv=require(_0x48c2('0x10'));var querystring=require(_0x48c2('0x11'));var Papa=require(_0x48c2('0x12'));var Redis=require(_0x48c2('0x13'));var authService=require(_0x48c2('0x14'));var qs=require(_0x48c2('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x48c2('0x16'));var logger=require(_0x48c2('0x17'))(_0x48c2('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x48c2('0x19'));var db=require(_0x48c2('0x1a'))['db'];function respondWithStatusCode(_0x54935e,_0x1eec41){_0x1eec41=_0x1eec41||0xcc;return function(_0x108916){if(_0x108916){return _0x54935e[_0x48c2('0x1b')](_0x1eec41);}return _0x54935e[_0x48c2('0x1c')](_0x1eec41)['end']();};}function respondWithResult(_0x420cdf,_0x142a06){_0x142a06=_0x142a06||0xc8;return function(_0x2cf5ff){if(_0x2cf5ff){return _0x420cdf['status'](_0x142a06)[_0x48c2('0x1d')](_0x2cf5ff);}};}function respondWithFilteredResult(_0x6f5fd3,_0x35e815){return function(_0x2c2ac7){if(_0x2c2ac7){var _0x549c92=typeof _0x35e815['offset']===_0x48c2('0x1e')&&typeof _0x35e815[_0x48c2('0x1f')]==='undefined';var _0x49b86f=_0x2c2ac7[_0x48c2('0x20')];var _0x519077=_0x549c92?0x0:_0x35e815[_0x48c2('0x21')];var _0x6a2cf=_0x549c92?_0x2c2ac7[_0x48c2('0x20')]:_0x35e815[_0x48c2('0x21')]+_0x35e815['limit'];var _0x34dc54;if(_0x6a2cf>=_0x49b86f){_0x6a2cf=_0x49b86f;_0x34dc54=0xc8;}else{_0x34dc54=0xce;}_0x6f5fd3[_0x48c2('0x1c')](_0x34dc54);return _0x6f5fd3[_0x48c2('0x22')](_0x48c2('0x23'),_0x519077+'-'+_0x6a2cf+'/'+_0x49b86f)[_0x48c2('0x1d')](_0x2c2ac7);}return null;};}function patchUpdates(_0xcdc3ba){return function(_0x3526aa){try{jsonpatch['apply'](_0x3526aa,_0xcdc3ba,!![]);}catch(_0xd17e82){return BPromise[_0x48c2('0x24')](_0xd17e82);}return _0x3526aa[_0x48c2('0x25')]();};}function saveUpdates(_0x5e8a8b,_0x27182a){return function(_0x4f72f6){if(_0x4f72f6){return _0x4f72f6[_0x48c2('0x26')](_0x5e8a8b)[_0x48c2('0x27')](function(_0x48ca6e){return _0x48ca6e;});}return null;};}function removeEntity(_0x4f9d3e,_0x1b53d1){return function(_0x445385){if(_0x445385){return _0x445385[_0x48c2('0x28')]()[_0x48c2('0x27')](function(){_0x4f9d3e[_0x48c2('0x1c')](0xcc)[_0x48c2('0x29')]();});}};}function handleEntityNotFound(_0x1228e2,_0x5c9d97){return function(_0x1cdd42){if(!_0x1cdd42){_0x1228e2['sendStatus'](0x194);}return _0x1cdd42;};}function handleError(_0x1b0dcf,_0x34b547){_0x34b547=_0x34b547||0x1f4;return function(_0x486054){logger[_0x48c2('0x2a')](_0x486054[_0x48c2('0x2b')]);if(_0x486054[_0x48c2('0x2c')]){delete _0x486054[_0x48c2('0x2c')];}_0x1b0dcf['status'](_0x34b547)['send'](_0x486054);};}exports[_0x48c2('0x2d')]=function(_0xfe7ab,_0x356105){var _0x2563a4={},_0x3a0839={},_0x3d0564={'count':0x0,'rows':[]};var _0x3c9f5b=_[_0x48c2('0x2e')](db[_0x48c2('0x2f')][_0x48c2('0x30')],function(_0x25d725){return{'name':_0x25d725['fieldName'],'type':_0x25d725[_0x48c2('0x31')]['key']};});_0x3a0839[_0x48c2('0x32')]=_[_0x48c2('0x2e')](_0x3c9f5b,'name');_0x3a0839[_0x48c2('0x33')]=_[_0x48c2('0x34')](_0xfe7ab['query']);_0x3a0839[_0x48c2('0x35')]=_[_0x48c2('0x36')](_0x3a0839[_0x48c2('0x32')],_0x3a0839[_0x48c2('0x33')]);_0x2563a4[_0x48c2('0x37')]=_[_0x48c2('0x36')](_0x3a0839['model'],qs[_0x48c2('0x38')](_0xfe7ab[_0x48c2('0x33')][_0x48c2('0x38')]));_0x2563a4[_0x48c2('0x37')]=_0x2563a4['attributes'][_0x48c2('0x39')]?_0x2563a4[_0x48c2('0x37')]:_0x3a0839[_0x48c2('0x32')];if(!_0xfe7ab['query']['hasOwnProperty'](_0x48c2('0x3a'))){_0x2563a4[_0x48c2('0x1f')]=qs[_0x48c2('0x1f')](_0xfe7ab[_0x48c2('0x33')][_0x48c2('0x1f')]);_0x2563a4['offset']=qs['offset'](_0xfe7ab['query']['offset']);}_0x2563a4[_0x48c2('0x3b')]=qs[_0x48c2('0x3c')](_0xfe7ab['query'][_0x48c2('0x3c')]);_0x2563a4[_0x48c2('0x3d')]=qs[_0x48c2('0x35')](_[_0x48c2('0x3e')](_0xfe7ab[_0x48c2('0x33')],_0x3a0839[_0x48c2('0x35')]),_0x3c9f5b);if(_0xfe7ab[_0x48c2('0x33')][_0x48c2('0x3f')]){_0x2563a4[_0x48c2('0x3d')]=_[_0x48c2('0x40')](_0x2563a4[_0x48c2('0x3d')],{'$or':_[_0x48c2('0x2e')](_0x3c9f5b,function(_0x2e391d){if(_0x2e391d['type']!=='VIRTUAL'){var _0x58cb1f={};_0x58cb1f[_0x2e391d[_0x48c2('0x2c')]]={'$like':'%'+_0xfe7ab[_0x48c2('0x33')][_0x48c2('0x3f')]+'%'};return _0x58cb1f;}})});}_0x2563a4=_[_0x48c2('0x40')]({},_0x2563a4,_0xfe7ab[_0x48c2('0x41')]);var _0x2f26dc={'where':_0x2563a4[_0x48c2('0x3d')]};return db[_0x48c2('0x2f')][_0x48c2('0x20')](_0x2f26dc)[_0x48c2('0x27')](function(_0xb4d184){_0x3d0564[_0x48c2('0x20')]=_0xb4d184;if(_0xfe7ab['query']['includeAll']){_0x2563a4[_0x48c2('0x42')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0x48c2('0x43')](_0x2563a4);})['then'](function(_0x3a064c){_0x3d0564[_0x48c2('0x44')]=_0x3a064c;return _0x3d0564;})[_0x48c2('0x27')](respondWithFilteredResult(_0x356105,_0x2563a4))[_0x48c2('0x45')](handleError(_0x356105,null));};exports[_0x48c2('0x46')]=function(_0x33d3ff,_0x138767){var _0x348c85={'raw':!![],'where':{'id':_0x33d3ff[_0x48c2('0x47')]['id']}},_0x1026da={};_0x1026da[_0x48c2('0x32')]=_[_0x48c2('0x34')](db[_0x48c2('0x2f')][_0x48c2('0x30')]);_0x1026da[_0x48c2('0x33')]=_[_0x48c2('0x34')](_0x33d3ff[_0x48c2('0x33')]);_0x1026da['filters']=_[_0x48c2('0x36')](_0x1026da[_0x48c2('0x32')],_0x1026da[_0x48c2('0x33')]);_0x348c85[_0x48c2('0x37')]=_[_0x48c2('0x36')](_0x1026da[_0x48c2('0x32')],qs[_0x48c2('0x38')](_0x33d3ff[_0x48c2('0x33')][_0x48c2('0x38')]));_0x348c85[_0x48c2('0x37')]=_0x348c85['attributes']['length']?_0x348c85[_0x48c2('0x37')]:_0x1026da[_0x48c2('0x32')];if(_0x33d3ff[_0x48c2('0x33')][_0x48c2('0x48')]){_0x348c85['include']=[{'all':!![]}];}_0x348c85=_[_0x48c2('0x40')]({},_0x348c85,_0x33d3ff['options']);return db['VoiceTransferReport'][_0x48c2('0x49')](_0x348c85)[_0x48c2('0x27')](handleEntityNotFound(_0x138767,null))[_0x48c2('0x27')](respondWithResult(_0x138767,null))[_0x48c2('0x45')](handleError(_0x138767,null));};exports[_0x48c2('0x4a')]=function(_0x53aeec,_0xe1d42){return db['VoiceTransferReport']['create'](_0x53aeec[_0x48c2('0x4b')],{})[_0x48c2('0x27')](respondWithResult(_0xe1d42,0xc9))[_0x48c2('0x45')](handleError(_0xe1d42,null));};exports[_0x48c2('0x26')]=function(_0x5a2a3a,_0x4bbde0){if(_0x5a2a3a['body']['id']){delete _0x5a2a3a[_0x48c2('0x4b')]['id'];}return db[_0x48c2('0x2f')][_0x48c2('0x49')]({'where':{'id':_0x5a2a3a[_0x48c2('0x47')]['id']}})['then'](handleEntityNotFound(_0x4bbde0,null))['then'](saveUpdates(_0x5a2a3a[_0x48c2('0x4b')],null))[_0x48c2('0x27')](respondWithResult(_0x4bbde0,null))[_0x48c2('0x45')](handleError(_0x4bbde0,null));};exports[_0x48c2('0x28')]=function(_0x2534f6,_0x1f33f0){return db[_0x48c2('0x2f')][_0x48c2('0x49')]({'where':{'id':_0x2534f6['params']['id']}})[_0x48c2('0x27')](handleEntityNotFound(_0x1f33f0,null))['then'](removeEntity(_0x1f33f0,null))[_0x48c2('0x45')](handleError(_0x1f33f0,null));};exports[_0x48c2('0x4c')]=function(_0x3ae447,_0x323b26){return db['VoiceTransferReport'][_0x48c2('0x4c')]()['then'](respondWithResult(_0x323b26,null))['catch'](handleError(_0x323b26,null));}; \ No newline at end of file +var _0x900f=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','error','stack','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','model','name','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0xe84953,_0xa2cc7){var _0x2f486f=function(_0x4a0a09){while(--_0x4a0a09){_0xe84953['push'](_0xe84953['shift']());}};_0x2f486f(++_0xa2cc7);}(_0x900f,0x86));var _0xf900=function(_0x178ca4,_0x5aaa16){_0x178ca4=_0x178ca4-0x0;var _0x57f6a8=_0x900f[_0x178ca4];return _0x57f6a8;};'use strict';var emlformat=require(_0xf900('0x0'));var rimraf=require(_0xf900('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf900('0x2'));var rp=require(_0xf900('0x3'));var moment=require('moment');var BPromise=require(_0xf900('0x4'));var Mustache=require(_0xf900('0x5'));var util=require('util');var path=require(_0xf900('0x6'));var sox=require(_0xf900('0x7'));var csv=require('to-csv');var ejs=require(_0xf900('0x8'));var fs=require('fs');var fs_extra=require(_0xf900('0x9'));var _=require(_0xf900('0xa'));var squel=require(_0xf900('0xb'));var crypto=require(_0xf900('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf900('0xd'));var toCsv=require(_0xf900('0xe'));var querystring=require('querystring');var Papa=require(_0xf900('0xf'));var Redis=require('ioredis');var authService=require(_0xf900('0x10'));var qs=require(_0xf900('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf900('0x12'));var logger=require(_0xf900('0x13'))(_0xf900('0x14'));var utils=require(_0xf900('0x15'));var config=require(_0xf900('0x16'));var licenseUtil=require(_0xf900('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1c49cd,_0x4c4bc9){_0x4c4bc9=_0x4c4bc9||0xcc;return function(_0x2246a8){if(_0x2246a8){return _0x1c49cd[_0xf900('0x18')](_0x4c4bc9);}return _0x1c49cd[_0xf900('0x19')](_0x4c4bc9)[_0xf900('0x1a')]();};}function respondWithResult(_0x54ea1c,_0x4847fb){_0x4847fb=_0x4847fb||0xc8;return function(_0x546639){if(_0x546639){return _0x54ea1c[_0xf900('0x19')](_0x4847fb)[_0xf900('0x1b')](_0x546639);}};}function respondWithFilteredResult(_0x14c05a,_0x1b3861){return function(_0x31ccca){if(_0x31ccca){var _0x3e284f=typeof _0x1b3861[_0xf900('0x1c')]===_0xf900('0x1d')&&typeof _0x1b3861[_0xf900('0x1e')]==='undefined';var _0x17e180=_0x31ccca[_0xf900('0x1f')];var _0x363e18=_0x3e284f?0x0:_0x1b3861['offset'];var _0x5a2c46=_0x3e284f?_0x31ccca[_0xf900('0x1f')]:_0x1b3861['offset']+_0x1b3861['limit'];var _0x37da0f;if(_0x5a2c46>=_0x17e180){_0x5a2c46=_0x17e180;_0x37da0f=0xc8;}else{_0x37da0f=0xce;}_0x14c05a[_0xf900('0x19')](_0x37da0f);return _0x14c05a['set'](_0xf900('0x20'),_0x363e18+'-'+_0x5a2c46+'/'+_0x17e180)['json'](_0x31ccca);}return null;};}function patchUpdates(_0x4ab1f1){return function(_0x62f80f){try{jsonpatch[_0xf900('0x21')](_0x62f80f,_0x4ab1f1,!![]);}catch(_0x4176b7){return BPromise[_0xf900('0x22')](_0x4176b7);}return _0x62f80f[_0xf900('0x23')]();};}function saveUpdates(_0x27b917,_0x447860){return function(_0x41a9f9){if(_0x41a9f9){return _0x41a9f9[_0xf900('0x24')](_0x27b917)['then'](function(_0x4ca02a){return _0x4ca02a;});}return null;};}function removeEntity(_0x2e441b,_0x3b8663){return function(_0x4f5dd4){if(_0x4f5dd4){return _0x4f5dd4[_0xf900('0x25')]()[_0xf900('0x26')](function(){_0x2e441b['status'](0xcc)[_0xf900('0x1a')]();});}};}function handleEntityNotFound(_0x2c911f,_0x557342){return function(_0x1c5e9e){if(!_0x1c5e9e){_0x2c911f[_0xf900('0x18')](0x194);}return _0x1c5e9e;};}function handleError(_0x431bc0,_0x26f85c){_0x26f85c=_0x26f85c||0x1f4;return function(_0x29a987){logger[_0xf900('0x27')](_0x29a987[_0xf900('0x28')]);if(_0x29a987['name']){delete _0x29a987['name'];}_0x431bc0[_0xf900('0x19')](_0x26f85c)[_0xf900('0x29')](_0x29a987);};}exports[_0xf900('0x2a')]=function(_0x389348,_0x1c17f6){var _0x1a10ec={},_0x1c0963={},_0x5496ec={'count':0x0,'rows':[]};var _0x45b586=_[_0xf900('0x2b')](db[_0xf900('0x2c')][_0xf900('0x2d')],function(_0x3f0373){return{'name':_0x3f0373[_0xf900('0x2e')],'type':_0x3f0373[_0xf900('0x2f')][_0xf900('0x30')]};});_0x1c0963[_0xf900('0x31')]=_[_0xf900('0x2b')](_0x45b586,_0xf900('0x32'));_0x1c0963[_0xf900('0x33')]=_[_0xf900('0x34')](_0x389348[_0xf900('0x33')]);_0x1c0963['filters']=_[_0xf900('0x35')](_0x1c0963[_0xf900('0x31')],_0x1c0963['query']);_0x1a10ec[_0xf900('0x36')]=_['intersection'](_0x1c0963['model'],qs[_0xf900('0x37')](_0x389348[_0xf900('0x33')][_0xf900('0x37')]));_0x1a10ec[_0xf900('0x36')]=_0x1a10ec[_0xf900('0x36')]['length']?_0x1a10ec[_0xf900('0x36')]:_0x1c0963['model'];if(!_0x389348[_0xf900('0x33')][_0xf900('0x38')](_0xf900('0x39'))){_0x1a10ec['limit']=qs[_0xf900('0x1e')](_0x389348[_0xf900('0x33')][_0xf900('0x1e')]);_0x1a10ec[_0xf900('0x1c')]=qs[_0xf900('0x1c')](_0x389348['query'][_0xf900('0x1c')]);}_0x1a10ec['order']=qs[_0xf900('0x3a')](_0x389348['query'][_0xf900('0x3a')]);_0x1a10ec[_0xf900('0x3b')]=qs[_0xf900('0x3c')](_[_0xf900('0x3d')](_0x389348[_0xf900('0x33')],_0x1c0963['filters']),_0x45b586);if(_0x389348[_0xf900('0x33')][_0xf900('0x3e')]){_0x1a10ec[_0xf900('0x3b')]=_[_0xf900('0x3f')](_0x1a10ec[_0xf900('0x3b')],{'$or':_['map'](_0x45b586,function(_0x62946a){if(_0x62946a[_0xf900('0x2f')]!==_0xf900('0x40')){var _0x17cf65={};_0x17cf65[_0x62946a[_0xf900('0x32')]]={'$like':'%'+_0x389348[_0xf900('0x33')][_0xf900('0x3e')]+'%'};return _0x17cf65;}})});}_0x1a10ec=_[_0xf900('0x3f')]({},_0x1a10ec,_0x389348[_0xf900('0x41')]);var _0x4327e1={'where':_0x1a10ec['where']};return db['VoiceTransferReport'][_0xf900('0x1f')](_0x4327e1)[_0xf900('0x26')](function(_0xefde28){_0x5496ec['count']=_0xefde28;if(_0x389348[_0xf900('0x33')][_0xf900('0x42')]){_0x1a10ec[_0xf900('0x43')]=[{'all':!![]}];}return db[_0xf900('0x2c')][_0xf900('0x44')](_0x1a10ec);})['then'](function(_0x563686){_0x5496ec[_0xf900('0x45')]=_0x563686;return _0x5496ec;})[_0xf900('0x26')](respondWithFilteredResult(_0x1c17f6,_0x1a10ec))['catch'](handleError(_0x1c17f6,null));};exports[_0xf900('0x46')]=function(_0x210eba,_0x26a63d){var _0x5911a6={'raw':!![],'where':{'id':_0x210eba[_0xf900('0x47')]['id']}},_0x26e06d={};_0x26e06d[_0xf900('0x31')]=_[_0xf900('0x34')](db['VoiceTransferReport'][_0xf900('0x2d')]);_0x26e06d[_0xf900('0x33')]=_['keys'](_0x210eba[_0xf900('0x33')]);_0x26e06d[_0xf900('0x3c')]=_[_0xf900('0x35')](_0x26e06d['model'],_0x26e06d[_0xf900('0x33')]);_0x5911a6[_0xf900('0x36')]=_[_0xf900('0x35')](_0x26e06d['model'],qs['fields'](_0x210eba[_0xf900('0x33')][_0xf900('0x37')]));_0x5911a6[_0xf900('0x36')]=_0x5911a6['attributes']['length']?_0x5911a6[_0xf900('0x36')]:_0x26e06d['model'];if(_0x210eba[_0xf900('0x33')][_0xf900('0x42')]){_0x5911a6[_0xf900('0x43')]=[{'all':!![]}];}_0x5911a6=_[_0xf900('0x3f')]({},_0x5911a6,_0x210eba[_0xf900('0x41')]);return db['VoiceTransferReport'][_0xf900('0x48')](_0x5911a6)[_0xf900('0x26')](handleEntityNotFound(_0x26a63d,null))[_0xf900('0x26')](respondWithResult(_0x26a63d,null))[_0xf900('0x49')](handleError(_0x26a63d,null));};exports[_0xf900('0x4a')]=function(_0x558f05,_0x451e58){return db['VoiceTransferReport']['create'](_0x558f05[_0xf900('0x4b')],{})['then'](respondWithResult(_0x451e58,0xc9))[_0xf900('0x49')](handleError(_0x451e58,null));};exports[_0xf900('0x24')]=function(_0x13dccf,_0x55da6b){if(_0x13dccf[_0xf900('0x4b')]['id']){delete _0x13dccf['body']['id'];}return db[_0xf900('0x2c')][_0xf900('0x48')]({'where':{'id':_0x13dccf['params']['id']}})[_0xf900('0x26')](handleEntityNotFound(_0x55da6b,null))['then'](saveUpdates(_0x13dccf[_0xf900('0x4b')],null))[_0xf900('0x26')](respondWithResult(_0x55da6b,null))[_0xf900('0x49')](handleError(_0x55da6b,null));};exports[_0xf900('0x25')]=function(_0x354b78,_0x26016c){return db[_0xf900('0x2c')][_0xf900('0x48')]({'where':{'id':_0x354b78[_0xf900('0x47')]['id']}})[_0xf900('0x26')](handleEntityNotFound(_0x26016c,null))[_0xf900('0x26')](removeEntity(_0x26016c,null))[_0xf900('0x49')](handleError(_0x26016c,null));};exports['describe']=function(_0x484caf,_0x4de1c0){return db[_0xf900('0x2c')]['describe']()[_0xf900('0x26')](respondWithResult(_0x4de1c0,null))[_0xf900('0x49')](handleError(_0x4de1c0,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 9162607..1707338 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 _0x3200=['rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','lodash','../../config/logger','api','moment','bluebird'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x3200,0x73));var _0x0320=function(_0x4f47a7,_0xa33fae){_0x4f47a7=_0x4f47a7-0x0;var _0x2a6bbe=_0x3200[_0x4f47a7];return _0x2a6bbe;};'use strict';var _=require(_0x0320('0x0'));var util=require('util');var logger=require(_0x0320('0x1'))(_0x0320('0x2'));var moment=require(_0x0320('0x3'));var BPromise=require(_0x0320('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0320('0x5'));var config=require(_0x0320('0x6'));var attributes=require(_0x0320('0x7'));module[_0x0320('0x8')]=function(_0x19d372,_0x301d46){return _0x19d372[_0x0320('0x9')](_0x0320('0xa'),attributes,{'tableName':_0x0320('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4ff0=['lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','exports','define','report_call_transfer'];(function(_0x1229f1,_0x624221){var _0x39cf59=function(_0x44375e){while(--_0x44375e){_0x1229f1['push'](_0x1229f1['shift']());}};_0x39cf59(++_0x624221);}(_0x4ff0,0xe7));var _0x04ff=function(_0x253fdb,_0x1e5e09){_0x253fdb=_0x253fdb-0x0;var _0x3d7953=_0x4ff0[_0x253fdb];return _0x3d7953;};'use strict';var _=require(_0x04ff('0x0'));var util=require(_0x04ff('0x1'));var logger=require(_0x04ff('0x2'))(_0x04ff('0x3'));var moment=require(_0x04ff('0x4'));var BPromise=require(_0x04ff('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x04ff('0x6'));var rimraf=require('rimraf');var config=require(_0x04ff('0x7'));var attributes=require('./voiceTransferReport.attributes');module[_0x04ff('0x8')]=function(_0x3800a3,_0x30eca4){return _0x3800a3[_0x04ff('0x9')]('VoiceTransferReport',attributes,{'tableName':_0x04ff('0xa'),'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 3494f01..931358f 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 _0x3fef=['options','raw','CreateVoiceTransferReport','lodash','util','randomstring','../../mysqldb','../../config/utils','../../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','message','catch','create','body'];(function(_0x4f9b89,_0x2da924){var _0x48a106=function(_0x584bd1){while(--_0x584bd1){_0x4f9b89['push'](_0x4f9b89['shift']());}};_0x48a106(++_0x2da924);}(_0x3fef,0x99));var _0xf3fe=function(_0x210d73,_0x47d720){_0x210d73=_0x210d73-0x0;var _0x10a8db=_0x3fef[_0x210d73];return _0x10a8db;};'use strict';var _=require(_0xf3fe('0x0'));var util=require(_0xf3fe('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf3fe('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf3fe('0x3'))['db'];var utils=require(_0xf3fe('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xf3fe('0x5'));var jayson=require(_0xf3fe('0x6'));var client=jayson[_0xf3fe('0x7')][_0xf3fe('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x22ddbf,_0x3293a9,_0x214d2b){return new BPromise(function(_0x3ff2e1,_0x4ed4c9){return client[_0xf3fe('0x9')](_0x22ddbf,_0x214d2b)[_0xf3fe('0xa')](function(_0x5be1ae){logger[_0xf3fe('0xb')](_0xf3fe('0xc'),_0x3293a9,_0xf3fe('0xd'));logger[_0xf3fe('0xe')](_0xf3fe('0xf'),_0x3293a9,_0xf3fe('0xd'),JSON[_0xf3fe('0x10')](_0x5be1ae));if(_0x5be1ae[_0xf3fe('0x11')]){if(_0x5be1ae[_0xf3fe('0x11')]['code']===0x1f4){logger[_0xf3fe('0x11')](_0xf3fe('0xc'),_0x3293a9,_0x5be1ae[_0xf3fe('0x11')][_0xf3fe('0x12')]);return _0x4ed4c9(_0x5be1ae['error']['message']);}logger[_0xf3fe('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x3293a9,_0x5be1ae[_0xf3fe('0x11')][_0xf3fe('0x12')]);return _0x3ff2e1(_0x5be1ae[_0xf3fe('0x11')][_0xf3fe('0x12')]);}else{logger[_0xf3fe('0xb')](_0xf3fe('0xc'),_0x3293a9,_0xf3fe('0xd'));_0x3ff2e1(_0x5be1ae['result'][_0xf3fe('0x12')]);}})[_0xf3fe('0x13')](function(_0x4fb244){logger[_0xf3fe('0x11')](_0xf3fe('0xc'),_0x3293a9,_0x4fb244);_0x4ed4c9(_0x4fb244);});});}exports['CreateVoiceTransferReport']=function(_0x4cec89){var _0x691d74=this;return new Promise(function(_0x4792c0,_0xe99054){return db['VoiceTransferReport'][_0xf3fe('0x14')](_0x4cec89[_0xf3fe('0x15')],{'raw':_0x4cec89[_0xf3fe('0x16')]?_0x4cec89['options'][_0xf3fe('0x17')]===undefined?!![]:![]:!![]})[_0xf3fe('0xa')](function(_0x3dee65){logger[_0xf3fe('0xb')](_0xf3fe('0x18'),_0x4cec89);logger[_0xf3fe('0xe')](_0xf3fe('0x18'),_0x4cec89,JSON[_0xf3fe('0x10')](_0x3dee65));_0x4792c0(_0x3dee65);})['catch'](function(_0x371854){logger[_0xf3fe('0x11')](_0xf3fe('0x18'),_0x371854[_0xf3fe('0x12')],_0x4cec89);_0xe99054(_0x691d74[_0xf3fe('0x11')](0x1f4,_0x371854[_0xf3fe('0x12')]));});});}; \ No newline at end of file +var _0x70db=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','lodash','util','bluebird','randomstring'];(function(_0x3d39a3,_0x70fab7){var _0x3fccc9=function(_0x2b23b6){while(--_0x2b23b6){_0x3d39a3['push'](_0x3d39a3['shift']());}};_0x3fccc9(++_0x70fab7);}(_0x70db,0xa4));var _0xb70d=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x70db[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0xb70d('0x0'));var util=require(_0xb70d('0x1'));var moment=require('moment');var BPromise=require(_0xb70d('0x2'));var rs=require(_0xb70d('0x3'));var fs=require('fs');var Redis=require(_0xb70d('0x4'));var db=require(_0xb70d('0x5'))['db'];var utils=require(_0xb70d('0x6'));var logger=require('../../config/logger')(_0xb70d('0x7'));var config=require(_0xb70d('0x8'));var jayson=require(_0xb70d('0x9'));var client=jayson[_0xb70d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ad55e,_0x323315,_0x442fc6){return new BPromise(function(_0x5b53d6,_0x29d302){return client[_0xb70d('0xb')](_0x2ad55e,_0x442fc6)['then'](function(_0x385fcc){logger[_0xb70d('0xc')](_0xb70d('0xd'),_0x323315,_0xb70d('0xe'));logger[_0xb70d('0xf')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x323315,_0xb70d('0xe'),JSON[_0xb70d('0x10')](_0x385fcc));if(_0x385fcc['error']){if(_0x385fcc[_0xb70d('0x11')][_0xb70d('0x12')]===0x1f4){logger[_0xb70d('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x323315,_0x385fcc['error'][_0xb70d('0x13')]);return _0x29d302(_0x385fcc['error'][_0xb70d('0x13')]);}logger['error'](_0xb70d('0xd'),_0x323315,_0x385fcc[_0xb70d('0x11')]['message']);return _0x5b53d6(_0x385fcc[_0xb70d('0x11')][_0xb70d('0x13')]);}else{logger['info'](_0xb70d('0xd'),_0x323315,_0xb70d('0xe'));_0x5b53d6(_0x385fcc[_0xb70d('0x14')][_0xb70d('0x13')]);}})[_0xb70d('0x15')](function(_0x44eb40){logger['error'](_0xb70d('0xd'),_0x323315,_0x44eb40);_0x29d302(_0x44eb40);});});}exports[_0xb70d('0x16')]=function(_0x4c323f){var _0x207431=this;return new Promise(function(_0x2efb14,_0x5c5c28){return db[_0xb70d('0x17')][_0xb70d('0x18')](_0x4c323f[_0xb70d('0x19')],{'raw':_0x4c323f[_0xb70d('0x1a')]?_0x4c323f[_0xb70d('0x1a')][_0xb70d('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x1baf8d){logger['info'](_0xb70d('0x16'),_0x4c323f);logger[_0xb70d('0xf')]('CreateVoiceTransferReport',_0x4c323f,JSON[_0xb70d('0x10')](_0x1baf8d));_0x2efb14(_0x1baf8d);})[_0xb70d('0x15')](function(_0x23613c){logger[_0xb70d('0x11')]('CreateVoiceTransferReport',_0x23613c['message'],_0x4c323f);_0x5c5c28(_0x207431['error'](0x1f4,_0x23613c[_0xb70d('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 01587bc..7569ea2 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 _0xb43b=['/transfer','transfer','express','Router','./webbar.controller','post','/originate','isWebrtcLicence','originate','/hangup','hangup','/answer','isAuthenticated','answer','/unhold','unhold'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xb43b,0x1b2));var _0xbb43=function(_0x2537f3,_0x354225){_0x2537f3=_0x2537f3-0x0;var _0x4b62a8=_0xb43b[_0x2537f3];return _0x4b62a8;};'use strict';var express=require(_0xbb43('0x0'));var router=express[_0xbb43('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xbb43('0x2'));router[_0xbb43('0x3')](_0xbb43('0x4'),auth['isAuthenticated'](),auth[_0xbb43('0x5')](),controller[_0xbb43('0x6')]);router[_0xbb43('0x3')](_0xbb43('0x7'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0xbb43('0x8')]);router['post'](_0xbb43('0x9'),auth[_0xbb43('0xa')](),auth[_0xbb43('0x5')](),controller[_0xbb43('0xb')]);router[_0xbb43('0x3')]('/hold',auth[_0xbb43('0xa')](),auth[_0xbb43('0x5')](),controller['hold']);router[_0xbb43('0x3')](_0xbb43('0xc'),auth[_0xbb43('0xa')](),auth[_0xbb43('0x5')](),controller[_0xbb43('0xd')]);router[_0xbb43('0x3')]('/calls',auth[_0xbb43('0xa')](),auth[_0xbb43('0x5')](),controller['calls']);router['post'](_0xbb43('0xe'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0xbb43('0xf')]);module['exports']=router; \ No newline at end of file +var _0x9c44=['/answer','answer','/hold','/unhold','unhold','/transfer','transfer','exports','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','isWebrtcLicence','/hangup','hangup'];(function(_0x2a5b3b,_0x4ebe31){var _0xae665a=function(_0x59e86a){while(--_0x59e86a){_0x2a5b3b['push'](_0x2a5b3b['shift']());}};_0xae665a(++_0x4ebe31);}(_0x9c44,0x178));var _0x49c4=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x9c44[_0x3bf83f];return _0x22c4a9;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x49c4('0x0'));var controller=require(_0x49c4('0x1'));router[_0x49c4('0x2')](_0x49c4('0x3'),auth[_0x49c4('0x4')](),auth[_0x49c4('0x5')](),controller['originate']);router['post'](_0x49c4('0x6'),auth['isAuthenticated'](),auth[_0x49c4('0x5')](),controller[_0x49c4('0x7')]);router[_0x49c4('0x2')](_0x49c4('0x8'),auth[_0x49c4('0x4')](),auth['isWebrtcLicence'](),controller[_0x49c4('0x9')]);router[_0x49c4('0x2')](_0x49c4('0xa'),auth[_0x49c4('0x4')](),auth['isWebrtcLicence'](),controller['hold']);router[_0x49c4('0x2')](_0x49c4('0xb'),auth['isAuthenticated'](),auth[_0x49c4('0x5')](),controller[_0x49c4('0xc')]);router['post']('/calls',auth[_0x49c4('0x4')](),auth[_0x49c4('0x5')](),controller['calls']);router[_0x49c4('0x2')](_0x49c4('0xd'),auth['isAuthenticated'](),auth[_0x49c4('0x5')](),controller[_0x49c4('0xe')]);module[_0x49c4('0xf')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 67411f4..304b910 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 _0x9567=['stringify','emit','handleError:','error','name','status','send','NotFound','request','then','code','message','result','catch','User','findOne','agent','VoiceChannels','all','filter','rows','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','validate','json','userId','callNumber','callerId','callbackUrl','entityFound:','user:%s','originate\x20executed!','hangup\x20fired:','webbar:hangup','answer','answer\x20fired:','format','webbar:answer','answer\x20executed!','hold','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','client','http','webbarapi','redis','localhost','number','userId\x20is\x20required','callNumber\x20is\x20required','string','sessionId\x20is\x20required','transferNumber\x20is\x20required','info'];(function(_0xe50213,_0x33d3a7){var _0x580080=function(_0x23587a){while(--_0x23587a){_0xe50213['push'](_0xe50213['shift']());}};_0x580080(++_0x33d3a7);}(_0x9567,0xdc));var _0x7956=function(_0x5bef95,_0x44a342){_0x5bef95=_0x5bef95-0x0;var _0x4db52a=_0x9567[_0x5bef95];return _0x4db52a;};'use strict';var path=require(_0x7956('0x0'));var fs=require('fs');var _=require(_0x7956('0x1'));var db=require(_0x7956('0x2'))['db'];var config=require(_0x7956('0x3'));var util=require(_0x7956('0x4'));var BPromise=require('bluebird');var jayson=require('jayson/promise');var amiClient=jayson[_0x7956('0x5')][_0x7956('0x6')]({'port':0x232a});var logger=require('../../config/logger')(_0x7956('0x7'));var Redis=require('ioredis');config[_0x7956('0x8')]=_['defaults'](config[_0x7956('0x8')],{'host':_0x7956('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7956('0x8')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0x7956('0xa'),'required':[!![],_0x7956('0xb')]},'callNumber':{'type':'string','required':[!![],_0x7956('0xc')]},'callerId':{'type':_0x7956('0xd')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0x7956('0xa'),'required':[!![],_0x7956('0xb')]},'sessionId':{'type':_0x7956('0xd'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0x7956('0xb')]},'sessionId':{'type':_0x7956('0xd'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x7956('0xa'),'required':[!![],_0x7956('0xb')]},'sessionId':{'type':'string','required':[!![],_0x7956('0xe')]},'transferNumber':{'type':_0x7956('0xd'),'required':[!![],_0x7956('0xf')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x7956('0xb')]},'sessionId':{'type':_0x7956('0xd'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x7956('0xa'),'required':[!![],_0x7956('0xb')]},'sessionId':{'type':_0x7956('0xd'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x7956('0xa'),'required':[!![],_0x7956('0xb')]}});var conferenceValidation=new Schema({'userId':{'type':_0x7956('0xa'),'required':[!![],_0x7956('0xb')]}});function emit(_0x6a6d78,_0x41d67a,_0x2820cd){logger[_0x7956('0x10')](_0x6a6d78,_0x41d67a,JSON[_0x7956('0x11')](_0x2820cd));io['to'](_0x6a6d78)[_0x7956('0x12')](_0x41d67a,_0x2820cd);}function handleError(_0x4640db){return function(_0x5e6b90){console['log'](_0x7956('0x13'),_0x5e6b90,_0x5e6b90 instanceof RangeError);logger[_0x7956('0x14')](_0x5e6b90['stack']);if(_0x5e6b90 instanceof RangeError){if(_0x5e6b90[_0x7956('0x15')]){delete _0x5e6b90['name'];}_0x4640db[_0x7956('0x16')](0x194)[_0x7956('0x17')](_0x5e6b90);}else{if(_0x5e6b90['name']){delete _0x5e6b90[_0x7956('0x15')];}_0x4640db[_0x7956('0x16')](0x1f4)[_0x7956('0x17')](_0x5e6b90);}};}function checkError(){return function(_0x4adf84){if(!_0x4adf84){throw new RangeError(_0x7956('0x18'));}return _0x4adf84;};}function respondWithRpcPromise(_0x497996,_0x171fc8){return new BPromise(function(_0x5100d8,_0x427500){var _0x8a7165=amiClient;return _0x8a7165[_0x7956('0x19')](_0x497996,_0x171fc8)[_0x7956('0x1a')](function(_0x4d4d95){if(_0x4d4d95[_0x7956('0x14')]){if(_0x4d4d95[_0x7956('0x14')][_0x7956('0x1b')]===0x1f4){return _0x427500(_0x4d4d95['error']['message']);}return _0x5100d8(_0x4d4d95[_0x7956('0x14')][_0x7956('0x1c')]);}else{_0x5100d8(_0x4d4d95[_0x7956('0x1d')]);}})[_0x7956('0x1e')](function(_0x4572b2){_0x427500(_0x4572b2);});});}function getAgent(_0x4e5b2d){return db[_0x7956('0x1f')][_0x7956('0x20')]({'where':{'id':_0x4e5b2d,'role':_0x7956('0x21')}})[_0x7956('0x1a')](checkError());}function getAgentCheckSession(_0x16d978,_0x30392c){return new BPromise(function(_0x4821d7,_0x3c4d5f){var _0x33401e=respondWithRpcPromise(_0x7956('0x22'));var _0x3de345=getAgent(_0x16d978);Promise[_0x7956('0x23')]([_0x33401e,_0x3de345])[_0x7956('0x1a')](function(_0x12cc06){var _0x30a8d1=_0x12cc06[0x0];var _0x2f248d=_0x12cc06[0x1];var _0x401770=_[_0x7956('0x24')](_0x30a8d1[_0x7956('0x25')],function(_0x21fb1b){return _0x21fb1b[_0x7956('0x26')]==_0x2f248d['id']&&_0x21fb1b[_0x7956('0x27')]==_0x30392c;});if(_0x401770[_0x7956('0x28')]==0x1){_0x4821d7(_0x2f248d);}else{_0x3c4d5f(new RangeError(_0x7956('0x29')+_0x30392c+_0x7956('0x2a')));}});});}exports[_0x7956('0x2b')]=function(_0x134d24,_0x5bb0f1){logger[_0x7956('0x10')](_0x7956('0x2c'),_0x134d24[_0x7956('0x2d')]);var _0x3a8d1d=originateValidation[_0x7956('0x2e')](_0x134d24[_0x7956('0x2d')]);if(_0x3a8d1d['length']>0x0){return _0x5bb0f1[_0x7956('0x16')](0x190)[_0x7956('0x2f')](_0x3a8d1d);}var _0x50d8cc=_0x134d24[_0x7956('0x2d')][_0x7956('0x30')];var _0x1c3411=_0x134d24[_0x7956('0x2d')][_0x7956('0x31')];var _0x302d38=_0x134d24[_0x7956('0x2d')][_0x7956('0x32')];var _0x5fb356=_0x134d24[_0x7956('0x2d')][_0x7956('0x33')];return getAgent(_0x50d8cc)[_0x7956('0x1a')](function(_0x1326b5){logger[_0x7956('0x10')](_0x7956('0x34'),_0x1326b5[_0x7956('0x15')]);emit(util['format'](_0x7956('0x35'),_0x1326b5[_0x7956('0x15')]),'webbar:originate',{'callNumber':_0x1c3411,'callerId':_0x302d38,'callbackUrl':_0x5fb356});return _0x5bb0f1[_0x7956('0x16')](0xc8)['json']({'error':![],'message':_0x7956('0x36')});})['catch'](handleError(_0x5bb0f1));};exports['hangup']=function(_0x5003ca,_0x4810ff){logger[_0x7956('0x10')](_0x7956('0x37'),_0x5003ca[_0x7956('0x2d')]);var _0x26f7b5=hangupValidation[_0x7956('0x2e')](_0x5003ca[_0x7956('0x2d')]);if(_0x26f7b5[_0x7956('0x28')]>0x0){return _0x4810ff[_0x7956('0x16')](0x190)[_0x7956('0x2f')](_0x26f7b5);}var _0x55c526=_0x5003ca[_0x7956('0x2d')]['userId'];var _0x1aaee5=_0x5003ca[_0x7956('0x2d')][_0x7956('0x27')];return getAgent(_0x55c526)[_0x7956('0x1a')](function(_0x4fd0fc){logger[_0x7956('0x10')](_0x7956('0x34'),_0x4fd0fc['name']);emit(util['format'](_0x7956('0x35'),_0x4fd0fc['name']),_0x7956('0x38'),{'sessionId':_0x1aaee5});return _0x4810ff[_0x7956('0x16')](0xc8)[_0x7956('0x2f')]({'error':![],'message':'hangup\x20executed!'});})[_0x7956('0x1e')](handleError(_0x4810ff));};exports[_0x7956('0x39')]=function(_0x57865d,_0x2f5d7d){logger['info'](_0x7956('0x3a'),_0x57865d[_0x7956('0x2d')]);var _0x1968ab=answerValidation[_0x7956('0x2e')](_0x57865d[_0x7956('0x2d')]);if(_0x1968ab['length']>0x0){return _0x2f5d7d['status'](0x190)[_0x7956('0x2f')](_0x1968ab);}var _0x475c42=_0x57865d[_0x7956('0x2d')][_0x7956('0x30')];var _0x23472d=_0x57865d[_0x7956('0x2d')]['sessionId'];return getAgent(_0x475c42)[_0x7956('0x1a')](function(_0x17589f){logger[_0x7956('0x10')](_0x7956('0x34'),_0x17589f[_0x7956('0x15')]);emit(util[_0x7956('0x3b')](_0x7956('0x35'),_0x17589f[_0x7956('0x15')]),_0x7956('0x3c'),{'sessionId':_0x23472d});return _0x2f5d7d[_0x7956('0x16')](0xc8)[_0x7956('0x2f')]({'error':![],'message':_0x7956('0x3d')});})[_0x7956('0x1e')](handleError(_0x2f5d7d));};exports[_0x7956('0x3e')]=function(_0x2d2c5e,_0x5c0fce){logger[_0x7956('0x10')]('hold\x20fired:',_0x2d2c5e['body']);var _0x45209c=holdValidation[_0x7956('0x2e')](_0x2d2c5e[_0x7956('0x2d')]);if(_0x45209c[_0x7956('0x28')]>0x0){return _0x5c0fce[_0x7956('0x16')](0x190)[_0x7956('0x2f')](_0x45209c);}var _0x441404=_0x2d2c5e[_0x7956('0x2d')][_0x7956('0x30')];var _0x1c6722=_0x2d2c5e[_0x7956('0x2d')][_0x7956('0x27')];return getAgent(_0x441404)[_0x7956('0x1a')](function(_0x2ba635){logger[_0x7956('0x10')](_0x7956('0x34'),_0x2ba635[_0x7956('0x15')]);emit(util[_0x7956('0x3b')](_0x7956('0x35'),_0x2ba635[_0x7956('0x15')]),_0x7956('0x3f'),{'sessionId':_0x1c6722});return _0x5c0fce[_0x7956('0x16')](0xc8)['json']({'error':![],'message':_0x7956('0x40')});})[_0x7956('0x1e')](handleError(_0x5c0fce));};exports[_0x7956('0x41')]=function(_0x493092,_0x385fb3){logger['info'](_0x7956('0x42'),_0x493092[_0x7956('0x2d')]);var _0x48c757=unholdValidation[_0x7956('0x2e')](_0x493092[_0x7956('0x2d')]);if(_0x48c757['length']>0x0){return _0x385fb3[_0x7956('0x16')](0x190)[_0x7956('0x2f')](_0x48c757);}var _0x52aa90=_0x493092[_0x7956('0x2d')][_0x7956('0x30')];var _0xc070ce=_0x493092[_0x7956('0x2d')][_0x7956('0x27')];return getAgent(_0x52aa90)[_0x7956('0x1a')](function(_0x455d3c){logger['info'](_0x7956('0x34'),_0x455d3c[_0x7956('0x15')]);emit(util[_0x7956('0x3b')](_0x7956('0x35'),_0x455d3c['name']),_0x7956('0x43'),{'sessionId':_0xc070ce});return _0x385fb3[_0x7956('0x16')](0xc8)[_0x7956('0x2f')]({'error':![],'message':_0x7956('0x44')});})[_0x7956('0x1e')](handleError(_0x385fb3));};exports[_0x7956('0x45')]=function(_0x23e7ee,_0x277d78){logger[_0x7956('0x10')](_0x7956('0x46'),_0x277d78[_0x7956('0x2d')]);var _0x1d2af8=callsValidation[_0x7956('0x2e')](_0x23e7ee[_0x7956('0x2d')]);if(_0x1d2af8['length']>0x0){return _0x277d78[_0x7956('0x16')](0x190)[_0x7956('0x2f')](_0x1d2af8);}var _0x40661a=_0x23e7ee[_0x7956('0x2d')]['userId'];var _0x196013=respondWithRpcPromise(_0x7956('0x22'));var _0x2122d3=getAgent(_0x40661a);return Promise[_0x7956('0x23')]([_0x196013,_0x2122d3])[_0x7956('0x1a')](function(_0x373dfa){var _0x3b8f7f=_0x373dfa[0x0];var _0x578a12=_0x373dfa[0x1];var _0x551501=_[_0x7956('0x24')](_0x3b8f7f['rows'],function(_0x1ca924){return _0x1ca924[_0x7956('0x26')]==_0x578a12['id'];});return _0x277d78[_0x7956('0x16')](0xc8)[_0x7956('0x2f')]({'count':_0x551501[_0x7956('0x28')],'rows':_0x551501});})[_0x7956('0x1e')](handleError(_0x277d78));};exports[_0x7956('0x47')]=function(_0x32e7b0,_0xaeda0b){logger['info'](_0x7956('0x48'),_0x32e7b0[_0x7956('0x2d')]);var _0x45cc68=conferenceValidation['validate'](_0x32e7b0[_0x7956('0x2d')]);if(_0x45cc68[_0x7956('0x28')]>0x0){return _0xaeda0b['status'](0x190)[_0x7956('0x2f')](_0x45cc68);}var _0x512088=_0x32e7b0[_0x7956('0x2d')][_0x7956('0x30')];return getAgent(_0x512088)[_0x7956('0x1a')](function(_0x1c440d){logger['info'](_0x7956('0x34'),_0x1c440d[_0x7956('0x15')]);emit(util[_0x7956('0x3b')]('user:%s',_0x1c440d[_0x7956('0x15')]),_0x7956('0x49'));return _0xaeda0b[_0x7956('0x16')](0xc8)[_0x7956('0x2f')]({'error':![],'message':_0x7956('0x4a')});})[_0x7956('0x1e')](handleError(_0xaeda0b));};exports['transfer']=function(_0x4fa4dd,_0x1c67dc){logger['info'](_0x7956('0x4b'),_0x4fa4dd['body']);var _0x28a06a=transferValidation[_0x7956('0x2e')](_0x4fa4dd[_0x7956('0x2d')]);if(_0x28a06a['length']>0x0){return _0x1c67dc['status'](0x190)[_0x7956('0x2f')](_0x28a06a);}var _0x40cbad=_0x4fa4dd[_0x7956('0x2d')][_0x7956('0x30')];var _0x5b0225=_0x4fa4dd[_0x7956('0x2d')][_0x7956('0x27')];var _0x16beac=_0x4fa4dd[_0x7956('0x2d')][_0x7956('0x4c')];return getAgent(_0x40cbad)[_0x7956('0x1a')](function(_0xf35ffd){logger['info'](_0x7956('0x34'),_0xf35ffd[_0x7956('0x15')]);emit(util[_0x7956('0x3b')](_0x7956('0x35'),_0xf35ffd[_0x7956('0x15')]),_0x7956('0x4d'),{'sessionId':_0x5b0225,'transferNumber':_0x16beac});return _0x1c67dc['status'](0xc8)[_0x7956('0x2f')]({'error':![],'message':_0x7956('0x4e')});})[_0x7956('0x1e')](handleError(_0x1c67dc));}; \ No newline at end of file +var _0x41bb=['then','error','code','message','result','findOne','agent','VoiceChannels','all','rows','sessionId','sessionId\x20','\x20not\x20found!','originate\x20fired:','body','validate','length','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','originate\x20executed!','catch','hangup\x20fired:','json','userId','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','unhold\x20executed!','calls','calls\x20fired:','filter','UserId','conference','conference\x20executed!','transfer','transfer\x20fired:','transfer\x20executed!','path','lodash','../../config/environment','bluebird','jayson/promise','client','http','webbarapi','ioredis','redis','socket.io-emitter','number','userId\x20is\x20required','string','callNumber\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','name','status','send','NotFound','request'];(function(_0x4ab9d8,_0x211196){var _0x2b7b2e=function(_0x3fb0a8){while(--_0x3fb0a8){_0x4ab9d8['push'](_0x4ab9d8['shift']());}};_0x2b7b2e(++_0x211196);}(_0x41bb,0xc5));var _0xb41b=function(_0x44fbe2,_0x15667){_0x44fbe2=_0x44fbe2-0x0;var _0x3de438=_0x41bb[_0x44fbe2];return _0x3de438;};'use strict';var path=require(_0xb41b('0x0'));var fs=require('fs');var _=require(_0xb41b('0x1'));var db=require('../../mysqldb')['db'];var config=require(_0xb41b('0x2'));var util=require('util');var BPromise=require(_0xb41b('0x3'));var jayson=require(_0xb41b('0x4'));var amiClient=jayson[_0xb41b('0x5')][_0xb41b('0x6')]({'port':0x232a});var logger=require('../../config/logger')(_0xb41b('0x7'));var Redis=require(_0xb41b('0x8'));config[_0xb41b('0x9')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xb41b('0xa'))(new Redis(config[_0xb41b('0x9')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0xb41b('0xb'),'required':[!![],_0xb41b('0xc')]},'callNumber':{'type':_0xb41b('0xd'),'required':[!![],_0xb41b('0xe')]},'callerId':{'type':_0xb41b('0xd')},'callbackUrl':{'type':_0xb41b('0xd')}});var hangupValidation=new Schema({'userId':{'type':_0xb41b('0xb'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xb41b('0xd'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0xb41b('0xc')]},'sessionId':{'type':_0xb41b('0xd'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xb41b('0xb'),'required':[!![],_0xb41b('0xc')]},'sessionId':{'type':_0xb41b('0xd'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0xb41b('0xd'),'required':[!![],_0xb41b('0xf')]}});var holdValidation=new Schema({'userId':{'type':_0xb41b('0xb'),'required':[!![],_0xb41b('0xc')]},'sessionId':{'type':_0xb41b('0xd'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':_0xb41b('0xb'),'required':[!![],_0xb41b('0xc')]}});var conferenceValidation=new Schema({'userId':{'type':_0xb41b('0xb'),'required':[!![],_0xb41b('0xc')]}});function emit(_0x29ea51,_0x54591e,_0x2f3673){logger[_0xb41b('0x10')](_0x29ea51,_0x54591e,JSON[_0xb41b('0x11')](_0x2f3673));io['to'](_0x29ea51)[_0xb41b('0x12')](_0x54591e,_0x2f3673);}function handleError(_0x43f4ea){return function(_0x47154d){console[_0xb41b('0x13')]('handleError:',_0x47154d,_0x47154d instanceof RangeError);logger['error'](_0x47154d['stack']);if(_0x47154d instanceof RangeError){if(_0x47154d[_0xb41b('0x14')]){delete _0x47154d['name'];}_0x43f4ea[_0xb41b('0x15')](0x194)[_0xb41b('0x16')](_0x47154d);}else{if(_0x47154d[_0xb41b('0x14')]){delete _0x47154d['name'];}_0x43f4ea['status'](0x1f4)[_0xb41b('0x16')](_0x47154d);}};}function checkError(){return function(_0x3b6ffb){if(!_0x3b6ffb){throw new RangeError(_0xb41b('0x17'));}return _0x3b6ffb;};}function respondWithRpcPromise(_0x2373f4,_0x232ff1){return new BPromise(function(_0x42dccb,_0x4c73da){var _0x58f149=amiClient;return _0x58f149[_0xb41b('0x18')](_0x2373f4,_0x232ff1)[_0xb41b('0x19')](function(_0x871b35){if(_0x871b35['error']){if(_0x871b35[_0xb41b('0x1a')][_0xb41b('0x1b')]===0x1f4){return _0x4c73da(_0x871b35['error'][_0xb41b('0x1c')]);}return _0x42dccb(_0x871b35[_0xb41b('0x1a')]['message']);}else{_0x42dccb(_0x871b35[_0xb41b('0x1d')]);}})['catch'](function(_0x2d0f27){_0x4c73da(_0x2d0f27);});});}function getAgent(_0x4c6a91){return db['User'][_0xb41b('0x1e')]({'where':{'id':_0x4c6a91,'role':_0xb41b('0x1f')}})['then'](checkError());}function getAgentCheckSession(_0x4c2e41,_0x2a5286){return new BPromise(function(_0x46aecf,_0x6b98aa){var _0x36dda8=respondWithRpcPromise(_0xb41b('0x20'));var _0x181cbd=getAgent(_0x4c2e41);Promise[_0xb41b('0x21')]([_0x36dda8,_0x181cbd])['then'](function(_0x26ef96){var _0xb68029=_0x26ef96[0x0];var _0x5069aa=_0x26ef96[0x1];var _0xe64568=_['filter'](_0xb68029[_0xb41b('0x22')],function(_0x31d4cd){return _0x31d4cd['UserId']==_0x5069aa['id']&&_0x31d4cd[_0xb41b('0x23')]==_0x2a5286;});if(_0xe64568['length']==0x1){_0x46aecf(_0x5069aa);}else{_0x6b98aa(new RangeError(_0xb41b('0x24')+_0x2a5286+_0xb41b('0x25')));}});});}exports['originate']=function(_0x2c0a8d,_0x41b326){logger[_0xb41b('0x10')](_0xb41b('0x26'),_0x2c0a8d[_0xb41b('0x27')]);var _0x195d63=originateValidation[_0xb41b('0x28')](_0x2c0a8d[_0xb41b('0x27')]);if(_0x195d63[_0xb41b('0x29')]>0x0){return _0x41b326[_0xb41b('0x15')](0x190)['json'](_0x195d63);}var _0x976d56=_0x2c0a8d['body']['userId'];var _0x305803=_0x2c0a8d[_0xb41b('0x27')][_0xb41b('0x2a')];var _0x18e70e=_0x2c0a8d[_0xb41b('0x27')][_0xb41b('0x2b')];var _0x1de31b=_0x2c0a8d[_0xb41b('0x27')][_0xb41b('0x2c')];return getAgent(_0x976d56)[_0xb41b('0x19')](function(_0x3a06a0){logger['info'](_0xb41b('0x2d'),_0x3a06a0[_0xb41b('0x14')]);emit(util[_0xb41b('0x2e')](_0xb41b('0x2f'),_0x3a06a0[_0xb41b('0x14')]),_0xb41b('0x30'),{'callNumber':_0x305803,'callerId':_0x18e70e,'callbackUrl':_0x1de31b});return _0x41b326['status'](0xc8)['json']({'error':![],'message':_0xb41b('0x31')});})[_0xb41b('0x32')](handleError(_0x41b326));};exports['hangup']=function(_0x19c835,_0x47363e){logger[_0xb41b('0x10')](_0xb41b('0x33'),_0x19c835[_0xb41b('0x27')]);var _0x47c8bf=hangupValidation[_0xb41b('0x28')](_0x19c835['body']);if(_0x47c8bf[_0xb41b('0x29')]>0x0){return _0x47363e[_0xb41b('0x15')](0x190)[_0xb41b('0x34')](_0x47c8bf);}var _0x40789b=_0x19c835[_0xb41b('0x27')][_0xb41b('0x35')];var _0x428feb=_0x19c835[_0xb41b('0x27')][_0xb41b('0x23')];return getAgent(_0x40789b)['then'](function(_0x49e8c4){logger['info'](_0xb41b('0x2d'),_0x49e8c4['name']);emit(util['format'](_0xb41b('0x2f'),_0x49e8c4['name']),_0xb41b('0x36'),{'sessionId':_0x428feb});return _0x47363e[_0xb41b('0x15')](0xc8)[_0xb41b('0x34')]({'error':![],'message':_0xb41b('0x37')});})[_0xb41b('0x32')](handleError(_0x47363e));};exports[_0xb41b('0x38')]=function(_0xddb59c,_0x57e043){logger[_0xb41b('0x10')](_0xb41b('0x39'),_0xddb59c[_0xb41b('0x27')]);var _0x174d6c=answerValidation['validate'](_0xddb59c[_0xb41b('0x27')]);if(_0x174d6c['length']>0x0){return _0x57e043[_0xb41b('0x15')](0x190)[_0xb41b('0x34')](_0x174d6c);}var _0x46dbbf=_0xddb59c['body']['userId'];var _0xe71120=_0xddb59c[_0xb41b('0x27')][_0xb41b('0x23')];return getAgent(_0x46dbbf)[_0xb41b('0x19')](function(_0x412ec0){logger[_0xb41b('0x10')](_0xb41b('0x2d'),_0x412ec0['name']);emit(util['format'](_0xb41b('0x2f'),_0x412ec0['name']),_0xb41b('0x3a'),{'sessionId':_0xe71120});return _0x57e043['status'](0xc8)[_0xb41b('0x34')]({'error':![],'message':'answer\x20executed!'});})[_0xb41b('0x32')](handleError(_0x57e043));};exports['hold']=function(_0x606eff,_0x104825){logger[_0xb41b('0x10')](_0xb41b('0x3b'),_0x606eff['body']);var _0x2f8442=holdValidation[_0xb41b('0x28')](_0x606eff['body']);if(_0x2f8442[_0xb41b('0x29')]>0x0){return _0x104825['status'](0x190)['json'](_0x2f8442);}var _0x5733d0=_0x606eff['body'][_0xb41b('0x35')];var _0x23ea63=_0x606eff[_0xb41b('0x27')][_0xb41b('0x23')];return getAgent(_0x5733d0)[_0xb41b('0x19')](function(_0x349a6c){logger[_0xb41b('0x10')](_0xb41b('0x2d'),_0x349a6c[_0xb41b('0x14')]);emit(util[_0xb41b('0x2e')](_0xb41b('0x2f'),_0x349a6c[_0xb41b('0x14')]),_0xb41b('0x3c'),{'sessionId':_0x23ea63});return _0x104825[_0xb41b('0x15')](0xc8)[_0xb41b('0x34')]({'error':![],'message':_0xb41b('0x3d')});})['catch'](handleError(_0x104825));};exports[_0xb41b('0x3e')]=function(_0x5e041d,_0x4a7aa3){logger[_0xb41b('0x10')](_0xb41b('0x3f'),_0x5e041d[_0xb41b('0x27')]);var _0x1b576f=unholdValidation[_0xb41b('0x28')](_0x5e041d[_0xb41b('0x27')]);if(_0x1b576f[_0xb41b('0x29')]>0x0){return _0x4a7aa3[_0xb41b('0x15')](0x190)[_0xb41b('0x34')](_0x1b576f);}var _0x1977b1=_0x5e041d[_0xb41b('0x27')][_0xb41b('0x35')];var _0x236c05=_0x5e041d[_0xb41b('0x27')][_0xb41b('0x23')];return getAgent(_0x1977b1)[_0xb41b('0x19')](function(_0x26ce99){logger[_0xb41b('0x10')](_0xb41b('0x2d'),_0x26ce99[_0xb41b('0x14')]);emit(util[_0xb41b('0x2e')]('user:%s',_0x26ce99[_0xb41b('0x14')]),'webbar:unhold',{'sessionId':_0x236c05});return _0x4a7aa3[_0xb41b('0x15')](0xc8)[_0xb41b('0x34')]({'error':![],'message':_0xb41b('0x40')});})[_0xb41b('0x32')](handleError(_0x4a7aa3));};exports[_0xb41b('0x41')]=function(_0x305f0e,_0x2bae07){logger['info'](_0xb41b('0x42'),_0x2bae07[_0xb41b('0x27')]);var _0x140c71=callsValidation['validate'](_0x305f0e[_0xb41b('0x27')]);if(_0x140c71[_0xb41b('0x29')]>0x0){return _0x2bae07[_0xb41b('0x15')](0x190)[_0xb41b('0x34')](_0x140c71);}var _0x454671=_0x305f0e[_0xb41b('0x27')][_0xb41b('0x35')];var _0x540763=respondWithRpcPromise('VoiceChannels');var _0xaeb50e=getAgent(_0x454671);return Promise[_0xb41b('0x21')]([_0x540763,_0xaeb50e])['then'](function(_0x43ad9c){var _0x285099=_0x43ad9c[0x0];var _0x5a322a=_0x43ad9c[0x1];var _0x2dced1=_[_0xb41b('0x43')](_0x285099[_0xb41b('0x22')],function(_0xb1ccab){return _0xb1ccab[_0xb41b('0x44')]==_0x5a322a['id'];});return _0x2bae07[_0xb41b('0x15')](0xc8)[_0xb41b('0x34')]({'count':_0x2dced1[_0xb41b('0x29')],'rows':_0x2dced1});})[_0xb41b('0x32')](handleError(_0x2bae07));};exports[_0xb41b('0x45')]=function(_0x5c5e0d,_0x154fa5){logger[_0xb41b('0x10')]('conference\x20fired:',_0x5c5e0d['body']);var _0x2ad478=conferenceValidation[_0xb41b('0x28')](_0x5c5e0d[_0xb41b('0x27')]);if(_0x2ad478['length']>0x0){return _0x154fa5[_0xb41b('0x15')](0x190)[_0xb41b('0x34')](_0x2ad478);}var _0x1451e7=_0x5c5e0d[_0xb41b('0x27')][_0xb41b('0x35')];return getAgent(_0x1451e7)[_0xb41b('0x19')](function(_0x9bae17){logger[_0xb41b('0x10')](_0xb41b('0x2d'),_0x9bae17[_0xb41b('0x14')]);emit(util['format'](_0xb41b('0x2f'),_0x9bae17[_0xb41b('0x14')]),'webbar:conference');return _0x154fa5[_0xb41b('0x15')](0xc8)[_0xb41b('0x34')]({'error':![],'message':_0xb41b('0x46')});})['catch'](handleError(_0x154fa5));};exports[_0xb41b('0x47')]=function(_0x43edc7,_0x10d953){logger[_0xb41b('0x10')](_0xb41b('0x48'),_0x43edc7[_0xb41b('0x27')]);var _0x3c663a=transferValidation[_0xb41b('0x28')](_0x43edc7[_0xb41b('0x27')]);if(_0x3c663a[_0xb41b('0x29')]>0x0){return _0x10d953['status'](0x190)['json'](_0x3c663a);}var _0x4be316=_0x43edc7['body'][_0xb41b('0x35')];var _0x4ad6b5=_0x43edc7[_0xb41b('0x27')][_0xb41b('0x23')];var _0x46eed9=_0x43edc7[_0xb41b('0x27')]['transferNumber'];return getAgent(_0x4be316)[_0xb41b('0x19')](function(_0x5e34a2){logger[_0xb41b('0x10')]('entityFound:',_0x5e34a2[_0xb41b('0x14')]);emit(util['format'](_0xb41b('0x2f'),_0x5e34a2[_0xb41b('0x14')]),'webbar:transfer',{'sessionId':_0x4ad6b5,'transferNumber':_0x46eed9});return _0x10d953[_0xb41b('0x15')](0xc8)[_0xb41b('0x34')]({'error':![],'message':_0xb41b('0x49')});})[_0xb41b('0x32')](handleError(_0x10d953));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 583f3af..04bd6ad 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 _0xc1c6=['addDisposition','/:id/canned_answers','addAnswer','addAgents','/:id/applications','addApplications','notify','/:id/send','send','put','/:id','update','delete','destroy','removeDispositions','removeAnswers','/:id/users','removeAgents','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','show','/:id/dispositions','getDispositions','getAnswers','getAgents','post','create'];(function(_0x3a9205,_0xa70aca){var _0x4c55b0=function(_0x158388){while(--_0x158388){_0x3a9205['push'](_0x3a9205['shift']());}};_0x4c55b0(++_0xa70aca);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x1e9baf,_0x584424){_0x1e9baf=_0x1e9baf-0x0;var _0x394e11=_0xc1c6[_0x1e9baf];return _0x394e11;};'use strict';var multer=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var path=require(_0x6c1c('0x2'));var timeout=require('connect-timeout');var express=require(_0x6c1c('0x3'));var router=express['Router']();var fs_extra=require(_0x6c1c('0x4'));var auth=require(_0x6c1c('0x5'));var interaction=require(_0x6c1c('0x6'));var config=require('../../config/environment');var controller=require('./whatsappAccount.controller');router[_0x6c1c('0x7')]('/',auth['isAuthenticated'](),controller[_0x6c1c('0x8')]);router['get'](_0x6c1c('0x9'),auth[_0x6c1c('0xa')](),controller[_0x6c1c('0xb')]);router[_0x6c1c('0x7')]('/:id',auth[_0x6c1c('0xa')](),controller[_0x6c1c('0xc')]);router['get'](_0x6c1c('0xd'),auth[_0x6c1c('0xa')](),controller[_0x6c1c('0xe')]);router[_0x6c1c('0x7')]('/:id/canned_answers',auth[_0x6c1c('0xa')](),controller[_0x6c1c('0xf')]);router[_0x6c1c('0x7')]('/:id/users',auth[_0x6c1c('0xa')](),controller[_0x6c1c('0x10')]);router[_0x6c1c('0x7')]('/:id/applications',auth[_0x6c1c('0xa')](),controller['getApplications']);router[_0x6c1c('0x11')]('/',auth[_0x6c1c('0xa')](),controller[_0x6c1c('0x12')]);router[_0x6c1c('0x11')](_0x6c1c('0xd'),auth[_0x6c1c('0xa')](),controller[_0x6c1c('0x13')]);router[_0x6c1c('0x11')](_0x6c1c('0x14'),auth['isAuthenticated'](),controller[_0x6c1c('0x15')]);router[_0x6c1c('0x11')]('/:id/users',auth[_0x6c1c('0xa')](),controller[_0x6c1c('0x16')]);router['post'](_0x6c1c('0x17'),auth['isAuthenticated'](),controller[_0x6c1c('0x18')]);router[_0x6c1c('0x11')]('/:id/notify',controller[_0x6c1c('0x19')]);router['post'](_0x6c1c('0x1a'),auth[_0x6c1c('0xa')](),controller[_0x6c1c('0x1b')]);router[_0x6c1c('0x1c')](_0x6c1c('0x1d'),auth[_0x6c1c('0xa')](),controller[_0x6c1c('0x1e')]);router[_0x6c1c('0x1f')](_0x6c1c('0x1d'),auth[_0x6c1c('0xa')](),controller[_0x6c1c('0x20')]);router[_0x6c1c('0x1f')](_0x6c1c('0xd'),auth[_0x6c1c('0xa')](),controller[_0x6c1c('0x21')]);router[_0x6c1c('0x1f')](_0x6c1c('0x14'),auth[_0x6c1c('0xa')](),controller[_0x6c1c('0x22')]);router[_0x6c1c('0x1f')](_0x6c1c('0x23'),auth[_0x6c1c('0xa')](),controller[_0x6c1c('0x24')]);module[_0x6c1c('0x25')]=router; \ No newline at end of file +var _0xe2fe=['removeAgents','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','/:id/dispositions','getAgents','/:id/applications','getApplications','post','addDisposition','/:id/canned_answers','addAnswer','/:id/users','addAgents','addApplications','/:id/notify','notify','send','put','destroy','delete','removeDispositions','removeAnswers'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xee2f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xee2f('0x1'));var express=require('express');var router=express[_0xee2f('0x2')]();var fs_extra=require(_0xee2f('0x3'));var auth=require(_0xee2f('0x4'));var interaction=require(_0xee2f('0x5'));var config=require(_0xee2f('0x6'));var controller=require('./whatsappAccount.controller');router[_0xee2f('0x7')]('/',auth[_0xee2f('0x8')](),controller['index']);router[_0xee2f('0x7')](_0xee2f('0x9'),auth['isAuthenticated'](),controller[_0xee2f('0xa')]);router['get'](_0xee2f('0xb'),auth[_0xee2f('0x8')](),controller['show']);router[_0xee2f('0x7')](_0xee2f('0xc'),auth['isAuthenticated'](),controller['getDispositions']);router['get']('/:id/canned_answers',auth[_0xee2f('0x8')](),controller['getAnswers']);router['get']('/:id/users',auth[_0xee2f('0x8')](),controller[_0xee2f('0xd')]);router[_0xee2f('0x7')](_0xee2f('0xe'),auth[_0xee2f('0x8')](),controller[_0xee2f('0xf')]);router['post']('/',auth[_0xee2f('0x8')](),controller['create']);router[_0xee2f('0x10')](_0xee2f('0xc'),auth['isAuthenticated'](),controller[_0xee2f('0x11')]);router[_0xee2f('0x10')](_0xee2f('0x12'),auth[_0xee2f('0x8')](),controller[_0xee2f('0x13')]);router['post'](_0xee2f('0x14'),auth['isAuthenticated'](),controller[_0xee2f('0x15')]);router[_0xee2f('0x10')]('/:id/applications',auth['isAuthenticated'](),controller[_0xee2f('0x16')]);router['post'](_0xee2f('0x17'),controller[_0xee2f('0x18')]);router[_0xee2f('0x10')]('/:id/send',auth[_0xee2f('0x8')](),controller[_0xee2f('0x19')]);router[_0xee2f('0x1a')](_0xee2f('0xb'),auth[_0xee2f('0x8')](),controller['update']);router['delete'](_0xee2f('0xb'),auth[_0xee2f('0x8')](),controller[_0xee2f('0x1b')]);router[_0xee2f('0x1c')](_0xee2f('0xc'),auth[_0xee2f('0x8')](),controller[_0xee2f('0x1d')]);router['delete'](_0xee2f('0x12'),auth[_0xee2f('0x8')](),controller[_0xee2f('0x1e')]);router[_0xee2f('0x1c')](_0xee2f('0x14'),auth[_0xee2f('0x8')](),controller[_0xee2f('0x1f')]);module[_0xee2f('0x20')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 0e45f83..b26110d 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 _0x5743=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDisposition','sequelize','exports','STRING','name','twilio','sinch','BOOLEAN','INTEGER'];(function(_0x331a31,_0x116709){var _0x521de0=function(_0x104a03){while(--_0x104a03){_0x331a31['push'](_0x331a31['shift']());}};_0x521de0(++_0x116709);}(_0x5743,0x142));var _0x3574=function(_0x59eac0,_0x5d1243){_0x59eac0=_0x59eac0-0x0;var _0x1941af=_0x5743[_0x59eac0];return _0x1941af;};'use strict';var Sequelize=require(_0x3574('0x0'));var rs=require('randomstring');module[_0x3574('0x1')]={'name':{'type':Sequelize[_0x3574('0x2')],'unique':_0x3574('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x3574('0x2')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x3574('0x2')]},'type':{'type':Sequelize['ENUM'](_0x3574('0x4'),_0x3574('0x5'))},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize[_0x3574('0x2')]},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x3574('0x6')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x3574('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x3574('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3574('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3574('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3574('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3574('0x7')],'comment':_0x3574('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x3574('0x6')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x140f69){if(!_0x140f69){this['setDataValue']('mandatoryDispositionPauseId',null);}this[_0x3574('0x9')](_0x3574('0xa'),_0x140f69);}},'description':{'type':Sequelize[_0x3574('0x2')]}}; \ No newline at end of file +var _0x420a=['sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','setDataValue','mandatoryDisposition','sequelize','randomstring','name','STRING','generate','twilio'];(function(_0x36a3af,_0x13b630){var _0xa65201=function(_0x40e9cf){while(--_0x40e9cf){_0x36a3af['push'](_0x36a3af['shift']());}};_0xa65201(++_0x13b630);}(_0x420a,0x1c1));var _0xa420=function(_0x28c292,_0x19cd5b){_0x28c292=_0x28c292-0x0;var _0x4eca35=_0x420a[_0x28c292];return _0x4eca35;};'use strict';var Sequelize=require(_0xa420('0x0'));var rs=require(_0xa420('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xa420('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0xa420('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0xa420('0x3')],'defaultValue':function(){return rs[_0xa420('0x4')]();}},'phone':{'type':Sequelize[_0xa420('0x3')]},'type':{'type':Sequelize['ENUM'](_0xa420('0x5'),_0xa420('0x6'))},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize[_0xa420('0x3')]},'authToken':{'type':Sequelize[_0xa420('0x3')]},'notificationTemplate':{'type':Sequelize[_0xa420('0x7')],'defaultValue':function(){return _0xa420('0x8');}},'notificationSound':{'type':Sequelize[_0xa420('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xa420('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xa420('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa420('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa420('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa420('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa420('0xa')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xa420('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2a70c3){if(!_0x2a70c3){this[_0xa420('0xb')]('mandatoryDispositionPauseId',null);}this[_0xa420('0xb')](_0xa420('0xc'),_0x2a70c3);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index e85ecb9..50fedbd 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 _0x5706=['body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','update','WhatsappAccountId','Disposition','getDispositions','removeDispositions','ids','CannedAnswer','getAnswers','findOne','options','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','sequelize','transaction','READ_COMMITTED','WhatsappApplication','bulkCreate','priority','finally','getApplications','notify','whatsapp','Applications','account','sinch','statuses','state','WhatsappMessage','timestamp','applications','orderBy','asc','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','From','Body','messageId','MessageSid','notifications','from','message_id','isNil','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','contact','WhatsappInteraction','interaction','created','autoclose','close','ContactId','AttachmentId','UserId','unshift','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','Content-Type','\x0a','List','out','Messages','dataValues','push','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./whatsappAccount.socket','register','jayson/promise','client','http','request','info','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','then','destroy','WhatsappAccounts','stack','name','send','mandatoryDispositionPause','map','WhatsappAccount','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','show','params','Pause','rawAttributes','create'];(function(_0x53f681,_0x5caa7b){var _0x5dc919=function(_0x4bc4ba){while(--_0x4bc4ba){_0x53f681['push'](_0x53f681['shift']());}};_0x5dc919(++_0x5caa7b);}(_0x5706,0x1e5));var _0x6570=function(_0x4dcde5,_0x434736){_0x4dcde5=_0x4dcde5-0x0;var _0x4ca8a8=_0x5706[_0x4dcde5];return _0x4ca8a8;};'use strict';var emlformat=require(_0x6570('0x0'));var rimraf=require(_0x6570('0x1'));var zipdir=require(_0x6570('0x2'));var jsonpatch=require(_0x6570('0x3'));var rp=require(_0x6570('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6570('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6570('0x6'));var fs=require('fs');var fs_extra=require(_0x6570('0x7'));var _=require('lodash');var squel=require(_0x6570('0x8'));var crypto=require('crypto');var jsforce=require(_0x6570('0x9'));var deskjs=require(_0x6570('0xa'));var toCsv=require(_0x6570('0xb'));var querystring=require(_0x6570('0xc'));var Papa=require(_0x6570('0xd'));var Redis=require(_0x6570('0xe'));var authService=require(_0x6570('0xf'));var qs=require(_0x6570('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6570('0x11'));var logger=require('../../config/logger')(_0x6570('0x12'));var utils=require(_0x6570('0x13'));var config=require(_0x6570('0x14'));var licenseUtil=require(_0x6570('0x15'));var db=require(_0x6570('0x16'))['db'];config[_0x6570('0x17')]=_[_0x6570('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6570('0x17')]));require(_0x6570('0x19'))[_0x6570('0x1a')](socket);var jayson=require(_0x6570('0x1b'));var client=jayson[_0x6570('0x1c')][_0x6570('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x4a968e,_0x5a22d6,_0x30973c,_0x41df04){return new BPromise(function(_0x14104d,_0x53bbf0){var _0x331920=_0x41df04||client;return _0x331920[_0x6570('0x1e')](_0x4a968e,_0x30973c)['then'](function(_0x4aed20){logger[_0x6570('0x1f')]('WhatsappAccount,\x20%s,\x20%s',_0x5a22d6,'request\x20sent');logger[_0x6570('0x20')](_0x6570('0x21'),_0x5a22d6,_0x6570('0x22'),JSON[_0x6570('0x23')](_0x4aed20));if(_0x4aed20[_0x6570('0x24')]){if(_0x4aed20[_0x6570('0x24')][_0x6570('0x25')]===0x1f4){logger[_0x6570('0x24')](_0x6570('0x26'),_0x5a22d6,_0x4aed20[_0x6570('0x24')][_0x6570('0x27')]);return _0x53bbf0(_0x4aed20['error'][_0x6570('0x27')]);}logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x5a22d6,_0x4aed20[_0x6570('0x24')][_0x6570('0x27')]);return _0x14104d(_0x4aed20[_0x6570('0x24')][_0x6570('0x27')]);}else{logger[_0x6570('0x1f')]('WhatsappAccount,\x20%s,\x20%s',_0x5a22d6,'request\x20sent');_0x14104d(_0x4aed20[_0x6570('0x28')][_0x6570('0x27')]);}})[_0x6570('0x29')](function(_0x47c187){logger[_0x6570('0x24')]('WhatsappAccount,\x20%s,\x20%s',_0x5a22d6,_0x47c187);_0x53bbf0(_0x47c187);});});}function respondWithStatusCode(_0x5c7ebd,_0x5408b4){_0x5408b4=_0x5408b4||0xcc;return function(_0x3523bf){if(_0x3523bf){return _0x5c7ebd[_0x6570('0x2a')](_0x5408b4);}return _0x5c7ebd[_0x6570('0x2b')](_0x5408b4)[_0x6570('0x2c')]();};}function respondWithResult(_0x22cab2,_0x50f153){_0x50f153=_0x50f153||0xc8;return function(_0x176d4d){if(_0x176d4d){return _0x22cab2[_0x6570('0x2b')](_0x50f153)[_0x6570('0x2d')](_0x176d4d);}};}function respondWithFilteredResult(_0x177ac9,_0x3cdb51){return function(_0x593668){if(_0x593668){var _0xddf886=typeof _0x3cdb51[_0x6570('0x2e')]==='undefined'&&typeof _0x3cdb51[_0x6570('0x2f')]===_0x6570('0x30');var _0x3af984=_0x593668[_0x6570('0x31')];var _0x533b8e=_0xddf886?0x0:_0x3cdb51[_0x6570('0x2e')];var _0x4d2453=_0xddf886?_0x593668[_0x6570('0x31')]:_0x3cdb51[_0x6570('0x2e')]+_0x3cdb51['limit'];var _0x1bfa99;if(_0x4d2453>=_0x3af984){_0x4d2453=_0x3af984;_0x1bfa99=0xc8;}else{_0x1bfa99=0xce;}_0x177ac9[_0x6570('0x2b')](_0x1bfa99);return _0x177ac9[_0x6570('0x32')](_0x6570('0x33'),_0x533b8e+'-'+_0x4d2453+'/'+_0x3af984)[_0x6570('0x2d')](_0x593668);}return null;};}function patchUpdates(_0x5210bb){return function(_0x2e386c){try{jsonpatch['apply'](_0x2e386c,_0x5210bb,!![]);}catch(_0x5c6a53){return BPromise[_0x6570('0x34')](_0x5c6a53);}return _0x2e386c[_0x6570('0x35')]();};}function saveUpdates(_0x56868f,_0x1b748a){return function(_0x142fd0){if(_0x142fd0){return _0x142fd0['update'](_0x56868f)[_0x6570('0x36')](function(_0x2da4cf){return _0x2da4cf;});}return null;};}function removeEntity(_0x3700de,_0xc1b5e4){return function(_0x185753){if(_0x185753){return _0x185753[_0x6570('0x37')]()['then'](function(){var _0xb4fab3=_0x185753['get']({'plain':!![]});var _0x47ec77=_0x6570('0x38');return db['UserProfileResource'][_0x6570('0x37')]({'where':{'type':_0x47ec77,'resourceId':_0xb4fab3['id']}})[_0x6570('0x36')](function(){return _0x185753;});})['then'](function(){_0x3700de[_0x6570('0x2b')](0xcc)[_0x6570('0x2c')]();});}};}function handleEntityNotFound(_0x4c1895,_0x85a0ae){return function(_0x3963e6){if(!_0x3963e6){_0x4c1895[_0x6570('0x2a')](0x194);}return _0x3963e6;};}function handleError(_0x30ea5e,_0x4a3eec){_0x4a3eec=_0x4a3eec||0x1f4;return function(_0x408691){logger[_0x6570('0x24')](_0x408691[_0x6570('0x39')]);if(_0x408691['name']){delete _0x408691[_0x6570('0x3a')];}_0x30ea5e[_0x6570('0x2b')](_0x4a3eec)[_0x6570('0x3b')](_0x408691);};}exports['index']=function(_0xafd8be,_0x313335){var _0x57d4e8={'include':[{'model':db['Pause'],'as':_0x6570('0x3c')}]},_0x2e386e={},_0x616fe8={'count':0x0,'rows':[]};var _0x22d885=_[_0x6570('0x3d')](db[_0x6570('0x3e')]['rawAttributes'],function(_0x5eacda){return{'name':_0x5eacda[_0x6570('0x3f')],'type':_0x5eacda[_0x6570('0x40')][_0x6570('0x41')]};});_0x2e386e['model']=_[_0x6570('0x3d')](_0x22d885,_0x6570('0x3a'));_0x2e386e[_0x6570('0x42')]=_[_0x6570('0x43')](_0xafd8be[_0x6570('0x42')]);_0x2e386e[_0x6570('0x44')]=_['intersection'](_0x2e386e[_0x6570('0x45')],_0x2e386e['query']);_0x57d4e8[_0x6570('0x46')]=_[_0x6570('0x47')](_0x2e386e[_0x6570('0x45')],qs[_0x6570('0x48')](_0xafd8be[_0x6570('0x42')][_0x6570('0x48')]));_0x57d4e8[_0x6570('0x46')]=_0x57d4e8[_0x6570('0x46')][_0x6570('0x49')]?_0x57d4e8[_0x6570('0x46')]:_0x2e386e['model'];if(!_0xafd8be[_0x6570('0x42')][_0x6570('0x4a')](_0x6570('0x4b'))){_0x57d4e8['limit']=qs[_0x6570('0x2f')](_0xafd8be[_0x6570('0x42')][_0x6570('0x2f')]);_0x57d4e8[_0x6570('0x2e')]=qs[_0x6570('0x2e')](_0xafd8be[_0x6570('0x42')]['offset']);}_0x57d4e8[_0x6570('0x4c')]=qs[_0x6570('0x4d')](_0xafd8be[_0x6570('0x42')][_0x6570('0x4d')]);_0x57d4e8[_0x6570('0x4e')]=qs['filters'](_[_0x6570('0x4f')](_0xafd8be[_0x6570('0x42')],_0x2e386e[_0x6570('0x44')]),_0x22d885);if(_0xafd8be[_0x6570('0x42')][_0x6570('0x50')]){_0x57d4e8[_0x6570('0x4e')]=_[_0x6570('0x51')](_0x57d4e8[_0x6570('0x4e')],{'$or':_[_0x6570('0x3d')](_0x22d885,function(_0x368bb6){if(_0x368bb6['type']!=='VIRTUAL'){var _0x39c991={};_0x39c991[_0x368bb6[_0x6570('0x3a')]]={'$like':'%'+_0xafd8be[_0x6570('0x42')]['filter']+'%'};return _0x39c991;}})});}_0x57d4e8=_[_0x6570('0x51')]({},_0x57d4e8,_0xafd8be['options']);var _0x3e5ba0={'where':_0x57d4e8['where']};return db['WhatsappAccount'][_0x6570('0x31')](_0x3e5ba0)[_0x6570('0x36')](function(_0x33a51d){_0x616fe8[_0x6570('0x31')]=_0x33a51d;if(_0xafd8be[_0x6570('0x42')][_0x6570('0x52')]){_0x57d4e8[_0x6570('0x53')]=[{'all':!![]}];}return db[_0x6570('0x3e')][_0x6570('0x54')](_0x57d4e8);})['then'](function(_0x3a9d91){_0x616fe8[_0x6570('0x55')]=_0x3a9d91;return _0x616fe8;})['then'](respondWithFilteredResult(_0x313335,_0x57d4e8))['catch'](handleError(_0x313335,null));};exports[_0x6570('0x56')]=function(_0x230fb3,_0x2b9a32){var _0x16a7a9={'raw':![],'where':{'id':_0x230fb3[_0x6570('0x57')]['id']},'include':[{'model':db[_0x6570('0x58')],'as':_0x6570('0x3c')}]},_0x130dd8={};_0x130dd8[_0x6570('0x45')]=_[_0x6570('0x43')](db[_0x6570('0x3e')][_0x6570('0x59')]);_0x130dd8[_0x6570('0x42')]=_[_0x6570('0x43')](_0x230fb3['query']);_0x130dd8['filters']=_['intersection'](_0x130dd8['model'],_0x130dd8[_0x6570('0x42')]);_0x16a7a9[_0x6570('0x46')]=_['intersection'](_0x130dd8[_0x6570('0x45')],qs[_0x6570('0x48')](_0x230fb3[_0x6570('0x42')][_0x6570('0x48')]));_0x16a7a9['attributes']=_0x16a7a9['attributes']['length']?_0x16a7a9['attributes']:_0x130dd8[_0x6570('0x45')];if(_0x230fb3['query'][_0x6570('0x52')]){_0x16a7a9[_0x6570('0x53')]=[{'all':!![]}];}_0x16a7a9=_[_0x6570('0x51')]({},_0x16a7a9,_0x230fb3['options']);return db[_0x6570('0x3e')]['find'](_0x16a7a9)[_0x6570('0x36')](handleEntityNotFound(_0x2b9a32,null))['then'](respondWithResult(_0x2b9a32,null))[_0x6570('0x29')](handleError(_0x2b9a32,null));};exports[_0x6570('0x5a')]=function(_0x2c7959,_0x1ab5ed){return db[_0x6570('0x3e')][_0x6570('0x5a')](_0x2c7959[_0x6570('0x5b')],{})['then'](function(_0x3e32c2){var _0x36abb9=_0x2c7959[_0x6570('0x5c')][_0x6570('0x5d')]({'plain':!![]});if(!_0x36abb9)throw new Error(_0x6570('0x5e'));if(_0x36abb9[_0x6570('0x5f')]===_0x6570('0x5c')){var _0x12b768=_0x3e32c2[_0x6570('0x5d')]({'plain':!![]});var _0x74862d=_0x6570('0x38');return db[_0x6570('0x60')][_0x6570('0x61')]({'where':{'name':_0x74862d,'userProfileId':_0x36abb9[_0x6570('0x62')]},'raw':!![]})['then'](function(_0x485e99){if(_0x485e99&&_0x485e99[_0x6570('0x63')]===0x0){return db[_0x6570('0x64')][_0x6570('0x5a')]({'name':_0x12b768[_0x6570('0x3a')],'resourceId':_0x12b768['id'],'type':_0x485e99[_0x6570('0x3a')],'sectionId':_0x485e99['id']},{})[_0x6570('0x36')](function(){return _0x3e32c2;});}else{return _0x3e32c2;}})[_0x6570('0x29')](function(_0x3b746d){logger[_0x6570('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3b746d);throw _0x3b746d;});}return _0x3e32c2;})[_0x6570('0x36')](respondWithResult(_0x1ab5ed,0xc9))[_0x6570('0x29')](handleError(_0x1ab5ed,null));};exports[_0x6570('0x65')]=function(_0x379a81,_0x567850){if(_0x379a81[_0x6570('0x5b')]['id']){delete _0x379a81[_0x6570('0x5b')]['id'];}return db[_0x6570('0x3e')][_0x6570('0x61')]({'where':{'id':_0x379a81[_0x6570('0x57')]['id']},'include':[{'model':db['Pause'],'as':_0x6570('0x3c')}]})[_0x6570('0x36')](handleEntityNotFound(_0x567850,null))[_0x6570('0x36')](saveUpdates(_0x379a81[_0x6570('0x5b')],null))[_0x6570('0x36')](respondWithResult(_0x567850,null))[_0x6570('0x29')](handleError(_0x567850,null));};exports[_0x6570('0x37')]=function(_0x42d6b,_0x32bb6b){return db[_0x6570('0x3e')][_0x6570('0x61')]({'where':{'id':_0x42d6b[_0x6570('0x57')]['id']}})['then'](handleEntityNotFound(_0x32bb6b,null))[_0x6570('0x36')](removeEntity(_0x32bb6b,null))[_0x6570('0x29')](handleError(_0x32bb6b,null));};exports['describe']=function(_0x35af79,_0xa26728){return db[_0x6570('0x3e')]['describe']()['then'](respondWithResult(_0xa26728,null))['catch'](handleError(_0xa26728,null));};exports['addDisposition']=function(_0x5d9336,_0x4dbd00,_0x2d9a64){if(_0x5d9336[_0x6570('0x5b')]['id']){delete _0x5d9336[_0x6570('0x5b')]['id'];}return db[_0x6570('0x3e')]['find']({'where':{'id':_0x5d9336['params']['id']}})[_0x6570('0x36')](handleEntityNotFound(_0x4dbd00,null))['then'](function(_0x31e639){if(_0x31e639){_0x5d9336['body'][_0x6570('0x66')]=_0x31e639['id'];return db[_0x6570('0x67')][_0x6570('0x5a')](_0x5d9336[_0x6570('0x5b')]);}})['then'](respondWithResult(_0x4dbd00,null))[_0x6570('0x29')](handleError(_0x4dbd00,null));};exports[_0x6570('0x68')]=function(_0x53ecb1,_0x59c621,_0x4d5724){var _0x1a2e2b={'raw':![],'where':{}};var _0x420ef9={};var _0xb77557={'count':0x0,'rows':[]};return db[_0x6570('0x3e')]['findOne']({'where':{'id':_0x53ecb1[_0x6570('0x57')]['id']}})[_0x6570('0x36')](handleEntityNotFound(_0x59c621,null))[_0x6570('0x36')](function(_0x33680a){if(_0x33680a){_0x420ef9[_0x6570('0x45')]=_['keys'](db[_0x6570('0x67')][_0x6570('0x59')]);_0x420ef9[_0x6570('0x42')]=_[_0x6570('0x43')](_0x53ecb1[_0x6570('0x42')]);_0x420ef9[_0x6570('0x44')]=_[_0x6570('0x47')](_0x420ef9[_0x6570('0x45')],_0x420ef9['query']);_0x1a2e2b[_0x6570('0x46')]=_[_0x6570('0x47')](_0x420ef9[_0x6570('0x45')],qs[_0x6570('0x48')](_0x53ecb1[_0x6570('0x42')][_0x6570('0x48')]));_0x1a2e2b[_0x6570('0x46')]=_0x1a2e2b[_0x6570('0x46')][_0x6570('0x49')]?_0x1a2e2b['attributes']:_0x420ef9['model'];if(!_0x53ecb1['query'][_0x6570('0x4a')]('nolimit')){_0x1a2e2b['limit']=qs['limit'](_0x53ecb1[_0x6570('0x42')][_0x6570('0x2f')]);_0x1a2e2b['offset']=qs[_0x6570('0x2e')](_0x53ecb1['query'][_0x6570('0x2e')]);}_0x1a2e2b[_0x6570('0x4c')]=qs['sort'](_0x53ecb1[_0x6570('0x42')]['sort']);_0x1a2e2b['where']=qs[_0x6570('0x44')](_[_0x6570('0x4f')](_0x53ecb1[_0x6570('0x42')],_0x420ef9['filters']));_0x1a2e2b[_0x6570('0x4e')]['WhatsappAccountId']=_0x33680a['id'];if(_0x53ecb1['query'][_0x6570('0x50')]){_0x1a2e2b[_0x6570('0x4e')]=_[_0x6570('0x51')](_0x1a2e2b['where'],{'$or':_['map'](_0x1a2e2b['attributes'],function(_0x3b8934){var _0x4593ca={};_0x4593ca[_0x3b8934]={'$like':'%'+_0x53ecb1[_0x6570('0x42')][_0x6570('0x50')]+'%'};return _0x4593ca;})});}_0x1a2e2b=_[_0x6570('0x51')]({},_0x1a2e2b,_0x53ecb1['options']);return db[_0x6570('0x67')]['count']({'where':_0x1a2e2b[_0x6570('0x4e')]})[_0x6570('0x36')](function(_0x1c6c38){_0xb77557[_0x6570('0x31')]=_0x1c6c38;if(_0x53ecb1[_0x6570('0x42')][_0x6570('0x52')]){_0x1a2e2b[_0x6570('0x53')]=[{'all':!![]}];}return db[_0x6570('0x67')]['findAll'](_0x1a2e2b);})['then'](function(_0x3408d4){_0xb77557[_0x6570('0x55')]=_0x3408d4;return _0xb77557;});}})[_0x6570('0x36')](respondWithFilteredResult(_0x59c621,_0x1a2e2b))[_0x6570('0x29')](handleError(_0x59c621,null));};exports[_0x6570('0x69')]=function(_0x5b777e,_0x810cc7,_0x269765){return db['WhatsappAccount'][_0x6570('0x61')]({'where':{'id':_0x5b777e['params']['id']}})[_0x6570('0x36')](handleEntityNotFound(_0x810cc7,null))[_0x6570('0x36')](function(_0x5cbead){if(_0x5cbead){return _0x5cbead[_0x6570('0x69')](_0x5b777e[_0x6570('0x42')][_0x6570('0x6a')]);}})['then'](respondWithStatusCode(_0x810cc7,null))[_0x6570('0x29')](handleError(_0x810cc7,null));};exports['addAnswer']=function(_0x3476ff,_0x108e4a,_0x4ad3ca){if(_0x3476ff[_0x6570('0x5b')]['id']){delete _0x3476ff['body']['id'];}return db['WhatsappAccount'][_0x6570('0x61')]({'where':{'id':_0x3476ff[_0x6570('0x57')]['id']}})[_0x6570('0x36')](handleEntityNotFound(_0x108e4a,null))['then'](function(_0x2bbf50){if(_0x2bbf50){_0x3476ff[_0x6570('0x5b')][_0x6570('0x66')]=_0x2bbf50['id'];return db[_0x6570('0x6b')]['create'](_0x3476ff[_0x6570('0x5b')]);}})[_0x6570('0x36')](respondWithResult(_0x108e4a,null))[_0x6570('0x29')](handleError(_0x108e4a,null));};exports[_0x6570('0x6c')]=function(_0xd8a9bf,_0xd0ab0,_0x3d0afc){var _0x3246d8={'raw':![],'where':{}};var _0x1269d5={};var _0x466bce={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x6570('0x6d')]({'where':{'id':_0xd8a9bf[_0x6570('0x57')]['id']}})[_0x6570('0x36')](handleEntityNotFound(_0xd0ab0,null))[_0x6570('0x36')](function(_0x27f00e){if(_0x27f00e){_0x1269d5[_0x6570('0x45')]=_['keys'](db[_0x6570('0x6b')][_0x6570('0x59')]);_0x1269d5[_0x6570('0x42')]=_[_0x6570('0x43')](_0xd8a9bf[_0x6570('0x42')]);_0x1269d5[_0x6570('0x44')]=_[_0x6570('0x47')](_0x1269d5[_0x6570('0x45')],_0x1269d5[_0x6570('0x42')]);_0x3246d8[_0x6570('0x46')]=_['intersection'](_0x1269d5['model'],qs[_0x6570('0x48')](_0xd8a9bf[_0x6570('0x42')][_0x6570('0x48')]));_0x3246d8[_0x6570('0x46')]=_0x3246d8['attributes']['length']?_0x3246d8[_0x6570('0x46')]:_0x1269d5[_0x6570('0x45')];if(!_0xd8a9bf['query'][_0x6570('0x4a')]('nolimit')){_0x3246d8['limit']=qs[_0x6570('0x2f')](_0xd8a9bf[_0x6570('0x42')][_0x6570('0x2f')]);_0x3246d8[_0x6570('0x2e')]=qs['offset'](_0xd8a9bf['query']['offset']);}_0x3246d8['order']=qs[_0x6570('0x4d')](_0xd8a9bf['query']['sort']);_0x3246d8[_0x6570('0x4e')]=qs['filters'](_[_0x6570('0x4f')](_0xd8a9bf['query'],_0x1269d5[_0x6570('0x44')]));_0x3246d8[_0x6570('0x4e')]['WhatsappAccountId']=_0x27f00e['id'];if(_0xd8a9bf[_0x6570('0x42')][_0x6570('0x50')]){_0x3246d8[_0x6570('0x4e')]=_['merge'](_0x3246d8[_0x6570('0x4e')],{'$or':_[_0x6570('0x3d')](_0x3246d8[_0x6570('0x46')],function(_0xf5fa9f){var _0x299a41={};_0x299a41[_0xf5fa9f]={'$like':'%'+_0xd8a9bf[_0x6570('0x42')]['filter']+'%'};return _0x299a41;})});}_0x3246d8=_['merge']({},_0x3246d8,_0xd8a9bf[_0x6570('0x6e')]);return db[_0x6570('0x6b')]['count']({'where':_0x3246d8[_0x6570('0x4e')]})[_0x6570('0x36')](function(_0x100a07){_0x466bce[_0x6570('0x31')]=_0x100a07;if(_0xd8a9bf[_0x6570('0x42')][_0x6570('0x52')]){_0x3246d8[_0x6570('0x53')]=[{'all':!![]}];}return db[_0x6570('0x6b')][_0x6570('0x54')](_0x3246d8);})[_0x6570('0x36')](function(_0x2671ab){_0x466bce['rows']=_0x2671ab;return _0x466bce;});}})[_0x6570('0x36')](respondWithFilteredResult(_0xd0ab0,_0x3246d8))['catch'](handleError(_0xd0ab0,null));};exports[_0x6570('0x6f')]=function(_0x9aebc5,_0x39bbf3,_0x46686d){return db[_0x6570('0x3e')]['find']({'where':{'id':_0x9aebc5[_0x6570('0x57')]['id']}})[_0x6570('0x36')](handleEntityNotFound(_0x39bbf3,null))[_0x6570('0x36')](function(_0x338a85){if(_0x338a85){return _0x338a85[_0x6570('0x6f')](_0x9aebc5[_0x6570('0x42')]['ids']);}})['then'](respondWithStatusCode(_0x39bbf3,null))[_0x6570('0x29')](handleError(_0x39bbf3,null));};exports[_0x6570('0x70')]=function(_0xecac8e,_0x12cbfb,_0x3551f9){return db[_0x6570('0x3e')][_0x6570('0x61')]({'where':{'id':_0xecac8e['params']['id']}})['then'](handleEntityNotFound(_0x12cbfb,null))['then'](function(_0x5b2f38){if(_0x5b2f38){return _0x5b2f38['addAgents'](_0xecac8e[_0x6570('0x5b')][_0x6570('0x6a')],_[_0x6570('0x71')](_0xecac8e[_0x6570('0x5b')],['ids','id'])||{})[_0x6570('0x72')](function(_0x683b26){for(var _0x52de44=0x0;_0x52de44<_0xecac8e[_0x6570('0x5b')][_0x6570('0x6a')][_0x6570('0x49')];_0x52de44+=0x1){socket[_0x6570('0x73')](_0x6570('0x74'),{'UserId':Number(_0xecac8e[_0x6570('0x5b')][_0x6570('0x6a')][_0x52de44]),'WhatsappAccountId':Number(_0xecac8e[_0x6570('0x57')]['id'])});}return _0x683b26;});}})['then'](respondWithResult(_0x12cbfb,null))[_0x6570('0x29')](handleError(_0x12cbfb,null));};exports[_0x6570('0x75')]=function(_0x3cc650,_0x162374,_0x5dd28f){return db['WhatsappAccount'][_0x6570('0x61')]({'where':{'id':_0x3cc650['params']['id']}})[_0x6570('0x36')](handleEntityNotFound(_0x162374,null))[_0x6570('0x36')](function(_0x3d5e63){if(_0x3d5e63){return _0x3d5e63[_0x6570('0x75')](_0x3cc650['query'][_0x6570('0x6a')])[_0x6570('0x36')](function(){if(_[_0x6570('0x76')](_0x3cc650[_0x6570('0x42')][_0x6570('0x6a')])){for(var _0x381821=0x0;_0x381821<_0x3cc650[_0x6570('0x42')][_0x6570('0x6a')]['length'];_0x381821+=0x1){socket[_0x6570('0x73')]('userWhatsappAccount:remove',{'UserId':Number(_0x3cc650['query'][_0x6570('0x6a')][_0x381821]),'WhatsappAccountId':Number(_0x3cc650['params']['id'])});}}else{socket[_0x6570('0x73')](_0x6570('0x77'),{'UserId':Number(_0x3cc650[_0x6570('0x42')]['ids']),'WhatsappAccountId':Number(_0x3cc650['params']['id'])});}});}})[_0x6570('0x36')](respondWithStatusCode(_0x162374,null))[_0x6570('0x29')](handleError(_0x162374,null));};exports[_0x6570('0x78')]=function(_0x162c4f,_0x516739,_0x591688){var _0xfa9194={};var _0x18350e={};var _0xdce087;var _0x30a190;return db[_0x6570('0x3e')][_0x6570('0x6d')]({'where':{'id':_0x162c4f[_0x6570('0x57')]['id']}})[_0x6570('0x36')](handleEntityNotFound(_0x516739,null))['then'](function(_0x291585){if(_0x291585){_0xdce087=_0x291585;_0x18350e[_0x6570('0x45')]=_[_0x6570('0x43')](db[_0x6570('0x79')][_0x6570('0x59')]);_0x18350e[_0x6570('0x42')]=_['keys'](_0x162c4f[_0x6570('0x42')]);_0x18350e['filters']=_[_0x6570('0x47')](_0x18350e['model'],_0x18350e[_0x6570('0x42')]);_0xfa9194['attributes']=_[_0x6570('0x47')](_0x18350e[_0x6570('0x45')],qs['fields'](_0x162c4f[_0x6570('0x42')][_0x6570('0x48')]));_0xfa9194[_0x6570('0x46')]=_0xfa9194[_0x6570('0x46')][_0x6570('0x49')]?_0xfa9194[_0x6570('0x46')]:_0x18350e[_0x6570('0x45')];_0xfa9194['order']=qs['sort'](_0x162c4f[_0x6570('0x42')][_0x6570('0x4d')]);_0xfa9194['where']=qs[_0x6570('0x44')](_['pick'](_0x162c4f[_0x6570('0x42')],_0x18350e[_0x6570('0x44')]));if(_0x162c4f[_0x6570('0x42')][_0x6570('0x50')]){_0xfa9194[_0x6570('0x4e')]=_[_0x6570('0x51')](_0xfa9194[_0x6570('0x4e')],{'$or':_['map'](_0xfa9194[_0x6570('0x46')],function(_0x2c63c1){var _0xb3841e={};_0xb3841e[_0x2c63c1]={'$like':'%'+_0x162c4f[_0x6570('0x42')][_0x6570('0x50')]+'%'};return _0xb3841e;})});}_0xfa9194=_[_0x6570('0x51')]({},_0xfa9194,_0x162c4f['options']);return _0xdce087[_0x6570('0x78')](_0xfa9194);}})['then'](function(_0xf1dbac){if(_0xf1dbac){_0x30a190=_0xf1dbac[_0x6570('0x49')];if(!_0x162c4f[_0x6570('0x42')][_0x6570('0x4a')](_0x6570('0x4b'))){_0xfa9194[_0x6570('0x2f')]=qs[_0x6570('0x2f')](_0x162c4f[_0x6570('0x42')][_0x6570('0x2f')]);_0xfa9194['offset']=qs['offset'](_0x162c4f[_0x6570('0x42')]['offset']);}return _0xdce087[_0x6570('0x78')](_0xfa9194);}})[_0x6570('0x36')](function(_0x4fa34b){if(_0x4fa34b){return _0x4fa34b?{'count':_0x30a190,'rows':_0x4fa34b}:null;}})['then'](respondWithResult(_0x516739,null))[_0x6570('0x29')](handleError(_0x516739,null));};exports['addApplications']=function(_0x199da4,_0x41f536){var _0x2999e7=_0x199da4[_0x6570('0x57')]['id'];var _0x5ee693=_0x199da4['body'];var _0x3bacf8=0xc8;var _0x408693=null;return db[_0x6570('0x7a')][_0x6570('0x7b')]({'isolationLevel':db[_0x6570('0x7a')]['Transaction']['ISOLATION_LEVELS'][_0x6570('0x7c')]},function(_0x530227){return db[_0x6570('0x3e')][_0x6570('0x6d')]({'where':{'id':_0x2999e7},'transaction':_0x530227})[_0x6570('0x36')](function(_0x272fad){if(_0x272fad){return db['WhatsappApplication'][_0x6570('0x37')]({'where':{'WhatsappAccountId':_0x2999e7},'transaction':_0x530227})['then'](function(){var _0x5ae5e0=_['map'](_0x5ee693,function(_0x33a244){_0x33a244[_0x6570('0x66')]=_0x2999e7;return _0x33a244;});return db[_0x6570('0x7d')][_0x6570('0x7e')](_0x5ae5e0,{'transaction':_0x530227});});}else{_0x3bacf8=0x194;_0x408693=[];}});})[_0x6570('0x36')](function(){if(_0x3bacf8!==0x194){return db[_0x6570('0x7d')]['findAndCountAll']({'where':{'WhatsappAccountId':_0x2999e7},'order':_0x6570('0x7f')})[_0x6570('0x36')](function(_0xddb5d7){_0x408693=_0xddb5d7;});}})['catch'](function(_0x1524e8){_0x3bacf8=0x1f4;logger['error'](_0x1524e8[_0x6570('0x39')]);if(_0x1524e8['name']){delete _0x1524e8[_0x6570('0x3a')];}_0x408693=_0x1524e8;})[_0x6570('0x80')](function(){if(_0x408693===null){_0x41f536['sendStatus'](_0x3bacf8);}else{if(_0x3bacf8===0x1f4){_0x41f536[_0x6570('0x2b')](_0x3bacf8)[_0x6570('0x3b')](_0x408693);}else{_0x41f536['status'](_0x3bacf8)[_0x6570('0x2d')](_0x408693);}}});};exports['getApplications']=function(_0x3d5c71,_0x2a78db,_0x217251){var _0x524880={};var _0x372003={};var _0x13ef37;var _0x936823;return db[_0x6570('0x3e')][_0x6570('0x6d')]({'where':{'id':_0x3d5c71[_0x6570('0x57')]['id']}})[_0x6570('0x36')](handleEntityNotFound(_0x2a78db,null))['then'](function(_0x5e8eb5){if(_0x5e8eb5){_0x13ef37=_0x5e8eb5;_0x372003[_0x6570('0x45')]=_[_0x6570('0x43')](db[_0x6570('0x7d')][_0x6570('0x59')]);_0x372003[_0x6570('0x42')]=_[_0x6570('0x43')](_0x3d5c71[_0x6570('0x42')]);_0x372003[_0x6570('0x44')]=_[_0x6570('0x47')](_0x372003[_0x6570('0x45')],_0x372003[_0x6570('0x42')]);_0x524880['attributes']=_['intersection'](_0x372003[_0x6570('0x45')],qs[_0x6570('0x48')](_0x3d5c71['query'][_0x6570('0x48')]));_0x524880[_0x6570('0x46')]=_0x524880[_0x6570('0x46')][_0x6570('0x49')]?_0x524880[_0x6570('0x46')]:_0x372003[_0x6570('0x45')];_0x524880[_0x6570('0x4c')]=qs[_0x6570('0x4d')](_0x3d5c71[_0x6570('0x42')][_0x6570('0x4d')]);_0x524880[_0x6570('0x4e')]=qs[_0x6570('0x44')](_[_0x6570('0x4f')](_0x3d5c71[_0x6570('0x42')],_0x372003[_0x6570('0x44')]));if(_0x3d5c71[_0x6570('0x42')][_0x6570('0x50')]){_0x524880['where']=_[_0x6570('0x51')](_0x524880['where'],{'$or':_['map'](_0x524880[_0x6570('0x46')],function(_0x1980a7){var _0x411229={};_0x411229[_0x1980a7]={'$like':'%'+_0x3d5c71[_0x6570('0x42')][_0x6570('0x50')]+'%'};return _0x411229;})});}_0x524880=_[_0x6570('0x51')]({},_0x524880,_0x3d5c71['options']);return _0x13ef37[_0x6570('0x81')](_0x524880);}})[_0x6570('0x36')](function(_0xcc54ac){if(_0xcc54ac){_0x936823=_0xcc54ac[_0x6570('0x49')];if(!_0x3d5c71[_0x6570('0x42')][_0x6570('0x4a')](_0x6570('0x4b'))){_0x524880['limit']=qs[_0x6570('0x2f')](_0x3d5c71['query'][_0x6570('0x2f')]);_0x524880[_0x6570('0x2e')]=qs[_0x6570('0x2e')](_0x3d5c71[_0x6570('0x42')][_0x6570('0x2e')]);}return _0x13ef37[_0x6570('0x81')](_0x524880);}})['then'](function(_0x3bc6ea){if(_0x3bc6ea){return _0x3bc6ea?{'count':_0x936823,'rows':_0x3bc6ea}:null;}})[_0x6570('0x36')](respondWithResult(_0x2a78db,null))[_0x6570('0x29')](handleError(_0x2a78db,null));};exports[_0x6570('0x82')]=function(_0x241c50,_0x2952a3,_0xc08c02){var _0x4c7009={'channel':_0x6570('0x83')};var _0xfbec=[];var _0x3673d5=[];var _0x561441={};return db[_0x6570('0x3e')]['find']({'where':{'id':_0x241c50['params']['id']},'include':[{'model':db[_0x6570('0x7d')],'as':_0x6570('0x84')}]})[_0x6570('0x36')](handleEntityNotFound(_0x2952a3,null))[_0x6570('0x36')](function(_0x4be8d3){_0x4c7009[_0x6570('0x85')]=_0x4be8d3;if(_0x4c7009[_0x6570('0x85')]&&_0x4c7009['account'][_0x6570('0x40')]===_0x6570('0x86')&&_0x241c50[_0x6570('0x5b')][_0x6570('0x87')]){if(_0x241c50['body'][_0x6570('0x87')][_0x6570('0x49')]===0x0)return;if(_0x241c50[_0x6570('0x5b')][_0x6570('0x87')][0x0][_0x6570('0x88')]!=='read')return;return db[_0x6570('0x89')]['update']({'read':!![],'readAt':_0x241c50['body'][_0x6570('0x87')][0x0][_0x6570('0x8a')]},{'where':{'messageId':_0x241c50[_0x6570('0x5b')][_0x6570('0x87')][0x0]['message_id']},'individualHooks':!![]})[_0x6570('0x36')](function(_0x305b6c){return _0x2952a3[_0x6570('0x2b')](0xc8)[_0x6570('0x2d')](_0x305b6c);});}_0x4c7009[_0x6570('0x8b')]=_[_0x6570('0x8c')](_0x4be8d3[_0x6570('0x84')],[_0x6570('0x7f')],[_0x6570('0x8d')]);if(_0x4c7009[_0x6570('0x85')]['Applications']){delete _0x4c7009[_0x6570('0x85')][_0x6570('0x84')];}return db[_0x6570('0x8e')]['describe']()[_0x6570('0x36')](function(_0x528dd3){if(!_0x528dd3){throw new db[(_0x6570('0x8f'))]['ValidationError'](_0x6570('0x90'));}_0xfbec=_[_0x6570('0x91')](_[_0x6570('0x43')](_0x528dd3),[_0x6570('0x92'),_0x6570('0x93')]);_0x3673d5=_[_0x6570('0x91')](_[_0x6570('0x43')](_0x528dd3),[_0x6570('0x92'),_0x6570('0x93'),_0x6570('0x94'),_0x6570('0x95')]);_0x4c7009[_0x6570('0x5b')]={'mapKey':_0x6570('0x96')};if(_0x4c7009['account']&&_0x4c7009[_0x6570('0x85')][_0x6570('0x40')]===_0x6570('0x97')){_0x4c7009['body']['from']=_0x241c50['body'][_0x6570('0x98')]['replace']('whatsapp:','');_0x4c7009[_0x6570('0x5b')][_0x6570('0x5b')]=_0x241c50[_0x6570('0x5b')][_0x6570('0x99')];_0x4c7009['body'][_0x6570('0x9a')]=_0x241c50['body'][_0x6570('0x9b')];}if(_0x4c7009[_0x6570('0x85')]&&_0x4c7009['account']['type']===_0x6570('0x86')){_0x4c7009[_0x6570('0x5b')]['from']=_0x241c50[_0x6570('0x5b')][_0x6570('0x9c')][0x0][_0x6570('0x9d')];_0x4c7009[_0x6570('0x5b')][_0x6570('0x5b')]=_0x241c50[_0x6570('0x5b')][_0x6570('0x9c')][0x0][_0x6570('0x27')]['body'];_0x4c7009['body'][_0x6570('0x9a')]=_0x241c50[_0x6570('0x5b')][_0x6570('0x9c')][0x0][_0x6570('0x9e')];}if(_0x4c7009['body']['id']){delete _0x4c7009['body']['id'];}if(_[_0x6570('0x9f')](_0x4c7009['body'][_0x6570('0x9d')])){throw new db[(_0x6570('0x8f'))][(_0x6570('0xa0'))]('from\x20is\x20mandatory');}if(_[_0x6570('0x9f')](_0x4c7009[_0x6570('0x5b')][_0x6570('0x5b')])||_0x4c7009[_0x6570('0x5b')][_0x6570('0x5b')]===''){throw new db['Sequelize'][(_0x6570('0xa0'))](_0x6570('0xa1'));}if(_['isNil'](_0x4c7009[_0x6570('0x5b')][_0x6570('0xa2')])){throw new db['Sequelize'][(_0x6570('0xa0'))](_0x6570('0xa3')+_0x3673d5);}if(!_[_0x6570('0xa4')](_0x3673d5,_0x4c7009[_0x6570('0x5b')][_0x6570('0xa2')])){throw new db[(_0x6570('0x8f'))][(_0x6570('0xa0'))](_0x6570('0xa5')+_0x3673d5);}_0x561441[_0x4c7009['body'][_0x6570('0xa2')]]=_0x4c7009['body'][_0x6570('0x9d')];return db[_0x6570('0xa6')][_0x6570('0x61')]({'where':{'id':_0x4c7009[_0x6570('0x85')][_0x6570('0x95')]},'include':[{'model':db[_0x6570('0x8e')],'as':_0x6570('0xa7'),'where':_0x561441,'limit':0x1,'order':[[_0x6570('0x93'),_0x6570('0xa8')]]}]});})[_0x6570('0x36')](handleEntityNotFound(_0x2952a3,null))[_0x6570('0x36')](function(_0x5d3cb3){if(_0x5d3cb3){_0x4c7009[_0x6570('0xa9')]=_[_0x6570('0x71')](_0x5d3cb3,[_0x6570('0xa7')]);if(_0x5d3cb3[_0x6570('0xa7')][_0x6570('0x49')]){return _0x5d3cb3[_0x6570('0xa7')][0x0];}var _0x1f856f=_[_0x6570('0x18')](_0x4c7009['body'],{'firstName':_0x4c7009['body'][_0x6570('0x9d')],'ListId':_0x5d3cb3['id']});_0x1f856f[_0x4c7009[_0x6570('0x5b')][_0x6570('0xa2')]]=_0x4c7009[_0x6570('0x5b')][_0x6570('0x9d')];return db[_0x6570('0x8e')]['create'](_0x1f856f,{'fields':_0xfbec,'raw':!![]});}})[_0x6570('0x36')](handleEntityNotFound(_0x2952a3,null))['then'](function(_0x5a3806){if(_0x5a3806){_0x4c7009[_0x6570('0xaa')]=_0x5a3806;var _0x18b12b={'ContactId':_0x5a3806['id'],'phone':_0x4c7009[_0x6570('0x5b')][_0x6570('0x9d')],'WhatsappAccountId':_0x241c50[_0x6570('0x57')]['id']};var _0x29d5ec={'ContactId':_0x5a3806['id'],'WhatsappAccountId':_0x241c50[_0x6570('0x57')]['id'],'closed':![]};return db[_0x6570('0xab')][_0x6570('0x61')]({'where':_0x29d5ec})[_0x6570('0x36')](function(_0x2fb48c){if(_0x2fb48c){return[_0x2fb48c,![]];}return db[_0x6570('0xab')][_0x6570('0x5a')](_0x18b12b)['then'](function(_0x574ce2){return[_0x574ce2,!![]];});});}})[_0x6570('0x72')](function(_0xe7dae8,_0x59f7a9){_0x4c7009[_0x6570('0xac')]=_0xe7dae8['get']({'plain':!![]});_0x4c7009[_0x6570('0xac')][_0x6570('0xad')]=![];if(_0x59f7a9){if(_0x4c7009['account'][_0x6570('0xae')]){_0x4c7009[_0x6570('0x8b')]['push']({'id':0x0,'priority':_0x4c7009[_0x6570('0x8b')][_0x6570('0x49')]+0x1,'app':_0x6570('0xaf'),'appdata':'unmanaged','interval':'*,*,*,*'});}_0x4c7009[_0x6570('0xac')][_0x6570('0xad')]=!![];}return db[_0x6570('0x89')][_0x6570('0x5a')]({'phone':_0x4c7009[_0x6570('0x5b')][_0x6570('0x9d')],'messageId':_0x4c7009[_0x6570('0x5b')]['messageId'],'body':_0x4c7009[_0x6570('0x5b')][_0x6570('0x5b')],'WhatsappAccountId':_0x241c50['params']['id'],'WhatsappInteractionId':_0xe7dae8['id'],'direction':'in','ContactId':_0xe7dae8[_0x6570('0xb0')],'AttachmentId':_0x4c7009[_0x6570('0x5b')][_0x6570('0xb1')]});})[_0x6570('0x36')](function(_0x1001b7){_0x4c7009[_0x6570('0x27')]=_0x1001b7;if(_0x4c7009[_0x6570('0xac')][_0x6570('0xb2')]){return db[_0x6570('0x79')]['find']({'attributes':['id','name'],'where':{'id':_0x4c7009[_0x6570('0xac')]['UserId']}})[_0x6570('0x36')](function(_0x20f2ba){if(_0x20f2ba){_0x4c7009[_0x6570('0x8b')][_0x6570('0xb3')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x20f2ba[_0x6570('0x3a')]+','+(_0x4c7009[_0x6570('0x85')][_0x6570('0xb4')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x6570('0xb5'),_0x6570('0xb6'),_0x4c7009);});}return respondWithRpcPromise('Start',_0x6570('0xb6'),_0x4c7009);})[_0x6570('0x36')](function(_0x32fe1f){if(_0x32fe1f){var _0x47a9e5=0xc8;var _0x2a692c=_0x6570('0xb7');logger[_0x6570('0x1f')](_0x6570('0x21'),_0x2a692c,_0x47a9e5,_0x6570('0xb8'));logger[_0x6570('0x20')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x2a692c,_0x47a9e5,_0x6570('0xb8'),JSON[_0x6570('0x23')](_0x32fe1f));if(_0x4c7009['account'][_0x6570('0x40')]===_0x6570('0x97')){return _0x2952a3[_0x6570('0x2b')](_0x47a9e5)['set'](_0x6570('0xb9'),'text/xml')[_0x6570('0x3b')](_0x6570('0xba'));}else{return _0x2952a3[_0x6570('0x2b')](_0x47a9e5)[_0x6570('0x2d')](_0x32fe1f);}}});})[_0x6570('0x29')](handleError(_0x2952a3,null));};exports['send']=function(_0x25cb09,_0x341c8c,_0x663508){var _0x3e830c,_0x5b4f2d,_0x21178f;if(_[_0x6570('0x9f')](_0x25cb09['body'][_0x6570('0x5b')])||_0x25cb09[_0x6570('0x5b')]['body']===''){throw new db[(_0x6570('0x8f'))][(_0x6570('0xa0'))](_0x6570('0xa1'));}if(_[_0x6570('0x9f')](_0x25cb09['body']['to'])){throw new db[(_0x6570('0x8f'))][(_0x6570('0xa0'))]('to\x20is\x20mandatory');}_0x3e830c=_0x25cb09['body']['to'];return db['WhatsappAccount'][_0x6570('0x61')]({'where':{'id':_0x25cb09[_0x6570('0x57')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x6570('0x8e')],'as':_0x6570('0xa7'),'where':{'mobile':_0x3e830c},'limit':0x1,'order':[['updatedAt',_0x6570('0xa8')]]}]}]})[_0x6570('0x36')](handleEntityNotFound(_0x341c8c,null))[_0x6570('0x36')](function(_0x5079e0){if(_0x5079e0&&_0x5079e0['List']){_0x5b4f2d=_0x5079e0['get']({'plain':!![]});if(_0x5b4f2d['List']&&_0x5b4f2d[_0x6570('0xbb')][_0x6570('0xa7')][_0x6570('0x49')]){return _0x5b4f2d[_0x6570('0xbb')][_0x6570('0xa7')][0x0];}return db[_0x6570('0x8e')][_0x6570('0x5a')](_[_0x6570('0x18')](_0x25cb09[_0x6570('0x5b')],{'firstName':_0x3e830c,'mobile':_0x3e830c,'phone':_0x3e830c,'ListId':_0x5b4f2d[_0x6570('0x95')]}));}})[_0x6570('0x36')](handleEntityNotFound(_0x341c8c,null))['then'](function(_0x1cdb3d){if(_0x1cdb3d){_0x21178f=_0x1cdb3d;return db[_0x6570('0xab')][_0x6570('0x61')]({'where':{'ContactId':_0x21178f['id'],'closed':![],'WhatsappAccountId':_0x5b4f2d['id']}})[_0x6570('0x36')](function(_0x4dce08){if(_0x4dce08){return[_0x4dce08,![]];}return db[_0x6570('0xab')][_0x6570('0x5a')]({'UserId':_0x25cb09[_0x6570('0x5c')]['id'],'ContactId':_0x21178f['id'],'WhatsappAccountId':_0x5b4f2d['id'],'phone':_0x3e830c,'firstMsgDirection':_0x6570('0xbc'),'Messages':[_['merge'](_0x25cb09[_0x6570('0x5b')],{'read':![],'body':_0x25cb09['body'][_0x6570('0x5b')],'phone':_0x3e830c,'WhatsappAccountId':_0x5b4f2d['id'],'UserId':_0x25cb09['user']['id'],'ContactId':_0x21178f['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0x6570('0xbd')}]})[_0x6570('0x36')](function(_0x1a0967){return[_0x1a0967,!![]];});});}})[_0x6570('0x72')](function(_0x18aed5,_0x1e313e){if(_0x1e313e){return _0x18aed5;}return db[_0x6570('0x89')][_0x6570('0x5a')](_[_0x6570('0x51')](_0x25cb09[_0x6570('0x5b')],{'read':![],'body':_0x25cb09[_0x6570('0x5b')]['body'],'phone':_0x3e830c,'WhatsappAccountId':_0x5b4f2d['id'],'WhatsappInteractionId':_0x18aed5['id'],'UserId':_0x25cb09[_0x6570('0x5c')]['id'],'ContactId':_0x21178f['id']}))[_0x6570('0x36')](function(_0x3c915f){_0x18aed5[_0x6570('0xbe')]['Messages']=[];_0x18aed5[_0x6570('0xbe')][_0x6570('0xbd')][_0x6570('0xbf')](_0x3c915f[_0x6570('0xbe')]);return _0x18aed5;});})[_0x6570('0x36')](respondWithResult(_0x341c8c,null))['catch'](handleError(_0x341c8c,null));}; \ No newline at end of file +var _0x6250=['updatedAt','CompanyId','ListId','mobile','From','replace','whatsapp:','messageId','MessageSid','notifications','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','CmList','Contacts','DESC','list','defaults','WhatsappInteraction','interaction','created','autoclose','close','unmanaged','*,*,*,*','ContactId','AttachmentId','UserId','agent','waitForTheAssignedAgent','startRouting','Start','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','set','Content-Type','text/xml','\x0a','to\x20is\x20mandatory','List','out','Messages','dataValues','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','client','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','status','end','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','get','WhatsappAccounts','sendStatus','stack','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','fieldName','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','options','include','findAll','rows','show','params','rawAttributes','keys','includeAll','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','WhatsappAccountId','getDispositions','merge','Disposition','removeDispositions','addAnswer','getAnswers','CannedAnswer','removeAnswers','ids','addAgents','omit','spread','removeAgents','emit','userWhatsappAccount:remove','findOne','User','getAgents','addApplications','sequelize','ISOLATION_LEVELS','WhatsappApplication','findAndCountAll','priority','finally','json','getApplications','notify','whatsapp','Applications','account','statuses','state','read','WhatsappMessage','timestamp','message_id','applications','asc','CmContact','Sequelize','ValidationError','difference','createdAt'];(function(_0x50c186,_0xf7791){var _0x1da419=function(_0x17b339){while(--_0x17b339){_0x50c186['push'](_0x50c186['shift']());}};_0x1da419(++_0xf7791);}(_0x6250,0x1b1));var _0x0625=function(_0x371e2d,_0x28de18){_0x371e2d=_0x371e2d-0x0;var _0x273c0a=_0x6250[_0x371e2d];return _0x273c0a;};'use strict';var emlformat=require(_0x0625('0x0'));var rimraf=require(_0x0625('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0625('0x2'));var rp=require(_0x0625('0x3'));var moment=require(_0x0625('0x4'));var BPromise=require(_0x0625('0x5'));var Mustache=require(_0x0625('0x6'));var util=require(_0x0625('0x7'));var path=require(_0x0625('0x8'));var sox=require(_0x0625('0x9'));var csv=require(_0x0625('0xa'));var ejs=require(_0x0625('0xb'));var fs=require('fs');var fs_extra=require(_0x0625('0xc'));var _=require(_0x0625('0xd'));var squel=require('squel');var crypto=require(_0x0625('0xe'));var jsforce=require(_0x0625('0xf'));var deskjs=require(_0x0625('0x10'));var toCsv=require(_0x0625('0xa'));var querystring=require(_0x0625('0x11'));var Papa=require(_0x0625('0x12'));var Redis=require(_0x0625('0x13'));var authService=require(_0x0625('0x14'));var qs=require(_0x0625('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0625('0x16'))(_0x0625('0x17'));var utils=require('../../config/utils');var config=require(_0x0625('0x18'));var licenseUtil=require(_0x0625('0x19'));var db=require(_0x0625('0x1a'))['db'];config[_0x0625('0x1b')]=_['defaults'](config['redis'],{'host':_0x0625('0x1c'),'port':0x18eb});var socket=require(_0x0625('0x1d'))(new Redis(config['redis']));require('./whatsappAccount.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x0625('0x1e')]['http']({'port':0x232c});function respondWithRpcPromise(_0x1f6387,_0x12561c,_0x258a6d,_0x423c25){return new BPromise(function(_0x401c5d,_0x5a3a73){var _0x553f72=_0x423c25||client;return _0x553f72[_0x0625('0x1f')](_0x1f6387,_0x258a6d)[_0x0625('0x20')](function(_0x368b90){logger[_0x0625('0x21')](_0x0625('0x22'),_0x12561c,_0x0625('0x23'));logger[_0x0625('0x24')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x12561c,'request\x20sent',JSON[_0x0625('0x25')](_0x368b90));if(_0x368b90[_0x0625('0x26')]){if(_0x368b90['error']['code']===0x1f4){logger[_0x0625('0x26')](_0x0625('0x22'),_0x12561c,_0x368b90['error'][_0x0625('0x27')]);return _0x5a3a73(_0x368b90[_0x0625('0x26')][_0x0625('0x27')]);}logger['error'](_0x0625('0x22'),_0x12561c,_0x368b90[_0x0625('0x26')][_0x0625('0x27')]);return _0x401c5d(_0x368b90['error'][_0x0625('0x27')]);}else{logger['info'](_0x0625('0x22'),_0x12561c,_0x0625('0x23'));_0x401c5d(_0x368b90[_0x0625('0x28')]['message']);}})[_0x0625('0x29')](function(_0x189f48){logger[_0x0625('0x26')](_0x0625('0x22'),_0x12561c,_0x189f48);_0x5a3a73(_0x189f48);});});}function respondWithStatusCode(_0x5ee744,_0x8cacc){_0x8cacc=_0x8cacc||0xcc;return function(_0x2fc0d5){if(_0x2fc0d5){return _0x5ee744['sendStatus'](_0x8cacc);}return _0x5ee744[_0x0625('0x2a')](_0x8cacc)[_0x0625('0x2b')]();};}function respondWithResult(_0x41641f,_0x1d762d){_0x1d762d=_0x1d762d||0xc8;return function(_0x3c056b){if(_0x3c056b){return _0x41641f[_0x0625('0x2a')](_0x1d762d)['json'](_0x3c056b);}};}function respondWithFilteredResult(_0x247d83,_0x24b6bc){return function(_0xc6327c){if(_0xc6327c){var _0x5bfd0b=typeof _0x24b6bc[_0x0625('0x2c')]===_0x0625('0x2d')&&typeof _0x24b6bc[_0x0625('0x2e')]===_0x0625('0x2d');var _0x1280b9=_0xc6327c[_0x0625('0x2f')];var _0x57abc6=_0x5bfd0b?0x0:_0x24b6bc[_0x0625('0x2c')];var _0x4de261=_0x5bfd0b?_0xc6327c[_0x0625('0x2f')]:_0x24b6bc['offset']+_0x24b6bc['limit'];var _0x29fa0c;if(_0x4de261>=_0x1280b9){_0x4de261=_0x1280b9;_0x29fa0c=0xc8;}else{_0x29fa0c=0xce;}_0x247d83[_0x0625('0x2a')](_0x29fa0c);return _0x247d83['set'](_0x0625('0x30'),_0x57abc6+'-'+_0x4de261+'/'+_0x1280b9)['json'](_0xc6327c);}return null;};}function patchUpdates(_0x52c75d){return function(_0x40aff1){try{jsonpatch[_0x0625('0x31')](_0x40aff1,_0x52c75d,!![]);}catch(_0x57aabb){return BPromise[_0x0625('0x32')](_0x57aabb);}return _0x40aff1[_0x0625('0x33')]();};}function saveUpdates(_0x16cbd1,_0xd578d5){return function(_0x5280d8){if(_0x5280d8){return _0x5280d8[_0x0625('0x34')](_0x16cbd1)[_0x0625('0x20')](function(_0x31e25f){return _0x31e25f;});}return null;};}function removeEntity(_0x4fbbd5,_0x14924b){return function(_0x39d6a0){if(_0x39d6a0){return _0x39d6a0[_0x0625('0x35')]()[_0x0625('0x20')](function(){var _0x5dd6d7=_0x39d6a0[_0x0625('0x36')]({'plain':!![]});var _0x79b2ae=_0x0625('0x37');return db['UserProfileResource'][_0x0625('0x35')]({'where':{'type':_0x79b2ae,'resourceId':_0x5dd6d7['id']}})[_0x0625('0x20')](function(){return _0x39d6a0;});})[_0x0625('0x20')](function(){_0x4fbbd5[_0x0625('0x2a')](0xcc)[_0x0625('0x2b')]();});}};}function handleEntityNotFound(_0x13e409,_0x2233dc){return function(_0x491485){if(!_0x491485){_0x13e409[_0x0625('0x38')](0x194);}return _0x491485;};}function handleError(_0x2bde5f,_0x9b6dd){_0x9b6dd=_0x9b6dd||0x1f4;return function(_0x829806){logger[_0x0625('0x26')](_0x829806[_0x0625('0x39')]);if(_0x829806['name']){delete _0x829806['name'];}_0x2bde5f['status'](_0x9b6dd)[_0x0625('0x3a')](_0x829806);};}exports[_0x0625('0x3b')]=function(_0x4378b4,_0x462d4c){var _0x12fd22={'include':[{'model':db[_0x0625('0x3c')],'as':_0x0625('0x3d')}]},_0x133590={},_0x30eaad={'count':0x0,'rows':[]};var _0x14eff6=_[_0x0625('0x3e')](db[_0x0625('0x3f')]['rawAttributes'],function(_0x256a69){return{'name':_0x256a69[_0x0625('0x40')],'type':_0x256a69['type']['key']};});_0x133590[_0x0625('0x41')]=_['map'](_0x14eff6,_0x0625('0x42'));_0x133590['query']=_['keys'](_0x4378b4[_0x0625('0x43')]);_0x133590[_0x0625('0x44')]=_[_0x0625('0x45')](_0x133590[_0x0625('0x41')],_0x133590[_0x0625('0x43')]);_0x12fd22[_0x0625('0x46')]=_[_0x0625('0x45')](_0x133590[_0x0625('0x41')],qs[_0x0625('0x47')](_0x4378b4[_0x0625('0x43')][_0x0625('0x47')]));_0x12fd22[_0x0625('0x46')]=_0x12fd22['attributes'][_0x0625('0x48')]?_0x12fd22[_0x0625('0x46')]:_0x133590[_0x0625('0x41')];if(!_0x4378b4[_0x0625('0x43')][_0x0625('0x49')](_0x0625('0x4a'))){_0x12fd22[_0x0625('0x2e')]=qs[_0x0625('0x2e')](_0x4378b4['query'][_0x0625('0x2e')]);_0x12fd22['offset']=qs['offset'](_0x4378b4[_0x0625('0x43')][_0x0625('0x2c')]);}_0x12fd22[_0x0625('0x4b')]=qs[_0x0625('0x4c')](_0x4378b4[_0x0625('0x43')][_0x0625('0x4c')]);_0x12fd22[_0x0625('0x4d')]=qs['filters'](_[_0x0625('0x4e')](_0x4378b4['query'],_0x133590[_0x0625('0x44')]),_0x14eff6);if(_0x4378b4[_0x0625('0x43')][_0x0625('0x4f')]){_0x12fd22[_0x0625('0x4d')]=_['merge'](_0x12fd22['where'],{'$or':_[_0x0625('0x3e')](_0x14eff6,function(_0x20c01a){if(_0x20c01a[_0x0625('0x50')]!=='VIRTUAL'){var _0x539322={};_0x539322[_0x20c01a[_0x0625('0x42')]]={'$like':'%'+_0x4378b4[_0x0625('0x43')]['filter']+'%'};return _0x539322;}})});}_0x12fd22=_['merge']({},_0x12fd22,_0x4378b4[_0x0625('0x51')]);var _0x3302ad={'where':_0x12fd22[_0x0625('0x4d')]};return db[_0x0625('0x3f')][_0x0625('0x2f')](_0x3302ad)['then'](function(_0x10d856){_0x30eaad[_0x0625('0x2f')]=_0x10d856;if(_0x4378b4[_0x0625('0x43')]['includeAll']){_0x12fd22[_0x0625('0x52')]=[{'all':!![]}];}return db[_0x0625('0x3f')][_0x0625('0x53')](_0x12fd22);})[_0x0625('0x20')](function(_0x14f959){_0x30eaad[_0x0625('0x54')]=_0x14f959;return _0x30eaad;})[_0x0625('0x20')](respondWithFilteredResult(_0x462d4c,_0x12fd22))[_0x0625('0x29')](handleError(_0x462d4c,null));};exports[_0x0625('0x55')]=function(_0x3db465,_0x2b1a36){var _0x12eecf={'raw':![],'where':{'id':_0x3db465[_0x0625('0x56')]['id']},'include':[{'model':db[_0x0625('0x3c')],'as':_0x0625('0x3d')}]},_0xc0f0d={};_0xc0f0d[_0x0625('0x41')]=_['keys'](db['WhatsappAccount'][_0x0625('0x57')]);_0xc0f0d[_0x0625('0x43')]=_[_0x0625('0x58')](_0x3db465[_0x0625('0x43')]);_0xc0f0d[_0x0625('0x44')]=_['intersection'](_0xc0f0d['model'],_0xc0f0d[_0x0625('0x43')]);_0x12eecf['attributes']=_[_0x0625('0x45')](_0xc0f0d['model'],qs[_0x0625('0x47')](_0x3db465[_0x0625('0x43')][_0x0625('0x47')]));_0x12eecf['attributes']=_0x12eecf[_0x0625('0x46')]['length']?_0x12eecf[_0x0625('0x46')]:_0xc0f0d[_0x0625('0x41')];if(_0x3db465[_0x0625('0x43')][_0x0625('0x59')]){_0x12eecf['include']=[{'all':!![]}];}_0x12eecf=_['merge']({},_0x12eecf,_0x3db465[_0x0625('0x51')]);return db['WhatsappAccount']['find'](_0x12eecf)[_0x0625('0x20')](handleEntityNotFound(_0x2b1a36,null))['then'](respondWithResult(_0x2b1a36,null))[_0x0625('0x29')](handleError(_0x2b1a36,null));};exports['create']=function(_0x54fbee,_0xc1b7e2){return db[_0x0625('0x3f')]['create'](_0x54fbee['body'],{})[_0x0625('0x20')](function(_0x297a1e){var _0x354694=_0x54fbee[_0x0625('0x5a')][_0x0625('0x36')]({'plain':!![]});if(!_0x354694)throw new Error(_0x0625('0x5b'));if(_0x354694['role']===_0x0625('0x5a')){var _0x46065d=_0x297a1e[_0x0625('0x36')]({'plain':!![]});var _0x252fc8=_0x0625('0x37');return db['UserProfileSection'][_0x0625('0x5c')]({'where':{'name':_0x252fc8,'userProfileId':_0x354694[_0x0625('0x5d')]},'raw':!![]})[_0x0625('0x20')](function(_0x19dbc2){if(_0x19dbc2&&_0x19dbc2[_0x0625('0x5e')]===0x0){return db[_0x0625('0x5f')][_0x0625('0x60')]({'name':_0x46065d[_0x0625('0x42')],'resourceId':_0x46065d['id'],'type':_0x19dbc2[_0x0625('0x42')],'sectionId':_0x19dbc2['id']},{})[_0x0625('0x20')](function(){return _0x297a1e;});}else{return _0x297a1e;}})[_0x0625('0x29')](function(_0x3d48b0){logger[_0x0625('0x26')](_0x0625('0x61'),_0x3d48b0);throw _0x3d48b0;});}return _0x297a1e;})[_0x0625('0x20')](respondWithResult(_0xc1b7e2,0xc9))[_0x0625('0x29')](handleError(_0xc1b7e2,null));};exports[_0x0625('0x34')]=function(_0x57e949,_0x2a3d34){if(_0x57e949['body']['id']){delete _0x57e949['body']['id'];}return db[_0x0625('0x3f')]['find']({'where':{'id':_0x57e949[_0x0625('0x56')]['id']},'include':[{'model':db[_0x0625('0x3c')],'as':'mandatoryDispositionPause'}]})[_0x0625('0x20')](handleEntityNotFound(_0x2a3d34,null))['then'](saveUpdates(_0x57e949[_0x0625('0x62')],null))[_0x0625('0x20')](respondWithResult(_0x2a3d34,null))[_0x0625('0x29')](handleError(_0x2a3d34,null));};exports[_0x0625('0x35')]=function(_0x5f3515,_0x275e12){return db[_0x0625('0x3f')][_0x0625('0x5c')]({'where':{'id':_0x5f3515[_0x0625('0x56')]['id']}})[_0x0625('0x20')](handleEntityNotFound(_0x275e12,null))[_0x0625('0x20')](removeEntity(_0x275e12,null))['catch'](handleError(_0x275e12,null));};exports[_0x0625('0x63')]=function(_0x180775,_0x28e0ef){return db[_0x0625('0x3f')][_0x0625('0x63')]()[_0x0625('0x20')](respondWithResult(_0x28e0ef,null))[_0x0625('0x29')](handleError(_0x28e0ef,null));};exports[_0x0625('0x64')]=function(_0x3ba79a,_0x4dd834,_0x5dcb1b){if(_0x3ba79a['body']['id']){delete _0x3ba79a[_0x0625('0x62')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x3ba79a[_0x0625('0x56')]['id']}})[_0x0625('0x20')](handleEntityNotFound(_0x4dd834,null))[_0x0625('0x20')](function(_0x19a11e){if(_0x19a11e){_0x3ba79a[_0x0625('0x62')][_0x0625('0x65')]=_0x19a11e['id'];return db['Disposition'][_0x0625('0x60')](_0x3ba79a[_0x0625('0x62')]);}})[_0x0625('0x20')](respondWithResult(_0x4dd834,null))[_0x0625('0x29')](handleError(_0x4dd834,null));};exports[_0x0625('0x66')]=function(_0x2378cf,_0x167a40,_0x1239ab){var _0x203f45={'raw':![],'where':{}};var _0x589904={};var _0x17a815={'count':0x0,'rows':[]};return db[_0x0625('0x3f')]['findOne']({'where':{'id':_0x2378cf['params']['id']}})[_0x0625('0x20')](handleEntityNotFound(_0x167a40,null))[_0x0625('0x20')](function(_0x54f331){if(_0x54f331){_0x589904[_0x0625('0x41')]=_[_0x0625('0x58')](db['Disposition'][_0x0625('0x57')]);_0x589904[_0x0625('0x43')]=_[_0x0625('0x58')](_0x2378cf['query']);_0x589904['filters']=_[_0x0625('0x45')](_0x589904[_0x0625('0x41')],_0x589904[_0x0625('0x43')]);_0x203f45[_0x0625('0x46')]=_[_0x0625('0x45')](_0x589904['model'],qs['fields'](_0x2378cf[_0x0625('0x43')][_0x0625('0x47')]));_0x203f45['attributes']=_0x203f45[_0x0625('0x46')][_0x0625('0x48')]?_0x203f45[_0x0625('0x46')]:_0x589904[_0x0625('0x41')];if(!_0x2378cf['query']['hasOwnProperty'](_0x0625('0x4a'))){_0x203f45[_0x0625('0x2e')]=qs['limit'](_0x2378cf['query'][_0x0625('0x2e')]);_0x203f45['offset']=qs[_0x0625('0x2c')](_0x2378cf['query'][_0x0625('0x2c')]);}_0x203f45[_0x0625('0x4b')]=qs[_0x0625('0x4c')](_0x2378cf[_0x0625('0x43')][_0x0625('0x4c')]);_0x203f45[_0x0625('0x4d')]=qs[_0x0625('0x44')](_[_0x0625('0x4e')](_0x2378cf[_0x0625('0x43')],_0x589904[_0x0625('0x44')]));_0x203f45['where'][_0x0625('0x65')]=_0x54f331['id'];if(_0x2378cf[_0x0625('0x43')][_0x0625('0x4f')]){_0x203f45['where']=_[_0x0625('0x67')](_0x203f45[_0x0625('0x4d')],{'$or':_[_0x0625('0x3e')](_0x203f45['attributes'],function(_0x5b76ed){var _0x41b1ea={};_0x41b1ea[_0x5b76ed]={'$like':'%'+_0x2378cf['query']['filter']+'%'};return _0x41b1ea;})});}_0x203f45=_['merge']({},_0x203f45,_0x2378cf['options']);return db['Disposition'][_0x0625('0x2f')]({'where':_0x203f45[_0x0625('0x4d')]})[_0x0625('0x20')](function(_0x279a72){_0x17a815[_0x0625('0x2f')]=_0x279a72;if(_0x2378cf['query'][_0x0625('0x59')]){_0x203f45[_0x0625('0x52')]=[{'all':!![]}];}return db[_0x0625('0x68')][_0x0625('0x53')](_0x203f45);})['then'](function(_0x1297e5){_0x17a815[_0x0625('0x54')]=_0x1297e5;return _0x17a815;});}})['then'](respondWithFilteredResult(_0x167a40,_0x203f45))[_0x0625('0x29')](handleError(_0x167a40,null));};exports[_0x0625('0x69')]=function(_0x45c54e,_0x349ddf,_0x430b4c){return db[_0x0625('0x3f')][_0x0625('0x5c')]({'where':{'id':_0x45c54e[_0x0625('0x56')]['id']}})['then'](handleEntityNotFound(_0x349ddf,null))['then'](function(_0x30ad36){if(_0x30ad36){return _0x30ad36[_0x0625('0x69')](_0x45c54e[_0x0625('0x43')]['ids']);}})[_0x0625('0x20')](respondWithStatusCode(_0x349ddf,null))[_0x0625('0x29')](handleError(_0x349ddf,null));};exports[_0x0625('0x6a')]=function(_0x3197e5,_0x53ea24,_0x30d330){if(_0x3197e5['body']['id']){delete _0x3197e5[_0x0625('0x62')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x3197e5[_0x0625('0x56')]['id']}})[_0x0625('0x20')](handleEntityNotFound(_0x53ea24,null))['then'](function(_0x549d20){if(_0x549d20){_0x3197e5['body'][_0x0625('0x65')]=_0x549d20['id'];return db['CannedAnswer'][_0x0625('0x60')](_0x3197e5[_0x0625('0x62')]);}})[_0x0625('0x20')](respondWithResult(_0x53ea24,null))[_0x0625('0x29')](handleError(_0x53ea24,null));};exports[_0x0625('0x6b')]=function(_0x2bfb5d,_0x244a67,_0x59867b){var _0x5787cd={'raw':![],'where':{}};var _0x48c71b={};var _0x5645a0={'count':0x0,'rows':[]};return db[_0x0625('0x3f')]['findOne']({'where':{'id':_0x2bfb5d['params']['id']}})[_0x0625('0x20')](handleEntityNotFound(_0x244a67,null))[_0x0625('0x20')](function(_0x5d78e7){if(_0x5d78e7){_0x48c71b[_0x0625('0x41')]=_['keys'](db['CannedAnswer'][_0x0625('0x57')]);_0x48c71b[_0x0625('0x43')]=_[_0x0625('0x58')](_0x2bfb5d[_0x0625('0x43')]);_0x48c71b[_0x0625('0x44')]=_[_0x0625('0x45')](_0x48c71b[_0x0625('0x41')],_0x48c71b[_0x0625('0x43')]);_0x5787cd[_0x0625('0x46')]=_['intersection'](_0x48c71b[_0x0625('0x41')],qs[_0x0625('0x47')](_0x2bfb5d[_0x0625('0x43')][_0x0625('0x47')]));_0x5787cd[_0x0625('0x46')]=_0x5787cd[_0x0625('0x46')]['length']?_0x5787cd[_0x0625('0x46')]:_0x48c71b[_0x0625('0x41')];if(!_0x2bfb5d[_0x0625('0x43')][_0x0625('0x49')]('nolimit')){_0x5787cd[_0x0625('0x2e')]=qs[_0x0625('0x2e')](_0x2bfb5d['query'][_0x0625('0x2e')]);_0x5787cd[_0x0625('0x2c')]=qs[_0x0625('0x2c')](_0x2bfb5d[_0x0625('0x43')][_0x0625('0x2c')]);}_0x5787cd[_0x0625('0x4b')]=qs['sort'](_0x2bfb5d[_0x0625('0x43')]['sort']);_0x5787cd[_0x0625('0x4d')]=qs[_0x0625('0x44')](_[_0x0625('0x4e')](_0x2bfb5d[_0x0625('0x43')],_0x48c71b[_0x0625('0x44')]));_0x5787cd[_0x0625('0x4d')][_0x0625('0x65')]=_0x5d78e7['id'];if(_0x2bfb5d[_0x0625('0x43')][_0x0625('0x4f')]){_0x5787cd[_0x0625('0x4d')]=_[_0x0625('0x67')](_0x5787cd[_0x0625('0x4d')],{'$or':_[_0x0625('0x3e')](_0x5787cd[_0x0625('0x46')],function(_0x4a3bc5){var _0x23f007={};_0x23f007[_0x4a3bc5]={'$like':'%'+_0x2bfb5d['query'][_0x0625('0x4f')]+'%'};return _0x23f007;})});}_0x5787cd=_['merge']({},_0x5787cd,_0x2bfb5d[_0x0625('0x51')]);return db[_0x0625('0x6c')]['count']({'where':_0x5787cd[_0x0625('0x4d')]})[_0x0625('0x20')](function(_0x48891e){_0x5645a0['count']=_0x48891e;if(_0x2bfb5d['query']['includeAll']){_0x5787cd[_0x0625('0x52')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x5787cd);})['then'](function(_0x495cf8){_0x5645a0[_0x0625('0x54')]=_0x495cf8;return _0x5645a0;});}})[_0x0625('0x20')](respondWithFilteredResult(_0x244a67,_0x5787cd))[_0x0625('0x29')](handleError(_0x244a67,null));};exports[_0x0625('0x6d')]=function(_0x247524,_0x24c121,_0x33c750){return db[_0x0625('0x3f')][_0x0625('0x5c')]({'where':{'id':_0x247524[_0x0625('0x56')]['id']}})[_0x0625('0x20')](handleEntityNotFound(_0x24c121,null))[_0x0625('0x20')](function(_0x1f7415){if(_0x1f7415){return _0x1f7415[_0x0625('0x6d')](_0x247524[_0x0625('0x43')][_0x0625('0x6e')]);}})[_0x0625('0x20')](respondWithStatusCode(_0x24c121,null))[_0x0625('0x29')](handleError(_0x24c121,null));};exports[_0x0625('0x6f')]=function(_0x5bca08,_0xb6aba3,_0x5a3a34){return db['WhatsappAccount'][_0x0625('0x5c')]({'where':{'id':_0x5bca08[_0x0625('0x56')]['id']}})[_0x0625('0x20')](handleEntityNotFound(_0xb6aba3,null))[_0x0625('0x20')](function(_0x2fe771){if(_0x2fe771){return _0x2fe771[_0x0625('0x6f')](_0x5bca08[_0x0625('0x62')][_0x0625('0x6e')],_[_0x0625('0x70')](_0x5bca08[_0x0625('0x62')],['ids','id'])||{})[_0x0625('0x71')](function(_0x7054da){for(var _0x36f21b=0x0;_0x36f21b<_0x5bca08[_0x0625('0x62')][_0x0625('0x6e')][_0x0625('0x48')];_0x36f21b+=0x1){socket['emit']('userWhatsappAccount:save',{'UserId':Number(_0x5bca08[_0x0625('0x62')]['ids'][_0x36f21b]),'WhatsappAccountId':Number(_0x5bca08[_0x0625('0x56')]['id'])});}return _0x7054da;});}})[_0x0625('0x20')](respondWithResult(_0xb6aba3,null))[_0x0625('0x29')](handleError(_0xb6aba3,null));};exports[_0x0625('0x72')]=function(_0x356fa8,_0x1745eb,_0x13644c){return db[_0x0625('0x3f')][_0x0625('0x5c')]({'where':{'id':_0x356fa8[_0x0625('0x56')]['id']}})[_0x0625('0x20')](handleEntityNotFound(_0x1745eb,null))[_0x0625('0x20')](function(_0x163362){if(_0x163362){return _0x163362[_0x0625('0x72')](_0x356fa8[_0x0625('0x43')]['ids'])[_0x0625('0x20')](function(){if(_['isArray'](_0x356fa8['query'][_0x0625('0x6e')])){for(var _0x4cac2f=0x0;_0x4cac2f<_0x356fa8[_0x0625('0x43')][_0x0625('0x6e')][_0x0625('0x48')];_0x4cac2f+=0x1){socket[_0x0625('0x73')](_0x0625('0x74'),{'UserId':Number(_0x356fa8['query'][_0x0625('0x6e')][_0x4cac2f]),'WhatsappAccountId':Number(_0x356fa8[_0x0625('0x56')]['id'])});}}else{socket[_0x0625('0x73')]('userWhatsappAccount:remove',{'UserId':Number(_0x356fa8['query'][_0x0625('0x6e')]),'WhatsappAccountId':Number(_0x356fa8['params']['id'])});}});}})['then'](respondWithStatusCode(_0x1745eb,null))['catch'](handleError(_0x1745eb,null));};exports['getAgents']=function(_0x51658e,_0x56bda9,_0x1627ee){var _0x3fc09e={};var _0x1f8b2c={};var _0x4937b8;var _0x372630;return db[_0x0625('0x3f')][_0x0625('0x75')]({'where':{'id':_0x51658e['params']['id']}})[_0x0625('0x20')](handleEntityNotFound(_0x56bda9,null))['then'](function(_0x2644b0){if(_0x2644b0){_0x4937b8=_0x2644b0;_0x1f8b2c[_0x0625('0x41')]=_[_0x0625('0x58')](db[_0x0625('0x76')][_0x0625('0x57')]);_0x1f8b2c[_0x0625('0x43')]=_[_0x0625('0x58')](_0x51658e[_0x0625('0x43')]);_0x1f8b2c[_0x0625('0x44')]=_['intersection'](_0x1f8b2c[_0x0625('0x41')],_0x1f8b2c['query']);_0x3fc09e[_0x0625('0x46')]=_[_0x0625('0x45')](_0x1f8b2c['model'],qs['fields'](_0x51658e[_0x0625('0x43')]['fields']));_0x3fc09e['attributes']=_0x3fc09e['attributes'][_0x0625('0x48')]?_0x3fc09e[_0x0625('0x46')]:_0x1f8b2c[_0x0625('0x41')];_0x3fc09e['order']=qs[_0x0625('0x4c')](_0x51658e['query']['sort']);_0x3fc09e[_0x0625('0x4d')]=qs[_0x0625('0x44')](_[_0x0625('0x4e')](_0x51658e['query'],_0x1f8b2c[_0x0625('0x44')]));if(_0x51658e['query'][_0x0625('0x4f')]){_0x3fc09e[_0x0625('0x4d')]=_['merge'](_0x3fc09e[_0x0625('0x4d')],{'$or':_[_0x0625('0x3e')](_0x3fc09e['attributes'],function(_0x4fe6be){var _0x57e66c={};_0x57e66c[_0x4fe6be]={'$like':'%'+_0x51658e[_0x0625('0x43')][_0x0625('0x4f')]+'%'};return _0x57e66c;})});}_0x3fc09e=_[_0x0625('0x67')]({},_0x3fc09e,_0x51658e[_0x0625('0x51')]);return _0x4937b8[_0x0625('0x77')](_0x3fc09e);}})[_0x0625('0x20')](function(_0x5f3e68){if(_0x5f3e68){_0x372630=_0x5f3e68[_0x0625('0x48')];if(!_0x51658e[_0x0625('0x43')][_0x0625('0x49')](_0x0625('0x4a'))){_0x3fc09e[_0x0625('0x2e')]=qs['limit'](_0x51658e['query']['limit']);_0x3fc09e[_0x0625('0x2c')]=qs[_0x0625('0x2c')](_0x51658e['query'][_0x0625('0x2c')]);}return _0x4937b8['getAgents'](_0x3fc09e);}})[_0x0625('0x20')](function(_0x18194d){if(_0x18194d){return _0x18194d?{'count':_0x372630,'rows':_0x18194d}:null;}})[_0x0625('0x20')](respondWithResult(_0x56bda9,null))[_0x0625('0x29')](handleError(_0x56bda9,null));};exports[_0x0625('0x78')]=function(_0x413212,_0x49a49f){var _0x4d6319=_0x413212['params']['id'];var _0x5806dc=_0x413212['body'];var _0x48c552=0xc8;var _0x242ae6=null;return db[_0x0625('0x79')]['transaction']({'isolationLevel':db[_0x0625('0x79')]['Transaction'][_0x0625('0x7a')]['READ_COMMITTED']},function(_0x393011){return db[_0x0625('0x3f')][_0x0625('0x75')]({'where':{'id':_0x4d6319},'transaction':_0x393011})['then'](function(_0x2b2d90){if(_0x2b2d90){return db['WhatsappApplication'][_0x0625('0x35')]({'where':{'WhatsappAccountId':_0x4d6319},'transaction':_0x393011})[_0x0625('0x20')](function(){var _0x57a94f=_['map'](_0x5806dc,function(_0x28fb8c){_0x28fb8c[_0x0625('0x65')]=_0x4d6319;return _0x28fb8c;});return db[_0x0625('0x7b')]['bulkCreate'](_0x57a94f,{'transaction':_0x393011});});}else{_0x48c552=0x194;_0x242ae6=[];}});})[_0x0625('0x20')](function(){if(_0x48c552!==0x194){return db[_0x0625('0x7b')][_0x0625('0x7c')]({'where':{'WhatsappAccountId':_0x4d6319},'order':_0x0625('0x7d')})[_0x0625('0x20')](function(_0x2169d3){_0x242ae6=_0x2169d3;});}})[_0x0625('0x29')](function(_0x10b0a1){_0x48c552=0x1f4;logger['error'](_0x10b0a1[_0x0625('0x39')]);if(_0x10b0a1[_0x0625('0x42')]){delete _0x10b0a1[_0x0625('0x42')];}_0x242ae6=_0x10b0a1;})[_0x0625('0x7e')](function(){if(_0x242ae6===null){_0x49a49f[_0x0625('0x38')](_0x48c552);}else{if(_0x48c552===0x1f4){_0x49a49f['status'](_0x48c552)['send'](_0x242ae6);}else{_0x49a49f['status'](_0x48c552)[_0x0625('0x7f')](_0x242ae6);}}});};exports[_0x0625('0x80')]=function(_0x24d2ad,_0xe88c30,_0x465fc2){var _0x140605={};var _0x3c1826={};var _0x47f023;var _0x46726e;return db[_0x0625('0x3f')]['findOne']({'where':{'id':_0x24d2ad[_0x0625('0x56')]['id']}})['then'](handleEntityNotFound(_0xe88c30,null))['then'](function(_0x2fedc1){if(_0x2fedc1){_0x47f023=_0x2fedc1;_0x3c1826[_0x0625('0x41')]=_['keys'](db['WhatsappApplication'][_0x0625('0x57')]);_0x3c1826['query']=_[_0x0625('0x58')](_0x24d2ad[_0x0625('0x43')]);_0x3c1826['filters']=_[_0x0625('0x45')](_0x3c1826[_0x0625('0x41')],_0x3c1826['query']);_0x140605[_0x0625('0x46')]=_['intersection'](_0x3c1826[_0x0625('0x41')],qs[_0x0625('0x47')](_0x24d2ad[_0x0625('0x43')]['fields']));_0x140605['attributes']=_0x140605[_0x0625('0x46')]['length']?_0x140605[_0x0625('0x46')]:_0x3c1826[_0x0625('0x41')];_0x140605[_0x0625('0x4b')]=qs[_0x0625('0x4c')](_0x24d2ad[_0x0625('0x43')]['sort']);_0x140605[_0x0625('0x4d')]=qs['filters'](_['pick'](_0x24d2ad['query'],_0x3c1826[_0x0625('0x44')]));if(_0x24d2ad[_0x0625('0x43')][_0x0625('0x4f')]){_0x140605[_0x0625('0x4d')]=_[_0x0625('0x67')](_0x140605[_0x0625('0x4d')],{'$or':_[_0x0625('0x3e')](_0x140605[_0x0625('0x46')],function(_0x5a910f){var _0x645b8a={};_0x645b8a[_0x5a910f]={'$like':'%'+_0x24d2ad[_0x0625('0x43')][_0x0625('0x4f')]+'%'};return _0x645b8a;})});}_0x140605=_['merge']({},_0x140605,_0x24d2ad[_0x0625('0x51')]);return _0x47f023[_0x0625('0x80')](_0x140605);}})[_0x0625('0x20')](function(_0x5d786f){if(_0x5d786f){_0x46726e=_0x5d786f[_0x0625('0x48')];if(!_0x24d2ad[_0x0625('0x43')][_0x0625('0x49')](_0x0625('0x4a'))){_0x140605[_0x0625('0x2e')]=qs[_0x0625('0x2e')](_0x24d2ad[_0x0625('0x43')][_0x0625('0x2e')]);_0x140605[_0x0625('0x2c')]=qs[_0x0625('0x2c')](_0x24d2ad[_0x0625('0x43')][_0x0625('0x2c')]);}return _0x47f023[_0x0625('0x80')](_0x140605);}})['then'](function(_0x8834be){if(_0x8834be){return _0x8834be?{'count':_0x46726e,'rows':_0x8834be}:null;}})[_0x0625('0x20')](respondWithResult(_0xe88c30,null))[_0x0625('0x29')](handleError(_0xe88c30,null));};exports[_0x0625('0x81')]=function(_0x526ad1,_0x5de433,_0x1f1588){var _0x364536={'channel':_0x0625('0x82')};var _0x2e24b1=[];var _0xe0e5d9=[];var _0x11f701={};return db['WhatsappAccount'][_0x0625('0x5c')]({'where':{'id':_0x526ad1[_0x0625('0x56')]['id']},'include':[{'model':db[_0x0625('0x7b')],'as':_0x0625('0x83')}]})[_0x0625('0x20')](handleEntityNotFound(_0x5de433,null))[_0x0625('0x20')](function(_0x2711cf){_0x364536[_0x0625('0x84')]=_0x2711cf;if(_0x364536[_0x0625('0x84')]&&_0x364536[_0x0625('0x84')][_0x0625('0x50')]==='sinch'&&_0x526ad1['body'][_0x0625('0x85')]){if(_0x526ad1[_0x0625('0x62')][_0x0625('0x85')][_0x0625('0x48')]===0x0)return;if(_0x526ad1['body'][_0x0625('0x85')][0x0][_0x0625('0x86')]!==_0x0625('0x87'))return;return db[_0x0625('0x88')]['update']({'read':!![],'readAt':_0x526ad1[_0x0625('0x62')]['statuses'][0x0][_0x0625('0x89')]},{'where':{'messageId':_0x526ad1[_0x0625('0x62')]['statuses'][0x0][_0x0625('0x8a')]},'individualHooks':!![]})[_0x0625('0x20')](function(_0x1265ca){return _0x5de433['status'](0xc8)[_0x0625('0x7f')](_0x1265ca);});}_0x364536[_0x0625('0x8b')]=_['orderBy'](_0x2711cf[_0x0625('0x83')],[_0x0625('0x7d')],[_0x0625('0x8c')]);if(_0x364536[_0x0625('0x84')]['Applications']){delete _0x364536[_0x0625('0x84')][_0x0625('0x83')];}return db[_0x0625('0x8d')]['describe']()['then'](function(_0x2b62f2){if(!_0x2b62f2){throw new db[(_0x0625('0x8e'))][(_0x0625('0x8f'))]('no\x20available\x20attributes');}_0x2e24b1=_[_0x0625('0x90')](_[_0x0625('0x58')](_0x2b62f2),[_0x0625('0x91'),_0x0625('0x92')]);_0xe0e5d9=_['difference'](_['keys'](_0x2b62f2),['createdAt',_0x0625('0x92'),_0x0625('0x93'),_0x0625('0x94')]);_0x364536[_0x0625('0x62')]={'mapKey':_0x0625('0x95')};if(_0x364536[_0x0625('0x84')]&&_0x364536['account'][_0x0625('0x50')]==='twilio'){_0x364536['body']['from']=_0x526ad1['body'][_0x0625('0x96')][_0x0625('0x97')](_0x0625('0x98'),'');_0x364536[_0x0625('0x62')][_0x0625('0x62')]=_0x526ad1[_0x0625('0x62')]['Body'];_0x364536[_0x0625('0x62')][_0x0625('0x99')]=_0x526ad1[_0x0625('0x62')][_0x0625('0x9a')];}if(_0x364536[_0x0625('0x84')]&&_0x364536['account'][_0x0625('0x50')]==='sinch'){_0x364536['body']['from']=_0x526ad1[_0x0625('0x62')][_0x0625('0x9b')][0x0]['from'];_0x364536[_0x0625('0x62')][_0x0625('0x62')]=_0x526ad1['body'][_0x0625('0x9b')][0x0]['message'][_0x0625('0x62')];_0x364536['body']['messageId']=_0x526ad1['body'][_0x0625('0x9b')][0x0][_0x0625('0x8a')];}if(_0x364536[_0x0625('0x62')]['id']){delete _0x364536[_0x0625('0x62')]['id'];}if(_[_0x0625('0x9c')](_0x364536[_0x0625('0x62')][_0x0625('0x9d')])){throw new db[(_0x0625('0x8e'))][(_0x0625('0x8f'))](_0x0625('0x9e'));}if(_['isNil'](_0x364536[_0x0625('0x62')][_0x0625('0x62')])||_0x364536[_0x0625('0x62')][_0x0625('0x62')]===''){throw new db['Sequelize'][(_0x0625('0x8f'))](_0x0625('0x9f'));}if(_['isNil'](_0x364536[_0x0625('0x62')][_0x0625('0xa0')])){throw new db[(_0x0625('0x8e'))][(_0x0625('0x8f'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xe0e5d9);}if(!_[_0x0625('0xa1')](_0xe0e5d9,_0x364536['body'][_0x0625('0xa0')])){throw new db[(_0x0625('0x8e'))][(_0x0625('0x8f'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xe0e5d9);}_0x11f701[_0x364536['body'][_0x0625('0xa0')]]=_0x364536[_0x0625('0x62')]['from'];return db[_0x0625('0xa2')][_0x0625('0x5c')]({'where':{'id':_0x364536['account'][_0x0625('0x94')]},'include':[{'model':db[_0x0625('0x8d')],'as':_0x0625('0xa3'),'where':_0x11f701,'limit':0x1,'order':[[_0x0625('0x92'),_0x0625('0xa4')]]}]});})[_0x0625('0x20')](handleEntityNotFound(_0x5de433,null))[_0x0625('0x20')](function(_0x39e2c4){if(_0x39e2c4){_0x364536[_0x0625('0xa5')]=_['omit'](_0x39e2c4,[_0x0625('0xa3')]);if(_0x39e2c4[_0x0625('0xa3')]['length']){return _0x39e2c4['Contacts'][0x0];}var _0x2c29bb=_[_0x0625('0xa6')](_0x364536[_0x0625('0x62')],{'firstName':_0x364536[_0x0625('0x62')]['from'],'ListId':_0x39e2c4['id']});_0x2c29bb[_0x364536[_0x0625('0x62')][_0x0625('0xa0')]]=_0x364536[_0x0625('0x62')][_0x0625('0x9d')];return db[_0x0625('0x8d')][_0x0625('0x60')](_0x2c29bb,{'fields':_0x2e24b1,'raw':!![]});}})[_0x0625('0x20')](handleEntityNotFound(_0x5de433,null))[_0x0625('0x20')](function(_0x5c59bc){if(_0x5c59bc){_0x364536['contact']=_0x5c59bc;var _0x3bf4e7={'ContactId':_0x5c59bc['id'],'phone':_0x364536[_0x0625('0x62')]['from'],'WhatsappAccountId':_0x526ad1[_0x0625('0x56')]['id']};var _0x5523d3={'ContactId':_0x5c59bc['id'],'WhatsappAccountId':_0x526ad1['params']['id'],'closed':![]};return db['WhatsappInteraction']['find']({'where':_0x5523d3})['then'](function(_0x4f8817){if(_0x4f8817){return[_0x4f8817,![]];}return db[_0x0625('0xa7')][_0x0625('0x60')](_0x3bf4e7)['then'](function(_0xf92ff6){return[_0xf92ff6,!![]];});});}})[_0x0625('0x71')](function(_0x32a3db,_0x58f44e){_0x364536[_0x0625('0xa8')]=_0x32a3db['get']({'plain':!![]});_0x364536[_0x0625('0xa8')][_0x0625('0xa9')]=![];if(_0x58f44e){if(_0x364536[_0x0625('0x84')][_0x0625('0xaa')]){_0x364536[_0x0625('0x8b')]['push']({'id':0x0,'priority':_0x364536[_0x0625('0x8b')]['length']+0x1,'app':_0x0625('0xab'),'appdata':_0x0625('0xac'),'interval':_0x0625('0xad')});}_0x364536[_0x0625('0xa8')][_0x0625('0xa9')]=!![];}return db[_0x0625('0x88')]['create']({'phone':_0x364536[_0x0625('0x62')][_0x0625('0x9d')],'messageId':_0x364536[_0x0625('0x62')][_0x0625('0x99')],'body':_0x364536[_0x0625('0x62')][_0x0625('0x62')],'WhatsappAccountId':_0x526ad1['params']['id'],'WhatsappInteractionId':_0x32a3db['id'],'direction':'in','ContactId':_0x32a3db[_0x0625('0xae')],'AttachmentId':_0x364536[_0x0625('0x62')][_0x0625('0xaf')]});})[_0x0625('0x20')](function(_0xafea00){_0x364536[_0x0625('0x27')]=_0xafea00;if(_0x364536[_0x0625('0xa8')][_0x0625('0xb0')]){return db[_0x0625('0x76')]['find']({'attributes':['id',_0x0625('0x42')],'where':{'id':_0x364536['interaction'][_0x0625('0xb0')]}})['then'](function(_0x181131){if(_0x181131){_0x364536[_0x0625('0x8b')]['unshift']({'id':0x0,'priority':0x0,'app':_0x0625('0xb1'),'appdata':_0x181131[_0x0625('0x42')]+','+(_0x364536['account'][_0x0625('0xb2')]||0xa),'interval':_0x0625('0xad')});}return respondWithRpcPromise('Start',_0x0625('0xb3'),_0x364536);});}return respondWithRpcPromise(_0x0625('0xb4'),_0x0625('0xb3'),_0x364536);})[_0x0625('0x20')](function(_0x1f995a){if(_0x1f995a){var _0x74d50c=0xc8;var _0x275627=_0x0625('0xb5');logger[_0x0625('0x21')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x275627,_0x74d50c,'entity\x20found');logger[_0x0625('0x24')](_0x0625('0xb6'),_0x275627,_0x74d50c,'entity\x20found',JSON['stringify'](_0x1f995a));if(_0x364536[_0x0625('0x84')][_0x0625('0x50')]===_0x0625('0xb7')){return _0x5de433['status'](_0x74d50c)[_0x0625('0xb8')](_0x0625('0xb9'),_0x0625('0xba'))['send'](_0x0625('0xbb'));}else{return _0x5de433[_0x0625('0x2a')](_0x74d50c)[_0x0625('0x7f')](_0x1f995a);}}});})[_0x0625('0x29')](handleError(_0x5de433,null));};exports[_0x0625('0x3a')]=function(_0x4a1613,_0x248b9d,_0xf9bafb){var _0x101eb2,_0x5c0331,_0x2eab21;if(_[_0x0625('0x9c')](_0x4a1613[_0x0625('0x62')]['body'])||_0x4a1613[_0x0625('0x62')][_0x0625('0x62')]===''){throw new db['Sequelize'][(_0x0625('0x8f'))](_0x0625('0x9f'));}if(_['isNil'](_0x4a1613['body']['to'])){throw new db['Sequelize'][(_0x0625('0x8f'))](_0x0625('0xbc'));}_0x101eb2=_0x4a1613[_0x0625('0x62')]['to'];return db[_0x0625('0x3f')][_0x0625('0x5c')]({'where':{'id':_0x4a1613[_0x0625('0x56')]['id']},'include':[{'model':db[_0x0625('0xa2')],'as':'List','include':[{'model':db[_0x0625('0x8d')],'as':_0x0625('0xa3'),'where':{'mobile':_0x101eb2},'limit':0x1,'order':[[_0x0625('0x92'),_0x0625('0xa4')]]}]}]})[_0x0625('0x20')](handleEntityNotFound(_0x248b9d,null))[_0x0625('0x20')](function(_0x368f15){if(_0x368f15&&_0x368f15[_0x0625('0xbd')]){_0x5c0331=_0x368f15[_0x0625('0x36')]({'plain':!![]});if(_0x5c0331[_0x0625('0xbd')]&&_0x5c0331[_0x0625('0xbd')][_0x0625('0xa3')][_0x0625('0x48')]){return _0x5c0331[_0x0625('0xbd')][_0x0625('0xa3')][0x0];}return db[_0x0625('0x8d')][_0x0625('0x60')](_['defaults'](_0x4a1613[_0x0625('0x62')],{'firstName':_0x101eb2,'mobile':_0x101eb2,'phone':_0x101eb2,'ListId':_0x5c0331[_0x0625('0x94')]}));}})[_0x0625('0x20')](handleEntityNotFound(_0x248b9d,null))['then'](function(_0xec75eb){if(_0xec75eb){_0x2eab21=_0xec75eb;return db['WhatsappInteraction'][_0x0625('0x5c')]({'where':{'ContactId':_0x2eab21['id'],'closed':![],'WhatsappAccountId':_0x5c0331['id']}})[_0x0625('0x20')](function(_0x301311){if(_0x301311){return[_0x301311,![]];}return db['WhatsappInteraction']['create']({'UserId':_0x4a1613['user']['id'],'ContactId':_0x2eab21['id'],'WhatsappAccountId':_0x5c0331['id'],'phone':_0x101eb2,'firstMsgDirection':_0x0625('0xbe'),'Messages':[_[_0x0625('0x67')](_0x4a1613[_0x0625('0x62')],{'read':![],'body':_0x4a1613[_0x0625('0x62')]['body'],'phone':_0x101eb2,'WhatsappAccountId':_0x5c0331['id'],'UserId':_0x4a1613[_0x0625('0x5a')]['id'],'ContactId':_0x2eab21['id']})]},{'include':[{'model':db[_0x0625('0x88')],'as':_0x0625('0xbf')}]})[_0x0625('0x20')](function(_0x391996){return[_0x391996,!![]];});});}})[_0x0625('0x71')](function(_0x6ecd54,_0x5c603d){if(_0x5c603d){return _0x6ecd54;}return db['WhatsappMessage'][_0x0625('0x60')](_['merge'](_0x4a1613[_0x0625('0x62')],{'read':![],'body':_0x4a1613['body'][_0x0625('0x62')],'phone':_0x101eb2,'WhatsappAccountId':_0x5c0331['id'],'WhatsappInteractionId':_0x6ecd54['id'],'UserId':_0x4a1613[_0x0625('0x5a')]['id'],'ContactId':_0x2eab21['id']}))['then'](function(_0x13450f){_0x6ecd54[_0x0625('0xc0')][_0x0625('0xbf')]=[];_0x6ecd54[_0x0625('0xc0')][_0x0625('0xbf')]['push'](_0x13450f[_0x0625('0xc0')]);return _0x6ecd54;});})[_0x0625('0x20')](respondWithResult(_0x248b9d,null))[_0x0625('0x29')](handleError(_0x248b9d,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index d6b92a7..52aee43 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 _0x6181=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','WhatsappAccount'];(function(_0x1318e4,_0x5ac595){var _0x5a6a41=function(_0x2b0784){while(--_0x2b0784){_0x1318e4['push'](_0x1318e4['shift']());}};_0x5a6a41(++_0x5ac595);}(_0x6181,0x1d2));var _0x1618=function(_0x1cd674,_0x8d3638){_0x1cd674=_0x1cd674-0x0;var _0x27928f=_0x6181[_0x1cd674];return _0x27928f;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0x1618('0x0'))['db'][_0x1618('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x1618('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1618('0x3'),'afterDestroy':_0x1618('0x4')};function emitEvent(_0x3348ce){return function(_0x47ec95,_0xe19514,_0x515efb){WhatsappAccountEvents[_0x1618('0x5')](_0x3348ce+':'+_0x47ec95['id'],_0x47ec95);WhatsappAccountEvents['emit'](_0x3348ce,_0x47ec95);_0x515efb(null);};}for(var e in events){if(events[_0x1618('0x6')](e)){var event=events[e];WhatsappAccount[_0x1618('0x7')](e,emitEvent(event));}}module[_0x1618('0x8')]=WhatsappAccountEvents; \ No newline at end of file +var _0x35e2=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappAccount','setMaxListeners','save','update','remove'];(function(_0x4b55e8,_0x41ba7e){var _0x46e844=function(_0x2b1e4f){while(--_0x2b1e4f){_0x4b55e8['push'](_0x4b55e8['shift']());}};_0x46e844(++_0x41ba7e);}(_0x35e2,0x143));var _0x235e=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x35e2[_0x167cc1];return _0x10bc4b;};'use strict';var EventEmitter=require(_0x235e('0x0'));var WhatsappAccount=require(_0x235e('0x1'))['db'][_0x235e('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x235e('0x3')](0x0);var events={'afterCreate':_0x235e('0x4'),'afterUpdate':_0x235e('0x5'),'afterDestroy':_0x235e('0x6')};function emitEvent(_0x522458){return function(_0x18dc30,_0x4aa96b,_0x26f757){WhatsappAccountEvents[_0x235e('0x7')](_0x522458+':'+_0x18dc30['id'],_0x18dc30);WhatsappAccountEvents[_0x235e('0x7')](_0x522458,_0x18dc30);_0x26f757(null);};}for(var e in events){if(events[_0x235e('0x8')](e)){var event=events[e];WhatsappAccount[_0x235e('0x9')](e,emitEvent(event));}}module[_0x235e('0xa')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 50acb39..4b83e7d 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 _0xd3f4=['define','WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x4101ee,_0x5d4684){var _0x15fdc5=function(_0x167b37){while(--_0x167b37){_0x4101ee['push'](_0x4101ee['shift']());}};_0x15fdc5(++_0x5d4684);}(_0xd3f4,0x9f));var _0x4d3f=function(_0x3e11db,_0x1e6fdc){_0x3e11db=_0x3e11db-0x0;var _0x53dbbe=_0xd3f4[_0x3e11db];return _0x53dbbe;};'use strict';var _=require(_0x4d3f('0x0'));var util=require(_0x4d3f('0x1'));var logger=require(_0x4d3f('0x2'))('api');var moment=require(_0x4d3f('0x3'));var BPromise=require(_0x4d3f('0x4'));var rp=require(_0x4d3f('0x5'));var fs=require('fs');var path=require(_0x4d3f('0x6'));var rimraf=require(_0x4d3f('0x7'));var config=require(_0x4d3f('0x8'));var attributes=require('./whatsappAccount.attributes');module[_0x4d3f('0x9')]=function(_0x3650ee,_0x102ab1){return _0x3650ee[_0x4d3f('0xa')](_0x4d3f('0xb'),attributes,{'tableName':_0x4d3f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe3f3=['./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger','api','moment','path','rimraf'];(function(_0x19d829,_0x4247a9){var _0x12b96d=function(_0x461ddb){while(--_0x461ddb){_0x19d829['push'](_0x19d829['shift']());}};_0x12b96d(++_0x4247a9);}(_0xe3f3,0x1a9));var _0x3e3f=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0xe3f3[_0x11c573];return _0x6b72de;};'use strict';var _=require(_0x3e3f('0x0'));var util=require(_0x3e3f('0x1'));var logger=require(_0x3e3f('0x2'))(_0x3e3f('0x3'));var moment=require(_0x3e3f('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3e3f('0x5'));var rimraf=require(_0x3e3f('0x6'));var config=require('../../config/environment');var attributes=require(_0x3e3f('0x7'));module[_0x3e3f('0x8')]=function(_0x4974e3,_0x53ef4c){return _0x4974e3[_0x3e3f('0x9')](_0x3e3f('0xa'),attributes,{'tableName':_0x3e3f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index 7ab4938..d49c527 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 _0x932a=['moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then','info','request\x20sent','debug','error','code','WhatsappAccount,\x20%s,\x20%s','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','where','attributes','model','include','map','stringify','lodash','util'];(function(_0x5105e6,_0x23a09e){var _0x58a6ad=function(_0x351dde){while(--_0x351dde){_0x5105e6['push'](_0x5105e6['shift']());}};_0x58a6ad(++_0x23a09e);}(_0x932a,0x96));var _0xa932=function(_0x4cf9b0,_0x6b6dae){_0x4cf9b0=_0x4cf9b0-0x0;var _0x111d04=_0x932a[_0x4cf9b0];return _0x111d04;};'use strict';var _=require(_0xa932('0x0'));var util=require(_0xa932('0x1'));var moment=require(_0xa932('0x2'));var BPromise=require(_0xa932('0x3'));var rs=require(_0xa932('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa932('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa932('0x6'))('rpc');var config=require(_0xa932('0x7'));var jayson=require(_0xa932('0x8'));var client=jayson['client'][_0xa932('0x9')]({'port':0x232a});config[_0xa932('0xa')]=_[_0xa932('0xb')](config[_0xa932('0xa')],{'host':_0xa932('0xc'),'port':0x18eb});var socket=require(_0xa932('0xd'))(new Redis(config[_0xa932('0xa')]));require(_0xa932('0xe'))[_0xa932('0xf')](socket);function respondWithRpcPromise(_0x5e62be,_0x4f905a,_0x5053db){return new BPromise(function(_0x112402,_0x13e16a){return client[_0xa932('0x10')](_0x5e62be,_0x5053db)[_0xa932('0x11')](function(_0x5e84db){logger[_0xa932('0x12')]('WhatsappAccount,\x20%s,\x20%s',_0x4f905a,_0xa932('0x13'));logger[_0xa932('0x14')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x4f905a,_0xa932('0x13'),JSON['stringify'](_0x5e84db));if(_0x5e84db['error']){if(_0x5e84db[_0xa932('0x15')][_0xa932('0x16')]===0x1f4){logger[_0xa932('0x15')](_0xa932('0x17'),_0x4f905a,_0x5e84db[_0xa932('0x15')][_0xa932('0x18')]);return _0x13e16a(_0x5e84db[_0xa932('0x15')]['message']);}logger[_0xa932('0x15')](_0xa932('0x17'),_0x4f905a,_0x5e84db[_0xa932('0x15')]['message']);return _0x112402(_0x5e84db[_0xa932('0x15')][_0xa932('0x18')]);}else{logger[_0xa932('0x12')](_0xa932('0x17'),_0x4f905a,_0xa932('0x13'));_0x112402(_0x5e84db[_0xa932('0x19')][_0xa932('0x18')]);}})[_0xa932('0x1a')](function(_0x4fcd81){logger[_0xa932('0x15')](_0xa932('0x17'),_0x4f905a,_0x4fcd81);_0x13e16a(_0x4fcd81);});});}exports[_0xa932('0x1b')]=function(_0x21e85c){var _0x65f042=this;return new Promise(function(_0x38408d,_0x8b0b29){return db[_0xa932('0x1c')][_0xa932('0x1d')]({'raw':_0x21e85c[_0xa932('0x1e')]?_0x21e85c['options'][_0xa932('0x1f')]===undefined?!![]:![]:!![],'where':_0x21e85c[_0xa932('0x1e')]?_0x21e85c['options'][_0xa932('0x20')]||null:null,'attributes':_0x21e85c[_0xa932('0x1e')]?_0x21e85c[_0xa932('0x1e')][_0xa932('0x21')]||null:null,'include':_0x21e85c[_0xa932('0x1e')]?_0x21e85c[_0xa932('0x1e')]['include']?_['map'](_0x21e85c[_0xa932('0x1e')]['include'],function(_0x4026f6){return{'model':db[_0x4026f6[_0xa932('0x22')]],'as':_0x4026f6['as'],'attributes':_0x4026f6[_0xa932('0x21')],'include':_0x4026f6[_0xa932('0x23')]?_[_0xa932('0x24')](_0x4026f6['include'],function(_0x3adfb6){return{'model':db[_0x3adfb6[_0xa932('0x22')]],'as':_0x3adfb6['as'],'attributes':_0x3adfb6[_0xa932('0x21')],'include':_0x3adfb6['include']?_[_0xa932('0x24')](_0x3adfb6['include'],function(_0x269541){return{'model':db[_0x269541[_0xa932('0x22')]],'as':_0x269541['as'],'attributes':_0x269541[_0xa932('0x21')]};}):[]};}):[]};}):[]:[]})[_0xa932('0x11')](function(_0x42437c){logger[_0xa932('0x12')](_0xa932('0x1b'),_0x21e85c);logger[_0xa932('0x14')](_0xa932('0x1b'),_0x21e85c,JSON[_0xa932('0x25')](_0x42437c));_0x38408d(_0x42437c);})[_0xa932('0x1a')](function(_0x18b89c){logger[_0xa932('0x15')]('ShowWhatsappAccount',_0x18b89c[_0xa932('0x18')],_0x21e85c);_0x8b0b29(_0x65f042[_0xa932('0x15')](0x1f4,_0x18b89c[_0xa932('0x18')]));});});}; \ No newline at end of file +var _0xebd5=['socket.io-emitter','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','message','result','ShowWhatsappAccount','WhatsappAccount','options','where','include','model','attributes','map','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x543034,_0x525727){var _0x1b92be=function(_0x547bc6){while(--_0x547bc6){_0x543034['push'](_0x543034['shift']());}};_0x1b92be(++_0x525727);}(_0xebd5,0xf4));var _0x5ebd=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xebd5[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x5ebd('0x0'));var util=require(_0x5ebd('0x1'));var moment=require('moment');var BPromise=require(_0x5ebd('0x2'));var rs=require(_0x5ebd('0x3'));var fs=require('fs');var Redis=require(_0x5ebd('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5ebd('0x5'));var logger=require(_0x5ebd('0x6'))(_0x5ebd('0x7'));var config=require(_0x5ebd('0x8'));var jayson=require(_0x5ebd('0x9'));var client=jayson[_0x5ebd('0xa')][_0x5ebd('0xb')]({'port':0x232a});config[_0x5ebd('0xc')]=_[_0x5ebd('0xd')](config[_0x5ebd('0xc')],{'host':_0x5ebd('0xe'),'port':0x18eb});var socket=require(_0x5ebd('0xf'))(new Redis(config['redis']));require(_0x5ebd('0x10'))[_0x5ebd('0x11')](socket);function respondWithRpcPromise(_0xcc4be3,_0x256f00,_0x2779a8){return new BPromise(function(_0x36dc53,_0x46f5ec){return client[_0x5ebd('0x12')](_0xcc4be3,_0x2779a8)[_0x5ebd('0x13')](function(_0x450196){logger[_0x5ebd('0x14')](_0x5ebd('0x15'),_0x256f00,_0x5ebd('0x16'));logger[_0x5ebd('0x17')](_0x5ebd('0x18'),_0x256f00,_0x5ebd('0x16'),JSON['stringify'](_0x450196));if(_0x450196[_0x5ebd('0x19')]){if(_0x450196['error']['code']===0x1f4){logger[_0x5ebd('0x19')](_0x5ebd('0x15'),_0x256f00,_0x450196[_0x5ebd('0x19')][_0x5ebd('0x1a')]);return _0x46f5ec(_0x450196[_0x5ebd('0x19')][_0x5ebd('0x1a')]);}logger[_0x5ebd('0x19')](_0x5ebd('0x15'),_0x256f00,_0x450196[_0x5ebd('0x19')][_0x5ebd('0x1a')]);return _0x36dc53(_0x450196[_0x5ebd('0x19')][_0x5ebd('0x1a')]);}else{logger[_0x5ebd('0x14')]('WhatsappAccount,\x20%s,\x20%s',_0x256f00,_0x5ebd('0x16'));_0x36dc53(_0x450196[_0x5ebd('0x1b')][_0x5ebd('0x1a')]);}})['catch'](function(_0x3e4fc0){logger['error'](_0x5ebd('0x15'),_0x256f00,_0x3e4fc0);_0x46f5ec(_0x3e4fc0);});});}exports[_0x5ebd('0x1c')]=function(_0x43e1a6){var _0x21260c=this;return new Promise(function(_0xbefe43,_0x459a48){return db[_0x5ebd('0x1d')]['find']({'raw':_0x43e1a6[_0x5ebd('0x1e')]?_0x43e1a6[_0x5ebd('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x43e1a6[_0x5ebd('0x1e')]?_0x43e1a6[_0x5ebd('0x1e')][_0x5ebd('0x1f')]||null:null,'attributes':_0x43e1a6[_0x5ebd('0x1e')]?_0x43e1a6['options']['attributes']||null:null,'include':_0x43e1a6[_0x5ebd('0x1e')]?_0x43e1a6[_0x5ebd('0x1e')][_0x5ebd('0x20')]?_['map'](_0x43e1a6[_0x5ebd('0x1e')][_0x5ebd('0x20')],function(_0x10fe07){return{'model':db[_0x10fe07[_0x5ebd('0x21')]],'as':_0x10fe07['as'],'attributes':_0x10fe07[_0x5ebd('0x22')],'include':_0x10fe07['include']?_[_0x5ebd('0x23')](_0x10fe07['include'],function(_0x4d3ddd){return{'model':db[_0x4d3ddd[_0x5ebd('0x21')]],'as':_0x4d3ddd['as'],'attributes':_0x4d3ddd[_0x5ebd('0x22')],'include':_0x4d3ddd[_0x5ebd('0x20')]?_[_0x5ebd('0x23')](_0x4d3ddd[_0x5ebd('0x20')],function(_0x1d3ca5){return{'model':db[_0x1d3ca5[_0x5ebd('0x21')]],'as':_0x1d3ca5['as'],'attributes':_0x1d3ca5[_0x5ebd('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f617c){logger[_0x5ebd('0x14')](_0x5ebd('0x1c'),_0x43e1a6);logger['debug'](_0x5ebd('0x1c'),_0x43e1a6,JSON['stringify'](_0x1f617c));_0xbefe43(_0x1f617c);})[_0x5ebd('0x24')](function(_0x403e0b){logger[_0x5ebd('0x19')]('ShowWhatsappAccount',_0x403e0b[_0x5ebd('0x1a')],_0x43e1a6);_0x459a48(_0x21260c[_0x5ebd('0x19')](0x1f4,_0x403e0b[_0x5ebd('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 1ca9053..9ca8909 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 _0x3aaa=['removeListener','register','length','whatsappAccount:','./whatsappAccount.events','save','remove','update','emit'];(function(_0x25319c,_0x3b70b0){var _0x5dd63f=function(_0x41b52e){while(--_0x41b52e){_0x25319c['push'](_0x25319c['shift']());}};_0x5dd63f(++_0x3b70b0);}(_0x3aaa,0xaf));var _0xa3aa=function(_0x492a98,_0x59d276){_0x492a98=_0x492a98-0x0;var _0x5081a2=_0x3aaa[_0x492a98];return _0x5081a2;};'use strict';var WhatsappAccountEvents=require(_0xa3aa('0x0'));var events=[_0xa3aa('0x1'),_0xa3aa('0x2'),_0xa3aa('0x3')];function createListener(_0x3d4e67,_0x461185){return function(_0x42bce6){_0x461185[_0xa3aa('0x4')](_0x3d4e67,_0x42bce6);};}function removeListener(_0x455ca9,_0x352977){return function(){WhatsappAccountEvents[_0xa3aa('0x5')](_0x455ca9,_0x352977);};}exports[_0xa3aa('0x6')]=function(_0x3726af){for(var _0x2d9322=0x0,_0x413b43=events[_0xa3aa('0x7')];_0x2d9322<_0x413b43;_0x2d9322++){var _0x6724e1=events[_0x2d9322];var _0x18b6b9=createListener(_0xa3aa('0x8')+_0x6724e1,_0x3726af);WhatsappAccountEvents['on'](_0x6724e1,_0x18b6b9);}}; \ No newline at end of file +var _0xd66e=['length','save','update','emit','removeListener'];(function(_0x5c02a2,_0x19acb9){var _0x599f58=function(_0x3df9af){while(--_0x3df9af){_0x5c02a2['push'](_0x5c02a2['shift']());}};_0x599f58(++_0x19acb9);}(_0xd66e,0x173));var _0xed66=function(_0x40f4d3,_0x2c163c){_0x40f4d3=_0x40f4d3-0x0;var _0x342be1=_0xd66e[_0x40f4d3];return _0x342be1;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0xed66('0x0'),'remove',_0xed66('0x1')];function createListener(_0x1c88d9,_0x2bb72b){return function(_0x42ef99){_0x2bb72b[_0xed66('0x2')](_0x1c88d9,_0x42ef99);};}function removeListener(_0x14ade3,_0x25e72e){return function(){WhatsappAccountEvents[_0xed66('0x3')](_0x14ade3,_0x25e72e);};}exports['register']=function(_0x425729){for(var _0x4ca99f=0x0,_0x51e19c=events[_0xed66('0x4')];_0x4ca99f<_0x51e19c;_0x4ca99f++){var _0x2ec35c=events[_0x4ca99f];var _0x217b06=createListener('whatsappAccount:'+_0x2ec35c,_0x425729);WhatsappAccountEvents['on'](_0x2ec35c,_0x217b06);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index a246c72..bb70136 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 _0x3377=['isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller'];(function(_0x5e4223,_0x5b55c2){var _0x1e4144=function(_0x10a84b){while(--_0x10a84b){_0x5e4223['push'](_0x5e4223['shift']());}};_0x1e4144(++_0x5b55c2);}(_0x3377,0x109));var _0x7337=function(_0x5ee4f4,_0xdcf1ff){_0x5ee4f4=_0x5ee4f4-0x0;var _0x19a957=_0x3377[_0x5ee4f4];return _0x19a957;};'use strict';var multer=require(_0x7337('0x0'));var util=require(_0x7337('0x1'));var path=require(_0x7337('0x2'));var timeout=require(_0x7337('0x3'));var express=require(_0x7337('0x4'));var router=express[_0x7337('0x5')]();var fs_extra=require(_0x7337('0x6'));var auth=require(_0x7337('0x7'));var interaction=require(_0x7337('0x8'));var config=require(_0x7337('0x9'));var controller=require(_0x7337('0xa'));router['get']('/',auth[_0x7337('0xb')](),controller[_0x7337('0xc')]);router[_0x7337('0xd')](_0x7337('0xe'),auth[_0x7337('0xb')](),controller[_0x7337('0xf')]);router[_0x7337('0x10')]('/',auth[_0x7337('0xb')](),controller[_0x7337('0x11')]);router[_0x7337('0x12')](_0x7337('0xe'),auth['isAuthenticated'](),controller[_0x7337('0x13')]);router[_0x7337('0x14')]('/:id',auth[_0x7337('0xb')](),controller[_0x7337('0x15')]);module[_0x7337('0x16')]=router; \ No newline at end of file +var _0x85c8=['get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x44cec6,_0x5d8fbe){var _0x42562e=function(_0x59907b){while(--_0x59907b){_0x44cec6['push'](_0x44cec6['shift']());}};_0x42562e(++_0x5d8fbe);}(_0x85c8,0x197));var _0x885c=function(_0x1cf9b7,_0x2c101d){_0x1cf9b7=_0x1cf9b7-0x0;var _0x1ddc85=_0x85c8[_0x1cf9b7];return _0x1ddc85;};'use strict';var multer=require(_0x885c('0x0'));var util=require('util');var path=require(_0x885c('0x1'));var timeout=require(_0x885c('0x2'));var express=require(_0x885c('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x885c('0x4'));var interaction=require(_0x885c('0x5'));var config=require(_0x885c('0x6'));var controller=require('./whatsappApplication.controller');router[_0x885c('0x7')]('/',auth[_0x885c('0x8')](),controller['index']);router[_0x885c('0x7')]('/:id',auth[_0x885c('0x8')](),controller[_0x885c('0x9')]);router[_0x885c('0xa')]('/',auth[_0x885c('0x8')](),controller[_0x885c('0xb')]);router[_0x885c('0xc')](_0x885c('0xd'),auth[_0x885c('0x8')](),controller[_0x885c('0xe')]);router[_0x885c('0xf')](_0x885c('0xd'),auth[_0x885c('0x8')](),controller[_0x885c('0x10')]);module[_0x885c('0x11')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 68e2e55..b74c7f0 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 _0x0543=['STRING','*,*,*,*','sequelize','exports','INTEGER','TEXT'];(function(_0x4803a3,_0x260e77){var _0x4ba8f9=function(_0x563a3b){while(--_0x563a3b){_0x4803a3['push'](_0x4803a3['shift']());}};_0x4ba8f9(++_0x260e77);}(_0x0543,0x1c4));var _0x3054=function(_0xba9125,_0x3973d3){_0xba9125=_0xba9125-0x0;var _0x57b896=_0x0543[_0xba9125];return _0x57b896;};'use strict';var Sequelize=require(_0x3054('0x0'));module[_0x3054('0x1')]={'priority':{'type':Sequelize[_0x3054('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x3054('0x3')]()},'description':{'type':Sequelize[_0x3054('0x4')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x3054('0x5')}}; \ No newline at end of file +var _0x64e6=['*,*,*,*','exports','STRING','noop'];(function(_0x5bf23f,_0x1492c3){var _0x4fc117=function(_0x5d1c62){while(--_0x5d1c62){_0x5bf23f['push'](_0x5bf23f['shift']());}};_0x4fc117(++_0x1492c3);}(_0x64e6,0x1e5));var _0x664e=function(_0x13325e,_0x47fe32){_0x13325e=_0x13325e-0x0;var _0x4e37d6=_0x64e6[_0x13325e];return _0x4e37d6;};'use strict';var Sequelize=require('sequelize');module[_0x664e('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x664e('0x1')],'allowNull':![],'defaultValue':_0x664e('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x664e('0x1')]},'interval':{'type':Sequelize[_0x664e('0x1')],'defaultValue':_0x664e('0x3')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 621217d..9609e67 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 _0x4d68=['json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','then','error','name','send','map','WhatsappApplication','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','includeAll','findAll','rows','catch','params','include','options','find','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status'];(function(_0x348c2c,_0x124eb8){var _0xa4435a=function(_0x30050d){while(--_0x30050d){_0x348c2c['push'](_0x348c2c['shift']());}};_0xa4435a(++_0x124eb8);}(_0x4d68,0x1c3));var _0x84d6=function(_0x3299d1,_0x545733){_0x3299d1=_0x3299d1-0x0;var _0x44356e=_0x4d68[_0x3299d1];return _0x44356e;};'use strict';var emlformat=require(_0x84d6('0x0'));var rimraf=require(_0x84d6('0x1'));var zipdir=require(_0x84d6('0x2'));var jsonpatch=require(_0x84d6('0x3'));var rp=require(_0x84d6('0x4'));var moment=require(_0x84d6('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x84d6('0x6'));var util=require('util');var path=require(_0x84d6('0x7'));var sox=require('sox');var csv=require(_0x84d6('0x8'));var ejs=require(_0x84d6('0x9'));var fs=require('fs');var fs_extra=require(_0x84d6('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x84d6('0xb'));var jsforce=require(_0x84d6('0xc'));var deskjs=require(_0x84d6('0xd'));var toCsv=require(_0x84d6('0x8'));var querystring=require('querystring');var Papa=require(_0x84d6('0xe'));var Redis=require('ioredis');var authService=require(_0x84d6('0xf'));var qs=require(_0x84d6('0x10'));var as=require(_0x84d6('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x84d6('0x12'));var utils=require('../../config/utils');var config=require(_0x84d6('0x13'));var licenseUtil=require(_0x84d6('0x14'));var db=require(_0x84d6('0x15'))['db'];function respondWithStatusCode(_0x19e7a9,_0x203c54){_0x203c54=_0x203c54||0xcc;return function(_0x506edc){if(_0x506edc){return _0x19e7a9[_0x84d6('0x16')](_0x203c54);}return _0x19e7a9['status'](_0x203c54)[_0x84d6('0x17')]();};}function respondWithResult(_0x2e6340,_0x1a5d62){_0x1a5d62=_0x1a5d62||0xc8;return function(_0x44b065){if(_0x44b065){return _0x2e6340[_0x84d6('0x18')](_0x1a5d62)[_0x84d6('0x19')](_0x44b065);}};}function respondWithFilteredResult(_0x957ae6,_0x4f39f0){return function(_0x10646e){if(_0x10646e){var _0x41e128=typeof _0x4f39f0[_0x84d6('0x1a')]===_0x84d6('0x1b')&&typeof _0x4f39f0[_0x84d6('0x1c')]==='undefined';var _0x1dd975=_0x10646e[_0x84d6('0x1d')];var _0x579aa8=_0x41e128?0x0:_0x4f39f0[_0x84d6('0x1a')];var _0x47a884=_0x41e128?_0x10646e[_0x84d6('0x1d')]:_0x4f39f0[_0x84d6('0x1a')]+_0x4f39f0[_0x84d6('0x1c')];var _0x2cbfb5;if(_0x47a884>=_0x1dd975){_0x47a884=_0x1dd975;_0x2cbfb5=0xc8;}else{_0x2cbfb5=0xce;}_0x957ae6[_0x84d6('0x18')](_0x2cbfb5);return _0x957ae6['set'](_0x84d6('0x1e'),_0x579aa8+'-'+_0x47a884+'/'+_0x1dd975)[_0x84d6('0x19')](_0x10646e);}return null;};}function patchUpdates(_0x50ec59){return function(_0x4e4634){try{jsonpatch[_0x84d6('0x1f')](_0x4e4634,_0x50ec59,!![]);}catch(_0x5ebfcb){return BPromise['reject'](_0x5ebfcb);}return _0x4e4634[_0x84d6('0x20')]();};}function saveUpdates(_0x256787,_0x24c8fb){return function(_0x576510){if(_0x576510){return _0x576510[_0x84d6('0x21')](_0x256787)['then'](function(_0x5deb1f){return _0x5deb1f;});}return null;};}function removeEntity(_0x26e753,_0x1b86f2){return function(_0x596b7d){if(_0x596b7d){return _0x596b7d[_0x84d6('0x22')]()[_0x84d6('0x23')](function(){_0x26e753[_0x84d6('0x18')](0xcc)[_0x84d6('0x17')]();});}};}function handleEntityNotFound(_0x5deaa5,_0x282fbb){return function(_0x5d9284){if(!_0x5d9284){_0x5deaa5[_0x84d6('0x16')](0x194);}return _0x5d9284;};}function handleError(_0x19b6aa,_0x548ba5){_0x548ba5=_0x548ba5||0x1f4;return function(_0x500a81){logger[_0x84d6('0x24')](_0x500a81['stack']);if(_0x500a81['name']){delete _0x500a81[_0x84d6('0x25')];}_0x19b6aa['status'](_0x548ba5)[_0x84d6('0x26')](_0x500a81);};}exports['index']=function(_0x773fd0,_0x2c76e2){var _0x329926={},_0x37adf9={},_0x7c0074={'count':0x0,'rows':[]};var _0x125a2a=_[_0x84d6('0x27')](db[_0x84d6('0x28')][_0x84d6('0x29')],function(_0x1ebff2){return{'name':_0x1ebff2[_0x84d6('0x2a')],'type':_0x1ebff2[_0x84d6('0x2b')]['key']};});_0x37adf9[_0x84d6('0x2c')]=_[_0x84d6('0x27')](_0x125a2a,_0x84d6('0x25'));_0x37adf9[_0x84d6('0x2d')]=_[_0x84d6('0x2e')](_0x773fd0[_0x84d6('0x2d')]);_0x37adf9[_0x84d6('0x2f')]=_[_0x84d6('0x30')](_0x37adf9['model'],_0x37adf9[_0x84d6('0x2d')]);_0x329926['attributes']=_[_0x84d6('0x30')](_0x37adf9[_0x84d6('0x2c')],qs['fields'](_0x773fd0[_0x84d6('0x2d')][_0x84d6('0x31')]));_0x329926['attributes']=_0x329926[_0x84d6('0x32')][_0x84d6('0x33')]?_0x329926[_0x84d6('0x32')]:_0x37adf9[_0x84d6('0x2c')];if(!_0x773fd0[_0x84d6('0x2d')]['hasOwnProperty'](_0x84d6('0x34'))){_0x329926[_0x84d6('0x1c')]=qs[_0x84d6('0x1c')](_0x773fd0['query'][_0x84d6('0x1c')]);_0x329926['offset']=qs[_0x84d6('0x1a')](_0x773fd0['query']['offset']);}_0x329926[_0x84d6('0x35')]=qs[_0x84d6('0x36')](_0x773fd0[_0x84d6('0x2d')]['sort']);_0x329926[_0x84d6('0x37')]=qs[_0x84d6('0x2f')](_[_0x84d6('0x38')](_0x773fd0['query'],_0x37adf9['filters']),_0x125a2a);if(_0x773fd0['query'][_0x84d6('0x39')]){_0x329926[_0x84d6('0x37')]=_[_0x84d6('0x3a')](_0x329926[_0x84d6('0x37')],{'$or':_[_0x84d6('0x27')](_0x125a2a,function(_0x3b1dd2){if(_0x3b1dd2['type']!=='VIRTUAL'){var _0x30836a={};_0x30836a[_0x3b1dd2[_0x84d6('0x25')]]={'$like':'%'+_0x773fd0[_0x84d6('0x2d')][_0x84d6('0x39')]+'%'};return _0x30836a;}})});}_0x329926=_[_0x84d6('0x3a')]({},_0x329926,_0x773fd0['options']);var _0x59ea9b={'where':_0x329926['where']};return db[_0x84d6('0x28')]['count'](_0x59ea9b)[_0x84d6('0x23')](function(_0x25dccd){_0x7c0074['count']=_0x25dccd;if(_0x773fd0[_0x84d6('0x2d')][_0x84d6('0x3b')]){_0x329926['include']=[{'all':!![]}];}return db[_0x84d6('0x28')][_0x84d6('0x3c')](_0x329926);})[_0x84d6('0x23')](function(_0x4596c6){_0x7c0074[_0x84d6('0x3d')]=_0x4596c6;return _0x7c0074;})['then'](respondWithFilteredResult(_0x2c76e2,_0x329926))[_0x84d6('0x3e')](handleError(_0x2c76e2,null));};exports['show']=function(_0x1165f9,_0x1930af){var _0x95c924={'raw':!![],'where':{'id':_0x1165f9[_0x84d6('0x3f')]['id']}},_0x56ff93={};_0x56ff93[_0x84d6('0x2c')]=_[_0x84d6('0x2e')](db[_0x84d6('0x28')][_0x84d6('0x29')]);_0x56ff93[_0x84d6('0x2d')]=_['keys'](_0x1165f9[_0x84d6('0x2d')]);_0x56ff93['filters']=_['intersection'](_0x56ff93['model'],_0x56ff93[_0x84d6('0x2d')]);_0x95c924['attributes']=_['intersection'](_0x56ff93[_0x84d6('0x2c')],qs[_0x84d6('0x31')](_0x1165f9['query'][_0x84d6('0x31')]));_0x95c924[_0x84d6('0x32')]=_0x95c924[_0x84d6('0x32')][_0x84d6('0x33')]?_0x95c924[_0x84d6('0x32')]:_0x56ff93[_0x84d6('0x2c')];if(_0x1165f9['query']['includeAll']){_0x95c924[_0x84d6('0x40')]=[{'all':!![]}];}_0x95c924=_[_0x84d6('0x3a')]({},_0x95c924,_0x1165f9[_0x84d6('0x41')]);return db[_0x84d6('0x28')][_0x84d6('0x42')](_0x95c924)[_0x84d6('0x23')](handleEntityNotFound(_0x1930af,null))[_0x84d6('0x23')](respondWithResult(_0x1930af,null))['catch'](handleError(_0x1930af,null));};exports['create']=function(_0x1adbdc,_0x5a42fb){return db[_0x84d6('0x28')]['create'](_0x1adbdc[_0x84d6('0x43')],{})[_0x84d6('0x23')](respondWithResult(_0x5a42fb,0xc9))[_0x84d6('0x3e')](handleError(_0x5a42fb,null));};exports[_0x84d6('0x21')]=function(_0x4e4d67,_0x1aae95){if(_0x4e4d67['body']['id']){delete _0x4e4d67[_0x84d6('0x43')]['id'];}return db[_0x84d6('0x28')][_0x84d6('0x42')]({'where':{'id':_0x4e4d67['params']['id']}})['then'](handleEntityNotFound(_0x1aae95,null))[_0x84d6('0x23')](saveUpdates(_0x4e4d67['body'],null))['then'](respondWithResult(_0x1aae95,null))['catch'](handleError(_0x1aae95,null));};exports['destroy']=function(_0x5704cb,_0x12ea8b){return db['WhatsappApplication'][_0x84d6('0x42')]({'where':{'id':_0x5704cb[_0x84d6('0x3f')]['id']}})[_0x84d6('0x23')](handleEntityNotFound(_0x12ea8b,null))[_0x84d6('0x23')](removeEntity(_0x12ea8b,null))[_0x84d6('0x3e')](handleError(_0x12ea8b,null));}; \ No newline at end of file +var _0xa2cb=['undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','WhatsappApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json'];(function(_0x37f6d8,_0x444925){var _0x49f67b=function(_0x54cfe7){while(--_0x54cfe7){_0x37f6d8['push'](_0x37f6d8['shift']());}};_0x49f67b(++_0x444925);}(_0xa2cb,0x7d));var _0xba2c=function(_0xa296a5,_0x44a37d){_0xa296a5=_0xa296a5-0x0;var _0x4a0905=_0xa2cb[_0xa296a5];return _0x4a0905;};'use strict';var emlformat=require(_0xba2c('0x0'));var rimraf=require(_0xba2c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xba2c('0x2'));var rp=require(_0xba2c('0x3'));var moment=require(_0xba2c('0x4'));var BPromise=require(_0xba2c('0x5'));var Mustache=require(_0xba2c('0x6'));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(_0xba2c('0x7'));var _=require('lodash');var squel=require(_0xba2c('0x8'));var crypto=require('crypto');var jsforce=require(_0xba2c('0x9'));var deskjs=require(_0xba2c('0xa'));var toCsv=require('to-csv');var querystring=require(_0xba2c('0xb'));var Papa=require(_0xba2c('0xc'));var Redis=require('ioredis');var authService=require(_0xba2c('0xd'));var qs=require(_0xba2c('0xe'));var as=require(_0xba2c('0xf'));var hardwareService=require(_0xba2c('0x10'));var logger=require('../../config/logger')(_0xba2c('0x11'));var utils=require(_0xba2c('0x12'));var config=require(_0xba2c('0x13'));var licenseUtil=require(_0xba2c('0x14'));var db=require(_0xba2c('0x15'))['db'];function respondWithStatusCode(_0x400762,_0x206bb2){_0x206bb2=_0x206bb2||0xcc;return function(_0x2c7fb4){if(_0x2c7fb4){return _0x400762[_0xba2c('0x16')](_0x206bb2);}return _0x400762[_0xba2c('0x17')](_0x206bb2)['end']();};}function respondWithResult(_0x56fe7c,_0x421d3d){_0x421d3d=_0x421d3d||0xc8;return function(_0x3fc26e){if(_0x3fc26e){return _0x56fe7c[_0xba2c('0x17')](_0x421d3d)[_0xba2c('0x18')](_0x3fc26e);}};}function respondWithFilteredResult(_0x12794c,_0x3fdb17){return function(_0x37de25){if(_0x37de25){var _0x121bbc=typeof _0x3fdb17['offset']===_0xba2c('0x19')&&typeof _0x3fdb17[_0xba2c('0x1a')]===_0xba2c('0x19');var _0x3282ea=_0x37de25[_0xba2c('0x1b')];var _0x48227c=_0x121bbc?0x0:_0x3fdb17[_0xba2c('0x1c')];var _0xe2e0d5=_0x121bbc?_0x37de25['count']:_0x3fdb17['offset']+_0x3fdb17['limit'];var _0x56087a;if(_0xe2e0d5>=_0x3282ea){_0xe2e0d5=_0x3282ea;_0x56087a=0xc8;}else{_0x56087a=0xce;}_0x12794c[_0xba2c('0x17')](_0x56087a);return _0x12794c[_0xba2c('0x1d')](_0xba2c('0x1e'),_0x48227c+'-'+_0xe2e0d5+'/'+_0x3282ea)[_0xba2c('0x18')](_0x37de25);}return null;};}function patchUpdates(_0x42dff6){return function(_0x3e6ab4){try{jsonpatch[_0xba2c('0x1f')](_0x3e6ab4,_0x42dff6,!![]);}catch(_0x14902f){return BPromise[_0xba2c('0x20')](_0x14902f);}return _0x3e6ab4[_0xba2c('0x21')]();};}function saveUpdates(_0x24172f,_0x19b41e){return function(_0x31cd64){if(_0x31cd64){return _0x31cd64[_0xba2c('0x22')](_0x24172f)[_0xba2c('0x23')](function(_0x45a296){return _0x45a296;});}return null;};}function removeEntity(_0x29eee0,_0xf79e4c){return function(_0x5ea429){if(_0x5ea429){return _0x5ea429[_0xba2c('0x24')]()[_0xba2c('0x23')](function(){_0x29eee0[_0xba2c('0x17')](0xcc)[_0xba2c('0x25')]();});}};}function handleEntityNotFound(_0x590f6a,_0x5f134f){return function(_0x199b1d){if(!_0x199b1d){_0x590f6a['sendStatus'](0x194);}return _0x199b1d;};}function handleError(_0x25e164,_0x3622dd){_0x3622dd=_0x3622dd||0x1f4;return function(_0xadee40){logger[_0xba2c('0x26')](_0xadee40[_0xba2c('0x27')]);if(_0xadee40[_0xba2c('0x28')]){delete _0xadee40['name'];}_0x25e164['status'](_0x3622dd)[_0xba2c('0x29')](_0xadee40);};}exports[_0xba2c('0x2a')]=function(_0x19ee5a,_0x46d3f9){var _0x4875f8={},_0x51e6b0={},_0x1ff162={'count':0x0,'rows':[]};var _0x3d7a13=_[_0xba2c('0x2b')](db[_0xba2c('0x2c')][_0xba2c('0x2d')],function(_0x26b5c7){return{'name':_0x26b5c7[_0xba2c('0x2e')],'type':_0x26b5c7[_0xba2c('0x2f')][_0xba2c('0x30')]};});_0x51e6b0[_0xba2c('0x31')]=_[_0xba2c('0x2b')](_0x3d7a13,_0xba2c('0x28'));_0x51e6b0[_0xba2c('0x32')]=_[_0xba2c('0x33')](_0x19ee5a[_0xba2c('0x32')]);_0x51e6b0[_0xba2c('0x34')]=_['intersection'](_0x51e6b0[_0xba2c('0x31')],_0x51e6b0['query']);_0x4875f8[_0xba2c('0x35')]=_[_0xba2c('0x36')](_0x51e6b0[_0xba2c('0x31')],qs[_0xba2c('0x37')](_0x19ee5a[_0xba2c('0x32')][_0xba2c('0x37')]));_0x4875f8['attributes']=_0x4875f8[_0xba2c('0x35')][_0xba2c('0x38')]?_0x4875f8[_0xba2c('0x35')]:_0x51e6b0[_0xba2c('0x31')];if(!_0x19ee5a[_0xba2c('0x32')][_0xba2c('0x39')](_0xba2c('0x3a'))){_0x4875f8[_0xba2c('0x1a')]=qs[_0xba2c('0x1a')](_0x19ee5a['query'][_0xba2c('0x1a')]);_0x4875f8[_0xba2c('0x1c')]=qs[_0xba2c('0x1c')](_0x19ee5a['query'][_0xba2c('0x1c')]);}_0x4875f8[_0xba2c('0x3b')]=qs[_0xba2c('0x3c')](_0x19ee5a[_0xba2c('0x32')]['sort']);_0x4875f8['where']=qs[_0xba2c('0x34')](_['pick'](_0x19ee5a[_0xba2c('0x32')],_0x51e6b0['filters']),_0x3d7a13);if(_0x19ee5a['query'][_0xba2c('0x3d')]){_0x4875f8[_0xba2c('0x3e')]=_[_0xba2c('0x3f')](_0x4875f8[_0xba2c('0x3e')],{'$or':_['map'](_0x3d7a13,function(_0x14b57f){if(_0x14b57f[_0xba2c('0x2f')]!==_0xba2c('0x40')){var _0x5e35b6={};_0x5e35b6[_0x14b57f[_0xba2c('0x28')]]={'$like':'%'+_0x19ee5a[_0xba2c('0x32')][_0xba2c('0x3d')]+'%'};return _0x5e35b6;}})});}_0x4875f8=_[_0xba2c('0x3f')]({},_0x4875f8,_0x19ee5a[_0xba2c('0x41')]);var _0x5419a5={'where':_0x4875f8[_0xba2c('0x3e')]};return db[_0xba2c('0x2c')][_0xba2c('0x1b')](_0x5419a5)[_0xba2c('0x23')](function(_0x146bed){_0x1ff162['count']=_0x146bed;if(_0x19ee5a['query'][_0xba2c('0x42')]){_0x4875f8[_0xba2c('0x43')]=[{'all':!![]}];}return db['WhatsappApplication'][_0xba2c('0x44')](_0x4875f8);})[_0xba2c('0x23')](function(_0x1e2ad8){_0x1ff162[_0xba2c('0x45')]=_0x1e2ad8;return _0x1ff162;})[_0xba2c('0x23')](respondWithFilteredResult(_0x46d3f9,_0x4875f8))[_0xba2c('0x46')](handleError(_0x46d3f9,null));};exports[_0xba2c('0x47')]=function(_0x381857,_0x40eb6c){var _0x501df5={'raw':!![],'where':{'id':_0x381857[_0xba2c('0x48')]['id']}},_0x3fddfd={};_0x3fddfd[_0xba2c('0x31')]=_['keys'](db[_0xba2c('0x2c')][_0xba2c('0x2d')]);_0x3fddfd[_0xba2c('0x32')]=_['keys'](_0x381857[_0xba2c('0x32')]);_0x3fddfd[_0xba2c('0x34')]=_[_0xba2c('0x36')](_0x3fddfd[_0xba2c('0x31')],_0x3fddfd['query']);_0x501df5[_0xba2c('0x35')]=_[_0xba2c('0x36')](_0x3fddfd[_0xba2c('0x31')],qs[_0xba2c('0x37')](_0x381857[_0xba2c('0x32')][_0xba2c('0x37')]));_0x501df5['attributes']=_0x501df5[_0xba2c('0x35')][_0xba2c('0x38')]?_0x501df5[_0xba2c('0x35')]:_0x3fddfd[_0xba2c('0x31')];if(_0x381857['query']['includeAll']){_0x501df5[_0xba2c('0x43')]=[{'all':!![]}];}_0x501df5=_[_0xba2c('0x3f')]({},_0x501df5,_0x381857['options']);return db[_0xba2c('0x2c')]['find'](_0x501df5)[_0xba2c('0x23')](handleEntityNotFound(_0x40eb6c,null))[_0xba2c('0x23')](respondWithResult(_0x40eb6c,null))['catch'](handleError(_0x40eb6c,null));};exports['create']=function(_0x4250b1,_0x4f6431){return db['WhatsappApplication']['create'](_0x4250b1[_0xba2c('0x49')],{})[_0xba2c('0x23')](respondWithResult(_0x4f6431,0xc9))['catch'](handleError(_0x4f6431,null));};exports[_0xba2c('0x22')]=function(_0x2ec59a,_0x41d277){if(_0x2ec59a[_0xba2c('0x49')]['id']){delete _0x2ec59a['body']['id'];}return db[_0xba2c('0x2c')][_0xba2c('0x4a')]({'where':{'id':_0x2ec59a[_0xba2c('0x48')]['id']}})[_0xba2c('0x23')](handleEntityNotFound(_0x41d277,null))['then'](saveUpdates(_0x2ec59a[_0xba2c('0x49')],null))[_0xba2c('0x23')](respondWithResult(_0x41d277,null))[_0xba2c('0x46')](handleError(_0x41d277,null));};exports['destroy']=function(_0x14b098,_0x585d43){return db[_0xba2c('0x2c')][_0xba2c('0x4a')]({'where':{'id':_0x14b098[_0xba2c('0x48')]['id']}})[_0xba2c('0x23')](handleEntityNotFound(_0x585d43,null))[_0xba2c('0x23')](removeEntity(_0x585d43,null))[_0xba2c('0x46')](handleError(_0x585d43,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 618633d..8216d22 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 _0x24cd=['utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','path','../../config/environment','./whatsappApplication.attributes','define','WhatsappApplication','whatsapp_applications','utf8mb4'];(function(_0x1f3c74,_0x1acefd){var _0x4f3219=function(_0x243341){while(--_0x243341){_0x1f3c74['push'](_0x1f3c74['shift']());}};_0x4f3219(++_0x1acefd);}(_0x24cd,0x83));var _0xd24c=function(_0x5be573,_0x2adad7){_0x5be573=_0x5be573-0x0;var _0x356074=_0x24cd[_0x5be573];return _0x356074;};'use strict';var _=require(_0xd24c('0x0'));var util=require(_0xd24c('0x1'));var logger=require('../../config/logger')(_0xd24c('0x2'));var moment=require('moment');var BPromise=require(_0xd24c('0x3'));var rp=require(_0xd24c('0x4'));var fs=require('fs');var path=require(_0xd24c('0x5'));var rimraf=require('rimraf');var config=require(_0xd24c('0x6'));var attributes=require(_0xd24c('0x7'));module['exports']=function(_0x1c30fc,_0x2721be){return _0x1c30fc[_0xd24c('0x8')](_0xd24c('0x9'),attributes,{'tableName':_0xd24c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd24c('0xb'),'collate':_0xd24c('0xc')});}; \ No newline at end of file +var _0x9d92=['whatsapp_applications','utf8mb4_unicode_ci','lodash','api','moment','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication'];(function(_0x4a83e8,_0x5b3234){var _0xa0adca=function(_0x3379a6){while(--_0x3379a6){_0x4a83e8['push'](_0x4a83e8['shift']());}};_0xa0adca(++_0x5b3234);}(_0x9d92,0xdf));var _0x29d9=function(_0x1305e3,_0x43a724){_0x1305e3=_0x1305e3-0x0;var _0x1068e9=_0x9d92[_0x1305e3];return _0x1068e9;};'use strict';var _=require(_0x29d9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x29d9('0x1'));var moment=require(_0x29d9('0x2'));var BPromise=require('bluebird');var rp=require(_0x29d9('0x3'));var fs=require('fs');var path=require(_0x29d9('0x4'));var rimraf=require(_0x29d9('0x5'));var config=require(_0x29d9('0x6'));var attributes=require(_0x29d9('0x7'));module[_0x29d9('0x8')]=function(_0x27d032,_0x52932b){return _0x27d032[_0x29d9('0x9')](_0x29d9('0xa'),attributes,{'tableName':_0x29d9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x29d9('0xc')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 2f7c387..332f124 100644 --- a/server/api/whatsappApplication/whatsappApplication.rpc.js +++ b/server/api/whatsappApplication/whatsappApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14d=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x4b14b0,_0x3364fc){var _0x2f54ff=function(_0x337b57){while(--_0x337b57){_0x4b14b0['push'](_0x4b14b0['shift']());}};_0x2f54ff(++_0x3364fc);}(_0xe14d,0x1ee));var _0xde14=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0xe14d[_0x5608a3];return _0x1ed50a;};'use strict';var _=require(_0xde14('0x0'));var util=require(_0xde14('0x1'));var moment=require(_0xde14('0x2'));var BPromise=require(_0xde14('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xde14('0x4'));var db=require(_0xde14('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xde14('0x6'))(_0xde14('0x7'));var config=require(_0xde14('0x8'));var jayson=require(_0xde14('0x9'));var client=jayson[_0xde14('0xa')][_0xde14('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b1f6b,_0x5a1344,_0x1bd49d){return new BPromise(function(_0x115b7d,_0x2b0e7c){return client[_0xde14('0xc')](_0x4b1f6b,_0x1bd49d)[_0xde14('0xd')](function(_0x176909){logger[_0xde14('0xe')](_0xde14('0xf'),_0x5a1344,'request\x20sent');logger[_0xde14('0x10')](_0xde14('0x11'),_0x5a1344,_0xde14('0x12'),JSON[_0xde14('0x13')](_0x176909));if(_0x176909[_0xde14('0x14')]){if(_0x176909[_0xde14('0x14')][_0xde14('0x15')]===0x1f4){logger[_0xde14('0x14')](_0xde14('0xf'),_0x5a1344,_0x176909[_0xde14('0x14')][_0xde14('0x16')]);return _0x2b0e7c(_0x176909[_0xde14('0x14')][_0xde14('0x16')]);}logger[_0xde14('0x14')](_0xde14('0xf'),_0x5a1344,_0x176909['error']['message']);return _0x115b7d(_0x176909[_0xde14('0x14')][_0xde14('0x16')]);}else{logger[_0xde14('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0x5a1344,_0xde14('0x12'));_0x115b7d(_0x176909[_0xde14('0x17')][_0xde14('0x16')]);}})[_0xde14('0x18')](function(_0x3de959){logger[_0xde14('0x14')](_0xde14('0xf'),_0x5a1344,_0x3de959);_0x2b0e7c(_0x3de959);});});} \ No newline at end of file +var _0xd6d6=['WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2bff83,_0xc785d9){var _0x4528b6=function(_0x5b4aab){while(--_0x5b4aab){_0x2bff83['push'](_0x2bff83['shift']());}};_0x4528b6(++_0xc785d9);}(_0xd6d6,0xbe));var _0x6d6d=function(_0xe5d84a,_0x43bc0a){_0xe5d84a=_0xe5d84a-0x0;var _0x50c8eb=_0xd6d6[_0xe5d84a];return _0x50c8eb;};'use strict';var _=require(_0x6d6d('0x0'));var util=require(_0x6d6d('0x1'));var moment=require(_0x6d6d('0x2'));var BPromise=require(_0x6d6d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6d6d('0x4'));var db=require(_0x6d6d('0x5'))['db'];var utils=require(_0x6d6d('0x6'));var logger=require(_0x6d6d('0x7'))(_0x6d6d('0x8'));var config=require(_0x6d6d('0x9'));var jayson=require(_0x6d6d('0xa'));var client=jayson['client'][_0x6d6d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1bf731,_0x44f83d,_0x18f824){return new BPromise(function(_0xd49f57,_0x408f88){return client[_0x6d6d('0xc')](_0x1bf731,_0x18f824)['then'](function(_0x51dd38){logger[_0x6d6d('0xd')](_0x6d6d('0xe'),_0x44f83d,_0x6d6d('0xf'));logger[_0x6d6d('0x10')](_0x6d6d('0x11'),_0x44f83d,'request\x20sent',JSON[_0x6d6d('0x12')](_0x51dd38));if(_0x51dd38[_0x6d6d('0x13')]){if(_0x51dd38['error']['code']===0x1f4){logger[_0x6d6d('0x13')](_0x6d6d('0xe'),_0x44f83d,_0x51dd38[_0x6d6d('0x13')][_0x6d6d('0x14')]);return _0x408f88(_0x51dd38[_0x6d6d('0x13')][_0x6d6d('0x14')]);}logger[_0x6d6d('0x13')](_0x6d6d('0xe'),_0x44f83d,_0x51dd38['error'][_0x6d6d('0x14')]);return _0xd49f57(_0x51dd38[_0x6d6d('0x13')][_0x6d6d('0x14')]);}else{logger[_0x6d6d('0xd')](_0x6d6d('0xe'),_0x44f83d,'request\x20sent');_0xd49f57(_0x51dd38[_0x6d6d('0x15')]['message']);}})[_0x6d6d('0x16')](function(_0x2cbc86){logger[_0x6d6d('0x13')]('WhatsappApplication,\x20%s,\x20%s',_0x44f83d,_0x2cbc86);_0x408f88(_0x2cbc86);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index f0ab320..bd3920b 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 _0x02a7=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','isAuthenticated','get','/describe','describe','/:id','getMessages','/:id/download','post','create','/:id/messages','addMessage','tracked','delete','whatsapp','destroy','removeTags','exports','util','express','Router'];(function(_0x599c44,_0x2fb16e){var _0x1d6cf6=function(_0x43f375){while(--_0x43f375){_0x599c44['push'](_0x599c44['shift']());}};_0x1d6cf6(++_0x2fb16e);}(_0x02a7,0x7a));var _0x702a=function(_0x13c18e,_0x3a7398){_0x13c18e=_0x13c18e-0x0;var _0x13bfcf=_0x02a7[_0x13c18e];return _0x13bfcf;};'use strict';var multer=require('multer');var util=require(_0x702a('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x702a('0x1'));var router=express[_0x702a('0x2')]();var fs_extra=require(_0x702a('0x3'));var auth=require(_0x702a('0x4'));var interaction=require(_0x702a('0x5'));var config=require(_0x702a('0x6'));var controller=require(_0x702a('0x7'));router['get']('/',auth[_0x702a('0x8')](),controller['index']);router[_0x702a('0x9')](_0x702a('0xa'),auth[_0x702a('0x8')](),controller[_0x702a('0xb')]);router[_0x702a('0x9')](_0x702a('0xc'),auth[_0x702a('0x8')](),controller['show']);router[_0x702a('0x9')]('/:id/messages',auth['isAuthenticated'](),controller[_0x702a('0xd')]);router[_0x702a('0x9')](_0x702a('0xe'),auth[_0x702a('0x8')](),controller['download']);router[_0x702a('0xf')]('/',auth[_0x702a('0x8')](),controller[_0x702a('0x10')]);router[_0x702a('0xf')](_0x702a('0x11'),auth[_0x702a('0x8')](),controller[_0x702a('0x12')]);router['post']('/:id/tags',auth[_0x702a('0x8')](),interaction['tracked']('whatsapp','whatsappinteraction:addtags'),controller['addTags']);router['put'](_0x702a('0xc'),auth[_0x702a('0x8')](),interaction[_0x702a('0x13')]('whatsapp','whatsappinteraction:update'),controller['update']);router[_0x702a('0x14')](_0x702a('0xc'),auth[_0x702a('0x8')](),interaction['tracked'](_0x702a('0x15'),'whatsappinteraction:destroy'),controller[_0x702a('0x16')]);router[_0x702a('0x14')]('/:id/tags',auth['isAuthenticated'](),controller[_0x702a('0x17')]);module[_0x702a('0x18')]=router; \ No newline at end of file +var _0xd101=['getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','whatsappinteraction:addtags','addTags','put','whatsapp','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages'];(function(_0x106d83,_0x21bc8d){var _0x515d6a=function(_0x32505b){while(--_0x32505b){_0x106d83['push'](_0x106d83['shift']());}};_0x515d6a(++_0x21bc8d);}(_0xd101,0xc1));var _0x1d10=function(_0x24f87b,_0x278771){_0x24f87b=_0x24f87b-0x0;var _0x1ae69f=_0xd101[_0x24f87b];return _0x1ae69f;};'use strict';var multer=require(_0x1d10('0x0'));var util=require('util');var path=require(_0x1d10('0x1'));var timeout=require(_0x1d10('0x2'));var express=require(_0x1d10('0x3'));var router=express[_0x1d10('0x4')]();var fs_extra=require(_0x1d10('0x5'));var auth=require(_0x1d10('0x6'));var interaction=require(_0x1d10('0x7'));var config=require(_0x1d10('0x8'));var controller=require('./whatsappInteraction.controller');router[_0x1d10('0x9')]('/',auth[_0x1d10('0xa')](),controller[_0x1d10('0xb')]);router[_0x1d10('0x9')](_0x1d10('0xc'),auth[_0x1d10('0xa')](),controller[_0x1d10('0xd')]);router[_0x1d10('0x9')](_0x1d10('0xe'),auth[_0x1d10('0xa')](),controller[_0x1d10('0xf')]);router[_0x1d10('0x9')](_0x1d10('0x10'),auth[_0x1d10('0xa')](),controller[_0x1d10('0x11')]);router[_0x1d10('0x9')](_0x1d10('0x12'),auth['isAuthenticated'](),controller[_0x1d10('0x13')]);router[_0x1d10('0x14')]('/',auth[_0x1d10('0xa')](),controller[_0x1d10('0x15')]);router[_0x1d10('0x14')]('/:id/messages',auth[_0x1d10('0xa')](),controller[_0x1d10('0x16')]);router[_0x1d10('0x14')](_0x1d10('0x17'),auth[_0x1d10('0xa')](),interaction[_0x1d10('0x18')]('whatsapp',_0x1d10('0x19')),controller[_0x1d10('0x1a')]);router[_0x1d10('0x1b')](_0x1d10('0xe'),auth['isAuthenticated'](),interaction[_0x1d10('0x18')](_0x1d10('0x1c'),_0x1d10('0x1d')),controller[_0x1d10('0x1e')]);router[_0x1d10('0x1f')](_0x1d10('0xe'),auth[_0x1d10('0xa')](),interaction['tracked'](_0x1d10('0x1c'),_0x1d10('0x20')),controller[_0x1d10('0x21')]);router[_0x1d10('0x1f')](_0x1d10('0x17'),auth['isAuthenticated'](),controller['removeTags']);module[_0x1d10('0x22')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index c649dde..8a75b15 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 _0x6299=['out','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x3335cf,_0x18b5f5){var _0x54a5ea=function(_0x13ef7f){while(--_0x13ef7f){_0x3335cf['push'](_0x3335cf['shift']());}};_0x54a5ea(++_0x18b5f5);}(_0x6299,0x169));var _0x9629=function(_0x2931c9,_0x114ef3){_0x2931c9=_0x2931c9-0x0;var _0x291a09=_0x6299[_0x2931c9];return _0x291a09;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x9629('0x0')]={'closed':{'type':Sequelize[_0x9629('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9629('0x2')]},'disposition':{'type':Sequelize[_0x9629('0x3')]},'secondDisposition':{'type':Sequelize[_0x9629('0x3')]},'thirdDisposition':{'type':Sequelize[_0x9629('0x3')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x9629('0x3')]},'read1stAt':{'type':Sequelize[_0x9629('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x9629('0x4')]('in',_0x9629('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x9629('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x9629('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0x17c4=['out','ENUM','sequelize','moment','exports','BOOLEAN','DATE','STRING'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x17c4,0x102));var _0x417c=function(_0x1c1fda,_0x1b076d){_0x1c1fda=_0x1c1fda-0x0;var _0xd76da7=_0x17c4[_0x1c1fda];return _0xd76da7;};'use strict';var Sequelize=require(_0x417c('0x0'));var moment=require(_0x417c('0x1'));module[_0x417c('0x2')]={'closed':{'type':Sequelize[_0x417c('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x417c('0x4')]},'disposition':{'type':Sequelize[_0x417c('0x5')]},'secondDisposition':{'type':Sequelize[_0x417c('0x5')]},'thirdDisposition':{'type':Sequelize[_0x417c('0x5')]},'note':{'type':Sequelize[_0x417c('0x5')]},'phone':{'type':Sequelize[_0x417c('0x5')]},'read1stAt':{'type':Sequelize[_0x417c('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x417c('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x417c('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x417c('0x7')]('in',_0x417c('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x417c('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index ec7ccda..658d3a0 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 _0x8f25=['QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','sequelize','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','all','show','params','includeAll','include','options','create','describe','addMessage','ids','omit','merge','format','YYYY-MM-DD\x20HH:mm:ss','WhatsappMessage','findAll','spread','Tag','color','emit','whatsappInteractionTags:save','removeTags','download','join','root','server','files','transcript-%d-%s.zip','User','firstName','lastName','attachments','Attachment','Messages','secret','WhatsappAccount','Account','mkdirSync','Owner','N.A.','closedAt','disposition','basename','existsSync','createReadStream','pipe','direction','renderFile','views','transcript-','.pdf','createPdfFromHTML','log','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','limit','undefined','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','Users','map','fullname','Tags','TagIds','forEach','push','catch','answered','unmanaged','closed','UserId','waiting','talking','total','index','WhatsappInteraction','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','from','tools_tags','u.id','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','whatsapp_interactions','cm_contacts','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','expr','parseSearch','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','Contact','$substring','split','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','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','start','body','some','compact','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize'];(function(_0x1ab185,_0x344169){var _0x5a6eec=function(_0x2199f6){while(--_0x2199f6){_0x1ab185['push'](_0x1ab185['shift']());}};_0x5a6eec(++_0x344169);}(_0x8f25,0x14b));var _0x58f2=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x8f25[_0x24237f];return _0x48298e;};'use strict';var emlformat=require(_0x58f2('0x0'));var rimraf=require(_0x58f2('0x1'));var zipdir=require(_0x58f2('0x2'));var jsonpatch=require(_0x58f2('0x3'));var rp=require(_0x58f2('0x4'));var moment=require(_0x58f2('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x58f2('0x6'));var sox=require(_0x58f2('0x7'));var csv=require(_0x58f2('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x58f2('0x9'));var _=require(_0x58f2('0xa'));var squel=require(_0x58f2('0xb'));var crypto=require(_0x58f2('0xc'));var jsforce=require(_0x58f2('0xd'));var deskjs=require(_0x58f2('0xe'));var toCsv=require(_0x58f2('0x8'));var querystring=require(_0x58f2('0xf'));var Papa=require('papaparse');var Redis=require(_0x58f2('0x10'));var authService=require(_0x58f2('0x11'));var qs=require(_0x58f2('0x12'));var as=require(_0x58f2('0x13'));var pdf=require(_0x58f2('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x58f2('0x15'))(_0x58f2('0x16'));var utils=require(_0x58f2('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x58f2('0x18'));var db=require(_0x58f2('0x19'))['db'];config['redis']=_[_0x58f2('0x1a')](config[_0x58f2('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x58f2('0x1c'))(new Redis(config[_0x58f2('0x1b')]));require(_0x58f2('0x1d'))[_0x58f2('0x1e')](socket);function respondWithStatusCode(_0x879d54,_0x1dc4ac){_0x1dc4ac=_0x1dc4ac||0xcc;return function(_0x44facb){if(_0x44facb){return _0x879d54[_0x58f2('0x1f')](_0x1dc4ac);}return _0x879d54[_0x58f2('0x20')](_0x1dc4ac)[_0x58f2('0x21')]();};}function respondWithResult(_0x256f1f,_0x3f9991){_0x3f9991=_0x3f9991||0xc8;return function(_0x4af52c){if(_0x4af52c){return _0x256f1f[_0x58f2('0x20')](_0x3f9991)['json'](_0x4af52c);}};}function respondWithFilteredResult(_0x2042bf,_0x1db4ad){return function(_0x4e66a4){if(_0x4e66a4){var _0x5f0b9c=typeof _0x1db4ad['offset']==='undefined'&&typeof _0x1db4ad[_0x58f2('0x22')]===_0x58f2('0x23');var _0x48ddb2=_0x4e66a4[_0x58f2('0x24')];var _0x28370e=_0x5f0b9c?0x0:_0x1db4ad[_0x58f2('0x25')];var _0x49ffe2=_0x5f0b9c?_0x4e66a4[_0x58f2('0x24')]:_0x1db4ad[_0x58f2('0x25')]+_0x1db4ad['limit'];var _0x289665;if(_0x49ffe2>=_0x48ddb2){_0x49ffe2=_0x48ddb2;_0x289665=0xc8;}else{_0x289665=0xce;}_0x2042bf[_0x58f2('0x20')](_0x289665);return _0x2042bf['set'](_0x58f2('0x26'),_0x28370e+'-'+_0x49ffe2+'/'+_0x48ddb2)[_0x58f2('0x27')](_0x4e66a4);}return null;};}function patchUpdates(_0x38e0b8){return function(_0x32ff95){try{jsonpatch[_0x58f2('0x28')](_0x32ff95,_0x38e0b8,!![]);}catch(_0x4084a4){return BPromise[_0x58f2('0x29')](_0x4084a4);}return _0x32ff95[_0x58f2('0x2a')]();};}function saveUpdates(_0x3f81c1,_0x8fad73){return function(_0x2a72ba){if(_0x2a72ba){return _0x2a72ba[_0x58f2('0x2b')](_0x3f81c1)[_0x58f2('0x2c')](function(_0xb5f201){return _0xb5f201;});}return null;};}function removeEntity(_0x1224f1,_0x422aa0){return function(_0x4e5b57){if(_0x4e5b57){return _0x4e5b57[_0x58f2('0x2d')]()['then'](function(){_0x1224f1[_0x58f2('0x20')](0xcc)[_0x58f2('0x21')]();});}};}function handleEntityNotFound(_0x2ec718,_0x55e50a){return function(_0x39c49b){if(!_0x39c49b){_0x2ec718[_0x58f2('0x1f')](0x194);}return _0x39c49b;};}function handleError(_0x46db2e,_0x58433b){_0x58433b=_0x58433b||0x1f4;return function(_0x143252){logger[_0x58f2('0x2e')](_0x143252['stack']);if(_0x143252[_0x58f2('0x2f')]){delete _0x143252[_0x58f2('0x2f')];}_0x46db2e[_0x58f2('0x20')](_0x58433b)[_0x58f2('0x30')](_0x143252);};}function getInteractionUsers(_0x5a6296,_0x46386a){return new BPromise(function(_0x492db5,_0x2633f8){try{if(_0x46386a[_0x5a6296['id']]){_0x5a6296[_0x58f2('0x31')]=_[_0x58f2('0x32')](_0x46386a[_0x5a6296['id']],function(_0x3441a7){return{'id':_0x3441a7['id'],'fullname':_0x3441a7[_0x58f2('0x33')]};});}}catch(_0x364e31){_0x2633f8(_0x364e31);}_0x492db5(_0x5a6296);});}function getInteractionTags(_0x5f3b55,_0x1ddbd8){return new BPromise(function(_0xbbd6bd,_0xbd6303){try{if(_0x5f3b55['TagIds']){_0x5f3b55[_0x58f2('0x34')]=[];_0x5f3b55[_0x58f2('0x35')]['split'](',')[_0x58f2('0x36')](function(_0x448fd8){_0x5f3b55[_0x58f2('0x34')][_0x58f2('0x37')](_0x1ddbd8[_0x448fd8]);});}delete _0x5f3b55[_0x58f2('0x35')];}catch(_0x5e29fd){_0xbd6303(_0x5e29fd);}_0xbbd6bd(_0x5f3b55);});}function updateWhatsappInteraction(_0x2cd36a,_0x3f2e73,_0x2cd0b2){return new BPromise(function(_0x3ebf54,_0x460b09){return getInteractionUsers(_0x2cd36a,_0x2cd0b2)[_0x58f2('0x2c')](function(_0x3bede5){return getInteractionTags(_0x3bede5,_0x3f2e73);})['then'](function(_0x4cc7cc){return getStateInteraction(_0x4cc7cc);})[_0x58f2('0x2c')](function(_0x342f70){_0x3ebf54(_0x342f70);})[_0x58f2('0x38')](function(_0x91f87c){_0x460b09(_0x91f87c);});});}function getStateInteraction(_0x502387){return new BPromise(function(_0x23cae9){_0x502387['waiting']=0x0;_0x502387['talking']=0x0;_0x502387[_0x58f2('0x39')]=0x0;_0x502387[_0x58f2('0x3a')]=0x0;_0x502387['total']=0x0;if(!_0x502387[_0x58f2('0x3b')]&&!_0x502387[_0x58f2('0x3c')]){_0x502387[_0x58f2('0x3d')]+=0x1;}if(!_0x502387[_0x58f2('0x3b')]&&_0x502387[_0x58f2('0x3c')]){_0x502387[_0x58f2('0x3e')]+=0x1;if(_0x502387[_0x58f2('0x3d')]){_0x502387['waiting']-=0x1;}}if(_0x502387[_0x58f2('0x3b')]&&_0x502387['UserId']){_0x502387[_0x58f2('0x39')]+=0x1;if(_0x502387[_0x58f2('0x3e')]){_0x502387[_0x58f2('0x3e')]-=0x1;}}if(_0x502387[_0x58f2('0x3b')]&&!_0x502387['UserId']){_0x502387[_0x58f2('0x3a')]+=0x1;if(_0x502387[_0x58f2('0x3d')]){_0x502387[_0x58f2('0x3d')]-=0x1;}}_0x502387[_0x58f2('0x3f')]+=0x1;_0x23cae9(_0x502387);});}exports[_0x58f2('0x40')]=function(_0x20a3c8,_0x3e21fb){var _0x2dbac2={},_0x2d6899={},_0x419276={'count':0x0,'rows':[]};var _0x55a82f=_['map'](db[_0x58f2('0x41')][_0x58f2('0x42')],function(_0x493d89){return{'name':_0x493d89[_0x58f2('0x43')],'type':_0x493d89[_0x58f2('0x44')][_0x58f2('0x45')]};});_0x2d6899[_0x58f2('0x46')]=_[_0x58f2('0x32')](_0x55a82f,_0x58f2('0x2f'));_0x2d6899['query']=_[_0x58f2('0x47')](_0x20a3c8[_0x58f2('0x48')]);_0x2d6899[_0x58f2('0x49')]=_[_0x58f2('0x4a')](_0x2d6899[_0x58f2('0x46')],_0x2d6899[_0x58f2('0x48')]);_0x2dbac2['attributes']=_[_0x58f2('0x4a')](_0x2d6899['model'],qs[_0x58f2('0x4b')](_0x20a3c8['query'][_0x58f2('0x4b')]));_0x2dbac2[_0x58f2('0x4c')]=_0x2dbac2[_0x58f2('0x4c')][_0x58f2('0x4d')]?_0x2dbac2['attributes']:_0x2d6899['model'];if(!_0x20a3c8[_0x58f2('0x48')][_0x58f2('0x4e')](_0x58f2('0x4f'))){_0x2dbac2[_0x58f2('0x22')]=qs['limit'](_0x20a3c8['query'][_0x58f2('0x22')]);_0x2dbac2[_0x58f2('0x25')]=qs[_0x58f2('0x25')](_0x20a3c8[_0x58f2('0x48')]['offset']);}_0x2dbac2[_0x58f2('0x50')]=qs[_0x58f2('0x51')](_0x20a3c8[_0x58f2('0x48')][_0x58f2('0x51')]);_0x2dbac2[_0x58f2('0x52')]=qs[_0x58f2('0x49')](_[_0x58f2('0x53')](_0x20a3c8[_0x58f2('0x48')],_0x2d6899['filters']),_0x55a82f);var _0x21aa0e=[];var _0xdf8b70=squel[_0x58f2('0x54')]()[_0x58f2('0x55')]('id')[_0x58f2('0x55')](_0x58f2('0x2f'))[_0x58f2('0x55')]('color')[_0x58f2('0x56')](_0x58f2('0x57'));var _0x1bd5a7=squel['select']()[_0x58f2('0x55')](_0x58f2('0x58'))[_0x58f2('0x55')]('u.fullname')[_0x58f2('0x55')](_0x58f2('0x59'))[_0x58f2('0x56')](_0x58f2('0x5a'),'ui')[_0x58f2('0x5b')](_0x58f2('0x5c'),'u','u.id\x20=\x20ui.UserId');var _0x2369e0=squel[_0x58f2('0x54')]()[_0x58f2('0x56')](_0x58f2('0x5d'),'i')[_0x58f2('0x5b')](_0x58f2('0x5e'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x58f2('0x5b')](_0x58f2('0x5c'),'o',_0x58f2('0x5f'))['left_join'](_0x58f2('0x60'),'a',_0x58f2('0x61'))['left_join'](_0x58f2('0x62'),'me',_0x58f2('0x63'))[_0x58f2('0x5b')](_0x58f2('0x64'),'it',_0x58f2('0x65'))[_0x58f2('0x5b')](_0x58f2('0x57'),'t','t.id\x20=\x20it.TagId');var _0x5ace9f=squel[_0x58f2('0x66')]();var _0x583004=[];var _0x16d66a=squel['expr']();var _0x3f2adb;if(_0x20a3c8[_0x58f2('0x48')]['search']){_0x3f2adb=as[_0x58f2('0x67')](_0x20a3c8['query'][_0x58f2('0x68')]);var _0x110d7b=_0x3f2adb[_0x58f2('0x69')];for(var _0x422580=0x0;_0x422580<_0x3f2adb[_0x58f2('0x6a')][_0x58f2('0x4d')];_0x422580++){var _0x76ed06=_0x3f2adb[_0x58f2('0x6a')][_0x422580];var _0x3f8e32='i';var _0x5110ca=_[_0x58f2('0x6b')](_0x55a82f,[_0x58f2('0x2f'),_0x76ed06['field']]);if(!_0x5110ca){switch(_0x76ed06[_0x58f2('0x55')]){case _0x58f2('0x6c'):if(_0x76ed06[_0x58f2('0x6d')]==0x1){_0x2369e0[_0x58f2('0x6e')]('`'+_0x76ed06[_0x58f2('0x55')]+_0x58f2('0x6f'));}else{_0x2369e0[_0x58f2('0x6e')]('`'+_0x76ed06['field']+'`\x20>\x200');}break;case _0x58f2('0x70'):if(_0x76ed06['operator']===_0x58f2('0x71')){if(_0x76ed06[_0x58f2('0x6d')][_0x58f2('0x72')]('\x20')['length']>0x1){_0x5ace9f[_0x110d7b](_0x58f2('0x73'),qs['getFullTextValue'](_0x76ed06['value']),null);}else{var _0x46da87='%'+_0x76ed06['value']+'%';_0x5ace9f[_0x110d7b](_0x58f2('0x74'),_0x46da87,_0x46da87,_0x46da87);}}else{_0x5110ca=_[_0x58f2('0x6b')](_0x55a82f,[_0x58f2('0x2f'),'ContactId']);_0x76ed06[_0x58f2('0x55')]=_0x58f2('0x75');_0x42370d=as[_0x58f2('0x76')](_0x3f8e32,_0x5110ca[_0x58f2('0x44')],_0x76ed06);_0x5ace9f[_0x110d7b](_0x42370d['text'],_0x42370d[_0x58f2('0x6d')]['start'],_0x42370d['value'][_0x58f2('0x21')]);}break;case'Tag':var _0x175f3f=_0x76ed06[_0x58f2('0x6d')][_0x58f2('0x72')](',')['map'](function(_0x5f215a){return Number(_0x5f215a);});_0x175f3f['forEach'](function(_0x1358e6){_0x16d66a['or'](_0x58f2('0x77'),'%,'+_0x1358e6+',%');});_0x583004=_[_0x58f2('0x78')](_0x583004,_0x175f3f);break;case'User':if(_0x76ed06[_0x58f2('0x79')]==='$substring'){_0x5ace9f[_0x110d7b](_0x58f2('0x7a'),'%'+_0x76ed06['value']+'%',null);}else{_0x5110ca=_[_0x58f2('0x6b')](_0x55a82f,[_0x58f2('0x2f'),_0x58f2('0x3c')]);_0x76ed06[_0x58f2('0x55')]=_0x58f2('0x3c');_0x42370d=as[_0x58f2('0x76')](_0x3f8e32,_0x5110ca[_0x58f2('0x44')],_0x76ed06);_0x5ace9f[_0x110d7b](_0x42370d[_0x58f2('0x7b')],_0x42370d[_0x58f2('0x6d')][_0x58f2('0x7c')],_0x42370d[_0x58f2('0x6d')]['end']);}break;case _0x58f2('0x7d'):_0x42370d=as[_0x58f2('0x76')]('me',null,_0x76ed06);_0x5ace9f[_0x110d7b](_0x42370d['text'],_0x42370d['value']['start'],_0x42370d[_0x58f2('0x6d')][_0x58f2('0x21')]);break;}}else{var _0x42370d=as[_0x58f2('0x76')](_0x3f8e32,_0x5110ca['type'],_0x76ed06);_0x5ace9f[_0x110d7b](_0x42370d[_0x58f2('0x7b')],_0x42370d[_0x58f2('0x6d')]['start'],_0x42370d['value']['end']);}}}else{var _0x41750f=_(_0x20a3c8[_0x58f2('0x48')])['keys']()[_0x58f2('0x32')](function(_0x272bfd){return _[_0x58f2('0x7e')](_0x55a82f,[_0x58f2('0x2f'),_0x272bfd])?_0x272bfd:undefined;})[_0x58f2('0x7f')]()[_0x58f2('0x6d')]();if(!_[_0x58f2('0x80')](_0x41750f)){_0x41750f[_0x58f2('0x36')](function(_0x5d7572){if(_0x5d7572===_0x58f2('0x81')){_0x2369e0[_0x58f2('0x52')](_0x58f2('0x82'),[][_0x58f2('0x83')](_0x20a3c8[_0x58f2('0x48')][_0x5d7572]));}else if(_0x5d7572===_0x58f2('0x84')){var _0x45c6df=JSON['parse'](_0x20a3c8[_0x58f2('0x48')][_0x5d7572])[_0x58f2('0x85')];var _0x47b7de=JSON[_0x58f2('0x86')](_0x20a3c8['query'][_0x5d7572])[_0x58f2('0x87')];_0x2369e0[_0x58f2('0x52')](_0x58f2('0x88'),_0x45c6df,_0x47b7de);}else{if(_0x20a3c8[_0x58f2('0x48')][_0x5d7572]===_0x58f2('0x89')){_0x2369e0['where']('i.'+_0x5d7572+_0x58f2('0x8a'));}else{_0x2369e0[_0x58f2('0x52')]('i.'+_0x5d7572+_0x58f2('0x8b'),_0x20a3c8['query'][_0x5d7572]);}}});}if(_0x20a3c8['query'][_0x58f2('0x8c')]){if(_0x20a3c8[_0x58f2('0x48')][_0x58f2('0x8c')]==0x1){_0x2369e0[_0x58f2('0x6e')](_0x58f2('0x8d'));}else{_0x2369e0['having'](_0x58f2('0x8e'));}}if(_0x20a3c8[_0x58f2('0x48')][_0x58f2('0x8f')]){_0x583004=_['isArray'](_0x20a3c8[_0x58f2('0x48')][_0x58f2('0x8f')])?_0x20a3c8[_0x58f2('0x48')][_0x58f2('0x8f')]:new Array(_0x20a3c8[_0x58f2('0x48')]['tag']);_0x583004[_0x58f2('0x36')](function(_0x2a945b){_0x16d66a['or'](_0x58f2('0x77'),'%,'+_0x2a945b+',%');});}if(_0x20a3c8['query'][_0x58f2('0x90')]){var _0x4961d5=_0x20a3c8[_0x58f2('0x48')][_0x58f2('0x90')]['replace']('\x5c','\x5c\x5c')[_0x58f2('0x91')](/'/g,'\x27\x27');if(qs[_0x58f2('0x92')](_0x4961d5)){_0x5ace9f['or'](_0x58f2('0x93'),_0x4961d5+'%')['or'](_0x58f2('0x94'),_0x4961d5+'%');}else{_0x5ace9f['or'](_0x58f2('0x95'),qs[_0x58f2('0x96')](_0x4961d5))['or'](_0x58f2('0x97'),_0x4961d5+'%');}}}_0x2369e0[_0x58f2('0x52')](_0x5ace9f);_0x2369e0[_0x58f2('0x98')](_0x58f2('0x99'));var _0x306884={'type':db[_0x58f2('0x9a')][_0x58f2('0x9b')][_0x58f2('0x9c')],'raw':!![]};var _0x325632=_0x2369e0['clone']();_0x325632[_0x58f2('0x55')]('i.id');_0x325632['field'](_0x58f2('0x9d'),_0x58f2('0x6c'));if(_0x2dbac2['order']){_0x2dbac2[_0x58f2('0x50')]['forEach'](function(_0x5380f5){var _0x1ff98d=_0x5380f5[0x0]===_0x58f2('0x9e')?_0x5380f5[0x0]:'i.'+_0x5380f5[0x0];_0x2369e0['order'](_0x1ff98d,_0x5380f5[0x1]==='DESC'?![]:!![]);});}if(!_[_0x58f2('0x80')](_0x583004)){_0x2369e0['having'](_0x16d66a);_0x325632[_0x58f2('0x52')]('t.id\x20IN\x20?',_0x583004);}BPromise[_0x58f2('0x9f')]()[_0x58f2('0x2c')](function(){if(!_0x3f2adb){if(_0x20a3c8['query'][_0x58f2('0x81')])return;_0x325632[_0x58f2('0x52')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');_0x2369e0[_0x58f2('0x52')](_0x58f2('0xa0'));return;}if(_0x20a3c8[_0x58f2('0xa1')][_0x58f2('0xa2')]!==_0x58f2('0xa3'))return;return _0x20a3c8[_0x58f2('0xa1')][_0x58f2('0xa4')]({'attributes':['id'],'raw':!![]})[_0x58f2('0x2c')](function(_0x457a63){if(_[_0x58f2('0x80')](_0x457a63)){_0x325632[_0x58f2('0x52')]('i.WhatsappAccountId\x20IS\x20NULL');_0x2369e0['where'](_0x58f2('0xa5'));}else{_0x325632[_0x58f2('0x52')]('i.WhatsappAccountId\x20IN\x20?',_[_0x58f2('0x32')](_0x457a63,'id'));_0x2369e0['where'](_0x58f2('0x82'),_['map'](_0x457a63,'id'));}});})[_0x58f2('0x2c')](function(){if(_0x20a3c8[_0x58f2('0xa1')][_0x58f2('0xa2')]==='agent'&&!_0x3f2adb&&!_0x20a3c8['query'][_0x58f2('0x81')])return[];return db['sequelize'][_0x58f2('0x48')](_0x325632[_0x58f2('0xa6')](),_0x306884);})[_0x58f2('0x2c')](function(_0x143313){_0x419276['count']=_0x143313['length'];if(_0x419276[_0x58f2('0x24')]===0x0)return[];return db['sequelize'][_0x58f2('0x48')](_0xdf8b70[_0x58f2('0xa6')](),_0x306884)[_0x58f2('0x2c')](function(_0xcfa810){_0x21aa0e=_[_0x58f2('0xa7')](_0xcfa810,'id');_0x306884=_['merge'](_0x306884,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x20a3c8[_0x58f2('0x48')]['fields']){_0x2dbac2[_0x58f2('0x4c')][_0x58f2('0x36')](function(_0x26b691){_0x2369e0['field']('i.'+_0x26b691);});}else{_0x2369e0['field'](_0x58f2('0x9d'),_0x58f2('0x6c'));_0x2369e0['field'](_0x58f2('0xa8'),_0x58f2('0xa9'));_0x2369e0[_0x58f2('0x55')](_0x58f2('0xaa'),'Account.mandatoryDisposition');_0x2369e0[_0x58f2('0x55')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0x58f2('0x9e'));_0x2369e0[_0x58f2('0x55')](_0x58f2('0xab'));_0x2369e0[_0x58f2('0x55')](_0x58f2('0xac'),_0x58f2('0xad'));_0x2369e0[_0x58f2('0x55')](_0x58f2('0xae'),_0x58f2('0xaf'));_0x2369e0[_0x58f2('0x55')](_0x58f2('0xb0'),'Contact.email');_0x2369e0['field'](_0x58f2('0xb1'),_0x58f2('0xb2'));_0x2369e0[_0x58f2('0x55')](_0x58f2('0xb3'),_0x58f2('0xb4'));_0x2369e0[_0x58f2('0x55')]('c.fax',_0x58f2('0xb5'));_0x2369e0[_0x58f2('0x55')]('o.fullname',_0x58f2('0xb6'));_0x2369e0[_0x58f2('0x55')](_0x58f2('0xb7'),'Owner.internal');_0x2369e0[_0x58f2('0x55')](_0x58f2('0xb8'),_0x58f2('0x35'));}if(_0x2dbac2[_0x58f2('0x22')])_0x2369e0['limit'](_0x2dbac2[_0x58f2('0x22')]);if(_0x2dbac2['offset'])_0x2369e0[_0x58f2('0x25')](_0x2dbac2['offset']);return db[_0x58f2('0xb9')][_0x58f2('0x48')](_0x2369e0[_0x58f2('0xa6')](),_0x306884);})[_0x58f2('0x2c')](function(_0x5800a1){if(_0x5800a1['length']>0x0)_0x1bd5a7['where'](_0x58f2('0xba'),_[_0x58f2('0x32')](_0x5800a1,'id'));return db[_0x58f2('0xb9')][_0x58f2('0x48')](_0x1bd5a7[_0x58f2('0xa6')](),_0x306884)[_0x58f2('0x2c')](function(_0x486495){var _0x5ea0d5=_[_0x58f2('0xbb')](_0x486495,_0x58f2('0xbc'));var _0x315ffb=[];_0x5800a1[_0x58f2('0x36')](function(_0x286409){_0x315ffb[_0x58f2('0x37')](updateWhatsappInteraction(_0x286409,_0x21aa0e,_0x5ea0d5));});return BPromise[_0x58f2('0xbd')](_0x315ffb);});});})[_0x58f2('0x2c')](function(_0x5b6f17){_0x419276['rows']=_0x5b6f17;return _0x419276;})['then'](respondWithFilteredResult(_0x3e21fb,_0x2dbac2))['catch'](handleError(_0x3e21fb,null));};exports[_0x58f2('0xbe')]=function(_0x3fd916,_0xbd3540){var _0x5090b5={'raw':![],'where':{'id':_0x3fd916[_0x58f2('0xbf')]['id']}},_0x3541f9={};_0x3541f9[_0x58f2('0x46')]=_[_0x58f2('0x47')](db['WhatsappInteraction'][_0x58f2('0x42')]);_0x3541f9[_0x58f2('0x48')]=_[_0x58f2('0x47')](_0x3fd916[_0x58f2('0x48')]);_0x3541f9['filters']=_[_0x58f2('0x4a')](_0x3541f9[_0x58f2('0x46')],_0x3541f9[_0x58f2('0x48')]);_0x5090b5[_0x58f2('0x4c')]=_[_0x58f2('0x4a')](_0x3541f9[_0x58f2('0x46')],qs['fields'](_0x3fd916['query'][_0x58f2('0x4b')]));_0x5090b5[_0x58f2('0x4c')]=_0x5090b5['attributes'][_0x58f2('0x4d')]?_0x5090b5[_0x58f2('0x4c')]:_0x3541f9[_0x58f2('0x46')];if(_0x3fd916['query'][_0x58f2('0xc0')]){_0x5090b5[_0x58f2('0xc1')]=[{'all':!![]}];}_0x5090b5=_['merge']({},_0x5090b5,_0x3fd916[_0x58f2('0xc2')]);return db[_0x58f2('0x41')][_0x58f2('0x6b')](_0x5090b5)[_0x58f2('0x2c')](handleEntityNotFound(_0xbd3540,null))[_0x58f2('0x2c')](respondWithResult(_0xbd3540,null))[_0x58f2('0x38')](handleError(_0xbd3540,null));};exports['create']=function(_0x365c99,_0x22addd){return db[_0x58f2('0x41')][_0x58f2('0xc3')](_0x365c99[_0x58f2('0x7d')],{})[_0x58f2('0x2c')](respondWithResult(_0x22addd,0xc9))[_0x58f2('0x38')](handleError(_0x22addd,null));};exports[_0x58f2('0x2b')]=function(_0x1b8234,_0x333cb8){if(_0x1b8234[_0x58f2('0x7d')]['id']){delete _0x1b8234[_0x58f2('0x7d')]['id'];}return db[_0x58f2('0x41')][_0x58f2('0x6b')]({'where':{'id':_0x1b8234[_0x58f2('0xbf')]['id']}})['then'](handleEntityNotFound(_0x333cb8,null))[_0x58f2('0x2c')](saveUpdates(_0x1b8234[_0x58f2('0x7d')],null))['then'](respondWithResult(_0x333cb8,null))[_0x58f2('0x38')](handleError(_0x333cb8,null));};exports[_0x58f2('0x2d')]=function(_0xbbf967,_0x33781b){return db[_0x58f2('0x41')][_0x58f2('0x6b')]({'where':{'id':_0xbbf967['params']['id']}})['then'](handleEntityNotFound(_0x33781b,null))[_0x58f2('0x2c')](removeEntity(_0x33781b,null))[_0x58f2('0x38')](handleError(_0x33781b,null));};exports[_0x58f2('0xc4')]=function(_0x18af8f,_0x4ca881){return db[_0x58f2('0x41')][_0x58f2('0xc4')]()['then'](respondWithResult(_0x4ca881,null))[_0x58f2('0x38')](handleError(_0x4ca881,null));};exports[_0x58f2('0xc5')]=function(_0x4a075c,_0x59c43,_0x54e68b){return db['WhatsappMessage'][_0x58f2('0x6b')]({'where':{'id':_0x4a075c[_0x58f2('0xbf')]['id']}})[_0x58f2('0x2c')](handleEntityNotFound(_0x59c43,null))[_0x58f2('0x2c')](function(_0x358546){if(_0x358546){return _0x358546[_0x58f2('0xc5')](_0x4a075c[_0x58f2('0x7d')][_0x58f2('0xc6')],_[_0x58f2('0xc7')](_0x4a075c[_0x58f2('0x7d')],['ids','id'])||{});}})[_0x58f2('0x2c')](respondWithResult(_0x59c43,null))[_0x58f2('0x38')](handleError(_0x59c43,null));};exports['getMessages']=function(_0x5d09b4,_0x19baa2,_0x3f2203){var _0x1793e3={'raw':![],'where':{}};var _0x353a8f={};var _0x21647d={'count':0x0,'rows':[]};return db[_0x58f2('0x41')]['findOne']({'where':{'id':_0x5d09b4['params']['id']}})[_0x58f2('0x2c')](handleEntityNotFound(_0x19baa2,null))[_0x58f2('0x2c')](function(_0x8082e4){if(_0x8082e4){_0x353a8f['model']=_[_0x58f2('0x47')](db['WhatsappMessage'][_0x58f2('0x42')]);_0x353a8f['query']=_[_0x58f2('0x47')](_0x5d09b4[_0x58f2('0x48')]);_0x353a8f['filters']=_['intersection'](_0x353a8f[_0x58f2('0x46')],_0x353a8f['query']);_0x1793e3[_0x58f2('0x4c')]=_[_0x58f2('0x4a')](_0x353a8f['model'],qs[_0x58f2('0x4b')](_0x5d09b4['query'][_0x58f2('0x4b')]));_0x1793e3[_0x58f2('0x4c')]=_0x1793e3[_0x58f2('0x4c')][_0x58f2('0x4d')]?_0x1793e3[_0x58f2('0x4c')]:_0x353a8f[_0x58f2('0x46')];if(!_0x5d09b4[_0x58f2('0x48')]['hasOwnProperty'](_0x58f2('0x4f'))){_0x1793e3[_0x58f2('0x22')]=qs[_0x58f2('0x22')](_0x5d09b4[_0x58f2('0x48')][_0x58f2('0x22')]);_0x1793e3[_0x58f2('0x25')]=qs[_0x58f2('0x25')](_0x5d09b4[_0x58f2('0x48')]['offset']);}_0x1793e3[_0x58f2('0x50')]=qs[_0x58f2('0x51')](_0x5d09b4[_0x58f2('0x48')]['sort']);_0x1793e3['where']=qs['filters'](_[_0x58f2('0x53')](_0x5d09b4[_0x58f2('0x48')],_0x353a8f[_0x58f2('0x49')]));_0x1793e3['where'][_0x58f2('0xbc')]=_0x8082e4['id'];if(_0x5d09b4[_0x58f2('0x48')][_0x58f2('0x90')]){_0x1793e3[_0x58f2('0x52')]=_[_0x58f2('0xc8')](_0x1793e3['where'],{'$or':_['map'](_0x1793e3[_0x58f2('0x4c')],function(_0x5f19bf){var _0x3b0340={};_0x3b0340[_0x5f19bf]={'$like':'%'+_0x5d09b4[_0x58f2('0x48')][_0x58f2('0x90')]+'%'};return _0x3b0340;})});}if(_0x5d09b4[_0x58f2('0x48')][_0x58f2('0x85')]){var _0x472b04=_0x5d09b4['query'][_0x58f2('0x85')][_0x58f2('0x72')](',');var _0x411bc8={};_0x411bc8[_0x472b04[0x0]]={'$gte':moment(_0x472b04[0x1])[_0x58f2('0xc9')](_0x58f2('0xca'))};_0x1793e3[_0x58f2('0x52')]=_[_0x58f2('0xc8')](_0x1793e3['where'],_0x411bc8);}_0x1793e3=_[_0x58f2('0xc8')]({},_0x1793e3,_0x5d09b4[_0x58f2('0xc2')]);return db[_0x58f2('0xcb')][_0x58f2('0x24')]({'where':_0x1793e3[_0x58f2('0x52')]})['then'](function(_0xeabbb5){_0x21647d['count']=_0xeabbb5;if(_0x5d09b4[_0x58f2('0x48')][_0x58f2('0xc0')]){_0x1793e3[_0x58f2('0xc1')]=[{'all':!![]}];}return db['WhatsappMessage'][_0x58f2('0xcc')](_0x1793e3);})[_0x58f2('0x2c')](function(_0x2ca020){_0x21647d['rows']=_0x2ca020;return _0x21647d;});}})[_0x58f2('0x2c')](respondWithFilteredResult(_0x19baa2,_0x1793e3))['catch'](handleError(_0x19baa2,null));};exports['addTags']=function(_0x1da2a9,_0x4ec17c,_0x41724c){return db[_0x58f2('0x41')][_0x58f2('0x6b')]({'where':{'id':_0x1da2a9[_0x58f2('0xbf')]['id']}})['then'](handleEntityNotFound(_0x4ec17c,null))[_0x58f2('0x2c')](function(_0xb944af){if(_0xb944af){return _0xb944af['setTags'](_0x1da2a9[_0x58f2('0x7d')][_0x58f2('0xc6')],_[_0x58f2('0xc7')](_0x1da2a9[_0x58f2('0x7d')],[_0x58f2('0xc6'),'id'])||{})[_0x58f2('0xcd')](function(){return db[_0x58f2('0xce')][_0x58f2('0xcc')]({'attributes':['id','name',_0x58f2('0xcf')],'where':{'id':_0x1da2a9['body'][_0x58f2('0xc6')]}});})[_0x58f2('0x2c')](function(_0x527ed6){socket[_0x58f2('0xd0')](_0x58f2('0xd1'),{'id':Number(_0x1da2a9[_0x58f2('0xbf')]['id']),'tags':_0x527ed6||[]});return{'id':Number(_0x1da2a9[_0x58f2('0xbf')]['id']),'tags':_0x527ed6||[]};});}})['then'](respondWithResult(_0x4ec17c,null))[_0x58f2('0x38')](handleError(_0x4ec17c,null));};exports[_0x58f2('0xd2')]=function(_0x51d4d5,_0xad7fb3,_0x4424a2){return db[_0x58f2('0x41')][_0x58f2('0x6b')]({'where':{'id':_0x51d4d5[_0x58f2('0xbf')]['id']}})[_0x58f2('0x2c')](handleEntityNotFound(_0xad7fb3,null))[_0x58f2('0x2c')](function(_0x54c72d){if(_0x54c72d){return _0x54c72d[_0x58f2('0xd2')](_0x51d4d5['query'][_0x58f2('0xc6')]);}})[_0x58f2('0x2c')](respondWithStatusCode(_0xad7fb3,null))[_0x58f2('0x38')](handleError(_0xad7fb3,null));};exports[_0x58f2('0xd3')]=function(_0x2b5f7f,_0x4c8ef9){var _0x2e12b8=moment()['unix']()['toString']();var _0x282949=path[_0x58f2('0xd4')](config[_0x58f2('0xd5')],_0x58f2('0xd6'),'files','tmp');var _0x28beda=path['join'](config[_0x58f2('0xd5')],_0x58f2('0xd6'),_0x58f2('0xd7'),'attachments');var _0x1353de=path[_0x58f2('0xd4')](_0x282949,_0x2e12b8);var _0x165b90=util[_0x58f2('0xc9')](_0x58f2('0xd8'),_0x2b5f7f['params']['id'],_0x2e12b8);var _0x22611d=path[_0x58f2('0xd4')](_0x282949,_0x165b90);var _0x5ef856=[];_0x5ef856[_0x58f2('0x37')]({'model':db[_0x58f2('0xd9')],'as':_0x58f2('0xd9'),'attributes':['id',_0x58f2('0x33')],'raw':!![]});_0x5ef856[_0x58f2('0x37')]({'model':db['CmContact'],'as':_0x58f2('0x70'),'attributes':['id',_0x58f2('0xda'),_0x58f2('0xdb')],'raw':!![]});if(_0x2b5f7f[_0x58f2('0x48')][_0x58f2('0xdc')]){_0x5ef856[_0x58f2('0x37')]({'model':db[_0x58f2('0xdd')],'as':_0x58f2('0xdd'),'raw':!![]});}var _0x554794=[{'model':db['WhatsappMessage'],'as':_0x58f2('0xde'),'attributes':['id','body',_0x58f2('0x84'),'direction',_0x58f2('0xdf'),'read'],'include':_0x5ef856}];_0x554794[_0x58f2('0x37')]({'model':db[_0x58f2('0xe0')],'as':_0x58f2('0xe1'),'attributes':['id',_0x58f2('0x2f')]});_0x554794[_0x58f2('0x37')]({'model':db[_0x58f2('0xd9')],'as':'Owner','attributes':['id',_0x58f2('0x33')]});return db[_0x58f2('0x41')][_0x58f2('0x6b')]({'where':{'id':_0x2b5f7f[_0x58f2('0xbf')]['id']},'include':_0x554794})[_0x58f2('0x2c')](handleEntityNotFound(_0x4c8ef9,null))[_0x58f2('0x2c')](function(_0x45cd8d){if(_0x45cd8d){var _0x4891d1=_0x45cd8d['get']({'plain':!![]});fs[_0x58f2('0xe2')](_0x1353de);var _0x3d5fd8={'channel':'Whatsapp','account':_0x4891d1['Account'][_0x58f2('0x2f')],'agent':_0x4891d1['Owner']?_0x4891d1[_0x58f2('0xe3')][_0x58f2('0x33')]:_0x58f2('0xe4'),'createdAt':moment(_0x4891d1[_0x58f2('0x84')])[_0x58f2('0xc9')]('YYYY-MM-DD\x20HH:mm:ss')[_0x58f2('0xa6')](),'closedAt':_0x4891d1[_0x58f2('0x3b')]?moment(_0x4891d1[_0x58f2('0xe5')])[_0x58f2('0xc9')](_0x58f2('0xca'))[_0x58f2('0xa6')]():'','disposition':_0x4891d1[_0x58f2('0xe6')],'messages':_(_0x4891d1[_0x58f2('0xde')])[_0x58f2('0x90')]({'secret':![]})[_0x58f2('0x32')](function(_0x55e4d7){if(_0x55e4d7[_0x58f2('0xdd')]){var _0x2bf1da=path[_0x58f2('0xd4')](_0x28beda,_0x55e4d7[_0x58f2('0xdd')][_0x58f2('0xe7')]);if(fs[_0x58f2('0xe8')](_0x2bf1da)){fs[_0x58f2('0xe9')](_0x2bf1da)[_0x58f2('0xea')](fs['createWriteStream'](path[_0x58f2('0xd4')](_0x1353de,_0x55e4d7[_0x58f2('0xdd')][_0x58f2('0xe7')])));}}return{'date':moment(_0x55e4d7['createdAt'])[_0x58f2('0xc9')](_0x58f2('0xca'))[_0x58f2('0xa6')](),'sender':_0x55e4d7['direction']==='out'?_0x55e4d7[_0x58f2('0xd9')]?_0x55e4d7[_0x58f2('0xd9')][_0x58f2('0x33')]:'System':_0x55e4d7['Contact']['firstName']+(_0x55e4d7[_0x58f2('0x70')][_0x58f2('0xdb')]?'\x20'+_0x55e4d7['Contact'][_0x58f2('0xdb')]:''),'body':_0x55e4d7[_0x58f2('0xdd')]?_0x55e4d7[_0x58f2('0xdd')][_0x58f2('0xe7')]:_0x55e4d7[_0x58f2('0x7d')],'direction':_0x55e4d7[_0x58f2('0xeb')]==='out'?'A':'C','secret':_0x55e4d7['secret'],'read':_0x55e4d7[_0x58f2('0x8c')],'attachment':_0x55e4d7[_0x58f2('0xdd')]};})['value']()};return ejs[_0x58f2('0xec')](path[_0x58f2('0xd4')](config['root'],_0x58f2('0xd6'),_0x58f2('0xed'),'downloadInteraction.ejs'),{'interaction':_0x3d5fd8})[_0x58f2('0x2c')](function(_0x5564b1){var _0xc0fbcd=path[_0x58f2('0xd4')](_0x1353de,_0x58f2('0xee')+_0x4891d1['id']+'-'+_0x2e12b8+_0x58f2('0xef'));var _0x7bbb3c={'path':_0xc0fbcd,'channel':'Whatsapp','interactionId':_0x4891d1['id']};return pdf[_0x58f2('0xf0')](_0x5564b1,_0x7bbb3c);})['then'](function(){return new BPromise(function(_0xc02eef,_0x30d0d5){zipdir(_0x1353de,{'saveTo':_0x22611d},function(_0x2dceeb,_0x6d21fe){if(_0x2dceeb)return _0x30d0d5(_0x2dceeb);return _0xc02eef(_0x6d21fe);});})[_0x58f2('0x2c')](function(){return new BPromise(function(_0xfef6f0,_0xc75f13){rimraf(_0x1353de,function(_0x1e48ed){if(_0x1e48ed)_0xc75f13(_0x1e48ed);return _0xfef6f0();});});})[_0x58f2('0x2c')](function(){return _0x4c8ef9['download'](_0x22611d,_0x165b90,function(_0x4676ff){if(_0x4676ff){console[_0x58f2('0xf1')]('err',_0x4676ff);}else{fs[_0x58f2('0xf2')](_0x22611d);}});});});}else{return _0x4c8ef9[_0x58f2('0x1f')](0xc8);}})['catch'](handleError(_0x4c8ef9,null));}; \ No newline at end of file +var _0x0c8d=['$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','isNumeric','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','user','role','toString','sequelize','keyBy','merge','a.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','all','rows','catch','show','params','include','create','describe','addMessage','WhatsappMessage','ids','omit','getMessages','findOne','format','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','addTags','setTags','spread','emit','whatsappInteractionTags:save','removeTags','download','unix','join','root','tmp','server','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','Attachment','Messages','createdAt','direction','secret','WhatsappAccount','Account','Owner','get','mkdirSync','Whatsapp','N.A.','closedAt','disposition','basename','existsSync','pipe','createWriteStream','out','System','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','err','rimraf','zip-dir','fast-json-patch','request-promise','moment','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','defaults','redis','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','name','Users','map','fullname','TagIds','Tags','split','push','waiting','talking','answered','total','closed','UserId','unmanaged','index','WhatsappInteraction','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','field','color','from','tools_tags','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','sqlOperator','conditions','find','unreadMessages','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)','value','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','Tag','forEach','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','start','some','compact','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','parse'];(function(_0x5ee3d3,_0x537c30){var _0x4b272f=function(_0x3dc277){while(--_0x3dc277){_0x5ee3d3['push'](_0x5ee3d3['shift']());}};_0x4b272f(++_0x537c30);}(_0x0c8d,0x79));var _0xd0c8=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0x0c8d[_0x1b6186];return _0x186121;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd0c8('0x0'));var zipdir=require(_0xd0c8('0x1'));var jsonpatch=require(_0xd0c8('0x2'));var rp=require(_0xd0c8('0x3'));var moment=require(_0xd0c8('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xd0c8('0x5'));var csv=require(_0xd0c8('0x6'));var ejs=require(_0xd0c8('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd0c8('0x8'));var squel=require('squel');var crypto=require(_0xd0c8('0x9'));var jsforce=require(_0xd0c8('0xa'));var deskjs=require(_0xd0c8('0xb'));var toCsv=require(_0xd0c8('0x6'));var querystring=require(_0xd0c8('0xc'));var Papa=require('papaparse');var Redis=require(_0xd0c8('0xd'));var authService=require(_0xd0c8('0xe'));var qs=require(_0xd0c8('0xf'));var as=require(_0xd0c8('0x10'));var pdf=require('../../components/export/pdf');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd0c8('0x11'))(_0xd0c8('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0xd0c8('0x13')](config[_0xd0c8('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0xd0c8('0x15'))(new Redis(config[_0xd0c8('0x14')]));require(_0xd0c8('0x16'))[_0xd0c8('0x17')](socket);function respondWithStatusCode(_0x1a637f,_0x39f5ae){_0x39f5ae=_0x39f5ae||0xcc;return function(_0x112b53){if(_0x112b53){return _0x1a637f[_0xd0c8('0x18')](_0x39f5ae);}return _0x1a637f[_0xd0c8('0x19')](_0x39f5ae)[_0xd0c8('0x1a')]();};}function respondWithResult(_0x1d100c,_0x1903f1){_0x1903f1=_0x1903f1||0xc8;return function(_0x58c3e0){if(_0x58c3e0){return _0x1d100c[_0xd0c8('0x19')](_0x1903f1)[_0xd0c8('0x1b')](_0x58c3e0);}};}function respondWithFilteredResult(_0x34a80d,_0x5d02a5){return function(_0x59b06f){if(_0x59b06f){var _0x32e360=typeof _0x5d02a5['offset']==='undefined'&&typeof _0x5d02a5[_0xd0c8('0x1c')]===_0xd0c8('0x1d');var _0x5b6b6f=_0x59b06f[_0xd0c8('0x1e')];var _0x42ba67=_0x32e360?0x0:_0x5d02a5['offset'];var _0x1a5a3d=_0x32e360?_0x59b06f[_0xd0c8('0x1e')]:_0x5d02a5[_0xd0c8('0x1f')]+_0x5d02a5[_0xd0c8('0x1c')];var _0x15bf62;if(_0x1a5a3d>=_0x5b6b6f){_0x1a5a3d=_0x5b6b6f;_0x15bf62=0xc8;}else{_0x15bf62=0xce;}_0x34a80d[_0xd0c8('0x19')](_0x15bf62);return _0x34a80d[_0xd0c8('0x20')](_0xd0c8('0x21'),_0x42ba67+'-'+_0x1a5a3d+'/'+_0x5b6b6f)[_0xd0c8('0x1b')](_0x59b06f);}return null;};}function patchUpdates(_0x352531){return function(_0x1e3536){try{jsonpatch[_0xd0c8('0x22')](_0x1e3536,_0x352531,!![]);}catch(_0x30d143){return BPromise[_0xd0c8('0x23')](_0x30d143);}return _0x1e3536[_0xd0c8('0x24')]();};}function saveUpdates(_0x1fbe73,_0x387584){return function(_0x2325f4){if(_0x2325f4){return _0x2325f4[_0xd0c8('0x25')](_0x1fbe73)['then'](function(_0x49fa75){return _0x49fa75;});}return null;};}function removeEntity(_0xc109ee,_0x41cfd9){return function(_0x3fcfa7){if(_0x3fcfa7){return _0x3fcfa7[_0xd0c8('0x26')]()[_0xd0c8('0x27')](function(){_0xc109ee[_0xd0c8('0x19')](0xcc)[_0xd0c8('0x1a')]();});}};}function handleEntityNotFound(_0x3548b2,_0xdc380c){return function(_0x513206){if(!_0x513206){_0x3548b2[_0xd0c8('0x18')](0x194);}return _0x513206;};}function handleError(_0x3faa1b,_0x160032){_0x160032=_0x160032||0x1f4;return function(_0x5b3f45){logger['error'](_0x5b3f45['stack']);if(_0x5b3f45[_0xd0c8('0x28')]){delete _0x5b3f45['name'];}_0x3faa1b[_0xd0c8('0x19')](_0x160032)['send'](_0x5b3f45);};}function getInteractionUsers(_0x2e8c33,_0x10fe0a){return new BPromise(function(_0x4abb89,_0x30336a){try{if(_0x10fe0a[_0x2e8c33['id']]){_0x2e8c33[_0xd0c8('0x29')]=_[_0xd0c8('0x2a')](_0x10fe0a[_0x2e8c33['id']],function(_0x50fb7c){return{'id':_0x50fb7c['id'],'fullname':_0x50fb7c[_0xd0c8('0x2b')]};});}}catch(_0x155eaa){_0x30336a(_0x155eaa);}_0x4abb89(_0x2e8c33);});}function getInteractionTags(_0x39ca0f,_0x21d7fb){return new BPromise(function(_0x87f472,_0x1f4b11){try{if(_0x39ca0f[_0xd0c8('0x2c')]){_0x39ca0f[_0xd0c8('0x2d')]=[];_0x39ca0f[_0xd0c8('0x2c')][_0xd0c8('0x2e')](',')['forEach'](function(_0x4ec541){_0x39ca0f['Tags'][_0xd0c8('0x2f')](_0x21d7fb[_0x4ec541]);});}delete _0x39ca0f['TagIds'];}catch(_0xf60971){_0x1f4b11(_0xf60971);}_0x87f472(_0x39ca0f);});}function updateWhatsappInteraction(_0x54d8cf,_0x357799,_0x6de030){return new BPromise(function(_0x1a6450,_0x4075ec){return getInteractionUsers(_0x54d8cf,_0x6de030)[_0xd0c8('0x27')](function(_0x2e94a6){return getInteractionTags(_0x2e94a6,_0x357799);})[_0xd0c8('0x27')](function(_0x481cef){return getStateInteraction(_0x481cef);})[_0xd0c8('0x27')](function(_0x31e000){_0x1a6450(_0x31e000);})['catch'](function(_0x2ac901){_0x4075ec(_0x2ac901);});});}function getStateInteraction(_0x47643c){return new BPromise(function(_0x321fe7){_0x47643c[_0xd0c8('0x30')]=0x0;_0x47643c[_0xd0c8('0x31')]=0x0;_0x47643c[_0xd0c8('0x32')]=0x0;_0x47643c['unmanaged']=0x0;_0x47643c[_0xd0c8('0x33')]=0x0;if(!_0x47643c[_0xd0c8('0x34')]&&!_0x47643c[_0xd0c8('0x35')]){_0x47643c[_0xd0c8('0x30')]+=0x1;}if(!_0x47643c[_0xd0c8('0x34')]&&_0x47643c[_0xd0c8('0x35')]){_0x47643c[_0xd0c8('0x31')]+=0x1;if(_0x47643c['waiting']){_0x47643c[_0xd0c8('0x30')]-=0x1;}}if(_0x47643c[_0xd0c8('0x34')]&&_0x47643c[_0xd0c8('0x35')]){_0x47643c['answered']+=0x1;if(_0x47643c[_0xd0c8('0x31')]){_0x47643c[_0xd0c8('0x31')]-=0x1;}}if(_0x47643c[_0xd0c8('0x34')]&&!_0x47643c[_0xd0c8('0x35')]){_0x47643c[_0xd0c8('0x36')]+=0x1;if(_0x47643c[_0xd0c8('0x30')]){_0x47643c[_0xd0c8('0x30')]-=0x1;}}_0x47643c['total']+=0x1;_0x321fe7(_0x47643c);});}exports[_0xd0c8('0x37')]=function(_0x49c947,_0x341525){var _0x1a84c7={},_0x226422={},_0x1470c4={'count':0x0,'rows':[]};var _0x4744b7=_['map'](db[_0xd0c8('0x38')]['rawAttributes'],function(_0x39481a){return{'name':_0x39481a[_0xd0c8('0x39')],'type':_0x39481a['type']['key']};});_0x226422[_0xd0c8('0x3a')]=_[_0xd0c8('0x2a')](_0x4744b7,_0xd0c8('0x28'));_0x226422[_0xd0c8('0x3b')]=_[_0xd0c8('0x3c')](_0x49c947[_0xd0c8('0x3b')]);_0x226422[_0xd0c8('0x3d')]=_[_0xd0c8('0x3e')](_0x226422['model'],_0x226422[_0xd0c8('0x3b')]);_0x1a84c7[_0xd0c8('0x3f')]=_[_0xd0c8('0x3e')](_0x226422[_0xd0c8('0x3a')],qs[_0xd0c8('0x40')](_0x49c947['query'][_0xd0c8('0x40')]));_0x1a84c7[_0xd0c8('0x3f')]=_0x1a84c7[_0xd0c8('0x3f')][_0xd0c8('0x41')]?_0x1a84c7[_0xd0c8('0x3f')]:_0x226422[_0xd0c8('0x3a')];if(!_0x49c947[_0xd0c8('0x3b')][_0xd0c8('0x42')](_0xd0c8('0x43'))){_0x1a84c7['limit']=qs[_0xd0c8('0x1c')](_0x49c947[_0xd0c8('0x3b')][_0xd0c8('0x1c')]);_0x1a84c7['offset']=qs[_0xd0c8('0x1f')](_0x49c947['query']['offset']);}_0x1a84c7['order']=qs[_0xd0c8('0x44')](_0x49c947[_0xd0c8('0x3b')][_0xd0c8('0x44')]);_0x1a84c7[_0xd0c8('0x45')]=qs['filters'](_[_0xd0c8('0x46')](_0x49c947[_0xd0c8('0x3b')],_0x226422['filters']),_0x4744b7);var _0x21d89c=[];var _0x2e598d=squel['select']()[_0xd0c8('0x47')]('id')[_0xd0c8('0x47')](_0xd0c8('0x28'))['field'](_0xd0c8('0x48'))[_0xd0c8('0x49')](_0xd0c8('0x4a'));var _0x180bad=squel['select']()[_0xd0c8('0x47')](_0xd0c8('0x4b'))['field'](_0xd0c8('0x4c'))['field'](_0xd0c8('0x4d'))[_0xd0c8('0x49')](_0xd0c8('0x4e'),'ui')[_0xd0c8('0x4f')](_0xd0c8('0x50'),'u',_0xd0c8('0x51'));var _0x382ee2=squel['select']()[_0xd0c8('0x49')](_0xd0c8('0x52'),'i')['left_join'](_0xd0c8('0x53'),'c',_0xd0c8('0x54'))[_0xd0c8('0x4f')](_0xd0c8('0x50'),'o','o.id\x20=\x20i.UserId')[_0xd0c8('0x4f')]('whatsapp_accounts','a',_0xd0c8('0x55'))[_0xd0c8('0x4f')](_0xd0c8('0x56'),'me','me.WhatsappInteractionId\x20=\x20i.id')['left_join']('whatsapp_interaction_has_tags','it',_0xd0c8('0x57'))[_0xd0c8('0x4f')](_0xd0c8('0x4a'),'t',_0xd0c8('0x58'));var _0x1ba22c=squel[_0xd0c8('0x59')]();var _0x2f6a66=[];var _0x190332=squel['expr']();var _0x106182;if(_0x49c947[_0xd0c8('0x3b')]['search']){_0x106182=as['parseSearch'](_0x49c947['query']['search']);var _0x1c1a63=_0x106182[_0xd0c8('0x5a')];for(var _0xc28721=0x0;_0xc28721<_0x106182[_0xd0c8('0x5b')][_0xd0c8('0x41')];_0xc28721++){var _0xef7a23=_0x106182['conditions'][_0xc28721];var _0x1bf350='i';var _0x1f5ad1=_[_0xd0c8('0x5c')](_0x4744b7,['name',_0xef7a23[_0xd0c8('0x47')]]);if(!_0x1f5ad1){switch(_0xef7a23[_0xd0c8('0x47')]){case _0xd0c8('0x5d'):if(_0xef7a23['value']==0x1){_0x382ee2[_0xd0c8('0x5e')]('`'+_0xef7a23['field']+'`\x20=\x200');}else{_0x382ee2[_0xd0c8('0x5e')]('`'+_0xef7a23['field']+_0xd0c8('0x5f'));}break;case _0xd0c8('0x60'):if(_0xef7a23[_0xd0c8('0x61')]===_0xd0c8('0x62')){if(_0xef7a23['value'][_0xd0c8('0x2e')]('\x20')['length']>0x1){_0x1ba22c[_0x1c1a63](_0xd0c8('0x63'),qs['getFullTextValue'](_0xef7a23[_0xd0c8('0x64')]),null);}else{var _0xe4d8ea='%'+_0xef7a23[_0xd0c8('0x64')]+'%';_0x1ba22c[_0x1c1a63](_0xd0c8('0x65'),_0xe4d8ea,_0xe4d8ea,_0xe4d8ea);}}else{_0x1f5ad1=_[_0xd0c8('0x5c')](_0x4744b7,[_0xd0c8('0x28'),_0xd0c8('0x66')]);_0xef7a23[_0xd0c8('0x47')]=_0xd0c8('0x66');_0x296696=as[_0xd0c8('0x67')](_0x1bf350,_0x1f5ad1[_0xd0c8('0x68')],_0xef7a23);_0x1ba22c[_0x1c1a63](_0x296696[_0xd0c8('0x69')],_0x296696[_0xd0c8('0x64')]['start'],_0x296696[_0xd0c8('0x64')][_0xd0c8('0x1a')]);}break;case _0xd0c8('0x6a'):var _0x2a7bbc=_0xef7a23[_0xd0c8('0x64')][_0xd0c8('0x2e')](',')[_0xd0c8('0x2a')](function(_0x5da021){return Number(_0x5da021);});_0x2a7bbc[_0xd0c8('0x6b')](function(_0x5ebd75){_0x190332['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x5ebd75+',%');});_0x2f6a66=_[_0xd0c8('0x6c')](_0x2f6a66,_0x2a7bbc);break;case _0xd0c8('0x6d'):if(_0xef7a23[_0xd0c8('0x61')]===_0xd0c8('0x62')){_0x1ba22c[_0x1c1a63](_0xd0c8('0x6e'),'%'+_0xef7a23[_0xd0c8('0x64')]+'%',null);}else{_0x1f5ad1=_['find'](_0x4744b7,['name','UserId']);_0xef7a23[_0xd0c8('0x47')]=_0xd0c8('0x35');_0x296696=as[_0xd0c8('0x67')](_0x1bf350,_0x1f5ad1[_0xd0c8('0x68')],_0xef7a23);_0x1ba22c[_0x1c1a63](_0x296696[_0xd0c8('0x69')],_0x296696['value']['start'],_0x296696[_0xd0c8('0x64')]['end']);}break;case _0xd0c8('0x6f'):_0x296696=as[_0xd0c8('0x67')]('me',null,_0xef7a23);_0x1ba22c[_0x1c1a63](_0x296696[_0xd0c8('0x69')],_0x296696[_0xd0c8('0x64')]['start'],_0x296696[_0xd0c8('0x64')]['end']);break;}}else{var _0x296696=as['buildExpression'](_0x1bf350,_0x1f5ad1['type'],_0xef7a23);_0x1ba22c[_0x1c1a63](_0x296696['text'],_0x296696[_0xd0c8('0x64')][_0xd0c8('0x70')],_0x296696[_0xd0c8('0x64')]['end']);}}}else{var _0x5486af=_(_0x49c947['query'])['keys']()[_0xd0c8('0x2a')](function(_0x6466ca){return _[_0xd0c8('0x71')](_0x4744b7,['name',_0x6466ca])?_0x6466ca:undefined;})[_0xd0c8('0x72')]()['value']();if(!_[_0xd0c8('0x73')](_0x5486af)){_0x5486af[_0xd0c8('0x6b')](function(_0x5c2571){if(_0x5c2571===_0xd0c8('0x74')){_0x382ee2['where'](_0xd0c8('0x75'),[]['concat'](_0x49c947[_0xd0c8('0x3b')][_0x5c2571]));}else if(_0x5c2571==='createdAt'){var _0x368590=JSON[_0xd0c8('0x76')](_0x49c947[_0xd0c8('0x3b')][_0x5c2571])[_0xd0c8('0x77')];var _0x594172=JSON['parse'](_0x49c947[_0xd0c8('0x3b')][_0x5c2571])[_0xd0c8('0x78')];_0x382ee2[_0xd0c8('0x45')](_0xd0c8('0x79'),_0x368590,_0x594172);}else{if(_0x49c947['query'][_0x5c2571]===_0xd0c8('0x7a')){_0x382ee2[_0xd0c8('0x45')]('i.'+_0x5c2571+_0xd0c8('0x7b'));}else{_0x382ee2[_0xd0c8('0x45')]('i.'+_0x5c2571+_0xd0c8('0x7c'),_0x49c947[_0xd0c8('0x3b')][_0x5c2571]);}}});}if(_0x49c947['query'][_0xd0c8('0x7d')]){if(_0x49c947[_0xd0c8('0x3b')][_0xd0c8('0x7d')]==0x1){_0x382ee2[_0xd0c8('0x5e')](_0xd0c8('0x7e'));}else{_0x382ee2['having'](_0xd0c8('0x7f'));}}if(_0x49c947['query'][_0xd0c8('0x80')]){_0x2f6a66=_[_0xd0c8('0x81')](_0x49c947[_0xd0c8('0x3b')][_0xd0c8('0x80')])?_0x49c947[_0xd0c8('0x3b')][_0xd0c8('0x80')]:new Array(_0x49c947[_0xd0c8('0x3b')]['tag']);_0x2f6a66[_0xd0c8('0x6b')](function(_0x2c02cc){_0x190332['or'](_0xd0c8('0x82'),'%,'+_0x2c02cc+',%');});}if(_0x49c947['query'][_0xd0c8('0x83')]){var _0x59d2d3=_0x49c947[_0xd0c8('0x3b')][_0xd0c8('0x83')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xd0c8('0x84')](_0x59d2d3)){_0x1ba22c['or']('i.id\x20LIKE\x20?',_0x59d2d3+'%')['or'](_0xd0c8('0x85'),_0x59d2d3+'%');}else{_0x1ba22c['or'](_0xd0c8('0x86'),qs[_0xd0c8('0x87')](_0x59d2d3))['or'](_0xd0c8('0x88'),_0x59d2d3+'%');}}}_0x382ee2[_0xd0c8('0x45')](_0x1ba22c);_0x382ee2[_0xd0c8('0x89')](_0xd0c8('0x8a'));var _0x58446b={'type':db[_0xd0c8('0x8b')]['QueryTypes'][_0xd0c8('0x8c')],'raw':!![]};var _0x5de7c9=_0x382ee2[_0xd0c8('0x8d')]();_0x5de7c9[_0xd0c8('0x47')](_0xd0c8('0x8a'));_0x5de7c9['field'](_0xd0c8('0x8e'),_0xd0c8('0x5d'));if(_0x1a84c7[_0xd0c8('0x8f')]){_0x1a84c7['order'][_0xd0c8('0x6b')](function(_0x10d1dd){var _0xbf24ec=_0x10d1dd[0x0]===_0xd0c8('0x90')?_0x10d1dd[0x0]:'i.'+_0x10d1dd[0x0];_0x382ee2[_0xd0c8('0x8f')](_0xbf24ec,_0x10d1dd[0x1]===_0xd0c8('0x91')?![]:!![]);});}if(!_['isEmpty'](_0x2f6a66)){_0x382ee2[_0xd0c8('0x5e')](_0x190332);_0x5de7c9[_0xd0c8('0x45')](_0xd0c8('0x92'),_0x2f6a66);}BPromise[_0xd0c8('0x93')]()['then'](function(){if(!_0x106182){if(_0x49c947[_0xd0c8('0x3b')][_0xd0c8('0x74')])return;_0x5de7c9[_0xd0c8('0x45')](_0xd0c8('0x94'));_0x382ee2['where'](_0xd0c8('0x94'));return;}if(_0x49c947['user']['role']!==_0xd0c8('0x95'))return;return _0x49c947['user'][_0xd0c8('0x96')]({'attributes':['id'],'raw':!![]})[_0xd0c8('0x27')](function(_0x1cc44b){if(_['isEmpty'](_0x1cc44b)){_0x5de7c9[_0xd0c8('0x45')](_0xd0c8('0x97'));_0x382ee2[_0xd0c8('0x45')](_0xd0c8('0x97'));}else{_0x5de7c9[_0xd0c8('0x45')]('i.WhatsappAccountId\x20IN\x20?',_[_0xd0c8('0x2a')](_0x1cc44b,'id'));_0x382ee2[_0xd0c8('0x45')](_0xd0c8('0x75'),_[_0xd0c8('0x2a')](_0x1cc44b,'id'));}});})['then'](function(){if(_0x49c947[_0xd0c8('0x98')][_0xd0c8('0x99')]===_0xd0c8('0x95')&&!_0x106182&&!_0x49c947[_0xd0c8('0x3b')][_0xd0c8('0x74')])return[];return db['sequelize'][_0xd0c8('0x3b')](_0x5de7c9[_0xd0c8('0x9a')](),_0x58446b);})[_0xd0c8('0x27')](function(_0x2cd90d){_0x1470c4[_0xd0c8('0x1e')]=_0x2cd90d[_0xd0c8('0x41')];if(_0x1470c4[_0xd0c8('0x1e')]===0x0)return[];return db[_0xd0c8('0x9b')][_0xd0c8('0x3b')](_0x2e598d[_0xd0c8('0x9a')](),_0x58446b)[_0xd0c8('0x27')](function(_0xdcccd9){_0x21d89c=_[_0xd0c8('0x9c')](_0xdcccd9,'id');_0x58446b=_[_0xd0c8('0x9d')](_0x58446b,{'model':db[_0xd0c8('0x38')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x49c947['query']['fields']){_0x1a84c7[_0xd0c8('0x3f')][_0xd0c8('0x6b')](function(_0x220bbd){_0x382ee2[_0xd0c8('0x47')]('i.'+_0x220bbd);});}else{_0x382ee2[_0xd0c8('0x47')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xd0c8('0x5d'));_0x382ee2['field'](_0xd0c8('0x9e'),'Account.key');_0x382ee2[_0xd0c8('0x47')]('a.mandatoryDisposition',_0xd0c8('0x9f'));_0x382ee2['field'](_0xd0c8('0xa0'),'contactName');_0x382ee2[_0xd0c8('0x47')](_0xd0c8('0xa1'));_0x382ee2[_0xd0c8('0x47')]('c.firstName','Contact.firstName');_0x382ee2[_0xd0c8('0x47')](_0xd0c8('0xa2'),'Contact.lastName');_0x382ee2[_0xd0c8('0x47')](_0xd0c8('0xa3'),_0xd0c8('0xa4'));_0x382ee2[_0xd0c8('0x47')](_0xd0c8('0xa5'),_0xd0c8('0xa6'));_0x382ee2[_0xd0c8('0x47')](_0xd0c8('0xa7'),_0xd0c8('0xa8'));_0x382ee2[_0xd0c8('0x47')](_0xd0c8('0xa9'),_0xd0c8('0xaa'));_0x382ee2[_0xd0c8('0x47')]('o.fullname',_0xd0c8('0xab'));_0x382ee2['field'](_0xd0c8('0xac'),_0xd0c8('0xad'));_0x382ee2[_0xd0c8('0x47')](_0xd0c8('0xae'),_0xd0c8('0x2c'));}if(_0x1a84c7[_0xd0c8('0x1c')])_0x382ee2[_0xd0c8('0x1c')](_0x1a84c7[_0xd0c8('0x1c')]);if(_0x1a84c7[_0xd0c8('0x1f')])_0x382ee2[_0xd0c8('0x1f')](_0x1a84c7[_0xd0c8('0x1f')]);return db[_0xd0c8('0x9b')][_0xd0c8('0x3b')](_0x382ee2[_0xd0c8('0x9a')](),_0x58446b);})[_0xd0c8('0x27')](function(_0x496dbd){if(_0x496dbd['length']>0x0)_0x180bad[_0xd0c8('0x45')](_0xd0c8('0xaf'),_[_0xd0c8('0x2a')](_0x496dbd,'id'));return db['sequelize'][_0xd0c8('0x3b')](_0x180bad[_0xd0c8('0x9a')](),_0x58446b)[_0xd0c8('0x27')](function(_0x391aa6){var _0x38f86e=_[_0xd0c8('0xb0')](_0x391aa6,_0xd0c8('0xb1'));var _0x258472=[];_0x496dbd['forEach'](function(_0x210cec){_0x258472[_0xd0c8('0x2f')](updateWhatsappInteraction(_0x210cec,_0x21d89c,_0x38f86e));});return BPromise[_0xd0c8('0xb2')](_0x258472);});});})['then'](function(_0x80b812){_0x1470c4[_0xd0c8('0xb3')]=_0x80b812;return _0x1470c4;})[_0xd0c8('0x27')](respondWithFilteredResult(_0x341525,_0x1a84c7))[_0xd0c8('0xb4')](handleError(_0x341525,null));};exports[_0xd0c8('0xb5')]=function(_0x4b9cd3,_0x3dc995){var _0xdc350={'raw':![],'where':{'id':_0x4b9cd3[_0xd0c8('0xb6')]['id']}},_0x5b8bb8={};_0x5b8bb8[_0xd0c8('0x3a')]=_[_0xd0c8('0x3c')](db[_0xd0c8('0x38')]['rawAttributes']);_0x5b8bb8['query']=_[_0xd0c8('0x3c')](_0x4b9cd3['query']);_0x5b8bb8[_0xd0c8('0x3d')]=_[_0xd0c8('0x3e')](_0x5b8bb8[_0xd0c8('0x3a')],_0x5b8bb8['query']);_0xdc350[_0xd0c8('0x3f')]=_[_0xd0c8('0x3e')](_0x5b8bb8['model'],qs[_0xd0c8('0x40')](_0x4b9cd3['query'][_0xd0c8('0x40')]));_0xdc350[_0xd0c8('0x3f')]=_0xdc350[_0xd0c8('0x3f')][_0xd0c8('0x41')]?_0xdc350[_0xd0c8('0x3f')]:_0x5b8bb8['model'];if(_0x4b9cd3['query']['includeAll']){_0xdc350[_0xd0c8('0xb7')]=[{'all':!![]}];}_0xdc350=_[_0xd0c8('0x9d')]({},_0xdc350,_0x4b9cd3['options']);return db[_0xd0c8('0x38')][_0xd0c8('0x5c')](_0xdc350)[_0xd0c8('0x27')](handleEntityNotFound(_0x3dc995,null))[_0xd0c8('0x27')](respondWithResult(_0x3dc995,null))['catch'](handleError(_0x3dc995,null));};exports[_0xd0c8('0xb8')]=function(_0x26907a,_0x520580){return db[_0xd0c8('0x38')][_0xd0c8('0xb8')](_0x26907a['body'],{})[_0xd0c8('0x27')](respondWithResult(_0x520580,0xc9))[_0xd0c8('0xb4')](handleError(_0x520580,null));};exports[_0xd0c8('0x25')]=function(_0x556adc,_0x3349c3){if(_0x556adc[_0xd0c8('0x6f')]['id']){delete _0x556adc[_0xd0c8('0x6f')]['id'];}return db['WhatsappInteraction'][_0xd0c8('0x5c')]({'where':{'id':_0x556adc[_0xd0c8('0xb6')]['id']}})[_0xd0c8('0x27')](handleEntityNotFound(_0x3349c3,null))[_0xd0c8('0x27')](saveUpdates(_0x556adc[_0xd0c8('0x6f')],null))['then'](respondWithResult(_0x3349c3,null))['catch'](handleError(_0x3349c3,null));};exports[_0xd0c8('0x26')]=function(_0x30a436,_0x34cf4f){return db[_0xd0c8('0x38')]['find']({'where':{'id':_0x30a436[_0xd0c8('0xb6')]['id']}})[_0xd0c8('0x27')](handleEntityNotFound(_0x34cf4f,null))[_0xd0c8('0x27')](removeEntity(_0x34cf4f,null))['catch'](handleError(_0x34cf4f,null));};exports['describe']=function(_0x515550,_0x33cf99){return db['WhatsappInteraction'][_0xd0c8('0xb9')]()[_0xd0c8('0x27')](respondWithResult(_0x33cf99,null))[_0xd0c8('0xb4')](handleError(_0x33cf99,null));};exports[_0xd0c8('0xba')]=function(_0x1af5b4,_0x5979ba,_0x21f567){return db[_0xd0c8('0xbb')][_0xd0c8('0x5c')]({'where':{'id':_0x1af5b4[_0xd0c8('0xb6')]['id']}})[_0xd0c8('0x27')](handleEntityNotFound(_0x5979ba,null))[_0xd0c8('0x27')](function(_0xc11fc4){if(_0xc11fc4){return _0xc11fc4['addMessage'](_0x1af5b4['body'][_0xd0c8('0xbc')],_[_0xd0c8('0xbd')](_0x1af5b4[_0xd0c8('0x6f')],[_0xd0c8('0xbc'),'id'])||{});}})[_0xd0c8('0x27')](respondWithResult(_0x5979ba,null))[_0xd0c8('0xb4')](handleError(_0x5979ba,null));};exports[_0xd0c8('0xbe')]=function(_0x54cc3f,_0x458c60,_0x1f5f17){var _0x347213={'raw':![],'where':{}};var _0x48afe4={};var _0x2ad453={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0xd0c8('0xbf')]({'where':{'id':_0x54cc3f[_0xd0c8('0xb6')]['id']}})[_0xd0c8('0x27')](handleEntityNotFound(_0x458c60,null))[_0xd0c8('0x27')](function(_0xb90a94){if(_0xb90a94){_0x48afe4['model']=_[_0xd0c8('0x3c')](db[_0xd0c8('0xbb')]['rawAttributes']);_0x48afe4['query']=_[_0xd0c8('0x3c')](_0x54cc3f['query']);_0x48afe4[_0xd0c8('0x3d')]=_['intersection'](_0x48afe4[_0xd0c8('0x3a')],_0x48afe4[_0xd0c8('0x3b')]);_0x347213[_0xd0c8('0x3f')]=_[_0xd0c8('0x3e')](_0x48afe4[_0xd0c8('0x3a')],qs[_0xd0c8('0x40')](_0x54cc3f[_0xd0c8('0x3b')][_0xd0c8('0x40')]));_0x347213[_0xd0c8('0x3f')]=_0x347213[_0xd0c8('0x3f')][_0xd0c8('0x41')]?_0x347213['attributes']:_0x48afe4[_0xd0c8('0x3a')];if(!_0x54cc3f[_0xd0c8('0x3b')][_0xd0c8('0x42')]('nolimit')){_0x347213[_0xd0c8('0x1c')]=qs['limit'](_0x54cc3f['query'][_0xd0c8('0x1c')]);_0x347213[_0xd0c8('0x1f')]=qs[_0xd0c8('0x1f')](_0x54cc3f[_0xd0c8('0x3b')][_0xd0c8('0x1f')]);}_0x347213['order']=qs[_0xd0c8('0x44')](_0x54cc3f[_0xd0c8('0x3b')][_0xd0c8('0x44')]);_0x347213[_0xd0c8('0x45')]=qs['filters'](_[_0xd0c8('0x46')](_0x54cc3f['query'],_0x48afe4[_0xd0c8('0x3d')]));_0x347213[_0xd0c8('0x45')][_0xd0c8('0xb1')]=_0xb90a94['id'];if(_0x54cc3f[_0xd0c8('0x3b')][_0xd0c8('0x83')]){_0x347213[_0xd0c8('0x45')]=_[_0xd0c8('0x9d')](_0x347213[_0xd0c8('0x45')],{'$or':_[_0xd0c8('0x2a')](_0x347213[_0xd0c8('0x3f')],function(_0x426622){var _0x780619={};_0x780619[_0x426622]={'$like':'%'+_0x54cc3f['query'][_0xd0c8('0x83')]+'%'};return _0x780619;})});}if(_0x54cc3f[_0xd0c8('0x3b')]['$gte']){var _0x275a0f=_0x54cc3f[_0xd0c8('0x3b')][_0xd0c8('0x77')][_0xd0c8('0x2e')](',');var _0x464375={};_0x464375[_0x275a0f[0x0]]={'$gte':moment(_0x275a0f[0x1])[_0xd0c8('0xc0')](_0xd0c8('0xc1'))};_0x347213[_0xd0c8('0x45')]=_['merge'](_0x347213[_0xd0c8('0x45')],_0x464375);}_0x347213=_[_0xd0c8('0x9d')]({},_0x347213,_0x54cc3f[_0xd0c8('0xc2')]);return db['WhatsappMessage'][_0xd0c8('0x1e')]({'where':_0x347213[_0xd0c8('0x45')]})[_0xd0c8('0x27')](function(_0x663bd4){_0x2ad453['count']=_0x663bd4;if(_0x54cc3f[_0xd0c8('0x3b')][_0xd0c8('0xc3')]){_0x347213[_0xd0c8('0xb7')]=[{'all':!![]}];}return db[_0xd0c8('0xbb')]['findAll'](_0x347213);})[_0xd0c8('0x27')](function(_0x361efc){_0x2ad453[_0xd0c8('0xb3')]=_0x361efc;return _0x2ad453;});}})['then'](respondWithFilteredResult(_0x458c60,_0x347213))['catch'](handleError(_0x458c60,null));};exports[_0xd0c8('0xc4')]=function(_0x4d6dd4,_0x269cff,_0xc26209){return db['WhatsappInteraction']['find']({'where':{'id':_0x4d6dd4[_0xd0c8('0xb6')]['id']}})['then'](handleEntityNotFound(_0x269cff,null))['then'](function(_0x3a56c3){if(_0x3a56c3){return _0x3a56c3[_0xd0c8('0xc5')](_0x4d6dd4[_0xd0c8('0x6f')][_0xd0c8('0xbc')],_[_0xd0c8('0xbd')](_0x4d6dd4['body'],[_0xd0c8('0xbc'),'id'])||{})[_0xd0c8('0xc6')](function(){return db[_0xd0c8('0x6a')]['findAll']({'attributes':['id',_0xd0c8('0x28'),_0xd0c8('0x48')],'where':{'id':_0x4d6dd4[_0xd0c8('0x6f')][_0xd0c8('0xbc')]}});})[_0xd0c8('0x27')](function(_0x34db39){socket[_0xd0c8('0xc7')](_0xd0c8('0xc8'),{'id':Number(_0x4d6dd4[_0xd0c8('0xb6')]['id']),'tags':_0x34db39||[]});return{'id':Number(_0x4d6dd4['params']['id']),'tags':_0x34db39||[]};});}})[_0xd0c8('0x27')](respondWithResult(_0x269cff,null))[_0xd0c8('0xb4')](handleError(_0x269cff,null));};exports[_0xd0c8('0xc9')]=function(_0x3de5f2,_0x5a9ee5,_0x16fe9c){return db[_0xd0c8('0x38')][_0xd0c8('0x5c')]({'where':{'id':_0x3de5f2['params']['id']}})['then'](handleEntityNotFound(_0x5a9ee5,null))[_0xd0c8('0x27')](function(_0x8b88be){if(_0x8b88be){return _0x8b88be[_0xd0c8('0xc9')](_0x3de5f2[_0xd0c8('0x3b')][_0xd0c8('0xbc')]);}})[_0xd0c8('0x27')](respondWithStatusCode(_0x5a9ee5,null))[_0xd0c8('0xb4')](handleError(_0x5a9ee5,null));};exports[_0xd0c8('0xca')]=function(_0x4c797d,_0x77e4cf){var _0x195197=moment()[_0xd0c8('0xcb')]()[_0xd0c8('0x9a')]();var _0x2073cc=path[_0xd0c8('0xcc')](config[_0xd0c8('0xcd')],'server','files',_0xd0c8('0xce'));var _0x11b73b=path[_0xd0c8('0xcc')](config[_0xd0c8('0xcd')],_0xd0c8('0xcf'),'files',_0xd0c8('0xd0'));var _0xe75e62=path[_0xd0c8('0xcc')](_0x2073cc,_0x195197);var _0x5bbf8b=util['format'](_0xd0c8('0xd1'),_0x4c797d[_0xd0c8('0xb6')]['id'],_0x195197);var _0x225dad=path['join'](_0x2073cc,_0x5bbf8b);var _0x3bff30=[];_0x3bff30[_0xd0c8('0x2f')]({'model':db['User'],'as':'User','attributes':['id',_0xd0c8('0x2b')],'raw':!![]});_0x3bff30[_0xd0c8('0x2f')]({'model':db[_0xd0c8('0xd2')],'as':_0xd0c8('0x60'),'attributes':['id',_0xd0c8('0xd3'),_0xd0c8('0xd4')],'raw':!![]});if(_0x4c797d[_0xd0c8('0x3b')][_0xd0c8('0xd0')]){_0x3bff30[_0xd0c8('0x2f')]({'model':db[_0xd0c8('0xd5')],'as':_0xd0c8('0xd5'),'raw':!![]});}var _0x50af3e=[{'model':db[_0xd0c8('0xbb')],'as':_0xd0c8('0xd6'),'attributes':['id',_0xd0c8('0x6f'),_0xd0c8('0xd7'),_0xd0c8('0xd8'),_0xd0c8('0xd9'),'read'],'include':_0x3bff30}];_0x50af3e[_0xd0c8('0x2f')]({'model':db[_0xd0c8('0xda')],'as':_0xd0c8('0xdb'),'attributes':['id',_0xd0c8('0x28')]});_0x50af3e['push']({'model':db['User'],'as':_0xd0c8('0xdc'),'attributes':['id',_0xd0c8('0x2b')]});return db[_0xd0c8('0x38')][_0xd0c8('0x5c')]({'where':{'id':_0x4c797d[_0xd0c8('0xb6')]['id']},'include':_0x50af3e})['then'](handleEntityNotFound(_0x77e4cf,null))[_0xd0c8('0x27')](function(_0xc25571){if(_0xc25571){var _0x24350d=_0xc25571[_0xd0c8('0xdd')]({'plain':!![]});fs[_0xd0c8('0xde')](_0xe75e62);var _0x1fb836={'channel':_0xd0c8('0xdf'),'account':_0x24350d[_0xd0c8('0xdb')][_0xd0c8('0x28')],'agent':_0x24350d[_0xd0c8('0xdc')]?_0x24350d[_0xd0c8('0xdc')][_0xd0c8('0x2b')]:_0xd0c8('0xe0'),'createdAt':moment(_0x24350d[_0xd0c8('0xd7')])[_0xd0c8('0xc0')](_0xd0c8('0xc1'))[_0xd0c8('0x9a')](),'closedAt':_0x24350d['closed']?moment(_0x24350d[_0xd0c8('0xe1')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xd0c8('0x9a')]():'','disposition':_0x24350d[_0xd0c8('0xe2')],'messages':_(_0x24350d[_0xd0c8('0xd6')])[_0xd0c8('0x83')]({'secret':![]})[_0xd0c8('0x2a')](function(_0x2caf99){if(_0x2caf99[_0xd0c8('0xd5')]){var _0xa29ffd=path[_0xd0c8('0xcc')](_0x11b73b,_0x2caf99[_0xd0c8('0xd5')][_0xd0c8('0xe3')]);if(fs[_0xd0c8('0xe4')](_0xa29ffd)){fs['createReadStream'](_0xa29ffd)[_0xd0c8('0xe5')](fs[_0xd0c8('0xe6')](path[_0xd0c8('0xcc')](_0xe75e62,_0x2caf99[_0xd0c8('0xd5')][_0xd0c8('0xe3')])));}}return{'date':moment(_0x2caf99[_0xd0c8('0xd7')])[_0xd0c8('0xc0')](_0xd0c8('0xc1'))[_0xd0c8('0x9a')](),'sender':_0x2caf99[_0xd0c8('0xd8')]===_0xd0c8('0xe7')?_0x2caf99[_0xd0c8('0x6d')]?_0x2caf99['User'][_0xd0c8('0x2b')]:_0xd0c8('0xe8'):_0x2caf99[_0xd0c8('0x60')][_0xd0c8('0xd3')]+(_0x2caf99[_0xd0c8('0x60')]['lastName']?'\x20'+_0x2caf99[_0xd0c8('0x60')][_0xd0c8('0xd4')]:''),'body':_0x2caf99['Attachment']?_0x2caf99[_0xd0c8('0xd5')][_0xd0c8('0xe3')]:_0x2caf99['body'],'direction':_0x2caf99['direction']==='out'?'A':'C','secret':_0x2caf99[_0xd0c8('0xd9')],'read':_0x2caf99[_0xd0c8('0x7d')],'attachment':_0x2caf99[_0xd0c8('0xd5')]};})[_0xd0c8('0x64')]()};return ejs[_0xd0c8('0xe9')](path[_0xd0c8('0xcc')](config[_0xd0c8('0xcd')],'server',_0xd0c8('0xea'),_0xd0c8('0xeb')),{'interaction':_0x1fb836})[_0xd0c8('0x27')](function(_0x1311a5){var _0x174223=path[_0xd0c8('0xcc')](_0xe75e62,'transcript-'+_0x24350d['id']+'-'+_0x195197+_0xd0c8('0xec'));var _0x272daa={'path':_0x174223,'channel':_0xd0c8('0xdf'),'interactionId':_0x24350d['id']};return pdf[_0xd0c8('0xed')](_0x1311a5,_0x272daa);})['then'](function(){return new BPromise(function(_0x3edf51,_0x1068d2){zipdir(_0xe75e62,{'saveTo':_0x225dad},function(_0x17ec13,_0x34aa7a){if(_0x17ec13)return _0x1068d2(_0x17ec13);return _0x3edf51(_0x34aa7a);});})[_0xd0c8('0x27')](function(){return new BPromise(function(_0x38e739,_0x5978b0){rimraf(_0xe75e62,function(_0x496179){if(_0x496179)_0x5978b0(_0x496179);return _0x38e739();});});})['then'](function(){return _0x77e4cf[_0xd0c8('0xca')](_0x225dad,_0x5bbf8b,function(_0x4f46af){if(_0x4f46af){console[_0xd0c8('0xee')](_0xd0c8('0xef'),_0x4f46af);}else{fs['unlinkSync'](_0x225dad);}});});});}else{return _0x77e4cf[_0xd0c8('0x18')](0xc8);}})[_0xd0c8('0xb4')](handleError(_0x77e4cf,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index b11c094..ffbdf64 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 _0x0c5d=['update','remove','then','Users','findAll','setDataValue','unreadMessages','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x4450b1,_0x214ace){var _0x399b0b=function(_0x2197df){while(--_0x2197df){_0x4450b1['push'](_0x4450b1['shift']());}};_0x399b0b(++_0x214ace);}(_0x0c5d,0x6c));var _0xd0c5=function(_0x143c2c,_0x5ac42e){_0x143c2c=_0x143c2c-0x0;var _0x1ff4c1=_0x0c5d[_0x143c2c];return _0x1ff4c1;};'use strict';var EventEmitter=require(_0xd0c5('0x0'));var WhatsappInteraction=require(_0xd0c5('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0xd0c5('0x1'))['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xd0c5('0x2')](0x0);var events={'afterCreate':_0xd0c5('0x3'),'afterUpdate':_0xd0c5('0x4'),'afterDestroy':_0xd0c5('0x5')};function emitEvent(_0x4664bc){return function(_0xc3a9b9,_0x166636,_0x121911){_0xc3a9b9['getUsers']({'attributes':['id'],'raw':!![]})[_0xd0c5('0x6')](function(_0x518801){_0xc3a9b9['setDataValue'](_0xd0c5('0x7'),_0x518801['map'](function(_0x567113){return{'id':_0x567113['id']};}));return WhatsappMessage[_0xd0c5('0x8')]({'where':{'WhatsappInteractionId':_0xc3a9b9['id'],'direction':'in','read':![]},'raw':!![]});})[_0xd0c5('0x6')](function(_0x50ed33){_0xc3a9b9[_0xd0c5('0x9')](_0xd0c5('0xa'),_0x50ed33['length']);WhatsappInteractionEvents[_0xd0c5('0xb')](_0x4664bc+':'+_0xc3a9b9['id'],_0xc3a9b9);WhatsappInteractionEvents[_0xd0c5('0xb')](_0x4664bc,_0xc3a9b9);_0x121911(null);})[_0xd0c5('0xc')](_0x121911(null));};}for(var e in events){if(events[_0xd0c5('0xd')](e)){var event=events[e];WhatsappInteraction[_0xd0c5('0xe')](e,emitEvent(event));}}module[_0xd0c5('0xf')]=WhatsappInteractionEvents; \ No newline at end of file +var _0xb04a=['../../mysqldb','WhatsappInteraction','setMaxListeners','save','update','getUsers','then','map','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','events'];(function(_0x53c4f8,_0x44ccaf){var _0x416458=function(_0x2632aa){while(--_0x2632aa){_0x53c4f8['push'](_0x53c4f8['shift']());}};_0x416458(++_0x44ccaf);}(_0xb04a,0xcf));var _0xab04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb04a[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xab04('0x0'));var WhatsappInteraction=require(_0xab04('0x1'))['db'][_0xab04('0x2')];var WhatsappMessage=require(_0xab04('0x1'))['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xab04('0x3')](0x0);var events={'afterCreate':_0xab04('0x4'),'afterUpdate':_0xab04('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2b5b06){return function(_0x160dd6,_0x1ad1a7,_0x488ced){_0x160dd6[_0xab04('0x6')]({'attributes':['id'],'raw':!![]})[_0xab04('0x7')](function(_0x598d0f){_0x160dd6['setDataValue']('Users',_0x598d0f[_0xab04('0x8')](function(_0x4faba9){return{'id':_0x4faba9['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x160dd6['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x1d4a39){_0x160dd6[_0xab04('0x9')](_0xab04('0xa'),_0x1d4a39[_0xab04('0xb')]);WhatsappInteractionEvents[_0xab04('0xc')](_0x2b5b06+':'+_0x160dd6['id'],_0x160dd6);WhatsappInteractionEvents[_0xab04('0xc')](_0x2b5b06,_0x160dd6);_0x488ced(null);})[_0xab04('0xd')](_0x488ced(null));};}for(var e in events){if(events[_0xab04('0xe')](e)){var event=events[e];WhatsappInteraction[_0xab04('0xf')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 46e27b5..4c056bc 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 _0x5452=['../../config/logger','bluebird','request-promise','path','rimraf','exports','define','whatsapp_interactions','changed','closed','closedAt','util'];(function(_0x575387,_0x2a3abe){var _0xb6f3eb=function(_0x278abe){while(--_0x278abe){_0x575387['push'](_0x575387['shift']());}};_0xb6f3eb(++_0x2a3abe);}(_0x5452,0xbf));var _0x2545=function(_0x47d0d1,_0x10b274){_0x47d0d1=_0x47d0d1-0x0;var _0x5639cf=_0x5452[_0x47d0d1];return _0x5639cf;};'use strict';var _=require('lodash');var util=require(_0x2545('0x0'));var logger=require(_0x2545('0x1'))('api');var moment=require('moment');var BPromise=require(_0x2545('0x2'));var rp=require(_0x2545('0x3'));var fs=require('fs');var path=require(_0x2545('0x4'));var rimraf=require(_0x2545('0x5'));var config=require('../../config/environment');var attributes=require('./whatsappInteraction.attributes');module[_0x2545('0x6')]=function(_0x5da8c4,_0x116336){return _0x5da8c4[_0x2545('0x7')]('WhatsappInteraction',attributes,{'tableName':_0x2545('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x47c297,_0x4d27ae,_0x39067c){if(_0x47c297[_0x2545('0x9')](_0x2545('0xa'))){_0x47c297[_0x2545('0xb')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x39067c(null,_0x47c297);}}});}; \ No newline at end of file +var _0xd159=['changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./whatsappInteraction.attributes','define','WhatsappInteraction','whatsapp_interactions'];(function(_0x4934e3,_0x124098){var _0x86a0c3=function(_0x59da73){while(--_0x59da73){_0x4934e3['push'](_0x4934e3['shift']());}};_0x86a0c3(++_0x124098);}(_0xd159,0x19d));var _0x9d15=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xd159[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x9d15('0x0'));var util=require(_0x9d15('0x1'));var logger=require(_0x9d15('0x2'))(_0x9d15('0x3'));var moment=require('moment');var BPromise=require(_0x9d15('0x4'));var rp=require(_0x9d15('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9d15('0x6'));var config=require(_0x9d15('0x7'));var attributes=require(_0x9d15('0x8'));module['exports']=function(_0x42b0bd,_0x5875b8){return _0x42b0bd[_0x9d15('0x9')](_0x9d15('0xa'),attributes,{'tableName':_0x9d15('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5b1a6e,_0xcaa861,_0x2bffa9){if(_0x5b1a6e[_0x9d15('0xc')](_0x9d15('0xd'))){_0x5b1a6e[_0x9d15('0xe')]=moment()[_0x9d15('0xf')](_0x9d15('0x10'));}_0x2bffa9(null,_0x5b1a6e);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 0c232f5..8154375 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 _0x754d=['info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','where','attributes','limit','AddTagsToWhatsappInteraction','find','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','./whatsappInteraction.socket','register','request','then'];(function(_0xac6dfb,_0x59ee38){var _0x2e692a=function(_0x53e34c){while(--_0x53e34c){_0xac6dfb['push'](_0xac6dfb['shift']());}};_0x2e692a(++_0x59ee38);}(_0x754d,0xf5));var _0xd754=function(_0x4b5cb6,_0x158e8e){_0x4b5cb6=_0x4b5cb6-0x0;var _0x5a8f27=_0x754d[_0x4b5cb6];return _0x5a8f27;};'use strict';var _=require(_0xd754('0x0'));var util=require(_0xd754('0x1'));var moment=require(_0xd754('0x2'));var BPromise=require(_0xd754('0x3'));var rs=require(_0xd754('0x4'));var fs=require('fs');var Redis=require(_0xd754('0x5'));var db=require(_0xd754('0x6'))['db'];var utils=require(_0xd754('0x7'));var logger=require(_0xd754('0x8'))('rpc');var config=require(_0xd754('0x9'));var jayson=require(_0xd754('0xa'));var client=jayson[_0xd754('0xb')][_0xd754('0xc')]({'port':0x232a});config[_0xd754('0xd')]=_[_0xd754('0xe')](config[_0xd754('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xd754('0xf'))[_0xd754('0x10')](socket);function respondWithRpcPromise(_0x45c24d,_0xb5021e,_0x6e4903){return new BPromise(function(_0x1eb98d,_0x12ad4b){return client[_0xd754('0x11')](_0x45c24d,_0x6e4903)[_0xd754('0x12')](function(_0x2fab5b){logger[_0xd754('0x13')](_0xd754('0x14'),_0xb5021e,_0xd754('0x15'));logger[_0xd754('0x16')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0xb5021e,_0xd754('0x15'),JSON[_0xd754('0x17')](_0x2fab5b));if(_0x2fab5b[_0xd754('0x18')]){if(_0x2fab5b[_0xd754('0x18')][_0xd754('0x19')]===0x1f4){logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0xb5021e,_0x2fab5b[_0xd754('0x18')][_0xd754('0x1a')]);return _0x12ad4b(_0x2fab5b['error'][_0xd754('0x1a')]);}logger[_0xd754('0x18')](_0xd754('0x14'),_0xb5021e,_0x2fab5b[_0xd754('0x18')][_0xd754('0x1a')]);return _0x1eb98d(_0x2fab5b[_0xd754('0x18')][_0xd754('0x1a')]);}else{logger[_0xd754('0x13')](_0xd754('0x14'),_0xb5021e,'request\x20sent');_0x1eb98d(_0x2fab5b[_0xd754('0x1b')][_0xd754('0x1a')]);}})[_0xd754('0x1c')](function(_0xc4c637){logger[_0xd754('0x18')](_0xd754('0x14'),_0xb5021e,_0xc4c637);_0x12ad4b(_0xc4c637);});});}exports[_0xd754('0x1d')]=function(_0xf34701){var _0x303cbe=this;return new Promise(function(_0x4299ea,_0x43f148){return db[_0xd754('0x1e')][_0xd754('0x1f')](_0xf34701[_0xd754('0x20')],{'raw':_0xf34701[_0xd754('0x21')]?_0xf34701[_0xd754('0x21')][_0xd754('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf34701[_0xd754('0x21')]?_0xf34701['options'][_0xd754('0x23')]||null:null,'attributes':_0xf34701[_0xd754('0x21')]?_0xf34701[_0xd754('0x21')][_0xd754('0x24')]||null:null,'limit':_0xf34701['options']?_0xf34701['options'][_0xd754('0x25')]||null:null})[_0xd754('0x12')](function(_0x5b898d){logger[_0xd754('0x13')](_0xd754('0x1d'),_0xf34701);logger[_0xd754('0x16')](_0xd754('0x1d'),_0xf34701,JSON[_0xd754('0x17')](_0x5b898d));_0x4299ea(_0x5b898d);})['catch'](function(_0x176981){logger[_0xd754('0x18')](_0xd754('0x1d'),_0x176981[_0xd754('0x1a')],_0xf34701);_0x43f148(_0x303cbe[_0xd754('0x18')](0x1f4,_0x176981[_0xd754('0x1a')]));});});};exports[_0xd754('0x26')]=function(_0x6b68e6){return new Promise(function(_0x131e71,_0x3a19f1){return db[_0xd754('0x1e')][_0xd754('0x27')]({'where':_0x6b68e6['options']?_0x6b68e6[_0xd754('0x21')][_0xd754('0x23')]||null:null})[_0xd754('0x12')](function(_0x39412d){if(_0x39412d){return _0x39412d[_0xd754('0x28')](_0x6b68e6['body'][_0xd754('0x29')],_['omit'](_0x6b68e6['body'],['ids','id'])||{});}})[_0xd754('0x2a')](function(_0x4ff166){logger[_0xd754('0x13')](_0xd754('0x2b'),_0x6b68e6);logger['debug']('AddTags',_0x6b68e6,JSON[_0xd754('0x17')](_0x4ff166));_0x131e71(_0x4ff166);})[_0xd754('0x1c')](function(_0xb792de){logger[_0xd754('0x18')](_0xd754('0x2b'),_0xb792de[_0xd754('0x1a')],_0x6b68e6);_0x3a19f1(_this[_0xd754('0x18')](0x1f4,_0xb792de[_0xd754('0x1a')]));});});}; \ No newline at end of file +var _0x3298=['redis','defaults','socket.io-emitter','register','request','then','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','WhatsappInteraction','options','raw','where','UpdateWhatsappInteraction','stringify','AddTagsToWhatsappInteraction','find','addTags','body','ids','omit','spread','AddTags','lodash','util','moment','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http'];(function(_0x1bb07c,_0x43cd16){var _0x30bb8a=function(_0x12ba2f){while(--_0x12ba2f){_0x1bb07c['push'](_0x1bb07c['shift']());}};_0x30bb8a(++_0x43cd16);}(_0x3298,0x173));var _0x8329=function(_0x25093c,_0x5cb04a){_0x25093c=_0x25093c-0x0;var _0x18c113=_0x3298[_0x25093c];return _0x18c113;};'use strict';var _=require(_0x8329('0x0'));var util=require(_0x8329('0x1'));var moment=require(_0x8329('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8329('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8329('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x8329('0x5'));var jayson=require(_0x8329('0x6'));var client=jayson[_0x8329('0x7')][_0x8329('0x8')]({'port':0x232a});config[_0x8329('0x9')]=_[_0x8329('0xa')](config[_0x8329('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x8329('0xb'))(new Redis(config[_0x8329('0x9')]));require('./whatsappInteraction.socket')[_0x8329('0xc')](socket);function respondWithRpcPromise(_0x7b7a45,_0x3672c7,_0x125a3a){return new BPromise(function(_0x2843df,_0x19d992){return client[_0x8329('0xd')](_0x7b7a45,_0x125a3a)[_0x8329('0xe')](function(_0x13081a){logger['info'](_0x8329('0xf'),_0x3672c7,_0x8329('0x10'));logger[_0x8329('0x11')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x3672c7,_0x8329('0x10'),JSON['stringify'](_0x13081a));if(_0x13081a['error']){if(_0x13081a[_0x8329('0x12')][_0x8329('0x13')]===0x1f4){logger[_0x8329('0x12')](_0x8329('0xf'),_0x3672c7,_0x13081a[_0x8329('0x12')]['message']);return _0x19d992(_0x13081a['error'][_0x8329('0x14')]);}logger[_0x8329('0x12')](_0x8329('0xf'),_0x3672c7,_0x13081a['error']['message']);return _0x2843df(_0x13081a['error']['message']);}else{logger[_0x8329('0x15')](_0x8329('0xf'),_0x3672c7,_0x8329('0x10'));_0x2843df(_0x13081a[_0x8329('0x16')][_0x8329('0x14')]);}})[_0x8329('0x17')](function(_0x20d792){logger[_0x8329('0x12')]('WhatsappInteraction,\x20%s,\x20%s',_0x3672c7,_0x20d792);_0x19d992(_0x20d792);});});}exports['UpdateWhatsappInteraction']=function(_0x4256e5){var _0x3b74ae=this;return new Promise(function(_0x3c72a3,_0x414a2b){return db[_0x8329('0x18')]['update'](_0x4256e5['body'],{'raw':_0x4256e5[_0x8329('0x19')]?_0x4256e5[_0x8329('0x19')][_0x8329('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4256e5[_0x8329('0x19')]?_0x4256e5['options'][_0x8329('0x1b')]||null:null,'attributes':_0x4256e5['options']?_0x4256e5[_0x8329('0x19')]['attributes']||null:null,'limit':_0x4256e5[_0x8329('0x19')]?_0x4256e5['options']['limit']||null:null})[_0x8329('0xe')](function(_0x1b1f64){logger[_0x8329('0x15')](_0x8329('0x1c'),_0x4256e5);logger['debug'](_0x8329('0x1c'),_0x4256e5,JSON[_0x8329('0x1d')](_0x1b1f64));_0x3c72a3(_0x1b1f64);})[_0x8329('0x17')](function(_0x77dfcf){logger[_0x8329('0x12')]('UpdateWhatsappInteraction',_0x77dfcf[_0x8329('0x14')],_0x4256e5);_0x414a2b(_0x3b74ae[_0x8329('0x12')](0x1f4,_0x77dfcf[_0x8329('0x14')]));});});};exports[_0x8329('0x1e')]=function(_0x549203){return new Promise(function(_0x556c3c,_0x596133){return db[_0x8329('0x18')][_0x8329('0x1f')]({'where':_0x549203[_0x8329('0x19')]?_0x549203['options'][_0x8329('0x1b')]||null:null})['then'](function(_0x40a8d7){if(_0x40a8d7){return _0x40a8d7[_0x8329('0x20')](_0x549203[_0x8329('0x21')][_0x8329('0x22')],_[_0x8329('0x23')](_0x549203['body'],[_0x8329('0x22'),'id'])||{});}})[_0x8329('0x24')](function(_0x56ebcd){logger[_0x8329('0x15')](_0x8329('0x25'),_0x549203);logger[_0x8329('0x11')](_0x8329('0x25'),_0x549203,JSON[_0x8329('0x1d')](_0x56ebcd));_0x556c3c(_0x56ebcd);})[_0x8329('0x17')](function(_0x53456d){logger[_0x8329('0x12')](_0x8329('0x25'),_0x53456d[_0x8329('0x14')],_0x549203);_0x596133(_this['error'](0x1f4,_0x53456d[_0x8329('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 8178161..54111a7 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 _0xa8b1=['register','length','whatsappInteraction:','./whatsappInteraction.events','save','remove','update','emit','removeListener'];(function(_0x52e7dd,_0x17984d){var _0xee62de=function(_0x4d3a28){while(--_0x4d3a28){_0x52e7dd['push'](_0x52e7dd['shift']());}};_0xee62de(++_0x17984d);}(_0xa8b1,0x1c5));var _0x1a8b=function(_0xfdf8db,_0x3aa794){_0xfdf8db=_0xfdf8db-0x0;var _0x43754e=_0xa8b1[_0xfdf8db];return _0x43754e;};'use strict';var WhatsappInteractionEvents=require(_0x1a8b('0x0'));var events=[_0x1a8b('0x1'),_0x1a8b('0x2'),_0x1a8b('0x3')];function createListener(_0x54fd40,_0x116f20){return function(_0x42a474){_0x116f20[_0x1a8b('0x4')](_0x54fd40,_0x42a474);};}function removeListener(_0x4f63b1,_0x353649){return function(){WhatsappInteractionEvents[_0x1a8b('0x5')](_0x4f63b1,_0x353649);};}exports[_0x1a8b('0x6')]=function(_0x3ca62e){for(var _0x4ff0c3=0x0,_0xa03d16=events[_0x1a8b('0x7')];_0x4ff0c3<_0xa03d16;_0x4ff0c3++){var _0x292319=events[_0x4ff0c3];var _0x13221e=createListener(_0x1a8b('0x8')+_0x292319,_0x3ca62e);WhatsappInteractionEvents['on'](_0x292319,_0x13221e);}}; \ No newline at end of file +var _0x75d8=['whatsappInteraction:','save','update','emit','removeListener','register'];(function(_0x2a294c,_0x1b241){var _0x442fdb=function(_0x2fe0eb){while(--_0x2fe0eb){_0x2a294c['push'](_0x2a294c['shift']());}};_0x442fdb(++_0x1b241);}(_0x75d8,0xeb));var _0x875d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x75d8[_0x3dd15e];return _0x231fd0;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=[_0x875d('0x0'),'remove',_0x875d('0x1')];function createListener(_0x5e12e4,_0x395785){return function(_0x1927b5){_0x395785[_0x875d('0x2')](_0x5e12e4,_0x1927b5);};}function removeListener(_0x27a617,_0x57cc57){return function(){WhatsappInteractionEvents[_0x875d('0x3')](_0x27a617,_0x57cc57);};}exports[_0x875d('0x4')]=function(_0x256e2a){for(var _0x5f25a1=0x0,_0x5ed587=events['length'];_0x5f25a1<_0x5ed587;_0x5f25a1++){var _0x2cccc7=events[_0x5f25a1];var _0x471737=createListener(_0x875d('0x5')+_0x2cccc7,_0x256e2a);WhatsappInteractionEvents['on'](_0x2cccc7,_0x471737);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 0ac10e6..610a5b4 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 _0x6285=['status','put','/:id','update','/:id/accept','/:id/reject','reject','delete','destroy','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','describe','post','whatsapp','create','/:id/status'];(function(_0x2af1fe,_0x29eba5){var _0x6807d0=function(_0x4c220a){while(--_0x4c220a){_0x2af1fe['push'](_0x2af1fe['shift']());}};_0x6807d0(++_0x29eba5);}(_0x6285,0x7c));var _0x5628=function(_0x263334,_0x168cba){_0x263334=_0x263334-0x0;var _0x31f855=_0x6285[_0x263334];return _0x31f855;};'use strict';var multer=require('multer');var util=require(_0x5628('0x0'));var path=require('path');var timeout=require(_0x5628('0x1'));var express=require('express');var router=express[_0x5628('0x2')]();var fs_extra=require(_0x5628('0x3'));var auth=require(_0x5628('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5628('0x5'));var controller=require(_0x5628('0x6'));router[_0x5628('0x7')]('/',auth[_0x5628('0x8')](),controller['index']);router[_0x5628('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x5628('0x9')]);router[_0x5628('0x7')]('/:id',auth[_0x5628('0x8')](),controller['show']);router[_0x5628('0xa')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x5628('0xb'),'whatsappmessage:create'),controller[_0x5628('0xc')]);router[_0x5628('0xa')](_0x5628('0xd'),controller[_0x5628('0xe')]);router[_0x5628('0xf')](_0x5628('0x10'),auth[_0x5628('0x8')](),controller[_0x5628('0x11')]);router[_0x5628('0xf')](_0x5628('0x12'),auth['isAuthenticated'](),controller['accept']);router[_0x5628('0xf')](_0x5628('0x13'),auth['isAuthenticated'](),controller[_0x5628('0x14')]);router[_0x5628('0x15')](_0x5628('0x10'),auth[_0x5628('0x8')](),controller[_0x5628('0x16')]);module['exports']=router; \ No newline at end of file +var _0xc6c7=['/:id/status','status','update','put','/:id/accept','/:id/reject','reject','/:id','exports','connect-timeout','Router','fs-extra','../../components/interaction/service','./whatsappMessage.controller','isAuthenticated','index','get','describe','post','tracked','whatsapp','whatsappmessage:create','create'];(function(_0x4e4555,_0x277e77){var _0x5714dc=function(_0x17d603){while(--_0x17d603){_0x4e4555['push'](_0x4e4555['shift']());}};_0x5714dc(++_0x277e77);}(_0xc6c7,0xaa));var _0x7c6c=function(_0x3e6b2f,_0x1ffa07){_0x3e6b2f=_0x3e6b2f-0x0;var _0x323215=_0xc6c7[_0x3e6b2f];return _0x323215;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x7c6c('0x0'));var express=require('express');var router=express[_0x7c6c('0x1')]();var fs_extra=require(_0x7c6c('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x7c6c('0x3'));var config=require('../../config/environment');var controller=require(_0x7c6c('0x4'));router['get']('/',auth[_0x7c6c('0x5')](),controller[_0x7c6c('0x6')]);router[_0x7c6c('0x7')]('/describe',auth[_0x7c6c('0x5')](),controller[_0x7c6c('0x8')]);router[_0x7c6c('0x7')]('/:id',auth[_0x7c6c('0x5')](),controller['show']);router[_0x7c6c('0x9')]('/',auth[_0x7c6c('0x5')](),interaction[_0x7c6c('0xa')](_0x7c6c('0xb'),_0x7c6c('0xc')),controller[_0x7c6c('0xd')]);router[_0x7c6c('0x9')](_0x7c6c('0xe'),controller[_0x7c6c('0xf')]);router['put']('/:id',auth[_0x7c6c('0x5')](),controller[_0x7c6c('0x10')]);router[_0x7c6c('0x11')](_0x7c6c('0x12'),auth[_0x7c6c('0x5')](),controller['accept']);router[_0x7c6c('0x11')](_0x7c6c('0x13'),auth[_0x7c6c('0x5')](),controller[_0x7c6c('0x14')]);router['delete'](_0x7c6c('0x15'),auth[_0x7c6c('0x5')](),controller['destroy']);module[_0x7c6c('0x16')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index d4dbafa..6a19cb6 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 _0x6007=['exports','TEXT','medium','BOOLEAN','out','STRING','DATE','sequelize'];(function(_0x2147ae,_0x37d08e){var _0x577f4a=function(_0x2ba48c){while(--_0x2ba48c){_0x2147ae['push'](_0x2147ae['shift']());}};_0x577f4a(++_0x37d08e);}(_0x6007,0x8f));var _0x7600=function(_0x307bf6,_0x55bdd5){_0x307bf6=_0x307bf6-0x0;var _0x2878fc=_0x6007[_0x307bf6];return _0x2878fc;};'use strict';var Sequelize=require(_0x7600('0x0'));module[_0x7600('0x1')]={'body':{'type':Sequelize[_0x7600('0x2')](_0x7600('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x7600('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x7600('0x5')),'defaultValue':_0x7600('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x7600('0x6')](0xbe)},'phone':{'type':Sequelize[_0x7600('0x6')]},'readAt':{'type':Sequelize[_0x7600('0x7')]},'secret':{'type':Sequelize[_0x7600('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x7600('0x6')]},'providerResponse':{'type':Sequelize[_0x7600('0x2')]}}; \ No newline at end of file +var _0xc58a=['ENUM','out','STRING','DATE','exports','TEXT','medium','BOOLEAN'];(function(_0x3932eb,_0x43b210){var _0x5316e5=function(_0x1744e8){while(--_0x1744e8){_0x3932eb['push'](_0x3932eb['shift']());}};_0x5316e5(++_0x43b210);}(_0xc58a,0x64));var _0xac58=function(_0x1fdb40,_0x51351c){_0x1fdb40=_0x1fdb40-0x0;var _0x281f93=_0xc58a[_0x1fdb40];return _0x281f93;};'use strict';var Sequelize=require('sequelize');module[_0xac58('0x0')]={'body':{'type':Sequelize[_0xac58('0x1')](_0xac58('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xac58('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xac58('0x4')]('in',_0xac58('0x5')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0xac58('0x6')]},'readAt':{'type':Sequelize[_0xac58('0x7')]},'secret':{'type':Sequelize[_0xac58('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xac58('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index a5e702e..7940fdd 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 _0x5373=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','end','offset','undefined','count','limit','set','json','reject','save','update','destroy','stack','name','send','index','WhatsappMessage','rawAttributes','type','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','options','includeAll','include','findAll','show','params','find','create','body','describe','whatsapp-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteractionId','read1stAt','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','User','email','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','whatsapp','WhatsappInteraction','interaction','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','QueryTypes','fullname','rejectmessage','WhatsappAccount','WhatsappAccountId','debug','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','papaparse','../../components/parsers/qs'];(function(_0x21e693,_0x30d25b){var _0x117cd5=function(_0xf0f0d3){while(--_0xf0f0d3){_0x21e693['push'](_0x21e693['shift']());}};_0x117cd5(++_0x30d25b);}(_0x5373,0x18e));var _0x3537=function(_0x2a54ad,_0x263efc){_0x2a54ad=_0x2a54ad-0x0;var _0x1ed48b=_0x5373[_0x2a54ad];return _0x1ed48b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3537('0x0'));var zipdir=require(_0x3537('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3537('0x2'));var moment=require(_0x3537('0x3'));var BPromise=require(_0x3537('0x4'));var Mustache=require(_0x3537('0x5'));var util=require(_0x3537('0x6'));var path=require(_0x3537('0x7'));var sox=require(_0x3537('0x8'));var csv=require(_0x3537('0x9'));var ejs=require(_0x3537('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3537('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3537('0xc'));var deskjs=require(_0x3537('0xd'));var toCsv=require(_0x3537('0x9'));var querystring=require('querystring');var Papa=require(_0x3537('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3537('0xf'));var as=require(_0x3537('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3537('0x11'))(_0x3537('0x12'));var utils=require(_0x3537('0x13'));var config=require(_0x3537('0x14'));var licenseUtil=require(_0x3537('0x15'));var db=require(_0x3537('0x16'))['db'];config[_0x3537('0x17')]=_[_0x3537('0x18')](config[_0x3537('0x17')],{'host':_0x3537('0x19'),'port':0x18eb});var socket=require(_0x3537('0x1a'))(new Redis(config[_0x3537('0x17')]));require(_0x3537('0x1b'))[_0x3537('0x1c')](socket);var jayson=require(_0x3537('0x1d'));var client=jayson[_0x3537('0x1e')][_0x3537('0x1f')]({'port':0x232c});var client9002=jayson[_0x3537('0x1e')][_0x3537('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0xbe9d26,_0x53266d,_0x458771,_0x59a64e){return new BPromise(function(_0x53fc18,_0x188e98){var _0x35c4ee=_0x59a64e||client;return _0x35c4ee[_0x3537('0x20')](_0xbe9d26,_0x458771)[_0x3537('0x21')](function(_0x1d88d1){logger[_0x3537('0x22')](_0x3537('0x23'),_0x53266d,_0x3537('0x24'));logger['debug'](_0x3537('0x25'),_0x53266d,_0x3537('0x24'),JSON[_0x3537('0x26')](_0x1d88d1));if(_0x1d88d1[_0x3537('0x27')]){if(_0x1d88d1[_0x3537('0x27')]['code']===0x1f4){logger['error'](_0x3537('0x23'),_0x53266d,_0x1d88d1[_0x3537('0x27')][_0x3537('0x28')]);return _0x188e98(_0x1d88d1[_0x3537('0x27')][_0x3537('0x28')]);}logger[_0x3537('0x27')](_0x3537('0x23'),_0x53266d,_0x1d88d1[_0x3537('0x27')][_0x3537('0x28')]);return _0x53fc18(_0x1d88d1[_0x3537('0x27')]['message']);}else{logger[_0x3537('0x22')]('WhatsappMessage,\x20%s,\x20%s',_0x53266d,_0x3537('0x24'));_0x53fc18(_0x1d88d1['result']['message']);}})[_0x3537('0x29')](function(_0x206142){logger[_0x3537('0x27')](_0x3537('0x23'),_0x53266d,_0x206142);_0x188e98(_0x206142);});});}function respondWithStatusCode(_0x121ec4,_0x57c0ad){_0x57c0ad=_0x57c0ad||0xcc;return function(_0xf05d64){if(_0xf05d64){return _0x121ec4[_0x3537('0x2a')](_0x57c0ad);}return _0x121ec4[_0x3537('0x2b')](_0x57c0ad)[_0x3537('0x2c')]();};}function respondWithResult(_0x27e095,_0x56cbac){_0x56cbac=_0x56cbac||0xc8;return function(_0x4097f5){if(_0x4097f5){return _0x27e095[_0x3537('0x2b')](_0x56cbac)['json'](_0x4097f5);}};}function respondWithFilteredResult(_0x453d84,_0x69aebe){return function(_0x36d178){if(_0x36d178){var _0x4a8bb5=typeof _0x69aebe[_0x3537('0x2d')]===_0x3537('0x2e')&&typeof _0x69aebe['limit']==='undefined';var _0x19902b=_0x36d178['count'];var _0x195b07=_0x4a8bb5?0x0:_0x69aebe['offset'];var _0x35e0a0=_0x4a8bb5?_0x36d178[_0x3537('0x2f')]:_0x69aebe['offset']+_0x69aebe[_0x3537('0x30')];var _0x385456;if(_0x35e0a0>=_0x19902b){_0x35e0a0=_0x19902b;_0x385456=0xc8;}else{_0x385456=0xce;}_0x453d84['status'](_0x385456);return _0x453d84[_0x3537('0x31')]('Content-Range',_0x195b07+'-'+_0x35e0a0+'/'+_0x19902b)[_0x3537('0x32')](_0x36d178);}return null;};}function patchUpdates(_0x50325d){return function(_0x1a72af){try{jsonpatch['apply'](_0x1a72af,_0x50325d,!![]);}catch(_0x1abf4f){return BPromise[_0x3537('0x33')](_0x1abf4f);}return _0x1a72af[_0x3537('0x34')]();};}function saveUpdates(_0x308dd7,_0x32a544){return function(_0x24edb9){if(_0x24edb9){return _0x24edb9[_0x3537('0x35')](_0x308dd7)[_0x3537('0x21')](function(_0x97b3a6){return _0x97b3a6;});}return null;};}function removeEntity(_0x34c347,_0x4ab391){return function(_0x309e94){if(_0x309e94){return _0x309e94[_0x3537('0x36')]()[_0x3537('0x21')](function(){_0x34c347[_0x3537('0x2b')](0xcc)[_0x3537('0x2c')]();});}};}function handleEntityNotFound(_0x27c953,_0x2edb54){return function(_0x271126){if(!_0x271126){_0x27c953[_0x3537('0x2a')](0x194);}return _0x271126;};}function handleError(_0x216196,_0x100470){_0x100470=_0x100470||0x1f4;return function(_0xd4c455){logger[_0x3537('0x27')](_0xd4c455[_0x3537('0x37')]);if(_0xd4c455[_0x3537('0x38')]){delete _0xd4c455[_0x3537('0x38')];}_0x216196['status'](_0x100470)[_0x3537('0x39')](_0xd4c455);};}exports[_0x3537('0x3a')]=function(_0x2f79a1,_0x445f2f){var _0x2fc6a1={},_0x143b99={},_0x16498e={'count':0x0,'rows':[]};var _0x4219c7=_['map'](db[_0x3537('0x3b')][_0x3537('0x3c')],function(_0x677339){return{'name':_0x677339['fieldName'],'type':_0x677339[_0x3537('0x3d')]['key']};});_0x143b99[_0x3537('0x3e')]=_[_0x3537('0x3f')](_0x4219c7,_0x3537('0x38'));_0x143b99[_0x3537('0x40')]=_[_0x3537('0x41')](_0x2f79a1[_0x3537('0x40')]);_0x143b99[_0x3537('0x42')]=_[_0x3537('0x43')](_0x143b99['model'],_0x143b99['query']);_0x2fc6a1['attributes']=_[_0x3537('0x43')](_0x143b99[_0x3537('0x3e')],qs[_0x3537('0x44')](_0x2f79a1[_0x3537('0x40')][_0x3537('0x44')]));_0x2fc6a1[_0x3537('0x45')]=_0x2fc6a1[_0x3537('0x45')][_0x3537('0x46')]?_0x2fc6a1[_0x3537('0x45')]:_0x143b99['model'];if(!_0x2f79a1[_0x3537('0x40')][_0x3537('0x47')](_0x3537('0x48'))){_0x2fc6a1['limit']=qs[_0x3537('0x30')](_0x2f79a1[_0x3537('0x40')]['limit']);_0x2fc6a1[_0x3537('0x2d')]=qs['offset'](_0x2f79a1[_0x3537('0x40')][_0x3537('0x2d')]);}_0x2fc6a1['order']=qs['sort'](_0x2f79a1['query'][_0x3537('0x49')]);_0x2fc6a1['where']=qs[_0x3537('0x42')](_[_0x3537('0x4a')](_0x2f79a1[_0x3537('0x40')],_0x143b99[_0x3537('0x42')]),_0x4219c7);if(_0x2f79a1[_0x3537('0x40')][_0x3537('0x4b')]){_0x2fc6a1['where']=_[_0x3537('0x4c')](_0x2fc6a1[_0x3537('0x4d')],{'$or':_[_0x3537('0x3f')](_0x4219c7,function(_0x5c8808){if(_0x5c8808[_0x3537('0x3d')]!=='VIRTUAL'){var _0x325d8b={};_0x325d8b[_0x5c8808[_0x3537('0x38')]]={'$like':'%'+_0x2f79a1[_0x3537('0x40')]['filter']+'%'};return _0x325d8b;}})});}_0x2fc6a1=_['merge']({},_0x2fc6a1,_0x2f79a1[_0x3537('0x4e')]);var _0xafd18f={'where':_0x2fc6a1[_0x3537('0x4d')]};return db['WhatsappMessage']['count'](_0xafd18f)[_0x3537('0x21')](function(_0x56a4a3){_0x16498e['count']=_0x56a4a3;if(_0x2f79a1[_0x3537('0x40')][_0x3537('0x4f')]){_0x2fc6a1[_0x3537('0x50')]=[{'all':!![]}];}return db[_0x3537('0x3b')][_0x3537('0x51')](_0x2fc6a1);})[_0x3537('0x21')](function(_0x45ad97){_0x16498e['rows']=_0x45ad97;return _0x16498e;})[_0x3537('0x21')](respondWithFilteredResult(_0x445f2f,_0x2fc6a1))['catch'](handleError(_0x445f2f,null));};exports[_0x3537('0x52')]=function(_0xbc580c,_0x3a11ee){var _0x38cf50={'raw':!![],'where':{'id':_0xbc580c[_0x3537('0x53')]['id']}},_0x141afe={};_0x141afe['model']=_[_0x3537('0x41')](db[_0x3537('0x3b')]['rawAttributes']);_0x141afe[_0x3537('0x40')]=_[_0x3537('0x41')](_0xbc580c[_0x3537('0x40')]);_0x141afe[_0x3537('0x42')]=_[_0x3537('0x43')](_0x141afe[_0x3537('0x3e')],_0x141afe['query']);_0x38cf50[_0x3537('0x45')]=_[_0x3537('0x43')](_0x141afe[_0x3537('0x3e')],qs[_0x3537('0x44')](_0xbc580c[_0x3537('0x40')][_0x3537('0x44')]));_0x38cf50['attributes']=_0x38cf50[_0x3537('0x45')][_0x3537('0x46')]?_0x38cf50[_0x3537('0x45')]:_0x141afe[_0x3537('0x3e')];if(_0xbc580c[_0x3537('0x40')][_0x3537('0x4f')]){_0x38cf50[_0x3537('0x50')]=[{'all':!![]}];}_0x38cf50=_[_0x3537('0x4c')]({},_0x38cf50,_0xbc580c[_0x3537('0x4e')]);return db['WhatsappMessage'][_0x3537('0x54')](_0x38cf50)[_0x3537('0x21')](handleEntityNotFound(_0x3a11ee,null))['then'](respondWithResult(_0x3a11ee,null))[_0x3537('0x29')](handleError(_0x3a11ee,null));};exports[_0x3537('0x55')]=function(_0x30a402,_0x3ddae2){return db[_0x3537('0x3b')][_0x3537('0x55')](_0x30a402[_0x3537('0x56')],{})[_0x3537('0x21')](respondWithResult(_0x3ddae2,0xc9))[_0x3537('0x29')](handleError(_0x3ddae2,null));};exports[_0x3537('0x35')]=function(_0x203c39,_0x273975){if(_0x203c39[_0x3537('0x56')]['id']){delete _0x203c39[_0x3537('0x56')]['id'];}return db['WhatsappMessage'][_0x3537('0x54')]({'where':{'id':_0x203c39[_0x3537('0x53')]['id']}})[_0x3537('0x21')](handleEntityNotFound(_0x273975,null))[_0x3537('0x21')](saveUpdates(_0x203c39[_0x3537('0x56')],null))[_0x3537('0x21')](respondWithResult(_0x273975,null))['catch'](handleError(_0x273975,null));};exports[_0x3537('0x36')]=function(_0xab5e3d,_0x99957b){return db[_0x3537('0x3b')]['find']({'where':{'id':_0xab5e3d['params']['id']}})[_0x3537('0x21')](handleEntityNotFound(_0x99957b,null))['then'](removeEntity(_0x99957b,null))['catch'](handleError(_0x99957b,null));};exports[_0x3537('0x57')]=function(_0x534496,_0x5511f8){return db[_0x3537('0x3b')][_0x3537('0x57')]()['then'](respondWithResult(_0x5511f8,null))[_0x3537('0x29')](handleError(_0x5511f8,null));};var interaction_log=require(_0x3537('0x11'))(_0x3537('0x58'));exports[_0x3537('0x59')]=function(_0x160bd9,_0x158ec8,_0x294e53){var _0x28c995={'agent':{},'channel':'whatsapp'};if(_0x160bd9[_0x3537('0x56')]['id']){delete _0x160bd9[_0x3537('0x56')]['id'];}_0x160bd9[_0x3537('0x56')][_0x3537('0x5a')]=!![];_0x160bd9[_0x3537('0x56')][_0x3537('0x5b')]=moment()[_0x3537('0x5c')](_0x3537('0x5d'));_0x160bd9[_0x3537('0x56')][_0x3537('0x5e')]=_0x160bd9[_0x3537('0x56')][_0x3537('0x5e')]||_0x160bd9[_0x3537('0x5f')]['id'];_0x28c995[_0x3537('0x60')]['id']=_0x160bd9[_0x3537('0x56')][_0x3537('0x5e')];return db[_0x3537('0x3b')][_0x3537('0x54')]({'where':{'id':_0x160bd9[_0x3537('0x53')]['id'],'UserId':null}})[_0x3537('0x21')](handleEntityNotFound(_0x158ec8,null))[_0x3537('0x21')](saveUpdates(_0x160bd9[_0x3537('0x56')],null))['then'](function(_0x2c331b){if(_0x2c331b){_0x28c995['message']=_0x2c331b[_0x3537('0x61')]({'plain':!![]});return db['WhatsappInteraction']['find']({'where':{'id':_0x2c331b[_0x3537('0x62')]}});}return null;})[_0x3537('0x21')](handleEntityNotFound(_0x158ec8,null))[_0x3537('0x21')](function(_0x5df6c9){if(_0x5df6c9){return _0x5df6c9[_0x3537('0x35')]({'UserId':_0x160bd9[_0x3537('0x56')]['UserId'],'read1stAt':_['isNil'](_0x5df6c9[_0x3537('0x63')])?moment()[_0x3537('0x5c')](_0x3537('0x5d')):undefined});}return null;})[_0x3537('0x21')](function(_0x1555a4){if(_0x1555a4){_0x28c995['interaction']=_0x1555a4[_0x3537('0x61')]({'plain':!![]});interaction_log[_0x3537('0x22')](_0x3537('0x64'),_0x160bd9[_0x3537('0x5f')]['id'],_0x160bd9['user'][_0x3537('0x38')],_0x160bd9[_0x3537('0x5f')][_0x3537('0x65')],_0x28c995['interaction']['id'],_0x160bd9[_0x3537('0x56')]?JSON[_0x3537('0x26')](_0x160bd9[_0x3537('0x56')]):_0x3537('0x66'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x28c995);}return null;})[_0x3537('0x21')](function(_0xef39c){var _0x567e87=_0x3537('0x67')+_0xef39c[_0x3537('0x28')][_0x3537('0x68')];return db[_0x3537('0x69')]['query'](_0x567e87,{'type':db[_0x3537('0x6a')]['QueryTypes'][_0x3537('0x6b')],'raw':!![]})[_0x3537('0x21')](function(_0x3688ee){return _0x3688ee;});})[_0x3537('0x21')](function(_0x5d8183){if(_0x5d8183){_0x28c995[_0x3537('0x28')][_0x3537('0x6c')]=_0x5d8183[0x0];if(!_0x160bd9['body']['UserId'])return;return db[_0x3537('0x6d')][_0x3537('0x54')]({'where':{'id':_0x160bd9['body'][_0x3537('0x5e')],'role':_0x3537('0x60')},'attributes':['id',_0x3537('0x38'),'fullname',_0x3537('0x6e'),'internal'],'raw':!![]});}return null;})['then'](function(_0x2c57fd){if(!_0x2c57fd)return null;_0x28c995[_0x3537('0x28')]['agent']=_0x2c57fd;return _0x28c995;})[_0x3537('0x21')](function(_0x29fc1a){if(_0x29fc1a){if(_0x160bd9[_0x3537('0x56')][_0x3537('0x6f')]){_0x28c995['message'][_0x3537('0x70')]=util[_0x3537('0x5c')](_0x3537('0x71'),_0x160bd9[_0x3537('0x5f')][_0x3537('0x38')]);_0x28c995[_0x3537('0x28')]['channel']=_0x28c995[_0x3537('0x72')];_0x28c995[_0x3537('0x28')][_0x3537('0x73')]=_0x28c995[_0x3537('0x72')];_0x28c995[_0x3537('0x28')][_0x3537('0x74')]=_0x3537('0x59');return respondWithRpcPromise(_0x3537('0x75'),_0x3537('0x75'),{'event':_0x3537('0x76'),'message':_0x28c995[_0x3537('0x28')]},client9002)[_0x3537('0x21')](function(){return _0x28c995;});}return _0x28c995;}return null;})[_0x3537('0x21')](respondWithResult(_0x158ec8,null))[_0x3537('0x29')](handleError(_0x158ec8,null));};var interaction_log=require(_0x3537('0x11'))(_0x3537('0x58'));exports['reject']=function(_0x4b064e,_0x40322c,_0x1ef456){var _0x24caea={'agent':{},'channel':_0x3537('0x77')};if(_0x4b064e[_0x3537('0x56')]['id']){delete _0x4b064e['body']['id'];}_0x4b064e[_0x3537('0x56')][_0x3537('0x5e')]=_0x4b064e[_0x3537('0x56')][_0x3537('0x5e')]||_0x4b064e['user']['id'];_0x24caea[_0x3537('0x60')]['id']=_0x4b064e[_0x3537('0x56')][_0x3537('0x5e')];return db[_0x3537('0x3b')][_0x3537('0x54')]({'where':{'id':_0x4b064e[_0x3537('0x53')]['id'],'UserId':null}})[_0x3537('0x21')](handleEntityNotFound(_0x40322c,null))['then'](function(_0x941749){if(_0x941749){_0x24caea[_0x3537('0x28')]=_0x941749[_0x3537('0x61')]({'plain':!![]});return db[_0x3537('0x78')]['find']({'where':{'id':_0x941749['WhatsappInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x40322c,null))[_0x3537('0x21')](function(_0x1e0785){if(_0x1e0785){_0x24caea[_0x3537('0x79')]=_0x1e0785[_0x3537('0x61')]({'plain':!![]});interaction_log[_0x3537('0x22')](_0x3537('0x7a'),_0x4b064e[_0x3537('0x5f')]['id'],_0x4b064e[_0x3537('0x5f')][_0x3537('0x38')],_0x4b064e[_0x3537('0x5f')]['role'],_0x24caea[_0x3537('0x79')]['id'],_0x4b064e['body']?JSON[_0x3537('0x26')](_0x4b064e[_0x3537('0x56')]):_0x3537('0x66'));return respondWithRpcPromise(_0x3537('0x7b'),'rejectMessage',_0x24caea);}return null;})[_0x3537('0x21')](function(_0x2c6f7a){var _0x22fa5a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2c6f7a[_0x3537('0x28')]['ContactId'];return db[_0x3537('0x69')][_0x3537('0x40')](_0x22fa5a,{'type':db[_0x3537('0x6a')][_0x3537('0x7c')][_0x3537('0x6b')],'raw':!![]})['then'](function(_0x21509b){return _0x21509b;});})['then'](function(_0x761a18){if(_0x761a18){_0x24caea[_0x3537('0x28')][_0x3537('0x6c')]=_0x761a18[0x0];if(!_0x4b064e['body'][_0x3537('0x5e')])return;return db[_0x3537('0x6d')][_0x3537('0x54')]({'where':{'id':_0x4b064e['body'][_0x3537('0x5e')],'role':_0x3537('0x60')},'attributes':['id',_0x3537('0x38'),_0x3537('0x7d'),'email','internal'],'raw':!![]});}return null;})['then'](function(_0x136b40){if(!_0x136b40)return null;_0x24caea[_0x3537('0x28')][_0x3537('0x60')]=_0x136b40;return _0x24caea;})[_0x3537('0x21')](function(_0xe34769){if(_0xe34769){_0xe34769[_0x3537('0x28')][_0x3537('0x70')]=util[_0x3537('0x5c')]('SIP/%s',_0x4b064e[_0x3537('0x5f')]['name']);_0xe34769['message'][_0x3537('0x72')]=_0x24caea[_0x3537('0x72')];_0xe34769[_0x3537('0x28')][_0x3537('0x73')]=_0x24caea[_0x3537('0x72')];_0xe34769[_0x3537('0x28')][_0x3537('0x74')]=_0x3537('0x33');respondWithRpcPromise(_0x3537('0x75'),'EventManager',{'event':_0x3537('0x7e'),'message':_0xe34769[_0x3537('0x28')]},client9002);return _0x24caea;}return null;})[_0x3537('0x21')](respondWithResult(_0x40322c,null))[_0x3537('0x29')](handleError(_0x40322c,null));};exports['status']=function(_0x2396b7,_0x1b87cb,_0x28e483){if(_0x2396b7['body']['id']){delete _0x2396b7[_0x3537('0x56')]['id'];}var _0x373b3e;return db[_0x3537('0x3b')]['find']({'where':{'id':_0x2396b7[_0x3537('0x53')]['id']}})[_0x3537('0x21')](handleEntityNotFound(_0x1b87cb,null))[_0x3537('0x21')](function(_0xe544a9){if(_0xe544a9){_0x373b3e=_0xe544a9;return db[_0x3537('0x7f')][_0x3537('0x54')]({'where':{'id':_0xe544a9[_0x3537('0x80')]}});}})[_0x3537('0x21')](handleEntityNotFound(_0x1b87cb,null))['then'](function(_0x42af68){if(_0x42af68){logger[_0x3537('0x81')](_0x3537('0x82'),_0x3537('0x2b'),_0x3537('0x83'),_0x42af68['type'],util[_0x3537('0x84')](_0x2396b7[_0x3537('0x56')],{'showHidden':![],'depth':null}));switch(_0x42af68['type']){case _0x3537('0x85'):if(_0x2396b7['body'][_0x3537('0x86')]&&_0x2396b7[_0x3537('0x56')][_0x3537('0x86')]===_0x373b3e[_0x3537('0x87')]&&_0x2396b7['body'][_0x3537('0x88')]&&_0x2396b7['body'][_0x3537('0x88')]===_0x3537('0x5a')){return _0x373b3e[_0x3537('0x35')]({'read':!![]});}else{logger['error'](_0x3537('0x89'),_0x3537('0x2b'),_0x3537('0x85'),util[_0x3537('0x84')](_0x2396b7[_0x3537('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x373b3e;}})['then'](respondWithResult(_0x1b87cb,null))['catch'](handleError(_0x1b87cb,null));}; \ No newline at end of file +var _0x06f5=['nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','findAll','rows','show','params','keys','includeAll','include','find','create','body','update','describe','../../config/logger','whatsapp-interactions','accept','whatsapp','readAt','format','UserId','user','agent','get','WhatsappInteractionId','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','email','manual','channel','motionChannel','EventManager','acceptmessage','WhatsappInteraction','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','Sequelize','fullname','internal','interface','event','rejectmessage','received\x20delivery\x20report\x20from','twilio','MessageSid','MessageStatus','read','WhatsappAccount,\x20%s,\x20%s,\x20%s','inspect','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','sendStatus','stack','name','send','WhatsappMessage','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty'];(function(_0x5993de,_0x1e902f){var _0x481faf=function(_0x11dea1){while(--_0x11dea1){_0x5993de['push'](_0x5993de['shift']());}};_0x481faf(++_0x1e902f);}(_0x06f5,0x1e4));var _0x506f=function(_0x1147ff,_0x3e62f3){_0x1147ff=_0x1147ff-0x0;var _0x79b1e9=_0x06f5[_0x1147ff];return _0x79b1e9;};'use strict';var emlformat=require(_0x506f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x506f('0x1'));var jsonpatch=require(_0x506f('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x506f('0x3'));var Mustache=require(_0x506f('0x4'));var util=require(_0x506f('0x5'));var path=require(_0x506f('0x6'));var sox=require(_0x506f('0x7'));var csv=require(_0x506f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x506f('0x9'));var _=require(_0x506f('0xa'));var squel=require(_0x506f('0xb'));var crypto=require(_0x506f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x506f('0xd'));var toCsv=require(_0x506f('0x8'));var querystring=require('querystring');var Papa=require(_0x506f('0xe'));var Redis=require(_0x506f('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x506f('0x10'));var as=require(_0x506f('0x11'));var hardwareService=require(_0x506f('0x12'));var logger=require('../../config/logger')(_0x506f('0x13'));var utils=require(_0x506f('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x506f('0x15'));var db=require(_0x506f('0x16'))['db'];config[_0x506f('0x17')]=_[_0x506f('0x18')](config[_0x506f('0x17')],{'host':_0x506f('0x19'),'port':0x18eb});var socket=require(_0x506f('0x1a'))(new Redis(config[_0x506f('0x17')]));require(_0x506f('0x1b'))[_0x506f('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x506f('0x1d')][_0x506f('0x1e')]({'port':0x232c});var client9002=jayson[_0x506f('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x73c8e3,_0x2906c7,_0x737118,_0xd9cc8f){return new BPromise(function(_0x197d5f,_0x5dba7b){var _0xdc6282=_0xd9cc8f||client;return _0xdc6282[_0x506f('0x1f')](_0x73c8e3,_0x737118)[_0x506f('0x20')](function(_0xc9eded){logger[_0x506f('0x21')](_0x506f('0x22'),_0x2906c7,'request\x20sent');logger[_0x506f('0x23')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x2906c7,_0x506f('0x24'),JSON['stringify'](_0xc9eded));if(_0xc9eded[_0x506f('0x25')]){if(_0xc9eded[_0x506f('0x25')][_0x506f('0x26')]===0x1f4){logger['error'](_0x506f('0x22'),_0x2906c7,_0xc9eded[_0x506f('0x25')][_0x506f('0x27')]);return _0x5dba7b(_0xc9eded[_0x506f('0x25')][_0x506f('0x27')]);}logger[_0x506f('0x25')]('WhatsappMessage,\x20%s,\x20%s',_0x2906c7,_0xc9eded[_0x506f('0x25')]['message']);return _0x197d5f(_0xc9eded[_0x506f('0x25')][_0x506f('0x27')]);}else{logger['info'](_0x506f('0x22'),_0x2906c7,_0x506f('0x24'));_0x197d5f(_0xc9eded[_0x506f('0x28')]['message']);}})[_0x506f('0x29')](function(_0x1855d6){logger[_0x506f('0x25')](_0x506f('0x22'),_0x2906c7,_0x1855d6);_0x5dba7b(_0x1855d6);});});}function respondWithStatusCode(_0x22af61,_0x222795){_0x222795=_0x222795||0xcc;return function(_0x5c7313){if(_0x5c7313){return _0x22af61['sendStatus'](_0x222795);}return _0x22af61['status'](_0x222795)[_0x506f('0x2a')]();};}function respondWithResult(_0x176212,_0x3e50a6){_0x3e50a6=_0x3e50a6||0xc8;return function(_0x296d85){if(_0x296d85){return _0x176212[_0x506f('0x2b')](_0x3e50a6)[_0x506f('0x2c')](_0x296d85);}};}function respondWithFilteredResult(_0x2b0ade,_0xa6861){return function(_0x486322){if(_0x486322){var _0x20bd65=typeof _0xa6861[_0x506f('0x2d')]===_0x506f('0x2e')&&typeof _0xa6861[_0x506f('0x2f')]===_0x506f('0x2e');var _0x191f55=_0x486322[_0x506f('0x30')];var _0x185ef3=_0x20bd65?0x0:_0xa6861[_0x506f('0x2d')];var _0x1970b3=_0x20bd65?_0x486322['count']:_0xa6861[_0x506f('0x2d')]+_0xa6861[_0x506f('0x2f')];var _0x50c74e;if(_0x1970b3>=_0x191f55){_0x1970b3=_0x191f55;_0x50c74e=0xc8;}else{_0x50c74e=0xce;}_0x2b0ade[_0x506f('0x2b')](_0x50c74e);return _0x2b0ade[_0x506f('0x31')](_0x506f('0x32'),_0x185ef3+'-'+_0x1970b3+'/'+_0x191f55)['json'](_0x486322);}return null;};}function patchUpdates(_0x334210){return function(_0x3698c5){try{jsonpatch[_0x506f('0x33')](_0x3698c5,_0x334210,!![]);}catch(_0x36557f){return BPromise[_0x506f('0x34')](_0x36557f);}return _0x3698c5[_0x506f('0x35')]();};}function saveUpdates(_0x5e0a16,_0x33cacf){return function(_0x3f9595){if(_0x3f9595){return _0x3f9595['update'](_0x5e0a16)[_0x506f('0x20')](function(_0x2f2f0c){return _0x2f2f0c;});}return null;};}function removeEntity(_0x18fa78,_0x4e9cbb){return function(_0x546567){if(_0x546567){return _0x546567[_0x506f('0x36')]()[_0x506f('0x20')](function(){_0x18fa78[_0x506f('0x2b')](0xcc)[_0x506f('0x2a')]();});}};}function handleEntityNotFound(_0x3807b6,_0x34ee04){return function(_0x594da5){if(!_0x594da5){_0x3807b6[_0x506f('0x37')](0x194);}return _0x594da5;};}function handleError(_0x407387,_0x58c4d9){_0x58c4d9=_0x58c4d9||0x1f4;return function(_0xc3f473){logger['error'](_0xc3f473[_0x506f('0x38')]);if(_0xc3f473[_0x506f('0x39')]){delete _0xc3f473[_0x506f('0x39')];}_0x407387[_0x506f('0x2b')](_0x58c4d9)[_0x506f('0x3a')](_0xc3f473);};}exports['index']=function(_0x304c15,_0x463057){var _0x11c7ff={},_0x5dac03={},_0x5f111a={'count':0x0,'rows':[]};var _0x1a7fac=_['map'](db[_0x506f('0x3b')][_0x506f('0x3c')],function(_0x3a4e0d){return{'name':_0x3a4e0d[_0x506f('0x3d')],'type':_0x3a4e0d[_0x506f('0x3e')]['key']};});_0x5dac03['model']=_[_0x506f('0x3f')](_0x1a7fac,_0x506f('0x39'));_0x5dac03[_0x506f('0x40')]=_['keys'](_0x304c15['query']);_0x5dac03[_0x506f('0x41')]=_[_0x506f('0x42')](_0x5dac03[_0x506f('0x43')],_0x5dac03[_0x506f('0x40')]);_0x11c7ff[_0x506f('0x44')]=_[_0x506f('0x42')](_0x5dac03[_0x506f('0x43')],qs[_0x506f('0x45')](_0x304c15['query']['fields']));_0x11c7ff[_0x506f('0x44')]=_0x11c7ff['attributes'][_0x506f('0x46')]?_0x11c7ff[_0x506f('0x44')]:_0x5dac03[_0x506f('0x43')];if(!_0x304c15['query'][_0x506f('0x47')](_0x506f('0x48'))){_0x11c7ff[_0x506f('0x2f')]=qs['limit'](_0x304c15[_0x506f('0x40')]['limit']);_0x11c7ff[_0x506f('0x2d')]=qs[_0x506f('0x2d')](_0x304c15[_0x506f('0x40')][_0x506f('0x2d')]);}_0x11c7ff[_0x506f('0x49')]=qs[_0x506f('0x4a')](_0x304c15[_0x506f('0x40')][_0x506f('0x4a')]);_0x11c7ff[_0x506f('0x4b')]=qs[_0x506f('0x41')](_[_0x506f('0x4c')](_0x304c15[_0x506f('0x40')],_0x5dac03[_0x506f('0x41')]),_0x1a7fac);if(_0x304c15['query'][_0x506f('0x4d')]){_0x11c7ff[_0x506f('0x4b')]=_['merge'](_0x11c7ff[_0x506f('0x4b')],{'$or':_[_0x506f('0x3f')](_0x1a7fac,function(_0x3b5a72){if(_0x3b5a72[_0x506f('0x3e')]!==_0x506f('0x4e')){var _0x4226cb={};_0x4226cb[_0x3b5a72['name']]={'$like':'%'+_0x304c15['query'][_0x506f('0x4d')]+'%'};return _0x4226cb;}})});}_0x11c7ff=_[_0x506f('0x4f')]({},_0x11c7ff,_0x304c15[_0x506f('0x50')]);var _0x2e98bd={'where':_0x11c7ff[_0x506f('0x4b')]};return db['WhatsappMessage'][_0x506f('0x30')](_0x2e98bd)[_0x506f('0x20')](function(_0x53ea01){_0x5f111a['count']=_0x53ea01;if(_0x304c15[_0x506f('0x40')]['includeAll']){_0x11c7ff['include']=[{'all':!![]}];}return db[_0x506f('0x3b')][_0x506f('0x51')](_0x11c7ff);})['then'](function(_0x38cc63){_0x5f111a[_0x506f('0x52')]=_0x38cc63;return _0x5f111a;})[_0x506f('0x20')](respondWithFilteredResult(_0x463057,_0x11c7ff))[_0x506f('0x29')](handleError(_0x463057,null));};exports[_0x506f('0x53')]=function(_0x1a06b5,_0x5ec4b2){var _0x39e99f={'raw':!![],'where':{'id':_0x1a06b5[_0x506f('0x54')]['id']}},_0x5308f9={};_0x5308f9[_0x506f('0x43')]=_[_0x506f('0x55')](db[_0x506f('0x3b')]['rawAttributes']);_0x5308f9['query']=_[_0x506f('0x55')](_0x1a06b5[_0x506f('0x40')]);_0x5308f9['filters']=_['intersection'](_0x5308f9[_0x506f('0x43')],_0x5308f9[_0x506f('0x40')]);_0x39e99f[_0x506f('0x44')]=_[_0x506f('0x42')](_0x5308f9[_0x506f('0x43')],qs['fields'](_0x1a06b5['query'][_0x506f('0x45')]));_0x39e99f[_0x506f('0x44')]=_0x39e99f[_0x506f('0x44')][_0x506f('0x46')]?_0x39e99f[_0x506f('0x44')]:_0x5308f9['model'];if(_0x1a06b5[_0x506f('0x40')][_0x506f('0x56')]){_0x39e99f[_0x506f('0x57')]=[{'all':!![]}];}_0x39e99f=_[_0x506f('0x4f')]({},_0x39e99f,_0x1a06b5[_0x506f('0x50')]);return db[_0x506f('0x3b')][_0x506f('0x58')](_0x39e99f)['then'](handleEntityNotFound(_0x5ec4b2,null))['then'](respondWithResult(_0x5ec4b2,null))[_0x506f('0x29')](handleError(_0x5ec4b2,null));};exports['create']=function(_0x46285a,_0x5213b6){return db['WhatsappMessage'][_0x506f('0x59')](_0x46285a[_0x506f('0x5a')],{})[_0x506f('0x20')](respondWithResult(_0x5213b6,0xc9))[_0x506f('0x29')](handleError(_0x5213b6,null));};exports[_0x506f('0x5b')]=function(_0x35f234,_0x559658){if(_0x35f234[_0x506f('0x5a')]['id']){delete _0x35f234[_0x506f('0x5a')]['id'];}return db[_0x506f('0x3b')][_0x506f('0x58')]({'where':{'id':_0x35f234['params']['id']}})['then'](handleEntityNotFound(_0x559658,null))['then'](saveUpdates(_0x35f234[_0x506f('0x5a')],null))['then'](respondWithResult(_0x559658,null))[_0x506f('0x29')](handleError(_0x559658,null));};exports[_0x506f('0x36')]=function(_0x5ee824,_0x5f07a2){return db[_0x506f('0x3b')][_0x506f('0x58')]({'where':{'id':_0x5ee824[_0x506f('0x54')]['id']}})[_0x506f('0x20')](handleEntityNotFound(_0x5f07a2,null))[_0x506f('0x20')](removeEntity(_0x5f07a2,null))['catch'](handleError(_0x5f07a2,null));};exports[_0x506f('0x5c')]=function(_0x277ddf,_0x406c4e){return db[_0x506f('0x3b')][_0x506f('0x5c')]()[_0x506f('0x20')](respondWithResult(_0x406c4e,null))[_0x506f('0x29')](handleError(_0x406c4e,null));};var interaction_log=require(_0x506f('0x5d'))(_0x506f('0x5e'));exports[_0x506f('0x5f')]=function(_0x2443c0,_0x5094bd,_0x2aeb72){var _0x11aaed={'agent':{},'channel':_0x506f('0x60')};if(_0x2443c0[_0x506f('0x5a')]['id']){delete _0x2443c0[_0x506f('0x5a')]['id'];}_0x2443c0['body']['read']=!![];_0x2443c0[_0x506f('0x5a')][_0x506f('0x61')]=moment()[_0x506f('0x62')]('YYYY-MM-DD\x20HH:mm:ss');_0x2443c0['body']['UserId']=_0x2443c0[_0x506f('0x5a')][_0x506f('0x63')]||_0x2443c0[_0x506f('0x64')]['id'];_0x11aaed[_0x506f('0x65')]['id']=_0x2443c0[_0x506f('0x5a')][_0x506f('0x63')];return db[_0x506f('0x3b')]['find']({'where':{'id':_0x2443c0[_0x506f('0x54')]['id'],'UserId':null}})[_0x506f('0x20')](handleEntityNotFound(_0x5094bd,null))[_0x506f('0x20')](saveUpdates(_0x2443c0[_0x506f('0x5a')],null))[_0x506f('0x20')](function(_0x4082a5){if(_0x4082a5){_0x11aaed[_0x506f('0x27')]=_0x4082a5[_0x506f('0x66')]({'plain':!![]});return db['WhatsappInteraction'][_0x506f('0x58')]({'where':{'id':_0x4082a5[_0x506f('0x67')]}});}return null;})[_0x506f('0x20')](handleEntityNotFound(_0x5094bd,null))['then'](function(_0x467eed){if(_0x467eed){return _0x467eed['update']({'UserId':_0x2443c0[_0x506f('0x5a')][_0x506f('0x63')],'read1stAt':_['isNil'](_0x467eed['read1stAt'])?moment()[_0x506f('0x62')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x506f('0x20')](function(_0x6ecc66){if(_0x6ecc66){_0x11aaed[_0x506f('0x68')]=_0x6ecc66[_0x506f('0x66')]({'plain':!![]});interaction_log[_0x506f('0x21')](_0x506f('0x69'),_0x2443c0['user']['id'],_0x2443c0[_0x506f('0x64')]['name'],_0x2443c0[_0x506f('0x64')][_0x506f('0x6a')],_0x11aaed[_0x506f('0x68')]['id'],_0x2443c0[_0x506f('0x5a')]?JSON[_0x506f('0x6b')](_0x2443c0[_0x506f('0x5a')]):_0x506f('0x6c'));return respondWithRpcPromise(_0x506f('0x6d'),_0x506f('0x6e'),_0x11aaed);}return null;})[_0x506f('0x20')](function(_0x4d8525){var _0xbf332a=_0x506f('0x6f')+_0x4d8525[_0x506f('0x27')][_0x506f('0x70')];return db[_0x506f('0x71')][_0x506f('0x40')](_0xbf332a,{'type':db['Sequelize'][_0x506f('0x72')][_0x506f('0x73')],'raw':!![]})[_0x506f('0x20')](function(_0x23e6a2){return _0x23e6a2;});})[_0x506f('0x20')](function(_0x37d14b){if(_0x37d14b){_0x11aaed[_0x506f('0x27')][_0x506f('0x74')]=_0x37d14b[0x0];if(!_0x2443c0[_0x506f('0x5a')][_0x506f('0x63')])return;return db['User'][_0x506f('0x58')]({'where':{'id':_0x2443c0[_0x506f('0x5a')][_0x506f('0x63')],'role':'agent'},'attributes':['id',_0x506f('0x39'),'fullname',_0x506f('0x75'),'internal'],'raw':!![]});}return null;})[_0x506f('0x20')](function(_0x12563f){if(!_0x12563f)return null;_0x11aaed[_0x506f('0x27')]['agent']=_0x12563f;return _0x11aaed;})[_0x506f('0x20')](function(_0x58ea52){if(_0x58ea52){if(_0x2443c0[_0x506f('0x5a')][_0x506f('0x76')]){_0x11aaed[_0x506f('0x27')]['interface']=util['format']('SIP/%s',_0x2443c0['user'][_0x506f('0x39')]);_0x11aaed['message']['channel']=_0x11aaed[_0x506f('0x77')];_0x11aaed[_0x506f('0x27')][_0x506f('0x78')]=_0x11aaed['channel'];_0x11aaed['message']['event']='accept';return respondWithRpcPromise('EventManager',_0x506f('0x79'),{'event':_0x506f('0x7a'),'message':_0x11aaed['message']},client9002)[_0x506f('0x20')](function(){return _0x11aaed;});}return _0x11aaed;}return null;})[_0x506f('0x20')](respondWithResult(_0x5094bd,null))[_0x506f('0x29')](handleError(_0x5094bd,null));};var interaction_log=require(_0x506f('0x5d'))(_0x506f('0x5e'));exports[_0x506f('0x34')]=function(_0x47ba66,_0x2fb7a6,_0x43bfd9){var _0x3680ae={'agent':{},'channel':_0x506f('0x60')};if(_0x47ba66[_0x506f('0x5a')]['id']){delete _0x47ba66['body']['id'];}_0x47ba66['body'][_0x506f('0x63')]=_0x47ba66['body']['UserId']||_0x47ba66[_0x506f('0x64')]['id'];_0x3680ae[_0x506f('0x65')]['id']=_0x47ba66[_0x506f('0x5a')][_0x506f('0x63')];return db[_0x506f('0x3b')][_0x506f('0x58')]({'where':{'id':_0x47ba66[_0x506f('0x54')]['id'],'UserId':null}})[_0x506f('0x20')](handleEntityNotFound(_0x2fb7a6,null))['then'](function(_0x3e2fd7){if(_0x3e2fd7){_0x3680ae['message']=_0x3e2fd7[_0x506f('0x66')]({'plain':!![]});return db[_0x506f('0x7b')][_0x506f('0x58')]({'where':{'id':_0x3e2fd7[_0x506f('0x67')]}});}return null;})[_0x506f('0x20')](handleEntityNotFound(_0x2fb7a6,null))[_0x506f('0x20')](function(_0x15d252){if(_0x15d252){_0x3680ae[_0x506f('0x68')]=_0x15d252[_0x506f('0x66')]({'plain':!![]});interaction_log[_0x506f('0x21')](_0x506f('0x7c'),_0x47ba66['user']['id'],_0x47ba66[_0x506f('0x64')][_0x506f('0x39')],_0x47ba66[_0x506f('0x64')][_0x506f('0x6a')],_0x3680ae[_0x506f('0x68')]['id'],_0x47ba66[_0x506f('0x5a')]?JSON[_0x506f('0x6b')](_0x47ba66[_0x506f('0x5a')]):_0x506f('0x6c'));return respondWithRpcPromise(_0x506f('0x7d'),'rejectMessage',_0x3680ae);}return null;})[_0x506f('0x20')](function(_0x7ec4d6){var _0x4a486a=_0x506f('0x6f')+_0x7ec4d6['message'][_0x506f('0x70')];return db[_0x506f('0x71')][_0x506f('0x40')](_0x4a486a,{'type':db[_0x506f('0x7e')][_0x506f('0x72')][_0x506f('0x73')],'raw':!![]})['then'](function(_0x25b264){return _0x25b264;});})['then'](function(_0x395bad){if(_0x395bad){_0x3680ae[_0x506f('0x27')][_0x506f('0x74')]=_0x395bad[0x0];if(!_0x47ba66[_0x506f('0x5a')][_0x506f('0x63')])return;return db['User']['find']({'where':{'id':_0x47ba66[_0x506f('0x5a')][_0x506f('0x63')],'role':_0x506f('0x65')},'attributes':['id',_0x506f('0x39'),_0x506f('0x7f'),_0x506f('0x75'),_0x506f('0x80')],'raw':!![]});}return null;})['then'](function(_0x666f99){if(!_0x666f99)return null;_0x3680ae[_0x506f('0x27')][_0x506f('0x65')]=_0x666f99;return _0x3680ae;})[_0x506f('0x20')](function(_0x297ed9){if(_0x297ed9){_0x297ed9[_0x506f('0x27')][_0x506f('0x81')]=util[_0x506f('0x62')]('SIP/%s',_0x47ba66['user'][_0x506f('0x39')]);_0x297ed9[_0x506f('0x27')][_0x506f('0x77')]=_0x3680ae[_0x506f('0x77')];_0x297ed9['message'][_0x506f('0x78')]=_0x3680ae[_0x506f('0x77')];_0x297ed9[_0x506f('0x27')][_0x506f('0x82')]=_0x506f('0x34');respondWithRpcPromise('EventManager',_0x506f('0x79'),{'event':_0x506f('0x83'),'message':_0x297ed9[_0x506f('0x27')]},client9002);return _0x3680ae;}return null;})[_0x506f('0x20')](respondWithResult(_0x2fb7a6,null))[_0x506f('0x29')](handleError(_0x2fb7a6,null));};exports['status']=function(_0x294a77,_0x3bfd42,_0x526ea1){if(_0x294a77[_0x506f('0x5a')]['id']){delete _0x294a77[_0x506f('0x5a')]['id'];}var _0xf21856;return db[_0x506f('0x3b')][_0x506f('0x58')]({'where':{'id':_0x294a77[_0x506f('0x54')]['id']}})[_0x506f('0x20')](handleEntityNotFound(_0x3bfd42,null))['then'](function(_0x5a3768){if(_0x5a3768){_0xf21856=_0x5a3768;return db['WhatsappAccount']['find']({'where':{'id':_0x5a3768['WhatsappAccountId']}});}})[_0x506f('0x20')](handleEntityNotFound(_0x3bfd42,null))[_0x506f('0x20')](function(_0x3fd0c2){if(_0x3fd0c2){logger[_0x506f('0x23')]('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0x506f('0x2b'),_0x506f('0x84'),_0x3fd0c2[_0x506f('0x3e')],util['inspect'](_0x294a77[_0x506f('0x5a')],{'showHidden':![],'depth':null}));switch(_0x3fd0c2[_0x506f('0x3e')]){case _0x506f('0x85'):if(_0x294a77['body'][_0x506f('0x86')]&&_0x294a77[_0x506f('0x5a')][_0x506f('0x86')]===_0xf21856['messageId']&&_0x294a77['body'][_0x506f('0x87')]&&_0x294a77[_0x506f('0x5a')][_0x506f('0x87')]===_0x506f('0x88')){return _0xf21856[_0x506f('0x5b')]({'read':!![]});}else{logger['error'](_0x506f('0x89'),_0x506f('0x2b'),_0x506f('0x85'),util[_0x506f('0x8a')](_0x294a77[_0x506f('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0xf21856;}})[_0x506f('0x20')](respondWithResult(_0x3bfd42,null))['catch'](handleError(_0x3bfd42,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 628217a..06274ef 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 _0x823c=['WhatsappMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x1b325a,_0x1298bf){var _0x2cab50=function(_0x507481){while(--_0x507481){_0x1b325a['push'](_0x1b325a['shift']());}};_0x2cab50(++_0x1298bf);}(_0x823c,0x143));var _0xc823=function(_0x16501f,_0x3d10e2){_0x16501f=_0x16501f-0x0;var _0x5433ac=_0x823c[_0x16501f];return _0x5433ac;};'use strict';var EventEmitter=require(_0xc823('0x0'));var WhatsappMessage=require('../../mysqldb')['db'][_0xc823('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xc823('0x2')](0x0);var events={'afterCreate':_0xc823('0x3'),'afterUpdate':_0xc823('0x4'),'afterDestroy':_0xc823('0x5')};function emitEvent(_0x67f9d){return function(_0x49f2d2,_0x3309cc,_0x35dedf){WhatsappMessageEvents[_0xc823('0x6')](_0x67f9d+':'+_0x49f2d2['id'],_0x49f2d2);WhatsappMessageEvents[_0xc823('0x6')](_0x67f9d,_0x49f2d2);_0x35dedf(null);};}for(var e in events){if(events[_0xc823('0x7')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0xc823('0x8')]=WhatsappMessageEvents; \ No newline at end of file +var _0xcf66=['exports','events','../../mysqldb','WhatsappMessage','save','update','emit','hasOwnProperty'];(function(_0x52e614,_0x1f7097){var _0x4b0c83=function(_0x1f2694){while(--_0x1f2694){_0x52e614['push'](_0x52e614['shift']());}};_0x4b0c83(++_0x1f7097);}(_0xcf66,0x71));var _0x6cf6=function(_0x59a4d1,_0x53a0ad){_0x59a4d1=_0x59a4d1-0x0;var _0x113e78=_0xcf66[_0x59a4d1];return _0x113e78;};'use strict';var EventEmitter=require(_0x6cf6('0x0'));var WhatsappMessage=require(_0x6cf6('0x1'))['db'][_0x6cf6('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6cf6('0x3'),'afterUpdate':_0x6cf6('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4e16eb){return function(_0x1c599d,_0x45d0d8,_0x57f22f){WhatsappMessageEvents[_0x6cf6('0x5')](_0x4e16eb+':'+_0x1c599d['id'],_0x1c599d);WhatsappMessageEvents[_0x6cf6('0x5')](_0x4e16eb,_0x1c599d);_0x57f22f(null);};}for(var e in events){if(events[_0x6cf6('0x6')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0x6cf6('0x7')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index eafe7a3..5d5c6f7 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 _0x5a80=['rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','messageId','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','WhatsappInteraction','findOne','WhatsappInteractionId','update','createdAt','error','WhatsappAccount','find','WhatsappAccountId','then','type','twilio','accountSid','authToken','messages','whatsapp:','phone','/api/whatsapp/messages/','/status?token=','token','catch','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','/messages/','text','POST','Bearer\x20','message_id','statuses','err','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','node-fetch'];(function(_0x3f1954,_0x1b2164){var _0x4d9c73=function(_0x15540a){while(--_0x15540a){_0x3f1954['push'](_0x3f1954['shift']());}};_0x4d9c73(++_0x1b2164);}(_0x5a80,0x15b));var _0x05a8=function(_0x53f51b,_0x1ff569){_0x53f51b=_0x53f51b-0x0;var _0x1affcd=_0x5a80[_0x53f51b];return _0x1affcd;};'use strict';var _=require(_0x05a8('0x0'));var util=require(_0x05a8('0x1'));var logger=require('../../config/logger')(_0x05a8('0x2'));var moment=require(_0x05a8('0x3'));var BPromise=require(_0x05a8('0x4'));var rp=require(_0x05a8('0x5'));var fetch=require(_0x05a8('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x05a8('0x7'));var config=require(_0x05a8('0x8'));var attributes=require(_0x05a8('0x9'));module[_0x05a8('0xa')]=function(_0xeb2df7,_0x322b60){return _0xeb2df7[_0x05a8('0xb')](_0x05a8('0xc'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0x05a8('0xd'),'fields':[_0x05a8('0xd')]},{'name':'fti_whatsapp_messages','fields':[_0x05a8('0xe')],'type':_0x05a8('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1e4d22,_0x2e9799,_0x3d56e8){var _0xb27ad4=_0xeb2df7['models'];var _0x284736=_0x1e4d22[_0x05a8('0x10')]({'plain':!![]});if(_0x284736[_0x05a8('0x11')][_0x05a8('0x12')]()==='in'||_0x284736[_0x05a8('0x11')][_0x05a8('0x12')]()===_0x05a8('0x13')&&!_0x284736[_0x05a8('0x14')]&&!_[_0x05a8('0x15')](_0x284736['UserId'])){_0xb27ad4[_0x05a8('0x16')][_0x05a8('0x17')]({'where':{'id':_0x284736[_0x05a8('0x18')]}})['then'](function(_0x3713b8){if(_0x3713b8){_0x3713b8[_0x05a8('0x19')]({'lastMsgAt':_0x284736[_0x05a8('0x1a')],'lastMsgDirection':_0x284736[_0x05a8('0x11')][_0x05a8('0x12')]()});}})['catch'](function(_0x5f0965){console[_0x05a8('0x1b')](_0x5f0965);});}if(_0x284736['direction']==='out'&&!_0x284736['secret']){var _0x529fab;_0xb27ad4[_0x05a8('0x1c')][_0x05a8('0x1d')]({'where':{'id':_0x284736[_0x05a8('0x1e')]},'raw':!![]})[_0x05a8('0x1f')](function(_0x39e5c9){_0x529fab=_0x39e5c9;if(_0x529fab&&_0x529fab[_0x05a8('0x20')]){switch(_0x529fab[_0x05a8('0x20')]){case _0x05a8('0x21'):var _0x5cc667=require(_0x05a8('0x21'));if(_0x529fab[_0x05a8('0x22')]&&_0x529fab[_0x05a8('0x23')]&&_0x529fab['phone']){var _0x543264=new _0x5cc667(_0x529fab[_0x05a8('0x22')],_0x529fab[_0x05a8('0x23')]);_0x543264[_0x05a8('0x24')]['create']({'body':_0x284736[_0x05a8('0xe')],'to':_0x05a8('0x25')+_0x284736[_0x05a8('0x26')],'from':_0x05a8('0x25')+_0x529fab[_0x05a8('0x26')],'statusCallback':_0x529fab['remote']+_0x05a8('0x27')+_0x284736['id']+_0x05a8('0x28')+_0x529fab[_0x05a8('0x29')]})['then'](function(_0x2a4298){if(_0x2a4298['sid']){return _0x1e4d22['update']({'messageId':_0x2a4298['sid']});}})[_0x05a8('0x2a')](function(_0x5de104){logger['error'](_0x05a8('0x2b'),_0x05a8('0x2c'),_0x05a8('0x21'),util[_0x05a8('0x2d')](_0x5de104,{'showHidden':![],'depth':null}));});}else{logger[_0x05a8('0x1b')](_0x05a8('0x2b'),_0x05a8('0x2c'),'twilio',_0x05a8('0x2e'));}break;case _0x05a8('0x2f'):var _0x27babc=_0x529fab[_0x05a8('0x22')];var _0x4b875e=_0x529fab[_0x05a8('0x23')];var _0x2debe3=_0x529fab[_0x05a8('0x30')]+_0x05a8('0x31')+_0x27babc+_0x05a8('0x32');var _0x3b2056={'to':[_0x284736[_0x05a8('0x26')]],'message':{'type':_0x05a8('0x33'),'text':_0x284736[_0x05a8('0xe')]}};var _0x1dd75f={'method':_0x05a8('0x34'),'uri':_0x2debe3,'headers':{'Authorization':_0x05a8('0x35')+_0x4b875e,'Content-Type':'application/json'},'body':_0x3b2056,'json':!![]};rp(_0x1dd75f)[_0x05a8('0x1f')](function(_0x261ed3){if(_0x261ed3['statuses'][0x0][_0x05a8('0x36')]){return _0x1e4d22[_0x05a8('0x19')]({'messageId':_0x261ed3[_0x05a8('0x37')][0x0][_0x05a8('0x36')]});}})['catch'](function(_0xd3c449){logger[_0x05a8('0x38')]('WhatsappMessage,\x20%s',_0xd3c449);});break;}}})['finally'](function(){_0x3d56e8();});}else{_0x3d56e8();}}},'charset':_0x05a8('0x39'),'collate':_0x05a8('0x3a')});}; \ No newline at end of file +var _0xa368=['direction','out','secret','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','update','toLowerCase','error','WhatsappAccount','find','WhatsappAccountId','then','type','twilio','accountSid','authToken','messages','create','remote','/api/whatsapp/messages/','/status?token=','token','sid','catch','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/messages/','phone','text','POST','Bearer\x20','application/json','statuses','message_id','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','request-promise','node-fetch','path','./whatsappMessage.attributes','exports','WhatsappMessage','messageId','body','FULLTEXT','models','get'];(function(_0x1c470d,_0x81d66b){var _0x12141b=function(_0x45bfd3){while(--_0x45bfd3){_0x1c470d['push'](_0x1c470d['shift']());}};_0x12141b(++_0x81d66b);}(_0xa368,0xd3));var _0x8a36=function(_0x1cf050,_0xd76301){_0x1cf050=_0x1cf050-0x0;var _0x5239f3=_0xa368[_0x1cf050];return _0x5239f3;};'use strict';var _=require(_0x8a36('0x0'));var util=require('util');var logger=require(_0x8a36('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8a36('0x2'));var fetch=require(_0x8a36('0x3'));var fs=require('fs');var path=require(_0x8a36('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8a36('0x5'));module[_0x8a36('0x6')]=function(_0x381b5f,_0x26d1a9){return _0x381b5f['define'](_0x8a36('0x7'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0x8a36('0x8'),'fields':[_0x8a36('0x8')]},{'name':'fti_whatsapp_messages','fields':[_0x8a36('0x9')],'type':_0x8a36('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x31b952,_0x2144b0,_0x428f25){var _0x2d1470=_0x381b5f[_0x8a36('0xb')];var _0x28f001=_0x31b952[_0x8a36('0xc')]({'plain':!![]});if(_0x28f001[_0x8a36('0xd')]['toLowerCase']()==='in'||_0x28f001[_0x8a36('0xd')]['toLowerCase']()===_0x8a36('0xe')&&!_0x28f001[_0x8a36('0xf')]&&!_['isNil'](_0x28f001[_0x8a36('0x10')])){_0x2d1470[_0x8a36('0x11')][_0x8a36('0x12')]({'where':{'id':_0x28f001[_0x8a36('0x13')]}})['then'](function(_0x3ee164){if(_0x3ee164){_0x3ee164[_0x8a36('0x14')]({'lastMsgAt':_0x28f001['createdAt'],'lastMsgDirection':_0x28f001['direction'][_0x8a36('0x15')]()});}})['catch'](function(_0x2934cf){console[_0x8a36('0x16')](_0x2934cf);});}if(_0x28f001[_0x8a36('0xd')]===_0x8a36('0xe')&&!_0x28f001['secret']){var _0x5105da;_0x2d1470[_0x8a36('0x17')][_0x8a36('0x18')]({'where':{'id':_0x28f001[_0x8a36('0x19')]},'raw':!![]})[_0x8a36('0x1a')](function(_0xa902a9){_0x5105da=_0xa902a9;if(_0x5105da&&_0x5105da[_0x8a36('0x1b')]){switch(_0x5105da[_0x8a36('0x1b')]){case'twilio':var _0x14cffb=require(_0x8a36('0x1c'));if(_0x5105da[_0x8a36('0x1d')]&&_0x5105da[_0x8a36('0x1e')]&&_0x5105da['phone']){var _0x56629a=new _0x14cffb(_0x5105da[_0x8a36('0x1d')],_0x5105da[_0x8a36('0x1e')]);_0x56629a[_0x8a36('0x1f')][_0x8a36('0x20')]({'body':_0x28f001[_0x8a36('0x9')],'to':'whatsapp:'+_0x28f001['phone'],'from':'whatsapp:'+_0x5105da['phone'],'statusCallback':_0x5105da[_0x8a36('0x21')]+_0x8a36('0x22')+_0x28f001['id']+_0x8a36('0x23')+_0x5105da[_0x8a36('0x24')]})['then'](function(_0x1a1d2f){if(_0x1a1d2f['sid']){return _0x31b952[_0x8a36('0x14')]({'messageId':_0x1a1d2f[_0x8a36('0x25')]});}})[_0x8a36('0x26')](function(_0x2d3973){logger['error'](_0x8a36('0x27'),_0x8a36('0x28'),'twilio',util['inspect'](_0x2d3973,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x8a36('0x27'),_0x8a36('0x28'),_0x8a36('0x1c'),_0x8a36('0x29'));}break;case _0x8a36('0x2a'):var _0x3a22d6=_0x5105da[_0x8a36('0x1d')];var _0x11ce93=_0x5105da[_0x8a36('0x1e')];var _0x1a0f82=_0x5105da[_0x8a36('0x2b')]+'/whatsapp/v1/'+_0x3a22d6+_0x8a36('0x2c');var _0x204d3f={'to':[_0x28f001[_0x8a36('0x2d')]],'message':{'type':_0x8a36('0x2e'),'text':_0x28f001[_0x8a36('0x9')]}};var _0x5d92fd={'method':_0x8a36('0x2f'),'uri':_0x1a0f82,'headers':{'Authorization':_0x8a36('0x30')+_0x11ce93,'Content-Type':_0x8a36('0x31')},'body':_0x204d3f,'json':!![]};rp(_0x5d92fd)[_0x8a36('0x1a')](function(_0x386859){if(_0x386859[_0x8a36('0x32')][0x0]['message_id']){return _0x31b952[_0x8a36('0x14')]({'messageId':_0x386859[_0x8a36('0x32')][0x0][_0x8a36('0x33')]});}})['catch'](function(_0x312e1f){logger['err'](_0x8a36('0x34'),_0x312e1f);});break;}}})[_0x8a36('0x35')](function(){_0x428f25();});}else{_0x428f25();}}},'charset':_0x8a36('0x36'),'collate':_0x8a36('0x37')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 6f886b9..ee10d1c 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 _0x0677=['request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','WhatsappMessage,\x20%s,\x20%s','message','result','catch','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','then','debug','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','info'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x0677,0xcf));var _0x7067=function(_0x476b5f,_0x1f9952){_0x476b5f=_0x476b5f-0x0;var _0x5a23d8=_0x0677[_0x476b5f];return _0x5a23d8;};'use strict';var _=require(_0x7067('0x0'));var util=require('util');var moment=require(_0x7067('0x1'));var BPromise=require('bluebird');var rs=require(_0x7067('0x2'));var fs=require('fs');var Redis=require(_0x7067('0x3'));var db=require(_0x7067('0x4'))['db'];var utils=require(_0x7067('0x5'));var logger=require('../../config/logger')(_0x7067('0x6'));var config=require('../../config/environment');var jayson=require(_0x7067('0x7'));var client=jayson[_0x7067('0x8')]['http']({'port':0x232a});config[_0x7067('0x9')]=_[_0x7067('0xa')](config[_0x7067('0x9')],{'host':_0x7067('0xb'),'port':0x18eb});var socket=require(_0x7067('0xc'))(new Redis(config[_0x7067('0x9')]));require(_0x7067('0xd'))[_0x7067('0xe')](socket);function respondWithRpcPromise(_0x49ac24,_0x2876c0,_0x507af7){return new BPromise(function(_0x3d0a6c,_0x5ee9){return client[_0x7067('0xf')](_0x49ac24,_0x507af7)['then'](function(_0x36c747){logger[_0x7067('0x10')]('WhatsappMessage,\x20%s,\x20%s',_0x2876c0,_0x7067('0x11'));logger['debug'](_0x7067('0x12'),_0x2876c0,_0x7067('0x11'),JSON['stringify'](_0x36c747));if(_0x36c747['error']){if(_0x36c747['error']['code']===0x1f4){logger[_0x7067('0x13')](_0x7067('0x14'),_0x2876c0,_0x36c747['error'][_0x7067('0x15')]);return _0x5ee9(_0x36c747[_0x7067('0x13')]['message']);}logger[_0x7067('0x13')](_0x7067('0x14'),_0x2876c0,_0x36c747[_0x7067('0x13')][_0x7067('0x15')]);return _0x3d0a6c(_0x36c747[_0x7067('0x13')][_0x7067('0x15')]);}else{logger[_0x7067('0x10')](_0x7067('0x14'),_0x2876c0,_0x7067('0x11'));_0x3d0a6c(_0x36c747[_0x7067('0x16')][_0x7067('0x15')]);}})[_0x7067('0x17')](function(_0x5a6b0c){logger[_0x7067('0x13')]('WhatsappMessage,\x20%s,\x20%s',_0x2876c0,_0x5a6b0c);_0x5ee9(_0x5a6b0c);});});}exports[_0x7067('0x18')]=function(_0x13d879){var _0x1f4b38=this;return new Promise(function(_0x5ece7b,_0x24e2c2){return db[_0x7067('0x19')][_0x7067('0x1a')](_0x13d879[_0x7067('0x1b')],{'raw':_0x13d879[_0x7067('0x1c')]?_0x13d879[_0x7067('0x1c')][_0x7067('0x1d')]===undefined?!![]:![]:!![]})[_0x7067('0x1e')](function(_0x2d9665){logger['info'](_0x7067('0x18'),_0x13d879);logger[_0x7067('0x1f')](_0x7067('0x18'),_0x13d879,JSON['stringify'](_0x2d9665));_0x5ece7b(_0x2d9665);})[_0x7067('0x17')](function(_0x505be6){logger[_0x7067('0x13')](_0x7067('0x18'),_0x505be6['message'],_0x13d879);_0x24e2c2(_0x1f4b38['error'](0x1f4,_0x505be6[_0x7067('0x15')]));});});}; \ No newline at end of file +var _0xe82a=['CreateWhatsappMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','WhatsappMessage','body','raw'];(function(_0x34d559,_0xc30b58){var _0x2112a5=function(_0x25b6fc){while(--_0x25b6fc){_0x34d559['push'](_0x34d559['shift']());}};_0x2112a5(++_0xc30b58);}(_0xe82a,0x161));var _0xae82=function(_0x2d1f90,_0x3855bb){_0x2d1f90=_0x2d1f90-0x0;var _0x38a52a=_0xe82a[_0x2d1f90];return _0x38a52a;};'use strict';var _=require(_0xae82('0x0'));var util=require(_0xae82('0x1'));var moment=require(_0xae82('0x2'));var BPromise=require(_0xae82('0x3'));var rs=require(_0xae82('0x4'));var fs=require('fs');var Redis=require(_0xae82('0x5'));var db=require(_0xae82('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xae82('0x7'))(_0xae82('0x8'));var config=require(_0xae82('0x9'));var jayson=require(_0xae82('0xa'));var client=jayson[_0xae82('0xb')][_0xae82('0xc')]({'port':0x232a});config['redis']=_[_0xae82('0xd')](config[_0xae82('0xe')],{'host':_0xae82('0xf'),'port':0x18eb});var socket=require(_0xae82('0x10'))(new Redis(config[_0xae82('0xe')]));require('./whatsappMessage.socket')[_0xae82('0x11')](socket);function respondWithRpcPromise(_0x3e4990,_0x5e84b7,_0x15afad){return new BPromise(function(_0x17b394,_0x39aa82){return client['request'](_0x3e4990,_0x15afad)[_0xae82('0x12')](function(_0x33a773){logger[_0xae82('0x13')](_0xae82('0x14'),_0x5e84b7,_0xae82('0x15'));logger[_0xae82('0x16')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x5e84b7,'request\x20sent',JSON[_0xae82('0x17')](_0x33a773));if(_0x33a773[_0xae82('0x18')]){if(_0x33a773['error'][_0xae82('0x19')]===0x1f4){logger[_0xae82('0x18')](_0xae82('0x14'),_0x5e84b7,_0x33a773[_0xae82('0x18')][_0xae82('0x1a')]);return _0x39aa82(_0x33a773[_0xae82('0x18')][_0xae82('0x1a')]);}logger[_0xae82('0x18')]('WhatsappMessage,\x20%s,\x20%s',_0x5e84b7,_0x33a773[_0xae82('0x18')]['message']);return _0x17b394(_0x33a773['error']['message']);}else{logger[_0xae82('0x13')](_0xae82('0x14'),_0x5e84b7,_0xae82('0x15'));_0x17b394(_0x33a773['result']['message']);}})[_0xae82('0x1b')](function(_0x798bba){logger[_0xae82('0x18')](_0xae82('0x14'),_0x5e84b7,_0x798bba);_0x39aa82(_0x798bba);});});}exports['CreateWhatsappMessage']=function(_0xa2837b){var _0x1a7c09=this;return new Promise(function(_0x3d4da3,_0x1e78eb){return db[_0xae82('0x1c')]['create'](_0xa2837b[_0xae82('0x1d')],{'raw':_0xa2837b['options']?_0xa2837b['options'][_0xae82('0x1e')]===undefined?!![]:![]:!![]})[_0xae82('0x12')](function(_0x52f13d){logger['info']('CreateWhatsappMessage',_0xa2837b);logger[_0xae82('0x16')](_0xae82('0x1f'),_0xa2837b,JSON[_0xae82('0x17')](_0x52f13d));_0x3d4da3(_0x52f13d);})[_0xae82('0x1b')](function(_0x541c96){logger[_0xae82('0x18')](_0xae82('0x1f'),_0x541c96[_0xae82('0x1a')],_0xa2837b);_0x1e78eb(_0x1a7c09[_0xae82('0x18')](0x1f4,_0x541c96[_0xae82('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 0597cf8..9092044 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 _0x8640=['register','length','./whatsappMessage.events','save','remove','update','emit','removeListener'];(function(_0x4c3f10,_0x6a6d7c){var _0x26f65c=function(_0x5ec71c){while(--_0x5ec71c){_0x4c3f10['push'](_0x4c3f10['shift']());}};_0x26f65c(++_0x6a6d7c);}(_0x8640,0x112));var _0x0864=function(_0x17fc76,_0x4ae8e5){_0x17fc76=_0x17fc76-0x0;var _0x4d2c29=_0x8640[_0x17fc76];return _0x4d2c29;};'use strict';var WhatsappMessageEvents=require(_0x0864('0x0'));var events=[_0x0864('0x1'),_0x0864('0x2'),_0x0864('0x3')];function createListener(_0x1ff2ca,_0x4bf543){return function(_0x223862){_0x4bf543[_0x0864('0x4')](_0x1ff2ca,_0x223862);};}function removeListener(_0x513af2,_0x4c400f){return function(){WhatsappMessageEvents[_0x0864('0x5')](_0x513af2,_0x4c400f);};}exports[_0x0864('0x6')]=function(_0x2a8351){for(var _0x19b233=0x0,_0x20b608=events[_0x0864('0x7')];_0x19b233<_0x20b608;_0x19b233++){var _0x5bb6fe=events[_0x19b233];var _0x373895=createListener('whatsappMessage:'+_0x5bb6fe,_0x2a8351);WhatsappMessageEvents['on'](_0x5bb6fe,_0x373895);}}; \ No newline at end of file +var _0x11f0=['save','remove','update','emit','removeListener','length','./whatsappMessage.events'];(function(_0x2ca0e1,_0x21848){var _0x133555=function(_0x1bea04){while(--_0x1bea04){_0x2ca0e1['push'](_0x2ca0e1['shift']());}};_0x133555(++_0x21848);}(_0x11f0,0x187));var _0x011f=function(_0x4d3ff9,_0x563356){_0x4d3ff9=_0x4d3ff9-0x0;var _0x260279=_0x11f0[_0x4d3ff9];return _0x260279;};'use strict';var WhatsappMessageEvents=require(_0x011f('0x0'));var events=[_0x011f('0x1'),_0x011f('0x2'),_0x011f('0x3')];function createListener(_0x475596,_0x599556){return function(_0x132c6c){_0x599556[_0x011f('0x4')](_0x475596,_0x132c6c);};}function removeListener(_0x1e8da2,_0x54662d){return function(){WhatsappMessageEvents[_0x011f('0x5')](_0x1e8da2,_0x54662d);};}exports['register']=function(_0x36eafb){for(var _0x4c1c1a=0x0,_0x57137e=events[_0x011f('0x6')];_0x4c1c1a<_0x57137e;_0x4c1c1a++){var _0x5913cb=events[_0x4c1c1a];var _0x1eb6ef=createListener('whatsappMessage:'+_0x5913cb,_0x36eafb);WhatsappMessageEvents['on'](_0x5913cb,_0x1eb6ef);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index afac516..3891484 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 _0x5072=['removeTeams','removeAgents','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','isAuthenticated','get','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','post','create','addAgents','update','delete','destroy'];(function(_0x5ec67a,_0x3a3bce){var _0x476099=function(_0x2419c6){while(--_0x2419c6){_0x5ec67a['push'](_0x5ec67a['shift']());}};_0x476099(++_0x3a3bce);}(_0x5072,0xab));var _0x2507=function(_0x32faaf,_0x2ed4a6){_0x32faaf=_0x32faaf-0x0;var _0x213374=_0x5072[_0x32faaf];return _0x213374;};'use strict';var multer=require(_0x2507('0x0'));var util=require('util');var path=require(_0x2507('0x1'));var timeout=require(_0x2507('0x2'));var express=require(_0x2507('0x3'));var router=express['Router']();var fs_extra=require(_0x2507('0x4'));var auth=require(_0x2507('0x5'));var interaction=require(_0x2507('0x6'));var config=require(_0x2507('0x7'));var controller=require(_0x2507('0x8'));router['get']('/',auth[_0x2507('0x9')](),controller['index']);router[_0x2507('0xa')](_0x2507('0xb'),auth[_0x2507('0x9')](),controller[_0x2507('0xc')]);router[_0x2507('0xa')](_0x2507('0xd'),auth[_0x2507('0x9')](),controller[_0x2507('0xe')]);router[_0x2507('0xa')]('/:id/members',auth['isAuthenticated'](),controller[_0x2507('0xf')]);router[_0x2507('0xa')](_0x2507('0x10'),auth[_0x2507('0x9')](),controller[_0x2507('0x11')]);router[_0x2507('0xa')](_0x2507('0x12'),auth[_0x2507('0x9')](),controller['getAgents']);router[_0x2507('0x13')]('/',auth[_0x2507('0x9')](),controller[_0x2507('0x14')]);router[_0x2507('0x13')]('/:id/teams',auth[_0x2507('0x9')](),controller['addTeams']);router[_0x2507('0x13')](_0x2507('0x12'),auth[_0x2507('0x9')](),controller[_0x2507('0x15')]);router['put'](_0x2507('0xd'),auth[_0x2507('0x9')](),controller[_0x2507('0x16')]);router[_0x2507('0x17')](_0x2507('0xd'),auth['isAuthenticated'](),controller[_0x2507('0x18')]);router[_0x2507('0x17')](_0x2507('0x10'),auth['isAuthenticated'](),controller[_0x2507('0x19')]);router[_0x2507('0x17')]('/:id/users',auth[_0x2507('0x9')](),controller[_0x2507('0x1a')]);module[_0x2507('0x1b')]=router; \ No newline at end of file +var _0x058d=['isAuthenticated','/describe','describe','/:id/members','getMembers','/:id/teams','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeTeams','/:id/users','removeAgents','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get'];(function(_0x5c9c78,_0x1d0c22){var _0x536886=function(_0x32cba8){while(--_0x32cba8){_0x5c9c78['push'](_0x5c9c78['shift']());}};_0x536886(++_0x1d0c22);}(_0x058d,0xce));var _0xd058=function(_0x489cd2,_0x2bab32){_0x489cd2=_0x489cd2-0x0;var _0x24aa64=_0x058d[_0x489cd2];return _0x24aa64;};'use strict';var multer=require('multer');var util=require(_0xd058('0x0'));var path=require(_0xd058('0x1'));var timeout=require(_0xd058('0x2'));var express=require(_0xd058('0x3'));var router=express[_0xd058('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd058('0x5'));var interaction=require(_0xd058('0x6'));var config=require(_0xd058('0x7'));var controller=require(_0xd058('0x8'));router[_0xd058('0x9')]('/',auth[_0xd058('0xa')](),controller['index']);router[_0xd058('0x9')](_0xd058('0xb'),auth['isAuthenticated'](),controller[_0xd058('0xc')]);router[_0xd058('0x9')]('/:id',auth[_0xd058('0xa')](),controller['show']);router[_0xd058('0x9')](_0xd058('0xd'),auth[_0xd058('0xa')](),controller[_0xd058('0xe')]);router[_0xd058('0x9')](_0xd058('0xf'),auth[_0xd058('0xa')](),controller['getTeams']);router['get']('/:id/users',auth[_0xd058('0xa')](),controller['getAgents']);router[_0xd058('0x10')]('/',auth[_0xd058('0xa')](),controller[_0xd058('0x11')]);router[_0xd058('0x10')]('/:id/teams',auth[_0xd058('0xa')](),controller[_0xd058('0x12')]);router[_0xd058('0x10')]('/:id/users',auth[_0xd058('0xa')](),controller[_0xd058('0x13')]);router[_0xd058('0x14')](_0xd058('0x15'),auth[_0xd058('0xa')](),controller['update']);router[_0xd058('0x16')](_0xd058('0x15'),auth[_0xd058('0xa')](),controller[_0xd058('0x17')]);router[_0xd058('0x16')]('/:id/teams',auth[_0xd058('0xa')](),controller[_0xd058('0x18')]);router[_0xd058('0x16')](_0xd058('0x19'),auth[_0xd058('0xa')](),controller[_0xd058('0x1a')]);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 3c3d67c..df2c7bd 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 _0x430e=['ENUM','rrmemory','beepall','exports','STRING','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x430e,0x105));var _0xe430=function(_0x3f619d,_0x4762c5){_0x3f619d=_0x3f619d-0x0;var _0x1eb364=_0x430e[_0x3f619d];return _0x1eb364;};'use strict';var Sequelize=require('sequelize');module[_0xe430('0x0')]={'name':{'type':Sequelize[_0xe430('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xe430('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe430('0x3')](_0xe430('0x4'),_0xe430('0x5'),'roundrobin')},'description':{'type':Sequelize[_0xe430('0x1')]}}; \ No newline at end of file +var _0x851e=['STRING','ENUM','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x14a036,_0x1a2355){var _0x4911d1=function(_0x5530db){while(--_0x5530db){_0x14a036['push'](_0x14a036['shift']());}};_0x4911d1(++_0x1a2355);}(_0x851e,0x1e8));var _0xe851=function(_0x18c9ab,_0x6ba7e7){_0x18c9ab=_0x18c9ab-0x0;var _0x17fc37=_0x851e[_0x18c9ab];return _0x17fc37;};'use strict';var Sequelize=require(_0xe851('0x0'));module[_0xe851('0x1')]={'name':{'type':Sequelize[_0xe851('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe851('0x3')](_0xe851('0x4'),_0xe851('0x5'),_0xe851('0x6'))},'description':{'type':Sequelize[_0xe851('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 965cccb..9b7cbb2 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 _0xc7ff=['key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','WhatsappQueue','includeAll','findAll','rows','catch','show','params','find','create','user','role','WhatsappQueues','UserProfileSection','userProfileId','autoAssociation','update','describe','getMembers','findOne','nolimit','WhatsappQueueId','UserWhatsappQueue','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','%s/%s','Team','getTeams','addTeams','body','Agents','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','emit','userWhatsappQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','value','forEach','addAgents','omit','spread','removeAgents','isArray','userWhatsappQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','type'];(function(_0xcedb27,_0x244c2b){var _0x5af121=function(_0x5ba69e){while(--_0x5ba69e){_0xcedb27['push'](_0xcedb27['shift']());}};_0x5af121(++_0x244c2b);}(_0xc7ff,0xe9));var _0xfc7f=function(_0x34eb2a,_0x2dde38){_0x34eb2a=_0x34eb2a-0x0;var _0x3e96b8=_0xc7ff[_0x34eb2a];return _0x3e96b8;};'use strict';var emlformat=require(_0xfc7f('0x0'));var rimraf=require(_0xfc7f('0x1'));var zipdir=require(_0xfc7f('0x2'));var jsonpatch=require(_0xfc7f('0x3'));var rp=require('request-promise');var moment=require(_0xfc7f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xfc7f('0x5'));var util=require(_0xfc7f('0x6'));var path=require(_0xfc7f('0x7'));var sox=require(_0xfc7f('0x8'));var csv=require(_0xfc7f('0x9'));var ejs=require(_0xfc7f('0xa'));var fs=require('fs');var fs_extra=require(_0xfc7f('0xb'));var _=require(_0xfc7f('0xc'));var squel=require(_0xfc7f('0xd'));var crypto=require(_0xfc7f('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xfc7f('0xf'));var toCsv=require(_0xfc7f('0x9'));var querystring=require(_0xfc7f('0x10'));var Papa=require('papaparse');var Redis=require(_0xfc7f('0x11'));var authService=require(_0xfc7f('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xfc7f('0x13'));var hardwareService=require(_0xfc7f('0x14'));var logger=require(_0xfc7f('0x15'))(_0xfc7f('0x16'));var utils=require(_0xfc7f('0x17'));var config=require(_0xfc7f('0x18'));var licenseUtil=require(_0xfc7f('0x19'));var db=require(_0xfc7f('0x1a'))['db'];config[_0xfc7f('0x1b')]=_[_0xfc7f('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfc7f('0x1b')]));require('./whatsappQueue.socket')['register'](socket);function respondWithStatusCode(_0x9bb0a8,_0x34394b){_0x34394b=_0x34394b||0xcc;return function(_0x393442){if(_0x393442){return _0x9bb0a8[_0xfc7f('0x1d')](_0x34394b);}return _0x9bb0a8[_0xfc7f('0x1e')](_0x34394b)[_0xfc7f('0x1f')]();};}function respondWithResult(_0x352f1b,_0x10c078){_0x10c078=_0x10c078||0xc8;return function(_0x8d0aa3){if(_0x8d0aa3){return _0x352f1b[_0xfc7f('0x1e')](_0x10c078)[_0xfc7f('0x20')](_0x8d0aa3);}};}function respondWithFilteredResult(_0x3e1e4f,_0x39f75e){return function(_0x1dd9de){if(_0x1dd9de){var _0x57c0ee=typeof _0x39f75e[_0xfc7f('0x21')]===_0xfc7f('0x22')&&typeof _0x39f75e[_0xfc7f('0x23')]===_0xfc7f('0x22');var _0x4d931c=_0x1dd9de['count'];var _0x15d999=_0x57c0ee?0x0:_0x39f75e[_0xfc7f('0x21')];var _0x2855e1=_0x57c0ee?_0x1dd9de[_0xfc7f('0x24')]:_0x39f75e[_0xfc7f('0x21')]+_0x39f75e[_0xfc7f('0x23')];var _0x3f1103;if(_0x2855e1>=_0x4d931c){_0x2855e1=_0x4d931c;_0x3f1103=0xc8;}else{_0x3f1103=0xce;}_0x3e1e4f['status'](_0x3f1103);return _0x3e1e4f['set'](_0xfc7f('0x25'),_0x15d999+'-'+_0x2855e1+'/'+_0x4d931c)[_0xfc7f('0x20')](_0x1dd9de);}return null;};}function patchUpdates(_0x40f549){return function(_0x1eb2b1){try{jsonpatch[_0xfc7f('0x26')](_0x1eb2b1,_0x40f549,!![]);}catch(_0x85cda4){return BPromise[_0xfc7f('0x27')](_0x85cda4);}return _0x1eb2b1[_0xfc7f('0x28')]();};}function saveUpdates(_0x50bcb4,_0x2cffc0){return function(_0x3a3fe1){if(_0x3a3fe1){return _0x3a3fe1['update'](_0x50bcb4)[_0xfc7f('0x29')](function(_0x432d96){return _0x432d96;});}return null;};}function removeEntity(_0x14b20e,_0x3a0f8c){return function(_0x19ec07){if(_0x19ec07){return _0x19ec07[_0xfc7f('0x2a')]()[_0xfc7f('0x29')](function(){var _0x24d16c=_0x19ec07[_0xfc7f('0x2b')]({'plain':!![]});var _0x1db051='WhatsappQueues';return db[_0xfc7f('0x2c')][_0xfc7f('0x2a')]({'where':{'type':_0x1db051,'resourceId':_0x24d16c['id']}})['then'](function(){return _0x19ec07;});})[_0xfc7f('0x29')](function(){_0x14b20e['status'](0xcc)[_0xfc7f('0x1f')]();});}};}function handleEntityNotFound(_0x5661f9,_0x134444){return function(_0x3712b3){if(!_0x3712b3){_0x5661f9[_0xfc7f('0x1d')](0x194);}return _0x3712b3;};}function handleError(_0x3877a0,_0x187eda){_0x187eda=_0x187eda||0x1f4;return function(_0x546f91){logger[_0xfc7f('0x2d')](_0x546f91['stack']);if(_0x546f91[_0xfc7f('0x2e')]){delete _0x546f91[_0xfc7f('0x2e')];}_0x3877a0['status'](_0x187eda)[_0xfc7f('0x2f')](_0x546f91);};}exports[_0xfc7f('0x30')]=function(_0x32a99f,_0x8584fe){var _0x219a2a={},_0x4b8838={},_0x482612={'count':0x0,'rows':[]};var _0x57e1e6=_[_0xfc7f('0x31')](db['WhatsappQueue'][_0xfc7f('0x32')],function(_0x30f60a){return{'name':_0x30f60a[_0xfc7f('0x33')],'type':_0x30f60a[_0xfc7f('0x34')][_0xfc7f('0x35')]};});_0x4b8838['model']=_[_0xfc7f('0x31')](_0x57e1e6,_0xfc7f('0x2e'));_0x4b8838[_0xfc7f('0x36')]=_[_0xfc7f('0x37')](_0x32a99f[_0xfc7f('0x36')]);_0x4b8838[_0xfc7f('0x38')]=_[_0xfc7f('0x39')](_0x4b8838[_0xfc7f('0x3a')],_0x4b8838[_0xfc7f('0x36')]);_0x219a2a[_0xfc7f('0x3b')]=_[_0xfc7f('0x39')](_0x4b8838['model'],qs[_0xfc7f('0x3c')](_0x32a99f[_0xfc7f('0x36')][_0xfc7f('0x3c')]));_0x219a2a[_0xfc7f('0x3b')]=_0x219a2a['attributes'][_0xfc7f('0x3d')]?_0x219a2a[_0xfc7f('0x3b')]:_0x4b8838['model'];if(!_0x32a99f[_0xfc7f('0x36')][_0xfc7f('0x3e')]('nolimit')){_0x219a2a[_0xfc7f('0x23')]=qs['limit'](_0x32a99f['query'][_0xfc7f('0x23')]);_0x219a2a['offset']=qs['offset'](_0x32a99f['query'][_0xfc7f('0x21')]);}_0x219a2a[_0xfc7f('0x3f')]=qs['sort'](_0x32a99f[_0xfc7f('0x36')][_0xfc7f('0x40')]);_0x219a2a[_0xfc7f('0x41')]=qs[_0xfc7f('0x38')](_[_0xfc7f('0x42')](_0x32a99f[_0xfc7f('0x36')],_0x4b8838['filters']),_0x57e1e6);if(_0x32a99f[_0xfc7f('0x36')][_0xfc7f('0x43')]){_0x219a2a[_0xfc7f('0x41')]=_[_0xfc7f('0x44')](_0x219a2a['where'],{'$or':_[_0xfc7f('0x31')](_0x57e1e6,function(_0x508969){if(_0x508969['type']!==_0xfc7f('0x45')){var _0x2e0470={};_0x2e0470[_0x508969['name']]={'$like':'%'+_0x32a99f[_0xfc7f('0x36')][_0xfc7f('0x43')]+'%'};return _0x2e0470;}})});}_0x219a2a=_[_0xfc7f('0x44')]({},_0x219a2a,_0x32a99f[_0xfc7f('0x46')]);var _0x27268f={'where':_0x219a2a[_0xfc7f('0x41')]};return db[_0xfc7f('0x47')]['count'](_0x27268f)[_0xfc7f('0x29')](function(_0x4512b9){_0x482612[_0xfc7f('0x24')]=_0x4512b9;if(_0x32a99f[_0xfc7f('0x36')][_0xfc7f('0x48')]){_0x219a2a['include']=[{'all':!![]}];}return db[_0xfc7f('0x47')][_0xfc7f('0x49')](_0x219a2a);})[_0xfc7f('0x29')](function(_0x4563a1){_0x482612[_0xfc7f('0x4a')]=_0x4563a1;return _0x482612;})[_0xfc7f('0x29')](respondWithFilteredResult(_0x8584fe,_0x219a2a))[_0xfc7f('0x4b')](handleError(_0x8584fe,null));};exports[_0xfc7f('0x4c')]=function(_0x3ec909,_0x27775f){var _0x279460={'raw':!![],'where':{'id':_0x3ec909[_0xfc7f('0x4d')]['id']}},_0x5ea6bc={};_0x5ea6bc[_0xfc7f('0x3a')]=_[_0xfc7f('0x37')](db[_0xfc7f('0x47')]['rawAttributes']);_0x5ea6bc[_0xfc7f('0x36')]=_[_0xfc7f('0x37')](_0x3ec909[_0xfc7f('0x36')]);_0x5ea6bc['filters']=_[_0xfc7f('0x39')](_0x5ea6bc[_0xfc7f('0x3a')],_0x5ea6bc[_0xfc7f('0x36')]);_0x279460['attributes']=_[_0xfc7f('0x39')](_0x5ea6bc[_0xfc7f('0x3a')],qs[_0xfc7f('0x3c')](_0x3ec909[_0xfc7f('0x36')][_0xfc7f('0x3c')]));_0x279460[_0xfc7f('0x3b')]=_0x279460['attributes'][_0xfc7f('0x3d')]?_0x279460[_0xfc7f('0x3b')]:_0x5ea6bc['model'];if(_0x3ec909['query'][_0xfc7f('0x48')]){_0x279460['include']=[{'all':!![]}];}_0x279460=_[_0xfc7f('0x44')]({},_0x279460,_0x3ec909[_0xfc7f('0x46')]);return db[_0xfc7f('0x47')][_0xfc7f('0x4e')](_0x279460)['then'](handleEntityNotFound(_0x27775f,null))[_0xfc7f('0x29')](respondWithResult(_0x27775f,null))[_0xfc7f('0x4b')](handleError(_0x27775f,null));};exports[_0xfc7f('0x4f')]=function(_0x50f63c,_0x439c5f){return db[_0xfc7f('0x47')][_0xfc7f('0x4f')](_0x50f63c['body'],{})[_0xfc7f('0x29')](function(_0xf21024){var _0x12c7d2=_0x50f63c[_0xfc7f('0x50')][_0xfc7f('0x2b')]({'plain':!![]});if(!_0x12c7d2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x12c7d2[_0xfc7f('0x51')]===_0xfc7f('0x50')){var _0x1b414d=_0xf21024[_0xfc7f('0x2b')]({'plain':!![]});var _0x1da4d5=_0xfc7f('0x52');return db[_0xfc7f('0x53')]['find']({'where':{'name':_0x1da4d5,'userProfileId':_0x12c7d2[_0xfc7f('0x54')]},'raw':!![]})['then'](function(_0x301796){if(_0x301796&&_0x301796[_0xfc7f('0x55')]===0x0){return db[_0xfc7f('0x2c')]['create']({'name':_0x1b414d[_0xfc7f('0x2e')],'resourceId':_0x1b414d['id'],'type':_0x301796[_0xfc7f('0x2e')],'sectionId':_0x301796['id']},{})[_0xfc7f('0x29')](function(){return _0xf21024;});}else{return _0xf21024;}})['catch'](function(_0x2397d8){logger[_0xfc7f('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2397d8);throw _0x2397d8;});}return _0xf21024;})['then'](respondWithResult(_0x439c5f,0xc9))[_0xfc7f('0x4b')](handleError(_0x439c5f,null));};exports[_0xfc7f('0x56')]=function(_0x59bced,_0x56fe5b){if(_0x59bced['body']['id']){delete _0x59bced['body']['id'];}return db['WhatsappQueue'][_0xfc7f('0x4e')]({'where':{'id':_0x59bced[_0xfc7f('0x4d')]['id']}})['then'](handleEntityNotFound(_0x56fe5b,null))['then'](saveUpdates(_0x59bced['body'],null))[_0xfc7f('0x29')](respondWithResult(_0x56fe5b,null))['catch'](handleError(_0x56fe5b,null));};exports[_0xfc7f('0x2a')]=function(_0x4e2c1e,_0x27b85e){return db['WhatsappQueue']['find']({'where':{'id':_0x4e2c1e[_0xfc7f('0x4d')]['id']}})['then'](handleEntityNotFound(_0x27b85e,null))['then'](removeEntity(_0x27b85e,null))[_0xfc7f('0x4b')](handleError(_0x27b85e,null));};exports[_0xfc7f('0x57')]=function(_0x583e71,_0x3655e4){return db[_0xfc7f('0x47')][_0xfc7f('0x57')]()[_0xfc7f('0x29')](respondWithResult(_0x3655e4,null))['catch'](handleError(_0x3655e4,null));};exports[_0xfc7f('0x58')]=function(_0x255cc1,_0x447cb5,_0x1ae73){var _0x10b64b={'raw':!![],'where':{}},_0x58de50={},_0x59bdb6;return db[_0xfc7f('0x47')][_0xfc7f('0x59')]({'where':{'id':_0x255cc1[_0xfc7f('0x4d')]['id']}})[_0xfc7f('0x29')](handleEntityNotFound(_0x447cb5,null))['then'](function(_0x232a5f){if(_0x232a5f){_0x59bdb6=_0x232a5f[_0xfc7f('0x2b')]({'plain':!![]});_0x58de50[_0xfc7f('0x3a')]=_[_0xfc7f('0x37')](db['UserWhatsappQueue'][_0xfc7f('0x32')]);_0x58de50['query']=_[_0xfc7f('0x37')](_0x255cc1['query']);_0x58de50[_0xfc7f('0x38')]=_[_0xfc7f('0x39')](_0x58de50[_0xfc7f('0x3a')],_0x58de50['query']);_0x10b64b['attributes']=_[_0xfc7f('0x39')](_0x58de50[_0xfc7f('0x3a')],qs[_0xfc7f('0x3c')](_0x255cc1[_0xfc7f('0x36')][_0xfc7f('0x3c')]));_0x10b64b[_0xfc7f('0x3b')]=_0x10b64b[_0xfc7f('0x3b')][_0xfc7f('0x3d')]?_0x10b64b[_0xfc7f('0x3b')]:_0x58de50[_0xfc7f('0x3a')];if(!_0x255cc1[_0xfc7f('0x36')]['hasOwnProperty'](_0xfc7f('0x5a'))){_0x10b64b[_0xfc7f('0x23')]=qs[_0xfc7f('0x23')](_0x255cc1['query'][_0xfc7f('0x23')]);_0x10b64b['offset']=qs[_0xfc7f('0x21')](_0x255cc1[_0xfc7f('0x36')][_0xfc7f('0x21')]);}_0x10b64b[_0xfc7f('0x3f')]=qs[_0xfc7f('0x40')](_0x255cc1[_0xfc7f('0x36')]['sort']);_0x10b64b[_0xfc7f('0x41')]=qs[_0xfc7f('0x38')](_[_0xfc7f('0x42')](_0x255cc1[_0xfc7f('0x36')],_0x58de50[_0xfc7f('0x38')]));_0x10b64b['where'][_0xfc7f('0x5b')]=_0x232a5f['id'];if(_0x255cc1[_0xfc7f('0x36')][_0xfc7f('0x43')]){_0x10b64b[_0xfc7f('0x41')]=_[_0xfc7f('0x44')](_0x10b64b[_0xfc7f('0x41')],{'$or':_[_0xfc7f('0x31')](_0x10b64b['attributes'],function(_0x187fae){var _0x3af345={};_0x3af345[_0x187fae]={'$like':'%'+_0x255cc1[_0xfc7f('0x36')][_0xfc7f('0x43')]+'%'};return _0x3af345;})});}_0x10b64b=_['merge']({},_0x10b64b,_0x255cc1[_0xfc7f('0x46')]);return db[_0xfc7f('0x5c')]['findAll'](_0x10b64b);}})[_0xfc7f('0x29')](function(_0x51266b){if(_0x51266b){return db[_0xfc7f('0x5d')][_0xfc7f('0x5e')]({'where':{'id':_['map'](_0x51266b,_0xfc7f('0x5f')),'role':_0xfc7f('0x60')},'attributes':['id',_0xfc7f('0x2e'),_0xfc7f('0x61'),_0xfc7f('0x62'),_0xfc7f('0x63')]});}})['then'](function(_0x43b6c1){if(_0x43b6c1){return{'count':_0x43b6c1['count'],'rows':_['map'](_0x43b6c1[_0xfc7f('0x4a')],function(_0x3cec7a){return{'membername':_0x3cec7a[_0xfc7f('0x2e')],'UserId':_0x3cec7a['id'],'queue_name':_0x59bdb6[_0xfc7f('0x2e')],'WhatsappQueueId':_0x59bdb6['id'],'interface':util['format'](_0xfc7f('0x64'),'SIP',_0x3cec7a[_0xfc7f('0x2e')]),'penalty':0x0,'paused':_0x3cec7a[_0xfc7f('0x61')],'createdAt':_0x3cec7a[_0xfc7f('0x63')],'updatedAt':_0x3cec7a['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xfc7f('0x29')](respondWithFilteredResult(_0x447cb5,_0x10b64b))[_0xfc7f('0x4b')](handleError(_0x447cb5,null));};exports['getTeams']=function(_0x4aec97,_0x3e1bb2,_0x192819){var _0x20592d={};var _0x5f4577={};var _0x1a623d;var _0x57ce48;return db['WhatsappQueue']['findOne']({'where':{'id':_0x4aec97[_0xfc7f('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3e1bb2,null))['then'](function(_0x35298d){if(_0x35298d){_0x1a623d=_0x35298d;_0x5f4577[_0xfc7f('0x3a')]=_[_0xfc7f('0x37')](db[_0xfc7f('0x65')][_0xfc7f('0x32')]);_0x5f4577['query']=_[_0xfc7f('0x37')](_0x4aec97[_0xfc7f('0x36')]);_0x5f4577[_0xfc7f('0x38')]=_[_0xfc7f('0x39')](_0x5f4577[_0xfc7f('0x3a')],_0x5f4577[_0xfc7f('0x36')]);_0x20592d['attributes']=_['intersection'](_0x5f4577[_0xfc7f('0x3a')],qs[_0xfc7f('0x3c')](_0x4aec97[_0xfc7f('0x36')][_0xfc7f('0x3c')]));_0x20592d['attributes']=_0x20592d[_0xfc7f('0x3b')][_0xfc7f('0x3d')]?_0x20592d[_0xfc7f('0x3b')]:_0x5f4577[_0xfc7f('0x3a')];_0x20592d[_0xfc7f('0x3f')]=qs[_0xfc7f('0x40')](_0x4aec97['query'][_0xfc7f('0x40')]);_0x20592d[_0xfc7f('0x41')]=qs[_0xfc7f('0x38')](_['pick'](_0x4aec97[_0xfc7f('0x36')],_0x5f4577[_0xfc7f('0x38')]));if(_0x4aec97['query'][_0xfc7f('0x43')]){_0x20592d[_0xfc7f('0x41')]=_[_0xfc7f('0x44')](_0x20592d[_0xfc7f('0x41')],{'$or':_[_0xfc7f('0x31')](_0x20592d[_0xfc7f('0x3b')],function(_0x45a8d6){var _0x5c4d7b={};_0x5c4d7b[_0x45a8d6]={'$like':'%'+_0x4aec97[_0xfc7f('0x36')]['filter']+'%'};return _0x5c4d7b;})});}_0x20592d=_[_0xfc7f('0x44')]({},_0x20592d,_0x4aec97[_0xfc7f('0x46')]);return _0x1a623d[_0xfc7f('0x66')](_0x20592d);}})[_0xfc7f('0x29')](function(_0x3bf421){if(_0x3bf421){_0x57ce48=_0x3bf421[_0xfc7f('0x3d')];if(!_0x4aec97[_0xfc7f('0x36')][_0xfc7f('0x3e')](_0xfc7f('0x5a'))){_0x20592d['limit']=qs['limit'](_0x4aec97[_0xfc7f('0x36')][_0xfc7f('0x23')]);_0x20592d['offset']=qs[_0xfc7f('0x21')](_0x4aec97['query'][_0xfc7f('0x21')]);}return _0x1a623d[_0xfc7f('0x66')](_0x20592d);}})[_0xfc7f('0x29')](function(_0x226a89){if(_0x226a89){return _0x226a89?{'count':_0x57ce48,'rows':_0x226a89}:null;}})['then'](respondWithResult(_0x3e1bb2,null))[_0xfc7f('0x4b')](handleError(_0x3e1bb2,null));};exports[_0xfc7f('0x67')]=function(_0x7dbc56,_0x374d4d,_0x46705f){var _0x1195b1=_0x7dbc56[_0xfc7f('0x68')]['ids'];return db[_0xfc7f('0x65')][_0xfc7f('0x49')]({'where':{'id':_0x1195b1},'attributes':['id'],'include':[{'model':db[_0xfc7f('0x5d')],'as':_0xfc7f('0x69'),'attributes':['id',_0xfc7f('0x2e'),'online',_0xfc7f('0x6a'),_0xfc7f('0x6b')],'raw':!![]}]})[_0xfc7f('0x29')](function(_0x293f10){if(_0x293f10){var _0x36df74=_[_0xfc7f('0x6c')](_0x293f10,function(_0x5d5d6b){var _0x257bd8=_0x5d5d6b['get']({'plain':!![]});return _0x257bd8['Agents'];});return db[_0xfc7f('0x47')]['find']({'where':{'id':_0x7dbc56[_0xfc7f('0x4d')]['id']}})[_0xfc7f('0x29')](function(_0x43a787){return db[_0xfc7f('0x6d')][_0xfc7f('0x6e')](function(_0x5dadd1){return _0x43a787['addTeams'](_0x1195b1,{'transaction':_0x5dadd1})[_0xfc7f('0x29')](function(){return BPromise['each'](_0x36df74,function(_0x1f2522){return db[_0xfc7f('0x5c')][_0xfc7f('0x6f')]({'where':{'UserId':_0x1f2522['id'],'WhatsappQueueId':_0x7dbc56[_0xfc7f('0x4d')]['id']},'transaction':_0x5dadd1});});})[_0xfc7f('0x29')](function(){_0x36df74['forEach'](function(_0x1f6022){socket[_0xfc7f('0x70')](_0xfc7f('0x71'),{'UserId':_0x1f6022['id'],'WhatsappQueueId':_0x43a787['id']});});});});});}})[_0xfc7f('0x29')](respondWithStatusCode(_0x374d4d,null))[_0xfc7f('0x4b')](handleError(_0x374d4d,null));};exports[_0xfc7f('0x72')]=function(_0x5008e4,_0x19de19,_0xe08d1c){return db[_0xfc7f('0x65')][_0xfc7f('0x49')]({'where':{'id':_0x5008e4[_0xfc7f('0x36')][_0xfc7f('0x73')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xfc7f('0x69'),'attributes':['id'],'raw':!![]}]})[_0xfc7f('0x29')](handleEntityNotFound(_0x19de19,null))[_0xfc7f('0x29')](function(_0x42935d){var _0x3161d4=_['map'](_0x42935d,'id');var _0x22b434=[];var _0xc9b761=[];var _0x23c3a9=squel[_0xfc7f('0x74')]();_0x23c3a9[_0xfc7f('0x75')](_0xfc7f('0x76'))[_0xfc7f('0x77')](_0xfc7f('0x78'),'tq')[_0xfc7f('0x79')]('user_has_teams','ut',_0xfc7f('0x7a'))[_0xfc7f('0x41')](_0xfc7f('0x7b'),_0x5008e4['params']['id']);for(var _0x2dbd59=0x0;_0x2dbd59<_0x42935d['length'];_0x2dbd59+=0x1){let _0x4e67de=_0x42935d[_0x2dbd59];for(var _0x536c60=0x0;_0x536c60<_0x4e67de[_0xfc7f('0x69')]['length'];_0x536c60+=0x1){let _0x1c319b=_0x4e67de['Agents'][_0x536c60];var _0x2d1b68=_0x23c3a9[_0xfc7f('0x7c')]();_0x2d1b68['where']('ut.UserId\x20=\x20?',_0x1c319b['id']);_0xc9b761[_0xfc7f('0x7d')](db[_0xfc7f('0x6d')]['query'](_0x2d1b68[_0xfc7f('0x7e')](),{'type':db[_0xfc7f('0x6d')][_0xfc7f('0x7f')][_0xfc7f('0x80')]})[_0xfc7f('0x29')](function(_0x243026){if(_0x243026['length']===0x1){return _0x1c319b['id'];}else{var _0x187db6=_[_0xfc7f('0x81')](_['map'](_0x243026,_0xfc7f('0x82')),function(_0x369f01){return _[_0xfc7f('0x83')](_0x3161d4,_0x369f01);});if(_0x187db6){return _0x1c319b['id'];}}}));}}return BPromise[_0xfc7f('0x84')](_0xc9b761)[_0xfc7f('0x29')](function(_0x44b240){_0x22b434=_(_0x22b434)[_0xfc7f('0x85')](_0x44b240)['compact']()[_0xfc7f('0x86')]();return db[_0xfc7f('0x47')][_0xfc7f('0x4e')]({'where':{'id':_0x5008e4[_0xfc7f('0x4d')]['id']}})[_0xfc7f('0x29')](function(_0x3b1b29){return db['sequelize'][_0xfc7f('0x6e')](function(_0x3213c3){return _0x3b1b29[_0xfc7f('0x72')](_0x5008e4[_0xfc7f('0x36')][_0xfc7f('0x73')],{'transaction':_0x3213c3})[_0xfc7f('0x29')](function(){if(!_['isEmpty'](_0x22b434)){return _0x3b1b29['removeAgents'](_0x22b434,{'transaction':_0x3213c3});}})[_0xfc7f('0x29')](function(){_0x22b434[_0xfc7f('0x87')](function(_0x91815c){socket[_0xfc7f('0x70')]('userWhatsappQueue:remove',{'UserId':_0x91815c,'WhatsappQueueId':_0x3b1b29['id']});});});});});});})['then'](respondWithStatusCode(_0x19de19,null))[_0xfc7f('0x4b')](handleError(_0x19de19,null));};exports[_0xfc7f('0x88')]=function(_0x5efe8c,_0x4e8d8e,_0x59012b){return db[_0xfc7f('0x47')][_0xfc7f('0x4e')]({'where':{'id':_0x5efe8c[_0xfc7f('0x4d')]['id']}})[_0xfc7f('0x29')](handleEntityNotFound(_0x4e8d8e,null))[_0xfc7f('0x29')](function(_0x1b4ac3){if(_0x1b4ac3){return _0x1b4ac3[_0xfc7f('0x88')](_0x5efe8c['body']['ids'],_[_0xfc7f('0x89')](_0x5efe8c[_0xfc7f('0x68')],['ids','id'])||{})[_0xfc7f('0x8a')](function(_0x158efa){for(var _0x19345e=0x0;_0x19345e<_0x5efe8c[_0xfc7f('0x68')][_0xfc7f('0x73')]['length'];_0x19345e+=0x1){socket[_0xfc7f('0x70')](_0xfc7f('0x71'),{'UserId':Number(_0x5efe8c[_0xfc7f('0x68')][_0xfc7f('0x73')][_0x19345e]),'WhatsappQueueId':Number(_0x5efe8c[_0xfc7f('0x4d')]['id'])});}return _0x158efa;});}})[_0xfc7f('0x29')](respondWithResult(_0x4e8d8e,null))[_0xfc7f('0x4b')](handleError(_0x4e8d8e,null));};exports[_0xfc7f('0x8b')]=function(_0x3d744e,_0x2cf3a8,_0x1c81e5){return db[_0xfc7f('0x47')][_0xfc7f('0x4e')]({'where':{'id':_0x3d744e[_0xfc7f('0x4d')]['id']}})[_0xfc7f('0x29')](handleEntityNotFound(_0x2cf3a8,null))['then'](function(_0x27a24b){if(_0x27a24b){return _0x27a24b[_0xfc7f('0x8b')](_0x3d744e['query'][_0xfc7f('0x73')])[_0xfc7f('0x29')](function(){if(_[_0xfc7f('0x8c')](_0x3d744e[_0xfc7f('0x36')]['ids'])){for(var _0x5c56fc=0x0;_0x5c56fc<_0x3d744e[_0xfc7f('0x36')][_0xfc7f('0x73')][_0xfc7f('0x3d')];_0x5c56fc+=0x1){socket['emit'](_0xfc7f('0x8d'),{'UserId':Number(_0x3d744e[_0xfc7f('0x36')][_0xfc7f('0x73')][_0x5c56fc]),'WhatsappQueueId':Number(_0x3d744e[_0xfc7f('0x4d')]['id'])});}}else{socket[_0xfc7f('0x70')](_0xfc7f('0x8d'),{'UserId':Number(_0x3d744e[_0xfc7f('0x36')][_0xfc7f('0x73')]),'WhatsappQueueId':Number(_0x3d744e[_0xfc7f('0x4d')]['id'])});}});}})[_0xfc7f('0x29')](respondWithStatusCode(_0x2cf3a8,null))['catch'](handleError(_0x2cf3a8,null));};exports['getAgents']=function(_0x56e73b,_0x4d83ea,_0x4b219c){var _0x4165f3={};var _0x227d3e={};var _0x187d03;var _0x2bae39;return db[_0xfc7f('0x47')][_0xfc7f('0x59')]({'where':{'id':_0x56e73b['params']['id']}})[_0xfc7f('0x29')](handleEntityNotFound(_0x4d83ea,null))[_0xfc7f('0x29')](function(_0xd6e3ad){if(_0xd6e3ad){_0x187d03=_0xd6e3ad;_0x227d3e[_0xfc7f('0x3a')]=_[_0xfc7f('0x37')](db[_0xfc7f('0x5d')][_0xfc7f('0x32')]);_0x227d3e[_0xfc7f('0x36')]=_[_0xfc7f('0x37')](_0x56e73b[_0xfc7f('0x36')]);_0x227d3e[_0xfc7f('0x38')]=_[_0xfc7f('0x39')](_0x227d3e['model'],_0x227d3e[_0xfc7f('0x36')]);_0x4165f3[_0xfc7f('0x3b')]=_['intersection'](_0x227d3e['model'],qs['fields'](_0x56e73b[_0xfc7f('0x36')][_0xfc7f('0x3c')]));_0x4165f3[_0xfc7f('0x3b')]=_0x4165f3['attributes'][_0xfc7f('0x3d')]?_0x4165f3[_0xfc7f('0x3b')]:_0x227d3e[_0xfc7f('0x3a')];_0x4165f3[_0xfc7f('0x3f')]=qs['sort'](_0x56e73b[_0xfc7f('0x36')][_0xfc7f('0x40')]);_0x4165f3['where']=qs['filters'](_[_0xfc7f('0x42')](_0x56e73b[_0xfc7f('0x36')],_0x227d3e['filters']));if(_0x56e73b[_0xfc7f('0x36')][_0xfc7f('0x43')]){_0x4165f3[_0xfc7f('0x41')]=_[_0xfc7f('0x44')](_0x4165f3['where'],{'$or':_[_0xfc7f('0x31')](_0x4165f3[_0xfc7f('0x3b')],function(_0x318e2e){var _0x1d2598={};_0x1d2598[_0x318e2e]={'$like':'%'+_0x56e73b[_0xfc7f('0x36')][_0xfc7f('0x43')]+'%'};return _0x1d2598;})});}_0x4165f3=_[_0xfc7f('0x44')]({},_0x4165f3,_0x56e73b['options']);return _0x187d03[_0xfc7f('0x8e')](_0x4165f3);}})['then'](function(_0x223801){if(_0x223801){_0x2bae39=_0x223801[_0xfc7f('0x3d')];if(!_0x56e73b[_0xfc7f('0x36')]['hasOwnProperty'](_0xfc7f('0x5a'))){_0x4165f3[_0xfc7f('0x23')]=qs[_0xfc7f('0x23')](_0x56e73b['query'][_0xfc7f('0x23')]);_0x4165f3[_0xfc7f('0x21')]=qs[_0xfc7f('0x21')](_0x56e73b[_0xfc7f('0x36')][_0xfc7f('0x21')]);}return _0x187d03[_0xfc7f('0x8e')](_0x4165f3);}})[_0xfc7f('0x29')](function(_0x10098c){if(_0x10098c){return _0x10098c?{'count':_0x2bae39,'rows':_0x10098c}:null;}})[_0xfc7f('0x29')](respondWithResult(_0x4d83ea,null))[_0xfc7f('0x4b')](handleError(_0x4d83ea,null));}; \ No newline at end of file +var _0x140a=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','WhatsappQueueId','UserWhatsappQueue','findAndCountAll','UserId','agent','whatsappPause','format','%s/%s','SIP','createdAt','updatedAt','getTeams','addTeams','ids','Team','findAll','Agents','online','voicePause','flatMap','transaction','each','findOrCreate','forEach','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','toString','sequelize','QueryTypes','every','TeamId','includes','union','compact','value','isEmpty','removeAgents','emit','userWhatsappQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','./whatsappQueue.socket','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','error','stack','name','index','WhatsappQueue','fieldName','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','catch','params','rawAttributes','find','create'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x140a,0x1dd));var _0xa140=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x140a[_0x422905];return _0x33dc6c;};'use strict';var emlformat=require(_0xa140('0x0'));var rimraf=require(_0xa140('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa140('0x2'));var rp=require(_0xa140('0x3'));var moment=require(_0xa140('0x4'));var BPromise=require(_0xa140('0x5'));var Mustache=require('mustache');var util=require(_0xa140('0x6'));var path=require(_0xa140('0x7'));var sox=require(_0xa140('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa140('0x9'));var _=require('lodash');var squel=require(_0xa140('0xa'));var crypto=require(_0xa140('0xb'));var jsforce=require(_0xa140('0xc'));var deskjs=require(_0xa140('0xd'));var toCsv=require(_0xa140('0xe'));var querystring=require(_0xa140('0xf'));var Papa=require(_0xa140('0x10'));var Redis=require(_0xa140('0x11'));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(_0xa140('0x12'))('api');var utils=require(_0xa140('0x13'));var config=require(_0xa140('0x14'));var licenseUtil=require(_0xa140('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xa140('0x16')](config[_0xa140('0x17')],{'host':_0xa140('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa140('0x17')]));require(_0xa140('0x19'))['register'](socket);function respondWithStatusCode(_0xd6bdd5,_0x40a4c5){_0x40a4c5=_0x40a4c5||0xcc;return function(_0x535c70){if(_0x535c70){return _0xd6bdd5[_0xa140('0x1a')](_0x40a4c5);}return _0xd6bdd5[_0xa140('0x1b')](_0x40a4c5)['end']();};}function respondWithResult(_0x55cb3f,_0x3517d3){_0x3517d3=_0x3517d3||0xc8;return function(_0x5730d0){if(_0x5730d0){return _0x55cb3f['status'](_0x3517d3)[_0xa140('0x1c')](_0x5730d0);}};}function respondWithFilteredResult(_0x4a7301,_0x383a78){return function(_0x58e3b3){if(_0x58e3b3){var _0x2e6eeb=typeof _0x383a78[_0xa140('0x1d')]===_0xa140('0x1e')&&typeof _0x383a78[_0xa140('0x1f')]==='undefined';var _0x53a9bd=_0x58e3b3[_0xa140('0x20')];var _0x3e9c2c=_0x2e6eeb?0x0:_0x383a78[_0xa140('0x1d')];var _0x21b965=_0x2e6eeb?_0x58e3b3[_0xa140('0x20')]:_0x383a78[_0xa140('0x1d')]+_0x383a78[_0xa140('0x1f')];var _0x360ba5;if(_0x21b965>=_0x53a9bd){_0x21b965=_0x53a9bd;_0x360ba5=0xc8;}else{_0x360ba5=0xce;}_0x4a7301['status'](_0x360ba5);return _0x4a7301[_0xa140('0x21')](_0xa140('0x22'),_0x3e9c2c+'-'+_0x21b965+'/'+_0x53a9bd)[_0xa140('0x1c')](_0x58e3b3);}return null;};}function patchUpdates(_0x5546aa){return function(_0x336ee0){try{jsonpatch['apply'](_0x336ee0,_0x5546aa,!![]);}catch(_0x10931e){return BPromise[_0xa140('0x23')](_0x10931e);}return _0x336ee0[_0xa140('0x24')]();};}function saveUpdates(_0x53a13a,_0x366515){return function(_0x465c4a){if(_0x465c4a){return _0x465c4a[_0xa140('0x25')](_0x53a13a)[_0xa140('0x26')](function(_0x2b7ed6){return _0x2b7ed6;});}return null;};}function removeEntity(_0x1261ed,_0xafff99){return function(_0x1becae){if(_0x1becae){return _0x1becae[_0xa140('0x27')]()[_0xa140('0x26')](function(){var _0x459d78=_0x1becae[_0xa140('0x28')]({'plain':!![]});var _0x4a6dff=_0xa140('0x29');return db[_0xa140('0x2a')][_0xa140('0x27')]({'where':{'type':_0x4a6dff,'resourceId':_0x459d78['id']}})['then'](function(){return _0x1becae;});})[_0xa140('0x26')](function(){_0x1261ed[_0xa140('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b6c66,_0x65e84c){return function(_0x5f1cd2){if(!_0x5f1cd2){_0x2b6c66['sendStatus'](0x194);}return _0x5f1cd2;};}function handleError(_0xbd9c73,_0x3d7185){_0x3d7185=_0x3d7185||0x1f4;return function(_0x25fea6){logger[_0xa140('0x2b')](_0x25fea6[_0xa140('0x2c')]);if(_0x25fea6[_0xa140('0x2d')]){delete _0x25fea6[_0xa140('0x2d')];}_0xbd9c73[_0xa140('0x1b')](_0x3d7185)['send'](_0x25fea6);};}exports[_0xa140('0x2e')]=function(_0x5e42ee,_0x349fc4){var _0x25f141={},_0x1f3c1b={},_0x2b23a7={'count':0x0,'rows':[]};var _0x5caa5f=_['map'](db[_0xa140('0x2f')]['rawAttributes'],function(_0x7e6f13){return{'name':_0x7e6f13[_0xa140('0x30')],'type':_0x7e6f13['type']['key']};});_0x1f3c1b['model']=_['map'](_0x5caa5f,_0xa140('0x2d'));_0x1f3c1b[_0xa140('0x31')]=_[_0xa140('0x32')](_0x5e42ee[_0xa140('0x31')]);_0x1f3c1b[_0xa140('0x33')]=_['intersection'](_0x1f3c1b[_0xa140('0x34')],_0x1f3c1b['query']);_0x25f141[_0xa140('0x35')]=_[_0xa140('0x36')](_0x1f3c1b[_0xa140('0x34')],qs[_0xa140('0x37')](_0x5e42ee['query'][_0xa140('0x37')]));_0x25f141[_0xa140('0x35')]=_0x25f141[_0xa140('0x35')][_0xa140('0x38')]?_0x25f141[_0xa140('0x35')]:_0x1f3c1b[_0xa140('0x34')];if(!_0x5e42ee[_0xa140('0x31')][_0xa140('0x39')](_0xa140('0x3a'))){_0x25f141[_0xa140('0x1f')]=qs[_0xa140('0x1f')](_0x5e42ee['query'][_0xa140('0x1f')]);_0x25f141[_0xa140('0x1d')]=qs[_0xa140('0x1d')](_0x5e42ee['query']['offset']);}_0x25f141[_0xa140('0x3b')]=qs[_0xa140('0x3c')](_0x5e42ee[_0xa140('0x31')][_0xa140('0x3c')]);_0x25f141[_0xa140('0x3d')]=qs[_0xa140('0x33')](_[_0xa140('0x3e')](_0x5e42ee[_0xa140('0x31')],_0x1f3c1b['filters']),_0x5caa5f);if(_0x5e42ee[_0xa140('0x31')][_0xa140('0x3f')]){_0x25f141['where']=_[_0xa140('0x40')](_0x25f141[_0xa140('0x3d')],{'$or':_[_0xa140('0x41')](_0x5caa5f,function(_0x1d506e){if(_0x1d506e['type']!==_0xa140('0x42')){var _0x2661b1={};_0x2661b1[_0x1d506e['name']]={'$like':'%'+_0x5e42ee[_0xa140('0x31')][_0xa140('0x3f')]+'%'};return _0x2661b1;}})});}_0x25f141=_[_0xa140('0x40')]({},_0x25f141,_0x5e42ee[_0xa140('0x43')]);var _0x48ce0e={'where':_0x25f141['where']};return db[_0xa140('0x2f')][_0xa140('0x20')](_0x48ce0e)[_0xa140('0x26')](function(_0x25fd3d){_0x2b23a7[_0xa140('0x20')]=_0x25fd3d;if(_0x5e42ee[_0xa140('0x31')][_0xa140('0x44')]){_0x25f141[_0xa140('0x45')]=[{'all':!![]}];}return db['WhatsappQueue']['findAll'](_0x25f141);})[_0xa140('0x26')](function(_0xffa03d){_0x2b23a7['rows']=_0xffa03d;return _0x2b23a7;})[_0xa140('0x26')](respondWithFilteredResult(_0x349fc4,_0x25f141))[_0xa140('0x46')](handleError(_0x349fc4,null));};exports['show']=function(_0x353c2a,_0x58b4d9){var _0x5a18ab={'raw':!![],'where':{'id':_0x353c2a[_0xa140('0x47')]['id']}},_0x5ba5a1={};_0x5ba5a1[_0xa140('0x34')]=_[_0xa140('0x32')](db[_0xa140('0x2f')][_0xa140('0x48')]);_0x5ba5a1[_0xa140('0x31')]=_[_0xa140('0x32')](_0x353c2a[_0xa140('0x31')]);_0x5ba5a1[_0xa140('0x33')]=_['intersection'](_0x5ba5a1[_0xa140('0x34')],_0x5ba5a1['query']);_0x5a18ab['attributes']=_[_0xa140('0x36')](_0x5ba5a1[_0xa140('0x34')],qs[_0xa140('0x37')](_0x353c2a[_0xa140('0x31')][_0xa140('0x37')]));_0x5a18ab[_0xa140('0x35')]=_0x5a18ab[_0xa140('0x35')]['length']?_0x5a18ab[_0xa140('0x35')]:_0x5ba5a1[_0xa140('0x34')];if(_0x353c2a['query']['includeAll']){_0x5a18ab[_0xa140('0x45')]=[{'all':!![]}];}_0x5a18ab=_['merge']({},_0x5a18ab,_0x353c2a[_0xa140('0x43')]);return db[_0xa140('0x2f')][_0xa140('0x49')](_0x5a18ab)[_0xa140('0x26')](handleEntityNotFound(_0x58b4d9,null))['then'](respondWithResult(_0x58b4d9,null))['catch'](handleError(_0x58b4d9,null));};exports[_0xa140('0x4a')]=function(_0x2a9cdb,_0x5a4a39){return db[_0xa140('0x2f')][_0xa140('0x4a')](_0x2a9cdb['body'],{})[_0xa140('0x26')](function(_0xe12e07){var _0x450713=_0x2a9cdb['user']['get']({'plain':!![]});if(!_0x450713)throw new Error(_0xa140('0x4b'));if(_0x450713[_0xa140('0x4c')]==='user'){var _0x495850=_0xe12e07[_0xa140('0x28')]({'plain':!![]});var _0x523193=_0xa140('0x29');return db[_0xa140('0x4d')]['find']({'where':{'name':_0x523193,'userProfileId':_0x450713[_0xa140('0x4e')]},'raw':!![]})[_0xa140('0x26')](function(_0x466d80){if(_0x466d80&&_0x466d80[_0xa140('0x4f')]===0x0){return db[_0xa140('0x2a')][_0xa140('0x4a')]({'name':_0x495850[_0xa140('0x2d')],'resourceId':_0x495850['id'],'type':_0x466d80[_0xa140('0x2d')],'sectionId':_0x466d80['id']},{})['then'](function(){return _0xe12e07;});}else{return _0xe12e07;}})[_0xa140('0x46')](function(_0x5ab12b){logger[_0xa140('0x2b')](_0xa140('0x50'),_0x5ab12b);throw _0x5ab12b;});}return _0xe12e07;})['then'](respondWithResult(_0x5a4a39,0xc9))[_0xa140('0x46')](handleError(_0x5a4a39,null));};exports['update']=function(_0x26e6da,_0x3b5dcb){if(_0x26e6da['body']['id']){delete _0x26e6da[_0xa140('0x51')]['id'];}return db['WhatsappQueue'][_0xa140('0x49')]({'where':{'id':_0x26e6da[_0xa140('0x47')]['id']}})[_0xa140('0x26')](handleEntityNotFound(_0x3b5dcb,null))[_0xa140('0x26')](saveUpdates(_0x26e6da[_0xa140('0x51')],null))[_0xa140('0x26')](respondWithResult(_0x3b5dcb,null))[_0xa140('0x46')](handleError(_0x3b5dcb,null));};exports['destroy']=function(_0x5640d1,_0x36b9b6){return db[_0xa140('0x2f')][_0xa140('0x49')]({'where':{'id':_0x5640d1[_0xa140('0x47')]['id']}})['then'](handleEntityNotFound(_0x36b9b6,null))[_0xa140('0x26')](removeEntity(_0x36b9b6,null))['catch'](handleError(_0x36b9b6,null));};exports[_0xa140('0x52')]=function(_0x3a8cf6,_0x237e36){return db[_0xa140('0x2f')][_0xa140('0x52')]()[_0xa140('0x26')](respondWithResult(_0x237e36,null))[_0xa140('0x46')](handleError(_0x237e36,null));};exports[_0xa140('0x53')]=function(_0x28272d,_0x1ae758,_0x18731d){var _0x1044b1={'raw':!![],'where':{}},_0x4f035c={},_0x3a4bbd;return db[_0xa140('0x2f')][_0xa140('0x54')]({'where':{'id':_0x28272d[_0xa140('0x47')]['id']}})[_0xa140('0x26')](handleEntityNotFound(_0x1ae758,null))[_0xa140('0x26')](function(_0x1fb902){if(_0x1fb902){_0x3a4bbd=_0x1fb902[_0xa140('0x28')]({'plain':!![]});_0x4f035c[_0xa140('0x34')]=_[_0xa140('0x32')](db['UserWhatsappQueue'][_0xa140('0x48')]);_0x4f035c[_0xa140('0x31')]=_[_0xa140('0x32')](_0x28272d[_0xa140('0x31')]);_0x4f035c[_0xa140('0x33')]=_['intersection'](_0x4f035c[_0xa140('0x34')],_0x4f035c[_0xa140('0x31')]);_0x1044b1[_0xa140('0x35')]=_[_0xa140('0x36')](_0x4f035c[_0xa140('0x34')],qs[_0xa140('0x37')](_0x28272d['query'][_0xa140('0x37')]));_0x1044b1[_0xa140('0x35')]=_0x1044b1['attributes'][_0xa140('0x38')]?_0x1044b1['attributes']:_0x4f035c['model'];if(!_0x28272d[_0xa140('0x31')][_0xa140('0x39')](_0xa140('0x3a'))){_0x1044b1[_0xa140('0x1f')]=qs[_0xa140('0x1f')](_0x28272d[_0xa140('0x31')]['limit']);_0x1044b1[_0xa140('0x1d')]=qs[_0xa140('0x1d')](_0x28272d[_0xa140('0x31')][_0xa140('0x1d')]);}_0x1044b1['order']=qs[_0xa140('0x3c')](_0x28272d['query'][_0xa140('0x3c')]);_0x1044b1[_0xa140('0x3d')]=qs[_0xa140('0x33')](_[_0xa140('0x3e')](_0x28272d[_0xa140('0x31')],_0x4f035c['filters']));_0x1044b1[_0xa140('0x3d')][_0xa140('0x55')]=_0x1fb902['id'];if(_0x28272d[_0xa140('0x31')][_0xa140('0x3f')]){_0x1044b1['where']=_[_0xa140('0x40')](_0x1044b1[_0xa140('0x3d')],{'$or':_['map'](_0x1044b1[_0xa140('0x35')],function(_0x20fd64){var _0x3ace93={};_0x3ace93[_0x20fd64]={'$like':'%'+_0x28272d['query'][_0xa140('0x3f')]+'%'};return _0x3ace93;})});}_0x1044b1=_[_0xa140('0x40')]({},_0x1044b1,_0x28272d[_0xa140('0x43')]);return db[_0xa140('0x56')]['findAll'](_0x1044b1);}})['then'](function(_0x598853){if(_0x598853){return db['User'][_0xa140('0x57')]({'where':{'id':_['map'](_0x598853,_0xa140('0x58')),'role':_0xa140('0x59')},'attributes':['id',_0xa140('0x2d'),_0xa140('0x5a'),'updatedAt','createdAt']});}})['then'](function(_0xc89b4a){if(_0xc89b4a){return{'count':_0xc89b4a[_0xa140('0x20')],'rows':_[_0xa140('0x41')](_0xc89b4a['rows'],function(_0x2b836b){return{'membername':_0x2b836b[_0xa140('0x2d')],'UserId':_0x2b836b['id'],'queue_name':_0x3a4bbd['name'],'WhatsappQueueId':_0x3a4bbd['id'],'interface':util[_0xa140('0x5b')](_0xa140('0x5c'),_0xa140('0x5d'),_0x2b836b[_0xa140('0x2d')]),'penalty':0x0,'paused':_0x2b836b[_0xa140('0x5a')],'createdAt':_0x2b836b[_0xa140('0x5e')],'updatedAt':_0x2b836b[_0xa140('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa140('0x26')](respondWithFilteredResult(_0x1ae758,_0x1044b1))[_0xa140('0x46')](handleError(_0x1ae758,null));};exports['getTeams']=function(_0x490864,_0x416e41,_0x53462f){var _0x277855={};var _0x29114f={};var _0xa249ed;var _0x207a75;return db[_0xa140('0x2f')]['findOne']({'where':{'id':_0x490864[_0xa140('0x47')]['id']}})[_0xa140('0x26')](handleEntityNotFound(_0x416e41,null))[_0xa140('0x26')](function(_0x37ea3b){if(_0x37ea3b){_0xa249ed=_0x37ea3b;_0x29114f[_0xa140('0x34')]=_[_0xa140('0x32')](db['Team']['rawAttributes']);_0x29114f['query']=_['keys'](_0x490864[_0xa140('0x31')]);_0x29114f[_0xa140('0x33')]=_[_0xa140('0x36')](_0x29114f[_0xa140('0x34')],_0x29114f[_0xa140('0x31')]);_0x277855[_0xa140('0x35')]=_[_0xa140('0x36')](_0x29114f[_0xa140('0x34')],qs[_0xa140('0x37')](_0x490864[_0xa140('0x31')][_0xa140('0x37')]));_0x277855[_0xa140('0x35')]=_0x277855[_0xa140('0x35')][_0xa140('0x38')]?_0x277855[_0xa140('0x35')]:_0x29114f[_0xa140('0x34')];_0x277855[_0xa140('0x3b')]=qs[_0xa140('0x3c')](_0x490864['query'][_0xa140('0x3c')]);_0x277855[_0xa140('0x3d')]=qs['filters'](_[_0xa140('0x3e')](_0x490864['query'],_0x29114f[_0xa140('0x33')]));if(_0x490864[_0xa140('0x31')]['filter']){_0x277855[_0xa140('0x3d')]=_[_0xa140('0x40')](_0x277855['where'],{'$or':_[_0xa140('0x41')](_0x277855[_0xa140('0x35')],function(_0x288e46){var _0x2c4021={};_0x2c4021[_0x288e46]={'$like':'%'+_0x490864[_0xa140('0x31')][_0xa140('0x3f')]+'%'};return _0x2c4021;})});}_0x277855=_['merge']({},_0x277855,_0x490864[_0xa140('0x43')]);return _0xa249ed['getTeams'](_0x277855);}})[_0xa140('0x26')](function(_0x95e29d){if(_0x95e29d){_0x207a75=_0x95e29d[_0xa140('0x38')];if(!_0x490864[_0xa140('0x31')][_0xa140('0x39')](_0xa140('0x3a'))){_0x277855[_0xa140('0x1f')]=qs[_0xa140('0x1f')](_0x490864[_0xa140('0x31')][_0xa140('0x1f')]);_0x277855[_0xa140('0x1d')]=qs[_0xa140('0x1d')](_0x490864[_0xa140('0x31')][_0xa140('0x1d')]);}return _0xa249ed[_0xa140('0x60')](_0x277855);}})[_0xa140('0x26')](function(_0x1899d2){if(_0x1899d2){return _0x1899d2?{'count':_0x207a75,'rows':_0x1899d2}:null;}})[_0xa140('0x26')](respondWithResult(_0x416e41,null))[_0xa140('0x46')](handleError(_0x416e41,null));};exports[_0xa140('0x61')]=function(_0x4c3a65,_0x137925,_0x2d0b40){var _0x9e4b95=_0x4c3a65[_0xa140('0x51')][_0xa140('0x62')];return db[_0xa140('0x63')][_0xa140('0x64')]({'where':{'id':_0x9e4b95},'attributes':['id'],'include':[{'model':db['User'],'as':_0xa140('0x65'),'attributes':['id',_0xa140('0x2d'),_0xa140('0x66'),_0xa140('0x67'),'interface'],'raw':!![]}]})[_0xa140('0x26')](function(_0x732edb){if(_0x732edb){var _0x218c6b=_[_0xa140('0x68')](_0x732edb,function(_0x37694a){var _0x355acf=_0x37694a[_0xa140('0x28')]({'plain':!![]});return _0x355acf[_0xa140('0x65')];});return db[_0xa140('0x2f')][_0xa140('0x49')]({'where':{'id':_0x4c3a65[_0xa140('0x47')]['id']}})[_0xa140('0x26')](function(_0x5ca3c2){return db['sequelize'][_0xa140('0x69')](function(_0x2a252d){return _0x5ca3c2['addTeams'](_0x9e4b95,{'transaction':_0x2a252d})['then'](function(){return BPromise[_0xa140('0x6a')](_0x218c6b,function(_0x1e9baa){return db[_0xa140('0x56')][_0xa140('0x6b')]({'where':{'UserId':_0x1e9baa['id'],'WhatsappQueueId':_0x4c3a65[_0xa140('0x47')]['id']},'transaction':_0x2a252d});});})[_0xa140('0x26')](function(){_0x218c6b[_0xa140('0x6c')](function(_0x8932f8){socket['emit'](_0xa140('0x6d'),{'UserId':_0x8932f8['id'],'WhatsappQueueId':_0x5ca3c2['id']});});});});});}})['then'](respondWithStatusCode(_0x137925,null))[_0xa140('0x46')](handleError(_0x137925,null));};exports[_0xa140('0x6e')]=function(_0x4c98e4,_0x15add4,_0x3e9f6a){return db[_0xa140('0x63')][_0xa140('0x64')]({'where':{'id':_0x4c98e4[_0xa140('0x31')][_0xa140('0x62')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xa140('0x65'),'attributes':['id'],'raw':!![]}]})[_0xa140('0x26')](handleEntityNotFound(_0x15add4,null))[_0xa140('0x26')](function(_0x285986){var _0x30b32c=_[_0xa140('0x41')](_0x285986,'id');var _0x560ea1=[];var _0x456a3b=[];var _0x3e8058=squel[_0xa140('0x6f')]();_0x3e8058[_0xa140('0x70')](_0xa140('0x71'))[_0xa140('0x72')](_0xa140('0x73'),'tq')[_0xa140('0x74')]('user_has_teams','ut',_0xa140('0x75'))[_0xa140('0x3d')]('WhatsappQueueId\x20=\x20?',_0x4c98e4['params']['id']);for(var _0x44e280=0x0;_0x44e280<_0x285986[_0xa140('0x38')];_0x44e280+=0x1){let _0x57bdfd=_0x285986[_0x44e280];for(var _0x462168=0x0;_0x462168<_0x57bdfd[_0xa140('0x65')]['length'];_0x462168+=0x1){let _0xbf876c=_0x57bdfd[_0xa140('0x65')][_0x462168];var _0x45d774=_0x3e8058['clone']();_0x45d774[_0xa140('0x3d')](_0xa140('0x76'),_0xbf876c['id']);_0x456a3b[_0xa140('0x77')](db['sequelize'][_0xa140('0x31')](_0x45d774[_0xa140('0x78')](),{'type':db[_0xa140('0x79')][_0xa140('0x7a')]['SELECT']})[_0xa140('0x26')](function(_0x268b30){if(_0x268b30[_0xa140('0x38')]===0x1){return _0xbf876c['id'];}else{var _0x183dd6=_[_0xa140('0x7b')](_[_0xa140('0x41')](_0x268b30,_0xa140('0x7c')),function(_0x7b3b15){return _[_0xa140('0x7d')](_0x30b32c,_0x7b3b15);});if(_0x183dd6){return _0xbf876c['id'];}}}));}}return BPromise['all'](_0x456a3b)['then'](function(_0x21d4aa){_0x560ea1=_(_0x560ea1)[_0xa140('0x7e')](_0x21d4aa)[_0xa140('0x7f')]()[_0xa140('0x80')]();return db[_0xa140('0x2f')][_0xa140('0x49')]({'where':{'id':_0x4c98e4[_0xa140('0x47')]['id']}})[_0xa140('0x26')](function(_0x3f5c0d){return db['sequelize'][_0xa140('0x69')](function(_0x18ed9c){return _0x3f5c0d[_0xa140('0x6e')](_0x4c98e4[_0xa140('0x31')][_0xa140('0x62')],{'transaction':_0x18ed9c})[_0xa140('0x26')](function(){if(!_[_0xa140('0x81')](_0x560ea1)){return _0x3f5c0d[_0xa140('0x82')](_0x560ea1,{'transaction':_0x18ed9c});}})[_0xa140('0x26')](function(){_0x560ea1['forEach'](function(_0x56dce1){socket[_0xa140('0x83')](_0xa140('0x84'),{'UserId':_0x56dce1,'WhatsappQueueId':_0x3f5c0d['id']});});});});});});})[_0xa140('0x26')](respondWithStatusCode(_0x15add4,null))[_0xa140('0x46')](handleError(_0x15add4,null));};exports[_0xa140('0x85')]=function(_0x568bb4,_0x48a08c,_0xd99495){return db[_0xa140('0x2f')][_0xa140('0x49')]({'where':{'id':_0x568bb4[_0xa140('0x47')]['id']}})[_0xa140('0x26')](handleEntityNotFound(_0x48a08c,null))[_0xa140('0x26')](function(_0x279609){if(_0x279609){return _0x279609[_0xa140('0x85')](_0x568bb4[_0xa140('0x51')][_0xa140('0x62')],_[_0xa140('0x86')](_0x568bb4[_0xa140('0x51')],[_0xa140('0x62'),'id'])||{})[_0xa140('0x87')](function(_0x520054){for(var _0x213f44=0x0;_0x213f44<_0x568bb4[_0xa140('0x51')]['ids']['length'];_0x213f44+=0x1){socket[_0xa140('0x83')]('userWhatsappQueue:save',{'UserId':Number(_0x568bb4[_0xa140('0x51')][_0xa140('0x62')][_0x213f44]),'WhatsappQueueId':Number(_0x568bb4[_0xa140('0x47')]['id'])});}return _0x520054;});}})['then'](respondWithResult(_0x48a08c,null))[_0xa140('0x46')](handleError(_0x48a08c,null));};exports[_0xa140('0x82')]=function(_0x203cec,_0x5c19bd,_0xda8fce){return db[_0xa140('0x2f')][_0xa140('0x49')]({'where':{'id':_0x203cec[_0xa140('0x47')]['id']}})[_0xa140('0x26')](handleEntityNotFound(_0x5c19bd,null))[_0xa140('0x26')](function(_0xc61d2b){if(_0xc61d2b){return _0xc61d2b[_0xa140('0x82')](_0x203cec[_0xa140('0x31')][_0xa140('0x62')])[_0xa140('0x26')](function(){if(_[_0xa140('0x88')](_0x203cec[_0xa140('0x31')][_0xa140('0x62')])){for(var _0x5d316c=0x0;_0x5d316c<_0x203cec[_0xa140('0x31')][_0xa140('0x62')]['length'];_0x5d316c+=0x1){socket[_0xa140('0x83')](_0xa140('0x84'),{'UserId':Number(_0x203cec[_0xa140('0x31')][_0xa140('0x62')][_0x5d316c]),'WhatsappQueueId':Number(_0x203cec[_0xa140('0x47')]['id'])});}}else{socket[_0xa140('0x83')]('userWhatsappQueue:remove',{'UserId':Number(_0x203cec['query'][_0xa140('0x62')]),'WhatsappQueueId':Number(_0x203cec['params']['id'])});}});}})['then'](respondWithStatusCode(_0x5c19bd,null))[_0xa140('0x46')](handleError(_0x5c19bd,null));};exports[_0xa140('0x89')]=function(_0x5c9bbc,_0x3ed076,_0x52270c){var _0x594c1c={};var _0x3c49af={};var _0x3cf69b;var _0x309116;return db[_0xa140('0x2f')][_0xa140('0x54')]({'where':{'id':_0x5c9bbc[_0xa140('0x47')]['id']}})['then'](handleEntityNotFound(_0x3ed076,null))[_0xa140('0x26')](function(_0x2b7c53){if(_0x2b7c53){_0x3cf69b=_0x2b7c53;_0x3c49af[_0xa140('0x34')]=_['keys'](db['User'][_0xa140('0x48')]);_0x3c49af['query']=_[_0xa140('0x32')](_0x5c9bbc['query']);_0x3c49af[_0xa140('0x33')]=_[_0xa140('0x36')](_0x3c49af[_0xa140('0x34')],_0x3c49af[_0xa140('0x31')]);_0x594c1c[_0xa140('0x35')]=_['intersection'](_0x3c49af[_0xa140('0x34')],qs[_0xa140('0x37')](_0x5c9bbc[_0xa140('0x31')][_0xa140('0x37')]));_0x594c1c[_0xa140('0x35')]=_0x594c1c[_0xa140('0x35')][_0xa140('0x38')]?_0x594c1c[_0xa140('0x35')]:_0x3c49af[_0xa140('0x34')];_0x594c1c[_0xa140('0x3b')]=qs[_0xa140('0x3c')](_0x5c9bbc['query'][_0xa140('0x3c')]);_0x594c1c[_0xa140('0x3d')]=qs[_0xa140('0x33')](_[_0xa140('0x3e')](_0x5c9bbc[_0xa140('0x31')],_0x3c49af[_0xa140('0x33')]));if(_0x5c9bbc[_0xa140('0x31')][_0xa140('0x3f')]){_0x594c1c[_0xa140('0x3d')]=_[_0xa140('0x40')](_0x594c1c[_0xa140('0x3d')],{'$or':_[_0xa140('0x41')](_0x594c1c['attributes'],function(_0x175efe){var _0x28ad2f={};_0x28ad2f[_0x175efe]={'$like':'%'+_0x5c9bbc['query'][_0xa140('0x3f')]+'%'};return _0x28ad2f;})});}_0x594c1c=_[_0xa140('0x40')]({},_0x594c1c,_0x5c9bbc[_0xa140('0x43')]);return _0x3cf69b[_0xa140('0x89')](_0x594c1c);}})[_0xa140('0x26')](function(_0x286dd5){if(_0x286dd5){_0x309116=_0x286dd5[_0xa140('0x38')];if(!_0x5c9bbc['query'][_0xa140('0x39')]('nolimit')){_0x594c1c[_0xa140('0x1f')]=qs[_0xa140('0x1f')](_0x5c9bbc[_0xa140('0x31')][_0xa140('0x1f')]);_0x594c1c['offset']=qs[_0xa140('0x1d')](_0x5c9bbc[_0xa140('0x31')]['offset']);}return _0x3cf69b[_0xa140('0x89')](_0x594c1c);}})[_0xa140('0x26')](function(_0x19ca05){if(_0x19ca05){return _0x19ca05?{'count':_0x309116,'rows':_0x19ca05}:null;}})['then'](respondWithResult(_0x3ed076,null))[_0xa140('0x46')](handleError(_0x3ed076,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 0547087..74e795c 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 _0x778d=['update','remove','emit','hasOwnProperty','hook','../../mysqldb','WhatsappQueue','setMaxListeners'];(function(_0x4fa9bb,_0x308b86){var _0x35b6fd=function(_0x54acff){while(--_0x54acff){_0x4fa9bb['push'](_0x4fa9bb['shift']());}};_0x35b6fd(++_0x308b86);}(_0x778d,0x8d));var _0xd778=function(_0x49a56f,_0x2d85f5){_0x49a56f=_0x49a56f-0x0;var _0x3e0a84=_0x778d[_0x49a56f];return _0x3e0a84;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0xd778('0x0'))['db'][_0xd778('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xd778('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd778('0x3'),'afterDestroy':_0xd778('0x4')};function emitEvent(_0x285231){return function(_0x4f52be,_0x3df5a1,_0x6f61e8){WhatsappQueueEvents[_0xd778('0x5')](_0x285231+':'+_0x4f52be['id'],_0x4f52be);WhatsappQueueEvents[_0xd778('0x5')](_0x285231,_0x4f52be);_0x6f61e8(null);};}for(var e in events){if(events[_0xd778('0x6')](e)){var event=events[e];WhatsappQueue[_0xd778('0x7')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file +var _0x0c37=['remove','emit','hasOwnProperty','hook','exports','events','WhatsappQueue','setMaxListeners','save','update'];(function(_0xae7aec,_0x517740){var _0x4c4915=function(_0x573924){while(--_0x573924){_0xae7aec['push'](_0xae7aec['shift']());}};_0x4c4915(++_0x517740);}(_0x0c37,0xeb));var _0x70c3=function(_0x373b3e,_0x347ac7){_0x373b3e=_0x373b3e-0x0;var _0xa4ce3=_0x0c37[_0x373b3e];return _0xa4ce3;};'use strict';var EventEmitter=require(_0x70c3('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0x70c3('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x70c3('0x2')](0x0);var events={'afterCreate':_0x70c3('0x3'),'afterUpdate':_0x70c3('0x4'),'afterDestroy':_0x70c3('0x5')};function emitEvent(_0x2d9979){return function(_0x3813b4,_0x11c9ac,_0x496313){WhatsappQueueEvents[_0x70c3('0x6')](_0x2d9979+':'+_0x3813b4['id'],_0x3813b4);WhatsappQueueEvents[_0x70c3('0x6')](_0x2d9979,_0x3813b4);_0x496313(null);};}for(var e in events){if(events[_0x70c3('0x7')](e)){var event=events[e];WhatsappQueue[_0x70c3('0x8')](e,emitEvent(event));}}module[_0x70c3('0x9')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index e27fa2b..732c184 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 _0x7089=['WhatsappQueue','whatsapp_queues','lodash','../../config/logger','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x515969,_0x2d54a4){var _0x5cc6a4=function(_0x4dd4ae){while(--_0x4dd4ae){_0x515969['push'](_0x515969['shift']());}};_0x5cc6a4(++_0x2d54a4);}(_0x7089,0x156));var _0x9708=function(_0x12dc7b,_0x4f9aa6){_0x12dc7b=_0x12dc7b-0x0;var _0x2fd3d9=_0x7089[_0x12dc7b];return _0x2fd3d9;};'use strict';var _=require(_0x9708('0x0'));var util=require('util');var logger=require(_0x9708('0x1'))('api');var moment=require('moment');var BPromise=require(_0x9708('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9708('0x3'));var rimraf=require(_0x9708('0x4'));var config=require(_0x9708('0x5'));var attributes=require('./whatsappQueue.attributes');module[_0x9708('0x6')]=function(_0x1de6da,_0x236805){return _0x1de6da[_0x9708('0x7')](_0x9708('0x8'),attributes,{'tableName':_0x9708('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfdb3=['path','rimraf','../../config/environment','exports','define','WhatsappQueue','whatsapp_queues','lodash','../../config/logger','api','bluebird'];(function(_0x311fc8,_0x38c9eb){var _0x371a71=function(_0x24314e){while(--_0x24314e){_0x311fc8['push'](_0x311fc8['shift']());}};_0x371a71(++_0x38c9eb);}(_0xfdb3,0x6a));var _0x3fdb=function(_0x10247d,_0x603ff5){_0x10247d=_0x10247d-0x0;var _0x249dd2=_0xfdb3[_0x10247d];return _0x249dd2;};'use strict';var _=require(_0x3fdb('0x0'));var util=require('util');var logger=require(_0x3fdb('0x1'))(_0x3fdb('0x2'));var moment=require('moment');var BPromise=require(_0x3fdb('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3fdb('0x4'));var rimraf=require(_0x3fdb('0x5'));var config=require(_0x3fdb('0x6'));var attributes=require('./whatsappQueue.attributes');module[_0x3fdb('0x7')]=function(_0x2d61e3,_0x339f53){return _0x2d61e3[_0x3fdb('0x8')](_0x3fdb('0x9'),attributes,{'tableName':_0x3fdb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js index 7793964..feabc14 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 _0x651e=['raw','where','attributes','limit','include','map','model','debug','stringify','find','ShowWhatsappQueue','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','request','then','WhatsappQueue,\x20%s,\x20%s','request\x20sent','WhatsappQueue,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','GetWhatsappQueue','WhatsappQueue','options'];(function(_0x3ffe90,_0x10b4df){var _0x3a7367=function(_0x51023b){while(--_0x51023b){_0x3ffe90['push'](_0x3ffe90['shift']());}};_0x3a7367(++_0x10b4df);}(_0x651e,0x1ec));var _0xe651=function(_0x54b061,_0xac4b37){_0x54b061=_0x54b061-0x0;var _0x55098c=_0x651e[_0x54b061];return _0x55098c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe651('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe651('0x1'));var db=require(_0xe651('0x2'))['db'];var utils=require(_0xe651('0x3'));var logger=require('../../config/logger')(_0xe651('0x4'));var config=require(_0xe651('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xe651('0x6')][_0xe651('0x7')]({'port':0x232a});config[_0xe651('0x8')]=_[_0xe651('0x9')](config[_0xe651('0x8')],{'host':_0xe651('0xa'),'port':0x18eb});var socket=require(_0xe651('0xb'))(new Redis(config[_0xe651('0x8')]));require(_0xe651('0xc'))['register'](socket);function respondWithRpcPromise(_0x3ec360,_0x2e3540,_0x5115fd){return new BPromise(function(_0x4ffd04,_0x94beb4){return client[_0xe651('0xd')](_0x3ec360,_0x5115fd)[_0xe651('0xe')](function(_0x3f2522){logger['info'](_0xe651('0xf'),_0x2e3540,_0xe651('0x10'));logger['debug'](_0xe651('0x11'),_0x2e3540,_0xe651('0x10'),JSON['stringify'](_0x3f2522));if(_0x3f2522['error']){if(_0x3f2522[_0xe651('0x12')]['code']===0x1f4){logger['error'](_0xe651('0xf'),_0x2e3540,_0x3f2522[_0xe651('0x12')]['message']);return _0x94beb4(_0x3f2522[_0xe651('0x12')][_0xe651('0x13')]);}logger[_0xe651('0x12')](_0xe651('0xf'),_0x2e3540,_0x3f2522[_0xe651('0x12')][_0xe651('0x13')]);return _0x4ffd04(_0x3f2522[_0xe651('0x12')][_0xe651('0x13')]);}else{logger[_0xe651('0x14')](_0xe651('0xf'),_0x2e3540,_0xe651('0x10'));_0x4ffd04(_0x3f2522[_0xe651('0x15')][_0xe651('0x13')]);}})[_0xe651('0x16')](function(_0x21ddb7){logger[_0xe651('0x12')](_0xe651('0xf'),_0x2e3540,_0x21ddb7);_0x94beb4(_0x21ddb7);});});}exports[_0xe651('0x17')]=function(_0x4ff5a0){var _0x38231b=this;return new Promise(function(_0x13dcd7,_0x414b3d){return db[_0xe651('0x18')]['findAll']({'raw':_0x4ff5a0[_0xe651('0x19')]?_0x4ff5a0['options'][_0xe651('0x1a')]===undefined?!![]:![]:!![],'where':_0x4ff5a0[_0xe651('0x19')]?_0x4ff5a0['options'][_0xe651('0x1b')]||null:null,'attributes':_0x4ff5a0[_0xe651('0x19')]?_0x4ff5a0['options'][_0xe651('0x1c')]||null:null,'limit':_0x4ff5a0[_0xe651('0x19')]?_0x4ff5a0[_0xe651('0x19')][_0xe651('0x1d')]||null:null,'include':_0x4ff5a0[_0xe651('0x19')]?_0x4ff5a0[_0xe651('0x19')][_0xe651('0x1e')]?_[_0xe651('0x1f')](_0x4ff5a0[_0xe651('0x19')]['include'],function(_0xb8f522){return{'model':db[_0xb8f522[_0xe651('0x20')]],'as':_0xb8f522['as'],'attributes':_0xb8f522[_0xe651('0x1c')],'include':_0xb8f522[_0xe651('0x1e')]?_[_0xe651('0x1f')](_0xb8f522[_0xe651('0x1e')],function(_0x510ad1){return{'model':db[_0x510ad1['model']],'as':_0x510ad1['as'],'attributes':_0x510ad1[_0xe651('0x1c')],'include':_0x510ad1['include']?_[_0xe651('0x1f')](_0x510ad1[_0xe651('0x1e')],function(_0x50440d){return{'model':db[_0x50440d[_0xe651('0x20')]],'as':_0x50440d['as'],'attributes':_0x50440d[_0xe651('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x18aa97){logger[_0xe651('0x14')](_0xe651('0x17'),_0x4ff5a0);logger[_0xe651('0x21')](_0xe651('0x17'),_0x4ff5a0,JSON[_0xe651('0x22')](_0x18aa97));_0x13dcd7(_0x18aa97);})[_0xe651('0x16')](function(_0x7f2587){logger[_0xe651('0x12')](_0xe651('0x17'),_0x7f2587[_0xe651('0x13')],_0x4ff5a0);_0x414b3d(_0x38231b[_0xe651('0x12')](0x1f4,_0x7f2587[_0xe651('0x13')]));});});};exports['ShowWhatsappQueue']=function(_0x2dfe77){var _0x1355ee=this;return new Promise(function(_0x9112aa,_0x115f93){return db['WhatsappQueue'][_0xe651('0x23')]({'raw':_0x2dfe77[_0xe651('0x19')]?_0x2dfe77[_0xe651('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x2dfe77[_0xe651('0x19')]?_0x2dfe77[_0xe651('0x19')][_0xe651('0x1b')]||null:null,'attributes':_0x2dfe77[_0xe651('0x19')]?_0x2dfe77['options'][_0xe651('0x1c')]||null:null,'include':_0x2dfe77['options']?_0x2dfe77[_0xe651('0x19')]['include']?_['map'](_0x2dfe77[_0xe651('0x19')][_0xe651('0x1e')],function(_0x368721){return{'model':db[_0x368721[_0xe651('0x20')]],'as':_0x368721['as'],'attributes':_0x368721[_0xe651('0x1c')],'include':_0x368721[_0xe651('0x1e')]?_['map'](_0x368721['include'],function(_0x13f4ee){return{'model':db[_0x13f4ee[_0xe651('0x20')]],'as':_0x13f4ee['as'],'attributes':_0x13f4ee[_0xe651('0x1c')],'include':_0x13f4ee[_0xe651('0x1e')]?_[_0xe651('0x1f')](_0x13f4ee[_0xe651('0x1e')],function(_0x19457){return{'model':db[_0x19457[_0xe651('0x20')]],'as':_0x19457['as'],'attributes':_0x19457[_0xe651('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe651('0xe')](function(_0x1cb44d){logger[_0xe651('0x14')](_0xe651('0x24'),_0x2dfe77);logger['debug'](_0xe651('0x24'),_0x2dfe77,JSON[_0xe651('0x22')](_0x1cb44d));_0x9112aa(_0x1cb44d);})[_0xe651('0x16')](function(_0x477e1d){logger[_0xe651('0x12')](_0xe651('0x24'),_0x477e1d[_0xe651('0x13')],_0x2dfe77);_0x115f93(_0x1355ee[_0xe651('0x12')](0x1f4,_0x477e1d[_0xe651('0x13')]));});});}; \ No newline at end of file +var _0x08a9=['request','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','WhatsappQueue','findAll','options','raw','where','attributes','map','include','model','then','GetWhatsappQueue','ShowWhatsappQueue','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register'];(function(_0x28c743,_0x1f6300){var _0x2aa122=function(_0x225279){while(--_0x225279){_0x28c743['push'](_0x28c743['shift']());}};_0x2aa122(++_0x1f6300);}(_0x08a9,0x1a8));var _0x908a=function(_0x22d423,_0x4ee083){_0x22d423=_0x22d423-0x0;var _0x1017ed=_0x08a9[_0x22d423];return _0x1017ed;};'use strict';var _=require(_0x908a('0x0'));var util=require(_0x908a('0x1'));var moment=require(_0x908a('0x2'));var BPromise=require(_0x908a('0x3'));var rs=require(_0x908a('0x4'));var fs=require('fs');var Redis=require(_0x908a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x908a('0x6'));var config=require(_0x908a('0x7'));var jayson=require(_0x908a('0x8'));var client=jayson[_0x908a('0x9')][_0x908a('0xa')]({'port':0x232a});config[_0x908a('0xb')]=_[_0x908a('0xc')](config[_0x908a('0xb')],{'host':_0x908a('0xd'),'port':0x18eb});var socket=require(_0x908a('0xe'))(new Redis(config[_0x908a('0xb')]));require('./whatsappQueue.socket')[_0x908a('0xf')](socket);function respondWithRpcPromise(_0x545000,_0x2a162f,_0x39b7a1){return new BPromise(function(_0x1b1b28,_0x2db39b){return client[_0x908a('0x10')](_0x545000,_0x39b7a1)['then'](function(_0x2e7cee){logger[_0x908a('0x11')](_0x908a('0x12'),_0x2a162f,_0x908a('0x13'));logger[_0x908a('0x14')](_0x908a('0x15'),_0x2a162f,_0x908a('0x13'),JSON[_0x908a('0x16')](_0x2e7cee));if(_0x2e7cee[_0x908a('0x17')]){if(_0x2e7cee[_0x908a('0x17')][_0x908a('0x18')]===0x1f4){logger[_0x908a('0x17')](_0x908a('0x12'),_0x2a162f,_0x2e7cee[_0x908a('0x17')][_0x908a('0x19')]);return _0x2db39b(_0x2e7cee['error'][_0x908a('0x19')]);}logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x2a162f,_0x2e7cee[_0x908a('0x17')][_0x908a('0x19')]);return _0x1b1b28(_0x2e7cee[_0x908a('0x17')]['message']);}else{logger[_0x908a('0x11')](_0x908a('0x12'),_0x2a162f,_0x908a('0x13'));_0x1b1b28(_0x2e7cee[_0x908a('0x1a')][_0x908a('0x19')]);}})[_0x908a('0x1b')](function(_0x4bd8d9){logger['error'](_0x908a('0x12'),_0x2a162f,_0x4bd8d9);_0x2db39b(_0x4bd8d9);});});}exports['GetWhatsappQueue']=function(_0x299c83){var _0x7fdff1=this;return new Promise(function(_0x340500,_0x4e1b20){return db[_0x908a('0x1c')][_0x908a('0x1d')]({'raw':_0x299c83[_0x908a('0x1e')]?_0x299c83[_0x908a('0x1e')][_0x908a('0x1f')]===undefined?!![]:![]:!![],'where':_0x299c83[_0x908a('0x1e')]?_0x299c83[_0x908a('0x1e')][_0x908a('0x20')]||null:null,'attributes':_0x299c83['options']?_0x299c83[_0x908a('0x1e')][_0x908a('0x21')]||null:null,'limit':_0x299c83[_0x908a('0x1e')]?_0x299c83['options']['limit']||null:null,'include':_0x299c83['options']?_0x299c83[_0x908a('0x1e')]['include']?_[_0x908a('0x22')](_0x299c83[_0x908a('0x1e')][_0x908a('0x23')],function(_0x5d7fd5){return{'model':db[_0x5d7fd5[_0x908a('0x24')]],'as':_0x5d7fd5['as'],'attributes':_0x5d7fd5[_0x908a('0x21')],'include':_0x5d7fd5[_0x908a('0x23')]?_[_0x908a('0x22')](_0x5d7fd5['include'],function(_0x5ebecc){return{'model':db[_0x5ebecc[_0x908a('0x24')]],'as':_0x5ebecc['as'],'attributes':_0x5ebecc[_0x908a('0x21')],'include':_0x5ebecc['include']?_['map'](_0x5ebecc[_0x908a('0x23')],function(_0x502c04){return{'model':db[_0x502c04['model']],'as':_0x502c04['as'],'attributes':_0x502c04[_0x908a('0x21')]};}):[]};}):[]};}):[]:[]})[_0x908a('0x25')](function(_0x44586c){logger[_0x908a('0x11')]('GetWhatsappQueue',_0x299c83);logger[_0x908a('0x14')](_0x908a('0x26'),_0x299c83,JSON[_0x908a('0x16')](_0x44586c));_0x340500(_0x44586c);})[_0x908a('0x1b')](function(_0x11369d){logger[_0x908a('0x17')](_0x908a('0x26'),_0x11369d[_0x908a('0x19')],_0x299c83);_0x4e1b20(_0x7fdff1['error'](0x1f4,_0x11369d[_0x908a('0x19')]));});});};exports['ShowWhatsappQueue']=function(_0x3783cd){var _0x280f46=this;return new Promise(function(_0x4a17e5,_0x19501e){return db['WhatsappQueue']['find']({'raw':_0x3783cd[_0x908a('0x1e')]?_0x3783cd[_0x908a('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x3783cd['options']?_0x3783cd[_0x908a('0x1e')][_0x908a('0x20')]||null:null,'attributes':_0x3783cd[_0x908a('0x1e')]?_0x3783cd[_0x908a('0x1e')][_0x908a('0x21')]||null:null,'include':_0x3783cd[_0x908a('0x1e')]?_0x3783cd[_0x908a('0x1e')][_0x908a('0x23')]?_[_0x908a('0x22')](_0x3783cd['options'][_0x908a('0x23')],function(_0x3d9766){return{'model':db[_0x3d9766['model']],'as':_0x3d9766['as'],'attributes':_0x3d9766[_0x908a('0x21')],'include':_0x3d9766[_0x908a('0x23')]?_[_0x908a('0x22')](_0x3d9766['include'],function(_0x41620c){return{'model':db[_0x41620c['model']],'as':_0x41620c['as'],'attributes':_0x41620c[_0x908a('0x21')],'include':_0x41620c['include']?_['map'](_0x41620c[_0x908a('0x23')],function(_0x3e2be9){return{'model':db[_0x3e2be9[_0x908a('0x24')]],'as':_0x3e2be9['as'],'attributes':_0x3e2be9[_0x908a('0x21')]};}):[]};}):[]};}):[]:[]})[_0x908a('0x25')](function(_0x5921c0){logger['info']('ShowWhatsappQueue',_0x3783cd);logger[_0x908a('0x14')](_0x908a('0x27'),_0x3783cd,JSON[_0x908a('0x16')](_0x5921c0));_0x4a17e5(_0x5921c0);})[_0x908a('0x1b')](function(_0x18b905){logger[_0x908a('0x17')]('ShowWhatsappQueue',_0x18b905[_0x908a('0x19')],_0x3783cd);_0x19501e(_0x280f46[_0x908a('0x17')](0x1f4,_0x18b905[_0x908a('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 168a1e8..29e1d96 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 _0x3e9b=['whatsappQueue:','./whatsappQueue.events','remove','emit','removeListener','length'];(function(_0x2ab76b,_0x176579){var _0x201126=function(_0x11d8c8){while(--_0x11d8c8){_0x2ab76b['push'](_0x2ab76b['shift']());}};_0x201126(++_0x176579);}(_0x3e9b,0x85));var _0xb3e9=function(_0x5c9453,_0x1f81f6){_0x5c9453=_0x5c9453-0x0;var _0xa43bb3=_0x3e9b[_0x5c9453];return _0xa43bb3;};'use strict';var WhatsappQueueEvents=require(_0xb3e9('0x0'));var events=['save',_0xb3e9('0x1'),'update'];function createListener(_0x1c37e0,_0x4e7349){return function(_0x7bc9a9){_0x4e7349[_0xb3e9('0x2')](_0x1c37e0,_0x7bc9a9);};}function removeListener(_0x15d08b,_0x4f443a){return function(){WhatsappQueueEvents[_0xb3e9('0x3')](_0x15d08b,_0x4f443a);};}exports['register']=function(_0x43957f){for(var _0x4b463d=0x0,_0xf0d486=events[_0xb3e9('0x4')];_0x4b463d<_0xf0d486;_0x4b463d++){var _0x2fd6cb=events[_0x4b463d];var _0x48936f=createListener(_0xb3e9('0x5')+_0x2fd6cb,_0x43957f);WhatsappQueueEvents['on'](_0x2fd6cb,_0x48936f);}}; \ No newline at end of file +var _0xa56e=['update','emit','remove'];(function(_0x5b8429,_0x184a91){var _0x588111=function(_0x4ef81a){while(--_0x4ef81a){_0x5b8429['push'](_0x5b8429['shift']());}};_0x588111(++_0x184a91);}(_0xa56e,0xda));var _0xea56=function(_0x5b96f6,_0x26fe54){_0x5b96f6=_0x5b96f6-0x0;var _0xe67cd8=_0xa56e[_0x5b96f6];return _0xe67cd8;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=['save',_0xea56('0x0'),_0xea56('0x1')];function createListener(_0x36afce,_0x2b5519){return function(_0x930236){_0x2b5519[_0xea56('0x2')](_0x36afce,_0x930236);};}function removeListener(_0x2a8b3f,_0x2f3fd1){return function(){WhatsappQueueEvents['removeListener'](_0x2a8b3f,_0x2f3fd1);};}exports['register']=function(_0x4d7e71){for(var _0x5474b5=0x0,_0x1b9a00=events['length'];_0x5474b5<_0x1b9a00;_0x5474b5++){var _0x46a494=events[_0x5474b5];var _0x52ab3e=createListener('whatsappQueue:'+_0x46a494,_0x4d7e71);WhatsappQueueEvents['on'](_0x46a494,_0x52ab3e);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 9de2ec7..d187330 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 _0x43df=['../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','index','describe','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x1f250f,_0x2a3926){var _0x5766ac=function(_0x52f541){while(--_0x52f541){_0x1f250f['push'](_0x1f250f['shift']());}};_0x5766ac(++_0x2a3926);}(_0x43df,0x6d));var _0xf43d=function(_0x291b31,_0x5722fc){_0x291b31=_0x291b31-0x0;var _0x4b8dda=_0x43df[_0x291b31];return _0x4b8dda;};'use strict';var multer=require(_0xf43d('0x0'));var util=require(_0xf43d('0x1'));var path=require(_0xf43d('0x2'));var timeout=require(_0xf43d('0x3'));var express=require(_0xf43d('0x4'));var router=express[_0xf43d('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf43d('0x6'));var interaction=require(_0xf43d('0x7'));var config=require(_0xf43d('0x8'));var controller=require(_0xf43d('0x9'));router[_0xf43d('0xa')]('/',auth['isAuthenticated'](),controller[_0xf43d('0xb')]);router[_0xf43d('0xa')]('/describe',auth['isAuthenticated'](),controller[_0xf43d('0xc')]);router[_0xf43d('0xa')](_0xf43d('0xd'),auth[_0xf43d('0xe')](),controller[_0xf43d('0xf')]);router[_0xf43d('0x10')]('/',auth[_0xf43d('0xe')](),controller[_0xf43d('0x11')]);router[_0xf43d('0x12')](_0xf43d('0xd'),auth[_0xf43d('0xe')](),controller[_0xf43d('0x13')]);router[_0xf43d('0x14')](_0xf43d('0xd'),auth[_0xf43d('0xe')](),controller[_0xf43d('0x15')]);module[_0xf43d('0x16')]=router; \ No newline at end of file +var _0x945c=['destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappQueueReport.controller','get','isAuthenticated','index','/:id','show','post','create','update'];(function(_0x1a0ef3,_0x535bbf){var _0x2b86da=function(_0x5d30f9){while(--_0x5d30f9){_0x1a0ef3['push'](_0x1a0ef3['shift']());}};_0x2b86da(++_0x535bbf);}(_0x945c,0x16a));var _0xc945=function(_0x23e5fd,_0x2c6da6){_0x23e5fd=_0x23e5fd-0x0;var _0xab592b=_0x945c[_0x23e5fd];return _0xab592b;};'use strict';var multer=require(_0xc945('0x0'));var util=require(_0xc945('0x1'));var path=require(_0xc945('0x2'));var timeout=require(_0xc945('0x3'));var express=require(_0xc945('0x4'));var router=express[_0xc945('0x5')]();var fs_extra=require(_0xc945('0x6'));var auth=require(_0xc945('0x7'));var interaction=require(_0xc945('0x8'));var config=require('../../config/environment');var controller=require(_0xc945('0x9'));router[_0xc945('0xa')]('/',auth[_0xc945('0xb')](),controller[_0xc945('0xc')]);router[_0xc945('0xa')]('/describe',auth[_0xc945('0xb')](),controller['describe']);router['get'](_0xc945('0xd'),auth[_0xc945('0xb')](),controller[_0xc945('0xe')]);router[_0xc945('0xf')]('/',auth[_0xc945('0xb')](),controller[_0xc945('0x10')]);router['put']('/:id',auth[_0xc945('0xb')](),controller[_0xc945('0x11')]);router['delete'](_0xc945('0xd'),auth[_0xc945('0xb')](),controller[_0xc945('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index a09e711..645f262 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x2cb17a,_0x5b88e5){var _0x27dbaf=function(_0x42a0f6){while(--_0x42a0f6){_0x2cb17a['push'](_0x2cb17a['shift']());}};_0x27dbaf(++_0x5b88e5);}(_0x7a54,0x106));var _0x47a5=function(_0x44c6f3,_0x222063){_0x44c6f3=_0x44c6f3-0x0;var _0x15c587=_0x7a54[_0x44c6f3];return _0x15c587;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file +var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x442feb,_0x16779c){var _0x3d1c70=function(_0x8659a1){while(--_0x8659a1){_0x442feb['push'](_0x442feb['shift']());}};_0x3d1c70(++_0x16779c);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index a4b44b4..8f1d20e 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 _0x2032=['body','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','WhatsappQueueReport','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','rows','show','params','keys','rawAttributes','includeAll','find','catch'];(function(_0x32b4aa,_0x12eba6){var _0x473160=function(_0x4906b6){while(--_0x4906b6){_0x32b4aa['push'](_0x32b4aa['shift']());}};_0x473160(++_0x12eba6);}(_0x2032,0xd9));var _0x2203=function(_0x351710,_0x4d4fe5){_0x351710=_0x351710-0x0;var _0x3f099b=_0x2032[_0x351710];return _0x3f099b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];function respondWithStatusCode(_0x4b9376,_0x583bc7){_0x583bc7=_0x583bc7||0xcc;return function(_0x585c76){if(_0x585c76){return _0x4b9376['sendStatus'](_0x583bc7);}return _0x4b9376['status'](_0x583bc7)[_0x2203('0x18')]();};}function respondWithResult(_0x538b30,_0x592e47){_0x592e47=_0x592e47||0xc8;return function(_0x21a3af){if(_0x21a3af){return _0x538b30[_0x2203('0x19')](_0x592e47)[_0x2203('0x1a')](_0x21a3af);}};}function respondWithFilteredResult(_0x41af85,_0x226209){return function(_0x3fe0a8){if(_0x3fe0a8){var _0x2c36e6=typeof _0x226209[_0x2203('0x1b')]===_0x2203('0x1c')&&typeof _0x226209[_0x2203('0x1d')]==='undefined';var _0x280eda=_0x3fe0a8[_0x2203('0x1e')];var _0x4893ff=_0x2c36e6?0x0:_0x226209[_0x2203('0x1b')];var _0x8906e1=_0x2c36e6?_0x3fe0a8['count']:_0x226209[_0x2203('0x1b')]+_0x226209['limit'];var _0x2904ba;if(_0x8906e1>=_0x280eda){_0x8906e1=_0x280eda;_0x2904ba=0xc8;}else{_0x2904ba=0xce;}_0x41af85[_0x2203('0x19')](_0x2904ba);return _0x41af85[_0x2203('0x1f')](_0x2203('0x20'),_0x4893ff+'-'+_0x8906e1+'/'+_0x280eda)[_0x2203('0x1a')](_0x3fe0a8);}return null;};}function patchUpdates(_0x449039){return function(_0x538c23){try{jsonpatch[_0x2203('0x21')](_0x538c23,_0x449039,!![]);}catch(_0x50822b){return BPromise['reject'](_0x50822b);}return _0x538c23[_0x2203('0x22')]();};}function saveUpdates(_0x496d82,_0x3b8ef9){return function(_0x5bfe61){if(_0x5bfe61){return _0x5bfe61['update'](_0x496d82)[_0x2203('0x23')](function(_0x5e29cd){return _0x5e29cd;});}return null;};}function removeEntity(_0x5c8da9,_0x226374){return function(_0x2718f5){if(_0x2718f5){return _0x2718f5[_0x2203('0x24')]()[_0x2203('0x23')](function(){_0x5c8da9[_0x2203('0x19')](0xcc)[_0x2203('0x18')]();});}};}function handleEntityNotFound(_0x49c12,_0x250349){return function(_0x576378){if(!_0x576378){_0x49c12[_0x2203('0x25')](0x194);}return _0x576378;};}function handleError(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0x1f4;return function(_0x5f11bf){logger[_0x2203('0x26')](_0x5f11bf[_0x2203('0x27')]);if(_0x5f11bf['name']){delete _0x5f11bf[_0x2203('0x28')];}_0x36b958[_0x2203('0x19')](_0x39a11a)[_0x2203('0x29')](_0x5f11bf);};}exports[_0x2203('0x2a')]=function(_0x28ae02,_0x1df508){var _0x9c53f={},_0x5a95c1={},_0x34b8ba={'count':0x0,'rows':[]};var _0x616ed8=_[_0x2203('0x2b')](db[_0x2203('0x2c')]['rawAttributes'],function(_0x3a8e23){return{'name':_0x3a8e23[_0x2203('0x2d')],'type':_0x3a8e23[_0x2203('0x2e')][_0x2203('0x2f')]};});_0x5a95c1['model']=_[_0x2203('0x2b')](_0x616ed8,_0x2203('0x28'));_0x5a95c1['query']=_['keys'](_0x28ae02[_0x2203('0x30')]);_0x5a95c1['filters']=_['intersection'](_0x5a95c1[_0x2203('0x31')],_0x5a95c1[_0x2203('0x30')]);_0x9c53f[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5a95c1[_0x2203('0x31')],qs['fields'](_0x28ae02[_0x2203('0x30')][_0x2203('0x34')]));_0x9c53f['attributes']=_0x9c53f[_0x2203('0x32')][_0x2203('0x35')]?_0x9c53f[_0x2203('0x32')]:_0x5a95c1[_0x2203('0x31')];if(!_0x28ae02[_0x2203('0x30')][_0x2203('0x36')](_0x2203('0x37'))){_0x9c53f[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x28ae02['query'][_0x2203('0x1d')]);_0x9c53f[_0x2203('0x1b')]=qs['offset'](_0x28ae02['query'][_0x2203('0x1b')]);}_0x9c53f['order']=qs[_0x2203('0x38')](_0x28ae02[_0x2203('0x30')][_0x2203('0x38')]);_0x9c53f['where']=qs['filters'](_[_0x2203('0x39')](_0x28ae02['query'],_0x5a95c1[_0x2203('0x3a')]),_0x616ed8);if(_0x28ae02['query'][_0x2203('0x3b')]){_0x9c53f['where']=_[_0x2203('0x3c')](_0x9c53f[_0x2203('0x3d')],{'$or':_[_0x2203('0x2b')](_0x616ed8,function(_0x40a793){if(_0x40a793[_0x2203('0x2e')]!=='VIRTUAL'){var _0x5f1561={};_0x5f1561[_0x40a793['name']]={'$like':'%'+_0x28ae02[_0x2203('0x30')][_0x2203('0x3b')]+'%'};return _0x5f1561;}})});}_0x9c53f=_[_0x2203('0x3c')]({},_0x9c53f,_0x28ae02[_0x2203('0x3e')]);var _0x3283fb={'where':_0x9c53f[_0x2203('0x3d')]};return db[_0x2203('0x2c')]['count'](_0x3283fb)[_0x2203('0x23')](function(_0x1b12c3){_0x34b8ba[_0x2203('0x1e')]=_0x1b12c3;if(_0x28ae02[_0x2203('0x30')]['includeAll']){_0x9c53f['include']=[{'all':!![]}];}return db[_0x2203('0x2c')]['findAll'](_0x9c53f);})[_0x2203('0x23')](function(_0x446209){_0x34b8ba[_0x2203('0x3f')]=_0x446209;return _0x34b8ba;})['then'](respondWithFilteredResult(_0x1df508,_0x9c53f))['catch'](handleError(_0x1df508,null));};exports[_0x2203('0x40')]=function(_0x3739f6,_0x368444){var _0x1e09f3={'raw':!![],'where':{'id':_0x3739f6[_0x2203('0x41')]['id']}},_0x372709={};_0x372709['model']=_[_0x2203('0x42')](db[_0x2203('0x2c')][_0x2203('0x43')]);_0x372709[_0x2203('0x30')]=_[_0x2203('0x42')](_0x3739f6[_0x2203('0x30')]);_0x372709[_0x2203('0x3a')]=_[_0x2203('0x33')](_0x372709[_0x2203('0x31')],_0x372709[_0x2203('0x30')]);_0x1e09f3['attributes']=_[_0x2203('0x33')](_0x372709[_0x2203('0x31')],qs[_0x2203('0x34')](_0x3739f6[_0x2203('0x30')]['fields']));_0x1e09f3['attributes']=_0x1e09f3[_0x2203('0x32')]['length']?_0x1e09f3[_0x2203('0x32')]:_0x372709[_0x2203('0x31')];if(_0x3739f6[_0x2203('0x30')][_0x2203('0x44')]){_0x1e09f3['include']=[{'all':!![]}];}_0x1e09f3=_[_0x2203('0x3c')]({},_0x1e09f3,_0x3739f6[_0x2203('0x3e')]);return db['WhatsappQueueReport'][_0x2203('0x45')](_0x1e09f3)[_0x2203('0x23')](handleEntityNotFound(_0x368444,null))[_0x2203('0x23')](respondWithResult(_0x368444,null))[_0x2203('0x46')](handleError(_0x368444,null));};exports['create']=function(_0x4c1a29,_0x21b8ab){return db['WhatsappQueueReport']['create'](_0x4c1a29[_0x2203('0x47')],{})[_0x2203('0x23')](respondWithResult(_0x21b8ab,0xc9))[_0x2203('0x46')](handleError(_0x21b8ab,null));};exports['update']=function(_0x4c1496,_0x131aec){if(_0x4c1496[_0x2203('0x47')]['id']){delete _0x4c1496[_0x2203('0x47')]['id'];}return db[_0x2203('0x2c')][_0x2203('0x45')]({'where':{'id':_0x4c1496[_0x2203('0x41')]['id']}})['then'](handleEntityNotFound(_0x131aec,null))[_0x2203('0x23')](saveUpdates(_0x4c1496['body'],null))[_0x2203('0x23')](respondWithResult(_0x131aec,null))[_0x2203('0x46')](handleError(_0x131aec,null));};exports[_0x2203('0x24')]=function(_0x1e49dd,_0x58b9bb){return db['WhatsappQueueReport'][_0x2203('0x45')]({'where':{'id':_0x1e49dd[_0x2203('0x41')]['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x58b9bb,null))[_0x2203('0x23')](removeEntity(_0x58b9bb,null))['catch'](handleError(_0x58b9bb,null));};exports['describe']=function(_0x49999a,_0x4064d5){return db[_0x2203('0x2c')]['describe']()[_0x2203('0x23')](respondWithResult(_0x4064d5,null))[_0x2203('0x46')](handleError(_0x4064d5,null));}; \ No newline at end of file +var _0x14a0=['mustache','sox','to-csv','ejs','squel','crypto','jsforce','querystring','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','destroy','then','stack','name','send','index','map','WhatsappQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x14a0,0x8e));var _0x014a=function(_0x204e38,_0x2b5ab8){_0x204e38=_0x204e38-0x0;var _0x1b15a1=_0x14a0[_0x204e38];return _0x1b15a1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x014a('0x0'));var zipdir=require(_0x014a('0x1'));var jsonpatch=require(_0x014a('0x2'));var rp=require(_0x014a('0x3'));var moment=require(_0x014a('0x4'));var BPromise=require(_0x014a('0x5'));var Mustache=require(_0x014a('0x6'));var util=require('util');var path=require('path');var sox=require(_0x014a('0x7'));var csv=require(_0x014a('0x8'));var ejs=require(_0x014a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x014a('0xa'));var crypto=require(_0x014a('0xb'));var jsforce=require(_0x014a('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x014a('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x014a('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x014a('0xf'))(_0x014a('0x10'));var utils=require('../../config/utils');var config=require(_0x014a('0x11'));var licenseUtil=require(_0x014a('0x12'));var db=require(_0x014a('0x13'))['db'];function respondWithStatusCode(_0x43bfeb,_0x1bcd1){_0x1bcd1=_0x1bcd1||0xcc;return function(_0x20cb56){if(_0x20cb56){return _0x43bfeb[_0x014a('0x14')](_0x1bcd1);}return _0x43bfeb[_0x014a('0x15')](_0x1bcd1)[_0x014a('0x16')]();};}function respondWithResult(_0x71535d,_0x45cd80){_0x45cd80=_0x45cd80||0xc8;return function(_0x3c54c8){if(_0x3c54c8){return _0x71535d['status'](_0x45cd80)[_0x014a('0x17')](_0x3c54c8);}};}function respondWithFilteredResult(_0x3cf92f,_0x59f207){return function(_0x3a836f){if(_0x3a836f){var _0x128c46=typeof _0x59f207['offset']===_0x014a('0x18')&&typeof _0x59f207[_0x014a('0x19')]===_0x014a('0x18');var _0x12da95=_0x3a836f[_0x014a('0x1a')];var _0x12d339=_0x128c46?0x0:_0x59f207[_0x014a('0x1b')];var _0x263b07=_0x128c46?_0x3a836f[_0x014a('0x1a')]:_0x59f207[_0x014a('0x1b')]+_0x59f207[_0x014a('0x19')];var _0x89e132;if(_0x263b07>=_0x12da95){_0x263b07=_0x12da95;_0x89e132=0xc8;}else{_0x89e132=0xce;}_0x3cf92f[_0x014a('0x15')](_0x89e132);return _0x3cf92f[_0x014a('0x1c')]('Content-Range',_0x12d339+'-'+_0x263b07+'/'+_0x12da95)[_0x014a('0x17')](_0x3a836f);}return null;};}function patchUpdates(_0x109a9c){return function(_0x11065f){try{jsonpatch[_0x014a('0x1d')](_0x11065f,_0x109a9c,!![]);}catch(_0xc9a563){return BPromise[_0x014a('0x1e')](_0xc9a563);}return _0x11065f[_0x014a('0x1f')]();};}function saveUpdates(_0x3dd2d0,_0x290b86){return function(_0x486e66){if(_0x486e66){return _0x486e66[_0x014a('0x20')](_0x3dd2d0)['then'](function(_0x1a1318){return _0x1a1318;});}return null;};}function removeEntity(_0x26718b,_0x44d921){return function(_0x36d52b){if(_0x36d52b){return _0x36d52b[_0x014a('0x21')]()[_0x014a('0x22')](function(){_0x26718b[_0x014a('0x15')](0xcc)[_0x014a('0x16')]();});}};}function handleEntityNotFound(_0x165a42,_0x4c2627){return function(_0x3b4b92){if(!_0x3b4b92){_0x165a42['sendStatus'](0x194);}return _0x3b4b92;};}function handleError(_0x39a432,_0x28701e){_0x28701e=_0x28701e||0x1f4;return function(_0x4f1c44){logger['error'](_0x4f1c44[_0x014a('0x23')]);if(_0x4f1c44[_0x014a('0x24')]){delete _0x4f1c44[_0x014a('0x24')];}_0x39a432['status'](_0x28701e)[_0x014a('0x25')](_0x4f1c44);};}exports[_0x014a('0x26')]=function(_0x598179,_0x31dc95){var _0x2560a6={},_0x496040={},_0x4f9c1c={'count':0x0,'rows':[]};var _0x397850=_[_0x014a('0x27')](db[_0x014a('0x28')][_0x014a('0x29')],function(_0x4ea00c){return{'name':_0x4ea00c[_0x014a('0x2a')],'type':_0x4ea00c[_0x014a('0x2b')][_0x014a('0x2c')]};});_0x496040[_0x014a('0x2d')]=_[_0x014a('0x27')](_0x397850,_0x014a('0x24'));_0x496040[_0x014a('0x2e')]=_[_0x014a('0x2f')](_0x598179[_0x014a('0x2e')]);_0x496040[_0x014a('0x30')]=_[_0x014a('0x31')](_0x496040['model'],_0x496040[_0x014a('0x2e')]);_0x2560a6[_0x014a('0x32')]=_[_0x014a('0x31')](_0x496040[_0x014a('0x2d')],qs[_0x014a('0x33')](_0x598179[_0x014a('0x2e')][_0x014a('0x33')]));_0x2560a6['attributes']=_0x2560a6[_0x014a('0x32')][_0x014a('0x34')]?_0x2560a6['attributes']:_0x496040[_0x014a('0x2d')];if(!_0x598179[_0x014a('0x2e')][_0x014a('0x35')](_0x014a('0x36'))){_0x2560a6[_0x014a('0x19')]=qs[_0x014a('0x19')](_0x598179[_0x014a('0x2e')][_0x014a('0x19')]);_0x2560a6['offset']=qs[_0x014a('0x1b')](_0x598179[_0x014a('0x2e')][_0x014a('0x1b')]);}_0x2560a6[_0x014a('0x37')]=qs['sort'](_0x598179[_0x014a('0x2e')][_0x014a('0x38')]);_0x2560a6[_0x014a('0x39')]=qs[_0x014a('0x30')](_[_0x014a('0x3a')](_0x598179[_0x014a('0x2e')],_0x496040[_0x014a('0x30')]),_0x397850);if(_0x598179[_0x014a('0x2e')][_0x014a('0x3b')]){_0x2560a6['where']=_[_0x014a('0x3c')](_0x2560a6['where'],{'$or':_[_0x014a('0x27')](_0x397850,function(_0xc11492){if(_0xc11492[_0x014a('0x2b')]!==_0x014a('0x3d')){var _0x43376c={};_0x43376c[_0xc11492['name']]={'$like':'%'+_0x598179[_0x014a('0x2e')][_0x014a('0x3b')]+'%'};return _0x43376c;}})});}_0x2560a6=_['merge']({},_0x2560a6,_0x598179[_0x014a('0x3e')]);var _0x2990df={'where':_0x2560a6[_0x014a('0x39')]};return db[_0x014a('0x28')][_0x014a('0x1a')](_0x2990df)[_0x014a('0x22')](function(_0x17b1b6){_0x4f9c1c[_0x014a('0x1a')]=_0x17b1b6;if(_0x598179[_0x014a('0x2e')]['includeAll']){_0x2560a6[_0x014a('0x3f')]=[{'all':!![]}];}return db[_0x014a('0x28')][_0x014a('0x40')](_0x2560a6);})[_0x014a('0x22')](function(_0x5f1a91){_0x4f9c1c[_0x014a('0x41')]=_0x5f1a91;return _0x4f9c1c;})[_0x014a('0x22')](respondWithFilteredResult(_0x31dc95,_0x2560a6))[_0x014a('0x42')](handleError(_0x31dc95,null));};exports[_0x014a('0x43')]=function(_0x1dc647,_0x430a56){var _0x5f2969={'raw':!![],'where':{'id':_0x1dc647[_0x014a('0x44')]['id']}},_0x361866={};_0x361866['model']=_[_0x014a('0x2f')](db[_0x014a('0x28')][_0x014a('0x29')]);_0x361866['query']=_[_0x014a('0x2f')](_0x1dc647['query']);_0x361866['filters']=_[_0x014a('0x31')](_0x361866[_0x014a('0x2d')],_0x361866['query']);_0x5f2969[_0x014a('0x32')]=_[_0x014a('0x31')](_0x361866[_0x014a('0x2d')],qs[_0x014a('0x33')](_0x1dc647[_0x014a('0x2e')][_0x014a('0x33')]));_0x5f2969['attributes']=_0x5f2969[_0x014a('0x32')][_0x014a('0x34')]?_0x5f2969[_0x014a('0x32')]:_0x361866['model'];if(_0x1dc647['query'][_0x014a('0x45')]){_0x5f2969['include']=[{'all':!![]}];}_0x5f2969=_['merge']({},_0x5f2969,_0x1dc647[_0x014a('0x3e')]);return db['WhatsappQueueReport'][_0x014a('0x46')](_0x5f2969)[_0x014a('0x22')](handleEntityNotFound(_0x430a56,null))[_0x014a('0x22')](respondWithResult(_0x430a56,null))['catch'](handleError(_0x430a56,null));};exports[_0x014a('0x47')]=function(_0x23be18,_0x12cd9b){return db[_0x014a('0x28')][_0x014a('0x47')](_0x23be18[_0x014a('0x48')],{})['then'](respondWithResult(_0x12cd9b,0xc9))[_0x014a('0x42')](handleError(_0x12cd9b,null));};exports[_0x014a('0x20')]=function(_0x5a861c,_0x1a4df9){if(_0x5a861c[_0x014a('0x48')]['id']){delete _0x5a861c[_0x014a('0x48')]['id'];}return db[_0x014a('0x28')][_0x014a('0x46')]({'where':{'id':_0x5a861c[_0x014a('0x44')]['id']}})[_0x014a('0x22')](handleEntityNotFound(_0x1a4df9,null))[_0x014a('0x22')](saveUpdates(_0x5a861c['body'],null))[_0x014a('0x22')](respondWithResult(_0x1a4df9,null))[_0x014a('0x42')](handleError(_0x1a4df9,null));};exports[_0x014a('0x21')]=function(_0x135e7e,_0x312c7a){return db['WhatsappQueueReport'][_0x014a('0x46')]({'where':{'id':_0x135e7e['params']['id']}})[_0x014a('0x22')](handleEntityNotFound(_0x312c7a,null))[_0x014a('0x22')](removeEntity(_0x312c7a,null))[_0x014a('0x42')](handleError(_0x312c7a,null));};exports[_0x014a('0x49')]=function(_0x3caa6e,_0x4f8547){return db['WhatsappQueueReport']['describe']()['then'](respondWithResult(_0x4f8547,null))[_0x014a('0x42')](handleError(_0x4f8547,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 9db6981..f423a9c 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 _0x67cc=['WhatsappQueueReport','report_whatsapp_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./whatsappQueueReport.attributes','exports'];(function(_0x5d5981,_0x2561e8){var _0x71af89=function(_0x2a8e37){while(--_0x2a8e37){_0x5d5981['push'](_0x5d5981['shift']());}};_0x71af89(++_0x2561e8);}(_0x67cc,0x6b));var _0xc67c=function(_0x380168,_0x40546c){_0x380168=_0x380168-0x0;var _0x12e86d=_0x67cc[_0x380168];return _0x12e86d;};'use strict';var _=require('lodash');var util=require(_0xc67c('0x0'));var logger=require(_0xc67c('0x1'))(_0xc67c('0x2'));var moment=require(_0xc67c('0x3'));var BPromise=require(_0xc67c('0x4'));var rp=require(_0xc67c('0x5'));var fs=require('fs');var path=require(_0xc67c('0x6'));var rimraf=require('rimraf');var config=require(_0xc67c('0x7'));var attributes=require(_0xc67c('0x8'));module[_0xc67c('0x9')]=function(_0x29500d,_0x338a51){return _0x29500d['define'](_0xc67c('0xa'),attributes,{'tableName':_0xc67c('0xb'),'paranoid':![],'indexes':[{'name':_0xc67c('0xc'),'fields':[_0xc67c('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xece3=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','WhatsappQueueReport','report_whatsapp_queue'];(function(_0x30b3fa,_0x244b65){var _0x11d163=function(_0x41d15c){while(--_0x41d15c){_0x30b3fa['push'](_0x30b3fa['shift']());}};_0x11d163(++_0x244b65);}(_0xece3,0x139));var _0x3ece=function(_0x53c2b9,_0x1dbc82){_0x53c2b9=_0x53c2b9-0x0;var _0x2c677b=_0xece3[_0x53c2b9];return _0x2c677b;};'use strict';var _=require(_0x3ece('0x0'));var util=require(_0x3ece('0x1'));var logger=require(_0x3ece('0x2'))(_0x3ece('0x3'));var moment=require(_0x3ece('0x4'));var BPromise=require(_0x3ece('0x5'));var rp=require(_0x3ece('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3ece('0x7'));var config=require(_0x3ece('0x8'));var attributes=require('./whatsappQueueReport.attributes');module[_0x3ece('0x9')]=function(_0x276a85,_0xdfff2b){return _0x276a85['define'](_0x3ece('0xa'),attributes,{'tableName':_0x3ece('0xb'),'paranoid':![],'indexes':[{'name':_0x3ece('0xc'),'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 e9d3b50..c9265db 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 _0x3feb=['raw','CreateWhatsappQueueReport','attributes','limit','UpdateWhatsappQueueReport','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','WhatsappQueueReport','create','body','options'];(function(_0x313c59,_0x23e3d1){var _0x2886af=function(_0x223c44){while(--_0x223c44){_0x313c59['push'](_0x313c59['shift']());}};_0x2886af(++_0x23e3d1);}(_0x3feb,0x192));var _0xb3fe=function(_0x183374,_0x1851aa){_0x183374=_0x183374-0x0;var _0x2f19c5=_0x3feb[_0x183374];return _0x2f19c5;};'use strict';var _=require(_0xb3fe('0x0'));var util=require(_0xb3fe('0x1'));var moment=require(_0xb3fe('0x2'));var BPromise=require(_0xb3fe('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb3fe('0x4'));var db=require(_0xb3fe('0x5'))['db'];var utils=require(_0xb3fe('0x6'));var logger=require('../../config/logger')(_0xb3fe('0x7'));var config=require(_0xb3fe('0x8'));var jayson=require(_0xb3fe('0x9'));var client=jayson[_0xb3fe('0xa')][_0xb3fe('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e3850,_0x328809,_0x5d9f7c){return new BPromise(function(_0x2e209d,_0x2426c8){return client[_0xb3fe('0xc')](_0x4e3850,_0x5d9f7c)['then'](function(_0x3364b7){logger[_0xb3fe('0xd')](_0xb3fe('0xe'),_0x328809,_0xb3fe('0xf'));logger[_0xb3fe('0x10')](_0xb3fe('0x11'),_0x328809,_0xb3fe('0xf'),JSON[_0xb3fe('0x12')](_0x3364b7));if(_0x3364b7[_0xb3fe('0x13')]){if(_0x3364b7[_0xb3fe('0x13')][_0xb3fe('0x14')]===0x1f4){logger[_0xb3fe('0x13')](_0xb3fe('0xe'),_0x328809,_0x3364b7[_0xb3fe('0x13')][_0xb3fe('0x15')]);return _0x2426c8(_0x3364b7[_0xb3fe('0x13')][_0xb3fe('0x15')]);}logger['error'](_0xb3fe('0xe'),_0x328809,_0x3364b7[_0xb3fe('0x13')][_0xb3fe('0x15')]);return _0x2e209d(_0x3364b7['error'][_0xb3fe('0x15')]);}else{logger[_0xb3fe('0xd')](_0xb3fe('0xe'),_0x328809,'request\x20sent');_0x2e209d(_0x3364b7[_0xb3fe('0x16')]['message']);}})['catch'](function(_0x41420e){logger[_0xb3fe('0x13')](_0xb3fe('0xe'),_0x328809,_0x41420e);_0x2426c8(_0x41420e);});});}exports['CreateWhatsappQueueReport']=function(_0x490e45){var _0x40d40f=this;return new Promise(function(_0x4cbc2b,_0x50b721){return db[_0xb3fe('0x17')][_0xb3fe('0x18')](_0x490e45[_0xb3fe('0x19')],{'raw':_0x490e45['options']?_0x490e45[_0xb3fe('0x1a')][_0xb3fe('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x4d2370){logger['info'](_0xb3fe('0x1c'),_0x490e45);logger[_0xb3fe('0x10')]('CreateWhatsappQueueReport',_0x490e45,JSON[_0xb3fe('0x12')](_0x4d2370));_0x4cbc2b(_0x4d2370);})['catch'](function(_0x13d729){logger['error']('CreateWhatsappQueueReport',_0x13d729[_0xb3fe('0x15')],_0x490e45);_0x50b721(_0x40d40f[_0xb3fe('0x13')](0x1f4,_0x13d729[_0xb3fe('0x15')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x30da9f){var _0x510827=this;return new Promise(function(_0x183c6a,_0x2b6978){return db['WhatsappQueueReport']['update'](_0x30da9f['body'],{'raw':_0x30da9f[_0xb3fe('0x1a')]?_0x30da9f[_0xb3fe('0x1a')][_0xb3fe('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x30da9f[_0xb3fe('0x1a')]?_0x30da9f[_0xb3fe('0x1a')]['where']||null:null,'attributes':_0x30da9f[_0xb3fe('0x1a')]?_0x30da9f[_0xb3fe('0x1a')][_0xb3fe('0x1d')]||null:null,'limit':_0x30da9f['options']?_0x30da9f['options'][_0xb3fe('0x1e')]||null:null})['then'](function(_0x475eb6){logger[_0xb3fe('0xd')](_0xb3fe('0x1f'),_0x30da9f);logger[_0xb3fe('0x10')](_0xb3fe('0x1f'),_0x30da9f,JSON[_0xb3fe('0x12')](_0x475eb6));_0x183c6a(_0x475eb6);})[_0xb3fe('0x20')](function(_0x48a5dd){logger[_0xb3fe('0x13')](_0xb3fe('0x1f'),_0x48a5dd[_0xb3fe('0x15')],_0x30da9f);_0x2b6978(_0x510827[_0xb3fe('0x13')](0x1f4,_0x48a5dd[_0xb3fe('0x15')]));});});}; \ No newline at end of file +var _0xd574=['WhatsappQueueReport','create','body','options','then','CreateWhatsappQueueReport','catch','UpdateWhatsappQueueReport','update','raw','where','attributes','limit','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x1d01be,_0x107191){var _0x467fd8=function(_0x2325bf){while(--_0x2325bf){_0x1d01be['push'](_0x1d01be['shift']());}};_0x467fd8(++_0x107191);}(_0xd574,0xa8));var _0x4d57=function(_0x47c68e,_0x5ee8bc){_0x47c68e=_0x47c68e-0x0;var _0x514038=_0xd574[_0x47c68e];return _0x514038;};'use strict';var _=require(_0x4d57('0x0'));var util=require('util');var moment=require(_0x4d57('0x1'));var BPromise=require(_0x4d57('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4d57('0x3'));var db=require(_0x4d57('0x4'))['db'];var utils=require(_0x4d57('0x5'));var logger=require('../../config/logger')(_0x4d57('0x6'));var config=require(_0x4d57('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4d57('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4df1e2,_0x2f0e92,_0x62e8d6){return new BPromise(function(_0x344c8e,_0x3e3b5d){return client['request'](_0x4df1e2,_0x62e8d6)['then'](function(_0x1d211d){logger[_0x4d57('0x9')](_0x4d57('0xa'),_0x2f0e92,_0x4d57('0xb'));logger[_0x4d57('0xc')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x2f0e92,_0x4d57('0xb'),JSON[_0x4d57('0xd')](_0x1d211d));if(_0x1d211d['error']){if(_0x1d211d[_0x4d57('0xe')][_0x4d57('0xf')]===0x1f4){logger[_0x4d57('0xe')](_0x4d57('0xa'),_0x2f0e92,_0x1d211d['error'][_0x4d57('0x10')]);return _0x3e3b5d(_0x1d211d[_0x4d57('0xe')][_0x4d57('0x10')]);}logger[_0x4d57('0xe')](_0x4d57('0xa'),_0x2f0e92,_0x1d211d['error'][_0x4d57('0x10')]);return _0x344c8e(_0x1d211d[_0x4d57('0xe')][_0x4d57('0x10')]);}else{logger[_0x4d57('0x9')](_0x4d57('0xa'),_0x2f0e92,_0x4d57('0xb'));_0x344c8e(_0x1d211d[_0x4d57('0x11')][_0x4d57('0x10')]);}})['catch'](function(_0x1af593){logger[_0x4d57('0xe')](_0x4d57('0xa'),_0x2f0e92,_0x1af593);_0x3e3b5d(_0x1af593);});});}exports['CreateWhatsappQueueReport']=function(_0x37bc9b){var _0x543fa9=this;return new Promise(function(_0x2775f5,_0x1b9e7d){return db[_0x4d57('0x12')][_0x4d57('0x13')](_0x37bc9b[_0x4d57('0x14')],{'raw':_0x37bc9b[_0x4d57('0x15')]?_0x37bc9b[_0x4d57('0x15')]['raw']===undefined?!![]:![]:!![]})[_0x4d57('0x16')](function(_0x4b9f81){logger[_0x4d57('0x9')](_0x4d57('0x17'),_0x37bc9b);logger[_0x4d57('0xc')](_0x4d57('0x17'),_0x37bc9b,JSON[_0x4d57('0xd')](_0x4b9f81));_0x2775f5(_0x4b9f81);})[_0x4d57('0x18')](function(_0x38d335){logger[_0x4d57('0xe')](_0x4d57('0x17'),_0x38d335['message'],_0x37bc9b);_0x1b9e7d(_0x543fa9[_0x4d57('0xe')](0x1f4,_0x38d335['message']));});});};exports[_0x4d57('0x19')]=function(_0x1c97d1){var _0x424ece=this;return new Promise(function(_0x1e4d3c,_0x297f57){return db[_0x4d57('0x12')][_0x4d57('0x1a')](_0x1c97d1[_0x4d57('0x14')],{'raw':_0x1c97d1[_0x4d57('0x15')]?_0x1c97d1[_0x4d57('0x15')][_0x4d57('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c97d1[_0x4d57('0x15')]?_0x1c97d1[_0x4d57('0x15')][_0x4d57('0x1c')]||null:null,'attributes':_0x1c97d1[_0x4d57('0x15')]?_0x1c97d1[_0x4d57('0x15')][_0x4d57('0x1d')]||null:null,'limit':_0x1c97d1['options']?_0x1c97d1[_0x4d57('0x15')][_0x4d57('0x1e')]||null:null})['then'](function(_0x73f002){logger[_0x4d57('0x9')](_0x4d57('0x19'),_0x1c97d1);logger[_0x4d57('0xc')](_0x4d57('0x19'),_0x1c97d1,JSON[_0x4d57('0xd')](_0x73f002));_0x1e4d3c(_0x73f002);})[_0x4d57('0x18')](function(_0x2526ff){logger[_0x4d57('0xe')](_0x4d57('0x19'),_0x2526ff[_0x4d57('0x10')],_0x1c97d1);_0x297f57(_0x424ece[_0x4d57('0xe')](0x1f4,_0x2526ff[_0x4d57('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index f519345..3554482 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 _0x8cae=['update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','show','post','create','put','/:id'];(function(_0x187f4b,_0x12fd52){var _0x132087=function(_0x2b68ef){while(--_0x2b68ef){_0x187f4b['push'](_0x187f4b['shift']());}};_0x132087(++_0x12fd52);}(_0x8cae,0x17a));var _0xe8ca=function(_0x1c8c34,_0xc1452d){_0x1c8c34=_0x1c8c34-0x0;var _0x2d97d9=_0x8cae[_0x1c8c34];return _0x2d97d9;};'use strict';var multer=require(_0xe8ca('0x0'));var util=require('util');var path=require(_0xe8ca('0x1'));var timeout=require('connect-timeout');var express=require(_0xe8ca('0x2'));var router=express[_0xe8ca('0x3')]();var fs_extra=require(_0xe8ca('0x4'));var auth=require(_0xe8ca('0x5'));var interaction=require(_0xe8ca('0x6'));var config=require(_0xe8ca('0x7'));var controller=require(_0xe8ca('0x8'));router[_0xe8ca('0x9')]('/',auth[_0xe8ca('0xa')](),controller[_0xe8ca('0xb')]);router[_0xe8ca('0x9')](_0xe8ca('0xc'),auth[_0xe8ca('0xa')](),controller['describe']);router['get']('/:id',auth[_0xe8ca('0xa')](),controller[_0xe8ca('0xd')]);router[_0xe8ca('0xe')]('/',auth[_0xe8ca('0xa')](),controller[_0xe8ca('0xf')]);router[_0xe8ca('0x10')](_0xe8ca('0x11'),auth['isAuthenticated'](),controller[_0xe8ca('0x12')]);router[_0xe8ca('0x13')](_0xe8ca('0x11'),auth['isAuthenticated'](),controller[_0xe8ca('0x14')]);module[_0xe8ca('0x15')]=router; \ No newline at end of file +var _0x4a4a=['update','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put'];(function(_0x415ed0,_0x11d08a){var _0xef7d0c=function(_0x502437){while(--_0x502437){_0x415ed0['push'](_0x415ed0['shift']());}};_0xef7d0c(++_0x11d08a);}(_0x4a4a,0x192));var _0xa4a4=function(_0xcc05fd,_0x391e26){_0xcc05fd=_0xcc05fd-0x0;var _0x4f4f71=_0x4a4a[_0xcc05fd];return _0x4f4f71;};'use strict';var multer=require('multer');var util=require(_0xa4a4('0x0'));var path=require('path');var timeout=require(_0xa4a4('0x1'));var express=require(_0xa4a4('0x2'));var router=express[_0xa4a4('0x3')]();var fs_extra=require(_0xa4a4('0x4'));var auth=require(_0xa4a4('0x5'));var interaction=require(_0xa4a4('0x6'));var config=require(_0xa4a4('0x7'));var controller=require('./whatsappTransferReport.controller');router[_0xa4a4('0x8')]('/',auth[_0xa4a4('0x9')](),controller[_0xa4a4('0xa')]);router[_0xa4a4('0x8')](_0xa4a4('0xb'),auth[_0xa4a4('0x9')](),controller[_0xa4a4('0xc')]);router[_0xa4a4('0x8')](_0xa4a4('0xd'),auth[_0xa4a4('0x9')](),controller[_0xa4a4('0xe')]);router[_0xa4a4('0xf')]('/',auth[_0xa4a4('0x9')](),controller[_0xa4a4('0x10')]);router[_0xa4a4('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xa4a4('0x12')]);router['delete'](_0xa4a4('0xd'),auth['isAuthenticated'](),controller[_0xa4a4('0x13')]);module[_0xa4a4('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 0d5b05e..1b3ca67 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 _0x66d3=['DATE','sequelize','STRING','account','agent'];(function(_0x30f837,_0x112c0b){var _0xe853d4=function(_0x4102d5){while(--_0x4102d5){_0x30f837['push'](_0x30f837['shift']());}};_0xe853d4(++_0x112c0b);}(_0x66d3,0x10f));var _0x366d=function(_0x1dcf1a,_0x506f1d){_0x1dcf1a=_0x1dcf1a-0x0;var _0x13e187=_0x66d3[_0x1dcf1a];return _0x13e187;};'use strict';var Sequelize=require(_0x366d('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x366d('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x366d('0x2'),_0x366d('0x3'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x366d('0x4')]}}; \ No newline at end of file +var _0x23db=['ENUM','account','agent','sequelize','exports','STRING'];(function(_0x5f35c5,_0x48949c){var _0x5e5d64=function(_0x3e968f){while(--_0x3e968f){_0x5f35c5['push'](_0x5f35c5['shift']());}};_0x5e5d64(++_0x48949c);}(_0x23db,0x141));var _0xb23d=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0x23db[_0x13b8f3];return _0x1a6d06;};'use strict';var Sequelize=require(_0xb23d('0x0'));module[_0xb23d('0x1')]={'uniqueid':{'type':Sequelize[_0xb23d('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xb23d('0x3')](_0xb23d('0x4'),_0xb23d('0x5'),'queue'),'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 7048ba2..a3a17e2 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 _0xdb3a=['eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','sendStatus','error','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','WhatsappTransferReport','includeAll','include','catch','show','params','keys','fields','options','find','create','body','destroy','describe'];(function(_0x5e83fd,_0x59e23d){var _0x4a7307=function(_0x9fceaa){while(--_0x9fceaa){_0x5e83fd['push'](_0x5e83fd['shift']());}};_0x4a7307(++_0x59e23d);}(_0xdb3a,0x163));var _0xadb3=function(_0x4b6420,_0x126201){_0x4b6420=_0x4b6420-0x0;var _0x37076f=_0xdb3a[_0x4b6420];return _0x37076f;};'use strict';var emlformat=require(_0xadb3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xadb3('0x1'));var jsonpatch=require(_0xadb3('0x2'));var rp=require(_0xadb3('0x3'));var moment=require(_0xadb3('0x4'));var BPromise=require(_0xadb3('0x5'));var Mustache=require(_0xadb3('0x6'));var util=require(_0xadb3('0x7'));var path=require('path');var sox=require(_0xadb3('0x8'));var csv=require(_0xadb3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xadb3('0xa'));var squel=require(_0xadb3('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xadb3('0xc'));var toCsv=require(_0xadb3('0x9'));var querystring=require(_0xadb3('0xd'));var Papa=require(_0xadb3('0xe'));var Redis=require(_0xadb3('0xf'));var authService=require(_0xadb3('0x10'));var qs=require(_0xadb3('0x11'));var as=require(_0xadb3('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xadb3('0x13'));var utils=require(_0xadb3('0x14'));var config=require(_0xadb3('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a2981,_0x118e92){_0x118e92=_0x118e92||0xcc;return function(_0x78f859){if(_0x78f859){return _0x1a2981['sendStatus'](_0x118e92);}return _0x1a2981[_0xadb3('0x16')](_0x118e92)['end']();};}function respondWithResult(_0x11a3ec,_0x5d0d82){_0x5d0d82=_0x5d0d82||0xc8;return function(_0x45e4f9){if(_0x45e4f9){return _0x11a3ec['status'](_0x5d0d82)[_0xadb3('0x17')](_0x45e4f9);}};}function respondWithFilteredResult(_0x346e7c,_0x313d9d){return function(_0x50b0a0){if(_0x50b0a0){var _0x63377e=typeof _0x313d9d[_0xadb3('0x18')]===_0xadb3('0x19')&&typeof _0x313d9d[_0xadb3('0x1a')]==='undefined';var _0x27f437=_0x50b0a0[_0xadb3('0x1b')];var _0x5235db=_0x63377e?0x0:_0x313d9d['offset'];var _0x3aadd8=_0x63377e?_0x50b0a0['count']:_0x313d9d['offset']+_0x313d9d['limit'];var _0xd6c3e5;if(_0x3aadd8>=_0x27f437){_0x3aadd8=_0x27f437;_0xd6c3e5=0xc8;}else{_0xd6c3e5=0xce;}_0x346e7c[_0xadb3('0x16')](_0xd6c3e5);return _0x346e7c[_0xadb3('0x1c')](_0xadb3('0x1d'),_0x5235db+'-'+_0x3aadd8+'/'+_0x27f437)[_0xadb3('0x17')](_0x50b0a0);}return null;};}function patchUpdates(_0x1fa07d){return function(_0x33fbde){try{jsonpatch[_0xadb3('0x1e')](_0x33fbde,_0x1fa07d,!![]);}catch(_0x27843b){return BPromise['reject'](_0x27843b);}return _0x33fbde[_0xadb3('0x1f')]();};}function saveUpdates(_0xad552f,_0x287278){return function(_0x40677a){if(_0x40677a){return _0x40677a[_0xadb3('0x20')](_0xad552f)[_0xadb3('0x21')](function(_0x183706){return _0x183706;});}return null;};}function removeEntity(_0x14e06f,_0x49458b){return function(_0x5c2e29){if(_0x5c2e29){return _0x5c2e29['destroy']()['then'](function(){_0x14e06f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x14de86,_0x4b4275){return function(_0xc0092b){if(!_0xc0092b){_0x14de86[_0xadb3('0x22')](0x194);}return _0xc0092b;};}function handleError(_0x316785,_0x48b6b4){_0x48b6b4=_0x48b6b4||0x1f4;return function(_0x348080){logger[_0xadb3('0x23')](_0x348080['stack']);if(_0x348080[_0xadb3('0x24')]){delete _0x348080[_0xadb3('0x24')];}_0x316785[_0xadb3('0x16')](_0x48b6b4)[_0xadb3('0x25')](_0x348080);};}exports['index']=function(_0x4bf348,_0x42a270){var _0x57f2ea={},_0x4c22e1={},_0xfb844b={'count':0x0,'rows':[]};var _0x589516=_[_0xadb3('0x26')](db['WhatsappTransferReport'][_0xadb3('0x27')],function(_0x233b28){return{'name':_0x233b28[_0xadb3('0x28')],'type':_0x233b28[_0xadb3('0x29')][_0xadb3('0x2a')]};});_0x4c22e1[_0xadb3('0x2b')]=_[_0xadb3('0x26')](_0x589516,_0xadb3('0x24'));_0x4c22e1[_0xadb3('0x2c')]=_['keys'](_0x4bf348[_0xadb3('0x2c')]);_0x4c22e1[_0xadb3('0x2d')]=_[_0xadb3('0x2e')](_0x4c22e1[_0xadb3('0x2b')],_0x4c22e1[_0xadb3('0x2c')]);_0x57f2ea[_0xadb3('0x2f')]=_['intersection'](_0x4c22e1[_0xadb3('0x2b')],qs['fields'](_0x4bf348[_0xadb3('0x2c')]['fields']));_0x57f2ea[_0xadb3('0x2f')]=_0x57f2ea[_0xadb3('0x2f')][_0xadb3('0x30')]?_0x57f2ea[_0xadb3('0x2f')]:_0x4c22e1[_0xadb3('0x2b')];if(!_0x4bf348['query'][_0xadb3('0x31')](_0xadb3('0x32'))){_0x57f2ea[_0xadb3('0x1a')]=qs[_0xadb3('0x1a')](_0x4bf348[_0xadb3('0x2c')][_0xadb3('0x1a')]);_0x57f2ea[_0xadb3('0x18')]=qs['offset'](_0x4bf348[_0xadb3('0x2c')][_0xadb3('0x18')]);}_0x57f2ea[_0xadb3('0x33')]=qs[_0xadb3('0x34')](_0x4bf348[_0xadb3('0x2c')]['sort']);_0x57f2ea[_0xadb3('0x35')]=qs[_0xadb3('0x2d')](_[_0xadb3('0x36')](_0x4bf348[_0xadb3('0x2c')],_0x4c22e1[_0xadb3('0x2d')]),_0x589516);if(_0x4bf348[_0xadb3('0x2c')][_0xadb3('0x37')]){_0x57f2ea['where']=_['merge'](_0x57f2ea[_0xadb3('0x35')],{'$or':_[_0xadb3('0x26')](_0x589516,function(_0x4799a4){if(_0x4799a4[_0xadb3('0x29')]!==_0xadb3('0x38')){var _0x23f881={};_0x23f881[_0x4799a4['name']]={'$like':'%'+_0x4bf348[_0xadb3('0x2c')][_0xadb3('0x37')]+'%'};return _0x23f881;}})});}_0x57f2ea=_['merge']({},_0x57f2ea,_0x4bf348['options']);var _0x56ac56={'where':_0x57f2ea[_0xadb3('0x35')]};return db[_0xadb3('0x39')][_0xadb3('0x1b')](_0x56ac56)[_0xadb3('0x21')](function(_0x20eddd){_0xfb844b[_0xadb3('0x1b')]=_0x20eddd;if(_0x4bf348[_0xadb3('0x2c')][_0xadb3('0x3a')]){_0x57f2ea[_0xadb3('0x3b')]=[{'all':!![]}];}return db['WhatsappTransferReport']['findAll'](_0x57f2ea);})[_0xadb3('0x21')](function(_0x418c4d){_0xfb844b['rows']=_0x418c4d;return _0xfb844b;})[_0xadb3('0x21')](respondWithFilteredResult(_0x42a270,_0x57f2ea))[_0xadb3('0x3c')](handleError(_0x42a270,null));};exports[_0xadb3('0x3d')]=function(_0x56d066,_0x26b61e){var _0x3c149b={'raw':!![],'where':{'id':_0x56d066[_0xadb3('0x3e')]['id']}},_0xf5c28={};_0xf5c28['model']=_[_0xadb3('0x3f')](db[_0xadb3('0x39')][_0xadb3('0x27')]);_0xf5c28[_0xadb3('0x2c')]=_[_0xadb3('0x3f')](_0x56d066[_0xadb3('0x2c')]);_0xf5c28[_0xadb3('0x2d')]=_[_0xadb3('0x2e')](_0xf5c28[_0xadb3('0x2b')],_0xf5c28[_0xadb3('0x2c')]);_0x3c149b[_0xadb3('0x2f')]=_['intersection'](_0xf5c28['model'],qs[_0xadb3('0x40')](_0x56d066[_0xadb3('0x2c')][_0xadb3('0x40')]));_0x3c149b[_0xadb3('0x2f')]=_0x3c149b[_0xadb3('0x2f')]['length']?_0x3c149b[_0xadb3('0x2f')]:_0xf5c28['model'];if(_0x56d066[_0xadb3('0x2c')][_0xadb3('0x3a')]){_0x3c149b[_0xadb3('0x3b')]=[{'all':!![]}];}_0x3c149b=_['merge']({},_0x3c149b,_0x56d066[_0xadb3('0x41')]);return db['WhatsappTransferReport'][_0xadb3('0x42')](_0x3c149b)['then'](handleEntityNotFound(_0x26b61e,null))[_0xadb3('0x21')](respondWithResult(_0x26b61e,null))[_0xadb3('0x3c')](handleError(_0x26b61e,null));};exports[_0xadb3('0x43')]=function(_0x35d68b,_0x17e604){return db[_0xadb3('0x39')]['create'](_0x35d68b[_0xadb3('0x44')],{})[_0xadb3('0x21')](respondWithResult(_0x17e604,0xc9))[_0xadb3('0x3c')](handleError(_0x17e604,null));};exports[_0xadb3('0x20')]=function(_0x3b79b3,_0x5da407){if(_0x3b79b3['body']['id']){delete _0x3b79b3[_0xadb3('0x44')]['id'];}return db['WhatsappTransferReport'][_0xadb3('0x42')]({'where':{'id':_0x3b79b3['params']['id']}})['then'](handleEntityNotFound(_0x5da407,null))[_0xadb3('0x21')](saveUpdates(_0x3b79b3[_0xadb3('0x44')],null))[_0xadb3('0x21')](respondWithResult(_0x5da407,null))['catch'](handleError(_0x5da407,null));};exports[_0xadb3('0x45')]=function(_0x3982b0,_0x4f1da0){return db[_0xadb3('0x39')]['find']({'where':{'id':_0x3982b0['params']['id']}})[_0xadb3('0x21')](handleEntityNotFound(_0x4f1da0,null))[_0xadb3('0x21')](removeEntity(_0x4f1da0,null))[_0xadb3('0x3c')](handleError(_0x4f1da0,null));};exports[_0xadb3('0x46')]=function(_0x3cb7d7,_0x1f6cc2){return db[_0xadb3('0x39')][_0xadb3('0x46')]()[_0xadb3('0x21')](respondWithResult(_0x1f6cc2,null))[_0xadb3('0x3c')](handleError(_0x1f6cc2,null));}; \ No newline at end of file +var _0x48b1=['rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','update','describe','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','apply','reject','save','then','destroy','error','stack','name','send','index','map','WhatsappTransferReport'];(function(_0xd87549,_0x5e443b){var _0x492872=function(_0x4f9cb3){while(--_0x4f9cb3){_0xd87549['push'](_0xd87549['shift']());}};_0x492872(++_0x5e443b);}(_0x48b1,0x197));var _0x148b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x48b1[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x148b('0x0'));var rp=require(_0x148b('0x1'));var moment=require(_0x148b('0x2'));var BPromise=require(_0x148b('0x3'));var Mustache=require(_0x148b('0x4'));var util=require(_0x148b('0x5'));var path=require(_0x148b('0x6'));var sox=require(_0x148b('0x7'));var csv=require(_0x148b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x148b('0x9'));var squel=require(_0x148b('0xa'));var crypto=require(_0x148b('0xb'));var jsforce=require(_0x148b('0xc'));var deskjs=require(_0x148b('0xd'));var toCsv=require('to-csv');var querystring=require(_0x148b('0xe'));var Papa=require('papaparse');var Redis=require(_0x148b('0xf'));var authService=require(_0x148b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x148b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x148b('0x12'));var utils=require(_0x148b('0x13'));var config=require(_0x148b('0x14'));var licenseUtil=require(_0x148b('0x15'));var db=require(_0x148b('0x16'))['db'];function respondWithStatusCode(_0x4b6ecb,_0x43c99d){_0x43c99d=_0x43c99d||0xcc;return function(_0x1919ed){if(_0x1919ed){return _0x4b6ecb[_0x148b('0x17')](_0x43c99d);}return _0x4b6ecb[_0x148b('0x18')](_0x43c99d)[_0x148b('0x19')]();};}function respondWithResult(_0x48f12b,_0x3f9a4b){_0x3f9a4b=_0x3f9a4b||0xc8;return function(_0x1e59e9){if(_0x1e59e9){return _0x48f12b[_0x148b('0x18')](_0x3f9a4b)[_0x148b('0x1a')](_0x1e59e9);}};}function respondWithFilteredResult(_0x2ecaf2,_0x16c4b6){return function(_0x2b91d7){if(_0x2b91d7){var _0x3852c9=typeof _0x16c4b6[_0x148b('0x1b')]==='undefined'&&typeof _0x16c4b6[_0x148b('0x1c')]===_0x148b('0x1d');var _0x4c4d2d=_0x2b91d7[_0x148b('0x1e')];var _0x5b055d=_0x3852c9?0x0:_0x16c4b6['offset'];var _0x4f90ec=_0x3852c9?_0x2b91d7[_0x148b('0x1e')]:_0x16c4b6[_0x148b('0x1b')]+_0x16c4b6['limit'];var _0x1af1ce;if(_0x4f90ec>=_0x4c4d2d){_0x4f90ec=_0x4c4d2d;_0x1af1ce=0xc8;}else{_0x1af1ce=0xce;}_0x2ecaf2[_0x148b('0x18')](_0x1af1ce);return _0x2ecaf2['set']('Content-Range',_0x5b055d+'-'+_0x4f90ec+'/'+_0x4c4d2d)[_0x148b('0x1a')](_0x2b91d7);}return null;};}function patchUpdates(_0x1781f0){return function(_0x442cdc){try{jsonpatch[_0x148b('0x1f')](_0x442cdc,_0x1781f0,!![]);}catch(_0x312a95){return BPromise[_0x148b('0x20')](_0x312a95);}return _0x442cdc[_0x148b('0x21')]();};}function saveUpdates(_0x264d57,_0x49cd84){return function(_0x466dc0){if(_0x466dc0){return _0x466dc0['update'](_0x264d57)[_0x148b('0x22')](function(_0x34a602){return _0x34a602;});}return null;};}function removeEntity(_0x4b7f15,_0x3431a9){return function(_0x6594cf){if(_0x6594cf){return _0x6594cf[_0x148b('0x23')]()[_0x148b('0x22')](function(){_0x4b7f15[_0x148b('0x18')](0xcc)[_0x148b('0x19')]();});}};}function handleEntityNotFound(_0x4f559a,_0x31cf16){return function(_0x41aca4){if(!_0x41aca4){_0x4f559a[_0x148b('0x17')](0x194);}return _0x41aca4;};}function handleError(_0x7c2de7,_0x65b099){_0x65b099=_0x65b099||0x1f4;return function(_0x164604){logger[_0x148b('0x24')](_0x164604[_0x148b('0x25')]);if(_0x164604[_0x148b('0x26')]){delete _0x164604[_0x148b('0x26')];}_0x7c2de7['status'](_0x65b099)[_0x148b('0x27')](_0x164604);};}exports[_0x148b('0x28')]=function(_0x41b31b,_0x1c8dec){var _0x3fef40={},_0x1e9dc9={},_0x499280={'count':0x0,'rows':[]};var _0x1cb1ca=_[_0x148b('0x29')](db[_0x148b('0x2a')][_0x148b('0x2b')],function(_0xccac07){return{'name':_0xccac07[_0x148b('0x2c')],'type':_0xccac07[_0x148b('0x2d')]['key']};});_0x1e9dc9[_0x148b('0x2e')]=_[_0x148b('0x29')](_0x1cb1ca,'name');_0x1e9dc9[_0x148b('0x2f')]=_[_0x148b('0x30')](_0x41b31b['query']);_0x1e9dc9['filters']=_[_0x148b('0x31')](_0x1e9dc9['model'],_0x1e9dc9[_0x148b('0x2f')]);_0x3fef40['attributes']=_[_0x148b('0x31')](_0x1e9dc9[_0x148b('0x2e')],qs[_0x148b('0x32')](_0x41b31b[_0x148b('0x2f')][_0x148b('0x32')]));_0x3fef40[_0x148b('0x33')]=_0x3fef40[_0x148b('0x33')][_0x148b('0x34')]?_0x3fef40[_0x148b('0x33')]:_0x1e9dc9[_0x148b('0x2e')];if(!_0x41b31b['query'][_0x148b('0x35')](_0x148b('0x36'))){_0x3fef40[_0x148b('0x1c')]=qs[_0x148b('0x1c')](_0x41b31b[_0x148b('0x2f')][_0x148b('0x1c')]);_0x3fef40['offset']=qs[_0x148b('0x1b')](_0x41b31b['query'][_0x148b('0x1b')]);}_0x3fef40[_0x148b('0x37')]=qs['sort'](_0x41b31b[_0x148b('0x2f')][_0x148b('0x38')]);_0x3fef40[_0x148b('0x39')]=qs[_0x148b('0x3a')](_[_0x148b('0x3b')](_0x41b31b[_0x148b('0x2f')],_0x1e9dc9[_0x148b('0x3a')]),_0x1cb1ca);if(_0x41b31b[_0x148b('0x2f')][_0x148b('0x3c')]){_0x3fef40[_0x148b('0x39')]=_[_0x148b('0x3d')](_0x3fef40[_0x148b('0x39')],{'$or':_[_0x148b('0x29')](_0x1cb1ca,function(_0x30eed6){if(_0x30eed6[_0x148b('0x2d')]!==_0x148b('0x3e')){var _0x4094e4={};_0x4094e4[_0x30eed6[_0x148b('0x26')]]={'$like':'%'+_0x41b31b[_0x148b('0x2f')]['filter']+'%'};return _0x4094e4;}})});}_0x3fef40=_[_0x148b('0x3d')]({},_0x3fef40,_0x41b31b[_0x148b('0x3f')]);var _0x5a9c1f={'where':_0x3fef40['where']};return db[_0x148b('0x2a')][_0x148b('0x1e')](_0x5a9c1f)['then'](function(_0x3bb29e){_0x499280[_0x148b('0x1e')]=_0x3bb29e;if(_0x41b31b[_0x148b('0x2f')][_0x148b('0x40')]){_0x3fef40[_0x148b('0x41')]=[{'all':!![]}];}return db[_0x148b('0x2a')][_0x148b('0x42')](_0x3fef40);})['then'](function(_0x2be69e){_0x499280['rows']=_0x2be69e;return _0x499280;})[_0x148b('0x22')](respondWithFilteredResult(_0x1c8dec,_0x3fef40))[_0x148b('0x43')](handleError(_0x1c8dec,null));};exports[_0x148b('0x44')]=function(_0x373757,_0x187cc3){var _0x52e7c0={'raw':!![],'where':{'id':_0x373757[_0x148b('0x45')]['id']}},_0x1828f9={};_0x1828f9[_0x148b('0x2e')]=_[_0x148b('0x30')](db[_0x148b('0x2a')][_0x148b('0x2b')]);_0x1828f9[_0x148b('0x2f')]=_[_0x148b('0x30')](_0x373757[_0x148b('0x2f')]);_0x1828f9[_0x148b('0x3a')]=_['intersection'](_0x1828f9['model'],_0x1828f9['query']);_0x52e7c0[_0x148b('0x33')]=_[_0x148b('0x31')](_0x1828f9[_0x148b('0x2e')],qs[_0x148b('0x32')](_0x373757['query'][_0x148b('0x32')]));_0x52e7c0['attributes']=_0x52e7c0[_0x148b('0x33')][_0x148b('0x34')]?_0x52e7c0[_0x148b('0x33')]:_0x1828f9['model'];if(_0x373757[_0x148b('0x2f')][_0x148b('0x40')]){_0x52e7c0[_0x148b('0x41')]=[{'all':!![]}];}_0x52e7c0=_['merge']({},_0x52e7c0,_0x373757[_0x148b('0x3f')]);return db[_0x148b('0x2a')][_0x148b('0x46')](_0x52e7c0)[_0x148b('0x22')](handleEntityNotFound(_0x187cc3,null))[_0x148b('0x22')](respondWithResult(_0x187cc3,null))[_0x148b('0x43')](handleError(_0x187cc3,null));};exports['create']=function(_0x57dbb2,_0x38a06a){return db[_0x148b('0x2a')][_0x148b('0x47')](_0x57dbb2[_0x148b('0x48')],{})[_0x148b('0x22')](respondWithResult(_0x38a06a,0xc9))['catch'](handleError(_0x38a06a,null));};exports[_0x148b('0x49')]=function(_0x4373c4,_0x14ea52){if(_0x4373c4[_0x148b('0x48')]['id']){delete _0x4373c4[_0x148b('0x48')]['id'];}return db[_0x148b('0x2a')][_0x148b('0x46')]({'where':{'id':_0x4373c4[_0x148b('0x45')]['id']}})[_0x148b('0x22')](handleEntityNotFound(_0x14ea52,null))[_0x148b('0x22')](saveUpdates(_0x4373c4[_0x148b('0x48')],null))['then'](respondWithResult(_0x14ea52,null))[_0x148b('0x43')](handleError(_0x14ea52,null));};exports['destroy']=function(_0x2d38d3,_0x5910c0){return db[_0x148b('0x2a')][_0x148b('0x46')]({'where':{'id':_0x2d38d3['params']['id']}})['then'](handleEntityNotFound(_0x5910c0,null))['then'](removeEntity(_0x5910c0,null))['catch'](handleError(_0x5910c0,null));};exports[_0x148b('0x4a')]=function(_0x18c47a,_0x47cebe){return db[_0x148b('0x2a')][_0x148b('0x4a')]()[_0x148b('0x22')](respondWithResult(_0x47cebe,null))[_0x148b('0x43')](handleError(_0x47cebe,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 979c68e..d658932 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 _0xd7bd=['WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./whatsappTransferReport.attributes','exports'];(function(_0x2675da,_0x5a250e){var _0x5e6153=function(_0xf93114){while(--_0xf93114){_0x2675da['push'](_0x2675da['shift']());}};_0x5e6153(++_0x5a250e);}(_0xd7bd,0x1e4));var _0xdd7b=function(_0x4bed75,_0x211cc7){_0x4bed75=_0x4bed75-0x0;var _0x2dd8e8=_0xd7bd[_0x4bed75];return _0x2dd8e8;};'use strict';var _=require(_0xdd7b('0x0'));var util=require(_0xdd7b('0x1'));var logger=require(_0xdd7b('0x2'))(_0xdd7b('0x3'));var moment=require('moment');var BPromise=require(_0xdd7b('0x4'));var rp=require(_0xdd7b('0x5'));var fs=require('fs');var path=require(_0xdd7b('0x6'));var rimraf=require(_0xdd7b('0x7'));var config=require('../../config/environment');var attributes=require(_0xdd7b('0x8'));module[_0xdd7b('0x9')]=function(_0x519e56,_0x3f12cb){return _0x519e56['define'](_0xdd7b('0xa'),attributes,{'tableName':_0xdd7b('0xb'),'paranoid':![],'indexes':[{'name':_0xdd7b('0xc'),'fields':[_0xdd7b('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x237a=['rimraf','./whatsappTransferReport.attributes','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','../../config/logger','api','moment','bluebird','path'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x237a,0xb6));var _0xa237=function(_0xd6d8a,_0x9bc2b5){_0xd6d8a=_0xd6d8a-0x0;var _0x25c275=_0x237a[_0xd6d8a];return _0x25c275;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa237('0x0'))(_0xa237('0x1'));var moment=require(_0xa237('0x2'));var BPromise=require(_0xa237('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa237('0x4'));var rimraf=require(_0xa237('0x5'));var config=require('../../config/environment');var attributes=require(_0xa237('0x6'));module['exports']=function(_0x1220cd,_0x136c66){return _0x1220cd[_0xa237('0x7')](_0xa237('0x8'),attributes,{'tableName':_0xa237('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xa237('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index e42afdd..9eaea94 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 _0x301a=['ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird'];(function(_0x1b8167,_0x5257e3){var _0x50ad83=function(_0x5e8bff){while(--_0x5e8bff){_0x1b8167['push'](_0x1b8167['shift']());}};_0x50ad83(++_0x5257e3);}(_0x301a,0x90));var _0xa301=function(_0x1e4a24,_0x2773bf){_0x1e4a24=_0x1e4a24-0x0;var _0x36a42c=_0x301a[_0x1e4a24];return _0x36a42c;};'use strict';var _=require(_0xa301('0x0'));var util=require(_0xa301('0x1'));var moment=require('moment');var BPromise=require(_0xa301('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa301('0x3'));var db=require(_0xa301('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa301('0x5'))(_0xa301('0x6'));var config=require('../../config/environment');var jayson=require(_0xa301('0x7'));var client=jayson[_0xa301('0x8')][_0xa301('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2dfdbb,_0x4f0243,_0x40466a){return new BPromise(function(_0x42e4a2,_0xb4565b){return client[_0xa301('0xa')](_0x2dfdbb,_0x40466a)['then'](function(_0x51447c){logger[_0xa301('0xb')](_0xa301('0xc'),_0x4f0243,_0xa301('0xd'));logger['debug'](_0xa301('0xe'),_0x4f0243,'request\x20sent',JSON[_0xa301('0xf')](_0x51447c));if(_0x51447c['error']){if(_0x51447c[_0xa301('0x10')][_0xa301('0x11')]===0x1f4){logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x4f0243,_0x51447c[_0xa301('0x10')][_0xa301('0x12')]);return _0xb4565b(_0x51447c[_0xa301('0x10')][_0xa301('0x12')]);}logger[_0xa301('0x10')](_0xa301('0xc'),_0x4f0243,_0x51447c['error'][_0xa301('0x12')]);return _0x42e4a2(_0x51447c[_0xa301('0x10')][_0xa301('0x12')]);}else{logger[_0xa301('0xb')](_0xa301('0xc'),_0x4f0243,_0xa301('0xd'));_0x42e4a2(_0x51447c[_0xa301('0x13')][_0xa301('0x12')]);}})[_0xa301('0x14')](function(_0x9dbbc2){logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x4f0243,_0x9dbbc2);_0xb4565b(_0x9dbbc2);});});} \ No newline at end of file +var _0x72a8=['code','message','WhatsappTransferReport,\x20%s,\x20%s','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1fa759,_0x4ecdce){var _0x2da9f4=function(_0x463e2a){while(--_0x463e2a){_0x1fa759['push'](_0x1fa759['shift']());}};_0x2da9f4(++_0x4ecdce);}(_0x72a8,0x12b));var _0x872a=function(_0x26c5f9,_0x2df481){_0x26c5f9=_0x26c5f9-0x0;var _0x36d45e=_0x72a8[_0x26c5f9];return _0x36d45e;};'use strict';var _=require(_0x872a('0x0'));var util=require('util');var moment=require(_0x872a('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x872a('0x2'));var db=require(_0x872a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x872a('0x4'))(_0x872a('0x5'));var config=require(_0x872a('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x872a('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12d204,_0x2f5ad6,_0x363ce3){return new BPromise(function(_0x3a17b1,_0x487eed){return client[_0x872a('0x8')](_0x12d204,_0x363ce3)[_0x872a('0x9')](function(_0x432cde){logger[_0x872a('0xa')]('WhatsappTransferReport,\x20%s,\x20%s',_0x2f5ad6,_0x872a('0xb'));logger[_0x872a('0xc')](_0x872a('0xd'),_0x2f5ad6,_0x872a('0xb'),JSON[_0x872a('0xe')](_0x432cde));if(_0x432cde[_0x872a('0xf')]){if(_0x432cde[_0x872a('0xf')][_0x872a('0x10')]===0x1f4){logger[_0x872a('0xf')]('WhatsappTransferReport,\x20%s,\x20%s',_0x2f5ad6,_0x432cde['error'][_0x872a('0x11')]);return _0x487eed(_0x432cde[_0x872a('0xf')][_0x872a('0x11')]);}logger[_0x872a('0xf')](_0x872a('0x12'),_0x2f5ad6,_0x432cde[_0x872a('0xf')][_0x872a('0x11')]);return _0x3a17b1(_0x432cde['error'][_0x872a('0x11')]);}else{logger[_0x872a('0xa')]('WhatsappTransferReport,\x20%s,\x20%s',_0x2f5ad6,'request\x20sent');_0x3a17b1(_0x432cde[_0x872a('0x13')][_0x872a('0x11')]);}})[_0x872a('0x14')](function(_0x5856f9){logger['error'](_0x872a('0x12'),_0x2f5ad6,_0x5856f9);_0x487eed(_0x5856f9);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 73fdb65..acfc25d 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xde09=['map','filter','online','name','Offline\x20apps:','status','join','None','seedDB','./config/seedDB','default','catch','error','exit','lodash','./rpc','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','then','info','start','Online\x20apps:'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xde09,0xbc));var _0x9de0=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xde09[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0x9de0('0x0'));var mysqldb=require('./mysqldb');var rpc=require(_0x9de0('0x1'));var config=require('./config/environment');var logger=require(_0x9de0('0x2'))(_0x9de0('0x3'));var pm2=require(_0x9de0('0x4'));var pm2Config=require(_0x9de0('0x5'));var schedule=require('./config/schedule');var chat=require(_0x9de0('0x6'));var whatsapp=require(_0x9de0('0x7'));var transcribe=require(_0x9de0('0x8'));function main(){return mysqldb['db'][_0x9de0('0x9')][_0x9de0('0xa')]()[_0x9de0('0xb')](function(){return rpc['listen']();})[_0x9de0('0xb')](function(_0x51c14b){logger[_0x9de0('0xc')](_0x51c14b);return chat[_0x9de0('0xd')]();})[_0x9de0('0xb')](function(){return whatsapp[_0x9de0('0xd')]();})[_0x9de0('0xb')](function(){return schedule['start']();})[_0x9de0('0xb')](function(){return transcribe[_0x9de0('0xd')]();})[_0x9de0('0xb')](function(_0x4e33a9){logger[_0x9de0('0xc')](_0x4e33a9);return pm2[_0x9de0('0xd')](pm2Config);})[_0x9de0('0xb')](function(_0x1d2f2b){logger['info'](_0x9de0('0xe'),_[_0x9de0('0xf')](_[_0x9de0('0x10')](_0x1d2f2b,{'status':_0x9de0('0x11')}),_0x9de0('0x12'))['join']());logger[_0x9de0('0xc')](_0x9de0('0x13'),_[_0x9de0('0xf')](_[_0x9de0('0x10')](_0x1d2f2b,function(_0x297b2e){return _0x297b2e[_0x9de0('0x14')]!==_0x9de0('0x11');}),_0x9de0('0x12'))[_0x9de0('0x15')]()||_0x9de0('0x16'));config[_0x9de0('0x17')]&&require(_0x9de0('0x18'))[_0x9de0('0x19')]();require('./config/license')[_0x9de0('0x19')]();})[_0x9de0('0x1a')](function(_0x39af78){logger[_0x9de0('0x1b')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x39af78);process[_0x9de0('0x1c')](0x1);});}main(); \ No newline at end of file +var _0x8af4=['listen','then','start','info','Online\x20apps:','map','filter','online','name','Offline\x20apps:','status','join','None','seedDB','./config/seedDB','default','./config/license','error','lodash','./mysqldb','./rpc','./config/environment','./config/logger','app','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/transcribe','sequelize','sync'];(function(_0x1e4c41,_0x5dbebe){var _0x5240ac=function(_0x2d7642){while(--_0x2d7642){_0x1e4c41['push'](_0x1e4c41['shift']());}};_0x5240ac(++_0x5dbebe);}(_0x8af4,0xa8));var _0x48af=function(_0x283127,_0x54d4d5){_0x283127=_0x283127-0x0;var _0x43da5d=_0x8af4[_0x283127];return _0x43da5d;};'use strict';var _=require(_0x48af('0x0'));var mysqldb=require(_0x48af('0x1'));var rpc=require(_0x48af('0x2'));var config=require(_0x48af('0x3'));var logger=require(_0x48af('0x4'))(_0x48af('0x5'));var pm2=require('./config/pm2');var pm2Config=require(_0x48af('0x6'));var schedule=require(_0x48af('0x7'));var chat=require(_0x48af('0x8'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0x48af('0x9'));function main(){return mysqldb['db'][_0x48af('0xa')][_0x48af('0xb')]()['then'](function(){return rpc[_0x48af('0xc')]();})[_0x48af('0xd')](function(_0x481075){logger['info'](_0x481075);return chat['start']();})[_0x48af('0xd')](function(){return whatsapp[_0x48af('0xe')]();})[_0x48af('0xd')](function(){return schedule[_0x48af('0xe')]();})[_0x48af('0xd')](function(){return transcribe['start']();})[_0x48af('0xd')](function(_0x1d0eb1){logger[_0x48af('0xf')](_0x1d0eb1);return pm2[_0x48af('0xe')](pm2Config);})[_0x48af('0xd')](function(_0x43ddfb){logger[_0x48af('0xf')](_0x48af('0x10'),_[_0x48af('0x11')](_[_0x48af('0x12')](_0x43ddfb,{'status':_0x48af('0x13')}),_0x48af('0x14'))['join']());logger[_0x48af('0xf')](_0x48af('0x15'),_[_0x48af('0x11')](_[_0x48af('0x12')](_0x43ddfb,function(_0x5a9288){return _0x5a9288[_0x48af('0x16')]!==_0x48af('0x13');}),_0x48af('0x14'))[_0x48af('0x17')]()||_0x48af('0x18'));config[_0x48af('0x19')]&&require(_0x48af('0x1a'))[_0x48af('0x1b')]();require(_0x48af('0x1c'))[_0x48af('0x1b')]();})['catch'](function(_0x41d6ba){logger[_0x48af('0x1d')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x41d6ba);process['exit'](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 87341ea..366191e 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 _0x31e9=['express-jwt','composable-middleware','crypto','bluebird','util','secrets','session','role','fullname','internal','email','userpic','permissions','md5secret','voicePause','chatPause','faxPause','smsPause','pauseType','showWebBar','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableDtmfTone','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','hotdesk','interface','privacyEnabled','settingsEnabled','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','isChatInteractionAuthorized','isAuthenticated','user','params','closed','disposition','then','status','json','unmanaged','Unmanaged.','catch','use','authorization','headers','Basic','find','authenticate','pass','Wrong\x20credentials.','startsWith','Bearer','Unknown\x20authorization\x20format','query','getUuid','apikey','User','sub','Setting','findOne','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','add','minutes','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isWebrtcLicence','webrtc','isMiddleware','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','send','retrieveApiKey','isNil','apiKeyIat','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','length','splice','unshift','encryptString','join','promisify','sign','secret','verify','toString','hex','now','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken'];(function(_0x830994,_0x4e0a64){var _0x52a8b=function(_0x415c2c){while(--_0x415c2c){_0x830994['push'](_0x830994['shift']());}};_0x52a8b(++_0x4e0a64);}(_0x31e9,0x1f1));var _0x931e=function(_0x5465d1,_0x599cb0){_0x5465d1=_0x5465d1-0x0;var _0x4b94cd=_0x31e9[_0x5465d1];return _0x4b94cd;};'use strict';var db=require(_0x931e('0x0'))['db'];var config=require(_0x931e('0x1'));var hardwareConf=require(_0x931e('0x2'));var licenseUtil=require(_0x931e('0x3'));var encryptor=require(_0x931e('0x4'));var _=require(_0x931e('0x5'));var jwt=require(_0x931e('0x6'));var expressJwt=require(_0x931e('0x7'));var compose=require(_0x931e('0x8'));var basicAuth=require('basic-auth');var crypto=require(_0x931e('0x9'));var BPromise=require(_0x931e('0xa'));var util=require(_0x931e('0xb'));var moment=require('moment');var validateJwt=expressJwt({'secret':config[_0x931e('0xc')][_0x931e('0xd')]});var userAttributes=['id',_0x931e('0xe'),_0x931e('0xf'),'name',_0x931e('0x10'),_0x931e('0x11'),_0x931e('0x12'),_0x931e('0x13'),_0x931e('0x14'),_0x931e('0x15'),_0x931e('0x16'),'mailPause',_0x931e('0x17'),_0x931e('0x18'),'openchannelPause',_0x931e('0x19'),_0x931e('0x1a'),'lastLoginAt','lastPauseAt',_0x931e('0x1b'),_0x931e('0x1c'),_0x931e('0x1d'),_0x931e('0x1e'),_0x931e('0x1f'),_0x931e('0x20'),'phoneBarDnd','phoneBarEnableRecording',_0x931e('0x21'),'phoneBarEnableSettings',_0x931e('0x22'),_0x931e('0x23'),_0x931e('0x24'),'phoneBarRemoteControlPort',_0x931e('0x25'),_0x931e('0x26'),'userProfileId',_0x931e('0x27'),_0x931e('0x28'),'wssPort',_0x931e('0x29'),_0x931e('0x2a'),_0x931e('0x2b'),_0x931e('0x2c'),_0x931e('0x2d')];exports[_0x931e('0x2e')]=function(){return this[_0x931e('0x2f')](!![])['use'](function(_0x4bd0f8,_0x3d0ff9,_0x2a1469){if(_0x4bd0f8[_0x931e('0x30')]){_0x2a1469();}else{return db['ChatInteraction']['findOne']({'where':{'id':_0x4bd0f8[_0x931e('0x31')]['id']},'attributes':['id',_0x931e('0x32'),_0x931e('0x33')],'raw':!![]})[_0x931e('0x34')](function(_0x172907){if(_0x172907&&_0x172907[_0x931e('0x32')]){return _0x3d0ff9[_0x931e('0x35')](_0x172907[_0x931e('0x33')]==='unmanaged'?0x195:0x193)[_0x931e('0x36')]({'message':_0x172907[_0x931e('0x33')]===_0x931e('0x37')?_0x931e('0x38'):'Forbidden.'});}else{_0x2a1469();}})[_0x931e('0x39')](function(_0x225571){_0x2a1469(_0x225571);});}});};exports[_0x931e('0x2f')]=function isAuthenticated(_0x4ff378){return compose()[_0x931e('0x3a')](function(_0x4f4ec5,_0x411fb7,_0x57d83b){var _0x48f11a;if(_0x4f4ec5['headers'][_0x931e('0x3b')]){if(_['startsWith'](_0x4f4ec5[_0x931e('0x3c')][_0x931e('0x3b')],_0x931e('0x3d'))){var _0x2d4975=basicAuth(_0x4f4ec5);db['User'][_0x931e('0x3e')]({'where':{'name':_0x2d4975['name']}})['then'](function(_0x14c6de){if(!_0x14c6de||!_0x14c6de[_0x931e('0x3f')](_0x2d4975[_0x931e('0x40')])){return _0x411fb7[_0x931e('0x35')](0x191)[_0x931e('0x36')]({'message':_0x931e('0x41')});}_0x4f4ec5['user']={'id':_0x14c6de['id']};_0x57d83b();})[_0x931e('0x39')](function(_0x104c92){_0x57d83b(_0x104c92);});}else if(_[_0x931e('0x42')](_0x4f4ec5[_0x931e('0x3c')][_0x931e('0x3b')],_0x931e('0x43'))){validateJwt(_0x4f4ec5,_0x411fb7,_0x57d83b);}else{if(_0x4ff378){_0x57d83b();}else{return _0x411fb7[_0x931e('0x35')](0x193)[_0x931e('0x36')]({'message':_0x931e('0x44')});}}}else if(_0x4f4ec5[_0x931e('0x45')]['apikey']){try{var _0x5b4d22={'audience':hardwareConf[_0x931e('0x46')](),'issuer':hardwareConf[_0x931e('0x46')]()};verifyJwt(_0x4f4ec5[_0x931e('0x45')][_0x931e('0x47')],_0x5b4d22)[_0x931e('0x34')](function(_0x3e35d1){return db[_0x931e('0x48')][_0x931e('0x3e')]({'where':{'id':_0x3e35d1[_0x931e('0x49')]}})[_0x931e('0x34')](function(_0x5ae442){_0x48f11a=_0x5ae442;return db[_0x931e('0x4a')][_0x931e('0x4b')]({'where':{'id':0x1},'attributes':[_0x931e('0x4c'),_0x931e('0x4d')],'raw':!![]});})[_0x931e('0x34')](function(_0x203a07){if(!_0x48f11a||!_[_0x931e('0x4e')](_0x48f11a[_0x931e('0x4f')],_0x3e35d1[_0x931e('0x50')])){return _0x411fb7[_0x931e('0x35')](0x191)['json']({'message':_0x931e('0x51')});}if(_0x48f11a[_0x931e('0x52')]){return _0x411fb7[_0x931e('0x35')](0x191)[_0x931e('0x36')]({'message':_0x931e('0x53')});}if(_0x48f11a[_0x931e('0x54')]){if(_0x203a07[_0x931e('0x4d')]>0x0){if(moment(_0x48f11a['blockedAt'])[_0x931e('0x55')](_0x203a07[_0x931e('0x4d')],_0x931e('0x56'))>moment()){return _0x411fb7['status'](0x191)[_0x931e('0x36')]({'message':_0x931e('0x53')});}}else{return _0x411fb7['status'](0x191)[_0x931e('0x36')]({'message':_0x931e('0x53')});}}_0x4f4ec5[_0x931e('0x30')]={'id':_0x48f11a['id']};_0x57d83b();});})[_0x931e('0x39')](function(){return _0x411fb7[_0x931e('0x35')](0x191)['json']({'message':_0x931e('0x53')});});}catch(_0x31f889){_0x57d83b(_0x31f889);}}else if(_0x4ff378){_0x57d83b();}else{return _0x411fb7['status'](0x193)[_0x931e('0x36')]({'message':_0x931e('0x44')});}})[_0x931e('0x3a')](function(_0x25685f,_0xa10fe5,_0x5acfe4){if(_0x25685f[_0x931e('0x30')]){db[_0x931e('0x48')][_0x931e('0x3e')]({'where':{'id':_0x25685f[_0x931e('0x30')]['id']},'attributes':userAttributes})[_0x931e('0x34')](function(_0x1ca7ac){if(!_0x1ca7ac){return _0xa10fe5[_0x931e('0x35')](0x194)['json']({'message':'User\x20not\x20found.'});}_0x25685f['user']=_0x1ca7ac;_0x5acfe4();})[_0x931e('0x39')](function(_0x232d89){_0x5acfe4(_0x232d89);});}else if(_0x4ff378){_0x5acfe4();}else{return _0xa10fe5['status'](0x194)['json']({'message':_0x931e('0x57')});}});};exports[_0x931e('0x58')]=function canUpdate(){return compose()[_0x931e('0x3a')](function(_0x17626c,_0x13468b,_0x34ac4c){return licenseUtil[_0x931e('0x59')]()[_0x931e('0x34')](function(_0x5024be){if(_0x5024be[_0x931e('0x5a')]){_0x34ac4c();}else{return _0x13468b['status'](0x193)[_0x931e('0x36')]({'message':_0x931e('0x5b')});}})[_0x931e('0x39')](function(_0x1b63bc){_0x34ac4c(_0x1b63bc);});});};exports[_0x931e('0x5c')]=function isWebrtcLicence(){return compose()['use'](function(_0xea2928,_0x53039e,_0x2c89ae){return licenseUtil[_0x931e('0x59')]()[_0x931e('0x34')](function(_0x3c51b){if(_0x3c51b[_0x931e('0x5d')]){_0x2c89ae();}else{return _0x53039e[_0x931e('0x35')](0x193)[_0x931e('0x36')]({'message':_0x931e('0x5b')});}})[_0x931e('0x39')](function(_0x3627a6){_0x2c89ae(_0x3627a6);});});};exports[_0x931e('0x5e')]=function(_0x3dc8bf,_0x3b7407,_0x394d53){_0x3dc8bf[_0x931e('0x5e')]=!![];return _0x394d53();};exports[_0x931e('0x5f')]=function signToken(_0x43da1e){return signJwt(_0x43da1e);};exports['setTokenCookie']=function(_0x307689,_0x116565){if(!_0x307689[_0x931e('0x30')]){return _0x116565[_0x931e('0x35')](0x194)[_0x931e('0x36')]({'message':_0x931e('0x60')});}var _0x1a3e8c={'payload':{'id':_0x307689[_0x931e('0x30')]['id'],'role':_0x307689[_0x931e('0x30')][_0x931e('0xe')]},'options':{'expiresIn':0x15180}};return signJwt(_0x1a3e8c)[_0x931e('0x34')](function(_0x121e13){_0x116565[_0x931e('0x61')]('motion.token',_0x121e13);_0x116565['redirect']('/dashboards/general');})[_0x931e('0x39')](function(_0x1b647a){return _0x116565['status'](0x1f4)[_0x931e('0x62')](_0x1b647a);});};exports[_0x931e('0x63')]=function(_0x321e82){if(_[_0x931e('0x64')](_0x321e82[_0x931e('0x4f')])||_[_0x931e('0x64')](_0x321e82[_0x931e('0x65')])){return null;}else{return createJwt(_0x321e82);}};exports['generateApiKey']=function(_0x471cc6){_0x471cc6[_0x931e('0x4f')]=generateNonce();_0x471cc6[_0x931e('0x65')]=generateIssuedAt();return createJwt(_0x471cc6);};exports['regenerateApiKey']=function(_0x12d2e7,_0x1abd50){var _0x403a83=_0x12d2e7[_0x931e('0x45')]['apikey'];if(_0x403a83){var _0x56216d={'nonce':_0x1abd50['apiKeyNonce'],'iat':_0x1abd50['apiKeyIat'],'audience':hardwareConf[_0x931e('0x46')](),'issuer':hardwareConf[_0x931e('0x46')]()};return verifyJwt(_0x403a83,_0x56216d)['then'](function(){return generateApiKey(_0x1abd50);});}else{throw{'message':_0x931e('0x66')};}};exports[_0x931e('0x67')]=function(_0x323a92){var _0x1985e6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x1985e6[_0x931e('0x68')](_0x323a92))throw new db[(_0x931e('0x69'))][(_0x931e('0x6a'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');return;};exports[_0x931e('0x6b')]=function(_0x384166,_0x143d70,_0x235831){var _0x21d2ea=encryptor[_0x931e('0x6c')](_0x143d70)[_0x931e('0x6d')](',');for(var _0xb1ab6b=0x0;_0xb1ab6b<_0x235831;_0xb1ab6b++){if(!_0x21d2ea[_0xb1ab6b])break;if(_0x384166[_0x931e('0x6e')]()===_0x21d2ea[_0xb1ab6b][_0x931e('0x6e')]()){var _0x3d9ea5=util[_0x931e('0x6f')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x235831);if(_0x235831===0x1){_0x3d9ea5=_0x931e('0x70');}throw new db[(_0x931e('0x69'))][(_0x931e('0x6a'))](_0x3d9ea5);}}return;};exports['updatePasswordsHistory']=function(_0x3f9dfa,_0x457911){var _0x1295ec=_0x457911?encryptor[_0x931e('0x6c')](_0x457911)[_0x931e('0x6d')](','):[];if(_0x1295ec[_0x931e('0x71')]===0x5){_0x1295ec[_0x931e('0x72')](-0x1,0x1);}_0x1295ec[_0x931e('0x73')](_0x3f9dfa);return encryptor[_0x931e('0x74')](_0x1295ec[_0x931e('0x75')](','));};function signJwt(_0xaafa9b){var _0x40781f=BPromise[_0x931e('0x76')](jwt[_0x931e('0x77')],{'context':jwt});var _0x4ac1f7=_0xaafa9b[_0x931e('0x78')]||config[_0x931e('0xc')][_0x931e('0xd')];return new BPromise(function(_0x5f00f0,_0x29216f){_0x40781f(_0xaafa9b['payload'],_0x4ac1f7,_0xaafa9b['options'])[_0x931e('0x34')](function(_0x25d9bb){_0x5f00f0(_0x25d9bb);})[_0x931e('0x39')](function(_0x513443){_0x29216f(_0x513443);});});}function verifyJwt(_0x1f9481,_0x100cd7,_0x3ca499){var _0x1b0f36=BPromise['promisify'](jwt[_0x931e('0x79')],{'context':jwt});var _0x130920=_0x3ca499||config[_0x931e('0xc')]['session'];return new BPromise(function(_0x3b6520,_0x20bd41){_0x1b0f36(_0x1f9481,_0x130920,_0x100cd7)['then'](function(_0x587930){_0x3b6520(_0x587930);})['catch'](function(_0x1a8dae){_0x20bd41(_0x1a8dae);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0x931e('0x7a')](_0x931e('0x7b'));}function generateIssuedAt(){return Math['floor'](Date[_0x931e('0x7c')]()/0x3e8)[_0x931e('0x7a')]();}function createJwt(_0x167279){var _0x13a6ef={'payload':{'iat':_0x167279['apiKeyIat'],'nonce':_0x167279[_0x931e('0x4f')]},'options':{'algorithm':_0x931e('0x7d'),'subject':_0x167279['id'][_0x931e('0x7a')](),'issuer':hardwareConf[_0x931e('0x46')](),'audience':hardwareConf[_0x931e('0x46')]()}};return signJwt(_0x13a6ef)[_0x931e('0x34')](function(_0xf78026){return{'iat':_0x167279[_0x931e('0x65')],'nonce':_0x167279[_0x931e('0x4f')],'token':_0xf78026};});} \ No newline at end of file +var _0x5cf3=['disposition','then','unmanaged','json','Unmanaged.','Forbidden.','catch','isAuthenticated','headers','startsWith','Basic','User','find','name','pass','status','Wrong\x20credentials.','Bearer','query','apikey','getUuid','Setting','allowedLoginAttempts','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockDuration','blockedAt','add','minutes','Unknown\x20authorization\x20format','user','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','Forbidden','webrtc','isMiddleware','signToken','cookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','apiKeyNonce','regenerateApiKey','test','Sequelize','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','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','decryptString','length','unshift','encryptString','join','promisify','sign','secret','payload','options','verify','randomBytes','hex','floor','now','toString','../../mysqldb','../../config/license/hardware','../../config/license/util','../encryptor','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','util','secrets','session','role','fullname','internal','email','userpic','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','showWebBar','lastPauseAt','crudPermissions','allowmessenger','alias','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','ignorePauseForPreviewCalls','selectRecallMeCampaign','isChatInteractionAuthorized','use','params','closed'];(function(_0x2a3bde,_0x3f15b3){var _0x46f677=function(_0x5f0726){while(--_0x5f0726){_0x2a3bde['push'](_0x2a3bde['shift']());}};_0x46f677(++_0x3f15b3);}(_0x5cf3,0x1cc));var _0x35cf=function(_0x40c62b,_0x2c2efe){_0x40c62b=_0x40c62b-0x0;var _0x568cf0=_0x5cf3[_0x40c62b];return _0x568cf0;};'use strict';var db=require(_0x35cf('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require(_0x35cf('0x1'));var licenseUtil=require(_0x35cf('0x2'));var encryptor=require(_0x35cf('0x3'));var _=require('lodash');var jwt=require(_0x35cf('0x4'));var expressJwt=require(_0x35cf('0x5'));var compose=require(_0x35cf('0x6'));var basicAuth=require(_0x35cf('0x7'));var crypto=require(_0x35cf('0x8'));var BPromise=require(_0x35cf('0x9'));var util=require(_0x35cf('0xa'));var moment=require('moment');var validateJwt=expressJwt({'secret':config[_0x35cf('0xb')][_0x35cf('0xc')]});var userAttributes=['id',_0x35cf('0xd'),_0x35cf('0xe'),'name',_0x35cf('0xf'),_0x35cf('0x10'),_0x35cf('0x11'),'permissions',_0x35cf('0x12'),_0x35cf('0x13'),_0x35cf('0x14'),_0x35cf('0x15'),_0x35cf('0x16'),_0x35cf('0x17'),_0x35cf('0x18'),'pauseType',_0x35cf('0x19'),'lastLoginAt',_0x35cf('0x1a'),_0x35cf('0x1b'),_0x35cf('0x1c'),'passwordResetAt',_0x35cf('0x1d'),_0x35cf('0x1e'),'phoneBarAutoAnswerDelay',_0x35cf('0x1f'),_0x35cf('0x20'),_0x35cf('0x21'),_0x35cf('0x22'),_0x35cf('0x23'),_0x35cf('0x24'),_0x35cf('0x25'),_0x35cf('0x26'),_0x35cf('0x27'),_0x35cf('0x28'),_0x35cf('0x29'),_0x35cf('0x2a'),_0x35cf('0x2b'),_0x35cf('0x2c'),_0x35cf('0x2d'),'downloadOmnichannelInteractions','downloadAttachments',_0x35cf('0x2e'),_0x35cf('0x2f')];exports[_0x35cf('0x30')]=function(){return this['isAuthenticated'](!![])[_0x35cf('0x31')](function(_0x47f332,_0x59bcb7,_0x4d59c4){if(_0x47f332['user']){_0x4d59c4();}else{return db['ChatInteraction']['findOne']({'where':{'id':_0x47f332[_0x35cf('0x32')]['id']},'attributes':['id',_0x35cf('0x33'),_0x35cf('0x34')],'raw':!![]})[_0x35cf('0x35')](function(_0x2a0b15){if(_0x2a0b15&&_0x2a0b15[_0x35cf('0x33')]){return _0x59bcb7['status'](_0x2a0b15[_0x35cf('0x34')]===_0x35cf('0x36')?0x195:0x193)[_0x35cf('0x37')]({'message':_0x2a0b15[_0x35cf('0x34')]==='unmanaged'?_0x35cf('0x38'):_0x35cf('0x39')});}else{_0x4d59c4();}})[_0x35cf('0x3a')](function(_0x403abf){_0x4d59c4(_0x403abf);});}});};exports[_0x35cf('0x3b')]=function isAuthenticated(_0x4c8717){return compose()[_0x35cf('0x31')](function(_0x934e7,_0x4cf1c9,_0x38887b){var _0x5e34a1;if(_0x934e7[_0x35cf('0x3c')]['authorization']){if(_[_0x35cf('0x3d')](_0x934e7[_0x35cf('0x3c')]['authorization'],_0x35cf('0x3e'))){var _0x29cda8=basicAuth(_0x934e7);db[_0x35cf('0x3f')][_0x35cf('0x40')]({'where':{'name':_0x29cda8[_0x35cf('0x41')]}})[_0x35cf('0x35')](function(_0x376ad4){if(!_0x376ad4||!_0x376ad4['authenticate'](_0x29cda8[_0x35cf('0x42')])){return _0x4cf1c9[_0x35cf('0x43')](0x191)[_0x35cf('0x37')]({'message':_0x35cf('0x44')});}_0x934e7['user']={'id':_0x376ad4['id']};_0x38887b();})[_0x35cf('0x3a')](function(_0x5a51a3){_0x38887b(_0x5a51a3);});}else if(_[_0x35cf('0x3d')](_0x934e7['headers']['authorization'],_0x35cf('0x45'))){validateJwt(_0x934e7,_0x4cf1c9,_0x38887b);}else{if(_0x4c8717){_0x38887b();}else{return _0x4cf1c9['status'](0x193)['json']({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x934e7[_0x35cf('0x46')][_0x35cf('0x47')]){try{var _0x5269a9={'audience':hardwareConf[_0x35cf('0x48')](),'issuer':hardwareConf[_0x35cf('0x48')]()};verifyJwt(_0x934e7[_0x35cf('0x46')][_0x35cf('0x47')],_0x5269a9)[_0x35cf('0x35')](function(_0xd03cc8){return db[_0x35cf('0x3f')][_0x35cf('0x40')]({'where':{'id':_0xd03cc8['sub']}})[_0x35cf('0x35')](function(_0x53f896){_0x5e34a1=_0x53f896;return db[_0x35cf('0x49')]['findOne']({'where':{'id':0x1},'attributes':[_0x35cf('0x4a'),'blockDuration'],'raw':!![]});})[_0x35cf('0x35')](function(_0x5c96bb){if(!_0x5e34a1||!_['isEqual'](_0x5e34a1['apiKeyNonce'],_0xd03cc8['nonce'])){return _0x4cf1c9['status'](0x191)[_0x35cf('0x37')]({'message':_0x35cf('0x4b')});}if(_0x5e34a1[_0x35cf('0x4c')]){return _0x4cf1c9[_0x35cf('0x43')](0x191)[_0x35cf('0x37')]({'message':_0x35cf('0x4d')});}if(_0x5e34a1[_0x35cf('0x4e')]){if(_0x5c96bb[_0x35cf('0x4f')]>0x0){if(moment(_0x5e34a1[_0x35cf('0x50')])[_0x35cf('0x51')](_0x5c96bb[_0x35cf('0x4f')],_0x35cf('0x52'))>moment()){return _0x4cf1c9[_0x35cf('0x43')](0x191)[_0x35cf('0x37')]({'message':_0x35cf('0x4d')});}}else{return _0x4cf1c9[_0x35cf('0x43')](0x191)[_0x35cf('0x37')]({'message':'Invalid\x20API\x20access\x20key'});}}_0x934e7['user']={'id':_0x5e34a1['id']};_0x38887b();});})[_0x35cf('0x3a')](function(){return _0x4cf1c9[_0x35cf('0x43')](0x191)[_0x35cf('0x37')]({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x1010ee){_0x38887b(_0x1010ee);}}else if(_0x4c8717){_0x38887b();}else{return _0x4cf1c9[_0x35cf('0x43')](0x193)[_0x35cf('0x37')]({'message':_0x35cf('0x53')});}})['use'](function(_0x188d83,_0x2b476e,_0x47b8f){if(_0x188d83[_0x35cf('0x54')]){db[_0x35cf('0x3f')][_0x35cf('0x40')]({'where':{'id':_0x188d83[_0x35cf('0x54')]['id']},'attributes':userAttributes})['then'](function(_0x91bd54){if(!_0x91bd54){return _0x2b476e['status'](0x194)['json']({'message':_0x35cf('0x55')});}_0x188d83[_0x35cf('0x54')]=_0x91bd54;_0x47b8f();})[_0x35cf('0x3a')](function(_0x3b729e){_0x47b8f(_0x3b729e);});}else if(_0x4c8717){_0x47b8f();}else{return _0x2b476e[_0x35cf('0x43')](0x194)[_0x35cf('0x37')]({'message':_0x35cf('0x56')});}});};exports[_0x35cf('0x57')]=function canUpdate(){return compose()[_0x35cf('0x31')](function(_0x440ec2,_0x40c9b4,_0x433274){return licenseUtil[_0x35cf('0x58')]()[_0x35cf('0x35')](function(_0x4d88a8){if(_0x4d88a8['update']){_0x433274();}else{return _0x40c9b4[_0x35cf('0x43')](0x193)[_0x35cf('0x37')]({'message':_0x35cf('0x59')});}})[_0x35cf('0x3a')](function(_0x2ff72d){_0x433274(_0x2ff72d);});});};exports['isWebrtcLicence']=function isWebrtcLicence(){return compose()[_0x35cf('0x31')](function(_0x3bf4b2,_0x57f33d,_0x31425c){return licenseUtil[_0x35cf('0x58')]()[_0x35cf('0x35')](function(_0x593c87){if(_0x593c87[_0x35cf('0x5a')]){_0x31425c();}else{return _0x57f33d[_0x35cf('0x43')](0x193)[_0x35cf('0x37')]({'message':_0x35cf('0x59')});}})[_0x35cf('0x3a')](function(_0x16b969){_0x31425c(_0x16b969);});});};exports[_0x35cf('0x5b')]=function(_0x2f213a,_0x1e888b,_0x559066){_0x2f213a[_0x35cf('0x5b')]=!![];return _0x559066();};exports[_0x35cf('0x5c')]=function signToken(_0x1f91d4){return signJwt(_0x1f91d4);};exports['setTokenCookie']=function(_0x347d11,_0x5bdf4f){if(!_0x347d11[_0x35cf('0x54')]){return _0x5bdf4f['status'](0x194)[_0x35cf('0x37')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x58d41f={'payload':{'id':_0x347d11[_0x35cf('0x54')]['id'],'role':_0x347d11[_0x35cf('0x54')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x58d41f)[_0x35cf('0x35')](function(_0x3a4de2){_0x5bdf4f[_0x35cf('0x5d')](_0x35cf('0x5e'),_0x3a4de2);_0x5bdf4f[_0x35cf('0x5f')](_0x35cf('0x60'));})[_0x35cf('0x3a')](function(_0x1669e6){return _0x5bdf4f[_0x35cf('0x43')](0x1f4)[_0x35cf('0x61')](_0x1669e6);});};exports[_0x35cf('0x62')]=function(_0x324422){if(_[_0x35cf('0x63')](_0x324422['apiKeyNonce'])||_[_0x35cf('0x63')](_0x324422[_0x35cf('0x64')])){return null;}else{return createJwt(_0x324422);}};exports['generateApiKey']=function(_0x33fdf4){_0x33fdf4[_0x35cf('0x65')]=generateNonce();_0x33fdf4[_0x35cf('0x64')]=generateIssuedAt();return createJwt(_0x33fdf4);};exports[_0x35cf('0x66')]=function(_0x28748b,_0x17f930){var _0x40bdaa=_0x28748b[_0x35cf('0x46')]['apikey'];if(_0x40bdaa){var _0x4d0e4c={'nonce':_0x17f930[_0x35cf('0x65')],'iat':_0x17f930[_0x35cf('0x64')],'audience':hardwareConf[_0x35cf('0x48')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x40bdaa,_0x4d0e4c)['then'](function(){return generateApiKey(_0x17f930);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports['validatePasswordPattern']=function(_0x55b38d){var _0x163239=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x163239[_0x35cf('0x67')](_0x55b38d))throw new db[(_0x35cf('0x68'))]['ValidationError'](_0x35cf('0x69'));return;};exports[_0x35cf('0x6a')]=function(_0x2a3e99,_0x569e70,_0x500d9d){var _0x1efb96=encryptor['decryptString'](_0x569e70)[_0x35cf('0x6b')](',');for(var _0x54efa6=0x0;_0x54efa6<_0x500d9d;_0x54efa6++){if(!_0x1efb96[_0x54efa6])break;if(_0x2a3e99[_0x35cf('0x6c')]()===_0x1efb96[_0x54efa6][_0x35cf('0x6c')]()){var _0x53fbcb=util[_0x35cf('0x6d')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x500d9d);if(_0x500d9d===0x1){_0x53fbcb=_0x35cf('0x6e');}throw new db[(_0x35cf('0x68'))]['ValidationError'](_0x53fbcb);}}return;};exports[_0x35cf('0x6f')]=function(_0x3310bb,_0x4653ec){var _0x39f1be=_0x4653ec?encryptor[_0x35cf('0x70')](_0x4653ec)[_0x35cf('0x6b')](','):[];if(_0x39f1be[_0x35cf('0x71')]===0x5){_0x39f1be['splice'](-0x1,0x1);}_0x39f1be[_0x35cf('0x72')](_0x3310bb);return encryptor[_0x35cf('0x73')](_0x39f1be[_0x35cf('0x74')](','));};function signJwt(_0x588bc7){var _0x1bd194=BPromise[_0x35cf('0x75')](jwt[_0x35cf('0x76')],{'context':jwt});var _0x47b0fc=_0x588bc7[_0x35cf('0x77')]||config[_0x35cf('0xb')][_0x35cf('0xc')];return new BPromise(function(_0x30a620,_0x440361){_0x1bd194(_0x588bc7[_0x35cf('0x78')],_0x47b0fc,_0x588bc7[_0x35cf('0x79')])[_0x35cf('0x35')](function(_0x1472c1){_0x30a620(_0x1472c1);})[_0x35cf('0x3a')](function(_0x5c0979){_0x440361(_0x5c0979);});});}function verifyJwt(_0x2a0aa7,_0xf1bd58,_0xf6afc8){var _0x23732d=BPromise[_0x35cf('0x75')](jwt[_0x35cf('0x7a')],{'context':jwt});var _0x58ee36=_0xf6afc8||config[_0x35cf('0xb')][_0x35cf('0xc')];return new BPromise(function(_0xee7cf7,_0x295c58){_0x23732d(_0x2a0aa7,_0x58ee36,_0xf1bd58)[_0x35cf('0x35')](function(_0x3e5e11){_0xee7cf7(_0x3e5e11);})[_0x35cf('0x3a')](function(_0x31045f){_0x295c58(_0x31045f);});});}function generateNonce(){return crypto[_0x35cf('0x7b')](0x10)['toString'](_0x35cf('0x7c'));}function generateIssuedAt(){return Math[_0x35cf('0x7d')](Date[_0x35cf('0x7e')]()/0x3e8)[_0x35cf('0x7f')]();}function createJwt(_0xd5bac){var _0x519d00={'payload':{'iat':_0xd5bac[_0x35cf('0x64')],'nonce':_0xd5bac['apiKeyNonce']},'options':{'algorithm':'HS512','subject':_0xd5bac['id'][_0x35cf('0x7f')](),'issuer':hardwareConf[_0x35cf('0x48')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x519d00)[_0x35cf('0x35')](function(_0xc84a7a){return{'iat':_0xd5bac['apiKeyIat'],'nonce':_0xd5bac['apiKeyNonce'],'token':_0xc84a7a};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 7a14e36..427063a 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 _0xcd82=['data','encryptString','base64','decryptString','secret','createDecipher','utf8','crypto','bluebird','../../config/environment','../../config/logger','app','secrets','encrypt','algorithm','join','error','test','filter','indexOf','hasOwnProperty','encryptFile','createWriteStream','createCipher','update','binary','write','final','end','close','unlink','decryptFile','createReadStream'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xcd82,0x1b4));var _0x2cd8=function(_0x5d0327,_0x30fbe7){_0x5d0327=_0x5d0327-0x0;var _0x1f887c=_0xcd82[_0x5d0327];return _0x1f887c;};'use strict';var crypto=require(_0x2cd8('0x0'));var fs=require('fs');var BPromise=require(_0x2cd8('0x1'));var _=require('lodash');var config=require(_0x2cd8('0x2'));var logger=require(_0x2cd8('0x3'))(_0x2cd8('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x2cd8('0x5')]['session'],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':'aes192'};if(config[_0x2cd8('0x6')]&&config[_0x2cd8('0x6')]['algorithm']){var isSupported=isAlgorithmSupported(config[_0x2cd8('0x6')][_0x2cd8('0x7')]);if(isSupported){fileOptions[_0x2cd8('0x7')]=config[_0x2cd8('0x6')][_0x2cd8('0x7')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x2cd8('0x8')](',\x20');logger[_0x2cd8('0x9')](config['encrypt'][_0x2cd8('0x7')],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x5e8bf2){return AES_SUPPORTED_RX[_0x2cd8('0xa')](_0x5e8bf2);}function getSupportedCiphers(){return crypto['getCiphers']()[_0x2cd8('0xb')](isASupportedCipher);}function isAlgorithmSupported(_0x42a77f){return getSupportedCiphers()[_0x2cd8('0xc')](_0x42a77f)>-0x1;}function combineOptions(_0x5f3ea3){var _0x4de123={};for(var _0x4f0404 in fileOptions){if(fileOptions['hasOwnProperty'](_0x4f0404)){_0x4de123[_0x4f0404]=fileOptions[_0x4f0404];}}if(_0x5f3ea3){for(var _0x29a845 in _0x5f3ea3){if(_0x5f3ea3[_0x2cd8('0xd')](_0x29a845)){_0x4de123[_0x29a845]=_0x5f3ea3[_0x29a845];}}}return _0x4de123;}exports[_0x2cd8('0xe')]=function(_0x10ccb8,_0x8c48c9,_0x22e56c,_0x37309c){return new BPromise(function(_0xb39f14,_0x540b2e){_0x37309c=combineOptions(_0x37309c);var _0x118cee=new Buffer(_0x22e56c);var _0x40872d=fs['createReadStream'](_0x10ccb8);var _0x1906e8=fs[_0x2cd8('0xf')](_0x8c48c9);var _0x19f09d=crypto[_0x2cd8('0x10')](_0x37309c[_0x2cd8('0x7')],_0x118cee);_0x40872d['on']('data',function(_0x36b9e1){var _0x77ca57=new Buffer(_0x19f09d[_0x2cd8('0x11')](_0x36b9e1),_0x2cd8('0x12'));_0x1906e8[_0x2cd8('0x13')](_0x77ca57);});_0x40872d['on']('end',function(){try{var _0x17c742=new Buffer(_0x19f09d[_0x2cd8('0x14')](_0x2cd8('0x12')),_0x2cd8('0x12'));_0x1906e8['write'](_0x17c742);_0x1906e8[_0x2cd8('0x15')]();_0x1906e8['on'](_0x2cd8('0x16'),function(){return _0xb39f14(_0x8c48c9);});}catch(_0x1384b8){fs[_0x2cd8('0x17')](_0x8c48c9);return _0x540b2e(_0x1384b8);}});});};exports[_0x2cd8('0x18')]=function(_0x224f03,_0x3cfd15,_0x42eeb8,_0x1ef539){return new BPromise(function(_0x451716,_0x85eb3b){_0x1ef539=combineOptions(_0x1ef539);var _0x1be8c0=new Buffer(_0x42eeb8);var _0x3eee14=fs[_0x2cd8('0x19')](_0x224f03);var _0x3155a1=fs[_0x2cd8('0xf')](_0x3cfd15);var _0x5b8448=crypto['createDecipher'](_0x1ef539[_0x2cd8('0x7')],_0x1be8c0);_0x3eee14['on'](_0x2cd8('0x1a'),function(_0x13eb3a){var _0x858703=new Buffer(_0x5b8448[_0x2cd8('0x11')](_0x13eb3a),'binary');_0x3155a1[_0x2cd8('0x13')](_0x858703);});_0x3eee14['on'](_0x2cd8('0x15'),function(){try{var _0x1d7a84=new Buffer(_0x5b8448[_0x2cd8('0x14')](_0x2cd8('0x12')),_0x2cd8('0x12'));_0x3155a1[_0x2cd8('0x13')](_0x1d7a84);_0x3155a1[_0x2cd8('0x15')]();_0x3155a1['on'](_0x2cd8('0x16'),function(){return _0x451716(_0x3cfd15);});}catch(_0x27d2dc){fs[_0x2cd8('0x17')](_0x3cfd15);return _0x85eb3b(_0x27d2dc);}});});};exports[_0x2cd8('0x1b')]=function(_0x4b343e,_0x356fbe,_0x2e1839){var _0x306eb9=_0x2e1839||stringOptions[_0x2cd8('0x7')];var _0x164a92=_0x356fbe||stringOptions['secret'];var _0x2e88a0=crypto[_0x2cd8('0x10')](_0x306eb9,_0x164a92);var _0x1ed1ba=_0x2e88a0[_0x2cd8('0x11')](_0x4b343e,'utf8',_0x2cd8('0x1c'));_0x1ed1ba+=_0x2e88a0[_0x2cd8('0x14')](_0x2cd8('0x1c'));return _0x1ed1ba;};exports[_0x2cd8('0x1d')]=function(_0x4a387d,_0x6f9c4d,_0x5770fc){var _0x2aff9e=_0x5770fc||stringOptions['algorithm'];var _0x562641=_0x6f9c4d||stringOptions[_0x2cd8('0x1e')];var _0x31f374=crypto[_0x2cd8('0x1f')](_0x2aff9e,_0x562641);var _0x5ae72e=_0x31f374[_0x2cd8('0x11')](_0x4a387d,'base64',_0x2cd8('0x20'));_0x5ae72e+=_0x31f374['final']('utf8');return _0x5ae72e;}; \ No newline at end of file +var _0x696e=['binary','end','final','write','unlink','createDecipher','data','close','encryptString','secret','utf8','base64','decryptString','crypto','bluebird','lodash','../../config/environment','../../config/logger','app','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','update'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x696e,0xc1));var _0xe696=function(_0x377b0f,_0x3d3080){_0x377b0f=_0x377b0f-0x0;var _0x5a6989=_0x696e[_0x377b0f];return _0x5a6989;};'use strict';var crypto=require(_0xe696('0x0'));var fs=require('fs');var BPromise=require(_0xe696('0x1'));var _=require(_0xe696('0x2'));var config=require(_0xe696('0x3'));var logger=require(_0xe696('0x4'))(_0xe696('0x5'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0xe696('0x6')],'algorithm':_0xe696('0x7')};const fileOptions={'algorithm':_0xe696('0x8')};if(config[_0xe696('0x9')]&&config[_0xe696('0x9')][_0xe696('0xa')]){var isSupported=isAlgorithmSupported(config[_0xe696('0x9')][_0xe696('0xa')]);if(isSupported){fileOptions[_0xe696('0xa')]=config[_0xe696('0x9')][_0xe696('0xa')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xe696('0xb')](',\x20');logger[_0xe696('0xc')](config[_0xe696('0x9')][_0xe696('0xa')],_0xe696('0xd'),supportedAlgorithms);}}function isASupportedCipher(_0x5123a4){return AES_SUPPORTED_RX[_0xe696('0xe')](_0x5123a4);}function getSupportedCiphers(){return crypto[_0xe696('0xf')]()[_0xe696('0x10')](isASupportedCipher);}function isAlgorithmSupported(_0x264b15){return getSupportedCiphers()['indexOf'](_0x264b15)>-0x1;}function combineOptions(_0x907ae8){var _0x2ab305={};for(var _0x2091d8 in fileOptions){if(fileOptions['hasOwnProperty'](_0x2091d8)){_0x2ab305[_0x2091d8]=fileOptions[_0x2091d8];}}if(_0x907ae8){for(var _0x235a0f in _0x907ae8){if(_0x907ae8[_0xe696('0x11')](_0x235a0f)){_0x2ab305[_0x235a0f]=_0x907ae8[_0x235a0f];}}}return _0x2ab305;}exports[_0xe696('0x12')]=function(_0x217aa8,_0x2af710,_0x5edbe7,_0xb32a02){return new BPromise(function(_0x4eca15,_0x4b163d){_0xb32a02=combineOptions(_0xb32a02);var _0x3baf90=new Buffer(_0x5edbe7);var _0x490f6a=fs[_0xe696('0x13')](_0x217aa8);var _0x4692ac=fs[_0xe696('0x14')](_0x2af710);var _0x2c8015=crypto[_0xe696('0x15')](_0xb32a02[_0xe696('0xa')],_0x3baf90);_0x490f6a['on']('data',function(_0x4b4c5e){var _0x2d050a=new Buffer(_0x2c8015[_0xe696('0x16')](_0x4b4c5e),_0xe696('0x17'));_0x4692ac['write'](_0x2d050a);});_0x490f6a['on'](_0xe696('0x18'),function(){try{var _0x296e8f=new Buffer(_0x2c8015[_0xe696('0x19')](_0xe696('0x17')),_0xe696('0x17'));_0x4692ac[_0xe696('0x1a')](_0x296e8f);_0x4692ac[_0xe696('0x18')]();_0x4692ac['on']('close',function(){return _0x4eca15(_0x2af710);});}catch(_0x532f14){fs[_0xe696('0x1b')](_0x2af710);return _0x4b163d(_0x532f14);}});});};exports['decryptFile']=function(_0x38e34f,_0xeb2c3,_0x4750e5,_0x12b12f){return new BPromise(function(_0xb8adfc,_0x2afdf4){_0x12b12f=combineOptions(_0x12b12f);var _0x3fb12d=new Buffer(_0x4750e5);var _0x4c88e0=fs[_0xe696('0x13')](_0x38e34f);var _0x1db25e=fs[_0xe696('0x14')](_0xeb2c3);var _0x2356df=crypto[_0xe696('0x1c')](_0x12b12f[_0xe696('0xa')],_0x3fb12d);_0x4c88e0['on'](_0xe696('0x1d'),function(_0xe312e){var _0x51f33f=new Buffer(_0x2356df[_0xe696('0x16')](_0xe312e),_0xe696('0x17'));_0x1db25e[_0xe696('0x1a')](_0x51f33f);});_0x4c88e0['on'](_0xe696('0x18'),function(){try{var _0x3b3c2a=new Buffer(_0x2356df[_0xe696('0x19')](_0xe696('0x17')),'binary');_0x1db25e[_0xe696('0x1a')](_0x3b3c2a);_0x1db25e[_0xe696('0x18')]();_0x1db25e['on'](_0xe696('0x1e'),function(){return _0xb8adfc(_0xeb2c3);});}catch(_0x32ce84){fs[_0xe696('0x1b')](_0xeb2c3);return _0x2afdf4(_0x32ce84);}});});};exports[_0xe696('0x1f')]=function(_0x1b7f9e,_0x2f3f09,_0x3f4718){var _0x237ae0=_0x3f4718||stringOptions['algorithm'];var _0x5e4b81=_0x2f3f09||stringOptions[_0xe696('0x20')];var _0x24f5ec=crypto[_0xe696('0x15')](_0x237ae0,_0x5e4b81);var _0x3806f0=_0x24f5ec[_0xe696('0x16')](_0x1b7f9e,_0xe696('0x21'),_0xe696('0x22'));_0x3806f0+=_0x24f5ec[_0xe696('0x19')]('base64');return _0x3806f0;};exports[_0xe696('0x23')]=function(_0xbc224,_0xe4c9fb,_0x51634c){var _0x104cb5=_0x51634c||stringOptions[_0xe696('0xa')];var _0x5dd3f4=_0xe4c9fb||stringOptions[_0xe696('0x20')];var _0xaa67c=crypto['createDecipher'](_0x104cb5,_0x5dd3f4);var _0x38f8ff=_0xaa67c['update'](_0xbc224,'base64','utf8');_0x38f8ff+=_0xaa67c[_0xe696('0x19')](_0xe696('0x21'));return _0x38f8ff;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 5aa4fb8..79a7f91 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 _0xa55d=['analytics','argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','splitSizeCsv','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','isInteger','forEach','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','push','basename','.csv','length','join','csv','%s.%s','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','util','path','lodash','to-csv','bluebird','rimraf','../../mysqldb','dbH','../../config/logger'];(function(_0x17d389,_0x2f85bf){var _0x28a0c4=function(_0x16d20d){while(--_0x16d20d){_0x17d389['push'](_0x17d389['shift']());}};_0x28a0c4(++_0x2f85bf);}(_0xa55d,0x17f));var _0xda55=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xa55d[_0x3b380d];return _0x54502b;};'use strict';var util=require(_0xda55('0x0'));var path=require(_0xda55('0x1'));var _=require(_0xda55('0x2'));var csv=require(_0xda55('0x3'));var fs=require('fs');var BPromise=require(_0xda55('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0xda55('0x5'));var db=require('../../mysqldb')['db'];var dbH=require(_0xda55('0x6'))[_0xda55('0x7')];var logger=require(_0xda55('0x8'))(_0xda55('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0xda55('0xa')][0x2]);var QUERY=process[_0xda55('0xa')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x5217bd,_0x340cfb){var _0x5d85a7={'status':_0x5217bd};var _0x5ca710={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x340cfb){_0x5d85a7[_0xda55('0xb')]=_0x340cfb;}return db['AnalyticExtractedReport'][_0xda55('0xc')](_0x5d85a7,_0x5ca710);}function main(){var _0x53eccc=0x1388;var _0x30affb;logger[_0xda55('0xd')](util[_0xda55('0xe')](_0xda55('0xf'),EXTRACTED_REPORT_ID,'CSV'));return db[_0xda55('0x10')][_0xda55('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xda55('0x12'),_0xda55('0x13')]})[_0xda55('0x14')](function(_0x516a7c){if(_0x516a7c){_0x30affb=_0x516a7c;_0x53eccc=_0x30affb['splitSizeCsv']||0x1388;}})[_0xda55('0x14')](function(){return dbH['sequelize'][_0xda55('0x15')](util[_0xda55('0xe')](_0xda55('0x16'),QUERY),{'type':dbH['sequelize'][_0xda55('0x17')][_0xda55('0x18')]});})[_0xda55('0x14')](function(_0x387050){if(!_0x387050[0x0][_0xda55('0x19')]){return analyticExtractedReport(_0xda55('0x1a'));}var _0x485fe6=[];var _0x30f7d6=0x0;if(_0x30affb[_0xda55('0x12')]){if(_0x387050&&_0x387050['length']){var _0xb4f756=_['range'](_0x387050[0x0]['num']/_0x53eccc);var _0x23400f=Number[_0xda55('0x1b')](_0x387050[0x0][_0xda55('0x19')]/_0x53eccc)?_0x387050[0x0][_0xda55('0x19')]%_0x53eccc:0x0;_0xb4f756[_0xda55('0x1c')](function(_0x422c46){if(_0x422c46>0x0){_0x30f7d6+=_0x53eccc;}_0x485fe6['push'](dbH[_0xda55('0x1d')]['query'](util['format'](_0xda55('0x1e'),QUERY,_0x53eccc,_0x30f7d6),{'type':dbH[_0xda55('0x1d')][_0xda55('0x17')][_0xda55('0x18')]}));});if(_0x23400f>0x0){_0x30f7d6+=_0x53eccc;_0x485fe6['push'](dbH['sequelize'][_0xda55('0x15')](util[_0xda55('0xe')](_0xda55('0x1e'),QUERY,_0x23400f,_0x30f7d6),{'type':dbH[_0xda55('0x1d')][_0xda55('0x17')][_0xda55('0x18')]}));}}}else{_0x485fe6[_0xda55('0x1f')](dbH['sequelize'][_0xda55('0x15')](QUERY,{'type':dbH['sequelize'][_0xda55('0x17')][_0xda55('0x18')]}));}var _0x592e2a=path['dirname'](PATH);var _0x4ec143=path[_0xda55('0x20')](PATH,_0xda55('0x21'));var _0x26edab=_0x30affb['split']&&_0x485fe6[_0xda55('0x22')]>0x1;var _0x5e5453=[];if(!fs['existsSync'](path[_0xda55('0x23')](_0x592e2a,_0x4ec143))&&_0x26edab){fs['mkdirSync'](path['join'](_0x592e2a,_0x4ec143));}return BPromise['each'](_0x485fe6,function(_0x1f1bf4){_0x5e5453['push'](_0x1f1bf4);})['then'](function(){for(var _0x39e784=0x0;_0x39e784<_0x5e5453[_0xda55('0x22')];_0x39e784+=0x1){var _0x1fe30c;var _0x521a15=_0x5e5453[_0x39e784];if(_0x26edab){_0x1fe30c=path[_0xda55('0x23')](_0x592e2a,_0x4ec143,util['format']('%s%d.%s',_0x4ec143,_0x39e784,_0xda55('0x24')));}else{_0x1fe30c=path[_0xda55('0x23')](_0x592e2a,util['format'](_0xda55('0x25'),_0x4ec143,'csv'));}fs[_0xda55('0x26')](_0x1fe30c,csv(_0x521a15));}})['then'](function(){if(_0x26edab){return new Promise(function(_0x40badf){zipdir(path[_0xda55('0x23')](_0x592e2a,_0x4ec143),{'saveTo':path['join'](_0x592e2a,util['format']('%s.%s',_0x4ec143,_0xda55('0x27')))},function(_0x1ceba9,_0x53e892){rimraf(path[_0xda55('0x23')](_0x592e2a,_0x4ec143),function(){});_0x40badf(_0xda55('0x28'));});});}})[_0xda55('0x14')](function(){logger[_0xda55('0xd')](util[_0xda55('0xe')](_0xda55('0x29'),EXTRACTED_REPORT_ID,_0xda55('0x2a')));return analyticExtractedReport(_0xda55('0x2b'),_0x26edab?util[_0xda55('0xe')](_0xda55('0x25'),_0x4ec143,_0x26edab?_0xda55('0x27'):_0xda55('0x24')):null);});})[_0xda55('0x2c')](function(_0x53b214){logger[_0xda55('0xd')](util[_0xda55('0xe')](_0xda55('0x2d'),EXTRACTED_REPORT_ID,'CSV'),util[_0xda55('0x2e')](_0x53b214,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xda55('0x2f'));})[_0xda55('0x30')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0x4413=['.csv','existsSync','mkdirSync','join','each','%s%d.%s','%s.%s','csv','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','catch','inspect','Failed','finally','exit','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','../../config/logger','argv','savename','AnalyticExtractedReport','info','format','Setting','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','Empty','length','range','num','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename'];(function(_0x3c62d6,_0x5d3a6c){var _0xd96a84=function(_0x3d7ca8){while(--_0x3d7ca8){_0x3c62d6['push'](_0x3c62d6['shift']());}};_0xd96a84(++_0x5d3a6c);}(_0x4413,0x17f));var _0x3441=function(_0x41a14f,_0x46e4c7){_0x41a14f=_0x41a14f-0x0;var _0x2495ae=_0x4413[_0x41a14f];return _0x2495ae;};'use strict';var util=require(_0x3441('0x0'));var path=require(_0x3441('0x1'));var _=require(_0x3441('0x2'));var csv=require(_0x3441('0x3'));var fs=require('fs');var BPromise=require(_0x3441('0x4'));var zipdir=require(_0x3441('0x5'));var rimraf=require(_0x3441('0x6'));var db=require(_0x3441('0x7'))['db'];var dbH=require(_0x3441('0x7'))['dbH'];var logger=require(_0x3441('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x3441('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x26e1ae,_0x413b28){var _0x37245e={'status':_0x26e1ae};var _0x5d2ae1={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x413b28){_0x37245e[_0x3441('0xa')]=_0x413b28;}return db[_0x3441('0xb')]['update'](_0x37245e,_0x5d2ae1);}function main(){var _0x46a306=0x1388;var _0x4fa9db;logger[_0x3441('0xc')](util[_0x3441('0xd')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'CSV'));return db[_0x3441('0xe')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x3441('0xf'),_0x3441('0x10')]})[_0x3441('0x11')](function(_0x2be1bb){if(_0x2be1bb){_0x4fa9db=_0x2be1bb;_0x46a306=_0x4fa9db[_0x3441('0x10')]||0x1388;}})[_0x3441('0x11')](function(){return dbH[_0x3441('0x12')][_0x3441('0x13')](util[_0x3441('0xd')](_0x3441('0x14'),QUERY),{'type':dbH[_0x3441('0x12')][_0x3441('0x15')][_0x3441('0x16')]});})[_0x3441('0x11')](function(_0x2a63ac){if(!_0x2a63ac[0x0]['num']){return analyticExtractedReport(_0x3441('0x17'));}var _0x1fc596=[];var _0x36c1b9=0x0;if(_0x4fa9db[_0x3441('0xf')]){if(_0x2a63ac&&_0x2a63ac[_0x3441('0x18')]){var _0x27120d=_[_0x3441('0x19')](_0x2a63ac[0x0][_0x3441('0x1a')]/_0x46a306);var _0x293bdf=Number[_0x3441('0x1b')](_0x2a63ac[0x0]['num']/_0x46a306)?_0x2a63ac[0x0][_0x3441('0x1a')]%_0x46a306:0x0;_0x27120d[_0x3441('0x1c')](function(_0x4d9da5){if(_0x4d9da5>0x0){_0x36c1b9+=_0x46a306;}_0x1fc596[_0x3441('0x1d')](dbH[_0x3441('0x12')][_0x3441('0x13')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x46a306,_0x36c1b9),{'type':dbH[_0x3441('0x12')]['QueryTypes']['SELECT']}));});if(_0x293bdf>0x0){_0x36c1b9+=_0x46a306;_0x1fc596[_0x3441('0x1d')](dbH['sequelize'][_0x3441('0x13')](util[_0x3441('0xd')](_0x3441('0x1e'),QUERY,_0x293bdf,_0x36c1b9),{'type':dbH[_0x3441('0x12')][_0x3441('0x15')][_0x3441('0x16')]}));}}}else{_0x1fc596['push'](dbH['sequelize'][_0x3441('0x13')](QUERY,{'type':dbH[_0x3441('0x12')][_0x3441('0x15')][_0x3441('0x16')]}));}var _0x3c012b=path[_0x3441('0x1f')](PATH);var _0x294bfc=path[_0x3441('0x20')](PATH,_0x3441('0x21'));var _0x3a7617=_0x4fa9db['split']&&_0x1fc596[_0x3441('0x18')]>0x1;var _0x5697d5=[];if(!fs[_0x3441('0x22')](path['join'](_0x3c012b,_0x294bfc))&&_0x3a7617){fs[_0x3441('0x23')](path[_0x3441('0x24')](_0x3c012b,_0x294bfc));}return BPromise[_0x3441('0x25')](_0x1fc596,function(_0x2e9d81){_0x5697d5[_0x3441('0x1d')](_0x2e9d81);})[_0x3441('0x11')](function(){for(var _0x188366=0x0;_0x188366<_0x5697d5[_0x3441('0x18')];_0x188366+=0x1){var _0x5f5dd2;var _0x1994e1=_0x5697d5[_0x188366];if(_0x3a7617){_0x5f5dd2=path[_0x3441('0x24')](_0x3c012b,_0x294bfc,util[_0x3441('0xd')](_0x3441('0x26'),_0x294bfc,_0x188366,'csv'));}else{_0x5f5dd2=path['join'](_0x3c012b,util[_0x3441('0xd')](_0x3441('0x27'),_0x294bfc,_0x3441('0x28')));}fs[_0x3441('0x29')](_0x5f5dd2,csv(_0x1994e1));}})['then'](function(){if(_0x3a7617){return new Promise(function(_0x5c9970){zipdir(path[_0x3441('0x24')](_0x3c012b,_0x294bfc),{'saveTo':path[_0x3441('0x24')](_0x3c012b,util[_0x3441('0xd')]('%s.%s',_0x294bfc,_0x3441('0x2a')))},function(_0x29817f,_0x45d0ea){rimraf(path[_0x3441('0x24')](_0x3c012b,_0x294bfc),function(){});_0x5c9970(_0x3441('0x2b'));});});}})['then'](function(){logger['info'](util[_0x3441('0xd')](_0x3441('0x2c'),EXTRACTED_REPORT_ID,_0x3441('0x2d')));return analyticExtractedReport(_0x3441('0x2e'),_0x3a7617?util['format'](_0x3441('0x27'),_0x294bfc,_0x3a7617?'zip':_0x3441('0x28')):null);});})[_0x3441('0x2f')](function(_0x1fe553){logger[_0x3441('0xc')](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x3441('0x2d')),util[_0x3441('0x30')](_0x1fe553,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x3441('0x31'));})[_0x3441('0x32')](function(){process[_0x3441('0x33')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index f4298ed..258fe97 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 _0xbecc=['%s\x20#%d','channel','Arial','center','Interaction\x20Transcript','header','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','util','path','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','JSDOM','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','tableHeader','pick','toString','value','length','body','push','concat','chunk','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','before','margin','landscape','\x20/\x20','footer','num','Empty','find','split','splitSizePdf','range','isInteger','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','query','dirname','basename','.pdf','existsSync','mkdirSync','each','flatten','pdf','join','%s.%s','zip','zip\x20finished','then','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf'];(function(_0x16337a,_0x4789a1){var _0x422365=function(_0x34f039){while(--_0x34f039){_0x16337a['push'](_0x16337a['shift']());}};_0x422365(++_0x4789a1);}(_0xbecc,0xbf));var _0xcbec=function(_0x5d40df,_0x49d06b){_0x5d40df=_0x5d40df-0x0;var _0x2ddfdb=_0xbecc[_0x5d40df];return _0x2ddfdb;};'use strict';var _=require('lodash');var fs=require('fs');var util=require(_0xcbec('0x0'));var path=require(_0xcbec('0x1'));var moment=require('moment');var htmlToPdfmake=require(_0xcbec('0x2'));var PdfPrinter=require(_0xcbec('0x3'));var zipdir=require(_0xcbec('0x4'));var rimraf=require(_0xcbec('0x5'));var JSDOM=require('jsdom')[_0xcbec('0x6')];var window=new JSDOM('')['window'];var BPromise=require(_0xcbec('0x7'));var db=require('../../mysqldb')['db'];var dbH=require(_0xcbec('0x8'))[_0xcbec('0x9')];var logger=require(_0xcbec('0xa'))(_0xcbec('0xb'));var EXTRACTED_REPORT_ID=Number(process[_0xcbec('0xc')][0x2]);var QUERY=process[_0xcbec('0xc')][0x3];var PATH=process[_0xcbec('0xc')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0xcbec('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0xa425cb,_0xeb5d67){var _0x3fb699={'status':_0xa425cb};var _0x1990b3={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xeb5d67){_0x3fb699[_0xcbec('0xe')]=_0xeb5d67;}return db[_0xcbec('0xf')][_0xcbec('0x10')](_0x3fb699,_0x1990b3);}function getHeaders(_0x4db8ee){return _[_0xcbec('0x11')](_0x4db8ee,function(_0x55f70f){return{'text':_0x55f70f,'style':_0xcbec('0x12')};});}function getRows(_0x1e4e9f,_0x3133b6){return _['map'](_0x3133b6,function(_0x487246){return _(_0x487246)[_0xcbec('0x13')](_0x1e4e9f)[_0xcbec('0x11')](function(_0x27cf56){return _0x27cf56?_[_0xcbec('0x14')](_0x27cf56):'';})[_0xcbec('0x15')]();});}function createTable(_0x380917,_0x202150){var _0x14b0ee={'widths':_['fill'](Array(_0x380917[_0xcbec('0x16')]),0x91),'heights':function(_0x47ae22){return _0x47ae22===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x449302=getHeaders(_0x380917);_0x14b0ee[_0xcbec('0x17')][_0xcbec('0x18')](_0x449302);var _0x2fb7db=getRows(_0x380917,_0x202150);_0x14b0ee[_0xcbec('0x17')]=_0x14b0ee[_0xcbec('0x17')][_0xcbec('0x19')](_0x2fb7db);return _0x14b0ee;}function createTables(_0x210d49){var _0x549f9d=[];var _0x55c381=_[_0xcbec('0x1a')](Object[_0xcbec('0x1b')](_0x210d49[0x0]),0x5);_0x55c381[_0xcbec('0x1c')](function(_0x3d81ed){_0x549f9d[_0xcbec('0x18')](createTable(_0x3d81ed,_0x210d49));});return _0x549f9d;}function getPDFDocDefinition(_0xe1da83){var _0x3c4d6b=util[_0xcbec('0x1d')](_0xcbec('0x1e'),NAME,EXTRACTED_REPORT[_0xcbec('0x1f')],moment(EXTRACTED_REPORT[_0xcbec('0x20')])[_0xcbec('0x1d')](FORMAT),moment(EXTRACTED_REPORT[_0xcbec('0x21')])[_0xcbec('0x1d')](FORMAT));var _0x3a5e84=[];for(var _0xf5b565=0x0;_0xf5b565<_0xe1da83['length'];_0xf5b565++){var _0x585033=[];if(_0xf5b565===0x0){_0x585033[_0xcbec('0x18')]({'text':_0x3c4d6b,'style':'header'});}var _0xf03ec1={'table':_0xe1da83[_0xf5b565]};if(_0xf5b565>0x0){_0xf03ec1['pageBreak']=_0xcbec('0x22');_0xf03ec1[_0xcbec('0x23')]=[0x0,0x46,0x0,0x0];}_0x585033[_0xcbec('0x18')](_0xf03ec1);_0x3a5e84[_0xcbec('0x18')](_0x585033);}return{'pageSize':'A4','pageOrientation':_0xcbec('0x24'),'content':_0x3a5e84,'footer':function(_0x1bb740,_0x5dece9){return{'text':_0x1bb740[_0xcbec('0x14')]()+_0xcbec('0x25')+_0x5dece9,'style':_0xcbec('0x26')};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x23dd87){var _0x2f3471=0x1388;var _0x35fb51;if(!_0x23dd87[0x0][_0xcbec('0x27')]){return analyticExtractedReport(_0xcbec('0x28'));}return db['Setting'][_0xcbec('0x29')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xcbec('0x2a'),'splitSizePdf']})['then'](function(_0x4d62fd){if(_0x4d62fd){_0x35fb51=_0x4d62fd;_0x2f3471=_0x35fb51[_0xcbec('0x2b')]||0x3e8;}})['then'](function(){var _0x5bdff3=[];var _0x541a89=0x0;if(_0x35fb51['split']){if(_0x23dd87&&_0x23dd87[_0xcbec('0x16')]){var _0x11b837=_[_0xcbec('0x2c')](_0x23dd87[0x0][_0xcbec('0x27')]/_0x2f3471);var _0x7f684=Number[_0xcbec('0x2d')](_0x23dd87[0x0][_0xcbec('0x27')]/_0x2f3471)?_0x23dd87[0x0][_0xcbec('0x27')]%_0x2f3471:0x0;_0x11b837[_0xcbec('0x1c')](function(_0x4da475){if(_0x4da475>0x0){_0x541a89+=_0x2f3471;}_0x5bdff3[_0xcbec('0x18')](dbH[_0xcbec('0x2e')]['query'](util['format'](_0xcbec('0x2f'),QUERY,_0x2f3471,_0x541a89),{'type':dbH['sequelize'][_0xcbec('0x30')][_0xcbec('0x31')]}));});if(_0x7f684>0x0){_0x541a89+=_0x2f3471;_0x5bdff3[_0xcbec('0x18')](dbH[_0xcbec('0x2e')]['query'](util[_0xcbec('0x1d')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x7f684,_0x541a89),{'type':dbH[_0xcbec('0x2e')][_0xcbec('0x30')][_0xcbec('0x31')]}));}}}else{_0x5bdff3['push'](dbH['sequelize'][_0xcbec('0x32')](QUERY,{'type':dbH['sequelize'][_0xcbec('0x30')][_0xcbec('0x31')]}));}var _0x311895=path[_0xcbec('0x33')](PATH);var _0x1d39eb=path[_0xcbec('0x34')](PATH,_0xcbec('0x35'));var _0x411554=_0x35fb51['split']&&_0x5bdff3[_0xcbec('0x16')]>0x1;var _0x5dbd2a=[];if(!fs[_0xcbec('0x36')](path['join'](_0x311895,_0x1d39eb))&&_0x411554){fs[_0xcbec('0x37')](path['join'](_0x311895,_0x1d39eb));}return BPromise[_0xcbec('0x38')](_0x5bdff3,function(_0x2c51ce){_0x5dbd2a['push'](_0x2c51ce);})['then'](function(){var _0x21fccb=[];for(var _0x34afd7=0x0;_0x34afd7<_0x5dbd2a[_0xcbec('0x16')];_0x34afd7+=0x1){var _0x1c316b=_0x5dbd2a[_0x34afd7];var _0x56e27e=createTables(_[_0xcbec('0x39')](_0x1c316b));var _0x2e658a;var _0xf6b202=getPDFDocDefinition(_0x56e27e);var _0xfc0a77=getPDFPrinter();var _0x23bcbf=_0xfc0a77['createPdfKitDocument'](_0xf6b202);if(_0x411554){_0x2e658a=path['join'](_0x311895,_0x1d39eb,util['format']('%s%d.%s',_0x1d39eb,_0x34afd7,_0xcbec('0x3a')));}else{_0x2e658a=path[_0xcbec('0x3b')](_0x311895,util[_0xcbec('0x1d')](_0xcbec('0x3c'),_0x1d39eb,_0xcbec('0x3a')));}_0x21fccb['push'](writePDFDocument(_0x23bcbf,_0x2e658a));}return Promise['all'](_0x21fccb);})['then'](function(){if(_0x411554){return new Promise(function(_0x11140a){zipdir(path['join'](_0x311895,_0x1d39eb),{'saveTo':path['join'](_0x311895,util['format'](_0xcbec('0x3c'),_0x1d39eb,_0xcbec('0x3d')))},function(){rimraf(path[_0xcbec('0x3b')](_0x311895,_0x1d39eb),function(){});_0x11140a(_0xcbec('0x3e'));});});}})[_0xcbec('0x3f')](function(){if(!_0x411554)return;rimraf(path[_0xcbec('0x3b')](_0x311895,_0x1d39eb),function(){});})['then'](function(){logger[_0xcbec('0x40')](util[_0xcbec('0x1d')](_0xcbec('0x41'),EXTRACTED_REPORT_ID,_0xcbec('0x42')));return analyticExtractedReport(_0xcbec('0x43'),_0x411554?util['format'](_0xcbec('0x3c'),_0x1d39eb,_0x411554?_0xcbec('0x3d'):_0xcbec('0x3a')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util['format'](_0xcbec('0x44'),EXTRACTED_REPORT_ID,_0xcbec('0x42')));return db['AnalyticExtractedReport'][_0xcbec('0x45')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xcbec('0x3f')](function(_0x3a8d52){EXTRACTED_REPORT=_0x3a8d52;return dbH['sequelize'][_0xcbec('0x32')](util[_0xcbec('0x1d')](_0xcbec('0x46'),QUERY),{'type':dbH[_0xcbec('0x2e')][_0xcbec('0x30')]['SELECT']});})[_0xcbec('0x3f')](extractReport)[_0xcbec('0x47')](function(_0x2f3127){logger[_0xcbec('0x40')](util['format'](_0xcbec('0x48'),EXTRACTED_REPORT_ID,_0xcbec('0x42')),util['inspect'](_0x2f3127,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xcbec('0x49'));})[_0xcbec('0x4a')](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x25ddb1=new PdfPrinter({'Arial':{'normal':__dirname+_0xcbec('0x4b'),'bold':__dirname+_0xcbec('0x4c'),'italics':__dirname+_0xcbec('0x4d'),'bolditalics':__dirname+_0xcbec('0x4e')}});return _0x25ddb1;}function getPDFDocDefinitionFromHTML(_0x101c6b,_0x2f6873){var _0x527740=util[_0xcbec('0x1d')](_0xcbec('0x4f'),_0x2f6873[_0xcbec('0x50')],_0x2f6873['interactionId']);var _0xb7356a=moment()['format']('YYYY-MM-DD')[_0xcbec('0x14')]();var _0x2474bc=htmlToPdfmake(_0x101c6b,{'window':window,'tableAutoSize':!![]});return{'content':[_0x2474bc],'defaultStyle':{'font':_0xcbec('0x51')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xcbec('0x52'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xcbec('0x52'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xcbec('0x52')}},'header':function(){return[{'text':_0xcbec('0x53'),'style':_0xcbec('0x54')}];},'footer':function(_0x18f43a,_0x7e50c){return[{'text':util[_0xcbec('0x1d')](_0xcbec('0x55'),_0x527740,_0x18f43a,_0x7e50c,_0xb7356a),'style':'footer'}];}};}function writePDFDocument(_0x318462,_0x563743){return new Promise(function(_0x54585f,_0x411e65){var _0x471caa=_0x318462[_0xcbec('0x56')](fs[_0xcbec('0x57')](_0x563743));_0x471caa['on'](_0xcbec('0x58'),function(){_0x54585f(_0xcbec('0x58'));});_0x471caa['on'](_0xcbec('0x59'),function(_0x1145cf){_0x411e65(_0x1145cf);});_0x318462['end']();});}exports['createPdfFromHTML']=function(_0x305eb2,_0x7ac3a2){var _0x24b513=getPDFPrinter();var _0x48b1c7=getPDFDocDefinitionFromHTML(_0x305eb2,_0x7ac3a2);var _0x32a6e4=_0x24b513['createPdfKitDocument'](_0x48b1c7);return writePDFDocument(_0x32a6e4,_0x7ac3a2[_0xcbec('0x1')])[_0xcbec('0x47')](function(_0x599960){throw _0x599960;});}; \ No newline at end of file +var _0xce3c=['YYYY-MM-DD','center','Interaction\x20Transcript','footer','pipe','createWriteStream','finish','error','end','path','lodash','util','html-to-pdfmake','pdfmake/src/printer','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','tableHeader','length','auto','body','chunk','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','endDate','header','pageBreak','before','push','landscape','toString','Arial','black','right','num','Setting','find','split','splitSizePdf','then','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','existsSync','join','mkdirSync','each','flatten','%s%d.%s','pdf','%s.%s','all','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','zip','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','interactionId'];(function(_0x6dd231,_0x23c785){var _0x20154e=function(_0x245b6f){while(--_0x245b6f){_0x6dd231['push'](_0x6dd231['shift']());}};_0x20154e(++_0x23c785);}(_0xce3c,0x1bd));var _0xcce3=function(_0x1cc325,_0x537298){_0x1cc325=_0x1cc325-0x0;var _0x33d644=_0xce3c[_0x1cc325];return _0x33d644;};'use strict';var _=require(_0xcce3('0x0'));var fs=require('fs');var util=require(_0xcce3('0x1'));var path=require('path');var moment=require('moment');var htmlToPdfmake=require(_0xcce3('0x2'));var PdfPrinter=require(_0xcce3('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0xcce3('0x4'));var JSDOM=require(_0xcce3('0x5'))[_0xcce3('0x6')];var window=new JSDOM('')[_0xcce3('0x7')];var BPromise=require(_0xcce3('0x8'));var db=require(_0xcce3('0x9'))['db'];var dbH=require(_0xcce3('0x9'))[_0xcce3('0xa')];var logger=require(_0xcce3('0xb'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xcce3('0xc')][0x2]);var QUERY=process[_0xcce3('0xc')][0x3];var PATH=process[_0xcce3('0xc')][0x4];var NAME=process[_0xcce3('0xc')][0x5];var FORMAT=_0xcce3('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x3f6413,_0xcd3439){var _0x34b882={'status':_0x3f6413};var _0x2dd06a={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xcd3439){_0x34b882[_0xcce3('0xe')]=_0xcd3439;}return db[_0xcce3('0xf')][_0xcce3('0x10')](_0x34b882,_0x2dd06a);}function getHeaders(_0x381a1b){return _[_0xcce3('0x11')](_0x381a1b,function(_0x2eb1ff){return{'text':_0x2eb1ff,'style':_0xcce3('0x12')};});}function getRows(_0x159f31,_0x14f7bb){return _['map'](_0x14f7bb,function(_0x16a451){return _(_0x16a451)['pick'](_0x159f31)['map'](function(_0x4b95ba){return _0x4b95ba?_['toString'](_0x4b95ba):'';})['value']();});}function createTable(_0x2eb598,_0x26fac2){var _0x24e3c2={'widths':_['fill'](Array(_0x2eb598[_0xcce3('0x13')]),0x91),'heights':function(_0x123dc2){return _0x123dc2===0x0?_0xcce3('0x14'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x3bed88=getHeaders(_0x2eb598);_0x24e3c2[_0xcce3('0x15')]['push'](_0x3bed88);var _0x5b2b5b=getRows(_0x2eb598,_0x26fac2);_0x24e3c2[_0xcce3('0x15')]=_0x24e3c2[_0xcce3('0x15')]['concat'](_0x5b2b5b);return _0x24e3c2;}function createTables(_0x5233e4){var _0x5709d4=[];var _0x5ad52f=_[_0xcce3('0x16')](Object[_0xcce3('0x17')](_0x5233e4[0x0]),0x5);_0x5ad52f[_0xcce3('0x18')](function(_0xc73cf0){_0x5709d4['push'](createTable(_0xc73cf0,_0x5233e4));});return _0x5709d4;}function getPDFDocDefinition(_0x4b18b6){var _0x32ed72=util[_0xcce3('0x19')](_0xcce3('0x1a'),NAME,EXTRACTED_REPORT[_0xcce3('0x1b')],moment(EXTRACTED_REPORT['startDate'])['format'](FORMAT),moment(EXTRACTED_REPORT[_0xcce3('0x1c')])[_0xcce3('0x19')](FORMAT));var _0x5c9794=[];for(var _0x1b75d9=0x0;_0x1b75d9<_0x4b18b6[_0xcce3('0x13')];_0x1b75d9++){var _0xe985bc=[];if(_0x1b75d9===0x0){_0xe985bc['push']({'text':_0x32ed72,'style':_0xcce3('0x1d')});}var _0x326b54={'table':_0x4b18b6[_0x1b75d9]};if(_0x1b75d9>0x0){_0x326b54[_0xcce3('0x1e')]=_0xcce3('0x1f');_0x326b54['margin']=[0x0,0x46,0x0,0x0];}_0xe985bc[_0xcce3('0x20')](_0x326b54);_0x5c9794['push'](_0xe985bc);}return{'pageSize':'A4','pageOrientation':_0xcce3('0x21'),'content':_0x5c9794,'footer':function(_0xb41c9,_0x44cc24){return{'text':_0xb41c9[_0xcce3('0x22')]()+'\x20/\x20'+_0x44cc24,'style':'footer'};},'defaultStyle':{'font':_0xcce3('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xcce3('0x24')},'footer':{'alignment':_0xcce3('0x25'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x335def){var _0x5d278e=0x1388;var _0xfda2f4;if(!_0x335def[0x0][_0xcce3('0x26')]){return analyticExtractedReport('Empty');}return db[_0xcce3('0x27')][_0xcce3('0x28')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xcce3('0x29'),_0xcce3('0x2a')]})[_0xcce3('0x2b')](function(_0x3f5b44){if(_0x3f5b44){_0xfda2f4=_0x3f5b44;_0x5d278e=_0xfda2f4[_0xcce3('0x2a')]||0x3e8;}})[_0xcce3('0x2b')](function(){var _0x438f7e=[];var _0x772291=0x0;if(_0xfda2f4[_0xcce3('0x29')]){if(_0x335def&&_0x335def[_0xcce3('0x13')]){var _0x295bb6=_['range'](_0x335def[0x0][_0xcce3('0x26')]/_0x5d278e);var _0x526215=Number['isInteger'](_0x335def[0x0]['num']/_0x5d278e)?_0x335def[0x0]['num']%_0x5d278e:0x0;_0x295bb6[_0xcce3('0x18')](function(_0x19df90){if(_0x19df90>0x0){_0x772291+=_0x5d278e;}_0x438f7e['push'](dbH[_0xcce3('0x2c')][_0xcce3('0x2d')](util[_0xcce3('0x19')](_0xcce3('0x2e'),QUERY,_0x5d278e,_0x772291),{'type':dbH[_0xcce3('0x2c')][_0xcce3('0x2f')]['SELECT']}));});if(_0x526215>0x0){_0x772291+=_0x5d278e;_0x438f7e[_0xcce3('0x20')](dbH[_0xcce3('0x2c')][_0xcce3('0x2d')](util[_0xcce3('0x19')](_0xcce3('0x2e'),QUERY,_0x526215,_0x772291),{'type':dbH[_0xcce3('0x2c')][_0xcce3('0x2f')][_0xcce3('0x30')]}));}}}else{_0x438f7e[_0xcce3('0x20')](dbH[_0xcce3('0x2c')][_0xcce3('0x2d')](QUERY,{'type':dbH[_0xcce3('0x2c')][_0xcce3('0x2f')][_0xcce3('0x30')]}));}var _0x45eb5f=path[_0xcce3('0x31')](PATH);var _0x1b874c=path[_0xcce3('0x32')](PATH,'.pdf');var _0x2303b4=_0xfda2f4[_0xcce3('0x29')]&&_0x438f7e[_0xcce3('0x13')]>0x1;var _0x211134=[];if(!fs[_0xcce3('0x33')](path[_0xcce3('0x34')](_0x45eb5f,_0x1b874c))&&_0x2303b4){fs[_0xcce3('0x35')](path['join'](_0x45eb5f,_0x1b874c));}return BPromise[_0xcce3('0x36')](_0x438f7e,function(_0xd85c56){_0x211134['push'](_0xd85c56);})[_0xcce3('0x2b')](function(){var _0x46be90=[];for(var _0x2396b3=0x0;_0x2396b3<_0x211134[_0xcce3('0x13')];_0x2396b3+=0x1){var _0x4c9949=_0x211134[_0x2396b3];var _0x20ad34=createTables(_[_0xcce3('0x37')](_0x4c9949));var _0x321a40;var _0x2783ef=getPDFDocDefinition(_0x20ad34);var _0x354c2b=getPDFPrinter();var _0x2ee3d3=_0x354c2b['createPdfKitDocument'](_0x2783ef);if(_0x2303b4){_0x321a40=path[_0xcce3('0x34')](_0x45eb5f,_0x1b874c,util[_0xcce3('0x19')](_0xcce3('0x38'),_0x1b874c,_0x2396b3,_0xcce3('0x39')));}else{_0x321a40=path['join'](_0x45eb5f,util['format'](_0xcce3('0x3a'),_0x1b874c,_0xcce3('0x39')));}_0x46be90[_0xcce3('0x20')](writePDFDocument(_0x2ee3d3,_0x321a40));}return Promise[_0xcce3('0x3b')](_0x46be90);})['then'](function(){if(_0x2303b4){return new Promise(function(_0x12f37f){zipdir(path[_0xcce3('0x34')](_0x45eb5f,_0x1b874c),{'saveTo':path[_0xcce3('0x34')](_0x45eb5f,util[_0xcce3('0x19')](_0xcce3('0x3a'),_0x1b874c,'zip'))},function(){rimraf(path[_0xcce3('0x34')](_0x45eb5f,_0x1b874c),function(){});_0x12f37f(_0xcce3('0x3c'));});});}})[_0xcce3('0x2b')](function(){if(!_0x2303b4)return;rimraf(path[_0xcce3('0x34')](_0x45eb5f,_0x1b874c),function(){});})[_0xcce3('0x2b')](function(){logger['info'](util[_0xcce3('0x19')](_0xcce3('0x3d'),EXTRACTED_REPORT_ID,_0xcce3('0x3e')));return analyticExtractedReport('Completed',_0x2303b4?util[_0xcce3('0x19')](_0xcce3('0x3a'),_0x1b874c,_0x2303b4?_0xcce3('0x3f'):_0xcce3('0x39')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xcce3('0x40')](util[_0xcce3('0x19')](_0xcce3('0x41'),EXTRACTED_REPORT_ID,_0xcce3('0x3e')));return db[_0xcce3('0xf')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x3cb2f1){EXTRACTED_REPORT=_0x3cb2f1;return dbH[_0xcce3('0x2c')][_0xcce3('0x2d')](util[_0xcce3('0x19')](_0xcce3('0x42'),QUERY),{'type':dbH[_0xcce3('0x2c')]['QueryTypes']['SELECT']});})[_0xcce3('0x2b')](extractReport)[_0xcce3('0x43')](function(_0x3ced30){logger['info'](util[_0xcce3('0x19')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xcce3('0x3e')),util['inspect'](_0x3ced30,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xcce3('0x44'));})[_0xcce3('0x45')](function(){process[_0xcce3('0x46')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x4107a3=new PdfPrinter({'Arial':{'normal':__dirname+_0xcce3('0x47'),'bold':__dirname+_0xcce3('0x48'),'italics':__dirname+_0xcce3('0x49'),'bolditalics':__dirname+_0xcce3('0x4a')}});return _0x4107a3;}function getPDFDocDefinitionFromHTML(_0x4d1b45,_0x1a7e0f){var _0x2e6022=util[_0xcce3('0x19')](_0xcce3('0x4b'),_0x1a7e0f['channel'],_0x1a7e0f[_0xcce3('0x4c')]);var _0x1d93fb=moment()[_0xcce3('0x19')](_0xcce3('0x4d'))[_0xcce3('0x22')]();var _0x433779=htmlToPdfmake(_0x4d1b45,{'window':window,'tableAutoSize':!![]});return{'content':[_0x433779],'defaultStyle':{'font':_0xcce3('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xcce3('0x4e'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xcce3('0x4e'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xcce3('0x4e')}},'header':function(){return[{'text':_0xcce3('0x4f'),'style':'header'}];},'footer':function(_0x380792,_0x12b266){return[{'text':util[_0xcce3('0x19')]('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x2e6022,_0x380792,_0x12b266,_0x1d93fb),'style':_0xcce3('0x50')}];}};}function writePDFDocument(_0x492cb7,_0x1a1e12){return new Promise(function(_0x4aa3d4,_0x38c2ca){var _0x11b574=_0x492cb7[_0xcce3('0x51')](fs[_0xcce3('0x52')](_0x1a1e12));_0x11b574['on'](_0xcce3('0x53'),function(){_0x4aa3d4(_0xcce3('0x53'));});_0x11b574['on'](_0xcce3('0x54'),function(_0x2aea24){_0x38c2ca(_0x2aea24);});_0x492cb7[_0xcce3('0x55')]();});}exports['createPdfFromHTML']=function(_0x456cda,_0x591640){var _0x514c74=getPDFPrinter();var _0x5e4b12=getPDFDocDefinitionFromHTML(_0x456cda,_0x591640);var _0x48f747=_0x514c74['createPdfKitDocument'](_0x5e4b12);return writePDFDocument(_0x48f747,_0x591640[_0xcce3('0x56')])['catch'](function(_0x1ec62b){throw _0x1ec62b;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index b261d2f..d52d56c 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 _0x8a16=['basename','.xlsx','join','mkdirSync','each','%s%d.%s','xlsx','writeFileSync','binary','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','inspect','Failed','finally','exit','util','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','query','dirname'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8a16,0xe6));var _0x68a1=function(_0x3f63dd,_0x50aeeb){_0x3f63dd=_0x3f63dd-0x0;var _0x92bdd=_0x8a16[_0x3f63dd];return _0x92bdd;};'use strict';var util=require(_0x68a1('0x0'));var path=require('path');var _=require(_0x68a1('0x1'));var fs=require('fs');var json2xls=require(_0x68a1('0x2'));var BPromise=require(_0x68a1('0x3'));var zipdir=require(_0x68a1('0x4'));var rimraf=require(_0x68a1('0x5'));var db=require(_0x68a1('0x6'))['db'];var dbH=require(_0x68a1('0x6'))['dbH'];var logger=require(_0x68a1('0x7'))(_0x68a1('0x8'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x68a1('0x9')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2a154a,_0x121c9f){var _0x363f65={'status':_0x2a154a};var _0x5e0457={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x121c9f){_0x363f65[_0x68a1('0xa')]=_0x121c9f;}return db[_0x68a1('0xb')][_0x68a1('0xc')](_0x363f65,_0x5e0457);}function main(){var _0x3dd213=0x1388;var _0x5de9d4;logger[_0x68a1('0xd')](util[_0x68a1('0xe')](_0x68a1('0xf'),EXTRACTED_REPORT_ID,_0x68a1('0x10')));return db[_0x68a1('0x11')][_0x68a1('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x68a1('0x13'),_0x68a1('0x14')]})[_0x68a1('0x15')](function(_0x4287c0){if(_0x4287c0){_0x5de9d4=_0x4287c0;_0x3dd213=_0x5de9d4['splitSizeXlsx']||0x1388;}})[_0x68a1('0x15')](function(){return dbH[_0x68a1('0x16')]['query'](util['format'](_0x68a1('0x17'),QUERY),{'type':dbH[_0x68a1('0x16')][_0x68a1('0x18')]['SELECT']});})[_0x68a1('0x15')](function(_0x2e8c23){if(!_0x2e8c23[0x0][_0x68a1('0x19')]){return analyticExtractedReport('Empty');}var _0x2b5302=[];var _0x2c7b1f=0x0;if(_0x5de9d4['split']){if(_0x2e8c23&&_0x2e8c23[_0x68a1('0x1a')]){var _0x2db597=_[_0x68a1('0x1b')](_0x2e8c23[0x0][_0x68a1('0x19')]/_0x3dd213);var _0x556e03=Number[_0x68a1('0x1c')](_0x2e8c23[0x0][_0x68a1('0x19')]/_0x3dd213)?_0x2e8c23[0x0][_0x68a1('0x19')]%_0x3dd213:0x0;_0x2db597[_0x68a1('0x1d')](function(_0x2d0d7d){if(_0x2d0d7d>0x0){_0x2c7b1f+=_0x3dd213;}_0x2b5302[_0x68a1('0x1e')](dbH['sequelize']['query'](util[_0x68a1('0xe')](_0x68a1('0x1f'),QUERY,_0x3dd213,_0x2c7b1f),{'type':dbH[_0x68a1('0x16')][_0x68a1('0x18')][_0x68a1('0x20')]}));});if(_0x556e03>0x0){_0x2c7b1f+=_0x3dd213;_0x2b5302[_0x68a1('0x1e')](dbH['sequelize'][_0x68a1('0x21')](util[_0x68a1('0xe')](_0x68a1('0x1f'),QUERY,_0x556e03,_0x2c7b1f),{'type':dbH[_0x68a1('0x16')]['QueryTypes'][_0x68a1('0x20')]}));}}}else{_0x2b5302[_0x68a1('0x1e')](dbH[_0x68a1('0x16')][_0x68a1('0x21')](QUERY,{'type':dbH['sequelize'][_0x68a1('0x18')][_0x68a1('0x20')]}));}var _0x566887=path[_0x68a1('0x22')](PATH);var _0x232adb=path[_0x68a1('0x23')](PATH,_0x68a1('0x24'));var _0x4446a5=_0x5de9d4[_0x68a1('0x13')]&&_0x2b5302['length']>0x1;var _0x254ba0=[];if(!fs['existsSync'](path[_0x68a1('0x25')](_0x566887,_0x232adb))&&_0x4446a5){fs[_0x68a1('0x26')](path[_0x68a1('0x25')](_0x566887,_0x232adb));}return BPromise[_0x68a1('0x27')](_0x2b5302,function(_0xc449fa){_0x254ba0[_0x68a1('0x1e')](_0xc449fa);})[_0x68a1('0x15')](function(){for(var _0x24de30=0x0;_0x24de30<_0x254ba0['length'];_0x24de30+=0x1){var _0x786b82;var _0x1c7cb5=_0x254ba0[_0x24de30];if(_0x4446a5){_0x786b82=path[_0x68a1('0x25')](_0x566887,_0x232adb,util['format'](_0x68a1('0x28'),_0x232adb,_0x24de30,_0x68a1('0x29')));}else{_0x786b82=path[_0x68a1('0x25')](_0x566887,util[_0x68a1('0xe')]('%s.%s',_0x232adb,'xlsx'));}fs[_0x68a1('0x2a')](_0x786b82,json2xls(_0x1c7cb5),_0x68a1('0x2b'));}})[_0x68a1('0x15')](function(){if(_0x4446a5){return new Promise(function(_0x1f0c20){zipdir(path[_0x68a1('0x25')](_0x566887,_0x232adb),{'saveTo':path['join'](_0x566887,util[_0x68a1('0xe')](_0x68a1('0x2c'),_0x232adb,_0x68a1('0x2d')))},function(_0x137365,_0xacdaa){rimraf(path[_0x68a1('0x25')](_0x566887,_0x232adb),function(){});_0x1f0c20('zip\x20finished');});});}})[_0x68a1('0x15')](function(){logger[_0x68a1('0xd')](util[_0x68a1('0xe')](_0x68a1('0x2e'),EXTRACTED_REPORT_ID,_0x68a1('0x10')));return analyticExtractedReport(_0x68a1('0x2f'),_0x4446a5?util[_0x68a1('0xe')](_0x68a1('0x2c'),_0x232adb,_0x4446a5?_0x68a1('0x2d'):_0x68a1('0x29')):null);});})[_0x68a1('0x30')](function(_0x85d48){logger[_0x68a1('0xd')](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x68a1('0x10')),util[_0x68a1('0x31')](_0x85d48,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x68a1('0x32'));})[_0x68a1('0x33')](function(){process[_0x68a1('0x34')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x8ed5=['sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','Empty','split','range','isInteger','num','%s\x20limit\x20%d\x20OFFSET\x20%d','push','basename','.xlsx','length','existsSync','mkdirSync','join','each','xlsx','%s.%s','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','path','lodash','zip-dir','../../mysqldb','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','splitSizeXlsx','then'];(function(_0x198446,_0x119c8f){var _0x38d7b7=function(_0x293752){while(--_0x293752){_0x198446['push'](_0x198446['shift']());}};_0x38d7b7(++_0x119c8f);}(_0x8ed5,0x15f));var _0x58ed=function(_0x514e2c,_0x5b9509){_0x514e2c=_0x514e2c-0x0;var _0x4776d6=_0x8ed5[_0x514e2c];return _0x4776d6;};'use strict';var util=require('util');var path=require(_0x58ed('0x0'));var _=require(_0x58ed('0x1'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require('bluebird');var zipdir=require(_0x58ed('0x2'));var rimraf=require('rimraf');var db=require(_0x58ed('0x3'))['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require(_0x58ed('0x4'))(_0x58ed('0x5'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x58ed('0x6')][0x3];var PATH=process[_0x58ed('0x6')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x18573d,_0x3ade1c){var _0x3817a7={'status':_0x18573d};var _0x391796={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3ade1c){_0x3817a7[_0x58ed('0x7')]=_0x3ade1c;}return db[_0x58ed('0x8')]['update'](_0x3817a7,_0x391796);}function main(){var _0x2e4971=0x1388;var _0x40c33f;logger[_0x58ed('0x9')](util[_0x58ed('0xa')](_0x58ed('0xb'),EXTRACTED_REPORT_ID,_0x58ed('0xc')));return db[_0x58ed('0xd')][_0x58ed('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x58ed('0xf')]})['then'](function(_0x1ba269){if(_0x1ba269){_0x40c33f=_0x1ba269;_0x2e4971=_0x40c33f[_0x58ed('0xf')]||0x1388;}})[_0x58ed('0x10')](function(){return dbH[_0x58ed('0x11')][_0x58ed('0x12')](util['format'](_0x58ed('0x13'),QUERY),{'type':dbH[_0x58ed('0x11')][_0x58ed('0x14')][_0x58ed('0x15')]});})['then'](function(_0x58dc4e){if(!_0x58dc4e[0x0]['num']){return analyticExtractedReport(_0x58ed('0x16'));}var _0x5d4501=[];var _0xb74f02=0x0;if(_0x40c33f[_0x58ed('0x17')]){if(_0x58dc4e&&_0x58dc4e['length']){var _0x5c0b2e=_[_0x58ed('0x18')](_0x58dc4e[0x0]['num']/_0x2e4971);var _0x5be03e=Number[_0x58ed('0x19')](_0x58dc4e[0x0][_0x58ed('0x1a')]/_0x2e4971)?_0x58dc4e[0x0]['num']%_0x2e4971:0x0;_0x5c0b2e['forEach'](function(_0x4bbcb8){if(_0x4bbcb8>0x0){_0xb74f02+=_0x2e4971;}_0x5d4501['push'](dbH[_0x58ed('0x11')]['query'](util[_0x58ed('0xa')](_0x58ed('0x1b'),QUERY,_0x2e4971,_0xb74f02),{'type':dbH[_0x58ed('0x11')][_0x58ed('0x14')]['SELECT']}));});if(_0x5be03e>0x0){_0xb74f02+=_0x2e4971;_0x5d4501[_0x58ed('0x1c')](dbH[_0x58ed('0x11')][_0x58ed('0x12')](util[_0x58ed('0xa')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x5be03e,_0xb74f02),{'type':dbH['sequelize'][_0x58ed('0x14')][_0x58ed('0x15')]}));}}}else{_0x5d4501[_0x58ed('0x1c')](dbH[_0x58ed('0x11')]['query'](QUERY,{'type':dbH[_0x58ed('0x11')]['QueryTypes'][_0x58ed('0x15')]}));}var _0x346821=path['dirname'](PATH);var _0x2c4352=path[_0x58ed('0x1d')](PATH,_0x58ed('0x1e'));var _0x38d109=_0x40c33f[_0x58ed('0x17')]&&_0x5d4501[_0x58ed('0x1f')]>0x1;var _0x5421a7=[];if(!fs[_0x58ed('0x20')](path['join'](_0x346821,_0x2c4352))&&_0x38d109){fs[_0x58ed('0x21')](path[_0x58ed('0x22')](_0x346821,_0x2c4352));}return BPromise[_0x58ed('0x23')](_0x5d4501,function(_0x340796){_0x5421a7[_0x58ed('0x1c')](_0x340796);})['then'](function(){for(var _0x369084=0x0;_0x369084<_0x5421a7['length'];_0x369084+=0x1){var _0x17dd7a;var _0x29cfde=_0x5421a7[_0x369084];if(_0x38d109){_0x17dd7a=path['join'](_0x346821,_0x2c4352,util['format']('%s%d.%s',_0x2c4352,_0x369084,_0x58ed('0x24')));}else{_0x17dd7a=path[_0x58ed('0x22')](_0x346821,util[_0x58ed('0xa')](_0x58ed('0x25'),_0x2c4352,_0x58ed('0x24')));}fs[_0x58ed('0x26')](_0x17dd7a,json2xls(_0x29cfde),'binary');}})['then'](function(){if(_0x38d109){return new Promise(function(_0x188d98){zipdir(path['join'](_0x346821,_0x2c4352),{'saveTo':path[_0x58ed('0x22')](_0x346821,util[_0x58ed('0xa')]('%s.%s',_0x2c4352,_0x58ed('0x27')))},function(_0x56c904,_0x505e76){rimraf(path[_0x58ed('0x22')](_0x346821,_0x2c4352),function(){});_0x188d98(_0x58ed('0x28'));});});}})['then'](function(){logger['info'](util[_0x58ed('0xa')](_0x58ed('0x29'),EXTRACTED_REPORT_ID,_0x58ed('0xc')));return analyticExtractedReport('Completed',_0x38d109?util[_0x58ed('0xa')](_0x58ed('0x25'),_0x2c4352,_0x38d109?_0x58ed('0x27'):'xlsx'):null);});})[_0x58ed('0x2a')](function(_0x9af9a5){logger[_0x58ed('0x9')](util[_0x58ed('0xa')](_0x58ed('0x2b'),EXTRACTED_REPORT_ID,_0x58ed('0xc')),util[_0x58ed('0x2c')](_0x9af9a5,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x58ed('0x2d')](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 4bcca87..9af09e3 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 _0x00ad=['priority','extensions','push','type','Set','CDR(type)=%s','context','VoiceExtensionId','inbound','outbound','CDR(destination)=','extension','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','ExecIf','):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','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','interval','filter','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','indexOf','app','appType','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime','last','concat','Hangup','transaction','destroy','bulkCreate','sortBy','error','lodash','util','Interval','findAll','then','intervals','models','VoiceExtension','IntervalId','uniq','CAST(priority\x20AS\x20UNSIGNED)','exten','queue','hasOwnProperty'];(function(_0x441da6,_0x35b146){var _0x59d32f=function(_0x4d8002){while(--_0x4d8002){_0x441da6['push'](_0x441da6['shift']());}};_0x59d32f(++_0x35b146);}(_0x00ad,0x84));var _0xd00a=function(_0x3fb9dd,_0x174fff){_0x3fb9dd=_0x3fb9dd-0x0;var _0x20136a=_0x00ad[_0x3fb9dd];return _0x20136a;};'use strict';var _=require(_0xd00a('0x0'));var util=require(_0xd00a('0x1'));function rewrite(_0x262766,_0x1b9d46){var _0x51bf1f=this;return _0x262766['models'][_0xd00a('0x2')][_0xd00a('0x3')]({'raw':!![]})[_0xd00a('0x4')](function(_0x526126){_0x51bf1f[_0xd00a('0x5')]=_0x526126;return _0x262766[_0xd00a('0x6')][_0xd00a('0x7')][_0xd00a('0x3')]({'where':{'IntervalId':_0x1b9d46[_0xd00a('0x8')]},'raw':!![]});})['then'](function(_0xed1e3f){return _0x262766[_0xd00a('0x6')][_0xd00a('0x7')]['findAll']({'where':{'exten':{'$in':_[_0xd00a('0x9')](_['map'](_0xed1e3f,'exten'))}},'order':[{'raw':_0xd00a('0xa')}],'raw':!![]});})['then'](function(_0x35ee03){var _0x14792a=_['filter'](_0x35ee03,{'priority':'1'});var _0x4d2c45=_['filter'](_0x35ee03,{'isApp':0x1});var _0x30371a=_['groupBy'](_0x4d2c45,_0xd00a('0xb'));var _0x39cd67=[_0xd00a('0xc'),'playback'];var _0x5f4e21=[];var _0x2aade4=[];for(var _0x325425 in _0x30371a){if(_0x30371a[_0xd00a('0xd')](_0x325425)){_0x51bf1f[_0xd00a('0xe')]=0x2;_0x51bf1f['extensions']=[];_0x51bf1f['extension']=_['find'](_0x14792a,{'exten':_0x30371a[_0x325425][0x0][_0xd00a('0xb')]});_0x51bf1f[_0xd00a('0xf')][_0xd00a('0x10')]({'type':_0x30371a[_0x325425][0x0][_0xd00a('0x11')],'app':_0xd00a('0x12'),'appdata':util['format'](_0xd00a('0x13'),_0x30371a[_0x325425][0x0][_0xd00a('0x11')]),'context':_0x30371a[_0x325425][0x0][_0xd00a('0x14')],'exten':_0x30371a[_0x325425][0x0][_0xd00a('0xb')],'priority':_0x51bf1f[_0xd00a('0xe')]++,'VoiceExtensionId':_0x30371a[_0x325425][0x0][_0xd00a('0x15')]});if(_0x30371a[_0x325425][0x0][_0xd00a('0x11')]===_0xd00a('0x16')){_0x51bf1f[_0xd00a('0xf')][_0xd00a('0x10')]({'type':_0x30371a[_0x325425][0x0]['type'],'app':'Set','appdata':'CDR(routeid)='+_0x30371a[_0x325425][0x0][_0xd00a('0x15')],'context':_0x30371a[_0x325425][0x0][_0xd00a('0x14')],'exten':_0x30371a[_0x325425][0x0]['exten'],'priority':_0x51bf1f[_0xd00a('0xe')]++,'VoiceExtensionId':_0x30371a[_0x325425][0x0]['VoiceExtensionId']});}else if(_0x30371a[_0x325425][0x0][_0xd00a('0x11')]===_0xd00a('0x17')){if(_0x51bf1f['extension']){_0x51bf1f[_0xd00a('0xf')][_0xd00a('0x10')]({'type':_0x30371a[_0x325425][0x0][_0xd00a('0x11')],'app':_0xd00a('0x12'),'appdata':_0xd00a('0x18')+(_0x51bf1f[_0xd00a('0x19')][_0xd00a('0x1a')]?_0xd00a('0x1b')+_0x51bf1f[_0xd00a('0x19')][_0xd00a('0x1a')]+'}':_0xd00a('0x1c')),'context':_0x30371a[_0x325425][0x0][_0xd00a('0x14')],'exten':_0x30371a[_0x325425][0x0][_0xd00a('0xb')],'priority':_0x51bf1f[_0xd00a('0xe')]++,'VoiceExtensionId':_0x30371a[_0x325425][0x0]['VoiceExtensionId']});}_0x51bf1f[_0xd00a('0xf')][_0xd00a('0x10')]({'type':_0x30371a[_0x325425][0x0][_0xd00a('0x11')],'app':_0xd00a('0x12'),'appdata':_0xd00a('0x1d')+_0x30371a[_0x325425][0x0]['VoiceExtensionId'],'context':_0x30371a[_0x325425][0x0][_0xd00a('0x14')],'exten':_0x30371a[_0x325425][0x0][_0xd00a('0xb')],'priority':_0x51bf1f[_0xd00a('0xe')]++,'VoiceExtensionId':_0x30371a[_0x325425][0x0][_0xd00a('0x15')]});var _0x53b782=_0x51bf1f['priority']++;_0x51bf1f[_0xd00a('0xf')]['push']({'type':_0x30371a[_0x325425][0x0][_0xd00a('0x11')],'app':_0xd00a('0x1e'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x53b782+0x2)+_0xd00a('0x1f')+(_0x53b782+0x1)+')','context':_0x30371a[_0x325425][0x0][_0xd00a('0x14')],'exten':_0x30371a[_0x325425][0x0]['exten'],'priority':_0x53b782,'VoiceExtensionId':_0x30371a[_0x325425][0x0][_0xd00a('0x15')]});if(_0x51bf1f[_0xd00a('0x19')]){_0x51bf1f['extensions'][_0xd00a('0x10')]({'type':_0x30371a[_0x325425][0x0]['type'],'app':'Set','appdata':_0x51bf1f[_0xd00a('0x19')]['cutdigits']?_0xd00a('0x20')+_0x51bf1f[_0xd00a('0x19')]['cutdigits']+'}':_0xd00a('0x21'),'context':_0x30371a[_0x325425][0x0]['context'],'exten':_0x30371a[_0x325425][0x0][_0xd00a('0xb')],'priority':_0x51bf1f['priority']++,'VoiceExtensionId':_0x30371a[_0x325425][0x0][_0xd00a('0x15')]});}_0x51bf1f[_0xd00a('0xf')][_0xd00a('0x10')]({'type':_0x30371a[_0x325425][0x0][_0xd00a('0x11')],'app':_0xd00a('0x12'),'appdata':_0xd00a('0x22')+_0x30371a[_0x325425][0x0][_0xd00a('0x15')],'context':_0x30371a[_0x325425][0x0]['context'],'exten':_0x30371a[_0x325425][0x0]['exten'],'priority':_0x51bf1f[_0xd00a('0xe')]++,'VoiceExtensionId':_0x30371a[_0x325425][0x0][_0xd00a('0x15')]});if(_0x51bf1f[_0xd00a('0x19')]&&_0x51bf1f[_0xd00a('0x19')][_0xd00a('0xd')](_0xd00a('0x23'))&&_0x51bf1f[_0xd00a('0x19')][_0xd00a('0x23')]!==_0xd00a('0x24')){_0x51bf1f['extensions'][_0xd00a('0x10')]({'type':_0x30371a[_0x325425][0x0][_0xd00a('0x11')],'app':_0xd00a('0x12'),'appdata':_0xd00a('0x25'),'context':_0x30371a[_0x325425][0x0][_0xd00a('0x14')],'exten':_0x30371a[_0x325425][0x0][_0xd00a('0xb')],'priority':_0x51bf1f['priority']++,'VoiceExtensionId':_0x30371a[_0x325425][0x0][_0xd00a('0x15')]});_0x51bf1f[_0xd00a('0xf')][_0xd00a('0x10')]({'type':_0x30371a[_0x325425][0x0][_0xd00a('0x11')],'app':'Set','appdata':_0xd00a('0x26')+_0x51bf1f[_0xd00a('0x19')]['recordingFormat']||_0xd00a('0x27'),'context':_0x30371a[_0x325425][0x0][_0xd00a('0x14')],'exten':_0x30371a[_0x325425][0x0]['exten'],'priority':_0x51bf1f[_0xd00a('0xe')]++,'VoiceExtensionId':_0x30371a[_0x325425][0x0][_0xd00a('0x15')]});}}_0x51bf1f['extensions'][_0xd00a('0x10')]({'type':_0x30371a[_0x325425][0x0]['type'],'app':_0xd00a('0x12'),'appdata':_0xd00a('0x28'),'context':_0x30371a[_0x325425][0x0]['context'],'exten':_0x30371a[_0x325425][0x0][_0xd00a('0xb')],'priority':_0x51bf1f[_0xd00a('0xe')]++,'VoiceExtensionId':_0x30371a[_0x325425][0x0][_0xd00a('0x15')]});_0x51bf1f[_0xd00a('0xf')][_0xd00a('0x10')]({'type':_0x30371a[_0x325425][0x0][_0xd00a('0x11')],'app':_0xd00a('0x12'),'appdata':_0xd00a('0x29'),'context':_0x30371a[_0x325425][0x0][_0xd00a('0x14')],'exten':_0x30371a[_0x325425][0x0][_0xd00a('0xb')],'priority':_0x51bf1f[_0xd00a('0xe')]++,'VoiceExtensionId':_0x30371a[_0x325425][0x0]['VoiceExtensionId']});_0x51bf1f['extensions'][_0xd00a('0x10')]({'type':_0x30371a[_0x325425][0x0][_0xd00a('0x11')],'app':_0xd00a('0x12'),'appdata':_0xd00a('0x2a'),'context':_0x30371a[_0x325425][0x0]['context'],'exten':_0x30371a[_0x325425][0x0][_0xd00a('0xb')],'priority':_0x51bf1f['priority']++,'VoiceExtensionId':_0x30371a[_0x325425][0x0][_0xd00a('0x15')]});for(var _0x26a77e=0x0,_0x3404d0=0x0;_0x26a77e<_0x30371a[_0x325425][_0xd00a('0x2b')];_0x26a77e+=0x1,_0x3404d0=0x0){var _0x57379b=_0x30371a[_0x325425][_0x26a77e];if(_0x57379b[_0xd00a('0x11')]){_0x57379b[_0xd00a('0x11')]=_0x57379b[_0xd00a('0x11')][_0xd00a('0x2c')]();}var _0x33ae26=[];var _0x16873b=[];delete _0x57379b['id'];delete _0x57379b[_0xd00a('0x2d')];delete _0x57379b[_0xd00a('0x2e')];var _0x333ca7=_0x57379b['interval']!=='*,*,*,*'?[_0x57379b[_0xd00a('0x2f')]]:_0x57379b[_0xd00a('0x8')]?_['map'](_[_0xd00a('0x30')](_0x51bf1f['intervals'],{'IntervalId':_0x57379b['IntervalId']}),'interval'):[];if(_0x57379b[_0xd00a('0xd')](_0xd00a('0x31'))){if(_0x57379b[_0xd00a('0x31')]&&_0x57379b[_0xd00a('0x31')]!=='--'){_0x33ae26[_0xd00a('0x10')]({'type':_0x57379b[_0xd00a('0x11')],'app':_0xd00a('0x12'),'appdata':_0xd00a('0x32')+_0x57379b[_0xd00a('0x31')],'context':_0x57379b['context'],'exten':_0x57379b[_0xd00a('0xb')],'priority':_0x333ca7[_0xd00a('0x2b')]+_0x51bf1f['priority']+_0x3404d0++,'VoiceExtensionId':_0x57379b['VoiceExtensionId']});}}if(_0x57379b[_0xd00a('0x11')]===_0xd00a('0x17')&&_0x57379b[_0xd00a('0xd')]('callerID')){if(_0x57379b[_0xd00a('0x33')]){_0x33ae26[_0xd00a('0x10')]({'type':_0x57379b[_0xd00a('0x11')],'app':'ExecIf','appdata':_0xd00a('0x34')+_0x57379b['callerID']+')','context':_0x57379b[_0xd00a('0x14')],'exten':_0x57379b[_0xd00a('0xb')],'priority':_0x333ca7['length']+_0x51bf1f[_0xd00a('0xe')]+_0x3404d0++,'VoiceExtensionId':_0x57379b[_0xd00a('0x15')]});}else{_0x33ae26[_0xd00a('0x10')]({'type':_0x57379b[_0xd00a('0x11')],'app':'ExecIf','appdata':_0xd00a('0x35'),'context':_0x57379b[_0xd00a('0x14')],'exten':_0x57379b[_0xd00a('0xb')],'priority':_0x333ca7[_0xd00a('0x2b')]+_0x51bf1f['priority']+_0x3404d0++,'VoiceExtensionId':_0x57379b[_0xd00a('0x15')]});}}if(_0x57379b['hasOwnProperty']('answer')){if(_0x39cd67[_0xd00a('0x36')](_0x57379b[_0xd00a('0x37')]['toLowerCase']())>=0x0&&_0x57379b[_0xd00a('0x38')]!==_0xd00a('0x39')){if(_0x57379b[_0xd00a('0x3a')]){_0x33ae26['push']({'type':_0x57379b[_0xd00a('0x11')],'app':_0xd00a('0x1e'),'appdata':_0xd00a('0x3b'),'context':_0x57379b[_0xd00a('0x14')],'exten':_0x57379b[_0xd00a('0xb')],'priority':_0x333ca7[_0xd00a('0x2b')]+_0x51bf1f[_0xd00a('0xe')]+_0x3404d0++,'VoiceExtensionId':_0x57379b[_0xd00a('0x15')]});_0x33ae26[_0xd00a('0x10')]({'type':_0x57379b['type'],'app':_0xd00a('0x12'),'appdata':_0xd00a('0x3c'),'context':_0x57379b['context'],'exten':_0x57379b[_0xd00a('0xb')],'priority':_0x333ca7[_0xd00a('0x2b')]+_0x51bf1f[_0xd00a('0xe')]+_0x3404d0++,'VoiceExtensionId':_0x57379b[_0xd00a('0x15')]});}else{_0x33ae26[_0xd00a('0x10')]({'type':_0x57379b[_0xd00a('0x11')],'app':'ExecIf','appdata':_0xd00a('0x3d'),'context':_0x57379b[_0xd00a('0x14')],'exten':_0x57379b[_0xd00a('0xb')],'priority':_0x333ca7[_0xd00a('0x2b')]+_0x51bf1f['priority']+_0x3404d0++,'VoiceExtensionId':_0x57379b[_0xd00a('0x15')]});_0x33ae26[_0xd00a('0x10')]({'type':_0x57379b['type'],'app':'Set','appdata':_0xd00a('0x3e'),'context':_0x57379b[_0xd00a('0x14')],'exten':_0x57379b['exten'],'priority':_0x333ca7[_0xd00a('0x2b')]+_0x51bf1f['priority']+_0x3404d0++,'VoiceExtensionId':_0x57379b['VoiceExtensionId']});}}}for(var _0x155e48=0x0;_0x155e48<_0x333ca7[_0xd00a('0x2b')];_0x155e48+=0x1){var _0x3769aa=_0x51bf1f[_0xd00a('0xe')]+_0x333ca7['length'];var _0x17aca5=_0x155e48===_0x333ca7[_0xd00a('0x2b')]-0x1?_0x51bf1f[_0xd00a('0xe')]+_0x33ae26['length']+_0x16873b[_0xd00a('0x2b')]+0x2:_0x51bf1f[_0xd00a('0xe')]+_0x155e48+0x1;_0x33ae26[_0xd00a('0x3f')](_0x155e48,0x0,{'type':_0x57379b[_0xd00a('0x11')],'app':_0xd00a('0x40'),'appdata':_0x333ca7[_0x155e48]+'?'+_0x57379b['context']+',${EXTEN},'+_0x3769aa+':'+_0x57379b[_0xd00a('0x14')]+',${EXTEN},'+_0x17aca5,'exten':_0x57379b['exten'],'context':_0x57379b['context'],'priority':_0x51bf1f['priority']+_0x155e48,'VoiceExtensionId':_0x30371a[_0x325425][0x0][_0xd00a('0x15')]});}_0x57379b[_0xd00a('0xe')]=_0x33ae26[_0xd00a('0x2b')]?_[_0xd00a('0x41')](_0x33ae26)[_0xd00a('0xe')]+0x1:_0x51bf1f['priority'];_0x51bf1f[_0xd00a('0xe')]=(_0x16873b[_0xd00a('0x2b')]?_[_0xd00a('0x41')](_0x16873b)[_0xd00a('0xe')]:_0x57379b[_0xd00a('0xe')])+0x1;_0x51bf1f[_0xd00a('0xf')]=_[_0xd00a('0x42')](_0x51bf1f[_0xd00a('0xf')],_0x33ae26,[_0x57379b],_0x16873b);}_0x51bf1f[_0xd00a('0xf')]['push']({'type':_0x30371a[_0x325425][0x0][_0xd00a('0x11')],'app':_0xd00a('0x43'),'exten':_0x30371a[_0x325425][0x0][_0xd00a('0xb')],'context':_0x30371a[_0x325425][0x0][_0xd00a('0x14')],'priority':_0x51bf1f[_0xd00a('0xe')],'VoiceExtensionId':_0x30371a[_0x325425][0x0][_0xd00a('0x15')]});_0x5f4e21[_0xd00a('0x10')](_0x30371a[_0x325425][0x0][_0xd00a('0x15')]);_0x2aade4=_['concat'](_0x2aade4,_0x51bf1f[_0xd00a('0xf')]);}}return _0x262766[_0xd00a('0x44')](function(_0x42c147){return _0x262766[_0xd00a('0x6')]['VoiceExtension'][_0xd00a('0x45')]({'where':{'VoiceExtensionId':{'$in':_0x5f4e21}},'transaction':_0x42c147})[_0xd00a('0x4')](function(_0x8718b4){return _0x262766[_0xd00a('0x6')]['VoiceExtension'][_0xd00a('0x46')](_[_0xd00a('0x47')](_0x2aade4,'priority'),{'transaction':_0x42c147});});});})['catch'](function(_0x252d72){console[_0xd00a('0x48')](_0x252d72);});}exports['rewrite']=rewrite; \ No newline at end of file +var _0x32ce=['recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','updatedAt','interval','*,*,*,*','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','catch','error','rewrite','lodash','models','Interval','findAll','then','intervals','IntervalId','VoiceExtension','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','queue','playback','hasOwnProperty','priority','find','extensions','Set','format','CDR(type)=%s','context','VoiceExtensionId','type','CDR(routeid)=','outbound','push','extension','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid='];(function(_0x33d5f3,_0x1c926c){var _0x4456a0=function(_0x37c965){while(--_0x37c965){_0x33d5f3['push'](_0x33d5f3['shift']());}};_0x4456a0(++_0x1c926c);}(_0x32ce,0xee));var _0xe32c=function(_0x17e629,_0x2332f2){_0x17e629=_0x17e629-0x0;var _0x4fdf39=_0x32ce[_0x17e629];return _0x4fdf39;};'use strict';var _=require(_0xe32c('0x0'));var util=require('util');function rewrite(_0x2234fb,_0x5788b7){var _0x1e8789=this;return _0x2234fb[_0xe32c('0x1')][_0xe32c('0x2')][_0xe32c('0x3')]({'raw':!![]})[_0xe32c('0x4')](function(_0x27ddd0){_0x1e8789[_0xe32c('0x5')]=_0x27ddd0;return _0x2234fb[_0xe32c('0x1')]['VoiceExtension'][_0xe32c('0x3')]({'where':{'IntervalId':_0x5788b7[_0xe32c('0x6')]},'raw':!![]});})['then'](function(_0x5734a4){return _0x2234fb[_0xe32c('0x1')][_0xe32c('0x7')][_0xe32c('0x3')]({'where':{'exten':{'$in':_[_0xe32c('0x8')](_[_0xe32c('0x9')](_0x5734a4,_0xe32c('0xa')))}},'order':[{'raw':_0xe32c('0xb')}],'raw':!![]});})[_0xe32c('0x4')](function(_0x378b9b){var _0x48ee83=_[_0xe32c('0xc')](_0x378b9b,{'priority':'1'});var _0x102102=_[_0xe32c('0xc')](_0x378b9b,{'isApp':0x1});var _0x388c1b=_['groupBy'](_0x102102,'exten');var _0x36dcd5=[_0xe32c('0xd'),_0xe32c('0xe')];var _0x123dfa=[];var _0x39c95c=[];for(var _0x12fc8a in _0x388c1b){if(_0x388c1b[_0xe32c('0xf')](_0x12fc8a)){_0x1e8789[_0xe32c('0x10')]=0x2;_0x1e8789['extensions']=[];_0x1e8789['extension']=_[_0xe32c('0x11')](_0x48ee83,{'exten':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0xa')]});_0x1e8789[_0xe32c('0x12')]['push']({'type':_0x388c1b[_0x12fc8a][0x0]['type'],'app':_0xe32c('0x13'),'appdata':util[_0xe32c('0x14')](_0xe32c('0x15'),_0x388c1b[_0x12fc8a][0x0]['type']),'context':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x16')],'exten':_0x388c1b[_0x12fc8a][0x0]['exten'],'priority':_0x1e8789['priority']++,'VoiceExtensionId':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x17')]});if(_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x18')]==='inbound'){_0x1e8789[_0xe32c('0x12')]['push']({'type':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x18')],'app':_0xe32c('0x13'),'appdata':_0xe32c('0x19')+_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x17')],'context':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x16')],'exten':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0xa')],'priority':_0x1e8789[_0xe32c('0x10')]++,'VoiceExtensionId':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x17')]});}else if(_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x18')]===_0xe32c('0x1a')){if(_0x1e8789['extension']){_0x1e8789['extensions'][_0xe32c('0x1b')]({'type':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x18')],'app':_0xe32c('0x13'),'appdata':'CDR(destination)='+(_0x1e8789[_0xe32c('0x1c')][_0xe32c('0x1d')]?_0xe32c('0x1e')+_0x1e8789['extension'][_0xe32c('0x1d')]+'}':_0xe32c('0x1f')),'context':_0x388c1b[_0x12fc8a][0x0]['context'],'exten':_0x388c1b[_0x12fc8a][0x0]['exten'],'priority':_0x1e8789[_0xe32c('0x10')]++,'VoiceExtensionId':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x17')]});}_0x1e8789[_0xe32c('0x12')]['push']({'type':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x18')],'app':'Set','appdata':'CDR(routeid)='+_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x17')],'context':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x16')],'exten':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0xa')],'priority':_0x1e8789['priority']++,'VoiceExtensionId':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x17')]});var _0x3f8d23=_0x1e8789['priority']++;_0x1e8789[_0xe32c('0x12')][_0xe32c('0x1b')]({'type':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x18')],'app':_0xe32c('0x20'),'appdata':_0xe32c('0x21')+(_0x3f8d23+0x2)+_0xe32c('0x22')+(_0x3f8d23+0x1)+')','context':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x16')],'exten':_0x388c1b[_0x12fc8a][0x0]['exten'],'priority':_0x3f8d23,'VoiceExtensionId':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x17')]});if(_0x1e8789[_0xe32c('0x1c')]){_0x1e8789[_0xe32c('0x12')][_0xe32c('0x1b')]({'type':_0x388c1b[_0x12fc8a][0x0]['type'],'app':_0xe32c('0x13'),'appdata':_0x1e8789[_0xe32c('0x1c')][_0xe32c('0x1d')]?_0xe32c('0x23')+_0x1e8789[_0xe32c('0x1c')][_0xe32c('0x1d')]+'}':_0xe32c('0x24'),'context':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x16')],'exten':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0xa')],'priority':_0x1e8789['priority']++,'VoiceExtensionId':_0x388c1b[_0x12fc8a][0x0]['VoiceExtensionId']});}_0x1e8789[_0xe32c('0x12')]['push']({'type':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x18')],'app':_0xe32c('0x13'),'appdata':_0xe32c('0x25')+_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x17')],'context':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x16')],'exten':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0xa')],'priority':_0x1e8789[_0xe32c('0x10')]++,'VoiceExtensionId':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x17')]});if(_0x1e8789[_0xe32c('0x1c')]&&_0x1e8789[_0xe32c('0x1c')][_0xe32c('0xf')](_0xe32c('0x26'))&&_0x1e8789[_0xe32c('0x1c')][_0xe32c('0x26')]!==_0xe32c('0x27')){_0x1e8789[_0xe32c('0x12')]['push']({'type':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x18')],'app':_0xe32c('0x13'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x16')],'exten':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0xa')],'priority':_0x1e8789[_0xe32c('0x10')]++,'VoiceExtensionId':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x17')]});_0x1e8789[_0xe32c('0x12')][_0xe32c('0x1b')]({'type':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x18')],'app':_0xe32c('0x13'),'appdata':_0xe32c('0x28')+_0x1e8789[_0xe32c('0x1c')][_0xe32c('0x26')]||_0xe32c('0x29'),'context':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x16')],'exten':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0xa')],'priority':_0x1e8789[_0xe32c('0x10')]++,'VoiceExtensionId':_0x388c1b[_0x12fc8a][0x0]['VoiceExtensionId']});}}_0x1e8789['extensions'][_0xe32c('0x1b')]({'type':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x18')],'app':_0xe32c('0x13'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x16')],'exten':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0xa')],'priority':_0x1e8789[_0xe32c('0x10')]++,'VoiceExtensionId':_0x388c1b[_0x12fc8a][0x0]['VoiceExtensionId']});_0x1e8789[_0xe32c('0x12')][_0xe32c('0x1b')]({'type':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x18')],'app':_0xe32c('0x13'),'appdata':_0xe32c('0x2a'),'context':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x16')],'exten':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0xa')],'priority':_0x1e8789[_0xe32c('0x10')]++,'VoiceExtensionId':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x17')]});_0x1e8789[_0xe32c('0x12')]['push']({'type':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x18')],'app':'Set','appdata':_0xe32c('0x2b'),'context':_0x388c1b[_0x12fc8a][0x0]['context'],'exten':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0xa')],'priority':_0x1e8789['priority']++,'VoiceExtensionId':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x17')]});for(var _0x356f02=0x0,_0x2a2691=0x0;_0x356f02<_0x388c1b[_0x12fc8a][_0xe32c('0x2c')];_0x356f02+=0x1,_0x2a2691=0x0){var _0x530573=_0x388c1b[_0x12fc8a][_0x356f02];if(_0x530573['type']){_0x530573[_0xe32c('0x18')]=_0x530573[_0xe32c('0x18')]['toLowerCase']();}var _0xbdcc76=[];var _0x345f22=[];delete _0x530573['id'];delete _0x530573['createdAt'];delete _0x530573[_0xe32c('0x2d')];var _0x929d38=_0x530573[_0xe32c('0x2e')]!==_0xe32c('0x2f')?[_0x530573[_0xe32c('0x2e')]]:_0x530573[_0xe32c('0x6')]?_['map'](_[_0xe32c('0xc')](_0x1e8789[_0xe32c('0x5')],{'IntervalId':_0x530573[_0xe32c('0x6')]}),_0xe32c('0x2e')):[];if(_0x530573['hasOwnProperty']('tag')){if(_0x530573[_0xe32c('0x30')]&&_0x530573[_0xe32c('0x30')]!=='--'){_0xbdcc76[_0xe32c('0x1b')]({'type':_0x530573['type'],'app':'Set','appdata':_0xe32c('0x31')+_0x530573['tag'],'context':_0x530573[_0xe32c('0x16')],'exten':_0x530573[_0xe32c('0xa')],'priority':_0x929d38[_0xe32c('0x2c')]+_0x1e8789['priority']+_0x2a2691++,'VoiceExtensionId':_0x530573[_0xe32c('0x17')]});}}if(_0x530573['type']==='outbound'&&_0x530573['hasOwnProperty'](_0xe32c('0x32'))){if(_0x530573[_0xe32c('0x32')]){_0xbdcc76[_0xe32c('0x1b')]({'type':_0x530573[_0xe32c('0x18')],'app':_0xe32c('0x20'),'appdata':_0xe32c('0x33')+_0x530573[_0xe32c('0x32')]+')','context':_0x530573['context'],'exten':_0x530573[_0xe32c('0xa')],'priority':_0x929d38[_0xe32c('0x2c')]+_0x1e8789[_0xe32c('0x10')]+_0x2a2691++,'VoiceExtensionId':_0x530573[_0xe32c('0x17')]});}else{_0xbdcc76[_0xe32c('0x1b')]({'type':_0x530573[_0xe32c('0x18')],'app':_0xe32c('0x20'),'appdata':_0xe32c('0x34'),'context':_0x530573[_0xe32c('0x16')],'exten':_0x530573['exten'],'priority':_0x929d38['length']+_0x1e8789[_0xe32c('0x10')]+_0x2a2691++,'VoiceExtensionId':_0x530573[_0xe32c('0x17')]});}}if(_0x530573[_0xe32c('0xf')](_0xe32c('0x35'))){if(_0x36dcd5[_0xe32c('0x36')](_0x530573[_0xe32c('0x37')]['toLowerCase']())>=0x0&&_0x530573['appType']!==_0xe32c('0x38')){if(_0x530573['answer']){_0xbdcc76[_0xe32c('0x1b')]({'type':_0x530573[_0xe32c('0x18')],'app':'ExecIf','appdata':_0xe32c('0x39'),'context':_0x530573['context'],'exten':_0x530573[_0xe32c('0xa')],'priority':_0x929d38['length']+_0x1e8789[_0xe32c('0x10')]+_0x2a2691++,'VoiceExtensionId':_0x530573[_0xe32c('0x17')]});_0xbdcc76[_0xe32c('0x1b')]({'type':_0x530573[_0xe32c('0x18')],'app':_0xe32c('0x13'),'appdata':_0xe32c('0x3a'),'context':_0x530573['context'],'exten':_0x530573[_0xe32c('0xa')],'priority':_0x929d38[_0xe32c('0x2c')]+_0x1e8789['priority']+_0x2a2691++,'VoiceExtensionId':_0x530573[_0xe32c('0x17')]});}else{_0xbdcc76[_0xe32c('0x1b')]({'type':_0x530573[_0xe32c('0x18')],'app':_0xe32c('0x20'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x530573[_0xe32c('0x16')],'exten':_0x530573[_0xe32c('0xa')],'priority':_0x929d38[_0xe32c('0x2c')]+_0x1e8789[_0xe32c('0x10')]+_0x2a2691++,'VoiceExtensionId':_0x530573[_0xe32c('0x17')]});_0xbdcc76[_0xe32c('0x1b')]({'type':_0x530573['type'],'app':_0xe32c('0x13'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x530573[_0xe32c('0x16')],'exten':_0x530573['exten'],'priority':_0x929d38['length']+_0x1e8789['priority']+_0x2a2691++,'VoiceExtensionId':_0x530573[_0xe32c('0x17')]});}}}for(var _0xfd7229=0x0;_0xfd7229<_0x929d38[_0xe32c('0x2c')];_0xfd7229+=0x1){var _0x2275e3=_0x1e8789[_0xe32c('0x10')]+_0x929d38[_0xe32c('0x2c')];var _0x506a35=_0xfd7229===_0x929d38['length']-0x1?_0x1e8789[_0xe32c('0x10')]+_0xbdcc76['length']+_0x345f22[_0xe32c('0x2c')]+0x2:_0x1e8789['priority']+_0xfd7229+0x1;_0xbdcc76['splice'](_0xfd7229,0x0,{'type':_0x530573['type'],'app':'GotoIfTime','appdata':_0x929d38[_0xfd7229]+'?'+_0x530573[_0xe32c('0x16')]+_0xe32c('0x3b')+_0x2275e3+':'+_0x530573[_0xe32c('0x16')]+',${EXTEN},'+_0x506a35,'exten':_0x530573[_0xe32c('0xa')],'context':_0x530573[_0xe32c('0x16')],'priority':_0x1e8789['priority']+_0xfd7229,'VoiceExtensionId':_0x388c1b[_0x12fc8a][0x0]['VoiceExtensionId']});}_0x530573[_0xe32c('0x10')]=_0xbdcc76[_0xe32c('0x2c')]?_[_0xe32c('0x3c')](_0xbdcc76)['priority']+0x1:_0x1e8789[_0xe32c('0x10')];_0x1e8789[_0xe32c('0x10')]=(_0x345f22['length']?_[_0xe32c('0x3c')](_0x345f22)[_0xe32c('0x10')]:_0x530573[_0xe32c('0x10')])+0x1;_0x1e8789['extensions']=_[_0xe32c('0x3d')](_0x1e8789[_0xe32c('0x12')],_0xbdcc76,[_0x530573],_0x345f22);}_0x1e8789[_0xe32c('0x12')][_0xe32c('0x1b')]({'type':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x18')],'app':_0xe32c('0x3e'),'exten':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0xa')],'context':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x16')],'priority':_0x1e8789['priority'],'VoiceExtensionId':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x17')]});_0x123dfa[_0xe32c('0x1b')](_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x17')]);_0x39c95c=_[_0xe32c('0x3d')](_0x39c95c,_0x1e8789['extensions']);}}return _0x2234fb[_0xe32c('0x3f')](function(_0x369f68){return _0x2234fb[_0xe32c('0x1')][_0xe32c('0x7')][_0xe32c('0x40')]({'where':{'VoiceExtensionId':{'$in':_0x123dfa}},'transaction':_0x369f68})[_0xe32c('0x4')](function(_0xa6eb4a){return _0x2234fb[_0xe32c('0x1')]['VoiceExtension'][_0xe32c('0x41')](_['sortBy'](_0x39c95c,_0xe32c('0x10')),{'transaction':_0x369f68});});});})[_0xe32c('0x42')](function(_0x8cd9b){console[_0xe32c('0x43')](_0x8cd9b);});}exports[_0xe32c('0x44')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index c3ed809..6581ee9 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 _0x0304=['length','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','push','pick','Error\x20while\x20creating\x20contact:\x20','message','stringify','cmContact','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','toString','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','from','\x20=\x20?','cm_contacts','id\x20IN\x20?','str','phone\x20IS\x20NOT\x20NULL','calleridnum','VoiceQueue','findAll','outbound','CmList','Lists','get','dialCheckDuplicateType','always','sequelize','VoiceQueueId','onlyIfOpen','catch','all','BlackLists','query','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','contact:csv_','resume','emit','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','bluebird','util','papaparse','ioredis','../../../mysqldb','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','argv','undefined','null','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','contact','index','test','isNil','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors'];(function(_0x321b04,_0x9a26ac){var _0x49ed26=function(_0x541dc3){while(--_0x541dc3){_0x321b04['push'](_0x321b04['shift']());}};_0x49ed26(++_0x9a26ac);}(_0x0304,0xc4));var _0x4030=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0x0304[_0x11c573];return _0x6b72de;};'use strict';var BPromise=require(_0x4030('0x0'));var util=require(_0x4030('0x1'));var _=require('lodash');var fs=require('fs');var squel=require('squel');var Papa=require(_0x4030('0x2'));var Redis=require(_0x4030('0x3'));var db=require(_0x4030('0x4'))['db'];var config=require('../../../config/environment');var logger=require(_0x4030('0x5'))(_0x4030('0x6'));config[_0x4030('0x7')]=_[_0x4030('0x8')](config['redis'],{'host':_0x4030('0x9'),'port':0x18eb});var socket=require(_0x4030('0xa'))(new Redis(config[_0x4030('0x7')]));require(_0x4030('0xb'))['register'](socket);try{if(!process[_0x4030('0xc')][0x2]||process[_0x4030('0xc')][0x2]===_0x4030('0xd')||process['argv'][0x2]===_0x4030('0xe')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process['argv'][0x2];if(!process[_0x4030('0xc')][0x3]||process['argv'][0x3]===_0x4030('0xd')||process['argv'][0x3]===_0x4030('0xe')||!process[_0x4030('0xc')][0x4]||process[_0x4030('0xc')][0x4]===_0x4030('0xd')||process[_0x4030('0xc')][0x4]===_0x4030('0xe')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0x4030('0xf')](process[_0x4030('0xc')][0x3]['split'](','),process['argv'][0x4][_0x4030('0x10')](','));if(!process[_0x4030('0xc')][0x5]||process[_0x4030('0xc')][0x5]===_0x4030('0xd')||process[_0x4030('0xc')][0x5]===_0x4030('0xe')){throw new Error(_0x4030('0x11'));}var LISTID=process[_0x4030('0xc')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x4030('0xc')][0x6]!==_0x4030('0xd')&&process[_0x4030('0xc')][0x6]!=='null'?process[_0x4030('0xc')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x4030('0xc')][0x7]!==_0x4030('0xd')&&process[_0x4030('0xc')][0x7]!=='null'?process['argv'][0x7]:null;if(!process[_0x4030('0xc')][0x8]||process[_0x4030('0xc')][0x8]===_0x4030('0xd')||process['argv'][0x8]===_0x4030('0xe')){throw new Error(_0x4030('0x12'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x494b92){logger['error'](_0x494b92);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(_0x159772,_0xa4bf87,_0x273161,_0x3c3a34){var _0x50d84b={'message':_0xa4bf87};_0x50d84b[_0x159772]=!![];if(_0x273161){_0x50d84b[_0x4030('0x13')]=_0x273161;}if(_0x3c3a34){_0x50d84b[_0x4030('0x14')]=_0x3c3a34;}return _0x50d84b;}function isEmail(_0x16218e){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))*$/[_0x4030('0x15')](_0x16218e);}function checkRow(_0x408df6,_0x3fb2a4,_0x524c6e){return new BPromise(function(_0x4855aa,_0x17990a){if(_[_0x4030('0x16')](_0x408df6)){return _0x17990a(handleCheckRowError(_0x4030('0x17'),_0x4030('0x18'),null,_0x524c6e));}if(_0x408df6[_0x4030('0x19')]&&_0x408df6[_0x4030('0x19')][_0x4030('0x1a')]){var _0x24f04d=_['map'](_0x408df6[_0x4030('0x19')],'message')[_0x4030('0x1b')](';');return _0x17990a(handleCheckRowError(_0x4030('0x17'),_0x24f04d,null,_0x524c6e));}var _0x6ab53e={};for(var _0x492163 in FIELDS){if(FIELDS[_0x4030('0x1c')](_0x492163)&&FIELDS[_0x492163]){_0x6ab53e[_0x492163]=_0x408df6[_0x4030('0x1d')][0x0][FIELDS[_0x492163]]||_0x408df6[_0x4030('0x1d')][0x0]['\ufeff'+FIELDS[_0x492163]];}}if(!_0x6ab53e[_0x4030('0x1e')]){return _0x17990a(handleCheckRowError('error',_0x4030('0x1f'),null,_0x524c6e));}if(!_0x6ab53e[_0x4030('0x20')]){return _0x17990a(handleCheckRowError(_0x4030('0x17'),_0x4030('0x21'),null,_0x524c6e));}if(_0x6ab53e[_0x4030('0x22')]){var _0x16af8f=moment(_0x6ab53e[_0x4030('0x22')],_0x4030('0x23'));if(!_0x16af8f[_0x4030('0x24')]()){return _0x17990a(handleCheckRowError(_0x4030('0x17'),_0x4030('0x25'),null,_0x524c6e));}}if(_0x6ab53e[_0x4030('0x26')]){if(!isEmail(_0x6ab53e[_0x4030('0x26')])){return _0x17990a(handleCheckRowError('error',_0x4030('0x27'),null,_0x524c6e));}}_0x6ab53e[_0x4030('0x28')]=LISTID;_0x6ab53e['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x4030('0x1a')]&&_0x3fb2a4){var _0x10adac={};for(var _0x118be9=0x0,_0x54a26f=DUPLICATES[_0x4030('0x1a')];_0x118be9<_0x54a26f;_0x118be9+=0x1){_0x10adac[DUPLICATES[_0x118be9]]=_0x6ab53e[DUPLICATES[_0x118be9]];}var _0x11e143=_['find'](_0x3fb2a4,_0x10adac);if(_0x11e143){return _0x17990a(handleCheckRowError(_0x4030('0x29'),_0x4030('0x2a'),_0x11e143,_0x524c6e));}}return db[_0x4030('0x2b')][_0x4030('0x2c')](_0x6ab53e,{'raw':!![],'hooks':![],'fields':_[_0x4030('0x2d')](_0x6ab53e)})[_0x4030('0x2e')](function(_0x1d84bb){if(DUPLICATES&&DUPLICATES['length']&&_0x3fb2a4){_0x3fb2a4[_0x4030('0x2f')](_[_0x4030('0x30')](_0x6ab53e,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x1d84bb['id'];return _0x4855aa();})['catch'](function(_0x490e5b){return _0x17990a(handleCheckRowError(_0x4030('0x17'),_0x4030('0x31')+(_0x490e5b[_0x4030('0x32')]||JSON[_0x4030('0x33')](_0x490e5b)),null,_0x524c6e));});});}function checkHopper(){function _0x237699(){return function(_0x7038fa){logger[_0x4030('0x17')](_0x4030('0x34'),'checkHopper',util[_0x4030('0x35')](_0x7038fa,{'showHidden':![],'depth':null}));};}var _0x193a5c=function(_0x583fd1,_0x47ccfe){var _0x3ccbf0=squel[_0x4030('0x36')]()[_0x4030('0x37')](_0x4030('0x38'))[_0x4030('0x39')](['phone',_0x4030('0x3a'),_0x4030('0x3b'),'ListId',_0x47ccfe,_0x4030('0x3c'),_0x4030('0x3d')],squel[_0x4030('0x3e')]()[_0x4030('0x3f')](_0x4030('0x20'),_0x4030('0x20'))[_0x4030('0x3f')](_0x4030('0x40'),'scheduledAt')[_0x4030('0x3f')]('id',_0x4030('0x3b'))[_0x4030('0x3f')](LISTID[_0x4030('0x41')](),_0x4030('0x28'))[_0x4030('0x3f')](_0x583fd1['id'][_0x4030('0x41')](),_0x47ccfe)[_0x4030('0x3f')](_0x4030('0x40'),'createdAt')['field']('NOW()',_0x4030('0x3d'))['from']('cm_contacts')[_0x4030('0x42')](_0x4030('0x43'))[_0x4030('0x42')](_0x4030('0x44'),LISTID[_0x4030('0x41')]())[_0x4030('0x42')]('phone\x20IS\x20NOT\x20NULL')['where'](_0x4030('0x45'),squel[_0x4030('0x3e')]()['field'](_0x4030('0x20'))[_0x4030('0x46')](_0x4030('0x38'))[_0x4030('0x42')](_0x47ccfe+_0x4030('0x47'),_0x583fd1['id'][_0x4030('0x41')]())))[_0x4030('0x41')]();return _0x3ccbf0;};var _0x2e10d4=function(_0x4aee43,_0x59270a){var _0x8a9d47=squel[_0x4030('0x36')]()[_0x4030('0x37')](_0x4030('0x38'))[_0x4030('0x39')]([_0x4030('0x20'),_0x4030('0x3a'),_0x4030('0x3b'),_0x4030('0x28'),_0x59270a,_0x4030('0x3c'),_0x4030('0x3d')],squel[_0x4030('0x3e')]()[_0x4030('0x3f')](_0x4030('0x20'),_0x4030('0x20'))[_0x4030('0x3f')](_0x4030('0x40'),_0x4030('0x3a'))[_0x4030('0x3f')]('id',_0x4030('0x3b'))[_0x4030('0x3f')](LISTID[_0x4030('0x41')](),_0x4030('0x28'))[_0x4030('0x3f')](_0x4aee43['id'][_0x4030('0x41')](),_0x59270a)[_0x4030('0x3f')](_0x4030('0x40'),_0x4030('0x3c'))[_0x4030('0x3f')](_0x4030('0x40'),'updatedAt')[_0x4030('0x46')](_0x4030('0x48'))['where'](_0x4030('0x43'))['where'](_0x4030('0x44'),LISTID['toString']())[_0x4030('0x42')](_0x4030('0x49'),squel[_0x4030('0x4a')](hopperContacts))[_0x4030('0x42')](_0x4030('0x4b'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x4030('0x3e')]()[_0x4030('0x3f')](_0x4030('0x4c'))['from']('cm_hopper_final')[_0x4030('0x42')](_0x59270a+_0x4030('0x47'),_0x4aee43['id'][_0x4030('0x41')]()))[_0x4030('0x42')](_0x4030('0x45'),squel['select']()[_0x4030('0x3f')](_0x4030('0x20'))[_0x4030('0x46')](_0x4030('0x38'))['where'](_0x59270a+_0x4030('0x47'),_0x4aee43['id'][_0x4030('0x41')]())))[_0x4030('0x41')]();return _0x8a9d47;};function _0x29d5e8(_0x1d7dfc,_0x19948b){var _0x2b533e=squel[_0x4030('0x36')]()[_0x4030('0x37')](_0x4030('0x38'))[_0x4030('0x39')]([_0x4030('0x20'),_0x4030('0x3a'),_0x4030('0x3b'),_0x4030('0x28'),_0x19948b,_0x4030('0x3c'),_0x4030('0x3d')],squel[_0x4030('0x3e')]()[_0x4030('0x3f')](_0x4030('0x20'),_0x4030('0x20'))[_0x4030('0x3f')](_0x4030('0x40'),_0x4030('0x3a'))[_0x4030('0x3f')]('id',_0x4030('0x3b'))[_0x4030('0x3f')](LISTID[_0x4030('0x41')](),_0x4030('0x28'))['field'](_0x1d7dfc['id'][_0x4030('0x41')](),_0x19948b)[_0x4030('0x3f')](_0x4030('0x40'),'createdAt')['field'](_0x4030('0x40'),_0x4030('0x3d'))[_0x4030('0x46')](_0x4030('0x48'))['where']('deletedAt\x20IS\x20NULL')['where'](_0x4030('0x44'),LISTID[_0x4030('0x41')]())[_0x4030('0x42')](_0x4030('0x49'),squel[_0x4030('0x4a')](hopperContacts))[_0x4030('0x42')]('phone\x20IS\x20NOT\x20NULL'))[_0x4030('0x41')]();return _0x2b533e;}function _0x4e5111(_0x36d34d,_0x279cde){var _0x2775ce=squel[_0x4030('0x36')]()[_0x4030('0x37')]('cm_hopper_black')[_0x4030('0x39')]([_0x4030('0x20'),_0x4030('0x3b'),'ListId',_0x279cde,_0x4030('0x3c'),_0x4030('0x3d')],squel[_0x4030('0x3e')]()[_0x4030('0x3f')]('phone','phone')[_0x4030('0x3f')]('id',_0x4030('0x3b'))[_0x4030('0x3f')](LISTID['toString'](),'ListId')['field'](_0x36d34d['id'][_0x4030('0x41')](),_0x279cde)[_0x4030('0x3f')](_0x4030('0x40'),_0x4030('0x3c'))[_0x4030('0x3f')](_0x4030('0x40'),_0x4030('0x3d'))['from'](_0x4030('0x48'))[_0x4030('0x42')](_0x4030('0x43'))[_0x4030('0x42')](_0x4030('0x44'),LISTID[_0x4030('0x41')]())[_0x4030('0x42')](_0x4030('0x49'),squel['str'](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))['toString']();return _0x2775ce;}return db[_0x4030('0x4d')][_0x4030('0x4e')]({'where':{'type':_0x4030('0x4f')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x4030('0x50')],'as':_0x4030('0x51'),'where':{'id':LISTID}}]})[_0x4030('0x2e')](function(_0x460e41){var _0x16295d=[];if(_0x460e41){var _0x4359a4;for(var _0x195f5f=0x0,_0x16451d;_0x195f5f<_0x460e41['length'];_0x195f5f+=0x1){_0x16451d=_0x460e41[_0x195f5f][_0x4030('0x52')]({'plain':!![]});switch(_0x16451d[_0x4030('0x53')]){case _0x4030('0x54'):_0x16295d['push'](db[_0x4030('0x55')]['query'](_0x2e10d4(_0x16451d,_0x4030('0x56')))[_0x4030('0x2e')](function(){})['catch'](_0x237699()));break;case _0x4030('0x57'):_0x16295d['push'](db[_0x4030('0x55')]['query'](_0x193a5c(_0x16451d,_0x4030('0x56')))[_0x4030('0x2e')](function(){})[_0x4030('0x58')](_0x237699()));break;default:_0x16295d[_0x4030('0x2f')](db[_0x4030('0x55')]['query'](_0x29d5e8(_0x16451d,_0x4030('0x56')))['then'](function(){})[_0x4030('0x58')](_0x237699()));}}}return _0x16295d;})[_0x4030('0x59')]()['then'](function(){return db[_0x4030('0x4d')][_0x4030('0x4e')]({'where':{'type':_0x4030('0x4f')},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x4030('0x5a'),'where':{'id':LISTID}}]})[_0x4030('0x2e')](function(_0x3ef9e5){var _0x1d2919=[];if(_0x3ef9e5){var _0xfaed0d;for(var _0x43301e=0x0,_0x4d32f8;_0x43301e<_0x3ef9e5[_0x4030('0x1a')];_0x43301e+=0x1){_0x4d32f8=_0x3ef9e5[_0x43301e][_0x4030('0x52')]({'plain':!![]});_0x1d2919['push'](db[_0x4030('0x55')][_0x4030('0x5b')](_0x4e5111(_0x4d32f8,'VoiceQueueId'))[_0x4030('0x2e')](function(){})[_0x4030('0x58')](_0x237699()));}}return _0x1d2919;})[_0x4030('0x59')]();})[_0x4030('0x2e')](function(){return db[_0x4030('0x5c')]['findAll']({'attributes':['id',_0x4030('0x53')],'include':[{'model':db[_0x4030('0x50')],'as':'Lists','where':{'id':LISTID}}]})[_0x4030('0x2e')](function(_0x192355){var _0x527c6b=[];if(_0x192355){for(var _0x64aca8=0x0,_0x2535cd;_0x64aca8<_0x192355[_0x4030('0x1a')];_0x64aca8+=0x1){_0x2535cd=_0x192355[_0x64aca8][_0x4030('0x52')]({'plain':!![]});switch(_0x2535cd['dialCheckDuplicateType']){case _0x4030('0x54'):_0x527c6b[_0x4030('0x2f')](db[_0x4030('0x55')]['query'](_0x2e10d4(_0x2535cd,_0x4030('0x5d')))[_0x4030('0x2e')](function(){})[_0x4030('0x58')](_0x237699()));break;case'onlyIfOpen':_0x527c6b[_0x4030('0x2f')](db['sequelize'][_0x4030('0x5b')](_0x193a5c(_0x2535cd,_0x4030('0x5d')))[_0x4030('0x2e')](function(){})[_0x4030('0x58')](_0x237699()));break;default:_0x527c6b[_0x4030('0x2f')](db[_0x4030('0x55')]['query'](_0x29d5e8(_0x2535cd,_0x4030('0x5d')))['then'](function(){})['catch'](_0x237699()));}}}return _0x527c6b;})[_0x4030('0x59')]();})['then'](function(){return db[_0x4030('0x5c')][_0x4030('0x4e')]({'attributes':['id'],'include':[{'model':db[_0x4030('0x50')],'as':_0x4030('0x5a'),'where':{'id':LISTID}}]})['then'](function(_0x2ad705){var _0x26fc7f=[];if(_0x2ad705){for(var _0x53bb50=0x0,_0x5e4ead;_0x53bb50<_0x2ad705['length'];_0x53bb50+=0x1){_0x5e4ead=_0x2ad705[_0x53bb50][_0x4030('0x52')]({'plain':!![]});_0x26fc7f['push'](db['sequelize']['query'](_0x4e5111(_0x5e4ead,_0x4030('0x5d')))[_0x4030('0x2e')](function(){})[_0x4030('0x58')](_0x237699()));}}return _0x26fc7f;})[_0x4030('0x59')]();})['catch'](function(_0x2a1031){logger[_0x4030('0x17')](_0x4030('0x5e'),_0x4030('0x5f'),_0x2a1031['message']);});}var processPromises=function(_0x4f01fc){return BPromise[_0x4030('0x59')](promises)[_0x4030('0x2e')](function(_0x47c01d){})['catch'](function(_0x16ee90){logger[_0x4030('0x17')](_0x4030('0x60'),JSON['stringify'](_0x16ee90));})[_0x4030('0x61')](function(){socket['emit'](_0x4030('0x62')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x4f01fc){return _0x4f01fc[_0x4030('0x63')]();}});};var endCsv=function(){return BPromise['resolve']()[_0x4030('0x2e')](function(){if(hopperContacts){return checkHopper();}})[_0x4030('0x2e')](function(){socket[_0x4030('0x64')](_0x4030('0x62')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x4030('0x65')](FILEPATH);}catch(_0x566d9f){logger[_0x4030('0x17')](_0x4030('0x66'),JSON[_0x4030('0x33')](_0x566d9f));}finally{process[_0x4030('0x67')](0x0);}});};process['on']('SIGINT',function(){logger[_0x4030('0x68')](_0x4030('0x69'));endCsv();});function main(){return BPromise['resolve']()[_0x4030('0x2e')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x4030('0x10')](',');return db[_0x4030('0x2b')][_0x4030('0x4e')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x4030('0x2e')](function(_0x1d3332){var _0x14b4c5=fs[_0x4030('0x6a')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x4030('0x6b')](_0x14b4c5,{'header':!![],'skipEmptyLines':!![],'step':function(_0x198d75,_0x127648){total+=0x1;var _0x2ac119=total;promises[_0x4030('0x2f')](checkRow(_0x198d75,_0x1d3332,_0x2ac119)[_0x4030('0x2e')](function(){success+=0x1;})['catch'](function(_0x3d34f4){if(_0x3d34f4[_0x4030('0x17')]){errors+=0x1;delete _0x3d34f4['error'];}else if(_0x3d34f4[_0x4030('0x29')]){duplicates+=0x1;delete _0x3d34f4[_0x4030('0x29')];}rows[_0x4030('0x2f')](_0x3d34f4);}));if(total%0xc8===0x0){_0x127648[_0x4030('0x6c')]();return processPromises(_0x127648);}},'complete':function(){return processPromises()[_0x4030('0x2e')](function(){logger['info'](_0x4030('0x6d'));endCsv();});},'error':function(_0xc0cd41,_0x3c930d){logger[_0x4030('0x68')](_0x4030('0x6e'),JSON['stringify'](_0xc0cd41));endCsv();}});})[_0x4030('0x58')](function(_0x36c5e0){logger[_0x4030('0x17')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0x4030('0x33')](_0x36c5e0));});}main(); \ No newline at end of file +var _0x26d9=['register','argv','undefined','Missing\x20filepath\x20parameter!','null','Missing\x20binding\x20parameters!','split','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','duplicate','CmContact','create','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','cm_hopper','fromQuery','phone','ContactId','createdAt','updatedAt','select','field','NOW()','scheduledAt','toString','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','insert','into','str','calleridnum','cm_hopper_final','\x20=\x20?','phone\x20NOT\x20IN\x20(?)','id\x20IN\x20?','phone\x20IS\x20NOT\x20NULL','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','get','always','sequelize','VoiceQueueId','query','all','BlackLists','Campaign','Lists','CampaignId','onlyIfOpen','cmContact,\x20%s,\x20%s','finally','emit','resume','resolve','contact:csv_','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','SIGINT','info','CSV\x20import\x20process\x20stopped!','parse','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket'];(function(_0xe540b8,_0x21cb53){var _0x10bae7=function(_0x9aecc0){while(--_0x9aecc0){_0xe540b8['push'](_0xe540b8['shift']());}};_0x10bae7(++_0x21cb53);}(_0x26d9,0x13d));var _0x926d=function(_0x283fe0,_0x341361){_0x283fe0=_0x283fe0-0x0;var _0x31d280=_0x26d9[_0x283fe0];return _0x31d280;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x926d('0x0'));var fs=require('fs');var squel=require(_0x926d('0x1'));var Papa=require(_0x926d('0x2'));var Redis=require(_0x926d('0x3'));var db=require(_0x926d('0x4'))['db'];var config=require(_0x926d('0x5'));var logger=require('../../../config/logger')('api');config[_0x926d('0x6')]=_['defaults'](config[_0x926d('0x6')],{'host':_0x926d('0x7'),'port':0x18eb});var socket=require(_0x926d('0x8'))(new Redis(config['redis']));require(_0x926d('0x9'))[_0x926d('0xa')](socket);try{if(!process[_0x926d('0xb')][0x2]||process[_0x926d('0xb')][0x2]===_0x926d('0xc')||process[_0x926d('0xb')][0x2]==='null'){throw new Error(_0x926d('0xd'));}var FILEPATH=process[_0x926d('0xb')][0x2];if(!process['argv'][0x3]||process[_0x926d('0xb')][0x3]==='undefined'||process[_0x926d('0xb')][0x3]===_0x926d('0xe')||!process[_0x926d('0xb')][0x4]||process[_0x926d('0xb')][0x4]===_0x926d('0xc')||process[_0x926d('0xb')][0x4]===_0x926d('0xe')){throw new Error(_0x926d('0xf'));}var FIELDS=_['zipObject'](process['argv'][0x3][_0x926d('0x10')](','),process['argv'][0x4][_0x926d('0x10')](','));if(!process['argv'][0x5]||process[_0x926d('0xb')][0x5]===_0x926d('0xc')||process['argv'][0x5]===_0x926d('0xe')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x926d('0xb')][0x5];var COMPANYID=process[_0x926d('0xb')][0x6]&&process[_0x926d('0xb')][0x6]!==_0x926d('0xc')&&process[_0x926d('0xb')][0x6]!==_0x926d('0xe')?process[_0x926d('0xb')][0x6]:null;var DUPLICATES=process[_0x926d('0xb')][0x7]&&process[_0x926d('0xb')][0x7]!==_0x926d('0xc')&&process[_0x926d('0xb')][0x7]!==_0x926d('0xe')?process[_0x926d('0xb')][0x7]:null;if(!process[_0x926d('0xb')][0x8]||process[_0x926d('0xb')][0x8]===_0x926d('0xc')||process[_0x926d('0xb')][0x8]===_0x926d('0xe')){throw new Error(_0x926d('0x11'));}var SOCKET_TIMESTAMP=process[_0x926d('0xb')][0x8];}catch(_0x439467){logger[_0x926d('0x12')](_0x439467);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(_0x5275be,_0x207a7d,_0x5660ec,_0x19543b){var _0x57c7ba={'message':_0x207a7d};_0x57c7ba[_0x5275be]=!![];if(_0x5660ec){_0x57c7ba[_0x926d('0x13')]=_0x5660ec;}if(_0x19543b){_0x57c7ba[_0x926d('0x14')]=_0x19543b;}return _0x57c7ba;}function isEmail(_0x27c983){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))*$/[_0x926d('0x15')](_0x27c983);}function checkRow(_0x157415,_0x46205e,_0x74be01){return new BPromise(function(_0x280617,_0x224e3d){if(_[_0x926d('0x16')](_0x157415)){return _0x224e3d(handleCheckRowError(_0x926d('0x12'),_0x926d('0x17'),null,_0x74be01));}if(_0x157415[_0x926d('0x18')]&&_0x157415[_0x926d('0x18')][_0x926d('0x19')]){var _0xf6c5b7=_[_0x926d('0x1a')](_0x157415[_0x926d('0x18')],_0x926d('0x1b'))['join'](';');return _0x224e3d(handleCheckRowError(_0x926d('0x12'),_0xf6c5b7,null,_0x74be01));}var _0xfe2ede={};for(var _0xb7018b in FIELDS){if(FIELDS[_0x926d('0x1c')](_0xb7018b)&&FIELDS[_0xb7018b]){_0xfe2ede[_0xb7018b]=_0x157415[_0x926d('0x1d')][0x0][FIELDS[_0xb7018b]]||_0x157415[_0x926d('0x1d')][0x0]['\ufeff'+FIELDS[_0xb7018b]];}}if(!_0xfe2ede[_0x926d('0x1e')]){return _0x224e3d(handleCheckRowError(_0x926d('0x12'),_0x926d('0x1f'),null,_0x74be01));}if(!_0xfe2ede['phone']){return _0x224e3d(handleCheckRowError('error',_0x926d('0x20'),null,_0x74be01));}if(_0xfe2ede['birthDate']){var _0x1cf4ff=moment(_0xfe2ede[_0x926d('0x21')],_0x926d('0x22'));if(!_0x1cf4ff[_0x926d('0x23')]()){return _0x224e3d(handleCheckRowError('error','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x74be01));}}if(_0xfe2ede['email']){if(!isEmail(_0xfe2ede[_0x926d('0x24')])){return _0x224e3d(handleCheckRowError(_0x926d('0x12'),_0x926d('0x25'),null,_0x74be01));}}_0xfe2ede[_0x926d('0x26')]=LISTID;_0xfe2ede[_0x926d('0x27')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x926d('0x19')]&&_0x46205e){var _0x26c288={};for(var _0x55034f=0x0,_0x3037c3=DUPLICATES[_0x926d('0x19')];_0x55034f<_0x3037c3;_0x55034f+=0x1){_0x26c288[DUPLICATES[_0x55034f]]=_0xfe2ede[DUPLICATES[_0x55034f]];}var _0x3316d5=_['find'](_0x46205e,_0x26c288);if(_0x3316d5){return _0x224e3d(handleCheckRowError(_0x926d('0x28'),'Duplicate\x20Contact',_0x3316d5,_0x74be01));}}return db[_0x926d('0x29')][_0x926d('0x2a')](_0xfe2ede,{'raw':!![],'hooks':![],'fields':_[_0x926d('0x2b')](_0xfe2ede)})[_0x926d('0x2c')](function(_0x30bda4){if(DUPLICATES&&DUPLICATES['length']&&_0x46205e){_0x46205e[_0x926d('0x2d')](_[_0x926d('0x2e')](_0xfe2ede,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x30bda4['id'];return _0x280617();})[_0x926d('0x2f')](function(_0x483fac){return _0x224e3d(handleCheckRowError(_0x926d('0x12'),_0x926d('0x30')+(_0x483fac[_0x926d('0x1b')]||JSON[_0x926d('0x31')](_0x483fac)),null,_0x74be01));});});}function checkHopper(){function _0x4b4482(){return function(_0x33c12d){logger[_0x926d('0x12')](_0x926d('0x32'),_0x926d('0x33'),util[_0x926d('0x34')](_0x33c12d,{'showHidden':![],'depth':null}));};}var _0x4baf49=function(_0x247dbc,_0x4ec383){var _0x251220=squel['insert']()['into'](_0x926d('0x35'))[_0x926d('0x36')]([_0x926d('0x37'),'scheduledAt',_0x926d('0x38'),'ListId',_0x4ec383,_0x926d('0x39'),_0x926d('0x3a')],squel[_0x926d('0x3b')]()[_0x926d('0x3c')](_0x926d('0x37'),_0x926d('0x37'))[_0x926d('0x3c')](_0x926d('0x3d'),_0x926d('0x3e'))[_0x926d('0x3c')]('id',_0x926d('0x38'))['field'](LISTID[_0x926d('0x3f')](),'ListId')[_0x926d('0x3c')](_0x247dbc['id'][_0x926d('0x3f')](),_0x4ec383)[_0x926d('0x3c')](_0x926d('0x3d'),_0x926d('0x39'))[_0x926d('0x3c')](_0x926d('0x3d'),_0x926d('0x3a'))[_0x926d('0x40')](_0x926d('0x41'))[_0x926d('0x42')](_0x926d('0x43'))[_0x926d('0x42')](_0x926d('0x44'),LISTID[_0x926d('0x3f')]())[_0x926d('0x42')]('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x926d('0x3b')]()[_0x926d('0x3c')](_0x926d('0x37'))[_0x926d('0x40')](_0x926d('0x35'))['where'](_0x4ec383+'\x20=\x20?',_0x247dbc['id'][_0x926d('0x3f')]())))[_0x926d('0x3f')]();return _0x251220;};var _0x392fa1=function(_0x2eed56,_0x458b38){var _0x5951c7=squel[_0x926d('0x45')]()[_0x926d('0x46')](_0x926d('0x35'))[_0x926d('0x36')](['phone','scheduledAt','ContactId',_0x926d('0x26'),_0x458b38,_0x926d('0x39'),_0x926d('0x3a')],squel['select']()['field'](_0x926d('0x37'),'phone')[_0x926d('0x3c')]('NOW()',_0x926d('0x3e'))['field']('id','ContactId')[_0x926d('0x3c')](LISTID[_0x926d('0x3f')](),_0x926d('0x26'))[_0x926d('0x3c')](_0x2eed56['id'][_0x926d('0x3f')](),_0x458b38)[_0x926d('0x3c')](_0x926d('0x3d'),'createdAt')[_0x926d('0x3c')](_0x926d('0x3d'),_0x926d('0x3a'))[_0x926d('0x40')](_0x926d('0x41'))[_0x926d('0x42')](_0x926d('0x43'))[_0x926d('0x42')]('ListId\x20=\x20?',LISTID['toString']())[_0x926d('0x42')]('id\x20IN\x20?',squel[_0x926d('0x47')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL')[_0x926d('0x42')]('phone\x20NOT\x20IN\x20(?)',squel[_0x926d('0x3b')]()[_0x926d('0x3c')](_0x926d('0x48'))[_0x926d('0x40')](_0x926d('0x49'))[_0x926d('0x42')](_0x458b38+_0x926d('0x4a'),_0x2eed56['id'][_0x926d('0x3f')]()))[_0x926d('0x42')](_0x926d('0x4b'),squel[_0x926d('0x3b')]()[_0x926d('0x3c')](_0x926d('0x37'))[_0x926d('0x40')](_0x926d('0x35'))[_0x926d('0x42')](_0x458b38+_0x926d('0x4a'),_0x2eed56['id'][_0x926d('0x3f')]())))[_0x926d('0x3f')]();return _0x5951c7;};function _0x4d6a04(_0x287a27,_0x36d847){var _0x5b878e=squel[_0x926d('0x45')]()[_0x926d('0x46')](_0x926d('0x35'))[_0x926d('0x36')]([_0x926d('0x37'),'scheduledAt','ContactId',_0x926d('0x26'),_0x36d847,_0x926d('0x39'),'updatedAt'],squel[_0x926d('0x3b')]()[_0x926d('0x3c')](_0x926d('0x37'),_0x926d('0x37'))['field'](_0x926d('0x3d'),_0x926d('0x3e'))['field']('id',_0x926d('0x38'))[_0x926d('0x3c')](LISTID[_0x926d('0x3f')](),_0x926d('0x26'))[_0x926d('0x3c')](_0x287a27['id']['toString'](),_0x36d847)[_0x926d('0x3c')]('NOW()',_0x926d('0x39'))[_0x926d('0x3c')]('NOW()','updatedAt')[_0x926d('0x40')](_0x926d('0x41'))[_0x926d('0x42')]('deletedAt\x20IS\x20NULL')[_0x926d('0x42')](_0x926d('0x44'),LISTID[_0x926d('0x3f')]())[_0x926d('0x42')](_0x926d('0x4c'),squel[_0x926d('0x47')](hopperContacts))['where'](_0x926d('0x4d')))[_0x926d('0x3f')]();return _0x5b878e;}function _0x447205(_0x3ed7fc,_0xb77a4f){var _0xf0a67b=squel[_0x926d('0x45')]()[_0x926d('0x46')](_0x926d('0x4e'))[_0x926d('0x36')]([_0x926d('0x37'),_0x926d('0x38'),_0x926d('0x26'),_0xb77a4f,'createdAt','updatedAt'],squel[_0x926d('0x3b')]()[_0x926d('0x3c')](_0x926d('0x37'),_0x926d('0x37'))[_0x926d('0x3c')]('id','ContactId')['field'](LISTID[_0x926d('0x3f')](),_0x926d('0x26'))['field'](_0x3ed7fc['id'][_0x926d('0x3f')](),_0xb77a4f)[_0x926d('0x3c')](_0x926d('0x3d'),_0x926d('0x39'))[_0x926d('0x3c')](_0x926d('0x3d'),_0x926d('0x3a'))['from'](_0x926d('0x41'))['where']('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',LISTID[_0x926d('0x3f')]())[_0x926d('0x42')]('id\x20IN\x20?',squel[_0x926d('0x47')](hopperContacts))[_0x926d('0x42')](_0x926d('0x4d')))[_0x926d('0x3f')]();return _0xf0a67b;}return db[_0x926d('0x4f')][_0x926d('0x50')]({'where':{'type':_0x926d('0x51')},'attributes':['id',_0x926d('0x52')],'include':[{'model':db[_0x926d('0x53')],'as':'Lists','where':{'id':LISTID}}]})['then'](function(_0x5e8eb3){var _0x293135=[];if(_0x5e8eb3){var _0x57ede0;for(var _0x3aaca3=0x0,_0x49305d;_0x3aaca3<_0x5e8eb3['length'];_0x3aaca3+=0x1){_0x49305d=_0x5e8eb3[_0x3aaca3][_0x926d('0x54')]({'plain':!![]});switch(_0x49305d[_0x926d('0x52')]){case _0x926d('0x55'):_0x293135[_0x926d('0x2d')](db[_0x926d('0x56')]['query'](_0x392fa1(_0x49305d,_0x926d('0x57')))['then'](function(){})[_0x926d('0x2f')](_0x4b4482()));break;case'onlyIfOpen':_0x293135['push'](db[_0x926d('0x56')][_0x926d('0x58')](_0x4baf49(_0x49305d,_0x926d('0x57')))[_0x926d('0x2c')](function(){})['catch'](_0x4b4482()));break;default:_0x293135['push'](db[_0x926d('0x56')][_0x926d('0x58')](_0x4d6a04(_0x49305d,_0x926d('0x57')))[_0x926d('0x2c')](function(){})['catch'](_0x4b4482()));}}}return _0x293135;})[_0x926d('0x59')]()[_0x926d('0x2c')](function(){return db['VoiceQueue']['findAll']({'where':{'type':_0x926d('0x51')},'attributes':['id'],'include':[{'model':db[_0x926d('0x53')],'as':_0x926d('0x5a'),'where':{'id':LISTID}}]})[_0x926d('0x2c')](function(_0x50b13f){var _0x468f57=[];if(_0x50b13f){var _0xb5250b;for(var _0x1d817a=0x0,_0xa4fdca;_0x1d817a<_0x50b13f[_0x926d('0x19')];_0x1d817a+=0x1){_0xa4fdca=_0x50b13f[_0x1d817a][_0x926d('0x54')]({'plain':!![]});_0x468f57['push'](db[_0x926d('0x56')][_0x926d('0x58')](_0x447205(_0xa4fdca,_0x926d('0x57')))[_0x926d('0x2c')](function(){})[_0x926d('0x2f')](_0x4b4482()));}}return _0x468f57;})['all']();})['then'](function(){return db[_0x926d('0x5b')][_0x926d('0x50')]({'attributes':['id',_0x926d('0x52')],'include':[{'model':db[_0x926d('0x53')],'as':_0x926d('0x5c'),'where':{'id':LISTID}}]})[_0x926d('0x2c')](function(_0x1a6e4d){var _0x504fbf=[];if(_0x1a6e4d){for(var _0x406ee2=0x0,_0x2d4dce;_0x406ee2<_0x1a6e4d['length'];_0x406ee2+=0x1){_0x2d4dce=_0x1a6e4d[_0x406ee2][_0x926d('0x54')]({'plain':!![]});switch(_0x2d4dce[_0x926d('0x52')]){case _0x926d('0x55'):_0x504fbf['push'](db[_0x926d('0x56')][_0x926d('0x58')](_0x392fa1(_0x2d4dce,_0x926d('0x5d')))[_0x926d('0x2c')](function(){})['catch'](_0x4b4482()));break;case _0x926d('0x5e'):_0x504fbf[_0x926d('0x2d')](db[_0x926d('0x56')][_0x926d('0x58')](_0x4baf49(_0x2d4dce,'CampaignId'))[_0x926d('0x2c')](function(){})[_0x926d('0x2f')](_0x4b4482()));break;default:_0x504fbf[_0x926d('0x2d')](db[_0x926d('0x56')][_0x926d('0x58')](_0x4d6a04(_0x2d4dce,'CampaignId'))[_0x926d('0x2c')](function(){})[_0x926d('0x2f')](_0x4b4482()));}}}return _0x504fbf;})[_0x926d('0x59')]();})[_0x926d('0x2c')](function(){return db[_0x926d('0x5b')]['findAll']({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x926d('0x5a'),'where':{'id':LISTID}}]})['then'](function(_0x18e59f){var _0x414a37=[];if(_0x18e59f){for(var _0x2266d6=0x0,_0x4017f8;_0x2266d6<_0x18e59f[_0x926d('0x19')];_0x2266d6+=0x1){_0x4017f8=_0x18e59f[_0x2266d6]['get']({'plain':!![]});_0x414a37[_0x926d('0x2d')](db['sequelize'][_0x926d('0x58')](_0x447205(_0x4017f8,'CampaignId'))['then'](function(){})[_0x926d('0x2f')](_0x4b4482()));}}return _0x414a37;})[_0x926d('0x59')]();})[_0x926d('0x2f')](function(_0x874a8e){logger[_0x926d('0x12')](_0x926d('0x5f'),'generalCheckHopper',_0x874a8e['message']);});}var processPromises=function(_0x305398){return BPromise[_0x926d('0x59')](promises)[_0x926d('0x2c')](function(_0x1f2c71){})['catch'](function(_0x480fcd){logger['error']('Error\x20processing\x20rows\x20block:',JSON[_0x926d('0x31')](_0x480fcd));})[_0x926d('0x60')](function(){socket[_0x926d('0x61')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x305398){return _0x305398[_0x926d('0x62')]();}});};var endCsv=function(){return BPromise[_0x926d('0x63')]()[_0x926d('0x2c')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x926d('0x61')](_0x926d('0x64')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x926d('0x65')](FILEPATH);}catch(_0x58b703){logger[_0x926d('0x12')](_0x926d('0x66'),JSON[_0x926d('0x31')](_0x58b703));}finally{process['exit'](0x0);}});};process['on'](_0x926d('0x67'),function(){logger[_0x926d('0x68')](_0x926d('0x69'));endCsv();});function main(){return BPromise['resolve']()[_0x926d('0x2c')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0x926d('0x29')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x926d('0x2c')](function(_0x2718a1){var _0x4f13cf=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x926d('0x6a')](_0x4f13cf,{'header':!![],'skipEmptyLines':!![],'step':function(_0x2f8055,_0x4cd739){total+=0x1;var _0x1c78a3=total;promises[_0x926d('0x2d')](checkRow(_0x2f8055,_0x2718a1,_0x1c78a3)[_0x926d('0x2c')](function(){success+=0x1;})[_0x926d('0x2f')](function(_0x2d8b9c){if(_0x2d8b9c[_0x926d('0x12')]){errors+=0x1;delete _0x2d8b9c[_0x926d('0x12')];}else if(_0x2d8b9c['duplicate']){duplicates+=0x1;delete _0x2d8b9c[_0x926d('0x28')];}rows[_0x926d('0x2d')](_0x2d8b9c);}));if(total%0xc8===0x0){_0x4cd739['pause']();return processPromises(_0x4cd739);}},'complete':function(){return processPromises()[_0x926d('0x2c')](function(){logger[_0x926d('0x68')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x1c61af,_0x31a0f5){logger[_0x926d('0x68')](_0x926d('0x6b'),JSON[_0x926d('0x31')](_0x1c61af));endCsv();}});})[_0x926d('0x2f')](function(_0x480aa9){logger['error'](_0x926d('0x6c'),JSON[_0x926d('0x31')](_0x480aa9));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index ec619b7..b29ba7a 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 _0x1e42=['catch','argv','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','firstName','firstName\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','SIGINT','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','redis','defaults','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','phone','from','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','into','scheduledat','ListId','createdAt','updatedAt','UserId','fields','join','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22always\x22','cm_contacts.id','insert','fromQuery','ContactId','field','cm_hopper_black','ListId\x20=\x20?','\x20=\x20?','keys','CompanyId','id\x20IN\x20?','min_id','toString','Received\x20SIGINT','error','message','exit','errors','push','code','query','spread','info','main','stringify','send','start','binding','socket_timestamp','root','server/files/tmp','.csv','header','writeFileSync','parse','createReadStream','data','length','hasOwnProperty','trim','isNaN','includes','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','isValid','SystemRow','appendFileSync','rows','Abort\x20parser','SystemError','step','duplicates','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','each','then','finish','affectedRows','emit','unlink'];(function(_0x4b7b62,_0x4920a9){var _0x2280df=function(_0x21e1f8){while(--_0x21e1f8){_0x4b7b62['push'](_0x4b7b62['shift']());}};_0x2280df(++_0x4920a9);}(_0x1e42,0x10c));var _0x21e4=function(_0x47c7b5,_0x19115a){_0x47c7b5=_0x47c7b5-0x0;var _0x506739=_0x1e42[_0x47c7b5];return _0x506739;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x21e4('0x0'));var Papa=require(_0x21e4('0x1'));var util=require(_0x21e4('0x2'));var BPromise=require(_0x21e4('0x3'));var moment=require(_0x21e4('0x4'));var squel=require(_0x21e4('0x5'));var Redis=require(_0x21e4('0x6'));var db=require(_0x21e4('0x7'))['db'];var config=require(_0x21e4('0x8'));var logger=require(_0x21e4('0x9'))('import');config[_0x21e4('0xa')]=_[_0x21e4('0xb')](config[_0x21e4('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x21e4('0xc'))(new Redis(config[_0x21e4('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x21e4('0xd')](_0x21e4('0xe'));function isEmail(_0x12cae2){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))*$/[_0x21e4('0xf')](_0x12cae2);}function selectNotIn(_0x3cb829,_0x3ec5e9,_0x166958,_0x3eb294,_0x2fbba0){return squel[_0x21e4('0x10')]()['field'](_0x21e4('0x11'))[_0x21e4('0x12')](_0x3eb294)['join'](_0x3ec5e9,null,_0x3ec5e9+_0x21e4('0x13')+_0x3eb294+'.'+_0x166958)[_0x21e4('0x14')](_0x3eb294+'.'+_0x166958+'\x20=\x20'+_0x3cb829+'.'+_0x166958)['where'](_0x3ec5e9+_0x21e4('0x15')+_0x2fbba0['join']()+')');}function insertCmHopper(_0x4773ae,_0x2b47f7,_0x3f782d,_0x4e90af,_0x57d3ba){var _0x4453be=[_0x21e4('0x16'),_0x21e4('0x17'),'cm_contacts.id',_0x21e4('0x18'),_0x2b47f7+'.'+_0x4e90af,_0x21e4('0x19'),_0x21e4('0x1a'),_0x21e4('0x1b'),_0x21e4('0x1c'),'\x22'+_0x57d3ba+'\x22'];return squel['insert']()[_0x21e4('0x1d')]('cm_hopper')['fromQuery']([_0x21e4('0x11'),_0x21e4('0x1e'),'ContactId',_0x21e4('0x1f'),_0x4e90af,_0x21e4('0x20'),_0x21e4('0x21'),'priority',_0x21e4('0x22'),'recallme'],squel['select']()[_0x21e4('0x23')](_0x4453be)[_0x21e4('0x12')](_0x2b47f7)[_0x21e4('0x24')](_0x21e4('0x25'),null,_0x21e4('0x26')+_0x2b47f7+_0x21e4('0x27'))['join'](_0x3f782d,null,_0x3f782d+_0x21e4('0x13')+_0x2b47f7+'.'+_0x4e90af)['where'](_0x2b47f7+_0x21e4('0x28'),_0x4773ae)[_0x21e4('0x14')](_0x21e4('0x29'),NOW)[_0x21e4('0x14')](_0x21e4('0x2a'),selectNotIn(_0x2b47f7,_0x3f782d,_0x4e90af,_0x21e4('0x2b'),[_0x21e4('0x2c'),'\x22onlyIfOpen\x22']))[_0x21e4('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x2b47f7,_0x3f782d,_0x4e90af,_0x21e4('0x2b'),[_0x21e4('0x2c')])))['toString']();}function insertCmHopperBlack(_0x322825,_0x5c7519,_0x31c982,_0x577349){var _0x552a7f=[_0x21e4('0x16'),_0x21e4('0x2d'),_0x21e4('0x18'),_0x5c7519+'.'+_0x577349,'cm_contacts.createdAt',_0x21e4('0x1a')];return squel[_0x21e4('0x2e')]()[_0x21e4('0x1d')]('cm_hopper_black')[_0x21e4('0x2f')]([_0x21e4('0x11'),_0x21e4('0x30'),_0x21e4('0x1f'),_0x577349,_0x21e4('0x20'),_0x21e4('0x21')],squel[_0x21e4('0x10')]()['fields'](_0x552a7f)[_0x21e4('0x12')](_0x5c7519)[_0x21e4('0x24')]('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x5c7519+'.CmListId')['join'](_0x31c982,null,_0x31c982+_0x21e4('0x13')+_0x5c7519+'.'+_0x577349)[_0x21e4('0x14')](_0x5c7519+'.CmListId\x20=\x20?',_0x322825)[_0x21e4('0x14')](_0x21e4('0x29'),NOW)['where'](_0x21e4('0x2a'),squel[_0x21e4('0x10')]()[_0x21e4('0x31')]('phone')[_0x21e4('0x12')](_0x21e4('0x32'))[_0x21e4('0x14')](_0x21e4('0x33'),_0x322825)['where'](_0x577349+_0x21e4('0x34'),_0x5c7519+'.'+_0x577349)))['toString']();}function insertCmContact(_0x35817d,_0x6bd0a,_0x94ba8,_0x5e97e6){var _0x3d6840=_['concat'](_[_0x21e4('0x35')](_0x5e97e6),['ListId',_0x21e4('0x36'),'createdAt',_0x21e4('0x21')]);return squel[_0x21e4('0x2e')]()[_0x21e4('0x1d')]('cm_contacts')['fromQuery'](_0x3d6840,squel['select']()[_0x21e4('0x23')](_0x3d6840)[_0x21e4('0x12')](_0x6bd0a)['where']('('+_0x94ba8[_0x21e4('0x24')](',')+')\x20NOT\x20IN\x20?',squel[_0x21e4('0x10')]()['fields'](_0x94ba8)[_0x21e4('0x12')](_0x21e4('0x25'))[_0x21e4('0x14')](_0x21e4('0x33'),_0x35817d)[_0x21e4('0x14')]('deletedAt\x20IS\x20NULL'))[_0x21e4('0x14')](_0x21e4('0x37'),squel[_0x21e4('0x10')]()['field']('MIN(id)',_0x21e4('0x38'))[_0x21e4('0x12')](_0x6bd0a)['group'](_0x94ba8[_0x21e4('0x24')](','))))[_0x21e4('0x39')]();}function handleStop(){logger['info'](_0x21e4('0x3a'));stopped=!![];}function handleUncaughtException(_0x4ea7f2){logger[_0x21e4('0x3b')](_0x4ea7f2[_0x21e4('0x3c')]);process[_0x21e4('0x3d')](0x1);}function handleError(_0x32c2db,_0x5a610e){stats[_0x21e4('0x3e')][_0x21e4('0x3f')]({'name':_0x5a610e[_0x21e4('0x40')],'message':_0x5a610e[_0x21e4('0x3c')],'row':_0x32c2db});}function handleQuery(_0x3e45aa){logger['info'](_0x3e45aa);return db['sequelize'][_0x21e4('0x41')](_0x3e45aa)[_0x21e4('0x42')](function(_0xb37195){results[_0x21e4('0x3f')](_0xb37195);})['catch'](function(_0x5e3b51){logger[_0x21e4('0x3b')](_0x5e3b51[_0x21e4('0x3c')]);});}function main(_0x59854e,_0x240eb9,_0xb6d9b3,_0x77fb84){logger[_0x21e4('0x43')](_0x21e4('0x44'),_0x59854e,JSON[_0x21e4('0x45')](_0x240eb9));process[_0x21e4('0x46')](_0x21e4('0x47'));var _0x1ad143=_0x240eb9[_0x21e4('0x48')];var _0x9c306=_0x240eb9[_0x21e4('0x49')];var _0x57ff2a=path[_0x21e4('0x24')](config[_0x21e4('0x4a')],_0x21e4('0x4b'),_0x9c306+_0x21e4('0x4c'));var _0x28ad43=_[_0x21e4('0x35')](_0x1ad143)[_0x21e4('0x24')]();logger[_0x21e4('0x43')](_0x21e4('0x4d'),_0x28ad43);fs[_0x21e4('0x4e')](_0x57ff2a,_0x28ad43+'\x0a');Papa[_0x21e4('0x4f')](fs[_0x21e4('0x50')](_0x59854e),{'header':!![],'skipEmptyLines':!![],'step':function(_0x557c5e,_0x1b75d7){try{for(var _0x89e0a4=0x0,_0x248956=[];_0x89e0a4<_0x557c5e[_0x21e4('0x51')][_0x21e4('0x52')];_0x89e0a4++){stats['rows']+=0x1;if(_0x557c5e[_0x21e4('0x3e')][_0x89e0a4]){handleError(_0x557c5e['data'][_0x89e0a4],_0x557c5e[_0x21e4('0x3e')][_0x89e0a4]);}else{var _0x20cbfe=[];for(var _0x2bcb41 in _0x1ad143){if(_0x1ad143[_0x21e4('0x53')](_0x2bcb41)){if(_0x557c5e[_0x21e4('0x51')][_0x89e0a4][_0x1ad143[_0x2bcb41]]){var _0x27f1ca=_[_0x21e4('0x54')](_0x557c5e[_0x21e4('0x51')][_0x89e0a4][_0x1ad143[_0x2bcb41]]['replace'](/"/g,'\x27'));switch(_0x2bcb41){case _0x21e4('0x1e'):var _0x16659e=moment(_0x27f1ca,_0x21e4('0xe'),!![]);if(_0x16659e['isValid']()){_0x248956['push']('\x22'+_0x27f1ca+'\x22');}else{_0x20cbfe[_0x21e4('0x3f')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case'priority':var _0x5ab201=parseInt(_0x27f1ca);_0x27f1ca=_[_0x21e4('0x55')](_0x5ab201)||_0x5ab201<0x0||_0x5ab201>0x4?_0x77fb84?0x3:0x2:_0x5ab201;_0x248956[_0x21e4('0x3f')]('\x22'+_0x27f1ca+'\x22');break;case _0x21e4('0x22'):var _0x57eee9=parseInt(_0x27f1ca);if(_['isNumber'](_0x57eee9)&&_[_0x21e4('0x56')](_0xb6d9b3,_0x57eee9)){_0x248956[_0x21e4('0x3f')]('\x22'+_0x57eee9+'\x22');}else{_0x20cbfe[_0x21e4('0x3f')](_0x21e4('0x57'));}break;case'email':if(isEmail(_0x27f1ca)){_0x248956[_0x21e4('0x3f')]('\x22'+_0x27f1ca+'\x22');}else{_0x20cbfe['push'](_0x21e4('0x58'));}break;case _0x21e4('0x59'):var _0x8d4939=moment(_0x27f1ca,_0x21e4('0x5a'),!![]);if(_0x8d4939[_0x21e4('0x5b')]()){_0x248956['push']('\x22'+_0x27f1ca+'\x22');}else{_0x20cbfe['push']('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x248956['push']('\x22'+_0x27f1ca+'\x22');}}else{switch(_0x2bcb41){case'firstName':case _0x21e4('0x11'):_0x20cbfe['push'](_0x2bcb41+'\x20not\x20specified');break;default:_0x248956['push']('\x22\x22');}}}}if(_0x20cbfe[_0x21e4('0x52')]){handleError(_0x557c5e['data'][_0x89e0a4],{'code':_0x21e4('0x5c'),'message':_0x20cbfe['join']()});}else{fs[_0x21e4('0x5d')](_0x57ff2a,_0x248956[_0x21e4('0x24')]()+'\x0a');}_0x248956=[];}if(!(stats[_0x21e4('0x5e')]%0xc8)){socket['emit']('contact:import:'+_0x9c306,stats);stats[_0x21e4('0x3e')]=[];}}if(stopped){logger[_0x21e4('0x43')](_0x21e4('0x5f'));_0x1b75d7['abort']();}}catch(_0x433b19){handleError(_0x557c5e[_0x21e4('0x51')][_0x89e0a4],{'code':_0x21e4('0x60'),'message':_0x433b19[_0x21e4('0x3c')]});logger['error'](_0x21e4('0x61'),_0x433b19[_0x21e4('0x3c')]);}},'complete':function(){try{var _0x3ff15f=[];var _0x5c2cb4='cm_contacts';if(_0x240eb9[_0x21e4('0x62')]&&_0x240eb9[_0x21e4('0x62')][_0x21e4('0x52')]){_0x5c2cb4='cm_contacts_'+_0x9c306;_0x3ff15f[_0x21e4('0x3f')](_0x21e4('0x63')+_0x5c2cb4+_0x21e4('0x64'));}var _0x4305c5=util[_0x21e4('0xd')](_0x21e4('0x65'),_0x57ff2a,_0x5c2cb4,_0x28ad43,_0x240eb9[_0x21e4('0x1f')],_0x240eb9[_0x21e4('0x36')]||null,NOW,NOW);if(_[_0x21e4('0x66')](_0x1ad143['scheduledat'])){_0x4305c5+=_0x21e4('0x67');}_0x3ff15f[_0x21e4('0x3f')](_0x4305c5);if(_0x240eb9['duplicates']&&_0x240eb9[_0x21e4('0x62')]['length']){_0x3ff15f[_0x21e4('0x3f')](insertCmContact(_0x240eb9[_0x21e4('0x1f')],_0x5c2cb4,_0x240eb9[_0x21e4('0x62')],_0x1ad143));_0x3ff15f['push'](_0x21e4('0x68')+_0x5c2cb4+';');}_0x3ff15f[_0x21e4('0x3f')](insertCmHopper(_0x240eb9[_0x21e4('0x1f')],_0x21e4('0x69'),_0x21e4('0x6a'),_0x21e4('0x6b'),_0x77fb84));_0x3ff15f[_0x21e4('0x3f')](insertCmHopperBlack(_0x240eb9[_0x21e4('0x1f')],_0x21e4('0x6c'),_0x21e4('0x6a'),'VoiceQueueId'));_0x3ff15f['push'](insertCmHopper(_0x240eb9[_0x21e4('0x1f')],_0x21e4('0x6d'),_0x21e4('0x6e'),_0x21e4('0x6f'),_0x77fb84));_0x3ff15f[_0x21e4('0x3f')](insertCmHopperBlack(_0x240eb9[_0x21e4('0x1f')],_0x21e4('0x70'),_0x21e4('0x6e'),_0x21e4('0x6f')));BPromise[_0x21e4('0x71')](_0x3ff15f,handleQuery)[_0x21e4('0x72')](function(_0x18959d){stats[_0x21e4('0x73')]=!![];stats[_0x21e4('0x74')]=_0x240eb9[_0x21e4('0x62')]&&_0x240eb9[_0x21e4('0x62')][_0x21e4('0x52')]?results[0x2]['affectedRows']:results[0x0][_0x21e4('0x74')];socket[_0x21e4('0x75')]('contact:import:'+_0x9c306,stats);fs['unlink'](_0x59854e);fs[_0x21e4('0x76')](_0x57ff2a);process[_0x21e4('0x3d')](0x0);})[_0x21e4('0x77')](function(_0x545eed){logger[_0x21e4('0x3b')](_0x545eed[_0x21e4('0x3c')]);process['exit'](0x1);});}catch(_0x541ceb){logger[_0x21e4('0x3b')]('complete',_0x541ceb[_0x21e4('0x3c')]);process['exit'](0x1);}},'error':function(_0x5f2dd5,_0xd9521d,_0x20ad7e,_0x38e536){throw new Error(_0x38e536);}});}function validate(){if(process[_0x21e4('0x78')]&&process[_0x21e4('0x78')][_0x21e4('0x52')]<0x4){throw new Error('arguments\x20\x20\x20');}var _0x5d79ff=path[_0x21e4('0x24')](config[_0x21e4('0x4a')],_0x21e4('0x4b'),process[_0x21e4('0x78')][0x2]);if(!fs[_0x21e4('0x79')](_0x5d79ff)){throw new Error(_0x21e4('0x7a'));}var _0x5576d1={};try{_0x5576d1=JSON[_0x21e4('0x4f')](process[_0x21e4('0x78')][0x3]);if(!_0x5576d1[_0x21e4('0x48')]){throw new Error(_0x21e4('0x7b'));}if(!_0x5576d1[_0x21e4('0x48')][_0x21e4('0x11')]){throw new Error('phone\x20is\x20mandatory');}if(!_0x5576d1[_0x21e4('0x48')][_0x21e4('0x7c')]){throw new Error(_0x21e4('0x7d'));}var _0x13c3a4=0x0;if(_0x5576d1[_0x21e4('0x48')][_0x21e4('0x22')]){_0x13c3a4=0x1;}if(!_0x5576d1['ListId']){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x2bd71c){throw new Error(_0x21e4('0x7e'));}var _0x2b7afc=[];try{_0x2b7afc=_['map'](JSON['parse'](process[_0x21e4('0x78')][0x4]),'id');}catch(_0x3d8cfb){logger[_0x21e4('0x43')](_0x21e4('0x7f'));}main(_0x5d79ff,_0x5576d1,_0x2b7afc,_0x13c3a4);}validate();process['on'](_0x21e4('0x80'),handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file +var _0x5b99=['campaigns_has_cm_blacklists','each','then','finish','affectedRows','unlink','exit','complete','argv','arguments\x20\x20\x20','root','existsSync','file\x20doesn\x27t\x20exists','parse','firstName','firstName\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','path','lodash','papaparse','bluebird','moment','ioredis','../../../mysqldb','../../../config/logger','redis','defaults','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','join','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','cm_hopper','fromQuery','scheduledat','ContactId','createdAt','priority','UserId','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.id\x20=\x20','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','cm_hopper_black','ListId','updatedAt','.CmListId\x20=\x20?','\x20=\x20?','CompanyId','into',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','Received\x20SIGINT','errors','push','code','message','info','sequelize','query','spread','catch','error','main','stringify','send','start','binding','socket_timestamp','server/files/tmp','.csv','keys','header','length','rows','data','trim','replace','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','agent\x20not\x20exists','email','dateOfBirth','isValid','\x20not\x20specified','SystemRow','emit','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','\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',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','campaigns_has_cm_lists','campaigns','CampaignId'];(function(_0x2ea70b,_0x902c22){var _0x4772c8=function(_0x2562e8){while(--_0x2562e8){_0x2ea70b['push'](_0x2ea70b['shift']());}};_0x4772c8(++_0x902c22);}(_0x5b99,0x1a6));var _0x95b9=function(_0x11a220,_0x4e470a){_0x11a220=_0x11a220-0x0;var _0x20d8fe=_0x5b99[_0x11a220];return _0x20d8fe;};'use strict';var fs=require('fs');var path=require(_0x95b9('0x0'));var _=require(_0x95b9('0x1'));var Papa=require(_0x95b9('0x2'));var util=require('util');var BPromise=require(_0x95b9('0x3'));var moment=require(_0x95b9('0x4'));var squel=require('squel');var Redis=require(_0x95b9('0x5'));var db=require(_0x95b9('0x6'))['db'];var config=require('../../../config/environment');var logger=require(_0x95b9('0x7'))('import');config[_0x95b9('0x8')]=_[_0x95b9('0x9')](config[_0x95b9('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x95b9('0xa'))(new Redis(config[_0x95b9('0x8')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()['format'](_0x95b9('0xb'));function isEmail(_0x40737f){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))*$/[_0x95b9('0xc')](_0x40737f);}function selectNotIn(_0x354a19,_0x296f26,_0x151a89,_0x133b5f,_0x9a0489){return squel[_0x95b9('0xd')]()[_0x95b9('0xe')](_0x95b9('0xf'))[_0x95b9('0x10')](_0x133b5f)[_0x95b9('0x11')](_0x296f26,null,_0x296f26+'.id\x20=\x20'+_0x133b5f+'.'+_0x151a89)[_0x95b9('0x12')](_0x133b5f+'.'+_0x151a89+_0x95b9('0x13')+_0x354a19+'.'+_0x151a89)[_0x95b9('0x12')](_0x296f26+_0x95b9('0x14')+_0x9a0489['join']()+')');}function insertCmHopper(_0x30cf6f,_0x445e25,_0x47fa8c,_0x493491,_0x3d1d39){var _0x5d1102=[_0x95b9('0x15'),_0x95b9('0x16'),_0x95b9('0x17'),_0x95b9('0x18'),_0x445e25+'.'+_0x493491,_0x95b9('0x19'),_0x95b9('0x1a'),_0x95b9('0x1b'),_0x95b9('0x1c'),'\x22'+_0x3d1d39+'\x22'];return squel[_0x95b9('0x1d')]()['into'](_0x95b9('0x1e'))[_0x95b9('0x1f')]([_0x95b9('0xf'),_0x95b9('0x20'),_0x95b9('0x21'),'ListId',_0x493491,_0x95b9('0x22'),'updatedAt',_0x95b9('0x23'),_0x95b9('0x24'),'recallme'],squel[_0x95b9('0xd')]()[_0x95b9('0x25')](_0x5d1102)[_0x95b9('0x10')](_0x445e25)[_0x95b9('0x11')](_0x95b9('0x26'),null,_0x95b9('0x27')+_0x445e25+'.CmListId')[_0x95b9('0x11')](_0x47fa8c,null,_0x47fa8c+_0x95b9('0x28')+_0x445e25+'.'+_0x493491)['where'](_0x445e25+'.CmListId\x20=\x20?',_0x30cf6f)[_0x95b9('0x12')](_0x95b9('0x29'),NOW)['where'](_0x95b9('0x2a'),selectNotIn(_0x445e25,_0x47fa8c,_0x493491,_0x95b9('0x1e'),['\x22always\x22','\x22onlyIfOpen\x22']))[_0x95b9('0x12')](_0x95b9('0x2a'),selectNotIn(_0x445e25,_0x47fa8c,_0x493491,'cm_hopper',[_0x95b9('0x2b')])))[_0x95b9('0x2c')]();}function insertCmHopperBlack(_0x1e96d4,_0x3c07b5,_0xf317a4,_0x265eda){var _0x5aa1ce=[_0x95b9('0x15'),_0x95b9('0x17'),'cm_contacts.ListId',_0x3c07b5+'.'+_0x265eda,_0x95b9('0x19'),_0x95b9('0x1a')];return squel['insert']()['into'](_0x95b9('0x2d'))[_0x95b9('0x1f')]([_0x95b9('0xf'),_0x95b9('0x21'),_0x95b9('0x2e'),_0x265eda,'createdAt',_0x95b9('0x2f')],squel['select']()[_0x95b9('0x25')](_0x5aa1ce)[_0x95b9('0x10')](_0x3c07b5)['join']('cm_contacts',null,_0x95b9('0x27')+_0x3c07b5+'.CmListId')[_0x95b9('0x11')](_0xf317a4,null,_0xf317a4+_0x95b9('0x28')+_0x3c07b5+'.'+_0x265eda)[_0x95b9('0x12')](_0x3c07b5+_0x95b9('0x30'),_0x1e96d4)[_0x95b9('0x12')](_0x95b9('0x29'),NOW)[_0x95b9('0x12')](_0x95b9('0x2a'),squel[_0x95b9('0xd')]()['field']('phone')[_0x95b9('0x10')]('cm_hopper_black')[_0x95b9('0x12')]('ListId\x20=\x20?',_0x1e96d4)['where'](_0x265eda+_0x95b9('0x31'),_0x3c07b5+'.'+_0x265eda)))[_0x95b9('0x2c')]();}function insertCmContact(_0x4b2c9d,_0x4ae434,_0x25ecae,_0x20a351){var _0x1145b6=_['concat'](_['keys'](_0x20a351),[_0x95b9('0x2e'),_0x95b9('0x32'),'createdAt',_0x95b9('0x2f')]);return squel['insert']()[_0x95b9('0x33')]('cm_contacts')[_0x95b9('0x1f')](_0x1145b6,squel[_0x95b9('0xd')]()[_0x95b9('0x25')](_0x1145b6)[_0x95b9('0x10')](_0x4ae434)['where']('('+_0x25ecae[_0x95b9('0x11')](',')+_0x95b9('0x34'),squel['select']()['fields'](_0x25ecae)['from']('cm_contacts')['where'](_0x95b9('0x35'),_0x4b2c9d)['where'](_0x95b9('0x36')))[_0x95b9('0x12')](_0x95b9('0x37'),squel[_0x95b9('0xd')]()[_0x95b9('0xe')](_0x95b9('0x38'),_0x95b9('0x39'))[_0x95b9('0x10')](_0x4ae434)[_0x95b9('0x3a')](_0x25ecae[_0x95b9('0x11')](','))))[_0x95b9('0x2c')]();}function handleStop(){logger['info'](_0x95b9('0x3b'));stopped=!![];}function handleUncaughtException(_0x3c3d6d){logger['error'](_0x3c3d6d['message']);process['exit'](0x1);}function handleError(_0x3e8250,_0x31ed86){stats[_0x95b9('0x3c')][_0x95b9('0x3d')]({'name':_0x31ed86[_0x95b9('0x3e')],'message':_0x31ed86[_0x95b9('0x3f')],'row':_0x3e8250});}function handleQuery(_0x36066f){logger[_0x95b9('0x40')](_0x36066f);return db[_0x95b9('0x41')][_0x95b9('0x42')](_0x36066f)[_0x95b9('0x43')](function(_0xadc0cb){results[_0x95b9('0x3d')](_0xadc0cb);})[_0x95b9('0x44')](function(_0x2e93ee){logger[_0x95b9('0x45')](_0x2e93ee['message']);});}function main(_0x64afe6,_0x5aa2fc,_0x4e83d2,_0x13930e){logger[_0x95b9('0x40')](_0x95b9('0x46'),_0x64afe6,JSON[_0x95b9('0x47')](_0x5aa2fc));process[_0x95b9('0x48')](_0x95b9('0x49'));var _0x4cb3ab=_0x5aa2fc[_0x95b9('0x4a')];var _0x21c158=_0x5aa2fc[_0x95b9('0x4b')];var _0xc46dcc=path[_0x95b9('0x11')](config['root'],_0x95b9('0x4c'),_0x21c158+_0x95b9('0x4d'));var _0x47061d=_[_0x95b9('0x4e')](_0x4cb3ab)[_0x95b9('0x11')]();logger[_0x95b9('0x40')](_0x95b9('0x4f'),_0x47061d);fs['writeFileSync'](_0xc46dcc,_0x47061d+'\x0a');Papa['parse'](fs['createReadStream'](_0x64afe6),{'header':!![],'skipEmptyLines':!![],'step':function(_0x8937d2,_0xe08ed6){try{for(var _0xe73004=0x0,_0x3c5b24=[];_0xe73004<_0x8937d2['data'][_0x95b9('0x50')];_0xe73004++){stats[_0x95b9('0x51')]+=0x1;if(_0x8937d2[_0x95b9('0x3c')][_0xe73004]){handleError(_0x8937d2[_0x95b9('0x52')][_0xe73004],_0x8937d2[_0x95b9('0x3c')][_0xe73004]);}else{var _0x3f84f7=[];for(var _0x4e2762 in _0x4cb3ab){if(_0x4cb3ab['hasOwnProperty'](_0x4e2762)){if(_0x8937d2[_0x95b9('0x52')][_0xe73004][_0x4cb3ab[_0x4e2762]]){var _0x7d8f0f=_[_0x95b9('0x53')](_0x8937d2[_0x95b9('0x52')][_0xe73004][_0x4cb3ab[_0x4e2762]][_0x95b9('0x54')](/"/g,'\x27'));switch(_0x4e2762){case'scheduledat':var _0xaa8029=moment(_0x7d8f0f,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0xaa8029['isValid']()){_0x3c5b24['push']('\x22'+_0x7d8f0f+'\x22');}else{_0x3f84f7['push'](_0x95b9('0x55'));}break;case _0x95b9('0x23'):var _0x2af70e=parseInt(_0x7d8f0f);_0x7d8f0f=_[_0x95b9('0x56')](_0x2af70e)||_0x2af70e<0x0||_0x2af70e>0x4?_0x13930e?0x3:0x2:_0x2af70e;_0x3c5b24['push']('\x22'+_0x7d8f0f+'\x22');break;case _0x95b9('0x24'):var _0xe44722=parseInt(_0x7d8f0f);if(_[_0x95b9('0x57')](_0xe44722)&&_['includes'](_0x4e83d2,_0xe44722)){_0x3c5b24[_0x95b9('0x3d')]('\x22'+_0xe44722+'\x22');}else{_0x3f84f7['push'](_0x95b9('0x58'));}break;case _0x95b9('0x59'):if(isEmail(_0x7d8f0f)){_0x3c5b24['push']('\x22'+_0x7d8f0f+'\x22');}else{_0x3f84f7['push']('email\x20wrong\x20format');}break;case _0x95b9('0x5a'):var _0x2623e8=moment(_0x7d8f0f,'YYYY-MM-DD',!![]);if(_0x2623e8[_0x95b9('0x5b')]()){_0x3c5b24['push']('\x22'+_0x7d8f0f+'\x22');}else{_0x3f84f7[_0x95b9('0x3d')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x3c5b24[_0x95b9('0x3d')]('\x22'+_0x7d8f0f+'\x22');}}else{switch(_0x4e2762){case'firstName':case _0x95b9('0xf'):_0x3f84f7[_0x95b9('0x3d')](_0x4e2762+_0x95b9('0x5c'));break;default:_0x3c5b24[_0x95b9('0x3d')]('\x22\x22');}}}}if(_0x3f84f7[_0x95b9('0x50')]){handleError(_0x8937d2[_0x95b9('0x52')][_0xe73004],{'code':_0x95b9('0x5d'),'message':_0x3f84f7[_0x95b9('0x11')]()});}else{fs['appendFileSync'](_0xc46dcc,_0x3c5b24[_0x95b9('0x11')]()+'\x0a');}_0x3c5b24=[];}if(!(stats[_0x95b9('0x51')]%0xc8)){socket[_0x95b9('0x5e')](_0x95b9('0x5f')+_0x21c158,stats);stats[_0x95b9('0x3c')]=[];}}if(stopped){logger[_0x95b9('0x40')](_0x95b9('0x60'));_0xe08ed6[_0x95b9('0x61')]();}}catch(_0xb909d3){handleError(_0x8937d2[_0x95b9('0x52')][_0xe73004],{'code':_0x95b9('0x62'),'message':_0xb909d3[_0x95b9('0x3f')]});logger[_0x95b9('0x45')](_0x95b9('0x63'),_0xb909d3['message']);}},'complete':function(){try{var _0x2add3d=[];var _0x39de27=_0x95b9('0x26');if(_0x5aa2fc[_0x95b9('0x64')]&&_0x5aa2fc['duplicates'][_0x95b9('0x50')]){_0x39de27=_0x95b9('0x65')+_0x21c158;_0x2add3d[_0x95b9('0x3d')]('CREATE\x20TABLE\x20'+_0x39de27+_0x95b9('0x66'));}var _0x3ffefe=util[_0x95b9('0x67')](_0x95b9('0x68'),_0xc46dcc,_0x39de27,_0x47061d,_0x5aa2fc['ListId'],_0x5aa2fc[_0x95b9('0x32')]||null,NOW,NOW);if(_[_0x95b9('0x69')](_0x4cb3ab[_0x95b9('0x20')])){_0x3ffefe+=_0x95b9('0x6a');}_0x2add3d[_0x95b9('0x3d')](_0x3ffefe);if(_0x5aa2fc[_0x95b9('0x64')]&&_0x5aa2fc[_0x95b9('0x64')]['length']){_0x2add3d[_0x95b9('0x3d')](insertCmContact(_0x5aa2fc[_0x95b9('0x2e')],_0x39de27,_0x5aa2fc[_0x95b9('0x64')],_0x4cb3ab));_0x2add3d['push'](_0x95b9('0x6b')+_0x39de27+';');}_0x2add3d[_0x95b9('0x3d')](insertCmHopper(_0x5aa2fc[_0x95b9('0x2e')],_0x95b9('0x6c'),_0x95b9('0x6d'),_0x95b9('0x6e'),_0x13930e));_0x2add3d[_0x95b9('0x3d')](insertCmHopperBlack(_0x5aa2fc['ListId'],'voice_queues_has_cm_blacklists','voice_queues',_0x95b9('0x6e')));_0x2add3d[_0x95b9('0x3d')](insertCmHopper(_0x5aa2fc[_0x95b9('0x2e')],_0x95b9('0x6f'),_0x95b9('0x70'),_0x95b9('0x71'),_0x13930e));_0x2add3d['push'](insertCmHopperBlack(_0x5aa2fc[_0x95b9('0x2e')],_0x95b9('0x72'),_0x95b9('0x70'),_0x95b9('0x71')));BPromise[_0x95b9('0x73')](_0x2add3d,handleQuery)[_0x95b9('0x74')](function(_0x1c35f7){stats[_0x95b9('0x75')]=!![];stats[_0x95b9('0x76')]=_0x5aa2fc[_0x95b9('0x64')]&&_0x5aa2fc['duplicates'][_0x95b9('0x50')]?results[0x2]['affectedRows']:results[0x0]['affectedRows'];socket['emit'](_0x95b9('0x5f')+_0x21c158,stats);fs[_0x95b9('0x77')](_0x64afe6);fs['unlink'](_0xc46dcc);process[_0x95b9('0x78')](0x0);})['catch'](function(_0x5cca9d){logger[_0x95b9('0x45')](_0x5cca9d[_0x95b9('0x3f')]);process[_0x95b9('0x78')](0x1);});}catch(_0x3557fd){logger[_0x95b9('0x45')](_0x95b9('0x79'),_0x3557fd[_0x95b9('0x3f')]);process[_0x95b9('0x78')](0x1);}},'error':function(_0x20fc3f,_0x4cfa1e,_0x455159,_0x561bdb){throw new Error(_0x561bdb);}});}function validate(){if(process[_0x95b9('0x7a')]&&process[_0x95b9('0x7a')][_0x95b9('0x50')]<0x4){throw new Error(_0x95b9('0x7b'));}var _0x92c8a4=path[_0x95b9('0x11')](config[_0x95b9('0x7c')],_0x95b9('0x4c'),process['argv'][0x2]);if(!fs[_0x95b9('0x7d')](_0x92c8a4)){throw new Error(_0x95b9('0x7e'));}var _0x27e257={};try{_0x27e257=JSON[_0x95b9('0x7f')](process[_0x95b9('0x7a')][0x3]);if(!_0x27e257[_0x95b9('0x4a')]){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x27e257['binding'][_0x95b9('0xf')]){throw new Error('phone\x20is\x20mandatory');}if(!_0x27e257[_0x95b9('0x4a')][_0x95b9('0x80')]){throw new Error(_0x95b9('0x81'));}var _0x31793f=0x0;if(_0x27e257[_0x95b9('0x4a')][_0x95b9('0x24')]){_0x31793f=0x1;}if(!_0x27e257[_0x95b9('0x2e')]){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x1a65f3){throw new Error(_0x95b9('0x82'));}var _0x1482ec=[];try{_0x1482ec=_[_0x95b9('0x83')](JSON[_0x95b9('0x7f')](process[_0x95b9('0x7a')][0x4]),'id');}catch(_0x239c07){logger[_0x95b9('0x40')](_0x95b9('0x84'));}main(_0x92c8a4,_0x27e257,_0x1482ec,_0x31793f);}validate();process['on'](_0x95b9('0x85'),handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 9ec14ac..015502e 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 _0x6468=['Agent\x20Ring','agentconnectAt','holdtime','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','membername','starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','voice','push','queue','calleridnum','outbound','variable','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','destexten','UniqueId','uniqueid','Date','agentcalledAt','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x6468,0x15f));var _0x8646=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x6468[_0x54d4fe];return _0x1ab5bb;};'use strict';exports[_0x8646('0x0')]=function(_0x190aeb,_0x3d87a9){var _0x26dcd6=[{'type':_0x8646('0x1'),'content':_0x8646('0x2'),'variableName':null}];switch(_0x190aeb[_0x8646('0x3')]()){case _0x8646('0x4'):switch(_0x3d87a9[_0x8646('0x3')]()){case'inbound':_0x26dcd6[_0x8646('0x5')]({'type':'variable','content':'','variableName':_0x8646('0x6')});_0x26dcd6[_0x8646('0x5')]({'type':'variable','content':'','variableName':_0x8646('0x7')});break;case _0x8646('0x8'):_0x26dcd6[_0x8646('0x5')]({'type':_0x8646('0x1'),'content':'Outbound\x20Call','variableName':null});_0x26dcd6[_0x8646('0x5')]({'type':_0x8646('0x9'),'content':'','variableName':_0x8646('0xa')});break;}}return _0x26dcd6;};exports[_0x8646('0xb')]=function(_0x3c8db2,_0x250d74){var _0x3266ef=[];switch(_0x3c8db2['toLowerCase']()){case _0x8646('0x4'):switch(_0x250d74[_0x8646('0x3')]()){case'inbound':_0x3266ef=[{'type':'string','content':_0x8646('0xc'),'key':null,'keyType':null,'variableName':null},{'type':_0x8646('0xd'),'content':'','key':_0x8646('0xe'),'keyType':_0x8646('0x9'),'variableName':'calleridnum'},{'type':_0x8646('0xd'),'content':'','key':_0x8646('0xf'),'keyType':_0x8646('0x9'),'variableName':_0x8646('0x10')},{'type':_0x8646('0xd'),'content':'','key':_0x8646('0x11'),'keyType':'variable','variableName':_0x8646('0x12')},{'type':_0x8646('0xd'),'content':'','key':'Queue','keyType':_0x8646('0x9'),'variableName':_0x8646('0x6')},{'type':_0x8646('0xd'),'content':'','key':_0x8646('0x13'),'keyType':_0x8646('0x9'),'variableName':_0x8646('0x14')},{'type':'keyValue','content':'','key':_0x8646('0x15'),'keyType':_0x8646('0x9'),'variableName':_0x8646('0x16')},{'type':'string','content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x8646('0x17'),'keyType':_0x8646('0x9'),'variableName':_0x8646('0x18')},{'type':'keyValue','content':'','key':_0x8646('0x19'),'keyType':_0x8646('0x9'),'variableName':_0x8646('0xa')},{'type':_0x8646('0x1'),'content':_0x8646('0x1a'),'key':null,'keyType':null,'variableName':null},{'type':_0x8646('0xd'),'content':'','key':_0x8646('0x1b'),'keyType':_0x8646('0x9'),'variableName':_0x8646('0x16')},{'type':_0x8646('0xd'),'content':'','key':'Agent\x20Connect','keyType':_0x8646('0x9'),'variableName':_0x8646('0x1c')},{'type':_0x8646('0xd'),'content':'','key':'Agent\x20Complete','keyType':'variable','variableName':'agentcompleteAt'},{'type':'keyValue','content':'','key':'Hold\x20Time','keyType':_0x8646('0x9'),'variableName':_0x8646('0x1d')},{'type':_0x8646('0xd'),'content':'','key':_0x8646('0x1e'),'keyType':_0x8646('0x9'),'variableName':_0x8646('0x1f')}];break;case _0x8646('0x8'):_0x3266ef=[{'type':_0x8646('0x1'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0x8646('0xd'),'content':'','key':_0x8646('0x20'),'keyType':_0x8646('0x9'),'keyContent':'','variableName':_0x8646('0xa')},{'type':_0x8646('0xd'),'content':'','key':_0x8646('0x21'),'keyType':_0x8646('0x9'),'keyContent':'','variableName':_0x8646('0x22')},{'type':_0x8646('0xd'),'content':'','key':'UniqueId','keyType':_0x8646('0x9'),'keyContent':'','variableName':'uniqueid'},{'type':_0x8646('0xd'),'content':'','key':_0x8646('0x15'),'keyType':_0x8646('0x9'),'keyContent':'','variableName':_0x8646('0x23')},{'type':_0x8646('0x1'),'content':'***\x20Time\x20Info\x20***'},{'type':_0x8646('0xd'),'content':'','key':_0x8646('0x24'),'keyType':'variable','keyContent':'','variableName':_0x8646('0x25')},{'type':_0x8646('0xd'),'content':'','key':_0x8646('0x26'),'keyType':'variable','keyContent':'','variableName':_0x8646('0x27')},{'type':_0x8646('0xd'),'content':'','key':'Duration','keyType':'variable','keyContent':'','variableName':'duration'},{'type':_0x8646('0xd'),'content':'','key':_0x8646('0x28'),'keyType':_0x8646('0x9'),'keyContent':'','variableName':_0x8646('0x29')}];break;}}return _0x3266ef;}; \ No newline at end of file +var _0xa6e3=['Agent\x20Number','destcalleridnum','***\x20Time\x20Info\x20***','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','UniqueId','Answer\x20Time','answertime','Complete\x20Time','endtime','duration','billableseconds','getSubjects','string','toLowerCase','inbound','push','variable','queue','calleridnum','outbound','Outbound\x20Call','getDescriptions','voice','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','calleridname','Call\x20To','destexten','Queue','uniqueid','Date','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname'];(function(_0x44d2c4,_0x57e541){var _0x148c18=function(_0x54ee84){while(--_0x54ee84){_0x44d2c4['push'](_0x44d2c4['shift']());}};_0x148c18(++_0x57e541);}(_0xa6e3,0x115));var _0x3a6e=function(_0x19be15,_0x5271d3){_0x19be15=_0x19be15-0x0;var _0x28b46d=_0xa6e3[_0x19be15];return _0x28b46d;};'use strict';exports[_0x3a6e('0x0')]=function(_0x5eca6c,_0x145485){var _0x402d29=[{'type':_0x3a6e('0x1'),'content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x5eca6c[_0x3a6e('0x2')]()){case'voice':switch(_0x145485['toLowerCase']()){case _0x3a6e('0x3'):_0x402d29[_0x3a6e('0x4')]({'type':_0x3a6e('0x5'),'content':'','variableName':_0x3a6e('0x6')});_0x402d29[_0x3a6e('0x4')]({'type':'variable','content':'','variableName':_0x3a6e('0x7')});break;case _0x3a6e('0x8'):_0x402d29['push']({'type':'string','content':_0x3a6e('0x9'),'variableName':null});_0x402d29['push']({'type':_0x3a6e('0x5'),'content':'','variableName':'destcalleridnum'});break;}}return _0x402d29;};exports[_0x3a6e('0xa')]=function(_0x16a066,_0x5c6f4d){var _0x1606eb=[];switch(_0x16a066['toLowerCase']()){case _0x3a6e('0xb'):switch(_0x5c6f4d[_0x3a6e('0x2')]()){case _0x3a6e('0x3'):_0x1606eb=[{'type':_0x3a6e('0x1'),'content':_0x3a6e('0xc'),'key':null,'keyType':null,'variableName':null},{'type':_0x3a6e('0xd'),'content':'','key':_0x3a6e('0xe'),'keyType':_0x3a6e('0x5'),'variableName':_0x3a6e('0x7')},{'type':_0x3a6e('0xd'),'content':'','key':'Caller\x20Name','keyType':_0x3a6e('0x5'),'variableName':_0x3a6e('0xf')},{'type':_0x3a6e('0xd'),'content':'','key':_0x3a6e('0x10'),'keyType':_0x3a6e('0x5'),'variableName':_0x3a6e('0x11')},{'type':_0x3a6e('0xd'),'content':'','key':_0x3a6e('0x12'),'keyType':'variable','variableName':_0x3a6e('0x6')},{'type':_0x3a6e('0xd'),'content':'','key':'UniqueId','keyType':_0x3a6e('0x5'),'variableName':_0x3a6e('0x13')},{'type':'keyValue','content':'','key':_0x3a6e('0x14'),'keyType':'variable','variableName':'agentcalledAt'},{'type':_0x3a6e('0x1'),'content':_0x3a6e('0x15'),'key':null,'keyType':null,'variableName':null},{'type':_0x3a6e('0xd'),'content':'','key':_0x3a6e('0x16'),'keyType':_0x3a6e('0x5'),'variableName':_0x3a6e('0x17')},{'type':_0x3a6e('0xd'),'content':'','key':_0x3a6e('0x18'),'keyType':_0x3a6e('0x5'),'variableName':_0x3a6e('0x19')},{'type':_0x3a6e('0x1'),'content':_0x3a6e('0x1a'),'key':null,'keyType':null,'variableName':null},{'type':_0x3a6e('0xd'),'content':'','key':'Agent\x20Ring','keyType':'variable','variableName':'agentcalledAt'},{'type':_0x3a6e('0xd'),'content':'','key':'Agent\x20Connect','keyType':_0x3a6e('0x5'),'variableName':_0x3a6e('0x1b')},{'type':'keyValue','content':'','key':_0x3a6e('0x1c'),'keyType':'variable','variableName':_0x3a6e('0x1d')},{'type':_0x3a6e('0xd'),'content':'','key':_0x3a6e('0x1e'),'keyType':_0x3a6e('0x5'),'variableName':_0x3a6e('0x1f')},{'type':'keyValue','content':'','key':_0x3a6e('0x20'),'keyType':_0x3a6e('0x5'),'variableName':_0x3a6e('0x21')}];break;case _0x3a6e('0x8'):_0x1606eb=[{'type':'string','content':_0x3a6e('0xc'),'variableName':null},{'type':_0x3a6e('0xd'),'content':'','key':_0x3a6e('0x22'),'keyType':_0x3a6e('0x5'),'keyContent':'','variableName':_0x3a6e('0x19')},{'type':_0x3a6e('0xd'),'content':'','key':_0x3a6e('0x23'),'keyType':'variable','keyContent':'','variableName':'membername'},{'type':'keyValue','content':'','key':_0x3a6e('0x24'),'keyType':_0x3a6e('0x5'),'keyContent':'','variableName':_0x3a6e('0x13')},{'type':_0x3a6e('0xd'),'content':'','key':'Date','keyType':_0x3a6e('0x5'),'keyContent':'','variableName':'starttime'},{'type':_0x3a6e('0x1'),'content':'***\x20Time\x20Info\x20***'},{'type':_0x3a6e('0xd'),'content':'','key':_0x3a6e('0x25'),'keyType':_0x3a6e('0x5'),'keyContent':'','variableName':_0x3a6e('0x26')},{'type':_0x3a6e('0xd'),'content':'','key':_0x3a6e('0x27'),'keyType':_0x3a6e('0x5'),'keyContent':'','variableName':_0x3a6e('0x28')},{'type':_0x3a6e('0xd'),'content':'','key':'Duration','keyType':_0x3a6e('0x5'),'keyContent':'','variableName':_0x3a6e('0x29')},{'type':_0x3a6e('0xd'),'content':'','key':'Billable\x20Time','keyType':'variable','keyContent':'','variableName':_0x3a6e('0x2a')}];break;}}return _0x1606eb;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 4e32025..21171b3 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 _0xf3a8=['update','info','error','tracked','user','query','clone','body','omit','phone','fax','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','upperFirst','InteractionId','unknown','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','stringify','null','Interaction','then'];(function(_0x1a4712,_0x191759){var _0x1b7826=function(_0x5016ca){while(--_0x5016ca){_0x1a4712['push'](_0x1a4712['shift']());}};_0x1b7826(++_0x191759);}(_0xf3a8,0x14f));var _0x8f3a=function(_0x35ae1d,_0x272cd9){_0x35ae1d=_0x35ae1d-0x0;var _0x2b246a=_0xf3a8[_0x35ae1d];return _0x2b246a;};'use strict';var _=require('lodash');var db=require(_0x8f3a('0x0'))['db'];var loggers={'openchannel':require(_0x8f3a('0x1'))(_0x8f3a('0x2')),'mail':require(_0x8f3a('0x1'))(_0x8f3a('0x3')),'fax':require(_0x8f3a('0x1'))(_0x8f3a('0x4')),'sms':require('../../config/logger')(_0x8f3a('0x5')),'chat':require(_0x8f3a('0x1'))(_0x8f3a('0x6')),'whatsapp':require(_0x8f3a('0x1'))('whatsapp-interactions')};function getInteractionId(_0x33b18a,_0x599bfd,_0xa49167){if(_0x33b18a&&_0x33b18a[_[_0x8f3a('0x7')](_0xa49167)+'InteractionId']){return _0x33b18a[_['upperFirst'](_0xa49167)+_0x8f3a('0x8')];}else if(_0x33b18a&&_0x33b18a['id']){return _0x33b18a['id'];}else if(_0x599bfd&&_0x599bfd['id']){return _0x599bfd['id'];}else{return _0x8f3a('0x9');}}function log(_0x5829aa,_0xce6aff,_0x4cca53,_0x3ba115,_0x5bf5e2,_0x21e6a5){loggers[_0x5bf5e2['toLowerCase']()][_0x5829aa](_0x8f3a('0xa'),_0x21e6a5[_0x8f3a('0xb')](),_0xce6aff?_0xce6aff['id']:null,_0xce6aff?_0xce6aff['name']:null,_0xce6aff?_0xce6aff['role']:null,getInteractionId(_0x4cca53,_0x3ba115,_0x5bf5e2),_0x4cca53?JSON[_0x8f3a('0xc')](_0x4cca53):_0x8f3a('0xd'));}function updateUser(_0x2a849b,_0x1832f6,_0x4512f3,_0x482607,_0x45cbc1){db[_[_0x8f3a('0x7')](_0x482607)+_0x8f3a('0xe')]['findOne']({'where':{'id':getInteractionId(_0x1832f6,_0x4512f3,_0x482607)}})[_0x8f3a('0xf')](function(_0x31bcf7){if(_0x31bcf7){return _0x31bcf7[_0x8f3a('0x10')]({'UserId':_0x2a849b?_0x2a849b['id']:null});}})[_0x8f3a('0xf')](function(_0x1bad8e){if(_0x1bad8e){log(_0x8f3a('0x11'),_0x2a849b,_0x1832f6,_0x4512f3,_0x482607,_0x45cbc1);}})['catch'](function(){log(_0x8f3a('0x12'),_0x2a849b,_0x1832f6,_0x4512f3,_0x482607,_0x45cbc1);});}exports[_0x8f3a('0x13')]=function(_0x2d405a,_0x23d1df){return function(_0x1f237d,_0x4057ce,_0x38ca7a){var _0x112d09=_0x1f237d[_0x8f3a('0x14')];var _0x5df662={};var _0x57fbaa=_0x1f237d[_0x8f3a('0x15')];if(_0x5df662){_0x5df662=_[_0x8f3a('0x16')](_0x1f237d[_0x8f3a('0x17')]);_0x5df662=_[_0x8f3a('0x18')](_0x5df662,[_0x8f3a('0x17'),'html',_0x8f3a('0x19'),_0x8f3a('0x1a'),'mobile']);}updateUser(_0x112d09,_0x5df662,_0x57fbaa,_0x2d405a,_0x23d1df);_0x38ca7a(null);};}; \ No newline at end of file +var _0x4631=['InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','null','findOne','update','then','error','tracked','query','clone','body','omit','html','phone','fax','mobile','lodash','../../config/logger','openchannel-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst'];(function(_0x2315cd,_0x3114cf){var _0x27bab5=function(_0x10b9c3){while(--_0x10b9c3){_0x2315cd['push'](_0x2315cd['shift']());}};_0x27bab5(++_0x3114cf);}(_0x4631,0xc3));var _0x1463=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0x4631[_0x3899d1];return _0xeb4a7d;};'use strict';var _=require(_0x1463('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0x1463('0x1'))(_0x1463('0x2')),'mail':require('../../config/logger')('mail-interactions'),'fax':require('../../config/logger')(_0x1463('0x3')),'sms':require(_0x1463('0x1'))(_0x1463('0x4')),'chat':require(_0x1463('0x1'))(_0x1463('0x5')),'whatsapp':require(_0x1463('0x1'))(_0x1463('0x6'))};function getInteractionId(_0x26f656,_0x1a55d4,_0xbab5b7){if(_0x26f656&&_0x26f656[_[_0x1463('0x7')](_0xbab5b7)+_0x1463('0x8')]){return _0x26f656[_[_0x1463('0x7')](_0xbab5b7)+_0x1463('0x8')];}else if(_0x26f656&&_0x26f656['id']){return _0x26f656['id'];}else if(_0x1a55d4&&_0x1a55d4['id']){return _0x1a55d4['id'];}else{return _0x1463('0x9');}}function log(_0x35802c,_0x361df9,_0x25f097,_0x431ebe,_0x2c4cc7,_0x4c40c4){loggers[_0x2c4cc7[_0x1463('0xa')]()][_0x35802c](_0x1463('0xb'),_0x4c40c4[_0x1463('0xc')](),_0x361df9?_0x361df9['id']:null,_0x361df9?_0x361df9[_0x1463('0xd')]:null,_0x361df9?_0x361df9[_0x1463('0xe')]:null,getInteractionId(_0x25f097,_0x431ebe,_0x2c4cc7),_0x25f097?JSON['stringify'](_0x25f097):_0x1463('0xf'));}function updateUser(_0x29e931,_0x2d2327,_0x3f2b6b,_0x345152,_0x279b42){db[_['upperFirst'](_0x345152)+'Interaction'][_0x1463('0x10')]({'where':{'id':getInteractionId(_0x2d2327,_0x3f2b6b,_0x345152)}})['then'](function(_0x4f3eec){if(_0x4f3eec){return _0x4f3eec[_0x1463('0x11')]({'UserId':_0x29e931?_0x29e931['id']:null});}})[_0x1463('0x12')](function(_0x2ae6cd){if(_0x2ae6cd){log('info',_0x29e931,_0x2d2327,_0x3f2b6b,_0x345152,_0x279b42);}})['catch'](function(){log(_0x1463('0x13'),_0x29e931,_0x2d2327,_0x3f2b6b,_0x345152,_0x279b42);});}exports[_0x1463('0x14')]=function(_0x5e02af,_0x374657){return function(_0x39a81,_0x15f98d,_0x302d3e){var _0xbbdcef=_0x39a81['user'];var _0x33c836={};var _0x49a183=_0x39a81[_0x1463('0x15')];if(_0x33c836){_0x33c836=_[_0x1463('0x16')](_0x39a81[_0x1463('0x17')]);_0x33c836=_[_0x1463('0x18')](_0x33c836,[_0x1463('0x17'),_0x1463('0x19'),_0x1463('0x1a'),_0x1463('0x1b'),_0x1463('0x1c')]);}updateUser(_0xbbdcef,_0x33c836,_0x49a183,_0x5e02af,_0x374657);_0x302d3e(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 0e877a2..328d348 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 _0xb3f1=['parse','License','findOne','then','count','status','json','catch','users','User','user','isUserLimit','crypto','composable-middleware','../../config/environment','data1','license','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final'];(function(_0x18927d,_0x3b0a65){var _0x23b90a=function(_0x5e26ec){while(--_0x5e26ec){_0x18927d['push'](_0x18927d['shift']());}};_0x23b90a(++_0x3b0a65);}(_0xb3f1,0xbb));var _0x1b3f=function(_0xf227a7,_0x5bd6c0){_0xf227a7=_0xf227a7-0x0;var _0x4c9aa1=_0xb3f1[_0xf227a7];return _0x4c9aa1;};'use strict';var crypto=require(_0x1b3f('0x0'));var util=require('util');var compose=require(_0x1b3f('0x1'));var db=require('../../mysqldb')['db'];var config=require(_0x1b3f('0x2'));function getValueFromLicense(_0x56bc62,_0x45f03e){if(_0x56bc62&&_0x45f03e){if(_0x45f03e[_0x1b3f('0x3')]&&_0x45f03e[_0x1b3f('0x4')]){var _0xd31676=_0x45f03e[_0x1b3f('0x3')];var _0x1148e9=_0x45f03e[_0x1b3f('0x4')];var _0xbbf505=_0xd31676['split']('-')[0x4];var _0x467b27=_0xd31676['split']('-')[0x0];var _0x5957c9=crypto[_0x1b3f('0x5')](_0x1b3f('0x6'),util[_0x1b3f('0x7')](_0x1b3f('0x8'),_0xbbf505,_0xd31676,_0x467b27));var _0x5af89b=_0x5957c9[_0x1b3f('0x9')](_0x1148e9,_0x1b3f('0xa'),_0x1b3f('0xb'));_0x5af89b+=_0x5957c9[_0x1b3f('0xc')](_0x1b3f('0xb'));var _0x1c9d8f=JSON[_0x1b3f('0xd')](_0x5af89b);return _0x1c9d8f['hasOwnProperty'](_0x56bc62)?_0x1c9d8f[_0x56bc62]:null;}}return null;}function isLimit(_0x46c3d3,_0x5b2321,_0x4c2064,_0x39fc55){var _0x5e5b92=_0x5b2321;return compose()['use'](function(_0x459083,_0x329212,_0x51f794){return db[_0x1b3f('0xe')][_0x1b3f('0xf')]({'where':{'id':0x1},'raw':!![]})[_0x1b3f('0x10')](function(_0x251c64){var _0x5383cf=getValueFromLicense(_0x46c3d3,_0x251c64);return _0x5383cf?_0x5383cf:_0x5e5b92;})[_0x1b3f('0x10')](function(_0x2cb77e){_0x5e5b92=_0x2cb77e;return _0x4c2064[_0x1b3f('0x11')](_0x39fc55);})[_0x1b3f('0x10')](function(_0x51bf39){if(_0x51bf39>=_0x5e5b92){return _0x329212[_0x1b3f('0x12')](0x193)[_0x1b3f('0x13')]({'message':util[_0x1b3f('0x7')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x46c3d3)});}_0x51f794();})[_0x1b3f('0x14')](function(_0x1a0eda){_0x51f794(_0x1a0eda);});});}function isUserLimit(){return isLimit(_0x1b3f('0x15'),0x1,db[_0x1b3f('0x16')],{'where':{'$or':[{'role':'admin'},{'role':_0x1b3f('0x17')}]}});}exports[_0x1b3f('0x18')]=isUserLimit; \ No newline at end of file +var _0x2016=['parse','hasOwnProperty','License','findOne','then','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','User','admin','user','isUserLimit','crypto','util','../../mysqldb','data1','license','split','createDecipher','format','update','base64','utf8','final'];(function(_0x33b399,_0x5f03d2){var _0x1959c7=function(_0x316f72){while(--_0x316f72){_0x33b399['push'](_0x33b399['shift']());}};_0x1959c7(++_0x5f03d2);}(_0x2016,0xa3));var _0x6201=function(_0x339816,_0x1a3e1b){_0x339816=_0x339816-0x0;var _0x2f1710=_0x2016[_0x339816];return _0x2f1710;};'use strict';var crypto=require(_0x6201('0x0'));var util=require(_0x6201('0x1'));var compose=require('composable-middleware');var db=require(_0x6201('0x2'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x3806ea,_0x152eb9){if(_0x3806ea&&_0x152eb9){if(_0x152eb9[_0x6201('0x3')]&&_0x152eb9[_0x6201('0x4')]){var _0x215c7a=_0x152eb9[_0x6201('0x3')];var _0x16ed29=_0x152eb9[_0x6201('0x4')];var _0x101983=_0x215c7a[_0x6201('0x5')]('-')[0x4];var _0x345223=_0x215c7a[_0x6201('0x5')]('-')[0x0];var _0x13c540=crypto[_0x6201('0x6')]('aes-256-ctr',util[_0x6201('0x7')]('%s:%s:%s',_0x101983,_0x215c7a,_0x345223));var _0x1dd3d7=_0x13c540[_0x6201('0x8')](_0x16ed29,_0x6201('0x9'),_0x6201('0xa'));_0x1dd3d7+=_0x13c540[_0x6201('0xb')](_0x6201('0xa'));var _0x3d79a5=JSON[_0x6201('0xc')](_0x1dd3d7);return _0x3d79a5[_0x6201('0xd')](_0x3806ea)?_0x3d79a5[_0x3806ea]:null;}}return null;}function isLimit(_0x5414bb,_0x59988f,_0x3fcf11,_0x16f1b5){var _0x5b5b0d=_0x59988f;return compose()['use'](function(_0x4a5195,_0x306030,_0x5cda3b){return db[_0x6201('0xe')][_0x6201('0xf')]({'where':{'id':0x1},'raw':!![]})[_0x6201('0x10')](function(_0x583852){var _0x39da96=getValueFromLicense(_0x5414bb,_0x583852);return _0x39da96?_0x39da96:_0x5b5b0d;})[_0x6201('0x10')](function(_0x42a050){_0x5b5b0d=_0x42a050;return _0x3fcf11['count'](_0x16f1b5);})[_0x6201('0x10')](function(_0x167391){if(_0x167391>=_0x5b5b0d){return _0x306030[_0x6201('0x11')](0x193)[_0x6201('0x12')]({'message':util[_0x6201('0x7')](_0x6201('0x13'),_0x5414bb)});}_0x5cda3b();})[_0x6201('0x14')](function(_0x328341){_0x5cda3b(_0x328341);});});}function isUserLimit(){return isLimit('users',0x1,db[_0x6201('0x15')],{'where':{'$or':[{'role':_0x6201('0x16')},{'role':_0x6201('0x17')}]}});}exports[_0x6201('0x18')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index ca42cd6..fe0b96a 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 _0x7f54=['$eq','$between','value','includes','$gt','$lte','operator','add','days','format','castTo','text','CAST(','field','\x20AS\x20','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','<>\x20?','$substring','$startsWith','$endsWith','$lt','<=\x20?','BETWEEN\x20?\x20AND\x20?','start','pop','utcOffset','minutes','sqlOperator','startsWith','[$or]','and','[$and]','replace','split','length','slice','shift','match','filter','indexOf','map','conditions','push','buildExpression','DATE'];(function(_0x578dd2,_0x451cf0){var _0x50d785=function(_0x325870){while(--_0x325870){_0x578dd2['push'](_0x578dd2['shift']());}};_0x50d785(++_0x451cf0);}(_0x7f54,0x1e2));var _0x47f5=function(_0x40e5d9,_0x36f0ce){_0x40e5d9=_0x40e5d9-0x0;var _0x4c395d=_0x7f54[_0x40e5d9];return _0x4c395d;};'use strict';var _=require('lodash');var moment=require('moment');exports['parseSearch']=function(_0x48ff60){var _0x34c0fa={'conditions':[]};_0x34c0fa[_0x47f5('0x0')]=_[_0x47f5('0x1')](_0x48ff60,_0x47f5('0x2'))?'or':_0x47f5('0x3');var _0x5d5984=_0x48ff60['replace'](_0x47f5('0x4'),'')[_0x47f5('0x5')](_0x47f5('0x2'),'')[_0x47f5('0x6')]('||');for(var _0xc65b20=0x0;_0xc65b20<_0x5d5984[_0x47f5('0x7')];_0xc65b20++){var _0x15da4c=_0x5d5984[_0xc65b20]['split'](':=');var _0x271038=_0x15da4c[0x0];var _0x36f413=_0x15da4c[_0x47f5('0x8')](0x1);_0x36f413['forEach'](function(_0x42ca59){var _0x14a0ac=_0x42ca59['split']('[')[_0x47f5('0x9')]();var _0x2159cb=_0x42ca59[_0x47f5('0xa')](/\[(.*?)\]/g);_0x2159cb['forEach'](function(_0x473551){var _0x142791=_0x473551['split']('[')[_0x47f5('0xb')](function(_0x3ff129){return _0x3ff129[_0x47f5('0xc')](']')>-0x1;})[_0x47f5('0xd')](function(_0x4649e3){return _0x4649e3[_0x47f5('0x6')](']')[0x0];})[0x0];_0x34c0fa[_0x47f5('0xe')][_0x47f5('0xf')]({'field':_0x271038,'operator':_0x14a0ac,'value':_0x142791});});});}return _0x34c0fa;};exports[_0x47f5('0x10')]=function(_0xdf6d15,_0x1dc267,_0x4ecee9){var _0x22a631={};if(_0x1dc267===_0x47f5('0x11')){if(_0x4ecee9['operator']===_0x47f5('0x12')){_0x4ecee9['operator']=_0x47f5('0x13');_0x4ecee9[_0x47f5('0x14')]+=','+_0x4ecee9[_0x47f5('0x14')];}else if(_[_0x47f5('0x15')]([_0x47f5('0x16'),_0x47f5('0x17')],_0x4ecee9[_0x47f5('0x18')])){_0x4ecee9[_0x47f5('0x14')]=moment(_0x4ecee9[_0x47f5('0x14')])[_0x47f5('0x19')](0x1,_0x47f5('0x1a'))[_0x47f5('0x1b')]('YYYY-MM-DD');}}if(_0x4ecee9[_0x47f5('0x1c')]){_0x1dc267=_0x4ecee9[_0x47f5('0x1c')];_0x22a631[_0x47f5('0x1d')]=_0x47f5('0x1e')+_0xdf6d15+'.'+_0x4ecee9[_0x47f5('0x1f')]+_0x47f5('0x20')+_0x4ecee9[_0x47f5('0x1c')]+')\x20'+parseOperator(_0x4ecee9[_0x47f5('0x18')]);}else{_0x22a631['text']=_0xdf6d15+'.'+_0x4ecee9['field']+'\x20'+parseOperator(_0x4ecee9[_0x47f5('0x18')]);}if(_[_0x47f5('0x15')]([_0x47f5('0x21'),_0x47f5('0x22')],_0x4ecee9['operator']))_0x22a631[_0x47f5('0x1d')]='('+_0x22a631['text']+_0x47f5('0x23')+_0xdf6d15+'.'+_0x4ecee9[_0x47f5('0x1f')]+_0x47f5('0x24');_0x22a631[_0x47f5('0x14')]=parseValue(_0x1dc267,_0x4ecee9[_0x47f5('0x18')],_0x4ecee9[_0x47f5('0x14')]);return _0x22a631;};function parseOperator(_0x500b40){var _0x2d9b70;switch(_0x500b40){case _0x47f5('0x25'):_0x2d9b70=_0x47f5('0x26');break;case'$notIn':_0x2d9b70='NOT\x20IN\x20?';break;case'$eq':_0x2d9b70='=\x20?';break;case _0x47f5('0x21'):_0x2d9b70=_0x47f5('0x27');break;case _0x47f5('0x28'):case _0x47f5('0x29'):case _0x47f5('0x2a'):_0x2d9b70='LIKE\x20?';break;case _0x47f5('0x2b'):_0x2d9b70='<\x20?';break;case'$gt':_0x2d9b70='>\x20?';break;case _0x47f5('0x17'):_0x2d9b70=_0x47f5('0x2c');break;case'$gte':_0x2d9b70='>=\x20?';break;case _0x47f5('0x13'):_0x2d9b70=_0x47f5('0x2d');break;}return _0x2d9b70;}function parseValue(_0x17f2e1,_0x4a7dfc,_0x5185fd){var _0x424d68={'start':undefined,'end':undefined};switch(_0x4a7dfc){case'$in':case'$notIn':_0x424d68['start']=_0x5185fd[_0x47f5('0x6')](',');break;case _0x47f5('0x28'):_0x424d68['start']='%'+_0x5185fd+'%';break;case _0x47f5('0x29'):_0x424d68[_0x47f5('0x2e')]=_0x5185fd+'%';break;case'$endsWith':_0x424d68[_0x47f5('0x2e')]='%'+_0x5185fd;break;case _0x47f5('0x13'):var _0x38cc39=_0x5185fd['split'](',');var _0x5185fd=_0x38cc39['shift']();var _0x256a63=_0x38cc39[_0x47f5('0x2f')]();if(_0x17f2e1===_0x47f5('0x11')){_0x5185fd=moment(_0x5185fd)['utcOffset'](0x0,!![])[_0x47f5('0x1b')]();_0x256a63=moment(_0x256a63)[_0x47f5('0x30')](0x0,!![])[_0x47f5('0x19')](0x17,'hours')[_0x47f5('0x19')](0x3b,_0x47f5('0x31'))[_0x47f5('0x19')](0x3b,'seconds')[_0x47f5('0x1b')]();}_0x424d68={'start':_0x5185fd,'end':_0x256a63};break;default:_0x424d68[_0x47f5('0x2e')]=_0x5185fd;break;}return _0x424d68;} \ No newline at end of file +var _0x8755=['=\x20?','<>\x20?','$substring','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','<=\x20?','>=\x20?','start','$startsWith','pop','DATE','utcOffset','hours','seconds','lodash','parseSearch','sqlOperator','startsWith','[$or]','and','replace','[$and]','split','length','slice','forEach','match','filter','indexOf','map','conditions','push','buildExpression','operator','$between','value','includes','$gt','$lte','add','days','format','YYYY-MM-DD','text','CAST(','field','\x20AS\x20','castTo','$ne','$notIn','\x20IS\x20NULL)','IN\x20?','NOT\x20IN\x20?','$eq'];(function(_0x4debf8,_0x1aebd7){var _0x42823f=function(_0x551488){while(--_0x551488){_0x4debf8['push'](_0x4debf8['shift']());}};_0x42823f(++_0x1aebd7);}(_0x8755,0x83));var _0x5875=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8755[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5875('0x0'));var moment=require('moment');exports[_0x5875('0x1')]=function(_0x47b472){var _0x98785c={'conditions':[]};_0x98785c[_0x5875('0x2')]=_[_0x5875('0x3')](_0x47b472,_0x5875('0x4'))?'or':_0x5875('0x5');var _0x1bb6b5=_0x47b472[_0x5875('0x6')](_0x5875('0x7'),'')[_0x5875('0x6')](_0x5875('0x4'),'')[_0x5875('0x8')]('||');for(var _0x7a417=0x0;_0x7a417<_0x1bb6b5[_0x5875('0x9')];_0x7a417++){var _0x50365d=_0x1bb6b5[_0x7a417][_0x5875('0x8')](':=');var _0x26456b=_0x50365d[0x0];var _0x3af4b7=_0x50365d[_0x5875('0xa')](0x1);_0x3af4b7[_0x5875('0xb')](function(_0x181279){var _0x5ee5f9=_0x181279[_0x5875('0x8')]('[')['shift']();var _0x21d0a5=_0x181279[_0x5875('0xc')](/\[(.*?)\]/g);_0x21d0a5[_0x5875('0xb')](function(_0x266025){var _0x2c76f5=_0x266025[_0x5875('0x8')]('[')[_0x5875('0xd')](function(_0x4c4330){return _0x4c4330[_0x5875('0xe')](']')>-0x1;})[_0x5875('0xf')](function(_0x2a365e){return _0x2a365e[_0x5875('0x8')](']')[0x0];})[0x0];_0x98785c[_0x5875('0x10')][_0x5875('0x11')]({'field':_0x26456b,'operator':_0x5ee5f9,'value':_0x2c76f5});});});}return _0x98785c;};exports[_0x5875('0x12')]=function(_0x1ba9f3,_0x46e378,_0x5d0d5c){var _0x9bbbea={};if(_0x46e378==='DATE'){if(_0x5d0d5c[_0x5875('0x13')]==='$eq'){_0x5d0d5c[_0x5875('0x13')]=_0x5875('0x14');_0x5d0d5c[_0x5875('0x15')]+=','+_0x5d0d5c[_0x5875('0x15')];}else if(_[_0x5875('0x16')]([_0x5875('0x17'),_0x5875('0x18')],_0x5d0d5c[_0x5875('0x13')])){_0x5d0d5c[_0x5875('0x15')]=moment(_0x5d0d5c[_0x5875('0x15')])[_0x5875('0x19')](0x1,_0x5875('0x1a'))[_0x5875('0x1b')](_0x5875('0x1c'));}}if(_0x5d0d5c['castTo']){_0x46e378=_0x5d0d5c['castTo'];_0x9bbbea[_0x5875('0x1d')]=_0x5875('0x1e')+_0x1ba9f3+'.'+_0x5d0d5c[_0x5875('0x1f')]+_0x5875('0x20')+_0x5d0d5c[_0x5875('0x21')]+')\x20'+parseOperator(_0x5d0d5c[_0x5875('0x13')]);}else{_0x9bbbea['text']=_0x1ba9f3+'.'+_0x5d0d5c[_0x5875('0x1f')]+'\x20'+parseOperator(_0x5d0d5c[_0x5875('0x13')]);}if(_[_0x5875('0x16')]([_0x5875('0x22'),_0x5875('0x23')],_0x5d0d5c[_0x5875('0x13')]))_0x9bbbea[_0x5875('0x1d')]='('+_0x9bbbea['text']+'\x20OR\x20'+_0x1ba9f3+'.'+_0x5d0d5c[_0x5875('0x1f')]+_0x5875('0x24');_0x9bbbea['value']=parseValue(_0x46e378,_0x5d0d5c['operator'],_0x5d0d5c[_0x5875('0x15')]);return _0x9bbbea;};function parseOperator(_0x263166){var _0x5f0769;switch(_0x263166){case'$in':_0x5f0769=_0x5875('0x25');break;case _0x5875('0x23'):_0x5f0769=_0x5875('0x26');break;case _0x5875('0x27'):_0x5f0769=_0x5875('0x28');break;case _0x5875('0x22'):_0x5f0769=_0x5875('0x29');break;case _0x5875('0x2a'):case'$startsWith':case _0x5875('0x2b'):_0x5f0769=_0x5875('0x2c');break;case _0x5875('0x2d'):_0x5f0769=_0x5875('0x2e');break;case'$gt':_0x5f0769=_0x5875('0x2f');break;case _0x5875('0x18'):_0x5f0769=_0x5875('0x30');break;case'$gte':_0x5f0769=_0x5875('0x31');break;case _0x5875('0x14'):_0x5f0769='BETWEEN\x20?\x20AND\x20?';break;}return _0x5f0769;}function parseValue(_0x57dba5,_0x4f2d7d,_0x1f985b){var _0x15f711={'start':undefined,'end':undefined};switch(_0x4f2d7d){case'$in':case'$notIn':_0x15f711['start']=_0x1f985b[_0x5875('0x8')](',');break;case'$substring':_0x15f711[_0x5875('0x32')]='%'+_0x1f985b+'%';break;case _0x5875('0x33'):_0x15f711[_0x5875('0x32')]=_0x1f985b+'%';break;case _0x5875('0x2b'):_0x15f711[_0x5875('0x32')]='%'+_0x1f985b;break;case _0x5875('0x14'):var _0x774073=_0x1f985b[_0x5875('0x8')](',');var _0x1f985b=_0x774073['shift']();var _0x239e21=_0x774073[_0x5875('0x34')]();if(_0x57dba5===_0x5875('0x35')){_0x1f985b=moment(_0x1f985b)[_0x5875('0x36')](0x0,!![])[_0x5875('0x1b')]();_0x239e21=moment(_0x239e21)['utcOffset'](0x0,!![])[_0x5875('0x19')](0x17,_0x5875('0x37'))[_0x5875('0x19')](0x3b,'minutes')[_0x5875('0x19')](0x3b,_0x5875('0x38'))[_0x5875('0x1b')]();}_0x15f711={'start':_0x1f985b,'end':_0x239e21};break;default:_0x15f711[_0x5875('0x32')]=_0x1f985b;break;}return _0x15f711;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index d354775..1e5f782 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 _0xb42e=['pick','filter','object','columns','value','merge','VIRTUAL','lower','options','lodash','parse','includes','fields','split','find','type','DATE','$gte','format','YYYY-MM-DD','$lte','name','uniqueid','isArray','limit','sort','map','indexOf','priority','cast','col','unsigned','DESC','ASC','omit','isEmpty','length','isObject','unset','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','replace','push','query','$id','model','keys','filters','attributes','hasOwnProperty','nolimit','offset','order','where'];(function(_0x4af356,_0x298d74){var _0x40566=function(_0x3cd2b2){while(--_0x3cd2b2){_0x4af356['push'](_0x4af356['shift']());}};_0x40566(++_0x298d74);}(_0xb42e,0x1d9));var _0xeb42=function(_0x43941d,_0x45fd0d){_0x43941d=_0x43941d-0x0;var _0x27b82a=_0xb42e[_0x43941d];return _0x27b82a;};'use strict';var _=require(_0xeb42('0x0'));var sequelize=require('sequelize');var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x3490a3){var _0x1dd738=['ne'];try{var _0x5396ba=JSON[_0xeb42('0x1')](_0x3490a3);var _0x4beb9d=Object['keys'](_0x5396ba)[0x0];return _0x1dd738[_0xeb42('0x2')](_0x4beb9d);}catch(_0x34a5e9){return![];}}function getOperatorValue(_0x3c859c){var _0x54a145=JSON[_0xeb42('0x1')](_0x3c859c);var _0x2f0f7e=Object['keys'](_0x54a145)[0x0];var _0x1c2f95=_0x54a145[_0x2f0f7e];return{['$'+_0x2f0f7e]:_0x1c2f95};}exports[_0xeb42('0x3')]=function(_0x253e3f){var _0x4570db=null;if(_0x253e3f){_0x4570db=_0x253e3f[_0xeb42('0x4')](',');}return _0x4570db;};exports['filters']=function(_0x5c7a5c,_0x56a552){var _0x4c7ffb={};if(!_['isEmpty'](_0x5c7a5c)){_['forOwn'](_0x5c7a5c,function(_0x46217f,_0x44cf3f){try{if(_0x56a552){var _0x255d15=_[_0xeb42('0x5')](_0x56a552,{'name':_0x44cf3f})||{};if(hasSequelizeOperator(_0x46217f)){_0x4c7ffb[_0x44cf3f]=getOperatorValue(_0x46217f);}else if(_0x255d15[_0xeb42('0x6')]===_0xeb42('0x7')&&_['isPlainObject'](_0x46217f)){var _0x11230b=JSON['parse'](_0x46217f);var _0x1d36d7={'$gte':moment(moment(_0x11230b[_0xeb42('0x8')])[_0xeb42('0x9')](_0xeb42('0xa')))['utc']()[_0xeb42('0x9')](),'$lte':moment(moment(_0x11230b[_0xeb42('0xb')])['format'](_0xeb42('0xa')))['utc']()['subtract'](0x1,'s')[_0xeb42('0x9')]()};_0x4c7ffb[_0x44cf3f]=_0x1d36d7;}else if(_0x255d15[_0xeb42('0xc')]===_0xeb42('0xd')){_0x4c7ffb[_0x44cf3f]=_0x46217f;}else{_0x4c7ffb[_0x44cf3f]=_[_0xeb42('0xe')](_0x46217f)?_0x46217f:JSON[_0xeb42('0x1')](_0x46217f);}}else{_0x4c7ffb[_0x44cf3f]=_[_0xeb42('0xe')](_0x46217f)?_0x46217f:JSON['parse'](_0x46217f);}}catch(_0x233cb9){_0x4c7ffb[_0x44cf3f]=_0x46217f[_0xeb42('0x4')](',');}});}return _0x4c7ffb;};exports[_0xeb42('0xf')]=function(_0x55f095){_0x55f095=parseInt(_0x55f095,0xa);if(!_0x55f095||_0x55f095<0x0){_0x55f095=LIMIT_VALUE;}return _0x55f095;};exports['offset']=function(_0x5207e1){_0x5207e1=parseInt(_0x5207e1,0xa);if(!_0x5207e1||_0x5207e1<0x0){_0x5207e1=0x0;}return _0x5207e1;};exports[_0xeb42('0x10')]=function(_0x3e9c38){var _0x51da90,_0x1db035=null;if(_0x3e9c38){_0x51da90=_0x3e9c38['split'](',');_0x1db035=_[_0xeb42('0x11')](_0x51da90,function(_0x4c3359){if(_0x4c3359[_0xeb42('0x12')]('-')===0x0){return[_0x4c3359===_0xeb42('0x13')?sequelize[_0xeb42('0x14')](sequelize[_0xeb42('0x15')](_0xeb42('0x13')),_0xeb42('0x16')):_0x4c3359['substr'](0x1),_0xeb42('0x17')];}else{return[_0x4c3359===_0xeb42('0x13')?sequelize['cast'](sequelize[_0xeb42('0x15')](_0xeb42('0x13')),_0xeb42('0x16')):_0x4c3359,_0xeb42('0x18')];}});}return _0x1db035;};exports[_0xeb42('0x19')]=function(_0x28e39a,_0x5bf3e4){if(_[_0xeb42('0x1a')](_0x28e39a)){return _0x28e39a;}if(_[_0xeb42('0xe')](_0x28e39a)){for(var _0x4895e3=0x0;_0x4895e3<_0x28e39a[_0xeb42('0x1b')];_0x4895e3+=0x1){_0x28e39a[_0x4895e3]=this['omit'](_0x28e39a[_0x4895e3],_0x5bf3e4);}return _0x28e39a;}if(!_[_0xeb42('0x1c')](_0x28e39a)){return _0x28e39a;}if(_['isString'](_0x5bf3e4)){_0x5bf3e4=[_0x5bf3e4];}if(!_['isArray'](_0x5bf3e4)){return _0x28e39a;}for(var _0x2c66f5=0x0;_0x2c66f5<_0x5bf3e4[_0xeb42('0x1b')];_0x2c66f5+=0x1){_[_0xeb42('0x1d')](_0x28e39a,_0x5bf3e4[_0x2c66f5]);}for(var _0x20523e in _0x28e39a){if(_0x28e39a['hasOwnProperty'](_0x20523e)){_0x28e39a[_0x20523e]=this['omit'](_0x28e39a[_0x20523e],_0x5bf3e4);}}return _0x28e39a;};exports[_0xeb42('0x1e')]=function(_0x22353f){return _0x22353f[_0xeb42('0x1f')](RegExp(_0xeb42('0x20')))?!![]:![];};exports[_0xeb42('0x21')]=function(_0x79ef0c){return _0x79ef0c[_0xeb42('0x1f')](/^\S+@\S+$/)?!![]:![];};exports[_0xeb42('0x22')]=function(_0x6311fc){var _0x417ecd=[];_0x6311fc[_0xeb42('0x4')](/[ ,]+/)[_0xeb42('0x23')](function(_0x219f6b){_0x219f6b=_0x219f6b[_0xeb42('0x24')](/([^:]")"+/g,'$1');_0x219f6b='+'+_0x219f6b+'*';var _0x57f1b2=/[ `!@#$%^&*()_\-?~]/;if(_0x219f6b[_0xeb42('0x1f')](_0x57f1b2))_0x219f6b='\x22'+_0x219f6b+'\x22';_0x417ecd[_0xeb42('0x25')](_0x219f6b);});return _0x417ecd['join']('\x20');};exports['getOptions']=function(_0x424116,_0x49e8f6,_0x201f6a){var _0x234906={},_0x44a1be={};if(_0x49e8f6[_0xeb42('0x26')][_0xeb42('0x27')]){_0x49e8f6[_0xeb42('0x26')]['id']=_0x49e8f6['query']['$id'];delete _0x49e8f6[_0xeb42('0x26')][_0xeb42('0x27')];}_0x234906[_0xeb42('0x28')]=_[_0xeb42('0x11')](_0x424116,_0xeb42('0xc'));_0x234906[_0xeb42('0x26')]=_[_0xeb42('0x29')](_0x49e8f6['query']);_0x234906[_0xeb42('0x2a')]=_['intersection'](_0x234906['model'],_0x234906[_0xeb42('0x26')]);_0x44a1be[_0xeb42('0x2b')]=_['intersection'](_0x234906[_0xeb42('0x28')],this[_0xeb42('0x3')](_0x49e8f6[_0xeb42('0x26')][_0xeb42('0x3')]));_0x44a1be['attributes']=_0x44a1be[_0xeb42('0x2b')][_0xeb42('0x1b')]?_0x44a1be['attributes']:_0x234906['model'];if(!_0x49e8f6[_0xeb42('0x26')][_0xeb42('0x2c')](_0xeb42('0x2d'))){_0x44a1be['limit']=this[_0xeb42('0xf')](_0x49e8f6[_0xeb42('0x26')][_0xeb42('0xf')]);_0x44a1be[_0xeb42('0x2e')]=this[_0xeb42('0x2e')](_0x49e8f6[_0xeb42('0x26')]['offset']);}_0x44a1be[_0xeb42('0x2f')]=this['sort'](_0x49e8f6[_0xeb42('0x26')][_0xeb42('0x10')]);_0x44a1be[_0xeb42('0x30')]=this[_0xeb42('0x2a')](_[_0xeb42('0x31')](_0x49e8f6[_0xeb42('0x26')],_0x234906[_0xeb42('0x2a')]),_0x424116);if(_0x49e8f6['query'][_0xeb42('0x32')]){var _0x48485e=_0x424116;var _0x242a65=_0x49e8f6[_0xeb42('0x26')][_0xeb42('0x32')];if(typeof _0x242a65===_0xeb42('0x33')){_0x48485e=_[_0xeb42('0x32')](_0x424116,function(_0x3d0233){return _[_0xeb42('0x2')](_0x242a65[_0xeb42('0x34')],_0x3d0233[_0xeb42('0xc')]);});_0x242a65=_0x242a65[_0xeb42('0x35')];}_0x44a1be[_0xeb42('0x30')]=_[_0xeb42('0x36')](_0x44a1be[_0xeb42('0x30')],{'$or':_[_0xeb42('0x11')](_0x48485e,function(_0x2cae4f){if(_0x2cae4f[_0xeb42('0x6')]!==_0xeb42('0x37')){if(_0x201f6a){return sequelize[_0xeb42('0x30')](sequelize['fn'](_0xeb42('0x38'),sequelize['col'](_0x2cae4f['name'])),{'$like':sequelize['fn']('lower','%'+_0x49e8f6[_0xeb42('0x26')][_0xeb42('0x32')]+'%')});}else{var _0x56dc9d={};_0x56dc9d[_0x2cae4f[_0xeb42('0xc')]]={'$like':'%'+_0x49e8f6[_0xeb42('0x26')]['filter']+'%'};return _0x56dc9d;}}})});}_0x44a1be=_[_0xeb42('0x36')]({},_0x44a1be,_0x49e8f6[_0xeb42('0x39')]);return _0x44a1be;}; \ No newline at end of file +var _0x031c=['nolimit','order','where','pick','filter','columns','merge','VIRTUAL','lower','options','sequelize','keys','includes','parse','fields','split','filters','isEmpty','forOwn','find','type','DATE','isPlainObject','$gte','YYYY-MM-DD','utc','$lte','format','subtract','uniqueid','isArray','limit','offset','sort','map','indexOf','priority','cast','unsigned','substr','DESC','col','ASC','length','unset','hasOwnProperty','omit','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','replace','join','getOptions','query','$id','model','name','intersection','attributes'];(function(_0x1566e7,_0x1f73a8){var _0x259053=function(_0x179366){while(--_0x179366){_0x1566e7['push'](_0x1566e7['shift']());}};_0x259053(++_0x1f73a8);}(_0x031c,0x140));var _0xc031=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x031c[_0x3b380d];return _0x54502b;};'use strict';var _=require('lodash');var sequelize=require(_0xc031('0x0'));var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x3f985d){var _0x3abf1e=['ne'];try{var _0xcc2d6a=JSON['parse'](_0x3f985d);var _0x3e355d=Object[_0xc031('0x1')](_0xcc2d6a)[0x0];return _0x3abf1e[_0xc031('0x2')](_0x3e355d);}catch(_0x18eb4a){return![];}}function getOperatorValue(_0x43222d){var _0x5d5cb8=JSON[_0xc031('0x3')](_0x43222d);var _0x1fdfaa=Object[_0xc031('0x1')](_0x5d5cb8)[0x0];var _0x9f14cf=_0x5d5cb8[_0x1fdfaa];return{['$'+_0x1fdfaa]:_0x9f14cf};}exports[_0xc031('0x4')]=function(_0x4fe8dd){var _0xc2db46=null;if(_0x4fe8dd){_0xc2db46=_0x4fe8dd[_0xc031('0x5')](',');}return _0xc2db46;};exports[_0xc031('0x6')]=function(_0x2b8edd,_0x114be8){var _0x4b7b9c={};if(!_[_0xc031('0x7')](_0x2b8edd)){_[_0xc031('0x8')](_0x2b8edd,function(_0xe1d4d6,_0x4cecb1){try{if(_0x114be8){var _0x5e51f2=_[_0xc031('0x9')](_0x114be8,{'name':_0x4cecb1})||{};if(hasSequelizeOperator(_0xe1d4d6)){_0x4b7b9c[_0x4cecb1]=getOperatorValue(_0xe1d4d6);}else if(_0x5e51f2[_0xc031('0xa')]===_0xc031('0xb')&&_[_0xc031('0xc')](_0xe1d4d6)){var _0x201520=JSON[_0xc031('0x3')](_0xe1d4d6);var _0x1f25cb={'$gte':moment(moment(_0x201520[_0xc031('0xd')])['format'](_0xc031('0xe')))[_0xc031('0xf')]()['format'](),'$lte':moment(moment(_0x201520[_0xc031('0x10')])[_0xc031('0x11')]('YYYY-MM-DD'))[_0xc031('0xf')]()[_0xc031('0x12')](0x1,'s')[_0xc031('0x11')]()};_0x4b7b9c[_0x4cecb1]=_0x1f25cb;}else if(_0x5e51f2['name']===_0xc031('0x13')){_0x4b7b9c[_0x4cecb1]=_0xe1d4d6;}else{_0x4b7b9c[_0x4cecb1]=_['isArray'](_0xe1d4d6)?_0xe1d4d6:JSON[_0xc031('0x3')](_0xe1d4d6);}}else{_0x4b7b9c[_0x4cecb1]=_[_0xc031('0x14')](_0xe1d4d6)?_0xe1d4d6:JSON[_0xc031('0x3')](_0xe1d4d6);}}catch(_0xd89011){_0x4b7b9c[_0x4cecb1]=_0xe1d4d6[_0xc031('0x5')](',');}});}return _0x4b7b9c;};exports[_0xc031('0x15')]=function(_0x51b530){_0x51b530=parseInt(_0x51b530,0xa);if(!_0x51b530||_0x51b530<0x0){_0x51b530=LIMIT_VALUE;}return _0x51b530;};exports[_0xc031('0x16')]=function(_0x54b29d){_0x54b29d=parseInt(_0x54b29d,0xa);if(!_0x54b29d||_0x54b29d<0x0){_0x54b29d=0x0;}return _0x54b29d;};exports[_0xc031('0x17')]=function(_0x411934){var _0x22a0b1,_0x5ec79f=null;if(_0x411934){_0x22a0b1=_0x411934[_0xc031('0x5')](',');_0x5ec79f=_[_0xc031('0x18')](_0x22a0b1,function(_0x3355de){if(_0x3355de[_0xc031('0x19')]('-')===0x0){return[_0x3355de===_0xc031('0x1a')?sequelize[_0xc031('0x1b')](sequelize['col'](_0xc031('0x1a')),_0xc031('0x1c')):_0x3355de[_0xc031('0x1d')](0x1),_0xc031('0x1e')];}else{return[_0x3355de===_0xc031('0x1a')?sequelize[_0xc031('0x1b')](sequelize[_0xc031('0x1f')](_0xc031('0x1a')),_0xc031('0x1c')):_0x3355de,_0xc031('0x20')];}});}return _0x5ec79f;};exports['omit']=function(_0x518457,_0x3ea3ce){if(_['isEmpty'](_0x518457)){return _0x518457;}if(_[_0xc031('0x14')](_0x518457)){for(var _0x49d1dd=0x0;_0x49d1dd<_0x518457[_0xc031('0x21')];_0x49d1dd+=0x1){_0x518457[_0x49d1dd]=this['omit'](_0x518457[_0x49d1dd],_0x3ea3ce);}return _0x518457;}if(!_['isObject'](_0x518457)){return _0x518457;}if(_['isString'](_0x3ea3ce)){_0x3ea3ce=[_0x3ea3ce];}if(!_[_0xc031('0x14')](_0x3ea3ce)){return _0x518457;}for(var _0x479e6d=0x0;_0x479e6d<_0x3ea3ce[_0xc031('0x21')];_0x479e6d+=0x1){_[_0xc031('0x22')](_0x518457,_0x3ea3ce[_0x479e6d]);}for(var _0x61179e in _0x518457){if(_0x518457[_0xc031('0x23')](_0x61179e)){_0x518457[_0x61179e]=this[_0xc031('0x24')](_0x518457[_0x61179e],_0x3ea3ce);}}return _0x518457;};exports[_0xc031('0x25')]=function(_0xf1c3c6){return _0xf1c3c6[_0xc031('0x26')](RegExp(_0xc031('0x27')))?!![]:![];};exports[_0xc031('0x28')]=function(_0x5e479a){return _0x5e479a[_0xc031('0x26')](/^\S+@\S+$/)?!![]:![];};exports[_0xc031('0x29')]=function(_0x4c6487){var _0x2c2dd1=[];_0x4c6487['split'](/[ ,]+/)[_0xc031('0x2a')](function(_0x118755){_0x118755=_0x118755[_0xc031('0x2b')](/([^:]")"+/g,'$1');_0x118755='+'+_0x118755+'*';var _0x37f805=/[ `!@#$%^&*()_\-?~]/;if(_0x118755[_0xc031('0x26')](_0x37f805))_0x118755='\x22'+_0x118755+'\x22';_0x2c2dd1['push'](_0x118755);});return _0x2c2dd1[_0xc031('0x2c')]('\x20');};exports[_0xc031('0x2d')]=function(_0x6f0d57,_0x2b28e6,_0x5eed3a){var _0x529ecb={},_0x34c393={};if(_0x2b28e6[_0xc031('0x2e')][_0xc031('0x2f')]){_0x2b28e6[_0xc031('0x2e')]['id']=_0x2b28e6[_0xc031('0x2e')][_0xc031('0x2f')];delete _0x2b28e6[_0xc031('0x2e')][_0xc031('0x2f')];}_0x529ecb[_0xc031('0x30')]=_[_0xc031('0x18')](_0x6f0d57,_0xc031('0x31'));_0x529ecb[_0xc031('0x2e')]=_[_0xc031('0x1')](_0x2b28e6[_0xc031('0x2e')]);_0x529ecb[_0xc031('0x6')]=_[_0xc031('0x32')](_0x529ecb[_0xc031('0x30')],_0x529ecb[_0xc031('0x2e')]);_0x34c393[_0xc031('0x33')]=_[_0xc031('0x32')](_0x529ecb[_0xc031('0x30')],this[_0xc031('0x4')](_0x2b28e6[_0xc031('0x2e')][_0xc031('0x4')]));_0x34c393[_0xc031('0x33')]=_0x34c393['attributes'][_0xc031('0x21')]?_0x34c393[_0xc031('0x33')]:_0x529ecb[_0xc031('0x30')];if(!_0x2b28e6[_0xc031('0x2e')]['hasOwnProperty'](_0xc031('0x34'))){_0x34c393[_0xc031('0x15')]=this[_0xc031('0x15')](_0x2b28e6['query'][_0xc031('0x15')]);_0x34c393[_0xc031('0x16')]=this['offset'](_0x2b28e6[_0xc031('0x2e')][_0xc031('0x16')]);}_0x34c393[_0xc031('0x35')]=this[_0xc031('0x17')](_0x2b28e6['query'][_0xc031('0x17')]);_0x34c393[_0xc031('0x36')]=this[_0xc031('0x6')](_[_0xc031('0x37')](_0x2b28e6['query'],_0x529ecb[_0xc031('0x6')]),_0x6f0d57);if(_0x2b28e6[_0xc031('0x2e')]['filter']){var _0x87dd8b=_0x6f0d57;var _0x217c1c=_0x2b28e6[_0xc031('0x2e')][_0xc031('0x38')];if(typeof _0x217c1c==='object'){_0x87dd8b=_[_0xc031('0x38')](_0x6f0d57,function(_0x9b39ae){return _[_0xc031('0x2')](_0x217c1c[_0xc031('0x39')],_0x9b39ae['name']);});_0x217c1c=_0x217c1c['value'];}_0x34c393[_0xc031('0x36')]=_[_0xc031('0x3a')](_0x34c393['where'],{'$or':_[_0xc031('0x18')](_0x87dd8b,function(_0x176455){if(_0x176455[_0xc031('0xa')]!==_0xc031('0x3b')){if(_0x5eed3a){return sequelize[_0xc031('0x36')](sequelize['fn'](_0xc031('0x3c'),sequelize['col'](_0x176455[_0xc031('0x31')])),{'$like':sequelize['fn'](_0xc031('0x3c'),'%'+_0x2b28e6[_0xc031('0x2e')][_0xc031('0x38')]+'%')});}else{var _0x26138c={};_0x26138c[_0x176455[_0xc031('0x31')]]={'$like':'%'+_0x2b28e6[_0xc031('0x2e')][_0xc031('0x38')]+'%'};return _0x26138c;}}})});}_0x34c393=_[_0xc031('0x3a')]({},_0x34c393,_0x2b28e6[_0xc031('0x3d')]);return _0x34c393;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 1806b12..eceadf5 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b33=['../mysqldb','default','get','env','set','appPath','join','public','development','test','root','client','use','/server/views','engine','html','urlencoded','json','50mb','initialize','body-parser','method-override','cookie-parser','errorhandler','path','passport','cors','moment','./environment'];(function(_0x5a9130,_0x1a32f3){var _0x53580d=function(_0x357363){while(--_0x357363){_0x5a9130['push'](_0x5a9130['shift']());}};_0x53580d(++_0x1a32f3);}(_0x0b33,0x1e4));var _0x30b3=function(_0x5a636f,_0x3fec2b){_0x5a636f=_0x5a636f-0x0;var _0x6a8cfb=_0x0b33[_0x5a636f];return _0x6a8cfb;};'use strict';var express=require('express');var favicon=require('serve-favicon');var bodyParser=require(_0x30b3('0x0'));var methodOverride=require(_0x30b3('0x1'));var cookieParser=require(_0x30b3('0x2'));var errorHandler=require(_0x30b3('0x3'));var path=require(_0x30b3('0x4'));var passport=require(_0x30b3('0x5'));var cors=require(_0x30b3('0x6'));var moment=require(_0x30b3('0x7'));var config=require(_0x30b3('0x8'));var db=require(_0x30b3('0x9'))['db'];exports[_0x30b3('0xa')]=function(_0x30d32c){var _0x12e0ca=_0x30d32c[_0x30b3('0xb')](_0x30b3('0xc'));if(_0x12e0ca==='production'){_0x30d32c[_0x30b3('0xd')](_0x30b3('0xe'),path[_0x30b3('0xf')](config['root'],_0x30b3('0x10')));}if(_0x12e0ca===_0x30b3('0x11')||_0x12e0ca===_0x30b3('0x12')){_0x30d32c['set'](_0x30b3('0xe'),path['join'](config[_0x30b3('0x13')],_0x30b3('0x14')));_0x30d32c[_0x30b3('0x15')](errorHandler());}_0x30d32c[_0x30b3('0xd')]('json\x20replacer',function(_0x155325,_0x5ac94f){if(this[_0x155325]instanceof Date){_0x5ac94f=this[_0x155325]['toISOString']()['split']('.')[0x0]+'Z';}return _0x5ac94f;});_0x30d32c['use'](express['static'](_0x30d32c['get'](_0x30b3('0xe'))));_0x30d32c[_0x30b3('0xd')]('views',config[_0x30b3('0x13')]+_0x30b3('0x16'));_0x30d32c[_0x30b3('0x17')](_0x30b3('0x18'),require('ejs')['renderFile']);_0x30d32c['set']('view\x20engine',_0x30b3('0x18'));_0x30d32c[_0x30b3('0x15')](bodyParser[_0x30b3('0x19')]({'limit':'50mb','extended':!![]}));_0x30d32c['use'](bodyParser[_0x30b3('0x1a')]({'limit':_0x30b3('0x1b')}));_0x30d32c['use'](cors());_0x30d32c[_0x30b3('0x15')](methodOverride());_0x30d32c[_0x30b3('0x15')](cookieParser());_0x30d32c['use'](passport[_0x30b3('0x1c')]());}; \ No newline at end of file +var _0x80a2=['root','client','use','json\x20replacer','toISOString','split','static','views','/server/views','engine','html','ejs','renderFile','view\x20engine','50mb','json','express','serve-favicon','body-parser','cookie-parser','errorhandler','cors','moment','./environment','default','get','env','production','set','public','development','test','appPath','join'];(function(_0x22e6f8,_0x44fd6f){var _0x4709dd=function(_0x5ba8f9){while(--_0x5ba8f9){_0x22e6f8['push'](_0x22e6f8['shift']());}};_0x4709dd(++_0x44fd6f);}(_0x80a2,0x186));var _0x280a=function(_0x4037e7,_0x30a945){_0x4037e7=_0x4037e7-0x0;var _0x1bd6b1=_0x80a2[_0x4037e7];return _0x1bd6b1;};'use strict';var express=require(_0x280a('0x0'));var favicon=require(_0x280a('0x1'));var bodyParser=require(_0x280a('0x2'));var methodOverride=require('method-override');var cookieParser=require(_0x280a('0x3'));var errorHandler=require(_0x280a('0x4'));var path=require('path');var passport=require('passport');var cors=require(_0x280a('0x5'));var moment=require(_0x280a('0x6'));var config=require(_0x280a('0x7'));var db=require('../mysqldb')['db'];exports[_0x280a('0x8')]=function(_0x3a75bb){var _0x271011=_0x3a75bb[_0x280a('0x9')](_0x280a('0xa'));if(_0x271011===_0x280a('0xb')){_0x3a75bb[_0x280a('0xc')]('appPath',path['join'](config['root'],_0x280a('0xd')));}if(_0x271011===_0x280a('0xe')||_0x271011===_0x280a('0xf')){_0x3a75bb[_0x280a('0xc')](_0x280a('0x10'),path[_0x280a('0x11')](config[_0x280a('0x12')],_0x280a('0x13')));_0x3a75bb[_0x280a('0x14')](errorHandler());}_0x3a75bb[_0x280a('0xc')](_0x280a('0x15'),function(_0x44d053,_0x4475d0){if(this[_0x44d053]instanceof Date){_0x4475d0=this[_0x44d053][_0x280a('0x16')]()[_0x280a('0x17')]('.')[0x0]+'Z';}return _0x4475d0;});_0x3a75bb[_0x280a('0x14')](express[_0x280a('0x18')](_0x3a75bb[_0x280a('0x9')]('appPath')));_0x3a75bb[_0x280a('0xc')](_0x280a('0x19'),config['root']+_0x280a('0x1a'));_0x3a75bb[_0x280a('0x1b')](_0x280a('0x1c'),require(_0x280a('0x1d'))[_0x280a('0x1e')]);_0x3a75bb['set'](_0x280a('0x1f'),_0x280a('0x1c'));_0x3a75bb[_0x280a('0x14')](bodyParser['urlencoded']({'limit':_0x280a('0x20'),'extended':!![]}));_0x3a75bb[_0x280a('0x14')](bodyParser[_0x280a('0x21')]({'limit':'50mb'}));_0x3a75bb['use'](cors());_0x3a75bb['use'](methodOverride());_0x3a75bb[_0x280a('0x14')](cookieParser());_0x3a75bb[_0x280a('0x14')](passport['initialize']());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 253c9a3..3656a9b 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 _0x7e2f=['concat','mac','00:00:00:00:00:00','address','getFirstInterface','orderBy','cpus','map','join','md5','update','digest','hex','getUuid','test','licenseToken','win32','dmidecode\x20--string\x20system-uuid','hostname','macAddress','ipAddress','createHash','substring','lodash','execSync','../environment','keys','IPv4'];(function(_0x2f2430,_0x14b259){var _0x2140e8=function(_0x45bdc5){while(--_0x45bdc5){_0x2f2430['push'](_0x2f2430['shift']());}};_0x2140e8(++_0x14b259);}(_0x7e2f,0x19f));var _0xf7e2=function(_0x1a070b,_0x46d2c8){_0x1a070b=_0x1a070b-0x0;var _0x20b48d=_0x7e2f[_0x1a070b];return _0x20b48d;};'use strict';var _=require(_0xf7e2('0x0'));var os=require('os');var crypto=require('crypto');var machine=require('bimedia-machine-uuid');var exec=require('child_process')[_0xf7e2('0x1')];var config=require(_0xf7e2('0x2'));function getInterfaces(){var _0x306c2f=[];var _0x306bab=os['networkInterfaces']();var _0x2e9dc3=_['orderBy'](_[_0xf7e2('0x3')](_0x306bab));for(var _0x2b958b=0x0;_0x2b958b<_0x2e9dc3['length'];_0x2b958b++){var _0x30b42d=_0x306bab[_0x2e9dc3[_0x2b958b]]['filter'](function(_0x3cee1d){return _0x3cee1d['family']===_0xf7e2('0x4')&&_0x3cee1d['internal']===![];});_0x306c2f=_0x306c2f[_0xf7e2('0x5')](_0x30b42d);}return _0x306c2f;}function getFirstInterface(){var _0x98360=_['head'](getInterfaces());return{'macAddress':_0x98360&&_0x98360['mac']?_0x98360[_0xf7e2('0x6')]:_0xf7e2('0x7'),'ipAddress':_0x98360&&_0x98360['address']?_0x98360[_0xf7e2('0x8')]:'127.0.0.1'};}exports[_0xf7e2('0x9')]=getFirstInterface;function getCPUhash(){var _0x533249=_[_0xf7e2('0xa')](os[_0xf7e2('0xb')]()[_0xf7e2('0xc')](function(_0x42f06f){return _0x42f06f['model'];}))[_0xf7e2('0xd')](':');return crypto['createHash'](_0xf7e2('0xe'))[_0xf7e2('0xf')](_0x533249)[_0xf7e2('0x10')](_0xf7e2('0x11'));}exports[_0xf7e2('0x12')]=function(){var _0x320bbd=os['platform']();var _0x53aca0=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x53aca0[_0xf7e2('0x13')](config[_0xf7e2('0x14')])){return config['licenseToken'];}else if(_0x320bbd===_0xf7e2('0x15')){return exec(_0xf7e2('0x16'),{'encoding':'utf8'})['replace']('\x0d\x0a','');}else{var _0x2d117f=getFirstInterface();var _0x477639=getCPUhash();var _0xd6a1a3=_0x477639+'|'+os[_0xf7e2('0x17')]()+'|'+_0x2d117f[_0xf7e2('0x18')]+'|'+_0x2d117f[_0xf7e2('0x19')];var _0x5d013f=crypto[_0xf7e2('0x1a')](_0xf7e2('0xe'))[_0xf7e2('0xf')](_0xd6a1a3)[_0xf7e2('0x10')](_0xf7e2('0x11'));return _0x5d013f['substring'](0x0,0x8)+'-'+_0x5d013f[_0xf7e2('0x1b')](0x8,0xc)+'-'+_0x5d013f[_0xf7e2('0x1b')](0xc,0x10)+'-'+_0x5d013f[_0xf7e2('0x1b')](0x10,0x14)+'-'+_0x5d013f[_0xf7e2('0x1b')](0x14);}}; \ No newline at end of file +var _0x4dd3=['mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','model','createHash','md5','update','digest','hex','getUuid','platform','test','licenseToken','dmidecode\x20--string\x20system-uuid','replace','hostname','macAddress','ipAddress','substring','lodash','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','orderBy','keys','length','filter','IPv4','internal','concat','head'];(function(_0x1876b2,_0x5d0225){var _0x9fb1e0=function(_0x29b099){while(--_0x29b099){_0x1876b2['push'](_0x1876b2['shift']());}};_0x9fb1e0(++_0x5d0225);}(_0x4dd3,0x189));var _0x34dd=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0x4dd3[_0x54d4a8];return _0x3b321b;};'use strict';var _=require(_0x34dd('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0x34dd('0x1'));var exec=require(_0x34dd('0x2'))[_0x34dd('0x3')];var config=require(_0x34dd('0x4'));function getInterfaces(){var _0x3675bc=[];var _0x6a6a4f=os[_0x34dd('0x5')]();var _0x16b266=_[_0x34dd('0x6')](_[_0x34dd('0x7')](_0x6a6a4f));for(var _0x3ee187=0x0;_0x3ee187<_0x16b266[_0x34dd('0x8')];_0x3ee187++){var _0x289f0d=_0x6a6a4f[_0x16b266[_0x3ee187]][_0x34dd('0x9')](function(_0x43b302){return _0x43b302['family']===_0x34dd('0xa')&&_0x43b302[_0x34dd('0xb')]===![];});_0x3675bc=_0x3675bc[_0x34dd('0xc')](_0x289f0d);}return _0x3675bc;}function getFirstInterface(){var _0xb2b7dc=_[_0x34dd('0xd')](getInterfaces());return{'macAddress':_0xb2b7dc&&_0xb2b7dc[_0x34dd('0xe')]?_0xb2b7dc['mac']:_0x34dd('0xf'),'ipAddress':_0xb2b7dc&&_0xb2b7dc['address']?_0xb2b7dc[_0x34dd('0x10')]:_0x34dd('0x11')};}exports[_0x34dd('0x12')]=getFirstInterface;function getCPUhash(){var _0xd5b5d=_[_0x34dd('0x6')](os[_0x34dd('0x13')]()[_0x34dd('0x14')](function(_0x294a79){return _0x294a79[_0x34dd('0x15')];}))['join'](':');return crypto[_0x34dd('0x16')](_0x34dd('0x17'))[_0x34dd('0x18')](_0xd5b5d)[_0x34dd('0x19')](_0x34dd('0x1a'));}exports[_0x34dd('0x1b')]=function(){var _0xf2471f=os[_0x34dd('0x1c')]();var _0x5e8cdb=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x5e8cdb[_0x34dd('0x1d')](config[_0x34dd('0x1e')])){return config[_0x34dd('0x1e')];}else if(_0xf2471f==='win32'){return exec(_0x34dd('0x1f'),{'encoding':'utf8'})[_0x34dd('0x20')]('\x0d\x0a','');}else{var _0x300dcc=getFirstInterface();var _0x3c57cc=getCPUhash();var _0x40bbf3=_0x3c57cc+'|'+os[_0x34dd('0x21')]()+'|'+_0x300dcc[_0x34dd('0x22')]+'|'+_0x300dcc[_0x34dd('0x23')];var _0x97868d=crypto[_0x34dd('0x16')](_0x34dd('0x17'))[_0x34dd('0x18')](_0x40bbf3)[_0x34dd('0x19')](_0x34dd('0x1a'));return _0x97868d['substring'](0x0,0x8)+'-'+_0x97868d[_0x34dd('0x24')](0x8,0xc)+'-'+_0x97868d[_0x34dd('0x24')](0xc,0x10)+'-'+_0x97868d[_0x34dd('0x24')](0x10,0x14)+'-'+_0x97868d[_0x34dd('0x24')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 94b44e8..88289a8 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 _0xf807=['data2','data1','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','update','diff','decryptString','DEMO\x20START\x20AT\x20%s','finally','getUuid','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','error','message','util','moment','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','%s/api/servers/%s/check?version=%s','exports','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','get'];(function(_0x16f475,_0x22b4b4){var _0x53372e=function(_0x507a7d){while(--_0x507a7d){_0x16f475['push'](_0x16f475['shift']());}};_0x53372e(++_0x22b4b4);}(_0xf807,0x95));var _0x7f80=function(_0x2683d4,_0x1148c2){_0x2683d4=_0x2683d4-0x0;var _0x493266=_0xf807[_0x2683d4];return _0x493266;};'use strict';var util=require(_0x7f80('0x0'));var moment=require(_0x7f80('0x1'));var rp=require('request-promise');var BPromise=require(_0x7f80('0x2'));var pkginfo=require(_0x7f80('0x3'))(module,_0x7f80('0x4'));var db=require(_0x7f80('0x5'))['db'];var encryptor=require(_0x7f80('0x6'));var hardware=require(_0x7f80('0x7'));var logger=require(_0x7f80('0x8'))(_0x7f80('0x9'));var HOST=_0x7f80('0xa');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x1e28be){return new BPromise(function(_0x523e50,_0x4f34e6){var _0x125970=util['format'](_0x7f80('0xb'),HOST,_0x1e28be,module[_0x7f80('0xc')][_0x7f80('0x4')]);if(oldToken){_0x125970=util[_0x7f80('0xd')](_0x7f80('0xe'),HOST,_0x1e28be,module[_0x7f80('0xc')][_0x7f80('0x4')],oldToken);}var _0x2e66d6={'uri':_0x125970,'method':_0x7f80('0xf'),'timeout':0xea60,'json':!![]};return rp(_0x2e66d6)[_0x7f80('0x10')](function(_0x511277){_0x523e50(_0x511277);})[_0x7f80('0x11')](function(_0x209de4){_0x4f34e6(_0x209de4);});});}function manageLicense(_0x2a36cd,_0x2978a5){var _0x202e3d=_0x2978a5[_0x7f80('0x12')]({'plain':!![]});if(!isOldTokenSent&&_0x202e3d['data1']!==_0x2a36cd&&!_0x202e3d[_0x7f80('0x13')]){oldToken=_0x202e3d[_0x7f80('0x14')];}httpRequest(_0x2a36cd)[_0x7f80('0x10')](function(_0x2182d4){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x2182d4['active']){isOldTokenSent=![];if(!_0x202e3d[_0x7f80('0x9')]&&_0x202e3d['license']!=_0x2182d4[_0x7f80('0x9')]||_0x202e3d[_0x7f80('0x9')]&&_0x202e3d[_0x7f80('0x13')]){logger[_0x7f80('0x15')](_0x7f80('0x16'));}if(_0x202e3d[_0x7f80('0x9')]&&!_0x202e3d[_0x7f80('0x13')]&&_0x202e3d[_0x7f80('0x9')]!=_0x2182d4[_0x7f80('0x9')]){logger[_0x7f80('0x15')](_0x7f80('0x17'));}if(_0x202e3d[_0x7f80('0x9')]&&!_0x202e3d['data2']&&_0x202e3d[_0x7f80('0x9')]==_0x2182d4[_0x7f80('0x9')]){return _0x2978a5;}return _0x2978a5['update']({'data1':_0x2a36cd,'data2':null,'license':_0x2182d4[_0x7f80('0x9')]});}else{if(_0x2182d4['license']||_0x202e3d[_0x7f80('0x9')]){if(!_0x202e3d['data2']){if(_0x202e3d[_0x7f80('0x14')]==_0x2a36cd){GRAY_PERIOD_REASON=_0x7f80('0x18');logger[_0x7f80('0x15')](_0x7f80('0x19'));}else{GRAY_PERIOD_REASON=_0x7f80('0x1a');logger[_0x7f80('0x15')](_0x7f80('0x1b'),_0x202e3d[_0x7f80('0x14')],_0x2a36cd);}logger[_0x7f80('0x15')](_0x7f80('0x1c'),GRAY_PERIOD_REASON[_0x7f80('0x1d')](),moment()['format'](_0x7f80('0x1e')));return _0x2978a5[_0x7f80('0x1f')]({'data2':encryptor['encryptString'](moment()[_0x7f80('0xd')](_0x7f80('0x1e')))});}else{if(moment()[_0x7f80('0x20')](encryptor[_0x7f80('0x21')](_0x202e3d['data2']),'days')>DAYS){logger[_0x7f80('0x15')](_0x7f80('0x22'),moment()[_0x7f80('0xd')](_0x7f80('0x1e')));isOldTokenSent=![];return _0x2978a5[_0x7f80('0x1f')]({'data1':_0x2a36cd,'data2':null,'license':null});}}}else{if(_0x202e3d[_0x7f80('0x14')]!=_0x2a36cd){logger[_0x7f80('0x15')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x202e3d[_0x7f80('0x14')],_0x2a36cd);return _0x2978a5['update']({'data1':_0x2a36cd,'data2':null,'license':null});}}}return _0x2978a5;})[_0x7f80('0x10')](function(_0x508e09){_0x2978a5=_0x508e09;})[_0x7f80('0x11')](function(_0x166a1b){logger['error'](_0x166a1b['message']);})[_0x7f80('0x23')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x2978a5);},TIME);});}function defaultLicense(){var _0x4c7602=hardware[_0x7f80('0x24')]();if(_0x4c7602){return db['License'][_0x7f80('0x25')]({'where':{'id':0x1},'defaults':{'data1':_0x4c7602}})[_0x7f80('0x26')](function(_0x46437c,_0x392696){logger[_0x7f80('0x15')](_0x7f80('0x27'),_0x4c7602);manageLicense(_0x4c7602,_0x46437c);})['catch'](function(_0x1fb8b5){logger[_0x7f80('0x28')](_0x1fb8b5[_0x7f80('0x29')]);});}}exports['default']=defaultLicense; \ No newline at end of file +var _0xead2=['getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','bluebird','pkginfo','version','../../components/encryptor','./hardware','https://www.xcallymotion.com','%s/api/servers/%s/check?version=%s','exports','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','catch','get','data1','data2','then','active','license','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','days','error','message'];(function(_0x53f897,_0x539857){var _0x6879f8=function(_0xa3c36){while(--_0xa3c36){_0x53f897['push'](_0x53f897['shift']());}};_0x6879f8(++_0x539857);}(_0xead2,0x1a0));var _0x2ead=function(_0x551c0b,_0x2d9a29){_0x551c0b=_0x551c0b-0x0;var _0x176c38=_0xead2[_0x551c0b];return _0x176c38;};'use strict';var util=require(_0x2ead('0x0'));var moment=require(_0x2ead('0x1'));var rp=require('request-promise');var BPromise=require(_0x2ead('0x2'));var pkginfo=require(_0x2ead('0x3'))(module,_0x2ead('0x4'));var db=require('../../mysqldb')['db'];var encryptor=require(_0x2ead('0x5'));var hardware=require(_0x2ead('0x6'));var logger=require('../logger')('license');var HOST=_0x2ead('0x7');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0xd1e38a){return new BPromise(function(_0x42cf29,_0x46ee54){var _0x35edf4=util['format'](_0x2ead('0x8'),HOST,_0xd1e38a,module[_0x2ead('0x9')][_0x2ead('0x4')]);if(oldToken){_0x35edf4=util[_0x2ead('0xa')](_0x2ead('0xb'),HOST,_0xd1e38a,module[_0x2ead('0x9')][_0x2ead('0x4')],oldToken);}var _0x3a0433={'uri':_0x35edf4,'method':_0x2ead('0xc'),'timeout':0xea60,'json':!![]};return rp(_0x3a0433)['then'](function(_0x7ac576){_0x42cf29(_0x7ac576);})[_0x2ead('0xd')](function(_0xfd07c){_0x46ee54(_0xfd07c);});});}function manageLicense(_0x233c55,_0x2ebf0f){var _0x10bdb5=_0x2ebf0f[_0x2ead('0xe')]({'plain':!![]});if(!isOldTokenSent&&_0x10bdb5[_0x2ead('0xf')]!==_0x233c55&&!_0x10bdb5[_0x2ead('0x10')]){oldToken=_0x10bdb5[_0x2ead('0xf')];}httpRequest(_0x233c55)[_0x2ead('0x11')](function(_0x13d14d){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x13d14d[_0x2ead('0x12')]){isOldTokenSent=![];if(!_0x10bdb5[_0x2ead('0x13')]&&_0x10bdb5[_0x2ead('0x13')]!=_0x13d14d[_0x2ead('0x13')]||_0x10bdb5[_0x2ead('0x13')]&&_0x10bdb5[_0x2ead('0x10')]){logger[_0x2ead('0x14')](_0x2ead('0x15'));}if(_0x10bdb5['license']&&!_0x10bdb5[_0x2ead('0x10')]&&_0x10bdb5[_0x2ead('0x13')]!=_0x13d14d[_0x2ead('0x13')]){logger[_0x2ead('0x14')](_0x2ead('0x16'));}if(_0x10bdb5[_0x2ead('0x13')]&&!_0x10bdb5['data2']&&_0x10bdb5[_0x2ead('0x13')]==_0x13d14d[_0x2ead('0x13')]){return _0x2ebf0f;}return _0x2ebf0f[_0x2ead('0x17')]({'data1':_0x233c55,'data2':null,'license':_0x13d14d['license']});}else{if(_0x13d14d['license']||_0x10bdb5[_0x2ead('0x13')]){if(!_0x10bdb5[_0x2ead('0x10')]){if(_0x10bdb5['data1']==_0x233c55){GRAY_PERIOD_REASON=_0x2ead('0x18');logger[_0x2ead('0x14')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0x2ead('0x19');logger[_0x2ead('0x14')](_0x2ead('0x1a'),_0x10bdb5[_0x2ead('0xf')],_0x233c55);}logger['info'](_0x2ead('0x1b'),GRAY_PERIOD_REASON[_0x2ead('0x1c')](),moment()[_0x2ead('0xa')](_0x2ead('0x1d')));return _0x2ebf0f[_0x2ead('0x17')]({'data2':encryptor[_0x2ead('0x1e')](moment()['format'](_0x2ead('0x1d')))});}else{if(moment()[_0x2ead('0x1f')](encryptor['decryptString'](_0x10bdb5[_0x2ead('0x10')]),_0x2ead('0x20'))>DAYS){logger[_0x2ead('0x14')]('DEMO\x20START\x20AT\x20%s',moment()[_0x2ead('0xa')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x2ebf0f[_0x2ead('0x17')]({'data1':_0x233c55,'data2':null,'license':null});}}}else{if(_0x10bdb5[_0x2ead('0xf')]!=_0x233c55){logger['info'](_0x2ead('0x1a'),_0x10bdb5['data1'],_0x233c55);return _0x2ebf0f[_0x2ead('0x17')]({'data1':_0x233c55,'data2':null,'license':null});}}}return _0x2ebf0f;})[_0x2ead('0x11')](function(_0x1c26d2){_0x2ebf0f=_0x1c26d2;})[_0x2ead('0xd')](function(_0x2666a1){logger[_0x2ead('0x21')](_0x2666a1[_0x2ead('0x22')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x2ead('0x23')](),_0x2ebf0f);},TIME);});}function defaultLicense(){var _0x2a5572=hardware['getUuid']();if(_0x2a5572){return db[_0x2ead('0x24')][_0x2ead('0x25')]({'where':{'id':0x1},'defaults':{'data1':_0x2a5572}})[_0x2ead('0x26')](function(_0x2400b5,_0x218876){logger[_0x2ead('0x14')](_0x2ead('0x27'),_0x2a5572);manageLicense(_0x2a5572,_0x2400b5);})['catch'](function(_0x5606c6){logger[_0x2ead('0x21')](_0x5606c6['message']);});}}exports[_0x2ead('0x28')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index dfbebf6..ee581ff 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 _0xa153=['pick','user','telephone','exports','util','lodash','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','getUuid','Breaking\x20license','License','defaults','catch','uuid','license','isEmpty','License\x20key\x20value\x20not\x20found','data1','data2','split','decryptString','format','parse','demo','machineUuid','add','days','disabled','message','then','User','findAll','role','sequelize','count','admin','users','telephones','forEach'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xa153,0x1dd));var _0x3a15=function(_0x496b2f,_0x280e8d){_0x496b2f=_0x496b2f-0x0;var _0x48d94f=_0xa153[_0x496b2f];return _0x48d94f;};'use strict';var util=require(_0x3a15('0x0'));var _=require(_0x3a15('0x1'));var moment=require(_0x3a15('0x2'));var BPromise=require(_0x3a15('0x3'));var hardware=require(_0x3a15('0x4'));var encryptor=require(_0x3a15('0x5'));var db=require(_0x3a15('0x6'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x3a15('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0x3a15('0x8')](),'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':_0x3a15('0x9'),'machineUuid':hardware[_0x3a15('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x5396ad){return new BPromise(function(_0x5328c8,_0x511d3f){return db[_0x3a15('0xa')]['find'](_[_0x3a15('0xb')](_0x5396ad,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x35feb8){return checkLicense(_0x35feb8,null);})['then'](function(_0x4479bf){_0x5328c8(_0x4479bf);return;})[_0x3a15('0xc')](function(_0x46e854){_0x511d3f(_0x46e854);});});}function checkLicense(_0x5044d4,_0xb54fed){if(!_0x5044d4){demoLicense[_0x3a15('0xd')]=_0x5044d4['data1'];return demoLicense;}try{var _0x4347d8=_0xb54fed||_0x5044d4[_0x3a15('0xe')];if(_[_0x3a15('0xf')](_0x4347d8)){throw new Error(_0x3a15('0x10'));}var _0xc68155=_0x5044d4[_0x3a15('0x11')];var _0x4fb811=_0x5044d4[_0x3a15('0x12')];var _0x219e86=_0xc68155[_0x3a15('0x13')]('-')[0x4];var _0x5ad91a=_0xc68155[_0x3a15('0x13')]('-')[0x0];var _0x384f58=encryptor[_0x3a15('0x14')](_0x4347d8,util[_0x3a15('0x15')]('%s:%s:%s',_0x219e86,_0xc68155,_0x5ad91a));var _0x131591=JSON[_0x3a15('0x16')](_0x384f58);_0x131591[_0x3a15('0x17')]=![];_0x131591['uuid']=_0xc68155;_0x131591[_0x3a15('0x18')]=hardware[_0x3a15('0x8')]();if(_0x4fb811){var _0x4c419a=encryptor[_0x3a15('0x14')](_0x4fb811);_0x131591['gray']=_0x4c419a;_0x131591['deadline']=moment(_0x4c419a)[_0x3a15('0x19')](0x7,_0x3a15('0x1a'))[_0x3a15('0x15')]();_0x131591['grayReason']=_0x131591['uuid']!=_0x131591[_0x3a15('0x18')]?'changed':_0x3a15('0x1b');}return _0x131591;}catch(_0x36c4ab){breakingLicense[_0x3a15('0xd')]=_0x5044d4[_0x3a15('0x11')];breakingLicense[_0x3a15('0x1c')]=_0x36c4ab[_0x3a15('0x1c')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x38bff1,_0xf34508){getLicense()[_0x3a15('0x1d')](function(_0x4d8ff9){return db[_0x3a15('0x1e')][_0x3a15('0x1f')]({'attributes':[_0x3a15('0x20'),[db['sequelize']['fn']('COUNT',db[_0x3a15('0x21')]['col'](_0x3a15('0x20'))),_0x3a15('0x22')]],'group':_0x3a15('0x20'),'where':{'role':{'$or':[_0x3a15('0x23'),'user','telephone']}},'raw':!![]})['then'](function(_0x20e2ad){var _0x123063={'user':_0x4d8ff9[_0x3a15('0x24')]||0x0,'telephone':_0x4d8ff9[_0x3a15('0x25')]||0x0};_0x20e2ad[_0x3a15('0x26')](function(_0x299eab){var _0x5bf286=_0x299eab[_0x3a15('0x20')]===_0x3a15('0x23')?'user':_0x299eab[_0x3a15('0x20')];_0x123063[_0x5bf286]-=_0x299eab[_0x3a15('0x22')];if(_0x123063[_0x5bf286]<0x0)_0x123063[_0x5bf286]=0x0;});_0x38bff1(_0x123063);return;});})[_0x3a15('0xc')](function(_0x4ace58){_0xf34508(_0x4ace58);});});}function checkUserLimits(_0x594066){return new BPromise(function(_0x4e076a,_0x20c26e){getLimits()['then'](function(_0x41b75f){var _0x5b614f=_[_0x3a15('0x27')](_['countBy'](_0x594066,'role'),[_0x3a15('0x23'),_0x3a15('0x28'),_0x3a15('0x29')]);var _0x259dc7=(_0x5b614f['admin']||0x0)+(_0x5b614f[_0x3a15('0x28')]||0x0);var _0x287a14=_0x5b614f[_0x3a15('0x29')]||0x0;if(_0x259dc7>_0x41b75f['user'])return _0x20c26e('License\x20limit\x20reached\x20for\x20users');if(_0x287a14>_0x41b75f[_0x3a15('0x29')])return _0x20c26e('License\x20limit\x20reached\x20for\x20telephones');return _0x4e076a();})['catch'](function(_0x1b7cee){_0x20c26e(_0x1b7cee);});});}module[_0x3a15('0x2a')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x4245=['admin','user','telephone','users','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','moment','../../components/encryptor','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','License','find','defaults','then','catch','uuid','license','isEmpty','License\x20key\x20value\x20not\x20found','data1','data2','split','decryptString','format','%s:%s:%s','parse','machineUuid','gray','deadline','add','days','grayReason','disabled','message','findAll','role','sequelize','COUNT','col','count'];(function(_0x57d74e,_0x51773f){var _0x39052b=function(_0x4a7a64){while(--_0x4a7a64){_0x57d74e['push'](_0x57d74e['shift']());}};_0x39052b(++_0x51773f);}(_0x4245,0x103));var _0x5424=function(_0x54d8e1,_0x254f7c){_0x54d8e1=_0x54d8e1-0x0;var _0x50473b=_0x4245[_0x54d8e1];return _0x50473b;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x5424('0x0'));var BPromise=require('bluebird');var hardware=require('./hardware');var encryptor=require(_0x5424('0x1'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x5424('0x2'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x5424('0x3'),'machineUuid':hardware[_0x5424('0x4')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x5424('0x2'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0x5424('0x4')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x3ceb97){return new BPromise(function(_0x1fbd11,_0x2554b5){return db[_0x5424('0x5')][_0x5424('0x6')](_[_0x5424('0x7')](_0x3ceb97,{'raw':!![],'where':{'id':0x1}}))[_0x5424('0x8')](function(_0xff5331){return checkLicense(_0xff5331,null);})[_0x5424('0x8')](function(_0x194f4c){_0x1fbd11(_0x194f4c);return;})[_0x5424('0x9')](function(_0x2e204f){_0x2554b5(_0x2e204f);});});}function checkLicense(_0x3a85f8,_0x1e4a75){if(!_0x3a85f8){demoLicense[_0x5424('0xa')]=_0x3a85f8['data1'];return demoLicense;}try{var _0x46e1b5=_0x1e4a75||_0x3a85f8[_0x5424('0xb')];if(_[_0x5424('0xc')](_0x46e1b5)){throw new Error(_0x5424('0xd'));}var _0x1d9951=_0x3a85f8[_0x5424('0xe')];var _0x399458=_0x3a85f8[_0x5424('0xf')];var _0xd8d7d4=_0x1d9951[_0x5424('0x10')]('-')[0x4];var _0xde33ca=_0x1d9951[_0x5424('0x10')]('-')[0x0];var _0x2b0380=encryptor[_0x5424('0x11')](_0x46e1b5,util[_0x5424('0x12')](_0x5424('0x13'),_0xd8d7d4,_0x1d9951,_0xde33ca));var _0x4bd5de=JSON[_0x5424('0x14')](_0x2b0380);_0x4bd5de['demo']=![];_0x4bd5de[_0x5424('0xa')]=_0x1d9951;_0x4bd5de[_0x5424('0x15')]=hardware['getUuid']();if(_0x399458){var _0x1ccb59=encryptor[_0x5424('0x11')](_0x399458);_0x4bd5de[_0x5424('0x16')]=_0x1ccb59;_0x4bd5de[_0x5424('0x17')]=moment(_0x1ccb59)[_0x5424('0x18')](0x7,_0x5424('0x19'))['format']();_0x4bd5de[_0x5424('0x1a')]=_0x4bd5de[_0x5424('0xa')]!=_0x4bd5de[_0x5424('0x15')]?'changed':_0x5424('0x1b');}return _0x4bd5de;}catch(_0x297e51){breakingLicense[_0x5424('0xa')]=_0x3a85f8['data1'];breakingLicense[_0x5424('0x1c')]=_0x297e51[_0x5424('0x1c')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x3f104,_0x559ad8){getLicense()['then'](function(_0x4ef37f){return db['User'][_0x5424('0x1d')]({'attributes':[_0x5424('0x1e'),[db[_0x5424('0x1f')]['fn'](_0x5424('0x20'),db['sequelize'][_0x5424('0x21')](_0x5424('0x1e'))),_0x5424('0x22')]],'group':_0x5424('0x1e'),'where':{'role':{'$or':[_0x5424('0x23'),_0x5424('0x24'),_0x5424('0x25')]}},'raw':!![]})[_0x5424('0x8')](function(_0xa49aa8){var _0x17dcef={'user':_0x4ef37f[_0x5424('0x26')]||0x0,'telephone':_0x4ef37f['telephones']||0x0};_0xa49aa8['forEach'](function(_0x4d2b6e){var _0x1b559a=_0x4d2b6e[_0x5424('0x1e')]==='admin'?_0x5424('0x24'):_0x4d2b6e[_0x5424('0x1e')];_0x17dcef[_0x1b559a]-=_0x4d2b6e[_0x5424('0x22')];if(_0x17dcef[_0x1b559a]<0x0)_0x17dcef[_0x1b559a]=0x0;});_0x3f104(_0x17dcef);return;});})[_0x5424('0x9')](function(_0x1573f9){_0x559ad8(_0x1573f9);});});}function checkUserLimits(_0x387e63){return new BPromise(function(_0x4fd9e6,_0x33f854){getLimits()['then'](function(_0x19cac3){var _0x280e82=_['pick'](_['countBy'](_0x387e63,_0x5424('0x1e')),[_0x5424('0x23'),'user',_0x5424('0x25')]);var _0x2bccf7=(_0x280e82[_0x5424('0x23')]||0x0)+(_0x280e82[_0x5424('0x24')]||0x0);var _0x35913f=_0x280e82[_0x5424('0x25')]||0x0;if(_0x2bccf7>_0x19cac3[_0x5424('0x24')])return _0x33f854(_0x5424('0x27'));if(_0x35913f>_0x19cac3[_0x5424('0x25')])return _0x33f854(_0x5424('0x28'));return _0x4fd9e6();})['catch'](function(_0x5ee525){_0x33f854(_0x5ee525);});});}module[_0x5424('0x29')]={'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 8d370d0..4442afc 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 _0x7880=['http://localhost:9000','myappanuglar-secret','app-id','secret'];(function(_0x4adcb0,_0x4aa4ef){var _0x50b00e=function(_0x389507){while(--_0x389507){_0x4adcb0['push'](_0x4adcb0['shift']());}};_0x50b00e(++_0x4aa4ef);}(_0x7880,0x1f4));var _0x0788=function(_0xbccf,_0x5f3f74){_0xbccf=_0xbccf-0x0;var _0x24c504=_0x7880[_0xbccf];return _0x24c504;};'use strict';module['exports']={'DOMAIN':_0x0788('0x0'),'SESSION_SECRET':_0x0788('0x1'),'GOOGLE_ID':_0x0788('0x2'),'GOOGLE_SECRET':_0x0788('0x3'),'DEBUG':''}; \ No newline at end of file +var _0x57ca=['http://localhost:9000','myappanuglar-secret','secret'];(function(_0x473b7b,_0x1b017a){var _0x4d18b9=function(_0x569253){while(--_0x569253){_0x473b7b['push'](_0x473b7b['shift']());}};_0x4d18b9(++_0x1b017a);}(_0x57ca,0x108));var _0xa57c=function(_0x3bfbf2,_0xe76f48){_0x3bfbf2=_0x3bfbf2-0x0;var _0xae343c=_0x57ca[_0x3bfbf2];return _0xae343c;};'use strict';module['exports']={'DOMAIN':_0xa57c('0x0'),'SESSION_SECRET':_0xa57c('0x1'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0xa57c('0x2'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 0af4421..fcee726 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4f36=['winston','path','INFO','join','/var','log','xcally','format','%s-%s.log','message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','exports','Logger','File','error','%s-%s','info','transports','env','debugLevel','moment'];(function(_0x1bf611,_0x5a169b){var _0x46c450=function(_0x3528e0){while(--_0x3528e0){_0x1bf611['push'](_0x1bf611['shift']());}};_0x46c450(++_0x5a169b);}(_0x4f36,0x6b));var _0x64f3=function(_0x54d52,_0x2473ba){_0x54d52=_0x54d52-0x0;var _0x968345=_0x4f36[_0x54d52];return _0x968345;};'use strict';var moment=require(_0x64f3('0x0'));var winston=require(_0x64f3('0x1'));var util=require('util');var path=require(_0x64f3('0x2'));var debugLevel=_0x64f3('0x3');function filename(_0x48dc2d,_0x4862cf){return path[_0x64f3('0x4')](_0x64f3('0x5'),_0x64f3('0x6'),_0x64f3('0x7'),util[_0x64f3('0x8')](_0x64f3('0x9'),_0x48dc2d,_0x4862cf));}function formatter(_0x44dc16,_0x2782e3){_0x2782e3[_0x64f3('0xa')]=_0x2782e3[_0x64f3('0xa')][_0x64f3('0xb')](/@@{/g,_0x64f3('0xc'))[_0x64f3('0xb')](/}@@/g,_0x64f3('0xd'))[_0x64f3('0xb')](/@{/g,'{{')[_0x64f3('0xb')](/}@/g,'}}');return util[_0x64f3('0x8')](_0x64f3('0xe'),moment()['format'](_0x64f3('0xf')),_0x2782e3[_0x64f3('0x10')][_0x64f3('0x11')](),_0x44dc16,_0x2782e3[_0x64f3('0xa')]);}module[_0x64f3('0x12')]=function(_0x5a5a2f){return new winston[(_0x64f3('0x13'))]({'transports':[new winston['transports'][(_0x64f3('0x14'))]({'name':util[_0x64f3('0x8')]('%s-%s',_0x5a5a2f,_0x64f3('0x15')),'filename':filename(_0x5a5a2f,_0x64f3('0x15')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5abf51){return formatter(_0x5a5a2f,_0x5abf51);}}),new winston['transports']['File']({'name':util[_0x64f3('0x8')](_0x64f3('0x16'),_0x5a5a2f,_0x64f3('0x17')),'filename':filename(_0x5a5a2f,_0x64f3('0x17')),'level':_0x64f3('0x17'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x616d1f){return formatter(_0x5a5a2f,_0x616d1f);}}),new winston[(_0x64f3('0x18'))]['Console']({'level':process[_0x64f3('0x19')][_0x64f3('0x1a')]||debugLevel,'json':![],'formatter':function(_0x1b1615){return formatter(_0x5a5a2f,_0x1b1615);}})]});}; \ No newline at end of file +var _0x2b84=['debugLevel','moment','util','INFO','join','/var','%s-%s.log','message','{{{','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','transports','File','error','%s-%s','info','Console','env'];(function(_0xe88bab,_0x1ed383){var _0x591329=function(_0x2b2ce0){while(--_0x2b2ce0){_0xe88bab['push'](_0xe88bab['shift']());}};_0x591329(++_0x1ed383);}(_0x2b84,0x188));var _0x42b8=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x2b84[_0x30ae5e];return _0x1f2e93;};'use strict';var moment=require(_0x42b8('0x0'));var winston=require('winston');var util=require(_0x42b8('0x1'));var path=require('path');var debugLevel=_0x42b8('0x2');function filename(_0x507f83,_0x9247e7){return path[_0x42b8('0x3')](_0x42b8('0x4'),'log','xcally',util['format'](_0x42b8('0x5'),_0x507f83,_0x9247e7));}function formatter(_0x225d44,_0x67e2e0){_0x67e2e0[_0x42b8('0x6')]=_0x67e2e0[_0x42b8('0x6')]['replace'](/@@{/g,_0x42b8('0x7'))[_0x42b8('0x8')](/}@@/g,_0x42b8('0x9'))[_0x42b8('0x8')](/@{/g,'{{')[_0x42b8('0x8')](/}@/g,'}}');return util['format'](_0x42b8('0xa'),moment()[_0x42b8('0xb')](_0x42b8('0xc')),_0x67e2e0[_0x42b8('0xd')][_0x42b8('0xe')](),_0x225d44,_0x67e2e0[_0x42b8('0x6')]);}module['exports']=function(_0x2eea8b){return new winston['Logger']({'transports':[new winston[(_0x42b8('0xf'))][(_0x42b8('0x10'))]({'name':util[_0x42b8('0xb')]('%s-%s',_0x2eea8b,_0x42b8('0x11')),'filename':filename(_0x2eea8b,_0x42b8('0x11')),'level':_0x42b8('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x84d6ad){return formatter(_0x2eea8b,_0x84d6ad);}}),new winston[(_0x42b8('0xf'))]['File']({'name':util[_0x42b8('0xb')](_0x42b8('0x12'),_0x2eea8b,'info'),'filename':filename(_0x2eea8b,_0x42b8('0x13')),'level':'info','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1fca47){return formatter(_0x2eea8b,_0x1fca47);}}),new winston[(_0x42b8('0xf'))][(_0x42b8('0x14'))]({'level':process[_0x42b8('0x15')][_0x42b8('0x16')]||debugLevel,'json':![],'formatter':function(_0x42516b){return formatter(_0x2eea8b,_0x42516b);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 20c8bc5..c4cf4df 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 _0x3e6e=['routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path','join','../../services/express/index.js','ami','../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x3e6e,0x19b));var _0xe3e6=function(_0x197061,_0x22e7c9){_0x197061=_0x197061-0x0;var _0x16a0dc=_0x3e6e[_0x197061];return _0x16a0dc;};'use strict';var path=require(_0xe3e6('0x0'));var os=require('os');var config={'apps':[{'name':'express','script':path[_0xe3e6('0x1')](__dirname,_0xe3e6('0x2'))},{'name':_0xe3e6('0x3'),'script':path[_0xe3e6('0x1')](__dirname,_0xe3e6('0x4'))},{'name':_0xe3e6('0x5'),'script':path[_0xe3e6('0x1')](__dirname,_0xe3e6('0x6'))},{'name':_0xe3e6('0x7'),'script':path[_0xe3e6('0x1')](__dirname,_0xe3e6('0x8'))},{'name':_0xe3e6('0x9'),'script':path[_0xe3e6('0x1')](__dirname,_0xe3e6('0xa'))},{'name':_0xe3e6('0xb'),'script':path[_0xe3e6('0x1')](__dirname,_0xe3e6('0xc'))}]};module[_0xe3e6('0xd')]=config; \ No newline at end of file +var _0xcef3=['../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path','express','join','../../services/express/index.js','ami','../../services/ami/index.js','../../services/agi/index.js','email'];(function(_0x1ea2e6,_0x17aa9c){var _0x2fd547=function(_0x2f3a60){while(--_0x2f3a60){_0x1ea2e6['push'](_0x1ea2e6['shift']());}};_0x2fd547(++_0x17aa9c);}(_0xcef3,0x19c));var _0x3cef=function(_0x544a27,_0x5914ab){_0x544a27=_0x544a27-0x0;var _0x1eed0b=_0xcef3[_0x544a27];return _0x1eed0b;};'use strict';var path=require(_0x3cef('0x0'));var os=require('os');var config={'apps':[{'name':_0x3cef('0x1'),'script':path[_0x3cef('0x2')](__dirname,_0x3cef('0x3'))},{'name':_0x3cef('0x4'),'script':path['join'](__dirname,_0x3cef('0x5'))},{'name':'agi','script':path[_0x3cef('0x2')](__dirname,_0x3cef('0x6'))},{'name':_0x3cef('0x7'),'script':path['join'](__dirname,_0x3cef('0x8'))},{'name':_0x3cef('0x9'),'script':path['join'](__dirname,_0x3cef('0xa'))},{'name':_0x3cef('0xb'),'script':path[_0x3cef('0x2')](__dirname,_0x3cef('0xc'))}]};module[_0x3cef('0xd')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 02520db..184ce9f 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 _0x88eb=['bluebird','./config','connect','connected','start','disconnect','stop','then','restart','list','describe','delete','dump','saved'];(function(_0x526168,_0x414b29){var _0x2b5b60=function(_0x1310f3){while(--_0x1310f3){_0x526168['push'](_0x526168['shift']());}};_0x2b5b60(++_0x414b29);}(_0x88eb,0xee));var _0xb88e=function(_0x3c340e,_0x33c8bc){_0x3c340e=_0x3c340e-0x0;var _0x2c82b6=_0x88eb[_0x3c340e];return _0x2c82b6;};'use strict';var pm2=require('pm2');var BPromise=require(_0xb88e('0x0'));var config=require(_0xb88e('0x1'));function connect(){return new BPromise(function(_0x47f1d4,_0x2c9fc0){return pm2[_0xb88e('0x2')](function(_0x46df40){if(_0x46df40){return _0x2c9fc0(_0x46df40);}return _0x47f1d4(_0xb88e('0x3'));});});};exports[_0xb88e('0x4')]=function(_0x2e0f16){return connect()['then'](function(){return new BPromise(function(_0x530177,_0x1d98d9){return pm2[_0xb88e('0x4')](_0x2e0f16,function(_0x375d7f,_0x4b019a){if(_0x375d7f){return _0x1d98d9(_0x375d7f);}pm2[_0xb88e('0x5')]();return _0x530177(_0x4b019a);});});});};exports[_0xb88e('0x6')]=function(_0x2d40db){return connect()[_0xb88e('0x7')](function(){return new BPromise(function(_0x42a6c3,_0x2c0a20){return pm2[_0xb88e('0x6')](_0x2d40db,function(_0x53e4d5,_0x3919ea){if(_0x53e4d5){return _0x2c0a20(_0x53e4d5);}pm2[_0xb88e('0x5')]();return _0x42a6c3(_0x3919ea);});});});};exports['restart']=function(_0x33a611){return connect()['then'](function(){return new BPromise(function(_0x492ed4,_0x28b991){return pm2[_0xb88e('0x8')](_0x33a611,function(_0xf351e8,_0x32cb4a){if(_0xf351e8){return _0x28b991(_0xf351e8);}pm2[_0xb88e('0x5')]();return _0x492ed4(_0x32cb4a);});});});};exports[_0xb88e('0x9')]=function(){return connect()[_0xb88e('0x7')](function(){return new BPromise(function(_0x53ae85,_0xbc7ad0){return pm2[_0xb88e('0x9')](function(_0x22a8ed,_0x4ecf57){if(_0x22a8ed){return _0xbc7ad0(_0x22a8ed);}pm2[_0xb88e('0x5')]();return _0x53ae85(_0x4ecf57);});});});};exports['describe']=function(_0x188449){return connect()[_0xb88e('0x7')](function(){return new BPromise(function(_0x31d802,_0x332d70){return pm2[_0xb88e('0xa')](_0x188449,function(_0x24eaa6,_0x44248d){if(_0x24eaa6){return _0x332d70(_0x24eaa6);}pm2['disconnect']();return _0x31d802(_0x44248d);});});});};exports[_0xb88e('0xb')]=function(_0x20fea5){return connect()[_0xb88e('0x7')](function(){return new BPromise(function(_0x310e05,_0x3fb21e){return pm2['delete'](_0x20fea5,function(_0x148d7a,_0x21dd21){if(_0x148d7a){return _0x3fb21e(_0x148d7a);}pm2[_0xb88e('0x5')]();return _0x310e05(_0x21dd21);});});});};exports['dump']=function(){return connect()[_0xb88e('0x7')](function(){return new BPromise(function(_0x40f869,_0x21356a){return pm2[_0xb88e('0xc')](function(_0x3015d6){if(_0x3015d6){return _0x21356a(_0x3015d6);}return _0x40f869(_0xb88e('0xd'));});});});}; \ No newline at end of file +var _0xe328=['dump','saved','bluebird','./config','connect','start','disconnect','stop','then','restart','list','describe','delete'];(function(_0x12c038,_0x1d922c){var _0x1c43b8=function(_0x5a0552){while(--_0x5a0552){_0x12c038['push'](_0x12c038['shift']());}};_0x1c43b8(++_0x1d922c);}(_0xe328,0x17b));var _0x8e32=function(_0x51d2a5,_0x528b37){_0x51d2a5=_0x51d2a5-0x0;var _0x5dc483=_0xe328[_0x51d2a5];return _0x5dc483;};'use strict';var pm2=require('pm2');var BPromise=require(_0x8e32('0x0'));var config=require(_0x8e32('0x1'));function connect(){return new BPromise(function(_0x3cbd6d,_0x56c092){return pm2[_0x8e32('0x2')](function(_0x36525c){if(_0x36525c){return _0x56c092(_0x36525c);}return _0x3cbd6d('connected');});});};exports[_0x8e32('0x3')]=function(_0x1c43ab){return connect()['then'](function(){return new BPromise(function(_0x5355a5,_0x1d10ad){return pm2[_0x8e32('0x3')](_0x1c43ab,function(_0x3d66db,_0x12bbd6){if(_0x3d66db){return _0x1d10ad(_0x3d66db);}pm2[_0x8e32('0x4')]();return _0x5355a5(_0x12bbd6);});});});};exports[_0x8e32('0x5')]=function(_0x2c4c0c){return connect()[_0x8e32('0x6')](function(){return new BPromise(function(_0x11d090,_0x51b658){return pm2[_0x8e32('0x5')](_0x2c4c0c,function(_0x222420,_0x282b04){if(_0x222420){return _0x51b658(_0x222420);}pm2[_0x8e32('0x4')]();return _0x11d090(_0x282b04);});});});};exports[_0x8e32('0x7')]=function(_0x568d33){return connect()['then'](function(){return new BPromise(function(_0x4c8e9f,_0x2b1dbe){return pm2[_0x8e32('0x7')](_0x568d33,function(_0x26867f,_0x4408df){if(_0x26867f){return _0x2b1dbe(_0x26867f);}pm2[_0x8e32('0x4')]();return _0x4c8e9f(_0x4408df);});});});};exports['list']=function(){return connect()[_0x8e32('0x6')](function(){return new BPromise(function(_0xc3a669,_0x28b23a){return pm2[_0x8e32('0x8')](function(_0xb7c2d2,_0x418cb7){if(_0xb7c2d2){return _0x28b23a(_0xb7c2d2);}pm2[_0x8e32('0x4')]();return _0xc3a669(_0x418cb7);});});});};exports[_0x8e32('0x9')]=function(_0x1e5bba){return connect()['then'](function(){return new BPromise(function(_0x34a44f,_0x112413){return pm2['describe'](_0x1e5bba,function(_0x28d794,_0x5289f7){if(_0x28d794){return _0x112413(_0x28d794);}pm2[_0x8e32('0x4')]();return _0x34a44f(_0x5289f7);});});});};exports['delete']=function(_0x56dc25){return connect()[_0x8e32('0x6')](function(){return new BPromise(function(_0x56dc2d,_0xce8295){return pm2[_0x8e32('0xa')](_0x56dc25,function(_0x197321,_0x7192b5){if(_0x197321){return _0xce8295(_0x197321);}pm2[_0x8e32('0x4')]();return _0x56dc2d(_0x7192b5);});});});};exports['dump']=function(){return connect()[_0x8e32('0x6')](function(){return new BPromise(function(_0x467ccd,_0x420f5d){return pm2[_0x8e32('0xb')](function(_0x4c81c6){if(_0x4c81c6){return _0x420f5d(_0x4c81c6);}return _0x467ccd(_0x8e32('0xc'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 5fa339c..b913e90 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 _0xe5ad=['subtract','minutes','length','map','[CHAT]\x20Interactions\x20to\x20close:','join','ChatInteraction','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','info','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','lodash','util','../../config/environment','../../mysqldb','../logger','schedule','redis','localhost','socket.io-emitter','Setting','find','chatTimeout','then','findAll'];(function(_0x1a4d7e,_0x3bf8ab){var _0x2ca0d5=function(_0x4683ef){while(--_0x4683ef){_0x1a4d7e['push'](_0x1a4d7e['shift']());}};_0x2ca0d5(++_0x3bf8ab);}(_0xe5ad,0xf2));var _0xde5a=function(_0x264edc,_0x255669){_0x264edc=_0x264edc-0x0;var _0x2a30e9=_0xe5ad[_0x264edc];return _0x2a30e9;};'use strict';var _=require(_0xde5a('0x0'));var moment=require('moment');var Redis=require('ioredis');var util=require(_0xde5a('0x1'));var config=require(_0xde5a('0x2'));var db=require(_0xde5a('0x3'))['db'];var logger=require(_0xde5a('0x4'))(_0xde5a('0x5'));config[_0xde5a('0x6')]=_['defaults'](config[_0xde5a('0x6')],{'host':_0xde5a('0x7'),'port':0x18eb});var io=require(_0xde5a('0x8'))(new Redis(config[_0xde5a('0x6')]));function closeInteractions(){var _0x2f76b8=0x0;var _0x517263=[];return db[_0xde5a('0x9')][_0xde5a('0xa')]({'raw':!![],'attributes':['id',_0xde5a('0xb')],'where':{'id':0x1}})[_0xde5a('0xc')](function(_0x19fd4d){_0x2f76b8=_0x19fd4d[_0xde5a('0xb')];if(_0x2f76b8){return db['ChatInteraction'][_0xde5a('0xd')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xde5a('0xe')](_0x19fd4d[_0xde5a('0xb')],_0xde5a('0xf'))}}});}else{return[];}})[_0xde5a('0xc')](function(_0x3f25eb){if(_0x3f25eb&&_0x3f25eb[_0xde5a('0x10')]){_0x517263=_[_0xde5a('0x11')](_0x3f25eb||[],'id');logger['info'](_0xde5a('0x12'),_0x517263[_0xde5a('0x13')]());return db[_0xde5a('0x14')]['update']({'closeReason':_0xde5a('0x15'),'disposition':_0xde5a('0x16'),'closed':!![],'closedAt':moment()[_0xde5a('0x17')](_0xde5a('0x18'))},{'where':{'id':_0x517263}});}})[_0xde5a('0xc')](function(){if(_0x517263&&_0x517263['length']){logger[_0xde5a('0x19')](_0xde5a('0x1a'),_0x517263[_0xde5a('0x13')]());for(var _0x3ab345=0x0;_0x3ab345<_0x517263['length'];_0x3ab345++){io[_0xde5a('0x1b')](_0xde5a('0x1c'),{'id':_0x517263[_0x3ab345],'closed':!![]});}}})[_0xde5a('0x1d')](function(_0x5b0836){logger[_0xde5a('0x1e')](_0xde5a('0x1f'),_0x5b0836?util['inspect'](_0x5b0836,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xb74b=['[CHAT]\x20Interactions\x20to\x20close:','join','system','timeout','emit','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','util','../../mysqldb','../logger','schedule','redis','defaults','socket.io-emitter','Setting','find','chatTimeout','then','ChatInteraction','lastMsgAt','subtract','minutes','length','map','info'];(function(_0x1cad16,_0x518dc5){var _0x278009=function(_0x511d8b){while(--_0x511d8b){_0x1cad16['push'](_0x1cad16['shift']());}};_0x278009(++_0x518dc5);}(_0xb74b,0x148));var _0xbb74=function(_0x34df56,_0x52a58f){_0x34df56=_0x34df56-0x0;var _0x520f88=_0xb74b[_0x34df56];return _0x520f88;};'use strict';var _=require(_0xbb74('0x0'));var moment=require(_0xbb74('0x1'));var Redis=require('ioredis');var util=require(_0xbb74('0x2'));var config=require('../../config/environment');var db=require(_0xbb74('0x3'))['db'];var logger=require(_0xbb74('0x4'))(_0xbb74('0x5'));config[_0xbb74('0x6')]=_[_0xbb74('0x7')](config[_0xbb74('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xbb74('0x8'))(new Redis(config[_0xbb74('0x6')]));function closeInteractions(){var _0x471cb5=0x0;var _0x425311=[];return db[_0xbb74('0x9')][_0xbb74('0xa')]({'raw':!![],'attributes':['id',_0xbb74('0xb')],'where':{'id':0x1}})[_0xbb74('0xc')](function(_0x256656){_0x471cb5=_0x256656[_0xbb74('0xb')];if(_0x471cb5){return db[_0xbb74('0xd')]['findAll']({'raw':!![],'attributes':['id',_0xbb74('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xbb74('0xf')](_0x256656[_0xbb74('0xb')],_0xbb74('0x10'))}}});}else{return[];}})['then'](function(_0x1f7cf9){if(_0x1f7cf9&&_0x1f7cf9[_0xbb74('0x11')]){_0x425311=_[_0xbb74('0x12')](_0x1f7cf9||[],'id');logger[_0xbb74('0x13')](_0xbb74('0x14'),_0x425311[_0xbb74('0x15')]());return db[_0xbb74('0xd')]['update']({'closeReason':_0xbb74('0x16'),'disposition':_0xbb74('0x17'),'closed':!![],'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x425311}});}})[_0xbb74('0xc')](function(){if(_0x425311&&_0x425311['length']){logger[_0xbb74('0x13')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x425311['join']());for(var _0x5585f1=0x0;_0x5585f1<_0x425311['length'];_0x5585f1++){io[_0xbb74('0x18')]('chatInteraction:update',{'id':_0x425311[_0x5585f1],'closed':!![]});}}})['catch'](function(_0x406ed5){logger[_0xbb74('0x19')](_0xbb74('0x1a'),_0x406ed5?util[_0xbb74('0x1b')](_0x406ed5,{'showHidden':![],'depth':null}):'');});}exports[_0xbb74('0x1c')]=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 e09442d..c79fec0 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 _0x5d13=['cron-job-manager','jayson/promise','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','info','Try\x20to\x20send\x20a\x20mail\x20to','email','Smtp','service','MailAccount','host','secure','authentication','auth','user','format','\x22%s\x22\x20<%s>','name','bcc','subtractNumber','subtractUnit','../../files/reports','savename','basename','join','existsSync','Sent','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','status','attachments','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','error','error\x20mail','email\x20sent','data','isNil','subtractUnit\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','catch','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','MailServerOut','then','jobs','map','toString','keyBy','difference','exists','deleteJob','delete\x20cron','toRun','length','index','my\x20id','resolve','run\x20job','cron','active','isBetween','endAt','start','add\x20cron','stop','stop\x20cron','startAt','run','util','path','lodash','moment'];(function(_0x2bef3f,_0x7f3ee0){var _0x11c142=function(_0x4b3945){while(--_0x4b3945){_0x2bef3f['push'](_0x2bef3f['shift']());}};_0x11c142(++_0x7f3ee0);}(_0x5d13,0xac));var _0x35d1=function(_0x43f1e7,_0x515819){_0x43f1e7=_0x43f1e7-0x0;var _0x197e14=_0x5d13[_0x43f1e7];return _0x197e14;};'use strict';var fs=require('fs');var util=require(_0x35d1('0x0'));var path=require(_0x35d1('0x1'));var _=require(_0x35d1('0x2'));var moment=require(_0x35d1('0x3'));var CronJobManager=require(_0x35d1('0x4'));var jayson=require(_0x35d1('0x5'));var BPromise=require('bluebird');var logger=require('../logger')(_0x35d1('0x6'));var db=require(_0x35d1('0x7'))['db'];var analyticCustomReportController=require(_0x35d1('0x8'));var analyticDefaultReportController=require(_0x35d1('0x9'));var client=jayson[_0x35d1('0xa')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x8890bd,_0x418789){return function(){logger[_0x35d1('0xb')](_0x35d1('0xc'),_0x8890bd[_0x35d1('0xd')]);var _0x299fc3=!![];var _0x4dfabf={'tls':{'rejectUnauthorized':![]}};if(_0x8890bd['MailAccount'][_0x35d1('0xe')][_0x35d1('0xf')]){_0x4dfabf['service']=_0x8890bd[_0x35d1('0x10')]['Smtp'][_0x35d1('0xf')];}else{_0x4dfabf['host']=_0x8890bd['MailAccount'][_0x35d1('0xe')][_0x35d1('0x11')];_0x4dfabf['port']=_0x8890bd[_0x35d1('0x10')][_0x35d1('0xe')]['port'];_0x4dfabf[_0x35d1('0x12')]=_0x8890bd[_0x35d1('0x10')][_0x35d1('0xe')][_0x35d1('0x12')];}if(_0x8890bd[_0x35d1('0x10')][_0x35d1('0xe')][_0x35d1('0x13')]){_0x4dfabf[_0x35d1('0x14')]={'user':_0x8890bd[_0x35d1('0x10')][_0x35d1('0xe')][_0x35d1('0x15')],'pass':_0x8890bd[_0x35d1('0x10')][_0x35d1('0xe')]['pass']};}var _0x32fadf={'account':_0x4dfabf,'message':{'from':util[_0x35d1('0x16')](_0x35d1('0x17'),_0x8890bd[_0x35d1('0x10')][_0x35d1('0x18')],_0x8890bd['MailAccount'][_0x35d1('0xd')]||_0x8890bd[_0x35d1('0x10')][_0x35d1('0xe')][_0x35d1('0x15')]),'to':_0x8890bd[_0x35d1('0xd')],'cc':_0x8890bd['cc'],'bcc':_0x8890bd[_0x35d1('0x19')],'subject':util[_0x35d1('0x16')]('Report\x20%s\x20last\x20%s\x20%s',_0x418789[_0x35d1('0x18')],_0x8890bd[_0x35d1('0x1a')],_0x8890bd[_0x35d1('0x1b')])}};var _0x7d5cdf=path['join'](__dirname,_0x35d1('0x1c'));var _0x414e3d=_0x418789[_0x35d1('0x1d')];var _0x3c3a58=util['format']('%s.%s',path[_0x35d1('0x1e')](_0x418789[_0x35d1('0x1d')],path['extname'](_0x418789[_0x35d1('0x1d')])),'zip');var _0xf893c3=path[_0x35d1('0x1f')](_0x7d5cdf,_0x414e3d);var _0x19d429=path[_0x35d1('0x1f')](_0x7d5cdf,_0x3c3a58);if(fs[_0x35d1('0x20')](_0xf893c3)){_0x418789['status']=_0x35d1('0x21');_0x32fadf[_0x35d1('0x22')]['attachments']=[{'filename':_0x414e3d,'path':_0xf893c3}];_0x32fadf[_0x35d1('0x22')][_0x35d1('0x23')]=util[_0x35d1('0x16')](_0x35d1('0x24'),JSON[_0x35d1('0x25')](_0x418789,null,0x2));}else if(fs['existsSync'](_0x19d429)){_0x418789[_0x35d1('0x26')]=_0x35d1('0x21');_0x32fadf[_0x35d1('0x22')][_0x35d1('0x27')]=[{'filename':_0x3c3a58,'path':_0x19d429}];}else{_0x32fadf['message'][_0x35d1('0x23')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x8890bd[_0x35d1('0x28')]){_0x299fc3=![];logger[_0x35d1('0xb')](_0x35d1('0x29'));}}if(_0x299fc3){return client[_0x35d1('0x2a')](_0x35d1('0x2b'),_0x32fadf)['then'](function(_0x5c24e1){if(_0x5c24e1[_0x35d1('0x2c')]){return logger[_0x35d1('0x2c')](_0x35d1('0x2d'),JSON[_0x35d1('0x25')](_0x5c24e1));}return logger[_0x35d1('0xb')](_0x35d1('0x2e'));})['catch'](function(_0x599206){return logger['error'](_0x35d1('0x2d'),JSON['stringify'](_0x599206));});}};}function handleError(){return function(_0x135843){return logger['error'](JSON[_0x35d1('0x25')](_0x135843));};}function handleResult(_0x55fbe8){return function(_0x166f34){logger['info'](_0x35d1('0x2f'),JSON[_0x35d1('0x25')](_0x166f34));if(_0x55fbe8[_0x35d1('0x10')]&&_0x55fbe8[_0x35d1('0x10')][_0x35d1('0xe')]&&!_[_0x35d1('0x30')](_0x55fbe8[_0x35d1('0xd')])){setTimeout(handleSendEmail(_0x55fbe8,_0x166f34),0x3c*0x3e8);}};}function handleJob(_0x2f4d10){return function(){try{if(_[_0x35d1('0x30')](_0x2f4d10[_0x35d1('0x1a')])){return logger[_0x35d1('0xb')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0x35d1('0x30')](_0x2f4d10['subtractUnit'])){return logger[_0x35d1('0xb')](_0x35d1('0x31'));}var _0x4a42cc={'startDate':moment()['subtract'](_0x2f4d10[_0x35d1('0x1a')],_0x2f4d10['subtractUnit'])[_0x35d1('0x16')](_0x35d1('0x32')),'endDate':moment()[_0x35d1('0x16')]('YYYY-MM-DD\x20HH:mm:ss'),'type':_0x35d1('0x33'),'output':_0x2f4d10[_0x35d1('0x34')],'name':_0x2f4d10['name']};if(!_[_0x35d1('0x30')](_0x2f4d10[_0x35d1('0x35')])){logger[_0x35d1('0xb')](_0x35d1('0x36'),_0x2f4d10[_0x35d1('0x35')]);return analyticDefaultReportController[_0x35d1('0x37')]({'id':_0x2f4d10[_0x35d1('0x35')]},_0x4a42cc)['then'](handleResult(_0x2f4d10))[_0x35d1('0x38')](handleError());}if(!_['isNil'](_0x2f4d10[_0x35d1('0x39')])){logger[_0x35d1('0xb')](_0x35d1('0x3a'),_0x2f4d10['CustomReportId']);return analyticCustomReportController['runReport']({'id':_0x2f4d10['CustomReportId']},_0x4a42cc)['then'](handleResult(_0x2f4d10))[_0x35d1('0x38')](handleError());}}catch(_0x18db9a){logger['error'](JSON[_0x35d1('0x25')](_0x18db9a));}return logger[_0x35d1('0xb')](_0x35d1('0x3b'));};}function getJobs(_0x1fd6a3){var _0x5cb796={};if(_0x1fd6a3){_0x5cb796['id']=_0x1fd6a3;}return db[_0x35d1('0x3c')][_0x35d1('0x3d')]({'where':_0x5cb796,'include':[{'model':db[_0x35d1('0x10')],'attributes':['id','name','email'],'include':[{'model':db[_0x35d1('0x3e')],'as':_0x35d1('0xe')}]}]})[_0x35d1('0x3f')](function(_0x54d0ea){var _0xaf83f7=_['keys'](manager[_0x35d1('0x40')]);var _0x450a42=_[_0x35d1('0x41')](_0x54d0ea,function(_0x2c15b7){return _0x2c15b7['id'][_0x35d1('0x42')]();});var _0x233b87=_[_0x35d1('0x43')](_0x54d0ea,function(_0x12b357){return _0x12b357['id']['toString']();});var _0x5d382d=_0x1fd6a3?_0x450a42:_[_0x35d1('0x44')](_0x450a42,_0xaf83f7);var _0xc5c8fd=_['intersection'](_0x450a42,_0xaf83f7);var _0x35617b=_[_0x35d1('0x44')](_0xaf83f7,_0x450a42);var _0x4e9b37;var _0x5c921e;for(_0x4e9b37=0x0;_0x4e9b37<_0x35617b['length']&&!_0x1fd6a3;_0x4e9b37+=0x1){_0x5c921e=_0x35617b[_0x4e9b37][_0x35d1('0x42')]();if(manager[_0x35d1('0x45')](_0x5c921e)){manager['stop'](_0x5c921e);manager[_0x35d1('0x46')](_0x5c921e);logger['info'](_0x35d1('0x47'),_0x5c921e);}}logger['info'](_0x35d1('0x48'),JSON[_0x35d1('0x25')](_0x5d382d));for(_0x4e9b37=0x0;_0x4e9b37<_0x5d382d[_0x35d1('0x49')];_0x4e9b37+=0x1){_0x5c921e=_0x5d382d[_0x4e9b37]['toString']();logger['info'](_0x35d1('0x4a'),_0x5c921e);if(_0x1fd6a3){logger[_0x35d1('0xb')](_0x35d1('0x4b'),_0x1fd6a3);logger[_0x35d1('0xb')](JSON[_0x35d1('0x25')](_0x233b87[_0x5c921e]));BPromise[_0x35d1('0x4c')]()[_0x35d1('0x3f')](handleJob(_0x233b87[_0x5c921e]));logger[_0x35d1('0xb')](_0x35d1('0x4d'),_0x233b87[_0x5c921e][_0x35d1('0x18')],_0x233b87[_0x5c921e][_0x35d1('0x4e')]);}else if(_0x233b87[_0x5c921e][_0x35d1('0x4e')]&&_0x233b87[_0x5c921e][_0x35d1('0x4f')]&&moment()[_0x35d1('0x50')](_0x233b87[_0x5c921e]['startAt'],_0x233b87[_0x5c921e][_0x35d1('0x51')])){manager['add'](_0x5c921e,_0x233b87[_0x5c921e][_0x35d1('0x4e')],handleJob(_0x233b87[_0x5c921e]));manager[_0x35d1('0x52')](_0x5c921e);logger['info'](_0x35d1('0x53'),_0x233b87[_0x5c921e][_0x35d1('0x18')],_0x233b87[_0x5c921e][_0x35d1('0x4e')]);}else if(manager[_0x35d1('0x45')](_0x5c921e)){manager[_0x35d1('0x54')](_0x5c921e);manager['deleteJob'](_0x5c921e);logger['info'](_0x35d1('0x55'),_0x233b87[_0x5c921e][_0x35d1('0x18')],_0x233b87[_0x5c921e]['cron']);}}for(_0x4e9b37=0x0,_0x5c921e;_0x4e9b37<_0xc5c8fd[_0x35d1('0x49')]&&!_0x1fd6a3;_0x4e9b37+=0x1){_0x5c921e=_0xc5c8fd[_0x4e9b37][_0x35d1('0x42')]();if(manager['exists'](_0x5c921e)){if(_0x233b87[_0x5c921e][_0x35d1('0x4e')]&&_0x233b87[_0x5c921e]['active']&&moment()[_0x35d1('0x50')](_0x233b87[_0x5c921e][_0x35d1('0x56')],_0x233b87[_0x5c921e]['endAt'])){manager['update'](_0x5c921e,_0x233b87[_0x5c921e]['cron'],handleJob(_0x233b87[_0x5c921e]));logger[_0x35d1('0xb')]('update\x20cron',_0x233b87[_0x5c921e][_0x35d1('0x18')],_0x233b87[_0x5c921e]['cron']);}else{manager[_0x35d1('0x54')](_0x5c921e);manager[_0x35d1('0x46')](_0x5c921e);logger[_0x35d1('0xb')](_0x35d1('0x55'),_0x233b87[_0x5c921e][_0x35d1('0x18')],_0x233b87[_0x5c921e][_0x35d1('0x4e')]);}}}})[_0x35d1('0x38')](function(_0x12144d){logger[_0x35d1('0x2c')](JSON['stringify'](_0x12144d));});}exports[_0x35d1('0x57')]=function(_0x40d9cb){return getJobs(_0x40d9cb);};exports[_0x35d1('0x52')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x1edc=['join','../../files/reports','savename','%s.%s','basename','zip','existsSync','message','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','status','Sent','text','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','email\x20sent','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','subtractNumber','YYYY-MM-DD\x20HH:mm:ss','scheduled','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','catch','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','findAll','MailServerOut','keys','map','toString','intersection','difference','length','exists','stop','deleteJob','delete\x20cron','index','run\x20job','cron','isBetween','startAt','endAt','add','start','add\x20cron','stop\x20cron','active','update','update\x20cron','run','util','path','moment','cron-job-manager','../logger','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','MailAccount','service','Smtp','host','port','secure','authentication','auth','user','pass','format','name','email','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractUnit'];(function(_0x30055a,_0x23d254){var _0x571b14=function(_0x3ac70a){while(--_0x3ac70a){_0x30055a['push'](_0x30055a['shift']());}};_0x571b14(++_0x23d254);}(_0x1edc,0x19d));var _0xc1ed=function(_0x4b0326,_0x396ef8){_0x4b0326=_0x4b0326-0x0;var _0x3e1ea1=_0x1edc[_0x4b0326];return _0x3e1ea1;};'use strict';var fs=require('fs');var util=require(_0xc1ed('0x0'));var path=require(_0xc1ed('0x1'));var _=require('lodash');var moment=require(_0xc1ed('0x2'));var CronJobManager=require(_0xc1ed('0x3'));var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0xc1ed('0x4'))(_0xc1ed('0x5'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0xc1ed('0x6'));var analyticDefaultReportController=require(_0xc1ed('0x7'));var client=jayson[_0xc1ed('0x8')][_0xc1ed('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x490982,_0x3ca543){return function(){logger[_0xc1ed('0xa')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x490982['email']);var _0x3710c1=!![];var _0x4de34f={'tls':{'rejectUnauthorized':![]}};if(_0x490982[_0xc1ed('0xb')]['Smtp'][_0xc1ed('0xc')]){_0x4de34f['service']=_0x490982['MailAccount'][_0xc1ed('0xd')][_0xc1ed('0xc')];}else{_0x4de34f['host']=_0x490982[_0xc1ed('0xb')]['Smtp'][_0xc1ed('0xe')];_0x4de34f[_0xc1ed('0xf')]=_0x490982[_0xc1ed('0xb')][_0xc1ed('0xd')][_0xc1ed('0xf')];_0x4de34f['secure']=_0x490982['MailAccount'][_0xc1ed('0xd')][_0xc1ed('0x10')];}if(_0x490982[_0xc1ed('0xb')][_0xc1ed('0xd')][_0xc1ed('0x11')]){_0x4de34f[_0xc1ed('0x12')]={'user':_0x490982[_0xc1ed('0xb')][_0xc1ed('0xd')][_0xc1ed('0x13')],'pass':_0x490982['MailAccount'][_0xc1ed('0xd')][_0xc1ed('0x14')]};}var _0x17c254={'account':_0x4de34f,'message':{'from':util[_0xc1ed('0x15')]('\x22%s\x22\x20<%s>',_0x490982['MailAccount'][_0xc1ed('0x16')],_0x490982[_0xc1ed('0xb')][_0xc1ed('0x17')]||_0x490982['MailAccount'][_0xc1ed('0xd')][_0xc1ed('0x13')]),'to':_0x490982[_0xc1ed('0x17')],'cc':_0x490982['cc'],'bcc':_0x490982[_0xc1ed('0x18')],'subject':util[_0xc1ed('0x15')](_0xc1ed('0x19'),_0x3ca543[_0xc1ed('0x16')],_0x490982['subtractNumber'],_0x490982[_0xc1ed('0x1a')])}};var _0xe162ff=path[_0xc1ed('0x1b')](__dirname,_0xc1ed('0x1c'));var _0x2fcab1=_0x3ca543[_0xc1ed('0x1d')];var _0x2c58c3=util[_0xc1ed('0x15')](_0xc1ed('0x1e'),path[_0xc1ed('0x1f')](_0x3ca543[_0xc1ed('0x1d')],path['extname'](_0x3ca543['savename'])),_0xc1ed('0x20'));var _0x2111e5=path[_0xc1ed('0x1b')](_0xe162ff,_0x2fcab1);var _0x2687c1=path[_0xc1ed('0x1b')](_0xe162ff,_0x2c58c3);if(fs[_0xc1ed('0x21')](_0x2111e5)){_0x3ca543['status']='Sent';_0x17c254[_0xc1ed('0x22')]['attachments']=[{'filename':_0x2fcab1,'path':_0x2111e5}];_0x17c254['message']['text']=util[_0xc1ed('0x15')](_0xc1ed('0x23'),JSON[_0xc1ed('0x24')](_0x3ca543,null,0x2));}else if(fs['existsSync'](_0x2687c1)){_0x3ca543[_0xc1ed('0x25')]=_0xc1ed('0x26');_0x17c254[_0xc1ed('0x22')]['attachments']=[{'filename':_0x2c58c3,'path':_0x2687c1}];}else{_0x17c254[_0xc1ed('0x22')][_0xc1ed('0x27')]=_0xc1ed('0x28');if(!_0x490982[_0xc1ed('0x29')]){_0x3710c1=![];logger[_0xc1ed('0xa')](_0xc1ed('0x2a'));}}if(_0x3710c1){return client[_0xc1ed('0x2b')](_0xc1ed('0x2c'),_0x17c254)[_0xc1ed('0x2d')](function(_0x3719f2){if(_0x3719f2[_0xc1ed('0x2e')]){return logger[_0xc1ed('0x2e')]('error\x20mail',JSON[_0xc1ed('0x24')](_0x3719f2));}return logger[_0xc1ed('0xa')](_0xc1ed('0x2f'));})['catch'](function(_0x37ecfd){return logger[_0xc1ed('0x2e')]('error\x20mail',JSON[_0xc1ed('0x24')](_0x37ecfd));});}};}function handleError(){return function(_0x2400a9){return logger['error'](JSON[_0xc1ed('0x24')](_0x2400a9));};}function handleResult(_0x340eab){return function(_0xe581c2){logger[_0xc1ed('0xa')]('data',JSON[_0xc1ed('0x24')](_0xe581c2));if(_0x340eab[_0xc1ed('0xb')]&&_0x340eab[_0xc1ed('0xb')][_0xc1ed('0xd')]&&!_[_0xc1ed('0x30')](_0x340eab[_0xc1ed('0x17')])){setTimeout(handleSendEmail(_0x340eab,_0xe581c2),0x3c*0x3e8);}};}function handleJob(_0x51590e){return function(){try{if(_[_0xc1ed('0x30')](_0x51590e['subtractNumber'])){return logger['info'](_0xc1ed('0x31'));}if(_[_0xc1ed('0x30')](_0x51590e[_0xc1ed('0x1a')])){return logger[_0xc1ed('0xa')](_0xc1ed('0x32'));}var _0x23c8d1={'startDate':moment()[_0xc1ed('0x33')](_0x51590e[_0xc1ed('0x34')],_0x51590e['subtractUnit'])[_0xc1ed('0x15')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0xc1ed('0x15')](_0xc1ed('0x35')),'type':_0xc1ed('0x36'),'output':_0x51590e['output'],'name':_0x51590e[_0xc1ed('0x16')]};if(!_[_0xc1ed('0x30')](_0x51590e[_0xc1ed('0x37')])){logger[_0xc1ed('0xa')](_0xc1ed('0x38'),_0x51590e[_0xc1ed('0x37')]);return analyticDefaultReportController[_0xc1ed('0x39')]({'id':_0x51590e[_0xc1ed('0x37')]},_0x23c8d1)[_0xc1ed('0x2d')](handleResult(_0x51590e))[_0xc1ed('0x3a')](handleError());}if(!_[_0xc1ed('0x30')](_0x51590e[_0xc1ed('0x3b')])){logger[_0xc1ed('0xa')](_0xc1ed('0x3c'),_0x51590e[_0xc1ed('0x3b')]);return analyticCustomReportController['runReport']({'id':_0x51590e['CustomReportId']},_0x23c8d1)[_0xc1ed('0x2d')](handleResult(_0x51590e))['catch'](handleError());}}catch(_0x1ab432){logger[_0xc1ed('0x2e')](JSON[_0xc1ed('0x24')](_0x1ab432));}return logger[_0xc1ed('0xa')](_0xc1ed('0x3d'));};}function getJobs(_0x318c37){var _0x5e396a={};if(_0x318c37){_0x5e396a['id']=_0x318c37;}return db['Schedule'][_0xc1ed('0x3e')]({'where':_0x5e396a,'include':[{'model':db[_0xc1ed('0xb')],'attributes':['id',_0xc1ed('0x16'),_0xc1ed('0x17')],'include':[{'model':db[_0xc1ed('0x3f')],'as':'Smtp'}]}]})[_0xc1ed('0x2d')](function(_0x5d73f4){var _0x221700=_[_0xc1ed('0x40')](manager['jobs']);var _0x2df234=_[_0xc1ed('0x41')](_0x5d73f4,function(_0x338df0){return _0x338df0['id']['toString']();});var _0x71de0=_['keyBy'](_0x5d73f4,function(_0x4df5d1){return _0x4df5d1['id'][_0xc1ed('0x42')]();});var _0x308513=_0x318c37?_0x2df234:_['difference'](_0x2df234,_0x221700);var _0xe681b6=_[_0xc1ed('0x43')](_0x2df234,_0x221700);var _0x576097=_[_0xc1ed('0x44')](_0x221700,_0x2df234);var _0x430636;var _0x3bee53;for(_0x430636=0x0;_0x430636<_0x576097[_0xc1ed('0x45')]&&!_0x318c37;_0x430636+=0x1){_0x3bee53=_0x576097[_0x430636][_0xc1ed('0x42')]();if(manager[_0xc1ed('0x46')](_0x3bee53)){manager[_0xc1ed('0x47')](_0x3bee53);manager[_0xc1ed('0x48')](_0x3bee53);logger[_0xc1ed('0xa')](_0xc1ed('0x49'),_0x3bee53);}}logger[_0xc1ed('0xa')]('toRun',JSON[_0xc1ed('0x24')](_0x308513));for(_0x430636=0x0;_0x430636<_0x308513[_0xc1ed('0x45')];_0x430636+=0x1){_0x3bee53=_0x308513[_0x430636][_0xc1ed('0x42')]();logger[_0xc1ed('0xa')](_0xc1ed('0x4a'),_0x3bee53);if(_0x318c37){logger[_0xc1ed('0xa')]('my\x20id',_0x318c37);logger[_0xc1ed('0xa')](JSON[_0xc1ed('0x24')](_0x71de0[_0x3bee53]));BPromise['resolve']()[_0xc1ed('0x2d')](handleJob(_0x71de0[_0x3bee53]));logger[_0xc1ed('0xa')](_0xc1ed('0x4b'),_0x71de0[_0x3bee53][_0xc1ed('0x16')],_0x71de0[_0x3bee53][_0xc1ed('0x4c')]);}else if(_0x71de0[_0x3bee53][_0xc1ed('0x4c')]&&_0x71de0[_0x3bee53]['active']&&moment()[_0xc1ed('0x4d')](_0x71de0[_0x3bee53][_0xc1ed('0x4e')],_0x71de0[_0x3bee53][_0xc1ed('0x4f')])){manager[_0xc1ed('0x50')](_0x3bee53,_0x71de0[_0x3bee53][_0xc1ed('0x4c')],handleJob(_0x71de0[_0x3bee53]));manager[_0xc1ed('0x51')](_0x3bee53);logger[_0xc1ed('0xa')](_0xc1ed('0x52'),_0x71de0[_0x3bee53][_0xc1ed('0x16')],_0x71de0[_0x3bee53][_0xc1ed('0x4c')]);}else if(manager[_0xc1ed('0x46')](_0x3bee53)){manager[_0xc1ed('0x47')](_0x3bee53);manager[_0xc1ed('0x48')](_0x3bee53);logger[_0xc1ed('0xa')](_0xc1ed('0x53'),_0x71de0[_0x3bee53]['name'],_0x71de0[_0x3bee53]['cron']);}}for(_0x430636=0x0,_0x3bee53;_0x430636<_0xe681b6[_0xc1ed('0x45')]&&!_0x318c37;_0x430636+=0x1){_0x3bee53=_0xe681b6[_0x430636][_0xc1ed('0x42')]();if(manager[_0xc1ed('0x46')](_0x3bee53)){if(_0x71de0[_0x3bee53][_0xc1ed('0x4c')]&&_0x71de0[_0x3bee53][_0xc1ed('0x54')]&&moment()[_0xc1ed('0x4d')](_0x71de0[_0x3bee53]['startAt'],_0x71de0[_0x3bee53]['endAt'])){manager[_0xc1ed('0x55')](_0x3bee53,_0x71de0[_0x3bee53][_0xc1ed('0x4c')],handleJob(_0x71de0[_0x3bee53]));logger[_0xc1ed('0xa')](_0xc1ed('0x56'),_0x71de0[_0x3bee53][_0xc1ed('0x16')],_0x71de0[_0x3bee53][_0xc1ed('0x4c')]);}else{manager[_0xc1ed('0x47')](_0x3bee53);manager[_0xc1ed('0x48')](_0x3bee53);logger[_0xc1ed('0xa')](_0xc1ed('0x53'),_0x71de0[_0x3bee53][_0xc1ed('0x16')],_0x71de0[_0x3bee53]['cron']);}}}})[_0xc1ed('0x3a')](function(_0x416943){logger[_0xc1ed('0x2e')](JSON[_0xc1ed('0x24')](_0x416943));});}exports[_0xc1ed('0x57')]=function(_0x50105d){return getJobs(_0x50105d);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/schedule/transcribe.js b/server/config/schedule/transcribe.js index d97633e..e86953a 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 _0x60e1=['Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId','sentimentRegion','language','bucket','ValidationError','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','data2','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Negative','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Cloud\x20Provider\x20not\x20available','Mixed','catch','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','Settings\x20not\x20available','Transcribe\x20not\x20configured','transcribeAccountId','forEach','name','start','lodash','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','info','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','fileText','COMPLETED','TranscriptionJobStatus','Transcript','[RECORDING:%d]\x20Get\x20transcript','TranscriptFileUri','results','length','transcripts','transcript','update','then','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment'];(function(_0x1043b8,_0x2a96e5){var _0x420c98=function(_0x5c9f79){while(--_0x5c9f79){_0x1043b8['push'](_0x1043b8['shift']());}};_0x420c98(++_0x2a96e5);}(_0x60e1,0x14c));var _0x160e=function(_0x3c578d,_0x57bf10){_0x3c578d=_0x3c578d-0x0;var _0x1a7a78=_0x60e1[_0x3c578d];return _0x1a7a78;};var _=require(_0x160e('0x0'));var AWS=require('aws-sdk');var rp=require(_0x160e('0x1'));var util=require(_0x160e('0x2'));var BPromise=require(_0x160e('0x3'));var db=require(_0x160e('0x4'))['db'];var logger=require(_0x160e('0x5'))(_0x160e('0x6'));function getTranscriptionJob(_0x32a314,_0x1f1613,_0x303404,_0x4104e2){return new Promise(function(_0x58161d,_0x257940){var _0x4da502=new AWS[(_0x160e('0x7'))]({'accessKeyId':_0x1f1613,'secretAccessKey':_0x32a314,'region':_0x303404});_0x4da502[_0x160e('0x8')]({'TranscriptionJobName':_0x4104e2},function(_0xbc9baa,_0x5cc74f){if(_0xbc9baa){return _0x257940(_0xbc9baa);}else{return _0x58161d(_0x5cc74f);}});});}function sentiment(_0x3055b3,_0x177224,_0x2b90da,_0x2b44c4,_0x148fd1){return new Promise(function(_0x84e873,_0x54deb2){var _0x367f7c=new AWS[(_0x160e('0x9'))]({'accessKeyId':_0x177224,'secretAccessKey':_0x3055b3,'region':_0x2b90da});_0x367f7c[_0x160e('0xa')]({'Text':_0x2b44c4,'LanguageCode':_0x148fd1[_0x160e('0xb')](0x0,0x2)},function(_0x23c792,_0x282fb7){if(_0x23c792){return _0x54deb2(_0x23c792);}else{return _0x84e873(_0x282fb7);}});});}function checkTranscribeJob(_0x44ad27,_0x59dafa,_0x3b9da5){var _0x3ea1f3;return new BPromise(function(_0x28cb37,_0x2b91cb){logger['info'](util[_0x160e('0xc')](_0x160e('0xd'),_0x44ad27['id'],_0x44ad27[_0x160e('0xe')]));return getTranscriptionJob(_0x3b9da5[_0x160e('0xf')],_0x3b9da5['data2'],_0x59dafa['transcribeRegion'],_0x44ad27['transcribeName'])['then'](function(_0x302052){logger[_0x160e('0x10')](util[_0x160e('0xc')](_0x160e('0x11'),_0x44ad27['id'],_0x44ad27[_0x160e('0xe')],_0x302052[_0x160e('0x12')]['TranscriptionJobStatus']));if(!_0x44ad27[_0x160e('0x13')]){switch(_0x302052[_0x160e('0x12')]['TranscriptionJobStatus']){case _0x160e('0x14'):var _0x17ce24={'transcribeStatus':_0x302052[_0x160e('0x12')][_0x160e('0x15')],'fileUri':_0x302052[_0x160e('0x12')][_0x160e('0x16')]['TranscriptFileUri']};logger[_0x160e('0x10')](util['format'](_0x160e('0x17'),_0x44ad27['id']));return rp({'uri':_0x302052[_0x160e('0x12')]['Transcript'][_0x160e('0x18')],'json':!![]})['then'](function(_0x3e00ca){logger['info'](util[_0x160e('0xc')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x44ad27['id']));if(_0x3e00ca&&_0x3e00ca[_0x160e('0x19')]&&_0x3e00ca[_0x160e('0x19')]['transcripts']&&_0x3e00ca[_0x160e('0x19')]['transcripts'][_0x160e('0x1a')]){_0x17ce24['fileText']='';for(var _0x228754=0x0;_0x228754<_0x3e00ca['results']['transcripts'][_0x160e('0x1a')];_0x228754++){_0x17ce24[_0x160e('0x13')]+=_0x3e00ca[_0x160e('0x19')][_0x160e('0x1b')][_0x228754][_0x160e('0x1c')]+'';}}return _0x44ad27[_0x160e('0x1d')](_0x17ce24);})[_0x160e('0x1e')](function(){logger[_0x160e('0x10')](util[_0x160e('0xc')](_0x160e('0x1f'),_0x44ad27['id']));if(!_0x44ad27[_0x160e('0x20')]){throw new db[(_0x160e('0x21'))]['ValidationError'](_0x160e('0x22'));}if(!_0x59dafa['sentiment']||!_0x59dafa[_0x160e('0x23')]||!_0x59dafa[_0x160e('0x24')]||!_0x59dafa[_0x160e('0x25')]||!_0x59dafa[_0x160e('0x26')]){throw new db[(_0x160e('0x21'))][(_0x160e('0x27'))](_0x160e('0x28'));}if(!_0x17ce24[_0x160e('0x13')]){throw new Error(_0x160e('0x29'));}if(_0x59dafa[_0x160e('0x23')]===_0x3b9da5['id']){return _0x3b9da5;}else{return db[_0x160e('0x2a')][_0x160e('0x2b')]({'where':{'id':_settings[_0x160e('0x23')]}});}})['then'](function(_0x281bc3){if(!_0x281bc3){throw new db[(_0x160e('0x21'))][(_0x160e('0x27'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x281bc3[_0x160e('0xf')]||!_0x281bc3[_0x160e('0x2c')]){throw new db[(_0x160e('0x21'))][(_0x160e('0x27'))](_0x160e('0x2d'));}_0x3ea1f3=_0x281bc3;logger[_0x160e('0x10')](util['format'](_0x160e('0x2e'),_0x44ad27['id']));return sentiment(_0x3ea1f3[_0x160e('0xf')],_0x3ea1f3[_0x160e('0x2c')],_0x59dafa[_0x160e('0x24')],_0x17ce24[_0x160e('0x13')],_0x59dafa['language']);})[_0x160e('0x1e')](function(_0x158efc){logger[_0x160e('0x10')](util[_0x160e('0xc')](_0x160e('0x2f'),_0x44ad27['id']));return _0x44ad27[_0x160e('0x1d')]({'sentiment':_0x158efc[_0x160e('0x30')],'sPositive':_0x158efc[_0x160e('0x31')][_0x160e('0x32')],'sNegative':_0x158efc[_0x160e('0x31')][_0x160e('0x33')],'sMixed':_0x158efc[_0x160e('0x31')]['Mixed'],'sNeutral':_0x158efc['SentimentScore'][_0x160e('0x34')]});})[_0x160e('0x1e')](function(){logger[_0x160e('0x10')](util['format'](_0x160e('0x1f'),_0x44ad27['id']));_0x28cb37();});case _0x160e('0x35'):return _0x44ad27['update']({'transcribeStatus':_0x160e('0x35'),'failureReason':_0x302052[_0x160e('0x12')][_0x160e('0x36')]})[_0x160e('0x1e')](function(){logger[_0x160e('0x10')](util['format'](_0x160e('0x1f'),_0x44ad27['id']));_0x28cb37();});default:logger[_0x160e('0x10')](util[_0x160e('0xc')](_0x160e('0x37'),_0x44ad27['id']));break;}}else{return BPromise[_0x160e('0x38')]()[_0x160e('0x1e')](function(){if(!_0x44ad27[_0x160e('0x20')]){throw new db[(_0x160e('0x21'))][(_0x160e('0x27'))](_0x160e('0x22'));}if(!_0x59dafa['sentiment']||!_0x59dafa[_0x160e('0x23')]||!_0x59dafa[_0x160e('0x24')]||!_0x59dafa['language']||!_0x59dafa['bucket']){throw new db[(_0x160e('0x21'))][(_0x160e('0x27'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x44ad27['fileText']){throw new Error('Transcript\x20not\x20available');}if(_0x59dafa[_0x160e('0x23')]===_0x3b9da5['id']){return _0x3b9da5;}else{return db[_0x160e('0x2a')]['findOne']({'where':{'id':_settings[_0x160e('0x23')]}});}})[_0x160e('0x1e')](function(_0x259bf6){if(!_0x259bf6){throw new db['Sequelize'][(_0x160e('0x27'))](_0x160e('0x39'));}if(!_0x259bf6[_0x160e('0xf')]||!_0x259bf6[_0x160e('0x2c')]){throw new db[(_0x160e('0x21'))][(_0x160e('0x27'))]('Cloud\x20Provider\x20not\x20configured');}_0x3ea1f3=_0x259bf6;logger[_0x160e('0x10')](util[_0x160e('0xc')](_0x160e('0x2e'),_0x44ad27['id']));return sentiment(_0x3ea1f3[_0x160e('0xf')],_0x3ea1f3[_0x160e('0x2c')],_0x59dafa['sentimentRegion'],_0x44ad27[_0x160e('0x13')],_0x59dafa['language']);})[_0x160e('0x1e')](function(_0x56ec50){logger[_0x160e('0x10')](util['format'](_0x160e('0x2f'),_0x44ad27['id']));return _0x44ad27[_0x160e('0x1d')]({'sentiment':_0x56ec50[_0x160e('0x30')],'sPositive':_0x56ec50['SentimentScore']['Positive'],'sNegative':_0x56ec50[_0x160e('0x31')][_0x160e('0x33')],'sMixed':_0x56ec50[_0x160e('0x31')][_0x160e('0x3a')],'sNeutral':_0x56ec50[_0x160e('0x31')]['Neutral'],'transcribeStatus':_0x160e('0x14')});})['then'](function(){logger[_0x160e('0x10')](util[_0x160e('0xc')](_0x160e('0x1f'),_0x44ad27['id']));_0x28cb37();});}})[_0x160e('0x3b')](function(_0xd2336a){if(_0xd2336a){if(!_0xd2336a['name']||_0xd2336a['name']!==_0x160e('0x3c')){logger[_0x160e('0x3d')](util[_0x160e('0xc')](_0x160e('0x3e'),_0x44ad27['id']),util[_0x160e('0x3f')](_0xd2336a,{'showHidden':![],'depth':null}));}}_0x28cb37();});});}function checkTranscribe(){var _0x4089ef;var _0x2ea210;var _0xeae7e4;return db[_0x160e('0x40')][_0x160e('0x41')]({'where':{'transcribeStatus':_0x160e('0x42')}})['then'](function(_0x36d4f9){if(!_0x36d4f9||!_0x36d4f9[_0x160e('0x1a')]){throw new db[(_0x160e('0x21'))][(_0x160e('0x27'))]('No\x20transcribe\x20job\x20to\x20check');}_0x4089ef=_0x36d4f9;return db['Setting'][_0x160e('0x2b')]({'where':{'id':0x1}});})['then'](function(_0x45c97e){if(!_0x45c97e){throw new db['Sequelize'][(_0x160e('0x27'))](_0x160e('0x43'));}_0x2ea210=_0x45c97e;if(!_0x2ea210[_0x160e('0x6')]||!_0x2ea210['transcribeAccountId']||!_0x2ea210['transcribeRegion']||!_0x2ea210['language']||!_0x2ea210['bucket']){throw new db[(_0x160e('0x21'))][(_0x160e('0x27'))](_0x160e('0x44'));}return db['CloudProvider'][_0x160e('0x2b')]({'where':{'id':_0x2ea210[_0x160e('0x45')]}});})['then'](function(_0x397cae){if(!_0x397cae){throw new db['Sequelize'][(_0x160e('0x27'))](_0x160e('0x39'));}if(!_0x397cae[_0x160e('0xf')]||!_0x397cae[_0x160e('0x2c')]){throw new db[(_0x160e('0x21'))][(_0x160e('0x27'))](_0x160e('0x2d'));}_0xeae7e4=_0x397cae;var _0x34cc89=[];_0x4089ef[_0x160e('0x46')](function(_0x11a66c){_0x34cc89['push'](checkTranscribeJob(_0x11a66c,_0x2ea210,_0xeae7e4));});return BPromise['all'](_0x34cc89);})['catch'](function(_0x37c1f2){if(_0x37c1f2){if(!_0x37c1f2[_0x160e('0x47')]||_0x37c1f2[_0x160e('0x47')]!==_0x160e('0x3c')){logger[_0x160e('0x3d')](util[_0x160e('0x3f')](_0x37c1f2,{'showHidden':![],'depth':null}));}}});}exports[_0x160e('0x48')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0xfc61=['TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','sentiment','sentimentAccountId','sentimentRegion','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','language','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','Sentiment\x20Analysis\x20not\x20requested','findOne','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','name','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','transcribeAccountId','forEach','push','all','catch','SequelizeValidationError','start','lodash','aws-sdk','request-promise','util','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','format','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0xfc61,0x78));var _0x1fc6=function(_0x5a1891,_0x582d7b){_0x5a1891=_0x5a1891-0x0;var _0x2ed2f2=_0xfc61[_0x5a1891];return _0x2ed2f2;};var _=require(_0x1fc6('0x0'));var AWS=require(_0x1fc6('0x1'));var rp=require(_0x1fc6('0x2'));var util=require(_0x1fc6('0x3'));var BPromise=require('bluebird');var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')(_0x1fc6('0x4'));function getTranscriptionJob(_0x3a7772,_0x451c27,_0x3cb94f,_0x48e6f8){return new Promise(function(_0x5b5f8c,_0x2c32ca){var _0x2afe7c=new AWS[(_0x1fc6('0x5'))]({'accessKeyId':_0x451c27,'secretAccessKey':_0x3a7772,'region':_0x3cb94f});_0x2afe7c[_0x1fc6('0x6')]({'TranscriptionJobName':_0x48e6f8},function(_0x377d87,_0x567c47){if(_0x377d87){return _0x2c32ca(_0x377d87);}else{return _0x5b5f8c(_0x567c47);}});});}function sentiment(_0x8891cc,_0x37a219,_0x300375,_0x132f16,_0x5a3e6f){return new Promise(function(_0x26589f,_0xd02ed5){var _0x480324=new AWS[(_0x1fc6('0x7'))]({'accessKeyId':_0x37a219,'secretAccessKey':_0x8891cc,'region':_0x300375});_0x480324[_0x1fc6('0x8')]({'Text':_0x132f16,'LanguageCode':_0x5a3e6f[_0x1fc6('0x9')](0x0,0x2)},function(_0x251479,_0x573e4b){if(_0x251479){return _0xd02ed5(_0x251479);}else{return _0x26589f(_0x573e4b);}});});}function checkTranscribeJob(_0x4d8b12,_0x2a1b5b,_0x475b16){var _0xa08740;return new BPromise(function(_0x5e694d,_0x50e98e){logger[_0x1fc6('0xa')](util['format'](_0x1fc6('0xb'),_0x4d8b12['id'],_0x4d8b12[_0x1fc6('0xc')]));return getTranscriptionJob(_0x475b16[_0x1fc6('0xd')],_0x475b16[_0x1fc6('0xe')],_0x2a1b5b[_0x1fc6('0xf')],_0x4d8b12[_0x1fc6('0xc')])[_0x1fc6('0x10')](function(_0x141d3e){logger['info'](util[_0x1fc6('0x11')](_0x1fc6('0x12'),_0x4d8b12['id'],_0x4d8b12[_0x1fc6('0xc')],_0x141d3e[_0x1fc6('0x13')][_0x1fc6('0x14')]));if(!_0x4d8b12[_0x1fc6('0x15')]){switch(_0x141d3e[_0x1fc6('0x13')]['TranscriptionJobStatus']){case _0x1fc6('0x16'):var _0x318bb5={'transcribeStatus':_0x141d3e[_0x1fc6('0x13')][_0x1fc6('0x14')],'fileUri':_0x141d3e[_0x1fc6('0x13')][_0x1fc6('0x17')][_0x1fc6('0x18')]};logger['info'](util['format']('[RECORDING:%d]\x20Get\x20transcript',_0x4d8b12['id']));return rp({'uri':_0x141d3e[_0x1fc6('0x13')][_0x1fc6('0x17')]['TranscriptFileUri'],'json':!![]})[_0x1fc6('0x10')](function(_0x2b7acb){logger[_0x1fc6('0xa')](util[_0x1fc6('0x11')](_0x1fc6('0x19'),_0x4d8b12['id']));if(_0x2b7acb&&_0x2b7acb[_0x1fc6('0x1a')]&&_0x2b7acb[_0x1fc6('0x1a')][_0x1fc6('0x1b')]&&_0x2b7acb[_0x1fc6('0x1a')][_0x1fc6('0x1b')][_0x1fc6('0x1c')]){_0x318bb5[_0x1fc6('0x15')]='';for(var _0x358d3a=0x0;_0x358d3a<_0x2b7acb['results'][_0x1fc6('0x1b')][_0x1fc6('0x1c')];_0x358d3a++){_0x318bb5[_0x1fc6('0x15')]+=_0x2b7acb[_0x1fc6('0x1a')][_0x1fc6('0x1b')][_0x358d3a][_0x1fc6('0x1d')]+'';}}return _0x4d8b12[_0x1fc6('0x1e')](_0x318bb5);})[_0x1fc6('0x10')](function(){logger[_0x1fc6('0xa')](util[_0x1fc6('0x11')](_0x1fc6('0x1f'),_0x4d8b12['id']));if(!_0x4d8b12[_0x1fc6('0x20')]){throw new db[(_0x1fc6('0x21'))][(_0x1fc6('0x22'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x2a1b5b[_0x1fc6('0x23')]||!_0x2a1b5b[_0x1fc6('0x24')]||!_0x2a1b5b[_0x1fc6('0x25')]||!_0x2a1b5b['language']||!_0x2a1b5b[_0x1fc6('0x26')]){throw new db[(_0x1fc6('0x21'))][(_0x1fc6('0x22'))](_0x1fc6('0x27'));}if(!_0x318bb5[_0x1fc6('0x15')]){throw new Error(_0x1fc6('0x28'));}if(_0x2a1b5b[_0x1fc6('0x24')]===_0x475b16['id']){return _0x475b16;}else{return db[_0x1fc6('0x29')]['findOne']({'where':{'id':_settings[_0x1fc6('0x24')]}});}})[_0x1fc6('0x10')](function(_0x3486ff){if(!_0x3486ff){throw new db[(_0x1fc6('0x21'))][(_0x1fc6('0x22'))](_0x1fc6('0x2a'));}if(!_0x3486ff[_0x1fc6('0xd')]||!_0x3486ff['data2']){throw new db[(_0x1fc6('0x21'))][(_0x1fc6('0x22'))](_0x1fc6('0x2b'));}_0xa08740=_0x3486ff;logger[_0x1fc6('0xa')](util[_0x1fc6('0x11')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x4d8b12['id']));return sentiment(_0xa08740['data1'],_0xa08740[_0x1fc6('0xe')],_0x2a1b5b[_0x1fc6('0x25')],_0x318bb5[_0x1fc6('0x15')],_0x2a1b5b[_0x1fc6('0x2c')]);})['then'](function(_0xd49a6a){logger[_0x1fc6('0xa')](util[_0x1fc6('0x11')](_0x1fc6('0x2d'),_0x4d8b12['id']));return _0x4d8b12[_0x1fc6('0x1e')]({'sentiment':_0xd49a6a['Sentiment'],'sPositive':_0xd49a6a[_0x1fc6('0x2e')][_0x1fc6('0x2f')],'sNegative':_0xd49a6a[_0x1fc6('0x2e')][_0x1fc6('0x30')],'sMixed':_0xd49a6a[_0x1fc6('0x2e')][_0x1fc6('0x31')],'sNeutral':_0xd49a6a[_0x1fc6('0x2e')][_0x1fc6('0x32')]});})[_0x1fc6('0x10')](function(){logger[_0x1fc6('0xa')](util[_0x1fc6('0x11')](_0x1fc6('0x1f'),_0x4d8b12['id']));_0x5e694d();});case _0x1fc6('0x33'):return _0x4d8b12[_0x1fc6('0x1e')]({'transcribeStatus':_0x1fc6('0x33'),'failureReason':_0x141d3e[_0x1fc6('0x13')][_0x1fc6('0x34')]})[_0x1fc6('0x10')](function(){logger[_0x1fc6('0xa')](util['format'](_0x1fc6('0x1f'),_0x4d8b12['id']));_0x5e694d();});default:logger[_0x1fc6('0xa')](util[_0x1fc6('0x11')](_0x1fc6('0x35'),_0x4d8b12['id']));break;}}else{return BPromise['resolve']()[_0x1fc6('0x10')](function(){if(!_0x4d8b12[_0x1fc6('0x20')]){throw new db[(_0x1fc6('0x21'))][(_0x1fc6('0x22'))](_0x1fc6('0x36'));}if(!_0x2a1b5b[_0x1fc6('0x23')]||!_0x2a1b5b['sentimentAccountId']||!_0x2a1b5b[_0x1fc6('0x25')]||!_0x2a1b5b['language']||!_0x2a1b5b[_0x1fc6('0x26')]){throw new db[(_0x1fc6('0x21'))][(_0x1fc6('0x22'))](_0x1fc6('0x27'));}if(!_0x4d8b12[_0x1fc6('0x15')]){throw new Error('Transcript\x20not\x20available');}if(_0x2a1b5b[_0x1fc6('0x24')]===_0x475b16['id']){return _0x475b16;}else{return db[_0x1fc6('0x29')][_0x1fc6('0x37')]({'where':{'id':_settings[_0x1fc6('0x24')]}});}})[_0x1fc6('0x10')](function(_0x4c310a){if(!_0x4c310a){throw new db[(_0x1fc6('0x21'))][(_0x1fc6('0x22'))](_0x1fc6('0x2a'));}if(!_0x4c310a[_0x1fc6('0xd')]||!_0x4c310a['data2']){throw new db[(_0x1fc6('0x21'))][(_0x1fc6('0x22'))](_0x1fc6('0x2b'));}_0xa08740=_0x4c310a;logger[_0x1fc6('0xa')](util[_0x1fc6('0x11')](_0x1fc6('0x38'),_0x4d8b12['id']));return sentiment(_0xa08740[_0x1fc6('0xd')],_0xa08740[_0x1fc6('0xe')],_0x2a1b5b[_0x1fc6('0x25')],_0x4d8b12[_0x1fc6('0x15')],_0x2a1b5b[_0x1fc6('0x2c')]);})['then'](function(_0x31307c){logger[_0x1fc6('0xa')](util[_0x1fc6('0x11')](_0x1fc6('0x2d'),_0x4d8b12['id']));return _0x4d8b12['update']({'sentiment':_0x31307c['Sentiment'],'sPositive':_0x31307c[_0x1fc6('0x2e')][_0x1fc6('0x2f')],'sNegative':_0x31307c[_0x1fc6('0x2e')][_0x1fc6('0x30')],'sMixed':_0x31307c['SentimentScore']['Mixed'],'sNeutral':_0x31307c[_0x1fc6('0x2e')]['Neutral'],'transcribeStatus':_0x1fc6('0x16')});})[_0x1fc6('0x10')](function(){logger['info'](util[_0x1fc6('0x11')](_0x1fc6('0x1f'),_0x4d8b12['id']));_0x5e694d();});}})['catch'](function(_0x50d92c){if(_0x50d92c){if(!_0x50d92c[_0x1fc6('0x39')]||_0x50d92c['name']!=='SequelizeValidationError'){logger[_0x1fc6('0x3a')](util[_0x1fc6('0x11')](_0x1fc6('0x3b'),_0x4d8b12['id']),util[_0x1fc6('0x3c')](_0x50d92c,{'showHidden':![],'depth':null}));}}_0x5e694d();});});}function checkTranscribe(){var _0x561409;var _0x349ffd;var _0xa849a4;return db[_0x1fc6('0x3d')]['findAll']({'where':{'transcribeStatus':_0x1fc6('0x3e')}})['then'](function(_0x2e0282){if(!_0x2e0282||!_0x2e0282[_0x1fc6('0x1c')]){throw new db['Sequelize'][(_0x1fc6('0x22'))](_0x1fc6('0x3f'));}_0x561409=_0x2e0282;return db[_0x1fc6('0x40')][_0x1fc6('0x37')]({'where':{'id':0x1}});})['then'](function(_0x45a8fc){if(!_0x45a8fc){throw new db['Sequelize'][(_0x1fc6('0x22'))]('Settings\x20not\x20available');}_0x349ffd=_0x45a8fc;if(!_0x349ffd[_0x1fc6('0x4')]||!_0x349ffd[_0x1fc6('0x41')]||!_0x349ffd[_0x1fc6('0xf')]||!_0x349ffd['language']||!_0x349ffd[_0x1fc6('0x26')]){throw new db[(_0x1fc6('0x21'))][(_0x1fc6('0x22'))]('Transcribe\x20not\x20configured');}return db[_0x1fc6('0x29')]['findOne']({'where':{'id':_0x349ffd[_0x1fc6('0x41')]}});})['then'](function(_0x5790a9){if(!_0x5790a9){throw new db[(_0x1fc6('0x21'))][(_0x1fc6('0x22'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x5790a9['data1']||!_0x5790a9['data2']){throw new db[(_0x1fc6('0x21'))][(_0x1fc6('0x22'))](_0x1fc6('0x2b'));}_0xa849a4=_0x5790a9;var _0x28f058=[];_0x561409[_0x1fc6('0x42')](function(_0x39fd88){_0x28f058[_0x1fc6('0x43')](checkTranscribeJob(_0x39fd88,_0x349ffd,_0xa849a4));});return BPromise[_0x1fc6('0x44')](_0x28f058);})[_0x1fc6('0x45')](function(_0x1257bf){if(_0x1257bf){if(!_0x1257bf[_0x1fc6('0x39')]||_0x1257bf['name']!==_0x1fc6('0x46')){logger[_0x1fc6('0x3a')](util[_0x1fc6('0x3c')](_0x1257bf,{'showHidden':![],'depth':null}));}}});}exports[_0x1fc6('0x47')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file diff --git a/server/config/schedule/whatsapp.js b/server/config/schedule/whatsapp.js index 0a82404..ce7fd84 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 _0x924a=['system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','then','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','redis','localhost','socket.io-emitter','lastMsgAt','subtract','length','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','WhatsappInteraction','update'];(function(_0x2e75c4,_0x54792f){var _0x45f46c=function(_0x15da16){while(--_0x15da16){_0x2e75c4['push'](_0x2e75c4['shift']());}};_0x45f46c(++_0x54792f);}(_0x924a,0x1ae));var _0xa924=function(_0x5ea335,_0x1b10b3){_0x5ea335=_0x5ea335-0x0;var _0x2c091c=_0x924a[_0x5ea335];return _0x2c091c;};'use strict';var _=require(_0xa924('0x0'));var moment=require(_0xa924('0x1'));var Redis=require(_0xa924('0x2'));var util=require(_0xa924('0x3'));var config=require(_0xa924('0x4'));var db=require(_0xa924('0x5'))['db'];var logger=require(_0xa924('0x6'))('schedule');config['redis']=_['defaults'](config[_0xa924('0x7')],{'host':_0xa924('0x8'),'port':0x18eb});var io=require(_0xa924('0x9'))(new Redis(config[_0xa924('0x7')]));function closeInteractions(){var _0x107465=[];return db['WhatsappInteraction']['findAll']({'raw':!![],'attributes':['id',_0xa924('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xa924('0xb')](0x18,'hours')}}})['then'](function(_0x93737c){if(_0x93737c&&_0x93737c[_0xa924('0xc')]){_0x107465=_['map'](_0x93737c||[],'id');logger[_0xa924('0xd')](_0xa924('0xe'),_0x107465[_0xa924('0xf')]());return db[_0xa924('0x10')][_0xa924('0x11')]({'closeReason':_0xa924('0x12'),'disposition':_0xa924('0x13'),'closed':!![],'closedAt':moment()[_0xa924('0x14')](_0xa924('0x15'))},{'where':{'id':_0x107465}});}})[_0xa924('0x16')](function(){if(_0x107465&&_0x107465[_0xa924('0xc')]){logger[_0xa924('0xd')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x107465[_0xa924('0xf')]());for(var _0x2daa15=0x0;_0x2daa15<_0x107465[_0xa924('0xc')];_0x2daa15++){io[_0xa924('0x17')](_0xa924('0x18'),{'id':_0x107465[_0x2daa15],'closed':!![]});}}})[_0xa924('0x19')](function(_0x384859){logger[_0xa924('0x1a')](_0xa924('0x1b'),_0x384859?util['inspect'](_0x384859,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xd9bf=['whatsappInteraction:update','error','inspect','lodash','moment','ioredis','util','../../mysqldb','../logger','schedule','defaults','localhost','redis','WhatsappInteraction','subtract','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd9bf,0x162));var _0xfd9b=function(_0x5251fd,_0x41c018){_0x5251fd=_0x5251fd-0x0;var _0x41ba58=_0xd9bf[_0x5251fd];return _0x41ba58;};'use strict';var _=require(_0xfd9b('0x0'));var moment=require(_0xfd9b('0x1'));var Redis=require(_0xfd9b('0x2'));var util=require(_0xfd9b('0x3'));var config=require('../../config/environment');var db=require(_0xfd9b('0x4'))['db'];var logger=require(_0xfd9b('0x5'))(_0xfd9b('0x6'));config['redis']=_[_0xfd9b('0x7')](config['redis'],{'host':_0xfd9b('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xfd9b('0x9')]));function closeInteractions(){var _0x2f2519=[];return db[_0xfd9b('0xa')]['findAll']({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xfd9b('0xb')](0x18,_0xfd9b('0xc'))}}})[_0xfd9b('0xd')](function(_0x56b6c8){if(_0x56b6c8&&_0x56b6c8[_0xfd9b('0xe')]){_0x2f2519=_[_0xfd9b('0xf')](_0x56b6c8||[],'id');logger[_0xfd9b('0x10')](_0xfd9b('0x11'),_0x2f2519['join']());return db['WhatsappInteraction'][_0xfd9b('0x12')]({'closeReason':_0xfd9b('0x13'),'disposition':_0xfd9b('0x14'),'closed':!![],'closedAt':moment()[_0xfd9b('0x15')](_0xfd9b('0x16'))},{'where':{'id':_0x2f2519}});}})[_0xfd9b('0xd')](function(){if(_0x2f2519&&_0x2f2519[_0xfd9b('0xe')]){logger[_0xfd9b('0x10')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x2f2519['join']());for(var _0x20c9a0=0x0;_0x20c9a0<_0x2f2519['length'];_0x20c9a0++){io[_0xfd9b('0x17')](_0xfd9b('0x18'),{'id':_0x2f2519[_0x20c9a0],'closed':!![]});}}})['catch'](function(_0xe48860){logger[_0xfd9b('0x19')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0xe48860?util[_0xfd9b('0x1a')](_0xe48860,{'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 27c8682..c826676 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x660c=['CmHopper','bulkCreate','finished\x20populating','contacts2','hopper2','../mysqldb','innocenzo.biondo','@xcally.com','now','push','Biondo','CmContact','destroy','then','log','contacts1'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x660c,0xa5));var _0xc660=function(_0x14d19c,_0x15e723){_0x14d19c=_0x14d19c-0x0;var _0x30deb7=_0x660c[_0x14d19c];return _0x30deb7;};'use strict';var util=require('util');var db=require(_0xc660('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':'Innocenzo'+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xc660('0x1')+i+_0xc660('0x2')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0xc660('0x3')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xc660('0x3')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xc660('0x4')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0xc660('0x5')+i,'phone':0xf879fb460+i,'email':_0xc660('0x1')+i+_0xc660('0x2')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xc660('0x4')]({'id':i,'active':![],'scheduledat':Date[_0xc660('0x3')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xc660('0x3')](),'updatedAt':Date[_0xc660('0x3')]()});}db[_0xc660('0x6')][_0xc660('0x7')]({'where':{}})[_0xc660('0x8')](function(){return db[_0xc660('0x6')]['bulkCreate'](contacts);})[_0xc660('0x8')](function(){console[_0xc660('0x9')]('finished\x20populating',_0xc660('0xa'));return db['CmHopper'][_0xc660('0x7')]({'where':{}});})['then'](function(){return db[_0xc660('0xb')][_0xc660('0xc')](hopper);})[_0xc660('0x8')](function(){console[_0xc660('0x9')](_0xc660('0xd'),'hopper1');return db[_0xc660('0x6')]['bulkCreate'](contacts2);})[_0xc660('0x8')](function(){console[_0xc660('0x9')](_0xc660('0xd'),_0xc660('0xe'));return db['CmHopper'][_0xc660('0xc')](hopper2);})[_0xc660('0x8')](function(){console[_0xc660('0x9')](_0xc660('0xd'),_0xc660('0xf'));})['catch'](function(_0x10e75b){console[_0xc660('0x9')](_0x10e75b);}); \ No newline at end of file +var _0x94ad=['Innocenzo','Biondo','innocenzo.biondo','now','CmContact','destroy','bulkCreate','log','finished\x20populating','contacts1','CmHopper','then','contacts2','hopper2','catch','util','../mysqldb','push'];(function(_0x209497,_0x311317){var _0x4882d4=function(_0x574888){while(--_0x574888){_0x209497['push'](_0x209497['shift']());}};_0x4882d4(++_0x311317);}(_0x94ad,0x165));var _0xd94a=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x94ad[_0x1d1779];return _0x2377e9;};'use strict';var util=require(_0xd94a('0x0'));var db=require(_0xd94a('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xd94a('0x2')]({'id':i,'firstName':_0xd94a('0x3')+i,'lastName':_0xd94a('0x4')+i,'phone':0xf879fb460+i,'email':_0xd94a('0x5')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xd94a('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xd94a('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0xd94a('0x3')+i,'lastName':_0xd94a('0x4')+i,'phone':0xf879fb460+i,'email':_0xd94a('0x5')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xd94a('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xd94a('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date['now']()});}db[_0xd94a('0x7')][_0xd94a('0x8')]({'where':{}})['then'](function(){return db[_0xd94a('0x7')][_0xd94a('0x9')](contacts);})['then'](function(){console[_0xd94a('0xa')](_0xd94a('0xb'),_0xd94a('0xc'));return db[_0xd94a('0xd')]['destroy']({'where':{}});})[_0xd94a('0xe')](function(){return db[_0xd94a('0xd')][_0xd94a('0x9')](hopper);})[_0xd94a('0xe')](function(){console['log'](_0xd94a('0xb'),'hopper1');return db[_0xd94a('0x7')][_0xd94a('0x9')](contacts2);})[_0xd94a('0xe')](function(){console[_0xd94a('0xa')]('finished\x20populating',_0xd94a('0xf'));return db['CmHopper'][_0xd94a('0x9')](hopper2);})[_0xd94a('0xe')](function(){console['log'](_0xd94a('0xb'),_0xd94a('0x10'));})[_0xd94a('0x11')](function(_0x3984b3){console['log'](_0x3984b3);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 521fe85..3d63c01 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7cda=['agent','format','password','friend','wss','all','ulaw','yes','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','log','add\x20user','catch','util','../mysqldb','%s%s'];(function(_0x55cdc5,_0x2b2297){var _0x29acd5=function(_0x405234){while(--_0x405234){_0x55cdc5['push'](_0x55cdc5['shift']());}};_0x29acd5(++_0x2b2297);}(_0x7cda,0xd5));var _0xa7cd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7cda[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xa7cd('0x0'));var db=require(_0xa7cd('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util['format'](_0xa7cd('0x2'),_0xa7cd('0x3'),i),'fullname':util['format'](_0xa7cd('0x2'),_0xa7cd('0x3'),i),'email':util[_0xa7cd('0x4')]('%s%s@xcally.com',_0xa7cd('0x3'),i),'role':_0xa7cd('0x3'),'password':_0xa7cd('0x5'),'internal':0xfa0+i,'type':_0xa7cd('0x6'),'transport':['udp','ws',_0xa7cd('0x7')],'disallow':[_0xa7cd('0x8')],'allow':[_0xa7cd('0x9')],'defaultuser':util[_0xa7cd('0x4')](_0xa7cd('0x2'),_0xa7cd('0x3'),i),'encryption':_0xa7cd('0xa'),'avpf':_0xa7cd('0xa'),'force_avp':_0xa7cd('0xa'),'icesupport':_0xa7cd('0xa'),'dtlsenable':_0xa7cd('0xa'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0xa7cd('0xb'),'callerid':util['format'](_0xa7cd('0xc'),util[_0xa7cd('0x4')]('%s%s',_0xa7cd('0x3'),i),0xfa0+i)});}db[_0xa7cd('0xd')][_0xa7cd('0xe')](users)['then'](function(){console[_0xa7cd('0xf')](_0xa7cd('0x10'));})[_0xa7cd('0x11')](function(_0x442ed3){console[_0xa7cd('0xf')](_0x442ed3);}); \ No newline at end of file +var _0x3257=['actpass','\x22%s\x22\x20<%s>','bulkCreate','then','log','add\x20user','catch','util','push','format','%s%s','agent','%s%s@xcally.com','password','friend','udp','ulaw','yes','/etc/pki/tls/private/motion.key'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3257,0x8c));var _0x7325=function(_0x2a504f,_0x427fd5){_0x2a504f=_0x2a504f-0x0;var _0x4ebd79=_0x3257[_0x2a504f];return _0x4ebd79;};'use strict';var util=require(_0x7325('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x7325('0x1')]({'name':util[_0x7325('0x2')](_0x7325('0x3'),_0x7325('0x4'),i),'fullname':util[_0x7325('0x2')]('%s%s','agent',i),'email':util[_0x7325('0x2')](_0x7325('0x5'),_0x7325('0x4'),i),'role':_0x7325('0x4'),'password':_0x7325('0x6'),'internal':0xfa0+i,'type':_0x7325('0x7'),'transport':[_0x7325('0x8'),'ws','wss'],'disallow':['all'],'allow':[_0x7325('0x9')],'defaultuser':util[_0x7325('0x2')]('%s%s',_0x7325('0x4'),i),'encryption':'yes','avpf':_0x7325('0xa'),'force_avp':_0x7325('0xa'),'icesupport':'yes','dtlsenable':'yes','dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0x7325('0xb'),'dtlssetup':_0x7325('0xc'),'callerid':util[_0x7325('0x2')](_0x7325('0xd'),util[_0x7325('0x2')]('%s%s','agent',i),0xfa0+i)});}db['User'][_0x7325('0xe')](users)[_0x7325('0xf')](function(){console[_0x7325('0x10')](_0x7325('0x11'));})[_0x7325('0x12')](function(_0xe2a29f){console[_0x7325('0x10')](_0xe2a29f);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 4ddc58a..264145e 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8b29=['all','length','chat','fax','sms','mail','openchannel','whatsapp','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','MailInteractions','removeMailInteractions','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','OpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','connection','setMaxListeners','address','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','../mysqldb','./environment','name','User','role','telephone','agent','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','FaxQueues','SmsQueues','MailQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','Campaign','where','type','format','%s:queue:%s','Agents','query','find','userProfileId','handshake','ChatInteraction','ChatInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','WhatsappInteractions','user:%s','admin','voice:outbound','hasOwnProperty','push','VoiceQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','ChatQueues','FaxQueue','SmsQueue','voice:inbound','getFaxQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues'];(function(_0x5ae187,_0x8afd5c){var _0x211069=function(_0x5a56b6){while(--_0x5a56b6){_0x5ae187['push'](_0x5ae187['shift']());}};_0x211069(++_0x8afd5c);}(_0x8b29,0x14f));var _0x98b2=function(_0x54909c,_0x1f66d3){_0x54909c=_0x54909c-0x0;var _0x4b1760=_0x8b29[_0x54909c];return _0x4b1760;};'use strict';var _=require(_0x98b2('0x0'));var util=require('util');var BPromise=require('bluebird');var db=require(_0x98b2('0x1'))['db'];var config=require(_0x98b2('0x2'));var queryQueues={'attributes':['id',_0x98b2('0x3')],'include':[{'as':'Agents','model':db[_0x98b2('0x4')],'attributes':['id',_0x98b2('0x3'),_0x98b2('0x5')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x98b2('0x3')],'where':{'role':_0x98b2('0x6')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0x98b2('0x3')],'where':{'role':_0x98b2('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id','name','type'],'where':{'type':_0x98b2('0x8')}};function getAssociatedResources(_0x47ca85,_0xbd9aff,_0x44b321){return db[_0x98b2('0x9')][_0x98b2('0xa')]({'where':{'name':_0x47ca85,'userProfileId':_0xbd9aff},'raw':!![]})[_0x98b2('0xb')](function(_0x53cdb2){if(_0x53cdb2){if(_0x53cdb2[_0x98b2('0xc')]){switch(_0x47ca85){case _0x98b2('0xd'):case'ChatQueues':case _0x98b2('0xe'):case _0x98b2('0xf'):case _0x98b2('0x10'):case'OpenchannelQueues':case _0x98b2('0x11'):return db[_0x44b321][_0x98b2('0x12')](queryQueues);case _0x98b2('0x13'):return db[_0x44b321][_0x98b2('0x12')](queryTelephones);case _0x98b2('0x14'):return db[_0x44b321][_0x98b2('0x12')](queryTrunks);case _0x98b2('0x15'):return db[_0x44b321][_0x98b2('0x12')](queryCampaigns);}}else{return db[_0x98b2('0x16')][_0x98b2('0x12')]({'attributes':[_0x98b2('0x17')],'where':{'sectionId':_0x53cdb2['id']},'raw':!![]})[_0x98b2('0xb')](function(_0x4c874d){if(_0x4c874d){var _0x36424b={'where':{'id':_[_0x98b2('0x18')](_0x4c874d,_0x98b2('0x17'))},'raw':!![]};switch(_0x44b321){case'User':_0x36424b['where'][_0x98b2('0x5')]=_0x98b2('0x6');break;case _0x98b2('0x19'):_0x36424b[_0x98b2('0x1a')][_0x98b2('0x1b')]=_0x98b2('0x8');break;}return db[_0x44b321][_0x98b2('0x12')](_0x36424b);}else{return[];}});}}else{return[];}})[_0x98b2('0xb')](function(_0x3180c9){return _0x3180c9;});}function joinOrLeaveQueues(_0x43a75f,_0x2edd4d,_0x14e300,_0x4918db){_0x43a75f[_0x2edd4d](util[_0x98b2('0x1c')](_0x98b2('0x1d'),_0x14e300,_0x4918db[_0x98b2('0x3')]));if(_0x4918db[_0x98b2('0x1e')]){for(var _0x55853b=0x0;_0x55853b<_0x4918db['Agents']['length'];_0x55853b+=0x1){_0x43a75f[_0x2edd4d](util[_0x98b2('0x1c')]('user:%s',_0x4918db[_0x98b2('0x1e')][_0x55853b][_0x98b2('0x3')]));}}}function joinOrLeave(_0x39d906,_0x367e4b,_0x50da70){var _0x5dc4d3;if(_0x39d906['handshake'][_0x98b2('0x1f')]['id']){db[_0x98b2('0x4')][_0x98b2('0x20')]({'attributes':['id',_0x98b2('0x3'),_0x98b2('0x5'),_0x98b2('0x21')],'where':{'id':_0x39d906[_0x98b2('0x22')][_0x98b2('0x1f')]['id']},'include':[{'model':db[_0x98b2('0x23')],'as':_0x98b2('0x24'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x98b2('0x25')],'as':_0x98b2('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x98b2('0x27')],'as':_0x98b2('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0x98b2('0x29')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0x98b2('0x2a'),'attributes':['id'],'raw':!![]}]})[_0x98b2('0xb')](function(_0x2f4565){if(_0x2f4565){_0x5dc4d3=_0x2f4565;_0x39d906[_0x367e4b](util[_0x98b2('0x1c')](_0x98b2('0x2b'),_0x2f4565['name']));var _0x419f5c=[];switch(_0x2f4565[_0x98b2('0x5')]){case _0x98b2('0x2c'):_0x39d906[_0x367e4b]('voice:inbound');_0x39d906[_0x367e4b](_0x98b2('0x2d'));if(queryQueues[_0x98b2('0x2e')]('include')){delete queryQueues['include'];}_0x419f5c[_0x98b2('0x2f')](db[_0x98b2('0x30')][_0x98b2('0x12')](queryQueues));_0x419f5c[_0x98b2('0x2f')](db['ChatQueue'][_0x98b2('0x12')](queryQueues));_0x419f5c[_0x98b2('0x2f')](db['FaxQueue']['findAll'](queryQueues));_0x419f5c[_0x98b2('0x2f')](db['SmsQueue']['findAll'](queryQueues));_0x419f5c['push'](db['MailQueue'][_0x98b2('0x12')](queryQueues));_0x419f5c['push'](db[_0x98b2('0x31')][_0x98b2('0x12')](queryQueues));_0x419f5c[_0x98b2('0x2f')](db[_0x98b2('0x32')]['findAll'](queryQueues));_0x419f5c[_0x98b2('0x2f')](db[_0x98b2('0x4')][_0x98b2('0x12')](queryTelephones));_0x419f5c[_0x98b2('0x2f')](db[_0x98b2('0x33')][_0x98b2('0x12')](queryTrunks));_0x419f5c[_0x98b2('0x2f')](db[_0x98b2('0x19')]['findAll'](queryCampaigns));_0x419f5c[_0x98b2('0x2f')](db[_0x98b2('0x4')]['findAll'](queryAgents));break;case _0x98b2('0x34'):_0x39d906[_0x367e4b]('voice:inbound');_0x39d906[_0x367e4b](_0x98b2('0x2d'));_0x419f5c[_0x98b2('0x2f')](getAssociatedResources(_0x98b2('0xd'),_0x2f4565[_0x98b2('0x21')],'VoiceQueue'));_0x419f5c[_0x98b2('0x2f')](getAssociatedResources(_0x98b2('0x35'),_0x2f4565[_0x98b2('0x21')],'ChatQueue'));_0x419f5c[_0x98b2('0x2f')](getAssociatedResources(_0x98b2('0xe'),_0x2f4565[_0x98b2('0x21')],_0x98b2('0x36')));_0x419f5c['push'](getAssociatedResources(_0x98b2('0xf'),_0x2f4565[_0x98b2('0x21')],_0x98b2('0x37')));_0x419f5c[_0x98b2('0x2f')](getAssociatedResources(_0x98b2('0x10'),_0x2f4565['userProfileId'],'MailQueue'));_0x419f5c[_0x98b2('0x2f')](getAssociatedResources('OpenchannelQueues',_0x2f4565[_0x98b2('0x21')],_0x98b2('0x31')));_0x419f5c['push'](getAssociatedResources('WhatsappQueues',_0x2f4565[_0x98b2('0x21')],_0x98b2('0x32')));_0x419f5c[_0x98b2('0x2f')](getAssociatedResources('Telephones',_0x2f4565['userProfileId'],_0x98b2('0x4')));_0x419f5c['push'](getAssociatedResources(_0x98b2('0x14'),_0x2f4565[_0x98b2('0x21')],_0x98b2('0x33')));_0x419f5c[_0x98b2('0x2f')](getAssociatedResources('IvrCampaigns',_0x2f4565['userProfileId'],_0x98b2('0x19')));_0x419f5c[_0x98b2('0x2f')](db[_0x98b2('0x4')][_0x98b2('0x12')](queryAgents));break;case'agent':_0x39d906[_0x367e4b](_0x98b2('0x38'));_0x39d906[_0x367e4b]('voice:outbound');_0x419f5c['push'](_0x2f4565['getVoiceQueues']({'attributes':['id',_0x98b2('0x3')]}));_0x419f5c[_0x98b2('0x2f')](_0x2f4565['getChatQueues']({'attributes':['id','name']}));_0x419f5c[_0x98b2('0x2f')](_0x2f4565[_0x98b2('0x39')]({'attributes':['id',_0x98b2('0x3')]}));_0x419f5c[_0x98b2('0x2f')](_0x2f4565['getSmsQueues']({'attributes':['id','name']}));_0x419f5c[_0x98b2('0x2f')](_0x2f4565[_0x98b2('0x3a')]({'attributes':['id',_0x98b2('0x3')]}));_0x419f5c[_0x98b2('0x2f')](_0x2f4565[_0x98b2('0x3b')]({'attributes':['id',_0x98b2('0x3')]}));_0x419f5c[_0x98b2('0x2f')](_0x2f4565[_0x98b2('0x3c')]({'attributes':['id','name']}));break;}return BPromise[_0x98b2('0x3d')](_0x419f5c);}})[_0x98b2('0xb')](function(_0x3b3445){if(_0x3b3445&&_0x3b3445[_0x98b2('0x3e')]){for(var _0x12d8b0=0x0;_0x12d8b0<_0x3b3445[_0x98b2('0x3e')];_0x12d8b0+=0x1){for(var _0x38df90=0x0;_0x38df90<_0x3b3445[_0x12d8b0]['length'];_0x38df90+=0x1){switch(_0x12d8b0){case 0x0:joinOrLeaveQueues(_0x39d906,_0x367e4b,'voice',_0x3b3445[_0x12d8b0][_0x38df90]);break;case 0x1:joinOrLeaveQueues(_0x39d906,_0x367e4b,_0x98b2('0x3f'),_0x3b3445[_0x12d8b0][_0x38df90]);break;case 0x2:joinOrLeaveQueues(_0x39d906,_0x367e4b,_0x98b2('0x40'),_0x3b3445[_0x12d8b0][_0x38df90]);break;case 0x3:joinOrLeaveQueues(_0x39d906,_0x367e4b,_0x98b2('0x41'),_0x3b3445[_0x12d8b0][_0x38df90]);break;case 0x4:joinOrLeaveQueues(_0x39d906,_0x367e4b,_0x98b2('0x42'),_0x3b3445[_0x12d8b0][_0x38df90]);break;case 0x5:joinOrLeaveQueues(_0x39d906,_0x367e4b,_0x98b2('0x43'),_0x3b3445[_0x12d8b0][_0x38df90]);break;case 0x6:joinOrLeaveQueues(_0x39d906,_0x367e4b,_0x98b2('0x44'),_0x3b3445[_0x12d8b0][_0x38df90]);break;case 0x7:if(_0x5dc4d3['role']!==_0x98b2('0x7'))_0x39d906[_0x367e4b](util['format']('telephone:%s',_0x3b3445[_0x12d8b0][_0x38df90][_0x98b2('0x3')]));break;case 0x8:if(_0x5dc4d3[_0x98b2('0x5')]!==_0x98b2('0x7'))_0x39d906[_0x367e4b](util[_0x98b2('0x1c')](_0x98b2('0x45'),_0x3b3445[_0x12d8b0][_0x38df90][_0x98b2('0x3')]));break;case 0x9:if(_0x5dc4d3['role']!=='agent')_0x39d906[_0x367e4b](util[_0x98b2('0x1c')](_0x98b2('0x46'),_0x3b3445[_0x12d8b0][_0x38df90][_0x98b2('0x1b')],_0x3b3445[_0x12d8b0][_0x38df90][_0x98b2('0x3')]));break;case 0xa:_0x39d906[_0x367e4b](util['format'](_0x98b2('0x2b'),_0x3b3445[_0x12d8b0][_0x38df90][_0x98b2('0x3')]));break;}}}}})['then'](function(){if(_0x367e4b===_0x98b2('0x47')){var _0x23ef65=_[_0x98b2('0x18')](_0x5dc4d3[_0x98b2('0x24')],'id');return _0x5dc4d3[_0x98b2('0x48')](_0x23ef65)[_0x98b2('0xb')](function(){for(var _0x705778=0x0;_0x705778<_0x23ef65[_0x98b2('0x3e')];_0x705778+=0x1){_0x50da70[_0x98b2('0x49')](_0x98b2('0x4a'),{'ChatInteractionId':Number(_0x23ef65[_0x705778]),'UserId':Number(_0x5dc4d3['id'])});}});}})[_0x98b2('0xb')](function(){if(_0x367e4b===_0x98b2('0x47')){var _0x4e038c=_[_0x98b2('0x18')](_0x5dc4d3[_0x98b2('0x4b')],'id');return _0x5dc4d3[_0x98b2('0x4c')](_0x4e038c)[_0x98b2('0xb')](function(){for(var _0x3cb958=0x0;_0x3cb958<_0x4e038c[_0x98b2('0x3e')];_0x3cb958+=0x1){_0x50da70['emit']('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x4e038c[_0x3cb958]),'UserId':Number(_0x5dc4d3['id'])});}});}})[_0x98b2('0xb')](function(){if(_0x367e4b===_0x98b2('0x47')){var _0x557543=_[_0x98b2('0x18')](_0x5dc4d3['FaxInteractions'],'id');return _0x5dc4d3[_0x98b2('0x4d')](_0x557543)[_0x98b2('0xb')](function(){for(var _0x32451e=0x0;_0x32451e<_0x557543[_0x98b2('0x3e')];_0x32451e+=0x1){_0x50da70[_0x98b2('0x49')](_0x98b2('0x4e'),{'FaxInteractionId':Number(_0x557543[_0x32451e]),'UserId':Number(_0x5dc4d3['id'])});}});}})[_0x98b2('0xb')](function(){if(_0x367e4b===_0x98b2('0x47')){var _0x3e7c8e=_[_0x98b2('0x18')](_0x5dc4d3['SmsInteractions'],'id');return _0x5dc4d3[_0x98b2('0x4f')](_0x3e7c8e)[_0x98b2('0xb')](function(){for(var _0x463092=0x0;_0x463092<_0x3e7c8e['length'];_0x463092+=0x1){_0x50da70[_0x98b2('0x49')](_0x98b2('0x50'),{'SmsInteractionId':Number(_0x3e7c8e[_0x463092]),'UserId':Number(_0x5dc4d3['id'])});}});}})[_0x98b2('0xb')](function(){if(_0x367e4b===_0x98b2('0x47')){var _0x7180eb=_[_0x98b2('0x18')](_0x5dc4d3[_0x98b2('0x51')],'id');return _0x5dc4d3['removeOpenchannelInteractions'](_0x7180eb)[_0x98b2('0xb')](function(){for(var _0x5538c3=0x0;_0x5538c3<_0x7180eb[_0x98b2('0x3e')];_0x5538c3+=0x1){_0x50da70[_0x98b2('0x49')](_0x98b2('0x52'),{'OpenchannelInteractionId':Number(_0x7180eb[_0x5538c3]),'UserId':Number(_0x5dc4d3['id'])});}});}})[_0x98b2('0xb')](function(){if(_0x367e4b===_0x98b2('0x47')){var _0x2986f3=_[_0x98b2('0x18')](_0x5dc4d3['WhatsappInteractions'],'id');return _0x5dc4d3[_0x98b2('0x53')](_0x2986f3)['then'](function(){for(var _0x4b2367=0x0;_0x4b2367<_0x2986f3[_0x98b2('0x3e')];_0x4b2367+=0x1){_0x50da70[_0x98b2('0x49')](_0x98b2('0x54'),{'WhatsappInteractionId':Number(_0x2986f3[_0x4b2367]),'UserId':Number(_0x5dc4d3['id'])});}});}})[_0x98b2('0x55')](function(_0x340c24){_0x39d906[_0x98b2('0x56')](_0x340c24);});}}function onDisconnect(_0xaac913,_0x552b51){joinOrLeave(_0xaac913,'leave',_0x552b51);}function onConnect(_0x353b9a){joinOrLeave(_0x353b9a,'join');}exports['default']=function(_0x40f313){_0x40f313['on'](_0x98b2('0x57'),function(_0x413f0d){_0x413f0d[_0x98b2('0x58')](0x0);_0x413f0d[_0x98b2('0x59')]=_0x413f0d[_0x98b2('0x5a')][_0x98b2('0x57')][_0x98b2('0x5b')]+':'+_0x413f0d[_0x98b2('0x5a')][_0x98b2('0x57')][_0x98b2('0x5c')];_0x413f0d[_0x98b2('0x5d')]=new Date();_0x413f0d[_0x98b2('0x56')]=function(_0x36e600){console[_0x98b2('0x56')](_0x98b2('0x5e')+_0x413f0d[_0x98b2('0x5f')][_0x98b2('0x3')]+'['+_0x413f0d['address']+']',_0x36e600);};_0x413f0d['on'](_0x98b2('0x60'),function(){onDisconnect(_0x413f0d,_0x40f313);_0x413f0d[_0x98b2('0x56')](_0x98b2('0x61'));});onConnect(_0x413f0d);_0x413f0d[_0x98b2('0x56')](_0x98b2('0x62'));});}; \ No newline at end of file +var _0x1ae6=['DISCONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','Agents','User','role','agent','telephone','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','WhatsappQueues','Telephones','findAll','Trunks','IvrCampaigns','UserProfileResource','map','resourceId','where','Campaign','type','ivr','format','user:%s','handshake','query','userProfileId','ChatInteraction','ChatInteractions','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:outbound','hasOwnProperty','include','VoiceQueue','push','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','voice:inbound','getVoiceQueues','getChatQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','length','chat','fax','sms','mail','openchannel','whatsapp','telephone:%s','campaign:%s:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','address','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','disconnect'];(function(_0x274213,_0x478bae){var _0x9da749=function(_0x3e8709){while(--_0x3e8709){_0x274213['push'](_0x274213['shift']());}};_0x9da749(++_0x478bae);}(_0x1ae6,0x65));var _0x61ae=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x1ae6[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x61ae('0x0'));var util=require(_0x61ae('0x1'));var BPromise=require(_0x61ae('0x2'));var db=require(_0x61ae('0x3'))['db'];var config=require(_0x61ae('0x4'));var queryQueues={'attributes':['id',_0x61ae('0x5')],'include':[{'as':_0x61ae('0x6'),'model':db[_0x61ae('0x7')],'attributes':['id',_0x61ae('0x5'),_0x61ae('0x8')],'raw':!![],'where':{'role':_0x61ae('0x9')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x61ae('0x5')],'where':{'role':_0x61ae('0xa')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x61ae('0x5'),'type'],'where':{'type':'ivr'}};function getAssociatedResources(_0xf6a00,_0x1864e8,_0x591eb7){return db['UserProfileSection']['findOne']({'where':{'name':_0xf6a00,'userProfileId':_0x1864e8},'raw':!![]})[_0x61ae('0xb')](function(_0x480e10){if(_0x480e10){if(_0x480e10[_0x61ae('0xc')]){switch(_0xf6a00){case _0x61ae('0xd'):case _0x61ae('0xe'):case _0x61ae('0xf'):case _0x61ae('0x10'):case _0x61ae('0x11'):case'OpenchannelQueues':case _0x61ae('0x12'):return db[_0x591eb7]['findAll'](queryQueues);case _0x61ae('0x13'):return db[_0x591eb7][_0x61ae('0x14')](queryTelephones);case _0x61ae('0x15'):return db[_0x591eb7][_0x61ae('0x14')](queryTrunks);case _0x61ae('0x16'):return db[_0x591eb7][_0x61ae('0x14')](queryCampaigns);}}else{return db[_0x61ae('0x17')]['findAll']({'attributes':['resourceId'],'where':{'sectionId':_0x480e10['id']},'raw':!![]})[_0x61ae('0xb')](function(_0x6dc672){if(_0x6dc672){var _0x5d1001={'where':{'id':_[_0x61ae('0x18')](_0x6dc672,_0x61ae('0x19'))},'raw':!![]};switch(_0x591eb7){case'User':_0x5d1001[_0x61ae('0x1a')][_0x61ae('0x8')]=_0x61ae('0xa');break;case _0x61ae('0x1b'):_0x5d1001[_0x61ae('0x1a')][_0x61ae('0x1c')]=_0x61ae('0x1d');break;}return db[_0x591eb7][_0x61ae('0x14')](_0x5d1001);}else{return[];}});}}else{return[];}})['then'](function(_0x1c6d08){return _0x1c6d08;});}function joinOrLeaveQueues(_0x3a3770,_0x56053b,_0xd6b7fd,_0x533cef){_0x3a3770[_0x56053b](util[_0x61ae('0x1e')]('%s:queue:%s',_0xd6b7fd,_0x533cef[_0x61ae('0x5')]));if(_0x533cef[_0x61ae('0x6')]){for(var _0x2f0eb2=0x0;_0x2f0eb2<_0x533cef[_0x61ae('0x6')]['length'];_0x2f0eb2+=0x1){_0x3a3770[_0x56053b](util[_0x61ae('0x1e')](_0x61ae('0x1f'),_0x533cef['Agents'][_0x2f0eb2][_0x61ae('0x5')]));}}}function joinOrLeave(_0xc69019,_0x5d9828,_0x2d3dd9){var _0x481ced;if(_0xc69019[_0x61ae('0x20')][_0x61ae('0x21')]['id']){db[_0x61ae('0x7')]['find']({'attributes':['id','name',_0x61ae('0x8'),_0x61ae('0x22')],'where':{'id':_0xc69019[_0x61ae('0x20')][_0x61ae('0x21')]['id']},'include':[{'model':db[_0x61ae('0x23')],'as':_0x61ae('0x24'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0x61ae('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x61ae('0x26')],'as':_0x61ae('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x61ae('0x28')],'as':_0x61ae('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0x61ae('0x2a')],'as':_0x61ae('0x2b'),'attributes':['id'],'raw':!![]},{'model':db[_0x61ae('0x2c')],'as':_0x61ae('0x2d'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x4d21ee){if(_0x4d21ee){_0x481ced=_0x4d21ee;_0xc69019[_0x5d9828](util[_0x61ae('0x1e')](_0x61ae('0x1f'),_0x4d21ee[_0x61ae('0x5')]));var _0x4830fb=[];switch(_0x4d21ee['role']){case _0x61ae('0x2e'):_0xc69019[_0x5d9828]('voice:inbound');_0xc69019[_0x5d9828](_0x61ae('0x2f'));if(queryQueues[_0x61ae('0x30')](_0x61ae('0x31'))){delete queryQueues['include'];}_0x4830fb['push'](db[_0x61ae('0x32')][_0x61ae('0x14')](queryQueues));_0x4830fb[_0x61ae('0x33')](db[_0x61ae('0x34')]['findAll'](queryQueues));_0x4830fb[_0x61ae('0x33')](db[_0x61ae('0x35')]['findAll'](queryQueues));_0x4830fb[_0x61ae('0x33')](db[_0x61ae('0x36')][_0x61ae('0x14')](queryQueues));_0x4830fb[_0x61ae('0x33')](db[_0x61ae('0x37')][_0x61ae('0x14')](queryQueues));_0x4830fb[_0x61ae('0x33')](db[_0x61ae('0x38')][_0x61ae('0x14')](queryQueues));_0x4830fb[_0x61ae('0x33')](db[_0x61ae('0x39')][_0x61ae('0x14')](queryQueues));_0x4830fb['push'](db['User']['findAll'](queryTelephones));_0x4830fb['push'](db[_0x61ae('0x3a')][_0x61ae('0x14')](queryTrunks));_0x4830fb[_0x61ae('0x33')](db['Campaign'][_0x61ae('0x14')](queryCampaigns));_0x4830fb['push'](db['User'][_0x61ae('0x14')](queryAgents));break;case'user':_0xc69019[_0x5d9828](_0x61ae('0x3b'));_0xc69019[_0x5d9828]('voice:outbound');_0x4830fb[_0x61ae('0x33')](getAssociatedResources(_0x61ae('0xd'),_0x4d21ee['userProfileId'],_0x61ae('0x32')));_0x4830fb['push'](getAssociatedResources('ChatQueues',_0x4d21ee[_0x61ae('0x22')],_0x61ae('0x34')));_0x4830fb[_0x61ae('0x33')](getAssociatedResources(_0x61ae('0xf'),_0x4d21ee[_0x61ae('0x22')],_0x61ae('0x35')));_0x4830fb[_0x61ae('0x33')](getAssociatedResources('SmsQueues',_0x4d21ee['userProfileId'],_0x61ae('0x36')));_0x4830fb[_0x61ae('0x33')](getAssociatedResources(_0x61ae('0x11'),_0x4d21ee[_0x61ae('0x22')],_0x61ae('0x37')));_0x4830fb[_0x61ae('0x33')](getAssociatedResources('OpenchannelQueues',_0x4d21ee[_0x61ae('0x22')],'OpenchannelQueue'));_0x4830fb[_0x61ae('0x33')](getAssociatedResources(_0x61ae('0x12'),_0x4d21ee[_0x61ae('0x22')],_0x61ae('0x39')));_0x4830fb[_0x61ae('0x33')](getAssociatedResources(_0x61ae('0x13'),_0x4d21ee[_0x61ae('0x22')],_0x61ae('0x7')));_0x4830fb[_0x61ae('0x33')](getAssociatedResources(_0x61ae('0x15'),_0x4d21ee['userProfileId'],'Trunk'));_0x4830fb[_0x61ae('0x33')](getAssociatedResources(_0x61ae('0x16'),_0x4d21ee[_0x61ae('0x22')],_0x61ae('0x1b')));_0x4830fb[_0x61ae('0x33')](db['User'][_0x61ae('0x14')](queryAgents));break;case _0x61ae('0x9'):_0xc69019[_0x5d9828](_0x61ae('0x3b'));_0xc69019[_0x5d9828](_0x61ae('0x2f'));_0x4830fb[_0x61ae('0x33')](_0x4d21ee[_0x61ae('0x3c')]({'attributes':['id',_0x61ae('0x5')]}));_0x4830fb['push'](_0x4d21ee[_0x61ae('0x3d')]({'attributes':['id',_0x61ae('0x5')]}));_0x4830fb[_0x61ae('0x33')](_0x4d21ee['getFaxQueues']({'attributes':['id',_0x61ae('0x5')]}));_0x4830fb[_0x61ae('0x33')](_0x4d21ee[_0x61ae('0x3e')]({'attributes':['id',_0x61ae('0x5')]}));_0x4830fb[_0x61ae('0x33')](_0x4d21ee[_0x61ae('0x3f')]({'attributes':['id',_0x61ae('0x5')]}));_0x4830fb[_0x61ae('0x33')](_0x4d21ee[_0x61ae('0x40')]({'attributes':['id',_0x61ae('0x5')]}));_0x4830fb['push'](_0x4d21ee['getWhatsappQueues']({'attributes':['id',_0x61ae('0x5')]}));break;}return BPromise['all'](_0x4830fb);}})[_0x61ae('0xb')](function(_0xd99b44){if(_0xd99b44&&_0xd99b44[_0x61ae('0x41')]){for(var _0x18aef3=0x0;_0x18aef3<_0xd99b44[_0x61ae('0x41')];_0x18aef3+=0x1){for(var _0x400acf=0x0;_0x400acf<_0xd99b44[_0x18aef3]['length'];_0x400acf+=0x1){switch(_0x18aef3){case 0x0:joinOrLeaveQueues(_0xc69019,_0x5d9828,'voice',_0xd99b44[_0x18aef3][_0x400acf]);break;case 0x1:joinOrLeaveQueues(_0xc69019,_0x5d9828,_0x61ae('0x42'),_0xd99b44[_0x18aef3][_0x400acf]);break;case 0x2:joinOrLeaveQueues(_0xc69019,_0x5d9828,_0x61ae('0x43'),_0xd99b44[_0x18aef3][_0x400acf]);break;case 0x3:joinOrLeaveQueues(_0xc69019,_0x5d9828,_0x61ae('0x44'),_0xd99b44[_0x18aef3][_0x400acf]);break;case 0x4:joinOrLeaveQueues(_0xc69019,_0x5d9828,_0x61ae('0x45'),_0xd99b44[_0x18aef3][_0x400acf]);break;case 0x5:joinOrLeaveQueues(_0xc69019,_0x5d9828,_0x61ae('0x46'),_0xd99b44[_0x18aef3][_0x400acf]);break;case 0x6:joinOrLeaveQueues(_0xc69019,_0x5d9828,_0x61ae('0x47'),_0xd99b44[_0x18aef3][_0x400acf]);break;case 0x7:if(_0x481ced['role']!==_0x61ae('0x9'))_0xc69019[_0x5d9828](util[_0x61ae('0x1e')](_0x61ae('0x48'),_0xd99b44[_0x18aef3][_0x400acf][_0x61ae('0x5')]));break;case 0x8:if(_0x481ced[_0x61ae('0x8')]!==_0x61ae('0x9'))_0xc69019[_0x5d9828](util[_0x61ae('0x1e')]('trunk:%s',_0xd99b44[_0x18aef3][_0x400acf][_0x61ae('0x5')]));break;case 0x9:if(_0x481ced[_0x61ae('0x8')]!==_0x61ae('0x9'))_0xc69019[_0x5d9828](util[_0x61ae('0x1e')](_0x61ae('0x49'),_0xd99b44[_0x18aef3][_0x400acf]['type'],_0xd99b44[_0x18aef3][_0x400acf]['name']));break;case 0xa:_0xc69019[_0x5d9828](util[_0x61ae('0x1e')](_0x61ae('0x1f'),_0xd99b44[_0x18aef3][_0x400acf][_0x61ae('0x5')]));break;}}}}})[_0x61ae('0xb')](function(){if(_0x5d9828===_0x61ae('0x4a')){var _0xbe20c=_[_0x61ae('0x18')](_0x481ced[_0x61ae('0x24')],'id');return _0x481ced[_0x61ae('0x4b')](_0xbe20c)[_0x61ae('0xb')](function(){for(var _0x2d3124=0x0;_0x2d3124<_0xbe20c[_0x61ae('0x41')];_0x2d3124+=0x1){_0x2d3dd9[_0x61ae('0x4c')](_0x61ae('0x4d'),{'ChatInteractionId':Number(_0xbe20c[_0x2d3124]),'UserId':Number(_0x481ced['id'])});}});}})[_0x61ae('0xb')](function(){if(_0x5d9828===_0x61ae('0x4a')){var _0x478759=_[_0x61ae('0x18')](_0x481ced[_0x61ae('0x25')],'id');return _0x481ced[_0x61ae('0x4e')](_0x478759)[_0x61ae('0xb')](function(){for(var _0x35400e=0x0;_0x35400e<_0x478759[_0x61ae('0x41')];_0x35400e+=0x1){_0x2d3dd9['emit']('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x478759[_0x35400e]),'UserId':Number(_0x481ced['id'])});}});}})[_0x61ae('0xb')](function(){if(_0x5d9828===_0x61ae('0x4a')){var _0x32ba4b=_['map'](_0x481ced[_0x61ae('0x27')],'id');return _0x481ced['removeFaxInteractions'](_0x32ba4b)[_0x61ae('0xb')](function(){for(var _0x37055c=0x0;_0x37055c<_0x32ba4b[_0x61ae('0x41')];_0x37055c+=0x1){_0x2d3dd9[_0x61ae('0x4c')](_0x61ae('0x4f'),{'FaxInteractionId':Number(_0x32ba4b[_0x37055c]),'UserId':Number(_0x481ced['id'])});}});}})[_0x61ae('0xb')](function(){if(_0x5d9828==='leave'){var _0x455c81=_['map'](_0x481ced['SmsInteractions'],'id');return _0x481ced[_0x61ae('0x50')](_0x455c81)['then'](function(){for(var _0x2d3697=0x0;_0x2d3697<_0x455c81[_0x61ae('0x41')];_0x2d3697+=0x1){_0x2d3dd9['emit'](_0x61ae('0x51'),{'SmsInteractionId':Number(_0x455c81[_0x2d3697]),'UserId':Number(_0x481ced['id'])});}});}})['then'](function(){if(_0x5d9828==='leave'){var _0x4f6fd8=_[_0x61ae('0x18')](_0x481ced[_0x61ae('0x2b')],'id');return _0x481ced[_0x61ae('0x52')](_0x4f6fd8)[_0x61ae('0xb')](function(){for(var _0x59b5eb=0x0;_0x59b5eb<_0x4f6fd8[_0x61ae('0x41')];_0x59b5eb+=0x1){_0x2d3dd9['emit'](_0x61ae('0x53'),{'OpenchannelInteractionId':Number(_0x4f6fd8[_0x59b5eb]),'UserId':Number(_0x481ced['id'])});}});}})[_0x61ae('0xb')](function(){if(_0x5d9828===_0x61ae('0x4a')){var _0x1f6231=_['map'](_0x481ced[_0x61ae('0x2d')],'id');return _0x481ced[_0x61ae('0x54')](_0x1f6231)['then'](function(){for(var _0xbfb517=0x0;_0xbfb517<_0x1f6231[_0x61ae('0x41')];_0xbfb517+=0x1){_0x2d3dd9[_0x61ae('0x4c')](_0x61ae('0x55'),{'WhatsappInteractionId':Number(_0x1f6231[_0xbfb517]),'UserId':Number(_0x481ced['id'])});}});}})[_0x61ae('0x56')](function(_0x57e756){_0xc69019[_0x61ae('0x57')](_0x57e756);});}}function onDisconnect(_0xe60fbe,_0x4839b2){joinOrLeave(_0xe60fbe,_0x61ae('0x4a'),_0x4839b2);}function onConnect(_0x5ca248){joinOrLeave(_0x5ca248,_0x61ae('0x58'));}exports[_0x61ae('0x59')]=function(_0x47e711){_0x47e711['on'](_0x61ae('0x5a'),function(_0x30a29c){_0x30a29c['setMaxListeners'](0x0);_0x30a29c[_0x61ae('0x5b')]=_0x30a29c[_0x61ae('0x5c')]['connection'][_0x61ae('0x5d')]+':'+_0x30a29c[_0x61ae('0x5c')][_0x61ae('0x5a')][_0x61ae('0x5e')];_0x30a29c[_0x61ae('0x5f')]=new Date();_0x30a29c[_0x61ae('0x57')]=function(_0x446b51){console[_0x61ae('0x57')](_0x61ae('0x60')+_0x30a29c[_0x61ae('0x61')][_0x61ae('0x5')]+'['+_0x30a29c[_0x61ae('0x5b')]+']',_0x446b51);};_0x30a29c['on'](_0x61ae('0x62'),function(){onDisconnect(_0x30a29c,_0x47e711);_0x30a29c[_0x61ae('0x57')](_0x61ae('0x63'));});onConnect(_0x30a29c);_0x30a29c['log']('CONNECTED');});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index bde27f7..7f63c7f 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 _0xcd2a=['OpenchannelMessage','request','EventManager','then','info','Trigger,\x20%s','code','error','catch','get','event','direction','resolve','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','query','QueryTypes','SELECT','contact','UserId','undefined','format','SIP/%s','agent','channel','incomingmessage','outgoingmessage','AfterCreateMessage','motionChannel','opened','interface','name','changed','closed','substatus','Sequelize','AfterUpdate','User','find','fullname','email','internal','length','hasOwnProperty','model','hook','callback','toLowerCase','condition','util','jayson/promise','../logger','triggers','http','Chat','ChatInteraction','afterCreate','newinteraction','closedinteraction','newmessage','SmsInteraction','Sms','Whatsapp','Fax','FaxInteraction','afterUpdate','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0xcd2a,0xc2));var _0xacd2=function(_0x553150,_0x589ff3){_0x553150=_0x553150-0x0;var _0x18193d=_0xcd2a[_0x553150];return _0x18193d;};'use strict';var util=require(_0xacd2('0x0'));var db=require('../../mysqldb')['db'];var jayson=require(_0xacd2('0x1'));var logger=require(_0xacd2('0x2'))(_0xacd2('0x3'));var client=jayson['client'][_0xacd2('0x4')]({'port':0x232a});var triggers=[{'channel':_0xacd2('0x5'),'model':_0xacd2('0x6'),'event':_0xacd2('0x7'),'condition':_0xacd2('0x8'),'callback':afterCreate},{'channel':_0xacd2('0x5'),'model':_0xacd2('0x6'),'event':'afterUpdate','condition':_0xacd2('0x9'),'callback':afterUpdate},{'channel':_0xacd2('0x5'),'model':'ChatMessage','event':'afterCreate','condition':_0xacd2('0xa'),'callback':afterCreateMessage},{'channel':'Sms','model':_0xacd2('0xb'),'event':_0xacd2('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xacd2('0xc'),'model':_0xacd2('0xb'),'event':'afterUpdate','condition':_0xacd2('0x9'),'callback':afterUpdate},{'channel':'Sms','model':'SmsMessage','event':_0xacd2('0x7'),'condition':_0xacd2('0xa'),'callback':afterCreateMessage},{'channel':'Whatsapp','model':'WhatsappInteraction','event':_0xacd2('0x7'),'condition':_0xacd2('0x8'),'callback':afterCreate},{'channel':_0xacd2('0xd'),'model':'WhatsappInteraction','event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0xacd2('0xd'),'model':'WhatsappMessage','event':_0xacd2('0x7'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0xacd2('0xe'),'model':_0xacd2('0xf'),'event':_0xacd2('0x7'),'condition':_0xacd2('0x8'),'callback':afterCreate},{'channel':_0xacd2('0xe'),'model':_0xacd2('0xf'),'event':_0xacd2('0x10'),'condition':_0xacd2('0x9'),'callback':afterUpdate},{'channel':_0xacd2('0xe'),'model':'FaxMessage','event':_0xacd2('0x7'),'condition':_0xacd2('0xa'),'callback':afterCreateMessage},{'channel':'Mail','model':'MailInteraction','event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0xacd2('0x11'),'model':_0xacd2('0x12'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0xacd2('0x11'),'model':_0xacd2('0x13'),'event':_0xacd2('0x7'),'condition':_0xacd2('0xa'),'callback':afterCreateMessage},{'channel':_0xacd2('0x14'),'model':_0xacd2('0x15'),'event':_0xacd2('0x7'),'condition':_0xacd2('0x8'),'callback':afterCreate},{'channel':'Openchannel','model':'OpenchannelInteraction','event':_0xacd2('0x10'),'condition':_0xacd2('0x9'),'callback':afterUpdate},{'channel':_0xacd2('0x14'),'model':_0xacd2('0x16'),'event':_0xacd2('0x7'),'condition':'newmessage','callback':afterCreateMessage}];function request(_0x16b614){return client[_0xacd2('0x17')](_0xacd2('0x18'),_0x16b614)[_0xacd2('0x19')](function(_0x414d9a){logger[_0xacd2('0x1a')](_0xacd2('0x1b'),_0xacd2('0x18'),_0x414d9a);if(_0x414d9a['error']){if(_0x414d9a['error'][_0xacd2('0x1c')]===0x1f4){logger[_0xacd2('0x1d')]('Trigger,\x20%s',_0xacd2('0x18'),_0x414d9a['error']);}}})[_0xacd2('0x1e')](function(_0x4e442e){logger[_0xacd2('0x1d')](_0xacd2('0x1b'),_0xacd2('0x18'),_0x4e442e);});}function afterCreateMessage(_0x32dc1f){return function(_0x394f30){_0x394f30=_0x394f30[_0xacd2('0x1f')]({'plain':!![]});_0x394f30['channel']=_0x32dc1f;_0x394f30['motionChannel']=_0x32dc1f;_0x394f30[_0xacd2('0x20')]=_0x394f30[_0xacd2('0x21')];Promise[_0xacd2('0x22')]()['then'](function(){if(typeof _0x394f30['ContactId']==='undefined')return null;var _0x28d8c8=_0xacd2('0x23')+_0x394f30[_0xacd2('0x24')];return db[_0xacd2('0x25')][_0xacd2('0x26')](_0x28d8c8,{'type':db['Sequelize'][_0xacd2('0x27')][_0xacd2('0x28')],'raw':!![]});})[_0xacd2('0x19')](function(_0x4f8cd5){if(_0x4f8cd5){_0x394f30[_0xacd2('0x29')]=_0x4f8cd5[0x0];}if(typeof _0x394f30[_0xacd2('0x2a')]===_0xacd2('0x2b'))return;return getAgent(_0x394f30['UserId']);})[_0xacd2('0x19')](function(_0x10c4b1){if(_0x10c4b1){_0x394f30['interface']=util[_0xacd2('0x2c')](_0xacd2('0x2d'),_0x10c4b1['name']);_0x394f30[_0xacd2('0x2e')]=_0x10c4b1;_0x394f30[_0xacd2('0x2f')]=_0x32dc1f;return request({'event':_0xacd2('0x30'),'message':_0x394f30});}else{return request({'event':_0xacd2('0x31'),'message':_0x394f30});}})['catch'](function(_0xa3657c){logger[_0xacd2('0x1d')]('Trigger,\x20%s',_0xacd2('0x32'),_0xa3657c);});};}function afterCreate(_0x44abeb,_0x5723f7){return function(_0x583c30){_0x583c30=_0x583c30[_0xacd2('0x1f')]({'plain':!![]});_0x583c30['channel']=_0x44abeb;_0x583c30[_0xacd2('0x33')]=_0x44abeb;_0x583c30[_0xacd2('0x20')]=_0xacd2('0x34');Promise[_0xacd2('0x22')]()['then'](function(){var _0x358757=_0xacd2('0x23')+_0x583c30[_0xacd2('0x24')];return db[_0xacd2('0x25')][_0xacd2('0x26')](_0x358757,{'type':db['Sequelize'][_0xacd2('0x27')][_0xacd2('0x28')],'raw':!![]});})[_0xacd2('0x19')](function(_0x1596c6){if(_0x1596c6){_0x583c30[_0xacd2('0x29')]=_0x1596c6[0x0];}if(typeof _0x583c30[_0xacd2('0x2a')]===_0xacd2('0x2b'))return;return getAgent(_0x583c30['UserId']);})['then'](function(_0x2fcccc){if(_0x2fcccc){_0x583c30[_0xacd2('0x35')]=util['format'](_0xacd2('0x2d'),_0x2fcccc[_0xacd2('0x36')]);_0x583c30['agent']=_0x2fcccc;}return request({'event':_0x5723f7,'message':_0x583c30});})[_0xacd2('0x1e')](function(_0x5b6dec){logger[_0xacd2('0x1d')](_0xacd2('0x1b'),'AfterCreate',_0x5b6dec);});};}function afterUpdate(_0x38e127){return function(_0x2e5682){var _0x43f619=_0x2e5682['changed']('closed')&&_0x2e5682['closed'];var _0xa6b0c2=_0x2e5682[_0xacd2('0x37')]('substatus');if(_0x43f619||_0xa6b0c2){var _0x4848f8=_0x43f619?_0xacd2('0x9'):'substatus';var _0x516451=_0x2e5682['get']({'plain':!![]});_0x516451[_0xacd2('0x2f')]=_0x38e127;_0x516451[_0xacd2('0x33')]=_0x38e127;_0x516451[_0xacd2('0x20')]=_0x43f619?_0xacd2('0x38'):_0xacd2('0x39');var _0x25b62c='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x516451['ContactId'];return db[_0xacd2('0x25')][_0xacd2('0x26')](_0x25b62c,{'type':db[_0xacd2('0x3a')]['QueryTypes']['SELECT'],'raw':!![]})[_0xacd2('0x19')](function(_0x532f70){if(_0x532f70){_0x516451[_0xacd2('0x29')]=_0x532f70[0x0];}if(typeof _0x516451['UserId']===_0xacd2('0x2b'))return;return getAgent(_0x516451['UserId']);})['then'](function(_0x216644){if(_0x216644){_0x516451['interface']=util[_0xacd2('0x2c')](_0xacd2('0x2d'),_0x216644[_0xacd2('0x36')]);_0x516451[_0xacd2('0x2e')]=_0x216644;}return request({'event':_0x4848f8,'message':_0x516451});})[_0xacd2('0x1e')](function(_0x2705ac){logger[_0xacd2('0x1d')]('Trigger,\x20%s',_0xacd2('0x3b'),_0x2705ac);});}};}function getAgent(_0x11b3ee){return db[_0xacd2('0x3c')][_0xacd2('0x3d')]({'where':{'id':_0x11b3ee},'attributes':['id',_0xacd2('0x36'),_0xacd2('0x3e'),_0xacd2('0x3f'),_0xacd2('0x40')],'raw':!![]})[_0xacd2('0x19')](function(_0x1edbb5){return _0x1edbb5;});}exports['default']=function(){for(var _0x176f5f=0x0;_0x176f5f=_0x4512e4[_0x14ba('0x10')]){throw Error(_0x14ba('0x11'));}_0x1fd154(_0x3e4bd3);})[_0x14ba('0x12')](function(_0xa22845){_0x1711f9(_0xa22845);});});}; \ No newline at end of file +var _0x73e0=['then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','./license/util','voice','mail','chat','getChannels','isValidChannel','toLowerCase','isUndefined','blockedAt','updateAttributes','getLicense','role','agent'];(function(_0x319660,_0x1dd90e){var _0x4ff277=function(_0x383c71){while(--_0x383c71){_0x319660['push'](_0x319660['shift']());}};_0x4ff277(++_0x1dd90e);}(_0x73e0,0x1b4));var _0x073e=function(_0x44f4a9,_0x9b21ec){_0x44f4a9=_0x44f4a9-0x0;var _0x415ef8=_0x73e0[_0x44f4a9];return _0x415ef8;};'use strict';var _=require(_0x073e('0x0'));var BPromise=require('bluebird');var db=require('../mysqldb')['db'];var util=require(_0x073e('0x1'));var channels=[_0x073e('0x2'),_0x073e('0x3'),_0x073e('0x4'),'fax','sms','whatsapp','openchannel'];exports[_0x073e('0x5')]=function(){return channels;};exports[_0x073e('0x6')]=function(_0x48aa2b){_0x48aa2b=_0x48aa2b[_0x073e('0x7')]();return _['includes'](channels,_0x48aa2b);};exports['clearBlockUser']=function(_0x1ec9db,_0xfe519a,_0x3d2107,_0x102fb4){var _0x554a9f={'loginAttempts':_0xfe519a,'blocked':_0x3d2107};if(!_[_0x073e('0x8')](_0x102fb4)){_0x554a9f[_0x073e('0x9')]=_0x102fb4;}return _0x1ec9db[_0x073e('0xa')](_0x554a9f);};exports[_0x073e('0xb')]=function(_0xef6bfc){return new BPromise(function(_0x252596,_0x31df53){var _0x1dd1fb=0x0;if(_0xef6bfc[_0x073e('0xc')]!==_0x073e('0xd')){_0x252596(_0xef6bfc);}db['User']['count']({'where':{'role':'agent','online':!![],'id':{'$ne':_0xef6bfc['id']}}})['then'](function(_0x45ad3c){_0x1dd1fb=_0x45ad3c;return util[_0x073e('0xb')]();})[_0x073e('0xe')](function(_0x1b3c59){if(_0x1b3c59&&_0x1b3c59['agents']&&_0x1dd1fb>=_0x1b3c59[_0x073e('0xf')]){throw Error(_0x073e('0x10'));}_0x252596(_0xef6bfc);})[_0x073e('0x11')](function(_0x31398c){_0x31df53(_0x31398c);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 19b2f07..827a95a 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5b22=['render','json','send','exports','404','status'];(function(_0x21b20a,_0x35b4fe){var _0x309292=function(_0x4d5208){while(--_0x4d5208){_0x21b20a['push'](_0x21b20a['shift']());}};_0x309292(++_0x35b4fe);}(_0x5b22,0xab));var _0x25b2=function(_0x748ade,_0x3685b3){_0x748ade=_0x748ade-0x0;var _0x337cbb=_0x5b22[_0x748ade];return _0x337cbb;};'use strict';module[_0x25b2('0x0')][0x194]=function pageNotFound(_0x316d2e,_0x308e36){var _0x291c3a=_0x25b2('0x1');var _0x58f5b3=0x194;var _0x49b222={'status':_0x58f5b3};_0x308e36['status'](_0x49b222[_0x25b2('0x2')]);_0x308e36[_0x25b2('0x3')](_0x291c3a,{},function(_0x511b92,_0x1883ae){if(_0x511b92){return _0x308e36['status'](_0x49b222[_0x25b2('0x2')])[_0x25b2('0x4')](_0x49b222);}_0x308e36[_0x25b2('0x5')](_0x1883ae);});}; \ No newline at end of file +var _0xc674=['exports','404','status','send'];(function(_0x5bf137,_0x1f668c){var _0x21c280=function(_0x571bf5){while(--_0x571bf5){_0x5bf137['push'](_0x5bf137['shift']());}};_0x21c280(++_0x1f668c);}(_0xc674,0xe8));var _0x4c67=function(_0x15876a,_0x15383d){_0x15876a=_0x15876a-0x0;var _0xbd900f=_0xc674[_0x15876a];return _0xbd900f;};'use strict';module[_0x4c67('0x0')][0x194]=function pageNotFound(_0x1fab8a,_0x453974){var _0x41fbbc=_0x4c67('0x1');var _0x14c74e=0x194;var _0x3b5468={'status':_0x14c74e};_0x453974['status'](_0x3b5468[_0x4c67('0x2')]);_0x453974['render'](_0x41fbbc,{},function(_0xf5a775,_0x179fcd){if(_0xf5a775){return _0x453974[_0x4c67('0x2')](_0x3b5468['status'])['json'](_0x3b5468);}_0x453974[_0x4c67('0x3')](_0x179fcd);});}; \ No newline at end of file diff --git a/server/migrations/2.5.39.js b/server/migrations/2.5.39.js index 631679b..b96d47f 100644 --- a/server/migrations/2.5.39.js +++ b/server/migrations/2.5.39.js @@ -205,6 +205,12 @@ module.exports = { migration.query('UPDATE mail_servers_in SET host = \'outlook.office365.com\' WHERE service = \'outlook365\' AND host IS NULL'); migration.query('UPDATE mail_servers_in SET port = 993 WHERE service = \'outlook365\' AND port IS NULL'); + migration.addColumn('mail_servers_in', 'modernAuthentication', { + type: Sequelize.BOOLEAN, + defaultValue: false, + after: 'authentication' + }); + migration.addColumn('mail_servers_in', 'CloudProviderId', { type: Sequelize.INTEGER }); @@ -228,6 +234,12 @@ module.exports = { migration.query('UPDATE mail_servers_out SET host = \'smtp.office365.com\' WHERE service = \'outlook365\' AND host IS NULL'); migration.query('UPDATE mail_servers_out SET port = 587 WHERE service = \'outlook365\' AND port IS NULL'); + migration.addColumn('mail_servers_out', 'modernAuthentication', { + type: Sequelize.BOOLEAN, + defaultValue: false, + after: 'authentication' + }); + migration.addColumn('mail_servers_out', 'CloudProviderId', { type: Sequelize.INTEGER }); diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 38aa45f..a186c8d 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb2b3=['sms_interaction_has_tags','ThroughTags','OpenchannelAccountId','openchannel_interaction_has_tags','OpenchannelInteractionId','OpenchannelQueueId','team_has_openchannel_queues','ProactiveActions','user_has_chat_websites','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','CompanyId','JscriptySessions','cm_contact_has_tags','OwnerId','All','OneAll','AutomationAllId','OneAny','AutomationAnyId','Actions','AutomationId','ParentId','MailApplications','ChatApplications','FaxApplications','DefaultReportId','CustomReportId','Mohs','moh_has_sounds','whatsapp_interaction_has_tags','Trigger','AllConditions','AllCondition','TriggerAllId','AnyCondition','Fields','AnalyticMetric','MetricId','SalesforceAccount','Configurations','AccountId','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Description','Field','Variable','VariableId','SugarcrmAccount','int_desk_configuration_has_tags','ZendeskField','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','ServicenowAccount','Dynamics365Configuration','ChatInternalMessage','FromId','ToId','SessionId','ProjectId','user_has_teams','ChatQueues','SmsQueues','team_has_whatsapp_queues','WhatsappQueues','VoicePrefixes','CampaignId','TrunkBackupId','SquareProjectId','campaigns_has_cm_lists','BlackLists','campaigns_has_cm_blacklists','FromMailAccountId','FromUserId','ToMailQueueId','ToAccount','FromChatWebsiteId','FromAgent','ToUserId','ToAgent','ToQueue','ToChatWebsiteId','FromFaxAccountId','FromAccount','ToFaxQueueId','FromOpenchannelAccountId','ToOpenchannelQueueId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','UserProfileSections','sectionId','WhatsappAccountId','user_has_whatsapp_accounts','WhatsappInteractionId','user_has_whatsapp_interactions','WhatsappTransferReport','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','Smtp','exports','../config/environment','sequelize','lodash','jstz','determine','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','database','username','password','options','User','../api/user/user.model','import','../api/voiceContext/voiceContext.model','VoiceExtension','VoiceMusicOnHold','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','VoiceMail','VoiceMailMessage','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboardItem/dashboardItem.model','FaxAccount','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','FaxMessage','FaxQueue','../api/faxQueue/faxQueue.model','SmsAccount','../api/smsAccount/smsAccount.model','../api/smsApplication/smsApplication.model','SmsInteraction','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','../api/template/template.model','../api/trigger/trigger.model','../api/variable/variable.model','Integration','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','SalesforceField','../api/intSalesforceField/intSalesforceField.model','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','Network','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/squareOdbc/squareOdbc.model','../api/squareProject/squareProject.model','SquareRecording','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','Migration','../api/attachment/attachment.model','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','WhatsappApplication','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','cascade','hasMany','Recordings','UserId','VoiceQueuesRt','Extensions','HopperHistory','ReportAgentPreview','OpenchannelInteraction','OpenchannelInteractions','ChatInteractions','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotifications','belongsTo','userProfileId','belongsToMany','chat_group_has_users','CmContact','Contacts','Lists','user_has_mail_interactions','user_has_chat_interactions','SmsInteractions','user_has_sms_interactions','user_has_openchannel_interactions','VoiceQueues','UserVoiceQueue','MailQueues','UserMailQueue','FaxQueues','OpenchannelQueue','OpenchannelQueues','UserOpenchannelQueue','CmList','cm_user_has_lists','ChatWebsites','FaxAccounts','user_has_fax_accounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','SquareProject','user_has_square_projects','SpiedAgents','ChanSpyId','VoiceContext','Applications','Sounds','Members','Hoppers','VoiceQueueId','CmHopperFinal','HopperFinals','HopperHistories','HopperBlacks','TrunkId','TrunkBackup','Interval','IntervalId','mandatoryDispositionPause','Agents','Teams','Messages','mailbox','mailboxuser','QueueCalls','uniqueid','AgentReports','ContactId','MailAccountId','CloudProvider','CloudProviderId','restrict','Imap','Disposition','Dispositions','ListId','TemplateId','mandatoryDispositionPauseId','team_has_mail_queues','Account','Contact','Owner','mail_interaction_has_tags','Tags','Users','MailInteractionId','Attachment','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessage','ChatOfflineMessageId','TagId','List','Items','FaxAccountId','Interactions','Exntensions','Pause','FaxInteractionId','fax_interaction_has_tags','user_has_fax_interactions','AttachmentId','team_has_fax_queues','FaxQueueReport','SmsAccountId','Answers','SmsApplication','SmsInteractionId'];(function(_0x53db86,_0x1ebc68){var _0x3121ba=function(_0x12fb7d){while(--_0x12fb7d){_0x53db86['push'](_0x53db86['shift']());}};_0x3121ba(++_0x1ebc68);}(_0xb2b3,0x71));var _0x3b2b=function(_0x5d97eb,_0x2143b4){_0x5d97eb=_0x5d97eb-0x0;var _0x35c719=_0xb2b3[_0x5d97eb];return _0x35c719;};'use strict';var config=require(_0x3b2b('0x0'));var Sequelize=require(_0x3b2b('0x1'));var _=require(_0x3b2b('0x2'));var jstz=require(_0x3b2b('0x3'));var timezone=jstz[_0x3b2b('0x4')]();config[_0x3b2b('0x1')]=_[_0x3b2b('0x5')](config['sequelize'],{'database':_0x3b2b('0x6'),'username':_0x3b2b('0x7'),'password':_0x3b2b('0x8'),'options':{'host':_0x3b2b('0x9'),'port':0xcea,'dialect':_0x3b2b('0xa'),'dialectOptions':{'charset':_0x3b2b('0xb')},'logging':![],'timezone':timezone[_0x3b2b('0xc')](),'define':{'charset':_0x3b2b('0xd'),'collate':_0x3b2b('0xe')}}});config[_0x3b2b('0xf')]=_[_0x3b2b('0x5')](config[_0x3b2b('0xf')],{'database':'motion2','username':_0x3b2b('0x7'),'password':_0x3b2b('0x8'),'options':{'host':_0x3b2b('0x9'),'port':0xcea,'dialect':_0x3b2b('0xa'),'dialectOptions':{'charset':_0x3b2b('0xb')},'logging':![],'timezone':timezone[_0x3b2b('0xc')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x3b2b('0x1')][_0x3b2b('0x10')],config[_0x3b2b('0x1')][_0x3b2b('0x11')],config['sequelize'][_0x3b2b('0x12')],config[_0x3b2b('0x1')][_0x3b2b('0x13')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x3b2b('0xf')][_0x3b2b('0x10')],config[_0x3b2b('0xf')]['username'],config[_0x3b2b('0xf')][_0x3b2b('0x12')],config['sequelizeHistory'][_0x3b2b('0x13')])};db[_0x3b2b('0x14')]=db[_0x3b2b('0x1')]['import'](_0x3b2b('0x15'));db['VoiceChanSpy']=db[_0x3b2b('0x1')][_0x3b2b('0x16')]('../api/voiceChanSpy/voiceChanSpy.model');db['VoiceContext']=db[_0x3b2b('0x1')]['import'](_0x3b2b('0x17'));db[_0x3b2b('0x18')]=db['sequelize'][_0x3b2b('0x16')]('../api/voiceExtension/voiceExtension.model');db[_0x3b2b('0x19')]=db[_0x3b2b('0x1')]['import']('../api/voiceMusicOnHold/voiceMusicOnHold.model');db[_0x3b2b('0x1a')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0x1b'));db[_0x3b2b('0x1c')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0x1d'));db[_0x3b2b('0x1e')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')]('../api/screenRecording/screenRecording.model');db[_0x3b2b('0x1f')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')]('../api/voiceMail/voiceMail.model');db[_0x3b2b('0x20')]=db['sequelize'][_0x3b2b('0x16')]('../api/voiceMailMessage/voiceMailMessage.model');db[_0x3b2b('0x21')]=db['sequelize']['import'](_0x3b2b('0x22'));db[_0x3b2b('0x23')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0x24'));db[_0x3b2b('0x25')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0x26'));db['VoiceQueueReport']=db['sequelize']['import']('../api/voiceQueueReport/voiceQueueReport.model');db[_0x3b2b('0x27')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0x28'));db[_0x3b2b('0x29')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')]('../api/trunk/trunk.model');db[_0x3b2b('0x2a')]=db['sequelize']['import'](_0x3b2b('0x2b'));db[_0x3b2b('0x2c')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db['UserVoiceQueue']=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0x2d'));db[_0x3b2b('0x2e')]=db[_0x3b2b('0x1')]['import'](_0x3b2b('0x2f'));db['UserMailQueue']=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0x30'));db[_0x3b2b('0x31')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0x32'));db[_0x3b2b('0x33')]=db['sequelize']['import'](_0x3b2b('0x34'));db['UserOpenchannelQueue']=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0x35'));db[_0x3b2b('0x36')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0x37'));db[_0x3b2b('0x38')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')]('../api/mailServerIn/mailServerIn.model');db[_0x3b2b('0x39')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0x3a'));db[_0x3b2b('0x3b')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0x3c'));db[_0x3b2b('0x3d')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0x3e'));db[_0x3b2b('0x3f')]=db[_0x3b2b('0x1')]['import'](_0x3b2b('0x40'));db[_0x3b2b('0x41')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0x42'));db[_0x3b2b('0x43')]=db[_0x3b2b('0x1')]['import']('../api/mailMessage/mailMessage.model');db[_0x3b2b('0x44')]=db['sequelize'][_0x3b2b('0x16')](_0x3b2b('0x45'));db[_0x3b2b('0x46')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0x47'));db[_0x3b2b('0x48')]=db[_0x3b2b('0x1')]['import']('../api/dashboard/dashboard.model');db['DashboardItem']=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0x49'));db[_0x3b2b('0x4a')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')]('../api/faxAccount/faxAccount.model');db[_0x3b2b('0x4b')]=db['sequelize'][_0x3b2b('0x16')](_0x3b2b('0x4c'));db[_0x3b2b('0x4d')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')]('../api/faxInteraction/faxInteraction.model');db[_0x3b2b('0x4e')]=db['sequelize'][_0x3b2b('0x16')]('../api/faxMessage/faxMessage.model');db[_0x3b2b('0x4f')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0x50'));db['FaxQueueReport']=db['sequelize'][_0x3b2b('0x16')]('../api/faxQueueReport/faxQueueReport.model');db[_0x3b2b('0x51')]=db[_0x3b2b('0x1')]['import'](_0x3b2b('0x52'));db['SmsApplication']=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0x53'));db[_0x3b2b('0x54')]=db[_0x3b2b('0x1')]['import']('../api/smsInteraction/smsInteraction.model');db[_0x3b2b('0x55')]=db[_0x3b2b('0x1')]['import'](_0x3b2b('0x56'));db[_0x3b2b('0x57')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0x58'));db[_0x3b2b('0x59')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0x5a'));db[_0x3b2b('0x5b')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0x5c'));db['OpenchannelInteraction']=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0x5d'));db[_0x3b2b('0x5e')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0x5f'));db['OpenchannelQueue']=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0x60'));db[_0x3b2b('0x61')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0x62'));db[_0x3b2b('0x63')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0x64'));db[_0x3b2b('0x65')]=db[_0x3b2b('0x1')]['import'](_0x3b2b('0x66'));db[_0x3b2b('0x67')]=db['sequelize'][_0x3b2b('0x16')](_0x3b2b('0x68'));db[_0x3b2b('0x69')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0x6a'));db['ChatOfflineMessage']=db['sequelize'][_0x3b2b('0x16')](_0x3b2b('0x6b'));db[_0x3b2b('0x6c')]=db['sequelize'][_0x3b2b('0x16')](_0x3b2b('0x6d'));db[_0x3b2b('0x6e')]=db[_0x3b2b('0x1')]['import'](_0x3b2b('0x6f'));db[_0x3b2b('0x70')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0x71'));db[_0x3b2b('0x72')]=db['sequelize'][_0x3b2b('0x16')](_0x3b2b('0x73'));db['CmContact']=db['sequelize'][_0x3b2b('0x16')](_0x3b2b('0x74'));db[_0x3b2b('0x75')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0x76'));db[_0x3b2b('0x77')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0x78'));db['CmHopperFinal']=db[_0x3b2b('0x1')]['import'](_0x3b2b('0x79'));db[_0x3b2b('0x7a')]=db['sequelize']['import'](_0x3b2b('0x7b'));db['ReportAgentPreview']=db['sequelize'][_0x3b2b('0x16')]('../api/reportAgentPreview/reportAgentPreview.model');db[_0x3b2b('0x7c')]=db['sequelize'][_0x3b2b('0x16')](_0x3b2b('0x7d'));db[_0x3b2b('0x7e')]=db[_0x3b2b('0x1')]['import']('../api/action/action.model');db[_0x3b2b('0x7f')]=db[_0x3b2b('0x1')]['import'](_0x3b2b('0x80'));db[_0x3b2b('0x81')]=db['sequelize'][_0x3b2b('0x16')](_0x3b2b('0x82'));db['Disposition']=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0x83'));db[_0x3b2b('0x84')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0x85'));db['Interval']=db[_0x3b2b('0x1')][_0x3b2b('0x16')]('../api/interval/interval.model');db['Pause']=db[_0x3b2b('0x1')]['import'](_0x3b2b('0x86'));db[_0x3b2b('0x87')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0x88'));db[_0x3b2b('0x89')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0x8a'));db[_0x3b2b('0x8b')]=db[_0x3b2b('0x1')]['import'](_0x3b2b('0x8c'));db[_0x3b2b('0x8d')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0x8e'));db[_0x3b2b('0x8f')]=db[_0x3b2b('0x1')]['import'](_0x3b2b('0x90'));db[_0x3b2b('0x91')]=db['sequelize'][_0x3b2b('0x16')](_0x3b2b('0x92'));db['Trigger']=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0x93'));db['Variable']=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0x94'));db[_0x3b2b('0x95')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')]('../api/integration/integration.model');db[_0x3b2b('0x96')]=db[_0x3b2b('0x1')]['import'](_0x3b2b('0x97'));db[_0x3b2b('0x98')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0x99'));db[_0x3b2b('0x9a')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0x9b'));db['AnalyticExtractedReport']=db[_0x3b2b('0x1')][_0x3b2b('0x16')]('../api/analyticExtractedReport/analyticExtractedReport.model');db['AnalyticMetric']=db[_0x3b2b('0x1')]['import'](_0x3b2b('0x9c'));db[_0x3b2b('0x9d')]=db['sequelize'][_0x3b2b('0x16')](_0x3b2b('0x9e'));db['AnalyticTreeReport']=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0x9f'));db['SalesforceAccount']=db['sequelize'][_0x3b2b('0x16')](_0x3b2b('0xa0'));db[_0x3b2b('0xa1')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0x3b2b('0xa2')]=db['sequelize'][_0x3b2b('0x16')](_0x3b2b('0xa3'));db['SugarcrmAccount']=db[_0x3b2b('0x1')]['import'](_0x3b2b('0xa4'));db[_0x3b2b('0xa5')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0xa6'));db[_0x3b2b('0xa7')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0xa8'));db[_0x3b2b('0xa9')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')]('../api/intDeskAccount/intDeskAccount.model');db[_0x3b2b('0xaa')]=db['sequelize'][_0x3b2b('0x16')](_0x3b2b('0xab'));db[_0x3b2b('0xac')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0xad'));db[_0x3b2b('0xae')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0xaf'));db[_0x3b2b('0xb0')]=db[_0x3b2b('0x1')]['import'](_0x3b2b('0xb1'));db[_0x3b2b('0xb2')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')]('../api/intZohoField/intZohoField.model');db[_0x3b2b('0xb3')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0xb4'));db[_0x3b2b('0xb5')]=db[_0x3b2b('0x1')]['import'](_0x3b2b('0xb6'));db['ZendeskField']=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0xb7'));db[_0x3b2b('0xb8')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0xb9'));db[_0x3b2b('0xba')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0xbb'));db[_0x3b2b('0xbc')]=db['sequelize'][_0x3b2b('0x16')](_0x3b2b('0xbd'));db[_0x3b2b('0xbe')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0xbf'));db[_0x3b2b('0xc0')]=db[_0x3b2b('0x1')]['import'](_0x3b2b('0xc1'));db[_0x3b2b('0xc2')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')]('../api/intVtigerField/intVtigerField.model');db['ServicenowAccount']=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0xc3'));db[_0x3b2b('0xc4')]=db['sequelize'][_0x3b2b('0x16')](_0x3b2b('0xc5'));db[_0x3b2b('0xc6')]=db['sequelize'][_0x3b2b('0x16')](_0x3b2b('0xc7'));db[_0x3b2b('0xc8')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0xc9'));db['Dynamics365Configuration']=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0xca'));db[_0x3b2b('0xcb')]=db['sequelize']['import'](_0x3b2b('0xcc'));db[_0x3b2b('0xcd')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')]('../api/intFreshsalesAccount/intFreshsalesAccount.model');db[_0x3b2b('0xce')]=db['sequelize']['import'](_0x3b2b('0xcf'));db[_0x3b2b('0xd0')]=db[_0x3b2b('0x1')]['import']('../api/intFreshsalesField/intFreshsalesField.model');db[_0x3b2b('0x95')]=db['sequelize']['import']('../api/integration/integration.model');db[_0x3b2b('0xd1')]=db['sequelize'][_0x3b2b('0x16')]('../api/network/network.model');db[_0x3b2b('0xd2')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0xd3'));db['ChatInternalMessage']=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0xd4'));db[_0x3b2b('0xd5')]=db[_0x3b2b('0x1')]['import']('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0x3b2b('0xd6')]=db['sequelize'][_0x3b2b('0x16')](_0x3b2b('0xd7'));db[_0x3b2b('0xd8')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0xd9'));db[_0x3b2b('0xda')]=db['sequelize'][_0x3b2b('0x16')](_0x3b2b('0xdb'));db['SquareReport']=db['sequelize'][_0x3b2b('0x16')](_0x3b2b('0xdc'));db[_0x3b2b('0xdd')]=db['sequelize'][_0x3b2b('0x16')](_0x3b2b('0xde'));db[_0x3b2b('0xdf')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0xe0'));db[_0x3b2b('0xe1')]=db[_0x3b2b('0x1')]['import']('../api/setting/setting.model');db['SquareOdbc']=db[_0x3b2b('0x1')]['import'](_0x3b2b('0xe2'));db['SquareProject']=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0xe3'));db[_0x3b2b('0xe4')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')]('../api/squareRecording/squareRecording.model');db['SquareMessage']=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0xe5'));db[_0x3b2b('0xe6')]=db['sequelize']['import'](_0x3b2b('0xe7'));db[_0x3b2b('0xe8')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0xe9'));db[_0x3b2b('0xea')]=db['sequelize'][_0x3b2b('0x16')]('../api/campaign/campaign.model');db[_0x3b2b('0xeb')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')]('../api/migration/migration.model');db['Attachment']=db['sequelize'][_0x3b2b('0x16')](_0x3b2b('0xec'));db['Plugin']=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0xed'));db[_0x3b2b('0xee')]=db['sequelize'][_0x3b2b('0x16')](_0x3b2b('0xef'));db[_0x3b2b('0xf0')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0xf1'));db[_0x3b2b('0xf2')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0xf3'));db[_0x3b2b('0xf4')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0xf5'));db[_0x3b2b('0xf6')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0xf7'));db['CmList']=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0xf8'));db[_0x3b2b('0xf9')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0xfa'));db[_0x3b2b('0xfb')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0xfc'));db[_0x3b2b('0xfd')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0xfe'));db[_0x3b2b('0xff')]=db[_0x3b2b('0x1')]['import'](_0x3b2b('0x100'));db[_0x3b2b('0x101')]=db['sequelize'][_0x3b2b('0x16')](_0x3b2b('0x102'));db[_0x3b2b('0x103')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')]('../api/whatsappAccount/whatsappAccount.model');db[_0x3b2b('0x104')]=db['sequelize']['import']('../api/whatsappApplication/whatsappApplication.model');db[_0x3b2b('0x105')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0x106'));db[_0x3b2b('0x107')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0x108'));db[_0x3b2b('0x109')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0x10a'));db['WhatsappTransferReport']=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0x10b'));db[_0x3b2b('0x10c')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')](_0x3b2b('0x10d'));db['CloudProvider']=db[_0x3b2b('0x1')]['import'](_0x3b2b('0x10e'));db[_0x3b2b('0x10f')]=db['sequelize'][_0x3b2b('0x16')](_0x3b2b('0x110'));db[_0x3b2b('0x111')]=db[_0x3b2b('0x1')][_0x3b2b('0x16')]('../api/teamVoicePrefix/teamVoicePrefix.model');db['UserVoicePrefix']=db['sequelize']['import'](_0x3b2b('0x112'));db[_0x3b2b('0x14')][_0x3b2b('0x113')](db[_0x3b2b('0x1f')],{'as':_0x3b2b('0x1f'),'onDelete':_0x3b2b('0x114'),'foreignKey':'UserId'});db['User'][_0x3b2b('0x115')](db['VoiceRecording'],{'as':_0x3b2b('0x116'),'foreignKey':_0x3b2b('0x117')});db['User'][_0x3b2b('0x115')](db[_0x3b2b('0x2c')],{'as':_0x3b2b('0x118'),'foreignKey':'UserId'});db[_0x3b2b('0x14')][_0x3b2b('0x115')](db[_0x3b2b('0x18')],{'as':_0x3b2b('0x119'),'onDelete':_0x3b2b('0x114'),'hooks':!![]});db['User'][_0x3b2b('0x115')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0x3b2b('0x117')});db['User'][_0x3b2b('0x115')](db[_0x3b2b('0x7a')],{'as':_0x3b2b('0x11a'),'foreignKey':_0x3b2b('0x117')});db[_0x3b2b('0x14')][_0x3b2b('0x115')](db[_0x3b2b('0x11b')],{'as':_0x3b2b('0x11b'),'foreignKey':'UserId'});db['User'][_0x3b2b('0x115')](db[_0x3b2b('0x11c')],{'as':_0x3b2b('0x11d'),'foreignKey':_0x3b2b('0x117')});db[_0x3b2b('0x14')][_0x3b2b('0x115')](db[_0x3b2b('0x67')],{'as':_0x3b2b('0x11e'),'foreignKey':_0x3b2b('0x117')});db['User'][_0x3b2b('0x115')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0x3b2b('0x117')});db[_0x3b2b('0x14')]['hasMany'](db[_0x3b2b('0x4d')],{'as':_0x3b2b('0x11f'),'foreignKey':_0x3b2b('0x117')});db['User'][_0x3b2b('0x115')](db[_0x3b2b('0x41')],{'as':_0x3b2b('0x120'),'foreignKey':_0x3b2b('0x117')});db[_0x3b2b('0x14')][_0x3b2b('0x115')](db[_0x3b2b('0x105')],{'as':_0x3b2b('0x121'),'foreignKey':_0x3b2b('0x117')});db[_0x3b2b('0x14')][_0x3b2b('0x115')](db['UserNotification'],{'as':_0x3b2b('0x122'),'foreignKey':'SenderId'});db[_0x3b2b('0x14')][_0x3b2b('0x123')](db[_0x3b2b('0xfb')],{'as':_0x3b2b('0xfb'),'foreignKey':_0x3b2b('0x124')});db['User'][_0x3b2b('0x125')](db['ChatGroup'],{'as':'Groups','through':_0x3b2b('0x126')});db[_0x3b2b('0x14')][_0x3b2b('0x125')](db[_0x3b2b('0x127')],{'as':_0x3b2b('0x128'),'through':'cm_user_has_contacts'});db['User'][_0x3b2b('0x125')](db['CmList'],{'as':_0x3b2b('0x129'),'through':'cm_user_has_lists'});db['User'][_0x3b2b('0x125')](db[_0x3b2b('0xe6')],{'through':'user_has_teams'});db[_0x3b2b('0x14')]['belongsToMany'](db[_0x3b2b('0x41')],{'as':_0x3b2b('0x120'),'through':_0x3b2b('0x12a')});db[_0x3b2b('0x14')][_0x3b2b('0x125')](db[_0x3b2b('0x67')],{'as':_0x3b2b('0x11e'),'through':_0x3b2b('0x12b')});db[_0x3b2b('0x14')][_0x3b2b('0x125')](db['FaxInteraction'],{'as':_0x3b2b('0x11f'),'through':'user_has_fax_interactions'});db['User'][_0x3b2b('0x125')](db[_0x3b2b('0x54')],{'as':_0x3b2b('0x12c'),'through':_0x3b2b('0x12d')});db[_0x3b2b('0x14')][_0x3b2b('0x125')](db[_0x3b2b('0x11c')],{'as':_0x3b2b('0x11d'),'through':_0x3b2b('0x12e')});db[_0x3b2b('0x14')][_0x3b2b('0x125')](db[_0x3b2b('0x105')],{'as':_0x3b2b('0x121'),'through':'user_has_whatsapp_interactions'});db[_0x3b2b('0x14')][_0x3b2b('0x125')](db[_0x3b2b('0x1a')],{'as':_0x3b2b('0x12f'),'through':_0x3b2b('0x130'),'required':![]});db[_0x3b2b('0x14')][_0x3b2b('0x125')](db[_0x3b2b('0xf9')],{'as':'VoicePrefixes','through':'UserVoicePrefix','required':![]});db[_0x3b2b('0x14')][_0x3b2b('0x125')](db['MailQueue'],{'as':_0x3b2b('0x131'),'through':_0x3b2b('0x132'),'required':![]});db[_0x3b2b('0x14')]['belongsToMany'](db[_0x3b2b('0x6c')],{'as':'ChatQueues','through':_0x3b2b('0x2e'),'required':![],'hooks':!![]});db['User'][_0x3b2b('0x125')](db['FaxQueue'],{'as':_0x3b2b('0x133'),'through':_0x3b2b('0x31'),'required':![]});db[_0x3b2b('0x14')][_0x3b2b('0x125')](db['SmsQueue'],{'as':'SmsQueues','through':_0x3b2b('0x33'),'required':![]});db[_0x3b2b('0x14')][_0x3b2b('0x125')](db[_0x3b2b('0x134')],{'as':_0x3b2b('0x135'),'through':_0x3b2b('0x136'),'required':![]});db[_0x3b2b('0x14')][_0x3b2b('0x125')](db[_0x3b2b('0x10c')],{'as':'WhatsappQueues','through':_0x3b2b('0x36'),'required':![]});db[_0x3b2b('0x14')][_0x3b2b('0x125')](db[_0x3b2b('0x137')],{'through':_0x3b2b('0x138')});db[_0x3b2b('0x14')][_0x3b2b('0x125')](db[_0x3b2b('0x61')],{'as':_0x3b2b('0x139'),'through':'user_has_chat_websites'});db['User'][_0x3b2b('0x125')](db[_0x3b2b('0x4a')],{'as':_0x3b2b('0x13a'),'through':_0x3b2b('0x13b')});db['User'][_0x3b2b('0x125')](db[_0x3b2b('0x3b')],{'as':'MailAccounts','through':_0x3b2b('0x13c')});db[_0x3b2b('0x14')][_0x3b2b('0x125')](db['OpenchannelAccount'],{'as':_0x3b2b('0x13d'),'through':_0x3b2b('0x13e')});db[_0x3b2b('0x14')][_0x3b2b('0x125')](db[_0x3b2b('0x51')],{'as':_0x3b2b('0x13f'),'through':_0x3b2b('0x140')});db[_0x3b2b('0x14')][_0x3b2b('0x125')](db[_0x3b2b('0x103')],{'as':_0x3b2b('0x141'),'through':'user_has_whatsapp_accounts'});db[_0x3b2b('0x14')][_0x3b2b('0x125')](db[_0x3b2b('0x142')],{'as':'SquareProjects','through':_0x3b2b('0x143')});db['VoiceChanSpy']['hasMany'](db['VoiceExtension'],{'as':_0x3b2b('0x144'),'onDelete':_0x3b2b('0x114'),'foreignKey':_0x3b2b('0x145')});db[_0x3b2b('0x146')]['hasMany'](db[_0x3b2b('0x18')],{'onDelete':'cascade'});db['VoiceExtension'][_0x3b2b('0x115')](db[_0x3b2b('0x18')],{'as':_0x3b2b('0x147'),'onDelete':_0x3b2b('0x114')});db[_0x3b2b('0x19')]['belongsToMany'](db[_0x3b2b('0x8d')],{'as':_0x3b2b('0x148'),'through':'moh_has_sounds'});db[_0x3b2b('0x1a')][_0x3b2b('0x115')](db[_0x3b2b('0x2c')],{'as':_0x3b2b('0x149'),'foreignKey':'VoiceQueueId'});db[_0x3b2b('0x1a')][_0x3b2b('0x115')](db[_0x3b2b('0x75')],{'as':_0x3b2b('0x14a'),'foreignKey':_0x3b2b('0x14b')});db[_0x3b2b('0x1a')][_0x3b2b('0x115')](db[_0x3b2b('0x14c')],{'as':_0x3b2b('0x14d'),'foreignKey':_0x3b2b('0x14b')});db[_0x3b2b('0x1a')][_0x3b2b('0x115')](db['CmHopperHistory'],{'as':_0x3b2b('0x14e'),'foreignKey':_0x3b2b('0x14b')});db[_0x3b2b('0x1a')][_0x3b2b('0x115')](db[_0x3b2b('0x11b')],{'as':_0x3b2b('0x11b'),'foreignKey':_0x3b2b('0x14b')});db[_0x3b2b('0x1a')][_0x3b2b('0x115')](db['CmHopperBlack'],{'as':_0x3b2b('0x14f'),'foreignKey':'VoiceQueueId'});db[_0x3b2b('0x1a')]['hasMany'](db[_0x3b2b('0xd8')],{'as':'JscriptySessions','foreignKey':_0x3b2b('0x14b')});db[_0x3b2b('0x1a')]['belongsTo'](db[_0x3b2b('0x29')],{'as':_0x3b2b('0x29'),'foreignKey':_0x3b2b('0x150')});db[_0x3b2b('0x1a')][_0x3b2b('0x123')](db[_0x3b2b('0x29')],{'as':_0x3b2b('0x151'),'foreignKey':'TrunkBackupId'});db['VoiceQueue'][_0x3b2b('0x123')](db[_0x3b2b('0x152')],{'as':_0x3b2b('0x152'),'foreignKey':_0x3b2b('0x153')});db['VoiceQueue'][_0x3b2b('0x123')](db['Pause'],{'as':_0x3b2b('0x154'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x3b2b('0x1a')][_0x3b2b('0x125')](db['CmList'],{'as':_0x3b2b('0x129'),'through':'voice_queues_has_cm_lists'});db[_0x3b2b('0x1a')][_0x3b2b('0x125')](db[_0x3b2b('0x14')],{'as':_0x3b2b('0x155'),'through':_0x3b2b('0x130')});db[_0x3b2b('0x1a')][_0x3b2b('0x125')](db['Team'],{'as':_0x3b2b('0x156'),'through':_0x3b2b('0x10f')});db[_0x3b2b('0x1a')][_0x3b2b('0x125')](db['CmList'],{'as':'BlackLists','through':'voice_queues_has_cm_blacklists'});db['VoiceRecording']['belongsTo'](db[_0x3b2b('0x14')],{'as':'User','foreignKey':_0x3b2b('0x117')});db[_0x3b2b('0x1e')]['belongsTo'](db[_0x3b2b('0x14')],{'as':_0x3b2b('0x14'),'foreignKey':_0x3b2b('0x117')});db[_0x3b2b('0x1f')][_0x3b2b('0x115')](db[_0x3b2b('0x20')],{'as':_0x3b2b('0x157'),'onDelete':_0x3b2b('0x114'),'foreignKey':'mailboxuser','sourceKey':_0x3b2b('0x158')});db[_0x3b2b('0x20')]['belongsTo'](db[_0x3b2b('0x1f')],{'foreignKey':_0x3b2b('0x159'),'targetKey':_0x3b2b('0x158')});db[_0x3b2b('0x21')][_0x3b2b('0x115')](db['VoiceQueueReport'],{'as':_0x3b2b('0x15a'),'foreignKey':_0x3b2b('0x15b'),'constraints':![]});db[_0x3b2b('0x21')]['hasMany'](db[_0x3b2b('0x25')],{'as':_0x3b2b('0x15c'),'foreignKey':_0x3b2b('0x15b'),'constraints':![]});db[_0x3b2b('0x21')]['belongsTo'](db[_0x3b2b('0x14')],{'as':_0x3b2b('0x14'),'foreignKey':'UserId'});db['VoiceCallReport']['belongsTo'](db[_0x3b2b('0x127')],{'as':'Contact','foreignKey':_0x3b2b('0x15d')});db[_0x3b2b('0x38')]['belongsTo'](db['MailAccount'],{'as':_0x3b2b('0x3b'),'foreignKey':_0x3b2b('0x15e')});db[_0x3b2b('0x38')][_0x3b2b('0x123')](db[_0x3b2b('0x15f')],{'as':_0x3b2b('0x15f'),'foreignKey':_0x3b2b('0x160'),'onDelete':_0x3b2b('0x161')});db[_0x3b2b('0x39')][_0x3b2b('0x123')](db['MailAccount'],{'as':_0x3b2b('0x3b'),'foreignKey':'MailAccountId'});db['MailServerOut'][_0x3b2b('0x123')](db['CloudProvider'],{'as':_0x3b2b('0x15f'),'foreignKey':_0x3b2b('0x160'),'onDelete':_0x3b2b('0x161')});db['MailAccount']['hasOne'](db[_0x3b2b('0x38')],{'as':_0x3b2b('0x162'),'onDelete':_0x3b2b('0x114')});db[_0x3b2b('0x3b')][_0x3b2b('0x113')](db[_0x3b2b('0x39')],{'as':'Smtp','onDelete':_0x3b2b('0x114')});db[_0x3b2b('0x3b')][_0x3b2b('0x115')](db[_0x3b2b('0x163')],{'as':_0x3b2b('0x164'),'foreignKey':_0x3b2b('0x15e'),'onDelete':'cascade'});db[_0x3b2b('0x3b')][_0x3b2b('0x115')](db[_0x3b2b('0x81')],{'as':'Answers','foreignKey':_0x3b2b('0x15e')});db[_0x3b2b('0x3b')][_0x3b2b('0x115')](db[_0x3b2b('0x43')],{'as':_0x3b2b('0x157'),'foreignKey':'MailAccountId'});db['MailAccount'][_0x3b2b('0x115')](db[_0x3b2b('0x41')],{'as':'Interactions'});db['MailAccount'][_0x3b2b('0x115')](db[_0x3b2b('0x44')],{'as':_0x3b2b('0x147')});db[_0x3b2b('0x3b')][_0x3b2b('0x123')](db[_0x3b2b('0x137')],{'as':'List','foreignKey':_0x3b2b('0x165')});db[_0x3b2b('0x3b')]['belongsTo'](db[_0x3b2b('0x91')],{'as':_0x3b2b('0x91'),'foreignKey':_0x3b2b('0x166')});db[_0x3b2b('0x3b')][_0x3b2b('0x123')](db['Pause'],{'as':_0x3b2b('0x154'),'foreignKey':_0x3b2b('0x167')});db[_0x3b2b('0x3b')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x3b2b('0x13c')});db[_0x3b2b('0x3d')][_0x3b2b('0x125')](db[_0x3b2b('0x14')],{'as':_0x3b2b('0x155'),'through':_0x3b2b('0x132')});db['MailQueue']['belongsToMany'](db[_0x3b2b('0xe6')],{'through':_0x3b2b('0x168'),'as':_0x3b2b('0x156')});db['MailInteraction'][_0x3b2b('0x115')](db[_0x3b2b('0x43')],{'as':_0x3b2b('0x157'),'onDelete':_0x3b2b('0x114'),'foreignKey':'MailInteractionId'});db[_0x3b2b('0x41')][_0x3b2b('0x123')](db[_0x3b2b('0x3b')],{'as':_0x3b2b('0x169'),'foreignKey':_0x3b2b('0x15e')});db[_0x3b2b('0x41')][_0x3b2b('0x123')](db[_0x3b2b('0x127')],{'as':_0x3b2b('0x16a'),'foreignKey':_0x3b2b('0x15d')});db[_0x3b2b('0x41')][_0x3b2b('0x123')](db[_0x3b2b('0x14')],{'as':_0x3b2b('0x16b'),'foreignKey':_0x3b2b('0x117')});db[_0x3b2b('0x41')][_0x3b2b('0x125')](db[_0x3b2b('0x8f')],{'through':_0x3b2b('0x16c'),'as':_0x3b2b('0x16d')});db[_0x3b2b('0x41')][_0x3b2b('0x125')](db[_0x3b2b('0x8f')],{'through':_0x3b2b('0x16c'),'as':'ThroughTags'});db[_0x3b2b('0x41')][_0x3b2b('0x125')](db[_0x3b2b('0x14')],{'as':_0x3b2b('0x16e'),'through':'user_has_mail_interactions','foreignKey':_0x3b2b('0x16f')});db['MailMessage'][_0x3b2b('0x115')](db[_0x3b2b('0x170')],{'as':_0x3b2b('0x171'),'onDelete':_0x3b2b('0x114')});db[_0x3b2b('0x43')][_0x3b2b('0x123')](db[_0x3b2b('0x14')],{'as':_0x3b2b('0x14')});db[_0x3b2b('0x43')][_0x3b2b('0x123')](db[_0x3b2b('0x127')],{'onDelete':_0x3b2b('0x114'),'as':'Contact'});db[_0x3b2b('0x43')][_0x3b2b('0x123')](db[_0x3b2b('0x41')],{'as':_0x3b2b('0x172'),'foreignKey':'MailInteractionId'});db[_0x3b2b('0x43')][_0x3b2b('0x123')](db['MailAccount'],{'as':_0x3b2b('0x169'),'foreignKey':_0x3b2b('0x15e')});db[_0x3b2b('0x43')]['belongsTo'](db[_0x3b2b('0x61')],{'as':_0x3b2b('0x61'),'foreignKey':_0x3b2b('0x173')});db[_0x3b2b('0x43')][_0x3b2b('0x123')](db[_0x3b2b('0x174')],{'as':_0x3b2b('0x174'),'foreignKey':_0x3b2b('0x175')});db['MailApplication'][_0x3b2b('0x123')](db['User'],{'onDelete':_0x3b2b('0x161')});db[_0x3b2b('0x44')][_0x3b2b('0x123')](db[_0x3b2b('0x3d')],{'onDelete':'restrict'});db[_0x3b2b('0x44')][_0x3b2b('0x123')](db[_0x3b2b('0x3b')],{'onDelete':_0x3b2b('0x161')});db[_0x3b2b('0x44')][_0x3b2b('0x123')](db[_0x3b2b('0x152')],{'onDelete':_0x3b2b('0x161'),'foreignKey':_0x3b2b('0x153')});db[_0x3b2b('0x44')][_0x3b2b('0x123')](db[_0x3b2b('0x8f')],{'onDelete':_0x3b2b('0x161'),'foreignKey':_0x3b2b('0x176')});db[_0x3b2b('0x46')]['belongsTo'](db[_0x3b2b('0x3b')],{});db[_0x3b2b('0x46')]['belongsTo'](db[_0x3b2b('0x137')],{'as':_0x3b2b('0x177'),'foreignKey':_0x3b2b('0x165')});db['MailQueueReport'][_0x3b2b('0x123')](db[_0x3b2b('0x127')],{'as':'Contact','foreignKey':'ContactId'});db[_0x3b2b('0x46')]['belongsTo'](db[_0x3b2b('0x41')],{});db[_0x3b2b('0x46')]['belongsTo'](db[_0x3b2b('0x43')],{});db[_0x3b2b('0x46')]['belongsTo'](db['User'],{});db[_0x3b2b('0x46')][_0x3b2b('0x123')](db[_0x3b2b('0x3d')],{});db[_0x3b2b('0x48')]['hasMany'](db['DashboardItem'],{'as':_0x3b2b('0x178'),'onDelete':_0x3b2b('0x114')});db[_0x3b2b('0x4a')][_0x3b2b('0x115')](db[_0x3b2b('0x163')],{'as':'Dispositions','foreignKey':_0x3b2b('0x179'),'onDelete':'cascade'});db[_0x3b2b('0x4a')][_0x3b2b('0x115')](db[_0x3b2b('0x81')],{'as':'Answers','foreignKey':_0x3b2b('0x179')});db['FaxAccount']['hasMany'](db[_0x3b2b('0x4d')],{'as':_0x3b2b('0x17a')});db[_0x3b2b('0x4a')][_0x3b2b('0x115')](db['FaxApplication'],{'as':'Applications'});db[_0x3b2b('0x4a')][_0x3b2b('0x115')](db[_0x3b2b('0x18')],{'as':_0x3b2b('0x17b'),'onDelete':'cascade'});db[_0x3b2b('0x4a')]['hasMany'](db[_0x3b2b('0x4e')],{'as':'Messages'});db['FaxAccount'][_0x3b2b('0x123')](db[_0x3b2b('0x29')],{'as':'Trunk'});db[_0x3b2b('0x4a')]['belongsTo'](db[_0x3b2b('0x137')],{'as':_0x3b2b('0x177'),'foreignKey':_0x3b2b('0x165')});db[_0x3b2b('0x4a')][_0x3b2b('0x123')](db[_0x3b2b('0x17c')],{'as':_0x3b2b('0x154'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x3b2b('0x4a')][_0x3b2b('0x125')](db[_0x3b2b('0x14')],{'as':'Agents','through':_0x3b2b('0x13b')});db['FaxApplication']['belongsTo'](db['User'],{'onDelete':_0x3b2b('0x161')});db[_0x3b2b('0x4b')][_0x3b2b('0x123')](db[_0x3b2b('0x4f')],{'onDelete':'restrict'});db['FaxApplication'][_0x3b2b('0x123')](db[_0x3b2b('0x4a')],{'onDelete':_0x3b2b('0x161')});db['FaxApplication']['belongsTo'](db[_0x3b2b('0x8f')],{'onDelete':_0x3b2b('0x161'),'foreignKey':_0x3b2b('0x176')});db[_0x3b2b('0x4d')][_0x3b2b('0x115')](db['FaxMessage'],{'as':_0x3b2b('0x157'),'onDelete':'cascade','foreignKey':_0x3b2b('0x17d')});db[_0x3b2b('0x4d')][_0x3b2b('0x123')](db[_0x3b2b('0x4a')],{'as':'Account','foreignKey':_0x3b2b('0x179')});db[_0x3b2b('0x4d')][_0x3b2b('0x123')](db[_0x3b2b('0x127')],{'as':_0x3b2b('0x16a'),'foreignKey':_0x3b2b('0x15d')});db[_0x3b2b('0x4d')][_0x3b2b('0x123')](db[_0x3b2b('0x14')],{'as':_0x3b2b('0x16b'),'foreignKey':_0x3b2b('0x117')});db['FaxInteraction'][_0x3b2b('0x125')](db[_0x3b2b('0x8f')],{'through':_0x3b2b('0x17e'),'as':_0x3b2b('0x16d')});db[_0x3b2b('0x4d')][_0x3b2b('0x125')](db['Tag'],{'through':_0x3b2b('0x17e'),'as':'ThroughTags'});db[_0x3b2b('0x4d')][_0x3b2b('0x125')](db[_0x3b2b('0x14')],{'as':'Users','through':_0x3b2b('0x17f'),'foreignKey':'FaxInteractionId'});db[_0x3b2b('0x4e')][_0x3b2b('0x123')](db[_0x3b2b('0x14')],{'onDelete':_0x3b2b('0x114'),'as':_0x3b2b('0x14')});db[_0x3b2b('0x4e')][_0x3b2b('0x123')](db[_0x3b2b('0x4d')],{'as':_0x3b2b('0x172'),'foreignKey':'FaxInteractionId'});db[_0x3b2b('0x4e')][_0x3b2b('0x123')](db['CmContact'],{'onDelete':_0x3b2b('0x114'),'as':_0x3b2b('0x16a')});db[_0x3b2b('0x4e')][_0x3b2b('0x123')](db[_0x3b2b('0x170')],{'as':_0x3b2b('0x170'),'foreignKey':_0x3b2b('0x180')});db['FaxMessage'][_0x3b2b('0x123')](db[_0x3b2b('0x4a')],{'as':_0x3b2b('0x169'),'foreignKey':_0x3b2b('0x179')});db[_0x3b2b('0x4f')]['belongsToMany'](db['User'],{'as':'Agents','through':'UserFaxQueue'});db[_0x3b2b('0x4f')]['belongsToMany'](db['Team'],{'through':_0x3b2b('0x181'),'as':_0x3b2b('0x156')});db[_0x3b2b('0x182')][_0x3b2b('0x123')](db[_0x3b2b('0x4a')],{});db[_0x3b2b('0x182')][_0x3b2b('0x123')](db['CmList'],{'as':_0x3b2b('0x177'),'foreignKey':_0x3b2b('0x165')});db[_0x3b2b('0x182')][_0x3b2b('0x123')](db[_0x3b2b('0x127')],{'as':_0x3b2b('0x16a'),'foreignKey':_0x3b2b('0x15d')});db[_0x3b2b('0x182')]['belongsTo'](db[_0x3b2b('0x4d')],{});db['FaxQueueReport']['belongsTo'](db[_0x3b2b('0x4e')],{});db[_0x3b2b('0x182')][_0x3b2b('0x123')](db[_0x3b2b('0x14')],{});db['FaxQueueReport'][_0x3b2b('0x123')](db[_0x3b2b('0x4f')],{});db[_0x3b2b('0x51')][_0x3b2b('0x115')](db[_0x3b2b('0x163')],{'as':_0x3b2b('0x164'),'foreignKey':_0x3b2b('0x183'),'onDelete':'cascade'});db[_0x3b2b('0x51')][_0x3b2b('0x115')](db[_0x3b2b('0x81')],{'as':_0x3b2b('0x184'),'foreignKey':_0x3b2b('0x183')});db['SmsAccount'][_0x3b2b('0x115')](db[_0x3b2b('0x55')],{'as':_0x3b2b('0x157'),'foreignKey':'SmsAccountId'});db[_0x3b2b('0x51')][_0x3b2b('0x115')](db[_0x3b2b('0x54')],{'as':'Interactions'});db[_0x3b2b('0x51')][_0x3b2b('0x115')](db[_0x3b2b('0x185')],{'as':'Applications'});db[_0x3b2b('0x51')][_0x3b2b('0x123')](db['CmList'],{'as':_0x3b2b('0x177'),'foreignKey':_0x3b2b('0x165')});db['SmsAccount'][_0x3b2b('0x123')](db[_0x3b2b('0x17c')],{'as':_0x3b2b('0x154'),'foreignKey':_0x3b2b('0x167')});db[_0x3b2b('0x51')][_0x3b2b('0x125')](db[_0x3b2b('0x14')],{'as':_0x3b2b('0x155'),'through':_0x3b2b('0x140')});db[_0x3b2b('0x185')]['belongsTo'](db[_0x3b2b('0x14')],{'onDelete':'restrict'});db[_0x3b2b('0x185')][_0x3b2b('0x123')](db[_0x3b2b('0x57')],{'onDelete':'restrict'});db[_0x3b2b('0x185')][_0x3b2b('0x123')](db[_0x3b2b('0x51')],{'onDelete':_0x3b2b('0x161')});db[_0x3b2b('0x185')][_0x3b2b('0x123')](db['Interval'],{'onDelete':_0x3b2b('0x161'),'foreignKey':_0x3b2b('0x153')});db[_0x3b2b('0x185')][_0x3b2b('0x123')](db[_0x3b2b('0x8f')],{'onDelete':_0x3b2b('0x161'),'foreignKey':_0x3b2b('0x176')});db['SmsInteraction'][_0x3b2b('0x115')](db[_0x3b2b('0x55')],{'as':'Messages','onDelete':'cascade','foreignKey':_0x3b2b('0x186')});db[_0x3b2b('0x54')][_0x3b2b('0x123')](db['SmsAccount'],{'as':_0x3b2b('0x169'),'foreignKey':_0x3b2b('0x183')});db[_0x3b2b('0x54')][_0x3b2b('0x123')](db[_0x3b2b('0x127')],{'as':_0x3b2b('0x16a'),'foreignKey':'ContactId'});db[_0x3b2b('0x54')][_0x3b2b('0x123')](db['User'],{'as':_0x3b2b('0x16b'),'foreignKey':_0x3b2b('0x117')});db['SmsInteraction'][_0x3b2b('0x125')](db[_0x3b2b('0x8f')],{'through':'sms_interaction_has_tags','as':'Tags'});db[_0x3b2b('0x54')][_0x3b2b('0x125')](db['Tag'],{'through':_0x3b2b('0x187'),'as':_0x3b2b('0x188')});db[_0x3b2b('0x54')][_0x3b2b('0x125')](db[_0x3b2b('0x14')],{'as':'Users','through':_0x3b2b('0x12d'),'foreignKey':_0x3b2b('0x186')});db[_0x3b2b('0x55')][_0x3b2b('0x123')](db[_0x3b2b('0x14')],{'as':_0x3b2b('0x14')});db[_0x3b2b('0x55')][_0x3b2b('0x123')](db[_0x3b2b('0x127')],{'onDelete':_0x3b2b('0x114'),'as':'Contact'});db[_0x3b2b('0x55')][_0x3b2b('0x123')](db[_0x3b2b('0x54')],{'onDelete':_0x3b2b('0x114'),'as':_0x3b2b('0x172'),'foreignKey':_0x3b2b('0x186')});db[_0x3b2b('0x55')][_0x3b2b('0x123')](db[_0x3b2b('0x51')],{'as':'Account','foreignKey':_0x3b2b('0x183')});db['SmsQueue'][_0x3b2b('0x125')](db['User'],{'as':_0x3b2b('0x155'),'through':_0x3b2b('0x33'),'foreignKey':'SmsQueueId'});db[_0x3b2b('0x57')][_0x3b2b('0x125')](db[_0x3b2b('0xe6')],{'through':'team_has_sms_queues','as':_0x3b2b('0x156')});db[_0x3b2b('0x59')][_0x3b2b('0x115')](db[_0x3b2b('0x163')],{'as':_0x3b2b('0x164'),'foreignKey':_0x3b2b('0x189'),'onDelete':'cascade'});db['OpenchannelAccount'][_0x3b2b('0x115')](db['CannedAnswer'],{'as':_0x3b2b('0x184'),'foreignKey':_0x3b2b('0x189')});db[_0x3b2b('0x59')][_0x3b2b('0x115')](db[_0x3b2b('0x11c')],{'as':_0x3b2b('0x17a'),'foreignKey':_0x3b2b('0x189')});db[_0x3b2b('0x59')][_0x3b2b('0x115')](db['OpenchannelMessage'],{'as':_0x3b2b('0x157'),'foreignKey':_0x3b2b('0x189')});db['OpenchannelAccount'][_0x3b2b('0x115')](db[_0x3b2b('0x5b')],{'as':_0x3b2b('0x147'),'foreignKey':'OpenchannelAccountId'});db[_0x3b2b('0x59')]['belongsTo'](db['CmList'],{'as':_0x3b2b('0x177'),'foreignKey':_0x3b2b('0x165')});db[_0x3b2b('0x59')][_0x3b2b('0x123')](db['Pause'],{'as':_0x3b2b('0x154'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x3b2b('0x59')][_0x3b2b('0x125')](db[_0x3b2b('0x14')],{'as':_0x3b2b('0x155'),'through':'user_has_openchannel_accounts'});db[_0x3b2b('0x5b')][_0x3b2b('0x123')](db[_0x3b2b('0x14')],{'onDelete':_0x3b2b('0x161')});db[_0x3b2b('0x5b')]['belongsTo'](db['OpenchannelQueue'],{'onDelete':_0x3b2b('0x161'),'foreignKey':'OpenchannelQueueId'});db['OpenchannelApplication'][_0x3b2b('0x123')](db[_0x3b2b('0x59')],{'onDelete':_0x3b2b('0x161'),'foreignKey':_0x3b2b('0x189')});db['OpenchannelApplication'][_0x3b2b('0x123')](db[_0x3b2b('0x152')],{'onDelete':_0x3b2b('0x161'),'foreignKey':'IntervalId'});db[_0x3b2b('0x5b')][_0x3b2b('0x123')](db['Tag'],{'onDelete':_0x3b2b('0x161'),'foreignKey':_0x3b2b('0x176')});db[_0x3b2b('0x11c')][_0x3b2b('0x115')](db['OpenchannelMessage'],{'as':_0x3b2b('0x157'),'onDelete':_0x3b2b('0x114'),'foreignKey':'OpenchannelInteractionId'});db[_0x3b2b('0x11c')][_0x3b2b('0x123')](db[_0x3b2b('0x59')],{'as':_0x3b2b('0x169'),'foreignKey':'OpenchannelAccountId'});db[_0x3b2b('0x11c')][_0x3b2b('0x123')](db[_0x3b2b('0x127')],{'as':_0x3b2b('0x16a'),'foreignKey':_0x3b2b('0x15d')});db[_0x3b2b('0x11c')]['belongsTo'](db[_0x3b2b('0x14')],{'as':_0x3b2b('0x16b'),'foreignKey':'UserId'});db[_0x3b2b('0x11c')][_0x3b2b('0x125')](db[_0x3b2b('0x8f')],{'through':_0x3b2b('0x18a'),'as':_0x3b2b('0x16d')});db[_0x3b2b('0x11c')][_0x3b2b('0x125')](db['Tag'],{'through':_0x3b2b('0x18a'),'as':'ThroughTags'});db[_0x3b2b('0x11c')][_0x3b2b('0x125')](db[_0x3b2b('0x14')],{'as':_0x3b2b('0x16e'),'through':_0x3b2b('0x12e'),'foreignKey':_0x3b2b('0x18b')});db[_0x3b2b('0x5e')][_0x3b2b('0x123')](db[_0x3b2b('0x14')],{'onDelete':_0x3b2b('0x114'),'as':_0x3b2b('0x14')});db[_0x3b2b('0x5e')][_0x3b2b('0x123')](db[_0x3b2b('0x127')],{'onDelete':_0x3b2b('0x114'),'as':'Contact'});db[_0x3b2b('0x5e')]['belongsTo'](db[_0x3b2b('0x11c')],{'onDelete':_0x3b2b('0x114'),'as':_0x3b2b('0x172'),'foreignKey':_0x3b2b('0x18b')});db[_0x3b2b('0x5e')][_0x3b2b('0x123')](db[_0x3b2b('0x170')],{'as':_0x3b2b('0x170'),'foreignKey':_0x3b2b('0x180')});db[_0x3b2b('0x5e')][_0x3b2b('0x123')](db[_0x3b2b('0x59')],{'as':'Account','foreignKey':'OpenchannelAccountId'});db[_0x3b2b('0x134')][_0x3b2b('0x125')](db[_0x3b2b('0x14')],{'as':_0x3b2b('0x155'),'through':_0x3b2b('0x136'),'foreignKey':_0x3b2b('0x18c')});db[_0x3b2b('0x134')]['belongsToMany'](db[_0x3b2b('0xe6')],{'through':_0x3b2b('0x18d'),'as':'Teams'});db[_0x3b2b('0x61')][_0x3b2b('0x115')](db[_0x3b2b('0x163')],{'as':_0x3b2b('0x164'),'foreignKey':_0x3b2b('0x173'),'onDelete':_0x3b2b('0x114')});db[_0x3b2b('0x61')]['hasMany'](db[_0x3b2b('0x81')],{'as':_0x3b2b('0x184'),'foreignKey':_0x3b2b('0x173')});db[_0x3b2b('0x61')][_0x3b2b('0x115')](db[_0x3b2b('0x70')],{'as':_0x3b2b('0x18e')});db[_0x3b2b('0x61')][_0x3b2b('0x115')](db[_0x3b2b('0x67')],{'as':_0x3b2b('0x17a')});db[_0x3b2b('0x61')][_0x3b2b('0x115')](db[_0x3b2b('0x65')],{'as':'Applications'});db['ChatWebsite']['hasMany'](db[_0x3b2b('0x69')],{'as':'Messages'});db[_0x3b2b('0x61')][_0x3b2b('0x123')](db[_0x3b2b('0x137')],{'as':_0x3b2b('0x177'),'foreignKey':'ListId'});db[_0x3b2b('0x61')]['belongsTo'](db[_0x3b2b('0x152')],{'as':'Interval','foreignKey':'IntervalId'});db['ChatWebsite'][_0x3b2b('0x123')](db[_0x3b2b('0x3b')],{'as':_0x3b2b('0x3b'),'foreignKey':_0x3b2b('0x15e')});db['ChatWebsite'][_0x3b2b('0x123')](db[_0x3b2b('0x17c')],{'as':_0x3b2b('0x154'),'foreignKey':_0x3b2b('0x167')});db[_0x3b2b('0x61')][_0x3b2b('0x125')](db[_0x3b2b('0x14')],{'as':_0x3b2b('0x155'),'through':_0x3b2b('0x18f')});db['OpenchannelQueueReport'][_0x3b2b('0x123')](db[_0x3b2b('0x59')],{});db[_0x3b2b('0x63')]['belongsTo'](db[_0x3b2b('0x137')],{'as':_0x3b2b('0x177'),'foreignKey':_0x3b2b('0x165')});db[_0x3b2b('0x63')]['belongsTo'](db[_0x3b2b('0x127')],{'as':_0x3b2b('0x16a'),'foreignKey':_0x3b2b('0x15d')});db[_0x3b2b('0x63')][_0x3b2b('0x123')](db[_0x3b2b('0x11c')],{});db[_0x3b2b('0x63')][_0x3b2b('0x123')](db['OpenchannelMessage'],{});db[_0x3b2b('0x63')][_0x3b2b('0x123')](db[_0x3b2b('0x14')],{});db[_0x3b2b('0x63')][_0x3b2b('0x123')](db[_0x3b2b('0x134')],{});db[_0x3b2b('0x65')][_0x3b2b('0x123')](db['User'],{'as':_0x3b2b('0x190'),'foreignKey':_0x3b2b('0x117'),'onDelete':_0x3b2b('0x161')});db[_0x3b2b('0x65')][_0x3b2b('0x123')](db['ChatQueue'],{'as':_0x3b2b('0x191'),'foreignKey':_0x3b2b('0x192'),'onDelete':_0x3b2b('0x161')});db[_0x3b2b('0x65')][_0x3b2b('0x123')](db[_0x3b2b('0x61')],{'as':_0x3b2b('0x193'),'foreignKey':_0x3b2b('0x173'),'onDelete':'restrict'});db['ChatApplication']['belongsTo'](db[_0x3b2b('0x8f')],{'onDelete':_0x3b2b('0x161'),'foreignKey':_0x3b2b('0x176')});db[_0x3b2b('0x67')][_0x3b2b('0x115')](db['ChatMessage'],{'as':_0x3b2b('0x157'),'onDelete':_0x3b2b('0x114'),'foreignKey':_0x3b2b('0x194')});db[_0x3b2b('0x67')][_0x3b2b('0x123')](db['ChatWebsite'],{'as':_0x3b2b('0x169'),'foreignKey':_0x3b2b('0x173')});db[_0x3b2b('0x67')][_0x3b2b('0x123')](db[_0x3b2b('0x127')],{'as':_0x3b2b('0x16a'),'foreignKey':'ContactId'});db[_0x3b2b('0x67')][_0x3b2b('0x123')](db[_0x3b2b('0x14')],{'as':_0x3b2b('0x16b'),'foreignKey':_0x3b2b('0x117')});db[_0x3b2b('0x67')][_0x3b2b('0x125')](db['Tag'],{'through':_0x3b2b('0x195'),'as':_0x3b2b('0x16d')});db[_0x3b2b('0x67')][_0x3b2b('0x125')](db[_0x3b2b('0x8f')],{'through':_0x3b2b('0x195'),'as':_0x3b2b('0x188')});db[_0x3b2b('0x67')][_0x3b2b('0x125')](db[_0x3b2b('0x14')],{'as':_0x3b2b('0x16e'),'through':_0x3b2b('0x12b'),'foreignKey':'ChatInteractionId'});db[_0x3b2b('0x69')][_0x3b2b('0x123')](db[_0x3b2b('0x14')],{'onDelete':_0x3b2b('0x114'),'as':_0x3b2b('0x14')});db[_0x3b2b('0x69')][_0x3b2b('0x123')](db['CmContact'],{'onDelete':_0x3b2b('0x114'),'as':_0x3b2b('0x16a'),'foreignKey':_0x3b2b('0x15d')});db['ChatMessage'][_0x3b2b('0x123')](db[_0x3b2b('0x67')],{'onDelete':'cascade','as':_0x3b2b('0x172'),'foreignKey':'ChatInteractionId'});db['ChatMessage'][_0x3b2b('0x123')](db[_0x3b2b('0x170')],{'as':_0x3b2b('0x170'),'foreignKey':_0x3b2b('0x180')});db[_0x3b2b('0x69')][_0x3b2b('0x123')](db[_0x3b2b('0x61')],{'as':'Account','foreignKey':_0x3b2b('0x173')});db[_0x3b2b('0x174')][_0x3b2b('0x115')](db['Attachment'],{'as':_0x3b2b('0x171'),'foreignKey':_0x3b2b('0x175'),'onDelete':'cascade','hooks':!![]});db['ChatOfflineMessage'][_0x3b2b('0x123')](db['CmContact'],{'onDelete':_0x3b2b('0x114'),'as':_0x3b2b('0x16a'),'foreignKey':_0x3b2b('0x15d')});db['ChatOfflineMessage'][_0x3b2b('0x123')](db['ChatWebsite'],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x3b2b('0x6c')][_0x3b2b('0x125')](db[_0x3b2b('0x14')],{'as':_0x3b2b('0x155'),'through':'UserChatQueue','hooks':!![]});db[_0x3b2b('0x6c')][_0x3b2b('0x125')](db[_0x3b2b('0xe6')],{'through':_0x3b2b('0x196'),'as':_0x3b2b('0x156')});db[_0x3b2b('0x6e')][_0x3b2b('0x115')](db['ChatInternalMessage'],{'as':'Messages','foreignKey':'ChatGroupId','onDelete':_0x3b2b('0x114')});db[_0x3b2b('0x6e')][_0x3b2b('0x125')](db['User'],{'as':_0x3b2b('0x149'),'through':'chat_group_has_users'});db['ChatProactiveAction'][_0x3b2b('0x123')](db['ChatWebsite'],{'as':_0x3b2b('0x193'),'foreignKey':_0x3b2b('0x173')});db['CmCompany']['hasMany'](db[_0x3b2b('0x127')],{'as':_0x3b2b('0x128'),'foreignKey':_0x3b2b('0x197')});db['CmContact'][_0x3b2b('0x115')](db[_0x3b2b('0x75')],{'as':_0x3b2b('0x14a'),'foreignKey':'ContactId'});db[_0x3b2b('0x127')][_0x3b2b('0x115')](db['CmHopperFinal'],{'as':_0x3b2b('0x14d'),'foreignKey':_0x3b2b('0x15d')});db['CmContact'][_0x3b2b('0x115')](db['CmHopperHistory'],{'as':_0x3b2b('0x14e'),'foreignKey':_0x3b2b('0x15d')});db[_0x3b2b('0x127')][_0x3b2b('0x115')](db[_0x3b2b('0x11b')],{'as':_0x3b2b('0x11b'),'foreignKey':'ContactId'});db[_0x3b2b('0x127')]['hasMany'](db[_0x3b2b('0xd8')],{'as':_0x3b2b('0x198'),'foreignKey':'ContactId'});db[_0x3b2b('0x127')][_0x3b2b('0x115')](db[_0x3b2b('0x11c')],{'as':_0x3b2b('0x11d'),'foreignKey':'ContactId','onDelete':_0x3b2b('0x161')});db[_0x3b2b('0x127')][_0x3b2b('0x115')](db[_0x3b2b('0x67')],{'as':_0x3b2b('0x11e'),'foreignKey':_0x3b2b('0x15d'),'onDelete':'restrict'});db[_0x3b2b('0x127')][_0x3b2b('0x115')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0x3b2b('0x15d'),'onDelete':_0x3b2b('0x161')});db['CmContact'][_0x3b2b('0x115')](db['FaxInteraction'],{'as':_0x3b2b('0x11f'),'foreignKey':'ContactId','onDelete':'restrict'});db['CmContact'][_0x3b2b('0x115')](db[_0x3b2b('0x41')],{'as':_0x3b2b('0x120'),'foreignKey':'ContactId','onDelete':_0x3b2b('0x161')});db[_0x3b2b('0x127')][_0x3b2b('0x123')](db[_0x3b2b('0x72')],{'as':'Company','foreignKey':'CompanyId'});db[_0x3b2b('0x127')][_0x3b2b('0x123')](db[_0x3b2b('0x137')],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db[_0x3b2b('0x127')]['belongsToMany'](db[_0x3b2b('0x14')],{'as':_0x3b2b('0x16e'),'through':'cm_user_has_contacts'});db[_0x3b2b('0x127')][_0x3b2b('0x125')](db[_0x3b2b('0x8f')],{'as':_0x3b2b('0x16d'),'through':'cm_contact_has_tags'});db[_0x3b2b('0x127')][_0x3b2b('0x125')](db[_0x3b2b('0x8f')],{'through':_0x3b2b('0x199'),'as':_0x3b2b('0x188')});db['CmHopper'][_0x3b2b('0x123')](db[_0x3b2b('0x127')],{'as':_0x3b2b('0x16a'),'foreignKey':'ContactId','onDelete':'cascade'});db[_0x3b2b('0x75')][_0x3b2b('0x123')](db[_0x3b2b('0x137')],{'as':'List','foreignKey':_0x3b2b('0x165'),'onDelete':_0x3b2b('0x114')});db[_0x3b2b('0x75')][_0x3b2b('0x123')](db[_0x3b2b('0x14')],{'as':_0x3b2b('0x190'),'foreignKey':_0x3b2b('0x117')});db['CmHopper']['belongsTo'](db['VoiceQueue'],{'as':_0x3b2b('0x191'),'foreignKey':_0x3b2b('0x14b'),'onDelete':_0x3b2b('0x114')});db[_0x3b2b('0x75')][_0x3b2b('0x123')](db[_0x3b2b('0xea')],{'as':'Campaign','foreignKey':'CampaignId','onDelete':_0x3b2b('0x114')});db['CmHopper'][_0x3b2b('0x123')](db[_0x3b2b('0x14')],{'as':_0x3b2b('0x16b'),'foreignKey':_0x3b2b('0x19a')});db[_0x3b2b('0x77')][_0x3b2b('0x123')](db[_0x3b2b('0x127')],{'as':_0x3b2b('0x16a'),'foreignKey':_0x3b2b('0x15d'),'onDelete':_0x3b2b('0x114')});db[_0x3b2b('0x77')]['belongsTo'](db[_0x3b2b('0x137')],{'as':'List','foreignKey':_0x3b2b('0x165'),'onDelete':'cascade'});db[_0x3b2b('0x77')][_0x3b2b('0x123')](db[_0x3b2b('0x1a')],{'as':_0x3b2b('0x191'),'foreignKey':_0x3b2b('0x14b'),'onDelete':_0x3b2b('0x114')});db['CmHopperBlack'][_0x3b2b('0x123')](db[_0x3b2b('0xea')],{'as':_0x3b2b('0xea'),'foreignKey':'CampaignId','onDelete':_0x3b2b('0x114')});db['Automation']['hasMany'](db[_0x3b2b('0x84')],{'as':{'plural':_0x3b2b('0x19b'),'singular':_0x3b2b('0x19c')},'foreignKey':_0x3b2b('0x19d'),'onDelete':_0x3b2b('0x114'),'hooks':!![]});db[_0x3b2b('0x7f')][_0x3b2b('0x115')](db['Condition'],{'as':{'plural':'Any','singular':_0x3b2b('0x19e')},'foreignKey':_0x3b2b('0x19f'),'onDelete':_0x3b2b('0x114'),'hooks':!![]});db[_0x3b2b('0x7f')]['hasMany'](db['Action'],{'as':_0x3b2b('0x1a0'),'foreignKey':_0x3b2b('0x1a1'),'onDelete':_0x3b2b('0x114'),'hooks':!![]});db[_0x3b2b('0x163')][_0x3b2b('0x115')](db[_0x3b2b('0x163')],{'as':'Dispositions','foreignKey':_0x3b2b('0x1a2'),'onDelete':'cascade'});db[_0x3b2b('0x152')][_0x3b2b('0x115')](db[_0x3b2b('0x152')],{'as':'Intervals','foreignKey':'IntervalId','onDelete':_0x3b2b('0x114'),'hooks':!![],'required':![]});db[_0x3b2b('0x152')][_0x3b2b('0x115')](db[_0x3b2b('0x18')],{'as':_0x3b2b('0x119'),'foreignKey':_0x3b2b('0x153'),'onDelete':_0x3b2b('0x161')});db[_0x3b2b('0x152')]['hasMany'](db['MailApplication'],{'as':_0x3b2b('0x1a3'),'foreignKey':_0x3b2b('0x153')});db[_0x3b2b('0x152')]['hasMany'](db[_0x3b2b('0x65')],{'as':_0x3b2b('0x1a4'),'foreignKey':_0x3b2b('0x153')});db['Interval'][_0x3b2b('0x115')](db['FaxApplication'],{'as':_0x3b2b('0x1a5'),'foreignKey':'IntervalId'});db[_0x3b2b('0x152')][_0x3b2b('0x115')](db['SmsApplication'],{'as':'SmsApplications','foreignKey':'IntervalId'});db[_0x3b2b('0x8b')]['belongsTo'](db[_0x3b2b('0x3b')],{});db['Schedule'][_0x3b2b('0x123')](db[_0x3b2b('0x9a')],{'foreignKey':_0x3b2b('0x1a6')});db[_0x3b2b('0x8b')][_0x3b2b('0x123')](db[_0x3b2b('0x98')],{'foreignKey':_0x3b2b('0x1a7')});db[_0x3b2b('0x8d')][_0x3b2b('0x125')](db[_0x3b2b('0x19')],{'as':_0x3b2b('0x1a8'),'through':_0x3b2b('0x1a9'),'onDelete':_0x3b2b('0x161')});db[_0x3b2b('0x8f')][_0x3b2b('0x125')](db[_0x3b2b('0x127')],{'through':'cm_contact_has_tags'});db[_0x3b2b('0x8f')][_0x3b2b('0x125')](db[_0x3b2b('0x67')],{'through':_0x3b2b('0x195')});db['Tag'][_0x3b2b('0x125')](db[_0x3b2b('0x41')],{'through':_0x3b2b('0x16c')});db[_0x3b2b('0x8f')][_0x3b2b('0x125')](db['SmsInteraction'],{'through':_0x3b2b('0x187')});db[_0x3b2b('0x8f')]['belongsToMany'](db[_0x3b2b('0x4d')],{'through':_0x3b2b('0x17e')});db['Tag'][_0x3b2b('0x125')](db[_0x3b2b('0x11c')],{'through':_0x3b2b('0x18a')});db[_0x3b2b('0x8f')][_0x3b2b('0x125')](db['WhatsappInteraction'],{'through':_0x3b2b('0x1aa')});db[_0x3b2b('0x1ab')]['hasMany'](db[_0x3b2b('0x84')],{'as':{'plural':_0x3b2b('0x1ac'),'singular':_0x3b2b('0x1ad')},'foreignKey':_0x3b2b('0x1ae'),'onDelete':'cascade','hooks':!![]});db[_0x3b2b('0x1ab')][_0x3b2b('0x115')](db[_0x3b2b('0x84')],{'as':{'plural':'AnyConditions','singular':_0x3b2b('0x1af')},'foreignKey':'TriggerAnyId','onDelete':_0x3b2b('0x114'),'hooks':!![]});db[_0x3b2b('0x1ab')][_0x3b2b('0x115')](db[_0x3b2b('0x7e')],{'as':_0x3b2b('0x1a0'),'foreignKey':'TriggerId','onDelete':_0x3b2b('0x114'),'hooks':!![]});db[_0x3b2b('0x98')]['hasMany'](db[_0x3b2b('0x9d')],{'as':_0x3b2b('0x1b0'),'onDelete':_0x3b2b('0x114'),'foreignKey':_0x3b2b('0x1a7'),'hooks':!![]});db[_0x3b2b('0x9a')][_0x3b2b('0x115')](db[_0x3b2b('0x9d')],{'as':_0x3b2b('0x1b0'),'onDelete':_0x3b2b('0x114'),'foreignKey':_0x3b2b('0x1a6')});db[_0x3b2b('0x1b1')][_0x3b2b('0x115')](db[_0x3b2b('0x9d')],{'as':'Fields','onDelete':_0x3b2b('0x114'),'foreignKey':_0x3b2b('0x1b2')});db['AnalyticFieldReport']['belongsTo'](db[_0x3b2b('0x1b1')],{'foreignKey':'MetricId'});db[_0x3b2b('0x1b3')][_0x3b2b('0x115')](db[_0x3b2b('0xa1')],{'as':_0x3b2b('0x1b4'),'onDelete':_0x3b2b('0x114'),'foreignKey':_0x3b2b('0x1b5')});db['SalesforceConfiguration'][_0x3b2b('0x115')](db[_0x3b2b('0xa2')],{'as':_0x3b2b('0x1b6'),'onDelete':_0x3b2b('0x114'),'foreignKey':_0x3b2b('0x1b7')});db[_0x3b2b('0xa1')]['hasMany'](db[_0x3b2b('0xa2')],{'as':_0x3b2b('0x1b8'),'onDelete':'cascade','foreignKey':_0x3b2b('0x1b9')});db[_0x3b2b('0xa1')][_0x3b2b('0x115')](db[_0x3b2b('0xa2')],{'as':'Fields','onDelete':_0x3b2b('0x114'),'foreignKey':_0x3b2b('0x1ba')});db[_0x3b2b('0xa1')][_0x3b2b('0x123')](db[_0x3b2b('0x1b3')],{'as':_0x3b2b('0x169'),'foreignKey':'AccountId'});db['SalesforceField'][_0x3b2b('0x115')](db['SalesforceField'],{'as':_0x3b2b('0x1bb'),'foreignKey':_0x3b2b('0x1b7')});db[_0x3b2b('0xa2')][_0x3b2b('0x115')](db[_0x3b2b('0xa2')],{'as':_0x3b2b('0x1bc'),'foreignKey':_0x3b2b('0x1b9')});db[_0x3b2b('0xa2')][_0x3b2b('0x115')](db[_0x3b2b('0xa2')],{'as':_0x3b2b('0x1bd'),'foreignKey':'FieldId'});db[_0x3b2b('0xa2')][_0x3b2b('0x123')](db[_0x3b2b('0x1be')],{'as':_0x3b2b('0x1be'),'foreignKey':_0x3b2b('0x1bf')});db[_0x3b2b('0x1c0')]['hasMany'](db[_0x3b2b('0xa5')],{'as':_0x3b2b('0x1b4'),'onDelete':_0x3b2b('0x114'),'foreignKey':_0x3b2b('0x1b5')});db['SugarcrmConfiguration'][_0x3b2b('0x115')](db[_0x3b2b('0xa7')],{'as':_0x3b2b('0x1b6'),'onDelete':_0x3b2b('0x114'),'foreignKey':_0x3b2b('0x1b7')});db[_0x3b2b('0xa5')]['hasMany'](db[_0x3b2b('0xa7')],{'as':'Descriptions','onDelete':_0x3b2b('0x114'),'foreignKey':_0x3b2b('0x1b9')});db['SugarcrmConfiguration'][_0x3b2b('0x115')](db[_0x3b2b('0xa7')],{'as':'Fields','onDelete':_0x3b2b('0x114'),'foreignKey':'FieldId'});db[_0x3b2b('0xa5')][_0x3b2b('0x123')](db['SugarcrmAccount'],{'as':_0x3b2b('0x169'),'foreignKey':_0x3b2b('0x1b5')});db[_0x3b2b('0xa7')][_0x3b2b('0x115')](db[_0x3b2b('0xa7')],{'as':_0x3b2b('0x1bb'),'foreignKey':_0x3b2b('0x1b7')});db[_0x3b2b('0xa7')][_0x3b2b('0x115')](db[_0x3b2b('0xa7')],{'as':_0x3b2b('0x1bc'),'foreignKey':'DescriptionId'});db['SugarcrmField'][_0x3b2b('0x115')](db[_0x3b2b('0xa7')],{'as':_0x3b2b('0x1bd'),'foreignKey':'FieldId'});db[_0x3b2b('0xa7')][_0x3b2b('0x123')](db[_0x3b2b('0x1be')],{'as':'Variable','foreignKey':_0x3b2b('0x1bf')});db[_0x3b2b('0xa9')][_0x3b2b('0x115')](db[_0x3b2b('0xaa')],{'as':_0x3b2b('0x1b4'),'onDelete':'cascade','foreignKey':_0x3b2b('0x1b5')});db[_0x3b2b('0xaa')][_0x3b2b('0x115')](db[_0x3b2b('0xac')],{'as':_0x3b2b('0x1b6'),'onDelete':'cascade','foreignKey':_0x3b2b('0x1b7')});db[_0x3b2b('0xaa')]['hasMany'](db[_0x3b2b('0xac')],{'as':_0x3b2b('0x1b8'),'onDelete':_0x3b2b('0x114'),'foreignKey':'DescriptionId'});db[_0x3b2b('0xaa')][_0x3b2b('0x115')](db[_0x3b2b('0xac')],{'as':_0x3b2b('0x1b0'),'onDelete':_0x3b2b('0x114'),'foreignKey':_0x3b2b('0x1ba')});db[_0x3b2b('0xaa')][_0x3b2b('0x123')](db[_0x3b2b('0xa9')],{'as':_0x3b2b('0x169'),'foreignKey':_0x3b2b('0x1b5')});db['DeskConfiguration'][_0x3b2b('0x125')](db[_0x3b2b('0x8f')],{'through':_0x3b2b('0x1c1')});db[_0x3b2b('0xac')][_0x3b2b('0x115')](db['DeskField'],{'as':_0x3b2b('0x1bb'),'foreignKey':_0x3b2b('0x1b7')});db[_0x3b2b('0xac')]['hasMany'](db[_0x3b2b('0xac')],{'as':_0x3b2b('0x1bc'),'foreignKey':'DescriptionId'});db['DeskField'][_0x3b2b('0x115')](db['DeskField'],{'as':_0x3b2b('0x1bd'),'foreignKey':_0x3b2b('0x1ba')});db[_0x3b2b('0xac')][_0x3b2b('0x123')](db['Variable'],{'as':_0x3b2b('0x1be'),'foreignKey':_0x3b2b('0x1bf')});db[_0x3b2b('0xae')][_0x3b2b('0x115')](db[_0x3b2b('0xb0')],{'as':_0x3b2b('0x1b4'),'onDelete':'cascade','foreignKey':'AccountId'});db['ZohoConfiguration'][_0x3b2b('0x115')](db[_0x3b2b('0xb2')],{'as':_0x3b2b('0x1b6'),'onDelete':_0x3b2b('0x114'),'foreignKey':_0x3b2b('0x1b7')});db[_0x3b2b('0xb0')][_0x3b2b('0x115')](db[_0x3b2b('0xb2')],{'as':_0x3b2b('0x1b8'),'onDelete':_0x3b2b('0x114'),'foreignKey':_0x3b2b('0x1b9')});db[_0x3b2b('0xb0')][_0x3b2b('0x115')](db[_0x3b2b('0xb2')],{'as':_0x3b2b('0x1b0'),'onDelete':_0x3b2b('0x114'),'foreignKey':_0x3b2b('0x1ba')});db[_0x3b2b('0xb0')][_0x3b2b('0x123')](db[_0x3b2b('0xae')],{'as':'Account','foreignKey':_0x3b2b('0x1b5')});db[_0x3b2b('0xb2')][_0x3b2b('0x115')](db[_0x3b2b('0xb2')],{'as':_0x3b2b('0x1bb'),'foreignKey':'SubjectId'});db[_0x3b2b('0xb2')][_0x3b2b('0x115')](db[_0x3b2b('0xb2')],{'as':_0x3b2b('0x1bc'),'foreignKey':_0x3b2b('0x1b9')});db['ZohoField'][_0x3b2b('0x115')](db[_0x3b2b('0xb2')],{'as':_0x3b2b('0x1bd'),'foreignKey':_0x3b2b('0x1ba')});db[_0x3b2b('0xb2')][_0x3b2b('0x123')](db[_0x3b2b('0x1be')],{'as':'Variable','foreignKey':'VariableId'});db[_0x3b2b('0xb3')]['hasMany'](db[_0x3b2b('0xb5')],{'as':_0x3b2b('0x1b4'),'onDelete':_0x3b2b('0x114'),'foreignKey':_0x3b2b('0x1b5')});db['ZendeskConfiguration']['hasMany'](db[_0x3b2b('0x1c2')],{'as':_0x3b2b('0x1b6'),'foreignKey':_0x3b2b('0x1b7')});db[_0x3b2b('0xb5')][_0x3b2b('0x115')](db['ZendeskField'],{'as':_0x3b2b('0x1b8'),'foreignKey':_0x3b2b('0x1b9')});db[_0x3b2b('0xb5')][_0x3b2b('0x115')](db[_0x3b2b('0x1c2')],{'as':_0x3b2b('0x1b0'),'foreignKey':'FieldId'});db[_0x3b2b('0xb5')][_0x3b2b('0x123')](db['ZendeskAccount'],{'as':'Account','foreignKey':'AccountId'});db[_0x3b2b('0xb5')][_0x3b2b('0x125')](db[_0x3b2b('0x8f')],{'through':_0x3b2b('0x1c3')});db[_0x3b2b('0x1c2')][_0x3b2b('0x115')](db['ZendeskField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x3b2b('0x1c2')][_0x3b2b('0x115')](db[_0x3b2b('0x1c2')],{'as':_0x3b2b('0x1bc'),'foreignKey':'DescriptionId'});db[_0x3b2b('0x1c2')][_0x3b2b('0x115')](db[_0x3b2b('0x1c2')],{'as':'Field','foreignKey':_0x3b2b('0x1ba')});db[_0x3b2b('0x1c2')][_0x3b2b('0x123')](db[_0x3b2b('0x1be')],{'as':_0x3b2b('0x1be'),'foreignKey':_0x3b2b('0x1bf')});db[_0x3b2b('0xb8')][_0x3b2b('0x115')](db['FreshdeskConfiguration'],{'as':_0x3b2b('0x1b4'),'onDelete':_0x3b2b('0x114'),'foreignKey':'AccountId'});db[_0x3b2b('0xba')][_0x3b2b('0x115')](db[_0x3b2b('0xbc')],{'as':_0x3b2b('0x1b6'),'onDelete':'cascade','foreignKey':_0x3b2b('0x1b7')});db['FreshdeskConfiguration']['hasMany'](db[_0x3b2b('0xbc')],{'as':_0x3b2b('0x1b8'),'onDelete':_0x3b2b('0x114'),'foreignKey':_0x3b2b('0x1b9')});db[_0x3b2b('0xba')][_0x3b2b('0x115')](db[_0x3b2b('0xbc')],{'as':_0x3b2b('0x1b0'),'onDelete':_0x3b2b('0x114'),'foreignKey':_0x3b2b('0x1ba')});db[_0x3b2b('0xba')][_0x3b2b('0x123')](db[_0x3b2b('0xb8')],{'as':_0x3b2b('0x169'),'foreignKey':'AccountId'});db['FreshdeskConfiguration']['belongsToMany'](db[_0x3b2b('0x8f')],{'through':_0x3b2b('0x1c4')});db[_0x3b2b('0xbc')][_0x3b2b('0x115')](db[_0x3b2b('0xbc')],{'as':'Subject','foreignKey':_0x3b2b('0x1b7')});db[_0x3b2b('0xbc')]['hasMany'](db[_0x3b2b('0xbc')],{'as':_0x3b2b('0x1bc'),'foreignKey':_0x3b2b('0x1b9')});db['FreshdeskField'][_0x3b2b('0x115')](db[_0x3b2b('0xbc')],{'as':'Field','foreignKey':'FieldId'});db['FreshdeskField'][_0x3b2b('0x123')](db['Variable'],{'as':_0x3b2b('0x1be'),'foreignKey':_0x3b2b('0x1bf')});db[_0x3b2b('0xbe')][_0x3b2b('0x115')](db[_0x3b2b('0xc0')],{'as':_0x3b2b('0x1b4'),'onDelete':'cascade','foreignKey':_0x3b2b('0x1b5')});db[_0x3b2b('0xc0')][_0x3b2b('0x115')](db['VtigerField'],{'as':'Subjects','foreignKey':_0x3b2b('0x1b7')});db['VtigerConfiguration'][_0x3b2b('0x115')](db['VtigerField'],{'as':'Descriptions','foreignKey':_0x3b2b('0x1b9')});db[_0x3b2b('0xc0')]['hasMany'](db[_0x3b2b('0xc2')],{'as':'Fields','foreignKey':'FieldId'});db[_0x3b2b('0xc0')][_0x3b2b('0x123')](db[_0x3b2b('0xbe')],{'as':_0x3b2b('0x169'),'foreignKey':_0x3b2b('0x1b5')});db[_0x3b2b('0xc2')][_0x3b2b('0x115')](db['VtigerField'],{'as':_0x3b2b('0x1bb'),'foreignKey':_0x3b2b('0x1b7')});db[_0x3b2b('0xc2')][_0x3b2b('0x115')](db[_0x3b2b('0xc2')],{'as':'Description','foreignKey':_0x3b2b('0x1b9')});db['VtigerField'][_0x3b2b('0x115')](db[_0x3b2b('0xc2')],{'as':_0x3b2b('0x1bd'),'foreignKey':_0x3b2b('0x1ba')});db['VtigerField'][_0x3b2b('0x123')](db['Variable'],{'as':_0x3b2b('0x1be'),'foreignKey':_0x3b2b('0x1bf')});db[_0x3b2b('0x1c5')][_0x3b2b('0x115')](db[_0x3b2b('0xc4')],{'as':_0x3b2b('0x1b4'),'onDelete':_0x3b2b('0x114'),'foreignKey':_0x3b2b('0x1b5')});db[_0x3b2b('0xc4')][_0x3b2b('0x115')](db[_0x3b2b('0xc6')],{'as':'Subjects','foreignKey':'SubjectId'});db[_0x3b2b('0xc4')]['hasMany'](db[_0x3b2b('0xc6')],{'as':_0x3b2b('0x1b8'),'foreignKey':_0x3b2b('0x1b9')});db[_0x3b2b('0xc4')]['hasMany'](db[_0x3b2b('0xc6')],{'as':'Fields','foreignKey':_0x3b2b('0x1ba')});db['ServicenowConfiguration'][_0x3b2b('0x123')](db[_0x3b2b('0x1c5')],{'as':'Account','foreignKey':_0x3b2b('0x1b5')});db[_0x3b2b('0xc6')][_0x3b2b('0x115')](db[_0x3b2b('0xc6')],{'as':'Subject','foreignKey':_0x3b2b('0x1b7')});db['ServicenowField'][_0x3b2b('0x115')](db['ServicenowField'],{'as':'Description','foreignKey':'DescriptionId'});db[_0x3b2b('0xc6')][_0x3b2b('0x115')](db['ServicenowField'],{'as':'Field','foreignKey':_0x3b2b('0x1ba')});db['ServicenowField'][_0x3b2b('0x123')](db[_0x3b2b('0x1be')],{'as':'Variable','foreignKey':_0x3b2b('0x1bf')});db[_0x3b2b('0xc8')][_0x3b2b('0x115')](db['Dynamics365Configuration'],{'as':_0x3b2b('0x1b4'),'onDelete':_0x3b2b('0x114'),'foreignKey':'AccountId'});db['Dynamics365Configuration'][_0x3b2b('0x115')](db[_0x3b2b('0xcb')],{'as':'Subjects','onDelete':'cascade','foreignKey':_0x3b2b('0x1b7')});db['Dynamics365Configuration'][_0x3b2b('0x115')](db[_0x3b2b('0xcb')],{'as':_0x3b2b('0x1b8'),'onDelete':_0x3b2b('0x114'),'foreignKey':_0x3b2b('0x1b9')});db[_0x3b2b('0x1c6')]['hasMany'](db[_0x3b2b('0xcb')],{'as':_0x3b2b('0x1b0'),'onDelete':_0x3b2b('0x114'),'foreignKey':_0x3b2b('0x1ba')});db['Dynamics365Configuration'][_0x3b2b('0x123')](db['Dynamics365Account'],{'as':_0x3b2b('0x169'),'foreignKey':_0x3b2b('0x1b5')});db[_0x3b2b('0xcb')][_0x3b2b('0x115')](db['Dynamics365Field'],{'as':'Subject','foreignKey':_0x3b2b('0x1b7')});db[_0x3b2b('0xcb')][_0x3b2b('0x115')](db[_0x3b2b('0xcb')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x3b2b('0xcb')][_0x3b2b('0x115')](db[_0x3b2b('0xcb')],{'as':_0x3b2b('0x1bd'),'foreignKey':_0x3b2b('0x1ba')});db[_0x3b2b('0xcb')][_0x3b2b('0x123')](db[_0x3b2b('0x1be')],{'as':_0x3b2b('0x1be'),'foreignKey':_0x3b2b('0x1bf')});db['FreshsalesAccount'][_0x3b2b('0x115')](db[_0x3b2b('0xce')],{'as':_0x3b2b('0x1b4'),'onDelete':_0x3b2b('0x114'),'foreignKey':_0x3b2b('0x1b5')});db[_0x3b2b('0xce')][_0x3b2b('0x115')](db[_0x3b2b('0xd0')],{'as':'Subjects','foreignKey':_0x3b2b('0x1b7')});db[_0x3b2b('0xce')][_0x3b2b('0x115')](db[_0x3b2b('0xd0')],{'as':_0x3b2b('0x1b8'),'foreignKey':_0x3b2b('0x1b9')});db[_0x3b2b('0xce')][_0x3b2b('0x115')](db[_0x3b2b('0xd0')],{'as':_0x3b2b('0x1b0'),'foreignKey':_0x3b2b('0x1ba')});db[_0x3b2b('0xce')][_0x3b2b('0x123')](db['FreshsalesAccount'],{'as':_0x3b2b('0x169'),'foreignKey':'AccountId'});db[_0x3b2b('0xd0')][_0x3b2b('0x115')](db[_0x3b2b('0xd0')],{'as':'Subject','foreignKey':_0x3b2b('0x1b7')});db[_0x3b2b('0xd0')]['hasMany'](db['FreshsalesField'],{'as':_0x3b2b('0x1bc'),'foreignKey':_0x3b2b('0x1b9')});db[_0x3b2b('0xd0')][_0x3b2b('0x115')](db['FreshsalesField'],{'as':_0x3b2b('0x1bd'),'foreignKey':_0x3b2b('0x1ba')});db[_0x3b2b('0xd0')][_0x3b2b('0x123')](db[_0x3b2b('0x1be')],{'as':_0x3b2b('0x1be'),'foreignKey':'VariableId'});db[_0x3b2b('0xd2')]['belongsTo'](db[_0x3b2b('0x61')],{});db[_0x3b2b('0xd2')][_0x3b2b('0x123')](db[_0x3b2b('0x137')],{'as':_0x3b2b('0x177'),'foreignKey':_0x3b2b('0x165')});db[_0x3b2b('0xd2')]['belongsTo'](db['CmContact'],{'as':_0x3b2b('0x16a'),'foreignKey':_0x3b2b('0x15d')});db[_0x3b2b('0xd2')]['belongsTo'](db['ChatInteraction'],{});db[_0x3b2b('0xd2')][_0x3b2b('0x123')](db[_0x3b2b('0x69')],{});db[_0x3b2b('0xd2')][_0x3b2b('0x123')](db[_0x3b2b('0x14')],{});db[_0x3b2b('0xd2')][_0x3b2b('0x123')](db[_0x3b2b('0x6c')],{});db[_0x3b2b('0x1c7')][_0x3b2b('0x123')](db['User'],{'onDelete':_0x3b2b('0x114'),'foreignKey':_0x3b2b('0x1c8')});db[_0x3b2b('0x1c7')]['belongsTo'](db['User'],{'onDelete':'cascade','foreignKey':_0x3b2b('0x1c9')});db['JscriptySessionReport']['hasMany'](db[_0x3b2b('0xd6')],{'foreignKey':_0x3b2b('0x1ca'),'onDelete':_0x3b2b('0x114')});db[_0x3b2b('0xd8')]['hasMany'](db[_0x3b2b('0xd5')],{'foreignKey':'SessionId','onDelete':_0x3b2b('0x114')});db[_0x3b2b('0xda')][_0x3b2b('0x123')](db[_0x3b2b('0x51')],{});db[_0x3b2b('0xda')]['belongsTo'](db['CmList'],{'as':_0x3b2b('0x177'),'foreignKey':'ListId'});db[_0x3b2b('0xda')][_0x3b2b('0x123')](db[_0x3b2b('0x127')],{'as':_0x3b2b('0x16a'),'foreignKey':_0x3b2b('0x15d')});db[_0x3b2b('0xda')][_0x3b2b('0x123')](db['SmsInteraction'],{});db['SmsQueueReport'][_0x3b2b('0x123')](db[_0x3b2b('0x55')],{});db[_0x3b2b('0xda')][_0x3b2b('0x123')](db[_0x3b2b('0x14')],{});db[_0x3b2b('0xda')][_0x3b2b('0x123')](db[_0x3b2b('0x57')],{});db['JscriptyProject'][_0x3b2b('0x115')](db[_0x3b2b('0xd8')],{'foreignKey':_0x3b2b('0x1cb')});db[_0x3b2b('0xdf')][_0x3b2b('0x115')](db[_0x3b2b('0xd6')],{'foreignKey':_0x3b2b('0x1cb')});db[_0x3b2b('0xdf')][_0x3b2b('0x115')](db[_0x3b2b('0xd5')],{'foreignKey':'ProjectId'});db['SquareProject'][_0x3b2b('0x125')](db['User'],{'as':_0x3b2b('0x16e'),'through':_0x3b2b('0x143')});db[_0x3b2b('0xe6')]['belongsToMany'](db['User'],{'as':_0x3b2b('0x155'),'through':_0x3b2b('0x1cc')});db[_0x3b2b('0xe6')][_0x3b2b('0x125')](db[_0x3b2b('0x1a')],{'through':_0x3b2b('0x10f'),'as':_0x3b2b('0x12f')});db[_0x3b2b('0xe6')][_0x3b2b('0x125')](db['MailQueue'],{'through':_0x3b2b('0x168'),'as':_0x3b2b('0x131')});db[_0x3b2b('0xe6')][_0x3b2b('0x125')](db[_0x3b2b('0x6c')],{'through':_0x3b2b('0x196'),'as':_0x3b2b('0x1cd')});db[_0x3b2b('0xe6')][_0x3b2b('0x125')](db[_0x3b2b('0x4f')],{'through':_0x3b2b('0x181'),'as':_0x3b2b('0x133')});db['Team']['belongsToMany'](db[_0x3b2b('0x57')],{'through':'team_has_sms_queues','as':_0x3b2b('0x1ce')});db[_0x3b2b('0xe6')][_0x3b2b('0x125')](db[_0x3b2b('0x134')],{'through':'team_has_openchannel_queues','as':_0x3b2b('0x135')});db[_0x3b2b('0xe6')]['belongsToMany'](db[_0x3b2b('0x10c')],{'through':_0x3b2b('0x1cf'),'as':_0x3b2b('0x1d0')});db[_0x3b2b('0xe6')]['belongsToMany'](db[_0x3b2b('0xf9')],{'through':_0x3b2b('0x111'),'as':_0x3b2b('0x1d1')});db[_0x3b2b('0xea')][_0x3b2b('0x115')](db['CmHopper'],{'as':'Hoppers','foreignKey':_0x3b2b('0x1d2')});db[_0x3b2b('0xea')][_0x3b2b('0x115')](db['CmHopperFinal'],{'as':_0x3b2b('0x14d'),'foreignKey':_0x3b2b('0x1d2')});db[_0x3b2b('0xea')][_0x3b2b('0x115')](db[_0x3b2b('0x7a')],{'as':_0x3b2b('0x14e'),'foreignKey':_0x3b2b('0x1d2')});db['Campaign'][_0x3b2b('0x115')](db[_0x3b2b('0x77')],{'as':_0x3b2b('0x14f'),'foreignKey':_0x3b2b('0x1d2')});db['Campaign']['belongsTo'](db[_0x3b2b('0x29')],{'as':'Trunk','foreignKey':_0x3b2b('0x150')});db[_0x3b2b('0xea')][_0x3b2b('0x123')](db['Trunk'],{'as':'TrunkBackup','foreignKey':_0x3b2b('0x1d3')});db[_0x3b2b('0xea')][_0x3b2b('0x123')](db[_0x3b2b('0x152')],{'as':_0x3b2b('0x152'),'foreignKey':_0x3b2b('0x153')});db[_0x3b2b('0xea')][_0x3b2b('0x123')](db[_0x3b2b('0x142')],{'as':_0x3b2b('0x142'),'foreignKey':_0x3b2b('0x1d4')});db[_0x3b2b('0xea')][_0x3b2b('0x125')](db[_0x3b2b('0x137')],{'as':_0x3b2b('0x129'),'through':_0x3b2b('0x1d5')});db['Campaign'][_0x3b2b('0x125')](db[_0x3b2b('0x137')],{'as':_0x3b2b('0x1d6'),'through':_0x3b2b('0x1d7')});db[_0x3b2b('0x170')]['belongsTo'](db[_0x3b2b('0x174')],{'as':'ChatOfflineMessage','foreignKey':'ChatOfflineMessageId'});db[_0x3b2b('0xee')][_0x3b2b('0x123')](db['MailMessage'],{});db['MailTransferReport']['belongsTo'](db[_0x3b2b('0x41')],{});db[_0x3b2b('0xee')]['belongsTo'](db[_0x3b2b('0x3b')],{'foreignKey':_0x3b2b('0x1d8'),'as':'FromAccount'});db['MailTransferReport'][_0x3b2b('0x123')](db['User'],{'foreignKey':_0x3b2b('0x1d9'),'as':'FromAgent'});db[_0x3b2b('0xee')][_0x3b2b('0x123')](db['User'],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x3b2b('0xee')][_0x3b2b('0x123')](db['MailQueue'],{'foreignKey':_0x3b2b('0x1da'),'as':'ToQueue'});db[_0x3b2b('0xee')][_0x3b2b('0x123')](db[_0x3b2b('0x3b')],{'foreignKey':'ToMailAccountId','as':_0x3b2b('0x1db')});db[_0x3b2b('0xf0')][_0x3b2b('0x123')](db[_0x3b2b('0x69')],{});db['ChatTransferReport'][_0x3b2b('0x123')](db['ChatInteraction'],{});db['ChatTransferReport'][_0x3b2b('0x123')](db[_0x3b2b('0x61')],{'foreignKey':_0x3b2b('0x1dc'),'as':'FromAccount'});db[_0x3b2b('0xf0')]['belongsTo'](db[_0x3b2b('0x14')],{'foreignKey':'FromUserId','as':_0x3b2b('0x1dd')});db[_0x3b2b('0xf0')][_0x3b2b('0x123')](db['User'],{'foreignKey':_0x3b2b('0x1de'),'as':_0x3b2b('0x1df')});db[_0x3b2b('0xf0')][_0x3b2b('0x123')](db[_0x3b2b('0x6c')],{'foreignKey':'ToChatQueueId','as':_0x3b2b('0x1e0')});db[_0x3b2b('0xf0')][_0x3b2b('0x123')](db[_0x3b2b('0x61')],{'foreignKey':_0x3b2b('0x1e1'),'as':_0x3b2b('0x1db')});db[_0x3b2b('0xf2')][_0x3b2b('0x123')](db[_0x3b2b('0x4e')],{});db[_0x3b2b('0xf2')][_0x3b2b('0x123')](db[_0x3b2b('0x4d')],{});db['FaxTransferReport'][_0x3b2b('0x123')](db[_0x3b2b('0x4a')],{'foreignKey':_0x3b2b('0x1e2'),'as':_0x3b2b('0x1e3')});db[_0x3b2b('0xf2')][_0x3b2b('0x123')](db[_0x3b2b('0x14')],{'foreignKey':_0x3b2b('0x1d9'),'as':_0x3b2b('0x1dd')});db['FaxTransferReport'][_0x3b2b('0x123')](db[_0x3b2b('0x14')],{'foreignKey':_0x3b2b('0x1de'),'as':'ToAgent'});db[_0x3b2b('0xf2')][_0x3b2b('0x123')](db[_0x3b2b('0x4f')],{'foreignKey':_0x3b2b('0x1e4'),'as':_0x3b2b('0x1e0')});db[_0x3b2b('0xf2')][_0x3b2b('0x123')](db['FaxAccount'],{'foreignKey':'ToFaxAccountId','as':_0x3b2b('0x1db')});db['OpenchannelTransferReport']['belongsTo'](db[_0x3b2b('0x5e')],{});db[_0x3b2b('0xf4')][_0x3b2b('0x123')](db[_0x3b2b('0x11c')],{});db[_0x3b2b('0xf4')][_0x3b2b('0x123')](db[_0x3b2b('0x59')],{'foreignKey':_0x3b2b('0x1e5'),'as':_0x3b2b('0x1e3')});db[_0x3b2b('0xf4')][_0x3b2b('0x123')](db['User'],{'foreignKey':'FromUserId','as':_0x3b2b('0x1dd')});db[_0x3b2b('0xf4')][_0x3b2b('0x123')](db[_0x3b2b('0x14')],{'foreignKey':_0x3b2b('0x1de'),'as':_0x3b2b('0x1df')});db['OpenchannelTransferReport'][_0x3b2b('0x123')](db[_0x3b2b('0x134')],{'foreignKey':_0x3b2b('0x1e6'),'as':_0x3b2b('0x1e0')});db['OpenchannelTransferReport'][_0x3b2b('0x123')](db[_0x3b2b('0x59')],{'foreignKey':'ToOpenchannelAccountId','as':_0x3b2b('0x1db')});db[_0x3b2b('0xf6')][_0x3b2b('0x123')](db[_0x3b2b('0x55')],{});db[_0x3b2b('0xf6')]['belongsTo'](db[_0x3b2b('0x54')],{});db[_0x3b2b('0xf6')][_0x3b2b('0x123')](db[_0x3b2b('0x51')],{'foreignKey':_0x3b2b('0x1e7'),'as':'FromAccount'});db[_0x3b2b('0xf6')][_0x3b2b('0x123')](db[_0x3b2b('0x14')],{'foreignKey':_0x3b2b('0x1d9'),'as':_0x3b2b('0x1dd')});db[_0x3b2b('0xf6')][_0x3b2b('0x123')](db[_0x3b2b('0x14')],{'foreignKey':_0x3b2b('0x1de'),'as':_0x3b2b('0x1df')});db[_0x3b2b('0xf6')][_0x3b2b('0x123')](db[_0x3b2b('0x57')],{'foreignKey':_0x3b2b('0x1e8'),'as':'ToQueue'});db[_0x3b2b('0xf6')]['belongsTo'](db['SmsAccount'],{'foreignKey':_0x3b2b('0x1e9'),'as':_0x3b2b('0x1db')});db[_0x3b2b('0x137')][_0x3b2b('0x115')](db['Disposition'],{'as':_0x3b2b('0x164'),'foreignKey':_0x3b2b('0x165'),'onDelete':_0x3b2b('0x114')});db[_0x3b2b('0x137')][_0x3b2b('0x115')](db[_0x3b2b('0x7c')],{'as':_0x3b2b('0x1ea'),'foreignKey':_0x3b2b('0x165')});db['CmList'][_0x3b2b('0x115')](db['CmContact'],{'as':_0x3b2b('0x128'),'onDelete':'cascade','foreignKey':'ListId'});db[_0x3b2b('0x137')]['hasMany'](db['CmHopperFinal'],{'as':_0x3b2b('0x14d'),'foreignKey':_0x3b2b('0x165')});db[_0x3b2b('0x137')]['hasMany'](db[_0x3b2b('0x7a')],{'as':'HopperHistory','foreignKey':_0x3b2b('0x165')});db[_0x3b2b('0x137')]['hasMany'](db[_0x3b2b('0x11b')],{'as':_0x3b2b('0x11b'),'foreignKey':_0x3b2b('0x165')});db[_0x3b2b('0x137')][_0x3b2b('0x125')](db[_0x3b2b('0x1a')],{'as':_0x3b2b('0x1eb'),'through':'voice_queues_has_cm_lists'});db[_0x3b2b('0x137')][_0x3b2b('0x125')](db[_0x3b2b('0x14')],{'as':_0x3b2b('0x155'),'through':_0x3b2b('0x138')});db[_0x3b2b('0xf9')][_0x3b2b('0x115')](db[_0x3b2b('0x18')],{'as':_0x3b2b('0x119'),'onDelete':_0x3b2b('0x114')});db[_0x3b2b('0xf9')][_0x3b2b('0x125')](db['User'],{'as':_0x3b2b('0x155'),'through':'UserVoicePrefix'});db[_0x3b2b('0xf9')][_0x3b2b('0x125')](db[_0x3b2b('0xe6')],{'through':'TeamVoicePrefix','as':_0x3b2b('0x156')});db[_0x3b2b('0xfb')]['hasMany'](db['User'],{'as':_0x3b2b('0x16e'),'foreignKey':_0x3b2b('0x124')});db[_0x3b2b('0xfb')][_0x3b2b('0x115')](db[_0x3b2b('0xfd')],{'as':_0x3b2b('0x1ec'),'foreignKey':'userProfileId','onDelete':_0x3b2b('0x114')});db[_0x3b2b('0xfd')][_0x3b2b('0x115')](db['UserProfileResource'],{'as':'Resources','foreignKey':_0x3b2b('0x1ed'),'onDelete':'cascade'});db[_0x3b2b('0x103')]['hasMany'](db[_0x3b2b('0x163')],{'as':_0x3b2b('0x164'),'foreignKey':'WhatsappAccountId','onDelete':_0x3b2b('0x114')});db['WhatsappAccount']['hasMany'](db[_0x3b2b('0x81')],{'as':_0x3b2b('0x184'),'foreignKey':_0x3b2b('0x1ee')});db['WhatsappAccount'][_0x3b2b('0x115')](db[_0x3b2b('0x107')],{'as':_0x3b2b('0x157'),'foreignKey':_0x3b2b('0x1ee')});db[_0x3b2b('0x103')][_0x3b2b('0x115')](db['WhatsappInteraction'],{'as':'Interactions'});db[_0x3b2b('0x103')][_0x3b2b('0x115')](db[_0x3b2b('0x104')],{'as':_0x3b2b('0x147')});db[_0x3b2b('0x103')][_0x3b2b('0x123')](db[_0x3b2b('0x137')],{'as':_0x3b2b('0x177'),'foreignKey':_0x3b2b('0x165')});db[_0x3b2b('0x103')][_0x3b2b('0x123')](db[_0x3b2b('0x17c')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x3b2b('0x103')][_0x3b2b('0x125')](db[_0x3b2b('0x14')],{'as':_0x3b2b('0x155'),'through':_0x3b2b('0x1ef')});db[_0x3b2b('0x104')][_0x3b2b('0x123')](db['User'],{'onDelete':_0x3b2b('0x161')});db[_0x3b2b('0x104')][_0x3b2b('0x123')](db[_0x3b2b('0x10c')],{'onDelete':_0x3b2b('0x161')});db[_0x3b2b('0x104')][_0x3b2b('0x123')](db['WhatsappAccount'],{'onDelete':_0x3b2b('0x161')});db[_0x3b2b('0x104')][_0x3b2b('0x123')](db['Interval'],{'onDelete':'restrict','foreignKey':_0x3b2b('0x153')});db[_0x3b2b('0x104')][_0x3b2b('0x123')](db[_0x3b2b('0x8f')],{'onDelete':_0x3b2b('0x161'),'foreignKey':_0x3b2b('0x176')});db[_0x3b2b('0x105')][_0x3b2b('0x115')](db[_0x3b2b('0x107')],{'as':_0x3b2b('0x157'),'onDelete':_0x3b2b('0x114'),'foreignKey':_0x3b2b('0x1f0')});db[_0x3b2b('0x105')][_0x3b2b('0x123')](db[_0x3b2b('0x103')],{'as':_0x3b2b('0x169'),'foreignKey':_0x3b2b('0x1ee')});db[_0x3b2b('0x105')][_0x3b2b('0x123')](db['CmContact'],{'as':_0x3b2b('0x16a'),'foreignKey':'ContactId'});db['WhatsappInteraction'][_0x3b2b('0x123')](db[_0x3b2b('0x14')],{'as':'Owner','foreignKey':_0x3b2b('0x117')});db['WhatsappInteraction'][_0x3b2b('0x125')](db[_0x3b2b('0x8f')],{'through':'whatsapp_interaction_has_tags','as':_0x3b2b('0x16d')});db[_0x3b2b('0x105')]['belongsToMany'](db['Tag'],{'through':_0x3b2b('0x1aa'),'as':_0x3b2b('0x188')});db['WhatsappInteraction'][_0x3b2b('0x125')](db['User'],{'as':_0x3b2b('0x16e'),'through':_0x3b2b('0x1f1'),'foreignKey':_0x3b2b('0x1f0')});db[_0x3b2b('0x107')][_0x3b2b('0x123')](db[_0x3b2b('0x14')],{'as':'User'});db[_0x3b2b('0x107')][_0x3b2b('0x123')](db[_0x3b2b('0x127')],{'onDelete':'cascade','as':'Contact'});db['WhatsappMessage'][_0x3b2b('0x123')](db[_0x3b2b('0x105')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x3b2b('0x1f0')});db['WhatsappMessage'][_0x3b2b('0x123')](db[_0x3b2b('0x103')],{'as':_0x3b2b('0x169'),'foreignKey':_0x3b2b('0x1ee')});db[_0x3b2b('0x109')][_0x3b2b('0x123')](db[_0x3b2b('0x103')],{});db['WhatsappQueueReport'][_0x3b2b('0x123')](db['CmList'],{'as':_0x3b2b('0x177'),'foreignKey':_0x3b2b('0x165')});db['WhatsappQueueReport'][_0x3b2b('0x123')](db[_0x3b2b('0x127')],{'as':_0x3b2b('0x16a'),'foreignKey':_0x3b2b('0x15d')});db['WhatsappQueueReport'][_0x3b2b('0x123')](db['WhatsappInteraction'],{});db[_0x3b2b('0x109')][_0x3b2b('0x123')](db['WhatsappQueue'],{});db[_0x3b2b('0x109')][_0x3b2b('0x123')](db[_0x3b2b('0x107')],{});db['WhatsappQueueReport'][_0x3b2b('0x123')](db[_0x3b2b('0x14')],{});db['WhatsappTransferReport']['belongsTo'](db[_0x3b2b('0x107')],{});db['WhatsappTransferReport'][_0x3b2b('0x123')](db[_0x3b2b('0x105')],{});db['WhatsappTransferReport'][_0x3b2b('0x123')](db[_0x3b2b('0x103')],{'foreignKey':'FromWhatsappAccountId','as':_0x3b2b('0x1e3')});db[_0x3b2b('0x1f2')][_0x3b2b('0x123')](db[_0x3b2b('0x103')],{'foreignKey':_0x3b2b('0x1f3'),'as':_0x3b2b('0x1db')});db[_0x3b2b('0x1f2')][_0x3b2b('0x123')](db[_0x3b2b('0x10c')],{'foreignKey':_0x3b2b('0x1f4'),'as':_0x3b2b('0x1e0')});db[_0x3b2b('0x1f2')][_0x3b2b('0x123')](db[_0x3b2b('0x14')],{'foreignKey':_0x3b2b('0x1d9'),'as':'FromAgent'});db['WhatsappTransferReport'][_0x3b2b('0x123')](db[_0x3b2b('0x14')],{'foreignKey':_0x3b2b('0x1de'),'as':'ToAgent'});db[_0x3b2b('0x10c')]['belongsToMany'](db['User'],{'as':_0x3b2b('0x155'),'through':'UserWhatsappQueue','foreignKey':_0x3b2b('0x1f5')});db[_0x3b2b('0x10c')][_0x3b2b('0x125')](db[_0x3b2b('0xe6')],{'through':_0x3b2b('0x1cf'),'as':_0x3b2b('0x156')});db[_0x3b2b('0x15f')][_0x3b2b('0x113')](db['MailServerIn'],{'as':'Imap','onDelete':'restrict'});db[_0x3b2b('0x15f')][_0x3b2b('0x113')](db[_0x3b2b('0x39')],{'as':_0x3b2b('0x1f6'),'onDelete':_0x3b2b('0x161')});module[_0x3b2b('0x1f7')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x62da=['SmsQueues','OpenchannelQueues','WhatsappQueues','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProject','SquareProjects','user_has_square_projects','SpiedAgents','VoiceContext','Applications','Sounds','moh_has_sounds','VoiceQueueId','Hoppers','HopperFinals','HopperHistories','HopperBlacks','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','ScreenRecording','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','AgentReports','Contact','MailAccountId','restrict','Smtp','Dispositions','Interactions','MailApplication','List','ListId','team_has_mail_queues','Account','ContactId','Owner','Tags','mail_interaction_has_tags','ThroughTags','MailInteractionId','Interaction','ChatOfflineMessageId','Tag','TagId','MailQueueReport','Items','FaxAccountId','Exntensions','fax_interaction_has_tags','Users','FaxInteractionId','AttachmentId','team_has_fax_queues','SmsAccountId','Answers','SmsApplication','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelInteractionId','openchannel_interaction_has_tags','user_has_openchannel_interactions','OpenchannelQueueId','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatMessage','ChatInteractionId','chat_interaction_has_tags','Attachments','team_has_chat_queues','ChatGroupId','Members','SmsInteractions','Company','CompanyId','cm_contact_has_tags','CampaignId','OwnerId','All','OneAll','AutomationAllId','Any','OneAny','Actions','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','DefaultReportId','AnalyticCustomReport','CustomReportId','Mohs','whatsapp_interaction_has_tags','AllConditions','TriggerAllId','AnyConditions','TriggerAnyId','AnalyticFieldReport','Fields','AnalyticDefaultReport','MetricId','AccountId','Subjects','SubjectId','Descriptions','FieldId','Subject','Description','Field','Variable','VariableId','Configurations','SugarcrmConfiguration','DeskAccount','DescriptionId','int_desk_configuration_has_tags','ZendeskConfiguration','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','VtigerField','Dynamics365Configuration','FromId','ToId','SessionId','ProjectId','FaxQueues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','ToAgent','ToMailAccountId','ToAccount','FromChatWebsiteId','FromUserId','ToUserId','ToChatQueueId','ToQueue','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','FromAgent','ToOpenchannelQueueId','SmsTransferReport','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','Queues','UserProfileSections','sectionId','WhatsappAccountId','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','team_has_whatsapp_queues','../config/environment','lodash','jstz','determine','sequelize','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','defaultsDeep','database','username','password','options','User','import','VoiceChanSpy','../api/voiceContext/voiceContext.model','VoiceExtension','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','../api/voiceQueue/voiceQueue.model','../api/voiceRecording/voiceRecording.model','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','../api/voiceDialReport/voiceDialReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','MailInteraction','MailMessage','../api/mailMessage/mailMessage.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','FaxQueue','FaxQueueReport','SmsAccount','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','OpenchannelQueue','ChatWebsite','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatMessage/chatMessage.model','ChatOfflineMessage','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','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/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','FreshdeskField','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','SquareOdbc','../api/squareOdbc/squareOdbc.model','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','FaxTransferReport','OpenchannelTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','hasOne','UserId','hasMany','VoiceRecording','UserVoiceQueueRt','VoiceQueuesRt','Extensions','cascade','HopperHistory','OpenchannelInteraction','ChatInteraction','ChatInteractions','SmsInteraction','FaxInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsTo','userProfileId','chat_group_has_users','CmContact','Contacts','belongsToMany','Lists','cm_user_has_lists','Team','user_has_teams','MailInteractions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','OpenchannelInteractions','user_has_whatsapp_interactions','VoiceQueue','VoiceQueues','VoicePrefix','MailQueues','ChatQueues','UserChatQueue'];(function(_0x5d47f0,_0xcded86){var _0x257793=function(_0x3f1069){while(--_0x3f1069){_0x5d47f0['push'](_0x5d47f0['shift']());}};_0x257793(++_0xcded86);}(_0x62da,0xc0));var _0xa62d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x62da[_0x20a584];return _0x4b41a8;};'use strict';var config=require(_0xa62d('0x0'));var Sequelize=require('sequelize');var _=require(_0xa62d('0x1'));var jstz=require(_0xa62d('0x2'));var timezone=jstz[_0xa62d('0x3')]();config[_0xa62d('0x4')]=_['defaultsDeep'](config[_0xa62d('0x4')],{'database':_0xa62d('0x5'),'username':_0xa62d('0x6'),'password':_0xa62d('0x7'),'options':{'host':_0xa62d('0x8'),'port':0xcea,'dialect':_0xa62d('0x9'),'dialectOptions':{'charset':_0xa62d('0xa')},'logging':![],'timezone':timezone[_0xa62d('0xb')](),'define':{'charset':_0xa62d('0xc'),'collate':_0xa62d('0xd')}}});config[_0xa62d('0xe')]=_[_0xa62d('0xf')](config['sequelizeHistory'],{'database':_0xa62d('0x5'),'username':_0xa62d('0x6'),'password':'xC@LL1234','options':{'host':_0xa62d('0x8'),'port':0xcea,'dialect':_0xa62d('0x9'),'dialectOptions':{'charset':_0xa62d('0xa')},'logging':![],'timezone':timezone[_0xa62d('0xb')](),'define':{'charset':_0xa62d('0xc'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xa62d('0x4')][_0xa62d('0x10')],config[_0xa62d('0x4')][_0xa62d('0x11')],config[_0xa62d('0x4')][_0xa62d('0x12')],config[_0xa62d('0x4')][_0xa62d('0x13')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xa62d('0xe')]['database'],config[_0xa62d('0xe')][_0xa62d('0x11')],config[_0xa62d('0xe')]['password'],config[_0xa62d('0xe')][_0xa62d('0x13')])};db[_0xa62d('0x14')]=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/user/user.model');db[_0xa62d('0x16')]=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/voiceChanSpy/voiceChanSpy.model');db['VoiceContext']=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x17'));db[_0xa62d('0x18')]=db[_0xa62d('0x4')]['import']('../api/voiceExtension/voiceExtension.model');db[_0xa62d('0x19')]=db[_0xa62d('0x4')]['import'](_0xa62d('0x1a'));db['VoiceQueue']=db[_0xa62d('0x4')]['import'](_0xa62d('0x1b'));db['VoiceRecording']=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x1c'));db['ScreenRecording']=db['sequelize'][_0xa62d('0x15')](_0xa62d('0x1d'));db[_0xa62d('0x1e')]=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/voiceMail/voiceMail.model');db['VoiceMailMessage']=db[_0xa62d('0x4')]['import'](_0xa62d('0x1f'));db[_0xa62d('0x20')]=db['sequelize']['import'](_0xa62d('0x21'));db['VoiceDialReport']=db[_0xa62d('0x4')]['import'](_0xa62d('0x22'));db['VoiceAgentReport']=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0xa62d('0x23')]=db['sequelize'][_0xa62d('0x15')](_0xa62d('0x24'));db[_0xa62d('0x25')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x26'));db[_0xa62d('0x27')]=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/trunk/trunk.model');db['VoiceTransferReport']=db[_0xa62d('0x4')]['import'](_0xa62d('0x28'));db['UserVoiceQueueRt']=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0xa62d('0x29')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x2a'));db['UserChatQueue']=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x2b'));db[_0xa62d('0x2c')]=db[_0xa62d('0x4')]['import']('../api/userMailQueue/userMailQueue.model');db[_0xa62d('0x2d')]=db[_0xa62d('0x4')]['import'](_0xa62d('0x2e'));db[_0xa62d('0x2f')]=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/userSmsQueue/userSmsQueue.model');db[_0xa62d('0x30')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x31'));db[_0xa62d('0x32')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x33'));db[_0xa62d('0x34')]=db['sequelize'][_0xa62d('0x15')](_0xa62d('0x35'));db[_0xa62d('0x36')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x37'));db[_0xa62d('0x38')]=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/mailAccount/mailAccount.model');db[_0xa62d('0x39')]=db[_0xa62d('0x4')]['import'](_0xa62d('0x3a'));db[_0xa62d('0x3b')]=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/mailSubstatus/mailSubstatus.model');db[_0xa62d('0x3c')]=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/mailInteraction/mailInteraction.model');db[_0xa62d('0x3d')]=db['sequelize'][_0xa62d('0x15')](_0xa62d('0x3e'));db['MailApplication']=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/mailApplication/mailApplication.model');db['MailQueueReport']=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/mailQueueReport/mailQueueReport.model');db[_0xa62d('0x3f')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x40'));db[_0xa62d('0x41')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x42'));db[_0xa62d('0x43')]=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/faxAccount/faxAccount.model');db[_0xa62d('0x44')]=db['sequelize'][_0xa62d('0x15')](_0xa62d('0x45'));db[_0xa62d('0x46')]=db['sequelize']['import'](_0xa62d('0x47'));db[_0xa62d('0x48')]=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/faxMessage/faxMessage.model');db[_0xa62d('0x49')]=db[_0xa62d('0x4')]['import']('../api/faxQueue/faxQueue.model');db[_0xa62d('0x4a')]=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/faxQueueReport/faxQueueReport.model');db[_0xa62d('0x4b')]=db[_0xa62d('0x4')]['import']('../api/smsAccount/smsAccount.model');db['SmsApplication']=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/smsApplication/smsApplication.model');db['SmsInteraction']=db['sequelize'][_0xa62d('0x15')](_0xa62d('0x4c'));db[_0xa62d('0x4d')]=db['sequelize']['import'](_0xa62d('0x4e'));db[_0xa62d('0x4f')]=db['sequelize']['import'](_0xa62d('0x50'));db[_0xa62d('0x51')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x52'));db[_0xa62d('0x53')]=db['sequelize'][_0xa62d('0x15')](_0xa62d('0x54'));db['OpenchannelInteraction']=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x55'));db[_0xa62d('0x56')]=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/openchannelMessage/openchannelMessage.model');db[_0xa62d('0x57')]=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/openchannelQueue/openchannelQueue.model');db[_0xa62d('0x58')]=db['sequelize'][_0xa62d('0x15')]('../api/chatWebsite/chatWebsite.model');db[_0xa62d('0x59')]=db['sequelize'][_0xa62d('0x15')](_0xa62d('0x5a'));db[_0xa62d('0x5b')]=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/chatApplication/chatApplication.model');db['ChatInteraction']=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/chatInteraction/chatInteraction.model');db['ChatMessage']=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x5c'));db[_0xa62d('0x5d')]=db['sequelize'][_0xa62d('0x15')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0xa62d('0x5e')]=db['sequelize'][_0xa62d('0x15')]('../api/chatQueue/chatQueue.model');db[_0xa62d('0x5f')]=db[_0xa62d('0x4')]['import'](_0xa62d('0x60'));db[_0xa62d('0x61')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x62'));db[_0xa62d('0x63')]=db['sequelize'][_0xa62d('0x15')]('../api/cmCompany/cmCompany.model');db['CmContact']=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x64'));db[_0xa62d('0x65')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x66'));db[_0xa62d('0x67')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x68'));db[_0xa62d('0x69')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x6a'));db[_0xa62d('0x6b')]=db['sequelize'][_0xa62d('0x15')](_0xa62d('0x6c'));db[_0xa62d('0x6d')]=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/reportAgentPreview/reportAgentPreview.model');db[_0xa62d('0x6e')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x6f'));db[_0xa62d('0x70')]=db['sequelize'][_0xa62d('0x15')]('../api/action/action.model');db[_0xa62d('0x71')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x72'));db[_0xa62d('0x73')]=db[_0xa62d('0x4')]['import'](_0xa62d('0x74'));db[_0xa62d('0x75')]=db['sequelize']['import'](_0xa62d('0x76'));db[_0xa62d('0x77')]=db['sequelize'][_0xa62d('0x15')](_0xa62d('0x78'));db[_0xa62d('0x79')]=db['sequelize'][_0xa62d('0x15')](_0xa62d('0x7a'));db[_0xa62d('0x7b')]=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/pause/pause.model');db['Cdr']=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x7c'));db[_0xa62d('0x7d')]=db[_0xa62d('0x4')]['import'](_0xa62d('0x7e'));db[_0xa62d('0x7f')]=db['sequelize'][_0xa62d('0x15')](_0xa62d('0x80'));db[_0xa62d('0x81')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x82'));db['Tag']=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x83'));db[_0xa62d('0x84')]=db['sequelize'][_0xa62d('0x15')](_0xa62d('0x85'));db[_0xa62d('0x86')]=db['sequelize'][_0xa62d('0x15')](_0xa62d('0x87'));db['Variable']=db['sequelize'][_0xa62d('0x15')](_0xa62d('0x88'));db[_0xa62d('0x89')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x8a'));db[_0xa62d('0x8b')]=db['sequelize']['import']('../api/integrationReport/integrationReport.model');db['AnalyticCustomReport']=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/analyticCustomReport/analyticCustomReport.model');db['AnalyticDefaultReport']=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x8c'));db[_0xa62d('0x8d')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x8e'));db[_0xa62d('0x8f')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x90'));db['AnalyticFieldReport']=db['sequelize'][_0xa62d('0x15')](_0xa62d('0x91'));db[_0xa62d('0x92')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x93'));db[_0xa62d('0x94')]=db[_0xa62d('0x4')]['import'](_0xa62d('0x95'));db[_0xa62d('0x96')]=db['sequelize'][_0xa62d('0x15')](_0xa62d('0x97'));db[_0xa62d('0x98')]=db[_0xa62d('0x4')]['import'](_0xa62d('0x99'));db[_0xa62d('0x9a')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x9b'));db['SugarcrmConfiguration']=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0xa62d('0x9c')]=db['sequelize'][_0xa62d('0x15')](_0xa62d('0x9d'));db['DeskAccount']=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x9e'));db[_0xa62d('0x9f')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0xa0'));db[_0xa62d('0xa1')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0xa2'));db[_0xa62d('0xa3')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0xa4'));db[_0xa62d('0xa5')]=db[_0xa62d('0x4')]['import'](_0xa62d('0xa6'));db[_0xa62d('0xa7')]=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/intZohoField/intZohoField.model');db[_0xa62d('0xa8')]=db[_0xa62d('0x4')]['import'](_0xa62d('0xa9'));db['ZendeskConfiguration']=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0xa62d('0xaa')]=db['sequelize'][_0xa62d('0x15')](_0xa62d('0xab'));db[_0xa62d('0xac')]=db[_0xa62d('0x4')]['import'](_0xa62d('0xad'));db[_0xa62d('0xae')]=db['sequelize'][_0xa62d('0x15')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0xa62d('0xaf')]=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/intFreshdeskField/intFreshdeskField.model');db[_0xa62d('0xb0')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0xb1'));db[_0xa62d('0xb2')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0xb3'));db['VtigerField']=db['sequelize'][_0xa62d('0x15')]('../api/intVtigerField/intVtigerField.model');db[_0xa62d('0xb4')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0xb5'));db[_0xa62d('0xb6')]=db[_0xa62d('0x4')]['import'](_0xa62d('0xb7'));db[_0xa62d('0xb8')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0xb9'));db[_0xa62d('0xba')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0xbb'));db['Dynamics365Configuration']=db[_0xa62d('0x4')]['import'](_0xa62d('0xbc'));db[_0xa62d('0xbd')]=db['sequelize'][_0xa62d('0x15')](_0xa62d('0xbe'));db[_0xa62d('0xbf')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0xc0'));db[_0xa62d('0xc1')]=db['sequelize']['import'](_0xa62d('0xc2'));db[_0xa62d('0xc3')]=db['sequelize'][_0xa62d('0x15')](_0xa62d('0xc4'));db[_0xa62d('0x89')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x8a'));db['Network']=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/network/network.model');db[_0xa62d('0xc5')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0xc6'));db[_0xa62d('0xc7')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0xc8'));db[_0xa62d('0xc9')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0xca'));db[_0xa62d('0xcb')]=db[_0xa62d('0x4')]['import']('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0xa62d('0xcc')]=db['sequelize']['import'](_0xa62d('0xcd'));db[_0xa62d('0xce')]=db['sequelize'][_0xa62d('0x15')](_0xa62d('0xcf'));db[_0xa62d('0xd0')]=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/squareReport/squareReport.model');db[_0xa62d('0xd1')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0xd2'));db[_0xa62d('0xd3')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0xd4'));db[_0xa62d('0xd5')]=db['sequelize'][_0xa62d('0x15')]('../api/setting/setting.model');db[_0xa62d('0xd6')]=db[_0xa62d('0x4')]['import'](_0xa62d('0xd7'));db['SquareProject']=db['sequelize'][_0xa62d('0x15')](_0xa62d('0xd8'));db[_0xa62d('0xd9')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0xda'));db[_0xa62d('0xdb')]=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/squareMessage/squareMessage.model');db['Team']=db['sequelize'][_0xa62d('0x15')](_0xa62d('0xdc'));db[_0xa62d('0xdd')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0xde'));db[_0xa62d('0xdf')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0xe0'));db[_0xa62d('0xe1')]=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/migration/migration.model');db[_0xa62d('0xe2')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0xe3'));db[_0xa62d('0xe4')]=db['sequelize'][_0xa62d('0x15')](_0xa62d('0xe5'));db[_0xa62d('0xe6')]=db['sequelize'][_0xa62d('0x15')](_0xa62d('0xe7'));db[_0xa62d('0xe8')]=db['sequelize'][_0xa62d('0x15')]('../api/chatTransferReport/chatTransferReport.model');db[_0xa62d('0xe9')]=db['sequelize']['import']('../api/faxTransferReport/faxTransferReport.model');db[_0xa62d('0xea')]=db['sequelize'][_0xa62d('0x15')]('../api/openchannelTransferReport/openchannelTransferReport.model');db['SmsTransferReport']=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0xeb'));db[_0xa62d('0xec')]=db[_0xa62d('0x4')]['import'](_0xa62d('0xed'));db['VoicePrefix']=db['sequelize'][_0xa62d('0x15')]('../api/voicePrefix/voicePrefix.model');db[_0xa62d('0xee')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0xef'));db[_0xa62d('0xf0')]=db[_0xa62d('0x4')]['import'](_0xa62d('0xf1'));db[_0xa62d('0xf2')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0xf3'));db[_0xa62d('0xf4')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0xf5'));db[_0xa62d('0xf6')]=db[_0xa62d('0x4')]['import'](_0xa62d('0xf7'));db[_0xa62d('0xf8')]=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/whatsappApplication/whatsappApplication.model');db[_0xa62d('0xf9')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0xfa'));db[_0xa62d('0xfb')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0xfc'));db[_0xa62d('0xfd')]=db['sequelize'][_0xa62d('0x15')](_0xa62d('0xfe'));db[_0xa62d('0xff')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x100'));db[_0xa62d('0x101')]=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/whatsappQueue/whatsappQueue.model');db[_0xa62d('0x102')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x103'));db[_0xa62d('0x104')]=db['sequelize'][_0xa62d('0x15')](_0xa62d('0x105'));db[_0xa62d('0x106')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x107'));db['UserVoicePrefix']=db['sequelize']['import']('../api/userVoicePrefix/userVoicePrefix.model');db[_0xa62d('0x14')][_0xa62d('0x108')](db[_0xa62d('0x1e')],{'as':'VoiceMail','onDelete':'cascade','foreignKey':_0xa62d('0x109')});db[_0xa62d('0x14')][_0xa62d('0x10a')](db[_0xa62d('0x10b')],{'as':'Recordings','foreignKey':'UserId'});db[_0xa62d('0x14')][_0xa62d('0x10a')](db[_0xa62d('0x10c')],{'as':_0xa62d('0x10d'),'foreignKey':'UserId'});db[_0xa62d('0x14')]['hasMany'](db[_0xa62d('0x18')],{'as':_0xa62d('0x10e'),'onDelete':_0xa62d('0x10f'),'hooks':!![]});db[_0xa62d('0x14')]['hasMany'](db[_0xa62d('0x69')],{'as':'HopperFinals','foreignKey':_0xa62d('0x109')});db[_0xa62d('0x14')][_0xa62d('0x10a')](db[_0xa62d('0x6b')],{'as':_0xa62d('0x110'),'foreignKey':_0xa62d('0x109')});db[_0xa62d('0x14')]['hasMany'](db[_0xa62d('0x6d')],{'as':_0xa62d('0x6d'),'foreignKey':_0xa62d('0x109')});db[_0xa62d('0x14')][_0xa62d('0x10a')](db[_0xa62d('0x111')],{'as':'OpenchannelInteractions','foreignKey':_0xa62d('0x109')});db['User'][_0xa62d('0x10a')](db[_0xa62d('0x112')],{'as':_0xa62d('0x113'),'foreignKey':_0xa62d('0x109')});db['User'][_0xa62d('0x10a')](db[_0xa62d('0x114')],{'as':'SmsInteractions','foreignKey':'UserId'});db[_0xa62d('0x14')][_0xa62d('0x10a')](db[_0xa62d('0x46')],{'as':_0xa62d('0x115'),'foreignKey':_0xa62d('0x109')});db['User'][_0xa62d('0x10a')](db[_0xa62d('0x3c')],{'as':'MailInteractions','foreignKey':'UserId'});db['User'][_0xa62d('0x10a')](db[_0xa62d('0xf9')],{'as':_0xa62d('0x116'),'foreignKey':'UserId'});db[_0xa62d('0x14')][_0xa62d('0x10a')](db[_0xa62d('0xf4')],{'as':_0xa62d('0x117'),'foreignKey':_0xa62d('0x118')});db['User'][_0xa62d('0x119')](db[_0xa62d('0xee')],{'as':_0xa62d('0xee'),'foreignKey':_0xa62d('0x11a')});db[_0xa62d('0x14')]['belongsToMany'](db[_0xa62d('0x5f')],{'as':'Groups','through':_0xa62d('0x11b')});db['User']['belongsToMany'](db[_0xa62d('0x11c')],{'as':_0xa62d('0x11d'),'through':'cm_user_has_contacts'});db[_0xa62d('0x14')][_0xa62d('0x11e')](db[_0xa62d('0xec')],{'as':_0xa62d('0x11f'),'through':_0xa62d('0x120')});db['User']['belongsToMany'](db[_0xa62d('0x121')],{'through':_0xa62d('0x122')});db['User'][_0xa62d('0x11e')](db['MailInteraction'],{'as':_0xa62d('0x123'),'through':'user_has_mail_interactions'});db[_0xa62d('0x14')]['belongsToMany'](db[_0xa62d('0x112')],{'as':'ChatInteractions','through':_0xa62d('0x124')});db[_0xa62d('0x14')][_0xa62d('0x11e')](db[_0xa62d('0x46')],{'as':_0xa62d('0x115'),'through':_0xa62d('0x125')});db[_0xa62d('0x14')]['belongsToMany'](db['SmsInteraction'],{'as':'SmsInteractions','through':_0xa62d('0x126')});db['User'][_0xa62d('0x11e')](db['OpenchannelInteraction'],{'as':_0xa62d('0x127'),'through':'user_has_openchannel_interactions'});db['User'][_0xa62d('0x11e')](db[_0xa62d('0xf9')],{'as':_0xa62d('0x116'),'through':_0xa62d('0x128')});db['User']['belongsToMany'](db[_0xa62d('0x129')],{'as':_0xa62d('0x12a'),'through':'UserVoiceQueue','required':![]});db['User'][_0xa62d('0x11e')](db[_0xa62d('0x12b')],{'as':'VoicePrefixes','through':'UserVoicePrefix','required':![]});db['User']['belongsToMany'](db[_0xa62d('0x39')],{'as':_0xa62d('0x12c'),'through':_0xa62d('0x2c'),'required':![]});db[_0xa62d('0x14')]['belongsToMany'](db['ChatQueue'],{'as':_0xa62d('0x12d'),'through':_0xa62d('0x12e'),'required':![],'hooks':!![]});db[_0xa62d('0x14')]['belongsToMany'](db['FaxQueue'],{'as':'FaxQueues','through':_0xa62d('0x2d'),'required':![]});db[_0xa62d('0x14')]['belongsToMany'](db[_0xa62d('0x4f')],{'as':_0xa62d('0x12f'),'through':'UserSmsQueue','required':![]});db[_0xa62d('0x14')][_0xa62d('0x11e')](db['OpenchannelQueue'],{'as':_0xa62d('0x130'),'through':'UserOpenchannelQueue','required':![]});db['User'][_0xa62d('0x11e')](db['WhatsappQueue'],{'as':_0xa62d('0x131'),'through':'UserWhatsappQueue','required':![]});db['User'][_0xa62d('0x11e')](db[_0xa62d('0xec')],{'through':'cm_user_has_lists'});db[_0xa62d('0x14')]['belongsToMany'](db['ChatWebsite'],{'as':_0xa62d('0x132'),'through':_0xa62d('0x133')});db['User'][_0xa62d('0x11e')](db[_0xa62d('0x43')],{'as':_0xa62d('0x134'),'through':_0xa62d('0x135')});db[_0xa62d('0x14')][_0xa62d('0x11e')](db['MailAccount'],{'as':_0xa62d('0x136'),'through':_0xa62d('0x137')});db[_0xa62d('0x14')]['belongsToMany'](db[_0xa62d('0x51')],{'as':_0xa62d('0x138'),'through':_0xa62d('0x139')});db[_0xa62d('0x14')][_0xa62d('0x11e')](db[_0xa62d('0x4b')],{'as':_0xa62d('0x13a'),'through':_0xa62d('0x13b')});db[_0xa62d('0x14')]['belongsToMany'](db[_0xa62d('0xf6')],{'as':_0xa62d('0x13c'),'through':_0xa62d('0x13d')});db[_0xa62d('0x14')][_0xa62d('0x11e')](db[_0xa62d('0x13e')],{'as':_0xa62d('0x13f'),'through':_0xa62d('0x140')});db[_0xa62d('0x16')][_0xa62d('0x10a')](db[_0xa62d('0x18')],{'as':_0xa62d('0x141'),'onDelete':_0xa62d('0x10f'),'foreignKey':'ChanSpyId'});db[_0xa62d('0x142')]['hasMany'](db[_0xa62d('0x18')],{'onDelete':'cascade'});db[_0xa62d('0x18')][_0xa62d('0x10a')](db[_0xa62d('0x18')],{'as':_0xa62d('0x143'),'onDelete':_0xa62d('0x10f')});db[_0xa62d('0x19')][_0xa62d('0x11e')](db['Sound'],{'as':_0xa62d('0x144'),'through':_0xa62d('0x145')});db[_0xa62d('0x129')][_0xa62d('0x10a')](db['UserVoiceQueueRt'],{'as':'Members','foreignKey':_0xa62d('0x146')});db['VoiceQueue'][_0xa62d('0x10a')](db[_0xa62d('0x65')],{'as':_0xa62d('0x147'),'foreignKey':_0xa62d('0x146')});db['VoiceQueue'][_0xa62d('0x10a')](db[_0xa62d('0x69')],{'as':_0xa62d('0x148'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0xa62d('0x10a')](db['CmHopperHistory'],{'as':_0xa62d('0x149'),'foreignKey':_0xa62d('0x146')});db[_0xa62d('0x129')][_0xa62d('0x10a')](db['ReportAgentPreview'],{'as':_0xa62d('0x6d'),'foreignKey':'VoiceQueueId'});db[_0xa62d('0x129')][_0xa62d('0x10a')](db['CmHopperBlack'],{'as':_0xa62d('0x14a'),'foreignKey':_0xa62d('0x146')});db['VoiceQueue'][_0xa62d('0x10a')](db['JscriptySessionReport'],{'as':_0xa62d('0x14b'),'foreignKey':_0xa62d('0x146')});db[_0xa62d('0x129')][_0xa62d('0x119')](db[_0xa62d('0x27')],{'as':_0xa62d('0x27'),'foreignKey':_0xa62d('0x14c')});db[_0xa62d('0x129')][_0xa62d('0x119')](db[_0xa62d('0x27')],{'as':_0xa62d('0x14d'),'foreignKey':_0xa62d('0x14e')});db['VoiceQueue'][_0xa62d('0x119')](db[_0xa62d('0x79')],{'as':'Interval','foreignKey':_0xa62d('0x14f')});db[_0xa62d('0x129')][_0xa62d('0x119')](db[_0xa62d('0x7b')],{'as':_0xa62d('0x150'),'foreignKey':_0xa62d('0x151')});db[_0xa62d('0x129')][_0xa62d('0x11e')](db[_0xa62d('0xec')],{'as':_0xa62d('0x11f'),'through':_0xa62d('0x152')});db['VoiceQueue'][_0xa62d('0x11e')](db['User'],{'as':_0xa62d('0x153'),'through':'UserVoiceQueue'});db[_0xa62d('0x129')][_0xa62d('0x11e')](db[_0xa62d('0x121')],{'as':_0xa62d('0x154'),'through':_0xa62d('0x104')});db[_0xa62d('0x129')]['belongsToMany'](db['CmList'],{'as':_0xa62d('0x155'),'through':_0xa62d('0x156')});db[_0xa62d('0x10b')][_0xa62d('0x119')](db['User'],{'as':_0xa62d('0x14'),'foreignKey':'UserId'});db[_0xa62d('0x157')][_0xa62d('0x119')](db[_0xa62d('0x14')],{'as':_0xa62d('0x14'),'foreignKey':'UserId'});db['VoiceMail']['hasMany'](db['VoiceMailMessage'],{'as':_0xa62d('0x158'),'onDelete':_0xa62d('0x10f'),'foreignKey':_0xa62d('0x159'),'sourceKey':'mailbox'});db['VoiceMailMessage']['belongsTo'](db['VoiceMail'],{'foreignKey':'mailboxuser','targetKey':_0xa62d('0x15a')});db[_0xa62d('0x20')][_0xa62d('0x10a')](db['VoiceQueueReport'],{'as':_0xa62d('0x15b'),'foreignKey':_0xa62d('0x15c'),'constraints':![]});db[_0xa62d('0x20')]['hasMany'](db['VoiceAgentReport'],{'as':_0xa62d('0x15d'),'foreignKey':_0xa62d('0x15c'),'constraints':![]});db[_0xa62d('0x20')][_0xa62d('0x119')](db[_0xa62d('0x14')],{'as':'User','foreignKey':_0xa62d('0x109')});db[_0xa62d('0x20')]['belongsTo'](db['CmContact'],{'as':_0xa62d('0x15e'),'foreignKey':'ContactId'});db[_0xa62d('0x34')][_0xa62d('0x119')](db['MailAccount'],{'as':'MailAccount','foreignKey':_0xa62d('0x15f')});db[_0xa62d('0x34')][_0xa62d('0x119')](db[_0xa62d('0x102')],{'as':_0xa62d('0x102'),'foreignKey':'CloudProviderId','onDelete':_0xa62d('0x160')});db[_0xa62d('0x36')][_0xa62d('0x119')](db[_0xa62d('0x38')],{'as':'MailAccount','foreignKey':'MailAccountId'});db[_0xa62d('0x36')][_0xa62d('0x119')](db['CloudProvider'],{'as':'CloudProvider','foreignKey':'CloudProviderId','onDelete':_0xa62d('0x160')});db[_0xa62d('0x38')][_0xa62d('0x108')](db[_0xa62d('0x34')],{'as':'Imap','onDelete':'cascade'});db[_0xa62d('0x38')][_0xa62d('0x108')](db['MailServerOut'],{'as':_0xa62d('0x161'),'onDelete':_0xa62d('0x10f')});db['MailAccount']['hasMany'](db[_0xa62d('0x75')],{'as':_0xa62d('0x162'),'foreignKey':_0xa62d('0x15f'),'onDelete':_0xa62d('0x10f')});db['MailAccount'][_0xa62d('0x10a')](db[_0xa62d('0x73')],{'as':'Answers','foreignKey':'MailAccountId'});db['MailAccount'][_0xa62d('0x10a')](db[_0xa62d('0x3d')],{'as':'Messages','foreignKey':'MailAccountId'});db['MailAccount']['hasMany'](db[_0xa62d('0x3c')],{'as':_0xa62d('0x163')});db['MailAccount'][_0xa62d('0x10a')](db[_0xa62d('0x164')],{'as':_0xa62d('0x143')});db['MailAccount'][_0xa62d('0x119')](db[_0xa62d('0xec')],{'as':_0xa62d('0x165'),'foreignKey':_0xa62d('0x166')});db[_0xa62d('0x38')][_0xa62d('0x119')](db[_0xa62d('0x84')],{'as':_0xa62d('0x84'),'foreignKey':'TemplateId'});db[_0xa62d('0x38')][_0xa62d('0x119')](db[_0xa62d('0x7b')],{'as':_0xa62d('0x150'),'foreignKey':_0xa62d('0x151')});db[_0xa62d('0x38')][_0xa62d('0x11e')](db[_0xa62d('0x14')],{'as':_0xa62d('0x153'),'through':_0xa62d('0x137')});db[_0xa62d('0x39')][_0xa62d('0x11e')](db[_0xa62d('0x14')],{'as':_0xa62d('0x153'),'through':'UserMailQueue'});db[_0xa62d('0x39')]['belongsToMany'](db[_0xa62d('0x121')],{'through':_0xa62d('0x167'),'as':_0xa62d('0x154')});db[_0xa62d('0x3c')][_0xa62d('0x10a')](db['MailMessage'],{'as':_0xa62d('0x158'),'onDelete':_0xa62d('0x10f'),'foreignKey':'MailInteractionId'});db[_0xa62d('0x3c')][_0xa62d('0x119')](db[_0xa62d('0x38')],{'as':_0xa62d('0x168'),'foreignKey':'MailAccountId'});db[_0xa62d('0x3c')][_0xa62d('0x119')](db[_0xa62d('0x11c')],{'as':'Contact','foreignKey':_0xa62d('0x169')});db[_0xa62d('0x3c')][_0xa62d('0x119')](db[_0xa62d('0x14')],{'as':_0xa62d('0x16a'),'foreignKey':_0xa62d('0x109')});db['MailInteraction'][_0xa62d('0x11e')](db['Tag'],{'through':'mail_interaction_has_tags','as':_0xa62d('0x16b')});db[_0xa62d('0x3c')][_0xa62d('0x11e')](db['Tag'],{'through':_0xa62d('0x16c'),'as':_0xa62d('0x16d')});db[_0xa62d('0x3c')][_0xa62d('0x11e')](db['User'],{'as':'Users','through':'user_has_mail_interactions','foreignKey':_0xa62d('0x16e')});db[_0xa62d('0x3d')][_0xa62d('0x10a')](db[_0xa62d('0xe2')],{'as':'Attachments','onDelete':_0xa62d('0x10f')});db['MailMessage'][_0xa62d('0x119')](db[_0xa62d('0x14')],{'as':_0xa62d('0x14')});db[_0xa62d('0x3d')][_0xa62d('0x119')](db[_0xa62d('0x11c')],{'onDelete':_0xa62d('0x10f'),'as':_0xa62d('0x15e')});db[_0xa62d('0x3d')]['belongsTo'](db[_0xa62d('0x3c')],{'as':_0xa62d('0x16f'),'foreignKey':_0xa62d('0x16e')});db[_0xa62d('0x3d')][_0xa62d('0x119')](db[_0xa62d('0x38')],{'as':_0xa62d('0x168'),'foreignKey':_0xa62d('0x15f')});db[_0xa62d('0x3d')][_0xa62d('0x119')](db[_0xa62d('0x58')],{'as':_0xa62d('0x58'),'foreignKey':'ChatWebsiteId'});db[_0xa62d('0x3d')][_0xa62d('0x119')](db[_0xa62d('0x5d')],{'as':_0xa62d('0x5d'),'foreignKey':_0xa62d('0x170')});db[_0xa62d('0x164')][_0xa62d('0x119')](db[_0xa62d('0x14')],{'onDelete':_0xa62d('0x160')});db[_0xa62d('0x164')]['belongsTo'](db[_0xa62d('0x39')],{'onDelete':_0xa62d('0x160')});db[_0xa62d('0x164')][_0xa62d('0x119')](db['MailAccount'],{'onDelete':_0xa62d('0x160')});db[_0xa62d('0x164')][_0xa62d('0x119')](db[_0xa62d('0x79')],{'onDelete':_0xa62d('0x160'),'foreignKey':_0xa62d('0x14f')});db[_0xa62d('0x164')]['belongsTo'](db[_0xa62d('0x171')],{'onDelete':'restrict','foreignKey':_0xa62d('0x172')});db[_0xa62d('0x173')][_0xa62d('0x119')](db['MailAccount'],{});db[_0xa62d('0x173')][_0xa62d('0x119')](db[_0xa62d('0xec')],{'as':_0xa62d('0x165'),'foreignKey':'ListId'});db[_0xa62d('0x173')][_0xa62d('0x119')](db['CmContact'],{'as':_0xa62d('0x15e'),'foreignKey':_0xa62d('0x169')});db[_0xa62d('0x173')][_0xa62d('0x119')](db[_0xa62d('0x3c')],{});db[_0xa62d('0x173')][_0xa62d('0x119')](db[_0xa62d('0x3d')],{});db[_0xa62d('0x173')][_0xa62d('0x119')](db[_0xa62d('0x14')],{});db['MailQueueReport'][_0xa62d('0x119')](db['MailQueue'],{});db['Dashboard'][_0xa62d('0x10a')](db[_0xa62d('0x41')],{'as':_0xa62d('0x174'),'onDelete':_0xa62d('0x10f')});db['FaxAccount']['hasMany'](db[_0xa62d('0x75')],{'as':'Dispositions','foreignKey':_0xa62d('0x175'),'onDelete':'cascade'});db['FaxAccount'][_0xa62d('0x10a')](db['CannedAnswer'],{'as':'Answers','foreignKey':'FaxAccountId'});db[_0xa62d('0x43')][_0xa62d('0x10a')](db[_0xa62d('0x46')],{'as':_0xa62d('0x163')});db[_0xa62d('0x43')][_0xa62d('0x10a')](db[_0xa62d('0x44')],{'as':_0xa62d('0x143')});db[_0xa62d('0x43')]['hasMany'](db[_0xa62d('0x18')],{'as':_0xa62d('0x176'),'onDelete':'cascade'});db[_0xa62d('0x43')][_0xa62d('0x10a')](db[_0xa62d('0x48')],{'as':_0xa62d('0x158')});db[_0xa62d('0x43')][_0xa62d('0x119')](db[_0xa62d('0x27')],{'as':_0xa62d('0x27')});db[_0xa62d('0x43')][_0xa62d('0x119')](db[_0xa62d('0xec')],{'as':'List','foreignKey':_0xa62d('0x166')});db[_0xa62d('0x43')][_0xa62d('0x119')](db[_0xa62d('0x7b')],{'as':_0xa62d('0x150'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xa62d('0x43')]['belongsToMany'](db[_0xa62d('0x14')],{'as':_0xa62d('0x153'),'through':_0xa62d('0x135')});db['FaxApplication'][_0xa62d('0x119')](db[_0xa62d('0x14')],{'onDelete':_0xa62d('0x160')});db[_0xa62d('0x44')]['belongsTo'](db['FaxQueue'],{'onDelete':_0xa62d('0x160')});db[_0xa62d('0x44')][_0xa62d('0x119')](db[_0xa62d('0x43')],{'onDelete':_0xa62d('0x160')});db['FaxApplication'][_0xa62d('0x119')](db['Tag'],{'onDelete':'restrict','foreignKey':_0xa62d('0x172')});db['FaxInteraction'][_0xa62d('0x10a')](db[_0xa62d('0x48')],{'as':_0xa62d('0x158'),'onDelete':'cascade','foreignKey':'FaxInteractionId'});db[_0xa62d('0x46')]['belongsTo'](db[_0xa62d('0x43')],{'as':_0xa62d('0x168'),'foreignKey':_0xa62d('0x175')});db[_0xa62d('0x46')][_0xa62d('0x119')](db[_0xa62d('0x11c')],{'as':_0xa62d('0x15e'),'foreignKey':'ContactId'});db[_0xa62d('0x46')][_0xa62d('0x119')](db[_0xa62d('0x14')],{'as':_0xa62d('0x16a'),'foreignKey':'UserId'});db[_0xa62d('0x46')]['belongsToMany'](db[_0xa62d('0x171')],{'through':_0xa62d('0x177'),'as':_0xa62d('0x16b')});db['FaxInteraction'][_0xa62d('0x11e')](db[_0xa62d('0x171')],{'through':_0xa62d('0x177'),'as':_0xa62d('0x16d')});db[_0xa62d('0x46')]['belongsToMany'](db[_0xa62d('0x14')],{'as':_0xa62d('0x178'),'through':'user_has_fax_interactions','foreignKey':_0xa62d('0x179')});db['FaxMessage'][_0xa62d('0x119')](db['User'],{'onDelete':_0xa62d('0x10f'),'as':_0xa62d('0x14')});db[_0xa62d('0x48')][_0xa62d('0x119')](db[_0xa62d('0x46')],{'as':'Interaction','foreignKey':_0xa62d('0x179')});db[_0xa62d('0x48')][_0xa62d('0x119')](db['CmContact'],{'onDelete':_0xa62d('0x10f'),'as':_0xa62d('0x15e')});db[_0xa62d('0x48')]['belongsTo'](db[_0xa62d('0xe2')],{'as':_0xa62d('0xe2'),'foreignKey':_0xa62d('0x17a')});db[_0xa62d('0x48')]['belongsTo'](db[_0xa62d('0x43')],{'as':'Account','foreignKey':_0xa62d('0x175')});db[_0xa62d('0x49')]['belongsToMany'](db[_0xa62d('0x14')],{'as':'Agents','through':_0xa62d('0x2d')});db['FaxQueue']['belongsToMany'](db[_0xa62d('0x121')],{'through':_0xa62d('0x17b'),'as':'Teams'});db[_0xa62d('0x4a')][_0xa62d('0x119')](db['FaxAccount'],{});db[_0xa62d('0x4a')][_0xa62d('0x119')](db[_0xa62d('0xec')],{'as':_0xa62d('0x165'),'foreignKey':_0xa62d('0x166')});db[_0xa62d('0x4a')][_0xa62d('0x119')](db[_0xa62d('0x11c')],{'as':_0xa62d('0x15e'),'foreignKey':_0xa62d('0x169')});db['FaxQueueReport'][_0xa62d('0x119')](db[_0xa62d('0x46')],{});db['FaxQueueReport'][_0xa62d('0x119')](db[_0xa62d('0x48')],{});db[_0xa62d('0x4a')][_0xa62d('0x119')](db['User'],{});db[_0xa62d('0x4a')][_0xa62d('0x119')](db[_0xa62d('0x49')],{});db[_0xa62d('0x4b')][_0xa62d('0x10a')](db[_0xa62d('0x75')],{'as':_0xa62d('0x162'),'foreignKey':_0xa62d('0x17c'),'onDelete':_0xa62d('0x10f')});db['SmsAccount'][_0xa62d('0x10a')](db[_0xa62d('0x73')],{'as':_0xa62d('0x17d'),'foreignKey':_0xa62d('0x17c')});db[_0xa62d('0x4b')][_0xa62d('0x10a')](db[_0xa62d('0x4d')],{'as':_0xa62d('0x158'),'foreignKey':_0xa62d('0x17c')});db[_0xa62d('0x4b')][_0xa62d('0x10a')](db[_0xa62d('0x114')],{'as':'Interactions'});db[_0xa62d('0x4b')][_0xa62d('0x10a')](db[_0xa62d('0x17e')],{'as':_0xa62d('0x143')});db['SmsAccount'][_0xa62d('0x119')](db['CmList'],{'as':_0xa62d('0x165'),'foreignKey':_0xa62d('0x166')});db[_0xa62d('0x4b')][_0xa62d('0x119')](db[_0xa62d('0x7b')],{'as':_0xa62d('0x150'),'foreignKey':_0xa62d('0x151')});db[_0xa62d('0x4b')][_0xa62d('0x11e')](db[_0xa62d('0x14')],{'as':_0xa62d('0x153'),'through':_0xa62d('0x13b')});db[_0xa62d('0x17e')][_0xa62d('0x119')](db[_0xa62d('0x14')],{'onDelete':_0xa62d('0x160')});db['SmsApplication']['belongsTo'](db[_0xa62d('0x4f')],{'onDelete':'restrict'});db[_0xa62d('0x17e')][_0xa62d('0x119')](db[_0xa62d('0x4b')],{'onDelete':_0xa62d('0x160')});db[_0xa62d('0x17e')][_0xa62d('0x119')](db[_0xa62d('0x79')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0xa62d('0x17e')][_0xa62d('0x119')](db[_0xa62d('0x171')],{'onDelete':_0xa62d('0x160'),'foreignKey':_0xa62d('0x172')});db[_0xa62d('0x114')][_0xa62d('0x10a')](db[_0xa62d('0x4d')],{'as':_0xa62d('0x158'),'onDelete':_0xa62d('0x10f'),'foreignKey':_0xa62d('0x17f')});db[_0xa62d('0x114')][_0xa62d('0x119')](db[_0xa62d('0x4b')],{'as':_0xa62d('0x168'),'foreignKey':_0xa62d('0x17c')});db['SmsInteraction'][_0xa62d('0x119')](db[_0xa62d('0x11c')],{'as':'Contact','foreignKey':_0xa62d('0x169')});db['SmsInteraction']['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0xa62d('0x109')});db['SmsInteraction']['belongsToMany'](db[_0xa62d('0x171')],{'through':'sms_interaction_has_tags','as':_0xa62d('0x16b')});db['SmsInteraction'][_0xa62d('0x11e')](db[_0xa62d('0x171')],{'through':_0xa62d('0x180'),'as':'ThroughTags'});db['SmsInteraction'][_0xa62d('0x11e')](db[_0xa62d('0x14')],{'as':_0xa62d('0x178'),'through':'user_has_sms_interactions','foreignKey':'SmsInteractionId'});db['SmsMessage'][_0xa62d('0x119')](db[_0xa62d('0x14')],{'as':'User'});db[_0xa62d('0x4d')]['belongsTo'](db[_0xa62d('0x11c')],{'onDelete':_0xa62d('0x10f'),'as':_0xa62d('0x15e')});db[_0xa62d('0x4d')][_0xa62d('0x119')](db[_0xa62d('0x114')],{'onDelete':'cascade','as':_0xa62d('0x16f'),'foreignKey':'SmsInteractionId'});db[_0xa62d('0x4d')][_0xa62d('0x119')](db['SmsAccount'],{'as':_0xa62d('0x168'),'foreignKey':_0xa62d('0x17c')});db['SmsQueue'][_0xa62d('0x11e')](db[_0xa62d('0x14')],{'as':_0xa62d('0x153'),'through':_0xa62d('0x2f'),'foreignKey':_0xa62d('0x181')});db[_0xa62d('0x4f')][_0xa62d('0x11e')](db[_0xa62d('0x121')],{'through':_0xa62d('0x182'),'as':_0xa62d('0x154')});db[_0xa62d('0x51')]['hasMany'](db['Disposition'],{'as':_0xa62d('0x162'),'foreignKey':_0xa62d('0x183'),'onDelete':_0xa62d('0x10f')});db[_0xa62d('0x51')][_0xa62d('0x10a')](db['CannedAnswer'],{'as':_0xa62d('0x17d'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0xa62d('0x10a')](db[_0xa62d('0x111')],{'as':_0xa62d('0x163'),'foreignKey':_0xa62d('0x183')});db['OpenchannelAccount'][_0xa62d('0x10a')](db[_0xa62d('0x56')],{'as':_0xa62d('0x158'),'foreignKey':_0xa62d('0x183')});db[_0xa62d('0x51')][_0xa62d('0x10a')](db[_0xa62d('0x53')],{'as':'Applications','foreignKey':'OpenchannelAccountId'});db[_0xa62d('0x51')][_0xa62d('0x119')](db[_0xa62d('0xec')],{'as':_0xa62d('0x165'),'foreignKey':'ListId'});db[_0xa62d('0x51')][_0xa62d('0x119')](db[_0xa62d('0x7b')],{'as':_0xa62d('0x150'),'foreignKey':_0xa62d('0x151')});db['OpenchannelAccount']['belongsToMany'](db[_0xa62d('0x14')],{'as':_0xa62d('0x153'),'through':_0xa62d('0x139')});db[_0xa62d('0x53')]['belongsTo'](db[_0xa62d('0x14')],{'onDelete':_0xa62d('0x160')});db[_0xa62d('0x53')][_0xa62d('0x119')](db[_0xa62d('0x57')],{'onDelete':_0xa62d('0x160'),'foreignKey':'OpenchannelQueueId'});db[_0xa62d('0x53')][_0xa62d('0x119')](db[_0xa62d('0x51')],{'onDelete':_0xa62d('0x160'),'foreignKey':_0xa62d('0x183')});db[_0xa62d('0x53')]['belongsTo'](db[_0xa62d('0x79')],{'onDelete':_0xa62d('0x160'),'foreignKey':_0xa62d('0x14f')});db[_0xa62d('0x53')][_0xa62d('0x119')](db[_0xa62d('0x171')],{'onDelete':_0xa62d('0x160'),'foreignKey':_0xa62d('0x172')});db[_0xa62d('0x111')][_0xa62d('0x10a')](db[_0xa62d('0x56')],{'as':_0xa62d('0x158'),'onDelete':_0xa62d('0x10f'),'foreignKey':_0xa62d('0x184')});db[_0xa62d('0x111')][_0xa62d('0x119')](db['OpenchannelAccount'],{'as':_0xa62d('0x168'),'foreignKey':_0xa62d('0x183')});db[_0xa62d('0x111')][_0xa62d('0x119')](db[_0xa62d('0x11c')],{'as':_0xa62d('0x15e'),'foreignKey':_0xa62d('0x169')});db[_0xa62d('0x111')][_0xa62d('0x119')](db[_0xa62d('0x14')],{'as':_0xa62d('0x16a'),'foreignKey':'UserId'});db[_0xa62d('0x111')][_0xa62d('0x11e')](db['Tag'],{'through':_0xa62d('0x185'),'as':'Tags'});db[_0xa62d('0x111')][_0xa62d('0x11e')](db[_0xa62d('0x171')],{'through':_0xa62d('0x185'),'as':'ThroughTags'});db[_0xa62d('0x111')][_0xa62d('0x11e')](db['User'],{'as':_0xa62d('0x178'),'through':_0xa62d('0x186'),'foreignKey':'OpenchannelInteractionId'});db[_0xa62d('0x56')][_0xa62d('0x119')](db[_0xa62d('0x14')],{'onDelete':'cascade','as':_0xa62d('0x14')});db[_0xa62d('0x56')]['belongsTo'](db[_0xa62d('0x11c')],{'onDelete':_0xa62d('0x10f'),'as':_0xa62d('0x15e')});db['OpenchannelMessage'][_0xa62d('0x119')](db[_0xa62d('0x111')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0xa62d('0x184')});db[_0xa62d('0x56')][_0xa62d('0x119')](db[_0xa62d('0xe2')],{'as':_0xa62d('0xe2'),'foreignKey':'AttachmentId'});db[_0xa62d('0x56')][_0xa62d('0x119')](db[_0xa62d('0x51')],{'as':'Account','foreignKey':_0xa62d('0x183')});db[_0xa62d('0x57')][_0xa62d('0x11e')](db[_0xa62d('0x14')],{'as':_0xa62d('0x153'),'through':'UserOpenchannelQueue','foreignKey':_0xa62d('0x187')});db[_0xa62d('0x57')][_0xa62d('0x11e')](db[_0xa62d('0x121')],{'through':_0xa62d('0x188'),'as':_0xa62d('0x154')});db[_0xa62d('0x58')][_0xa62d('0x10a')](db[_0xa62d('0x75')],{'as':_0xa62d('0x162'),'foreignKey':_0xa62d('0x189'),'onDelete':_0xa62d('0x10f')});db[_0xa62d('0x58')]['hasMany'](db[_0xa62d('0x73')],{'as':'Answers','foreignKey':_0xa62d('0x189')});db['ChatWebsite']['hasMany'](db[_0xa62d('0x61')],{'as':_0xa62d('0x18a')});db['ChatWebsite'][_0xa62d('0x10a')](db['ChatInteraction'],{'as':_0xa62d('0x163')});db[_0xa62d('0x58')][_0xa62d('0x10a')](db[_0xa62d('0x5b')],{'as':_0xa62d('0x143')});db[_0xa62d('0x58')][_0xa62d('0x10a')](db['ChatMessage'],{'as':_0xa62d('0x158')});db[_0xa62d('0x58')][_0xa62d('0x119')](db[_0xa62d('0xec')],{'as':_0xa62d('0x165'),'foreignKey':_0xa62d('0x166')});db[_0xa62d('0x58')]['belongsTo'](db['Interval'],{'as':'Interval','foreignKey':_0xa62d('0x14f')});db[_0xa62d('0x58')]['belongsTo'](db[_0xa62d('0x38')],{'as':'MailAccount','foreignKey':'MailAccountId'});db[_0xa62d('0x58')][_0xa62d('0x119')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xa62d('0x151')});db[_0xa62d('0x58')]['belongsToMany'](db[_0xa62d('0x14')],{'as':_0xa62d('0x153'),'through':_0xa62d('0x133')});db[_0xa62d('0x59')][_0xa62d('0x119')](db[_0xa62d('0x51')],{});db[_0xa62d('0x59')][_0xa62d('0x119')](db[_0xa62d('0xec')],{'as':_0xa62d('0x165'),'foreignKey':_0xa62d('0x166')});db[_0xa62d('0x59')]['belongsTo'](db[_0xa62d('0x11c')],{'as':_0xa62d('0x15e'),'foreignKey':_0xa62d('0x169')});db[_0xa62d('0x59')][_0xa62d('0x119')](db['OpenchannelInteraction'],{});db[_0xa62d('0x59')][_0xa62d('0x119')](db['OpenchannelMessage'],{});db[_0xa62d('0x59')][_0xa62d('0x119')](db['User'],{});db[_0xa62d('0x59')][_0xa62d('0x119')](db[_0xa62d('0x57')],{});db[_0xa62d('0x5b')][_0xa62d('0x119')](db['User'],{'as':_0xa62d('0x18b'),'foreignKey':_0xa62d('0x109'),'onDelete':_0xa62d('0x160')});db['ChatApplication']['belongsTo'](db[_0xa62d('0x5e')],{'as':_0xa62d('0x18c'),'foreignKey':_0xa62d('0x18d'),'onDelete':_0xa62d('0x160')});db[_0xa62d('0x5b')]['belongsTo'](db[_0xa62d('0x58')],{'as':_0xa62d('0x18e'),'foreignKey':_0xa62d('0x189'),'onDelete':_0xa62d('0x160')});db[_0xa62d('0x5b')][_0xa62d('0x119')](db[_0xa62d('0x171')],{'onDelete':'restrict','foreignKey':_0xa62d('0x172')});db[_0xa62d('0x112')][_0xa62d('0x10a')](db[_0xa62d('0x18f')],{'as':_0xa62d('0x158'),'onDelete':'cascade','foreignKey':_0xa62d('0x190')});db[_0xa62d('0x112')][_0xa62d('0x119')](db[_0xa62d('0x58')],{'as':_0xa62d('0x168'),'foreignKey':_0xa62d('0x189')});db[_0xa62d('0x112')][_0xa62d('0x119')](db[_0xa62d('0x11c')],{'as':_0xa62d('0x15e'),'foreignKey':'ContactId'});db[_0xa62d('0x112')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':'UserId'});db[_0xa62d('0x112')][_0xa62d('0x11e')](db[_0xa62d('0x171')],{'through':'chat_interaction_has_tags','as':_0xa62d('0x16b')});db[_0xa62d('0x112')][_0xa62d('0x11e')](db[_0xa62d('0x171')],{'through':_0xa62d('0x191'),'as':_0xa62d('0x16d')});db[_0xa62d('0x112')]['belongsToMany'](db[_0xa62d('0x14')],{'as':'Users','through':_0xa62d('0x124'),'foreignKey':_0xa62d('0x190')});db['ChatMessage'][_0xa62d('0x119')](db[_0xa62d('0x14')],{'onDelete':'cascade','as':'User'});db['ChatMessage']['belongsTo'](db[_0xa62d('0x11c')],{'onDelete':_0xa62d('0x10f'),'as':_0xa62d('0x15e'),'foreignKey':_0xa62d('0x169')});db[_0xa62d('0x18f')][_0xa62d('0x119')](db[_0xa62d('0x112')],{'onDelete':_0xa62d('0x10f'),'as':_0xa62d('0x16f'),'foreignKey':_0xa62d('0x190')});db[_0xa62d('0x18f')][_0xa62d('0x119')](db[_0xa62d('0xe2')],{'as':_0xa62d('0xe2'),'foreignKey':_0xa62d('0x17a')});db[_0xa62d('0x18f')]['belongsTo'](db[_0xa62d('0x58')],{'as':_0xa62d('0x168'),'foreignKey':'ChatWebsiteId'});db['ChatOfflineMessage']['hasMany'](db['Attachment'],{'as':_0xa62d('0x192'),'foreignKey':_0xa62d('0x170'),'onDelete':_0xa62d('0x10f'),'hooks':!![]});db['ChatOfflineMessage'][_0xa62d('0x119')](db[_0xa62d('0x11c')],{'onDelete':'cascade','as':_0xa62d('0x15e'),'foreignKey':'ContactId'});db['ChatOfflineMessage'][_0xa62d('0x119')](db[_0xa62d('0x58')],{'as':_0xa62d('0x168'),'foreignKey':_0xa62d('0x189')});db[_0xa62d('0x5e')][_0xa62d('0x11e')](db['User'],{'as':_0xa62d('0x153'),'through':_0xa62d('0x12e'),'hooks':!![]});db[_0xa62d('0x5e')][_0xa62d('0x11e')](db[_0xa62d('0x121')],{'through':_0xa62d('0x193'),'as':_0xa62d('0x154')});db[_0xa62d('0x5f')][_0xa62d('0x10a')](db[_0xa62d('0xc7')],{'as':_0xa62d('0x158'),'foreignKey':_0xa62d('0x194'),'onDelete':_0xa62d('0x10f')});db['ChatGroup']['belongsToMany'](db[_0xa62d('0x14')],{'as':_0xa62d('0x195'),'through':_0xa62d('0x11b')});db['ChatProactiveAction'][_0xa62d('0x119')](db['ChatWebsite'],{'as':_0xa62d('0x18e'),'foreignKey':_0xa62d('0x189')});db[_0xa62d('0x63')][_0xa62d('0x10a')](db[_0xa62d('0x11c')],{'as':_0xa62d('0x11d'),'foreignKey':'CompanyId'});db[_0xa62d('0x11c')][_0xa62d('0x10a')](db[_0xa62d('0x65')],{'as':_0xa62d('0x147'),'foreignKey':'ContactId'});db['CmContact'][_0xa62d('0x10a')](db[_0xa62d('0x69')],{'as':'HopperFinals','foreignKey':_0xa62d('0x169')});db[_0xa62d('0x11c')][_0xa62d('0x10a')](db[_0xa62d('0x6b')],{'as':_0xa62d('0x149'),'foreignKey':_0xa62d('0x169')});db[_0xa62d('0x11c')]['hasMany'](db[_0xa62d('0x6d')],{'as':_0xa62d('0x6d'),'foreignKey':_0xa62d('0x169')});db[_0xa62d('0x11c')][_0xa62d('0x10a')](db[_0xa62d('0xcc')],{'as':'JscriptySessions','foreignKey':'ContactId'});db['CmContact'][_0xa62d('0x10a')](db[_0xa62d('0x111')],{'as':_0xa62d('0x127'),'foreignKey':'ContactId','onDelete':_0xa62d('0x160')});db[_0xa62d('0x11c')][_0xa62d('0x10a')](db[_0xa62d('0x112')],{'as':_0xa62d('0x113'),'foreignKey':_0xa62d('0x169'),'onDelete':_0xa62d('0x160')});db['CmContact'][_0xa62d('0x10a')](db['SmsInteraction'],{'as':_0xa62d('0x196'),'foreignKey':_0xa62d('0x169'),'onDelete':'restrict'});db[_0xa62d('0x11c')][_0xa62d('0x10a')](db['FaxInteraction'],{'as':_0xa62d('0x115'),'foreignKey':_0xa62d('0x169'),'onDelete':_0xa62d('0x160')});db[_0xa62d('0x11c')][_0xa62d('0x10a')](db[_0xa62d('0x3c')],{'as':'MailInteractions','foreignKey':_0xa62d('0x169'),'onDelete':_0xa62d('0x160')});db[_0xa62d('0x11c')]['belongsTo'](db['CmCompany'],{'as':_0xa62d('0x197'),'foreignKey':_0xa62d('0x198')});db[_0xa62d('0x11c')]['belongsTo'](db[_0xa62d('0xec')],{'as':'List','foreignKey':_0xa62d('0x166'),'onDelete':'cascade'});db[_0xa62d('0x11c')][_0xa62d('0x11e')](db[_0xa62d('0x14')],{'as':_0xa62d('0x178'),'through':'cm_user_has_contacts'});db[_0xa62d('0x11c')][_0xa62d('0x11e')](db['Tag'],{'as':_0xa62d('0x16b'),'through':_0xa62d('0x199')});db['CmContact'][_0xa62d('0x11e')](db[_0xa62d('0x171')],{'through':_0xa62d('0x199'),'as':_0xa62d('0x16d')});db[_0xa62d('0x65')][_0xa62d('0x119')](db[_0xa62d('0x11c')],{'as':_0xa62d('0x15e'),'foreignKey':_0xa62d('0x169'),'onDelete':'cascade'});db['CmHopper']['belongsTo'](db['CmList'],{'as':'List','foreignKey':_0xa62d('0x166'),'onDelete':_0xa62d('0x10f')});db[_0xa62d('0x65')]['belongsTo'](db[_0xa62d('0x14')],{'as':_0xa62d('0x18b'),'foreignKey':_0xa62d('0x109')});db[_0xa62d('0x65')][_0xa62d('0x119')](db['VoiceQueue'],{'as':_0xa62d('0x18c'),'foreignKey':_0xa62d('0x146'),'onDelete':_0xa62d('0x10f')});db[_0xa62d('0x65')][_0xa62d('0x119')](db[_0xa62d('0xdf')],{'as':_0xa62d('0xdf'),'foreignKey':_0xa62d('0x19a'),'onDelete':'cascade'});db[_0xa62d('0x65')]['belongsTo'](db[_0xa62d('0x14')],{'as':'Owner','foreignKey':_0xa62d('0x19b')});db['CmHopperBlack']['belongsTo'](db[_0xa62d('0x11c')],{'as':_0xa62d('0x15e'),'foreignKey':_0xa62d('0x169'),'onDelete':_0xa62d('0x10f')});db[_0xa62d('0x67')]['belongsTo'](db[_0xa62d('0xec')],{'as':'List','foreignKey':_0xa62d('0x166'),'onDelete':'cascade'});db[_0xa62d('0x67')][_0xa62d('0x119')](db[_0xa62d('0x129')],{'as':_0xa62d('0x18c'),'foreignKey':_0xa62d('0x146'),'onDelete':_0xa62d('0x10f')});db[_0xa62d('0x67')][_0xa62d('0x119')](db[_0xa62d('0xdf')],{'as':_0xa62d('0xdf'),'foreignKey':_0xa62d('0x19a'),'onDelete':'cascade'});db[_0xa62d('0x71')][_0xa62d('0x10a')](db[_0xa62d('0x77')],{'as':{'plural':_0xa62d('0x19c'),'singular':_0xa62d('0x19d')},'foreignKey':_0xa62d('0x19e'),'onDelete':_0xa62d('0x10f'),'hooks':!![]});db['Automation']['hasMany'](db[_0xa62d('0x77')],{'as':{'plural':_0xa62d('0x19f'),'singular':_0xa62d('0x1a0')},'foreignKey':'AutomationAnyId','onDelete':'cascade','hooks':!![]});db[_0xa62d('0x71')][_0xa62d('0x10a')](db[_0xa62d('0x70')],{'as':_0xa62d('0x1a1'),'foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db[_0xa62d('0x75')][_0xa62d('0x10a')](db[_0xa62d('0x75')],{'as':_0xa62d('0x162'),'foreignKey':_0xa62d('0x1a2'),'onDelete':_0xa62d('0x10f')});db[_0xa62d('0x79')]['hasMany'](db[_0xa62d('0x79')],{'as':_0xa62d('0x1a3'),'foreignKey':_0xa62d('0x14f'),'onDelete':_0xa62d('0x10f'),'hooks':!![],'required':![]});db['Interval'][_0xa62d('0x10a')](db[_0xa62d('0x18')],{'as':_0xa62d('0x10e'),'foreignKey':_0xa62d('0x14f'),'onDelete':_0xa62d('0x160')});db['Interval'][_0xa62d('0x10a')](db[_0xa62d('0x164')],{'as':_0xa62d('0x1a4'),'foreignKey':_0xa62d('0x14f')});db[_0xa62d('0x79')][_0xa62d('0x10a')](db[_0xa62d('0x5b')],{'as':_0xa62d('0x1a5'),'foreignKey':_0xa62d('0x14f')});db[_0xa62d('0x79')]['hasMany'](db[_0xa62d('0x44')],{'as':_0xa62d('0x1a6'),'foreignKey':_0xa62d('0x14f')});db[_0xa62d('0x79')]['hasMany'](db[_0xa62d('0x17e')],{'as':'SmsApplications','foreignKey':_0xa62d('0x14f')});db[_0xa62d('0x7f')][_0xa62d('0x119')](db['MailAccount'],{});db[_0xa62d('0x7f')][_0xa62d('0x119')](db['AnalyticDefaultReport'],{'foreignKey':_0xa62d('0x1a7')});db[_0xa62d('0x7f')]['belongsTo'](db[_0xa62d('0x1a8')],{'foreignKey':_0xa62d('0x1a9')});db[_0xa62d('0x81')][_0xa62d('0x11e')](db[_0xa62d('0x19')],{'as':_0xa62d('0x1aa'),'through':_0xa62d('0x145'),'onDelete':_0xa62d('0x160')});db[_0xa62d('0x171')][_0xa62d('0x11e')](db[_0xa62d('0x11c')],{'through':_0xa62d('0x199')});db[_0xa62d('0x171')][_0xa62d('0x11e')](db[_0xa62d('0x112')],{'through':'chat_interaction_has_tags'});db['Tag'][_0xa62d('0x11e')](db[_0xa62d('0x3c')],{'through':'mail_interaction_has_tags'});db[_0xa62d('0x171')]['belongsToMany'](db['SmsInteraction'],{'through':_0xa62d('0x180')});db['Tag']['belongsToMany'](db[_0xa62d('0x46')],{'through':_0xa62d('0x177')});db['Tag']['belongsToMany'](db[_0xa62d('0x111')],{'through':_0xa62d('0x185')});db[_0xa62d('0x171')][_0xa62d('0x11e')](db[_0xa62d('0xf9')],{'through':_0xa62d('0x1ab')});db[_0xa62d('0x86')][_0xa62d('0x10a')](db[_0xa62d('0x77')],{'as':{'plural':_0xa62d('0x1ac'),'singular':'AllCondition'},'foreignKey':_0xa62d('0x1ad'),'onDelete':_0xa62d('0x10f'),'hooks':!![]});db[_0xa62d('0x86')]['hasMany'](db['Condition'],{'as':{'plural':_0xa62d('0x1ae'),'singular':'AnyCondition'},'foreignKey':_0xa62d('0x1af'),'onDelete':_0xa62d('0x10f'),'hooks':!![]});db['Trigger'][_0xa62d('0x10a')](db[_0xa62d('0x70')],{'as':_0xa62d('0x1a1'),'foreignKey':'TriggerId','onDelete':_0xa62d('0x10f'),'hooks':!![]});db[_0xa62d('0x1a8')][_0xa62d('0x10a')](db[_0xa62d('0x1b0')],{'as':_0xa62d('0x1b1'),'onDelete':'cascade','foreignKey':_0xa62d('0x1a9'),'hooks':!![]});db[_0xa62d('0x1b2')][_0xa62d('0x10a')](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0xa62d('0x10f'),'foreignKey':_0xa62d('0x1a7')});db[_0xa62d('0x8f')][_0xa62d('0x10a')](db['AnalyticFieldReport'],{'as':_0xa62d('0x1b1'),'onDelete':_0xa62d('0x10f'),'foreignKey':'MetricId'});db[_0xa62d('0x1b0')][_0xa62d('0x119')](db[_0xa62d('0x8f')],{'foreignKey':_0xa62d('0x1b3')});db[_0xa62d('0x94')][_0xa62d('0x10a')](db['SalesforceConfiguration'],{'as':'Configurations','onDelete':_0xa62d('0x10f'),'foreignKey':_0xa62d('0x1b4')});db[_0xa62d('0x96')]['hasMany'](db['SalesforceField'],{'as':_0xa62d('0x1b5'),'onDelete':_0xa62d('0x10f'),'foreignKey':_0xa62d('0x1b6')});db[_0xa62d('0x96')][_0xa62d('0x10a')](db['SalesforceField'],{'as':_0xa62d('0x1b7'),'onDelete':_0xa62d('0x10f'),'foreignKey':'DescriptionId'});db['SalesforceConfiguration'][_0xa62d('0x10a')](db[_0xa62d('0x98')],{'as':_0xa62d('0x1b1'),'onDelete':'cascade','foreignKey':_0xa62d('0x1b8')});db[_0xa62d('0x96')]['belongsTo'](db['SalesforceAccount'],{'as':_0xa62d('0x168'),'foreignKey':_0xa62d('0x1b4')});db['SalesforceField']['hasMany'](db[_0xa62d('0x98')],{'as':_0xa62d('0x1b9'),'foreignKey':'SubjectId'});db[_0xa62d('0x98')]['hasMany'](db['SalesforceField'],{'as':_0xa62d('0x1ba'),'foreignKey':'DescriptionId'});db[_0xa62d('0x98')][_0xa62d('0x10a')](db[_0xa62d('0x98')],{'as':_0xa62d('0x1bb'),'foreignKey':_0xa62d('0x1b8')});db['SalesforceField']['belongsTo'](db[_0xa62d('0x1bc')],{'as':_0xa62d('0x1bc'),'foreignKey':_0xa62d('0x1bd')});db[_0xa62d('0x9a')][_0xa62d('0x10a')](db['SugarcrmConfiguration'],{'as':_0xa62d('0x1be'),'onDelete':_0xa62d('0x10f'),'foreignKey':'AccountId'});db['SugarcrmConfiguration']['hasMany'](db[_0xa62d('0x9c')],{'as':_0xa62d('0x1b5'),'onDelete':'cascade','foreignKey':_0xa62d('0x1b6')});db['SugarcrmConfiguration'][_0xa62d('0x10a')](db['SugarcrmField'],{'as':_0xa62d('0x1b7'),'onDelete':_0xa62d('0x10f'),'foreignKey':'DescriptionId'});db[_0xa62d('0x1bf')][_0xa62d('0x10a')](db[_0xa62d('0x9c')],{'as':_0xa62d('0x1b1'),'onDelete':_0xa62d('0x10f'),'foreignKey':_0xa62d('0x1b8')});db[_0xa62d('0x1bf')][_0xa62d('0x119')](db[_0xa62d('0x9a')],{'as':_0xa62d('0x168'),'foreignKey':_0xa62d('0x1b4')});db[_0xa62d('0x9c')][_0xa62d('0x10a')](db[_0xa62d('0x9c')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xa62d('0x9c')]['hasMany'](db['SugarcrmField'],{'as':'Description','foreignKey':'DescriptionId'});db[_0xa62d('0x9c')]['hasMany'](db[_0xa62d('0x9c')],{'as':'Field','foreignKey':_0xa62d('0x1b8')});db[_0xa62d('0x9c')][_0xa62d('0x119')](db[_0xa62d('0x1bc')],{'as':_0xa62d('0x1bc'),'foreignKey':_0xa62d('0x1bd')});db[_0xa62d('0x1c0')][_0xa62d('0x10a')](db['DeskConfiguration'],{'as':'Configurations','onDelete':_0xa62d('0x10f'),'foreignKey':_0xa62d('0x1b4')});db[_0xa62d('0x9f')][_0xa62d('0x10a')](db[_0xa62d('0xa1')],{'as':'Subjects','onDelete':_0xa62d('0x10f'),'foreignKey':'SubjectId'});db[_0xa62d('0x9f')]['hasMany'](db[_0xa62d('0xa1')],{'as':'Descriptions','onDelete':_0xa62d('0x10f'),'foreignKey':_0xa62d('0x1c1')});db[_0xa62d('0x9f')]['hasMany'](db[_0xa62d('0xa1')],{'as':'Fields','onDelete':_0xa62d('0x10f'),'foreignKey':_0xa62d('0x1b8')});db['DeskConfiguration'][_0xa62d('0x119')](db[_0xa62d('0x1c0')],{'as':_0xa62d('0x168'),'foreignKey':_0xa62d('0x1b4')});db[_0xa62d('0x9f')][_0xa62d('0x11e')](db['Tag'],{'through':_0xa62d('0x1c2')});db['DeskField'][_0xa62d('0x10a')](db[_0xa62d('0xa1')],{'as':_0xa62d('0x1b9'),'foreignKey':_0xa62d('0x1b6')});db['DeskField'][_0xa62d('0x10a')](db[_0xa62d('0xa1')],{'as':_0xa62d('0x1ba'),'foreignKey':_0xa62d('0x1c1')});db[_0xa62d('0xa1')][_0xa62d('0x10a')](db['DeskField'],{'as':_0xa62d('0x1bb'),'foreignKey':'FieldId'});db[_0xa62d('0xa1')]['belongsTo'](db[_0xa62d('0x1bc')],{'as':_0xa62d('0x1bc'),'foreignKey':_0xa62d('0x1bd')});db[_0xa62d('0xa3')][_0xa62d('0x10a')](db[_0xa62d('0xa5')],{'as':_0xa62d('0x1be'),'onDelete':_0xa62d('0x10f'),'foreignKey':_0xa62d('0x1b4')});db[_0xa62d('0xa5')][_0xa62d('0x10a')](db[_0xa62d('0xa7')],{'as':_0xa62d('0x1b5'),'onDelete':'cascade','foreignKey':_0xa62d('0x1b6')});db[_0xa62d('0xa5')]['hasMany'](db[_0xa62d('0xa7')],{'as':_0xa62d('0x1b7'),'onDelete':_0xa62d('0x10f'),'foreignKey':_0xa62d('0x1c1')});db[_0xa62d('0xa5')]['hasMany'](db[_0xa62d('0xa7')],{'as':_0xa62d('0x1b1'),'onDelete':_0xa62d('0x10f'),'foreignKey':_0xa62d('0x1b8')});db['ZohoConfiguration']['belongsTo'](db['ZohoAccount'],{'as':'Account','foreignKey':_0xa62d('0x1b4')});db[_0xa62d('0xa7')][_0xa62d('0x10a')](db[_0xa62d('0xa7')],{'as':_0xa62d('0x1b9'),'foreignKey':_0xa62d('0x1b6')});db[_0xa62d('0xa7')][_0xa62d('0x10a')](db[_0xa62d('0xa7')],{'as':'Description','foreignKey':_0xa62d('0x1c1')});db[_0xa62d('0xa7')][_0xa62d('0x10a')](db[_0xa62d('0xa7')],{'as':_0xa62d('0x1bb'),'foreignKey':'FieldId'});db[_0xa62d('0xa7')][_0xa62d('0x119')](db[_0xa62d('0x1bc')],{'as':'Variable','foreignKey':'VariableId'});db[_0xa62d('0xa8')][_0xa62d('0x10a')](db['ZendeskConfiguration'],{'as':_0xa62d('0x1be'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0xa62d('0x1c3')]['hasMany'](db[_0xa62d('0xaa')],{'as':_0xa62d('0x1b5'),'foreignKey':'SubjectId'});db['ZendeskConfiguration'][_0xa62d('0x10a')](db[_0xa62d('0xaa')],{'as':'Descriptions','foreignKey':_0xa62d('0x1c1')});db[_0xa62d('0x1c3')][_0xa62d('0x10a')](db[_0xa62d('0xaa')],{'as':_0xa62d('0x1b1'),'foreignKey':_0xa62d('0x1b8')});db[_0xa62d('0x1c3')][_0xa62d('0x119')](db['ZendeskAccount'],{'as':_0xa62d('0x168'),'foreignKey':_0xa62d('0x1b4')});db['ZendeskConfiguration'][_0xa62d('0x11e')](db[_0xa62d('0x171')],{'through':_0xa62d('0x1c4')});db[_0xa62d('0xaa')][_0xa62d('0x10a')](db[_0xa62d('0xaa')],{'as':_0xa62d('0x1b9'),'foreignKey':_0xa62d('0x1b6')});db[_0xa62d('0xaa')][_0xa62d('0x10a')](db[_0xa62d('0xaa')],{'as':_0xa62d('0x1ba'),'foreignKey':'DescriptionId'});db[_0xa62d('0xaa')][_0xa62d('0x10a')](db[_0xa62d('0xaa')],{'as':_0xa62d('0x1bb'),'foreignKey':'FieldId'});db[_0xa62d('0xaa')]['belongsTo'](db[_0xa62d('0x1bc')],{'as':_0xa62d('0x1bc'),'foreignKey':'VariableId'});db['FreshdeskAccount'][_0xa62d('0x10a')](db[_0xa62d('0xae')],{'as':_0xa62d('0x1be'),'onDelete':'cascade','foreignKey':_0xa62d('0x1b4')});db['FreshdeskConfiguration']['hasMany'](db[_0xa62d('0xaf')],{'as':_0xa62d('0x1b5'),'onDelete':_0xa62d('0x10f'),'foreignKey':_0xa62d('0x1b6')});db[_0xa62d('0xae')][_0xa62d('0x10a')](db[_0xa62d('0xaf')],{'as':_0xa62d('0x1b7'),'onDelete':'cascade','foreignKey':_0xa62d('0x1c1')});db[_0xa62d('0xae')]['hasMany'](db[_0xa62d('0xaf')],{'as':'Fields','onDelete':_0xa62d('0x10f'),'foreignKey':_0xa62d('0x1b8')});db['FreshdeskConfiguration'][_0xa62d('0x119')](db[_0xa62d('0xac')],{'as':'Account','foreignKey':_0xa62d('0x1b4')});db[_0xa62d('0xae')][_0xa62d('0x11e')](db[_0xa62d('0x171')],{'through':_0xa62d('0x1c5')});db[_0xa62d('0xaf')][_0xa62d('0x10a')](db[_0xa62d('0xaf')],{'as':'Subject','foreignKey':_0xa62d('0x1b6')});db[_0xa62d('0xaf')][_0xa62d('0x10a')](db['FreshdeskField'],{'as':_0xa62d('0x1ba'),'foreignKey':_0xa62d('0x1c1')});db['FreshdeskField'][_0xa62d('0x10a')](db[_0xa62d('0xaf')],{'as':_0xa62d('0x1bb'),'foreignKey':_0xa62d('0x1b8')});db[_0xa62d('0xaf')][_0xa62d('0x119')](db[_0xa62d('0x1bc')],{'as':_0xa62d('0x1bc'),'foreignKey':'VariableId'});db[_0xa62d('0xb0')][_0xa62d('0x10a')](db[_0xa62d('0xb2')],{'as':'Configurations','onDelete':_0xa62d('0x10f'),'foreignKey':_0xa62d('0x1b4')});db[_0xa62d('0xb2')]['hasMany'](db['VtigerField'],{'as':_0xa62d('0x1b5'),'foreignKey':_0xa62d('0x1b6')});db[_0xa62d('0xb2')][_0xa62d('0x10a')](db[_0xa62d('0x1c6')],{'as':'Descriptions','foreignKey':_0xa62d('0x1c1')});db[_0xa62d('0xb2')][_0xa62d('0x10a')](db['VtigerField'],{'as':_0xa62d('0x1b1'),'foreignKey':_0xa62d('0x1b8')});db[_0xa62d('0xb2')][_0xa62d('0x119')](db[_0xa62d('0xb0')],{'as':_0xa62d('0x168'),'foreignKey':_0xa62d('0x1b4')});db['VtigerField'][_0xa62d('0x10a')](db[_0xa62d('0x1c6')],{'as':'Subject','foreignKey':_0xa62d('0x1b6')});db['VtigerField'][_0xa62d('0x10a')](db[_0xa62d('0x1c6')],{'as':_0xa62d('0x1ba'),'foreignKey':_0xa62d('0x1c1')});db[_0xa62d('0x1c6')]['hasMany'](db[_0xa62d('0x1c6')],{'as':_0xa62d('0x1bb'),'foreignKey':_0xa62d('0x1b8')});db[_0xa62d('0x1c6')][_0xa62d('0x119')](db[_0xa62d('0x1bc')],{'as':_0xa62d('0x1bc'),'foreignKey':_0xa62d('0x1bd')});db[_0xa62d('0xb4')]['hasMany'](db[_0xa62d('0xb6')],{'as':_0xa62d('0x1be'),'onDelete':_0xa62d('0x10f'),'foreignKey':'AccountId'});db[_0xa62d('0xb6')][_0xa62d('0x10a')](db['ServicenowField'],{'as':_0xa62d('0x1b5'),'foreignKey':'SubjectId'});db[_0xa62d('0xb6')][_0xa62d('0x10a')](db[_0xa62d('0xb8')],{'as':'Descriptions','foreignKey':_0xa62d('0x1c1')});db[_0xa62d('0xb6')][_0xa62d('0x10a')](db[_0xa62d('0xb8')],{'as':'Fields','foreignKey':_0xa62d('0x1b8')});db[_0xa62d('0xb6')][_0xa62d('0x119')](db['ServicenowAccount'],{'as':_0xa62d('0x168'),'foreignKey':'AccountId'});db[_0xa62d('0xb8')][_0xa62d('0x10a')](db[_0xa62d('0xb8')],{'as':_0xa62d('0x1b9'),'foreignKey':_0xa62d('0x1b6')});db[_0xa62d('0xb8')]['hasMany'](db[_0xa62d('0xb8')],{'as':_0xa62d('0x1ba'),'foreignKey':_0xa62d('0x1c1')});db[_0xa62d('0xb8')][_0xa62d('0x10a')](db[_0xa62d('0xb8')],{'as':_0xa62d('0x1bb'),'foreignKey':_0xa62d('0x1b8')});db['ServicenowField'][_0xa62d('0x119')](db[_0xa62d('0x1bc')],{'as':_0xa62d('0x1bc'),'foreignKey':_0xa62d('0x1bd')});db[_0xa62d('0xba')][_0xa62d('0x10a')](db[_0xa62d('0x1c7')],{'as':'Configurations','onDelete':_0xa62d('0x10f'),'foreignKey':_0xa62d('0x1b4')});db[_0xa62d('0x1c7')][_0xa62d('0x10a')](db[_0xa62d('0xbd')],{'as':'Subjects','onDelete':_0xa62d('0x10f'),'foreignKey':_0xa62d('0x1b6')});db['Dynamics365Configuration'][_0xa62d('0x10a')](db[_0xa62d('0xbd')],{'as':_0xa62d('0x1b7'),'onDelete':'cascade','foreignKey':_0xa62d('0x1c1')});db['Dynamics365Configuration'][_0xa62d('0x10a')](db[_0xa62d('0xbd')],{'as':'Fields','onDelete':_0xa62d('0x10f'),'foreignKey':_0xa62d('0x1b8')});db[_0xa62d('0x1c7')][_0xa62d('0x119')](db[_0xa62d('0xba')],{'as':_0xa62d('0x168'),'foreignKey':_0xa62d('0x1b4')});db[_0xa62d('0xbd')][_0xa62d('0x10a')](db[_0xa62d('0xbd')],{'as':_0xa62d('0x1b9'),'foreignKey':_0xa62d('0x1b6')});db['Dynamics365Field'][_0xa62d('0x10a')](db[_0xa62d('0xbd')],{'as':_0xa62d('0x1ba'),'foreignKey':_0xa62d('0x1c1')});db['Dynamics365Field'][_0xa62d('0x10a')](db[_0xa62d('0xbd')],{'as':_0xa62d('0x1bb'),'foreignKey':_0xa62d('0x1b8')});db[_0xa62d('0xbd')]['belongsTo'](db[_0xa62d('0x1bc')],{'as':_0xa62d('0x1bc'),'foreignKey':_0xa62d('0x1bd')});db['FreshsalesAccount'][_0xa62d('0x10a')](db[_0xa62d('0xc1')],{'as':_0xa62d('0x1be'),'onDelete':_0xa62d('0x10f'),'foreignKey':_0xa62d('0x1b4')});db[_0xa62d('0xc1')][_0xa62d('0x10a')](db[_0xa62d('0xc3')],{'as':_0xa62d('0x1b5'),'foreignKey':_0xa62d('0x1b6')});db[_0xa62d('0xc1')]['hasMany'](db[_0xa62d('0xc3')],{'as':_0xa62d('0x1b7'),'foreignKey':'DescriptionId'});db[_0xa62d('0xc1')]['hasMany'](db[_0xa62d('0xc3')],{'as':_0xa62d('0x1b1'),'foreignKey':'FieldId'});db[_0xa62d('0xc1')][_0xa62d('0x119')](db[_0xa62d('0xbf')],{'as':_0xa62d('0x168'),'foreignKey':'AccountId'});db[_0xa62d('0xc3')]['hasMany'](db[_0xa62d('0xc3')],{'as':'Subject','foreignKey':_0xa62d('0x1b6')});db['FreshsalesField'][_0xa62d('0x10a')](db['FreshsalesField'],{'as':'Description','foreignKey':_0xa62d('0x1c1')});db[_0xa62d('0xc3')][_0xa62d('0x10a')](db['FreshsalesField'],{'as':_0xa62d('0x1bb'),'foreignKey':_0xa62d('0x1b8')});db[_0xa62d('0xc3')][_0xa62d('0x119')](db['Variable'],{'as':_0xa62d('0x1bc'),'foreignKey':_0xa62d('0x1bd')});db[_0xa62d('0xc5')]['belongsTo'](db[_0xa62d('0x58')],{});db[_0xa62d('0xc5')][_0xa62d('0x119')](db[_0xa62d('0xec')],{'as':_0xa62d('0x165'),'foreignKey':_0xa62d('0x166')});db[_0xa62d('0xc5')][_0xa62d('0x119')](db[_0xa62d('0x11c')],{'as':'Contact','foreignKey':_0xa62d('0x169')});db[_0xa62d('0xc5')]['belongsTo'](db[_0xa62d('0x112')],{});db[_0xa62d('0xc5')][_0xa62d('0x119')](db['ChatMessage'],{});db[_0xa62d('0xc5')][_0xa62d('0x119')](db[_0xa62d('0x14')],{});db[_0xa62d('0xc5')][_0xa62d('0x119')](db[_0xa62d('0x5e')],{});db[_0xa62d('0xc7')][_0xa62d('0x119')](db[_0xa62d('0x14')],{'onDelete':_0xa62d('0x10f'),'foreignKey':_0xa62d('0x1c8')});db[_0xa62d('0xc7')][_0xa62d('0x119')](db[_0xa62d('0x14')],{'onDelete':'cascade','foreignKey':_0xa62d('0x1c9')});db[_0xa62d('0xcc')]['hasMany'](db['JscriptyQuestionReport'],{'foreignKey':_0xa62d('0x1ca'),'onDelete':_0xa62d('0x10f')});db[_0xa62d('0xcc')][_0xa62d('0x10a')](db[_0xa62d('0xc9')],{'foreignKey':_0xa62d('0x1ca'),'onDelete':_0xa62d('0x10f')});db[_0xa62d('0xce')]['belongsTo'](db[_0xa62d('0x4b')],{});db['SmsQueueReport'][_0xa62d('0x119')](db[_0xa62d('0xec')],{'as':_0xa62d('0x165'),'foreignKey':_0xa62d('0x166')});db[_0xa62d('0xce')]['belongsTo'](db['CmContact'],{'as':_0xa62d('0x15e'),'foreignKey':_0xa62d('0x169')});db[_0xa62d('0xce')][_0xa62d('0x119')](db[_0xa62d('0x114')],{});db[_0xa62d('0xce')][_0xa62d('0x119')](db['SmsMessage'],{});db[_0xa62d('0xce')][_0xa62d('0x119')](db[_0xa62d('0x14')],{});db[_0xa62d('0xce')]['belongsTo'](db[_0xa62d('0x4f')],{});db[_0xa62d('0xd3')]['hasMany'](db[_0xa62d('0xcc')],{'foreignKey':_0xa62d('0x1cb')});db[_0xa62d('0xd3')][_0xa62d('0x10a')](db['JscriptyQuestionReport'],{'foreignKey':_0xa62d('0x1cb')});db[_0xa62d('0xd3')][_0xa62d('0x10a')](db[_0xa62d('0xc9')],{'foreignKey':_0xa62d('0x1cb')});db[_0xa62d('0x13e')][_0xa62d('0x11e')](db[_0xa62d('0x14')],{'as':_0xa62d('0x178'),'through':_0xa62d('0x140')});db[_0xa62d('0x121')][_0xa62d('0x11e')](db['User'],{'as':_0xa62d('0x153'),'through':_0xa62d('0x122')});db[_0xa62d('0x121')]['belongsToMany'](db[_0xa62d('0x129')],{'through':_0xa62d('0x104'),'as':'VoiceQueues'});db['Team'][_0xa62d('0x11e')](db[_0xa62d('0x39')],{'through':'team_has_mail_queues','as':_0xa62d('0x12c')});db['Team'][_0xa62d('0x11e')](db[_0xa62d('0x5e')],{'through':_0xa62d('0x193'),'as':_0xa62d('0x12d')});db[_0xa62d('0x121')]['belongsToMany'](db['FaxQueue'],{'through':'team_has_fax_queues','as':_0xa62d('0x1cc')});db[_0xa62d('0x121')]['belongsToMany'](db['SmsQueue'],{'through':_0xa62d('0x182'),'as':_0xa62d('0x12f')});db[_0xa62d('0x121')][_0xa62d('0x11e')](db['OpenchannelQueue'],{'through':_0xa62d('0x188'),'as':'OpenchannelQueues'});db['Team']['belongsToMany'](db[_0xa62d('0x101')],{'through':'team_has_whatsapp_queues','as':_0xa62d('0x131')});db[_0xa62d('0x121')][_0xa62d('0x11e')](db[_0xa62d('0x12b')],{'through':_0xa62d('0x106'),'as':'VoicePrefixes'});db[_0xa62d('0xdf')][_0xa62d('0x10a')](db[_0xa62d('0x65')],{'as':_0xa62d('0x147'),'foreignKey':_0xa62d('0x19a')});db[_0xa62d('0xdf')][_0xa62d('0x10a')](db[_0xa62d('0x69')],{'as':_0xa62d('0x148'),'foreignKey':'CampaignId'});db[_0xa62d('0xdf')]['hasMany'](db[_0xa62d('0x6b')],{'as':_0xa62d('0x149'),'foreignKey':_0xa62d('0x19a')});db['Campaign'][_0xa62d('0x10a')](db[_0xa62d('0x67')],{'as':_0xa62d('0x14a'),'foreignKey':_0xa62d('0x19a')});db[_0xa62d('0xdf')][_0xa62d('0x119')](db[_0xa62d('0x27')],{'as':_0xa62d('0x27'),'foreignKey':_0xa62d('0x14c')});db[_0xa62d('0xdf')][_0xa62d('0x119')](db[_0xa62d('0x27')],{'as':_0xa62d('0x14d'),'foreignKey':_0xa62d('0x14e')});db[_0xa62d('0xdf')][_0xa62d('0x119')](db['Interval'],{'as':_0xa62d('0x79'),'foreignKey':_0xa62d('0x14f')});db[_0xa62d('0xdf')][_0xa62d('0x119')](db[_0xa62d('0x13e')],{'as':_0xa62d('0x13e'),'foreignKey':_0xa62d('0x1cd')});db[_0xa62d('0xdf')]['belongsToMany'](db[_0xa62d('0xec')],{'as':_0xa62d('0x11f'),'through':_0xa62d('0x1ce')});db[_0xa62d('0xdf')][_0xa62d('0x11e')](db['CmList'],{'as':_0xa62d('0x155'),'through':_0xa62d('0x1cf')});db[_0xa62d('0xe2')]['belongsTo'](db[_0xa62d('0x5d')],{'as':_0xa62d('0x5d'),'foreignKey':_0xa62d('0x170')});db[_0xa62d('0xe6')][_0xa62d('0x119')](db[_0xa62d('0x3d')],{});db[_0xa62d('0xe6')][_0xa62d('0x119')](db[_0xa62d('0x3c')],{});db[_0xa62d('0xe6')]['belongsTo'](db[_0xa62d('0x38')],{'foreignKey':_0xa62d('0x1d0'),'as':_0xa62d('0x1d1')});db['MailTransferReport'][_0xa62d('0x119')](db[_0xa62d('0x14')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0xa62d('0xe6')][_0xa62d('0x119')](db[_0xa62d('0x14')],{'foreignKey':'ToUserId','as':_0xa62d('0x1d2')});db['MailTransferReport'][_0xa62d('0x119')](db[_0xa62d('0x39')],{'foreignKey':'ToMailQueueId','as':'ToQueue'});db['MailTransferReport'][_0xa62d('0x119')](db[_0xa62d('0x38')],{'foreignKey':_0xa62d('0x1d3'),'as':_0xa62d('0x1d4')});db[_0xa62d('0xe8')][_0xa62d('0x119')](db[_0xa62d('0x18f')],{});db[_0xa62d('0xe8')][_0xa62d('0x119')](db['ChatInteraction'],{});db['ChatTransferReport'][_0xa62d('0x119')](db[_0xa62d('0x58')],{'foreignKey':_0xa62d('0x1d5'),'as':'FromAccount'});db[_0xa62d('0xe8')][_0xa62d('0x119')](db[_0xa62d('0x14')],{'foreignKey':_0xa62d('0x1d6'),'as':'FromAgent'});db[_0xa62d('0xe8')][_0xa62d('0x119')](db[_0xa62d('0x14')],{'foreignKey':_0xa62d('0x1d7'),'as':_0xa62d('0x1d2')});db['ChatTransferReport']['belongsTo'](db[_0xa62d('0x5e')],{'foreignKey':_0xa62d('0x1d8'),'as':_0xa62d('0x1d9')});db[_0xa62d('0xe8')][_0xa62d('0x119')](db['ChatWebsite'],{'foreignKey':_0xa62d('0x1da'),'as':_0xa62d('0x1d4')});db[_0xa62d('0xe9')][_0xa62d('0x119')](db[_0xa62d('0x48')],{});db[_0xa62d('0xe9')][_0xa62d('0x119')](db['FaxInteraction'],{});db['FaxTransferReport'][_0xa62d('0x119')](db[_0xa62d('0x43')],{'foreignKey':_0xa62d('0x1db'),'as':_0xa62d('0x1d1')});db[_0xa62d('0xe9')][_0xa62d('0x119')](db[_0xa62d('0x14')],{'foreignKey':_0xa62d('0x1d6'),'as':'FromAgent'});db[_0xa62d('0xe9')][_0xa62d('0x119')](db['User'],{'foreignKey':_0xa62d('0x1d7'),'as':'ToAgent'});db[_0xa62d('0xe9')][_0xa62d('0x119')](db[_0xa62d('0x49')],{'foreignKey':_0xa62d('0x1dc'),'as':_0xa62d('0x1d9')});db[_0xa62d('0xe9')][_0xa62d('0x119')](db[_0xa62d('0x43')],{'foreignKey':_0xa62d('0x1dd'),'as':_0xa62d('0x1d4')});db[_0xa62d('0xea')][_0xa62d('0x119')](db[_0xa62d('0x56')],{});db[_0xa62d('0xea')][_0xa62d('0x119')](db[_0xa62d('0x111')],{});db[_0xa62d('0xea')][_0xa62d('0x119')](db['OpenchannelAccount'],{'foreignKey':_0xa62d('0x1de'),'as':_0xa62d('0x1d1')});db[_0xa62d('0xea')][_0xa62d('0x119')](db[_0xa62d('0x14')],{'foreignKey':'FromUserId','as':_0xa62d('0x1df')});db[_0xa62d('0xea')][_0xa62d('0x119')](db[_0xa62d('0x14')],{'foreignKey':_0xa62d('0x1d7'),'as':_0xa62d('0x1d2')});db[_0xa62d('0xea')][_0xa62d('0x119')](db[_0xa62d('0x57')],{'foreignKey':_0xa62d('0x1e0'),'as':_0xa62d('0x1d9')});db[_0xa62d('0xea')][_0xa62d('0x119')](db[_0xa62d('0x51')],{'foreignKey':'ToOpenchannelAccountId','as':_0xa62d('0x1d4')});db[_0xa62d('0x1e1')]['belongsTo'](db['SmsMessage'],{});db[_0xa62d('0x1e1')]['belongsTo'](db[_0xa62d('0x114')],{});db[_0xa62d('0x1e1')][_0xa62d('0x119')](db[_0xa62d('0x4b')],{'foreignKey':_0xa62d('0x1e2'),'as':_0xa62d('0x1d1')});db[_0xa62d('0x1e1')][_0xa62d('0x119')](db[_0xa62d('0x14')],{'foreignKey':'FromUserId','as':_0xa62d('0x1df')});db['SmsTransferReport'][_0xa62d('0x119')](db[_0xa62d('0x14')],{'foreignKey':_0xa62d('0x1d7'),'as':'ToAgent'});db[_0xa62d('0x1e1')][_0xa62d('0x119')](db[_0xa62d('0x4f')],{'foreignKey':_0xa62d('0x1e3'),'as':_0xa62d('0x1d9')});db[_0xa62d('0x1e1')]['belongsTo'](db[_0xa62d('0x4b')],{'foreignKey':_0xa62d('0x1e4'),'as':_0xa62d('0x1d4')});db[_0xa62d('0xec')]['hasMany'](db[_0xa62d('0x75')],{'as':'Dispositions','foreignKey':'ListId','onDelete':_0xa62d('0x10f')});db[_0xa62d('0xec')]['hasMany'](db[_0xa62d('0x6e')],{'as':'CustomFields','foreignKey':_0xa62d('0x166')});db[_0xa62d('0xec')][_0xa62d('0x10a')](db[_0xa62d('0x11c')],{'as':_0xa62d('0x11d'),'onDelete':_0xa62d('0x10f'),'foreignKey':_0xa62d('0x166')});db['CmList'][_0xa62d('0x10a')](db[_0xa62d('0x69')],{'as':_0xa62d('0x148'),'foreignKey':_0xa62d('0x166')});db[_0xa62d('0xec')][_0xa62d('0x10a')](db[_0xa62d('0x6b')],{'as':_0xa62d('0x110'),'foreignKey':'ListId'});db[_0xa62d('0xec')][_0xa62d('0x10a')](db['ReportAgentPreview'],{'as':_0xa62d('0x6d'),'foreignKey':_0xa62d('0x166')});db['CmList'][_0xa62d('0x11e')](db[_0xa62d('0x129')],{'as':_0xa62d('0x1e5'),'through':_0xa62d('0x152')});db['CmList'][_0xa62d('0x11e')](db['User'],{'as':_0xa62d('0x153'),'through':'cm_user_has_lists'});db[_0xa62d('0x12b')]['hasMany'](db[_0xa62d('0x18')],{'as':_0xa62d('0x10e'),'onDelete':_0xa62d('0x10f')});db[_0xa62d('0x12b')][_0xa62d('0x11e')](db[_0xa62d('0x14')],{'as':_0xa62d('0x153'),'through':'UserVoicePrefix'});db[_0xa62d('0x12b')]['belongsToMany'](db[_0xa62d('0x121')],{'through':_0xa62d('0x106'),'as':'Teams'});db[_0xa62d('0xee')][_0xa62d('0x10a')](db['User'],{'as':_0xa62d('0x178'),'foreignKey':_0xa62d('0x11a')});db['UserProfile'][_0xa62d('0x10a')](db['UserProfileSection'],{'as':_0xa62d('0x1e6'),'foreignKey':'userProfileId','onDelete':'cascade'});db[_0xa62d('0xf0')]['hasMany'](db[_0xa62d('0xf2')],{'as':'Resources','foreignKey':_0xa62d('0x1e7'),'onDelete':_0xa62d('0x10f')});db[_0xa62d('0xf6')]['hasMany'](db['Disposition'],{'as':'Dispositions','foreignKey':_0xa62d('0x1e8'),'onDelete':'cascade'});db[_0xa62d('0xf6')][_0xa62d('0x10a')](db[_0xa62d('0x73')],{'as':_0xa62d('0x17d'),'foreignKey':_0xa62d('0x1e8')});db[_0xa62d('0xf6')][_0xa62d('0x10a')](db[_0xa62d('0xfb')],{'as':_0xa62d('0x158'),'foreignKey':_0xa62d('0x1e8')});db[_0xa62d('0xf6')][_0xa62d('0x10a')](db['WhatsappInteraction'],{'as':_0xa62d('0x163')});db[_0xa62d('0xf6')][_0xa62d('0x10a')](db[_0xa62d('0xf8')],{'as':_0xa62d('0x143')});db[_0xa62d('0xf6')][_0xa62d('0x119')](db['CmList'],{'as':'List','foreignKey':_0xa62d('0x166')});db[_0xa62d('0xf6')][_0xa62d('0x119')](db[_0xa62d('0x7b')],{'as':_0xa62d('0x150'),'foreignKey':_0xa62d('0x151')});db['WhatsappAccount'][_0xa62d('0x11e')](db['User'],{'as':_0xa62d('0x153'),'through':_0xa62d('0x13d')});db['WhatsappApplication']['belongsTo'](db['User'],{'onDelete':'restrict'});db['WhatsappApplication'][_0xa62d('0x119')](db[_0xa62d('0x101')],{'onDelete':_0xa62d('0x160')});db[_0xa62d('0xf8')][_0xa62d('0x119')](db[_0xa62d('0xf6')],{'onDelete':_0xa62d('0x160')});db['WhatsappApplication'][_0xa62d('0x119')](db['Interval'],{'onDelete':_0xa62d('0x160'),'foreignKey':'IntervalId'});db[_0xa62d('0xf8')][_0xa62d('0x119')](db['Tag'],{'onDelete':_0xa62d('0x160'),'foreignKey':_0xa62d('0x172')});db[_0xa62d('0xf9')][_0xa62d('0x10a')](db[_0xa62d('0xfb')],{'as':_0xa62d('0x158'),'onDelete':_0xa62d('0x10f'),'foreignKey':_0xa62d('0x1e9')});db['WhatsappInteraction'][_0xa62d('0x119')](db[_0xa62d('0xf6')],{'as':_0xa62d('0x168'),'foreignKey':_0xa62d('0x1e8')});db['WhatsappInteraction'][_0xa62d('0x119')](db[_0xa62d('0x11c')],{'as':'Contact','foreignKey':_0xa62d('0x169')});db[_0xa62d('0xf9')][_0xa62d('0x119')](db['User'],{'as':_0xa62d('0x16a'),'foreignKey':_0xa62d('0x109')});db[_0xa62d('0xf9')][_0xa62d('0x11e')](db[_0xa62d('0x171')],{'through':'whatsapp_interaction_has_tags','as':'Tags'});db[_0xa62d('0xf9')]['belongsToMany'](db[_0xa62d('0x171')],{'through':_0xa62d('0x1ab'),'as':_0xa62d('0x16d')});db[_0xa62d('0xf9')][_0xa62d('0x11e')](db[_0xa62d('0x14')],{'as':'Users','through':_0xa62d('0x128'),'foreignKey':_0xa62d('0x1e9')});db['WhatsappMessage'][_0xa62d('0x119')](db[_0xa62d('0x14')],{'as':_0xa62d('0x14')});db['WhatsappMessage'][_0xa62d('0x119')](db[_0xa62d('0x11c')],{'onDelete':_0xa62d('0x10f'),'as':_0xa62d('0x15e')});db[_0xa62d('0xfb')][_0xa62d('0x119')](db[_0xa62d('0xf9')],{'onDelete':_0xa62d('0x10f'),'as':_0xa62d('0x16f'),'foreignKey':_0xa62d('0x1e9')});db[_0xa62d('0xfb')][_0xa62d('0x119')](db[_0xa62d('0xf6')],{'as':_0xa62d('0x168'),'foreignKey':'WhatsappAccountId'});db[_0xa62d('0xfd')][_0xa62d('0x119')](db[_0xa62d('0xf6')],{});db[_0xa62d('0xfd')]['belongsTo'](db['CmList'],{'as':_0xa62d('0x165'),'foreignKey':_0xa62d('0x166')});db['WhatsappQueueReport'][_0xa62d('0x119')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0xa62d('0xfd')]['belongsTo'](db[_0xa62d('0xf9')],{});db[_0xa62d('0xfd')][_0xa62d('0x119')](db[_0xa62d('0x101')],{});db[_0xa62d('0xfd')][_0xa62d('0x119')](db['WhatsappMessage'],{});db[_0xa62d('0xfd')][_0xa62d('0x119')](db['User'],{});db[_0xa62d('0xff')][_0xa62d('0x119')](db[_0xa62d('0xfb')],{});db[_0xa62d('0xff')][_0xa62d('0x119')](db[_0xa62d('0xf9')],{});db[_0xa62d('0xff')]['belongsTo'](db[_0xa62d('0xf6')],{'foreignKey':_0xa62d('0x1ea'),'as':_0xa62d('0x1d1')});db[_0xa62d('0xff')][_0xa62d('0x119')](db[_0xa62d('0xf6')],{'foreignKey':_0xa62d('0x1eb'),'as':'ToAccount'});db[_0xa62d('0xff')][_0xa62d('0x119')](db[_0xa62d('0x101')],{'foreignKey':_0xa62d('0x1ec'),'as':_0xa62d('0x1d9')});db['WhatsappTransferReport']['belongsTo'](db[_0xa62d('0x14')],{'foreignKey':_0xa62d('0x1d6'),'as':'FromAgent'});db[_0xa62d('0xff')][_0xa62d('0x119')](db['User'],{'foreignKey':'ToUserId','as':_0xa62d('0x1d2')});db[_0xa62d('0x101')][_0xa62d('0x11e')](db[_0xa62d('0x14')],{'as':_0xa62d('0x153'),'through':_0xa62d('0x32'),'foreignKey':_0xa62d('0x1ed')});db[_0xa62d('0x101')]['belongsToMany'](db['Team'],{'through':_0xa62d('0x1ee'),'as':_0xa62d('0x154')});db[_0xa62d('0x102')][_0xa62d('0x108')](db['MailServerIn'],{'as':'Imap','onDelete':_0xa62d('0x160')});db['CloudProvider']['hasOne'](db[_0xa62d('0x36')],{'as':_0xa62d('0x161'),'onDelete':_0xa62d('0x160')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 834f7f9..e9cc9af 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x458a=['/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','/api/mail/out_servers','./api/mailServerOut','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','./api/mailApplication','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','./api/faxMessage','./api/faxQueue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','/api/sms/messages','./api/smsMessage','./api/smsQueue','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','./api/openchannelInteraction','/api/openchannel/messages','/api/openchannel/queues','./api/openchannelQueue','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/contacts','./api/cmHopper','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','./api/automation','./api/cannedAnswer','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','/api/voiceQueuesLog','/api/schedules','/api/sounds','./api/tag','/api/templates','./api/template','./api/trigger','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZendeskAccount','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','./api/intZendeskField','./api/intFreshdeskAccount','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','/api/jscripty/projects','./api/jscriptyProject','/api/settings','/api/square/odbc','/api/square/projects','./api/squareProject','/api/square/recordings','/api/square/messages','./api/team','/api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','./api/attachment','/api/plugins','/api/mail/reports/transfer','./api/mailTransferReport','./api/chatTransferReport','./api/openchannelTransferReport','./api/smsTransferReport','/api/cm/lists','./api/cmList','./api/voicePrefix','./api/userProfile','/api/userProfile/sections','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','/api/whatsapp/messages','./api/whatsappMessage','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','/api/realtime','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','/api/webbar','/apidoc','static','root','/www','join','/demo','/snippet','snippet','3.0.0','/plugins','/server/files/plugins','route','get','resolve','appPath','/index.html','username','password','newPassword','apiKey','firstName','lastName','street','mobile','fax','email','clientSecret','accessKey','token','accessToken','accessTokenSecret','authToken','consumerKey','consumerSecret','membername','calleridname','calleridnum','exten','clientEmail','privateKey','accesskeyid','secretaccesskey','pass','accountSid','localstationid','dsn','registry','oldPassword','isPlainObject','length','isString','replace','@@{','lodash','express-winston','util','./config/environment','./config/logger','api','auth','./safe-template','use','logger','isEmpty','method','headers','x-forwarded-for','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','body','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)','name','other','agent_name','test','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport'];(function(_0x1156f0,_0x25fe10){var _0x4cfbe0=function(_0x33cfad){while(--_0x33cfad){_0x1156f0['push'](_0x1156f0['shift']());}};_0x4cfbe0(++_0x25fe10);}(_0x458a,0x110));var _0xa458=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x458a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa458('0x0'));var path=require('path');var express=require('express');var ewinston=require(_0xa458('0x1'));var util=require(_0xa458('0x2'));var errors=require('./errors');var config=require(_0xa458('0x3'));var logger=require(_0xa458('0x4'))(_0xa458('0x5'));var authLogger=require(_0xa458('0x4'))(_0xa458('0x6'));var safeTemplate=require(_0xa458('0x7'))['safeTemplate'];exports['default']=function(_0x5a9636){_0x5a9636[_0xa458('0x8')](ewinston[_0xa458('0x9')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x435bc7,_0x192b61){var _0x25a8c8='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_[_0xa458('0xa')](_0x435bc7['body'])){_0x25a8c8+='\x20body=%s';var _0x5c8138=_0x435bc7['body'];maskSensitiveData(_0x5c8138);}return safeTemplate(util['format'](_0x25a8c8,_0x435bc7[_0xa458('0xb')],_0x435bc7[_0xa458('0xc')][_0xa458('0xd')]?_0x435bc7[_0xa458('0xc')]['x-forwarded-for']:_0x435bc7[_0xa458('0xe')][_0xa458('0xf')]||_0x435bc7['ip'],_0x435bc7[_0xa458('0x10')],_0x192b61[_0xa458('0x11')],_0x192b61[_0xa458('0x12')],_0x435bc7[_0xa458('0x13')]?_0x435bc7[_0xa458('0x13')]['id']:null,_0x435bc7['user']?_0x435bc7[_0xa458('0x13')]['name']:null,_0x435bc7['user']?_0x435bc7[_0xa458('0x13')][_0xa458('0x14')]:null,_0x5c8138?util[_0xa458('0x15')](_0x5c8138,![],null):''));}}));_0x5a9636['use'](ewinston['logger']({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x110800,_0x10b1a3){var _0x2b3b5c=_0xa458('0x16');if(_0x110800['body']&&_0x110800[_0xa458('0x17')][_0xa458('0x18')]&&_0x110800[_0xa458('0x17')][_0xa458('0x19')]){_0x2b3b5c=_0xa458('0x1a');}return util['format'](_0x2b3b5c,_0x110800[_0xa458('0xb')],_0x110800[_0xa458('0xc')][_0xa458('0xd')]?_0x110800[_0xa458('0xc')][_0xa458('0xd')]:_0x110800['connection'][_0xa458('0xf')]||_0x110800['ip'],_0x110800[_0xa458('0x10')],_0x10b1a3[_0xa458('0x11')],_0x10b1a3['responseTime'],_0x110800[_0xa458('0x13')]?_0x110800[_0xa458('0x13')]['id']:null,_0x110800[_0xa458('0x13')]?_0x110800[_0xa458('0x13')][_0xa458('0x1b')]:null,_0x110800[_0xa458('0x13')]?_0x110800['user']['role']:null,_0x110800['body']&&_0x110800[_0xa458('0x17')]['device']?_0x110800[_0xa458('0x17')][_0xa458('0x18')]:_0xa458('0x1c'),_0x110800[_0xa458('0x17')]&&_0x110800['body'][_0xa458('0x19')]?_0x110800[_0xa458('0x17')]['agent_id']:'',_0x110800[_0xa458('0x17')]&&_0x110800[_0xa458('0x17')][_0xa458('0x1d')]?_0x110800[_0xa458('0x17')][_0xa458('0x1d')]:'');},'ignoreRoute':function(_0x61c155){var _0x595eed=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x595eed[_0xa458('0x1e')](_0x61c155[_0xa458('0x10')]);}}));_0x5a9636[_0xa458('0x8')]('/api/users',require('./api/user'));_0x5a9636['use']('/api/voice/chanspy',require(_0xa458('0x1f')));_0x5a9636[_0xa458('0x8')](_0xa458('0x20'),require(_0xa458('0x21')));_0x5a9636[_0xa458('0x8')](_0xa458('0x22'),require(_0xa458('0x23')));_0x5a9636[_0xa458('0x8')](_0xa458('0x24'),require(_0xa458('0x25')));_0x5a9636[_0xa458('0x8')](_0xa458('0x26'),require(_0xa458('0x27')));_0x5a9636[_0xa458('0x8')](_0xa458('0x28'),require('./api/voiceRecording'));_0x5a9636[_0xa458('0x8')](_0xa458('0x29'),require(_0xa458('0x2a')));_0x5a9636['use'](_0xa458('0x2b'),require(_0xa458('0x2c')));_0x5a9636['use'](_0xa458('0x2d'),require(_0xa458('0x2e')));_0x5a9636[_0xa458('0x8')](_0xa458('0x2f'),require(_0xa458('0x30')));_0x5a9636[_0xa458('0x8')](_0xa458('0x31'),require(_0xa458('0x32')));_0x5a9636['use'](_0xa458('0x33'),require(_0xa458('0x34')));_0x5a9636[_0xa458('0x8')](_0xa458('0x35'),require(_0xa458('0x36')));_0x5a9636['use'](_0xa458('0x37'),require(_0xa458('0x38')));_0x5a9636[_0xa458('0x8')](_0xa458('0x39'),require(_0xa458('0x3a')));_0x5a9636[_0xa458('0x8')](_0xa458('0x3b'),require('./api/voiceTransferReport'));_0x5a9636[_0xa458('0x8')](_0xa458('0x3c'),require(_0xa458('0x3d')));_0x5a9636[_0xa458('0x8')]('/api/mail/accounts',require(_0xa458('0x3e')));_0x5a9636['use'](_0xa458('0x3f'),require(_0xa458('0x40')));_0x5a9636[_0xa458('0x8')](_0xa458('0x41'),require('./api/mailSubstatus'));_0x5a9636['use'](_0xa458('0x42'),require(_0xa458('0x43')));_0x5a9636[_0xa458('0x8')](_0xa458('0x44'),require(_0xa458('0x45')));_0x5a9636[_0xa458('0x8')]('/api/mail/applications',require(_0xa458('0x46')));_0x5a9636['use']('/api/mail/reports/queue',require(_0xa458('0x47')));_0x5a9636[_0xa458('0x8')](_0xa458('0x48'),require(_0xa458('0x49')));_0x5a9636[_0xa458('0x8')](_0xa458('0x4a'),require(_0xa458('0x4b')));_0x5a9636['use'](_0xa458('0x4c'),require(_0xa458('0x4d')));_0x5a9636['use'](_0xa458('0x4e'),require(_0xa458('0x4f')));_0x5a9636[_0xa458('0x8')](_0xa458('0x50'),require(_0xa458('0x51')));_0x5a9636[_0xa458('0x8')]('/api/fax/messages',require(_0xa458('0x52')));_0x5a9636[_0xa458('0x8')]('/api/fax/queues',require(_0xa458('0x53')));_0x5a9636['use']('/api/fax/reports/queue',require(_0xa458('0x54')));_0x5a9636[_0xa458('0x8')](_0xa458('0x55'),require(_0xa458('0x56')));_0x5a9636['use'](_0xa458('0x57'),require(_0xa458('0x58')));_0x5a9636[_0xa458('0x8')](_0xa458('0x59'),require('./api/smsInteraction'));_0x5a9636['use'](_0xa458('0x5a'),require(_0xa458('0x5b')));_0x5a9636[_0xa458('0x8')]('/api/sms/queues',require(_0xa458('0x5c')));_0x5a9636['use']('/api/openchannel/accounts',require(_0xa458('0x5d')));_0x5a9636[_0xa458('0x8')](_0xa458('0x5e'),require(_0xa458('0x5f')));_0x5a9636[_0xa458('0x8')]('/api/openchannel/interactions',require(_0xa458('0x60')));_0x5a9636[_0xa458('0x8')](_0xa458('0x61'),require('./api/openchannelMessage'));_0x5a9636[_0xa458('0x8')](_0xa458('0x62'),require(_0xa458('0x63')));_0x5a9636[_0xa458('0x8')]('/api/chat/websites',require(_0xa458('0x64')));_0x5a9636[_0xa458('0x8')](_0xa458('0x65'),require(_0xa458('0x66')));_0x5a9636['use'](_0xa458('0x67'),require(_0xa458('0x68')));_0x5a9636[_0xa458('0x8')](_0xa458('0x69'),require(_0xa458('0x6a')));_0x5a9636['use']('/api/chat/messages',require('./api/chatMessage'));_0x5a9636[_0xa458('0x8')](_0xa458('0x6b'),require(_0xa458('0x6c')));_0x5a9636['use'](_0xa458('0x6d'),require(_0xa458('0x6e')));_0x5a9636[_0xa458('0x8')]('/api/chat/groups',require('./api/chatGroup'));_0x5a9636[_0xa458('0x8')](_0xa458('0x6f'),require(_0xa458('0x70')));_0x5a9636[_0xa458('0x8')]('/api/cm/companies',require('./api/cmCompany'));_0x5a9636[_0xa458('0x8')](_0xa458('0x71'),require('./api/cmContact'));_0x5a9636[_0xa458('0x8')]('/api/cm/hopper',require(_0xa458('0x72')));_0x5a9636['use']('/api/cm/hopper_black',require(_0xa458('0x73')));_0x5a9636[_0xa458('0x8')](_0xa458('0x74'),require(_0xa458('0x75')));_0x5a9636[_0xa458('0x8')](_0xa458('0x76'),require('./api/cmHopperHistory'));_0x5a9636['use'](_0xa458('0x77'),require(_0xa458('0x78')));_0x5a9636[_0xa458('0x8')](_0xa458('0x79'),require(_0xa458('0x7a')));_0x5a9636['use']('/api/automations',require(_0xa458('0x7b')));_0x5a9636['use']('/api/canned_answers',require(_0xa458('0x7c')));_0x5a9636['use']('/api/dispositions',require('./api/disposition'));_0x5a9636[_0xa458('0x8')](_0xa458('0x7d'),require(_0xa458('0x7e')));_0x5a9636[_0xa458('0x8')](_0xa458('0x7f'),require(_0xa458('0x80')));_0x5a9636['use'](_0xa458('0x81'),require(_0xa458('0x82')));_0x5a9636[_0xa458('0x8')](_0xa458('0x83'),require('./api/cdr'));_0x5a9636[_0xa458('0x8')](_0xa458('0x84'),require('./api/voiceQueuesLog'));_0x5a9636[_0xa458('0x8')](_0xa458('0x85'),require('./api/schedule'));_0x5a9636[_0xa458('0x8')](_0xa458('0x86'),require('./api/sound'));_0x5a9636['use']('/api/tags',require(_0xa458('0x87')));_0x5a9636[_0xa458('0x8')](_0xa458('0x88'),require(_0xa458('0x89')));_0x5a9636[_0xa458('0x8')]('/api/triggers',require(_0xa458('0x8a')));_0x5a9636['use']('/api/variables',require('./api/variable'));_0x5a9636[_0xa458('0x8')](_0xa458('0x8b'),require(_0xa458('0x8c')));_0x5a9636[_0xa458('0x8')](_0xa458('0x8d'),require(_0xa458('0x8e')));_0x5a9636[_0xa458('0x8')]('/api/analytics/custom_reports',require(_0xa458('0x8f')));_0x5a9636['use'](_0xa458('0x90'),require(_0xa458('0x91')));_0x5a9636[_0xa458('0x8')](_0xa458('0x92'),require('./api/analyticExtractedReport'));_0x5a9636[_0xa458('0x8')](_0xa458('0x93'),require(_0xa458('0x94')));_0x5a9636[_0xa458('0x8')](_0xa458('0x95'),require(_0xa458('0x96')));_0x5a9636[_0xa458('0x8')](_0xa458('0x97'),require(_0xa458('0x98')));_0x5a9636[_0xa458('0x8')]('/api/integrations/salesforce/accounts',require(_0xa458('0x99')));_0x5a9636[_0xa458('0x8')](_0xa458('0x9a'),require(_0xa458('0x9b')));_0x5a9636[_0xa458('0x8')](_0xa458('0x9c'),require(_0xa458('0x9d')));_0x5a9636[_0xa458('0x8')](_0xa458('0x9e'),require(_0xa458('0x9f')));_0x5a9636['use'](_0xa458('0xa0'),require('./api/intSugarcrmConfiguration'));_0x5a9636[_0xa458('0x8')](_0xa458('0xa1'),require(_0xa458('0xa2')));_0x5a9636[_0xa458('0x8')](_0xa458('0xa3'),require(_0xa458('0xa4')));_0x5a9636[_0xa458('0x8')]('/api/integrations/desk/configurations',require(_0xa458('0xa5')));_0x5a9636[_0xa458('0x8')](_0xa458('0xa6'),require(_0xa458('0xa7')));_0x5a9636[_0xa458('0x8')](_0xa458('0xa8'),require(_0xa458('0xa9')));_0x5a9636[_0xa458('0x8')](_0xa458('0xaa'),require(_0xa458('0xab')));_0x5a9636[_0xa458('0x8')](_0xa458('0xac'),require('./api/intZohoField'));_0x5a9636[_0xa458('0x8')]('/api/integrations/zendesk/accounts',require(_0xa458('0xad')));_0x5a9636[_0xa458('0x8')](_0xa458('0xae'),require('./api/intZendeskConfiguration'));_0x5a9636[_0xa458('0x8')](_0xa458('0xaf'),require(_0xa458('0xb0')));_0x5a9636[_0xa458('0x8')]('/api/integrations/freshdesk/accounts',require(_0xa458('0xb1')));_0x5a9636[_0xa458('0x8')]('/api/integrations/freshdesk/configurations',require(_0xa458('0xb2')));_0x5a9636[_0xa458('0x8')](_0xa458('0xb3'),require(_0xa458('0xb4')));_0x5a9636[_0xa458('0x8')](_0xa458('0xb5'),require(_0xa458('0xb6')));_0x5a9636['use'](_0xa458('0xb7'),require('./api/intVtigerConfiguration'));_0x5a9636[_0xa458('0x8')]('/api/integrations/vtiger/fields',require(_0xa458('0xb8')));_0x5a9636[_0xa458('0x8')](_0xa458('0xb9'),require('./api/intServicenowAccount'));_0x5a9636[_0xa458('0x8')]('/api/integrations/servicenow/configurations',require(_0xa458('0xba')));_0x5a9636[_0xa458('0x8')](_0xa458('0xbb'),require(_0xa458('0xbc')));_0x5a9636[_0xa458('0x8')](_0xa458('0xbd'),require('./api/intDynamics365Account'));_0x5a9636['use'](_0xa458('0xbe'),require(_0xa458('0xbf')));_0x5a9636[_0xa458('0x8')](_0xa458('0xc0'),require('./api/intDynamics365Field'));_0x5a9636[_0xa458('0x8')]('/api/integrations/freshsales/accounts',require('./api/intFreshsalesAccount'));_0x5a9636['use']('/api/integrations/freshsales/configurations',require('./api/intFreshsalesConfiguration'));_0x5a9636[_0xa458('0x8')](_0xa458('0xc1'),require(_0xa458('0xc2')));_0x5a9636[_0xa458('0x8')](_0xa458('0xc3'),require(_0xa458('0xc4')));_0x5a9636[_0xa458('0x8')](_0xa458('0xc5'),require(_0xa458('0xc6')));_0x5a9636[_0xa458('0x8')](_0xa458('0xc7'),require(_0xa458('0xc8')));_0x5a9636[_0xa458('0x8')](_0xa458('0xc9'),require(_0xa458('0xca')));_0x5a9636[_0xa458('0x8')](_0xa458('0xcb'),require(_0xa458('0xcc')));_0x5a9636['use'](_0xa458('0xcd'),require('./api/jscriptySessionReport'));_0x5a9636[_0xa458('0x8')](_0xa458('0xce'),require(_0xa458('0xcf')));_0x5a9636[_0xa458('0x8')](_0xa458('0xd0'),require(_0xa458('0xd1')));_0x5a9636[_0xa458('0x8')](_0xa458('0xd2'),require('./api/squareReportDetail'));_0x5a9636[_0xa458('0x8')](_0xa458('0xd3'),require(_0xa458('0xd4')));_0x5a9636['use'](_0xa458('0xd5'),require('./api/setting'));_0x5a9636[_0xa458('0x8')](_0xa458('0xd6'),require('./api/squareOdbc'));_0x5a9636[_0xa458('0x8')](_0xa458('0xd7'),require(_0xa458('0xd8')));_0x5a9636[_0xa458('0x8')](_0xa458('0xd9'),require('./api/squareRecording'));_0x5a9636[_0xa458('0x8')](_0xa458('0xda'),require('./api/squareMessage'));_0x5a9636[_0xa458('0x8')]('/api/teams',require(_0xa458('0xdb')));_0x5a9636['use'](_0xa458('0xdc'),require('./api/license'));_0x5a9636['use'](_0xa458('0xdd'),require(_0xa458('0xde')));_0x5a9636['use'](_0xa458('0xdf'),require(_0xa458('0xe0')));_0x5a9636[_0xa458('0x8')]('/api/attachments',require(_0xa458('0xe1')));_0x5a9636['use'](_0xa458('0xe2'),require('./api/plugin'));_0x5a9636[_0xa458('0x8')](_0xa458('0xe3'),require(_0xa458('0xe4')));_0x5a9636[_0xa458('0x8')]('/api/chat/reports/transfer',require(_0xa458('0xe5')));_0x5a9636[_0xa458('0x8')]('/api/fax/reports/transfer',require('./api/faxTransferReport'));_0x5a9636[_0xa458('0x8')]('/api/openchannel/reports/transfer',require(_0xa458('0xe6')));_0x5a9636[_0xa458('0x8')]('/api/sms/reports/transfer',require(_0xa458('0xe7')));_0x5a9636[_0xa458('0x8')](_0xa458('0xe8'),require(_0xa458('0xe9')));_0x5a9636['use']('/api/voice/prefixes',require(_0xa458('0xea')));_0x5a9636[_0xa458('0x8')]('/api/userProfiles',require(_0xa458('0xeb')));_0x5a9636[_0xa458('0x8')](_0xa458('0xec'),require('./api/userProfileSection'));_0x5a9636[_0xa458('0x8')](_0xa458('0xed'),require(_0xa458('0xee')));_0x5a9636[_0xa458('0x8')](_0xa458('0xef'),require(_0xa458('0xf0')));_0x5a9636[_0xa458('0x8')](_0xa458('0xf1'),require(_0xa458('0xf2')));_0x5a9636['use'](_0xa458('0xf3'),require(_0xa458('0xf4')));_0x5a9636[_0xa458('0x8')](_0xa458('0xf5'),require('./api/whatsappInteraction'));_0x5a9636['use'](_0xa458('0xf6'),require(_0xa458('0xf7')));_0x5a9636[_0xa458('0x8')]('/api/whatsapp/reports/queue',require(_0xa458('0xf8')));_0x5a9636['use'](_0xa458('0xf9'),require(_0xa458('0xfa')));_0x5a9636[_0xa458('0x8')](_0xa458('0xfb'),require(_0xa458('0xfc')));_0x5a9636[_0xa458('0x8')](_0xa458('0xfd'),require('./api/cloudProvider'));_0x5a9636[_0xa458('0x8')](_0xa458('0xfe'),require('./api/realtime'));_0x5a9636[_0xa458('0x8')](_0xa458('0xff'),require(_0xa458('0x100')));_0x5a9636[_0xa458('0x8')](_0xa458('0x101'),require(_0xa458('0x102')));_0x5a9636['use'](_0xa458('0x103'),require(_0xa458('0x104')));_0x5a9636[_0xa458('0x8')](_0xa458('0x105'),require('./api/jira'));_0x5a9636['use'](_0xa458('0x106'),require(_0xa458('0x107')));_0x5a9636[_0xa458('0x8')](_0xa458('0x108'),require(_0xa458('0x109')));_0x5a9636[_0xa458('0x8')](_0xa458('0x10a'),require(_0xa458('0x10b')));_0x5a9636[_0xa458('0x8')](_0xa458('0x10c'),require('./api/pm2'));_0x5a9636['use'](_0xa458('0x10d'),require('./api/webbar'));_0x5a9636['use'](_0xa458('0x10e'),express[_0xa458('0x10f')](path['join'](config[_0xa458('0x110')],'/apidoc')));_0x5a9636[_0xa458('0x8')](_0xa458('0x111'),express[_0xa458('0x10f')](path[_0xa458('0x112')](config[_0xa458('0x110')],_0xa458('0x111'))));_0x5a9636[_0xa458('0x8')](_0xa458('0x113'),express['static'](path[_0xa458('0x112')](config[_0xa458('0x110')],'/demo')));_0x5a9636['use'](_0xa458('0x114'),express[_0xa458('0x10f')](path[_0xa458('0x112')](config[_0xa458('0x110')],_0xa458('0x115'),_0xa458('0x116'))));_0x5a9636[_0xa458('0x8')](_0xa458('0x117'),express[_0xa458('0x10f')](path[_0xa458('0x112')](config[_0xa458('0x110')],_0xa458('0x118'))));_0x5a9636[_0xa458('0x119')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0xa458('0x11a')](errors[0x194]);_0x5a9636[_0xa458('0x119')]('/*')['get'](function(_0x553ec6,_0x681e65){_0x681e65['sendFile'](path[_0xa458('0x11b')](_0x5a9636[_0xa458('0x11a')](_0xa458('0x11c'))+_0xa458('0x11d')));});};var sensitiveFields=[_0xa458('0x11e'),_0xa458('0x11f'),_0xa458('0x120'),_0xa458('0x121'),_0xa458('0x122'),_0xa458('0x123'),_0xa458('0x124'),'phone',_0xa458('0x125'),_0xa458('0x126'),_0xa458('0x127'),'clientId',_0xa458('0x128'),'securityToken','code',_0xa458('0x129'),'tenantId',_0xa458('0x12a'),'channelSecret',_0xa458('0x12b'),_0xa458('0x12c'),_0xa458('0x12d'),_0xa458('0x12e'),_0xa458('0x12f'),_0xa458('0x130'),_0xa458('0x131'),_0xa458('0x132'),_0xa458('0x133'),'vidaooApiKey',_0xa458('0x134'),_0xa458('0x135'),_0xa458('0x136'),_0xa458('0x137'),'key','user',_0xa458('0x138'),_0xa458('0x139'),_0xa458('0x13a'),_0xa458('0x13b'),'secret',_0xa458('0x13c'),_0xa458('0x13d')];function maskSensitiveData(_0x46e518){var _0x3b7646=/(?!^)[\s\S](?!$)/g;if(!_[_0xa458('0x13e')](_0x46e518))return;for(var _0x70640c in _0x46e518){if(_['isArray'](_0x46e518[_0x70640c])){for(var _0x5f2351=0x0;_0x5f2351<_0x46e518[_0x70640c][_0xa458('0x13f')];_0x5f2351++){maskSensitiveData(_0x46e518[_0x70640c][_0x5f2351]);}}else if(_[_0xa458('0x13e')](_0x46e518[_0x70640c])){maskSensitiveData(_0x46e518[_0x70640c]);}else if(_[_0xa458('0x140')](_0x46e518[_0x70640c])){_0x46e518[_0x70640c]=_0x46e518[_0x70640c][_0xa458('0x141')](/{{{/g,_0xa458('0x142'))['replace'](/}}}/g,'}@@')[_0xa458('0x141')](/{{/g,'@{')[_0xa458('0x141')](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x70640c)){_0x46e518[_0x70640c]=_0x46e518[_0x70640c][_0xa458('0x141')](_0x3b7646,'*');}}}} \ No newline at end of file +var _0x30cd=['./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','./api/intVtigerField','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','./api/intServicenowField','./api/intDynamics365Configuration','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','./api/jscriptySessionReport','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','/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/license','./api/license','/api/campaigns','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/voice/prefixes','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','/api/whatsapp/accounts','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','/api/cloudProviders','./api/cloudProvider','./api/realtime','/api/auth/local','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/jira','/api/rpc','/api/version','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','static','join','root','/apidoc','/www','/demo','/snippet','snippet','3.0.0','/plugins','route','get','sendFile','resolve','/index.html','password','apiKey','firstName','lastName','street','phone','clientId','clientSecret','securityToken','code','accessKey','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','consumerSecret','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','pass','accountSid','localstationid','secret','registry','oldPassword','isPlainObject','isArray','isString','@@{','replace','}@@','lodash','path','express','util','./errors','./config/logger','api','auth','./safe-template','safeTemplate','default','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','headers','x-forwarded-for','url','statusCode','user','name','role','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','format','method','remoteAddress','agent_name','./api/user','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','/api/screen/recordings','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','/api/voice/calls/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','/api/trunks','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','/api/mail/accounts','./api/mailAccount','./api/mailQueue','/api/mail/substatuses','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','./api/dashboard','/api/fax/accounts','./api/faxAccount','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','./api/openchannelApplication','/api/openchannel/interactions','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','./api/chatApplication','./api/chatInteraction','./api/chatMessage','./api/chatOfflineMessage','/api/chat/queues','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','./api/cmContact','/api/cm/hopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/tags','./api/tag','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','./api/analyticFieldReport','/api/analytics/tree_reports','/api/integrations/salesforce/accounts','./api/intSalesforceConfiguration','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts'];(function(_0x5b411a,_0x9445a4){var _0x3d21e3=function(_0x52efc0){while(--_0x52efc0){_0x5b411a['push'](_0x5b411a['shift']());}};_0x3d21e3(++_0x9445a4);}(_0x30cd,0x1e3));var _0xd30c=function(_0x48d388,_0x5e792a){_0x48d388=_0x48d388-0x0;var _0x8f96c6=_0x30cd[_0x48d388];return _0x8f96c6;};'use strict';var _=require(_0xd30c('0x0'));var path=require(_0xd30c('0x1'));var express=require(_0xd30c('0x2'));var ewinston=require('express-winston');var util=require(_0xd30c('0x3'));var errors=require(_0xd30c('0x4'));var config=require('./config/environment');var logger=require(_0xd30c('0x5'))(_0xd30c('0x6'));var authLogger=require(_0xd30c('0x5'))(_0xd30c('0x7'));var safeTemplate=require(_0xd30c('0x8'))[_0xd30c('0x9')];exports[_0xd30c('0xa')]=function(_0x4d00e4){_0x4d00e4[_0xd30c('0xb')](ewinston[_0xd30c('0xc')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x6d239e,_0x374c9e){var _0x44af2e=_0xd30c('0xd');if(!_[_0xd30c('0xe')](_0x6d239e[_0xd30c('0xf')])){_0x44af2e+=_0xd30c('0x10');var _0x21c3bd=_0x6d239e[_0xd30c('0xf')];maskSensitiveData(_0x21c3bd);}return safeTemplate(util['format'](_0x44af2e,_0x6d239e['method'],_0x6d239e[_0xd30c('0x11')][_0xd30c('0x12')]?_0x6d239e['headers'][_0xd30c('0x12')]:_0x6d239e['connection']['remoteAddress']||_0x6d239e['ip'],_0x6d239e[_0xd30c('0x13')],_0x374c9e[_0xd30c('0x14')],_0x374c9e['responseTime'],_0x6d239e[_0xd30c('0x15')]?_0x6d239e['user']['id']:null,_0x6d239e[_0xd30c('0x15')]?_0x6d239e[_0xd30c('0x15')][_0xd30c('0x16')]:null,_0x6d239e[_0xd30c('0x15')]?_0x6d239e[_0xd30c('0x15')][_0xd30c('0x17')]:null,_0x21c3bd?util[_0xd30c('0x18')](_0x21c3bd,![],null):''));}}));_0x4d00e4[_0xd30c('0xb')](ewinston[_0xd30c('0xc')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x306282,_0x227ca1){var _0x1cd97e=_0xd30c('0x19');if(_0x306282[_0xd30c('0xf')]&&_0x306282['body'][_0xd30c('0x1a')]&&_0x306282[_0xd30c('0xf')][_0xd30c('0x1b')]){_0x1cd97e=_0xd30c('0x1c');}return util[_0xd30c('0x1d')](_0x1cd97e,_0x306282[_0xd30c('0x1e')],_0x306282[_0xd30c('0x11')]['x-forwarded-for']?_0x306282[_0xd30c('0x11')][_0xd30c('0x12')]:_0x306282['connection'][_0xd30c('0x1f')]||_0x306282['ip'],_0x306282[_0xd30c('0x13')],_0x227ca1[_0xd30c('0x14')],_0x227ca1['responseTime'],_0x306282[_0xd30c('0x15')]?_0x306282['user']['id']:null,_0x306282[_0xd30c('0x15')]?_0x306282[_0xd30c('0x15')][_0xd30c('0x16')]:null,_0x306282[_0xd30c('0x15')]?_0x306282[_0xd30c('0x15')]['role']:null,_0x306282['body']&&_0x306282[_0xd30c('0xf')][_0xd30c('0x1a')]?_0x306282['body'][_0xd30c('0x1a')]:'other',_0x306282['body']&&_0x306282[_0xd30c('0xf')][_0xd30c('0x1b')]?_0x306282[_0xd30c('0xf')]['agent_id']:'',_0x306282[_0xd30c('0xf')]&&_0x306282['body']['agent_name']?_0x306282[_0xd30c('0xf')][_0xd30c('0x20')]:'');},'ignoreRoute':function(_0x36db1a){var _0x142af2=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x142af2['test'](_0x36db1a[_0xd30c('0x13')]);}}));_0x4d00e4['use']('/api/users',require(_0xd30c('0x21')));_0x4d00e4[_0xd30c('0xb')]('/api/voice/chanspy',require('./api/voiceChanSpy'));_0x4d00e4['use'](_0xd30c('0x22'),require(_0xd30c('0x23')));_0x4d00e4['use'](_0xd30c('0x24'),require(_0xd30c('0x25')));_0x4d00e4[_0xd30c('0xb')]('/api/voice/mohs',require(_0xd30c('0x26')));_0x4d00e4['use'](_0xd30c('0x27'),require(_0xd30c('0x28')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x29'),require('./api/voiceRecording'));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x2a'),require('./api/screenRecording'));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x2b'),require(_0xd30c('0x2c')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x2d'),require('./api/voiceMailMessage'));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x2e'),require('./api/voiceCallReport'));_0x4d00e4['use']('/api/voice/dials/reports',require(_0xd30c('0x2f')));_0x4d00e4['use'](_0xd30c('0x30'),require(_0xd30c('0x31')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x32'),require(_0xd30c('0x33')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x34'),require('./api/memberReport'));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x35'),require('./api/trunk'));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x36'),require(_0xd30c('0x37')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x38'),require('./api/mailServerOut'));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x39'),require(_0xd30c('0x3a')));_0x4d00e4[_0xd30c('0xb')]('/api/mail/queues',require(_0xd30c('0x3b')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x3c'),require('./api/mailSubstatus'));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x3d'),require(_0xd30c('0x3e')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x3f'),require('./api/mailMessage'));_0x4d00e4[_0xd30c('0xb')]('/api/mail/applications',require(_0xd30c('0x40')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x41'),require(_0xd30c('0x42')));_0x4d00e4[_0xd30c('0xb')]('/api/dashboards',require(_0xd30c('0x43')));_0x4d00e4[_0xd30c('0xb')]('/api/dashboards/items',require('./api/dashboardItem'));_0x4d00e4['use'](_0xd30c('0x44'),require(_0xd30c('0x45')));_0x4d00e4['use']('/api/fax/applications',require('./api/faxApplication'));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x46'),require(_0xd30c('0x47')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x48'),require(_0xd30c('0x49')));_0x4d00e4['use'](_0xd30c('0x4a'),require(_0xd30c('0x4b')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x4c'),require(_0xd30c('0x4d')));_0x4d00e4['use'](_0xd30c('0x4e'),require('./api/smsAccount'));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x4f'),require(_0xd30c('0x50')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x51'),require(_0xd30c('0x52')));_0x4d00e4['use']('/api/sms/messages',require(_0xd30c('0x53')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x54'),require(_0xd30c('0x55')));_0x4d00e4['use'](_0xd30c('0x56'),require(_0xd30c('0x57')));_0x4d00e4[_0xd30c('0xb')]('/api/openchannel/applications',require(_0xd30c('0x58')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x59'),require('./api/openchannelInteraction'));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x5a'),require(_0xd30c('0x5b')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x5c'),require(_0xd30c('0x5d')));_0x4d00e4[_0xd30c('0xb')]('/api/chat/websites',require(_0xd30c('0x5e')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x5f'),require(_0xd30c('0x60')));_0x4d00e4['use']('/api/chat/applications',require(_0xd30c('0x61')));_0x4d00e4[_0xd30c('0xb')]('/api/chat/interactions',require(_0xd30c('0x62')));_0x4d00e4['use']('/api/chat/messages',require(_0xd30c('0x63')));_0x4d00e4[_0xd30c('0xb')]('/api/chat/offline_messages',require(_0xd30c('0x64')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x65'),require('./api/chatQueue'));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x66'),require(_0xd30c('0x67')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x68'),require(_0xd30c('0x69')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x6a'),require(_0xd30c('0x6b')));_0x4d00e4[_0xd30c('0xb')]('/api/cm/contacts',require(_0xd30c('0x6c')));_0x4d00e4['use'](_0xd30c('0x6d'),require('./api/cmHopper'));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x6e'),require(_0xd30c('0x6f')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x70'),require(_0xd30c('0x71')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x72'),require(_0xd30c('0x73')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x74'),require(_0xd30c('0x75')));_0x4d00e4['use'](_0xd30c('0x76'),require(_0xd30c('0x77')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x78'),require(_0xd30c('0x79')));_0x4d00e4['use'](_0xd30c('0x7a'),require(_0xd30c('0x7b')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x7c'),require(_0xd30c('0x7d')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x7e'),require('./api/condition'));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x7f'),require(_0xd30c('0x80')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x81'),require(_0xd30c('0x82')));_0x4d00e4['use'](_0xd30c('0x83'),require(_0xd30c('0x84')));_0x4d00e4[_0xd30c('0xb')]('/api/voiceQueuesLog',require(_0xd30c('0x85')));_0x4d00e4['use'](_0xd30c('0x86'),require(_0xd30c('0x87')));_0x4d00e4[_0xd30c('0xb')]('/api/sounds',require('./api/sound'));_0x4d00e4['use'](_0xd30c('0x88'),require(_0xd30c('0x89')));_0x4d00e4[_0xd30c('0xb')]('/api/templates',require('./api/template'));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x8a'),require(_0xd30c('0x8b')));_0x4d00e4['use'](_0xd30c('0x8c'),require(_0xd30c('0x8d')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x8e'),require(_0xd30c('0x8f')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x90'),require(_0xd30c('0x91')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x92'),require(_0xd30c('0x93')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x94'),require(_0xd30c('0x95')));_0x4d00e4[_0xd30c('0xb')]('/api/analytics/extracted_reports',require(_0xd30c('0x96')));_0x4d00e4['use'](_0xd30c('0x97'),require(_0xd30c('0x98')));_0x4d00e4['use']('/api/analytics/field_reports',require(_0xd30c('0x99')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x9a'),require('./api/analyticTreeReport'));_0x4d00e4['use'](_0xd30c('0x9b'),require('./api/intSalesforceAccount'));_0x4d00e4['use']('/api/integrations/salesforce/configurations',require(_0xd30c('0x9c')));_0x4d00e4[_0xd30c('0xb')]('/api/integrations/salesforce/fields',require(_0xd30c('0x9d')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x9e'),require(_0xd30c('0x9f')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xa0'),require(_0xd30c('0xa1')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xa2'),require(_0xd30c('0xa3')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xa4'),require(_0xd30c('0xa5')));_0x4d00e4['use'](_0xd30c('0xa6'),require(_0xd30c('0xa7')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xa8'),require(_0xd30c('0xa9')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xaa'),require(_0xd30c('0xab')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xac'),require(_0xd30c('0xad')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xae'),require('./api/intZohoField'));_0x4d00e4[_0xd30c('0xb')]('/api/integrations/zendesk/accounts',require('./api/intZendeskAccount'));_0x4d00e4[_0xd30c('0xb')]('/api/integrations/zendesk/configurations',require(_0xd30c('0xaf')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xb0'),require('./api/intZendeskField'));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xb1'),require(_0xd30c('0xb2')));_0x4d00e4['use'](_0xd30c('0xb3'),require(_0xd30c('0xb4')));_0x4d00e4[_0xd30c('0xb')]('/api/integrations/freshdesk/fields',require(_0xd30c('0xb5')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xb6'),require(_0xd30c('0xb7')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xb8'),require(_0xd30c('0xb9')));_0x4d00e4[_0xd30c('0xb')]('/api/integrations/vtiger/fields',require(_0xd30c('0xba')));_0x4d00e4[_0xd30c('0xb')]('/api/integrations/servicenow/accounts',require(_0xd30c('0xbb')));_0x4d00e4['use'](_0xd30c('0xbc'),require(_0xd30c('0xbd')));_0x4d00e4['use']('/api/integrations/servicenow/fields',require(_0xd30c('0xbe')));_0x4d00e4[_0xd30c('0xb')]('/api/integrations/dynamics365/accounts',require('./api/intDynamics365Account'));_0x4d00e4[_0xd30c('0xb')]('/api/integrations/dynamics365/configurations',require(_0xd30c('0xbf')));_0x4d00e4[_0xd30c('0xb')]('/api/integrations/dynamics365/fields',require(_0xd30c('0xc0')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xc1'),require(_0xd30c('0xc2')));_0x4d00e4['use'](_0xd30c('0xc3'),require('./api/intFreshsalesConfiguration'));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xc4'),require(_0xd30c('0xc5')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xc6'),require(_0xd30c('0xc7')));_0x4d00e4['use']('/api/chat/reports/queue',require(_0xd30c('0xc8')));_0x4d00e4['use'](_0xd30c('0xc9'),require(_0xd30c('0xca')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xcb'),require(_0xd30c('0xcc')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xcd'),require(_0xd30c('0xce')));_0x4d00e4['use']('/api/jscripty/sessions/reports',require(_0xd30c('0xcf')));_0x4d00e4['use']('/api/sms/reports/queue',require(_0xd30c('0xd0')));_0x4d00e4['use'](_0xd30c('0xd1'),require(_0xd30c('0xd2')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xd3'),require('./api/squareReportDetail'));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xd4'),require(_0xd30c('0xd5')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xd6'),require(_0xd30c('0xd7')));_0x4d00e4['use'](_0xd30c('0xd8'),require(_0xd30c('0xd9')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xda'),require(_0xd30c('0xdb')));_0x4d00e4[_0xd30c('0xb')]('/api/square/recordings',require(_0xd30c('0xdc')));_0x4d00e4['use'](_0xd30c('0xdd'),require('./api/squareMessage'));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xde'),require('./api/team'));_0x4d00e4['use'](_0xd30c('0xdf'),require(_0xd30c('0xe0')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xe1'),require('./api/campaign'));_0x4d00e4[_0xd30c('0xb')]('/api/migrations',require(_0xd30c('0xe2')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xe3'),require(_0xd30c('0xe4')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xe5'),require(_0xd30c('0xe6')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xe7'),require(_0xd30c('0xe8')));_0x4d00e4['use'](_0xd30c('0xe9'),require(_0xd30c('0xea')));_0x4d00e4['use']('/api/fax/reports/transfer',require(_0xd30c('0xeb')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xec'),require(_0xd30c('0xed')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xee'),require(_0xd30c('0xef')));_0x4d00e4['use']('/api/cm/lists',require('./api/cmList'));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xf0'),require('./api/voicePrefix'));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xf1'),require(_0xd30c('0xf2')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xf3'),require(_0xd30c('0xf4')));_0x4d00e4['use'](_0xd30c('0xf5'),require(_0xd30c('0xf6')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xf7'),require('./api/userNotification'));_0x4d00e4['use'](_0xd30c('0xf8'),require('./api/whatsappAccount'));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xf9'),require(_0xd30c('0xfa')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xfb'),require(_0xd30c('0xfc')));_0x4d00e4['use'](_0xd30c('0xfd'),require('./api/whatsappMessage'));_0x4d00e4['use'](_0xd30c('0xfe'),require(_0xd30c('0xff')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x100'),require(_0xd30c('0x101')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x102'),require('./api/whatsappQueue'));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x103'),require(_0xd30c('0x104')));_0x4d00e4[_0xd30c('0xb')]('/api/realtime',require(_0xd30c('0x105')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x106'),require('./api/authLocal'));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x107'),require(_0xd30c('0x108')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x109'),require('./api/authActiveDirectory'));_0x4d00e4[_0xd30c('0xb')]('/api/jira',require(_0xd30c('0x10a')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x10b'),require('./api/rpc'));_0x4d00e4['use'](_0xd30c('0x10c'),require('./api/version'));_0x4d00e4[_0xd30c('0xb')]('/api/system',require(_0xd30c('0x10d')));_0x4d00e4['use'](_0xd30c('0x10e'),require(_0xd30c('0x10f')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x110'),require(_0xd30c('0x111')));_0x4d00e4[_0xd30c('0xb')]('/apidoc',express[_0xd30c('0x112')](path[_0xd30c('0x113')](config[_0xd30c('0x114')],_0xd30c('0x115'))));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x116'),express['static'](path[_0xd30c('0x113')](config['root'],_0xd30c('0x116'))));_0x4d00e4['use'](_0xd30c('0x117'),express[_0xd30c('0x112')](path['join'](config[_0xd30c('0x114')],_0xd30c('0x117'))));_0x4d00e4['use'](_0xd30c('0x118'),express['static'](path['join'](config[_0xd30c('0x114')],_0xd30c('0x119'),_0xd30c('0x11a'))));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x11b'),express['static'](path[_0xd30c('0x113')](config[_0xd30c('0x114')],'/server/files/plugins')));_0x4d00e4[_0xd30c('0x11c')]('/:url(api|auth|components|app|bower_components|assets)/*')['get'](errors[0x194]);_0x4d00e4[_0xd30c('0x11c')]('/*')[_0xd30c('0x11d')](function(_0x587149,_0x65b63f){_0x65b63f[_0xd30c('0x11e')](path[_0xd30c('0x11f')](_0x4d00e4[_0xd30c('0x11d')]('appPath')+_0xd30c('0x120')));});};var sensitiveFields=['username',_0xd30c('0x121'),'newPassword',_0xd30c('0x122'),_0xd30c('0x123'),_0xd30c('0x124'),_0xd30c('0x125'),_0xd30c('0x126'),'mobile','fax','email',_0xd30c('0x127'),_0xd30c('0x128'),_0xd30c('0x129'),_0xd30c('0x12a'),_0xd30c('0x12b'),'tenantId',_0xd30c('0x12c'),_0xd30c('0x12d'),_0xd30c('0x12e'),_0xd30c('0x12f'),_0xd30c('0x130'),_0xd30c('0x131'),_0xd30c('0x132'),'membername',_0xd30c('0x133'),_0xd30c('0x134'),_0xd30c('0x135'),_0xd30c('0x136'),_0xd30c('0x137'),_0xd30c('0x138'),_0xd30c('0x139'),_0xd30c('0x13a'),'key',_0xd30c('0x15'),_0xd30c('0x13b'),_0xd30c('0x13c'),_0xd30c('0x13d'),'dsn',_0xd30c('0x13e'),_0xd30c('0x13f'),_0xd30c('0x140')];function maskSensitiveData(_0x2528ca){var _0x439ddb=/(?!^)[\s\S](?!$)/g;if(!_[_0xd30c('0x141')](_0x2528ca))return;for(var _0x552031 in _0x2528ca){if(_[_0xd30c('0x142')](_0x2528ca[_0x552031])){for(var _0xb94fee=0x0;_0xb94fee<_0x2528ca[_0x552031]['length'];_0xb94fee++){maskSensitiveData(_0x2528ca[_0x552031][_0xb94fee]);}}else if(_[_0xd30c('0x141')](_0x2528ca[_0x552031])){maskSensitiveData(_0x2528ca[_0x552031]);}else if(_[_0xd30c('0x143')](_0x2528ca[_0x552031])){_0x2528ca[_0x552031]=_0x2528ca[_0x552031]['replace'](/{{{/g,_0xd30c('0x144'))[_0xd30c('0x145')](/}}}/g,_0xd30c('0x146'))[_0xd30c('0x145')](/{{/g,'@{')[_0xd30c('0x145')](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x552031)){_0x2528ca[_0x552031]=_0x2528ca[_0x552031][_0xd30c('0x145')](_0x439ddb,'*');}}}} \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 30f1c3f..9ec961c 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x81b9=['../api/smsMessage/smsMessage.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.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/squareReport/squareReport.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareMessage/squareMessage.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','listen','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','jayson/promise','bluebird','lodash','merge','../api/user/user.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc'];(function(_0x2b60d1,_0x20a442){var _0x44a53b=function(_0x55211f){while(--_0x55211f){_0x2b60d1['push'](_0x2b60d1['shift']());}};_0x44a53b(++_0x20a442);}(_0x81b9,0x197));var _0x981b=function(_0x2e369f,_0x10fe9b){_0x2e369f=_0x2e369f-0x0;var _0x2ba625=_0x81b9[_0x2e369f];return _0x2ba625;};'use strict';var jayson=require(_0x981b('0x0'));var BPromise=require(_0x981b('0x1'));var _=require(_0x981b('0x2'));var config=require('../config/environment');exports['listen']=function(){return new BPromise(function(_0x68648d,_0x2ab2cc){var _0x1dd259={};_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require(_0x981b('0x4')));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require('../api/voiceExtension/voiceExtension.rpc'));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require(_0x981b('0x5')));_0x1dd259=_['merge'](_0x1dd259,require(_0x981b('0x6')));_0x1dd259=_['merge'](_0x1dd259,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require(_0x981b('0x7')));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require(_0x981b('0x8')));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require(_0x981b('0x9')));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require(_0x981b('0xa')));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require(_0x981b('0xb')));_0x1dd259=_['merge'](_0x1dd259,require(_0x981b('0xc')));_0x1dd259=_['merge'](_0x1dd259,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require(_0x981b('0xd')));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require(_0x981b('0xe')));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require(_0x981b('0xf')));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require(_0x981b('0x10')));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require(_0x981b('0x11')));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require(_0x981b('0x12')));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x1dd259=_['merge'](_0x1dd259,require('../api/faxAccount/faxAccount.rpc'));_0x1dd259=_['merge'](_0x1dd259,require(_0x981b('0x13')));_0x1dd259=_['merge'](_0x1dd259,require(_0x981b('0x14')));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require('../api/faxMessage/faxMessage.rpc'));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require(_0x981b('0x15')));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require(_0x981b('0x16')));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require(_0x981b('0x17')));_0x1dd259=_['merge'](_0x1dd259,require(_0x981b('0x18')));_0x1dd259=_['merge'](_0x1dd259,require(_0x981b('0x19')));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require('../api/smsQueue/smsQueue.rpc'));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require(_0x981b('0x1a')));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require(_0x981b('0x1b')));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require(_0x981b('0x1c')));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require(_0x981b('0x1d')));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require(_0x981b('0x1e')));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require(_0x981b('0x1f')));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require(_0x981b('0x20')));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require(_0x981b('0x21')));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require(_0x981b('0x22')));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require(_0x981b('0x23')));_0x1dd259=_['merge'](_0x1dd259,require(_0x981b('0x24')));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require(_0x981b('0x25')));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require(_0x981b('0x26')));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require(_0x981b('0x27')));_0x1dd259=_['merge'](_0x1dd259,require(_0x981b('0x28')));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require(_0x981b('0x29')));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require(_0x981b('0x2a')));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require(_0x981b('0x2b')));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require('../api/variable/variable.rpc'));_0x1dd259=_['merge'](_0x1dd259,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require(_0x981b('0x2c')));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require(_0x981b('0x2d')));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require(_0x981b('0x2e')));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require(_0x981b('0x2f')));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require(_0x981b('0x30')));_0x1dd259=_['merge'](_0x1dd259,require(_0x981b('0x31')));_0x1dd259=_['merge'](_0x1dd259,require(_0x981b('0x32')));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require(_0x981b('0x33')));_0x1dd259=_['merge'](_0x1dd259,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require(_0x981b('0x34')));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require(_0x981b('0x35')));_0x1dd259=_['merge'](_0x1dd259,require(_0x981b('0x36')));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require('../api/squareProject/squareProject.rpc'));_0x1dd259=_['merge'](_0x1dd259,require('../api/squareRecording/squareRecording.rpc'));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require(_0x981b('0x37')));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require('../api/campaign/campaign.rpc'));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require(_0x981b('0x38')));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require(_0x981b('0x39')));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require(_0x981b('0x3a')));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require(_0x981b('0x3b')));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require(_0x981b('0x3c')));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x1dd259=_[_0x981b('0x3')](_0x1dd259,require(_0x981b('0x3d')));var _0x5e8038=jayson[_0x981b('0x3e')](_0x1dd259)[_0x981b('0x3f')]();var _0x20b77a=config[_0x981b('0x40')][_0x981b('0x41')]||config[_0x981b('0x41')]+0x1;var _0x58368a=config[_0x981b('0x40')]['ip']||_0x981b('0x42');_0x5e8038['on']('error',function(_0x5baee6){return _0x2ab2cc(_0x5baee6);});_0x5e8038[_0x981b('0x43')](_0x20b77a,_0x58368a,function(){console[_0x981b('0x44')](_0x981b('0x45'),_0x58368a,_0x20b77a);require(_0x981b('0x46'))['default']();return _0x68648d(_0x981b('0x47')+_0x58368a+':'+_0x20b77a);});});}; \ No newline at end of file +var _0xba5c=['../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/attachment/attachment.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','rpc','port','localhost','error','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','bluebird','../config/environment','listen','../api/user/user.rpc','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc'];(function(_0x50b2fe,_0x4a6b3c){var _0x1c48f0=function(_0x5e0763){while(--_0x5e0763){_0x50b2fe['push'](_0x50b2fe['shift']());}};_0x1c48f0(++_0x4a6b3c);}(_0xba5c,0x1bc));var _0xcba5=function(_0x2c97fd,_0x511278){_0x2c97fd=_0x2c97fd-0x0;var _0x2d1e17=_0xba5c[_0x2c97fd];return _0x2d1e17;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xcba5('0x0'));var _=require('lodash');var config=require(_0xcba5('0x1'));exports[_0xcba5('0x2')]=function(){return new BPromise(function(_0x27330f,_0x50d795){var _0x469c98={};_0x469c98=_['merge'](_0x469c98,require(_0xcba5('0x3')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x5')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require('../api/voiceQueue/voiceQueue.rpc'));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x6')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x7')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x8')));_0x469c98=_['merge'](_0x469c98,require(_0xcba5('0x9')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0xa')));_0x469c98=_['merge'](_0x469c98,require(_0xcba5('0xb')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0xc')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0xd')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require('../api/mailServerIn/mailServerIn.rpc'));_0x469c98=_['merge'](_0x469c98,require(_0xcba5('0xe')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0xf')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x10')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x11')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x12')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x13')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require('../api/faxAccount/faxAccount.rpc'));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x14')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x15')));_0x469c98=_['merge'](_0x469c98,require('../api/faxMessage/faxMessage.rpc'));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require('../api/faxQueue/faxQueue.rpc'));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x16')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x17')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x18')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x19')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x1a')));_0x469c98=_['merge'](_0x469c98,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x1b')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x469c98=_['merge'](_0x469c98,require(_0xcba5('0x1c')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x1d')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x1e')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require('../api/chatQueue/chatQueue.rpc'));_0x469c98=_['merge'](_0x469c98,require('../api/cmContact/cmContact.rpc'));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x1f')));_0x469c98=_['merge'](_0x469c98,require(_0xcba5('0x20')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x21')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x22')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x23')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require('../api/pause/pause.rpc'));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x24')));_0x469c98=_['merge'](_0x469c98,require(_0xcba5('0x25')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require('../api/trigger/trigger.rpc'));_0x469c98=_['merge'](_0x469c98,require('../api/variable/variable.rpc'));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x469c98=_['merge'](_0x469c98,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x469c98=_['merge'](_0x469c98,require(_0xcba5('0x26')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x27')));_0x469c98=_['merge'](_0x469c98,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x28')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x29')));_0x469c98=_['merge'](_0x469c98,require(_0xcba5('0x2a')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x2b')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x2c')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x2d')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x2e')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x2f')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x30')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x31')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require('../api/squareRecording/squareRecording.rpc'));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x32')));_0x469c98=_['merge'](_0x469c98,require('../api/campaign/campaign.rpc'));_0x469c98=_['merge'](_0x469c98,require(_0xcba5('0x33')));_0x469c98=_['merge'](_0x469c98,require('../api/plugin/plugin.rpc'));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x34')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x469c98=_['merge'](_0x469c98,require(_0xcba5('0x35')));_0x469c98=_['merge'](_0x469c98,require(_0xcba5('0x36')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x37')));var _0x5e4250=jayson[_0xcba5('0x38')](_0x469c98)['http']();var _0x21db33=config[_0xcba5('0x39')][_0xcba5('0x3a')]||config[_0xcba5('0x3a')]+0x1;var _0x456736=config[_0xcba5('0x39')]['ip']||_0xcba5('0x3b');_0x5e4250['on'](_0xcba5('0x3c'),function(_0x2bad1b){return _0x50d795(_0x2bad1b);});_0x5e4250[_0xcba5('0x2')](_0x21db33,_0x456736,function(){console['log'](_0xcba5('0x3d'),_0x456736,_0x21db33);require(_0xcba5('0x3e'))[_0xcba5('0x3f')]();return _0x27330f(_0xcba5('0x40')+_0x456736+':'+_0x21db33);});});}; \ No newline at end of file diff --git a/server/safe-template.js b/server/safe-template.js index 9e1ca46..9f218f2 100644 --- a/server/safe-template.js +++ b/server/safe-template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xea28=['isPlainObject','reduce','exports','safeTemplate','lodash','{\x20{\x20','\x20}\x20}','string','replace','map'];(function(_0x55848a,_0xf2a1f3){var _0x181cc6=function(_0x2bde67){while(--_0x2bde67){_0x55848a['push'](_0x55848a['shift']());}};_0x181cc6(++_0xf2a1f3);}(_0xea28,0x13a));var _0x8ea2=function(_0x39979a,_0x55abc6){_0x39979a=_0x39979a-0x0;var _0x43b59d=_0xea28[_0x39979a];return _0x43b59d;};var _=require(_0x8ea2('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x2e031a){return _0x2e031a==='{{'?_0x8ea2('0x1'):_0x8ea2('0x2');}function safeTemplate(_0x459c4e){var _0x25e47e=_0x459c4e;if(typeof _0x459c4e===_0x8ea2('0x3')){_0x25e47e=_0x459c4e[_0x8ea2('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x459c4e)){_0x25e47e=_0x459c4e[_0x8ea2('0x5')](function(_0x23aaf1){return safeTemplate(_0x23aaf1);});}else if(_[_0x8ea2('0x6')](_0x459c4e)){_0x25e47e=Object['keys'](_0x459c4e)[_0x8ea2('0x7')](function(_0x435d78,_0xb7f278){_0x435d78[_0xb7f278]=safeTemplate(_0x459c4e[_0xb7f278]);return _0x435d78;},{});}return _0x25e47e;}module[_0x8ea2('0x8')][_0x8ea2('0x9')]=safeTemplate; \ No newline at end of file +var _0x1eba=['\x20}\x20}','replace','isArray','map','isPlainObject','keys','reduce','exports','safeTemplate','lodash','{\x20{\x20'];(function(_0x43de22,_0x1eced6){var _0x4b15ee=function(_0x6e36da){while(--_0x6e36da){_0x43de22['push'](_0x43de22['shift']());}};_0x4b15ee(++_0x1eced6);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0x1eba[_0x138f59];return _0x3d114d;};var _=require(_0xa1eb('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x2b1355){return _0x2b1355==='{{'?_0xa1eb('0x1'):_0xa1eb('0x2');}function safeTemplate(_0x3ef7ee){var _0x5865fc=_0x3ef7ee;if(typeof _0x3ef7ee==='string'){_0x5865fc=_0x3ef7ee[_0xa1eb('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xa1eb('0x4')](_0x3ef7ee)){_0x5865fc=_0x3ef7ee[_0xa1eb('0x5')](function(_0xf9d704){return safeTemplate(_0xf9d704);});}else if(_[_0xa1eb('0x6')](_0x3ef7ee)){_0x5865fc=Object[_0xa1eb('0x7')](_0x3ef7ee)[_0xa1eb('0x8')](function(_0x2bfbb0,_0x39a5a3){_0x2bfbb0[_0x39a5a3]=safeTemplate(_0x3ef7ee[_0x39a5a3]);return _0x2bfbb0;},{});}return _0x5865fc;}module[_0xa1eb('0x9')][_0xa1eb('0xa')]=safeTemplate; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index f969b3c..16c1137 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 _0x242e=['SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setContext','setExtension','noop','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','agi','wait','WAIT','label','exports','util','events','EventEmitter','utf8','setTimeout','headers','emit','line','toLowerCase','hangup','substring','520-Invalid','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','substr','indexOf','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','sendRequest','prototype','answer','ANSWER','beep','format','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','EXEC\x20%s\x20%s','join','SET\x20CONTEXT\x20%s','setPriority','SET\x20PRIORITY\x20%s','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits'];(function(_0xe7c3f1,_0x12326f){var _0x1a0934=function(_0x2c3300){while(--_0x2c3300){_0xe7c3f1['push'](_0xe7c3f1['shift']());}};_0x1a0934(++_0x12326f);}(_0x242e,0x12f));var _0xe242=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x242e[_0x59ee6f];return _0x4c0979;};'use strict';var util=require(_0xe242('0x0'));var _=require('lodash');var EventEmitter=require(_0xe242('0x1'))[_0xe242('0x2')];var AGIReply=require('./reply');var AGIError=require('./error');function AGIChannel(_0xf85009){var _0x130843=this,_0x35be65=new AGIReply(),_0x1da0f6=![],_0xf3e4c9={};EventEmitter['call'](_0x130843);_0xf85009['setEncoding'](_0xe242('0x3'));_0xf85009[_0xe242('0x4')](0x8*0x3c*0x3c*0x3e8);_0x35be65['setEncoding'](_0xe242('0x3'));_0x35be65['on'](_0xe242('0x5'),function(_0x38cbbb){for(var _0x444dd9 in _0x38cbbb){_0x130843[_0x444dd9]=_0x38cbbb[_0x444dd9];}_0x130843[_0xe242('0x6')]('ready');});_0x35be65['on'](_0xe242('0x7'),function(_0x2814fa){if(_0x2814fa[_0xe242('0x8')]()==_0xe242('0x9')){_0x130843[_0xe242('0x6')](_0xe242('0x9'));return;}if(_0x2814fa[_0xe242('0xa')](0x0,0xb)==_0xe242('0xb')){_0x1da0f6=!![];}if(_0x1da0f6){_0xf3e4c9['rx']+=_0x2814fa+'\x0a';if(_0x2814fa['search'](_0xe242('0xc'))!=-0x1){_0x1da0f6=![];}}else{_0xf3e4c9['rx']=_0x2814fa;}if(_0x1da0f6){return;}if(typeof _0xf3e4c9['cb']==_0xe242('0xd')){var _0xc02082=_0xf3e4c9['rx']['substring'](0x0,0x3),_0x4056b3=null,_0x3212c3=null;_0xc02082=parseInt(_0xc02082);if(isNaN(_0xc02082)){_0xf3e4c9['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xe242('0xe')});return;}if(_0xc02082!=0xc8){_0xf3e4c9['cb'](null,{'code':_0xc02082,'result':-0x1,'extra':'KO'});return;}_0x4056b3=_0xf3e4c9['rx'][_0xe242('0xa')](0x4)[_0xe242('0xf')](_0xe242('0x10'),'');if(_0x4056b3['indexOf']('\x20')!=-0x1){_0x4056b3=_0x4056b3[_0xe242('0x11')](0x0,_0x4056b3[_0xe242('0x12')]('\x20'));}if(_[_0xe242('0x13')](_0x4056b3,'-1')){_0x4056b3=parseInt(_0x4056b3);}_0x3212c3=_0xf3e4c9['rx'][_0xe242('0x14')]('\x20');if(_0x3212c3['length']==0x3){_0x3212c3=_0x3212c3[0x2][_0xe242('0xa')](0x1,_0x3212c3[0x2][_0xe242('0x15')]-0x1);}else if(_0x3212c3[_0xe242('0x15')]>0x3){var _0x4f9304=/\((.+)\)/;var _0x2ad54a=_0xf3e4c9['rx'][_0xe242('0x16')](_0x4f9304);if(_0x2ad54a){_0x3212c3=_0x2ad54a[0x1];}else{_0x3212c3=null;}}else{_0x3212c3=null;}_0xf3e4c9['cb'](null,{'code':_0xc02082,'result':_0x4056b3,'extra':_0x3212c3});}});_0xf85009['on'](_0xe242('0x17'),function(_0x292bd3){_0x130843['emit']('error',new AGIError(_0xe242('0x18'),_0x292bd3[_0xe242('0x19')]));});_0xf85009['on']('close',function(){_0x130843[_0xe242('0x6')](_0xe242('0x1a'),new AGIError(_0xe242('0x1b')));});_0xf85009['on'](_0xe242('0x1c'),function(){_0x130843[_0xe242('0x6')](_0xe242('0x1c'),new AGIError(_0xe242('0x1d')));_0xf85009[_0xe242('0x1e')]();});_0xf85009['pipe'](_0x35be65);this['command']=function(_0x12a3cd,_0x578b3c){var _0x12a3cd=_0x12a3cd||'',_0x578b3c=typeof _0x578b3c==_0xe242('0xd')?_0x578b3c:new Function();_0xf3e4c9={'tx':_0x12a3cd,'rx':'','cb':_0x578b3c};_0xf85009['write'](_0x12a3cd+'\x0a');},this[_0xe242('0x1a')]=function(){_0xf85009[_0xe242('0x1e')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel['prototype'][_0xe242('0x1f')]=function(_0x2844e8){return this['command']['sync'](this,_0x2844e8);};AGIChannel[_0xe242('0x20')][_0xe242('0x21')]=function(){return this[_0xe242('0x1f')](_0xe242('0x22'));};AGIChannel['prototype']['getData']=function(_0x34d90c,_0xd84e0d,_0x59c1a3){_0x34d90c=_0x34d90c===undefined?_0xe242('0x23'):_0x34d90c;_0xd84e0d=_0xd84e0d===undefined?'5':_0xd84e0d;_0x59c1a3=_0x59c1a3===undefined?'1':_0x59c1a3;return this[_0xe242('0x1f')](util[_0xe242('0x24')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x34d90c,_0xd84e0d*0x3e8,_0x59c1a3));};AGIChannel['prototype']['noop']=function(_0x570627){_0x570627=_0x570627||_0xe242('0x25');return this[_0xe242('0x1f')](util[_0xe242('0x24')](_0xe242('0x26'),_0x570627));};AGIChannel['prototype'][_0xe242('0x27')]=function(_0x4a3793,_0x5824d6){if(_['isArray'](_0x5824d6)){return this[_0xe242('0x1f')](util['format'](_0xe242('0x28'),_0x4a3793,_0x5824d6[_0xe242('0x29')](',')));}return this[_0xe242('0x1f')](util[_0xe242('0x24')](_0xe242('0x28'),_0x4a3793,_0x5824d6));};AGIChannel[_0xe242('0x20')]['setContext']=function(_0x3a85ab){return this[_0xe242('0x1f')](util['format'](_0xe242('0x2a'),_0x3a85ab));};AGIChannel[_0xe242('0x20')]['setExtension']=function(_0x37b20d){return this[_0xe242('0x1f')](util['format']('SET\x20EXTENSION\x20%s',_0x37b20d));};AGIChannel[_0xe242('0x20')][_0xe242('0x2b')]=function(_0x5ef234){return this[_0xe242('0x1f')](util[_0xe242('0x24')](_0xe242('0x2c'),_0x5ef234));};AGIChannel[_0xe242('0x20')][_0xe242('0x9')]=function(){return this[_0xe242('0x1f')]('HANGUP');};AGIChannel[_0xe242('0x20')]['setVariable']=function(_0x25cb9f,_0x5b444d){var _0xbfbc0a=_[_0xe242('0x2d')](_0x5b444d)||_[_0xe242('0x2e')](_0x5b444d)?_0x5b444d[_0xe242('0x2f')]():_0x5b444d;return this['sendRequest'](util['format'](_0xe242('0x30'),_0x25cb9f,_0xbfbc0a?_0xbfbc0a[_0xe242('0x2f')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0xe242('0x31')]=function(_0xc7c475,_0x2428bf){return this[_0xe242('0x1f')](util[_0xe242('0x24')](_0xe242('0x32'),_0xc7c475,_0x2428bf));};AGIChannel['prototype'][_0xe242('0x33')]=function(_0x41c7df,_0x4ea7a0){return this['sendRequest'](util[_0xe242('0x24')](_0xe242('0x34'),_0x41c7df,_0x4ea7a0));};AGIChannel['prototype'][_0xe242('0x35')]=function(_0x56130e,_0xc27612){return this[_0xe242('0x1f')](util[_0xe242('0x24')](_0xe242('0x36'),_0x56130e,_0xc27612));};AGIChannel[_0xe242('0x20')][_0xe242('0x37')]=function(_0x1aad4e,_0x1a2660,_0x11f70f){_0x1a2660=_0x1a2660||this[_0xe242('0x38')];_0x11f70f=_0x11f70f||0x1;this[_0xe242('0x39')](_0x1aad4e);this[_0xe242('0x3a')](_0x1a2660);this[_0xe242('0x2b')](_0x11f70f);return this[_0xe242('0x3b')](util['format']('GOTO\x20%s\x20%s\x20%s',_0x1aad4e,_0x1a2660,_0x11f70f));};AGIChannel[_0xe242('0x20')]['getVariable']=function(_0x32debb){return this[_0xe242('0x1f')](util[_0xe242('0x24')](_0xe242('0x3c'),_0x32debb));};AGIChannel['prototype'][_0xe242('0x3d')]=function(_0x11fbb6,_0x3d5bb8,_0x6d7c3f,_0x1625c6,_0x405b4c,_0x3173ee){_0x3d5bb8=_0x3d5bb8||_0xe242('0x3e');_0x6d7c3f=_0x6d7c3f||'';_0x1625c6=_0x1625c6===undefined?-0x1:_0x1625c6==='-1'?-0x1:_0x1625c6*0x3e8;_0x405b4c=_0x405b4c===undefined?'':'s='+_0x405b4c;_0x3173ee=_0x3173ee?_0xe242('0x3f'):'';return this['sendRequest'](util['format'](_0xe242('0x40'),_0x11fbb6,_0x3d5bb8,_0x6d7c3f,_0x1625c6,_0x3173ee,_0x405b4c));};AGIChannel[_0xe242('0x20')][_0xe242('0x41')]=function(_0x4f54eb,_0x1e0207){_0x1e0207=_0x1e0207||'';return this['sendRequest'](util[_0xe242('0x24')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x4f54eb,_0x1e0207));};AGIChannel[_0xe242('0x20')][_0xe242('0x42')]=function(_0x4cc10f){return this[_0xe242('0x27')]('AGI',_0x4cc10f);};AGIChannel[_0xe242('0x20')][_0xe242('0x43')]=function(_0x3e5c41){return this[_0xe242('0x27')](_0xe242('0x44'),_0x3e5c41);};AGIChannel[_0xe242('0x20')][_0xe242('0x17')]=function(_0x201b70,_0x67fad1){this[_0xe242('0x3b')](util['format']('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x201b70['id'],_0x201b70[_0xe242('0x45')],_0x67fad1));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xe242('0x46')]=AGIChannel; \ No newline at end of file +var _0xf380=['streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','lodash','EventEmitter','./error','call','setEncoding','setTimeout','headers','emit','ready','line','toLowerCase','hangup','substring','520-Invalid','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','close','prototype','sendRequest','sync','answer','beep','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','format','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','SET\x20CONTEXT\x20%s','setExtension','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','extension','setContext','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP'];(function(_0x4045ff,_0x46cbcd){var _0x5797ac=function(_0x32003f){while(--_0x32003f){_0x4045ff['push'](_0x4045ff['shift']());}};_0x5797ac(++_0x46cbcd);}(_0xf380,0x1bf));var _0x0f38=function(_0x4143f1,_0x53b3){_0x4143f1=_0x4143f1-0x0;var _0x5e3b5b=_0xf380[_0x4143f1];return _0x5e3b5b;};'use strict';var util=require('util');var _=require(_0x0f38('0x0'));var EventEmitter=require('events')[_0x0f38('0x1')];var AGIReply=require('./reply');var AGIError=require(_0x0f38('0x2'));function AGIChannel(_0x39ec37){var _0x3ba9d3=this,_0x1110c6=new AGIReply(),_0x4352a6=![],_0x24e289={};EventEmitter[_0x0f38('0x3')](_0x3ba9d3);_0x39ec37[_0x0f38('0x4')]('utf8');_0x39ec37[_0x0f38('0x5')](0x8*0x3c*0x3c*0x3e8);_0x1110c6[_0x0f38('0x4')]('utf8');_0x1110c6['on'](_0x0f38('0x6'),function(_0x1194c1){for(var _0x43ff17 in _0x1194c1){_0x3ba9d3[_0x43ff17]=_0x1194c1[_0x43ff17];}_0x3ba9d3[_0x0f38('0x7')](_0x0f38('0x8'));});_0x1110c6['on'](_0x0f38('0x9'),function(_0x1da45b){if(_0x1da45b[_0x0f38('0xa')]()=='hangup'){_0x3ba9d3[_0x0f38('0x7')](_0x0f38('0xb'));return;}if(_0x1da45b[_0x0f38('0xc')](0x0,0xb)==_0x0f38('0xd')){_0x4352a6=!![];}if(_0x4352a6){_0x24e289['rx']+=_0x1da45b+'\x0a';if(_0x1da45b['search'](_0x0f38('0xe'))!=-0x1){_0x4352a6=![];}}else{_0x24e289['rx']=_0x1da45b;}if(_0x4352a6){return;}if(typeof _0x24e289['cb']==_0x0f38('0xf')){var _0x48ec3d=_0x24e289['rx'][_0x0f38('0xc')](0x0,0x3),_0x35fcf3=null,_0x40141e=null;_0x48ec3d=parseInt(_0x48ec3d);if(isNaN(_0x48ec3d)){_0x24e289['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x0f38('0x10')});return;}if(_0x48ec3d!=0xc8){_0x24e289['cb'](null,{'code':_0x48ec3d,'result':-0x1,'extra':'KO'});return;}_0x35fcf3=_0x24e289['rx'][_0x0f38('0xc')](0x4)[_0x0f38('0x11')](_0x0f38('0x12'),'');if(_0x35fcf3[_0x0f38('0x13')]('\x20')!=-0x1){_0x35fcf3=_0x35fcf3[_0x0f38('0x14')](0x0,_0x35fcf3[_0x0f38('0x13')]('\x20'));}if(_[_0x0f38('0x15')](_0x35fcf3,'-1')){_0x35fcf3=parseInt(_0x35fcf3);}_0x40141e=_0x24e289['rx'][_0x0f38('0x16')]('\x20');if(_0x40141e['length']==0x3){_0x40141e=_0x40141e[0x2][_0x0f38('0xc')](0x1,_0x40141e[0x2][_0x0f38('0x17')]-0x1);}else if(_0x40141e[_0x0f38('0x17')]>0x3){var _0x3124ca=/\((.+)\)/;var _0x4a3110=_0x24e289['rx'][_0x0f38('0x18')](_0x3124ca);if(_0x4a3110){_0x40141e=_0x4a3110[0x1];}else{_0x40141e=null;}}else{_0x40141e=null;}_0x24e289['cb'](null,{'code':_0x48ec3d,'result':_0x35fcf3,'extra':_0x40141e});}});_0x39ec37['on'](_0x0f38('0x19'),function(_0x23159d){_0x3ba9d3[_0x0f38('0x7')]('error',new AGIError(_0x0f38('0x1a'),_0x23159d[_0x0f38('0x1b')]));});_0x39ec37['on']('close',function(){_0x3ba9d3[_0x0f38('0x7')]('close',new AGIError('E_AGI_SOCKET_CLOSE'));});_0x39ec37['on']('timeout',function(){_0x3ba9d3[_0x0f38('0x7')](_0x0f38('0x1c'),new AGIError(_0x0f38('0x1d')));_0x39ec37[_0x0f38('0x1e')]();});_0x39ec37[_0x0f38('0x1f')](_0x1110c6);this['command']=function(_0x2a70df,_0x3493d3){var _0x2a70df=_0x2a70df||'',_0x3493d3=typeof _0x3493d3==_0x0f38('0xf')?_0x3493d3:new Function();_0x24e289={'tx':_0x2a70df,'rx':'','cb':_0x3493d3};_0x39ec37['write'](_0x2a70df+'\x0a');},this[_0x0f38('0x20')]=function(){_0x39ec37['destroy']();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0x0f38('0x21')][_0x0f38('0x22')]=function(_0x59e25b){return this['command'][_0x0f38('0x23')](this,_0x59e25b);};AGIChannel[_0x0f38('0x21')][_0x0f38('0x24')]=function(){return this['sendRequest']('ANSWER');};AGIChannel[_0x0f38('0x21')]['getData']=function(_0x38851e,_0x44de3d,_0x88213f){_0x38851e=_0x38851e===undefined?_0x0f38('0x25'):_0x38851e;_0x44de3d=_0x44de3d===undefined?'5':_0x44de3d;_0x88213f=_0x88213f===undefined?'1':_0x88213f;return this['sendRequest'](util['format'](_0x0f38('0x26'),_0x38851e,_0x44de3d*0x3e8,_0x88213f));};AGIChannel[_0x0f38('0x21')][_0x0f38('0x27')]=function(_0x361f1d){_0x361f1d=_0x361f1d||_0x0f38('0x28');return this[_0x0f38('0x22')](util[_0x0f38('0x29')](_0x0f38('0x2a'),_0x361f1d));};AGIChannel['prototype'][_0x0f38('0x2b')]=function(_0x5092c8,_0x50a42a){if(_[_0x0f38('0x2c')](_0x50a42a)){return this['sendRequest'](util[_0x0f38('0x29')](_0x0f38('0x2d'),_0x5092c8,_0x50a42a[_0x0f38('0x2e')](',')));}return this[_0x0f38('0x22')](util[_0x0f38('0x29')](_0x0f38('0x2d'),_0x5092c8,_0x50a42a));};AGIChannel['prototype']['setContext']=function(_0x1a152c){return this[_0x0f38('0x22')](util[_0x0f38('0x29')](_0x0f38('0x2f'),_0x1a152c));};AGIChannel[_0x0f38('0x21')][_0x0f38('0x30')]=function(_0x58576e){return this[_0x0f38('0x22')](util['format']('SET\x20EXTENSION\x20%s',_0x58576e));};AGIChannel['prototype']['setPriority']=function(_0x21fa0d){return this['sendRequest'](util[_0x0f38('0x29')]('SET\x20PRIORITY\x20%s',_0x21fa0d));};AGIChannel[_0x0f38('0x21')][_0x0f38('0xb')]=function(){return this[_0x0f38('0x22')]('HANGUP');};AGIChannel[_0x0f38('0x21')][_0x0f38('0x31')]=function(_0x104e8e,_0x384948){var _0x5626e0=_[_0x0f38('0x32')](_0x384948)||_[_0x0f38('0x33')](_0x384948)?_0x384948[_0x0f38('0x34')]():_0x384948;return this['sendRequest'](util[_0x0f38('0x29')](_0x0f38('0x35'),_0x104e8e,_0x5626e0?_0x5626e0[_0x0f38('0x34')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype']['sayNumber']=function(_0x387bac,_0x41e44b){return this[_0x0f38('0x22')](util[_0x0f38('0x29')]('SAY\x20NUMBER\x20%s\x20%s',_0x387bac,_0x41e44b));};AGIChannel[_0x0f38('0x21')][_0x0f38('0x36')]=function(_0x1695a4,_0x22166e){return this[_0x0f38('0x22')](util[_0x0f38('0x29')](_0x0f38('0x37'),_0x1695a4,_0x22166e));};AGIChannel[_0x0f38('0x21')][_0x0f38('0x38')]=function(_0x226d1f,_0x560c0a){return this[_0x0f38('0x22')](util[_0x0f38('0x29')](_0x0f38('0x39'),_0x226d1f,_0x560c0a));};AGIChannel[_0x0f38('0x21')]['continueAt']=function(_0x20be68,_0x52a5c2,_0x59a95c){_0x52a5c2=_0x52a5c2||this[_0x0f38('0x3a')];_0x59a95c=_0x59a95c||0x1;this[_0x0f38('0x3b')](_0x20be68);this[_0x0f38('0x30')](_0x52a5c2);this['setPriority'](_0x59a95c);return this[_0x0f38('0x27')](util[_0x0f38('0x29')]('GOTO\x20%s\x20%s\x20%s',_0x20be68,_0x52a5c2,_0x59a95c));};AGIChannel[_0x0f38('0x21')]['getVariable']=function(_0x1784d7){return this[_0x0f38('0x22')](util['format'](_0x0f38('0x3c'),_0x1784d7));};AGIChannel[_0x0f38('0x21')][_0x0f38('0x3d')]=function(_0xb2fa42,_0x263890,_0x4942ae,_0x20a7a3,_0x5ada5f,_0x53440d){_0x263890=_0x263890||_0x0f38('0x3e');_0x4942ae=_0x4942ae||'';_0x20a7a3=_0x20a7a3===undefined?-0x1:_0x20a7a3==='-1'?-0x1:_0x20a7a3*0x3e8;_0x5ada5f=_0x5ada5f===undefined?'':'s='+_0x5ada5f;_0x53440d=_0x53440d?_0x0f38('0x3f'):'';return this[_0x0f38('0x22')](util[_0x0f38('0x29')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0xb2fa42,_0x263890,_0x4942ae,_0x20a7a3,_0x53440d,_0x5ada5f));};AGIChannel[_0x0f38('0x21')][_0x0f38('0x40')]=function(_0xfbae85,_0xc3fb57){_0xc3fb57=_0xc3fb57||'';return this[_0x0f38('0x22')](util[_0x0f38('0x29')](_0x0f38('0x41'),_0xfbae85,_0xc3fb57));};AGIChannel['prototype'][_0x0f38('0x42')]=function(_0x140a12){return this[_0x0f38('0x2b')](_0x0f38('0x43'),_0x140a12);};AGIChannel[_0x0f38('0x21')][_0x0f38('0x44')]=function(_0x1f119b){return this[_0x0f38('0x2b')](_0x0f38('0x45'),_0x1f119b);};AGIChannel[_0x0f38('0x21')][_0x0f38('0x19')]=function(_0x38f4bc,_0x54a376){this[_0x0f38('0x27')](util[_0x0f38('0x29')](_0x0f38('0x46'),_0x38f4bc['id'],_0x38f4bc[_0x0f38('0x47')],_0x54a376));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x0f38('0x48')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index e1d0601..eca72c1 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 _0xc9bc=['Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','message','name','util','Undefined\x20error.','Server\x20error.\x20Code:\x20%s.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.'];(function(_0x5c7a85,_0x41dd19){var _0x35290f=function(_0x26215b){while(--_0x26215b){_0x5c7a85['push'](_0x5c7a85['shift']());}};_0x35290f(++_0x41dd19);}(_0xc9bc,0x1ae));var _0xcc9b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc9bc[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xcc9b('0x0'));var error={'E_AGI_UNDEFINED':_0xcc9b('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0xcc9b('0x2'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0xcc9b('0x3'),'E_AGI_SOCKET_CLOSE':_0xcc9b('0x4'),'E_AGI_SOCKET_TIMEOUT':_0xcc9b('0x5'),'E_AGI_COMMAND_EMPTY':_0xcc9b('0x6'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xcc9b('0x7'),'E_AGI_IVR_ENTRY':_0xcc9b('0x8')};function AGIError(_0x2c164f){var _0x2c164f=_0x2c164f||null,_0x42df47=_0x42df47||[],_0x1e837b=0x1,_0x296ab5='';if(!error[_0x2c164f]){_0x2c164f=_0xcc9b('0x9');}_0x42df47[_0xcc9b('0xa')](error[_0x2c164f]);while(arguments[_0x1e837b]){_0x42df47[_0xcc9b('0xa')](arguments[_0x1e837b]);_0x1e837b++;}_0x296ab5=util[_0xcc9b('0xb')][_0xcc9b('0xc')](util,_0x42df47);this[_0xcc9b('0xd')]=_0x296ab5;this[_0xcc9b('0xe')]=_0x2c164f;}module['exports']=AGIError; \ No newline at end of file +var _0xfbdf=['Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','push','format','message','name','util','Server\x20error.\x20Code:\x20%s.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xfbdf,0xd9));var _0xffbd=function(_0x4738b7,_0x9096f0){_0x4738b7=_0x4738b7-0x0;var _0x47cb9e=_0xfbdf[_0x4738b7];return _0x47cb9e;};'use strict';var util=require(_0xffbd('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0xffbd('0x1'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0xffbd('0x2'),'E_AGI_SERVER_VOICE_DISABLED':_0xffbd('0x3'),'E_AGI_SOCKET_ERROR':_0xffbd('0x4'),'E_AGI_SOCKET_CLOSE':_0xffbd('0x5'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0xffbd('0x6'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xffbd('0x7'),'E_AGI_IVR_ENTRY':_0xffbd('0x8')};function AGIError(_0x19934a){var _0x19934a=_0x19934a||null,_0x3df9a7=_0x3df9a7||[],_0x42a703=0x1,_0x1b01ca='';if(!error[_0x19934a]){_0x19934a='E_AGI_UNDEFINED';}_0x3df9a7[_0xffbd('0x9')](error[_0x19934a]);while(arguments[_0x42a703]){_0x3df9a7[_0xffbd('0x9')](arguments[_0x42a703]);_0x42a703++;}_0x1b01ca=util[_0xffbd('0xa')]['apply'](util,_0x3df9a7);this[_0xffbd('0xb')]=_0x1b01ca;this[_0xffbd('0xc')]=_0x19934a;}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 8168f16..db4b247 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 _0x8516=['target','default','invalid','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','agi','menu','getdigits','getsecretdigits','vertices','edges','numberOfEdges','prototype','push','size','getVertex','traverseBFS','info','no\x20vertex\x20found','stop\x20traverse','no\x20edge/s\x20available','condition','length','agicommand','vswitch'];(function(_0x494572,_0xaa722e){var _0x59d150=function(_0x30a2f8){while(--_0x30a2f8){_0x494572['push'](_0x494572['shift']());}};_0x59d150(++_0xaa722e);}(_0x8516,0x18e));var _0x6851=function(_0x47f5a0,_0x4a2fa3){_0x47f5a0=_0x47f5a0-0x0;var _0x58705c=_0x8516[_0x47f5a0];return _0x58705c;};'use strict';var _=require(_0x6851('0x0'));var logger=require(_0x6851('0x1'))(_0x6851('0x2'));var verticesWithRetry=[_0x6851('0x3'),_0x6851('0x4'),_0x6851('0x5')];var Graph=function(){this[_0x6851('0x6')]={};this[_0x6851('0x7')]={};this[_0x6851('0x8')]=0x0;};Graph[_0x6851('0x9')]['addVertex']=function(_0x550490){this[_0x6851('0x6')][_0x550490['id']]=_0x550490;this['edges'][_0x550490['id']]=[];};Graph[_0x6851('0x9')]['addEdge']=function(_0x5e8279,_0x1f961c,_0x532bc6){this[_0x6851('0x7')][_0x5e8279][_0x6851('0xa')]({'target':_0x1f961c,'condition':_0x532bc6});this[_0x6851('0x8')]+=0x1;};Graph[_0x6851('0x9')]['size']=function(){return _[_0x6851('0xb')](this[_0x6851('0x6')]);};Graph[_0x6851('0x9')]['relations']=function(){return this[_0x6851('0x8')];};Graph[_0x6851('0x9')][_0x6851('0xc')]=function(_0x3aeac8){return this['vertices'][_0x3aeac8];};Graph[_0x6851('0x9')][_0x6851('0xd')]=function(_0x13c1f5,_0x4e6108){if(!this[_0x6851('0x6')][_0x13c1f5]){return logger[_0x6851('0xe')](_0x6851('0xf'));}var _0x34ef92=_0x4e6108(this[_0x6851('0x6')][_0x13c1f5]);if(!_0x34ef92){return logger[_0x6851('0xe')](_0x6851('0x10'));}if(this[_0x6851('0x7')][_0x13c1f5]['length']===0x0){return logger['info'](_0x6851('0x11'));}for(var _0x3b249d=0x0,_0x56f1d8=[],_0x3b023f=![];_0x3b249d\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','mxGraphModel','root','hasOwnProperty','retry','omit','mxCell','length','source','target','addEdge','value','getSquareProject','then','catch','createSquareReport','indexOf','agi_','substring','inspect','debug','variables','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','timeout','hangup','production','start','stringify','joinAt','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','vertex','gotoc','context','priority','agicommand','response','result','isUndefined','toString','agicommand\x20not\x20found','finally','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','extension','continueAt','close','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','xml2json','syncho','util','moment','../../config/environment','agi','../../config/license/util','./mailRpc','defaults','127.0.0.1','nextTick','error','stack','info','port','name','message','format','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname'];(function(_0x19c9bc,_0x1f2b1c){var _0x5dc3db=function(_0x48b8b3){while(--_0x48b8b3){_0x19c9bc['push'](_0x19c9bc['shift']());}};_0x5dc3db(++_0x1f2b1c);}(_0x3911,0x95));var _0x1391=function(_0x26f866,_0x1900bc){_0x26f866=_0x26f866-0x0;var _0x1abef3=_0x3911[_0x26f866];return _0x1abef3;};'use strict';var parser=require(_0x1391('0x0'));var _=require('lodash');var syncho=require(_0x1391('0x1'));var util=require(_0x1391('0x2'));var moment=require(_0x1391('0x3'));var config=require(_0x1391('0x4'));var logger=require('../../config/logger')(_0x1391('0x5'));var utilLicense=require(_0x1391('0x6'));var rpc=require('./rpc');var mailRpc=require(_0x1391('0x7'));var Graph=require('./graph');var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x1391('0x5')]=_[_0x1391('0x8')](config[_0x1391('0x5')],{'ip':_0x1391('0x9'),'port':0x11dd});function connectionHandler(_0x48fa89){process[_0x1391('0xa')](function(){syncho(function(){try{setChannelVariables(_0x48fa89);agiHandler(_0x48fa89);}catch(_0x56039b){logger[_0x1391('0xb')](_0x56039b[_0x1391('0xc')]);}});});}function listeningHandler(){console['log']('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config['agi']['port']);logger[_0x1391('0xd')](util['format']('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0x1391('0x5')]['ip'],config['agi'][_0x1391('0xe')]));}function errorHandler(_0x1fc22d){if(_0x1fc22d&&_0x1fc22d[_0x1391('0xf')]&&_0x1fc22d[_0x1391('0x10')]){logger[_0x1391('0xb')](util['format']('[%s]\x20%s',_0x1fc22d[_0x1391('0xf')],_0x1fc22d[_0x1391('0x10')]));}else{logger[_0x1391('0xb')](util[_0x1391('0x11')](_0x1391('0x12'),_0x1fc22d['stack']));}}function closeHandler(){logger['info'](util[_0x1391('0x11')](_0x1391('0x13'),this['arg_1'],this[_0x1391('0x14')],this[_0x1391('0x15')],this[_0x1391('0x16')],this['uniqueid']));try{createSquareReport(this);}catch(_0x5b8f89){logger[_0x1391('0xb')](_0x5b8f89['stack']);}}function timeoutHandler(){logger[_0x1391('0xd')](util[_0x1391('0x11')](_0x1391('0x17'),this[_0x1391('0x18')],this[_0x1391('0x14')],this[_0x1391('0x15')],this['dnid'],this[_0x1391('0x19')]));}function hangupHandler(){logger[_0x1391('0xd')](util[_0x1391('0x11')](_0x1391('0x1a'),this['arg_1'],this[_0x1391('0x14')],this['callerid'],this['dnid'],this['uniqueid']));this[_0x1391('0x1b')]=!![];}function getRoot(_0x40591d){return parser[_0x1391('0x1c')](_0x40591d,{'object':!![]})[_0x1391('0x1d')][_0x1391('0x1e')];}function addVertex(_0x70d0ad,_0x349333,_0x356ef4){_0x349333['agicommand']=_0x356ef4;if(_0x349333[_0x1391('0x1f')](_0x1391('0x20'))){_0x349333['maxRetry']=parseInt(_0x349333[_0x1391('0x20')],0xa);}_0x70d0ad['addVertex'](_[_0x1391('0x21')](_0x349333,_0x1391('0x22')));}function initGraph(_0x5b7d1d,_0x1720bd){var _0x22ab06=new Graph();for(var _0x3fbd2f in _0x5b7d1d){if(_0x5b7d1d[_0x1391('0x1f')](_0x3fbd2f)){if(_['isArray'](_0x5b7d1d[_0x3fbd2f])){for(var _0x35db80=0x0;_0x35db80<_0x5b7d1d[_0x3fbd2f]['length'];_0x35db80+=0x1){addVertex(_0x22ab06,_0x5b7d1d[_0x3fbd2f][_0x35db80],_0x3fbd2f);}}else{addVertex(_0x22ab06,_0x5b7d1d[_0x3fbd2f],_0x3fbd2f);}}}for(var _0x49409=0x0;_0x49409<_0x1720bd[_0x1391('0x23')];_0x49409+=0x1){if(_0x1720bd[_0x49409][_0x1391('0x24')]&&_0x1720bd[_0x49409][_0x1391('0x25')]){_0x22ab06[_0x1391('0x26')](_0x1720bd[_0x49409][_0x1391('0x24')],_0x1720bd[_0x49409][_0x1391('0x25')],_0x1720bd[_0x49409][_0x1391('0x27')]);}}return _0x22ab06;}function getSquareProject(_0x54c101,_0x1c87d9){rpc[_0x1391('0x28')](_0x54c101)[_0x1391('0x29')](function(_0x144063){_0x1c87d9(null,_0x144063);})[_0x1391('0x2a')](function(_0x3193b2){_0x1c87d9(null,_0x3193b2);});}function createSquareReport(_0x72739d,_0x47111a){rpc[_0x1391('0x2b')](_0x72739d)[_0x1391('0x29')](function(_0x495120){if(_0x47111a){_0x47111a(null,_0x495120);}})[_0x1391('0x2a')](function(_0x1147e9){if(_0x47111a){_0x47111a(null,_0x1147e9);}});}function setChannelVariables(_0x31f965){for(var _0x17427b in _0x31f965){if(_0x31f965[_0x1391('0x1f')](_0x17427b)){if(_0x17427b[_0x1391('0x2c')](_0x1391('0x2d'))===0x0){_0x31f965[_0x17427b[_0x1391('0x2e')](0x4)]=_0x31f965[_0x17427b];delete _0x31f965[_0x17427b];}}}}function getLogFromObject(_0x313cb0){return util[_0x1391('0x2f')](_0x313cb0,{'showHidden':![],'depth':null});}function agiHandler(_0x397d62){var _0x2b2114,_0x48691c,_0x205de2,_0x1ac4cf,_0x58da69;logger[_0x1391('0x30')](_0x1391('0x31'),JSON['stringify'](_0x397d62,null,0x2));logger[_0x1391('0xd')](util[_0x1391('0x11')](_0x1391('0x32'),_0x397d62[_0x1391('0x18')],_0x397d62[_0x1391('0x14')],_0x397d62[_0x1391('0x15')],_0x397d62[_0x1391('0x16')],_0x397d62[_0x1391('0x19')]));_0x397d62['on'](_0x1391('0xb'),errorHandler);_0x397d62['on']('close',closeHandler);_0x397d62['on'](_0x1391('0x33'),timeoutHandler);_0x397d62[_0x1391('0x1b')]=![];_0x397d62['on'](_0x1391('0x34'),hangupHandler);var _0x3ddb37=getSquareProject['sync'](null,_0x397d62[_0x1391('0x18')]);if(_0x3ddb37){if(_0x3ddb37[_0x1391('0x35')]){_0x2b2114=getRoot(_0x3ddb37[_0x1391('0x35')]);if(_0x2b2114&&_0x2b2114[_0x1391('0x36')]){logger[_0x1391('0x30')](_0x1391('0x1e'),JSON[_0x1391('0x37')](_0x2b2114,null,0x2));_0x397d62[_0x1391('0x38')]=moment()[_0x1391('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x48691c=initGraph(_[_0x1391('0x21')](_0x2b2114,_0x1391('0x22')),_0x2b2114[_0x1391('0x22')]);_0x205de2=new Vertices(_0x397d62,rpc,mailRpc);logger['info'](util['format'](_0x1391('0x39'),_0x397d62[_0x1391('0x18')],_0x397d62[_0x1391('0x14')],_0x397d62[_0x1391('0x15')],_0x397d62[_0x1391('0x16')],_0x397d62[_0x1391('0x19')]));_0x48691c[_0x1391('0x3a')](_0x2b2114['start']['id'],function(_0x5c0d08){try{_0x5c0d08=_0x205de2[_0x1391('0x3b')](_0x5c0d08);logger['debug'](_0x1391('0x3c'),JSON[_0x1391('0x37')](_0x5c0d08,null,0x2));if(_0x5c0d08['agicommand']===_0x1391('0x3d')){logger[_0x1391('0xd')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x397d62['context']=_0x5c0d08['context']||_0x397d62[_0x1391('0x3e')];_0x397d62['extension']=_0x5c0d08['extension'];_0x397d62[_0x1391('0x3f')]=_0x5c0d08['priority']?_0x5c0d08[_0x1391('0x3f')]-0x1:0x1;return null;}else if(_0x5c0d08&&_0x205de2[_0x5c0d08[_0x1391('0x40')]]){_0x58da69=_0x205de2[_0x5c0d08[_0x1391('0x40')]](_0x5c0d08);logger[_0x1391('0xd')](_0x1391('0x41'),JSON[_0x1391('0x37')](_0x58da69,null,0x2));if(_0x58da69&&_0x58da69['code']===AGI_CODE_SUCCESS&&_0x58da69[_0x1391('0x42')]!==AGI_RESULT_ERROR&&!_0x397d62['evtHangup']){logger[_0x1391('0x30')](_0x1391('0x41'),getLogFromObject(_0x58da69));return _[_0x1391('0x43')](_0x58da69['result'])?null:_0x58da69[_0x1391('0x42')][_0x1391('0x44')]();}else{logger[_0x1391('0xb')](_0x1391('0x41'),getLogFromObject(_0x58da69));return null;}}else{logger[_0x1391('0xb')](_0x1391('0x45'));return null;}}catch(_0x13cac3){logger[_0x1391('0xb')](_0x13cac3[_0x1391('0xc')]);return null;}});if(_0x2b2114[_0x1391('0x46')]){logger[_0x1391('0xd')](util[_0x1391('0x11')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x397d62[_0x1391('0x18')],_0x397d62[_0x1391('0x14')],_0x397d62[_0x1391('0x15')],_0x397d62['dnid'],_0x397d62['uniqueid']));_0x48691c[_0x1391('0x3a')](_0x2b2114['finally']['id'],function(_0x45db4c){try{_0x45db4c=_0x205de2[_0x1391('0x3b')](_0x45db4c);logger[_0x1391('0x30')](_0x1391('0x3c'),JSON[_0x1391('0x37')](_0x45db4c,null,0x2));if(_0x45db4c&&_0x205de2[_0x45db4c[_0x1391('0x40')]]){_0x58da69=_0x205de2[_0x45db4c[_0x1391('0x40')]](_0x45db4c);if(_0x58da69){logger[_0x1391('0x30')](_0x1391('0x41'),getLogFromObject(_0x58da69));return _[_0x1391('0x43')](_0x58da69['result'])?null:_0x58da69[_0x1391('0x42')][_0x1391('0x44')]();}else{logger[_0x1391('0xb')](_0x1391('0x41'),getLogFromObject(_0x58da69));return null;}}else{logger[_0x1391('0xb')](_0x1391('0x45'));return null;}}catch(_0xb1e773){logger['error'](_0xb1e773[_0x1391('0xc')]);return null;}});}logger[_0x1391('0xd')](util[_0x1391('0x11')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x397d62[_0x1391('0x18')],_0x397d62[_0x1391('0x14')],_0x397d62[_0x1391('0x15')],_0x397d62['dnid'],_0x397d62[_0x1391('0x19')]));logger['info'](util[_0x1391('0x11')](_0x1391('0x47'),_0x397d62[_0x1391('0x3e')],_0x397d62[_0x1391('0x48')],parseInt(_0x397d62[_0x1391('0x3f')],0xa)+0x1));_0x397d62[_0x1391('0x49')](_0x397d62['context'],_0x397d62['extension'],parseInt(_0x397d62[_0x1391('0x3f')],0xa)+0x1);_0x397d62[_0x1391('0x4a')]();}}else{logger[_0x1391('0xb')](util[_0x1391('0x11')](_0x1391('0x4b'),_0x397d62[_0x1391('0x18')]));_0x397d62['continueAt'](_0x397d62[_0x1391('0x3e')],_0x397d62[_0x1391('0x48')],parseInt(_0x397d62['priority'],0xa)+0x1);_0x397d62[_0x1391('0x4a')]();}}else{logger[_0x1391('0xb')](util['format'](_0x1391('0x4c'),_0x397d62[_0x1391('0x18')]));_0x397d62[_0x1391('0x49')](_0x397d62[_0x1391('0x3e')],_0x397d62['extension'],parseInt(_0x397d62['priority'],0xa)+0x1);_0x397d62[_0x1391('0x4a')]();}}function main(){var _0xad8e4d;return utilLicense[_0x1391('0x4d')]()['then'](function(_0x2021d0){if(_0x2021d0){if(_0x2021d0[_0x1391('0x4e')]){if(_0x2021d0[_0x1391('0x4f')]&&_0x2021d0[_0x1391('0x4f')]>0x0){logger[_0x1391('0xd')](util['format'](_0x1391('0x50'),_0x2021d0[_0x1391('0x4f')]));_0xad8e4d=_0x2021d0[_0x1391('0x4f')];}else{logger[_0x1391('0xd')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger['info'](_0x1391('0x51'));_0xad8e4d=-0x1;}}})[_0x1391('0x2a')](function(_0x114cae){logger[_0x1391('0xb')](_0x1391('0x52'),_0x114cae[_0x1391('0xc')]);})[_0x1391('0x46')](function(){var _0x3dc7b9=require(_0x1391('0x53'))(config[_0x1391('0x5')][_0x1391('0xe')],config[_0x1391('0x5')]['ip'],_0xad8e4d);_0x3dc7b9['on'](_0x1391('0xb'),errorHandler);_0x3dc7b9['on'](_0x1391('0x54'),listeningHandler);_0x3dc7b9['on']('connection',connectionHandler);_0x3dc7b9['on'](_0x1391('0x4a'),closeHandler);});}main(); \ No newline at end of file +var _0x61f1=['gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','isUndefined','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','Project\x20%s\x20not\x20published','continueAt','Project\x20%s\x20not\x20found','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','port','listening','connection','xml2json','lodash','util','moment','../../config/environment','../../config/logger','agi','../../config/license/util','./graph','./vertices','defaults','127.0.0.1','nextTick','error','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','[%s]\x20%s','name','message','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','toJson','mxGraphModel','root','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','length','source','target','value','getSquareProject','then','catch','createSquareReport','agi_','debug','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','evtHangup','sync','production','start','stringify','joinAt','YYYY-MM-DD\x20HH:mm:ss','mxCell','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','vertex'];(function(_0x2c602e,_0x1d26f5){var _0x1a2650=function(_0x2370d1){while(--_0x2370d1){_0x2c602e['push'](_0x2c602e['shift']());}};_0x1a2650(++_0x1d26f5);}(_0x61f1,0x74));var _0x161f=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x61f1[_0xa464c9];return _0x3d73c4;};'use strict';var parser=require(_0x161f('0x0'));var _=require(_0x161f('0x1'));var syncho=require('syncho');var util=require(_0x161f('0x2'));var moment=require(_0x161f('0x3'));var config=require(_0x161f('0x4'));var logger=require(_0x161f('0x5'))(_0x161f('0x6'));var utilLicense=require(_0x161f('0x7'));var rpc=require('./rpc');var mailRpc=require('./mailRpc');var Graph=require(_0x161f('0x8'));var Vertices=require(_0x161f('0x9'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x161f('0x6')]=_[_0x161f('0xa')](config[_0x161f('0x6')],{'ip':_0x161f('0xb'),'port':0x11dd});function connectionHandler(_0x418630){process[_0x161f('0xc')](function(){syncho(function(){try{setChannelVariables(_0x418630);agiHandler(_0x418630);}catch(_0x14b7c4){logger[_0x161f('0xd')](_0x14b7c4[_0x161f('0xe')]);}});});}function listeningHandler(){console[_0x161f('0xf')](_0x161f('0x10'),config[_0x161f('0x6')]['port']);logger[_0x161f('0x11')](util[_0x161f('0x12')](_0x161f('0x13'),config['agi']['ip'],config['agi']['port']));}function errorHandler(_0x137449){if(_0x137449&&_0x137449['name']&&_0x137449['message']){logger[_0x161f('0xd')](util[_0x161f('0x12')](_0x161f('0x14'),_0x137449[_0x161f('0x15')],_0x137449[_0x161f('0x16')]));}else{logger[_0x161f('0xd')](util[_0x161f('0x12')]('[ERROR]\x20%s',_0x137449['stack']));}}function closeHandler(){logger['info'](util[_0x161f('0x12')](_0x161f('0x17'),this[_0x161f('0x18')],this[_0x161f('0x19')],this[_0x161f('0x1a')],this[_0x161f('0x1b')],this[_0x161f('0x1c')]));try{createSquareReport(this);}catch(_0x432de0){logger['error'](_0x432de0[_0x161f('0xe')]);}}function timeoutHandler(){logger[_0x161f('0x11')](util[_0x161f('0x12')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x161f('0x18')],this[_0x161f('0x19')],this['callerid'],this['dnid'],this[_0x161f('0x1c')]));}function hangupHandler(){logger[_0x161f('0x11')](util['format'](_0x161f('0x1d'),this['arg_1'],this[_0x161f('0x19')],this[_0x161f('0x1a')],this[_0x161f('0x1b')],this['uniqueid']));this['evtHangup']=!![];}function getRoot(_0x296fb5){return parser[_0x161f('0x1e')](_0x296fb5,{'object':!![]})[_0x161f('0x1f')][_0x161f('0x20')];}function addVertex(_0x1f64b6,_0x42f964,_0x412f83){_0x42f964[_0x161f('0x21')]=_0x412f83;if(_0x42f964[_0x161f('0x22')](_0x161f('0x23'))){_0x42f964[_0x161f('0x24')]=parseInt(_0x42f964['retry'],0xa);}_0x1f64b6[_0x161f('0x25')](_[_0x161f('0x26')](_0x42f964,'mxCell'));}function initGraph(_0x8ce645,_0x52c277){var _0x529e4e=new Graph();for(var _0x5de994 in _0x8ce645){if(_0x8ce645[_0x161f('0x22')](_0x5de994)){if(_['isArray'](_0x8ce645[_0x5de994])){for(var _0x4f65d4=0x0;_0x4f65d4<_0x8ce645[_0x5de994][_0x161f('0x27')];_0x4f65d4+=0x1){addVertex(_0x529e4e,_0x8ce645[_0x5de994][_0x4f65d4],_0x5de994);}}else{addVertex(_0x529e4e,_0x8ce645[_0x5de994],_0x5de994);}}}for(var _0x3eac4e=0x0;_0x3eac4e<_0x52c277[_0x161f('0x27')];_0x3eac4e+=0x1){if(_0x52c277[_0x3eac4e][_0x161f('0x28')]&&_0x52c277[_0x3eac4e]['target']){_0x529e4e['addEdge'](_0x52c277[_0x3eac4e][_0x161f('0x28')],_0x52c277[_0x3eac4e][_0x161f('0x29')],_0x52c277[_0x3eac4e][_0x161f('0x2a')]);}}return _0x529e4e;}function getSquareProject(_0x2fcdf6,_0x898fc6){rpc[_0x161f('0x2b')](_0x2fcdf6)[_0x161f('0x2c')](function(_0x4f4346){_0x898fc6(null,_0x4f4346);})[_0x161f('0x2d')](function(_0x2ea68c){_0x898fc6(null,_0x2ea68c);});}function createSquareReport(_0x2c0dea,_0xec622f){rpc[_0x161f('0x2e')](_0x2c0dea)[_0x161f('0x2c')](function(_0x468219){if(_0xec622f){_0xec622f(null,_0x468219);}})[_0x161f('0x2d')](function(_0x2092cd){if(_0xec622f){_0xec622f(null,_0x2092cd);}});}function setChannelVariables(_0x12fe12){for(var _0x153d14 in _0x12fe12){if(_0x12fe12[_0x161f('0x22')](_0x153d14)){if(_0x153d14['indexOf'](_0x161f('0x2f'))===0x0){_0x12fe12[_0x153d14['substring'](0x4)]=_0x12fe12[_0x153d14];delete _0x12fe12[_0x153d14];}}}}function getLogFromObject(_0xd75289){return util['inspect'](_0xd75289,{'showHidden':![],'depth':null});}function agiHandler(_0x508fe0){var _0x10740e,_0x11ab5b,_0x5d2b27,_0x128c46,_0x4a8a49;logger[_0x161f('0x30')]('variables',JSON['stringify'](_0x508fe0,null,0x2));logger[_0x161f('0x11')](util[_0x161f('0x12')](_0x161f('0x31'),_0x508fe0[_0x161f('0x18')],_0x508fe0[_0x161f('0x19')],_0x508fe0[_0x161f('0x1a')],_0x508fe0[_0x161f('0x1b')],_0x508fe0[_0x161f('0x1c')]));_0x508fe0['on']('error',errorHandler);_0x508fe0['on'](_0x161f('0x32'),closeHandler);_0x508fe0['on'](_0x161f('0x33'),timeoutHandler);_0x508fe0[_0x161f('0x34')]=![];_0x508fe0['on']('hangup',hangupHandler);var _0x12f1be=getSquareProject[_0x161f('0x35')](null,_0x508fe0[_0x161f('0x18')]);if(_0x12f1be){if(_0x12f1be[_0x161f('0x36')]){_0x10740e=getRoot(_0x12f1be[_0x161f('0x36')]);if(_0x10740e&&_0x10740e[_0x161f('0x37')]){logger[_0x161f('0x30')](_0x161f('0x20'),JSON[_0x161f('0x38')](_0x10740e,null,0x2));_0x508fe0[_0x161f('0x39')]=moment()['format'](_0x161f('0x3a'));_0x11ab5b=initGraph(_[_0x161f('0x26')](_0x10740e,_0x161f('0x3b')),_0x10740e['mxCell']);_0x5d2b27=new Vertices(_0x508fe0,rpc,mailRpc);logger[_0x161f('0x11')](util[_0x161f('0x12')](_0x161f('0x3c'),_0x508fe0[_0x161f('0x18')],_0x508fe0['calleridname'],_0x508fe0[_0x161f('0x1a')],_0x508fe0['dnid'],_0x508fe0[_0x161f('0x1c')]));_0x11ab5b[_0x161f('0x3d')](_0x10740e['start']['id'],function(_0x5bbdf0){try{_0x5bbdf0=_0x5d2b27[_0x161f('0x3e')](_0x5bbdf0);logger[_0x161f('0x30')](_0x161f('0x3f'),JSON[_0x161f('0x38')](_0x5bbdf0,null,0x2));if(_0x5bbdf0[_0x161f('0x21')]===_0x161f('0x40')){logger['info'](_0x161f('0x41'));_0x508fe0['context']=_0x5bbdf0[_0x161f('0x42')]||_0x508fe0[_0x161f('0x42')];_0x508fe0['extension']=_0x5bbdf0[_0x161f('0x43')];_0x508fe0['priority']=_0x5bbdf0['priority']?_0x5bbdf0[_0x161f('0x44')]-0x1:0x1;return null;}else if(_0x5bbdf0&&_0x5d2b27[_0x5bbdf0[_0x161f('0x21')]]){_0x4a8a49=_0x5d2b27[_0x5bbdf0[_0x161f('0x21')]](_0x5bbdf0);logger['info'](_0x161f('0x45'),JSON[_0x161f('0x38')](_0x4a8a49,null,0x2));if(_0x4a8a49&&_0x4a8a49[_0x161f('0x46')]===AGI_CODE_SUCCESS&&_0x4a8a49[_0x161f('0x47')]!==AGI_RESULT_ERROR&&!_0x508fe0[_0x161f('0x34')]){logger[_0x161f('0x30')](_0x161f('0x45'),getLogFromObject(_0x4a8a49));return _[_0x161f('0x48')](_0x4a8a49[_0x161f('0x47')])?null:_0x4a8a49[_0x161f('0x47')][_0x161f('0x49')]();}else{logger['error'](_0x161f('0x45'),getLogFromObject(_0x4a8a49));return null;}}else{logger['error'](_0x161f('0x4a'));return null;}}catch(_0x1b6ced){logger[_0x161f('0xd')](_0x1b6ced['stack']);return null;}});if(_0x10740e[_0x161f('0x4b')]){logger[_0x161f('0x11')](util['format'](_0x161f('0x4c'),_0x508fe0[_0x161f('0x18')],_0x508fe0[_0x161f('0x19')],_0x508fe0['callerid'],_0x508fe0[_0x161f('0x1b')],_0x508fe0[_0x161f('0x1c')]));_0x11ab5b['traverseBFS'](_0x10740e[_0x161f('0x4b')]['id'],function(_0x585fc1){try{_0x585fc1=_0x5d2b27['clear'](_0x585fc1);logger[_0x161f('0x30')](_0x161f('0x3f'),JSON[_0x161f('0x38')](_0x585fc1,null,0x2));if(_0x585fc1&&_0x5d2b27[_0x585fc1[_0x161f('0x21')]]){_0x4a8a49=_0x5d2b27[_0x585fc1[_0x161f('0x21')]](_0x585fc1);if(_0x4a8a49){logger['debug'](_0x161f('0x45'),getLogFromObject(_0x4a8a49));return _['isUndefined'](_0x4a8a49['result'])?null:_0x4a8a49[_0x161f('0x47')][_0x161f('0x49')]();}else{logger['error'](_0x161f('0x45'),getLogFromObject(_0x4a8a49));return null;}}else{logger[_0x161f('0xd')](_0x161f('0x4a'));return null;}}catch(_0x58b6bf){logger[_0x161f('0xd')](_0x58b6bf[_0x161f('0xe')]);return null;}});}logger[_0x161f('0x11')](util[_0x161f('0x12')](_0x161f('0x4d'),_0x508fe0[_0x161f('0x18')],_0x508fe0['calleridname'],_0x508fe0[_0x161f('0x1a')],_0x508fe0[_0x161f('0x1b')],_0x508fe0['uniqueid']));logger[_0x161f('0x11')](util['format']('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x508fe0['context'],_0x508fe0[_0x161f('0x43')],parseInt(_0x508fe0[_0x161f('0x44')],0xa)+0x1));_0x508fe0['continueAt'](_0x508fe0['context'],_0x508fe0[_0x161f('0x43')],parseInt(_0x508fe0[_0x161f('0x44')],0xa)+0x1);_0x508fe0[_0x161f('0x32')]();}}else{logger['error'](util['format'](_0x161f('0x4e'),_0x508fe0[_0x161f('0x18')]));_0x508fe0[_0x161f('0x4f')](_0x508fe0[_0x161f('0x42')],_0x508fe0[_0x161f('0x43')],parseInt(_0x508fe0[_0x161f('0x44')],0xa)+0x1);_0x508fe0[_0x161f('0x32')]();}}else{logger['error'](util[_0x161f('0x12')](_0x161f('0x50'),_0x508fe0[_0x161f('0x18')]));_0x508fe0[_0x161f('0x4f')](_0x508fe0[_0x161f('0x42')],_0x508fe0[_0x161f('0x43')],parseInt(_0x508fe0[_0x161f('0x44')],0xa)+0x1);_0x508fe0[_0x161f('0x32')]();}}function main(){var _0x4bb91a;return utilLicense['getLicense']()[_0x161f('0x2c')](function(_0x75805a){if(_0x75805a){if(_0x75805a[_0x161f('0x51')]){if(_0x75805a['callysquare']&&_0x75805a[_0x161f('0x52')]>0x0){logger[_0x161f('0x11')](util['format'](_0x161f('0x53'),_0x75805a[_0x161f('0x52')]));_0x4bb91a=_0x75805a[_0x161f('0x52')];}else{logger[_0x161f('0x11')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0x161f('0x11')](_0x161f('0x54'));_0x4bb91a=-0x1;}}})[_0x161f('0x2d')](function(_0x315e2c){logger[_0x161f('0xd')](_0x161f('0x55'),_0x315e2c[_0x161f('0xe')]);})[_0x161f('0x4b')](function(){var _0x25848a=require(_0x161f('0x56'))(config[_0x161f('0x6')][_0x161f('0x57')],config[_0x161f('0x6')]['ip'],_0x4bb91a);_0x25848a['on'](_0x161f('0xd'),errorHandler);_0x25848a['on'](_0x161f('0x58'),listeningHandler);_0x25848a['on'](_0x161f('0x59'),connectionHandler);_0x25848a['on'](_0x161f('0x32'),closeHandler);});}main(); \ No newline at end of file diff --git a/server/services/agi/mailRpc/index.js b/server/services/agi/mailRpc/index.js index 12cdad4..4ea18d6 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 _0x5608=['sendMailMessage','SendMail','bluebird','jayson/promise','client','http','then','error','message','result','catch'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0x5608,0x12b));var _0x8560=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x5608[_0x164eca];return _0x2ce562;};'use strict';var BPromise=require(_0x8560('0x0'));var jayson=require(_0x8560('0x1'));var client=jayson[_0x8560('0x2')][_0x8560('0x3')]({'port':0x232b});function request(_0x3e46f4,_0x354ba0){return new BPromise(function(_0x21d3ae,_0x54eab4){return client['request'](_0x3e46f4,_0x354ba0)[_0x8560('0x4')](function(_0x4e3655){if(_0x4e3655[_0x8560('0x5')]){return _0x54eab4(_0x4e3655[_0x8560('0x5')][_0x8560('0x6')]);}else{return _0x21d3ae(_0x4e3655[_0x8560('0x7')]);}})[_0x8560('0x8')](function(_0x3889ae){return _0x54eab4(_0x3889ae);});});}exports[_0x8560('0x9')]=function(_0x1713c6,_0x1a2f9e){return request(_0x8560('0xa'),{'account':_0x1713c6,'message':_0x1a2f9e});}; \ No newline at end of file +var _0xe833=['jayson/promise','http','request','then','error','message','catch'];(function(_0xd07d78,_0x237c88){var _0x89958e=function(_0x3c62ed){while(--_0x3c62ed){_0xd07d78['push'](_0xd07d78['shift']());}};_0x89958e(++_0x237c88);}(_0xe833,0x134));var _0x3e83=function(_0x6fead4,_0x4bf947){_0x6fead4=_0x6fead4-0x0;var _0x55d050=_0xe833[_0x6fead4];return _0x55d050;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x3e83('0x0'));var client=jayson['client'][_0x3e83('0x1')]({'port':0x232b});function request(_0x560e77,_0x30e418){return new BPromise(function(_0x572a18,_0x22ba01){return client[_0x3e83('0x2')](_0x560e77,_0x30e418)[_0x3e83('0x3')](function(_0x5e6f22){if(_0x5e6f22['error']){return _0x22ba01(_0x5e6f22[_0x3e83('0x4')][_0x3e83('0x5')]);}else{return _0x572a18(_0x5e6f22['result']);}})[_0x3e83('0x6')](function(_0x4c5bef){return _0x22ba01(_0x4c5bef);});});}exports['sendMailMessage']=function(_0x1d8323,_0x28c978){return request('SendMail',{'account':_0x1d8323,'message':_0x28c978});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 56b9b60..2dbe2f6 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 _0x9147=['_inBody','prototype','_transform','\x0d\x0a\x0d\x0a','toString','indexOf','substring','length','split','slice','trim','headers','emit','line','exports','util','stream','_localBuffer'];(function(_0x38a5ca,_0x464da3){var _0x3fa7d0=function(_0x4b9a09){while(--_0x4b9a09){_0x38a5ca['push'](_0x38a5ca['shift']());}};_0x3fa7d0(++_0x464da3);}(_0x9147,0x7b));var _0x7914=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9147[_0x6131cd];return _0x47e916;};'use strict';var util=require(_0x7914('0x0'));var Transform=require(_0x7914('0x1'))['Transform'];function AGIReply(_0x1bf3cd){Transform['call'](this,_0x1bf3cd);this[_0x7914('0x2')]='';this[_0x7914('0x3')]=![];}util['inherits'](AGIReply,Transform);AGIReply[_0x7914('0x4')][_0x7914('0x5')]=function(_0x28f320,_0x5da333,_0x34c372){var _0x4dd321='\x0a',_0x1e65cc=['\x0a\x0a',_0x7914('0x6')],_0x535b02=-0x1,_0xdac92f=-0x1,_0x462c85='',_0x37450d=0x0,_0x463e7f='',_0x29fdf8='';this[_0x7914('0x2')]+=_0x28f320[_0x7914('0x7')]();_0x463e7f=this[_0x7914('0x2')];if(!this[_0x7914('0x3')]){_0x37450d=0x0;while(_0x1e65cc[_0x37450d]){while((_0xdac92f=_0x463e7f[_0x7914('0x8')](_0x1e65cc[_0x37450d]))!=-0x1){_0x462c85=_0x1e65cc[_0x37450d];_0x29fdf8=_0x463e7f[_0x7914('0x9')](0x0,_0xdac92f);_0x463e7f=_0x463e7f[_0x7914('0x9')](_0xdac92f+_0x462c85[_0x7914('0xa')]);var _0x221438=_0x29fdf8[_0x7914('0xb')](_0x4dd321),_0x531b02=0x0,_0x290117={},_0x29050a='',_0x1c47ad='',_0x1e6768=-0x1;while(_0x221438[_0x531b02]){_0x1e6768=_0x221438[_0x531b02]['indexOf'](':');if(_0x1e6768!=-0x1){_0x29050a=_0x221438[_0x531b02][_0x7914('0xc')](0x0,_0x1e6768)[_0x7914('0xd')]();_0x1c47ad=_0x221438[_0x531b02][_0x7914('0xc')](_0x1e6768+0x1)['trim']();if(_0x29050a[_0x7914('0xa')]>0x0){_0x290117[_0x29050a]=_0x1c47ad;}}else{}_0x531b02++;}this['emit'](_0x7914('0xe'),_0x290117);this[_0x7914('0x3')]=!![];}_0x37450d++;}this['_localBuffer']=_0x463e7f;}else{while((_0x535b02=_0x463e7f[_0x7914('0x8')](_0x4dd321))!=-0x1){_0x29fdf8=_0x463e7f[_0x7914('0x9')](0x0,_0x535b02);this[_0x7914('0xf')](_0x7914('0x10'),_0x29fdf8);_0x463e7f=_0x463e7f[_0x7914('0x9')](_0x535b02+_0x4dd321['length']);}this[_0x7914('0x2')]=_0x463e7f;}_0x34c372();};module[_0x7914('0x11')]=AGIReply; \ No newline at end of file +var _0xc0f3=['indexOf','substring','slice','trim','length','emit','line','stream','Transform','_localBuffer','prototype','_transform','\x0d\x0a\x0d\x0a','toString','_inBody'];(function(_0x148c1d,_0x537052){var _0xed1bda=function(_0x182118){while(--_0x182118){_0x148c1d['push'](_0x148c1d['shift']());}};_0xed1bda(++_0x537052);}(_0xc0f3,0x1d8));var _0x3c0f=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xc0f3[_0xa464c9];return _0x3d73c4;};'use strict';var util=require('util');var Transform=require(_0x3c0f('0x0'))[_0x3c0f('0x1')];function AGIReply(_0x2ed777){Transform['call'](this,_0x2ed777);this[_0x3c0f('0x2')]='';this['_inBody']=![];}util['inherits'](AGIReply,Transform);AGIReply[_0x3c0f('0x3')][_0x3c0f('0x4')]=function(_0x268952,_0x13628b,_0x1512d2){var _0x5871c0='\x0a',_0x2daf63=['\x0a\x0a',_0x3c0f('0x5')],_0x12f125=-0x1,_0x3a3f83=-0x1,_0x43605b='',_0x595b2e=0x0,_0x2dcb80='',_0x3fc2f3='';this[_0x3c0f('0x2')]+=_0x268952[_0x3c0f('0x6')]();_0x2dcb80=this['_localBuffer'];if(!this[_0x3c0f('0x7')]){_0x595b2e=0x0;while(_0x2daf63[_0x595b2e]){while((_0x3a3f83=_0x2dcb80[_0x3c0f('0x8')](_0x2daf63[_0x595b2e]))!=-0x1){_0x43605b=_0x2daf63[_0x595b2e];_0x3fc2f3=_0x2dcb80[_0x3c0f('0x9')](0x0,_0x3a3f83);_0x2dcb80=_0x2dcb80[_0x3c0f('0x9')](_0x3a3f83+_0x43605b['length']);var _0x467327=_0x3fc2f3['split'](_0x5871c0),_0x9fec2a=0x0,_0xf6cd51={},_0x590c5a='',_0x15c4cc='',_0x26686f=-0x1;while(_0x467327[_0x9fec2a]){_0x26686f=_0x467327[_0x9fec2a][_0x3c0f('0x8')](':');if(_0x26686f!=-0x1){_0x590c5a=_0x467327[_0x9fec2a][_0x3c0f('0xa')](0x0,_0x26686f)['trim']();_0x15c4cc=_0x467327[_0x9fec2a][_0x3c0f('0xa')](_0x26686f+0x1)[_0x3c0f('0xb')]();if(_0x590c5a[_0x3c0f('0xc')]>0x0){_0xf6cd51[_0x590c5a]=_0x15c4cc;}}else{}_0x9fec2a++;}this['emit']('headers',_0xf6cd51);this[_0x3c0f('0x7')]=!![];}_0x595b2e++;}this[_0x3c0f('0x2')]=_0x2dcb80;}else{while((_0x12f125=_0x2dcb80['indexOf'](_0x5871c0))!=-0x1){_0x3fc2f3=_0x2dcb80[_0x3c0f('0x9')](0x0,_0x12f125);this[_0x3c0f('0xd')](_0x3c0f('0xe'),_0x3fc2f3);_0x2dcb80=_0x2dcb80[_0x3c0f('0x9')](_0x12f125+_0x5871c0[_0x3c0f('0xc')]);}this['_localBuffer']=_0x2dcb80;}_0x1512d2();};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 2880786..8ac1355 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 _0x4fd8=['createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','phone','ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','agentPause','PauseUser','agentUnpause','UnpauseUser','LogoutUser','bluebird','lodash','util','jayson/promise','client','http','request','then','error','message','result','catch','production','getMailAccountById','ShowMailAccount','name','email','ShowSquareProject','getVoiceQueueById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','getUserById','ShowUser','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','ShowInterval','Interval','getSmsAccountById','ShowSmsAccount','CreateSmsMessage'];(function(_0x31ddd7,_0x5d5eaa){var _0x1e7545=function(_0x32685a){while(--_0x32685a){_0x31ddd7['push'](_0x31ddd7['shift']());}};_0x1e7545(++_0x5d5eaa);}(_0x4fd8,0x16d));var _0x84fd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4fd8[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x84fd('0x0'));var moment=require('moment');var _=require(_0x84fd('0x1'));var util=require(_0x84fd('0x2'));var jayson=require(_0x84fd('0x3'));var client=jayson[_0x84fd('0x4')][_0x84fd('0x5')]({'port':0x2329});function request(_0x4d422e,_0x283670){return new BPromise(function(_0xa295b2,_0x131739){return client[_0x84fd('0x6')](_0x4d422e,_0x283670)[_0x84fd('0x7')](function(_0x48c594){if(_0x48c594[_0x84fd('0x8')]){return _0x131739(_0x48c594[_0x84fd('0x8')][_0x84fd('0x9')]);}else{return _0xa295b2(_0x48c594[_0x84fd('0xa')]);}})[_0x84fd('0xb')](function(_0x17e48b){return _0x131739(_0x17e48b);});});}exports['getSquareProject']=function(_0xe9be7e){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0xe9be7e},'attributes':[_0x84fd('0xc')]}});};exports[_0x84fd('0xd')]=function(_0x2bc922){return request(_0x84fd('0xe'),{'options':{'raw':![],'where':{'id':_0x2bc922},'include':[{'model':'MailServerOut','as':'Smtp'}],'attributes':['id',_0x84fd('0xf'),_0x84fd('0x10')]}});};exports['getSquareProjectById']=function(_0x3b1e28){return request(_0x84fd('0x11'),{'options':{'where':{'id':_0x3b1e28},'attributes':[_0x84fd('0xf')]}});};exports[_0x84fd('0x12')]=function(_0x33d4eb){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x33d4eb},'attributes':['name']}});};exports['getVariableById']=function(_0x5b5449){return request(_0x84fd('0x13'),{'options':{'where':{'id':_0x5b5449},'attributes':[_0x84fd('0xf')]}});};exports[_0x84fd('0x14')]=function(_0x141905){return request(_0x84fd('0x15'),{'options':{'where':{'id':_0x141905},'attributes':['dsn']}});};exports[_0x84fd('0x16')]=function(_0x518f60){return request(_0x84fd('0x17'),{'options':{'where':{'id':_0x518f60},'attributes':['name']}});};exports[_0x84fd('0x18')]=function(_0x1b2c40){return request(_0x84fd('0x19'),{'options':{'where':{'id':_0x1b2c40},'attributes':[_0x84fd('0xf')]}});};exports[_0x84fd('0x1a')]=function(_0x4c57bc){return request(_0x84fd('0x1b'),{'options':{'where':{'id':_0x4c57bc},'attributes':[_0x84fd('0x1c')]}});};exports['getIntervalById']=function(_0x1cc42c){return request(_0x84fd('0x1d'),{'options':{'raw':![],'where':{'id':_0x1cc42c},'include':[{'model':_0x84fd('0x1e'),'as':'Intervals'}]}});};exports[_0x84fd('0x1f')]=function(_0x5a5e5d){return request(_0x84fd('0x20'),{'options':{'where':{'id':_0x5a5e5d},'attributes':['id',_0x84fd('0xf')]}});};exports['createSmsMessage']=function(_0x1f8aa6){return request(_0x84fd('0x21'),{'body':_0x1f8aa6});};exports[_0x84fd('0x22')]=function(_0x2148e1){return request(_0x84fd('0x23'),{'body':_0x2148e1});};exports[_0x84fd('0x24')]=function(_0x21a816){return request(_0x84fd('0x25'),{'body':_[_0x84fd('0x26')](_0x21a816,{'project_name':_0x21a816['arg_1'],'prev_project_name':_0x21a816['arg_2']||'','is_subproject':_0x21a816[_0x84fd('0x27')]?!![]:![],'leaveAt':moment()[_0x84fd('0x28')](_0x84fd('0x29'))})});};exports['createSquareRecording']=function(_0x3f0653){return request('CreateSquareRecording',{'body':_0x3f0653});};exports[_0x84fd('0x2a')]=function(_0x2697e8){return request(_0x84fd('0x2b'),{'body':_0x2697e8});};exports[_0x84fd('0x2c')]=function(_0x4dba8a){return request(_0x84fd('0x2d'),{'options':{'raw':![],'where':{'phone':_0x4dba8a[_0x84fd('0x2e')],'ListId':_0x4dba8a[_0x84fd('0x2f')]}}})['then'](function(_0x3e504a){if(_0x3e504a){return _0x3e504a;}return request(_0x84fd('0x30'),{'body':_0x4dba8a});});};exports[_0x84fd('0x31')]=function(_0x36dd7d){return request(_0x84fd('0x32'),{'options':{'where':{'id':_0x36dd7d},'attributes':[_0x84fd('0xf')]}});};exports[_0x84fd('0x33')]=function(_0x26ddeb,_0x4fdff1){return request('LoginUser',{'body':{'interface':_0x4fdff1},'options':{'where':_0x26ddeb}});};exports[_0x84fd('0x34')]=function(_0xe3c79a,_0x2283ae,_0xb5c88d){return request(_0x84fd('0x35'),{'body':{'type':_0x2283ae,'uniqueid':_0xb5c88d},'options':{'where':_0xe3c79a}});};exports[_0x84fd('0x36')]=function(_0x61b7ba){return request(_0x84fd('0x37'),{'body':{},'options':{'where':_0x61b7ba}});};exports['agentLogout']=function(_0x1d4c6c){return request(_0x84fd('0x38'),{'body':{},'options':{'where':_0x1d4c6c}});}; \ No newline at end of file +var _0xe483=['jayson/promise','http','request','error','message','result','catch','ShowSquareProject','production','getMailAccountById','ShowMailAccount','Smtp','name','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getTrunkById','ShowTrunk','getSoundById','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','phone','then','CreateCmContact','ShowPause','agentPause','agentUnpause','UnpauseUser','agentLogout','LogoutUser','bluebird','moment','util'];(function(_0x37a6f3,_0x3574c6){var _0x13ed36=function(_0x561c40){while(--_0x561c40){_0x37a6f3['push'](_0x37a6f3['shift']());}};_0x13ed36(++_0x3574c6);}(_0xe483,0xed));var _0x3e48=function(_0x7ed61c,_0x3b6074){_0x7ed61c=_0x7ed61c-0x0;var _0x56457f=_0xe483[_0x7ed61c];return _0x56457f;};'use strict';var BPromise=require(_0x3e48('0x0'));var moment=require(_0x3e48('0x1'));var _=require('lodash');var util=require(_0x3e48('0x2'));var jayson=require(_0x3e48('0x3'));var client=jayson['client'][_0x3e48('0x4')]({'port':0x2329});function request(_0x5363c3,_0x4a9717){return new BPromise(function(_0x259eb5,_0x34fc6b){return client[_0x3e48('0x5')](_0x5363c3,_0x4a9717)['then'](function(_0x3b0cb4){if(_0x3b0cb4[_0x3e48('0x6')]){return _0x34fc6b(_0x3b0cb4[_0x3e48('0x6')][_0x3e48('0x7')]);}else{return _0x259eb5(_0x3b0cb4[_0x3e48('0x8')]);}})[_0x3e48('0x9')](function(_0x370fe0){return _0x34fc6b(_0x370fe0);});});}exports['getSquareProject']=function(_0x41aa16){return request(_0x3e48('0xa'),{'options':{'raw':![],'where':{'name':_0x41aa16},'attributes':[_0x3e48('0xb')]}});};exports[_0x3e48('0xc')]=function(_0x180b62){return request(_0x3e48('0xd'),{'options':{'raw':![],'where':{'id':_0x180b62},'include':[{'model':'MailServerOut','as':_0x3e48('0xe')}],'attributes':['id',_0x3e48('0xf'),_0x3e48('0x10')]}});};exports[_0x3e48('0x11')]=function(_0x556898){return request('ShowSquareProject',{'options':{'where':{'id':_0x556898},'attributes':[_0x3e48('0xf')]}});};exports[_0x3e48('0x12')]=function(_0x4f0ff2){return request(_0x3e48('0x13'),{'options':{'where':{'id':_0x4f0ff2},'attributes':[_0x3e48('0xf')]}});};exports[_0x3e48('0x14')]=function(_0x3e95e1){return request(_0x3e48('0x15'),{'options':{'where':{'id':_0x3e95e1},'attributes':[_0x3e48('0xf')]}});};exports[_0x3e48('0x16')]=function(_0xc88bf8){return request(_0x3e48('0x17'),{'options':{'where':{'id':_0xc88bf8},'attributes':[_0x3e48('0x18')]}});};exports[_0x3e48('0x19')]=function(_0x536d87){return request(_0x3e48('0x1a'),{'options':{'where':{'id':_0x536d87},'attributes':[_0x3e48('0xf')]}});};exports[_0x3e48('0x1b')]=function(_0x58b840){return request(_0x3e48('0x1c'),{'options':{'where':{'id':_0x58b840},'attributes':['name']}});};exports[_0x3e48('0x1d')]=function(_0x20dbd8){return request('ShowSound',{'options':{'where':{'id':_0x20dbd8},'attributes':['save_name']}});};exports[_0x3e48('0x1e')]=function(_0x1e56aa){return request(_0x3e48('0x1f'),{'options':{'raw':![],'where':{'id':_0x1e56aa},'include':[{'model':_0x3e48('0x20'),'as':_0x3e48('0x21')}]}});};exports[_0x3e48('0x22')]=function(_0x370175){return request(_0x3e48('0x23'),{'options':{'where':{'id':_0x370175},'attributes':['id',_0x3e48('0xf')]}});};exports[_0x3e48('0x24')]=function(_0x5f4a04){return request(_0x3e48('0x25'),{'body':_0x5f4a04});};exports[_0x3e48('0x26')]=function(_0x1feae6){return request(_0x3e48('0x27'),{'body':_0x1feae6});};exports[_0x3e48('0x28')]=function(_0x5e55e1){return request(_0x3e48('0x29'),{'body':_[_0x3e48('0x2a')](_0x5e55e1,{'project_name':_0x5e55e1[_0x3e48('0x2b')],'prev_project_name':_0x5e55e1['arg_2']||'','is_subproject':_0x5e55e1[_0x3e48('0x2c')]?!![]:![],'leaveAt':moment()[_0x3e48('0x2d')](_0x3e48('0x2e'))})});};exports['createSquareRecording']=function(_0x1d014c){return request('CreateSquareRecording',{'body':_0x1d014c});};exports[_0x3e48('0x2f')]=function(_0x516b52){return request(_0x3e48('0x30'),{'body':_0x516b52});};exports[_0x3e48('0x31')]=function(_0x5e9f1d){return request(_0x3e48('0x32'),{'options':{'raw':![],'where':{'phone':_0x5e9f1d[_0x3e48('0x33')],'ListId':_0x5e9f1d['ListId']}}})[_0x3e48('0x34')](function(_0x3bb356){if(_0x3bb356){return _0x3bb356;}return request(_0x3e48('0x35'),{'body':_0x5e9f1d});});};exports['getPauseById']=function(_0x1365b4){return request(_0x3e48('0x36'),{'options':{'where':{'id':_0x1365b4},'attributes':[_0x3e48('0xf')]}});};exports['agentLogin']=function(_0x1250ef,_0x40bd1d){return request('LoginUser',{'body':{'interface':_0x40bd1d},'options':{'where':_0x1250ef}});};exports[_0x3e48('0x37')]=function(_0x3ef867,_0x54080c,_0x29186f){return request('PauseUser',{'body':{'type':_0x54080c,'uniqueid':_0x29186f},'options':{'where':_0x3ef867}});};exports[_0x3e48('0x38')]=function(_0x270616){return request(_0x3e48('0x39'),{'body':{},'options':{'where':_0x270616}});};exports[_0x3e48('0x3a')]=function(_0x37d4fd){return request(_0x3e48('0x3b'),{'body':{},'options':{'where':_0x37d4fd}});}; \ 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 66d3404..ddfface 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 _0x644f=['exports','./lex'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x644f,0x177));var _0xf644=function(_0x2867d8,_0xef3ee0){_0x2867d8=_0x2867d8-0x0;var _0x3b8176=_0x644f[_0x2867d8];return _0x3b8176;};var polly=require('./polly');var lex=require(_0xf644('0x0'));module[_0xf644('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x2070=['exports'];(function(_0x5353a7,_0x35c20f){var _0x2c86ac=function(_0x105d9e){while(--_0x105d9e){_0x5353a7['push'](_0x5353a7['shift']());}};_0x2c86ac(++_0x35c20f);}(_0x2070,0x1a2));var _0x0207=function(_0x2f384a,_0x2b093f){_0x2f384a=_0x2f384a-0x0;var _0x20e890=_0x2070[_0x2f384a];return _0x20e890;};var polly=require('./polly');var lex=require('./lex');module[_0x0207('0x0')]={'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 63813eb..b75f785 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 _0xa9e0=['exports','./lib/api'];(function(_0xa6cc5c,_0x239c99){var _0x44803d=function(_0x515b6e){while(--_0x515b6e){_0xa6cc5c['push'](_0xa6cc5c['shift']());}};_0x44803d(++_0x239c99);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'use strict';var lex=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]=function(_0x29929c,_0x5dd881,_0x550fbc,_0x18d5c9,_0x4ce2f1,_0x333808){return lex(_0x29929c,_0x5dd881,_0x550fbc,_0x18d5c9,_0x4ce2f1,_0x333808);}; \ No newline at end of file +var _0x9348=['exports','./lib/api'];(function(_0x521dde,_0x7ebabd){var _0x3f8e4a=function(_0x3e29ab){while(--_0x3e29ab){_0x521dde['push'](_0x521dde['shift']());}};_0x3f8e4a(++_0x7ebabd);}(_0x9348,0x10d));var _0x8934=function(_0x2df8d6,_0x337ed0){_0x2df8d6=_0x2df8d6-0x0;var _0x4f95ee=_0x9348[_0x2df8d6];return _0x4f95ee;};'use strict';var lex=require(_0x8934('0x0'));module[_0x8934('0x1')]=function(_0x472223,_0x135b2c,_0x46a231,_0x4a2577,_0x34d032,_0x35da0b){return lex(_0x472223,_0x135b2c,_0x46a231,_0x4a2577,_0x34d032,_0x35da0b);}; \ 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 1533370..90ce962 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(_0x15cc02,_0x2cbb64){var _0x424f08=function(_0x58f1be){while(--_0x58f1be){_0x15cc02['push'](_0x15cc02['shift']());}};_0x424f08(++_0x2cbb64);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'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(_0x4998d3,_0x4628fb){var _0x7388ac=function(_0x28df92){while(--_0x28df92){_0x4998d3['push'](_0x4998d3['shift']());}};_0x7388ac(++_0x4628fb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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 31afafe..94b30f0 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 _0x3de3=['./lib/api'];(function(_0x1f5b3d,_0x5e8c5d){var _0x284d4c=function(_0x213eee){while(--_0x213eee){_0x1f5b3d['push'](_0x1f5b3d['shift']());}};_0x284d4c(++_0x5e8c5d);}(_0x3de3,0x1d5));var _0x33de=function(_0x223a74,_0x53c941){_0x223a74=_0x223a74-0x0;var _0x2e3bea=_0x3de3[_0x223a74];return _0x2e3bea;};'use strict';var polly=require(_0x33de('0x0'));module['exports']=function(_0x67f98d,_0x88eeef,_0x324682,_0x5fee17,_0x190e11,_0x4dcb97,_0x42913c){return polly(_0x67f98d,_0x88eeef,_0x324682,_0x5fee17,_0x190e11,_0x4dcb97,_0x42913c);}; \ No newline at end of file +var _0x7923=['exports','./lib/api'];(function(_0x1e9fcc,_0x4f475e){var _0x50c77c=function(_0x27fd3d){while(--_0x27fd3d){_0x1e9fcc['push'](_0x1e9fcc['shift']());}};_0x50c77c(++_0x4f475e);}(_0x7923,0x97));var _0x3792=function(_0x44992b,_0x3bcfb9){_0x44992b=_0x44992b-0x0;var _0x372fa5=_0x7923[_0x44992b];return _0x372fa5;};'use strict';var polly=require(_0x3792('0x0'));module[_0x3792('0x1')]=function(_0x298990,_0x578a5c,_0x495786,_0x2daa49,_0x28a528,_0xd7a1ee,_0x3a2694){return polly(_0x298990,_0x578a5c,_0x495786,_0x2daa49,_0x28a528,_0xd7a1ee,_0x3a2694);}; \ 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 55f9c7c..991449a 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 _0x3c33=['exports','Polly','text','path','randomstring','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x545dd8,_0x404f75){var _0x44cd80=function(_0xec3ca3){while(--_0xec3ca3){_0x545dd8['push'](_0x545dd8['shift']());}};_0x44cd80(++_0x404f75);}(_0x3c33,0x16b));var _0x33c3=function(_0x45f567,_0x38db68){_0x45f567=_0x45f567-0x0;var _0x6a7dbb=_0x3c33[_0x45f567];return _0x6a7dbb;};'use strict';var fs=require('fs');var path=require(_0x33c3('0x0'));var BPromise=require('bluebird');var rs=require(_0x33c3('0x1'));var AWS=require('aws-sdk');function pollyResult(_0x54ad21,_0x180883,_0x53c8d6){return new BPromise(function(_0x33d82a,_0x4a625a){_0x54ad21['synthesizeSpeech'](_0x180883,function(_0x50e7a6,_0x1ae054){if(_0x50e7a6){_0x4a625a(_0x50e7a6);}else if(_0x1ae054){if(_0x1ae054[_0x33c3('0x2')]instanceof Buffer){fs[_0x33c3('0x3')](_0x53c8d6,_0x1ae054[_0x33c3('0x2')],function(_0x94cb89){if(_0x94cb89){_0x4a625a(_0x94cb89);}else{_0x33d82a();}});}else{_0x4a625a(new Error(_0x33c3('0x4')));}}else{_0x4a625a(new Error(_0x33c3('0x5')));}});});}module[_0x33c3('0x6')]=function(_0x48307d,_0x1eb704,_0x22856e,_0x20b8e7,_0x5f457c,_0x286f60,_0xdf0eda){var _0x368cd2=new AWS[(_0x33c3('0x7'))]({'accessKeyId':_0x48307d,'secretAccessKey':_0x1eb704,'region':_0x22856e});var _0x3a511c={'Text':_0x5f457c,'TextType':_0x286f60||_0x33c3('0x8'),'OutputFormat':'mp3','VoiceId':_0x20b8e7};return pollyResult(_0x368cd2,_0x3a511c,_0xdf0eda);}; \ No newline at end of file +var _0x6cd6=['aws-sdk','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','randomstring'];(function(_0x50b1aa,_0x3c1710){var _0x3657f4=function(_0x15a096){while(--_0x15a096){_0x50b1aa['push'](_0x50b1aa['shift']());}};_0x3657f4(++_0x3c1710);}(_0x6cd6,0x116));var _0x66cd=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x6cd6[_0x199572];return _0x13cfa3;};'use strict';var fs=require('fs');var path=require(_0x66cd('0x0'));var BPromise=require('bluebird');var rs=require(_0x66cd('0x1'));var AWS=require(_0x66cd('0x2'));function pollyResult(_0x48ceae,_0x5479f5,_0x5ccfcd){return new BPromise(function(_0x7d803,_0x1eaec8){_0x48ceae['synthesizeSpeech'](_0x5479f5,function(_0x33ee39,_0x218706){if(_0x33ee39){_0x1eaec8(_0x33ee39);}else if(_0x218706){if(_0x218706[_0x66cd('0x3')]instanceof Buffer){fs['writeFile'](_0x5ccfcd,_0x218706[_0x66cd('0x3')],function(_0x1d6545){if(_0x1d6545){_0x1eaec8(_0x1d6545);}else{_0x7d803();}});}else{_0x1eaec8(new Error(_0x66cd('0x4')));}}else{_0x1eaec8(new Error(_0x66cd('0x5')));}});});}module[_0x66cd('0x6')]=function(_0x5e2d7c,_0x12ff5a,_0x4132c2,_0xc3626f,_0x480450,_0x2bdaeb,_0xedd7b9){var _0x5a8fe6=new AWS[(_0x66cd('0x7'))]({'accessKeyId':_0x5e2d7c,'secretAccessKey':_0x12ff5a,'region':_0x4132c2});var _0x43634f={'Text':_0x480450,'TextType':_0x2bdaeb||_0x66cd('0x8'),'OutputFormat':_0x66cd('0x9'),'VoiceId':_0xc3626f};return pollyResult(_0x5a8fe6,_0x43634f,_0xedd7b9);}; \ 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 66df271..f620047 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 _0x0f3d=['./lib/api','exports'];(function(_0x3df993,_0xaf56c9){var _0x35381a=function(_0x1c6d49){while(--_0x1c6d49){_0x3df993['push'](_0x3df993['shift']());}};_0x35381a(++_0xaf56c9);}(_0x0f3d,0x10a));var _0xd0f3=function(_0x2b31b4,_0x405bc7){_0x2b31b4=_0x2b31b4-0x0;var _0x195159=_0x0f3d[_0x2b31b4];return _0x195159;};'use strict';var asr=require(_0xd0f3('0x0'));module[_0xd0f3('0x1')]=function(_0x1d1dd0,_0x408762,_0x10375f,_0x30c59d){return asr(_0x1d1dd0,_0x408762,_0x10375f);}; \ No newline at end of file +var _0x3ae7=['exports','./lib/api'];(function(_0x2b6340,_0x1f9871){var _0x34595f=function(_0x4344b0){while(--_0x4344b0){_0x2b6340['push'](_0x2b6340['shift']());}};_0x34595f(++_0x1f9871);}(_0x3ae7,0x7b));var _0x73ae=function(_0x323059,_0x527389){_0x323059=_0x323059-0x0;var _0x564449=_0x3ae7[_0x323059];return _0x564449;};'use strict';var asr=require(_0x73ae('0x0'));module[_0x73ae('0x1')]=function(_0x24575e,_0x493168,_0x439821,_0x437530){return asr(_0x24575e,_0x493168,_0x439821);}; \ 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 636581f..eab3baf 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(_0x1d211b,_0x475f3b){var _0x47c88b=function(_0x3126f5){while(--_0x3126f5){_0x1d211b['push'](_0x1d211b['shift']());}};_0x47c88b(++_0x475f3b);}(_0x2f68,0x9a));var _0x82f6=function(_0x2f8aad,_0x3ad4cf){_0x2f8aad=_0x2f8aad-0x0;var _0x35f30c=_0x2f68[_0x2f8aad];return _0x35f30c;};'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 _0x83f1=['https://speech.googleapis.com','exports','string','length','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','/v1/speech:recognize?key=','8000','url','bluebird'];(function(_0x18e124,_0x5ca114){var _0x2f335a=function(_0x2d752e){while(--_0x2d752e){_0x18e124['push'](_0x18e124['shift']());}};_0x2f335a(++_0x5ca114);}(_0x83f1,0x1cc));var _0x183f=function(_0x247ab3,_0x253a3e){_0x247ab3=_0x247ab3-0x0;var _0x26a765=_0x83f1[_0x247ab3];return _0x26a765;};'use strict';var url=require(_0x183f('0x0'));var BPromise=require(_0x183f('0x1'));var fs=require('fs');var host=_0x183f('0x2');module[_0x183f('0x3')]=function(_0x40525d,_0x50f14d,_0x52688c){return new BPromise(function(_0x459395,_0x2668ca){var _0x7f265;if(typeof _0x40525d!==_0x183f('0x4')||_0x40525d[_0x183f('0x5')]===0x0){return _0x2668ca('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x50f14d!==_0x183f('0x4')||_0x50f14d[_0x183f('0x5')]===0x0){return _0x2668ca(_0x183f('0x6'));}if(typeof _0x52688c!=='undefined'&&(typeof _0x52688c!==_0x183f('0x4')||_0x52688c['length']===0x0)){return _0x2668ca(_0x183f('0x7'));}try{_0x7f265=fs[_0x183f('0x8')](_0x40525d)[_0x183f('0x9')](_0x183f('0xa'));}catch(_0x22bcd6){return _0x2668ca(_0x22bcd6);}return _0x459395({'method':_0x183f('0xb'),'uri':host+_0x183f('0xc')+_0x50f14d,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0x183f('0xd'),'languageCode':_0x52688c},'audio':{'content':_0x7f265}},'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 bbcf890..99d64dc 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 _0x3465=['exports','./asr'];(function(_0x2cac87,_0x2a49b4){var _0x421fa1=function(_0x4f55d1){while(--_0x4f55d1){_0x2cac87['push'](_0x2cac87['shift']());}};_0x421fa1(++_0x2a49b4);}(_0x3465,0xb3));var _0x5346=function(_0x5da877,_0x361726){_0x5da877=_0x5da877-0x0;var _0x3f2c10=_0x3465[_0x5da877];return _0x3f2c10;};var asr=require(_0x5346('0x0'));module[_0x5346('0x1')]={'asr':asr}; \ No newline at end of file +var _0x54c1=['./asr','exports'];(function(_0x107d8e,_0x40a3a9){var _0xabbe90=function(_0x18bb8a){while(--_0x18bb8a){_0x107d8e['push'](_0x107d8e['shift']());}};_0xabbe90(++_0x40a3a9);}(_0x54c1,0x166));var _0x154c=function(_0x8e28ae,_0x3a1bee){_0x8e28ae=_0x8e28ae-0x0;var _0x4805df=_0x54c1[_0x8e28ae];return _0x4805df;};var asr=require(_0x154c('0x0'));module[_0x154c('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 eb1f5ac..43108f8 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 _0x7c25=['WHAT_EVER','get','statusCode','error','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','unlink','download\x20error','pipe','protocol','request\x20to\x20','data','end','transcode','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','then','split','readFileSync','base64','?key=','input','voice','MP3','text:synthesize','.mp3','from','audioContent','chmodSync','777','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','POST','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','slice','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','parse\x20response\x20failed:\x0a','goggleTTS\x20path','asr','uri','results','map','alternatives','transcript','confidence','join','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','status','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','length','Dialogflow\x20V2\x20response:','allRequiredParamsPresent','queryResult','diagnosticInfo','fields','fulfillmentText','intent','displayName','isFallback','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','parse','text','CustomAction','CustomActionData','channelData','AudioFromTts','Data','audiofile','dirName','apiai-promise','dialogflow','https','path','querystring','request-promise','sox','url','util','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest','https:','host'];(function(_0x1027cd,_0x55055a){var _0x13317b=function(_0x2b87c9){while(--_0x2b87c9){_0x1027cd['push'](_0x1027cd['shift']());}};_0x13317b(++_0x55055a);}(_0x7c25,0x7b));var _0x57c2=function(_0x5835fc,_0xfdfc6b){_0x5835fc=_0x5835fc-0x0;var _0x158768=_0x7c25[_0x5835fc];return _0x158768;};'use strict';var apiai=require(_0x57c2('0x0'));var BPromise=require('bluebird');var dialogflow=require(_0x57c2('0x1'));var fs=require('fs');var http=require('http');var https=require(_0x57c2('0x2'));var md5=require('md5');var path=require(_0x57c2('0x3'));var querystring=require(_0x57c2('0x4'));var rp=require(_0x57c2('0x5'));var rs=require('randomstring');var sox=require(_0x57c2('0x6'));var tts=require('google-tts-api');var urlParse=require(_0x57c2('0x7'))['parse'];var util=require(_0x57c2('0x8'));var aws=require('./aws');var google=require('./google');var sestek=require(_0x57c2('0x9'));var tilde=require('./tilde');var logger=require(_0x57c2('0xa'))(_0x57c2('0xb'));var ISPEECH_API=_0x57c2('0xc');function downloadFile(_0x194478,_0x51c679){return new BPromise(function(_0x5621b5,_0xc1cad4){var _0x2d35af=urlParse(_0x194478);var _0x3071d4=_0x2d35af['protocol']===_0x57c2('0xd')?https:http;var _0x3ef879={'host':_0x2d35af[_0x57c2('0xe')],'path':_0x2d35af[_0x57c2('0x3')],'headers':{'user-agent':_0x57c2('0xf')}};_0x3071d4[_0x57c2('0x10')](_0x3ef879,function(_0x26c535){if(_0x26c535[_0x57c2('0x11')]!==0xc8){logger[_0x57c2('0x12')]('request\x20to\x20'+_0x194478+_0x57c2('0x13')+_0x26c535[_0x57c2('0x11')]+'\x20('+_0x26c535[_0x57c2('0x14')]+')');_0xc1cad4(new Error('request\x20to\x20'+_0x194478+_0x57c2('0x13')+_0x26c535[_0x57c2('0x11')]+'\x20('+_0x26c535[_0x57c2('0x14')]+')'));return;}var _0xe27c5e=fs[_0x57c2('0x15')](_0x51c679);_0xe27c5e['on'](_0x57c2('0x16'),function(){logger[_0x57c2('0x17')](_0x57c2('0x18'));_0xe27c5e[_0x57c2('0x19')](_0x5621b5);});_0xe27c5e['on']('error',function(_0x291e8c){fs[_0x57c2('0x1a')](_0x51c679);logger[_0x57c2('0x12')](_0x57c2('0x1b'),_0x291e8c);_0xc1cad4(_0x291e8c);});_0x26c535[_0x57c2('0x1c')](_0xe27c5e);})['on'](_0x57c2('0x12'),function(_0x19486d){logger[_0x57c2('0x12')](_0x19486d);_0xc1cad4(_0x19486d);})['end']();});}function uploadFile(_0x58ad66){return new BPromise(function(_0x15d430,_0x201cc0){var _0x59aac3=urlParse(_0x58ad66);var _0x369b03=_0x59aac3[_0x57c2('0x1d')]===_0x57c2('0xd')?https:http;var _0x49436a={'host':_0x59aac3[_0x57c2('0xe')],'path':_0x59aac3['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x369b03[_0x57c2('0x10')](_0x49436a,function(_0x4e8e33){if(_0x4e8e33[_0x57c2('0x11')]!==0xc8){_0x201cc0(new Error(_0x57c2('0x1e')+_0x58ad66+_0x57c2('0x13')+_0x4e8e33[_0x57c2('0x11')]+'\x20('+_0x4e8e33[_0x57c2('0x14')]+')'));return;}var _0x2ebbb2='';_0x4e8e33['on'](_0x57c2('0x1f'),function(_0x18d84b){_0x2ebbb2+=_0x18d84b;});_0x4e8e33['on'](_0x57c2('0x20'),function(){_0x15d430(_0x2ebbb2);});})['on']('error',function(_0x1954ae){_0x201cc0(_0x1954ae);})[_0x57c2('0x20')]();});}function convertFile(_0x186c37,_0x1ba707){return new BPromise(function(_0x42b9d9,_0x2afcc9){var _0x3a07ba=sox[_0x57c2('0x21')](_0x186c37,_0x1ba707,{'sampleRate':0x1f40,'format':_0x57c2('0x22'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3a07ba['on'](_0x57c2('0x12'),function(_0xeb173b){logger[_0x57c2('0x12')](_0x57c2('0x23'),_0xeb173b);_0x2afcc9(_0xeb173b);});_0x3a07ba['on'](_0x57c2('0x20'),function(){logger[_0x57c2('0x17')](_0x57c2('0x24'));_0x42b9d9();});_0x3a07ba[_0x57c2('0x25')]();});}function base64Decode(_0x3bc0c1,_0x3e1a86){var _0x1a78cd=path[_0x57c2('0x26')](__dirname,_0x57c2('0x27'),rs[_0x57c2('0x28')](0x4)+_0x57c2('0x29'));fs[_0x57c2('0x2a')](_0x1a78cd,_0x3bc0c1,'base64');return convertFile(_0x1a78cd,_0x3e1a86)[_0x57c2('0x2b')](function(){try{fs[_0x57c2('0x1a')](_0x1a78cd);fs['chmodSync'](_0x3e1a86,'777');}catch(_0x594f81){logger[_0x57c2('0x12')](_0x594f81);}return _0x3e1a86[_0x57c2('0x2c')]('.')[0x0];});}function base64Encode(_0x2a794b){var _0x85c7b7=fs[_0x57c2('0x2d')](_0x2a794b);return new Buffer(_0x85c7b7)['toString'](_0x57c2('0x2e'));}exports['googleCloudTTS']=function(_0x125f55,_0x6e8df0,_0x2b3968,_0x332081,_0x2162b6,_0x3f0bca){var _0x16eda1,_0x330ca2;var _0x10f7f2='https://texttospeech.googleapis.com/v1/';var _0x2d8cbe=_0x57c2('0x2f')+_0x125f55;var _0x27bfee={};if(_0x6e8df0==='ssml'){_0x27bfee[_0x57c2('0x30')]={'ssml':_0x2b3968};}else{_0x27bfee[_0x57c2('0x30')]={'text':_0x2b3968};};_0x27bfee[_0x57c2('0x31')]={'languageCode':_0x332081,'ssmlGender':_0x2162b6};_0x27bfee['audioConfig']={'audioEncoding':_0x57c2('0x32'),'sampleRateHertz':0x1f40};var _0x37e390={'url':_0x10f7f2+_0x57c2('0x33')+_0x2d8cbe,'method':'POST','json':!![],'body':_0x27bfee};return rp(_0x37e390)[_0x57c2('0x2b')](function(_0x1d2f6f){return new BPromise(function(_0x3a345b,_0x110a1f){_0x16eda1=path[_0x57c2('0x26')](__dirname,'tmp',rs[_0x57c2('0x28')](0x4)+_0x57c2('0x34'));var _0x15e542=Buffer[_0x57c2('0x35')](_0x1d2f6f[_0x57c2('0x36')],_0x57c2('0x2e'));return fs['writeFile'](_0x16eda1,_0x15e542,function(_0x45368f){_0x110a1f(_0x45368f);},function(_0x12942c){fs[_0x57c2('0x37')](_0x16eda1,_0x57c2('0x38'));_0x3a345b(_0x12942c);});});})['then'](function(_0x51c015){_0x330ca2=path['resolve'](__dirname,'tmp',rs[_0x57c2('0x28')](0x4)+_0x57c2('0x29'));return convertFile(_0x16eda1,_0x330ca2);})['then'](function(){try{fs[_0x57c2('0x1a')](_0x16eda1);fs[_0x57c2('0x37')](_0x330ca2,_0x57c2('0x38'));}catch(_0x302d94){logger[_0x57c2('0x12')](_0x302d94);}logger[_0x57c2('0x17')](_0x57c2('0x39'),_0x330ca2[_0x57c2('0x2c')]('.')[0x0]);return _0x330ca2['split']('.')[0x0];});};exports[_0x57c2('0x3a')]=function(_0x5cd949,_0x12ebf8){var _0x3b35de=_0x57c2('0x3b');var _0x27d1cc,_0x41c869;var _0x5dff17;var _0x5a3389={'encoding':'utf8','method':_0x57c2('0x3c'),'timeout':0x2710,'url':_0x3b35de,'headers':{'Content-Type':_0x57c2('0x3d')},'body':_0x57c2('0x3e')+encodeURIComponent(JSON[_0x57c2('0x3f')]([[[_0x57c2('0x40'),JSON[_0x57c2('0x3f')]([_0x5cd949,_0x12ebf8||'en',![],'null']),null,'generic']]]))};return rp(_0x5a3389)['then'](function(_0x9f29e3){try{_0x5dff17=eval(_0x9f29e3[_0x57c2('0x41')](0x5))[0x0][0x2];}catch(_0x5ab706){throw new Error('parse\x20response\x20failed:\x0a'+_0x9f29e3[_0x57c2('0x1f')]);}if(!_0x5dff17){if(_0x5cd949['length']>0xc8){throw new Error(_0x57c2('0x42'));}else{throw new Error(_0x57c2('0x43')+_0x12ebf8+_0x57c2('0x44'));}}try{_0x5dff17=eval(_0x5dff17)[0x0];}catch(_0x45e875){throw new Error(_0x57c2('0x45')+res['data']);}const _0x4734b3=_0x5dff17;_0x27d1cc=path[_0x57c2('0x26')](__dirname,_0x57c2('0x27'),rs[_0x57c2('0x28')](0x4)+'.mp3');fs[_0x57c2('0x2a')](_0x27d1cc,_0x5dff17,{'encoding':'base64'});_0x41c869=path['resolve'](__dirname,_0x57c2('0x27'),rs['generate'](0x4)+_0x57c2('0x29'));return convertFile(_0x27d1cc,_0x41c869);})[_0x57c2('0x2b')](function(){try{fs[_0x57c2('0x1a')](_0x27d1cc);fs[_0x57c2('0x37')](_0x41c869,'777');}catch(_0x1dae71){logger['error'](_0x1dae71);}logger[_0x57c2('0x17')](_0x57c2('0x46'),_0x41c869[_0x57c2('0x2c')]('.')[0x0]);return _0x41c869[_0x57c2('0x2c')]('.')[0x0];});};exports['googleASR']=function(_0x4c03a3,_0x50d684,_0x4cf9df){return google[_0x57c2('0x47')](_0x4c03a3,_0x50d684,_0x4cf9df)['then'](function(_0x131f4b){logger['info'](_0x131f4b[_0x57c2('0x48')]);return rp(_0x131f4b);})[_0x57c2('0x2b')](function(_0x212755){var _0x1d196b='';var _0x2298e0=0x0;try{fs[_0x57c2('0x1a')](_0x4c03a3);}catch(_0x1321c8){logger[_0x57c2('0x12')](_0x1321c8);}if(_0x212755&&_0x212755[_0x57c2('0x49')]){_0x1d196b=_0x212755[_0x57c2('0x49')][_0x57c2('0x4a')](function(_0x344afe){return _0x344afe&&_0x344afe[_0x57c2('0x4b')][0x0]&&_0x344afe[_0x57c2('0x4b')][0x0][_0x57c2('0x4c')]?_0x344afe[_0x57c2('0x4b')][0x0][_0x57c2('0x4c')]:'';})['join']('\x0a');_0x2298e0=_0x212755[_0x57c2('0x49')][_0x57c2('0x4a')](function(_0x2537ab){return _0x2537ab&&_0x2537ab['alternatives'][0x0]&&_0x2537ab['alternatives'][0x0][_0x57c2('0x4d')]?_0x2537ab[_0x57c2('0x4b')][0x0][_0x57c2('0x4d')]:0x0;})[_0x57c2('0x4e')]('\x0a');}logger['info'](_0x57c2('0x4f'),_0x1d196b);logger[_0x57c2('0x17')](_0x57c2('0x50'),_0x2298e0);return{'transcript':_0x1d196b,'confidence':_0x2298e0};})[_0x57c2('0x51')](function(_0x119ce5){logger['error'](_0x57c2('0x52'),_0x119ce5[_0x57c2('0x11')],_0x119ce5[_0x57c2('0x53')],_0x119ce5[_0x57c2('0x54')]);});};exports[_0x57c2('0x55')]=function(_0x4705a7,_0x429fb4,_0x54b947,_0x221bf1){var _0x5c7a7d=apiai(_0x429fb4,{'language':_0x221bf1||'en'});return _0x5c7a7d[_0x57c2('0x56')](_0x54b947,{'sessionId':md5(_0x4705a7)})[_0x57c2('0x2b')](function(_0x16c120){logger['info'](JSON['stringify'](_0x16c120));return{'source':_0x16c120[_0x57c2('0x57')][_0x57c2('0x58')],'resolvedQuery':_0x16c120['result'][_0x57c2('0x59')],'action':_0x16c120[_0x57c2('0x57')][_0x57c2('0x5a')],'actionIncomplete':_0x16c120[_0x57c2('0x57')][_0x57c2('0x5b')],'speech':_0x16c120['result'][_0x57c2('0x5c')][_0x57c2('0x5d')],'score':_0x16c120['result']['score'],'statusCode':_0x16c120[_0x57c2('0x5e')][_0x57c2('0x5f')],'endConversation':_0x16c120[_0x57c2('0x57')][_0x57c2('0x60')][_0x57c2('0x61')]||![],'isFallbackIntent':_0x16c120['result'][_0x57c2('0x60')][_0x57c2('0x62')]};});};exports[_0x57c2('0x63')]=function(_0x285be8,_0x504bee,_0x24a2ff,_0x45f75b,_0x2a20c2,_0xf048d6){var _0x19027e=_0x45f75b[_0x57c2('0x64')](/\\n/g,'\x0a');var _0x5920aa={'credentials':{'private_key':_0x19027e,'client_email':_0x24a2ff}};var _0x2c96c1=new dialogflow[(_0x57c2('0x65'))](_0x5920aa);var _0x8eb743=_0x2c96c1[_0x57c2('0x66')](_0x504bee,md5(_0x285be8));var _0x4b34b4={'session':_0x8eb743,'queryInput':{'text':{'text':_0x2a20c2,'languageCode':_0xf048d6}}};return _0x2c96c1[_0x57c2('0x67')](_0x4b34b4)[_0x57c2('0x2b')](function(_0x56f868){if(_0x56f868&&_0x56f868[_0x57c2('0x68')]){logger[_0x57c2('0x17')](_0x57c2('0x69'),JSON[_0x57c2('0x3f')](_0x56f868));var _0x18db0d=_0x56f868[0x0];if(_0x18db0d){var _0x3decee={'action':_0x18db0d['queryResult'][_0x57c2('0x5a')],'allRequiredParamsPresent':_0x18db0d['queryResult'][_0x57c2('0x6a')],'endConversation':_0x18db0d[_0x57c2('0x6b')][_0x57c2('0x6c')]&&_0x18db0d[_0x57c2('0x6b')]['diagnosticInfo']['fields']?_0x18db0d['queryResult'][_0x57c2('0x6c')][_0x57c2('0x6d')]['end_conversation']['boolValue']:![],'fulfillmentText':_0x18db0d[_0x57c2('0x6b')][_0x57c2('0x6e')],'intentName':_0x18db0d['queryResult'][_0x57c2('0x6f')][_0x57c2('0x53')],'intentDisplayName':_0x18db0d[_0x57c2('0x6b')][_0x57c2('0x6f')][_0x57c2('0x70')],'isFallbackIntent':_0x18db0d[_0x57c2('0x6b')][_0x57c2('0x6f')][_0x57c2('0x71')],'languageCode':_0x18db0d[_0x57c2('0x6b')]['languageCode'],'queryText':_0x18db0d[_0x57c2('0x6b')][_0x57c2('0x72')],'responseId':_0x18db0d[_0x57c2('0x73')],'score':_0x18db0d[_0x57c2('0x6b')][_0x57c2('0x74')],'speech':_0x18db0d[_0x57c2('0x6b')][_0x57c2('0x6e')],'providerResponse':JSON[_0x57c2('0x3f')](_0x56f868)};return _0x3decee;}}});};exports[_0x57c2('0x75')]=function(_0x330dc8,_0x38fae0,_0x544f1c,_0x46e37a){return tilde[_0x57c2('0x47')](_0x330dc8,_0x38fae0,_0x544f1c,_0x46e37a)['then'](function(_0x1a23e1){try{fs[_0x57c2('0x1a')](_0x330dc8);}catch(_0x4db35a){logger[_0x57c2('0x12')](_0x4db35a);}logger[_0x57c2('0x17')](_0x57c2('0x76'),_0x1a23e1['transcript']);logger[_0x57c2('0x17')](_0x57c2('0x77'),_0x1a23e1[_0x57c2('0x4d')]);return _0x1a23e1;});};exports[_0x57c2('0x78')]=function(_0x2240a3,_0x5ce66f,_0x50a5fc,_0x479ccb,_0x4689e2,_0xc545aa){var _0x344b65=path[_0x57c2('0x26')](__dirname,_0x57c2('0x27'),rs[_0x57c2('0x28')](0x4)+_0x57c2('0x34'));var _0x3ff275;return aws['polly'](_0x2240a3,_0x5ce66f,_0x50a5fc,_0x479ccb,_0x4689e2,_0xc545aa,_0x344b65)[_0x57c2('0x2b')](function(){_0x3ff275=path[_0x57c2('0x26')](__dirname,_0x57c2('0x27'),rs[_0x57c2('0x28')](0x4)+'.wav');return convertFile(_0x344b65,_0x3ff275);})[_0x57c2('0x2b')](function(){try{fs[_0x57c2('0x1a')](_0x344b65);fs[_0x57c2('0x37')](_0x3ff275,_0x57c2('0x38'));}catch(_0x33191d){logger[_0x57c2('0x12')](_0x33191d);}return _0x3ff275['split']('.')[0x0];});};exports[_0x57c2('0x79')]=function(_0x371d66,_0x462cda,_0x16cf74,_0x4d0300,_0xb380d1,_0x4d3ea4){return aws[_0x57c2('0x7a')](_0x371d66,_0x462cda,_0x16cf74,_0x4d0300,_0xb380d1,_0x4d3ea4)[_0x57c2('0x2b')](function(_0x4a7c57){logger[_0x57c2('0x17')](JSON['stringify'](_0x4a7c57));return _0x4a7c57;});};exports[_0x57c2('0x7b')]=function(_0x1b0ed6,_0x27e95f,_0x2bc381,_0x22896e){var _0x458d0a=util[_0x57c2('0x7c')](_0x57c2('0x7d'),ISPEECH_API,_0x1b0ed6,encodeURIComponent(_0x27e95f),_0x2bc381,_0x22896e);var _0x1cc920=path[_0x57c2('0x26')](__dirname,_0x57c2('0x27'),rs[_0x57c2('0x28')](0x4)+_0x57c2('0x34'));var _0xa1f7e6;return downloadFile(_0x458d0a,_0x1cc920)[_0x57c2('0x2b')](function(){_0xa1f7e6=path[_0x57c2('0x26')](__dirname,_0x57c2('0x27'),rs['generate'](0x4)+_0x57c2('0x29'));return convertFile(_0x1cc920,_0xa1f7e6);})[_0x57c2('0x2b')](function(){try{fs[_0x57c2('0x1a')](_0x1cc920);fs['chmodSync'](_0xa1f7e6,_0x57c2('0x38'));}catch(_0x33cc84){logger[_0x57c2('0x12')](_0x33cc84);}return _0xa1f7e6[_0x57c2('0x2c')]('.')[0x0];});};exports['ispeechASR']=function(_0x1cf145,_0x11204d,_0x1880eb,_0x41ed23){var _0x5806bf=util['format'](_0x57c2('0x7e'),ISPEECH_API,_0x11204d,_0x1880eb,base64Encode(_0x1cf145),_0x41ed23?util['format'](_0x57c2('0x7f'),encodeURIComponent(_0x41ed23)):_0x57c2('0x80'));return uploadFile(_0x5806bf)[_0x57c2('0x2b')](function(_0x2ffbfd){return querystring[_0x57c2('0x81')](_0x2ffbfd);});};exports['sestekNDA']=function(_0x219856,_0x43cad7){return sestek['nda'](_0x219856,_0x43cad7)[_0x57c2('0x2b')](function(_0x41fd5e){logger[_0x57c2('0x17')](JSON[_0x57c2('0x3f')](_0x41fd5e));var _0x5019d4={'speech':_0x41fd5e[_0x57c2('0x82')],'action':_0x41fd5e['channelData']?_0x41fd5e['channelData'][_0x57c2('0x83')]:undefined,'actiondata':_0x41fd5e['channelData']?_0x41fd5e['channelData'][_0x57c2('0x84')]:undefined};if(_0x41fd5e[_0x57c2('0x85')]&&_0x41fd5e[_0x57c2('0x85')][_0x57c2('0x86')]){return base64Decode(_0x41fd5e['channelData'][_0x57c2('0x86')][_0x57c2('0x87')],path[_0x57c2('0x26')](__dirname,_0x57c2('0x27'),rs[_0x57c2('0x28')](0x4)+_0x57c2('0x29')))[_0x57c2('0x2b')](function(_0x8acb9b){_0x5019d4[_0x57c2('0x88')]=_0x8acb9b;return _0x5019d4;});}return _0x5019d4;});};exports[_0x57c2('0x89')]=function(){return __dirname;}; \ No newline at end of file +var _0xe623=['finish\x20to\x20convert','resolve','base64','then','chmodSync','777','split','readFileSync','googleCloudTTS','?key=','ssml','input','voice','MP3','POST','tmp','generate','from','audioContent','.wav','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','stringify','jQ1olc','null','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','.mp3','goggleTTS\x20path','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','resolvedQuery','action','fulfillment','speech','status','metadata','endConversation','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','intent','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','fulfillmentText','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','polly','awsLex','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','nda','channelData','CustomAction','AudioFromTts','Data','audiofile','dirName','bluebird','md5','path','querystring','request-promise','randomstring','sox','google-tts-api','url','parse','./tilde','../../../config/logger','protocol','https:','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','close','unlink','download\x20error','pipe','host','data','end','transcode','wav','info'];(function(_0x1570d7,_0x3e242f){var _0x30a6f5=function(_0x34d6d2){while(--_0x34d6d2){_0x1570d7['push'](_0x1570d7['shift']());}};_0x30a6f5(++_0x3e242f);}(_0xe623,0x165));var _0x3e62=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0xe623[_0x1762b4];return _0x29beda;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0x3e62('0x0'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require('http');var https=require('https');var md5=require(_0x3e62('0x1'));var path=require(_0x3e62('0x2'));var querystring=require(_0x3e62('0x3'));var rp=require(_0x3e62('0x4'));var rs=require(_0x3e62('0x5'));var sox=require(_0x3e62('0x6'));var tts=require(_0x3e62('0x7'));var urlParse=require(_0x3e62('0x8'))[_0x3e62('0x9')];var util=require('util');var aws=require('./aws');var google=require('./google');var sestek=require('./sestek');var tilde=require(_0x3e62('0xa'));var logger=require(_0x3e62('0xb'))('agi');var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x1ec71e,_0x5084cb){return new BPromise(function(_0x1953c1,_0x257685){var _0x3943b6=urlParse(_0x1ec71e);var _0x4e8dbb=_0x3943b6[_0x3e62('0xc')]===_0x3e62('0xd')?https:http;var _0x4ec06c={'host':_0x3943b6['host'],'path':_0x3943b6['path'],'headers':{'user-agent':_0x3e62('0xe')}};_0x4e8dbb[_0x3e62('0xf')](_0x4ec06c,function(_0x19a3d6){if(_0x19a3d6[_0x3e62('0x10')]!==0xc8){logger[_0x3e62('0x11')](_0x3e62('0x12')+_0x1ec71e+_0x3e62('0x13')+_0x19a3d6[_0x3e62('0x10')]+'\x20('+_0x19a3d6[_0x3e62('0x14')]+')');_0x257685(new Error(_0x3e62('0x12')+_0x1ec71e+_0x3e62('0x13')+_0x19a3d6[_0x3e62('0x10')]+'\x20('+_0x19a3d6[_0x3e62('0x14')]+')'));return;}var _0xbf9bc3=fs[_0x3e62('0x15')](_0x5084cb);_0xbf9bc3['on'](_0x3e62('0x16'),function(){logger['info']('finish\x20download\x20file');_0xbf9bc3[_0x3e62('0x17')](_0x1953c1);});_0xbf9bc3['on'](_0x3e62('0x11'),function(_0x115f53){fs[_0x3e62('0x18')](_0x5084cb);logger['error'](_0x3e62('0x19'),_0x115f53);_0x257685(_0x115f53);});_0x19a3d6[_0x3e62('0x1a')](_0xbf9bc3);})['on'](_0x3e62('0x11'),function(_0x4d9e2c){logger[_0x3e62('0x11')](_0x4d9e2c);_0x257685(_0x4d9e2c);})['end']();});}function uploadFile(_0x4fac60){return new BPromise(function(_0x4bd8a9,_0xfd8670){var _0x29f4b1=urlParse(_0x4fac60);var _0x5af928=_0x29f4b1['protocol']===_0x3e62('0xd')?https:http;var _0x13ed0d={'host':_0x29f4b1[_0x3e62('0x1b')],'path':_0x29f4b1[_0x3e62('0x2')],'headers':{'user-agent':_0x3e62('0xe')}};_0x5af928['get'](_0x13ed0d,function(_0x2fdc7d){if(_0x2fdc7d[_0x3e62('0x10')]!==0xc8){_0xfd8670(new Error(_0x3e62('0x12')+_0x4fac60+_0x3e62('0x13')+_0x2fdc7d[_0x3e62('0x10')]+'\x20('+_0x2fdc7d[_0x3e62('0x14')]+')'));return;}var _0x5e4723='';_0x2fdc7d['on'](_0x3e62('0x1c'),function(_0x2ed7b3){_0x5e4723+=_0x2ed7b3;});_0x2fdc7d['on'](_0x3e62('0x1d'),function(){_0x4bd8a9(_0x5e4723);});})['on'](_0x3e62('0x11'),function(_0x3f0230){_0xfd8670(_0x3f0230);})['end']();});}function convertFile(_0x275fe2,_0x462457){return new BPromise(function(_0x13b89f,_0x29f09d){var _0xa91249=sox[_0x3e62('0x1e')](_0x275fe2,_0x462457,{'sampleRate':0x1f40,'format':_0x3e62('0x1f'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xa91249['on']('error',function(_0x24eec2){logger['error']('error\x20convert',_0x24eec2);_0x29f09d(_0x24eec2);});_0xa91249['on'](_0x3e62('0x1d'),function(){logger[_0x3e62('0x20')](_0x3e62('0x21'));_0x13b89f();});_0xa91249['start']();});}function base64Decode(_0x4eb049,_0xa3aaba){var _0x3fb899=path[_0x3e62('0x22')](__dirname,'tmp',rs['generate'](0x4)+'.wav');fs['writeFileSync'](_0x3fb899,_0x4eb049,_0x3e62('0x23'));return convertFile(_0x3fb899,_0xa3aaba)[_0x3e62('0x24')](function(){try{fs[_0x3e62('0x18')](_0x3fb899);fs[_0x3e62('0x25')](_0xa3aaba,_0x3e62('0x26'));}catch(_0x4a8437){logger[_0x3e62('0x11')](_0x4a8437);}return _0xa3aaba[_0x3e62('0x27')]('.')[0x0];});}function base64Encode(_0xd2df45){var _0x374141=fs[_0x3e62('0x28')](_0xd2df45);return new Buffer(_0x374141)['toString'](_0x3e62('0x23'));}exports[_0x3e62('0x29')]=function(_0x20118e,_0x40007d,_0x50d060,_0x16e250,_0xca0b0f,_0x388896){var _0x99c53c,_0x5463fa;var _0x3e42ac='https://texttospeech.googleapis.com/v1/';var _0x406576=_0x3e62('0x2a')+_0x20118e;var _0x337a95={};if(_0x40007d===_0x3e62('0x2b')){_0x337a95[_0x3e62('0x2c')]={'ssml':_0x50d060};}else{_0x337a95[_0x3e62('0x2c')]={'text':_0x50d060};};_0x337a95[_0x3e62('0x2d')]={'languageCode':_0x16e250,'ssmlGender':_0xca0b0f};_0x337a95['audioConfig']={'audioEncoding':_0x3e62('0x2e'),'sampleRateHertz':0x1f40};var _0x55f132={'url':_0x3e42ac+'text:synthesize'+_0x406576,'method':_0x3e62('0x2f'),'json':!![],'body':_0x337a95};return rp(_0x55f132)[_0x3e62('0x24')](function(_0x3a08b7){return new BPromise(function(_0x21dfc0,_0x124e31){_0x99c53c=path[_0x3e62('0x22')](__dirname,_0x3e62('0x30'),rs[_0x3e62('0x31')](0x4)+'.mp3');var _0x4ba118=Buffer[_0x3e62('0x32')](_0x3a08b7[_0x3e62('0x33')],_0x3e62('0x23'));return fs['writeFile'](_0x99c53c,_0x4ba118,function(_0x303d31){_0x124e31(_0x303d31);},function(_0x1dc1e1){fs[_0x3e62('0x25')](_0x99c53c,_0x3e62('0x26'));_0x21dfc0(_0x1dc1e1);});});})[_0x3e62('0x24')](function(_0x1972f4){_0x5463fa=path[_0x3e62('0x22')](__dirname,_0x3e62('0x30'),rs[_0x3e62('0x31')](0x4)+_0x3e62('0x34'));return convertFile(_0x99c53c,_0x5463fa);})[_0x3e62('0x24')](function(){try{fs['unlink'](_0x99c53c);fs['chmodSync'](_0x5463fa,'777');}catch(_0x3dbda9){logger[_0x3e62('0x11')](_0x3dbda9);}logger[_0x3e62('0x20')](_0x3e62('0x35'),_0x5463fa['split']('.')[0x0]);return _0x5463fa[_0x3e62('0x27')]('.')[0x0];});};exports[_0x3e62('0x36')]=function(_0x2184ca,_0x2b08fa){var _0x58c21a=_0x3e62('0x37');var _0x28a93f,_0x408941;var _0x2f852a;var _0x1a9785={'encoding':_0x3e62('0x38'),'method':_0x3e62('0x2f'),'timeout':0x2710,'url':_0x58c21a,'headers':{'Content-Type':_0x3e62('0x39')},'body':'f.req='+encodeURIComponent(JSON[_0x3e62('0x3a')]([[[_0x3e62('0x3b'),JSON[_0x3e62('0x3a')]([_0x2184ca,_0x2b08fa||'en',![],_0x3e62('0x3c')]),null,'generic']]]))};return rp(_0x1a9785)['then'](function(_0x3bfb98){try{_0x2f852a=eval(_0x3bfb98[_0x3e62('0x3d')](0x5))[0x0][0x2];}catch(_0xbf89ca){throw new Error(_0x3e62('0x3e')+_0x3bfb98[_0x3e62('0x1c')]);}if(!_0x2f852a){if(_0x2184ca[_0x3e62('0x3f')]>0xc8){throw new Error(_0x3e62('0x40'));}else{throw new Error(_0x3e62('0x41')+_0x2b08fa+_0x3e62('0x42'));}}try{_0x2f852a=eval(_0x2f852a)[0x0];}catch(_0x49f032){throw new Error(_0x3e62('0x3e')+res[_0x3e62('0x1c')]);}const _0x27f530=_0x2f852a;_0x28a93f=path[_0x3e62('0x22')](__dirname,_0x3e62('0x30'),rs[_0x3e62('0x31')](0x4)+_0x3e62('0x43'));fs['writeFileSync'](_0x28a93f,_0x2f852a,{'encoding':_0x3e62('0x23')});_0x408941=path['resolve'](__dirname,_0x3e62('0x30'),rs[_0x3e62('0x31')](0x4)+_0x3e62('0x34'));return convertFile(_0x28a93f,_0x408941);})[_0x3e62('0x24')](function(){try{fs[_0x3e62('0x18')](_0x28a93f);fs[_0x3e62('0x25')](_0x408941,'777');}catch(_0x4d2567){logger[_0x3e62('0x11')](_0x4d2567);}logger[_0x3e62('0x20')](_0x3e62('0x44'),_0x408941[_0x3e62('0x27')]('.')[0x0]);return _0x408941['split']('.')[0x0];});};exports['googleASR']=function(_0x22f859,_0x5005ea,_0x29e283){return google[_0x3e62('0x45')](_0x22f859,_0x5005ea,_0x29e283)['then'](function(_0x48f2f3){logger[_0x3e62('0x20')](_0x48f2f3[_0x3e62('0x46')]);return rp(_0x48f2f3);})[_0x3e62('0x24')](function(_0x4361b0){var _0x2d7b38='';var _0x413d24=0x0;try{fs[_0x3e62('0x18')](_0x22f859);}catch(_0x52088c){logger['error'](_0x52088c);}if(_0x4361b0&&_0x4361b0[_0x3e62('0x47')]){_0x2d7b38=_0x4361b0[_0x3e62('0x47')][_0x3e62('0x48')](function(_0x2720b8){return _0x2720b8&&_0x2720b8[_0x3e62('0x49')][0x0]&&_0x2720b8[_0x3e62('0x49')][0x0][_0x3e62('0x4a')]?_0x2720b8[_0x3e62('0x49')][0x0][_0x3e62('0x4a')]:'';})[_0x3e62('0x4b')]('\x0a');_0x413d24=_0x4361b0['results'][_0x3e62('0x48')](function(_0x3ed9f6){return _0x3ed9f6&&_0x3ed9f6[_0x3e62('0x49')][0x0]&&_0x3ed9f6['alternatives'][0x0]['confidence']?_0x3ed9f6[_0x3e62('0x49')][0x0][_0x3e62('0x4c')]:0x0;})[_0x3e62('0x4b')]('\x0a');}logger[_0x3e62('0x20')](_0x3e62('0x4d'),_0x2d7b38);logger[_0x3e62('0x20')](_0x3e62('0x4e'),_0x413d24);return{'transcript':_0x2d7b38,'confidence':_0x413d24};})['catch'](function(_0x452422){logger[_0x3e62('0x11')](_0x3e62('0x4f'),_0x452422[_0x3e62('0x10')],_0x452422[_0x3e62('0x50')],_0x452422[_0x3e62('0x51')]);});};exports[_0x3e62('0x52')]=function(_0xaec69f,_0x30e71e,_0x55ec36,_0x32a786){var _0x9195e9=apiai(_0x30e71e,{'language':_0x32a786||'en'});return _0x9195e9[_0x3e62('0x53')](_0x55ec36,{'sessionId':md5(_0xaec69f)})[_0x3e62('0x24')](function(_0x5e259b){logger['info'](JSON['stringify'](_0x5e259b));return{'source':_0x5e259b[_0x3e62('0x54')]['source'],'resolvedQuery':_0x5e259b['result'][_0x3e62('0x55')],'action':_0x5e259b[_0x3e62('0x54')][_0x3e62('0x56')],'actionIncomplete':_0x5e259b['result']['actionIncomplete'],'speech':_0x5e259b['result'][_0x3e62('0x57')][_0x3e62('0x58')],'score':_0x5e259b[_0x3e62('0x54')]['score'],'statusCode':_0x5e259b[_0x3e62('0x59')]['code'],'endConversation':_0x5e259b[_0x3e62('0x54')][_0x3e62('0x5a')][_0x3e62('0x5b')]||![],'isFallbackIntent':_0x5e259b['result']['metadata']['isFallbackIntent']};});};exports[_0x3e62('0x5c')]=function(_0x2bfb1b,_0x56f201,_0x248e0e,_0x56fc16,_0x3d2740,_0x453492){var _0x3ef144=_0x56fc16[_0x3e62('0x5d')](/\\n/g,'\x0a');var _0x5b6a21={'credentials':{'private_key':_0x3ef144,'client_email':_0x248e0e}};var _0x189ad3=new dialogflow[(_0x3e62('0x5e'))](_0x5b6a21);var _0x59c8f8=_0x189ad3[_0x3e62('0x5f')](_0x56f201,md5(_0x2bfb1b));var _0x31284d={'session':_0x59c8f8,'queryInput':{'text':{'text':_0x3d2740,'languageCode':_0x453492}}};return _0x189ad3[_0x3e62('0x60')](_0x31284d)[_0x3e62('0x24')](function(_0x44c13a){if(_0x44c13a&&_0x44c13a[_0x3e62('0x3f')]){logger[_0x3e62('0x20')](_0x3e62('0x61'),JSON['stringify'](_0x44c13a));var _0x51715e=_0x44c13a[0x0];if(_0x51715e){var _0x3847b8={'action':_0x51715e[_0x3e62('0x62')][_0x3e62('0x56')],'allRequiredParamsPresent':_0x51715e['queryResult'][_0x3e62('0x63')],'endConversation':_0x51715e['queryResult'][_0x3e62('0x64')]&&_0x51715e['queryResult'][_0x3e62('0x64')][_0x3e62('0x65')]?_0x51715e[_0x3e62('0x62')][_0x3e62('0x64')][_0x3e62('0x65')][_0x3e62('0x66')][_0x3e62('0x67')]:![],'fulfillmentText':_0x51715e['queryResult']['fulfillmentText'],'intentName':_0x51715e[_0x3e62('0x62')][_0x3e62('0x68')]['name'],'intentDisplayName':_0x51715e[_0x3e62('0x62')]['intent'][_0x3e62('0x69')],'isFallbackIntent':_0x51715e['queryResult']['intent'][_0x3e62('0x6a')],'languageCode':_0x51715e[_0x3e62('0x62')][_0x3e62('0x6b')],'queryText':_0x51715e['queryResult'][_0x3e62('0x6c')],'responseId':_0x51715e[_0x3e62('0x6d')],'score':_0x51715e[_0x3e62('0x62')][_0x3e62('0x6e')],'speech':_0x51715e['queryResult'][_0x3e62('0x6f')],'providerResponse':JSON[_0x3e62('0x3a')](_0x44c13a)};return _0x3847b8;}}});};exports[_0x3e62('0x70')]=function(_0x1a717a,_0xbfa936,_0x1d635b,_0x298743){return tilde['asr'](_0x1a717a,_0xbfa936,_0x1d635b,_0x298743)[_0x3e62('0x24')](function(_0x583e32){try{fs[_0x3e62('0x18')](_0x1a717a);}catch(_0x4a06a6){logger[_0x3e62('0x11')](_0x4a06a6);}logger[_0x3e62('0x20')](_0x3e62('0x71'),_0x583e32[_0x3e62('0x4a')]);logger['info'](_0x3e62('0x72'),_0x583e32[_0x3e62('0x4c')]);return _0x583e32;});};exports['awsPolly']=function(_0x1e03bf,_0xf694b0,_0x4f5653,_0x3326a8,_0x15a1f9,_0x2c1008){var _0x631e92=path[_0x3e62('0x22')](__dirname,_0x3e62('0x30'),rs[_0x3e62('0x31')](0x4)+'.mp3');var _0x45eab3;return aws[_0x3e62('0x73')](_0x1e03bf,_0xf694b0,_0x4f5653,_0x3326a8,_0x15a1f9,_0x2c1008,_0x631e92)['then'](function(){_0x45eab3=path['resolve'](__dirname,_0x3e62('0x30'),rs[_0x3e62('0x31')](0x4)+_0x3e62('0x34'));return convertFile(_0x631e92,_0x45eab3);})[_0x3e62('0x24')](function(){try{fs[_0x3e62('0x18')](_0x631e92);fs[_0x3e62('0x25')](_0x45eab3,'777');}catch(_0x1b2868){logger[_0x3e62('0x11')](_0x1b2868);}return _0x45eab3[_0x3e62('0x27')]('.')[0x0];});};exports[_0x3e62('0x74')]=function(_0x4649db,_0x2dc21c,_0x4aa034,_0x3c695d,_0x36bea6,_0x54c8f6){return aws['lex'](_0x4649db,_0x2dc21c,_0x4aa034,_0x3c695d,_0x36bea6,_0x54c8f6)[_0x3e62('0x24')](function(_0x23ac6b){logger[_0x3e62('0x20')](JSON[_0x3e62('0x3a')](_0x23ac6b));return _0x23ac6b;});};exports[_0x3e62('0x75')]=function(_0x13099e,_0x5e3960,_0x397da0,_0x2e67bb){var _0x754700=util[_0x3e62('0x76')](_0x3e62('0x77'),ISPEECH_API,_0x13099e,encodeURIComponent(_0x5e3960),_0x397da0,_0x2e67bb);var _0x555b2d=path[_0x3e62('0x22')](__dirname,_0x3e62('0x30'),rs['generate'](0x4)+_0x3e62('0x43'));var _0x2653af;return downloadFile(_0x754700,_0x555b2d)[_0x3e62('0x24')](function(){_0x2653af=path[_0x3e62('0x22')](__dirname,'tmp',rs[_0x3e62('0x31')](0x4)+_0x3e62('0x34'));return convertFile(_0x555b2d,_0x2653af);})[_0x3e62('0x24')](function(){try{fs[_0x3e62('0x18')](_0x555b2d);fs[_0x3e62('0x25')](_0x2653af,_0x3e62('0x26'));}catch(_0xa94578){logger[_0x3e62('0x11')](_0xa94578);}return _0x2653af[_0x3e62('0x27')]('.')[0x0];});};exports[_0x3e62('0x78')]=function(_0x2cc139,_0x3827f7,_0x530851,_0x2025a0){var _0xe8ef2a=util[_0x3e62('0x76')](_0x3e62('0x79'),ISPEECH_API,_0x3827f7,_0x530851,base64Encode(_0x2cc139),_0x2025a0?util[_0x3e62('0x76')](_0x3e62('0x7a'),encodeURIComponent(_0x2025a0)):'freeform=3');return uploadFile(_0xe8ef2a)[_0x3e62('0x24')](function(_0x280e8f){return querystring[_0x3e62('0x9')](_0x280e8f);});};exports['sestekNDA']=function(_0x2b5e83,_0x379cb1){return sestek[_0x3e62('0x7b')](_0x2b5e83,_0x379cb1)[_0x3e62('0x24')](function(_0x1eda46){logger[_0x3e62('0x20')](JSON[_0x3e62('0x3a')](_0x1eda46));var _0x12a897={'speech':_0x1eda46['text'],'action':_0x1eda46[_0x3e62('0x7c')]?_0x1eda46['channelData'][_0x3e62('0x7d')]:undefined,'actiondata':_0x1eda46[_0x3e62('0x7c')]?_0x1eda46[_0x3e62('0x7c')]['CustomActionData']:undefined};if(_0x1eda46['channelData']&&_0x1eda46[_0x3e62('0x7c')]['AudioFromTts']){return base64Decode(_0x1eda46['channelData'][_0x3e62('0x7e')][_0x3e62('0x7f')],path['resolve'](__dirname,_0x3e62('0x30'),rs['generate'](0x4)+'.wav'))[_0x3e62('0x24')](function(_0x3474ce){_0x12a897[_0x3e62('0x80')]=_0x3474ce;return _0x12a897;});}return _0x12a897;});};exports[_0x3e62('0x81')]=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 9db48b6..8f34e03 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 _0x7037=['./nda'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7037,0xf9));var _0x7703=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x7037[_0x2070da];return _0x4f9fe1;};var nda=require(_0x7703('0x0'));module['exports']={'nda':nda}; \ No newline at end of file +var nda=require('./nda');module['exports']={'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 924c8d7..a09b321 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 _0x280f=['custom_action_data','stringify','request-promise','../../../../../config/logger','agi','exports','POST','ndauth_url','/token','password','username','resolve','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','message','Nda','uniqueid','callerid','calleridname','dnid','extension','text','Bearer\x20','access_token','project','channelData','ProjectName','ndagenerate_audio','body','audio/wav','custom_action','CustomAction'];(function(_0x4bd97b,_0x4f80f3){var _0x4e2871=function(_0x4b8fa4){while(--_0x4b8fa4){_0x4bd97b['push'](_0x4bd97b['shift']());}};_0x4e2871(++_0x4f80f3);}(_0x280f,0xe2));var _0xf280=function(_0x367361,_0x311488){_0x367361=_0x367361-0x0;var _0x195d2d=_0x280f[_0x367361];return _0x195d2d;};'use strict';var rp=require(_0xf280('0x0'));var url=require('url');var logger=require(_0xf280('0x1'))(_0xf280('0x2'));module[_0xf280('0x3')]=function(_0x2d0377,_0x436dd1){var _0x348341={'method':_0xf280('0x4'),'uri':url['resolve'](_0x436dd1[_0xf280('0x5')],_0xf280('0x6')),'form':{'grant_type':_0xf280('0x7'),'username':_0x436dd1[_0xf280('0x8')],'password':_0x436dd1[_0xf280('0x7')]},'json':!![]};return rp(_0x348341)['then'](function(_0x3de766){var _0x4392c5={'method':_0xf280('0x4'),'uri':url[_0xf280('0x9')](_0x436dd1[_0xf280('0xa')],_0xf280('0xb')),'body':{'type':_0x436dd1['ndaactivity_type']||_0xf280('0xc'),'channelId':_0xf280('0xd'),'conversation':{'id':_0x2d0377[_0xf280('0xe')]},'from':{'id':_0x2d0377[_0xf280('0xf')],'name':_0x2d0377[_0xf280('0x10')]},'recipient':{'id':_0x2d0377[_0xf280('0x11')],'name':_0x2d0377[_0xf280('0x12')]},'text':_0x436dd1[_0xf280('0x13')],'channelData':{}},'headers':{'Authorization':_0xf280('0x14')+_0x3de766[_0xf280('0x15')]},'json':!![]};if(_0x436dd1[_0xf280('0x16')]){_0x4392c5['body'][_0xf280('0x17')][_0xf280('0x18')]=_0x436dd1[_0xf280('0x16')];}if(_0x436dd1[_0xf280('0x19')]=='1'){_0x4392c5[_0xf280('0x1a')][_0xf280('0x17')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xf280('0x1b')};}if(_0x436dd1[_0xf280('0x1c')]){_0x4392c5[_0xf280('0x1a')][_0xf280('0x17')][_0xf280('0x1d')]=_0x436dd1[_0xf280('0x1c')];if(_0x436dd1[_0xf280('0x1e')]){_0x4392c5['body']['channelData']['CustomActionData']=_0x436dd1[_0xf280('0x1e')];}}logger['info'](JSON[_0xf280('0x1f')](_0x4392c5));return rp(_0x4392c5);});}; \ No newline at end of file +var _0x49e9=['text','Bearer\x20','access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','CustomAction','custom_action','custom_action_data','info','stringify','request-promise','url','agi','exports','POST','ndauth_url','/token','password','then','resolve','ndassistant_url','ndaactivity_type','Nda','uniqueid','callerid','dnid','extension'];(function(_0x17f115,_0x5710cb){var _0x5587f4=function(_0x2289ca){while(--_0x2289ca){_0x17f115['push'](_0x17f115['shift']());}};_0x5587f4(++_0x5710cb);}(_0x49e9,0x10f));var _0x949e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x49e9[_0x20a584];return _0x4b41a8;};'use strict';var rp=require(_0x949e('0x0'));var url=require(_0x949e('0x1'));var logger=require('../../../../../config/logger')(_0x949e('0x2'));module[_0x949e('0x3')]=function(_0x259795,_0x5c303a){var _0x4f1295={'method':_0x949e('0x4'),'uri':url['resolve'](_0x5c303a[_0x949e('0x5')],_0x949e('0x6')),'form':{'grant_type':_0x949e('0x7'),'username':_0x5c303a['username'],'password':_0x5c303a[_0x949e('0x7')]},'json':!![]};return rp(_0x4f1295)[_0x949e('0x8')](function(_0xfc4f8a){var _0x34ee57={'method':_0x949e('0x4'),'uri':url[_0x949e('0x9')](_0x5c303a[_0x949e('0xa')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x5c303a[_0x949e('0xb')]||'message','channelId':_0x949e('0xc'),'conversation':{'id':_0x259795[_0x949e('0xd')]},'from':{'id':_0x259795[_0x949e('0xe')],'name':_0x259795['calleridname']},'recipient':{'id':_0x259795[_0x949e('0xf')],'name':_0x259795[_0x949e('0x10')]},'text':_0x5c303a[_0x949e('0x11')],'channelData':{}},'headers':{'Authorization':_0x949e('0x12')+_0xfc4f8a[_0x949e('0x13')]},'json':!![]};if(_0x5c303a[_0x949e('0x14')]){_0x34ee57[_0x949e('0x15')][_0x949e('0x16')][_0x949e('0x17')]=_0x5c303a[_0x949e('0x14')];}if(_0x5c303a[_0x949e('0x18')]=='1'){_0x34ee57[_0x949e('0x15')][_0x949e('0x16')][_0x949e('0x19')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x949e('0x1a')};}if(_0x5c303a['custom_action']){_0x34ee57[_0x949e('0x15')][_0x949e('0x16')][_0x949e('0x1b')]=_0x5c303a[_0x949e('0x1c')];if(_0x5c303a['custom_action_data']){_0x34ee57[_0x949e('0x15')][_0x949e('0x16')]['CustomActionData']=_0x5c303a[_0x949e('0x1d')];}}logger[_0x949e('0x1e')](JSON[_0x949e('0x1f')](_0x34ee57));return rp(_0x34ee57);});}; \ 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 727913d..c1173a2 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 _0x973b=['./lib/api','exports'];(function(_0x52d7df,_0x5d5742){var _0x6163fc=function(_0x79d617){while(--_0x79d617){_0x52d7df['push'](_0x52d7df['shift']());}};_0x6163fc(++_0x5d5742);}(_0x973b,0x1f0));var _0xb973=function(_0x47ca3b,_0x36627d){_0x47ca3b=_0x47ca3b-0x0;var _0x49a632=_0x973b[_0x47ca3b];return _0x49a632;};'use strict';var asr=require(_0xb973('0x0'));module[_0xb973('0x1')]=function(_0x68b48,_0x5e9808,_0x15d7a1,_0x21b1c2){return asr(_0x68b48,_0x5e9808,_0x15d7a1,_0x21b1c2);}; \ No newline at end of file +var _0xc357=['exports','./lib/api'];(function(_0x46f404,_0x1e37d7){var _0x6a62ea=function(_0x388828){while(--_0x388828){_0x46f404['push'](_0x46f404['shift']());}};_0x6a62ea(++_0x1e37d7);}(_0xc357,0x137));var _0x7c35=function(_0x1fd003,_0x1a81cc){_0x1fd003=_0x1fd003-0x0;var _0x243afb=_0xc357[_0x1fd003];return _0x243afb;};'use strict';var asr=require(_0x7c35('0x0'));module[_0x7c35('0x1')]=function(_0x467b6d,_0x38e5f7,_0x2742d4,_0x3e2273){return asr(_0x467b6d,_0x38e5f7,_0x2742d4,_0x3e2273);}; \ 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 95d6dca..8ec373c 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 _0x077c=['error','terminate','parse','status','result','hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','close','bluebird','moment','crypto','../../../../../../config/logger','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','stringify','createReadStream','data','send','EOS'];(function(_0x36a537,_0xbc7ef7){var _0x409654=function(_0x350a89){while(--_0x350a89){_0x36a537['push'](_0x36a537['shift']());}};_0x409654(++_0xbc7ef7);}(_0x077c,0xb4));var _0xc077=function(_0x3f0e35,_0x45410b){_0x3f0e35=_0x3f0e35-0x0;var _0x21f962=_0x077c[_0x3f0e35];return _0x21f962;};'use strict';var BPromise=require(_0xc077('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xc077('0x1'));var crypto=require(_0xc077('0x2'));var logger=require(_0xc077('0x3'))('agi');module[_0xc077('0x4')]=function(_0x176aa9,_0x23499f,_0x9064d0,_0xe99007){return new BPromise(function(_0x452d7f,_0x9b1db2){logger[_0xc077('0x5')](_0xc077('0x6'),_0xe99007||_0xc077('0x7'));var _0x4a2c8f=new WebSocket(_0xe99007||_0xc077('0x7'),{'perMessageDeflate':![]});var _0x3f234f='';var _0x29cc72='0';var _0x178515='1';var _0x572ae2=_0xc077('0x8');function _0x5c4d25(_0x4e9e79){var _0x2d9fa1=crypto[_0xc077('0x9')]('sha1');_0x2d9fa1[_0xc077('0xa')](_0x4e9e79);return _0x2d9fa1[_0xc077('0xb')](_0xc077('0xc'));}function _0x1629ff(){try{logger[_0xc077('0x5')](_0xc077('0xd'));var _0x3fb951=moment()[_0xc077('0xe')]();var _0x6be928=_0x5c4d25(_0x3fb951+_0x23499f+_0x9064d0);_0x4a2c8f['send'](JSON[_0xc077('0xf')]({'appID':_0x23499f,'timestamp':_0x3fb951,'appKey':_0x6be928}));var _0x3bf229=fs[_0xc077('0x10')](_0x176aa9);_0x3bf229['on'](_0xc077('0x11'),function(_0x4eadd4){_0x4a2c8f[_0xc077('0x12')](_0x4eadd4);});_0x3bf229['on']('close',function(){_0x4a2c8f[_0xc077('0x12')](_0xc077('0x13'));});}catch(_0x52cd1){logger[_0xc077('0x14')]('Tilde\x20ASR\x20send\x20error',JSON[_0xc077('0xf')](_0x52cd1));_0x4a2c8f[_0xc077('0x15')]();}}function _0x35f02b(_0x5caf0e){try{if(_0x5caf0e){var _0x1fee57=JSON[_0xc077('0x16')](_0x5caf0e);switch(_0x1fee57[_0xc077('0x17')]){case 0x0:if(_0x1fee57[_0xc077('0x18')]){if(_0x1fee57[_0xc077('0x18')]['final']){logger[_0xc077('0x5')]('Tilde\x20ASR\x20hypoteses',JSON[_0xc077('0xf')](_0x1fee57[_0xc077('0x18')][_0xc077('0x19')]));_0x3f234f=_0x1fee57[_0xc077('0x18')]['hypotheses'][0x0][_0xc077('0x1a')];_0x29cc72=_0x1fee57[_0xc077('0x18')][_0xc077('0x19')][0x0][_0xc077('0x1b')];_0x178515='0';_0x572ae2=_0xc077('0x1c');_0x4a2c8f[_0xc077('0x15')]();}}break;case 0x1:logger[_0xc077('0x5')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x178515='1';_0x572ae2='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0xc077('0x5')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x178515='2';_0x572ae2=_0xc077('0x1d');break;case 0x9:logger['info']('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x178515='9';_0x572ae2=_0xc077('0x1e');break;case 0xa:logger['info'](_0xc077('0x1f'));_0x178515='10';_0x572ae2=_0xc077('0x1f');break;case 0xb:logger['info']('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x178515='11';_0x572ae2=_0xc077('0x20');}}}catch(_0x30343f){logger[_0xc077('0x14')]('Tilde\x20ASR\x20parse\x20error',JSON[_0xc077('0xf')](_0x30343f));_0x4a2c8f['terminate']();}}function _0x4eb7a3(){logger[_0xc077('0x5')](_0xc077('0x21'));_0x452d7f({'transcript':_0x3f234f,'confidence':_0x29cc72,'status':_0x178515,'status_message':_0x572ae2});}function _0x40dea1(_0x59c500){logger[_0xc077('0x14')](_0xc077('0x22'));if(!_[_0xc077('0x23')](_0x59c500)){logger[_0xc077('0x14')](_[_0xc077('0x24')](_0x59c500)?JSON[_0xc077('0xf')](_0x59c500):_0x59c500);}}_0x4a2c8f['on'](_0xc077('0x25'),_0x1629ff);_0x4a2c8f['on'](_0xc077('0x26'),_0x35f02b);_0x4a2c8f['on'](_0xc077('0x27'),_0x4eb7a3);_0x4a2c8f['on']('error',_0x40dea1);});}; \ No newline at end of file +var _0x616f=['isObject','open','message','bluebird','moment','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','sha1','update','unix','send','createReadStream','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','stringify','terminate','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','isNil'];(function(_0x5311e8,_0x57c5bb){var _0x582ad8=function(_0x1909af){while(--_0x1909af){_0x5311e8['push'](_0x5311e8['shift']());}};_0x582ad8(++_0x57c5bb);}(_0x616f,0xed));var _0xf616=function(_0x280bef,_0x5e1bd3){_0x280bef=_0x280bef-0x0;var _0x56dc85=_0x616f[_0x280bef];return _0x56dc85;};'use strict';var BPromise=require(_0xf616('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xf616('0x1'));var crypto=require(_0xf616('0x2'));var logger=require(_0xf616('0x3'))(_0xf616('0x4'));module[_0xf616('0x5')]=function(_0x650ba2,_0x350549,_0x70423d,_0x3f25ed){return new BPromise(function(_0xbc384,_0x2dd2ee){logger[_0xf616('0x6')](_0xf616('0x7'),_0x3f25ed||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x55d754=new WebSocket(_0x3f25ed||_0xf616('0x8'),{'perMessageDeflate':![]});var _0x5d3562='';var _0x419910='0';var _0x30c84c='1';var _0xcf0310=_0xf616('0x9');function _0x238bdf(_0x5e21a9){var _0x88797a=crypto['createHash'](_0xf616('0xa'));_0x88797a[_0xf616('0xb')](_0x5e21a9);return _0x88797a['digest']('hex');}function _0x277666(){try{logger[_0xf616('0x6')]('Open\x20Tilde\x20ASR\x20socket');var _0x17e439=moment()[_0xf616('0xc')]();var _0x3d1686=_0x238bdf(_0x17e439+_0x350549+_0x70423d);_0x55d754[_0xf616('0xd')](JSON['stringify']({'appID':_0x350549,'timestamp':_0x17e439,'appKey':_0x3d1686}));var _0x41fde9=fs[_0xf616('0xe')](_0x650ba2);_0x41fde9['on'](_0xf616('0xf'),function(_0x435764){_0x55d754[_0xf616('0xd')](_0x435764);});_0x41fde9['on'](_0xf616('0x10'),function(){_0x55d754[_0xf616('0xd')](_0xf616('0x11'));});}catch(_0x1968ef){logger[_0xf616('0x12')](_0xf616('0x13'),JSON[_0xf616('0x14')](_0x1968ef));_0x55d754[_0xf616('0x15')]();}}function _0x4ed4b1(_0x123c53){try{if(_0x123c53){var _0x15e90b=JSON['parse'](_0x123c53);switch(_0x15e90b[_0xf616('0x16')]){case 0x0:if(_0x15e90b[_0xf616('0x17')]){if(_0x15e90b['result'][_0xf616('0x18')]){logger['info'](_0xf616('0x19'),JSON['stringify'](_0x15e90b[_0xf616('0x17')][_0xf616('0x1a')]));_0x5d3562=_0x15e90b['result']['hypotheses'][0x0][_0xf616('0x1b')];_0x419910=_0x15e90b[_0xf616('0x17')][_0xf616('0x1a')][0x0]['likelihood'];_0x30c84c='0';_0xcf0310=_0xf616('0x1c');_0x55d754[_0xf616('0x15')]();}}break;case 0x1:logger[_0xf616('0x6')](_0xf616('0x9'));_0x30c84c='1';_0xcf0310=_0xf616('0x9');break;case 0x2:logger[_0xf616('0x6')](_0xf616('0x1d'));_0x30c84c='2';_0xcf0310=_0xf616('0x1d');break;case 0x9:logger['info']('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x30c84c='9';_0xcf0310=_0xf616('0x1e');break;case 0xa:logger[_0xf616('0x6')](_0xf616('0x1f'));_0x30c84c='10';_0xcf0310='Authentication\x20failed.';break;case 0xb:logger[_0xf616('0x6')](_0xf616('0x20'));_0x30c84c='11';_0xcf0310=_0xf616('0x20');}}}catch(_0xe7c0cf){logger[_0xf616('0x12')](_0xf616('0x21'),JSON['stringify'](_0xe7c0cf));_0x55d754[_0xf616('0x15')]();}}function _0x113470(){logger[_0xf616('0x6')](_0xf616('0x22'));_0xbc384({'transcript':_0x5d3562,'confidence':_0x419910,'status':_0x30c84c,'status_message':_0xcf0310});}function _0x68039a(_0x5d928d){logger[_0xf616('0x12')]('Error\x20Tilde\x20ASR\x20socket');if(!_[_0xf616('0x23')](_0x5d928d)){logger[_0xf616('0x12')](_[_0xf616('0x24')](_0x5d928d)?JSON[_0xf616('0x14')](_0x5d928d):_0x5d928d);}}_0x55d754['on'](_0xf616('0x25'),_0x277666);_0x55d754['on'](_0xf616('0x26'),_0x4ed4b1);_0x55d754['on']('close',_0x113470);_0x55d754['on']('error',_0x68039a);});}; \ 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 12417ac..10cb4be 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 _0x4e2a=['./asr'];(function(_0x38ae4f,_0x1d3180){var _0x1e92db=function(_0x1a1cb9){while(--_0x1a1cb9){_0x38ae4f['push'](_0x38ae4f['shift']());}};_0x1e92db(++_0x1d3180);}(_0x4e2a,0xcf));var _0xa4e2=function(_0x1979d8,_0x10d8f2){_0x1979d8=_0x1979d8-0x0;var _0x1d5bb3=_0x4e2a[_0x1979d8];return _0x1d5bb3;};var asr=require(_0xa4e2('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var asr=require('./asr');module['exports']={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index a0a2f25..4bcef6e 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 _0xc22a=['127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','events','EventEmitter','./error','./channel'];(function(_0xe7f7f0,_0x1d0a0a){var _0x242a77=function(_0x597634){while(--_0x597634){_0xe7f7f0['push'](_0xe7f7f0['shift']());}};_0x242a77(++_0x1d0a0a);}(_0xc22a,0x6e));var _0xac22=function(_0x5d15a5,_0x199541){_0x5d15a5=_0x5d15a5-0x0;var _0x170fdb=_0xc22a[_0x5d15a5];return _0x170fdb;};'use strict';var util=require(_0xac22('0x0'));var net=require('net');var EventEmitter=require(_0xac22('0x1'))[_0xac22('0x2')];var AGIError=require(_0xac22('0x3'));var AGIChannel=require(_0xac22('0x4'));var AGIServer=function(_0x29eab2,_0x2f06ac,_0x3f1b2a){var _0x2b5302=this,_0x29eab2=_0x29eab2||0x11dd,_0x2f06ac=_0x2f06ac||_0xac22('0x5'),_0x8672b=null,_0x32f9fc=0x0;EventEmitter[_0xac22('0x6')](_0x2b5302);function _0x259211(){if(!_0x29eab2){_0x2b5302[_0xac22('0x7')](_0xac22('0x8'),new AGIError(_0xac22('0x9')));return![];}_0x8672b=net[_0xac22('0xa')]();_0x8672b[_0xac22('0xb')](_0x29eab2,_0x2f06ac);_0x8672b['on']('listening',function(){_0x2b5302[_0xac22('0x7')]('listening');});_0x8672b['on'](_0xac22('0xc'),function(_0x1d766a){_0x8672b[_0xac22('0xd')](function(_0x57e2e2,_0x57c6f2){if(_0x57e2e2){_0x2b5302[_0xac22('0x7')]('error',new AGIError(_0xac22('0xe'),_0x57e2e2));}else if(_0x3f1b2a&&_0x3f1b2a<0x0){_0x2b5302[_0xac22('0x7')](_0xac22('0x8'),new AGIError(_0xac22('0xf')));_0x1d766a[_0xac22('0x10')]();}else if(_0x3f1b2a&&_0x3f1b2a>0x0&&_0x3f1b2a<_0x57c6f2){_0x32f9fc+=0x1;_0x2b5302[_0xac22('0x7')](_0xac22('0x8'),new AGIError(_0xac22('0x11'),_0x32f9fc));_0x1d766a[_0xac22('0x10')]();}else{var _0x117820=new AGIChannel(_0x1d766a);_0x117820['on'](_0xac22('0x12'),function(){_0x2b5302[_0xac22('0x7')]('connection',_0x117820);});}});});_0x8672b['on'](_0xac22('0x8'),function(_0x42017c){_0x2b5302[_0xac22('0x7')](_0xac22('0x8'),new AGIError(_0xac22('0xe'),_0x42017c['code']));});_0x8672b['on']('close',function(){_0x2b5302[_0xac22('0x7')]('close',new AGIError(_0xac22('0x13')));});}process[_0xac22('0x14')](function(){_0x259211();});};util[_0xac22('0x15')](AGIServer,EventEmitter);module[_0xac22('0x16')]=function(_0x6f5903,_0x11c2bf,_0x5db721){return new AGIServer(_0x6f5903,_0x11c2bf,_0x5db721);}; \ No newline at end of file +var _0xedb9=['listening','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','code','close','E_AGI_SERVER_CLOSE','nextTick','exports','util','net','events','EventEmitter','./error','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0xedb9,0x183));var _0x9edb=function(_0x27b7e9,_0x2a6f59){_0x27b7e9=_0x27b7e9-0x0;var _0x399fea=_0xedb9[_0x27b7e9];return _0x399fea;};'use strict';var util=require(_0x9edb('0x0'));var net=require(_0x9edb('0x1'));var EventEmitter=require(_0x9edb('0x2'))[_0x9edb('0x3')];var AGIError=require(_0x9edb('0x4'));var AGIChannel=require(_0x9edb('0x5'));var AGIServer=function(_0x59f2be,_0x1b9f87,_0x4113bb){var _0x34b52e=this,_0x59f2be=_0x59f2be||0x11dd,_0x1b9f87=_0x1b9f87||_0x9edb('0x6'),_0x36e5c9=null,_0x4f1766=0x0;EventEmitter[_0x9edb('0x7')](_0x34b52e);function _0x35a073(){if(!_0x59f2be){_0x34b52e[_0x9edb('0x8')](_0x9edb('0x9'),new AGIError(_0x9edb('0xa')));return![];}_0x36e5c9=net[_0x9edb('0xb')]();_0x36e5c9[_0x9edb('0xc')](_0x59f2be,_0x1b9f87);_0x36e5c9['on'](_0x9edb('0xd'),function(){_0x34b52e[_0x9edb('0x8')]('listening');});_0x36e5c9['on'](_0x9edb('0xe'),function(_0x400f52){_0x36e5c9[_0x9edb('0xf')](function(_0x1538bc,_0xd8f66d){if(_0x1538bc){_0x34b52e['emit']('error',new AGIError(_0x9edb('0x10'),_0x1538bc));}else if(_0x4113bb&&_0x4113bb<0x0){_0x34b52e[_0x9edb('0x8')](_0x9edb('0x9'),new AGIError(_0x9edb('0x11')));_0x400f52[_0x9edb('0x12')]();}else if(_0x4113bb&&_0x4113bb>0x0&&_0x4113bb<_0xd8f66d){_0x4f1766+=0x1;_0x34b52e[_0x9edb('0x8')]('error',new AGIError(_0x9edb('0x13'),_0x4f1766));_0x400f52[_0x9edb('0x12')]();}else{var _0x2acd4f=new AGIChannel(_0x400f52);_0x2acd4f['on']('ready',function(){_0x34b52e[_0x9edb('0x8')]('connection',_0x2acd4f);});}});});_0x36e5c9['on'](_0x9edb('0x9'),function(_0x3f13de){_0x34b52e['emit']('error',new AGIError(_0x9edb('0x10'),_0x3f13de[_0x9edb('0x14')]));});_0x36e5c9['on'](_0x9edb('0x15'),function(){_0x34b52e['emit'](_0x9edb('0x15'),new AGIError(_0x9edb('0x16')));});}process[_0x9edb('0x17')](function(){_0x35a073();});};util['inherits'](AGIServer,EventEmitter);module[_0x9edb('0x18')]=function(_0x5926ee,_0x339e99,_0x2f4c21){return new AGIServer(_0x5926ee,_0x339e99,_0x2f4c21);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 1961c3d..3eaf379 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 _0x9265=['rpc','mailRpc','prototype','name','catch','getVoiceQueueById','getSquareProject','then','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','Intervals','getSoundPath','format','error','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','callerid','createSquareRecording','calleridname','context','extension','accountcode','dnid','createSquareMessage','createCmContact','callback_','random','isEmpty','lastName','isNil','phone','list_id','scheduledAt','callback','callback_priority','getPause','getPauseById','agent','agentPause','agentUnpause','agentLogout','internal','%s/%s@from-sip/n','LOCAL','agentLogin','shellCommand','exec','trim','googleCloudTTS','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','audioEncoding','MP3','googleTTS','url','timeout','includes','method','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','500\x20-\x20Internal\x20Server\x20Error','googleDialogflow','key','googleDialogflowV2','dialogflowV2_project_id','dialogflowV2_language','sestekNDA','ispeechTTS','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_polly_voice','Amy','aws_text_type','awsLex','aws_secret_access_key','aws_bot_name','googleASR','google_asr_language','tildeASR','appsecret','clear','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','%s.%s','setVariable','split','replaceAll','getVariable','extra','toString','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','sync','retry','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','options','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','Enter\x20in\x20AGI\x20(%s)\x20block','command','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','lumenvoxtts','no\x20text\x20configured','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','MRCPRecog','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','Executed\x20command\x20MRCPRecog\x20%s','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','getSquareOdbc','replace','getQueryOdbc','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','client_email','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','out','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','ndassistant_url','bot','Trying\x20SestekNDA:\x20%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','unlink','.wav','SestekNDA\x20Result\x20%s','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','file_id','no\x20file\x20audio\x20found','getData','response','maxdigit','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','message','amazonlex','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','appid','no\x20appid\x20configured','no\x20appsecret\x20configured','wav','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','priority','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','streamFile','ispeech\x20TTS\x20is\x20unreachable','findBy','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','no\x20find\x20by\x20configured','failure','operation','math\x20%s','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20selected','output','pause','pause_id','playback','opts','Executed\x20command\x20%s\x20%s','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','getVoiceQueue','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','restapi','no\x20url\x20configured','restAPI','inspect','no\x20variable\x20selected\x20for\x20the\x20response','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','escape_digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','user','bcc','subject','service','host','port','secure','auth','pass','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sendSMS\x20message','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','start','Enter\x20in\x20START\x20(%s)\x20block','answer','yes','Answer','Skipped\x20Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','arg_1','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','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','apiKey','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','path','util','lodash','shelljs','odbc','randomstring','moment','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawBody','menu','getdigits','channel'];(function(_0x28a871,_0x52b032){var _0x58f08e=function(_0xda058){while(--_0xda058){_0x28a871['push'](_0x28a871['shift']());}};_0x58f08e(++_0x52b032);}(_0x9265,0x1b9));var _0x5926=function(_0x28b8c4,_0x596a00){_0x28b8c4=_0x28b8c4-0x0;var _0xedf264=_0x9265[_0x28b8c4];return _0xedf264;};'use strict';var fs=require('fs');var path=require(_0x5926('0x0'));var util=require(_0x5926('0x1'));var _=require(_0x5926('0x2'));var sh=require(_0x5926('0x3'));var odbc=require(_0x5926('0x4'))();var rs=require(_0x5926('0x5'));var moment=require(_0x5926('0x6'));var Mustache=require('mustache');var rp=require('request-promise');var logger=require('../../config/logger')(_0x5926('0x7'));var config=require(_0x5926('0x8'));var scripts=require(_0x5926('0x9'));var FILES_PATH=_0x5926('0xa');var recursiveMapAttributes=['rawHeaders',_0x5926('0xb')];var verticesWithRetry=[_0x5926('0xc'),_0x5926('0xd'),'getsecretdigits'];var AGIVertices=function(_0x3825d4,_0x346912,_0x4c812b){this[_0x5926('0xe')]=_0x3825d4;this[_0x5926('0xf')]=_0x346912;this[_0x5926('0x10')]=_0x4c812b;};AGIVertices[_0x5926('0x11')]['getVariable']=function(_0x291f5d,_0x57fd95){this[_0x5926('0xf')]['getVariableById'](_0x291f5d)['then'](function(_0x31b234){_0x57fd95(null,_0x31b234?_0x31b234[_0x5926('0x12')]:![]);})[_0x5926('0x13')](function(_0x189004){_0x57fd95(_0x189004);});};AGIVertices[_0x5926('0x11')]['getVoiceQueue']=function(_0x83fbd7,_0x4cedf4){this['rpc'][_0x5926('0x14')](_0x83fbd7)['then'](function(_0x5e1da3){_0x4cedf4(null,_0x5e1da3?_0x5e1da3[_0x5926('0x12')]:![]);})[_0x5926('0x13')](function(_0xb13ed3){_0x4cedf4(_0xb13ed3);});};AGIVertices[_0x5926('0x11')][_0x5926('0x15')]=function(_0x51b136,_0x504c18){this['rpc']['getSquareProjectById'](_0x51b136)[_0x5926('0x16')](function(_0x28b532){_0x504c18(null,_0x28b532?_0x28b532[_0x5926('0x12')]:![]);})[_0x5926('0x13')](function(_0x58ea10){_0x504c18(_0x58ea10);});};AGIVertices[_0x5926('0x11')]['getSquareOdbc']=function(_0x39fa72,_0x1d8164){this['rpc'][_0x5926('0x17')](_0x39fa72)[_0x5926('0x16')](function(_0x4355ae){_0x1d8164(null,_0x4355ae?_0x4355ae[_0x5926('0x18')]:![]);})[_0x5926('0x13')](function(_0x344f55){_0x1d8164(_0x344f55);});};AGIVertices[_0x5926('0x11')][_0x5926('0x19')]=function(_0x2fc26f,_0x3cac01){this['rpc'][_0x5926('0x1a')](_0x2fc26f)[_0x5926('0x16')](function(_0x36da92){_0x3cac01(null,_0x36da92?_0x36da92['name']:![]);})[_0x5926('0x13')](function(_0x2468f4){_0x3cac01(_0x2468f4);});};AGIVertices[_0x5926('0x11')][_0x5926('0x1b')]=function(_0x855c77,_0x546f4f){this[_0x5926('0xf')][_0x5926('0x1c')](_0x855c77)['then'](function(_0x5cb2a0){_0x546f4f(null,_0x5cb2a0?_0x5cb2a0[_0x5926('0x12')]:![]);})['catch'](function(_0x54f471){_0x546f4f(_0x54f471);});};AGIVertices['prototype'][_0x5926('0x1d')]=function(_0x584c6d,_0x45ce2e){var _0xed2135=this;this[_0x5926('0xf')][_0x5926('0x1e')](_0x584c6d)['then'](function(_0x410710){_0x45ce2e(null,_0x410710?_0xed2135['getSoundPath'](_0x410710[_0x5926('0x1f')]):![]);})[_0x5926('0x13')](function(_0x52f368){_0x45ce2e(_0x52f368);});};AGIVertices[_0x5926('0x11')][_0x5926('0x20')]=function(_0x429b80,_0x4c29b4){this[_0x5926('0xf')][_0x5926('0x21')](_0x429b80)[_0x5926('0x16')](function(_0x2c609a){_0x4c29b4(null,_0x2c609a?_0x2c609a:![]);})[_0x5926('0x13')](function(_0xe53301){_0x4c29b4(_0xe53301);});};AGIVertices[_0x5926('0x11')][_0x5926('0x22')]=function(_0xea8c77,_0x44c9b8,_0x450fc4){this['mailRpc'][_0x5926('0x22')](_0xea8c77,_0x44c9b8)[_0x5926('0x16')](function(){_0x450fc4(null);})['catch'](function(_0x41763f){_0x450fc4(_0x41763f);});};AGIVertices[_0x5926('0x11')][_0x5926('0x23')]=function(_0x22e3fc,_0x2a8201){this['rpc'][_0x5926('0x24')](_0x22e3fc)[_0x5926('0x16')](function(_0x528db6){if(_0x528db6){if(_0x528db6[_0x5926('0x25')]){_0x2a8201(null,[_0x528db6[_0x5926('0x26')]]);}else{_0x2a8201(null,_['map'](_0x528db6[_0x5926('0x27')],_0x5926('0x26')));}}else{_0x2a8201(null,![]);}})[_0x5926('0x13')](function(_0x22c0e2){_0x2a8201(_0x22c0e2);});};AGIVertices['prototype'][_0x5926('0x28')]=function(_0x24639c){return util[_0x5926('0x29')]('%s/sounds/converted/%s',FILES_PATH,_0x24639c);};AGIVertices[_0x5926('0x11')]['getQueryOdbc']=function(_0x44152c,_0x4b0162,_0x4212ab){odbc['open'](_0x44152c,function(_0x14fb70){if(_0x14fb70){logger[_0x5926('0x2a')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x14fb70);_0x4212ab(_0x14fb70);}else{logger[_0x5926('0x2b')](_0x5926('0x2c'));odbc[_0x5926('0x2d')](_0x4b0162,function(_0x568474,_0x4d2af0){if(_0x568474){logger[_0x5926('0x2b')](_0x5926('0x2e'),_0x4b0162);_0x4212ab(_0x568474);}else{logger[_0x5926('0x2b')]('Query\x20executed\x20correctly\x20%s',_0x4b0162);odbc['close'](function(_0x52ba3a){if(_0x52ba3a){logger[_0x5926('0x2a')](_0x5926('0x2f'),_0x52ba3a);}_0x4212ab(null,_0x4d2af0);});}});}});};AGIVertices['prototype'][_0x5926('0x30')]=function(_0x6de3c6,_0x397a00){this[_0x5926('0xf')][_0x5926('0x31')](_0x6de3c6)[_0x5926('0x16')](function(_0x2ef886){_0x397a00(null,_0x2ef886?_0x2ef886:![]);})['catch'](function(_0x7f85bf){_0x397a00(_0x7f85bf);});};AGIVertices[_0x5926('0x11')][_0x5926('0x32')]=function(_0x430d98,_0x4d80e9){this[_0x5926('0xf')][_0x5926('0x32')](_0x430d98)[_0x5926('0x16')](function(_0x4e09c){_0x4d80e9(null,_0x4e09c);})['catch'](function(_0xb34ed5){_0x4d80e9(_0xb34ed5);});};AGIVertices[_0x5926('0x11')][_0x5926('0x33')]=function(_0x1f29c2,_0xb4f705,_0x2a804d){this[_0x5926('0xf')][_0x5926('0x33')]({'uniqueid':this[_0x5926('0xe')][_0x5926('0x34')],'node':_0x1f29c2[_0x5926('0x35')],'application':_0x1f29c2[_0x5926('0x36')],'data':_0xb4f705||null,'project_name':this[_0x5926('0xe')]['arg_1'],'callerid':this[_0x5926('0xe')][_0x5926('0x37')]})[_0x5926('0x16')](function(_0x34d052){if(_0x2a804d){_0x2a804d(null,_0x34d052);}})[_0x5926('0x13')](function(_0x428aae){if(_0x2a804d){_0x2a804d(_0x428aae);}});};AGIVertices[_0x5926('0x11')][_0x5926('0x38')]=function(_0x4bd685,_0x59cbfb,_0x3d6a46,_0xa7d39e){this[_0x5926('0xf')][_0x5926('0x38')]({'uniqueid':this[_0x5926('0xe')]['uniqueid'],'callerid':this[_0x5926('0xe')][_0x5926('0x37')],'calleridname':this[_0x5926('0xe')][_0x5926('0x39')],'context':this['channel'][_0x5926('0x3a')],'extension':this[_0x5926('0xe')][_0x5926('0x3b')],'priority':this[_0x5926('0xe')]['priority'],'accountcode':this['channel'][_0x5926('0x3c')],'dnid':this[_0x5926('0xe')][_0x5926('0x3d')],'projectName':this[_0x5926('0xe')]['arg_1'],'saveName':_0x59cbfb,'filename':_0x4bd685['file']||_0x59cbfb,'savePath':_0x3d6a46})[_0x5926('0x16')](function(_0x1338af){_0xa7d39e(null,_0x1338af);})['catch'](function(_0x726e78){_0xa7d39e(_0x726e78);});};AGIVertices[_0x5926('0x11')]['createSquareMessage']=function(_0x3ca871,_0x143e54,_0x4aee70,_0x3168ad,_0x30123d){this[_0x5926('0xf')][_0x5926('0x3e')]({'uniqueid':this['channel'][_0x5926('0x34')],'body':_0x3ca871,'direction':_0x143e54,'providerName':_0x4aee70,'providerResponse':_0x3168ad})[_0x5926('0x16')](function(_0x1c3e18){if(_0x30123d){_0x30123d(null,_0x1c3e18);}})[_0x5926('0x13')](function(_0x30c3fe){if(_0x30123d){_0x30123d(_0x30c3fe);}});};AGIVertices[_0x5926('0x11')][_0x5926('0x3f')]=function(_0x44f562,_0x30bea1){this[_0x5926('0xf')][_0x5926('0x3f')]({'firstName':_['isEmpty'](_0x44f562[_0x5926('0x12')])||_['isNil'](_0x44f562[_0x5926('0x12')])?_0x5926('0x40')+Math[_0x5926('0x41')]():_0x44f562[_0x5926('0x12')],'lastName':_[_0x5926('0x42')](_0x44f562[_0x5926('0x43')])||_[_0x5926('0x44')](_0x44f562[_0x5926('0x43')])?null:_0x44f562['lastName'],'phone':_0x44f562[_0x5926('0x45')],'ListId':_0x44f562[_0x5926('0x46')],'scheduledat':_0x44f562[_0x5926('0x47')],'callbackUniqueid':this[_0x5926('0xe')][_0x5926('0x34')],'tags':_0x5926('0x48'),'description':'Callback\x20scheduled\x20at\x20'+_0x44f562[_0x5926('0x47')]['toString'](),'priority':_0x44f562[_0x5926('0x49')]})['then'](function(_0x271123){_0x30bea1(null,_0x271123);})[_0x5926('0x13')](function(_0xd0cdaa){_0x30bea1(_0xd0cdaa);});};AGIVertices[_0x5926('0x11')][_0x5926('0x4a')]=function(_0x5cd2dc,_0x41571a){this['rpc'][_0x5926('0x4b')](_0x5cd2dc)[_0x5926('0x16')](function(_0x35ca3b){_0x41571a(null,_0x35ca3b?_0x35ca3b[_0x5926('0x12')]:![]);})[_0x5926('0x13')](function(_0x105647){_0x41571a(_0x105647);});};AGIVertices[_0x5926('0x11')]['agentPause']=function(_0x2215f3,_0x1f693c,_0x15b352){var _0x33d00f={'role':_0x5926('0x4c')};_0x33d00f[_0x2215f3]=this['channel']['callerid'];this[_0x5926('0xf')][_0x5926('0x4d')](_0x33d00f,_0x1f693c,this[_0x5926('0xe')][_0x5926('0x34')])[_0x5926('0x16')](function(_0x217d1b){_0x15b352(null,_[_0x5926('0x44')](_0x217d1b)?![]:!![]);})[_0x5926('0x13')](function(_0x2aa364){logger[_0x5926('0x2a')](_0x2aa364);_0x15b352(null,![]);});};AGIVertices['prototype'][_0x5926('0x4e')]=function(_0x379acb,_0x4f3275){var _0x4fadb1={'role':'agent'};_0x4fadb1[_0x379acb]=this[_0x5926('0xe')]['callerid'];this[_0x5926('0xf')][_0x5926('0x4e')](_0x4fadb1)[_0x5926('0x16')](function(_0x1c86f6){_0x4f3275(null,_[_0x5926('0x44')](_0x1c86f6)?![]:!![]);})['catch'](function(_0x333a6d){logger[_0x5926('0x2a')](_0x333a6d);_0x4f3275(null,![]);});};AGIVertices[_0x5926('0x11')]['agentLogout']=function(_0x3d331f,_0x377dab){var _0x5cec8a={'role':_0x5926('0x4c')};_0x5cec8a[_0x3d331f]=this['channel']['callerid'];this[_0x5926('0xf')][_0x5926('0x4f')](_0x5cec8a)[_0x5926('0x16')](function(_0x3c748c){_0x377dab(null,_['isNil'](_0x3c748c)?![]:!![]);})['catch'](function(_0x4c4ae3){logger[_0x5926('0x2a')](_0x4c4ae3);_0x377dab(null,![]);});};AGIVertices[_0x5926('0x11')]['agentLogin']=function(_0x1df7fe,_0x27ad08){var _0x172db5={'role':_0x5926('0x4c')};_0x172db5[_0x1df7fe]=this[_0x5926('0xe')][_0x5926('0x37')];var _0x1327e9=_0x1df7fe!=_0x5926('0x50')?util[_0x5926('0x29')](_0x5926('0x51'),_0x5926('0x52'),this[_0x5926('0xe')][_0x5926('0x37')]):undefined;this[_0x5926('0xf')][_0x5926('0x53')](_0x172db5,_0x1327e9)[_0x5926('0x16')](function(_0x17d80c){_0x27ad08(null,_[_0x5926('0x44')](_0x17d80c)?![]:!![]);})[_0x5926('0x13')](function(_0x246b7c){logger[_0x5926('0x2a')](_0x246b7c);_0x27ad08(null,![]);});};AGIVertices['prototype'][_0x5926('0x54')]=function(_0x3101c0,_0x4da7e7){sh[_0x5926('0x55')](_[_0x5926('0x56')](_0x3101c0),function(_0xc85b07,_0x5b14a9){var _0x38c246=_0x5b14a9['replace'](/(\r\n|\n|\r)/gm,'');_0x4da7e7(null,_0x38c246);});};AGIVertices['prototype'][_0x5926('0x57')]=function(_0x31f77e,_0x289bb7){scripts[_0x5926('0x57')](_0x31f77e['apiKey'],_0x31f77e[_0x5926('0x58')]||_0x5926('0x59'),_0x31f77e[_0x5926('0x59')],_0x31f77e[_0x5926('0x5a')]||_0x5926('0x5b'),_0x31f77e[_0x5926('0x5c')]||'MALE',_0x31f77e[_0x5926('0x5d')]||_0x5926('0x5e'))[_0x5926('0x16')](function(_0x5a45fc){_0x289bb7(null,_0x5a45fc);})[_0x5926('0x13')](function(_0x2bdd15){_0x289bb7(_0x2bdd15);});};AGIVertices[_0x5926('0x11')]['googleTTS']=function(_0x269953,_0xf78db0){scripts[_0x5926('0x5f')](_0x269953[_0x5926('0x59')],_0x269953['google_tts_language']||'en',0x1)['then'](function(_0x5b2a63){_0xf78db0(null,_0x5b2a63);})[_0x5926('0x13')](function(_0x1f09f6){_0xf78db0(_0x1f09f6);});};AGIVertices[_0x5926('0x11')]['restAPI']=function(_0x300bb7,_0x3c6289){var _0x145bcd={'uri':_0x300bb7[_0x5926('0x60')],'method':_0x300bb7['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x300bb7['timeout'])==='number'&&parseInt(_0x300bb7['timeout'])>=0x1?parseInt(_0x300bb7[_0x5926('0x61')])*0x3e8:0x5*0x3e8};if(_[_0x5926('0x62')](['POST','PUT'],_0x145bcd[_0x5926('0x63')][_0x5926('0x64')]())){try{_0x145bcd[_0x5926('0x65')]=_0x300bb7[_0x5926('0xb')]?JSON[_0x5926('0x66')](_0x300bb7[_0x5926('0xb')]):{};}catch(_0x598f9e){logger['error'](_0x5926('0x67'),_0x598f9e);}}try{_0x145bcd[_0x5926('0x68')]=_0x300bb7[_0x5926('0x69')]?JSON[_0x5926('0x66')](_0x300bb7[_0x5926('0x69')]):{};}catch(_0x1fcb8a){logger[_0x5926('0x2a')](_0x5926('0x6a'),_0x1fcb8a);}if(_0x300bb7[_0x5926('0x6b')]){try{var _0x466131=require(_0x300bb7[_0x5926('0x6b')])['sync'](this,_0x145bcd);_0x145bcd[_0x5926('0x6c')]=Mustache[_0x5926('0x6d')](_0x300bb7[_0x5926('0x60')],_0x466131,{},['$$','$$']);if(_0x145bcd[_0x5926('0x68')]){_0x145bcd[_0x5926('0x68')]=JSON[_0x5926('0x66')](Mustache[_0x5926('0x6d')](JSON[_0x5926('0x6e')](_0x145bcd[_0x5926('0x68')]),_0x466131,{},['$$','$$']));}if(_0x145bcd[_0x5926('0x65')]){_0x145bcd[_0x5926('0x65')]=JSON['parse'](Mustache[_0x5926('0x6d')](JSON['stringify'](_0x145bcd[_0x5926('0x65')]),_0x466131,{},['$$','$$']));}}catch(_0x49819a){logger[_0x5926('0x2a')](_0x5926('0x6f'),_0x49819a);}}rp(_0x145bcd)[_0x5926('0x16')](function(_0x3c3012){var _0x2d3f19={'statusCode':_0x3c3012[_0x5926('0x70')]||0xc8,'statusMessage':_0x3c3012[_0x5926('0x71')]||'OK','headers':_0x3c3012[_0x5926('0x68')]||{},'body':_0x3c3012[_0x5926('0x65')]||{}};_0x3c6289(null,_0x2d3f19);})[_0x5926('0x13')](function(_0x3f16c2){var _0x3652ff={'statusCode':_0x3f16c2[_0x5926('0x70')]||0x1f4,'statusMessage':_0x3f16c2['message']||_0x5926('0x72'),'headers':_0x3f16c2['options'][_0x5926('0x68')]||{},'body':_0x3f16c2['options'][_0x5926('0x65')]||{}};_0x3c6289(null,_0x3652ff);});};AGIVertices[_0x5926('0x11')][_0x5926('0x73')]=function(_0x3d4054,_0x3098fc){scripts[_0x5926('0x73')](this['channel'][_0x5926('0x34')],_0x3d4054[_0x5926('0x74')],_0x3d4054[_0x5926('0x59')],_0x3d4054['dialogflow_language']||'en')['then'](function(_0x27c603){_0x3098fc(null,_0x27c603);})[_0x5926('0x13')](function(_0x25d9b2){_0x3098fc(_0x25d9b2);});};AGIVertices['prototype'][_0x5926('0x75')]=function(_0x243eb0,_0x23bdf3){scripts[_0x5926('0x75')](this[_0x5926('0xe')][_0x5926('0x34')],_0x243eb0[_0x5926('0x76')],_0x243eb0['client_email'],_0x243eb0['private_key'],_0x243eb0[_0x5926('0x59')],_0x243eb0[_0x5926('0x77')]||'en')[_0x5926('0x16')](function(_0x2efad5){_0x23bdf3(null,_0x2efad5);})[_0x5926('0x13')](function(_0x3c8d03){_0x23bdf3(_0x3c8d03);});};AGIVertices[_0x5926('0x11')][_0x5926('0x78')]=function(_0x38874d,_0x2cf0c9){scripts['sestekNDA'](this[_0x5926('0xe')],_0x38874d)[_0x5926('0x16')](function(_0x49937b){_0x2cf0c9(null,_0x49937b);})['catch'](function(_0x7ee07d){_0x2cf0c9(_0x7ee07d);});};AGIVertices[_0x5926('0x11')][_0x5926('0x79')]=function(_0x184b11,_0x401d1d){scripts['ispeechTTS'](_0x184b11[_0x5926('0x74')],_0x184b11[_0x5926('0x59')],_0x184b11['ispeech_tts_language']||_0x5926('0x5b'),_0x184b11[_0x5926('0x7a')])[_0x5926('0x16')](function(_0xe4732){_0x401d1d(null,_0xe4732);})[_0x5926('0x13')](function(_0x470884){_0x401d1d(_0x470884);});};AGIVertices['prototype']['ispeechASR']=function(_0x3f27eb,_0x2d968f,_0x3deb1c){scripts[_0x5926('0x7b')](_0x2d968f,_0x3f27eb[_0x5926('0x74')],_0x3f27eb[_0x5926('0x7c')]||_0x5926('0x5b'),this[_0x5926('0x7d')](_0x3f27eb['model'])?_0x3f27eb[_0x5926('0x7e')]:undefined)['then'](function(_0x1bac65){_0x3deb1c(null,_0x1bac65);})[_0x5926('0x13')](function(_0x225f28){_0x3deb1c(_0x225f28);});};AGIVertices[_0x5926('0x11')]['awsPolly']=function(_0x10eecf,_0x2cda90){scripts[_0x5926('0x7f')](_0x10eecf[_0x5926('0x80')],_0x10eecf['aws_secret_access_key'],_0x10eecf['aws_polly_region'],_0x10eecf[_0x5926('0x81')]||_0x5926('0x82'),_0x10eecf['text'],_0x10eecf[_0x5926('0x83')]||_0x5926('0x59'))[_0x5926('0x16')](function(_0x53f4df){_0x2cda90(null,_0x53f4df);})['catch'](function(_0x1ffc4a){_0x2cda90(_0x1ffc4a);});};AGIVertices[_0x5926('0x11')][_0x5926('0x84')]=function(_0x360b07,_0x158665){scripts[_0x5926('0x84')](this[_0x5926('0xe')][_0x5926('0x34')],_0x360b07[_0x5926('0x80')],_0x360b07[_0x5926('0x85')],_0x360b07['aws_lex_region'],_0x360b07['text'],_0x360b07[_0x5926('0x86')])['then'](function(_0x58913f){_0x158665(null,_0x58913f);})['catch'](function(_0x6824b8){_0x158665(_0x6824b8);});};AGIVertices[_0x5926('0x11')][_0x5926('0x87')]=function(_0x16f035,_0x3ede30,_0xf7b99a){scripts['googleASR'](_0x3ede30,_0x16f035[_0x5926('0x74')],_0x16f035[_0x5926('0x88')]||_0x5926('0x5b'))['then'](function(_0x5144ee){_0xf7b99a(null,_0x5144ee);})[_0x5926('0x13')](function(_0x395461){_0xf7b99a(_0x395461);});};AGIVertices[_0x5926('0x11')][_0x5926('0x89')]=function(_0x41708c,_0x2f062e,_0x70cb9c){scripts[_0x5926('0x89')](_0x2f062e,_0x41708c['appid'],_0x41708c[_0x5926('0x8a')],_0x41708c['uri'])[_0x5926('0x16')](function(_0x365722){_0x70cb9c(null,_0x365722);})[_0x5926('0x13')](function(_0xb31cb9){_0x70cb9c(_0xb31cb9);});};AGIVertices[_0x5926('0x11')][_0x5926('0x8b')]=function(_0x29cc9c){var _0x1f72d6=_['includes'](verticesWithRetry,_0x29cc9c[_0x5926('0x36')])?_0x29cc9c:_[_0x5926('0x8c')](_0x29cc9c);for(var _0x256013 in _0x1f72d6){if(_0x1f72d6[_0x5926('0x8d')](_0x256013)){if(_0x1f72d6[_0x256013]&&_[_0x5926('0x8e')](_0x1f72d6[_0x256013])){if(_[_0x5926('0x62')](recursiveMapAttributes,_0x256013)){_0x1f72d6[_0x256013]=this[_0x5926('0x8f')](_0x1f72d6[_0x256013]);}else{_0x1f72d6[_0x256013]=this[_0x5926('0x90')](_0x1f72d6[_0x256013]);}}}}return _0x1f72d6;};AGIVertices[_0x5926('0x11')][_0x5926('0x91')]=function(_0x54587b){for(var _0x2dc9f2 in _0x54587b){if(_0x54587b[_0x5926('0x8d')](_0x2dc9f2)){if(_[_0x5926('0x92')](_0x54587b[_0x2dc9f2])){this[_0x5926('0x91')](_0x54587b[_0x2dc9f2]);}else if(_[_0x5926('0x93')](_0x54587b[_0x2dc9f2])){for(var _0x31bf11=0x0;_0x31bf11<_0x54587b[_0x2dc9f2][_0x5926('0x94')];_0x31bf11++){this[_0x5926('0x91')](_0x54587b[_0x2dc9f2][_0x31bf11]);}}else if(_[_0x5926('0x8e')](_0x54587b[_0x2dc9f2])){_0x54587b[_0x2dc9f2]=this[_0x5926('0x90')](_0x54587b[_0x2dc9f2]);}}}};AGIVertices['prototype'][_0x5926('0x95')]=function(_0x23d28f,_0x3ae524){for(var _0x42e3c8 in _0x23d28f){if(_0x23d28f[_0x5926('0x8d')](_0x42e3c8)){if(_[_0x5926('0x92')](_0x23d28f[_0x42e3c8])){if(!_[_0x5926('0x42')](_0x23d28f[_0x42e3c8])){this['saveRestApiResult'](_0x23d28f[_0x42e3c8],util['format'](_0x5926('0x96'),_0x3ae524,_0x42e3c8));}}else if(_[_0x5926('0x93')](_0x23d28f[_0x42e3c8])){for(var _0x3d9610=0x0;_0x3d9610<_0x23d28f[_0x42e3c8][_0x5926('0x94')];_0x3d9610++){this[_0x5926('0x95')](_0x23d28f[_0x42e3c8][_0x3d9610],util[_0x5926('0x29')](_0x5926('0x96'),_0x3ae524,_0x42e3c8+'['+_0x3d9610+']'));}}else{if(!_['isNil'](_0x23d28f[_0x42e3c8])){this['channel'][_0x5926('0x97')](util[_0x5926('0x29')]('%s.%s',_0x3ae524,_0x42e3c8),_0x23d28f[_0x42e3c8]);}}}}};AGIVertices[_0x5926('0x11')]['replaceObjectAllVariables']=function(_0x467b35){try{var _0x2c287c=JSON['parse'](_0x467b35);this['recursiveNodeIndex'](_0x2c287c);return JSON['stringify'](_0x2c287c);}catch(_0x978f52){return this[_0x5926('0x90')](_0x467b35);}};AGIVertices[_0x5926('0x11')][_0x5926('0x90')]=function(_0x19cb0f){var _0x3ca2da=_0x19cb0f[_0x5926('0x98')]('{');for(var _0x461684=0x1;_0x461684<_0x3ca2da['length'];_0x461684+=0x1){var _0x2bef1b=_0x3ca2da[_0x461684][_0x5926('0x98')]('}');if(_0x2bef1b[_0x5926('0x94')]>0x1){_0x19cb0f=_0x19cb0f[_0x5926('0x99')]('{'+_0x2bef1b[0x0]+'}',this[_0x5926('0xe')][_0x5926('0x9a')](_0x2bef1b[0x0])[_0x5926('0x9b')]||_0x2bef1b[0x0]);}}if(_0x3ca2da['length']===0x1){return _0x19cb0f[_0x5926('0x9c')]();}return this[_0x5926('0x90')](_0x19cb0f);};AGIVertices[_0x5926('0x11')][_0x5926('0x9d')]=function(_0x233c22,_0x439025){var _0x153ddd=this[_0x5926('0xe')][_0x5926('0x9a')](_0x233c22);if(_0x153ddd[_0x5926('0x9e')]===-0x1){return _0x153ddd;}logger[_0x5926('0x2b')](util[_0x5926('0x29')](_0x5926('0x9f'),_0x439025,_0x153ddd['extra']));return this['channel'][_0x5926('0x97')](_0x439025,_0x153ddd[_0x5926('0x9b')]);};AGIVertices[_0x5926('0x11')][_0x5926('0x7d')]=function(_0x56717d){return _0x56717d&&_0x56717d!=='0'&&_0x56717d!=='-1'&&_0x56717d!=='';};AGIVertices[_0x5926('0x11')]['maxRetry']=function(_0x513670){this[_0x5926('0x33')][_0x5926('0xa0')](this,_0x513670,'-');_0x513670[_0x5926('0xa1')]=_0x513670[_0x5926('0xa2')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x5926('0x11')][_0x5926('0xa3')]=function(_0x5de3c2){logger[_0x5926('0x2b')](util[_0x5926('0x29')](_0x5926('0xa4'),_0x5de3c2['label']));if(!this['isConfigured'](_0x5de3c2['text'])){return this[_0x5926('0xe')][_0x5926('0xa5')]('no\x20text\x20configured');}var _0x46a6fd='\x22'+_0x5de3c2[_0x5926('0x59')]+'\x22';if(this[_0x5926('0x7d')](_0x5de3c2['options'])){_0x46a6fd+=','+_0x5de3c2[_0x5926('0xa6')];}var _0x581060=this[_0x5926('0xe')]['exec'](_0x5926('0xa7'),_0x46a6fd);if(_0x581060['result']===-0x1){return _0x581060;}return this[_0x5926('0xe')][_0x5926('0xa5')](util['format'](_0x5926('0xa8'),_0x46a6fd));};AGIVertices[_0x5926('0x11')]['mrcprecog']=function(_0x14fcb9){logger[_0x5926('0x2b')](util[_0x5926('0x29')](_0x5926('0xa9'),_0x14fcb9[_0x5926('0x35')]));if(!this[_0x5926('0x7d')](_0x14fcb9[_0x5926('0xaa')])){return this['channel'][_0x5926('0xa5')](_0x5926('0xab'));}var _0x5bd74e=_0x14fcb9[_0x5926('0xaa')];if(this[_0x5926('0x7d')](_0x14fcb9[_0x5926('0xa6')])){_0x5bd74e+=','+_0x14fcb9[_0x5926('0xa6')];}var _0x27f71c=this[_0x5926('0xe')][_0x5926('0x55')]('MRCPRecog',_0x5bd74e);if(_0x27f71c['result']===-0x1){return _0x27f71c;}var _0x3b00d1=this[_0x5926('0x9d')](_0x5926('0xac'),_0x5926('0xad'));if(_0x3b00d1['result']===-0x1){return _0x3b00d1;}var _0x57550b=this[_0x5926('0x9d')]('RECOG_INPUT()',_0x5926('0xae'));if(_0x57550b[_0x5926('0x9e')]===-0x1){return _0x57550b;}var _0x842b87=this[_0x5926('0x9d')](_0x5926('0xaf'),'MRCP_RECOG_INSTANCE');if(_0x842b87[_0x5926('0x9e')]===-0x1){return _0x842b87;}return this[_0x5926('0xe')]['noop'](util[_0x5926('0x29')]('Executed\x20command\x20MRCPRecog\x20%s',_0x5bd74e));};AGIVertices[_0x5926('0x11')][_0x5926('0x7')]=function(_0x4a5714){logger[_0x5926('0x2b')](util[_0x5926('0x29')](_0x5926('0xb0'),_0x4a5714['label']));return this[_0x5926('0xe')][_0x5926('0x7')]([_0x4a5714[_0x5926('0xb1')],_0x4a5714['args']]);};AGIVertices[_0x5926('0x11')]['answer']=function(_0x4759d3){logger['info'](util[_0x5926('0x29')](_0x5926('0xb2'),_0x4759d3[_0x5926('0x35')]));if(this['isConfigured'](_0x4759d3['timeout'])){logger[_0x5926('0x2b')](util[_0x5926('0x29')](_0x5926('0xb3'),_0x4759d3[_0x5926('0x61')]));var _0x1488d1=this[_0x5926('0xe')][_0x5926('0xb4')](_0x4759d3['timeout']);if(_0x1488d1[_0x5926('0x9e')]===-0x1){return _0x1488d1;}}return this[_0x5926('0xe')]['answer']();};AGIVertices['prototype'][_0x5926('0x48')]=function(_0x5998dd){logger[_0x5926('0x2b')](util[_0x5926('0x29')](_0x5926('0xb5'),_0x5998dd['label']));if(!this[_0x5926('0x7d')](_0x5998dd[_0x5926('0x46')])){return this[_0x5926('0xe')][_0x5926('0x2a')](_0x5998dd,_0x5926('0xb6'));}_0x5998dd[_0x5926('0x47')]=moment();if(this[_0x5926('0x7d')](_0x5998dd[_0x5926('0xb7')])){_0x5998dd[_0x5926('0x47')]=moment()[_0x5926('0xb8')](_0x5998dd[_0x5926('0xb7')],'minutes');}if(!this[_0x5926('0x7d')](_0x5998dd[_0x5926('0x49')])){_0x5998dd['callback_priority']=0x2;}this[_0x5926('0x3f')][_0x5926('0xa0')](this,_0x5998dd);return this[_0x5926('0xe')]['noop'](util[_0x5926('0x29')](_0x5926('0xb9'),_0x5998dd[_0x5926('0x45')],_0x5998dd['list_id'],_0x5998dd[_0x5926('0x47')]));};AGIVertices['prototype'][_0x5926('0xba')]=function(_0x56a972){logger[_0x5926('0x2b')](util[_0x5926('0x29')](_0x5926('0xbb'),_0x56a972[_0x5926('0x35')]));var _0x451504=this['channel'][_0x5926('0x55')](_0x56a972['application'],_0x56a972[_0x5926('0xa6')]);if(_0x451504['result']===-0x1){return _0x451504;}return this[_0x5926('0xe')][_0x5926('0xa5')](util['format']('Executed\x20command\x20%s\x20%s',_0x56a972[_0x5926('0xbc')],_0x56a972[_0x5926('0xa6')]));};AGIVertices[_0x5926('0x11')][_0x5926('0xbd')]=function(_0x3d3466){logger[_0x5926('0x2b')](util[_0x5926('0x29')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x3d3466[_0x5926('0x35')]));if(!this[_0x5926('0x7d')](_0x3d3466[_0x5926('0x59')])){return this['channel'][_0x5926('0xa5')](_0x5926('0xbe'));}var _0x478373='\x22'+_0x3d3466[_0x5926('0x59')]+'\x22';if(this[_0x5926('0x7d')](_0x3d3466['options'])){_0x478373+=','+_0x3d3466['options'];}var _0x3a8898=this[_0x5926('0xe')]['exec'](_0x5926('0xa7'),_0x478373);if(_0x3a8898[_0x5926('0x9e')]===-0x1){return _0x3a8898;}return this[_0x5926('0xe')][_0x5926('0xa5')](util[_0x5926('0x29')](_0x5926('0xa8'),_0x478373));};AGIVertices[_0x5926('0x11')][_0x5926('0xbf')]=function(_0x203541){logger[_0x5926('0x2b')](util['format'](_0x5926('0xc0'),_0x203541[_0x5926('0x35')]));if(!this['isConfigured'](_0x203541[_0x5926('0x59')])){return this[_0x5926('0xe')]['noop'](_0x5926('0xbe'));}var _0x3d2310='\x22'+_0x203541['text']+'\x22';if(this[_0x5926('0x7d')](_0x203541[_0x5926('0xa6')])){_0x3d2310+=','+_0x203541[_0x5926('0xa6')];}var _0x3996ca=this[_0x5926('0xe')][_0x5926('0x55')]('MRCPSynth',_0x3d2310);if(_0x3996ca[_0x5926('0x9e')]===-0x1){return _0x3996ca;}return this['channel'][_0x5926('0xa5')](util[_0x5926('0x29')](_0x5926('0xa8'),_0x3d2310));};AGIVertices[_0x5926('0x11')]['lumenvoxasr']=function(_0x364e27){logger[_0x5926('0x2b')](util[_0x5926('0x29')](_0x5926('0xc1'),_0x364e27[_0x5926('0x35')]));if(!this[_0x5926('0x7d')](_0x364e27[_0x5926('0xaa')])){return this[_0x5926('0xe')][_0x5926('0xa5')](_0x5926('0xab'));}var _0x2ec05f=_0x364e27[_0x5926('0xaa')];if(this[_0x5926('0x7d')](_0x364e27['options'])){_0x2ec05f+=','+_0x364e27[_0x5926('0xa6')];}var _0x1b0974=this[_0x5926('0xe')][_0x5926('0x55')](_0x5926('0xc2'),_0x2ec05f);if(_0x1b0974[_0x5926('0x9e')]===-0x1){return _0x1b0974;}var _0x58ecb7=this['getAndSetVariable'](_0x5926('0xac'),_0x5926('0xc3'));if(_0x58ecb7[_0x5926('0x9e')]===-0x1){return _0x58ecb7;}var _0x4acd36=this[_0x5926('0x9d')](_0x5926('0xc4'),_0x5926('0xc5'));if(_0x4acd36[_0x5926('0x9e')]===-0x1){return _0x4acd36;}var _0x5a1076=this[_0x5926('0x9d')](_0x5926('0xaf'),'LUMENVOX_ASR_INSTANCE');if(_0x5a1076[_0x5926('0x9e')]===-0x1){return _0x5a1076;}return this[_0x5926('0xe')][_0x5926('0xa5')](util[_0x5926('0x29')](_0x5926('0xc6'),_0x2ec05f));};AGIVertices[_0x5926('0x11')]['sestekasr']=function(_0x195ead){logger['info'](util[_0x5926('0x29')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x195ead['label']));if(!this['isConfigured'](_0x195ead['grammar'])){return this['channel'][_0x5926('0xa5')](_0x5926('0xab'));}var _0x35415d=_0x195ead[_0x5926('0xaa')];if(this['isConfigured'](_0x195ead[_0x5926('0xa6')])){_0x35415d+=','+_0x195ead['options'];}var _0x33cfdc=this[_0x5926('0xe')][_0x5926('0x55')]('MRCPRecog',_0x35415d);if(_0x33cfdc[_0x5926('0x9e')]===-0x1){return _0x33cfdc;}var _0x219bef=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0x5926('0xc7'));if(_0x219bef[_0x5926('0x9e')]===-0x1){return _0x219bef;}var _0x81c0b1=this[_0x5926('0x9d')]('RECOG_INPUT()',_0x5926('0xc8'));if(_0x81c0b1[_0x5926('0x9e')]===-0x1){return _0x81c0b1;}var _0x5eaaf1=this[_0x5926('0x9d')]('RECOG_INSTANCE()','SESTEK_ASR_INSTANCE');if(_0x5eaaf1['result']===-0x1){return _0x5eaaf1;}return this[_0x5926('0xe')][_0x5926('0xa5')](util[_0x5926('0x29')](_0x5926('0xc6'),_0x35415d));};AGIVertices[_0x5926('0x11')][_0x5926('0xc9')]=function(_0x59bc6b){logger[_0x5926('0x2b')](util[_0x5926('0x29')](_0x5926('0xca'),_0x59bc6b['label']));if(!this[_0x5926('0x7d')](_0x59bc6b[_0x5926('0xcb')])){return this['channel'][_0x5926('0x2a')](_0x59bc6b,_0x5926('0xcc'));}var _0x26adfb=this[_0x5926('0xcd')][_0x5926('0xa0')](this,_0x59bc6b[_0x5926('0xcb')]);if(!_0x26adfb){return this[_0x5926('0xe')][_0x5926('0x2a')](_0x59bc6b,'no\x20odbc\x20database\x20found');}if(!this[_0x5926('0x7d')](_0x59bc6b[_0x5926('0x2d')])){return this['channel'][_0x5926('0x2a')](_0x59bc6b,'no\x20query\x20configured');}var _0x5d488d=_0x59bc6b[_0x5926('0x2d')][_0x5926('0xce')](/(\r\n|\n|\r)/gm,'\x20');this['channel']['noop'](util['format']('query:\x20%s',_0x5d488d));var _0x504353=this[_0x5926('0xcf')][_0x5926('0xa0')](this,_0x26adfb,_0x5d488d);this['createSquareDetailsReport'][_0x5926('0xa0')](this,_0x59bc6b,_0x5d488d);if(!this[_0x5926('0x7d')](_0x59bc6b[_0x5926('0xd0')])){return this[_0x5926('0xe')]['noop'](_0x5926('0xd1'));}var _0x297a6c=this[_0x5926('0x9a')][_0x5926('0xa0')](this,_0x59bc6b[_0x5926('0xd0')]);if(!_0x297a6c){return this[_0x5926('0xe')][_0x5926('0x2a')](_0x59bc6b,_0x5926('0xd2'));}var _0x586d10=this;_0x504353[_0x5926('0xd3')](function(_0x13aec8,_0x3fe723){Object['keys'](_0x13aec8)[_0x5926('0xd3')](function(_0x8727e2){_0x586d10[_0x5926('0xe')][_0x5926('0x97')](util['format'](_0x5926('0xd4'),_0x297a6c,_0x3fe723,_0x8727e2),_0x13aec8[_0x8727e2]);});});this['channel'][_0x5926('0x97')](util[_0x5926('0x29')](_0x5926('0xd5'),_0x297a6c),_0x504353[_0x5926('0x94')]);return this[_0x5926('0xe')]['noop'](util[_0x5926('0x29')](_0x5926('0xd6'),_0x297a6c));};AGIVertices['prototype'][_0x5926('0xd7')]=function(_0x15b5fe){logger[_0x5926('0xd8')](util[_0x5926('0x29')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x15b5fe[_0x5926('0x35')]));if(!this[_0x5926('0x7d')](_0x15b5fe[_0x5926('0xd9')])){return this[_0x5926('0xe')]['error'](_0x15b5fe,_0x5926('0xda'));}var _0x3c60fa=this[_0x5926('0x19')][_0x5926('0xa0')](this,_0x15b5fe[_0x5926('0xd9')]);if(!_0x3c60fa){return this['channel'][_0x5926('0x2a')](_0x15b5fe,_0x5926('0xdb'));}var _0x123228=this[_0x5926('0xe')][_0x5926('0x55')](_0x5926('0xdc'),[util['format'](_0x5926('0xdd'),_0x3c60fa),_0x15b5fe['timeout'],_0x15b5fe['opts'],_0x15b5fe[_0x5926('0x60')]]);if(_0x123228[_0x5926('0x9e')]===-0x1){return _0x123228;}return this[_0x5926('0xe')]['noop'](util[_0x5926('0x29')](_0x5926('0xde'),_0x5926('0xdc')));};AGIVertices[_0x5926('0x11')][_0x5926('0xdf')]=function(_0x16b991){logger[_0x5926('0x2b')](util['format'](_0x5926('0xe0'),_0x16b991['label']));if(!this[_0x5926('0x7d')](_0x16b991[_0x5926('0x74')])){return this[_0x5926('0xe')][_0x5926('0xa5')](_0x5926('0xe1'));}if(!this[_0x5926('0x7d')](_0x16b991[_0x5926('0x59')])){return this['channel'][_0x5926('0xa5')](_0x5926('0xbe'));}this[_0x5926('0xe')]['bot']=!![];this['createSquareDetailsReport'](_0x16b991);this[_0x5926('0x3e')](_0x16b991[_0x5926('0x59')],'in','','');this[_0x5926('0xe')][_0x5926('0xa5')](util['format'](_0x5926('0xe2'),_0x16b991['text']));var _0x438695=this[_0x5926('0x73')][_0x5926('0xa0')](this,_0x16b991);if(_0x438695){for(var _0x24c540 in _0x438695){if(_0x438695[_0x5926('0x8d')](_0x24c540)){this[_0x5926('0xe')][_0x5926('0x97')](util['format'](_0x5926('0xe3'),_0x24c540['toUpperCase']()),_0x438695[_0x24c540]);}}this[_0x5926('0x3e')](_0x438695[_0x5926('0xe4')],'out',_0x5926('0xdf'),'');return this['channel'][_0x5926('0xa5')](util[_0x5926('0x29')]('Dialogflow\x20Result\x20%s',_0x438695['speech']));}return this['channel'][_0x5926('0x2a')](_0x16b991,_0x5926('0xe5'));};AGIVertices['prototype'][_0x5926('0xe6')]=function(_0x528e0f){logger[_0x5926('0x2b')](util[_0x5926('0x29')](_0x5926('0xe7'),_0x528e0f[_0x5926('0x35')]));if(!this[_0x5926('0x7d')](_0x528e0f['dialogflowV2_project_id'])){return this[_0x5926('0xe')][_0x5926('0xa5')](_0x5926('0xe8'));}if(!this[_0x5926('0x7d')](_0x528e0f[_0x5926('0xe9')])){return this[_0x5926('0xe')]['noop'](_0x5926('0xea'));}if(!this[_0x5926('0x7d')](_0x528e0f['private_key'])){return this[_0x5926('0xe')][_0x5926('0xa5')](_0x5926('0xeb'));}if(!this['isConfigured'](_0x528e0f[_0x5926('0x77')])){return this[_0x5926('0xe')][_0x5926('0xa5')](_0x5926('0xec'));}if(!this['isConfigured'](_0x528e0f[_0x5926('0x59')])){return this[_0x5926('0xe')][_0x5926('0xa5')](_0x5926('0xbe'));}this[_0x5926('0xe')]['bot']=!![];this[_0x5926('0x33')](_0x528e0f);this[_0x5926('0x3e')](_0x528e0f[_0x5926('0x59')],'in','','');this[_0x5926('0xe')][_0x5926('0xa5')](util[_0x5926('0x29')](_0x5926('0xed'),_0x528e0f[_0x5926('0x59')]));var _0x3a0558=this[_0x5926('0x75')][_0x5926('0xa0')](this,_0x528e0f);if(_0x3a0558){for(var _0x49ce08 in _0x3a0558){if(_0x3a0558[_0x5926('0x8d')](_0x49ce08)){if(_0x49ce08!==_0x5926('0xee')){this['channel'][_0x5926('0x97')](util['format'](_0x5926('0xe3'),_0x49ce08[_0x5926('0x64')]()),_0x3a0558[_0x49ce08]);}}}this['createSquareMessage'](_0x3a0558[_0x5926('0xe4')],_0x5926('0xef'),_0x5926('0xe6'),_0x3a0558[_0x5926('0xee')]);return this['channel']['noop'](util[_0x5926('0x29')](_0x5926('0xf0'),_0x3a0558[_0x5926('0xe4')]));}return this[_0x5926('0xe')]['error'](_0x528e0f,_0x5926('0xf1'));};AGIVertices['prototype'][_0x5926('0xf2')]=function(_0x327cd9){logger[_0x5926('0x2b')](util[_0x5926('0x29')](_0x5926('0xf3'),_0x327cd9[_0x5926('0x35')]));if(!this[_0x5926('0x7d')](_0x327cd9[_0x5926('0xf4')])){return this[_0x5926('0xe')][_0x5926('0xa5')](_0x5926('0xf5'));}if(!this[_0x5926('0x7d')](_0x327cd9[_0x5926('0xf6')])){return this[_0x5926('0xe')][_0x5926('0xa5')](_0x5926('0xf7'));}if(!this[_0x5926('0x7d')](_0x327cd9['password'])){return this[_0x5926('0xe')]['noop']('no\x20password\x20configured');}if(!this[_0x5926('0x7d')](_0x327cd9[_0x5926('0xf8')])){return this['channel'][_0x5926('0xa5')]('no\x20text\x20configured');}this[_0x5926('0xe')][_0x5926('0xf9')]=!![];this[_0x5926('0x33')](_0x327cd9);this[_0x5926('0x3e')](_0x327cd9[_0x5926('0x59')],'in','','');this[_0x5926('0xe')][_0x5926('0xa5')](util['format'](_0x5926('0xfa'),_0x327cd9[_0x5926('0x59')]));var _0x1ace70=this[_0x5926('0x78')][_0x5926('0xa0')](this,_0x327cd9);if(_0x1ace70){for(var _0x141c60 in _0x1ace70){if(_0x1ace70[_0x5926('0x8d')](_0x141c60)){this[_0x5926('0xe')][_0x5926('0x97')](util[_0x5926('0x29')]('SESTEK_NDA_%s',_0x141c60['toUpperCase']()),_0x1ace70[_0x141c60]);}}this[_0x5926('0x3e')](_0x1ace70[_0x5926('0xe4')],_0x5926('0xef'),_0x5926('0xf2'),'');if(_0x1ace70[_0x5926('0xfb')]){this[_0x5926('0xe')]['noop'](util[_0x5926('0x29')](_0x5926('0xfc'),_0x1ace70['audiofile']));var _0x3d7f2c=this[_0x5926('0xe')]['streamFile'](_0x1ace70[_0x5926('0xfb')]);try{fs[_0x5926('0xfd')](_0x1ace70['audiofile']+_0x5926('0xfe'));}catch(_0x510406){logger[_0x5926('0x2a')](_0x510406);}return _0x3d7f2c;}else{return this[_0x5926('0xe')][_0x5926('0xa5')](util[_0x5926('0x29')](_0x5926('0xff'),_0x1ace70[_0x5926('0xe4')]));}}return this[_0x5926('0xe')]['error'](_0x327cd9,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0x5926('0x11')][_0x5926('0x100')]=function(_0x17490b){logger[_0x5926('0x2b')](util['format'](_0x5926('0x101'),_0x17490b[_0x5926('0x35')]));return this[_0x5926('0xe')][_0x5926('0xa5')](_0x5926('0x100'));};AGIVertices[_0x5926('0x11')][_0x5926('0x102')]=function(_0x32b690){logger[_0x5926('0x2b')](util[_0x5926('0x29')](_0x5926('0x103'),_0x32b690[_0x5926('0x35')]));var _0x31808e='';if(_0x32b690[_0x5926('0x104')]){if(!this[_0x5926('0x7d')](_0x32b690['trunk_id'])){return this['channel'][_0x5926('0x2a')](_0x32b690,_0x5926('0x105'));}else{var _0x1a6419=parseInt(_0x32b690[_0x5926('0x104')],0xa);if(isNaN(_0x1a6419)){_0x31808e=_0x32b690['trunk_id'];}else{_0x31808e=this[_0x5926('0x1b')][_0x5926('0xa0')](this,_0x32b690[_0x5926('0x104')]);if(!_0x31808e){return this['channel'][_0x5926('0x2a')](_0x32b690,_0x5926('0x106'));}}}}else if(_0x32b690[_0x5926('0x107')]){_0x31808e=_0x32b690[_0x5926('0x107')];}else{return this[_0x5926('0xe')][_0x5926('0x2a')](_0x32b690,_0x5926('0x105'));}var _0x2d27b8=this[_0x5926('0xe')][_0x5926('0x55')]('DIAL',[util[_0x5926('0x29')](_0x5926('0x108'),_0x31808e,_0x32b690[_0x5926('0x45')]),_0x32b690[_0x5926('0x61')],_0x32b690['opts'],_0x32b690[_0x5926('0x60')]]);if(_0x2d27b8['result']===-0x1){return _0x2d27b8;}return this['channel'][_0x5926('0xa5')](util[_0x5926('0x29')](_0x5926('0xde'),_0x5926('0xdc')));};AGIVertices['prototype'][_0x5926('0x109')]=function(_0x7cb9be){logger[_0x5926('0x2b')](util[_0x5926('0x29')](_0x5926('0x10a'),_0x7cb9be[_0x5926('0x35')]));return this[_0x5926('0xe')][_0x5926('0xa5')](_0x5926('0x109'));};AGIVertices[_0x5926('0x11')][_0x5926('0xd')]=function(_0xef1480){logger['info'](util[_0x5926('0x29')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0xef1480[_0x5926('0x35')]));if(_0xef1480[_0x5926('0xa1')]===0x0){return this[_0x5926('0xa2')](_0xef1480);}_0xef1480['retry']-=0x1;if(!this['isConfigured'](_0xef1480[_0x5926('0x10b')])){return this[_0x5926('0xe')][_0x5926('0x2a')](_0xef1480,'no\x20file\x20audio\x20selected');}var _0x437376=this['getSound']['sync'](this,_0xef1480['file_id']);if(!_0x437376){return this[_0x5926('0xe')][_0x5926('0x2a')](_0xef1480,_0x5926('0x10c'));}if(!this[_0x5926('0x7d')](_0xef1480[_0x5926('0xd0')])){return this[_0x5926('0xe')]['error'](_0x5926('0xd1'));}var _0x587cb4=this[_0x5926('0xe')][_0x5926('0x10d')](_0x437376,_0xef1480[_0x5926('0x10e')],_0xef1480[_0x5926('0x10f')]);var _0x103a01=_0x587cb4['result']?_0x587cb4[_0x5926('0x9e')][_0x5926('0x9c')]():'';logger[_0x5926('0x2b')]('test',JSON['stringify'](_0x587cb4));if(_0x587cb4['result']===-0x1){this[_0x5926('0x33')][_0x5926('0xa0')](this,_0xef1480,_0x103a01);return _0x587cb4;}else if(_0x587cb4[_0x5926('0x9b')]===_0x5926('0x61')){_0x587cb4['result']=_0x103a01[_0x5926('0x94')]>=parseInt(_0xef1480['mindigit'])?'x':'i';}else{_0x587cb4[_0x5926('0x9e')]=_0x103a01[_0x5926('0x94')]>=parseInt(_0xef1480[_0x5926('0x110')])&&_0x103a01[_0x5926('0x94')]<=parseInt(_0xef1480[_0x5926('0x10f')])?'x':'i';}var _0x561a98=this[_0x5926('0x9a')][_0x5926('0xa0')](this,_0xef1480[_0x5926('0xd0')]);if(!_0x561a98){return this[_0x5926('0xe')]['error'](_0xef1480,'no\x20variable\x20found');}this[_0x5926('0xe')][_0x5926('0x97')](_0x561a98,_0x103a01);if(this[_0x5926('0x7d')](_0xef1480[_0x5926('0x111')])){var _0x199a70=parseInt(_0xef1480['hiddendigitsnum'],0xa);var _0x4ed4cb=rs[_0x5926('0x112')]({'charset':'*','length':_0x199a70});var _0x322fb9=_0x103a01[_0x5926('0x94')];if(_0x322fb9>0x0){if(_0x322fb9>_0x199a70){this[_0x5926('0x33')][_0x5926('0xa0')](this,_0xef1480,_0xef1480[_0x5926('0x113')]===_0x5926('0x114')?_0x4ed4cb+_0x103a01[_0x5926('0x115')](_0x199a70):_0x103a01[_0x5926('0x115')](0x0,_0x322fb9-_0x199a70)+_0x4ed4cb);}else{this[_0x5926('0x33')]['sync'](this,_0xef1480,rs[_0x5926('0x112')]({'charset':'*','length':_0x322fb9}));}}else{this[_0x5926('0x33')][_0x5926('0xa0')](this,_0xef1480,'');}}else{this[_0x5926('0x33')][_0x5926('0xa0')](this,_0xef1480,_0x103a01);}return _0x587cb4;};AGIVertices['prototype'][_0x5926('0x116')]=function(_0x563046){logger[_0x5926('0x2b')](util['format'](_0x5926('0x117'),_0x563046[_0x5926('0x35')]));return this[_0x5926('0xd')](_0x563046);};AGIVertices[_0x5926('0x11')][_0x5926('0x118')]=function(_0x6224cc){logger['info'](util[_0x5926('0x29')](_0x5926('0x119'),_0x6224cc[_0x5926('0x35')]));this[_0x5926('0x33')][_0x5926('0xa0')](this,_0x6224cc,_0x6224cc[_0x5926('0x11a')]);return this[_0x5926('0xe')][_0x5926('0xa5')](util[_0x5926('0x29')](_0x5926('0x11b'),_0x6224cc[_0x5926('0x11a')]));};AGIVertices['prototype']['awspolly']=function(_0x23fc9f){logger['info'](util[_0x5926('0x29')](_0x5926('0x11c'),_0x23fc9f[_0x5926('0x35')]));if(!this['isConfigured'](_0x23fc9f[_0x5926('0x80')])||!this[_0x5926('0x7d')](_0x23fc9f[_0x5926('0x85')])){return this['channel'][_0x5926('0xa5')](_0x5926('0x11d'));}if(!this['isConfigured'](_0x23fc9f['text'])){return this[_0x5926('0xe')][_0x5926('0xa5')]('no\x20text\x20configured');}this[_0x5926('0xe')][_0x5926('0xa5')](util[_0x5926('0x29')](_0x5926('0x11e'),_0x23fc9f['text']));var _0x161d33=this[_0x5926('0x7f')][_0x5926('0xa0')](this,_0x23fc9f);if(_0x161d33){this[_0x5926('0xe')][_0x5926('0xa5')](util[_0x5926('0x29')](_0x5926('0x11f'),_0x161d33));var _0x303867=this[_0x5926('0xe')]['streamFile'](_0x161d33);try{fs[_0x5926('0xfd')](_0x161d33+_0x5926('0xfe'));}catch(_0x4c13dc){logger['error'](_0x4c13dc);}return _0x303867;}return this[_0x5926('0xe')][_0x5926('0x2a')](_0x23fc9f,_0x5926('0x120'));};AGIVertices[_0x5926('0x11')][_0x5926('0x121')]=function(_0x101ee3){logger[_0x5926('0x2b')](util[_0x5926('0x29')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x101ee3[_0x5926('0x35')]));if(!this['isConfigured'](_0x101ee3[_0x5926('0x80')])||!this[_0x5926('0x7d')](_0x101ee3['aws_secret_access_key'])){return this[_0x5926('0xe')][_0x5926('0xa5')](_0x5926('0x11d'));}if(!this[_0x5926('0x7d')](_0x101ee3[_0x5926('0x86')])){return this[_0x5926('0xe')][_0x5926('0xa5')]('no\x20bot\x20name\x20configured');}if(!this['isConfigured'](_0x101ee3[_0x5926('0x59')])){return this[_0x5926('0xe')][_0x5926('0xa5')](_0x5926('0xbe'));}this[_0x5926('0xe')][_0x5926('0xf9')]=!![];this[_0x5926('0x33')](_0x101ee3);this[_0x5926('0x3e')](_0x101ee3[_0x5926('0x59')],'in','','');this[_0x5926('0xe')][_0x5926('0xa5')](util[_0x5926('0x29')](_0x5926('0x122'),_0x101ee3[_0x5926('0x59')]));var _0x5501c7=this[_0x5926('0x84')][_0x5926('0xa0')](this,_0x101ee3);if(_0x5501c7){for(var _0x2f45fd in _0x5501c7){if(_0x5501c7[_0x5926('0x8d')](_0x2f45fd)&&_[_0x5926('0x8e')](_0x5501c7[_0x2f45fd])){this[_0x5926('0xe')][_0x5926('0x97')](util[_0x5926('0x29')](_0x5926('0x123'),_0x2f45fd[_0x5926('0x64')]()),_0x5501c7[_0x2f45fd]);}}if(_[_0x5926('0x44')](_0x5501c7['message'])){return this[_0x5926('0xe')][_0x5926('0xa5')](_0x5926('0x124'));}else{this['createSquareMessage'](_0x5501c7[_0x5926('0x125')],_0x5926('0xef'),_0x5926('0x126'),'');return this[_0x5926('0xe')]['noop'](util['format']('Amazon\x20Lex\x20Result\x20%s',_0x5501c7['message']));}}return this[_0x5926('0xe')]['error'](_0x101ee3,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x5926('0x11')]['googleasr']=function(_0xcb21b5){logger[_0x5926('0x2b')](util[_0x5926('0x29')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0xcb21b5['label'],_0xcb21b5[_0x5926('0x61')]));if(!this['isConfigured'](_0xcb21b5[_0x5926('0x74')])){return this[_0x5926('0xe')]['noop'](_0x5926('0xe1'));}var _0x3b86ea='wav';var _0x47b594=util[_0x5926('0x29')](_0x5926('0x127'),FILES_PATH,rs[_0x5926('0x112')](0x4));var _0x57a801=util[_0x5926('0x29')]('%s.%s',_0x47b594,_0x3b86ea);var _0x162334=!![];if(_0xcb21b5[_0x5926('0x128')]===_0x5926('0x129')){_0x162334=![];}var _0x43f67a=this[_0x5926('0xe')][_0x5926('0x12a')](_0x47b594,_0x3b86ea,_0xcb21b5[_0x5926('0x12b')],_0xcb21b5['timeout'],undefined,_0x162334);if(_0x43f67a['result']!==-0x1){this['channel'][_0x5926('0xa5')](util[_0x5926('0x29')](_0x5926('0x12c'),_0x57a801));var _0x389e18=this[_0x5926('0x87')][_0x5926('0xa0')](this,_0xcb21b5,_0x57a801);if(_0x389e18){for(var _0x33f000 in _0x389e18){if(_0x389e18[_0x5926('0x8d')](_0x33f000)){this[_0x5926('0xe')][_0x5926('0x97')](util[_0x5926('0x29')](_0x5926('0x12d'),_0x33f000[_0x5926('0x64')]()),_0x389e18[_0x33f000]);}}return this[_0x5926('0xe')][_0x5926('0xa5')](util[_0x5926('0x29')](_0x5926('0x12e'),JSON[_0x5926('0x6e')](_0x389e18)));}}return _0x43f67a;};AGIVertices['prototype'][_0x5926('0x12f')]=function(_0x508662){logger['info'](util[_0x5926('0x29')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x508662[_0x5926('0x35')]));if(!this[_0x5926('0x7d')](_0x508662[_0x5926('0x130')])){return this[_0x5926('0xe')][_0x5926('0xa5')](_0x5926('0x131'));}if(!this[_0x5926('0x7d')](_0x508662['appsecret'])){return this[_0x5926('0xe')][_0x5926('0xa5')](_0x5926('0x132'));}var _0x56abbc=_0x5926('0x133');var _0x485931=util['format'](_0x5926('0x127'),FILES_PATH,rs[_0x5926('0x112')](0x4));var _0x1dd0c9=util['format'](_0x5926('0x96'),_0x485931,_0x56abbc);var _0x50c761=!![];if(_0x508662['beep']===_0x5926('0x129')){_0x50c761=![];}var _0x11950d=this[_0x5926('0xe')][_0x5926('0x12a')](_0x485931,_0x56abbc,_0x508662[_0x5926('0x12b')],_0x508662[_0x5926('0x61')],undefined,_0x50c761);if(_0x11950d[_0x5926('0x9e')]!==-0x1){this[_0x5926('0xe')][_0x5926('0xa5')](util[_0x5926('0x29')](_0x5926('0x134'),_0x1dd0c9));var _0x448353=this['tildeASR']['sync'](this,_0x508662,_0x1dd0c9);if(_0x448353){for(var _0xf1ae62 in _0x448353){if(_0x448353[_0x5926('0x8d')](_0xf1ae62)){this[_0x5926('0xe')][_0x5926('0x97')](util[_0x5926('0x29')]('TILDE_ASR_%s',_0xf1ae62['toUpperCase']()),_0x448353[_0xf1ae62]);}}return this['channel']['noop'](util[_0x5926('0x29')](_0x5926('0x135'),JSON[_0x5926('0x6e')](_0x448353)));}}return _0x11950d;};AGIVertices[_0x5926('0x11')][_0x5926('0x136')]=function(_0x4c5bbc){logger[_0x5926('0x2b')](util[_0x5926('0x29')](_0x5926('0x137'),_0x4c5bbc[_0x5926('0x35')]));return this['channel'][_0x5926('0x138')](_0x4c5bbc[_0x5926('0x3a')],_0x4c5bbc['extension'],_0x4c5bbc[_0x5926('0x139')]);};AGIVertices['prototype'][_0x5926('0x13a')]=function(_0x423bde){logger['info'](util['format'](_0x5926('0x13b'),_0x423bde['label']));if(!this[_0x5926('0x7d')](_0x423bde[_0x5926('0x13c')])){return this['channel'][_0x5926('0x2a')](_0x423bde,_0x5926('0x13d'));}try{var _0xb3e1a1=eval(_0x423bde['condition'])?_0x5926('0x13e'):_0x5926('0x13f');this[_0x5926('0xe')][_0x5926('0xa5')](util['format']('EVAL\x20CONDITION\x20%s\x20%s',_0x423bde[_0x5926('0x13c')],_0xb3e1a1));return{'code':0xc8,'result':_0xb3e1a1};}catch(_0x3eb83c){return{'code':0xc8,'result':_0x5926('0x13f')};}};AGIVertices[_0x5926('0x11')][_0x5926('0x140')]=function(_0x5494c2){logger[_0x5926('0x2b')](util[_0x5926('0x29')](_0x5926('0x141'),_0x5494c2[_0x5926('0x35')]));if(!this['isConfigured'](_0x5494c2[_0x5926('0x142')])){return this[_0x5926('0xe')][_0x5926('0x2a')](_0x5494c2,_0x5926('0x143'));}var _0x1901b0=this[_0x5926('0x23')][_0x5926('0xa0')](this,_0x5494c2[_0x5926('0x142')]);if(!_0x1901b0){return this[_0x5926('0xe')][_0x5926('0x2a')](_0x5494c2,_0x5926('0x144'));}for(var _0x33527d=0x0;_0x33527d<_0x1901b0[_0x5926('0x94')];_0x33527d+=0x1){var _0x28a6da=this[_0x5926('0xe')]['getVariable'](util[_0x5926('0x29')](_0x5926('0x145'),_0x1901b0[_0x33527d]));if(_0x28a6da[_0x5926('0x9e')]===-0x1){return _0x28a6da;}logger[_0x5926('0x2b')](util[_0x5926('0x29')](_0x5926('0x146'),_0x1901b0[_0x33527d],_0x28a6da[_0x5926('0x9b')]));if(_0x28a6da[_0x5926('0x9b')]===_0x5926('0x13e')){logger['info'](util['format'](_0x5926('0x146'),_0x1901b0[_0x33527d],_0x5926('0x13e')));this[_0x5926('0xe')][_0x5926('0xa5')](util['format'](_0x5926('0x146'),_0x1901b0[_0x33527d],_0x5926('0x13e')));return{'code':0xc8,'result':_0x5926('0x13e')};}else{logger[_0x5926('0x2b')](util[_0x5926('0x29')](_0x5926('0x146'),_0x1901b0[_0x33527d],'false'));this[_0x5926('0xe')][_0x5926('0xa5')](util['format'](_0x5926('0x146'),_0x1901b0[_0x33527d],_0x5926('0x13f')));}}return{'code':0xc8,'result':_0x5926('0x13f')};};AGIVertices[_0x5926('0x11')][_0x5926('0x147')]=function(_0x3c948f){logger[_0x5926('0x2b')](util['format'](_0x5926('0x148'),_0x3c948f[_0x5926('0x35')]));return this[_0x5926('0xe')][_0x5926('0x147')]();};AGIVertices[_0x5926('0x11')][_0x5926('0x149')]=function(_0x12fe97){logger[_0x5926('0x2b')](util[_0x5926('0x29')](_0x5926('0x14a'),_0x12fe97[_0x5926('0x35')]));if(!this[_0x5926('0x7d')](_0x12fe97[_0x5926('0x74')])){return this[_0x5926('0xe')][_0x5926('0xa5')]('no\x20key\x20configured');}var _0x29870d=_0x5926('0x133');var _0x4bb6dd=util['format'](_0x5926('0x127'),FILES_PATH,rs[_0x5926('0x112')](0x4));var _0x3514c7=util[_0x5926('0x29')](_0x5926('0x96'),_0x4bb6dd,_0x29870d);var _0x589109=!![];if(_0x12fe97[_0x5926('0x128')]===_0x5926('0x129')){_0x589109=![];}var _0xd2c957=this[_0x5926('0xe')]['recordFile'](_0x4bb6dd,_0x29870d,_0x12fe97[_0x5926('0x12b')],_0x12fe97[_0x5926('0x61')],undefined,_0x589109);if(_0xd2c957['result']!==-0x1){this[_0x5926('0xe')][_0x5926('0xa5')](util['format'](_0x5926('0x14b'),_0x3514c7));var _0x2abdbc=this[_0x5926('0x7b')][_0x5926('0xa0')](this,_0x12fe97,_0x3514c7);if(_0x2abdbc){for(var _0x3aa7e in _0x2abdbc){if(_0x2abdbc[_0x5926('0x8d')](_0x3aa7e)){this['channel']['setVariable'](util['format'](_0x5926('0x14c'),_0x3aa7e[_0x5926('0x64')]()),_0x2abdbc[_0x3aa7e]);}}return this[_0x5926('0xe')][_0x5926('0xa5')](util[_0x5926('0x29')](_0x5926('0x14d'),JSON['stringify'](_0x2abdbc)));}}return _0xd2c957;};AGIVertices[_0x5926('0x11')]['ispeechtts']=function(_0x297b22){logger[_0x5926('0x2b')](util[_0x5926('0x29')](_0x5926('0x14e'),_0x297b22['label']));if(!this['isConfigured'](_0x297b22['key'])){return this['channel'][_0x5926('0xa5')](_0x5926('0xe1'));}if(!this[_0x5926('0x7d')](_0x297b22['text'])){return this['channel']['noop']('no\x20text\x20configured');}this['channel'][_0x5926('0xa5')](util[_0x5926('0x29')](_0x5926('0x14f'),_0x297b22[_0x5926('0x59')]));var _0x57c320=this[_0x5926('0x79')]['sync'](this,_0x297b22);if(_0x57c320){this[_0x5926('0xe')][_0x5926('0xa5')](util[_0x5926('0x29')](_0x5926('0x14b'),_0x57c320));var _0x4c7b4f=this[_0x5926('0xe')][_0x5926('0x150')](_0x57c320,_0x297b22['intKey']);try{fs[_0x5926('0xfd')](_0x57c320+_0x5926('0xfe'));}catch(_0x34b1eb){logger[_0x5926('0x2a')](_0x34b1eb);}return _0x4c7b4f;}return this[_0x5926('0xe')][_0x5926('0x2a')](_0x297b22,_0x5926('0x151'));};AGIVertices[_0x5926('0x11')]['login']=function(_0x2ab6fb){logger[_0x5926('0x2b')](util[_0x5926('0x29')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x2ab6fb['label']));if(!this[_0x5926('0x7d')](_0x2ab6fb[_0x5926('0x152')])){return this[_0x5926('0xe')][_0x5926('0x2a')](_0x2ab6fb,'no\x20find\x20by\x20configured');}logger[_0x5926('0x2b')](util['format'](_0x5926('0x153'),this[_0x5926('0xe')][_0x5926('0x37')],_0x2ab6fb[_0x5926('0x152')]));var _0x101f50=this[_0x5926('0x53')][_0x5926('0xa0')](this,_0x2ab6fb[_0x5926('0x152')]);if(_0x101f50){logger[_0x5926('0x2b')](util[_0x5926('0x29')](_0x5926('0x154'),this[_0x5926('0xe')]['callerid'],_0x2ab6fb[_0x5926('0x152')]));this['channel'][_0x5926('0xa5')](util[_0x5926('0x29')](_0x5926('0x154'),this[_0x5926('0xe')]['callerid'],_0x2ab6fb[_0x5926('0x152')]));return{'code':0xc8,'result':_0x5926('0x155')};}else{logger['info'](util['format'](_0x5926('0x156'),this[_0x5926('0xe')]['callerid'],_0x2ab6fb[_0x5926('0x152')]));this['channel'][_0x5926('0xa5')](util[_0x5926('0x29')](_0x5926('0x156'),this['channel'][_0x5926('0x37')],_0x2ab6fb['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x5926('0x11')][_0x5926('0x157')]=function(_0x4ca4c8){logger[_0x5926('0x2b')](util[_0x5926('0x29')](_0x5926('0x158'),_0x4ca4c8[_0x5926('0x35')]));if(!this['isConfigured'](_0x4ca4c8[_0x5926('0x152')])){return this[_0x5926('0xe')][_0x5926('0x2a')](_0x4ca4c8,_0x5926('0x159'));}logger['info'](util[_0x5926('0x29')](_0x5926('0x153'),this['channel'][_0x5926('0x37')],_0x4ca4c8[_0x5926('0x152')]));var _0x318b46=this['agentLogout'][_0x5926('0xa0')](this,_0x4ca4c8[_0x5926('0x152')]);if(_0x318b46){logger[_0x5926('0x2b')](util['format'](_0x5926('0x154'),this['channel']['callerid'],_0x4ca4c8[_0x5926('0x152')]));this[_0x5926('0xe')][_0x5926('0xa5')](util[_0x5926('0x29')](_0x5926('0x154'),this['channel'][_0x5926('0x37')],_0x4ca4c8[_0x5926('0x152')]));return{'code':0xc8,'result':_0x5926('0x155')};}else{logger[_0x5926('0x2b')](util[_0x5926('0x29')](_0x5926('0x156'),this[_0x5926('0xe')]['callerid'],_0x4ca4c8[_0x5926('0x152')]));this['channel'][_0x5926('0xa5')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x5926('0xe')][_0x5926('0x37')],_0x4ca4c8[_0x5926('0x152')]));return{'code':0xc8,'result':_0x5926('0x15a')};}};AGIVertices[_0x5926('0x11')]['math']=function(_0x1c2575){logger['info'](util['format']('Enter\x20in\x20MATH\x20(%s)\x20block',_0x1c2575['label']));if(!this['isConfigured'](_0x1c2575[_0x5926('0x15b')])){return this[_0x5926('0xe')][_0x5926('0x2a')](_0x1c2575,'no\x20operation\x20configured');}this[_0x5926('0xe')][_0x5926('0xa5')](util[_0x5926('0x29')](_0x5926('0x15c'),_0x1c2575[_0x5926('0x15b')]));var _0x521f03=eval(_0x1c2575[_0x5926('0x15b')]);if(!this[_0x5926('0x7d')](_0x1c2575['variable_id'])){return this[_0x5926('0xe')][_0x5926('0xa5')](_0x5926('0xd1'));}var _0x151306=this[_0x5926('0x9a')][_0x5926('0xa0')](this,_0x1c2575[_0x5926('0xd0')]);if(!_0x151306){return this[_0x5926('0xe')][_0x5926('0x2a')](_0x1c2575,_0x5926('0xd2'));}if(_['isArray'](_0x521f03)){var _0x409f7f=this;_0x521f03[_0x5926('0xd3')](function(_0xb23154,_0x53a23f){_0x409f7f[_0x5926('0xe')][_0x5926('0x97')](util[_0x5926('0x29')]('%s[%s]',_0x151306,_0x53a23f),_0xb23154);});return this[_0x5926('0xe')][_0x5926('0xa5')](util[_0x5926('0x29')]('variable\x20%s[key]\x20set',_0x151306));}else{return this[_0x5926('0xe')][_0x5926('0x97')](_0x151306,_0x521f03);}};AGIVertices[_0x5926('0x11')][_0x5926('0xc')]=function(_0x59c5ad){logger[_0x5926('0x2b')](util[_0x5926('0x29')](_0x5926('0x15d'),_0x59c5ad[_0x5926('0x35')]));if(_0x59c5ad[_0x5926('0xa1')]===0x0){return this['maxRetry'](_0x59c5ad);}_0x59c5ad[_0x5926('0xa1')]-=0x1;if(!this['isConfigured'](_0x59c5ad[_0x5926('0x10b')])){return this['channel'][_0x5926('0x2a')](_0x59c5ad,_0x5926('0x15e'));}var _0x59dd72=this[_0x5926('0x1d')][_0x5926('0xa0')](this,_0x59c5ad[_0x5926('0x10b')]);if(!_0x59dd72){return this[_0x5926('0xe')][_0x5926('0x2a')](_0x59c5ad,_0x5926('0x10c'));}var _0x1920f3=this[_0x5926('0xe')][_0x5926('0x10d')](_0x59dd72,_0x59c5ad[_0x5926('0x10e')],_0x59c5ad['digit']);var _0x80d72d=_0x1920f3[_0x5926('0x9e')];if(_0x1920f3[_0x5926('0x9e')]===-0x1){this[_0x5926('0x33')][_0x5926('0xa0')](this,_0x59c5ad,'-1');return _0x1920f3;}else if(_0x1920f3['extra']===_0x5926('0x61')){_0x1920f3['result']=_0x1920f3['result']['length']>0x0?_0x1920f3[_0x5926('0x9e')]:'t';}else if(_['isEmpty'](_0x1920f3[_0x5926('0x9e')])){_0x1920f3['result']='#';_0x80d72d='#';}if(!this[_0x5926('0x7d')](_0x59c5ad[_0x5926('0xd0')])){this[_0x5926('0xe')]['noop'](_0x5926('0xd1'));}else{var _0xfadcd5=this['getVariable']['sync'](this,_0x59c5ad[_0x5926('0xd0')]);if(!_0xfadcd5){return this['channel'][_0x5926('0x2a')](_0x59c5ad,_0x5926('0xd2'));}this[_0x5926('0xe')][_0x5926('0x97')](_0xfadcd5,_0x80d72d);}this[_0x5926('0x33')][_0x5926('0xa0')](this,_0x59c5ad,_0x80d72d);return _0x1920f3;};AGIVertices[_0x5926('0x11')][_0x5926('0xa5')]=function(_0x1916c9){logger['info'](util[_0x5926('0x29')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x1916c9[_0x5926('0x35')]));return this['channel'][_0x5926('0xa5')](_0x1916c9[_0x5926('0x15f')]||_0x1916c9[_0x5926('0x35')]);};AGIVertices[_0x5926('0x11')][_0x5926('0x160')]=function(_0x52a1c6){logger[_0x5926('0x2b')](util['format']('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x52a1c6[_0x5926('0x35')]));if(!this[_0x5926('0x7d')](_0x52a1c6[_0x5926('0x152')])){return this[_0x5926('0xe')]['error'](_0x52a1c6,_0x5926('0x159'));}logger[_0x5926('0x2b')](util[_0x5926('0x29')](_0x5926('0x153'),this[_0x5926('0xe')][_0x5926('0x37')],_0x52a1c6[_0x5926('0x152')]));var _0x5506bb=this[_0x5926('0x4a')][_0x5926('0xa0')](this,_0x52a1c6[_0x5926('0x161')]);var _0x440196=this[_0x5926('0x4d')][_0x5926('0xa0')](this,_0x52a1c6[_0x5926('0x152')],_0x5506bb);if(_0x440196){logger[_0x5926('0x2b')](util[_0x5926('0x29')](_0x5926('0x154'),this[_0x5926('0xe')][_0x5926('0x37')],_0x52a1c6['findBy']));this[_0x5926('0xe')][_0x5926('0xa5')](util[_0x5926('0x29')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x5926('0xe')]['callerid'],_0x52a1c6[_0x5926('0x152')]));return{'code':0xc8,'result':_0x5926('0x155')};}else{logger[_0x5926('0x2b')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x5926('0xe')]['callerid'],_0x52a1c6['findBy']));this[_0x5926('0xe')][_0x5926('0xa5')](util['format'](_0x5926('0x154'),this[_0x5926('0xe')][_0x5926('0x37')],_0x52a1c6[_0x5926('0x152')]));return{'code':0xc8,'result':_0x5926('0x15a')};}};AGIVertices[_0x5926('0x11')][_0x5926('0x162')]=function(_0x9afe3d){logger['info'](util['format']('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x9afe3d[_0x5926('0x35')]));if(!this[_0x5926('0x7d')](_0x9afe3d['file_id'])){return this[_0x5926('0xe')][_0x5926('0x2a')](_0x9afe3d,_0x5926('0x15e'));}var _0x22f35f=this['getSound'][_0x5926('0xa0')](this,_0x9afe3d['file_id']);if(!_0x22f35f){return this[_0x5926('0xe')][_0x5926('0x2a')](_0x9afe3d,_0x5926('0x10c'));}var _0x593c0d=this[_0x5926('0xe')][_0x5926('0x55')]('PLAYBACK',[_0x22f35f,_0x9afe3d[_0x5926('0x163')]]);if(_0x593c0d['result']===-0x1){return _0x593c0d;}return this[_0x5926('0xe')][_0x5926('0xa5')](util[_0x5926('0x29')](_0x5926('0x164'),_0x5926('0x165'),_0x22f35f));};AGIVertices[_0x5926('0x11')]['queue']=function(_0x295cc9){logger[_0x5926('0x2b')](util[_0x5926('0x29')](_0x5926('0x166'),_0x295cc9[_0x5926('0x35')]));if(!this[_0x5926('0x7d')](_0x295cc9['queue_id'])){return this[_0x5926('0xe')][_0x5926('0x2a')](_0x295cc9,_0x5926('0x167'));}var _0x1ac284='';var _0x15395c=parseInt(_0x295cc9[_0x5926('0x168')],0xa);if(isNaN(_0x15395c)){_0x1ac284=_0x295cc9[_0x5926('0x168')];}else{_0x1ac284=this[_0x5926('0x169')][_0x5926('0xa0')](this,_0x295cc9[_0x5926('0x168')]);if(!_0x1ac284){return this['channel'][_0x5926('0x2a')](_0x295cc9,_0x5926('0x16a'));}}var _0x35edbc='';if(this['isConfigured'](_0x295cc9['file_id'])){var _0xb7be6c=this['getSound'][_0x5926('0xa0')](this,_0x295cc9[_0x5926('0x10b')]);if(_0xb7be6c){_0x35edbc=_0xb7be6c;}}this[_0x5926('0x33')][_0x5926('0xa0')](this,_0x295cc9,_0x1ac284);if(_0x295cc9[_0x5926('0x163')][_0x5926('0x16b')]('x')<0x0){_0x295cc9[_0x5926('0x163')]+='x';}if(_0x295cc9['opts']['indexOf']('X')<0x0){_0x295cc9[_0x5926('0x163')]+='X';}this[_0x5926('0xe')][_0x5926('0x97')](_0x5926('0x16c'),_0x1ac284?_0x1ac284[_0x5926('0x16d')]():'');var _0x32f66b=this['channel'][_0x5926('0x55')](_0x5926('0x16e'),[_0x1ac284,_0x295cc9[_0x5926('0x163')],_0x295cc9[_0x5926('0x60')],_0x35edbc,_0x295cc9[_0x5926('0x61')],_0x295cc9['agi'],_0x295cc9[_0x5926('0x16f')],_0x295cc9[_0x5926('0x170')],'',_0x295cc9['position']]);if(_0x32f66b['result']===-0x1){return _0x32f66b;}return this[_0x5926('0xe')][_0x5926('0xa5')](util[_0x5926('0x29')](_0x5926('0x164'),_0x5926('0x16e'),_0x1ac284));};AGIVertices[_0x5926('0x11')][_0x5926('0x171')]=function(_0x11c647){logger[_0x5926('0x2b')](util[_0x5926('0x29')](_0x5926('0x172'),_0x11c647[_0x5926('0x35')]));var _0x11f789=_0x11c647[_0x5926('0x173')]||_0x5926('0x133');var _0x56e75a=util[_0x5926('0x29')](_0x5926('0x174'),this[_0x5926('0xe')][_0x5926('0x34')],rs[_0x5926('0x112')](0x5));var _0x284706=util[_0x5926('0x29')](_0x5926('0x175'),FILES_PATH,_0x56e75a,_0x11f789);var _0x33d761=util['format'](_0x5926('0x127'),FILES_PATH,_0x56e75a);this['createSquareRecording'][_0x5926('0xa0')](this,_0x11c647,_0x56e75a,_0x284706);this[_0x5926('0xe')][_0x5926('0x97')](_0x5926('0x176'),_0x56e75a);logger[_0x5926('0x2b')](_0x5926('0x177'),_0x33d761,_0x11f789,_0x11c647['escape_digits'],_0x11c647[_0x5926('0x61')]);return this[_0x5926('0xe')]['recordFile'](_0x33d761,_0x11f789,_0x11c647['escape_digits'],_0x11c647[_0x5926('0x61')],undefined,!![]);};AGIVertices[_0x5926('0x11')][_0x5926('0x178')]=function(_0x397143){logger[_0x5926('0x2b')](util[_0x5926('0x29')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x397143[_0x5926('0x35')]));if(!this[_0x5926('0x7d')](_0x397143[_0x5926('0x60')])){return this['channel'][_0x5926('0xa5')](_0x5926('0x179'));}var _0x5e2f64=this[_0x5926('0x17a')][_0x5926('0xa0')](this,_0x397143);logger[_0x5926('0x2b')](util['format']('Response:',util[_0x5926('0x17b')](_0x5e2f64,{'showHidden':![],'depth':null})));if(!this[_0x5926('0x7d')](_0x397143[_0x5926('0xd0')])){return this['channel']['noop'](_0x5926('0x17c'));}var _0x287a68=this[_0x5926('0x9a')][_0x5926('0xa0')](this,_0x397143[_0x5926('0xd0')]);if(!_0x287a68){return this[_0x5926('0xe')][_0x5926('0x2a')](_0x397143,_0x5926('0xd2'));}this[_0x5926('0xe')][_0x5926('0x97')](util[_0x5926('0x29')]('%s_STATUS_CODE',_0x287a68),_0x5e2f64['statusCode']?_0x5e2f64[_0x5926('0x70')]:'200');this[_0x5926('0xe')][_0x5926('0x97')](util[_0x5926('0x29')]('%s_STATUS_MESSAGE',_0x287a68),_0x5e2f64[_0x5926('0x71')]?_0x5e2f64[_0x5926('0x71')]:'OK');if(_0x5e2f64['body']){try{this[_0x5926('0x95')](_0x5e2f64[_0x5926('0x65')],_0x287a68);}catch(_0x3423c0){logger['error'](util[_0x5926('0x29')](_0x5926('0x17d'),_0x287a68));}}return this[_0x5926('0xe')][_0x5926('0xa5')](util['format'](_0x5926('0xd6'),_0x287a68));};AGIVertices[_0x5926('0x11')][_0x5926('0x17e')]=function(_0x3ccb6d){logger[_0x5926('0x2b')](util[_0x5926('0x29')](_0x5926('0x17f'),_0x3ccb6d[_0x5926('0x35')]));return this[_0x5926('0xe')]['sayDigits'](_0x3ccb6d[_0x5926('0x180')][_0x5926('0xce')](/\s+/g,''),_0x3ccb6d[_0x5926('0x181')]);};AGIVertices['prototype'][_0x5926('0x182')]=function(_0x23f12f){logger[_0x5926('0x2b')](util[_0x5926('0x29')](_0x5926('0x183'),_0x23f12f[_0x5926('0x35')]));return this['channel']['sayNumber'](_0x23f12f['number'][_0x5926('0xce')](/\s+/g,''),_0x23f12f[_0x5926('0x181')]);};AGIVertices[_0x5926('0x11')][_0x5926('0x184')]=function(_0x3ec3e8){logger[_0x5926('0x2b')](util[_0x5926('0x29')](_0x5926('0x185'),_0x3ec3e8[_0x5926('0x35')]));return this[_0x5926('0xe')][_0x5926('0x186')](_0x3ec3e8[_0x5926('0x59')],_0x3ec3e8['escape_digits']);};AGIVertices['prototype'][_0x5926('0x187')]=function(_0x55d70c){logger[_0x5926('0x2b')](util[_0x5926('0x29')](_0x5926('0x188'),_0x55d70c[_0x5926('0x35')]));if(!this['isConfigured'](_0x55d70c[_0x5926('0x189')])){return this[_0x5926('0xe')][_0x5926('0xa5')](_0x5926('0x18a'));}var _0x44d5ac=this[_0x5926('0x20')]['sync'](this,_0x55d70c[_0x5926('0x189')]);if(!_0x44d5ac||!_0x44d5ac[_0x5926('0x18b')]){return this[_0x5926('0xe')][_0x5926('0x2a')](_0x55d70c,_0x5926('0x18c'));}var _0x228c60={'from':util[_0x5926('0x29')](_0x5926('0x18d'),_0x44d5ac['name'],_0x44d5ac['email']||_0x44d5ac['Smtp'][_0x5926('0x18e')]),'to':_0x55d70c['to']||'','cc':_0x55d70c['cc']||'','bcc':_0x55d70c[_0x5926('0x18f')]||'','subject':_0x55d70c[_0x5926('0x190')],'html':_0x55d70c['text'],'text':_0x55d70c[_0x5926('0x59')]};var _0x354611={'tls':{'rejectUnauthorized':![]}};if(_0x44d5ac['Smtp'][_0x5926('0x191')]){_0x354611[_0x5926('0x191')]=_0x44d5ac[_0x5926('0x18b')][_0x5926('0x191')];}else{_0x354611['host']=_0x44d5ac[_0x5926('0x18b')][_0x5926('0x192')];_0x354611[_0x5926('0x193')]=_0x44d5ac[_0x5926('0x18b')][_0x5926('0x193')];_0x354611[_0x5926('0x194')]=_0x44d5ac[_0x5926('0x18b')][_0x5926('0x194')];}if(_0x44d5ac[_0x5926('0x18b')]['authentication']){_0x354611[_0x5926('0x195')]={'user':_0x44d5ac[_0x5926('0x18b')][_0x5926('0x18e')],'pass':_0x44d5ac[_0x5926('0x18b')][_0x5926('0x196')]};}if(this[_0x5926('0x7d')](_0x55d70c[_0x5926('0x197')])){}logger[_0x5926('0xd8')](_0x5926('0x198'),JSON[_0x5926('0x6e')](_0x228c60));this[_0x5926('0x33')][_0x5926('0xa0')](this,_0x55d70c,_0x55d70c[_0x5926('0x189')]);this[_0x5926('0xe')][_0x5926('0xa5')](util[_0x5926('0x29')](_0x5926('0x199'),_0x44d5ac[_0x5926('0x12')]));this[_0x5926('0x22')][_0x5926('0xa0')](this,_0x354611,_0x228c60);return this[_0x5926('0xe')][_0x5926('0xa5')](_0x5926('0x19a'));};AGIVertices[_0x5926('0x11')][_0x5926('0x19b')]=function(_0x487d80){logger[_0x5926('0x2b')](util[_0x5926('0x29')](_0x5926('0x19c'),_0x487d80[_0x5926('0x35')]));return this[_0x5926('0xe')][_0x5926('0xa5')](_0x5926('0x19d'));};AGIVertices[_0x5926('0x11')][_0x5926('0x19e')]=function(_0x3baf9d){logger[_0x5926('0x2b')](util['format'](_0x5926('0x19f'),_0x3baf9d['label']));if(!this[_0x5926('0x7d')](_0x3baf9d[_0x5926('0x1a0')])){return this[_0x5926('0xe')]['noop'](_0x5926('0x1a1'));}var _0x370851=this[_0x5926('0x30')][_0x5926('0xa0')](this,_0x3baf9d[_0x5926('0x1a0')]);if(!_0x370851){return this['channel']['error'](_0x3baf9d,_0x5926('0x1a2'));}var _0x47b1ef={'body':_0x3baf9d['sms_text'],'phone':_0x3baf9d['to']||'','SmsAccountId':_0x370851['id']};logger['debug'](_0x5926('0x1a3'),JSON[_0x5926('0x6e')](_0x47b1ef));this['createSquareDetailsReport'][_0x5926('0xa0')](this,_0x3baf9d,_0x3baf9d['sms_account_id']);this[_0x5926('0xe')][_0x5926('0xa5')](util['format']('Trying\x20SendSMS\x20with\x20account\x20%s',_0x370851[_0x5926('0x12')]));this[_0x5926('0x32')][_0x5926('0xa0')](this,_0x47b1ef);return this[_0x5926('0xe')][_0x5926('0xa5')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x5926('0x11')][_0x5926('0x1a4')]=function(_0xb09d5b){logger[_0x5926('0x2b')](util[_0x5926('0x29')](_0x5926('0x1a5'),_0xb09d5b['label']));if(!this['isConfigured'](_0xb09d5b[_0x5926('0xd0')])){return this[_0x5926('0xe')][_0x5926('0x2a')](_0xb09d5b,_0x5926('0x1a6'));}var _0x44ee35=this[_0x5926('0x9a')][_0x5926('0xa0')](this,_0xb09d5b['variable_id']);if(!_0x44ee35){return this['channel'][_0x5926('0x2a')](_0xb09d5b,'no\x20variable\x20found');}return this[_0x5926('0xe')]['setVariable'](_0x44ee35,_0xb09d5b['variable_value']);};AGIVertices[_0x5926('0x11')][_0x5926('0x1a7')]=function(_0xd023c0){logger['info'](util[_0x5926('0x29')](_0x5926('0x1a8'),_0xd023c0['label']));this[_0x5926('0xe')][_0x5926('0xa5')]('START\x20CALLY\x20SQUARE');if(_0xd023c0[_0x5926('0x1a9')]===_0x5926('0x1aa')){this[_0x5926('0xe')][_0x5926('0xa5')](_0x5926('0x1ab'));return this['channel'][_0x5926('0x1a9')]();}return this[_0x5926('0xe')][_0x5926('0xa5')](_0x5926('0x1ac'));};AGIVertices[_0x5926('0x11')]['subproject']=function(_0x4d7ba2){logger[_0x5926('0x2b')](util[_0x5926('0x29')](_0x5926('0x1ad'),_0x4d7ba2[_0x5926('0x35')]));if(!this[_0x5926('0x7d')](_0x4d7ba2[_0x5926('0x1ae')])){return this['channel'][_0x5926('0x2a')](_0x4d7ba2,'no\x20subproject\x20selected');}var _0x52d0f7=this['getSquareProject'][_0x5926('0xa0')](this,_0x4d7ba2['project_id']);if(!this[_0x5926('0x7d')](_0x52d0f7)){return this['channel'][_0x5926('0x2a')](_0x4d7ba2,util[_0x5926('0x29')](_0x5926('0x1af'),_0x4d7ba2['project_id']));}if(_0x52d0f7===this[_0x5926('0xe')]['arg_1']){return this['channel'][_0x5926('0x2a')](_0x4d7ba2,_0x5926('0x1b0'));}this[_0x5926('0x33')][_0x5926('0xa0')](this,_0x4d7ba2,_0x52d0f7);var _0x2288b1=this[_0x5926('0xe')][_0x5926('0x55')](_0x5926('0x1b1'),util['format'](_0x5926('0x1b2'),config[_0x5926('0x7')][_0x5926('0x192')]||_0x5926('0x1b3'),_0x52d0f7,this['channel'][_0x5926('0x1b4')]));if(_0x2288b1[_0x5926('0x9e')]===-0x1){return _0x2288b1;}return this[_0x5926('0xe')][_0x5926('0xa5')](util[_0x5926('0x29')]('Executed\x20command\x20%s\x20%s','AGI',_0x52d0f7));};AGIVertices[_0x5926('0x11')][_0x5926('0x1b5')]=function(_0x30af6a){logger[_0x5926('0x2b')](util[_0x5926('0x29')](_0x5926('0x1b6'),_0x30af6a[_0x5926('0x35')]));var _0x189000=this[_0x5926('0x54')][_0x5926('0xa0')](this,_0x30af6a[_0x5926('0xb1')]);this[_0x5926('0x33')]['sync'](this,_0x30af6a,_0x30af6a[_0x5926('0xb1')]);if(this[_0x5926('0x7d')](_0x30af6a[_0x5926('0xd0')])){var _0x2b68a2=this[_0x5926('0x9a')][_0x5926('0xa0')](this,_0x30af6a['variable_id']);if(_0x2b68a2){this[_0x5926('0xe')][_0x5926('0x97')](_0x2b68a2,_0x189000);return this[_0x5926('0xe')][_0x5926('0xa5')](util[_0x5926('0x29')](_0x5926('0x1b7'),_0x30af6a['command'],_0x2b68a2));}}return this[_0x5926('0xe')]['noop'](util[_0x5926('0x29')](_0x5926('0x1b8'),_0x30af6a[_0x5926('0xb1')]));};AGIVertices[_0x5926('0x11')][_0x5926('0x1b9')]=function(_0x56e4b9){logger[_0x5926('0x2b')](util['format'](_0x5926('0x1ba'),_0x56e4b9['label']));_0x56e4b9['text']=_0x56e4b9[_0x5926('0x59')][_0x5926('0xce')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x56e4b9[_0x5926('0x1bb')])){return this['channel'][_0x5926('0xa5')]('no\x20apiKey\x20configured');}if(!this[_0x5926('0x7d')](_0x56e4b9['text'])){return this['channel'][_0x5926('0xa5')](_0x5926('0xbe'));}this[_0x5926('0xe')][_0x5926('0xa5')](util['format']('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x56e4b9[_0x5926('0x59')]));var _0x3d374b=this[_0x5926('0x57')][_0x5926('0xa0')](this,_0x56e4b9);if(_0x3d374b){this[_0x5926('0xe')][_0x5926('0xa5')](util[_0x5926('0x29')](_0x5926('0x1bc'),_0x3d374b));var _0x5660e1=this[_0x5926('0xe')][_0x5926('0x150')](_0x3d374b);try{fs['unlink'](_0x3d374b+_0x5926('0xfe'));}catch(_0x4a9651){logger[_0x5926('0x2a')](_0x4a9651);}return _0x5660e1;}return this[_0x5926('0xe')][_0x5926('0x2a')](_0x56e4b9,_0x5926('0x1bd'));};AGIVertices['prototype']['tts']=function(_0x53f59c){logger[_0x5926('0x2b')](util[_0x5926('0x29')](_0x5926('0x1be'),_0x53f59c[_0x5926('0x35')]));_0x53f59c['text']=_0x53f59c[_0x5926('0x59')][_0x5926('0xce')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x5926('0x7d')](_0x53f59c[_0x5926('0x59')])){return this[_0x5926('0xe')][_0x5926('0xa5')](_0x5926('0xbe'));}this[_0x5926('0xe')]['noop'](util[_0x5926('0x29')](_0x5926('0x1bf'),_0x53f59c[_0x5926('0x59')]));var _0x2fda6e=this['googleTTS'][_0x5926('0xa0')](this,_0x53f59c);if(_0x2fda6e){this[_0x5926('0xe')]['noop'](util[_0x5926('0x29')]('Google\x20TTS\x20%s\x20file\x20created',_0x2fda6e));var _0x718fb5=this[_0x5926('0xe')][_0x5926('0x150')](_0x2fda6e);try{fs[_0x5926('0xfd')](_0x2fda6e+_0x5926('0xfe'));}catch(_0x2e412b){logger[_0x5926('0x2a')](_0x2e412b);}return _0x718fb5;}return this[_0x5926('0xe')][_0x5926('0x2a')](_0x53f59c,_0x5926('0x1c0'));};AGIVertices[_0x5926('0x11')]['unpause']=function(_0x5904f0){logger[_0x5926('0x2b')](util[_0x5926('0x29')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x5904f0[_0x5926('0x35')]));if(!this[_0x5926('0x7d')](_0x5904f0['findBy'])){return this[_0x5926('0xe')][_0x5926('0x2a')](_0x5904f0,_0x5926('0x159'));}logger[_0x5926('0x2b')](util[_0x5926('0x29')](_0x5926('0x153'),this[_0x5926('0xe')][_0x5926('0x37')],_0x5904f0[_0x5926('0x152')]));var _0xbafa92=this['agentUnpause']['sync'](this,_0x5904f0[_0x5926('0x152')]);if(_0xbafa92){logger[_0x5926('0x2b')](util[_0x5926('0x29')](_0x5926('0x154'),this[_0x5926('0xe')]['callerid'],_0x5904f0['findBy']));this[_0x5926('0xe')][_0x5926('0xa5')](util[_0x5926('0x29')](_0x5926('0x154'),this['channel'][_0x5926('0x37')],_0x5904f0[_0x5926('0x152')]));return{'code':0xc8,'result':_0x5926('0x155')};}else{logger[_0x5926('0x2b')](util[_0x5926('0x29')](_0x5926('0x156'),this[_0x5926('0xe')]['callerid'],_0x5904f0['findBy']));this[_0x5926('0xe')][_0x5926('0xa5')](util[_0x5926('0x29')](_0x5926('0x156'),this[_0x5926('0xe')][_0x5926('0x37')],_0x5904f0[_0x5926('0x152')]));return{'code':0xc8,'result':_0x5926('0x15a')};}};AGIVertices[_0x5926('0x11')]['voicemail']=function(_0xe3fb31){logger['info'](util[_0x5926('0x29')](_0x5926('0x1c1'),_0xe3fb31[_0x5926('0x35')]));var _0x26c4c6=this[_0x5926('0xe')][_0x5926('0x55')]('VOICEMAIL',[_0xe3fb31['mailbox'],_0xe3fb31[_0x5926('0xa6')]]);if(_0x26c4c6[_0x5926('0x9e')]===-0x1){return _0x26c4c6;}return this[_0x5926('0xe')][_0x5926('0xa5')](util[_0x5926('0x29')](_0x5926('0x164'),_0x5926('0x1c2'),_0xe3fb31[_0x5926('0x1c3')]));};AGIVertices[_0x5926('0x11')][_0x5926('0x1c4')]=function(_0x58e639){logger[_0x5926('0x2b')](util[_0x5926('0x29')](_0x5926('0x1c5'),_0x58e639[_0x5926('0x35')]));if(!this[_0x5926('0x7d')](_0x58e639[_0x5926('0xd0')])){return this[_0x5926('0xe')][_0x5926('0x2a')](_0x58e639,_0x5926('0x1a6'));}var _0x4e41a2=this['getVariable'][_0x5926('0xa0')](this,_0x58e639[_0x5926('0xd0')]);if(!_0x4e41a2){return this[_0x5926('0xe')][_0x5926('0x2a')](_0x58e639,_0x5926('0xd2'));}var _0x575e39=this['channel'][_0x5926('0x9a')](_0x4e41a2);return{'code':0xc8,'result':_0x575e39[_0x5926('0x9b')]?_0x575e39[_0x5926('0x9b')]:'-'};};String['prototype'][_0x5926('0x99')]=function(_0x346d4c,_0x502fc6){return this['split'](_0x346d4c)[_0x5926('0x1c6')](_0x502fc6);};module[_0x5926('0x1c7')]=AGIVertices; \ No newline at end of file +var _0x0ea9=['mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','result','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','label','grammar','no\x20grammar\x20configured','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','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','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','MRCPRecog','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','getQueryOdbc','variable_id','forEach','%s[%s][%s]','variable\x20%s\x20set','debug','sip_id','no\x20user\x20found','opts','DIAL','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','Trying\x20Dialogflow:\x20%s','speech','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','providerResponse','DIALOGFLOW_%s','toUpperCase','out','DialogflowV2\x20is\x20unreachable','sesteknda','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','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','Executed\x20command\x20%s','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','maxRetry','no\x20file\x20audio\x20selected','getSound','file_id','no\x20file\x20audio\x20found','no\x20variable\x20selected\x20for\x20the\x20result','getData','response','maxdigit','test','mindigit','no\x20variable\x20found','hiddendigitsnum','generate','hiddendigitspos','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','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','NOBEEP','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','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','Enter\x20in\x20GOTO\x20(%s)\x20block','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','true','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','failure','Enter\x20in\x20LOGOUT\x20(%s)\x20block','AGENT\x20%s\x20NOT\x20FOUND\x20BY','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','getPause','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','indexOf','toLowerCase','QUEUE','gosub','position','Executed\x20command\x20%s\x20%s','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','restAPI','Response:','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','number','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','Smtp','service','host','port','secure','authentication','auth','user','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','SENDFAX\x20block\x20not\x20implemented','sendSMS','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','google_cloud_tts','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','VOICEMAIL','mailbox','vswitch','join','exports','path','util','lodash','randomstring','moment','mustache','request-promise','agi','../../config/environment','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','name','catch','getVoiceQueue','getVoiceQueueById','then','getSquareProject','getSquareProjectById','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','Intervals','format','%s/sounds/converted/%s','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','query','Error\x20executing\x20query\x20%s','info','Query\x20executed\x20correctly\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','agicommand','arg_1','callerid','createSquareRecording','context','priority','accountcode','createSquareMessage','createCmContact','isEmpty','callback_','random','lastName','phone','list_id','uniqueid','callback','scheduledAt','toString','callback_priority','getPauseById','agent','agentPause','isNil','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','ssmlGender','MALE','googleTTS','url','method','timeout','includes','POST','PUT','body','parse','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','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','en-US','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','tildeASR','appid','appsecret','hasOwnProperty','isString','replaceObjectAllVariables','isPlainObject','recursiveNodeIndex','isArray','length','replaceAllVariables','saveRestApiResult','%s.%s','setVariable','split','extra','getAndSetVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','retry'];(function(_0x2b700e,_0x2cd396){var _0x1f1bf3=function(_0x183b64){while(--_0x183b64){_0x2b700e['push'](_0x2b700e['shift']());}};_0x1f1bf3(++_0x2cd396);}(_0x0ea9,0x130));var _0x90ea=function(_0x160dcb,_0x3451b5){_0x160dcb=_0x160dcb-0x0;var _0x2ce20a=_0x0ea9[_0x160dcb];return _0x2ce20a;};'use strict';var fs=require('fs');var path=require(_0x90ea('0x0'));var util=require(_0x90ea('0x1'));var _=require(_0x90ea('0x2'));var sh=require('shelljs');var odbc=require('odbc')();var rs=require(_0x90ea('0x3'));var moment=require(_0x90ea('0x4'));var Mustache=require(_0x90ea('0x5'));var rp=require(_0x90ea('0x6'));var logger=require('../../config/logger')(_0x90ea('0x7'));var config=require(_0x90ea('0x8'));var scripts=require('./scripts');var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0x90ea('0x9'),_0x90ea('0xa')];var verticesWithRetry=[_0x90ea('0xb'),_0x90ea('0xc'),_0x90ea('0xd')];var AGIVertices=function(_0xf01350,_0x3bee24,_0x142bcd){this[_0x90ea('0xe')]=_0xf01350;this[_0x90ea('0xf')]=_0x3bee24;this[_0x90ea('0x10')]=_0x142bcd;};AGIVertices[_0x90ea('0x11')][_0x90ea('0x12')]=function(_0xcc7650,_0x4ee506){this['rpc'][_0x90ea('0x13')](_0xcc7650)['then'](function(_0x4f48e9){_0x4ee506(null,_0x4f48e9?_0x4f48e9[_0x90ea('0x14')]:![]);})[_0x90ea('0x15')](function(_0x200e2a){_0x4ee506(_0x200e2a);});};AGIVertices[_0x90ea('0x11')][_0x90ea('0x16')]=function(_0x303d8f,_0x2cea38){this['rpc'][_0x90ea('0x17')](_0x303d8f)[_0x90ea('0x18')](function(_0x3e9525){_0x2cea38(null,_0x3e9525?_0x3e9525[_0x90ea('0x14')]:![]);})[_0x90ea('0x15')](function(_0x2535a0){_0x2cea38(_0x2535a0);});};AGIVertices[_0x90ea('0x11')][_0x90ea('0x19')]=function(_0x268315,_0x1b1b4e){this[_0x90ea('0xf')][_0x90ea('0x1a')](_0x268315)[_0x90ea('0x18')](function(_0x4df57d){_0x1b1b4e(null,_0x4df57d?_0x4df57d[_0x90ea('0x14')]:![]);})[_0x90ea('0x15')](function(_0x23502e){_0x1b1b4e(_0x23502e);});};AGIVertices[_0x90ea('0x11')]['getSquareOdbc']=function(_0x1946a1,_0xa233b2){this['rpc'][_0x90ea('0x1b')](_0x1946a1)[_0x90ea('0x18')](function(_0x43fb87){_0xa233b2(null,_0x43fb87?_0x43fb87[_0x90ea('0x1c')]:![]);})['catch'](function(_0x5e1d80){_0xa233b2(_0x5e1d80);});};AGIVertices[_0x90ea('0x11')][_0x90ea('0x1d')]=function(_0x21fbd7,_0x5422f8){this[_0x90ea('0xf')][_0x90ea('0x1e')](_0x21fbd7)[_0x90ea('0x18')](function(_0x3287f0){_0x5422f8(null,_0x3287f0?_0x3287f0[_0x90ea('0x14')]:![]);})[_0x90ea('0x15')](function(_0x14e86e){_0x5422f8(_0x14e86e);});};AGIVertices[_0x90ea('0x11')][_0x90ea('0x1f')]=function(_0x597154,_0x38efb1){this['rpc'][_0x90ea('0x20')](_0x597154)[_0x90ea('0x18')](function(_0x18bb87){_0x38efb1(null,_0x18bb87?_0x18bb87[_0x90ea('0x14')]:![]);})['catch'](function(_0x4c21ba){_0x38efb1(_0x4c21ba);});};AGIVertices[_0x90ea('0x11')]['getSound']=function(_0xe5893b,_0x4da4a9){var _0x1e2937=this;this[_0x90ea('0xf')]['getSoundById'](_0xe5893b)[_0x90ea('0x18')](function(_0x2863a1){_0x4da4a9(null,_0x2863a1?_0x1e2937[_0x90ea('0x21')](_0x2863a1[_0x90ea('0x22')]):![]);})[_0x90ea('0x15')](function(_0x13b4ff){_0x4da4a9(_0x13b4ff);});};AGIVertices[_0x90ea('0x11')][_0x90ea('0x23')]=function(_0x44cf46,_0x3066ba){this[_0x90ea('0xf')][_0x90ea('0x24')](_0x44cf46)['then'](function(_0x2a4152){_0x3066ba(null,_0x2a4152?_0x2a4152:![]);})[_0x90ea('0x15')](function(_0x2470d2){_0x3066ba(_0x2470d2);});};AGIVertices[_0x90ea('0x11')]['sendMailMessage']=function(_0x28a0ad,_0x42e210,_0x64b002){this[_0x90ea('0x10')][_0x90ea('0x25')](_0x28a0ad,_0x42e210)[_0x90ea('0x18')](function(){_0x64b002(null);})['catch'](function(_0x10ddf7){_0x64b002(_0x10ddf7);});};AGIVertices['prototype'][_0x90ea('0x26')]=function(_0x24b6df,_0x34c118){this[_0x90ea('0xf')][_0x90ea('0x27')](_0x24b6df)['then'](function(_0x161fc2){if(_0x161fc2){if(_0x161fc2['IntervalId']){_0x34c118(null,[_0x161fc2['interval']]);}else{_0x34c118(null,_['map'](_0x161fc2[_0x90ea('0x28')],'interval'));}}else{_0x34c118(null,![]);}})[_0x90ea('0x15')](function(_0x537252){_0x34c118(_0x537252);});};AGIVertices['prototype']['getSoundPath']=function(_0xbac25){return util[_0x90ea('0x29')](_0x90ea('0x2a'),FILES_PATH,_0xbac25);};AGIVertices[_0x90ea('0x11')]['getQueryOdbc']=function(_0xf3b74e,_0x2d2b2d,_0x2da3f6){odbc[_0x90ea('0x2b')](_0xf3b74e,function(_0x137db4){if(_0x137db4){logger[_0x90ea('0x2c')](_0x90ea('0x2d'),_0x137db4);_0x2da3f6(_0x137db4);}else{logger['info']('ODBC\x20connection\x20successfully');odbc[_0x90ea('0x2e')](_0x2d2b2d,function(_0x521dbd,_0x412245){if(_0x521dbd){logger['info'](_0x90ea('0x2f'),_0x2d2b2d);_0x2da3f6(_0x521dbd);}else{logger[_0x90ea('0x30')](_0x90ea('0x31'),_0x2d2b2d);odbc['close'](function(_0x209d7f){if(_0x209d7f){logger[_0x90ea('0x2c')](_0x90ea('0x32'),_0x209d7f);}_0x2da3f6(null,_0x412245);});}});}});};AGIVertices['prototype'][_0x90ea('0x33')]=function(_0x22416e,_0x1ef7f1){this[_0x90ea('0xf')][_0x90ea('0x34')](_0x22416e)['then'](function(_0x107629){_0x1ef7f1(null,_0x107629?_0x107629:![]);})[_0x90ea('0x15')](function(_0x19bc9a){_0x1ef7f1(_0x19bc9a);});};AGIVertices[_0x90ea('0x11')]['createSmsMessage']=function(_0x13b475,_0x448981){this[_0x90ea('0xf')][_0x90ea('0x35')](_0x13b475)['then'](function(_0x611e33){_0x448981(null,_0x611e33);})[_0x90ea('0x15')](function(_0x4d0e22){_0x448981(_0x4d0e22);});};AGIVertices[_0x90ea('0x11')]['createSquareDetailsReport']=function(_0x48b908,_0x4e57db,_0x8ba7b){this[_0x90ea('0xf')][_0x90ea('0x36')]({'uniqueid':this['channel']['uniqueid'],'node':_0x48b908['label'],'application':_0x48b908[_0x90ea('0x37')],'data':_0x4e57db||null,'project_name':this[_0x90ea('0xe')][_0x90ea('0x38')],'callerid':this[_0x90ea('0xe')][_0x90ea('0x39')]})[_0x90ea('0x18')](function(_0x55f2a9){if(_0x8ba7b){_0x8ba7b(null,_0x55f2a9);}})[_0x90ea('0x15')](function(_0x5c680d){if(_0x8ba7b){_0x8ba7b(_0x5c680d);}});};AGIVertices[_0x90ea('0x11')][_0x90ea('0x3a')]=function(_0x16d15f,_0x480baf,_0x5b70a0,_0x36eb5c){this[_0x90ea('0xf')][_0x90ea('0x3a')]({'uniqueid':this[_0x90ea('0xe')]['uniqueid'],'callerid':this[_0x90ea('0xe')][_0x90ea('0x39')],'calleridname':this[_0x90ea('0xe')]['calleridname'],'context':this['channel'][_0x90ea('0x3b')],'extension':this[_0x90ea('0xe')]['extension'],'priority':this[_0x90ea('0xe')][_0x90ea('0x3c')],'accountcode':this[_0x90ea('0xe')][_0x90ea('0x3d')],'dnid':this[_0x90ea('0xe')]['dnid'],'projectName':this[_0x90ea('0xe')]['arg_1'],'saveName':_0x480baf,'filename':_0x16d15f['file']||_0x480baf,'savePath':_0x5b70a0})['then'](function(_0x15b75f){_0x36eb5c(null,_0x15b75f);})[_0x90ea('0x15')](function(_0x32dfaa){_0x36eb5c(_0x32dfaa);});};AGIVertices[_0x90ea('0x11')]['createSquareMessage']=function(_0x47fbb5,_0x418108,_0x258635,_0x57a1a3,_0x303cb1){this[_0x90ea('0xf')][_0x90ea('0x3e')]({'uniqueid':this[_0x90ea('0xe')]['uniqueid'],'body':_0x47fbb5,'direction':_0x418108,'providerName':_0x258635,'providerResponse':_0x57a1a3})[_0x90ea('0x18')](function(_0x219c36){if(_0x303cb1){_0x303cb1(null,_0x219c36);}})[_0x90ea('0x15')](function(_0x2f5464){if(_0x303cb1){_0x303cb1(_0x2f5464);}});};AGIVertices['prototype'][_0x90ea('0x3f')]=function(_0x5c6303,_0x4fc48a){this[_0x90ea('0xf')][_0x90ea('0x3f')]({'firstName':_[_0x90ea('0x40')](_0x5c6303[_0x90ea('0x14')])||_['isNil'](_0x5c6303[_0x90ea('0x14')])?_0x90ea('0x41')+Math[_0x90ea('0x42')]():_0x5c6303[_0x90ea('0x14')],'lastName':_[_0x90ea('0x40')](_0x5c6303[_0x90ea('0x43')])||_['isNil'](_0x5c6303['lastName'])?null:_0x5c6303['lastName'],'phone':_0x5c6303[_0x90ea('0x44')],'ListId':_0x5c6303[_0x90ea('0x45')],'scheduledat':_0x5c6303['scheduledAt'],'callbackUniqueid':this['channel'][_0x90ea('0x46')],'tags':_0x90ea('0x47'),'description':'Callback\x20scheduled\x20at\x20'+_0x5c6303[_0x90ea('0x48')][_0x90ea('0x49')](),'priority':_0x5c6303[_0x90ea('0x4a')]})['then'](function(_0x1cbd98){_0x4fc48a(null,_0x1cbd98);})[_0x90ea('0x15')](function(_0x478532){_0x4fc48a(_0x478532);});};AGIVertices[_0x90ea('0x11')]['getPause']=function(_0x571daf,_0x36b671){this['rpc'][_0x90ea('0x4b')](_0x571daf)[_0x90ea('0x18')](function(_0x6a9fe2){_0x36b671(null,_0x6a9fe2?_0x6a9fe2[_0x90ea('0x14')]:![]);})[_0x90ea('0x15')](function(_0x55c2a4){_0x36b671(_0x55c2a4);});};AGIVertices[_0x90ea('0x11')]['agentPause']=function(_0x2fdbd6,_0x220d43,_0x221f03){var _0x22ae7d={'role':_0x90ea('0x4c')};_0x22ae7d[_0x2fdbd6]=this['channel']['callerid'];this[_0x90ea('0xf')][_0x90ea('0x4d')](_0x22ae7d,_0x220d43,this['channel']['uniqueid'])[_0x90ea('0x18')](function(_0x325abd){_0x221f03(null,_[_0x90ea('0x4e')](_0x325abd)?![]:!![]);})['catch'](function(_0x3597d6){logger[_0x90ea('0x2c')](_0x3597d6);_0x221f03(null,![]);});};AGIVertices[_0x90ea('0x11')][_0x90ea('0x4f')]=function(_0x3dd96d,_0x4b86b8){var _0x12b8ec={'role':_0x90ea('0x4c')};_0x12b8ec[_0x3dd96d]=this[_0x90ea('0xe')][_0x90ea('0x39')];this[_0x90ea('0xf')][_0x90ea('0x4f')](_0x12b8ec)['then'](function(_0x54caf8){_0x4b86b8(null,_[_0x90ea('0x4e')](_0x54caf8)?![]:!![]);})[_0x90ea('0x15')](function(_0x6604c6){logger[_0x90ea('0x2c')](_0x6604c6);_0x4b86b8(null,![]);});};AGIVertices[_0x90ea('0x11')]['agentLogout']=function(_0x1d261c,_0x43d663){var _0x130b8f={'role':_0x90ea('0x4c')};_0x130b8f[_0x1d261c]=this[_0x90ea('0xe')]['callerid'];this[_0x90ea('0xf')][_0x90ea('0x50')](_0x130b8f)[_0x90ea('0x18')](function(_0x2d95f0){_0x43d663(null,_[_0x90ea('0x4e')](_0x2d95f0)?![]:!![]);})[_0x90ea('0x15')](function(_0x273d0b){logger[_0x90ea('0x2c')](_0x273d0b);_0x43d663(null,![]);});};AGIVertices[_0x90ea('0x11')][_0x90ea('0x51')]=function(_0x3e7d31,_0x4a1e6c){var _0xfa3cbe={'role':_0x90ea('0x4c')};_0xfa3cbe[_0x3e7d31]=this[_0x90ea('0xe')][_0x90ea('0x39')];var _0x2408ec=_0x3e7d31!=_0x90ea('0x52')?util['format'](_0x90ea('0x53'),_0x90ea('0x54'),this[_0x90ea('0xe')]['callerid']):undefined;this[_0x90ea('0xf')]['agentLogin'](_0xfa3cbe,_0x2408ec)[_0x90ea('0x18')](function(_0x2c654a){_0x4a1e6c(null,_[_0x90ea('0x4e')](_0x2c654a)?![]:!![]);})[_0x90ea('0x15')](function(_0x9a3847){logger['error'](_0x9a3847);_0x4a1e6c(null,![]);});};AGIVertices['prototype'][_0x90ea('0x55')]=function(_0x5ca20c,_0x25cee6){sh[_0x90ea('0x56')](_[_0x90ea('0x57')](_0x5ca20c),function(_0x1f01e9,_0x11186c){var _0x5e09c1=_0x11186c[_0x90ea('0x58')](/(\r\n|\n|\r)/gm,'');_0x25cee6(null,_0x5e09c1);});};AGIVertices[_0x90ea('0x11')][_0x90ea('0x59')]=function(_0x1ce10b,_0x41c00b){scripts['googleCloudTTS'](_0x1ce10b[_0x90ea('0x5a')],_0x1ce10b[_0x90ea('0x5b')]||_0x90ea('0x5c'),_0x1ce10b[_0x90ea('0x5c')],_0x1ce10b[_0x90ea('0x5d')]||'en-US',_0x1ce10b[_0x90ea('0x5e')]||_0x90ea('0x5f'),_0x1ce10b['audioEncoding']||'MP3')[_0x90ea('0x18')](function(_0x391736){_0x41c00b(null,_0x391736);})['catch'](function(_0x3e470a){_0x41c00b(_0x3e470a);});};AGIVertices[_0x90ea('0x11')]['googleTTS']=function(_0x3856c8,_0x255ef7){scripts[_0x90ea('0x60')](_0x3856c8[_0x90ea('0x5c')],_0x3856c8['google_tts_language']||'en',0x1)[_0x90ea('0x18')](function(_0x28eac7){_0x255ef7(null,_0x28eac7);})[_0x90ea('0x15')](function(_0x48d010){_0x255ef7(_0x48d010);});};AGIVertices['prototype']['restAPI']=function(_0x5d2bd0,_0x37021d){var _0x36c244={'uri':_0x5d2bd0[_0x90ea('0x61')],'method':_0x5d2bd0[_0x90ea('0x62')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x5d2bd0['timeout'])==='number'&&parseInt(_0x5d2bd0[_0x90ea('0x63')])>=0x1?parseInt(_0x5d2bd0[_0x90ea('0x63')])*0x3e8:0x5*0x3e8};if(_[_0x90ea('0x64')]([_0x90ea('0x65'),_0x90ea('0x66')],_0x36c244[_0x90ea('0x62')]['toUpperCase']())){try{_0x36c244[_0x90ea('0x67')]=_0x5d2bd0[_0x90ea('0xa')]?JSON[_0x90ea('0x68')](_0x5d2bd0[_0x90ea('0xa')]):{};}catch(_0x4d1bd0){logger[_0x90ea('0x2c')](_0x90ea('0x69'),_0x4d1bd0);}}try{_0x36c244[_0x90ea('0x6a')]=_0x5d2bd0[_0x90ea('0x9')]?JSON['parse'](_0x5d2bd0[_0x90ea('0x9')]):{};}catch(_0x5e8cfd){logger[_0x90ea('0x2c')](_0x90ea('0x6b'),_0x5e8cfd);}if(_0x5d2bd0[_0x90ea('0x6c')]){try{var _0x5a8adc=require(_0x5d2bd0[_0x90ea('0x6c')])[_0x90ea('0x6d')](this,_0x36c244);_0x36c244[_0x90ea('0x6e')]=Mustache[_0x90ea('0x6f')](_0x5d2bd0[_0x90ea('0x61')],_0x5a8adc,{},['$$','$$']);if(_0x36c244['headers']){_0x36c244[_0x90ea('0x6a')]=JSON[_0x90ea('0x68')](Mustache[_0x90ea('0x6f')](JSON[_0x90ea('0x70')](_0x36c244['headers']),_0x5a8adc,{},['$$','$$']));}if(_0x36c244[_0x90ea('0x67')]){_0x36c244[_0x90ea('0x67')]=JSON[_0x90ea('0x68')](Mustache[_0x90ea('0x6f')](JSON[_0x90ea('0x70')](_0x36c244[_0x90ea('0x67')]),_0x5a8adc,{},['$$','$$']));}}catch(_0xa96399){logger['error'](_0x90ea('0x71'),_0xa96399);}}rp(_0x36c244)['then'](function(_0x447794){var _0x4f882f={'statusCode':_0x447794[_0x90ea('0x72')]||0xc8,'statusMessage':_0x447794[_0x90ea('0x73')]||'OK','headers':_0x447794[_0x90ea('0x6a')]||{},'body':_0x447794[_0x90ea('0x67')]||{}};_0x37021d(null,_0x4f882f);})[_0x90ea('0x15')](function(_0x37c143){var _0x17cd6f={'statusCode':_0x37c143[_0x90ea('0x72')]||0x1f4,'statusMessage':_0x37c143[_0x90ea('0x74')]||_0x90ea('0x75'),'headers':_0x37c143[_0x90ea('0x76')][_0x90ea('0x6a')]||{},'body':_0x37c143[_0x90ea('0x76')][_0x90ea('0x67')]||{}};_0x37021d(null,_0x17cd6f);});};AGIVertices[_0x90ea('0x11')][_0x90ea('0x77')]=function(_0x3afb5c,_0x2568c0){scripts[_0x90ea('0x77')](this[_0x90ea('0xe')]['uniqueid'],_0x3afb5c[_0x90ea('0x78')],_0x3afb5c['text'],_0x3afb5c[_0x90ea('0x79')]||'en')[_0x90ea('0x18')](function(_0x4cff88){_0x2568c0(null,_0x4cff88);})[_0x90ea('0x15')](function(_0x112019){_0x2568c0(_0x112019);});};AGIVertices[_0x90ea('0x11')][_0x90ea('0x7a')]=function(_0x11740d,_0x419d2d){scripts['googleDialogflowV2'](this['channel'][_0x90ea('0x46')],_0x11740d[_0x90ea('0x7b')],_0x11740d[_0x90ea('0x7c')],_0x11740d[_0x90ea('0x7d')],_0x11740d['text'],_0x11740d[_0x90ea('0x7e')]||'en')['then'](function(_0xcd8a49){_0x419d2d(null,_0xcd8a49);})[_0x90ea('0x15')](function(_0x37c28c){_0x419d2d(_0x37c28c);});};AGIVertices['prototype'][_0x90ea('0x7f')]=function(_0x5008d2,_0x312926){scripts[_0x90ea('0x7f')](this[_0x90ea('0xe')],_0x5008d2)[_0x90ea('0x18')](function(_0x37cfc1){_0x312926(null,_0x37cfc1);})[_0x90ea('0x15')](function(_0x3fb110){_0x312926(_0x3fb110);});};AGIVertices[_0x90ea('0x11')][_0x90ea('0x80')]=function(_0x22148f,_0x2cfd01){scripts[_0x90ea('0x80')](_0x22148f[_0x90ea('0x78')],_0x22148f[_0x90ea('0x5c')],_0x22148f[_0x90ea('0x81')]||_0x90ea('0x82'),_0x22148f['speed'])['then'](function(_0x56c314){_0x2cfd01(null,_0x56c314);})['catch'](function(_0x561319){_0x2cfd01(_0x561319);});};AGIVertices['prototype'][_0x90ea('0x83')]=function(_0x2dc7a7,_0x261dcf,_0x2b781e){scripts[_0x90ea('0x83')](_0x261dcf,_0x2dc7a7[_0x90ea('0x78')],_0x2dc7a7[_0x90ea('0x84')]||_0x90ea('0x82'),this[_0x90ea('0x85')](_0x2dc7a7[_0x90ea('0x86')])?_0x2dc7a7['model']:undefined)[_0x90ea('0x18')](function(_0x3362ed){_0x2b781e(null,_0x3362ed);})[_0x90ea('0x15')](function(_0x1626c2){_0x2b781e(_0x1626c2);});};AGIVertices[_0x90ea('0x11')][_0x90ea('0x87')]=function(_0x499585,_0x40ef25){scripts[_0x90ea('0x87')](_0x499585[_0x90ea('0x88')],_0x499585[_0x90ea('0x89')],_0x499585[_0x90ea('0x8a')],_0x499585[_0x90ea('0x8b')]||_0x90ea('0x8c'),_0x499585[_0x90ea('0x5c')],_0x499585[_0x90ea('0x8d')]||_0x90ea('0x5c'))[_0x90ea('0x18')](function(_0x47bd7d){_0x40ef25(null,_0x47bd7d);})[_0x90ea('0x15')](function(_0x180ea0){_0x40ef25(_0x180ea0);});};AGIVertices['prototype'][_0x90ea('0x8e')]=function(_0x5b9c0f,_0x35a333){scripts[_0x90ea('0x8e')](this[_0x90ea('0xe')][_0x90ea('0x46')],_0x5b9c0f[_0x90ea('0x88')],_0x5b9c0f['aws_secret_access_key'],_0x5b9c0f[_0x90ea('0x8f')],_0x5b9c0f['text'],_0x5b9c0f[_0x90ea('0x90')])[_0x90ea('0x18')](function(_0x4bc8e4){_0x35a333(null,_0x4bc8e4);})[_0x90ea('0x15')](function(_0x401c77){_0x35a333(_0x401c77);});};AGIVertices[_0x90ea('0x11')][_0x90ea('0x91')]=function(_0x1387a8,_0x49d387,_0x3b049b){scripts[_0x90ea('0x91')](_0x49d387,_0x1387a8[_0x90ea('0x78')],_0x1387a8['google_asr_language']||_0x90ea('0x82'))[_0x90ea('0x18')](function(_0x3d6cff){_0x3b049b(null,_0x3d6cff);})[_0x90ea('0x15')](function(_0x3bd1a1){_0x3b049b(_0x3bd1a1);});};AGIVertices[_0x90ea('0x11')][_0x90ea('0x92')]=function(_0x17e269,_0x322145,_0x4974ee){scripts['tildeASR'](_0x322145,_0x17e269[_0x90ea('0x93')],_0x17e269[_0x90ea('0x94')],_0x17e269['uri'])[_0x90ea('0x18')](function(_0x5c4372){_0x4974ee(null,_0x5c4372);})[_0x90ea('0x15')](function(_0x1f0655){_0x4974ee(_0x1f0655);});};AGIVertices[_0x90ea('0x11')]['clear']=function(_0x38ce53){var _0x4b0ae5=_['includes'](verticesWithRetry,_0x38ce53[_0x90ea('0x37')])?_0x38ce53:_['clone'](_0x38ce53);for(var _0x184a51 in _0x4b0ae5){if(_0x4b0ae5[_0x90ea('0x95')](_0x184a51)){if(_0x4b0ae5[_0x184a51]&&_[_0x90ea('0x96')](_0x4b0ae5[_0x184a51])){if(_['includes'](recursiveMapAttributes,_0x184a51)){_0x4b0ae5[_0x184a51]=this[_0x90ea('0x97')](_0x4b0ae5[_0x184a51]);}else{_0x4b0ae5[_0x184a51]=this['replaceAllVariables'](_0x4b0ae5[_0x184a51]);}}}}return _0x4b0ae5;};AGIVertices[_0x90ea('0x11')]['recursiveNodeIndex']=function(_0x5d8f79){for(var _0x345504 in _0x5d8f79){if(_0x5d8f79[_0x90ea('0x95')](_0x345504)){if(_[_0x90ea('0x98')](_0x5d8f79[_0x345504])){this[_0x90ea('0x99')](_0x5d8f79[_0x345504]);}else if(_[_0x90ea('0x9a')](_0x5d8f79[_0x345504])){for(var _0x5cbcf0=0x0;_0x5cbcf0<_0x5d8f79[_0x345504][_0x90ea('0x9b')];_0x5cbcf0++){this['recursiveNodeIndex'](_0x5d8f79[_0x345504][_0x5cbcf0]);}}else if(_[_0x90ea('0x96')](_0x5d8f79[_0x345504])){_0x5d8f79[_0x345504]=this[_0x90ea('0x9c')](_0x5d8f79[_0x345504]);}}}};AGIVertices['prototype']['saveRestApiResult']=function(_0x2715e7,_0x209ec8){for(var _0x280f4e in _0x2715e7){if(_0x2715e7[_0x90ea('0x95')](_0x280f4e)){if(_[_0x90ea('0x98')](_0x2715e7[_0x280f4e])){if(!_[_0x90ea('0x40')](_0x2715e7[_0x280f4e])){this[_0x90ea('0x9d')](_0x2715e7[_0x280f4e],util[_0x90ea('0x29')](_0x90ea('0x9e'),_0x209ec8,_0x280f4e));}}else if(_[_0x90ea('0x9a')](_0x2715e7[_0x280f4e])){for(var _0xa4381b=0x0;_0xa4381b<_0x2715e7[_0x280f4e][_0x90ea('0x9b')];_0xa4381b++){this[_0x90ea('0x9d')](_0x2715e7[_0x280f4e][_0xa4381b],util[_0x90ea('0x29')](_0x90ea('0x9e'),_0x209ec8,_0x280f4e+'['+_0xa4381b+']'));}}else{if(!_[_0x90ea('0x4e')](_0x2715e7[_0x280f4e])){this['channel'][_0x90ea('0x9f')](util[_0x90ea('0x29')](_0x90ea('0x9e'),_0x209ec8,_0x280f4e),_0x2715e7[_0x280f4e]);}}}}};AGIVertices[_0x90ea('0x11')][_0x90ea('0x97')]=function(_0x165bb1){try{var _0x299c90=JSON[_0x90ea('0x68')](_0x165bb1);this[_0x90ea('0x99')](_0x299c90);return JSON[_0x90ea('0x70')](_0x299c90);}catch(_0xc78e55){return this[_0x90ea('0x9c')](_0x165bb1);}};AGIVertices[_0x90ea('0x11')][_0x90ea('0x9c')]=function(_0x3124fa){var _0x15e32d=_0x3124fa[_0x90ea('0xa0')]('{');for(var _0x196f3b=0x1;_0x196f3b<_0x15e32d[_0x90ea('0x9b')];_0x196f3b+=0x1){var _0x4bba2c=_0x15e32d[_0x196f3b][_0x90ea('0xa0')]('}');if(_0x4bba2c[_0x90ea('0x9b')]>0x1){_0x3124fa=_0x3124fa['replaceAll']('{'+_0x4bba2c[0x0]+'}',this[_0x90ea('0xe')]['getVariable'](_0x4bba2c[0x0])[_0x90ea('0xa1')]||_0x4bba2c[0x0]);}}if(_0x15e32d[_0x90ea('0x9b')]===0x1){return _0x3124fa[_0x90ea('0x49')]();}return this[_0x90ea('0x9c')](_0x3124fa);};AGIVertices[_0x90ea('0x11')][_0x90ea('0xa2')]=function(_0x11d8aa,_0x314378){var _0x2b6666=this[_0x90ea('0xe')][_0x90ea('0x12')](_0x11d8aa);if(_0x2b6666['result']===-0x1){return _0x2b6666;}logger[_0x90ea('0x30')](util['format'](_0x90ea('0xa3'),_0x314378,_0x2b6666['extra']));return this[_0x90ea('0xe')][_0x90ea('0x9f')](_0x314378,_0x2b6666[_0x90ea('0xa1')]);};AGIVertices[_0x90ea('0x11')][_0x90ea('0x85')]=function(_0x3dcd39){return _0x3dcd39&&_0x3dcd39!=='0'&&_0x3dcd39!=='-1'&&_0x3dcd39!=='';};AGIVertices[_0x90ea('0x11')]['maxRetry']=function(_0x5237b4){this[_0x90ea('0x36')]['sync'](this,_0x5237b4,'-');_0x5237b4[_0x90ea('0xa4')]=_0x5237b4['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x90ea('0x11')][_0x90ea('0xa5')]=function(_0x255864){logger[_0x90ea('0x30')](util['format'](_0x90ea('0xa6'),_0x255864['label']));if(!this[_0x90ea('0x85')](_0x255864[_0x90ea('0x5c')])){return this[_0x90ea('0xe')][_0x90ea('0xa7')](_0x90ea('0xa8'));}var _0x2d4a52='\x22'+_0x255864[_0x90ea('0x5c')]+'\x22';if(this[_0x90ea('0x85')](_0x255864[_0x90ea('0x76')])){_0x2d4a52+=','+_0x255864[_0x90ea('0x76')];}var _0x377c07=this[_0x90ea('0xe')][_0x90ea('0x56')](_0x90ea('0xa9'),_0x2d4a52);if(_0x377c07[_0x90ea('0xaa')]===-0x1){return _0x377c07;}return this[_0x90ea('0xe')][_0x90ea('0xa7')](util['format'](_0x90ea('0xab'),_0x2d4a52));};AGIVertices['prototype'][_0x90ea('0xac')]=function(_0xeadc5){logger[_0x90ea('0x30')](util[_0x90ea('0x29')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0xeadc5[_0x90ea('0xad')]));if(!this[_0x90ea('0x85')](_0xeadc5[_0x90ea('0xae')])){return this[_0x90ea('0xe')]['noop'](_0x90ea('0xaf'));}var _0x12670b=_0xeadc5[_0x90ea('0xae')];if(this['isConfigured'](_0xeadc5[_0x90ea('0x76')])){_0x12670b+=','+_0xeadc5['options'];}var _0x1c0639=this[_0x90ea('0xe')]['exec']('MRCPRecog',_0x12670b);if(_0x1c0639['result']===-0x1){return _0x1c0639;}var _0x582b4c=this[_0x90ea('0xa2')]('RECOG_CONFIDENCE()',_0x90ea('0xb0'));if(_0x582b4c[_0x90ea('0xaa')]===-0x1){return _0x582b4c;}var _0x5c8a31=this[_0x90ea('0xa2')](_0x90ea('0xb1'),_0x90ea('0xb2'));if(_0x5c8a31['result']===-0x1){return _0x5c8a31;}var _0x220d4c=this[_0x90ea('0xa2')](_0x90ea('0xb3'),_0x90ea('0xb4'));if(_0x220d4c[_0x90ea('0xaa')]===-0x1){return _0x220d4c;}return this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')]('Executed\x20command\x20MRCPRecog\x20%s',_0x12670b));};AGIVertices[_0x90ea('0x11')]['agi']=function(_0x5107f2){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0xb5'),_0x5107f2['label']));return this[_0x90ea('0xe')][_0x90ea('0x7')]([_0x5107f2[_0x90ea('0xb6')],_0x5107f2[_0x90ea('0xb7')]]);};AGIVertices[_0x90ea('0x11')][_0x90ea('0xb8')]=function(_0xc58f8b){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0xb9'),_0xc58f8b[_0x90ea('0xad')]));if(this[_0x90ea('0x85')](_0xc58f8b['timeout'])){logger[_0x90ea('0x30')](util[_0x90ea('0x29')]('Wait\x20%s\x20seconds\x20before\x20answer',_0xc58f8b['timeout']));var _0x354985=this[_0x90ea('0xe')][_0x90ea('0xba')](_0xc58f8b[_0x90ea('0x63')]);if(_0x354985[_0x90ea('0xaa')]===-0x1){return _0x354985;}}return this['channel']['answer']();};AGIVertices['prototype'][_0x90ea('0x47')]=function(_0x49a453){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0xbb'),_0x49a453[_0x90ea('0xad')]));if(!this['isConfigured'](_0x49a453[_0x90ea('0x45')])){return this[_0x90ea('0xe')][_0x90ea('0x2c')](_0x49a453,'no\x20list\x20selected');}_0x49a453['scheduledAt']=moment();if(this[_0x90ea('0x85')](_0x49a453[_0x90ea('0xbc')])){_0x49a453[_0x90ea('0x48')]=moment()[_0x90ea('0xbd')](_0x49a453[_0x90ea('0xbc')],_0x90ea('0xbe'));}if(!this[_0x90ea('0x85')](_0x49a453[_0x90ea('0x4a')])){_0x49a453['callback_priority']=0x2;}this[_0x90ea('0x3f')]['sync'](this,_0x49a453);return this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')](_0x90ea('0xbf'),_0x49a453[_0x90ea('0x44')],_0x49a453[_0x90ea('0x45')],_0x49a453[_0x90ea('0x48')]));};AGIVertices[_0x90ea('0x11')][_0x90ea('0xc0')]=function(_0x3cac40){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0xc1'),_0x3cac40[_0x90ea('0xad')]));var _0x2f9496=this['channel'][_0x90ea('0x56')](_0x3cac40[_0x90ea('0xc2')],_0x3cac40[_0x90ea('0x76')]);if(_0x2f9496['result']===-0x1){return _0x2f9496;}return this[_0x90ea('0xe')]['noop'](util[_0x90ea('0x29')]('Executed\x20command\x20%s\x20%s',_0x3cac40['application'],_0x3cac40['options']));};AGIVertices['prototype'][_0x90ea('0xc3')]=function(_0x10cebf){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0xc4'),_0x10cebf[_0x90ea('0xad')]));if(!this[_0x90ea('0x85')](_0x10cebf[_0x90ea('0x5c')])){return this[_0x90ea('0xe')]['noop'](_0x90ea('0xa8'));}var _0x18174b='\x22'+_0x10cebf['text']+'\x22';if(this[_0x90ea('0x85')](_0x10cebf['options'])){_0x18174b+=','+_0x10cebf[_0x90ea('0x76')];}var _0x3d0c85=this['channel']['exec'](_0x90ea('0xa9'),_0x18174b);if(_0x3d0c85['result']===-0x1){return _0x3d0c85;}return this['channel'][_0x90ea('0xa7')](util[_0x90ea('0x29')]('Executed\x20command\x20MRCPSynth\x20%s',_0x18174b));};AGIVertices['prototype'][_0x90ea('0xc5')]=function(_0x134384){logger[_0x90ea('0x30')](util['format'](_0x90ea('0xc6'),_0x134384[_0x90ea('0xad')]));if(!this[_0x90ea('0x85')](_0x134384[_0x90ea('0x5c')])){return this[_0x90ea('0xe')]['noop']('no\x20text\x20configured');}var _0xf7eb61='\x22'+_0x134384[_0x90ea('0x5c')]+'\x22';if(this[_0x90ea('0x85')](_0x134384[_0x90ea('0x76')])){_0xf7eb61+=','+_0x134384[_0x90ea('0x76')];}var _0x19599c=this[_0x90ea('0xe')][_0x90ea('0x56')](_0x90ea('0xa9'),_0xf7eb61);if(_0x19599c[_0x90ea('0xaa')]===-0x1){return _0x19599c;}return this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')]('Executed\x20command\x20MRCPSynth\x20%s',_0xf7eb61));};AGIVertices[_0x90ea('0x11')][_0x90ea('0xc7')]=function(_0x50ead2){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0xc8'),_0x50ead2[_0x90ea('0xad')]));if(!this[_0x90ea('0x85')](_0x50ead2[_0x90ea('0xae')])){return this[_0x90ea('0xe')][_0x90ea('0xa7')](_0x90ea('0xaf'));}var _0x214991=_0x50ead2[_0x90ea('0xae')];if(this['isConfigured'](_0x50ead2[_0x90ea('0x76')])){_0x214991+=','+_0x50ead2[_0x90ea('0x76')];}var _0x140394=this['channel']['exec']('MRCPRecog',_0x214991);if(_0x140394['result']===-0x1){return _0x140394;}var _0x3bb669=this[_0x90ea('0xa2')](_0x90ea('0xc9'),_0x90ea('0xca'));if(_0x3bb669[_0x90ea('0xaa')]===-0x1){return _0x3bb669;}var _0x36aa80=this[_0x90ea('0xa2')](_0x90ea('0xb1'),_0x90ea('0xcb'));if(_0x36aa80[_0x90ea('0xaa')]===-0x1){return _0x36aa80;}var _0x3fd0d7=this[_0x90ea('0xa2')](_0x90ea('0xb3'),_0x90ea('0xcc'));if(_0x3fd0d7['result']===-0x1){return _0x3fd0d7;}return this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')](_0x90ea('0xcd'),_0x214991));};AGIVertices[_0x90ea('0x11')][_0x90ea('0xce')]=function(_0x1bf30c){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0xcf'),_0x1bf30c[_0x90ea('0xad')]));if(!this[_0x90ea('0x85')](_0x1bf30c[_0x90ea('0xae')])){return this[_0x90ea('0xe')][_0x90ea('0xa7')](_0x90ea('0xaf'));}var _0x4af84f=_0x1bf30c['grammar'];if(this[_0x90ea('0x85')](_0x1bf30c[_0x90ea('0x76')])){_0x4af84f+=','+_0x1bf30c['options'];}var _0x2edff9=this[_0x90ea('0xe')]['exec'](_0x90ea('0xd0'),_0x4af84f);if(_0x2edff9[_0x90ea('0xaa')]===-0x1){return _0x2edff9;}var _0x5c05d8=this[_0x90ea('0xa2')](_0x90ea('0xc9'),_0x90ea('0xd1'));if(_0x5c05d8[_0x90ea('0xaa')]===-0x1){return _0x5c05d8;}var _0x484f2e=this[_0x90ea('0xa2')](_0x90ea('0xb1'),_0x90ea('0xd2'));if(_0x484f2e[_0x90ea('0xaa')]===-0x1){return _0x484f2e;}var _0x4ebb3e=this[_0x90ea('0xa2')](_0x90ea('0xb3'),_0x90ea('0xd3'));if(_0x4ebb3e[_0x90ea('0xaa')]===-0x1){return _0x4ebb3e;}return this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')](_0x90ea('0xcd'),_0x4af84f));};AGIVertices[_0x90ea('0x11')]['database']=function(_0x436602){logger['info'](util['format'](_0x90ea('0xd4'),_0x436602[_0x90ea('0xad')]));if(!this[_0x90ea('0x85')](_0x436602[_0x90ea('0xd5')])){return this['channel'][_0x90ea('0x2c')](_0x436602,'no\x20database\x20selected');}var _0x4ff413=this['getSquareOdbc'][_0x90ea('0x6d')](this,_0x436602['odbc_id']);if(!_0x4ff413){return this[_0x90ea('0xe')]['error'](_0x436602,_0x90ea('0xd6'));}if(!this['isConfigured'](_0x436602[_0x90ea('0x2e')])){return this[_0x90ea('0xe')][_0x90ea('0x2c')](_0x436602,_0x90ea('0xd7'));}var _0x3c7f5b=_0x436602['query'][_0x90ea('0x58')](/(\r\n|\n|\r)/gm,'\x20');this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')](_0x90ea('0xd8'),_0x3c7f5b));var _0x4b5adb=this[_0x90ea('0xd9')][_0x90ea('0x6d')](this,_0x4ff413,_0x3c7f5b);this[_0x90ea('0x36')][_0x90ea('0x6d')](this,_0x436602,_0x3c7f5b);if(!this[_0x90ea('0x85')](_0x436602[_0x90ea('0xda')])){return this[_0x90ea('0xe')][_0x90ea('0xa7')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x184a65=this[_0x90ea('0x12')][_0x90ea('0x6d')](this,_0x436602[_0x90ea('0xda')]);if(!_0x184a65){return this['channel'][_0x90ea('0x2c')](_0x436602,'no\x20variable\x20found');}var _0x41fcb7=this;_0x4b5adb[_0x90ea('0xdb')](function(_0x4b7d7f,_0x207992){Object['keys'](_0x4b7d7f)[_0x90ea('0xdb')](function(_0x35b2bb){_0x41fcb7[_0x90ea('0xe')][_0x90ea('0x9f')](util['format'](_0x90ea('0xdc'),_0x184a65,_0x207992,_0x35b2bb),_0x4b7d7f[_0x35b2bb]);});});this[_0x90ea('0xe')][_0x90ea('0x9f')](util[_0x90ea('0x29')]('%s_ROWS_COUNT',_0x184a65),_0x4b5adb['length']);return this[_0x90ea('0xe')]['noop'](util['format'](_0x90ea('0xdd'),_0x184a65));};AGIVertices[_0x90ea('0x11')]['dial']=function(_0x529584){logger[_0x90ea('0xde')](util['format']('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x529584['label']));if(!this[_0x90ea('0x85')](_0x529584[_0x90ea('0xdf')])){return this[_0x90ea('0xe')]['error'](_0x529584,'no\x20user\x20selected');}var _0x36c54e=this[_0x90ea('0x1d')][_0x90ea('0x6d')](this,_0x529584[_0x90ea('0xdf')]);if(!_0x36c54e){return this[_0x90ea('0xe')]['error'](_0x529584,_0x90ea('0xe0'));}var _0x263a08=this['channel'][_0x90ea('0x56')]('DIAL',[util['format']('SIP/%s',_0x36c54e),_0x529584[_0x90ea('0x63')],_0x529584[_0x90ea('0xe1')],_0x529584[_0x90ea('0x61')]]);if(_0x263a08['result']===-0x1){return _0x263a08;}return this['channel'][_0x90ea('0xa7')](util[_0x90ea('0x29')]('Executed\x20command\x20%s',_0x90ea('0xe2')));};AGIVertices[_0x90ea('0x11')][_0x90ea('0xe3')]=function(_0x3b5f31){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0xe4'),_0x3b5f31[_0x90ea('0xad')]));if(!this[_0x90ea('0x85')](_0x3b5f31['key'])){return this[_0x90ea('0xe')][_0x90ea('0xa7')]('no\x20key\x20configured');}if(!this[_0x90ea('0x85')](_0x3b5f31[_0x90ea('0x5c')])){return this[_0x90ea('0xe')][_0x90ea('0xa7')](_0x90ea('0xa8'));}this['channel'][_0x90ea('0xe5')]=!![];this[_0x90ea('0x36')](_0x3b5f31);this[_0x90ea('0x3e')](_0x3b5f31[_0x90ea('0x5c')],'in','','');this['channel'][_0x90ea('0xa7')](util[_0x90ea('0x29')](_0x90ea('0xe6'),_0x3b5f31[_0x90ea('0x5c')]));var _0x16ac00=this[_0x90ea('0x77')]['sync'](this,_0x3b5f31);if(_0x16ac00){for(var _0x371a8a in _0x16ac00){if(_0x16ac00['hasOwnProperty'](_0x371a8a)){this[_0x90ea('0xe')][_0x90ea('0x9f')](util[_0x90ea('0x29')]('DIALOGFLOW_%s',_0x371a8a['toUpperCase']()),_0x16ac00[_0x371a8a]);}}this[_0x90ea('0x3e')](_0x16ac00[_0x90ea('0xe7')],'out',_0x90ea('0xe3'),'');return this['channel'][_0x90ea('0xa7')](util[_0x90ea('0x29')]('Dialogflow\x20Result\x20%s',_0x16ac00[_0x90ea('0xe7')]));}return this['channel'][_0x90ea('0x2c')](_0x3b5f31,_0x90ea('0xe8'));};AGIVertices[_0x90ea('0x11')][_0x90ea('0xe9')]=function(_0x4c74fe){logger['info'](util['format'](_0x90ea('0xea'),_0x4c74fe[_0x90ea('0xad')]));if(!this[_0x90ea('0x85')](_0x4c74fe[_0x90ea('0x7b')])){return this[_0x90ea('0xe')]['noop'](_0x90ea('0xeb'));}if(!this['isConfigured'](_0x4c74fe[_0x90ea('0x7c')])){return this[_0x90ea('0xe')][_0x90ea('0xa7')](_0x90ea('0xec'));}if(!this[_0x90ea('0x85')](_0x4c74fe[_0x90ea('0x7d')])){return this[_0x90ea('0xe')][_0x90ea('0xa7')](_0x90ea('0xed'));}if(!this[_0x90ea('0x85')](_0x4c74fe['dialogflowV2_language'])){return this[_0x90ea('0xe')][_0x90ea('0xa7')](_0x90ea('0xee'));}if(!this[_0x90ea('0x85')](_0x4c74fe[_0x90ea('0x5c')])){return this['channel']['noop'](_0x90ea('0xa8'));}this[_0x90ea('0xe')][_0x90ea('0xe5')]=!![];this[_0x90ea('0x36')](_0x4c74fe);this[_0x90ea('0x3e')](_0x4c74fe['text'],'in','','');this[_0x90ea('0xe')][_0x90ea('0xa7')](util['format']('Trying\x20DialogflowV2:\x20%s',_0x4c74fe[_0x90ea('0x5c')]));var _0x3e5adc=this[_0x90ea('0x7a')][_0x90ea('0x6d')](this,_0x4c74fe);if(_0x3e5adc){for(var _0x4f59b3 in _0x3e5adc){if(_0x3e5adc['hasOwnProperty'](_0x4f59b3)){if(_0x4f59b3!==_0x90ea('0xef')){this['channel'][_0x90ea('0x9f')](util[_0x90ea('0x29')](_0x90ea('0xf0'),_0x4f59b3[_0x90ea('0xf1')]()),_0x3e5adc[_0x4f59b3]);}}}this[_0x90ea('0x3e')](_0x3e5adc[_0x90ea('0xe7')],_0x90ea('0xf2'),_0x90ea('0xe9'),_0x3e5adc[_0x90ea('0xef')]);return this['channel']['noop'](util[_0x90ea('0x29')]('DialogflowV2\x20Result\x20%s',_0x3e5adc[_0x90ea('0xe7')]));}return this[_0x90ea('0xe')][_0x90ea('0x2c')](_0x4c74fe,_0x90ea('0xf3'));};AGIVertices[_0x90ea('0x11')][_0x90ea('0xf4')]=function(_0x53c32e){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0xf5'),_0x53c32e[_0x90ea('0xad')]));if(!this[_0x90ea('0x85')](_0x53c32e[_0x90ea('0xf6')])){return this[_0x90ea('0xe')]['noop'](_0x90ea('0xf7'));}if(!this[_0x90ea('0x85')](_0x53c32e[_0x90ea('0xf8')])){return this[_0x90ea('0xe')][_0x90ea('0xa7')](_0x90ea('0xf9'));}if(!this['isConfigured'](_0x53c32e['password'])){return this['channel'][_0x90ea('0xa7')](_0x90ea('0xfa'));}if(!this['isConfigured'](_0x53c32e[_0x90ea('0xfb')])){return this[_0x90ea('0xe')][_0x90ea('0xa7')](_0x90ea('0xa8'));}this[_0x90ea('0xe')][_0x90ea('0xe5')]=!![];this[_0x90ea('0x36')](_0x53c32e);this[_0x90ea('0x3e')](_0x53c32e[_0x90ea('0x5c')],'in','','');this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')](_0x90ea('0xfc'),_0x53c32e[_0x90ea('0x5c')]));var _0x641799=this[_0x90ea('0x7f')][_0x90ea('0x6d')](this,_0x53c32e);if(_0x641799){for(var _0x5519a6 in _0x641799){if(_0x641799[_0x90ea('0x95')](_0x5519a6)){this[_0x90ea('0xe')]['setVariable'](util[_0x90ea('0x29')](_0x90ea('0xfd'),_0x5519a6['toUpperCase']()),_0x641799[_0x5519a6]);}}this[_0x90ea('0x3e')](_0x641799['speech'],_0x90ea('0xf2'),'sesteknda','');if(_0x641799[_0x90ea('0xfe')]){this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')](_0x90ea('0xff'),_0x641799[_0x90ea('0xfe')]));var _0x5bc194=this[_0x90ea('0xe')][_0x90ea('0x100')](_0x641799[_0x90ea('0xfe')]);try{fs[_0x90ea('0x101')](_0x641799['audiofile']+_0x90ea('0x102'));}catch(_0x5d4602){logger[_0x90ea('0x2c')](_0x5d4602);}return _0x5bc194;}else{return this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')](_0x90ea('0x103'),_0x641799[_0x90ea('0xe7')]));}}return this['channel'][_0x90ea('0x2c')](_0x53c32e,_0x90ea('0x104'));};AGIVertices[_0x90ea('0x11')][_0x90ea('0x105')]=function(_0x3ea772){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0x106'),_0x3ea772[_0x90ea('0xad')]));return this[_0x90ea('0xe')][_0x90ea('0xa7')](_0x90ea('0x105'));};AGIVertices['prototype'][_0x90ea('0x107')]=function(_0x3e1304){logger[_0x90ea('0x30')](util['format']('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x3e1304['label']));var _0x2cb528='';if(_0x3e1304[_0x90ea('0x108')]){if(!this[_0x90ea('0x85')](_0x3e1304['trunk_id'])){return this['channel']['error'](_0x3e1304,_0x90ea('0x109'));}else{var _0x2a2b3d=parseInt(_0x3e1304[_0x90ea('0x108')],0xa);if(isNaN(_0x2a2b3d)){_0x2cb528=_0x3e1304[_0x90ea('0x108')];}else{_0x2cb528=this[_0x90ea('0x1f')]['sync'](this,_0x3e1304[_0x90ea('0x108')]);if(!_0x2cb528){return this[_0x90ea('0xe')][_0x90ea('0x2c')](_0x3e1304,_0x90ea('0x10a'));}}}}else if(_0x3e1304[_0x90ea('0x10b')]){_0x2cb528=_0x3e1304[_0x90ea('0x10b')];}else{return this[_0x90ea('0xe')][_0x90ea('0x2c')](_0x3e1304,_0x90ea('0x109'));}var _0x5647f4=this[_0x90ea('0xe')][_0x90ea('0x56')](_0x90ea('0xe2'),[util['format'](_0x90ea('0x10c'),_0x2cb528,_0x3e1304[_0x90ea('0x44')]),_0x3e1304[_0x90ea('0x63')],_0x3e1304[_0x90ea('0xe1')],_0x3e1304[_0x90ea('0x61')]]);if(_0x5647f4[_0x90ea('0xaa')]===-0x1){return _0x5647f4;}return this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')](_0x90ea('0x10d'),_0x90ea('0xe2')));};AGIVertices[_0x90ea('0x11')][_0x90ea('0x10e')]=function(_0x173ddb){logger[_0x90ea('0x30')](util[_0x90ea('0x29')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x173ddb[_0x90ea('0xad')]));return this[_0x90ea('0xe')][_0x90ea('0xa7')](_0x90ea('0x10e'));};AGIVertices['prototype']['getdigits']=function(_0x540f5e){logger['info'](util['format'](_0x90ea('0x10f'),_0x540f5e[_0x90ea('0xad')]));if(_0x540f5e[_0x90ea('0xa4')]===0x0){return this[_0x90ea('0x110')](_0x540f5e);}_0x540f5e[_0x90ea('0xa4')]-=0x1;if(!this[_0x90ea('0x85')](_0x540f5e['file_id'])){return this[_0x90ea('0xe')][_0x90ea('0x2c')](_0x540f5e,_0x90ea('0x111'));}var _0x211a47=this[_0x90ea('0x112')][_0x90ea('0x6d')](this,_0x540f5e[_0x90ea('0x113')]);if(!_0x211a47){return this[_0x90ea('0xe')][_0x90ea('0x2c')](_0x540f5e,_0x90ea('0x114'));}if(!this[_0x90ea('0x85')](_0x540f5e[_0x90ea('0xda')])){return this['channel'][_0x90ea('0x2c')](_0x90ea('0x115'));}var _0x2a2240=this[_0x90ea('0xe')][_0x90ea('0x116')](_0x211a47,_0x540f5e[_0x90ea('0x117')],_0x540f5e[_0x90ea('0x118')]);var _0x26f318=_0x2a2240['result']?_0x2a2240[_0x90ea('0xaa')]['toString']():'';logger[_0x90ea('0x30')](_0x90ea('0x119'),JSON['stringify'](_0x2a2240));if(_0x2a2240[_0x90ea('0xaa')]===-0x1){this[_0x90ea('0x36')][_0x90ea('0x6d')](this,_0x540f5e,_0x26f318);return _0x2a2240;}else if(_0x2a2240['extra']==='timeout'){_0x2a2240[_0x90ea('0xaa')]=_0x26f318['length']>=parseInt(_0x540f5e[_0x90ea('0x11a')])?'x':'i';}else{_0x2a2240[_0x90ea('0xaa')]=_0x26f318['length']>=parseInt(_0x540f5e['mindigit'])&&_0x26f318[_0x90ea('0x9b')]<=parseInt(_0x540f5e['maxdigit'])?'x':'i';}var _0x270f3d=this[_0x90ea('0x12')]['sync'](this,_0x540f5e[_0x90ea('0xda')]);if(!_0x270f3d){return this['channel'][_0x90ea('0x2c')](_0x540f5e,_0x90ea('0x11b'));}this['channel'][_0x90ea('0x9f')](_0x270f3d,_0x26f318);if(this['isConfigured'](_0x540f5e[_0x90ea('0x11c')])){var _0x3f3ee3=parseInt(_0x540f5e['hiddendigitsnum'],0xa);var _0x370a39=rs[_0x90ea('0x11d')]({'charset':'*','length':_0x3f3ee3});var _0x54a3f4=_0x26f318[_0x90ea('0x9b')];if(_0x54a3f4>0x0){if(_0x54a3f4>_0x3f3ee3){this['createSquareDetailsReport']['sync'](this,_0x540f5e,_0x540f5e[_0x90ea('0x11e')]==='first'?_0x370a39+_0x26f318[_0x90ea('0x11f')](_0x3f3ee3):_0x26f318[_0x90ea('0x11f')](0x0,_0x54a3f4-_0x3f3ee3)+_0x370a39);}else{this['createSquareDetailsReport'][_0x90ea('0x6d')](this,_0x540f5e,rs[_0x90ea('0x11d')]({'charset':'*','length':_0x54a3f4}));}}else{this['createSquareDetailsReport'][_0x90ea('0x6d')](this,_0x540f5e,'');}}else{this[_0x90ea('0x36')]['sync'](this,_0x540f5e,_0x26f318);}return _0x2a2240;};AGIVertices['prototype'][_0x90ea('0xd')]=function(_0x360f03){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0x120'),_0x360f03[_0x90ea('0xad')]));return this[_0x90ea('0xc')](_0x360f03);};AGIVertices[_0x90ea('0x11')][_0x90ea('0x121')]=function(_0x51e13c){logger[_0x90ea('0x30')](util['format']('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x51e13c[_0x90ea('0xad')]));this['createSquareDetailsReport'][_0x90ea('0x6d')](this,_0x51e13c,_0x51e13c[_0x90ea('0x122')]);return this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')](_0x90ea('0x123'),_0x51e13c['goalname']));};AGIVertices[_0x90ea('0x11')][_0x90ea('0x124')]=function(_0x32563e){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0x125'),_0x32563e[_0x90ea('0xad')]));if(!this[_0x90ea('0x85')](_0x32563e[_0x90ea('0x88')])||!this[_0x90ea('0x85')](_0x32563e['aws_secret_access_key'])){return this[_0x90ea('0xe')]['noop'](_0x90ea('0x126'));}if(!this['isConfigured'](_0x32563e[_0x90ea('0x5c')])){return this[_0x90ea('0xe')][_0x90ea('0xa7')](_0x90ea('0xa8'));}this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')](_0x90ea('0x127'),_0x32563e['text']));var _0x33e732=this[_0x90ea('0x87')][_0x90ea('0x6d')](this,_0x32563e);if(_0x33e732){this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')](_0x90ea('0x128'),_0x33e732));var _0xf81dac=this[_0x90ea('0xe')][_0x90ea('0x100')](_0x33e732);try{fs[_0x90ea('0x101')](_0x33e732+'.wav');}catch(_0x9844cb){logger[_0x90ea('0x2c')](_0x9844cb);}return _0xf81dac;}return this[_0x90ea('0xe')][_0x90ea('0x2c')](_0x32563e,_0x90ea('0x129'));};AGIVertices[_0x90ea('0x11')][_0x90ea('0x12a')]=function(_0x404467){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0x12b'),_0x404467[_0x90ea('0xad')]));if(!this['isConfigured'](_0x404467[_0x90ea('0x88')])||!this[_0x90ea('0x85')](_0x404467['aws_secret_access_key'])){return this[_0x90ea('0xe')][_0x90ea('0xa7')](_0x90ea('0x126'));}if(!this['isConfigured'](_0x404467['aws_bot_name'])){return this[_0x90ea('0xe')][_0x90ea('0xa7')]('no\x20bot\x20name\x20configured');}if(!this[_0x90ea('0x85')](_0x404467[_0x90ea('0x5c')])){return this[_0x90ea('0xe')][_0x90ea('0xa7')]('no\x20text\x20configured');}this['channel'][_0x90ea('0xe5')]=!![];this[_0x90ea('0x36')](_0x404467);this[_0x90ea('0x3e')](_0x404467[_0x90ea('0x5c')],'in','','');this['channel']['noop'](util[_0x90ea('0x29')](_0x90ea('0x12c'),_0x404467[_0x90ea('0x5c')]));var _0x213ba4=this[_0x90ea('0x8e')][_0x90ea('0x6d')](this,_0x404467);if(_0x213ba4){for(var _0x276925 in _0x213ba4){if(_0x213ba4['hasOwnProperty'](_0x276925)&&_['isString'](_0x213ba4[_0x276925])){this[_0x90ea('0xe')][_0x90ea('0x9f')](util[_0x90ea('0x29')](_0x90ea('0x12d'),_0x276925[_0x90ea('0xf1')]()),_0x213ba4[_0x276925]);}}if(_[_0x90ea('0x4e')](_0x213ba4[_0x90ea('0x74')])){return this['channel'][_0x90ea('0xa7')](_0x90ea('0x12e'));}else{this['createSquareMessage'](_0x213ba4[_0x90ea('0x74')],'out',_0x90ea('0x12f'),'');return this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')](_0x90ea('0x130'),_0x213ba4[_0x90ea('0x74')]));}}return this[_0x90ea('0xe')][_0x90ea('0x2c')](_0x404467,_0x90ea('0x131'));};AGIVertices[_0x90ea('0x11')][_0x90ea('0x132')]=function(_0x56321e){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0x133'),_0x56321e[_0x90ea('0xad')],_0x56321e[_0x90ea('0x63')]));if(!this['isConfigured'](_0x56321e['key'])){return this[_0x90ea('0xe')][_0x90ea('0xa7')](_0x90ea('0x134'));}var _0x3a1bba=_0x90ea('0x135');var _0x4c6ecd=util[_0x90ea('0x29')](_0x90ea('0x136'),FILES_PATH,rs['generate'](0x4));var _0x5a4a49=util['format'](_0x90ea('0x9e'),_0x4c6ecd,_0x3a1bba);var _0x34eae6=!![];if(_0x56321e[_0x90ea('0x137')]===_0x90ea('0x138')){_0x34eae6=![];}var _0x4051c9=this[_0x90ea('0xe')][_0x90ea('0x139')](_0x4c6ecd,_0x3a1bba,_0x56321e[_0x90ea('0x13a')],_0x56321e['timeout'],undefined,_0x34eae6);if(_0x4051c9[_0x90ea('0xaa')]!==-0x1){this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')](_0x90ea('0x13b'),_0x5a4a49));var _0x4ea617=this[_0x90ea('0x91')][_0x90ea('0x6d')](this,_0x56321e,_0x5a4a49);if(_0x4ea617){for(var _0x167327 in _0x4ea617){if(_0x4ea617[_0x90ea('0x95')](_0x167327)){this[_0x90ea('0xe')][_0x90ea('0x9f')](util[_0x90ea('0x29')](_0x90ea('0x13c'),_0x167327[_0x90ea('0xf1')]()),_0x4ea617[_0x167327]);}}return this['channel']['noop'](util[_0x90ea('0x29')](_0x90ea('0x13d'),JSON[_0x90ea('0x70')](_0x4ea617)));}}return _0x4051c9;};AGIVertices[_0x90ea('0x11')][_0x90ea('0x13e')]=function(_0x1f1e18){logger[_0x90ea('0x30')](util['format'](_0x90ea('0x13f'),_0x1f1e18[_0x90ea('0xad')]));if(!this[_0x90ea('0x85')](_0x1f1e18[_0x90ea('0x93')])){return this[_0x90ea('0xe')][_0x90ea('0xa7')](_0x90ea('0x140'));}if(!this['isConfigured'](_0x1f1e18['appsecret'])){return this['channel'][_0x90ea('0xa7')](_0x90ea('0x141'));}var _0xa0832f=_0x90ea('0x135');var _0x48bf69=util[_0x90ea('0x29')](_0x90ea('0x136'),FILES_PATH,rs[_0x90ea('0x11d')](0x4));var _0x260942=util[_0x90ea('0x29')](_0x90ea('0x9e'),_0x48bf69,_0xa0832f);var _0xa019da=!![];if(_0x1f1e18[_0x90ea('0x137')]==='NOBEEP'){_0xa019da=![];}var _0x28fcd0=this[_0x90ea('0xe')][_0x90ea('0x139')](_0x48bf69,_0xa0832f,_0x1f1e18[_0x90ea('0x13a')],_0x1f1e18[_0x90ea('0x63')],undefined,_0xa019da);if(_0x28fcd0['result']!==-0x1){this[_0x90ea('0xe')][_0x90ea('0xa7')](util['format'](_0x90ea('0x142'),_0x260942));var _0xc4d9c2=this[_0x90ea('0x92')]['sync'](this,_0x1f1e18,_0x260942);if(_0xc4d9c2){for(var _0x237b20 in _0xc4d9c2){if(_0xc4d9c2[_0x90ea('0x95')](_0x237b20)){this[_0x90ea('0xe')][_0x90ea('0x9f')](util[_0x90ea('0x29')]('TILDE_ASR_%s',_0x237b20[_0x90ea('0xf1')]()),_0xc4d9c2[_0x237b20]);}}return this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')](_0x90ea('0x143'),JSON[_0x90ea('0x70')](_0xc4d9c2)));}}return _0x28fcd0;};AGIVertices[_0x90ea('0x11')]['gotoc']=function(_0x400a18){logger[_0x90ea('0x30')](util['format'](_0x90ea('0x144'),_0x400a18[_0x90ea('0xad')]));return this[_0x90ea('0xe')]['continueAt'](_0x400a18[_0x90ea('0x3b')],_0x400a18['extension'],_0x400a18[_0x90ea('0x3c')]);};AGIVertices[_0x90ea('0x11')]['gotoif']=function(_0x4deb9a){logger['info'](util['format'](_0x90ea('0x145'),_0x4deb9a[_0x90ea('0xad')]));if(!this[_0x90ea('0x85')](_0x4deb9a['condition'])){return this[_0x90ea('0xe')][_0x90ea('0x2c')](_0x4deb9a,'no\x20condition\x20configured');}try{var _0x41c71a=eval(_0x4deb9a[_0x90ea('0x146')])?'true':_0x90ea('0x147');this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')](_0x90ea('0x148'),_0x4deb9a[_0x90ea('0x146')],_0x41c71a));return{'code':0xc8,'result':_0x41c71a};}catch(_0x46f6f1){return{'code':0xc8,'result':_0x90ea('0x147')};}};AGIVertices[_0x90ea('0x11')][_0x90ea('0x149')]=function(_0x3b81ce){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0x14a'),_0x3b81ce[_0x90ea('0xad')]));if(!this[_0x90ea('0x85')](_0x3b81ce[_0x90ea('0x14b')])){return this['channel'][_0x90ea('0x2c')](_0x3b81ce,_0x90ea('0x14c'));}var _0x1be00a=this[_0x90ea('0x26')][_0x90ea('0x6d')](this,_0x3b81ce['interval_id']);if(!_0x1be00a){return this[_0x90ea('0xe')][_0x90ea('0x2c')](_0x3b81ce,_0x90ea('0x14d'));}for(var _0x3e74e1=0x0;_0x3e74e1<_0x1be00a['length'];_0x3e74e1+=0x1){var _0xeeb762=this[_0x90ea('0xe')][_0x90ea('0x12')](util[_0x90ea('0x29')](_0x90ea('0x14e'),_0x1be00a[_0x3e74e1]));if(_0xeeb762[_0x90ea('0xaa')]===-0x1){return _0xeeb762;}logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0x14f'),_0x1be00a[_0x3e74e1],_0xeeb762[_0x90ea('0xa1')]));if(_0xeeb762[_0x90ea('0xa1')]===_0x90ea('0x150')){logger['info'](util[_0x90ea('0x29')](_0x90ea('0x14f'),_0x1be00a[_0x3e74e1],_0x90ea('0x150')));this['channel'][_0x90ea('0xa7')](util['format']('IFTIME\x20%s\x20%s',_0x1be00a[_0x3e74e1],_0x90ea('0x150')));return{'code':0xc8,'result':_0x90ea('0x150')};}else{logger[_0x90ea('0x30')](util['format']('IFTIME\x20%s\x20%s',_0x1be00a[_0x3e74e1],_0x90ea('0x147')));this['channel']['noop'](util['format'](_0x90ea('0x14f'),_0x1be00a[_0x3e74e1],_0x90ea('0x147')));}}return{'code':0xc8,'result':_0x90ea('0x147')};};AGIVertices[_0x90ea('0x11')][_0x90ea('0x151')]=function(_0x2819f4){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0x152'),_0x2819f4['label']));return this['channel'][_0x90ea('0x151')]();};AGIVertices['prototype'][_0x90ea('0x153')]=function(_0x3706e6){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0x154'),_0x3706e6[_0x90ea('0xad')]));if(!this[_0x90ea('0x85')](_0x3706e6[_0x90ea('0x78')])){return this[_0x90ea('0xe')][_0x90ea('0xa7')](_0x90ea('0x134'));}var _0x2017b4='wav';var _0x33da71=util[_0x90ea('0x29')](_0x90ea('0x136'),FILES_PATH,rs[_0x90ea('0x11d')](0x4));var _0x3e0366=util['format'](_0x90ea('0x9e'),_0x33da71,_0x2017b4);var _0x2e37c8=!![];if(_0x3706e6[_0x90ea('0x137')]===_0x90ea('0x138')){_0x2e37c8=![];}var _0xb75e53=this['channel'][_0x90ea('0x139')](_0x33da71,_0x2017b4,_0x3706e6[_0x90ea('0x13a')],_0x3706e6[_0x90ea('0x63')],undefined,_0x2e37c8);if(_0xb75e53['result']!==-0x1){this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')](_0x90ea('0x155'),_0x3e0366));var _0x5aad80=this[_0x90ea('0x83')][_0x90ea('0x6d')](this,_0x3706e6,_0x3e0366);if(_0x5aad80){for(var _0x5721dc in _0x5aad80){if(_0x5aad80[_0x90ea('0x95')](_0x5721dc)){this[_0x90ea('0xe')]['setVariable'](util['format'](_0x90ea('0x156'),_0x5721dc[_0x90ea('0xf1')]()),_0x5aad80[_0x5721dc]);}}return this[_0x90ea('0xe')]['noop'](util['format']('IspeechASR\x20Result\x20%s',JSON['stringify'](_0x5aad80)));}}return _0xb75e53;};AGIVertices[_0x90ea('0x11')][_0x90ea('0x157')]=function(_0x7363f1){logger['info'](util[_0x90ea('0x29')](_0x90ea('0x158'),_0x7363f1['label']));if(!this[_0x90ea('0x85')](_0x7363f1[_0x90ea('0x78')])){return this[_0x90ea('0xe')][_0x90ea('0xa7')](_0x90ea('0x134'));}if(!this['isConfigured'](_0x7363f1[_0x90ea('0x5c')])){return this[_0x90ea('0xe')][_0x90ea('0xa7')](_0x90ea('0xa8'));}this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')](_0x90ea('0x159'),_0x7363f1[_0x90ea('0x5c')]));var _0x53491a=this[_0x90ea('0x80')]['sync'](this,_0x7363f1);if(_0x53491a){this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')](_0x90ea('0x155'),_0x53491a));var _0x5bef0c=this[_0x90ea('0xe')][_0x90ea('0x100')](_0x53491a,_0x7363f1[_0x90ea('0x13a')]);try{fs[_0x90ea('0x101')](_0x53491a+_0x90ea('0x102'));}catch(_0x3b2f47){logger['error'](_0x3b2f47);}return _0x5bef0c;}return this[_0x90ea('0xe')]['error'](_0x7363f1,_0x90ea('0x15a'));};AGIVertices[_0x90ea('0x11')][_0x90ea('0x15b')]=function(_0x29af91){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0x15c'),_0x29af91['label']));if(!this[_0x90ea('0x85')](_0x29af91[_0x90ea('0x15d')])){return this['channel'][_0x90ea('0x2c')](_0x29af91,_0x90ea('0x15e'));}logger['info'](util[_0x90ea('0x29')](_0x90ea('0x15f'),this[_0x90ea('0xe')][_0x90ea('0x39')],_0x29af91[_0x90ea('0x15d')]));var _0x5c7e7c=this[_0x90ea('0x51')][_0x90ea('0x6d')](this,_0x29af91['findBy']);if(_0x5c7e7c){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0x160'),this[_0x90ea('0xe')]['callerid'],_0x29af91['findBy']));this['channel'][_0x90ea('0xa7')](util[_0x90ea('0x29')](_0x90ea('0x160'),this[_0x90ea('0xe')][_0x90ea('0x39')],_0x29af91['findBy']));return{'code':0xc8,'result':_0x90ea('0x161')};}else{logger[_0x90ea('0x30')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x90ea('0xe')]['callerid'],_0x29af91[_0x90ea('0x15d')]));this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x90ea('0xe')][_0x90ea('0x39')],_0x29af91[_0x90ea('0x15d')]));return{'code':0xc8,'result':_0x90ea('0x162')};}};AGIVertices[_0x90ea('0x11')]['logout']=function(_0x245ebe){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0x163'),_0x245ebe[_0x90ea('0xad')]));if(!this[_0x90ea('0x85')](_0x245ebe[_0x90ea('0x15d')])){return this[_0x90ea('0xe')][_0x90ea('0x2c')](_0x245ebe,_0x90ea('0x15e'));}logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0x15f'),this[_0x90ea('0xe')][_0x90ea('0x39')],_0x245ebe[_0x90ea('0x15d')]));var _0x54a22a=this['agentLogout'][_0x90ea('0x6d')](this,_0x245ebe['findBy']);if(_0x54a22a){logger['info'](util['format'](_0x90ea('0x160'),this['channel'][_0x90ea('0x39')],_0x245ebe[_0x90ea('0x15d')]));this[_0x90ea('0xe')][_0x90ea('0xa7')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x90ea('0x39')],_0x245ebe[_0x90ea('0x15d')]));return{'code':0xc8,'result':_0x90ea('0x161')};}else{logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0x164'),this['channel']['callerid'],_0x245ebe[_0x90ea('0x15d')]));this[_0x90ea('0xe')][_0x90ea('0xa7')](util['format'](_0x90ea('0x164'),this[_0x90ea('0xe')]['callerid'],_0x245ebe[_0x90ea('0x15d')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype']['math']=function(_0x55aecc){logger[_0x90ea('0x30')](util['format'](_0x90ea('0x165'),_0x55aecc[_0x90ea('0xad')]));if(!this[_0x90ea('0x85')](_0x55aecc[_0x90ea('0x166')])){return this[_0x90ea('0xe')][_0x90ea('0x2c')](_0x55aecc,_0x90ea('0x167'));}this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')](_0x90ea('0x168'),_0x55aecc['operation']));var _0x597c47=eval(_0x55aecc[_0x90ea('0x166')]);if(!this['isConfigured'](_0x55aecc['variable_id'])){return this[_0x90ea('0xe')][_0x90ea('0xa7')](_0x90ea('0x115'));}var _0x4c1aa5=this[_0x90ea('0x12')][_0x90ea('0x6d')](this,_0x55aecc['variable_id']);if(!_0x4c1aa5){return this[_0x90ea('0xe')][_0x90ea('0x2c')](_0x55aecc,_0x90ea('0x11b'));}if(_[_0x90ea('0x9a')](_0x597c47)){var _0x167eca=this;_0x597c47[_0x90ea('0xdb')](function(_0x372193,_0x3578ca){_0x167eca[_0x90ea('0xe')]['setVariable'](util[_0x90ea('0x29')](_0x90ea('0x169'),_0x4c1aa5,_0x3578ca),_0x372193);});return this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')]('variable\x20%s[key]\x20set',_0x4c1aa5));}else{return this[_0x90ea('0xe')][_0x90ea('0x9f')](_0x4c1aa5,_0x597c47);}};AGIVertices['prototype'][_0x90ea('0xb')]=function(_0x1c3787){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0x16a'),_0x1c3787[_0x90ea('0xad')]));if(_0x1c3787[_0x90ea('0xa4')]===0x0){return this[_0x90ea('0x110')](_0x1c3787);}_0x1c3787[_0x90ea('0xa4')]-=0x1;if(!this[_0x90ea('0x85')](_0x1c3787[_0x90ea('0x113')])){return this[_0x90ea('0xe')][_0x90ea('0x2c')](_0x1c3787,'no\x20file\x20audio\x20selected');}var _0x22e71e=this[_0x90ea('0x112')]['sync'](this,_0x1c3787[_0x90ea('0x113')]);if(!_0x22e71e){return this[_0x90ea('0xe')][_0x90ea('0x2c')](_0x1c3787,'no\x20file\x20audio\x20found');}var _0x11ed9b=this[_0x90ea('0xe')][_0x90ea('0x116')](_0x22e71e,_0x1c3787['response'],_0x1c3787[_0x90ea('0x16b')]);var _0x2566fa=_0x11ed9b['result'];if(_0x11ed9b[_0x90ea('0xaa')]===-0x1){this['createSquareDetailsReport'][_0x90ea('0x6d')](this,_0x1c3787,'-1');return _0x11ed9b;}else if(_0x11ed9b[_0x90ea('0xa1')]===_0x90ea('0x63')){_0x11ed9b['result']=_0x11ed9b[_0x90ea('0xaa')]['length']>0x0?_0x11ed9b['result']:'t';}else if(_[_0x90ea('0x40')](_0x11ed9b[_0x90ea('0xaa')])){_0x11ed9b['result']='#';_0x2566fa='#';}if(!this['isConfigured'](_0x1c3787['variable_id'])){this[_0x90ea('0xe')][_0x90ea('0xa7')](_0x90ea('0x115'));}else{var _0x4b8296=this[_0x90ea('0x12')]['sync'](this,_0x1c3787['variable_id']);if(!_0x4b8296){return this[_0x90ea('0xe')][_0x90ea('0x2c')](_0x1c3787,_0x90ea('0x11b'));}this['channel']['setVariable'](_0x4b8296,_0x2566fa);}this[_0x90ea('0x36')][_0x90ea('0x6d')](this,_0x1c3787,_0x2566fa);return _0x11ed9b;};AGIVertices[_0x90ea('0x11')][_0x90ea('0xa7')]=function(_0x1fe05c){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0x16c'),_0x1fe05c[_0x90ea('0xad')]));return this[_0x90ea('0xe')][_0x90ea('0xa7')](_0x1fe05c[_0x90ea('0x16d')]||_0x1fe05c[_0x90ea('0xad')]);};AGIVertices[_0x90ea('0x11')][_0x90ea('0x16e')]=function(_0x46f785){logger['info'](util[_0x90ea('0x29')](_0x90ea('0x16f'),_0x46f785['label']));if(!this[_0x90ea('0x85')](_0x46f785[_0x90ea('0x15d')])){return this['channel'][_0x90ea('0x2c')](_0x46f785,_0x90ea('0x15e'));}logger[_0x90ea('0x30')](util['format'](_0x90ea('0x15f'),this[_0x90ea('0xe')][_0x90ea('0x39')],_0x46f785[_0x90ea('0x15d')]));var _0xc5ca80=this[_0x90ea('0x170')][_0x90ea('0x6d')](this,_0x46f785[_0x90ea('0x171')]);var _0x4a114e=this['agentPause'][_0x90ea('0x6d')](this,_0x46f785[_0x90ea('0x15d')],_0xc5ca80);if(_0x4a114e){logger['info'](util[_0x90ea('0x29')](_0x90ea('0x160'),this['channel'][_0x90ea('0x39')],_0x46f785['findBy']));this['channel'][_0x90ea('0xa7')](util['format'](_0x90ea('0x160'),this[_0x90ea('0xe')][_0x90ea('0x39')],_0x46f785[_0x90ea('0x15d')]));return{'code':0xc8,'result':_0x90ea('0x161')};}else{logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0x164'),this[_0x90ea('0xe')][_0x90ea('0x39')],_0x46f785[_0x90ea('0x15d')]));this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x90ea('0x39')],_0x46f785[_0x90ea('0x15d')]));return{'code':0xc8,'result':_0x90ea('0x162')};}};AGIVertices[_0x90ea('0x11')][_0x90ea('0x172')]=function(_0x344e0a){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0x173'),_0x344e0a[_0x90ea('0xad')]));if(!this[_0x90ea('0x85')](_0x344e0a[_0x90ea('0x113')])){return this['channel'][_0x90ea('0x2c')](_0x344e0a,_0x90ea('0x111'));}var _0x242a78=this['getSound'][_0x90ea('0x6d')](this,_0x344e0a[_0x90ea('0x113')]);if(!_0x242a78){return this[_0x90ea('0xe')]['error'](_0x344e0a,_0x90ea('0x114'));}var _0x514ea4=this[_0x90ea('0xe')][_0x90ea('0x56')](_0x90ea('0x174'),[_0x242a78,_0x344e0a['opts']]);if(_0x514ea4[_0x90ea('0xaa')]===-0x1){return _0x514ea4;}return this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')]('Executed\x20command\x20%s\x20%s','PLAYBACK',_0x242a78));};AGIVertices['prototype'][_0x90ea('0x175')]=function(_0x77e0da){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0x176'),_0x77e0da[_0x90ea('0xad')]));if(!this['isConfigured'](_0x77e0da[_0x90ea('0x177')])){return this['channel'][_0x90ea('0x2c')](_0x77e0da,_0x90ea('0x178'));}var _0x4bf572='';var _0xe6b784=parseInt(_0x77e0da[_0x90ea('0x177')],0xa);if(isNaN(_0xe6b784)){_0x4bf572=_0x77e0da[_0x90ea('0x177')];}else{_0x4bf572=this[_0x90ea('0x16')][_0x90ea('0x6d')](this,_0x77e0da['queue_id']);if(!_0x4bf572){return this[_0x90ea('0xe')][_0x90ea('0x2c')](_0x77e0da,'no\x20queue\x20found');}}var _0x1784bd='';if(this[_0x90ea('0x85')](_0x77e0da[_0x90ea('0x113')])){var _0x34d847=this[_0x90ea('0x112')][_0x90ea('0x6d')](this,_0x77e0da[_0x90ea('0x113')]);if(_0x34d847){_0x1784bd=_0x34d847;}}this[_0x90ea('0x36')]['sync'](this,_0x77e0da,_0x4bf572);if(_0x77e0da[_0x90ea('0xe1')]['indexOf']('x')<0x0){_0x77e0da['opts']+='x';}if(_0x77e0da[_0x90ea('0xe1')][_0x90ea('0x179')]('X')<0x0){_0x77e0da[_0x90ea('0xe1')]+='X';}this[_0x90ea('0xe')][_0x90ea('0x9f')]('XMCS-QUEUE',_0x4bf572?_0x4bf572[_0x90ea('0x17a')]():'');var _0x72a6fb=this[_0x90ea('0xe')]['exec'](_0x90ea('0x17b'),[_0x4bf572,_0x77e0da['opts'],_0x77e0da[_0x90ea('0x61')],_0x1784bd,_0x77e0da['timeout'],_0x77e0da['agi'],_0x77e0da['macro'],_0x77e0da[_0x90ea('0x17c')],'',_0x77e0da[_0x90ea('0x17d')]]);if(_0x72a6fb[_0x90ea('0xaa')]===-0x1){return _0x72a6fb;}return this['channel'][_0x90ea('0xa7')](util[_0x90ea('0x29')](_0x90ea('0x17e'),_0x90ea('0x17b'),_0x4bf572));};AGIVertices['prototype'][_0x90ea('0x17f')]=function(_0xefa567){logger[_0x90ea('0x30')](util['format'](_0x90ea('0x180'),_0xefa567[_0x90ea('0xad')]));var _0x30e73b=_0xefa567[_0x90ea('0x181')]||_0x90ea('0x135');var _0x1ec3a3=util['format'](_0x90ea('0x182'),this[_0x90ea('0xe')][_0x90ea('0x46')],rs[_0x90ea('0x11d')](0x5));var _0x18ae3e=util['format'](_0x90ea('0x183'),FILES_PATH,_0x1ec3a3,_0x30e73b);var _0x5854d6=util[_0x90ea('0x29')](_0x90ea('0x136'),FILES_PATH,_0x1ec3a3);this[_0x90ea('0x3a')][_0x90ea('0x6d')](this,_0xefa567,_0x1ec3a3,_0x18ae3e);this['channel'][_0x90ea('0x9f')](_0x90ea('0x184'),_0x1ec3a3);logger[_0x90ea('0x30')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x5854d6,_0x30e73b,_0xefa567[_0x90ea('0x185')],_0xefa567[_0x90ea('0x63')]);return this['channel'][_0x90ea('0x139')](_0x5854d6,_0x30e73b,_0xefa567[_0x90ea('0x185')],_0xefa567['timeout'],undefined,!![]);};AGIVertices[_0x90ea('0x11')][_0x90ea('0x186')]=function(_0x3cff0d){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0x187'),_0x3cff0d[_0x90ea('0xad')]));if(!this['isConfigured'](_0x3cff0d[_0x90ea('0x61')])){return this[_0x90ea('0xe')][_0x90ea('0xa7')](_0x90ea('0x188'));}var _0xbc4e05=this[_0x90ea('0x189')][_0x90ea('0x6d')](this,_0x3cff0d);logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0x18a'),util['inspect'](_0xbc4e05,{'showHidden':![],'depth':null})));if(!this[_0x90ea('0x85')](_0x3cff0d[_0x90ea('0xda')])){return this['channel'][_0x90ea('0xa7')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x1ad1c6=this[_0x90ea('0x12')]['sync'](this,_0x3cff0d[_0x90ea('0xda')]);if(!_0x1ad1c6){return this[_0x90ea('0xe')][_0x90ea('0x2c')](_0x3cff0d,'no\x20variable\x20found');}this['channel'][_0x90ea('0x9f')](util[_0x90ea('0x29')]('%s_STATUS_CODE',_0x1ad1c6),_0xbc4e05[_0x90ea('0x72')]?_0xbc4e05[_0x90ea('0x72')]:_0x90ea('0x18b'));this[_0x90ea('0xe')]['setVariable'](util['format']('%s_STATUS_MESSAGE',_0x1ad1c6),_0xbc4e05['statusMessage']?_0xbc4e05[_0x90ea('0x73')]:'OK');if(_0xbc4e05[_0x90ea('0x67')]){try{this[_0x90ea('0x9d')](_0xbc4e05[_0x90ea('0x67')],_0x1ad1c6);}catch(_0x522743){logger[_0x90ea('0x2c')](util[_0x90ea('0x29')](_0x90ea('0x18c'),_0x1ad1c6));}}return this[_0x90ea('0xe')][_0x90ea('0xa7')](util['format'](_0x90ea('0xdd'),_0x1ad1c6));};AGIVertices[_0x90ea('0x11')]['saydigits']=function(_0x4f34c2){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0x18d'),_0x4f34c2['label']));return this[_0x90ea('0xe')]['sayDigits'](_0x4f34c2[_0x90ea('0x18e')]['replace'](/\s+/g,''),_0x4f34c2[_0x90ea('0x185')]);};AGIVertices[_0x90ea('0x11')][_0x90ea('0x18f')]=function(_0x36d51f){logger[_0x90ea('0x30')](util['format'](_0x90ea('0x190'),_0x36d51f[_0x90ea('0xad')]));return this[_0x90ea('0xe')][_0x90ea('0x191')](_0x36d51f[_0x90ea('0x192')][_0x90ea('0x58')](/\s+/g,''),_0x36d51f['escape_digits']);};AGIVertices[_0x90ea('0x11')]['sayphonetic']=function(_0x178619){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0x193'),_0x178619[_0x90ea('0xad')]));return this['channel']['sayPhonetic'](_0x178619['text'],_0x178619[_0x90ea('0x185')]);};AGIVertices[_0x90ea('0x11')][_0x90ea('0x194')]=function(_0x4fbc9c){logger['info'](util[_0x90ea('0x29')](_0x90ea('0x195'),_0x4fbc9c[_0x90ea('0xad')]));if(!this[_0x90ea('0x85')](_0x4fbc9c[_0x90ea('0x196')])){return this[_0x90ea('0xe')][_0x90ea('0xa7')](_0x90ea('0x197'));}var _0x435fa6=this[_0x90ea('0x23')][_0x90ea('0x6d')](this,_0x4fbc9c['account_id']);if(!_0x435fa6||!_0x435fa6['Smtp']){return this['channel'][_0x90ea('0x2c')](_0x4fbc9c,_0x90ea('0x198'));}var _0x2fd03c={'from':util[_0x90ea('0x29')](_0x90ea('0x199'),_0x435fa6['name'],_0x435fa6[_0x90ea('0x19a')]||_0x435fa6[_0x90ea('0x19b')]['user']),'to':_0x4fbc9c['to']||'','cc':_0x4fbc9c['cc']||'','bcc':_0x4fbc9c['bcc']||'','subject':_0x4fbc9c['subject'],'html':_0x4fbc9c[_0x90ea('0x5c')],'text':_0x4fbc9c[_0x90ea('0x5c')]};var _0x20b7f8={'tls':{'rejectUnauthorized':![]}};if(_0x435fa6[_0x90ea('0x19b')][_0x90ea('0x19c')]){_0x20b7f8[_0x90ea('0x19c')]=_0x435fa6[_0x90ea('0x19b')][_0x90ea('0x19c')];}else{_0x20b7f8[_0x90ea('0x19d')]=_0x435fa6[_0x90ea('0x19b')]['host'];_0x20b7f8[_0x90ea('0x19e')]=_0x435fa6[_0x90ea('0x19b')]['port'];_0x20b7f8['secure']=_0x435fa6[_0x90ea('0x19b')][_0x90ea('0x19f')];}if(_0x435fa6[_0x90ea('0x19b')][_0x90ea('0x1a0')]){_0x20b7f8[_0x90ea('0x1a1')]={'user':_0x435fa6[_0x90ea('0x19b')][_0x90ea('0x1a2')],'pass':_0x435fa6[_0x90ea('0x19b')]['pass']};}if(this[_0x90ea('0x85')](_0x4fbc9c[_0x90ea('0x1a3')])){}logger['debug'](_0x90ea('0x1a4'),JSON[_0x90ea('0x70')](_0x2fd03c));this[_0x90ea('0x36')]['sync'](this,_0x4fbc9c,_0x4fbc9c['account_id']);this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')](_0x90ea('0x1a5'),_0x435fa6[_0x90ea('0x14')]));this[_0x90ea('0x25')][_0x90ea('0x6d')](this,_0x20b7f8,_0x2fd03c);return this[_0x90ea('0xe')]['noop'](_0x90ea('0x1a6'));};AGIVertices[_0x90ea('0x11')][_0x90ea('0x1a7')]=function(_0x2cca6d){logger['info'](util['format']('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x2cca6d[_0x90ea('0xad')]));return this['channel'][_0x90ea('0xa7')](_0x90ea('0x1a8'));};AGIVertices[_0x90ea('0x11')][_0x90ea('0x1a9')]=function(_0x44d7c1){logger['info'](util[_0x90ea('0x29')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x44d7c1[_0x90ea('0xad')]));if(!this['isConfigured'](_0x44d7c1[_0x90ea('0x1aa')])){return this[_0x90ea('0xe')][_0x90ea('0xa7')](_0x90ea('0x1ab'));}var _0x5e8322=this[_0x90ea('0x33')][_0x90ea('0x6d')](this,_0x44d7c1[_0x90ea('0x1aa')]);if(!_0x5e8322){return this['channel'][_0x90ea('0x2c')](_0x44d7c1,_0x90ea('0x1ac'));}var _0x4e6447={'body':_0x44d7c1[_0x90ea('0x1ad')],'phone':_0x44d7c1['to']||'','SmsAccountId':_0x5e8322['id']};logger[_0x90ea('0xde')](_0x90ea('0x1ae'),JSON['stringify'](_0x4e6447));this['createSquareDetailsReport'][_0x90ea('0x6d')](this,_0x44d7c1,_0x44d7c1['sms_account_id']);this[_0x90ea('0xe')]['noop'](util[_0x90ea('0x29')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x5e8322[_0x90ea('0x14')]));this[_0x90ea('0x35')]['sync'](this,_0x4e6447);return this[_0x90ea('0xe')][_0x90ea('0xa7')](_0x90ea('0x1af'));};AGIVertices[_0x90ea('0x11')][_0x90ea('0x1b0')]=function(_0x466e45){logger['info'](util['format'](_0x90ea('0x1b1'),_0x466e45[_0x90ea('0xad')]));if(!this[_0x90ea('0x85')](_0x466e45['variable_id'])){return this[_0x90ea('0xe')][_0x90ea('0x2c')](_0x466e45,'no\x20variable\x20selected');}var _0x21fe5d=this['getVariable']['sync'](this,_0x466e45[_0x90ea('0xda')]);if(!_0x21fe5d){return this[_0x90ea('0xe')][_0x90ea('0x2c')](_0x466e45,_0x90ea('0x11b'));}return this[_0x90ea('0xe')][_0x90ea('0x9f')](_0x21fe5d,_0x466e45['variable_value']);};AGIVertices['prototype'][_0x90ea('0x1b2')]=function(_0x2851b7){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0x1b3'),_0x2851b7[_0x90ea('0xad')]));this['channel'][_0x90ea('0xa7')](_0x90ea('0x1b4'));if(_0x2851b7[_0x90ea('0xb8')]===_0x90ea('0x1b5')){this[_0x90ea('0xe')]['noop'](_0x90ea('0x1b6'));return this[_0x90ea('0xe')][_0x90ea('0xb8')]();}return this['channel'][_0x90ea('0xa7')](_0x90ea('0x1b7'));};AGIVertices[_0x90ea('0x11')][_0x90ea('0x1b8')]=function(_0x4d87a8){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0x1b9'),_0x4d87a8[_0x90ea('0xad')]));if(!this[_0x90ea('0x85')](_0x4d87a8['project_id'])){return this[_0x90ea('0xe')][_0x90ea('0x2c')](_0x4d87a8,_0x90ea('0x1ba'));}var _0x4666d0=this[_0x90ea('0x19')]['sync'](this,_0x4d87a8[_0x90ea('0x1bb')]);if(!this[_0x90ea('0x85')](_0x4666d0)){return this[_0x90ea('0xe')]['error'](_0x4d87a8,util[_0x90ea('0x29')](_0x90ea('0x1bc'),_0x4d87a8['project_id']));}if(_0x4666d0===this[_0x90ea('0xe')][_0x90ea('0x38')]){return this['channel'][_0x90ea('0x2c')](_0x4d87a8,_0x90ea('0x1bd'));}this[_0x90ea('0x36')][_0x90ea('0x6d')](this,_0x4d87a8,_0x4666d0);var _0x2947c4=this[_0x90ea('0xe')][_0x90ea('0x56')](_0x90ea('0x1be'),util['format'](_0x90ea('0x1bf'),config[_0x90ea('0x7')][_0x90ea('0x19d')]||_0x90ea('0x1c0'),_0x4666d0,this[_0x90ea('0xe')][_0x90ea('0x38')]));if(_0x2947c4[_0x90ea('0xaa')]===-0x1){return _0x2947c4;}return this[_0x90ea('0xe')]['noop'](util[_0x90ea('0x29')](_0x90ea('0x17e'),_0x90ea('0x1be'),_0x4666d0));};AGIVertices['prototype'][_0x90ea('0x1c1')]=function(_0x13fc63){logger[_0x90ea('0x30')](util[_0x90ea('0x29')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x13fc63[_0x90ea('0xad')]));var _0x199c6a=this[_0x90ea('0x55')]['sync'](this,_0x13fc63['command']);this['createSquareDetailsReport'][_0x90ea('0x6d')](this,_0x13fc63,_0x13fc63['command']);if(this[_0x90ea('0x85')](_0x13fc63[_0x90ea('0xda')])){var _0x1ef09f=this[_0x90ea('0x12')][_0x90ea('0x6d')](this,_0x13fc63[_0x90ea('0xda')]);if(_0x1ef09f){this[_0x90ea('0xe')][_0x90ea('0x9f')](_0x1ef09f,_0x199c6a);return this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')](_0x90ea('0x1c2'),_0x13fc63[_0x90ea('0xb6')],_0x1ef09f));}}return this[_0x90ea('0xe')]['noop'](util[_0x90ea('0x29')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x13fc63[_0x90ea('0xb6')]));};AGIVertices[_0x90ea('0x11')][_0x90ea('0x1c3')]=function(_0x32c04a){logger[_0x90ea('0x30')](util[_0x90ea('0x29')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x32c04a[_0x90ea('0xad')]));_0x32c04a[_0x90ea('0x5c')]=_0x32c04a['text'][_0x90ea('0x58')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x90ea('0x85')](_0x32c04a['apiKey'])){return this[_0x90ea('0xe')]['noop'](_0x90ea('0x1c4'));}if(!this['isConfigured'](_0x32c04a['text'])){return this[_0x90ea('0xe')][_0x90ea('0xa7')](_0x90ea('0xa8'));}this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')](_0x90ea('0x1c5'),_0x32c04a[_0x90ea('0x5c')]));var _0x3e1fec=this[_0x90ea('0x59')]['sync'](this,_0x32c04a);if(_0x3e1fec){this[_0x90ea('0xe')]['noop'](util[_0x90ea('0x29')](_0x90ea('0x1c6'),_0x3e1fec));var _0x1064c2=this['channel'][_0x90ea('0x100')](_0x3e1fec);try{fs[_0x90ea('0x101')](_0x3e1fec+_0x90ea('0x102'));}catch(_0x3d71af){logger[_0x90ea('0x2c')](_0x3d71af);}return _0x1064c2;}return this[_0x90ea('0xe')]['error'](_0x32c04a,_0x90ea('0x1c7'));};AGIVertices[_0x90ea('0x11')][_0x90ea('0x1c8')]=function(_0x33d7b2){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0x1c9'),_0x33d7b2[_0x90ea('0xad')]));_0x33d7b2[_0x90ea('0x5c')]=_0x33d7b2[_0x90ea('0x5c')][_0x90ea('0x58')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x33d7b2[_0x90ea('0x5c')])){return this['channel']['noop'](_0x90ea('0xa8'));}this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')](_0x90ea('0x1ca'),_0x33d7b2[_0x90ea('0x5c')]));var _0x2a45d8=this[_0x90ea('0x60')]['sync'](this,_0x33d7b2);if(_0x2a45d8){this['channel'][_0x90ea('0xa7')](util[_0x90ea('0x29')](_0x90ea('0x1cb'),_0x2a45d8));var _0x54b930=this['channel'][_0x90ea('0x100')](_0x2a45d8);try{fs[_0x90ea('0x101')](_0x2a45d8+'.wav');}catch(_0x1d9cbb){logger['error'](_0x1d9cbb);}return _0x54b930;}return this[_0x90ea('0xe')][_0x90ea('0x2c')](_0x33d7b2,_0x90ea('0x1cc'));};AGIVertices[_0x90ea('0x11')][_0x90ea('0x1cd')]=function(_0x130b83){logger['info'](util[_0x90ea('0x29')](_0x90ea('0x1ce'),_0x130b83[_0x90ea('0xad')]));if(!this[_0x90ea('0x85')](_0x130b83[_0x90ea('0x15d')])){return this['channel'][_0x90ea('0x2c')](_0x130b83,_0x90ea('0x15e'));}logger['info'](util[_0x90ea('0x29')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x90ea('0xe')]['callerid'],_0x130b83[_0x90ea('0x15d')]));var _0x279ed6=this[_0x90ea('0x4f')][_0x90ea('0x6d')](this,_0x130b83[_0x90ea('0x15d')]);if(_0x279ed6){logger[_0x90ea('0x30')](util['format'](_0x90ea('0x160'),this[_0x90ea('0xe')][_0x90ea('0x39')],_0x130b83['findBy']));this['channel']['noop'](util[_0x90ea('0x29')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x90ea('0xe')]['callerid'],_0x130b83['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0x164'),this[_0x90ea('0xe')][_0x90ea('0x39')],_0x130b83[_0x90ea('0x15d')]));this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')](_0x90ea('0x164'),this['channel'][_0x90ea('0x39')],_0x130b83['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x90ea('0x11')][_0x90ea('0x1cf')]=function(_0x58c57c){logger[_0x90ea('0x30')](util['format']('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x58c57c[_0x90ea('0xad')]));var _0x3ea77=this[_0x90ea('0xe')]['exec'](_0x90ea('0x1d0'),[_0x58c57c[_0x90ea('0x1d1')],_0x58c57c['options']]);if(_0x3ea77[_0x90ea('0xaa')]===-0x1){return _0x3ea77;}return this[_0x90ea('0xe')]['noop'](util[_0x90ea('0x29')](_0x90ea('0x17e'),_0x90ea('0x1d0'),_0x58c57c[_0x90ea('0x1d1')]));};AGIVertices[_0x90ea('0x11')][_0x90ea('0x1d2')]=function(_0x266514){logger[_0x90ea('0x30')](util[_0x90ea('0x29')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x266514[_0x90ea('0xad')]));if(!this['isConfigured'](_0x266514[_0x90ea('0xda')])){return this[_0x90ea('0xe')][_0x90ea('0x2c')](_0x266514,'no\x20variable\x20selected');}var _0x47711f=this[_0x90ea('0x12')][_0x90ea('0x6d')](this,_0x266514[_0x90ea('0xda')]);if(!_0x47711f){return this[_0x90ea('0xe')]['error'](_0x266514,_0x90ea('0x11b'));}var _0x2f5705=this[_0x90ea('0xe')][_0x90ea('0x12')](_0x47711f);return{'code':0xc8,'result':_0x2f5705[_0x90ea('0xa1')]?_0x2f5705['extra']:'-'};};String[_0x90ea('0x11')]['replaceAll']=function(_0x34b388,_0x28992e){return this['split'](_0x34b388)[_0x90ea('0x1d3')](_0x28992e);};module[_0x90ea('0x1d4')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 39702c6..11438a9 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 _0xc359=['error','finally','message','[%s][TIMER][STOP][AGENT:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','syncHangup','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','transfertargetuniqueid','secondtransfereruniqueid','transfereeuniqueid','origtransfereruniqueid','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','exports','util','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','syncHangupRequest','hangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','milliseconds','diff','prototype','startAcw','interface','ACW','mandatoryDisposition','name','mandatoryDispositionPause','Action','QueuePause','getAgent','then','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','timer','stopAcw','acwTimeout','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','catch','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]'];(function(_0x28d872,_0x265276){var _0x36308a=function(_0x455a03){while(--_0x455a03){_0x28d872['push'](_0x28d872['shift']());}};_0x36308a(++_0x265276);}(_0xc359,0x11f));var _0x9c35=function(_0x27d8bc,_0x19e010){_0x27d8bc=_0x27d8bc-0x0;var _0x4b04cb=_0xc359[_0x27d8bc];return _0x4b04cb;};'use strict';var util=require(_0x9c35('0x0'));var _=require(_0x9c35('0x1'));var moment=require(_0x9c35('0x2'));var ami=require(_0x9c35('0x3'));var logger=require(_0x9c35('0x4'))(_0x9c35('0x5'));var RpcUser=require(_0x9c35('0x6'));var RpcVoiceAgentReport=require(_0x9c35('0x7'));function Acw(_0x3ea76e){this[_0x9c35('0x8')]=_0x3ea76e[_0x9c35('0x8')];this[_0x9c35('0x9')]=_0x3ea76e[_0x9c35('0x9')];this[_0x9c35('0xa')]=_0x3ea76e[_0x9c35('0xa')];this[_0x9c35('0xb')]={};ami['on'](_0x9c35('0xc'),this[_0x9c35('0xd')][_0x9c35('0xe')](this));ami['on']('hanguprequest',this[_0x9c35('0xf')][_0x9c35('0xe')](this));ami['on'](_0x9c35('0x10'),this['syncHangup'][_0x9c35('0xe')](this));ami['on'](_0x9c35('0x11'),this[_0x9c35('0x12')][_0x9c35('0xe')](this));ami['on'](_0x9c35('0x13'),this[_0x9c35('0x14')][_0x9c35('0xe')](this));ami['on'](_0x9c35('0x15'),this[_0x9c35('0x16')][_0x9c35('0xe')](this));ami['on']('custom:agentConnectPreview',this['syncAgentConnectPreview'][_0x9c35('0xe')](this));}function getDiff(_0x5442b1){var _0x370502=moment()[_0x9c35('0x17')](0x0);var _0x4d3425=moment(_0x5442b1)[_0x9c35('0x17')](0x0);return _0x370502[_0x9c35('0x18')](_0x4d3425,'seconds');}Acw[_0x9c35('0x19')][_0x9c35('0x1a')]=function(_0x53f8a1){try{var _0x2f1800=this;var _0x583c51=this[_0x9c35('0xb')][_0x53f8a1][_0x9c35('0x1b')];var _0x5d2187=this[_0x9c35('0xb')][_0x53f8a1]['queue'];var _0x30bbcf=this['voiceQueues'][_0x5d2187];var _0x26f59a=![];var _0x3bc1e8=_0x9c35('0x1c');if(_0x30bbcf[_0x9c35('0x1d')]){if(_0x30bbcf['mandatoryDispositionPause'][_0x9c35('0x1e')]){_0x26f59a=!![];_0x3bc1e8=_0x30bbcf[_0x9c35('0x1f')][_0x9c35('0x1e')];}}ami[_0x9c35('0x20')]({'action':_0x9c35('0x21'),'interface':_0x583c51,'paused':!![],'reason':_0x3bc1e8})['then'](function(_0x1219b9){if(_0x2f1800[_0x9c35('0x9')][_0x583c51]){return RpcUser[_0x9c35('0x22')](_0x2f1800[_0x9c35('0x9')][_0x583c51]['id'])[_0x9c35('0x23')](function(_0xac9bcf){if(_0xac9bcf&&!_0xac9bcf[_0x9c35('0x24')]){logger[_0x9c35('0x25')](_0x9c35('0x26'),_0x53f8a1,_0x583c51,_0x5d2187);var _0x2baf64=_0x2f1800[_0x9c35('0xb')][_0x53f8a1][_0x9c35('0x27')]&&_0x2f1800[_0x9c35('0xb')][_0x53f8a1]['destlinkedid']?_0x2f1800[_0x9c35('0xb')][_0x53f8a1][_0x9c35('0x28')]:_0x53f8a1;return RpcUser[_0x9c35('0x29')](_0x2f1800[_0x9c35('0x9')][_0x583c51],_0x3bc1e8,_0x2baf64)[_0x9c35('0x23')](function(_0x501724){if(!_0x26f59a){_0x2f1800['timers'][_0x583c51]={};logger[_0x9c35('0x25')](_0x9c35('0x2a'),_0x53f8a1,_0x2f1800[_0x9c35('0x8')][_0x5d2187]['acwTimeout'],_0x583c51,_0x5d2187);_0x2f1800[_0x9c35('0xa')][_0x583c51][_0x9c35('0x2b')]=setTimeout(_0x2f1800[_0x9c35('0x2c')][_0x9c35('0xe')](_0x2f1800,_0x583c51),_0x2f1800['voiceQueues'][_0x5d2187][_0x9c35('0x2d')]*0x3e8);_0x2f1800[_0x9c35('0xa')][_0x583c51][_0x9c35('0x2e')]=moment()[_0x9c35('0x2f')](_0x9c35('0x30'));_0x2f1800[_0x9c35('0xa')][_0x583c51][_0x9c35('0x31')]=_0x53f8a1;_0x2f1800[_0x9c35('0xa')][_0x583c51][_0x9c35('0x32')]=_0x5d2187;_0x2f1800[_0x9c35('0xa')][_0x583c51][_0x9c35('0x33')]=function(){var _0xb0c6a9=getDiff(_0x2f1800['timers'][_0x583c51]['lastPauseAt']);clearTimeout(_0x2f1800['timers'][_0x583c51][_0x9c35('0x2b')]);_0x2f1800[_0x9c35('0xa')][_0x583c51][_0x9c35('0x2b')]=![];RpcVoiceAgentReport[_0x9c35('0x34')]({'acwtime':_0xb0c6a9},_0x2f1800[_0x9c35('0xa')][_0x583c51]['uniqueid'],_0x583c51)[_0x9c35('0x23')](function(_0x28b472){logger[_0x9c35('0x25')](_0x9c35('0x35'),_0x53f8a1,_0xb0c6a9,_0x28b472);})[_0x9c35('0x36')](function(_0x9d828a){logger['error'](_0x9c35('0x37'),_0x53f8a1,_0x9d828a);});delete _0x2f1800[_0x9c35('0xa')][_0x583c51];};}});}else{logger['info'](_0x9c35('0x38'),_0x53f8a1,_0x583c51,_0x5d2187);}});}})['catch'](function(_0x15fd24){logger[_0x9c35('0x39')](_0x9c35('0x2a'),_0x53f8a1,_0x2f1800[_0x9c35('0x8')][_0x5d2187][_0x9c35('0x2d')],_0x583c51,_0x5d2187);})[_0x9c35('0x3a')](function(){delete _0x2f1800[_0x9c35('0xb')][_0x53f8a1];});}catch(_0x915d4f){logger[_0x9c35('0x39')]('[ACW][START]\x20%s',_0x915d4f[_0x9c35('0x3b')]);}};Acw[_0x9c35('0x19')][_0x9c35('0x2c')]=function(_0x24288b){try{var _0xc050dd=this;if(_0xc050dd[_0x9c35('0xa')][_0x24288b]){_0xc050dd['timers'][_0x24288b][_0x9c35('0x2b')]=![];var _0x506747=_0xc050dd[_0x9c35('0xa')][_0x24288b][_0x9c35('0x31')];var _0x5de45b=_0xc050dd[_0x9c35('0xa')][_0x24288b][_0x9c35('0x32')];var _0x3747cc=_0xc050dd[_0x9c35('0x8')][_0x5de45b][_0x9c35('0x2d')];logger[_0x9c35('0x25')](_0x9c35('0x3c'),_0x506747,_0x24288b);RpcUser['saveUnpause'](this[_0x9c35('0x9')][_0x24288b]);RpcVoiceAgentReport[_0x9c35('0x34')]({'acwtime':_0x3747cc,'agentacw':!![]},_0x506747,_0x24288b)['then'](function(_0x3ba9de){logger[_0x9c35('0x25')](_0x9c35('0x35'),_0x506747,_0x3747cc,_0x3ba9de);})[_0x9c35('0x36')](function(_0x1675dd){logger['error'](_0x9c35('0x37'),_0x506747,_0x1675dd);});}else{logger[_0x9c35('0x39')](_0x9c35('0x3d'),_0x24288b);if(_0xc050dd['timers']){logger['info'](_0x9c35('0x3e'),JSON[_0x9c35('0x3f')](_0xc050dd[_0x9c35('0xa')]));}}}catch(_0xca2935){logger[_0x9c35('0x39')]('[ACW][STOP]\x20%s',_0xca2935[_0x9c35('0x3b')]);}};Acw[_0x9c35('0x19')][_0x9c35('0xd')]=function(_0x3eed1d){try{if(this[_0x9c35('0x8')][_0x3eed1d[_0x9c35('0x32')]]&&(this[_0x9c35('0x8')][_0x3eed1d[_0x9c35('0x32')]][_0x9c35('0x5')]||this[_0x9c35('0x8')][_0x3eed1d['queue']]['mandatoryDisposition'])){if(this[_0x9c35('0x9')][_0x3eed1d['interface']]){this[_0x9c35('0xb')][_0x3eed1d[_0x9c35('0x31')]]={'queue':_0x3eed1d[_0x9c35('0x32')],'interface':_0x3eed1d[_0x9c35('0x1b')],'destlinkedid':_0x3eed1d[_0x9c35('0x28')]};}}}catch(_0x480f4a){logger[_0x9c35('0x39')]('[ACW][syncAgentConnect]\x20%s',_0x480f4a[_0x9c35('0x3b')]);}};Acw[_0x9c35('0x19')]['syncAgentConnectPreview']=function(_0x3e0bc9){try{if(this['voiceQueues'][_0x3e0bc9[_0x9c35('0x32')]]&&(this[_0x9c35('0x8')][_0x3e0bc9[_0x9c35('0x32')]]['acw']||this['voiceQueues'][_0x3e0bc9['queue']]['mandatoryDisposition'])){if(this[_0x9c35('0x9')][_0x3e0bc9[_0x9c35('0x1b')]]){this[_0x9c35('0xb')][_0x3e0bc9[_0x9c35('0x31')]]={'queue':_0x3e0bc9[_0x9c35('0x32')],'interface':_0x3e0bc9['interface']};}}}catch(_0x195d85){logger['error'](_0x9c35('0x40'),_0x195d85['message']);}};Acw[_0x9c35('0x19')][_0x9c35('0xf')]=function(_0x55f197){try{if(this['channels'][_0x55f197[_0x9c35('0x31')]]&&_[_0x9c35('0x41')](this[_0x9c35('0xb')][_0x55f197[_0x9c35('0x31')]][_0x9c35('0x27')])){logger[_0x9c35('0x25')](_0x9c35('0x42'),_0x55f197[_0x9c35('0x31')]);this[_0x9c35('0x1a')](_0x55f197[_0x9c35('0x31')]);}else if(this[_0x9c35('0xb')][_0x55f197[_0x9c35('0x43')]]&&_['isUndefined'](this[_0x9c35('0xb')][_0x55f197[_0x9c35('0x43')]][_0x9c35('0x27')])){logger[_0x9c35('0x25')](_0x9c35('0x44'),_0x55f197[_0x9c35('0x43')]);this[_0x9c35('0x1a')](_0x55f197[_0x9c35('0x43')]);}}catch(_0x278ce3){logger[_0x9c35('0x39')](_0x9c35('0x45'),_0x278ce3[_0x9c35('0x3b')]);}};Acw[_0x9c35('0x19')][_0x9c35('0x46')]=function(_0x15bf60){try{if(this[_0x9c35('0xb')][_0x15bf60[_0x9c35('0x31')]]&&this[_0x9c35('0xb')][_0x15bf60[_0x9c35('0x31')]][_0x9c35('0x27')]){logger[_0x9c35('0x25')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x15bf60['uniqueid']);this['startAcw'](_0x15bf60['uniqueid']);}else if(this[_0x9c35('0xb')][_0x15bf60[_0x9c35('0x43')]]&&this[_0x9c35('0xb')][_0x15bf60[_0x9c35('0x43')]][_0x9c35('0x27')]){logger[_0x9c35('0x25')](_0x9c35('0x47'),_0x15bf60['linkedid']);this[_0x9c35('0x1a')](_0x15bf60['linkedid']);}}catch(_0x16f6b4){logger[_0x9c35('0x39')](_0x9c35('0x48'),_0x16f6b4[_0x9c35('0x3b')]);}};Acw[_0x9c35('0x19')][_0x9c35('0x14')]=function(_0x5e560a){try{if(!_['isNil'](this[_0x9c35('0xb')][_0x5e560a['transfereeuniqueid']])){this[_0x9c35('0x1a')](_0x5e560a['transfereeuniqueid']);if(this[_0x9c35('0xb')][_0x5e560a['secondtransfereruniqueid']]){this[_0x9c35('0xb')][_0x5e560a['secondtransfereruniqueid']][_0x9c35('0x27')]=!![];this[_0x9c35('0xb')][_0x5e560a[_0x9c35('0x49')]]=this[_0x9c35('0xb')][_0x5e560a[_0x9c35('0x4a')]];delete this[_0x9c35('0xb')][_0x5e560a[_0x9c35('0x4a')]];}}else if(!_['isNil'](this['channels'][_0x5e560a['transfertargetuniqueid']])){this[_0x9c35('0x1a')](_0x5e560a[_0x9c35('0x49')]);if(this[_0x9c35('0xb')][_0x5e560a['origtransfereruniqueid']]){this[_0x9c35('0xb')][_0x5e560a['origtransfereruniqueid']][_0x9c35('0x27')]=!![];this[_0x9c35('0xb')][_0x5e560a[_0x9c35('0x4b')]]=this[_0x9c35('0xb')][_0x5e560a['origtransfereruniqueid']];delete this[_0x9c35('0xb')][_0x5e560a[_0x9c35('0x4c')]];}}}catch(_0x2e81e0){logger['error']('[ACW][syncAttendedTransfer]\x20%s',_0x2e81e0['message']);}};Acw['prototype'][_0x9c35('0x16')]=function(_0x455092){try{if(this['channels'][_0x455092[_0x9c35('0x4d')]]){logger[_0x9c35('0x25')](_0x9c35('0x4e'),JSON['stringify'](_0x455092[_0x9c35('0x4d')]));this[_0x9c35('0x1a')](_0x455092[_0x9c35('0x4d')]);}else if(this[_0x9c35('0xb')][_0x455092[_0x9c35('0x4f')]]){logger[_0x9c35('0x25')](_0x9c35('0x50'),JSON[_0x9c35('0x3f')](_0x455092[_0x9c35('0x4f')]));this[_0x9c35('0x1a')](_0x455092[_0x9c35('0x4f')]);}}catch(_0x311bbf){logger[_0x9c35('0x39')](_0x9c35('0x51'),_0x311bbf['message']);}};Acw[_0x9c35('0x19')]['syncAgentRingNoAnswer']=function(_0x276782){try{if(this[_0x9c35('0x8')][_0x276782['queue']]&&this['voiceQueues'][_0x276782[_0x9c35('0x32')]][_0x9c35('0x52')]==='all'){if(this[_0x9c35('0x9')][_0x276782[_0x9c35('0x1b')]]){logger['info'](_0x9c35('0x53'),_0x276782[_0x9c35('0x31')],_0x276782['interface'],_0x276782['queue']);return RpcUser[_0x9c35('0x29')](this[_0x9c35('0x9')][_0x276782[_0x9c35('0x1b')]],_0x9c35('0x54'),_0x276782[_0x9c35('0x31')]);}}}catch(_0x1939ac){logger[_0x9c35('0x39')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x1939ac[_0x9c35('0x3b')]);}};module[_0x9c35('0x55')]=Acw; \ No newline at end of file +var _0x8a01=['exports','lodash','moment','../ami','../../../config/logger','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','bind','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','startAcw','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','stopAcw','acwTimeout','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','timer','[%s][UPDATE][ACWTIME:%s]','catch','error','finally','message','prototype','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','update','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','syncAgentConnect','acw','syncHangupRequest','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[ACW][syncHangup]\x20%s','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','isNil','origtransfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s'];(function(_0x172d16,_0x447212){var _0x4197c9=function(_0x59edb9){while(--_0x59edb9){_0x172d16['push'](_0x172d16['shift']());}};_0x4197c9(++_0x447212);}(_0x8a01,0x1af));var _0x18a0=function(_0x314ae6,_0x1f1af6){_0x314ae6=_0x314ae6-0x0;var _0xb31d45=_0x8a01[_0x314ae6];return _0xb31d45;};'use strict';var util=require('util');var _=require(_0x18a0('0x0'));var moment=require(_0x18a0('0x1'));var ami=require(_0x18a0('0x2'));var logger=require(_0x18a0('0x3'))('acw');var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0x18a0('0x4'));function Acw(_0xbc1eec){this[_0x18a0('0x5')]=_0xbc1eec[_0x18a0('0x5')];this[_0x18a0('0x6')]=_0xbc1eec[_0x18a0('0x6')];this['timers']=_0xbc1eec[_0x18a0('0x7')];this[_0x18a0('0x8')]={};ami['on'](_0x18a0('0x9'),this['syncAgentConnect'][_0x18a0('0xa')](this));ami['on']('hanguprequest',this['syncHangupRequest']['bind'](this));ami['on']('hangup',this[_0x18a0('0xb')][_0x18a0('0xa')](this));ami['on'](_0x18a0('0xc'),this[_0x18a0('0xd')][_0x18a0('0xa')](this));ami['on'](_0x18a0('0xe'),this[_0x18a0('0xf')]['bind'](this));ami['on'](_0x18a0('0x10'),this[_0x18a0('0x11')][_0x18a0('0xa')](this));ami['on'](_0x18a0('0x12'),this[_0x18a0('0x13')][_0x18a0('0xa')](this));}function getDiff(_0x82650c){var _0x5d158d=moment()[_0x18a0('0x14')](0x0);var _0x3890a9=moment(_0x82650c)[_0x18a0('0x14')](0x0);return _0x5d158d[_0x18a0('0x15')](_0x3890a9,_0x18a0('0x16'));}Acw['prototype'][_0x18a0('0x17')]=function(_0x4f0eeb){try{var _0x487cd5=this;var _0x243213=this[_0x18a0('0x8')][_0x4f0eeb][_0x18a0('0x18')];var _0x355ccf=this[_0x18a0('0x8')][_0x4f0eeb][_0x18a0('0x19')];var _0x8a4266=this[_0x18a0('0x5')][_0x355ccf];var _0x1fd201=![];var _0x450fd1=_0x18a0('0x1a');if(_0x8a4266[_0x18a0('0x1b')]){if(_0x8a4266[_0x18a0('0x1c')][_0x18a0('0x1d')]){_0x1fd201=!![];_0x450fd1=_0x8a4266[_0x18a0('0x1c')][_0x18a0('0x1d')];}}ami['Action']({'action':_0x18a0('0x1e'),'interface':_0x243213,'paused':!![],'reason':_0x450fd1})[_0x18a0('0x1f')](function(_0x24f33c){if(_0x487cd5['agents'][_0x243213]){return RpcUser[_0x18a0('0x20')](_0x487cd5[_0x18a0('0x6')][_0x243213]['id'])['then'](function(_0x12948a){if(_0x12948a&&!_0x12948a[_0x18a0('0x21')]){logger[_0x18a0('0x22')](_0x18a0('0x23'),_0x4f0eeb,_0x243213,_0x355ccf);var _0x16a951=_0x487cd5[_0x18a0('0x8')][_0x4f0eeb][_0x18a0('0x24')]&&_0x487cd5[_0x18a0('0x8')][_0x4f0eeb]['destlinkedid']?_0x487cd5[_0x18a0('0x8')][_0x4f0eeb][_0x18a0('0x25')]:_0x4f0eeb;return RpcUser[_0x18a0('0x26')](_0x487cd5[_0x18a0('0x6')][_0x243213],_0x450fd1,_0x16a951)['then'](function(_0x2d0845){if(!_0x1fd201){_0x487cd5[_0x18a0('0x7')][_0x243213]={};logger[_0x18a0('0x22')](_0x18a0('0x27'),_0x4f0eeb,_0x487cd5['voiceQueues'][_0x355ccf]['acwTimeout'],_0x243213,_0x355ccf);_0x487cd5[_0x18a0('0x7')][_0x243213]['timer']=setTimeout(_0x487cd5[_0x18a0('0x28')][_0x18a0('0xa')](_0x487cd5,_0x243213),_0x487cd5['voiceQueues'][_0x355ccf][_0x18a0('0x29')]*0x3e8);_0x487cd5[_0x18a0('0x7')][_0x243213][_0x18a0('0x2a')]=moment()[_0x18a0('0x2b')](_0x18a0('0x2c'));_0x487cd5['timers'][_0x243213][_0x18a0('0x2d')]=_0x4f0eeb;_0x487cd5[_0x18a0('0x7')][_0x243213][_0x18a0('0x19')]=_0x355ccf;_0x487cd5[_0x18a0('0x7')][_0x243213][_0x18a0('0x2e')]=function(){var _0x3e68f1=getDiff(_0x487cd5['timers'][_0x243213][_0x18a0('0x2a')]);clearTimeout(_0x487cd5[_0x18a0('0x7')][_0x243213][_0x18a0('0x2f')]);_0x487cd5[_0x18a0('0x7')][_0x243213]['timer']=![];RpcVoiceAgentReport['update']({'acwtime':_0x3e68f1},_0x487cd5[_0x18a0('0x7')][_0x243213][_0x18a0('0x2d')],_0x243213)[_0x18a0('0x1f')](function(_0xd9b8fe){logger[_0x18a0('0x22')](_0x18a0('0x30'),_0x4f0eeb,_0x3e68f1,_0xd9b8fe);})[_0x18a0('0x31')](function(_0x5e0dea){logger[_0x18a0('0x32')]('[%s][UPDATE][ERRORS:%s]',_0x4f0eeb,_0x5e0dea);});delete _0x487cd5[_0x18a0('0x7')][_0x243213];};}});}else{logger['info']('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x4f0eeb,_0x243213,_0x355ccf);}});}})[_0x18a0('0x31')](function(_0x6fb68a){logger['error'](_0x18a0('0x27'),_0x4f0eeb,_0x487cd5[_0x18a0('0x5')][_0x355ccf][_0x18a0('0x29')],_0x243213,_0x355ccf);})[_0x18a0('0x33')](function(){delete _0x487cd5[_0x18a0('0x8')][_0x4f0eeb];});}catch(_0x4f2d37){logger[_0x18a0('0x32')]('[ACW][START]\x20%s',_0x4f2d37[_0x18a0('0x34')]);}};Acw[_0x18a0('0x35')]['stopAcw']=function(_0xf876ae){try{var _0x29c8f7=this;if(_0x29c8f7['timers'][_0xf876ae]){_0x29c8f7[_0x18a0('0x7')][_0xf876ae][_0x18a0('0x2f')]=![];var _0x1eb502=_0x29c8f7[_0x18a0('0x7')][_0xf876ae][_0x18a0('0x2d')];var _0x5b0bc9=_0x29c8f7[_0x18a0('0x7')][_0xf876ae][_0x18a0('0x19')];var _0x1d863b=_0x29c8f7[_0x18a0('0x5')][_0x5b0bc9][_0x18a0('0x29')];logger[_0x18a0('0x22')](_0x18a0('0x36'),_0x1eb502,_0xf876ae);RpcUser[_0x18a0('0x37')](this[_0x18a0('0x6')][_0xf876ae]);RpcVoiceAgentReport[_0x18a0('0x38')]({'acwtime':_0x1d863b,'agentacw':!![]},_0x1eb502,_0xf876ae)['then'](function(_0x224ee0){logger[_0x18a0('0x22')](_0x18a0('0x30'),_0x1eb502,_0x1d863b,_0x224ee0);})[_0x18a0('0x31')](function(_0x1c0417){logger[_0x18a0('0x32')](_0x18a0('0x39'),_0x1eb502,_0x1c0417);});}else{logger[_0x18a0('0x32')](_0x18a0('0x3a'),_0xf876ae);if(_0x29c8f7['timers']){logger[_0x18a0('0x22')](_0x18a0('0x3b'),JSON[_0x18a0('0x3c')](_0x29c8f7[_0x18a0('0x7')]));}}}catch(_0x84732e){logger[_0x18a0('0x32')](_0x18a0('0x3d'),_0x84732e[_0x18a0('0x34')]);}};Acw[_0x18a0('0x35')][_0x18a0('0x3e')]=function(_0x108fff){try{if(this[_0x18a0('0x5')][_0x108fff[_0x18a0('0x19')]]&&(this[_0x18a0('0x5')][_0x108fff[_0x18a0('0x19')]][_0x18a0('0x3f')]||this[_0x18a0('0x5')][_0x108fff[_0x18a0('0x19')]]['mandatoryDisposition'])){if(this[_0x18a0('0x6')][_0x108fff[_0x18a0('0x18')]]){this[_0x18a0('0x8')][_0x108fff[_0x18a0('0x2d')]]={'queue':_0x108fff['queue'],'interface':_0x108fff[_0x18a0('0x18')],'destlinkedid':_0x108fff[_0x18a0('0x25')]};}}}catch(_0x221598){logger[_0x18a0('0x32')]('[ACW][syncAgentConnect]\x20%s',_0x221598[_0x18a0('0x34')]);}};Acw['prototype']['syncAgentConnectPreview']=function(_0x2b033f){try{if(this[_0x18a0('0x5')][_0x2b033f[_0x18a0('0x19')]]&&(this[_0x18a0('0x5')][_0x2b033f['queue']][_0x18a0('0x3f')]||this[_0x18a0('0x5')][_0x2b033f[_0x18a0('0x19')]][_0x18a0('0x1b')])){if(this[_0x18a0('0x6')][_0x2b033f[_0x18a0('0x18')]]){this[_0x18a0('0x8')][_0x2b033f['uniqueid']]={'queue':_0x2b033f[_0x18a0('0x19')],'interface':_0x2b033f['interface']};}}}catch(_0x35fc26){logger[_0x18a0('0x32')]('[ACW][syncAgentConnectPreview]\x20%s',_0x35fc26[_0x18a0('0x34')]);}};Acw[_0x18a0('0x35')][_0x18a0('0x40')]=function(_0x187b60){try{if(this['channels'][_0x187b60[_0x18a0('0x2d')]]&&_[_0x18a0('0x41')](this[_0x18a0('0x8')][_0x187b60[_0x18a0('0x2d')]][_0x18a0('0x24')])){logger[_0x18a0('0x22')](_0x18a0('0x42'),_0x187b60[_0x18a0('0x2d')]);this[_0x18a0('0x17')](_0x187b60['uniqueid']);}else if(this[_0x18a0('0x8')][_0x187b60[_0x18a0('0x43')]]&&_[_0x18a0('0x41')](this['channels'][_0x187b60[_0x18a0('0x43')]][_0x18a0('0x24')])){logger['info'](_0x18a0('0x44'),_0x187b60[_0x18a0('0x43')]);this[_0x18a0('0x17')](_0x187b60[_0x18a0('0x43')]);}}catch(_0x5d8b49){logger[_0x18a0('0x32')]('[ACW][syncHangupRequest]\x20%s',_0x5d8b49[_0x18a0('0x34')]);}};Acw['prototype']['syncHangup']=function(_0x2f4177){try{if(this[_0x18a0('0x8')][_0x2f4177[_0x18a0('0x2d')]]&&this[_0x18a0('0x8')][_0x2f4177[_0x18a0('0x2d')]][_0x18a0('0x24')]){logger[_0x18a0('0x22')](_0x18a0('0x45'),_0x2f4177['uniqueid']);this['startAcw'](_0x2f4177[_0x18a0('0x2d')]);}else if(this[_0x18a0('0x8')][_0x2f4177[_0x18a0('0x43')]]&&this[_0x18a0('0x8')][_0x2f4177[_0x18a0('0x43')]][_0x18a0('0x24')]){logger[_0x18a0('0x22')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x2f4177[_0x18a0('0x43')]);this[_0x18a0('0x17')](_0x2f4177[_0x18a0('0x43')]);}}catch(_0x11926e){logger[_0x18a0('0x32')](_0x18a0('0x46'),_0x11926e['message']);}};Acw['prototype'][_0x18a0('0xf')]=function(_0x23c0d1){try{if(!_['isNil'](this[_0x18a0('0x8')][_0x23c0d1[_0x18a0('0x47')]])){this[_0x18a0('0x17')](_0x23c0d1['transfereeuniqueid']);if(this[_0x18a0('0x8')][_0x23c0d1['secondtransfereruniqueid']]){this['channels'][_0x23c0d1[_0x18a0('0x48')]][_0x18a0('0x24')]=!![];this['channels'][_0x23c0d1[_0x18a0('0x49')]]=this[_0x18a0('0x8')][_0x23c0d1[_0x18a0('0x48')]];delete this['channels'][_0x23c0d1['secondtransfereruniqueid']];}}else if(!_[_0x18a0('0x4a')](this[_0x18a0('0x8')][_0x23c0d1['transfertargetuniqueid']])){this[_0x18a0('0x17')](_0x23c0d1[_0x18a0('0x49')]);if(this[_0x18a0('0x8')][_0x23c0d1[_0x18a0('0x4b')]]){this['channels'][_0x23c0d1[_0x18a0('0x4b')]][_0x18a0('0x24')]=!![];this[_0x18a0('0x8')][_0x23c0d1[_0x18a0('0x47')]]=this[_0x18a0('0x8')][_0x23c0d1['origtransfereruniqueid']];delete this['channels'][_0x23c0d1[_0x18a0('0x4b')]];}}}catch(_0x3ef262){logger[_0x18a0('0x32')]('[ACW][syncAttendedTransfer]\x20%s',_0x3ef262[_0x18a0('0x34')]);}};Acw[_0x18a0('0x35')][_0x18a0('0x11')]=function(_0x58ceaf){try{if(this['channels'][_0x58ceaf['transfereruniqueid']]){logger[_0x18a0('0x22')](_0x18a0('0x4c'),JSON[_0x18a0('0x3c')](_0x58ceaf[_0x18a0('0x4d')]));this[_0x18a0('0x17')](_0x58ceaf[_0x18a0('0x4d')]);}else if(this[_0x18a0('0x8')][_0x58ceaf[_0x18a0('0x4e')]]){logger[_0x18a0('0x22')](_0x18a0('0x4f'),JSON[_0x18a0('0x3c')](_0x58ceaf[_0x18a0('0x4e')]));this[_0x18a0('0x17')](_0x58ceaf[_0x18a0('0x4e')]);}}catch(_0x327e07){logger['error'](_0x18a0('0x50'),_0x327e07[_0x18a0('0x34')]);}};Acw[_0x18a0('0x35')]['syncAgentRingNoAnswer']=function(_0x1af84f){try{if(this[_0x18a0('0x5')][_0x1af84f[_0x18a0('0x19')]]&&this[_0x18a0('0x5')][_0x1af84f['queue']][_0x18a0('0x51')]===_0x18a0('0x52')){if(this['agents'][_0x1af84f['interface']]){logger['info']('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x1af84f['uniqueid'],_0x1af84f[_0x18a0('0x18')],_0x1af84f['queue']);return RpcUser[_0x18a0('0x26')](this[_0x18a0('0x6')][_0x1af84f['interface']],_0x18a0('0x53'),_0x1af84f['uniqueid']);}}}catch(_0x4d3432){logger['error'](_0x18a0('0x54'),_0x4d3432[_0x18a0('0x34')]);}};module[_0x18a0('0x55')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 8e4d226..1b60ee0 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 _0xbaf0=['once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','then','actionSipShowRegistry','catch','[ami.js][fullybooted]','exports','bluebird','moment','util','lodash','../../config/logger','ami','asterisk','port','username','password','keepConnected','Action','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s'];(function(_0x1553fc,_0x329abf){var _0x19afe8=function(_0x22d85b){while(--_0x22d85b){_0x1553fc['push'](_0x1553fc['shift']());}};_0x19afe8(++_0x329abf);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xbaf0[_0x5ddb1c];return _0x354adc;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var util=require(_0x0baf('0x2'));var _=require(_0x0baf('0x3'));var logger=require(_0x0baf('0x4'))(_0x0baf('0x5'));var config=require('../../config/environment');var ami=new Manager(config[_0x0baf('0x6')][_0x0baf('0x7')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')][_0x0baf('0x9')],!![]);ami[_0x0baf('0xa')]();ami[_0x0baf('0xb')]=BPromise['promisify'](ami[_0x0baf('0xc')]);function error(_0x5f20aa){logger[_0x0baf('0xd')](util[_0x0baf('0xe')](_0x0baf('0xf'),config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')],util[_0x0baf('0x10')](_0x5f20aa,![],null)));}function close(){logger[_0x0baf('0xd')](util[_0x0baf('0xe')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config['asterisk'][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x0baf('0xb')]({'action':'sipshowregistry'});};};ami[_0x0baf('0x11')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x12')});};};ami[_0x0baf('0x13')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x14')});};};ami['actionQueueSummary']=function(){return function(){return ami['Action']({'action':_0x0baf('0x15')});};};ami[_0x0baf('0x16')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x17')});};};function connect(_0x2cf7da){logger[_0x0baf('0x18')](util['format'](_0x0baf('0x19'),config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));ami['once']('error',error);ami[_0x0baf('0x1a')](_0x0baf('0x1b'),close);}ami['on'](_0x0baf('0x1c'),connect);ami['on'](_0x0baf('0x1d'),function(_0x1fa92b){logger[_0x0baf('0x18')](util[_0x0baf('0xe')](_0x0baf('0x1e'),config[_0x0baf('0x6')][_0x0baf('0x8')],config['asterisk']['ip'],config[_0x0baf('0x6')]['port'],util[_0x0baf('0x10')](_0x1fa92b,![],null)));});ami['on']('fullybooted',function(_0x4de74c){logger[_0x0baf('0x18')](util['format']('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));return BPromise['resolve']()[_0x0baf('0x1f')](ami[_0x0baf('0x20')]())[_0x0baf('0x1f')](ami[_0x0baf('0x11')]())[_0x0baf('0x1f')](ami[_0x0baf('0x13')]())[_0x0baf('0x1f')](ami['actionQueueSummary']())[_0x0baf('0x1f')](ami[_0x0baf('0x16')]())[_0x0baf('0x21')](function(_0x265915){logger['error'](_0x0baf('0x22'),util[_0x0baf('0x10')](_0x265915,{'showHidden':![],'depth':null}));});});ami['once'](_0x0baf('0xd'),error);ami[_0x0baf('0x1a')](_0x0baf('0x1b'),close);module[_0x0baf('0x23')]=ami; \ No newline at end of file +var _0x0b0e=['../../config/environment','asterisk','port','username','password','promisify','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','format','Action','sipshowregistry','actionDeviceStateList','devicestatelist','actionQueueSummary','actionCoreShowChannels','coreshowchannels','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','close','shutdown','info','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','then','actionSipPeerStatus','catch','[ami.js][fullybooted]','once','asterisk-manager','moment','lodash','../../config/logger','ami'];(function(_0x787fa,_0x2fd2b8){var _0x12cc98=function(_0x1d173e){while(--_0x1d173e){_0x787fa['push'](_0x787fa['shift']());}};_0x12cc98(++_0x2fd2b8);}(_0x0b0e,0x187));var _0xe0b0=function(_0x9faff7,_0x59a564){_0x9faff7=_0x9faff7-0x0;var _0x4f8043=_0x0b0e[_0x9faff7];return _0x4f8043;};'use strict';var Manager=require(_0xe0b0('0x0'));var BPromise=require('bluebird');var moment=require(_0xe0b0('0x1'));var util=require('util');var _=require(_0xe0b0('0x2'));var logger=require(_0xe0b0('0x3'))(_0xe0b0('0x4'));var config=require(_0xe0b0('0x5'));var ami=new Manager(config[_0xe0b0('0x6')][_0xe0b0('0x7')],config[_0xe0b0('0x6')]['ip'],config[_0xe0b0('0x6')][_0xe0b0('0x8')],config[_0xe0b0('0x6')][_0xe0b0('0x9')],!![]);ami['keepConnected']();ami['Action']=BPromise[_0xe0b0('0xa')](ami[_0xe0b0('0xb')]);function error(_0xc4a085){logger[_0xe0b0('0xc')](util['format'](_0xe0b0('0xd'),config[_0xe0b0('0x6')]['username'],config[_0xe0b0('0x6')]['ip'],config[_0xe0b0('0x6')]['port'],util[_0xe0b0('0xe')](_0xc4a085,![],null)));}function close(){logger[_0xe0b0('0xc')](util[_0xe0b0('0xf')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0xe0b0('0x6')][_0xe0b0('0x8')],config[_0xe0b0('0x6')]['ip'],config[_0xe0b0('0x6')][_0xe0b0('0x7')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0xe0b0('0x10')]({'action':_0xe0b0('0x11')});};};ami[_0xe0b0('0x12')]=function(){return function(){return ami[_0xe0b0('0x10')]({'action':_0xe0b0('0x13')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0xe0b0('0x10')]({'action':'sippeerstatus'});};};ami[_0xe0b0('0x14')]=function(){return function(){return ami[_0xe0b0('0x10')]({'action':'queuesummary'});};};ami[_0xe0b0('0x15')]=function(){return function(){return ami['Action']({'action':_0xe0b0('0x16')});};};function connect(_0x100204){logger['info'](util['format'](_0xe0b0('0x17'),config['asterisk']['username'],config['asterisk']['ip'],config[_0xe0b0('0x6')]['port']));ami['once'](_0xe0b0('0xc'),error);ami['once'](_0xe0b0('0x18'),close);}ami['on']('connect',connect);ami['on'](_0xe0b0('0x19'),function(_0x1cd7c4){logger[_0xe0b0('0x1a')](util[_0xe0b0('0xf')](_0xe0b0('0x1b'),config['asterisk']['username'],config[_0xe0b0('0x6')]['ip'],config['asterisk'][_0xe0b0('0x7')],util[_0xe0b0('0xe')](_0x1cd7c4,![],null)));});ami['on']('fullybooted',function(_0x170ad8){logger['info'](util[_0xe0b0('0xf')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0xe0b0('0x6')]['username'],config[_0xe0b0('0x6')]['ip'],config['asterisk'][_0xe0b0('0x7')]));return BPromise['resolve']()[_0xe0b0('0x1c')](ami['actionSipShowRegistry']())[_0xe0b0('0x1c')](ami[_0xe0b0('0x12')]())[_0xe0b0('0x1c')](ami[_0xe0b0('0x1d')]())[_0xe0b0('0x1c')](ami[_0xe0b0('0x14')]())['then'](ami[_0xe0b0('0x15')]())[_0xe0b0('0x1e')](function(_0x5b7a64){logger[_0xe0b0('0xc')](_0xe0b0('0x1f'),util[_0xe0b0('0xe')](_0x5b7a64,{'showHidden':![],'depth':null}));});});ami[_0xe0b0('0x20')](_0xe0b0('0xc'),error);ami[_0xe0b0('0x20')](_0xe0b0('0x18'),close);module['exports']=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 6e8bcae..22cd312 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 _0xac4a=['ami','client','http','then','debug','memberReport','error','message','result','catch','rpc','jayson/promise','bluebird','../../config/logger'];(function(_0x40f9a0,_0x3458cc){var _0x3e3144=function(_0x1f8fce){while(--_0x1f8fce){_0x40f9a0['push'](_0x40f9a0['shift']());}};_0x3e3144(++_0x3458cc);}(_0xac4a,0x13f));var _0xaac4=function(_0x2170b6,_0x3f0c2e){_0x2170b6=_0x2170b6-0x0;var _0x1da0c8=_0xac4a[_0x2170b6];return _0x1da0c8;};'use strict';var jayson=require(_0xaac4('0x0'));var BPromise=require(_0xaac4('0x1'));var logger=require(_0xaac4('0x2'))(_0xaac4('0x3'));var client=jayson[_0xaac4('0x4')][_0xaac4('0x5')]({'port':0x2329});client['Request']=function(_0x58626e,_0x2af0f6){return new BPromise(function(_0x2a5762,_0x32d34c){return client['request'](_0x58626e,_0x2af0f6)[_0xaac4('0x6')](function(_0x53d03a){logger[_0xaac4('0x7')]('rpc',_0xaac4('0x8'),_0x58626e,_0x2af0f6,_0x53d03a);if(_0x53d03a[_0xaac4('0x9')]){logger['error']('rpc',_0xaac4('0x8'),_0x58626e,_0x53d03a['error'][_0xaac4('0xa')],_0x2af0f6);return _0x32d34c(_0x53d03a['error']['message']);}else{return _0x2a5762(_0x53d03a[_0xaac4('0xb')]);}})[_0xaac4('0xc')](function(_0x38d1d0){logger[_0xaac4('0x9')](_0xaac4('0xd'),'memberReport',_0x58626e,_0x38d1d0,_0x2af0f6);return _0x32d34c(_0x38d1d0);});});};module['exports']=client; \ No newline at end of file +var _0x9c44=['ami','client','http','Request','then','debug','rpc','memberReport','error','message','result','exports','../../config/logger'];(function(_0x3c9def,_0x3f14db){var _0x211d29=function(_0x1bc22b){while(--_0x1bc22b){_0x3c9def['push'](_0x3c9def['shift']());}};_0x211d29(++_0x3f14db);}(_0x9c44,0x178));var _0x49c4=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x9c44[_0x4b055c];return _0x4b62bb;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var client=jayson[_0x49c4('0x2')][_0x49c4('0x3')]({'port':0x2329});client[_0x49c4('0x4')]=function(_0x2ad237,_0x4e0313){return new BPromise(function(_0x4941f1,_0x41a183){return client['request'](_0x2ad237,_0x4e0313)[_0x49c4('0x5')](function(_0x6030ae){logger[_0x49c4('0x6')](_0x49c4('0x7'),_0x49c4('0x8'),_0x2ad237,_0x4e0313,_0x6030ae);if(_0x6030ae['error']){logger[_0x49c4('0x9')](_0x49c4('0x7'),_0x49c4('0x8'),_0x2ad237,_0x6030ae[_0x49c4('0x9')]['message'],_0x4e0313);return _0x41a183(_0x6030ae['error'][_0x49c4('0xa')]);}else{return _0x4941f1(_0x6030ae[_0x49c4('0xb')]);}})['catch'](function(_0xb611a1){logger[_0x49c4('0x9')]('rpc','memberReport',_0x2ad237,_0xb611a1,_0x4e0313);return _0x41a183(_0xb611a1);});});};module[_0x49c4('0xc')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 91201fc..ce5b8ec 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 _0x6055=['countabandonedretry','countmachineretry','countagentrejectretry','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','starttime','format','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue','queue','exports','util','lodash','moment','isNil','string','voiceQueue','name','phone','Contact','lastName','number','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry'];(function(_0x816700,_0x5d3450){var _0x3d1af5=function(_0x400774){while(--_0x400774){_0x816700['push'](_0x816700['shift']());}};_0x3d1af5(++_0x5d3450);}(_0x6055,0x6d));var _0x5605=function(_0x446d82,_0x1c779a){_0x446d82=_0x446d82-0x0;var _0x2fbab6=_0x6055[_0x446d82];return _0x2fbab6;};'use strict';var util=require(_0x5605('0x0'));var _=require(_0x5605('0x1'));var moment=require(_0x5605('0x2'));function checkNameSurname(_0x2068b6,_0x56bc32,_0x4384b7){var _0x11483f='';if(!_[_0x5605('0x3')](_0x56bc32)&&_0x5605('0x4')===typeof _0x56bc32){_0x11483f+=_0x56bc32;}if(!_[_0x5605('0x3')](_0x4384b7)&&_0x5605('0x4')===typeof _0x4384b7){_0x11483f+='\x20'+_0x4384b7;}if(_0x11483f!==''){return _0x11483f;}return _0x2068b6;}function Action(_0x259d43,_0x133fe0,_0x3977c9){this[_0x5605('0x5')]=_0x259d43;this['uniqueid']=_0x3977c9||undefined;this[_0x5605('0x6')]=checkNameSurname(_0x133fe0['Contact'][_0x5605('0x7')],_0x133fe0[_0x5605('0x8')]['firstName'],_0x133fe0[_0x5605('0x8')][_0x5605('0x9')]);this[_0x5605('0xa')]=_0x133fe0[_0x5605('0x8')][_0x5605('0x7')];this['queue']=_0x259d43[_0x5605('0x6')];this[_0x5605('0xb')]=_0x133fe0['active']||![];this[_0x5605('0xc')]=_0x259d43[_0x5605('0xc')];this[_0x5605('0xd')]=_0x259d43[_0x5605('0xd')]||0x3;this[_0x5605('0xe')]=_0x133fe0['scheduledat'];this[_0x5605('0xf')]=_0x133fe0[_0x5605('0xf')];this[_0x5605('0x10')]=_0x133fe0[_0x5605('0x10')];this['countnoanswerretry']=_0x133fe0[_0x5605('0x11')];this['countnosuchnumberretry']=_0x133fe0[_0x5605('0x12')];this[_0x5605('0x13')]=_0x133fe0[_0x5605('0x13')];this[_0x5605('0x14')]=_0x133fe0['countabandonedretry'];this['countmachineretry']=_0x133fe0[_0x5605('0x15')];this[_0x5605('0x16')]=_0x133fe0[_0x5605('0x16')];this['ContactId']=_0x133fe0['ContactId'];this[_0x5605('0x17')]=_0x133fe0[_0x5605('0x17')];this[_0x5605('0x18')]=_0x133fe0['UserId'];this[_0x5605('0x19')]=_0x133fe0['VoiceQueueId'];this[_0x5605('0x1a')]=_0x133fe0['CampaignId'];this['idHopper']=_0x133fe0['id'];this[_0x5605('0x1b')]=_0x133fe0['Contact']['firstName']||'';this[_0x5605('0x1c')]=moment()[_0x5605('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x5605('0x1e')]=_0x133fe0[_0x5605('0x1e')];this[_0x5605('0x1f')]=_0x133fe0[_0x5605('0x1f')];this['callbackat']=_0x133fe0[_0x5605('0x20')];this[_0x5605('0x21')]=_0x133fe0['recallme'];this[_0x5605('0x22')]='';this[_0x5605('0x23')]='';}Action[_0x5605('0x24')]['getCaller']=function(){return util[_0x5605('0x1d')](_0x5605('0x25'),this[_0x5605('0x6')],this[_0x5605('0x5')][_0x5605('0x26')]>0x0?this['number'][_0x5605('0x27')](this[_0x5605('0x5')][_0x5605('0x26')]):this[_0x5605('0xa')]);};Action[_0x5605('0x24')][_0x5605('0x28')]=function(){return this[_0x5605('0x29')];};module[_0x5605('0x2a')]=Action; \ No newline at end of file +var _0xae0c=['callback','recallme','prototype','getCaller','\x22%s\x22\x20<%s>','substring','dialCutDigit','number','getQueue','queue','exports','lodash','string','isNil','voiceQueue','phone','Contact','firstName','lastName','name','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xae0c,0x1eb));var _0xcae0=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xae0c[_0xfae23b];return _0x200640;};'use strict';var util=require('util');var _=require(_0xcae0('0x0'));var moment=require('moment');function checkNameSurname(_0x45a23f,_0x14768f,_0x1637d4){var _0x3b8d2a='';if(!_['isNil'](_0x14768f)&&_0xcae0('0x1')===typeof _0x14768f){_0x3b8d2a+=_0x14768f;}if(!_[_0xcae0('0x2')](_0x1637d4)&&'string'===typeof _0x1637d4){_0x3b8d2a+='\x20'+_0x1637d4;}if(_0x3b8d2a!==''){return _0x3b8d2a;}return _0x45a23f;}function Action(_0x14b1ee,_0x14668d,_0x485b74){this[_0xcae0('0x3')]=_0x14b1ee;this['uniqueid']=_0x485b74||undefined;this['name']=checkNameSurname(_0x14668d['Contact'][_0xcae0('0x4')],_0x14668d[_0xcae0('0x5')][_0xcae0('0x6')],_0x14668d[_0xcae0('0x5')][_0xcae0('0x7')]);this['number']=_0x14668d[_0xcae0('0x5')][_0xcae0('0x4')];this['queue']=_0x14b1ee[_0xcae0('0x8')];this[_0xcae0('0x9')]=_0x14668d['active']||![];this[_0xcae0('0xa')]=_0x14b1ee[_0xcae0('0xa')];this[_0xcae0('0xb')]=_0x14b1ee[_0xcae0('0xb')]||0x3;this[_0xcae0('0xc')]=_0x14668d[_0xcae0('0xc')];this[_0xcae0('0xd')]=_0x14668d[_0xcae0('0xd')];this['countcongestionretry']=_0x14668d[_0xcae0('0xe')];this[_0xcae0('0xf')]=_0x14668d[_0xcae0('0xf')];this[_0xcae0('0x10')]=_0x14668d['countnosuchnumberretry'];this['countdropretry']=_0x14668d[_0xcae0('0x11')];this['countabandonedretry']=_0x14668d['countabandonedretry'];this[_0xcae0('0x12')]=_0x14668d['countmachineretry'];this[_0xcae0('0x13')]=_0x14668d[_0xcae0('0x13')];this['ContactId']=_0x14668d['ContactId'];this['ListId']=_0x14668d[_0xcae0('0x14')];this[_0xcae0('0x15')]=_0x14668d[_0xcae0('0x15')];this['VoiceQueueId']=_0x14668d[_0xcae0('0x16')];this[_0xcae0('0x17')]=_0x14668d['CampaignId'];this[_0xcae0('0x18')]=_0x14668d['id'];this[_0xcae0('0x19')]=_0x14668d[_0xcae0('0x5')][_0xcae0('0x6')]||'';this[_0xcae0('0x1a')]=moment()[_0xcae0('0x1b')](_0xcae0('0x1c'));this[_0xcae0('0x1d')]=_0x14668d[_0xcae0('0x1d')];this['callbackuniqueid']=_0x14668d['callbackuniqueid'];this['callbackat']=_0x14668d['callbackat'];this['recallme']=_0x14668d[_0xcae0('0x1e')];this['originatecalleridnum']='';this['originatecalleridname']='';}Action[_0xcae0('0x1f')][_0xcae0('0x20')]=function(){return util['format'](_0xcae0('0x21'),this['name'],this[_0xcae0('0x3')]['dialCutDigit']>0x0?this['number'][_0xcae0('0x22')](this[_0xcae0('0x3')][_0xcae0('0x23')]):this[_0xcae0('0x24')]);};Action[_0xcae0('0x1f')][_0xcae0('0x25')]=function(){return this[_0xcae0('0x26')];};module[_0xcae0('0x27')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 8ec69bb..56e5f22 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 _0x1c75=['Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','number','starttime','responsetime','answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','moment','milliseconds','diff','state','statedesc'];(function(_0x1b1b73,_0x38d787){var _0x403581=function(_0x131267){while(--_0x131267){_0x1b1b73['push'](_0x1b1b73['shift']());}};_0x403581(++_0x38d787);}(_0x1c75,0x82));var _0x51c7=function(_0x44ab9d,_0x3d060c){_0x44ab9d=_0x44ab9d-0x0;var _0x279648=_0x1c75[_0x44ab9d];return _0x279648;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x51c7('0x0'));function getSeconds(_0x419561,_0x4821dd){var _0x965097=moment(_0x419561)[_0x51c7('0x1')](0x0);var _0x10f4e8=moment(_0x4821dd)[_0x51c7('0x1')](0x0);return _0x965097[_0x51c7('0x2')](_0x10f4e8,'seconds');}function AgentComplete(_0x1514a4,_0x237031){this[_0x51c7('0x3')]=0x4;this[_0x51c7('0x4')]=_0x51c7('0x5');this['scheduledat']=_0x1514a4[_0x51c7('0x6')];this[_0x51c7('0x7')]=_0x1514a4[_0x51c7('0x7')];this[_0x51c7('0x8')]=_0x1514a4[_0x51c7('0x7')]===_0x51c7('0x9')?_0x51c7('0xa'):_0x1514a4[_0x51c7('0x7')];this['countbusyretry']=_0x1514a4[_0x51c7('0xb')];this[_0x51c7('0xc')]=_0x1514a4[_0x51c7('0xc')];this[_0x51c7('0xd')]=_0x1514a4['countnoanswerretry'];this[_0x51c7('0xe')]=_0x1514a4[_0x51c7('0xb')]+_0x1514a4[_0x51c7('0xc')]+_0x1514a4[_0x51c7('0xd')]+_0x1514a4[_0x51c7('0xf')]+_0x1514a4[_0x51c7('0x10')]+_0x1514a4[_0x51c7('0x11')]+_0x1514a4[_0x51c7('0x12')]+_0x1514a4['countagentrejectretry'];this[_0x51c7('0xf')]=_0x1514a4['countnosuchnumberretry'];this[_0x51c7('0x10')]=_0x1514a4[_0x51c7('0x10')];this[_0x51c7('0x11')]=_0x1514a4[_0x51c7('0x11')];this['countmachineretry']=_0x1514a4['countmachineretry'];this[_0x51c7('0x13')]=_0x1514a4[_0x51c7('0x13')];this['uniqueid']=_0x237031[_0x51c7('0x14')];this[_0x51c7('0x15')]=_0x1514a4[_0x51c7('0x16')];this['calleridnum']=_0x1514a4[_0x51c7('0x17')];this['starttime']=_0x1514a4[_0x51c7('0x18')];this['responsetime']=_0x1514a4[_0x51c7('0x19')];this[_0x51c7('0x1a')]=_0x1514a4[_0x51c7('0x1a')];this[_0x51c7('0x1b')]=moment()['format'](_0x51c7('0x1c'));this[_0x51c7('0x1d')]=getSeconds(_0x1514a4['responsetime'],_0x1514a4[_0x51c7('0x18')]);this[_0x51c7('0x1e')]=getSeconds(_0x1514a4[_0x51c7('0x1a')],_0x1514a4[_0x51c7('0x19')]);this[_0x51c7('0x1f')]=getSeconds(this['endtime'],_0x1514a4[_0x51c7('0x1a')]);this['queue']=_0x237031[_0x51c7('0xa')];this[_0x51c7('0x20')]=_0x237031[_0x51c7('0x20')];this['reason']=_0x237031[_0x51c7('0x21')];this['callback']=_0x1514a4[_0x51c7('0x22')];this['callbackuniqueid']=_0x1514a4[_0x51c7('0x23')];this['callbackat']=_0x1514a4[_0x51c7('0x24')];this[_0x51c7('0x25')]=_0x1514a4[_0x51c7('0x25')];this[_0x51c7('0x26')]=_0x1514a4[_0x51c7('0x26')];this[_0x51c7('0x27')]=_0x1514a4['ListId'];this['UserId']=_0x1514a4['UserId'];this[_0x51c7('0x28')]=_0x1514a4['VoiceQueueId'];this[_0x51c7('0x29')]=_0x1514a4[_0x51c7('0x29')];this[_0x51c7('0x2a')]=_0x1514a4[_0x51c7('0x2a')]||'';this[_0x51c7('0x2b')]=_0x1514a4['originatecalleridname']||'';}module[_0x51c7('0x2c')]=AgentComplete; \ No newline at end of file +var _0xf975=['moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countglobal','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','ringtime','holdtime','talktime','membername','reason','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0xf975,0xba));var _0x5f97=function(_0x3550e8,_0x424fea){_0x3550e8=_0x3550e8-0x0;var _0x18eb61=_0xf975[_0x3550e8];return _0x18eb61;};'use strict';var util=require(_0x5f97('0x0'));var _=require(_0x5f97('0x1'));var moment=require(_0x5f97('0x2'));function getSeconds(_0x137a71,_0x2c7c5a){var _0x24d1cc=moment(_0x137a71)[_0x5f97('0x3')](0x0);var _0x5f1872=moment(_0x2c7c5a)['milliseconds'](0x0);return _0x24d1cc[_0x5f97('0x4')](_0x5f1872,_0x5f97('0x5'));}function AgentComplete(_0x1a600c,_0x415dae){this[_0x5f97('0x6')]=0x4;this[_0x5f97('0x7')]=_0x5f97('0x8');this['scheduledat']=_0x1a600c[_0x5f97('0x9')];this[_0x5f97('0xa')]=_0x1a600c[_0x5f97('0xa')];this[_0x5f97('0xb')]=_0x1a600c[_0x5f97('0xa')]===_0x5f97('0xc')?_0x5f97('0xd'):_0x1a600c[_0x5f97('0xa')];this['countbusyretry']=_0x1a600c['countbusyretry'];this['countcongestionretry']=_0x1a600c['countcongestionretry'];this['countnoanswerretry']=_0x1a600c['countnoanswerretry'];this[_0x5f97('0xe')]=_0x1a600c[_0x5f97('0xf')]+_0x1a600c['countcongestionretry']+_0x1a600c[_0x5f97('0x10')]+_0x1a600c[_0x5f97('0x11')]+_0x1a600c[_0x5f97('0x12')]+_0x1a600c[_0x5f97('0x13')]+_0x1a600c['countmachineretry']+_0x1a600c[_0x5f97('0x14')];this[_0x5f97('0x11')]=_0x1a600c[_0x5f97('0x11')];this[_0x5f97('0x12')]=_0x1a600c[_0x5f97('0x12')];this[_0x5f97('0x13')]=_0x1a600c[_0x5f97('0x13')];this[_0x5f97('0x15')]=_0x1a600c['countmachineretry'];this[_0x5f97('0x14')]=_0x1a600c[_0x5f97('0x14')];this[_0x5f97('0x16')]=_0x415dae[_0x5f97('0x16')];this[_0x5f97('0x17')]=_0x1a600c[_0x5f97('0x18')];this[_0x5f97('0x19')]=_0x1a600c[_0x5f97('0x1a')];this[_0x5f97('0x1b')]=_0x1a600c[_0x5f97('0x1b')];this[_0x5f97('0x1c')]=_0x1a600c['responsetime'];this[_0x5f97('0x1d')]=_0x1a600c[_0x5f97('0x1d')];this[_0x5f97('0x1e')]=moment()[_0x5f97('0x1f')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x5f97('0x20')]=getSeconds(_0x1a600c[_0x5f97('0x1c')],_0x1a600c['starttime']);this[_0x5f97('0x21')]=getSeconds(_0x1a600c[_0x5f97('0x1d')],_0x1a600c[_0x5f97('0x1c')]);this[_0x5f97('0x22')]=getSeconds(this['endtime'],_0x1a600c['answertime']);this[_0x5f97('0xd')]=_0x415dae[_0x5f97('0xd')];this[_0x5f97('0x23')]=_0x415dae['membername'];this[_0x5f97('0x24')]=_0x415dae['reason'];this[_0x5f97('0x25')]=_0x1a600c[_0x5f97('0x25')];this[_0x5f97('0x26')]=_0x1a600c[_0x5f97('0x26')];this['callbackat']=_0x1a600c['callbackat'];this[_0x5f97('0x27')]=_0x1a600c[_0x5f97('0x27')];this[_0x5f97('0x28')]=_0x1a600c[_0x5f97('0x28')];this['ListId']=_0x1a600c[_0x5f97('0x29')];this[_0x5f97('0x2a')]=_0x1a600c[_0x5f97('0x2a')];this[_0x5f97('0x2b')]=_0x1a600c[_0x5f97('0x2b')];this[_0x5f97('0x2c')]=_0x1a600c[_0x5f97('0x2c')];this['originatecalleridnum']=_0x1a600c[_0x5f97('0x2d')]||'';this[_0x5f97('0x2e')]=_0x1a600c[_0x5f97('0x2e')]||'';}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 741ce2b..6bb81dc 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 _0xfc76=['exports','lodash','moment','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0xfc76,0xb5));var _0x6fc7=function(_0x36f85a,_0x1e7f34){_0x36f85a=_0x36f85a-0x0;var _0xd89a86=_0xfc76[_0x36f85a];return _0xd89a86;};'use strict';var util=require('util');var _=require(_0x6fc7('0x0'));var moment=require(_0x6fc7('0x1'));function getSeconds(_0x1d6ab9,_0xdc26f7){var _0x5c0232=moment(_0x1d6ab9)['milliseconds'](0x0);var _0x316cc4=moment(_0xdc26f7)[_0x6fc7('0x2')](0x0);return _0x5c0232['diff'](_0x316cc4,_0x6fc7('0x3'));}function Final(_0x51cb40){this[_0x6fc7('0x4')]=_0x51cb40[_0x6fc7('0x4')];this[_0x6fc7('0x5')]=_0x51cb40['scheduledat'];this[_0x6fc7('0x6')]=_0x51cb40[_0x6fc7('0x6')];this[_0x6fc7('0x7')]=_0x51cb40[_0x6fc7('0x6')]===_0x6fc7('0x8')?_0x6fc7('0x9'):_0x51cb40['type'];this[_0x6fc7('0xa')]=_0x51cb40[_0x6fc7('0xa')];this[_0x6fc7('0xb')]=_0x51cb40[_0x6fc7('0xb')];this[_0x6fc7('0xc')]=_0x51cb40[_0x6fc7('0xc')];this['countglobal']=_0x51cb40[_0x6fc7('0xa')]+_0x51cb40[_0x6fc7('0xb')]+_0x51cb40['countnoanswerretry']+_0x51cb40[_0x6fc7('0xd')]+_0x51cb40[_0x6fc7('0xe')]+_0x51cb40['countabandonedretry']+_0x51cb40[_0x6fc7('0xf')]+_0x51cb40[_0x6fc7('0x10')];this['countnosuchnumberretry']=_0x51cb40[_0x6fc7('0xd')];this[_0x6fc7('0xe')]=_0x51cb40[_0x6fc7('0xe')];this['countabandonedretry']=_0x51cb40['countabandonedretry'];this[_0x6fc7('0xf')]=_0x51cb40[_0x6fc7('0xf')];this['countagentrejectretry']=_0x51cb40[_0x6fc7('0x10')];this[_0x6fc7('0x9')]=_0x51cb40[_0x6fc7('0x9')];this[_0x6fc7('0x11')]=_0x51cb40['calleridname'];this[_0x6fc7('0x12')]=_0x51cb40[_0x6fc7('0x12')];this[_0x6fc7('0x13')]=_0x51cb40[_0x6fc7('0x13')];this[_0x6fc7('0x14')]=_0x51cb40[_0x6fc7('0x14')];this['endtime']=_0x51cb40[_0x6fc7('0x14')];this[_0x6fc7('0x15')]=_0x51cb40[_0x6fc7('0x15')]||0x0;this[_0x6fc7('0x16')]=_0x51cb40[_0x6fc7('0x16')]||0x0;this['talktime']=_0x51cb40[_0x6fc7('0x17')]||0x0;this[_0x6fc7('0x18')]=_0x51cb40['callback'];this[_0x6fc7('0x19')]=_0x51cb40['callbackuniqueid'];this[_0x6fc7('0x1a')]=_0x51cb40['callbackat'];this[_0x6fc7('0x1b')]=_0x51cb40[_0x6fc7('0x1b')];this[_0x6fc7('0x1c')]=_0x51cb40['ContactId'];this[_0x6fc7('0x1d')]=_0x51cb40['ListId'];this[_0x6fc7('0x1e')]=_0x51cb40[_0x6fc7('0x1e')];this[_0x6fc7('0x1f')]=_0x51cb40[_0x6fc7('0x1f')];this[_0x6fc7('0x20')]=_0x51cb40[_0x6fc7('0x20')];this[_0x6fc7('0x21')]=_0x51cb40[_0x6fc7('0x21')]||'';this[_0x6fc7('0x22')]=_0x51cb40[_0x6fc7('0x22')]||'';}module[_0x6fc7('0x23')]=Final; \ No newline at end of file +var _0x4f0d=['campaigntype','outbound','queue','countbusyretry','countnoanswerretry','countcongestionretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','calleridname','calleridnum','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','milliseconds','diff','uniqueid','scheduledat','type'];(function(_0x32191d,_0x1f080f){var _0x1842e1=function(_0x2f2343){while(--_0x2f2343){_0x32191d['push'](_0x32191d['shift']());}};_0x1842e1(++_0x1f080f);}(_0x4f0d,0x1c2));var _0xd4f0=function(_0x599d7f,_0xc586e8){_0x599d7f=_0x599d7f-0x0;var _0x3346d3=_0x4f0d[_0x599d7f];return _0x3346d3;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');function getSeconds(_0x5290b6,_0x5cd109){var _0xc4d56b=moment(_0x5290b6)[_0xd4f0('0x0')](0x0);var _0x216b0d=moment(_0x5cd109)['milliseconds'](0x0);return _0xc4d56b[_0xd4f0('0x1')](_0x216b0d,'seconds');}function Final(_0x501b8f){this[_0xd4f0('0x2')]=_0x501b8f['uniqueid'];this[_0xd4f0('0x3')]=_0x501b8f[_0xd4f0('0x3')];this['type']=_0x501b8f[_0xd4f0('0x4')];this[_0xd4f0('0x5')]=_0x501b8f[_0xd4f0('0x4')]===_0xd4f0('0x6')?_0xd4f0('0x7'):_0x501b8f['type'];this[_0xd4f0('0x8')]=_0x501b8f[_0xd4f0('0x8')];this['countcongestionretry']=_0x501b8f['countcongestionretry'];this[_0xd4f0('0x9')]=_0x501b8f[_0xd4f0('0x9')];this['countglobal']=_0x501b8f[_0xd4f0('0x8')]+_0x501b8f[_0xd4f0('0xa')]+_0x501b8f[_0xd4f0('0x9')]+_0x501b8f[_0xd4f0('0xb')]+_0x501b8f[_0xd4f0('0xc')]+_0x501b8f['countabandonedretry']+_0x501b8f[_0xd4f0('0xd')]+_0x501b8f[_0xd4f0('0xe')];this[_0xd4f0('0xb')]=_0x501b8f[_0xd4f0('0xb')];this[_0xd4f0('0xc')]=_0x501b8f[_0xd4f0('0xc')];this[_0xd4f0('0xf')]=_0x501b8f[_0xd4f0('0xf')];this[_0xd4f0('0xd')]=_0x501b8f[_0xd4f0('0xd')];this[_0xd4f0('0xe')]=_0x501b8f[_0xd4f0('0xe')];this['queue']=_0x501b8f['queue'];this[_0xd4f0('0x10')]=_0x501b8f[_0xd4f0('0x10')];this[_0xd4f0('0x11')]=_0x501b8f[_0xd4f0('0x11')];this['starttime']=_0x501b8f['starttime'];this[_0xd4f0('0x12')]=_0x501b8f[_0xd4f0('0x12')];this[_0xd4f0('0x13')]=_0x501b8f[_0xd4f0('0x12')];this[_0xd4f0('0x14')]=_0x501b8f[_0xd4f0('0x14')]||0x0;this[_0xd4f0('0x15')]=_0x501b8f[_0xd4f0('0x15')]||0x0;this[_0xd4f0('0x16')]=_0x501b8f[_0xd4f0('0x16')]||0x0;this['callback']=_0x501b8f[_0xd4f0('0x17')];this[_0xd4f0('0x18')]=_0x501b8f[_0xd4f0('0x18')];this['callbackat']=_0x501b8f[_0xd4f0('0x19')];this[_0xd4f0('0x1a')]=_0x501b8f[_0xd4f0('0x1a')];this['ContactId']=_0x501b8f[_0xd4f0('0x1b')];this[_0xd4f0('0x1c')]=_0x501b8f[_0xd4f0('0x1c')];this[_0xd4f0('0x1d')]=_0x501b8f['UserId'];this[_0xd4f0('0x1e')]=_0x501b8f[_0xd4f0('0x1e')];this[_0xd4f0('0x1f')]=_0x501b8f[_0xd4f0('0x1f')];this['originatecalleridnum']=_0x501b8f[_0xd4f0('0x20')]||'';this['originatecalleridname']=_0x501b8f[_0xd4f0('0x21')]||'';}module[_0xd4f0('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 115431b..ac29b38 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 _0x2c14=['uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countmachineretry','countagentrejectretry','countabandonedretry'];(function(_0x1034ca,_0x14ecd6){var _0x1a023a=function(_0x2cfa65){while(--_0x2cfa65){_0x1034ca['push'](_0x1034ca['shift']());}};_0x1a023a(++_0x14ecd6);}(_0x2c14,0xab));var _0x42c1=function(_0x4bdf6f,_0x19c32a){_0x4bdf6f=_0x4bdf6f-0x0;var _0x8de20a=_0x2c14[_0x4bdf6f];return _0x8de20a;};'use strict';var util=require(_0x42c1('0x0'));var _=require(_0x42c1('0x1'));var moment=require(_0x42c1('0x2'));function getSeconds(_0x2d28ec,_0x439b74){var _0xdb2c1b=moment(_0x2d28ec)[_0x42c1('0x3')](0x0);var _0x492d65=moment(_0x439b74)[_0x42c1('0x3')](0x0);return _0xdb2c1b['diff'](_0x492d65,_0x42c1('0x4'));}function Hangup(_0x199304,_0x56f409){this[_0x42c1('0x5')]=0x4;this[_0x42c1('0x6')]=_0x42c1('0x7');this[_0x42c1('0x8')]=_0x199304[_0x42c1('0x8')];this[_0x42c1('0x9')]=_0x199304[_0x42c1('0x9')];this[_0x42c1('0xa')]=_0x199304[_0x42c1('0x9')]===_0x42c1('0xb')?_0x42c1('0xc'):_0x199304[_0x42c1('0x9')];this[_0x42c1('0xd')]=_0x199304[_0x42c1('0xd')];this[_0x42c1('0xe')]=_0x199304['countcongestionretry'];this['countnoanswerretry']=_0x199304[_0x42c1('0xf')];this[_0x42c1('0x10')]=_0x199304[_0x42c1('0xd')]+_0x199304[_0x42c1('0xe')]+_0x199304[_0x42c1('0xf')]+_0x199304[_0x42c1('0x11')]+_0x199304['countdropretry']+_0x199304['countabandonedretry']+_0x199304[_0x42c1('0x12')]+_0x199304[_0x42c1('0x13')];this[_0x42c1('0x11')]=_0x199304[_0x42c1('0x11')];this['countdropretry']=_0x199304['countdropretry'];this[_0x42c1('0x14')]=_0x199304[_0x42c1('0x14')];this[_0x42c1('0x12')]=_0x199304[_0x42c1('0x12')];this[_0x42c1('0x13')]=_0x199304[_0x42c1('0x13')];this[_0x42c1('0x15')]=_0x56f409['uniqueid'];this[_0x42c1('0x16')]=_0x199304[_0x42c1('0x17')];this[_0x42c1('0x18')]=_0x199304[_0x42c1('0x19')];this[_0x42c1('0x1a')]=_0x199304[_0x42c1('0x1a')];this[_0x42c1('0x1b')]=_0x199304[_0x42c1('0x1b')];this[_0x42c1('0x1c')]=moment()[_0x42c1('0x1d')](_0x42c1('0x1e'));this[_0x42c1('0x1f')]=getSeconds(_0x199304[_0x42c1('0x1b')],_0x199304[_0x42c1('0x1a')]);this[_0x42c1('0x20')]=0x0;this[_0x42c1('0x21')]=getSeconds(this[_0x42c1('0x1c')],_0x199304[_0x42c1('0x1b')]);this[_0x42c1('0xc')]=_0x199304[_0x42c1('0xc')];this[_0x42c1('0x22')]=_0x42c1('0x23');this[_0x42c1('0x24')]=_0x56f409[_0x42c1('0x25')];this[_0x42c1('0x26')]=_0x199304[_0x42c1('0x26')];this[_0x42c1('0x27')]=_0x199304['callbackuniqueid'];this[_0x42c1('0x28')]=_0x199304[_0x42c1('0x28')];this[_0x42c1('0x29')]=_0x199304[_0x42c1('0x29')];this['ContactId']=_0x199304[_0x42c1('0x2a')];this[_0x42c1('0x2b')]=_0x199304['ListId'];this[_0x42c1('0x2c')]=_0x199304[_0x42c1('0x2c')];this[_0x42c1('0x2d')]=_0x199304[_0x42c1('0x2d')];this[_0x42c1('0x2e')]=_0x199304['CampaignId'];}module[_0x42c1('0x2f')]=Hangup; \ No newline at end of file +var _0x1bfd=['uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','membername','IVR','cause-txt','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry'];(function(_0x26849e,_0x39c560){var _0x4b090e=function(_0x594941){while(--_0x594941){_0x26849e['push'](_0x26849e['shift']());}};_0x4b090e(++_0x39c560);}(_0x1bfd,0x71));var _0xd1bf=function(_0xf2f46b,_0x89cf58){_0xf2f46b=_0xf2f46b-0x0;var _0x382051=_0x1bfd[_0xf2f46b];return _0x382051;};'use strict';var util=require(_0xd1bf('0x0'));var _=require(_0xd1bf('0x1'));var moment=require(_0xd1bf('0x2'));function getSeconds(_0x1a9c8d,_0x5f38ab){var _0x4b2384=moment(_0x1a9c8d)[_0xd1bf('0x3')](0x0);var _0x5d1a18=moment(_0x5f38ab)[_0xd1bf('0x3')](0x0);return _0x4b2384[_0xd1bf('0x4')](_0x5d1a18,'seconds');}function Hangup(_0xf4f892,_0x59d6c2){this[_0xd1bf('0x5')]=0x4;this[_0xd1bf('0x6')]=_0xd1bf('0x7');this[_0xd1bf('0x8')]=_0xf4f892[_0xd1bf('0x8')];this[_0xd1bf('0x9')]=_0xf4f892['type'];this[_0xd1bf('0xa')]=_0xf4f892[_0xd1bf('0x9')]===_0xd1bf('0xb')?_0xd1bf('0xc'):_0xf4f892[_0xd1bf('0x9')];this[_0xd1bf('0xd')]=_0xf4f892[_0xd1bf('0xd')];this[_0xd1bf('0xe')]=_0xf4f892['countcongestionretry'];this[_0xd1bf('0xf')]=_0xf4f892[_0xd1bf('0xf')];this[_0xd1bf('0x10')]=_0xf4f892[_0xd1bf('0xd')]+_0xf4f892['countcongestionretry']+_0xf4f892[_0xd1bf('0xf')]+_0xf4f892[_0xd1bf('0x11')]+_0xf4f892[_0xd1bf('0x12')]+_0xf4f892[_0xd1bf('0x13')]+_0xf4f892[_0xd1bf('0x14')]+_0xf4f892[_0xd1bf('0x15')];this[_0xd1bf('0x11')]=_0xf4f892['countnosuchnumberretry'];this['countdropretry']=_0xf4f892[_0xd1bf('0x12')];this['countabandonedretry']=_0xf4f892[_0xd1bf('0x13')];this[_0xd1bf('0x14')]=_0xf4f892['countmachineretry'];this[_0xd1bf('0x15')]=_0xf4f892[_0xd1bf('0x15')];this['uniqueid']=_0x59d6c2[_0xd1bf('0x16')];this[_0xd1bf('0x17')]=_0xf4f892[_0xd1bf('0x18')];this[_0xd1bf('0x19')]=_0xf4f892[_0xd1bf('0x1a')];this[_0xd1bf('0x1b')]=_0xf4f892[_0xd1bf('0x1b')];this[_0xd1bf('0x1c')]=_0xf4f892[_0xd1bf('0x1c')];this[_0xd1bf('0x1d')]=moment()['format'](_0xd1bf('0x1e'));this['ringtime']=getSeconds(_0xf4f892['responsetime'],_0xf4f892[_0xd1bf('0x1b')]);this[_0xd1bf('0x1f')]=0x0;this[_0xd1bf('0x20')]=getSeconds(this[_0xd1bf('0x1d')],_0xf4f892[_0xd1bf('0x1c')]);this[_0xd1bf('0xc')]=_0xf4f892[_0xd1bf('0xc')];this[_0xd1bf('0x21')]=_0xd1bf('0x22');this['reason']=_0x59d6c2[_0xd1bf('0x23')];this[_0xd1bf('0x24')]=_0xf4f892[_0xd1bf('0x24')];this[_0xd1bf('0x25')]=_0xf4f892[_0xd1bf('0x25')];this['callbackat']=_0xf4f892['callbackat'];this['recallme']=_0xf4f892[_0xd1bf('0x26')];this[_0xd1bf('0x27')]=_0xf4f892[_0xd1bf('0x27')];this[_0xd1bf('0x28')]=_0xf4f892[_0xd1bf('0x28')];this[_0xd1bf('0x29')]=_0xf4f892[_0xd1bf('0x29')];this[_0xd1bf('0x2a')]=_0xf4f892[_0xd1bf('0x2a')];this['CampaignId']=_0xf4f892[_0xd1bf('0x2b')];}module[_0xd1bf('0x2c')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 752540f..44216bb 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 _0x8ef8=['countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','queue','calleridname','name','calleridnum','starttime','responsetime','endtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry'];(function(_0xc6f29c,_0x469980){var _0x47191d=function(_0x592b2c){while(--_0x592b2c){_0xc6f29c['push'](_0xc6f29c['shift']());}};_0x47191d(++_0x469980);}(_0x8ef8,0x105));var _0x88ef=function(_0x5ed98b,_0x2ec8d6){_0x5ed98b=_0x5ed98b-0x0;var _0x47724a=_0x8ef8[_0x5ed98b];return _0x47724a;};'use strict';var util=require(_0x88ef('0x0'));var _=require(_0x88ef('0x1'));var moment=require(_0x88ef('0x2'));function getSeconds(_0x51e03d,_0x34d05a){var _0x1bcdf0=moment(_0x51e03d)['milliseconds'](0x0);var _0x5f1d70=moment(_0x34d05a)[_0x88ef('0x3')](0x0);return _0x1bcdf0['diff'](_0x5f1d70,_0x88ef('0x4'));}function History(_0x1f737e){this[_0x88ef('0x5')]=_0x1f737e['uniqueid'];this[_0x88ef('0x6')]=_0x1f737e[_0x88ef('0x6')]||undefined;this[_0x88ef('0x7')]=_0x1f737e[_0x88ef('0x7')];this[_0x88ef('0x8')]=_0x1f737e['type']===_0x88ef('0x9')?'queue':_0x1f737e[_0x88ef('0x7')];this[_0x88ef('0xa')]=_0x1f737e[_0x88ef('0xa')];this[_0x88ef('0xb')]=_0x1f737e['countcongestionretry'];this['countnoanswerretry']=_0x1f737e[_0x88ef('0xc')];this[_0x88ef('0xd')]=_0x1f737e[_0x88ef('0xa')]+_0x1f737e[_0x88ef('0xb')]+_0x1f737e[_0x88ef('0xc')]+_0x1f737e['countnosuchnumberretry']+_0x1f737e[_0x88ef('0xe')]+_0x1f737e[_0x88ef('0xf')]+_0x1f737e[_0x88ef('0x10')]+_0x1f737e[_0x88ef('0x11')];this['countnosuchnumberretry']=_0x1f737e[_0x88ef('0x12')];this[_0x88ef('0xe')]=_0x1f737e[_0x88ef('0xe')];this[_0x88ef('0xf')]=_0x1f737e[_0x88ef('0xf')];this[_0x88ef('0x10')]=_0x1f737e[_0x88ef('0x10')];this[_0x88ef('0x11')]=_0x1f737e['countagentrejectretry'];this[_0x88ef('0x13')]=_0x1f737e[_0x88ef('0x13')];this[_0x88ef('0x14')]=_0x1f737e[_0x88ef('0x15')];this[_0x88ef('0x16')]=_0x1f737e['number'];this[_0x88ef('0x17')]=_0x1f737e['starttime'];this['responsetime']=_0x1f737e[_0x88ef('0x18')];this[_0x88ef('0x19')]=_0x1f737e['responsetime'];this['ringtime']=getSeconds(_0x1f737e['responsetime'],_0x1f737e[_0x88ef('0x17')]);this['holdtime']=0x0;this[_0x88ef('0x1a')]=0x0;this[_0x88ef('0x1b')]=_0x1f737e['callback'];this[_0x88ef('0x1c')]=_0x1f737e['callbackuniqueid'];this[_0x88ef('0x1d')]=_0x1f737e[_0x88ef('0x1d')];this['recallme']=_0x1f737e[_0x88ef('0x1e')];this[_0x88ef('0x1f')]=_0x1f737e[_0x88ef('0x1f')];this['ListId']=_0x1f737e[_0x88ef('0x20')];this[_0x88ef('0x21')]=_0x1f737e[_0x88ef('0x21')];this['VoiceQueueId']=_0x1f737e[_0x88ef('0x22')];this[_0x88ef('0x23')]=_0x1f737e[_0x88ef('0x23')];this[_0x88ef('0x24')]=_0x1f737e[_0x88ef('0x24')]||'';this[_0x88ef('0x25')]=_0x1f737e[_0x88ef('0x25')]||'';}module[_0x88ef('0x26')]=History; \ No newline at end of file +var _0xd654=['countagentrejectretry','countnosuchnumberretry','countdropretry','calleridname','name','calleridnum','number','responsetime','ringtime','starttime','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countabandonedretry','countmachineretry'];(function(_0x30fe75,_0x3e069e){var _0x466006=function(_0x36ae0e){while(--_0x36ae0e){_0x30fe75['push'](_0x30fe75['shift']());}};_0x466006(++_0x3e069e);}(_0xd654,0x16d));var _0x4d65=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd654[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0x4d65('0x0'));var _=require('lodash');var moment=require(_0x4d65('0x1'));function getSeconds(_0x145340,_0x54c4ad){var _0x334f6a=moment(_0x145340)[_0x4d65('0x2')](0x0);var _0x3c321c=moment(_0x54c4ad)[_0x4d65('0x2')](0x0);return _0x334f6a['diff'](_0x3c321c,'seconds');}function History(_0x82b69){this[_0x4d65('0x3')]=_0x82b69['uniqueid'];this[_0x4d65('0x4')]=_0x82b69[_0x4d65('0x4')]||undefined;this[_0x4d65('0x5')]=_0x82b69['type'];this[_0x4d65('0x6')]=_0x82b69[_0x4d65('0x5')]===_0x4d65('0x7')?_0x4d65('0x8'):_0x82b69['type'];this[_0x4d65('0x9')]=_0x82b69['countbusyretry'];this[_0x4d65('0xa')]=_0x82b69[_0x4d65('0xa')];this[_0x4d65('0xb')]=_0x82b69['countnoanswerretry'];this[_0x4d65('0xc')]=_0x82b69['countbusyretry']+_0x82b69['countcongestionretry']+_0x82b69[_0x4d65('0xb')]+_0x82b69['countnosuchnumberretry']+_0x82b69['countdropretry']+_0x82b69[_0x4d65('0xd')]+_0x82b69[_0x4d65('0xe')]+_0x82b69[_0x4d65('0xf')];this[_0x4d65('0x10')]=_0x82b69[_0x4d65('0x10')];this[_0x4d65('0x11')]=_0x82b69['countdropretry'];this[_0x4d65('0xd')]=_0x82b69[_0x4d65('0xd')];this[_0x4d65('0xe')]=_0x82b69[_0x4d65('0xe')];this['countagentrejectretry']=_0x82b69['countagentrejectretry'];this[_0x4d65('0x8')]=_0x82b69['queue'];this[_0x4d65('0x12')]=_0x82b69[_0x4d65('0x13')];this[_0x4d65('0x14')]=_0x82b69[_0x4d65('0x15')];this['starttime']=_0x82b69['starttime'];this[_0x4d65('0x16')]=_0x82b69[_0x4d65('0x16')];this['endtime']=_0x82b69[_0x4d65('0x16')];this[_0x4d65('0x17')]=getSeconds(_0x82b69['responsetime'],_0x82b69[_0x4d65('0x18')]);this[_0x4d65('0x19')]=0x0;this['talktime']=0x0;this[_0x4d65('0x1a')]=_0x82b69[_0x4d65('0x1a')];this[_0x4d65('0x1b')]=_0x82b69[_0x4d65('0x1b')];this[_0x4d65('0x1c')]=_0x82b69[_0x4d65('0x1c')];this['recallme']=_0x82b69[_0x4d65('0x1d')];this[_0x4d65('0x1e')]=_0x82b69[_0x4d65('0x1e')];this[_0x4d65('0x1f')]=_0x82b69['ListId'];this[_0x4d65('0x20')]=_0x82b69[_0x4d65('0x20')];this['VoiceQueueId']=_0x82b69[_0x4d65('0x21')];this[_0x4d65('0x22')]=_0x82b69[_0x4d65('0x22')];this[_0x4d65('0x23')]=_0x82b69[_0x4d65('0x23')]||'';this[_0x4d65('0x24')]=_0x82b69[_0x4d65('0x24')]||'';}module[_0x4d65('0x25')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index d30fd89..a3725da 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 _0xa325=['trim','dialCutDigit','substring','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','originate\x20action\x20Error','isSuccess','callProgressDetecting','checkRetriveMax','countcongestionretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','minutes','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialDropMaxRetry','[rescheduleContact][Drop]','dialAbandonedRetryFrequency','[rescheduleContact][Machine]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','stateGlobal','NoAnswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','predictiveIntervalMaxThreshold','round','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','averageHandleTime','startMethodPredictive','Predictive\x20after\x20first\x20interval','getDataPredictive','Predictive\x20for\x20every\x20interval',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','Unknown\x20Predictive','[getDataPredictive]','check\x20failure','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','dialRecallMeTimeout','Agent','voicePause','dialRecallInQueue','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','AVAILABLE_CONTACTS_FINISHED','[getContactCampaign2][Empty]','RUNNING','Contact.phone','[getContactCampaign2]','dialLimitQueue','not_inuse','[countReScheduled]\x20','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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----','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','m\x20=\x20','Umin\x20=\x20','exports','util','bluebird','uuid','md5','ioredis','../../../config/logger','booked','predictive','../ami','redis','defaults','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./final','./agentComplete','./queueCallerAbandon','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','prototype','enqueue','tail','preview','campaigns','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','custom:queuesummary','hangup','syncNewExten','varset','syncVarSet','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','emit','outbound','answered','available','loggedIn','pTalking','sumDuration','talking','total','type','unmanaged','abandoned','waiting','loggedInDb','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startPredictive','Trunk','active','callerid','format','voice:queue:%s','voice_queue:save','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','merge','clearing\x20variable\x20start\x20progressive','handlePredictive','clearing\x20variable\x20handle\x20predictive','ivr','string','\x22%s\x22\x20<%s>','error','inspect','originated','[decremetOriginate]\x20object\x20originated\x20is\x20negative','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','[getContactDialer2][Empty]','sendMessageOneNotActive','NOT_ACTIVE','[syncQueueSummary]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','statedesc','starttime','loopClearZombieChannels','clearZombieChannels','[uniqueid]','[actions]','undefined','sequence','isNil','Action','channel','catch','voiceQueues','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','unlockContact','[unlockContact]\x20','getContactDialer','temp','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','updateOriginated','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','saveInDb','pick','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','Success','isTrunkReachable','status','reachable','SIP/%s','unmonitored','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','HangupInAMD','membername','AMD','custom:amd','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','state','Machine','countmachineretry','countglobal','buildObj','[syncAgentComplete][createHistory][0]','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','dialGlobalMaxRetry','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','YYYY-MM-DD\x20HH:mm:ss','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','uniqueid','countbusyretry','countagentrejectretry','ContactId','syncHangup','ivrAnswerCallsDay','[syncHangupIvr]','AnswerAGI','AGI','[syncHangupIvr][createHistory]','dialQueueProject','Unknow','syncAgentComplete','reason','agent','agiafterat','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','answertime','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','dialQueueProject2','queueCallerAbandonCreateState','dialDropRetryFrequency','endtime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','strategy','roundrobin','actionid','paused','agents','stateinterface','locked','push','idHopper','[unlockQueueStatus][undefined]','queueStatusComplete','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','finally','_rr','length','unlockRR','[booked][RR]','[booked][RR][finaly]','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock]','[unlock][syncQueueStatusComplete]','[booked][unlock2]','[unlock3][syncQueueStatusComplete]','resetActiveCalls','syncCampaigns','TrunkBackup','\x20trunk\x20is\x20not\x20reachable','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','content','indexOf','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','progressive','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','syncQueueSummary','dialActive','checkIsTrunkReachable','checkIfTime','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','checkDialMethod','[syncQueueSummary]','[syncCampaigns]','\x5cw{0,','pow','random','match','actionOriginate','object','voiceQueue\x20is\x20undefine','Contact','phone','originate','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialer','XMD-AMDINITIALSILENCE','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s'];(function(_0x32e6f2,_0xd06033){var _0x21dec3=function(_0x3f5e6d){while(--_0x3f5e6d){_0x32e6f2['push'](_0x32e6f2['shift']());}};_0x21dec3(++_0xd06033);}(_0xa325,0x8d));var _0x5a32=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xa325[_0x4ff09b];return _0x3f5c2e;};'use strict';var util=require(_0x5a32('0x0'));var _=require('lodash');var BPromise=require(_0x5a32('0x1'));var uuid=require(_0x5a32('0x2'));var moment=require('moment');var rr=require('rr');var md5=require(_0x5a32('0x3'));var Redis=require(_0x5a32('0x4'));var ut=require('../preview/util/util');var config=require('../../../config/environment/');var logger=require('../../../config/logger')('dialer');var loggerBooked=require(_0x5a32('0x5'))(_0x5a32('0x6'));var loggerPredictive=require(_0x5a32('0x5'))(_0x5a32('0x7'));var loggerPredictiveCalls=require(_0x5a32('0x5'))('predictiveCalls');var loggerSyncQueueSummary=require(_0x5a32('0x5'))('syncQueueSummary');var ami=require(_0x5a32('0x8'));config[_0x5a32('0x9')]=_[_0x5a32('0xa')](config[_0x5a32('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x5a32('0xb'))(new Redis(config[_0x5a32('0x9')]));var cmHopper=require(_0x5a32('0xc'));var cmHopperHistory=require(_0x5a32('0xd'));var cmHopperBlack=require(_0x5a32('0xe'));var voiceQueueRt=require(_0x5a32('0xf'));var Action=require(_0x5a32('0x10'));var History=require(_0x5a32('0x11'));var Final=require(_0x5a32('0x12'));var AgentComplete=require(_0x5a32('0x13'));var QueueCallerAbandon=require(_0x5a32('0x14'));var Hangup=require('./hangup');var ipAgi=process[_0x5a32('0x15')][_0x5a32('0x16')]||_0x5a32('0x17');var strategy={'rrmemory':_0x5a32('0x18'),'roundrobin':'roundrobin'};var Sequence=function(){};Sequence[_0x5a32('0x19')][_0x5a32('0x1a')]=function(_0x3249e4){this[_0x5a32('0x1b')]=this[_0x5a32('0x1b')]?this[_0x5a32('0x1b')]['finally'](_0x3249e4):_0x3249e4();};function Dialer(_0x5cd215,_0x1d7e7a){this['sequence']=new Sequence();this[_0x5a32('0x1c')]=_0x1d7e7a;this['voiceQueues']=_0x5cd215['voiceQueues'];this[_0x5a32('0x1d')]=_0x5cd215['campaigns'];this['agents']=_0x5cd215['agents'];this[_0x5a32('0x1e')]=_0x5cd215[_0x5a32('0x1e')];this[_0x5a32('0x1f')]=config[_0x5a32('0x1f')]||0x2;this[_0x5a32('0x20')]={};this[_0x5a32('0x21')]={};this[_0x5a32('0x22')]={};this[_0x5a32('0x23')]={};this[_0x5a32('0x24')]={};this['startPredictive']={};this[_0x5a32('0x25')]={};this[_0x5a32('0x26')]={};this[_0x5a32('0x27')]={};this[_0x5a32('0x28')]={};ami['on'](_0x5a32('0x29'),this[_0x5a32('0x2a')][_0x5a32('0x2b')](this));ami['on'](_0x5a32('0x2c'),this[_0x5a32('0x2d')][_0x5a32('0x2b')](this));ami['on'](_0x5a32('0x2e'),this[_0x5a32('0x2f')]['bind'](this));ami['on'](_0x5a32('0x30'),this['syncAgentComplete'][_0x5a32('0x2b')](this));ami['on'](_0x5a32('0x31'),this['syncQueueSummary'][_0x5a32('0x2b')](this));ami['on'](_0x5a32('0x32'),this['syncHangup'][_0x5a32('0x2b')](this));ami['on']('newexten',this[_0x5a32('0x33')]['bind'](this));ami['on'](_0x5a32('0x34'),this[_0x5a32('0x35')][_0x5a32('0x2b')](this));ami['on']('queuemember',this[_0x5a32('0x36')][_0x5a32('0x2b')](this));ami['on'](_0x5a32('0x37'),this[_0x5a32('0x38')][_0x5a32('0x2b')](this));this[_0x5a32('0x39')]();this['loopClearZombieChannels']();}function isNotNull(_0xa36600){return _0xa36600!==null&&!_[_0x5a32('0x3a')](_0xa36600);}function checkIsLoggedIn(_0x2da1d6,_0x5d47af){return function(){if(_0x5d47af<=0x0){_0x2da1d6[_0x5a32('0x3b')]=_0x5a32('0x3c');throw _0x2da1d6[_0x5a32('0x3d')]+_0x5a32('0x3e');}};}function isActive(_0x3f19d5){return _0x3f19d5;}function checkIsActive(_0x389cb6,_0xe0c66b){return function(){if(!isActive(_0xe0c66b)){_0x389cb6[_0x5a32('0x3b')]='NOT_ACTIVE';throw _0x389cb6[_0x5a32('0x3d')]+_0x5a32('0x3f');}};}function checkInterval(_0x2aa6d0){return function(){if(!isNotNull(_0x2aa6d0[_0x5a32('0x40')])){_0x2aa6d0[_0x5a32('0x3b')]=_0x5a32('0x41');throw _0x2aa6d0[_0x5a32('0x3d')]+_0x5a32('0x42');}if(!isNotNull(_0x2aa6d0[_0x5a32('0x40')][_0x5a32('0x43')])){_0x2aa6d0[_0x5a32('0x3b')]='INTERVAL_IS_NULL';throw _0x2aa6d0[_0x5a32('0x3d')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x5a32('0x44')](_0x2aa6d0[_0x5a32('0x40')]['Intervals']))){_0x2aa6d0[_0x5a32('0x3b')]=_0x5a32('0x41');throw _0x2aa6d0[_0x5a32('0x3d')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x30a552,_0x1563bf,_0x4c51ae){return{'action':_0x30a552,'response':_0x1563bf,'message':_0x4c51ae,'stack':_0x4c51ae};}function myreject(_0x557e2f){return function(_0x1e5932){return _0x557e2f(msgResponse(_0x5a32('0x45'),_0x5a32('0x46'),JSON[_0x5a32('0x47')](_0x1e5932)));};}function getSeconds(_0x2ab800,_0x45f58c){var _0x375506=moment(_0x2ab800)[_0x5a32('0x48')](0x0);var _0xc8e69d=moment(_0x45f58c)[_0x5a32('0x48')](0x0);return _0x375506[_0x5a32('0x49')](_0xc8e69d,_0x5a32('0x4a'));}function emit(_0x323554,_0x1ab02e,_0x49a50d){io['to'](_0x323554)[_0x5a32('0x4b')](_0x1ab02e,_0x49a50d);}function emitVoiceQueueSummary(_0x2cf59f){if(_0x2cf59f['type']===_0x5a32('0x4c')){var _0x5818a7={'id':_0x2cf59f['id'],'name':_0x2cf59f[_0x5a32('0x3d')],'strategy':_0x2cf59f['strategy'],'answered':_0x2cf59f[_0x5a32('0x4d')],'available':_0x2cf59f[_0x5a32('0x4e')],'loggedIn':_0x2cf59f[_0x5a32('0x4f')],'pTalking':_0x2cf59f[_0x5a32('0x50')],'sumBillable':_0x2cf59f['sumBillable'],'sumDuration':_0x2cf59f[_0x5a32('0x51')],'sumHoldTime':_0x2cf59f['sumHoldTime']||0x0,'talking':_0x2cf59f[_0x5a32('0x52')],'total':_0x2cf59f[_0x5a32('0x53')],'type':_0x2cf59f[_0x5a32('0x54')],'unmanaged':_0x2cf59f[_0x5a32('0x55')],'abandoned':_0x2cf59f[_0x5a32('0x56')],'waiting':_0x2cf59f[_0x5a32('0x57')],'loggedInDb':_0x2cf59f[_0x5a32('0x58')],'dialActive':_0x2cf59f['dialActive'],'dialMethod':_0x2cf59f[_0x5a32('0x59')],'dialOriginateCallerIdName':_0x2cf59f[_0x5a32('0x5a')],'dialOriginateCallerIdNumber':_0x2cf59f[_0x5a32('0x5b')],'dialOriginateTimeout':_0x2cf59f['dialOriginateTimeout'],'dialPrefix':_0x2cf59f[_0x5a32('0x5c')],'outboundAnswerAgiCallsDay':_0x2cf59f[_0x5a32('0x5d')],'outboundAnswerCallsDay':_0x2cf59f[_0x5a32('0x5e')],'outboundBlacklistCallsDay':_0x2cf59f[_0x5a32('0x5f')],'outboundBusyCallsDay':_0x2cf59f[_0x5a32('0x60')],'outboundCongestionCallsDay':_0x2cf59f[_0x5a32('0x61')],'outboundDropCallsDayACS':_0x2cf59f['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x2cf59f[_0x5a32('0x62')],'outboundDropCallsDayTimeout':_0x2cf59f[_0x5a32('0x63')],'outboundNoAnswerCallsDay':_0x2cf59f[_0x5a32('0x64')],'outboundNoSuchCallsDay':_0x2cf59f['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x2cf59f['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x2cf59f['outboundReCallsDay'],'outboundRejectCallsDay':_0x2cf59f[_0x5a32('0x65')],'outboundUnknownCallsDay':_0x2cf59f[_0x5a32('0x66')],'predictiveIntervalAnsweredCalls':_0x2cf59f[_0x5a32('0x67')],'predictiveIntervalAvgHoldtime':_0x2cf59f[_0x5a32('0x68')],'predictiveIntervalAvgTalktime':_0x2cf59f[_0x5a32('0x69')],'predictiveIntervalDroppedCallsCallersExit':_0x2cf59f[_0x5a32('0x6a')],'predictiveIntervalDroppedCallsTimeout':_0x2cf59f[_0x5a32('0x6b')],'predictiveIntervalErlangCalls':_0x2cf59f[_0x5a32('0x6c')],'predictiveIntervalErlangCallsDroppedCalls':_0x2cf59f['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x2cf59f[_0x5a32('0x6d')],'predictiveIntervalMultiplicativeFactor':_0x2cf59f[_0x5a32('0x6e')],'predictiveIntervalPauses':_0x2cf59f['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x2cf59f[_0x5a32('0x6f')],'predictiveIntervalTotalCalls':_0x2cf59f['predictiveIntervalTotalCalls'],'message':_0x2cf59f[_0x5a32('0x3b')],'originated':_0x2cf59f['originated'],'erlangCalls':_0x2cf59f[_0x5a32('0x70')],'erlangCallToSecond':_0x2cf59f[_0x5a32('0x71')],'erlangAbandonmentRate':_0x2cf59f[_0x5a32('0x72')],'erlangBusyFactor':_0x2cf59f['erlangBusyFactor'],'startPredictive':_0x2cf59f[_0x5a32('0x73')],'startProgressive':_0x2cf59f[_0x5a32('0x25')]};if(_0x2cf59f['Trunk']){_0x5818a7[_0x5a32('0x74')]={'id':_0x2cf59f['Trunk']['id'],'name':_0x2cf59f[_0x5a32('0x74')]['name'],'active':_0x2cf59f['Trunk'][_0x5a32('0x75')],'callerid':_0x2cf59f[_0x5a32('0x74')][_0x5a32('0x76')]};}if(_0x2cf59f['Interval']){_0x5818a7[_0x5a32('0x40')]={'id':_0x2cf59f[_0x5a32('0x40')]['id'],'name':_0x2cf59f[_0x5a32('0x40')][_0x5a32('0x3d')]};}var _0x1257b3=md5(JSON['stringify'](_0x5818a7));if(_0x2cf59f['md5']!==_0x1257b3){_0x2cf59f['md5']=_0x1257b3;emit(util[_0x5a32('0x77')](_0x5a32('0x78'),_0x5818a7[_0x5a32('0x3d')]),_0x5a32('0x79'),_0x5818a7);}}}function emitCampaignSummary(_0x35a38b){if(_0x35a38b[_0x5a32('0x54')]==='ivr'){emit(util[_0x5a32('0x77')](_0x5a32('0x7a'),_0x35a38b[_0x5a32('0x3d')]),_0x5a32('0x7b'),_0x35a38b);}}function checkGetDataPredictive(_0x353194){if(isNotNull(_0x353194)&&!_[_0x5a32('0x44')](_0x353194)){loggerPredictive[_0x5a32('0x7c')](_0x5a32('0x7d'));loggerPredictive[_0x5a32('0x7c')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x353194[_0x5a32('0x7e')]);loggerPredictive[_0x5a32('0x7c')](_0x5a32('0x7f'),_0x353194[_0x5a32('0x67')]);loggerPredictive[_0x5a32('0x7c')](_0x5a32('0x80'),_0x353194['predictiveIntervalDroppedCallsTimeout']);loggerPredictive['info'](_0x5a32('0x81'),_0x353194[_0x5a32('0x6a')]);loggerPredictive[_0x5a32('0x7c')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x353194[_0x5a32('0x68')]);loggerPredictive[_0x5a32('0x7c')](_0x5a32('0x82'),_0x353194[_0x5a32('0x69')]);loggerPredictive[_0x5a32('0x7c')](_0x5a32('0x83'));if(_0x353194['predictiveIntervalTotalCalls']>0x0){if(!_['isUndefined'](_0x353194[_0x5a32('0x69')])&&_0x353194[_0x5a32('0x69')]>0x0){return!![];}loggerPredictive[_0x5a32('0x7c')](_0x5a32('0x84'));if(!_['isUndefined'](_0x353194[_0x5a32('0x68')])&&_0x353194[_0x5a32('0x68')]>0x0){return!![];}loggerPredictive[_0x5a32('0x7c')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0x5a32('0x7c')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive['info'](_0x5a32('0x85'));}return![];}function mergeDataErlangB(_0x591104){return function(_0x2cf6e9){loggerPredictive[_0x5a32('0x7c')](_0x5a32('0x86'));loggerPredictive[_0x5a32('0x7c')](_0x5a32('0x87'),_0x2cf6e9[_0x5a32('0x70')]);loggerPredictive[_0x5a32('0x7c')](_0x5a32('0x88'),_0x2cf6e9[_0x5a32('0x71')]);loggerPredictive[_0x5a32('0x7c')](_0x5a32('0x89'),_0x2cf6e9['erlangAbandonmentRate']);loggerPredictive[_0x5a32('0x7c')](_0x5a32('0x8a'),_0x2cf6e9[_0x5a32('0x8b')]);loggerPredictive['info']('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2cf6e9[_0x5a32('0x72')]);loggerPredictive['info']('---------------------------');_[_0x5a32('0x8c')](_0x591104,_0x2cf6e9);};}function getDiff(_0x279416){var _0x378334=moment()[_0x5a32('0x48')](0x0);var _0xa53391=moment(_0x279416)[_0x5a32('0x48')](0x0);return _0x378334[_0x5a32('0x49')](_0xa53391,_0x5a32('0x4a'));}function ifInterval(_0x175de6,_0x4c5973){if(_[_0x5a32('0x3a')](_0x4c5973)){return![];}return getDiff(_0x4c5973)<_0x175de6*0x3c;}function freeVariablesPredictive(_0x3daf4b){if(isNotNull(_0x3daf4b)){if(!_[_0x5a32('0x3a')](_0x3daf4b[_0x5a32('0x25')])){_0x3daf4b[_0x5a32('0x25')]=undefined;loggerPredictive[_0x5a32('0x7c')](_0x3daf4b[_0x5a32('0x3d')],_0x5a32('0x8d'));}if(!_[_0x5a32('0x3a')](_0x3daf4b[_0x5a32('0x73')])){_0x3daf4b['startPredictive']=undefined;loggerPredictive['info'](_0x3daf4b[_0x5a32('0x3d')],'clearing\x20variable\x20start\x20predictive');}if(!_['isUndefined'](_0x3daf4b[_0x5a32('0x8e')])){clearInterval(_0x3daf4b[_0x5a32('0x8e')]);_0x3daf4b[_0x5a32('0x8e')]=undefined;loggerPredictive[_0x5a32('0x7c')](_0x3daf4b[_0x5a32('0x3d')],_0x5a32('0x8f'));}}}function erlangb(_0x4e0d1a,_0x202739){if(_0x202739===0x0){return 0x0;}var _0x2a1686=0x1;for(var _0x4638e2=0x1;_0x4638e2<=_0x202739;_0x4638e2+=0x1){_0x2a1686=0x1+_0x2a1686*_0x4638e2/_0x4e0d1a;}return 0x1/_0x2a1686;}function isVoiceQueueOutbound(_0x39125d){return _0x39125d===_0x5a32('0x4c');}function isNotPreview(_0x475e93){return _0x475e93!==_0x5a32('0x1c');}function isCampaignIvr(_0x3e8192){return _0x3e8192===_0x5a32('0x90');}function getCallerId(_0x1c5907,_0x27184b,_0x2be336){if(!_[_0x5a32('0x3a')](_0x2be336)&&typeof _0x2be336===_0x5a32('0x91')&&!_[_0x5a32('0x44')](_0x2be336)){if(!_['isUndefined'](_0x27184b)&&typeof _0x27184b===_0x5a32('0x91')&&!_[_0x5a32('0x44')](_0x27184b)){return util[_0x5a32('0x77')](_0x5a32('0x92'),_0x27184b,_0x2be336);}return util[_0x5a32('0x77')](_0x5a32('0x92'),_0x2be336,_0x2be336);}if(!_[_0x5a32('0x3a')](_0x1c5907)&&typeof _0x1c5907===_0x5a32('0x91')&&!_['isEmpty'](_0x1c5907)){return _0x1c5907;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x570b63,_0x305212){return function(_0x270bd4){freeVariablesPredictive(_0x305212);emitVoiceQueueSummary(_0x305212);emitCampaignSummary(_0x305212);loggerSyncQueueSummary[_0x5a32('0x93')](_0x570b63,util[_0x5a32('0x94')](_0x270bd4,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x4a6a5b,_0x2414d0){return function(_0x461817){loggerPredictive[_0x5a32('0x93')](_0x2414d0['name'],_0x4a6a5b);loggerPredictive[_0x5a32('0x93')](_0x461817['stack']);freeVariablesPredictive(_0x2414d0);};}function loggerCatch(_0x1d6e76){return function(_0x3cb9fb){logger[_0x5a32('0x93')](_0x1d6e76,util[_0x5a32('0x94')](_0x3cb9fb,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x553479){return _0x553479&&!_[_0x5a32('0x3a')](_0x553479)&&_0x553479['length']>0x0;}function decremetOriginate(_0x19dcb7){if(!_[_0x5a32('0x3a')](_0x19dcb7)&&_0x19dcb7!==null){if(typeof _0x19dcb7[_0x5a32('0x95')]!=='undefined'){if(_0x19dcb7[_0x5a32('0x95')]>0x0){_0x19dcb7[_0x5a32('0x95')]-=0x1;}else{logger[_0x5a32('0x93')](_0x5a32('0x96'));}}}else{logger[_0x5a32('0x93')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x5f35b8,_0x550545,_0xb14e51){if(_0x550545>_0xb14e51){for(var _0x33dd97=0x0;_0x33dd97<_0x550545-_0xb14e51;_0x33dd97+=0x1){decremetOriginate(_0x5f35b8);}}}function loggerGetContactDialer(_0x3e5300,_0x29828c,_0x1f025c){return function(_0x238d13){checkContactLowerLimitOriginate(_0x29828c,_0x1f025c,0x0);logger[_0x5a32('0x93')](_0x3e5300,util['inspect'](_0x238d13,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x6f59d6){return function(_0x521aaa){if(isNotNull(_0x521aaa)&&isNotNull(_0x521aaa[0x0])){if(_0x521aaa[0x0][_0x5a32('0x97')]>0x0){_0x6f59d6[_0x5a32('0x3b')]=_0x5a32('0x98');logger[_0x5a32('0x7c')](_0x5a32('0x99')+_0x6f59d6[_0x5a32('0x3d')],_0x521aaa[0x0][_0x5a32('0x97')],_0x5a32('0x9a'));}else{_0x6f59d6[_0x5a32('0x3b')]='AVAILABLE_CONTACTS_FINISHED';logger['info'](_0x5a32('0x9b')+_0x6f59d6['name']);}}};}function notSendMessagesQueue(_0x4745d7){if(_0x4745d7[_0x5a32('0x9c')]){freeVariablesPredictive(_0x4745d7);if(_0x4745d7[_0x5a32('0x95')]===0x0&&_0x4745d7[_0x5a32('0x52')]===0x0&&_0x4745d7[_0x5a32('0x57')]===0x0&&(_0x4745d7[_0x5a32('0x50')]||0x0)===0x0){_0x4745d7[_0x5a32('0x9c')]=![];_0x4745d7[_0x5a32('0x4e')]=0x0;_0x4745d7[_0x5a32('0x3b')]=_0x5a32('0x9d');loggerSyncQueueSummary[_0x5a32('0x93')](_0x5a32('0x9e'),_0x4745d7[_0x5a32('0x3d')],'is\x20not\x20active');}else{_0x4745d7[_0x5a32('0x3b')]=_0x5a32('0x9f');loggerSyncQueueSummary[_0x5a32('0x93')](_0x5a32('0x9e'),_0x4745d7[_0x5a32('0x3d')],_0x5a32('0xa0'));}emitVoiceQueueSummary(_0x4745d7);}}function notSendMessagesCampaign(_0x492273){if(_0x492273['sendMessageOneNotActive']){if(_0x492273[_0x5a32('0x95')]===0x0){_0x492273[_0x5a32('0x9c')]=![];_0x492273[_0x5a32('0x3b')]=_0x5a32('0x9d');loggerSyncQueueSummary[_0x5a32('0x93')](_0x5a32('0xa1'),_0x492273[_0x5a32('0x3d')],_0x5a32('0xa2'));}else{_0x492273[_0x5a32('0x3b')]=_0x5a32('0x9f');loggerSyncQueueSummary['error'](_0x5a32('0xa1'),_0x492273[_0x5a32('0x3d')],'is\x20disactive');}emitCampaignSummary(_0x492273);}}function createObjHistory(_0x57a04f,_0x3a673a,_0x4f5e89,_0x40bde4,_0x55129f){_0x57a04f[_0x5a32('0x3b')]=_0x4f5e89;var _0x588edd=new Action(_0x57a04f,_0x3a673a);var _0xab03e4=new History(_0x588edd);_0xab03e4['state']=_0x40bde4;_0xab03e4[_0x5a32('0xa3')]=_0x55129f;_0xab03e4['endtime']=_0x588edd[_0x5a32('0xa4')];return _0xab03e4;}Dialer[_0x5a32('0x19')][_0x5a32('0xa5')]=function(){var _0x58f699=this;setInterval(function(){_0x58f699[_0x5a32('0xa6')](_0x58f699[_0x5a32('0x23')],_0x5a32('0xa7'));_0x58f699['clearZombieChannels'](_0x58f699['actions'],_0x5a32('0xa8'));},0x32c8);};Dialer[_0x5a32('0x19')][_0x5a32('0xa6')]=function(_0x1d82c4,_0x2fc557){var _0x3347c0=this;for(var _0xe739b3 in _0x1d82c4){if(typeof _0x1d82c4[_0xe739b3]!==_0x5a32('0xa9')){this[_0x5a32('0xaa')][_0x5a32('0x1a')](function(){if(!_[_0x5a32('0xab')](_0x1d82c4[_0xe739b3])){return ami[_0x5a32('0xac')]({'action':'status','channel':_0x1d82c4[_0xe739b3][_0x5a32('0xad')]})[_0x5a32('0xae')](function(_0x303ada){if(_0x303ada[_0x5a32('0x3b')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x1d82c4[_0xe739b3]&&_0x1d82c4[_0xe739b3][_0x5a32('0x54')]!==_0x5a32('0x90')){_0x3347c0['updateOriginated'](_0x3347c0[_0x5a32('0xaf')][_0x1d82c4[_0xe739b3][_0x5a32('0xb0')]]);logger['error'](_0x5a32('0xb1'),_0x2fc557,_0xe739b3,_0x1d82c4[_0xe739b3][_0x5a32('0xb0')]);delete _0x1d82c4[_0xe739b3];}if(_0x1d82c4[_0xe739b3]&&_0x1d82c4[_0xe739b3][_0x5a32('0x54')]===_0x5a32('0x90')){_0x3347c0['updateOriginated'](_0x3347c0['campaigns'][_0x1d82c4[_0xe739b3][_0x5a32('0xb0')]]);logger[_0x5a32('0x93')](_0x5a32('0xb2'),_0x2fc557,_0xe739b3,_0x1d82c4[_0xe739b3][_0x5a32('0xb0')]);delete _0x1d82c4[_0xe739b3];}},0x2328);}});}});}}};Dialer[_0x5a32('0x19')][_0x5a32('0xb3')]=function(_0x4cb56f){return BPromise[_0x5a32('0xb4')]()[_0x5a32('0xb5')](cmHopper[_0x5a32('0xb3')](_0x4cb56f))[_0x5a32('0xae')](loggerCatch('[countReScheduled]\x20'));};Dialer[_0x5a32('0x19')][_0x5a32('0xb6')]=function(_0x211467){return BPromise['resolve']()[_0x5a32('0xb5')](cmHopperBlack['checkIsBlackList'](_0x211467))[_0x5a32('0xae')](loggerCatch(_0x5a32('0xb7')));};Dialer[_0x5a32('0x19')]['checkIsBlackListIvr']=function(_0x618d1d){return BPromise['resolve']()[_0x5a32('0xb5')](cmHopperBlack[_0x5a32('0xb8')](_0x618d1d))['catch'](loggerCatch(_0x5a32('0xb9')));};Dialer[_0x5a32('0x19')]['averageHandleTime']=function(_0x48ddb2){return BPromise[_0x5a32('0xb4')]()[_0x5a32('0xb5')](cmHopperHistory[_0x5a32('0xba')](_0x48ddb2))[_0x5a32('0xae')](loggerCatch(_0x5a32('0xbb')));};Dialer['prototype'][_0x5a32('0xbc')]=function(_0x4e8949){return BPromise[_0x5a32('0xb4')]()['then'](cmHopper[_0x5a32('0xbc')](_0x4e8949))[_0x5a32('0xae')](loggerCatch('[rescheduleContact]\x20'));};Dialer[_0x5a32('0x19')]['unlockContact']=function(_0xe21a97,_0x3e5010,_0x24c9ea){return BPromise[_0x5a32('0xb4')]()[_0x5a32('0xb5')](cmHopper[_0x5a32('0xbd')](_0xe21a97,_0x3e5010,_0x24c9ea))[_0x5a32('0xae')](loggerCatch(_0x5a32('0xbe')));};Dialer[_0x5a32('0x19')]['getContactDialer']=function(_0x33aaa0,_0x3f224c,_0xfda771,_0x2f6267,_0xf2ed3){return BPromise['resolve']()[_0x5a32('0xb5')](cmHopper[_0x5a32('0xbf')](_0x33aaa0,_0x3f224c,_0xfda771,_0x2f6267))[_0x5a32('0xae')](function(_0x192129){_0xf2ed3['temp']-=_0xfda771;_0xf2ed3[_0x5a32('0xc0')]=_0xf2ed3['temp']>0x0?_0xf2ed3[_0x5a32('0xc0')]:0x0;loggerCatch('[getContactDialer]\x20')(_0x192129);});};Dialer[_0x5a32('0x19')][_0x5a32('0xc1')]=function(_0x47101f,_0x70d1f,_0x3306e5,_0x4de6cf){return BPromise[_0x5a32('0xb4')]()[_0x5a32('0xb5')](cmHopper[_0x5a32('0xc1')](_0x47101f,_0x70d1f,_0x3306e5))[_0x5a32('0xae')](function(_0x512e16){_0x4de6cf[_0x5a32('0xc0')]-=_0x70d1f;_0x4de6cf[_0x5a32('0xc0')]=_0x4de6cf['temp']>0x0?_0x4de6cf[_0x5a32('0xc0')]:0x0;loggerCatch(_0x5a32('0xc2'))(_0x512e16);});};Dialer[_0x5a32('0x19')]['getVoiceQueueRtPauses']=function(_0x44f8a4){return BPromise[_0x5a32('0xb4')]()[_0x5a32('0xb5')](voiceQueueRt[_0x5a32('0xc3')](_0x44f8a4))[_0x5a32('0xae')](loggerCatch(_0x5a32('0xc4')));};Dialer[_0x5a32('0x19')][_0x5a32('0xc5')]=function(_0x54122c){return BPromise[_0x5a32('0xb4')]()[_0x5a32('0xb5')](cmHopper[_0x5a32('0xc5')](_0x54122c))['catch'](loggerCatch(_0x5a32('0xc6')));};Dialer[_0x5a32('0x19')][_0x5a32('0xc7')]=function(_0x5b5d2c){return BPromise[_0x5a32('0xb4')]()[_0x5a32('0xb5')](cmHopperHistory['createHistory'](_0x5b5d2c))[_0x5a32('0xae')](loggerCatch('[createHistory]\x20'));};Dialer[_0x5a32('0x19')][_0x5a32('0xc8')]=function(_0x3ca367){if(!_[_0x5a32('0x3a')](_0x3ca367)&&_0x3ca367!==null){if(typeof _0x3ca367['originated']!==_0x5a32('0xa9')){if(_0x3ca367[_0x5a32('0x95')]>0x0){_0x3ca367['originated']-=0x1;}else{logger[_0x5a32('0x93')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger['error'](_0x5a32('0xc9'));}};Dialer['prototype'][_0x5a32('0xca')]=function(_0x1b3736,_0x2fb2fc){var _0x272ac0=this;return function(_0x1d8eb9){_0x272ac0[_0x5a32('0xc8')](_0x2fb2fc);logger[_0x5a32('0x93')](_0x1b3736,util[_0x5a32('0x94')](_0x1d8eb9,{'showHidden':![],'depth':null}));};};Dialer[_0x5a32('0x19')][_0x5a32('0xcb')]=function(_0x3e9b74,_0x104dc5,_0x282554){var _0x14ec7c={'state':0x19,'statedesc':'notFound'};this[_0x5a32('0xc8')](_0x104dc5);this[_0x5a32('0xcc')](_[_0x5a32('0x8c')](_0x14ec7c,_[_0x5a32('0xcd')](_0x282554,['ContactId',_0x5a32('0xce'),_0x5a32('0xcf'),_0x5a32('0xd0'),_0x5a32('0xd1')])),_0x5a32('0xd2'),_0x5a32('0xd3'));logger[_0x5a32('0x93')](_0x3e9b74);};Dialer['prototype']['isSuccess']=function(_0x1123ea){return _0x1123ea===_0x5a32('0xd4');};Dialer[_0x5a32('0x19')][_0x5a32('0xd5')]=function(_0x22604e){return!_['isUndefined'](_0x22604e)&&_0x22604e&&!_[_0x5a32('0x3a')](_0x22604e[_0x5a32('0x3d')])&&!_[_0x5a32('0x3a')](_0x22604e['active'])&&_0x22604e[_0x5a32('0x75')]&&(this[_0x5a32('0x1e')][util[_0x5a32('0x77')]('SIP/%s',_0x22604e[_0x5a32('0x3d')])][_0x5a32('0xd6')]===_0x5a32('0xd7')||this['trunks'][util[_0x5a32('0x77')](_0x5a32('0xd8'),_0x22604e['name'])][_0x5a32('0xd6')]===_0x5a32('0xd9'));};Dialer[_0x5a32('0x19')][_0x5a32('0xcc')]=function(_0x10718b,_0x1215b2,_0x28771a){this['createHistory'](_0x10718b)[_0x5a32('0xae')](loggerCatch(_0x1215b2));this[_0x5a32('0xc5')](_0x10718b)[_0x5a32('0xae')](loggerCatch(_0x28771a));};Dialer['prototype'][_0x5a32('0x35')]=function(_0x32b75f){var _0x169827=this[_0x5a32('0x23')][_0x32b75f['uniqueid']];var _0x44b1c8;if(!_['isNil'](_0x32b75f)&&!_['isNil'](_0x32b75f[_0x5a32('0xda')])&&!_[_0x5a32('0xab')](_0x32b75f[_0x5a32('0xda')][_0x5a32('0xdb')])&&_0x32b75f[_0x5a32('0xdc')]===_0x5a32('0xdd')&&_0x169827){if(_0x169827[_0x5a32('0x54')]!==_0x5a32('0x90')&&this['voiceQueues'][_0x169827[_0x5a32('0xb0')]][_0x5a32('0xde')]&&_0x32b75f[_0x5a32('0xdf')]===_0x5a32('0xe0')){delete this[_0x5a32('0x23')][_0x32b75f['uniqueid']];this[_0x5a32('0xc8')](this[_0x5a32('0xaf')][_0x169827[_0x5a32('0xb0')]]);this[_0x5a32('0xaf')][_0x169827[_0x5a32('0xb0')]][_0x5a32('0x5e')]+=0x1;this['voiceQueues'][_0x169827[_0x5a32('0xb0')]][_0x5a32('0x5d')]+=0x1;_0x44b1c8=new Hangup(_0x169827,_0x32b75f);_0x44b1c8['state']=0x12;_0x44b1c8[_0x5a32('0xa3')]=_0x5a32('0xe1');_0x44b1c8[_0x5a32('0xe2')]=_0x5a32('0xe3');ami['emit'](_0x5a32('0xe4'),ut['buildObj'](_0x44b1c8,_0x5a32('0xe5')));this['saveInDb'](_0x44b1c8,_0x5a32('0xe6'),_0x5a32('0xe7'));}if(_0x169827[_0x5a32('0x54')]!==_0x5a32('0x90')&&this['voiceQueues'][_0x169827[_0x5a32('0xb0')]][_0x5a32('0xde')]&&_0x32b75f[_0x5a32('0xdf')]===_0x5a32('0xe8')){var _0x1b56c0=this;return new BPromise(function(_0x5b446e,_0x2d6d8d){delete _0x1b56c0[_0x5a32('0x23')][_0x32b75f['uniqueid']];_0x1b56c0[_0x5a32('0xc8')](_0x1b56c0[_0x5a32('0xaf')][_0x169827[_0x5a32('0xb0')]]);_0x1b56c0[_0x5a32('0xaf')][_0x169827[_0x5a32('0xb0')]][_0x5a32('0x5e')]+=0x1;_0x1b56c0[_0x5a32('0xaf')][_0x169827[_0x5a32('0xb0')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x3a8fdc=_0x1b56c0[_0x5a32('0xaf')][_0x169827['queue']];var _0x9c56aa=new Hangup(_0x169827,_0x32b75f);_0x9c56aa[_0x5a32('0xe9')]=0x13;_0x9c56aa[_0x5a32('0xa3')]=_0x5a32('0xea');_0x9c56aa['membername']=_0x5a32('0xe3');_0x9c56aa[_0x5a32('0xeb')]+=0x1;_0x9c56aa[_0x5a32('0xec')]+=0x1;_0x9c56aa['amd']=!![];ami[_0x5a32('0x4b')]('custom:amd',ut[_0x5a32('0xed')](_0x9c56aa,_0x5a32('0xe5')));_0x1b56c0[_0x5a32('0xc7')](_0x9c56aa)[_0x5a32('0xae')](loggerCatch(_0x5a32('0xee')));if(_0x9c56aa['countbusyretry']+_0x9c56aa['countcongestionretry']+_0x9c56aa[_0x5a32('0xef')]+_0x9c56aa[_0x5a32('0xf0')]+_0x9c56aa[_0x5a32('0xf1')]+_0x9c56aa[_0x5a32('0xf2')]+_0x9c56aa[_0x5a32('0xeb')]+_0x9c56aa['countagentrejectretry']>=_0x3a8fdc[_0x5a32('0xf3')]){_0x1b56c0['stateGlobal'](_0x9c56aa,_0x5b446e,_0x2d6d8d,_0x5a32('0xf4'));}else{if(_0x9c56aa[_0x5a32('0xeb')]>=_0x3a8fdc[_0x5a32('0xf5')]){_0x1b56c0[_0x5a32('0xf6')](_0x9c56aa,_0x5b446e,_0x2d6d8d,_0x5a32('0xf7'));}else{_0x1b56c0[_0x5a32('0xbc')]({'active':![],'countmachineretry':_0x9c56aa[_0x5a32('0xeb')],'scheduledat':moment()[_0x5a32('0xf8')](_0x3a8fdc[_0x5a32('0xf9')],'minutes')[_0x5a32('0x77')](_0x5a32('0xfa')),'ContactId':_0x9c56aa['ContactId'],'ListId':_0x9c56aa[_0x5a32('0xce')],'VoiceQueueId':_0x9c56aa[_0x5a32('0xd0')]||undefined,'CampaignId':_0x9c56aa[_0x5a32('0xd1')]||undefined})[_0x5a32('0xae')](loggerCatch('[rescheduleContact][Machine]'));_0x5b446e({'reschedule':0x1});}}});}if(_0x169827[_0x5a32('0x54')]===_0x5a32('0x90')&&this[_0x5a32('0x1d')][_0x169827[_0x5a32('0xb0')]]['dialAMDActive']&&_0x32b75f[_0x5a32('0xdf')]===_0x5a32('0xe0')){delete this[_0x5a32('0x23')][_0x32b75f['uniqueid']];this[_0x5a32('0xc8')](this[_0x5a32('0x1d')][_0x169827['queue']]);_0x44b1c8=new Hangup(_0x169827,_0x32b75f);_0x44b1c8[_0x5a32('0xe9')]=0x12;_0x44b1c8['statedesc']=_0x5a32('0xe1');_0x44b1c8['membername']='AMD';ami['emit'](_0x5a32('0xe4'),ut[_0x5a32('0xed')](_0x44b1c8,_0x5a32('0xe5')));this[_0x5a32('0xcc')](_0x44b1c8,_0x5a32('0xfb'),_0x5a32('0xfc'));}if(_0x169827[_0x5a32('0x54')]===_0x5a32('0x90')&&this[_0x5a32('0x1d')][_0x169827[_0x5a32('0xb0')]][_0x5a32('0xde')]&&_0x32b75f[_0x5a32('0xdf')]===_0x5a32('0xe8')){var _0x1b56c0=this;return new BPromise(function(_0x149946,_0x2b39b6){delete _0x1b56c0[_0x5a32('0x23')][_0x32b75f[_0x5a32('0xfd')]];_0x1b56c0['updateOriginated'](_0x1b56c0[_0x5a32('0x1d')][_0x169827['queue']]);_0x1b56c0[_0x5a32('0x1d')][_0x169827[_0x5a32('0xb0')]][_0x5a32('0x5e')]+=0x1;_0x1b56c0['campaigns'][_0x169827['queue']][_0x5a32('0x5d')]+=0x1;var _0x4399a6=_0x1b56c0['campaigns'][_0x169827[_0x5a32('0xb0')]];var _0x310ef0=new Hangup(_0x169827,_0x32b75f);_0x310ef0[_0x5a32('0xe9')]=0x13;_0x310ef0[_0x5a32('0xa3')]='Machine';_0x310ef0['membername']=_0x5a32('0xe3');_0x310ef0[_0x5a32('0xeb')]+=0x1;_0x310ef0[_0x5a32('0xec')]+=0x1;_0x310ef0['amd']=!![];ami[_0x5a32('0x4b')](_0x5a32('0xe4'),ut[_0x5a32('0xed')](_0x310ef0,_0x5a32('0xe5')));_0x1b56c0[_0x5a32('0xc7')](_0x310ef0)[_0x5a32('0xae')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x310ef0[_0x5a32('0xfe')]+_0x310ef0['countcongestionretry']+_0x310ef0[_0x5a32('0xef')]+_0x310ef0[_0x5a32('0xf0')]+_0x310ef0['countdropretry']+_0x310ef0['countabandonedretry']+_0x310ef0[_0x5a32('0xeb')]+_0x310ef0[_0x5a32('0xff')]>=_0x4399a6[_0x5a32('0xf3')]){_0x1b56c0['stateGlobal'](_0x310ef0,_0x149946,_0x2b39b6,'reason19\x20machine....');}else{if(_0x310ef0[_0x5a32('0xeb')]>=_0x4399a6['dialMachineMaxRetry']){_0x1b56c0[_0x5a32('0xf6')](_0x310ef0,_0x149946,_0x2b39b6,_0x5a32('0xf7'));}else{_0x1b56c0['rescheduleContact']({'active':![],'countmachineretry':_0x310ef0[_0x5a32('0xeb')],'scheduledat':moment()['add'](_0x4399a6[_0x5a32('0xf9')],'minutes')[_0x5a32('0x77')](_0x5a32('0xfa')),'ContactId':_0x310ef0[_0x5a32('0x100')],'ListId':_0x310ef0[_0x5a32('0xce')],'VoiceQueueId':_0x310ef0[_0x5a32('0xd0')]||undefined,'CampaignId':_0x310ef0[_0x5a32('0xd1')]||undefined})[_0x5a32('0xae')](loggerCatch('[rescheduleContact][Machine]'));_0x149946({'reschedule':0x1});}}});}}};Dialer[_0x5a32('0x19')][_0x5a32('0x101')]=function(_0xf996a1){var _0x28b746=this[_0x5a32('0x23')][_0xf996a1[_0x5a32('0xfd')]];var _0x15ce17=this;var _0x833ae0;if(_0x28b746&&_0x28b746[_0x5a32('0x54')]===_0x5a32('0x90')){delete this['uniqueId'][_0xf996a1['uniqueid']];this[_0x5a32('0xc8')](this['campaigns'][_0x28b746[_0x5a32('0xb0')]]);this[_0x5a32('0x1d')][_0x28b746[_0x5a32('0xb0')]][_0x5a32('0x102')]+=0x1;_0x833ae0=new Hangup(_0x28b746,_0xf996a1);this[_0x5a32('0xc7')](_0x833ae0)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));this['moveContactManagedDialer'](_0x833ae0)[_0x5a32('0xae')](loggerCatch(_0x5a32('0x103')));}if(_0x28b746&&_0x28b746[_0x5a32('0x54')]!==_0x5a32('0x90')&&isNotNull(this[_0x5a32('0xaf')][_0x28b746[_0x5a32('0xb0')]]['dialQueueProject'])){delete this['uniqueId'][_0xf996a1[_0x5a32('0xfd')]];this[_0x5a32('0xc8')](this[_0x5a32('0xaf')][_0x28b746[_0x5a32('0xb0')]]);this[_0x5a32('0xaf')][_0x28b746[_0x5a32('0xb0')]]['outboundAnswerCallsDay']+=0x1;this[_0x5a32('0xaf')][_0x28b746[_0x5a32('0xb0')]][_0x5a32('0x5d')]+=0x1;_0x833ae0=new Hangup(_0x28b746,_0xf996a1);_0x833ae0[_0x5a32('0xe9')]=0x10;_0x833ae0[_0x5a32('0xa3')]=_0x5a32('0x104');_0x833ae0[_0x5a32('0xe2')]=_0x5a32('0x105');this[_0x5a32('0xc7')](_0x833ae0)['catch'](loggerCatch(_0x5a32('0x106')));this[_0x5a32('0xc5')](_0x833ae0)['catch'](loggerCatch(_0x5a32('0x103')));}if(_0x28b746&&_0x28b746[_0x5a32('0x54')]!=='ivr'&&!isNotNull(this[_0x5a32('0xaf')][_0x28b746['queue']][_0x5a32('0x107')])){delete this[_0x5a32('0x23')][_0xf996a1[_0x5a32('0xfd')]];this[_0x5a32('0xc8')](this[_0x5a32('0xaf')][_0x28b746['queue']]);this['voiceQueues'][_0x28b746[_0x5a32('0xb0')]][_0x5a32('0x66')]+=0x1;_0x833ae0=new Hangup(_0x28b746,_0xf996a1);_0x833ae0['state']=0xc;_0x833ae0['statedesc']=_0xf996a1['cause-txt'];_0x833ae0['membername']=_0x5a32('0x108');this[_0x5a32('0xc7')](_0x833ae0)['catch'](loggerCatch(_0x5a32('0x106')));this['moveContactManagedDialer'](_0x833ae0)[_0x5a32('0xae')](loggerCatch(_0x5a32('0x103')));}};Dialer['prototype'][_0x5a32('0x109')]=function(_0x280947){var _0x1bd866=this[_0x5a32('0x23')][_0x280947['uniqueid']];var _0x3824a6=this;if(this['voiceQueues'][_0x280947['queue']]){if(_0x1bd866&&_0x1bd866[_0x5a32('0x54')]!==_0x5a32('0x90')){delete this[_0x5a32('0x23')][_0x280947[_0x5a32('0xfd')]];this['voiceQueues'][_0x280947[_0x5a32('0xb0')]]['outboundAnswerCallsDay']+=0x1;var _0x4eae6b=new AgentComplete(_0x1bd866,_0x280947);if(_0x280947[_0x5a32('0x10a')]===_0x5a32('0x10b')){_0x4eae6b[_0x5a32('0x10c')]=this[_0x5a32('0xaf')][_0x280947[_0x5a32('0xb0')]]['dialQueueProject2']&&this[_0x5a32('0xaf')][_0x280947[_0x5a32('0xb0')]][_0x5a32('0x10d')]?moment()['format'](_0x5a32('0xfa')):undefined;}this[_0x5a32('0xc7')](_0x4eae6b)[_0x5a32('0xae')](loggerCatch(_0x5a32('0x10e')));this[_0x5a32('0xc5')](_0x4eae6b)[_0x5a32('0xae')](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0x5a32('0x19')][_0x5a32('0x2a')]=function(_0x41537b){if(this['voiceQueues'][_0x41537b[_0x5a32('0xb0')]]){if(this['uniqueId'][_0x41537b[_0x5a32('0xfd')]]&&this[_0x5a32('0x23')][_0x41537b['uniqueid']][_0x5a32('0x54')]!==_0x5a32('0x90')){this[_0x5a32('0xc8')](this[_0x5a32('0xaf')][_0x41537b[_0x5a32('0xb0')]]);this[_0x5a32('0x23')][_0x41537b[_0x5a32('0xfd')]][_0x5a32('0x10f')]=moment()['format'](_0x5a32('0xfa'));}}};Dialer['prototype']['queueCallerAbandonCreateState']=function(_0x1d9f78){this['createHistory'](_0x1d9f78)[_0x5a32('0xae')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x5a32('0xc5')](_0x1d9f78)[_0x5a32('0xae')](loggerCatch(_0x5a32('0x110')));};Dialer[_0x5a32('0x19')][_0x5a32('0x2d')]=function(_0x3fe7fe){var _0x388804=this[_0x5a32('0x23')][_0x3fe7fe['uniqueid']];var _0x3520eb=this;if(this[_0x5a32('0xaf')][_0x3fe7fe[_0x5a32('0xb0')]]){if(_0x388804&&_0x388804[_0x5a32('0x54')]!==_0x5a32('0x90')){delete this['uniqueId'][_0x3fe7fe[_0x5a32('0xfd')]];this['updateOriginated'](this['voiceQueues'][_0x3fe7fe[_0x5a32('0xb0')]]);_0x388804['droptime']=moment()[_0x5a32('0x77')](_0x5a32('0xfa'));var _0x37dcd9=new QueueCallerAbandon(_0x388804,_0x3fe7fe);if(getSeconds(_0x388804[_0x5a32('0x111')],_0x388804[_0x5a32('0x112')])>=_0x388804[_0x5a32('0x113')]){this[_0x5a32('0xaf')][_0x3fe7fe[_0x5a32('0xb0')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0x5a32('0xaf')][_0x3fe7fe[_0x5a32('0xb0')]]['outboundDropCallsDayTimeout']+=0x1;this['voiceQueues'][_0x3fe7fe[_0x5a32('0xb0')]][_0x5a32('0x114')]+=0x1;_0x37dcd9[_0x5a32('0xe9')]=0xa;_0x37dcd9['statedesc']=_0x5a32('0x115');_0x37dcd9[_0x5a32('0x116')]='TIMEOUT';_0x37dcd9[_0x5a32('0x10c')]=this['voiceQueues'][_0x3fe7fe[_0x5a32('0xb0')]][_0x5a32('0x117')]?moment()[_0x5a32('0x77')](_0x5a32('0xfa')):undefined;_0x37dcd9['countdropretry']+=0x1;_0x37dcd9[_0x5a32('0xec')]+=0x1;if(_0x37dcd9['countdropretry']>=this['voiceQueues'][_0x3fe7fe['queue']]['dialDropMaxRetry']){this[_0x5a32('0x118')](_0x37dcd9);}else{this[_0x5a32('0xbc')]({'active':![],'countdropretry':_0x37dcd9['countdropretry'],'scheduledat':moment()[_0x5a32('0xf8')](this[_0x5a32('0xaf')][_0x3fe7fe['queue']][_0x5a32('0x119')],'minutes')[_0x5a32('0x77')](_0x5a32('0xfa')),'ContactId':_0x388804[_0x5a32('0x100')],'ListId':_0x388804['ListId'],'VoiceQueueId':_0x388804['VoiceQueueId']||undefined,'CampaignId':_0x388804[_0x5a32('0xd1')]||undefined})[_0x5a32('0xae')](loggerCatch('[rescheduleContact][Drop]'));var _0x4e07ba=new History(_0x37dcd9);_0x4e07ba['state']=0xa;_0x4e07ba[_0x5a32('0xa3')]=_0x5a32('0x115');_0x4e07ba[_0x5a32('0xa4')]=moment()['format'](_0x5a32('0xfa'));_0x4e07ba[_0x5a32('0x11a')]=_0x4e07ba[_0x5a32('0xa4')];_0x4e07ba[_0x5a32('0x11b')]=_0x37dcd9['calleridname'];_0x4e07ba[_0x5a32('0x11c')]=_0x37dcd9[_0x5a32('0x11c')];this[_0x5a32('0xc7')](_0x4e07ba)['catch'](loggerCatch(_0x5a32('0x11d')));}}else{this[_0x5a32('0xaf')][_0x3fe7fe[_0x5a32('0xb0')]][_0x5a32('0x6a')]+=0x1;this['voiceQueues'][_0x3fe7fe[_0x5a32('0xb0')]][_0x5a32('0x62')]+=0x1;_0x37dcd9[_0x5a32('0xe9')]=0xb;_0x37dcd9[_0x5a32('0xa3')]=_0x5a32('0x11e');_0x37dcd9[_0x5a32('0x116')]=_0x5a32('0x11f');_0x37dcd9[_0x5a32('0xf2')]+=0x1;_0x37dcd9['countglobal']+=0x1;if(_0x37dcd9[_0x5a32('0xf2')]>=this[_0x5a32('0xaf')][_0x3fe7fe[_0x5a32('0xb0')]][_0x5a32('0x120')]){this[_0x5a32('0x118')](_0x37dcd9);}else{this[_0x5a32('0xbc')]({'active':![],'countabandonedretry':_0x37dcd9[_0x5a32('0xf2')],'scheduledat':moment()[_0x5a32('0xf8')](this[_0x5a32('0xaf')][_0x3fe7fe[_0x5a32('0xb0')]]['dialAbandonedRetryFrequency'],'minutes')[_0x5a32('0x77')](_0x5a32('0xfa')),'ContactId':_0x388804[_0x5a32('0x100')],'ListId':_0x388804['ListId'],'VoiceQueueId':_0x388804[_0x5a32('0xd0')]||undefined,'CampaignId':_0x388804[_0x5a32('0xd1')]||undefined})[_0x5a32('0xae')](loggerCatch(_0x5a32('0x121')));var _0x4e07ba=new History(_0x37dcd9);_0x4e07ba['state']=0xb;_0x4e07ba['statedesc']=_0x5a32('0x11e');_0x4e07ba[_0x5a32('0xa4')]=moment()[_0x5a32('0x77')](_0x5a32('0xfa'));_0x4e07ba[_0x5a32('0x11a')]=_0x4e07ba['starttime'];_0x4e07ba['calleridname']=_0x37dcd9[_0x5a32('0x11b')];_0x4e07ba['calleridnum']=_0x37dcd9[_0x5a32('0x11c')];this[_0x5a32('0xc7')](_0x4e07ba)[_0x5a32('0xae')](loggerCatch(_0x5a32('0x122')));}}}}};Dialer[_0x5a32('0x19')]['syncNewExten']=function(_0x1d7bcf){if(this[_0x5a32('0x21')][_0x1d7bcf[_0x5a32('0xfd')]]){this['actions'][_0x1d7bcf['uniqueid']]['channel']=_0x1d7bcf[_0x5a32('0xad')];}if(this[_0x5a32('0x23')][_0x1d7bcf[_0x5a32('0xfd')]]){this['uniqueId'][_0x1d7bcf[_0x5a32('0xfd')]]['channel']=_0x1d7bcf[_0x5a32('0xad')];}};Dialer['prototype'][_0x5a32('0x36')]=function(_0x27db0c){if(strategy[this[_0x5a32('0xaf')][this[_0x5a32('0x21')][_0x27db0c['actionid']][_0x5a32('0xb0')]][_0x5a32('0x123')]]===_0x5a32('0x124')){if(this[_0x5a32('0x21')][_0x27db0c[_0x5a32('0x125')]]&&_[_0x5a32('0xab')](this[_0x5a32('0x21')][_0x27db0c[_0x5a32('0x125')]]['locked'])&&_0x27db0c[_0x5a32('0xd6')]==='1'&&_0x27db0c[_0x5a32('0x126')]==='0'){if(this['agents'][_0x27db0c['stateinterface']]){if(!this[_0x5a32('0x127')][_0x27db0c[_0x5a32('0x128')]]['locked']){this[_0x5a32('0x127')][_0x27db0c[_0x5a32('0x128')]][_0x5a32('0x129')]=!![];this[_0x5a32('0x21')][_0x27db0c[_0x5a32('0x125')]]['locked']=!![];this['actions'][_0x27db0c['actionid']]['stateinterface']=_0x27db0c[_0x5a32('0x128')];}}}}else if((strategy[this[_0x5a32('0xaf')][this['actions'][_0x27db0c[_0x5a32('0x125')]][_0x5a32('0xb0')]][_0x5a32('0x123')]]||'rrmemory')===_0x5a32('0x18')){if(this[_0x5a32('0x21')][_0x27db0c[_0x5a32('0x125')]]){if(this[_0x5a32('0x127')][_0x27db0c[_0x5a32('0x128')]]){this['actions'][_0x27db0c[_0x5a32('0x125')]][_0x5a32('0x128')]=_0x27db0c[_0x5a32('0x128')];if(_[_0x5a32('0xab')](this['queueBooked'][this[_0x5a32('0x21')][_0x27db0c['actionid']][_0x5a32('0xb0')]])){this[_0x5a32('0x27')][this['actions'][_0x27db0c[_0x5a32('0x125')]]['queue']]=[];}this[_0x5a32('0x27')][this[_0x5a32('0x21')][_0x27db0c[_0x5a32('0x125')]]['queue']][_0x5a32('0x12a')](_[_0x5a32('0x8c')](_[_0x5a32('0xcd')](this[_0x5a32('0x21')][_0x27db0c[_0x5a32('0x125')]],[_0x5a32('0x12b'),_0x5a32('0x128')]),{'status':_0x27db0c['status'],'paused':_0x27db0c[_0x5a32('0x126')]}));}}}};function unlockQueueStatus(_0x37df34,_0x4578ad){setTimeout(function(){if(_[_0x5a32('0x3a')](_0x37df34['queueStatusComplete'])){loggerBooked[_0x5a32('0x93')](_0x5a32('0x12c'),_0x4578ad);}_0x37df34[_0x5a32('0x12d')]=!![];loggerBooked[_0x5a32('0x7c')](_0x5a32('0x12e'),_0x4578ad,JSON[_0x5a32('0x47')](_['pick'](_0x37df34,[_0x5a32('0x3d'),_0x5a32('0x12d')])));},0x1f3);}Dialer[_0x5a32('0x19')][_0x5a32('0x38')]=function(_0x44649f){var _0x2fa4a5=this;var _0x467085=_0x2fa4a5['voiceQueues'][_0x2fa4a5[_0x5a32('0x21')][_0x44649f['actionid']]['queue']];if(strategy[this[_0x5a32('0xaf')][this[_0x5a32('0x21')][_0x44649f[_0x5a32('0x125')]][_0x5a32('0xb0')]]['strategy']]==='roundrobin'){if(this['actions'][_0x44649f[_0x5a32('0x125')]]&&this[_0x5a32('0x21')][_0x44649f[_0x5a32('0x125')]]['stateinterface']){this[_0x5a32('0x1c')][_0x5a32('0x12f')](this[_0x5a32('0x21')][_0x44649f[_0x5a32('0x125')]][_0x5a32('0x12b')],this[_0x5a32('0x21')][_0x44649f['actionid']][_0x5a32('0x128')])[_0x5a32('0xae')](function(_0x4182f7){logger[_0x5a32('0x93')](_0x5a32('0x130'),util[_0x5a32('0x94')](_0x4182f7,{'showHidden':![],'depth':null}));})[_0x5a32('0x131')](function(){_0x2fa4a5[_0x5a32('0xc8')](_0x2fa4a5[_0x5a32('0xaf')][_0x2fa4a5[_0x5a32('0x21')][_0x44649f['actionid']][_0x5a32('0xb0')]]);_0x2fa4a5[_0x5a32('0x127')][_0x2fa4a5[_0x5a32('0x21')][_0x44649f[_0x5a32('0x125')]][_0x5a32('0x128')]][_0x5a32('0x129')]=![];delete _0x2fa4a5['actions'][_0x44649f[_0x5a32('0x125')]];unlockQueueStatus(_0x467085);});}else{this[_0x5a32('0xc8')](this[_0x5a32('0xaf')][this['actions'][_0x44649f[_0x5a32('0x125')]]['queue']]);this['rescheduleContact']({'active':![],'ContactId':this[_0x5a32('0x21')][_0x44649f[_0x5a32('0x125')]][_0x5a32('0x100')],'ListId':this[_0x5a32('0x21')][_0x44649f[_0x5a32('0x125')]][_0x5a32('0xce')],'VoiceQueueId':this[_0x5a32('0x21')][_0x44649f['actionid']]['VoiceQueueId']||undefined,'CampaignId':this[_0x5a32('0x21')][_0x44649f[_0x5a32('0x125')]]['CampaignId']||undefined})[_0x5a32('0xae')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0x5a32('0x21')][_0x44649f['actionid']];unlockQueueStatus(_0x467085);}}else if((strategy[this['voiceQueues'][this['actions'][_0x44649f[_0x5a32('0x125')]]['queue']][_0x5a32('0x123')]]||_0x5a32('0x18'))===_0x5a32('0x18')){var _0x1d72b0;if(this[_0x5a32('0x21')][_0x44649f[_0x5a32('0x125')]]&&!_[_0x5a32('0x44')](this[_0x5a32('0x27')][this['actions'][_0x44649f[_0x5a32('0x125')]][_0x5a32('0xb0')]])){if(this['queueBookedRR'][_0x2fa4a5['actions'][_0x44649f[_0x5a32('0x125')]][_0x5a32('0xb0')]]){this['queueBookedRR'][_0x2fa4a5['actions'][_0x44649f[_0x5a32('0x125')]][_0x5a32('0xb0')]]=this['queueBookedRR'][this[_0x5a32('0x21')][_0x44649f[_0x5a32('0x125')]]['queue']]?this[_0x5a32('0x28')][this[_0x5a32('0x21')][_0x44649f['actionid']][_0x5a32('0xb0')]]:this[_0x5a32('0x27')][this[_0x5a32('0x21')][_0x44649f[_0x5a32('0x125')]]['queue']]?this['queueBooked'][this[_0x5a32('0x21')][_0x44649f[_0x5a32('0x125')]][_0x5a32('0xb0')]][_0x5a32('0x132')]||0x0:0x0;}this[_0x5a32('0x27')][this[_0x5a32('0x21')][_0x44649f[_0x5a32('0x125')]][_0x5a32('0xb0')]][_0x5a32('0x132')]=this['queueBookedRR'][this[_0x5a32('0x21')][_0x44649f[_0x5a32('0x125')]]['queue']];for(var _0x1da2d9=0x0;_0x1da2d9=0x0;})[_0x5a32('0xae')](myreject(_0x5d0cd8)));}}else{_0x989162[_0x5a32('0x12a')](ami[_0x5a32('0xac')]({'action':_0x5a32('0x14a'),'command':util[_0x5a32('0x77')]('iftime\x20%s,%s',_0x388eca,!_[_0x5a32('0x3a')](config[_0x5a32('0x146')][_0x378166])?_0x378166:'')})[_0x5a32('0xb5')](function(_0x3cae2a){return _0x3cae2a[_0x5a32('0x14c')][_0x5a32('0x14d')](_0x5a32('0x14e'))>=0x0;})[_0x5a32('0xae')](myreject(_0x5d0cd8)));}BPromise[_0x5a32('0x14f')](_0x989162)['then'](function(_0x350891){var _0x7075d3=_[_0x5a32('0x150')](_0x350891);if(_0x7075d3){return _0x5be7fd(_0x7075d3);}else{_0x1c56a8['message']=_0x4f529c?_0x5a32('0x151'):'INTERVAL_IS_OVERTIME';return _0x5d0cd8(msgResponse(_0x5a32('0x152'),_0x5a32('0x142'),_0x5a32('0x153')+_0x4f529c+'\x20'+_0x4e5a62+_0x5a32('0x154')+util[_0x5a32('0x94')](_0x388eca,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x378166));}})['catch'](function(_0x1cc1ce){return _0x5d0cd8(msgResponse(_0x5a32('0x141'),_0x5a32('0x142'),JSON[_0x5a32('0x47')](_0x1cc1ce)));});});};Dialer['prototype']['checkDialMethod']=function(_0x401697){var _0x40aacc=this;return function(){switch(_0x401697['dialMethod']){case _0x5a32('0x155'):freeVariablesPredictive(_0x401697);_0x40aacc[_0x5a32('0x156')](_0x401697,0x1);break;case _0x5a32('0x157'):freeVariablesPredictive(_0x401697);_0x40aacc[_0x5a32('0x156')](_0x401697,_0x401697[_0x5a32('0x158')]);break;case'predictive':_0x40aacc['predictive'](_0x401697);break;case'booked':freeVariablesPredictive(_0x401697);_0x40aacc[_0x5a32('0x156')](_0x401697,0x1);break;default:freeVariablesPredictive(_0x401697);logger[_0x5a32('0x93')](_0x5a32('0x159'),_0x401697[_0x5a32('0x3d')],_0x5a32('0x15a'));}};};Dialer[_0x5a32('0x19')][_0x5a32('0x15b')]=function(_0x2aaf84){var _0x406e47=this;return function(){_0x406e47[_0x5a32('0x15c')](_0x2aaf84);};};Dialer['prototype'][_0x5a32('0x15d')]=function(_0x2b0cf7){var _0x12c75f=this;if(isNotPreview(_0x2b0cf7[_0x5a32('0x59')])){if(isVoiceQueueOutbound(_0x2b0cf7['type'])&&isActive(_0x2b0cf7[_0x5a32('0x15e')])){_0x2b0cf7[_0x5a32('0x9c')]=!![];BPromise[_0x5a32('0xb4')]()['then'](checkIsLoggedIn(_0x2b0cf7,_0x2b0cf7['loggedIn']))[_0x5a32('0xb5')](checkIsActive(_0x2b0cf7,_0x2b0cf7['dialActive']))[_0x5a32('0xb5')](checkInterval(_0x2b0cf7))[_0x5a32('0xb5')](_0x12c75f[_0x5a32('0x15f')](_0x2b0cf7))[_0x5a32('0xb5')](_0x12c75f[_0x5a32('0x160')](_0x2b0cf7[_0x5a32('0x161')],_0x2b0cf7[_0x5a32('0x162')],_0x2b0cf7[_0x5a32('0x3d')],_0x2b0cf7))['then'](_0x12c75f[_0x5a32('0x163')](_0x2b0cf7[_0x5a32('0x40')],_0x2b0cf7['dialTimezone'],_0x2b0cf7[_0x5a32('0x3d')],_0x2b0cf7))[_0x5a32('0xb5')](_0x12c75f[_0x5a32('0x164')](_0x2b0cf7))[_0x5a32('0xae')](loggerCatchQueueSummary(_0x5a32('0x165'),_0x2b0cf7));}else{notSendMessagesQueue(_0x2b0cf7);}}else{freeVariablesPredictive(_0x2b0cf7);}};Dialer[_0x5a32('0x19')][_0x5a32('0x13e')]=function(){var _0xab5061=this;var _0x1cdf50;for(var _0x30ed3c in this['campaigns']){if(typeof this[_0x5a32('0x1d')][_0x30ed3c]!==_0x5a32('0xa9')){_0x1cdf50=this['campaigns'][_0x30ed3c];if(isCampaignIvr(_0x1cdf50['type'])&&isActive(_0x1cdf50[_0x5a32('0x75')])){_0x1cdf50[_0x5a32('0x9c')]=!![];BPromise['resolve']()[_0x5a32('0xb5')](checkIsActive(_0x1cdf50,_0x1cdf50['active']))[_0x5a32('0xb5')](checkInterval(_0x1cdf50))['then'](_0xab5061['checkIsTrunkReachable'](_0x1cdf50))[_0x5a32('0xb5')](_0xab5061[_0x5a32('0x160')](_0x1cdf50[_0x5a32('0x161')],_0x1cdf50['dialTimezone'],_0x1cdf50[_0x5a32('0x3d')],_0x1cdf50))[_0x5a32('0xb5')](_0xab5061['checkIfTimeIntervals'](_0x1cdf50[_0x5a32('0x40')],_0x1cdf50[_0x5a32('0x162')],_0x1cdf50[_0x5a32('0x3d')],_0x1cdf50))['then'](_0xab5061['launchHandleIvr'](_0x1cdf50))['catch'](loggerCatchQueueSummary(_0x5a32('0x166'),_0x1cdf50));}else{notSendMessagesCampaign(_0x1cdf50);}}}};function getCallerIdRandom(_0x2a4de7,_0x1ec124){var _0x1f4e1f;var _0x5995f3;var _0x2a8a36;if(_0x1ec124<=0x0){_0x1ec124=0x1;}_0x1f4e1f=new RegExp(_0x5a32('0x167')+_0x1ec124+'}$');_0x5995f3=Math[_0x5a32('0x168')](0xa,_0x1ec124-0x1);_0x2a8a36=Math[_0x5a32('0x168')](0xa,_0x1ec124)-0x1;return util[_0x5a32('0x77')]('%s',_['replace'](_0x2a4de7,_0x1f4e1f,_[_0x5a32('0x169')](_0x5995f3,_0x2a8a36)));}function extractCalleridName(_0xf428e0){var _0x354fa5=_0xf428e0[_0x5a32('0x16a')](/"(.*?)"/);return _0x354fa5?_0x354fa5[0x1]:_0xf428e0;}function extractCalleridNumber(_0x4ccc4d){var _0x1a2e56=_0x4ccc4d[_0x5a32('0x16a')](/<(.*?)>/);return _0x1a2e56?_0x1a2e56[0x1]:_0x4ccc4d;}Dialer[_0x5a32('0x19')][_0x5a32('0x16b')]=function(_0x52853e,_0x198747){var _0x122fb8=this;var _0x4d0d40=uuid['v4']();this[_0x5a32('0x21')][_0x4d0d40]=new Action(_0x52853e,_0x198747,_0x4d0d40);return new BPromise(function(_0x4f33f4,_0x40e0d1){if(_[_0x5a32('0x3a')](_0x52853e)&&typeof _0x52853e!==_0x5a32('0x16c')){return _0x40e0d1(msgResponse('originate',_0x5a32('0x142'),_0x5a32('0x16d')));}if(_['isUndefined'](_0x198747[_0x5a32('0x16e')][_0x5a32('0x16f')])||_0x198747[_0x5a32('0x16e')]['phone']===null){return _0x40e0d1(msgResponse(_0x5a32('0x170'),'Failure',_0x5a32('0x171')));}var _0x18f1bb={'XMD-CALLERID':_0x122fb8[_0x5a32('0x21')][_0x4d0d40][_0x5a32('0x172')](),'XMD-AGI':_0x52853e[_0x5a32('0x107')]?util[_0x5a32('0x77')](_0x5a32('0x173'),ipAgi,_0x52853e[_0x5a32('0x107')]):'NONE','XMD-AGIAFTER':_0x52853e[_0x5a32('0x117')]?util[_0x5a32('0x77')]('\x22agi://%s/square,%s\x22',ipAgi,_0x52853e['dialQueueProject2']):_0x5a32('0x174'),'XMD-QUEUE':_0x52853e['type']===_0x5a32('0x4c')?util[_0x5a32('0x77')](_0x5a32('0x175'),_0x52853e[_0x5a32('0x3d')],_0x52853e[_0x5a32('0x176')]||'',_0x52853e[_0x5a32('0x10d')]?'c':'',_0x52853e[_0x5a32('0x113')]||0x3):_0x5a32('0x174'),'XMD-CONTACTID':_0x198747[_0x5a32('0x100')],'XMD-CDRTYPE':_0x5a32('0x177'),'CALLERID(all)':_0x122fb8[_0x5a32('0x21')][_0x4d0d40]['getCaller'](),'XMD-AMD':_0x52853e[_0x5a32('0xde')]?'ACTIVE':_0x5a32('0x174'),'XMD-DESTINATION':_0x5a32('0xdd')};if(_0x52853e[_0x5a32('0xde')]){_0x18f1bb[_0x5a32('0x178')]=_0x52853e['dialAMDInitialSilence']||0x9c4;_0x18f1bb[_0x5a32('0x179')]=_0x52853e[_0x5a32('0x17a')]||0x5dc;_0x18f1bb[_0x5a32('0x17b')]=_0x52853e[_0x5a32('0x17c')]||0x320;_0x18f1bb[_0x5a32('0x17d')]=_0x52853e[_0x5a32('0x17e')]||0x1388;_0x18f1bb[_0x5a32('0x17f')]=_0x52853e['dialAMDMinWordLength']||0x64;_0x18f1bb[_0x5a32('0x180')]=_0x52853e[_0x5a32('0x181')]||0x32;_0x18f1bb[_0x5a32('0x182')]=_0x52853e[_0x5a32('0x183')]||0x3;_0x18f1bb[_0x5a32('0x184')]=_0x52853e['dialAMDSilenceThreshold']||0x100;_0x18f1bb[_0x5a32('0x185')]=_0x52853e[_0x5a32('0x186')]||0x1388;}if(_0x52853e[_0x5a32('0x54')]===_0x5a32('0x4c')){_0x18f1bb[_0x5a32('0x187')]=_0x198747[_0x5a32('0xd0')];}else{_0x18f1bb[_0x5a32('0x188')]=_0x198747[_0x5a32('0xd1')];}for(var _0x119386 in _0x198747[_0x5a32('0x16e')]){if(typeof _0x198747[_0x5a32('0x16e')][_0x119386]!==_0x5a32('0xa9')){if(isNotNull(_0x198747['Contact'][_0x119386])&&_0x119386!=='id'&&_0x119386!==_0x5a32('0x189')&&_0x119386!==_0x5a32('0x18a')&&_0x119386!==_0x5a32('0x18b')){_0x18f1bb[util[_0x5a32('0x77')](_0x5a32('0x18c'),_0x5a32('0x18d'),_[_0x5a32('0x18e')](_0x119386))]=_0x198747[_0x5a32('0x16e')][_0x119386];}}}var _0x56f648=_0x122fb8[_0x5a32('0xd5')](_0x52853e[_0x5a32('0x74')])?getCallerId(_0x52853e[_0x5a32('0x74')][_0x5a32('0x76')],_0x52853e['dialOriginateCallerIdName'],_0x52853e['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x52853e[_0x5a32('0x5b')],_0x52853e[_0x5a32('0x18f')]):_0x52853e[_0x5a32('0x5b')]):getCallerId(_['isNil'](_0x52853e[_0x5a32('0x13f')])?_0x52853e[_0x5a32('0x74')]['callerid']:_0x52853e[_0x5a32('0x13f')][_0x5a32('0x76')],_0x52853e[_0x5a32('0x5a')],_0x52853e[_0x5a32('0x18f')]>0x0?getCallerIdRandom(_0x52853e[_0x5a32('0x5b')],_0x52853e['dialRandomLastDigitCallerIdNumber']):_0x52853e[_0x5a32('0x5b')]);if(_0x56f648){_0x18f1bb[_0x5a32('0x190')]=_0x122fb8['actions'][_0x4d0d40]['originatecalleridname']=extractCalleridName(_0x56f648);_0x18f1bb[_0x5a32('0x191')]=_0x122fb8['actions'][_0x4d0d40]['originatecalleridnum']=extractCalleridNumber(_0x56f648);}return ami['Action']({'actionid':_0x4d0d40,'action':_0x5a32('0x170'),'channel':_0x122fb8['isTrunkReachable'](_0x52853e['Trunk'])?util[_0x5a32('0x77')](_0x5a32('0x192'),_0x52853e[_0x5a32('0x74')][_0x5a32('0x3d')],isNotNull(_0x52853e[_0x5a32('0x5c')])?_0x52853e['dialPrefix'][_0x5a32('0x193')]()||'':'',_0x52853e[_0x5a32('0x194')]>0x0?_0x198747[_0x5a32('0x16e')]['phone'][_0x5a32('0x195')](_0x52853e['dialCutDigit']):_0x198747[_0x5a32('0x16e')][_0x5a32('0x16f')]):util[_0x5a32('0x77')](_0x5a32('0x192'),_['isNil'](_0x52853e[_0x5a32('0x13f')])?_0x52853e[_0x5a32('0x74')][_0x5a32('0x3d')]:_0x52853e[_0x5a32('0x13f')][_0x5a32('0x3d')],isNotNull(_0x52853e[_0x5a32('0x5c')])?_0x52853e[_0x5a32('0x5c')]['trim']()||'':'',_0x52853e['dialCutDigit']>0x0?_0x198747[_0x5a32('0x16e')][_0x5a32('0x16f')][_0x5a32('0x195')](_0x52853e[_0x5a32('0x194')]):_0x198747[_0x5a32('0x16e')]['phone']),'callerid':_0x56f648,'Exten':_0x5a32('0xdd'),'Context':'from-sip','Priority':'1','variable':_0x18f1bb,'timeout':(_0x52853e[_0x5a32('0x196')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4d0d40})[_0x5a32('0xb5')](function(_0x43a044){return _0x4f33f4(_0x43a044);})[_0x5a32('0xae')](function(_0x232954){_0x52853e[_0x5a32('0x197')]+=0x1;var _0x13c73e=new History(_0x122fb8['actions'][_0x4d0d40]);logger[_0x5a32('0x93')](util['format'](_0x5a32('0x198'),JSON['stringify'](_0x232954)));_0x13c73e[_0x5a32('0xe9')]=0xe;_0x13c73e[_0x5a32('0xa3')]=_0x5a32('0x199');_0x13c73e[_0x5a32('0xa4')]=moment()[_0x5a32('0x77')]('YYYY-MM-DD\x20HH:mm:ss');_0x13c73e[_0x5a32('0x11a')]=_0x13c73e['starttime'];_0x122fb8[_0x5a32('0xc7')](_0x13c73e)[_0x5a32('0xae')](loggerCatch('[originate][error]'));_0x122fb8['moveContactManagedDialer'](_0x13c73e)[_0x5a32('0xae')](loggerCatch('[originate][error]'))[_0x5a32('0x131')](function(){delete _0x122fb8[_0x5a32('0x21')][_0x4d0d40];return _0x40e0d1(msgResponse(_0x5a32('0x170'),_0x5a32('0x46'),_0x5a32('0x19a')));});});});};Dialer[_0x5a32('0x19')]['syncOriginateResponse']=function(_0x3b75c3){var _0x11a378=this[_0x5a32('0x21')][_0x3b75c3[_0x5a32('0x125')]];if(_0x11a378){delete this['actions'][_0x3b75c3['actionid']];_0x11a378[_0x5a32('0x112')]=moment()['format'](_0x5a32('0xfa'));var _0x43ab62=_0x11a378[_0x5a32('0x54')]==='ivr'?this[_0x5a32('0x1d')][_0x11a378[_0x5a32('0xb0')]]:this['voiceQueues'][_0x11a378['getQueue']()];if(!this[_0x5a32('0x19b')](_0x3b75c3['response'])){this[_0x5a32('0xc8')](_0x43ab62);return this[_0x5a32('0x19c')](_0x11a378,_0x43ab62,_0x3b75c3)['catch'](loggerCatch('[callProgressDetecting]\x20'));}this[_0x5a32('0x23')][_0x3b75c3[_0x5a32('0xfd')]]=_0x11a378;}};Dialer['prototype'][_0x5a32('0x19d')]=function(_0x5476d9,_0x5e34ca,_0x23d4e5){var _0x5d0673=new History(_0x5e34ca);if(_0x5d0673['countbusyretry']+_0x5d0673[_0x5a32('0x19e')]+_0x5d0673[_0x5a32('0xef')]+_0x5d0673[_0x5a32('0xf0')]+_0x5d0673[_0x5a32('0xf1')]+_0x5d0673[_0x5a32('0xf2')]+_0x5d0673[_0x5a32('0xeb')]+_0x5d0673[_0x5a32('0xff')]>=_0x23d4e5[_0x5a32('0xf3')]-0x1){return!![];}switch(_0x5476d9){case 0x3:if(_0x5d0673[_0x5a32('0xef')]>=_0x23d4e5[_0x5a32('0x19f')]-0x1){return!![];}this[_0x5a32('0xbc')]({'active':![],'countnoanswerretry':_0x5d0673[_0x5a32('0xef')]+=0x1,'scheduledat':moment()['add'](_0x23d4e5[_0x5a32('0x1a0')],_0x5a32('0x1a1'))['format'](_0x5a32('0xfa')),'ContactId':_0x5d0673['ContactId'],'ListId':_0x5d0673[_0x5a32('0xce')],'VoiceQueueId':_0x5d0673[_0x5a32('0xd0')]||undefined,'CampaignId':_0x5d0673[_0x5a32('0xd1')]||undefined})['catch'](loggerCatch(_0x5a32('0x1a2')));break;case 0x5:if(_0x5d0673[_0x5a32('0xfe')]>=_0x23d4e5[_0x5a32('0x1a3')]-0x1){return!![];}this[_0x5a32('0xbc')]({'active':![],'countbusyretry':_0x5d0673[_0x5a32('0xfe')]+=0x1,'scheduledat':moment()['add'](_0x23d4e5[_0x5a32('0x1a4')],'minutes')[_0x5a32('0x77')](_0x5a32('0xfa')),'ContactId':_0x5d0673[_0x5a32('0x100')],'ListId':_0x5d0673['ListId'],'VoiceQueueId':_0x5d0673[_0x5a32('0xd0')]||undefined,'CampaignId':_0x5d0673['CampaignId']||undefined})['catch'](loggerCatch(_0x5a32('0x1a5')));break;case 0x8:if(_0x5d0673[_0x5a32('0x19e')]>=_0x23d4e5[_0x5a32('0x1a6')]-0x1){return!![];}this[_0x5a32('0xbc')]({'active':![],'countcongestionretry':_0x5d0673[_0x5a32('0x19e')]+=0x1,'scheduledat':moment()['add'](_0x23d4e5[_0x5a32('0x1a7')],'minutes')[_0x5a32('0x77')](_0x5a32('0xfa')),'ContactId':_0x5d0673[_0x5a32('0x100')],'ListId':_0x5d0673[_0x5a32('0xce')],'VoiceQueueId':_0x5d0673['VoiceQueueId']||undefined,'CampaignId':_0x5d0673[_0x5a32('0xd1')]||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x5d0673[_0x5a32('0xf0')]>=_0x23d4e5[_0x5a32('0x1a8')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x5d0673[_0x5a32('0xf0')]+=0x1,'scheduledat':moment()[_0x5a32('0xf8')](_0x23d4e5[_0x5a32('0x1a9')],_0x5a32('0x1a1'))[_0x5a32('0x77')](_0x5a32('0xfa')),'ContactId':_0x5d0673['ContactId'],'ListId':_0x5d0673['ListId'],'VoiceQueueId':_0x5d0673[_0x5a32('0xd0')]||undefined,'CampaignId':_0x5d0673[_0x5a32('0xd1')]||undefined})['catch'](loggerCatch(_0x5a32('0x1aa')));}break;case 0xa:if(_0x5d0673['countdropretry']>=_0x23d4e5[_0x5a32('0x1ab')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countdropretry':_0x5d0673[_0x5a32('0xf1')]+=0x1,'scheduledat':moment()[_0x5a32('0xf8')](_0x23d4e5[_0x5a32('0x119')],_0x5a32('0x1a1'))[_0x5a32('0x77')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5d0673[_0x5a32('0x100')],'ListId':_0x5d0673['ListId'],'VoiceQueueId':_0x5d0673[_0x5a32('0xd0')]||undefined,'CampaignId':_0x5d0673[_0x5a32('0xd1')]||undefined})[_0x5a32('0xae')](loggerCatch(_0x5a32('0x1ac')));break;case 0xb:if(_0x5d0673[_0x5a32('0xf2')]>=_0x23d4e5[_0x5a32('0x120')]-0x1){return!![];}this[_0x5a32('0xbc')]({'active':![],'countabandonedretry':_0x5d0673[_0x5a32('0xf2')]+=0x1,'scheduledat':moment()[_0x5a32('0xf8')](_0x23d4e5[_0x5a32('0x1ad')],_0x5a32('0x1a1'))[_0x5a32('0x77')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5d0673['ContactId'],'ListId':_0x5d0673[_0x5a32('0xce')],'VoiceQueueId':_0x5d0673['VoiceQueueId']||undefined,'CampaignId':_0x5d0673[_0x5a32('0xd1')]||undefined})[_0x5a32('0xae')](loggerCatch(_0x5a32('0x121')));break;case 0x13:if(_0x5d0673['countmachineretry']>=_0x23d4e5[_0x5a32('0xf5')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countmachineretry':_0x5d0673[_0x5a32('0xeb')]+=0x1,'scheduledat':moment()[_0x5a32('0xf8')](_0x23d4e5[_0x5a32('0xf9')],_0x5a32('0x1a1'))[_0x5a32('0x77')](_0x5a32('0xfa')),'ContactId':_0x5d0673['ContactId'],'ListId':_0x5d0673[_0x5a32('0xce')],'VoiceQueueId':_0x5d0673[_0x5a32('0xd0')]||undefined,'CampaignId':_0x5d0673[_0x5a32('0xd1')]||undefined})[_0x5a32('0xae')](loggerCatch(_0x5a32('0x1ae')));break;case 0x14:if(_0x5d0673[_0x5a32('0xff')]>=_0x23d4e5[_0x5a32('0x1af')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countagentrejectretry':_0x5d0673[_0x5a32('0xff')]+=0x1,'scheduledat':moment()[_0x5a32('0xf8')](_0x23d4e5[_0x5a32('0x1b0')],'minutes')['format'](_0x5a32('0xfa')),'ContactId':_0x5d0673[_0x5a32('0x100')],'ListId':_0x5d0673['ListId'],'VoiceQueueId':_0x5d0673[_0x5a32('0xd0')]||undefined,'CampaignId':_0x5d0673[_0x5a32('0xd1')]||undefined})[_0x5a32('0xae')](loggerCatch(_0x5a32('0x1b1')));break;default:return!![];}};Dialer[_0x5a32('0x19')][_0x5a32('0x19c')]=function(_0x42bd9c,_0x35090f,_0x1d2b9e){var _0x89801b=this;var _0x187825=new History(_0x42bd9c);return new BPromise(function(_0x57681f,_0x7be4e9){if(_[_0x5a32('0x3a')](_0x35090f)&&typeof _0x35090f!==_0x5a32('0x16c')){return _0x7be4e9(msgResponse('[callProgressDetecting]',_0x5a32('0x142'),'entity\x20is\x20undefine'));}if(_[_0x5a32('0x3a')](_0x1d2b9e)&&typeof _0x1d2b9e!==_0x5a32('0x16c')){return _0x7be4e9(msgResponse(_0x5a32('0x1b2'),_0x5a32('0x142'),_0x5a32('0x1b3')));}switch(_0x1d2b9e[_0x5a32('0x10a')]){case'0':_0x35090f[_0x5a32('0x1b4')]+=0x1;_0x187825[_0x5a32('0xe9')]=0x0;_0x187825[_0x5a32('0xa3')]=_0x5a32('0x1b5');_0x187825['countnosuchnumberretry']+=0x1;_0x187825['countglobal']+=0x1;ami[_0x5a32('0x4b')](_0x5a32('0x1b6'),ut[_0x5a32('0xed')](_0x42bd9c,_0x5a32('0x1b7')));_0x89801b['createHistory'](_0x187825)[_0x5a32('0xae')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x89801b['checkRetriveMax'](0x0,_0x42bd9c,_0x35090f)){if(_0x187825[_0x5a32('0xf0')]>=_0x35090f[_0x5a32('0x1a8')]){_0x89801b[_0x5a32('0xf6')](_0x187825,_0x57681f,_0x7be4e9,_0x5a32('0x1b8'));}else{_0x89801b[_0x5a32('0x1b9')](_0x187825,_0x57681f,_0x7be4e9,_0x5a32('0x1b8'));}}break;case'3':_0x35090f['outboundNoAnswerCallsDay']+=0x1;_0x187825[_0x5a32('0xe9')]=0x3;_0x187825[_0x5a32('0xa3')]=_0x5a32('0x1ba');_0x187825[_0x5a32('0xef')]+=0x1;_0x187825[_0x5a32('0xec')]+=0x1;ami[_0x5a32('0x4b')]('custom:agentnoanswer',ut[_0x5a32('0xed')](_0x42bd9c,_0x5a32('0x1bb')));_0x89801b['createHistory'](_0x187825)[_0x5a32('0xae')](loggerCatch(_0x5a32('0x1bc')));if(_0x89801b[_0x5a32('0x19d')](0x3,_0x42bd9c,_0x35090f)){if(_0x187825[_0x5a32('0xef')]>=_0x35090f['dialNoAnswerMaxRetry']){_0x89801b[_0x5a32('0xf6')](_0x187825,_0x57681f,_0x7be4e9,_0x5a32('0x1bd'));}else{_0x89801b[_0x5a32('0x1b9')](_0x187825,_0x57681f,_0x7be4e9,_0x5a32('0x1bd'));}}break;case'5':_0x35090f['outboundBusyCallsDay']+=0x1;_0x187825[_0x5a32('0xe9')]=0x5;_0x187825[_0x5a32('0xa3')]=_0x5a32('0x1be');_0x187825[_0x5a32('0xfe')]+=0x1;_0x187825[_0x5a32('0xec')]+=0x1;ami[_0x5a32('0x4b')](_0x5a32('0x1bf'),ut[_0x5a32('0xed')](_0x42bd9c,_0x5a32('0x1c0')));_0x89801b[_0x5a32('0xc7')](_0x187825)[_0x5a32('0xae')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x89801b[_0x5a32('0x19d')](0x5,_0x42bd9c,_0x35090f)){if(_0x187825[_0x5a32('0xfe')]>=_0x35090f[_0x5a32('0x1a3')]){_0x89801b[_0x5a32('0xf6')](_0x187825,_0x57681f,_0x7be4e9,'reason\x205\x20busy');}else{_0x89801b['stateGlobal'](_0x187825,_0x57681f,_0x7be4e9,_0x5a32('0x1c1'));}}break;case'8':_0x35090f[_0x5a32('0x61')]+=0x1;_0x187825[_0x5a32('0xe9')]=0x8;_0x187825['statedesc']=_0x5a32('0x1c2');_0x187825[_0x5a32('0x19e')]+=0x1;_0x187825[_0x5a32('0xec')]+=0x1;ami[_0x5a32('0x4b')](_0x5a32('0x1c3'),ut['buildObj'](_0x42bd9c,_0x5a32('0x1c4')));_0x89801b[_0x5a32('0xc7')](_0x187825)[_0x5a32('0xae')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x89801b[_0x5a32('0x19d')](0x8,_0x42bd9c,_0x35090f)){if(_0x187825['countcongestionretry']>=_0x35090f[_0x5a32('0x1a6')]){_0x89801b[_0x5a32('0xf6')](_0x187825,_0x57681f,_0x7be4e9,'reason\x208\x20congestion');}else{_0x89801b[_0x5a32('0x1b9')](_0x187825,_0x57681f,_0x7be4e9,'reason\x208\x20congestion');}}break;case'11':_0x35090f[_0x5a32('0x1c5')]+=0x1;_0x187825[_0x5a32('0xe9')]=0xb;_0x187825[_0x5a32('0xa3')]=_0x5a32('0x11e');_0x187825[_0x5a32('0xf2')]+=0x1;_0x187825['countglobal']+=0x1;_0x89801b[_0x5a32('0xc7')](_0x187825)[_0x5a32('0xae')](loggerCatch(_0x5a32('0x122')));if(_0x89801b[_0x5a32('0x19d')](0xb,_0x42bd9c,_0x35090f)){if(_0x187825[_0x5a32('0xf2')]>=_0x35090f['dialAbandonedMaxRetry']){_0x89801b['createStateFinal'](_0x187825,_0x57681f,_0x7be4e9,_0x5a32('0x1c6'));}else{_0x89801b['stateGlobal'](_0x187825,_0x57681f,_0x7be4e9,'reason\x2011\x20abandoned');}}break;case'20':_0x35090f[_0x5a32('0x65')]+=0x1;_0x187825[_0x5a32('0xe9')]=0x14;_0x187825[_0x5a32('0xa3')]=_0x5a32('0x1c7');_0x187825[_0x5a32('0xff')]+=0x1;_0x187825[_0x5a32('0xec')]+=0x1;ami[_0x5a32('0x4b')](_0x5a32('0x1c8'),ut[_0x5a32('0xed')](_0x42bd9c,'agentreject'));_0x89801b['createHistory'](_0x187825)[_0x5a32('0xae')](loggerCatch(_0x5a32('0x1c9')));if(_0x89801b[_0x5a32('0x19d')](0x14,_0x42bd9c,_0x35090f)){if(_0x187825['countagentrejectretry']>=_0x35090f[_0x5a32('0x1af')]){_0x89801b[_0x5a32('0xf6')](_0x187825,_0x57681f,_0x7be4e9,_0x5a32('0x1ca'));}else{_0x89801b[_0x5a32('0x1b9')](_0x187825,_0x57681f,_0x7be4e9,_0x5a32('0x1ca'));}}break;default:_0x35090f['outboundUnknownCallsDay']+=0x1;_0x187825[_0x5a32('0xe9')]=0xc;_0x187825[_0x5a32('0xa3')]=_0x1d2b9e[_0x5a32('0x10a')];_0x89801b[_0x5a32('0xc7')](_0x187825)[_0x5a32('0xae')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x89801b[_0x5a32('0x19d')](_0x1d2b9e[_0x5a32('0x10a')],_0x42bd9c,_0x35090f)){if(_0x187825[_0x5a32('0xfe')]+_0x187825[_0x5a32('0x19e')]+_0x187825[_0x5a32('0xef')]+_0x187825[_0x5a32('0xf0')]+_0x187825[_0x5a32('0xf1')]+_0x187825[_0x5a32('0xf2')]+_0x187825['countmachineretry']+_0x187825[_0x5a32('0xff')]>=_0x35090f[_0x5a32('0xf3')]){_0x89801b['stateGlobal'](_0x187825,_0x57681f,_0x7be4e9,_0x1d2b9e['reason']);}else{_0x89801b[_0x5a32('0xf6')](_0x187825,_0x57681f,_0x7be4e9,_0x1d2b9e[_0x5a32('0x10a')]);}}}});};Dialer['prototype']['stateGlobal']=function(_0x4e62ba,_0x4923eb,_0x2a4957,_0x40f50e){var _0x3bd2ca=new Final(_0x4e62ba);_0x3bd2ca[_0x5a32('0xe9')]=0xf;_0x3bd2ca['statedesc']='Global';this['createStateFinal'](_0x3bd2ca,_0x4923eb,_0x2a4957,_0x40f50e);};Dialer['prototype'][_0x5a32('0xf6')]=function(_0x40eadc,_0x3de0b6,_0x3262b6,_0x5cd480){this[_0x5a32('0xc5')](_0x40eadc)['then'](function(){return _0x3de0b6(msgResponse('[callProgressDetecting]',_0x5a32('0xd4'),_0x5cd480));})[_0x5a32('0xae')](function(){return _0x3262b6(msgResponse('[moveContactManagedDialer][0]',_0x5a32('0x142'),_0x5a32('0x1cb')));});};Dialer[_0x5a32('0x19')][_0x5a32('0x7')]=function(_0x2c8ba5){var _0x3c136=_0x2c8ba5[_0x5a32('0x1cc')]/0x64;var _0x25ec14=_0x2c8ba5[_0x5a32('0x63')]/(_0x2c8ba5[_0x5a32('0x63')]+_0x2c8ba5[_0x5a32('0x5e')]);var _0x5c5539=Math['round'](_0x2c8ba5[_0x5a32('0x6f')]*(_0x2c8ba5[_0x5a32('0x1cd')]/0x64));var _0x5b2c0e=Math[_0x5a32('0x1ce')](_0x2c8ba5[_0x5a32('0x6f')]*(_0x2c8ba5[_0x5a32('0x1cf')]/0x64));var _0x5d3355=_0x2c8ba5[_0x5a32('0x4e')]+_0x2c8ba5[_0x5a32('0x52')];var _0x598d63=Math[_0x5a32('0x1d0')](_0x2c8ba5[_0x5a32('0x70')]*_0x2c8ba5[_0x5a32('0x72')]*_0x2c8ba5[_0x5a32('0x6d')]*_0x2c8ba5['predictiveIntervalMultiplicativeFactor']);if(_[_0x5a32('0x3a')](_0x2c8ba5[_0x5a32('0x25')])){if(!_[_0x5a32('0x3a')](_0x2c8ba5[_0x5a32('0x73')])){_0x2c8ba5[_0x5a32('0x73')]=undefined;loggerPredictive[_0x5a32('0x93')](_0x5a32('0x1d1'),_0x5a32('0x1d2'));}if(!_[_0x5a32('0x3a')](_0x2c8ba5[_0x5a32('0x8e')])){loggerPredictive[_0x5a32('0x93')](_0x5a32('0x1d1'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x2c8ba5[_0x5a32('0x8e')]);_0x2c8ba5[_0x5a32('0x8e')]=undefined;}_0x2c8ba5[_0x5a32('0x25')]=moment()[_0x5a32('0x77')](_0x5a32('0xfa'));loggerPredictive['info'](_0x2c8ba5[_0x5a32('0x3d')],_0x5a32('0x1d3'),_0x2c8ba5[_0x5a32('0x25')]);this[_0x5a32('0x156')](_0x2c8ba5,0x1);}else if(ifInterval(_0x2c8ba5[_0x5a32('0x1d4')],_0x2c8ba5[_0x5a32('0x25')])){this[_0x5a32('0x156')](_0x2c8ba5,0x1);loggerPredictiveCalls[_0x5a32('0x7c')](_0x5a32('0x1d5'),_0x2c8ba5['startProgressive'],_0x2c8ba5[_0x5a32('0x3d')]);_0x2c8ba5[_0x5a32('0x70')]=0x0;_0x2c8ba5[_0x5a32('0x114')]=0x0;}else if(_0x3c136<_0x25ec14&&_0x2c8ba5[_0x5a32('0x1d6')]===_0x5a32('0x1d7')){freeVariablesPredictive(_0x2c8ba5);loggerPredictive[_0x5a32('0x7c')](_0x5a32('0x1d8'),'Dropped\x20calls\x20day',_0x25ec14,_0x5a32('0x25'),_0x2c8ba5[_0x5a32('0x3d')]);}else if(_0x598d63<_0x2c8ba5[_0x5a32('0x114')]&&_0x2c8ba5[_0x5a32('0x1d6')]===_0x5a32('0x1d7')){freeVariablesPredictive(_0x2c8ba5);loggerPredictive[_0x5a32('0x7c')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20',_0x598d63,_0x5a32('0x1d9'),_0x2c8ba5['predictiveIntervalErlangCallsDroppedCalls'],_0x5a32('0x25'),_0x2c8ba5[_0x5a32('0x3d')]);}else if(!ifInterval(_0x2c8ba5['dialPredictiveInterval'],_0x2c8ba5[_0x5a32('0x25')])&&_[_0x5a32('0x3a')](_0x2c8ba5[_0x5a32('0x73')])&&!_[_0x5a32('0x3a')](_0x2c8ba5[_0x5a32('0x25')])){_0x2c8ba5[_0x5a32('0x73')]=moment()[_0x5a32('0x77')](_0x5a32('0xfa'));loggerPredictive[_0x5a32('0x7c')](_0x2c8ba5[_0x5a32('0x3d')],_0x5a32('0x1da'),_0x2c8ba5[_0x5a32('0x73')]);this[_0x5a32('0x1db')](_0x2c8ba5[_0x5a32('0x1d4')])['then'](this['getDataPredictive'](_0x2c8ba5))[_0x5a32('0xb5')](mergeDataErlangB(_0x2c8ba5))['then'](this[_0x5a32('0x1dc')](_0x2c8ba5))[_0x5a32('0xae')](loggerCatchPredictive(_0x5a32('0x1dd'),_0x2c8ba5));}else if(!ifInterval(_0x2c8ba5['dialPredictiveInterval'],_0x2c8ba5['startPredictive'])){_0x2c8ba5[_0x5a32('0x114')]=0x0;_0x2c8ba5['startPredictive']=moment()[_0x5a32('0x77')](_0x5a32('0xfa'));loggerPredictive[_0x5a32('0x7c')](_0x2c8ba5['name'],'recalculate\x20predictive\x20at',_0x2c8ba5[_0x5a32('0x73')]);clearInterval(_0x2c8ba5[_0x5a32('0x8e')]);_0x2c8ba5[_0x5a32('0x8e')]=undefined;this[_0x5a32('0x1db')](_0x2c8ba5[_0x5a32('0x1d4')])[_0x5a32('0xb5')](this[_0x5a32('0x1de')](_0x2c8ba5))[_0x5a32('0xb5')](mergeDataErlangB(_0x2c8ba5))[_0x5a32('0xb5')](this[_0x5a32('0x1dc')](_0x2c8ba5))[_0x5a32('0xae')](loggerCatchPredictive(_0x5a32('0x1df'),_0x2c8ba5));}else if(_0x2c8ba5['predictiveIntervalAvailable']&&_0x5d3355<_0x2c8ba5['predictiveIntervalAvailable']-_0x5b2c0e){freeVariablesPredictive(_0x2c8ba5);loggerPredictive['info'](_0x2c8ba5[_0x5a32('0x3d')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x5d3355,')\x20are\x20less\x20than\x20threshold\x20(',_0x2c8ba5[_0x5a32('0x6f')],'-',_0x5b2c0e,'=',_0x2c8ba5[_0x5a32('0x6f')]-_0x5b2c0e,')');}else if(_0x2c8ba5[_0x5a32('0x6f')]&&_0x5d3355>_0x2c8ba5[_0x5a32('0x6f')]+_0x5c5539){freeVariablesPredictive(_0x2c8ba5);loggerPredictive[_0x5a32('0x7c')](_0x2c8ba5[_0x5a32('0x3d')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x5d3355,_0x5a32('0x1e0'),_0x2c8ba5[_0x5a32('0x6f')],'+',_0x5c5539,'=',_0x2c8ba5[_0x5a32('0x6f')]+_0x5c5539,')');}};Dialer[_0x5a32('0x19')][_0x5a32('0x1de')]=function(_0x36637b){var _0x3c3611=this;return function(_0x2f4154){return new BPromise(function(_0x38f831,_0x4e783a){_[_0x5a32('0x8c')](_0x36637b,_0x2f4154[0x0]);if(checkGetDataPredictive(_0x2f4154[0x0])){var _0x565e08=_0x36637b[_0x5a32('0x6f')]=_0x36637b[_0x5a32('0x52')]+_0x36637b[_0x5a32('0x4e')];var _0x41a6e7=_0x36637b['dialPredictiveInterval']*0x3c;var _0x5a43ab=_0x2f4154[0x0][_0x5a32('0x69')]+_0x2f4154[0x0]['predictiveIntervalAvgHoldtime'];var _0x3e1784=(_0x2f4154[0x0]['predictiveIntervalAnsweredCalls']+_0x2f4154[0x0][_0x5a32('0x6b')]+_0x2f4154[0x0][_0x5a32('0x6a')])/_0x2f4154[0x0][_0x5a32('0x7e')];_0x36637b['predictiveIntervalHitRate']=_0x3e1784>0x0?_0x3e1784:0x1;switch(_0x36637b[_0x5a32('0x1d6')]){case _0x5a32('0x1d7'):var _0x35e179=_0x36637b['dialPredictiveOptimizationPercentage']/0x64;return _0x3c3611[_0x5a32('0x1e1')](_0x565e08,_0x41a6e7,_0x5a43ab,_0x3e1784,_0x35e179)[_0x5a32('0xb5')](function(_0xaada70){return _0x38f831(_0xaada70);});case _0x5a32('0x1e2'):var _0x180368=_0x36637b['dialPredictiveOptimizationPercentage']/0x64;return _0x3c3611[_0x5a32('0x1e3')](_0x565e08,_0x41a6e7,_0x5a43ab,_0x3e1784,_0x180368)[_0x5a32('0xb5')](function(_0x4584fb){return _0x38f831(_0x4584fb);});default:return _0x4e783a(msgResponse('[getDataPredictive]',_0x5a32('0x142'),_0x5a32('0x1e4')));}}else{return _0x4e783a(msgResponse(_0x5a32('0x1e5'),_0x5a32('0x142'),_0x5a32('0x1e6')));}});};};Dialer[_0x5a32('0x19')]['getDataPredictiveOld']=function(_0x166249){var _0x2d040f=this;return function(_0x1599ff){return new BPromise(function(_0x5bd6e8,_0x51b083){_['merge'](_0x166249,_0x1599ff[0x0]);if(checkGetDataPredictive(_0x1599ff[0x0])){loggerPredictive['info'](JSON[_0x5a32('0x47')](_0x1599ff[0x0]));if(_0x166249[_0x5a32('0x1d6')]==='dropRate'){return _0x2d040f[_0x5a32('0xc3')](_0x166249['id'])[_0x5a32('0xb5')](function(_0x289914){var _0x3c3f97=_0x166249['loggedIn']-_0x289914[0x0][_0x5a32('0x1e7')];var _0x5a875f=_0x166249[_0x5a32('0x1d4')]*0x3c;var _0x2f961b=_0x1599ff[0x0][_0x5a32('0x69')]+_0x1599ff[0x0][_0x5a32('0x68')];var _0x192830=(_0x1599ff[0x0]['predictiveIntervalAnsweredCalls']+_0x1599ff[0x0][_0x5a32('0x6b')]+_0x1599ff[0x0][_0x5a32('0x6a')])/_0x1599ff[0x0][_0x5a32('0x7e')];var _0x43f2b2=_0x166249[_0x5a32('0x1cc')]/0x64;_0x166249[_0x5a32('0x1e8')]=_0x289914[0x0][_0x5a32('0x1e7')]||0x0;_0x166249[_0x5a32('0x6d')]=_0x192830>0x0?_0x192830:0x1;return _0x2d040f[_0x5a32('0x1e1')](_0x3c3f97,_0x5a875f,_0x2f961b,_0x192830,_0x43f2b2);})[_0x5a32('0xb5')](function(_0x24937e){return _0x5bd6e8(_0x24937e);})['catch'](function(_0x1702b8){return _0x51b083(msgResponse(_0x5a32('0x1e9'),'Failure',JSON['stringify'](_0x1702b8)));});}if(_0x166249[_0x5a32('0x1d6')]==='agentBusyFactor'){return _0x2d040f[_0x5a32('0xc3')](_0x166249['id'])[_0x5a32('0xb5')](function(_0x482983){var _0x229a02=_0x166249['loggedIn']-_0x482983[0x0][_0x5a32('0x1e7')];var _0x34c65c=_0x166249[_0x5a32('0x1d4')]*0x3c;var _0x59c97b=_0x1599ff[0x0]['predictiveIntervalAvgTalktime']+_0x1599ff[0x0]['predictiveIntervalAvgHoldtime'];var _0x1a4b01=(_0x1599ff[0x0][_0x5a32('0x67')]+_0x1599ff[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x1599ff[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x1599ff[0x0][_0x5a32('0x7e')];var _0x44fe5e=_0x166249['dialPredictiveOptimizationPercentage']/0x64;_0x166249[_0x5a32('0x1e8')]=_0x482983[0x0][_0x5a32('0x1e7')]||0x0;_0x166249[_0x5a32('0x6d')]=_0x1a4b01>0x0?_0x1a4b01:0x1;return _0x2d040f[_0x5a32('0x1e3')](_0x229a02,_0x34c65c,_0x59c97b,_0x1a4b01,_0x44fe5e);})[_0x5a32('0xb5')](function(_0x83fed){return _0x5bd6e8(_0x83fed);})[_0x5a32('0xae')](function(_0x300e7b){return _0x51b083(msgResponse(_0x5a32('0x1e9'),_0x5a32('0x142'),JSON[_0x5a32('0x47')](_0x300e7b)));});}}else{return _0x51b083(msgResponse('[getDataPredictive]','Failure','check\x20failure'));}});};};Dialer['prototype'][_0x5a32('0x1dc')]=function(_0x54c4d8){var _0x540220=this;return function(){var _0x3bb0fb=0x0;var _0x213a25=Math['floor'](_0x54c4d8[_0x5a32('0x71')]*0x3e8);if(_0x213a25>0x0){_0x213a25=_0x213a25<0x64?0x64:_0x213a25;loggerPredictive[_0x5a32('0x7c')](_0x54c4d8[_0x5a32('0x3d')],_0x5a32('0x1ea'),_0x213a25,_0x5a32('0x48'));_0x54c4d8[_0x5a32('0x8e')]=setInterval(function(){_0x540220[_0x5a32('0x8e')](_0x54c4d8);loggerPredictiveCalls[_0x5a32('0x7c')](_0x5a32('0x1eb'),_0x3bb0fb+=0x1);},_0x213a25);}else{loggerPredictive[_0x5a32('0x7c')](_0x54c4d8[_0x5a32('0x3d')],_0x5a32('0x1ec'));}};};Dialer[_0x5a32('0x19')][_0x5a32('0x1ed')]=function(_0x155911,_0x14bac5){var _0x511180=this;return function(_0x2e1b9b){if(_[_0x5a32('0x44')](_0x2e1b9b)){if(_[_0x5a32('0xab')](_0x14bac5[_0x5a32('0xcf')])||!_0x14bac5['recallme']){if(_0x155911[_0x5a32('0x59')]==='booked'){_0x155911[_0x5a32('0x12d')]=_[_0x5a32('0x3a')](_0x155911[_0x5a32('0x12d')])?!![]:_0x155911['queueStatusComplete'];var _0x2cb11a=uuid['v4']();_0x511180[_0x5a32('0x21')][_0x2cb11a]=new Action(_0x155911,_0x14bac5,_0x2cb11a);loggerBooked[_0x5a32('0x7c')](_0x5a32('0x1ee'),_0x2cb11a,_0x5a32('0x1ef'),JSON[_0x5a32('0x47')](_0x155911[_0x5a32('0x12d')]),_0x5a32('0x1f0'),_0x155911[_0x5a32('0x3d')]);if(_0x155911[_0x5a32('0x12d')]){_0x155911['queueStatusComplete']=![];_0x511180[_0x5a32('0x27')][_0x511180[_0x5a32('0x21')][_0x2cb11a][_0x5a32('0xb0')]]=[];ami[_0x5a32('0xac')]({'actionid':_0x2cb11a,'action':_0x5a32('0x1f1'),'queue':_0x155911[_0x5a32('0x3d')]})[_0x5a32('0xae')](function(){_0x511180[_0x5a32('0xc8')](_0x155911);_0x511180[_0x5a32('0xbc')]({'active':![],'ContactId':_0x511180[_0x5a32('0x21')][_0x2cb11a]['ContactId'],'ListId':_0x511180[_0x5a32('0x21')][_0x2cb11a][_0x5a32('0xce')],'VoiceQueueId':_0x511180[_0x5a32('0x21')][_0x2cb11a][_0x5a32('0xd0')]||undefined,'CampaignId':_0x511180[_0x5a32('0x21')][_0x2cb11a][_0x5a32('0xd1')]||undefined})[_0x5a32('0xae')](loggerCatch(_0x5a32('0x1f2')));delete _0x511180[_0x5a32('0x21')][_0x2cb11a];});}else{loggerBooked[_0x5a32('0x7c')](_0x5a32('0x1f3'),JSON[_0x5a32('0x47')](_0x155911[_0x5a32('0x12d')]),_0x5a32('0x1f0'),_0x155911[_0x5a32('0x3d')]);_0x511180[_0x5a32('0xc8')](_0x155911);_0x511180[_0x5a32('0xbc')]({'active':![],'ContactId':_0x511180[_0x5a32('0x21')][_0x2cb11a]['ContactId'],'ListId':_0x511180[_0x5a32('0x21')][_0x2cb11a][_0x5a32('0xce')],'VoiceQueueId':_0x511180['actions'][_0x2cb11a]['VoiceQueueId']||undefined,'CampaignId':_0x511180[_0x5a32('0x21')][_0x2cb11a][_0x5a32('0xd1')]||undefined})['catch'](loggerCatch(_0x5a32('0x1f2')));delete _0x511180[_0x5a32('0x21')][_0x2cb11a];}}else{return _0x511180[_0x5a32('0x16b')](_0x155911,_0x14bac5);}}else{if(getDiff(_0x14bac5['scheduledat'])<_0x155911[_0x5a32('0x1f4')]*0x3c){if(_0x14bac5['Agent']&&!_0x14bac5[_0x5a32('0x1f5')][_0x5a32('0x1f6')]){_0x511180[_0x5a32('0x1c')][_0x5a32('0x12f')](_0x14bac5['id'])[_0x5a32('0x131')](function(){_0x511180['updateOriginated'](_0x155911);});}else{_0x511180['unlockContact']({'active':![]},_0x14bac5['id'],0x1)[_0x5a32('0x131')](function(){_0x511180['updateOriginated'](_0x155911);});}}else{_0x155911['outboundReCallsDay']+=0x1;_0x511180['updateOriginated'](_0x155911);if(_0x155911[_0x5a32('0x1f7')]){_0x511180[_0x5a32('0xbc')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x14bac5['ContactId'],'ListId':_0x14bac5[_0x5a32('0xce')],'VoiceQueueId':_0x14bac5[_0x5a32('0xd0')]||undefined,'CampaignId':_0x14bac5['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x511180[_0x5a32('0xc7')](createObjHistory(_0x155911,_0x14bac5,'RECALLINQUEUE',0x17,_0x5a32('0x1f8')))[_0x5a32('0xae')](loggerCatch(_0x5a32('0x1f9')));}else{_0x511180[_0x5a32('0xcc')](createObjHistory(_0x155911,_0x14bac5,_0x5a32('0x1fa'),0x16,_0x5a32('0x1fb')),'[Originate][HistoryRecallClose][historyCatch]',_0x5a32('0x1fc'));}}}}else{_0x155911[_0x5a32('0x5f')]+=0x1;_0x511180[_0x5a32('0xcc')](createObjHistory(_0x155911,_0x14bac5,_0x5a32('0x1fd'),0xd,_0x5a32('0x1fe')),_0x5a32('0x1ff'),_0x5a32('0x200'));throw _0x5a32('0x201');}};};Dialer[_0x5a32('0x19')][_0x5a32('0x15c')]=function(_0x16831e){var _0x4b4e09=this;var _0x1a422f=_0x16831e[_0x5a32('0x202')]-_0x16831e[_0x5a32('0x95')]-_0x16831e[_0x5a32('0xc0')];emitCampaignSummary(_0x16831e);if(_0x1a422f>0x0){if(_0x1a422f>this[_0x5a32('0x1f')]){_0x1a422f=this['maxNumberOriginate'];}_0x16831e[_0x5a32('0xc0')]+=_0x1a422f;this[_0x5a32('0xc1')](_0x16831e['id'],_0x1a422f,_0x16831e[_0x5a32('0x203')],_0x16831e)[_0x5a32('0xb5')](function(_0x145f76){_0x16831e[_0x5a32('0xc0')]-=_0x1a422f;_0x16831e[_0x5a32('0xc0')]=_0x16831e['temp']>0x0?_0x16831e[_0x5a32('0xc0')]:0x0;if(!checkContactEmpty(_0x145f76)){_0x16831e[_0x5a32('0x3b')]=_0x5a32('0x204');logger['info'](_0x5a32('0x205')+_0x16831e[_0x5a32('0x3d')]);}else{_0x16831e[_0x5a32('0x95')]+=_0x145f76['length'];_0x16831e[_0x5a32('0x3b')]=_0x5a32('0x206');for(var _0x121875=0x0;_0x121875<_0x145f76['length'];_0x121875+=0x1){_0x16831e['ivrTotalCallsDays']+=0x1;if(_['isNil'](_0x145f76[_0x121875])||_[_0x5a32('0xab')](_0x145f76[_0x121875][_0x5a32('0x16e')])||_['isNil'](_0x145f76[_0x121875][_0x5a32('0x16e')][_0x5a32('0x16f')])){_0x4b4e09[_0x5a32('0xcb')]('[actionOriginate]\x20',_0x16831e,_0x145f76[_0x121875]);}else{_0x4b4e09[_0x5a32('0xb8')](_[_0x5a32('0xcd')](_0x145f76[_0x121875],['CampaignId',_0x5a32('0x207')]))[_0x5a32('0xb5')](_0x4b4e09[_0x5a32('0x1ed')](_0x16831e,_0x145f76[_0x121875]))[_0x5a32('0xae')](_0x4b4e09[_0x5a32('0xca')]('[actionOriginateIvr]\x20',_0x16831e));}}}})[_0x5a32('0xae')](loggerGetContactDialer(_0x5a32('0x208'),_0x16831e,_0x1a422f));}};Dialer['prototype'][_0x5a32('0x156')]=function(_0x275540,_0x5e5b2a){var _0x103487=this;var _0x2fe656=[];var _0x2b902e=_0x5e5b2a>=0x1?_0x5e5b2a:0x1;if(_0x275540[_0x5a32('0x59')]===_0x5a32('0x6')){_0x2b902e=0x1;}var _0x3075fd=Math[_0x5a32('0x1d0')](_0x275540[_0x5a32('0x4e')]*_0x2b902e)-_0x275540['originated']-_0x275540[_0x5a32('0xc0')];emitVoiceQueueSummary(_0x275540);if(_0x275540[_0x5a32('0x209')]>0x0){var _0x954de3=_0x275540[_0x5a32('0x209')]-_0x275540['originated']-_0x275540[_0x5a32('0x52')]-_0x275540[_0x5a32('0xc0')]-_0x275540[_0x5a32('0x50')];if(_0x3075fd>_0x954de3){_0x3075fd=_0x954de3;}}if(_0x3075fd>0x0){if(_0x275540['dialMethod']===_0x5a32('0x6')){_0x3075fd=0x1;}if(_0x3075fd>this[_0x5a32('0x1f')]){_0x3075fd=this[_0x5a32('0x1f')];}_0x275540[_0x5a32('0xc0')]+=_0x3075fd;for(var _0xf10211 in this[_0x5a32('0x127')]){if(typeof this[_0x5a32('0x127')][_0xf10211]!==_0x5a32('0xa9')){if(this[_0x5a32('0x127')][_0xf10211][_0x5a32('0xe9')]===_0x5a32('0x20a')&&this['agents'][_0xf10211][_0x5a32('0xd6')]===_0x5a32('0xd7')){_0x2fe656['push'](this[_0x5a32('0x127')][_0xf10211]['id']);}}}this[_0x5a32('0xbf')](_0x275540['id'],_0x2fe656,_0x3075fd,_0x275540[_0x5a32('0x203')],_0x275540)['then'](function(_0x5b54d3){_0x275540[_0x5a32('0xc0')]-=_0x3075fd;_0x275540[_0x5a32('0xc0')]=_0x275540[_0x5a32('0xc0')]>0x0?_0x275540[_0x5a32('0xc0')]:0x0;if(!checkContactEmpty(_0x5b54d3)){_0x103487['countReScheduled'](_0x275540)[_0x5a32('0xb5')](sendMessageReschedule(_0x275540))[_0x5a32('0xae')](loggerCatch(_0x5a32('0x20b')));}else{_0x275540['originated']+=_0x5b54d3['length'];_0x275540[_0x5a32('0x3b')]=_0x275540[_0x5a32('0x59')]===_0x5a32('0x6')?'ACTIVE':_0x5a32('0x206');for(var _0x36c210=0x0;_0x36c210<_0x5b54d3[_0x5a32('0x133')];_0x36c210+=0x1){if(_[_0x5a32('0xab')](_0x5b54d3[_0x36c210])||_['isNil'](_0x5b54d3[_0x36c210][_0x5a32('0x16e')])||_[_0x5a32('0xab')](_0x5b54d3[_0x36c210][_0x5a32('0x16e')][_0x5a32('0x16f')])){_0x103487[_0x5a32('0xcb')]('[actionOriginate]\x20',_0x275540,_0x5b54d3[_0x36c210]);}else{_0x103487[_0x5a32('0xb6')](_[_0x5a32('0xcd')](_0x5b54d3[_0x36c210],[_0x5a32('0xd0'),_0x5a32('0x207')]))[_0x5a32('0xb5')](_0x103487[_0x5a32('0x1ed')](_0x275540,_0x5b54d3[_0x36c210]))['catch'](_0x103487[_0x5a32('0xca')]('[actionOriginate]\x20',_0x275540));}}}})[_0x5a32('0xae')](loggerGetContactDialer(_0x5a32('0x20c'),_0x275540,_0x3075fd));}};Dialer[_0x5a32('0x19')][_0x5a32('0x8e')]=function(_0xc0782a){if(_0xc0782a[_0x5a32('0x209')]>0x0){var _0x34ed7e=_0xc0782a['dialLimitQueue']-_0xc0782a[_0x5a32('0x95')]-_0xc0782a['talking'];if(_0x34ed7e>0x0){this[_0x5a32('0x20d')](_0xc0782a);}else{loggerPredictiveCalls[_0x5a32('0x7c')](_0x5a32('0x20e'));}}else{this[_0x5a32('0x20d')](_0xc0782a);}};Dialer[_0x5a32('0x19')][_0x5a32('0x20d')]=function(_0x4e4688){var _0x226fa5=this;var _0x3735c4=[];_0x4e4688['originated']+=0x1;for(var _0x3ef1e0 in this[_0x5a32('0x127')]){if(typeof this[_0x5a32('0x127')][_0x3ef1e0]!=='undefined'){if(this[_0x5a32('0x127')][_0x3ef1e0][_0x5a32('0xe9')]===_0x5a32('0x20a')&&this[_0x5a32('0x127')][_0x3ef1e0]['status']===_0x5a32('0xd7')){_0x3735c4[_0x5a32('0x12a')](this['agents'][_0x3ef1e0]['id']);}}}this[_0x5a32('0xbf')](_0x4e4688['id'],_0x3735c4,0x1,_0x4e4688[_0x5a32('0x203')],_0x4e4688)['then'](function(_0x246819){if(!checkContactEmpty(_0x246819)){checkContactLowerLimitOriginate(_0x4e4688,0x1,0x0);_0x226fa5[_0x5a32('0xb3')](_0x4e4688)[_0x5a32('0xb5')](sendMessageReschedule(_0x4e4688))[_0x5a32('0xae')](loggerCatch(_0x5a32('0x20b')));}else{_0x4e4688[_0x5a32('0x3b')]=_0x5a32('0x206');if(_[_0x5a32('0xab')](_0x246819[0x0])||_[_0x5a32('0xab')](_0x246819[0x0][_0x5a32('0x16e')])||_[_0x5a32('0xab')](_0x246819[0x0][_0x5a32('0x16e')]['phone'])){_0x226fa5['emptyContact']('[actionOriginate]\x20',_0x4e4688,_0x246819[0x0]);}else{_0x226fa5[_0x5a32('0xb6')](_[_0x5a32('0xcd')](_0x246819[0x0],[_0x5a32('0xd0'),'Contact.phone']))[_0x5a32('0xb5')](_0x226fa5[_0x5a32('0x1ed')](_0x4e4688,_0x246819[0x0]))[_0x5a32('0xae')](_0x226fa5[_0x5a32('0xca')](_0x5a32('0x20f'),_0x4e4688));}}})[_0x5a32('0xae')](loggerGetContactDialer(_0x5a32('0x210'),_0x4e4688,0x1));emitVoiceQueueSummary(_0x4e4688);};Dialer[_0x5a32('0x19')][_0x5a32('0x1e1')]=function(_0x2b4f76,_0x3aec06,_0x1cf3dd,_0x216b7c,_0x58408f,_0x9607d3){loggerPredictive[_0x5a32('0x7c')](_0x5a32('0x211'));loggerPredictive[_0x5a32('0x7c')](_0x5a32('0x212'),_0x2b4f76);loggerPredictive['info'](_0x5a32('0x213'),_0x3aec06);loggerPredictive['info']('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',_0x1cf3dd);loggerPredictive[_0x5a32('0x7c')](_0x5a32('0x214'),_0x216b7c);loggerPredictive['info']('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x58408f);loggerPredictive[_0x5a32('0x7c')](_0x5a32('0x83'));return new BPromise(function(_0x2a8014,_0x4b4ece){if(_0x2b4f76<=0x0||isNaN(_0x2b4f76)){return _0x4b4ece(msgResponse(_0x5a32('0x215'),_0x5a32('0x46'),'m\x20=\x20'+_0x2b4f76));}if(_0x1cf3dd<=0x0||isNaN(_0x1cf3dd)){return _0x4b4ece(msgResponse(_0x5a32('0x215'),_0x5a32('0x46'),_0x5a32('0x216')+_0x1cf3dd));}if(_0x216b7c<=0x0||isNaN(_0x216b7c)){return _0x4b4ece(msgResponse(_0x5a32('0x215'),_0x5a32('0x46'),_0x5a32('0x217')+_0x216b7c));}if(_0x3aec06<=0x0||isNaN(_0x3aec06)){return _0x4b4ece(msgResponse(_0x5a32('0x215'),_0x5a32('0x46'),_0x5a32('0x218')+_0x3aec06));}if(_0x58408f<=0x0||isNaN(_0x58408f)){return _0x4b4ece(msgResponse(_0x5a32('0x215'),_0x5a32('0x46'),_0x5a32('0x219')+_0x58408f));}_0x9607d3=_0x9607d3||0x0;var _0xa0087a=0x1/_0x1cf3dd;var _0x157903=0x0;var _0x43f937=0x0;var _0x42edcf=0x0;var _0x4f8588=0x0;for(var _0x18ca3d=0x0;_0x42edcf<_0x58408f;_0x18ca3d+=0x1){_0x43f937=_0x18ca3d/_0x3aec06;_0x157903=(_0x216b7c*_0x43f937+_0x9607d3)/_0xa0087a;_0x42edcf=erlangb(_0x157903,_0x2b4f76);_0x4f8588=_0x157903/_0x2b4f76*(0x1-erlangb(_0x157903,_0x2b4f76));}return _0x2a8014({'erlangCalls':_0x18ca3d,'erlangCallToSecond':_0x3aec06/_0x18ca3d,'erlangAbandonmentRate':_0x42edcf,'erlangBusyFactor':_0x4f8588});});};Dialer[_0x5a32('0x19')][_0x5a32('0x1e3')]=function(_0x47b5ef,_0x2b4fe3,_0x5318c2,_0x1151ab,_0x2498a3,_0x1fe223){loggerPredictive['info'](_0x5a32('0x21a'));loggerPredictive[_0x5a32('0x7c')]('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',_0x47b5ef);loggerPredictive['info'](_0x5a32('0x213'),_0x2b4fe3);loggerPredictive[_0x5a32('0x7c')](_0x5a32('0x21b'),_0x5318c2);loggerPredictive['info'](_0x5a32('0x214'),_0x1151ab);loggerPredictive['info']('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2498a3);loggerPredictive[_0x5a32('0x7c')](_0x5a32('0x83'));return new BPromise(function(_0x408fcc,_0x387b29){if(_0x47b5ef<=0x0||isNaN(_0x47b5ef)){return _0x387b29(msgResponse(_0x5a32('0x21c'),_0x5a32('0x46'),_0x5a32('0x21d')+_0x47b5ef));}if(_0x5318c2<=0x0||isNaN(_0x5318c2)){return _0x387b29(msgResponse(_0x5a32('0x21c'),'Error',_0x5a32('0x216')+_0x5318c2));}if(_0x1151ab<=0x0||isNaN(_0x1151ab)){return _0x387b29(msgResponse(_0x5a32('0x21c'),_0x5a32('0x46'),'p\x20=\x20'+_0x1151ab));}if(_0x2b4fe3<=0x0||isNaN(_0x2b4fe3)){return _0x387b29(msgResponse(_0x5a32('0x21c'),_0x5a32('0x46'),_0x5a32('0x218')+_0x2b4fe3));}if(_0x2498a3<=0x0||isNaN(_0x2498a3)){return _0x387b29(msgResponse(_0x5a32('0x21c'),_0x5a32('0x46'),_0x5a32('0x21e')+_0x2498a3));}_0x1fe223=_0x1fe223||0x0;var _0x335087=0x1/_0x5318c2;var _0x18b8d0=0x0;var _0x2ed4c9=0x0;var _0x2606df=0x0;var _0x72da6b=0x0;for(var _0x4a5bec=0x0;_0x72da6b<_0x2498a3;_0x4a5bec+=0x1){_0x2ed4c9=_0x4a5bec/_0x2b4fe3;_0x18b8d0=(_0x1151ab*_0x2ed4c9+_0x1fe223)/_0x335087;_0x2606df=erlangb(_0x18b8d0,_0x47b5ef);_0x72da6b=_0x18b8d0/_0x47b5ef*(0x1-erlangb(_0x18b8d0,_0x47b5ef));}return _0x408fcc({'erlangCalls':_0x4a5bec,'erlangCallToSecond':_0x2b4fe3/_0x4a5bec,'erlangAbandonmentRate':_0x2606df,'erlangBusyFactor':_0x72da6b});});};module[_0x5a32('0x21f')]=Dialer; \ No newline at end of file +var _0xf408=['dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','format','voice:queue:%s','voice_queue:save','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','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22\x22\x20<>','error','inspect','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','contacts','[getContactDialer2][Empty]','waiting','pTalking','available','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','state','statedesc','endtime','starttime','clearZombieChannels','[uniqueid]','[actions]','undefined','sequence','isNil','Action','status','catch','updateOriginated','queue','ivr','[Dialer][checkChannel][ivr]','countReScheduled','[countReScheduled]\x20','checkIsBlackList','then','[checkIsBlackList]\x20','checkIsBlackListIvr','resolve','[checkIsBlackListIvr]\x20','averageHandleTime','[averageHandleTime]\x20','rescheduleContact','unlockContact','[unlockContact]\x20','getContactDialer','temp','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','saveInDb','pick','ListId','UserId','VoiceQueueId','[emptyContact][createHistory]','[emptyContact]','isSuccess','isTrunkReachable','SIP/%s','unmonitored','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','HangupInAMD','membername','AMD','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','Machine','countmachineretry','countglobal','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','dialGlobalMaxRetry','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','ContactId','CampaignId','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','countagentrejectretry','reason\x2019\x20machine....','ivrAnswerCallsDay','[syncHangupIvr]','AGI','[syncHangupIvr][createHistory]','cause-txt','agent','agiafterat','dialQueueProject2','[syncAgentComplete]','answertime','[syncAgentComplete][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','droptime','predictiveIntervalErlangCallsDroppedCalls','Drop','TIMEOUT','dialDropMaxRetry','dialDropRetryFrequency','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','CALLEREXIT','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','Abandoned','channel','actionid','roundrobin','locked','paused','stateinterface','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','length','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','run','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','resetActiveCalls','syncCampaigns','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','content','true','all','some','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','Timezone:\x20','progressive','power','handlePower','launchHandleIvr','dialGlobalInterval','dialTimezone','checkDialMethod','[syncQueueSummary]','checkIsTrunkReachable','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','getCaller','dialQueueProject','NONE','\x22agi://%s/square,%s\x22','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialAgiAfterHangupAgent','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','XMD-','toUpper','callerid','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdName','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','OriginateError','[originate][error]','originate\x20action\x20Error','responsetime','response','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][Drop]','dialAbandonedMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','callProgressDetecting','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','stateGlobal','NoAnswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','custom:agentbusy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','outboundAbandonedCallsDay','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','outboundRejectCallsDay','custom:agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','reason','Global','[callProgressDetecting]','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMinThreshold','floor','predictiveIntervalMultiplicativeFactor','check\x20predictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','Predictive\x20after\x20first\x20interval','startMethodPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','predictiveIntervalDroppedCallsTimeout','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','loggedIn','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','Queue:\x20','actionOriginate','scheduledat','dialRecallMeTimeout','Agent','RecallInQueue','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][MoveBlacklist]','inBlackList','handleIvr','AVAILABLE_CONTACTS_FINISHED','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','RUNNING','[actionOriginate]\x20','Contact.phone','tryOriginatePredictive','[handlePredictive][limitChannel]','reachable','[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','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','---------------------------','m\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]','exports','util','lodash','bluebird','uuid','md5','ioredis','../../../config/logger','dialer','booked','predictive','predictiveCalls','redis','defaults','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','./action','./history','./final','./agentComplete','./queueCallerAbandon','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','prototype','enqueue','tail','finally','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','agentconnect','syncAgentConnect','queuecallerabandon','syncQueueCallerAbandon','bind','syncOriginateResponse','syncAgentComplete','custom:queuesummary','syncQueueSummary','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','Interval','\x20INTERVAL_IS_NULL','Intervals','INTERVAL_IS_NULL','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','emit','type','outbound','strategy','sumBillable','sumDuration','talking','loggedInDb','dialActive'];(function(_0x5978ac,_0x441ad5){var _0x3cf9b1=function(_0xc1f780){while(--_0xc1f780){_0x5978ac['push'](_0x5978ac['shift']());}};_0x3cf9b1(++_0x441ad5);}(_0xf408,0x1b9));var _0x8f40=function(_0x3fdd09,_0x2853f7){_0x3fdd09=_0x3fdd09-0x0;var _0x2be280=_0xf408[_0x3fdd09];return _0x2be280;};'use strict';var util=require(_0x8f40('0x0'));var _=require(_0x8f40('0x1'));var BPromise=require(_0x8f40('0x2'));var uuid=require(_0x8f40('0x3'));var moment=require('moment');var rr=require('rr');var md5=require(_0x8f40('0x4'));var Redis=require(_0x8f40('0x5'));var ut=require('../preview/util/util');var config=require('../../../config/environment/');var logger=require(_0x8f40('0x6'))(_0x8f40('0x7'));var loggerBooked=require(_0x8f40('0x6'))(_0x8f40('0x8'));var loggerPredictive=require(_0x8f40('0x6'))(_0x8f40('0x9'));var loggerPredictiveCalls=require(_0x8f40('0x6'))(_0x8f40('0xa'));var loggerSyncQueueSummary=require(_0x8f40('0x6'))('syncQueueSummary');var ami=require('../ami');config[_0x8f40('0xb')]=_[_0x8f40('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8f40('0xb')]));var cmHopper=require(_0x8f40('0xd'));var cmHopperHistory=require(_0x8f40('0xe'));var cmHopperBlack=require(_0x8f40('0xf'));var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require(_0x8f40('0x10'));var History=require(_0x8f40('0x11'));var Final=require(_0x8f40('0x12'));var AgentComplete=require(_0x8f40('0x13'));var QueueCallerAbandon=require(_0x8f40('0x14'));var Hangup=require('./hangup');var ipAgi=process[_0x8f40('0x15')][_0x8f40('0x16')]||_0x8f40('0x17');var strategy={'rrmemory':_0x8f40('0x18'),'roundrobin':'roundrobin'};var Sequence=function(){};Sequence[_0x8f40('0x19')][_0x8f40('0x1a')]=function(_0xda282f){this[_0x8f40('0x1b')]=this[_0x8f40('0x1b')]?this[_0x8f40('0x1b')][_0x8f40('0x1c')](_0xda282f):_0xda282f();};function Dialer(_0x5f5378,_0x21209d){this['sequence']=new Sequence();this[_0x8f40('0x1d')]=_0x21209d;this[_0x8f40('0x1e')]=_0x5f5378[_0x8f40('0x1e')];this[_0x8f40('0x1f')]=_0x5f5378[_0x8f40('0x1f')];this[_0x8f40('0x20')]=_0x5f5378[_0x8f40('0x20')];this['trunks']=_0x5f5378[_0x8f40('0x21')];this[_0x8f40('0x22')]=config[_0x8f40('0x22')]||0x2;this[_0x8f40('0x23')]={};this[_0x8f40('0x24')]={};this['contactsId']={};this[_0x8f40('0x25')]={};this[_0x8f40('0x26')]={};this[_0x8f40('0x27')]={};this[_0x8f40('0x28')]={};this[_0x8f40('0x29')]={};this[_0x8f40('0x2a')]={};this['queueBookedRR']={};ami['on'](_0x8f40('0x2b'),this[_0x8f40('0x2c')]['bind'](this));ami['on'](_0x8f40('0x2d'),this[_0x8f40('0x2e')][_0x8f40('0x2f')](this));ami['on']('originateresponse',this[_0x8f40('0x30')][_0x8f40('0x2f')](this));ami['on']('agentcomplete',this[_0x8f40('0x31')][_0x8f40('0x2f')](this));ami['on'](_0x8f40('0x32'),this[_0x8f40('0x33')][_0x8f40('0x2f')](this));ami['on'](_0x8f40('0x34'),this[_0x8f40('0x35')][_0x8f40('0x2f')](this));ami['on'](_0x8f40('0x36'),this[_0x8f40('0x37')]['bind'](this));ami['on'](_0x8f40('0x38'),this[_0x8f40('0x39')][_0x8f40('0x2f')](this));ami['on'](_0x8f40('0x3a'),this[_0x8f40('0x3b')][_0x8f40('0x2f')](this));ami['on'](_0x8f40('0x3c'),this[_0x8f40('0x3d')][_0x8f40('0x2f')](this));this[_0x8f40('0x3e')]();this[_0x8f40('0x3f')]();}function isNotNull(_0x1e27a7){return _0x1e27a7!==null&&!_[_0x8f40('0x40')](_0x1e27a7);}function checkIsLoggedIn(_0x5d03ed,_0x253c93){return function(){if(_0x253c93<=0x0){_0x5d03ed[_0x8f40('0x41')]=_0x8f40('0x42');throw _0x5d03ed[_0x8f40('0x43')]+_0x8f40('0x44');}};}function isActive(_0x101a79){return _0x101a79;}function checkIsActive(_0x35f68d,_0x530974){return function(){if(!isActive(_0x530974)){_0x35f68d['message']=_0x8f40('0x45');throw _0x35f68d[_0x8f40('0x43')]+'\x20NOT\x20Active';}};}function checkInterval(_0x4c342c){return function(){if(!isNotNull(_0x4c342c[_0x8f40('0x46')])){_0x4c342c['message']='INTERVAL_IS_NULL';throw _0x4c342c[_0x8f40('0x43')]+_0x8f40('0x47');}if(!isNotNull(_0x4c342c[_0x8f40('0x46')][_0x8f40('0x48')])){_0x4c342c[_0x8f40('0x41')]=_0x8f40('0x49');throw _0x4c342c[_0x8f40('0x43')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x8f40('0x4a')](_0x4c342c[_0x8f40('0x46')]['Intervals']))){_0x4c342c[_0x8f40('0x41')]=_0x8f40('0x49');throw _0x4c342c[_0x8f40('0x43')]+_0x8f40('0x47');}};}function msgResponse(_0xf26421,_0x55928c,_0x550a5a){return{'action':_0xf26421,'response':_0x55928c,'message':_0x550a5a,'stack':_0x550a5a};}function myreject(_0x15fc84){return function(_0x3c7e1a){return _0x15fc84(msgResponse(_0x8f40('0x4b'),_0x8f40('0x4c'),JSON[_0x8f40('0x4d')](_0x3c7e1a)));};}function getSeconds(_0x49a845,_0x43ad32){var _0x31556a=moment(_0x49a845)[_0x8f40('0x4e')](0x0);var _0x3e4e71=moment(_0x43ad32)[_0x8f40('0x4e')](0x0);return _0x31556a[_0x8f40('0x4f')](_0x3e4e71,_0x8f40('0x50'));}function emit(_0x420390,_0x471904,_0x31d282){io['to'](_0x420390)[_0x8f40('0x51')](_0x471904,_0x31d282);}function emitVoiceQueueSummary(_0x5a2bc6){if(_0x5a2bc6[_0x8f40('0x52')]===_0x8f40('0x53')){var _0x1f09ca={'id':_0x5a2bc6['id'],'name':_0x5a2bc6[_0x8f40('0x43')],'strategy':_0x5a2bc6[_0x8f40('0x54')],'answered':_0x5a2bc6['answered'],'available':_0x5a2bc6['available'],'loggedIn':_0x5a2bc6['loggedIn'],'pTalking':_0x5a2bc6['pTalking'],'sumBillable':_0x5a2bc6[_0x8f40('0x55')],'sumDuration':_0x5a2bc6[_0x8f40('0x56')],'sumHoldTime':_0x5a2bc6['sumHoldTime']||0x0,'talking':_0x5a2bc6[_0x8f40('0x57')],'total':_0x5a2bc6['total'],'type':_0x5a2bc6[_0x8f40('0x52')],'unmanaged':_0x5a2bc6['unmanaged'],'abandoned':_0x5a2bc6['abandoned'],'waiting':_0x5a2bc6['waiting'],'loggedInDb':_0x5a2bc6[_0x8f40('0x58')],'dialActive':_0x5a2bc6[_0x8f40('0x59')],'dialMethod':_0x5a2bc6[_0x8f40('0x5a')],'dialOriginateCallerIdName':_0x5a2bc6['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x5a2bc6[_0x8f40('0x5b')],'dialOriginateTimeout':_0x5a2bc6[_0x8f40('0x5c')],'dialPrefix':_0x5a2bc6[_0x8f40('0x5d')],'outboundAnswerAgiCallsDay':_0x5a2bc6[_0x8f40('0x5e')],'outboundAnswerCallsDay':_0x5a2bc6[_0x8f40('0x5f')],'outboundBlacklistCallsDay':_0x5a2bc6[_0x8f40('0x60')],'outboundBusyCallsDay':_0x5a2bc6[_0x8f40('0x61')],'outboundCongestionCallsDay':_0x5a2bc6['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x5a2bc6[_0x8f40('0x62')],'outboundDropCallsDayCallersExit':_0x5a2bc6[_0x8f40('0x63')],'outboundDropCallsDayTimeout':_0x5a2bc6[_0x8f40('0x64')],'outboundNoAnswerCallsDay':_0x5a2bc6[_0x8f40('0x65')],'outboundNoSuchCallsDay':_0x5a2bc6[_0x8f40('0x66')],'outboundOriginateFailureCallsDay':_0x5a2bc6['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x5a2bc6[_0x8f40('0x67')],'outboundRejectCallsDay':_0x5a2bc6['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x5a2bc6[_0x8f40('0x68')],'predictiveIntervalAnsweredCalls':_0x5a2bc6['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x5a2bc6[_0x8f40('0x69')],'predictiveIntervalAvgTalktime':_0x5a2bc6[_0x8f40('0x6a')],'predictiveIntervalDroppedCallsCallersExit':_0x5a2bc6[_0x8f40('0x6b')],'predictiveIntervalDroppedCallsTimeout':_0x5a2bc6['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x5a2bc6[_0x8f40('0x6c')],'predictiveIntervalErlangCallsDroppedCalls':_0x5a2bc6['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x5a2bc6[_0x8f40('0x6d')],'predictiveIntervalMultiplicativeFactor':_0x5a2bc6['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x5a2bc6['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x5a2bc6[_0x8f40('0x6e')],'predictiveIntervalTotalCalls':_0x5a2bc6[_0x8f40('0x6f')],'message':_0x5a2bc6['message'],'originated':_0x5a2bc6[_0x8f40('0x70')],'erlangCalls':_0x5a2bc6[_0x8f40('0x71')],'erlangCallToSecond':_0x5a2bc6['erlangCallToSecond'],'erlangAbandonmentRate':_0x5a2bc6[_0x8f40('0x72')],'erlangBusyFactor':_0x5a2bc6[_0x8f40('0x73')],'startPredictive':_0x5a2bc6[_0x8f40('0x27')],'startProgressive':_0x5a2bc6[_0x8f40('0x28')]};if(_0x5a2bc6['Trunk']){_0x1f09ca[_0x8f40('0x74')]={'id':_0x5a2bc6['Trunk']['id'],'name':_0x5a2bc6[_0x8f40('0x74')][_0x8f40('0x43')],'active':_0x5a2bc6[_0x8f40('0x74')][_0x8f40('0x75')],'callerid':_0x5a2bc6['Trunk']['callerid']};}if(_0x5a2bc6[_0x8f40('0x46')]){_0x1f09ca[_0x8f40('0x46')]={'id':_0x5a2bc6[_0x8f40('0x46')]['id'],'name':_0x5a2bc6[_0x8f40('0x46')][_0x8f40('0x43')]};}var _0x2c03c5=md5(JSON[_0x8f40('0x4d')](_0x1f09ca));if(_0x5a2bc6[_0x8f40('0x4')]!==_0x2c03c5){_0x5a2bc6[_0x8f40('0x4')]=_0x2c03c5;emit(util[_0x8f40('0x76')](_0x8f40('0x77'),_0x1f09ca[_0x8f40('0x43')]),_0x8f40('0x78'),_0x1f09ca);}}}function emitCampaignSummary(_0x4e5f3c){if(_0x4e5f3c[_0x8f40('0x52')]==='ivr'){emit(util[_0x8f40('0x76')](_0x8f40('0x79'),_0x4e5f3c[_0x8f40('0x43')]),_0x8f40('0x7a'),_0x4e5f3c);}}function checkGetDataPredictive(_0x59300d){if(isNotNull(_0x59300d)&&!_[_0x8f40('0x4a')](_0x59300d)){loggerPredictive[_0x8f40('0x7b')](_0x8f40('0x7c'));loggerPredictive[_0x8f40('0x7b')](_0x8f40('0x7d'),_0x59300d[_0x8f40('0x6f')]);loggerPredictive[_0x8f40('0x7b')](_0x8f40('0x7e'),_0x59300d[_0x8f40('0x7f')]);loggerPredictive[_0x8f40('0x7b')](_0x8f40('0x80'),_0x59300d['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0x8f40('0x7b')](_0x8f40('0x81'),_0x59300d[_0x8f40('0x6b')]);loggerPredictive[_0x8f40('0x7b')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x59300d[_0x8f40('0x69')]);loggerPredictive[_0x8f40('0x7b')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x59300d[_0x8f40('0x6a')]);loggerPredictive[_0x8f40('0x7b')]('---------------------------');if(_0x59300d[_0x8f40('0x6f')]>0x0){if(!_['isUndefined'](_0x59300d[_0x8f40('0x6a')])&&_0x59300d[_0x8f40('0x6a')]>0x0){return!![];}loggerPredictive[_0x8f40('0x7b')](_0x8f40('0x82'));if(!_['isUndefined'](_0x59300d['predictiveIntervalAvgHoldtime'])&&_0x59300d[_0x8f40('0x69')]>0x0){return!![];}loggerPredictive[_0x8f40('0x7b')](_0x8f40('0x83'));}else{loggerPredictive['info'](_0x8f40('0x84'));}}else{loggerPredictive[_0x8f40('0x7b')](_0x8f40('0x85'));}return![];}function mergeDataErlangB(_0x1030ea){return function(_0x5cf479){loggerPredictive[_0x8f40('0x7b')](_0x8f40('0x86'));loggerPredictive[_0x8f40('0x7b')](_0x8f40('0x87'),_0x5cf479[_0x8f40('0x71')]);loggerPredictive[_0x8f40('0x7b')](_0x8f40('0x88'),_0x5cf479[_0x8f40('0x89')]);loggerPredictive[_0x8f40('0x7b')](_0x8f40('0x8a'),_0x5cf479[_0x8f40('0x72')]);loggerPredictive[_0x8f40('0x7b')](_0x8f40('0x8b'),_0x5cf479[_0x8f40('0x73')]);loggerPredictive[_0x8f40('0x7b')](_0x8f40('0x8a'),_0x5cf479['erlangAbandonmentRate']);loggerPredictive[_0x8f40('0x7b')]('---------------------------');_[_0x8f40('0x8c')](_0x1030ea,_0x5cf479);};}function getDiff(_0x1c9ba3){var _0x268eb6=moment()[_0x8f40('0x4e')](0x0);var _0x3717b1=moment(_0x1c9ba3)[_0x8f40('0x4e')](0x0);return _0x268eb6['diff'](_0x3717b1,_0x8f40('0x50'));}function ifInterval(_0x1778d4,_0x83d099){if(_[_0x8f40('0x40')](_0x83d099)){return![];}return getDiff(_0x83d099)<_0x1778d4*0x3c;}function freeVariablesPredictive(_0x51cc54){if(isNotNull(_0x51cc54)){if(!_['isUndefined'](_0x51cc54[_0x8f40('0x28')])){_0x51cc54[_0x8f40('0x28')]=undefined;loggerPredictive[_0x8f40('0x7b')](_0x51cc54[_0x8f40('0x43')],_0x8f40('0x8d'));}if(!_[_0x8f40('0x40')](_0x51cc54[_0x8f40('0x27')])){_0x51cc54[_0x8f40('0x27')]=undefined;loggerPredictive[_0x8f40('0x7b')](_0x51cc54[_0x8f40('0x43')],_0x8f40('0x8e'));}if(!_[_0x8f40('0x40')](_0x51cc54[_0x8f40('0x8f')])){clearInterval(_0x51cc54['handlePredictive']);_0x51cc54['handlePredictive']=undefined;loggerPredictive[_0x8f40('0x7b')](_0x51cc54[_0x8f40('0x43')],_0x8f40('0x90'));}}}function erlangb(_0x2f7cb2,_0x4ee3a8){if(_0x4ee3a8===0x0){return 0x0;}var _0x3cc0bd=0x1;for(var _0x4cc320=0x1;_0x4cc320<=_0x4ee3a8;_0x4cc320+=0x1){_0x3cc0bd=0x1+_0x3cc0bd*_0x4cc320/_0x2f7cb2;}return 0x1/_0x3cc0bd;}function isVoiceQueueOutbound(_0x2ef238){return _0x2ef238===_0x8f40('0x53');}function isNotPreview(_0x57eea7){return _0x57eea7!=='preview';}function isCampaignIvr(_0x53ec2f){return _0x53ec2f==='ivr';}function getCallerId(_0x24f682,_0x3af8b4,_0x5c1180){if(!_[_0x8f40('0x40')](_0x5c1180)&&typeof _0x5c1180===_0x8f40('0x91')&&!_[_0x8f40('0x4a')](_0x5c1180)){if(!_[_0x8f40('0x40')](_0x3af8b4)&&typeof _0x3af8b4===_0x8f40('0x91')&&!_[_0x8f40('0x4a')](_0x3af8b4)){return util[_0x8f40('0x76')]('\x22%s\x22\x20<%s>',_0x3af8b4,_0x5c1180);}return util[_0x8f40('0x76')]('\x22%s\x22\x20<%s>',_0x5c1180,_0x5c1180);}if(!_[_0x8f40('0x40')](_0x24f682)&&typeof _0x24f682===_0x8f40('0x91')&&!_[_0x8f40('0x4a')](_0x24f682)){return _0x24f682;}return _0x8f40('0x92');}function loggerCatchQueueSummary(_0x47cbaa,_0x5c57c7){return function(_0x536eda){freeVariablesPredictive(_0x5c57c7);emitVoiceQueueSummary(_0x5c57c7);emitCampaignSummary(_0x5c57c7);loggerSyncQueueSummary[_0x8f40('0x93')](_0x47cbaa,util[_0x8f40('0x94')](_0x536eda,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x31d2e8,_0x1e29ff){return function(_0x27f450){loggerPredictive[_0x8f40('0x93')](_0x1e29ff[_0x8f40('0x43')],_0x31d2e8);loggerPredictive[_0x8f40('0x93')](_0x27f450['stack']);freeVariablesPredictive(_0x1e29ff);};}function loggerCatch(_0x1df508){return function(_0x13f8f4){logger[_0x8f40('0x93')](_0x1df508,util['inspect'](_0x13f8f4,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x5e1ff0){return _0x5e1ff0&&!_['isUndefined'](_0x5e1ff0)&&_0x5e1ff0['length']>0x0;}function decremetOriginate(_0x4d38be){if(!_[_0x8f40('0x40')](_0x4d38be)&&_0x4d38be!==null){if(typeof _0x4d38be[_0x8f40('0x70')]!=='undefined'){if(_0x4d38be[_0x8f40('0x70')]>0x0){_0x4d38be[_0x8f40('0x70')]-=0x1;}else{logger[_0x8f40('0x93')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x8f40('0x93')](_0x8f40('0x95'));}}function checkContactLowerLimitOriginate(_0x3576c9,_0x3a64ce,_0x3578ea){if(_0x3a64ce>_0x3578ea){for(var _0x2a7769=0x0;_0x2a7769<_0x3a64ce-_0x3578ea;_0x2a7769+=0x1){decremetOriginate(_0x3576c9);}}}function loggerGetContactDialer(_0x5341eb,_0x513032,_0x2de2e3){return function(_0x5ed7ee){checkContactLowerLimitOriginate(_0x513032,_0x2de2e3,0x0);logger[_0x8f40('0x93')](_0x5341eb,util[_0x8f40('0x94')](_0x5ed7ee,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x1a95e1){return function(_0x45df30){if(isNotNull(_0x45df30)&&isNotNull(_0x45df30[0x0])){if(_0x45df30[0x0][_0x8f40('0x96')]>0x0){_0x1a95e1['message']=_0x8f40('0x97');logger[_0x8f40('0x7b')]('[getContactDialer2][ReScheduled]'+_0x1a95e1[_0x8f40('0x43')],_0x45df30[0x0]['contactsRescheduled'],_0x8f40('0x98'));}else{_0x1a95e1[_0x8f40('0x41')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x8f40('0x7b')](_0x8f40('0x99')+_0x1a95e1[_0x8f40('0x43')]);}}};}function notSendMessagesQueue(_0x39538b){if(_0x39538b['sendMessageOneNotActive']){freeVariablesPredictive(_0x39538b);if(_0x39538b[_0x8f40('0x70')]===0x0&&_0x39538b['talking']===0x0&&_0x39538b[_0x8f40('0x9a')]===0x0&&(_0x39538b[_0x8f40('0x9b')]||0x0)===0x0){_0x39538b['sendMessageOneNotActive']=![];_0x39538b[_0x8f40('0x9c')]=0x0;_0x39538b[_0x8f40('0x41')]=_0x8f40('0x45');loggerSyncQueueSummary[_0x8f40('0x93')](_0x8f40('0x9d'),_0x39538b[_0x8f40('0x43')],_0x8f40('0x9e'));}else{_0x39538b['message']=_0x8f40('0x9f');loggerSyncQueueSummary[_0x8f40('0x93')](_0x8f40('0x9d'),_0x39538b[_0x8f40('0x43')],'is\x20disactive');}emitVoiceQueueSummary(_0x39538b);}}function notSendMessagesCampaign(_0x602c17){if(_0x602c17['sendMessageOneNotActive']){if(_0x602c17[_0x8f40('0x70')]===0x0){_0x602c17[_0x8f40('0xa0')]=![];_0x602c17[_0x8f40('0x41')]='NOT_ACTIVE';loggerSyncQueueSummary[_0x8f40('0x93')](_0x8f40('0xa1'),_0x602c17['name'],'is\x20not\x20active');}else{_0x602c17[_0x8f40('0x41')]=_0x8f40('0x9f');loggerSyncQueueSummary[_0x8f40('0x93')](_0x8f40('0xa1'),_0x602c17[_0x8f40('0x43')],_0x8f40('0xa2'));}emitCampaignSummary(_0x602c17);}}function createObjHistory(_0x591390,_0x4c8baf,_0x385082,_0x2e597d,_0x1bb40f){_0x591390[_0x8f40('0x41')]=_0x385082;var _0x31e31e=new Action(_0x591390,_0x4c8baf);var _0x47fe9c=new History(_0x31e31e);_0x47fe9c[_0x8f40('0xa3')]=_0x2e597d;_0x47fe9c[_0x8f40('0xa4')]=_0x1bb40f;_0x47fe9c[_0x8f40('0xa5')]=_0x31e31e[_0x8f40('0xa6')];return _0x47fe9c;}Dialer['prototype'][_0x8f40('0x3f')]=function(){var _0x3be946=this;setInterval(function(){_0x3be946[_0x8f40('0xa7')](_0x3be946['uniqueId'],_0x8f40('0xa8'));_0x3be946[_0x8f40('0xa7')](_0x3be946[_0x8f40('0x24')],_0x8f40('0xa9'));},0x32c8);};Dialer['prototype']['clearZombieChannels']=function(_0x24f932,_0x2e644e){var _0x2a9655=this;for(var _0x3c3647 in _0x24f932){if(typeof _0x24f932[_0x3c3647]!==_0x8f40('0xaa')){this[_0x8f40('0xab')][_0x8f40('0x1a')](function(){if(!_[_0x8f40('0xac')](_0x24f932[_0x3c3647])){return ami[_0x8f40('0xad')]({'action':_0x8f40('0xae'),'channel':_0x24f932[_0x3c3647]['channel']})[_0x8f40('0xaf')](function(_0x562010){if(_0x562010[_0x8f40('0x41')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x24f932[_0x3c3647]&&_0x24f932[_0x3c3647][_0x8f40('0x52')]!=='ivr'){_0x2a9655[_0x8f40('0xb0')](_0x2a9655[_0x8f40('0x1e')][_0x24f932[_0x3c3647][_0x8f40('0xb1')]]);logger[_0x8f40('0x93')]('[Dialer][checkChannel]',_0x2e644e,_0x3c3647,_0x24f932[_0x3c3647][_0x8f40('0xb1')]);delete _0x24f932[_0x3c3647];}if(_0x24f932[_0x3c3647]&&_0x24f932[_0x3c3647][_0x8f40('0x52')]===_0x8f40('0xb2')){_0x2a9655['updateOriginated'](_0x2a9655[_0x8f40('0x1f')][_0x24f932[_0x3c3647]['queue']]);logger[_0x8f40('0x93')](_0x8f40('0xb3'),_0x2e644e,_0x3c3647,_0x24f932[_0x3c3647]['queue']);delete _0x24f932[_0x3c3647];}},0x2328);}});}});}}};Dialer[_0x8f40('0x19')][_0x8f40('0xb4')]=function(_0x328e39){return BPromise['resolve']()['then'](cmHopper[_0x8f40('0xb4')](_0x328e39))[_0x8f40('0xaf')](loggerCatch(_0x8f40('0xb5')));};Dialer[_0x8f40('0x19')][_0x8f40('0xb6')]=function(_0x397204){return BPromise['resolve']()[_0x8f40('0xb7')](cmHopperBlack[_0x8f40('0xb6')](_0x397204))[_0x8f40('0xaf')](loggerCatch(_0x8f40('0xb8')));};Dialer[_0x8f40('0x19')][_0x8f40('0xb9')]=function(_0x52ed95){return BPromise[_0x8f40('0xba')]()['then'](cmHopperBlack[_0x8f40('0xb9')](_0x52ed95))[_0x8f40('0xaf')](loggerCatch(_0x8f40('0xbb')));};Dialer[_0x8f40('0x19')][_0x8f40('0xbc')]=function(_0x2a00e1){return BPromise[_0x8f40('0xba')]()['then'](cmHopperHistory['avgHandleTime'](_0x2a00e1))['catch'](loggerCatch(_0x8f40('0xbd')));};Dialer[_0x8f40('0x19')][_0x8f40('0xbe')]=function(_0x4e8100){return BPromise[_0x8f40('0xba')]()['then'](cmHopper['rescheduleContact'](_0x4e8100))[_0x8f40('0xaf')](loggerCatch('[rescheduleContact]\x20'));};Dialer[_0x8f40('0x19')][_0x8f40('0xbf')]=function(_0x2e2762,_0x8c016c,_0x1a854f){return BPromise[_0x8f40('0xba')]()[_0x8f40('0xb7')](cmHopper['unlockContact'](_0x2e2762,_0x8c016c,_0x1a854f))[_0x8f40('0xaf')](loggerCatch(_0x8f40('0xc0')));};Dialer['prototype']['getContactDialer']=function(_0x4e678c,_0x471c2d,_0x3fe7b4,_0x3025ca,_0x24e6c4){return BPromise[_0x8f40('0xba')]()[_0x8f40('0xb7')](cmHopper[_0x8f40('0xc1')](_0x4e678c,_0x471c2d,_0x3fe7b4,_0x3025ca))[_0x8f40('0xaf')](function(_0x3dad1e){_0x24e6c4['temp']-=_0x3fe7b4;_0x24e6c4[_0x8f40('0xc2')]=_0x24e6c4[_0x8f40('0xc2')]>0x0?_0x24e6c4[_0x8f40('0xc2')]:0x0;loggerCatch('[getContactDialer]\x20')(_0x3dad1e);});};Dialer['prototype'][_0x8f40('0xc3')]=function(_0x521dd8,_0x36c66a,_0x546295,_0x2dc816){return BPromise['resolve']()[_0x8f40('0xb7')](cmHopper['getContactDialerIvr'](_0x521dd8,_0x36c66a,_0x546295))[_0x8f40('0xaf')](function(_0x5b8f50){_0x2dc816[_0x8f40('0xc2')]-=_0x36c66a;_0x2dc816[_0x8f40('0xc2')]=_0x2dc816[_0x8f40('0xc2')]>0x0?_0x2dc816[_0x8f40('0xc2')]:0x0;loggerCatch(_0x8f40('0xc4'))(_0x5b8f50);});};Dialer[_0x8f40('0x19')]['getVoiceQueueRtPauses']=function(_0x11d04d){return BPromise['resolve']()[_0x8f40('0xb7')](voiceQueueRt[_0x8f40('0xc5')](_0x11d04d))[_0x8f40('0xaf')](loggerCatch(_0x8f40('0xc6')));};Dialer['prototype']['moveContactManagedDialer']=function(_0x578d35){return BPromise['resolve']()[_0x8f40('0xb7')](cmHopper[_0x8f40('0xc7')](_0x578d35))[_0x8f40('0xaf')](loggerCatch(_0x8f40('0xc8')));};Dialer[_0x8f40('0x19')][_0x8f40('0xc9')]=function(_0x354bc8){return BPromise['resolve']()[_0x8f40('0xb7')](cmHopperHistory[_0x8f40('0xc9')](_0x354bc8))['catch'](loggerCatch(_0x8f40('0xca')));};Dialer[_0x8f40('0x19')][_0x8f40('0xb0')]=function(_0x779808){if(!_['isUndefined'](_0x779808)&&_0x779808!==null){if(typeof _0x779808[_0x8f40('0x70')]!==_0x8f40('0xaa')){if(_0x779808[_0x8f40('0x70')]>0x0){_0x779808[_0x8f40('0x70')]-=0x1;}else{logger[_0x8f40('0x93')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x8f40('0x93')](_0x8f40('0xcb'));}};Dialer[_0x8f40('0x19')][_0x8f40('0xcc')]=function(_0x4a5004,_0x27da89){var _0x10fe7e=this;return function(_0x3bf6a2){_0x10fe7e['updateOriginated'](_0x27da89);logger['error'](_0x4a5004,util[_0x8f40('0x94')](_0x3bf6a2,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0x8f40('0xcd')]=function(_0x86e081,_0x2ebfe8,_0x183cfd){var _0x32f5f6={'state':0x19,'statedesc':'notFound'};this[_0x8f40('0xb0')](_0x2ebfe8);this[_0x8f40('0xce')](_['merge'](_0x32f5f6,_[_0x8f40('0xcf')](_0x183cfd,['ContactId',_0x8f40('0xd0'),_0x8f40('0xd1'),_0x8f40('0xd2'),'CampaignId'])),_0x8f40('0xd3'),_0x8f40('0xd4'));logger['error'](_0x86e081);};Dialer['prototype'][_0x8f40('0xd5')]=function(_0x2cee7e){return _0x2cee7e==='Success';};Dialer[_0x8f40('0x19')][_0x8f40('0xd6')]=function(_0x106b7d){return!_[_0x8f40('0x40')](_0x106b7d)&&_0x106b7d&&!_[_0x8f40('0x40')](_0x106b7d['name'])&&!_['isUndefined'](_0x106b7d[_0x8f40('0x75')])&&_0x106b7d[_0x8f40('0x75')]&&(this[_0x8f40('0x21')][util[_0x8f40('0x76')](_0x8f40('0xd7'),_0x106b7d[_0x8f40('0x43')])][_0x8f40('0xae')]==='reachable'||this[_0x8f40('0x21')][util[_0x8f40('0x76')](_0x8f40('0xd7'),_0x106b7d[_0x8f40('0x43')])][_0x8f40('0xae')]===_0x8f40('0xd8'));};Dialer[_0x8f40('0x19')][_0x8f40('0xce')]=function(_0x2689f3,_0x283120,_0x5bf035){this[_0x8f40('0xc9')](_0x2689f3)[_0x8f40('0xaf')](loggerCatch(_0x283120));this['moveContactManagedDialer'](_0x2689f3)[_0x8f40('0xaf')](loggerCatch(_0x5bf035));};Dialer[_0x8f40('0x19')][_0x8f40('0x39')]=function(_0x8edc83){var _0x930485=this[_0x8f40('0x25')][_0x8edc83[_0x8f40('0xd9')]];var _0x358b1c;if(!_[_0x8f40('0xac')](_0x8edc83)&&!_[_0x8f40('0xac')](_0x8edc83['variable'])&&!_[_0x8f40('0xac')](_0x8edc83[_0x8f40('0xda')][_0x8f40('0xdb')])&&_0x8edc83[_0x8f40('0xdc')]===_0x8f40('0xdd')&&_0x930485){if(_0x930485[_0x8f40('0x52')]!=='ivr'&&this['voiceQueues'][_0x930485[_0x8f40('0xb1')]][_0x8f40('0xde')]&&_0x8edc83[_0x8f40('0xdf')]===_0x8f40('0xe0')){delete this['uniqueId'][_0x8edc83[_0x8f40('0xd9')]];this[_0x8f40('0xb0')](this[_0x8f40('0x1e')][_0x930485[_0x8f40('0xb1')]]);this[_0x8f40('0x1e')][_0x930485[_0x8f40('0xb1')]][_0x8f40('0x5f')]+=0x1;this[_0x8f40('0x1e')][_0x930485[_0x8f40('0xb1')]]['outboundAnswerAgiCallsDay']+=0x1;_0x358b1c=new Hangup(_0x930485,_0x8edc83);_0x358b1c[_0x8f40('0xa3')]=0x12;_0x358b1c[_0x8f40('0xa4')]=_0x8f40('0xe1');_0x358b1c[_0x8f40('0xe2')]=_0x8f40('0xe3');ami[_0x8f40('0x51')](_0x8f40('0xe4'),ut[_0x8f40('0xe5')](_0x358b1c,_0x8f40('0xe6')));this[_0x8f40('0xce')](_0x358b1c,_0x8f40('0xe7'),'[syncHangupInAMD]');}if(_0x930485['type']!=='ivr'&&this['voiceQueues'][_0x930485['queue']][_0x8f40('0xde')]&&_0x8edc83[_0x8f40('0xdf')]==='MACHINE'){var _0x1e2ac2=this;return new BPromise(function(_0x427132,_0x314903){delete _0x1e2ac2['uniqueId'][_0x8edc83['uniqueid']];_0x1e2ac2[_0x8f40('0xb0')](_0x1e2ac2[_0x8f40('0x1e')][_0x930485[_0x8f40('0xb1')]]);_0x1e2ac2[_0x8f40('0x1e')][_0x930485['queue']][_0x8f40('0x5f')]+=0x1;_0x1e2ac2[_0x8f40('0x1e')][_0x930485[_0x8f40('0xb1')]][_0x8f40('0x5e')]+=0x1;var _0x2b8218=_0x1e2ac2[_0x8f40('0x1e')][_0x930485[_0x8f40('0xb1')]];var _0x2dee25=new Hangup(_0x930485,_0x8edc83);_0x2dee25['state']=0x13;_0x2dee25[_0x8f40('0xa4')]=_0x8f40('0xe8');_0x2dee25['membername']=_0x8f40('0xe3');_0x2dee25[_0x8f40('0xe9')]+=0x1;_0x2dee25[_0x8f40('0xea')]+=0x1;_0x2dee25[_0x8f40('0xe6')]=!![];ami[_0x8f40('0x51')](_0x8f40('0xe4'),ut[_0x8f40('0xe5')](_0x2dee25,_0x8f40('0xe6')));_0x1e2ac2[_0x8f40('0xc9')](_0x2dee25)[_0x8f40('0xaf')](loggerCatch(_0x8f40('0xeb')));if(_0x2dee25[_0x8f40('0xec')]+_0x2dee25[_0x8f40('0xed')]+_0x2dee25[_0x8f40('0xee')]+_0x2dee25[_0x8f40('0xef')]+_0x2dee25[_0x8f40('0xf0')]+_0x2dee25[_0x8f40('0xf1')]+_0x2dee25['countmachineretry']+_0x2dee25['countagentrejectretry']>=_0x2b8218[_0x8f40('0xf2')]){_0x1e2ac2['stateGlobal'](_0x2dee25,_0x427132,_0x314903,_0x8f40('0xf3'));}else{if(_0x2dee25['countmachineretry']>=_0x2b8218[_0x8f40('0xf4')]){_0x1e2ac2[_0x8f40('0xf5')](_0x2dee25,_0x427132,_0x314903,'reason\x2019\x20machine....');}else{_0x1e2ac2[_0x8f40('0xbe')]({'active':![],'countmachineretry':_0x2dee25[_0x8f40('0xe9')],'scheduledat':moment()[_0x8f40('0xf6')](_0x2b8218[_0x8f40('0xf7')],_0x8f40('0xf8'))[_0x8f40('0x76')](_0x8f40('0xf9')),'ContactId':_0x2dee25[_0x8f40('0xfa')],'ListId':_0x2dee25[_0x8f40('0xd0')],'VoiceQueueId':_0x2dee25['VoiceQueueId']||undefined,'CampaignId':_0x2dee25[_0x8f40('0xfb')]||undefined})[_0x8f40('0xaf')](loggerCatch(_0x8f40('0xfc')));_0x427132({'reschedule':0x1});}}});}if(_0x930485['type']===_0x8f40('0xb2')&&this[_0x8f40('0x1f')][_0x930485[_0x8f40('0xb1')]][_0x8f40('0xde')]&&_0x8edc83[_0x8f40('0xdf')]===_0x8f40('0xe0')){delete this[_0x8f40('0x25')][_0x8edc83['uniqueid']];this[_0x8f40('0xb0')](this['campaigns'][_0x930485[_0x8f40('0xb1')]]);_0x358b1c=new Hangup(_0x930485,_0x8edc83);_0x358b1c[_0x8f40('0xa3')]=0x12;_0x358b1c[_0x8f40('0xa4')]=_0x8f40('0xe1');_0x358b1c['membername']=_0x8f40('0xe3');ami[_0x8f40('0x51')](_0x8f40('0xe4'),ut[_0x8f40('0xe5')](_0x358b1c,_0x8f40('0xe6')));this[_0x8f40('0xce')](_0x358b1c,_0x8f40('0xfd'),'[syncHangupInAMDIvr]');}if(_0x930485['type']===_0x8f40('0xb2')&&this['campaigns'][_0x930485[_0x8f40('0xb1')]][_0x8f40('0xde')]&&_0x8edc83[_0x8f40('0xdf')]==='MACHINE'){var _0x1e2ac2=this;return new BPromise(function(_0x34b5fa,_0x15aec9){delete _0x1e2ac2[_0x8f40('0x25')][_0x8edc83[_0x8f40('0xd9')]];_0x1e2ac2[_0x8f40('0xb0')](_0x1e2ac2[_0x8f40('0x1f')][_0x930485[_0x8f40('0xb1')]]);_0x1e2ac2[_0x8f40('0x1f')][_0x930485[_0x8f40('0xb1')]][_0x8f40('0x5f')]+=0x1;_0x1e2ac2[_0x8f40('0x1f')][_0x930485['queue']]['outboundAnswerAgiCallsDay']+=0x1;var _0xcfb63d=_0x1e2ac2[_0x8f40('0x1f')][_0x930485[_0x8f40('0xb1')]];var _0x465336=new Hangup(_0x930485,_0x8edc83);_0x465336[_0x8f40('0xa3')]=0x13;_0x465336[_0x8f40('0xa4')]=_0x8f40('0xe8');_0x465336[_0x8f40('0xe2')]=_0x8f40('0xe3');_0x465336[_0x8f40('0xe9')]+=0x1;_0x465336[_0x8f40('0xea')]+=0x1;_0x465336[_0x8f40('0xe6')]=!![];ami[_0x8f40('0x51')](_0x8f40('0xe4'),ut[_0x8f40('0xe5')](_0x465336,_0x8f40('0xe6')));_0x1e2ac2[_0x8f40('0xc9')](_0x465336)[_0x8f40('0xaf')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x465336[_0x8f40('0xec')]+_0x465336['countcongestionretry']+_0x465336[_0x8f40('0xee')]+_0x465336[_0x8f40('0xef')]+_0x465336['countdropretry']+_0x465336[_0x8f40('0xf1')]+_0x465336[_0x8f40('0xe9')]+_0x465336[_0x8f40('0xfe')]>=_0xcfb63d['dialGlobalMaxRetry']){_0x1e2ac2['stateGlobal'](_0x465336,_0x34b5fa,_0x15aec9,_0x8f40('0xf3'));}else{if(_0x465336[_0x8f40('0xe9')]>=_0xcfb63d['dialMachineMaxRetry']){_0x1e2ac2[_0x8f40('0xf5')](_0x465336,_0x34b5fa,_0x15aec9,_0x8f40('0xff'));}else{_0x1e2ac2['rescheduleContact']({'active':![],'countmachineretry':_0x465336[_0x8f40('0xe9')],'scheduledat':moment()['add'](_0xcfb63d[_0x8f40('0xf7')],_0x8f40('0xf8'))[_0x8f40('0x76')](_0x8f40('0xf9')),'ContactId':_0x465336[_0x8f40('0xfa')],'ListId':_0x465336['ListId'],'VoiceQueueId':_0x465336[_0x8f40('0xd2')]||undefined,'CampaignId':_0x465336[_0x8f40('0xfb')]||undefined})['catch'](loggerCatch(_0x8f40('0xfc')));_0x34b5fa({'reschedule':0x1});}}});}}};Dialer[_0x8f40('0x19')]['syncHangup']=function(_0x1decc2){var _0x2e0975=this['uniqueId'][_0x1decc2[_0x8f40('0xd9')]];var _0x24534e=this;var _0xd8d38c;if(_0x2e0975&&_0x2e0975['type']===_0x8f40('0xb2')){delete this[_0x8f40('0x25')][_0x1decc2[_0x8f40('0xd9')]];this[_0x8f40('0xb0')](this['campaigns'][_0x2e0975[_0x8f40('0xb1')]]);this[_0x8f40('0x1f')][_0x2e0975['queue']][_0x8f40('0x100')]+=0x1;_0xd8d38c=new Hangup(_0x2e0975,_0x1decc2);this[_0x8f40('0xc9')](_0xd8d38c)[_0x8f40('0xaf')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x8f40('0xc7')](_0xd8d38c)[_0x8f40('0xaf')](loggerCatch(_0x8f40('0x101')));}if(_0x2e0975&&_0x2e0975[_0x8f40('0x52')]!=='ivr'&&isNotNull(this['voiceQueues'][_0x2e0975[_0x8f40('0xb1')]]['dialQueueProject'])){delete this[_0x8f40('0x25')][_0x1decc2[_0x8f40('0xd9')]];this[_0x8f40('0xb0')](this[_0x8f40('0x1e')][_0x2e0975[_0x8f40('0xb1')]]);this['voiceQueues'][_0x2e0975[_0x8f40('0xb1')]][_0x8f40('0x5f')]+=0x1;this[_0x8f40('0x1e')][_0x2e0975[_0x8f40('0xb1')]][_0x8f40('0x5e')]+=0x1;_0xd8d38c=new Hangup(_0x2e0975,_0x1decc2);_0xd8d38c[_0x8f40('0xa3')]=0x10;_0xd8d38c[_0x8f40('0xa4')]='AnswerAGI';_0xd8d38c[_0x8f40('0xe2')]=_0x8f40('0x102');this['createHistory'](_0xd8d38c)['catch'](loggerCatch(_0x8f40('0x103')));this[_0x8f40('0xc7')](_0xd8d38c)['catch'](loggerCatch(_0x8f40('0x101')));}if(_0x2e0975&&_0x2e0975[_0x8f40('0x52')]!=='ivr'&&!isNotNull(this[_0x8f40('0x1e')][_0x2e0975['queue']]['dialQueueProject'])){delete this[_0x8f40('0x25')][_0x1decc2[_0x8f40('0xd9')]];this[_0x8f40('0xb0')](this[_0x8f40('0x1e')][_0x2e0975[_0x8f40('0xb1')]]);this[_0x8f40('0x1e')][_0x2e0975[_0x8f40('0xb1')]][_0x8f40('0x68')]+=0x1;_0xd8d38c=new Hangup(_0x2e0975,_0x1decc2);_0xd8d38c[_0x8f40('0xa3')]=0xc;_0xd8d38c[_0x8f40('0xa4')]=_0x1decc2[_0x8f40('0x104')];_0xd8d38c[_0x8f40('0xe2')]='Unknow';this[_0x8f40('0xc9')](_0xd8d38c)[_0x8f40('0xaf')](loggerCatch(_0x8f40('0x103')));this[_0x8f40('0xc7')](_0xd8d38c)['catch'](loggerCatch(_0x8f40('0x101')));}};Dialer[_0x8f40('0x19')]['syncAgentComplete']=function(_0xe447a2){var _0x5d3c19=this[_0x8f40('0x25')][_0xe447a2['uniqueid']];var _0x1a7caf=this;if(this[_0x8f40('0x1e')][_0xe447a2[_0x8f40('0xb1')]]){if(_0x5d3c19&&_0x5d3c19[_0x8f40('0x52')]!==_0x8f40('0xb2')){delete this[_0x8f40('0x25')][_0xe447a2['uniqueid']];this[_0x8f40('0x1e')][_0xe447a2[_0x8f40('0xb1')]][_0x8f40('0x5f')]+=0x1;var _0x41ee4a=new AgentComplete(_0x5d3c19,_0xe447a2);if(_0xe447a2['reason']===_0x8f40('0x105')){_0x41ee4a[_0x8f40('0x106')]=this[_0x8f40('0x1e')][_0xe447a2[_0x8f40('0xb1')]][_0x8f40('0x107')]&&this['voiceQueues'][_0xe447a2[_0x8f40('0xb1')]]['dialAgiAfterHangupAgent']?moment()[_0x8f40('0x76')](_0x8f40('0xf9')):undefined;}this[_0x8f40('0xc9')](_0x41ee4a)[_0x8f40('0xaf')](loggerCatch('[syncAgentComplete][createHistory]'));this['moveContactManagedDialer'](_0x41ee4a)[_0x8f40('0xaf')](loggerCatch(_0x8f40('0x108')));}}};Dialer[_0x8f40('0x19')]['syncAgentConnect']=function(_0x5e6e64){if(this[_0x8f40('0x1e')][_0x5e6e64[_0x8f40('0xb1')]]){if(this[_0x8f40('0x25')][_0x5e6e64['uniqueid']]&&this[_0x8f40('0x25')][_0x5e6e64[_0x8f40('0xd9')]][_0x8f40('0x52')]!==_0x8f40('0xb2')){this[_0x8f40('0xb0')](this[_0x8f40('0x1e')][_0x5e6e64[_0x8f40('0xb1')]]);this[_0x8f40('0x25')][_0x5e6e64[_0x8f40('0xd9')]][_0x8f40('0x109')]=moment()[_0x8f40('0x76')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer['prototype']['queueCallerAbandonCreateState']=function(_0x102c5c){this['createHistory'](_0x102c5c)['catch'](loggerCatch(_0x8f40('0x10a')));this['moveContactManagedDialer'](_0x102c5c)[_0x8f40('0xaf')](loggerCatch(_0x8f40('0x10b')));};Dialer[_0x8f40('0x19')][_0x8f40('0x2e')]=function(_0x49535a){var _0x43cb21=this[_0x8f40('0x25')][_0x49535a['uniqueid']];var _0x171503=this;if(this['voiceQueues'][_0x49535a[_0x8f40('0xb1')]]){if(_0x43cb21&&_0x43cb21[_0x8f40('0x52')]!==_0x8f40('0xb2')){delete this['uniqueId'][_0x49535a['uniqueid']];this[_0x8f40('0xb0')](this[_0x8f40('0x1e')][_0x49535a['queue']]);_0x43cb21[_0x8f40('0x10c')]=moment()[_0x8f40('0x76')](_0x8f40('0xf9'));var _0x51cdbb=new QueueCallerAbandon(_0x43cb21,_0x49535a);if(getSeconds(_0x43cb21[_0x8f40('0x10c')],_0x43cb21['responsetime'])>=_0x43cb21['dialQueueTimeout']){this[_0x8f40('0x1e')][_0x49535a['queue']]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0x8f40('0x1e')][_0x49535a[_0x8f40('0xb1')]][_0x8f40('0x64')]+=0x1;this[_0x8f40('0x1e')][_0x49535a[_0x8f40('0xb1')]][_0x8f40('0x10d')]+=0x1;_0x51cdbb[_0x8f40('0xa3')]=0xa;_0x51cdbb['statedesc']=_0x8f40('0x10e');_0x51cdbb['dropreason']=_0x8f40('0x10f');_0x51cdbb[_0x8f40('0x106')]=this[_0x8f40('0x1e')][_0x49535a['queue']][_0x8f40('0x107')]?moment()[_0x8f40('0x76')](_0x8f40('0xf9')):undefined;_0x51cdbb['countdropretry']+=0x1;_0x51cdbb[_0x8f40('0xea')]+=0x1;if(_0x51cdbb[_0x8f40('0xf0')]>=this['voiceQueues'][_0x49535a[_0x8f40('0xb1')]][_0x8f40('0x110')]){this['queueCallerAbandonCreateState'](_0x51cdbb);}else{this[_0x8f40('0xbe')]({'active':![],'countdropretry':_0x51cdbb['countdropretry'],'scheduledat':moment()[_0x8f40('0xf6')](this[_0x8f40('0x1e')][_0x49535a['queue']][_0x8f40('0x111')],_0x8f40('0xf8'))[_0x8f40('0x76')](_0x8f40('0xf9')),'ContactId':_0x43cb21[_0x8f40('0xfa')],'ListId':_0x43cb21[_0x8f40('0xd0')],'VoiceQueueId':_0x43cb21[_0x8f40('0xd2')]||undefined,'CampaignId':_0x43cb21[_0x8f40('0xfb')]||undefined})[_0x8f40('0xaf')](loggerCatch('[rescheduleContact][Drop]'));var _0x23a457=new History(_0x51cdbb);_0x23a457[_0x8f40('0xa3')]=0xa;_0x23a457['statedesc']=_0x8f40('0x10e');_0x23a457[_0x8f40('0xa6')]=moment()[_0x8f40('0x76')](_0x8f40('0xf9'));_0x23a457[_0x8f40('0xa5')]=_0x23a457['starttime'];_0x23a457['calleridname']=_0x51cdbb[_0x8f40('0x112')];_0x23a457[_0x8f40('0x113')]=_0x51cdbb[_0x8f40('0x113')];this[_0x8f40('0xc9')](_0x23a457)[_0x8f40('0xaf')](loggerCatch(_0x8f40('0x114')));}}else{this[_0x8f40('0x1e')][_0x49535a[_0x8f40('0xb1')]][_0x8f40('0x6b')]+=0x1;this[_0x8f40('0x1e')][_0x49535a[_0x8f40('0xb1')]][_0x8f40('0x63')]+=0x1;_0x51cdbb[_0x8f40('0xa3')]=0xb;_0x51cdbb[_0x8f40('0xa4')]='Abandoned';_0x51cdbb['dropreason']=_0x8f40('0x115');_0x51cdbb[_0x8f40('0xf1')]+=0x1;_0x51cdbb['countglobal']+=0x1;if(_0x51cdbb[_0x8f40('0xf1')]>=this[_0x8f40('0x1e')][_0x49535a['queue']]['dialAbandonedMaxRetry']){this['queueCallerAbandonCreateState'](_0x51cdbb);}else{this[_0x8f40('0xbe')]({'active':![],'countabandonedretry':_0x51cdbb[_0x8f40('0xf1')],'scheduledat':moment()[_0x8f40('0xf6')](this['voiceQueues'][_0x49535a['queue']][_0x8f40('0x116')],_0x8f40('0xf8'))[_0x8f40('0x76')](_0x8f40('0xf9')),'ContactId':_0x43cb21['ContactId'],'ListId':_0x43cb21[_0x8f40('0xd0')],'VoiceQueueId':_0x43cb21['VoiceQueueId']||undefined,'CampaignId':_0x43cb21['CampaignId']||undefined})[_0x8f40('0xaf')](loggerCatch(_0x8f40('0x117')));var _0x23a457=new History(_0x51cdbb);_0x23a457[_0x8f40('0xa3')]=0xb;_0x23a457[_0x8f40('0xa4')]=_0x8f40('0x118');_0x23a457['starttime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x23a457['endtime']=_0x23a457[_0x8f40('0xa6')];_0x23a457[_0x8f40('0x112')]=_0x51cdbb[_0x8f40('0x112')];_0x23a457[_0x8f40('0x113')]=_0x51cdbb[_0x8f40('0x113')];this['createHistory'](_0x23a457)[_0x8f40('0xaf')](loggerCatch('[syncAgentComplete][createHistory][11]'));}}}}};Dialer[_0x8f40('0x19')][_0x8f40('0x37')]=function(_0x173cbe){if(this['actions'][_0x173cbe[_0x8f40('0xd9')]]){this[_0x8f40('0x24')][_0x173cbe['uniqueid']][_0x8f40('0x119')]=_0x173cbe[_0x8f40('0x119')];}if(this[_0x8f40('0x25')][_0x173cbe[_0x8f40('0xd9')]]){this[_0x8f40('0x25')][_0x173cbe[_0x8f40('0xd9')]]['channel']=_0x173cbe[_0x8f40('0x119')];}};Dialer[_0x8f40('0x19')][_0x8f40('0x3b')]=function(_0x6ab8a4){if(strategy[this[_0x8f40('0x1e')][this[_0x8f40('0x24')][_0x6ab8a4[_0x8f40('0x11a')]]['queue']][_0x8f40('0x54')]]===_0x8f40('0x11b')){if(this[_0x8f40('0x24')][_0x6ab8a4['actionid']]&&_[_0x8f40('0xac')](this[_0x8f40('0x24')][_0x6ab8a4[_0x8f40('0x11a')]][_0x8f40('0x11c')])&&_0x6ab8a4[_0x8f40('0xae')]==='1'&&_0x6ab8a4[_0x8f40('0x11d')]==='0'){if(this[_0x8f40('0x20')][_0x6ab8a4[_0x8f40('0x11e')]]){if(!this[_0x8f40('0x20')][_0x6ab8a4[_0x8f40('0x11e')]][_0x8f40('0x11c')]){this[_0x8f40('0x20')][_0x6ab8a4[_0x8f40('0x11e')]][_0x8f40('0x11c')]=!![];this['actions'][_0x6ab8a4['actionid']][_0x8f40('0x11c')]=!![];this['actions'][_0x6ab8a4['actionid']]['stateinterface']=_0x6ab8a4[_0x8f40('0x11e')];}}}}else if((strategy[this[_0x8f40('0x1e')][this['actions'][_0x6ab8a4[_0x8f40('0x11a')]]['queue']][_0x8f40('0x54')]]||'rrmemory')===_0x8f40('0x18')){if(this['actions'][_0x6ab8a4[_0x8f40('0x11a')]]){if(this[_0x8f40('0x20')][_0x6ab8a4[_0x8f40('0x11e')]]){this['actions'][_0x6ab8a4[_0x8f40('0x11a')]][_0x8f40('0x11e')]=_0x6ab8a4['stateinterface'];if(_['isNil'](this[_0x8f40('0x2a')][this['actions'][_0x6ab8a4[_0x8f40('0x11a')]]['queue']])){this[_0x8f40('0x2a')][this['actions'][_0x6ab8a4[_0x8f40('0x11a')]][_0x8f40('0xb1')]]=[];}this[_0x8f40('0x2a')][this[_0x8f40('0x24')][_0x6ab8a4[_0x8f40('0x11a')]][_0x8f40('0xb1')]][_0x8f40('0x11f')](_[_0x8f40('0x8c')](_['pick'](this['actions'][_0x6ab8a4['actionid']],[_0x8f40('0x120'),_0x8f40('0x11e')]),{'status':_0x6ab8a4[_0x8f40('0xae')],'paused':_0x6ab8a4['paused']}));}}}};function unlockQueueStatus(_0x404ff4,_0x96792b){setTimeout(function(){if(_[_0x8f40('0x40')](_0x404ff4[_0x8f40('0x121')])){loggerBooked['error'](_0x8f40('0x122'),_0x96792b);}_0x404ff4[_0x8f40('0x121')]=!![];loggerBooked[_0x8f40('0x7b')]('[booked][unlockQueueStatus]',_0x96792b,JSON[_0x8f40('0x4d')](_[_0x8f40('0xcf')](_0x404ff4,['name',_0x8f40('0x121')])));},0x1f3);}Dialer[_0x8f40('0x19')][_0x8f40('0x3d')]=function(_0x58d89c){var _0x532426=this;var _0x29952c=_0x532426[_0x8f40('0x1e')][_0x532426['actions'][_0x58d89c[_0x8f40('0x11a')]][_0x8f40('0xb1')]];if(strategy[this[_0x8f40('0x1e')][this[_0x8f40('0x24')][_0x58d89c[_0x8f40('0x11a')]][_0x8f40('0xb1')]][_0x8f40('0x54')]]==='roundrobin'){if(this[_0x8f40('0x24')][_0x58d89c[_0x8f40('0x11a')]]&&this[_0x8f40('0x24')][_0x58d89c[_0x8f40('0x11a')]]['stateinterface']){this[_0x8f40('0x1d')]['run'](this[_0x8f40('0x24')][_0x58d89c[_0x8f40('0x11a')]][_0x8f40('0x120')],this[_0x8f40('0x24')][_0x58d89c[_0x8f40('0x11a')]]['stateinterface'])['catch'](function(_0xd99aa9){logger[_0x8f40('0x93')](_0x8f40('0x123'),util[_0x8f40('0x94')](_0xd99aa9,{'showHidden':![],'depth':null}));})[_0x8f40('0x1c')](function(){_0x532426['updateOriginated'](_0x532426[_0x8f40('0x1e')][_0x532426[_0x8f40('0x24')][_0x58d89c[_0x8f40('0x11a')]][_0x8f40('0xb1')]]);_0x532426['agents'][_0x532426[_0x8f40('0x24')][_0x58d89c[_0x8f40('0x11a')]][_0x8f40('0x11e')]]['locked']=![];delete _0x532426[_0x8f40('0x24')][_0x58d89c['actionid']];unlockQueueStatus(_0x29952c);});}else{this[_0x8f40('0xb0')](this[_0x8f40('0x1e')][this[_0x8f40('0x24')][_0x58d89c[_0x8f40('0x11a')]][_0x8f40('0xb1')]]);this[_0x8f40('0xbe')]({'active':![],'ContactId':this[_0x8f40('0x24')][_0x58d89c[_0x8f40('0x11a')]]['ContactId'],'ListId':this['actions'][_0x58d89c[_0x8f40('0x11a')]][_0x8f40('0xd0')],'VoiceQueueId':this[_0x8f40('0x24')][_0x58d89c[_0x8f40('0x11a')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x8f40('0x24')][_0x58d89c[_0x8f40('0x11a')]][_0x8f40('0xfb')]||undefined})[_0x8f40('0xaf')](loggerCatch(_0x8f40('0x124')));delete this[_0x8f40('0x24')][_0x58d89c['actionid']];unlockQueueStatus(_0x29952c);}}else if((strategy[this['voiceQueues'][this[_0x8f40('0x24')][_0x58d89c['actionid']][_0x8f40('0xb1')]]['strategy']]||_0x8f40('0x18'))===_0x8f40('0x18')){var _0x3f5347;if(this[_0x8f40('0x24')][_0x58d89c[_0x8f40('0x11a')]]&&!_[_0x8f40('0x4a')](this[_0x8f40('0x2a')][this[_0x8f40('0x24')][_0x58d89c[_0x8f40('0x11a')]][_0x8f40('0xb1')]])){if(this[_0x8f40('0x125')][_0x532426[_0x8f40('0x24')][_0x58d89c[_0x8f40('0x11a')]][_0x8f40('0xb1')]]){this[_0x8f40('0x125')][_0x532426[_0x8f40('0x24')][_0x58d89c[_0x8f40('0x11a')]][_0x8f40('0xb1')]]=this[_0x8f40('0x125')][this[_0x8f40('0x24')][_0x58d89c['actionid']]['queue']]?this['queueBookedRR'][this[_0x8f40('0x24')][_0x58d89c['actionid']][_0x8f40('0xb1')]]:this[_0x8f40('0x2a')][this[_0x8f40('0x24')][_0x58d89c[_0x8f40('0x11a')]][_0x8f40('0xb1')]]?this[_0x8f40('0x2a')][this['actions'][_0x58d89c[_0x8f40('0x11a')]][_0x8f40('0xb1')]]['_rr']||0x0:0x0;}this[_0x8f40('0x2a')][this[_0x8f40('0x24')][_0x58d89c[_0x8f40('0x11a')]][_0x8f40('0xb1')]][_0x8f40('0x126')]=this[_0x8f40('0x125')][this[_0x8f40('0x24')][_0x58d89c['actionid']][_0x8f40('0xb1')]];for(var _0x138943=0x0;_0x138943=0x0;})[_0x8f40('0xaf')](myreject(_0x197843)));}}else{_0x5c9c80[_0x8f40('0x11f')](ami[_0x8f40('0xad')]({'action':_0x8f40('0x141'),'command':util[_0x8f40('0x76')](_0x8f40('0x142'),_0x737cb3,!_[_0x8f40('0x40')](config[_0x8f40('0x13d')][_0x521fac])?_0x521fac:'')})[_0x8f40('0xb7')](function(_0x3e8629){return _0x3e8629['content']['indexOf'](_0x8f40('0x144'))>=0x0;})['catch'](myreject(_0x197843)));}BPromise[_0x8f40('0x145')](_0x5c9c80)[_0x8f40('0xb7')](function(_0x2f8ac2){var _0x329b60=_[_0x8f40('0x146')](_0x2f8ac2);if(_0x329b60){return _0x32bdb0(_0x329b60);}else{_0x47cbda[_0x8f40('0x41')]=_0x3fe6b4?'GLOBAL_INTERVAL_IS_OVERTIME':_0x8f40('0x147');return _0x197843(msgResponse(_0x8f40('0x148'),_0x8f40('0x13a'),_0x8f40('0x149')+_0x3fe6b4+'\x20'+_0x4042f9+'\x20Interval\x20is\x20overtime:\x20'+util['inspect'](_0x737cb3,{'showHidden':![],'depth':null})+_0x8f40('0x14a')+_0x521fac));}})[_0x8f40('0xaf')](function(_0x45c564){return _0x197843(msgResponse(_0x8f40('0x138'),_0x8f40('0x13a'),JSON[_0x8f40('0x4d')](_0x45c564)));});});};Dialer[_0x8f40('0x19')]['checkDialMethod']=function(_0x4027eb){var _0x2fa582=this;return function(){switch(_0x4027eb[_0x8f40('0x5a')]){case _0x8f40('0x14b'):freeVariablesPredictive(_0x4027eb);_0x2fa582['handlePower'](_0x4027eb,0x1);break;case _0x8f40('0x14c'):freeVariablesPredictive(_0x4027eb);_0x2fa582[_0x8f40('0x14d')](_0x4027eb,_0x4027eb['dialPowerLevel']);break;case _0x8f40('0x9'):_0x2fa582['predictive'](_0x4027eb);break;case'booked':freeVariablesPredictive(_0x4027eb);_0x2fa582['handlePower'](_0x4027eb,0x1);break;default:freeVariablesPredictive(_0x4027eb);logger[_0x8f40('0x93')]('Queue',_0x4027eb[_0x8f40('0x43')],'method\x20not\x20recognized');}};};Dialer[_0x8f40('0x19')][_0x8f40('0x14e')]=function(_0x48c0b7){var _0x30e7c2=this;return function(){_0x30e7c2['handleIvr'](_0x48c0b7);};};Dialer[_0x8f40('0x19')][_0x8f40('0x33')]=function(_0x43e9c6){var _0x419fbd=this;if(isNotPreview(_0x43e9c6[_0x8f40('0x5a')])){if(isVoiceQueueOutbound(_0x43e9c6[_0x8f40('0x52')])&&isActive(_0x43e9c6[_0x8f40('0x59')])){_0x43e9c6['sendMessageOneNotActive']=!![];BPromise['resolve']()[_0x8f40('0xb7')](checkIsLoggedIn(_0x43e9c6,_0x43e9c6['loggedIn']))[_0x8f40('0xb7')](checkIsActive(_0x43e9c6,_0x43e9c6[_0x8f40('0x59')]))[_0x8f40('0xb7')](checkInterval(_0x43e9c6))[_0x8f40('0xb7')](_0x419fbd['checkIsTrunkReachable'](_0x43e9c6))[_0x8f40('0xb7')](_0x419fbd[_0x8f40('0x137')](_0x43e9c6[_0x8f40('0x14f')],_0x43e9c6[_0x8f40('0x150')],_0x43e9c6[_0x8f40('0x43')],_0x43e9c6))[_0x8f40('0xb7')](_0x419fbd[_0x8f40('0x139')](_0x43e9c6[_0x8f40('0x46')],_0x43e9c6['dialTimezone'],_0x43e9c6[_0x8f40('0x43')],_0x43e9c6))[_0x8f40('0xb7')](_0x419fbd[_0x8f40('0x151')](_0x43e9c6))[_0x8f40('0xaf')](loggerCatchQueueSummary(_0x8f40('0x152'),_0x43e9c6));}else{notSendMessagesQueue(_0x43e9c6);}}else{freeVariablesPredictive(_0x43e9c6);}};Dialer[_0x8f40('0x19')][_0x8f40('0x133')]=function(){var _0x5f4a79=this;var _0x47d274;for(var _0x54798c in this[_0x8f40('0x1f')]){if(typeof this['campaigns'][_0x54798c]!==_0x8f40('0xaa')){_0x47d274=this[_0x8f40('0x1f')][_0x54798c];if(isCampaignIvr(_0x47d274[_0x8f40('0x52')])&&isActive(_0x47d274['active'])){_0x47d274[_0x8f40('0xa0')]=!![];BPromise[_0x8f40('0xba')]()['then'](checkIsActive(_0x47d274,_0x47d274[_0x8f40('0x75')]))[_0x8f40('0xb7')](checkInterval(_0x47d274))[_0x8f40('0xb7')](_0x5f4a79[_0x8f40('0x153')](_0x47d274))[_0x8f40('0xb7')](_0x5f4a79[_0x8f40('0x137')](_0x47d274['dialGlobalInterval'],_0x47d274['dialTimezone'],_0x47d274[_0x8f40('0x43')],_0x47d274))['then'](_0x5f4a79[_0x8f40('0x139')](_0x47d274[_0x8f40('0x46')],_0x47d274['dialTimezone'],_0x47d274[_0x8f40('0x43')],_0x47d274))[_0x8f40('0xb7')](_0x5f4a79[_0x8f40('0x14e')](_0x47d274))[_0x8f40('0xaf')](loggerCatchQueueSummary(_0x8f40('0x154'),_0x47d274));}else{notSendMessagesCampaign(_0x47d274);}}}};function getCallerIdRandom(_0x150f84,_0x4c98e3){var _0x441303;var _0x343e00;var _0x2cc176;if(_0x4c98e3<=0x0){_0x4c98e3=0x1;}_0x441303=new RegExp(_0x8f40('0x155')+_0x4c98e3+'}$');_0x343e00=Math[_0x8f40('0x156')](0xa,_0x4c98e3-0x1);_0x2cc176=Math[_0x8f40('0x156')](0xa,_0x4c98e3)-0x1;return util[_0x8f40('0x76')]('%s',_[_0x8f40('0x157')](_0x150f84,_0x441303,_[_0x8f40('0x158')](_0x343e00,_0x2cc176)));}function extractCalleridName(_0x1d2457){var _0x31af9e=_0x1d2457[_0x8f40('0x159')](/"(.*?)"/);return _0x31af9e?_0x31af9e[0x1]:_0x1d2457;}function extractCalleridNumber(_0x4e394c){var _0x5774b7=_0x4e394c[_0x8f40('0x159')](/<(.*?)>/);return _0x5774b7?_0x5774b7[0x1]:_0x4e394c;}Dialer[_0x8f40('0x19')]['actionOriginate']=function(_0x4b4416,_0x3370e4){var _0x141678=this;var _0x511c68=uuid['v4']();this[_0x8f40('0x24')][_0x511c68]=new Action(_0x4b4416,_0x3370e4,_0x511c68);return new BPromise(function(_0x3253ab,_0xe847bd){if(_[_0x8f40('0x40')](_0x4b4416)&&typeof _0x4b4416!==_0x8f40('0x15a')){return _0xe847bd(msgResponse(_0x8f40('0x15b'),_0x8f40('0x13a'),_0x8f40('0x15c')));}if(_['isUndefined'](_0x3370e4[_0x8f40('0x15d')][_0x8f40('0x15e')])||_0x3370e4['Contact'][_0x8f40('0x15e')]===null){return _0xe847bd(msgResponse('originate',_0x8f40('0x13a'),_0x8f40('0x15f')));}var _0xbff6df={'XMD-CALLERID':_0x141678[_0x8f40('0x24')][_0x511c68][_0x8f40('0x160')](),'XMD-AGI':_0x4b4416['dialQueueProject']?util[_0x8f40('0x76')]('\x22agi://%s/square,%s\x22',ipAgi,_0x4b4416[_0x8f40('0x161')]):_0x8f40('0x162'),'XMD-AGIAFTER':_0x4b4416['dialQueueProject2']?util[_0x8f40('0x76')](_0x8f40('0x163'),ipAgi,_0x4b4416[_0x8f40('0x107')]):'NONE','XMD-QUEUE':_0x4b4416[_0x8f40('0x52')]===_0x8f40('0x53')?util[_0x8f40('0x76')](_0x8f40('0x164'),_0x4b4416[_0x8f40('0x43')],_0x4b4416[_0x8f40('0x165')]||'',_0x4b4416[_0x8f40('0x166')]?'c':'',_0x4b4416['dialQueueTimeout']||0x3):_0x8f40('0x162'),'XMD-CONTACTID':_0x3370e4[_0x8f40('0xfa')],'XMD-CDRTYPE':_0x8f40('0x7'),'CALLERID(all)':_0x141678[_0x8f40('0x24')][_0x511c68][_0x8f40('0x160')](),'XMD-AMD':_0x4b4416[_0x8f40('0xde')]?_0x8f40('0x167'):_0x8f40('0x162'),'XMD-DESTINATION':_0x8f40('0xdd')};if(_0x4b4416['dialAMDActive']){_0xbff6df[_0x8f40('0x168')]=_0x4b4416[_0x8f40('0x169')]||0x9c4;_0xbff6df[_0x8f40('0x16a')]=_0x4b4416[_0x8f40('0x16b')]||0x5dc;_0xbff6df['XMD-AMDAFTERGREETINGSILENCE']=_0x4b4416[_0x8f40('0x16c')]||0x320;_0xbff6df[_0x8f40('0x16d')]=_0x4b4416[_0x8f40('0x16e')]||0x1388;_0xbff6df['XMD-AMDMINWORDLENGTH']=_0x4b4416[_0x8f40('0x16f')]||0x64;_0xbff6df[_0x8f40('0x170')]=_0x4b4416[_0x8f40('0x171')]||0x32;_0xbff6df[_0x8f40('0x172')]=_0x4b4416[_0x8f40('0x173')]||0x3;_0xbff6df[_0x8f40('0x174')]=_0x4b4416[_0x8f40('0x175')]||0x100;_0xbff6df['XMD-AMDMAXIMUMWORDLENGTH']=_0x4b4416[_0x8f40('0x176')]||0x1388;}if(_0x4b4416['type']===_0x8f40('0x53')){_0xbff6df[_0x8f40('0x177')]=_0x3370e4[_0x8f40('0xd2')];}else{_0xbff6df[_0x8f40('0x178')]=_0x3370e4[_0x8f40('0xfb')];}for(var _0x3649bd in _0x3370e4[_0x8f40('0x15d')]){if(typeof _0x3370e4[_0x8f40('0x15d')][_0x3649bd]!==_0x8f40('0xaa')){if(isNotNull(_0x3370e4[_0x8f40('0x15d')][_0x3649bd])&&_0x3649bd!=='id'&&_0x3649bd!==_0x8f40('0x179')&&_0x3649bd!==_0x8f40('0x17a')&&_0x3649bd!==_0x8f40('0x17b')){_0xbff6df[util['format']('%s%s',_0x8f40('0x17c'),_[_0x8f40('0x17d')](_0x3649bd))]=_0x3370e4[_0x8f40('0x15d')][_0x3649bd];}}}var _0x43a90c=_0x141678[_0x8f40('0xd6')](_0x4b4416[_0x8f40('0x74')])?getCallerId(_0x4b4416[_0x8f40('0x74')][_0x8f40('0x17e')],_0x4b4416['dialOriginateCallerIdName'],_0x4b4416[_0x8f40('0x17f')]>0x0?getCallerIdRandom(_0x4b4416['dialOriginateCallerIdNumber'],_0x4b4416['dialRandomLastDigitCallerIdNumber']):_0x4b4416[_0x8f40('0x5b')]):getCallerId(_[_0x8f40('0xac')](_0x4b4416[_0x8f40('0x134')])?_0x4b4416[_0x8f40('0x74')][_0x8f40('0x17e')]:_0x4b4416[_0x8f40('0x134')][_0x8f40('0x17e')],_0x4b4416[_0x8f40('0x180')],_0x4b4416['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x4b4416[_0x8f40('0x5b')],_0x4b4416[_0x8f40('0x17f')]):_0x4b4416['dialOriginateCallerIdNumber']);if(_0x43a90c){_0xbff6df[_0x8f40('0x181')]=_0x141678[_0x8f40('0x24')][_0x511c68][_0x8f40('0x182')]=extractCalleridName(_0x43a90c);_0xbff6df[_0x8f40('0x183')]=_0x141678[_0x8f40('0x24')][_0x511c68][_0x8f40('0x184')]=extractCalleridNumber(_0x43a90c);}return ami['Action']({'actionid':_0x511c68,'action':'originate','channel':_0x141678[_0x8f40('0xd6')](_0x4b4416[_0x8f40('0x74')])?util[_0x8f40('0x76')](_0x8f40('0x185'),_0x4b4416[_0x8f40('0x74')][_0x8f40('0x43')],isNotNull(_0x4b4416[_0x8f40('0x5d')])?_0x4b4416['dialPrefix'][_0x8f40('0x186')]()||'':'',_0x4b4416[_0x8f40('0x187')]>0x0?_0x3370e4['Contact'][_0x8f40('0x15e')]['substring'](_0x4b4416[_0x8f40('0x187')]):_0x3370e4[_0x8f40('0x15d')]['phone']):util['format'](_0x8f40('0x185'),_[_0x8f40('0xac')](_0x4b4416['TrunkBackup'])?_0x4b4416[_0x8f40('0x74')][_0x8f40('0x43')]:_0x4b4416[_0x8f40('0x134')][_0x8f40('0x43')],isNotNull(_0x4b4416[_0x8f40('0x5d')])?_0x4b4416['dialPrefix'][_0x8f40('0x186')]()||'':'',_0x4b4416[_0x8f40('0x187')]>0x0?_0x3370e4['Contact'][_0x8f40('0x15e')]['substring'](_0x4b4416['dialCutDigit']):_0x3370e4['Contact'][_0x8f40('0x15e')]),'callerid':_0x43a90c,'Exten':_0x8f40('0xdd'),'Context':'from-sip','Priority':'1','variable':_0xbff6df,'timeout':(_0x4b4416['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x511c68})[_0x8f40('0xb7')](function(_0x5c7b01){return _0x3253ab(_0x5c7b01);})[_0x8f40('0xaf')](function(_0x33ca0e){_0x4b4416['outboundOriginateFailureCallsDay']+=0x1;var _0x5d1b3a=new History(_0x141678[_0x8f40('0x24')][_0x511c68]);logger[_0x8f40('0x93')](util[_0x8f40('0x76')]('[originateError]:\x20%s',JSON[_0x8f40('0x4d')](_0x33ca0e)));_0x5d1b3a[_0x8f40('0xa3')]=0xe;_0x5d1b3a[_0x8f40('0xa4')]=_0x8f40('0x188');_0x5d1b3a[_0x8f40('0xa6')]=moment()[_0x8f40('0x76')](_0x8f40('0xf9'));_0x5d1b3a[_0x8f40('0xa5')]=_0x5d1b3a['starttime'];_0x141678[_0x8f40('0xc9')](_0x5d1b3a)['catch'](loggerCatch(_0x8f40('0x189')));_0x141678[_0x8f40('0xc7')](_0x5d1b3a)[_0x8f40('0xaf')](loggerCatch(_0x8f40('0x189')))[_0x8f40('0x1c')](function(){delete _0x141678[_0x8f40('0x24')][_0x511c68];return _0xe847bd(msgResponse(_0x8f40('0x15b'),_0x8f40('0x4c'),_0x8f40('0x18a')));});});});};Dialer[_0x8f40('0x19')][_0x8f40('0x30')]=function(_0x417add){var _0x3c17af=this['actions'][_0x417add['actionid']];if(_0x3c17af){delete this[_0x8f40('0x24')][_0x417add[_0x8f40('0x11a')]];_0x3c17af[_0x8f40('0x18b')]=moment()['format'](_0x8f40('0xf9'));var _0x1fd086=_0x3c17af[_0x8f40('0x52')]===_0x8f40('0xb2')?this[_0x8f40('0x1f')][_0x3c17af['queue']]:this[_0x8f40('0x1e')][_0x3c17af['getQueue']()];if(!this[_0x8f40('0xd5')](_0x417add[_0x8f40('0x18c')])){this['updateOriginated'](_0x1fd086);return this['callProgressDetecting'](_0x3c17af,_0x1fd086,_0x417add)['catch'](loggerCatch(_0x8f40('0x18d')));}this[_0x8f40('0x25')][_0x417add[_0x8f40('0xd9')]]=_0x3c17af;}};Dialer[_0x8f40('0x19')][_0x8f40('0x18e')]=function(_0x2261c2,_0x199f38,_0x7857a1){var _0x4da147=new History(_0x199f38);if(_0x4da147[_0x8f40('0xec')]+_0x4da147[_0x8f40('0xed')]+_0x4da147[_0x8f40('0xee')]+_0x4da147['countnosuchnumberretry']+_0x4da147[_0x8f40('0xf0')]+_0x4da147[_0x8f40('0xf1')]+_0x4da147[_0x8f40('0xe9')]+_0x4da147[_0x8f40('0xfe')]>=_0x7857a1[_0x8f40('0xf2')]-0x1){return!![];}switch(_0x2261c2){case 0x3:if(_0x4da147[_0x8f40('0xee')]>=_0x7857a1[_0x8f40('0x18f')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x4da147[_0x8f40('0xee')]+=0x1,'scheduledat':moment()[_0x8f40('0xf6')](_0x7857a1['dialNoAnswerRetryFrequency'],'minutes')[_0x8f40('0x76')](_0x8f40('0xf9')),'ContactId':_0x4da147[_0x8f40('0xfa')],'ListId':_0x4da147['ListId'],'VoiceQueueId':_0x4da147[_0x8f40('0xd2')]||undefined,'CampaignId':_0x4da147['CampaignId']||undefined})['catch'](loggerCatch(_0x8f40('0x190')));break;case 0x5:if(_0x4da147[_0x8f40('0xec')]>=_0x7857a1[_0x8f40('0x191')]-0x1){return!![];}this[_0x8f40('0xbe')]({'active':![],'countbusyretry':_0x4da147[_0x8f40('0xec')]+=0x1,'scheduledat':moment()[_0x8f40('0xf6')](_0x7857a1['dialBusyRetryFrequency'],_0x8f40('0xf8'))[_0x8f40('0x76')](_0x8f40('0xf9')),'ContactId':_0x4da147['ContactId'],'ListId':_0x4da147['ListId'],'VoiceQueueId':_0x4da147[_0x8f40('0xd2')]||undefined,'CampaignId':_0x4da147[_0x8f40('0xfb')]||undefined})[_0x8f40('0xaf')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x4da147[_0x8f40('0xed')]>=_0x7857a1['dialCongestionMaxRetry']-0x1){return!![];}this[_0x8f40('0xbe')]({'active':![],'countcongestionretry':_0x4da147[_0x8f40('0xed')]+=0x1,'scheduledat':moment()['add'](_0x7857a1[_0x8f40('0x192')],_0x8f40('0xf8'))['format'](_0x8f40('0xf9')),'ContactId':_0x4da147['ContactId'],'ListId':_0x4da147[_0x8f40('0xd0')],'VoiceQueueId':_0x4da147['VoiceQueueId']||undefined,'CampaignId':_0x4da147[_0x8f40('0xfb')]||undefined})[_0x8f40('0xaf')](loggerCatch(_0x8f40('0x193')));break;case 0x0:if(_0x4da147[_0x8f40('0xef')]>=_0x7857a1[_0x8f40('0x194')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x4da147[_0x8f40('0xef')]+=0x1,'scheduledat':moment()[_0x8f40('0xf6')](_0x7857a1[_0x8f40('0x195')],_0x8f40('0xf8'))['format'](_0x8f40('0xf9')),'ContactId':_0x4da147[_0x8f40('0xfa')],'ListId':_0x4da147[_0x8f40('0xd0')],'VoiceQueueId':_0x4da147[_0x8f40('0xd2')]||undefined,'CampaignId':_0x4da147['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x4da147[_0x8f40('0xf0')]>=_0x7857a1[_0x8f40('0x110')]-0x1){return!![];}this[_0x8f40('0xbe')]({'active':![],'countdropretry':_0x4da147['countdropretry']+=0x1,'scheduledat':moment()[_0x8f40('0xf6')](_0x7857a1['dialDropRetryFrequency'],_0x8f40('0xf8'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4da147['ContactId'],'ListId':_0x4da147[_0x8f40('0xd0')],'VoiceQueueId':_0x4da147[_0x8f40('0xd2')]||undefined,'CampaignId':_0x4da147['CampaignId']||undefined})[_0x8f40('0xaf')](loggerCatch(_0x8f40('0x196')));break;case 0xb:if(_0x4da147[_0x8f40('0xf1')]>=_0x7857a1[_0x8f40('0x197')]-0x1){return!![];}this[_0x8f40('0xbe')]({'active':![],'countabandonedretry':_0x4da147[_0x8f40('0xf1')]+=0x1,'scheduledat':moment()[_0x8f40('0xf6')](_0x7857a1[_0x8f40('0x116')],_0x8f40('0xf8'))[_0x8f40('0x76')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4da147['ContactId'],'ListId':_0x4da147[_0x8f40('0xd0')],'VoiceQueueId':_0x4da147[_0x8f40('0xd2')]||undefined,'CampaignId':_0x4da147[_0x8f40('0xfb')]||undefined})['catch'](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x4da147[_0x8f40('0xe9')]>=_0x7857a1['dialMachineMaxRetry']-0x1){return!![];}this[_0x8f40('0xbe')]({'active':![],'countmachineretry':_0x4da147[_0x8f40('0xe9')]+=0x1,'scheduledat':moment()[_0x8f40('0xf6')](_0x7857a1[_0x8f40('0xf7')],_0x8f40('0xf8'))[_0x8f40('0x76')](_0x8f40('0xf9')),'ContactId':_0x4da147[_0x8f40('0xfa')],'ListId':_0x4da147[_0x8f40('0xd0')],'VoiceQueueId':_0x4da147[_0x8f40('0xd2')]||undefined,'CampaignId':_0x4da147[_0x8f40('0xfb')]||undefined})[_0x8f40('0xaf')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x4da147['countagentrejectretry']>=_0x7857a1[_0x8f40('0x198')]-0x1){return!![];}this[_0x8f40('0xbe')]({'active':![],'countagentrejectretry':_0x4da147['countagentrejectretry']+=0x1,'scheduledat':moment()['add'](_0x7857a1[_0x8f40('0x199')],'minutes')[_0x8f40('0x76')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4da147[_0x8f40('0xfa')],'ListId':_0x4da147['ListId'],'VoiceQueueId':_0x4da147[_0x8f40('0xd2')]||undefined,'CampaignId':_0x4da147[_0x8f40('0xfb')]||undefined})[_0x8f40('0xaf')](loggerCatch(_0x8f40('0x19a')));break;default:return!![];}};Dialer[_0x8f40('0x19')][_0x8f40('0x19b')]=function(_0x55f32d,_0x5256ff,_0x16886f){var _0x1740f1=this;var _0x23467b=new History(_0x55f32d);return new BPromise(function(_0x2df1a6,_0x13c3c9){if(_[_0x8f40('0x40')](_0x5256ff)&&typeof _0x5256ff!==_0x8f40('0x15a')){return _0x13c3c9(msgResponse('[callProgressDetecting]',_0x8f40('0x13a'),_0x8f40('0x19c')));}if(_['isUndefined'](_0x16886f)&&typeof _0x16886f!==_0x8f40('0x15a')){return _0x13c3c9(msgResponse('[callProgressDetecting]','Failure',_0x8f40('0x19d')));}switch(_0x16886f['reason']){case'0':_0x5256ff[_0x8f40('0x66')]+=0x1;_0x23467b[_0x8f40('0xa3')]=0x0;_0x23467b[_0x8f40('0xa4')]=_0x8f40('0x19e');_0x23467b[_0x8f40('0xef')]+=0x1;_0x23467b[_0x8f40('0xea')]+=0x1;ami[_0x8f40('0x51')](_0x8f40('0x19f'),ut[_0x8f40('0xe5')](_0x55f32d,_0x8f40('0x1a0')));_0x1740f1[_0x8f40('0xc9')](_0x23467b)[_0x8f40('0xaf')](loggerCatch(_0x8f40('0xeb')));if(_0x1740f1['checkRetriveMax'](0x0,_0x55f32d,_0x5256ff)){if(_0x23467b['countnosuchnumberretry']>=_0x5256ff[_0x8f40('0x194')]){_0x1740f1[_0x8f40('0xf5')](_0x23467b,_0x2df1a6,_0x13c3c9,'reason\x200\x20no\x20such\x20number....');}else{_0x1740f1[_0x8f40('0x1a1')](_0x23467b,_0x2df1a6,_0x13c3c9,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x5256ff[_0x8f40('0x65')]+=0x1;_0x23467b[_0x8f40('0xa3')]=0x3;_0x23467b[_0x8f40('0xa4')]=_0x8f40('0x1a2');_0x23467b['countnoanswerretry']+=0x1;_0x23467b[_0x8f40('0xea')]+=0x1;ami[_0x8f40('0x51')]('custom:agentnoanswer',ut[_0x8f40('0xe5')](_0x55f32d,_0x8f40('0x1a3')));_0x1740f1['createHistory'](_0x23467b)[_0x8f40('0xaf')](loggerCatch(_0x8f40('0x1a4')));if(_0x1740f1[_0x8f40('0x18e')](0x3,_0x55f32d,_0x5256ff)){if(_0x23467b[_0x8f40('0xee')]>=_0x5256ff[_0x8f40('0x18f')]){_0x1740f1['createStateFinal'](_0x23467b,_0x2df1a6,_0x13c3c9,'reason\x203\x20ringing\x20no\x20answer');}else{_0x1740f1['stateGlobal'](_0x23467b,_0x2df1a6,_0x13c3c9,_0x8f40('0x1a5'));}}break;case'5':_0x5256ff['outboundBusyCallsDay']+=0x1;_0x23467b[_0x8f40('0xa3')]=0x5;_0x23467b['statedesc']='Busy';_0x23467b[_0x8f40('0xec')]+=0x1;_0x23467b[_0x8f40('0xea')]+=0x1;ami[_0x8f40('0x51')](_0x8f40('0x1a6'),ut[_0x8f40('0xe5')](_0x55f32d,'busy'));_0x1740f1[_0x8f40('0xc9')](_0x23467b)['catch'](loggerCatch(_0x8f40('0x1a7')));if(_0x1740f1[_0x8f40('0x18e')](0x5,_0x55f32d,_0x5256ff)){if(_0x23467b[_0x8f40('0xec')]>=_0x5256ff[_0x8f40('0x191')]){_0x1740f1[_0x8f40('0xf5')](_0x23467b,_0x2df1a6,_0x13c3c9,'reason\x205\x20busy');}else{_0x1740f1['stateGlobal'](_0x23467b,_0x2df1a6,_0x13c3c9,_0x8f40('0x1a8'));}}break;case'8':_0x5256ff[_0x8f40('0x1a9')]+=0x1;_0x23467b['state']=0x8;_0x23467b[_0x8f40('0xa4')]=_0x8f40('0x1aa');_0x23467b[_0x8f40('0xed')]+=0x1;_0x23467b[_0x8f40('0xea')]+=0x1;ami[_0x8f40('0x51')](_0x8f40('0x1ab'),ut[_0x8f40('0xe5')](_0x55f32d,_0x8f40('0x1ac')));_0x1740f1[_0x8f40('0xc9')](_0x23467b)[_0x8f40('0xaf')](loggerCatch(_0x8f40('0x1ad')));if(_0x1740f1[_0x8f40('0x18e')](0x8,_0x55f32d,_0x5256ff)){if(_0x23467b['countcongestionretry']>=_0x5256ff[_0x8f40('0x1ae')]){_0x1740f1[_0x8f40('0xf5')](_0x23467b,_0x2df1a6,_0x13c3c9,'reason\x208\x20congestion');}else{_0x1740f1[_0x8f40('0x1a1')](_0x23467b,_0x2df1a6,_0x13c3c9,_0x8f40('0x1af'));}}break;case'11':_0x5256ff[_0x8f40('0x1b0')]+=0x1;_0x23467b[_0x8f40('0xa3')]=0xb;_0x23467b[_0x8f40('0xa4')]=_0x8f40('0x118');_0x23467b[_0x8f40('0xf1')]+=0x1;_0x23467b['countglobal']+=0x1;_0x1740f1['createHistory'](_0x23467b)[_0x8f40('0xaf')](loggerCatch(_0x8f40('0x1b1')));if(_0x1740f1[_0x8f40('0x18e')](0xb,_0x55f32d,_0x5256ff)){if(_0x23467b['countabandonedretry']>=_0x5256ff[_0x8f40('0x197')]){_0x1740f1[_0x8f40('0xf5')](_0x23467b,_0x2df1a6,_0x13c3c9,_0x8f40('0x1b2'));}else{_0x1740f1[_0x8f40('0x1a1')](_0x23467b,_0x2df1a6,_0x13c3c9,_0x8f40('0x1b2'));}}break;case'20':_0x5256ff[_0x8f40('0x1b3')]+=0x1;_0x23467b[_0x8f40('0xa3')]=0x14;_0x23467b['statedesc']='AgentReject';_0x23467b[_0x8f40('0xfe')]+=0x1;_0x23467b[_0x8f40('0xea')]+=0x1;ami['emit'](_0x8f40('0x1b4'),ut[_0x8f40('0xe5')](_0x55f32d,'agentreject'));_0x1740f1[_0x8f40('0xc9')](_0x23467b)[_0x8f40('0xaf')](loggerCatch(_0x8f40('0x1b5')));if(_0x1740f1[_0x8f40('0x18e')](0x14,_0x55f32d,_0x5256ff)){if(_0x23467b['countagentrejectretry']>=_0x5256ff[_0x8f40('0x198')]){_0x1740f1['createStateFinal'](_0x23467b,_0x2df1a6,_0x13c3c9,_0x8f40('0x1b6'));}else{_0x1740f1[_0x8f40('0x1a1')](_0x23467b,_0x2df1a6,_0x13c3c9,_0x8f40('0x1b6'));}}break;default:_0x5256ff[_0x8f40('0x68')]+=0x1;_0x23467b['state']=0xc;_0x23467b[_0x8f40('0xa4')]=_0x16886f['reason'];_0x1740f1[_0x8f40('0xc9')](_0x23467b)['catch'](loggerCatch(_0x8f40('0x1b7')));if(_0x1740f1[_0x8f40('0x18e')](_0x16886f[_0x8f40('0x1b8')],_0x55f32d,_0x5256ff)){if(_0x23467b['countbusyretry']+_0x23467b[_0x8f40('0xed')]+_0x23467b[_0x8f40('0xee')]+_0x23467b[_0x8f40('0xef')]+_0x23467b[_0x8f40('0xf0')]+_0x23467b[_0x8f40('0xf1')]+_0x23467b[_0x8f40('0xe9')]+_0x23467b['countagentrejectretry']>=_0x5256ff[_0x8f40('0xf2')]){_0x1740f1[_0x8f40('0x1a1')](_0x23467b,_0x2df1a6,_0x13c3c9,_0x16886f[_0x8f40('0x1b8')]);}else{_0x1740f1[_0x8f40('0xf5')](_0x23467b,_0x2df1a6,_0x13c3c9,_0x16886f['reason']);}}}});};Dialer[_0x8f40('0x19')][_0x8f40('0x1a1')]=function(_0x4f1a90,_0xa0d8c,_0xcb0600,_0x5acc40){var _0x2492ae=new Final(_0x4f1a90);_0x2492ae[_0x8f40('0xa3')]=0xf;_0x2492ae[_0x8f40('0xa4')]=_0x8f40('0x1b9');this[_0x8f40('0xf5')](_0x2492ae,_0xa0d8c,_0xcb0600,_0x5acc40);};Dialer[_0x8f40('0x19')][_0x8f40('0xf5')]=function(_0x1066e8,_0x96b48d,_0x179fcd,_0x29ccda){this['moveContactManagedDialer'](_0x1066e8)[_0x8f40('0xb7')](function(){return _0x96b48d(msgResponse(_0x8f40('0x1ba'),'Success',_0x29ccda));})['catch'](function(){return _0x179fcd(msgResponse(_0x8f40('0x1bb'),_0x8f40('0x13a'),_0x8f40('0x1bc')));});};Dialer[_0x8f40('0x19')]['predictive']=function(_0x38680b){var _0x3cedbd=_0x38680b[_0x8f40('0x1bd')]/0x64;var _0x5b769b=_0x38680b['outboundDropCallsDayTimeout']/(_0x38680b[_0x8f40('0x64')]+_0x38680b[_0x8f40('0x5f')]);var _0x196d2e=Math['round'](_0x38680b[_0x8f40('0x6e')]*(_0x38680b['predictiveIntervalMaxThreshold']/0x64));var _0x3c74f2=Math[_0x8f40('0x1be')](_0x38680b[_0x8f40('0x6e')]*(_0x38680b[_0x8f40('0x1bf')]/0x64));var _0x34aa2c=_0x38680b[_0x8f40('0x9c')]+_0x38680b['talking'];var _0xfe99c8=Math[_0x8f40('0x1c0')](_0x38680b['erlangCalls']*_0x38680b[_0x8f40('0x72')]*_0x38680b['predictiveIntervalHitRate']*_0x38680b[_0x8f40('0x1c1')]);if(_[_0x8f40('0x40')](_0x38680b[_0x8f40('0x28')])){if(!_[_0x8f40('0x40')](_0x38680b['startPredictive'])){_0x38680b[_0x8f40('0x27')]=undefined;loggerPredictive['error']('[startMethodPredictive][StartProgressive]',_0x8f40('0x1c2'));}if(!_['isUndefined'](_0x38680b[_0x8f40('0x8f')])){loggerPredictive[_0x8f40('0x93')](_0x8f40('0x1c3'),_0x8f40('0x1c4'));clearInterval(_0x38680b[_0x8f40('0x8f')]);_0x38680b[_0x8f40('0x8f')]=undefined;}_0x38680b[_0x8f40('0x28')]=moment()[_0x8f40('0x76')](_0x8f40('0xf9'));loggerPredictive[_0x8f40('0x7b')](_0x38680b[_0x8f40('0x43')],'collection\x20data\x20in\x20progressive\x20at',_0x38680b[_0x8f40('0x28')]);this['handlePower'](_0x38680b,0x1);}else if(ifInterval(_0x38680b[_0x8f40('0x1c5')],_0x38680b[_0x8f40('0x28')])){this[_0x8f40('0x14d')](_0x38680b,0x1);loggerPredictiveCalls[_0x8f40('0x7b')](_0x8f40('0x1c6'),_0x38680b[_0x8f40('0x28')],_0x38680b[_0x8f40('0x43')]);_0x38680b[_0x8f40('0x71')]=0x0;_0x38680b[_0x8f40('0x10d')]=0x0;}else if(_0x3cedbd<_0x5b769b&&_0x38680b[_0x8f40('0x1c7')]===_0x8f40('0x1c8')){freeVariablesPredictive(_0x38680b);loggerPredictive[_0x8f40('0x7b')](_0x8f40('0x1c9'),'Dropped\x20calls\x20day',_0x5b769b,_0x8f40('0x28'),_0x38680b['name']);}else if(_0xfe99c8<_0x38680b[_0x8f40('0x10d')]&&_0x38680b['dialPredictiveOptimization']==='dropRate'){freeVariablesPredictive(_0x38680b);loggerPredictive[_0x8f40('0x7b')](_0x8f40('0x1ca'),'Max\x20Drop\x20',_0xfe99c8,_0x8f40('0x1cb'),_0x38680b[_0x8f40('0x10d')],'startProgressive',_0x38680b['name']);}else if(!ifInterval(_0x38680b[_0x8f40('0x1c5')],_0x38680b[_0x8f40('0x28')])&&_['isUndefined'](_0x38680b[_0x8f40('0x27')])&&!_['isUndefined'](_0x38680b[_0x8f40('0x28')])){_0x38680b[_0x8f40('0x27')]=moment()[_0x8f40('0x76')](_0x8f40('0xf9'));loggerPredictive[_0x8f40('0x7b')](_0x38680b[_0x8f40('0x43')],_0x8f40('0x1cc'),_0x38680b['startPredictive']);this['averageHandleTime'](_0x38680b[_0x8f40('0x1c5')])['then'](this[_0x8f40('0x1cd')](_0x38680b))[_0x8f40('0xb7')](mergeDataErlangB(_0x38680b))['then'](this['startMethodPredictive'](_0x38680b))[_0x8f40('0xaf')](loggerCatchPredictive(_0x8f40('0x1ce'),_0x38680b));}else if(!ifInterval(_0x38680b['dialPredictiveInterval'],_0x38680b[_0x8f40('0x27')])){_0x38680b[_0x8f40('0x10d')]=0x0;_0x38680b[_0x8f40('0x27')]=moment()[_0x8f40('0x76')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x8f40('0x7b')](_0x38680b[_0x8f40('0x43')],'recalculate\x20predictive\x20at',_0x38680b[_0x8f40('0x27')]);clearInterval(_0x38680b[_0x8f40('0x8f')]);_0x38680b['handlePredictive']=undefined;this['averageHandleTime'](_0x38680b[_0x8f40('0x1c5')])[_0x8f40('0xb7')](this[_0x8f40('0x1cd')](_0x38680b))['then'](mergeDataErlangB(_0x38680b))['then'](this[_0x8f40('0x1cf')](_0x38680b))['catch'](loggerCatchPredictive(_0x8f40('0x1d0'),_0x38680b));}else if(_0x38680b[_0x8f40('0x6e')]&&_0x34aa2c<_0x38680b['predictiveIntervalAvailable']-_0x3c74f2){freeVariablesPredictive(_0x38680b);loggerPredictive[_0x8f40('0x7b')](_0x38680b[_0x8f40('0x43')],_0x8f40('0x1d1'),_0x34aa2c,_0x8f40('0x1d2'),_0x38680b[_0x8f40('0x6e')],'-',_0x3c74f2,'=',_0x38680b['predictiveIntervalAvailable']-_0x3c74f2,')');}else if(_0x38680b[_0x8f40('0x6e')]&&_0x34aa2c>_0x38680b[_0x8f40('0x6e')]+_0x196d2e){freeVariablesPredictive(_0x38680b);loggerPredictive[_0x8f40('0x7b')](_0x38680b[_0x8f40('0x43')],_0x8f40('0x1d1'),_0x34aa2c,_0x8f40('0x1d3'),_0x38680b[_0x8f40('0x6e')],'+',_0x196d2e,'=',_0x38680b[_0x8f40('0x6e')]+_0x196d2e,')');}};Dialer[_0x8f40('0x19')]['getDataPredictive']=function(_0x15005c){var _0x8ad867=this;return function(_0x1a86c7){return new BPromise(function(_0x411405,_0x56045a){_[_0x8f40('0x8c')](_0x15005c,_0x1a86c7[0x0]);if(checkGetDataPredictive(_0x1a86c7[0x0])){var _0x2b397c=_0x15005c['predictiveIntervalAvailable']=_0x15005c[_0x8f40('0x57')]+_0x15005c[_0x8f40('0x9c')];var _0x1070be=_0x15005c[_0x8f40('0x1c5')]*0x3c;var _0x592931=_0x1a86c7[0x0][_0x8f40('0x6a')]+_0x1a86c7[0x0][_0x8f40('0x69')];var _0x3795cb=(_0x1a86c7[0x0][_0x8f40('0x7f')]+_0x1a86c7[0x0][_0x8f40('0x1d4')]+_0x1a86c7[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x1a86c7[0x0]['predictiveIntervalTotalCalls'];_0x15005c['predictiveIntervalHitRate']=_0x3795cb>0x0?_0x3795cb:0x1;switch(_0x15005c['dialPredictiveOptimization']){case _0x8f40('0x1c8'):var _0x39c94f=_0x15005c['dialPredictiveOptimizationPercentage']/0x64;return _0x8ad867[_0x8f40('0x1d5')](_0x2b397c,_0x1070be,_0x592931,_0x3795cb,_0x39c94f)['then'](function(_0x365767){return _0x411405(_0x365767);});case _0x8f40('0x1d6'):var _0x13baa8=_0x15005c['dialPredictiveOptimizationPercentage']/0x64;return _0x8ad867[_0x8f40('0x1d7')](_0x2b397c,_0x1070be,_0x592931,_0x3795cb,_0x13baa8)[_0x8f40('0xb7')](function(_0x1bfadc){return _0x411405(_0x1bfadc);});default:return _0x56045a(msgResponse(_0x8f40('0x1d8'),_0x8f40('0x13a'),_0x8f40('0x1d9')));}}else{return _0x56045a(msgResponse(_0x8f40('0x1d8'),'Failure',_0x8f40('0x1da')));}});};};Dialer[_0x8f40('0x19')][_0x8f40('0x1db')]=function(_0x584bba){var _0x270452=this;return function(_0xfc55f2){return new BPromise(function(_0x2aeb4d,_0x4ad0ae){_[_0x8f40('0x8c')](_0x584bba,_0xfc55f2[0x0]);if(checkGetDataPredictive(_0xfc55f2[0x0])){loggerPredictive['info'](JSON[_0x8f40('0x4d')](_0xfc55f2[0x0]));if(_0x584bba['dialPredictiveOptimization']===_0x8f40('0x1c8')){return _0x270452[_0x8f40('0xc5')](_0x584bba['id'])[_0x8f40('0xb7')](function(_0x4591fb){var _0x1d9a2=_0x584bba[_0x8f40('0x1dc')]-_0x4591fb[0x0][_0x8f40('0x1dd')];var _0x5a901b=_0x584bba[_0x8f40('0x1c5')]*0x3c;var _0x4d78d6=_0xfc55f2[0x0]['predictiveIntervalAvgTalktime']+_0xfc55f2[0x0][_0x8f40('0x69')];var _0x1c8c1c=(_0xfc55f2[0x0][_0x8f40('0x7f')]+_0xfc55f2[0x0][_0x8f40('0x1d4')]+_0xfc55f2[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0xfc55f2[0x0][_0x8f40('0x6f')];var _0x117b2c=_0x584bba[_0x8f40('0x1bd')]/0x64;_0x584bba[_0x8f40('0x1de')]=_0x4591fb[0x0][_0x8f40('0x1dd')]||0x0;_0x584bba['predictiveIntervalHitRate']=_0x1c8c1c>0x0?_0x1c8c1c:0x1;return _0x270452[_0x8f40('0x1d5')](_0x1d9a2,_0x5a901b,_0x4d78d6,_0x1c8c1c,_0x117b2c);})['then'](function(_0x3ac966){return _0x2aeb4d(_0x3ac966);})['catch'](function(_0x143c88){return _0x4ad0ae(msgResponse(_0x8f40('0x1df'),_0x8f40('0x13a'),JSON[_0x8f40('0x4d')](_0x143c88)));});}if(_0x584bba[_0x8f40('0x1c7')]===_0x8f40('0x1d6')){return _0x270452[_0x8f40('0xc5')](_0x584bba['id'])[_0x8f40('0xb7')](function(_0x1235b1){var _0x28cfc7=_0x584bba[_0x8f40('0x1dc')]-_0x1235b1[0x0][_0x8f40('0x1dd')];var _0x4315ba=_0x584bba['dialPredictiveInterval']*0x3c;var _0xb443c1=_0xfc55f2[0x0]['predictiveIntervalAvgTalktime']+_0xfc55f2[0x0][_0x8f40('0x69')];var _0x18cad0=(_0xfc55f2[0x0][_0x8f40('0x7f')]+_0xfc55f2[0x0][_0x8f40('0x1d4')]+_0xfc55f2[0x0][_0x8f40('0x6b')])/_0xfc55f2[0x0]['predictiveIntervalTotalCalls'];var _0x819826=_0x584bba[_0x8f40('0x1bd')]/0x64;_0x584bba[_0x8f40('0x1de')]=_0x1235b1[0x0][_0x8f40('0x1dd')]||0x0;_0x584bba[_0x8f40('0x6d')]=_0x18cad0>0x0?_0x18cad0:0x1;return _0x270452['busyFactor'](_0x28cfc7,_0x4315ba,_0xb443c1,_0x18cad0,_0x819826);})[_0x8f40('0xb7')](function(_0x14ee7f){return _0x2aeb4d(_0x14ee7f);})['catch'](function(_0x495859){return _0x4ad0ae(msgResponse(_0x8f40('0x1df'),_0x8f40('0x13a'),JSON[_0x8f40('0x4d')](_0x495859)));});}}else{return _0x4ad0ae(msgResponse('[getDataPredictive]','Failure','check\x20failure'));}});};};Dialer[_0x8f40('0x19')][_0x8f40('0x1cf')]=function(_0x584d6d){var _0x5be245=this;return function(){var _0x18747f=0x0;var _0x422759=Math[_0x8f40('0x1c0')](_0x584d6d[_0x8f40('0x89')]*0x3e8);if(_0x422759>0x0){_0x422759=_0x422759<0x64?0x64:_0x422759;loggerPredictive[_0x8f40('0x7b')](_0x584d6d[_0x8f40('0x43')],'one\x20call\x20every:',_0x422759,'milliseconds');_0x584d6d[_0x8f40('0x8f')]=setInterval(function(){_0x5be245[_0x8f40('0x8f')](_0x584d6d);loggerPredictiveCalls[_0x8f40('0x7b')](_0x8f40('0x1e0'),_0x18747f+=0x1);},_0x422759);}else{loggerPredictive['info'](_0x584d6d[_0x8f40('0x43')],_0x8f40('0x1e1'));}};};Dialer[_0x8f40('0x19')][_0x8f40('0x1e2')]=function(_0x2126dd,_0x59cd90){var _0xaa6497=this;return function(_0x1ddcaf){if(_[_0x8f40('0x4a')](_0x1ddcaf)){if(_[_0x8f40('0xac')](_0x59cd90[_0x8f40('0xd1')])||!_0x59cd90[_0x8f40('0x1e3')]){if(_0x2126dd[_0x8f40('0x5a')]===_0x8f40('0x8')){_0x2126dd[_0x8f40('0x121')]=_['isUndefined'](_0x2126dd[_0x8f40('0x121')])?!![]:_0x2126dd['queueStatusComplete'];var _0x89cca3=uuid['v4']();_0xaa6497[_0x8f40('0x24')][_0x89cca3]=new Action(_0x2126dd,_0x59cd90,_0x89cca3);loggerBooked[_0x8f40('0x7b')](_0x8f40('0x1e4'),_0x89cca3,'queueStatusComplete:\x20',JSON['stringify'](_0x2126dd[_0x8f40('0x121')]),'Queue:\x20',_0x2126dd[_0x8f40('0x43')]);if(_0x2126dd[_0x8f40('0x121')]){_0x2126dd[_0x8f40('0x121')]=![];_0xaa6497[_0x8f40('0x2a')][_0xaa6497['actions'][_0x89cca3][_0x8f40('0xb1')]]=[];ami['Action']({'actionid':_0x89cca3,'action':_0x8f40('0x1e5'),'queue':_0x2126dd[_0x8f40('0x43')]})['catch'](function(){_0xaa6497['updateOriginated'](_0x2126dd);_0xaa6497[_0x8f40('0xbe')]({'active':![],'ContactId':_0xaa6497['actions'][_0x89cca3][_0x8f40('0xfa')],'ListId':_0xaa6497[_0x8f40('0x24')][_0x89cca3][_0x8f40('0xd0')],'VoiceQueueId':_0xaa6497[_0x8f40('0x24')][_0x89cca3][_0x8f40('0xd2')]||undefined,'CampaignId':_0xaa6497[_0x8f40('0x24')][_0x89cca3][_0x8f40('0xfb')]||undefined})[_0x8f40('0xaf')](loggerCatch(_0x8f40('0x1e6')));delete _0xaa6497[_0x8f40('0x24')][_0x89cca3];});}else{loggerBooked[_0x8f40('0x7b')](_0x8f40('0x1e7'),JSON['stringify'](_0x2126dd[_0x8f40('0x121')]),_0x8f40('0x1e8'),_0x2126dd['name']);_0xaa6497[_0x8f40('0xb0')](_0x2126dd);_0xaa6497[_0x8f40('0xbe')]({'active':![],'ContactId':_0xaa6497['actions'][_0x89cca3]['ContactId'],'ListId':_0xaa6497[_0x8f40('0x24')][_0x89cca3][_0x8f40('0xd0')],'VoiceQueueId':_0xaa6497[_0x8f40('0x24')][_0x89cca3][_0x8f40('0xd2')]||undefined,'CampaignId':_0xaa6497[_0x8f40('0x24')][_0x89cca3][_0x8f40('0xfb')]||undefined})[_0x8f40('0xaf')](loggerCatch(_0x8f40('0x1e6')));delete _0xaa6497['actions'][_0x89cca3];}}else{return _0xaa6497[_0x8f40('0x1e9')](_0x2126dd,_0x59cd90);}}else{if(getDiff(_0x59cd90[_0x8f40('0x1ea')])<_0x2126dd[_0x8f40('0x1eb')]*0x3c){if(_0x59cd90[_0x8f40('0x1ec')]&&!_0x59cd90[_0x8f40('0x1ec')]['voicePause']){_0xaa6497[_0x8f40('0x1d')]['run'](_0x59cd90['id'])[_0x8f40('0x1c')](function(){_0xaa6497[_0x8f40('0xb0')](_0x2126dd);});}else{_0xaa6497['unlockContact']({'active':![]},_0x59cd90['id'],0x1)[_0x8f40('0x1c')](function(){_0xaa6497[_0x8f40('0xb0')](_0x2126dd);});}}else{_0x2126dd[_0x8f40('0x67')]+=0x1;_0xaa6497[_0x8f40('0xb0')](_0x2126dd);if(_0x2126dd['dialRecallInQueue']){_0xaa6497['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x59cd90['ContactId'],'ListId':_0x59cd90[_0x8f40('0xd0')],'VoiceQueueId':_0x59cd90['VoiceQueueId']||undefined,'CampaignId':_0x59cd90[_0x8f40('0xfb')]||undefined})['catch'](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0xaa6497['createHistory'](createObjHistory(_0x2126dd,_0x59cd90,'RECALLINQUEUE',0x17,_0x8f40('0x1ed')))[_0x8f40('0xaf')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0xaa6497[_0x8f40('0xce')](createObjHistory(_0x2126dd,_0x59cd90,'RECALLFAILEDTIMEOUT',0x16,_0x8f40('0x1ee')),_0x8f40('0x1ef'),_0x8f40('0x1f0'));}}}}else{_0x2126dd[_0x8f40('0x60')]+=0x1;_0xaa6497[_0x8f40('0xce')](createObjHistory(_0x2126dd,_0x59cd90,_0x8f40('0x1f1'),0xd,_0x8f40('0x1f2')),'[Originate][historyBlacklist]',_0x8f40('0x1f3'));throw _0x8f40('0x1f4');}};};Dialer[_0x8f40('0x19')][_0x8f40('0x1f5')]=function(_0x4807e4){var _0x3481b0=this;var _0x14752a=_0x4807e4['limitCalls']-_0x4807e4['originated']-_0x4807e4[_0x8f40('0xc2')];emitCampaignSummary(_0x4807e4);if(_0x14752a>0x0){if(_0x14752a>this['maxNumberOriginate']){_0x14752a=this[_0x8f40('0x22')];}_0x4807e4['temp']+=_0x14752a;this[_0x8f40('0xc3')](_0x4807e4['id'],_0x14752a,_0x4807e4['dialOrderByScheduledAt'],_0x4807e4)['then'](function(_0xf79aae){_0x4807e4[_0x8f40('0xc2')]-=_0x14752a;_0x4807e4[_0x8f40('0xc2')]=_0x4807e4[_0x8f40('0xc2')]>0x0?_0x4807e4[_0x8f40('0xc2')]:0x0;if(!checkContactEmpty(_0xf79aae)){_0x4807e4[_0x8f40('0x41')]=_0x8f40('0x1f6');logger[_0x8f40('0x7b')]('[getContactCampaign2][Empty]'+_0x4807e4[_0x8f40('0x43')]);}else{_0x4807e4[_0x8f40('0x70')]+=_0xf79aae['length'];_0x4807e4[_0x8f40('0x41')]='RUNNING';for(var _0x214274=0x0;_0x214274<_0xf79aae[_0x8f40('0x127')];_0x214274+=0x1){_0x4807e4['ivrTotalCallsDays']+=0x1;if(_[_0x8f40('0xac')](_0xf79aae[_0x214274])||_[_0x8f40('0xac')](_0xf79aae[_0x214274][_0x8f40('0x15d')])||_['isNil'](_0xf79aae[_0x214274]['Contact'][_0x8f40('0x15e')])){_0x3481b0[_0x8f40('0xcd')]('[actionOriginate]\x20',_0x4807e4,_0xf79aae[_0x214274]);}else{_0x3481b0['checkIsBlackListIvr'](_[_0x8f40('0xcf')](_0xf79aae[_0x214274],[_0x8f40('0xfb'),'Contact.phone']))[_0x8f40('0xb7')](_0x3481b0[_0x8f40('0x1e2')](_0x4807e4,_0xf79aae[_0x214274]))[_0x8f40('0xaf')](_0x3481b0[_0x8f40('0xcc')](_0x8f40('0x1f7'),_0x4807e4));}}}})[_0x8f40('0xaf')](loggerGetContactDialer(_0x8f40('0x1f8'),_0x4807e4,_0x14752a));}};Dialer[_0x8f40('0x19')][_0x8f40('0x14d')]=function(_0x128729,_0x5c9dac){var _0x513d31=this;var _0x1e43ec=[];var _0x51e9d8=_0x5c9dac>=0x1?_0x5c9dac:0x1;if(_0x128729['dialMethod']===_0x8f40('0x8')){_0x51e9d8=0x1;}var _0x1bbbc6=Math['floor'](_0x128729['available']*_0x51e9d8)-_0x128729[_0x8f40('0x70')]-_0x128729[_0x8f40('0xc2')];emitVoiceQueueSummary(_0x128729);if(_0x128729[_0x8f40('0x1f9')]>0x0){var _0x54fbbc=_0x128729[_0x8f40('0x1f9')]-_0x128729[_0x8f40('0x70')]-_0x128729[_0x8f40('0x57')]-_0x128729[_0x8f40('0xc2')]-_0x128729[_0x8f40('0x9b')];if(_0x1bbbc6>_0x54fbbc){_0x1bbbc6=_0x54fbbc;}}if(_0x1bbbc6>0x0){if(_0x128729['dialMethod']==='booked'){_0x1bbbc6=0x1;}if(_0x1bbbc6>this[_0x8f40('0x22')]){_0x1bbbc6=this[_0x8f40('0x22')];}_0x128729[_0x8f40('0xc2')]+=_0x1bbbc6;for(var _0x176488 in this[_0x8f40('0x20')]){if(typeof this[_0x8f40('0x20')][_0x176488]!==_0x8f40('0xaa')){if(this['agents'][_0x176488]['state']===_0x8f40('0x1fa')&&this['agents'][_0x176488][_0x8f40('0xae')]==='reachable'){_0x1e43ec[_0x8f40('0x11f')](this[_0x8f40('0x20')][_0x176488]['id']);}}}this[_0x8f40('0xc1')](_0x128729['id'],_0x1e43ec,_0x1bbbc6,_0x128729['dialOrderByScheduledAt'],_0x128729)[_0x8f40('0xb7')](function(_0x46a67f){_0x128729[_0x8f40('0xc2')]-=_0x1bbbc6;_0x128729[_0x8f40('0xc2')]=_0x128729['temp']>0x0?_0x128729[_0x8f40('0xc2')]:0x0;if(!checkContactEmpty(_0x46a67f)){_0x513d31['countReScheduled'](_0x128729)[_0x8f40('0xb7')](sendMessageReschedule(_0x128729))[_0x8f40('0xaf')](loggerCatch(_0x8f40('0xb5')));}else{_0x128729[_0x8f40('0x70')]+=_0x46a67f['length'];_0x128729[_0x8f40('0x41')]=_0x128729[_0x8f40('0x5a')]===_0x8f40('0x8')?'ACTIVE':_0x8f40('0x1fb');for(var _0x368900=0x0;_0x368900<_0x46a67f['length'];_0x368900+=0x1){if(_[_0x8f40('0xac')](_0x46a67f[_0x368900])||_[_0x8f40('0xac')](_0x46a67f[_0x368900][_0x8f40('0x15d')])||_[_0x8f40('0xac')](_0x46a67f[_0x368900][_0x8f40('0x15d')][_0x8f40('0x15e')])){_0x513d31[_0x8f40('0xcd')](_0x8f40('0x1fc'),_0x128729,_0x46a67f[_0x368900]);}else{_0x513d31['checkIsBlackList'](_[_0x8f40('0xcf')](_0x46a67f[_0x368900],[_0x8f40('0xd2'),_0x8f40('0x1fd')]))[_0x8f40('0xb7')](_0x513d31[_0x8f40('0x1e2')](_0x128729,_0x46a67f[_0x368900]))[_0x8f40('0xaf')](_0x513d31[_0x8f40('0xcc')](_0x8f40('0x1fc'),_0x128729));}}}})[_0x8f40('0xaf')](loggerGetContactDialer('[getContactDialer2]',_0x128729,_0x1bbbc6));}};Dialer[_0x8f40('0x19')][_0x8f40('0x8f')]=function(_0x4adb47){if(_0x4adb47['dialLimitQueue']>0x0){var _0x29c4c2=_0x4adb47[_0x8f40('0x1f9')]-_0x4adb47[_0x8f40('0x70')]-_0x4adb47[_0x8f40('0x57')];if(_0x29c4c2>0x0){this[_0x8f40('0x1fe')](_0x4adb47);}else{loggerPredictiveCalls['info'](_0x8f40('0x1ff'));}}else{this[_0x8f40('0x1fe')](_0x4adb47);}};Dialer[_0x8f40('0x19')]['tryOriginatePredictive']=function(_0x194707){var _0x16d32c=this;var _0x1560e9=[];_0x194707[_0x8f40('0x70')]+=0x1;for(var _0x422153 in this[_0x8f40('0x20')]){if(typeof this[_0x8f40('0x20')][_0x422153]!==_0x8f40('0xaa')){if(this[_0x8f40('0x20')][_0x422153][_0x8f40('0xa3')]===_0x8f40('0x1fa')&&this['agents'][_0x422153]['status']===_0x8f40('0x200')){_0x1560e9[_0x8f40('0x11f')](this[_0x8f40('0x20')][_0x422153]['id']);}}}this[_0x8f40('0xc1')](_0x194707['id'],_0x1560e9,0x1,_0x194707['dialOrderByScheduledAt'],_0x194707)['then'](function(_0x8cc1d5){if(!checkContactEmpty(_0x8cc1d5)){checkContactLowerLimitOriginate(_0x194707,0x1,0x0);_0x16d32c['countReScheduled'](_0x194707)[_0x8f40('0xb7')](sendMessageReschedule(_0x194707))[_0x8f40('0xaf')](loggerCatch(_0x8f40('0xb5')));}else{_0x194707[_0x8f40('0x41')]=_0x8f40('0x1fb');if(_[_0x8f40('0xac')](_0x8cc1d5[0x0])||_['isNil'](_0x8cc1d5[0x0][_0x8f40('0x15d')])||_['isNil'](_0x8cc1d5[0x0][_0x8f40('0x15d')][_0x8f40('0x15e')])){_0x16d32c[_0x8f40('0xcd')](_0x8f40('0x1fc'),_0x194707,_0x8cc1d5[0x0]);}else{_0x16d32c[_0x8f40('0xb6')](_[_0x8f40('0xcf')](_0x8cc1d5[0x0],['VoiceQueueId',_0x8f40('0x1fd')]))['then'](_0x16d32c['checkContactBlack'](_0x194707,_0x8cc1d5[0x0]))['catch'](_0x16d32c[_0x8f40('0xcc')](_0x8f40('0x201'),_0x194707));}}})['catch'](loggerGetContactDialer(_0x8f40('0x202'),_0x194707,0x1));emitVoiceQueueSummary(_0x194707);};Dialer['prototype'][_0x8f40('0x1d5')]=function(_0x441cc0,_0x314aee,_0x534739,_0x3eabcd,_0x52a63e,_0x3eb226){loggerPredictive[_0x8f40('0x7b')](_0x8f40('0x203'));loggerPredictive['info'](_0x8f40('0x204'),_0x441cc0);loggerPredictive[_0x8f40('0x7b')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x314aee);loggerPredictive[_0x8f40('0x7b')](_0x8f40('0x205'),_0x534739);loggerPredictive[_0x8f40('0x7b')](_0x8f40('0x206'),_0x3eabcd);loggerPredictive[_0x8f40('0x7b')](_0x8f40('0x207'),_0x52a63e);loggerPredictive[_0x8f40('0x7b')](_0x8f40('0x208'));return new BPromise(function(_0x3d5353,_0x44c0c9){if(_0x441cc0<=0x0||isNaN(_0x441cc0)){return _0x44c0c9(msgResponse('[abandonmentRate]',_0x8f40('0x4c'),_0x8f40('0x209')+_0x441cc0));}if(_0x534739<=0x0||isNaN(_0x534739)){return _0x44c0c9(msgResponse(_0x8f40('0x20a'),_0x8f40('0x4c'),_0x8f40('0x20b')+_0x534739));}if(_0x3eabcd<=0x0||isNaN(_0x3eabcd)){return _0x44c0c9(msgResponse(_0x8f40('0x20a'),_0x8f40('0x4c'),_0x8f40('0x20c')+_0x3eabcd));}if(_0x314aee<=0x0||isNaN(_0x314aee)){return _0x44c0c9(msgResponse(_0x8f40('0x20a'),_0x8f40('0x4c'),_0x8f40('0x20d')+_0x314aee));}if(_0x52a63e<=0x0||isNaN(_0x52a63e)){return _0x44c0c9(msgResponse(_0x8f40('0x20a'),_0x8f40('0x4c'),_0x8f40('0x20e')+_0x52a63e));}_0x3eb226=_0x3eb226||0x0;var _0x4c6e7d=0x1/_0x534739;var _0x60c9a7=0x0;var _0x228114=0x0;var _0x595d89=0x0;var _0x10aa86=0x0;for(var _0x511b49=0x0;_0x595d89<_0x52a63e;_0x511b49+=0x1){_0x228114=_0x511b49/_0x314aee;_0x60c9a7=(_0x3eabcd*_0x228114+_0x3eb226)/_0x4c6e7d;_0x595d89=erlangb(_0x60c9a7,_0x441cc0);_0x10aa86=_0x60c9a7/_0x441cc0*(0x1-erlangb(_0x60c9a7,_0x441cc0));}return _0x3d5353({'erlangCalls':_0x511b49,'erlangCallToSecond':_0x314aee/_0x511b49,'erlangAbandonmentRate':_0x595d89,'erlangBusyFactor':_0x10aa86});});};Dialer[_0x8f40('0x19')][_0x8f40('0x1d7')]=function(_0x3c49d6,_0x1ff3b0,_0x5efa77,_0x3b208f,_0x2eb715,_0x2bc245){loggerPredictive['info'](_0x8f40('0x20f'));loggerPredictive['info'](_0x8f40('0x204'),_0x3c49d6);loggerPredictive[_0x8f40('0x7b')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1ff3b0);loggerPredictive[_0x8f40('0x7b')](_0x8f40('0x205'),_0x5efa77);loggerPredictive[_0x8f40('0x7b')](_0x8f40('0x206'),_0x3b208f);loggerPredictive[_0x8f40('0x7b')](_0x8f40('0x210'),_0x2eb715);loggerPredictive[_0x8f40('0x7b')](_0x8f40('0x208'));return new BPromise(function(_0xf1c296,_0x1059d0){if(_0x3c49d6<=0x0||isNaN(_0x3c49d6)){return _0x1059d0(msgResponse('[busyFactor]',_0x8f40('0x4c'),_0x8f40('0x209')+_0x3c49d6));}if(_0x5efa77<=0x0||isNaN(_0x5efa77)){return _0x1059d0(msgResponse(_0x8f40('0x211'),_0x8f40('0x4c'),_0x8f40('0x20b')+_0x5efa77));}if(_0x3b208f<=0x0||isNaN(_0x3b208f)){return _0x1059d0(msgResponse(_0x8f40('0x211'),_0x8f40('0x4c'),'p\x20=\x20'+_0x3b208f));}if(_0x1ff3b0<=0x0||isNaN(_0x1ff3b0)){return _0x1059d0(msgResponse(_0x8f40('0x211'),_0x8f40('0x4c'),_0x8f40('0x20d')+_0x1ff3b0));}if(_0x2eb715<=0x0||isNaN(_0x2eb715)){return _0x1059d0(msgResponse(_0x8f40('0x211'),_0x8f40('0x4c'),'Umin\x20=\x20'+_0x2eb715));}_0x2bc245=_0x2bc245||0x0;var _0x3e8da6=0x1/_0x5efa77;var _0x57d5ac=0x0;var _0x57fe08=0x0;var _0x50c920=0x0;var _0x197d4b=0x0;for(var _0x17ab6a=0x0;_0x197d4b<_0x2eb715;_0x17ab6a+=0x1){_0x57fe08=_0x17ab6a/_0x1ff3b0;_0x57d5ac=(_0x3b208f*_0x57fe08+_0x2bc245)/_0x3e8da6;_0x50c920=erlangb(_0x57d5ac,_0x3c49d6);_0x197d4b=_0x57d5ac/_0x3c49d6*(0x1-erlangb(_0x57d5ac,_0x3c49d6));}return _0xf1c296({'erlangCalls':_0x17ab6a,'erlangCallToSecond':_0x1ff3b0/_0x17ab6a,'erlangAbandonmentRate':_0x50c920,'erlangBusyFactor':_0x197d4b});});};module[_0x8f40('0x212')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index cbd13ef..f2215d8 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 _0x9fee=['droptime','endtime','ringtime','holdtime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countdropretry','countagentrejectretry','uniqueid','starttime','responsetime'];(function(_0x221fbe,_0x16bc47){var _0x51c3eb=function(_0x1dc3c3){while(--_0x1dc3c3){_0x221fbe['push'](_0x221fbe['shift']());}};_0x51c3eb(++_0x16bc47);}(_0x9fee,0x1e7));var _0xe9fe=function(_0xcec31b,_0x21d2f3){_0xcec31b=_0xcec31b-0x0;var _0x529778=_0x9fee[_0xcec31b];return _0x529778;};'use strict';var util=require('util');var _=require(_0xe9fe('0x0'));var moment=require(_0xe9fe('0x1'));function getSeconds(_0x498617,_0x5af849){var _0x417b8b=moment(_0x498617)[_0xe9fe('0x2')](0x0);var _0x16d3a5=moment(_0x5af849)[_0xe9fe('0x2')](0x0);return _0x417b8b[_0xe9fe('0x3')](_0x16d3a5,_0xe9fe('0x4'));}function QueueCallerAbandon(_0x5e8a95,_0x54ee7f){this[_0xe9fe('0x5')]=_0x5e8a95[_0xe9fe('0x5')];this[_0xe9fe('0x6')]=_0x5e8a95['type'];this[_0xe9fe('0x7')]=_0x5e8a95[_0xe9fe('0x6')]===_0xe9fe('0x8')?_0xe9fe('0x9'):_0x5e8a95[_0xe9fe('0x6')];this[_0xe9fe('0xa')]=_0x5e8a95[_0xe9fe('0xa')];this[_0xe9fe('0xb')]=_0x5e8a95['countcongestionretry'];this[_0xe9fe('0xc')]=_0x5e8a95[_0xe9fe('0xc')];this['countglobal']=_0x5e8a95['countbusyretry']+_0x5e8a95[_0xe9fe('0xb')]+_0x5e8a95['countnoanswerretry']+_0x5e8a95[_0xe9fe('0xd')]+_0x5e8a95['countdropretry']+_0x5e8a95[_0xe9fe('0xe')]+_0x5e8a95['countmachineretry']+_0x5e8a95['countagentrejectretry'];this[_0xe9fe('0xd')]=_0x5e8a95[_0xe9fe('0xd')];this[_0xe9fe('0xf')]=_0x5e8a95[_0xe9fe('0xf')];this[_0xe9fe('0xe')]=_0x5e8a95['countabandonedretry'];this['countmachineretry']=_0x5e8a95['countmachineretry'];this[_0xe9fe('0x10')]=_0x5e8a95[_0xe9fe('0x10')];this[_0xe9fe('0x11')]=_0x54ee7f[_0xe9fe('0x11')];this['calleridname']=_0x5e8a95['name'];this['calleridnum']=_0x5e8a95['number'];this[_0xe9fe('0x12')]=_0x5e8a95['starttime'];this[_0xe9fe('0x13')]=_0x5e8a95['responsetime'];this[_0xe9fe('0x14')]=_0x5e8a95[_0xe9fe('0x14')];this[_0xe9fe('0x15')]=this['droptime'];this[_0xe9fe('0x16')]=getSeconds(_0x5e8a95[_0xe9fe('0x13')],_0x5e8a95[_0xe9fe('0x12')]);this[_0xe9fe('0x17')]=getSeconds(this[_0xe9fe('0x14')],_0x5e8a95[_0xe9fe('0x13')]);this['talktime']=0x0;this[_0xe9fe('0x9')]=_0x54ee7f[_0xe9fe('0x9')];this[_0xe9fe('0x18')]=_0x54ee7f[_0xe9fe('0x19')];this['reason']=_0x54ee7f[_0xe9fe('0x1a')];this[_0xe9fe('0x1b')]=_0x5e8a95[_0xe9fe('0x1b')];this[_0xe9fe('0x1c')]=_0x5e8a95[_0xe9fe('0x1c')];this['callbackat']=_0x5e8a95[_0xe9fe('0x1d')];this[_0xe9fe('0x1e')]=_0x5e8a95[_0xe9fe('0x1e')];this[_0xe9fe('0x1f')]=_0x5e8a95[_0xe9fe('0x1f')];this['ListId']=_0x5e8a95[_0xe9fe('0x20')];this[_0xe9fe('0x21')]=_0x5e8a95['UserId'];this[_0xe9fe('0x22')]=_0x5e8a95[_0xe9fe('0x22')];this['CampaignId']=_0x5e8a95[_0xe9fe('0x23')];this[_0xe9fe('0x24')]=_0x5e8a95[_0xe9fe('0x24')]||'';this[_0xe9fe('0x25')]=_0x5e8a95[_0xe9fe('0x25')]||'';}module[_0xe9fe('0x26')]=QueueCallerAbandon; \ No newline at end of file +var _0xc2ff=['countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','name','calleridnum','number','starttime','responsetime','droptime','endtime','ringtime','holdtime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','lodash','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry'];(function(_0x59e564,_0x5936f5){var _0x461a11=function(_0x498624){while(--_0x498624){_0x59e564['push'](_0x59e564['shift']());}};_0x461a11(++_0x5936f5);}(_0xc2ff,0x114));var _0xfc2f=function(_0x4e4630,_0x111d71){_0x4e4630=_0x4e4630-0x0;var _0x277a11=_0xc2ff[_0x4e4630];return _0x277a11;};'use strict';var util=require('util');var _=require(_0xfc2f('0x0'));var moment=require(_0xfc2f('0x1'));function getSeconds(_0xd5bb3f,_0x456944){var _0x469859=moment(_0xd5bb3f)[_0xfc2f('0x2')](0x0);var _0x5c62cb=moment(_0x456944)[_0xfc2f('0x2')](0x0);return _0x469859[_0xfc2f('0x3')](_0x5c62cb,_0xfc2f('0x4'));}function QueueCallerAbandon(_0x3e5286,_0x1c2241){this[_0xfc2f('0x5')]=_0x3e5286[_0xfc2f('0x5')];this['type']=_0x3e5286[_0xfc2f('0x6')];this[_0xfc2f('0x7')]=_0x3e5286[_0xfc2f('0x6')]==='outbound'?_0xfc2f('0x8'):_0x3e5286['type'];this[_0xfc2f('0x9')]=_0x3e5286[_0xfc2f('0x9')];this['countcongestionretry']=_0x3e5286[_0xfc2f('0xa')];this[_0xfc2f('0xb')]=_0x3e5286['countnoanswerretry'];this[_0xfc2f('0xc')]=_0x3e5286[_0xfc2f('0x9')]+_0x3e5286[_0xfc2f('0xa')]+_0x3e5286['countnoanswerretry']+_0x3e5286[_0xfc2f('0xd')]+_0x3e5286[_0xfc2f('0xe')]+_0x3e5286[_0xfc2f('0xf')]+_0x3e5286['countmachineretry']+_0x3e5286[_0xfc2f('0x10')];this[_0xfc2f('0xd')]=_0x3e5286[_0xfc2f('0xd')];this[_0xfc2f('0xe')]=_0x3e5286['countdropretry'];this['countabandonedretry']=_0x3e5286[_0xfc2f('0xf')];this[_0xfc2f('0x11')]=_0x3e5286['countmachineretry'];this[_0xfc2f('0x10')]=_0x3e5286[_0xfc2f('0x10')];this[_0xfc2f('0x12')]=_0x1c2241[_0xfc2f('0x12')];this['calleridname']=_0x3e5286[_0xfc2f('0x13')];this[_0xfc2f('0x14')]=_0x3e5286[_0xfc2f('0x15')];this['starttime']=_0x3e5286[_0xfc2f('0x16')];this[_0xfc2f('0x17')]=_0x3e5286[_0xfc2f('0x17')];this['droptime']=_0x3e5286[_0xfc2f('0x18')];this[_0xfc2f('0x19')]=this['droptime'];this[_0xfc2f('0x1a')]=getSeconds(_0x3e5286['responsetime'],_0x3e5286[_0xfc2f('0x16')]);this[_0xfc2f('0x1b')]=getSeconds(this[_0xfc2f('0x18')],_0x3e5286[_0xfc2f('0x17')]);this['talktime']=0x0;this[_0xfc2f('0x8')]=_0x1c2241['queue'];this[_0xfc2f('0x1c')]=_0x1c2241[_0xfc2f('0x1d')];this[_0xfc2f('0x1e')]=_0x1c2241[_0xfc2f('0x1e')];this['callback']=_0x3e5286[_0xfc2f('0x1f')];this[_0xfc2f('0x20')]=_0x3e5286[_0xfc2f('0x20')];this[_0xfc2f('0x21')]=_0x3e5286[_0xfc2f('0x21')];this[_0xfc2f('0x22')]=_0x3e5286[_0xfc2f('0x22')];this[_0xfc2f('0x23')]=_0x3e5286[_0xfc2f('0x23')];this[_0xfc2f('0x24')]=_0x3e5286['ListId'];this['UserId']=_0x3e5286['UserId'];this[_0xfc2f('0x25')]=_0x3e5286['VoiceQueueId'];this['CampaignId']=_0x3e5286[_0xfc2f('0x26')];this[_0xfc2f('0x27')]=_0x3e5286[_0xfc2f('0x27')]||'';this[_0xfc2f('0x28')]=_0x3e5286['originatecalleridname']||'';}module['exports']=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 1fc2d76..85d32d8 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(_0x2df412,_0x9a3ded){var _0x5f132d=function(_0x56f883){while(--_0x56f883){_0x2df412['push'](_0x2df412['shift']());}};_0x5f132d(++_0x9a3ded);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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(_0x138dc8,_0x4adda3){var _0x4ee68e=function(_0x20eb68){while(--_0x20eb68){_0x138dc8['push'](_0x138dc8['shift']());}};_0x4ee68e(++_0x4adda3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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 6b03736..97229e2 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 _0x2e54=['\x20hangup\x20faxRiceive\x20','faxpages','updateStatus','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkTrunk','Trunk','format','execute','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','exports','util','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','./rpcDb','./channel','./util/util','../rpc/faxAccount','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','syncVarSet','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','exten','uniqueid','channel','info','\x20syncNewchannel\x20','variable','hasOwnProperty','value','channelstate','channelstatedesc','operation','status','localstationid','\x20syncFaxStatus\x20','remotestationid','pagestransferred','transferrate','filename','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','name','.pdf','application/pdf','then','catch','error','stringify','\x20receiveFax\x20','merge','response','AttachmentId','update','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20'];(function(_0x4d2936,_0x22d1df){var _0x584438=function(_0x45eb82){while(--_0x45eb82){_0x4d2936['push'](_0x4d2936['shift']());}};_0x584438(++_0x22d1df);}(_0x2e54,0x1dd));var _0x42e5=function(_0x4bcb3c,_0x170a44){_0x4bcb3c=_0x4bcb3c-0x0;var _0x552b53=_0x2e54[_0x4bcb3c];return _0x552b53;};'use strict';var util=require(_0x42e5('0x0'));var _=require('lodash');var BPromise=require('bluebird');var uuid=require(_0x42e5('0x1'));var moment=require(_0x42e5('0x2'));var path=require(_0x42e5('0x3'));var tiff2pdf=require(_0x42e5('0x4'));var gs=require(_0x42e5('0x5'));var logger=require(_0x42e5('0x6'))(_0x42e5('0x7'));var ami=require('../ami');var rpcDb=require(_0x42e5('0x8'));var Channel=require(_0x42e5('0x9'));var ut=require(_0x42e5('0xa'));var Action=require('./action');var faxAccount=require(_0x42e5('0xb'));var attachment=require('../rpc/attachment');var faxMessage=require(_0x42e5('0xc'));function Fax(_0x490b99){this[_0x42e5('0xd')]={};this[_0x42e5('0xe')]=_0x490b99[_0x42e5('0xe')];this[_0x42e5('0xf')]=_0x490b99[_0x42e5('0xf')];this[_0x42e5('0x10')]={};ami['on'](_0x42e5('0x11'),this[_0x42e5('0x12')][_0x42e5('0x13')](this));ami['on']('varset',this[_0x42e5('0x14')][_0x42e5('0x13')](this));ami['on']('newstate',this[_0x42e5('0x15')][_0x42e5('0x13')](this));ami['on'](_0x42e5('0x16'),this[_0x42e5('0x17')][_0x42e5('0x13')](this));ami['on'](_0x42e5('0x18'),this[_0x42e5('0x19')][_0x42e5('0x13')](this));ami['on'](_0x42e5('0x1a'),this[_0x42e5('0x1b')]['bind'](this));ami['on'](_0x42e5('0x1c'),this[_0x42e5('0x1d')][_0x42e5('0x13')](this));ami['on'](_0x42e5('0x1e'),this[_0x42e5('0x1f')][_0x42e5('0x13')](this));}Fax[_0x42e5('0x20')][_0x42e5('0x12')]=function(_0x16c753){if(_0x16c753[_0x42e5('0x21')]===_0x42e5('0x22')){for(var _0x38282d in this[_0x42e5('0xe')]){if(this[_0x42e5('0xe')]['hasOwnProperty'](_0x38282d)){if(_0x16c753[_0x42e5('0x23')]===this['faxAccounts'][_0x38282d]['localstationid']){this[_0x42e5('0xd')][_0x16c753[_0x42e5('0x24')]]={};this['channels'][_0x16c753[_0x42e5('0x24')]][_0x42e5('0x25')]=_0x16c753[_0x42e5('0x25')];this[_0x42e5('0xd')][_0x16c753[_0x42e5('0x24')]]['id']=this[_0x42e5('0xe')][_0x38282d]['id'];this[_0x42e5('0xd')][_0x16c753['uniqueid']]['name']=this[_0x42e5('0xe')][_0x38282d]['name'];logger[_0x42e5('0x26')](_0x16c753[_0x42e5('0x24')],_0x42e5('0x27'));}}}}if(this[_0x42e5('0x10')][_0x16c753[_0x42e5('0x24')]]){this['channels'][_0x16c753[_0x42e5('0x24')]]={};this[_0x42e5('0xd')][_0x16c753[_0x42e5('0x24')]][_0x42e5('0x25')]=_0x16c753[_0x42e5('0x25')];logger['info'](_0x16c753['uniqueid'],_0x42e5('0x27'));}};Fax['prototype']['syncVarSet']=function(_0x1b60be){if(this['channels'][_0x1b60be[_0x42e5('0x24')]]){for(var _0x2d9e65 in _0x1b60be[_0x42e5('0x28')]){if(_0x1b60be[_0x42e5('0x28')][_0x42e5('0x29')](_0x2d9e65)){this[_0x42e5('0xd')][_0x1b60be['uniqueid']][_0x2d9e65]=_0x1b60be[_0x42e5('0x2a')];}}}};Fax[_0x42e5('0x20')][_0x42e5('0x15')]=function(_0x2c53d4){if(this[_0x42e5('0xd')][_0x2c53d4[_0x42e5('0x24')]]){this[_0x42e5('0xd')][_0x2c53d4[_0x42e5('0x24')]][_0x42e5('0x2b')]=_0x2c53d4[_0x42e5('0x2b')];this[_0x42e5('0xd')][_0x2c53d4[_0x42e5('0x24')]][_0x42e5('0x2c')]=_0x2c53d4['channelstatedesc'];}};Fax[_0x42e5('0x20')][_0x42e5('0x17')]=function(_0x14c8fd){if(this[_0x42e5('0xd')][_0x14c8fd['uniqueid']]){for(var _0x539254 in _0x14c8fd[_0x42e5('0x28')]){if(_0x14c8fd['variable'][_0x42e5('0x29')](_0x539254)){this['channels'][_0x14c8fd[_0x42e5('0x24')]][_0x539254]=_0x14c8fd[_0x42e5('0x2a')];}}}};Fax[_0x42e5('0x20')]['syncFaxStatus']=function(_0x29b9fd){if(this[_0x42e5('0xd')][_0x29b9fd['uniqueid']]){this[_0x42e5('0xd')][_0x29b9fd['uniqueid']][_0x42e5('0x2d')]=_0x29b9fd[_0x42e5('0x2d')];this[_0x42e5('0xd')][_0x29b9fd[_0x42e5('0x24')]][_0x42e5('0x2e')]=_0x29b9fd[_0x42e5('0x2e')];this[_0x42e5('0xd')][_0x29b9fd['uniqueid']]['localstationid']=_0x29b9fd[_0x42e5('0x2f')];this[_0x42e5('0xd')][_0x29b9fd[_0x42e5('0x24')]]['filename']=_0x29b9fd['filename'];logger['info'](_0x29b9fd['uniqueid'],_0x42e5('0x30'));}};Fax[_0x42e5('0x20')][_0x42e5('0x1b')]=function(_0xedb7bc){var _0x2be00e=this;if(this[_0x42e5('0xd')][_0xedb7bc[_0x42e5('0x24')]]){var _0x11060d=this['channels'][_0xedb7bc[_0x42e5('0x24')]]['id'];this['channels'][_0xedb7bc[_0x42e5('0x24')]][_0x42e5('0x31')]=_0xedb7bc[_0x42e5('0x31')];this[_0x42e5('0xd')][_0xedb7bc[_0x42e5('0x24')]][_0x42e5('0x32')]=_0xedb7bc[_0x42e5('0x32')];this['channels'][_0xedb7bc[_0x42e5('0x24')]][_0x42e5('0x2f')]=_0xedb7bc['localstationid'];this[_0x42e5('0xd')][_0xedb7bc['uniqueid']]['resolution']=_0xedb7bc['resolution'];this[_0x42e5('0xd')][_0xedb7bc[_0x42e5('0x24')]][_0x42e5('0x33')]=_0xedb7bc[_0x42e5('0x33')];this[_0x42e5('0xd')][_0xedb7bc[_0x42e5('0x24')]][_0x42e5('0x34')]=_0xedb7bc['filename'];this[_0x42e5('0xd')][_0xedb7bc[_0x42e5('0x24')]]['calleridnum']=_0xedb7bc[_0x42e5('0x35')];if(this[_0x42e5('0xd')][_0xedb7bc['uniqueid']][_0x42e5('0x32')]>0x0){tiff2pdf(_0xedb7bc[_0x42e5('0x34')],_0x42e5('0x36'),function(_0x1d0482){logger[_0x42e5('0x26')](_0xedb7bc['uniqueid'],_0x42e5('0x37'),_0x1d0482[_0x42e5('0x38')]);attachment[_0x42e5('0x39')]({'name':path[_0x42e5('0x3a')](_0xedb7bc['filename'])[_0x42e5('0x3b')],'basename':path[_0x42e5('0x3a')](_0xedb7bc[_0x42e5('0x34')])[_0x42e5('0x3b')]+_0x42e5('0x3c'),'type':_0x42e5('0x3d')})[_0x42e5('0x3e')](function(_0xf8b9e1){faxAccount['notify'](_0x11060d,{'from':_0xedb7bc[_0x42e5('0x35')],'mapKey':'fax','body':path['parse'](_0xedb7bc[_0x42e5('0x34')])[_0x42e5('0x3b')]+_0x42e5('0x3c'),'AttachmentId':_0xf8b9e1['id']})[_0x42e5('0x3f')](function(_0x3229d6){logger[_0x42e5('0x40')](_0xedb7bc[_0x42e5('0x24')],'\x20notify\x20',JSON[_0x42e5('0x41')](_0x3229d6));});})[_0x42e5('0x3f')](function(_0x224395){logger[_0x42e5('0x40')](_0xedb7bc[_0x42e5('0x24')],_0x42e5('0x42'),JSON[_0x42e5('0x41')](_0x224395));});});}logger[_0x42e5('0x26')](_0xedb7bc['uniqueid'],_0x42e5('0x42'));}};Fax[_0x42e5('0x20')][_0x42e5('0x1f')]=function(_0x48757e){if(this[_0x42e5('0x10')][_0x48757e[_0x42e5('0x24')]]){_[_0x42e5('0x43')](this[_0x42e5('0xd')][_0x48757e[_0x42e5('0x24')]],_['pick'](_0x48757e,[_0x42e5('0x44'),'reason']));}};function updateStatus(_0x27cbca){if(_0x27cbca[_0x42e5('0x45')]){faxMessage[_0x42e5('0x46')](_0x27cbca['AttachmentId'],{'failMessage':'SENDING\x20FAILED\x20'})['then'](function(_0x3e2747){ut[_0x42e5('0x47')](_0x42e5('0x48'),_0x3e2747);})[_0x42e5('0x3f')](function(_0x53edc8){ut[_0x42e5('0x47')](_0x42e5('0x49'),_0x53edc8);});}else{ut[_0x42e5('0x47')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0x42e5('0x20')]['updateStatus']=function(_0x319088,_0x2583cd,_0x53e29b){var _0x2588e6=this;var _0x18509a={};if(_0x2583cd){_0x18509a={'read':_0x2583cd};}else{_0x18509a={'failMessage':_0x53e29b};}if(this[_0x42e5('0x10')][_0x319088][_0x42e5('0x45')]){faxMessage[_0x42e5('0x46')](this[_0x42e5('0x10')][_0x319088][_0x42e5('0x45')],_0x18509a)[_0x42e5('0x3e')](function(_0x1ddd4c){ut[_0x42e5('0x47')]('[Fax][Message][Updated]',_0x1ddd4c);})[_0x42e5('0x3f')](function(_0x384057){ut[_0x42e5('0x47')](_0x42e5('0x4a'),_0x384057);})[_0x42e5('0x4b')](function(){delete _0x2588e6['channels'][_0x319088];delete _0x2588e6[_0x42e5('0x10')][_0x319088];});}else{ut[_0x42e5('0x47')](_0x42e5('0x4c'));delete this[_0x42e5('0xd')][_0x319088];delete this['actions'][_0x319088];}};Fax['prototype']['syncHangup']=function(_0x37082e){var _0x4695c3=this;if(this['channels'][_0x37082e[_0x42e5('0x24')]]){if(this[_0x42e5('0x10')][_0x37082e[_0x42e5('0x24')]]){this[_0x42e5('0xd')][_0x37082e[_0x42e5('0x24')]]['id']=this[_0x42e5('0x10')][_0x37082e[_0x42e5('0x24')]]['id'];this[_0x42e5('0xd')][_0x37082e[_0x42e5('0x24')]]['name']=this[_0x42e5('0x10')][_0x37082e['uniqueid']][_0x42e5('0x3b')];}logger[_0x42e5('0x26')](_0x37082e[_0x42e5('0x24')],this[_0x42e5('0x10')][_0x37082e[_0x42e5('0x24')]]?_0x42e5('0x4d'):_0x42e5('0x4e'),JSON[_0x42e5('0x41')](this[_0x42e5('0xd')][_0x37082e[_0x42e5('0x24')]]));if(this[_0x42e5('0x10')][_0x37082e['uniqueid']]){if(this[_0x42e5('0xd')][_0x37082e['uniqueid']][_0x42e5('0x4f')]>0x0&&this['channels'][_0x37082e[_0x42e5('0x24')]][_0x42e5('0x18')]==='SUCCESS'){this[_0x42e5('0x50')](_0x37082e[_0x42e5('0x24')],!![]);}else{this['updateStatus'](_0x37082e[_0x42e5('0x24')],![],this[_0x42e5('0xd')][_0x37082e['uniqueid']][_0x42e5('0x51')]?_0x42e5('0x52')+this[_0x42e5('0xd')][_0x37082e['uniqueid']][_0x42e5('0x51')]:_0x42e5('0x53'));}}}};Fax[_0x42e5('0x20')][_0x42e5('0x54')]=function(_0x57368e){var _0x42db50=this;return new BPromise(function(_0x4a4327,_0x259291){_0x42db50[_0x42e5('0x55')](_0x57368e,_0x42db50[_0x42e5('0xe')][_0x57368e[_0x42e5('0x56')]])[_0x42e5('0x3e')](function(_0x3c6914){ut[_0x42e5('0x47')]('[Fax][execOriginate][success]',_0x3c6914);_0x4a4327(ut[_0x42e5('0x38')](_0x42e5('0x57')));})[_0x42e5('0x3f')](function(_0x93c05d){ut[_0x42e5('0x47')](_0x42e5('0x58'),_0x93c05d);updateStatus(_0x57368e);_0x259291(ut[_0x42e5('0x38')](_0x42e5('0x59')));});});};Fax[_0x42e5('0x20')]['checkAfterSend']=function(_0x1cf8e4){var _0x30d2b5=this;return new BPromise(function(_0x2af01f,_0x1163b2){var _0x5b1a5c=_0x30d2b5[_0x42e5('0x5a')](_0x30d2b5[_0x42e5('0xe')][_0x1cf8e4[_0x42e5('0x56')]][_0x42e5('0x5b')],_0x1cf8e4);if(_0x5b1a5c['isValid']){_0x2af01f(ut['message']('Trunk\x20Reachable'));}else{_0x1163b2(ut[_0x42e5('0x38')](_0x5b1a5c[_0x42e5('0x38')]));}});};function originate(_0x8c7c57,_0x2ce1d4,_0xb198d){return new BPromise(function(_0x14d111,_0x1cfe79){if(_0xb198d){var _0x3cc383=util[_0x42e5('0x5c')]('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[_0x42e5('0x3a')](_0x8c7c57[_0x42e5('0x3')])[_0x42e5('0x3b')],_0x8c7c57[_0x42e5('0x3')]);gs[_0x42e5('0x5d')](_0x3cc383)[_0x42e5('0x3e')](function(){_0x8c7c57[_0x42e5('0x3')]=util[_0x42e5('0x5c')]('%s/%s.tif',path['parse'](_0x8c7c57[_0x42e5('0x3')])[_0x42e5('0x5e')],path['parse'](_0x8c7c57['path'])['name']);_0x2ce1d4[_0x42e5('0x5f')]=_0x8c7c57[_0x42e5('0x3')];ut['logger'](_0x42e5('0x60'),'');ami[_0x42e5('0x61')](ut['variablesAction'](_0x8c7c57,_0x2ce1d4))[_0x42e5('0x3e')](function(_0x14e1ee){_0x14d111(_0x14e1ee);})['catch'](function(_0x3517d0){_0x1cfe79(_0x3517d0);});})['catch'](function(_0x49945e){_0x1cfe79(_0x49945e);});}else{ami['Action'](ut['variablesAction'](_0x8c7c57,_0x2ce1d4))[_0x42e5('0x3e')](function(_0x234e29){_0x14d111(_0x234e29);})['catch'](function(_0x1be0ce){_0x1cfe79(_0x1be0ce);});}});}Fax[_0x42e5('0x20')][_0x42e5('0x55')]=function(_0x290010,_0x1d7c2a){var _0x3f813a=this;return new BPromise(function(_0x53f9df,_0x38e1a1){var _0xe0f6ab=uuid['v4']();var _0x51a05e=ut['addVariables'](_0x290010,_0x1d7c2a);_0x3f813a[_0x42e5('0x10')][_0xe0f6ab]=new Action(_0xe0f6ab,_0x1d7c2a,_0x290010);var _0xfa822e=_0x3f813a[_0x42e5('0x10')][_0xe0f6ab];if(path[_0x42e5('0x3a')](_0x290010[_0x42e5('0x3')])[_0x42e5('0x62')]===_0x42e5('0x3c')){originate(_0xfa822e,_0x51a05e,!![])['then'](function(_0x5a1b63){_0x53f9df(_0x5a1b63);})['catch'](function(_0x567a00){_0x38e1a1(_0x567a00);});}else{originate(_0xfa822e,_0x51a05e,![])[_0x42e5('0x3e')](function(_0x8b16b4){_0x53f9df(_0x8b16b4);})['catch'](function(_0x1908d6){_0x38e1a1(_0x1908d6);});}});};Fax['prototype'][_0x42e5('0x63')]=function(_0x2982a2){return!_[_0x42e5('0x64')](_0x2982a2)&&!_[_0x42e5('0x64')](_0x2982a2[_0x42e5('0x3b')])&&!_[_0x42e5('0x64')](_0x2982a2[_0x42e5('0x65')])&&_0x2982a2[_0x42e5('0x65')]&&!_[_0x42e5('0x64')](this[_0x42e5('0xf')][util[_0x42e5('0x5c')](_0x42e5('0x66'),_0x2982a2[_0x42e5('0x3b')])])&&!_[_0x42e5('0x64')](this[_0x42e5('0xf')][util[_0x42e5('0x5c')](_0x42e5('0x66'),_0x2982a2[_0x42e5('0x3b')])]['status'])&&(this[_0x42e5('0xf')][util[_0x42e5('0x5c')](_0x42e5('0x66'),_0x2982a2[_0x42e5('0x3b')])][_0x42e5('0x2e')]===_0x42e5('0x67')||this[_0x42e5('0xf')][util[_0x42e5('0x5c')]('SIP/%s',_0x2982a2[_0x42e5('0x3b')])][_0x42e5('0x2e')]===_0x42e5('0x68'));};Fax[_0x42e5('0x20')][_0x42e5('0x5a')]=function(_0x5b5073,_0x590cc8){if(!this[_0x42e5('0x63')](_0x5b5073)){ut[_0x42e5('0x47')](_0x42e5('0x69'),_[_0x42e5('0x64')](_0x5b5073)?'':_0x5b5073[_0x42e5('0x3b')]+_0x42e5('0x6a'));return{'isValid':![],'message':_0x42e5('0x6b')};}if(_[_0x42e5('0x64')](_0x590cc8[_0x42e5('0x7')])){ut['logger'](_0x42e5('0x6c'),JSON[_0x42e5('0x41')](_0x590cc8));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x42e5('0x64')](_0x590cc8[_0x42e5('0x3')])){ut[_0x42e5('0x47')](_0x42e5('0x6d'),JSON['stringify'](_0x590cc8));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x42e5('0x6e')]=Fax; \ No newline at end of file +var _0xe511=['checkTrunk','isValid','Trunk\x20Reachable','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','variablesAction','Action','execOriginate','addVariables','ext','isNil','active','format','SIP/%s','unmonitored','isTrunkReachable','[Fax][checkTrunk][Trunk\x20not\x20work]','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','exports','util','lodash','uuid','path','tiff2pdf','../../../config/logger','fax','../ami','./rpcDb','./util/util','./action','../rpc/faxMessage','faxAccounts','trunks','actions','newchannel','syncNewchannel','varset','syncVarSet','bind','newstate','syncNewState','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channels','channel','name','info','\x20syncNewchannel\x20','prototype','variable','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','notify','catch','error','stringify','\x20receiveFax\x20','pick','response','reason','update','SENDING\x20FAILED\x20','then','logger','[Fax][Message][Error][NoUpdate2]','updateStatus','AttachmentId','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','FaxAccountId','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend'];(function(_0x5c4585,_0x3d0eab){var _0x21dede=function(_0x5c3d6a){while(--_0x5c3d6a){_0x5c4585['push'](_0x5c4585['shift']());}};_0x21dede(++_0x3d0eab);}(_0xe511,0x16f));var _0x1e51=function(_0x253946,_0x1c8d56){_0x253946=_0x253946-0x0;var _0x198cd6=_0xe511[_0x253946];return _0x198cd6;};'use strict';var util=require(_0x1e51('0x0'));var _=require(_0x1e51('0x1'));var BPromise=require('bluebird');var uuid=require(_0x1e51('0x2'));var moment=require('moment');var path=require(_0x1e51('0x3'));var tiff2pdf=require(_0x1e51('0x4'));var gs=require('./util/gs');var logger=require(_0x1e51('0x5'))(_0x1e51('0x6'));var ami=require(_0x1e51('0x7'));var rpcDb=require(_0x1e51('0x8'));var Channel=require('./channel');var ut=require(_0x1e51('0x9'));var Action=require(_0x1e51('0xa'));var faxAccount=require('../rpc/faxAccount');var attachment=require('../rpc/attachment');var faxMessage=require(_0x1e51('0xb'));function Fax(_0x133021){this['channels']={};this['faxAccounts']=_0x133021[_0x1e51('0xc')];this[_0x1e51('0xd')]=_0x133021[_0x1e51('0xd')];this[_0x1e51('0xe')]={};ami['on'](_0x1e51('0xf'),this[_0x1e51('0x10')]['bind'](this));ami['on'](_0x1e51('0x11'),this[_0x1e51('0x12')][_0x1e51('0x13')](this));ami['on'](_0x1e51('0x14'),this[_0x1e51('0x15')][_0x1e51('0x13')](this));ami['on']('newexten',this[_0x1e51('0x16')][_0x1e51('0x13')](this));ami['on'](_0x1e51('0x17'),this[_0x1e51('0x18')][_0x1e51('0x13')](this));ami['on'](_0x1e51('0x19'),this[_0x1e51('0x1a')][_0x1e51('0x13')](this));ami['on'](_0x1e51('0x1b'),this[_0x1e51('0x1c')]['bind'](this));ami['on'](_0x1e51('0x1d'),this[_0x1e51('0x1e')][_0x1e51('0x13')](this));}Fax['prototype'][_0x1e51('0x10')]=function(_0x4f7aaf){if(_0x4f7aaf['context']===_0x1e51('0x1f')){for(var _0x27dcad in this[_0x1e51('0xc')]){if(this[_0x1e51('0xc')][_0x1e51('0x20')](_0x27dcad)){if(_0x4f7aaf[_0x1e51('0x21')]===this['faxAccounts'][_0x27dcad][_0x1e51('0x22')]){this['channels'][_0x4f7aaf[_0x1e51('0x23')]]={};this[_0x1e51('0x24')][_0x4f7aaf[_0x1e51('0x23')]][_0x1e51('0x25')]=_0x4f7aaf['channel'];this['channels'][_0x4f7aaf['uniqueid']]['id']=this['faxAccounts'][_0x27dcad]['id'];this[_0x1e51('0x24')][_0x4f7aaf['uniqueid']][_0x1e51('0x26')]=this[_0x1e51('0xc')][_0x27dcad][_0x1e51('0x26')];logger[_0x1e51('0x27')](_0x4f7aaf[_0x1e51('0x23')],_0x1e51('0x28'));}}}}if(this[_0x1e51('0xe')][_0x4f7aaf[_0x1e51('0x23')]]){this['channels'][_0x4f7aaf['uniqueid']]={};this[_0x1e51('0x24')][_0x4f7aaf[_0x1e51('0x23')]][_0x1e51('0x25')]=_0x4f7aaf[_0x1e51('0x25')];logger['info'](_0x4f7aaf['uniqueid'],'\x20syncNewchannel\x20');}};Fax[_0x1e51('0x29')][_0x1e51('0x12')]=function(_0x433c2d){if(this['channels'][_0x433c2d[_0x1e51('0x23')]]){for(var _0x49c507 in _0x433c2d['variable']){if(_0x433c2d[_0x1e51('0x2a')]['hasOwnProperty'](_0x49c507)){this[_0x1e51('0x24')][_0x433c2d[_0x1e51('0x23')]][_0x49c507]=_0x433c2d['value'];}}}};Fax[_0x1e51('0x29')][_0x1e51('0x15')]=function(_0x71c7af){if(this[_0x1e51('0x24')][_0x71c7af['uniqueid']]){this['channels'][_0x71c7af['uniqueid']][_0x1e51('0x2b')]=_0x71c7af[_0x1e51('0x2b')];this[_0x1e51('0x24')][_0x71c7af[_0x1e51('0x23')]][_0x1e51('0x2c')]=_0x71c7af[_0x1e51('0x2c')];}};Fax[_0x1e51('0x29')][_0x1e51('0x16')]=function(_0x31b678){if(this[_0x1e51('0x24')][_0x31b678[_0x1e51('0x23')]]){for(var _0x54c84e in _0x31b678[_0x1e51('0x2a')]){if(_0x31b678[_0x1e51('0x2a')][_0x1e51('0x20')](_0x54c84e)){this[_0x1e51('0x24')][_0x31b678[_0x1e51('0x23')]][_0x54c84e]=_0x31b678['value'];}}}};Fax[_0x1e51('0x29')]['syncFaxStatus']=function(_0x2a7b70){if(this[_0x1e51('0x24')][_0x2a7b70[_0x1e51('0x23')]]){this['channels'][_0x2a7b70[_0x1e51('0x23')]]['operation']=_0x2a7b70[_0x1e51('0x2d')];this['channels'][_0x2a7b70['uniqueid']][_0x1e51('0x2e')]=_0x2a7b70[_0x1e51('0x2e')];this[_0x1e51('0x24')][_0x2a7b70['uniqueid']][_0x1e51('0x22')]=_0x2a7b70['localstationid'];this[_0x1e51('0x24')][_0x2a7b70[_0x1e51('0x23')]]['filename']=_0x2a7b70[_0x1e51('0x2f')];logger[_0x1e51('0x27')](_0x2a7b70[_0x1e51('0x23')],_0x1e51('0x30'));}};Fax[_0x1e51('0x29')][_0x1e51('0x1a')]=function(_0x5c57a6){var _0x509f7d=this;if(this[_0x1e51('0x24')][_0x5c57a6['uniqueid']]){var _0x3c6c35=this[_0x1e51('0x24')][_0x5c57a6[_0x1e51('0x23')]]['id'];this[_0x1e51('0x24')][_0x5c57a6[_0x1e51('0x23')]][_0x1e51('0x31')]=_0x5c57a6[_0x1e51('0x31')];this[_0x1e51('0x24')][_0x5c57a6[_0x1e51('0x23')]][_0x1e51('0x32')]=_0x5c57a6[_0x1e51('0x32')];this['channels'][_0x5c57a6[_0x1e51('0x23')]]['localstationid']=_0x5c57a6[_0x1e51('0x22')];this[_0x1e51('0x24')][_0x5c57a6[_0x1e51('0x23')]][_0x1e51('0x33')]=_0x5c57a6[_0x1e51('0x33')];this[_0x1e51('0x24')][_0x5c57a6[_0x1e51('0x23')]][_0x1e51('0x34')]=_0x5c57a6[_0x1e51('0x34')];this[_0x1e51('0x24')][_0x5c57a6[_0x1e51('0x23')]]['filename']=_0x5c57a6['filename'];this[_0x1e51('0x24')][_0x5c57a6[_0x1e51('0x23')]][_0x1e51('0x35')]=_0x5c57a6[_0x1e51('0x35')];if(this[_0x1e51('0x24')][_0x5c57a6[_0x1e51('0x23')]][_0x1e51('0x32')]>0x0){tiff2pdf(_0x5c57a6[_0x1e51('0x2f')],'/var/opt/motion2/server/files/attachments/',function(_0x279fca){logger[_0x1e51('0x27')](_0x5c57a6[_0x1e51('0x23')],_0x1e51('0x36'),_0x279fca[_0x1e51('0x37')]);attachment[_0x1e51('0x38')]({'name':path[_0x1e51('0x39')](_0x5c57a6['filename'])[_0x1e51('0x26')],'basename':path[_0x1e51('0x39')](_0x5c57a6['filename'])[_0x1e51('0x26')]+_0x1e51('0x3a'),'type':_0x1e51('0x3b')})['then'](function(_0x2b0790){faxAccount[_0x1e51('0x3c')](_0x3c6c35,{'from':_0x5c57a6[_0x1e51('0x35')],'mapKey':_0x1e51('0x6'),'body':path[_0x1e51('0x39')](_0x5c57a6[_0x1e51('0x2f')])[_0x1e51('0x26')]+_0x1e51('0x3a'),'AttachmentId':_0x2b0790['id']})[_0x1e51('0x3d')](function(_0x551ca4){logger[_0x1e51('0x3e')](_0x5c57a6[_0x1e51('0x23')],'\x20notify\x20',JSON[_0x1e51('0x3f')](_0x551ca4));});})[_0x1e51('0x3d')](function(_0x139e9f){logger['error'](_0x5c57a6[_0x1e51('0x23')],_0x1e51('0x40'),JSON[_0x1e51('0x3f')](_0x139e9f));});});}logger['info'](_0x5c57a6[_0x1e51('0x23')],'\x20receiveFax\x20');}};Fax['prototype']['syncOriginateResponse']=function(_0x169e6c){if(this[_0x1e51('0xe')][_0x169e6c['uniqueid']]){_['merge'](this[_0x1e51('0x24')][_0x169e6c[_0x1e51('0x23')]],_[_0x1e51('0x41')](_0x169e6c,[_0x1e51('0x42'),_0x1e51('0x43')]));}};function updateStatus(_0x54ce36){if(_0x54ce36['AttachmentId']){faxMessage[_0x1e51('0x44')](_0x54ce36['AttachmentId'],{'failMessage':_0x1e51('0x45')})[_0x1e51('0x46')](function(_0x47f9c7){ut['logger']('[Fax][Message][Error][Updated]',_0x47f9c7);})[_0x1e51('0x3d')](function(_0x1cad52){ut[_0x1e51('0x47')]('[Fax][Message][Error][NoUpdate1]',_0x1cad52);});}else{ut[_0x1e51('0x47')](_0x1e51('0x48'));}}Fax[_0x1e51('0x29')][_0x1e51('0x49')]=function(_0x1ccb55,_0x12584c,_0x32fe1f){var _0x2ca91f=this;var _0x5b64f6={};if(_0x12584c){_0x5b64f6={'read':_0x12584c};}else{_0x5b64f6={'failMessage':_0x32fe1f};}if(this[_0x1e51('0xe')][_0x1ccb55][_0x1e51('0x4a')]){faxMessage[_0x1e51('0x44')](this[_0x1e51('0xe')][_0x1ccb55][_0x1e51('0x4a')],_0x5b64f6)[_0x1e51('0x46')](function(_0x5ba6c2){ut[_0x1e51('0x47')]('[Fax][Message][Updated]',_0x5ba6c2);})['catch'](function(_0x4807b9){ut[_0x1e51('0x47')](_0x1e51('0x4b'),_0x4807b9);})[_0x1e51('0x4c')](function(){delete _0x2ca91f['channels'][_0x1ccb55];delete _0x2ca91f[_0x1e51('0xe')][_0x1ccb55];});}else{ut[_0x1e51('0x47')](_0x1e51('0x4d'));delete this['channels'][_0x1ccb55];delete this[_0x1e51('0xe')][_0x1ccb55];}};Fax[_0x1e51('0x29')][_0x1e51('0x1c')]=function(_0x570193){var _0x2d5e58=this;if(this[_0x1e51('0x24')][_0x570193[_0x1e51('0x23')]]){if(this[_0x1e51('0xe')][_0x570193[_0x1e51('0x23')]]){this[_0x1e51('0x24')][_0x570193[_0x1e51('0x23')]]['id']=this[_0x1e51('0xe')][_0x570193['uniqueid']]['id'];this[_0x1e51('0x24')][_0x570193[_0x1e51('0x23')]]['name']=this['actions'][_0x570193['uniqueid']][_0x1e51('0x26')];}logger[_0x1e51('0x27')](_0x570193[_0x1e51('0x23')],this[_0x1e51('0xe')][_0x570193[_0x1e51('0x23')]]?_0x1e51('0x4e'):_0x1e51('0x4f'),JSON[_0x1e51('0x3f')](this[_0x1e51('0x24')][_0x570193['uniqueid']]));if(this['actions'][_0x570193['uniqueid']]){if(this[_0x1e51('0x24')][_0x570193[_0x1e51('0x23')]]['faxpages']>0x0&&this['channels'][_0x570193[_0x1e51('0x23')]][_0x1e51('0x17')]==='SUCCESS'){this[_0x1e51('0x49')](_0x570193[_0x1e51('0x23')],!![]);}else{this[_0x1e51('0x49')](_0x570193[_0x1e51('0x23')],![],this[_0x1e51('0x24')][_0x570193[_0x1e51('0x23')]][_0x1e51('0x50')]?_0x1e51('0x51')+this[_0x1e51('0x24')][_0x570193[_0x1e51('0x23')]]['faxstatusstring']:_0x1e51('0x52'));}}}};Fax[_0x1e51('0x29')][_0x1e51('0x53')]=function(_0x402bbd){var _0xc720e2=this;return new BPromise(function(_0x224dbc,_0x47cc50){_0xc720e2['execOriginate'](_0x402bbd,_0xc720e2[_0x1e51('0xc')][_0x402bbd[_0x1e51('0x54')]])[_0x1e51('0x46')](function(_0x13fb81){ut['logger']('[Fax][execOriginate][success]',_0x13fb81);_0x224dbc(ut['message'](_0x1e51('0x55')));})[_0x1e51('0x3d')](function(_0x100126){ut[_0x1e51('0x47')](_0x1e51('0x56'),_0x100126);updateStatus(_0x402bbd);_0x47cc50(ut['message'](_0x1e51('0x57')));});});};Fax[_0x1e51('0x29')][_0x1e51('0x58')]=function(_0x556b74){var _0x2d0ff0=this;return new BPromise(function(_0x77f0c1,_0x45e607){var _0x5f19af=_0x2d0ff0[_0x1e51('0x59')](_0x2d0ff0[_0x1e51('0xc')][_0x556b74['FaxAccountId']]['Trunk'],_0x556b74);if(_0x5f19af[_0x1e51('0x5a')]){_0x77f0c1(ut['message'](_0x1e51('0x5b')));}else{_0x45e607(ut['message'](_0x5f19af[_0x1e51('0x37')]));}});};function originate(_0xe1cfa0,_0x35f12e,_0x457e4a){return new BPromise(function(_0x5142ed,_0x37f3e6){if(_0x457e4a){var _0x4c9871=util['format'](_0x1e51('0x5c'),path[_0x1e51('0x39')](_0xe1cfa0[_0x1e51('0x3')])['name'],_0xe1cfa0[_0x1e51('0x3')]);gs[_0x1e51('0x5d')](_0x4c9871)[_0x1e51('0x46')](function(){_0xe1cfa0[_0x1e51('0x3')]=util['format'](_0x1e51('0x5e'),path['parse'](_0xe1cfa0['path'])[_0x1e51('0x5f')],path['parse'](_0xe1cfa0[_0x1e51('0x3')])['name']);_0x35f12e[_0x1e51('0x60')]=_0xe1cfa0['path'];ut[_0x1e51('0x47')](_0x1e51('0x61'),'');ami['Action'](ut[_0x1e51('0x62')](_0xe1cfa0,_0x35f12e))['then'](function(_0x204962){_0x5142ed(_0x204962);})[_0x1e51('0x3d')](function(_0x1d2753){_0x37f3e6(_0x1d2753);});})[_0x1e51('0x3d')](function(_0x2cda1a){_0x37f3e6(_0x2cda1a);});}else{ami[_0x1e51('0x63')](ut['variablesAction'](_0xe1cfa0,_0x35f12e))[_0x1e51('0x46')](function(_0x5054b0){_0x5142ed(_0x5054b0);})['catch'](function(_0x23068f){_0x37f3e6(_0x23068f);});}});}Fax[_0x1e51('0x29')][_0x1e51('0x64')]=function(_0x7091fe,_0x38dda4){var _0x25d128=this;return new BPromise(function(_0x41b43b,_0x51ef46){var _0x39dc12=uuid['v4']();var _0x260f4a=ut[_0x1e51('0x65')](_0x7091fe,_0x38dda4);_0x25d128['actions'][_0x39dc12]=new Action(_0x39dc12,_0x38dda4,_0x7091fe);var _0x4da887=_0x25d128[_0x1e51('0xe')][_0x39dc12];if(path[_0x1e51('0x39')](_0x7091fe['path'])[_0x1e51('0x66')]===_0x1e51('0x3a')){originate(_0x4da887,_0x260f4a,!![])['then'](function(_0x5eb939){_0x41b43b(_0x5eb939);})[_0x1e51('0x3d')](function(_0x49263c){_0x51ef46(_0x49263c);});}else{originate(_0x4da887,_0x260f4a,![])[_0x1e51('0x46')](function(_0x1d6a02){_0x41b43b(_0x1d6a02);})[_0x1e51('0x3d')](function(_0xd450df){_0x51ef46(_0xd450df);});}});};Fax[_0x1e51('0x29')]['isTrunkReachable']=function(_0x4e3460){return!_[_0x1e51('0x67')](_0x4e3460)&&!_[_0x1e51('0x67')](_0x4e3460['name'])&&!_[_0x1e51('0x67')](_0x4e3460[_0x1e51('0x68')])&&_0x4e3460['active']&&!_[_0x1e51('0x67')](this['trunks'][util[_0x1e51('0x69')]('SIP/%s',_0x4e3460['name'])])&&!_['isNil'](this['trunks'][util['format']('SIP/%s',_0x4e3460[_0x1e51('0x26')])]['status'])&&(this[_0x1e51('0xd')][util['format'](_0x1e51('0x6a'),_0x4e3460[_0x1e51('0x26')])][_0x1e51('0x2e')]==='reachable'||this[_0x1e51('0xd')][util[_0x1e51('0x69')]('SIP/%s',_0x4e3460[_0x1e51('0x26')])]['status']===_0x1e51('0x6b'));};Fax['prototype'][_0x1e51('0x59')]=function(_0x42318c,_0x2d5062){if(!this[_0x1e51('0x6c')](_0x42318c)){ut[_0x1e51('0x47')](_0x1e51('0x6d'),_['isNil'](_0x42318c)?'':_0x42318c[_0x1e51('0x26')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x1e51('0x6e')};}if(_[_0x1e51('0x67')](_0x2d5062[_0x1e51('0x6')])){ut[_0x1e51('0x47')]('[Fax][checkTrunk][Empty\x20Fax]',JSON['stringify'](_0x2d5062));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x1e51('0x67')](_0x2d5062[_0x1e51('0x3')])){ut[_0x1e51('0x47')](_0x1e51('0x6f'),JSON['stringify'](_0x2d5062));return{'isValid':![],'message':_0x1e51('0x70')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x1e51('0x71')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index b71e740..59443ef 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 _0x4741=['[Notify]\x20','util','bluebird','../../../config/logger','lodash','../rpc/faxAccount','error','inspect','notify','resolve','then','catch'];(function(_0x282c43,_0x586845){var _0x3773db=function(_0x6d735e){while(--_0x6d735e){_0x282c43['push'](_0x282c43['shift']());}};_0x3773db(++_0x586845);}(_0x4741,0x12d));var _0x1474=function(_0x507c0f,_0x491814){_0x507c0f=_0x507c0f-0x0;var _0x180367=_0x4741[_0x507c0f];return _0x180367;};'use strict';var util=require(_0x1474('0x0'));var BPromise=require(_0x1474('0x1'));var logger=require(_0x1474('0x2'))('preview');var _=require(_0x1474('0x3'));var faxAccount=require(_0x1474('0x4'));function loggerCatch(_0x29a810){return function(_0x1616c5){logger[_0x1474('0x5')](_0x29a810,util[_0x1474('0x6')](_0x1616c5,{'showHidden':![],'depth':null}));};}exports[_0x1474('0x7')]=function(_0x56f17d,_0x29ca67){return BPromise[_0x1474('0x8')]()[_0x1474('0x9')](faxAccount[_0x1474('0x7')](_0x56f17d,_0x29ca67))[_0x1474('0xa')](loggerCatch(_0x1474('0xb')));}; \ No newline at end of file +var _0xe60f=['error','inspect','notify','resolve','then','catch','util','bluebird','../../../config/logger','lodash','../rpc/faxAccount'];(function(_0x3fe393,_0x234a3a){var _0x534d14=function(_0x277fab){while(--_0x277fab){_0x3fe393['push'](_0x3fe393['shift']());}};_0x534d14(++_0x234a3a);}(_0xe60f,0x1ea));var _0xfe60=function(_0xea5f54,_0x153d7b){_0xea5f54=_0xea5f54-0x0;var _0xdc118e=_0xe60f[_0xea5f54];return _0xdc118e;};'use strict';var util=require(_0xfe60('0x0'));var BPromise=require(_0xfe60('0x1'));var logger=require(_0xfe60('0x2'))('preview');var _=require(_0xfe60('0x3'));var faxAccount=require(_0xfe60('0x4'));function loggerCatch(_0x490ae9){return function(_0x536a91){logger[_0xfe60('0x5')](_0x490ae9,util[_0xfe60('0x6')](_0x536a91,{'showHidden':![],'depth':null}));};}exports[_0xfe60('0x7')]=function(_0x47090e,_0x1473bf){return BPromise[_0xfe60('0x8')]()[_0xfe60('0x9')](faxAccount[_0xfe60('0x7')](_0x47090e,_0x1473bf))[_0xfe60('0xa')](loggerCatch('[Notify]\x20'));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index 7e038df..187ba4e 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 _0x25a9=['exec','execute','info','Exec\x20gs','\x20Error\x20:','util','../../../../config/logger','fax','bluebird','child_process'];(function(_0x4e630a,_0x3c006b){var _0x2cc905=function(_0x2057e9){while(--_0x2057e9){_0x4e630a['push'](_0x4e630a['shift']());}};_0x2cc905(++_0x3c006b);}(_0x25a9,0x73));var _0x925a=function(_0x211448,_0x333996){_0x211448=_0x211448-0x0;var _0x162266=_0x25a9[_0x211448];return _0x162266;};'use strict';var util=require(_0x925a('0x0'));var logger=require(_0x925a('0x1'))(_0x925a('0x2'));var BPromise=require(_0x925a('0x3'));var exec=require(_0x925a('0x4'))[_0x925a('0x5')];exports[_0x925a('0x6')]=function(_0xf987a5){return new BPromise(function(_0x1e0eb3,_0x5ec9a5){exec(_0xf987a5,function(_0x53d940,_0x52130f,_0x741486){logger[_0x925a('0x7')](_0x925a('0x8'),_0x52130f);if(_0x53d940){logger[_0x925a('0x7')](_0x925a('0x8'),_0x925a('0x9'),util['inspect'](_0x53d940,{'showHidden':![],'depth':null}),_0x52130f,_0x741486);_0x5ec9a5(_0x53d940);}_0x1e0eb3(_0x52130f);});});}; \ No newline at end of file +var _0x88ca=['exec','info','Exec\x20gs','\x20Error\x20:','inspect','util','../../../../config/logger','fax'];(function(_0x26545f,_0x1d05e5){var _0x3ea49e=function(_0x108ca2){while(--_0x108ca2){_0x26545f['push'](_0x26545f['shift']());}};_0x3ea49e(++_0x1d05e5);}(_0x88ca,0x175));var _0xa88c=function(_0xc40b9f,_0x17ec1f){_0xc40b9f=_0xc40b9f-0x0;var _0x535b9c=_0x88ca[_0xc40b9f];return _0x535b9c;};'use strict';var util=require(_0xa88c('0x0'));var logger=require(_0xa88c('0x1'))(_0xa88c('0x2'));var BPromise=require('bluebird');var exec=require('child_process')[_0xa88c('0x3')];exports['execute']=function(_0x56489b){return new BPromise(function(_0x470b7c,_0x4891fa){exec(_0x56489b,function(_0x382fba,_0x2506b0,_0x392553){logger[_0xa88c('0x4')](_0xa88c('0x5'),_0x2506b0);if(_0x382fba){logger[_0xa88c('0x4')](_0xa88c('0x5'),_0xa88c('0x6'),util[_0xa88c('0x7')](_0x382fba,{'showHidden':![],'depth':null}),_0x2506b0,_0x392553);_0x4891fa(_0x382fba);}_0x470b7c(_0x2506b0);});});}; \ 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 bc647f2..b2e90d5 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 _0x7110=['from-sip','format','\x22%s\x22\x20<%s>','localstationid','uniqueid','util','lodash','fax','message','logger','info','ecm','headerinfo','minrate','maxrate','\x22%s\x22','modem','gateway','faxdetect','path','variablesAction','originate','channel'];(function(_0xbc6873,_0x1f40d2){var _0x2d7a5d=function(_0xea07d4){while(--_0xea07d4){_0xbc6873['push'](_0xbc6873['shift']());}};_0x2d7a5d(++_0x1f40d2);}(_0x7110,0x18c));var _0x0711=function(_0x28d345,_0x258c0a){_0x28d345=_0x28d345-0x0;var _0x412cd8=_0x7110[_0x28d345];return _0x412cd8;};'use strict';var util=require(_0x0711('0x0'));var _=require(_0x0711('0x1'));var moment=require('moment');var logger=require('../../../../config/logger')(_0x0711('0x2'));exports[_0x0711('0x3')]=function(_0x326697){return{'message':_0x326697};};exports[_0x0711('0x4')]=function(_0x5bbf39,_0x31d54a){logger[_0x0711('0x5')](_0x5bbf39,util['inspect'](_0x31d54a,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x31247e,_0x1c3f85){var _0x4279e3={'XMF-ECM':_0x1c3f85[_0x0711('0x6')],'XMF-HEADERINFO':_0x1c3f85[_0x0711('0x7')],'XMF-MINRATE':_0x1c3f85[_0x0711('0x8')],'XMF-MAXRATE':_0x1c3f85[_0x0711('0x9')],'XMF-MODEM':util['format'](_0x0711('0xa'),_0x1c3f85[_0x0711('0xb')]),'XMF-GATEWAY':_0x1c3f85[_0x0711('0xc')],'XMF-FAXDETECT':_0x1c3f85[_0x0711('0xd')],'XMF-T38TIMEOUT':_0x1c3f85['t38timeout'],'XMF-LOCALSTATIONID':_0x1c3f85['localstationid'],'XMF-PATH':_0x31247e[_0x0711('0xe')]};return _0x4279e3;};exports[_0x0711('0xf')]=function(_0x3636ba,_0x233cb5){return{'actionid':_0x3636ba['uniqueid'],'action':_0x0711('0x10'),'channel':_0x3636ba[_0x0711('0x11')],'Exten':'xcally-motion-fax','Context':_0x0711('0x12'),'Priority':'1','callerid':util[_0x0711('0x13')](_0x0711('0x14'),_0x3636ba[_0x0711('0x7')]?_0x3636ba[_0x0711('0x7')]:'',_0x3636ba[_0x0711('0x15')]),'variable':_0x233cb5,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x3636ba[_0x0711('0x16')]};}; \ No newline at end of file +var _0x0c32=['inspect','addVariables','ecm','minrate','format','\x22%s\x22','modem','t38timeout','path','variablesAction','uniqueid','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','headerinfo','localstationid','util','lodash','moment','../../../../config/logger','fax','message','logger','info'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x0c32,0x130));var _0x20c3=function(_0xd626ea,_0x855b6b){_0xd626ea=_0xd626ea-0x0;var _0x155a50=_0x0c32[_0xd626ea];return _0x155a50;};'use strict';var util=require(_0x20c3('0x0'));var _=require(_0x20c3('0x1'));var moment=require(_0x20c3('0x2'));var logger=require(_0x20c3('0x3'))(_0x20c3('0x4'));exports[_0x20c3('0x5')]=function(_0x1152fe){return{'message':_0x1152fe};};exports[_0x20c3('0x6')]=function(_0x19382d,_0x107cd7){logger[_0x20c3('0x7')](_0x19382d,util[_0x20c3('0x8')](_0x107cd7,{'showHidden':![],'depth':null}));};exports[_0x20c3('0x9')]=function(_0x430839,_0x4d069e){var _0x58bdc4={'XMF-ECM':_0x4d069e[_0x20c3('0xa')],'XMF-HEADERINFO':_0x4d069e['headerinfo'],'XMF-MINRATE':_0x4d069e[_0x20c3('0xb')],'XMF-MAXRATE':_0x4d069e['maxrate'],'XMF-MODEM':util[_0x20c3('0xc')](_0x20c3('0xd'),_0x4d069e[_0x20c3('0xe')]),'XMF-GATEWAY':_0x4d069e['gateway'],'XMF-FAXDETECT':_0x4d069e['faxdetect'],'XMF-T38TIMEOUT':_0x4d069e[_0x20c3('0xf')],'XMF-LOCALSTATIONID':_0x4d069e['localstationid'],'XMF-PATH':_0x430839[_0x20c3('0x10')]};return _0x58bdc4;};exports[_0x20c3('0x11')]=function(_0x12e9dc,_0x1f2e32){return{'actionid':_0x12e9dc[_0x20c3('0x12')],'action':_0x20c3('0x13'),'channel':_0x12e9dc[_0x20c3('0x14')],'Exten':_0x20c3('0x15'),'Context':_0x20c3('0x16'),'Priority':'1','callerid':util[_0x20c3('0xc')](_0x20c3('0x17'),_0x12e9dc[_0x20c3('0x18')]?_0x12e9dc[_0x20c3('0x18')]:'',_0x12e9dc[_0x20c3('0x19')]),'variable':_0x1f2e32,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x12e9dc['uniqueid']};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index a770e78..2393ea0 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 _0xbb3f=['./rpc/template','./rpc/campaign','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/zoho','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','getCampaigns','initCampaigns','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','[index.js][initParams]','inspect','listen','sync','error','[index.js][main]','bluebird','util','./server','./realtime','./acw','./trigger','./dialer','./preview','./fax','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger'];(function(_0x3f25db,_0x1d3686){var _0x54f29d=function(_0x2963bb){while(--_0x2963bb){_0x3f25db['push'](_0x3f25db['shift']());}};_0x54f29d(++_0x1d3686);}(_0xbb3f,0xfe));var _0xfbb3=function(_0x13f3f0,_0x151e5a){_0x13f3f0=_0x13f3f0-0x0;var _0x350c87=_0xbb3f[_0x13f3f0];return _0x350c87;};'use strict';var BPromise=require(_0xfbb3('0x0'));var util=require(_0xfbb3('0x1'));var moment=require('moment');var server=require(_0xfbb3('0x2'));var Realtime=require(_0xfbb3('0x3'));var Report=require('./report');var Acw=require(_0xfbb3('0x4'));var Trigger=require(_0xfbb3('0x5'));var Dialer=require(_0xfbb3('0x6'));var Preview=require(_0xfbb3('0x7'));var Fax=require(_0xfbb3('0x8'));var user=require('./rpc/user');var voiceQueue=require(_0xfbb3('0x9'));var voiceQueueReport=require(_0xfbb3('0xa'));var voiceCallReport=require(_0xfbb3('0xb'));var trunk=require(_0xfbb3('0xc'));var trigger=require(_0xfbb3('0xd'));var template=require(_0xfbb3('0xe'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0xfbb3('0xf'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0xfbb3('0x10'));var salesforce=require(_0xfbb3('0x11'));var sugarcrm=require(_0xfbb3('0x12'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require('./rpc/integrations/desk');var zoho=require(_0xfbb3('0x13'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0xfbb3('0x14'));var servicenow=require(_0xfbb3('0x15'));var dynamics365=require(_0xfbb3('0x16'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0xfbb3('0x17'))(_0xfbb3('0x18'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xfbb3('0x19')](_0xfbb3('0x1a'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0xfbb3('0x1a'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xfbb3('0x1b')]()[_0xfbb3('0x1c')](user[_0xfbb3('0x1d')]())[_0xfbb3('0x1c')](realtime[_0xfbb3('0x1e')]())[_0xfbb3('0x1c')](user[_0xfbb3('0x1f')]())['then'](realtime[_0xfbb3('0x20')]())[_0xfbb3('0x1c')](trunk[_0xfbb3('0x21')]())[_0xfbb3('0x1c')](realtime[_0xfbb3('0x22')]())[_0xfbb3('0x1c')](voiceQueue[_0xfbb3('0x23')]())[_0xfbb3('0x1c')](realtime[_0xfbb3('0x24')]())[_0xfbb3('0x1c')](trigger[_0xfbb3('0x25')]())[_0xfbb3('0x1c')](realtime['initTriggers']())[_0xfbb3('0x1c')](template[_0xfbb3('0x26')]())[_0xfbb3('0x1c')](realtime[_0xfbb3('0x27')]())[_0xfbb3('0x1c')](zendesk[_0xfbb3('0x28')]())['then'](realtime[_0xfbb3('0x29')]())[_0xfbb3('0x1c')](salesforce['getSalesforceAccounts']())[_0xfbb3('0x1c')](realtime['initSalesforceAccounts']())[_0xfbb3('0x1c')](sugarcrm[_0xfbb3('0x2a')]())[_0xfbb3('0x1c')](realtime['initSugarcrmAccounts']())['then'](freshdesk[_0xfbb3('0x2b')]())[_0xfbb3('0x1c')](realtime[_0xfbb3('0x2c')]())[_0xfbb3('0x1c')](desk[_0xfbb3('0x2d')]())[_0xfbb3('0x1c')](realtime[_0xfbb3('0x2e')]())[_0xfbb3('0x1c')](zoho['getZohoAccounts']())[_0xfbb3('0x1c')](realtime['initZohoAccounts']())[_0xfbb3('0x1c')](vtiger[_0xfbb3('0x2f')]())[_0xfbb3('0x1c')](realtime[_0xfbb3('0x30')]())[_0xfbb3('0x1c')](freshsales[_0xfbb3('0x31')]())[_0xfbb3('0x1c')](realtime['initFreshsalesAccounts']())[_0xfbb3('0x1c')](servicenow['getServicenowAccounts']())[_0xfbb3('0x1c')](realtime['initServicenowAccounts']())[_0xfbb3('0x1c')](dynamics365['getDynamics365Accounts']())[_0xfbb3('0x1c')](realtime['initDynamics365Accounts']())['then'](campaign[_0xfbb3('0x32')]())[_0xfbb3('0x1c')](realtime[_0xfbb3('0x33')]())[_0xfbb3('0x1c')](voiceExtension['getVoiceExtensions']())[_0xfbb3('0x1c')](realtime[_0xfbb3('0x34')]())[_0xfbb3('0x1c')](faxAccount[_0xfbb3('0x35')]())[_0xfbb3('0x1c')](realtime[_0xfbb3('0x36')]())['then'](function(){return realtime;});}function initParams(){return BPromise['resolve']()[_0xfbb3('0x1c')](voiceQueueReport[_0xfbb3('0x37')]())[_0xfbb3('0x1c')](realtime[_0xfbb3('0x38')]())[_0xfbb3('0x1c')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0xfbb3('0x1c')](realtime['initVoiceQueueHopperHistory']())[_0xfbb3('0x1c')](cmHopperHistory['getCampaignHopperHistory']())[_0xfbb3('0x1c')](realtime[_0xfbb3('0x39')]())[_0xfbb3('0x1c')](voiceCallReport[_0xfbb3('0x3a')]())[_0xfbb3('0x1c')](realtime[_0xfbb3('0x3b')]())[_0xfbb3('0x3c')](function(_0x522eaf){logger['error'](_0xfbb3('0x3d'),util[_0xfbb3('0x3e')](_0x522eaf,{'showHidden':![],'depth':null}));});}function main(){return server[_0xfbb3('0x3f')](realtime,preview,fax)[_0xfbb3('0x1c')](function(_0x5b9af4){return initRealtime();})[_0xfbb3('0x1c')](function(){return initParams();})[_0xfbb3('0x1c')](function(){report[_0xfbb3('0x40')]();setInterval(initRealtime,0x1388);})[_0xfbb3('0x3c')](function(_0xbdc423){logger[_0xfbb3('0x41')](_0xfbb3('0x42'),util[_0xfbb3('0x3e')](_0xbdc423,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0xc408=['./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','ami','get','then','getAgents','getTelephones','initTelephones','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','error','[index.js][initParams]','listen','sync','catch','[index.js][main]','inspect','util','moment','./server','./report','./acw','./dialer','./preview','./fax','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/cmHopperHistory','./rpc/voiceExtension'];(function(_0x13f980,_0x1e1c56){var _0x27153c=function(_0x3953d5){while(--_0x3953d5){_0x13f980['push'](_0x13f980['shift']());}};_0x27153c(++_0x1e1c56);}(_0xc408,0x7a));var _0x8c40=function(_0x5cb412,_0xca6392){_0x5cb412=_0x5cb412-0x0;var _0x24f3cd=_0xc408[_0x5cb412];return _0x24f3cd;};'use strict';var BPromise=require('bluebird');var util=require(_0x8c40('0x0'));var moment=require(_0x8c40('0x1'));var server=require(_0x8c40('0x2'));var Realtime=require('./realtime');var Report=require(_0x8c40('0x3'));var Acw=require(_0x8c40('0x4'));var Trigger=require('./trigger');var Dialer=require(_0x8c40('0x5'));var Preview=require(_0x8c40('0x6'));var Fax=require(_0x8c40('0x7'));var user=require('./rpc/user');var voiceQueue=require(_0x8c40('0x8'));var voiceQueueReport=require(_0x8c40('0x9'));var voiceCallReport=require(_0x8c40('0xa'));var trunk=require(_0x8c40('0xb'));var trigger=require('./rpc/trigger');var template=require('./rpc/template');var cmHopperHistory=require(_0x8c40('0xc'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0x8c40('0xd'));var faxAccount=require(_0x8c40('0xe'));var zendesk=require(_0x8c40('0xf'));var salesforce=require(_0x8c40('0x10'));var sugarcrm=require(_0x8c40('0x11'));var freshdesk=require(_0x8c40('0x12'));var desk=require('./rpc/integrations/desk');var zoho=require(_0x8c40('0x13'));var vtiger=require(_0x8c40('0x14'));var freshsales=require(_0x8c40('0x15'));var servicenow=require(_0x8c40('0x16'));var dynamics365=require(_0x8c40('0x17'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require('../../config/logger')(_0x8c40('0x18'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x8c40('0x19')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get']('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0x8c40('0x1a')](user[_0x8c40('0x1b')]())[_0x8c40('0x1a')](realtime['initAgents']())[_0x8c40('0x1a')](user[_0x8c40('0x1c')]())[_0x8c40('0x1a')](realtime[_0x8c40('0x1d')]())['then'](trunk['getTrunks']())[_0x8c40('0x1a')](realtime[_0x8c40('0x1e')]())[_0x8c40('0x1a')](voiceQueue[_0x8c40('0x1f')]())['then'](realtime[_0x8c40('0x20')]())[_0x8c40('0x1a')](trigger[_0x8c40('0x21')]())[_0x8c40('0x1a')](realtime[_0x8c40('0x22')]())[_0x8c40('0x1a')](template[_0x8c40('0x23')]())[_0x8c40('0x1a')](realtime[_0x8c40('0x24')]())['then'](zendesk[_0x8c40('0x25')]())[_0x8c40('0x1a')](realtime[_0x8c40('0x26')]())['then'](salesforce['getSalesforceAccounts']())[_0x8c40('0x1a')](realtime[_0x8c40('0x27')]())[_0x8c40('0x1a')](sugarcrm[_0x8c40('0x28')]())[_0x8c40('0x1a')](realtime['initSugarcrmAccounts']())[_0x8c40('0x1a')](freshdesk[_0x8c40('0x29')]())['then'](realtime[_0x8c40('0x2a')]())[_0x8c40('0x1a')](desk[_0x8c40('0x2b')]())[_0x8c40('0x1a')](realtime['initDeskAccounts']())[_0x8c40('0x1a')](zoho[_0x8c40('0x2c')]())[_0x8c40('0x1a')](realtime[_0x8c40('0x2d')]())[_0x8c40('0x1a')](vtiger[_0x8c40('0x2e')]())[_0x8c40('0x1a')](realtime[_0x8c40('0x2f')]())[_0x8c40('0x1a')](freshsales['getFreshsalesAccounts']())[_0x8c40('0x1a')](realtime[_0x8c40('0x30')]())['then'](servicenow[_0x8c40('0x31')]())[_0x8c40('0x1a')](realtime[_0x8c40('0x32')]())['then'](dynamics365[_0x8c40('0x33')]())['then'](realtime['initDynamics365Accounts']())[_0x8c40('0x1a')](campaign[_0x8c40('0x34')]())['then'](realtime[_0x8c40('0x35')]())[_0x8c40('0x1a')](voiceExtension[_0x8c40('0x36')]())[_0x8c40('0x1a')](realtime['initVoiceExtensions']())[_0x8c40('0x1a')](faxAccount['getFaxAccounts']())[_0x8c40('0x1a')](realtime[_0x8c40('0x37')]())[_0x8c40('0x1a')](function(){return realtime;});}function initParams(){return BPromise['resolve']()[_0x8c40('0x1a')](voiceQueueReport[_0x8c40('0x38')]())['then'](realtime[_0x8c40('0x39')]())[_0x8c40('0x1a')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x8c40('0x1a')](realtime[_0x8c40('0x3a')]())['then'](cmHopperHistory[_0x8c40('0x3b')]())[_0x8c40('0x1a')](realtime[_0x8c40('0x3c')]())[_0x8c40('0x1a')](voiceCallReport['getVoiceCallReports']())[_0x8c40('0x1a')](realtime['initVoiceCallReports']())['catch'](function(_0x34fee1){logger[_0x8c40('0x3d')](_0x8c40('0x3e'),util['inspect'](_0x34fee1,{'showHidden':![],'depth':null}));});}function main(){return server[_0x8c40('0x3f')](realtime,preview,fax)['then'](function(_0x3320bd){return initRealtime();})[_0x8c40('0x1a')](function(){return initParams();})[_0x8c40('0x1a')](function(){report[_0x8c40('0x40')]();setInterval(initRealtime,0x1388);})[_0x8c40('0x41')](function(_0x42ce17){logger[_0x8c40('0x3d')](_0x8c40('0x42'),util[_0x8c40('0x43')](_0x42ce17,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index f593852..cc53278 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 _0x9c44=['phone','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','onhold','local','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','talking','statePause','stateTime','address','voiceStatusQueue','stringify','format','user:%s','emit','user:presence','exports','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','state','status','unknown'];(function(_0xc48869,_0x56b37b){var _0x1f5dca=function(_0x508043){while(--_0x508043){_0xc48869['push'](_0xc48869['shift']());}};_0x1f5dca(++_0x56b37b);}(_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 md5=require(_0x49c4('0x1'));var Redis=require(_0x49c4('0x2'));var config=require(_0x49c4('0x3'));config[_0x49c4('0x4')]=_[_0x49c4('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x49c4('0x6'))(new Redis(config['redis']));function Agent(_0xc1278f){this['id']=_0xc1278f['id']||0x0;this[_0x49c4('0x7')]=_0xc1278f[_0x49c4('0x7')]||'';this[_0x49c4('0x8')]=_0xc1278f[_0x49c4('0x8')]||'';this['accountcode']=_0xc1278f[_0x49c4('0x9')]||'';this[_0x49c4('0xa')]=_0xc1278f[_0x49c4('0xa')]||'';this[_0x49c4('0xb')]='unknown';this['stateTime']=0x0;this[_0x49c4('0xc')]=_0x49c4('0xd');this['address']='';this[_0x49c4('0xe')]='';this[_0x49c4('0xf')]='';this['interface']='';this['online']=_0xc1278f[_0x49c4('0x10')]||![];this[_0x49c4('0x11')]='unknown';this[_0x49c4('0x12')]=0x0;this[_0x49c4('0x13')]='';this['voiceStatusQueue']='';this[_0x49c4('0x14')]=![];this[_0x49c4('0x15')]=![];this[_0x49c4('0x1')]='';}Agent[_0x49c4('0x16')][_0x49c4('0x17')]=function(_0x18211c){var _0x75ea8;if(_0x18211c&&_0x18211c[_0x49c4('0xb')]){_0x75ea8=_0x18211c['state'][_0x49c4('0x18')]();switch(_0x75ea8){case _0x49c4('0x19'):_0x75ea8=_0x49c4('0x1a');break;case _0x49c4('0x1b'):_0x75ea8=_0x49c4('0x1c');break;}}if(_0x75ea8&&this['voiceStatus']!==_0x75ea8||_0x18211c[_0x49c4('0x1d')]){this[_0x49c4('0x12')]=_['toNumber'](moment()['format']('x'));}if(_0x75ea8){this[_0x49c4('0x11')]=_0x75ea8;}var _0x2f82d5={'id':this['id'],'name':this[_0x49c4('0x7')],'email':this['email'],'accountcode':this[_0x49c4('0x9')],'fullname':this['fullname'],'state':this[_0x49c4('0xb')],'stateTime':this[_0x49c4('0x1e')],'status':this[_0x49c4('0xc')],'address':this[_0x49c4('0x1f')],'online':this[_0x49c4('0x10')],'voiceStatus':this[_0x49c4('0x11')],'voiceStatusTime':this[_0x49c4('0x12')],'voiceStatusCallerIdNumber':this[_0x49c4('0x13')],'voiceStatusQueue':this[_0x49c4('0x20')],'interface':this['interface'],'onhold':this['onhold']};var _0x57f502=md5(JSON[_0x49c4('0x21')](_0x2f82d5));if(this['md5']!==_0x57f502){this['md5']=_0x57f502;io['to'](util[_0x49c4('0x22')](_0x49c4('0x23'),_0x2f82d5[_0x49c4('0x7')]))[_0x49c4('0x24')]('user:save',_0x2f82d5);io['emit'](_0x49c4('0x25'),_0x2f82d5);}};module[_0x49c4('0x26')]=Agent; \ No newline at end of file +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(_0x3b660f,_0x45c3db){var _0x187a29=function(_0x11cedf){while(--_0x11cedf){_0x3b660f['push'](_0x3b660f['shift']());}};_0x187a29(++_0x45c3db);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'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 diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 28a3afe..fce6419 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 _0x98fe=['dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','campaign','temp','ivrAnswerCallsDay','message','sendMessageOneNotActive','active','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix'];(function(_0x1a5014,_0x343d0a){var _0xa03a09=function(_0x117ca5){while(--_0x117ca5){_0x1a5014['push'](_0x1a5014['shift']());}};_0xa03a09(++_0x343d0a);}(_0x98fe,0xfb));var _0xe98f=function(_0x449943,_0x43b9ae){_0x449943=_0x449943-0x0;var _0x44d8cd=_0x98fe[_0x449943];return _0x44d8cd;};'use strict';function Campaign(_0x26d626){this['id']=_0x26d626['id']||0x0;this[_0xe98f('0x0')]=_0x26d626['name']||'';this['type']=_0x26d626[_0xe98f('0x1')]||_0xe98f('0x2');this['originated']=0x0;this[_0xe98f('0x3')]=0x0;this[_0xe98f('0x4')]=0x0;this['ivrTotalCallsDays']=0x0;this[_0xe98f('0x5')]='';this[_0xe98f('0x6')]=!![];this[_0xe98f('0x7')]=_0x26d626[_0xe98f('0x7')];this['limitCalls']=_0x26d626['limitCalls'];this['dialTimezone']=_0x26d626[_0xe98f('0x8')]||null;this[_0xe98f('0x9')]=_0x26d626['dialGlobalInterval']?_0x26d626[_0xe98f('0x9')]:null;this[_0xe98f('0xa')]=_0x26d626['dialOriginateCallerIdName'];this['dialOriginateCallerIdNumber']=_0x26d626['dialOriginateCallerIdNumber'];this[_0xe98f('0xb')]=_0x26d626[_0xe98f('0xb')]||0x1e;this[_0xe98f('0xc')]=_0x26d626[_0xe98f('0xc')];this[_0xe98f('0xd')]=_0x26d626[_0xe98f('0xd')];this['dialBusyMaxRetry']=_0x26d626[_0xe98f('0xe')];this[_0xe98f('0xf')]=_0x26d626[_0xe98f('0xf')];this[_0xe98f('0x10')]=_0x26d626[_0xe98f('0x10')];this[_0xe98f('0x11')]=_0x26d626['dialNoAnswerRetryFrequency'];this[_0xe98f('0x12')]=_0x26d626['dialGlobalMaxRetry'];this[_0xe98f('0x13')]=_0x26d626[_0xe98f('0x13')]||0x3;this[_0xe98f('0x14')]=_0x26d626[_0xe98f('0x14')]||0x96;this[_0xe98f('0x15')]=_0x26d626[_0xe98f('0x15')]||0x3;this['dialDropRetryFrequency']=_0x26d626[_0xe98f('0x16')]||0x96;this[_0xe98f('0x17')]=_0x26d626['dialAbandonedMaxRetry']||0x3;this[_0xe98f('0x18')]=_0x26d626['dialAbandonedRetryFrequency']||0x96;this[_0xe98f('0x19')]=_0x26d626[_0xe98f('0x19')]||0x3;this[_0xe98f('0x1a')]=_0x26d626[_0xe98f('0x1a')]||0x96;this[_0xe98f('0x1b')]=_0x26d626['dialAgentRejectMaxRetry']||0x3;this[_0xe98f('0x1c')]=_0x26d626['dialAgentRejectRetryFrequency']||0x96;this['dialOrderByScheduledAt']=_0x26d626[_0xe98f('0x1d')]||'DESC';this[_0xe98f('0x1e')]=_0x26d626['dialPrefix']||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x26d626[_0xe98f('0x1f')]||undefined;this[_0xe98f('0x20')]=_0x26d626['dialCutDigit']||undefined;this[_0xe98f('0x21')]=_0x26d626[_0xe98f('0x21')]?_0x26d626[_0xe98f('0x21')]:undefined;this['Trunk']=_0x26d626['Trunk']?_0x26d626[_0xe98f('0x22')]:undefined;this[_0xe98f('0x23')]=_0x26d626[_0xe98f('0x23')]?_0x26d626['Interval']:undefined;this['SquareProject']=_0x26d626[_0xe98f('0x24')]?_0x26d626[_0xe98f('0x24')]:undefined;this[_0xe98f('0x25')]=_0x26d626[_0xe98f('0x24')]?_0x26d626[_0xe98f('0x24')][_0xe98f('0x0')]:undefined;this['dialAMDActive']=_0x26d626['dialAMDActive']||![];this[_0xe98f('0x26')]=_0x26d626[_0xe98f('0x26')];this[_0xe98f('0x27')]=_0x26d626['dialAMDGreeting'];this[_0xe98f('0x28')]=_0x26d626[_0xe98f('0x28')];this['dialAMDTotalAnalysisTime']=_0x26d626[_0xe98f('0x29')];this[_0xe98f('0x2a')]=_0x26d626['dialAMDMinWordLength'];this[_0xe98f('0x2b')]=_0x26d626[_0xe98f('0x2b')];this['dialAMDMaximumNumberOfWords']=_0x26d626[_0xe98f('0x2c')];this[_0xe98f('0x2d')]=_0x26d626['dialAMDSilenceThreshold'];this['dialAMDMaximumWordLength']=_0x26d626[_0xe98f('0x2e')];}module['exports']=Campaign; \ No newline at end of file +var _0x04a8=['dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive'];(function(_0x296754,_0x5befe9){var _0x1d9f1d=function(_0x3f033e){while(--_0x3f033e){_0x296754['push'](_0x296754['shift']());}};_0x1d9f1d(++_0x5befe9);}(_0x04a8,0x1de));var _0x804a=function(_0x3f74fe,_0x4a517a){_0x3f74fe=_0x3f74fe-0x0;var _0xf3e4aa=_0x04a8[_0x3f74fe];return _0xf3e4aa;};'use strict';function Campaign(_0x36f67d){this['id']=_0x36f67d['id']||0x0;this[_0x804a('0x0')]=_0x36f67d[_0x804a('0x0')]||'';this[_0x804a('0x1')]=_0x36f67d['type']||_0x804a('0x2');this[_0x804a('0x3')]=0x0;this['temp']=0x0;this[_0x804a('0x4')]=0x0;this[_0x804a('0x5')]=0x0;this[_0x804a('0x6')]='';this[_0x804a('0x7')]=!![];this['active']=_0x36f67d[_0x804a('0x8')];this[_0x804a('0x9')]=_0x36f67d['limitCalls'];this[_0x804a('0xa')]=_0x36f67d[_0x804a('0xa')]||null;this[_0x804a('0xb')]=_0x36f67d['dialGlobalInterval']?_0x36f67d['dialGlobalInterval']:null;this[_0x804a('0xc')]=_0x36f67d['dialOriginateCallerIdName'];this[_0x804a('0xd')]=_0x36f67d[_0x804a('0xd')];this[_0x804a('0xe')]=_0x36f67d[_0x804a('0xe')]||0x1e;this[_0x804a('0xf')]=_0x36f67d[_0x804a('0xf')];this['dialCongestionRetryFrequency']=_0x36f67d[_0x804a('0x10')];this[_0x804a('0x11')]=_0x36f67d[_0x804a('0x11')];this[_0x804a('0x12')]=_0x36f67d[_0x804a('0x12')];this['dialNoAnswerMaxRetry']=_0x36f67d[_0x804a('0x13')];this[_0x804a('0x14')]=_0x36f67d['dialNoAnswerRetryFrequency'];this['dialGlobalMaxRetry']=_0x36f67d[_0x804a('0x15')];this['dialNoSuchNumberMaxRetry']=_0x36f67d[_0x804a('0x16')]||0x3;this[_0x804a('0x17')]=_0x36f67d[_0x804a('0x17')]||0x96;this['dialDropMaxRetry']=_0x36f67d[_0x804a('0x18')]||0x3;this[_0x804a('0x19')]=_0x36f67d[_0x804a('0x19')]||0x96;this[_0x804a('0x1a')]=_0x36f67d['dialAbandonedMaxRetry']||0x3;this[_0x804a('0x1b')]=_0x36f67d[_0x804a('0x1b')]||0x96;this['dialMachineMaxRetry']=_0x36f67d[_0x804a('0x1c')]||0x3;this[_0x804a('0x1d')]=_0x36f67d[_0x804a('0x1d')]||0x96;this[_0x804a('0x1e')]=_0x36f67d['dialAgentRejectMaxRetry']||0x3;this[_0x804a('0x1f')]=_0x36f67d[_0x804a('0x1f')]||0x96;this['dialOrderByScheduledAt']=_0x36f67d[_0x804a('0x20')]||'DESC';this[_0x804a('0x21')]=_0x36f67d[_0x804a('0x21')]||undefined;this[_0x804a('0x22')]=_0x36f67d[_0x804a('0x22')]||undefined;this[_0x804a('0x23')]=_0x36f67d[_0x804a('0x23')]||undefined;this[_0x804a('0x24')]=_0x36f67d['TrunkBackup']?_0x36f67d['TrunkBackup']:undefined;this[_0x804a('0x25')]=_0x36f67d[_0x804a('0x25')]?_0x36f67d[_0x804a('0x25')]:undefined;this[_0x804a('0x26')]=_0x36f67d[_0x804a('0x26')]?_0x36f67d[_0x804a('0x26')]:undefined;this[_0x804a('0x27')]=_0x36f67d['SquareProject']?_0x36f67d[_0x804a('0x27')]:undefined;this[_0x804a('0x28')]=_0x36f67d[_0x804a('0x27')]?_0x36f67d[_0x804a('0x27')][_0x804a('0x0')]:undefined;this['dialAMDActive']=_0x36f67d[_0x804a('0x29')]||![];this['dialAMDInitialSilence']=_0x36f67d[_0x804a('0x2a')];this[_0x804a('0x2b')]=_0x36f67d[_0x804a('0x2b')];this[_0x804a('0x2c')]=_0x36f67d[_0x804a('0x2c')];this[_0x804a('0x2d')]=_0x36f67d[_0x804a('0x2d')];this['dialAMDMinWordLength']=_0x36f67d[_0x804a('0x2e')];this[_0x804a('0x2f')]=_0x36f67d[_0x804a('0x2f')];this['dialAMDMaximumNumberOfWords']=_0x36f67d[_0x804a('0x30')];this[_0x804a('0x31')]=_0x36f67d[_0x804a('0x31')];this[_0x804a('0x32')]=_0x36f67d[_0x804a('0x32')];}module[_0x804a('0x33')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 1c9703b..1b0fbb4 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 _0x5324=['queue','transferconnectedlinenum','mohtime','exports','starttime','channel','destinationchannel','calleridnum','connectedlinenum','accountcode','context','uniqueid','linkedid','exten','answered','answertime','endtime','abandoned','lastapplication','lastdata','duration','billableseconds','holdtime','type','tag','disposition','monitor','monitorFilename'];(function(_0x14199,_0x4f8ea3){var _0x2415e2=function(_0x42761f){while(--_0x42761f){_0x14199['push'](_0x14199['shift']());}};_0x2415e2(++_0x4f8ea3);}(_0x5324,0x154));var _0x4532=function(_0x193231,_0xabca8){_0x193231=_0x193231-0x0;var _0x55fbd4=_0x5324[_0x193231];return _0x55fbd4;};'use strict';function Channel(){this[_0x4532('0x0')]=null;this[_0x4532('0x1')]='';this[_0x4532('0x2')]='';this[_0x4532('0x3')]=0x0;this['calleridname']='';this[_0x4532('0x4')]=undefined;this['connectedlinename']=undefined;this[_0x4532('0x5')]=0x0;this[_0x4532('0x6')]='';this[_0x4532('0x7')]=0x0;this[_0x4532('0x8')]=0x0;this[_0x4532('0x9')]=0x0;this[_0x4532('0xa')]=![];this[_0x4532('0xb')]=null;this[_0x4532('0xc')]=null;this['unmanaged']=![];this[_0x4532('0xd')]=![];this[_0x4532('0xe')]='';this[_0x4532('0xf')]='';this[_0x4532('0x10')]=0x0;this[_0x4532('0x11')]=0x0;this[_0x4532('0x12')]=0x0;this[_0x4532('0x13')]=null;this[_0x4532('0x14')]=null;this[_0x4532('0x15')]=null;this[_0x4532('0x16')]=![];this[_0x4532('0x17')]=null;this[_0x4532('0x18')]=null;this['monitors']=[];this['transfercalleridnum']=undefined;this[_0x4532('0x19')]=undefined;this['transferType']=undefined;this[_0x4532('0x1a')]=0x0;}module[_0x4532('0x1b')]=Channel; \ No newline at end of file +var _0xc0a6=['connectedlinenum','connectedlinename','accountcode','context','uniqueid','linkedid','answered','answertime','endtime','unmanaged','lastapplication','lastdata','billableseconds','type','queue','transfercalleridnum','transferconnectedlinenum','transferType','exports','starttime','channel','calleridnum','calleridname'];(function(_0x3891bb,_0x12be78){var _0x1b7637=function(_0x5071fa){while(--_0x5071fa){_0x3891bb['push'](_0x3891bb['shift']());}};_0x1b7637(++_0x12be78);}(_0xc0a6,0xcb));var _0x6c0a=function(_0x20a63e,_0xcb0bea){_0x20a63e=_0x20a63e-0x0;var _0x56fe3d=_0xc0a6[_0x20a63e];return _0x56fe3d;};'use strict';function Channel(){this[_0x6c0a('0x0')]=null;this[_0x6c0a('0x1')]='';this['destinationchannel']='';this[_0x6c0a('0x2')]=0x0;this[_0x6c0a('0x3')]='';this[_0x6c0a('0x4')]=undefined;this[_0x6c0a('0x5')]=undefined;this[_0x6c0a('0x6')]=0x0;this[_0x6c0a('0x7')]='';this[_0x6c0a('0x8')]=0x0;this[_0x6c0a('0x9')]=0x0;this['exten']=0x0;this[_0x6c0a('0xa')]=![];this[_0x6c0a('0xb')]=null;this[_0x6c0a('0xc')]=null;this[_0x6c0a('0xd')]=![];this['abandoned']=![];this[_0x6c0a('0xe')]='';this[_0x6c0a('0xf')]='';this['duration']=0x0;this[_0x6c0a('0x10')]=0x0;this['holdtime']=0x0;this[_0x6c0a('0x11')]=null;this['tag']=null;this['disposition']=null;this['monitor']=![];this['monitorFilename']=null;this[_0x6c0a('0x12')]=null;this['monitors']=[];this[_0x6c0a('0x13')]=undefined;this[_0x6c0a('0x14')]=undefined;this[_0x6c0a('0x15')]=undefined;this['mohtime']=0x0;}module[_0x6c0a('0x16')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index fe8c2ab..884455c 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 _0xe00c=['tokenSecret','serverUrl','Configurations','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe00c,0xc9));var _0xce00=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe00c[_0x3dd15e];return _0x231fd0;};'use strict';function DeskAccount(_0xd1d746){this['id']=_0xd1d746['id']||0x0;this['name']=_0xd1d746[_0xce00('0x0')]||'';this[_0xce00('0x1')]=_0xd1d746[_0xce00('0x1')]||'';this['remoteUri']=_0xd1d746[_0xce00('0x2')]||'';this[_0xce00('0x3')]=_0xd1d746['authType']||'';this[_0xce00('0x4')]=_0xd1d746[_0xce00('0x4')]||'';this['consumerKey']=_0xd1d746[_0xce00('0x5')]||'';this[_0xce00('0x6')]=_0xd1d746['consumerSecret']||'';this[_0xce00('0x7')]=_0xd1d746[_0xce00('0x7')]||'';this[_0xce00('0x8')]=_0xd1d746[_0xce00('0x8')]||'';this['type']=_0xd1d746['type']||'';this['serverUrl']=_0xd1d746[_0xce00('0x9')]||'';this[_0xce00('0xa')]=_0xd1d746[_0xce00('0xa')]||{};}module['exports']=DeskAccount; \ No newline at end of file +var _0x21a5=['Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl'];(function(_0x434eab,_0x1f6969){var _0x579004=function(_0x4f99ce){while(--_0x4f99ce){_0x434eab['push'](_0x434eab['shift']());}};_0x579004(++_0x1f6969);}(_0x21a5,0x84));var _0x521a=function(_0x10df18,_0x13338c){_0x10df18=_0x10df18-0x0;var _0x1f9a1d=_0x21a5[_0x10df18];return _0x1f9a1d;};'use strict';function DeskAccount(_0xf959f5){this['id']=_0xf959f5['id']||0x0;this[_0x521a('0x0')]=_0xf959f5[_0x521a('0x0')]||'';this[_0x521a('0x1')]=_0xf959f5[_0x521a('0x1')]||'';this[_0x521a('0x2')]=_0xf959f5[_0x521a('0x2')]||'';this['authType']=_0xf959f5[_0x521a('0x3')]||'';this[_0x521a('0x4')]=_0xf959f5[_0x521a('0x4')]||'';this['consumerKey']=_0xf959f5[_0x521a('0x5')]||'';this[_0x521a('0x6')]=_0xf959f5[_0x521a('0x6')]||'';this['token']=_0xf959f5[_0x521a('0x7')]||'';this['tokenSecret']=_0xf959f5[_0x521a('0x8')]||'';this[_0x521a('0x9')]=_0xf959f5[_0x521a('0x9')]||'';this[_0x521a('0xa')]=_0xf959f5['serverUrl']||'';this[_0x521a('0xb')]=_0xf959f5[_0x521a('0xb')]||{};}module[_0x521a('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 0481899..78fc15d 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 _0x6c76=['exports','name','username','password','remoteUri','tenantId','clientId','clientSecret','Configurations'];(function(_0x6f1031,_0x3c0a6f){var _0x4e1b8d=function(_0x159882){while(--_0x159882){_0x6f1031['push'](_0x6f1031['shift']());}};_0x4e1b8d(++_0x3c0a6f);}(_0x6c76,0x184));var _0x66c7=function(_0x3db4eb,_0x1fcb7a){_0x3db4eb=_0x3db4eb-0x0;var _0x2a8056=_0x6c76[_0x3db4eb];return _0x2a8056;};'use strict';function Dynamics365Account(_0x4d4f77){this['id']=_0x4d4f77['id']||0x0;this[_0x66c7('0x0')]=_0x4d4f77[_0x66c7('0x0')]||'';this['username']=_0x4d4f77[_0x66c7('0x1')]||'';this[_0x66c7('0x2')]=_0x4d4f77['password']||'';this['remoteUri']=_0x4d4f77[_0x66c7('0x3')]||'';this[_0x66c7('0x4')]=_0x4d4f77['tenantId']||'';this[_0x66c7('0x5')]=_0x4d4f77[_0x66c7('0x5')]||'';this['clientSecret']=_0x4d4f77[_0x66c7('0x6')]||{};this['serverUrl']=_0x4d4f77['serverUrl']||'';this[_0x66c7('0x7')]=_0x4d4f77[_0x66c7('0x7')]||{};}module[_0x66c7('0x8')]=Dynamics365Account; \ No newline at end of file +var _0xac4a=['clientId','clientSecret','serverUrl','Configurations','name','username','password','remoteUri','tenantId'];(function(_0x4def83,_0x5277f9){var _0xa4c6bf=function(_0x490614){while(--_0x490614){_0x4def83['push'](_0x4def83['shift']());}};_0xa4c6bf(++_0x5277f9);}(_0xac4a,0x13f));var _0xaac4=function(_0x4613a2,_0x45f36a){_0x4613a2=_0x4613a2-0x0;var _0x3952a8=_0xac4a[_0x4613a2];return _0x3952a8;};'use strict';function Dynamics365Account(_0x5d2081){this['id']=_0x5d2081['id']||0x0;this[_0xaac4('0x0')]=_0x5d2081[_0xaac4('0x0')]||'';this[_0xaac4('0x1')]=_0x5d2081[_0xaac4('0x1')]||'';this[_0xaac4('0x2')]=_0x5d2081['password']||'';this['remoteUri']=_0x5d2081[_0xaac4('0x3')]||'';this[_0xaac4('0x4')]=_0x5d2081[_0xaac4('0x4')]||'';this['clientId']=_0x5d2081[_0xaac4('0x5')]||'';this['clientSecret']=_0x5d2081[_0xaac4('0x6')]||{};this['serverUrl']=_0x5d2081[_0xaac4('0x7')]||'';this[_0xaac4('0x8')]=_0x5d2081['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 6d76fda..6c2e560 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 _0xd5ee=['ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xd5ee,0x93));var _0xed5e=function(_0x314b56,_0x292792){_0x314b56=_0x314b56-0x0;var _0x34e0d4=_0xd5ee[_0x314b56];return _0x34e0d4;};'use strict';function FaxAccount(_0x7be480){this['id']=_0x7be480['id']||0x0;this['name']=_0x7be480[_0xed5e('0x0')]||'';this[_0xed5e('0x1')]=_0x7be480[_0xed5e('0x1')];this['ecm']=_0x7be480[_0xed5e('0x2')];this['headerinfo']=_0x7be480[_0xed5e('0x3')];this[_0xed5e('0x4')]=_0x7be480[_0xed5e('0x4')];this[_0xed5e('0x5')]=_0x7be480[_0xed5e('0x5')]||0x960;this[_0xed5e('0x6')]=_0x7be480[_0xed5e('0x6')]||0x3840;this[_0xed5e('0x7')]=_0x7be480[_0xed5e('0x7')]||_0xed5e('0x8');this[_0xed5e('0x9')]=_0x7be480['gateway']||'no';this[_0xed5e('0xa')]=_0x7be480[_0xed5e('0xa')]||'no';this[_0xed5e('0xb')]=_0x7be480[_0xed5e('0xb')]||0x1388;this[_0xed5e('0xc')]=_0x7be480[_0xed5e('0xc')]||_0xed5e('0xd');this[_0xed5e('0xe')]=_0x7be480[_0xed5e('0xe')]?_0x7be480[_0xed5e('0xe')]:undefined;this[_0xed5e('0xf')]=_0x7be480[_0xed5e('0xf')];this['key']=_0x7be480[_0xed5e('0x10')];}module[_0xed5e('0x11')]=FaxAccount; \ No newline at end of file +var _0xfa77=['exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','faxdetect','t38timeout','tech','Trunk','ListId','key'];(function(_0x24a92f,_0x3538b4){var _0x327b7c=function(_0x2d98b5){while(--_0x2d98b5){_0x24a92f['push'](_0x24a92f['shift']());}};_0x327b7c(++_0x3538b4);}(_0xfa77,0x17b));var _0x7fa7=function(_0x2c9984,_0x9c5c02){_0x2c9984=_0x2c9984-0x0;var _0x284f97=_0xfa77[_0x2c9984];return _0x284f97;};'use strict';function FaxAccount(_0x3ce0bb){this['id']=_0x3ce0bb['id']||0x0;this[_0x7fa7('0x0')]=_0x3ce0bb[_0x7fa7('0x0')]||'';this['description']=_0x3ce0bb[_0x7fa7('0x1')];this[_0x7fa7('0x2')]=_0x3ce0bb[_0x7fa7('0x2')];this[_0x7fa7('0x3')]=_0x3ce0bb[_0x7fa7('0x3')];this[_0x7fa7('0x4')]=_0x3ce0bb[_0x7fa7('0x4')];this[_0x7fa7('0x5')]=_0x3ce0bb['minrate']||0x960;this[_0x7fa7('0x6')]=_0x3ce0bb[_0x7fa7('0x6')]||0x3840;this['modem']=_0x3ce0bb['modem']||'v17,v27,v29';this['gateway']=_0x3ce0bb['gateway']||'no';this[_0x7fa7('0x7')]=_0x3ce0bb[_0x7fa7('0x7')]||'no';this[_0x7fa7('0x8')]=_0x3ce0bb[_0x7fa7('0x8')]||0x1388;this['tech']=_0x3ce0bb[_0x7fa7('0x9')]||'SIP';this['Trunk']=_0x3ce0bb[_0x7fa7('0xa')]?_0x3ce0bb[_0x7fa7('0xa')]:undefined;this[_0x7fa7('0xb')]=_0x3ce0bb[_0x7fa7('0xb')];this[_0x7fa7('0xc')]=_0x3ce0bb[_0x7fa7('0xc')];}module[_0x7fa7('0xd')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index f527d74..f88331e 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 _0x2514=['exports','username','remoteUri','serverUrl'];(function(_0x46b22a,_0x5bf83a){var _0x44c2e8=function(_0x21b6fc){while(--_0x21b6fc){_0x46b22a['push'](_0x46b22a['shift']());}};_0x44c2e8(++_0x5bf83a);}(_0x2514,0x165));var _0x4251=function(_0x2608d7,_0x452452){_0x2608d7=_0x2608d7-0x0;var _0x54ea95=_0x2514[_0x2608d7];return _0x54ea95;};'use strict';function FreshdeskAccount(_0x44f550){this['id']=_0x44f550['id']||0x0;this['name']=_0x44f550['name']||'';this['username']=_0x44f550[_0x4251('0x0')]||'';this['apiKey']=_0x44f550['token']||'';this[_0x4251('0x1')]=_0x44f550['remoteUri']||'';this['serverUrl']=_0x44f550[_0x4251('0x2')]||'';this['Configurations']=_0x44f550['Configurations']||{};}module[_0x4251('0x3')]=FreshdeskAccount; \ No newline at end of file +var _0xefae=['remoteUri','serverUrl','Configurations','exports','name','username','token'];(function(_0x8dc04d,_0xaa7559){var _0x2f5f28=function(_0xdd2d1d){while(--_0xdd2d1d){_0x8dc04d['push'](_0x8dc04d['shift']());}};_0x2f5f28(++_0xaa7559);}(_0xefae,0x1d2));var _0xeefa=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xefae[_0x14add3];return _0x4a174f;};'use strict';function FreshdeskAccount(_0x7d5f32){this['id']=_0x7d5f32['id']||0x0;this[_0xeefa('0x0')]=_0x7d5f32[_0xeefa('0x0')]||'';this[_0xeefa('0x1')]=_0x7d5f32[_0xeefa('0x1')]||'';this['apiKey']=_0x7d5f32[_0xeefa('0x2')]||'';this[_0xeefa('0x3')]=_0x7d5f32[_0xeefa('0x3')]||'';this[_0xeefa('0x4')]=_0x7d5f32[_0xeefa('0x4')]||'';this[_0xeefa('0x5')]=_0x7d5f32['Configurations']||{};}module[_0xeefa('0x6')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 45e4f95..2b4c135 100644 --- a/server/services/ami/model/freshsalesAccount.js +++ b/server/services/ami/model/freshsalesAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x038b=['name','username','apiKey','remoteUri','serverUrl','Configurations'];(function(_0x4fc80b,_0xfe1b3d){var _0x119dba=function(_0x16ed12){while(--_0x16ed12){_0x4fc80b['push'](_0x4fc80b['shift']());}};_0x119dba(++_0xfe1b3d);}(_0x038b,0x114));var _0xb038=function(_0xa48b20,_0x27f27a){_0xa48b20=_0xa48b20-0x0;var _0x4d57a6=_0x038b[_0xa48b20];return _0x4d57a6;};'use strict';function FreshsalesAccount(_0x493b50){this['id']=_0x493b50['id']||0x0;this[_0xb038('0x0')]=_0x493b50[_0xb038('0x0')]||'';this[_0xb038('0x1')]=_0x493b50['username']||'';this[_0xb038('0x2')]=_0x493b50['token']||'';this[_0xb038('0x3')]=_0x493b50[_0xb038('0x3')]||'';this['serverUrl']=_0x493b50[_0xb038('0x4')]||'';this[_0xb038('0x5')]=_0x493b50['Configurations']||{};}module['exports']=FreshsalesAccount; \ No newline at end of file +var _0xd101=['exports','name','username','apiKey','token','remoteUri','serverUrl','Configurations'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd101,0xc1));var _0x1d10=function(_0x46a836,_0x59b1e9){_0x46a836=_0x46a836-0x0;var _0x4e6773=_0xd101[_0x46a836];return _0x4e6773;};'use strict';function FreshsalesAccount(_0x34b53f){this['id']=_0x34b53f['id']||0x0;this['name']=_0x34b53f[_0x1d10('0x0')]||'';this[_0x1d10('0x1')]=_0x34b53f[_0x1d10('0x1')]||'';this[_0x1d10('0x2')]=_0x34b53f[_0x1d10('0x3')]||'';this[_0x1d10('0x4')]=_0x34b53f[_0x1d10('0x4')]||'';this[_0x1d10('0x5')]=_0x34b53f['serverUrl']||'';this[_0x1d10('0x6')]=_0x34b53f[_0x1d10('0x6')]||{};}module[_0x1d10('0x7')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 1634a9e..9b2855c 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 _0x2daf=['holdtime','assigned','lastAssignedTo','motionChannel','exports','type','calleridnum','calleridname','queuecallerjoinAt','queuecallerleaveAt','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','context','exten'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x2daf,0x89));var _0xf2da=function(_0x5a67fa,_0x6fdba4){_0x5a67fa=_0x5a67fa-0x0;var _0x35b6e8=_0x2daf[_0x5a67fa];return _0x35b6e8;};'use strict';function QueueReport(){this[_0xf2da('0x0')]='inbound';this['uniqueid']='';this[_0xf2da('0x1')]='';this[_0xf2da('0x2')]='';this['queue']='';this[_0xf2da('0x3')]=null;this[_0xf2da('0x4')]=null;this['position']=0x1;this['count']=0x1;this[_0xf2da('0x5')]=![];this['queuecallerabandonAt']=null;this[_0xf2da('0x6')]=![];this[_0xf2da('0x7')]=null;this[_0xf2da('0x8')]=![];this[_0xf2da('0x9')]=null;this[_0xf2da('0xa')]=0x1;this[_0xf2da('0xb')]='';this[_0xf2da('0xc')]='';this[_0xf2da('0xd')]='';this[_0xf2da('0xe')]='';this[_0xf2da('0xf')]='';this[_0xf2da('0x10')]='';this['priority']='';this[_0xf2da('0x11')]=0x0;this[_0xf2da('0x12')]=![];this[_0xf2da('0x13')]='';this[_0xf2da('0x14')]='voice';this['mohtime']=0x0;this['variables']={};}module[_0xf2da('0x15')]=QueueReport; \ No newline at end of file +var _0x4fac=['connectedlinename','context','exten','priority','holdtime','assigned','lastAssignedTo','motionChannel','voice','variables','type','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','position','queuecallerabandonAt','queuecallercompleteAt','queuecallerexit','originalposition','channel'];(function(_0x5e5fa2,_0x1b68eb){var _0x1f7d0f=function(_0x3a68e8){while(--_0x3a68e8){_0x5e5fa2['push'](_0x5e5fa2['shift']());}};_0x1f7d0f(++_0x1b68eb);}(_0x4fac,0xab));var _0xc4fa=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x4fac[_0x122ef9];return _0x42fba0;};'use strict';function QueueReport(){this[_0xc4fa('0x0')]=_0xc4fa('0x1');this[_0xc4fa('0x2')]='';this[_0xc4fa('0x3')]='';this[_0xc4fa('0x4')]='';this[_0xc4fa('0x5')]='';this[_0xc4fa('0x6')]=null;this['queuecallerleaveAt']=null;this[_0xc4fa('0x7')]=0x1;this['count']=0x1;this['queuecallerabandon']=![];this[_0xc4fa('0x8')]=null;this['queuecallercomplete']=![];this[_0xc4fa('0x9')]=null;this[_0xc4fa('0xa')]=![];this['queuecallerexitAt']=null;this[_0xc4fa('0xb')]=0x1;this[_0xc4fa('0xc')]='';this['connectedlinenum']='';this[_0xc4fa('0xd')]='';this['accountcode']='';this[_0xc4fa('0xe')]='';this[_0xc4fa('0xf')]='';this[_0xc4fa('0x10')]='';this[_0xc4fa('0x11')]=0x0;this[_0xc4fa('0x12')]=![];this[_0xc4fa('0x13')]='';this[_0xc4fa('0x14')]=_0xc4fa('0x15');this['mohtime']=0x0;this[_0xc4fa('0x16')]={};}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 20d9152..404b070 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 _0xd232=['clientSecret','securityToken','type','serverUrl','Configurations','exports','name','username','remoteUri','clientId'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xd232,0x74));var _0x2d23=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd232[_0x321bb2];return _0x9c12ed;};'use strict';function SalesforceAccount(_0x318a04){this['id']=_0x318a04['id']||0x0;this['name']=_0x318a04[_0x2d23('0x0')]||'';this[_0x2d23('0x1')]=_0x318a04[_0x2d23('0x1')]||'';this[_0x2d23('0x2')]=_0x318a04[_0x2d23('0x2')]||'';this['password']=_0x318a04['password']||'';this[_0x2d23('0x3')]=_0x318a04['clientId']||'';this['clientSecret']=_0x318a04[_0x2d23('0x4')]||'';this[_0x2d23('0x5')]=_0x318a04[_0x2d23('0x5')]||'';this['type']=_0x318a04[_0x2d23('0x6')]||'integrationTab';this[_0x2d23('0x7')]=_0x318a04[_0x2d23('0x7')]||'';this[_0x2d23('0x8')]=_0x318a04[_0x2d23('0x8')]||{};}module[_0x2d23('0x9')]=SalesforceAccount; \ No newline at end of file +var _0x3991=['password','clientId','securityToken','type','integrationTab','serverUrl','Configurations','name','username','remoteUri'];(function(_0x4979c8,_0x33206d){var _0x4141bb=function(_0x45857b){while(--_0x45857b){_0x4979c8['push'](_0x4979c8['shift']());}};_0x4141bb(++_0x33206d);}(_0x3991,0x101));var _0x1399=function(_0x581c12,_0x2b75b1){_0x581c12=_0x581c12-0x0;var _0x2ba5af=_0x3991[_0x581c12];return _0x2ba5af;};'use strict';function SalesforceAccount(_0x18d00f){this['id']=_0x18d00f['id']||0x0;this[_0x1399('0x0')]=_0x18d00f[_0x1399('0x0')]||'';this[_0x1399('0x1')]=_0x18d00f['username']||'';this[_0x1399('0x2')]=_0x18d00f[_0x1399('0x2')]||'';this[_0x1399('0x3')]=_0x18d00f[_0x1399('0x3')]||'';this[_0x1399('0x4')]=_0x18d00f['clientId']||'';this['clientSecret']=_0x18d00f['clientSecret']||'';this[_0x1399('0x5')]=_0x18d00f[_0x1399('0x5')]||'';this['type']=_0x18d00f[_0x1399('0x6')]||_0x1399('0x7');this[_0x1399('0x8')]=_0x18d00f[_0x1399('0x8')]||'';this['Configurations']=_0x18d00f[_0x1399('0x9')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 1818d39..f8e9bcb 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 _0xd7d0=['username','password','remoteUri','serverUrl','Configurations','name'];(function(_0x350ea2,_0x58faa3){var _0x5dca2f=function(_0x325ede){while(--_0x325ede){_0x350ea2['push'](_0x350ea2['shift']());}};_0x5dca2f(++_0x58faa3);}(_0xd7d0,0x173));var _0x0d7d=function(_0x3fa134,_0x5ecdce){_0x3fa134=_0x3fa134-0x0;var _0x1a03ff=_0xd7d0[_0x3fa134];return _0x1a03ff;};'use strict';function ServicenowAccount(_0x44b152){this['id']=_0x44b152['id']||0x0;this[_0x0d7d('0x0')]=_0x44b152[_0x0d7d('0x0')]||'';this[_0x0d7d('0x1')]=_0x44b152['username']||'';this[_0x0d7d('0x2')]=_0x44b152[_0x0d7d('0x2')]||'';this['remoteUri']=_0x44b152[_0x0d7d('0x3')]||'';this[_0x0d7d('0x4')]=_0x44b152[_0x0d7d('0x4')]||'';this['Configurations']=_0x44b152[_0x0d7d('0x5')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file +var _0x7c3e=['serverUrl','Configurations','name','username','password','remoteUri'];(function(_0x52838f,_0x55eb08){var _0xa3f47f=function(_0x34b594){while(--_0x34b594){_0x52838f['push'](_0x52838f['shift']());}};_0xa3f47f(++_0x55eb08);}(_0x7c3e,0x1d6));var _0xe7c3=function(_0x33cf66,_0x30e414){_0x33cf66=_0x33cf66-0x0;var _0x3a400b=_0x7c3e[_0x33cf66];return _0x3a400b;};'use strict';function ServicenowAccount(_0x552ef2){this['id']=_0x552ef2['id']||0x0;this['name']=_0x552ef2[_0xe7c3('0x0')]||'';this[_0xe7c3('0x1')]=_0x552ef2[_0xe7c3('0x1')]||'';this[_0xe7c3('0x2')]=_0x552ef2['password']||'';this[_0xe7c3('0x3')]=_0x552ef2[_0xe7c3('0x3')]||'';this[_0xe7c3('0x4')]=_0x552ef2['serverUrl']||'';this[_0xe7c3('0x5')]=_0x552ef2[_0xe7c3('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 f0eff57..31363cd 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 _0x13d1=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0x49cb71,_0x2f0149){var _0x3a50fd=function(_0x48c304){while(--_0x48c304){_0x49cb71['push'](_0x49cb71['shift']());}};_0x3a50fd(++_0x2f0149);}(_0x13d1,0xa3));var _0x113d=function(_0x384db8,_0x11a023){_0x384db8=_0x384db8-0x0;var _0x40e833=_0x13d1[_0x384db8];return _0x40e833;};'use strict';function SugarcrmAccount(_0x105b22){this['id']=_0x105b22['id']||0x0;this[_0x113d('0x0')]=_0x105b22[_0x113d('0x0')]||'';this['username']=_0x105b22[_0x113d('0x1')]||'';this[_0x113d('0x2')]=_0x105b22[_0x113d('0x2')]||'';this[_0x113d('0x3')]=_0x105b22['remoteUri']||'';this[_0x113d('0x4')]=_0x105b22[_0x113d('0x4')]||'';this[_0x113d('0x5')]=_0x105b22[_0x113d('0x5')]||{};}module[_0x113d('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0x844d=['password','serverUrl','Configurations','username'];(function(_0x4eda7e,_0x38b16f){var _0x1261cc=function(_0xf0935e){while(--_0xf0935e){_0x4eda7e['push'](_0x4eda7e['shift']());}};_0x1261cc(++_0x38b16f);}(_0x844d,0x1df));var _0xd844=function(_0x10e840,_0x5b3935){_0x10e840=_0x10e840-0x0;var _0x405caa=_0x844d[_0x10e840];return _0x405caa;};'use strict';function SugarcrmAccount(_0x843dd0){this['id']=_0x843dd0['id']||0x0;this['name']=_0x843dd0['name']||'';this[_0xd844('0x0')]=_0x843dd0[_0xd844('0x0')]||'';this[_0xd844('0x1')]=_0x843dd0[_0xd844('0x1')]||'';this['remoteUri']=_0x843dd0['remoteUri']||'';this[_0xd844('0x2')]=_0x843dd0['serverUrl']||'';this[_0xd844('0x3')]=_0x843dd0[_0xd844('0x3')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 3b86deb..9de4f3a 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 _0xd71d=['exports','name','accountcode','unknown','stateTime','status','address'];(function(_0x395b38,_0x56ec34){var _0x51990d=function(_0x1b5dda){while(--_0x1b5dda){_0x395b38['push'](_0x395b38['shift']());}};_0x51990d(++_0x56ec34);}(_0xd71d,0x1a5));var _0xdd71=function(_0x1d5ba8,_0x412a52){_0x1d5ba8=_0x1d5ba8-0x0;var _0x1022a2=_0xd71d[_0x1d5ba8];return _0x1022a2;};'use strict';function Telephone(_0xaf57db){this['id']=_0xaf57db['id']||0x0;this[_0xdd71('0x0')]=_0xaf57db[_0xdd71('0x0')]||'';this[_0xdd71('0x1')]=_0xaf57db[_0xdd71('0x1')]||'';this['state']=_0xdd71('0x2');this[_0xdd71('0x3')]=0x0;this[_0xdd71('0x4')]='unknown';this[_0xdd71('0x5')]='';}module[_0xdd71('0x6')]=Telephone; \ No newline at end of file +var _0xd11e=['accountcode','state','unknown','stateTime','address','exports','name'];(function(_0x33ef9c,_0x365cec){var _0x1f4322=function(_0x47bbfa){while(--_0x47bbfa){_0x33ef9c['push'](_0x33ef9c['shift']());}};_0x1f4322(++_0x365cec);}(_0xd11e,0xe6));var _0xed11=function(_0x318cc4,_0xca449c){_0x318cc4=_0x318cc4-0x0;var _0x442ef8=_0xd11e[_0x318cc4];return _0x442ef8;};'use strict';function Telephone(_0x50cfb3){this['id']=_0x50cfb3['id']||0x0;this[_0xed11('0x0')]=_0x50cfb3[_0xed11('0x0')]||'';this[_0xed11('0x1')]=_0x50cfb3[_0xed11('0x1')]||'';this[_0xed11('0x2')]=_0xed11('0x3');this[_0xed11('0x4')]=0x0;this['status']=_0xed11('0x3');this[_0xed11('0x5')]='';}module[_0xed11('0x6')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 6145379..383daef 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(_0x14054b,_0x4cd614){var _0xf4ce67=function(_0x2bcfda){while(--_0x2bcfda){_0x14054b['push'](_0x14054b['shift']());}};_0xf4ce67(++_0x4cd614);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x57b931,_0x45ebc0){var _0x1bf9e4=function(_0x8c1da7){while(--_0x8c1da7){_0x57b931['push'](_0x57b931['shift']());}};_0x1bf9e4(++_0x45ebc0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 174c3f7..9f49a1e 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 _0x2032=['exports','name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x168336,_0x48d543){var _0x22d32c=function(_0x28130b){while(--_0x28130b){_0x168336['push'](_0x168336['shift']());}};_0x22d32c(++_0x48d543);}(_0x2032,0xd9));var _0x2203=function(_0x50645f,_0x442462){_0x50645f=_0x50645f-0x0;var _0x536c3d=_0x2032[_0x50645f];return _0x536c3d;};'use strict';function Trigger(_0x4d6c97){this['id']=_0x4d6c97['id']||0x0;this[_0x2203('0x0')]=_0x4d6c97[_0x2203('0x0')]||'';this[_0x2203('0x1')]=_0x4d6c97['channel']||_0x2203('0x2');this[_0x2203('0x3')]=_0x4d6c97['status']||![];this[_0x2203('0x4')]=_0x4d6c97[_0x2203('0x4')]||[];this[_0x2203('0x5')]=_0x4d6c97[_0x2203('0x5')]||[];this[_0x2203('0x6')]=_0x4d6c97[_0x2203('0x6')]||[];}module[_0x2203('0x7')]=Trigger; \ No newline at end of file +var _0x5eb8=['Actions','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x5eb8,0xb0));var _0x85eb=function(_0x19d24c,_0x62bc50){_0x19d24c=_0x19d24c-0x0;var _0x2fae8d=_0x5eb8[_0x19d24c];return _0x2fae8d;};'use strict';function Trigger(_0x5ea4df){this['id']=_0x5ea4df['id']||0x0;this['name']=_0x5ea4df[_0x85eb('0x0')]||'';this[_0x85eb('0x1')]=_0x5ea4df[_0x85eb('0x1')]||_0x85eb('0x2');this[_0x85eb('0x3')]=_0x5ea4df[_0x85eb('0x3')]||![];this[_0x85eb('0x4')]=_0x5ea4df[_0x85eb('0x4')]||[];this[_0x85eb('0x5')]=_0x5ea4df[_0x85eb('0x5')]||[];this[_0x85eb('0x6')]=_0x5ea4df[_0x85eb('0x6')]||[];}module['exports']=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 7aa68f1..05af564 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 _0x4308=['status','registry','indexOf','host','port','domain','refresh','registrationtime','address','defaultuser','exports','active','name','state','unknown','stateTime'];(function(_0x11a55c,_0x4eced9){var _0x26c390=function(_0x5b0662){while(--_0x5b0662){_0x11a55c['push'](_0x11a55c['shift']());}};_0x26c390(++_0x4eced9);}(_0x4308,0x10b));var _0x8430=function(_0x21ab87,_0xaa8266){_0x21ab87=_0x21ab87-0x0;var _0x367a25=_0x4308[_0x21ab87];return _0x367a25;};'use strict';function Trunk(_0x265512){this['id']=_0x265512['id']||0x0;this['active']=_0x265512[_0x8430('0x0')]||![];this[_0x8430('0x1')]=_0x265512['name']||'';this[_0x8430('0x2')]=_0x8430('0x3');this[_0x8430('0x4')]=0x0;this[_0x8430('0x5')]=_0x8430('0x3');this[_0x8430('0x6')]=_0x265512['registry']&&_0x265512[_0x8430('0x6')][_0x8430('0x7')](':')?_0x265512[_0x8430('0x6')]['split'](':')[0x0]:'';this[_0x8430('0x8')]='';this[_0x8430('0x9')]='';this[_0x8430('0xa')]='';this['domainport']='';this[_0x8430('0xb')]='';this['stateRegistry']=_0x8430('0x3');this[_0x8430('0xc')]='';this[_0x8430('0xd')]='';this[_0x8430('0xe')]=_0x265512['defaultuser']||'';}module[_0x8430('0xf')]=Trunk; \ No newline at end of file +var _0x21cf=['split','host','port','domain','domainport','refresh','stateRegistry','address','defaultuser','exports','active','name','state','stateTime','status','unknown','registry','indexOf'];(function(_0x420b24,_0x382adc){var _0x4da552=function(_0x4e1623){while(--_0x4e1623){_0x420b24['push'](_0x420b24['shift']());}};_0x4da552(++_0x382adc);}(_0x21cf,0xd0));var _0xf21c=function(_0x87128c,_0x505bf4){_0x87128c=_0x87128c-0x0;var _0x507047=_0x21cf[_0x87128c];return _0x507047;};'use strict';function Trunk(_0x5bfe39){this['id']=_0x5bfe39['id']||0x0;this[_0xf21c('0x0')]=_0x5bfe39[_0xf21c('0x0')]||![];this['name']=_0x5bfe39[_0xf21c('0x1')]||'';this[_0xf21c('0x2')]='unknown';this[_0xf21c('0x3')]=0x0;this[_0xf21c('0x4')]=_0xf21c('0x5');this[_0xf21c('0x6')]=_0x5bfe39[_0xf21c('0x6')]&&_0x5bfe39[_0xf21c('0x6')][_0xf21c('0x7')](':')?_0x5bfe39[_0xf21c('0x6')][_0xf21c('0x8')](':')[0x0]:'';this[_0xf21c('0x9')]='';this[_0xf21c('0xa')]='';this[_0xf21c('0xb')]='';this[_0xf21c('0xc')]='';this[_0xf21c('0xd')]='';this[_0xf21c('0xe')]=_0xf21c('0x5');this['registrationtime']='';this[_0xf21c('0xf')]='';this[_0xf21c('0x10')]=_0x5bfe39[_0xf21c('0x10')]||'';}module[_0xf21c('0x11')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 6a50f8f..da2e650 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 _0xf179=['none','mandatoryDisposition','exports','exten','recordingFormat'];(function(_0x346dd7,_0x21fcdc){var _0x172dc1=function(_0xbc432c){while(--_0xbc432c){_0x346dd7['push'](_0x346dd7['shift']());}};_0x172dc1(++_0x21fcdc);}(_0xf179,0x184));var _0x9f17=function(_0x837db3,_0x22a6d5){_0x837db3=_0x837db3-0x0;var _0x5975d3=_0xf179[_0x837db3];return _0x5975d3;};'use strict';function voiceExtension(_0x3c58f7){this['id']=_0x3c58f7['id']||0x0;this[_0x9f17('0x0')]=_0x3c58f7[_0x9f17('0x0')]||'';this[_0x9f17('0x1')]=_0x3c58f7[_0x9f17('0x1')]||_0x9f17('0x2');this[_0x9f17('0x3')]=_0x3c58f7[_0x9f17('0x3')]||![];}module[_0x9f17('0x4')]=voiceExtension; \ No newline at end of file +var _0xdb96=['exports','exten','recordingFormat','mandatoryDisposition'];(function(_0xeb1dff,_0x5d2f59){var _0x4c0ee0=function(_0x106dbd){while(--_0x106dbd){_0xeb1dff['push'](_0xeb1dff['shift']());}};_0x4c0ee0(++_0x5d2f59);}(_0xdb96,0x12d));var _0x6db9=function(_0x22df91,_0x1521d2){_0x22df91=_0x22df91-0x0;var _0x10f330=_0xdb96[_0x22df91];return _0x10f330;};'use strict';function voiceExtension(_0x4571b2){this['id']=_0x4571b2['id']||0x0;this[_0x6db9('0x0')]=_0x4571b2[_0x6db9('0x0')]||'';this[_0x6db9('0x1')]=_0x4571b2['recordingFormat']||'none';this['mandatoryDisposition']=_0x4571b2[_0x6db9('0x2')]||![];}module[_0x6db9('0x3')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 6365028..4c2203d 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 _0x2e28=['total','answered','sumDuration','sumBillable','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialGlobalInterval','dialActive','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startPredictive','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','wav','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound'];(function(_0x35d661,_0x3d9814){var _0x4c71c1=function(_0x32f81d){while(--_0x32f81d){_0x35d661['push'](_0x35d661['shift']());}};_0x4c71c1(++_0x3d9814);}(_0x2e28,0x1d3));var _0x82e2=function(_0xb5cbe7,_0x445848){_0xb5cbe7=_0xb5cbe7-0x0;var _0x3244dd=_0x2e28[_0xb5cbe7];return _0x3244dd;};'use strict';var statusDesc=[_0x82e2('0x0'),_0x82e2('0x1'),_0x82e2('0x2'),_0x82e2('0x3'),_0x82e2('0x4'),_0x82e2('0x5'),_0x82e2('0x6'),_0x82e2('0x7'),'onhold'];var monitorFormat={'wav':_0x82e2('0x8'),'wav49':_0x82e2('0x9'),'gsm':_0x82e2('0xa')};var strategy={'rrmemory':_0x82e2('0xb'),'roundrobin':_0x82e2('0xc')};function VoiceQueue(_0x1eb8c0){this['id']=_0x1eb8c0['id']||0x0;this[_0x82e2('0xd')]=_0x1eb8c0[_0x82e2('0xd')]||'';this[_0x82e2('0xe')]=_0x1eb8c0[_0x82e2('0xe')]||'';this[_0x82e2('0xf')]=_0x1eb8c0[_0x82e2('0xf')]||_0x82e2('0x10');this['waiting']=0x0;this['talking']=0x0;this[_0x82e2('0x11')]=0x0;this[_0x82e2('0x12')]=0x0;this[_0x82e2('0x13')]=0x0;this['sumHoldTime']=0x0;this[_0x82e2('0x14')]=0x0;this['unmanaged']=0x0;this[_0x82e2('0x15')]=0x0;this[_0x82e2('0x16')]=0x0;this[_0x82e2('0x17')]=0x0;this[_0x82e2('0x18')]=_0x1eb8c0[_0x82e2('0x18')]||![];this[_0x82e2('0x19')]=_0x1eb8c0[_0x82e2('0x19')]||0xa;this[_0x82e2('0x1a')]=_0x1eb8c0['autopause']||'no';this[_0x82e2('0x1b')]=!![];this[_0x82e2('0x1c')]='';this[_0x82e2('0x1d')]=0x0;this[_0x82e2('0x1e')]=0x0;this['dialTimezone']=_0x1eb8c0['dialTimezone']||null;this[_0x82e2('0x1f')]=_0x1eb8c0['dialGlobalInterval']?_0x1eb8c0[_0x82e2('0x1f')]:null;this['dialActive']=_0x1eb8c0[_0x82e2('0x20')];this['dialMethod']=_0x1eb8c0['dialMethod']||_0x82e2('0x21');this[_0x82e2('0x22')]=_0x1eb8c0[_0x82e2('0x22')]||0x0;this[_0x82e2('0x23')]=_0x1eb8c0[_0x82e2('0x23')]||0x0;this[_0x82e2('0x24')]=_0x1eb8c0['dialPowerLevel']||0x1;this[_0x82e2('0x25')]=_0x1eb8c0['dialPredictiveOptimization']||_0x82e2('0x26');this[_0x82e2('0x27')]=_0x1eb8c0[_0x82e2('0x27')]||0.03;this[_0x82e2('0x28')]=_0x1eb8c0['dialPredictiveInterval']||0x258;this[_0x82e2('0x29')]=_0x1eb8c0[_0x82e2('0x29')]||_0x82e2('0x2a');this['dialOriginateCallerIdNumber']=_0x1eb8c0[_0x82e2('0x2b')]||'anonymous';this[_0x82e2('0x2c')]=_0x1eb8c0['dialOriginateTimeout']||0x1e;this['dialQueueOptions']=_0x1eb8c0[_0x82e2('0x2d')]||_0x82e2('0x2e');this[_0x82e2('0x2f')]=_0x1eb8c0['dialQueueTimeout']||0x3;this[_0x82e2('0x30')]=_0x1eb8c0[_0x82e2('0x30')]||undefined;this[_0x82e2('0x31')]=_0x1eb8c0[_0x82e2('0x31')]||0x3;this[_0x82e2('0x32')]=_0x1eb8c0[_0x82e2('0x32')]||0x96;this[_0x82e2('0x33')]=_0x1eb8c0[_0x82e2('0x33')]||0x3;this[_0x82e2('0x34')]=_0x1eb8c0[_0x82e2('0x34')]||0x96;this['dialNoAnswerMaxRetry']=_0x1eb8c0[_0x82e2('0x35')]||0x3;this['dialNoAnswerRetryFrequency']=_0x1eb8c0[_0x82e2('0x36')]||0x96;this[_0x82e2('0x37')]=_0x1eb8c0[_0x82e2('0x37')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x1eb8c0[_0x82e2('0x38')]||0x96;this[_0x82e2('0x39')]=_0x1eb8c0[_0x82e2('0x39')]||0x3;this[_0x82e2('0x3a')]=_0x1eb8c0[_0x82e2('0x3a')]||0x96;this[_0x82e2('0x3b')]=_0x1eb8c0[_0x82e2('0x3b')]||0x3;this[_0x82e2('0x3c')]=_0x1eb8c0[_0x82e2('0x3c')]||0x96;this[_0x82e2('0x3d')]=_0x1eb8c0[_0x82e2('0x3d')]||0x3;this[_0x82e2('0x3e')]=_0x1eb8c0['dialMachineRetryFrequency']||0x96;this[_0x82e2('0x3f')]=_0x1eb8c0[_0x82e2('0x3f')]||0x3;this[_0x82e2('0x40')]=_0x1eb8c0[_0x82e2('0x40')]||0x96;this[_0x82e2('0x41')]=_0x1eb8c0[_0x82e2('0x41')]||0x4;this[_0x82e2('0x42')]=_0x1eb8c0[_0x82e2('0x42')]?_0x1eb8c0[_0x82e2('0x42')]:undefined;this[_0x82e2('0x43')]=_0x1eb8c0[_0x82e2('0x43')]?_0x1eb8c0[_0x82e2('0x43')]:undefined;this['dialPrefix']=_0x1eb8c0[_0x82e2('0x44')]||undefined;this['Interval']=_0x1eb8c0[_0x82e2('0x45')]?_0x1eb8c0[_0x82e2('0x45')]:undefined;this['dialOrderByScheduledAt']=_0x1eb8c0[_0x82e2('0x46')]||_0x82e2('0x47');this[_0x82e2('0x48')]=_0x1eb8c0[_0x82e2('0x48')]||undefined;this['dialCutDigit']=_0x1eb8c0[_0x82e2('0x49')]||undefined;this[_0x82e2('0x4a')]=strategy[_0x1eb8c0[_0x82e2('0x4a')]]||_0x82e2('0xb');this['queueStatusComplete']=!![];this['dialAMDActive']=_0x1eb8c0[_0x82e2('0x4b')]||![];this[_0x82e2('0x4c')]=_0x1eb8c0[_0x82e2('0x4c')];this['dialAMDGreeting']=_0x1eb8c0[_0x82e2('0x4d')];this[_0x82e2('0x4e')]=_0x1eb8c0[_0x82e2('0x4e')];this['dialAMDTotalAnalysisTime']=_0x1eb8c0['dialAMDTotalAnalysisTime'];this[_0x82e2('0x4f')]=_0x1eb8c0[_0x82e2('0x4f')];this[_0x82e2('0x50')]=_0x1eb8c0[_0x82e2('0x50')];this['dialAMDMaximumNumberOfWords']=_0x1eb8c0['dialAMDMaximumNumberOfWords'];this[_0x82e2('0x51')]=_0x1eb8c0[_0x82e2('0x51')];this[_0x82e2('0x52')]=_0x1eb8c0[_0x82e2('0x52')];this['outboundRejectCallsDay']=0x0;this[_0x82e2('0x53')]=0x0;this[_0x82e2('0x54')]=_0x1eb8c0[_0x82e2('0x54')];this[_0x82e2('0x55')]=0x0;this[_0x82e2('0x56')]=0x0;this[_0x82e2('0x57')]=0x0;this[_0x82e2('0x58')]=0x0;this[_0x82e2('0x59')]=0x0;this[_0x82e2('0x5a')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0x82e2('0x5b')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0x82e2('0x5c')]=0x0;this[_0x82e2('0x5d')]=0x0;this[_0x82e2('0x5e')]=0x0;this[_0x82e2('0x5f')]=0x0;this[_0x82e2('0x60')]=0x0;this['startProgressive']=undefined;this[_0x82e2('0x61')]=undefined;this['handlePredictive']=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0x82e2('0x62')]=0x0;this[_0x82e2('0x63')]=0x0;this[_0x82e2('0x64')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0x82e2('0x65')]=0x0;this[_0x82e2('0x66')]=0x0;this[_0x82e2('0x67')]=0x0;this[_0x82e2('0x68')]=0x0;this[_0x82e2('0x69')]=_0x1eb8c0[_0x82e2('0x6a')]||0x14;this[_0x82e2('0x6b')]=_0x1eb8c0['dialPredictiveIntervalMaxThreshold']||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0x82e2('0x6c')]=0x0;this[_0x82e2('0x6d')]=0x1;this[_0x82e2('0x6e')]=0x0;this['erlangCallToSecond']=0x0;this[_0x82e2('0x6f')]=0x0;this[_0x82e2('0x70')]=0x0;this[_0x82e2('0x71')]=_0x1eb8c0[_0x82e2('0x71')]||0x1e;this[_0x82e2('0x72')]=_0x1eb8c0[_0x82e2('0x72')]||![];this[_0x82e2('0x73')]=!!_0x1eb8c0[_0x82e2('0x73')]||![];this[_0x82e2('0x74')]=_0x1eb8c0[_0x82e2('0x74')]||undefined;this[_0x82e2('0x75')]=_0x1eb8c0[_0x82e2('0x75')]||![];this[_0x82e2('0x76')]=_0x1eb8c0[_0x82e2('0x76')]||![];this[_0x82e2('0xe')]=monitorFormat[_0x1eb8c0[_0x82e2('0xe')]]?monitorFormat[_0x1eb8c0['monitor_format']]:undefined;this['mandatoryDisposition']=_0x1eb8c0['mandatoryDisposition']||![];this[_0x82e2('0x77')]=_0x1eb8c0['mandatoryDispositionPause']?_0x1eb8c0[_0x82e2('0x77')]:undefined;}module[_0x82e2('0x78')]=VoiceQueue; \ No newline at end of file +var _0x91f8=['predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','exports','unknown','not_inuse','inuse','busy','invalid','unavailable','ringinuse','onhold','wav','wav49','gsm','rrmemory','name','monitor_format','type','inbound','talking','total','answered','sumDuration','sumHoldTime','sumBillable','abandoned','loggedIn','available','acw','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','outboundRejectCallsDay','outboundAnswerCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','handlePredictive'];(function(_0x3996e2,_0x5a4ed5){var _0x586f0c=function(_0x45a867){while(--_0x45a867){_0x3996e2['push'](_0x3996e2['shift']());}};_0x586f0c(++_0x5a4ed5);}(_0x91f8,0x8c));var _0x891f=function(_0x1dc1ea,_0x44ab67){_0x1dc1ea=_0x1dc1ea-0x0;var _0x44e0e2=_0x91f8[_0x1dc1ea];return _0x44e0e2;};'use strict';var statusDesc=[_0x891f('0x0'),_0x891f('0x1'),_0x891f('0x2'),_0x891f('0x3'),_0x891f('0x4'),_0x891f('0x5'),'ringing',_0x891f('0x6'),_0x891f('0x7')];var monitorFormat={'wav':_0x891f('0x8'),'wav49':_0x891f('0x9'),'gsm':_0x891f('0xa')};var strategy={'rrmemory':_0x891f('0xb'),'roundrobin':'roundrobin'};function VoiceQueue(_0x28541b){this['id']=_0x28541b['id']||0x0;this[_0x891f('0xc')]=_0x28541b[_0x891f('0xc')]||'';this[_0x891f('0xd')]=_0x28541b[_0x891f('0xd')]||'';this[_0x891f('0xe')]=_0x28541b[_0x891f('0xe')]||_0x891f('0xf');this['waiting']=0x0;this[_0x891f('0x10')]=0x0;this[_0x891f('0x11')]=0x0;this[_0x891f('0x12')]=0x0;this[_0x891f('0x13')]=0x0;this[_0x891f('0x14')]=0x0;this[_0x891f('0x15')]=0x0;this['unmanaged']=0x0;this[_0x891f('0x16')]=0x0;this[_0x891f('0x17')]=0x0;this[_0x891f('0x18')]=0x0;this[_0x891f('0x19')]=_0x28541b[_0x891f('0x19')]||![];this['acwTimeout']=_0x28541b['acwTimeout']||0xa;this[_0x891f('0x1a')]=_0x28541b[_0x891f('0x1a')]||'no';this[_0x891f('0x1b')]=!![];this[_0x891f('0x1c')]='';this[_0x891f('0x1d')]=0x0;this[_0x891f('0x1e')]=0x0;this[_0x891f('0x1f')]=_0x28541b[_0x891f('0x1f')]||null;this[_0x891f('0x20')]=_0x28541b[_0x891f('0x20')]?_0x28541b[_0x891f('0x20')]:null;this['dialActive']=_0x28541b[_0x891f('0x21')];this[_0x891f('0x22')]=_0x28541b['dialMethod']||_0x891f('0x23');this[_0x891f('0x24')]=_0x28541b[_0x891f('0x24')]||0x0;this[_0x891f('0x25')]=_0x28541b['dialLimitQueue']||0x0;this['dialPowerLevel']=_0x28541b[_0x891f('0x26')]||0x1;this[_0x891f('0x27')]=_0x28541b['dialPredictiveOptimization']||'dropRate';this[_0x891f('0x28')]=_0x28541b[_0x891f('0x28')]||0.03;this['dialPredictiveInterval']=_0x28541b['dialPredictiveInterval']||0x258;this[_0x891f('0x29')]=_0x28541b[_0x891f('0x29')]||_0x891f('0x2a');this[_0x891f('0x2b')]=_0x28541b[_0x891f('0x2b')]||_0x891f('0x2a');this['dialOriginateTimeout']=_0x28541b['dialOriginateTimeout']||0x1e;this['dialQueueOptions']=_0x28541b['dialQueueOptions']||'tTxX';this['dialQueueTimeout']=_0x28541b['dialQueueTimeout']||0x3;this[_0x891f('0x2c')]=_0x28541b[_0x891f('0x2c')]||undefined;this[_0x891f('0x2d')]=_0x28541b[_0x891f('0x2d')]||0x3;this[_0x891f('0x2e')]=_0x28541b[_0x891f('0x2e')]||0x96;this['dialBusyMaxRetry']=_0x28541b[_0x891f('0x2f')]||0x3;this['dialBusyRetryFrequency']=_0x28541b['dialBusyRetryFrequency']||0x96;this['dialNoAnswerMaxRetry']=_0x28541b[_0x891f('0x30')]||0x3;this[_0x891f('0x31')]=_0x28541b[_0x891f('0x31')]||0x96;this[_0x891f('0x32')]=_0x28541b['dialNoSuchNumberMaxRetry']||0x3;this[_0x891f('0x33')]=_0x28541b[_0x891f('0x33')]||0x96;this[_0x891f('0x34')]=_0x28541b['dialDropMaxRetry']||0x3;this[_0x891f('0x35')]=_0x28541b[_0x891f('0x35')]||0x96;this[_0x891f('0x36')]=_0x28541b[_0x891f('0x36')]||0x3;this[_0x891f('0x37')]=_0x28541b[_0x891f('0x37')]||0x96;this[_0x891f('0x38')]=_0x28541b[_0x891f('0x38')]||0x3;this[_0x891f('0x39')]=_0x28541b[_0x891f('0x39')]||0x96;this[_0x891f('0x3a')]=_0x28541b[_0x891f('0x3a')]||0x3;this['dialAgentRejectRetryFrequency']=_0x28541b['dialAgentRejectRetryFrequency']||0x96;this['dialGlobalMaxRetry']=_0x28541b['dialGlobalMaxRetry']||0x4;this[_0x891f('0x3b')]=_0x28541b[_0x891f('0x3b')]?_0x28541b['Trunk']:undefined;this[_0x891f('0x3c')]=_0x28541b[_0x891f('0x3c')]?_0x28541b['TrunkBackup']:undefined;this[_0x891f('0x3d')]=_0x28541b['dialPrefix']||undefined;this['Interval']=_0x28541b[_0x891f('0x3e')]?_0x28541b[_0x891f('0x3e')]:undefined;this[_0x891f('0x3f')]=_0x28541b[_0x891f('0x3f')]||'DESC';this[_0x891f('0x40')]=_0x28541b[_0x891f('0x40')]||undefined;this['dialCutDigit']=_0x28541b[_0x891f('0x41')]||undefined;this[_0x891f('0x42')]=strategy[_0x28541b['strategy']]||'rrmemory';this[_0x891f('0x43')]=!![];this[_0x891f('0x44')]=_0x28541b[_0x891f('0x44')]||![];this['dialAMDInitialSilence']=_0x28541b['dialAMDInitialSilence'];this[_0x891f('0x45')]=_0x28541b['dialAMDGreeting'];this[_0x891f('0x46')]=_0x28541b[_0x891f('0x46')];this[_0x891f('0x47')]=_0x28541b[_0x891f('0x47')];this[_0x891f('0x48')]=_0x28541b['dialAMDMinWordLength'];this[_0x891f('0x49')]=_0x28541b[_0x891f('0x49')];this[_0x891f('0x4a')]=_0x28541b[_0x891f('0x4a')];this['dialAMDSilenceThreshold']=_0x28541b['dialAMDSilenceThreshold'];this[_0x891f('0x4b')]=_0x28541b[_0x891f('0x4b')];this[_0x891f('0x4c')]=0x0;this['pTalking']=0x0;this['timeout']=_0x28541b['timeout'];this[_0x891f('0x4d')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0x891f('0x4e')]=0x0;this[_0x891f('0x4f')]=0x0;this[_0x891f('0x50')]=0x0;this[_0x891f('0x51')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0x891f('0x52')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this['outboundDropCallsDayCallersExit']=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0x891f('0x53')]=0x0;this[_0x891f('0x54')]=0x0;this[_0x891f('0x55')]=0x0;this[_0x891f('0x56')]=undefined;this['startPredictive']=undefined;this[_0x891f('0x57')]=undefined;this[_0x891f('0x58')]=1.05;this[_0x891f('0x59')]=0x0;this[_0x891f('0x5a')]=0x0;this[_0x891f('0x5b')]=0x0;this[_0x891f('0x5c')]=0x0;this[_0x891f('0x5d')]=0x0;this[_0x891f('0x5e')]=0x0;this[_0x891f('0x5f')]=0x0;this[_0x891f('0x60')]=0x0;this[_0x891f('0x61')]=_0x28541b[_0x891f('0x62')]||0x14;this[_0x891f('0x63')]=_0x28541b[_0x891f('0x62')]||0xa;this[_0x891f('0x64')]=0x0;this[_0x891f('0x65')]=0x0;this[_0x891f('0x66')]=0x1;this[_0x891f('0x67')]=0x0;this['erlangCallToSecond']=0x0;this[_0x891f('0x68')]=0x0;this[_0x891f('0x69')]=0x0;this[_0x891f('0x6a')]=_0x28541b['dialRecallMeTimeout']||0x1e;this[_0x891f('0x6b')]=_0x28541b['dialRecallInQueue']||![];this[_0x891f('0x6c')]=!!_0x28541b[_0x891f('0x6c')]||![];this[_0x891f('0x6d')]=_0x28541b[_0x891f('0x6d')]||undefined;this[_0x891f('0x6e')]=_0x28541b['dialAgiAfterHangupClient']||![];this[_0x891f('0x6f')]=_0x28541b[_0x891f('0x6f')]||![];this[_0x891f('0xd')]=monitorFormat[_0x28541b['monitor_format']]?monitorFormat[_0x28541b[_0x891f('0xd')]]:undefined;this[_0x891f('0x70')]=_0x28541b[_0x891f('0x70')]||![];this['mandatoryDispositionPause']=_0x28541b['mandatoryDispositionPause']?_0x28541b['mandatoryDispositionPause']:undefined;}module[_0x891f('0x71')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 39f3fe0..34a6596 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 _0xd445=['name','username','accessKey','remoteUri','serverUrl','Configurations'];(function(_0x3a1a64,_0xd63cac){var _0x1723e0=function(_0x53ea19){while(--_0x53ea19){_0x3a1a64['push'](_0x3a1a64['shift']());}};_0x1723e0(++_0xd63cac);}(_0xd445,0x10e));var _0x5d44=function(_0x5a3aef,_0x3abf55){_0x5a3aef=_0x5a3aef-0x0;var _0x46891c=_0xd445[_0x5a3aef];return _0x46891c;};'use strict';function VtigerAccount(_0x5c1a2f){this['id']=_0x5c1a2f['id']||0x0;this[_0x5d44('0x0')]=_0x5c1a2f[_0x5d44('0x0')]||'';this[_0x5d44('0x1')]=_0x5c1a2f['username']||'';this[_0x5d44('0x2')]=_0x5c1a2f[_0x5d44('0x2')]||'';this[_0x5d44('0x3')]=_0x5c1a2f[_0x5d44('0x3')]||'';this[_0x5d44('0x4')]=_0x5c1a2f[_0x5d44('0x4')]||'';this[_0x5d44('0x5')]=_0x5c1a2f[_0x5d44('0x5')]||{};}module['exports']=VtigerAccount; \ No newline at end of file +var _0x948e=['exports','name','username','accessKey','remoteUri','serverUrl','Configurations'];(function(_0x39fb6a,_0x8b07ae){var _0x1452a1=function(_0x391804){while(--_0x391804){_0x39fb6a['push'](_0x39fb6a['shift']());}};_0x1452a1(++_0x8b07ae);}(_0x948e,0x6a));var _0xe948=function(_0x13d71e,_0x1ab6a1){_0x13d71e=_0x13d71e-0x0;var _0x2dc8aa=_0x948e[_0x13d71e];return _0x2dc8aa;};'use strict';function VtigerAccount(_0x302ee8){this['id']=_0x302ee8['id']||0x0;this[_0xe948('0x0')]=_0x302ee8[_0xe948('0x0')]||'';this[_0xe948('0x1')]=_0x302ee8[_0xe948('0x1')]||'';this['accessKey']=_0x302ee8[_0xe948('0x2')]||'';this[_0xe948('0x3')]=_0x302ee8['remoteUri']||'';this[_0xe948('0x4')]=_0x302ee8[_0xe948('0x4')]||'';this[_0xe948('0x5')]=_0x302ee8['Configurations']||{};}module[_0xe948('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 fccc835..0b4f1b0 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 _0xca7e=['Configurations','name','username','password','token','remoteUri','authType','type','serverUrl'];(function(_0x29be7b,_0x16e33c){var _0x2a3483=function(_0x2fb540){while(--_0x2fb540){_0x29be7b['push'](_0x29be7b['shift']());}};_0x2a3483(++_0x16e33c);}(_0xca7e,0x13c));var _0xeca7=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xca7e[_0x39096d];return _0x13da4f;};'use strict';function ZendeskAccount(_0x217d15){this['id']=_0x217d15['id']||0x0;this[_0xeca7('0x0')]=_0x217d15['name']||'';this['username']=_0x217d15[_0xeca7('0x1')]||'';this['password']=_0x217d15[_0xeca7('0x2')]||'';this[_0xeca7('0x3')]=_0x217d15[_0xeca7('0x3')]||'';this[_0xeca7('0x4')]=_0x217d15[_0xeca7('0x4')]||'';this[_0xeca7('0x5')]=_0x217d15[_0xeca7('0x5')]||'';this[_0xeca7('0x6')]=_0x217d15[_0xeca7('0x6')]||'integrationTab';this[_0xeca7('0x7')]=_0x217d15[_0xeca7('0x7')]||'';this[_0xeca7('0x8')]=_0x217d15[_0xeca7('0x8')]||{};}module['exports']=ZendeskAccount; \ No newline at end of file +var _0xce2f=['username','password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','name'];(function(_0x20b10f,_0xc23e9c){var _0x279391=function(_0x3799b4){while(--_0x3799b4){_0x20b10f['push'](_0x20b10f['shift']());}};_0x279391(++_0xc23e9c);}(_0xce2f,0x18f));var _0xfce2=function(_0x30bbee,_0x24025e){_0x30bbee=_0x30bbee-0x0;var _0x2e16da=_0xce2f[_0x30bbee];return _0x2e16da;};'use strict';function ZendeskAccount(_0x3f5a58){this['id']=_0x3f5a58['id']||0x0;this['name']=_0x3f5a58[_0xfce2('0x0')]||'';this['username']=_0x3f5a58[_0xfce2('0x1')]||'';this[_0xfce2('0x2')]=_0x3f5a58[_0xfce2('0x2')]||'';this[_0xfce2('0x3')]=_0x3f5a58[_0xfce2('0x3')]||'';this[_0xfce2('0x4')]=_0x3f5a58['remoteUri']||'';this[_0xfce2('0x5')]=_0x3f5a58['authType']||'';this[_0xfce2('0x6')]=_0x3f5a58[_0xfce2('0x6')]||_0xfce2('0x7');this[_0xfce2('0x8')]=_0x3f5a58[_0xfce2('0x8')]||'';this['Configurations']=_0x3f5a58[_0xfce2('0x9')]||{};}module['exports']=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 20395a0..de0b8ee 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 _0x4650=['clientSecret','serverUrl','code','refreshToken','Configurations','exports','name','description','host','zone','clientId'];(function(_0x604a6d,_0x473a6f){var _0x156b0f=function(_0x132653){while(--_0x132653){_0x604a6d['push'](_0x604a6d['shift']());}};_0x156b0f(++_0x473a6f);}(_0x4650,0x166));var _0x0465=function(_0xbeaf55,_0x1c879b){_0xbeaf55=_0xbeaf55-0x0;var _0x1b07d0=_0x4650[_0xbeaf55];return _0x1b07d0;};'use strict';function ZohoAccount(_0x1b0269){this['id']=_0x1b0269['id']||0x0;this[_0x0465('0x0')]=_0x1b0269['name']||'';this[_0x0465('0x1')]=_0x1b0269[_0x0465('0x1')]||'';this['host']=_0x1b0269[_0x0465('0x2')]||'';this[_0x0465('0x3')]=_0x1b0269['zone']||'';this[_0x0465('0x4')]=_0x1b0269[_0x0465('0x4')]||'';this[_0x0465('0x5')]=_0x1b0269['clientSecret']||'';this[_0x0465('0x6')]=_0x1b0269[_0x0465('0x6')]||'';this[_0x0465('0x7')]=_0x1b0269['code']||'';this[_0x0465('0x8')]=_0x1b0269[_0x0465('0x8')]||'';this[_0x0465('0x9')]=_0x1b0269[_0x0465('0x9')]||{};}module[_0x0465('0xa')]=ZohoAccount; \ No newline at end of file +var _0x7b5f=['refreshToken','name','description','host','zone','clientId','clientSecret','serverUrl','code'];(function(_0x2a5864,_0x2b9396){var _0x490ab6=function(_0x3bcd16){while(--_0x3bcd16){_0x2a5864['push'](_0x2a5864['shift']());}};_0x490ab6(++_0x2b9396);}(_0x7b5f,0x1c3));var _0xf7b5=function(_0x5e1427,_0x322bd8){_0x5e1427=_0x5e1427-0x0;var _0x41458f=_0x7b5f[_0x5e1427];return _0x41458f;};'use strict';function ZohoAccount(_0x221739){this['id']=_0x221739['id']||0x0;this[_0xf7b5('0x0')]=_0x221739[_0xf7b5('0x0')]||'';this[_0xf7b5('0x1')]=_0x221739[_0xf7b5('0x1')]||'';this[_0xf7b5('0x2')]=_0x221739[_0xf7b5('0x2')]||'';this[_0xf7b5('0x3')]=_0x221739['zone']||'';this[_0xf7b5('0x4')]=_0x221739[_0xf7b5('0x4')]||'';this[_0xf7b5('0x5')]=_0x221739[_0xf7b5('0x5')]||'';this[_0xf7b5('0x6')]=_0x221739['serverUrl']||'';this[_0xf7b5('0x7')]=_0x221739[_0xf7b5('0x7')]||'';this[_0xf7b5('0x8')]=_0x221739[_0xf7b5('0x8')]||'';this['Configurations']=_0x221739['Configurations']||{};}module['exports']=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 1dcd687..222019a 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 _0x3712=['active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countagentrejectretry','countabandonedretry','countmachineretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','exports','util','moment','isNil','string','idContact','queue','name','type','campaigntype','dialAnswer','membername','Agent','format','SIP/%s','calleridname','Contact','phone','firstName'];(function(_0x44a20f,_0x5be0b8){var _0x15f2e4=function(_0x67f722){while(--_0x67f722){_0x44a20f['push'](_0x44a20f['shift']());}};_0x15f2e4(++_0x5be0b8);}(_0x3712,0x96));var _0x2371=function(_0x3653c7,_0xadb356){_0x3653c7=_0x3653c7-0x0;var _0x58a021=_0x3712[_0x3653c7];return _0x58a021;};'use strict';var util=require(_0x2371('0x0'));var _=require('lodash');var moment=require(_0x2371('0x1'));function checkNameSurname(_0x55b847,_0x3ebed5,_0x19ad6b){var _0x3a476d='';if(!_[_0x2371('0x2')](_0x3ebed5)&&_0x2371('0x3')===typeof _0x3ebed5){_0x3a476d+=_0x3ebed5;}if(!_[_0x2371('0x2')](_0x19ad6b)&&_0x2371('0x3')===typeof _0x19ad6b){_0x3a476d+='\x20'+_0x19ad6b;}if(_0x3a476d!==''){return _0x3a476d;}return _0x55b847;}function Action(_0x2f76b2,_0x3dd5e3,_0x1cef32,_0x3fc28f,_0x1d85d2){this['uniqueid']=_0x1cef32||undefined;this[_0x2371('0x4')]=_0x2f76b2['id'];this[_0x2371('0x5')]=_0x3dd5e3[_0x2371('0x6')];this[_0x2371('0x7')]=_0x3dd5e3[_0x2371('0x7')];this[_0x2371('0x8')]=_0x2371('0x5');this[_0x2371('0x9')]=![];this[_0x2371('0xa')]=_['isNil'](_0x2f76b2[_0x2371('0xb')])?undefined:_0x2f76b2['Agent'][_0x2371('0x6')];this['channelAgent']=this['membername']?util[_0x2371('0xc')](_0x2371('0xd'),this['membername']):_0x3fc28f||undefined;this[_0x2371('0xe')]=checkNameSurname(_0x2f76b2[_0x2371('0xf')][_0x2371('0x10')],_0x2f76b2[_0x2371('0xf')][_0x2371('0x11')],_0x2f76b2[_0x2371('0xf')]['lastName']);this[_0x2371('0x12')]=_0x2f76b2['active']||![];this[_0x2371('0x13')]=_0x2f76b2[_0x2371('0xf')]['phone'];this[_0x2371('0x14')]=_0x2f76b2[_0x2371('0x14')];this[_0x2371('0x15')]=_0x2f76b2[_0x2371('0x15')]||0x0;this[_0x2371('0x16')]=_0x2f76b2['countcongestionretry']||0x0;this[_0x2371('0x17')]=_0x2f76b2[_0x2371('0x17')]||0x0;this[_0x2371('0x18')]=(_0x2f76b2['countbusyretry']||0x0)+(_0x2f76b2[_0x2371('0x16')]||0x0)+(_0x2f76b2[_0x2371('0x17')]||0x0)+(_0x2f76b2[_0x2371('0x19')]||0x0)+(_0x2f76b2[_0x2371('0x1a')]||0x0)+(_0x2f76b2['countabandonedretry']||0x0)+(_0x2f76b2['countmachineretry']||0x0)+(_0x2f76b2[_0x2371('0x1b')]||0x0);this[_0x2371('0x19')]=_0x2f76b2['countnosuchnumberretry']||0x0;this['countdropretry']=_0x2f76b2[_0x2371('0x1a')]||0x0;this[_0x2371('0x1c')]=_0x2f76b2[_0x2371('0x1c')]||0x0;this['countmachineretry']=_0x2f76b2[_0x2371('0x1d')]||0x0;this[_0x2371('0x1b')]=_0x2f76b2[_0x2371('0x1b')]||0x0;this['callback']=_0x2f76b2[_0x2371('0x1e')];this[_0x2371('0x1f')]=_0x2f76b2[_0x2371('0x1f')];this['callbackat']=_0x2f76b2[_0x2371('0x20')];this['recallme']=_0x2f76b2[_0x2371('0x21')];this[_0x2371('0x22')]=_0x2f76b2[_0x2371('0x22')];this[_0x2371('0x23')]=_0x2f76b2[_0x2371('0x23')];this['UserId']=_[_0x2371('0x2')](_0x2f76b2[_0x2371('0xb')])?_0x2f76b2['UserId']:_0x2f76b2[_0x2371('0xb')]['id'];this[_0x2371('0x24')]=_0x2f76b2[_0x2371('0x24')];this[_0x2371('0x25')]='';this[_0x2371('0x26')]='';}Action['prototype'][_0x2371('0x27')]=function(){return util['format'](_0x2371('0x28'),this[_0x2371('0xe')],this['number']);};module[_0x2371('0x29')]=Action; \ No newline at end of file +var _0xb7a4=['scheduledat','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','exports','util','lodash','moment','isNil','string','idContact','queue','name','type','campaigntype','dialAnswer','Agent','channelAgent','membername','format','SIP/%s','calleridname','firstName','Contact','lastName','active','calleridnum','phone'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xb7a4,0xa1));var _0x4b7a=function(_0x404fc1,_0x3ba027){_0x404fc1=_0x404fc1-0x0;var _0x3eca07=_0xb7a4[_0x404fc1];return _0x3eca07;};'use strict';var util=require(_0x4b7a('0x0'));var _=require(_0x4b7a('0x1'));var moment=require(_0x4b7a('0x2'));function checkNameSurname(_0x6d7cb6,_0x577a85,_0xf8ad7){var _0x4d702b='';if(!_[_0x4b7a('0x3')](_0x577a85)&&_0x4b7a('0x4')===typeof _0x577a85){_0x4d702b+=_0x577a85;}if(!_[_0x4b7a('0x3')](_0xf8ad7)&&_0x4b7a('0x4')===typeof _0xf8ad7){_0x4d702b+='\x20'+_0xf8ad7;}if(_0x4d702b!==''){return _0x4d702b;}return _0x6d7cb6;}function Action(_0x35a555,_0x3e40b2,_0x454d06,_0x15314b,_0x38436e){this['uniqueid']=_0x454d06||undefined;this[_0x4b7a('0x5')]=_0x35a555['id'];this[_0x4b7a('0x6')]=_0x3e40b2[_0x4b7a('0x7')];this[_0x4b7a('0x8')]=_0x3e40b2[_0x4b7a('0x8')];this[_0x4b7a('0x9')]=_0x4b7a('0x6');this[_0x4b7a('0xa')]=![];this['membername']=_[_0x4b7a('0x3')](_0x35a555[_0x4b7a('0xb')])?undefined:_0x35a555[_0x4b7a('0xb')][_0x4b7a('0x7')];this[_0x4b7a('0xc')]=this[_0x4b7a('0xd')]?util[_0x4b7a('0xe')](_0x4b7a('0xf'),this[_0x4b7a('0xd')]):_0x15314b||undefined;this[_0x4b7a('0x10')]=checkNameSurname(_0x35a555['Contact']['phone'],_0x35a555['Contact'][_0x4b7a('0x11')],_0x35a555[_0x4b7a('0x12')][_0x4b7a('0x13')]);this[_0x4b7a('0x14')]=_0x35a555['active']||![];this[_0x4b7a('0x15')]=_0x35a555['Contact'][_0x4b7a('0x16')];this[_0x4b7a('0x17')]=_0x35a555['scheduledat'];this[_0x4b7a('0x18')]=_0x35a555[_0x4b7a('0x18')]||0x0;this[_0x4b7a('0x19')]=_0x35a555[_0x4b7a('0x19')]||0x0;this['countnoanswerretry']=_0x35a555['countnoanswerretry']||0x0;this[_0x4b7a('0x1a')]=(_0x35a555[_0x4b7a('0x18')]||0x0)+(_0x35a555[_0x4b7a('0x19')]||0x0)+(_0x35a555[_0x4b7a('0x1b')]||0x0)+(_0x35a555[_0x4b7a('0x1c')]||0x0)+(_0x35a555[_0x4b7a('0x1d')]||0x0)+(_0x35a555[_0x4b7a('0x1e')]||0x0)+(_0x35a555[_0x4b7a('0x1f')]||0x0)+(_0x35a555[_0x4b7a('0x20')]||0x0);this['countnosuchnumberretry']=_0x35a555[_0x4b7a('0x1c')]||0x0;this[_0x4b7a('0x1d')]=_0x35a555[_0x4b7a('0x1d')]||0x0;this[_0x4b7a('0x1e')]=_0x35a555['countabandonedretry']||0x0;this[_0x4b7a('0x1f')]=_0x35a555[_0x4b7a('0x1f')]||0x0;this[_0x4b7a('0x20')]=_0x35a555['countagentrejectretry']||0x0;this['callback']=_0x35a555[_0x4b7a('0x21')];this[_0x4b7a('0x22')]=_0x35a555[_0x4b7a('0x22')];this['callbackat']=_0x35a555[_0x4b7a('0x23')];this[_0x4b7a('0x24')]=_0x35a555[_0x4b7a('0x24')];this[_0x4b7a('0x25')]=_0x35a555['ContactId'];this['ListId']=_0x35a555[_0x4b7a('0x26')];this['UserId']=_['isNil'](_0x35a555[_0x4b7a('0xb')])?_0x35a555['UserId']:_0x35a555['Agent']['id'];this[_0x4b7a('0x27')]=_0x35a555['VoiceQueueId'];this[_0x4b7a('0x28')]='';this[_0x4b7a('0x29')]='';}Action[_0x4b7a('0x2a')][_0x4b7a('0x2b')]=function(){return util[_0x4b7a('0xe')](_0x4b7a('0x2c'),this['calleridname'],this['number']);};module[_0x4b7a('0x2d')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index fffca11..ebaa0b6 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 _0xdb94=['contactId','UserId','VoiceQueueId','ListId','Action','status','channel','catch','updateOriginated','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','getContactRecallMe','agentReadyId','then','isNil','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','RecallFailedTimeout','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','custom:agentnosuchnumber','buildObj','Global','dialNoSuchNumberMaxRetry','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','unlockAgent','ANSWER','responsetime','[syncHangup][talking][increment]','\x20Queue','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','answered','[16]','Answer','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','uniqueid','linkedid','BUSY','countbusyretry','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','cloneAction','activeContact','NOANSWER','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','scheduledAt','dialNoAnswerRetryFrequency','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','dialBusyRetryFrequency','CANCEL','countagentrejectretry','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','AgentReject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','countmachineretry','dialstatus','[callProgressDetectingCustomer][hangupInAMD]','cause-txt','amd','[callProgressDetectingCustomer][machine]','dialAnswer','decrementTalkink','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','NoSuchNumber','createAgentHistory','logAgent','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','Contact','Queue','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','called','Calling','[Preview][execCall][failure]','Call\x20failed','createHistory','[Blacklist][error]','trunks','SIP/%s','reachable','unmonitored','execRun','unlock','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','campaign\x20Name:\x20','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','phone','substring','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdName','originatecalleridname','extractCalleridName','originatecalleridnum','addVariables','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','isFailure','response','unlockContact','idContact','custom:agentringnoanswer','rejected','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','destuniqueid','addVariable','variables','syncVarSet','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','lodash','bluebird','moment','md5','ioredis','../../../config/environment','../../../config/logger','../ami','./rpcDb','./action','./util/util','redis','localhost','socket.io-emitter','prototype','tail','finally','campaignsPreview','voiceQueues','actions','agents','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','syncNewExten','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','name','strategy','available','loggedIn','pTalking','sumBillable','sumHoldTime','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','format','voice:queue:%s','voice_queue:save','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','paused','message','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','dialMethod','preview','booked','clockClearZombieChannels','clearZombieChannels','hasOwnProperty','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','sequence','info','queue','originated:\x20','stringify','pTalking:\x20','pick'];(function(_0xe3c12b,_0x5c9f97){var _0x1712be=function(_0x3fc120){while(--_0x3fc120){_0xe3c12b['push'](_0xe3c12b['shift']());}};_0x1712be(++_0x5c9f97);}(_0xdb94,0xe5));var _0x4db9=function(_0x30d826,_0x23ec08){_0x30d826=_0x30d826-0x0;var _0x470b18=_0xdb94[_0x30d826];return _0x470b18;};'use strict';var util=require('util');var _=require(_0x4db9('0x0'));var BPromise=require(_0x4db9('0x1'));var uuid=require('uuid');var moment=require(_0x4db9('0x2'));var md5=require(_0x4db9('0x3'));var Redis=require(_0x4db9('0x4'));var config=require(_0x4db9('0x5'));var logger=require(_0x4db9('0x6'))('preview');var loggerAction=require(_0x4db9('0x6'))('actionPreview');var ami=require(_0x4db9('0x7'));var rpcDb=require(_0x4db9('0x8'));var Action=require(_0x4db9('0x9'));var ut=require(_0x4db9('0xa'));config[_0x4db9('0xb')]=_['defaults'](config[_0x4db9('0xb')],{'host':_0x4db9('0xc'),'port':0x18eb});var io=require(_0x4db9('0xd'))(new Redis(config[_0x4db9('0xb')]));var Sequence=function(){};Sequence[_0x4db9('0xe')]['enqueue']=function(_0x268eb5){this[_0x4db9('0xf')]=this[_0x4db9('0xf')]?this[_0x4db9('0xf')][_0x4db9('0x10')](_0x268eb5):_0x268eb5();};function Preview(_0x3d1b96){this['sequence']=new Sequence();this[_0x4db9('0x11')]=_0x3d1b96[_0x4db9('0x12')];this['trunks']=_0x3d1b96['trunks'];this[_0x4db9('0x13')]={};this[_0x4db9('0x14')]=_0x3d1b96[_0x4db9('0x14')];this['clockClearZombieChannels']=0x0;ami['on'](_0x4db9('0x15'),this[_0x4db9('0x16')][_0x4db9('0x17')](this));ami['on'](_0x4db9('0x18'),this[_0x4db9('0x19')]['bind'](this));ami['on'](_0x4db9('0x1a'),this[_0x4db9('0x1b')]['bind'](this));ami['on'](_0x4db9('0x1c'),this[_0x4db9('0x1d')][_0x4db9('0x17')](this));ami['on']('newexten',this[_0x4db9('0x1e')][_0x4db9('0x17')](this));ami['on']('varset',this['syncVarSet']['bind'](this));ami['on'](_0x4db9('0x1f'),this[_0x4db9('0x20')]['bind'](this));ami['on'](_0x4db9('0x21'),this[_0x4db9('0x22')][_0x4db9('0x17')](this));this[_0x4db9('0x23')](this[_0x4db9('0x11')]);}function emit(_0x28b7f6,_0x34a6ed,_0x111f4a){io['to'](_0x28b7f6)[_0x4db9('0x24')](_0x34a6ed,_0x111f4a);}function emitCampaignPreview(_0x41d0c1){if(_0x41d0c1[_0x4db9('0x25')]===_0x4db9('0x26')){var _0x4d56a1={'id':_0x41d0c1['id'],'name':_0x41d0c1[_0x4db9('0x27')],'strategy':_0x41d0c1[_0x4db9('0x28')],'answered':_0x41d0c1['answered'],'available':_0x41d0c1[_0x4db9('0x29')],'loggedIn':_0x41d0c1[_0x4db9('0x2a')],'pTalking':_0x41d0c1[_0x4db9('0x2b')],'sumBillable':_0x41d0c1[_0x4db9('0x2c')],'sumDuration':_0x41d0c1['sumDuration'],'sumHoldTime':_0x41d0c1[_0x4db9('0x2d')]||0x0,'talking':_0x41d0c1['talking'],'total':_0x41d0c1[_0x4db9('0x2e')],'type':_0x41d0c1[_0x4db9('0x25')],'unmanaged':_0x41d0c1[_0x4db9('0x2f')],'abandoned':_0x41d0c1[_0x4db9('0x30')],'waiting':_0x41d0c1[_0x4db9('0x31')],'loggedInDb':_0x41d0c1[_0x4db9('0x32')],'dialActive':_0x41d0c1[_0x4db9('0x33')],'dialMethod':_0x41d0c1['dialMethod'],'dialOriginateCallerIdName':_0x41d0c1['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x41d0c1[_0x4db9('0x34')],'dialOriginateTimeout':_0x41d0c1['dialOriginateTimeout'],'dialPrefix':_0x41d0c1[_0x4db9('0x35')],'outboundAnswerAgiCallsDay':_0x41d0c1[_0x4db9('0x36')],'outboundAnswerCallsDay':_0x41d0c1[_0x4db9('0x37')],'outboundBlacklistCallsDay':_0x41d0c1[_0x4db9('0x38')],'outboundBusyCallsDay':_0x41d0c1[_0x4db9('0x39')],'outboundCongestionCallsDay':_0x41d0c1[_0x4db9('0x3a')],'outboundDropCallsDayACS':_0x41d0c1[_0x4db9('0x3b')],'outboundDropCallsDayCallersExit':_0x41d0c1[_0x4db9('0x3c')],'outboundDropCallsDayTimeout':_0x41d0c1['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x41d0c1[_0x4db9('0x3d')],'outboundNoSuchCallsDay':_0x41d0c1['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x41d0c1[_0x4db9('0x3e')],'outboundReCallsDay':_0x41d0c1[_0x4db9('0x3f')],'outboundRejectCallsDay':_0x41d0c1[_0x4db9('0x40')],'outboundUnknownCallsDay':_0x41d0c1[_0x4db9('0x41')],'outboundAbandonedCallsDay':_0x41d0c1[_0x4db9('0x42')],'predictiveIntervalAnsweredCalls':_0x41d0c1['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x41d0c1[_0x4db9('0x43')],'predictiveIntervalAvgTalktime':_0x41d0c1[_0x4db9('0x44')],'predictiveIntervalDroppedCallsCallersExit':_0x41d0c1[_0x4db9('0x45')],'predictiveIntervalDroppedCallsTimeout':_0x41d0c1[_0x4db9('0x46')],'predictiveIntervalErlangCalls':_0x41d0c1['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x41d0c1['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x41d0c1[_0x4db9('0x47')],'predictiveIntervalMultiplicativeFactor':_0x41d0c1[_0x4db9('0x48')],'predictiveIntervalPauses':_0x41d0c1['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x41d0c1['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x41d0c1[_0x4db9('0x49')],'message':_0x41d0c1['message'],'originated':_0x41d0c1['originated'],'erlangCalls':_0x41d0c1[_0x4db9('0x4a')],'erlangCallToSecond':_0x41d0c1[_0x4db9('0x4b')],'erlangAbandonmentRate':_0x41d0c1['erlangAbandonmentRate'],'erlangBusyFactor':_0x41d0c1[_0x4db9('0x4c')],'startPredictive':_0x41d0c1[_0x4db9('0x4d')],'startProgressive':_0x41d0c1[_0x4db9('0x4e')]};if(_0x41d0c1[_0x4db9('0x4f')]){_0x4d56a1['Trunk']={'id':_0x41d0c1[_0x4db9('0x4f')]['id'],'name':_0x41d0c1['Trunk']['name'],'active':_0x41d0c1['Trunk'][_0x4db9('0x50')],'callerid':_0x41d0c1[_0x4db9('0x4f')]['callerid']};}if(_0x41d0c1[_0x4db9('0x51')]){_0x4d56a1[_0x4db9('0x51')]={'id':_0x41d0c1['Interval']['id'],'name':_0x41d0c1['Interval']['name']};}var _0x2c28fa=md5(JSON['stringify'](_0x4d56a1));if(_0x41d0c1[_0x4db9('0x3')]!==_0x2c28fa){_0x41d0c1['md5']=_0x2c28fa;emit(util[_0x4db9('0x52')](_0x4db9('0x53'),_0x4d56a1[_0x4db9('0x27')]),_0x4db9('0x54'),_0x4d56a1);}}}function emitVoiceQueueChannelRemove(_0x27ef37){logger['info'](_0x4db9('0x55'),JSON['stringify'](_0x27ef37));emit(util[_0x4db9('0x52')](_0x4db9('0x53'),_0x27ef37[_0x4db9('0x27')]),_0x4db9('0x56'),_0x27ef37);io[_0x4db9('0x24')](_0x4db9('0x57'),_0x27ef37);}function notSendMessagesQueue(_0x52b00c){if(_0x52b00c[_0x4db9('0x58')]){if(_0x52b00c[_0x4db9('0x59')]===0x0&&_0x52b00c['pTalking']===0x0){_0x52b00c['sendMessageOneNotActive']=![];_0x52b00c[_0x4db9('0x29')]=0x0;_0x52b00c[_0x4db9('0x5a')]=0x0;_0x52b00c[_0x4db9('0x5b')]=_0x4db9('0x5c');ut[_0x4db9('0x5d')](_0x4db9('0x5e'),_0x52b00c[_0x4db9('0x27')]+_0x4db9('0x5f'));}else{_0x52b00c[_0x4db9('0x5b')]=_0x4db9('0x60');ut[_0x4db9('0x5d')](_0x4db9('0x5e'),_0x52b00c['name']+_0x4db9('0x61'));}emitCampaignPreview(_0x52b00c);}}Preview[_0x4db9('0xe')][_0x4db9('0x23')]=function(){var _0x3b53be=this;setInterval(function(){_0x3b53be['syncCampaigns']();},0x7cf);};Preview['prototype'][_0x4db9('0x62')]=function(){var _0x2b18a2=this[_0x4db9('0x11')];this['clockClearZombieChannels']+=0x1;for(var _0x461878 in _0x2b18a2){if(_0x2b18a2['hasOwnProperty'](_0x461878)&&(_0x2b18a2[_0x461878][_0x4db9('0x63')]===_0x4db9('0x64')||_0x2b18a2[_0x461878][_0x4db9('0x63')]===_0x4db9('0x65'))&&_0x2b18a2[_0x461878][_0x4db9('0x25')]==='outbound'){if(this[_0x4db9('0x66')]>0x7){this[_0x4db9('0x66')]=0x0;this[_0x4db9('0x67')]();}}if(_0x2b18a2[_0x4db9('0x68')](_0x461878)&&_0x2b18a2[_0x461878][_0x4db9('0x63')]==='preview'&&_0x2b18a2[_0x461878][_0x4db9('0x25')]===_0x4db9('0x26')){if(_0x2b18a2[_0x461878][_0x4db9('0x33')]){this[_0x4db9('0x69')](_0x2b18a2[_0x461878]);if(_0x2b18a2[_0x461878][_0x4db9('0x6a')])this[_0x4db9('0x6b')](_0x2b18a2[_0x461878]);}else{notSendMessagesQueue(_0x2b18a2[_0x461878]);}}}};Preview[_0x4db9('0xe')][_0x4db9('0x6c')]=function(_0x8ebc63){var _0x5d27fe=this;this[_0x4db9('0x6d')]['enqueue'](function(){if(!_['isNil'](_0x5d27fe[_0x4db9('0x13')][_0x8ebc63])){loggerAction[_0x4db9('0x6e')]('[clearZombieChannels][talking]',_0x8ebc63,'Queue',_0x5d27fe[_0x4db9('0x13')][_0x8ebc63][_0x4db9('0x6f')],_0x4db9('0x70'),JSON[_0x4db9('0x71')](_0x5d27fe[_0x4db9('0x11')][_0x5d27fe[_0x4db9('0x13')][_0x8ebc63][_0x4db9('0x6f')]][_0x4db9('0x59')]),_0x4db9('0x72'),JSON[_0x4db9('0x71')](_0x5d27fe[_0x4db9('0x11')][_0x5d27fe['actions'][_0x8ebc63][_0x4db9('0x6f')]][_0x4db9('0x2b')]),JSON['stringify'](_0x5d27fe[_0x4db9('0x13')][_0x8ebc63]['dialAnswer']),JSON[_0x4db9('0x71')](_[_0x4db9('0x73')](_0x5d27fe[_0x4db9('0x13')][_0x8ebc63],[_0x4db9('0x74'),_0x4db9('0x75'),_0x4db9('0x76'),_0x4db9('0x77')])));return ami[_0x4db9('0x78')]({'action':_0x4db9('0x79'),'channel':_0x5d27fe[_0x4db9('0x13')][_0x8ebc63][_0x4db9('0x7a')]})[_0x4db9('0x7b')](function(_0x1bbdb8){if(_0x1bbdb8['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x5d27fe['actions'][_0x8ebc63]){ut[_0x4db9('0x7c')](_0x5d27fe['campaignsPreview'][_0x5d27fe[_0x4db9('0x13')][_0x8ebc63]['queue']],_0x4db9('0x7d'));if(_0x5d27fe[_0x4db9('0x13')][_0x8ebc63]['dialAnswer']===!![]){ut['decrementTalkink'](_0x5d27fe[_0x4db9('0x11')][_0x5d27fe[_0x4db9('0x13')][_0x8ebc63][_0x4db9('0x6f')]],_0x4db9('0x7d'));ut[_0x4db9('0x7e')](_0x4db9('0x7f')+_0x8ebc63,_0x5d27fe[_0x4db9('0x13')][_0x8ebc63][_0x4db9('0x6f')]);}ut['loggerError'](_0x4db9('0x80')+_0x8ebc63,_0x5d27fe[_0x4db9('0x13')][_0x8ebc63][_0x4db9('0x6f')]);delete _0x5d27fe[_0x4db9('0x13')][_0x8ebc63];}},0x2328);}});}});};Preview[_0x4db9('0xe')]['clearZombieChannels']=function(){var _0x319d69=this;loggerAction[_0x4db9('0x6e')](_0x4db9('0x81'),_['size'](this[_0x4db9('0x13')]));for(var _0x305e4c in this[_0x4db9('0x13')]){if(_0x319d69['actions'][_0x4db9('0x68')](_0x305e4c)){_0x319d69['clearZombieChannel'](_0x305e4c);}}};Preview[_0x4db9('0xe')][_0x4db9('0x6b')]=function(_0x287c67){var _0x57dedc=this;rpcDb[_0x4db9('0x82')](_0x287c67['id'],ut[_0x4db9('0x83')](this['agents']))[_0x4db9('0x84')](function(_0x37f635){if(!_[_0x4db9('0x85')](_0x37f635)){for(var _0x10f6f2=0x0;_0x10f6f2<_0x37f635[_0x4db9('0x86')];_0x10f6f2+=0x1){if(ut[_0x4db9('0x87')](_0x37f635[_0x10f6f2][_0x4db9('0x88')])<_0x287c67[_0x4db9('0x89')]*0x3c){if(_0x37f635[_0x10f6f2]['Agent']&&!_0x37f635[_0x10f6f2][_0x4db9('0x8a')][_0x4db9('0x8b')]){_0x57dedc[_0x4db9('0x8c')](_0x37f635[_0x10f6f2]['id'])['then'](ut[_0x4db9('0x8d')](_0x4db9('0x8e')))[_0x4db9('0x7b')](ut[_0x4db9('0x8d')]('[RecallMe]'));}else{rpcDb[_0x4db9('0x8f')](_0x37f635[_0x10f6f2]['id']);}}else{var _0x3a6b75=new Action(_0x37f635[_0x10f6f2],_0x287c67);_0x3a6b75[_0x4db9('0x90')]=moment()[_0x4db9('0x52')](_0x4db9('0x91'));_0x287c67[_0x4db9('0x3f')]+=0x1;ut[_0x4db9('0x92')](_0x3a6b75,0x17,_0x4db9('0x93'));if(_0x287c67['dialRecallInQueue']){rpcDb[_0x4db9('0x94')](ut[_0x4db9('0x95')](_0x37f635[_0x10f6f2]));rpcDb[_0x4db9('0x96')](_0x3a6b75,'[HistoryDialRecallInQueue][historyCatch]');}else{ut['logCustomer'](_0x3a6b75,0x16,_0x4db9('0x97'));rpcDb[_0x4db9('0x96')](_0x3a6b75,'[HistoryRecallClose]');rpcDb[_0x4db9('0x98')](_0x3a6b75,'[HistoryRecallClose]');}}}}})[_0x4db9('0x7b')](ut[_0x4db9('0x8d')](_0x4db9('0x99')));};Preview[_0x4db9('0xe')][_0x4db9('0x69')]=function(_0x2024ec){_0x2024ec[_0x4db9('0x58')]=!![];if(ut[_0x4db9('0x9a')](_0x2024ec['loggedIn'])){_0x2024ec[_0x4db9('0x5b')]=_0x4db9('0x9b');}else if(!ut[_0x4db9('0x9c')](_0x2024ec[_0x4db9('0x33')])){_0x2024ec[_0x4db9('0x5b')]=_0x4db9('0x5c');}else if(!this[_0x4db9('0x9d')](_0x2024ec[_0x4db9('0x4f')])){if(!this['isTrunkReachable'](_0x2024ec[_0x4db9('0x9e')])){_0x2024ec['message']='TRUNK_IS_NOT_REACHABLE';}else{_0x2024ec['message']=_0x4db9('0x9f');}}else{_0x2024ec[_0x4db9('0x5b')]=_0x4db9('0x9f');}emitCampaignPreview(_0x2024ec);};Preview[_0x4db9('0xe')][_0x4db9('0xa0')]=function(_0x1db7d9,_0x40c00f,_0x23be44){var _0x5c9467=this;var _0x597843=this['actions'][_0x40c00f];var _0x522be8=this[_0x4db9('0x11')][_0x597843[_0x4db9('0x6f')]];var _0x2612db;if(_0x522be8){switch(_0x23be44){case'1':_0x522be8[_0x4db9('0xa1')]+=0x1;_0x597843[_0x4db9('0xa2')]+=0x1;_0x597843[_0x4db9('0xa3')]=ut[_0x4db9('0xa4')](_0x597843);ut[_0x4db9('0x92')](_0x597843,0x0,'NoSuchNumber');ami[_0x4db9('0x24')](_0x4db9('0xa5'),ut[_0x4db9('0xa6')](_0x597843,'nosuchnumber'));rpcDb[_0x4db9('0x96')](_0x597843,'[callProgressDetectingCustomer][logNoSuch]');if(ut['totalGlobal'](_0x597843)>=_0x522be8['dialGlobalMaxRetry']){_0x2612db=ut['cloneAction'](_0x597843,0xf,_0x4db9('0xa7'));rpcDb[_0x4db9('0x98')](_0x2612db,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x597843[_0x4db9('0xa2')]>=_0x522be8[_0x4db9('0xa8')]){rpcDb[_0x4db9('0x98')](_0x597843,_0x4db9('0xa9'));}else{rpcDb[_0x4db9('0xaa')](ut['scheduledAt'](_0x597843,'countnosuchnumberretry',_0x522be8['dialNoSuchNumberRetryFrequency']),_0x597843[_0x4db9('0xab')],_0x597843['activeContact']);}}delete this[_0x4db9('0x13')][_0x1db7d9['linkedid']];break;case _0x4db9('0xac'):var _0x13fa02=moment()[_0x4db9('0x52')]('YYYY-MM-DD\x20HH:mm:ss');_0x597843[_0x4db9('0xad')]=_0x13fa02;_0x597843['answertime']=_0x13fa02;_0x597843['dialAnswer']=!![];_0x522be8[_0x4db9('0x2b')]+=0x1;logger[_0x4db9('0x6e')](_0x4db9('0xae'),_0x597843['uniqueid'],_0x4db9('0xaf'),_0x522be8['name'],'pTalking:\x20',_0x522be8[_0x4db9('0x2b')]);ami[_0x4db9('0x24')](_0x4db9('0xb0'),ut[_0x4db9('0xa6')](_0x597843,_0x4db9('0xb1'),this[_0x4db9('0x11')][_0x597843['queue']]));if(_0x522be8[_0x4db9('0xb2')]){ami[_0x4db9('0x24')](_0x4db9('0xb3'),ut[_0x4db9('0xb4')](_0x597843));}break;case'16':ami['emit'](_0x4db9('0xb5'),ut[_0x4db9('0xa6')](_0x597843,'complete',this[_0x4db9('0x11')][_0x597843[_0x4db9('0x6f')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x597843,_0x4db9('0xb6')));_0x522be8[_0x4db9('0x37')]+=0x1;_0x522be8[_0x4db9('0x2e')]+=0x1;_0x522be8[_0x4db9('0xb7')]+=0x1;ut['decrementTalkink'](_0x522be8,_0x4db9('0xb8'));_0x597843['countglobal']=ut[_0x4db9('0xa4')](_0x597843);ut[_0x4db9('0x92')](_0x597843,0x4,_0x4db9('0xb9'));rpcDb[_0x4db9('0x96')](_0x597843,'[callProgressDetectingCustomer][logAnswer]');rpcDb['createCustomerFinal'](_0x597843,_0x4db9('0xba'));rpcDb[_0x4db9('0xbb')](_0x597843);_0x522be8[_0x4db9('0xbc')]+=_0x597843[_0x4db9('0xbd')];_0x522be8[_0x4db9('0x2c')]+=_0x597843[_0x4db9('0xbd')];logger[_0x4db9('0x6e')]('[syncHangup][talking][decrement]',_0x597843[_0x4db9('0xbe')],_0x4db9('0xaf'),_0x522be8[_0x4db9('0x27')],_0x4db9('0x72'),_0x522be8['pTalking']);delete this[_0x4db9('0x13')][_0x1db7d9[_0x4db9('0xbf')]];break;case _0x4db9('0xc0'):_0x522be8[_0x4db9('0x39')]+=0x1;_0x597843[_0x4db9('0xc1')]+=0x1;_0x597843[_0x4db9('0xa3')]=ut[_0x4db9('0xa4')](_0x597843);ut[_0x4db9('0x92')](_0x597843,0x5,_0x4db9('0xc2'));ami[_0x4db9('0x24')](_0x4db9('0xc3'),ut[_0x4db9('0xa6')](_0x597843,_0x4db9('0xc4')));rpcDb[_0x4db9('0x96')](_0x597843,_0x4db9('0xc5'));if(ut['totalGlobal'](_0x597843)>=_0x522be8[_0x4db9('0xc6')]){_0x2612db=ut[_0x4db9('0xc7')](_0x597843,0xf,_0x4db9('0xa7'));rpcDb['createCustomerFinal'](_0x2612db,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x597843[_0x4db9('0xc1')]>=_0x522be8['dialBusyMaxRetry']){rpcDb[_0x4db9('0x98')](_0x597843,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0x4db9('0xaa')](ut['scheduledAt'](_0x597843,'countbusyretry',_0x522be8['dialBusyRetryFrequency']),_0x597843['unlockAgent'],_0x597843[_0x4db9('0xc8')]);}}break;case _0x4db9('0xc9'):_0x522be8[_0x4db9('0x3d')]+=0x1;_0x597843['countnoanswerretry']+=0x1;_0x597843[_0x4db9('0xa3')]=ut['totalGlobal'](_0x597843);ut[_0x4db9('0x92')](_0x597843,0x3,'NoAnswer');ami['emit'](_0x4db9('0xca'),ut[_0x4db9('0xa6')](_0x597843,'noanswer'));rpcDb['createCustomerHistory'](_0x597843,_0x4db9('0xcb'));if(ut[_0x4db9('0xa4')](_0x597843)>=_0x522be8[_0x4db9('0xc6')]){_0x2612db=ut[_0x4db9('0xc7')](_0x597843,0xf,'Global');rpcDb[_0x4db9('0x98')](_0x2612db,_0x4db9('0xcc'));}else{if(_0x597843[_0x4db9('0xcd')]>=_0x522be8['dialNoAnswerMaxRetry']){rpcDb[_0x4db9('0x98')](_0x597843,_0x4db9('0xcb'));}else{rpcDb[_0x4db9('0xaa')](ut[_0x4db9('0xce')](_0x597843,_0x4db9('0xcd'),_0x522be8[_0x4db9('0xcf')]),_0x597843[_0x4db9('0xab')],_0x597843['activeContact']);}}break;case'CONGESTION':_0x522be8[_0x4db9('0x3a')]+=0x1;_0x597843[_0x4db9('0xd0')]+=0x1;_0x597843[_0x4db9('0xa3')]=ut[_0x4db9('0xa4')](_0x597843);ut[_0x4db9('0x92')](_0x597843,0x8,_0x4db9('0xd1'));ami[_0x4db9('0x24')](_0x4db9('0xd2'),ut['buildObj'](_0x597843,_0x4db9('0xd3')));rpcDb[_0x4db9('0x96')](_0x597843,_0x4db9('0xd4'));if(ut[_0x4db9('0xa4')](_0x597843)>=_0x522be8[_0x4db9('0xc6')]){_0x2612db=ut['cloneAction'](_0x597843,0xf,'Global');rpcDb[_0x4db9('0x98')](_0x2612db,_0x4db9('0xd5'));}else{if(_0x597843['countcongestionretry']>=_0x522be8[_0x4db9('0xd6')]){rpcDb[_0x4db9('0x98')](_0x597843,_0x4db9('0xd4'));}else{rpcDb[_0x4db9('0xaa')](ut['scheduledAt'](_0x597843,_0x4db9('0xd0'),_0x522be8[_0x4db9('0xd7')]),_0x597843[_0x4db9('0xab')],_0x597843['activeContact']);}}break;case _0x4db9('0xd8'):_0x522be8[_0x4db9('0x40')]+=0x1;_0x597843[_0x4db9('0xd9')]+=0x1;_0x597843[_0x4db9('0xa3')]=ut[_0x4db9('0xa4')](_0x597843);ut['logCustomer'](_0x597843,0x14,'AgentReject');ami[_0x4db9('0x24')](_0x4db9('0xda'),ut['buildObj'](_0x597843,_0x4db9('0xdb')));rpcDb[_0x4db9('0x96')](_0x597843,_0x4db9('0xdc'));if(ut[_0x4db9('0xa4')](_0x597843)>=_0x522be8[_0x4db9('0xc6')]){_0x2612db=ut[_0x4db9('0xc7')](_0x597843,0x14,_0x4db9('0xdd'));rpcDb[_0x4db9('0x98')](_0x2612db,_0x4db9('0xde'));}else{if(_0x597843[_0x4db9('0xd9')]>=_0x522be8[_0x4db9('0xdf')]){rpcDb[_0x4db9('0x98')](_0x597843,_0x4db9('0xde'));}else{rpcDb['rescheduleContact'](ut[_0x4db9('0xce')](_0x597843,'countagentrejectretry',_0x522be8[_0x4db9('0xe0')]),_0x597843[_0x4db9('0xab')],_0x597843[_0x4db9('0xc8')]);}}break;case _0x4db9('0xe1'):_0x522be8[_0x4db9('0x42')]+=0x1;_0x597843[_0x4db9('0xe2')]+=0x1;_0x597843[_0x4db9('0xa3')]=ut[_0x4db9('0xa4')](_0x597843);ut[_0x4db9('0x92')](_0x597843,0xb,_0x4db9('0xe3'));rpcDb[_0x4db9('0x96')](_0x597843,_0x4db9('0xe4'));if(ut['totalGlobal'](_0x597843)>=_0x522be8['dialGlobalMaxRetry']){_0x2612db=ut['cloneAction'](_0x597843,0xf,_0x4db9('0xa7'));rpcDb[_0x4db9('0x98')](_0x2612db,_0x4db9('0xe4'));}else{if(_0x597843[_0x4db9('0xe5')]>=_0x522be8[_0x4db9('0xe6')]){rpcDb[_0x4db9('0x98')](_0x597843,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb[_0x4db9('0xaa')](ut[_0x4db9('0xce')](_0x597843,'countabandonedretry',_0x522be8[_0x4db9('0xe7')]),_0x597843[_0x4db9('0xab')],_0x597843[_0x4db9('0xc8')]);}}break;case'18':_0x522be8[_0x4db9('0x41')]+=0x1;_0x597843[_0x4db9('0xe8')]+=0x1;_0x597843[_0x4db9('0xa3')]=ut[_0x4db9('0xa4')](_0x597843);ut['logCustomer'](_0x597843,0x12,_0x1db7d9['cause-txt']||_0x1db7d9[_0x4db9('0xe9')]);ami[_0x4db9('0x24')]('custom:amd',ut[_0x4db9('0xa6')](_0x597843,'amd'));rpcDb[_0x4db9('0x96')](_0x597843,_0x4db9('0xea'));if(ut[_0x4db9('0xa4')](_0x597843)>=_0x522be8[_0x4db9('0xc6')]){_0x2612db=ut[_0x4db9('0xc7')](_0x597843,0xf,_0x4db9('0xa7'));rpcDb['createCustomerFinal'](_0x2612db,_0x4db9('0xea'));}else{rpcDb['createCustomerFinal'](_0x597843,_0x4db9('0xea'));}delete this[_0x4db9('0x13')][_0x1db7d9['linkedid']];break;case'19':_0x522be8[_0x4db9('0x41')]+=0x1;_0x597843[_0x4db9('0xa3')]=ut['totalGlobal'](_0x597843);ut[_0x4db9('0x92')](_0x597843,0x13,_0x1db7d9[_0x4db9('0xeb')]||_0x1db7d9[_0x4db9('0xe9')]);ami[_0x4db9('0x24')]('custom:amd',ut[_0x4db9('0xa6')](_0x597843,_0x4db9('0xec')));rpcDb[_0x4db9('0x96')](_0x597843,'[callProgressDetectingCustomer][machine]');if(ut[_0x4db9('0xa4')](_0x597843)>=_0x522be8[_0x4db9('0xc6')]){_0x2612db=ut[_0x4db9('0xc7')](_0x597843,0xf,_0x4db9('0xa7'));rpcDb['createCustomerFinal'](_0x2612db,_0x4db9('0xed'));}else{rpcDb[_0x4db9('0x98')](_0x597843,_0x4db9('0xed'));}delete this[_0x4db9('0x13')][_0x1db7d9[_0x4db9('0xbf')]];break;default:if(_0x597843[_0x4db9('0xee')]){ut[_0x4db9('0xef')](_0x522be8,_0x4db9('0xf0'));ut[_0x4db9('0x7e')](_0x4db9('0xf1')+_0x522be8[_0x4db9('0x27')],_0x1db7d9);}_0x522be8[_0x4db9('0x41')]+=0x1;_0x597843[_0x4db9('0xa3')]=ut[_0x4db9('0xa4')](_0x597843);ut[_0x4db9('0x92')](_0x597843,0xc,_0x1db7d9[_0x4db9('0xeb')]||_0x1db7d9[_0x4db9('0xe9')]);rpcDb[_0x4db9('0x96')](_0x597843,_0x4db9('0xf2'));if(ut['totalGlobal'](_0x597843)>=_0x522be8[_0x4db9('0xc6')]){_0x2612db=ut[_0x4db9('0xc7')](_0x597843,0xf,'Global');rpcDb[_0x4db9('0x98')](_0x2612db,_0x4db9('0xf3'));}else{rpcDb[_0x4db9('0x98')](_0x597843,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this['actions'][_0x1db7d9[_0x4db9('0xbf')]];}if(!(_0x597843['dialAnswer']&&_0x23be44==='16')){ut[_0x4db9('0x7c')](_0x522be8,_0x4db9('0xf4'));logger[_0x4db9('0x6e')](_0x4db9('0xf5'),_0x597843[_0x4db9('0xbe')],_0x4db9('0xaf'),_0x522be8['name'],_0x4db9('0x70'),_0x522be8['originated']);}if(_0x23be44!=='ANSWER'){delete this[_0x4db9('0x13')][_0x1db7d9[_0x4db9('0xbf')]];delete this[_0x4db9('0x13')][_0x1db7d9[_0x4db9('0xf6')]];}}};Preview['prototype'][_0x4db9('0xf7')]=function(_0x1a6cac,_0xf53b25,_0x1f895b){if(_[_0x4db9('0xf8')](_0xf53b25)&&_0x4db9('0xf9')!==typeof _0xf53b25){return;}if(_[_0x4db9('0xf8')](_0x1f895b)&&_0x4db9('0xf9')!==typeof _0x1f895b){return;}switch(_0x1f895b[_0x4db9('0xfa')]){case'0':ut['logAgent'](_0x1a6cac,0x0,_0x4db9('0xfb'));rpcDb[_0x4db9('0xfc')](_0x1a6cac,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0x4db9('0xfd')](_0x1a6cac,0x3,'NoAnswer');rpcDb[_0x4db9('0xfc')](_0x1a6cac,_0x4db9('0xfe'));break;case'5':ut[_0x4db9('0xfd')](_0x1a6cac,0x5,_0x4db9('0xc2'));rpcDb['createAgentHistory'](_0x1a6cac,_0x4db9('0xff'));break;case'8':ut[_0x4db9('0xfd')](_0x1a6cac,0x8,_0x4db9('0xd1'));rpcDb[_0x4db9('0xfc')](_0x1a6cac,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut['logAgent'](_0x1a6cac,0x16,'AnswerAGI');rpcDb[_0x4db9('0xfc')](_0x1a6cac,_0x4db9('0x100'));break;default:ut[_0x4db9('0xfd')](_0x1a6cac,0xc,_0x1f895b[_0x4db9('0xfa')]);rpcDb[_0x4db9('0xfc')](_0x1a6cac,_0x4db9('0x101'));}ut[_0x4db9('0x7c')](_0xf53b25,_0x4db9('0x102'));logger[_0x4db9('0x6e')](_0x4db9('0x103'),_0x1a6cac['uniqueid'],_0x4db9('0xaf'),_0xf53b25['name'],_0x4db9('0x70'),_0xf53b25[_0x4db9('0x59')]);delete this[_0x4db9('0x13')][_0x1a6cac['uniqueid']];};Preview[_0x4db9('0xe')]['checkInBlack']=function(_0x28a0c7,_0x4746db,_0x579844,_0x137d52,_0x93c84d){var _0x3c19a9=this;return new BPromise(function(_0x16dec4,_0x4ceca9){if(_['isNil'](_0x4746db)||_['isNil'](_0x4746db[_0x4db9('0x104')])||_[_0x4db9('0x85')](_0x4746db[_0x4db9('0x104')]['phone'])||_['isNil'](_0x4746db['VoiceQueueId'])){_0x4ceca9(ut[_0x4db9('0x5b')]('Contact\x20is\x20undefined',_0x137d52,_0x93c84d));return;}var _0x3155fb=uuid['v4']();var _0x3e886e=_0x3c19a9[_0x4db9('0x11')][_0x4746db[_0x4db9('0x105')][_0x4db9('0x27')]];var _0x47cfd0=_0x579844?_0x3c19a9['agents'][_0x579844]['id']:undefined;_0x3c19a9[_0x4db9('0x13')][_0x3155fb]=new Action(_0x4746db,_0x3e886e,_0x3155fb,_0x579844,_0x47cfd0);var _0x579e2b=_0x3c19a9['actions'][_0x3155fb];_0x579e2b[_0x4db9('0xab')]=_0x137d52;_0x579e2b[_0x4db9('0xc8')]=_0x93c84d;_0x579e2b[_0x4db9('0x106')]=_0x579844;if(_[_0x4db9('0x107')](_0x28a0c7)){_0x3c19a9[_0x4db9('0x108')](_0x579e2b,_0x3e886e,_0x4746db,_0x579844)[_0x4db9('0x84')](function(_0x4d3308){logger[_0x4db9('0x6e')](_0x4db9('0x109'),_0x4db9('0x10a')+_0x579e2b['queue']+_0x4db9('0x10b')+_0x579e2b['idContact'],JSON[_0x4db9('0x71')](_0x4d3308));ami[_0x4db9('0x24')]('custom:agentcalled',ut[_0x4db9('0xa6')](_0x579e2b,_0x4db9('0x10c'),_0x3c19a9['campaignsPreview'][_0x579e2b[_0x4db9('0x6f')]]));_0x16dec4(ut[_0x4db9('0x5b')](_0x4db9('0x10d')));})[_0x4db9('0x7b')](function(_0x33238f){ut[_0x4db9('0x5d')](_0x4db9('0x10e'),_0x33238f);_0x4ceca9(ut['message'](_0x4db9('0x10f'),_0x137d52,_0x93c84d));});}else{_0x3e886e[_0x4db9('0x38')]+=0x1;ut['logBlacklist'](_0x579e2b);rpcDb[_0x4db9('0x110')](_0x579e2b,_0x4db9('0x111'));delete _0x3c19a9[_0x4db9('0x13')][_0x3155fb];_0x4ceca9(ut[_0x4db9('0x5b')]('Contact\x20in\x20black\x20List',_0x137d52,_0x93c84d));}});};Preview[_0x4db9('0xe')]['isTrunkReachable']=function(_0x17deb9){return!_[_0x4db9('0x85')](_0x17deb9)&&!_['isNil'](_0x17deb9[_0x4db9('0x27')])&&!_[_0x4db9('0x85')](_0x17deb9['active'])&&_0x17deb9[_0x4db9('0x50')]&&!_['isNil'](this[_0x4db9('0x112')][util['format'](_0x4db9('0x113'),_0x17deb9[_0x4db9('0x27')])])&&!_['isNil'](this['trunks'][util[_0x4db9('0x52')]('SIP/%s',_0x17deb9[_0x4db9('0x27')])][_0x4db9('0x79')])&&(this[_0x4db9('0x112')][util[_0x4db9('0x52')](_0x4db9('0x113'),_0x17deb9[_0x4db9('0x27')])][_0x4db9('0x79')]===_0x4db9('0x114')||this[_0x4db9('0x112')][util['format'](_0x4db9('0x113'),_0x17deb9['name'])][_0x4db9('0x79')]===_0x4db9('0x115'));};Preview[_0x4db9('0xe')][_0x4db9('0x8c')]=function(_0x33eefb,_0x2bb523){var _0x2d81e2=this;return new BPromise(function(_0x562cbf,_0x5156b3){_0x2d81e2[_0x4db9('0x116')](_0x33eefb,_0x2bb523)[_0x4db9('0x84')](function(_0x4c1e5f){_0x562cbf(_[_0x4db9('0x73')](_0x4c1e5f,[_0x4db9('0x5b')]));})[_0x4db9('0x7b')](function(_0x2066f2){if(_0x2066f2[_0x4db9('0x117')]){rpcDb['unlockContact'](_0x33eefb);}if(_0x2066f2['active']){rpcDb[_0x4db9('0x8f')](_0x33eefb);}_0x5156b3(_['pick'](_0x2066f2,[_0x4db9('0x5b')]));});});};Preview[_0x4db9('0xe')][_0x4db9('0x116')]=function(_0x57be63,_0x547d6b){var _0x2bd150=this;return new BPromise(function(_0x5e7da0,_0x1d8229){var _0x25bc7a,_0x570d79;rpcDb[_0x4db9('0x118')](_0x57be63)[_0x4db9('0x84')](function(_0x2f37b0){if(!_[_0x4db9('0x85')](_0x2f37b0[0x0])){_0x570d79=_0x2f37b0[0x0][_0x4db9('0x119')]?![]:!![];_0x25bc7a=_0x2f37b0[0x0][_0x4db9('0x119')]?!![]:![];_0x25bc7a=_0x547d6b?!![]:_0x25bc7a;}var _0x10af6f=_0x2bd150[_0x4db9('0x11a')](_0x2f37b0);if(_0x10af6f[_0x4db9('0x11b')]){rpcDb[_0x4db9('0x11c')](_[_0x4db9('0x73')](_0x2f37b0[0x0],['VoiceQueueId','Contact.phone']))[_0x4db9('0x84')](function(_0x256486){_0x2bd150['checkInBlack'](_0x256486,_0x2f37b0[0x0],_0x547d6b,_0x570d79,_0x25bc7a)['then'](function(_0x1fd4ad){_0x5e7da0(_0x1fd4ad);})[_0x4db9('0x7b')](function(_0x108c0e){_0x1d8229(_0x108c0e);});})[_0x4db9('0x7b')](function(_0x4dc454){ut[_0x4db9('0x5d')](_0x4db9('0x11d'),_0x4dc454);_0x1d8229(ut[_0x4db9('0x5b')](_0x4db9('0x11e'),_0x570d79,_0x25bc7a));});}else{_0x1d8229(ut[_0x4db9('0x5b')](_0x10af6f['message'],_0x570d79,_0x25bc7a));}})[_0x4db9('0x7b')](function(_0x3c380b){ut['logger'](_0x4db9('0x11f'),_0x3c380b);_0x1d8229(ut[_0x4db9('0x5b')]('Call\x20unsuccessful',![],!![]));});});};Preview['prototype'][_0x4db9('0x11a')]=function(_0x56fc73){if(_[_0x4db9('0x85')](_0x56fc73)||_[_0x4db9('0x107')](_0x56fc73)||!_[_0x4db9('0x85')](_0x56fc73[0x0]['Agent'])&&_[_0x4db9('0x85')](_0x56fc73[0x0][_0x4db9('0x8a')][_0x4db9('0x27')])){ut[_0x4db9('0x5d')](_0x4db9('0x120'),_0x56fc73);return{'isValid':![],'message':_0x4db9('0x121')};}var _0x428474=this[_0x4db9('0x11')][_0x56fc73[0x0][_0x4db9('0x105')]['name']];_0x428474[_0x4db9('0x5b')]=_0x4db9('0x9f');if(_[_0x4db9('0x85')](_0x428474)){ut['logger'](_0x4db9('0x122'),_0x428474);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0x4db9('0x9d')](_0x428474[_0x4db9('0x4f')])){ut[_0x4db9('0x5d')](_0x4db9('0x123'),'campaign\x20Name:\x20'+_0x428474['name']+_0x4db9('0x124'));if(!this['isTrunkReachable'](_0x428474[_0x4db9('0x9e')])){ut[_0x4db9('0x5d')](_0x4db9('0x123'),_0x428474[_0x4db9('0x27')]+_0x4db9('0x125'));return{'isValid':![],'message':_0x4db9('0x126')};}}if(!ut['isActive'](_0x428474[_0x4db9('0x33')])){ut[_0x4db9('0x5d')]('[Preview][validateContact][Campaign\x20Active]',_0x428474[_0x4db9('0x27')]+'\x20Not\x20Active');return{'isValid':![],'message':_0x4db9('0x127')+_0x428474[_0x4db9('0x27')]+_0x4db9('0x128')};}return{'isValid':!![],'message':_0x4db9('0x129')};};Preview[_0x4db9('0xe')][_0x4db9('0x108')]=function(_0x7780b2,_0x34a269,_0x3575c6,_0x42d402){var _0x2b1b7c=this;return new BPromise(function(_0x35a7ae,_0x1e06da){var _0xc3257=_0x7780b2[_0x4db9('0xbe')];var _0x1095b4=_0x2b1b7c['isTrunkReachable'](_0x34a269['Trunk'])?util[_0x4db9('0x52')](_0x4db9('0x12a'),_0x34a269[_0x4db9('0x4f')][_0x4db9('0x27')],_[_0x4db9('0x85')](_0x34a269[_0x4db9('0x35')])?'':_0x34a269['dialPrefix'][_0x4db9('0x12b')]()||'',_0x34a269[_0x4db9('0x12c')]>0x0?_0x3575c6[_0x4db9('0x104')][_0x4db9('0x12d')][_0x4db9('0x12e')](_0x34a269[_0x4db9('0x12c')]):_0x3575c6[_0x4db9('0x104')][_0x4db9('0x12d')]):util['format'](_0x4db9('0x12a'),_['isNil'](_0x34a269[_0x4db9('0x9e')])?_0x34a269[_0x4db9('0x4f')][_0x4db9('0x27')]:_0x34a269[_0x4db9('0x9e')][_0x4db9('0x27')],_[_0x4db9('0x85')](_0x34a269[_0x4db9('0x35')])?'':_0x34a269[_0x4db9('0x35')]['trim']()||'',_0x34a269[_0x4db9('0x12c')]>0x0?_0x3575c6[_0x4db9('0x104')]['phone'][_0x4db9('0x12e')](_0x34a269[_0x4db9('0x12c')]):_0x3575c6[_0x4db9('0x104')][_0x4db9('0x12d')]);var _0x1c0e83=_0x2b1b7c['isTrunkReachable'](_0x34a269[_0x4db9('0x4f')])?ut[_0x4db9('0x12f')](_0x34a269[_0x4db9('0x4f')][_0x4db9('0x130')],_0x34a269['dialOriginateCallerIdName'],_0x34a269[_0x4db9('0x131')]>0x0?ut[_0x4db9('0x132')](_0x34a269[_0x4db9('0x34')],_0x34a269['dialRandomLastDigitCallerIdNumber']):_0x34a269[_0x4db9('0x34')]):ut[_0x4db9('0x12f')](_['isNil'](_0x34a269[_0x4db9('0x9e')])?_0x34a269[_0x4db9('0x4f')][_0x4db9('0x130')]:_0x34a269[_0x4db9('0x9e')][_0x4db9('0x130')],_0x34a269[_0x4db9('0x133')],_0x34a269[_0x4db9('0x131')]>0x0?ut[_0x4db9('0x132')](_0x34a269[_0x4db9('0x34')],_0x34a269[_0x4db9('0x131')]):_0x34a269['dialOriginateCallerIdNumber']);if(_0x1c0e83){_0x7780b2[_0x4db9('0x134')]=ut[_0x4db9('0x135')](_0x1c0e83);_0x7780b2[_0x4db9('0x136')]=ut['extractCalleridNumber'](_0x1c0e83);}var _0xf01341=ut[_0x4db9('0x137')](_0x34a269,_0x3575c6,_0x1095b4,_0x1c0e83,_0xc3257,_0x7780b2);_['merge'](_0x7780b2,ut['toLowerVariables'](_0xf01341));_0x7780b2['starttime']=moment()[_0x4db9('0x52')](_0x4db9('0x91'));ami[_0x4db9('0x78')](ut['variablesAction'](_0x7780b2,_0x34a269,_0xf01341,_0x7780b2[_0x4db9('0xc8')],_0x42d402))[_0x4db9('0x84')](function(_0x4c02ac){_0x34a269[_0x4db9('0x59')]+=0x1;logger[_0x4db9('0x6e')](_0x4db9('0x138'),_0xc3257,_0x4db9('0xaf'),_0x34a269['name'],_0x4db9('0x70'),_0x34a269['originated']);_0x35a7ae(_0x4c02ac);})['catch'](function(_0x5841d6){ut[_0x4db9('0xfd')](_0x7780b2,0xe,_0x4db9('0x139'));rpcDb[_0x4db9('0xfc')](_0x7780b2,_0x4db9('0x13a'));_0x1e06da(_0x5841d6);});});};Preview[_0x4db9('0xe')]['syncNewExten']=function(_0x3562f1){if(this[_0x4db9('0x13')][_0x3562f1[_0x4db9('0xbf')]]){this['actions'][_0x3562f1[_0x4db9('0xbf')]]['channel']=_0x3562f1[_0x4db9('0x7a')];}};Preview[_0x4db9('0xe')][_0x4db9('0x16')]=function(_0x4ffeed){var _0xd2a174=this;var _0x32c1bd=this[_0x4db9('0x13')][_0x4ffeed[_0x4db9('0x13b')]];if(_0x32c1bd){if(_0x32c1bd['lookAgent']&&this[_0x4db9('0x14')][_0x32c1bd['lookAgent']]){ut[_0x4db9('0x13c')](_0x32c1bd,this[_0x4db9('0x14')][_0x32c1bd[_0x4db9('0x106')]][_0x4db9('0x27')],this[_0x4db9('0x14')][_0x32c1bd[_0x4db9('0x106')]]['id']);}var _0x57f32b=_[_0x4db9('0x13d')](_0x32c1bd);_0x57f32b[_0x4db9('0xad')]=moment()['format'](_0x4db9('0x91'));var _0x2744cc=_0xd2a174['campaignsPreview'][_0x32c1bd['queue']];if(ut[_0x4db9('0x13e')](_0x4ffeed[_0x4db9('0x13f')])){if(_0x32c1bd[_0x4db9('0xab')]){rpcDb[_0x4db9('0x140')](_0x32c1bd[_0x4db9('0x141')]);}if(_0x32c1bd[_0x4db9('0xc8')]){rpcDb[_0x4db9('0x8f')](_0x32c1bd[_0x4db9('0x141')]);}ami[_0x4db9('0x24')](_0x4db9('0x142'),ut[_0x4db9('0xa6')](_0x32c1bd,_0x4db9('0x143'),this[_0x4db9('0x11')][_0x32c1bd[_0x4db9('0x6f')]]));this['callProgressDetectingAgent'](_0x57f32b,_0x2744cc,_0x4ffeed);}else{_0x32c1bd[_0x4db9('0x90')]=moment()[_0x4db9('0x52')](_0x4db9('0x91'));ut[_0x4db9('0xfd')](_0x57f32b,0x4,'Answer');rpcDb[_0x4db9('0xfc')](_0x57f32b,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0x4db9('0xe')][_0x4db9('0x19')]=function(_0x4eb570){var _0x4ff181=this;var _0x27792a=this[_0x4db9('0x13')][_0x4eb570[_0x4db9('0xbf')]];var _0x52caa0;if(_0x27792a){_0x52caa0=this[_0x4db9('0x11')][_0x27792a[_0x4db9('0x6f')]];logger[_0x4db9('0x6e')](_0x4db9('0x144'),_0x4eb570[_0x4db9('0xbf')],_0x4db9('0xaf'),_0x52caa0[_0x4db9('0x27')],_0x4db9('0x72'),_0x52caa0[_0x4db9('0x2b')]);}if(this[_0x4db9('0x13')][_0x4eb570[_0x4db9('0xbf')]]&&_0x4eb570['linkedid']!==_0x4eb570[_0x4db9('0xbe')]){if(_0x4eb570[_0x4db9('0x145')]==='16'&&this['actions'][_0x4eb570[_0x4db9('0xbf')]][_0x4db9('0xee')]){this[_0x4db9('0xa0')](_0x4eb570,_0x4eb570[_0x4db9('0xbf')],_0x4eb570[_0x4db9('0x145')]);}else if(this[_0x4db9('0x13')][_0x4eb570['linkedid']]['dialAnswer']){logger[_0x4db9('0x6e')](_0x4db9('0x146'),_0x4eb570[_0x4db9('0xbf')],_0x4eb570[_0x4db9('0x145')],_0x4db9('0xaf'),_0x52caa0[_0x4db9('0x27')],_0x4db9('0x72'),_0x52caa0[_0x4db9('0x2b')]);this[_0x4db9('0xa0')](_0x4eb570,_0x4eb570[_0x4db9('0xbf')],_0x4eb570[_0x4db9('0x145')]);}}else if(_0x27792a&&_[_0x4db9('0x85')](_0x27792a[_0x4db9('0x147')])&&_0x52caa0[_0x4db9('0x148')]&&_0x4eb570[_0x4db9('0xbf')]===_0x4eb570[_0x4db9('0xbe')]&&_[_0x4db9('0x85')](_0x4eb570[_0x4db9('0xfa')])&&_0x4eb570['cause']==='16'&&_0x4eb570[_0x4db9('0x149')]==='6'&&_[_0x4db9('0xf8')](_0x27792a[_0x4db9('0x14a')])){if(_0x27792a[_0x4db9('0xab')]){rpcDb[_0x4db9('0x140')](_0x27792a['idContact']);}if(_0x27792a[_0x4db9('0xc8')]){rpcDb[_0x4db9('0x8f')](_0x27792a['idContact']);}_0x4eb570[_0x4db9('0xfa')]='22';this[_0x4db9('0xf7')](_0x27792a,_0x52caa0,_0x4eb570);}else if(_0x27792a&&_0x27792a['transfer']){if(_0x4eb570[_0x4db9('0x145')]==='16'&&this[_0x4db9('0x13')][_0x4eb570[_0x4db9('0xbf')]]['dialAnswer']){logger[_0x4db9('0x6e')](_0x4db9('0x14b'),_0x4eb570[_0x4db9('0xbf')],_0x4eb570[_0x4db9('0x145')],'\x20Queue',_0x52caa0['name'],'pTalking:\x20',_0x52caa0[_0x4db9('0x2b')]);this[_0x4db9('0xa0')](_0x4eb570,_0x4eb570[_0x4db9('0xbf')],_0x4eb570['cause']);}else if(this[_0x4db9('0x13')][_0x4eb570[_0x4db9('0xbf')]][_0x4db9('0xee')]){logger[_0x4db9('0x6e')](_0x4db9('0x146'),_0x4eb570[_0x4db9('0xbf')],_0x4eb570[_0x4db9('0x145')],_0x4db9('0xaf'),_0x52caa0['name'],_0x4db9('0x72'),_0x52caa0['pTalking']);this[_0x4db9('0xa0')](_0x4eb570,_0x4eb570[_0x4db9('0xbf')],_0x4eb570[_0x4db9('0x145')]);}}};Preview[_0x4db9('0xe')]['syncDialEnd']=function(_0x1e34ad){if(this[_0x4db9('0x13')][_0x1e34ad[_0x4db9('0xf6')]]&&_0x1e34ad[_0x4db9('0xf6')]!==_0x1e34ad[_0x4db9('0x14c')]){this[_0x4db9('0xa0')](_0x1e34ad,_0x1e34ad[_0x4db9('0xf6')],_0x1e34ad[_0x4db9('0xe9')]);}};Preview['prototype'][_0x4db9('0x1b')]=function(_0x1bff58){if(this[_0x4db9('0x13')][_0x1bff58[_0x4db9('0xbf')]]&&_0x1bff58[_0x4db9('0xbf')]!==_0x1bff58['uniqueid']&&!this['actions'][_0x1bff58['linkedid']][_0x4db9('0xee')]){if(_0x1bff58[_0x4db9('0x145')]==='1'){this[_0x4db9('0xa0')](_0x1bff58,_0x1bff58[_0x4db9('0xbf')],_0x1bff58[_0x4db9('0x145')]);}}};Preview['prototype'][_0x4db9('0x14d')]=function(_0x1f1823,_0x4cc042,_0x434293){if(this['actions'][_0x1f1823]){if(_[_0x4db9('0x85')](this['actions'][_0x1f1823][_0x4db9('0x14e')])){this[_0x4db9('0x13')][_0x1f1823][_0x4db9('0x14e')]={};}this[_0x4db9('0x13')][_0x1f1823][_0x4db9('0x14e')][_0x4cc042]=_0x434293;}};Preview[_0x4db9('0xe')][_0x4db9('0x14f')]=function(_0xb42488){try{if(!_[_0x4db9('0x85')](_0xb42488)){if(ut[_0x4db9('0x150')](_[_0x4db9('0x151')](_0xb42488['variable'])[0x0])){this[_0x4db9('0x14d')](_0xb42488['uniqueid'],_[_0x4db9('0x151')](_0xb42488[_0x4db9('0x152')])[0x0],_0xb42488[_0x4db9('0x153')]);}}}catch(_0x534155){logger[_0x4db9('0x154')](_0x4db9('0x155'),util[_0x4db9('0x156')](_0x534155,{'showHidden':![],'depth':null}));}};Preview[_0x4db9('0xe')]['syncAttendedTransfer']=function(_0x5dbda0){if(_0x5dbda0){if(this['actions'][_0x5dbda0['transfertargetlinkedid']]){this['actions'][_0x5dbda0[_0x4db9('0x157')]][_0x4db9('0x14a')]=!![];}}};Preview[_0x4db9('0xe')][_0x4db9('0x22')]=function(_0xefc5e6){if(_0xefc5e6){if(this[_0x4db9('0x13')][_0xefc5e6[_0x4db9('0x158')]]){this[_0x4db9('0x13')][_0xefc5e6[_0x4db9('0x158')]][_0x4db9('0x14a')]=!![];}}};module['exports']=Preview; \ No newline at end of file +var _0x0faf=['trunks','actions','agents','syncOriginateResponse','hangup','syncHangup','bind','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','blindtransfer','syncBlindTransfer','loopCampaigns','emit','outbound','name','strategy','answered','available','loggedIn','pTalking','sumBillable','sumHoldTime','talking','type','unmanaged','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','stringify','format','voice:queue:%s','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','paused','message','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','clockClearZombieChannels','hasOwnProperty','clearZombieChannels','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','sequence','isNil','info','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','contactId','UserId','VoiceQueueId','ListId','status','channel','catch','[clearZombieChannel]','dialAnswer','decrementTalkink','[Dialer][checkChannel][pTalking][Preview]','loggerError','[Dialer][checkChannel][Preview]','[action]','size','agentReadyId','then','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','logger2','[RecallMe]','disableContact','starttime','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','AGENTS_NOT_LOGGED','isActive','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','totalGlobal','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','scheduledAt','countnosuchnumberretry','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','ANSWER','responsetime','answertime','uniqueid','\x20Queue','custom:agentconnect','acw','complete','[16]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','[syncHangup][talking][decrement]','linkedid','outboundBusyCallsDay','countbusyretry','countglobal','Busy','busy','dialBusyMaxRetry','[callProgressDetectingCustomer][logBusy]','rescheduleContact','NoAnswer','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','dialNoAnswerRetryFrequency','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','dialCongestionMaxRetry','countagentrejectretry','custom:agentreject','cloneAction','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','dialAbandonedRetryFrequency','outboundUnknownCallsDay','dialstatus','amd','[callProgressDetectingCustomer][hangupInAMD]','cause-txt','custom:amd','[callProgressDetectingCustomer][machine]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','updateOriginated','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','object','isUndefined','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','reason','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','Contact\x20is\x20undefined','lookAgent','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','[Preview][execCall][failure]','Call\x20failed','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','isTrunkReachable','SIP/%s','unmonitored','run','execRun','pick','unlockContact','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','Empty\x20Contact','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','trim','dialCutDigit','phone','substring','SIP/%s/%s%s','getCallerId','callerid','getCallerIdRandom','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','YYYY-MM-DD\x20HH:mm:ss','Action','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','isFailure','idContact','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','callProgressDetectingAgent','[syncHangup][talking][transfer]','addVariable','variables','filterKey','variable','keys','value','error','inspect','exports','util','bluebird','uuid','moment','md5','ioredis','../../../config/environment','../../../config/logger','preview','../ami','./rpcDb','./action','./util/util','redis','localhost','prototype','enqueue','tail','finally','campaignsPreview'];(function(_0x372ae0,_0x2efa78){var _0x390c44=function(_0x139dab){while(--_0x139dab){_0x372ae0['push'](_0x372ae0['shift']());}};_0x390c44(++_0x2efa78);}(_0x0faf,0x132));var _0xf0fa=function(_0x528497,_0x147e87){_0x528497=_0x528497-0x0;var _0x392d59=_0x0faf[_0x528497];return _0x392d59;};'use strict';var util=require(_0xf0fa('0x0'));var _=require('lodash');var BPromise=require(_0xf0fa('0x1'));var uuid=require(_0xf0fa('0x2'));var moment=require(_0xf0fa('0x3'));var md5=require(_0xf0fa('0x4'));var Redis=require(_0xf0fa('0x5'));var config=require(_0xf0fa('0x6'));var logger=require(_0xf0fa('0x7'))(_0xf0fa('0x8'));var loggerAction=require(_0xf0fa('0x7'))('actionPreview');var ami=require(_0xf0fa('0x9'));var rpcDb=require(_0xf0fa('0xa'));var Action=require(_0xf0fa('0xb'));var ut=require(_0xf0fa('0xc'));config[_0xf0fa('0xd')]=_['defaults'](config[_0xf0fa('0xd')],{'host':_0xf0fa('0xe'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Sequence=function(){};Sequence[_0xf0fa('0xf')][_0xf0fa('0x10')]=function(_0x25dfec){this[_0xf0fa('0x11')]=this[_0xf0fa('0x11')]?this[_0xf0fa('0x11')][_0xf0fa('0x12')](_0x25dfec):_0x25dfec();};function Preview(_0x20fd09){this['sequence']=new Sequence();this[_0xf0fa('0x13')]=_0x20fd09['voiceQueues'];this[_0xf0fa('0x14')]=_0x20fd09['trunks'];this[_0xf0fa('0x15')]={};this[_0xf0fa('0x16')]=_0x20fd09[_0xf0fa('0x16')];this['clockClearZombieChannels']=0x0;ami['on']('originateresponse',this[_0xf0fa('0x17')]['bind'](this));ami['on'](_0xf0fa('0x18'),this[_0xf0fa('0x19')][_0xf0fa('0x1a')](this));ami['on'](_0xf0fa('0x1b'),this[_0xf0fa('0x1c')][_0xf0fa('0x1a')](this));ami['on'](_0xf0fa('0x1d'),this[_0xf0fa('0x1e')]['bind'](this));ami['on'](_0xf0fa('0x1f'),this[_0xf0fa('0x20')][_0xf0fa('0x1a')](this));ami['on'](_0xf0fa('0x21'),this[_0xf0fa('0x22')][_0xf0fa('0x1a')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0xf0fa('0x1a')](this));ami['on'](_0xf0fa('0x23'),this[_0xf0fa('0x24')][_0xf0fa('0x1a')](this));this[_0xf0fa('0x25')](this[_0xf0fa('0x13')]);}function emit(_0x32c9bc,_0x3de639,_0x3b87a2){io['to'](_0x32c9bc)[_0xf0fa('0x26')](_0x3de639,_0x3b87a2);}function emitCampaignPreview(_0x1878c4){if(_0x1878c4['type']===_0xf0fa('0x27')){var _0x306f3e={'id':_0x1878c4['id'],'name':_0x1878c4[_0xf0fa('0x28')],'strategy':_0x1878c4[_0xf0fa('0x29')],'answered':_0x1878c4[_0xf0fa('0x2a')],'available':_0x1878c4[_0xf0fa('0x2b')],'loggedIn':_0x1878c4[_0xf0fa('0x2c')],'pTalking':_0x1878c4[_0xf0fa('0x2d')],'sumBillable':_0x1878c4[_0xf0fa('0x2e')],'sumDuration':_0x1878c4['sumDuration'],'sumHoldTime':_0x1878c4[_0xf0fa('0x2f')]||0x0,'talking':_0x1878c4[_0xf0fa('0x30')],'total':_0x1878c4['total'],'type':_0x1878c4[_0xf0fa('0x31')],'unmanaged':_0x1878c4[_0xf0fa('0x32')],'abandoned':_0x1878c4[_0xf0fa('0x33')],'waiting':_0x1878c4['waiting'],'loggedInDb':_0x1878c4[_0xf0fa('0x34')],'dialActive':_0x1878c4[_0xf0fa('0x35')],'dialMethod':_0x1878c4[_0xf0fa('0x36')],'dialOriginateCallerIdName':_0x1878c4[_0xf0fa('0x37')],'dialOriginateCallerIdNumber':_0x1878c4['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x1878c4['dialOriginateTimeout'],'dialPrefix':_0x1878c4[_0xf0fa('0x38')],'outboundAnswerAgiCallsDay':_0x1878c4[_0xf0fa('0x39')],'outboundAnswerCallsDay':_0x1878c4[_0xf0fa('0x3a')],'outboundBlacklistCallsDay':_0x1878c4[_0xf0fa('0x3b')],'outboundBusyCallsDay':_0x1878c4['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x1878c4[_0xf0fa('0x3c')],'outboundDropCallsDayACS':_0x1878c4[_0xf0fa('0x3d')],'outboundDropCallsDayCallersExit':_0x1878c4[_0xf0fa('0x3e')],'outboundDropCallsDayTimeout':_0x1878c4['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x1878c4[_0xf0fa('0x3f')],'outboundNoSuchCallsDay':_0x1878c4['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x1878c4[_0xf0fa('0x40')],'outboundReCallsDay':_0x1878c4[_0xf0fa('0x41')],'outboundRejectCallsDay':_0x1878c4[_0xf0fa('0x42')],'outboundUnknownCallsDay':_0x1878c4['outboundUnknownCallsDay'],'outboundAbandonedCallsDay':_0x1878c4[_0xf0fa('0x43')],'predictiveIntervalAnsweredCalls':_0x1878c4[_0xf0fa('0x44')],'predictiveIntervalAvgHoldtime':_0x1878c4[_0xf0fa('0x45')],'predictiveIntervalAvgTalktime':_0x1878c4[_0xf0fa('0x46')],'predictiveIntervalDroppedCallsCallersExit':_0x1878c4[_0xf0fa('0x47')],'predictiveIntervalDroppedCallsTimeout':_0x1878c4[_0xf0fa('0x48')],'predictiveIntervalErlangCalls':_0x1878c4['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x1878c4['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x1878c4[_0xf0fa('0x49')],'predictiveIntervalMultiplicativeFactor':_0x1878c4[_0xf0fa('0x4a')],'predictiveIntervalPauses':_0x1878c4['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x1878c4[_0xf0fa('0x4b')],'predictiveIntervalTotalCalls':_0x1878c4['predictiveIntervalTotalCalls'],'message':_0x1878c4['message'],'originated':_0x1878c4['originated'],'erlangCalls':_0x1878c4[_0xf0fa('0x4c')],'erlangCallToSecond':_0x1878c4['erlangCallToSecond'],'erlangAbandonmentRate':_0x1878c4[_0xf0fa('0x4d')],'erlangBusyFactor':_0x1878c4[_0xf0fa('0x4e')],'startPredictive':_0x1878c4[_0xf0fa('0x4f')],'startProgressive':_0x1878c4[_0xf0fa('0x50')]};if(_0x1878c4[_0xf0fa('0x51')]){_0x306f3e[_0xf0fa('0x51')]={'id':_0x1878c4[_0xf0fa('0x51')]['id'],'name':_0x1878c4[_0xf0fa('0x51')]['name'],'active':_0x1878c4[_0xf0fa('0x51')][_0xf0fa('0x52')],'callerid':_0x1878c4[_0xf0fa('0x51')]['callerid']};}if(_0x1878c4[_0xf0fa('0x53')]){_0x306f3e[_0xf0fa('0x53')]={'id':_0x1878c4[_0xf0fa('0x53')]['id'],'name':_0x1878c4[_0xf0fa('0x53')]['name']};}var _0x5c474e=md5(JSON[_0xf0fa('0x54')](_0x306f3e));if(_0x1878c4[_0xf0fa('0x4')]!==_0x5c474e){_0x1878c4[_0xf0fa('0x4')]=_0x5c474e;emit(util[_0xf0fa('0x55')](_0xf0fa('0x56'),_0x306f3e['name']),'voice_queue:save',_0x306f3e);}}}function emitVoiceQueueChannelRemove(_0x5a2be0){logger['info'](_0xf0fa('0x57'),JSON[_0xf0fa('0x54')](_0x5a2be0));emit(util['format']('voice:queue:%s',_0x5a2be0[_0xf0fa('0x28')]),_0xf0fa('0x58'),_0x5a2be0);io[_0xf0fa('0x26')](_0xf0fa('0x59'),_0x5a2be0);}function notSendMessagesQueue(_0x2202de){if(_0x2202de[_0xf0fa('0x5a')]){if(_0x2202de[_0xf0fa('0x5b')]===0x0&&_0x2202de['pTalking']===0x0){_0x2202de['sendMessageOneNotActive']=![];_0x2202de[_0xf0fa('0x2b')]=0x0;_0x2202de[_0xf0fa('0x5c')]=0x0;_0x2202de[_0xf0fa('0x5d')]=_0xf0fa('0x5e');ut[_0xf0fa('0x5f')](_0xf0fa('0x60'),_0x2202de['name']+_0xf0fa('0x61'));}else{_0x2202de['message']=_0xf0fa('0x62');ut[_0xf0fa('0x5f')](_0xf0fa('0x60'),_0x2202de[_0xf0fa('0x28')]+_0xf0fa('0x63'));}emitCampaignPreview(_0x2202de);}}Preview[_0xf0fa('0xf')][_0xf0fa('0x25')]=function(){var _0x36778f=this;setInterval(function(){_0x36778f[_0xf0fa('0x64')]();},0x7cf);};Preview['prototype']['syncCampaigns']=function(){var _0x52221a=this[_0xf0fa('0x13')];this[_0xf0fa('0x65')]+=0x1;for(var _0x53667f in _0x52221a){if(_0x52221a[_0xf0fa('0x66')](_0x53667f)&&(_0x52221a[_0x53667f][_0xf0fa('0x36')]===_0xf0fa('0x8')||_0x52221a[_0x53667f][_0xf0fa('0x36')]==='booked')&&_0x52221a[_0x53667f][_0xf0fa('0x31')]===_0xf0fa('0x27')){if(this[_0xf0fa('0x65')]>0x7){this[_0xf0fa('0x65')]=0x0;this[_0xf0fa('0x67')]();}}if(_0x52221a[_0xf0fa('0x66')](_0x53667f)&&_0x52221a[_0x53667f][_0xf0fa('0x36')]===_0xf0fa('0x8')&&_0x52221a[_0x53667f][_0xf0fa('0x31')]==='outbound'){if(_0x52221a[_0x53667f][_0xf0fa('0x35')]){this[_0xf0fa('0x68')](_0x52221a[_0x53667f]);if(_0x52221a[_0x53667f][_0xf0fa('0x69')])this[_0xf0fa('0x6a')](_0x52221a[_0x53667f]);}else{notSendMessagesQueue(_0x52221a[_0x53667f]);}}}};Preview[_0xf0fa('0xf')][_0xf0fa('0x6b')]=function(_0x53b2a6){var _0xd86643=this;this[_0xf0fa('0x6c')]['enqueue'](function(){if(!_[_0xf0fa('0x6d')](_0xd86643[_0xf0fa('0x15')][_0x53b2a6])){loggerAction[_0xf0fa('0x6e')](_0xf0fa('0x6f'),_0x53b2a6,_0xf0fa('0x70'),_0xd86643[_0xf0fa('0x15')][_0x53b2a6][_0xf0fa('0x71')],_0xf0fa('0x72'),JSON[_0xf0fa('0x54')](_0xd86643['campaignsPreview'][_0xd86643[_0xf0fa('0x15')][_0x53b2a6]['queue']][_0xf0fa('0x5b')]),_0xf0fa('0x73'),JSON[_0xf0fa('0x54')](_0xd86643['campaignsPreview'][_0xd86643[_0xf0fa('0x15')][_0x53b2a6][_0xf0fa('0x71')]][_0xf0fa('0x2d')]),JSON[_0xf0fa('0x54')](_0xd86643[_0xf0fa('0x15')][_0x53b2a6]['dialAnswer']),JSON[_0xf0fa('0x54')](_['pick'](_0xd86643[_0xf0fa('0x15')][_0x53b2a6],[_0xf0fa('0x74'),_0xf0fa('0x75'),_0xf0fa('0x76'),_0xf0fa('0x77')])));return ami['Action']({'action':_0xf0fa('0x78'),'channel':_0xd86643[_0xf0fa('0x15')][_0x53b2a6][_0xf0fa('0x79')]})[_0xf0fa('0x7a')](function(_0x1002e1){if(_0x1002e1[_0xf0fa('0x5d')]==='No\x20such\x20channel'){setTimeout(function(){if(_0xd86643[_0xf0fa('0x15')][_0x53b2a6]){ut['updateOriginated'](_0xd86643['campaignsPreview'][_0xd86643['actions'][_0x53b2a6][_0xf0fa('0x71')]],_0xf0fa('0x7b'));if(_0xd86643[_0xf0fa('0x15')][_0x53b2a6][_0xf0fa('0x7c')]===!![]){ut[_0xf0fa('0x7d')](_0xd86643[_0xf0fa('0x13')][_0xd86643[_0xf0fa('0x15')][_0x53b2a6][_0xf0fa('0x71')]],_0xf0fa('0x7b'));ut['loggerError'](_0xf0fa('0x7e')+_0x53b2a6,_0xd86643['actions'][_0x53b2a6][_0xf0fa('0x71')]);}ut[_0xf0fa('0x7f')](_0xf0fa('0x80')+_0x53b2a6,_0xd86643[_0xf0fa('0x15')][_0x53b2a6]['queue']);delete _0xd86643[_0xf0fa('0x15')][_0x53b2a6];}},0x2328);}});}});};Preview['prototype'][_0xf0fa('0x67')]=function(){var _0x398ea0=this;loggerAction[_0xf0fa('0x6e')](_0xf0fa('0x81'),_[_0xf0fa('0x82')](this[_0xf0fa('0x15')]));for(var _0x4fa721 in this[_0xf0fa('0x15')]){if(_0x398ea0[_0xf0fa('0x15')]['hasOwnProperty'](_0x4fa721)){_0x398ea0[_0xf0fa('0x6b')](_0x4fa721);}}};Preview[_0xf0fa('0xf')]['recallMe']=function(_0x48d769){var _0x2857ae=this;rpcDb['getContactRecallMe'](_0x48d769['id'],ut[_0xf0fa('0x83')](this[_0xf0fa('0x16')]))[_0xf0fa('0x84')](function(_0x4db972){if(!_[_0xf0fa('0x6d')](_0x4db972)){for(var _0x190f2b=0x0;_0x190f2b<_0x4db972['length'];_0x190f2b+=0x1){if(ut[_0xf0fa('0x85')](_0x4db972[_0x190f2b][_0xf0fa('0x86')])<_0x48d769[_0xf0fa('0x87')]*0x3c){if(_0x4db972[_0x190f2b]['Agent']&&!_0x4db972[_0x190f2b][_0xf0fa('0x88')][_0xf0fa('0x89')]){_0x2857ae['run'](_0x4db972[_0x190f2b]['id'])[_0xf0fa('0x84')](ut[_0xf0fa('0x8a')](_0xf0fa('0x8b')))[_0xf0fa('0x7a')](ut[_0xf0fa('0x8a')](_0xf0fa('0x8b')));}else{rpcDb[_0xf0fa('0x8c')](_0x4db972[_0x190f2b]['id']);}}else{var _0x337640=new Action(_0x4db972[_0x190f2b],_0x48d769);_0x337640[_0xf0fa('0x8d')]=moment()[_0xf0fa('0x55')]('YYYY-MM-DD\x20HH:mm:ss');_0x48d769[_0xf0fa('0x41')]+=0x1;ut[_0xf0fa('0x8e')](_0x337640,0x17,_0xf0fa('0x8f'));if(_0x48d769[_0xf0fa('0x90')]){rpcDb[_0xf0fa('0x91')](ut[_0xf0fa('0x92')](_0x4db972[_0x190f2b]));rpcDb[_0xf0fa('0x93')](_0x337640,'[HistoryDialRecallInQueue][historyCatch]');}else{ut[_0xf0fa('0x8e')](_0x337640,0x16,_0xf0fa('0x94'));rpcDb[_0xf0fa('0x93')](_0x337640,_0xf0fa('0x95'));rpcDb[_0xf0fa('0x96')](_0x337640,_0xf0fa('0x95'));}}}}})[_0xf0fa('0x7a')](ut['logger2'](_0xf0fa('0x97')));};Preview[_0xf0fa('0xf')][_0xf0fa('0x68')]=function(_0x1f608e){_0x1f608e[_0xf0fa('0x5a')]=!![];if(ut['IsNotLoggedIn'](_0x1f608e['loggedIn'])){_0x1f608e['message']=_0xf0fa('0x98');}else if(!ut[_0xf0fa('0x99')](_0x1f608e[_0xf0fa('0x35')])){_0x1f608e[_0xf0fa('0x5d')]='NOT_ACTIVE';}else if(!this['isTrunkReachable'](_0x1f608e[_0xf0fa('0x51')])){if(!this['isTrunkReachable'](_0x1f608e[_0xf0fa('0x9a')])){_0x1f608e[_0xf0fa('0x5d')]=_0xf0fa('0x9b');}else{_0x1f608e[_0xf0fa('0x5d')]=_0xf0fa('0x9c');}}else{_0x1f608e['message']=_0xf0fa('0x9c');}emitCampaignPreview(_0x1f608e);};Preview[_0xf0fa('0xf')][_0xf0fa('0x9d')]=function(_0x147f71,_0x3e3f6b,_0x43bad2){var _0x30f0fe=this;var _0x35e7e7=this[_0xf0fa('0x15')][_0x3e3f6b];var _0x4c2fdd=this['campaignsPreview'][_0x35e7e7[_0xf0fa('0x71')]];var _0x4d8d2f;if(_0x4c2fdd){switch(_0x43bad2){case'1':_0x4c2fdd[_0xf0fa('0x9e')]+=0x1;_0x35e7e7['countnosuchnumberretry']+=0x1;_0x35e7e7['countglobal']=ut['totalGlobal'](_0x35e7e7);ut[_0xf0fa('0x8e')](_0x35e7e7,0x0,_0xf0fa('0x9f'));ami[_0xf0fa('0x26')](_0xf0fa('0xa0'),ut[_0xf0fa('0xa1')](_0x35e7e7,_0xf0fa('0xa2')));rpcDb[_0xf0fa('0x93')](_0x35e7e7,_0xf0fa('0xa3'));if(ut[_0xf0fa('0xa4')](_0x35e7e7)>=_0x4c2fdd[_0xf0fa('0xa5')]){_0x4d8d2f=ut['cloneAction'](_0x35e7e7,0xf,_0xf0fa('0xa6'));rpcDb['createCustomerFinal'](_0x4d8d2f,_0xf0fa('0xa7'));}else{if(_0x35e7e7['countnosuchnumberretry']>=_0x4c2fdd[_0xf0fa('0xa8')]){rpcDb['createCustomerFinal'](_0x35e7e7,_0xf0fa('0xa7'));}else{rpcDb['rescheduleContact'](ut[_0xf0fa('0xa9')](_0x35e7e7,_0xf0fa('0xaa'),_0x4c2fdd[_0xf0fa('0xab')]),_0x35e7e7[_0xf0fa('0xac')],_0x35e7e7[_0xf0fa('0xad')]);}}delete this['actions'][_0x147f71['linkedid']];break;case _0xf0fa('0xae'):var _0x157772=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x35e7e7[_0xf0fa('0xaf')]=_0x157772;_0x35e7e7[_0xf0fa('0xb0')]=_0x157772;_0x35e7e7[_0xf0fa('0x7c')]=!![];_0x4c2fdd[_0xf0fa('0x2d')]+=0x1;logger[_0xf0fa('0x6e')]('[syncHangup][talking][increment]',_0x35e7e7[_0xf0fa('0xb1')],_0xf0fa('0xb2'),_0x4c2fdd[_0xf0fa('0x28')],'pTalking:\x20',_0x4c2fdd['pTalking']);ami[_0xf0fa('0x26')](_0xf0fa('0xb3'),ut['buildObj'](_0x35e7e7,'connect',this[_0xf0fa('0x13')][_0x35e7e7[_0xf0fa('0x71')]]));if(_0x4c2fdd[_0xf0fa('0xb4')]){ami['emit']('custom:agentConnectPreview',ut['buildAcw'](_0x35e7e7));}break;case'16':ami[_0xf0fa('0x26')]('custom:agentcomplete',ut['buildObj'](_0x35e7e7,_0xf0fa('0xb5'),this[_0xf0fa('0x13')][_0x35e7e7[_0xf0fa('0x71')]]));emitVoiceQueueChannelRemove(ut[_0xf0fa('0xa1')](_0x35e7e7,_0xf0fa('0xb5')));_0x4c2fdd[_0xf0fa('0x3a')]+=0x1;_0x4c2fdd['total']+=0x1;_0x4c2fdd[_0xf0fa('0x2a')]+=0x1;ut[_0xf0fa('0x7d')](_0x4c2fdd,_0xf0fa('0xb6'));_0x35e7e7['countglobal']=ut[_0xf0fa('0xa4')](_0x35e7e7);ut['logCustomer'](_0x35e7e7,0x4,'Answer');rpcDb[_0xf0fa('0x93')](_0x35e7e7,'[callProgressDetectingCustomer][logAnswer]');rpcDb['createCustomerFinal'](_0x35e7e7,_0xf0fa('0xb7'));rpcDb[_0xf0fa('0xb8')](_0x35e7e7);_0x4c2fdd[_0xf0fa('0xb9')]+=_0x35e7e7['talktime'];_0x4c2fdd[_0xf0fa('0x2e')]+=_0x35e7e7[_0xf0fa('0xba')];logger['info'](_0xf0fa('0xbb'),_0x35e7e7[_0xf0fa('0xb1')],_0xf0fa('0xb2'),_0x4c2fdd[_0xf0fa('0x28')],_0xf0fa('0x73'),_0x4c2fdd[_0xf0fa('0x2d')]);delete this['actions'][_0x147f71[_0xf0fa('0xbc')]];break;case'BUSY':_0x4c2fdd[_0xf0fa('0xbd')]+=0x1;_0x35e7e7[_0xf0fa('0xbe')]+=0x1;_0x35e7e7[_0xf0fa('0xbf')]=ut[_0xf0fa('0xa4')](_0x35e7e7);ut[_0xf0fa('0x8e')](_0x35e7e7,0x5,_0xf0fa('0xc0'));ami[_0xf0fa('0x26')]('custom:agentbusy',ut['buildObj'](_0x35e7e7,_0xf0fa('0xc1')));rpcDb[_0xf0fa('0x93')](_0x35e7e7,'[callProgressDetectingCustomer][logBusy]');if(ut[_0xf0fa('0xa4')](_0x35e7e7)>=_0x4c2fdd['dialGlobalMaxRetry']){_0x4d8d2f=ut['cloneAction'](_0x35e7e7,0xf,_0xf0fa('0xa6'));rpcDb[_0xf0fa('0x96')](_0x4d8d2f,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x35e7e7['countbusyretry']>=_0x4c2fdd[_0xf0fa('0xc2')]){rpcDb[_0xf0fa('0x96')](_0x35e7e7,_0xf0fa('0xc3'));}else{rpcDb[_0xf0fa('0xc4')](ut[_0xf0fa('0xa9')](_0x35e7e7,_0xf0fa('0xbe'),_0x4c2fdd['dialBusyRetryFrequency']),_0x35e7e7[_0xf0fa('0xac')],_0x35e7e7[_0xf0fa('0xad')]);}}break;case'NOANSWER':_0x4c2fdd[_0xf0fa('0x3f')]+=0x1;_0x35e7e7['countnoanswerretry']+=0x1;_0x35e7e7[_0xf0fa('0xbf')]=ut['totalGlobal'](_0x35e7e7);ut['logCustomer'](_0x35e7e7,0x3,_0xf0fa('0xc5'));ami['emit']('custom:agentnoanswer',ut['buildObj'](_0x35e7e7,'noanswer'));rpcDb[_0xf0fa('0x93')](_0x35e7e7,'[callProgressDetectingCustomer][logNoAnswer]');if(ut[_0xf0fa('0xa4')](_0x35e7e7)>=_0x4c2fdd[_0xf0fa('0xa5')]){_0x4d8d2f=ut['cloneAction'](_0x35e7e7,0xf,_0xf0fa('0xa6'));rpcDb[_0xf0fa('0x96')](_0x4d8d2f,_0xf0fa('0xc6'));}else{if(_0x35e7e7[_0xf0fa('0xc7')]>=_0x4c2fdd['dialNoAnswerMaxRetry']){rpcDb[_0xf0fa('0x96')](_0x35e7e7,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0xf0fa('0xc4')](ut['scheduledAt'](_0x35e7e7,_0xf0fa('0xc7'),_0x4c2fdd[_0xf0fa('0xc8')]),_0x35e7e7[_0xf0fa('0xac')],_0x35e7e7[_0xf0fa('0xad')]);}}break;case'CONGESTION':_0x4c2fdd['outboundCongestionCallsDay']+=0x1;_0x35e7e7[_0xf0fa('0xc9')]+=0x1;_0x35e7e7['countglobal']=ut[_0xf0fa('0xa4')](_0x35e7e7);ut[_0xf0fa('0x8e')](_0x35e7e7,0x8,_0xf0fa('0xca'));ami['emit'](_0xf0fa('0xcb'),ut['buildObj'](_0x35e7e7,_0xf0fa('0xcc')));rpcDb[_0xf0fa('0x93')](_0x35e7e7,_0xf0fa('0xcd'));if(ut['totalGlobal'](_0x35e7e7)>=_0x4c2fdd[_0xf0fa('0xa5')]){_0x4d8d2f=ut['cloneAction'](_0x35e7e7,0xf,_0xf0fa('0xa6'));rpcDb[_0xf0fa('0x96')](_0x4d8d2f,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x35e7e7[_0xf0fa('0xc9')]>=_0x4c2fdd[_0xf0fa('0xce')]){rpcDb[_0xf0fa('0x96')](_0x35e7e7,_0xf0fa('0xcd'));}else{rpcDb['rescheduleContact'](ut[_0xf0fa('0xa9')](_0x35e7e7,'countcongestionretry',_0x4c2fdd['dialBusyRetryFrequency']),_0x35e7e7[_0xf0fa('0xac')],_0x35e7e7[_0xf0fa('0xad')]);}}break;case'CANCEL':_0x4c2fdd['outboundRejectCallsDay']+=0x1;_0x35e7e7[_0xf0fa('0xcf')]+=0x1;_0x35e7e7[_0xf0fa('0xbf')]=ut['totalGlobal'](_0x35e7e7);ut[_0xf0fa('0x8e')](_0x35e7e7,0x14,'AgentReject');ami[_0xf0fa('0x26')](_0xf0fa('0xd0'),ut['buildObj'](_0x35e7e7,'agentreject'));rpcDb[_0xf0fa('0x93')](_0x35e7e7,'[syncHangupRequest][logAgentReject]');if(ut[_0xf0fa('0xa4')](_0x35e7e7)>=_0x4c2fdd[_0xf0fa('0xa5')]){_0x4d8d2f=ut[_0xf0fa('0xd1')](_0x35e7e7,0x14,'AgentReject');rpcDb['createCustomerFinal'](_0x4d8d2f,_0xf0fa('0xd2'));}else{if(_0x35e7e7['countagentrejectretry']>=_0x4c2fdd[_0xf0fa('0xd3')]){rpcDb[_0xf0fa('0x96')](_0x35e7e7,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0xf0fa('0xc4')](ut['scheduledAt'](_0x35e7e7,_0xf0fa('0xcf'),_0x4c2fdd[_0xf0fa('0xd4')]),_0x35e7e7[_0xf0fa('0xac')],_0x35e7e7[_0xf0fa('0xad')]);}}break;case'ABANDONED':_0x4c2fdd['outboundAbandonedCallsDay']+=0x1;_0x35e7e7[_0xf0fa('0xd5')]+=0x1;_0x35e7e7['countglobal']=ut[_0xf0fa('0xa4')](_0x35e7e7);ut['logCustomer'](_0x35e7e7,0xb,'Abandoned');rpcDb[_0xf0fa('0x93')](_0x35e7e7,'[callProgressDetectingCustomer][logAbandoned]');if(ut['totalGlobal'](_0x35e7e7)>=_0x4c2fdd[_0xf0fa('0xa5')]){_0x4d8d2f=ut['cloneAction'](_0x35e7e7,0xf,'Global');rpcDb[_0xf0fa('0x96')](_0x4d8d2f,_0xf0fa('0xd6'));}else{if(_0x35e7e7['countabandonedetry']>=_0x4c2fdd[_0xf0fa('0xd7')]){rpcDb['createCustomerFinal'](_0x35e7e7,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb[_0xf0fa('0xc4')](ut['scheduledAt'](_0x35e7e7,'countabandonedretry',_0x4c2fdd[_0xf0fa('0xd8')]),_0x35e7e7['unlockAgent'],_0x35e7e7[_0xf0fa('0xad')]);}}break;case'18':_0x4c2fdd[_0xf0fa('0xd9')]+=0x1;_0x35e7e7['countmachineretry']+=0x1;_0x35e7e7[_0xf0fa('0xbf')]=ut[_0xf0fa('0xa4')](_0x35e7e7);ut[_0xf0fa('0x8e')](_0x35e7e7,0x12,_0x147f71['cause-txt']||_0x147f71[_0xf0fa('0xda')]);ami[_0xf0fa('0x26')]('custom:amd',ut['buildObj'](_0x35e7e7,_0xf0fa('0xdb')));rpcDb['createCustomerHistory'](_0x35e7e7,'[callProgressDetectingCustomer][hangupInAMD]');if(ut[_0xf0fa('0xa4')](_0x35e7e7)>=_0x4c2fdd['dialGlobalMaxRetry']){_0x4d8d2f=ut['cloneAction'](_0x35e7e7,0xf,_0xf0fa('0xa6'));rpcDb['createCustomerFinal'](_0x4d8d2f,_0xf0fa('0xdc'));}else{rpcDb[_0xf0fa('0x96')](_0x35e7e7,_0xf0fa('0xdc'));}delete this[_0xf0fa('0x15')][_0x147f71[_0xf0fa('0xbc')]];break;case'19':_0x4c2fdd['outboundUnknownCallsDay']+=0x1;_0x35e7e7[_0xf0fa('0xbf')]=ut[_0xf0fa('0xa4')](_0x35e7e7);ut[_0xf0fa('0x8e')](_0x35e7e7,0x13,_0x147f71[_0xf0fa('0xdd')]||_0x147f71[_0xf0fa('0xda')]);ami[_0xf0fa('0x26')](_0xf0fa('0xde'),ut[_0xf0fa('0xa1')](_0x35e7e7,'amd'));rpcDb['createCustomerHistory'](_0x35e7e7,_0xf0fa('0xdf'));if(ut['totalGlobal'](_0x35e7e7)>=_0x4c2fdd['dialGlobalMaxRetry']){_0x4d8d2f=ut[_0xf0fa('0xd1')](_0x35e7e7,0xf,_0xf0fa('0xa6'));rpcDb[_0xf0fa('0x96')](_0x4d8d2f,_0xf0fa('0xdf'));}else{rpcDb[_0xf0fa('0x96')](_0x35e7e7,_0xf0fa('0xdf'));}delete this[_0xf0fa('0x15')][_0x147f71[_0xf0fa('0xbc')]];break;default:if(_0x35e7e7['dialAnswer']){ut['decrementTalkink'](_0x4c2fdd,'[default]');ut['loggerError'](_0xf0fa('0xe0')+_0x4c2fdd[_0xf0fa('0x28')],_0x147f71);}_0x4c2fdd['outboundUnknownCallsDay']+=0x1;_0x35e7e7[_0xf0fa('0xbf')]=ut[_0xf0fa('0xa4')](_0x35e7e7);ut[_0xf0fa('0x8e')](_0x35e7e7,0xc,_0x147f71['cause-txt']||_0x147f71['dialstatus']);rpcDb[_0xf0fa('0x93')](_0x35e7e7,_0xf0fa('0xe1'));if(ut[_0xf0fa('0xa4')](_0x35e7e7)>=_0x4c2fdd[_0xf0fa('0xa5')]){_0x4d8d2f=ut[_0xf0fa('0xd1')](_0x35e7e7,0xf,_0xf0fa('0xa6'));rpcDb['createCustomerFinal'](_0x4d8d2f,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0xf0fa('0x96')](_0x35e7e7,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0xf0fa('0x15')][_0x147f71[_0xf0fa('0xbc')]];}if(!(_0x35e7e7[_0xf0fa('0x7c')]&&_0x43bad2==='16')){ut[_0xf0fa('0xe2')](_0x4c2fdd,_0xf0fa('0xe3'));logger[_0xf0fa('0x6e')](_0xf0fa('0xe4'),_0x35e7e7[_0xf0fa('0xb1')],_0xf0fa('0xb2'),_0x4c2fdd['name'],_0xf0fa('0x72'),_0x4c2fdd['originated']);}if(_0x43bad2!=='ANSWER'){delete this[_0xf0fa('0x15')][_0x147f71[_0xf0fa('0xbc')]];delete this['actions'][_0x147f71[_0xf0fa('0xe5')]];}}};Preview[_0xf0fa('0xf')]['callProgressDetectingAgent']=function(_0x10aa45,_0x9a7e50,_0x1d4106){if(_['isUndefined'](_0x9a7e50)&&_0xf0fa('0xe6')!==typeof _0x9a7e50){return;}if(_[_0xf0fa('0xe7')](_0x1d4106)&&_0xf0fa('0xe6')!==typeof _0x1d4106){return;}switch(_0x1d4106['reason']){case'0':ut[_0xf0fa('0xe8')](_0x10aa45,0x0,_0xf0fa('0x9f'));rpcDb[_0xf0fa('0xe9')](_0x10aa45,_0xf0fa('0xea'));break;case'3':ut[_0xf0fa('0xe8')](_0x10aa45,0x3,_0xf0fa('0xc5'));rpcDb[_0xf0fa('0xe9')](_0x10aa45,_0xf0fa('0xeb'));break;case'5':ut[_0xf0fa('0xe8')](_0x10aa45,0x5,_0xf0fa('0xc0'));rpcDb[_0xf0fa('0xe9')](_0x10aa45,_0xf0fa('0xec'));break;case'8':ut[_0xf0fa('0xe8')](_0x10aa45,0x8,_0xf0fa('0xca'));rpcDb[_0xf0fa('0xe9')](_0x10aa45,_0xf0fa('0xed'));break;case'22':ut[_0xf0fa('0xe8')](_0x10aa45,0x16,_0xf0fa('0xee'));rpcDb[_0xf0fa('0xe9')](_0x10aa45,_0xf0fa('0xef'));break;default:ut[_0xf0fa('0xe8')](_0x10aa45,0xc,_0x1d4106[_0xf0fa('0xf0')]);rpcDb[_0xf0fa('0xe9')](_0x10aa45,'[callProgressDetectingAgent][logCongestion]');}ut['updateOriginated'](_0x9a7e50,_0xf0fa('0xf1'));logger[_0xf0fa('0x6e')](_0xf0fa('0xf2'),_0x10aa45[_0xf0fa('0xb1')],_0xf0fa('0xb2'),_0x9a7e50[_0xf0fa('0x28')],_0xf0fa('0x72'),_0x9a7e50[_0xf0fa('0x5b')]);delete this[_0xf0fa('0x15')][_0x10aa45[_0xf0fa('0xb1')]];};Preview[_0xf0fa('0xf')][_0xf0fa('0xf3')]=function(_0x4bee69,_0x2b6960,_0x4c85b9,_0x35fd94,_0x3269eb){var _0x573371=this;return new BPromise(function(_0x19c928,_0x32ba2a){if(_[_0xf0fa('0x6d')](_0x2b6960)||_[_0xf0fa('0x6d')](_0x2b6960[_0xf0fa('0xf4')])||_[_0xf0fa('0x6d')](_0x2b6960[_0xf0fa('0xf4')]['phone'])||_['isNil'](_0x2b6960[_0xf0fa('0x76')])){_0x32ba2a(ut[_0xf0fa('0x5d')](_0xf0fa('0xf5'),_0x35fd94,_0x3269eb));return;}var _0x5b6a68=uuid['v4']();var _0x19e455=_0x573371[_0xf0fa('0x13')][_0x2b6960[_0xf0fa('0x70')][_0xf0fa('0x28')]];var _0x3c906e=_0x4c85b9?_0x573371[_0xf0fa('0x16')][_0x4c85b9]['id']:undefined;_0x573371[_0xf0fa('0x15')][_0x5b6a68]=new Action(_0x2b6960,_0x19e455,_0x5b6a68,_0x4c85b9,_0x3c906e);var _0x36c5e3=_0x573371[_0xf0fa('0x15')][_0x5b6a68];_0x36c5e3[_0xf0fa('0xac')]=_0x35fd94;_0x36c5e3['activeContact']=_0x3269eb;_0x36c5e3[_0xf0fa('0xf6')]=_0x4c85b9;if(_['isEmpty'](_0x4bee69)){_0x573371[_0xf0fa('0xf7')](_0x36c5e3,_0x19e455,_0x2b6960,_0x4c85b9)[_0xf0fa('0x84')](function(_0x958a0a){logger[_0xf0fa('0x6e')](_0xf0fa('0xf8'),_0xf0fa('0xf9')+_0x36c5e3[_0xf0fa('0x71')]+_0xf0fa('0xfa')+_0x36c5e3['idContact'],JSON['stringify'](_0x958a0a));ami[_0xf0fa('0x26')](_0xf0fa('0xfb'),ut[_0xf0fa('0xa1')](_0x36c5e3,_0xf0fa('0xfc'),_0x573371[_0xf0fa('0x13')][_0x36c5e3[_0xf0fa('0x71')]]));_0x19c928(ut[_0xf0fa('0x5d')]('Calling'));})[_0xf0fa('0x7a')](function(_0x3cafd3){ut[_0xf0fa('0x5f')](_0xf0fa('0xfd'),_0x3cafd3);_0x32ba2a(ut[_0xf0fa('0x5d')](_0xf0fa('0xfe'),_0x35fd94,_0x3269eb));});}else{_0x19e455[_0xf0fa('0x3b')]+=0x1;ut['logBlacklist'](_0x36c5e3);rpcDb[_0xf0fa('0xff')](_0x36c5e3,_0xf0fa('0x100'));delete _0x573371[_0xf0fa('0x15')][_0x5b6a68];_0x32ba2a(ut[_0xf0fa('0x5d')](_0xf0fa('0x101'),_0x35fd94,_0x3269eb));}});};Preview['prototype'][_0xf0fa('0x102')]=function(_0x5b40d9){return!_[_0xf0fa('0x6d')](_0x5b40d9)&&!_[_0xf0fa('0x6d')](_0x5b40d9[_0xf0fa('0x28')])&&!_['isNil'](_0x5b40d9['active'])&&_0x5b40d9[_0xf0fa('0x52')]&&!_[_0xf0fa('0x6d')](this[_0xf0fa('0x14')][util[_0xf0fa('0x55')]('SIP/%s',_0x5b40d9[_0xf0fa('0x28')])])&&!_[_0xf0fa('0x6d')](this[_0xf0fa('0x14')][util[_0xf0fa('0x55')](_0xf0fa('0x103'),_0x5b40d9[_0xf0fa('0x28')])]['status'])&&(this[_0xf0fa('0x14')][util['format']('SIP/%s',_0x5b40d9[_0xf0fa('0x28')])][_0xf0fa('0x78')]==='reachable'||this[_0xf0fa('0x14')][util['format'](_0xf0fa('0x103'),_0x5b40d9['name'])]['status']===_0xf0fa('0x104'));};Preview[_0xf0fa('0xf')][_0xf0fa('0x105')]=function(_0x142b1e,_0xdc3ef9){var _0x187523=this;return new BPromise(function(_0x53b346,_0x9ebd51){_0x187523[_0xf0fa('0x106')](_0x142b1e,_0xdc3ef9)[_0xf0fa('0x84')](function(_0x38811c){_0x53b346(_[_0xf0fa('0x107')](_0x38811c,[_0xf0fa('0x5d')]));})[_0xf0fa('0x7a')](function(_0x41fdf9){if(_0x41fdf9['unlock']){rpcDb[_0xf0fa('0x108')](_0x142b1e);}if(_0x41fdf9[_0xf0fa('0x52')]){rpcDb[_0xf0fa('0x8c')](_0x142b1e);}_0x9ebd51(_[_0xf0fa('0x107')](_0x41fdf9,[_0xf0fa('0x5d')]));});});};Preview[_0xf0fa('0xf')][_0xf0fa('0x106')]=function(_0x616338,_0x114487){var _0xe0bb72=this;return new BPromise(function(_0x27c397,_0x49448a){var _0x29b1e9,_0x5c8e7b;rpcDb[_0xf0fa('0x109')](_0x616338)[_0xf0fa('0x84')](function(_0xb688a1){if(!_[_0xf0fa('0x6d')](_0xb688a1[0x0])){_0x5c8e7b=_0xb688a1[0x0][_0xf0fa('0x10a')]?![]:!![];_0x29b1e9=_0xb688a1[0x0][_0xf0fa('0x10a')]?!![]:![];_0x29b1e9=_0x114487?!![]:_0x29b1e9;}var _0x571a62=_0xe0bb72[_0xf0fa('0x10b')](_0xb688a1);if(_0x571a62[_0xf0fa('0x10c')]){rpcDb[_0xf0fa('0x10d')](_['pick'](_0xb688a1[0x0],[_0xf0fa('0x76'),_0xf0fa('0x10e')]))[_0xf0fa('0x84')](function(_0x4cf660){_0xe0bb72[_0xf0fa('0xf3')](_0x4cf660,_0xb688a1[0x0],_0x114487,_0x5c8e7b,_0x29b1e9)[_0xf0fa('0x84')](function(_0x42caa1){_0x27c397(_0x42caa1);})['catch'](function(_0x212b4a){_0x49448a(_0x212b4a);});})[_0xf0fa('0x7a')](function(_0x44edb5){ut[_0xf0fa('0x5f')](_0xf0fa('0x10f'),_0x44edb5);_0x49448a(ut[_0xf0fa('0x5d')](_0xf0fa('0x110'),_0x5c8e7b,_0x29b1e9));});}else{_0x49448a(ut['message'](_0x571a62['message'],_0x5c8e7b,_0x29b1e9));}})[_0xf0fa('0x7a')](function(_0x5d32f9){ut[_0xf0fa('0x5f')]('[Preview][getContactPreview]',_0x5d32f9);_0x49448a(ut[_0xf0fa('0x5d')]('Call\x20unsuccessful',![],!![]));});});};Preview[_0xf0fa('0xf')][_0xf0fa('0x10b')]=function(_0x5b9e3f){if(_[_0xf0fa('0x6d')](_0x5b9e3f)||_['isEmpty'](_0x5b9e3f)||!_[_0xf0fa('0x6d')](_0x5b9e3f[0x0][_0xf0fa('0x88')])&&_[_0xf0fa('0x6d')](_0x5b9e3f[0x0]['Agent']['name'])){ut['logger']('[Preview][validateContact][Empty\x20Contact]',_0x5b9e3f);return{'isValid':![],'message':_0xf0fa('0x111')};}var _0x4b6acc=this['campaignsPreview'][_0x5b9e3f[0x0][_0xf0fa('0x70')][_0xf0fa('0x28')]];_0x4b6acc[_0xf0fa('0x5d')]=_0xf0fa('0x9c');if(_[_0xf0fa('0x6d')](_0x4b6acc)){ut[_0xf0fa('0x5f')]('[Preview][validateContact][Empty\x20Campaign]',_0x4b6acc);return{'isValid':![],'message':_0xf0fa('0x112')};}if(!this[_0xf0fa('0x102')](_0x4b6acc[_0xf0fa('0x51')])){ut[_0xf0fa('0x5f')](_0xf0fa('0x113'),_0xf0fa('0x114')+_0x4b6acc['name']+_0xf0fa('0x115'));if(!this['isTrunkReachable'](_0x4b6acc[_0xf0fa('0x9a')])){ut[_0xf0fa('0x5f')](_0xf0fa('0x113'),_0x4b6acc[_0xf0fa('0x28')]+_0xf0fa('0x116'));return{'isValid':![],'message':_0xf0fa('0x117')};}}if(!ut[_0xf0fa('0x99')](_0x4b6acc['dialActive'])){ut[_0xf0fa('0x5f')](_0xf0fa('0x118'),_0x4b6acc[_0xf0fa('0x28')]+_0xf0fa('0x119'));return{'isValid':![],'message':_0xf0fa('0x114')+_0x4b6acc[_0xf0fa('0x28')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0xf0fa('0x11a')};};Preview[_0xf0fa('0xf')][_0xf0fa('0xf7')]=function(_0xb9addb,_0x1493d2,_0x223211,_0x3f4f31){var _0x1864a7=this;return new BPromise(function(_0x18d83c,_0x247dba){var _0x1e1a94=_0xb9addb[_0xf0fa('0xb1')];var _0x1b5b8f=_0x1864a7[_0xf0fa('0x102')](_0x1493d2[_0xf0fa('0x51')])?util[_0xf0fa('0x55')]('SIP/%s/%s%s',_0x1493d2[_0xf0fa('0x51')]['name'],_[_0xf0fa('0x6d')](_0x1493d2[_0xf0fa('0x38')])?'':_0x1493d2[_0xf0fa('0x38')][_0xf0fa('0x11b')]()||'',_0x1493d2[_0xf0fa('0x11c')]>0x0?_0x223211[_0xf0fa('0xf4')][_0xf0fa('0x11d')][_0xf0fa('0x11e')](_0x1493d2[_0xf0fa('0x11c')]):_0x223211['Contact'][_0xf0fa('0x11d')]):util[_0xf0fa('0x55')](_0xf0fa('0x11f'),_[_0xf0fa('0x6d')](_0x1493d2[_0xf0fa('0x9a')])?_0x1493d2[_0xf0fa('0x51')]['name']:_0x1493d2[_0xf0fa('0x9a')][_0xf0fa('0x28')],_[_0xf0fa('0x6d')](_0x1493d2[_0xf0fa('0x38')])?'':_0x1493d2['dialPrefix'][_0xf0fa('0x11b')]()||'',_0x1493d2[_0xf0fa('0x11c')]>0x0?_0x223211[_0xf0fa('0xf4')]['phone'][_0xf0fa('0x11e')](_0x1493d2[_0xf0fa('0x11c')]):_0x223211[_0xf0fa('0xf4')][_0xf0fa('0x11d')]);var _0x33a57e=_0x1864a7['isTrunkReachable'](_0x1493d2[_0xf0fa('0x51')])?ut[_0xf0fa('0x120')](_0x1493d2[_0xf0fa('0x51')][_0xf0fa('0x121')],_0x1493d2[_0xf0fa('0x37')],_0x1493d2['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0xf0fa('0x122')](_0x1493d2[_0xf0fa('0x123')],_0x1493d2[_0xf0fa('0x124')]):_0x1493d2[_0xf0fa('0x123')]):ut[_0xf0fa('0x120')](_[_0xf0fa('0x6d')](_0x1493d2['TrunkBackup'])?_0x1493d2[_0xf0fa('0x51')]['callerid']:_0x1493d2[_0xf0fa('0x9a')][_0xf0fa('0x121')],_0x1493d2[_0xf0fa('0x37')],_0x1493d2[_0xf0fa('0x124')]>0x0?ut[_0xf0fa('0x122')](_0x1493d2[_0xf0fa('0x123')],_0x1493d2[_0xf0fa('0x124')]):_0x1493d2['dialOriginateCallerIdNumber']);if(_0x33a57e){_0xb9addb[_0xf0fa('0x125')]=ut[_0xf0fa('0x126')](_0x33a57e);_0xb9addb[_0xf0fa('0x127')]=ut['extractCalleridNumber'](_0x33a57e);}var _0x1b3439=ut['addVariables'](_0x1493d2,_0x223211,_0x1b5b8f,_0x33a57e,_0x1e1a94,_0xb9addb);_['merge'](_0xb9addb,ut['toLowerVariables'](_0x1b3439));_0xb9addb[_0xf0fa('0x8d')]=moment()['format'](_0xf0fa('0x128'));ami[_0xf0fa('0x129')](ut['variablesAction'](_0xb9addb,_0x1493d2,_0x1b3439,_0xb9addb['activeContact'],_0x3f4f31))[_0xf0fa('0x84')](function(_0x3a8b55){_0x1493d2['originated']+=0x1;logger[_0xf0fa('0x6e')]('[originated][increment]',_0x1e1a94,'\x20Queue',_0x1493d2[_0xf0fa('0x28')],_0xf0fa('0x72'),_0x1493d2[_0xf0fa('0x5b')]);_0x18d83c(_0x3a8b55);})[_0xf0fa('0x7a')](function(_0x5ef78f){ut['logAgent'](_0xb9addb,0xe,_0xf0fa('0x12a'));rpcDb[_0xf0fa('0xe9')](_0xb9addb,_0xf0fa('0x12b'));_0x247dba(_0x5ef78f);});});};Preview[_0xf0fa('0xf')][_0xf0fa('0x20')]=function(_0x4fcae8){if(this[_0xf0fa('0x15')][_0x4fcae8[_0xf0fa('0xbc')]]){this[_0xf0fa('0x15')][_0x4fcae8[_0xf0fa('0xbc')]][_0xf0fa('0x79')]=_0x4fcae8[_0xf0fa('0x79')];}};Preview[_0xf0fa('0xf')][_0xf0fa('0x17')]=function(_0x516696){var _0x34c7eb=this;var _0x57f64f=this['actions'][_0x516696[_0xf0fa('0x12c')]];if(_0x57f64f){if(_0x57f64f[_0xf0fa('0xf6')]&&this[_0xf0fa('0x16')][_0x57f64f[_0xf0fa('0xf6')]]){ut[_0xf0fa('0x12d')](_0x57f64f,this[_0xf0fa('0x16')][_0x57f64f['lookAgent']][_0xf0fa('0x28')],this[_0xf0fa('0x16')][_0x57f64f[_0xf0fa('0xf6')]]['id']);}var _0x1514a4=_[_0xf0fa('0x12e')](_0x57f64f);_0x1514a4['responsetime']=moment()[_0xf0fa('0x55')]('YYYY-MM-DD\x20HH:mm:ss');var _0x40e1cf=_0x34c7eb['campaignsPreview'][_0x57f64f[_0xf0fa('0x71')]];if(ut[_0xf0fa('0x12f')](_0x516696['response'])){if(_0x57f64f[_0xf0fa('0xac')]){rpcDb[_0xf0fa('0x108')](_0x57f64f[_0xf0fa('0x130')]);}if(_0x57f64f[_0xf0fa('0xad')]){rpcDb[_0xf0fa('0x8c')](_0x57f64f['idContact']);}ami[_0xf0fa('0x26')](_0xf0fa('0x131'),ut['buildObj'](_0x57f64f,_0xf0fa('0x132'),this[_0xf0fa('0x13')][_0x57f64f[_0xf0fa('0x71')]]));this['callProgressDetectingAgent'](_0x1514a4,_0x40e1cf,_0x516696);}else{_0x57f64f[_0xf0fa('0x8d')]=moment()[_0xf0fa('0x55')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0xf0fa('0xe8')](_0x1514a4,0x4,'Answer');rpcDb[_0xf0fa('0xe9')](_0x1514a4,_0xf0fa('0x133'));}}};Preview[_0xf0fa('0xf')][_0xf0fa('0x19')]=function(_0x18212c){var _0x4e070b=this;var _0x3a088e=this[_0xf0fa('0x15')][_0x18212c['linkedid']];var _0x4df407;if(_0x3a088e){_0x4df407=this[_0xf0fa('0x13')][_0x3a088e[_0xf0fa('0x71')]];logger['info'](_0xf0fa('0x134'),_0x18212c['linkedid'],'\x20Queue',_0x4df407[_0xf0fa('0x28')],_0xf0fa('0x73'),_0x4df407[_0xf0fa('0x2d')]);}if(this['actions'][_0x18212c[_0xf0fa('0xbc')]]&&_0x18212c[_0xf0fa('0xbc')]!==_0x18212c[_0xf0fa('0xb1')]){if(_0x18212c[_0xf0fa('0x135')]==='16'&&this[_0xf0fa('0x15')][_0x18212c['linkedid']]['dialAnswer']){this[_0xf0fa('0x9d')](_0x18212c,_0x18212c['linkedid'],_0x18212c[_0xf0fa('0x135')]);}else if(this[_0xf0fa('0x15')][_0x18212c[_0xf0fa('0xbc')]][_0xf0fa('0x7c')]){logger['info'](_0xf0fa('0x136'),_0x18212c['linkedid'],_0x18212c[_0xf0fa('0x135')],'\x20Queue',_0x4df407['name'],_0xf0fa('0x73'),_0x4df407[_0xf0fa('0x2d')]);this[_0xf0fa('0x9d')](_0x18212c,_0x18212c[_0xf0fa('0xbc')],_0x18212c[_0xf0fa('0x135')]);}}else if(_0x3a088e&&_['isNil'](_0x3a088e[_0xf0fa('0x137')])&&_0x4df407[_0xf0fa('0x138')]&&_0x18212c[_0xf0fa('0xbc')]===_0x18212c[_0xf0fa('0xb1')]&&_[_0xf0fa('0x6d')](_0x18212c[_0xf0fa('0xf0')])&&_0x18212c['cause']==='16'&&_0x18212c[_0xf0fa('0x139')]==='6'&&_[_0xf0fa('0xe7')](_0x3a088e[_0xf0fa('0x13a')])){if(_0x3a088e['unlockAgent']){rpcDb['unlockContact'](_0x3a088e['idContact']);}if(_0x3a088e[_0xf0fa('0xad')]){rpcDb[_0xf0fa('0x8c')](_0x3a088e[_0xf0fa('0x130')]);}_0x18212c[_0xf0fa('0xf0')]='22';this[_0xf0fa('0x13b')](_0x3a088e,_0x4df407,_0x18212c);}else if(_0x3a088e&&_0x3a088e['transfer']){if(_0x18212c['cause']==='16'&&this[_0xf0fa('0x15')][_0x18212c[_0xf0fa('0xbc')]]['dialAnswer']){logger[_0xf0fa('0x6e')](_0xf0fa('0x13c'),_0x18212c[_0xf0fa('0xbc')],_0x18212c[_0xf0fa('0x135')],_0xf0fa('0xb2'),_0x4df407[_0xf0fa('0x28')],_0xf0fa('0x73'),_0x4df407[_0xf0fa('0x2d')]);this[_0xf0fa('0x9d')](_0x18212c,_0x18212c[_0xf0fa('0xbc')],_0x18212c[_0xf0fa('0x135')]);}else if(this['actions'][_0x18212c[_0xf0fa('0xbc')]][_0xf0fa('0x7c')]){logger[_0xf0fa('0x6e')](_0xf0fa('0x136'),_0x18212c[_0xf0fa('0xbc')],_0x18212c[_0xf0fa('0x135')],'\x20Queue',_0x4df407[_0xf0fa('0x28')],'pTalking:\x20',_0x4df407['pTalking']);this['callProgressDetectingCustomer'](_0x18212c,_0x18212c['linkedid'],_0x18212c[_0xf0fa('0x135')]);}}};Preview[_0xf0fa('0xf')]['syncDialEnd']=function(_0x14e3ed){if(this[_0xf0fa('0x15')][_0x14e3ed['destlinkedid']]&&_0x14e3ed[_0xf0fa('0xe5')]!==_0x14e3ed['destuniqueid']){this[_0xf0fa('0x9d')](_0x14e3ed,_0x14e3ed[_0xf0fa('0xe5')],_0x14e3ed[_0xf0fa('0xda')]);}};Preview[_0xf0fa('0xf')]['syncHangupRequest']=function(_0x543bbb){if(this[_0xf0fa('0x15')][_0x543bbb[_0xf0fa('0xbc')]]&&_0x543bbb[_0xf0fa('0xbc')]!==_0x543bbb[_0xf0fa('0xb1')]&&!this['actions'][_0x543bbb[_0xf0fa('0xbc')]]['dialAnswer']){if(_0x543bbb[_0xf0fa('0x135')]==='1'){this[_0xf0fa('0x9d')](_0x543bbb,_0x543bbb[_0xf0fa('0xbc')],_0x543bbb['cause']);}}};Preview[_0xf0fa('0xf')][_0xf0fa('0x13d')]=function(_0x591ffb,_0x160c0a,_0x4cdf8b){if(this[_0xf0fa('0x15')][_0x591ffb]){if(_[_0xf0fa('0x6d')](this[_0xf0fa('0x15')][_0x591ffb]['variables'])){this[_0xf0fa('0x15')][_0x591ffb][_0xf0fa('0x13e')]={};}this[_0xf0fa('0x15')][_0x591ffb][_0xf0fa('0x13e')][_0x160c0a]=_0x4cdf8b;}};Preview[_0xf0fa('0xf')][_0xf0fa('0x22')]=function(_0x29dea5){try{if(!_[_0xf0fa('0x6d')](_0x29dea5)){if(ut[_0xf0fa('0x13f')](_['keys'](_0x29dea5[_0xf0fa('0x140')])[0x0])){this[_0xf0fa('0x13d')](_0x29dea5['uniqueid'],_[_0xf0fa('0x141')](_0x29dea5[_0xf0fa('0x140')])[0x0],_0x29dea5[_0xf0fa('0x142')]);}}}catch(_0x2dddd1){logger[_0xf0fa('0x143')]('[syncVarSet][Preview]',util[_0xf0fa('0x144')](_0x2dddd1,{'showHidden':![],'depth':null}));}};Preview['prototype']['syncAttendedTransfer']=function(_0x1fc0b1){if(_0x1fc0b1){if(this[_0xf0fa('0x15')][_0x1fc0b1['transfertargetlinkedid']]){this[_0xf0fa('0x15')][_0x1fc0b1['transfertargetlinkedid']][_0xf0fa('0x13a')]=!![];}}};Preview[_0xf0fa('0xf')][_0xf0fa('0x24')]=function(_0x264d29){if(_0x264d29){if(this[_0xf0fa('0x15')][_0x264d29['transfererlinkedid']]){this[_0xf0fa('0x15')][_0x264d29['transfererlinkedid']][_0xf0fa('0x13a')]=!![];}}};module[_0xf0fa('0x145')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 6ccfbff..a00d14a 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 _0x172d=['getContactRecallMe','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','lodash','../rpc/cmHopperHistory','../rpc/voiceQueueRt','../rpc/agentReportPreview','error','inspect','then','createHistory','catch','[createHistory]\x20','resolve','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','holdtime','assigned','queuecallerexitreason','create'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x172d,0xa2));var _0xd172=function(_0x17cb63,_0x4c0e90){_0x17cb63=_0x17cb63-0x0;var _0x4340bc=_0x172d[_0x17cb63];return _0x4340bc;};'use strict';var util=require(_0xd172('0x0'));var BPromise=require(_0xd172('0x1'));var logger=require(_0xd172('0x2'))('preview');var _=require(_0xd172('0x3'));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0xd172('0x4'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0xd172('0x5'));var agentReportPreview=require(_0xd172('0x6'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x3fa95c){return function(_0x32c506){logger[_0xd172('0x7')](_0x3fa95c,util[_0xd172('0x8')](_0x32c506,{'showHidden':![],'depth':null}));};}function create(_0x428b8b){return BPromise['resolve']()[_0xd172('0x9')](cmHopperHistory[_0xd172('0xa')](_0x428b8b))['catch'](loggerCatch('[createHistory]\x20'));}function createAgent(_0x5848b7){return BPromise['resolve']()[_0xd172('0x9')](agentReportPreview[_0xd172('0xa')](_0x5848b7))[_0xd172('0xb')](loggerCatch(_0xd172('0xc')));}function moveContact(_0x51070a){return BPromise[_0xd172('0xd')]()[_0xd172('0x9')](cmHopper[_0xd172('0xe')](_0x51070a,!![]))[_0xd172('0xb')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0xd172('0xf')]=function(_0x287c6b){return BPromise['resolve']()[_0xd172('0x9')](cmHopperBlack[_0xd172('0xf')](_0x287c6b))[_0xd172('0xb')](loggerCatch(_0xd172('0x10')));};exports['getContactPreview']=function(_0x44687c){return BPromise[_0xd172('0xd')]()[_0xd172('0x9')](cmHopper[_0xd172('0x11')](_0x44687c))[_0xd172('0xb')](loggerCatch(_0xd172('0x12')));};exports[_0xd172('0xa')]=function(_0xc644c9,_0x133dac){create(_0xc644c9)[_0xd172('0xb')](loggerCatch(_0x133dac));moveContact(_0xc644c9)[_0xd172('0xb')](loggerCatch(_0x133dac));};exports[_0xd172('0x13')]=function(_0x3290a2,_0x2ef780){createAgent(_0x3290a2)[_0xd172('0xb')](loggerCatch(_0x2ef780));};exports[_0xd172('0x14')]=function(_0x48e03a,_0x31fd3b){create(_0x48e03a)[_0xd172('0xb')](loggerCatch(_0x31fd3b));};exports[_0xd172('0x15')]=function(_0x35623f,_0x3166a2){moveContact(_0x35623f)[_0xd172('0xb')](loggerCatch(_0x3166a2));};exports[_0xd172('0x16')]=function(_0x2cac79,_0x4a547e,_0x5d075b){if(_0x4a547e){_0x2cac79[_0xd172('0x17')]=null;}if(_0x5d075b){_0x2cac79[_0xd172('0x18')]=![];}return BPromise[_0xd172('0xd')]()[_0xd172('0x9')](cmHopper[_0xd172('0x16')](_0x2cac79))['catch'](loggerCatch(_0xd172('0x19')));};exports[_0xd172('0x1a')]=function(_0x175734){return BPromise[_0xd172('0xd')]()[_0xd172('0x9')](cmHopper['countReScheduled'](_0x175734))[_0xd172('0xb')](loggerCatch(_0xd172('0x1b')));};exports['unlockContact']=function(_0x3987dd){return BPromise[_0xd172('0xd')]()['then'](cmHopper[_0xd172('0x1c')]({'UserId':null},_0x3987dd,0x1))[_0xd172('0xb')](loggerCatch(_0xd172('0x1d')));};exports['disableContact']=function(_0x4f37d8){return BPromise[_0xd172('0xd')]()[_0xd172('0x9')](cmHopper['unlockContact']({'active':![]},_0x4f37d8,0x1))[_0xd172('0xb')](loggerCatch('[activeContact]\x20'));};exports[_0xd172('0x1e')]=function(_0x305fc8){var _0x1eb1ef={};_0x1eb1ef[_0xd172('0x1f')]=_0x305fc8[_0xd172('0x1f')];_0x1eb1ef[_0xd172('0x20')]=_0x305fc8['uniqueid'];_0x1eb1ef[_0xd172('0x21')]=_0x305fc8[_0xd172('0x21')];_0x1eb1ef[_0xd172('0x22')]=_0x305fc8[_0xd172('0x22')];_0x1eb1ef[_0xd172('0x23')]=_0x305fc8[_0xd172('0x23')];_0x1eb1ef[_0xd172('0x24')]=_0x305fc8[_0xd172('0x25')];_0x1eb1ef[_0xd172('0x26')]=_0x305fc8[_0xd172('0x25')];_0x1eb1ef[_0xd172('0x27')]=0x1;_0x1eb1ef[_0xd172('0x28')]=_0x305fc8[_0xd172('0x29')];_0x1eb1ef[_0xd172('0x2a')]=_0x305fc8[_0xd172('0x2b')];_0x1eb1ef[_0xd172('0x2c')]=_0xd172('0x2d');_0x1eb1ef['exten']='xcally-motion-preview';_0x1eb1ef[_0xd172('0x2e')]=0x0;_0x1eb1ef[_0xd172('0x2f')]=0x1;_0x1eb1ef['lastAssignedTo']=_0x305fc8['membername'];_0x1eb1ef[_0xd172('0x30')]='COMPLETED';return BPromise[_0xd172('0xd')]()[_0xd172('0x9')](voiceQueueReport[_0xd172('0x31')](_0x1eb1ef))[_0xd172('0xb')](loggerCatch('[voiceQueueReport]\x20'));};exports[_0xd172('0x32')]=function(_0x46514a,_0x39d1df){return BPromise[_0xd172('0xd')]()['then'](cmHopper[_0xd172('0x32')](_0x46514a,_0x39d1df))[_0xd172('0xb')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0xd172('0x33')]=function(_0x43a475){return BPromise[_0xd172('0xd')]()[_0xd172('0x9')](cmHopper['rescheduleContact'](_0x43a475,!![],!![]))[_0xd172('0xb')](loggerCatch(_0xd172('0x34')));}; \ No newline at end of file +var _0x4a7f=['queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','context','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','getContactRecallMe','[GetContactRecallMe]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopperHistory','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x4a7f,0x15b));var _0xf4a7=function(_0x21686a,_0x139cd2){_0x21686a=_0x21686a-0x0;var _0x168a0c=_0x4a7f[_0x21686a];return _0x168a0c;};'use strict';var util=require(_0xf4a7('0x0'));var BPromise=require(_0xf4a7('0x1'));var logger=require(_0xf4a7('0x2'))(_0xf4a7('0x3'));var _=require(_0xf4a7('0x4'));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0xf4a7('0x5'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require(_0xf4a7('0x6'));var voiceQueueReport=require(_0xf4a7('0x7'));function loggerCatch(_0x2f008a){return function(_0x34b2e4){logger[_0xf4a7('0x8')](_0x2f008a,util['inspect'](_0x34b2e4,{'showHidden':![],'depth':null}));};}function create(_0x130b9b){return BPromise[_0xf4a7('0x9')]()[_0xf4a7('0xa')](cmHopperHistory[_0xf4a7('0xb')](_0x130b9b))[_0xf4a7('0xc')](loggerCatch(_0xf4a7('0xd')));}function createAgent(_0xafd829){return BPromise[_0xf4a7('0x9')]()[_0xf4a7('0xa')](agentReportPreview[_0xf4a7('0xb')](_0xafd829))['catch'](loggerCatch(_0xf4a7('0xd')));}function moveContact(_0x3dd45b){return BPromise[_0xf4a7('0x9')]()[_0xf4a7('0xa')](cmHopper[_0xf4a7('0xe')](_0x3dd45b,!![]))['catch'](loggerCatch(_0xf4a7('0xf')));}exports[_0xf4a7('0x10')]=function(_0x389a2e){return BPromise['resolve']()[_0xf4a7('0xa')](cmHopperBlack[_0xf4a7('0x10')](_0x389a2e))[_0xf4a7('0xc')](loggerCatch(_0xf4a7('0x11')));};exports[_0xf4a7('0x12')]=function(_0x255d01){return BPromise[_0xf4a7('0x9')]()[_0xf4a7('0xa')](cmHopper['getContactPreview'](_0x255d01))[_0xf4a7('0xc')](loggerCatch(_0xf4a7('0x13')));};exports[_0xf4a7('0xb')]=function(_0x77ba24,_0xa4ae5f){create(_0x77ba24)[_0xf4a7('0xc')](loggerCatch(_0xa4ae5f));moveContact(_0x77ba24)['catch'](loggerCatch(_0xa4ae5f));};exports[_0xf4a7('0x14')]=function(_0x1d848c,_0x5e3b74){createAgent(_0x1d848c)[_0xf4a7('0xc')](loggerCatch(_0x5e3b74));};exports[_0xf4a7('0x15')]=function(_0x11f195,_0x3496b1){create(_0x11f195)[_0xf4a7('0xc')](loggerCatch(_0x3496b1));};exports[_0xf4a7('0x16')]=function(_0x1f1389,_0x51ab67){moveContact(_0x1f1389)[_0xf4a7('0xc')](loggerCatch(_0x51ab67));};exports[_0xf4a7('0x17')]=function(_0x16b839,_0x2e7522,_0x3a4459){if(_0x2e7522){_0x16b839[_0xf4a7('0x18')]=null;}if(_0x3a4459){_0x16b839[_0xf4a7('0x19')]=![];}return BPromise['resolve']()[_0xf4a7('0xa')](cmHopper[_0xf4a7('0x17')](_0x16b839))[_0xf4a7('0xc')](loggerCatch(_0xf4a7('0x1a')));};exports[_0xf4a7('0x1b')]=function(_0x13fbfe){return BPromise[_0xf4a7('0x9')]()[_0xf4a7('0xa')](cmHopper[_0xf4a7('0x1b')](_0x13fbfe))[_0xf4a7('0xc')](loggerCatch('[countReScheduled]\x20'));};exports[_0xf4a7('0x1c')]=function(_0x223675){return BPromise['resolve']()[_0xf4a7('0xa')](cmHopper[_0xf4a7('0x1c')]({'UserId':null},_0x223675,0x1))[_0xf4a7('0xc')](loggerCatch(_0xf4a7('0x1d')));};exports[_0xf4a7('0x1e')]=function(_0x2ab40f){return BPromise['resolve']()['then'](cmHopper[_0xf4a7('0x1c')]({'active':![]},_0x2ab40f,0x1))[_0xf4a7('0xc')](loggerCatch(_0xf4a7('0x1f')));};exports[_0xf4a7('0x20')]=function(_0x338174){var _0x1df37e={};_0x1df37e[_0xf4a7('0x21')]=_0x338174[_0xf4a7('0x21')];_0x1df37e[_0xf4a7('0x22')]=_0x338174['uniqueid'];_0x1df37e[_0xf4a7('0x23')]=_0x338174[_0xf4a7('0x23')];_0x1df37e[_0xf4a7('0x24')]=_0x338174[_0xf4a7('0x24')];_0x1df37e[_0xf4a7('0x25')]=_0x338174[_0xf4a7('0x25')];_0x1df37e[_0xf4a7('0x26')]=_0x338174[_0xf4a7('0x27')];_0x1df37e[_0xf4a7('0x28')]=_0x338174[_0xf4a7('0x27')];_0x1df37e[_0xf4a7('0x29')]=0x1;_0x1df37e[_0xf4a7('0x2a')]=_0x338174[_0xf4a7('0x2b')];_0x1df37e[_0xf4a7('0x2c')]=_0x338174['membername'];_0x1df37e[_0xf4a7('0x2d')]='from-sip';_0x1df37e[_0xf4a7('0x2e')]=_0xf4a7('0x2f');_0x1df37e[_0xf4a7('0x30')]=0x0;_0x1df37e[_0xf4a7('0x31')]=0x1;_0x1df37e[_0xf4a7('0x32')]=_0x338174['membername'];_0x1df37e[_0xf4a7('0x33')]=_0xf4a7('0x34');return BPromise[_0xf4a7('0x9')]()[_0xf4a7('0xa')](voiceQueueReport['create'](_0x1df37e))[_0xf4a7('0xc')](loggerCatch('[voiceQueueReport]\x20'));};exports['getContactRecallMe']=function(_0x98fd18,_0x2085f6){return BPromise[_0xf4a7('0x9')]()['then'](cmHopper[_0xf4a7('0x35')](_0x98fd18,_0x2085f6))[_0xf4a7('0xc')](loggerCatch(_0xf4a7('0x36')));};exports['rescheduleContactInQueue']=function(_0x156ef7){return BPromise['resolve']()[_0xf4a7('0xa')](cmHopper[_0xf4a7('0x17')](_0x156ef7,!![],!![]))['catch'](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file diff --git a/server/services/ami/preview/util/util.js b/server/services/ami/preview/util/util.js index b3b1f47..8cb0203 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 _0xae41=['_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','XMD-','updateOriginated','originated','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','Blacklist','starttime','responsetime','endtime','logAgent','statedesc','ringtime','UserId','logCustomer','talktime','answertime','isFailure','Failure','variablesAction','RECALL','uniqueid','originate','channelAgent','totalGlobal','countbusyretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','scheduledAt','active','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','queue','motionChannel','mandatoryDisposition','buildAcw','agentReadyId','not_inuse','status','reachable','createBody','CampaignId','filterKey','idContact','campaigntype','dialAnswer','membername','scheduledat','countcongestionretry','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-phone','xmd-listid','xmd-dialtimeout','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqoslossbridged','bridgepeer','bridgepvtcallid','\x5cw{0,','replace','random','extractCalleridName','extractCalleridNumber','match','util','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','milliseconds','diff','seconds','loggerCatch','error','inspect','info','loggerError','logger2','message','getCallerId','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','format','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview'];(function(_0x55b228,_0xaf647d){var _0xe0d285=function(_0x2f1810){while(--_0x2f1810){_0x55b228['push'](_0x55b228['shift']());}};_0xe0d285(++_0xaf647d);}(_0xae41,0x174));var _0x1ae4=function(_0x17181f,_0x2493c8){_0x17181f=_0x17181f-0x0;var _0x4bac36=_0xae41[_0x17181f];return _0x4bac36;};'use strict';var util=require(_0x1ae4('0x0'));var _=require(_0x1ae4('0x1'));var moment=require(_0x1ae4('0x2'));var logger=require(_0x1ae4('0x3'))(_0x1ae4('0x4'));var ipAgi=process[_0x1ae4('0x5')][_0x1ae4('0x6')]||'127.0.0.1';function getSeconds(_0x1f1de6,_0x372276){var _0x2425d5=moment(_0x1f1de6)[_0x1ae4('0x7')](0x0);var _0x34089a=moment(_0x372276)[_0x1ae4('0x7')](0x0);return _0x2425d5[_0x1ae4('0x8')](_0x34089a,_0x1ae4('0x9'));}exports[_0x1ae4('0xa')]=function(_0x58c2e6){return function(_0xaf7d8f){logger[_0x1ae4('0xb')](_0x58c2e6,util[_0x1ae4('0xc')](_0xaf7d8f,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x1effd4,_0x49695e){logger[_0x1ae4('0xd')](_0x1effd4,util['inspect'](_0x49695e,{'showHidden':![],'depth':null}));};exports[_0x1ae4('0xe')]=function(_0x42b105,_0x4250f8){logger[_0x1ae4('0xb')](_0x42b105,util[_0x1ae4('0xc')](_0x4250f8,{'showHidden':![],'depth':null}));};exports[_0x1ae4('0xf')]=function(_0xee1c7c){return function(_0x500e03){logger[_0x1ae4('0xd')](_0xee1c7c,util[_0x1ae4('0xc')](_0x500e03,{'showHidden':![],'depth':null}));};};exports[_0x1ae4('0x10')]=function(_0x35daaf,_0x1913fd,_0x5b26b2){return{'message':_0x35daaf,'unlock':_0x1913fd,'active':_0x5b26b2};};exports[_0x1ae4('0x11')]=function(_0x5a5782,_0x254996,_0x161a27){if(!_[_0x1ae4('0x12')](_0x161a27)&&_0x1ae4('0x13')===typeof _0x161a27&&!_[_0x1ae4('0x14')](_0x161a27)){if(!_[_0x1ae4('0x12')](_0x254996)&&_0x1ae4('0x13')===typeof _0x254996&&!_[_0x1ae4('0x14')](_0x254996)){return util['format']('\x22%s\x22\x20<%s>',_0x254996,_0x161a27);}return util['format'](_0x1ae4('0x15'),_0x161a27,_0x161a27);}if(!_['isUndefined'](_0x5a5782)&&_0x1ae4('0x13')===typeof _0x5a5782&&!_[_0x1ae4('0x14')](_0x5a5782)){return _0x5a5782;}return _0x1ae4('0x16');};exports['isActive']=function(_0x5a6877){if(_[_0x1ae4('0x17')](_0x5a6877)){return![];}return _0x5a6877;};exports[_0x1ae4('0x18')]=function(_0x3025ed,_0x2441f6,_0x10a40d,_0x5ef631,_0x458213,_0x176d70){var _0x3ff11b={'XMD-QUEUE':_0x2441f6[_0x1ae4('0x19')]?_0x2441f6[_0x1ae4('0x19')][_0x1ae4('0x1a')]:'','XMD-CALLERID':_0x5ef631,'XMD-CALLERID-PREVIEW':_0x176d70?util['format'](_0x1ae4('0x15'),_0x176d70[_0x1ae4('0x1b')],_0x176d70[_0x1ae4('0x1c')]):_0x5ef631,'XMD-DIALID':_0x458213,'XMD-CONTACTID':_0x2441f6[_0x1ae4('0x1d')],'XMD-CDRTYPE':_0x1ae4('0x1e'),'CALLERID(all)':_0x5ef631,'XMD-VOICEQUEUEID':_0x2441f6[_0x1ae4('0x1f')],'XMD-DIALCHANNEL':_0x10a40d,'XMD-DIALTIMEOUT':_0x3025ed[_0x1ae4('0x20')]||0x1e,'XMD-DIALOPTIONS':util[_0x1ae4('0x21')](_0x1ae4('0x22'),_0x3025ed[_0x1ae4('0x23')]?'g':'',_[_0x1ae4('0x14')](_0x3025ed[_0x1ae4('0x24')])?'':_0x1ae4('0x25')),'XMD-DIALURL':_0x3025ed[_0x1ae4('0x26')]||'','XMD-AGI':_0x3025ed[_0x1ae4('0x27')]?util['format'](_0x1ae4('0x28'),ipAgi,_0x3025ed[_0x1ae4('0x27')]):_0x1ae4('0x29'),'XMD-AGIAFTER':_0x3025ed['dialQueueProject2']?util[_0x1ae4('0x21')](_0x1ae4('0x28'),ipAgi,_0x3025ed[_0x1ae4('0x23')]):_0x1ae4('0x29'),'XMD-ORIGINATECALLERIDNUM':_0x176d70?_0x176d70[_0x1ae4('0x2a')]:'','XMD-ORIGINATECALLERIDNAME':_0x176d70?_0x176d70[_0x1ae4('0x2b')]:'','XMD-DESTINATION':_0x1ae4('0x2c'),'SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_[_0x1ae4('0x14')](_0x3025ed[_0x1ae4('0x24')])){_0x3ff11b[util[_0x1ae4('0x21')]('%s',_0x1ae4('0x2d'))]=_0x3025ed[_0x1ae4('0x24')];_0x3ff11b[util['format']('%s',_0x1ae4('0x2e'))]=_0x458213;}if(_0x2441f6&&_0x2441f6[_0x1ae4('0x2f')]){for(var _0x578cdf in _0x2441f6[_0x1ae4('0x2f')]){if(_0x2441f6[_0x1ae4('0x2f')][_0x1ae4('0x30')](_0x578cdf)){if(!_[_0x1ae4('0x17')](_0x2441f6['Contact'][_0x578cdf])&&_0x578cdf!=='id'&&_0x578cdf!==_0x1ae4('0x31')&&_0x578cdf!==_0x1ae4('0x32')&&_0x578cdf!=='updatedAt'){_0x3ff11b[util[_0x1ae4('0x21')]('%s%s',_0x1ae4('0x33'),_['toUpper'](_0x578cdf))]=_0x2441f6[_0x1ae4('0x2f')][_0x578cdf];}}}}return _0x3ff11b;};exports['toLowerVariables']=function(_0x3d0ef0){var _0x262fad={};for(var _0xd6ec15 in _0x3d0ef0){if(_0x3d0ef0[_0x1ae4('0x30')](_0xd6ec15)){_0x262fad[util[_0x1ae4('0x21')]('%s',_['toLower'](_0xd6ec15))]=_0x3d0ef0[_0xd6ec15];}}return{'variables':_0x262fad};};exports[_0x1ae4('0x34')]=function(_0x4ef815,_0x37b223){if(!_[_0x1ae4('0x17')](_0x4ef815)){if(_0x4ef815['hasOwnProperty'](_0x1ae4('0x35'))){if(_0x4ef815[_0x1ae4('0x35')]>0x0){_0x4ef815[_0x1ae4('0x35')]-=0x1;}else{logger[_0x1ae4('0xb')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x37b223);}}}else{logger['error']('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x37b223);}};exports[_0x1ae4('0x36')]=function(_0x2b41b6){var _0x369faa=moment()['format'](_0x1ae4('0x37'));_0x2b41b6[_0x1ae4('0x38')]=0xd;_0x2b41b6['statedesc']=_0x1ae4('0x39');_0x2b41b6[_0x1ae4('0x3a')]=_0x369faa;_0x2b41b6[_0x1ae4('0x3b')]=_0x369faa;_0x2b41b6[_0x1ae4('0x3c')]=_0x369faa;};exports[_0x1ae4('0x3d')]=function(_0xed0bfc,_0x39e320,_0x20c31a){var _0x122266=moment()[_0x1ae4('0x21')](_0x1ae4('0x37'));_0xed0bfc[_0x1ae4('0x38')]=_0x39e320;_0xed0bfc[_0x1ae4('0x3e')]=_0x20c31a;_0xed0bfc[_0x1ae4('0x3b')]=_0x122266;_0xed0bfc[_0x1ae4('0x3f')]=getSeconds(_0xed0bfc['responsetime'],_0xed0bfc[_0x1ae4('0x3a')]);};exports['logLookAgent']=function(_0x2905da,_0x58c731,_0x4a0dea){_0x2905da['membername']=_0x58c731;_0x2905da[_0x1ae4('0x40')]=_0x4a0dea;};exports[_0x1ae4('0x41')]=function(_0x3ded86,_0x18c076,_0x2e9e32){var _0x54ed3e=moment()[_0x1ae4('0x21')](_0x1ae4('0x37'));_0x3ded86[_0x1ae4('0x38')]=_0x18c076;_0x3ded86['statedesc']=_0x2e9e32;_0x3ded86[_0x1ae4('0x3b')]=_0x3ded86['responsetime']?_0x3ded86[_0x1ae4('0x3b')]:_0x54ed3e;_0x3ded86[_0x1ae4('0x3c')]=_0x3ded86['endtime']?_0x3ded86['endtime']:_0x54ed3e;_0x3ded86['ringtime']=getSeconds(_0x3ded86['responsetime']||0x0,_0x3ded86[_0x1ae4('0x3a')]||0x0);_0x3ded86[_0x1ae4('0x42')]=_0x3ded86[_0x1ae4('0x43')]?getSeconds(_0x3ded86[_0x1ae4('0x3c')],_0x3ded86['answertime']):0x0;};exports[_0x1ae4('0x44')]=function(_0x40e3b2){return _0x40e3b2===_0x1ae4('0x45');};exports[_0x1ae4('0x46')]=function(_0x2af44d,_0x18ced7,_0x502a52,_0x463512,_0x2f8393){var _0x544bbc=_0x463512?_0x1ae4('0x47'):_0x2af44d[_0x1ae4('0x1b')];_0x544bbc=_0x2f8393?'BOOKED':_0x544bbc;return{'actionid':_0x2af44d[_0x1ae4('0x48')],'action':_0x1ae4('0x49'),'channel':_0x2af44d[_0x1ae4('0x4a')],'callerid':util['format'](_0x1ae4('0x15'),_0x544bbc,_0x2af44d[_0x1ae4('0x1c')]),'Exten':'xcally-motion-preview','Context':'from-sip','Priority':'1','variable':_0x502a52,'timeout':(_0x18ced7['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x2af44d[_0x1ae4('0x48')]};};exports[_0x1ae4('0x4b')]=function(_0x578795){return _0x578795[_0x1ae4('0x4c')]+_0x578795['countcongestionretry']+_0x578795[_0x1ae4('0x4d')]+_0x578795[_0x1ae4('0x4e')]+_0x578795[_0x1ae4('0x4f')];};exports[_0x1ae4('0x50')]=function(_0x542cae){var _0x3aaf1c=_[_0x1ae4('0x51')](_0x542cae);_0x3aaf1c[_0x1ae4('0x38')]=0xf;_0x3aaf1c[_0x1ae4('0x3e')]='Global';return _0x3aaf1c;};exports[_0x1ae4('0x52')]=function(_0x333d44,_0x4dd027,_0xd6af56){var _0x40dce3={};_0x40dce3[_0x4dd027]=_0x333d44[_0x4dd027];_0x40dce3[_0x1ae4('0x53')]=![];_0x40dce3['scheduledat']=moment()['add'](_0xd6af56,_0x1ae4('0x54'))[_0x1ae4('0x21')](_0x1ae4('0x37'));_0x40dce3[_0x1ae4('0x1d')]=_0x333d44['ContactId'];_0x40dce3[_0x1ae4('0x55')]=_0x333d44[_0x1ae4('0x55')];_0x40dce3[_0x1ae4('0x1f')]=_0x333d44[_0x1ae4('0x1f')]||undefined;return _0x40dce3;};exports[_0x1ae4('0x56')]=function(_0x54b810,_0x429da2){if(!_[_0x1ae4('0x17')](_0x54b810)){if(_0x54b810['pTalking']>0x0){_0x54b810[_0x1ae4('0x57')]-=0x1;}else{logger[_0x1ae4('0xb')](_0x429da2,_0x1ae4('0x58'));}}else{logger[_0x1ae4('0xb')](_0x429da2,_0x1ae4('0x59'));}};exports[_0x1ae4('0x5a')]=function(_0x5dccae){if(_0x5dccae<=0x0){return!![];}return![];};exports[_0x1ae4('0x5b')]=function(_0x2d7808,_0x28d166,_0x5895c8){_0x2d7808['lastevent']=_0x28d166;_0x2d7808[_0x1ae4('0x1a')]=_0x2d7808[_0x1ae4('0x5c')];_0x2d7808['interface']=_0x2d7808[_0x1ae4('0x4a')];_0x2d7808[_0x1ae4('0x5d')]='voice';if(_0x5895c8){_0x2d7808[_0x1ae4('0x5e')]=_0x5895c8['mandatoryDisposition'];}return _0x2d7808;};exports[_0x1ae4('0x5f')]=function(_0x7b358f){var _0x2b0efd={};_0x2b0efd[_0x1ae4('0x5c')]=_0x7b358f[_0x1ae4('0x5c')];_0x2b0efd['interface']=_0x7b358f[_0x1ae4('0x4a')];_0x2b0efd[_0x1ae4('0x48')]=_0x7b358f['uniqueid'];return _0x2b0efd;};exports[_0x1ae4('0x60')]=function(_0x4a3616){var _0x3676b2=[];for(var _0x21f8fc in _0x4a3616){if(_0x4a3616[_0x1ae4('0x30')](_0x21f8fc)){if(!_[_0x1ae4('0x17')](_0x4a3616[_0x21f8fc])&&_0x4a3616[_0x21f8fc]['state']===_0x1ae4('0x61')&&_0x4a3616[_0x21f8fc][_0x1ae4('0x62')]===_0x1ae4('0x63')){_0x3676b2['push'](_0x4a3616[_0x21f8fc]['id']);}}}return _0x3676b2;};exports['getDiff']=function(_0x5815f7){var _0x46cc53=moment()[_0x1ae4('0x7')](0x0);var _0x23a0b=moment(_0x5815f7)['milliseconds'](0x0);return _0x46cc53[_0x1ae4('0x8')](_0x23a0b,_0x1ae4('0x9'));};exports[_0x1ae4('0x64')]=function(_0x4be8eb){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x4be8eb['ContactId'],'ListId':_0x4be8eb['ListId'],'VoiceQueueId':_0x4be8eb[_0x1ae4('0x1f')]||undefined,'CampaignId':_0x4be8eb[_0x1ae4('0x65')]||undefined};};exports[_0x1ae4('0x66')]=function(_0x16991c){if(_0x16991c===_0x1ae4('0x48')||_0x16991c===_0x1ae4('0x67')||_0x16991c==='queue'||_0x16991c==='type'||_0x16991c===_0x1ae4('0x68')||_0x16991c===_0x1ae4('0x69')||_0x16991c===_0x1ae4('0x6a')||_0x16991c==='channelAgent'||_0x16991c==='calleridname'||_0x16991c===_0x1ae4('0x53')||_0x16991c===_0x1ae4('0x1c')||_0x16991c===_0x1ae4('0x6b')||_0x16991c===_0x1ae4('0x4c')||_0x16991c===_0x1ae4('0x6c')||_0x16991c===_0x1ae4('0x4d')||_0x16991c==='countglobal'||_0x16991c===_0x1ae4('0x6d')||_0x16991c===_0x1ae4('0x6e')||_0x16991c===_0x1ae4('0x6f')||_0x16991c===_0x1ae4('0x70')||_0x16991c===_0x1ae4('0x1d')||_0x16991c===_0x1ae4('0x55')||_0x16991c==='UserId'||_0x16991c===_0x1ae4('0x1f')||_0x16991c===_0x1ae4('0x71')||_0x16991c==='xmd-voicequeueid'||_0x16991c==='xmd-queue'||_0x16991c===_0x1ae4('0x72')||_0x16991c===_0x1ae4('0x73')||_0x16991c==='xmd-dialurl'||_0x16991c===_0x1ae4('0x74')||_0x16991c==='xmd-dialoptions'||_0x16991c===_0x1ae4('0x75')||_0x16991c===_0x1ae4('0x76')||_0x16991c===_0x1ae4('0x77')||_0x16991c==='xmd-cdrtype'||_0x16991c===_0x1ae4('0x78')||_0x16991c===_0x1ae4('0x79')||_0x16991c===_0x1ae4('0x7a')||_0x16991c===_0x1ae4('0x7b')||_0x16991c===_0x1ae4('0x7c')||_0x16991c===_0x1ae4('0x7d')||_0x16991c===_0x1ae4('0x7e')||_0x16991c===_0x1ae4('0x7f')||_0x16991c==='rtpaudioqoslossbridged'||_0x16991c===_0x1ae4('0x80')||_0x16991c===_0x1ae4('0x81')||_0x16991c===_0x1ae4('0x7b')||_0x16991c===_0x1ae4('0x7c')||_0x16991c==='rtpaudioqosjitter'||_0x16991c==='rtpaudioqosjitterbridged'||_0x16991c===_0x1ae4('0x7f')||_0x16991c===_0x1ae4('0x82')||_0x16991c==='rtpaudioqosrtt'||_0x16991c===_0x1ae4('0x81')||_0x16991c===_0x1ae4('0x83')||_0x16991c===_0x1ae4('0x84')||_0x16991c===_0x1ae4('0x38')||_0x16991c===_0x1ae4('0x3e')){return![];}return!![];};exports['getCallerIdRandom']=function(_0xa0841a,_0x4cc85c){var _0x5d30db,_0x5314fa,_0x4b6c68;if(_0x4cc85c<=0x0){_0x4cc85c=0x1;}_0x5d30db=new RegExp(_0x1ae4('0x85')+_0x4cc85c+'}$');_0x5314fa=Math['pow'](0xa,_0x4cc85c-0x1);_0x4b6c68=Math['pow'](0xa,_0x4cc85c)-0x1;return util[_0x1ae4('0x21')]('%s',_[_0x1ae4('0x86')](_0xa0841a,_0x5d30db,_[_0x1ae4('0x87')](_0x5314fa,_0x4b6c68)));};exports[_0x1ae4('0x88')]=function(_0x1614ba){var _0x278d9d=_0x1614ba['match'](/"(.*?)"/);return _0x278d9d?_0x278d9d[0x1]:_0x1614ba;};exports[_0x1ae4('0x89')]=function(_0x34429f){var _0x2d1a37=_0x34429f[_0x1ae4('0x8a')](/<(.*?)>/);return _0x2d1a37?_0x2d1a37[0x1]:_0x34429f;}; \ No newline at end of file +var _0x06e6=['CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','countbusyretry','countglobal','callback','callbackat','recallme','UserId','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-dialurl','xmd-dialtimeout','xmd-dialid','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosbridged','rtpaudioqoslossbridged','rtpaudioqosrttbridged','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','random','extractCalleridName','extractCalleridNumber','match','util','lodash','moment','../../../../config/logger','preview','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','error','info','inspect','loggerError','logger2','message','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','isActive','addVariables','Queue','name','calleridname','calleridnum','ContactId','\x22rtTxX%s%s\x22','dialQueueProject2','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','xcally-motion-preview','monitor_format','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','isNil','tags','createdAt','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','starttime','responsetime','endtime','logAgent','state','statedesc','ringtime','logLookAgent','membername','logCustomer','answertime','isFailure','variablesAction','RECALL','BOOKED','uniqueid','channelAgent','from-sip','totalGlobal','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','Global','scheduledAt','active','scheduledat','add','minutes','ListId','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','interface','motionChannel','mandatoryDisposition','buildAcw','queue','not_inuse','reachable','push'];(function(_0x549c16,_0x3d29d5){var _0x57cffd=function(_0x4e9f82){while(--_0x4e9f82){_0x549c16['push'](_0x549c16['shift']());}};_0x57cffd(++_0x3d29d5);}(_0x06e6,0xb1));var _0x606e=function(_0x49cee9,_0x28e9de){_0x49cee9=_0x49cee9-0x0;var _0x5c896d=_0x06e6[_0x49cee9];return _0x5c896d;};'use strict';var util=require(_0x606e('0x0'));var _=require(_0x606e('0x1'));var moment=require(_0x606e('0x2'));var logger=require(_0x606e('0x3'))(_0x606e('0x4'));var ipAgi=process['env'][_0x606e('0x5')]||_0x606e('0x6');function getSeconds(_0x166899,_0x58f939){var _0x4aa2d7=moment(_0x166899)['milliseconds'](0x0);var _0x3a557c=moment(_0x58f939)[_0x606e('0x7')](0x0);return _0x4aa2d7[_0x606e('0x8')](_0x3a557c,_0x606e('0x9'));}exports['loggerCatch']=function(_0x59f764){return function(_0x34c2e5){logger[_0x606e('0xa')](_0x59f764,util['inspect'](_0x34c2e5,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x1d4a57,_0x3a9927){logger[_0x606e('0xb')](_0x1d4a57,util[_0x606e('0xc')](_0x3a9927,{'showHidden':![],'depth':null}));};exports[_0x606e('0xd')]=function(_0x1d80c6,_0x393f7c){logger[_0x606e('0xa')](_0x1d80c6,util[_0x606e('0xc')](_0x393f7c,{'showHidden':![],'depth':null}));};exports[_0x606e('0xe')]=function(_0x87b239){return function(_0x8d40bb){logger['info'](_0x87b239,util[_0x606e('0xc')](_0x8d40bb,{'showHidden':![],'depth':null}));};};exports[_0x606e('0xf')]=function(_0x119f72,_0x2c44ab,_0x239b62){return{'message':_0x119f72,'unlock':_0x2c44ab,'active':_0x239b62};};exports['getCallerId']=function(_0x4a081d,_0x109010,_0x310c93){if(!_[_0x606e('0x10')](_0x310c93)&&_0x606e('0x11')===typeof _0x310c93&&!_['isEmpty'](_0x310c93)){if(!_[_0x606e('0x10')](_0x109010)&&_0x606e('0x11')===typeof _0x109010&&!_[_0x606e('0x12')](_0x109010)){return util[_0x606e('0x13')](_0x606e('0x14'),_0x109010,_0x310c93);}return util['format'](_0x606e('0x14'),_0x310c93,_0x310c93);}if(!_['isUndefined'](_0x4a081d)&&'string'===typeof _0x4a081d&&!_[_0x606e('0x12')](_0x4a081d)){return _0x4a081d;}return'\x22\x22\x20<>';};exports[_0x606e('0x15')]=function(_0x26321d){if(_['isNil'](_0x26321d)){return![];}return _0x26321d;};exports[_0x606e('0x16')]=function(_0x5bfad0,_0x338299,_0x4100be,_0x52a83d,_0x4c517c,_0x571302){var _0x4e492e={'XMD-QUEUE':_0x338299[_0x606e('0x17')]?_0x338299['Queue'][_0x606e('0x18')]:'','XMD-CALLERID':_0x52a83d,'XMD-CALLERID-PREVIEW':_0x571302?util['format'](_0x606e('0x14'),_0x571302[_0x606e('0x19')],_0x571302[_0x606e('0x1a')]):_0x52a83d,'XMD-DIALID':_0x4c517c,'XMD-CONTACTID':_0x338299[_0x606e('0x1b')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x52a83d,'XMD-VOICEQUEUEID':_0x338299['VoiceQueueId'],'XMD-DIALCHANNEL':_0x4100be,'XMD-DIALTIMEOUT':_0x5bfad0['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util['format'](_0x606e('0x1c'),_0x5bfad0[_0x606e('0x1d')]?'g':'',_[_0x606e('0x12')](_0x5bfad0['monitor_format'])?'':_0x606e('0x1e')),'XMD-DIALURL':_0x5bfad0['dialPreviewUrl']||'','XMD-AGI':_0x5bfad0[_0x606e('0x1f')]?util[_0x606e('0x13')](_0x606e('0x20'),ipAgi,_0x5bfad0[_0x606e('0x1f')]):_0x606e('0x21'),'XMD-AGIAFTER':_0x5bfad0['dialQueueProject2']?util['format'](_0x606e('0x20'),ipAgi,_0x5bfad0['dialQueueProject2']):_0x606e('0x21'),'XMD-ORIGINATECALLERIDNUM':_0x571302?_0x571302['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x571302?_0x571302['originatecalleridname']:'','XMD-DESTINATION':_0x606e('0x22'),'SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_[_0x606e('0x12')](_0x5bfad0[_0x606e('0x23')])){_0x4e492e[util['format']('%s',_0x606e('0x24'))]=_0x5bfad0[_0x606e('0x23')];_0x4e492e[util[_0x606e('0x13')]('%s',_0x606e('0x25'))]=_0x4c517c;}if(_0x338299&&_0x338299['Contact']){for(var _0x4c68a0 in _0x338299[_0x606e('0x26')]){if(_0x338299['Contact'][_0x606e('0x27')](_0x4c68a0)){if(!_[_0x606e('0x28')](_0x338299['Contact'][_0x4c68a0])&&_0x4c68a0!=='id'&&_0x4c68a0!==_0x606e('0x29')&&_0x4c68a0!==_0x606e('0x2a')&&_0x4c68a0!=='updatedAt'){_0x4e492e[util[_0x606e('0x13')]('%s%s',_0x606e('0x2b'),_[_0x606e('0x2c')](_0x4c68a0))]=_0x338299[_0x606e('0x26')][_0x4c68a0];}}}}return _0x4e492e;};exports[_0x606e('0x2d')]=function(_0x5bfd7a){var _0x2581e8={};for(var _0x1e2a6e in _0x5bfd7a){if(_0x5bfd7a[_0x606e('0x27')](_0x1e2a6e)){_0x2581e8[util['format']('%s',_[_0x606e('0x2e')](_0x1e2a6e))]=_0x5bfd7a[_0x1e2a6e];}}return{'variables':_0x2581e8};};exports[_0x606e('0x2f')]=function(_0x4e3788,_0x1d5c9a){if(!_[_0x606e('0x28')](_0x4e3788)){if(_0x4e3788['hasOwnProperty'](_0x606e('0x30'))){if(_0x4e3788[_0x606e('0x30')]>0x0){_0x4e3788[_0x606e('0x30')]-=0x1;}else{logger[_0x606e('0xa')](_0x606e('0x31'),_0x1d5c9a);}}}else{logger[_0x606e('0xa')](_0x606e('0x32'),_0x1d5c9a);}};exports[_0x606e('0x33')]=function(_0x264955){var _0x1a256f=moment()['format'](_0x606e('0x34'));_0x264955['state']=0xd;_0x264955['statedesc']='Blacklist';_0x264955[_0x606e('0x35')]=_0x1a256f;_0x264955[_0x606e('0x36')]=_0x1a256f;_0x264955[_0x606e('0x37')]=_0x1a256f;};exports[_0x606e('0x38')]=function(_0x4310d4,_0x4f89f4,_0x386843){var _0x214dd6=moment()[_0x606e('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x4310d4[_0x606e('0x39')]=_0x4f89f4;_0x4310d4[_0x606e('0x3a')]=_0x386843;_0x4310d4[_0x606e('0x36')]=_0x214dd6;_0x4310d4[_0x606e('0x3b')]=getSeconds(_0x4310d4[_0x606e('0x36')],_0x4310d4[_0x606e('0x35')]);};exports[_0x606e('0x3c')]=function(_0x2086ad,_0x357ed9,_0x2e577c){_0x2086ad[_0x606e('0x3d')]=_0x357ed9;_0x2086ad['UserId']=_0x2e577c;};exports[_0x606e('0x3e')]=function(_0x23fd45,_0x1b4f23,_0x565828){var _0x29a597=moment()[_0x606e('0x13')](_0x606e('0x34'));_0x23fd45[_0x606e('0x39')]=_0x1b4f23;_0x23fd45[_0x606e('0x3a')]=_0x565828;_0x23fd45[_0x606e('0x36')]=_0x23fd45['responsetime']?_0x23fd45[_0x606e('0x36')]:_0x29a597;_0x23fd45[_0x606e('0x37')]=_0x23fd45[_0x606e('0x37')]?_0x23fd45[_0x606e('0x37')]:_0x29a597;_0x23fd45['ringtime']=getSeconds(_0x23fd45[_0x606e('0x36')]||0x0,_0x23fd45['starttime']||0x0);_0x23fd45['talktime']=_0x23fd45['answertime']?getSeconds(_0x23fd45[_0x606e('0x37')],_0x23fd45[_0x606e('0x3f')]):0x0;};exports[_0x606e('0x40')]=function(_0xd93494){return _0xd93494==='Failure';};exports[_0x606e('0x41')]=function(_0x3c37a8,_0x4d6a0f,_0x143b92,_0x51d0b7,_0x51ad97){var _0x30e288=_0x51d0b7?_0x606e('0x42'):_0x3c37a8[_0x606e('0x19')];_0x30e288=_0x51ad97?_0x606e('0x43'):_0x30e288;return{'actionid':_0x3c37a8[_0x606e('0x44')],'action':'originate','channel':_0x3c37a8[_0x606e('0x45')],'callerid':util[_0x606e('0x13')]('\x22%s\x22\x20<%s>',_0x30e288,_0x3c37a8[_0x606e('0x1a')]),'Exten':'xcally-motion-preview','Context':_0x606e('0x46'),'Priority':'1','variable':_0x143b92,'timeout':(_0x4d6a0f['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x3c37a8['uniqueid']};};exports[_0x606e('0x47')]=function(_0x2c6bd6){return _0x2c6bd6['countbusyretry']+_0x2c6bd6[_0x606e('0x48')]+_0x2c6bd6[_0x606e('0x49')]+_0x2c6bd6[_0x606e('0x4a')]+_0x2c6bd6[_0x606e('0x4b')];};exports[_0x606e('0x4c')]=function(_0x4c1d00){var _0x2c4b0f=_['clone'](_0x4c1d00);_0x2c4b0f[_0x606e('0x39')]=0xf;_0x2c4b0f['statedesc']=_0x606e('0x4d');return _0x2c4b0f;};exports[_0x606e('0x4e')]=function(_0x1b1632,_0x4e180a,_0x3e207b){var _0x18774f={};_0x18774f[_0x4e180a]=_0x1b1632[_0x4e180a];_0x18774f[_0x606e('0x4f')]=![];_0x18774f[_0x606e('0x50')]=moment()[_0x606e('0x51')](_0x3e207b,_0x606e('0x52'))[_0x606e('0x13')](_0x606e('0x34'));_0x18774f[_0x606e('0x1b')]=_0x1b1632['ContactId'];_0x18774f[_0x606e('0x53')]=_0x1b1632['ListId'];_0x18774f['VoiceQueueId']=_0x1b1632[_0x606e('0x54')]||undefined;return _0x18774f;};exports[_0x606e('0x55')]=function(_0x309149,_0x4cb0c3){if(!_['isNil'](_0x309149)){if(_0x309149['pTalking']>0x0){_0x309149[_0x606e('0x56')]-=0x1;}else{logger['error'](_0x4cb0c3,_0x606e('0x57'));}}else{logger[_0x606e('0xa')](_0x4cb0c3,_0x606e('0x58'));}};exports[_0x606e('0x59')]=function(_0x257c8b){if(_0x257c8b<=0x0){return!![];}return![];};exports['buildObj']=function(_0x416834,_0x2d12b4,_0x2abd56){_0x416834[_0x606e('0x5a')]=_0x2d12b4;_0x416834[_0x606e('0x18')]=_0x416834['queue'];_0x416834[_0x606e('0x5b')]=_0x416834['channelAgent'];_0x416834[_0x606e('0x5c')]='voice';if(_0x2abd56){_0x416834[_0x606e('0x5d')]=_0x2abd56[_0x606e('0x5d')];}return _0x416834;};exports[_0x606e('0x5e')]=function(_0xed25df){var _0x6130a0={};_0x6130a0[_0x606e('0x5f')]=_0xed25df[_0x606e('0x5f')];_0x6130a0[_0x606e('0x5b')]=_0xed25df[_0x606e('0x45')];_0x6130a0['uniqueid']=_0xed25df[_0x606e('0x44')];return _0x6130a0;};exports['agentReadyId']=function(_0x480f76){var _0x598c08=[];for(var _0x49be21 in _0x480f76){if(_0x480f76[_0x606e('0x27')](_0x49be21)){if(!_[_0x606e('0x28')](_0x480f76[_0x49be21])&&_0x480f76[_0x49be21]['state']===_0x606e('0x60')&&_0x480f76[_0x49be21]['status']===_0x606e('0x61')){_0x598c08[_0x606e('0x62')](_0x480f76[_0x49be21]['id']);}}}return _0x598c08;};exports['getDiff']=function(_0x2c1d24){var _0x2cc6fb=moment()[_0x606e('0x7')](0x0);var _0x3f0253=moment(_0x2c1d24)['milliseconds'](0x0);return _0x2cc6fb[_0x606e('0x8')](_0x3f0253,_0x606e('0x9'));};exports['createBody']=function(_0x3739b8){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x3739b8[_0x606e('0x1b')],'ListId':_0x3739b8[_0x606e('0x53')],'VoiceQueueId':_0x3739b8[_0x606e('0x54')]||undefined,'CampaignId':_0x3739b8[_0x606e('0x63')]||undefined};};exports[_0x606e('0x64')]=function(_0xc4d584){if(_0xc4d584===_0x606e('0x44')||_0xc4d584===_0x606e('0x65')||_0xc4d584===_0x606e('0x5f')||_0xc4d584===_0x606e('0x66')||_0xc4d584===_0x606e('0x67')||_0xc4d584===_0x606e('0x68')||_0xc4d584===_0x606e('0x3d')||_0xc4d584===_0x606e('0x45')||_0xc4d584==='calleridname'||_0xc4d584===_0x606e('0x4f')||_0xc4d584===_0x606e('0x1a')||_0xc4d584===_0x606e('0x50')||_0xc4d584===_0x606e('0x69')||_0xc4d584==='countcongestionretry'||_0xc4d584===_0x606e('0x49')||_0xc4d584===_0x606e('0x6a')||_0xc4d584===_0x606e('0x6b')||_0xc4d584==='callbackuniqueid'||_0xc4d584===_0x606e('0x6c')||_0xc4d584===_0x606e('0x6d')||_0xc4d584==='ContactId'||_0xc4d584===_0x606e('0x53')||_0xc4d584===_0x606e('0x6e')||_0xc4d584===_0x606e('0x54')||_0xc4d584===_0x606e('0x6f')||_0xc4d584===_0x606e('0x70')||_0xc4d584===_0x606e('0x71')||_0xc4d584===_0x606e('0x72')||_0xc4d584==='xmd-listid'||_0xc4d584===_0x606e('0x73')||_0xc4d584===_0x606e('0x74')||_0xc4d584==='xmd-dialoptions'||_0xc4d584===_0x606e('0x75')||_0xc4d584==='xmd-dialchannel'||_0xc4d584===_0x606e('0x76')||_0xc4d584===_0x606e('0x77')||_0xc4d584===_0x606e('0x78')||_0xc4d584===_0x606e('0x79')||_0xc4d584==='xmd-agi'||_0xc4d584===_0x606e('0x7a')||_0xc4d584==='rtpaudioqosbridged'||_0xc4d584===_0x606e('0x7b')||_0xc4d584===_0x606e('0x7c')||_0xc4d584===_0x606e('0x7d')||_0xc4d584==='rtpaudioqoslossbridged'||_0xc4d584===_0x606e('0x7e')||_0xc4d584==='rtpaudioqosrttbridged'||_0xc4d584==='rtpaudioqos'||_0xc4d584===_0x606e('0x7f')||_0xc4d584==='rtpaudioqosjitter'||_0xc4d584===_0x606e('0x7c')||_0xc4d584===_0x606e('0x7d')||_0xc4d584===_0x606e('0x80')||_0xc4d584===_0x606e('0x7e')||_0xc4d584===_0x606e('0x81')||_0xc4d584==='bridgepeer'||_0xc4d584===_0x606e('0x82')||_0xc4d584==='state'||_0xc4d584==='statedesc'){return![];}return!![];};exports[_0x606e('0x83')]=function(_0x321b2c,_0x2eb3d8){var _0x197363,_0x1fe8f1,_0x35cd06;if(_0x2eb3d8<=0x0){_0x2eb3d8=0x1;}_0x197363=new RegExp(_0x606e('0x84')+_0x2eb3d8+'}$');_0x1fe8f1=Math[_0x606e('0x85')](0xa,_0x2eb3d8-0x1);_0x35cd06=Math['pow'](0xa,_0x2eb3d8)-0x1;return util['format']('%s',_['replace'](_0x321b2c,_0x197363,_[_0x606e('0x86')](_0x1fe8f1,_0x35cd06)));};exports[_0x606e('0x87')]=function(_0x42cbd4){var _0x961b9b=_0x42cbd4['match'](/"(.*?)"/);return _0x961b9b?_0x961b9b[0x1]:_0x42cbd4;};exports[_0x606e('0x88')]=function(_0x1e16a3){var _0xa56cc=_0x1e16a3[_0x606e('0x89')](/<(.*?)>/);return _0xa56cc?_0xa56cc[0x1]:_0x1e16a3;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 4c609f9..3460f81 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 _0xfd6c=['queueremove','queuepause','reload','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number','boolean'];(function(_0x535558,_0x1182ff){var _0x168744=function(_0x4c028c){while(--_0x4c028c){_0x535558['push'](_0x535558['shift']());}};_0x168744(++_0x1182ff);}(_0xfd6c,0xce));var _0xcfd6=function(_0x2d2ca2,_0x51873f){_0x2d2ca2=_0x2d2ca2-0x0;var _0x48489d=_0xfd6c[_0x2d2ca2];return _0x48489d;};'use strict';exports[_0xcfd6('0x0')]={'queue':{'type':_0xcfd6('0x1'),'required':!![]},'interface':{'type':_0xcfd6('0x1'),'required':!![]},'membername':{'type':_0xcfd6('0x1'),'required':!![]},'penalty':{'type':_0xcfd6('0x2'),'required':![]},'paused':{'type':_0xcfd6('0x3'),'required':![]}};exports[_0xcfd6('0x4')]={'queue':{'type':_0xcfd6('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports[_0xcfd6('0x5')]={'interface':{'type':_0xcfd6('0x1'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0xcfd6('0x1'),'required':![]}};exports[_0xcfd6('0x6')]={'module':{'type':_0xcfd6('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0xcfd6('0x1'),'required':!![]}};exports[_0xcfd6('0x7')]={'uniqueid':{'type':_0xcfd6('0x1'),'required':!![]},'filename':{'type':_0xcfd6('0x1')},'format':{'type':_0xcfd6('0x1')},'mixmonitorid':{'type':'string'}};exports[_0xcfd6('0x8')]={'uniqueid':{'type':_0xcfd6('0x1'),'required':!![]}};exports[_0xcfd6('0x9')]={'uniqueid':{'type':_0xcfd6('0x1'),'required':!![]},'exten':{'type':_0xcfd6('0x1'),'required':!![]},'context':{'type':'string'}}; \ No newline at end of file +var _0xc85f=['voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number','boolean','reload'];(function(_0x4c6f51,_0x2757c4){var _0x28050f=function(_0x24c3fc){while(--_0x24c3fc){_0x4c6f51['push'](_0x4c6f51['shift']());}};_0x28050f(++_0x2757c4);}(_0xc85f,0xcd));var _0xfc85=function(_0x1f68de,_0x470829){_0x1f68de=_0x1f68de-0x0;var _0x152c2d=_0xc85f[_0x1f68de];return _0x152c2d;};'use strict';exports[_0xfc85('0x0')]={'queue':{'type':_0xfc85('0x1'),'required':!![]},'interface':{'type':_0xfc85('0x1'),'required':!![]},'membername':{'type':_0xfc85('0x1'),'required':!![]},'penalty':{'type':_0xfc85('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports['queueremove']={'queue':{'type':_0xfc85('0x1'),'required':!![]},'interface':{'type':_0xfc85('0x1'),'required':!![]}};exports['queuepause']={'interface':{'type':_0xfc85('0x1'),'required':!![]},'paused':{'type':_0xfc85('0x3')},'reason':{'type':'string','required':![]}};exports[_0xfc85('0x4')]={'module':{'type':_0xfc85('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':'string','required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0xfc85('0x1'),'required':!![]},'filename':{'type':_0xfc85('0x1')},'format':{'type':_0xfc85('0x1')},'mixmonitorid':{'type':_0xfc85('0x1')}};exports[_0xfc85('0x5')]={'uniqueid':{'type':_0xfc85('0x1'),'required':!![]}};exports[_0xfc85('0x6')]={'uniqueid':{'type':_0xfc85('0x1'),'required':!![]},'exten':{'type':_0xfc85('0x1'),'required':!![]},'context':{'type':_0xfc85('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 1fe778a..c295aca 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 _0x8c78=['freshdeskAccounts','zohoAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','mapKeys','hasOwnProperty','format','SIP/%s','name','isNil','interface','total','answered','sumHoldTime','sumDuration','sumBillable','ivrTotalCallsDays','isEmpty','unmanaged','abandoned','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','prototype','mergeFromDatabase','length','isUndefined','initVoiceQueues','triggers','initTemplates','templates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','deskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','initDynamics365Accounts','initFreshsalesAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','uniqueid','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','faxAccounts','util','moment','../model/agent','../model/telephone','../model/trunk','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones','trunks','voiceQueues','campaigns','outbound','channels','outboundChannels','settings','zendeskAccounts','salesforceAccounts'];(function(_0x4ef3ce,_0x239d34){var _0x42490c=function(_0x33db11){while(--_0x33db11){_0x4ef3ce['push'](_0x4ef3ce['shift']());}};_0x42490c(++_0x239d34);}(_0x8c78,0x1c2));var _0x88c7=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x8c78[_0x3e5086];return _0xfeb102;};'use strict';var BPromise=require('bluebird');var util=require(_0x88c7('0x0'));var _=require('lodash');var moment=require(_0x88c7('0x1'));var Agent=require(_0x88c7('0x2'));var Telephone=require(_0x88c7('0x3'));var Trunk=require(_0x88c7('0x4'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require('../model/trigger');var Template=require('../model/template');var Campaign=require(_0x88c7('0x5'));var VoiceExtension=require(_0x88c7('0x6'));var ZendeskAccount=require(_0x88c7('0x7'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0x88c7('0x8'));var SugarcrmAccount=require(_0x88c7('0x9'));var ZohoAccount=require(_0x88c7('0xa'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require(_0x88c7('0xb'));var Dynamics365Account=require(_0x88c7('0xc'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0x88c7('0xd'));var Realtime=function(){this[_0x88c7('0xe')]={};this[_0x88c7('0xf')]={};this[_0x88c7('0x10')]={};this[_0x88c7('0x11')]={};this['triggers']={};this[_0x88c7('0x12')]={};this['templates']={};this[_0x88c7('0x13')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x88c7('0x14')]={};this['queueChannels']={};this[_0x88c7('0x15')]={};this['timers']={};this[_0x88c7('0x16')]={};this[_0x88c7('0x17')]={};this[_0x88c7('0x18')]={};this['sugarcrmAccounts']={};this[_0x88c7('0x19')]={};this[_0x88c7('0x1a')]={};this['deskAccounts']={};this[_0x88c7('0x1b')]={};this[_0x88c7('0x1c')]={};this[_0x88c7('0x1d')]={};this['freshsalesAccounts']={};this['faxAccounts']={};};function freeIsNotKey(_0x52e124,_0x19bede,_0xbf2673){var _0x3b6505=_[_0x88c7('0x1e')](_0x52e124,function(_0x25d9e3,_0xd2690d){return _0x25d9e3[_0xbf2673];});for(var _0xe48ca8 in _0x19bede){if(_0x19bede[_0x88c7('0x1f')](_0xe48ca8)){if(!_0x3b6505[_0xe48ca8]){delete _0x19bede[_0xe48ca8];}}}}function freeIsNotKeySip(_0x1b6fc1,_0x50e6bb){var _0x23bcb4=_[_0x88c7('0x1e')](_0x1b6fc1,function(_0x2c0d30,_0x75268e){return util[_0x88c7('0x20')](_0x88c7('0x21'),_0x2c0d30[_0x88c7('0x22')]);});for(var _0x8d1f72 in _0x50e6bb){if(_0x50e6bb['hasOwnProperty'](_0x8d1f72)){if(!_0x23bcb4[_0x8d1f72]){delete _0x50e6bb[_0x8d1f72];}}}}function freeIsNotKeyAgent(_0x28e7c9,_0x4a37c3){var _0x10e8c5=_[_0x88c7('0x1e')](_0x28e7c9,function(_0x48fecd,_0x26b752){var _0x28ddd9=_[_0x88c7('0x23')](_0x48fecd[_0x88c7('0x24')])?util[_0x88c7('0x20')](_0x88c7('0x21'),_0x48fecd[_0x88c7('0x22')]):_0x48fecd[_0x88c7('0x24')];return _0x28ddd9;});for(var _0x20b75b in _0x4a37c3){if(_0x4a37c3[_0x88c7('0x1f')](_0x20b75b)){if(!_0x10e8c5[_0x20b75b]){delete _0x4a37c3[_0x20b75b];}}}}function clearVoiceCallReports(_0x3634d2){_0x3634d2[_0x88c7('0x25')]=0x0;_0x3634d2[_0x88c7('0x26')]=0x0;_0x3634d2[_0x88c7('0x27')]=0x0;_0x3634d2[_0x88c7('0x28')]=0x0;_0x3634d2[_0x88c7('0x29')]=0x0;}function clearCampaigns(_0x35467c){if(!_['isEmpty'](_0x35467c)){for(var _0x5f59e9 in _0x35467c){if(_0x35467c[_0x88c7('0x1f')](_0x5f59e9)){_0x35467c[_0x5f59e9][_0x88c7('0x2a')]=0x0;_0x35467c[_0x5f59e9]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x4b679f){if(!_[_0x88c7('0x2b')](_0x4b679f)){for(var _0x1ad75b in _0x4b679f){if(_0x4b679f[_0x88c7('0x1f')](_0x1ad75b)){_0x4b679f[_0x1ad75b][_0x88c7('0x25')]=0x0;_0x4b679f[_0x1ad75b]['answered']=0x0;_0x4b679f[_0x1ad75b][_0x88c7('0x2c')]=0x0;_0x4b679f[_0x1ad75b][_0x88c7('0x2d')]=0x0;_0x4b679f[_0x1ad75b]['sumHoldTime']=0x0;_0x4b679f[_0x1ad75b][_0x88c7('0x28')]=0x0;_0x4b679f[_0x1ad75b][_0x88c7('0x29')]=0x0;_0x4b679f[_0x1ad75b]['outboundAnswerAgiCallsDay']=0x0;_0x4b679f[_0x1ad75b]['outboundNoAnswerCallsDay']=0x0;_0x4b679f[_0x1ad75b][_0x88c7('0x2e')]=0x0;_0x4b679f[_0x1ad75b][_0x88c7('0x2f')]=0x0;_0x4b679f[_0x1ad75b]['outboundNoSuchCallsDay']=0x0;_0x4b679f[_0x1ad75b][_0x88c7('0x30')]=0x0;_0x4b679f[_0x1ad75b][_0x88c7('0x31')]=0x0;_0x4b679f[_0x1ad75b][_0x88c7('0x32')]=0x0;_0x4b679f[_0x1ad75b][_0x88c7('0x33')]=0x0;_0x4b679f[_0x1ad75b]['outboundOriginateFailureCallsDay']=0x0;_0x4b679f[_0x1ad75b][_0x88c7('0x34')]=0x0;_0x4b679f[_0x1ad75b][_0x88c7('0x35')]=0x0;_0x4b679f[_0x1ad75b][_0x88c7('0x36')]=0x0;_0x4b679f[_0x1ad75b][_0x88c7('0x37')]=0x0;_0x4b679f[_0x1ad75b]['queueStatusComplete']=!![];}}}}Realtime[_0x88c7('0x38')][_0x88c7('0x39')]=function(_0xd2970b,_0x168a43){for(var _0x3dd3c6 in _0x168a43){if(_0xd2970b[_0x88c7('0x1f')](_0x3dd3c6)){_0xd2970b[_0x3dd3c6]=_0x168a43[_0x3dd3c6];}}};Realtime[_0x88c7('0x38')]['initAgents']=function(){var _0x13ca4f=this;return function(_0x2617b1){if(_0x2617b1){freeIsNotKeyAgent(_0x2617b1,_0x13ca4f[_0x88c7('0xe')]);for(var _0x4a420d=0x0,_0x513789={},_0x985687={};_0x4a420d<_0x2617b1[_0x88c7('0x3a')];_0x4a420d+=0x1){_0x513789=_0x2617b1[_0x4a420d];var _0xfe2dad=_[_0x88c7('0x23')](_0x513789[_0x88c7('0x24')])?util[_0x88c7('0x20')](_0x88c7('0x21'),_0x513789['name']):_0x513789[_0x88c7('0x24')];if(_['isUndefined'](_0x13ca4f['agents'][_0xfe2dad])){_0x13ca4f[_0x88c7('0xe')][_0xfe2dad]=new Agent(_0x513789);}else{_0x13ca4f[_0x88c7('0x39')](_0x13ca4f['agents'][_0xfe2dad],_0x513789);}}}return _0x13ca4f['agents'];};};Realtime[_0x88c7('0x38')]['initTelephones']=function(){var _0x219252=this;return function(_0xdb4546){if(_0xdb4546){freeIsNotKeySip(_0xdb4546,_0x219252['telephones']);for(var _0x529d42=0x0,_0x1b117d={},_0x37dd28={};_0x529d42<_0xdb4546[_0x88c7('0x3a')];_0x529d42+=0x1){_0x1b117d=_0xdb4546[_0x529d42];if(_[_0x88c7('0x3b')](_0x219252['telephones'][util[_0x88c7('0x20')](_0x88c7('0x21'),_0x1b117d[_0x88c7('0x22')])])){_0x219252['telephones'][util[_0x88c7('0x20')](_0x88c7('0x21'),_0x1b117d[_0x88c7('0x22')])]=new Telephone(_0x1b117d);}else{_0x219252[_0x88c7('0x39')](_0x219252[_0x88c7('0xf')][util[_0x88c7('0x20')]('SIP/%s',_0x1b117d['name'])],_0x1b117d);}}}return _0x219252[_0x88c7('0xf')];};};Realtime[_0x88c7('0x38')]['initTrunks']=function(){var _0x55cd15=this;return function(_0x3ba908){if(_0x3ba908){freeIsNotKeySip(_0x3ba908,_0x55cd15['trunks']);for(var _0x2620e=0x0,_0x57f9a3={},_0x108a17={};_0x2620e<_0x3ba908[_0x88c7('0x3a')];_0x2620e+=0x1){_0x57f9a3=_0x3ba908[_0x2620e];if(_[_0x88c7('0x3b')](_0x55cd15[_0x88c7('0x10')][util[_0x88c7('0x20')](_0x88c7('0x21'),_0x57f9a3[_0x88c7('0x22')])])){_0x55cd15['trunks'][util[_0x88c7('0x20')](_0x88c7('0x21'),_0x57f9a3[_0x88c7('0x22')])]=new Trunk(_0x57f9a3);}else{_0x55cd15['mergeFromDatabase'](_0x55cd15[_0x88c7('0x10')][util[_0x88c7('0x20')](_0x88c7('0x21'),_0x57f9a3[_0x88c7('0x22')])],_0x57f9a3);}}}return _0x55cd15[_0x88c7('0x10')];};};Realtime[_0x88c7('0x38')][_0x88c7('0x3c')]=function(){var _0x3977fa=this;return function(_0x10fa3c){if(_0x10fa3c){freeIsNotKey(_0x10fa3c,_0x3977fa[_0x88c7('0x11')],_0x88c7('0x22'));for(var _0x5b859b=0x0,_0x438a3f={},_0x172f09={};_0x5b859b<_0x10fa3c[_0x88c7('0x3a')];_0x5b859b+=0x1){_0x438a3f=_0x10fa3c[_0x5b859b];if(_['isUndefined'](_0x3977fa[_0x88c7('0x11')][_0x438a3f['name']])){_0x3977fa[_0x88c7('0x11')][_0x438a3f[_0x88c7('0x22')]]=new VoiceQueue(_0x438a3f);}else{_0x3977fa['mergeFromDatabase'](_0x3977fa[_0x88c7('0x11')][_0x438a3f['name']],_0x438a3f);}}}return _0x3977fa[_0x88c7('0x11')];};};Realtime[_0x88c7('0x38')]['initTriggers']=function(){var _0x171981=this;return function(_0x2e0d21){if(_0x2e0d21){freeIsNotKey(_0x2e0d21,_0x171981['triggers'],'id');for(var _0xd959ad=0x0,_0x7dae11={},_0x153158={};_0xd959ad<_0x2e0d21[_0x88c7('0x3a')];_0xd959ad+=0x1){_0x7dae11=_0x2e0d21[_0xd959ad];if(_[_0x88c7('0x3b')](_0x171981[_0x88c7('0x3d')][_0x7dae11['id']])){_0x171981[_0x88c7('0x3d')][_0x7dae11['id']]=new Trigger(_0x7dae11);}else{_0x171981[_0x88c7('0x39')](_0x171981[_0x88c7('0x3d')][_0x7dae11['id']],_0x7dae11);}}}return _0x171981[_0x88c7('0x3d')];};};Realtime[_0x88c7('0x38')][_0x88c7('0x3e')]=function(){var _0x1f5eee=this;return function(_0x348c40){if(_0x348c40){freeIsNotKey(_0x348c40,_0x1f5eee['templates'],'id');for(var _0x1326f1=0x0,_0x409e9c={},_0x69b83c={};_0x1326f1<_0x348c40[_0x88c7('0x3a')];_0x1326f1+=0x1){_0x409e9c=_0x348c40[_0x1326f1];if(_[_0x88c7('0x3b')](_0x1f5eee['templates'][_0x409e9c['id']])){_0x1f5eee['templates'][_0x409e9c['id']]=new Template(_0x409e9c);}else{_0x1f5eee[_0x88c7('0x39')](_0x1f5eee[_0x88c7('0x3f')][_0x409e9c['id']],_0x409e9c);}}}return _0x1f5eee[_0x88c7('0x3f')];};};Realtime['prototype'][_0x88c7('0x40')]=function(){var _0x362787=this;return function(_0xed8236){if(_0xed8236){freeIsNotKey(_0xed8236,_0x362787[_0x88c7('0x17')],'id');for(var _0x28e4fd=0x0,_0x2597ac={},_0x53080e={};_0x28e4fd<_0xed8236[_0x88c7('0x3a')];_0x28e4fd+=0x1){_0x2597ac=_0xed8236[_0x28e4fd];if(_[_0x88c7('0x3b')](_0x362787[_0x88c7('0x17')][_0x2597ac['id']])){_0x362787['zendeskAccounts'][_0x2597ac['id']]=new ZendeskAccount(_0x2597ac);}else{_0x362787[_0x88c7('0x39')](_0x362787[_0x88c7('0x17')][_0x2597ac['id']],_0x2597ac);}}}return _0x362787[_0x88c7('0x17')];};};Realtime[_0x88c7('0x38')][_0x88c7('0x41')]=function(){var _0x101c9e=this;return function(_0x3bf267){if(_0x3bf267){freeIsNotKey(_0x3bf267,_0x101c9e[_0x88c7('0x18')],'id');for(var _0x1560fa=0x0,_0x334811={},_0x257684={};_0x1560fa<_0x3bf267['length'];_0x1560fa+=0x1){_0x334811=_0x3bf267[_0x1560fa];if(_[_0x88c7('0x3b')](_0x101c9e[_0x88c7('0x18')][_0x334811['id']])){_0x101c9e['salesforceAccounts'][_0x334811['id']]=new SalesforceAccount(_0x334811);}else{_0x101c9e[_0x88c7('0x39')](_0x101c9e[_0x88c7('0x18')][_0x334811['id']],_0x334811);}}}return _0x101c9e[_0x88c7('0x18')];};};Realtime[_0x88c7('0x38')][_0x88c7('0x42')]=function(){var _0x2853a4=this;return function(_0x425062){if(_0x425062){freeIsNotKey(_0x425062,_0x2853a4[_0x88c7('0x19')],'id');for(var _0x3c9395=0x0,_0x72d1f0={},_0x1a670a={};_0x3c9395<_0x425062['length'];_0x3c9395+=0x1){_0x72d1f0=_0x425062[_0x3c9395];if(_['isUndefined'](_0x2853a4['freshdeskAccounts'][_0x72d1f0['id']])){_0x2853a4[_0x88c7('0x19')][_0x72d1f0['id']]=new FreshdeskAccount(_0x72d1f0);}else{_0x2853a4[_0x88c7('0x39')](_0x2853a4[_0x88c7('0x19')][_0x72d1f0['id']],_0x72d1f0);}}}return _0x2853a4[_0x88c7('0x19')];};};Realtime['prototype'][_0x88c7('0x43')]=function(){var _0x4d1c6f=this;return function(_0xa70f55){if(_0xa70f55){freeIsNotKey(_0xa70f55,_0x4d1c6f[_0x88c7('0x1a')],'id');for(var _0x4aba57=0x0,_0x67d9fa={},_0x231e2d={};_0x4aba57<_0xa70f55[_0x88c7('0x3a')];_0x4aba57+=0x1){_0x67d9fa=_0xa70f55[_0x4aba57];if(_['isUndefined'](_0x4d1c6f[_0x88c7('0x1a')][_0x67d9fa['id']])){_0x4d1c6f[_0x88c7('0x1a')][_0x67d9fa['id']]=new ZohoAccount(_0x67d9fa);}else{_0x4d1c6f[_0x88c7('0x39')](_0x4d1c6f[_0x88c7('0x1a')][_0x67d9fa['id']],_0x67d9fa);}}}return _0x4d1c6f[_0x88c7('0x1a')];};};Realtime[_0x88c7('0x38')]['initDeskAccounts']=function(){var _0x47f688=this;return function(_0x533498){if(_0x533498){freeIsNotKey(_0x533498,_0x47f688[_0x88c7('0x44')],'id');for(var _0xc5a9c2=0x0,_0x44cced={},_0xd2c176={};_0xc5a9c2<_0x533498[_0x88c7('0x3a')];_0xc5a9c2+=0x1){_0x44cced=_0x533498[_0xc5a9c2];if(_[_0x88c7('0x3b')](_0x47f688['deskAccounts'][_0x44cced['id']])){_0x47f688[_0x88c7('0x44')][_0x44cced['id']]=new DeskAccount(_0x44cced);}else{_0x47f688[_0x88c7('0x39')](_0x47f688[_0x88c7('0x44')][_0x44cced['id']],_0x44cced);}}}return _0x47f688[_0x88c7('0x44')];};};Realtime[_0x88c7('0x38')][_0x88c7('0x45')]=function(){var _0x1d3ba8=this;return function(_0x4e7e90){if(_0x4e7e90){freeIsNotKey(_0x4e7e90,_0x1d3ba8[_0x88c7('0x46')],'id');for(var _0x399e03=0x0,_0x2f5f60={},_0x207ec2={};_0x399e03<_0x4e7e90['length'];_0x399e03+=0x1){_0x2f5f60=_0x4e7e90[_0x399e03];if(_[_0x88c7('0x3b')](_0x1d3ba8['sugarcrmAccounts'][_0x2f5f60['id']])){_0x1d3ba8['sugarcrmAccounts'][_0x2f5f60['id']]=new SugarcrmAccount(_0x2f5f60);}else{_0x1d3ba8[_0x88c7('0x39')](_0x1d3ba8[_0x88c7('0x46')][_0x2f5f60['id']],_0x2f5f60);}}}return _0x1d3ba8[_0x88c7('0x46')];};};Realtime[_0x88c7('0x38')][_0x88c7('0x47')]=function(){var _0x5d5980=this;return function(_0x4d32db){if(_0x4d32db){freeIsNotKey(_0x4d32db,_0x5d5980['vtigerAccounts'],'id');for(var _0x5b74ab=0x0,_0x1115f3={},_0x388637={};_0x5b74ab<_0x4d32db[_0x88c7('0x3a')];_0x5b74ab+=0x1){_0x1115f3=_0x4d32db[_0x5b74ab];if(_[_0x88c7('0x3b')](_0x5d5980[_0x88c7('0x1b')][_0x1115f3['id']])){_0x5d5980[_0x88c7('0x1b')][_0x1115f3['id']]=new VtigerAccount(_0x1115f3);}else{_0x5d5980[_0x88c7('0x39')](_0x5d5980[_0x88c7('0x1b')][_0x1115f3['id']],_0x1115f3);}}}return _0x5d5980['vtigerAccounts'];};};Realtime['prototype']['initServicenowAccounts']=function(){var _0x1c1cd6=this;return function(_0x26f147){if(_0x26f147){freeIsNotKey(_0x26f147,_0x1c1cd6[_0x88c7('0x1c')],'id');for(var _0x383f49=0x0,_0x32adcc={},_0x41d363={};_0x383f49<_0x26f147[_0x88c7('0x3a')];_0x383f49+=0x1){_0x32adcc=_0x26f147[_0x383f49];if(_[_0x88c7('0x3b')](_0x1c1cd6[_0x88c7('0x1c')][_0x32adcc['id']])){_0x1c1cd6[_0x88c7('0x1c')][_0x32adcc['id']]=new ServicenowAccount(_0x32adcc);}else{_0x1c1cd6['mergeFromDatabase'](_0x1c1cd6['servicenowAccounts'][_0x32adcc['id']],_0x32adcc);}}}return _0x1c1cd6[_0x88c7('0x1c')];};};Realtime[_0x88c7('0x38')][_0x88c7('0x48')]=function(){var _0xd1fb2a=this;return function(_0x42519b){if(_0x42519b){freeIsNotKey(_0x42519b,_0xd1fb2a['dynamics365Accounts'],'id');for(var _0x36105a=0x0,_0xb1f484={},_0x18a1dc={};_0x36105a<_0x42519b[_0x88c7('0x3a')];_0x36105a+=0x1){_0xb1f484=_0x42519b[_0x36105a];if(_['isUndefined'](_0xd1fb2a[_0x88c7('0x1d')][_0xb1f484['id']])){_0xd1fb2a[_0x88c7('0x1d')][_0xb1f484['id']]=new Dynamics365Account(_0xb1f484);}else{_0xd1fb2a[_0x88c7('0x39')](_0xd1fb2a[_0x88c7('0x1d')][_0xb1f484['id']],_0xb1f484);}}}return _0xd1fb2a[_0x88c7('0x1d')];};};Realtime[_0x88c7('0x38')][_0x88c7('0x49')]=function(){var _0x4418c0=this;return function(_0x3fa624){if(_0x3fa624){freeIsNotKey(_0x3fa624,_0x4418c0[_0x88c7('0x4a')],'id');for(var _0x3f527a=0x0,_0x24f195={},_0x5312b4={};_0x3f527a<_0x3fa624[_0x88c7('0x3a')];_0x3f527a+=0x1){_0x24f195=_0x3fa624[_0x3f527a];if(_['isUndefined'](_0x4418c0[_0x88c7('0x4a')][_0x24f195['id']])){_0x4418c0['freshsalesAccounts'][_0x24f195['id']]=new FreshsalesAccount(_0x24f195);}else{_0x4418c0[_0x88c7('0x39')](_0x4418c0['freshsalesAccounts'][_0x24f195['id']],_0x24f195);}}}return _0x4418c0[_0x88c7('0x4a')];};};Realtime['prototype'][_0x88c7('0x4b')]=function(){var _0x97842e=this;return function(_0x14dbda){for(var _0x49a0b1=0x0;_0x49a0b1<_0x14dbda[_0x88c7('0x3a')];_0x49a0b1+=0x1){_[_0x88c7('0x4c')](_0x97842e[_0x88c7('0x11')][_0x14dbda[_0x49a0b1]['name']],_0x14dbda[_0x49a0b1]);}return _0x97842e['voiceQueues'];};};Realtime[_0x88c7('0x38')][_0x88c7('0x4d')]=function(){var _0x5332ae=this;return function(_0x47ed70){clearVoiceQueues(_0x5332ae[_0x88c7('0x11')]);if(_0x47ed70){_0x47ed70=_['groupBy'](_0x47ed70,_0x88c7('0x4e'));for(var _0x3a3d27 in _0x47ed70){if(_0x47ed70[_0x88c7('0x1f')](_0x3a3d27)){var _0x537acb={};for(var _0x21317b=0x0;_0x21317b<_0x47ed70[_0x3a3d27][_0x88c7('0x3a')];_0x21317b+=0x1){var _0x1a48b6=_0x47ed70[_0x3a3d27][_0x21317b]['queue'];if(_0x5332ae[_0x88c7('0x11')][_0x1a48b6]){if(_0x47ed70[_0x3a3d27][_0x21317b]['queuecallerexit']){_0x5332ae['voiceQueues'][_0x1a48b6][_0x88c7('0x2c')]+=0x1;}if(_0x47ed70[_0x3a3d27][_0x21317b]['queuecallerabandon']){_0x5332ae[_0x88c7('0x11')][_0x1a48b6][_0x88c7('0x2d')]+=0x1;}_0x5332ae['voiceQueues'][_0x1a48b6][_0x88c7('0x27')]+=moment(_0x47ed70[_0x3a3d27][_0x21317b]['queuecallerleaveAt'])['diff'](moment(_0x47ed70[_0x3a3d27][_0x21317b]['queuecallerjoinAt']),_0x88c7('0x4f'))||0x0;if(_0x21317b===_0x47ed70[_0x3a3d27][_0x88c7('0x3a')]-0x1){_0x5332ae[_0x88c7('0x11')][_0x1a48b6][_0x88c7('0x28')]+=moment(_0x47ed70[_0x3a3d27][_0x21317b][_0x88c7('0x50')]||_0x47ed70[_0x3a3d27][_0x21317b]['queuecallerabandonAt']||_0x47ed70[_0x3a3d27][_0x21317b][_0x88c7('0x51')])['diff'](moment(_0x47ed70[_0x3a3d27][_0x21317b]['queuecallerjoinAt']),_0x88c7('0x4f'))||0x0;_0x5332ae['voiceQueues'][_0x1a48b6]['total']+=0x1;if(_0x47ed70[_0x3a3d27][_0x21317b][_0x88c7('0x52')]){_0x5332ae[_0x88c7('0x11')][_0x1a48b6][_0x88c7('0x26')]+=0x1;_0x5332ae[_0x88c7('0x11')][_0x1a48b6][_0x88c7('0x29')]+=moment(_0x47ed70[_0x3a3d27][_0x21317b][_0x88c7('0x50')])['diff'](moment(_0x47ed70[_0x3a3d27][_0x21317b]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0x5332ae[_0x88c7('0x11')][_0x1a48b6][_0x88c7('0x28')]+=_0x5332ae[_0x88c7('0x11')][_0x1a48b6][_0x88c7('0x27')]||0x0;}}}}}}return _0x5332ae[_0x88c7('0x11')];};};Realtime[_0x88c7('0x38')][_0x88c7('0x53')]=function(){var _0x12956e=this;return function(_0x568c03){clearVoiceCallReports(_0x12956e[_0x88c7('0x13')]);if(_0x568c03){for(var _0x49e36d=0x0;_0x49e36d<_0x568c03[_0x88c7('0x3a')];_0x49e36d+=0x1){_0x12956e[_0x88c7('0x13')][_0x88c7('0x25')]+=0x1;_0x12956e[_0x88c7('0x13')][_0x88c7('0x28')]+=_0x568c03[_0x49e36d][_0x88c7('0x54')];if(_0x568c03[_0x49e36d][_0x88c7('0x55')]===_0x88c7('0x56')){_0x12956e['outbound'][_0x88c7('0x26')]+=0x1;_0x12956e[_0x88c7('0x13')]['sumHoldTime']+=_0x568c03[_0x49e36d]['duration']-_0x568c03[_0x49e36d][_0x88c7('0x57')]||0x0;_0x12956e[_0x88c7('0x13')][_0x88c7('0x29')]+=_0x568c03[_0x49e36d]['billableseconds'];}}}return _0x12956e[_0x88c7('0x13')];};};Realtime[_0x88c7('0x38')][_0x88c7('0x58')]=function(){var _0x510115=this;return function(_0x33ab77){if(_0x33ab77){freeIsNotKey(_0x33ab77,_0x510115[_0x88c7('0x12')],_0x88c7('0x22'));for(var _0x285f23=0x0,_0x18d971={};_0x285f23<_0x33ab77[_0x88c7('0x3a')];_0x285f23+=0x1){_0x18d971=_0x33ab77[_0x285f23];if(_['isUndefined'](_0x510115[_0x88c7('0x12')][_0x18d971[_0x88c7('0x22')]])){_0x510115[_0x88c7('0x12')][_0x18d971[_0x88c7('0x22')]]=new Campaign(_0x18d971);}else{_0x510115[_0x88c7('0x39')](_0x510115[_0x88c7('0x12')][_0x18d971['name']],_0x18d971);_0x510115['campaigns'][_0x18d971[_0x88c7('0x22')]][_0x88c7('0x59')]=_0x18d971['SquareProject']?_0x18d971[_0x88c7('0x5a')][_0x88c7('0x22')]:undefined;}}}return _0x510115['campaigns'];};};Realtime[_0x88c7('0x38')][_0x88c7('0x5b')]=function(){var _0x376e7e=this;return function(_0x5378ac){if(_0x5378ac){freeIsNotKey(_0x5378ac,_0x376e7e[_0x88c7('0x5c')],'id');for(var _0x173045=0x0,_0x267cad={};_0x173045<_0x5378ac['length'];_0x173045+=0x1){_0x267cad=_0x5378ac[_0x173045];if(_[_0x88c7('0x3b')](_0x376e7e[_0x88c7('0x5c')][_0x267cad['id']])){_0x376e7e[_0x88c7('0x5c')][_0x267cad['id']]=new VoiceExtension(_0x267cad);}else{_0x376e7e[_0x88c7('0x39')](_0x376e7e[_0x88c7('0x5c')][_0x267cad['id']],_0x267cad);}}}return _0x376e7e[_0x88c7('0x5c')];};};Realtime[_0x88c7('0x38')][_0x88c7('0x5d')]=function(){var _0x11a243=this;return function(_0x364929){clearCampaigns(_0x11a243[_0x88c7('0x12')]);for(var _0x93c79c=0x0;_0x93c79c<_0x364929[_0x88c7('0x3a')];_0x93c79c+=0x1){_['merge'](_0x11a243[_0x88c7('0x12')][_0x364929[_0x93c79c][_0x88c7('0x22')]],_0x364929[_0x93c79c]);}return _0x11a243[_0x88c7('0x12')];};};Realtime[_0x88c7('0x38')]['initFaxAccounts']=function(){var _0x64decd=this;return function(_0x56f7a9){if(_0x56f7a9){freeIsNotKey(_0x56f7a9,_0x64decd[_0x88c7('0x5e')],'id');for(var _0x3811ac=0x0,_0x54c08a={},_0x47e8a5={};_0x3811ac<_0x56f7a9[_0x88c7('0x3a')];_0x3811ac+=0x1){_0x54c08a=_0x56f7a9[_0x3811ac];if(_[_0x88c7('0x3b')](_0x64decd['faxAccounts'][_0x54c08a['id']])){_0x64decd[_0x88c7('0x5e')][_0x54c08a['id']]=new FaxAccount(_0x54c08a);}else{_0x64decd[_0x88c7('0x39')](_0x64decd[_0x88c7('0x5e')][_0x54c08a['id']],_0x54c08a);}}}return _0x64decd['faxAccounts'];};};module['exports']=Realtime; \ No newline at end of file +var _0x0334=['total','queuecallercomplete','queuecallercompleteAt','queuecallerleaveAt','initVoiceCallReports','duration','disposition','billableseconds','campaigns','dialQueueProject','SquareProject','initCampaignHopperHistory','initFaxAccounts','exports','bluebird','util','lodash','../model/trunk','../model/voiceQueue','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','telephones','voiceQueues','triggers','templates','outbound','voiceExtensions','channels','timers','settings','zendeskAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','vtigerAccounts','servicenowAccounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','SIP/%s','name','isNil','interface','format','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','answered','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','agents','length','isUndefined','initTelephones','initTrunks','trunks','initVoiceQueues','initTriggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','salesforceAccounts','initZohoAccounts','initDeskAccounts','deskAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','dynamics365Accounts','merge','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','queuecallerjoinAt','queuecallerabandonAt','queuecallerexitAt','diff','seconds'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x0334,0x14c));var _0x4033=function(_0x23ccc4,_0x2d2059){_0x23ccc4=_0x23ccc4-0x0;var _0xb6498d=_0x0334[_0x23ccc4];return _0xb6498d;};'use strict';var BPromise=require(_0x4033('0x0'));var util=require(_0x4033('0x1'));var _=require(_0x4033('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Telephone=require('../model/telephone');var Trunk=require(_0x4033('0x3'));var VoiceQueue=require(_0x4033('0x4'));var Trigger=require('../model/trigger');var Template=require('../model/template');var Campaign=require(_0x4033('0x5'));var VoiceExtension=require(_0x4033('0x6'));var ZendeskAccount=require(_0x4033('0x7'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0x4033('0x8'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0x4033('0x9'));var VtigerAccount=require(_0x4033('0xa'));var ServicenowAccount=require(_0x4033('0xb'));var Dynamics365Account=require(_0x4033('0xc'));var FreshsalesAccount=require(_0x4033('0xd'));var FaxAccount=require(_0x4033('0xe'));var Realtime=function(){this['agents']={};this[_0x4033('0xf')]={};this['trunks']={};this[_0x4033('0x10')]={};this[_0x4033('0x11')]={};this['campaigns']={};this[_0x4033('0x12')]={};this[_0x4033('0x13')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x4033('0x14')]={};this[_0x4033('0x15')]={};this['queueChannels']={};this['outboundChannels']={};this[_0x4033('0x16')]={};this[_0x4033('0x17')]={};this[_0x4033('0x18')]={};this['salesforceAccounts']={};this[_0x4033('0x19')]={};this[_0x4033('0x1a')]={};this[_0x4033('0x1b')]={};this['deskAccounts']={};this[_0x4033('0x1c')]={};this[_0x4033('0x1d')]={};this['dynamics365Accounts']={};this[_0x4033('0x1e')]={};this[_0x4033('0x1f')]={};};function freeIsNotKey(_0x47d1ca,_0x1013fb,_0x29ba24){var _0x29c0d4=_[_0x4033('0x20')](_0x47d1ca,function(_0xa20b53,_0xa2318e){return _0xa20b53[_0x29ba24];});for(var _0x2e1ccc in _0x1013fb){if(_0x1013fb[_0x4033('0x21')](_0x2e1ccc)){if(!_0x29c0d4[_0x2e1ccc]){delete _0x1013fb[_0x2e1ccc];}}}}function freeIsNotKeySip(_0x20de76,_0x34936b){var _0x18ec7a=_[_0x4033('0x20')](_0x20de76,function(_0x5933f0,_0x19195b){return util['format'](_0x4033('0x22'),_0x5933f0[_0x4033('0x23')]);});for(var _0x56a16d in _0x34936b){if(_0x34936b['hasOwnProperty'](_0x56a16d)){if(!_0x18ec7a[_0x56a16d]){delete _0x34936b[_0x56a16d];}}}}function freeIsNotKeyAgent(_0x4eddbd,_0x31630f){var _0x568f9d=_[_0x4033('0x20')](_0x4eddbd,function(_0x17a6e3,_0xea6f8c){var _0x596b95=_[_0x4033('0x24')](_0x17a6e3[_0x4033('0x25')])?util[_0x4033('0x26')]('SIP/%s',_0x17a6e3[_0x4033('0x23')]):_0x17a6e3[_0x4033('0x25')];return _0x596b95;});for(var _0x28677d in _0x31630f){if(_0x31630f[_0x4033('0x21')](_0x28677d)){if(!_0x568f9d[_0x28677d]){delete _0x31630f[_0x28677d];}}}}function clearVoiceCallReports(_0x407b60){_0x407b60['total']=0x0;_0x407b60['answered']=0x0;_0x407b60[_0x4033('0x27')]=0x0;_0x407b60[_0x4033('0x28')]=0x0;_0x407b60[_0x4033('0x29')]=0x0;}function clearCampaigns(_0x298c1d){if(!_[_0x4033('0x2a')](_0x298c1d)){for(var _0x1e7b36 in _0x298c1d){if(_0x298c1d['hasOwnProperty'](_0x1e7b36)){_0x298c1d[_0x1e7b36][_0x4033('0x2b')]=0x0;_0x298c1d[_0x1e7b36][_0x4033('0x2c')]=0x0;}}}}function clearVoiceQueues(_0x12115e){if(!_[_0x4033('0x2a')](_0x12115e)){for(var _0x4d36a4 in _0x12115e){if(_0x12115e[_0x4033('0x21')](_0x4d36a4)){_0x12115e[_0x4d36a4]['total']=0x0;_0x12115e[_0x4d36a4][_0x4033('0x2d')]=0x0;_0x12115e[_0x4d36a4][_0x4033('0x2e')]=0x0;_0x12115e[_0x4d36a4][_0x4033('0x2f')]=0x0;_0x12115e[_0x4d36a4][_0x4033('0x27')]=0x0;_0x12115e[_0x4d36a4]['sumDuration']=0x0;_0x12115e[_0x4d36a4][_0x4033('0x29')]=0x0;_0x12115e[_0x4d36a4][_0x4033('0x30')]=0x0;_0x12115e[_0x4d36a4][_0x4033('0x31')]=0x0;_0x12115e[_0x4d36a4][_0x4033('0x32')]=0x0;_0x12115e[_0x4d36a4][_0x4033('0x33')]=0x0;_0x12115e[_0x4d36a4]['outboundNoSuchCallsDay']=0x0;_0x12115e[_0x4d36a4]['outboundUnknownCallsDay']=0x0;_0x12115e[_0x4d36a4][_0x4033('0x34')]=0x0;_0x12115e[_0x4d36a4]['outboundDropCallsDayCallersExit']=0x0;_0x12115e[_0x4d36a4][_0x4033('0x35')]=0x0;_0x12115e[_0x4d36a4][_0x4033('0x36')]=0x0;_0x12115e[_0x4d36a4][_0x4033('0x37')]=0x0;_0x12115e[_0x4d36a4][_0x4033('0x38')]=0x0;_0x12115e[_0x4d36a4][_0x4033('0x30')]=0x0;_0x12115e[_0x4d36a4][_0x4033('0x39')]=0x0;_0x12115e[_0x4d36a4][_0x4033('0x3a')]=!![];}}}}Realtime[_0x4033('0x3b')][_0x4033('0x3c')]=function(_0x32b6c7,_0x539074){for(var _0x1d9130 in _0x539074){if(_0x32b6c7['hasOwnProperty'](_0x1d9130)){_0x32b6c7[_0x1d9130]=_0x539074[_0x1d9130];}}};Realtime[_0x4033('0x3b')][_0x4033('0x3d')]=function(){var _0x5aabb5=this;return function(_0xf72e45){if(_0xf72e45){freeIsNotKeyAgent(_0xf72e45,_0x5aabb5[_0x4033('0x3e')]);for(var _0x13087e=0x0,_0x530d6c={},_0x2ff269={};_0x13087e<_0xf72e45[_0x4033('0x3f')];_0x13087e+=0x1){_0x530d6c=_0xf72e45[_0x13087e];var _0x48bfe5=_['isNil'](_0x530d6c[_0x4033('0x25')])?util[_0x4033('0x26')]('SIP/%s',_0x530d6c[_0x4033('0x23')]):_0x530d6c[_0x4033('0x25')];if(_[_0x4033('0x40')](_0x5aabb5[_0x4033('0x3e')][_0x48bfe5])){_0x5aabb5[_0x4033('0x3e')][_0x48bfe5]=new Agent(_0x530d6c);}else{_0x5aabb5[_0x4033('0x3c')](_0x5aabb5[_0x4033('0x3e')][_0x48bfe5],_0x530d6c);}}}return _0x5aabb5['agents'];};};Realtime[_0x4033('0x3b')][_0x4033('0x41')]=function(){var _0x2fdf8f=this;return function(_0x2e96c9){if(_0x2e96c9){freeIsNotKeySip(_0x2e96c9,_0x2fdf8f[_0x4033('0xf')]);for(var _0x27dc86=0x0,_0x353608={},_0x17e06c={};_0x27dc86<_0x2e96c9[_0x4033('0x3f')];_0x27dc86+=0x1){_0x353608=_0x2e96c9[_0x27dc86];if(_[_0x4033('0x40')](_0x2fdf8f['telephones'][util[_0x4033('0x26')](_0x4033('0x22'),_0x353608['name'])])){_0x2fdf8f[_0x4033('0xf')][util[_0x4033('0x26')]('SIP/%s',_0x353608[_0x4033('0x23')])]=new Telephone(_0x353608);}else{_0x2fdf8f[_0x4033('0x3c')](_0x2fdf8f[_0x4033('0xf')][util['format'](_0x4033('0x22'),_0x353608[_0x4033('0x23')])],_0x353608);}}}return _0x2fdf8f[_0x4033('0xf')];};};Realtime[_0x4033('0x3b')][_0x4033('0x42')]=function(){var _0x473225=this;return function(_0x3aa4f5){if(_0x3aa4f5){freeIsNotKeySip(_0x3aa4f5,_0x473225[_0x4033('0x43')]);for(var _0x477bde=0x0,_0x4abc04={},_0x561686={};_0x477bde<_0x3aa4f5[_0x4033('0x3f')];_0x477bde+=0x1){_0x4abc04=_0x3aa4f5[_0x477bde];if(_[_0x4033('0x40')](_0x473225['trunks'][util[_0x4033('0x26')](_0x4033('0x22'),_0x4abc04[_0x4033('0x23')])])){_0x473225['trunks'][util[_0x4033('0x26')]('SIP/%s',_0x4abc04['name'])]=new Trunk(_0x4abc04);}else{_0x473225[_0x4033('0x3c')](_0x473225[_0x4033('0x43')][util[_0x4033('0x26')](_0x4033('0x22'),_0x4abc04[_0x4033('0x23')])],_0x4abc04);}}}return _0x473225['trunks'];};};Realtime[_0x4033('0x3b')][_0x4033('0x44')]=function(){var _0x4d9e1f=this;return function(_0x4de6aa){if(_0x4de6aa){freeIsNotKey(_0x4de6aa,_0x4d9e1f[_0x4033('0x10')],_0x4033('0x23'));for(var _0x58e173=0x0,_0x2ce338={},_0x161825={};_0x58e173<_0x4de6aa[_0x4033('0x3f')];_0x58e173+=0x1){_0x2ce338=_0x4de6aa[_0x58e173];if(_[_0x4033('0x40')](_0x4d9e1f[_0x4033('0x10')][_0x2ce338[_0x4033('0x23')]])){_0x4d9e1f['voiceQueues'][_0x2ce338['name']]=new VoiceQueue(_0x2ce338);}else{_0x4d9e1f[_0x4033('0x3c')](_0x4d9e1f[_0x4033('0x10')][_0x2ce338[_0x4033('0x23')]],_0x2ce338);}}}return _0x4d9e1f[_0x4033('0x10')];};};Realtime['prototype'][_0x4033('0x45')]=function(){var _0x405e86=this;return function(_0x39afad){if(_0x39afad){freeIsNotKey(_0x39afad,_0x405e86[_0x4033('0x11')],'id');for(var _0x432496=0x0,_0x34c735={},_0x19d901={};_0x432496<_0x39afad[_0x4033('0x3f')];_0x432496+=0x1){_0x34c735=_0x39afad[_0x432496];if(_[_0x4033('0x40')](_0x405e86['triggers'][_0x34c735['id']])){_0x405e86[_0x4033('0x11')][_0x34c735['id']]=new Trigger(_0x34c735);}else{_0x405e86[_0x4033('0x3c')](_0x405e86[_0x4033('0x11')][_0x34c735['id']],_0x34c735);}}}return _0x405e86[_0x4033('0x11')];};};Realtime['prototype'][_0x4033('0x46')]=function(){var _0x1129ef=this;return function(_0x1d447c){if(_0x1d447c){freeIsNotKey(_0x1d447c,_0x1129ef['templates'],'id');for(var _0x5c4e36=0x0,_0x393b81={},_0x378445={};_0x5c4e36<_0x1d447c[_0x4033('0x3f')];_0x5c4e36+=0x1){_0x393b81=_0x1d447c[_0x5c4e36];if(_[_0x4033('0x40')](_0x1129ef[_0x4033('0x12')][_0x393b81['id']])){_0x1129ef['templates'][_0x393b81['id']]=new Template(_0x393b81);}else{_0x1129ef[_0x4033('0x3c')](_0x1129ef[_0x4033('0x12')][_0x393b81['id']],_0x393b81);}}}return _0x1129ef[_0x4033('0x12')];};};Realtime['prototype'][_0x4033('0x47')]=function(){var _0x27086c=this;return function(_0x26139d){if(_0x26139d){freeIsNotKey(_0x26139d,_0x27086c['zendeskAccounts'],'id');for(var _0x463813=0x0,_0x330865={},_0xc3af={};_0x463813<_0x26139d['length'];_0x463813+=0x1){_0x330865=_0x26139d[_0x463813];if(_['isUndefined'](_0x27086c['zendeskAccounts'][_0x330865['id']])){_0x27086c[_0x4033('0x18')][_0x330865['id']]=new ZendeskAccount(_0x330865);}else{_0x27086c['mergeFromDatabase'](_0x27086c[_0x4033('0x18')][_0x330865['id']],_0x330865);}}}return _0x27086c['zendeskAccounts'];};};Realtime[_0x4033('0x3b')][_0x4033('0x48')]=function(){var _0xd2b79=this;return function(_0x5206fa){if(_0x5206fa){freeIsNotKey(_0x5206fa,_0xd2b79[_0x4033('0x49')],'id');for(var _0x5f092c=0x0,_0x4b55ae={},_0x10db47={};_0x5f092c<_0x5206fa[_0x4033('0x3f')];_0x5f092c+=0x1){_0x4b55ae=_0x5206fa[_0x5f092c];if(_[_0x4033('0x40')](_0xd2b79[_0x4033('0x49')][_0x4b55ae['id']])){_0xd2b79['salesforceAccounts'][_0x4b55ae['id']]=new SalesforceAccount(_0x4b55ae);}else{_0xd2b79[_0x4033('0x3c')](_0xd2b79[_0x4033('0x49')][_0x4b55ae['id']],_0x4b55ae);}}}return _0xd2b79['salesforceAccounts'];};};Realtime[_0x4033('0x3b')]['initFreshdeskAccounts']=function(){var _0x5c5261=this;return function(_0x195fb8){if(_0x195fb8){freeIsNotKey(_0x195fb8,_0x5c5261['freshdeskAccounts'],'id');for(var _0x3e610d=0x0,_0x2dcdec={},_0x2c0c7a={};_0x3e610d<_0x195fb8[_0x4033('0x3f')];_0x3e610d+=0x1){_0x2dcdec=_0x195fb8[_0x3e610d];if(_[_0x4033('0x40')](_0x5c5261[_0x4033('0x1a')][_0x2dcdec['id']])){_0x5c5261[_0x4033('0x1a')][_0x2dcdec['id']]=new FreshdeskAccount(_0x2dcdec);}else{_0x5c5261[_0x4033('0x3c')](_0x5c5261[_0x4033('0x1a')][_0x2dcdec['id']],_0x2dcdec);}}}return _0x5c5261['freshdeskAccounts'];};};Realtime[_0x4033('0x3b')][_0x4033('0x4a')]=function(){var _0x4c7155=this;return function(_0x37f464){if(_0x37f464){freeIsNotKey(_0x37f464,_0x4c7155[_0x4033('0x1b')],'id');for(var _0x1c406b=0x0,_0x4e2c83={},_0x375be8={};_0x1c406b<_0x37f464['length'];_0x1c406b+=0x1){_0x4e2c83=_0x37f464[_0x1c406b];if(_[_0x4033('0x40')](_0x4c7155['zohoAccounts'][_0x4e2c83['id']])){_0x4c7155[_0x4033('0x1b')][_0x4e2c83['id']]=new ZohoAccount(_0x4e2c83);}else{_0x4c7155[_0x4033('0x3c')](_0x4c7155['zohoAccounts'][_0x4e2c83['id']],_0x4e2c83);}}}return _0x4c7155[_0x4033('0x1b')];};};Realtime['prototype'][_0x4033('0x4b')]=function(){var _0x4f80ba=this;return function(_0x3997d2){if(_0x3997d2){freeIsNotKey(_0x3997d2,_0x4f80ba[_0x4033('0x4c')],'id');for(var _0x24fb4c=0x0,_0x504dec={},_0x37fdf1={};_0x24fb4c<_0x3997d2['length'];_0x24fb4c+=0x1){_0x504dec=_0x3997d2[_0x24fb4c];if(_['isUndefined'](_0x4f80ba['deskAccounts'][_0x504dec['id']])){_0x4f80ba[_0x4033('0x4c')][_0x504dec['id']]=new DeskAccount(_0x504dec);}else{_0x4f80ba[_0x4033('0x3c')](_0x4f80ba[_0x4033('0x4c')][_0x504dec['id']],_0x504dec);}}}return _0x4f80ba[_0x4033('0x4c')];};};Realtime[_0x4033('0x3b')]['initSugarcrmAccounts']=function(){var _0x5cccc3=this;return function(_0x3f3307){if(_0x3f3307){freeIsNotKey(_0x3f3307,_0x5cccc3[_0x4033('0x19')],'id');for(var _0x3c236f=0x0,_0x3378dc={},_0x2a49e3={};_0x3c236f<_0x3f3307[_0x4033('0x3f')];_0x3c236f+=0x1){_0x3378dc=_0x3f3307[_0x3c236f];if(_[_0x4033('0x40')](_0x5cccc3['sugarcrmAccounts'][_0x3378dc['id']])){_0x5cccc3[_0x4033('0x19')][_0x3378dc['id']]=new SugarcrmAccount(_0x3378dc);}else{_0x5cccc3['mergeFromDatabase'](_0x5cccc3['sugarcrmAccounts'][_0x3378dc['id']],_0x3378dc);}}}return _0x5cccc3['sugarcrmAccounts'];};};Realtime['prototype'][_0x4033('0x4d')]=function(){var _0x5d611b=this;return function(_0x226fb8){if(_0x226fb8){freeIsNotKey(_0x226fb8,_0x5d611b[_0x4033('0x1c')],'id');for(var _0x5c583f=0x0,_0x559730={},_0x61a63f={};_0x5c583f<_0x226fb8[_0x4033('0x3f')];_0x5c583f+=0x1){_0x559730=_0x226fb8[_0x5c583f];if(_[_0x4033('0x40')](_0x5d611b[_0x4033('0x1c')][_0x559730['id']])){_0x5d611b[_0x4033('0x1c')][_0x559730['id']]=new VtigerAccount(_0x559730);}else{_0x5d611b[_0x4033('0x3c')](_0x5d611b[_0x4033('0x1c')][_0x559730['id']],_0x559730);}}}return _0x5d611b['vtigerAccounts'];};};Realtime[_0x4033('0x3b')][_0x4033('0x4e')]=function(){var _0x84cc85=this;return function(_0x520f74){if(_0x520f74){freeIsNotKey(_0x520f74,_0x84cc85['servicenowAccounts'],'id');for(var _0x24f2ce=0x0,_0x12027d={},_0xcbe83b={};_0x24f2ce<_0x520f74[_0x4033('0x3f')];_0x24f2ce+=0x1){_0x12027d=_0x520f74[_0x24f2ce];if(_[_0x4033('0x40')](_0x84cc85['servicenowAccounts'][_0x12027d['id']])){_0x84cc85['servicenowAccounts'][_0x12027d['id']]=new ServicenowAccount(_0x12027d);}else{_0x84cc85['mergeFromDatabase'](_0x84cc85[_0x4033('0x1d')][_0x12027d['id']],_0x12027d);}}}return _0x84cc85['servicenowAccounts'];};};Realtime['prototype'][_0x4033('0x4f')]=function(){var _0x44182f=this;return function(_0x592436){if(_0x592436){freeIsNotKey(_0x592436,_0x44182f[_0x4033('0x50')],'id');for(var _0x44a9b4=0x0,_0x13b7d0={},_0x31c78c={};_0x44a9b4<_0x592436[_0x4033('0x3f')];_0x44a9b4+=0x1){_0x13b7d0=_0x592436[_0x44a9b4];if(_['isUndefined'](_0x44182f['dynamics365Accounts'][_0x13b7d0['id']])){_0x44182f[_0x4033('0x50')][_0x13b7d0['id']]=new Dynamics365Account(_0x13b7d0);}else{_0x44182f[_0x4033('0x3c')](_0x44182f[_0x4033('0x50')][_0x13b7d0['id']],_0x13b7d0);}}}return _0x44182f[_0x4033('0x50')];};};Realtime[_0x4033('0x3b')]['initFreshsalesAccounts']=function(){var _0x33b7d8=this;return function(_0xcedfbb){if(_0xcedfbb){freeIsNotKey(_0xcedfbb,_0x33b7d8[_0x4033('0x1e')],'id');for(var _0x25f919=0x0,_0x46a148={},_0xdc6097={};_0x25f919<_0xcedfbb['length'];_0x25f919+=0x1){_0x46a148=_0xcedfbb[_0x25f919];if(_[_0x4033('0x40')](_0x33b7d8[_0x4033('0x1e')][_0x46a148['id']])){_0x33b7d8['freshsalesAccounts'][_0x46a148['id']]=new FreshsalesAccount(_0x46a148);}else{_0x33b7d8[_0x4033('0x3c')](_0x33b7d8[_0x4033('0x1e')][_0x46a148['id']],_0x46a148);}}}return _0x33b7d8[_0x4033('0x1e')];};};Realtime[_0x4033('0x3b')]['initVoiceQueueHopperHistory']=function(){var _0x28464c=this;return function(_0x5f57c1){for(var _0x2bdfba=0x0;_0x2bdfba<_0x5f57c1[_0x4033('0x3f')];_0x2bdfba+=0x1){_[_0x4033('0x51')](_0x28464c['voiceQueues'][_0x5f57c1[_0x2bdfba][_0x4033('0x23')]],_0x5f57c1[_0x2bdfba]);}return _0x28464c[_0x4033('0x10')];};};Realtime[_0x4033('0x3b')]['initVoiceQueueReports']=function(){var _0x2d20be=this;return function(_0x3313d2){clearVoiceQueues(_0x2d20be[_0x4033('0x10')]);if(_0x3313d2){_0x3313d2=_[_0x4033('0x52')](_0x3313d2,_0x4033('0x53'));for(var _0xfc6c65 in _0x3313d2){if(_0x3313d2[_0x4033('0x21')](_0xfc6c65)){var _0x2091f7={};for(var _0x264493=0x0;_0x264493<_0x3313d2[_0xfc6c65][_0x4033('0x3f')];_0x264493+=0x1){var _0x1c0ca1=_0x3313d2[_0xfc6c65][_0x264493][_0x4033('0x54')];if(_0x2d20be[_0x4033('0x10')][_0x1c0ca1]){if(_0x3313d2[_0xfc6c65][_0x264493][_0x4033('0x55')]){_0x2d20be[_0x4033('0x10')][_0x1c0ca1]['unmanaged']+=0x1;}if(_0x3313d2[_0xfc6c65][_0x264493][_0x4033('0x56')]){_0x2d20be['voiceQueues'][_0x1c0ca1][_0x4033('0x2f')]+=0x1;}_0x2d20be['voiceQueues'][_0x1c0ca1]['sumHoldTime']+=moment(_0x3313d2[_0xfc6c65][_0x264493]['queuecallerleaveAt'])['diff'](moment(_0x3313d2[_0xfc6c65][_0x264493][_0x4033('0x57')]),'seconds')||0x0;if(_0x264493===_0x3313d2[_0xfc6c65][_0x4033('0x3f')]-0x1){_0x2d20be[_0x4033('0x10')][_0x1c0ca1]['sumDuration']+=moment(_0x3313d2[_0xfc6c65][_0x264493]['queuecallercompleteAt']||_0x3313d2[_0xfc6c65][_0x264493][_0x4033('0x58')]||_0x3313d2[_0xfc6c65][_0x264493][_0x4033('0x59')])[_0x4033('0x5a')](moment(_0x3313d2[_0xfc6c65][_0x264493][_0x4033('0x57')]),_0x4033('0x5b'))||0x0;_0x2d20be[_0x4033('0x10')][_0x1c0ca1][_0x4033('0x5c')]+=0x1;if(_0x3313d2[_0xfc6c65][_0x264493][_0x4033('0x5d')]){_0x2d20be[_0x4033('0x10')][_0x1c0ca1][_0x4033('0x2d')]+=0x1;_0x2d20be[_0x4033('0x10')][_0x1c0ca1][_0x4033('0x29')]+=moment(_0x3313d2[_0xfc6c65][_0x264493][_0x4033('0x5e')])[_0x4033('0x5a')](moment(_0x3313d2[_0xfc6c65][_0x264493][_0x4033('0x5f')]),_0x4033('0x5b'))||0x0;}}else{_0x2d20be['voiceQueues'][_0x1c0ca1][_0x4033('0x28')]+=_0x2d20be[_0x4033('0x10')][_0x1c0ca1][_0x4033('0x27')]||0x0;}}}}}}return _0x2d20be[_0x4033('0x10')];};};Realtime['prototype'][_0x4033('0x60')]=function(){var _0x4062af=this;return function(_0x2c31c0){clearVoiceCallReports(_0x4062af['outbound']);if(_0x2c31c0){for(var _0x56baa8=0x0;_0x56baa8<_0x2c31c0['length'];_0x56baa8+=0x1){_0x4062af[_0x4033('0x13')][_0x4033('0x5c')]+=0x1;_0x4062af[_0x4033('0x13')][_0x4033('0x28')]+=_0x2c31c0[_0x56baa8][_0x4033('0x61')];if(_0x2c31c0[_0x56baa8][_0x4033('0x62')]==='ANSWERED'){_0x4062af[_0x4033('0x13')]['answered']+=0x1;_0x4062af[_0x4033('0x13')][_0x4033('0x27')]+=_0x2c31c0[_0x56baa8][_0x4033('0x61')]-_0x2c31c0[_0x56baa8][_0x4033('0x63')]||0x0;_0x4062af['outbound'][_0x4033('0x29')]+=_0x2c31c0[_0x56baa8][_0x4033('0x63')];}}}return _0x4062af[_0x4033('0x13')];};};Realtime[_0x4033('0x3b')]['initCampaigns']=function(){var _0x409b0a=this;return function(_0x486800){if(_0x486800){freeIsNotKey(_0x486800,_0x409b0a[_0x4033('0x64')],_0x4033('0x23'));for(var _0x5122c2=0x0,_0x57a098={};_0x5122c2<_0x486800['length'];_0x5122c2+=0x1){_0x57a098=_0x486800[_0x5122c2];if(_[_0x4033('0x40')](_0x409b0a[_0x4033('0x64')][_0x57a098[_0x4033('0x23')]])){_0x409b0a[_0x4033('0x64')][_0x57a098[_0x4033('0x23')]]=new Campaign(_0x57a098);}else{_0x409b0a[_0x4033('0x3c')](_0x409b0a[_0x4033('0x64')][_0x57a098['name']],_0x57a098);_0x409b0a['campaigns'][_0x57a098[_0x4033('0x23')]][_0x4033('0x65')]=_0x57a098[_0x4033('0x66')]?_0x57a098[_0x4033('0x66')][_0x4033('0x23')]:undefined;}}}return _0x409b0a[_0x4033('0x64')];};};Realtime['prototype']['initVoiceExtensions']=function(){var _0x355f49=this;return function(_0x2c63eb){if(_0x2c63eb){freeIsNotKey(_0x2c63eb,_0x355f49[_0x4033('0x14')],'id');for(var _0xd42457=0x0,_0x197a14={};_0xd42457<_0x2c63eb[_0x4033('0x3f')];_0xd42457+=0x1){_0x197a14=_0x2c63eb[_0xd42457];if(_[_0x4033('0x40')](_0x355f49[_0x4033('0x14')][_0x197a14['id']])){_0x355f49[_0x4033('0x14')][_0x197a14['id']]=new VoiceExtension(_0x197a14);}else{_0x355f49[_0x4033('0x3c')](_0x355f49[_0x4033('0x14')][_0x197a14['id']],_0x197a14);}}}return _0x355f49['voiceExtensions'];};};Realtime[_0x4033('0x3b')][_0x4033('0x67')]=function(){var _0x13cd4c=this;return function(_0x518401){clearCampaigns(_0x13cd4c[_0x4033('0x64')]);for(var _0x21264f=0x0;_0x21264f<_0x518401[_0x4033('0x3f')];_0x21264f+=0x1){_['merge'](_0x13cd4c[_0x4033('0x64')][_0x518401[_0x21264f][_0x4033('0x23')]],_0x518401[_0x21264f]);}return _0x13cd4c[_0x4033('0x64')];};};Realtime['prototype'][_0x4033('0x68')]=function(){var _0x5f1963=this;return function(_0x553e48){if(_0x553e48){freeIsNotKey(_0x553e48,_0x5f1963[_0x4033('0x1f')],'id');for(var _0xcdfc5=0x0,_0x36a917={},_0x43d5e6={};_0xcdfc5<_0x553e48[_0x4033('0x3f')];_0xcdfc5+=0x1){_0x36a917=_0x553e48[_0xcdfc5];if(_[_0x4033('0x40')](_0x5f1963[_0x4033('0x1f')][_0x36a917['id']])){_0x5f1963[_0x4033('0x1f')][_0x36a917['id']]=new FaxAccount(_0x36a917);}else{_0x5f1963[_0x4033('0x3c')](_0x5f1963[_0x4033('0x1f')][_0x36a917['id']],_0x36a917);}}}return _0x5f1963[_0x4033('0x1f')];};};module[_0x4033('0x69')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 54b69e5..530902b 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 _0x0c0b=['agents','telephones','prototype','sync','realtime','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','bind','custom:voiceDialReport','voiceDialReport','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find','accountcode','isNil','interface','format','length','assigned','lastAssignedTo','name','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitAt','create','match','keys','getCallType','split','getAgentByInternal','calleridnum','outbound','internal','destination','exten','lastapplication','queue','lastdata','context','from-sip','xcally-motion-preview','destinationchannel','channel','callerid','calleridpreview','originatecalleridnum','disposition','connectedlinenum','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','type','membername','monitor','monitorFilename','monitors','filename','createdAt','connectedlinename','xcally-motion-dialer','forEach','Local','indexOf','mobile','substring','lastIndexOf','SIP/%s','exports','lodash','moment','../../../config/environment','../rpc/voiceAgentReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceDialReport','./userReport'];(function(_0x5bca81,_0x5eda32){var _0x129d18=function(_0x2e3789){while(--_0x2e3789){_0x5bca81['push'](_0x5bca81['shift']());}};_0x129d18(++_0x5eda32);}(_0x0c0b,0xa6));var _0xb0c0=function(_0x28ad29,_0x1f184d){_0x28ad29=_0x28ad29-0x0;var _0x113a67=_0x0c0b[_0x28ad29];return _0x113a67;};'use strict';var _=require(_0xb0c0('0x0'));var moment=require(_0xb0c0('0x1'));var util=require('util');var config=require(_0xb0c0('0x2'));var ami=require('../ami');var RpcVoiceAgentReport=require(_0xb0c0('0x3'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0xb0c0('0x4'));var RpcVoiceQueueReport=require(_0xb0c0('0x5'));var RpcVoiceRecording=require(_0xb0c0('0x6'));var RpcVoiceTransferReport=require(_0xb0c0('0x7'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0xb0c0('0x8'));var UserReport=require(_0xb0c0('0x9'));function Report(_0x265380){this['realtime']=_0x265380;this[_0xb0c0('0xa')]=_0x265380[_0xb0c0('0xa')];this['telephones']=_0x265380[_0xb0c0('0xb')];}Report[_0xb0c0('0xc')][_0xb0c0('0xd')]=function(_0x37799f){var _0x44cd22=new VoiceQueueReport(this[_0xb0c0('0xe')]);var _0x231663=new VoiceAgentReport(this[_0xb0c0('0xe')]);var _0x3177c6=new VoiceDialReport(this[_0xb0c0('0xe')]);var _0x3cbc6e=new VoiceCallReport(this[_0xb0c0('0xe')]);var _0x2f7a76=new UserReport(this[_0xb0c0('0xe')]);if(config[_0xb0c0('0xf')]&&config[_0xb0c0('0xf')][_0xb0c0('0x10')]){ami['on'](_0xb0c0('0x11'),this[_0xb0c0('0x12')]['bind'](this));ami['on'](_0xb0c0('0x13'),this[_0xb0c0('0x14')]['bind'](this));ami['on'](_0xb0c0('0x15'),this[_0xb0c0('0x16')][_0xb0c0('0x17')](this));ami['on'](_0xb0c0('0x18'),this[_0xb0c0('0x19')][_0xb0c0('0x17')](this));ami['on']('blindtransfer',this[_0xb0c0('0x1a')][_0xb0c0('0x17')](this));ami['on'](_0xb0c0('0x1b'),this[_0xb0c0('0x1c')][_0xb0c0('0x17')](this));}};Report[_0xb0c0('0xc')][_0xb0c0('0x1d')]=function(_0x99a4b2){var _0x2194a6;_0x2194a6=_[_0xb0c0('0x1e')](this[_0xb0c0('0xa')],function(_0x4ab576){return _0x4ab576[_0xb0c0('0x1f')]==_0x99a4b2||_0x4ab576['name']==_0x99a4b2;});if(_[_0xb0c0('0x20')](_0x2194a6)){var _0x2b428b=_[_0xb0c0('0x1e')](this[_0xb0c0('0xb')],function(_0x12ba62){return _0x12ba62['accountcode']==_0x99a4b2||_0x12ba62['name']==_0x99a4b2;});if(_0x2b428b){_0x2194a6=_['find'](this[_0xb0c0('0xa')],function(_0x3e6337){return _0x3e6337[_0xb0c0('0x21')]==util[_0xb0c0('0x22')]('SIP/%s',_0x2b428b['name']);});}}return _0x2194a6;};Report[_0xb0c0('0xc')][_0xb0c0('0x12')]=function(_0x7b39ee){for(var _0x3dfb0a=0x0;_0x3dfb0a<_0x7b39ee[_0xb0c0('0x23')];_0x3dfb0a+=0x1){var _0x4612ea=this[_0xb0c0('0x1d')](_0x7b39ee[_0x3dfb0a]['connectedlinenum']);if(_0x4612ea){_0x7b39ee[_0x3dfb0a][_0xb0c0('0x1f')]=_0x4612ea[_0xb0c0('0x1f')];_0x7b39ee[_0x3dfb0a][_0xb0c0('0x24')]=!![];_0x7b39ee[_0x3dfb0a][_0xb0c0('0x25')]=_0x4612ea[_0xb0c0('0x26')];_0x7b39ee[_0x3dfb0a][_0xb0c0('0x21')]=_[_0xb0c0('0x20')](_0x4612ea[_0xb0c0('0x21')])?util[_0xb0c0('0x22')]('SIP/%s',_0x4612ea['name']):_0x4612ea['interface'];if(_0x7b39ee[_0x3dfb0a]['queuecallercomplete']){_0x7b39ee[_0x3dfb0a][_0xb0c0('0x27')]=moment()[_0xb0c0('0x22')](_0xb0c0('0x28'));}if(_0x7b39ee[_0x3dfb0a]['queuecallerexit']){_0x7b39ee[_0x3dfb0a][_0xb0c0('0x29')]=moment()[_0xb0c0('0x22')](_0xb0c0('0x28'));}RpcMemberReport[_0xb0c0('0x12')](_0x7b39ee[_0x3dfb0a]);}RpcVoiceQueueReport[_0xb0c0('0x2a')](_0x7b39ee[_0x3dfb0a]);}};function extractCalleridNumber(_0x481ccf){var _0x1d3222=_0x481ccf[_0xb0c0('0x2b')](/<(.*?)>/);return _0x1d3222?_0x1d3222[0x1]:_0x481ccf;}Report['prototype']['getAgentByInternal']=function(_0x46744f){for(var _0x1efa12=0x0;_0x1efa12','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','UserId','monitor','monitors','monitorFilename','filename','createdAt','connectedlinename','originatecalleridnum','xcally-motion-dialer','isArray','forEach','startsWith','Local','indexOf','mobile','phone','substring','blindTransfer','transfererlinkedid','attendedTransfer','exports','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','agents','telephones','sync','realtime','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','bind','blindtransfer','attendedtransfer','prototype','find','name','isNil','accountcode','interface','format','SIP/%s','length','findAgent','assigned','lastAssignedTo','queuecallercomplete','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','getAgentByInternal','keys','getCallType','channel','calleridnum','outbound','destination','exten','type','dialer','lastapplication','queue','lastdata','context','from-voip-provider','from-sip','xcally-motion-preview'];(function(_0x5d456c,_0x4cbaa9){var _0x4ccf83=function(_0x395607){while(--_0x395607){_0x5d456c['push'](_0x5d456c['shift']());}};_0x4ccf83(++_0x4cbaa9);}(_0x754a,0x1a3));var _0xa754=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0x754a[_0x54d4a8];return _0x3b321b;};'use strict';var _=require('lodash');var moment=require(_0xa754('0x0'));var util=require(_0xa754('0x1'));var config=require(_0xa754('0x2'));var ami=require(_0xa754('0x3'));var RpcVoiceAgentReport=require(_0xa754('0x4'));var RpcVoiceCallReport=require(_0xa754('0x5'));var RpcVoiceDialReport=require(_0xa754('0x6'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0xa754('0x7'));var RpcVoiceTransferReport=require(_0xa754('0x8'));var VoiceQueueReport=require(_0xa754('0x9'));var VoiceCallReport=require(_0xa754('0xa'));var VoiceAgentReport=require(_0xa754('0xb'));var VoiceDialReport=require(_0xa754('0xc'));var UserReport=require(_0xa754('0xd'));function Report(_0x108965){this['realtime']=_0x108965;this[_0xa754('0xe')]=_0x108965[_0xa754('0xe')];this[_0xa754('0xf')]=_0x108965[_0xa754('0xf')];}Report['prototype'][_0xa754('0x10')]=function(_0x579e93){var _0x218b1a=new VoiceQueueReport(this[_0xa754('0x11')]);var _0x53dae6=new VoiceAgentReport(this['realtime']);var _0x2faf79=new VoiceDialReport(this['realtime']);var _0x13e4f1=new VoiceCallReport(this['realtime']);var _0x109f1f=new UserReport(this[_0xa754('0x11')]);if(config[_0xa754('0x12')]&&config['xdr'][_0xa754('0x13')]){ami['on'](_0xa754('0x14'),this[_0xa754('0x15')]['bind'](this));ami['on'](_0xa754('0x16'),this[_0xa754('0x17')]['bind'](this));ami['on'](_0xa754('0x18'),this[_0xa754('0x19')]['bind'](this));ami['on'](_0xa754('0x1a'),this[_0xa754('0x1b')][_0xa754('0x1c')](this));ami['on'](_0xa754('0x1d'),this['blindTransfer'][_0xa754('0x1c')](this));ami['on'](_0xa754('0x1e'),this['attendedTransfer'][_0xa754('0x1c')](this));}};Report[_0xa754('0x1f')]['findAgent']=function(_0x1a4eb7){var _0x44f0c3;_0x44f0c3=_[_0xa754('0x20')](this[_0xa754('0xe')],function(_0x9031f5){return _0x9031f5['accountcode']==_0x1a4eb7||_0x9031f5[_0xa754('0x21')]==_0x1a4eb7;});if(_[_0xa754('0x22')](_0x44f0c3)){var _0x2f61f3=_[_0xa754('0x20')](this['telephones'],function(_0x3f836e){return _0x3f836e[_0xa754('0x23')]==_0x1a4eb7||_0x3f836e['name']==_0x1a4eb7;});if(_0x2f61f3){_0x44f0c3=_[_0xa754('0x20')](this[_0xa754('0xe')],function(_0x37cb8b){return _0x37cb8b[_0xa754('0x24')]==util[_0xa754('0x25')](_0xa754('0x26'),_0x2f61f3[_0xa754('0x21')]);});}}return _0x44f0c3;};Report['prototype'][_0xa754('0x15')]=function(_0x4f23bb){for(var _0x44a1f4=0x0;_0x44a1f4<_0x4f23bb[_0xa754('0x27')];_0x44a1f4+=0x1){var _0x38fc58=this[_0xa754('0x28')](_0x4f23bb[_0x44a1f4]['connectedlinenum']);if(_0x38fc58){_0x4f23bb[_0x44a1f4][_0xa754('0x23')]=_0x38fc58[_0xa754('0x23')];_0x4f23bb[_0x44a1f4][_0xa754('0x29')]=!![];_0x4f23bb[_0x44a1f4][_0xa754('0x2a')]=_0x38fc58[_0xa754('0x21')];_0x4f23bb[_0x44a1f4][_0xa754('0x24')]=_[_0xa754('0x22')](_0x38fc58['interface'])?util[_0xa754('0x25')](_0xa754('0x26'),_0x38fc58[_0xa754('0x21')]):_0x38fc58[_0xa754('0x24')];if(_0x4f23bb[_0x44a1f4][_0xa754('0x2b')]){_0x4f23bb[_0x44a1f4]['queuecallercompleteAt']=moment()['format'](_0xa754('0x2c'));}if(_0x4f23bb[_0x44a1f4][_0xa754('0x2d')]){_0x4f23bb[_0x44a1f4][_0xa754('0x2e')]=moment()[_0xa754('0x25')](_0xa754('0x2c'));}RpcMemberReport[_0xa754('0x15')](_0x4f23bb[_0x44a1f4]);}RpcVoiceQueueReport[_0xa754('0x2f')](_0x4f23bb[_0x44a1f4]);}};function extractCalleridNumber(_0x3beae9){var _0x2efd9a=_0x3beae9[_0xa754('0x30')](/<(.*?)>/);return _0x2efd9a?_0x2efd9a[0x1]:_0x3beae9;}Report['prototype'][_0xa754('0x31')]=function(_0x1e2f6e){for(var _0x37751c=0x0;_0x37751c0x0?_0x1d419d:0x0;this[_0x2bac('0x12')][_0x5e720d['queue']][_0x2bac('0x5b')]=this[_0x2bac('0x12')][_0x5e720d[_0x2bac('0x6e')]]['talking']>_[_0x2bac('0x71')](_0x5e720d[_0x2bac('0x74')])?_['toNumber'](_0x5e720d[_0x2bac('0x74')]):this[_0x2bac('0x12')][_0x5e720d[_0x2bac('0x6e')]][_0x2bac('0x5b')];this[_0x2bac('0x54')](this[_0x2bac('0x12')][_0x5e720d['queue']],_0x2bac('0x15'));}logger[_0x2bac('0x49')](_0x2bac('0x75'),util['inspect'](this[_0x2bac('0x12')][_0x5e720d['queue']],{'showHidden':![],'depth':null}));ami['emit'](_0x2bac('0x76'),this[_0x2bac('0x12')][_0x5e720d[_0x2bac('0x6e')]]);}}}catch(_0x477679){logger[_0x2bac('0x41')](_0x2bac('0x6c'),util[_0x2bac('0x3f')](_0x477679,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2bac('0xa')][_0x2bac('0x19')]=function(_0x49eb78){logger[_0x2bac('0x49')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0x2bac('0x3f')](_0x49eb78,{'showHidden':![],'depth':null}));this[_0x2bac('0x69')]=!![];};VoiceQueueReport[_0x2bac('0xa')][_0x2bac('0x77')]=function(_0x41cd5e){try{if(this['isNotNull'](_0x41cd5e)){logger[_0x2bac('0x49')](_0x2bac('0x78'),_0x41cd5e[_0x2bac('0x51')],util[_0x2bac('0x3f')](_0x41cd5e,{'showHidden':![],'depth':null}));if(_[_0x2bac('0x66')](this[_0x2bac('0x40')][_0x41cd5e['uniqueid']]))this['queueReports'][_0x41cd5e['uniqueid']]=[];if(_[_0x2bac('0x66')](this[_0x2bac('0x10')][_0x41cd5e['uniqueid']]))this[_0x2bac('0x10')][_0x41cd5e[_0x2bac('0x51')]]={};var _0x3ec6a5=new QueueReport();_0x3ec6a5[_0x2bac('0x4d')]=_0x41cd5e[_0x2bac('0x6e')];_0x3ec6a5[_0x2bac('0x55')]=this['voiceQueues'][_0x3ec6a5[_0x2bac('0x4d')]]&&this[_0x2bac('0x12')][_0x3ec6a5[_0x2bac('0x4d')]][_0x2bac('0x55')]?this[_0x2bac('0x12')][_0x3ec6a5[_0x2bac('0x4d')]]['type']||_0x2bac('0x79'):'inbound';_0x3ec6a5[_0x2bac('0x6e')]=_0x41cd5e[_0x2bac('0x6e')];_0x3ec6a5[_0x2bac('0x7a')]=moment()[_0x2bac('0x52')]('YYYY-MM-DD\x20HH:mm:ss');_0x3ec6a5[_0x2bac('0x7b')]=_0x41cd5e[_0x2bac('0x7b')];_0x3ec6a5[_0x2bac('0x7c')]=_0x41cd5e[_0x2bac('0x7c')];_0x3ec6a5['uniqueid']=_0x41cd5e[_0x2bac('0x51')];_0x3ec6a5[_0x2bac('0x7d')]=this['channels'][_0x41cd5e[_0x2bac('0x51')]][_0x2bac('0x7d')];logger[_0x2bac('0x7e')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x3ec6a5[_0x2bac('0x4d')],_0x3ec6a5[_0x2bac('0x55')]);_[_0x2bac('0x7f')](_0x3ec6a5,_[_0x2bac('0x80')](_0x41cd5e,_[_0x2bac('0x81')](_0x3ec6a5)));this[_0x2bac('0x40')][_0x41cd5e[_0x2bac('0x51')]][_0x2bac('0x82')](_0x3ec6a5);this[_0x2bac('0x10')][_0x41cd5e[_0x2bac('0x51')]]=_0x3ec6a5;this[_0x2bac('0x48')](_0x3ec6a5,_0x2bac('0x1a'));}}catch(_0x491810){logger[_0x2bac('0x41')](_0x2bac('0x78'),_0x41cd5e[_0x2bac('0x51')],util['inspect'](_0x491810,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerAbandon']=function(_0x59b696){try{if(this[_0x2bac('0x65')](_0x59b696)){logger['debug'](_0x2bac('0x83'),_0x59b696['uniqueid'],util[_0x2bac('0x3f')](_0x59b696,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x59b696[_0x2bac('0x51')]]){var _0x3494fe=_[_0x2bac('0x84')](this[_0x2bac('0x40')][_0x59b696[_0x2bac('0x51')]]);_0x3494fe[_0x2bac('0x85')]=![];_0x3494fe[_0x2bac('0x86')]=null;_0x3494fe[_0x2bac('0x87')]=_0x59b696[_0x2bac('0x87')];_0x3494fe['originalposition']=_0x59b696[_0x2bac('0x88')];_0x3494fe[_0x2bac('0x1b')]=!![];_0x3494fe['queuecallerabandonAt']=moment()[_0x2bac('0x52')](_0x2bac('0x89'));_0x3494fe[_0x2bac('0x8a')]=_0x2bac('0x8b');_0x3494fe['lastAssignedTo']=null;logger[_0x2bac('0x7e')](_0x2bac('0x8c'),_0x3494fe[_0x2bac('0x4d')],_0x3494fe[_0x2bac('0x55')]);this['channels'][_0x59b696[_0x2bac('0x51')]]=_0x3494fe;this[_0x2bac('0x45')](_0x3494fe,_0x2bac('0x1b'));}}}catch(_0x56bbe8){logger[_0x2bac('0x41')](_0x2bac('0x83'),_0x59b696[_0x2bac('0x51')],util[_0x2bac('0x3f')](_0x56bbe8,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x2bac('0x1e')]=function(_0x3b703e){try{if(this[_0x2bac('0x65')](_0x3b703e)){logger[_0x2bac('0x49')](_0x2bac('0x8d'),_0x3b703e[_0x2bac('0x51')],util['inspect'](_0x3b703e,{'showHidden':![],'depth':null}));if(this[_0x2bac('0x40')][_0x3b703e[_0x2bac('0x51')]]){var _0x2a9a41=_[_0x2bac('0x84')](this[_0x2bac('0x40')][_0x3b703e['uniqueid']]);_0x2a9a41[_0x2bac('0x8e')]=moment()[_0x2bac('0x52')](_0x2bac('0x89'));_0x2a9a41[_0x2bac('0x8f')]=_0x3b703e[_0x2bac('0x8f')];_0x2a9a41['connectedlinename']=_0x3b703e[_0x2bac('0x90')];logger[_0x2bac('0x7e')](_0x2bac('0x91'),_0x2a9a41['name'],_0x2a9a41['type'],_0x3b703e[_0x2bac('0x8f')],_0x3b703e[_0x2bac('0x90')]);this[_0x2bac('0x10')][_0x3b703e['uniqueid']]=_0x2a9a41;this['emitVoiceQueueChannelSave'](_0x2a9a41,_0x2bac('0x1d'));}}}catch(_0x1c286a){logger[_0x2bac('0x41')](_0x2bac('0x8d'),_0x3b703e[_0x2bac('0x51')],util[_0x2bac('0x3f')](_0x1c286a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2bac('0xa')][_0x2bac('0x22')]=function(_0x517732){try{if(this[_0x2bac('0x65')](_0x517732)){logger[_0x2bac('0x49')]('[%s][voiceQueueReport][agentconnect]',_0x517732[_0x2bac('0x51')],util['inspect'](_0x517732,{'showHidden':![],'depth':null}));if(this[_0x2bac('0x40')][_0x517732[_0x2bac('0x51')]]){var _0xd23d60=_[_0x2bac('0x84')](this[_0x2bac('0x40')][_0x517732[_0x2bac('0x51')]]);_0xd23d60[_0x2bac('0x85')]=!![];_0xd23d60[_0x2bac('0x8a')]=_0x2bac('0x92');logger[_0x2bac('0x7e')](_0x2bac('0x93'),_0xd23d60[_0x2bac('0x4d')],_0xd23d60[_0x2bac('0x55')]);}}}catch(_0x5ef42e){logger[_0x2bac('0x41')](_0x2bac('0x94'),_0x517732[_0x2bac('0x51')],util[_0x2bac('0x3f')](_0x5ef42e,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x2bac('0x20')]=function(_0x18d936){try{if(this['isNotNull'](_0x18d936)){logger['debug'](_0x2bac('0x95'),_0x18d936[_0x2bac('0x51')],util[_0x2bac('0x3f')](_0x18d936,{'showHidden':![],'depth':null}));if(this[_0x2bac('0x40')][_0x18d936['uniqueid']]){var _0x21e957=_[_0x2bac('0x84')](this['queueReports'][_0x18d936[_0x2bac('0x51')]]);_0x21e957[_0x2bac('0x1b')]=![];_0x21e957[_0x2bac('0x96')]=null;_0x21e957['assigned']=!![];_0x21e957[_0x2bac('0x97')]=_0x18d936[_0x2bac('0x98')];_0x21e957[_0x2bac('0x87')]=_0x18d936[_0x2bac('0x87')];_0x21e957[_0x2bac('0x85')]=!![];_0x21e957[_0x2bac('0x99')]=![];_0x21e957[_0x2bac('0x9a')]=null;if(!_0x21e957[_0x2bac('0x9b')]){if(_0x18d936[_0x2bac('0x9c')]==_0x2bac('0x9b')){_0x21e957[_0x2bac('0x8a')]=_0x2bac('0x9d');logger['info'](_0x2bac('0x9e'),_0x21e957[_0x2bac('0x4d')],_0x21e957[_0x2bac('0x55')]);}else{if(_[_0x2bac('0x9f')](_0x18d936[_0x2bac('0xa0')][_0x2bac('0xa1')](),_0x2bac('0xa2'))){if(this[_0x2bac('0x40')][_0x18d936['linkedid']]){var _0x3a5fdb=_['last'](this[_0x2bac('0x40')][_0x18d936[_0x2bac('0xa3')]]);_0x3a5fdb['queuecallercomplete']=![];_0x3a5fdb[_0x2bac('0x99')]=!![];_0x3a5fdb['queuecallerexitAt']=moment(_0x21e957['queuecallerjoinAt'])[_0x2bac('0xa4')](_0x18d936['holdtime'],_0x2bac('0xa5'))['format'](_0x2bac('0x89'));_0x3a5fdb[_0x2bac('0x8a')]=_0x2bac('0xa6');_0x3a5fdb['transfer']=!![];_0x3a5fdb[_0x2bac('0xa7')]=_0x2bac('0xa8');_0x3a5fdb[_0x2bac('0xa9')]=_0x18d936['destexten'];_0x3a5fdb[_0x2bac('0xaa')]=_0x18d936[_0x2bac('0x51')];logger[_0x2bac('0x7e')](_0x2bac('0xab'),_0x3a5fdb[_0x2bac('0x4d')],_0x3a5fdb[_0x2bac('0x55')]);var _0x58ee2d=this[_0x2bac('0x40')][_0x18d936[_0x2bac('0xa3')]];this[_0x2bac('0x40')][_0x18d936[_0x2bac('0xa3')]]=this[_0x2bac('0x40')][_0x18d936[_0x2bac('0x51')]];this[_0x2bac('0x40')][_0x18d936[_0x2bac('0x51')]]=_0x58ee2d;}}else{_0x21e957[_0x2bac('0x8a')]=_0x2bac('0xac')+_0x18d936[_0x2bac('0x9c')][_0x2bac('0xad')]();logger['info'](_0x2bac('0xae'),_0x21e957[_0x2bac('0x4d')],_0x21e957[_0x2bac('0x55')],_0x21e957['queuecallerexitreason']);}}}this[_0x2bac('0x10')][_0x18d936['uniqueid']]=_0x21e957;this[_0x2bac('0x45')](_0x21e957,'agentcomplete');}}}catch(_0x22c701){logger[_0x2bac('0x41')](_0x2bac('0x95'),_0x18d936['uniqueid'],util[_0x2bac('0x3f')](_0x22c701,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x2bac('0x23')]=function(_0x2d4492){try{if(this['isNotNull'](_0x2d4492)){logger[_0x2bac('0x49')]('[%s][voiceQueueReport][varset]',_0x2d4492[_0x2bac('0x51')],util['inspect'](_0x2d4492,{'showHidden':![],'depth':null}));this[_0x2bac('0xaf')](_0x2d4492['uniqueid'],_[_0x2bac('0x81')](_0x2d4492['variable'])[0x0],_0x2d4492[_0x2bac('0xb0')]);if(this[_0x2bac('0x40')][_0x2d4492[_0x2bac('0x51')]]){var _0x5a6b18=_[_0x2bac('0x84')](this['queueReports'][_0x2d4492['uniqueid']]);if(_0x5a6b18){if(this[_0x2bac('0x65')](_0x2d4492[_0x2bac('0xb1')])&&this[_0x2bac('0x65')](_0x2d4492[_0x2bac('0xb1')][_0x2bac('0xb2')])){switch(_0x2d4492['value']){case _0x2bac('0xb3'):_0x5a6b18[_0x2bac('0x99')]=![];_0x5a6b18['queuecallerexitAt']=null;break;case'TIMEOUT':_0x5a6b18[_0x2bac('0xb4')]=_0x2bac('0xb5');_0x5a6b18[_0x2bac('0x99')]=!![];_0x5a6b18['queuecallerexitAt']=moment()[_0x2bac('0x52')](_0x2bac('0x89'));_0x5a6b18[_0x2bac('0x8e')]=moment()['format'](_0x2bac('0x89'));logger[_0x2bac('0x49')](_0x2bac('0xb6'),_0x2d4492[_0x2bac('0x51')],util[_0x2bac('0x3f')](_0x5a6b18,{'showHidden':![],'depth':null}));ami[_0x2bac('0x47')](_0x2bac('0xb7'),_0x5a6b18);break;default:_0x5a6b18[_0x2bac('0x99')]=!![];_0x5a6b18[_0x2bac('0x9a')]=moment()[_0x2bac('0x52')](_0x2bac('0x89'));_0x5a6b18[_0x2bac('0x8e')]=moment()[_0x2bac('0x52')](_0x2bac('0x89'));}_0x5a6b18[_0x2bac('0x1b')]=![];_0x5a6b18['queuecallerabandonAt']=null;_0x5a6b18[_0x2bac('0x8a')]=_0x2d4492[_0x2bac('0xb0')];this[_0x2bac('0x10')][_0x2d4492[_0x2bac('0x51')]]=_0x5a6b18;this[_0x2bac('0x45')](_0x5a6b18,_0x2bac('0xb8'));}else if(this[_0x2bac('0x65')](_0x2d4492['variable'])&&this['isNotNull'](_0x2d4492[_0x2bac('0xb1')][_0x2bac('0xb9')])){if(!_0x5a6b18[_0x2bac('0x1b')]){_0x5a6b18[_0x2bac('0x99')]=!![];_0x5a6b18[_0x2bac('0x9a')]=moment()['format'](_0x2bac('0x89'));_0x5a6b18[_0x2bac('0x8a')]=_0x2bac('0xba');_0x5a6b18['queuecallerleaveAt']=moment()[_0x2bac('0x52')](_0x2bac('0x89'));this[_0x2bac('0x10')][_0x2d4492[_0x2bac('0x51')]]=_0x5a6b18;}}logger['info'](_0x2bac('0xbb'),_0x2d4492[_0x2bac('0x51')],_0x5a6b18[_0x2bac('0x4d')],_0x5a6b18[_0x2bac('0x55')],_['keys'](_0x2d4492['variable'])[0x0],_0x2d4492[_0x2bac('0xb0')]);_0x5a6b18[_0x2bac('0x14')]=this[_0x2bac('0x14')][_0x2d4492[_0x2bac('0x51')]];}}}}catch(_0x5d8f2a){logger[_0x2bac('0x41')](_0x2bac('0xbc'),_0x2d4492[_0x2bac('0x51')],util[_0x2bac('0x3f')](_0x5d8f2a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2bac('0xa')]['addVariable']=function(_0x34438a,_0x458b48,_0x44db95){var _0x31cad0=[_0x2bac('0xbd'),_0x2bac('0xbe'),_0x2bac('0xbf'),_0x2bac('0xc0'),_0x2bac('0xc1'),_0x2bac('0xc2'),_0x2bac('0xc3'),_0x2bac('0xc4'),_0x2bac('0xc5'),_0x2bac('0xc6'),'bridgepeer',_0x2bac('0xc7'),_0x2bac('0xc8'),_0x2bac('0xc9'),'memberinterface','memberlastcall',_0x2bac('0x98'),_0x2bac('0xca'),_0x2bac('0xcb')];if(!_[_0x2bac('0x3a')](_0x458b48)&&!_[_0x2bac('0xcc')](_0x31cad0,_0x458b48)){if(_['isUndefined'](this[_0x2bac('0x14')][_0x34438a])){this[_0x2bac('0x14')][_0x34438a]={};}this['variables'][_0x34438a][_0x458b48]=_0x44db95;}};VoiceQueueReport[_0x2bac('0xa')][_0x2bac('0x25')]=function(_0xcad1a9){try{if(this['isNotNull'](_0xcad1a9)){logger[_0x2bac('0x49')]('[%s][voiceQueueReport][hangup]',_0xcad1a9[_0x2bac('0x51')],util[_0x2bac('0x3f')](_0xcad1a9,{'showHidden':![],'depth':null}));if(this[_0x2bac('0x40')][_0xcad1a9[_0x2bac('0x51')]]){for(var _0x168ae8=0x0,_0x5986f9={};_0x168ae80x0?_0x5a7567:0x0;this[_0xcd85('0x14')][_0x24e12b['queue']][_0xcd85('0x32')]=this[_0xcd85('0x14')][_0x24e12b['queue']][_0xcd85('0x32')]>_[_0xcd85('0x68')](_0x24e12b['loggedin'])?_[_0xcd85('0x68')](_0x24e12b[_0xcd85('0x6a')]):this[_0xcd85('0x14')][_0x24e12b[_0xcd85('0x64')]][_0xcd85('0x32')];this[_0xcd85('0x4f')](this[_0xcd85('0x14')][_0x24e12b[_0xcd85('0x64')]],_0xcd85('0x18'));}logger[_0xcd85('0x44')](_0xcd85('0x6b'),util['inspect'](this[_0xcd85('0x14')][_0x24e12b['queue']],{'showHidden':![],'depth':null}));ami[_0xcd85('0x42')]('custom:queuesummary',this[_0xcd85('0x14')][_0x24e12b[_0xcd85('0x64')]]);}}}catch(_0xadd71e){logger[_0xcd85('0x3b')]('[voiceQueueReport][queuesummary]',util[_0xcd85('0x3d')](_0xadd71e,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xcd85('0x1b')]=function(_0x4e6520){logger[_0xcd85('0x44')](_0xcd85('0x6c'),util['inspect'](_0x4e6520,{'showHidden':![],'depth':null}));this[_0xcd85('0x15')]=!![];};VoiceQueueReport[_0xcd85('0xd')][_0xcd85('0x1c')]=function(_0x19bc44){try{if(this[_0xcd85('0x63')](_0x19bc44)){logger['debug'](_0xcd85('0x6d'),_0x19bc44[_0xcd85('0x47')],util[_0xcd85('0x3d')](_0x19bc44,{'showHidden':![],'depth':null}));if(_[_0xcd85('0x5c')](this[_0xcd85('0x11')][_0x19bc44[_0xcd85('0x47')]]))this[_0xcd85('0x11')][_0x19bc44[_0xcd85('0x47')]]=[];if(_[_0xcd85('0x5c')](this[_0xcd85('0x13')][_0x19bc44[_0xcd85('0x47')]]))this[_0xcd85('0x13')][_0x19bc44[_0xcd85('0x47')]]={};var _0x256702=new QueueReport();_0x256702['name']=_0x19bc44['queue'];_0x256702[_0xcd85('0x50')]=this[_0xcd85('0x14')][_0x256702[_0xcd85('0x49')]]&&this['voiceQueues'][_0x256702[_0xcd85('0x49')]][_0xcd85('0x50')]?this[_0xcd85('0x14')][_0x256702[_0xcd85('0x49')]][_0xcd85('0x50')]||_0xcd85('0x51'):'inbound';_0x256702[_0xcd85('0x64')]=_0x19bc44[_0xcd85('0x64')];_0x256702[_0xcd85('0x6e')]=moment()[_0xcd85('0x4d')](_0xcd85('0x6f'));_0x256702[_0xcd85('0x70')]=_0x19bc44[_0xcd85('0x70')];_0x256702[_0xcd85('0x71')]=_0x19bc44['count'];_0x256702['uniqueid']=_0x19bc44[_0xcd85('0x47')];_0x256702[_0xcd85('0x72')]=this[_0xcd85('0x13')][_0x19bc44[_0xcd85('0x47')]][_0xcd85('0x72')];logger['info'](_0xcd85('0x73'),_0x256702[_0xcd85('0x49')],_0x256702['type']);_[_0xcd85('0x74')](_0x256702,_[_0xcd85('0x75')](_0x19bc44,_[_0xcd85('0x76')](_0x256702)));this['queueReports'][_0x19bc44[_0xcd85('0x47')]][_0xcd85('0x77')](_0x256702);this[_0xcd85('0x13')][_0x19bc44[_0xcd85('0x47')]]=_0x256702;this[_0xcd85('0x43')](_0x256702,_0xcd85('0x78'));}}catch(_0x1bdc13){logger['error']('[%s][voiceQueueReport][queuecallerjoin]',_0x19bc44[_0xcd85('0x47')],util[_0xcd85('0x3d')](_0x1bdc13,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xcd85('0x1e')]=function(_0x1f1cbb){try{if(this[_0xcd85('0x63')](_0x1f1cbb)){logger[_0xcd85('0x44')](_0xcd85('0x79'),_0x1f1cbb[_0xcd85('0x47')],util['inspect'](_0x1f1cbb,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1f1cbb[_0xcd85('0x47')]]){var _0x6efeff=_[_0xcd85('0x7a')](this['queueReports'][_0x1f1cbb[_0xcd85('0x47')]]);_0x6efeff[_0xcd85('0x7b')]=![];_0x6efeff[_0xcd85('0x7c')]=null;_0x6efeff[_0xcd85('0x7d')]=_0x1f1cbb[_0xcd85('0x7d')];_0x6efeff[_0xcd85('0x7e')]=_0x1f1cbb[_0xcd85('0x7e')];_0x6efeff[_0xcd85('0x1d')]=!![];_0x6efeff[_0xcd85('0x7f')]=moment()[_0xcd85('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');_0x6efeff[_0xcd85('0x80')]=_0xcd85('0x81');_0x6efeff[_0xcd85('0x82')]=null;logger[_0xcd85('0x65')](_0xcd85('0x83'),_0x6efeff[_0xcd85('0x49')],_0x6efeff[_0xcd85('0x50')]);this[_0xcd85('0x13')][_0x1f1cbb[_0xcd85('0x47')]]=_0x6efeff;this[_0xcd85('0x40')](_0x6efeff,'queuecallerabandon');}}}catch(_0x1b272e){logger[_0xcd85('0x3b')]('[%s][voiceQueueReport][queuecallerabandon]',_0x1f1cbb[_0xcd85('0x47')],util['inspect'](_0x1b272e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xcd85('0xd')]['syncQueueCallerLeave']=function(_0x5e8354){try{if(this['isNotNull'](_0x5e8354)){logger[_0xcd85('0x44')](_0xcd85('0x84'),_0x5e8354['uniqueid'],util['inspect'](_0x5e8354,{'showHidden':![],'depth':null}));if(this[_0xcd85('0x11')][_0x5e8354['uniqueid']]){var _0x9206a=_[_0xcd85('0x7a')](this[_0xcd85('0x11')][_0x5e8354['uniqueid']]);_0x9206a[_0xcd85('0x85')]=moment()[_0xcd85('0x4d')](_0xcd85('0x6f'));_0x9206a[_0xcd85('0x86')]=_0x5e8354[_0xcd85('0x86')];_0x9206a[_0xcd85('0x87')]=_0x5e8354['connectedlinename'];logger[_0xcd85('0x65')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x9206a[_0xcd85('0x49')],_0x9206a[_0xcd85('0x50')],_0x5e8354[_0xcd85('0x86')],_0x5e8354['connectedlinename']);this[_0xcd85('0x13')][_0x5e8354[_0xcd85('0x47')]]=_0x9206a;this[_0xcd85('0x43')](_0x9206a,_0xcd85('0x1f'));}}}catch(_0xadab3d){logger[_0xcd85('0x3b')](_0xcd85('0x84'),_0x5e8354[_0xcd85('0x47')],util['inspect'](_0xadab3d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xcd85('0xd')][_0xcd85('0x24')]=function(_0x17c1fb){try{if(this['isNotNull'](_0x17c1fb)){logger['debug'](_0xcd85('0x88'),_0x17c1fb[_0xcd85('0x47')],util[_0xcd85('0x3d')](_0x17c1fb,{'showHidden':![],'depth':null}));if(this[_0xcd85('0x11')][_0x17c1fb[_0xcd85('0x47')]]){var _0x623c57=_[_0xcd85('0x7a')](this[_0xcd85('0x11')][_0x17c1fb[_0xcd85('0x47')]]);_0x623c57[_0xcd85('0x7b')]=!![];_0x623c57['queuecallerexitreason']=_0xcd85('0x89');logger[_0xcd85('0x65')](_0xcd85('0x8a'),_0x623c57[_0xcd85('0x49')],_0x623c57[_0xcd85('0x50')]);}}}catch(_0x3b7cc5){logger['error']('[%s][voiceQueueReport][agentconnect]',_0x17c1fb['uniqueid'],util[_0xcd85('0x3d')](_0x3b7cc5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xcd85('0xd')][_0xcd85('0x22')]=function(_0x22b3f1){try{if(this[_0xcd85('0x63')](_0x22b3f1)){logger['debug']('[%s][voiceQueueReport][agentcomplete]',_0x22b3f1[_0xcd85('0x47')],util[_0xcd85('0x3d')](_0x22b3f1,{'showHidden':![],'depth':null}));if(this[_0xcd85('0x11')][_0x22b3f1[_0xcd85('0x47')]]){var _0x5a2121=_[_0xcd85('0x7a')](this['queueReports'][_0x22b3f1[_0xcd85('0x47')]]);_0x5a2121[_0xcd85('0x1d')]=![];_0x5a2121[_0xcd85('0x7f')]=null;_0x5a2121['assigned']=!![];_0x5a2121['lastAssignedTo']=_0x22b3f1[_0xcd85('0x8b')];_0x5a2121['holdtime']=_0x22b3f1['holdtime'];_0x5a2121[_0xcd85('0x7b')]=!![];_0x5a2121[_0xcd85('0x8c')]=![];_0x5a2121[_0xcd85('0x8d')]=null;if(!_0x5a2121[_0xcd85('0x8e')]){if(_0x22b3f1[_0xcd85('0x8f')]=='transfer'){_0x5a2121[_0xcd85('0x80')]=_0xcd85('0x90');logger[_0xcd85('0x65')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x5a2121[_0xcd85('0x49')],_0x5a2121['type']);}else{if(_[_0xcd85('0x91')](_0x22b3f1['channel'][_0xcd85('0x92')](),_0xcd85('0x93'))){if(this[_0xcd85('0x11')][_0x22b3f1[_0xcd85('0x94')]]){var _0x468835=_[_0xcd85('0x7a')](this[_0xcd85('0x11')][_0x22b3f1['linkedid']]);_0x468835['queuecallercomplete']=![];_0x468835[_0xcd85('0x8c')]=!![];_0x468835[_0xcd85('0x8d')]=moment(_0x5a2121['queuecallerjoinAt'])[_0xcd85('0x95')](_0x22b3f1[_0xcd85('0x7d')],'seconds')['format']('YYYY-MM-DD\x20HH:mm:ss');_0x468835[_0xcd85('0x80')]=_0xcd85('0x96');_0x468835['transfer']=!![];_0x468835[_0xcd85('0x97')]='FORWARD';_0x468835['transferexten']=_0x22b3f1[_0xcd85('0x98')];_0x468835[_0xcd85('0x99')]=_0x22b3f1[_0xcd85('0x47')];logger['info'](_0xcd85('0x9a'),_0x468835[_0xcd85('0x49')],_0x468835[_0xcd85('0x50')]);var _0x55ec67=this['queueReports'][_0x22b3f1[_0xcd85('0x94')]];this[_0xcd85('0x11')][_0x22b3f1[_0xcd85('0x94')]]=this[_0xcd85('0x11')][_0x22b3f1[_0xcd85('0x47')]];this[_0xcd85('0x11')][_0x22b3f1[_0xcd85('0x47')]]=_0x55ec67;}}else{_0x5a2121[_0xcd85('0x80')]='COMPLETEDBY'+_0x22b3f1[_0xcd85('0x8f')][_0xcd85('0x9b')]();logger[_0xcd85('0x65')](_0xcd85('0x9c'),_0x5a2121[_0xcd85('0x49')],_0x5a2121[_0xcd85('0x50')],_0x5a2121[_0xcd85('0x80')]);}}}this['channels'][_0x22b3f1[_0xcd85('0x47')]]=_0x5a2121;this['emitVoiceQueueChannelRemove'](_0x5a2121,_0xcd85('0x21'));}}}catch(_0x5317e0){logger[_0xcd85('0x3b')](_0xcd85('0x9d'),_0x22b3f1[_0xcd85('0x47')],util[_0xcd85('0x3d')](_0x5317e0,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xcd85('0x25')]=function(_0x176a6e){try{if(this[_0xcd85('0x63')](_0x176a6e)){logger[_0xcd85('0x44')](_0xcd85('0x9e'),_0x176a6e[_0xcd85('0x47')],util[_0xcd85('0x3d')](_0x176a6e,{'showHidden':![],'depth':null}));this[_0xcd85('0x9f')](_0x176a6e[_0xcd85('0x47')],_[_0xcd85('0x76')](_0x176a6e[_0xcd85('0xa0')])[0x0],_0x176a6e['value']);if(this[_0xcd85('0x11')][_0x176a6e[_0xcd85('0x47')]]){var _0x52dcee=_[_0xcd85('0x7a')](this[_0xcd85('0x11')][_0x176a6e[_0xcd85('0x47')]]);if(_0x52dcee){if(this['isNotNull'](_0x176a6e[_0xcd85('0xa0')])&&this[_0xcd85('0x63')](_0x176a6e[_0xcd85('0xa0')][_0xcd85('0xa1')])){switch(_0x176a6e[_0xcd85('0xa2')]){case _0xcd85('0xa3'):_0x52dcee[_0xcd85('0x8c')]=![];_0x52dcee[_0xcd85('0x8d')]=null;break;case'TIMEOUT':_0x52dcee['lastevent']=_0xcd85('0xa4');_0x52dcee['queuecallerexit']=!![];_0x52dcee[_0xcd85('0x8d')]=moment()[_0xcd85('0x4d')](_0xcd85('0x6f'));_0x52dcee['queuecallerleaveAt']=moment()[_0xcd85('0x4d')](_0xcd85('0x6f'));logger[_0xcd85('0x44')](_0xcd85('0xa5'),_0x176a6e[_0xcd85('0x47')],util[_0xcd85('0x3d')](_0x52dcee,{'showHidden':![],'depth':null}));ami[_0xcd85('0x42')](_0xcd85('0xa6'),_0x52dcee);break;default:_0x52dcee[_0xcd85('0x8c')]=!![];_0x52dcee['queuecallerexitAt']=moment()[_0xcd85('0x4d')](_0xcd85('0x6f'));_0x52dcee[_0xcd85('0x85')]=moment()[_0xcd85('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');}_0x52dcee[_0xcd85('0x1d')]=![];_0x52dcee[_0xcd85('0x7f')]=null;_0x52dcee['queuecallerexitreason']=_0x176a6e[_0xcd85('0xa2')];this[_0xcd85('0x13')][_0x176a6e['uniqueid']]=_0x52dcee;this[_0xcd85('0x40')](_0x52dcee,_0xcd85('0xa7'));}else if(this['isNotNull'](_0x176a6e[_0xcd85('0xa0')])&&this['isNotNull'](_0x176a6e['variable'][_0xcd85('0xa8')])){if(!_0x52dcee[_0xcd85('0x1d')]){_0x52dcee['queuecallerexit']=!![];_0x52dcee[_0xcd85('0x8d')]=moment()[_0xcd85('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');_0x52dcee[_0xcd85('0x80')]='EXITWITHKEY';_0x52dcee[_0xcd85('0x85')]=moment()[_0xcd85('0x4d')](_0xcd85('0x6f'));this[_0xcd85('0x13')][_0x176a6e[_0xcd85('0x47')]]=_0x52dcee;}}logger[_0xcd85('0x65')](_0xcd85('0xa9'),_0x176a6e[_0xcd85('0x47')],_0x52dcee['name'],_0x52dcee[_0xcd85('0x50')],_[_0xcd85('0x76')](_0x176a6e[_0xcd85('0xa0')])[0x0],_0x176a6e[_0xcd85('0xa2')]);_0x52dcee['variables']=this[_0xcd85('0x17')][_0x176a6e['uniqueid']];}}}}catch(_0x3c43e6){logger[_0xcd85('0x3b')](_0xcd85('0x9e'),_0x176a6e[_0xcd85('0x47')],util['inspect'](_0x3c43e6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xcd85('0xd')][_0xcd85('0x9f')]=function(_0x346bd0,_0x125e4c,_0x232f6a){var _0x2a87d6=['rtpaudioqos',_0xcd85('0xaa'),_0xcd85('0xab'),_0xcd85('0xac'),_0xcd85('0xad'),_0xcd85('0xae'),_0xcd85('0xaf'),_0xcd85('0xb0'),'sipcallid',_0xcd85('0xb1'),'bridgepeer','bridgepvtcallid',_0xcd85('0xb2'),_0xcd85('0xb3'),_0xcd85('0xb4'),'memberlastcall',_0xcd85('0x8b'),_0xcd85('0xb5'),_0xcd85('0xb6')];if(!_[_0xcd85('0xb7')](_0x125e4c)&&!_[_0xcd85('0xb8')](_0x2a87d6,_0x125e4c)){if(_[_0xcd85('0x5c')](this[_0xcd85('0x17')][_0x346bd0])){this[_0xcd85('0x17')][_0x346bd0]={};}this[_0xcd85('0x17')][_0x346bd0][_0x125e4c]=_0x232f6a;}};VoiceQueueReport['prototype'][_0xcd85('0x26')]=function(_0x24684e){try{if(this[_0xcd85('0x63')](_0x24684e)){logger['debug']('[%s][voiceQueueReport][hangup]',_0x24684e[_0xcd85('0x47')],util[_0xcd85('0x3d')](_0x24684e,{'showHidden':![],'depth':null}));if(this[_0xcd85('0x11')][_0x24684e['uniqueid']]){for(var _0x4465c5=0x0,_0x56d517={};_0x4465c5=0x0?moment(_0x229c13[_0x9744('0x18')])['diff'](_0x229c13[_0x9744('0x17')],_0x9744('0xd')):null,'data1':_0x9744('0x19'),'data2':_0x229c13[_0x9744('0x10')],'data3':_0x229c13[_0x9744('0xe')],'data4':_0x229c13[_0x9744('0x1a')]||null,'role':'agent','internal':_0x229c13[_0x9744('0x10')]?_[_0x9744('0x11')](_0x229c13[_0x9744('0x10')]):undefined,'uniqueid':_0x229c13[_0x9744('0x12')]},'log':_0x9744('0x13')});}; \ No newline at end of file +var _0xc9e0=['calleridnum','exten','queue','agent','toNumber','accountcode','uniqueid','voiceDialReport','Request','voice','membername','starttime','endtime','outbound','dialstring','moment','lodash','util','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','CreateMemberReport','lastAssignedTo','isNil','interface','format','SIP/%s','TALKING','queuecallerleaveAt','diff','seconds','inbound'];(function(_0x912d27,_0x28e0e3){var _0x31b918=function(_0x1882f7){while(--_0x1882f7){_0x912d27['push'](_0x912d27['shift']());}};_0x31b918(++_0x28e0e3);}(_0xc9e0,0x159));var _0x0c9e=function(_0x5b08e7,_0x506d83){_0x5b08e7=_0x5b08e7-0x0;var _0x13e6fc=_0xc9e0[_0x5b08e7];return _0x13e6fc;};'use strict';var moment=require(_0x0c9e('0x0'));var _=require(_0x0c9e('0x1'));var util=require(_0x0c9e('0x2'));var client=require(_0x0c9e('0x3'));exports[_0x0c9e('0x4')]=function(_0x1f32f2){var _0xb53f52=_0x1f32f2[_0x0c9e('0x5')]||_0x1f32f2[_0x0c9e('0x6')];return client['Request'](_0x0c9e('0x7'),{'body':{'channel':'voice','membername':_0x1f32f2[_0x0c9e('0x8')],'interface':_[_0x0c9e('0x9')](_0x1f32f2[_0x0c9e('0xa')])?util[_0x0c9e('0xb')](_0x0c9e('0xc'),_0x1f32f2['lastAssignedTo']):_0x1f32f2[_0x0c9e('0xa')],'type':_0x0c9e('0xd'),'enterAt':_0x1f32f2[_0x0c9e('0xe')],'exitAt':_0xb53f52,'duration':moment(_0xb53f52)[_0x0c9e('0xf')](_0x1f32f2['queuecallerleaveAt'],_0x0c9e('0x10')),'data1':_0x0c9e('0x11'),'data2':_0x1f32f2[_0x0c9e('0x12')],'data3':_0x1f32f2[_0x0c9e('0x13')],'data4':null,'data5':_0x1f32f2[_0x0c9e('0x14')],'role':_0x0c9e('0x15'),'internal':_0x1f32f2['accountcode']?_[_0x0c9e('0x16')](_0x1f32f2[_0x0c9e('0x17')]):undefined,'uniqueid':_0x1f32f2[_0x0c9e('0x18')]},'log':_0x0c9e('0x7')});};exports[_0x0c9e('0x19')]=function(_0x2093f9){return client[_0x0c9e('0x1a')](_0x0c9e('0x7'),{'body':{'channel':_0x0c9e('0x1b'),'membername':_0x2093f9[_0x0c9e('0x1c')],'interface':_0x2093f9[_0x0c9e('0xa')],'type':_0x0c9e('0xd'),'enterAt':_0x2093f9[_0x0c9e('0x1d')],'exitAt':_0x2093f9['endtime'],'duration':moment(_0x2093f9[_0x0c9e('0x1e')])[_0x0c9e('0xf')](_0x2093f9[_0x0c9e('0x1d')],_0x0c9e('0x10'))>=0x0?moment(_0x2093f9[_0x0c9e('0x1e')])[_0x0c9e('0xf')](_0x2093f9[_0x0c9e('0x1d')],_0x0c9e('0x10')):null,'data1':_0x0c9e('0x1f'),'data2':_0x2093f9[_0x0c9e('0x17')],'data3':_0x2093f9['exten'],'data4':_0x2093f9[_0x0c9e('0x20')]||null,'role':_0x0c9e('0x15'),'internal':_0x2093f9['accountcode']?_['toNumber'](_0x2093f9[_0x0c9e('0x17')]):undefined,'uniqueid':_0x2093f9[_0x0c9e('0x18')]},'log':_0x0c9e('0x7')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 4fc93ef..68293a7 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 _0x2547=['GetSettings','getSettings','Request','ShowSetting','stopRecordingOnTransfer'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x2547,0x1cd));var _0x7254=function(_0x4d5d6d,_0x5962c1){_0x4d5d6d=_0x4d5d6d-0x0;var _0x12c0b6=_0x2547[_0x4d5d6d];return _0x12c0b6;};'use strict';var client=require('../client');exports[_0x7254('0x0')]=function(){return client[_0x7254('0x1')](_0x7254('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x7254('0x3')]},'log':_0x7254('0x4')});}; \ No newline at end of file +var _0x79d3=['getSettings','Request','ShowSetting','stopRecordingOnTransfer','GetSettings','../client'];(function(_0x4f0a89,_0x52adca){var _0x1bdd37=function(_0x2c878f){while(--_0x2c878f){_0x4f0a89['push'](_0x4f0a89['shift']());}};_0x1bdd37(++_0x52adca);}(_0x79d3,0x179));var _0x379d=function(_0x1a04a6,_0x1b9764){_0x1a04a6=_0x1a04a6-0x0;var _0xb3f005=_0x79d3[_0x1a04a6];return _0xb3f005;};'use strict';var client=require(_0x379d('0x0'));exports[_0x379d('0x1')]=function(){return client[_0x379d('0x2')](_0x379d('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x379d('0x4')]},'log':_0x379d('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index ff3a48c..68d7338 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 _0x4c8c=['Request','GetTemplate','html','../client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4c8c,0x1b3));var _0xc4c8=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x4c8c[_0x4709c0];return _0x13348b;};'use strict';var client=require(_0xc4c8('0x0'));exports['getTemplates']=function(_0x4afaa8){return function(_0x1d9f79){return client[_0xc4c8('0x1')](_0xc4c8('0x2'),{'options':{'raw':!![],'attributes':['id','name',_0xc4c8('0x3')]},'log':_0xc4c8('0x2')});};}; \ No newline at end of file +var _0x059a=['GetTemplate','name','getTemplates'];(function(_0x593020,_0x12ca30){var _0x215c24=function(_0x2b7118){while(--_0x2b7118){_0x593020['push'](_0x593020['shift']());}};_0x215c24(++_0x12ca30);}(_0x059a,0x18b));var _0xa059=function(_0x5e7e92,_0xdb0f1){_0x5e7e92=_0x5e7e92-0x0;var _0x412746=_0x059a[_0x5e7e92];return _0x412746;};'use strict';var client=require('../client');exports[_0xa059('0x0')]=function(_0x506795){return function(_0x4e5507){return client['Request'](_0xa059('0x1'),{'options':{'raw':!![],'attributes':['id',_0xa059('0x2'),'html']},'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 f46ba3c..b8579c7 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 _0x47e2=['data3','data6','data7','../client','Request','GetTrigger','name','channel','status','Condition','AllConditions','field','value','AnyConditions','operator','action','data1','data2'];(function(_0x5205cf,_0x3ef5c3){var _0xa2d00a=function(_0x39409f){while(--_0x39409f){_0x5205cf['push'](_0x5205cf['shift']());}};_0xa2d00a(++_0x3ef5c3);}(_0x47e2,0x147));var _0x247e=function(_0x46e326,_0x3d9c82){_0x46e326=_0x46e326-0x0;var _0x203819=_0x47e2[_0x46e326];return _0x203819;};'use strict';var client=require(_0x247e('0x0'));exports['getTriggers']=function(_0x2acb55){return function(_0x2d3c8c){return client[_0x247e('0x1')](_0x247e('0x2'),{'options':{'raw':![],'attributes':['id',_0x247e('0x3'),_0x247e('0x4'),_0x247e('0x5')],'include':[{'model':_0x247e('0x6'),'as':_0x247e('0x7'),'attributes':['id',_0x247e('0x8'),'operator',_0x247e('0x9')]},{'model':_0x247e('0x6'),'as':_0x247e('0xa'),'attributes':['id',_0x247e('0x8'),_0x247e('0xb'),_0x247e('0x9')]},{'model':'Action','as':'Actions','attributes':['id',_0x247e('0xc'),_0x247e('0xd'),_0x247e('0xe'),_0x247e('0xf'),'data4','data5',_0x247e('0x10'),_0x247e('0x11')]}]},'log':_0x247e('0x2')});};}; \ No newline at end of file +var _0x5206=['data5','data6','data7','../client','getTriggers','Request','GetTrigger','name','channel','AllConditions','field','value','AnyConditions','operator','Action','Actions','action','data1','data3','data4'];(function(_0x2fb654,_0x47558f){var _0x52284d=function(_0x35698c){while(--_0x35698c){_0x2fb654['push'](_0x2fb654['shift']());}};_0x52284d(++_0x47558f);}(_0x5206,0x1bb));var _0x6520=function(_0x4c27ca,_0x542d00){_0x4c27ca=_0x4c27ca-0x0;var _0x41fba0=_0x5206[_0x4c27ca];return _0x41fba0;};'use strict';var client=require(_0x6520('0x0'));exports[_0x6520('0x1')]=function(_0x5d5173){return function(_0x3d66e5){return client[_0x6520('0x2')](_0x6520('0x3'),{'options':{'raw':![],'attributes':['id',_0x6520('0x4'),_0x6520('0x5'),'status'],'include':[{'model':'Condition','as':_0x6520('0x6'),'attributes':['id',_0x6520('0x7'),'operator',_0x6520('0x8')]},{'model':'Condition','as':_0x6520('0x9'),'attributes':['id',_0x6520('0x7'),_0x6520('0xa'),_0x6520('0x8')]},{'model':_0x6520('0xb'),'as':_0x6520('0xc'),'attributes':['id',_0x6520('0xd'),_0x6520('0xe'),'data2',_0x6520('0xf'),_0x6520('0x10'),_0x6520('0x11'),_0x6520('0x12'),_0x6520('0x13')]}]},'log':_0x6520('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index fa5e587..425e952 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 _0x9224=['Request','GetTrunk','name','getTrunks'];(function(_0x4abb2c,_0x4bdf94){var _0x59e031=function(_0x504eeb){while(--_0x504eeb){_0x4abb2c['push'](_0x4abb2c['shift']());}};_0x59e031(++_0x4bdf94);}(_0x9224,0xa3));var _0x4922=function(_0x1cb896,_0x2c0b8a){_0x1cb896=_0x1cb896-0x0;var _0x266279=_0x9224[_0x1cb896];return _0x266279;};'use strict';var client=require('../client');exports[_0x4922('0x0')]=function(_0x2ef3ae){return function(_0x29fbd7){return client[_0x4922('0x1')](_0x4922('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x4922('0x3'),'registry','defaultuser']},'log':'GetTrunk'});};}; \ No newline at end of file +var _0xf3a6=['GetTrunk','name','registry','defaultuser','Request'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xf3a6,0x1e9));var _0x6f3a=function(_0x39285d,_0x4e7c32){_0x39285d=_0x39285d-0x0;var _0x5b809b=_0xf3a6[_0x39285d];return _0x5b809b;};'use strict';var client=require('../client');exports['getTrunks']=function(_0x4a1034){return function(_0x57f158){return client[_0x6f3a('0x0')](_0x6f3a('0x1'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x6f3a('0x2'),_0x6f3a('0x3'),_0x6f3a('0x4')]},'log':_0x6f3a('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 7dc707d..69410a2 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 _0x9c44=['online','pauseType','Request','GetUser','agent','name','email','accountcode','lastLoginAt','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','telephone','internal','PauseUser','savePause','getAgent','ShowUser','fullname'];(function(_0x3e5ce0,_0xa934c6){var _0x10f3ed=function(_0x430b40){while(--_0x430b40){_0x3e5ce0['push'](_0x3e5ce0['shift']());}};_0x10f3ed(++_0xa934c6);}(_0x9c44,0x178));var _0x49c4=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x9c44[_0x3511d3];return _0x5d6321;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2')},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5'),'fullname','online',_0x49c4('0x6'),'pauseType',_0x49c4('0x7'),_0x49c4('0x8'),_0x49c4('0x9'),_0x49c4('0xa'),_0x49c4('0xb')]},'log':'getAgents'});};};exports[_0x49c4('0xc')]=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':!![],'where':{'role':_0x49c4('0xd')},'attributes':['id','name','accountcode',_0x49c4('0xe')]},'log':_0x49c4('0xc')});};};exports['savePause']=function(_0xb611a1,_0x459d09,_0x4adb3c){return client['Request'](_0x49c4('0xf'),{'body':{'type':_0x459d09,'uniqueid':_0x4adb3c},'options':{'where':{'id':_0xb611a1['id']}},'log':_0x49c4('0x10')});};exports['saveUnpause']=function(_0x7df3a9){return client[_0x49c4('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x7df3a9['id']}},'log':_0x49c4('0x10')});};exports[_0x49c4('0x11')]=function(_0x21f15a){return client[_0x49c4('0x0')](_0x49c4('0x12'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2'),'id':_0x21f15a},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),'accountcode',_0x49c4('0x13'),_0x49c4('0x14'),_0x49c4('0x6'),_0x49c4('0x15'),_0x49c4('0x7'),'voicePause',_0x49c4('0xb')]},'log':_0x49c4('0x11')});}; \ No newline at end of file +var _0xcb91=['UnpauseUser','getAgent','ShowUser','email','lastPauseAt','Request','GetUser','agent','name','accountcode','fullname','lastLoginAt','pauseType','voicePause','phone','interface','getAgents','internal','getTelephones','savePause','PauseUser'];(function(_0x20be82,_0x47c505){var _0x2139c7=function(_0x46b8f1){while(--_0x46b8f1){_0x20be82['push'](_0x20be82['shift']());}};_0x2139c7(++_0x47c505);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x22c684,_0x753309){_0x22c684=_0x22c684-0x0;var _0x39fcbb=_0xcb91[_0x22c684];return _0x39fcbb;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'where':{'role':_0x1cb9('0x2')},'attributes':['id',_0x1cb9('0x3'),'email',_0x1cb9('0x4'),_0x1cb9('0x5'),'online',_0x1cb9('0x6'),_0x1cb9('0x7'),'lastPauseAt',_0x1cb9('0x8'),_0x1cb9('0x9'),'mobile',_0x1cb9('0xa')]},'log':_0x1cb9('0xb')});};};exports['getTelephones']=function(){return function(){return client[_0x1cb9('0x0')]('GetUser',{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x1cb9('0x3'),_0x1cb9('0x4'),_0x1cb9('0xc')]},'log':_0x1cb9('0xd')});};};exports[_0x1cb9('0xe')]=function(_0x50ce71,_0x9b58f1,_0x44a6b4){return client[_0x1cb9('0x0')](_0x1cb9('0xf'),{'body':{'type':_0x9b58f1,'uniqueid':_0x44a6b4},'options':{'where':{'id':_0x50ce71['id']}},'log':_0x1cb9('0xe')});};exports['saveUnpause']=function(_0x5e3c19){return client['Request'](_0x1cb9('0x10'),{'body':{},'options':{'where':{'id':_0x5e3c19['id']}},'log':_0x1cb9('0xe')});};exports[_0x1cb9('0x11')]=function(_0x1c714f){return client['Request'](_0x1cb9('0x12'),{'options':{'raw':![],'where':{'role':_0x1cb9('0x2'),'id':_0x1c714f},'attributes':['id',_0x1cb9('0x3'),_0x1cb9('0x13'),_0x1cb9('0x4'),'fullname','online',_0x1cb9('0x6'),_0x1cb9('0x7'),_0x1cb9('0x14'),_0x1cb9('0x8'),_0x1cb9('0xa')]},'log':_0x1cb9('0x11')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index df7b514..c7069a8 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 _0xee0a=['CreateVoiceAgentReport','UpdateVoiceAgentReport','create'];(function(_0x278e73,_0x2eb3a0){var _0x1a1333=function(_0x39d3a1){while(--_0x39d3a1){_0x278e73['push'](_0x278e73['shift']());}};_0x1a1333(++_0x2eb3a0);}(_0xee0a,0x194));var _0xaee0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xee0a[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0xaee0('0x0')]=function(_0xd6f028){return client['Request'](_0xaee0('0x1'),{'body':_0xd6f028,'log':_0xaee0('0x1')});};exports['update']=function(_0x4cdd90,_0x12ffee,_0x12a70c){return client['Request'](_0xaee0('0x2'),{'body':_0x4cdd90,'options':{'where':{'uniqueid':_0x12ffee,'interface':_0x12a70c,'agentcomplete':!![]}},'log':_0xaee0('0x2')});}; \ No newline at end of file +var _0x5e00=['Request','UpdateVoiceAgentReport','../client','create','CreateVoiceAgentReport','update'];(function(_0x1219ba,_0x195743){var _0x582035=function(_0x374e34){while(--_0x374e34){_0x1219ba['push'](_0x1219ba['shift']());}};_0x582035(++_0x195743);}(_0x5e00,0xc2));var _0x05e0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5e00[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x05e0('0x0'));exports[_0x05e0('0x1')]=function(_0x22adf1){return client['Request'](_0x05e0('0x2'),{'body':_0x22adf1,'log':'CreateVoiceAgentReport'});};exports[_0x05e0('0x3')]=function(_0x1d7e35,_0x1b46b5,_0x2e7c41){return client[_0x05e0('0x4')](_0x05e0('0x5'),{'body':_0x1d7e35,'options':{'where':{'uniqueid':_0x1b46b5,'interface':_0x2e7c41,'agentcomplete':!![]}},'log':_0x05e0('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 8ca4250..6975b18 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 _0x37bf=['day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','disposition','duration','billableseconds','GetVoiceCallReports','moment','util','lodash','../client','create','Request','merge','calleridnum','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','startOf'];(function(_0x2134e0,_0x7e8620){var _0x9d0e9f=function(_0x5936fc){while(--_0x5936fc){_0x2134e0['push'](_0x2134e0['shift']());}};_0x9d0e9f(++_0x7e8620);}(_0x37bf,0xa2));var _0xf37b=function(_0x18cc9,_0x422b42){_0x18cc9=_0x18cc9-0x0;var _0x1b5404=_0x37bf[_0x18cc9];return _0x1b5404;};'use strict';var moment=require(_0xf37b('0x0'));var util=require(_0xf37b('0x1'));var _=require(_0xf37b('0x2'));var client=require(_0xf37b('0x3'));exports[_0xf37b('0x4')]=function(_0x48d205){return client[_0xf37b('0x5')]('CreateVoiceCallReport',{'body':_[_0xf37b('0x6')](_0x48d205,{'source':_0x48d205[_0xf37b('0x7')],'destinationcontext':_0x48d205['context'],'callerid':_0x48d205[_0xf37b('0x8')],'amaflags':_0xf37b('0x9')}),'log':'CreateVoiceCallReport'});};exports[_0xf37b('0xa')]=function(){return function(){return client[_0xf37b('0x5')](_0xf37b('0xb'),{'options':{'where':{'type':[_0xf37b('0xc')],'createdAt':{'$between':[moment()[_0xf37b('0xd')](_0xf37b('0xe'))[_0xf37b('0xf')](_0xf37b('0x10')),moment()[_0xf37b('0x11')](_0xf37b('0xe'))[_0xf37b('0xf')](_0xf37b('0x10'))]}},'attributes':['type',_0xf37b('0x12'),_0xf37b('0x13'),_0xf37b('0x14')]},'log':_0xf37b('0x15')});};}; \ No newline at end of file +var _0x17de=['disposition','duration','billableseconds','moment','util','lodash','../client','create','Request','CreateVoiceCallReport','context','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type'];(function(_0x53c177,_0x5c8b30){var _0x4a9c32=function(_0x46ab17){while(--_0x46ab17){_0x53c177['push'](_0x53c177['shift']());}};_0x4a9c32(++_0x5c8b30);}(_0x17de,0x67));var _0xe17d=function(_0x4ac48d,_0x171a68){_0x4ac48d=_0x4ac48d-0x0;var _0x7537af=_0x17de[_0x4ac48d];return _0x7537af;};'use strict';var moment=require(_0xe17d('0x0'));var util=require(_0xe17d('0x1'));var _=require(_0xe17d('0x2'));var client=require(_0xe17d('0x3'));exports[_0xe17d('0x4')]=function(_0x2ea5f1){return client[_0xe17d('0x5')](_0xe17d('0x6'),{'body':_['merge'](_0x2ea5f1,{'source':_0x2ea5f1['calleridnum'],'destinationcontext':_0x2ea5f1[_0xe17d('0x7')],'callerid':_0x2ea5f1['callerid'],'amaflags':_0xe17d('0x8')}),'log':_0xe17d('0x6')});};exports[_0xe17d('0x9')]=function(){return function(){return client[_0xe17d('0x5')](_0xe17d('0xa'),{'options':{'where':{'type':[_0xe17d('0xb')],'createdAt':{'$between':[moment()['startOf'](_0xe17d('0xc'))[_0xe17d('0xd')](_0xe17d('0xe')),moment()[_0xe17d('0xf')]('day')['format'](_0xe17d('0xe'))]}},'attributes':[_0xe17d('0x10'),_0xe17d('0x11'),_0xe17d('0x12'),_0xe17d('0x13')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index ec66f4d..5a9f052 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 _0x3d67=['../client','Request','CreateVoiceDialReport'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x3d67,0x105));var _0x73d6=function(_0x26bbb8,_0x35fb8a){_0x26bbb8=_0x26bbb8-0x0;var _0x10e3c2=_0x3d67[_0x26bbb8];return _0x10e3c2;};'use strict';var client=require(_0x73d6('0x0'));exports['create']=function(_0x4f3b4d){return client[_0x73d6('0x1')](_0x73d6('0x2'),{'body':_0x4f3b4d,'log':_0x73d6('0x2')});}; \ No newline at end of file +var _0x4baf=['CreateVoiceDialReport','../client','Request'];(function(_0x1acc2d,_0x597696){var _0xabfa6d=function(_0x41e83c){while(--_0x41e83c){_0x1acc2d['push'](_0x1acc2d['shift']());}};_0xabfa6d(++_0x597696);}(_0x4baf,0x10c));var _0xf4ba=function(_0x4e3b64,_0xe13dd9){_0x4e3b64=_0x4e3b64-0x0;var _0x56a8ce=_0x4baf[_0x4e3b64];return _0x56a8ce;};'use strict';var client=require(_0xf4ba('0x0'));exports['create']=function(_0x63c177){return client[_0xf4ba('0x1')](_0xf4ba('0x2'),{'body':_0x63c177,'log':_0xf4ba('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index dbba441..8d91c4a 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 _0x9000=['getVoiceExtensions','GetVoiceExtension','exten','recordingFormat','../client'];(function(_0x31d3ea,_0x23eecc){var _0x178f09=function(_0xbb5f7e){while(--_0xbb5f7e){_0x31d3ea['push'](_0x31d3ea['shift']());}};_0x178f09(++_0x23eecc);}(_0x9000,0x19e));var _0x0900=function(_0x5621e8,_0x257e0d){_0x5621e8=_0x5621e8-0x0;var _0x20d8a7=_0x9000[_0x5621e8];return _0x20d8a7;};'use strict';var client=require(_0x0900('0x0'));exports[_0x0900('0x1')]=function(){return function(){return client['Request'](_0x0900('0x2'),{'options':{'raw':!![],'attributes':['id',_0x0900('0x3'),_0x0900('0x4')],'where':{'VoiceExtensionId':null}},'log':_0x0900('0x1')});};}; \ No newline at end of file +var _0x9f94=['getVoiceExtensions','Request','recordingFormat','../client'];(function(_0x2dcd57,_0x3ef5b1){var _0x26789b=function(_0x59fbea){while(--_0x59fbea){_0x2dcd57['push'](_0x2dcd57['shift']());}};_0x26789b(++_0x3ef5b1);}(_0x9f94,0x1e7));var _0x49f9=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x9f94[_0x4e676e];return _0x336a3c;};'use strict';var client=require(_0x49f9('0x0'));exports[_0x49f9('0x1')]=function(){return function(){return client[_0x49f9('0x2')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id','exten',_0x49f9('0x3')],'where':{'VoiceExtensionId':null}},'log':_0x49f9('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 593cd3e..5049a61 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 _0x36bb=['dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPreviewAutoRecallMe','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','../client','getVoiceQueues','Request','name','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDSilenceThreshold'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x36bb,0xe6));var _0xb36b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36bb[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xb36b('0x0'));exports[_0xb36b('0x1')]=function(){return function(){return client[_0xb36b('0x2')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0xb36b('0x3'),_0xb36b('0x4'),_0xb36b('0x5'),_0xb36b('0x6'),_0xb36b('0x7'),_0xb36b('0x8'),_0xb36b('0x9'),_0xb36b('0xa'),_0xb36b('0xb'),_0xb36b('0xc'),_0xb36b('0xd'),_0xb36b('0xe'),_0xb36b('0xf'),_0xb36b('0x10'),_0xb36b('0x11'),_0xb36b('0x12'),_0xb36b('0x13'),_0xb36b('0x14'),_0xb36b('0x15'),'dialQueueProject',_0xb36b('0x16'),_0xb36b('0x17'),_0xb36b('0x18'),'dialBusyRetryFrequency',_0xb36b('0x19'),_0xb36b('0x1a'),_0xb36b('0x1b'),_0xb36b('0x1c'),_0xb36b('0x1d'),_0xb36b('0x1e'),_0xb36b('0x1f'),_0xb36b('0x20'),_0xb36b('0x21'),_0xb36b('0x22'),_0xb36b('0x23'),'dialAMDTotalAnalysisTime',_0xb36b('0x24'),'dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords',_0xb36b('0x25'),_0xb36b('0x26'),_0xb36b('0x27'),_0xb36b('0x28'),_0xb36b('0x29'),_0xb36b('0x2a'),'dialAgiAfterHangupAgent',_0xb36b('0x2b'),_0xb36b('0x2c'),_0xb36b('0x7'),_0xb36b('0x2d'),'dialRandomLastDigitCallerIdNumber',_0xb36b('0x2e'),_0xb36b('0x2f'),_0xb36b('0x30'),'dialDropMaxRetry',_0xb36b('0x31'),'dialAbandonedMaxRetry',_0xb36b('0x32'),_0xb36b('0x33'),_0xb36b('0x34'),_0xb36b('0x35'),_0xb36b('0x36'),_0xb36b('0x37'),_0xb36b('0x38'),'dialPredictiveIntervalMinThreshold',_0xb36b('0x39')],'include':[{'model':'Trunk','as':_0xb36b('0x3a'),'attributes':['id','name',_0xb36b('0x3b'),_0xb36b('0x3c')]},{'model':_0xb36b('0x3d'),'as':_0xb36b('0x3e'),'attributes':['id',_0xb36b('0x3')]},{'model':'Trunk','as':_0xb36b('0x3f'),'attributes':['id',_0xb36b('0x3'),_0xb36b('0x3b'),'active']},{'model':_0xb36b('0x40'),'as':'Interval','attributes':['id','name'],'include':[{'model':'Interval','as':_0xb36b('0x41'),'attributes':['id',_0xb36b('0x3'),_0xb36b('0x42')]}]}]},'log':_0xb36b('0x1')});};}; \ No newline at end of file +var _0x4d87=['dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialPrefix','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','Trunk','name','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','getVoiceQueues','Request','GetVoiceQueue','acw','acwTimeout','type','dialActive','dialMethod','dialLimitChannel','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName'];(function(_0x2cf0d1,_0x444114){var _0x166fee=function(_0x5cd185){while(--_0x5cd185){_0x2cf0d1['push'](_0x2cf0d1['shift']());}};_0x166fee(++_0x444114);}(_0x4d87,0xf0));var _0x74d8=function(_0x2af50a,_0xa2c81d){_0x2af50a=_0x2af50a-0x0;var _0x36ff3b=_0x4d87[_0x2af50a];return _0x36ff3b;};'use strict';var client=require('../client');exports[_0x74d8('0x0')]=function(){return function(){return client[_0x74d8('0x1')](_0x74d8('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x74d8('0x3'),_0x74d8('0x4'),'autopause','monitor_format',_0x74d8('0x5'),_0x74d8('0x6'),_0x74d8('0x7'),_0x74d8('0x8'),'dialLimitQueue','dialPowerLevel','dialPredictiveOptimization',_0x74d8('0x9'),_0x74d8('0xa'),_0x74d8('0xb'),_0x74d8('0xc'),_0x74d8('0xd'),_0x74d8('0xe'),'dialQueueTimeout',_0x74d8('0xf'),_0x74d8('0x10'),_0x74d8('0x11'),_0x74d8('0x12'),_0x74d8('0x13'),_0x74d8('0x14'),_0x74d8('0x15'),_0x74d8('0x16'),_0x74d8('0x17'),'dialGlobalInterval',_0x74d8('0x18'),_0x74d8('0x19'),'dialAMDActive',_0x74d8('0x1a'),_0x74d8('0x1b'),_0x74d8('0x1c'),_0x74d8('0x1d'),_0x74d8('0x1e'),'dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold',_0x74d8('0x1f'),_0x74d8('0x20'),_0x74d8('0x21'),_0x74d8('0x22'),_0x74d8('0x23'),_0x74d8('0x24'),'dialAgiAfterHangupClient',_0x74d8('0x25'),'monitor_format',_0x74d8('0x26'),_0x74d8('0x27'),_0x74d8('0x28'),_0x74d8('0x29'),_0x74d8('0x2a'),_0x74d8('0x2b'),_0x74d8('0x2c'),'dialAbandonedMaxRetry',_0x74d8('0x2d'),_0x74d8('0x2e'),'dialMachineRetryFrequency',_0x74d8('0x2f'),_0x74d8('0x30'),_0x74d8('0x31'),_0x74d8('0x32'),_0x74d8('0x33'),_0x74d8('0x34')],'include':[{'model':_0x74d8('0x35'),'as':_0x74d8('0x35'),'attributes':['id',_0x74d8('0x36'),_0x74d8('0x37'),_0x74d8('0x38')]},{'model':_0x74d8('0x39'),'as':_0x74d8('0x3a'),'attributes':['id',_0x74d8('0x36')]},{'model':_0x74d8('0x35'),'as':_0x74d8('0x3b'),'attributes':['id',_0x74d8('0x36'),_0x74d8('0x37'),_0x74d8('0x38')]},{'model':'Interval','as':_0x74d8('0x3c'),'attributes':['id',_0x74d8('0x36')],'include':[{'model':_0x74d8('0x3c'),'as':_0x74d8('0x3d'),'attributes':['id',_0x74d8('0x36'),_0x74d8('0x3e')]}]}]},'log':_0x74d8('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index ff9a995..91e0801 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(_0x26fc02,_0x53e772){var _0x1ff609=function(_0xde58ff){while(--_0xde58ff){_0x26fc02['push'](_0x26fc02['shift']());}};_0x1ff609(++_0x53e772);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'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(_0x1fb299,_0x13dcc9){var _0x5db7da=function(_0x4f8e98){while(--_0x4f8e98){_0x1fb299['push'](_0x1fb299['shift']());}};_0x5db7da(++_0x13dcc9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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 f84e08d..706b556 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 _0xcbe0=['Request','GetVoiceQueueRtPauses','getVoiceQueueRtPauses'];(function(_0x3f43ef,_0x4c2ba9){var _0x20af43=function(_0x17fb2b){while(--_0x17fb2b){_0x3f43ef['push'](_0x3f43ef['shift']());}};_0x20af43(++_0x4c2ba9);}(_0xcbe0,0x119));var _0x0cbe=function(_0x2a0738,_0x3c0bc5){_0x2a0738=_0x2a0738-0x0;var _0x159679=_0xcbe0[_0x2a0738];return _0x159679;};'use strict';var client=require('../client');exports[_0x0cbe('0x0')]=function(_0x586609){return function(){return client[_0x0cbe('0x1')](_0x0cbe('0x2'),{'options':{'where':{'VoiceQueueId':_0x586609,'paused':!![]},'raw':!![]},'log':_0x0cbe('0x0')});};}; \ No newline at end of file +var _0x6186=['Request','getVoiceQueueRtPauses','../client'];(function(_0x22ba60,_0x164968){var _0x2c9354=function(_0xb53eca){while(--_0xb53eca){_0x22ba60['push'](_0x22ba60['shift']());}};_0x2c9354(++_0x164968);}(_0x6186,0x9b));var _0x6618=function(_0x25d386,_0x108d0d){_0x25d386=_0x25d386-0x0;var _0x857f4a=_0x6186[_0x25d386];return _0x857f4a;};'use strict';var client=require(_0x6618('0x0'));exports['getVoiceQueueRtPauses']=function(_0x56a7ea){return function(){return client[_0x6618('0x1')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x56a7ea,'paused':!![]},'raw':!![]},'log':_0x6618('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index e0ef69a..f096020 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(_0x4879eb,_0x4696f9){var _0x25c394=function(_0x57663b){while(--_0x57663b){_0x4879eb['push'](_0x4879eb['shift']());}};_0x25c394(++_0x4696f9);}(_0x7a54,0x106));var _0x47a5=function(_0x111ce3,_0x2a5245){_0x111ce3=_0x111ce3-0x0;var _0x105547=_0x7a54[_0x111ce3];return _0x105547;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file +var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x49877c,_0x33cca1){var _0x265999=function(_0x44e63a){while(--_0x44e63a){_0x49877c['push'](_0x49877c['shift']());}};_0x265999(++_0x33cca1);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 551dcf7..85ef66f 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 _0x2eea=['transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereecontext','transfereelinkedid','context','extension','blind','attendedTransfer','Request','result','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','transfertargetcalleridnum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','isexternal','origtransfererexten','../client','transfers','CreateVoiceTransferReport','transfererchannel','transferercalleridnum','transferercalleridname','transfereraccountcode','transferercontext'];(function(_0x2f7d18,_0x44bea6){var _0x425175=function(_0x4b6787){while(--_0x4b6787){_0x2f7d18['push'](_0x2f7d18['shift']());}};_0x425175(++_0x44bea6);}(_0x2eea,0x120));var _0xa2ee=function(_0x28bd4d,_0x391f03){_0x28bd4d=_0x28bd4d-0x0;var _0x125aaa=_0x2eea[_0x28bd4d];return _0x125aaa;};'use strict';var client=require(_0xa2ee('0x0'));exports[_0xa2ee('0x1')]={};exports['blindTransfer']=function(_0x1e7f61){return client['Request'](_0xa2ee('0x2'),{'body':{'result':_0x1e7f61['result'],'transfererchannel':_0x1e7f61[_0xa2ee('0x3')],'transferercalleridnum':_0x1e7f61[_0xa2ee('0x4')],'transferercalleridname':_0x1e7f61[_0xa2ee('0x5')],'transfererconnectedlinenum':_0x1e7f61['transfererconnectedlinenum'],'transfererconnectedlinename':_0x1e7f61['transfererconnectedlinename'],'transfereraccountcode':_0x1e7f61[_0xa2ee('0x6')],'transferercontext':_0x1e7f61[_0xa2ee('0x7')],'transfererexten':_0x1e7f61[_0xa2ee('0x8')],'transfererlinkedid':_0x1e7f61[_0xa2ee('0x9')],'transfereechannel':_0x1e7f61[_0xa2ee('0xa')],'transfereecalleridnum':_0x1e7f61[_0xa2ee('0xb')],'transfereecalleridname':_0x1e7f61[_0xa2ee('0xc')],'transfereeconnectedlinenum':_0x1e7f61[_0xa2ee('0xd')],'transfereeconnectedlinename':_0x1e7f61[_0xa2ee('0xe')],'transfereeaccountcode':_0x1e7f61['transfereeaccountcode'],'transfereecontext':_0x1e7f61[_0xa2ee('0xf')],'transfereeexten':_0x1e7f61['transfereeexten'],'transfereelinkedid':_0x1e7f61[_0xa2ee('0x10')],'isexternal':_0x1e7f61['isexternal'],'context':_0x1e7f61[_0xa2ee('0x11')],'extension':_0x1e7f61[_0xa2ee('0x12')],'type':_0xa2ee('0x13')},'log':'CreateVoiceTransferReport'});};exports[_0xa2ee('0x14')]=function(_0x1514a6){return client[_0xa2ee('0x15')](_0xa2ee('0x2'),{'body':{'result':_0x1514a6[_0xa2ee('0x16')],'transfererchannel':_0x1514a6[_0xa2ee('0x17')],'transferercalleridnum':_0x1514a6['origtransferercalleridnum'],'transferercalleridname':_0x1514a6['origtransferercalleridname'],'transfererconnectedlinenum':_0x1514a6[_0xa2ee('0x18')],'transfererconnectedlinename':_0x1514a6[_0xa2ee('0x19')],'transfereraccountcode':_0x1514a6[_0xa2ee('0x1a')],'transferercontext':_0x1514a6[_0xa2ee('0x1b')],'transfererexten':_0x1514a6['secondtransfererexten'],'transfererlinkedid':_0x1514a6[_0xa2ee('0x1c')],'transfereechannel':_0x1514a6['transfertargetchannel'],'transfereecalleridnum':_0x1514a6[_0xa2ee('0x1d')],'transfereecalleridname':_0x1514a6['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x1514a6['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x1514a6[_0xa2ee('0x1e')],'transfereeaccountcode':_0x1514a6[_0xa2ee('0x1f')],'transfereecontext':_0x1514a6[_0xa2ee('0x20')],'transfereeexten':_0x1514a6[_0xa2ee('0x21')],'transfereelinkedid':_0x1514a6[_0xa2ee('0x22')],'isexternal':_0x1514a6[_0xa2ee('0x23')],'context':_0x1514a6['origtransferercontext'],'extension':_0x1514a6[_0xa2ee('0x24')],'type':'attended'},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file +var _0x87b3=['isexternal','context','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','attended','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transferercalleridnum','transfererconnectedlinenum','transfereraccountcode','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinename','transfereecontext','transfereeexten'];(function(_0x5d008b,_0x12b7b2){var _0x381807=function(_0x270f75){while(--_0x270f75){_0x5d008b['push'](_0x5d008b['shift']());}};_0x381807(++_0x12b7b2);}(_0x87b3,0x1a2));var _0x387b=function(_0x4c0b5f,_0x32e47d){_0x4c0b5f=_0x4c0b5f-0x0;var _0x20b9df=_0x87b3[_0x4c0b5f];return _0x20b9df;};'use strict';var client=require('../client');exports[_0x387b('0x0')]={};exports[_0x387b('0x1')]=function(_0x1b9bf0){return client[_0x387b('0x2')](_0x387b('0x3'),{'body':{'result':_0x1b9bf0[_0x387b('0x4')],'transfererchannel':_0x1b9bf0['transfererchannel'],'transferercalleridnum':_0x1b9bf0[_0x387b('0x5')],'transferercalleridname':_0x1b9bf0['transferercalleridname'],'transfererconnectedlinenum':_0x1b9bf0[_0x387b('0x6')],'transfererconnectedlinename':_0x1b9bf0['transfererconnectedlinename'],'transfereraccountcode':_0x1b9bf0[_0x387b('0x7')],'transferercontext':_0x1b9bf0['transferercontext'],'transfererexten':_0x1b9bf0[_0x387b('0x8')],'transfererlinkedid':_0x1b9bf0[_0x387b('0x9')],'transfereechannel':_0x1b9bf0[_0x387b('0xa')],'transfereecalleridnum':_0x1b9bf0[_0x387b('0xb')],'transfereecalleridname':_0x1b9bf0[_0x387b('0xc')],'transfereeconnectedlinenum':_0x1b9bf0['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x1b9bf0[_0x387b('0xd')],'transfereeaccountcode':_0x1b9bf0['transfereeaccountcode'],'transfereecontext':_0x1b9bf0[_0x387b('0xe')],'transfereeexten':_0x1b9bf0[_0x387b('0xf')],'transfereelinkedid':_0x1b9bf0['transfereelinkedid'],'isexternal':_0x1b9bf0[_0x387b('0x10')],'context':_0x1b9bf0[_0x387b('0x11')],'extension':_0x1b9bf0['extension'],'type':'blind'},'log':_0x387b('0x3')});};exports['attendedTransfer']=function(_0xcc6229){return client[_0x387b('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0xcc6229[_0x387b('0x4')],'transfererchannel':_0xcc6229[_0x387b('0x12')],'transferercalleridnum':_0xcc6229[_0x387b('0x13')],'transferercalleridname':_0xcc6229[_0x387b('0x14')],'transfererconnectedlinenum':_0xcc6229['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0xcc6229[_0x387b('0x15')],'transfereraccountcode':_0xcc6229[_0x387b('0x16')],'transferercontext':_0xcc6229[_0x387b('0x17')],'transfererexten':_0xcc6229[_0x387b('0x18')],'transfererlinkedid':_0xcc6229['origtransfererlinkedid'],'transfereechannel':_0xcc6229['transfertargetchannel'],'transfereecalleridnum':_0xcc6229[_0x387b('0x19')],'transfereecalleridname':_0xcc6229['transfertargetcalleridname'],'transfereeconnectedlinenum':_0xcc6229[_0x387b('0x1a')],'transfereeconnectedlinename':_0xcc6229[_0x387b('0x1b')],'transfereeaccountcode':_0xcc6229[_0x387b('0x1c')],'transfereecontext':_0xcc6229[_0x387b('0x1d')],'transfereeexten':_0xcc6229['transfertargetexten'],'transfereelinkedid':_0xcc6229['transfertargetlinkedid'],'isexternal':_0xcc6229[_0x387b('0x10')],'context':_0xcc6229['origtransferercontext'],'extension':_0xcc6229['origtransfererexten'],'type':_0x387b('0x1e')},'log':_0x387b('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 64bd454..2e79a2b 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 _0x6365=['predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','push','length','find','omit','undefined','channels','map','uniqueid','channel','%s.%s','filename','wav','/var/spool/asterisk/monitor/','toLowerCase','mixmonitorid','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','voicechannel','resolve','StopMixMonitor','destinationchannel','monitors','status','stop','StopMixMonitor\x20Success','values','queueChannels','voicequeuechannel','Hangup','voicequeuechannelredirect','Redirect','context','telephones','trunks','outboundChannels','run','event','Event\x20name\x20mandatory','custom:','faxAccounts','send','checkAfterSend','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','%s/%s','SIP','name','timers','updateAcw','agents','updateStatusRealtime','pause','isConnected','asterisk','username','ami\x20disconnected','join','pick','module','Action','then','message','catch','error','command','action','Command','content','voiceQueues','hasOwnProperty','strategy','answered','available','pTalking','sumDuration','talking','type','abandoned','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout'];(function(_0x7d83de,_0x51384a){var _0x2efd8a=function(_0x50cba8){while(--_0x50cba8){_0x7d83de['push'](_0x7d83de['shift']());}};_0x2efd8a(++_0x51384a);}(_0x6365,0x148));var _0x5636=function(_0x424302,_0x361053){_0x424302=_0x424302-0x0;var _0xc8a89=_0x6365[_0x424302];return _0xc8a89;};'use strict';var _=require(_0x5636('0x0'));var util=require(_0x5636('0x1'));var jayson=require(_0x5636('0x2'));var schema=require(_0x5636('0x3'));var BPromise=require('bluebird');var moment=require(_0x5636('0x4'));var config=require(_0x5636('0x5'));var properties=require(_0x5636('0x6'));var ami=require(_0x5636('0x7'));exports[_0x5636('0x8')]=function(_0x4ad69d,_0x3be5f4,_0x230d78){return new BPromise(function(_0x2a12df,_0x3575b7){var _0x53d5b4={'QueuePause':function(_0x17439f){return new Promise(function(_0x10769f,_0x54eb5c){var _0x516641=util[_0x5636('0x9')](_0x5636('0xa'),_0x5636('0xb'),_0x17439f[_0x5636('0xc')]);if(_0x4ad69d['timers']&&_0x4ad69d['timers'][_0x516641]&&_0x4ad69d[_0x5636('0xd')][_0x516641]['timer']){_0x4ad69d[_0x5636('0xd')][_0x516641][_0x5636('0xe')]();}if(_0x4ad69d[_0x5636('0xf')][_0x516641]){_0x4ad69d[_0x5636('0xf')][_0x516641][_0x5636('0x10')]({'statePause':_0x17439f[_0x5636('0x11')]?!![]:![]});}_0x10769f({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x58712f){var _0x1c60dd=this;return new Promise(function(_0x5d4b17,_0x250a72){if(ami[_0x5636('0x12')]()==![]){return _0x250a72(_0x1c60dd['error'](0x1f4,[config['asterisk']['ip'],config[_0x5636('0x13')][_0x5636('0x14')],_0x5636('0x15')][_0x5636('0x16')]('\x20')));}_0x58712f=_[_0x5636('0x17')](_0x58712f,_['keys'](properties[_0x5636('0x18')]));_0x58712f['action']='Reload';return ami[_0x5636('0x19')](_0x58712f)[_0x5636('0x1a')](function(_0x395f26){_0x5d4b17({'code':0xc8,'message':_0x395f26[_0x5636('0x1b')]});})[_0x5636('0x1c')](function(_0x2e375d){_0x250a72(_0x1c60dd[_0x5636('0x1d')](0x1f5,_0x2e375d[_0x5636('0x1b')]));});});},'Command':function(_0x522d61){var _0x4dd749=this;return new Promise(function(_0x306e98,_0x433fec){if(ami[_0x5636('0x12')]()==![]){return _0x433fec(_0x4dd749['error'](0x1f4,[config[_0x5636('0x13')]['ip'],config[_0x5636('0x13')][_0x5636('0x14')],_0x5636('0x15')][_0x5636('0x16')]('\x20')));}_0x522d61=_['pick'](_0x522d61,_0x5636('0x1e'));_0x522d61[_0x5636('0x1f')]=_0x5636('0x20');return ami[_0x5636('0x19')](_0x522d61)['then'](function(_0x4c913c){_0x306e98({'code':0xc8,'message':_0x4c913c[_0x5636('0x21')]});})['catch'](function(_0x342e77){_0x433fec(_0x4dd749[_0x5636('0x1d')](0x1f5,_0x342e77[_0x5636('0x1b')]));});});},'VoiceQueues':function(_0x3a9777){return new Promise(function(_0x51e5cc,_0x3a1575){var _0x488e0c=[];for(var _0x3c6dcb in _0x4ad69d['voiceQueues']){if(_0x4ad69d[_0x5636('0x22')][_0x5636('0x23')](_0x3c6dcb)){var _0x10f3ea=_0x4ad69d[_0x5636('0x22')][_0x3c6dcb];var _0x4d1db1={'id':_0x10f3ea['id'],'name':_0x10f3ea[_0x5636('0xc')],'strategy':_0x10f3ea[_0x5636('0x24')],'answered':_0x10f3ea[_0x5636('0x25')],'available':_0x10f3ea[_0x5636('0x26')],'loggedIn':_0x10f3ea['loggedIn'],'pTalking':_0x10f3ea[_0x5636('0x27')],'sumBillable':_0x10f3ea['sumBillable'],'sumDuration':_0x10f3ea[_0x5636('0x28')],'sumHoldTime':_0x10f3ea['sumHoldTime']||0x0,'talking':_0x10f3ea[_0x5636('0x29')],'total':_0x10f3ea['total'],'type':_0x10f3ea[_0x5636('0x2a')],'unmanaged':_0x10f3ea['unmanaged'],'abandoned':_0x10f3ea[_0x5636('0x2b')],'waiting':_0x10f3ea['waiting'],'loggedInDb':_0x10f3ea[_0x5636('0x2c')]};if(_0x10f3ea[_0x5636('0x2a')]===_0x5636('0x2d')){_0x4d1db1['dialActive']=_0x10f3ea[_0x5636('0x2e')];_0x4d1db1[_0x5636('0x2f')]=_0x10f3ea[_0x5636('0x2f')];_0x4d1db1['dialOriginateCallerIdName']=_0x10f3ea[_0x5636('0x30')];_0x4d1db1[_0x5636('0x31')]=_0x10f3ea[_0x5636('0x31')];_0x4d1db1[_0x5636('0x32')]=_0x10f3ea[_0x5636('0x32')];_0x4d1db1[_0x5636('0x33')]=_0x10f3ea['dialPrefix'];_0x4d1db1['temp']=_0x10f3ea[_0x5636('0x34')];_0x4d1db1['outboundAnswerAgiCallsDay']=_0x10f3ea[_0x5636('0x35')];_0x4d1db1['outboundAnswerCallsDay']=_0x10f3ea[_0x5636('0x36')];_0x4d1db1[_0x5636('0x37')]=_0x10f3ea[_0x5636('0x37')];_0x4d1db1[_0x5636('0x38')]=_0x10f3ea['outboundBusyCallsDay'];_0x4d1db1[_0x5636('0x39')]=_0x10f3ea['outboundCongestionCallsDay'];_0x4d1db1[_0x5636('0x3a')]=_0x10f3ea[_0x5636('0x3a')];_0x4d1db1[_0x5636('0x3b')]=_0x10f3ea['outboundDropCallsDayCallersExit'];_0x4d1db1['outboundDropCallsDayTimeout']=_0x10f3ea[_0x5636('0x3c')];_0x4d1db1[_0x5636('0x3d')]=_0x10f3ea[_0x5636('0x3d')];_0x4d1db1[_0x5636('0x3e')]=_0x10f3ea[_0x5636('0x3e')];_0x4d1db1[_0x5636('0x3f')]=_0x10f3ea[_0x5636('0x3f')];_0x4d1db1['outboundReCallsDay']=_0x10f3ea[_0x5636('0x40')];_0x4d1db1['outboundRejectCallsDay']=_0x10f3ea['outboundRejectCallsDay'];_0x4d1db1[_0x5636('0x41')]=_0x10f3ea[_0x5636('0x41')];_0x4d1db1[_0x5636('0x42')]=_0x10f3ea[_0x5636('0x42')];_0x4d1db1[_0x5636('0x43')]=_0x10f3ea[_0x5636('0x43')];_0x4d1db1[_0x5636('0x44')]=_0x10f3ea[_0x5636('0x44')];_0x4d1db1[_0x5636('0x45')]=_0x10f3ea[_0x5636('0x45')];_0x4d1db1[_0x5636('0x46')]=_0x10f3ea[_0x5636('0x46')];_0x4d1db1['predictiveIntervalErlangCalls']=_0x10f3ea['predictiveIntervalErlangCalls'];_0x4d1db1[_0x5636('0x47')]=_0x10f3ea[_0x5636('0x47')];_0x4d1db1['predictiveIntervalHitRate']=_0x10f3ea['predictiveIntervalHitRate'];_0x4d1db1[_0x5636('0x48')]=_0x10f3ea[_0x5636('0x48')];_0x4d1db1[_0x5636('0x49')]=_0x10f3ea[_0x5636('0x49')];_0x4d1db1[_0x5636('0x4a')]=_0x10f3ea['predictiveIntervalAvailable'];_0x4d1db1['predictiveIntervalTotalCalls']=_0x10f3ea[_0x5636('0x4b')];_0x4d1db1[_0x5636('0x1b')]=_0x10f3ea[_0x5636('0x1b')];_0x4d1db1[_0x5636('0x4c')]=_0x10f3ea['originated'];_0x4d1db1['erlangCalls']=_0x10f3ea[_0x5636('0x4d')];_0x4d1db1[_0x5636('0x4e')]=_0x10f3ea[_0x5636('0x4e')];_0x4d1db1['erlangAbandonmentRate']=_0x10f3ea['erlangAbandonmentRate'];_0x4d1db1[_0x5636('0x4f')]=_0x10f3ea[_0x5636('0x4f')];_0x4d1db1[_0x5636('0x50')]=_0x10f3ea[_0x5636('0x50')];_0x4d1db1['startProgressive']=_0x10f3ea[_0x5636('0x51')];}if(_0x10f3ea[_0x5636('0x52')]){_0x4d1db1[_0x5636('0x52')]={'id':_0x10f3ea[_0x5636('0x52')]['id'],'name':_0x10f3ea[_0x5636('0x52')][_0x5636('0xc')],'active':_0x10f3ea[_0x5636('0x52')][_0x5636('0x53')],'callerid':_0x10f3ea[_0x5636('0x52')]['callerid']};}if(_0x10f3ea[_0x5636('0x54')]){_0x4d1db1['Interval']={'id':_0x10f3ea[_0x5636('0x54')]['id'],'name':_0x10f3ea['Interval'][_0x5636('0xc')]};}_0x488e0c[_0x5636('0x55')](_0x4d1db1);}}_0x51e5cc({'count':_0x488e0c[_0x5636('0x56')],'rows':_0x488e0c});});},'UpdateVoiceQueue':function(_0x326542){return new Promise(function(_0x131f54,_0x3ad5d8){var _0x51c78a=_[_0x5636('0x57')](_0x4ad69d[_0x5636('0x22')],{'id':parseInt(_0x326542['id'])});var _0x8fe13b=_[_0x5636('0x58')](_0x326542,['id']);if(_0x51c78a){for(var _0x352407 in _0x8fe13b){if(typeof _0x8fe13b[_0x352407]!==_0x5636('0x59')&&typeof _0x51c78a[_0x352407]!==_0x5636('0x59')){_0x51c78a[_0x352407]=_0x8fe13b[_0x352407];}}_0x131f54(_0x51c78a);}else{_0x3ad5d8();}});},'VoiceChannels':function(_0x39c019){return new Promise(function(_0x880404,_0x310051){var _0xfa53a5=_['values'](_0x4ad69d[_0x5636('0x5a')]);_0x880404({'count':_0xfa53a5['length'],'rows':_0xfa53a5});});},'VoiceChannelMixMonitor':function(_0x856355){var _0x17b0b8=this;return new Promise(function(_0x1a3fa3,_0x5c9d41){if(ami[_0x5636('0x12')]()==![]){return _0x5c9d41(_0x17b0b8[_0x5636('0x1d')](0x1f4,[config[_0x5636('0x13')]['ip'],config['asterisk']['username'],'ami\x20disconnected'][_0x5636('0x16')]('\x20')));}var _0x4984f6=schema(properties['voicechannel'])[_0x5636('0x3')](_0x856355);if(_0x4984f6['length']>0x0){return _0x5c9d41(_0x17b0b8[_0x5636('0x1d')](0x1f4,_[_0x5636('0x5b')](_0x4984f6,_0x5636('0x1b'))[_0x5636('0x16')](',\x20')));}var _0x3f4d6f=_['find'](_0x4ad69d[_0x5636('0x5a')],{'uniqueid':_0x856355[_0x5636('0x5c')]});if(_0x3f4d6f&&_0x3f4d6f[_0x5636('0x5d')]){var _0x399fe5=util['format'](_0x5636('0x5e'),_0x856355[_0x5636('0x5f')]||_0x856355[_0x5636('0x5c')],_0x856355[_0x5636('0x9')]||_0x5636('0x60'));return ami[_0x5636('0x19')]({'action':'MixMonitor','channel':_0x3f4d6f['channel'],'file':_0x399fe5,'options':'ai(mixmonitorid)'})[_0x5636('0x1a')](function(_0x3b7840){var _0x2da2c5=_[_0x5636('0x57')](_0x3f4d6f['monitors'],{'filename':_0x5636('0x61')+_0x399fe5[_0x5636('0x62')]()});if(_['isNil'](_0x2da2c5)){_0x3f4d6f['monitors'][_0x5636('0x55')]({'filename':'/var/spool/asterisk/monitor/'+_0x399fe5['toLowerCase'](),'createdAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x3b7840[_0x5636('0x63')],'status':_0x5636('0x64')});}else{_0x2da2c5[_0x5636('0x63')]=_0x3b7840[_0x5636('0x63')];_0x2da2c5['status']=_0x5636('0x64');}_0x1a3fa3({'code':0xc8,'message':[_0x856355['uniqueid'],_0x5636('0x65'),_0x3b7840[_0x5636('0x63')]][_0x5636('0x16')]('\x20'),'mixmonitorid':_0x3b7840[_0x5636('0x63')]});})[_0x5636('0x1c')](function(_0x44520a){_0x5c9d41(_0x17b0b8[_0x5636('0x1d')](0x1f5,[_0x856355[_0x5636('0x5c')],_0x44520a[_0x5636('0x1b')]['toLowerCase']()][_0x5636('0x16')]('\x20')));});}else{return _0x5c9d41(_0x17b0b8[_0x5636('0x1d')](0x1f5,_0x5636('0x66')));}});},'VoiceChannelStopMixMonitor':function(_0x48283d){var _0x4618ba=this;return new Promise(function(_0x25d8f8,_0x1efdae){if(ami[_0x5636('0x12')]()==![]){return _0x1efdae(_0x4618ba[_0x5636('0x1d')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0x5636('0x14')],_0x5636('0x15')][_0x5636('0x16')]('\x20')));}var _0x3eb35e=schema(properties[_0x5636('0x67')])['validate'](_0x48283d);if(_0x3eb35e['length']>0x0){return _0x1efdae(_0x4618ba[_0x5636('0x1d')](0x1f4,_['map'](_0x3eb35e,_0x5636('0x1b'))[_0x5636('0x16')](',\x20')));}var _0x596d33=_[_0x5636('0x57')](_0x4ad69d[_0x5636('0x5a')],{'uniqueid':_0x48283d[_0x5636('0x5c')]});if(_0x596d33){return BPromise[_0x5636('0x68')]()[_0x5636('0x1a')](function(){if(_0x596d33[_0x5636('0x5d')]){return ami[_0x5636('0x19')]({'action':_0x5636('0x69'),'channel':_0x596d33['channel'],'mixmonitorid':_0x48283d[_0x5636('0x63')]})[_0x5636('0x1c')](function(_0x1bed7f){});}})[_0x5636('0x1a')](function(){if(_0x596d33[_0x5636('0x6a')]){return ami['Action']({'action':_0x5636('0x69'),'channel':_0x596d33[_0x5636('0x6a')],'mixmonitorid':_0x48283d['mixmonitorid']})['catch'](function(_0x36d36e){});}})[_0x5636('0x1a')](function(_0x5aaf5a){var _0x43bb83=_[_0x5636('0x57')](_0x596d33[_0x5636('0x6b')],{'mixmonitorid':_0x48283d['mixmonitorid']});if(_0x43bb83){_0x43bb83[_0x5636('0x6c')]=_0x5636('0x6d');}})[_0x5636('0x1a')](function(){var _0x46b1c3=util['format']('%s.%s',_0x48283d[_0x5636('0x5f')]||_0x48283d['uniqueid'],_0x48283d['format']||'wav');var _0x241dde=_[_0x5636('0x57')](_0x596d33[_0x5636('0x6b')],{'filename':_0x5636('0x61')+_0x46b1c3['toLowerCase']()});if(_0x241dde){_0x241dde[_0x5636('0x6c')]=_0x5636('0x6d');}})[_0x5636('0x1a')](function(){_0x25d8f8({'code':0xc8,'message':[_0x48283d[_0x5636('0x5c')],_0x5636('0x6e')][_0x5636('0x16')]('\x20')});})[_0x5636('0x1c')](function(_0x3560a8){_0x1efdae(_0x4618ba[_0x5636('0x1d')](0x1f5,[_0x48283d[_0x5636('0x5c')],_0x3560a8[_0x5636('0x1b')][_0x5636('0x62')]()]['join']('\x20')));});}else{return _0x1efdae(_0x4618ba[_0x5636('0x1d')](0x1f5,_0x5636('0x66')));}});},'VoiceQueuesChannels':function(_0xe71f2f){return new Promise(function(_0x1baf77,_0x54d222){var _0x35c617=_[_0x5636('0x6f')](_0x4ad69d[_0x5636('0x70')]);_0x1baf77({'count':_0x35c617[_0x5636('0x56')],'rows':_0x35c617});});},'VoiceQueuesChannel':function(_0x1b8f11){var _0x2201f3=this;return new Promise(function(_0x5713a6,_0x35abba){var _0x565145=schema(properties[_0x5636('0x71')])[_0x5636('0x3')](_0x1b8f11);if(_0x565145[_0x5636('0x56')]>0x0){return _0x35abba(_0x2201f3[_0x5636('0x1d')](0x1f4,_[_0x5636('0x5b')](_0x565145,_0x5636('0x1b'))[_0x5636('0x16')](',\x20')));}var _0x207132=_[_0x5636('0x57')](_0x4ad69d[_0x5636('0x70')],{'uniqueid':_0x1b8f11[_0x5636('0x5c')]});if(_0x207132){_0x5713a6(_0x207132);}else{return _0x35abba(_0x2201f3[_0x5636('0x1d')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x114b45){var _0xdc652=this;return new Promise(function(_0x3dcc7c,_0x5cd795){if(ami[_0x5636('0x12')]()==![]){return _0x5cd795(_0xdc652['error'](0x1f4,[config[_0x5636('0x13')]['ip'],config[_0x5636('0x13')][_0x5636('0x14')],_0x5636('0x15')][_0x5636('0x16')]('\x20')));}var _0x2ed259=schema(properties['voicequeuechannelhangup'])['validate'](_0x114b45);if(_0x2ed259[_0x5636('0x56')]>0x0){return _0x5cd795(_0xdc652[_0x5636('0x1d')](0x1f4,_[_0x5636('0x5b')](_0x2ed259,'message')[_0x5636('0x16')](',\x20')));}var _0x39ecb6=_[_0x5636('0x57')](_0x4ad69d[_0x5636('0x70')],{'uniqueid':_0x114b45[_0x5636('0x5c')]});if(_0x39ecb6&&_0x39ecb6[_0x5636('0x5d')]){return ami['Action']({'action':_0x5636('0x72'),'channel':_0x39ecb6[_0x5636('0x5d')]})[_0x5636('0x1a')](function(_0x1ba97d){_0x3dcc7c({'code':0xc8,'message':[_0x114b45[_0x5636('0x5c')],_0x1ba97d['message'][_0x5636('0x62')]()][_0x5636('0x16')]('\x20')});})['catch'](function(_0x535831){_0x5cd795(_0xdc652[_0x5636('0x1d')](0x1f5,[_0x114b45[_0x5636('0x5c')],_0x535831[_0x5636('0x1b')]['toLowerCase']()]['join']('\x20')));});}else{return _0x5cd795(_0xdc652[_0x5636('0x1d')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x2d7dfe){var _0x59dfd3=this;return new Promise(function(_0x3c8323,_0xc306f4){if(ami[_0x5636('0x12')]()==![]){return _0xc306f4(_0x59dfd3[_0x5636('0x1d')](0x1f4,[config['asterisk']['ip'],config[_0x5636('0x13')][_0x5636('0x14')],'ami\x20disconnected'][_0x5636('0x16')]('\x20')));}var _0x5474c1=schema(properties[_0x5636('0x73')])[_0x5636('0x3')](_0x2d7dfe);if(_0x5474c1[_0x5636('0x56')]>0x0){return _0xc306f4(_0x59dfd3[_0x5636('0x1d')](0x1f4,_[_0x5636('0x5b')](_0x5474c1,'message')['join'](',\x20')));}var _0x6e4d5d=_[_0x5636('0x57')](_0x4ad69d[_0x5636('0x70')],{'uniqueid':_0x2d7dfe[_0x5636('0x5c')]});if(_0x6e4d5d&&_0x6e4d5d[_0x5636('0x5d')]){return ami['Action']({'action':_0x5636('0x74'),'channel':_0x6e4d5d[_0x5636('0x5d')],'exten':_0x2d7dfe['exten'],'context':_0x2d7dfe[_0x5636('0x75')]||_0x6e4d5d[_0x5636('0x75')],'priority':0x1})[_0x5636('0x1a')](function(_0x4f6fe9){_0x3c8323({'code':0xc8,'message':[_0x2d7dfe[_0x5636('0x5c')],_0x4f6fe9[_0x5636('0x1b')][_0x5636('0x62')]()]['join']('\x20')});})[_0x5636('0x1c')](function(_0x2abee8){_0xc306f4(_0x59dfd3[_0x5636('0x1d')](0x1f5,[_0x2d7dfe['uniqueid'],_0x2abee8[_0x5636('0x1b')][_0x5636('0x62')]()][_0x5636('0x16')]('\x20')));});}else{return _0xc306f4(_0x59dfd3[_0x5636('0x1d')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x395f48){return new Promise(function(_0x5f07ed,_0x587ab6){var _0x579fad=_['values'](_0x4ad69d['agents']);_0x5f07ed({'count':_0x579fad[_0x5636('0x56')],'rows':_0x579fad});});},'Telephones':function(_0x52fa5f){return new Promise(function(_0x353ae4,_0x3ca005){var _0x539504=_['values'](_0x4ad69d[_0x5636('0x76')]);_0x353ae4({'count':_0x539504['length'],'rows':_0x539504});});},'Trunks':function(_0x513c44){return new Promise(function(_0x4228af,_0x2eebbb){var _0x29166d=_['values'](_0x4ad69d[_0x5636('0x77')]);_0x4228af({'count':_0x29166d[_0x5636('0x56')],'rows':_0x29166d});});},'OutboundChannels':function(_0x1cf7c3){return new Promise(function(_0x2e3d61,_0x3a77ae){var _0x395ab7=_[_0x5636('0x6f')](_0x4ad69d[_0x5636('0x78')]);_0x2e3d61({'count':_0x395ab7['length'],'rows':_0x395ab7});});},'Outbound':function(_0x361dfd){return new Promise(function(_0x5016a3,_0x543115){_0x5016a3(_0x4ad69d[_0x5636('0x2d')]);});},'Campaigns':function(_0x2ebd2a){return new Promise(function(_0x1d40ac,_0x2f7f43){var _0x551589=_[_0x5636('0x6f')](_0x4ad69d['campaigns']);_0x1d40ac({'count':_0x551589[_0x5636('0x56')],'rows':_0x551589});});},'VoiceQueuesPreview':function(_0x5c0922){var _0x1b1f27=this;return new Promise(function(_0xbae169,_0x3ad66d){_0x3be5f4[_0x5636('0x79')](_0x5c0922['id'])[_0x5636('0x1a')](function(_0x57656f){_0xbae169({'code':0xc8,'message':_0x57656f[_0x5636('0x1b')]});})[_0x5636('0x1c')](function(_0x5a614a){_0x3ad66d(_0x1b1f27[_0x5636('0x1d')](0x1f4,_0x5a614a[_0x5636('0x1b')]));});});},'EventManager':function(_0x463570){var _0x1b1c11=this;return new Promise(function(_0x3927e7,_0x24e865){if(!_0x463570[_0x5636('0x7a')]){return _0x24e865(_0x1b1c11['error'](0x1f4,_0x5636('0x7b')));}ami['emit'](_0x5636('0x7c')+_0x463570['event'],_0x463570['message']);_0x3927e7({'code':0xc8,'message':_0x463570});});},'FaxAccounts':function(_0x357071){return new Promise(function(_0x47f1b8,_0x3ab387){var _0x694217=_[_0x5636('0x6f')](_0x4ad69d[_0x5636('0x7d')]);_0x47f1b8({'count':_0x694217[_0x5636('0x56')],'rows':_0x694217});});},'SendFax':function(_0x421e93){var _0x4c2b7c=this;return new Promise(function(_0x50624b,_0x47394f){_0x230d78[_0x5636('0x7e')](_0x421e93)[_0x5636('0x1a')](function(_0x7db5){_0x50624b({'code':0xc8,'message':_0x7db5['message']});})[_0x5636('0x1c')](function(_0x18e401){_0x47394f(_0x4c2b7c[_0x5636('0x1d')](0x1f4,_0x18e401['message']));});});},'CheckAfterSend':function(_0xb8fe20){var _0x1bcd64=this;return new Promise(function(_0x1a977e,_0x3cdc4d){_0x230d78[_0x5636('0x7f')](_0xb8fe20)['then'](function(_0x46af20){_0x1a977e({'code':0xc8,'message':_0x46af20['message']});})[_0x5636('0x1c')](function(_0x204162){_0x3cdc4d(_0x1bcd64['error'](0x1f4,_0x204162[_0x5636('0x1b')]));});});}};var _0x99e89c=jayson[_0x5636('0x80')](_0x53d5b4)[_0x5636('0x81')]();_0x99e89c['on']('error',function(_0x4efd6e){return _0x3575b7(_0x4efd6e);});_0x99e89c['listen'](0x232a,'127.0.0.1',function(){console[_0x5636('0x82')](_0x5636('0x83'),0x232a);return _0x2a12df(_0x5636('0x84')+0x232a);});});}; \ No newline at end of file +var _0xee2c=['Interval','push','length','find','omit','undefined','values','channels','voicechannel','map','uniqueid','channel','%s.%s','filename','wav','Action','monitors','/var/spool/asterisk/monitor/','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','StopMixMonitor','destinationchannel','status','stop','queueChannels','voicequeuechannelhangup','voicequeuechannelredirect','exten','context','telephones','trunks','outbound','campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','send','checkAfterSend','server','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','validate','bluebird','moment','../ami','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','pause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','then','message','catch','command','content','voiceQueues','hasOwnProperty','strategy','answered','available','loggedIn','pTalking','sumDuration','sumHoldTime','talking','type','unmanaged','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','callerid'];(function(_0x1fae41,_0x7304c2){var _0x59be72=function(_0x3ccada){while(--_0x3ccada){_0x1fae41['push'](_0x1fae41['shift']());}};_0x59be72(++_0x7304c2);}(_0xee2c,0x1c7));var _0xcee2=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0xee2c[_0x42bdad];return _0x122626;};'use strict';var _=require(_0xcee2('0x0'));var util=require('util');var jayson=require(_0xcee2('0x1'));var schema=require(_0xcee2('0x2'));var BPromise=require(_0xcee2('0x3'));var moment=require(_0xcee2('0x4'));var config=require('../../../config/environment');var properties=require('../properties');var ami=require(_0xcee2('0x5'));exports[_0xcee2('0x6')]=function(_0x49d04d,_0xae585b,_0x409944){return new BPromise(function(_0x12fa86,_0x3d7611){var _0x24ce33={'QueuePause':function(_0x5a8219){return new Promise(function(_0x52a4ac,_0xea6c3c){var _0x2059ef=util[_0xcee2('0x7')](_0xcee2('0x8'),_0xcee2('0x9'),_0x5a8219[_0xcee2('0xa')]);if(_0x49d04d[_0xcee2('0xb')]&&_0x49d04d[_0xcee2('0xb')][_0x2059ef]&&_0x49d04d['timers'][_0x2059ef][_0xcee2('0xc')]){_0x49d04d[_0xcee2('0xb')][_0x2059ef][_0xcee2('0xd')]();}if(_0x49d04d[_0xcee2('0xe')][_0x2059ef]){_0x49d04d[_0xcee2('0xe')][_0x2059ef]['updateStatusRealtime']({'statePause':_0x5a8219[_0xcee2('0xf')]?!![]:![]});}_0x52a4ac({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x50a306){var _0x5dad1e=this;return new Promise(function(_0xfa663a,_0x34cc92){if(ami[_0xcee2('0x10')]()==![]){return _0x34cc92(_0x5dad1e[_0xcee2('0x11')](0x1f4,[config['asterisk']['ip'],config[_0xcee2('0x12')][_0xcee2('0x13')],_0xcee2('0x14')][_0xcee2('0x15')]('\x20')));}_0x50a306=_[_0xcee2('0x16')](_0x50a306,_[_0xcee2('0x17')](properties[_0xcee2('0x18')]));_0x50a306[_0xcee2('0x19')]=_0xcee2('0x1a');return ami['Action'](_0x50a306)[_0xcee2('0x1b')](function(_0x548e47){_0xfa663a({'code':0xc8,'message':_0x548e47[_0xcee2('0x1c')]});})[_0xcee2('0x1d')](function(_0x2b2ea0){_0x34cc92(_0x5dad1e[_0xcee2('0x11')](0x1f5,_0x2b2ea0['message']));});});},'Command':function(_0x245811){var _0x317659=this;return new Promise(function(_0x19022a,_0x36af7f){if(ami[_0xcee2('0x10')]()==![]){return _0x36af7f(_0x317659[_0xcee2('0x11')](0x1f4,[config[_0xcee2('0x12')]['ip'],config[_0xcee2('0x12')][_0xcee2('0x13')],_0xcee2('0x14')][_0xcee2('0x15')]('\x20')));}_0x245811=_['pick'](_0x245811,_0xcee2('0x1e'));_0x245811[_0xcee2('0x19')]='Command';return ami['Action'](_0x245811)[_0xcee2('0x1b')](function(_0x4fa083){_0x19022a({'code':0xc8,'message':_0x4fa083[_0xcee2('0x1f')]});})[_0xcee2('0x1d')](function(_0x2edef5){_0x36af7f(_0x317659['error'](0x1f5,_0x2edef5['message']));});});},'VoiceQueues':function(_0x20a6de){return new Promise(function(_0x2ccc9c,_0x22789d){var _0x5905f6=[];for(var _0x2f18ec in _0x49d04d['voiceQueues']){if(_0x49d04d[_0xcee2('0x20')][_0xcee2('0x21')](_0x2f18ec)){var _0x14615a=_0x49d04d[_0xcee2('0x20')][_0x2f18ec];var _0x84d7c={'id':_0x14615a['id'],'name':_0x14615a[_0xcee2('0xa')],'strategy':_0x14615a[_0xcee2('0x22')],'answered':_0x14615a[_0xcee2('0x23')],'available':_0x14615a[_0xcee2('0x24')],'loggedIn':_0x14615a[_0xcee2('0x25')],'pTalking':_0x14615a[_0xcee2('0x26')],'sumBillable':_0x14615a['sumBillable'],'sumDuration':_0x14615a[_0xcee2('0x27')],'sumHoldTime':_0x14615a[_0xcee2('0x28')]||0x0,'talking':_0x14615a[_0xcee2('0x29')],'total':_0x14615a['total'],'type':_0x14615a[_0xcee2('0x2a')],'unmanaged':_0x14615a[_0xcee2('0x2b')],'abandoned':_0x14615a['abandoned'],'waiting':_0x14615a[_0xcee2('0x2c')],'loggedInDb':_0x14615a[_0xcee2('0x2d')]};if(_0x14615a['type']==='outbound'){_0x84d7c[_0xcee2('0x2e')]=_0x14615a['dialActive'];_0x84d7c['dialMethod']=_0x14615a[_0xcee2('0x2f')];_0x84d7c[_0xcee2('0x30')]=_0x14615a['dialOriginateCallerIdName'];_0x84d7c[_0xcee2('0x31')]=_0x14615a[_0xcee2('0x31')];_0x84d7c[_0xcee2('0x32')]=_0x14615a[_0xcee2('0x32')];_0x84d7c[_0xcee2('0x33')]=_0x14615a[_0xcee2('0x33')];_0x84d7c[_0xcee2('0x34')]=_0x14615a[_0xcee2('0x34')];_0x84d7c[_0xcee2('0x35')]=_0x14615a[_0xcee2('0x35')];_0x84d7c[_0xcee2('0x36')]=_0x14615a[_0xcee2('0x36')];_0x84d7c['outboundBlacklistCallsDay']=_0x14615a[_0xcee2('0x37')];_0x84d7c[_0xcee2('0x38')]=_0x14615a['outboundBusyCallsDay'];_0x84d7c[_0xcee2('0x39')]=_0x14615a[_0xcee2('0x39')];_0x84d7c['outboundDropCallsDayACS']=_0x14615a[_0xcee2('0x3a')];_0x84d7c[_0xcee2('0x3b')]=_0x14615a[_0xcee2('0x3b')];_0x84d7c['outboundDropCallsDayTimeout']=_0x14615a[_0xcee2('0x3c')];_0x84d7c[_0xcee2('0x3d')]=_0x14615a[_0xcee2('0x3d')];_0x84d7c[_0xcee2('0x3e')]=_0x14615a[_0xcee2('0x3e')];_0x84d7c[_0xcee2('0x3f')]=_0x14615a['outboundOriginateFailureCallsDay'];_0x84d7c[_0xcee2('0x40')]=_0x14615a[_0xcee2('0x40')];_0x84d7c[_0xcee2('0x41')]=_0x14615a['outboundRejectCallsDay'];_0x84d7c[_0xcee2('0x42')]=_0x14615a['outboundUnknownCallsDay'];_0x84d7c['predictiveIntervalAnsweredCalls']=_0x14615a[_0xcee2('0x43')];_0x84d7c[_0xcee2('0x44')]=_0x14615a[_0xcee2('0x44')];_0x84d7c[_0xcee2('0x45')]=_0x14615a[_0xcee2('0x45')];_0x84d7c[_0xcee2('0x46')]=_0x14615a['predictiveIntervalDroppedCallsCallersExit'];_0x84d7c['predictiveIntervalDroppedCallsTimeout']=_0x14615a['predictiveIntervalDroppedCallsTimeout'];_0x84d7c[_0xcee2('0x47')]=_0x14615a['predictiveIntervalErlangCalls'];_0x84d7c[_0xcee2('0x48')]=_0x14615a[_0xcee2('0x48')];_0x84d7c['predictiveIntervalHitRate']=_0x14615a[_0xcee2('0x49')];_0x84d7c['predictiveIntervalMultiplicativeFactor']=_0x14615a['predictiveIntervalMultiplicativeFactor'];_0x84d7c[_0xcee2('0x4a')]=_0x14615a[_0xcee2('0x4a')];_0x84d7c['predictiveIntervalAvailable']=_0x14615a['predictiveIntervalAvailable'];_0x84d7c[_0xcee2('0x4b')]=_0x14615a[_0xcee2('0x4b')];_0x84d7c[_0xcee2('0x1c')]=_0x14615a[_0xcee2('0x1c')];_0x84d7c[_0xcee2('0x4c')]=_0x14615a[_0xcee2('0x4c')];_0x84d7c[_0xcee2('0x4d')]=_0x14615a[_0xcee2('0x4d')];_0x84d7c[_0xcee2('0x4e')]=_0x14615a['erlangCallToSecond'];_0x84d7c[_0xcee2('0x4f')]=_0x14615a[_0xcee2('0x4f')];_0x84d7c[_0xcee2('0x50')]=_0x14615a[_0xcee2('0x50')];_0x84d7c['startPredictive']=_0x14615a[_0xcee2('0x51')];_0x84d7c[_0xcee2('0x52')]=_0x14615a[_0xcee2('0x52')];}if(_0x14615a[_0xcee2('0x53')]){_0x84d7c[_0xcee2('0x53')]={'id':_0x14615a[_0xcee2('0x53')]['id'],'name':_0x14615a[_0xcee2('0x53')][_0xcee2('0xa')],'active':_0x14615a[_0xcee2('0x53')]['active'],'callerid':_0x14615a[_0xcee2('0x53')][_0xcee2('0x54')]};}if(_0x14615a[_0xcee2('0x55')]){_0x84d7c['Interval']={'id':_0x14615a[_0xcee2('0x55')]['id'],'name':_0x14615a[_0xcee2('0x55')][_0xcee2('0xa')]};}_0x5905f6[_0xcee2('0x56')](_0x84d7c);}}_0x2ccc9c({'count':_0x5905f6[_0xcee2('0x57')],'rows':_0x5905f6});});},'UpdateVoiceQueue':function(_0x1a883a){return new Promise(function(_0x2f3cdd,_0x3af08a){var _0x27ec54=_[_0xcee2('0x58')](_0x49d04d[_0xcee2('0x20')],{'id':parseInt(_0x1a883a['id'])});var _0x4720c0=_[_0xcee2('0x59')](_0x1a883a,['id']);if(_0x27ec54){for(var _0xa98bc1 in _0x4720c0){if(typeof _0x4720c0[_0xa98bc1]!=='undefined'&&typeof _0x27ec54[_0xa98bc1]!==_0xcee2('0x5a')){_0x27ec54[_0xa98bc1]=_0x4720c0[_0xa98bc1];}}_0x2f3cdd(_0x27ec54);}else{_0x3af08a();}});},'VoiceChannels':function(_0x54ab70){return new Promise(function(_0x52c037,_0xe69b91){var _0x399291=_[_0xcee2('0x5b')](_0x49d04d[_0xcee2('0x5c')]);_0x52c037({'count':_0x399291[_0xcee2('0x57')],'rows':_0x399291});});},'VoiceChannelMixMonitor':function(_0x5e5011){var _0x10d8a6=this;return new Promise(function(_0x4b9864,_0x2f6cf0){if(ami[_0xcee2('0x10')]()==![]){return _0x2f6cf0(_0x10d8a6[_0xcee2('0x11')](0x1f4,[config[_0xcee2('0x12')]['ip'],config[_0xcee2('0x12')][_0xcee2('0x13')],_0xcee2('0x14')]['join']('\x20')));}var _0xfbd8d2=schema(properties[_0xcee2('0x5d')])[_0xcee2('0x2')](_0x5e5011);if(_0xfbd8d2[_0xcee2('0x57')]>0x0){return _0x2f6cf0(_0x10d8a6[_0xcee2('0x11')](0x1f4,_[_0xcee2('0x5e')](_0xfbd8d2,_0xcee2('0x1c'))[_0xcee2('0x15')](',\x20')));}var _0x228c88=_['find'](_0x49d04d['channels'],{'uniqueid':_0x5e5011[_0xcee2('0x5f')]});if(_0x228c88&&_0x228c88[_0xcee2('0x60')]){var _0x4b888f=util[_0xcee2('0x7')](_0xcee2('0x61'),_0x5e5011[_0xcee2('0x62')]||_0x5e5011[_0xcee2('0x5f')],_0x5e5011[_0xcee2('0x7')]||_0xcee2('0x63'));return ami[_0xcee2('0x64')]({'action':'MixMonitor','channel':_0x228c88['channel'],'file':_0x4b888f,'options':'ai(mixmonitorid)'})[_0xcee2('0x1b')](function(_0x3e0aa8){var _0x841efa=_['find'](_0x228c88[_0xcee2('0x65')],{'filename':_0xcee2('0x66')+_0x4b888f[_0xcee2('0x67')]()});if(_['isNil'](_0x841efa)){_0x228c88[_0xcee2('0x65')][_0xcee2('0x56')]({'filename':_0xcee2('0x66')+_0x4b888f['toLowerCase'](),'createdAt':moment()[_0xcee2('0x7')](_0xcee2('0x68')),'mixmonitorid':_0x3e0aa8[_0xcee2('0x69')],'status':_0xcee2('0x6a')});}else{_0x841efa['mixmonitorid']=_0x3e0aa8['mixmonitorid'];_0x841efa['status']=_0xcee2('0x6a');}_0x4b9864({'code':0xc8,'message':[_0x5e5011[_0xcee2('0x5f')],_0xcee2('0x6b'),_0x3e0aa8[_0xcee2('0x69')]][_0xcee2('0x15')]('\x20'),'mixmonitorid':_0x3e0aa8[_0xcee2('0x69')]});})[_0xcee2('0x1d')](function(_0x4c9a97){_0x2f6cf0(_0x10d8a6[_0xcee2('0x11')](0x1f5,[_0x5e5011[_0xcee2('0x5f')],_0x4c9a97[_0xcee2('0x1c')]['toLowerCase']()][_0xcee2('0x15')]('\x20')));});}else{return _0x2f6cf0(_0x10d8a6[_0xcee2('0x11')](0x1f5,_0xcee2('0x6c')));}});},'VoiceChannelStopMixMonitor':function(_0x1bb852){var _0x289744=this;return new Promise(function(_0x310098,_0x325f62){if(ami[_0xcee2('0x10')]()==![]){return _0x325f62(_0x289744['error'](0x1f4,[config[_0xcee2('0x12')]['ip'],config[_0xcee2('0x12')][_0xcee2('0x13')],_0xcee2('0x14')][_0xcee2('0x15')]('\x20')));}var _0x297e70=schema(properties[_0xcee2('0x5d')])[_0xcee2('0x2')](_0x1bb852);if(_0x297e70[_0xcee2('0x57')]>0x0){return _0x325f62(_0x289744[_0xcee2('0x11')](0x1f4,_['map'](_0x297e70,'message')[_0xcee2('0x15')](',\x20')));}var _0xaf7f73=_[_0xcee2('0x58')](_0x49d04d['channels'],{'uniqueid':_0x1bb852['uniqueid']});if(_0xaf7f73){return BPromise['resolve']()[_0xcee2('0x1b')](function(){if(_0xaf7f73['channel']){return ami['Action']({'action':_0xcee2('0x6d'),'channel':_0xaf7f73['channel'],'mixmonitorid':_0x1bb852[_0xcee2('0x69')]})[_0xcee2('0x1d')](function(_0x4920a1){});}})[_0xcee2('0x1b')](function(){if(_0xaf7f73[_0xcee2('0x6e')]){return ami['Action']({'action':'StopMixMonitor','channel':_0xaf7f73[_0xcee2('0x6e')],'mixmonitorid':_0x1bb852[_0xcee2('0x69')]})[_0xcee2('0x1d')](function(_0x1b07b5){});}})[_0xcee2('0x1b')](function(_0x4faaef){var _0x41521f=_[_0xcee2('0x58')](_0xaf7f73[_0xcee2('0x65')],{'mixmonitorid':_0x1bb852[_0xcee2('0x69')]});if(_0x41521f){_0x41521f[_0xcee2('0x6f')]=_0xcee2('0x70');}})[_0xcee2('0x1b')](function(){var _0xa2f8b0=util[_0xcee2('0x7')](_0xcee2('0x61'),_0x1bb852[_0xcee2('0x62')]||_0x1bb852[_0xcee2('0x5f')],_0x1bb852['format']||_0xcee2('0x63'));var _0x19feb8=_[_0xcee2('0x58')](_0xaf7f73['monitors'],{'filename':'/var/spool/asterisk/monitor/'+_0xa2f8b0[_0xcee2('0x67')]()});if(_0x19feb8){_0x19feb8[_0xcee2('0x6f')]=_0xcee2('0x70');}})[_0xcee2('0x1b')](function(){_0x310098({'code':0xc8,'message':[_0x1bb852['uniqueid'],'StopMixMonitor\x20Success'][_0xcee2('0x15')]('\x20')});})[_0xcee2('0x1d')](function(_0x81f30a){_0x325f62(_0x289744[_0xcee2('0x11')](0x1f5,[_0x1bb852[_0xcee2('0x5f')],_0x81f30a['message']['toLowerCase']()][_0xcee2('0x15')]('\x20')));});}else{return _0x325f62(_0x289744[_0xcee2('0x11')](0x1f5,_0xcee2('0x6c')));}});},'VoiceQueuesChannels':function(_0xd39003){return new Promise(function(_0x3ba2d0,_0x4ea04a){var _0x3796cf=_['values'](_0x49d04d[_0xcee2('0x71')]);_0x3ba2d0({'count':_0x3796cf[_0xcee2('0x57')],'rows':_0x3796cf});});},'VoiceQueuesChannel':function(_0x2c9497){var _0x3f11e2=this;return new Promise(function(_0x59d2fe,_0xc64dbb){var _0x4edaba=schema(properties['voicequeuechannel'])[_0xcee2('0x2')](_0x2c9497);if(_0x4edaba[_0xcee2('0x57')]>0x0){return _0xc64dbb(_0x3f11e2[_0xcee2('0x11')](0x1f4,_[_0xcee2('0x5e')](_0x4edaba,'message')[_0xcee2('0x15')](',\x20')));}var _0x51599d=_['find'](_0x49d04d[_0xcee2('0x71')],{'uniqueid':_0x2c9497[_0xcee2('0x5f')]});if(_0x51599d){_0x59d2fe(_0x51599d);}else{return _0xc64dbb(_0x3f11e2[_0xcee2('0x11')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x17cd07){var _0x5bbd36=this;return new Promise(function(_0x1c7436,_0x5a44be){if(ami[_0xcee2('0x10')]()==![]){return _0x5a44be(_0x5bbd36['error'](0x1f4,[config[_0xcee2('0x12')]['ip'],config[_0xcee2('0x12')][_0xcee2('0x13')],_0xcee2('0x14')][_0xcee2('0x15')]('\x20')));}var _0x43bf19=schema(properties[_0xcee2('0x72')])[_0xcee2('0x2')](_0x17cd07);if(_0x43bf19[_0xcee2('0x57')]>0x0){return _0x5a44be(_0x5bbd36[_0xcee2('0x11')](0x1f4,_[_0xcee2('0x5e')](_0x43bf19,_0xcee2('0x1c'))[_0xcee2('0x15')](',\x20')));}var _0x292549=_[_0xcee2('0x58')](_0x49d04d[_0xcee2('0x71')],{'uniqueid':_0x17cd07[_0xcee2('0x5f')]});if(_0x292549&&_0x292549[_0xcee2('0x60')]){return ami[_0xcee2('0x64')]({'action':'Hangup','channel':_0x292549[_0xcee2('0x60')]})[_0xcee2('0x1b')](function(_0x586b40){_0x1c7436({'code':0xc8,'message':[_0x17cd07[_0xcee2('0x5f')],_0x586b40[_0xcee2('0x1c')][_0xcee2('0x67')]()][_0xcee2('0x15')]('\x20')});})[_0xcee2('0x1d')](function(_0x355834){_0x5a44be(_0x5bbd36[_0xcee2('0x11')](0x1f5,[_0x17cd07[_0xcee2('0x5f')],_0x355834[_0xcee2('0x1c')][_0xcee2('0x67')]()]['join']('\x20')));});}else{return _0x5a44be(_0x5bbd36[_0xcee2('0x11')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x109b85){var _0x2907f1=this;return new Promise(function(_0x132436,_0x4025f2){if(ami['isConnected']()==![]){return _0x4025f2(_0x2907f1['error'](0x1f4,[config[_0xcee2('0x12')]['ip'],config['asterisk'][_0xcee2('0x13')],_0xcee2('0x14')][_0xcee2('0x15')]('\x20')));}var _0x10db5b=schema(properties[_0xcee2('0x73')])['validate'](_0x109b85);if(_0x10db5b['length']>0x0){return _0x4025f2(_0x2907f1[_0xcee2('0x11')](0x1f4,_[_0xcee2('0x5e')](_0x10db5b,'message')['join'](',\x20')));}var _0x1f1676=_[_0xcee2('0x58')](_0x49d04d[_0xcee2('0x71')],{'uniqueid':_0x109b85['uniqueid']});if(_0x1f1676&&_0x1f1676['channel']){return ami[_0xcee2('0x64')]({'action':'Redirect','channel':_0x1f1676['channel'],'exten':_0x109b85[_0xcee2('0x74')],'context':_0x109b85[_0xcee2('0x75')]||_0x1f1676[_0xcee2('0x75')],'priority':0x1})[_0xcee2('0x1b')](function(_0xf3d804){_0x132436({'code':0xc8,'message':[_0x109b85[_0xcee2('0x5f')],_0xf3d804[_0xcee2('0x1c')][_0xcee2('0x67')]()][_0xcee2('0x15')]('\x20')});})[_0xcee2('0x1d')](function(_0x21bbb5){_0x4025f2(_0x2907f1[_0xcee2('0x11')](0x1f5,[_0x109b85[_0xcee2('0x5f')],_0x21bbb5[_0xcee2('0x1c')]['toLowerCase']()][_0xcee2('0x15')]('\x20')));});}else{return _0x4025f2(_0x2907f1[_0xcee2('0x11')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x2057fb){return new Promise(function(_0x203572,_0x472e15){var _0x58511f=_['values'](_0x49d04d['agents']);_0x203572({'count':_0x58511f[_0xcee2('0x57')],'rows':_0x58511f});});},'Telephones':function(_0x2afc1e){return new Promise(function(_0x2d1a5e,_0x10fd3a){var _0x5e2d43=_['values'](_0x49d04d[_0xcee2('0x76')]);_0x2d1a5e({'count':_0x5e2d43[_0xcee2('0x57')],'rows':_0x5e2d43});});},'Trunks':function(_0x42cd1d){return new Promise(function(_0x255f8a,_0x10c8c4){var _0x56900e=_[_0xcee2('0x5b')](_0x49d04d[_0xcee2('0x77')]);_0x255f8a({'count':_0x56900e[_0xcee2('0x57')],'rows':_0x56900e});});},'OutboundChannels':function(_0x4c755a){return new Promise(function(_0x19c2e4,_0x28f6a9){var _0x51f8ff=_[_0xcee2('0x5b')](_0x49d04d['outboundChannels']);_0x19c2e4({'count':_0x51f8ff[_0xcee2('0x57')],'rows':_0x51f8ff});});},'Outbound':function(_0x30848b){return new Promise(function(_0x31c0f6,_0x6e6bff){_0x31c0f6(_0x49d04d[_0xcee2('0x78')]);});},'Campaigns':function(_0x4d753f){return new Promise(function(_0x51c204,_0x977c1a){var _0xc18245=_['values'](_0x49d04d[_0xcee2('0x79')]);_0x51c204({'count':_0xc18245[_0xcee2('0x57')],'rows':_0xc18245});});},'VoiceQueuesPreview':function(_0x1ecbbf){var _0x352100=this;return new Promise(function(_0x2c3d40,_0x58e5e5){_0xae585b[_0xcee2('0x7a')](_0x1ecbbf['id'])[_0xcee2('0x1b')](function(_0x3163d7){_0x2c3d40({'code':0xc8,'message':_0x3163d7[_0xcee2('0x1c')]});})['catch'](function(_0x3ba30c){_0x58e5e5(_0x352100[_0xcee2('0x11')](0x1f4,_0x3ba30c[_0xcee2('0x1c')]));});});},'EventManager':function(_0x1c18c0){var _0xdc2285=this;return new Promise(function(_0x13748b,_0xad1457){if(!_0x1c18c0[_0xcee2('0x7b')]){return _0xad1457(_0xdc2285[_0xcee2('0x11')](0x1f4,_0xcee2('0x7c')));}ami[_0xcee2('0x7d')](_0xcee2('0x7e')+_0x1c18c0[_0xcee2('0x7b')],_0x1c18c0[_0xcee2('0x1c')]);_0x13748b({'code':0xc8,'message':_0x1c18c0});});},'FaxAccounts':function(_0x2d0bfb){return new Promise(function(_0x49a1a5,_0x46c635){var _0x450e2a=_[_0xcee2('0x5b')](_0x49d04d['faxAccounts']);_0x49a1a5({'count':_0x450e2a[_0xcee2('0x57')],'rows':_0x450e2a});});},'SendFax':function(_0x75e016){var _0x5a8347=this;return new Promise(function(_0x3365ee,_0x532417){_0x409944[_0xcee2('0x7f')](_0x75e016)[_0xcee2('0x1b')](function(_0x257650){_0x3365ee({'code':0xc8,'message':_0x257650[_0xcee2('0x1c')]});})[_0xcee2('0x1d')](function(_0x17c838){_0x532417(_0x5a8347[_0xcee2('0x11')](0x1f4,_0x17c838[_0xcee2('0x1c')]));});});},'CheckAfterSend':function(_0x1db3c3){var _0x467911=this;return new Promise(function(_0x26ed21,_0x292045){_0x409944[_0xcee2('0x80')](_0x1db3c3)[_0xcee2('0x1b')](function(_0x5e8544){_0x26ed21({'code':0xc8,'message':_0x5e8544[_0xcee2('0x1c')]});})[_0xcee2('0x1d')](function(_0x558776){_0x292045(_0x467911[_0xcee2('0x11')](0x1f4,_0x558776[_0xcee2('0x1c')]));});});}};var _0x18b013=jayson[_0xcee2('0x81')](_0x24ce33)[_0xcee2('0x82')]();_0x18b013['on'](_0xcee2('0x11'),function(_0x1fce50){return _0x3d7611(_0x1fce50);});_0x18b013[_0xcee2('0x6')](0x232a,_0xcee2('0x83'),function(){console[_0xcee2('0x84')](_0xcee2('0x85'),0x232a);return _0x12fa86(_0xcee2('0x86')+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 9161b95..8527859 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 _0xda55=['name','trigger:%s','action','merge','length','lodash','bluebird','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','socket.io-emitter','info','[CM][%s][%s]','stringify','exec','data1','data2','isNil','data5','ListId','data3','split','phone','$or','routeId','destcalleridnum','calleridnum','lastName','mobile','fax','scheduledAt','updatedAt','resolve','then','getContacts','isEmpty','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','map','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','firstName','calleridname','','Unknown','destcalleridname','[CM][%s][%s]\x20Autocreate\x20disabled','push','format'];(function(_0x38555f,_0x2f8ff4){var _0xa5f55b=function(_0xac77d5){while(--_0xac77d5){_0x38555f['push'](_0x38555f['shift']());}};_0xa5f55b(++_0x2f8ff4);}(_0xda55,0x6d));var _0x5da5=function(_0x5b73ff,_0x1cba4d){_0x5b73ff=_0x5b73ff-0x0;var _0x1c4ba4=_0xda55[_0x5b73ff];return _0x1c4ba4;};'use strict';var _=require(_0x5da5('0x0'));var BPromise=require(_0x5da5('0x1'));var Redis=require('ioredis');var util=require('util');var config=require(_0x5da5('0x2'));var logger=require(_0x5da5('0x3'))(_0x5da5('0x4'));var cmContactRpc=require(_0x5da5('0x5'));config[_0x5da5('0x6')]=_['defaults'](config[_0x5da5('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x5da5('0x7'))(new Redis(config['redis']));function emit(_0x2fd877,_0x267469,_0x71b187,_0x46290d,_0x3debdf){logger[_0x5da5('0x8')](_0x5da5('0x9'),_0x2fd877,_0x267469['id'],_0x71b187,_0x46290d,JSON[_0x5da5('0xa')](_0x3debdf));io['to'](_0x71b187)['emit'](_0x46290d,_0x3debdf);}exports[_0x5da5('0xb')]=function(_0x1f98a7,_0x2731a3,_0x26fbe3,_0x1a047e){var _0x2a361c,_0x33313e;var _0x589c14={};var _0x2f4e4b=Number(_0x26fbe3[_0x5da5('0xc')]);var _0x4f813b=_0x26fbe3[_0x5da5('0xd')]?Boolean(Number(_0x26fbe3[_0x5da5('0xd')])):![];var _0x3ced00;var _0x43d526=![];if(!_[_0x5da5('0xe')](_0x26fbe3[_0x5da5('0xf')])){if(_0x26fbe3['data5']=='1')_0x43d526=!![];}if(!_0x43d526){if(_0x1a047e['xmd-contactid']){_0x589c14['id']=_0x1a047e['xmd-contactid'];}}if(!_0x589c14['id']){_0x589c14[_0x5da5('0x10')]=_0x2f4e4b;_0x3ced00=_0x26fbe3[_0x5da5('0x11')]&&_0x26fbe3[_0x5da5('0x11')]!=='0'?_0x26fbe3[_0x5da5('0x11')][_0x5da5('0x12')](','):[_0x5da5('0x13')];_0x589c14[_0x5da5('0x14')]=_['map'](_0x3ced00,function(_0x124dc5){var _0x290136={};_0x290136[_0x124dc5]=_0x1a047e[_0x5da5('0x15')]?_0x1a047e[_0x5da5('0x16')]:_0x1a047e[_0x5da5('0x17')];return _0x290136;});}var _0x428b07=['id','firstName',_0x5da5('0x18'),_0x5da5('0x13'),_0x5da5('0x19'),_0x5da5('0x1a'),_0x5da5('0x10'),'createdAt',_0x5da5('0x1b'),_0x5da5('0x1c')];var _0x42a3cb=_['union'](_0x428b07,_0x3ced00);BPromise[_0x5da5('0x1d')]()[_0x5da5('0x1e')](cmContactRpc[_0x5da5('0x1f')]({'attributes':_0x42a3cb,'where':_0x589c14}))[_0x5da5('0x1e')](function(_0xec69f2){_0x33313e=_0xec69f2;if(!_[_0x5da5('0x20')](_0x33313e)){if(_0x33313e['length']===0x1){_0x2a361c=_0x33313e[0x0];logger[_0x5da5('0x8')]('[CM][%s][%s]\x20Contact\x20found:%s',_0x1a047e[_0x5da5('0x21')],_0x2731a3['id'],_0x2a361c['id']);}else{logger[_0x5da5('0x8')](_0x5da5('0x22'),_0x1a047e['uniqueid'],_0x2731a3['id'],_[_0x5da5('0x23')](_0x33313e,'id')[_0x5da5('0x24')](','));}return;}else{logger[_0x5da5('0x8')](_0x5da5('0x25'),_0x1a047e['uniqueid'],_0x2731a3['id']);var _0x5b0b43={'ListId':_0x2f4e4b};var _0x50aadc=_0x26fbe3[_0x5da5('0x26')]&&_0x26fbe3['data4']!=='0'?_0x26fbe3['data4']:_0x5da5('0x13');if(_0x4f813b){logger[_0x5da5('0x8')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x1a047e[_0x5da5('0x21')],_0x2731a3['id']);_0x5b0b43[_0x50aadc]=_[_0x5da5('0xe')](_0x1a047e['routeId'])?_0x1a047e[_0x5da5('0x17')]:_0x1a047e[_0x5da5('0x16')];if(_[_0x5da5('0xe')](_0x1a047e[_0x5da5('0x15')])){_0x5b0b43[_0x5da5('0x27')]=_0x1a047e['calleridname']&&_0x1a047e[_0x5da5('0x28')]!==_0x5da5('0x29')?_0x1a047e[_0x5da5('0x28')]:_0x5da5('0x2a');}else{_0x5b0b43['firstName']=_0x1a047e['destcalleridname']&&_0x1a047e['destcalleridname']!==_0x5da5('0x29')?_0x1a047e[_0x5da5('0x2b')]:_0x5da5('0x2a');}return BPromise[_0x5da5('0x1d')]()['then'](cmContactRpc['createContact'](_0x5b0b43))[_0x5da5('0x1e')](function(_0x4afb58){_0x2a361c=_0x4afb58;_0x33313e['push'](_0x4afb58);if(_0x2a361c){logger[_0x5da5('0x8')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x1a047e[_0x5da5('0x21')],_0x2731a3['id'],_0x2a361c['id']);}return;});}else{logger[_0x5da5('0x8')](_0x5da5('0x2c'),_0x1a047e[_0x5da5('0x21')],_0x2731a3['id']);_0x5b0b43[_0x50aadc]=_[_0x5da5('0xe')](_0x1a047e[_0x5da5('0x15')])?_0x1a047e[_0x5da5('0x17')]:_0x1a047e[_0x5da5('0x16')];if(_['isNil'](_0x1a047e[_0x5da5('0x15')])){_0x5b0b43['firstName']=_0x1a047e[_0x5da5('0x28')]&&_0x1a047e[_0x5da5('0x28')]!==_0x5da5('0x29')?_0x1a047e[_0x5da5('0x28')]:_0x5da5('0x2a');}else{_0x5b0b43[_0x5da5('0x27')]=_0x1a047e[_0x5da5('0x2b')]&&_0x1a047e[_0x5da5('0x2b')]!==_0x5da5('0x29')?_0x1a047e[_0x5da5('0x2b')]:_0x5da5('0x2a');}_0x2a361c=_0x5b0b43;_0x33313e[_0x5da5('0x2d')](_0x5b0b43);return;}}})[_0x5da5('0x1e')](function(){if(_0x1f98a7){emit(_0x1a047e['uniqueid'],_0x2731a3,util[_0x5da5('0x2e')]('user:%s',_0x1f98a7[_0x5da5('0x2f')]),util[_0x5da5('0x2e')](_0x5da5('0x30'),_0x26fbe3[_0x5da5('0x31')]['toLowerCase']()),{'evt':_[_0x5da5('0x32')](_0x1a047e,{'autoCreate':_0x4f813b}),'contact':_0x2a361c===undefined?{}:_0x2a361c,'contacts':_0x33313e[_0x5da5('0x33')]===0x0?undefined:_0x33313e});}});}; \ No newline at end of file +var _0xedd9=['data3','phone','$or','map','routeId','destcalleridnum','lastName','scheduledAt','union','resolve','then','isEmpty','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','isNil','calleridnum','firstName','calleridname','','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','user:%s','name','format','trigger:%s','action','toLowerCase','merge','length','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','localhost','socket.io-emitter','info','[CM][%s][%s]','emit','data1','data2','data5','xmd-contactid','ListId'];(function(_0x26e319,_0x782049){var _0x32dcd7=function(_0x59d771){while(--_0x59d771){_0x26e319['push'](_0x26e319['shift']());}};_0x32dcd7(++_0x782049);}(_0xedd9,0xfc));var _0x9edd=function(_0x402045,_0x1c5977){_0x402045=_0x402045-0x0;var _0x30b313=_0xedd9[_0x402045];return _0x30b313;};'use strict';var _=require('lodash');var BPromise=require(_0x9edd('0x0'));var Redis=require(_0x9edd('0x1'));var util=require(_0x9edd('0x2'));var config=require(_0x9edd('0x3'));var logger=require(_0x9edd('0x4'))(_0x9edd('0x5'));var cmContactRpc=require(_0x9edd('0x6'));config[_0x9edd('0x7')]=_['defaults'](config[_0x9edd('0x7')],{'host':_0x9edd('0x8'),'port':0x18eb});var io=require(_0x9edd('0x9'))(new Redis(config[_0x9edd('0x7')]));function emit(_0x5319f7,_0xf0b2d8,_0x571af9,_0x172522,_0x190185){logger[_0x9edd('0xa')](_0x9edd('0xb'),_0x5319f7,_0xf0b2d8['id'],_0x571af9,_0x172522,JSON['stringify'](_0x190185));io['to'](_0x571af9)[_0x9edd('0xc')](_0x172522,_0x190185);}exports['exec']=function(_0x2076fc,_0x138767,_0x523026,_0xbf9da6){var _0x13dc4f,_0x5b6c00;var _0x30c0d7={};var _0x1b73d1=Number(_0x523026[_0x9edd('0xd')]);var _0xfd544a=_0x523026[_0x9edd('0xe')]?Boolean(Number(_0x523026[_0x9edd('0xe')])):![];var _0xfca576;var _0xef5498=![];if(!_['isNil'](_0x523026[_0x9edd('0xf')])){if(_0x523026[_0x9edd('0xf')]=='1')_0xef5498=!![];}if(!_0xef5498){if(_0xbf9da6[_0x9edd('0x10')]){_0x30c0d7['id']=_0xbf9da6[_0x9edd('0x10')];}}if(!_0x30c0d7['id']){_0x30c0d7[_0x9edd('0x11')]=_0x1b73d1;_0xfca576=_0x523026[_0x9edd('0x12')]&&_0x523026[_0x9edd('0x12')]!=='0'?_0x523026[_0x9edd('0x12')]['split'](','):[_0x9edd('0x13')];_0x30c0d7[_0x9edd('0x14')]=_[_0x9edd('0x15')](_0xfca576,function(_0x5acf65){var _0x1b54c0={};_0x1b54c0[_0x5acf65]=_0xbf9da6[_0x9edd('0x16')]?_0xbf9da6[_0x9edd('0x17')]:_0xbf9da6['calleridnum'];return _0x1b54c0;});}var _0x43dc70=['id','firstName',_0x9edd('0x18'),_0x9edd('0x13'),'mobile','fax',_0x9edd('0x11'),'createdAt',_0x9edd('0x19'),'updatedAt'];var _0x535f37=_[_0x9edd('0x1a')](_0x43dc70,_0xfca576);BPromise[_0x9edd('0x1b')]()['then'](cmContactRpc['getContacts']({'attributes':_0x535f37,'where':_0x30c0d7}))[_0x9edd('0x1c')](function(_0x186186){_0x5b6c00=_0x186186;if(!_[_0x9edd('0x1d')](_0x5b6c00)){if(_0x5b6c00['length']===0x1){_0x13dc4f=_0x5b6c00[0x0];logger[_0x9edd('0xa')](_0x9edd('0x1e'),_0xbf9da6[_0x9edd('0x1f')],_0x138767['id'],_0x13dc4f['id']);}else{logger[_0x9edd('0xa')](_0x9edd('0x20'),_0xbf9da6['uniqueid'],_0x138767['id'],_[_0x9edd('0x15')](_0x5b6c00,'id')[_0x9edd('0x21')](','));}return;}else{logger[_0x9edd('0xa')](_0x9edd('0x22'),_0xbf9da6[_0x9edd('0x1f')],_0x138767['id']);var _0x4d507f={'ListId':_0x1b73d1};var _0x4b3d1b=_0x523026[_0x9edd('0x23')]&&_0x523026[_0x9edd('0x23')]!=='0'?_0x523026[_0x9edd('0x23')]:_0x9edd('0x13');if(_0xfd544a){logger[_0x9edd('0xa')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0xbf9da6['uniqueid'],_0x138767['id']);_0x4d507f[_0x4b3d1b]=_[_0x9edd('0x24')](_0xbf9da6[_0x9edd('0x16')])?_0xbf9da6[_0x9edd('0x25')]:_0xbf9da6['destcalleridnum'];if(_[_0x9edd('0x24')](_0xbf9da6[_0x9edd('0x16')])){_0x4d507f[_0x9edd('0x26')]=_0xbf9da6[_0x9edd('0x27')]&&_0xbf9da6['calleridname']!==_0x9edd('0x28')?_0xbf9da6[_0x9edd('0x27')]:_0x9edd('0x29');}else{_0x4d507f[_0x9edd('0x26')]=_0xbf9da6[_0x9edd('0x2a')]&&_0xbf9da6[_0x9edd('0x2a')]!==_0x9edd('0x28')?_0xbf9da6[_0x9edd('0x2a')]:_0x9edd('0x29');}return BPromise[_0x9edd('0x1b')]()[_0x9edd('0x1c')](cmContactRpc[_0x9edd('0x2b')](_0x4d507f))[_0x9edd('0x1c')](function(_0xa55906){_0x13dc4f=_0xa55906;_0x5b6c00[_0x9edd('0x2c')](_0xa55906);if(_0x13dc4f){logger['info'](_0x9edd('0x2d'),_0xbf9da6[_0x9edd('0x1f')],_0x138767['id'],_0x13dc4f['id']);}return;});}else{logger[_0x9edd('0xa')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0xbf9da6[_0x9edd('0x1f')],_0x138767['id']);_0x4d507f[_0x4b3d1b]=_[_0x9edd('0x24')](_0xbf9da6[_0x9edd('0x16')])?_0xbf9da6[_0x9edd('0x25')]:_0xbf9da6[_0x9edd('0x17')];if(_[_0x9edd('0x24')](_0xbf9da6[_0x9edd('0x16')])){_0x4d507f[_0x9edd('0x26')]=_0xbf9da6[_0x9edd('0x27')]&&_0xbf9da6[_0x9edd('0x27')]!==_0x9edd('0x28')?_0xbf9da6[_0x9edd('0x27')]:_0x9edd('0x29');}else{_0x4d507f[_0x9edd('0x26')]=_0xbf9da6['destcalleridname']&&_0xbf9da6[_0x9edd('0x2a')]!==''?_0xbf9da6[_0x9edd('0x2a')]:_0x9edd('0x29');}_0x13dc4f=_0x4d507f;_0x5b6c00[_0x9edd('0x2c')](_0x4d507f);return;}}})[_0x9edd('0x1c')](function(){if(_0x2076fc){emit(_0xbf9da6[_0x9edd('0x1f')],_0x138767,util['format'](_0x9edd('0x2e'),_0x2076fc[_0x9edd('0x2f')]),util[_0x9edd('0x30')](_0x9edd('0x31'),_0x523026[_0x9edd('0x32')][_0x9edd('0x33')]()),{'evt':_[_0x9edd('0x34')](_0xbf9da6,{'autoCreate':_0xfd544a}),'contact':_0x13dc4f===undefined?{}:_0x13dc4f,'contacts':_0x5b6c00[_0x9edd('0x35')]===0x0?undefined:_0x5b6c00});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index bfb0639..efffc07 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 _0x2935=['some','field','account','chat','operator','value','ChatWebsiteId','upperFirst','AccountId','message','queue','membername','lastevent','routeId','mailSubstatus','null','substatus','exports','url','ioredis','./urlforward','./integration','./cmContact','./script','../../../config/environment','../../../config/logger','trigger','../ami','redis','defaults','localhost','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','custom:agentconnect','syncCustomEvent','bind','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:queuecallerabandon','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:outgoingmessage','custom:acceptmessage','prototype','emit','info','stringify','clone','motionChannel','undefined','voice','interface','checkTriggers','hasOwnProperty','status','checkTrigger','merge','variables','length','Actions','toLowerCase','contactmanager','motionbar','browser','data2','html','template\x20not\x20found','uri','buildUri','isNil','data3','data4','location','uriLocation','windowWidth','800','windowHeight','600','data6','winApplication','render','winArguments','format','trigger:%s:%s','action','data1','jscripty','user:%s','name','trigger:%s','exec','integration','urlforward','parse','query','search','replace','channel','every','AllConditions','checkConditions','AnyConditions'];(function(_0x2cf9b5,_0x42bdee){var _0x351b93=function(_0xbf8b8){while(--_0xbf8b8){_0x2cf9b5['push'](_0x2cf9b5['shift']());}};_0x351b93(++_0x42bdee);}(_0x2935,0x94));var _0x5293=function(_0x4f7bb3,_0xfd7327){_0x4f7bb3=_0x4f7bb3-0x0;var _0x1e1236=_0x2935[_0x4f7bb3];return _0x1e1236;};'use strict';var util=require('util');var _=require('lodash');var url=require(_0x5293('0x0'));var Mustache=require('mustache');var Redis=require(_0x5293('0x1'));var urlforward=require(_0x5293('0x2'));var integration=require(_0x5293('0x3'));var cmContact=require(_0x5293('0x4'));var script=require(_0x5293('0x5'));var config=require(_0x5293('0x6'));var logger=require(_0x5293('0x7'))(_0x5293('0x8'));var ami=require(_0x5293('0x9'));config[_0x5293('0xa')]=_[_0x5293('0xb')](config[_0x5293('0xa')],{'host':_0x5293('0xc'),'port':0x18eb});var io=require(_0x5293('0xd'))(new Redis(config[_0x5293('0xa')]));var operators={'equals':function(_0x203bf7,_0x53b56f){return _0x203bf7==_0x53b56f;},'not_equals':function(_0x1e40ea,_0x260855){return _0x1e40ea!=_0x260855;}};var barAndWebActions=[_0x5293('0xe'),_0x5293('0x0'),_0x5293('0xf')];function Trigger(_0x171c06){this['triggers']=_0x171c06[_0x5293('0x10')];this[_0x5293('0x11')]=_0x171c06[_0x5293('0x11')];this[_0x5293('0x12')]=_0x171c06[_0x5293('0x12')];this[_0x5293('0x13')]=_0x171c06['templates'];this[_0x5293('0x14')]=_0x171c06['voiceExtensions'];this[_0x5293('0x15')]=_0x171c06[_0x5293('0x15')];this[_0x5293('0x16')]=_0x171c06[_0x5293('0x16')];this[_0x5293('0x17')]=_0x171c06[_0x5293('0x17')];this[_0x5293('0x18')]=_0x171c06[_0x5293('0x18')];this[_0x5293('0x19')]=_0x171c06[_0x5293('0x19')];this[_0x5293('0x1a')]=_0x171c06['deskAccounts'];this[_0x5293('0x1b')]=_0x171c06[_0x5293('0x1b')];this[_0x5293('0x1c')]=_0x171c06[_0x5293('0x1c')];this[_0x5293('0x1d')]=_0x171c06[_0x5293('0x1d')];this[_0x5293('0x1e')]=_0x171c06['freshsalesAccounts'];this[_0x5293('0x1f')]={'zendesk':this['zendeskAccounts'],'salesforce':this[_0x5293('0x17')],'freshdesk':this[_0x5293('0x16')],'sugarcrm':this['sugarcrmAccounts'],'zoho':this[_0x5293('0x19')],'desk':this[_0x5293('0x1a')],'vtiger':this[_0x5293('0x1b')],'dynamics365':this[_0x5293('0x1d')],'freshsales':this['freshsalesAccounts'],'servicenow':this[_0x5293('0x1c')]};ami['on'](_0x5293('0x20'),this['syncCustomEvent']['bind'](this));ami['on'](_0x5293('0x21'),this[_0x5293('0x22')][_0x5293('0x23')](this));ami['on'](_0x5293('0x24'),this[_0x5293('0x22')][_0x5293('0x23')](this));ami['on'](_0x5293('0x25'),this[_0x5293('0x22')][_0x5293('0x23')](this));ami['on'](_0x5293('0x26'),this[_0x5293('0x22')]['bind'](this));ami['on'](_0x5293('0x27'),this['syncCustomEvent'][_0x5293('0x23')](this));ami['on'](_0x5293('0x28'),this[_0x5293('0x22')][_0x5293('0x23')](this));ami['on'](_0x5293('0x29'),this[_0x5293('0x22')][_0x5293('0x23')](this));ami['on'](_0x5293('0x2a'),this[_0x5293('0x22')][_0x5293('0x23')](this));ami['on']('custom:amd',this[_0x5293('0x22')][_0x5293('0x23')](this));ami['on'](_0x5293('0x2b'),this['syncCustomEvent'][_0x5293('0x23')](this));ami['on']('custom:timeout',this[_0x5293('0x22')][_0x5293('0x23')](this));ami['on'](_0x5293('0x2c'),this[_0x5293('0x2d')]['bind'](this));ami['on'](_0x5293('0x2e'),this[_0x5293('0x2d')][_0x5293('0x23')](this));ami['on'](_0x5293('0x2f'),this[_0x5293('0x2d')][_0x5293('0x23')](this));ami['on'](_0x5293('0x30'),this[_0x5293('0x22')]['bind'](this));ami['on'](_0x5293('0x31'),this['syncCustomEvent']['bind'](this));ami['on'](_0x5293('0x32'),this['syncCustomEvent']['bind'](this));ami['on']('custom:incomingmessage',this['syncCustomEvent'][_0x5293('0x23')](this));ami['on'](_0x5293('0x33'),this[_0x5293('0x22')]['bind'](this));ami['on'](_0x5293('0x34'),this[_0x5293('0x22')]['bind'](this));ami['on']('custom:rejectmessage',this[_0x5293('0x22')][_0x5293('0x23')](this));}Trigger[_0x5293('0x35')][_0x5293('0x36')]=function(_0x2c1906,_0x18c23a,_0x2fb4a2){logger[_0x5293('0x37')](_0x2c1906,_0x18c23a,JSON[_0x5293('0x38')](_0x2fb4a2));io['to'](_0x2c1906)['emit'](_0x18c23a,_0x2fb4a2);};Trigger[_0x5293('0x35')][_0x5293('0x22')]=function(_0x260673){var _0x575b35=_[_0x5293('0x39')](_0x260673);if(typeof _0x575b35[_0x5293('0x3a')]===_0x5293('0x3b')){_0x575b35[_0x5293('0x3a')]=_0x5293('0x3c');}this['checkTriggers'](_0x575b35);};Trigger[_0x5293('0x35')][_0x5293('0x2d')]=function(_0x12d6c2){if(this[_0x5293('0x11')][_0x12d6c2[_0x5293('0x3d')]]){this[_0x5293('0x22')](_0x12d6c2);}};Trigger['prototype'][_0x5293('0x3e')]=function(_0x386799){var _0x7ed394;for(var _0x1eccba in this['triggers']){if(this[_0x5293('0x10')][_0x5293('0x3f')](_0x1eccba)){if(this[_0x5293('0x10')][_0x1eccba][_0x5293('0x40')]){_0x7ed394=this[_0x5293('0x41')](this[_0x5293('0x10')][_0x1eccba],_0x386799);if(_0x7ed394){_[_0x5293('0x42')](_0x386799,_0x386799[_0x5293('0x43')]);for(var _0x1e2189=0x0,_0x5824b6,_0xa1fdaf,_0x34381f;_0x1e21890x0){_0x328a08=_[_0xb814('0x2c')](_0x5a6291,_0x271aa8);}return _0x328a08;}function getCustomFields(_0x37d24d,_0x530744){var _0x499f22=[];var _0x20577b={'custom_fields':{}};if(_0x37d24d[_0xb814('0x2d')]>0x0){_['forEach'](_0x37d24d,function(_0x338a28){if(_['includes']([_0xb814('0x2e'),'picklist'],_0x338a28['type'])&&_0x338a28[_0xb814('0x2f')]&&!_0x338a28['customField']){_0x20577b[_0x338a28[_0xb814('0x2f')][_0xb814('0x30')]()]=_0x338a28[_0xb814('0x31')]['toString']();}else if(_['includes']([_0xb814('0x2e'),_0xb814('0x32')],_0x338a28['type'])&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x338a28[_0xb814('0x31')][_0xb814('0x23')]();}else if(_0x338a28[_0xb814('0x36')]==='variable'&&_0x338a28[_0xb814('0x37')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x530744[_0x338a28[_0xb814('0x37')]]&&(_0x20577b[_0xb814('0x35')][_0x338a28['idField']]=_0x530744[_0x338a28[_0xb814('0x37')]]['toString']());}else if(_0x338a28[_0xb814('0x36')]===_0xb814('0x38')&&_0x338a28[_0xb814('0x39')]&&_0x338a28['Variable'][_0xb814('0x3a')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28['customField']){_0x530744[_0x338a28[_0xb814('0x39')][_0xb814('0x3a')][_0xb814('0x30')]()]&&(_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x530744[_0x338a28[_0xb814('0x39')]['name'][_0xb814('0x30')]()]['toString']());}});}if(_0x20577b[_0xb814('0x3b')]){_0x20577b['priority']=Number(_0x20577b[_0xb814('0x3b')]);}return _0x20577b;}function getTicket(_0x4b9233,_0x2f8a2e,_0x26675a,_0x54a7fb,_0x4d308a){logger['info']('Creating\x20new\x20ticket...');var _0x17549e=_[_0xb814('0x3c')]({'subject':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x3e')],_0x4d308a,'\x20'),'type':'phone','status':'new','labels':[_0xb814('0x3f'),'Motion',_0xb814('0x40')][_0xb814('0x41')](getTags(_0x54a7fb[_0xb814('0x42')],_0xb814('0x3a'))),'description':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x43')],_0x4d308a,'\x0a'),'_links':{'assigned_user':{'href':util[_0xb814('0x10')](_0xb814('0x44'),_0x2f8a2e['id']),'class':_0xb814('0x45')}},'message':{'direction':'in','body':intUtil['getString'](_0x54a7fb['Descriptions'],_0x4d308a,'\x0a')}},getCustomFields(_0x54a7fb['Fields'],_0x4d308a));return request({'uri':util[_0xb814('0x10')]('%s/customers/%d/cases',_0x4b9233[_0xb814('0x1a')],_0x26675a['id']),'method':'POST','body':_0x17549e});}exports[_0xb814('0x46')]=function(_0x44ff56,_0x9ef639,_0x2e97cc,_0x4fae23,_0x30fc57,_0x15f01a){var _0x2b23c7,_0x22cf27;_0x15f01a[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x15f01a['remoteUri']);_0x15f01a[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x15f01a[_0xb814('0x48')]);if(_0x30fc57&&_0x30fc57[_0xb814('0x49')]){logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x4b'));_0x9ef639['recordingURL']=util['format'](_0xb814('0x4c'),_0x15f01a[_0xb814('0x48')],_0x9ef639[_0xb814('0x4d')],md5(_0x9ef639[_0xb814('0x4d')]));}else{_0x9ef639[_0xb814('0x4e')]='';}headers[_0xb814('0x4f')]=getAuth(_0x15f01a);return getUser(_0x15f01a,_0x4fae23[_0xb814('0x50')])[_0xb814('0x12')](function(_0x2eb9b6){_0x2b23c7=_0x2eb9b6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x2b23c7['id']);return getEndUser(_0x15f01a,_0x9ef639['calleridname'],_0x9ef639[_0xb814('0x52')]);})[_0xb814('0x12')](function(_0x4a76bb){_0x22cf27=_0x4a76bb;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x22cf27['id']);return getTicket(_0x15f01a,_0x2b23c7,_0x22cf27,_0x2e97cc,_0x9ef639);})[_0xb814('0x12')](function(_0x37866f){if(_0x37866f){logger[_0xb814('0xe')](_0xb814('0x53'));logger[_0xb814('0xe')](_0xb814('0x54'),_0x37866f['id']);switch(_0x15f01a[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0x37866f['id']});break;case _0xb814('0x58'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x5a'),{'uri':util['format'](_0xb814('0x5b'),_0x37866f['id'])});break;default:logger['error'](_0xb814('0x4a'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x3cf8f8){console['error'](_0x3cf8f8);logger[_0xb814('0x5d')](_0xb814('0x4a'),JSON[_0xb814('0x5e')](_0x3cf8f8));});};exports['outbound']=function(_0x3da050,_0x5f0e58,_0x13bdcf,_0x158893,_0x4aed78,_0x39952d,_0x4a3f84){var _0x539be7,_0x3b9709;_0x39952d[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x39952d['remoteUri']);_0x39952d[_0xb814('0x48')]=intUtil['stripTrailingSlash'](_0x39952d[_0xb814('0x48')]);if(_0x4a3f84&&_0x4a3f84[_0xb814('0x5f')]&&_0x4a3f84['recordingFormat']!==_0xb814('0x60')){logger['info'](_0xb814('0x61'),_0xb814('0x4b'));_0x5f0e58[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x39952d[_0xb814('0x48')],_0x5f0e58[_0xb814('0x4d')],md5(_0x5f0e58[_0xb814('0x4d')]));}headers['Authorization']=getAuth(_0x39952d);return getUser(_0x39952d,_0x158893[_0xb814('0x50')])[_0xb814('0x12')](function(_0x5d71d5){_0x539be7=_0x5d71d5;logger[_0xb814('0xe')](_0xb814('0x51'),_0x539be7['id']);return getEndUser(_0x39952d,_0x5f0e58['destcalleridname'],_0x5f0e58[_0xb814('0x62')]);})['then'](function(_0x48362c){_0x3b9709=_0x48362c;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x3b9709['id']);return getTicket(_0x39952d,_0x539be7,_0x3b9709,_0x13bdcf,_0x5f0e58);})[_0xb814('0x12')](function(_0xd1cd8b){if(_0xd1cd8b){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')]('The\x20Ticket\x20ID\x20is:',_0xd1cd8b['id']);switch(_0x39952d[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x63'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0xd1cd8b['id']});break;case'newTab':logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),'trigger:browser:url',{'uri':util[_0xb814('0x10')]('%s/agent/tickets/%s',_0x39952d[_0xb814('0x1a')],_0xd1cd8b['id'])});break;default:logger[_0xb814('0x5d')](_0xb814('0x61'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x579351){logger[_0xb814('0x5d')]('[OUTBOUND]',JSON[_0xb814('0x5e')](_0x579351));});};exports[_0xb814('0x64')]=function(_0xa03cd2,_0x1b024f,_0x3377d4,_0x167d82,_0x143518,_0x4d44e3){var _0x44088d,_0x51ca51;_0x4d44e3[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x1a')]);_0x4d44e3[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x48')]);if(_0x143518&&_0x143518['monitor_format']){logger[_0xb814('0xe')]('['+_0x1b024f[_0xb814('0x65')]['toUpperCase']()+']',_0xb814('0x4b'));_0x1b024f[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x4d44e3[_0xb814('0x48')],_0x1b024f['uniqueid'],md5(_0x1b024f[_0xb814('0x4d')]));}else{_0x1b024f['recordingURL']='';}headers[_0xb814('0x4f')]=getAuth(_0x4d44e3);return getUser(_0x4d44e3)[_0xb814('0x12')](function(_0x2645f6){_0x44088d=_0x2645f6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x44088d['id']);return getEndUser(_0x4d44e3,_0x1b024f[_0xb814('0x66')],_0x1b024f['calleridnum']);})['then'](function(_0x5d064b){_0x51ca51=_0x5d064b;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x51ca51['id']);return getTicket(_0x4d44e3,_0x44088d,_0x51ca51,_0x3377d4,_0x1b024f);})[_0xb814('0x12')](function(_0x1d3954){if(_0x1d3954){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')](_0xb814('0x54'),_0x1d3954['id']);}})[_0xb814('0x5c')](function(_0x5aabbe){logger[_0xb814('0x5d')]('['+_0x1b024f[_0xb814('0x65')][_0xb814('0x67')]()+']',JSON[_0xb814('0x5e')](_0x5aabbe));});}; \ 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(_0x394cf2,_0x9fd583){var _0xd7e195=function(_0x341ecb){while(--_0x341ecb){_0x394cf2['push'](_0x394cf2['shift']());}};_0xd7e195(++_0x9fd583);}(_0x7217,0x19e));var _0x7721=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0x7217[_0x5037ab];return _0x512adb;};'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 784fef9..1e21c9a 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 _0xd065=['contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','forEach','includes','string','picklist','type','customField','content','ticketType','incident','incidents','assign','Subjects','getString','Fields','phonecall','/systemusers(','callDirection','/contacts(','queue','phonecalls','headers','odata-entityid','lastIndexOf','ticketId','format','user:%s','emit','trigger:browser:url','serverUrl','stripTrailingSlash','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','error',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','bluebird','request-promise','util','./util','md5','ioredis','../../../../config/logger','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','POST','clientId','remoteUri','username','password','clientSecret','then','catch','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','userEmail','email','internalemailaddress','info',']\x20Agent\x20found\x20','systemuserid','userId','length','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','substring','enduserId'];(function(_0x1d6869,_0x1a4d8d){var _0x467434=function(_0x44a8c1){while(--_0x44a8c1){_0x1d6869['push'](_0x1d6869['shift']());}};_0x467434(++_0x1a4d8d);}(_0xd065,0x1c1));var _0x5d06=function(_0x5227ed,_0x5cea91){_0x5227ed=_0x5227ed-0x0;var _0x38b465=_0xd065[_0x5227ed];return _0x38b465;};'use strict';var _=require(_0x5d06('0x0'));var BPromise=require(_0x5d06('0x1'));var rp=require(_0x5d06('0x2'));var util=require(_0x5d06('0x3'));var intUtil=require(_0x5d06('0x4'));var md5=require(_0x5d06('0x5'));var Redis=require(_0x5d06('0x6'));var logger=require(_0x5d06('0x7'))('dynamics365');var config=require(_0x5d06('0x8'));config[_0x5d06('0x9')]=_[_0x5d06('0xa')](config[_0x5d06('0x9')],{'host':_0x5d06('0xb'),'port':0x18eb});var io=require(_0x5d06('0xc'))(new Redis(config[_0x5d06('0x9')]));function getAuthToken(_0x21aff5,_0x233928,_0x32cf50){var _0x39dc04={'method':_0x5d06('0xd'),'uri':_0x233928,'form':{'client_id':_0x21aff5[_0x5d06('0xe')],'resource':_0x21aff5[_0x5d06('0xf')],'username':_0x21aff5[_0x5d06('0x10')],'password':_0x21aff5[_0x5d06('0x11')],'grant_type':_0x5d06('0x11'),'client_secret':_0x21aff5[_0x5d06('0x12')]},'json':!![]};return rp(_0x39dc04)[_0x5d06('0x13')](function(_0x55dde6){return _0x55dde6['access_token'];})[_0x5d06('0x14')](function(_0x4de9cc){logger['error']('['+[_0x32cf50[_0x5d06('0x15')]()]+_0x5d06('0x16'));return _0x4de9cc[_0x5d06('0x17')];});}function getUser(_0x42d12a,_0xdfc68a,_0x5392f6,_0x91e4bb,_0x47f4d2,_0x4299ef){return new BPromise(function(_0x5a7a53,_0x428f28){return getAuthToken(_0xdfc68a,_0x91e4bb,_0x4299ef)[_0x5d06('0x13')](function(_0x1ad1a0){var _0x472ec8={'method':_0x5d06('0x18'),'uri':_0x47f4d2+_0x5d06('0x19'),'headers':{'Authorization':_0x5d06('0x1a')+_0x1ad1a0,'OData-Version':_0x5d06('0x1b')},'json':!![]};return rp(_0x472ec8);})[_0x5d06('0x13')](function(_0x104d3c){var _0x4942a4=_0x104d3c[_0x5d06('0x1c')];var _0x4dd47e=![];var _0x5a52ba=null;if(!_[_0x5d06('0x1d')](_0x5392f6)){if(intUtil[_0x5d06('0x1e')](_0x5392f6['email'])){_0x42d12a[_0x5d06('0x1f')]=_0x5392f6[_0x5d06('0x20')];for(_0x5a52ba=0x0;_0x5a52ba<_0x4942a4['length'];_0x5a52ba++){if(_0x4942a4[_0x5a52ba][_0x5d06('0x21')]===_0x5392f6[_0x5d06('0x20')]&&!_0x4942a4[_0x5a52ba]['isdisabled']){_0x4dd47e=!![];logger[_0x5d06('0x22')]('['+[_0x4299ef[_0x5d06('0x15')]()]+_0x5d06('0x23')+_0x4942a4[_0x5a52ba][_0x5d06('0x24')]+'!');_0x42d12a[_0x5d06('0x25')]=_0x4942a4[_0x5a52ba][_0x5d06('0x24')];}}}}if(!_0x4dd47e){logger['info']('['+[_0x4299ef[_0x5d06('0x15')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x42d12a[_0x5d06('0x1f')]=_0xdfc68a[_0x5d06('0x10')];for(_0x5a52ba=0x0;_0x5a52ba<_0x4942a4[_0x5d06('0x26')];_0x5a52ba++){if(_0x4942a4[_0x5a52ba][_0x5d06('0x21')]===_0xdfc68a[_0x5d06('0x10')]){_0x42d12a['userId']=_0x4942a4[_0x5a52ba]['systemuserid'];}}}_0x5a7a53(_0x42d12a);})[_0x5d06('0x14')](function(_0xee535a){_0x428f28(_0xee535a['message']);});});}function createEndUser(_0x37718b,_0x271d94,_0x383308,_0x2fc464,_0x252b77,_0x488391){return new BPromise(function(_0x5d6ebf,_0x3aff0e){return getAuthToken(_0x271d94,_0x383308,_0x488391)['then'](function(_0x4b7a21){var _0x5aa16e=_0x488391[_0x5d06('0x27')]()===_0x5d06('0x28')?_0x252b77[_0x5d06('0x29')]:_0x252b77[_0x5d06('0x2a')];var _0x565c58={'method':_0x5d06('0xd'),'uri':_0x2fc464+_0x5d06('0x2b'),'body':{'telephone1':_0x5aa16e,'fullname':_0x5aa16e,'firstname':_0x5aa16e,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x37718b[_0x5d06('0x25')]+')'},'headers':{'Authorization':_0x5d06('0x1a')+_0x4b7a21,'OData-Version':_0x5d06('0x1b')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x565c58);})[_0x5d06('0x13')](function(_0x4265f8){var _0x4b7be2=_0x4265f8['headers']['odata-entityid'];var _0x4095a6=_0x4b7be2[_0x5d06('0x2c')](_0x4b7be2['lastIndexOf']('(')+0x1,_0x4b7be2['lastIndexOf'](')'));_0x37718b[_0x5d06('0x2d')]=_0x4095a6;_0x5d6ebf(_0x37718b);})[_0x5d06('0x14')](function(_0x3738a5){_0x3aff0e(_0x3738a5[_0x5d06('0x17')]);});});}function getEndUser(_0x18d918,_0x6608b0,_0xa26f7a,_0x2fb615,_0x9349ea,_0x1fe85b,_0x21ea88){var _0x4ca216=_0x1fe85b[_0x5d06('0x27')]()===_0x5d06('0x28')?_0x9349ea[_0x5d06('0x29')]:_0x9349ea[_0x5d06('0x2a')];return getAuthToken(_0x6608b0,_0xa26f7a,_0x1fe85b)['then'](function(_0x58c2f9){var _0x4d973f={'method':_0x5d06('0x18'),'uri':_0x2fb615+_0x5d06('0x2e')+_0x4ca216[_0x5d06('0x2f')]('+','%2b')+'\x27','headers':{'Authorization':'Bearer\x20'+_0x58c2f9,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x4d973f);})['then'](function(_0x332e1a){var _0x481af5=![];if(!_0x332e1a)return _0x481af5;var _0x7ed15e=_0x332e1a['value'];for(var _0x46a4e0=0x0;_0x46a4e0<_0x7ed15e[_0x5d06('0x26')];_0x46a4e0++){if(_0x7ed15e[_0x46a4e0]['telephone1']===_0x4ca216){_0x481af5=!![];_0x18d918[_0x5d06('0x2d')]=_0x7ed15e[_0x46a4e0][_0x5d06('0x30')];}}return _0x481af5;})[_0x5d06('0x13')](function(_0x593c1c){if(_0x593c1c)return _0x18d918;if(_0x21ea88===_0x5d06('0x31')){logger[_0x5d06('0x22')]('['+[_0x1fe85b[_0x5d06('0x15')]()]+_0x5d06('0x32'));return _0x18d918;}return createEndUser(_0x18d918,_0x6608b0,_0xa26f7a,_0x2fb615,_0x9349ea,_0x1fe85b)[_0x5d06('0x13')](function(_0x20e1b5){logger[_0x5d06('0x22')]('['+[_0x1fe85b[_0x5d06('0x15')]()]+']\x20Enduser\x20created!',_0x20e1b5[_0x5d06('0x2d')]);return _0x20e1b5;});});}function getCustomFields(_0x529b13,_0x499102,_0xa89a0){var _0x39d455={};if(_0x529b13['length']>0x0){_[_0x5d06('0x33')](_0x529b13,function(_0x29e3e1){if(_[_0x5d06('0x34')]([_0x5d06('0x35'),_0x5d06('0x36')],_0x29e3e1[_0x5d06('0x37')])&&_0x29e3e1['nameField']&&!_0x29e3e1[_0x5d06('0x38')]){var _0x45a802=_0x29e3e1['idField']['toLowerCase']();var _0x1a9164=_0x45a802[_0x5d06('0x2c')](0x0,_0x45a802['indexOf']('_'));var _0x1d4c66=_0x45a802[_0x5d06('0x2c')](_0x45a802['indexOf']('_')+0x1);if(_0x1a9164===_0xa89a0){_0x39d455[_0x1d4c66]=_0x29e3e1[_0x5d06('0x39')];}}});}return _0x39d455;}function getTicket(_0x534fef,_0x194a18,_0x44023c,_0x45185c,_0x495eef,_0x47e76b,_0xa775f7){return new BPromise(function(_0x516f20,_0x25e29a){var _0x4589f9;return getAuthToken(_0x194a18,_0x44023c,_0xa775f7)['then'](function(_0x10c1a2){if(_0x47e76b[_0x5d06('0x3a')]===_0x5d06('0x3b')){_0x4589f9={'method':_0x5d06('0xd'),'uri':_0x45185c+_0x5d06('0x3c'),'body':Object[_0x5d06('0x3d')]({},{'title':intUtil['getString'](_0x47e76b[_0x5d06('0x3e')],_0x495eef,'\x20'),'description':intUtil[_0x5d06('0x3f')](_0x47e76b['Descriptions'],_0x495eef,'\x0a'),'customerid_contact@odata.bind':_0x534fef[_0x5d06('0x2d')]?'/contacts('+_0x534fef[_0x5d06('0x2d')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x534fef[_0x5d06('0x25')]+')','caseorigincode':'1'},getCustomFields(_0x47e76b[_0x5d06('0x40')],_0x495eef,_0x47e76b['ticketType'])),'headers':{'Authorization':_0x5d06('0x1a')+_0x10c1a2,'OData-Version':_0x5d06('0x1b')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x47e76b['ticketType']===_0x5d06('0x41')){var _0x5c7f90=_0x534fef[_0x5d06('0x2d')]?[{'partyid_systemuser@odata.bind':_0x5d06('0x42')+_0x534fef[_0x5d06('0x25')]+')','participationtypemask':_0x534fef[_0x5d06('0x43')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x5d06('0x44')+_0x534fef[_0x5d06('0x2d')]+')','participationtypemask':_0x534fef[_0x5d06('0x43')]===_0x5d06('0x45')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x5d06('0x42')+_0x534fef[_0x5d06('0x25')]+')','participationtypemask':_0x534fef['callDirection']===_0x5d06('0x45')?0x2:0x1}];_0x4589f9={'method':_0x5d06('0xd'),'uri':_0x45185c+_0x5d06('0x46'),'body':Object['assign']({},{'subject':intUtil[_0x5d06('0x3f')](_0x47e76b['Subjects'],_0x495eef,'\x20'),'phonenumber':String(_0x495eef[_0x5d06('0x2a')]),'description':intUtil['getString'](_0x47e76b['Descriptions'],_0x495eef,'\x0a'),'regardingobjectid_contact@odata.bind':_0x534fef[_0x5d06('0x2d')]?_0x5d06('0x44')+_0x534fef[_0x5d06('0x2d')]+')':undefined,'ownerid@odata.bind':_0x5d06('0x42')+_0x534fef[_0x5d06('0x25')]+')','directioncode':_0x534fef[_0x5d06('0x43')]===_0x5d06('0x45')?![]:!![],'phonecall_activity_parties':_0x5c7f90},getCustomFields(_0x47e76b[_0x5d06('0x40')],_0x495eef,_0x47e76b['ticketType'])),'headers':{'Authorization':_0x5d06('0x1a')+_0x10c1a2,'OData-Version':_0x5d06('0x1b')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x4589f9);})[_0x5d06('0x13')](function(_0x199d36){var _0xb2d9bb=_0x199d36[_0x5d06('0x47')][_0x5d06('0x48')];var _0x32b045=_0xb2d9bb[_0x5d06('0x2c')](_0xb2d9bb[_0x5d06('0x49')]('(')+0x1,_0xb2d9bb[_0x5d06('0x49')](')'));_0x534fef[_0x5d06('0x4a')]=_0x32b045;_0x516f20(_0x534fef);})[_0x5d06('0x14')](function(_0x506e34){_0x25e29a(_0x506e34[_0x5d06('0x17')]);});});}function emit(_0x511286,_0x24f651,_0x18913e,_0xaf45b1){var _0x186875={'uri':util[_0x5d06('0x4b')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x511286,_0x18913e,_0xaf45b1)};io['to'](util[_0x5d06('0x4b')](_0x5d06('0x4c'),_0x24f651))[_0x5d06('0x4d')](_0x5d06('0x4e'),_0x186875);}exports['cs']=function(_0x52a925,_0x10eec2,_0x4bab4e,_0x428895,_0x4a6c27,_0x266abe,_0x1c95a1,_0x5953bd){var _0x50f1cd={};_0x266abe[_0x5d06('0xf')]=intUtil['stripTrailingSlash'](_0x266abe[_0x5d06('0xf')]);_0x266abe[_0x5d06('0x4f')]=intUtil[_0x5d06('0x50')](_0x266abe['serverUrl']);_0x50f1cd[_0x5d06('0x43')]=_0x5953bd===_0x5d06('0x45')||_0x5953bd===_0x5d06('0x51')?'queue':_0x5d06('0x28');var _0x8ed889=util[_0x5d06('0x4b')]('%s/api/data/v9.0/',_0x266abe['remoteUri']);var _0x54021a=util[_0x5d06('0x4b')]('https://login.microsoftonline.com/%s/oauth2/token',_0x266abe['tenantId']);var _0x385760=util['format'](_0x5d06('0x52'),_0x266abe[_0x5d06('0x4f')],_0x10eec2['uniqueid'],md5(_0x10eec2[_0x5d06('0x53')]));if(_0x4a6c27&&_0x4a6c27['monitor_format']){logger[_0x5d06('0x22')](_0x5d06('0x54'),_0x5d06('0x55'));_0x10eec2['recordingURL']=_0x385760;}else if(_0x1c95a1&&_0x1c95a1[_0x5d06('0x56')]&&_0x1c95a1[_0x5d06('0x56')]!==_0x5d06('0x57')){logger[_0x5d06('0x22')]('[OUTBOUND]',_0x5d06('0x55'));_0x10eec2[_0x5d06('0x58')]=_0x385760;}else{_0x10eec2['recordingURL']='';}return getUser(_0x50f1cd,_0x266abe,_0x428895,_0x54021a,_0x8ed889,_0x5953bd)['then'](function(_0x316b46){logger[_0x5d06('0x22')]('['+_0x5953bd[_0x5d06('0x15')]()+_0x5d06('0x59'),_0x316b46['userId']);logger[_0x5d06('0x22')]('['+_0x5953bd[_0x5d06('0x15')]()+_0x5d06('0x5a'),_0x316b46[_0x5d06('0x1f')]);return getEndUser(_0x316b46,_0x266abe,_0x54021a,_0x8ed889,_0x10eec2,_0x5953bd,_0x4bab4e[_0x5d06('0x5b')]);})['then'](function(_0x2a525b){logger['info']('['+_0x5953bd[_0x5d06('0x15')]()+_0x5d06('0x5c'),_0x2a525b[_0x5d06('0x2d')]);logger['info']('['+_0x5953bd[_0x5d06('0x15')]()+_0x5d06('0x5d'),_0x10eec2[_0x5d06('0x2a')]);return getTicket(_0x2a525b,_0x266abe,_0x54021a,_0x8ed889,_0x10eec2,_0x4bab4e,_0x5953bd);})[_0x5d06('0x13')](function(_0x13504b){logger[_0x5d06('0x22')](util['format']('['+_0x5953bd[_0x5d06('0x15')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x4bab4e[_0x5d06('0x3a')],_0x13504b[_0x5d06('0x4a')]));logger[_0x5d06('0x22')](util[_0x5d06('0x4b')]('['+_0x5953bd[_0x5d06('0x15')]()+_0x5d06('0x5e'),_0x5953bd));if(_0x5953bd!==_0x5d06('0x51')){logger[_0x5d06('0x22')]('['+_0x5953bd[_0x5d06('0x15')]()+']',_0x5d06('0x5f'));emit(_0x266abe[_0x5d06('0xf')],_0x428895[_0x5d06('0x60')],_0x4bab4e[_0x5d06('0x3a')],_0x13504b[_0x5d06('0x4a')]);}})[_0x5d06('0x14')](function(_0x37e86c){logger[_0x5d06('0x61')]('['+_0x5953bd[_0x5d06('0x15')]()+_0x5d06('0x62'),util['inspect'](_0x37e86c,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xed39=['/systemusers(','Bearer\x20','headers','substring','lastIndexOf','replace','%2b','telephone1','enduserId','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','string','picklist','type','nameField','customField','idField','indexOf','content','ticketType','incident','getString','Subjects','Descriptions','/contacts(','phonecall','callDirection','queue','assign','odata-entityid','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','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\x20User\x20email\x20is:','moduleCreate',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','error',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','bluebird','request-promise','util','./util','ioredis','../../../../config/environment','localhost','socket.io-emitter','redis','POST','clientId','remoteUri','username','password','clientSecret','access_token','catch','toUpperCase',']\x20Wrong\x20credentials!','message','then','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','4.0','value','validateEmail','length','internalemailaddress','email','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId','userEmail','toLowerCase','outbound','destcalleridnum','calleridnum','contacts'];(function(_0x3376ac,_0x5d78b3){var _0x117b25=function(_0xf30ee6){while(--_0xf30ee6){_0x3376ac['push'](_0x3376ac['shift']());}};_0x117b25(++_0x5d78b3);}(_0xed39,0xa7));var _0x9ed3=function(_0x39885c,_0x32bc25){_0x39885c=_0x39885c-0x0;var _0x4f62dd=_0xed39[_0x39885c];return _0x4f62dd;};'use strict';var _=require(_0x9ed3('0x0'));var BPromise=require(_0x9ed3('0x1'));var rp=require(_0x9ed3('0x2'));var util=require(_0x9ed3('0x3'));var intUtil=require(_0x9ed3('0x4'));var md5=require('md5');var Redis=require(_0x9ed3('0x5'));var logger=require('../../../../config/logger')('dynamics365');var config=require(_0x9ed3('0x6'));config['redis']=_['defaults'](config['redis'],{'host':_0x9ed3('0x7'),'port':0x18eb});var io=require(_0x9ed3('0x8'))(new Redis(config[_0x9ed3('0x9')]));function getAuthToken(_0x2412c5,_0x5e8bdc,_0x432be6){var _0x12bed5={'method':_0x9ed3('0xa'),'uri':_0x5e8bdc,'form':{'client_id':_0x2412c5[_0x9ed3('0xb')],'resource':_0x2412c5[_0x9ed3('0xc')],'username':_0x2412c5[_0x9ed3('0xd')],'password':_0x2412c5[_0x9ed3('0xe')],'grant_type':'password','client_secret':_0x2412c5[_0x9ed3('0xf')]},'json':!![]};return rp(_0x12bed5)['then'](function(_0x3a25ad){return _0x3a25ad[_0x9ed3('0x10')];})[_0x9ed3('0x11')](function(_0x434180){logger['error']('['+[_0x432be6[_0x9ed3('0x12')]()]+_0x9ed3('0x13'));return _0x434180[_0x9ed3('0x14')];});}function getUser(_0xf4b62b,_0x4acc4a,_0x25f9a8,_0x1b5f18,_0x3b845f,_0x3ff350){return new BPromise(function(_0x57fa90,_0x3f29e3){return getAuthToken(_0x4acc4a,_0x1b5f18,_0x3ff350)[_0x9ed3('0x15')](function(_0x5b1d69){var _0x3de8c3={'method':_0x9ed3('0x16'),'uri':_0x3b845f+_0x9ed3('0x17'),'headers':{'Authorization':'Bearer\x20'+_0x5b1d69,'OData-Version':_0x9ed3('0x18')},'json':!![]};return rp(_0x3de8c3);})['then'](function(_0x3c70ea){var _0x10c715=_0x3c70ea[_0x9ed3('0x19')];var _0x542cc6=![];var _0x5403fe=null;if(!_['isNil'](_0x25f9a8)){if(intUtil[_0x9ed3('0x1a')](_0x25f9a8['email'])){_0xf4b62b['userEmail']=_0x25f9a8['email'];for(_0x5403fe=0x0;_0x5403fe<_0x10c715[_0x9ed3('0x1b')];_0x5403fe++){if(_0x10c715[_0x5403fe][_0x9ed3('0x1c')]===_0x25f9a8[_0x9ed3('0x1d')]&&!_0x10c715[_0x5403fe][_0x9ed3('0x1e')]){_0x542cc6=!![];logger[_0x9ed3('0x1f')]('['+[_0x3ff350[_0x9ed3('0x12')]()]+_0x9ed3('0x20')+_0x10c715[_0x5403fe][_0x9ed3('0x21')]+'!');_0xf4b62b[_0x9ed3('0x22')]=_0x10c715[_0x5403fe]['systemuserid'];}}}}if(!_0x542cc6){logger[_0x9ed3('0x1f')]('['+[_0x3ff350[_0x9ed3('0x12')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0xf4b62b[_0x9ed3('0x23')]=_0x4acc4a[_0x9ed3('0xd')];for(_0x5403fe=0x0;_0x5403fe<_0x10c715['length'];_0x5403fe++){if(_0x10c715[_0x5403fe][_0x9ed3('0x1c')]===_0x4acc4a['username']){_0xf4b62b[_0x9ed3('0x22')]=_0x10c715[_0x5403fe]['systemuserid'];}}}_0x57fa90(_0xf4b62b);})[_0x9ed3('0x11')](function(_0xcff114){_0x3f29e3(_0xcff114[_0x9ed3('0x14')]);});});}function createEndUser(_0x517c73,_0x4a93ff,_0x57f45d,_0x411798,_0x16ee2f,_0x5b8c1d){return new BPromise(function(_0x5b77fe,_0x391361){return getAuthToken(_0x4a93ff,_0x57f45d,_0x5b8c1d)[_0x9ed3('0x15')](function(_0x2be8ad){var _0x549d84=_0x5b8c1d[_0x9ed3('0x24')]()===_0x9ed3('0x25')?_0x16ee2f[_0x9ed3('0x26')]:_0x16ee2f[_0x9ed3('0x27')];var _0x246310={'method':'POST','uri':_0x411798+_0x9ed3('0x28'),'body':{'telephone1':_0x549d84,'fullname':_0x549d84,'firstname':_0x549d84,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x9ed3('0x29')+_0x517c73[_0x9ed3('0x22')]+')'},'headers':{'Authorization':_0x9ed3('0x2a')+_0x2be8ad,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x246310);})[_0x9ed3('0x15')](function(_0x30a07a){var _0x8e2f9e=_0x30a07a[_0x9ed3('0x2b')]['odata-entityid'];var _0x113b6a=_0x8e2f9e[_0x9ed3('0x2c')](_0x8e2f9e[_0x9ed3('0x2d')]('(')+0x1,_0x8e2f9e[_0x9ed3('0x2d')](')'));_0x517c73['enduserId']=_0x113b6a;_0x5b77fe(_0x517c73);})['catch'](function(_0x23ceeb){_0x391361(_0x23ceeb[_0x9ed3('0x14')]);});});}function getEndUser(_0x17f66e,_0x4793af,_0x7c7ef8,_0x3cd49d,_0x3890ec,_0x475994,_0x52bbe9){var _0x414158=_0x475994[_0x9ed3('0x24')]()===_0x9ed3('0x25')?_0x3890ec[_0x9ed3('0x26')]:_0x3890ec[_0x9ed3('0x27')];return getAuthToken(_0x4793af,_0x7c7ef8,_0x475994)[_0x9ed3('0x15')](function(_0x55614c){var _0x2bd793={'method':'GET','uri':_0x3cd49d+'contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27'+_0x414158[_0x9ed3('0x2e')]('+',_0x9ed3('0x2f'))+'\x27','headers':{'Authorization':_0x9ed3('0x2a')+_0x55614c,'If-None-Match':null,'OData-Version':_0x9ed3('0x18')},'json':!![]};return rp(_0x2bd793);})['then'](function(_0x5581ab){var _0x199837=![];if(!_0x5581ab)return _0x199837;var _0x334da1=_0x5581ab['value'];for(var _0x8cc101=0x0;_0x8cc101<_0x334da1[_0x9ed3('0x1b')];_0x8cc101++){if(_0x334da1[_0x8cc101][_0x9ed3('0x30')]===_0x414158){_0x199837=!![];_0x17f66e[_0x9ed3('0x31')]=_0x334da1[_0x8cc101][_0x9ed3('0x32')];}}return _0x199837;})[_0x9ed3('0x15')](function(_0x4fbe29){if(_0x4fbe29)return _0x17f66e;if(_0x52bbe9===_0x9ed3('0x33')){logger[_0x9ed3('0x1f')]('['+[_0x475994[_0x9ed3('0x12')]()]+_0x9ed3('0x34'));return _0x17f66e;}return createEndUser(_0x17f66e,_0x4793af,_0x7c7ef8,_0x3cd49d,_0x3890ec,_0x475994)[_0x9ed3('0x15')](function(_0x18d622){logger[_0x9ed3('0x1f')]('['+[_0x475994[_0x9ed3('0x12')]()]+_0x9ed3('0x35'),_0x18d622[_0x9ed3('0x31')]);return _0x18d622;});});}function getCustomFields(_0x1019fe,_0x330ce4,_0x8b39a9){var _0x30923f={};if(_0x1019fe[_0x9ed3('0x1b')]>0x0){_[_0x9ed3('0x36')](_0x1019fe,function(_0x496a6a){if(_['includes']([_0x9ed3('0x37'),_0x9ed3('0x38')],_0x496a6a[_0x9ed3('0x39')])&&_0x496a6a[_0x9ed3('0x3a')]&&!_0x496a6a[_0x9ed3('0x3b')]){var _0x6178c=_0x496a6a[_0x9ed3('0x3c')][_0x9ed3('0x24')]();var _0x40b7da=_0x6178c[_0x9ed3('0x2c')](0x0,_0x6178c[_0x9ed3('0x3d')]('_'));var _0x2a9663=_0x6178c[_0x9ed3('0x2c')](_0x6178c[_0x9ed3('0x3d')]('_')+0x1);if(_0x40b7da===_0x8b39a9){_0x30923f[_0x2a9663]=_0x496a6a[_0x9ed3('0x3e')];}}});}return _0x30923f;}function getTicket(_0x11292d,_0x809722,_0x2cfc9e,_0x3e64bd,_0x3d9c7e,_0x5f483e,_0x37676a){return new BPromise(function(_0x35c636,_0x397bc4){var _0x2eab82;return getAuthToken(_0x809722,_0x2cfc9e,_0x37676a)[_0x9ed3('0x15')](function(_0x48cdb7){if(_0x5f483e[_0x9ed3('0x3f')]===_0x9ed3('0x40')){_0x2eab82={'method':_0x9ed3('0xa'),'uri':_0x3e64bd+'incidents','body':Object['assign']({},{'title':intUtil[_0x9ed3('0x41')](_0x5f483e[_0x9ed3('0x42')],_0x3d9c7e,'\x20'),'description':intUtil[_0x9ed3('0x41')](_0x5f483e[_0x9ed3('0x43')],_0x3d9c7e,'\x0a'),'customerid_contact@odata.bind':_0x11292d[_0x9ed3('0x31')]?_0x9ed3('0x44')+_0x11292d['enduserId']+')':undefined,'ownerid@odata.bind':_0x9ed3('0x29')+_0x11292d[_0x9ed3('0x22')]+')','caseorigincode':'1'},getCustomFields(_0x5f483e['Fields'],_0x3d9c7e,_0x5f483e[_0x9ed3('0x3f')])),'headers':{'Authorization':'Bearer\x20'+_0x48cdb7,'OData-Version':_0x9ed3('0x18')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x5f483e[_0x9ed3('0x3f')]===_0x9ed3('0x45')){var _0x4b2a4f=_0x11292d[_0x9ed3('0x31')]?[{'partyid_systemuser@odata.bind':_0x9ed3('0x29')+_0x11292d[_0x9ed3('0x22')]+')','participationtypemask':_0x11292d[_0x9ed3('0x46')]===_0x9ed3('0x47')?0x2:0x1},{'partyid_contact@odata.bind':_0x9ed3('0x44')+_0x11292d[_0x9ed3('0x31')]+')','participationtypemask':_0x11292d[_0x9ed3('0x46')]==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x9ed3('0x29')+_0x11292d[_0x9ed3('0x22')]+')','participationtypemask':_0x11292d[_0x9ed3('0x46')]==='queue'?0x2:0x1}];_0x2eab82={'method':_0x9ed3('0xa'),'uri':_0x3e64bd+'phonecalls','body':Object[_0x9ed3('0x48')]({},{'subject':intUtil[_0x9ed3('0x41')](_0x5f483e[_0x9ed3('0x42')],_0x3d9c7e,'\x20'),'phonenumber':String(_0x3d9c7e['calleridnum']),'description':intUtil[_0x9ed3('0x41')](_0x5f483e[_0x9ed3('0x43')],_0x3d9c7e,'\x0a'),'regardingobjectid_contact@odata.bind':_0x11292d['enduserId']?_0x9ed3('0x44')+_0x11292d[_0x9ed3('0x31')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x11292d['userId']+')','directioncode':_0x11292d[_0x9ed3('0x46')]==='queue'?![]:!![],'phonecall_activity_parties':_0x4b2a4f},getCustomFields(_0x5f483e['Fields'],_0x3d9c7e,_0x5f483e[_0x9ed3('0x3f')])),'headers':{'Authorization':_0x9ed3('0x2a')+_0x48cdb7,'OData-Version':_0x9ed3('0x18')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x2eab82);})[_0x9ed3('0x15')](function(_0x2c0d3e){var _0x2eda3b=_0x2c0d3e[_0x9ed3('0x2b')][_0x9ed3('0x49')];var _0x38bfd3=_0x2eda3b[_0x9ed3('0x2c')](_0x2eda3b[_0x9ed3('0x2d')]('(')+0x1,_0x2eda3b[_0x9ed3('0x2d')](')'));_0x11292d[_0x9ed3('0x4a')]=_0x38bfd3;_0x35c636(_0x11292d);})[_0x9ed3('0x11')](function(_0x380dea){_0x397bc4(_0x380dea[_0x9ed3('0x14')]);});});}function emit(_0x5114c8,_0x2a38c1,_0x3624a3,_0x5af8f0){var _0x38df4f={'uri':util[_0x9ed3('0x4b')](_0x9ed3('0x4c'),_0x5114c8,_0x3624a3,_0x5af8f0)};io['to'](util[_0x9ed3('0x4b')]('user:%s',_0x2a38c1))[_0x9ed3('0x4d')](_0x9ed3('0x4e'),_0x38df4f);}exports['cs']=function(_0xa70cc0,_0x2c8a0f,_0x31a5ff,_0xcb61c2,_0x1fff82,_0x1d6ab2,_0x1e6ad0,_0x4f986f){var _0x376dae={};_0x1d6ab2[_0x9ed3('0xc')]=intUtil[_0x9ed3('0x4f')](_0x1d6ab2[_0x9ed3('0xc')]);_0x1d6ab2[_0x9ed3('0x50')]=intUtil['stripTrailingSlash'](_0x1d6ab2[_0x9ed3('0x50')]);_0x376dae[_0x9ed3('0x46')]=_0x4f986f===_0x9ed3('0x47')||_0x4f986f==='unmanaged'?_0x9ed3('0x47'):_0x9ed3('0x25');var _0x3b1c9e=util[_0x9ed3('0x4b')]('%s/api/data/v9.0/',_0x1d6ab2[_0x9ed3('0xc')]);var _0x43db4f=util[_0x9ed3('0x4b')]('https://login.microsoftonline.com/%s/oauth2/token',_0x1d6ab2[_0x9ed3('0x51')]);var _0x251432=util[_0x9ed3('0x4b')](_0x9ed3('0x52'),_0x1d6ab2[_0x9ed3('0x50')],_0x2c8a0f[_0x9ed3('0x53')],md5(_0x2c8a0f[_0x9ed3('0x53')]));if(_0x1fff82&&_0x1fff82[_0x9ed3('0x54')]){logger[_0x9ed3('0x1f')](_0x9ed3('0x55'),_0x9ed3('0x56'));_0x2c8a0f[_0x9ed3('0x57')]=_0x251432;}else if(_0x1e6ad0&&_0x1e6ad0[_0x9ed3('0x58')]&&_0x1e6ad0[_0x9ed3('0x58')]!==_0x9ed3('0x59')){logger[_0x9ed3('0x1f')](_0x9ed3('0x5a'),'Recording\x20is\x20enabled!');_0x2c8a0f[_0x9ed3('0x57')]=_0x251432;}else{_0x2c8a0f[_0x9ed3('0x57')]='';}return getUser(_0x376dae,_0x1d6ab2,_0xcb61c2,_0x43db4f,_0x3b1c9e,_0x4f986f)[_0x9ed3('0x15')](function(_0x1ada51){logger[_0x9ed3('0x1f')]('['+_0x4f986f[_0x9ed3('0x12')]()+_0x9ed3('0x5b'),_0x1ada51[_0x9ed3('0x22')]);logger['info']('['+_0x4f986f[_0x9ed3('0x12')]()+_0x9ed3('0x5c'),_0x1ada51[_0x9ed3('0x23')]);return getEndUser(_0x1ada51,_0x1d6ab2,_0x43db4f,_0x3b1c9e,_0x2c8a0f,_0x4f986f,_0x31a5ff[_0x9ed3('0x5d')]);})[_0x9ed3('0x15')](function(_0x9a5e02){logger[_0x9ed3('0x1f')]('['+_0x4f986f[_0x9ed3('0x12')]()+_0x9ed3('0x5e'),_0x9a5e02[_0x9ed3('0x31')]);logger[_0x9ed3('0x1f')]('['+_0x4f986f[_0x9ed3('0x12')]()+_0x9ed3('0x5f'),_0x2c8a0f[_0x9ed3('0x27')]);return getTicket(_0x9a5e02,_0x1d6ab2,_0x43db4f,_0x3b1c9e,_0x2c8a0f,_0x31a5ff,_0x4f986f);})[_0x9ed3('0x15')](function(_0x543ff8){logger['info'](util['format']('['+_0x4f986f[_0x9ed3('0x12')]()+_0x9ed3('0x60'),_0x31a5ff[_0x9ed3('0x3f')],_0x543ff8['ticketId']));logger[_0x9ed3('0x1f')](util[_0x9ed3('0x4b')]('['+_0x4f986f[_0x9ed3('0x12')]()+_0x9ed3('0x61'),_0x4f986f));if(_0x4f986f!==_0x9ed3('0x62')){logger['info']('['+_0x4f986f[_0x9ed3('0x12')]()+']',_0x9ed3('0x63'));emit(_0x1d6ab2[_0x9ed3('0xc')],_0xcb61c2[_0x9ed3('0x64')],_0x31a5ff[_0x9ed3('0x3f')],_0x543ff8[_0x9ed3('0x4a')]);}})[_0x9ed3('0x11')](function(_0xccb20e){logger[_0x9ed3('0x65')]('['+_0x4f986f[_0x9ed3('0x12')]()+_0x9ed3('0x66'),util[_0x9ed3('0x67')](_0xccb20e,{'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 bfcd005..6113ea9 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 _0x72a1=['recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/helpdesk/tickets/%d','toUpperCase','lastevent','lodash','request-promise','md5','ioredis','./util','../../../../config/environment','freshdesk','redis','defaults','socket.io-emitter','application/json','emit','Creating\x20new\x20ticket...','merge','Caller\x20-\x20%s','calleridname','calleridnum','getString','Descriptions','Tags','name','Fields','keyBy','value','format','%s/api/v2/tickets','POST','then','info','Ticket\x20created!','validateEmail','%s/api/v2/agents','remoteUri','find','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','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','stringify','GET','length','map','forEach','includes','string','picklist','nameField','toLowerCase','type','customField','custom_fields','idField','variableName','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20Ticket\x20ID\x20is:','[QUEUE]','trigger:browser:url','catch','error','outbound'];(function(_0x4cdb9b,_0x59894f){var _0x869771=function(_0x2fae5c){while(--_0x2fae5c){_0x4cdb9b['push'](_0x4cdb9b['shift']());}};_0x869771(++_0x59894f);}(_0x72a1,0xc1));var _0x172a=function(_0x3024ba,_0x4d354f){_0x3024ba=_0x3024ba-0x0;var _0x48c858=_0x72a1[_0x3024ba];return _0x48c858;};'use strict';var _=require(_0x172a('0x0'));var rp=require(_0x172a('0x1'));var md5=require(_0x172a('0x2'));var util=require('util');var Redis=require(_0x172a('0x3'));var intUtil=require(_0x172a('0x4'));var config=require(_0x172a('0x5'));var logger=require('../../../../config/logger')(_0x172a('0x6'));config[_0x172a('0x7')]=_[_0x172a('0x8')](config[_0x172a('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x172a('0x9'))(new Redis(config[_0x172a('0x7')]));var headers={'Content-Type':_0x172a('0xa'),'Accept':_0x172a('0xa')};function emit(_0x3f88fd,_0x4f4d68,_0x446d92){io['to'](_0x3f88fd)[_0x172a('0xb')](_0x4f4d68,_0x446d92);}function getTicket(_0x3cc1d0,_0x22a41c,_0x2620f3,_0x332637,_0x1a065b){logger['info'](_0x172a('0xc'));var _0x1deabe=_[_0x172a('0xd')]({'responder_id':_0x22a41c['id'],'requester_id':_0x2620f3['id'],'name':util['format'](_0x172a('0xe'),_0x1a065b[_0x172a('0xf')]),'phone':_0x1a065b[_0x172a('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x332637['Subjects'],_0x1a065b,'\x20'),'description':intUtil[_0x172a('0x11')](_0x332637[_0x172a('0x12')],_0x1a065b,'
'),'tags':getTags(_0x332637[_0x172a('0x13')],_0x172a('0x14'))},getCustomFields(_0x332637[_0x172a('0x15')],_0x1a065b));_0x1deabe['custom_fields']=_['mapValues'](_[_0x172a('0x16')](_0x1deabe['custom_fields'],'id'),_0x172a('0x17'));return request({'uri':util[_0x172a('0x18')](_0x172a('0x19'),_0x3cc1d0['remoteUri']),'method':_0x172a('0x1a'),'body':_0x1deabe})[_0x172a('0x1b')](function(_0x564858){logger[_0x172a('0x1c')](_0x172a('0x1d'));return _0x564858;});}function getUser(_0x5e5b98,_0x459bc3){if(intUtil[_0x172a('0x1e')](_0x459bc3)){return request({'uri':util[_0x172a('0x18')](_0x172a('0x1f'),_0x5e5b98[_0x172a('0x20')]),'qs':{'email':_0x459bc3}})[_0x172a('0x1b')](function(_0xeff56a){if(_0xeff56a['length']){logger[_0x172a('0x1c')]('Agent\x20found!');return _[_0x172a('0x21')](_0xeff56a,function(_0x5fcedd){return _0x5fcedd['contact']['email']===_0x459bc3;});}else{logger[_0x172a('0x1c')](_0x172a('0x22'));return request({'uri':util[_0x172a('0x18')]('%s/api/v2/agents/me',_0x5e5b98[_0x172a('0x20')])})[_0x172a('0x1b')](function(_0x4b16ef){logger[_0x172a('0x1c')](_0x172a('0x23'));return _0x4b16ef;});}});}else{logger['info'](_0x172a('0x24'));return request({'uri':util[_0x172a('0x18')](_0x172a('0x25'),_0x5e5b98[_0x172a('0x20')])})['then'](function(_0x3ca5c9){logger[_0x172a('0x1c')](_0x172a('0x23'));return _0x3ca5c9;});}}function getEndUser(_0x2224fd,_0x373aa1,_0x53748d){logger['info'](_0x172a('0x26'),_0x53748d);return request({'uri':util[_0x172a('0x18')]('%s/api/v2/contacts',_0x2224fd[_0x172a('0x20')]),'qs':{'phone':_0x53748d}})[_0x172a('0x1b')](function(_0x58a79f){if(_0x58a79f['length']){logger[_0x172a('0x1c')](_0x172a('0x27'));return _[_0x172a('0x21')](_0x58a79f,{'phone':_0x53748d});}else{logger[_0x172a('0x1c')](_0x172a('0x28'));return request({'uri':util[_0x172a('0x18')]('%s/api/v2/contacts',_0x2224fd[_0x172a('0x20')]),'method':_0x172a('0x1a'),'body':{'name':_0x373aa1,'phone':_0x53748d}})[_0x172a('0x1b')](function(_0x2aea7b){logger[_0x172a('0x1c')](_0x172a('0x29'));return _0x2aea7b;});}});}function getAuth(_0x46a6b8){return util[_0x172a('0x18')](_0x172a('0x2a'),new Buffer(_0x46a6b8[_0x172a('0x2b')]+':X')[_0x172a('0x2c')](_0x172a('0x2d')));}function request(_0x276aa5){logger['debug']('[HTTP]',JSON[_0x172a('0x2e')](_0x276aa5));return rp(_[_0x172a('0x8')](_0x276aa5,{'method':_0x172a('0x2f'),'headers':headers,'json':!![]}));}function getTags(_0x3997d3,_0x2f0784){var _0x547b1f=[];if(_0x3997d3&&_0x3997d3[_0x172a('0x30')]>0x0){_0x547b1f=_[_0x172a('0x31')](_0x3997d3,_0x2f0784);}return _0x547b1f;}function getCustomFields(_0x5e00aa,_0x5589c6){var _0x51ac8d=[];var _0x16a789={'custom_fields':[]};if(_0x5e00aa[_0x172a('0x30')]>0x0){_[_0x172a('0x32')](_0x5e00aa,function(_0x37c8d8){if(_[_0x172a('0x33')]([_0x172a('0x34'),_0x172a('0x35')],_0x37c8d8['type'])&&_0x37c8d8[_0x172a('0x36')]&&!_0x37c8d8['customField']){_0x16a789[_0x37c8d8[_0x172a('0x36')][_0x172a('0x37')]()]=_0x37c8d8['content'][_0x172a('0x2c')]();}else if(_[_0x172a('0x33')]([_0x172a('0x34'),_0x172a('0x35')],_0x37c8d8[_0x172a('0x38')])&&_0x37c8d8['idField']&&_0x37c8d8[_0x172a('0x39')]){_0x16a789[_0x172a('0x3a')]['push']({'id':_0x37c8d8[_0x172a('0x3b')],'value':_0x37c8d8['content'][_0x172a('0x2c')]()});}else if(_0x37c8d8[_0x172a('0x38')]==='variable'&&_0x37c8d8[_0x172a('0x3c')]&&_0x37c8d8[_0x172a('0x3b')]&&_0x37c8d8[_0x172a('0x39')]){_0x5589c6[_0x37c8d8['variableName']]&&_0x16a789[_0x172a('0x3a')]['push']({'id':_0x37c8d8[_0x172a('0x3b')],'value':_0x5589c6[_0x37c8d8[_0x172a('0x3c')]]['toString']()});}else if(_0x37c8d8[_0x172a('0x38')]==='customVariable'&&_0x37c8d8[_0x172a('0x3d')]&&_0x37c8d8[_0x172a('0x3d')][_0x172a('0x14')]&&_0x37c8d8[_0x172a('0x3b')]&&_0x37c8d8['customField']){_0x5589c6[_0x37c8d8[_0x172a('0x3d')]['name']['toLowerCase']()]&&_0x16a789[_0x172a('0x3a')]['push']({'id':_0x37c8d8['idField'],'value':_0x5589c6[_0x37c8d8['Variable'][_0x172a('0x14')][_0x172a('0x37')]()][_0x172a('0x2c')]()});}});}return _0x16a789;}exports[_0x172a('0x3e')]=function(_0x146d0e,_0x3df776,_0x5df62f,_0x24dde2,_0x4eea4f,_0x5007ad){var _0x1a3b32,_0x3bd0fc;_0x5007ad['remoteUri']=intUtil[_0x172a('0x3f')](_0x5007ad[_0x172a('0x20')]);_0x5007ad[_0x172a('0x40')]=intUtil[_0x172a('0x3f')](_0x5007ad[_0x172a('0x40')]);if(_0x4eea4f&&_0x4eea4f[_0x172a('0x41')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x3df776[_0x172a('0x42')]=util[_0x172a('0x18')](_0x172a('0x43'),_0x5007ad['serverUrl'],_0x3df776[_0x172a('0x44')],md5(_0x3df776[_0x172a('0x44')]));}else{_0x3df776[_0x172a('0x42')]='';}headers[_0x172a('0x45')]=getAuth(_0x5007ad);return getUser(_0x5007ad,_0x24dde2[_0x172a('0x46')])[_0x172a('0x1b')](function(_0x2bed7d){_0x1a3b32=_0x2bed7d;logger[_0x172a('0x1c')]('The\x20User\x20ID\x20is:',_0x1a3b32['id']);return getEndUser(_0x5007ad,_0x3df776[_0x172a('0xf')],_0x3df776[_0x172a('0x10')]);})['then'](function(_0xa4ef17){_0x3bd0fc=_0xa4ef17;logger[_0x172a('0x1c')]('The\x20Enduser\x20ID\x20is:',_0x3bd0fc['id']);return getTicket(_0x5007ad,_0x1a3b32,_0x3bd0fc,_0x5df62f,_0x3df776);})[_0x172a('0x1b')](function(_0xcee705){if(_0xcee705&&_0xcee705['id']){logger['info'](_0x172a('0x1d'));logger[_0x172a('0x1c')](_0x172a('0x47'),_0xcee705['id']);logger['info'](_0x172a('0x48'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x172a('0x18')]('user:%s',_0x24dde2[_0x172a('0x14')]),_0x172a('0x49'),{'uri':util[_0x172a('0x18')]('%s/helpdesk/tickets/%d',_0x5007ad[_0x172a('0x20')],_0xcee705['id'])});}})[_0x172a('0x4a')](function(_0x43f180){logger[_0x172a('0x4b')](_0x172a('0x48'),JSON[_0x172a('0x2e')](_0x43f180));});};exports[_0x172a('0x4c')]=function(_0x4d178a,_0x358b01,_0x32fd40,_0x295eac,_0x56add9,_0x2c465d,_0x54ba3e){var _0x185eb9,_0x704be6;_0x2c465d[_0x172a('0x20')]=intUtil[_0x172a('0x3f')](_0x2c465d[_0x172a('0x20')]);_0x2c465d[_0x172a('0x40')]=intUtil[_0x172a('0x3f')](_0x2c465d[_0x172a('0x40')]);if(_0x54ba3e&&_0x54ba3e[_0x172a('0x4d')]&&_0x54ba3e[_0x172a('0x4d')]!==_0x172a('0x4e')){logger[_0x172a('0x1c')](_0x172a('0x4f'),_0x172a('0x50'));_0x358b01['recordingURL']=util[_0x172a('0x18')](_0x172a('0x43'),_0x2c465d[_0x172a('0x40')],_0x358b01[_0x172a('0x44')],md5(_0x358b01['uniqueid']));}headers[_0x172a('0x45')]=getAuth(_0x2c465d);return getUser(_0x2c465d,_0x295eac[_0x172a('0x46')])[_0x172a('0x1b')](function(_0x48d2fa){_0x185eb9=_0x48d2fa;logger[_0x172a('0x1c')](_0x172a('0x51'),_0x185eb9['id']);return getEndUser(_0x2c465d,_0x358b01[_0x172a('0x52')],_0x358b01[_0x172a('0x53')]);})['then'](function(_0x1743e4){_0x704be6=_0x1743e4;logger['info'](_0x172a('0x54'),_0x704be6['id']);return getTicket(_0x2c465d,_0x185eb9,_0x704be6,_0x32fd40,_0x358b01);})[_0x172a('0x1b')](function(_0x26ba83){if(_0x26ba83&&_0x26ba83['id']){logger['info']('Ticket\x20created!');logger[_0x172a('0x1c')](_0x172a('0x47'),_0x26ba83['id']);logger[_0x172a('0x1c')](_0x172a('0x4f'),_0x172a('0x55'));emit(util[_0x172a('0x18')](_0x172a('0x56'),_0x295eac[_0x172a('0x14')]),_0x172a('0x49'),{'uri':util['format'](_0x172a('0x57'),_0x2c465d[_0x172a('0x20')],_0x26ba83['id'])});}})[_0x172a('0x4a')](function(_0x5b520a){logger[_0x172a('0x4b')](_0x172a('0x4f'),JSON[_0x172a('0x2e')](_0x5b520a));});};exports['unmanaged']=function(_0x1ad528,_0x39f2a4,_0x2bddeb,_0x40265a,_0x57c190,_0x883269){var _0x494c09,_0x278264;_0x883269['remoteUri']=intUtil['stripTrailingSlash'](_0x883269[_0x172a('0x20')]);_0x883269['serverUrl']=intUtil['stripTrailingSlash'](_0x883269[_0x172a('0x40')]);if(_0x57c190&&_0x57c190[_0x172a('0x41')]){logger[_0x172a('0x1c')]('['+_0x39f2a4['lastevent'][_0x172a('0x58')]()+']',_0x172a('0x50'));_0x39f2a4[_0x172a('0x42')]=util['format'](_0x172a('0x43'),_0x883269[_0x172a('0x40')],_0x39f2a4[_0x172a('0x44')],md5(_0x39f2a4['uniqueid']));}else{_0x39f2a4[_0x172a('0x42')]='';}headers[_0x172a('0x45')]=getAuth(_0x883269);return getUser(_0x883269,'')[_0x172a('0x1b')](function(_0x156af8){_0x494c09=_0x156af8;logger[_0x172a('0x1c')]('The\x20User\x20ID\x20is:',_0x494c09['id']);return getEndUser(_0x883269,_0x39f2a4['calleridname'],_0x39f2a4['calleridnum']);})[_0x172a('0x1b')](function(_0x464ab5){_0x278264=_0x464ab5;logger[_0x172a('0x1c')]('The\x20Enduser\x20ID\x20is:',_0x278264['id']);return getTicket(_0x883269,_0x494c09,_0x278264,_0x2bddeb,_0x39f2a4);})[_0x172a('0x1b')](function(_0x208e7){if(_0x208e7){logger['info'](_0x172a('0x1d'));logger['info'](_0x172a('0x47'),_0x208e7['id']);}})[_0x172a('0x4a')](function(_0x318412){logger[_0x172a('0x4b')]('['+_0x39f2a4[_0x172a('0x59')][_0x172a('0x58')]()+']',JSON['stringify'](_0x318412));});}; \ No newline at end of file +var _0x5478=['recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','trigger:browser:url','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','info','Caller\x20-\x20%s','calleridname','getString','Subjects','Descriptions','
','Tags','name','custom_fields','mapValues','keyBy','value','format','%s/api/v2/tickets','remoteUri','POST','Ticket\x20created!','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','then','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','length','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','apiKey','toString','base64','debug','[HTTP]','stringify','GET','map','forEach','includes','string','picklist','nameField','customField','content','type','idField','variable','variableName','push','customVariable','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/helpdesk/tickets/%d','catch','error','[QUEUE]','outbound'];(function(_0x9668c1,_0x26274a){var _0x50b7e6=function(_0x42e9d2){while(--_0x42e9d2){_0x9668c1['push'](_0x9668c1['shift']());}};_0x50b7e6(++_0x26274a);}(_0x5478,0x18d));var _0x8547=function(_0x2aee2f,_0xad9887){_0x2aee2f=_0x2aee2f-0x0;var _0x19337f=_0x5478[_0x2aee2f];return _0x19337f;};'use strict';var _=require(_0x8547('0x0'));var rp=require(_0x8547('0x1'));var md5=require(_0x8547('0x2'));var util=require(_0x8547('0x3'));var Redis=require(_0x8547('0x4'));var intUtil=require(_0x8547('0x5'));var config=require(_0x8547('0x6'));var logger=require('../../../../config/logger')(_0x8547('0x7'));config[_0x8547('0x8')]=_[_0x8547('0x9')](config[_0x8547('0x8')],{'host':_0x8547('0xa'),'port':0x18eb});var io=require(_0x8547('0xb'))(new Redis(config['redis']));var headers={'Content-Type':_0x8547('0xc'),'Accept':_0x8547('0xc')};function emit(_0x4debf6,_0x5ec598,_0x43b5d7){io['to'](_0x4debf6)['emit'](_0x5ec598,_0x43b5d7);}function getTicket(_0x292a01,_0x5a310e,_0x36e4ed,_0x30ae2d,_0x9fe705){logger[_0x8547('0xd')]('Creating\x20new\x20ticket...');var _0x54bc73=_['merge']({'responder_id':_0x5a310e['id'],'requester_id':_0x36e4ed['id'],'name':util['format'](_0x8547('0xe'),_0x9fe705[_0x8547('0xf')]),'phone':_0x9fe705['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x8547('0x10')](_0x30ae2d[_0x8547('0x11')],_0x9fe705,'\x20'),'description':intUtil[_0x8547('0x10')](_0x30ae2d[_0x8547('0x12')],_0x9fe705,_0x8547('0x13')),'tags':getTags(_0x30ae2d[_0x8547('0x14')],_0x8547('0x15'))},getCustomFields(_0x30ae2d['Fields'],_0x9fe705));_0x54bc73[_0x8547('0x16')]=_[_0x8547('0x17')](_[_0x8547('0x18')](_0x54bc73[_0x8547('0x16')],'id'),_0x8547('0x19'));return request({'uri':util[_0x8547('0x1a')](_0x8547('0x1b'),_0x292a01[_0x8547('0x1c')]),'method':_0x8547('0x1d'),'body':_0x54bc73})['then'](function(_0x374633){logger[_0x8547('0xd')](_0x8547('0x1e'));return _0x374633;});}function getUser(_0x504966,_0x2da248){if(intUtil['validateEmail'](_0x2da248)){return request({'uri':util[_0x8547('0x1a')]('%s/api/v2/agents',_0x504966[_0x8547('0x1c')]),'qs':{'email':_0x2da248}})['then'](function(_0x34defa){if(_0x34defa['length']){logger[_0x8547('0xd')](_0x8547('0x1f'));return _[_0x8547('0x20')](_0x34defa,function(_0x246e76){return _0x246e76[_0x8547('0x21')][_0x8547('0x22')]===_0x2da248;});}else{logger['info'](_0x8547('0x23'));return request({'uri':util['format'](_0x8547('0x24'),_0x504966[_0x8547('0x1c')])})[_0x8547('0x25')](function(_0x315789){logger[_0x8547('0xd')](_0x8547('0x26'));return _0x315789;});}});}else{logger[_0x8547('0xd')](_0x8547('0x27'));return request({'uri':util['format'](_0x8547('0x24'),_0x504966['remoteUri'])})[_0x8547('0x25')](function(_0x38080c){logger[_0x8547('0xd')](_0x8547('0x26'));return _0x38080c;});}}function getEndUser(_0x566cbb,_0x187cdc,_0x60c217){logger['info'](_0x8547('0x28'),_0x60c217);return request({'uri':util[_0x8547('0x1a')](_0x8547('0x29'),_0x566cbb[_0x8547('0x1c')]),'qs':{'phone':_0x60c217}})[_0x8547('0x25')](function(_0x2d7942){if(_0x2d7942[_0x8547('0x2a')]){logger['info'](_0x8547('0x2b'));return _[_0x8547('0x20')](_0x2d7942,{'phone':_0x60c217});}else{logger['info'](_0x8547('0x2c'));return request({'uri':util[_0x8547('0x1a')](_0x8547('0x29'),_0x566cbb['remoteUri']),'method':_0x8547('0x1d'),'body':{'name':_0x187cdc,'phone':_0x60c217}})['then'](function(_0x1d5867){logger[_0x8547('0xd')]('Enduser\x20created.');return _0x1d5867;});}});}function getAuth(_0x380114){return util['format']('Basic\x20%s',new Buffer(_0x380114[_0x8547('0x2d')]+':X')[_0x8547('0x2e')](_0x8547('0x2f')));}function request(_0x5e2296){logger[_0x8547('0x30')](_0x8547('0x31'),JSON[_0x8547('0x32')](_0x5e2296));return rp(_['defaults'](_0x5e2296,{'method':_0x8547('0x33'),'headers':headers,'json':!![]}));}function getTags(_0x15f027,_0x1cd00a){var _0x5b304a=[];if(_0x15f027&&_0x15f027[_0x8547('0x2a')]>0x0){_0x5b304a=_[_0x8547('0x34')](_0x15f027,_0x1cd00a);}return _0x5b304a;}function getCustomFields(_0x2d8109,_0x1f25f2){var _0x460e73=[];var _0x2787a5={'custom_fields':[]};if(_0x2d8109[_0x8547('0x2a')]>0x0){_[_0x8547('0x35')](_0x2d8109,function(_0x264774){if(_[_0x8547('0x36')]([_0x8547('0x37'),_0x8547('0x38')],_0x264774['type'])&&_0x264774[_0x8547('0x39')]&&!_0x264774[_0x8547('0x3a')]){_0x2787a5[_0x264774[_0x8547('0x39')]['toLowerCase']()]=_0x264774[_0x8547('0x3b')]['toString']();}else if(_[_0x8547('0x36')](['string',_0x8547('0x38')],_0x264774[_0x8547('0x3c')])&&_0x264774['idField']&&_0x264774['customField']){_0x2787a5[_0x8547('0x16')]['push']({'id':_0x264774[_0x8547('0x3d')],'value':_0x264774['content'][_0x8547('0x2e')]()});}else if(_0x264774[_0x8547('0x3c')]===_0x8547('0x3e')&&_0x264774[_0x8547('0x3f')]&&_0x264774['idField']&&_0x264774[_0x8547('0x3a')]){_0x1f25f2[_0x264774['variableName']]&&_0x2787a5[_0x8547('0x16')][_0x8547('0x40')]({'id':_0x264774[_0x8547('0x3d')],'value':_0x1f25f2[_0x264774[_0x8547('0x3f')]][_0x8547('0x2e')]()});}else if(_0x264774[_0x8547('0x3c')]===_0x8547('0x41')&&_0x264774[_0x8547('0x42')]&&_0x264774['Variable']['name']&&_0x264774[_0x8547('0x3d')]&&_0x264774[_0x8547('0x3a')]){_0x1f25f2[_0x264774['Variable'][_0x8547('0x15')]['toLowerCase']()]&&_0x2787a5[_0x8547('0x16')]['push']({'id':_0x264774[_0x8547('0x3d')],'value':_0x1f25f2[_0x264774['Variable']['name'][_0x8547('0x43')]()][_0x8547('0x2e')]()});}});}return _0x2787a5;}exports[_0x8547('0x44')]=function(_0x401462,_0x365892,_0x321551,_0x477f1e,_0x22b5d1,_0x1334f1){var _0x55a6f2,_0xa760e3;_0x1334f1['remoteUri']=intUtil[_0x8547('0x45')](_0x1334f1[_0x8547('0x1c')]);_0x1334f1[_0x8547('0x46')]=intUtil[_0x8547('0x45')](_0x1334f1[_0x8547('0x46')]);if(_0x22b5d1&&_0x22b5d1[_0x8547('0x47')]){logger[_0x8547('0xd')]('[QUEUE]',_0x8547('0x48'));_0x365892[_0x8547('0x49')]=util[_0x8547('0x1a')](_0x8547('0x4a'),_0x1334f1[_0x8547('0x46')],_0x365892[_0x8547('0x4b')],md5(_0x365892[_0x8547('0x4b')]));}else{_0x365892[_0x8547('0x49')]='';}headers[_0x8547('0x4c')]=getAuth(_0x1334f1);return getUser(_0x1334f1,_0x477f1e['email'])[_0x8547('0x25')](function(_0x38e21d){_0x55a6f2=_0x38e21d;logger[_0x8547('0xd')](_0x8547('0x4d'),_0x55a6f2['id']);return getEndUser(_0x1334f1,_0x365892[_0x8547('0xf')],_0x365892[_0x8547('0x4e')]);})[_0x8547('0x25')](function(_0x593e22){_0xa760e3=_0x593e22;logger['info'](_0x8547('0x4f'),_0xa760e3['id']);return getTicket(_0x1334f1,_0x55a6f2,_0xa760e3,_0x321551,_0x365892);})['then'](function(_0x46ee89){if(_0x46ee89&&_0x46ee89['id']){logger[_0x8547('0xd')]('Ticket\x20created!');logger[_0x8547('0xd')](_0x8547('0x50'),_0x46ee89['id']);logger[_0x8547('0xd')]('[QUEUE]',_0x8547('0x51'));emit(util[_0x8547('0x1a')](_0x8547('0x52'),_0x477f1e[_0x8547('0x15')]),'trigger:browser:url',{'uri':util['format'](_0x8547('0x53'),_0x1334f1[_0x8547('0x1c')],_0x46ee89['id'])});}})[_0x8547('0x54')](function(_0x44387f){logger[_0x8547('0x55')](_0x8547('0x56'),JSON[_0x8547('0x32')](_0x44387f));});};exports[_0x8547('0x57')]=function(_0x5e43dc,_0x563521,_0xecbca0,_0x250284,_0x419498,_0x2fe578,_0x3aa30c){var _0x182a93,_0xc9e79;_0x2fe578[_0x8547('0x1c')]=intUtil['stripTrailingSlash'](_0x2fe578[_0x8547('0x1c')]);_0x2fe578[_0x8547('0x46')]=intUtil[_0x8547('0x45')](_0x2fe578[_0x8547('0x46')]);if(_0x3aa30c&&_0x3aa30c[_0x8547('0x58')]&&_0x3aa30c[_0x8547('0x58')]!==_0x8547('0x59')){logger[_0x8547('0xd')](_0x8547('0x5a'),'Recording\x20is\x20enabled!');_0x563521['recordingURL']=util['format'](_0x8547('0x4a'),_0x2fe578[_0x8547('0x46')],_0x563521['uniqueid'],md5(_0x563521[_0x8547('0x4b')]));}headers['Authorization']=getAuth(_0x2fe578);return getUser(_0x2fe578,_0x250284[_0x8547('0x22')])['then'](function(_0x1fb4c3){_0x182a93=_0x1fb4c3;logger['info'](_0x8547('0x4d'),_0x182a93['id']);return getEndUser(_0x2fe578,_0x563521[_0x8547('0x5b')],_0x563521[_0x8547('0x5c')]);})[_0x8547('0x25')](function(_0x49163d){_0xc9e79=_0x49163d;logger['info'](_0x8547('0x4f'),_0xc9e79['id']);return getTicket(_0x2fe578,_0x182a93,_0xc9e79,_0xecbca0,_0x563521);})[_0x8547('0x25')](function(_0x5b86dc){if(_0x5b86dc&&_0x5b86dc['id']){logger[_0x8547('0xd')](_0x8547('0x1e'));logger[_0x8547('0xd')](_0x8547('0x50'),_0x5b86dc['id']);logger[_0x8547('0xd')]('[OUTBOUND]',_0x8547('0x51'));emit(util['format']('user:%s',_0x250284[_0x8547('0x15')]),_0x8547('0x5d'),{'uri':util[_0x8547('0x1a')]('%s/helpdesk/tickets/%d',_0x2fe578[_0x8547('0x1c')],_0x5b86dc['id'])});}})[_0x8547('0x54')](function(_0x233672){logger[_0x8547('0x55')](_0x8547('0x5a'),JSON[_0x8547('0x32')](_0x233672));});};exports[_0x8547('0x5e')]=function(_0x5f36f8,_0x5cd438,_0x5332e3,_0x2525fc,_0x1976a9,_0x5cda18){var _0x3fa5b6,_0x33b3c3;_0x5cda18[_0x8547('0x1c')]=intUtil[_0x8547('0x45')](_0x5cda18[_0x8547('0x1c')]);_0x5cda18['serverUrl']=intUtil[_0x8547('0x45')](_0x5cda18[_0x8547('0x46')]);if(_0x1976a9&&_0x1976a9[_0x8547('0x47')]){logger[_0x8547('0xd')]('['+_0x5cd438[_0x8547('0x5f')][_0x8547('0x60')]()+']',_0x8547('0x48'));_0x5cd438[_0x8547('0x49')]=util[_0x8547('0x1a')](_0x8547('0x4a'),_0x5cda18[_0x8547('0x46')],_0x5cd438[_0x8547('0x4b')],md5(_0x5cd438['uniqueid']));}else{_0x5cd438['recordingURL']='';}headers[_0x8547('0x4c')]=getAuth(_0x5cda18);return getUser(_0x5cda18,'')['then'](function(_0xf6daa1){_0x3fa5b6=_0xf6daa1;logger['info'](_0x8547('0x4d'),_0x3fa5b6['id']);return getEndUser(_0x5cda18,_0x5cd438[_0x8547('0xf')],_0x5cd438[_0x8547('0x4e')]);})[_0x8547('0x25')](function(_0xa60fc7){_0x33b3c3=_0xa60fc7;logger[_0x8547('0xd')](_0x8547('0x4f'),_0x33b3c3['id']);return getTicket(_0x5cda18,_0x3fa5b6,_0x33b3c3,_0x5332e3,_0x5cd438);})[_0x8547('0x25')](function(_0x2edc5){if(_0x2edc5){logger['info']('Ticket\x20created!');logger[_0x8547('0xd')]('The\x20Ticket\x20ID\x20is:',_0x2edc5['id']);}})[_0x8547('0x54')](function(_0x8bfc81){logger[_0x8547('0x55')]('['+_0x5cd438[_0x8547('0x5f')][_0x8547('0x60')]()+']',JSON[_0x8547('0x32')](_0x8bfc81));});}; \ 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 330591e..ce5fafa 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 _0x2946=['util','moment','bluebird','ioredis','../../../../config/environment','../../../../config/logger','redis','localhost','/api/selector/owners','info','Getting\x20admin\x20information','then','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','GET','headers','users','agentEmail','Getting\x20user\x20with\x20email','length','userId','User\x20found:','Admin\x20selected','userEmail','toUpperCase','message','/api/lookup?q=','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','YYYY-MM-DDTHH:mm:ss','/api/tasks','getString','Contact','add','ticketId','task','Task\x20created:','/contacts/','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','md5'];(function(_0x25b365,_0x570f17){var _0xc9f56=function(_0x36380f){while(--_0x36380f){_0x25b365['push'](_0x25b365['shift']());}};_0xc9f56(++_0x570f17);}(_0x2946,0x193));var _0x6294=function(_0xe65e3e,_0x29466f){_0xe65e3e=_0xe65e3e-0x0;var _0x4dd4cd=_0x2946[_0xe65e3e];return _0x4dd4cd;};'use strict';var _=require(_0x6294('0x0'));var rp=require('request-promise');var md5=require(_0x6294('0x1'));var util=require(_0x6294('0x2'));var moment=require(_0x6294('0x3'));var Promise=require(_0x6294('0x4'));var Redis=require(_0x6294('0x5'));var intUtil=require('./util');var config=require(_0x6294('0x6'));var logger=require(_0x6294('0x7'))('freshsales');config['redis']=_['defaults'](config[_0x6294('0x8')],{'host':_0x6294('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6294('0x8')]));function getAdminId(_0x5304cd,_0x2708f8,_0x4a0bac,_0x4868f5){return new Promise(function(_0x1cabdf,_0x34c649){var _0xbac5ca=![];var _0x3d3e7b={'method':'GET','uri':_0x4868f5+_0x6294('0xa'),'json':!![]};_0x3d3e7b['headers']=_0x4a0bac;logger[_0x6294('0xb')](_0x6294('0xc'));return rp(_0x3d3e7b)[_0x6294('0xd')](function(_0x3067fe){if(_0x3067fe){var _0x4c4825=_0x3067fe['users'];var _0x2c2f2e=null;for(_0x2c2f2e=0x0;_0x2c2f2e<_0x4c4825['length'];_0x2c2f2e++){if(_0x4c4825[_0x2c2f2e][_0x6294('0xe')]===_0x5304cd[_0x6294('0xf')]){_0x5304cd[_0x6294('0x10')]=_0x4c4825[_0x2c2f2e]['id'];_0xbac5ca=!![];}}if(_0xbac5ca){logger['info'](_0x6294('0x11'),_0x5304cd[_0x6294('0x10')]);_0x1cabdf(_0x5304cd);}else{_0x34c649({'statusCode':0x194,'message':_0x6294('0x12')});}}else{_0x34c649({'statusCode':0x194,'message':_0x6294('0x12')});}})[_0x6294('0x13')](function(_0x4d201f){logger[_0x6294('0x14')]('['+[_0x2708f8['toUpperCase']()]+']',_0x4d201f['message']);_0x34c649(_0x4d201f);});});}function getUser(_0xbdbca2,_0x5109d5,_0x2efa07){return function(_0x1a8920){return new Promise(function(_0x3a0b4b,_0x326a7c){var _0x50f6a8={'method':_0x6294('0x15'),'uri':_0x2efa07+_0x6294('0xa'),'json':!![]};_0x50f6a8[_0x6294('0x16')]=_0x5109d5;logger[_0x6294('0xb')]('Getting\x20user\x20list');return rp(_0x50f6a8)['then'](function(_0x108b46){if(_0x108b46){var _0x33c5df=_0x108b46[_0x6294('0x17')];var _0x31a3dc=![];var _0x47c2de=null;if(_0x1a8920[_0x6294('0x18')]!==null){logger[_0x6294('0xb')](_0x6294('0x19'),_0x1a8920[_0x6294('0x18')]);_0x1a8920['userEmail']=_0x1a8920[_0x6294('0x18')];for(_0x47c2de=0x0;_0x47c2de<_0x33c5df[_0x6294('0x1a')];_0x47c2de++){if(_0x33c5df[_0x47c2de][_0x6294('0xe')]===_0x1a8920[_0x6294('0x18')]){_0x31a3dc=!![];_0x1a8920[_0x6294('0x1b')]=_0x33c5df[_0x47c2de]['id'];logger['info'](_0x6294('0x1c'),_0x1a8920[_0x6294('0x1b')]);}}}if(!_0x31a3dc){logger[_0x6294('0xb')](_0x6294('0x1d'));_0x1a8920[_0x6294('0x1e')]=_0x1a8920[_0x6294('0xf')];_0x1a8920[_0x6294('0x1b')]=_0x1a8920['adminId'];_0x31a3dc=!![];}if(_0x31a3dc){_0x3a0b4b(_0x1a8920);}else{_0x326a7c({'statusCode':0x194,'message':_0x6294('0x12')});}}else{_0x326a7c({'statusCode':0x194,'message':_0x6294('0x12')});}})[_0x6294('0x13')](function(_0x87dda7){logger[_0x6294('0x14')]('['+[_0xbdbca2[_0x6294('0x1f')]()]+']',_0x87dda7[_0x6294('0x20')]);_0x326a7c(_0x87dda7);});});};}function searchContact(_0x6fa2d,_0x354676,_0x1f739a,_0x455e84){return new Promise(function(_0x5e59e8,_0x2d84ae){var _0x43e029={'method':'GET','headers':_0x354676,'uri':_0x6fa2d+_0x6294('0x21')+_0x455e84+'&f='+_0x1f739a+'&entities=contact','json':!![]};rp(_0x43e029)[_0x6294('0xd')](function(_0x33a13f){var _0x3e1af1=_[_0x6294('0x22')](_0x33a13f[_0x6294('0x23')][_0x6294('0x23')],[_0x1f739a,_0x455e84]);_0x5e59e8(_0x3e1af1);})[_0x6294('0x13')](function(_0x3adf7c){_0x2d84ae(_0x3adf7c);});});}function getEndUser(_0x5608e2,_0x25db8c,_0x583ee3){return function(_0x5b6665){return new Promise(function(_0x1a3f8e,_0x45f440){logger[_0x6294('0xb')](util[_0x6294('0x24')](_0x6294('0x25'),_0x5b6665[_0x6294('0x26')]));searchContact(_0x583ee3,_0x25db8c,_0x6294('0x27'),_0x5b6665['contactNumber'])[_0x6294('0xd')](function(_0xe08fd5){if(_0xe08fd5){_0x5b6665[_0x6294('0x28')]=_0xe08fd5['id'];logger[_0x6294('0xb')]('Contact\x20found\x20mobile_number:',_0x5b6665[_0x6294('0x28')]);return _0x1a3f8e(_0x5b6665);}searchContact(_0x583ee3,_0x25db8c,_0x6294('0x29'),_0x5b6665['contactNumber'])[_0x6294('0xd')](function(_0x3afd90){if(_0x3afd90){_0x5b6665[_0x6294('0x28')]=_0x3afd90['id'];logger[_0x6294('0xb')](_0x6294('0x2a'),_0x5b6665[_0x6294('0x28')]);return _0x1a3f8e(_0x5b6665);}createEndUser(_0x5b6665,_0x5608e2,_0x25db8c,_0x583ee3)[_0x6294('0xd')](function(_0x3bbb28){logger[_0x6294('0xb')](_0x6294('0x2b'),_0x3bbb28[_0x6294('0x28')]);return _0x1a3f8e(_0x3bbb28);});});})[_0x6294('0x13')](function(_0x3e99d1){_0x45f440(_0x3e99d1);});});};}function createEndUser(_0x328f70,_0x404c25,_0x28ac64,_0x296a1e){return new Promise(function(_0x203956,_0x149e64){var _0x3e395b=moment();var _0x23877b={'method':_0x6294('0x2c'),'uri':_0x296a1e+'/api/contacts','body':{'contact':{'last_name':_0x328f70[_0x6294('0x26')],'work_number':_0x328f70[_0x6294('0x26')],'mobile_number':_0x328f70[_0x6294('0x26')],'owner_id':_0x328f70[_0x6294('0x1b')],'created_at':_0x3e395b[_0x6294('0x24')](_0x6294('0x2d'))}},'json':!![]};_0x23877b[_0x6294('0x16')]=_0x28ac64;logger[_0x6294('0xb')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x23877b)['then'](function(_0x273fbb){_0x328f70[_0x6294('0x28')]=_0x273fbb['contact']['id'];_0x203956(_0x328f70);})[_0x6294('0x13')](function(_0x3642d4){logger[_0x6294('0x14')]('['+[_0x404c25[_0x6294('0x1f')]()]+']',_0x3642d4[_0x6294('0x20')]);_0x149e64(_0x3642d4[_0x6294('0x20')]);});});}function getTicket(_0x49a3e6,_0x350055,_0x226043,_0x1b5d40,_0x13f28a){return function(_0x1518f5){logger[_0x6294('0xb')]('Creating\x20new\x20task');return new Promise(function(_0x3a961c,_0x569b67){var _0x3e4bdd=moment();var _0x11294d={'method':'POST','uri':_0x226043+_0x6294('0x2e'),'body':{'title':intUtil[_0x6294('0x2f')](_0x1b5d40['Subjects'],_0x13f28a,'\x20'),'description':intUtil[_0x6294('0x2f')](_0x1b5d40['Descriptions'],_0x13f28a,'\x0a'),'owner_id':_0x1518f5[_0x6294('0x1b')],'creater_id':_0x1518f5[_0x6294('0x10')],'targetable_id':_0x1518f5[_0x6294('0x28')],'targetable_type':_0x6294('0x30'),'created_at':_0x3e4bdd[_0x6294('0x24')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x3e4bdd[_0x6294('0x31')](0x1e,'m')[_0x6294('0x24')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x11294d[_0x6294('0x16')]=_0x350055;return rp(_0x11294d)[_0x6294('0xd')](function(_0x2fe1a4){_0x1518f5[_0x6294('0x32')]=_0x2fe1a4[_0x6294('0x33')]['id'];logger['info'](_0x6294('0x34'),_0x1518f5[_0x6294('0x32')]);_0x3a961c(_0x1518f5);})[_0x6294('0x13')](function(_0x5e5d97){logger[_0x6294('0x14')]('['+[_0x49a3e6[_0x6294('0x1f')]()]+']',_0x5e5d97[_0x6294('0x20')]);_0x569b67(_0x5e5d97[_0x6294('0x20')]);});});};}function emit(_0x45574f,_0x197f8a,_0x1a8cf2){var _0x57a5dc={'uri':_0x45574f+_0x6294('0x35')+_0x1a8cf2};io['to'](util['format']('user:%s',_0x197f8a))['emit'](_0x6294('0x36'),_0x57a5dc);}exports['cs']=function(_0x4ea3f0,_0x42ee8d,_0x2094b9,_0x2c772a,_0xd2b1d7,_0x1832d4,_0x48a8fb,_0x409a54){var _0x3819fe={};var _0x5ad063={'Authorization':_0x6294('0x37')+_0x1832d4[_0x6294('0x38')]};_0x1832d4[_0x6294('0x39')]=intUtil[_0x6294('0x3a')](_0x1832d4['remoteUri']);_0x1832d4['serverUrl']=intUtil[_0x6294('0x3a')](_0x1832d4[_0x6294('0x3b')]);var _0x87b62e=_0x1832d4[_0x6294('0x39')];_0x3819fe[_0x6294('0xf')]=_0x1832d4[_0x6294('0x3c')];_0x3819fe['contactNumber']=_0x409a54[_0x6294('0x3d')]()===_0x6294('0x3e')?_0x42ee8d[_0x6294('0x3f')]:_0x42ee8d[_0x6294('0x40')];_0x3819fe[_0x6294('0x41')]=_0x409a54===_0x6294('0x42')||_0x409a54===_0x6294('0x43')?_0x6294('0x42'):'outbound';if(_0x2c772a){_0x3819fe[_0x6294('0x18')]=_0x2c772a[_0x6294('0xe')];}var _0x52d9c3=util[_0x6294('0x24')](_0x6294('0x44'),_0x1832d4[_0x6294('0x3b')],_0x42ee8d['uniqueid'],md5(_0x42ee8d[_0x6294('0x45')]));if(_0xd2b1d7&&_0xd2b1d7[_0x6294('0x46')]){logger[_0x6294('0xb')](_0x6294('0x47'),_0x6294('0x48'));_0x42ee8d[_0x6294('0x49')]=_0x52d9c3;}else if(_0x48a8fb&&_0x48a8fb[_0x6294('0x4a')]&&_0x48a8fb[_0x6294('0x4a')]!==_0x6294('0x4b')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x42ee8d[_0x6294('0x49')]=_0x52d9c3;}else{_0x42ee8d[_0x6294('0x49')]='';}return getAdminId(_0x3819fe,_0x409a54,_0x5ad063,_0x87b62e)[_0x6294('0xd')](getUser(_0x409a54,_0x5ad063,_0x87b62e))[_0x6294('0xd')](getEndUser(_0x409a54,_0x5ad063,_0x87b62e))['then'](getTicket(_0x409a54,_0x5ad063,_0x87b62e,_0x2094b9,_0x42ee8d))[_0x6294('0xd')](function(_0xf2f5f7){logger[_0x6294('0xb')](util[_0x6294('0x24')](_0x6294('0x4c'),_0xf2f5f7[_0x6294('0x32')]));if(_0x409a54!=='unmanaged'){logger['info']('['+[_0x409a54['toUpperCase']()]+']',_0x6294('0x4d'));emit(_0x87b62e,_0x2c772a[_0x6294('0x4e')],_0xf2f5f7[_0x6294('0x28')]);}})[_0x6294('0x13')](function(_0x17304a){logger[_0x6294('0x14')]('['+[_0x409a54['toUpperCase']()]+_0x6294('0x4f'),util[_0x6294('0x50')](_0x17304a,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x81a9=['name',']\x20Error\x20running\x20Freshsales\x20integration','lodash','request-promise','md5','util','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','GET','headers','info','then','users','length','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','/api/selector/owners','Getting\x20user\x20list','Getting\x20user\x20with\x20email','agentEmail','userId','User\x20found:','Admin\x20selected','userEmail','&f=','&entities=contact','find','contacts','format','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','Subjects','getString','Contact','YYYY-MM-DDTHH:mm:ss','add','ticketId','task','/contacts/','emit','Token\x20token=','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Recording\x20is\x20enabled!','recordingURL','recordingFormat','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...'];(function(_0xb25c53,_0x4ac6b6){var _0x4bd9ef=function(_0x2d300d){while(--_0x2d300d){_0xb25c53['push'](_0xb25c53['shift']());}};_0x4bd9ef(++_0x4ac6b6);}(_0x81a9,0xfb));var _0x981a=function(_0x52f692,_0xfbc239){_0x52f692=_0x52f692-0x0;var _0x293519=_0x81a9[_0x52f692];return _0x293519;};'use strict';var _=require(_0x981a('0x0'));var rp=require(_0x981a('0x1'));var md5=require(_0x981a('0x2'));var util=require(_0x981a('0x3'));var moment=require('moment');var Promise=require(_0x981a('0x4'));var Redis=require(_0x981a('0x5'));var intUtil=require(_0x981a('0x6'));var config=require(_0x981a('0x7'));var logger=require(_0x981a('0x8'))('freshsales');config['redis']=_[_0x981a('0x9')](config[_0x981a('0xa')],{'host':_0x981a('0xb'),'port':0x18eb});var io=require(_0x981a('0xc'))(new Redis(config['redis']));function getAdminId(_0x11f6f7,_0x27e9f9,_0x2a4c8b,_0x2301ca){return new Promise(function(_0x1ce64a,_0x403069){var _0x17fc0b=![];var _0x41538c={'method':_0x981a('0xd'),'uri':_0x2301ca+'/api/selector/owners','json':!![]};_0x41538c[_0x981a('0xe')]=_0x2a4c8b;logger[_0x981a('0xf')]('Getting\x20admin\x20information');return rp(_0x41538c)[_0x981a('0x10')](function(_0x4242b4){if(_0x4242b4){var _0xf210a2=_0x4242b4[_0x981a('0x11')];var _0x48d654=null;for(_0x48d654=0x0;_0x48d654<_0xf210a2[_0x981a('0x12')];_0x48d654++){if(_0xf210a2[_0x48d654][_0x981a('0x13')]===_0x11f6f7[_0x981a('0x14')]){_0x11f6f7[_0x981a('0x15')]=_0xf210a2[_0x48d654]['id'];_0x17fc0b=!![];}}if(_0x17fc0b){logger[_0x981a('0xf')](_0x981a('0x16'),_0x11f6f7[_0x981a('0x15')]);_0x1ce64a(_0x11f6f7);}else{_0x403069({'statusCode':0x194,'message':_0x981a('0x17')});}}else{_0x403069({'statusCode':0x194,'message':_0x981a('0x17')});}})[_0x981a('0x18')](function(_0x37e12){logger[_0x981a('0x19')]('['+[_0x27e9f9[_0x981a('0x1a')]()]+']',_0x37e12[_0x981a('0x1b')]);_0x403069(_0x37e12);});});}function getUser(_0x4443f0,_0x175f18,_0xc1322a){return function(_0x996644){return new Promise(function(_0x500dd5,_0x58ebd0){var _0x5a9d37={'method':_0x981a('0xd'),'uri':_0xc1322a+_0x981a('0x1c'),'json':!![]};_0x5a9d37[_0x981a('0xe')]=_0x175f18;logger[_0x981a('0xf')](_0x981a('0x1d'));return rp(_0x5a9d37)['then'](function(_0x208bf9){if(_0x208bf9){var _0x1e4135=_0x208bf9[_0x981a('0x11')];var _0x303fdf=![];var _0x120294=null;if(_0x996644['agentEmail']!==null){logger['info'](_0x981a('0x1e'),_0x996644[_0x981a('0x1f')]);_0x996644['userEmail']=_0x996644[_0x981a('0x1f')];for(_0x120294=0x0;_0x120294<_0x1e4135['length'];_0x120294++){if(_0x1e4135[_0x120294][_0x981a('0x13')]===_0x996644[_0x981a('0x1f')]){_0x303fdf=!![];_0x996644[_0x981a('0x20')]=_0x1e4135[_0x120294]['id'];logger[_0x981a('0xf')](_0x981a('0x21'),_0x996644['userId']);}}}if(!_0x303fdf){logger[_0x981a('0xf')](_0x981a('0x22'));_0x996644[_0x981a('0x23')]=_0x996644['adminEmail'];_0x996644[_0x981a('0x20')]=_0x996644[_0x981a('0x15')];_0x303fdf=!![];}if(_0x303fdf){_0x500dd5(_0x996644);}else{_0x58ebd0({'statusCode':0x194,'message':_0x981a('0x17')});}}else{_0x58ebd0({'statusCode':0x194,'message':_0x981a('0x17')});}})[_0x981a('0x18')](function(_0x3ded46){logger[_0x981a('0x19')]('['+[_0x4443f0[_0x981a('0x1a')]()]+']',_0x3ded46[_0x981a('0x1b')]);_0x58ebd0(_0x3ded46);});});};}function searchContact(_0x546d62,_0x1e9cf0,_0x256894,_0x5d3281){return new Promise(function(_0x3fd92e,_0x13a3c4){var _0x406b13={'method':'GET','headers':_0x1e9cf0,'uri':_0x546d62+'/api/lookup?q='+_0x5d3281+_0x981a('0x24')+_0x256894+_0x981a('0x25'),'json':!![]};rp(_0x406b13)['then'](function(_0x2e0f9b){var _0x523cc4=_[_0x981a('0x26')](_0x2e0f9b[_0x981a('0x27')][_0x981a('0x27')],[_0x256894,_0x5d3281]);_0x3fd92e(_0x523cc4);})[_0x981a('0x18')](function(_0x3880ea){_0x13a3c4(_0x3880ea);});});}function getEndUser(_0x401bc4,_0x5bb71f,_0x7bc6f){return function(_0x411f39){return new Promise(function(_0x1ef588,_0x5346c8){logger[_0x981a('0xf')](util[_0x981a('0x28')]('Searching\x20contact\x20with\x20phone\x20%s',_0x411f39[_0x981a('0x29')]));searchContact(_0x7bc6f,_0x5bb71f,_0x981a('0x2a'),_0x411f39['contactNumber'])[_0x981a('0x10')](function(_0x589189){if(_0x589189){_0x411f39[_0x981a('0x2b')]=_0x589189['id'];logger[_0x981a('0xf')](_0x981a('0x2c'),_0x411f39['endUserId']);return _0x1ef588(_0x411f39);}searchContact(_0x7bc6f,_0x5bb71f,'work_number',_0x411f39[_0x981a('0x29')])[_0x981a('0x10')](function(_0xcee2d0){if(_0xcee2d0){_0x411f39[_0x981a('0x2b')]=_0xcee2d0['id'];logger[_0x981a('0xf')](_0x981a('0x2d'),_0x411f39[_0x981a('0x2b')]);return _0x1ef588(_0x411f39);}createEndUser(_0x411f39,_0x401bc4,_0x5bb71f,_0x7bc6f)[_0x981a('0x10')](function(_0x10d0e0){logger[_0x981a('0xf')](_0x981a('0x2e'),_0x10d0e0['endUserId']);return _0x1ef588(_0x10d0e0);});});})['catch'](function(_0x88c0f0){_0x5346c8(_0x88c0f0);});});};}function createEndUser(_0x1bf072,_0x3e5d23,_0x1771e1,_0x352722){return new Promise(function(_0x186b77,_0x4ed414){var _0x35f989=moment();var _0x4458d6={'method':_0x981a('0x2f'),'uri':_0x352722+_0x981a('0x30'),'body':{'contact':{'last_name':_0x1bf072[_0x981a('0x29')],'work_number':_0x1bf072[_0x981a('0x29')],'mobile_number':_0x1bf072[_0x981a('0x29')],'owner_id':_0x1bf072[_0x981a('0x20')],'created_at':_0x35f989[_0x981a('0x28')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x4458d6['headers']=_0x1771e1;logger[_0x981a('0xf')](_0x981a('0x31'));return rp(_0x4458d6)[_0x981a('0x10')](function(_0x3416a5){_0x1bf072[_0x981a('0x2b')]=_0x3416a5[_0x981a('0x32')]['id'];_0x186b77(_0x1bf072);})['catch'](function(_0xb42abe){logger['error']('['+[_0x3e5d23['toUpperCase']()]+']',_0xb42abe[_0x981a('0x1b')]);_0x4ed414(_0xb42abe[_0x981a('0x1b')]);});});}function getTicket(_0x35e733,_0x2d587f,_0x4c8ebe,_0x1212ca,_0x25aff5){return function(_0x362388){logger[_0x981a('0xf')](_0x981a('0x33'));return new Promise(function(_0x1930eb,_0xcbfe2b){var _0x19348a=moment();var _0x222ef3={'method':_0x981a('0x2f'),'uri':_0x4c8ebe+_0x981a('0x34'),'body':{'title':intUtil['getString'](_0x1212ca[_0x981a('0x35')],_0x25aff5,'\x20'),'description':intUtil[_0x981a('0x36')](_0x1212ca['Descriptions'],_0x25aff5,'\x0a'),'owner_id':_0x362388[_0x981a('0x20')],'creater_id':_0x362388[_0x981a('0x15')],'targetable_id':_0x362388[_0x981a('0x2b')],'targetable_type':_0x981a('0x37'),'created_at':_0x19348a[_0x981a('0x28')](_0x981a('0x38')),'due_date':_0x19348a[_0x981a('0x39')](0x1e,'m')[_0x981a('0x28')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x222ef3['headers']=_0x2d587f;return rp(_0x222ef3)[_0x981a('0x10')](function(_0x20a23f){_0x362388[_0x981a('0x3a')]=_0x20a23f[_0x981a('0x3b')]['id'];logger[_0x981a('0xf')]('Task\x20created:',_0x362388[_0x981a('0x3a')]);_0x1930eb(_0x362388);})[_0x981a('0x18')](function(_0x24471b){logger[_0x981a('0x19')]('['+[_0x35e733['toUpperCase']()]+']',_0x24471b[_0x981a('0x1b')]);_0xcbfe2b(_0x24471b[_0x981a('0x1b')]);});});};}function emit(_0x1224e5,_0x25eea9,_0x43c091){var _0x4e031b={'uri':_0x1224e5+_0x981a('0x3c')+_0x43c091};io['to'](util[_0x981a('0x28')]('user:%s',_0x25eea9))[_0x981a('0x3d')]('trigger:browser:url',_0x4e031b);}exports['cs']=function(_0x26f788,_0x7347a9,_0x58dd08,_0x2f9f28,_0x226ecb,_0x22921d,_0x1e315f,_0x141285){var _0x2f48af={};var _0x4e7e23={'Authorization':_0x981a('0x3e')+_0x22921d['apiKey']};_0x22921d[_0x981a('0x3f')]=intUtil[_0x981a('0x40')](_0x22921d['remoteUri']);_0x22921d[_0x981a('0x41')]=intUtil[_0x981a('0x40')](_0x22921d[_0x981a('0x41')]);var _0x406993=_0x22921d[_0x981a('0x3f')];_0x2f48af['adminEmail']=_0x22921d[_0x981a('0x42')];_0x2f48af[_0x981a('0x29')]=_0x141285[_0x981a('0x43')]()===_0x981a('0x44')?_0x7347a9[_0x981a('0x45')]:_0x7347a9[_0x981a('0x46')];_0x2f48af[_0x981a('0x47')]=_0x141285===_0x981a('0x48')||_0x141285===_0x981a('0x49')?'queue':_0x981a('0x44');if(_0x2f9f28){_0x2f48af['agentEmail']=_0x2f9f28[_0x981a('0x13')];}var _0x319fdb=util['format'](_0x981a('0x4a'),_0x22921d[_0x981a('0x41')],_0x7347a9['uniqueid'],md5(_0x7347a9[_0x981a('0x4b')]));if(_0x226ecb&&_0x226ecb['monitor_format']){logger[_0x981a('0xf')]('[QUEUE]',_0x981a('0x4c'));_0x7347a9[_0x981a('0x4d')]=_0x319fdb;}else if(_0x1e315f&&_0x1e315f['recordingFormat']&&_0x1e315f[_0x981a('0x4e')]!=='none'){logger[_0x981a('0xf')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x7347a9[_0x981a('0x4d')]=_0x319fdb;}else{_0x7347a9['recordingURL']='';}return getAdminId(_0x2f48af,_0x141285,_0x4e7e23,_0x406993)[_0x981a('0x10')](getUser(_0x141285,_0x4e7e23,_0x406993))[_0x981a('0x10')](getEndUser(_0x141285,_0x4e7e23,_0x406993))[_0x981a('0x10')](getTicket(_0x141285,_0x4e7e23,_0x406993,_0x58dd08,_0x7347a9))[_0x981a('0x10')](function(_0x162db4){logger[_0x981a('0xf')](util['format'](_0x981a('0x4f'),_0x162db4[_0x981a('0x3a')]));if(_0x141285!==_0x981a('0x49')){logger[_0x981a('0xf')]('['+[_0x141285[_0x981a('0x1a')]()]+']',_0x981a('0x50'));emit(_0x406993,_0x2f9f28[_0x981a('0x51')],_0x162db4['endUserId']);}})[_0x981a('0x18')](function(_0x197fdb){logger[_0x981a('0x19')]('['+[_0x141285['toUpperCase']()]+_0x981a('0x52'),util['inspect'](_0x197fdb,{'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 3a3594d..1eec531 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 _0x6f7b=['error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','data2','util','./zendesk','./salesforce','./sugarcrm','./zoho','./desk','./servicenow','./freshsales','zendesk','freshdesk','desk','vtiger','freshsales','servicenow','includes','data1','toLowerCase','Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','salesforce','sugarcrm','zoho','dynamics365','unknown\x20integration','../../../../config/logger'];(function(_0x5b18d2,_0x35cba0){var _0x4fef72=function(_0x1744b2){while(--_0x1744b2){_0x5b18d2['push'](_0x5b18d2['shift']());}};_0x4fef72(++_0x35cba0);}(_0x6f7b,0xe4));var _0xb6f7=function(_0x32640f,_0x58db62){_0x32640f=_0x32640f-0x0;var _0x24ec83=_0x6f7b[_0x32640f];return _0x24ec83;};'use strict';var _=require('lodash');var util=require(_0xb6f7('0x0'));var zendesk=require(_0xb6f7('0x1'));var salesforce=require(_0xb6f7('0x2'));var sugarcrm=require(_0xb6f7('0x3'));var freshdesk=require('./freshdesk');var zoho=require(_0xb6f7('0x4'));var desk=require(_0xb6f7('0x5'));var vtiger=require('./vtiger');var servicenow=require(_0xb6f7('0x6'));var dynamics365=require('./dynamics365');var freshsales=require(_0xb6f7('0x7'));var integrations=[_0xb6f7('0x8'),'salesforce','sugarcrm',_0xb6f7('0x9'),'zoho',_0xb6f7('0xa'),_0xb6f7('0xb'),'dynamics365',_0xb6f7('0xc'),_0xb6f7('0xd')];exports['exec']=function(_0x33d535,_0x478b49,_0x1aa532,_0x5690c2,_0x4d944f,_0x30dbea){if(_0x1aa532){if(_[_0xb6f7('0xe')](integrations,_0x33d535['data1']['toLowerCase']())){try{var _0x54a53f=null;var _0x4cfec1='';var _0x26f1c2=_0x1aa532[_0x33d535[_0xb6f7('0xf')][_0xb6f7('0x10')]()];if(_0x26f1c2){var _0x4e28d2=_0x26f1c2[_0x33d535['data2']];if(_0x4e28d2){var _0x2e0d31=_['find'](_0x4e28d2[_0xb6f7('0x11')],{'id':parseInt(_0x33d535[_0xb6f7('0x12')],0xa)});if(_0x2e0d31){if(_0x5690c2){if(_0x4d944f&&_0x478b49['queue']){_0x4cfec1=_0xb6f7('0x13');}else if(_0x478b49[_0xb6f7('0x14')]){_0x4cfec1=_0xb6f7('0x15');}else{console[_0xb6f7('0x16')](_0xb6f7('0x17'),_0x478b49);}}else{_0x4cfec1=_0xb6f7('0x18');}switch(_0x33d535[_0xb6f7('0xf')]['toLowerCase']()){case _0xb6f7('0x8'):zendesk[_0x4cfec1](_0x33d535,_0x478b49,_0x2e0d31,_0x5690c2,_0x4d944f,_0x4e28d2,_0x30dbea);break;case _0xb6f7('0x19'):salesforce[_0x4cfec1](_0x33d535,_0x478b49,_0x2e0d31,_0x5690c2,_0x4d944f,_0x4e28d2,_0x30dbea);break;case _0xb6f7('0x1a'):sugarcrm[_0x4cfec1](_0x33d535,_0x478b49,_0x2e0d31,_0x5690c2,_0x4d944f,_0x4e28d2,_0x30dbea);break;case'freshdesk':freshdesk[_0x4cfec1](_0x33d535,_0x478b49,_0x2e0d31,_0x5690c2,_0x4d944f,_0x4e28d2,_0x30dbea);break;case _0xb6f7('0x1b'):zoho[_0x4cfec1](_0x33d535,_0x478b49,_0x2e0d31,_0x5690c2,_0x4d944f,_0x4e28d2,_0x30dbea);break;case'desk':desk[_0x4cfec1](_0x33d535,_0x478b49,_0x2e0d31,_0x5690c2,_0x4d944f,_0x4e28d2,_0x30dbea);break;case _0xb6f7('0xb'):vtiger[_0x4cfec1](_0x33d535,_0x478b49,_0x2e0d31,_0x5690c2,_0x4d944f,_0x4e28d2,_0x30dbea);break;case _0xb6f7('0xc'):freshsales['cs'](_0x33d535,_0x478b49,_0x2e0d31,_0x5690c2,_0x4d944f,_0x4e28d2,_0x30dbea,_0x4cfec1);break;case _0xb6f7('0xd'):servicenow['cs'](_0x33d535,_0x478b49,_0x2e0d31,_0x5690c2,_0x4d944f,_0x4e28d2,_0x30dbea,_0x4cfec1);break;case _0xb6f7('0x1c'):dynamics365['cs'](_0x33d535,_0x478b49,_0x2e0d31,_0x5690c2,_0x4d944f,_0x4e28d2,_0x30dbea,_0x4cfec1);break;default:console['log'](_0xb6f7('0x1d'));}}else{_0x54a53f=require(_0xb6f7('0x1e'))(_0x33d535[_0xb6f7('0xf')][_0xb6f7('0x10')]());_0x54a53f[_0xb6f7('0x1f')](_0xb6f7('0x20'),util[_0xb6f7('0x21')](_0xb6f7('0x22'),_0x33d535[_0xb6f7('0xf')]['toLowerCase'](),_0x33d535[_0xb6f7('0x12')]));}}else{_0x54a53f=require(_0xb6f7('0x1e'))(_0x33d535[_0xb6f7('0xf')][_0xb6f7('0x10')]());_0x54a53f[_0xb6f7('0x1f')](_0xb6f7('0x20'),util[_0xb6f7('0x21')](_0xb6f7('0x23'),_0x33d535[_0xb6f7('0xf')][_0xb6f7('0x10')](),_0x33d535[_0xb6f7('0x24')]));}}else{}}catch(_0x43fdbf){console[_0xb6f7('0x1f')](_0x43fdbf);}}}}; \ No newline at end of file +var _0x6385=['data2','lodash','./salesforce','./sugarcrm','./freshdesk','./desk','./vtiger','./servicenow','./dynamics365','zendesk','sugarcrm','desk','vtiger','dynamics365','freshsales','data1','toLowerCase','find','queue','outbound','EVENT\x20UNKNOWN','unmanaged','salesforce','zoho','servicenow','log','unknown\x20integration','../../../../config/logger','error','[EXEC]','%s\x20account\x20#%s\x20not\x20found'];(function(_0x1f5ed2,_0x5b3372){var _0xa36e0=function(_0x355491){while(--_0x355491){_0x1f5ed2['push'](_0x1f5ed2['shift']());}};_0xa36e0(++_0x5b3372);}(_0x6385,0xf9));var _0x5638=function(_0x356127,_0x4873ac){_0x356127=_0x356127-0x0;var _0x5d4c75=_0x6385[_0x356127];return _0x5d4c75;};'use strict';var _=require(_0x5638('0x0'));var util=require('util');var zendesk=require('./zendesk');var salesforce=require(_0x5638('0x1'));var sugarcrm=require(_0x5638('0x2'));var freshdesk=require(_0x5638('0x3'));var zoho=require('./zoho');var desk=require(_0x5638('0x4'));var vtiger=require(_0x5638('0x5'));var servicenow=require(_0x5638('0x6'));var dynamics365=require(_0x5638('0x7'));var freshsales=require('./freshsales');var integrations=[_0x5638('0x8'),'salesforce',_0x5638('0x9'),'freshdesk','zoho',_0x5638('0xa'),_0x5638('0xb'),_0x5638('0xc'),_0x5638('0xd'),'servicenow'];exports['exec']=function(_0x3e9736,_0x1e200f,_0xc6f54a,_0x9dad15,_0x5a22cc,_0x3304f9){if(_0xc6f54a){if(_['includes'](integrations,_0x3e9736[_0x5638('0xe')][_0x5638('0xf')]())){try{var _0x5bf3be=null;var _0x146b54='';var _0x4b16cc=_0xc6f54a[_0x3e9736['data1']['toLowerCase']()];if(_0x4b16cc){var _0xf5af0a=_0x4b16cc[_0x3e9736['data2']];if(_0xf5af0a){var _0x4d81d6=_[_0x5638('0x10')](_0xf5af0a['Configurations'],{'id':parseInt(_0x3e9736['data3'],0xa)});if(_0x4d81d6){if(_0x9dad15){if(_0x5a22cc&&_0x1e200f[_0x5638('0x11')]){_0x146b54='queue';}else if(_0x1e200f['routeId']){_0x146b54=_0x5638('0x12');}else{console['log'](_0x5638('0x13'),_0x1e200f);}}else{_0x146b54=_0x5638('0x14');}switch(_0x3e9736[_0x5638('0xe')][_0x5638('0xf')]()){case _0x5638('0x8'):zendesk[_0x146b54](_0x3e9736,_0x1e200f,_0x4d81d6,_0x9dad15,_0x5a22cc,_0xf5af0a,_0x3304f9);break;case _0x5638('0x15'):salesforce[_0x146b54](_0x3e9736,_0x1e200f,_0x4d81d6,_0x9dad15,_0x5a22cc,_0xf5af0a,_0x3304f9);break;case _0x5638('0x9'):sugarcrm[_0x146b54](_0x3e9736,_0x1e200f,_0x4d81d6,_0x9dad15,_0x5a22cc,_0xf5af0a,_0x3304f9);break;case'freshdesk':freshdesk[_0x146b54](_0x3e9736,_0x1e200f,_0x4d81d6,_0x9dad15,_0x5a22cc,_0xf5af0a,_0x3304f9);break;case _0x5638('0x16'):zoho[_0x146b54](_0x3e9736,_0x1e200f,_0x4d81d6,_0x9dad15,_0x5a22cc,_0xf5af0a,_0x3304f9);break;case'desk':desk[_0x146b54](_0x3e9736,_0x1e200f,_0x4d81d6,_0x9dad15,_0x5a22cc,_0xf5af0a,_0x3304f9);break;case _0x5638('0xb'):vtiger[_0x146b54](_0x3e9736,_0x1e200f,_0x4d81d6,_0x9dad15,_0x5a22cc,_0xf5af0a,_0x3304f9);break;case _0x5638('0xd'):freshsales['cs'](_0x3e9736,_0x1e200f,_0x4d81d6,_0x9dad15,_0x5a22cc,_0xf5af0a,_0x3304f9,_0x146b54);break;case _0x5638('0x17'):servicenow['cs'](_0x3e9736,_0x1e200f,_0x4d81d6,_0x9dad15,_0x5a22cc,_0xf5af0a,_0x3304f9,_0x146b54);break;case _0x5638('0xc'):dynamics365['cs'](_0x3e9736,_0x1e200f,_0x4d81d6,_0x9dad15,_0x5a22cc,_0xf5af0a,_0x3304f9,_0x146b54);break;default:console[_0x5638('0x18')](_0x5638('0x19'));}}else{_0x5bf3be=require(_0x5638('0x1a'))(_0x3e9736[_0x5638('0xe')]['toLowerCase']());_0x5bf3be[_0x5638('0x1b')](_0x5638('0x1c'),util['format']('%s\x20configuration\x20#%s\x20not\x20found',_0x3e9736[_0x5638('0xe')][_0x5638('0xf')](),_0x3e9736['data3']));}}else{_0x5bf3be=require(_0x5638('0x1a'))(_0x3e9736[_0x5638('0xe')][_0x5638('0xf')]());_0x5bf3be[_0x5638('0x1b')](_0x5638('0x1c'),util['format'](_0x5638('0x1d'),_0x3e9736[_0x5638('0xe')][_0x5638('0xf')](),_0x3e9736[_0x5638('0x1e')]));}}else{}}catch(_0x2f5a1b){console['error'](_0x2f5a1b);}}}}; \ 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 120d893..f1b2b88 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 _0x4014=['ticketType','Case','AccountId','lead','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','isNil','sobject','User','find','then','length','Email','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','display_name','user_id','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','cloneDeep','additionalSearchContact','merge','$or','Contact','execute','Lead','account_contact_lead','additionalSearchAccount','additionalSearchLead','Account','first','Phone','attributes','type','toLowerCase','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','Caller\x20-\x20%s','format','No\x20Company','upperFirst','create','forEach','includes','string','idField','toString','variable','variableName','customVariable','Variable','name','concat','securityToken','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','remoteUri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','newTab','trigger:browser:url','%s/%s/e','error','catch','outbound','recordingFormat','none','destcalleridname','destcalleridnum','Fields','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','instanceUrl','[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','toUpperCase','lastevent',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','bluebird','jsforce','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','localhost','emit','assign','getString','Subjects','Descriptions','utc','IsRecurrence','contact','WhoId','endUserType','account','WhatId'];(function(_0x33a44d,_0x21d762){var _0x2831b8=function(_0x34053c){while(--_0x34053c){_0x33a44d['push'](_0x33a44d['shift']());}};_0x2831b8(++_0x21d762);}(_0x4014,0x69));var _0x4401=function(_0x46d0c9,_0x526bfa){_0x46d0c9=_0x46d0c9-0x0;var _0x174506=_0x4014[_0x46d0c9];return _0x174506;};'use strict';var _=require(_0x4401('0x0'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4401('0x1'));var md5=require('md5');var jsforce=require(_0x4401('0x2'));var util=require('util');var Redis=require(_0x4401('0x3'));var intUtil=require(_0x4401('0x4'));var config=require(_0x4401('0x5'));var logger=require(_0x4401('0x6'))('salesforce');config[_0x4401('0x7')]=_['defaults'](config[_0x4401('0x7')],{'host':_0x4401('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4401('0x7')]));function emit(_0x114805,_0x345abb,_0x20405b){io['to'](_0x114805)[_0x4401('0x9')](_0x345abb,_0x20405b);}function getTicket(_0x40b9d7,_0x41b36f,_0x1113a6,_0x48d325,_0x457aa4,_0x3744b7,_0x57d9bd,_0x13e555){var _0x1d8f1a=Object[_0x4401('0xa')]({},{'OwnerId':_0x41b36f['id'],'Subject':intUtil[_0x4401('0xb')](_0x48d325[_0x4401('0xc')],_0x457aa4,'\x20'),'Description':intUtil[_0x4401('0xb')](_0x48d325[_0x4401('0xd')],_0x457aa4,'\x0a')},getCustomFields(_0x3744b7,_0x457aa4));if(_0x1113a6){if(_0x48d325['ticketType']==='Task'){_0x1d8f1a['ActivityDate']=moment[_0x4401('0xe')]();_0x1d8f1a['IsReminderSet']=![];_0x1d8f1a[_0x4401('0xf')]=![];if(_0x1113a6['endUserType']===_0x4401('0x10')||_0x1113a6['endUserType']==='lead'){_0x1d8f1a[_0x4401('0x11')]=_0x1113a6['id'];}else if(_0x1113a6[_0x4401('0x12')]===_0x4401('0x13')){_0x1d8f1a[_0x4401('0x14')]=_0x1113a6['id'];}}else if(_0x48d325[_0x4401('0x15')]===_0x4401('0x16')){if(_0x1113a6['endUserType']===_0x4401('0x10')){_0x1d8f1a['ContactId']=_0x1113a6['id'];}else if(_0x1113a6[_0x4401('0x12')]===_0x4401('0x13')){_0x1d8f1a[_0x4401('0x17')]=_0x1113a6['id'];}else if(_0x1113a6[_0x4401('0x12')]===_0x4401('0x18')&&_0x48d325[_0x4401('0x19')]){_0x1d8f1a[_0x48d325[_0x4401('0x19')]]=_0x1113a6['id'];}else{logger[_0x4401('0x1a')](_0x4401('0x1b'));}}}return _0x57d9bd['sobject'](_0x48d325['ticketType'])['create'](_0x1d8f1a);}function getUser(_0x4ebb3b,_0x218860,_0x19b216){if(!_[_0x4401('0x1c')](_0x218860)&&intUtil['validateEmail'](_0x218860)){var _0x2befdf={'Email':_0x218860};var _0x59616e={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x19b216[_0x4401('0x1d')](_0x4401('0x1e'))[_0x4401('0x1f')](_0x2befdf,_0x59616e)['execute']()[_0x4401('0x20')](function(_0x4c749f){if(_0x4c749f[_0x4401('0x21')]){var _0x2df006=_[_0x4401('0x1f')](_0x4c749f,function(_0x4c4f79){return _0x4c4f79[_0x4401('0x22')]===_0x218860;});if(_0x2df006){logger[_0x4401('0x1a')](_0x4401('0x23'),_0x218860);return BPromise[_0x4401('0x24')]({'id':_0x2df006['Id'],'name':_0x2df006[_0x4401('0x25')]});}}else{logger[_0x4401('0x1a')](_0x4401('0x26'),_0x218860);return _0x19b216[_0x4401('0x27')]()[_0x4401('0x20')](function(_0x2a848c){return BPromise[_0x4401('0x24')]({'id':_0x2a848c['user_id'],'name':_0x2a848c[_0x4401('0x28')]});});}});}else{logger[_0x4401('0x1a')](_0x4401('0x26'),_0x218860);return _0x19b216['identity']()[_0x4401('0x20')](function(_0x433b30){return BPromise[_0x4401('0x24')]({'id':_0x433b30[_0x4401('0x29')],'name':_0x433b30[_0x4401('0x28')]});});}}function getEndUser(_0x188f90,_0x350148,_0x54c894,_0x4a1010,_0x1a2ff4){var _0x157eea={'$or':{'Phone':_0x4a1010}};var _0x44d0f1={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x4401('0x24')]()[_0x4401('0x20')](function(){logger[_0x4401('0x1a')](_0x4401('0x2a'),_0x4a1010,_0x350148['moduleSearch']);switch(_0x350148[_0x4401('0x2b')]){case'contact_lead':var _0x13d9c0=_[_0x4401('0x2c')](_0x157eea);if(_0x350148[_0x4401('0x2d')]){var _0x543a7a={};_0x543a7a[_0x350148['additionalSearchContact']]=_0x4a1010;_[_0x4401('0x2e')](_0x13d9c0[_0x4401('0x2f')],_0x543a7a);}return _0x1a2ff4[_0x4401('0x1d')](_0x4401('0x30'))[_0x4401('0x1f')](_0x13d9c0,_0x44d0f1)[_0x4401('0x31')]()[_0x4401('0x20')](function(_0x1b244c){if(_0x1b244c&&_0x1b244c[_0x4401('0x21')]){return _0x1b244c;}else{var _0x378f7d=_['cloneDeep'](_0x157eea);if(_0x350148['additionalSearchLead']){var _0xe00470={};_0xe00470[_0x350148['additionalSearchLead']]=_0x4a1010;_[_0x4401('0x2e')](_0x378f7d[_0x4401('0x2f')],_0xe00470);}return _0x1a2ff4['sobject'](_0x4401('0x32'))[_0x4401('0x1f')](_0x378f7d,_0x44d0f1);}});case _0x4401('0x33'):var _0x425fbf=_[_0x4401('0x2c')](_0x157eea);if(_0x350148[_0x4401('0x34')]){var _0x543a7a={};_0x543a7a[_0x350148['additionalSearchAccount']]=_0x4a1010;_[_0x4401('0x2e')](_0x425fbf[_0x4401('0x2f')],_0x543a7a);}return _0x1a2ff4[_0x4401('0x1d')]('Account')['find'](_0x425fbf,_0x44d0f1)[_0x4401('0x31')]()[_0x4401('0x20')](function(_0x10e179){if(_0x10e179&&_0x10e179[_0x4401('0x21')]){return _0x10e179;}else{var _0x52535a=_[_0x4401('0x2c')](_0x157eea);if(_0x350148['additionalSearchContact']){var _0x11e1d6={};_0x11e1d6[_0x350148[_0x4401('0x2d')]]=_0x4a1010;_['merge'](_0x52535a[_0x4401('0x2f')],_0x11e1d6);}return _0x1a2ff4['sobject']('Contact')[_0x4401('0x1f')](_0x52535a,_0x44d0f1)[_0x4401('0x20')](function(_0x4135db){if(_0x4135db&&_0x4135db[_0x4401('0x21')]){return _0x4135db;}else{var _0x5cf25a=_[_0x4401('0x2c')](_0x157eea);if(_0x350148[_0x4401('0x35')]){var _0x1595f0={};_0x1595f0[_0x350148[_0x4401('0x35')]]=_0x4a1010;_[_0x4401('0x2e')](_0x5cf25a[_0x4401('0x2f')],_0x1595f0);}return _0x1a2ff4[_0x4401('0x1d')]('Lead')[_0x4401('0x1f')](_0x5cf25a,_0x44d0f1);}});}});case'contact':var _0x13d9c0=_[_0x4401('0x2c')](_0x157eea);if(_0x350148[_0x4401('0x2d')]){var _0x543a7a={};_0x543a7a[_0x350148[_0x4401('0x2d')]]=_0x4a1010;_['merge'](_0x13d9c0[_0x4401('0x2f')],_0x543a7a);}return _0x1a2ff4[_0x4401('0x1d')]('Contact')[_0x4401('0x1f')](_0x13d9c0,_0x44d0f1)[_0x4401('0x31')]();case _0x4401('0x18'):var _0xa8b36f=_[_0x4401('0x2c')](_0x157eea);if(_0x350148['additionalSearchLead']){var _0x543a7a={};_0x543a7a[_0x350148[_0x4401('0x35')]]=_0x4a1010;_[_0x4401('0x2e')](_0xa8b36f[_0x4401('0x2f')],_0x543a7a);}return _0x1a2ff4[_0x4401('0x1d')](_0x4401('0x32'))[_0x4401('0x1f')](_0xa8b36f,_0x44d0f1);case _0x4401('0x13'):var _0x425fbf=_[_0x4401('0x2c')](_0x157eea);if(_0x350148[_0x4401('0x34')]){var _0x543a7a={};_0x543a7a[_0x350148[_0x4401('0x34')]]=_0x4a1010;_[_0x4401('0x2e')](_0x425fbf[_0x4401('0x2f')],_0x543a7a);}return _0x1a2ff4['sobject'](_0x4401('0x36'))[_0x4401('0x1f')](_0x425fbf,_0x44d0f1);default:return null;}})[_0x4401('0x20')](function(_0xd444bc){if(_0xd444bc&&_0xd444bc[_0x4401('0x21')]){var _0x540b25=_[_0x4401('0x37')](_0xd444bc);if(_0x540b25){return BPromise['resolve']({'id':_0x540b25['Id'],'name':_0x540b25[_0x4401('0x25')],'phone':_0x540b25[_0x4401('0x38')],'endUserType':_0x540b25[_0x4401('0x39')][_0x4401('0x3a')][_0x4401('0x3b')]()});}}})['then'](function(_0x198882){if(_0x198882){logger['info']('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x198882['endUserType'],_0x4a1010);return BPromise[_0x4401('0x24')](_0x198882);}else{logger[_0x4401('0x1a')]('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x4a1010);var _0x1a9fd9={'Phone':_0x4a1010};if(_0x350148[_0x4401('0x3c')]){if(_0x350148[_0x4401('0x3c')]===_0x4401('0x10')){logger[_0x4401('0x1a')](_0x4401('0x3d'),_0x4a1010,_0x350148[_0x4401('0x3c')]);_0x1a9fd9[_0x4401('0x3e')]=_0x54c894!==_0x4401('0x3f')?_0x54c894:util['format'](_0x4401('0x40'),_0x4a1010);}else if(_0x350148[_0x4401('0x3c')]===_0x4401('0x18')){logger['info'](_0x4401('0x3d'),_0x4a1010,_0x350148[_0x4401('0x3c')]);_0x1a9fd9[_0x4401('0x3e')]=_0x54c894!==''?_0x54c894:util[_0x4401('0x41')](_0x4401('0x40'),_0x4a1010);_0x1a9fd9['Company']=_0x4401('0x42');}else if(_0x350148[_0x4401('0x3c')]===_0x4401('0x13')){logger[_0x4401('0x1a')](_0x4401('0x3d'),_0x4a1010,_0x350148[_0x4401('0x3c')]);_0x1a9fd9[_0x4401('0x25')]=_0x54c894!==''?_0x54c894:util[_0x4401('0x41')]('Caller\x20-\x20%s',_0x4a1010);}else{return null;}}return _0x1a2ff4[_0x4401('0x1d')](_[_0x4401('0x43')](_0x350148[_0x4401('0x3c')]))[_0x4401('0x44')](_0x1a9fd9)[_0x4401('0x20')](function(_0x47a3b8){return BPromise[_0x4401('0x24')]({'id':_0x47a3b8['id'],'endUserType':_0x350148[_0x4401('0x3c')]});});}});}function getCustomFields(_0x13aaa5,_0x3d2536){var _0x356c75={};if(_0x13aaa5[_0x4401('0x21')]>0x0){_[_0x4401('0x45')](_0x13aaa5,function(_0x5b754a){if(_[_0x4401('0x46')]([_0x4401('0x47'),'picklist'],_0x5b754a[_0x4401('0x3a')])&&_0x5b754a[_0x4401('0x48')]){_0x356c75[_0x5b754a[_0x4401('0x48')]]=_0x5b754a['content'][_0x4401('0x49')]();}else if(_0x5b754a['type']===_0x4401('0x4a')&&_0x5b754a[_0x4401('0x4b')]&&_0x5b754a[_0x4401('0x48')]){_0x3d2536[_0x5b754a[_0x4401('0x4b')]]&&(_0x356c75[_0x5b754a['idField']]=_0x3d2536[_0x5b754a[_0x4401('0x4b')]][_0x4401('0x49')]());}else if(_0x5b754a[_0x4401('0x3a')]===_0x4401('0x4c')&&_0x5b754a[_0x4401('0x4d')]&&_0x5b754a[_0x4401('0x4d')][_0x4401('0x4e')]&&_0x5b754a[_0x4401('0x48')]){_0x3d2536[_0x5b754a['Variable'][_0x4401('0x4e')][_0x4401('0x3b')]()]&&(_0x356c75[_0x5b754a[_0x4401('0x48')]]=_0x3d2536[_0x5b754a[_0x4401('0x4d')][_0x4401('0x4e')][_0x4401('0x3b')]()][_0x4401('0x49')]());}});}return _0x356c75;}function getConnection(_0x11b1cf){var _0x23370b=_0x11b1cf['password'][_0x4401('0x4f')](_0x11b1cf[_0x4401('0x50')]);var _0x552e81=new jsforce['Connection']({'oauth2':{'loginUrl':_0x11b1cf['remoteUri']||_0x4401('0x51'),'clientId':_0x11b1cf[_0x4401('0x52')],'clientSecret':_0x11b1cf[_0x4401('0x53')]}});return _0x552e81[_0x4401('0x54')](_0x11b1cf[_0x4401('0x55')],_0x23370b)['then'](function(){logger[_0x4401('0x1a')](_0x4401('0x56'));return _0x552e81;});}exports[_0x4401('0x57')]=function(_0x5eef40,_0x4276e6,_0xfba72f,_0x55455c,_0x40947e,_0x36c0f0){var _0x30c3c2,_0x11a7bf,_0x423489,_0x374523;_0x36c0f0[_0x4401('0x58')]=intUtil[_0x4401('0x59')](_0x36c0f0[_0x4401('0x58')]);_0x36c0f0[_0x4401('0x5a')]=intUtil['stripTrailingSlash'](_0x36c0f0['remoteUri']);if(_0x40947e&&_0x40947e[_0x4401('0x5b')]){logger[_0x4401('0x1a')](_0x4401('0x5c'),_0x4401('0x5d'));_0x4276e6[_0x4401('0x5e')]=util[_0x4401('0x41')](_0x4401('0x5f'),_0x36c0f0[_0x4401('0x58')],_0x4276e6[_0x4401('0x60')],md5(_0x4276e6[_0x4401('0x60')]));}else{_0x4276e6[_0x4401('0x5e')]='';}return getConnection(_0x36c0f0)[_0x4401('0x20')](function(_0x579c8a){_0x374523=_0x579c8a;return getUser(_0x36c0f0,_0x55455c[_0x4401('0x61')],_0x374523);})[_0x4401('0x20')](function(_0x3eddcc){_0x30c3c2=_0x3eddcc;return getEndUser(_0x36c0f0,_0xfba72f,_0x4276e6[_0x4401('0x62')],_0x4276e6[_0x4401('0x63')],_0x374523);})[_0x4401('0x20')](function(_0x3efdfd){_0x11a7bf=_0x3efdfd;return getTicket(_0x36c0f0,_0x30c3c2,_0x11a7bf,_0xfba72f,_0x4276e6,_0xfba72f['Fields'],_0x374523,_0x4401('0x57'));})['then'](function(_0x5b2955){_0x423489=_0x5b2955;logger[_0x4401('0x1a')](_0x4401('0x64'),_0x423489['id']);logger[_0x4401('0x1a')](_0x4401('0x65'),_0x423489['id'],_0x55455c['name'],_0x36c0f0['type']);switch(_0x36c0f0[_0x4401('0x3a')]){case _0x4401('0x66'):emit(util[_0x4401('0x41')](_0x4401('0x67'),_0x55455c[_0x4401('0x4e')]),'trigger:salesforce:display',{'recordId':_0x423489['id']});break;case _0x4401('0x68'):emit(util['format'](_0x4401('0x67'),_0x55455c[_0x4401('0x4e')]),_0x4401('0x69'),{'uri':util[_0x4401('0x41')](_0x4401('0x6a'),_0x374523['instanceUrl'],_0x423489['id'])});break;default:logger[_0x4401('0x6b')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x4401('0x6c')](function(_0x209196){logger[_0x4401('0x6b')](_0x4401('0x5c'),_0x209196);});};exports[_0x4401('0x6d')]=function(_0x475f0e,_0x40c64b,_0x5ecc7b,_0x146c11,_0x5e7ce5,_0x5e8434,_0x59255b){var _0x39ff8d,_0x3d852e,_0x4da3b2,_0x1f2036;_0x5e8434[_0x4401('0x58')]=intUtil[_0x4401('0x59')](_0x5e8434[_0x4401('0x58')]);_0x5e8434[_0x4401('0x5a')]=intUtil['stripTrailingSlash'](_0x5e8434[_0x4401('0x5a')]);if(_0x59255b&&_0x59255b[_0x4401('0x6e')]&&_0x59255b[_0x4401('0x6e')]!==_0x4401('0x6f')){logger[_0x4401('0x1a')]('[OUTBOUND]',_0x4401('0x5d'));_0x40c64b[_0x4401('0x5e')]=util[_0x4401('0x41')](_0x4401('0x5f'),_0x5e8434['serverUrl'],_0x40c64b[_0x4401('0x60')],md5(_0x40c64b['uniqueid']));}return getConnection(_0x5e8434)[_0x4401('0x20')](function(_0x3123e9){_0x1f2036=_0x3123e9;return getUser(_0x5e8434,_0x146c11[_0x4401('0x61')],_0x1f2036);})[_0x4401('0x20')](function(_0x36242b){_0x39ff8d=_0x36242b;return getEndUser(_0x5e8434,_0x5ecc7b,_0x40c64b[_0x4401('0x70')],_0x40c64b[_0x4401('0x71')],_0x1f2036);})['then'](function(_0x318370){_0x3d852e=_0x318370;return getTicket(_0x5e8434,_0x39ff8d,_0x3d852e,_0x5ecc7b,_0x40c64b,_0x5ecc7b[_0x4401('0x72')],_0x1f2036,_0x4401('0x6d'));})['then'](function(_0x4c41f8){_0x4da3b2=_0x4c41f8;logger[_0x4401('0x1a')](_0x4401('0x73'),_0x4da3b2['id']);logger[_0x4401('0x1a')](_0x4401('0x74'),_0x4da3b2['id'],_0x146c11[_0x4401('0x4e')],_0x5e8434[_0x4401('0x3a')]);switch(_0x5e8434[_0x4401('0x3a')]){case _0x4401('0x66'):emit(util['format'](_0x4401('0x67'),_0x146c11[_0x4401('0x4e')]),_0x4401('0x75'),{'recordId':_0x4da3b2['id']});break;case _0x4401('0x68'):emit(util[_0x4401('0x41')](_0x4401('0x67'),_0x146c11[_0x4401('0x4e')]),_0x4401('0x69'),{'uri':util[_0x4401('0x41')](_0x4401('0x6a'),_0x1f2036[_0x4401('0x76')],_0x4da3b2['id'])});break;default:logger['error'](_0x4401('0x77'),_0x4401('0x78'));}})[_0x4401('0x6c')](function(_0x35ccba){logger[_0x4401('0x6b')](_0x4401('0x77'),_0x35ccba);});};exports[_0x4401('0x79')]=function(_0x2ef299,_0x6d20d7,_0x3b34cd,_0x3da43a,_0x36e51d,_0x5828b7){var _0x50c5c4,_0x70ee62,_0x526d2a,_0x59defa;_0x5828b7['serverUrl']=intUtil['stripTrailingSlash'](_0x5828b7[_0x4401('0x58')]);_0x5828b7[_0x4401('0x5a')]=intUtil[_0x4401('0x59')](_0x5828b7[_0x4401('0x5a')]);if(_0x36e51d&&_0x36e51d[_0x4401('0x5b')]){logger[_0x4401('0x1a')]('['+_0x6d20d7['lastevent'][_0x4401('0x7a')]()+']',_0x4401('0x5d'));_0x6d20d7['recordingURL']=util['format'](_0x4401('0x5f'),_0x5828b7[_0x4401('0x58')],_0x6d20d7[_0x4401('0x60')],md5(_0x6d20d7['uniqueid']));}else{_0x6d20d7['recordingURL']='';}return getConnection(_0x5828b7)[_0x4401('0x20')](function(_0x48a112){_0x59defa=_0x48a112;if(!_[_0x4401('0x1c')](_0x3da43a)){return getUser(_0x5828b7,_0x3da43a[_0x4401('0x4e')],_0x59defa);}else{return getUser(_0x5828b7,null,_0x59defa);}})[_0x4401('0x20')](function(_0x40b1f2){_0x50c5c4=_0x40b1f2;return getEndUser(_0x5828b7,_0x3b34cd,_0x6d20d7[_0x4401('0x62')],_0x6d20d7['calleridnum'],_0x59defa);})[_0x4401('0x20')](function(_0x204d87){_0x70ee62=_0x204d87;return getTicket(_0x5828b7,_0x50c5c4,_0x70ee62,_0x3b34cd,_0x6d20d7,_0x3b34cd[_0x4401('0x72')],_0x59defa);})[_0x4401('0x20')](function(_0x2ba526){_0x526d2a=_0x2ba526;logger['info']('['+_0x6d20d7[_0x4401('0x7b')]['toUpperCase']()+_0x4401('0x7c'),_0x526d2a['id']);logger['info']('['+_0x6d20d7[_0x4401('0x7b')][_0x4401('0x7a')]()+_0x4401('0x7d'),_0x5828b7[_0x4401('0x3a')]);})[_0x4401('0x6c')](function(_0x455119){logger['error']('['+_0x6d20d7[_0x4401('0x7b')][_0x4401('0x7a')]()+']',_0x455119);});}; \ No newline at end of file +var _0xc8e3=['user:%s','trigger:salesforce:display','trigger:browser:url','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','none','destcalleridname','destcalleridnum','Fields','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','newTab','[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase','calleridnum',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','request-promise','moment','bluebird','md5','jsforce','./util','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','emit','getString','Task','ActivityDate','IsReminderSet','IsRecurrence','endUserType','contact','WhoId','account','WhatId','ticketType','Case','ContactId','AccountId','lead','leadId','info','sobject','create','isNil','validateEmail','User','execute','then','length','find','Email','resolve','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','additionalSearchLead','Lead','additionalSearchAccount','Account','Contact','first','Name','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','moduleCreate','','format','LastName','Caller\x20-\x20%s','Company','No\x20Company','upperFirst','forEach','includes','string','picklist','idField','content','toString','variableName','customVariable','Variable','name','password','concat','securityToken','Connection','https://login.salesforce.com','clientSecret','login','username','serverUrl','stripTrailingSlash','remoteUri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','queue','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab'];(function(_0x6ff55a,_0x372355){var _0x205083=function(_0xce1de9){while(--_0xce1de9){_0x6ff55a['push'](_0x6ff55a['shift']());}};_0x205083(++_0x372355);}(_0xc8e3,0x119));var _0x3c8e=function(_0x53e97d,_0x554a9c){_0x53e97d=_0x53e97d-0x0;var _0x5c77f0=_0xc8e3[_0x53e97d];return _0x5c77f0;};'use strict';var _=require('lodash');var rp=require(_0x3c8e('0x0'));var moment=require(_0x3c8e('0x1'));var BPromise=require(_0x3c8e('0x2'));var md5=require(_0x3c8e('0x3'));var jsforce=require(_0x3c8e('0x4'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x3c8e('0x5'));var config=require('../../../../config/environment');var logger=require(_0x3c8e('0x6'))(_0x3c8e('0x7'));config[_0x3c8e('0x8')]=_[_0x3c8e('0x9')](config[_0x3c8e('0x8')],{'host':_0x3c8e('0xa'),'port':0x18eb});var io=require(_0x3c8e('0xb'))(new Redis(config[_0x3c8e('0x8')]));function emit(_0x193a43,_0x40a3a5,_0x4eeba3){io['to'](_0x193a43)[_0x3c8e('0xc')](_0x40a3a5,_0x4eeba3);}function getTicket(_0x5e33a3,_0x4a333b,_0x5861b6,_0x449500,_0x1caed5,_0x5324e8,_0xbea958,_0x7660be){var _0x146afd=Object['assign']({},{'OwnerId':_0x4a333b['id'],'Subject':intUtil[_0x3c8e('0xd')](_0x449500['Subjects'],_0x1caed5,'\x20'),'Description':intUtil[_0x3c8e('0xd')](_0x449500['Descriptions'],_0x1caed5,'\x0a')},getCustomFields(_0x5324e8,_0x1caed5));if(_0x5861b6){if(_0x449500['ticketType']===_0x3c8e('0xe')){_0x146afd[_0x3c8e('0xf')]=moment['utc']();_0x146afd[_0x3c8e('0x10')]=![];_0x146afd[_0x3c8e('0x11')]=![];if(_0x5861b6[_0x3c8e('0x12')]===_0x3c8e('0x13')||_0x5861b6[_0x3c8e('0x12')]==='lead'){_0x146afd[_0x3c8e('0x14')]=_0x5861b6['id'];}else if(_0x5861b6[_0x3c8e('0x12')]===_0x3c8e('0x15')){_0x146afd[_0x3c8e('0x16')]=_0x5861b6['id'];}}else if(_0x449500[_0x3c8e('0x17')]===_0x3c8e('0x18')){if(_0x5861b6[_0x3c8e('0x12')]==='contact'){_0x146afd[_0x3c8e('0x19')]=_0x5861b6['id'];}else if(_0x5861b6[_0x3c8e('0x12')]===_0x3c8e('0x15')){_0x146afd[_0x3c8e('0x1a')]=_0x5861b6['id'];}else if(_0x5861b6[_0x3c8e('0x12')]===_0x3c8e('0x1b')&&_0x449500['leadId']){_0x146afd[_0x449500[_0x3c8e('0x1c')]]=_0x5861b6['id'];}else{logger[_0x3c8e('0x1d')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0xbea958[_0x3c8e('0x1e')](_0x449500[_0x3c8e('0x17')])[_0x3c8e('0x1f')](_0x146afd);}function getUser(_0x30a828,_0x2d824f,_0x49c510){if(!_[_0x3c8e('0x20')](_0x2d824f)&&intUtil[_0x3c8e('0x21')](_0x2d824f)){var _0x287b36={'Email':_0x2d824f};var _0x1105b7={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x49c510[_0x3c8e('0x1e')](_0x3c8e('0x22'))['find'](_0x287b36,_0x1105b7)[_0x3c8e('0x23')]()[_0x3c8e('0x24')](function(_0x22702a){if(_0x22702a[_0x3c8e('0x25')]){var _0x2da3c0=_[_0x3c8e('0x26')](_0x22702a,function(_0x29333d){return _0x29333d[_0x3c8e('0x27')]===_0x2d824f;});if(_0x2da3c0){logger[_0x3c8e('0x1d')]('Agent\x20%s\x20found.',_0x2d824f);return BPromise[_0x3c8e('0x28')]({'id':_0x2da3c0['Id'],'name':_0x2da3c0['Name']});}}else{logger[_0x3c8e('0x1d')](_0x3c8e('0x29'),_0x2d824f);return _0x49c510[_0x3c8e('0x2a')]()[_0x3c8e('0x24')](function(_0xfae6af){return BPromise[_0x3c8e('0x28')]({'id':_0xfae6af[_0x3c8e('0x2b')],'name':_0xfae6af[_0x3c8e('0x2c')]});});}});}else{logger[_0x3c8e('0x1d')](_0x3c8e('0x29'),_0x2d824f);return _0x49c510['identity']()[_0x3c8e('0x24')](function(_0x4fcade){return BPromise[_0x3c8e('0x28')]({'id':_0x4fcade['user_id'],'name':_0x4fcade[_0x3c8e('0x2c')]});});}}function getEndUser(_0x322ff2,_0x4b025d,_0x1c321f,_0x197739,_0x242074){var _0x270e53={'$or':{'Phone':_0x197739}};var _0x56f80c={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x3c8e('0x28')]()[_0x3c8e('0x24')](function(){logger[_0x3c8e('0x1d')](_0x3c8e('0x2d'),_0x197739,_0x4b025d[_0x3c8e('0x2e')]);switch(_0x4b025d[_0x3c8e('0x2e')]){case _0x3c8e('0x2f'):var _0x49e241=_[_0x3c8e('0x30')](_0x270e53);if(_0x4b025d['additionalSearchContact']){var _0x332122={};_0x332122[_0x4b025d[_0x3c8e('0x31')]]=_0x197739;_[_0x3c8e('0x32')](_0x49e241[_0x3c8e('0x33')],_0x332122);}return _0x242074[_0x3c8e('0x1e')]('Contact')[_0x3c8e('0x26')](_0x49e241,_0x56f80c)['execute']()['then'](function(_0xf2852b){if(_0xf2852b&&_0xf2852b[_0x3c8e('0x25')]){return _0xf2852b;}else{var _0x1a194e=_[_0x3c8e('0x30')](_0x270e53);if(_0x4b025d['additionalSearchLead']){var _0x44eca2={};_0x44eca2[_0x4b025d[_0x3c8e('0x34')]]=_0x197739;_[_0x3c8e('0x32')](_0x1a194e['$or'],_0x44eca2);}return _0x242074[_0x3c8e('0x1e')](_0x3c8e('0x35'))[_0x3c8e('0x26')](_0x1a194e,_0x56f80c);}});case'account_contact_lead':var _0x4dfcfe=_[_0x3c8e('0x30')](_0x270e53);if(_0x4b025d[_0x3c8e('0x36')]){var _0x332122={};_0x332122[_0x4b025d['additionalSearchAccount']]=_0x197739;_[_0x3c8e('0x32')](_0x4dfcfe[_0x3c8e('0x33')],_0x332122);}return _0x242074[_0x3c8e('0x1e')](_0x3c8e('0x37'))[_0x3c8e('0x26')](_0x4dfcfe,_0x56f80c)[_0x3c8e('0x23')]()[_0x3c8e('0x24')](function(_0x137aef){if(_0x137aef&&_0x137aef['length']){return _0x137aef;}else{var _0x5372e9=_[_0x3c8e('0x30')](_0x270e53);if(_0x4b025d['additionalSearchContact']){var _0x14d024={};_0x14d024[_0x4b025d['additionalSearchContact']]=_0x197739;_['merge'](_0x5372e9[_0x3c8e('0x33')],_0x14d024);}return _0x242074[_0x3c8e('0x1e')](_0x3c8e('0x38'))[_0x3c8e('0x26')](_0x5372e9,_0x56f80c)[_0x3c8e('0x24')](function(_0x57a0ff){if(_0x57a0ff&&_0x57a0ff['length']){return _0x57a0ff;}else{var _0x4948da=_['cloneDeep'](_0x270e53);if(_0x4b025d['additionalSearchLead']){var _0x145e33={};_0x145e33[_0x4b025d[_0x3c8e('0x34')]]=_0x197739;_[_0x3c8e('0x32')](_0x4948da[_0x3c8e('0x33')],_0x145e33);}return _0x242074[_0x3c8e('0x1e')](_0x3c8e('0x35'))['find'](_0x4948da,_0x56f80c);}});}});case _0x3c8e('0x13'):var _0x49e241=_[_0x3c8e('0x30')](_0x270e53);if(_0x4b025d[_0x3c8e('0x31')]){var _0x332122={};_0x332122[_0x4b025d[_0x3c8e('0x31')]]=_0x197739;_['merge'](_0x49e241[_0x3c8e('0x33')],_0x332122);}return _0x242074[_0x3c8e('0x1e')](_0x3c8e('0x38'))[_0x3c8e('0x26')](_0x49e241,_0x56f80c)['execute']();case'lead':var _0x9bbae5=_['cloneDeep'](_0x270e53);if(_0x4b025d['additionalSearchLead']){var _0x332122={};_0x332122[_0x4b025d['additionalSearchLead']]=_0x197739;_[_0x3c8e('0x32')](_0x9bbae5[_0x3c8e('0x33')],_0x332122);}return _0x242074[_0x3c8e('0x1e')](_0x3c8e('0x35'))['find'](_0x9bbae5,_0x56f80c);case _0x3c8e('0x15'):var _0x4dfcfe=_[_0x3c8e('0x30')](_0x270e53);if(_0x4b025d['additionalSearchAccount']){var _0x332122={};_0x332122[_0x4b025d['additionalSearchAccount']]=_0x197739;_[_0x3c8e('0x32')](_0x4dfcfe['$or'],_0x332122);}return _0x242074[_0x3c8e('0x1e')](_0x3c8e('0x37'))[_0x3c8e('0x26')](_0x4dfcfe,_0x56f80c);default:return null;}})[_0x3c8e('0x24')](function(_0x7e5026){if(_0x7e5026&&_0x7e5026[_0x3c8e('0x25')]){var _0x18b332=_[_0x3c8e('0x39')](_0x7e5026);if(_0x18b332){return BPromise['resolve']({'id':_0x18b332['Id'],'name':_0x18b332[_0x3c8e('0x3a')],'phone':_0x18b332['Phone'],'endUserType':_0x18b332['attributes'][_0x3c8e('0x3b')][_0x3c8e('0x3c')]()});}}})[_0x3c8e('0x24')](function(_0x1a1eeb){if(_0x1a1eeb){logger[_0x3c8e('0x1d')](_0x3c8e('0x3d'),_0x1a1eeb[_0x3c8e('0x12')],_0x197739);return BPromise[_0x3c8e('0x28')](_0x1a1eeb);}else{logger[_0x3c8e('0x1d')](_0x3c8e('0x3e'),_0x197739);var _0x59a21d={'Phone':_0x197739};if(_0x4b025d['moduleCreate']){if(_0x4b025d['moduleCreate']===_0x3c8e('0x13')){logger[_0x3c8e('0x1d')](_0x3c8e('0x3f'),_0x197739,_0x4b025d[_0x3c8e('0x40')]);_0x59a21d['LastName']=_0x1c321f!==_0x3c8e('0x41')?_0x1c321f:util[_0x3c8e('0x42')]('Caller\x20-\x20%s',_0x197739);}else if(_0x4b025d[_0x3c8e('0x40')]===_0x3c8e('0x1b')){logger[_0x3c8e('0x1d')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x197739,_0x4b025d[_0x3c8e('0x40')]);_0x59a21d[_0x3c8e('0x43')]=_0x1c321f!==_0x3c8e('0x41')?_0x1c321f:util[_0x3c8e('0x42')](_0x3c8e('0x44'),_0x197739);_0x59a21d[_0x3c8e('0x45')]=_0x3c8e('0x46');}else if(_0x4b025d[_0x3c8e('0x40')]==='account'){logger[_0x3c8e('0x1d')](_0x3c8e('0x3f'),_0x197739,_0x4b025d[_0x3c8e('0x40')]);_0x59a21d[_0x3c8e('0x3a')]=_0x1c321f!==''?_0x1c321f:util[_0x3c8e('0x42')]('Caller\x20-\x20%s',_0x197739);}else{return null;}}return _0x242074[_0x3c8e('0x1e')](_[_0x3c8e('0x47')](_0x4b025d[_0x3c8e('0x40')]))[_0x3c8e('0x1f')](_0x59a21d)[_0x3c8e('0x24')](function(_0x4c110e){return BPromise[_0x3c8e('0x28')]({'id':_0x4c110e['id'],'endUserType':_0x4b025d[_0x3c8e('0x40')]});});}});}function getCustomFields(_0xfda8f1,_0x4d88b3){var _0x1e111d={};if(_0xfda8f1[_0x3c8e('0x25')]>0x0){_[_0x3c8e('0x48')](_0xfda8f1,function(_0x42f282){if(_[_0x3c8e('0x49')]([_0x3c8e('0x4a'),_0x3c8e('0x4b')],_0x42f282['type'])&&_0x42f282[_0x3c8e('0x4c')]){_0x1e111d[_0x42f282[_0x3c8e('0x4c')]]=_0x42f282[_0x3c8e('0x4d')][_0x3c8e('0x4e')]();}else if(_0x42f282['type']==='variable'&&_0x42f282[_0x3c8e('0x4f')]&&_0x42f282['idField']){_0x4d88b3[_0x42f282['variableName']]&&(_0x1e111d[_0x42f282['idField']]=_0x4d88b3[_0x42f282[_0x3c8e('0x4f')]][_0x3c8e('0x4e')]());}else if(_0x42f282[_0x3c8e('0x3b')]===_0x3c8e('0x50')&&_0x42f282[_0x3c8e('0x51')]&&_0x42f282[_0x3c8e('0x51')]['name']&&_0x42f282[_0x3c8e('0x4c')]){_0x4d88b3[_0x42f282[_0x3c8e('0x51')][_0x3c8e('0x52')][_0x3c8e('0x3c')]()]&&(_0x1e111d[_0x42f282[_0x3c8e('0x4c')]]=_0x4d88b3[_0x42f282[_0x3c8e('0x51')]['name'][_0x3c8e('0x3c')]()][_0x3c8e('0x4e')]());}});}return _0x1e111d;}function getConnection(_0x5b4ffb){var _0x163471=_0x5b4ffb[_0x3c8e('0x53')][_0x3c8e('0x54')](_0x5b4ffb[_0x3c8e('0x55')]);var _0xdd6bc5=new jsforce[(_0x3c8e('0x56'))]({'oauth2':{'loginUrl':_0x5b4ffb['remoteUri']||_0x3c8e('0x57'),'clientId':_0x5b4ffb['clientId'],'clientSecret':_0x5b4ffb[_0x3c8e('0x58')]}});return _0xdd6bc5[_0x3c8e('0x59')](_0x5b4ffb[_0x3c8e('0x5a')],_0x163471)[_0x3c8e('0x24')](function(){logger[_0x3c8e('0x1d')]('Connection\x20established.');return _0xdd6bc5;});}exports['queue']=function(_0x57d6b1,_0x18314a,_0x4cafbc,_0x52461c,_0x278364,_0x120073){var _0x210d25,_0x2038ac,_0x507eb2,_0x57370e;_0x120073[_0x3c8e('0x5b')]=intUtil[_0x3c8e('0x5c')](_0x120073['serverUrl']);_0x120073[_0x3c8e('0x5d')]=intUtil[_0x3c8e('0x5c')](_0x120073[_0x3c8e('0x5d')]);if(_0x278364&&_0x278364[_0x3c8e('0x5e')]){logger[_0x3c8e('0x1d')](_0x3c8e('0x5f'),_0x3c8e('0x60'));_0x18314a[_0x3c8e('0x61')]=util[_0x3c8e('0x42')](_0x3c8e('0x62'),_0x120073[_0x3c8e('0x5b')],_0x18314a['uniqueid'],md5(_0x18314a[_0x3c8e('0x63')]));}else{_0x18314a[_0x3c8e('0x61')]='';}return getConnection(_0x120073)[_0x3c8e('0x24')](function(_0x4f5a8e){_0x57370e=_0x4f5a8e;return getUser(_0x120073,_0x52461c[_0x3c8e('0x64')],_0x57370e);})[_0x3c8e('0x24')](function(_0x2932fe){_0x210d25=_0x2932fe;return getEndUser(_0x120073,_0x4cafbc,_0x18314a[_0x3c8e('0x65')],_0x18314a['calleridnum'],_0x57370e);})[_0x3c8e('0x24')](function(_0xe995e2){_0x2038ac=_0xe995e2;return getTicket(_0x120073,_0x210d25,_0x2038ac,_0x4cafbc,_0x18314a,_0x4cafbc['Fields'],_0x57370e,_0x3c8e('0x66'));})[_0x3c8e('0x24')](function(_0x1542c6){_0x507eb2=_0x1542c6;logger[_0x3c8e('0x1d')](_0x3c8e('0x67'),_0x507eb2['id']);logger[_0x3c8e('0x1d')](_0x3c8e('0x68'),_0x507eb2['id'],_0x52461c[_0x3c8e('0x52')],_0x120073[_0x3c8e('0x3b')]);switch(_0x120073[_0x3c8e('0x3b')]){case _0x3c8e('0x69'):emit(util['format'](_0x3c8e('0x6a'),_0x52461c[_0x3c8e('0x52')]),_0x3c8e('0x6b'),{'recordId':_0x507eb2['id']});break;case'newTab':emit(util[_0x3c8e('0x42')](_0x3c8e('0x6a'),_0x52461c[_0x3c8e('0x52')]),_0x3c8e('0x6c'),{'uri':util[_0x3c8e('0x42')]('%s/%s/e',_0x57370e[_0x3c8e('0x6d')],_0x507eb2['id'])});break;default:logger[_0x3c8e('0x6e')](_0x3c8e('0x6f'));}})[_0x3c8e('0x70')](function(_0x12f575){logger[_0x3c8e('0x6e')](_0x3c8e('0x5f'),_0x12f575);});};exports[_0x3c8e('0x71')]=function(_0x3a1ae,_0x3275be,_0x4dd64b,_0x2be099,_0x14b117,_0xfa5e38,_0xe1d56){var _0x461d76,_0x13f98c,_0x42d1be,_0x2e2737;_0xfa5e38[_0x3c8e('0x5b')]=intUtil[_0x3c8e('0x5c')](_0xfa5e38[_0x3c8e('0x5b')]);_0xfa5e38['remoteUri']=intUtil[_0x3c8e('0x5c')](_0xfa5e38[_0x3c8e('0x5d')]);if(_0xe1d56&&_0xe1d56['recordingFormat']&&_0xe1d56['recordingFormat']!==_0x3c8e('0x72')){logger[_0x3c8e('0x1d')]('[OUTBOUND]',_0x3c8e('0x60'));_0x3275be[_0x3c8e('0x61')]=util['format'](_0x3c8e('0x62'),_0xfa5e38[_0x3c8e('0x5b')],_0x3275be[_0x3c8e('0x63')],md5(_0x3275be[_0x3c8e('0x63')]));}return getConnection(_0xfa5e38)[_0x3c8e('0x24')](function(_0x47b3cc){_0x2e2737=_0x47b3cc;return getUser(_0xfa5e38,_0x2be099[_0x3c8e('0x64')],_0x2e2737);})[_0x3c8e('0x24')](function(_0x27528d){_0x461d76=_0x27528d;return getEndUser(_0xfa5e38,_0x4dd64b,_0x3275be[_0x3c8e('0x73')],_0x3275be[_0x3c8e('0x74')],_0x2e2737);})[_0x3c8e('0x24')](function(_0x4d4bf4){_0x13f98c=_0x4d4bf4;return getTicket(_0xfa5e38,_0x461d76,_0x13f98c,_0x4dd64b,_0x3275be,_0x4dd64b[_0x3c8e('0x75')],_0x2e2737,_0x3c8e('0x71'));})['then'](function(_0x53d1a3){_0x42d1be=_0x53d1a3;logger[_0x3c8e('0x1d')](_0x3c8e('0x76'),_0x42d1be['id']);logger[_0x3c8e('0x1d')](_0x3c8e('0x77'),_0x42d1be['id'],_0x2be099[_0x3c8e('0x52')],_0xfa5e38[_0x3c8e('0x3b')]);switch(_0xfa5e38['type']){case _0x3c8e('0x69'):emit(util['format'](_0x3c8e('0x6a'),_0x2be099[_0x3c8e('0x52')]),_0x3c8e('0x6b'),{'recordId':_0x42d1be['id']});break;case _0x3c8e('0x78'):emit(util['format']('user:%s',_0x2be099[_0x3c8e('0x52')]),_0x3c8e('0x6c'),{'uri':util['format']('%s/%s/e',_0x2e2737[_0x3c8e('0x6d')],_0x42d1be['id'])});break;default:logger['error'](_0x3c8e('0x79'),_0x3c8e('0x7a'));}})[_0x3c8e('0x70')](function(_0x38a545){logger['error'](_0x3c8e('0x79'),_0x38a545);});};exports[_0x3c8e('0x7b')]=function(_0x5deafb,_0x3547af,_0xfe2db6,_0x1c3136,_0x4d64fa,_0x1bbe66){var _0x11ad4a,_0x32a63d,_0x4383c3,_0x5966c3;_0x1bbe66['serverUrl']=intUtil[_0x3c8e('0x5c')](_0x1bbe66[_0x3c8e('0x5b')]);_0x1bbe66[_0x3c8e('0x5d')]=intUtil[_0x3c8e('0x5c')](_0x1bbe66[_0x3c8e('0x5d')]);if(_0x4d64fa&&_0x4d64fa[_0x3c8e('0x5e')]){logger[_0x3c8e('0x1d')]('['+_0x3547af[_0x3c8e('0x7c')][_0x3c8e('0x7d')]()+']',_0x3c8e('0x60'));_0x3547af[_0x3c8e('0x61')]=util[_0x3c8e('0x42')](_0x3c8e('0x62'),_0x1bbe66['serverUrl'],_0x3547af['uniqueid'],md5(_0x3547af[_0x3c8e('0x63')]));}else{_0x3547af[_0x3c8e('0x61')]='';}return getConnection(_0x1bbe66)[_0x3c8e('0x24')](function(_0x484b45){_0x5966c3=_0x484b45;if(!_[_0x3c8e('0x20')](_0x1c3136)){return getUser(_0x1bbe66,_0x1c3136[_0x3c8e('0x52')],_0x5966c3);}else{return getUser(_0x1bbe66,null,_0x5966c3);}})[_0x3c8e('0x24')](function(_0x1fd946){_0x11ad4a=_0x1fd946;return getEndUser(_0x1bbe66,_0xfe2db6,_0x3547af['calleridname'],_0x3547af[_0x3c8e('0x7e')],_0x5966c3);})['then'](function(_0xfde9a0){_0x32a63d=_0xfde9a0;return getTicket(_0x1bbe66,_0x11ad4a,_0x32a63d,_0xfe2db6,_0x3547af,_0xfe2db6[_0x3c8e('0x75')],_0x5966c3);})[_0x3c8e('0x24')](function(_0x21e914){_0x4383c3=_0x21e914;logger['info']('['+_0x3547af['lastevent'][_0x3c8e('0x7d')]()+_0x3c8e('0x7f'),_0x4383c3['id']);logger[_0x3c8e('0x1d')]('['+_0x3547af[_0x3c8e('0x7c')]['toUpperCase']()+_0x3c8e('0x80'),_0x1bbe66['type']);})[_0x3c8e('0x70')](function(_0x58805b){logger[_0x3c8e('0x6e')]('['+_0x3547af['lastevent'][_0x3c8e('0x7d')]()+']',_0x58805b);});}; \ 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 066e11f..b4b82ad 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 _0xb022=['./util','../../../../config/logger','redis','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','length','adminId','sys_id','toUpperCase','],\x20getAdminUser\x20crm','message','info','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20entity','active','true','userId','catch','error','adminEmail','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','endUserNumber','System','result','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','includes','string','picklist','nameField','customField','toLowerCase','content','type','idField','toString','variable','variableName','customVariable','name','Variable',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketNumber','number','label','?sysparm_query=name%3D','label_entry','Incident','ticketId','Incident\x20-\x20','forEach','push','all','Tags','map','%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','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','email','destcalleridnum','calleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','ioredis'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xb022,0xdf));var _0x2b02=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0xb022[_0x16d10f];return _0x50c823;};'use strict';var _=require(_0x2b02('0x0'));var Promise=require(_0x2b02('0x1'));var rp=require(_0x2b02('0x2'));var util=require(_0x2b02('0x3'));var md5=require('md5');var Redis=require(_0x2b02('0x4'));var intUtil=require(_0x2b02('0x5'));var config=require('../../../../config/environment');var logger=require(_0x2b02('0x6'))('servicenow');config[_0x2b02('0x7')]=_['defaults'](config['redis'],{'host':_0x2b02('0x8'),'port':0x18eb});var io=require(_0x2b02('0x9'))(new Redis(config[_0x2b02('0x7')]));function getAdminUser(_0xc37d5e,_0xf01b74,_0x4ad3fc,_0x29a083,_0x268e4c,_0x3359dc){return new Promise(function(_0x357514,_0x54ef7a){var _0x3e2f68={'method':_0x2b02('0xa'),'uri':_0x29a083+_0x2b02('0xb')+'&'+_0x268e4c+'&'+_0x3359dc,'auth':_0xf01b74,'json':!![]};return rp(_0x3e2f68)[_0x2b02('0xc')](function(_0x20d83f){if(_0x20d83f['result'][_0x2b02('0xd')]>0x0){_0x4ad3fc[_0x2b02('0xe')]=_0x20d83f['result'][0x0][_0x2b02('0xf')];}logger['info']('['+[_0xc37d5e[_0x2b02('0x10')]()]+_0x2b02('0x11'),_0x4ad3fc);_0x357514(_0x4ad3fc);})['catch'](function(_0x461340){logger['error']('['+[_0xc37d5e['toUpperCase']()]+']',_0x461340[_0x2b02('0x12')]);_0x54ef7a(_0x461340[_0x2b02('0x12')]);});});}function getUser(_0x20e0fa,_0x26a4de,_0x5b43be,_0x8337a8,_0x50f9d4){return function(_0x4048ca){logger[_0x2b02('0x13')]('['+[_0x20e0fa[_0x2b02('0x10')]()]+_0x2b02('0x14'),_0x4048ca);return new Promise(function(_0xe8a73b,_0xbe03af){if(intUtil[_0x2b02('0x15')](_0x4048ca[_0x2b02('0x16')])){var _0x2d2496={'method':_0x2b02('0xa'),'uri':_0x5b43be+_0x2b02('0x17')+_0x4048ca['userEmail']+'&'+_0x8337a8+'&'+_0x50f9d4,'auth':_0x26a4de,'json':!![]};logger[_0x2b02('0x13')]('['+[_0x20e0fa[_0x2b02('0x10')]()]+'],\x20getUser\x20rp\x20obj',_0x2d2496);return rp(_0x2d2496)['then'](function(_0x9bf59d){logger[_0x2b02('0x13')]('['+[_0x20e0fa['toUpperCase']()]+_0x2b02('0x18'),_0x9bf59d);if(_0x9bf59d['result'][_0x2b02('0xd')]>0x0&&String(_0x9bf59d['result'][0x0][_0x2b02('0x19')])===_0x2b02('0x1a')){_0x4048ca['userId']=_0x9bf59d['result'][0x0][_0x2b02('0xf')];}else{_0x4048ca[_0x2b02('0x1b')]=_0x4048ca[_0x2b02('0xe')];_0x4048ca[_0x2b02('0x16')]=_0x4048ca['adminEmail'];}logger[_0x2b02('0x13')]('['+[_0x20e0fa[_0x2b02('0x10')]()]+'],\x20getUser\x20crm',_0x4048ca);_0xe8a73b(_0x4048ca);})[_0x2b02('0x1c')](function(_0x164377){logger[_0x2b02('0x1d')]('['+[_0x20e0fa['toUpperCase']()]+']',_0x164377[_0x2b02('0x12')]);_0xbe03af(_0x164377['message']);});}else{logger[_0x2b02('0x13')]('['+[_0x20e0fa[_0x2b02('0x10')]()]+']\x20using\x20admin\x20profile');_0x4048ca[_0x2b02('0x1b')]=_0x4048ca[_0x2b02('0xe')];_0x4048ca[_0x2b02('0x16')]=_0x4048ca[_0x2b02('0x1e')];_0xe8a73b(_0x4048ca);}});};}function createEndUser(_0x511757,_0x3e1aa6,_0x262ba7,_0x1a36b4,_0xbc250b){logger['info']('['+[_0x511757[_0x2b02('0x10')]()]+_0x2b02('0x1f'),_0x262ba7);return new Promise(function(_0x224a0c,_0x140806){var _0x39ec03={'method':_0x2b02('0x20'),'uri':_0x1a36b4+_0x2b02('0x21')+_0xbc250b,'body':{'user_name':_0x262ba7['endUserNumber'],'roles':_0x2b02('0x22'),'first_name':_0x262ba7[_0x2b02('0x23')],'active':_0x2b02('0x1a'),'date_format':_0x2b02('0x24'),'phone':_0x262ba7[_0x2b02('0x23')]},'auth':_0x3e1aa6,'json':!![]};return rp(_0x39ec03)[_0x2b02('0xc')](function(_0x3c683b){logger['info']('['+[_0x511757[_0x2b02('0x10')]()]+'],\x20EndUser\x20schema',_0x3c683b[_0x2b02('0x25')]);_0x262ba7[_0x2b02('0x26')]=_0x3c683b['result'][_0x2b02('0xf')];_0x224a0c(_0x262ba7);})[_0x2b02('0x1c')](function(_0xc5461d){logger['error']('['+[_0x511757[_0x2b02('0x10')]()]+']',_0xc5461d[_0x2b02('0x12')]);_0x140806(_0xc5461d[_0x2b02('0x12')]);});});}function getEndUser(_0x14723e,_0x3cf2f6,_0xb87ba8,_0x4eb6e9,_0x4efbb4){return function(_0x3e1731){logger[_0x2b02('0x13')]('['+[_0x14723e[_0x2b02('0x10')]()]+_0x2b02('0x27'),_0x3e1731);return new Promise(function(_0x135531,_0x281ed9){var _0x17a43a={'method':_0x2b02('0xa'),'uri':_0xb87ba8+_0x2b02('0x28')+_0x3e1731['endUserNumber']+'&'+_0x4eb6e9+'&'+_0x4efbb4,'auth':_0x3cf2f6,'json':!![]};return rp(_0x17a43a)[_0x2b02('0xc')](function(_0x55487d){if(_0x55487d['result'][_0x2b02('0xd')]>0x0){_0x3e1731[_0x2b02('0x26')]=_0x55487d[_0x2b02('0x25')][0x0]['sys_id'];logger[_0x2b02('0x13')]('['+[_0x14723e['toUpperCase']()]+_0x2b02('0x29'),_0x3e1731);_0x135531(_0x3e1731);}else{return createEndUser(_0x14723e,_0x3cf2f6,_0x3e1731,_0xb87ba8,_0x4eb6e9)['then'](function(_0x21523b){logger[_0x2b02('0x13')]('['+[_0x14723e[_0x2b02('0x10')]()]+_0x2b02('0x2a'),_0x21523b);_0x135531(_0x21523b);});}})['catch'](function(_0x1290ee){logger[_0x2b02('0x1d')]('['+[_0x14723e[_0x2b02('0x10')]()]+']',_0x1290ee[_0x2b02('0x12')]);_0x281ed9(_0x1290ee['message']);});});};}function getCustomFields(_0x16b1f7,_0x432272){var _0x249779={};if(_0x16b1f7['length']>0x0){_['forEach'](_0x16b1f7,function(_0xd6a834){if(_[_0x2b02('0x2b')]([_0x2b02('0x2c'),_0x2b02('0x2d')],_0xd6a834['type'])&&_0xd6a834[_0x2b02('0x2e')]&&!_0xd6a834[_0x2b02('0x2f')]){_0x249779[_0xd6a834[_0x2b02('0x2e')][_0x2b02('0x30')]()]=_0xd6a834[_0x2b02('0x31')]['toString']();}else if(_[_0x2b02('0x2b')](['string','picklist'],_0xd6a834[_0x2b02('0x32')])&&_0xd6a834[_0x2b02('0x33')]&&_0xd6a834['customField']){_0x249779[_0xd6a834[_0x2b02('0x33')][_0x2b02('0x30')]()]=_0xd6a834['content'][_0x2b02('0x34')]();}else if(_0xd6a834[_0x2b02('0x32')]===_0x2b02('0x35')&&_0xd6a834[_0x2b02('0x36')]&&_0xd6a834[_0x2b02('0x33')]&&_0xd6a834[_0x2b02('0x2f')]){_0x249779[_0xd6a834[_0x2b02('0x33')][_0x2b02('0x30')]()]=_0x432272[_0xd6a834[_0x2b02('0x36')]][_0x2b02('0x34')]();}else if(_0xd6a834[_0x2b02('0x32')]===_0x2b02('0x37')&&_0xd6a834['Variable']&&_0xd6a834['Variable'][_0x2b02('0x38')]&&_0xd6a834['idField']&&_0xd6a834[_0x2b02('0x2f')]){_0x249779[_0xd6a834['idField'][_0x2b02('0x30')]()]=_0x432272[_0xd6a834[_0x2b02('0x39')][_0x2b02('0x38')]['toLowerCase']()][_0x2b02('0x34')]();}});}return _0x249779;}function getTicket(_0xfc5e42,_0x255a87,_0x431551,_0x3c1039,_0x19d5a5,_0x3e143e){return function(_0x48ede1){logger[_0x2b02('0x13')]('['+[_0xfc5e42[_0x2b02('0x10')]()]+_0x2b02('0x3a'),_0x48ede1);return new Promise(function(_0x520773,_0x3673dc){var _0x13d868=_0xfc5e42[_0x2b02('0x30')]()===_0x2b02('0x3b')?_0x48ede1[_0x2b02('0x1b')]:_0x48ede1[_0x2b02('0x26')];var _0x57f970={'method':_0x2b02('0x20'),'uri':_0x431551+_0x2b02('0x3c')+'?'+_0x3e143e,'body':Object[_0x2b02('0x3d')]({},{'active':'true','caller_id':_0x13d868,'assigned_to':_0x48ede1[_0x2b02('0x1b')],'short_description':intUtil[_0x2b02('0x3e')](_0x3c1039[_0x2b02('0x3f')],_0x19d5a5,'\x20'),'description':intUtil[_0x2b02('0x3e')](_0x3c1039[_0x2b02('0x40')],_0x19d5a5,'\x0a')},getCustomFields(_0x3c1039[_0x2b02('0x41')],_0x19d5a5)),'auth':_0x255a87,'json':!![]};return rp(_0x57f970)[_0x2b02('0xc')](function(_0x3b9a37){logger[_0x2b02('0x13')]('['+[_0xfc5e42['toUpperCase']()]+_0x2b02('0x42'),_0x3b9a37[_0x2b02('0x25')]);_0x48ede1['ticketId']=_0x3b9a37[_0x2b02('0x25')][_0x2b02('0xf')];_0x48ede1[_0x2b02('0x43')]=_0x3b9a37[_0x2b02('0x25')][_0x2b02('0x44')];logger[_0x2b02('0x13')]('['+[_0xfc5e42[_0x2b02('0x10')]()]+']\x20getTicket\x20crm',_0x48ede1);_0x520773(_0x48ede1);})[_0x2b02('0x1c')](function(_0x212c58){logger[_0x2b02('0x1d')]('['+[_0xfc5e42[_0x2b02('0x10')]()]+']',_0x212c58['message']);_0x3673dc(_0x212c58['message']);});});};}function createRemoteTag(_0x1c04a6,_0x5ca616,_0x21f0db,_0x558711){return new Promise(function(_0x2e794f,_0x265868){var _0x434fb2={'method':_0x2b02('0x20'),'uri':_0x21f0db+_0x2b02('0x45')+'?'+_0x558711,'body':{'short_description':_0x1c04a6,'global':!![],'active':!![],'name':_0x1c04a6},'auth':_0x5ca616,'json':!![]};return rp(_0x434fb2)[_0x2b02('0xc')](function(_0x471e26){var _0x10e4dd=_0x471e26[_0x2b02('0x25')]['sys_id'];_0x2e794f(_0x10e4dd);});});}function getRemoteTag(_0x1c48a0,_0x2e277e,_0x4aa5ee,_0x3429f8,_0x21922c){return new Promise(function(_0x1058d9,_0xd27169){var _0x2f7779={'method':_0x2b02('0xa'),'uri':_0x4aa5ee+_0x2b02('0x45')+_0x2b02('0x46')+_0x1c48a0+'&'+_0x3429f8,'auth':_0x2e277e,'json':!![]};return rp(_0x2f7779)[_0x2b02('0xc')](function(_0x570eac){if(_0x570eac[_0x2b02('0x25')][_0x2b02('0xd')]>0x0){var _0x55424c=_0x570eac[_0x2b02('0x25')][0x0]['sys_id'];_0x1058d9(_0x55424c);}else{return createRemoteTag(_0x1c48a0,_0x2e277e,_0x4aa5ee,_0x3429f8)[_0x2b02('0xc')](function(_0x2baf4a){_0x1058d9(_0x2baf4a);});}});});}function assignTagToIncident(_0x877ccf,_0x3bd273,_0x42fb56,_0x4ba8bd,_0x5c70c4){return new Promise(function(_0x314940,_0x4ed1c6){var _0x2665d9={'method':_0x2b02('0x20'),'uri':_0x42fb56+_0x2b02('0x47')+'?'+_0x5c70c4,'body':{'label':_0x877ccf,'table':_0x2b02('0x3c'),'id_type':_0x2b02('0x48'),'table_key':_0x4ba8bd[_0x2b02('0x49')],'title':_0x2b02('0x4a')+_0x4ba8bd[_0x2b02('0x43')],'id_display':_0x4ba8bd['ticketNumber']},'auth':_0x3bd273,'json':!![]};return rp(_0x2665d9)[_0x2b02('0xc')](function(_0x158689){_0x314940();})[_0x2b02('0x1c')](function(){_0x314940();});});}function manageTags(_0x1f3c9f,_0x5749ed,_0xcdeab,_0x5eb362,_0x2be27c,_0x170f6b,_0x398f07){return new Promise(function(_0x56c78f,_0x383e20){var _0x379508=[];_0x5749ed[_0x2b02('0x4b')](function(_0x47081e){_0x379508[_0x2b02('0x4c')](getRemoteTag(_0x47081e,_0xcdeab,_0x5eb362,_0x170f6b,_0x398f07));});return Promise[_0x2b02('0x4d')](_0x379508)[_0x2b02('0xc')](function(_0x1d058a){if(_0x1d058a[_0x2b02('0xd')]){logger[_0x2b02('0x13')]('['+[_0x1f3c9f[_0x2b02('0x10')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x1d058a);var _0x40c0b3=[];_0x1d058a[_0x2b02('0x4b')](function(_0x2d8dd6){_0x40c0b3[_0x2b02('0x4c')](assignTagToIncident(_0x2d8dd6,_0xcdeab,_0x5eb362,_0x2be27c,_0x170f6b));});return Promise['all'](_0x40c0b3)[_0x2b02('0xc')](function(){_0x56c78f();})[_0x2b02('0x1c')](function(){_0x56c78f();});}else{_0x56c78f();}});});}function getTags(_0x56e68d,_0x36284f,_0x58dd31,_0x620b99,_0x27c007,_0x2f3e40){return function(_0x418ac9){return new Promise(function(_0x37a513,_0x11ca14){var _0x52c547=[];var _0x495398=_0x620b99[_0x2b02('0x4e')];if(_0x495398&&_0x495398['length']>0x0){_0x52c547=_[_0x2b02('0x4f')](_0x495398,_0x2b02('0x38'));}if(_0x52c547[_0x2b02('0xd')]>0x0){return manageTags(_0x56e68d,_0x52c547,_0x36284f,_0x58dd31,_0x418ac9,_0x27c007,_0x2f3e40)[_0x2b02('0xc')](function(){_0x37a513(_0x418ac9);});}else{_0x37a513(_0x418ac9);}});};}function emit(_0x3d1853,_0x65d4ea,_0x2e036e){var _0x4a0d10=_0x2b02('0x50')+_0x2b02('0x51')+_0x2b02('0x52')+_0x2b02('0x53');var _0x51d5a6={'uri':_0x3d1853+_0x2b02('0x54')+_0x2e036e+_0x4a0d10};io['to'](util[_0x2b02('0x55')](_0x2b02('0x56'),_0x65d4ea))['emit'](_0x2b02('0x57'),_0x51d5a6);}exports['cs']=function(_0x2ce6bf,_0x2e795f,_0x2611e1,_0x5f2dc0,_0x145f47,_0x5d515c,_0x4c29b1,_0x458e3a){var _0x314f20={};var _0x31af05={'user':_0x5d515c[_0x2b02('0x58')],'pass':_0x5d515c[_0x2b02('0x59')]};var _0x3ab6b6=_0x2b02('0x5a');var _0x18da13=_0x2b02('0x5b');_0x5d515c[_0x2b02('0x5c')]=intUtil[_0x2b02('0x5d')](_0x5d515c[_0x2b02('0x5c')]);_0x5d515c[_0x2b02('0x5e')]=intUtil[_0x2b02('0x5d')](_0x5d515c[_0x2b02('0x5e')]);var _0x4fae53=util[_0x2b02('0x55')](_0x2b02('0x5f'),_0x5d515c[_0x2b02('0x5c')]);_0x314f20['userEmail']=!_['isNil'](_0x5f2dc0)?_0x5f2dc0['email']:null;_0x314f20[_0x2b02('0x1e')]=_0x5d515c[_0x2b02('0x60')];_0x314f20[_0x2b02('0x23')]=_0x458e3a[_0x2b02('0x30')]()==='outbound'?_0x2e795f[_0x2b02('0x61')]:_0x2e795f[_0x2b02('0x62')];_0x314f20['callDirection']=_0x458e3a===_0x2b02('0x63')||_0x458e3a===_0x2b02('0x64')?_0x2b02('0x63'):_0x2b02('0x3b');var _0x2aa254=util['format'](_0x2b02('0x65'),_0x5d515c[_0x2b02('0x5e')],_0x2e795f[_0x2b02('0x66')],md5(_0x2e795f[_0x2b02('0x66')]));if(_0x145f47&&_0x145f47[_0x2b02('0x67')]){logger[_0x2b02('0x13')](_0x2b02('0x68'),_0x2b02('0x69'));_0x2e795f[_0x2b02('0x6a')]=_0x2aa254;}else if(_0x4c29b1&&_0x4c29b1[_0x2b02('0x6b')]&&_0x4c29b1[_0x2b02('0x6b')]!==_0x2b02('0x6c')){logger['info'](_0x2b02('0x6d'),'Recording\x20is\x20enabled!');_0x2e795f['recordingURL']=_0x2aa254;}else{_0x2e795f[_0x2b02('0x6a')]='';}return getAdminUser(_0x458e3a,_0x31af05,_0x314f20,_0x4fae53,_0x18da13,_0x3ab6b6)[_0x2b02('0xc')](getUser(_0x458e3a,_0x31af05,_0x4fae53,_0x18da13,_0x3ab6b6))[_0x2b02('0xc')](getEndUser(_0x458e3a,_0x31af05,_0x4fae53,_0x18da13,_0x3ab6b6))[_0x2b02('0xc')](getTicket(_0x458e3a,_0x31af05,_0x4fae53,_0x2611e1,_0x2e795f,_0x18da13))[_0x2b02('0xc')](function(_0x293c36){logger[_0x2b02('0x13')](util[_0x2b02('0x55')]('The\x20ticket\x20ID\x20is:\x20%s',_0x293c36[_0x2b02('0x49')]));logger[_0x2b02('0x13')](util[_0x2b02('0x55')](_0x2b02('0x6e'),_0x458e3a));if(_0x458e3a!==_0x2b02('0x64')){logger['info']('['+[_0x458e3a[_0x2b02('0x10')]()]+']',_0x2b02('0x6f'));emit(_0x5d515c[_0x2b02('0x5c')],_0x5f2dc0[_0x2b02('0x38')],_0x293c36[_0x2b02('0x49')]);}})[_0x2b02('0x1c')](function(_0x3f70e6){logger[_0x2b02('0x1d')]('['+[_0x458e3a[_0x2b02('0x10')]()]+_0x2b02('0x70'),util[_0x2b02('0x71')](_0x3f70e6,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xb0f7=['lodash','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/environment','servicenow','redis','defaults','localhost','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','result','length','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','then','],\x20getUser\x20entity','active','true','userId','],\x20getUser\x20crm','message',']\x20using\x20admin\x20profile','adminEmail','POST','user','endUserNumber','],\x20EndUser\x20schema','],\x20getEndUser\x20input\x20crm','],\x20createEndUser\x20crm','includes','string','picklist','nameField','toLowerCase','content','type','idField','customField','toString','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','endUserId','assign','getString','Subjects','Descriptions',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber',']\x20getTicket\x20crm','label','GET','label_entry','incident','Incident','Incident\x20-\x20','forEach','push',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','all','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','format','user:%s','emit','trigger:browser:url','username','sysparm_display_value=true','remoteUri','serverUrl','%s/api/now/table/','isNil','email','calleridnum','callDirection','unmanaged','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','inspect'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xb0f7,0x6b));var _0x7b0f=function(_0x2a8375,_0x372351){_0x2a8375=_0x2a8375-0x0;var _0x1b9d44=_0xb0f7[_0x2a8375];return _0x1b9d44;};'use strict';var _=require(_0x7b0f('0x0'));var Promise=require(_0x7b0f('0x1'));var rp=require(_0x7b0f('0x2'));var util=require(_0x7b0f('0x3'));var md5=require(_0x7b0f('0x4'));var Redis=require(_0x7b0f('0x5'));var intUtil=require(_0x7b0f('0x6'));var config=require(_0x7b0f('0x7'));var logger=require('../../../../config/logger')(_0x7b0f('0x8'));config[_0x7b0f('0x9')]=_[_0x7b0f('0xa')](config[_0x7b0f('0x9')],{'host':_0x7b0f('0xb'),'port':0x18eb});var io=require(_0x7b0f('0xc'))(new Redis(config[_0x7b0f('0x9')]));function getAdminUser(_0xd4c456,_0x500ba2,_0x56cde9,_0x293294,_0x4b8f77,_0x3455b7){return new Promise(function(_0xa48575,_0x23fe8f){var _0x50484f={'method':'GET','uri':_0x293294+_0x7b0f('0xd')+'&'+_0x4b8f77+'&'+_0x3455b7,'auth':_0x500ba2,'json':!![]};return rp(_0x50484f)['then'](function(_0x104cdf){if(_0x104cdf[_0x7b0f('0xe')][_0x7b0f('0xf')]>0x0){_0x56cde9[_0x7b0f('0x10')]=_0x104cdf[_0x7b0f('0xe')][0x0][_0x7b0f('0x11')];}logger[_0x7b0f('0x12')]('['+[_0xd4c456[_0x7b0f('0x13')]()]+_0x7b0f('0x14'),_0x56cde9);_0xa48575(_0x56cde9);})[_0x7b0f('0x15')](function(_0x4032f5){logger[_0x7b0f('0x16')]('['+[_0xd4c456[_0x7b0f('0x13')]()]+']',_0x4032f5['message']);_0x23fe8f(_0x4032f5['message']);});});}function getUser(_0x2cf4ee,_0x924dd3,_0x105184,_0x2ed27b,_0x327c88){return function(_0x36f3d4){logger[_0x7b0f('0x12')]('['+[_0x2cf4ee['toUpperCase']()]+_0x7b0f('0x17'),_0x36f3d4);return new Promise(function(_0x253fc9,_0x3ca209){if(intUtil[_0x7b0f('0x18')](_0x36f3d4[_0x7b0f('0x19')])){var _0xf4b185={'method':'GET','uri':_0x105184+_0x7b0f('0x1a')+_0x36f3d4[_0x7b0f('0x19')]+'&'+_0x2ed27b+'&'+_0x327c88,'auth':_0x924dd3,'json':!![]};logger['info']('['+[_0x2cf4ee['toUpperCase']()]+'],\x20getUser\x20rp\x20obj',_0xf4b185);return rp(_0xf4b185)[_0x7b0f('0x1b')](function(_0x3953c7){logger['info']('['+[_0x2cf4ee['toUpperCase']()]+_0x7b0f('0x1c'),_0x3953c7);if(_0x3953c7[_0x7b0f('0xe')][_0x7b0f('0xf')]>0x0&&String(_0x3953c7[_0x7b0f('0xe')][0x0][_0x7b0f('0x1d')])===_0x7b0f('0x1e')){_0x36f3d4[_0x7b0f('0x1f')]=_0x3953c7[_0x7b0f('0xe')][0x0]['sys_id'];}else{_0x36f3d4[_0x7b0f('0x1f')]=_0x36f3d4[_0x7b0f('0x10')];_0x36f3d4[_0x7b0f('0x19')]=_0x36f3d4['adminEmail'];}logger['info']('['+[_0x2cf4ee[_0x7b0f('0x13')]()]+_0x7b0f('0x20'),_0x36f3d4);_0x253fc9(_0x36f3d4);})['catch'](function(_0x4952c){logger[_0x7b0f('0x16')]('['+[_0x2cf4ee[_0x7b0f('0x13')]()]+']',_0x4952c['message']);_0x3ca209(_0x4952c[_0x7b0f('0x21')]);});}else{logger[_0x7b0f('0x12')]('['+[_0x2cf4ee['toUpperCase']()]+_0x7b0f('0x22'));_0x36f3d4[_0x7b0f('0x1f')]=_0x36f3d4[_0x7b0f('0x10')];_0x36f3d4['userEmail']=_0x36f3d4[_0x7b0f('0x23')];_0x253fc9(_0x36f3d4);}});};}function createEndUser(_0x208b5f,_0x456be5,_0x4228a1,_0x3aee6f,_0x1defa6){logger['info']('['+[_0x208b5f['toUpperCase']()]+'],\x20createEndUser\x20input\x20crm',_0x4228a1);return new Promise(function(_0x516f1a,_0x10dfcf){var _0x392b5f={'method':_0x7b0f('0x24'),'uri':_0x3aee6f+'sys_user?'+_0x1defa6,'body':{'user_name':_0x4228a1['endUserNumber'],'roles':_0x7b0f('0x25'),'first_name':_0x4228a1[_0x7b0f('0x26')],'active':_0x7b0f('0x1e'),'date_format':'System','phone':_0x4228a1[_0x7b0f('0x26')]},'auth':_0x456be5,'json':!![]};return rp(_0x392b5f)[_0x7b0f('0x1b')](function(_0x248d0c){logger[_0x7b0f('0x12')]('['+[_0x208b5f[_0x7b0f('0x13')]()]+_0x7b0f('0x27'),_0x248d0c[_0x7b0f('0xe')]);_0x4228a1['endUserId']=_0x248d0c[_0x7b0f('0xe')][_0x7b0f('0x11')];_0x516f1a(_0x4228a1);})[_0x7b0f('0x15')](function(_0x19fcf7){logger['error']('['+[_0x208b5f[_0x7b0f('0x13')]()]+']',_0x19fcf7[_0x7b0f('0x21')]);_0x10dfcf(_0x19fcf7[_0x7b0f('0x21')]);});});}function getEndUser(_0x12a096,_0x14635d,_0x3ab6bf,_0x2d806c,_0x18d2be){return function(_0xe2027e){logger['info']('['+[_0x12a096[_0x7b0f('0x13')]()]+_0x7b0f('0x28'),_0xe2027e);return new Promise(function(_0x4d2e3a,_0x31ea35){var _0x45b36f={'method':'GET','uri':_0x3ab6bf+'sys_user?sysparm_query=phone%3D'+_0xe2027e[_0x7b0f('0x26')]+'&'+_0x2d806c+'&'+_0x18d2be,'auth':_0x14635d,'json':!![]};return rp(_0x45b36f)[_0x7b0f('0x1b')](function(_0x7b1df2){if(_0x7b1df2['result'][_0x7b0f('0xf')]>0x0){_0xe2027e['endUserId']=_0x7b1df2[_0x7b0f('0xe')][0x0]['sys_id'];logger[_0x7b0f('0x12')]('['+[_0x12a096['toUpperCase']()]+'],\x20getEndUser\x20crm',_0xe2027e);_0x4d2e3a(_0xe2027e);}else{return createEndUser(_0x12a096,_0x14635d,_0xe2027e,_0x3ab6bf,_0x2d806c)[_0x7b0f('0x1b')](function(_0x32ed9c){logger[_0x7b0f('0x12')]('['+[_0x12a096[_0x7b0f('0x13')]()]+_0x7b0f('0x29'),_0x32ed9c);_0x4d2e3a(_0x32ed9c);});}})[_0x7b0f('0x15')](function(_0x2fa014){logger[_0x7b0f('0x16')]('['+[_0x12a096[_0x7b0f('0x13')]()]+']',_0x2fa014[_0x7b0f('0x21')]);_0x31ea35(_0x2fa014[_0x7b0f('0x21')]);});});};}function getCustomFields(_0x3df01b,_0x32931e){var _0x1aa13d={};if(_0x3df01b['length']>0x0){_['forEach'](_0x3df01b,function(_0x5ef0e2){if(_[_0x7b0f('0x2a')]([_0x7b0f('0x2b'),_0x7b0f('0x2c')],_0x5ef0e2['type'])&&_0x5ef0e2[_0x7b0f('0x2d')]&&!_0x5ef0e2['customField']){_0x1aa13d[_0x5ef0e2['nameField'][_0x7b0f('0x2e')]()]=_0x5ef0e2[_0x7b0f('0x2f')]['toString']();}else if(_['includes']([_0x7b0f('0x2b'),_0x7b0f('0x2c')],_0x5ef0e2[_0x7b0f('0x30')])&&_0x5ef0e2[_0x7b0f('0x31')]&&_0x5ef0e2[_0x7b0f('0x32')]){_0x1aa13d[_0x5ef0e2[_0x7b0f('0x31')]['toLowerCase']()]=_0x5ef0e2[_0x7b0f('0x2f')][_0x7b0f('0x33')]();}else if(_0x5ef0e2[_0x7b0f('0x30')]==='variable'&&_0x5ef0e2['variableName']&&_0x5ef0e2[_0x7b0f('0x31')]&&_0x5ef0e2['customField']){_0x1aa13d[_0x5ef0e2[_0x7b0f('0x31')][_0x7b0f('0x2e')]()]=_0x32931e[_0x5ef0e2['variableName']]['toString']();}else if(_0x5ef0e2[_0x7b0f('0x30')]===_0x7b0f('0x34')&&_0x5ef0e2[_0x7b0f('0x35')]&&_0x5ef0e2[_0x7b0f('0x35')][_0x7b0f('0x36')]&&_0x5ef0e2[_0x7b0f('0x31')]&&_0x5ef0e2[_0x7b0f('0x32')]){_0x1aa13d[_0x5ef0e2['idField'][_0x7b0f('0x2e')]()]=_0x32931e[_0x5ef0e2[_0x7b0f('0x35')][_0x7b0f('0x36')][_0x7b0f('0x2e')]()][_0x7b0f('0x33')]();}});}return _0x1aa13d;}function getTicket(_0x83eaab,_0x421d55,_0x4aa614,_0xffbf83,_0x3e503f,_0x4ec65c){return function(_0x2ac258){logger[_0x7b0f('0x12')]('['+[_0x83eaab[_0x7b0f('0x13')]()]+_0x7b0f('0x37'),_0x2ac258);return new Promise(function(_0x3cdd23,_0x562550){var _0x2f150b=_0x83eaab[_0x7b0f('0x2e')]()===_0x7b0f('0x38')?_0x2ac258[_0x7b0f('0x1f')]:_0x2ac258[_0x7b0f('0x39')];var _0x526006={'method':_0x7b0f('0x24'),'uri':_0x4aa614+'incident'+'?'+_0x4ec65c,'body':Object[_0x7b0f('0x3a')]({},{'active':_0x7b0f('0x1e'),'caller_id':_0x2f150b,'assigned_to':_0x2ac258[_0x7b0f('0x1f')],'short_description':intUtil[_0x7b0f('0x3b')](_0xffbf83[_0x7b0f('0x3c')],_0x3e503f,'\x20'),'description':intUtil[_0x7b0f('0x3b')](_0xffbf83[_0x7b0f('0x3d')],_0x3e503f,'\x0a')},getCustomFields(_0xffbf83['Fields'],_0x3e503f)),'auth':_0x421d55,'json':!![]};return rp(_0x526006)[_0x7b0f('0x1b')](function(_0x27f7d4){logger[_0x7b0f('0x12')]('['+[_0x83eaab[_0x7b0f('0x13')]()]+_0x7b0f('0x3e'),_0x27f7d4['result']);_0x2ac258[_0x7b0f('0x3f')]=_0x27f7d4[_0x7b0f('0xe')]['sys_id'];_0x2ac258[_0x7b0f('0x40')]=_0x27f7d4[_0x7b0f('0xe')]['number'];logger[_0x7b0f('0x12')]('['+[_0x83eaab[_0x7b0f('0x13')]()]+_0x7b0f('0x41'),_0x2ac258);_0x3cdd23(_0x2ac258);})['catch'](function(_0x17b4e){logger[_0x7b0f('0x16')]('['+[_0x83eaab[_0x7b0f('0x13')]()]+']',_0x17b4e['message']);_0x562550(_0x17b4e['message']);});});};}function createRemoteTag(_0x561a6f,_0x512bcb,_0x4c1269,_0x346851){return new Promise(function(_0x1a4ff9,_0x5c560d){var _0x49759e={'method':_0x7b0f('0x24'),'uri':_0x4c1269+_0x7b0f('0x42')+'?'+_0x346851,'body':{'short_description':_0x561a6f,'global':!![],'active':!![],'name':_0x561a6f},'auth':_0x512bcb,'json':!![]};return rp(_0x49759e)[_0x7b0f('0x1b')](function(_0x298f3d){var _0x54b4ee=_0x298f3d['result'][_0x7b0f('0x11')];_0x1a4ff9(_0x54b4ee);});});}function getRemoteTag(_0x5cd591,_0x3c437e,_0x3caad9,_0x178e36,_0xd7ab1a){return new Promise(function(_0x1db86a,_0x15c51e){var _0x3b2b20={'method':_0x7b0f('0x43'),'uri':_0x3caad9+_0x7b0f('0x42')+'?sysparm_query=name%3D'+_0x5cd591+'&'+_0x178e36,'auth':_0x3c437e,'json':!![]};return rp(_0x3b2b20)[_0x7b0f('0x1b')](function(_0x2caa1b){if(_0x2caa1b[_0x7b0f('0xe')]['length']>0x0){var _0x360b32=_0x2caa1b[_0x7b0f('0xe')][0x0]['sys_id'];_0x1db86a(_0x360b32);}else{return createRemoteTag(_0x5cd591,_0x3c437e,_0x3caad9,_0x178e36)['then'](function(_0x349ef1){_0x1db86a(_0x349ef1);});}});});}function assignTagToIncident(_0x17acb4,_0x560725,_0x420c95,_0x17659e,_0x209d8c){return new Promise(function(_0x4d8924,_0x5c01cb){var _0xba1452={'method':_0x7b0f('0x24'),'uri':_0x420c95+_0x7b0f('0x44')+'?'+_0x209d8c,'body':{'label':_0x17acb4,'table':_0x7b0f('0x45'),'id_type':_0x7b0f('0x46'),'table_key':_0x17659e[_0x7b0f('0x3f')],'title':_0x7b0f('0x47')+_0x17659e[_0x7b0f('0x40')],'id_display':_0x17659e[_0x7b0f('0x40')]},'auth':_0x560725,'json':!![]};return rp(_0xba1452)['then'](function(_0x3b1c12){_0x4d8924();})[_0x7b0f('0x15')](function(){_0x4d8924();});});}function manageTags(_0x15b817,_0x329603,_0x5d28bc,_0x3363f7,_0x8236c2,_0x449622,_0x2657c7){return new Promise(function(_0x3a9a45,_0x4c6503){var _0x4739eb=[];_0x329603[_0x7b0f('0x48')](function(_0x2229ee){_0x4739eb[_0x7b0f('0x49')](getRemoteTag(_0x2229ee,_0x5d28bc,_0x3363f7,_0x449622,_0x2657c7));});return Promise['all'](_0x4739eb)[_0x7b0f('0x1b')](function(_0x3c6636){if(_0x3c6636['length']){logger[_0x7b0f('0x12')]('['+[_0x15b817[_0x7b0f('0x13')]()]+_0x7b0f('0x4a'),_0x3c6636);var _0x51b660=[];_0x3c6636[_0x7b0f('0x48')](function(_0x1af258){_0x51b660[_0x7b0f('0x49')](assignTagToIncident(_0x1af258,_0x5d28bc,_0x3363f7,_0x8236c2,_0x449622));});return Promise[_0x7b0f('0x4b')](_0x51b660)['then'](function(){_0x3a9a45();})['catch'](function(){_0x3a9a45();});}else{_0x3a9a45();}});});}function getTags(_0x13bfa1,_0x1ae99b,_0x55cc75,_0x554d6a,_0x2f68c0,_0x7da28b){return function(_0x184a88){return new Promise(function(_0x2645cc,_0x470c3b){var _0x66cd8=[];var _0x16c5db=_0x554d6a['Tags'];if(_0x16c5db&&_0x16c5db[_0x7b0f('0xf')]>0x0){_0x66cd8=_[_0x7b0f('0x4c')](_0x16c5db,_0x7b0f('0x36'));}if(_0x66cd8['length']>0x0){return manageTags(_0x13bfa1,_0x66cd8,_0x1ae99b,_0x55cc75,_0x184a88,_0x2f68c0,_0x7da28b)[_0x7b0f('0x1b')](function(){_0x2645cc(_0x184a88);});}else{_0x2645cc(_0x184a88);}});};}function emit(_0x20afc4,_0x4605c3,_0x31cf54){var _0x2cdae7=_0x7b0f('0x4d')+_0x7b0f('0x4e')+_0x7b0f('0x4f')+_0x7b0f('0x50');var _0x542957={'uri':_0x20afc4+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x31cf54+_0x2cdae7};io['to'](util[_0x7b0f('0x51')](_0x7b0f('0x52'),_0x4605c3))[_0x7b0f('0x53')](_0x7b0f('0x54'),_0x542957);}exports['cs']=function(_0x301349,_0x1fd360,_0x4cb9f9,_0x14bdca,_0x20b265,_0x568467,_0x265eef,_0x26efa1){var _0x11bb9e={};var _0x172f68={'user':_0x568467[_0x7b0f('0x55')],'pass':_0x568467['password']};var _0xf5902b='sysparm_limit=1';var _0x355eb7=_0x7b0f('0x56');_0x568467[_0x7b0f('0x57')]=intUtil['stripTrailingSlash'](_0x568467['remoteUri']);_0x568467[_0x7b0f('0x58')]=intUtil['stripTrailingSlash'](_0x568467[_0x7b0f('0x58')]);var _0x5b8798=util['format'](_0x7b0f('0x59'),_0x568467[_0x7b0f('0x57')]);_0x11bb9e[_0x7b0f('0x19')]=!_[_0x7b0f('0x5a')](_0x14bdca)?_0x14bdca[_0x7b0f('0x5b')]:null;_0x11bb9e[_0x7b0f('0x23')]=_0x568467[_0x7b0f('0x5b')];_0x11bb9e[_0x7b0f('0x26')]=_0x26efa1[_0x7b0f('0x2e')]()==='outbound'?_0x1fd360['destcalleridnum']:_0x1fd360[_0x7b0f('0x5c')];_0x11bb9e[_0x7b0f('0x5d')]=_0x26efa1==='queue'||_0x26efa1===_0x7b0f('0x5e')?_0x7b0f('0x5f'):'outbound';var _0x3367cf=util[_0x7b0f('0x51')](_0x7b0f('0x60'),_0x568467[_0x7b0f('0x58')],_0x1fd360[_0x7b0f('0x61')],md5(_0x1fd360[_0x7b0f('0x61')]));if(_0x20b265&&_0x20b265[_0x7b0f('0x62')]){logger[_0x7b0f('0x12')](_0x7b0f('0x63'),'Recording\x20is\x20enabled!');_0x1fd360[_0x7b0f('0x64')]=_0x3367cf;}else if(_0x265eef&&_0x265eef[_0x7b0f('0x65')]&&_0x265eef[_0x7b0f('0x65')]!==_0x7b0f('0x66')){logger[_0x7b0f('0x12')](_0x7b0f('0x67'),'Recording\x20is\x20enabled!');_0x1fd360[_0x7b0f('0x64')]=_0x3367cf;}else{_0x1fd360['recordingURL']='';}return getAdminUser(_0x26efa1,_0x172f68,_0x11bb9e,_0x5b8798,_0x355eb7,_0xf5902b)[_0x7b0f('0x1b')](getUser(_0x26efa1,_0x172f68,_0x5b8798,_0x355eb7,_0xf5902b))[_0x7b0f('0x1b')](getEndUser(_0x26efa1,_0x172f68,_0x5b8798,_0x355eb7,_0xf5902b))[_0x7b0f('0x1b')](getTicket(_0x26efa1,_0x172f68,_0x5b8798,_0x4cb9f9,_0x1fd360,_0x355eb7))[_0x7b0f('0x1b')](function(_0x4b470a){logger[_0x7b0f('0x12')](util[_0x7b0f('0x51')]('The\x20ticket\x20ID\x20is:\x20%s',_0x4b470a[_0x7b0f('0x3f')]));logger[_0x7b0f('0x12')](util[_0x7b0f('0x51')](_0x7b0f('0x68'),_0x26efa1));if(_0x26efa1!==_0x7b0f('0x5e')){logger[_0x7b0f('0x12')]('['+[_0x26efa1[_0x7b0f('0x13')]()]+']',_0x7b0f('0x69'));emit(_0x568467[_0x7b0f('0x57')],_0x14bdca['name'],_0x4b470a['ticketId']);}})['catch'](function(_0x403f22){logger[_0x7b0f('0x16')]('['+[_0x26efa1[_0x7b0f('0x13')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0x7b0f('0x6a')](_0x403f22,{'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 37e4004..27b8c64 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 _0x7577=['catch','unmanaged','monitor_format','lastevent','toUpperCase','The\x20User\x20ID\x20is:','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','localhost','socket.io-emitter','POST','info','Creating\x20new\x20ticket...','name','getString','Subjects','created_by','date_start','toISOString','replace','duration_minutes','parent_id','Contacts','parent_name','length','forEach','push','variableName','set_entry','JSON','apiKey','toString','base64','get_server_info','stringify','isNil','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','entry_list','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','get_entry_list','format','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','then','find','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','debug','[HTTP]','merge','type','nameField','customField','toLowerCase','content','string','idField','custom_fields','variable','customVariable','Variable','username','password','PLAIN','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','Calls','queue','remoteUri','serverUrl','stripTrailingSlash','uri','%s/service/v4_1/rest.php','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','error','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Fields','Outbound','contacts'];(function(_0x1b14e4,_0x154a76){var _0x39197a=function(_0x534660){while(--_0x534660){_0x1b14e4['push'](_0x1b14e4['shift']());}};_0x39197a(++_0x154a76);}(_0x7577,0x80));var _0x7757=function(_0x10cb5d,_0x96a3aa){_0x10cb5d=_0x10cb5d-0x0;var _0x28351e=_0x7577[_0x10cb5d];return _0x28351e;};'use strict';var _=require(_0x7757('0x0'));var rp=require(_0x7757('0x1'));var BPromise=require(_0x7757('0x2'));var md5=require(_0x7757('0x3'));var util=require(_0x7757('0x4'));var Redis=require(_0x7757('0x5'));var intUtil=require(_0x7757('0x6'));var config=require(_0x7757('0x7'));var logger=require(_0x7757('0x8'))(_0x7757('0x9'));config['redis']=_['defaults'](config['redis'],{'host':_0x7757('0xa'),'port':0x18eb});var io=require(_0x7757('0xb'))(new Redis(config['redis']));var def={'method':_0x7757('0xc'),'json':!![]};function emit(_0xb23152,_0x16be21,_0xc4c7e0){io['to'](_0xb23152)['emit'](_0x16be21,_0xc4c7e0);}function getTicket(_0x120edc,_0x59d957,_0x49bf81,_0x4e4022,_0x2b8111,_0xd4e4e1,_0x2a5161,_0x19b9f3){logger[_0x7757('0xd')](_0x7757('0xe'));var _0x1f434b=new Date();var _0x3a4458=[{'name':_0x7757('0xf'),'value':intUtil[_0x7757('0x10')](_0x4e4022[_0x7757('0x11')],_0x2b8111,'\x20')},{'name':'assigned_user_id','value':_0x59d957['id']},{'name':_0x7757('0x12'),'value':_0x59d957['id']},{'name':'description','value':intUtil[_0x7757('0x10')](_0x4e4022['Descriptions'],_0x2b8111,'\x0a')},{'name':_0x7757('0x13'),'value':_0x1f434b[_0x7757('0x14')]()['slice'](0x0,0x13)[_0x7757('0x15')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0x7757('0x16'),'value':'15'},{'name':_0x7757('0x17'),'value':_0x49bf81['id']},{'name':'parent_type','value':_0x7757('0x18')},{'name':_0x7757('0x19'),'value':_0x49bf81[_0x7757('0xf')]},{'name':'direction','value':_0x19b9f3}];if(_0xd4e4e1[_0x7757('0x1a')]){_[_0x7757('0x1b')](_0xd4e4e1,function(_0x16bec5){if(_0x2b8111[_0x16bec5['variableName']]){_0x3a4458[_0x7757('0x1c')]({'name':_0x16bec5['idField'],'value':_0x2b8111[_0x16bec5[_0x7757('0x1d')]]});}});}return request({'form':{'method':_0x7757('0x1e'),'input_type':_0x7757('0x1f'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x2a5161['id'],'module_name':'Calls','name_value_list':_0x3a4458})}});}function getAuth(_0x1eb030){return util['format']('Basic\x20%s',new Buffer(_0x1eb030[_0x7757('0x20')]+':X')[_0x7757('0x21')](_0x7757('0x22')));}function getServerInfo(_0x435444){return request({'form':{'method':_0x7757('0x23'),'input_type':_0x7757('0x1f'),'response_type':_0x7757('0x1f'),'rest_data':JSON[_0x7757('0x24')]({'session':_0x435444['id']})}});}function getUser(_0x2b0513,_0x35e7b5,_0x3655e3){if(!_[_0x7757('0x25')](_0x35e7b5)){logger[_0x7757('0xd')]('Getting\x20agent\x20with\x20name',_0x35e7b5);return request({'form':{'method':'get_entry_list','input_type':_0x7757('0x1f'),'response_type':'JSON','rest_data':JSON[_0x7757('0x24')]({'session':_0x3655e3['id'],'module_name':_0x7757('0x26'),'query':util['format'](_0x7757('0x27'),_0x35e7b5),'order_by':'','offset':'0','select_fields':['id',_0x7757('0xf'),_0x7757('0x28')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x1c22fb){if(_0x1c22fb[_0x7757('0x29')][_0x7757('0x1a')]){var _0x582ed2=_['find'](_0x1c22fb[_0x7757('0x29')],function(_0x2e5a35){return _0x2e5a35[_0x7757('0x2a')][_0x7757('0x28')][_0x7757('0x2b')]===_0x35e7b5;});if(_0x582ed2){logger['info'](_0x7757('0x2c'));return BPromise[_0x7757('0x2d')]({'id':_0x582ed2['name_value_list']['id'][_0x7757('0x2b')],'name':_0x582ed2[_0x7757('0x2a')][_0x7757('0xf')][_0x7757('0x2b')]});}}logger[_0x7757('0xd')](_0x7757('0x2e'));return BPromise[_0x7757('0x2d')]({'id':_0x3655e3['name_value_list'][_0x7757('0x2f')][_0x7757('0x2b')],'name':_0x3655e3['name_value_list'][_0x7757('0x28')][_0x7757('0x2b')]});});}else{logger[_0x7757('0xd')](_0x7757('0x30'));return BPromise[_0x7757('0x2d')]({'id':_0x3655e3[_0x7757('0x2a')][_0x7757('0x2f')][_0x7757('0x2b')],'name':_0x3655e3[_0x7757('0x2a')][_0x7757('0x28')][_0x7757('0x2b')]});}}function getEndUser(_0x330a7a,_0x59a3c2,_0x25a8bb,_0x4f33b8){logger[_0x7757('0xd')](_0x7757('0x31'),_0x25a8bb);return request({'form':{'method':_0x7757('0x32'),'input_type':'JSON','response_type':_0x7757('0x1f'),'rest_data':JSON[_0x7757('0x24')]({'session':_0x4f33b8['id'],'module_name':_0x7757('0x18'),'query':util[_0x7757('0x33')](_0x7757('0x34'),_0x25a8bb),'order_by':'','offset':'0','select_fields':['id',_0x7757('0xf'),_0x7757('0x35')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x7757('0x36')](function(_0x248137){if(_0x248137[_0x7757('0x29')][_0x7757('0x1a')]){var _0x72c9ad=_[_0x7757('0x37')](_0x248137['entry_list'],function(_0x2158de){return _0x2158de[_0x7757('0x2a')]['phone_home'][_0x7757('0x2b')]===_0x25a8bb;});if(_0x72c9ad){logger[_0x7757('0xd')](_0x7757('0x38'));return BPromise[_0x7757('0x2d')]({'id':_0x72c9ad['name_value_list']['id'][_0x7757('0x2b')],'name':_0x72c9ad[_0x7757('0x2a')][_0x7757('0xf')][_0x7757('0x2b')],'phone':_0x72c9ad[_0x7757('0x2a')][_0x7757('0x35')][_0x7757('0x2b')]});}}else{logger[_0x7757('0xd')](_0x7757('0x39'));return request({'form':{'method':'set_entry','input_type':_0x7757('0x1f'),'response_type':_0x7757('0x1f'),'rest_data':JSON[_0x7757('0x24')]({'session':_0x4f33b8['id'],'module_name':'Contacts','name_value_list':[{'name':_0x7757('0x3a'),'value':_0x59a3c2!==_0x7757('0x3b')?_0x59a3c2:util[_0x7757('0x33')](_0x7757('0x3c'),_0x25a8bb)},{'name':_0x7757('0x35'),'value':_0x25a8bb}]})}})[_0x7757('0x36')](function(_0x180a24){logger['info']('Enduser\x20created.');return BPromise['resolve']({'id':_0x180a24['id'],'name':_0x180a24[_0x7757('0x29')]['first_name'][_0x7757('0x2b')],'phone':_0x180a24[_0x7757('0x29')][_0x7757('0x35')][_0x7757('0x2b')]});});}});}function request(_0x42caa5){logger[_0x7757('0x3d')](_0x7757('0x3e'),JSON[_0x7757('0x24')](_0x42caa5));return rp(_[_0x7757('0x3f')](def,_0x42caa5));}function getTags(_0x40f727,_0x2a82c8){var _0x495bcd=[];if(_0x40f727&&_0x40f727['length']>0x0){_0x495bcd=_['map'](_0x40f727,_0x2a82c8);}return _0x495bcd;}function getCustomFields(_0x376d52,_0x2d2f47){var _0x5a07a2=[];var _0x4ec5da={'custom_fields':[]};if(_0x376d52[_0x7757('0x1a')]>0x0){_[_0x7757('0x1b')](_0x376d52,function(_0x1de342){if(_0x1de342[_0x7757('0x40')]==='string'&&_0x1de342[_0x7757('0x41')]&&!_0x1de342[_0x7757('0x42')]){_0x4ec5da[_0x1de342['nameField'][_0x7757('0x43')]()]=_0x1de342[_0x7757('0x44')][_0x7757('0x21')]();}else if(_0x1de342['type']===_0x7757('0x45')&&_0x1de342[_0x7757('0x46')]&&_0x1de342[_0x7757('0x42')]){_0x4ec5da[_0x7757('0x47')][_0x7757('0x1c')]({'id':_0x1de342[_0x7757('0x46')],'value':_0x1de342[_0x7757('0x44')]['toString']()});}else if(_0x1de342[_0x7757('0x40')]===_0x7757('0x48')&&_0x1de342['variableName']&&_0x1de342['idField']&&_0x1de342['customField']){_0x2d2f47[_0x1de342[_0x7757('0x1d')]]&&_0x4ec5da[_0x7757('0x47')][_0x7757('0x1c')]({'id':_0x1de342[_0x7757('0x46')],'value':_0x2d2f47[_0x1de342[_0x7757('0x1d')]][_0x7757('0x21')]()});}else if(_0x1de342['type']===_0x7757('0x49')&&_0x1de342[_0x7757('0x4a')]&&_0x1de342[_0x7757('0x4a')][_0x7757('0xf')]&&_0x1de342[_0x7757('0x46')]&&_0x1de342[_0x7757('0x42')]){_0x2d2f47[_0x1de342[_0x7757('0x4a')][_0x7757('0xf')][_0x7757('0x43')]()]&&_0x4ec5da[_0x7757('0x47')][_0x7757('0x1c')]({'id':_0x1de342['idField'],'value':_0x2d2f47[_0x1de342['Variable'][_0x7757('0xf')][_0x7757('0x43')]()][_0x7757('0x21')]()});}});}return _0x4ec5da;}function getConnection(_0x355900){return request({'method':_0x7757('0xc'),'form':{'method':'login','input_type':_0x7757('0x1f'),'response_type':_0x7757('0x1f'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x355900[_0x7757('0x4b')],'password':_0x355900[_0x7757('0x4c')],'encryption':_0x7757('0x4d')},'application':'xCALLY\x20Motion\x20integration'})}})['then'](function(_0x25527a){var _0x3793e1=_0x25527a;if(_0x3793e1['id']){def[_0x7757('0x4e')]=_0x3793e1['id'];return BPromise[_0x7757('0x2d')](_0x3793e1);}else{throw new Error(util['format'](_0x7757('0x4f'),_0x355900['id']));}});}function setRelationship(_0x1f849f,_0x12270b,_0x984152,_0x4779ca){return request({'form':{'method':_0x7757('0x50'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x7757('0x24')]({'session':_0x1f849f['id'],'module_name':_0x7757('0x51'),'module_id':_0x984152['id'],'link_field_name':_0x4779ca,'related_ids':[_0x12270b['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x7757('0x52')]=function(_0x6cb097,_0x6edc93,_0x4dcb65,_0x3970a0,_0x24b4c2,_0x24a024){var _0x106d6b,_0x26cf1f,_0xca1c6f,_0x374e5d;_0x24a024['remoteUri']=intUtil['stripTrailingSlash'](_0x24a024[_0x7757('0x53')]);_0x24a024[_0x7757('0x54')]=intUtil[_0x7757('0x55')](_0x24a024[_0x7757('0x54')]);def[_0x7757('0x56')]=util[_0x7757('0x33')](_0x7757('0x57'),_0x24a024[_0x7757('0x53')]);if(_0x24b4c2&&_0x24b4c2['monitor_format']){logger['info'](_0x7757('0x58'),'Recording\x20is\x20enabled!');_0x6edc93[_0x7757('0x59')]=util[_0x7757('0x33')](_0x7757('0x5a'),_0x24a024[_0x7757('0x54')],_0x6edc93['uniqueid'],md5(_0x6edc93[_0x7757('0x5b')]));}else{_0x6edc93[_0x7757('0x59')]='';}return getConnection(_0x24a024)[_0x7757('0x36')](function(_0x5d7831){_0x374e5d=_0x5d7831;return getUser(_0x24a024,_0x3970a0['name'],_0x374e5d);})['then'](function(_0xf616ef){_0x106d6b=_0xf616ef;logger[_0x7757('0xd')]('The\x20User\x20ID\x20is:',_0x106d6b['id']);return getEndUser(_0x24a024,_0x6edc93[_0x7757('0x5c')],_0x6edc93[_0x7757('0x5d')],_0x374e5d);})[_0x7757('0x36')](function(_0x44853c){_0x26cf1f=_0x44853c;logger[_0x7757('0xd')](_0x7757('0x5e'),_0x26cf1f['id']);return getTicket(_0x24a024,_0x106d6b,_0x26cf1f,_0x4dcb65,_0x6edc93,_0x4dcb65['Fields'],_0x374e5d,_0x7757('0x5f'));})[_0x7757('0x36')](function(_0x1821bc){_0xca1c6f=_0x1821bc;logger[_0x7757('0xd')](_0x7757('0x60'));logger[_0x7757('0xd')](_0x7757('0x61'),_0xca1c6f['id']);return setRelationship(_0x374e5d,_0x106d6b,_0xca1c6f,_0x7757('0x62'));})[_0x7757('0x36')](function(){return setRelationship(_0x374e5d,_0x26cf1f,_0xca1c6f,'contacts');})[_0x7757('0x36')](function(){return getServerInfo(_0x374e5d);})[_0x7757('0x36')](function(_0x151a07){var _0x453f08=parseInt(_0x151a07[_0x7757('0x63')][_0x7757('0x64')](0x0));var _0x5cf5cf=util[_0x7757('0x33')](_0x7757('0x65'),_0x24a024[_0x7757('0x53')],_0xca1c6f['id']);if(_0x453f08>0x6){_0x5cf5cf=util[_0x7757('0x33')](_0x7757('0x66'),_0x24a024[_0x7757('0x53')],_0xca1c6f['id']);}logger[_0x7757('0xd')](_0x7757('0x58'),_0x7757('0x67'));emit(util[_0x7757('0x33')](_0x7757('0x68'),_0x3970a0[_0x7757('0xf')]),_0x7757('0x69'),{'uri':_0x5cf5cf});})['catch'](function(_0xfaa5bc){logger[_0x7757('0x6a')](_0x7757('0x58'),JSON[_0x7757('0x24')](_0xfaa5bc));});};exports['outbound']=function(_0x16e2f6,_0x19a8e2,_0x2d0365,_0x24b056,_0x162530,_0x27c795,_0x38aad9){var _0x5d9891,_0x458b89,_0x4726bc,_0x51d96c;_0x27c795[_0x7757('0x53')]=intUtil[_0x7757('0x55')](_0x27c795[_0x7757('0x53')]);_0x27c795['serverUrl']=intUtil['stripTrailingSlash'](_0x27c795[_0x7757('0x54')]);def['uri']=util[_0x7757('0x33')](_0x7757('0x57'),_0x27c795[_0x7757('0x53')]);if(_0x38aad9&&_0x38aad9[_0x7757('0x6b')]&&_0x38aad9[_0x7757('0x6b')]!==_0x7757('0x6c')){logger[_0x7757('0xd')](_0x7757('0x6d'),_0x7757('0x6e'));_0x19a8e2[_0x7757('0x59')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x27c795[_0x7757('0x54')],_0x19a8e2[_0x7757('0x5b')],md5(_0x19a8e2['uniqueid']));}return getConnection(_0x27c795)['then'](function(_0x1f2ce9){_0x51d96c=_0x1f2ce9;return getUser(_0x27c795,_0x24b056[_0x7757('0xf')],_0x51d96c);})[_0x7757('0x36')](function(_0x3997cf){_0x5d9891=_0x3997cf;logger[_0x7757('0xd')]('The\x20User\x20ID\x20is:',_0x5d9891['id']);return getEndUser(_0x27c795,_0x19a8e2[_0x7757('0x6f')],_0x19a8e2[_0x7757('0x70')],_0x51d96c);})[_0x7757('0x36')](function(_0x327a9f){_0x458b89=_0x327a9f;logger[_0x7757('0xd')](_0x7757('0x5e'),_0x458b89['id']);return getTicket(_0x27c795,_0x5d9891,_0x458b89,_0x2d0365,_0x19a8e2,_0x2d0365[_0x7757('0x71')],_0x51d96c,_0x7757('0x72'));})[_0x7757('0x36')](function(_0x3060cc){_0x4726bc=_0x3060cc;logger['info']('Ticket\x20created!');logger[_0x7757('0xd')](_0x7757('0x61'),_0x4726bc['id']);return setRelationship(_0x51d96c,_0x5d9891,_0x4726bc,_0x7757('0x62'));})[_0x7757('0x36')](function(){return setRelationship(_0x51d96c,_0x458b89,_0x4726bc,_0x7757('0x73'));})['then'](function(){return getServerInfo(_0x51d96c);})['then'](function(_0x120bf9){var _0x165e05=parseInt(_0x120bf9[_0x7757('0x63')][_0x7757('0x64')](0x0));var _0x2f8cda=util[_0x7757('0x33')](_0x7757('0x65'),_0x27c795[_0x7757('0x53')],_0x4726bc['id']);if(_0x165e05>0x6){_0x2f8cda=util[_0x7757('0x33')](_0x7757('0x66'),_0x27c795[_0x7757('0x53')],_0x4726bc['id']);}logger[_0x7757('0xd')]('[OUTBOUND]',_0x7757('0x67'));emit(util[_0x7757('0x33')](_0x7757('0x68'),_0x24b056[_0x7757('0xf')]),_0x7757('0x69'),{'uri':_0x2f8cda});})[_0x7757('0x74')](function(_0x11218f){logger[_0x7757('0x6a')](_0x7757('0x6d'),JSON[_0x7757('0x24')](_0x11218f));});};exports[_0x7757('0x75')]=function(_0x22c347,_0x587831,_0x1609be,_0x55dd7c,_0x1468eb,_0x439b5c){var _0x454084,_0x239581,_0x3f79b0,_0x3cd641;_0x439b5c[_0x7757('0x53')]=intUtil[_0x7757('0x55')](_0x439b5c[_0x7757('0x53')]);_0x439b5c[_0x7757('0x54')]=intUtil[_0x7757('0x55')](_0x439b5c[_0x7757('0x54')]);def[_0x7757('0x56')]=util[_0x7757('0x33')]('%s/service/v4_1/rest.php',_0x439b5c[_0x7757('0x53')]);if(_0x1468eb&&_0x1468eb[_0x7757('0x76')]){logger['info']('['+_0x587831[_0x7757('0x77')][_0x7757('0x78')]()+']',_0x7757('0x6e'));_0x587831['recordingURL']=util[_0x7757('0x33')](_0x7757('0x5a'),_0x439b5c['serverUrl'],_0x587831[_0x7757('0x5b')],md5(_0x587831[_0x7757('0x5b')]));}else{_0x587831['recordingURL']='';}return getConnection(_0x439b5c)['then'](function(_0x284ebb){_0x3cd641=_0x284ebb;if(!_[_0x7757('0x25')](_0x55dd7c)){return getUser(_0x439b5c,_0x55dd7c[_0x7757('0xf')],_0x3cd641);}else{return getUser(_0x439b5c,null,_0x3cd641);}})[_0x7757('0x36')](function(_0xe0bea2){_0x454084=_0xe0bea2;logger[_0x7757('0xd')](_0x7757('0x79'),_0x454084['id']);return getEndUser(_0x439b5c,_0x587831[_0x7757('0x5c')],_0x587831[_0x7757('0x5d')],_0x3cd641);})[_0x7757('0x36')](function(_0x222a8c){_0x239581=_0x222a8c;logger[_0x7757('0xd')](_0x7757('0x5e'),_0x239581['id']);return getTicket(_0x439b5c,_0x454084,_0x239581,_0x1609be,_0x587831,_0x1609be[_0x7757('0x71')],_0x3cd641,_0x7757('0x5f'));})[_0x7757('0x36')](function(_0x6abb8b){_0x3f79b0=_0x6abb8b;logger[_0x7757('0xd')](_0x7757('0x60'));logger[_0x7757('0xd')]('The\x20Ticket\x20ID\x20is:',_0x3f79b0['id']);return setRelationship(_0x3cd641,_0x454084,_0x3f79b0,_0x7757('0x62'));})[_0x7757('0x36')](function(){return setRelationship(_0x3cd641,_0x239581,_0x3f79b0,_0x7757('0x73'));})[_0x7757('0x36')](function(){return getServerInfo(_0x3cd641);})[_0x7757('0x74')](function(_0xe8c9f0){logger[_0x7757('0x6a')]('['+_0x587831[_0x7757('0x77')][_0x7757('0x78')]()+']',JSON[_0x7757('0x24')](_0xe8c9f0));});}; \ No newline at end of file +var _0x80ca=['JSON','stringify','format','apiKey','toString','Getting\x20agent\x20with\x20name','get_entry_list','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','name_value_list','info','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','value','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','resolve','Searching\x20enduser\x20with\x20phone','phone_home','find','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','set_entry','first_name','','Caller\x20-\x20%s','debug','[HTTP]','merge','map','type','string','nameField','toLowerCase','content','idField','customField','custom_fields','customVariable','Variable','POST','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','Calls','queue','remoteUri','serverUrl','stripTrailingSlash','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','users','version','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','uri','recordingFormat','none','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Outbound','contacts','charAt','[OUTBOUND]','error','unmanaged','toUpperCase','isNil','Inbound','The\x20Ticket\x20ID\x20is:','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','emit','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','description','date_start','toISOString','slice','duration_hours','Contacts','parent_name','length','forEach','variableName','push'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x80ca,0x153));var _0xa80c=function(_0xe9ab7a,_0x53ef34){_0xe9ab7a=_0xe9ab7a-0x0;var _0x14956b=_0x80ca[_0xe9ab7a];return _0x14956b;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0xa80c('0x0'));var md5=require(_0xa80c('0x1'));var util=require(_0xa80c('0x2'));var Redis=require(_0xa80c('0x3'));var intUtil=require(_0xa80c('0x4'));var config=require(_0xa80c('0x5'));var logger=require(_0xa80c('0x6'))(_0xa80c('0x7'));config[_0xa80c('0x8')]=_[_0xa80c('0x9')](config['redis'],{'host':_0xa80c('0xa'),'port':0x18eb});var io=require(_0xa80c('0xb'))(new Redis(config['redis']));var def={'method':'POST','json':!![]};function emit(_0x2e44bb,_0xbae1a8,_0x5301e4){io['to'](_0x2e44bb)[_0xa80c('0xc')](_0xbae1a8,_0x5301e4);}function getTicket(_0x2ab8bc,_0x5c266c,_0x10a01f,_0x166ff3,_0x38ac9b,_0x399ed1,_0x10825e,_0x1ab4ea){logger['info'](_0xa80c('0xd'));var _0xfafc25=new Date();var _0x387624=[{'name':_0xa80c('0xe'),'value':intUtil[_0xa80c('0xf')](_0x166ff3[_0xa80c('0x10')],_0x38ac9b,'\x20')},{'name':_0xa80c('0x11'),'value':_0x5c266c['id']},{'name':_0xa80c('0x12'),'value':_0x5c266c['id']},{'name':_0xa80c('0x13'),'value':intUtil[_0xa80c('0xf')](_0x166ff3['Descriptions'],_0x38ac9b,'\x0a')},{'name':_0xa80c('0x14'),'value':_0xfafc25[_0xa80c('0x15')]()[_0xa80c('0x16')](0x0,0x13)['replace']('T','\x20')},{'name':_0xa80c('0x17'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':'parent_id','value':_0x10a01f['id']},{'name':'parent_type','value':_0xa80c('0x18')},{'name':_0xa80c('0x19'),'value':_0x10a01f[_0xa80c('0xe')]},{'name':'direction','value':_0x1ab4ea}];if(_0x399ed1[_0xa80c('0x1a')]){_[_0xa80c('0x1b')](_0x399ed1,function(_0x5f4c30){if(_0x38ac9b[_0x5f4c30[_0xa80c('0x1c')]]){_0x387624[_0xa80c('0x1d')]({'name':_0x5f4c30['idField'],'value':_0x38ac9b[_0x5f4c30[_0xa80c('0x1c')]]});}});}return request({'form':{'method':'set_entry','input_type':_0xa80c('0x1e'),'response_type':_0xa80c('0x1e'),'rest_data':JSON[_0xa80c('0x1f')]({'session':_0x10825e['id'],'module_name':'Calls','name_value_list':_0x387624})}});}function getAuth(_0x5635b1){return util[_0xa80c('0x20')]('Basic\x20%s',new Buffer(_0x5635b1[_0xa80c('0x21')]+':X')[_0xa80c('0x22')]('base64'));}function getServerInfo(_0x4382c8){return request({'form':{'method':'get_server_info','input_type':_0xa80c('0x1e'),'response_type':'JSON','rest_data':JSON[_0xa80c('0x1f')]({'session':_0x4382c8['id']})}});}function getUser(_0x2fdd03,_0x3bc122,_0x247b3b){if(!_['isNil'](_0x3bc122)){logger['info'](_0xa80c('0x23'),_0x3bc122);return request({'form':{'method':_0xa80c('0x24'),'input_type':'JSON','response_type':_0xa80c('0x1e'),'rest_data':JSON[_0xa80c('0x1f')]({'session':_0x247b3b['id'],'module_name':'Employees','query':util[_0xa80c('0x20')](_0xa80c('0x25'),_0x3bc122),'order_by':'','offset':'0','select_fields':['id','name',_0xa80c('0x26')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xa80c('0x27')](function(_0x42af46){if(_0x42af46['entry_list'][_0xa80c('0x1a')]){var _0x404b6e=_['find'](_0x42af46[_0xa80c('0x28')],function(_0x5603b2){return _0x5603b2[_0xa80c('0x29')][_0xa80c('0x26')]['value']===_0x3bc122;});if(_0x404b6e){logger[_0xa80c('0x2a')](_0xa80c('0x2b'));return BPromise['resolve']({'id':_0x404b6e[_0xa80c('0x29')]['id']['value'],'name':_0x404b6e['name_value_list'][_0xa80c('0xe')]['value']});}}logger[_0xa80c('0x2a')](_0xa80c('0x2c'));return BPromise['resolve']({'id':_0x247b3b[_0xa80c('0x29')][_0xa80c('0x2d')]['value'],'name':_0x247b3b[_0xa80c('0x29')][_0xa80c('0x26')][_0xa80c('0x2e')]});});}else{logger[_0xa80c('0x2a')](_0xa80c('0x2f'));return BPromise[_0xa80c('0x30')]({'id':_0x247b3b['name_value_list'][_0xa80c('0x2d')][_0xa80c('0x2e')],'name':_0x247b3b[_0xa80c('0x29')]['user_name'][_0xa80c('0x2e')]});}}function getEndUser(_0x291f26,_0x7505d0,_0x1ade3b,_0x249bc8){logger[_0xa80c('0x2a')](_0xa80c('0x31'),_0x1ade3b);return request({'form':{'method':_0xa80c('0x24'),'input_type':_0xa80c('0x1e'),'response_type':_0xa80c('0x1e'),'rest_data':JSON[_0xa80c('0x1f')]({'session':_0x249bc8['id'],'module_name':_0xa80c('0x18'),'query':util[_0xa80c('0x20')]('contacts.phone_home\x20=\x20\x22%s\x22',_0x1ade3b),'order_by':'','offset':'0','select_fields':['id',_0xa80c('0xe'),_0xa80c('0x32')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xa80c('0x27')](function(_0x2ab2f0){if(_0x2ab2f0[_0xa80c('0x28')][_0xa80c('0x1a')]){var _0x211288=_[_0xa80c('0x33')](_0x2ab2f0[_0xa80c('0x28')],function(_0x15b6ee){return _0x15b6ee['name_value_list']['phone_home']['value']===_0x1ade3b;});if(_0x211288){logger[_0xa80c('0x2a')](_0xa80c('0x34'));return BPromise[_0xa80c('0x30')]({'id':_0x211288[_0xa80c('0x29')]['id'][_0xa80c('0x2e')],'name':_0x211288[_0xa80c('0x29')][_0xa80c('0xe')][_0xa80c('0x2e')],'phone':_0x211288[_0xa80c('0x29')][_0xa80c('0x32')]['value']});}}else{logger[_0xa80c('0x2a')](_0xa80c('0x35'));return request({'form':{'method':_0xa80c('0x36'),'input_type':_0xa80c('0x1e'),'response_type':_0xa80c('0x1e'),'rest_data':JSON[_0xa80c('0x1f')]({'session':_0x249bc8['id'],'module_name':_0xa80c('0x18'),'name_value_list':[{'name':_0xa80c('0x37'),'value':_0x7505d0!==_0xa80c('0x38')?_0x7505d0:util[_0xa80c('0x20')](_0xa80c('0x39'),_0x1ade3b)},{'name':_0xa80c('0x32'),'value':_0x1ade3b}]})}})['then'](function(_0x2a752c){logger['info']('Enduser\x20created.');return BPromise[_0xa80c('0x30')]({'id':_0x2a752c['id'],'name':_0x2a752c[_0xa80c('0x28')][_0xa80c('0x37')][_0xa80c('0x2e')],'phone':_0x2a752c[_0xa80c('0x28')][_0xa80c('0x32')][_0xa80c('0x2e')]});});}});}function request(_0x410c68){logger[_0xa80c('0x3a')](_0xa80c('0x3b'),JSON[_0xa80c('0x1f')](_0x410c68));return rp(_[_0xa80c('0x3c')](def,_0x410c68));}function getTags(_0x2b9652,_0x564513){var _0x34764d=[];if(_0x2b9652&&_0x2b9652[_0xa80c('0x1a')]>0x0){_0x34764d=_[_0xa80c('0x3d')](_0x2b9652,_0x564513);}return _0x34764d;}function getCustomFields(_0x4cd260,_0x3305f9){var _0x3ab465=[];var _0x135a9a={'custom_fields':[]};if(_0x4cd260[_0xa80c('0x1a')]>0x0){_[_0xa80c('0x1b')](_0x4cd260,function(_0x2ea034){if(_0x2ea034[_0xa80c('0x3e')]===_0xa80c('0x3f')&&_0x2ea034['nameField']&&!_0x2ea034['customField']){_0x135a9a[_0x2ea034[_0xa80c('0x40')][_0xa80c('0x41')]()]=_0x2ea034[_0xa80c('0x42')][_0xa80c('0x22')]();}else if(_0x2ea034[_0xa80c('0x3e')]===_0xa80c('0x3f')&&_0x2ea034[_0xa80c('0x43')]&&_0x2ea034[_0xa80c('0x44')]){_0x135a9a[_0xa80c('0x45')]['push']({'id':_0x2ea034[_0xa80c('0x43')],'value':_0x2ea034[_0xa80c('0x42')]['toString']()});}else if(_0x2ea034[_0xa80c('0x3e')]==='variable'&&_0x2ea034['variableName']&&_0x2ea034['idField']&&_0x2ea034[_0xa80c('0x44')]){_0x3305f9[_0x2ea034[_0xa80c('0x1c')]]&&_0x135a9a[_0xa80c('0x45')][_0xa80c('0x1d')]({'id':_0x2ea034[_0xa80c('0x43')],'value':_0x3305f9[_0x2ea034['variableName']]['toString']()});}else if(_0x2ea034['type']===_0xa80c('0x46')&&_0x2ea034[_0xa80c('0x47')]&&_0x2ea034[_0xa80c('0x47')]['name']&&_0x2ea034[_0xa80c('0x43')]&&_0x2ea034['customField']){_0x3305f9[_0x2ea034['Variable'][_0xa80c('0xe')][_0xa80c('0x41')]()]&&_0x135a9a['custom_fields'][_0xa80c('0x1d')]({'id':_0x2ea034[_0xa80c('0x43')],'value':_0x3305f9[_0x2ea034[_0xa80c('0x47')][_0xa80c('0xe')][_0xa80c('0x41')]()][_0xa80c('0x22')]()});}});}return _0x135a9a;}function getConnection(_0x8f35d7){return request({'method':_0xa80c('0x48'),'form':{'method':_0xa80c('0x49'),'input_type':_0xa80c('0x1e'),'response_type':_0xa80c('0x1e'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x8f35d7[_0xa80c('0x4a')],'password':_0x8f35d7[_0xa80c('0x4b')],'encryption':_0xa80c('0x4c')},'application':_0xa80c('0x4d')})}})['then'](function(_0x52408d){var _0x403e0b=_0x52408d;if(_0x403e0b['id']){def[_0xa80c('0x4e')]=_0x403e0b['id'];return BPromise[_0xa80c('0x30')](_0x403e0b);}else{throw new Error(util[_0xa80c('0x20')](_0xa80c('0x4f'),_0x8f35d7['id']));}});}function setRelationship(_0x3de9c9,_0x544ef1,_0x2f054e,_0x1bdd7b){return request({'form':{'method':_0xa80c('0x50'),'input_type':_0xa80c('0x1e'),'response_type':_0xa80c('0x1e'),'rest_data':JSON[_0xa80c('0x1f')]({'session':_0x3de9c9['id'],'module_name':_0xa80c('0x51'),'module_id':_0x2f054e['id'],'link_field_name':_0x1bdd7b,'related_ids':[_0x544ef1['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xa80c('0x52')]=function(_0x5201b5,_0x28bed1,_0x2891c5,_0x15a0ee,_0x29aa79,_0x2b6b3d){var _0x3d7691,_0x22f8c3,_0x9ead89,_0x289bc6;_0x2b6b3d['remoteUri']=intUtil['stripTrailingSlash'](_0x2b6b3d[_0xa80c('0x53')]);_0x2b6b3d[_0xa80c('0x54')]=intUtil[_0xa80c('0x55')](_0x2b6b3d['serverUrl']);def['uri']=util[_0xa80c('0x20')](_0xa80c('0x56'),_0x2b6b3d['remoteUri']);if(_0x29aa79&&_0x29aa79[_0xa80c('0x57')]){logger['info'](_0xa80c('0x58'),'Recording\x20is\x20enabled!');_0x28bed1[_0xa80c('0x59')]=util[_0xa80c('0x20')](_0xa80c('0x5a'),_0x2b6b3d[_0xa80c('0x54')],_0x28bed1['uniqueid'],md5(_0x28bed1[_0xa80c('0x5b')]));}else{_0x28bed1[_0xa80c('0x59')]='';}return getConnection(_0x2b6b3d)['then'](function(_0x2f285a){_0x289bc6=_0x2f285a;return getUser(_0x2b6b3d,_0x15a0ee[_0xa80c('0xe')],_0x289bc6);})['then'](function(_0x1cd98e){_0x3d7691=_0x1cd98e;logger[_0xa80c('0x2a')](_0xa80c('0x5c'),_0x3d7691['id']);return getEndUser(_0x2b6b3d,_0x28bed1[_0xa80c('0x5d')],_0x28bed1[_0xa80c('0x5e')],_0x289bc6);})[_0xa80c('0x27')](function(_0x55f1d2){_0x22f8c3=_0x55f1d2;logger['info'](_0xa80c('0x5f'),_0x22f8c3['id']);return getTicket(_0x2b6b3d,_0x3d7691,_0x22f8c3,_0x2891c5,_0x28bed1,_0x2891c5[_0xa80c('0x60')],_0x289bc6,'Inbound');})['then'](function(_0x462854){_0x9ead89=_0x462854;logger['info'](_0xa80c('0x61'));logger[_0xa80c('0x2a')]('The\x20Ticket\x20ID\x20is:',_0x9ead89['id']);return setRelationship(_0x289bc6,_0x3d7691,_0x9ead89,_0xa80c('0x62'));})[_0xa80c('0x27')](function(){return setRelationship(_0x289bc6,_0x22f8c3,_0x9ead89,'contacts');})[_0xa80c('0x27')](function(){return getServerInfo(_0x289bc6);})[_0xa80c('0x27')](function(_0x2640fd){var _0x2c8101=parseInt(_0x2640fd[_0xa80c('0x63')]['charAt'](0x0));var _0x19dac2=util['format'](_0xa80c('0x64'),_0x2b6b3d[_0xa80c('0x53')],_0x9ead89['id']);if(_0x2c8101>0x6){_0x19dac2=util[_0xa80c('0x20')](_0xa80c('0x65'),_0x2b6b3d[_0xa80c('0x53')],_0x9ead89['id']);}logger[_0xa80c('0x2a')]('[QUEUE]',_0xa80c('0x66'));emit(util[_0xa80c('0x20')](_0xa80c('0x67'),_0x15a0ee['name']),_0xa80c('0x68'),{'uri':_0x19dac2});})[_0xa80c('0x69')](function(_0x2eb0b2){logger['error']('[QUEUE]',JSON[_0xa80c('0x1f')](_0x2eb0b2));});};exports['outbound']=function(_0x5dc50f,_0x2bce3d,_0x137ea0,_0x414a37,_0xecf3ef,_0x1e3a65,_0x285d75){var _0x1eda6f,_0x17ea99,_0x5aec10,_0x5bb726;_0x1e3a65['remoteUri']=intUtil[_0xa80c('0x55')](_0x1e3a65['remoteUri']);_0x1e3a65[_0xa80c('0x54')]=intUtil[_0xa80c('0x55')](_0x1e3a65[_0xa80c('0x54')]);def[_0xa80c('0x6a')]=util[_0xa80c('0x20')]('%s/service/v4_1/rest.php',_0x1e3a65['remoteUri']);if(_0x285d75&&_0x285d75[_0xa80c('0x6b')]&&_0x285d75['recordingFormat']!==_0xa80c('0x6c')){logger[_0xa80c('0x2a')]('[OUTBOUND]',_0xa80c('0x6d'));_0x2bce3d[_0xa80c('0x59')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1e3a65[_0xa80c('0x54')],_0x2bce3d['uniqueid'],md5(_0x2bce3d[_0xa80c('0x5b')]));}return getConnection(_0x1e3a65)[_0xa80c('0x27')](function(_0x4bef47){_0x5bb726=_0x4bef47;return getUser(_0x1e3a65,_0x414a37[_0xa80c('0xe')],_0x5bb726);})[_0xa80c('0x27')](function(_0x2949eb){_0x1eda6f=_0x2949eb;logger['info'](_0xa80c('0x5c'),_0x1eda6f['id']);return getEndUser(_0x1e3a65,_0x2bce3d[_0xa80c('0x6e')],_0x2bce3d[_0xa80c('0x6f')],_0x5bb726);})[_0xa80c('0x27')](function(_0x4e4d64){_0x17ea99=_0x4e4d64;logger[_0xa80c('0x2a')]('The\x20Enduser\x20ID\x20is:',_0x17ea99['id']);return getTicket(_0x1e3a65,_0x1eda6f,_0x17ea99,_0x137ea0,_0x2bce3d,_0x137ea0['Fields'],_0x5bb726,_0xa80c('0x70'));})[_0xa80c('0x27')](function(_0x4fcb9b){_0x5aec10=_0x4fcb9b;logger[_0xa80c('0x2a')](_0xa80c('0x61'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x5aec10['id']);return setRelationship(_0x5bb726,_0x1eda6f,_0x5aec10,_0xa80c('0x62'));})[_0xa80c('0x27')](function(){return setRelationship(_0x5bb726,_0x17ea99,_0x5aec10,_0xa80c('0x71'));})['then'](function(){return getServerInfo(_0x5bb726);})[_0xa80c('0x27')](function(_0x308e44){var _0x48676e=parseInt(_0x308e44[_0xa80c('0x63')][_0xa80c('0x72')](0x0));var _0x4cc242=util[_0xa80c('0x20')](_0xa80c('0x64'),_0x1e3a65['remoteUri'],_0x5aec10['id']);if(_0x48676e>0x6){_0x4cc242=util['format']('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x1e3a65['remoteUri'],_0x5aec10['id']);}logger[_0xa80c('0x2a')](_0xa80c('0x73'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xa80c('0x20')](_0xa80c('0x67'),_0x414a37[_0xa80c('0xe')]),'trigger:browser:url',{'uri':_0x4cc242});})[_0xa80c('0x69')](function(_0x2da9ca){logger[_0xa80c('0x74')](_0xa80c('0x73'),JSON[_0xa80c('0x1f')](_0x2da9ca));});};exports[_0xa80c('0x75')]=function(_0x365806,_0x2613cc,_0x33eefc,_0x7a3f6b,_0x1cfa0d,_0x2f1aaa){var _0x507046,_0xee267c,_0x4b196f,_0x2a4340;_0x2f1aaa[_0xa80c('0x53')]=intUtil[_0xa80c('0x55')](_0x2f1aaa[_0xa80c('0x53')]);_0x2f1aaa['serverUrl']=intUtil[_0xa80c('0x55')](_0x2f1aaa[_0xa80c('0x54')]);def['uri']=util[_0xa80c('0x20')](_0xa80c('0x56'),_0x2f1aaa[_0xa80c('0x53')]);if(_0x1cfa0d&&_0x1cfa0d[_0xa80c('0x57')]){logger[_0xa80c('0x2a')]('['+_0x2613cc['lastevent'][_0xa80c('0x76')]()+']',_0xa80c('0x6d'));_0x2613cc['recordingURL']=util[_0xa80c('0x20')](_0xa80c('0x5a'),_0x2f1aaa[_0xa80c('0x54')],_0x2613cc['uniqueid'],md5(_0x2613cc['uniqueid']));}else{_0x2613cc[_0xa80c('0x59')]='';}return getConnection(_0x2f1aaa)[_0xa80c('0x27')](function(_0x664ba3){_0x2a4340=_0x664ba3;if(!_[_0xa80c('0x77')](_0x7a3f6b)){return getUser(_0x2f1aaa,_0x7a3f6b['name'],_0x2a4340);}else{return getUser(_0x2f1aaa,null,_0x2a4340);}})[_0xa80c('0x27')](function(_0x564374){_0x507046=_0x564374;logger[_0xa80c('0x2a')](_0xa80c('0x5c'),_0x507046['id']);return getEndUser(_0x2f1aaa,_0x2613cc[_0xa80c('0x5d')],_0x2613cc[_0xa80c('0x5e')],_0x2a4340);})[_0xa80c('0x27')](function(_0x3f24d3){_0xee267c=_0x3f24d3;logger[_0xa80c('0x2a')](_0xa80c('0x5f'),_0xee267c['id']);return getTicket(_0x2f1aaa,_0x507046,_0xee267c,_0x33eefc,_0x2613cc,_0x33eefc[_0xa80c('0x60')],_0x2a4340,_0xa80c('0x78'));})['then'](function(_0x46cc88){_0x4b196f=_0x46cc88;logger[_0xa80c('0x2a')](_0xa80c('0x61'));logger[_0xa80c('0x2a')](_0xa80c('0x79'),_0x4b196f['id']);return setRelationship(_0x2a4340,_0x507046,_0x4b196f,_0xa80c('0x62'));})['then'](function(){return setRelationship(_0x2a4340,_0xee267c,_0x4b196f,_0xa80c('0x71'));})[_0xa80c('0x27')](function(){return getServerInfo(_0x2a4340);})[_0xa80c('0x69')](function(_0x44d017){logger[_0xa80c('0x74')]('['+_0x2613cc[_0xa80c('0x7a')]['toUpperCase']()+']',JSON[_0xa80c('0x1f')](_0x44d017));});}; \ 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 cd35644..13be923 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 _0xdd07=['content','variable','variableName','customVariable','Variable','name','toLowerCase','toString','keyType','format','%s:\x20%s','key','keyContent','join','slice','substring','lastIndexOf','isNil','lodash','util','sortBy','length','type','string','push'];(function(_0x403af9,_0x11d485){var _0x27e253=function(_0x155d6d){while(--_0x155d6d){_0x403af9['push'](_0x403af9['shift']());}};_0x27e253(++_0x11d485);}(_0xdd07,0x76));var _0x7dd0=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0xdd07[_0x6cf19c];return _0xce14f3;};'use strict';var _=require(_0x7dd0('0x0'));var util=require(_0x7dd0('0x1'));exports['getString']=function(_0x534705,_0x1265ff,_0x3ac6a6){var _0x424624=[];if(_0x534705['length']>0x0){var _0x4d2d70=_[_0x7dd0('0x2')](_0x534705,['id']);for(var _0xbf7718=0x0;_0xbf7718<_0x4d2d70[_0x7dd0('0x3')];_0xbf7718++){var _0x38039f=_0x4d2d70[_0xbf7718];if(_0x38039f[_0x7dd0('0x4')]===_0x7dd0('0x5')){_0x424624[_0x7dd0('0x6')](_0x38039f[_0x7dd0('0x7')]);}else if(_0x38039f[_0x7dd0('0x4')]===_0x7dd0('0x8')&&_0x38039f[_0x7dd0('0x9')]){_0x1265ff[_0x38039f[_0x7dd0('0x9')]]&&_0x424624['push'](_0x1265ff[_0x38039f[_0x7dd0('0x9')]]['toString']());}else if(_0x38039f[_0x7dd0('0x4')]===_0x7dd0('0xa')&&_0x38039f[_0x7dd0('0xb')]&&_0x38039f[_0x7dd0('0xb')]['name']){_0x1265ff[_0x38039f[_0x7dd0('0xb')][_0x7dd0('0xc')]['toLowerCase']()]&&_0x424624[_0x7dd0('0x6')](_0x1265ff[_0x38039f[_0x7dd0('0xb')]['name'][_0x7dd0('0xd')]()][_0x7dd0('0xe')]());}else if(_0x38039f[_0x7dd0('0x4')]==='keyValue'){if(_0x38039f[_0x7dd0('0xf')]==='string'&&_0x38039f['key']){_0x424624[_0x7dd0('0x6')](util[_0x7dd0('0x10')](_0x7dd0('0x11'),_0x38039f[_0x7dd0('0x12')],_0x38039f[_0x7dd0('0x13')]));}else if(_0x38039f[_0x7dd0('0xf')]===_0x7dd0('0x8')&&_0x38039f[_0x7dd0('0x9')]&&_0x38039f[_0x7dd0('0x12')]){_0x1265ff[_0x38039f[_0x7dd0('0x9')]]&&_0x424624[_0x7dd0('0x6')](util[_0x7dd0('0x10')]('%s:\x20%s',_0x38039f[_0x7dd0('0x12')],_0x1265ff[_0x38039f[_0x7dd0('0x9')]]));}else if(_0x38039f[_0x7dd0('0xf')]===_0x7dd0('0xa')&&_0x38039f['Variable']&&_0x38039f[_0x7dd0('0xb')][_0x7dd0('0xc')]&&_0x38039f[_0x7dd0('0x12')]){_0x1265ff[_0x38039f['Variable'][_0x7dd0('0xc')][_0x7dd0('0xd')]()]&&_0x424624['push'](util[_0x7dd0('0x10')](_0x7dd0('0x11'),_0x38039f[_0x7dd0('0x12')],_0x1265ff[_0x38039f[_0x7dd0('0xb')][_0x7dd0('0xc')][_0x7dd0('0xd')]()]));}}}}return _0x424624[_0x7dd0('0x14')](_0x3ac6a6);};exports['stripTrailingSlash']=function(_0xd11363){var _0x49eeba=_0xd11363[_0x7dd0('0x15')](-0x1);if(_0x49eeba==='/'){_0xd11363=_0xd11363[_0x7dd0('0x16')](0x0,_0xd11363[_0x7dd0('0x17')](_0x49eeba));}return _0xd11363;};exports['validateEmail']=function(_0x4727f9){if(!_[_0x7dd0('0x18')](_0x4727f9)&&_0x4727f9!==''){var _0x184b53=/^(([^<>()\[\]\\.,;:\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 _0x184b53['test'](String(_0x4727f9)['toLowerCase']());}else{return![];}}; \ No newline at end of file +var _0xd6b3=['type','string','content','variable','variableName','toString','Variable','name','toLowerCase','push','keyType','key','format','keyContent','%s:\x20%s','customVariable','join','stripTrailingSlash','slice','substring','validateEmail','isNil','lodash','util','sortBy'];(function(_0x3c58d1,_0x150f6e){var _0x5e46e7=function(_0x432419){while(--_0x432419){_0x3c58d1['push'](_0x3c58d1['shift']());}};_0x5e46e7(++_0x150f6e);}(_0xd6b3,0x174));var _0x3d6b=function(_0x51970a,_0x5ab3b7){_0x51970a=_0x51970a-0x0;var _0x3e7380=_0xd6b3[_0x51970a];return _0x3e7380;};'use strict';var _=require(_0x3d6b('0x0'));var util=require(_0x3d6b('0x1'));exports['getString']=function(_0x46de11,_0x4f3960,_0x437c97){var _0x448d90=[];if(_0x46de11['length']>0x0){var _0x530bae=_[_0x3d6b('0x2')](_0x46de11,['id']);for(var _0x245477=0x0;_0x245477<_0x530bae['length'];_0x245477++){var _0x21aa6e=_0x530bae[_0x245477];if(_0x21aa6e[_0x3d6b('0x3')]===_0x3d6b('0x4')){_0x448d90['push'](_0x21aa6e[_0x3d6b('0x5')]);}else if(_0x21aa6e[_0x3d6b('0x3')]===_0x3d6b('0x6')&&_0x21aa6e[_0x3d6b('0x7')]){_0x4f3960[_0x21aa6e[_0x3d6b('0x7')]]&&_0x448d90['push'](_0x4f3960[_0x21aa6e[_0x3d6b('0x7')]][_0x3d6b('0x8')]());}else if(_0x21aa6e[_0x3d6b('0x3')]==='customVariable'&&_0x21aa6e[_0x3d6b('0x9')]&&_0x21aa6e[_0x3d6b('0x9')][_0x3d6b('0xa')]){_0x4f3960[_0x21aa6e[_0x3d6b('0x9')][_0x3d6b('0xa')][_0x3d6b('0xb')]()]&&_0x448d90[_0x3d6b('0xc')](_0x4f3960[_0x21aa6e['Variable'][_0x3d6b('0xa')][_0x3d6b('0xb')]()]['toString']());}else if(_0x21aa6e[_0x3d6b('0x3')]==='keyValue'){if(_0x21aa6e[_0x3d6b('0xd')]===_0x3d6b('0x4')&&_0x21aa6e[_0x3d6b('0xe')]){_0x448d90[_0x3d6b('0xc')](util[_0x3d6b('0xf')]('%s:\x20%s',_0x21aa6e[_0x3d6b('0xe')],_0x21aa6e[_0x3d6b('0x10')]));}else if(_0x21aa6e[_0x3d6b('0xd')]==='variable'&&_0x21aa6e[_0x3d6b('0x7')]&&_0x21aa6e[_0x3d6b('0xe')]){_0x4f3960[_0x21aa6e[_0x3d6b('0x7')]]&&_0x448d90[_0x3d6b('0xc')](util[_0x3d6b('0xf')](_0x3d6b('0x11'),_0x21aa6e[_0x3d6b('0xe')],_0x4f3960[_0x21aa6e[_0x3d6b('0x7')]]));}else if(_0x21aa6e[_0x3d6b('0xd')]===_0x3d6b('0x12')&&_0x21aa6e[_0x3d6b('0x9')]&&_0x21aa6e[_0x3d6b('0x9')][_0x3d6b('0xa')]&&_0x21aa6e[_0x3d6b('0xe')]){_0x4f3960[_0x21aa6e[_0x3d6b('0x9')][_0x3d6b('0xa')][_0x3d6b('0xb')]()]&&_0x448d90[_0x3d6b('0xc')](util['format']('%s:\x20%s',_0x21aa6e[_0x3d6b('0xe')],_0x4f3960[_0x21aa6e[_0x3d6b('0x9')]['name'][_0x3d6b('0xb')]()]));}}}}return _0x448d90[_0x3d6b('0x13')](_0x437c97);};exports[_0x3d6b('0x14')]=function(_0x278cd8){var _0x3bad07=_0x278cd8[_0x3d6b('0x15')](-0x1);if(_0x3bad07==='/'){_0x278cd8=_0x278cd8[_0x3d6b('0x16')](0x0,_0x278cd8['lastIndexOf'](_0x3bad07));}return _0x278cd8;};exports[_0x3d6b('0x17')]=function(_0x28c597){if(!_[_0x3d6b('0x18')](_0x28c597)&&_0x28c597!==''){var _0x277a2f=/^(([^<>()\[\]\\.,;:\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 _0x277a2f['test'](String(_0x28c597)[_0x3d6b('0xb')]());}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 96344e9..9274eb6 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0x4a68c8,_0x3b024d){var _0x37f3bd=function(_0x4f1082){while(--_0x4f1082){_0x4a68c8['push'](_0x4a68c8['shift']());}};_0x37f3bd(++_0x3b024d);}(_0x9c44,0x178));var _0x49c4=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x9c44[_0x5f1391];return _0x50ebe3;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});}; \ No newline at end of file +var _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(_0x55e11c,_0x463a84){var _0xf006c5=function(_0x393902){while(--_0x393902){_0x55e11c['push'](_0x55e11c['shift']());}};_0xf006c5(++_0x463a84);}(_0xe706,0xa3));var _0x6e70=function(_0x4c4fbe,_0x483482){_0x4c4fbe=_0x4c4fbe-0x0;var _0x39b3b9=_0xe706[_0x4c4fbe];return _0x39b3b9;};'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 d678763..830ba99 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 _0xa42d=['type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','results','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','authType','password','token','%s/token:%s','toString','base64','debug','[HTTP]','stringify','GET','map','forEach','includes','string','picklist','nameField','customField','content','type','custom_fields','idField','variable','variableName','push','customVariable','Variable','toLowerCase','queue','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','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','POST','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','Zendesk\x20account\x20type\x20not\x20recognized','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','newTab','catch','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','util','ioredis','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json','Creating\x20new\x20ticket...','format','%s/tickets.json','Tags','name','Subjects','getString','Descriptions','Fields','then','validateEmail','info','Getting\x20agent\x20with\x20email','remoteUri'];(function(_0x31a174,_0x3991b8){var _0x2c7e25=function(_0x5da10e){while(--_0x5da10e){_0x31a174['push'](_0x31a174['shift']());}};_0x2c7e25(++_0x3991b8);}(_0xa42d,0xc7));var _0xda42=function(_0x42c432,_0x138cdf){_0x42c432=_0x42c432-0x0;var _0x55c8dd=_0xa42d[_0x42c432];return _0x55c8dd;};'use strict';var _=require(_0xda42('0x0'));var rp=require(_0xda42('0x1'));var md5=require('md5');var util=require(_0xda42('0x2'));var Redis=require(_0xda42('0x3'));var intUtil=require('./util');var config=require(_0xda42('0x4'));var logger=require(_0xda42('0x5'))(_0xda42('0x6'));config[_0xda42('0x7')]=_[_0xda42('0x8')](config[_0xda42('0x7')],{'host':_0xda42('0x9'),'port':0x18eb});var io=require(_0xda42('0xa'))(new Redis(config['redis']));function emit(_0x4523bb,_0x400fc0,_0x2dc785){io['to'](_0x4523bb)[_0xda42('0xb')](_0x400fc0,_0x2dc785);}var headers={'Content-Type':_0xda42('0xc'),'Accept':'application/json'};function getTicket(_0x107d05,_0x5104e9,_0x10a0ad,_0x1ade89,_0x50286b){logger['info'](_0xda42('0xd'));return request({'uri':util[_0xda42('0xe')](_0xda42('0xf'),_0x107d05['remoteUri']),'method':'POST','body':{'ticket':_['merge']({'requester_id':_0x10a0ad['id'],'submitter_id':_0x5104e9?_0x5104e9['id']:undefined,'assignee_id':_0x5104e9?_0x5104e9['id']:undefined,'tags':getTags(_0x1ade89[_0xda42('0x10')],_0xda42('0x11')),'subject':intUtil['getString'](_0x1ade89[_0xda42('0x12')],_0x50286b,'\x20'),'description':intUtil[_0xda42('0x13')](_0x1ade89[_0xda42('0x14')],_0x50286b,'\x0a'),'comment':{'public':![],'body':intUtil[_0xda42('0x13')](_0x1ade89[_0xda42('0x14')],_0x50286b,'\x0a')}},getCustomFields(_0x1ade89[_0xda42('0x15')],_0x50286b))}})[_0xda42('0x16')](function(_0x11bf1d){logger['info']('Ticket\x20created!');return _0x11bf1d['ticket'];});}function getUser(_0x5bde4b,_0x7ecd1f){if(intUtil[_0xda42('0x17')](_0x7ecd1f)){logger[_0xda42('0x18')](_0xda42('0x19'),_0x7ecd1f);return request({'uri':util[_0xda42('0xe')]('%s/search.json',_0x5bde4b[_0xda42('0x1a')]),'qs':{'query':util[_0xda42('0xe')](_0xda42('0x1b'),_0x7ecd1f)}})[_0xda42('0x16')](function(_0x58c9cf){if(_0x58c9cf[_0xda42('0x1c')]){logger[_0xda42('0x18')](_0xda42('0x1d'));return _[_0xda42('0x1e')](_0x58c9cf['results'],{'email':_0x7ecd1f,'role':_0xda42('0x1f')});}else{logger[_0xda42('0x18')](_0xda42('0x20'));return request({'uri':util['format'](_0xda42('0x21'),_0x5bde4b[_0xda42('0x1a')])})[_0xda42('0x16')](function(_0x133809){logger[_0xda42('0x18')](_0xda42('0x22'));return _0x133809[_0xda42('0x23')];});}});}else{logger[_0xda42('0x18')](_0xda42('0x20'));return request({'uri':util[_0xda42('0xe')]('%s/users/me.json',_0x5bde4b[_0xda42('0x1a')])})[_0xda42('0x16')](function(_0x226197){logger[_0xda42('0x18')]('Admin\x20account\x20selected.');return _0x226197[_0xda42('0x23')];});}}function getEndUser(_0x442dd1,_0xae673d,_0x1a0018){logger[_0xda42('0x18')](_0xda42('0x24'),_0x1a0018);return request({'uri':util[_0xda42('0xe')]('%s/search.json',_0x442dd1[_0xda42('0x1a')]),'qs':{'query':util[_0xda42('0xe')](_0xda42('0x25'),_0x1a0018)}})[_0xda42('0x16')](function(_0x11880b){var _0x5b2077;if(_0x11880b[_0xda42('0x26')][_0xda42('0x27')]){_0x11880b[_0xda42('0x26')]=_[_0xda42('0x28')](_0x11880b[_0xda42('0x26')],{'suspended':![],'role':_0xda42('0x29')});if(_0x11880b[_0xda42('0x26')][_0xda42('0x27')]){_0x5b2077=_[_0xda42('0x2a')](_0x11880b[_0xda42('0x26')]);}}if(_0x5b2077){logger['info'](_0xda42('0x2b'));return _0x5b2077;}else{logger[_0xda42('0x18')](_0xda42('0x2c'));return request({'uri':util['format'](_0xda42('0x2d'),_0x442dd1[_0xda42('0x1a')]),'method':'POST','body':{'user':{'role':_0xda42('0x29'),'name':util['format']('Caller\x20-\x20%s',_0xae673d||_0x1a0018),'phone':_0x1a0018}}})[_0xda42('0x16')](function(_0x34c2e9){logger[_0xda42('0x18')]('Enduser\x20created.');return _0x34c2e9[_0xda42('0x23')];});}});}function getAuth(_0x144acf){var _0x3474a3;if(_0x144acf[_0xda42('0x2e')]===_0xda42('0x2f')){_0x3474a3=util[_0xda42('0xe')]('%s:%s',_0x144acf['username'],_0x144acf[_0xda42('0x2f')]);}else if(_0x144acf[_0xda42('0x2e')]===_0xda42('0x30')){_0x3474a3=util[_0xda42('0xe')](_0xda42('0x31'),_0x144acf['username'],_0x144acf['token']);}return util[_0xda42('0xe')]('Basic\x20%s',new Buffer(_0x3474a3)[_0xda42('0x32')](_0xda42('0x33')));}function request(_0x577e75){logger[_0xda42('0x34')](_0xda42('0x35'),JSON[_0xda42('0x36')](_0x577e75));return rp(_[_0xda42('0x8')](_0x577e75,{'method':_0xda42('0x37'),'headers':headers,'json':!![]}));}function getTags(_0x53facd,_0x120998){var _0x13e5a6=[];if(_0x53facd&&_0x53facd[_0xda42('0x27')]>0x0){_0x13e5a6=_[_0xda42('0x38')](_0x53facd,_0x120998);}return _0x13e5a6;}function getCustomFields(_0x1a9a05,_0x20e93a){var _0x15b5a8=[];var _0x57a3a6={'custom_fields':[]};if(_0x1a9a05['length']>0x0){_[_0xda42('0x39')](_0x1a9a05,function(_0x50cb9b){if(_[_0xda42('0x3a')]([_0xda42('0x3b'),_0xda42('0x3c')],_0x50cb9b['type'])&&_0x50cb9b[_0xda42('0x3d')]&&!_0x50cb9b[_0xda42('0x3e')]){_0x57a3a6[_0x50cb9b['nameField']['toLowerCase']()]=_0x50cb9b[_0xda42('0x3f')][_0xda42('0x32')]();}else if(_[_0xda42('0x3a')]([_0xda42('0x3b'),_0xda42('0x3c')],_0x50cb9b[_0xda42('0x40')])&&_0x50cb9b['idField']&&_0x50cb9b[_0xda42('0x3e')]){_0x57a3a6[_0xda42('0x41')]['push']({'id':_0x50cb9b[_0xda42('0x42')],'value':_0x50cb9b[_0xda42('0x3f')][_0xda42('0x32')]()});}else if(_0x50cb9b[_0xda42('0x40')]===_0xda42('0x43')&&_0x50cb9b[_0xda42('0x44')]&&_0x50cb9b[_0xda42('0x42')]&&_0x50cb9b['customField']){_0x20e93a[_0x50cb9b[_0xda42('0x44')]]&&_0x57a3a6['custom_fields'][_0xda42('0x45')]({'id':_0x50cb9b['idField'],'value':_0x20e93a[_0x50cb9b[_0xda42('0x44')]]['toString']()});}else if(_0x50cb9b[_0xda42('0x40')]===_0xda42('0x46')&&_0x50cb9b['Variable']&&_0x50cb9b[_0xda42('0x47')][_0xda42('0x11')]&&_0x50cb9b['idField']&&_0x50cb9b[_0xda42('0x3e')]){_0x20e93a[_0x50cb9b['Variable']['name']['toLowerCase']()]&&_0x57a3a6['custom_fields']['push']({'id':_0x50cb9b[_0xda42('0x42')],'value':_0x20e93a[_0x50cb9b[_0xda42('0x47')][_0xda42('0x11')][_0xda42('0x48')]()][_0xda42('0x32')]()});}});}return _0x57a3a6;}exports[_0xda42('0x49')]=function(_0x16731e,_0x563289,_0x5462a3,_0x4ec023,_0x2e17e2,_0x15f267){var _0x49b53d,_0x421e6d;_0x15f267[_0xda42('0x1a')]=intUtil[_0xda42('0x4a')](_0x15f267[_0xda42('0x1a')]);_0x15f267['serverUrl']=intUtil[_0xda42('0x4a')](_0x15f267[_0xda42('0x4b')]);if(_0x2e17e2&&_0x2e17e2[_0xda42('0x4c')]){logger[_0xda42('0x18')](_0xda42('0x4d'),_0xda42('0x4e'));_0x563289[_0xda42('0x4f')]=util[_0xda42('0xe')](_0xda42('0x50'),_0x15f267[_0xda42('0x4b')],_0x563289[_0xda42('0x51')],md5(_0x563289['uniqueid']));}else{_0x563289[_0xda42('0x4f')]='';}headers[_0xda42('0x52')]=getAuth(_0x15f267);return getUser(_0x15f267,_0x4ec023[_0xda42('0x53')])[_0xda42('0x16')](function(_0x2308bd){_0x49b53d=_0x2308bd;logger[_0xda42('0x18')](_0xda42('0x54'),_0x49b53d['id']);return getEndUser(_0x15f267,_0x563289[_0xda42('0x55')],_0x563289[_0xda42('0x56')]);})[_0xda42('0x16')](function(_0x33a4ff){_0x421e6d=_0x33a4ff;logger[_0xda42('0x18')](_0xda42('0x57'),_0x421e6d['id']);return getTicket(_0x15f267,_0x49b53d,_0x421e6d,_0x5462a3,_0x563289);})[_0xda42('0x16')](function(_0x57f782){if(_0x57f782){logger[_0xda42('0x18')](_0xda42('0x58'),_0x57f782['id']);switch(_0x15f267[_0xda42('0x40')]){case _0xda42('0x59'):logger[_0xda42('0x18')](_0xda42('0x4d'),_0xda42('0x5a'));return request({'uri':util['format'](_0xda42('0x5b'),_0x15f267[_0xda42('0x1a')],_0x49b53d['id'],_0x57f782['id']),'method':_0xda42('0x5c')});case'newTab':logger[_0xda42('0x18')](_0xda42('0x4d'),_0xda42('0x5d'));emit(util[_0xda42('0xe')](_0xda42('0x5e'),_0x4ec023[_0xda42('0x11')]),_0xda42('0x5f'),{'uri':util[_0xda42('0xe')](_0xda42('0x60'),_0x15f267[_0xda42('0x1a')][_0xda42('0x61')]('/api/v2',''),_0x57f782['id'])});break;default:logger['error'](_0xda42('0x4d'),_0xda42('0x62'));}}})['catch'](function(_0x1f46d0){logger[_0xda42('0x63')](_0xda42('0x64'),util[_0xda42('0x65')](_0x1f46d0,{'showHidden':!![],'depth':null}));});};exports[_0xda42('0x66')]=function(_0xc8d8b9,_0x57d4cf,_0x133455,_0x518302,_0x53f254,_0x41dd5b,_0x2c5004){var _0x5ac931,_0x15dfc1;_0x41dd5b['remoteUri']=intUtil['stripTrailingSlash'](_0x41dd5b[_0xda42('0x1a')]);_0x41dd5b[_0xda42('0x4b')]=intUtil['stripTrailingSlash'](_0x41dd5b[_0xda42('0x4b')]);if(_0x2c5004&&_0x2c5004[_0xda42('0x67')]&&_0x2c5004[_0xda42('0x67')]!==_0xda42('0x68')){logger[_0xda42('0x18')](_0xda42('0x69'),_0xda42('0x4e'));_0x57d4cf['recordingURL']=util[_0xda42('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x41dd5b[_0xda42('0x4b')],_0x57d4cf[_0xda42('0x51')],md5(_0x57d4cf[_0xda42('0x51')]));}headers[_0xda42('0x52')]=getAuth(_0x41dd5b);return getUser(_0x41dd5b,_0x518302[_0xda42('0x53')])[_0xda42('0x16')](function(_0x471537){_0x5ac931=_0x471537;logger['info'](_0xda42('0x54'),_0x5ac931['id']);return getEndUser(_0x41dd5b,_0x57d4cf[_0xda42('0x6a')],_0x57d4cf[_0xda42('0x6b')]);})[_0xda42('0x16')](function(_0x3114df){_0x15dfc1=_0x3114df;logger['info'](_0xda42('0x57'),_0x15dfc1['id']);return getTicket(_0x41dd5b,_0x5ac931,_0x15dfc1,_0x133455,_0x57d4cf);})['then'](function(_0x747904){if(_0x747904){logger[_0xda42('0x18')](_0xda42('0x58'),_0x747904['id']);switch(_0x41dd5b[_0xda42('0x40')]){case _0xda42('0x59'):logger['info'](_0xda42('0x69'),_0xda42('0x5a'));return request({'uri':util[_0xda42('0xe')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x41dd5b[_0xda42('0x1a')],_0x5ac931['id'],_0x747904['id']),'method':_0xda42('0x5c')});case _0xda42('0x6c'):logger[_0xda42('0x18')]('[OUTBOUND]',_0xda42('0x5d'));emit(util[_0xda42('0xe')](_0xda42('0x5e'),_0x518302[_0xda42('0x11')]),_0xda42('0x5f'),{'uri':util['format'](_0xda42('0x60'),_0x41dd5b['remoteUri'][_0xda42('0x61')]('/api/v2',''),_0x747904['id'])});break;default:logger['error']('[OUTBOUND]','Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xda42('0x6d')](function(_0x21777a){logger[_0xda42('0x63')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0xda42('0x65')](_0x21777a,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x58e1bc,_0x5a029b,_0x5df8ee,_0x1123f0,_0x41bf5c,_0x310e02){var _0xe2287c,_0x201c89;_0x310e02[_0xda42('0x1a')]=intUtil[_0xda42('0x4a')](_0x310e02[_0xda42('0x1a')]);_0x310e02[_0xda42('0x4b')]=intUtil[_0xda42('0x4a')](_0x310e02[_0xda42('0x4b')]);if(_0x41bf5c&&_0x41bf5c['monitor_format']){logger[_0xda42('0x18')]('['+_0x5a029b[_0xda42('0x6e')][_0xda42('0x6f')]()+']',_0xda42('0x4e'));_0x5a029b[_0xda42('0x4f')]=util[_0xda42('0xe')](_0xda42('0x50'),_0x310e02['serverUrl'],_0x5a029b[_0xda42('0x51')],md5(_0x5a029b[_0xda42('0x51')]));}else{_0x5a029b[_0xda42('0x4f')]='';}headers[_0xda42('0x52')]=getAuth(_0x310e02);return getUser(_0x310e02)['then'](function(_0x2d76c4){_0xe2287c=_0x2d76c4;logger[_0xda42('0x18')](_0xda42('0x54'),_0xe2287c['id']);return getEndUser(_0x310e02,_0x5a029b['calleridname'],_0x5a029b[_0xda42('0x56')]);})[_0xda42('0x16')](function(_0x4c458d){_0x201c89=_0x4c458d;logger[_0xda42('0x18')]('The\x20Enduser\x20ID\x20is:',_0x201c89['id']);return getTicket(_0x310e02,_0xe2287c,_0x201c89,_0x5df8ee,_0x5a029b);})[_0xda42('0x16')](function(_0x4269a1){if(_0x4269a1){logger['info'](_0xda42('0x58'),_0x4269a1['id']);}})[_0xda42('0x6d')](function(_0x55b551){logger[_0xda42('0x63')]('['+_0x5a029b[_0xda42('0x6e')][_0xda42('0x6f')]()+']'+_0xda42('0x70'),util[_0xda42('0x65')](_0x55b551,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xc9ef=['util','ioredis','./util','../../../../config/environment','zendesk','redis','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','%s/tickets.json','POST','name','getString','Subjects','Descriptions','Fields','then','ticket','validateEmail','Getting\x20agent\x20with\x20email','format','remoteUri','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user','Admin\x20account\x20selected.','%s/search.json','type:user\x20role:end-user\x20phone:%s','length','results','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','password','token','%s/token:%s','username','toString','debug','[HTTP]','defaults','GET','map','forEach','includes','picklist','type','nameField','customField','toLowerCase','content','string','idField','custom_fields','push','variable','variableName','Variable','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','newTab','user:%s','trigger:browser:url','%s/agent/tickets/%s','error','Zendesk\x20account\x20type\x20not\x20recognized','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','%s/channels/voice/agents/%d/tickets/%d/display.json','/api/v2','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','lastevent','toUpperCase','lodash'];(function(_0x2d7c5f,_0x3fcdd4){var _0x13d9d0=function(_0x3a008e){while(--_0x3a008e){_0x2d7c5f['push'](_0x2d7c5f['shift']());}};_0x13d9d0(++_0x3fcdd4);}(_0xc9ef,0x68));var _0xfc9e=function(_0x1dc337,_0x163446){_0x1dc337=_0x1dc337-0x0;var _0x2c4d04=_0xc9ef[_0x1dc337];return _0x2c4d04;};'use strict';var _=require(_0xfc9e('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0xfc9e('0x1'));var Redis=require(_0xfc9e('0x2'));var intUtil=require(_0xfc9e('0x3'));var config=require(_0xfc9e('0x4'));var logger=require('../../../../config/logger')(_0xfc9e('0x5'));config[_0xfc9e('0x6')]=_['defaults'](config[_0xfc9e('0x6')],{'host':_0xfc9e('0x7'),'port':0x18eb});var io=require(_0xfc9e('0x8'))(new Redis(config[_0xfc9e('0x6')]));function emit(_0x2d3161,_0x1fe084,_0x450c62){io['to'](_0x2d3161)['emit'](_0x1fe084,_0x450c62);}var headers={'Content-Type':_0xfc9e('0x9'),'Accept':'application/json'};function getTicket(_0xec9760,_0x68012,_0x39594b,_0x1e6094,_0x168fbb){logger[_0xfc9e('0xa')](_0xfc9e('0xb'));return request({'uri':util['format'](_0xfc9e('0xc'),_0xec9760['remoteUri']),'method':_0xfc9e('0xd'),'body':{'ticket':_['merge']({'requester_id':_0x39594b['id'],'submitter_id':_0x68012?_0x68012['id']:undefined,'assignee_id':_0x68012?_0x68012['id']:undefined,'tags':getTags(_0x1e6094['Tags'],_0xfc9e('0xe')),'subject':intUtil[_0xfc9e('0xf')](_0x1e6094[_0xfc9e('0x10')],_0x168fbb,'\x20'),'description':intUtil[_0xfc9e('0xf')](_0x1e6094['Descriptions'],_0x168fbb,'\x0a'),'comment':{'public':![],'body':intUtil[_0xfc9e('0xf')](_0x1e6094[_0xfc9e('0x11')],_0x168fbb,'\x0a')}},getCustomFields(_0x1e6094[_0xfc9e('0x12')],_0x168fbb))}})[_0xfc9e('0x13')](function(_0x2a4aef){logger[_0xfc9e('0xa')]('Ticket\x20created!');return _0x2a4aef[_0xfc9e('0x14')];});}function getUser(_0x28f3d7,_0x460999){if(intUtil[_0xfc9e('0x15')](_0x460999)){logger['info'](_0xfc9e('0x16'),_0x460999);return request({'uri':util[_0xfc9e('0x17')]('%s/search.json',_0x28f3d7[_0xfc9e('0x18')]),'qs':{'query':util[_0xfc9e('0x17')](_0xfc9e('0x19'),_0x460999)}})[_0xfc9e('0x13')](function(_0x47c4b7){if(_0x47c4b7[_0xfc9e('0x1a')]){logger[_0xfc9e('0xa')](_0xfc9e('0x1b'));return _['find'](_0x47c4b7['results'],{'email':_0x460999,'role':_0xfc9e('0x1c')});}else{logger[_0xfc9e('0xa')](_0xfc9e('0x1d'));return request({'uri':util[_0xfc9e('0x17')]('%s/users/me.json',_0x28f3d7[_0xfc9e('0x18')])})[_0xfc9e('0x13')](function(_0x5d91fc){logger['info']('Admin\x20account\x20selected.');return _0x5d91fc[_0xfc9e('0x1e')];});}});}else{logger[_0xfc9e('0xa')](_0xfc9e('0x1d'));return request({'uri':util[_0xfc9e('0x17')]('%s/users/me.json',_0x28f3d7[_0xfc9e('0x18')])})['then'](function(_0x5a408a){logger[_0xfc9e('0xa')](_0xfc9e('0x1f'));return _0x5a408a[_0xfc9e('0x1e')];});}}function getEndUser(_0x49e261,_0x3a6446,_0x3a6bd5){logger[_0xfc9e('0xa')]('Searching\x20enduser\x20with\x20phone',_0x3a6bd5);return request({'uri':util[_0xfc9e('0x17')](_0xfc9e('0x20'),_0x49e261[_0xfc9e('0x18')]),'qs':{'query':util['format'](_0xfc9e('0x21'),_0x3a6bd5)}})['then'](function(_0x27f111){var _0x338b9a;if(_0x27f111['results'][_0xfc9e('0x22')]){_0x27f111['results']=_['filter'](_0x27f111[_0xfc9e('0x23')],{'suspended':![],'role':_0xfc9e('0x24')});if(_0x27f111[_0xfc9e('0x23')][_0xfc9e('0x22')]){_0x338b9a=_[_0xfc9e('0x25')](_0x27f111[_0xfc9e('0x23')]);}}if(_0x338b9a){logger[_0xfc9e('0xa')](_0xfc9e('0x26'));return _0x338b9a;}else{logger[_0xfc9e('0xa')](_0xfc9e('0x27'));return request({'uri':util[_0xfc9e('0x17')](_0xfc9e('0x28'),_0x49e261[_0xfc9e('0x18')]),'method':_0xfc9e('0xd'),'body':{'user':{'role':'end-user','name':util[_0xfc9e('0x17')](_0xfc9e('0x29'),_0x3a6446||_0x3a6bd5),'phone':_0x3a6bd5}}})[_0xfc9e('0x13')](function(_0x373e9c){logger[_0xfc9e('0xa')](_0xfc9e('0x2a'));return _0x373e9c[_0xfc9e('0x1e')];});}});}function getAuth(_0x1b0798){var _0x5bed02;if(_0x1b0798[_0xfc9e('0x2b')]===_0xfc9e('0x2c')){_0x5bed02=util['format']('%s:%s',_0x1b0798['username'],_0x1b0798[_0xfc9e('0x2c')]);}else if(_0x1b0798[_0xfc9e('0x2b')]===_0xfc9e('0x2d')){_0x5bed02=util['format'](_0xfc9e('0x2e'),_0x1b0798[_0xfc9e('0x2f')],_0x1b0798[_0xfc9e('0x2d')]);}return util[_0xfc9e('0x17')]('Basic\x20%s',new Buffer(_0x5bed02)[_0xfc9e('0x30')]('base64'));}function request(_0x200982){logger[_0xfc9e('0x31')](_0xfc9e('0x32'),JSON['stringify'](_0x200982));return rp(_[_0xfc9e('0x33')](_0x200982,{'method':_0xfc9e('0x34'),'headers':headers,'json':!![]}));}function getTags(_0x38f80c,_0x4e52c3){var _0x5eb266=[];if(_0x38f80c&&_0x38f80c['length']>0x0){_0x5eb266=_[_0xfc9e('0x35')](_0x38f80c,_0x4e52c3);}return _0x5eb266;}function getCustomFields(_0x44b72e,_0x3d99d3){var _0x51c454=[];var _0x32acdd={'custom_fields':[]};if(_0x44b72e['length']>0x0){_[_0xfc9e('0x36')](_0x44b72e,function(_0x2f02d6){if(_[_0xfc9e('0x37')](['string',_0xfc9e('0x38')],_0x2f02d6[_0xfc9e('0x39')])&&_0x2f02d6[_0xfc9e('0x3a')]&&!_0x2f02d6[_0xfc9e('0x3b')]){_0x32acdd[_0x2f02d6[_0xfc9e('0x3a')][_0xfc9e('0x3c')]()]=_0x2f02d6[_0xfc9e('0x3d')][_0xfc9e('0x30')]();}else if(_[_0xfc9e('0x37')]([_0xfc9e('0x3e'),_0xfc9e('0x38')],_0x2f02d6[_0xfc9e('0x39')])&&_0x2f02d6[_0xfc9e('0x3f')]&&_0x2f02d6[_0xfc9e('0x3b')]){_0x32acdd[_0xfc9e('0x40')][_0xfc9e('0x41')]({'id':_0x2f02d6[_0xfc9e('0x3f')],'value':_0x2f02d6[_0xfc9e('0x3d')][_0xfc9e('0x30')]()});}else if(_0x2f02d6[_0xfc9e('0x39')]===_0xfc9e('0x42')&&_0x2f02d6['variableName']&&_0x2f02d6[_0xfc9e('0x3f')]&&_0x2f02d6[_0xfc9e('0x3b')]){_0x3d99d3[_0x2f02d6['variableName']]&&_0x32acdd[_0xfc9e('0x40')]['push']({'id':_0x2f02d6['idField'],'value':_0x3d99d3[_0x2f02d6[_0xfc9e('0x43')]]['toString']()});}else if(_0x2f02d6[_0xfc9e('0x39')]==='customVariable'&&_0x2f02d6['Variable']&&_0x2f02d6['Variable'][_0xfc9e('0xe')]&&_0x2f02d6[_0xfc9e('0x3f')]&&_0x2f02d6['customField']){_0x3d99d3[_0x2f02d6[_0xfc9e('0x44')][_0xfc9e('0xe')][_0xfc9e('0x3c')]()]&&_0x32acdd['custom_fields'][_0xfc9e('0x41')]({'id':_0x2f02d6[_0xfc9e('0x3f')],'value':_0x3d99d3[_0x2f02d6[_0xfc9e('0x44')]['name'][_0xfc9e('0x3c')]()][_0xfc9e('0x30')]()});}});}return _0x32acdd;}exports[_0xfc9e('0x45')]=function(_0x47440a,_0x1bca65,_0x5c7646,_0x3d3c32,_0x585f04,_0x4e52be){var _0x30176c,_0x129de4;_0x4e52be[_0xfc9e('0x18')]=intUtil['stripTrailingSlash'](_0x4e52be[_0xfc9e('0x18')]);_0x4e52be[_0xfc9e('0x46')]=intUtil[_0xfc9e('0x47')](_0x4e52be['serverUrl']);if(_0x585f04&&_0x585f04[_0xfc9e('0x48')]){logger[_0xfc9e('0xa')](_0xfc9e('0x49'),_0xfc9e('0x4a'));_0x1bca65[_0xfc9e('0x4b')]=util[_0xfc9e('0x17')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4e52be[_0xfc9e('0x46')],_0x1bca65['uniqueid'],md5(_0x1bca65[_0xfc9e('0x4c')]));}else{_0x1bca65[_0xfc9e('0x4b')]='';}headers[_0xfc9e('0x4d')]=getAuth(_0x4e52be);return getUser(_0x4e52be,_0x3d3c32[_0xfc9e('0x4e')])[_0xfc9e('0x13')](function(_0x61fd46){_0x30176c=_0x61fd46;logger[_0xfc9e('0xa')](_0xfc9e('0x4f'),_0x30176c['id']);return getEndUser(_0x4e52be,_0x1bca65[_0xfc9e('0x50')],_0x1bca65[_0xfc9e('0x51')]);})[_0xfc9e('0x13')](function(_0x1dfb71){_0x129de4=_0x1dfb71;logger[_0xfc9e('0xa')](_0xfc9e('0x52'),_0x129de4['id']);return getTicket(_0x4e52be,_0x30176c,_0x129de4,_0x5c7646,_0x1bca65);})[_0xfc9e('0x13')](function(_0x506533){if(_0x506533){logger[_0xfc9e('0xa')](_0xfc9e('0x53'),_0x506533['id']);switch(_0x4e52be[_0xfc9e('0x39')]){case _0xfc9e('0x54'):logger[_0xfc9e('0xa')]('[QUEUE]',_0xfc9e('0x55'));return request({'uri':util[_0xfc9e('0x17')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x4e52be[_0xfc9e('0x18')],_0x30176c['id'],_0x506533['id']),'method':'POST'});case _0xfc9e('0x56'):logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xfc9e('0x57'),_0x3d3c32[_0xfc9e('0xe')]),_0xfc9e('0x58'),{'uri':util['format'](_0xfc9e('0x59'),_0x4e52be[_0xfc9e('0x18')]['replace']('/api/v2',''),_0x506533['id'])});break;default:logger[_0xfc9e('0x5a')](_0xfc9e('0x49'),_0xfc9e('0x5b'));}}})['catch'](function(_0x5ced58){logger[_0xfc9e('0x5a')](_0xfc9e('0x5c'),util[_0xfc9e('0x5d')](_0x5ced58,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x3e17ce,_0x511dbe,_0x3d160e,_0x15c5df,_0x5aa4f3,_0x12446d,_0x3bd0b1){var _0x5bb323,_0x314128;_0x12446d[_0xfc9e('0x18')]=intUtil[_0xfc9e('0x47')](_0x12446d[_0xfc9e('0x18')]);_0x12446d[_0xfc9e('0x46')]=intUtil[_0xfc9e('0x47')](_0x12446d[_0xfc9e('0x46')]);if(_0x3bd0b1&&_0x3bd0b1['recordingFormat']&&_0x3bd0b1[_0xfc9e('0x5e')]!==_0xfc9e('0x5f')){logger[_0xfc9e('0xa')](_0xfc9e('0x60'),_0xfc9e('0x4a'));_0x511dbe[_0xfc9e('0x4b')]=util[_0xfc9e('0x17')](_0xfc9e('0x61'),_0x12446d[_0xfc9e('0x46')],_0x511dbe[_0xfc9e('0x4c')],md5(_0x511dbe['uniqueid']));}headers[_0xfc9e('0x4d')]=getAuth(_0x12446d);return getUser(_0x12446d,_0x15c5df[_0xfc9e('0x4e')])[_0xfc9e('0x13')](function(_0x5a0b37){_0x5bb323=_0x5a0b37;logger[_0xfc9e('0xa')](_0xfc9e('0x4f'),_0x5bb323['id']);return getEndUser(_0x12446d,_0x511dbe[_0xfc9e('0x62')],_0x511dbe['destcalleridnum']);})[_0xfc9e('0x13')](function(_0x42f614){_0x314128=_0x42f614;logger['info'](_0xfc9e('0x52'),_0x314128['id']);return getTicket(_0x12446d,_0x5bb323,_0x314128,_0x3d160e,_0x511dbe);})[_0xfc9e('0x13')](function(_0x363a85){if(_0x363a85){logger[_0xfc9e('0xa')](_0xfc9e('0x53'),_0x363a85['id']);switch(_0x12446d['type']){case _0xfc9e('0x54'):logger[_0xfc9e('0xa')](_0xfc9e('0x60'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xfc9e('0x17')](_0xfc9e('0x63'),_0x12446d['remoteUri'],_0x5bb323['id'],_0x363a85['id']),'method':_0xfc9e('0xd')});case'newTab':logger[_0xfc9e('0xa')](_0xfc9e('0x60'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xfc9e('0x17')]('user:%s',_0x15c5df[_0xfc9e('0xe')]),_0xfc9e('0x58'),{'uri':util[_0xfc9e('0x17')](_0xfc9e('0x59'),_0x12446d[_0xfc9e('0x18')]['replace'](_0xfc9e('0x64'),''),_0x363a85['id'])});break;default:logger[_0xfc9e('0x5a')](_0xfc9e('0x60'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xfc9e('0x65')](function(_0x276f67){logger[_0xfc9e('0x5a')](_0xfc9e('0x66'),util[_0xfc9e('0x5d')](_0x276f67,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x459716,_0x204f2c,_0x126260,_0x14416a,_0x4df5be,_0x2dce3c){var _0x499a6f,_0x1f7217;_0x2dce3c[_0xfc9e('0x18')]=intUtil[_0xfc9e('0x47')](_0x2dce3c['remoteUri']);_0x2dce3c['serverUrl']=intUtil[_0xfc9e('0x47')](_0x2dce3c[_0xfc9e('0x46')]);if(_0x4df5be&&_0x4df5be[_0xfc9e('0x48')]){logger['info']('['+_0x204f2c[_0xfc9e('0x67')][_0xfc9e('0x68')]()+']',_0xfc9e('0x4a'));_0x204f2c['recordingURL']=util[_0xfc9e('0x17')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2dce3c['serverUrl'],_0x204f2c['uniqueid'],md5(_0x204f2c[_0xfc9e('0x4c')]));}else{_0x204f2c[_0xfc9e('0x4b')]='';}headers[_0xfc9e('0x4d')]=getAuth(_0x2dce3c);return getUser(_0x2dce3c)[_0xfc9e('0x13')](function(_0x4da2c8){_0x499a6f=_0x4da2c8;logger[_0xfc9e('0xa')](_0xfc9e('0x4f'),_0x499a6f['id']);return getEndUser(_0x2dce3c,_0x204f2c['calleridname'],_0x204f2c['calleridnum']);})[_0xfc9e('0x13')](function(_0x20faa6){_0x1f7217=_0x20faa6;logger[_0xfc9e('0xa')](_0xfc9e('0x52'),_0x1f7217['id']);return getTicket(_0x2dce3c,_0x499a6f,_0x1f7217,_0x126260,_0x204f2c);})[_0xfc9e('0x13')](function(_0x29aea8){if(_0x29aea8){logger[_0xfc9e('0xa')]('The\x20Ticket\x20ID\x20is:',_0x29aea8['id']);}})[_0xfc9e('0x65')](function(_0x2564e7){logger[_0xfc9e('0x5a')]('['+_0x204f2c[_0xfc9e('0x67')][_0xfc9e('0x68')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x2564e7,{'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 7e3a204..5a49fe8 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 _0x652b=['https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','then','users','isArrayLikeObject','findIndex','email','info','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','stringify','data','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','SUCCESS','details','Error:\x20','log','CREATE\x20ERROR','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','Leads','contact','nothing','lead','Creating\x20new\x20call...','administrator','Subjects','Description','getString','Descriptions','enduserType','Who_Id','Full_Name','First_Name','Last_Name','What_Id','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','lastevent','called','complete','Call_Result','Answered','rejected','Rejected','Abandoned','timeout','Timeout','Call_Start_Time','outbound','starttime','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','code','Call\x20created!','err','queue','host','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','The\x20Call\x20ID\x20is:','user:%s','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','[OUTBOUND]','/downloads?type=uniqueid&token=','destcalleridname','Outbound','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','toUpperCase','calleridnum','lodash','request-promise','md5','./util','bluebird','../../../../config/environment','../../../../config/logger','defaults','socket.io-emitter','emit','debug','length','includes','string','type','idField','variable','variableName','toString','customVariable','Variable','name','toLowerCase','split','isNil','isBefore','expires_in','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','Search\x20user','GET','format'];(function(_0x1299ea,_0x40a3c8){var _0x53a75b=function(_0x29e447){while(--_0x29e447){_0x1299ea['push'](_0x1299ea['shift']());}};_0x53a75b(++_0x40a3c8);}(_0x652b,0x68));var _0xb652=function(_0x119280,_0x439c3e){_0x119280=_0x119280-0x0;var _0x481797=_0x652b[_0x119280];return _0x481797;};'use strict';var _=require(_0xb652('0x0'));var rp=require(_0xb652('0x1'));var md5=require(_0xb652('0x2'));var util=require('util');var intUtil=require(_0xb652('0x3'));var moment=require('moment');var Redis=require('ioredis');var BPromise=require(_0xb652('0x4'));var config=require(_0xb652('0x5'));var logger=require(_0xb652('0x6'))('zoho');config['redis']=_[_0xb652('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xb652('0x8'))(new Redis(config['redis']));function emit(_0x2b82fd,_0x117e49,_0x2b29c0){io['to'](_0x2b82fd)[_0xb652('0x9')](_0x117e49,_0x2b29c0);}function request(_0x2f06f0){logger[_0xb652('0xa')]('[HTTP]',JSON['stringify'](_0x2f06f0));return rp(_0x2f06f0);}function getCustomFields(_0x368635,_0x1ebe2b){var _0x2273d4={};if(_0x368635[_0xb652('0xb')]>0x0){_['forEach'](_0x368635,function(_0xe3ddb0){if(_[_0xb652('0xc')]([_0xb652('0xd'),'picklist'],_0xe3ddb0[_0xb652('0xe')])&&_0xe3ddb0[_0xb652('0xf')]){_0x2273d4[_0xe3ddb0['idField']]=_0xe3ddb0['content']['toString']();}else if(_0xe3ddb0['type']===_0xb652('0x10')&&_0xe3ddb0['variableName']&&_0xe3ddb0[_0xb652('0xf')]&&_0x1ebe2b[_0xe3ddb0[_0xb652('0x11')]]){_0x2273d4[_0xe3ddb0[_0xb652('0xf')]]=_0x1ebe2b[_0xe3ddb0['variableName']][_0xb652('0x12')]();}else if(_0xe3ddb0[_0xb652('0xe')]===_0xb652('0x13')&&_0xe3ddb0[_0xb652('0x14')]&&_0xe3ddb0['Variable'][_0xb652('0x15')]&&_0xe3ddb0[_0xb652('0xf')]&&_0x1ebe2b[_0xe3ddb0[_0xb652('0x14')][_0xb652('0x15')]['toLowerCase']()]){_0x2273d4[_0xe3ddb0[_0xb652('0xf')]]=_0x1ebe2b[_0xe3ddb0['Variable'][_0xb652('0x15')][_0xb652('0x16')]()][_0xb652('0x12')]();}});}return _0x2273d4;}function getName(_0x2db151){if(_0x2db151['indexOf']('\x20')>0x0){var _0x1de010=_0x2db151[_0xb652('0x17')](/ (.+)/);if(_0x1de010[0x1]){return _0x1de010;}}return[_0x2db151,_0x2db151];}var accountsTokens={};function getAccessToken(_0x3fc43e){return new Promise(function(_0x169f41,_0x32f67b){if(!_[_0xb652('0x18')](accountsTokens[_0x3fc43e['id']])&&!_['isNil'](accountsTokens[_0x3fc43e['id']]['access_token'])){if(moment()[_0xb652('0x19')](accountsTokens[_0x3fc43e['id']][_0xb652('0x1a')])){_0x169f41(accountsTokens[_0x3fc43e['id']]['access_token']);}}var _0x4c3fc1;switch(_0x3fc43e[_0xb652('0x1b')]){case'US':_0x4c3fc1='https://accounts.zoho.com';break;case'AU':_0x4c3fc1=_0xb652('0x1c');break;case'EU':_0x4c3fc1=_0xb652('0x1d');break;case'IN':_0x4c3fc1='https://accounts.zoho.in';break;case'CN':_0x4c3fc1='https://accounts.zoho.com.cn';break;default:_0x4c3fc1=_0xb652('0x1d');break;}var _0xd6bbf9={'method':_0xb652('0x1e'),'uri':_0x4c3fc1+_0xb652('0x1f'),'qs':{'refresh_token':_0x3fc43e[_0xb652('0x20')],'client_id':_0x3fc43e[_0xb652('0x21')],'client_secret':_0x3fc43e[_0xb652('0x22')],'grant_type':_0xb652('0x23')},'json':!![]};return rp(_0xd6bbf9)['then'](function(_0x4dcc1b){accountsTokens[_0x3fc43e['id']]={'access_token':_0x4dcc1b['access_token'],'expires_in':moment()[_0xb652('0x24')](_0x4dcc1b['expires_in'],_0xb652('0x25'))};_0x169f41(_0x4dcc1b['access_token']);})[_0xb652('0x26')](function(_0x133a14){logger[_0xb652('0x27')](_0xb652('0x28'),_0x133a14[_0xb652('0x29')]);_0x32f67b(_0x133a14);});});}function getUser(_0x5f39cb,_0x459c03,_0x52d918,_0x3a6f08){logger['info'](_0xb652('0x2a'));return request({'method':_0xb652('0x2b'),'uri':util[_0xb652('0x2c')](_0xb652('0x2d'),_0x459c03),'qs':{'type':_0xb652('0x2e')},'headers':{'Authorization':_0xb652('0x2f')+_0x5f39cb},'json':!![]})[_0xb652('0x30')](function(_0x374ae8){if(_0x374ae8[_0xb652('0x31')]){var _0x2f93f4=-0x1;if(_[_0xb652('0x32')](_0x374ae8['users'])){if(!_[_0xb652('0x18')](_0x3a6f08)){_0x2f93f4=_[_0xb652('0x33')](_0x374ae8[_0xb652('0x31')],function(_0x447821){return _0x447821[_0xb652('0x34')]===_0x3a6f08;});}if(_0x2f93f4>=0x0){logger[_0xb652('0x35')]('Agent\x20found!');}else{logger[_0xb652('0x35')](_0xb652('0x36'));_0x2f93f4=_[_0xb652('0x33')](_0x374ae8[_0xb652('0x31')],function(_0x30ce7e){return _0x30ce7e[_0xb652('0x37')][_0xb652('0x15')]===_0xb652('0x38');});}return _0x374ae8[_0xb652('0x31')][_0x2f93f4];}else{if(_0x374ae8[_0xb652('0x39')]['profile'][_0xb652('0x15')]==='Administrator'){logger['info']('Using\x20the\x20admin\x20account!');user=_0x374ae8[_0xb652('0x39')];return user;}else{logger[_0xb652('0x27')](_0xb652('0x3a'),JSON['stringify'](_0x374ae8));throw new Error(_0xb652('0x3b')+JSON['stringify'](_0x374ae8));}}}else{logger[_0xb652('0x27')]('The\x20failing\x20result\x20is',JSON[_0xb652('0x3c')](_0x374ae8));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0xb652('0x3c')](_0x374ae8));}})[_0xb652('0x26')](function(_0x28a7f4){console[_0xb652('0x27')](_0x28a7f4);});}function getZohoUser(_0x488063,_0x400200){return new BPromise(function(_0x11724f,_0x19ef00){request(_0x488063)[_0xb652('0x30')](function(_0x5dc5ba){var _0x3164f4=null;if(_0x5dc5ba){_0x3164f4=_0x5dc5ba[_0xb652('0x3d')][0x0];_0x3164f4['enduserType']=_0x400200;}_0x11724f(_0x3164f4);})[_0xb652('0x26')](function(_0x48261f){_0x19ef00(_0x48261f);});});}function createEndUser(_0x5ced40,_0x3b70a8,_0xb8f377,_0xb20a,_0x521739,_0x3efefc){var _0xb8f377=getName(_0xb8f377);return request({'method':_0xb652('0x1e'),'uri':_0xb652('0x3e')+_0x3b70a8+_0xb652('0x3f')+_[_0xb652('0x40')](_0x3efefc[_0xb652('0x41')])+'s','body':{'data':[{'Last_Name':_0xb8f377[0x1],'First_Name':_0xb8f377[0x0],'Phone':_0xb20a,'Owner':{'name':!_[_0xb652('0x18')](_0x521739[_0xb652('0x42')][_0xb652('0x15')])?_0x521739['role']['name']:!_[_0xb652('0x18')](_0x521739['first_name'])?_0x521739[_0xb652('0x43')]+'\x20'+_0x521739[_0xb652('0x44')]:_0x521739[_0xb652('0x44')],'id':_0x521739['id']}}]},'headers':{'Authorization':_0xb652('0x2f')+_0x5ced40},'json':!![]})[_0xb652('0x30')](function(_0x144b26){if(_0x144b26&&_0x144b26['data'][0x0]['code']===_0xb652('0x45')){var _0x115dc2=_0x144b26[_0xb652('0x3d')][0x0][_0xb652('0x46')];_0x115dc2['enduserType']=_[_0xb652('0x40')](_0x3efefc[_0xb652('0x41')])+'s';return _0x115dc2;}logger[_0xb652('0x27')](_0xb652('0x3a'),JSON[_0xb652('0x3c')](data));throw new Error(_0xb652('0x47')+JSON[_0xb652('0x3c')](data));})[_0xb652('0x26')](function(_0x20065c){console[_0xb652('0x48')](_0xb652('0x49'),_0x20065c);});}function getEndUser(_0x17a553,_0x46e4ec,_0x1480f4,_0x4e2fd5,_0x5aeb81,_0x3a0715,_0xdc89d1){var _0x283471={'method':'GET','uri':'','headers':{'Authorization':_0xb652('0x2f')+_0x17a553},'json':!![]};switch(_0xdc89d1['moduleSearch']){case _0xb652('0x4a'):_0x283471[_0xb652('0x4b')]=_0xb652('0x3e')+_0x46e4ec+_0xb652('0x4c')+_0x5aeb81+'))';return getZohoUser(_0x283471,_0xb652('0x4d'))[_0xb652('0x30')](function(_0x17d5fb){if(_0x17d5fb)return _0x17d5fb;_0x283471[_0xb652('0x4b')]=_0xb652('0x3e')+_0x46e4ec+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x5aeb81+'))';return getZohoUser(_0x283471,_0xb652('0x4e'))[_0xb652('0x30')](function(_0x5a4d6c){if(_0x5a4d6c)return _0x5a4d6c;if(_0xdc89d1[_0xb652('0x41')]!='nothing'){return createEndUser(_0x17a553,_0x46e4ec,_0x4e2fd5,_0x5aeb81,_0x3a0715,_0xdc89d1);}else{return{};}});});break;case _0xb652('0x4f'):_0x283471[_0xb652('0x4b')]=_0xb652('0x3e')+_0x46e4ec+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x5aeb81+'))';return getZohoUser(_0x283471,_0xb652('0x4d'))[_0xb652('0x30')](function(_0x32439a){if(_0x32439a)return _0x32439a;if(_0xdc89d1[_0xb652('0x41')]!=_0xb652('0x50')){return createEndUser(_0x17a553,_0x46e4ec,_0x4e2fd5,_0x5aeb81,_0x3a0715,_0xdc89d1);}else{return{};}});break;case _0xb652('0x51'):_0x283471[_0xb652('0x4b')]=_0xb652('0x3e')+_0x46e4ec+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x5aeb81+'))';return getZohoUser(_0x283471,'Leads')[_0xb652('0x30')](function(_0x45e3b9){if(_0x45e3b9)return _0x45e3b9;if(_0xdc89d1['moduleCreate']!='nothing'){return createEndUser(_0x17a553,_0x46e4ec,_0x4e2fd5,_0x5aeb81,_0x3a0715,_0xdc89d1);}else{return{};}});break;}}function getCall(_0x58b1a5,_0x10ca6c,_0x938dbf,_0x242f8a,_0x15aa71,_0x573426,_0x5d5d6d,_0x5a153e){logger[_0xb652('0x35')](_0xb652('0x52'));var _0x4768c4={};_0x4768c4['Owner']={'name':!_[_0xb652('0x18')](_0x242f8a[_0xb652('0x42')]['name'])&&!_['isNil'](_0x242f8a[_0xb652('0x37')][_0xb652('0x15')])&&_0x242f8a[_0xb652('0x37')][_0xb652('0x15')]===_0xb652('0x53')?_0x242f8a[_0xb652('0x42')][_0xb652('0x15')]:!_[_0xb652('0x18')](_0x242f8a[_0xb652('0x43')])?_0x242f8a[_0xb652('0x43')]+'\x20'+_0x242f8a[_0xb652('0x44')]:_0x242f8a['last_name'],'id':_0x242f8a['id']};_0x4768c4['Subject']=intUtil['getString'](_0x573426[_0xb652('0x54')],_0x5d5d6d,'\x20');_0x4768c4[_0xb652('0x55')]=intUtil[_0xb652('0x56')](_0x573426[_0xb652('0x57')],_0x5d5d6d,'\x0a');if(_0x15aa71[_0xb652('0x58')]===_0xb652('0x4d')){_0x4768c4[_0xb652('0x59')]={'name':!_['isNil'](_0x15aa71[_0xb652('0x5a')])?_0x15aa71[_0xb652('0x5a')]:!_['isNil'](_0x15aa71[_0xb652('0x5b')])?_0x15aa71[_0xb652('0x5b')]+'\x20'+_0x15aa71['Last_Name']:_0x15aa71[_0xb652('0x5c')],'id':_0x15aa71['id']};}if(_0x15aa71[_0xb652('0x58')]===_0xb652('0x4e')){_0x4768c4[_0xb652('0x5d')]={'name':!_[_0xb652('0x18')](_0x15aa71[_0xb652('0x5a')])?_0x15aa71[_0xb652('0x5a')]:!_['isNil'](_0x15aa71[_0xb652('0x5b')])?_0x15aa71[_0xb652('0x5b')]+'\x20'+_0x15aa71[_0xb652('0x5c')]:_0x15aa71[_0xb652('0x5c')],'id':_0x15aa71['id']};_0x4768c4['$se_module']=_[_0xb652('0x40')](_0x15aa71[_0xb652('0x58')]);}if(_0x5d5d6d[_0xb652('0x5e')]){_0x4768c4[_0xb652('0x5f')]=moment[_0xb652('0x60')](parseInt(_0x5d5d6d[_0xb652('0x5e')])*0x3e8)[_0xb652('0x2c')](_0xb652('0x61'));}else if(_0x5d5d6d[_0xb652('0x62')]&&_0x5d5d6d['endtime']){_0x4768c4[_0xb652('0x5f')]=moment[_0xb652('0x60')](moment(_0x5d5d6d[_0xb652('0x63')],_0xb652('0x64'))[_0xb652('0x65')](moment(_0x5d5d6d['starttime'],'YYYY-MM-DDTHH:mm:ss')))[_0xb652('0x2c')](_0xb652('0x61'));}switch(_0x5d5d6d[_0xb652('0x66')]){case _0xb652('0x67'):_0x4768c4['Call_Result']='Called';break;case _0xb652('0x68'):case'connect':_0x4768c4[_0xb652('0x69')]=_0xb652('0x6a');break;case _0xb652('0x6b'):_0x4768c4[_0xb652('0x69')]=_0xb652('0x6c');break;case'abandoned':_0x4768c4[_0xb652('0x69')]=_0xb652('0x6d');break;case _0xb652('0x6e'):_0x4768c4[_0xb652('0x69')]=_0xb652('0x6f');default:}_0x4768c4[_0xb652('0x70')]=(_0x5a153e===_0xb652('0x71')?moment(_0x5d5d6d[_0xb652('0x72')])['format']('YYYY-MM-DDTHH:mm:ss'):moment(_0x5d5d6d['agentcalledAt'])[_0xb652('0x2c')](_0xb652('0x64')))||moment()['format'](_0xb652('0x64'));_0x4768c4[_0xb652('0x73')]=_0x5a153e||_0xb652('0x74');_0x4768c4=_[_0xb652('0x75')](_0x4768c4,getCustomFields(_0x573426[_0xb652('0x76')],_0x5d5d6d));return request({'method':'POST','uri':_0xb652('0x3e')+_0x10ca6c+_0xb652('0x77'),'headers':{'Authorization':_0xb652('0x2f')+_0x58b1a5},'body':{'data':[_0x4768c4]},'json':!![]})['then'](function(_0x1b34de){if(_0x1b34de&&_0x1b34de['data'][0x0][_0xb652('0x78')]===_0xb652('0x45')){logger[_0xb652('0x35')](_0xb652('0x79'));return{'id':_0x1b34de['data'][0x0]['details']['id']};}})[_0xb652('0x26')](function(_0x52067e){logger[_0xb652('0x35')]('err',_0x52067e['stack']);console[_0xb652('0x48')](_0xb652('0x7a'),_0x52067e);});}exports[_0xb652('0x7b')]=function(_0x23b5c1,_0x2b0169,_0x239959,_0x3e8920,_0x1b3cd7,_0x238dab){var _0x17f2ab,_0x2c2a6d,_0x4e20e1;_0x238dab[_0xb652('0x7c')]=intUtil['stripTrailingSlash'](_0x238dab[_0xb652('0x7c')]);_0x238dab[_0xb652('0x7d')]=intUtil[_0xb652('0x7e')](_0x238dab['serverUrl']);if(_0x1b3cd7&&_0x1b3cd7[_0xb652('0x7f')]){logger[_0xb652('0x35')](_0xb652('0x80'),_0xb652('0x81'));_0x2b0169[_0xb652('0x82')]=_0x238dab[_0xb652('0x7d')]+_0xb652('0x83')+_0x2b0169['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x2b0169[_0xb652('0x84')]);}else{_0x2b0169[_0xb652('0x82')]='';}var _0x3c0d68=_0x238dab[_0xb652('0x7c')]===_0xb652('0x85')?'eu':_0xb652('0x86');return getAccessToken(_0x238dab)[_0xb652('0x30')](function(_0x10648a){_0x4e20e1=_0x10648a;return getUser(_0x4e20e1,_0x3c0d68,_0x238dab,_0x3e8920[_0xb652('0x34')]);})[_0xb652('0x30')](function(_0x2d1db5){_0x17f2ab=_0x2d1db5;logger[_0xb652('0x35')](_0xb652('0x87'),_0x17f2ab['id']);return getEndUser(_0x4e20e1,_0x3c0d68,_0x238dab,_0x2b0169[_0xb652('0x88')],_0x2b0169['calleridnum'],_0x17f2ab,_0x239959);})[_0xb652('0x30')](function(_0xed8a52){_0x2c2a6d=_0xed8a52;return getCall(_0x4e20e1,_0x3c0d68,_0x238dab,_0x17f2ab,_0x2c2a6d,_0x239959,_0x2b0169,_0xb652('0x74'));})[_0xb652('0x30')](function(_0x1acf3b){if(_0x1acf3b){logger[_0xb652('0x35')](_0xb652('0x89'),_0x1acf3b['id']);logger['info'](_0xb652('0x80'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xb652('0x2c')](_0xb652('0x8a'),_0x3e8920[_0xb652('0x15')]),_0xb652('0x8b'),{'uri':'https://crm.'+_0x238dab[_0xb652('0x7c')]+_0xb652('0x8c')+_0x1acf3b['id']});}})[_0xb652('0x26')](function(_0x5f4a02){logger['error'](_0xb652('0x80'),JSON[_0xb652('0x3c')](_0x5f4a02));});};exports[_0xb652('0x71')]=function(_0x23753,_0x5125a4,_0x1b6fff,_0xe6574c,_0xf7d6e1,_0x41b967,_0x3f7c69){var _0x1f8394,_0x33d392,_0x20051f;_0x41b967[_0xb652('0x7c')]=intUtil[_0xb652('0x7e')](_0x41b967[_0xb652('0x7c')]);_0x41b967[_0xb652('0x7d')]=intUtil[_0xb652('0x7e')](_0x41b967[_0xb652('0x7d')]);if(_0x3f7c69&&_0x3f7c69[_0xb652('0x8d')]&&_0x3f7c69[_0xb652('0x8d')]!=='none'){logger['info'](_0xb652('0x8e'),_0xb652('0x81'));_0x5125a4[_0xb652('0x82')]=_0x41b967[_0xb652('0x7d')]+_0xb652('0x83')+_0x5125a4[_0xb652('0x84')]+_0xb652('0x8f')+md5(_0x5125a4[_0xb652('0x84')]);}var _0x42556d=_0x41b967[_0xb652('0x7c')]===_0xb652('0x85')?'eu':_0xb652('0x86');return getAccessToken(_0x41b967)[_0xb652('0x30')](function(_0x55c630){_0x20051f=_0x55c630;return getUser(_0x20051f,_0x42556d,_0x41b967,_0xe6574c[_0xb652('0x34')]);})[_0xb652('0x30')](function(_0x38037b){_0x1f8394=_0x38037b;logger[_0xb652('0x35')]('The\x20User\x20ID\x20is:',_0x1f8394['id']);return getEndUser(_0x20051f,_0x42556d,_0x41b967,_0x5125a4[_0xb652('0x90')],_0x5125a4['destcalleridnum'],_0x1f8394,_0x1b6fff);})[_0xb652('0x30')](function(_0x556170){_0x33d392=_0x556170;return getCall(_0x20051f,_0x42556d,_0x41b967,_0x1f8394,_0x33d392,_0x1b6fff,_0x5125a4,_0xb652('0x91'));})[_0xb652('0x30')](function(_0x275848){if(_0x275848){logger['info'](_0xb652('0x89'),_0x275848['id']);logger[_0xb652('0x35')](_0xb652('0x8e'),_0xb652('0x92'));emit(util[_0xb652('0x2c')]('user:%s',_0xe6574c[_0xb652('0x15')]),'trigger:browser:url',{'uri':'https://crm.'+_0x41b967[_0xb652('0x7c')]+_0xb652('0x8c')+_0x275848['id']});}})[_0xb652('0x26')](function(_0x55b98b){logger[_0xb652('0x27')](_0xb652('0x8e'),JSON[_0xb652('0x3c')](_0x55b98b));});};exports['unmanaged']=function(_0x2d62f4,_0xb307ef,_0x3bad03,_0x54730c,_0x364512,_0x10f73a){var _0x1bfecb,_0x7a7887,_0xe69a2c;_0x10f73a['host']=intUtil[_0xb652('0x7e')](_0x10f73a[_0xb652('0x7c')]);_0x10f73a[_0xb652('0x7d')]=intUtil[_0xb652('0x7e')](_0x10f73a[_0xb652('0x7d')]);if(_0x364512&&_0x364512['monitor_format']){logger['info']('['+_0xb307ef['lastevent'][_0xb652('0x93')]()+']',_0xb652('0x81'));_0xb307ef[_0xb652('0x82')]=_0x10f73a['serverUrl']+_0xb652('0x83')+_0xb307ef[_0xb652('0x84')]+_0xb652('0x8f')+md5(_0xb307ef['uniqueid']);}else{_0xb307ef[_0xb652('0x82')]='';}var _0x47d0dd=_0x10f73a[_0xb652('0x7c')]===_0xb652('0x85')?'eu':_0xb652('0x86');return getAccessToken(_0x10f73a)['then'](function(_0x4e76dc){_0xe69a2c=_0x4e76dc;return getUser(_0xe69a2c,_0x47d0dd,_0x10f73a);})[_0xb652('0x30')](function(_0x124c97){_0x1bfecb=_0x124c97;logger[_0xb652('0x35')](_0xb652('0x87'),_0x1bfecb['id']);return getEndUser(_0xe69a2c,_0x47d0dd,_0x10f73a,_0xb307ef['calleridname'],_0xb307ef[_0xb652('0x94')],_0x1bfecb,_0x3bad03);})[_0xb652('0x30')](function(_0x5492ef){_0x7a7887=_0x5492ef;return getCall(_0xe69a2c,_0x47d0dd,_0x10f73a,_0x1bfecb,_0x7a7887,_0x3bad03,_0xb307ef,'Inbound');})[_0xb652('0x30')](function(_0x37693a){if(_0x37693a){logger[_0xb652('0x35')](_0xb652('0x89'),_0x37693a['id']);}})['catch'](function(_0x496359){logger['error']('['+_0xb307ef[_0xb652('0x66')][_0xb652('0x93')]()+']',JSON['stringify'](_0x496359));});}; \ No newline at end of file +var _0xa0e2=['outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Outbound','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','unmanaged','calleridname','toUpperCase','lodash','request-promise','md5','util','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','defaults','redis','emit','stringify','length','forEach','includes','string','picklist','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','split','isNil','isBefore','expires_in','access_token','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','then','add','seconds','catch','error','stack','info','Search\x20user','GET','format','ActiveUsers','users','findIndex','email','Agent\x20found!','profile','Administrator','user','Using\x20the\x20admin\x20account!','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','Zoho-oauthtoken\x20','code','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','nothing','Leads','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','utc','mm:ss','answertime','endtime','Call_Duration','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','called','Called','complete','connect','Call_Result','Answered','rejected','Rejected','Abandoned','timeout','Timeout','Call_Type','Inbound','Fields','/crm/v2/Calls','Call\x20created!','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:','calleridnum','The\x20Call\x20ID\x20is:','[QUEUE]','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id='];(function(_0xd82eb2,_0x504198){var _0x1b1c57=function(_0x1d6082){while(--_0x1d6082){_0xd82eb2['push'](_0xd82eb2['shift']());}};_0x1b1c57(++_0x504198);}(_0xa0e2,0xaa));var _0x2a0e=function(_0x235ceb,_0x903bb3){_0x235ceb=_0x235ceb-0x0;var _0x4974bf=_0xa0e2[_0x235ceb];return _0x4974bf;};'use strict';var _=require(_0x2a0e('0x0'));var rp=require(_0x2a0e('0x1'));var md5=require(_0x2a0e('0x2'));var util=require(_0x2a0e('0x3'));var intUtil=require(_0x2a0e('0x4'));var moment=require(_0x2a0e('0x5'));var Redis=require(_0x2a0e('0x6'));var BPromise=require(_0x2a0e('0x7'));var config=require(_0x2a0e('0x8'));var logger=require(_0x2a0e('0x9'))(_0x2a0e('0xa'));config['redis']=_[_0x2a0e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2a0e('0xc')]));function emit(_0x339857,_0x33ad16,_0x25e0bb){io['to'](_0x339857)[_0x2a0e('0xd')](_0x33ad16,_0x25e0bb);}function request(_0x4cbf43){logger['debug']('[HTTP]',JSON[_0x2a0e('0xe')](_0x4cbf43));return rp(_0x4cbf43);}function getCustomFields(_0x100d38,_0x3a5f8b){var _0x421f1e={};if(_0x100d38[_0x2a0e('0xf')]>0x0){_[_0x2a0e('0x10')](_0x100d38,function(_0x523ee6){if(_[_0x2a0e('0x11')]([_0x2a0e('0x12'),_0x2a0e('0x13')],_0x523ee6[_0x2a0e('0x14')])&&_0x523ee6[_0x2a0e('0x15')]){_0x421f1e[_0x523ee6[_0x2a0e('0x15')]]=_0x523ee6[_0x2a0e('0x16')][_0x2a0e('0x17')]();}else if(_0x523ee6[_0x2a0e('0x14')]===_0x2a0e('0x18')&&_0x523ee6[_0x2a0e('0x19')]&&_0x523ee6[_0x2a0e('0x15')]&&_0x3a5f8b[_0x523ee6[_0x2a0e('0x19')]]){_0x421f1e[_0x523ee6['idField']]=_0x3a5f8b[_0x523ee6[_0x2a0e('0x19')]][_0x2a0e('0x17')]();}else if(_0x523ee6[_0x2a0e('0x14')]===_0x2a0e('0x1a')&&_0x523ee6[_0x2a0e('0x1b')]&&_0x523ee6[_0x2a0e('0x1b')][_0x2a0e('0x1c')]&&_0x523ee6['idField']&&_0x3a5f8b[_0x523ee6[_0x2a0e('0x1b')][_0x2a0e('0x1c')][_0x2a0e('0x1d')]()]){_0x421f1e[_0x523ee6[_0x2a0e('0x15')]]=_0x3a5f8b[_0x523ee6[_0x2a0e('0x1b')]['name'][_0x2a0e('0x1d')]()][_0x2a0e('0x17')]();}});}return _0x421f1e;}function getName(_0x82240e){if(_0x82240e['indexOf']('\x20')>0x0){var _0x19972b=_0x82240e[_0x2a0e('0x1e')](/ (.+)/);if(_0x19972b[0x1]){return _0x19972b;}}return[_0x82240e,_0x82240e];}var accountsTokens={};function getAccessToken(_0x160c8f){return new Promise(function(_0x1b642d,_0x2f3795){if(!_[_0x2a0e('0x1f')](accountsTokens[_0x160c8f['id']])&&!_[_0x2a0e('0x1f')](accountsTokens[_0x160c8f['id']]['access_token'])){if(moment()[_0x2a0e('0x20')](accountsTokens[_0x160c8f['id']][_0x2a0e('0x21')])){_0x1b642d(accountsTokens[_0x160c8f['id']][_0x2a0e('0x22')]);}}var _0x1a9085;switch(_0x160c8f[_0x2a0e('0x23')]){case'US':_0x1a9085='https://accounts.zoho.com';break;case'AU':_0x1a9085=_0x2a0e('0x24');break;case'EU':_0x1a9085=_0x2a0e('0x25');break;case'IN':_0x1a9085='https://accounts.zoho.in';break;case'CN':_0x1a9085=_0x2a0e('0x26');break;default:_0x1a9085=_0x2a0e('0x25');break;}var _0x213719={'method':_0x2a0e('0x27'),'uri':_0x1a9085+_0x2a0e('0x28'),'qs':{'refresh_token':_0x160c8f[_0x2a0e('0x29')],'client_id':_0x160c8f[_0x2a0e('0x2a')],'client_secret':_0x160c8f[_0x2a0e('0x2b')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x213719)[_0x2a0e('0x2c')](function(_0x44f5b6){accountsTokens[_0x160c8f['id']]={'access_token':_0x44f5b6['access_token'],'expires_in':moment()[_0x2a0e('0x2d')](_0x44f5b6[_0x2a0e('0x21')],_0x2a0e('0x2e'))};_0x1b642d(_0x44f5b6['access_token']);})[_0x2a0e('0x2f')](function(_0x1beffb){logger[_0x2a0e('0x30')]('Failing\x20creating\x20the\x20access_token',_0x1beffb[_0x2a0e('0x31')]);_0x2f3795(_0x1beffb);});});}function getUser(_0x250f59,_0x1640c4,_0x2ecd43,_0x334814){logger[_0x2a0e('0x32')](_0x2a0e('0x33'));return request({'method':_0x2a0e('0x34'),'uri':util[_0x2a0e('0x35')]('https://www.zohoapis.%s/crm/v2/users',_0x1640c4),'qs':{'type':_0x2a0e('0x36')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x250f59},'json':!![]})[_0x2a0e('0x2c')](function(_0x766801){if(_0x766801['users']){var _0x7ffc62=-0x1;if(_['isArrayLikeObject'](_0x766801[_0x2a0e('0x37')])){if(!_['isNil'](_0x334814)){_0x7ffc62=_[_0x2a0e('0x38')](_0x766801[_0x2a0e('0x37')],function(_0x4f12f6){return _0x4f12f6[_0x2a0e('0x39')]===_0x334814;});}if(_0x7ffc62>=0x0){logger[_0x2a0e('0x32')](_0x2a0e('0x3a'));}else{logger['info']('Using\x20the\x20admin\x20account!');_0x7ffc62=_['findIndex'](_0x766801[_0x2a0e('0x37')],function(_0x26f97f){return _0x26f97f[_0x2a0e('0x3b')][_0x2a0e('0x1c')]===_0x2a0e('0x3c');});}return _0x766801[_0x2a0e('0x37')][_0x7ffc62];}else{if(_0x766801[_0x2a0e('0x3d')][_0x2a0e('0x3b')][_0x2a0e('0x1c')]===_0x2a0e('0x3c')){logger[_0x2a0e('0x32')](_0x2a0e('0x3e'));user=_0x766801[_0x2a0e('0x3d')];return user;}else{logger[_0x2a0e('0x30')](_0x2a0e('0x3f'),JSON[_0x2a0e('0xe')](_0x766801));throw new Error(_0x2a0e('0x40')+JSON[_0x2a0e('0xe')](_0x766801));}}}else{logger[_0x2a0e('0x30')](_0x2a0e('0x3f'),JSON[_0x2a0e('0xe')](_0x766801));throw new Error(_0x2a0e('0x40')+JSON[_0x2a0e('0xe')](_0x766801));}})[_0x2a0e('0x2f')](function(_0x778734){console[_0x2a0e('0x30')](_0x778734);});}function getZohoUser(_0x24f020,_0x13ddfc){return new BPromise(function(_0x2c4055,_0x213fef){request(_0x24f020)['then'](function(_0x59734f){var _0x293a8f=null;if(_0x59734f){_0x293a8f=_0x59734f[_0x2a0e('0x41')][0x0];_0x293a8f[_0x2a0e('0x42')]=_0x13ddfc;}_0x2c4055(_0x293a8f);})[_0x2a0e('0x2f')](function(_0xe4bccf){_0x213fef(_0xe4bccf);});});}function createEndUser(_0x4d8c6b,_0x53583e,_0x1f6db3,_0x40c0fc,_0x34f959,_0x27ddef){var _0x1f6db3=getName(_0x1f6db3);return request({'method':_0x2a0e('0x27'),'uri':_0x2a0e('0x43')+_0x53583e+_0x2a0e('0x44')+_[_0x2a0e('0x45')](_0x27ddef[_0x2a0e('0x46')])+'s','body':{'data':[{'Last_Name':_0x1f6db3[0x1],'First_Name':_0x1f6db3[0x0],'Phone':_0x40c0fc,'Owner':{'name':!_[_0x2a0e('0x1f')](_0x34f959[_0x2a0e('0x47')][_0x2a0e('0x1c')])?_0x34f959['role'][_0x2a0e('0x1c')]:!_[_0x2a0e('0x1f')](_0x34f959[_0x2a0e('0x48')])?_0x34f959[_0x2a0e('0x48')]+'\x20'+_0x34f959[_0x2a0e('0x49')]:_0x34f959[_0x2a0e('0x49')],'id':_0x34f959['id']}}]},'headers':{'Authorization':_0x2a0e('0x4a')+_0x4d8c6b},'json':!![]})[_0x2a0e('0x2c')](function(_0x573f22){if(_0x573f22&&_0x573f22[_0x2a0e('0x41')][0x0][_0x2a0e('0x4b')]==='SUCCESS'){var _0xc6124a=_0x573f22[_0x2a0e('0x41')][0x0]['details'];_0xc6124a[_0x2a0e('0x42')]=_['startCase'](_0x27ddef[_0x2a0e('0x46')])+'s';return _0xc6124a;}logger['error']('The\x20failing\x20result\x20is',JSON[_0x2a0e('0xe')](data));throw new Error(_0x2a0e('0x4c')+JSON[_0x2a0e('0xe')](data));})[_0x2a0e('0x2f')](function(_0x12f9da){console[_0x2a0e('0x4d')](_0x2a0e('0x4e'),_0x12f9da);});}function getEndUser(_0x42269c,_0x46b2a5,_0x5ce514,_0x538a92,_0x78cde8,_0x571d9e,_0xd0223a){var _0x55b7d7={'method':_0x2a0e('0x34'),'uri':'','headers':{'Authorization':_0x2a0e('0x4a')+_0x42269c},'json':!![]};switch(_0xd0223a[_0x2a0e('0x4f')]){case _0x2a0e('0x50'):_0x55b7d7[_0x2a0e('0x51')]=_0x2a0e('0x43')+_0x46b2a5+_0x2a0e('0x52')+_0x78cde8+'))';return getZohoUser(_0x55b7d7,_0x2a0e('0x53'))[_0x2a0e('0x2c')](function(_0x1662c5){if(_0x1662c5)return _0x1662c5;_0x55b7d7[_0x2a0e('0x51')]=_0x2a0e('0x43')+_0x46b2a5+_0x2a0e('0x54')+_0x78cde8+'))';return getZohoUser(_0x55b7d7,'Leads')['then'](function(_0x387efc){if(_0x387efc)return _0x387efc;if(_0xd0223a[_0x2a0e('0x46')]!=_0x2a0e('0x55')){return createEndUser(_0x42269c,_0x46b2a5,_0x538a92,_0x78cde8,_0x571d9e,_0xd0223a);}else{return{};}});});break;case'contact':_0x55b7d7['uri']=_0x2a0e('0x43')+_0x46b2a5+_0x2a0e('0x52')+_0x78cde8+'))';return getZohoUser(_0x55b7d7,_0x2a0e('0x53'))[_0x2a0e('0x2c')](function(_0x5504f5){if(_0x5504f5)return _0x5504f5;if(_0xd0223a['moduleCreate']!=_0x2a0e('0x55')){return createEndUser(_0x42269c,_0x46b2a5,_0x538a92,_0x78cde8,_0x571d9e,_0xd0223a);}else{return{};}});break;case'lead':_0x55b7d7[_0x2a0e('0x51')]=_0x2a0e('0x43')+_0x46b2a5+_0x2a0e('0x54')+_0x78cde8+'))';return getZohoUser(_0x55b7d7,_0x2a0e('0x56'))['then'](function(_0x103ab8){if(_0x103ab8)return _0x103ab8;if(_0xd0223a[_0x2a0e('0x46')]!=_0x2a0e('0x55')){return createEndUser(_0x42269c,_0x46b2a5,_0x538a92,_0x78cde8,_0x571d9e,_0xd0223a);}else{return{};}});break;}}function getCall(_0x1088fe,_0x27ed95,_0x1cfeef,_0x308b8d,_0x48b6d4,_0x4fbf17,_0x58908c,_0x40e35c){logger[_0x2a0e('0x32')](_0x2a0e('0x57'));var _0x42d7b7={};_0x42d7b7[_0x2a0e('0x58')]={'name':!_[_0x2a0e('0x1f')](_0x308b8d[_0x2a0e('0x47')][_0x2a0e('0x1c')])&&!_[_0x2a0e('0x1f')](_0x308b8d[_0x2a0e('0x3b')][_0x2a0e('0x1c')])&&_0x308b8d[_0x2a0e('0x3b')][_0x2a0e('0x1c')]===_0x2a0e('0x59')?_0x308b8d[_0x2a0e('0x47')][_0x2a0e('0x1c')]:!_[_0x2a0e('0x1f')](_0x308b8d[_0x2a0e('0x48')])?_0x308b8d[_0x2a0e('0x48')]+'\x20'+_0x308b8d[_0x2a0e('0x49')]:_0x308b8d[_0x2a0e('0x49')],'id':_0x308b8d['id']};_0x42d7b7[_0x2a0e('0x5a')]=intUtil[_0x2a0e('0x5b')](_0x4fbf17[_0x2a0e('0x5c')],_0x58908c,'\x20');_0x42d7b7[_0x2a0e('0x5d')]=intUtil[_0x2a0e('0x5b')](_0x4fbf17[_0x2a0e('0x5e')],_0x58908c,'\x0a');if(_0x48b6d4[_0x2a0e('0x42')]===_0x2a0e('0x53')){_0x42d7b7[_0x2a0e('0x5f')]={'name':!_['isNil'](_0x48b6d4['Full_Name'])?_0x48b6d4[_0x2a0e('0x60')]:!_[_0x2a0e('0x1f')](_0x48b6d4[_0x2a0e('0x61')])?_0x48b6d4[_0x2a0e('0x61')]+'\x20'+_0x48b6d4['Last_Name']:_0x48b6d4[_0x2a0e('0x62')],'id':_0x48b6d4['id']};}if(_0x48b6d4[_0x2a0e('0x42')]===_0x2a0e('0x56')){_0x42d7b7[_0x2a0e('0x63')]={'name':!_[_0x2a0e('0x1f')](_0x48b6d4[_0x2a0e('0x60')])?_0x48b6d4[_0x2a0e('0x60')]:!_[_0x2a0e('0x1f')](_0x48b6d4[_0x2a0e('0x61')])?_0x48b6d4['First_Name']+'\x20'+_0x48b6d4['Last_Name']:_0x48b6d4['Last_Name'],'id':_0x48b6d4['id']};_0x42d7b7[_0x2a0e('0x64')]=_[_0x2a0e('0x45')](_0x48b6d4[_0x2a0e('0x42')]);}if(_0x58908c[_0x2a0e('0x65')]){_0x42d7b7['Call_Duration']=moment[_0x2a0e('0x66')](parseInt(_0x58908c[_0x2a0e('0x65')])*0x3e8)[_0x2a0e('0x35')](_0x2a0e('0x67'));}else if(_0x58908c[_0x2a0e('0x68')]&&_0x58908c[_0x2a0e('0x69')]){_0x42d7b7[_0x2a0e('0x6a')]=moment['utc'](moment(_0x58908c[_0x2a0e('0x69')],_0x2a0e('0x6b'))[_0x2a0e('0x6c')](moment(_0x58908c[_0x2a0e('0x6d')],_0x2a0e('0x6b'))))[_0x2a0e('0x35')]('mm:ss');}switch(_0x58908c[_0x2a0e('0x6e')]){case _0x2a0e('0x6f'):_0x42d7b7['Call_Result']=_0x2a0e('0x70');break;case _0x2a0e('0x71'):case _0x2a0e('0x72'):_0x42d7b7[_0x2a0e('0x73')]=_0x2a0e('0x74');break;case _0x2a0e('0x75'):_0x42d7b7['Call_Result']=_0x2a0e('0x76');break;case'abandoned':_0x42d7b7['Call_Result']=_0x2a0e('0x77');break;case _0x2a0e('0x78'):_0x42d7b7['Call_Result']=_0x2a0e('0x79');default:}_0x42d7b7['Call_Start_Time']=(_0x40e35c==='outbound'?moment(_0x58908c[_0x2a0e('0x6d')])['format'](_0x2a0e('0x6b')):moment(_0x58908c['agentcalledAt'])[_0x2a0e('0x35')](_0x2a0e('0x6b')))||moment()[_0x2a0e('0x35')](_0x2a0e('0x6b'));_0x42d7b7[_0x2a0e('0x7a')]=_0x40e35c||_0x2a0e('0x7b');_0x42d7b7=_['merge'](_0x42d7b7,getCustomFields(_0x4fbf17[_0x2a0e('0x7c')],_0x58908c));return request({'method':_0x2a0e('0x27'),'uri':_0x2a0e('0x43')+_0x27ed95+_0x2a0e('0x7d'),'headers':{'Authorization':_0x2a0e('0x4a')+_0x1088fe},'body':{'data':[_0x42d7b7]},'json':!![]})['then'](function(_0xf4500a){if(_0xf4500a&&_0xf4500a[_0x2a0e('0x41')][0x0]['code']==='SUCCESS'){logger[_0x2a0e('0x32')](_0x2a0e('0x7e'));return{'id':_0xf4500a[_0x2a0e('0x41')][0x0]['details']['id']};}})[_0x2a0e('0x2f')](function(_0x1c4357){logger[_0x2a0e('0x32')](_0x2a0e('0x7f'),_0x1c4357[_0x2a0e('0x31')]);console[_0x2a0e('0x4d')](_0x2a0e('0x7f'),_0x1c4357);});}exports[_0x2a0e('0x80')]=function(_0x1531bc,_0x38dee7,_0x21dd92,_0x422dfc,_0x242ba3,_0x2e09cf){var _0x53b861,_0x37813b,_0x54d484;_0x2e09cf[_0x2a0e('0x81')]=intUtil[_0x2a0e('0x82')](_0x2e09cf[_0x2a0e('0x81')]);_0x2e09cf[_0x2a0e('0x83')]=intUtil[_0x2a0e('0x82')](_0x2e09cf[_0x2a0e('0x83')]);if(_0x242ba3&&_0x242ba3[_0x2a0e('0x84')]){logger[_0x2a0e('0x32')]('[QUEUE]','Recording\x20is\x20enabled!');_0x38dee7[_0x2a0e('0x85')]=_0x2e09cf[_0x2a0e('0x83')]+_0x2a0e('0x86')+_0x38dee7[_0x2a0e('0x87')]+_0x2a0e('0x88')+md5(_0x38dee7[_0x2a0e('0x87')]);}else{_0x38dee7[_0x2a0e('0x85')]='';}var _0x408c95=_0x2e09cf[_0x2a0e('0x81')]===_0x2a0e('0x89')?'eu':_0x2a0e('0x8a');return getAccessToken(_0x2e09cf)[_0x2a0e('0x2c')](function(_0x3f8666){_0x54d484=_0x3f8666;return getUser(_0x54d484,_0x408c95,_0x2e09cf,_0x422dfc[_0x2a0e('0x39')]);})[_0x2a0e('0x2c')](function(_0x33a8b6){_0x53b861=_0x33a8b6;logger[_0x2a0e('0x32')](_0x2a0e('0x8b'),_0x53b861['id']);return getEndUser(_0x54d484,_0x408c95,_0x2e09cf,_0x38dee7['calleridname'],_0x38dee7[_0x2a0e('0x8c')],_0x53b861,_0x21dd92);})['then'](function(_0x495ae6){_0x37813b=_0x495ae6;return getCall(_0x54d484,_0x408c95,_0x2e09cf,_0x53b861,_0x37813b,_0x21dd92,_0x38dee7,_0x2a0e('0x7b'));})[_0x2a0e('0x2c')](function(_0x240c12){if(_0x240c12){logger[_0x2a0e('0x32')](_0x2a0e('0x8d'),_0x240c12['id']);logger['info'](_0x2a0e('0x8e'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x2a0e('0x35')]('user:%s',_0x422dfc[_0x2a0e('0x1c')]),_0x2a0e('0x8f'),{'uri':_0x2a0e('0x90')+_0x2e09cf[_0x2a0e('0x81')]+_0x2a0e('0x91')+_0x240c12['id']});}})['catch'](function(_0x426b70){logger[_0x2a0e('0x30')](_0x2a0e('0x8e'),JSON['stringify'](_0x426b70));});};exports[_0x2a0e('0x92')]=function(_0xf3904b,_0x47c2d0,_0x150fec,_0x2a5b9d,_0x1bb0e9,_0xb385a2,_0x5f22ea){var _0x5b5de7,_0x597af5,_0x1e1d6f;_0xb385a2[_0x2a0e('0x81')]=intUtil[_0x2a0e('0x82')](_0xb385a2[_0x2a0e('0x81')]);_0xb385a2[_0x2a0e('0x83')]=intUtil[_0x2a0e('0x82')](_0xb385a2['serverUrl']);if(_0x5f22ea&&_0x5f22ea[_0x2a0e('0x93')]&&_0x5f22ea['recordingFormat']!==_0x2a0e('0x94')){logger[_0x2a0e('0x32')](_0x2a0e('0x95'),_0x2a0e('0x96'));_0x47c2d0['recordingURL']=_0xb385a2['serverUrl']+_0x2a0e('0x86')+_0x47c2d0[_0x2a0e('0x87')]+_0x2a0e('0x88')+md5(_0x47c2d0['uniqueid']);}var _0x1e0e5f=_0xb385a2['host']==='zoho.eu'?'eu':'com';return getAccessToken(_0xb385a2)[_0x2a0e('0x2c')](function(_0x28e877){_0x1e1d6f=_0x28e877;return getUser(_0x1e1d6f,_0x1e0e5f,_0xb385a2,_0x2a5b9d['email']);})[_0x2a0e('0x2c')](function(_0x337474){_0x5b5de7=_0x337474;logger[_0x2a0e('0x32')](_0x2a0e('0x8b'),_0x5b5de7['id']);return getEndUser(_0x1e1d6f,_0x1e0e5f,_0xb385a2,_0x47c2d0[_0x2a0e('0x97')],_0x47c2d0[_0x2a0e('0x98')],_0x5b5de7,_0x150fec);})[_0x2a0e('0x2c')](function(_0x430643){_0x597af5=_0x430643;return getCall(_0x1e1d6f,_0x1e0e5f,_0xb385a2,_0x5b5de7,_0x597af5,_0x150fec,_0x47c2d0,_0x2a0e('0x99'));})[_0x2a0e('0x2c')](function(_0x3972fc){if(_0x3972fc){logger[_0x2a0e('0x32')](_0x2a0e('0x8d'),_0x3972fc['id']);logger[_0x2a0e('0x32')](_0x2a0e('0x95'),_0x2a0e('0x9a'));emit(util['format']('user:%s',_0x2a5b9d[_0x2a0e('0x1c')]),'trigger:browser:url',{'uri':_0x2a0e('0x90')+_0xb385a2[_0x2a0e('0x81')]+_0x2a0e('0x91')+_0x3972fc['id']});}})[_0x2a0e('0x2f')](function(_0x3ef98a){logger[_0x2a0e('0x30')](_0x2a0e('0x95'),JSON['stringify'](_0x3ef98a));});};exports[_0x2a0e('0x9b')]=function(_0x14f1dc,_0x2f25b4,_0x2c4d45,_0x2375ff,_0x1e0177,_0x229f83){var _0x1f27e0,_0x137820,_0x21ae99;_0x229f83[_0x2a0e('0x81')]=intUtil[_0x2a0e('0x82')](_0x229f83[_0x2a0e('0x81')]);_0x229f83[_0x2a0e('0x83')]=intUtil['stripTrailingSlash'](_0x229f83[_0x2a0e('0x83')]);if(_0x1e0177&&_0x1e0177['monitor_format']){logger['info']('['+_0x2f25b4[_0x2a0e('0x6e')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x2f25b4['recordingURL']=_0x229f83['serverUrl']+_0x2a0e('0x86')+_0x2f25b4[_0x2a0e('0x87')]+'/downloads?type=uniqueid&token='+md5(_0x2f25b4['uniqueid']);}else{_0x2f25b4[_0x2a0e('0x85')]='';}var _0x5b7061=_0x229f83[_0x2a0e('0x81')]===_0x2a0e('0x89')?'eu':_0x2a0e('0x8a');return getAccessToken(_0x229f83)[_0x2a0e('0x2c')](function(_0x55d23e){_0x21ae99=_0x55d23e;return getUser(_0x21ae99,_0x5b7061,_0x229f83);})[_0x2a0e('0x2c')](function(_0x3a01e9){_0x1f27e0=_0x3a01e9;logger[_0x2a0e('0x32')]('The\x20User\x20ID\x20is:',_0x1f27e0['id']);return getEndUser(_0x21ae99,_0x5b7061,_0x229f83,_0x2f25b4[_0x2a0e('0x9c')],_0x2f25b4[_0x2a0e('0x8c')],_0x1f27e0,_0x2c4d45);})[_0x2a0e('0x2c')](function(_0x4cf625){_0x137820=_0x4cf625;return getCall(_0x21ae99,_0x5b7061,_0x229f83,_0x1f27e0,_0x137820,_0x2c4d45,_0x2f25b4,'Inbound');})[_0x2a0e('0x2c')](function(_0x204ebd){if(_0x204ebd){logger['info'](_0x2a0e('0x8d'),_0x204ebd['id']);}})['catch'](function(_0x67f6ce){logger[_0x2a0e('0x30')]('['+_0x2f25b4[_0x2a0e('0x6e')][_0x2a0e('0x9d')]()+']',JSON[_0x2a0e('0xe')](_0x67f6ce));});}; \ 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 ff79ad4..9cdb10f 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 _0xf91e=['render','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','shelljs','mustache','../../../../config/logger','trigger'];(function(_0x3005d5,_0xf588c7){var _0x547c7e=function(_0x4514dc){while(--_0x4514dc){_0x3005d5['push'](_0x3005d5['shift']());}};_0x547c7e(++_0xf588c7);}(_0xf91e,0xee));var _0xef91=function(_0x1803e1,_0x410fef){_0x1803e1=_0x1803e1-0x0;var _0x14c015=_0xf91e[_0x1803e1];return _0x14c015;};'use strict';var util=require('util');var sh=require(_0xef91('0x0'));var Mustache=require(_0xef91('0x1'));var logger=require(_0xef91('0x2'))(_0xef91('0x3'));exports['exec']=function(_0xcbbb0b,_0x519171){var _0x5e76ff=_0xcbbb0b['data2']?_0xcbbb0b['data2']:'Script';var _0x3e0d1b=_0xcbbb0b['data3']?Mustache[_0xef91('0x4')](_0xcbbb0b[_0xef91('0x5')],_0x519171):_0x519171;sh['exec'](_0x3e0d1b,function(_0x3a9618,_0x52037d,_0x38579d){if(_0x3a9618!==0x0){logger[_0xef91('0x6')](util[_0xef91('0x7')](_0xef91('0x8'),_0x5e76ff,_0x3e0d1b,_0x3a9618,_0x38579d));}else{logger[_0xef91('0x9')](util['format'](_0xef91('0xa'),_0x5e76ff,_0x3e0d1b,_0x52037d));}});}; \ No newline at end of file +var _0x1f9e=['info','mustache','../../../../config/logger','trigger','exec','data2','Script','render','data3','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s'];(function(_0x4178b0,_0xf5e57b){var _0x499921=function(_0x230c99){while(--_0x230c99){_0x4178b0['push'](_0x4178b0['shift']());}};_0x499921(++_0xf5e57b);}(_0x1f9e,0xdd));var _0xe1f9=function(_0x4af01e,_0x543f5c){_0x4af01e=_0x4af01e-0x0;var _0x178c11=_0x1f9e[_0x4af01e];return _0x178c11;};'use strict';var util=require('util');var sh=require('shelljs');var Mustache=require(_0xe1f9('0x0'));var logger=require(_0xe1f9('0x1'))(_0xe1f9('0x2'));exports[_0xe1f9('0x3')]=function(_0xa8607b,_0x4e8b63){var _0x50ddf4=_0xa8607b[_0xe1f9('0x4')]?_0xa8607b[_0xe1f9('0x4')]:_0xe1f9('0x5');var _0x2ae687=_0xa8607b['data3']?Mustache[_0xe1f9('0x6')](_0xa8607b[_0xe1f9('0x7')],_0x4e8b63):_0x4e8b63;sh[_0xe1f9('0x3')](_0x2ae687,function(_0x4783be,_0x56125b,_0x3dae96){if(_0x4783be!==0x0){logger['error'](util[_0xe1f9('0x8')](_0xe1f9('0x9'),_0x50ddf4,_0x2ae687,_0x4783be,_0x3dae96));}else{logger[_0xe1f9('0xa')](util[_0xe1f9('0x8')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x50ddf4,_0x2ae687,_0x56125b));}});}; \ 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 3412802..ce72a9a 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 _0xc793=['data2','isNil',',\x20request\x20body:\x20','object','info','statusCode','name','message','util','../../../../config/logger','trigger','exec','data1','render','data5','data6','parse','error','GET','DELETE','PUT','data7','body','stack','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s'];(function(_0x4685e4,_0x51031f){var _0x5abd59=function(_0x3257d7){while(--_0x3257d7){_0x4685e4['push'](_0x4685e4['shift']());}};_0x5abd59(++_0x51031f);}(_0xc793,0x1b8));var _0x3c79=function(_0x488bfc,_0xfa00ea){_0x488bfc=_0x488bfc-0x0;var _0xe292c3=_0xc793[_0x488bfc];return _0xe292c3;};'use strict';var rp=require('request-promise');var util=require(_0x3c79('0x0'));var _=require('lodash');var Mustache=require('mustache');var logger=require(_0x3c79('0x1'))(_0x3c79('0x2'));exports[_0x3c79('0x3')]=function(_0x57e8bb,_0x49466a){var _0x4077ee,_0x359e0d;var _0x414435={'method':_0x57e8bb[_0x3c79('0x4')]['toUpperCase'](),'uri':Mustache[_0x3c79('0x5')](_0x57e8bb['data2'],_0x49466a),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x57e8bb['data5'])==='number'&&parseInt(_0x57e8bb[_0x3c79('0x6')])>=0x1&&parseInt(_0x57e8bb[_0x3c79('0x6')])<=0xa?parseInt(_0x57e8bb[_0x3c79('0x6')])*0x3e8:0x5*0x3e8};try{_0x414435['headers']=_0x57e8bb[_0x3c79('0x7')]?JSON[_0x3c79('0x8')](Mustache[_0x3c79('0x5')](_0x57e8bb[_0x3c79('0x7')],_0x49466a)):{};}catch(_0x498a03){logger[_0x3c79('0x9')](_0x498a03['stack']);}switch(_0x57e8bb[_0x3c79('0x4')]['toUpperCase']()){case _0x3c79('0xa'):case _0x3c79('0xb'):_0x4077ee=null;_0x414435['qs']=_0x49466a;break;case'POST':case _0x3c79('0xc'):if(_0x57e8bb[_0x3c79('0xd')]){try{_0x4077ee=JSON[_0x3c79('0x8')](Mustache[_0x3c79('0x5')](_0x57e8bb[_0x3c79('0xd')],_0x49466a));_0x414435[_0x3c79('0xe')]=_0x4077ee;}catch(_0x4dbe79){logger[_0x3c79('0x9')](_0x4dbe79[_0x3c79('0xf')]);logger[_0x3c79('0x9')](_0x3c79('0x10'));}}else{_0x4077ee=_0x49466a;_0x414435[_0x3c79('0xe')]=_0x4077ee;}break;}logger['info'](util[_0x3c79('0x11')](_0x3c79('0x12'),_0x57e8bb[_0x3c79('0x4')],_0x57e8bb[_0x3c79('0x13')],JSON['stringify'](_0x414435)));rp(_0x414435)['then'](function(_0x31130d){_0x4077ee=!_[_0x3c79('0x14')](_0x4077ee)?_0x3c79('0x15')+_0x4077ee:'';_0x359e0d=typeof _0x31130d[_0x3c79('0xe')]===_0x3c79('0x16')?JSON['stringify'](_0x31130d[_0x3c79('0xe')]):_0x31130d[_0x3c79('0xe')];logger[_0x3c79('0x17')](util[_0x3c79('0x11')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x57e8bb[_0x3c79('0x4')],_0x57e8bb[_0x3c79('0x13')],_0x31130d[_0x3c79('0x18')],_0x359e0d));})['catch'](function(_0x4d3ed9){logger[_0x3c79('0x9')](util[_0x3c79('0x11')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x57e8bb[_0x3c79('0x4')],_0x57e8bb[_0x3c79('0x13')],_0x4d3ed9['statusCode'],_0x4d3ed9[_0x3c79('0x19')],_0x4d3ed9[_0x3c79('0x1a')]));});}; \ No newline at end of file +var _0xfdcd=['number','data5','data6','parse','error','stack','GET','DELETE','POST','PUT','data7','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','body','info','format','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','name','message','util','lodash','../../../../config/logger','trigger','data1','toUpperCase','render','data2'];(function(_0x2e1d26,_0x1a1b10){var _0x1642e6=function(_0x40c896){while(--_0x40c896){_0x2e1d26['push'](_0x2e1d26['shift']());}};_0x1642e6(++_0x1a1b10);}(_0xfdcd,0xb8));var _0xdfdc=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xfdcd[_0x2dafbe];return _0x58a45a;};'use strict';var rp=require('request-promise');var util=require(_0xdfdc('0x0'));var _=require(_0xdfdc('0x1'));var Mustache=require('mustache');var logger=require(_0xdfdc('0x2'))(_0xdfdc('0x3'));exports['exec']=function(_0x407b21,_0x225d3d){var _0x449ce6,_0x312b49;var _0x29f78d={'method':_0x407b21[_0xdfdc('0x4')][_0xdfdc('0x5')](),'uri':Mustache[_0xdfdc('0x6')](_0x407b21[_0xdfdc('0x7')],_0x225d3d),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x407b21['data5'])===_0xdfdc('0x8')&&parseInt(_0x407b21['data5'])>=0x1&&parseInt(_0x407b21[_0xdfdc('0x9')])<=0xa?parseInt(_0x407b21['data5'])*0x3e8:0x5*0x3e8};try{_0x29f78d['headers']=_0x407b21[_0xdfdc('0xa')]?JSON[_0xdfdc('0xb')](Mustache[_0xdfdc('0x6')](_0x407b21['data6'],_0x225d3d)):{};}catch(_0x58af9b){logger[_0xdfdc('0xc')](_0x58af9b[_0xdfdc('0xd')]);}switch(_0x407b21[_0xdfdc('0x4')][_0xdfdc('0x5')]()){case _0xdfdc('0xe'):case _0xdfdc('0xf'):_0x449ce6=null;_0x29f78d['qs']=_0x225d3d;break;case _0xdfdc('0x10'):case _0xdfdc('0x11'):if(_0x407b21[_0xdfdc('0x12')]){try{_0x449ce6=JSON[_0xdfdc('0xb')](Mustache[_0xdfdc('0x6')](_0x407b21['data7'],_0x225d3d));_0x29f78d['body']=_0x449ce6;}catch(_0x7b9759){logger[_0xdfdc('0xc')](_0x7b9759[_0xdfdc('0xd')]);logger[_0xdfdc('0xc')](_0xdfdc('0x13'));}}else{_0x449ce6=_0x225d3d;_0x29f78d[_0xdfdc('0x14')]=_0x449ce6;}break;}logger[_0xdfdc('0x15')](util[_0xdfdc('0x16')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x407b21[_0xdfdc('0x4')],_0x407b21[_0xdfdc('0x7')],JSON[_0xdfdc('0x17')](_0x29f78d)));rp(_0x29f78d)[_0xdfdc('0x18')](function(_0x26da60){_0x449ce6=!_[_0xdfdc('0x19')](_0x449ce6)?_0xdfdc('0x1a')+_0x449ce6:'';_0x312b49=typeof _0x26da60[_0xdfdc('0x14')]===_0xdfdc('0x1b')?JSON[_0xdfdc('0x17')](_0x26da60[_0xdfdc('0x14')]):_0x26da60[_0xdfdc('0x14')];logger[_0xdfdc('0x15')](util[_0xdfdc('0x16')](_0xdfdc('0x1c'),_0x407b21['data1'],_0x407b21[_0xdfdc('0x7')],_0x26da60[_0xdfdc('0x1d')],_0x312b49));})['catch'](function(_0x48148f){logger[_0xdfdc('0xc')](util[_0xdfdc('0x16')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x407b21[_0xdfdc('0x4')],_0x407b21['data2'],_0x48148f['statusCode'],_0x48148f[_0xdfdc('0x1e')],_0x48148f[_0xdfdc('0x1f')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 49c4bc0..6cbf91a 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 _0xfc4c=['client','Request','request','then','debug','rpc','error','message','catch','bluebird','routing'];(function(_0xc2964c,_0x4c165a){var _0x5a0801=function(_0x5de92d){while(--_0x5de92d){_0xc2964c['push'](_0xc2964c['shift']());}};_0x5a0801(++_0x4c165a);}(_0xfc4c,0x1c1));var _0xcfc4=function(_0x59537c,_0x4f7a78){_0x59537c=_0x59537c-0x0;var _0x360c34=_0xfc4c[_0x59537c];return _0x360c34;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xcfc4('0x0'));var logger=require('../../config/logger')(_0xcfc4('0x1'));var client=jayson[_0xcfc4('0x2')]['http']({'port':0x2329});client[_0xcfc4('0x3')]=function(_0x25a08e,_0x44fe54){return new BPromise(function(_0x28a671,_0x1e40bb){return client[_0xcfc4('0x4')](_0x25a08e,_0x44fe54)[_0xcfc4('0x5')](function(_0x51ce3d){logger[_0xcfc4('0x6')](_0xcfc4('0x7'),'routing',_0x25a08e,_0x44fe54,_0x51ce3d);if(_0x51ce3d['error']){logger[_0xcfc4('0x8')](_0xcfc4('0x7'),_0xcfc4('0x1'),_0x25a08e,_0x51ce3d[_0xcfc4('0x8')][_0xcfc4('0x9')],_0x44fe54);return _0x1e40bb(_0x51ce3d[_0xcfc4('0x8')][_0xcfc4('0x9')]);}else{return _0x28a671(_0x51ce3d['result']);}})[_0xcfc4('0xa')](function(_0x473937){logger['error'](_0xcfc4('0x7'),_0xcfc4('0x1'),_0x25a08e,_0x473937,_0x44fe54);return _0x1e40bb(_0x473937);});});};module['exports']=client; \ No newline at end of file +var _0xe198=['request','debug','rpc','error','message','result','exports','jayson/promise','bluebird','routing','http','Request'];(function(_0x53f3d9,_0xf23c6e){var _0x17a455=function(_0x36e9d3){while(--_0x36e9d3){_0x53f3d9['push'](_0x53f3d9['shift']());}};_0x17a455(++_0xf23c6e);}(_0xe198,0x163));var _0x8e19=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xe198[_0x2064e5];return _0x21a233;};'use strict';var jayson=require(_0x8e19('0x0'));var BPromise=require(_0x8e19('0x1'));var logger=require('../../config/logger')(_0x8e19('0x2'));var client=jayson['client'][_0x8e19('0x3')]({'port':0x2329});client[_0x8e19('0x4')]=function(_0x192730,_0x41acd1){return new BPromise(function(_0xa621d,_0x49a9b9){return client[_0x8e19('0x5')](_0x192730,_0x41acd1)['then'](function(_0x180193){logger[_0x8e19('0x6')](_0x8e19('0x7'),_0x8e19('0x2'),_0x192730,_0x41acd1,_0x180193);if(_0x180193[_0x8e19('0x8')]){logger[_0x8e19('0x8')](_0x8e19('0x7'),_0x8e19('0x2'),_0x192730,_0x180193[_0x8e19('0x8')][_0x8e19('0x9')],_0x41acd1);return _0x49a9b9(_0x180193[_0x8e19('0x8')]['message']);}else{return _0xa621d(_0x180193[_0x8e19('0xa')]);}})['catch'](function(_0x47c600){logger['error']('rpc',_0x8e19('0x2'),_0x192730,_0x47c600,_0x41acd1);return _0x49a9b9(_0x47c600);});});};module[_0x8e19('0xb')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 0b3d5ac..05ed71c 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 _0xb7d7=['../../config/logger','email','resolve','then','getMailAccounts','initMailAccounts','mailAccounts','listen','getSettings','loginMailFrequency','catch','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting'];(function(_0x4274dc,_0x1a5252){var _0x240bfa=function(_0x38d8f7){while(--_0x38d8f7){_0x4274dc['push'](_0x4274dc['shift']());}};_0x240bfa(++_0x1a5252);}(_0xb7d7,0xcb));var _0x7b7d=function(_0x461527,_0x2d0437){_0x461527=_0x461527-0x0;var _0x247ebb=_0xb7d7[_0x461527];return _0x247ebb;};'use strict';var server=require(_0x7b7d('0x0'));var Realtime=require(_0x7b7d('0x1'));var EmailChannel=require(_0x7b7d('0x2'));var mailAccount=require(_0x7b7d('0x3'));var setting=require(_0x7b7d('0x4'));var logger=require(_0x7b7d('0x5'))(_0x7b7d('0x6'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x7b7d('0x7')]()[_0x7b7d('0x8')](mailAccount[_0x7b7d('0x9')]())['then'](realtime[_0x7b7d('0xa')]())['then'](function(){email['refresh'](realtime[_0x7b7d('0xb')]);return realtime;});}function main(){return server[_0x7b7d('0xc')](realtime,email)[_0x7b7d('0x8')](function(){return initRealtime();})[_0x7b7d('0x8')](function(){return setting[_0x7b7d('0xd')]();})[_0x7b7d('0x8')](function(_0x25d562){return setInterval(initRealtime,_0x25d562[_0x7b7d('0xe')]*0x3e8);})[_0x7b7d('0xf')](function(_0x94260c){logger['error']('Email\x20service\x20initialization',_0x94260c);});}main(); \ No newline at end of file +var _0xc274=['loginMailFrequency','error','Email\x20service\x20initialization','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','resolve','then','initMailAccounts','refresh','mailAccounts','listen','getSettings'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xc274,0x93));var _0x4c27=function(_0x1d97fb,_0x475e43){_0x1d97fb=_0x1d97fb-0x0;var _0x595579=_0xc274[_0x1d97fb];return _0x595579;};'use strict';var server=require(_0x4c27('0x0'));var Realtime=require(_0x4c27('0x1'));var EmailChannel=require(_0x4c27('0x2'));var mailAccount=require(_0x4c27('0x3'));var setting=require(_0x4c27('0x4'));var logger=require(_0x4c27('0x5'))('email');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x4c27('0x6')]()[_0x4c27('0x7')](mailAccount['getMailAccounts']())['then'](realtime[_0x4c27('0x8')]())['then'](function(){email[_0x4c27('0x9')](realtime[_0x4c27('0xa')]);return realtime;});}function main(){return server[_0x4c27('0xb')](realtime,email)[_0x4c27('0x7')](function(){return initRealtime();})['then'](function(){return setting[_0x4c27('0xc')]();})['then'](function(_0x48a332){return setInterval(initRealtime,_0x48a332[_0x4c27('0xd')]*0x3e8);})['catch'](function(_0x2ec4f8){logger[_0x4c27('0xe')](_0x4c27('0xf'),_0x2ec4f8);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index d150bbb..f5cb63e 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 _0xa40b=['total','isNil','mailAccount:update','refresh','hasOwnProperty','provider','imapAccounts','box','handleImapBox','bind','handleImapEmail','end','error','status','disabled','connected','messages','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','handleImapEnd','lastSync','handleImapError','sendMail','verifySmtp','Smtp','verify','exports','moment','md5','ioredis','email','redis','defaults','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','smtp','prototype','emit','name','key','active','Imap','messageStatus'];(function(_0x1443e1,_0x14aaf1){var _0x5a42fc=function(_0x1ec938){while(--_0x1ec938){_0x1443e1['push'](_0x1443e1['shift']());}};_0x5a42fc(++_0x14aaf1);}(_0xa40b,0x15e));var _0xba40=function(_0x6673d1,_0x518696){_0x6673d1=_0x6673d1-0x0;var _0x40ae10=_0xa40b[_0x6673d1];return _0x40ae10;};'use strict';var _=require('lodash');var moment=require(_0xba40('0x0'));var BPromise=require('bluebird');var md5=require(_0xba40('0x1'));var Redis=require(_0xba40('0x2'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0xba40('0x3'));config[_0xba40('0x4')]=_[_0xba40('0x5')](config[_0xba40('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xba40('0x6'))(new Redis(config['redis']));var EmailImap=require(_0xba40('0x7'));var EmailSmtp=require(_0xba40('0x8'));var mailAccount=require(_0xba40('0x9'));var md5Accounts={};function EmailChannel(_0x1f38c2){logger[_0xba40('0xa')](_0xba40('0xb'));this['mailAccounts']=_0x1f38c2[_0xba40('0xc')];this['imapAccounts']={};this[_0xba40('0xd')]=new EmailSmtp();}EmailChannel[_0xba40('0xe')][_0xba40('0xf')]=function(_0x4ef7e7){var _0x5192a3=this[_0xba40('0xc')][_0x4ef7e7];var _0x36310d={'id':_0x5192a3['id'],'name':_0x5192a3[_0xba40('0x10')],'key':_0x5192a3[_0xba40('0x11')],'active':_0x5192a3[_0xba40('0x12')],'Imap':{'status':_0x5192a3[_0xba40('0x13')]['status'],'messageStatus':_0x5192a3[_0xba40('0x13')][_0xba40('0x14')],'total':_0x5192a3[_0xba40('0x13')][_0xba40('0x15')]}};if(_[_0xba40('0x16')](md5Accounts[_0x4ef7e7])){md5Accounts[_0x4ef7e7]={};}var _0x298677=md5(JSON['stringify'](_0x36310d));if(md5Accounts[_0x4ef7e7][_0xba40('0x1')]!==_0x298677){md5Accounts[_0x4ef7e7][_0xba40('0x1')]=_0x298677;io[_0xba40('0xf')](_0xba40('0x17'),_0x36310d);}};EmailChannel['prototype'][_0xba40('0x18')]=function(_0x2658a1){for(var _0x18f2ae in _0x2658a1){if(_0x2658a1[_0xba40('0x19')](_0x18f2ae)){if(_0x2658a1[_0x18f2ae][_0xba40('0x13')]&&_0x2658a1[_0x18f2ae]['active']){var _0x39c7e6=_0x2658a1[_0x18f2ae][_0xba40('0x13')];if(!_0x39c7e6['service'])_0x39c7e6['service']=_0x2658a1[_0x18f2ae][_0xba40('0x1a')];if(!this[_0xba40('0x1b')]['hasOwnProperty'](_0x39c7e6['id'])){this[_0xba40('0x1b')][_0x39c7e6['id']]=new EmailImap(_0x39c7e6,_0x2658a1[_0x18f2ae][_0xba40('0x3')]);this[_0xba40('0x1b')][_0x39c7e6['id']]['on'](_0xba40('0x1c'),this[_0xba40('0x1d')][_0xba40('0x1e')](this,_0x18f2ae));this[_0xba40('0x1b')][_0x39c7e6['id']]['on'](_0xba40('0x3'),this[_0xba40('0x1f')][_0xba40('0x1e')](this,_0x18f2ae));this[_0xba40('0x1b')][_0x39c7e6['id']]['on'](_0xba40('0x20'),this['handleImapEnd'][_0xba40('0x1e')](this,_0x18f2ae));this[_0xba40('0x1b')][_0x39c7e6['id']]['on'](_0xba40('0x21'),this['handleImapError'][_0xba40('0x1e')](this,_0x18f2ae));}}else{if(_[_0xba40('0x16')](this[_0xba40('0xc')][_0x18f2ae][_0xba40('0x13')])){this[_0xba40('0xc')][_0x18f2ae][_0xba40('0x13')]={};}this['mailAccounts'][_0x18f2ae][_0xba40('0x13')][_0xba40('0x22')]=_0xba40('0x23');this[_0xba40('0xc')][_0x18f2ae][_0xba40('0x13')][_0xba40('0x14')]='';this[_0xba40('0xf')](_0x18f2ae);}}}};EmailChannel[_0xba40('0xe')][_0xba40('0x1d')]=function(_0x2707ee,_0x1aa730){if(this[_0xba40('0xc')][_0x2707ee]){this['mailAccounts'][_0x2707ee][_0xba40('0x13')][_0xba40('0x22')]=_0xba40('0x24');this[_0xba40('0xc')][_0x2707ee]['Imap'][_0xba40('0x14')]=_0x1aa730[_0xba40('0x10')];if(_0x1aa730[_0xba40('0x25')]){this[_0xba40('0xc')][_0x2707ee]['Imap']['total']=_0x1aa730[_0xba40('0x25')][_0xba40('0x15')];}return this[_0xba40('0xf')](_0x2707ee);}};EmailChannel[_0xba40('0xe')][_0xba40('0x1f')]=function(_0x42f980,_0xa3083c){logger[_0xba40('0xa')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0xa3083c['firstName'],_0xa3083c['lastName'],_0xa3083c[_0xba40('0x26')],_0x42f980);if(this[_0xba40('0xc')][_0x42f980]){return mailAccount[_0xba40('0x27')](_0x42f980,_0xa3083c)[_0xba40('0x28')](function(_0x4659a5){if(_0x4659a5){logger[_0xba40('0xa')](_0xba40('0x29'));}})[_0xba40('0x2a')](function(_0x4f13b8){logger[_0xba40('0x21')](_0xba40('0x2b'),JSON[_0xba40('0x2c')](_0x4f13b8));});}};EmailChannel[_0xba40('0xe')][_0xba40('0x2d')]=function(_0x3f73e2){if(this[_0xba40('0xc')][_0x3f73e2]&&this[_0xba40('0xc')][_0x3f73e2][_0xba40('0x13')]){if(this[_0xba40('0x1b')][this['mailAccounts'][_0x3f73e2]['Imap']['id']]){delete this[_0xba40('0x1b')][this[_0xba40('0xc')][_0x3f73e2][_0xba40('0x13')]['id']];}this[_0xba40('0xc')][_0x3f73e2][_0xba40('0x13')][_0xba40('0x2e')]=moment();this[_0xba40('0xf')](_0x3f73e2);}};EmailChannel[_0xba40('0xe')][_0xba40('0x2f')]=function(_0x4327f9,_0x81d28c){if(this[_0xba40('0xc')][_0x4327f9]){this[_0xba40('0xc')][_0x4327f9][_0xba40('0x13')][_0xba40('0x22')]=_0xba40('0x21');this[_0xba40('0xc')][_0x4327f9]['Imap']['messageStatus']=_0x81d28c;return this[_0xba40('0xf')](_0x4327f9);}};EmailChannel[_0xba40('0xe')][_0xba40('0x30')]=function(_0x28f5db,_0x5f46b6){return this[_0xba40('0xd')]['send'](_0x28f5db,_0x5f46b6);};EmailChannel[_0xba40('0xe')][_0xba40('0x31')]=function(_0x98c9ac){var _0x7a505b=this;if(this[_0xba40('0xc')][_0x98c9ac['id']]){if(_['isNil'](this[_0xba40('0xc')][_0x98c9ac['id']][_0xba40('0x32')])){this[_0xba40('0xc')][_0x98c9ac['id']][_0xba40('0x32')]={};}this[_0xba40('0xc')][_0x98c9ac['id']]['Smtp'][_0xba40('0x2e')]=moment();return new BPromise(function(_0x95cdfa,_0x1bda65){return _0x7a505b['smtp'][_0xba40('0x33')](_0x98c9ac)[_0xba40('0x28')](function(_0x47f746){_0x7a505b[_0xba40('0xc')][_0x98c9ac['id']][_0xba40('0x32')]['status']='verified';_0x7a505b[_0xba40('0xc')][_0x98c9ac['id']][_0xba40('0x32')][_0xba40('0x14')]='';_0x7a505b[_0xba40('0xf')](_0x98c9ac['id']);_0x95cdfa(_0x47f746);})[_0xba40('0x2a')](function(_0x481634){_0x7a505b[_0xba40('0xc')][_0x98c9ac['id']][_0xba40('0x32')]['status']=_0xba40('0x21');_0x7a505b['mailAccounts'][_0x98c9ac['id']][_0xba40('0x32')]['messageStatus']=_0x481634;_0x7a505b['emit'](_0x98c9ac['id']);_0x1bda65(_0x481634);});});}return this[_0xba40('0xd')][_0xba40('0x33')](_0x98c9ac);};module[_0xba40('0x34')]=EmailChannel; \ No newline at end of file +var _0xc4e1=['moment','bluebird','md5','../../../config/environment','email','defaults','localhost','socket.io-emitter','./imap','./smtp','mailAccounts','imapAccounts','prototype','name','key','active','status','Imap','isNil','emit','mailAccount:update','service','provider','hasOwnProperty','box','handleImapBox','bind','end','handleImapEnd','error','handleImapError','disabled','messageStatus','connected','messages','total','handleImapEmail','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','smtp','send','Smtp','verified','verify','exports','lodash'];(function(_0x3d9e9e,_0x2779d6){var _0x4632e5=function(_0x176590){while(--_0x176590){_0x3d9e9e['push'](_0x3d9e9e['shift']());}};_0x4632e5(++_0x2779d6);}(_0xc4e1,0x172));var _0x1c4e=function(_0x3ec174,_0x39d21b){_0x3ec174=_0x3ec174-0x0;var _0x33ed60=_0xc4e1[_0x3ec174];return _0x33ed60;};'use strict';var _=require(_0x1c4e('0x0'));var moment=require(_0x1c4e('0x1'));var BPromise=require(_0x1c4e('0x2'));var md5=require(_0x1c4e('0x3'));var Redis=require('ioredis');var config=require(_0x1c4e('0x4'));var logger=require('../../../config/logger')(_0x1c4e('0x5'));config['redis']=_[_0x1c4e('0x6')](config['redis'],{'host':_0x1c4e('0x7'),'port':0x18eb});var io=require(_0x1c4e('0x8'))(new Redis(config['redis']));var EmailImap=require(_0x1c4e('0x9'));var EmailSmtp=require(_0x1c4e('0xa'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0xa423ce){logger['info']('start\x20email\x20channel');this[_0x1c4e('0xb')]=_0xa423ce['mailAccounts'];this[_0x1c4e('0xc')]={};this['smtp']=new EmailSmtp();}EmailChannel[_0x1c4e('0xd')]['emit']=function(_0x39b296){var _0x5cdd3c=this['mailAccounts'][_0x39b296];var _0x5b75a3={'id':_0x5cdd3c['id'],'name':_0x5cdd3c[_0x1c4e('0xe')],'key':_0x5cdd3c[_0x1c4e('0xf')],'active':_0x5cdd3c[_0x1c4e('0x10')],'Imap':{'status':_0x5cdd3c['Imap'][_0x1c4e('0x11')],'messageStatus':_0x5cdd3c[_0x1c4e('0x12')]['messageStatus'],'total':_0x5cdd3c['Imap']['total']}};if(_[_0x1c4e('0x13')](md5Accounts[_0x39b296])){md5Accounts[_0x39b296]={};}var _0x2b6459=md5(JSON['stringify'](_0x5b75a3));if(md5Accounts[_0x39b296][_0x1c4e('0x3')]!==_0x2b6459){md5Accounts[_0x39b296][_0x1c4e('0x3')]=_0x2b6459;io[_0x1c4e('0x14')](_0x1c4e('0x15'),_0x5b75a3);}};EmailChannel[_0x1c4e('0xd')]['refresh']=function(_0x17259a){for(var _0x3d4bd4 in _0x17259a){if(_0x17259a['hasOwnProperty'](_0x3d4bd4)){if(_0x17259a[_0x3d4bd4]['Imap']&&_0x17259a[_0x3d4bd4]['active']){var _0x54ef20=_0x17259a[_0x3d4bd4][_0x1c4e('0x12')];if(!_0x54ef20[_0x1c4e('0x16')])_0x54ef20['service']=_0x17259a[_0x3d4bd4][_0x1c4e('0x17')];if(!this[_0x1c4e('0xc')][_0x1c4e('0x18')](_0x54ef20['id'])){this[_0x1c4e('0xc')][_0x54ef20['id']]=new EmailImap(_0x54ef20,_0x17259a[_0x3d4bd4][_0x1c4e('0x5')]);this[_0x1c4e('0xc')][_0x54ef20['id']]['on'](_0x1c4e('0x19'),this[_0x1c4e('0x1a')][_0x1c4e('0x1b')](this,_0x3d4bd4));this['imapAccounts'][_0x54ef20['id']]['on'](_0x1c4e('0x5'),this['handleImapEmail'][_0x1c4e('0x1b')](this,_0x3d4bd4));this[_0x1c4e('0xc')][_0x54ef20['id']]['on'](_0x1c4e('0x1c'),this[_0x1c4e('0x1d')][_0x1c4e('0x1b')](this,_0x3d4bd4));this['imapAccounts'][_0x54ef20['id']]['on'](_0x1c4e('0x1e'),this[_0x1c4e('0x1f')][_0x1c4e('0x1b')](this,_0x3d4bd4));}}else{if(_[_0x1c4e('0x13')](this[_0x1c4e('0xb')][_0x3d4bd4][_0x1c4e('0x12')])){this['mailAccounts'][_0x3d4bd4][_0x1c4e('0x12')]={};}this[_0x1c4e('0xb')][_0x3d4bd4][_0x1c4e('0x12')][_0x1c4e('0x11')]=_0x1c4e('0x20');this[_0x1c4e('0xb')][_0x3d4bd4]['Imap'][_0x1c4e('0x21')]='';this[_0x1c4e('0x14')](_0x3d4bd4);}}}};EmailChannel['prototype'][_0x1c4e('0x1a')]=function(_0x3c8240,_0x35a119){if(this[_0x1c4e('0xb')][_0x3c8240]){this['mailAccounts'][_0x3c8240][_0x1c4e('0x12')][_0x1c4e('0x11')]=_0x1c4e('0x22');this['mailAccounts'][_0x3c8240][_0x1c4e('0x12')][_0x1c4e('0x21')]=_0x35a119[_0x1c4e('0xe')];if(_0x35a119[_0x1c4e('0x23')]){this['mailAccounts'][_0x3c8240][_0x1c4e('0x12')][_0x1c4e('0x24')]=_0x35a119[_0x1c4e('0x23')][_0x1c4e('0x24')];}return this['emit'](_0x3c8240);}};EmailChannel['prototype'][_0x1c4e('0x25')]=function(_0x287dcd,_0x1f99c9){logger['info'](_0x1c4e('0x26'),_0x1f99c9[_0x1c4e('0x27')],_0x1f99c9['lastName'],_0x1f99c9[_0x1c4e('0x28')],_0x287dcd);if(this[_0x1c4e('0xb')][_0x287dcd]){return mailAccount[_0x1c4e('0x29')](_0x287dcd,_0x1f99c9)[_0x1c4e('0x2a')](function(_0x216cf4){if(_0x216cf4){logger['info'](_0x1c4e('0x2b'));}})[_0x1c4e('0x2c')](function(_0x1e2559){logger[_0x1c4e('0x1e')](_0x1c4e('0x2d'),JSON['stringify'](_0x1e2559));});}};EmailChannel[_0x1c4e('0xd')]['handleImapEnd']=function(_0x1fff83){if(this[_0x1c4e('0xb')][_0x1fff83]&&this[_0x1c4e('0xb')][_0x1fff83][_0x1c4e('0x12')]){if(this[_0x1c4e('0xc')][this['mailAccounts'][_0x1fff83][_0x1c4e('0x12')]['id']]){delete this[_0x1c4e('0xc')][this[_0x1c4e('0xb')][_0x1fff83][_0x1c4e('0x12')]['id']];}this[_0x1c4e('0xb')][_0x1fff83][_0x1c4e('0x12')][_0x1c4e('0x2e')]=moment();this[_0x1c4e('0x14')](_0x1fff83);}};EmailChannel[_0x1c4e('0xd')][_0x1c4e('0x1f')]=function(_0xa8b923,_0x2b78ee){if(this[_0x1c4e('0xb')][_0xa8b923]){this['mailAccounts'][_0xa8b923][_0x1c4e('0x12')][_0x1c4e('0x11')]=_0x1c4e('0x1e');this[_0x1c4e('0xb')][_0xa8b923][_0x1c4e('0x12')]['messageStatus']=_0x2b78ee;return this[_0x1c4e('0x14')](_0xa8b923);}};EmailChannel['prototype']['sendMail']=function(_0x19cb63,_0x5d0f40){return this[_0x1c4e('0x2f')][_0x1c4e('0x30')](_0x19cb63,_0x5d0f40);};EmailChannel['prototype']['verifySmtp']=function(_0x1ab7e5){var _0x3267e9=this;if(this[_0x1c4e('0xb')][_0x1ab7e5['id']]){if(_[_0x1c4e('0x13')](this['mailAccounts'][_0x1ab7e5['id']]['Smtp'])){this['mailAccounts'][_0x1ab7e5['id']]['Smtp']={};}this[_0x1c4e('0xb')][_0x1ab7e5['id']][_0x1c4e('0x31')][_0x1c4e('0x2e')]=moment();return new BPromise(function(_0x25432d,_0x3c19af){return _0x3267e9['smtp']['verify'](_0x1ab7e5)[_0x1c4e('0x2a')](function(_0x3baa31){_0x3267e9[_0x1c4e('0xb')][_0x1ab7e5['id']][_0x1c4e('0x31')]['status']=_0x1c4e('0x32');_0x3267e9['mailAccounts'][_0x1ab7e5['id']]['Smtp'][_0x1c4e('0x21')]='';_0x3267e9[_0x1c4e('0x14')](_0x1ab7e5['id']);_0x25432d(_0x3baa31);})['catch'](function(_0x43193f){_0x3267e9[_0x1c4e('0xb')][_0x1ab7e5['id']][_0x1c4e('0x31')][_0x1c4e('0x11')]=_0x1c4e('0x1e');_0x3267e9['mailAccounts'][_0x1ab7e5['id']][_0x1c4e('0x31')]['messageStatus']=_0x43193f;_0x3267e9[_0x1c4e('0x14')](_0x1ab7e5['id']);_0x3c19af(_0x43193f);});});}return this['smtp'][_0x1c4e('0x33')](_0x1ab7e5);};module[_0x1c4e('0x34')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 43e785d..0ab7519 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 _0x53ec=['modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','data5','getHost','service','email','openBox','handleOpenBox','emit','readUnseen','handleCloseBox','end','search','UNSEEN','handleReadUnseen','handleFetchMessage','handleFetchError','closeBox','body','handleMessageAttributes','handleMessageEnd','handleMessageBody','handleSimpleParser','parser','textCode','hasOwnProperty','upperFirst','exports','lodash','util','imap','mailparser','simpleParser','iconv','events','./utils','../../../config/logger','mailbox','INBOX','getAccount','account','once','ready','handleReady','bind','handleEnd','error','handleError','prototype','connTimeout','authTimeout','isNil','authentication','user','password','host','port','tls','autotls','required'];(function(_0x3dfe6f,_0xb900a9){var _0x5838e4=function(_0x2d7d70){while(--_0x2d7d70){_0x3dfe6f['push'](_0x3dfe6f['shift']());}};_0x5838e4(++_0xb900a9);}(_0x53ec,0x192));var _0xc53e=function(_0x4e9e0d,_0xd86384){_0x4e9e0d=_0x4e9e0d-0x0;var _0x514622=_0x53ec[_0x4e9e0d];return _0x514622;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var Imap=require(_0xc53e('0x2'));var simpleParser=require(_0xc53e('0x3'))[_0xc53e('0x4')];var Iconv=require(_0xc53e('0x5'))['Iconv'];var EventEmitter=require(_0xc53e('0x6'))['EventEmitter'];var utils=require(_0xc53e('0x7'));var logger=require(_0xc53e('0x8'))('email');function EmailImap(_0x2f1414,_0x4f989b){this[_0xc53e('0x9')]=_0xc53e('0xa');this['account']=this[_0xc53e('0xb')](_0x2f1414,_0x4f989b);this[_0xc53e('0x2')]=new Imap(this[_0xc53e('0xc')]);this[_0xc53e('0x2')][_0xc53e('0xd')](_0xc53e('0xe'),this[_0xc53e('0xf')][_0xc53e('0x10')](this));this[_0xc53e('0x2')]['once']('end',this[_0xc53e('0x11')]['bind'](this));this['imap']['on'](_0xc53e('0x12'),this[_0xc53e('0x13')][_0xc53e('0x10')](this));this[_0xc53e('0x2')]['connect']();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0xc53e('0x14')][_0xc53e('0xb')]=function(_0x7cd798,_0x3d2e17){var _0x358ef3={'connTimeout':_0x7cd798[_0xc53e('0x15')]?_0x7cd798[_0xc53e('0x15')]*0x3e8:0x2710,'authTimeout':_0x7cd798[_0xc53e('0x16')]?_0x7cd798[_0xc53e('0x16')]*0x3e8:0x1388};if(_[_0xc53e('0x17')](_0x7cd798['service'])){if(_0x7cd798[_0xc53e('0x18')]){_0x358ef3[_0xc53e('0x19')]=_0x7cd798[_0xc53e('0x19')];_0x358ef3[_0xc53e('0x1a')]=_0x7cd798[_0xc53e('0x1a')];}_0x358ef3[_0xc53e('0x1b')]=_0x7cd798[_0xc53e('0x1b')];_0x358ef3[_0xc53e('0x1c')]=_0x7cd798[_0xc53e('0x1c')]||0x3e1;if(_0x7cd798['tls']){_0x358ef3['tls']=!![];}else{_0x358ef3[_0xc53e('0x1d')]=![];_0x358ef3[_0xc53e('0x1e')]=_0xc53e('0x1f');}}else{if(_0x7cd798[_0xc53e('0x20')]){_0x358ef3[_0xc53e('0x21')]=utils[_0xc53e('0x22')](_0x7cd798[_0xc53e('0x23')][_0xc53e('0x24')],_0x7cd798[_0xc53e('0x19')]);_0x358ef3[_0xc53e('0x19')]=_0x7cd798[_0xc53e('0x19')];}else{_0x358ef3[_0xc53e('0x19')]=_0x7cd798[_0xc53e('0x19')];_0x358ef3['password']=_0x7cd798['password'];}_0x358ef3['host']=utils[_0xc53e('0x25')](_0x7cd798[_0xc53e('0x26')]);_0x358ef3[_0xc53e('0x1c')]=0x3e1;_0x358ef3[_0xc53e('0x1d')]=!![];}_0x358ef3[_0xc53e('0x27')]=_0x3d2e17||_0x7cd798['user']||'anonymous@xcally.com';return _0x358ef3;};EmailImap[_0xc53e('0x14')]['handleReady']=function(){this[_0xc53e('0x2')][_0xc53e('0x28')](this[_0xc53e('0x9')],![],this[_0xc53e('0x29')][_0xc53e('0x10')](this));};EmailImap['prototype'][_0xc53e('0x29')]=function(_0x4b9f6a,_0x4d9a68){if(_0x4b9f6a){this['handleError'](_0x4b9f6a,!![]);}else{this[_0xc53e('0x2a')]('box',_0x4d9a68);this[_0xc53e('0x2b')]();}};EmailImap['prototype'][_0xc53e('0x2c')]=function(_0x5112d2){if(_0x5112d2){this['handleError'](_0x5112d2,!![]);}else{this[_0xc53e('0x2')][_0xc53e('0x2d')]();}};EmailImap[_0xc53e('0x14')][_0xc53e('0x2b')]=function(){this[_0xc53e('0x2')][_0xc53e('0x2e')]([_0xc53e('0x2f')],this[_0xc53e('0x30')]['bind'](this));};EmailImap[_0xc53e('0x14')][_0xc53e('0x30')]=function(_0x2d36c0,_0x56206b){if(_0x2d36c0){this[_0xc53e('0x13')](_0x2d36c0,!![]);}else{if(_0x56206b['length']){try{var _0x4572e=this[_0xc53e('0x2')]['fetch'](_0x56206b,{'bodies':'','markSeen':!![]});_0x4572e['on']('message',this[_0xc53e('0x31')][_0xc53e('0x10')](this));_0x4572e[_0xc53e('0xd')](_0xc53e('0x12'),this[_0xc53e('0x32')][_0xc53e('0x10')](this));_0x4572e[_0xc53e('0xd')](_0xc53e('0x2d'),this['handleFetchEnd'][_0xc53e('0x10')](this));}catch(_0x3bae8a){logger[_0xc53e('0x12')](_0x3bae8a);}}else{this[_0xc53e('0x2')][_0xc53e('0x33')](!![],this[_0xc53e('0x2c')][_0xc53e('0x10')](this));}}};EmailImap[_0xc53e('0x14')][_0xc53e('0x31')]=function(_0x595efb){_0x595efb['on'](_0xc53e('0x34'),this['handleMessageBody'][_0xc53e('0x10')](this));_0x595efb[_0xc53e('0xd')]('attributes',this[_0xc53e('0x35')][_0xc53e('0x10')](this));_0x595efb[_0xc53e('0xd')]('end',this[_0xc53e('0x36')][_0xc53e('0x10')](this));};EmailImap[_0xc53e('0x14')][_0xc53e('0x37')]=function(_0xeaec72){simpleParser(_0xeaec72,{'Iconv':Iconv},this[_0xc53e('0x38')][_0xc53e('0x10')](this));};EmailImap['prototype'][_0xc53e('0x35')]=function(){};EmailImap[_0xc53e('0x14')][_0xc53e('0x36')]=function(){};EmailImap['prototype'][_0xc53e('0x38')]=function(_0x5e8ab7,_0xaa00cd){if(_0x5e8ab7){logger[_0xc53e('0x12')](_0x5e8ab7);}else{var _0x40c4f5=this;utils[_0xc53e('0x39')](this[_0xc53e('0xc')],_0xaa00cd,function(_0x5507d0){_0x40c4f5[_0xc53e('0x2a')](_0xc53e('0x27'),_0x5507d0);});}};EmailImap['prototype']['handleFetchEnd']=function(){this['imap']['closeBox'](!![],this[_0xc53e('0x2c')][_0xc53e('0x10')](this));};EmailImap['prototype'][_0xc53e('0x32')]=function(_0x574983){this['handleError'](_0x574983);this['imap'][_0xc53e('0x33')](!![],this['handleCloseBox']['bind'](this));};EmailImap[_0xc53e('0x14')]['handleEnd']=function(){this[_0xc53e('0x2a')](_0xc53e('0x2d'));};EmailImap['prototype'][_0xc53e('0x13')]=function(_0x3a4ebc,_0x509a04){logger[_0xc53e('0x12')]('handleError',this['account']['email'],JSON['stringify'](_0x3a4ebc));var _0x887d78='';if(_0x3a4ebc){if(_0x3a4ebc[_0xc53e('0x3a')]){_0x887d78=_0x3a4ebc[_0xc53e('0x3a')];}else{for(var _0x5f1884 in _0x3a4ebc){if(_0x3a4ebc[_0xc53e('0x3b')](_0x5f1884)){_0x887d78+=_[_0xc53e('0x3c')](_0x5f1884)+':\x20'+_0x3a4ebc[_0x5f1884]+'\x0a';}}}}if(_0x509a04){this['imap']['end']();}else{this[_0xc53e('0x2a')](_0xc53e('0x12'),_0x887d78);this[_0xc53e('0x2a')]('end');}};module[_0xc53e('0x3d')]=EmailImap; \ No newline at end of file +var _0xb016=['isNil','service','authentication','user','password','host','port','tls','autotls','required','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','getHost','anonymous@xcally.com','openBox','mailbox','handleOpenBox','handleError','emit','box','readUnseen','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchError','handleFetchEnd','closeBox','handleCloseBox','body','handleMessageBody','attributes','handleMessageAttributes','handleSimpleParser','handleMessageEnd','stringify','textCode','lodash','util','simpleParser','Iconv','events','EventEmitter','./utils','email','account','getAccount','imap','once','ready','handleReady','bind','end','handleEnd','error','inherits','prototype','connTimeout'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0xb016,0x159));var _0x6b01=function(_0x7267c4,_0x3d79c4){_0x7267c4=_0x7267c4-0x0;var _0x31075d=_0xb016[_0x7267c4];return _0x31075d;};'use strict';var _=require(_0x6b01('0x0'));var util=require(_0x6b01('0x1'));var Imap=require('imap');var simpleParser=require('mailparser')[_0x6b01('0x2')];var Iconv=require('iconv')[_0x6b01('0x3')];var EventEmitter=require(_0x6b01('0x4'))[_0x6b01('0x5')];var utils=require(_0x6b01('0x6'));var logger=require('../../../config/logger')(_0x6b01('0x7'));function EmailImap(_0x65407a,_0x192b2d){this['mailbox']='INBOX';this[_0x6b01('0x8')]=this[_0x6b01('0x9')](_0x65407a,_0x192b2d);this['imap']=new Imap(this['account']);this[_0x6b01('0xa')][_0x6b01('0xb')](_0x6b01('0xc'),this[_0x6b01('0xd')][_0x6b01('0xe')](this));this['imap']['once'](_0x6b01('0xf'),this[_0x6b01('0x10')][_0x6b01('0xe')](this));this['imap']['on'](_0x6b01('0x11'),this['handleError']['bind'](this));this[_0x6b01('0xa')]['connect']();}util[_0x6b01('0x12')](EmailImap,EventEmitter);EmailImap[_0x6b01('0x13')]['getAccount']=function(_0x2c305e,_0x4ea5fa){var _0x50d778={'connTimeout':_0x2c305e['connTimeout']?_0x2c305e[_0x6b01('0x14')]*0x3e8:0x2710,'authTimeout':_0x2c305e['authTimeout']?_0x2c305e['authTimeout']*0x3e8:0x1388};if(_[_0x6b01('0x15')](_0x2c305e[_0x6b01('0x16')])){if(_0x2c305e[_0x6b01('0x17')]){_0x50d778[_0x6b01('0x18')]=_0x2c305e[_0x6b01('0x18')];_0x50d778[_0x6b01('0x19')]=_0x2c305e[_0x6b01('0x19')];}_0x50d778[_0x6b01('0x1a')]=_0x2c305e[_0x6b01('0x1a')];_0x50d778[_0x6b01('0x1b')]=_0x2c305e[_0x6b01('0x1b')]||0x3e1;if(_0x2c305e['tls']){_0x50d778[_0x6b01('0x1c')]=!![];}else{_0x50d778[_0x6b01('0x1c')]=![];_0x50d778[_0x6b01('0x1d')]=_0x6b01('0x1e');}}else{if(_0x2c305e[_0x6b01('0x1f')]){_0x50d778[_0x6b01('0x20')]=utils[_0x6b01('0x21')](_0x2c305e[_0x6b01('0x22')]['data5'],_0x2c305e[_0x6b01('0x18')]);_0x50d778[_0x6b01('0x18')]=_0x2c305e[_0x6b01('0x18')];}else{_0x50d778[_0x6b01('0x18')]=_0x2c305e[_0x6b01('0x18')];_0x50d778[_0x6b01('0x19')]=_0x2c305e[_0x6b01('0x19')];}_0x50d778['host']=utils[_0x6b01('0x23')](_0x2c305e[_0x6b01('0x16')]);_0x50d778[_0x6b01('0x1b')]=0x3e1;_0x50d778['tls']=!![];}_0x50d778[_0x6b01('0x7')]=_0x4ea5fa||_0x2c305e[_0x6b01('0x18')]||_0x6b01('0x24');return _0x50d778;};EmailImap[_0x6b01('0x13')][_0x6b01('0xd')]=function(){this[_0x6b01('0xa')][_0x6b01('0x25')](this[_0x6b01('0x26')],![],this[_0x6b01('0x27')][_0x6b01('0xe')](this));};EmailImap[_0x6b01('0x13')][_0x6b01('0x27')]=function(_0x154dfc,_0x55ca4b){if(_0x154dfc){this[_0x6b01('0x28')](_0x154dfc,!![]);}else{this[_0x6b01('0x29')](_0x6b01('0x2a'),_0x55ca4b);this[_0x6b01('0x2b')]();}};EmailImap[_0x6b01('0x13')]['handleCloseBox']=function(_0x54f030){if(_0x54f030){this[_0x6b01('0x28')](_0x54f030,!![]);}else{this[_0x6b01('0xa')][_0x6b01('0xf')]();}};EmailImap[_0x6b01('0x13')][_0x6b01('0x2b')]=function(){this[_0x6b01('0xa')]['search']([_0x6b01('0x2c')],this['handleReadUnseen'][_0x6b01('0xe')](this));};EmailImap['prototype'][_0x6b01('0x2d')]=function(_0xa6b2b6,_0x473201){if(_0xa6b2b6){this[_0x6b01('0x28')](_0xa6b2b6,!![]);}else{if(_0x473201[_0x6b01('0x2e')]){try{var _0x54575c=this[_0x6b01('0xa')][_0x6b01('0x2f')](_0x473201,{'bodies':'','markSeen':!![]});_0x54575c['on'](_0x6b01('0x30'),this['handleFetchMessage']['bind'](this));_0x54575c[_0x6b01('0xb')]('error',this[_0x6b01('0x31')][_0x6b01('0xe')](this));_0x54575c[_0x6b01('0xb')]('end',this[_0x6b01('0x32')][_0x6b01('0xe')](this));}catch(_0x186a6d){logger['error'](_0x186a6d);}}else{this[_0x6b01('0xa')][_0x6b01('0x33')](!![],this[_0x6b01('0x34')][_0x6b01('0xe')](this));}}};EmailImap[_0x6b01('0x13')]['handleFetchMessage']=function(_0xa041ea){_0xa041ea['on'](_0x6b01('0x35'),this[_0x6b01('0x36')][_0x6b01('0xe')](this));_0xa041ea[_0x6b01('0xb')](_0x6b01('0x37'),this[_0x6b01('0x38')][_0x6b01('0xe')](this));_0xa041ea['once'](_0x6b01('0xf'),this['handleMessageEnd'][_0x6b01('0xe')](this));};EmailImap[_0x6b01('0x13')][_0x6b01('0x36')]=function(_0x318b8b){simpleParser(_0x318b8b,{'Iconv':Iconv},this[_0x6b01('0x39')][_0x6b01('0xe')](this));};EmailImap[_0x6b01('0x13')]['handleMessageAttributes']=function(){};EmailImap[_0x6b01('0x13')][_0x6b01('0x3a')]=function(){};EmailImap[_0x6b01('0x13')][_0x6b01('0x39')]=function(_0x1ca3aa,_0x2c4205){if(_0x1ca3aa){logger[_0x6b01('0x11')](_0x1ca3aa);}else{var _0x44bf46=this;utils['parser'](this[_0x6b01('0x8')],_0x2c4205,function(_0x55907f){_0x44bf46[_0x6b01('0x29')](_0x6b01('0x7'),_0x55907f);});}};EmailImap['prototype'][_0x6b01('0x32')]=function(){this[_0x6b01('0xa')][_0x6b01('0x33')](!![],this[_0x6b01('0x34')][_0x6b01('0xe')](this));};EmailImap[_0x6b01('0x13')][_0x6b01('0x31')]=function(_0x93737a){this[_0x6b01('0x28')](_0x93737a);this[_0x6b01('0xa')]['closeBox'](!![],this[_0x6b01('0x34')][_0x6b01('0xe')](this));};EmailImap['prototype']['handleEnd']=function(){this[_0x6b01('0x29')](_0x6b01('0xf'));};EmailImap['prototype'][_0x6b01('0x28')]=function(_0x3f9e46,_0x55bf71){logger[_0x6b01('0x11')]('handleError',this[_0x6b01('0x8')][_0x6b01('0x7')],JSON[_0x6b01('0x3b')](_0x3f9e46));var _0x50b13d='';if(_0x3f9e46){if(_0x3f9e46[_0x6b01('0x3c')]){_0x50b13d=_0x3f9e46[_0x6b01('0x3c')];}else{for(var _0x52cc57 in _0x3f9e46){if(_0x3f9e46['hasOwnProperty'](_0x52cc57)){_0x50b13d+=_['upperFirst'](_0x52cc57)+':\x20'+_0x3f9e46[_0x52cc57]+'\x0a';}}}}if(_0x55bf71){this[_0x6b01('0xa')][_0x6b01('0xf')]();}else{this[_0x6b01('0x29')](_0x6b01('0x11'),_0x50b13d);this[_0x6b01('0x29')](_0x6b01('0xf'));}};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 8fc3d6d..16fabba 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 _0x687b=['compile','sendMail','toString','verify','Not\x20verified','exports','nodemailer','nodemailer-plugin-inline-base64','prototype','send','createTransport','use'];(function(_0xd7b0a4,_0x53c7d3){var _0x184e9e=function(_0x325bbd){while(--_0x325bbd){_0xd7b0a4['push'](_0xd7b0a4['shift']());}};_0x184e9e(++_0x53c7d3);}(_0x687b,0x14a));var _0xb687=function(_0x1b3e32,_0x49ad74){_0x1b3e32=_0x1b3e32-0x0;var _0x4796e3=_0x687b[_0x1b3e32];return _0x4796e3;};'use strict';var nodemailer=require(_0xb687('0x0'));var inlineBase64=require(_0xb687('0x1'));function EmailSmtp(){}EmailSmtp[_0xb687('0x2')][_0xb687('0x3')]=function(_0x5d8563,_0x5e5f06){return new Promise(function(_0x35069a,_0x2a4a7c){var _0x36c468=nodemailer[_0xb687('0x4')](_0x5d8563);_0x36c468[_0xb687('0x5')](_0xb687('0x6'),inlineBase64());_0x36c468[_0xb687('0x7')](_0x5e5f06,function(_0xf43a1f,_0x47ffea){if(_0xf43a1f)return _0x2a4a7c(_0xf43a1f[_0xb687('0x8')]());return _0x35069a(_0x47ffea);});});};EmailSmtp['prototype'][_0xb687('0x9')]=function(_0xd40346){return new Promise(function(_0x47f4cc,_0x1a99c5){var _0x21e3ab=nodemailer[_0xb687('0x4')](_0xd40346);_0x21e3ab[_0xb687('0x9')](function(_0x404fdb,_0x309d84){if(_0x404fdb)return _0x1a99c5(_0x404fdb[_0xb687('0x8')]());if(!_0x309d84)return _0x1a99c5(_0xb687('0xa'));return _0x47f4cc(_0x309d84);});});};module[_0xb687('0xb')]=EmailSmtp; \ No newline at end of file +var _0xfdbd=['nodemailer','nodemailer-plugin-inline-base64','prototype','send','use','sendMail','verify','createTransport','toString','exports'];(function(_0x198577,_0x3040c6){var _0x58bba3=function(_0x1aa42b){while(--_0x1aa42b){_0x198577['push'](_0x198577['shift']());}};_0x58bba3(++_0x3040c6);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x22ccc0,_0x914457){_0x22ccc0=_0x22ccc0-0x0;var _0xe2af6a=_0xfdbd[_0x22ccc0];return _0xe2af6a;};'use strict';var nodemailer=require(_0xdfdb('0x0'));var inlineBase64=require(_0xdfdb('0x1'));function EmailSmtp(){}EmailSmtp[_0xdfdb('0x2')][_0xdfdb('0x3')]=function(_0x28f05d,_0x3078f0){return new Promise(function(_0x11218a,_0x66533b){var _0x330ad3=nodemailer['createTransport'](_0x28f05d);_0x330ad3[_0xdfdb('0x4')]('compile',inlineBase64());_0x330ad3[_0xdfdb('0x5')](_0x3078f0,function(_0x41bd5e,_0x489f19){if(_0x41bd5e)return _0x66533b(_0x41bd5e['toString']());return _0x11218a(_0x489f19);});});};EmailSmtp['prototype'][_0xdfdb('0x6')]=function(_0xf72a24){return new Promise(function(_0x47c629,_0x11d845){var _0x444c19=nodemailer[_0xdfdb('0x7')](_0xf72a24);_0x444c19[_0xdfdb('0x6')](function(_0x3a44a9,_0x1ace28){if(_0x3a44a9)return _0x11d845(_0x3a44a9[_0xdfdb('0x8')]());if(!_0x1ace28)return _0x11d845('Not\x20verified');return _0x47c629(_0x1ace28);});});};module[_0xdfdb('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 d259a1d..ea1bf81 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 _0x651b=['head','name','substring','indexOf','split','slice','join','Anonymous','length','pop','@xcally.com','html','test','replace','includes','','body','textAsHtml','Empty\x20message

','Attachments','getHost','gmail','imap.gmail.com','yahoo','hotmail','imap-mail.outlook.com','outlook365','127.0.0.1','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','base64','moment','randomstring','path','node-tnef','../../../config/logger','email','../../../config/environment','value','address','anonymous','generate'];(function(_0x1abd98,_0x4efa0b){var _0x547194=function(_0x5d153e){while(--_0x5d153e){_0x1abd98['push'](_0x1abd98['shift']());}};_0x547194(++_0x4efa0b);}(_0x651b,0x1db));var _0xb651=function(_0x468c87,_0x3ecc35){_0x468c87=_0x468c87-0x0;var _0x3a9381=_0x651b[_0x468c87];return _0x3a9381;};'use strict';var _=require('lodash');var moment=require(_0xb651('0x0'));var random=require(_0xb651('0x1'));var fs=require('fs');var path=require(_0xb651('0x2'));var util=require('util');var tnef=require(_0xb651('0x3'));var logger=require(_0xb651('0x4'))(_0xb651('0x5'));var config=require(_0xb651('0x6'));function getAddress(_0x39cdda){var _0x357f45=_['head'](_0x39cdda[_0xb651('0x7')]);return _0x357f45&&_0x357f45[_0xb651('0x8')]?_0x357f45['address']:_0xb651('0x9')+random[_0xb651('0xa')](0x6)+'@xcally.com';}function getFirstName(_0x2d260a){var _0x2ff0e9=_[_0xb651('0xb')](_0x2d260a[_0xb651('0x7')]);if(_0x2ff0e9&&_0x2ff0e9[_0xb651('0xc')]){if(_0x2ff0e9[_0xb651('0xc')]==_0x2ff0e9[_0xb651('0x8')]){return _0x2ff0e9['name'][_0xb651('0xd')](0x0,_0x2ff0e9[_0xb651('0xc')][_0xb651('0xe')]('@'));}var _0x39cf61=_0x2ff0e9[_0xb651('0xc')][_0xb651('0xf')](/\s+/);return _0x39cf61['length']>0x1?_0x39cf61[_0xb651('0x10')](0x0,-0x1)[_0xb651('0x11')]('\x20'):_0x2ff0e9['name'];}return _0xb651('0x12');}function getLastName(_0x289b4e){var _0x4d17d5=_[_0xb651('0xb')](_0x289b4e[_0xb651('0x7')]);if(_0x4d17d5&&_0x4d17d5['name']){var _0x4aea2c=_0x4d17d5[_0xb651('0xc')]['split'](/\s+/);return _0x4aea2c[_0xb651('0x13')]>0x1?_0x4aea2c[_0xb651('0x14')]():'';}return'';}function getMails(_0x3af96e,_0x37b382){var _0x69d87c='';for(var _0x35b039=0x0;_0x35b039<_0x37b382[_0xb651('0x7')][_0xb651('0x13')];_0x35b039+=0x1){if(_0x37b382['value'][_0x35b039]['address']!==_0x3af96e){if(!_['isEmpty'](_0x69d87c)){_0x69d87c+=',';}_0x69d87c+=_0x37b382['value'][_0x35b039][_0xb651('0xc')]||_0x37b382[_0xb651('0x7')][_0x35b039][_0xb651('0x8')]||'';_0x69d87c+='\x20<';_0x69d87c+=_0x37b382['value'][_0x35b039][_0xb651('0x8')]?_0x37b382[_0xb651('0x7')][_0x35b039][_0xb651('0x8')]:'anonymous'+random[_0xb651('0xa')](0x6)+_0xb651('0x15');_0x69d87c+='>';}}return _0x69d87c;}function parseEmail(_0x3db476,_0x212de4,_0x846816){if(_0x212de4[_0xb651('0x16')]){var _0xa31e3=/)<[^<]*)*<\/script>/gi;while(_0xa31e3[_0xb651('0x17')](_0x212de4[_0xb651('0x16')])){_0x212de4['html']=_0x212de4[_0xb651('0x16')][_0xb651('0x18')](_0xa31e3,'');}if(_0x212de4[_0xb651('0x16')][_0xb651('0x19')](_0xb651('0x1a'))){var _0x3bcc78=[];_0x212de4[_0xb651('0x1b')][_0xb651('0x1c')](_0x19731b=>{_0x3bcc78[_0xb651('0x1d')](_0x19731b[_0xb651('0x1e')]);});var _0x179a74=/]+>/g;var _0x19993a=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x4c2b3d=_0x212de4[_0xb651('0x16')][_0xb651('0x18')](_0x19993a,_0xb651('0x1f'));var _0x1a1438=_0x4c2b3d[_0xb651('0x18')](_0x179a74,'_IMG');for(let _0x5df6f7=0x0;_0x5df6f7<_0x3bcc78['length'];_0x5df6f7++){var _0x25cf6f=_0x1a1438['replace']('_IMG','\x20[Attachment:\x20'+_0x3bcc78[_0x5df6f7]+_0xb651('0x20'));_0x1a1438=_0x25cf6f;}_0x212de4[_0xb651('0x16')]=_0x1a1438;}_0x846816['body']=_0x212de4[_0xb651('0x16')];}else{_0x846816[_0xb651('0x21')]=_0x212de4[_0xb651('0x22')];}if(_0x846816[_0xb651('0x21')]){_0x846816['body']=_0x846816['body'][_0xb651('0x18')](/0x0){var _0x459977=[_0xb651('0x2f'),_0xb651('0x30'),_0xb651('0x31')];for(var _0x2c789b=0x0;_0x2c789b<_0x212de4[_0xb651('0x2e')][_0xb651('0x13')];_0x2c789b++){var _0x1d3be4=_[_0xb651('0xe')](_0x459977,_0x212de4[_0xb651('0x2e')][_0x2c789b][_0xb651('0x32')]);if(_0x1d3be4>=0x0){_0x846816['isAutoreply']=!![];}}}return _0x846816;}exports[_0xb651('0x33')]=function(_0x59707f,_0x53d6f6,_0x52e947){var _0xa471c4={'from':getAddress(_0x53d6f6['from']),'firstName':getFirstName(_0x53d6f6[_0xb651('0x34')]),'lastName':getLastName(_0x53d6f6[_0xb651('0x34')]),'mapKey':_0xb651('0x5'),'message':{'from':getMails(_0x59707f[_0xb651('0x5')],_0x53d6f6['from']),'to':_0x59707f[_0xb651('0x5')],'cc':'','subject':_0x53d6f6[_0xb651('0x35')]||'','messageId':_0x53d6f6[_0xb651('0x36')],'inReplyTo':_0x53d6f6[_0xb651('0x37')],'sentAt':moment(_0x53d6f6[_0xb651('0x38')])[_0xb651('0x2a')](_0xb651('0x39')),'attach':![],'attachments':[]}};if(!_0x53d6f6[_0xb651('0x16')]&&!_0x53d6f6[_0xb651('0x22')]){var _0x2130cc=_[_0xb651('0x3a')](_0x53d6f6['attachments'],{'contentType':_0xb651('0x3b')});if(_0x2130cc[_0xb651('0x13')]){logger[_0xb651('0x3c')](util[_0xb651('0x2a')](_0xb651('0x3d'),_0x53d6f6[_0xb651('0x36')]));tnef[_0xb651('0x3e')](_[_0xb651('0x3f')](_0x2130cc)[_0xb651('0x2c')],function(_0x59a6c1,_0x4ff0ed){if(_0x4ff0ed){_0x53d6f6[_0xb651('0x16')]=_0x4ff0ed[_0xb651('0x40')]||_0xb651('0x41');if(_0x4ff0ed[_0xb651('0x42')]){for(var _0x5eca59=0x0;_0x5eca59<_0x4ff0ed[_0xb651('0x42')][_0xb651('0x13')];_0x5eca59++){var _0x2a8fd8=_0x4ff0ed[_0xb651('0x42')][_0x5eca59];_0xa471c4[_0xb651('0x24')][_0xb651('0x1b')][_0xb651('0x1d')]({'filename':_0x2a8fd8['Title'],'content':Buffer[_0xb651('0x34')](_0x2a8fd8['Data'])});}}}_0x52e947(parseEmail(_0x59707f,_0x53d6f6,_0xa471c4));});}else{_0x53d6f6[_0xb651('0x16')]=_0xb651('0x41');_0x52e947(parseEmail(_0x59707f,_0x53d6f6,_0xa471c4));}}else{_0x52e947(parseEmail(_0x59707f,_0x53d6f6,_0xa471c4));}};exports[_0xb651('0x43')]=function(_0x2de957){switch(_0x2de957){case _0xb651('0x44'):return _0xb651('0x45');case _0xb651('0x46'):return'imap.mail.yahoo.com';case _0xb651('0x47'):return _0xb651('0x48');case _0xb651('0x49'):return'outlook.office365.com';}return _0xb651('0x4a');};exports[_0xb651('0x4b')]=function(_0x35aa22,_0x2c85ae){var _0x1a84ba=[_0xb651('0x4c')+(_0x2c85ae||''),_0xb651('0x4d')+_0x35aa22,'',''];return Buffer[_0xb651('0x34')](_0x1a84ba['join'](''),_0xb651('0x4e'))[_0xb651('0x4f')](_0xb651('0x50'));}; \ No newline at end of file +var _0xaa09=['body','message','originTo','email','bcc','attachments','attach','type','attachment-','format','now','join','writeFileSync','content','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','line','isAutoreply','parser','from','subject','YYYY-MM-DD\x20HH:mm:ss','textAsHtml','filter','application/ms-tnef','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','Attachments','push','Data','getHost','imap.gmail.com','yahoo','imap.mail.yahoo.com','outlook365','outlook.office365.com','user=','auth=Bearer\x20','toString','base64','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','../../../config/environment','head','value','address','generate','@xcally.com','name','substring','indexOf','length','slice','Anonymous','pop','isEmpty','anonymous','test','html','replace','includes','\x20[Attachment:\x20','\x20]'];(function(_0x4f4c89,_0x330fa1){var _0x10f812=function(_0x8934fe){while(--_0x8934fe){_0x4f4c89['push'](_0x4f4c89['shift']());}};_0x10f812(++_0x330fa1);}(_0xaa09,0x77));var _0x9aa0=function(_0x40189c,_0x3a35d4){_0x40189c=_0x40189c-0x0;var _0xac4ebb=_0xaa09[_0x40189c];return _0xac4ebb;};'use strict';var _=require(_0x9aa0('0x0'));var moment=require(_0x9aa0('0x1'));var random=require(_0x9aa0('0x2'));var fs=require('fs');var path=require(_0x9aa0('0x3'));var util=require(_0x9aa0('0x4'));var tnef=require(_0x9aa0('0x5'));var logger=require(_0x9aa0('0x6'))('email');var config=require(_0x9aa0('0x7'));function getAddress(_0x57182f){var _0x2877eb=_[_0x9aa0('0x8')](_0x57182f[_0x9aa0('0x9')]);return _0x2877eb&&_0x2877eb[_0x9aa0('0xa')]?_0x2877eb[_0x9aa0('0xa')]:'anonymous'+random[_0x9aa0('0xb')](0x6)+_0x9aa0('0xc');}function getFirstName(_0x34c7c9){var _0x518438=_[_0x9aa0('0x8')](_0x34c7c9[_0x9aa0('0x9')]);if(_0x518438&&_0x518438[_0x9aa0('0xd')]){if(_0x518438[_0x9aa0('0xd')]==_0x518438[_0x9aa0('0xa')]){return _0x518438[_0x9aa0('0xd')][_0x9aa0('0xe')](0x0,_0x518438[_0x9aa0('0xd')][_0x9aa0('0xf')]('@'));}var _0x3eb532=_0x518438['name']['split'](/\s+/);return _0x3eb532[_0x9aa0('0x10')]>0x1?_0x3eb532[_0x9aa0('0x11')](0x0,-0x1)['join']('\x20'):_0x518438[_0x9aa0('0xd')];}return _0x9aa0('0x12');}function getLastName(_0x31c653){var _0x50a524=_['head'](_0x31c653[_0x9aa0('0x9')]);if(_0x50a524&&_0x50a524['name']){var _0x2df9e5=_0x50a524[_0x9aa0('0xd')]['split'](/\s+/);return _0x2df9e5['length']>0x1?_0x2df9e5[_0x9aa0('0x13')]():'';}return'';}function getMails(_0x3512fb,_0x462501){var _0x4d96b8='';for(var _0x5d12a8=0x0;_0x5d12a8<_0x462501[_0x9aa0('0x9')][_0x9aa0('0x10')];_0x5d12a8+=0x1){if(_0x462501[_0x9aa0('0x9')][_0x5d12a8]['address']!==_0x3512fb){if(!_[_0x9aa0('0x14')](_0x4d96b8)){_0x4d96b8+=',';}_0x4d96b8+=_0x462501[_0x9aa0('0x9')][_0x5d12a8][_0x9aa0('0xd')]||_0x462501[_0x9aa0('0x9')][_0x5d12a8][_0x9aa0('0xa')]||'';_0x4d96b8+='\x20<';_0x4d96b8+=_0x462501[_0x9aa0('0x9')][_0x5d12a8][_0x9aa0('0xa')]?_0x462501[_0x9aa0('0x9')][_0x5d12a8][_0x9aa0('0xa')]:_0x9aa0('0x15')+random[_0x9aa0('0xb')](0x6)+_0x9aa0('0xc');_0x4d96b8+='>';}}return _0x4d96b8;}function parseEmail(_0x28820f,_0x1d870f,_0x1b3db6){if(_0x1d870f['html']){var _0x48f84c=/)<[^<]*)*<\/script>/gi;while(_0x48f84c[_0x9aa0('0x16')](_0x1d870f[_0x9aa0('0x17')])){_0x1d870f[_0x9aa0('0x17')]=_0x1d870f[_0x9aa0('0x17')][_0x9aa0('0x18')](_0x48f84c,'');}if(_0x1d870f[_0x9aa0('0x17')][_0x9aa0('0x19')](_0x9aa0('0x1a'))){var _0x3045da=[];_0x1d870f['attachments']['forEach'](_0x50074b=>{_0x3045da['push'](_0x50074b[_0x9aa0('0x1b')]);});var _0x2fc9e5=/]+>/g;var _0x3a71c6=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x2b1b1a=_0x1d870f['html']['replace'](_0x3a71c6,_0x9aa0('0x1c'));var _0x1cd6b4=_0x2b1b1a[_0x9aa0('0x18')](_0x2fc9e5,'_IMG');for(let _0x3b6f62=0x0;_0x3b6f62<_0x3045da[_0x9aa0('0x10')];_0x3b6f62++){var _0x365bad=_0x1cd6b4[_0x9aa0('0x18')]('_IMG',_0x9aa0('0x1d')+_0x3045da[_0x3b6f62]+_0x9aa0('0x1e'));_0x1cd6b4=_0x365bad;}_0x1d870f[_0x9aa0('0x17')]=_0x1cd6b4;}_0x1b3db6[_0x9aa0('0x1f')]=_0x1d870f['html'];}else{_0x1b3db6[_0x9aa0('0x1f')]=_0x1d870f['textAsHtml'];}if(_0x1b3db6[_0x9aa0('0x1f')]){_0x1b3db6['body']=_0x1b3db6[_0x9aa0('0x1f')][_0x9aa0('0x18')](/0x0){var _0x4d3d25=[_0x9aa0('0x2f'),_0x9aa0('0x30'),_0x9aa0('0x31')];for(var _0x1fd156=0x0;_0x1fd156<_0x1d870f[_0x9aa0('0x2e')]['length'];_0x1fd156++){var _0x368b2a=_[_0x9aa0('0xf')](_0x4d3d25,_0x1d870f[_0x9aa0('0x2e')][_0x1fd156][_0x9aa0('0x32')]);if(_0x368b2a>=0x0){_0x1b3db6[_0x9aa0('0x33')]=!![];}}}return _0x1b3db6;}exports[_0x9aa0('0x34')]=function(_0xc5c4c7,_0x1e5eea,_0x43d038){var _0x9819a9={'from':getAddress(_0x1e5eea['from']),'firstName':getFirstName(_0x1e5eea[_0x9aa0('0x35')]),'lastName':getLastName(_0x1e5eea[_0x9aa0('0x35')]),'mapKey':'email','message':{'from':getMails(_0xc5c4c7['email'],_0x1e5eea[_0x9aa0('0x35')]),'to':_0xc5c4c7[_0x9aa0('0x22')],'cc':'','subject':_0x1e5eea[_0x9aa0('0x36')]||'','messageId':_0x1e5eea['messageId'],'inReplyTo':_0x1e5eea['inReplyTo'],'sentAt':moment(_0x1e5eea['date'])[_0x9aa0('0x28')](_0x9aa0('0x37')),'attach':![],'attachments':[]}};if(!_0x1e5eea[_0x9aa0('0x17')]&&!_0x1e5eea[_0x9aa0('0x38')]){var _0x104476=_[_0x9aa0('0x39')](_0x1e5eea[_0x9aa0('0x24')],{'contentType':_0x9aa0('0x3a')});if(_0x104476['length']){logger['info'](util[_0x9aa0('0x28')](_0x9aa0('0x3b'),_0x1e5eea['messageId']));tnef[_0x9aa0('0x3c')](_[_0x9aa0('0x3d')](_0x104476)['content'],function(_0x1db098,_0x4506aa){if(_0x4506aa){_0x1e5eea[_0x9aa0('0x17')]=_0x4506aa['BodyHTML']||'

Empty\x20message

';if(_0x4506aa[_0x9aa0('0x3e')]){for(var _0x11de3a=0x0;_0x11de3a<_0x4506aa['Attachments']['length'];_0x11de3a++){var _0x2520c8=_0x4506aa[_0x9aa0('0x3e')][_0x11de3a];_0x9819a9[_0x9aa0('0x20')]['attachments'][_0x9aa0('0x3f')]({'filename':_0x2520c8['Title'],'content':Buffer[_0x9aa0('0x35')](_0x2520c8[_0x9aa0('0x40')])});}}}_0x43d038(parseEmail(_0xc5c4c7,_0x1e5eea,_0x9819a9));});}else{_0x1e5eea[_0x9aa0('0x17')]='

Empty\x20message

';_0x43d038(parseEmail(_0xc5c4c7,_0x1e5eea,_0x9819a9));}}else{_0x43d038(parseEmail(_0xc5c4c7,_0x1e5eea,_0x9819a9));}};exports[_0x9aa0('0x41')]=function(_0x4a3e5){switch(_0x4a3e5){case'gmail':return _0x9aa0('0x42');case _0x9aa0('0x43'):return _0x9aa0('0x44');case'hotmail':return'imap-mail.outlook.com';case _0x9aa0('0x45'):return _0x9aa0('0x46');}return'127.0.0.1';};exports['generateXOAuth2Token']=function(_0x2c7e81,_0x377287){var _0x46bac5=[_0x9aa0('0x47')+(_0x377287||''),_0x9aa0('0x48')+_0x2c7e81,'',''];return Buffer['from'](_0x46bac5[_0x9aa0('0x2a')](''),'utf-8')[_0x9aa0('0x49')](_0x9aa0('0x4a'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 8e3c539..2c33508 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 _0xa75e=['SERV','Imap','Smtp','lodash','name','Service','key'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa75e,0x106));var _0xea75=function(_0x499f90,_0x18cc56){_0x499f90=_0x499f90-0x0;var _0x5ad390=_0xa75e[_0x499f90];return _0x5ad390;};'use strict';var _=require(_0xea75('0x0'));function MailAccount(_0x2d2219){this['id']=_0x2d2219['id']||0x0;this[_0xea75('0x1')]=_0x2d2219[_0xea75('0x1')]||_0xea75('0x2');this[_0xea75('0x3')]=_0x2d2219[_0xea75('0x3')]||_0xea75('0x4');this['active']=_0x2d2219['active']||![];this[_0xea75('0x5')]=_0x2d2219[_0xea75('0x5')]||[];this[_0xea75('0x6')]=_0x2d2219['Smtp']||[];}module['exports']=MailAccount; \ No newline at end of file +var _0xd677=['Service','key','SERV','active','Imap','Smtp','exports','lodash','name'];(function(_0x13052e,_0x5c5754){var _0x685d7e=function(_0x182db4){while(--_0x182db4){_0x13052e['push'](_0x13052e['shift']());}};_0x685d7e(++_0x5c5754);}(_0xd677,0x154));var _0x7d67=function(_0x5b95f2,_0x2adb49){_0x5b95f2=_0x5b95f2-0x0;var _0x376b33=_0xd677[_0x5b95f2];return _0x376b33;};'use strict';var _=require(_0x7d67('0x0'));function MailAccount(_0x1d80fb){this['id']=_0x1d80fb['id']||0x0;this[_0x7d67('0x1')]=_0x1d80fb[_0x7d67('0x1')]||_0x7d67('0x2');this['key']=_0x1d80fb[_0x7d67('0x3')]||_0x7d67('0x4');this[_0x7d67('0x5')]=_0x1d80fb[_0x7d67('0x5')]||![];this['Imap']=_0x1d80fb[_0x7d67('0x6')]||[];this[_0x7d67('0x7')]=_0x1d80fb[_0x7d67('0x7')]||[];}module[_0x7d67('0x8')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 3e15512..b2a13a8 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 _0xffe4=['mailAccounts','lodash','../model/mailAccount','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','length','isUndefined'];(function(_0x3acb89,_0x2ca05e){var _0x4d38f2=function(_0x4cb6a9){while(--_0x4cb6a9){_0x3acb89['push'](_0x3acb89['shift']());}};_0x4d38f2(++_0x2ca05e);}(_0xffe4,0x6d));var _0x4ffe=function(_0x4ef711,_0x19243c){_0x4ef711=_0x4ef711-0x0;var _0x387032=_0xffe4[_0x4ef711];return _0x387032;};'use strict';var _=require(_0x4ffe('0x0'));var MailAccount=require(_0x4ffe('0x1'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x5b16de,_0xd79f35,_0x54caa3){var _0x508872=_['mapKeys'](_0x5b16de,function(_0x436f28,_0x1de290){return _0x436f28[_0x54caa3];});for(var _0x5cf620 in _0xd79f35){if(_0xd79f35[_0x4ffe('0x2')](_0x5cf620)){if(!_0x508872[_0x5cf620]){delete _0xd79f35[_0x5cf620];}}}}Realtime[_0x4ffe('0x3')][_0x4ffe('0x4')]=function(_0x2cdba1,_0x25f506){for(var _0x1c4e17 in _0x25f506){if(_0x2cdba1[_0x4ffe('0x2')](_0x1c4e17)){_0x2cdba1[_0x1c4e17]=_0x25f506[_0x1c4e17];}}};Realtime[_0x4ffe('0x3')][_0x4ffe('0x5')]=function(){var _0x30ec30=this;return function(_0x1da623){if(_0x1da623){freeIsNotKey(_0x1da623,_0x30ec30['mailAccounts'],'id');for(var _0x4d3eff=0x0,_0x555c80={},_0x2b2bcf={};_0x4d3eff<_0x1da623[_0x4ffe('0x6')];_0x4d3eff+=0x1){_0x555c80=_0x1da623[_0x4d3eff];if(_[_0x4ffe('0x7')](_0x30ec30['mailAccounts'][_0x555c80['id']])){_0x30ec30[_0x4ffe('0x8')][_0x555c80['id']]=new MailAccount(_0x555c80);}else{_['merge'](_0x30ec30[_0x4ffe('0x8')][_0x555c80['id']],_0x555c80);}}}return _0x30ec30[_0x4ffe('0x8')];};};module['exports']=Realtime; \ No newline at end of file +var _0x6d2f=['lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype','length','isUndefined'];(function(_0x501b35,_0x352c25){var _0x204306=function(_0x79bbd8){while(--_0x79bbd8){_0x501b35['push'](_0x501b35['shift']());}};_0x204306(++_0x352c25);}(_0x6d2f,0xc0));var _0xf6d2=function(_0x1cd65a,_0x29fa8f){_0x1cd65a=_0x1cd65a-0x0;var _0xf93849=_0x6d2f[_0x1cd65a];return _0xf93849;};'use strict';var _=require(_0xf6d2('0x0'));var MailAccount=require(_0xf6d2('0x1'));var Realtime=function(){this[_0xf6d2('0x2')]={};};function freeIsNotKey(_0x558f52,_0xcb94bb,_0x5054ce){var _0x401608=_[_0xf6d2('0x3')](_0x558f52,function(_0x1cbd74,_0x52da96){return _0x1cbd74[_0x5054ce];});for(var _0x400cec in _0xcb94bb){if(_0xcb94bb[_0xf6d2('0x4')](_0x400cec)){if(!_0x401608[_0x400cec]){delete _0xcb94bb[_0x400cec];}}}}Realtime[_0xf6d2('0x5')]['mergeFromDatabase']=function(_0x551709,_0x7a8263){for(var _0x5715c3 in _0x7a8263){if(_0x551709[_0xf6d2('0x4')](_0x5715c3)){_0x551709[_0x5715c3]=_0x7a8263[_0x5715c3];}}};Realtime[_0xf6d2('0x5')]['initMailAccounts']=function(){var _0xcaa468=this;return function(_0x3ea901){if(_0x3ea901){freeIsNotKey(_0x3ea901,_0xcaa468[_0xf6d2('0x2')],'id');for(var _0x306203=0x0,_0xfec6c6={},_0x120121={};_0x306203<_0x3ea901[_0xf6d2('0x6')];_0x306203+=0x1){_0xfec6c6=_0x3ea901[_0x306203];if(_[_0xf6d2('0x7')](_0xcaa468[_0xf6d2('0x2')][_0xfec6c6['id']])){_0xcaa468[_0xf6d2('0x2')][_0xfec6c6['id']]=new MailAccount(_0xfec6c6);}else{_['merge'](_0xcaa468[_0xf6d2('0x2')][_0xfec6c6['id']],_0xfec6c6);}}}return _0xcaa468[_0xf6d2('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 16933d4..b00cc53 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 _0xb6ff=['Request','GetMailAccount','provider','service','email','key','ListId','Imap','CloudProvider','name','data5','Smtp','type','notify','NotifyMailAccount','../client','getMailAccounts'];(function(_0x26cb03,_0x38d271){var _0x5b7ac9=function(_0x4ab1b9){while(--_0x4ab1b9){_0x26cb03['push'](_0x26cb03['shift']());}};_0x5b7ac9(++_0x38d271);}(_0xb6ff,0x185));var _0xfb6f=function(_0xd299c3,_0x4ba0f1){_0xd299c3=_0xd299c3-0x0;var _0x376574=_0xb6ff[_0xd299c3];return _0x376574;};'use strict';var client=require(_0xfb6f('0x0'));exports[_0xfb6f('0x1')]=function(){return function(){return client[_0xfb6f('0x2')](_0xfb6f('0x3'),{'options':{'attributes':['id','name',_0xfb6f('0x4'),_0xfb6f('0x5'),_0xfb6f('0x6'),'active',_0xfb6f('0x7'),_0xfb6f('0x8'),'TemplateId'],'raw':![],'include':[{'model':'MailServerIn','as':_0xfb6f('0x9'),'include':[{'model':_0xfb6f('0xa'),'attributes':['id',_0xfb6f('0xb'),_0xfb6f('0x5'),'type',_0xfb6f('0xc')],'as':_0xfb6f('0xa')}]},{'model':'MailServerOut','as':_0xfb6f('0xd'),'include':[{'model':_0xfb6f('0xa'),'attributes':['id',_0xfb6f('0xb'),'service',_0xfb6f('0xe'),'data5'],'as':_0xfb6f('0xa')}]}]},'log':'getMailAccount'});};};exports[_0xfb6f('0xf')]=function(_0x3cda77,_0x2a328c){return client[_0xfb6f('0x2')](_0xfb6f('0x10'),{'account':{'id':_0x3cda77},'body':_0x2a328c,'log':_0xfb6f('0x10')});}; \ No newline at end of file +var _0xb1f7=['email','active','key','ListId','TemplateId','MailServerIn','Imap','CloudProvider','type','data5','MailServerOut','Smtp','getMailAccount','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','name','provider','service'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0xb1f7,0x19d));var _0x7b1f=function(_0x7882f2,_0x12aaae){_0x7882f2=_0x7882f2-0x0;var _0x1eefbe=_0xb1f7[_0x7882f2];return _0x1eefbe;};'use strict';var client=require(_0x7b1f('0x0'));exports[_0x7b1f('0x1')]=function(){return function(){return client[_0x7b1f('0x2')](_0x7b1f('0x3'),{'options':{'attributes':['id',_0x7b1f('0x4'),_0x7b1f('0x5'),_0x7b1f('0x6'),_0x7b1f('0x7'),_0x7b1f('0x8'),_0x7b1f('0x9'),_0x7b1f('0xa'),_0x7b1f('0xb')],'raw':![],'include':[{'model':_0x7b1f('0xc'),'as':_0x7b1f('0xd'),'include':[{'model':_0x7b1f('0xe'),'attributes':['id',_0x7b1f('0x4'),_0x7b1f('0x6'),_0x7b1f('0xf'),_0x7b1f('0x10')],'as':_0x7b1f('0xe')}]},{'model':_0x7b1f('0x11'),'as':_0x7b1f('0x12'),'include':[{'model':_0x7b1f('0xe'),'attributes':['id','name','service','type',_0x7b1f('0x10')],'as':_0x7b1f('0xe')}]}]},'log':_0x7b1f('0x13')});};};exports['notify']=function(_0x2af42e,_0x33f354){return client[_0x7b1f('0x2')](_0x7b1f('0x14'),{'account':{'id':_0x2af42e},'body':_0x33f354,'log':'NotifyMailAccount'});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index fc8a5d0..9f63c90 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 _0xef57=['loginMailFrequency','GetSettings','../client','getSettings'];(function(_0x547228,_0x2c7c33){var _0x4cfa0a=function(_0x501de8){while(--_0x501de8){_0x547228['push'](_0x547228['shift']());}};_0x4cfa0a(++_0x2c7c33);}(_0xef57,0x1b2));var _0x7ef5=function(_0x2e03d0,_0x1471a0){_0x2e03d0=_0x2e03d0-0x0;var _0x21272f=_0xef57[_0x2e03d0];return _0x21272f;};'use strict';var client=require(_0x7ef5('0x0'));exports[_0x7ef5('0x1')]=function(){return client['Request']('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x7ef5('0x2')]},'log':_0x7ef5('0x3')});}; \ No newline at end of file +var _0x5037=['Request','ShowSetting','GetSettings'];(function(_0x25af83,_0x49dedd){var _0x2b1902=function(_0x4e7b5a){while(--_0x4e7b5a){_0x25af83['push'](_0x25af83['shift']());}};_0x2b1902(++_0x49dedd);}(_0x5037,0xd2));var _0x7503=function(_0x45f8ef,_0x26fc8d){_0x45f8ef=_0x45f8ef-0x0;var _0x10878a=_0x5037[_0x45f8ef];return _0x10878a;};'use strict';var client=require('../client');exports['getSettings']=function(){return client[_0x7503('0x0')](_0x7503('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0x7503('0x2')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 61a0117..085baac 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file diff --git a/server/services/express/index.js b/server/services/express/index.js index 53041f7..735ea09 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 _0x174c=['../../config/environment','createServer','timeout','listen','port','socket.io','polling','redis','defaults','localhost','adapter','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','express','sticky-session','ioredis'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x174c,0xbd));var _0xc174=function(_0x21c0de,_0x4a9720){_0x21c0de=_0x21c0de-0x0;var _0x32229e=_0x174c[_0x21c0de];return _0x32229e;};'use strict';var _=require('lodash');var http=require('http');var express=require(_0xc174('0x0'));var sticky=require(_0xc174('0x1'));var Redis=require(_0xc174('0x2'));var config=require(_0xc174('0x3'));var app=express();var server=http[_0xc174('0x4')](app);server[_0xc174('0x5')]=0xdbba0;if(sticky[_0xc174('0x6')](server,config[_0xc174('0x7')])){var socketio=require(_0xc174('0x8'))(server,{'transports':['websocket',_0xc174('0x9')]});config[_0xc174('0xa')]=_[_0xc174('0xb')](config[_0xc174('0xa')],{'host':_0xc174('0xc'),'port':0x18eb});socketio[_0xc174('0xd')](require(_0xc174('0xe'))({'pubClient':new Redis(config[_0xc174('0xa')]),'subClient':new Redis(config['redis'])}));require(_0xc174('0xf'))[_0xc174('0x10')]();require(_0xc174('0x11'))[_0xc174('0x10')](socketio);require(_0xc174('0x12'))[_0xc174('0x10')](app);require(_0xc174('0x13'))['default'](app);}else{server['once'](_0xc174('0x14'),function(){console[_0xc174('0x15')](_0xc174('0x16'),config[_0xc174('0x7')]);});}exports=module[_0xc174('0x17')]=app; \ No newline at end of file +var _0xd389=['polling','redis','defaults','adapter','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','lodash','http','express','ioredis','../../config/environment','timeout','listen','port','socket.io','websocket'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xd389,0x1ab));var _0x9d38=function(_0x75f855,_0x133595){_0x75f855=_0x75f855-0x0;var _0x4ffb79=_0xd389[_0x75f855];return _0x4ffb79;};'use strict';var _=require(_0x9d38('0x0'));var http=require(_0x9d38('0x1'));var express=require(_0x9d38('0x2'));var sticky=require('sticky-session');var Redis=require(_0x9d38('0x3'));var config=require(_0x9d38('0x4'));var app=express();var server=http['createServer'](app);server[_0x9d38('0x5')]=0xdbba0;if(sticky[_0x9d38('0x6')](server,config[_0x9d38('0x7')])){var socketio=require(_0x9d38('0x8'))(server,{'transports':[_0x9d38('0x9'),_0x9d38('0xa')]});config[_0x9d38('0xb')]=_[_0x9d38('0xc')](config[_0x9d38('0xb')],{'host':'localhost','port':0x18eb});socketio[_0x9d38('0xd')](require(_0x9d38('0xe'))({'pubClient':new Redis(config[_0x9d38('0xb')]),'subClient':new Redis(config[_0x9d38('0xb')])}));require(_0x9d38('0xf'))[_0x9d38('0x10')]();require(_0x9d38('0x11'))[_0x9d38('0x10')](socketio);require(_0x9d38('0x12'))[_0x9d38('0x10')](app);require(_0x9d38('0x13'))[_0x9d38('0x10')](app);}else{server['once'](_0x9d38('0x14'),function(){console[_0x9d38('0x15')](_0x9d38('0x16'),config[_0x9d38('0x7')]);});}exports=module['exports']=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index e2acb46..bdc2ce2 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 _0xe2f3=['error','rpc','message','result','exports','../../config/logger','routing','client','http','request','debug'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0xe2f3,0xe1));var _0x3e2f=function(_0x5ebe63,_0x2956bc){_0x5ebe63=_0x5ebe63-0x0;var _0x1f91ee=_0xe2f3[_0x5ebe63];return _0x1f91ee;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x3e2f('0x0'))(_0x3e2f('0x1'));var client=jayson[_0x3e2f('0x2')][_0x3e2f('0x3')]({'port':0x2329});client['Request']=function(_0x5d37c4,_0x16ed8e){return new BPromise(function(_0x26f28e,_0x187e7c){return client[_0x3e2f('0x4')](_0x5d37c4,_0x16ed8e)['then'](function(_0x1ef3a5){logger[_0x3e2f('0x5')]('rpc',_0x3e2f('0x1'),_0x5d37c4,_0x16ed8e,_0x1ef3a5);if(_0x1ef3a5[_0x3e2f('0x6')]){logger[_0x3e2f('0x6')](_0x3e2f('0x7'),_0x3e2f('0x1'),_0x5d37c4,_0x1ef3a5['error'][_0x3e2f('0x8')],_0x16ed8e);return _0x187e7c(_0x1ef3a5[_0x3e2f('0x6')]['message']);}else{return _0x26f28e(_0x1ef3a5[_0x3e2f('0x9')]);}})['catch'](function(_0x246ae7){logger['error'](_0x3e2f('0x7'),_0x3e2f('0x1'),_0x5d37c4,_0x246ae7,_0x16ed8e);return _0x187e7c(_0x246ae7);});});};module[_0x3e2f('0xa')]=client; \ No newline at end of file +var _0x8b25=['routing','client','http','Request','request','rpc','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger'];(function(_0x4d16c7,_0x153f0e){var _0x24c82b=function(_0x27f46c){while(--_0x27f46c){_0x4d16c7['push'](_0x4d16c7['shift']());}};_0x24c82b(++_0x153f0e);}(_0x8b25,0x1d9));var _0x58b2=function(_0x1d886b,_0x593cc9){_0x1d886b=_0x1d886b-0x0;var _0x2cee91=_0x8b25[_0x1d886b];return _0x2cee91;};'use strict';var jayson=require(_0x58b2('0x0'));var BPromise=require(_0x58b2('0x1'));var logger=require(_0x58b2('0x2'))(_0x58b2('0x3'));var client=jayson[_0x58b2('0x4')][_0x58b2('0x5')]({'port':0x2329});client[_0x58b2('0x6')]=function(_0x52a15b,_0x4c5684){return new BPromise(function(_0x14a918,_0x2e4613){return client[_0x58b2('0x7')](_0x52a15b,_0x4c5684)['then'](function(_0x5219cf){logger['debug'](_0x58b2('0x8'),_0x58b2('0x3'),_0x52a15b,_0x4c5684,_0x5219cf);if(_0x5219cf[_0x58b2('0x9')]){logger[_0x58b2('0x9')](_0x58b2('0x8'),_0x58b2('0x3'),_0x52a15b,_0x5219cf[_0x58b2('0x9')][_0x58b2('0xa')],_0x4c5684);return _0x2e4613(_0x5219cf[_0x58b2('0x9')][_0x58b2('0xa')]);}else{return _0x14a918(_0x5219cf[_0x58b2('0xb')]);}})[_0x58b2('0xc')](function(_0x17e9bf){logger['error']('rpc',_0x58b2('0x3'),_0x52a15b,_0x17e9bf,_0x4c5684);return _0x2e4613(_0x17e9bf);});});};module[_0x58b2('0xd')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 980323f..2315f1e 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 _0xe37b=['initSmsQueues','getFaxQueues','initWhatsappQueues','listen','catch','log','bluebird','./server','./realtime','./rpc/user','./rpc/chatQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','getAgents','initAgents','then','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','getSmsQueues'];(function(_0x58bb4e,_0x54dd3f){var _0x37947e=function(_0x5f213a){while(--_0x5f213a){_0x58bb4e['push'](_0x58bb4e['shift']());}};_0x37947e(++_0x54dd3f);}(_0xe37b,0x16b));var _0xbe37=function(_0x24f671,_0x442d25){_0x24f671=_0x24f671-0x0;var _0x3af4e4=_0xe37b[_0x24f671];return _0x3af4e4;};'use strict';var BPromise=require(_0xbe37('0x0'));var server=require(_0xbe37('0x1'));var Realtime=require(_0xbe37('0x2'));var user=require(_0xbe37('0x3'));var interval=require('./rpc/interval');var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0xbe37('0x4'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0xbe37('0x5'));var faxQueue=require(_0xbe37('0x6'));var whatsappQueue=require(_0xbe37('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()['then'](user[_0xbe37('0x8')]())['then'](realtime[_0xbe37('0x9')]())[_0xbe37('0xa')](interval['getIntervals']())['then'](realtime['initIntervals']())['then'](openchannelQueue[_0xbe37('0xb')]())[_0xbe37('0xa')](realtime[_0xbe37('0xc')]())[_0xbe37('0xa')](chatQueue[_0xbe37('0xd')]())[_0xbe37('0xa')](realtime['initChatQueues']())[_0xbe37('0xa')](smsQueue[_0xbe37('0xe')]())[_0xbe37('0xa')](realtime[_0xbe37('0xf')]())[_0xbe37('0xa')](mailQueue['getMailQueues']())[_0xbe37('0xa')](realtime['initMailQueues']())[_0xbe37('0xa')](faxQueue[_0xbe37('0x10')]())[_0xbe37('0xa')](realtime['initFaxQueues']())[_0xbe37('0xa')](whatsappQueue['getWhatsappQueues']())['then'](realtime[_0xbe37('0x11')]())[_0xbe37('0xa')](function(){return realtime;});}function main(){return server[_0xbe37('0x12')](realtime)[_0xbe37('0xa')](function(_0x2e8aa2){return initRealtime();})[_0xbe37('0xa')](function(_0x32b1de){return setInterval(initRealtime,0x1388);})[_0xbe37('0x13')](function(_0x5a7ace){console[_0xbe37('0x14')](_0x5a7ace);});}main(); \ No newline at end of file +var _0x747d=['./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','getIntervals','initIntervals','initOpenchannelQueues','initChatQueues','getSmsQueues','initSmsQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','log','./server','./realtime','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue'];(function(_0x1c97c8,_0x28d564){var _0x2c096d=function(_0x1bf3ec){while(--_0x1bf3ec){_0x1c97c8['push'](_0x1c97c8['shift']());}};_0x2c096d(++_0x28d564);}(_0x747d,0x170));var _0xd747=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x747d[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require('bluebird');var server=require(_0xd747('0x0'));var Realtime=require(_0xd747('0x1'));var user=require('./rpc/user');var interval=require(_0xd747('0x2'));var openchannelQueue=require(_0xd747('0x3'));var chatQueue=require(_0xd747('0x4'));var smsQueue=require(_0xd747('0x5'));var mailQueue=require(_0xd747('0x6'));var faxQueue=require(_0xd747('0x7'));var whatsappQueue=require(_0xd747('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xd747('0x9')]()[_0xd747('0xa')](user[_0xd747('0xb')]())[_0xd747('0xa')](realtime[_0xd747('0xc')]())[_0xd747('0xa')](interval[_0xd747('0xd')]())[_0xd747('0xa')](realtime[_0xd747('0xe')]())[_0xd747('0xa')](openchannelQueue['getOpenchannelQueues']())[_0xd747('0xa')](realtime[_0xd747('0xf')]())[_0xd747('0xa')](chatQueue['getChatQueues']())[_0xd747('0xa')](realtime[_0xd747('0x10')]())['then'](smsQueue[_0xd747('0x11')]())[_0xd747('0xa')](realtime[_0xd747('0x12')]())[_0xd747('0xa')](mailQueue['getMailQueues']())[_0xd747('0xa')](realtime[_0xd747('0x13')]())['then'](faxQueue[_0xd747('0x14')]())[_0xd747('0xa')](realtime[_0xd747('0x15')]())['then'](whatsappQueue[_0xd747('0x16')]())['then'](realtime[_0xd747('0x17')]())[_0xd747('0xa')](function(){return realtime;});}function main(){return server['listen'](realtime)['then'](function(_0x4037db){return initRealtime();})[_0xd747('0xa')](function(_0x5b68e2){return setInterval(initRealtime,0x1388);})['catch'](function(_0x569466){console[_0xd747('0x18')](_0x569466);});}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 9e4f187..8c5fc71 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fc3=['lodash','util','EventEmitter','init','isNil','ignoreFactChanges','inherits','activeRules','prototype','register','isArray','rules','isObject','sync','orderBy','asc','execute','clone','ruleRef','name','index_','push','call','nextTick','next','isEqual','restart','length','condition','matchPath','noop','findRules','filter','prioritize','priority','toJSON','map','consequence','toString','fromJSON','isString','parse'];(function(_0x32c9b9,_0x21a0cf){var _0x239eab=function(_0x25fceb){while(--_0x25fceb){_0x32c9b9['push'](_0x32c9b9['shift']());}};_0x239eab(++_0x21a0cf);}(_0x5fc3,0xa8));var _0x35fc=function(_0x269ee8,_0x477226){_0x269ee8=_0x269ee8-0x0;var _0x4d98bd=_0x5fc3[_0x269ee8];return _0x4d98bd;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var EventEmitter=require('events')[_0x35fc('0x2')];function RuleEngine(_0x2ac6da,_0x196bc2){this[_0x35fc('0x3')]();if(!_[_0x35fc('0x4')](_0x2ac6da)){this['register'](_0x2ac6da);}if(_0x196bc2){this[_0x35fc('0x5')]=_0x196bc2[_0x35fc('0x5')];}return this;}util[_0x35fc('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x19a0d1){this['rules']=[];this[_0x35fc('0x7')]=[];};RuleEngine[_0x35fc('0x8')][_0x35fc('0x9')]=function(_0x1e5f90){if(Array[_0x35fc('0xa')](_0x1e5f90)){this[_0x35fc('0xb')]=this[_0x35fc('0xb')]['concat'](_0x1e5f90);}else if(_0x1e5f90!==null&&_[_0x35fc('0xc')](_0x1e5f90)){this[_0x35fc('0xb')]['push'](_0x1e5f90);}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')]['sync']=function(){this[_0x35fc('0x7')]=this[_0x35fc('0xb')]['filter'](function(_0x4cbe74){if(_[_0x35fc('0x4')](_0x4cbe74['on'])){_0x4cbe74['on']=!![];}if(_0x4cbe74['on']===!![]){return _0x4cbe74;}});this['activeRules']=_[_0x35fc('0xe')](this[_0x35fc('0x7')],['p'],[_0x35fc('0xf')]);};RuleEngine[_0x35fc('0x8')][_0x35fc('0x10')]=function(_0x5cfe94,_0x59507a){var _0x5eac0f=![];_0x5cfe94['result']=!![];var _0x398b67=_[_0x35fc('0x11')](_0x5cfe94);var _0x53b898=_[_0x35fc('0x11')](_0x5cfe94);var _0x227a49=this[_0x35fc('0x7')];var _0x480851=[];var _0x26ba54=this[_0x35fc('0x5')];(function FnRuleLoop(_0x553677){var _0x41e165={'rules':function(){return _0x227a49;},'rule':function(){return _0x227a49[_0x553677];},'when':function(_0x363e47){if(_0x363e47){var _0x2e513b=_0x227a49[_0x553677]['consequence'];_0x2e513b[_0x35fc('0x12')]=_0x227a49[_0x553677]['id']||_0x227a49[_0x553677][_0x35fc('0x13')]||_0x35fc('0x14')+_0x553677;process['nextTick'](function(){_0x480851[_0x35fc('0x15')](_0x2e513b[_0x35fc('0x12')]);_0x2e513b[_0x35fc('0x16')](_0x398b67,_0x41e165);});}else{process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x5eac0f=!![];return FnRuleLoop(0x0);},'next':function(_0x21f1a9){if(!_0x26ba54&&!_[_0x35fc('0x19')](_0x53b898,_0x398b67)){_0x53b898=_[_0x35fc('0x11')](_0x398b67);process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x1a')]();});}else{process['nextTick'](function(){if(_[_0x35fc('0x4')](_0x21f1a9)){return FnRuleLoop(_0x553677+0x1);}else{return FnRuleLoop(_0x21f1a9);}});}}};if(_0x553677<_0x227a49[_0x35fc('0x1b')]&&_0x5eac0f===![]){var _0x257719=_0x227a49[_0x553677][_0x35fc('0x1c')];_0x257719[_0x35fc('0x16')](_0x398b67,_0x41e165);}else{process['nextTick'](function(){_0x398b67[_0x35fc('0x1d')]=_0x480851;return _0x59507a?_0x59507a(_0x398b67):_[_0x35fc('0x1e')]();});}}(0x0));};RuleEngine['prototype'][_0x35fc('0x1f')]=function(_0x5a93df){if(_[_0x35fc('0x4')](_0x5a93df)){return this['rules'];}else{var _0x4086e9=_['matches'](_0x5a93df);return _[_0x35fc('0x20')](this[_0x35fc('0xb')],_0x4086e9);}};RuleEngine['prototype']['turn']=function(_0x47774c,_0x58edb6){var _0x274208=_0x47774c==='on'||_0x47774c==='ON'?!![]:![];var _0x1a5d92=this['findRules'](_0x58edb6);for(var _0x26b7cb=0x0,_0x645eac=_0x1a5d92[_0x35fc('0x1b')];_0x26b7cb<_0x645eac;_0x26b7cb+=0x1){_0x1a5d92[_0x26b7cb]['on']=_0x274208;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x21')]=function(_0x11ccdb,_0x451f0c){_0x11ccdb=parseInt(_0x11ccdb,0xa);var _0x54aedc=this[_0x35fc('0x1f')](_0x451f0c);for(var _0x220931=0x0,_0x22af18=_0x54aedc['length'];_0x220931<_0x22af18;_0x220931+=0x1){_0x54aedc[_0x220931][_0x35fc('0x22')]=_0x11ccdb;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x23')]=function(){var _0xd8a4ca=this[_0x35fc('0xb')];if(_0xd8a4ca instanceof Array){_0xd8a4ca=_0xd8a4ca[_0x35fc('0x24')](function(_0x37b435){_0x37b435[_0x35fc('0x1c')]=_0x37b435[_0x35fc('0x1c')]['toString']();_0x37b435['consequence']=_0x37b435[_0x35fc('0x25')]['toString']();return _0x37b435;});}else if(!_[_0x35fc('0x4')](_0xd8a4ca)){_0xd8a4ca[_0x35fc('0x1c')]=_0xd8a4ca[_0x35fc('0x1c')][_0x35fc('0x26')]();_0xd8a4ca[_0x35fc('0x25')]=_0xd8a4ca[_0x35fc('0x25')]['toString']();}return _0xd8a4ca;};RuleEngine[_0x35fc('0x8')][_0x35fc('0x27')]=function(_0x46b9ef){this[_0x35fc('0x3')]();if(_[_0x35fc('0x28')](_0x46b9ef)){_0x46b9ef=JSON[_0x35fc('0x29')](_0x46b9ef);}if(_0x46b9ef instanceof Array){_0x46b9ef=_0x46b9ef['map'](function(_0x2483be){_0x2483be[_0x35fc('0x1c')]=eval('('+_0x2483be[_0x35fc('0x1c')]+')');_0x2483be['consequence']=eval('('+_0x2483be[_0x35fc('0x25')]+')');return _0x2483be;});}else if(_0x46b9ef!==null&&typeof _0x46b9ef=='object'){_0x46b9ef[_0x35fc('0x1c')]=eval('('+_0x46b9ef[_0x35fc('0x1c')]+')');_0x46b9ef[_0x35fc('0x25')]=eval('('+_0x46b9ef[_0x35fc('0x25')]+')');}this['register'](_0x46b9ef);};module['exports']=RuleEngine; \ No newline at end of file +var _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(_0xc5c9ac,_0x57c492){var _0x3f4606=function(_0x2aa448){while(--_0x2aa448){_0xc5c9ac['push'](_0xc5c9ac['shift']());}};_0x3f4606(++_0x57c492);}(_0x326f,0xd1));var _0xf326=function(_0x2a3933,_0x16d3d2){_0x2a3933=_0x2a3933-0x0;var _0x6a4b24=_0x326f[_0x2a3933];return _0x6a4b24;};'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 abf6243..4cfed5b 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 _0xb05b=['client','http','error','message','result','catch','SendMail','jayson/promise'];(function(_0x15cbce,_0xda8402){var _0x257f29=function(_0x388132){while(--_0x388132){_0x15cbce['push'](_0x15cbce['shift']());}};_0x257f29(++_0xda8402);}(_0xb05b,0x167));var _0xbb05=function(_0x4d584f,_0x385fcd){_0x4d584f=_0x4d584f-0x0;var _0x383793=_0xb05b[_0x4d584f];return _0x383793;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xbb05('0x0'));var client=jayson[_0xbb05('0x1')][_0xbb05('0x2')]({'port':0x232b});function request(_0x30bdbc,_0x2d28f3){return new BPromise(function(_0x3132e1,_0x17ce80){return client['request'](_0x30bdbc,_0x2d28f3)['then'](function(_0x6d8953){if(_0x6d8953[_0xbb05('0x3')]){return _0x17ce80(_0x6d8953[_0xbb05('0x3')][_0xbb05('0x4')]);}else{return _0x3132e1(_0x6d8953[_0xbb05('0x5')]);}})[_0xbb05('0x6')](function(_0x3f22be){return _0x17ce80(_0x3f22be);});});}exports['sendMailMessage']=function(_0xb84a38,_0x475bad){return request(_0xbb05('0x7'),{'account':_0xb84a38,'message':_0x475bad});}; \ No newline at end of file +var _0xc221=['result','catch','sendMailMessage','bluebird','jayson/promise','client','http','request','then','error','message'];(function(_0x592694,_0x3b1336){var _0x174315=function(_0xd15dba){while(--_0xd15dba){_0x592694['push'](_0x592694['shift']());}};_0x174315(++_0x3b1336);}(_0xc221,0x71));var _0x1c22=function(_0x32991c,_0x5434e7){_0x32991c=_0x32991c-0x0;var _0x56f2be=_0xc221[_0x32991c];return _0x56f2be;};'use strict';var BPromise=require(_0x1c22('0x0'));var jayson=require(_0x1c22('0x1'));var client=jayson[_0x1c22('0x2')][_0x1c22('0x3')]({'port':0x232b});function request(_0x4de90a,_0x100ea2){return new BPromise(function(_0x1dd500,_0x5017b8){return client[_0x1c22('0x4')](_0x4de90a,_0x100ea2)[_0x1c22('0x5')](function(_0x2995e1){if(_0x2995e1[_0x1c22('0x6')]){return _0x5017b8(_0x2995e1[_0x1c22('0x6')][_0x1c22('0x7')]);}else{return _0x1dd500(_0x2995e1[_0x1c22('0x8')]);}})[_0x1c22('0x9')](function(_0x1e6fa5){return _0x5017b8(_0x1e6fa5);});});}exports[_0x1c22('0xa')]=function(_0x5b5cc6,_0xbf0af3){return request('SendMail',{'account':_0x5b5cc6,'message':_0xbf0af3});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 463e271..f9a7d53 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 _0xbfda=['chat','openchannel','fax','sms','whatsapp','length','Status','StatusTime','toNumber','format','chatCurrentCapacity','faxStatusTime','smsStatus','smsStatusTime','openchannelStatusTime','stringify','emit','user:save','exports','lodash','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','updateRealtime','prototype','getChannelStatus','Capacity','CurrentCapacity','idle','mail'];(function(_0x4a7631,_0x2c85b9){var _0x1a5a6f=function(_0x1ee3fd){while(--_0x1ee3fd){_0x4a7631['push'](_0x4a7631['shift']());}};_0x1a5a6f(++_0x2c85b9);}(_0xbfda,0x193));var _0xabfd=function(_0xe65ac8,_0x2691be){_0xe65ac8=_0xe65ac8-0x0;var _0x202ba1=_0xbfda[_0xe65ac8];return _0x202ba1;};'use strict';var _=require(_0xabfd('0x0'));var moment=require(_0xabfd('0x1'));var md5=require(_0xabfd('0x2'));var Redis=require(_0xabfd('0x3'));var config=require(_0xabfd('0x4'));config[_0xabfd('0x5')]=_[_0xabfd('0x6')](config[_0xabfd('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xabfd('0x7'))(new Redis(config['redis']));function Agent(_0x12d61f){this['id']=_0x12d61f['id']||0x0;this[_0xabfd('0x8')]=_0x12d61f[_0xabfd('0x8')]||'';this[_0xabfd('0x9')]=_0x12d61f['online']||!![];this[_0xabfd('0xa')]=_0x12d61f[_0xabfd('0xa')]||![];this[_0xabfd('0xb')]=_0x12d61f['chatPause']||![];this[_0xabfd('0xc')]=_0x12d61f['mailPause']||![];this[_0xabfd('0xd')]=_0x12d61f[_0xabfd('0xd')]||![];this[_0xabfd('0xe')]=_0x12d61f[_0xabfd('0xe')]||![];this['openchannelPause']=_0x12d61f[_0xabfd('0xf')]||![];this[_0xabfd('0x10')]=_0xabfd('0x11');this[_0xabfd('0x12')]=0x0;this[_0xabfd('0x13')]=_0x12d61f[_0xabfd('0x13')]||0x0;this['chatCurrentCapacity']=0x0;this[_0xabfd('0x14')]=_0xabfd('0x11');this[_0xabfd('0x15')]=0x0;this['mailCapacity']=_0x12d61f[_0xabfd('0x16')]||0x0;this[_0xabfd('0x17')]=0x0;this[_0xabfd('0x18')]='unknown';this['faxStatusTime']=0x0;this[_0xabfd('0x19')]=_0x12d61f[_0xabfd('0x19')]||0x0;this[_0xabfd('0x1a')]=0x0;this['smsStatus']=_0xabfd('0x11');this['smsStatusTime']=0x0;this[_0xabfd('0x1b')]=_0x12d61f[_0xabfd('0x1b')]||0x0;this[_0xabfd('0x1c')]=0x0;this[_0xabfd('0x1d')]=_0xabfd('0x11');this[_0xabfd('0x1e')]=0x0;this[_0xabfd('0x1f')]=_0x12d61f[_0xabfd('0x1f')]||0x0;this[_0xabfd('0x20')]=0x0;this[_0xabfd('0x21')]=_0xabfd('0x11');this['openchannelStatusTime']=0x0;this['openchannelCapacity']=_0x12d61f[_0xabfd('0x22')]||0x0;this[_0xabfd('0x23')]=0x0;this[_0xabfd('0x24')]=![];this[_0xabfd('0x25')]=undefined;this['md5']='';this[_0xabfd('0x26')]();}Agent[_0xabfd('0x27')][_0xabfd('0x28')]=function(_0x2f9488){if(this[_0x2f9488+'CurrentCapacity']>0x0){if(this[_0x2f9488+_0xabfd('0x29')]>0x0&&this[_0x2f9488+_0xabfd('0x2a')]>=this[_0x2f9488+_0xabfd('0x29')]){return'maxcapacity';}else{return'working';}}else{return _0xabfd('0x2b');}};Agent[_0xabfd('0x27')][_0xabfd('0x26')]=function(){var _0x5d1659=[_0xabfd('0x2c'),_0xabfd('0x2d'),_0xabfd('0x2e'),_0xabfd('0x2f'),_0xabfd('0x30'),_0xabfd('0x31')];for(var _0x202266=0x0;_0x202266<_0x5d1659[_0xabfd('0x32')];_0x202266+=0x1){var _0x1d4838=this[_0xabfd('0x28')](_0x5d1659[_0x202266]);if(this[_0x5d1659[_0x202266]+_0xabfd('0x33')]!==_0x1d4838){this[_0x5d1659[_0x202266]+_0xabfd('0x34')]=_[_0xabfd('0x35')](moment()[_0xabfd('0x36')]('x'));}this[_0x5d1659[_0x202266]+_0xabfd('0x33')]=_0x1d4838;}var _0x21d7a0={'id':this['id'],'name':this[_0xabfd('0x8')],'online':this[_0xabfd('0x9')],'voicePause':this[_0xabfd('0xa')],'chatPause':this[_0xabfd('0xb')],'mailPause':this['mailPause'],'smsPause':this[_0xabfd('0xe')],'faxPause':this[_0xabfd('0xd')],'openchannelPause':this['openchannelPause'],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0xabfd('0x12')],'chatCapacity':this[_0xabfd('0x13')],'chatCurrentCapacity':this[_0xabfd('0x37')],'mailStatus':this[_0xabfd('0x14')],'mailStatusTime':this[_0xabfd('0x15')],'mailCapacity':this[_0xabfd('0x16')],'mailCurrentCapacity':this[_0xabfd('0x17')],'faxStatus':this[_0xabfd('0x18')],'faxStatusTime':this[_0xabfd('0x38')],'faxCapacity':this[_0xabfd('0x19')],'faxCurrentCapacity':this[_0xabfd('0x1a')],'smsStatus':this[_0xabfd('0x39')],'smsStatusTime':this[_0xabfd('0x3a')],'smsCapacity':this[_0xabfd('0x1b')],'smsCurrentCapacity':this[_0xabfd('0x1c')],'whatsappStatus':this[_0xabfd('0x1d')],'whatsappStatusTime':this[_0xabfd('0x1e')],'whatsappCapacity':this[_0xabfd('0x1f')],'whatsappCurrentCapacity':this[_0xabfd('0x20')],'openchannelStatus':this[_0xabfd('0x21')],'openchannelStatusTime':this[_0xabfd('0x3b')],'openchannelCapacity':this[_0xabfd('0x22')],'openchannelCurrentCapacity':this[_0xabfd('0x23')],'busy':this['busy'],'busyQueue':this['busyQueue']};var _0x8f5684=md5(JSON[_0xabfd('0x3c')](_0x21d7a0));if(this[_0xabfd('0x2')]!==_0x8f5684){this[_0xabfd('0x2')]=_0x8f5684;io[_0xabfd('0x3d')](_0xabfd('0x3e'),_0x21d7a0);}};module[_0xabfd('0x3f')]=Agent; \ No newline at end of file +var _0xc465=['openchannelCapacity','busy','busyQueue','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','mail','chat','openchannel','length','Status','StatusTime','toNumber','format','mailStatus','faxStatus','smsStatusTime','whatsappCurrentCapacity','stringify','emit','user:save','lodash','moment','md5','ioredis','../../../config/environment','redis','defaults','localhost','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatCapacity','chatCurrentCapacity','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','openchannelStatus','openchannelStatusTime'];(function(_0xab0b32,_0x52d49d){var _0x3532f2=function(_0x2261ac){while(--_0x2261ac){_0xab0b32['push'](_0xab0b32['shift']());}};_0x3532f2(++_0x52d49d);}(_0xc465,0x100));var _0x5c46=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0xc465[_0x25e7cb];return _0x375d92;};'use strict';var _=require(_0x5c46('0x0'));var moment=require(_0x5c46('0x1'));var md5=require(_0x5c46('0x2'));var Redis=require(_0x5c46('0x3'));var config=require(_0x5c46('0x4'));config[_0x5c46('0x5')]=_[_0x5c46('0x6')](config[_0x5c46('0x5')],{'host':_0x5c46('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5c46('0x5')]));function Agent(_0x3a4e73){this['id']=_0x3a4e73['id']||0x0;this[_0x5c46('0x8')]=_0x3a4e73[_0x5c46('0x8')]||'';this[_0x5c46('0x9')]=_0x3a4e73[_0x5c46('0x9')]||!![];this[_0x5c46('0xa')]=_0x3a4e73[_0x5c46('0xa')]||![];this['chatPause']=_0x3a4e73[_0x5c46('0xb')]||![];this[_0x5c46('0xc')]=_0x3a4e73[_0x5c46('0xc')]||![];this[_0x5c46('0xd')]=_0x3a4e73[_0x5c46('0xd')]||![];this[_0x5c46('0xe')]=_0x3a4e73[_0x5c46('0xe')]||![];this[_0x5c46('0xf')]=_0x3a4e73[_0x5c46('0xf')]||![];this[_0x5c46('0x10')]=_0x5c46('0x11');this['chatStatusTime']=0x0;this[_0x5c46('0x12')]=_0x3a4e73[_0x5c46('0x12')]||0x0;this[_0x5c46('0x13')]=0x0;this['mailStatus']=_0x5c46('0x11');this[_0x5c46('0x14')]=0x0;this[_0x5c46('0x15')]=_0x3a4e73[_0x5c46('0x15')]||0x0;this[_0x5c46('0x16')]=0x0;this['faxStatus']=_0x5c46('0x11');this[_0x5c46('0x17')]=0x0;this[_0x5c46('0x18')]=_0x3a4e73[_0x5c46('0x18')]||0x0;this[_0x5c46('0x19')]=0x0;this[_0x5c46('0x1a')]=_0x5c46('0x11');this['smsStatusTime']=0x0;this['smsCapacity']=_0x3a4e73[_0x5c46('0x1b')]||0x0;this[_0x5c46('0x1c')]=0x0;this[_0x5c46('0x1d')]='unknown';this[_0x5c46('0x1e')]=0x0;this[_0x5c46('0x1f')]=_0x3a4e73[_0x5c46('0x1f')]||0x0;this['whatsappCurrentCapacity']=0x0;this[_0x5c46('0x20')]=_0x5c46('0x11');this[_0x5c46('0x21')]=0x0;this['openchannelCapacity']=_0x3a4e73[_0x5c46('0x22')]||0x0;this['openchannelCurrentCapacity']=0x0;this[_0x5c46('0x23')]=![];this[_0x5c46('0x24')]=undefined;this[_0x5c46('0x2')]='';this[_0x5c46('0x25')]();}Agent[_0x5c46('0x26')][_0x5c46('0x27')]=function(_0x1f2e51){if(this[_0x1f2e51+_0x5c46('0x28')]>0x0){if(this[_0x1f2e51+'Capacity']>0x0&&this[_0x1f2e51+_0x5c46('0x28')]>=this[_0x1f2e51+_0x5c46('0x29')]){return _0x5c46('0x2a');}else{return'working';}}else{return'idle';}};Agent[_0x5c46('0x26')][_0x5c46('0x25')]=function(){var _0x440d72=[_0x5c46('0x2b'),_0x5c46('0x2c'),_0x5c46('0x2d'),'fax','sms','whatsapp'];for(var _0x1e92e5=0x0;_0x1e92e5<_0x440d72[_0x5c46('0x2e')];_0x1e92e5+=0x1){var _0x2f220f=this[_0x5c46('0x27')](_0x440d72[_0x1e92e5]);if(this[_0x440d72[_0x1e92e5]+_0x5c46('0x2f')]!==_0x2f220f){this[_0x440d72[_0x1e92e5]+_0x5c46('0x30')]=_[_0x5c46('0x31')](moment()[_0x5c46('0x32')]('x'));}this[_0x440d72[_0x1e92e5]+_0x5c46('0x2f')]=_0x2f220f;}var _0x11260d={'id':this['id'],'name':this[_0x5c46('0x8')],'online':this[_0x5c46('0x9')],'voicePause':this[_0x5c46('0xa')],'chatPause':this['chatPause'],'mailPause':this[_0x5c46('0xc')],'smsPause':this['smsPause'],'faxPause':this['faxPause'],'openchannelPause':this[_0x5c46('0xf')],'chatStatus':this['chatStatus'],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0x5c46('0x12')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0x5c46('0x33')],'mailStatusTime':this[_0x5c46('0x14')],'mailCapacity':this[_0x5c46('0x15')],'mailCurrentCapacity':this[_0x5c46('0x16')],'faxStatus':this[_0x5c46('0x34')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x5c46('0x19')],'smsStatus':this[_0x5c46('0x1a')],'smsStatusTime':this[_0x5c46('0x35')],'smsCapacity':this[_0x5c46('0x1b')],'smsCurrentCapacity':this[_0x5c46('0x1c')],'whatsappStatus':this[_0x5c46('0x1d')],'whatsappStatusTime':this[_0x5c46('0x1e')],'whatsappCapacity':this[_0x5c46('0x1f')],'whatsappCurrentCapacity':this[_0x5c46('0x36')],'openchannelStatus':this[_0x5c46('0x20')],'openchannelStatusTime':this[_0x5c46('0x21')],'openchannelCapacity':this[_0x5c46('0x22')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0x5c46('0x23')],'busyQueue':this[_0x5c46('0x24')]};var _0x3fb7bf=md5(JSON[_0x5c46('0x37')](_0x11260d));if(this[_0x5c46('0x2')]!==_0x3fb7bf){this[_0x5c46('0x2')]=_0x3fb7bf;io[_0x5c46('0x38')](_0x5c46('0x39'),_0x11260d);}};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 ff816bf..550a83d 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 _0x7d5e=['updateRouting','prototype','_rr','mapAgentsId','map','updateRealtime','length','loggedIn','chatPause','paused','available','waiting','format','chat:queue:%s','emit','exports','lodash','md5','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents'];(function(_0x4c9806,_0x1d3ef5){var _0x570950=function(_0x5c24b0){while(--_0x5c24b0){_0x4c9806['push'](_0x4c9806['shift']());}};_0x570950(++_0x1d3ef5);}(_0x7d5e,0x14f));var _0xe7d5=function(_0x4e2c68,_0xa32554){_0x4e2c68=_0x4e2c68-0x0;var _0x1d88c3=_0x7d5e[_0x4e2c68];return _0x1d88c3;};'use strict';var _=require(_0xe7d5('0x0'));var md5=require(_0xe7d5('0x1'));var util=require(_0xe7d5('0x2'));var Redis=require(_0xe7d5('0x3'));var config=require('../../../config/environment');config[_0xe7d5('0x4')]=_[_0xe7d5('0x5')](config[_0xe7d5('0x4')],{'host':_0xe7d5('0x6'),'port':0x18eb});var io=require(_0xe7d5('0x7'))(new Redis(config[_0xe7d5('0x4')]));function ChatQueue(_0x111c3f){this['id']=_0x111c3f['id']||0x0;this[_0xe7d5('0x8')]=_0x111c3f[_0xe7d5('0x8')]||'';this[_0xe7d5('0x9')]=_0x111c3f['timeout']||0xa;this[_0xe7d5('0xa')]=_0x111c3f[_0xe7d5('0xa')]||_0xe7d5('0xb');this['Agents']=_0x111c3f[_0xe7d5('0xc')];this['mapAgentsId']={};this['waiting']=0x0;this[_0xe7d5('0x1')]='';this[_0xe7d5('0xd')]();this['updateRealtime']();}ChatQueue[_0xe7d5('0xe')][_0xe7d5('0xd')]=function(){var _0x4b4e6b=this['mapAgentsId'][_0xe7d5('0xf')];this[_0xe7d5('0x10')]=_[_0xe7d5('0x11')](this[_0xe7d5('0xc')],'id');this['mapAgentsId']['_rr']=_0x4b4e6b;};ChatQueue[_0xe7d5('0xe')][_0xe7d5('0x12')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x3807bc=0x0;_0x3807bc=0x0?this['available']:0x0;var _0x2e9e75={'id':this['id'],'available':this[_0xe7d5('0x17')],'loggedIn':this[_0xe7d5('0x14')],'name':this[_0xe7d5('0x8')],'paused':this[_0xe7d5('0x16')],'waiting':this[_0xe7d5('0x18')]};var _0x39935a=md5(JSON['stringify'](_0x2e9e75));if(this[_0xe7d5('0x1')]!==_0x39935a){this[_0xe7d5('0x1')]=_0x39935a;io['to'](util[_0xe7d5('0x19')](_0xe7d5('0x1a'),_0x2e9e75['name']))[_0xe7d5('0x1b')]('chat_queue:save',_0x2e9e75);}};module[_0xe7d5('0x1c')]=ChatQueue; \ No newline at end of file +var _0xa4e1=['Agents','mapAgentsId','md5','updateRealtime','prototype','updateRouting','_rr','map','length','online','loggedIn','paused','available','waiting','stringify','format','chat:queue:%s','emit','chat_queue:save','lodash','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall'];(function(_0x5bd14c,_0x46fda7){var _0x53bcbd=function(_0x2afd9d){while(--_0x2afd9d){_0x5bd14c['push'](_0x5bd14c['shift']());}};_0x53bcbd(++_0x46fda7);}(_0xa4e1,0x121));var _0x1a4e=function(_0x4e0bb5,_0x307f58){_0x4e0bb5=_0x4e0bb5-0x0;var _0xc89f95=_0xa4e1[_0x4e0bb5];return _0xc89f95;};'use strict';var _=require(_0x1a4e('0x0'));var md5=require('md5');var util=require(_0x1a4e('0x1'));var Redis=require('ioredis');var config=require(_0x1a4e('0x2'));config[_0x1a4e('0x3')]=_[_0x1a4e('0x4')](config[_0x1a4e('0x3')],{'host':_0x1a4e('0x5'),'port':0x18eb});var io=require(_0x1a4e('0x6'))(new Redis(config[_0x1a4e('0x3')]));function ChatQueue(_0x2e494){this['id']=_0x2e494['id']||0x0;this[_0x1a4e('0x7')]=_0x2e494[_0x1a4e('0x7')]||'';this['timeout']=_0x2e494[_0x1a4e('0x8')]||0xa;this[_0x1a4e('0x9')]=_0x2e494[_0x1a4e('0x9')]||_0x1a4e('0xa');this[_0x1a4e('0xb')]=_0x2e494['Agents'];this[_0x1a4e('0xc')]={};this['waiting']=0x0;this[_0x1a4e('0xd')]='';this['updateRouting']();this[_0x1a4e('0xe')]();}ChatQueue[_0x1a4e('0xf')][_0x1a4e('0x10')]=function(){var _0x17c05d=this['mapAgentsId'][_0x1a4e('0x11')];this[_0x1a4e('0xc')]=_[_0x1a4e('0x12')](this[_0x1a4e('0xb')],'id');this[_0x1a4e('0xc')]['_rr']=_0x17c05d;};ChatQueue[_0x1a4e('0xf')][_0x1a4e('0xe')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x6ad27d=0x0;_0x6ad27d=0x0?this[_0x1a4e('0x17')]:0x0;var _0x56eb98={'id':this['id'],'available':this[_0x1a4e('0x17')],'loggedIn':this[_0x1a4e('0x15')],'name':this[_0x1a4e('0x7')],'paused':this[_0x1a4e('0x16')],'waiting':this[_0x1a4e('0x18')]};var _0x49d821=md5(JSON[_0x1a4e('0x19')](_0x56eb98));if(this[_0x1a4e('0xd')]!==_0x49d821){this['md5']=_0x49d821;io['to'](util[_0x1a4e('0x1a')](_0x1a4e('0x1b'),_0x56eb98[_0x1a4e('0x7')]))[_0x1a4e('0x1c')](_0x1a4e('0x1d'),_0x56eb98);}};module['exports']=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index f996ae5..1463b7f 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 _0xd768=['socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','updateRouting','prototype','_rr','map','updateRealtime','loggedIn','paused','online','faxPause','available','stringify','fax:queue:%s','emit','fax_queue:save','exports','lodash','md5','util','../../../config/environment','defaults','redis','localhost'];(function(_0xfa2f68,_0x23836e){var _0x252d9a=function(_0x285e61){while(--_0x285e61){_0xfa2f68['push'](_0xfa2f68['shift']());}};_0x252d9a(++_0x23836e);}(_0xd768,0xa1));var _0x8d76=function(_0x397014,_0x17cc12){_0x397014=_0x397014-0x0;var _0x1163f7=_0xd768[_0x397014];return _0x1163f7;};'use strict';var _=require(_0x8d76('0x0'));var md5=require(_0x8d76('0x1'));var util=require(_0x8d76('0x2'));var Redis=require('ioredis');var config=require(_0x8d76('0x3'));config['redis']=_[_0x8d76('0x4')](config[_0x8d76('0x5')],{'host':_0x8d76('0x6'),'port':0x18eb});var io=require(_0x8d76('0x7'))(new Redis(config['redis']));function FaxQueue(_0x37134b){this['id']=_0x37134b['id']||0x0;this[_0x8d76('0x8')]=_0x37134b['name']||'';this[_0x8d76('0x9')]=_0x37134b['timeout']||0xa;this['strategy']=_0x37134b[_0x8d76('0xa')]||'beepall';this[_0x8d76('0xb')]=_0x37134b[_0x8d76('0xb')];this[_0x8d76('0xc')]={};this['waiting']=0x0;this['md5']='';this[_0x8d76('0xd')]();this['updateRealtime']();}FaxQueue[_0x8d76('0xe')][_0x8d76('0xd')]=function(){var _0xef473f=this[_0x8d76('0xc')][_0x8d76('0xf')];this[_0x8d76('0xc')]=_[_0x8d76('0x10')](this[_0x8d76('0xb')],'id');this[_0x8d76('0xc')][_0x8d76('0xf')]=_0xef473f;};FaxQueue[_0x8d76('0xe')][_0x8d76('0x11')]=function(){this[_0x8d76('0x12')]=0x0;this[_0x8d76('0x13')]=0x0;for(var _0x5f5838=0x0;_0x5f5838=0x0?this[_0x8d76('0x16')]:0x0;var _0x1b7971={'id':this['id'],'available':this[_0x8d76('0x16')],'loggedIn':this[_0x8d76('0x12')],'name':this['name'],'paused':this[_0x8d76('0x13')],'waiting':this['waiting']};var _0x5f1211=md5(JSON[_0x8d76('0x17')](_0x1b7971));if(this['md5']!==_0x5f1211){this['md5']=_0x5f1211;io['to'](util['format'](_0x8d76('0x18'),_0x1b7971[_0x8d76('0x8')]))[_0x8d76('0x19')](_0x8d76('0x1a'),_0x1b7971);}};module[_0x8d76('0x1b')]=FaxQueue; \ No newline at end of file +var _0x2347=['Agents','mapAgentsId','updateRouting','_rr','map','prototype','updateRealtime','paused','length','online','loggedIn','available','stringify','format','fax:queue:%s','emit','fax_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x2347,0xc6));var _0x7234=function(_0x2d7b62,_0x1327df){_0x2d7b62=_0x2d7b62-0x0;var _0x25cef1=_0x2347[_0x2d7b62];return _0x25cef1;};'use strict';var _=require(_0x7234('0x0'));var md5=require(_0x7234('0x1'));var util=require(_0x7234('0x2'));var Redis=require(_0x7234('0x3'));var config=require(_0x7234('0x4'));config['redis']=_['defaults'](config[_0x7234('0x5')],{'host':_0x7234('0x6'),'port':0x18eb});var io=require(_0x7234('0x7'))(new Redis(config[_0x7234('0x5')]));function FaxQueue(_0x49b7e6){this['id']=_0x49b7e6['id']||0x0;this[_0x7234('0x8')]=_0x49b7e6[_0x7234('0x8')]||'';this[_0x7234('0x9')]=_0x49b7e6[_0x7234('0x9')]||0xa;this[_0x7234('0xa')]=_0x49b7e6[_0x7234('0xa')]||_0x7234('0xb');this[_0x7234('0xc')]=_0x49b7e6[_0x7234('0xc')];this[_0x7234('0xd')]={};this['waiting']=0x0;this[_0x7234('0x1')]='';this[_0x7234('0xe')]();this['updateRealtime']();}FaxQueue['prototype'][_0x7234('0xe')]=function(){var _0x315b6c=this['mapAgentsId'][_0x7234('0xf')];this[_0x7234('0xd')]=_[_0x7234('0x10')](this['Agents'],'id');this[_0x7234('0xd')][_0x7234('0xf')]=_0x315b6c;};FaxQueue[_0x7234('0x11')][_0x7234('0x12')]=function(){this['loggedIn']=0x0;this[_0x7234('0x13')]=0x0;for(var _0x200545=0x0;_0x200545=0x0?this[_0x7234('0x17')]:0x0;var _0x4851bc={'id':this['id'],'available':this[_0x7234('0x17')],'loggedIn':this['loggedIn'],'name':this[_0x7234('0x8')],'paused':this['paused'],'waiting':this['waiting']};var _0xe46a80=md5(JSON[_0x7234('0x18')](_0x4851bc));if(this[_0x7234('0x1')]!==_0xe46a80){this[_0x7234('0x1')]=_0xe46a80;io['to'](util[_0x7234('0x19')](_0x7234('0x1a'),_0x4851bc[_0x7234('0x8')]))[_0x7234('0x1b')](_0x7234('0x1c'),_0x4851bc);}};module[_0x7234('0x1d')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index b4b17af..b06d9c3 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 _0x8eba=['name','Intervals','exports'];(function(_0x374818,_0x180a2d){var _0x62aa58=function(_0x50e125){while(--_0x50e125){_0x374818['push'](_0x374818['shift']());}};_0x62aa58(++_0x180a2d);}(_0x8eba,0x135));var _0xa8eb=function(_0x303064,_0x12f0c2){_0x303064=_0x303064-0x0;var _0x5a1d3d=_0x8eba[_0x303064];return _0x5a1d3d;};'use strict';function Interval(_0x3ce4c3){this['id']=_0x3ce4c3['id']||0x0;this[_0xa8eb('0x0')]=_0x3ce4c3[_0xa8eb('0x0')]||'';this[_0xa8eb('0x1')]=_0x3ce4c3[_0xa8eb('0x1')]||{};}module[_0xa8eb('0x2')]=Interval; \ No newline at end of file +var _0x42cc=['Intervals','exports','name'];(function(_0x245690,_0x3bf938){var _0x3fb9a4=function(_0x3354b3){while(--_0x3354b3){_0x245690['push'](_0x245690['shift']());}};_0x3fb9a4(++_0x3bf938);}(_0x42cc,0x119));var _0xc42c=function(_0x220afa,_0xf5f6cc){_0x220afa=_0x220afa-0x0;var _0x1b79d1=_0x42cc[_0x220afa];return _0x1b79d1;};'use strict';function Interval(_0x100827){this['id']=_0x100827['id']||0x0;this['name']=_0x100827[_0xc42c('0x0')]||'';this[_0xc42c('0x1')]=_0x100827[_0xc42c('0x1')]||{};}module[_0xc42c('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 c0f16b6..1328095 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 _0x3be7=['waiting','updateRouting','updateRealtime','_rr','prototype','loggedIn','length','online','mailPause','paused','available','md5','format','mail:queue:%s','emit','mail_queue:save','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','Agents','mapAgentsId'];(function(_0x55f380,_0x3e27f0){var _0x36b38e=function(_0x31bbc6){while(--_0x31bbc6){_0x55f380['push'](_0x55f380['shift']());}};_0x36b38e(++_0x3e27f0);}(_0x3be7,0x1c0));var _0x73be=function(_0x406f1e,_0x4ee57e){_0x406f1e=_0x406f1e-0x0;var _0x248807=_0x3be7[_0x406f1e];return _0x248807;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x73be('0x0'));var Redis=require(_0x73be('0x1'));var config=require(_0x73be('0x2'));config[_0x73be('0x3')]=_[_0x73be('0x4')](config['redis'],{'host':_0x73be('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x73be('0x3')]));function MailQueue(_0x563a20){this['id']=_0x563a20['id']||0x0;this[_0x73be('0x6')]=_0x563a20['name']||'';this[_0x73be('0x7')]=_0x563a20[_0x73be('0x7')]||0xa;this[_0x73be('0x8')]=_0x563a20[_0x73be('0x8')]||'beepall';this['Agents']=_0x563a20[_0x73be('0x9')];this[_0x73be('0xa')]={};this[_0x73be('0xb')]=0x0;this['md5']='';this[_0x73be('0xc')]();this[_0x73be('0xd')]();}MailQueue['prototype']['updateRouting']=function(){var _0x44b797=this[_0x73be('0xa')][_0x73be('0xe')];this['mapAgentsId']=_['map'](this[_0x73be('0x9')],'id');this['mapAgentsId'][_0x73be('0xe')]=_0x44b797;};MailQueue[_0x73be('0xf')][_0x73be('0xd')]=function(){this[_0x73be('0x10')]=0x0;this['paused']=0x0;for(var _0x212c41=0x0;_0x212c41=0x0?this[_0x73be('0x15')]:0x0;var _0x129ddf={'id':this['id'],'available':this['available'],'loggedIn':this[_0x73be('0x10')],'name':this[_0x73be('0x6')],'paused':this[_0x73be('0x14')],'waiting':this[_0x73be('0xb')]};var _0xb15297=md5(JSON['stringify'](_0x129ddf));if(this[_0x73be('0x16')]!==_0xb15297){this[_0x73be('0x16')]=_0xb15297;io['to'](util[_0x73be('0x17')](_0x73be('0x18'),_0x129ddf[_0x73be('0x6')]))[_0x73be('0x19')](_0x73be('0x1a'),_0x129ddf);}};module['exports']=MailQueue; \ No newline at end of file +var _0x8486=['defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','mailPause','available','stringify','format','emit','mail_queue:save','exports','md5','util','ioredis','../../../config/environment','redis'];(function(_0x4cab36,_0x27aa8f){var _0x1eca64=function(_0x245753){while(--_0x245753){_0x4cab36['push'](_0x4cab36['shift']());}};_0x1eca64(++_0x27aa8f);}(_0x8486,0x1ad));var _0x6848=function(_0x508095,_0x1c8d7c){_0x508095=_0x508095-0x0;var _0x10f4ac=_0x8486[_0x508095];return _0x10f4ac;};'use strict';var _=require('lodash');var md5=require(_0x6848('0x0'));var util=require(_0x6848('0x1'));var Redis=require(_0x6848('0x2'));var config=require(_0x6848('0x3'));config[_0x6848('0x4')]=_[_0x6848('0x5')](config[_0x6848('0x4')],{'host':_0x6848('0x6'),'port':0x18eb});var io=require(_0x6848('0x7'))(new Redis(config[_0x6848('0x4')]));function MailQueue(_0x3e87b4){this['id']=_0x3e87b4['id']||0x0;this[_0x6848('0x8')]=_0x3e87b4['name']||'';this[_0x6848('0x9')]=_0x3e87b4[_0x6848('0x9')]||0xa;this[_0x6848('0xa')]=_0x3e87b4[_0x6848('0xa')]||_0x6848('0xb');this[_0x6848('0xc')]=_0x3e87b4[_0x6848('0xc')];this[_0x6848('0xd')]={};this[_0x6848('0xe')]=0x0;this['md5']='';this[_0x6848('0xf')]();this[_0x6848('0x10')]();}MailQueue[_0x6848('0x11')][_0x6848('0xf')]=function(){var _0x15ff8c=this['mapAgentsId'][_0x6848('0x12')];this['mapAgentsId']=_[_0x6848('0x13')](this[_0x6848('0xc')],'id');this[_0x6848('0xd')]['_rr']=_0x15ff8c;};MailQueue[_0x6848('0x11')][_0x6848('0x10')]=function(){this[_0x6848('0x14')]=0x0;this[_0x6848('0x15')]=0x0;for(var _0x2626ac=0x0;_0x2626ac=0x0?this[_0x6848('0x19')]:0x0;var _0x5cfb3e={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0x6848('0x8')],'paused':this[_0x6848('0x15')],'waiting':this['waiting']};var _0x500cef=md5(JSON[_0x6848('0x1a')](_0x5cfb3e));if(this[_0x6848('0x0')]!==_0x500cef){this['md5']=_0x500cef;io['to'](util[_0x6848('0x1b')]('mail:queue:%s',_0x5cfb3e[_0x6848('0x8')]))[_0x6848('0x1c')](_0x6848('0x1d'),_0x5cfb3e);}};module[_0x6848('0x1e')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 5ac29e6..dc26ed7 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(_0x2bf670,_0x396bc1){var _0x1087b4=function(_0x1695d6){while(--_0x1695d6){_0x2bf670['push'](_0x2bf670['shift']());}};_0x1087b4(++_0x396bc1);}(_0x814b,0x1a2));var _0xb814=function(_0x5e3bb1,_0x3cfe7c){_0x5e3bb1=_0x5e3bb1-0x0;var _0x4c1278=_0x814b[_0x5e3bb1];return _0x4c1278;};'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 _0x1261=['available','stringify','openchannel:queue:%s','openchannel_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','prototype','mapAgentsId','map','_rr','updateRealtime','loggedIn','paused','length','online'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x1261,0x144));var _0x1126=function(_0x3d5df9,_0x5b3623){_0x3d5df9=_0x3d5df9-0x0;var _0x50ba39=_0x1261[_0x3d5df9];return _0x50ba39;};'use strict';var _=require('lodash');var md5=require(_0x1126('0x0'));var util=require(_0x1126('0x1'));var Redis=require(_0x1126('0x2'));var config=require(_0x1126('0x3'));config[_0x1126('0x4')]=_[_0x1126('0x5')](config[_0x1126('0x4')],{'host':_0x1126('0x6'),'port':0x18eb});var io=require(_0x1126('0x7'))(new Redis(config[_0x1126('0x4')]));function OpenchannelQueue(_0x5a2189){this['id']=_0x5a2189['id']||0x0;this['name']=_0x5a2189[_0x1126('0x8')]||'';this[_0x1126('0x9')]=_0x5a2189['timeout']||0xa;this[_0x1126('0xa')]=_0x5a2189[_0x1126('0xa')]||_0x1126('0xb');this[_0x1126('0xc')]=_0x5a2189[_0x1126('0xc')];this['mapAgentsId']={};this[_0x1126('0xd')]=0x0;this[_0x1126('0x0')]='';this[_0x1126('0xe')]();this['updateRealtime']();}OpenchannelQueue[_0x1126('0xf')]['updateRouting']=function(){var _0x52ef15=this[_0x1126('0x10')]['_rr'];this[_0x1126('0x10')]=_[_0x1126('0x11')](this[_0x1126('0xc')],'id');this[_0x1126('0x10')][_0x1126('0x12')]=_0x52ef15;};OpenchannelQueue[_0x1126('0xf')][_0x1126('0x13')]=function(){this[_0x1126('0x14')]=0x0;this[_0x1126('0x15')]=0x0;for(var _0x53a8f0=0x0;_0x53a8f0=0x0?this['available']:0x0;var _0x4d2b38={'id':this['id'],'available':this[_0x1126('0x18')],'loggedIn':this[_0x1126('0x14')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x1126('0xd')]};var _0x58b109=md5(JSON[_0x1126('0x19')](_0x4d2b38));if(this[_0x1126('0x0')]!==_0x58b109){this[_0x1126('0x0')]=_0x58b109;io['to'](util['format'](_0x1126('0x1a'),_0x4d2b38['name']))['emit'](_0x1126('0x1b'),_0x4d2b38);}};module[_0x1126('0x1c')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 483bb20..826a124 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 _0xd6d6=['util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','map','_rr','loggedIn','paused','length','online','smsPause','available','stringify','format','sms:queue:%s','emit','sms_queue:save','exports','lodash','md5'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x52aa63,_0x411087){_0x52aa63=_0x52aa63-0x0;var _0x420691=_0xd6d6[_0x52aa63];return _0x420691;};'use strict';var _=require(_0x6d6d('0x0'));var md5=require(_0x6d6d('0x1'));var util=require(_0x6d6d('0x2'));var Redis=require(_0x6d6d('0x3'));var config=require('../../../config/environment');config[_0x6d6d('0x4')]=_[_0x6d6d('0x5')](config[_0x6d6d('0x4')],{'host':_0x6d6d('0x6'),'port':0x18eb});var io=require(_0x6d6d('0x7'))(new Redis(config[_0x6d6d('0x4')]));function SmsQueue(_0x35a813){this['id']=_0x35a813['id']||0x0;this['name']=_0x35a813[_0x6d6d('0x8')]||'';this[_0x6d6d('0x9')]=_0x35a813[_0x6d6d('0x9')]||0xa;this[_0x6d6d('0xa')]=_0x35a813[_0x6d6d('0xa')]||_0x6d6d('0xb');this[_0x6d6d('0xc')]=_0x35a813['Agents'];this['mapAgentsId']={};this[_0x6d6d('0xd')]=0x0;this[_0x6d6d('0x1')]='';this[_0x6d6d('0xe')]();this[_0x6d6d('0xf')]();}SmsQueue[_0x6d6d('0x10')]['updateRouting']=function(){var _0x1f2b86=this[_0x6d6d('0x11')]['_rr'];this['mapAgentsId']=_[_0x6d6d('0x12')](this[_0x6d6d('0xc')],'id');this[_0x6d6d('0x11')][_0x6d6d('0x13')]=_0x1f2b86;};SmsQueue[_0x6d6d('0x10')][_0x6d6d('0xf')]=function(){this[_0x6d6d('0x14')]=0x0;this[_0x6d6d('0x15')]=0x0;for(var _0x5f4154=0x0;_0x5f4154=0x0?this[_0x6d6d('0x19')]:0x0;var _0x1a75d8={'id':this['id'],'available':this[_0x6d6d('0x19')],'loggedIn':this[_0x6d6d('0x14')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x6d6d('0xd')]};var _0x5a5855=md5(JSON[_0x6d6d('0x1a')](_0x1a75d8));if(this[_0x6d6d('0x1')]!==_0x5a5855){this[_0x6d6d('0x1')]=_0x5a5855;io['to'](util[_0x6d6d('0x1b')](_0x6d6d('0x1c'),_0x1a75d8[_0x6d6d('0x8')]))[_0x6d6d('0x1d')](_0x6d6d('0x1e'),_0x1a75d8);}};module[_0x6d6d('0x1f')]=SmsQueue; \ No newline at end of file +var _0xf9f7=['md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','length','online','smsPause','available','paused','format','sms:queue:%s','emit','lodash'];(function(_0x3bad42,_0x3c736d){var _0xa57adf=function(_0x24df89){while(--_0x24df89){_0x3bad42['push'](_0x3bad42['shift']());}};_0xa57adf(++_0x3c736d);}(_0xf9f7,0xdf));var _0x7f9f=function(_0x2f379a,_0x53382d){_0x2f379a=_0x2f379a-0x0;var _0x305249=_0xf9f7[_0x2f379a];return _0x305249;};'use strict';var _=require(_0x7f9f('0x0'));var md5=require(_0x7f9f('0x1'));var util=require(_0x7f9f('0x2'));var Redis=require(_0x7f9f('0x3'));var config=require(_0x7f9f('0x4'));config[_0x7f9f('0x5')]=_['defaults'](config['redis'],{'host':_0x7f9f('0x6'),'port':0x18eb});var io=require(_0x7f9f('0x7'))(new Redis(config[_0x7f9f('0x5')]));function SmsQueue(_0xee790a){this['id']=_0xee790a['id']||0x0;this[_0x7f9f('0x8')]=_0xee790a[_0x7f9f('0x8')]||'';this['timeout']=_0xee790a[_0x7f9f('0x9')]||0xa;this[_0x7f9f('0xa')]=_0xee790a[_0x7f9f('0xa')]||_0x7f9f('0xb');this[_0x7f9f('0xc')]=_0xee790a['Agents'];this[_0x7f9f('0xd')]={};this[_0x7f9f('0xe')]=0x0;this[_0x7f9f('0x1')]='';this[_0x7f9f('0xf')]();this[_0x7f9f('0x10')]();}SmsQueue[_0x7f9f('0x11')][_0x7f9f('0xf')]=function(){var _0x4a2786=this[_0x7f9f('0xd')][_0x7f9f('0x12')];this['mapAgentsId']=_['map'](this[_0x7f9f('0xc')],'id');this['mapAgentsId'][_0x7f9f('0x12')]=_0x4a2786;};SmsQueue[_0x7f9f('0x11')]['updateRealtime']=function(){this[_0x7f9f('0x13')]=0x0;this['paused']=0x0;for(var _0x292470=0x0;_0x292470=0x0?this[_0x7f9f('0x17')]:0x0;var _0x2d663e={'id':this['id'],'available':this[_0x7f9f('0x17')],'loggedIn':this['loggedIn'],'name':this[_0x7f9f('0x8')],'paused':this[_0x7f9f('0x18')],'waiting':this['waiting']};var _0x28621a=md5(JSON['stringify'](_0x2d663e));if(this[_0x7f9f('0x1')]!==_0x28621a){this[_0x7f9f('0x1')]=_0x28621a;io['to'](util[_0x7f9f('0x19')](_0x7f9f('0x1a'),_0x2d663e['name']))[_0x7f9f('0x1b')]('sms_queue:save',_0x2d663e);}};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 7f4fe54..d5c29b7 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 _0xc0ff=['available','waiting','stringify','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','updateRouting','updateRealtime','_rr','mapAgentsId','map','loggedIn','paused','length','online','whatsappPause'];(function(_0x34bad1,_0x4ab7f1){var _0x39c694=function(_0x4a7ba9){while(--_0x4a7ba9){_0x34bad1['push'](_0x34bad1['shift']());}};_0x39c694(++_0x4ab7f1);}(_0xc0ff,0x13b));var _0xfc0f=function(_0x38080e,_0x95512d){_0x38080e=_0x38080e-0x0;var _0x4e4c87=_0xc0ff[_0x38080e];return _0x4e4c87;};'use strict';var _=require('lodash');var md5=require(_0xfc0f('0x0'));var util=require('util');var Redis=require(_0xfc0f('0x1'));var config=require(_0xfc0f('0x2'));config[_0xfc0f('0x3')]=_[_0xfc0f('0x4')](config[_0xfc0f('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0xfc0f('0x5'))(new Redis(config['redis']));function WhatsappQueue(_0xab45b0){this['id']=_0xab45b0['id']||0x0;this['name']=_0xab45b0[_0xfc0f('0x6')]||'';this['timeout']=_0xab45b0[_0xfc0f('0x7')]||0xa;this[_0xfc0f('0x8')]=_0xab45b0['strategy']||_0xfc0f('0x9');this['Agents']=_0xab45b0[_0xfc0f('0xa')];this['mapAgentsId']={};this['waiting']=0x0;this[_0xfc0f('0x0')]='';this[_0xfc0f('0xb')]();this[_0xfc0f('0xc')]();}WhatsappQueue['prototype'][_0xfc0f('0xb')]=function(){var _0x41c790=this['mapAgentsId'][_0xfc0f('0xd')];this[_0xfc0f('0xe')]=_[_0xfc0f('0xf')](this[_0xfc0f('0xa')],'id');this[_0xfc0f('0xe')][_0xfc0f('0xd')]=_0x41c790;};WhatsappQueue['prototype']['updateRealtime']=function(){this[_0xfc0f('0x10')]=0x0;this[_0xfc0f('0x11')]=0x0;for(var _0x368e8d=0x0;_0x368e8d=0x0?this[_0xfc0f('0x15')]:0x0;var _0x2da53f={'id':this['id'],'available':this[_0xfc0f('0x15')],'loggedIn':this['loggedIn'],'name':this[_0xfc0f('0x6')],'paused':this[_0xfc0f('0x11')],'waiting':this[_0xfc0f('0x16')]};var _0x45711e=md5(JSON[_0xfc0f('0x17')](_0x2da53f));if(this[_0xfc0f('0x0')]!==_0x45711e){this[_0xfc0f('0x0')]=_0x45711e;io['to'](util['format'](_0xfc0f('0x18'),_0x2da53f[_0xfc0f('0x6')]))[_0xfc0f('0x19')](_0xfc0f('0x1a'),_0x2da53f);}};module[_0xfc0f('0x1b')]=WhatsappQueue; \ No newline at end of file +var _0x4bc2=['whatsappPause','available','stringify','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length'];(function(_0x463c69,_0x2168a6){var _0x1084bd=function(_0x417281){while(--_0x417281){_0x463c69['push'](_0x463c69['shift']());}};_0x1084bd(++_0x2168a6);}(_0x4bc2,0xff));var _0x24bc=function(_0x44a34b,_0x5171f1){_0x44a34b=_0x44a34b-0x0;var _0x421e7e=_0x4bc2[_0x44a34b];return _0x421e7e;};'use strict';var _=require(_0x24bc('0x0'));var md5=require(_0x24bc('0x1'));var util=require(_0x24bc('0x2'));var Redis=require(_0x24bc('0x3'));var config=require(_0x24bc('0x4'));config['redis']=_[_0x24bc('0x5')](config[_0x24bc('0x6')],{'host':_0x24bc('0x7'),'port':0x18eb});var io=require(_0x24bc('0x8'))(new Redis(config[_0x24bc('0x6')]));function WhatsappQueue(_0x5208c5){this['id']=_0x5208c5['id']||0x0;this[_0x24bc('0x9')]=_0x5208c5[_0x24bc('0x9')]||'';this['timeout']=_0x5208c5[_0x24bc('0xa')]||0xa;this[_0x24bc('0xb')]=_0x5208c5[_0x24bc('0xb')]||_0x24bc('0xc');this[_0x24bc('0xd')]=_0x5208c5[_0x24bc('0xd')];this[_0x24bc('0xe')]={};this[_0x24bc('0xf')]=0x0;this[_0x24bc('0x1')]='';this[_0x24bc('0x10')]();this[_0x24bc('0x11')]();}WhatsappQueue[_0x24bc('0x12')][_0x24bc('0x10')]=function(){var _0x8eaed6=this['mapAgentsId'][_0x24bc('0x13')];this[_0x24bc('0xe')]=_[_0x24bc('0x14')](this['Agents'],'id');this[_0x24bc('0xe')][_0x24bc('0x13')]=_0x8eaed6;};WhatsappQueue['prototype'][_0x24bc('0x11')]=function(){this[_0x24bc('0x15')]=0x0;this[_0x24bc('0x16')]=0x0;for(var _0x3d7993=0x0;_0x3d7993=0x0?this['available']:0x0;var _0x2076b2={'id':this['id'],'available':this[_0x24bc('0x19')],'loggedIn':this[_0x24bc('0x15')],'name':this[_0x24bc('0x9')],'paused':this[_0x24bc('0x16')],'waiting':this[_0x24bc('0xf')]};var _0x158894=md5(JSON[_0x24bc('0x1a')](_0x2076b2));if(this[_0x24bc('0x1')]!==_0x158894){this[_0x24bc('0x1')]=_0x158894;io['to'](util['format'](_0x24bc('0x1b'),_0x2076b2[_0x24bc('0x9')]))[_0x24bc('0x1c')](_0x24bc('0x1d'),_0x2076b2);}};module[_0x24bc('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 a7c417f..6faef5b 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file +var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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 c2f60eb..64ddf58 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 _0xef11=['addTags','AddTagsToChatInteraction','../client','update','Request','UpdateChatInteraction','updateChatInteraction'];(function(_0x84b030,_0x9b3e76){var _0x4acf1e=function(_0x3df2a6){while(--_0x3df2a6){_0x84b030['push'](_0x84b030['shift']());}};_0x4acf1e(++_0x9b3e76);}(_0xef11,0x105));var _0x1ef1=function(_0x38eb23,_0x196e8b){_0x38eb23=_0x38eb23-0x0;var _0x48506a=_0xef11[_0x38eb23];return _0x48506a;};'use strict';var client=require(_0x1ef1('0x0'));exports[_0x1ef1('0x1')]=function(_0x1b4a21,_0x302b96){return client[_0x1ef1('0x2')](_0x1ef1('0x3'),{'body':_0x302b96,'options':{'where':{'id':_0x1b4a21}},'log':_0x1ef1('0x4')});};exports[_0x1ef1('0x5')]=function(_0x3dd89f,_0x422c08){return client['Request'](_0x1ef1('0x6'),{'body':_0x422c08,'options':{'where':{'id':_0x3dd89f}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x6bc8=['../client','update','addTags','Request','AddTagsToChatInteraction','addTagsToChatInteraction'];(function(_0x179fb3,_0x7d2749){var _0x118482=function(_0x3d4e22){while(--_0x3d4e22){_0x179fb3['push'](_0x179fb3['shift']());}};_0x118482(++_0x7d2749);}(_0x6bc8,0xde));var _0x86bc=function(_0x1337ef,_0x3963f6){_0x1337ef=_0x1337ef-0x0;var _0x532a6d=_0x6bc8[_0x1337ef];return _0x532a6d;};'use strict';var client=require(_0x86bc('0x0'));exports[_0x86bc('0x1')]=function(_0x5a8683,_0x582063){return client['Request']('UpdateChatInteraction',{'body':_0x582063,'options':{'where':{'id':_0x5a8683}},'log':'updateChatInteraction'});};exports[_0x86bc('0x2')]=function(_0x5d0196,_0x39315a){return client[_0x86bc('0x3')](_0x86bc('0x4'),{'body':_0x39315a,'options':{'where':{'id':_0x5d0196}},'log':_0x86bc('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 8824cf8..bcb981f 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 _0xcaac=['CreateChatMessage','createChatMessage','../client','create','Request'];(function(_0x11ea3b,_0x3b4a75){var _0x52514e=function(_0x724793){while(--_0x724793){_0x11ea3b['push'](_0x11ea3b['shift']());}};_0x52514e(++_0x3b4a75);}(_0xcaac,0x188));var _0xccaa=function(_0x7c1e66,_0x5017c2){_0x7c1e66=_0x7c1e66-0x0;var _0x41bc1=_0xcaac[_0x7c1e66];return _0x41bc1;};'use strict';var client=require(_0xccaa('0x0'));exports[_0xccaa('0x1')]=function(_0x4e1f12){return client[_0xccaa('0x2')](_0xccaa('0x3'),{'body':_0x4e1f12,'log':_0xccaa('0x4')});}; \ No newline at end of file +var _0xcf0c=['createChatMessage','create','Request','CreateChatMessage'];(function(_0x59dfb4,_0x55fa56){var _0x5bec07=function(_0x4fca9d){while(--_0x4fca9d){_0x59dfb4['push'](_0x59dfb4['shift']());}};_0x5bec07(++_0x55fa56);}(_0xcf0c,0x1d1));var _0xccf0=function(_0x548627,_0x4ec392){_0x548627=_0x548627-0x0;var _0x844a84=_0xcf0c[_0x548627];return _0x844a84;};'use strict';var client=require('../client');exports[_0xccf0('0x0')]=function(_0x575eb7){return client[_0xccf0('0x1')](_0xccf0('0x2'),{'body':_0x575eb7,'log':_0xccf0('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 3d252ff..6462b77 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 _0x3663=['User','Agents','online','chatPause','../client','getChatQueues','Request','name','timeout'];(function(_0x55a777,_0x2c95f7){var _0x8ca6a1=function(_0x3cc973){while(--_0x3cc973){_0x55a777['push'](_0x55a777['shift']());}};_0x8ca6a1(++_0x2c95f7);}(_0x3663,0x1cf));var _0x3366=function(_0x18655b,_0xbf5752){_0x18655b=_0x18655b-0x0;var _0x56477e=_0x3663[_0x18655b];return _0x56477e;};'use strict';var client=require(_0x3366('0x0'));exports[_0x3366('0x1')]=function(){return function(){return client[_0x3366('0x2')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x3366('0x3'),_0x3366('0x4'),'strategy'],'include':[{'model':_0x3366('0x5'),'as':_0x3366('0x6'),'attributes':['id',_0x3366('0x3'),_0x3366('0x7'),_0x3366('0x8')]}]},'log':'getChatQueues'});};}; \ No newline at end of file +var _0xb3ea=['name','strategy','Agents','online','chatPause','../client','getChatQueues','Request'];(function(_0x3ae2d0,_0x51d098){var _0x25b291=function(_0x2445b1){while(--_0x2445b1){_0x3ae2d0['push'](_0x3ae2d0['shift']());}};_0x25b291(++_0x51d098);}(_0xb3ea,0x10d));var _0xab3e=function(_0x9abdef,_0x1800ab){_0x9abdef=_0x9abdef-0x0;var _0x3122cb=_0xb3ea[_0x9abdef];return _0x3122cb;};'use strict';var client=require(_0xab3e('0x0'));exports[_0xab3e('0x1')]=function(){return function(){return client[_0xab3e('0x2')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0xab3e('0x3'),'timeout',_0xab3e('0x4')],'include':[{'model':'User','as':_0xab3e('0x5'),'attributes':['id',_0xab3e('0x3'),_0xab3e('0x6'),_0xab3e('0x7')]}]},'log':_0xab3e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 2e15f62..720a125 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 _0x7333=['Request','UpdateChatQueueReport','../client','CreateChatQueueReport','update'];(function(_0x1147ab,_0x10e72b){var _0x55cb5a=function(_0x364bd6){while(--_0x364bd6){_0x1147ab['push'](_0x1147ab['shift']());}};_0x55cb5a(++_0x10e72b);}(_0x7333,0xfc));var _0x3733=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x7333[_0x432682];return _0x463d05;};'use strict';var client=require(_0x3733('0x0'));exports['create']=function(_0x42c214){return client['Request'](_0x3733('0x1'),{'body':_0x42c214,'log':_0x3733('0x1')});};exports[_0x3733('0x2')]=function(_0x4ad96b,_0x1bf202){return client[_0x3733('0x3')](_0x3733('0x4'),{'body':_0x1bf202,'options':{'where':{'uniqueid':_0x4ad96b},'order':[['id','DESC']],'limit':0x1},'log':_0x3733('0x4')});}; \ No newline at end of file +var _0xe812=['create','CreateChatQueueReport','update','Request','DESC','UpdateChatQueueReport'];(function(_0x23fdea,_0x11fbd6){var _0x22b2d9=function(_0x894694){while(--_0x894694){_0x23fdea['push'](_0x23fdea['shift']());}};_0x22b2d9(++_0x11fbd6);}(_0xe812,0x1f2));var _0x2e81=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xe812[_0x3ab51d];return _0x29a04e;};'use strict';var client=require('../client');exports[_0x2e81('0x0')]=function(_0x46bf6b){return client['Request']('CreateChatQueueReport',{'body':_0x46bf6b,'log':_0x2e81('0x1')});};exports[_0x2e81('0x2')]=function(_0x4fac31,_0x466f52){return client[_0x2e81('0x3')]('UpdateChatQueueReport',{'body':_0x466f52,'options':{'where':{'uniqueid':_0x4fac31},'order':[['id',_0x2e81('0x4')]],'limit':0x1},'log':_0x2e81('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index e89b45c..19658d4 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x54d79c,_0x54adf9){var _0xa2fc90=function(_0x3aab34){while(--_0x3aab34){_0x54d79c['push'](_0x54d79c['shift']());}};_0xa2fc90(++_0x54adf9);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file +var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x3a6efd,_0x2a5102){var _0x487b9a=function(_0x104f89){while(--_0x104f89){_0x3a6efd['push'](_0x3a6efd['shift']());}};_0x487b9a(++_0x2a5102);}(_0x7a54,0x106));var _0x47a5=function(_0x45aee2,_0x2693b9){_0x45aee2=_0x45aee2-0x0;var _0x2d3c32=_0x7a54[_0x45aee2];return _0x2d3c32;};'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 47126b5..1dda5a1 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 _0x4d26=['../client','create','Request','CreateFaxMessage','createFaxMessage'];(function(_0x15dddd,_0x5761c2){var _0x33ca34=function(_0x3e9ac7){while(--_0x3e9ac7){_0x15dddd['push'](_0x15dddd['shift']());}};_0x33ca34(++_0x5761c2);}(_0x4d26,0x15e));var _0x64d2=function(_0x3ec340,_0x41b1ec){_0x3ec340=_0x3ec340-0x0;var _0x3328f3=_0x4d26[_0x3ec340];return _0x3328f3;};'use strict';var client=require(_0x64d2('0x0'));exports[_0x64d2('0x1')]=function(_0x2571d9){return client[_0x64d2('0x2')](_0x64d2('0x3'),{'body':_0x2571d9,'log':_0x64d2('0x4')});}; \ No newline at end of file +var _0xb076=['create','Request','CreateFaxMessage','createFaxMessage'];(function(_0xf56414,_0xf524f){var _0x44dac9=function(_0x2c1156){while(--_0x2c1156){_0xf56414['push'](_0xf56414['shift']());}};_0x44dac9(++_0xf524f);}(_0xb076,0x118));var _0x6b07=function(_0x168fd3,_0x11fbbd){_0x168fd3=_0x168fd3-0x0;var _0x47f2b7=_0xb076[_0x168fd3];return _0x47f2b7;};'use strict';var client=require('../client');exports[_0x6b07('0x0')]=function(_0x3f0e94){return client[_0x6b07('0x1')](_0x6b07('0x2'),{'body':_0x3f0e94,'log':_0x6b07('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 7004565..598f395 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 _0x4d17=['timeout','strategy','Agents','online','../client','getFaxQueues','name'];(function(_0x284dba,_0x482e70){var _0x1880d7=function(_0x2f02f0){while(--_0x2f02f0){_0x284dba['push'](_0x284dba['shift']());}};_0x1880d7(++_0x482e70);}(_0x4d17,0x1ee));var _0x74d1=function(_0x152121,_0x120c53){_0x152121=_0x152121-0x0;var _0x592a85=_0x4d17[_0x152121];return _0x592a85;};'use strict';var client=require(_0x74d1('0x0'));exports[_0x74d1('0x1')]=function(){return function(){return client['Request']('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0x74d1('0x2'),_0x74d1('0x3'),_0x74d1('0x4')],'include':[{'model':'User','as':_0x74d1('0x5'),'attributes':['id',_0x74d1('0x2'),_0x74d1('0x6'),'faxPause']}]},'log':_0x74d1('0x1')});};}; \ No newline at end of file +var _0xd961=['../client','Request','GetFaxQueue','name','User','Agents','faxPause'];(function(_0x35e92e,_0x21581b){var _0x1205a8=function(_0x4325d8){while(--_0x4325d8){_0x35e92e['push'](_0x35e92e['shift']());}};_0x1205a8(++_0x21581b);}(_0xd961,0x1e3));var _0x1d96=function(_0x39782f,_0x4aa931){_0x39782f=_0x39782f-0x0;var _0x47768c=_0xd961[_0x39782f];return _0x47768c;};'use strict';var client=require(_0x1d96('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0x1d96('0x1')](_0x1d96('0x2'),{'options':{'raw':![],'attributes':['id',_0x1d96('0x3'),'timeout','strategy'],'include':[{'model':_0x1d96('0x4'),'as':_0x1d96('0x5'),'attributes':['id','name','online',_0x1d96('0x6')]}]},'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 840d7b3..06cc0e4 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 _0x79b2=['Request','UpdateFaxQueueReport','../client','CreateFaxQueueReport','update'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x79b2,0x142));var _0x279b=function(_0xfc77d1,_0x4433e7){_0xfc77d1=_0xfc77d1-0x0;var _0x2d5e38=_0x79b2[_0xfc77d1];return _0x2d5e38;};'use strict';var client=require(_0x279b('0x0'));exports['create']=function(_0x1d9726){return client['Request'](_0x279b('0x1'),{'body':_0x1d9726,'log':'CreateFaxQueueReport'});};exports[_0x279b('0x2')]=function(_0x4e9271,_0x12d4b8){return client[_0x279b('0x3')]('UpdateFaxQueueReport',{'body':_0x12d4b8,'options':{'where':{'uniqueid':_0x4e9271},'order':[['id','DESC']],'limit':0x1},'log':_0x279b('0x4')});}; \ No newline at end of file +var _0x9fd3=['create','Request','CreateFaxQueueReport','update','DESC','../client'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9fd3,0x71));var _0x39fd=function(_0x2e5363,_0x1b9df7){_0x2e5363=_0x2e5363-0x0;var _0xa52095=_0x9fd3[_0x2e5363];return _0xa52095;};'use strict';var client=require(_0x39fd('0x0'));exports[_0x39fd('0x1')]=function(_0x33fb5c){return client[_0x39fd('0x2')](_0x39fd('0x3'),{'body':_0x33fb5c,'log':_0x39fd('0x3')});};exports[_0x39fd('0x4')]=function(_0x50cbbf,_0x51b7b9){return client[_0x39fd('0x2')]('UpdateFaxQueueReport',{'body':_0x51b7b9,'options':{'where':{'uniqueid':_0x50cbbf},'order':[['id',_0x39fd('0x5')]],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 5ded73d..c5b7aeb 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 _0xfca1=['getIntervals','GetInterval','name','Interval','Intervals'];(function(_0x1cc060,_0x1afbdc){var _0x5c7e10=function(_0x15e8d6){while(--_0x15e8d6){_0x1cc060['push'](_0x1cc060['shift']());}};_0x5c7e10(++_0x1afbdc);}(_0xfca1,0xbf));var _0x1fca=function(_0x5c077d,_0x1f5c99){_0x5c077d=_0x5c077d-0x0;var _0x21c0f1=_0xfca1[_0x5c077d];return _0x21c0f1;};'use strict';var client=require('../client');exports['getIntervals']=function(){return function(){return client['Request'](_0x1fca('0x0'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x1fca('0x1')],'include':[{'model':_0x1fca('0x2'),'as':_0x1fca('0x3'),'attributes':['id',_0x1fca('0x1'),'interval']}]},'log':_0x1fca('0x4')});};}; \ No newline at end of file +var _0x4842=['getIntervals','Request','GetInterval','name','Interval','interval'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4842,0x67));var _0x2484=function(_0x4739ea,_0x1c1f75){_0x4739ea=_0x4739ea-0x0;var _0x3b2427=_0x4842[_0x4739ea];return _0x3b2427;};'use strict';var client=require('../client');exports['getIntervals']=function(){return function(){return client[_0x2484('0x0')](_0x2484('0x1'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x2484('0x2')],'include':[{'model':_0x2484('0x3'),'as':'Intervals','attributes':['id',_0x2484('0x2'),_0x2484('0x4')]}]},'log':_0x2484('0x5')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index b9af417..74250db 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 _0xfb11=['UpdateMailInteraction','addTags','Request','addTagsToChatInteraction','../client'];(function(_0x326389,_0x35a213){var _0x80b853=function(_0x5b3398){while(--_0x5b3398){_0x326389['push'](_0x326389['shift']());}};_0x80b853(++_0x35a213);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xfb11[_0x3635ce];return _0x97ecd0;};'use strict';var client=require(_0x1fb1('0x0'));exports['update']=function(_0x3418a7,_0x34e2d6){return client['Request'](_0x1fb1('0x1'),{'body':_0x34e2d6,'options':{'where':{'id':_0x3418a7}},'log':'updateMailInteraction'});};exports[_0x1fb1('0x2')]=function(_0x5a830e,_0x190f74){return client[_0x1fb1('0x3')]('AddTagsToMailInteraction',{'body':_0x190f74,'options':{'where':{'id':_0x5a830e}},'log':_0x1fb1('0x4')});}; \ No newline at end of file +var _0xadb5=['Request','UpdateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','update'];(function(_0x8bb086,_0x487530){var _0x3b6943=function(_0x343291){while(--_0x343291){_0x8bb086['push'](_0x8bb086['shift']());}};_0x3b6943(++_0x487530);}(_0xadb5,0xad));var _0x5adb=function(_0x209400,_0x45ae77){_0x209400=_0x209400-0x0;var _0x2d2ef0=_0xadb5[_0x209400];return _0x2d2ef0;};'use strict';var client=require('../client');exports[_0x5adb('0x0')]=function(_0x49fc17,_0x3d6340){return client[_0x5adb('0x1')](_0x5adb('0x2'),{'body':_0x3d6340,'options':{'where':{'id':_0x49fc17}},'log':'updateMailInteraction'});};exports[_0x5adb('0x3')]=function(_0x31457,_0x2e3ef4){return client['Request'](_0x5adb('0x4'),{'body':_0x2e3ef4,'options':{'where':{'id':_0x31457}},'log':_0x5adb('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 5ce3711..1388091 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 _0x607a=['create','Request','CreateMailMessage','createMailMessage','../client'];(function(_0x4486ee,_0x85b039){var _0x2713cb=function(_0x2b67f0){while(--_0x2b67f0){_0x4486ee['push'](_0x4486ee['shift']());}};_0x2713cb(++_0x85b039);}(_0x607a,0xa4));var _0xa607=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x607a[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xa607('0x0'));exports[_0xa607('0x1')]=function(_0x21b8e5){return client[_0xa607('0x2')](_0xa607('0x3'),{'body':_0x21b8e5,'log':_0xa607('0x4')});}; \ No newline at end of file +var _0x35e0=['createMailMessage','../client','create','Request','CreateMailMessage'];(function(_0x26bf69,_0x2a0bcf){var _0x41ab9a=function(_0x2916bc){while(--_0x2916bc){_0x26bf69['push'](_0x26bf69['shift']());}};_0x41ab9a(++_0x2a0bcf);}(_0x35e0,0x10f));var _0x035e=function(_0x53d8a0,_0x32137e){_0x53d8a0=_0x53d8a0-0x0;var _0x560209=_0x35e0[_0x53d8a0];return _0x560209;};'use strict';var client=require(_0x035e('0x0'));exports[_0x035e('0x1')]=function(_0x9cca2b){return client[_0x035e('0x2')](_0x035e('0x3'),{'body':_0x9cca2b,'log':_0x035e('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 976f9c4..89b287f 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 _0xf99d=['strategy','User','Agents','online','mailPause','getMailQueues','GetMailQueue','name','timeout'];(function(_0x2f6eed,_0x354474){var _0x647987=function(_0x5a7663){while(--_0x5a7663){_0x2f6eed['push'](_0x2f6eed['shift']());}};_0x647987(++_0x354474);}(_0xf99d,0x165));var _0xdf99=function(_0x4a7631,_0x2c85b9){_0x4a7631=_0x4a7631-0x0;var _0x1a5a6f=_0xf99d[_0x4a7631];return _0x1a5a6f;};'use strict';var client=require('../client');exports['getMailQueues']=function(){return function(){return client['Request'](_0xdf99('0x0'),{'options':{'raw':![],'attributes':['id',_0xdf99('0x1'),_0xdf99('0x2'),_0xdf99('0x3')],'include':[{'model':_0xdf99('0x4'),'as':_0xdf99('0x5'),'attributes':['id','name',_0xdf99('0x6'),_0xdf99('0x7')]}]},'log':_0xdf99('0x8')});};}; \ No newline at end of file +var _0x55aa=['timeout','User','Agents','online','../client','getMailQueues','Request','GetMailQueue','name'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x55aa,0x94));var _0xa55a=function(_0x48ff63,_0x10f18a){_0x48ff63=_0x48ff63-0x0;var _0x584924=_0x55aa[_0x48ff63];return _0x584924;};'use strict';var client=require(_0xa55a('0x0'));exports[_0xa55a('0x1')]=function(){return function(){return client[_0xa55a('0x2')](_0xa55a('0x3'),{'options':{'raw':![],'attributes':['id',_0xa55a('0x4'),_0xa55a('0x5'),'strategy'],'include':[{'model':_0xa55a('0x6'),'as':_0xa55a('0x7'),'attributes':['id','name',_0xa55a('0x8'),'mailPause']}]},'log':_0xa55a('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 13fadc6..8f17264 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 _0xadc4=['CreateMailQueueReport','DESC','UpdateMailQueueReport','Request'];(function(_0x36f291,_0x516b67){var _0x4b35e8=function(_0x15630f){while(--_0x15630f){_0x36f291['push'](_0x36f291['shift']());}};_0x4b35e8(++_0x516b67);}(_0xadc4,0xff));var _0x4adc=function(_0x9d5eee,_0x32a93f){_0x9d5eee=_0x9d5eee-0x0;var _0x4a8e31=_0xadc4[_0x9d5eee];return _0x4a8e31;};'use strict';var client=require('../client');exports['create']=function(_0xed23ce){return client[_0x4adc('0x0')](_0x4adc('0x1'),{'body':_0xed23ce,'log':_0x4adc('0x1')});};exports['update']=function(_0x317970,_0x5d6daf){return client[_0x4adc('0x0')]('UpdateMailQueueReport',{'body':_0x5d6daf,'options':{'where':{'uniqueid':_0x317970},'order':[['id',_0x4adc('0x2')]],'limit':0x1},'log':_0x4adc('0x3')});}; \ No newline at end of file +var _0x3c2d=['update','DESC','UpdateMailQueueReport','create','Request','CreateMailQueueReport'];(function(_0xad6bec,_0x3bd539){var _0x1201a7=function(_0xa8e557){while(--_0xa8e557){_0xad6bec['push'](_0xad6bec['shift']());}};_0x1201a7(++_0x3bd539);}(_0x3c2d,0x1b3));var _0xd3c2=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x3c2d[_0x59ee6f];return _0x4c0979;};'use strict';var client=require('../client');exports[_0xd3c2('0x0')]=function(_0x1d8fdf){return client[_0xd3c2('0x1')](_0xd3c2('0x2'),{'body':_0x1d8fdf,'log':_0xd3c2('0x2')});};exports[_0xd3c2('0x3')]=function(_0x5d4f6e,_0x3fc242){return client['Request']('UpdateMailQueueReport',{'body':_0x3fc242,'options':{'where':{'uniqueid':_0x5d4f6e},'order':[['id',_0xd3c2('0x4')]],'limit':0x1},'log':_0xd3c2('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index e74dda3..a95abde 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 _0xd25d=['AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','Request'];(function(_0x4b08d3,_0x176175){var _0x11a556=function(_0x3b94a9){while(--_0x3b94a9){_0x4b08d3['push'](_0x4b08d3['shift']());}};_0x11a556(++_0x176175);}(_0xd25d,0x7a));var _0xdd25=function(_0x6bb0a0,_0x468b8f){_0x6bb0a0=_0x6bb0a0-0x0;var _0x19dbc5=_0xd25d[_0x6bb0a0];return _0x19dbc5;};'use strict';var client=require(_0xdd25('0x0'));exports[_0xdd25('0x1')]=function(_0x5225d4,_0x45c517){return client['Request'](_0xdd25('0x2'),{'body':_0x45c517,'options':{'where':{'id':_0x5225d4}},'log':_0xdd25('0x3')});};exports[_0xdd25('0x4')]=function(_0x590ee0,_0x28a230){return client[_0xdd25('0x5')](_0xdd25('0x6'),{'body':_0x28a230,'options':{'where':{'id':_0x590ee0}},'log':_0xdd25('0x7')});}; \ No newline at end of file +var _0x4b75=['Request','AddTagsToOpenchannelInteraction','update','updateOpenchannelInteraction','addTags'];(function(_0x217f17,_0x2a2039){var _0x66991e=function(_0x484039){while(--_0x484039){_0x217f17['push'](_0x217f17['shift']());}};_0x66991e(++_0x2a2039);}(_0x4b75,0x1ab));var _0x54b7=function(_0x126ca8,_0x2fc203){_0x126ca8=_0x126ca8-0x0;var _0x5372a0=_0x4b75[_0x126ca8];return _0x5372a0;};'use strict';var client=require('../client');exports[_0x54b7('0x0')]=function(_0x4b1b7a,_0x399e8d){return client['Request']('UpdateOpenchannelInteraction',{'body':_0x399e8d,'options':{'where':{'id':_0x4b1b7a}},'log':_0x54b7('0x1')});};exports[_0x54b7('0x2')]=function(_0x4a1181,_0x362e8c){return client[_0x54b7('0x3')](_0x54b7('0x4'),{'body':_0x362e8c,'options':{'where':{'id':_0x4a1181}},'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 382f47a..1dbb9dc 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 _0x763b=['Request','CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x2223ff,_0x2af669){var _0x3e62de=function(_0x444f0b){while(--_0x444f0b){_0x2223ff['push'](_0x2223ff['shift']());}};_0x3e62de(++_0x2af669);}(_0x763b,0xd3));var _0xb763=function(_0x400720,_0x5539d3){_0x400720=_0x400720-0x0;var _0x2aa351=_0x763b[_0x400720];return _0x2aa351;};'use strict';var client=require(_0xb763('0x0'));exports['create']=function(_0x1290b8){return client[_0xb763('0x1')](_0xb763('0x2'),{'body':_0x1290b8,'log':_0xb763('0x3')});}; \ No newline at end of file +var _0x4cac=['Request','createOpenchannelMessage','create'];(function(_0xedba19,_0x4faa98){var _0x298a7f=function(_0x1dac1e){while(--_0x1dac1e){_0xedba19['push'](_0xedba19['shift']());}};_0x298a7f(++_0x4faa98);}(_0x4cac,0xe3));var _0xc4ca=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x4cac[_0x2dafbe];return _0x58a45a;};'use strict';var client=require('../client');exports[_0xc4ca('0x0')]=function(_0x45b1f6){return client[_0xc4ca('0x1')]('CreateOpenchannelMessage',{'body':_0x45b1f6,'log':_0xc4ca('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index ae3a64f..a37cf05 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 _0x3f48=['User','Agents','openchannelPause','getOpenchannelQueues','../client','Request','name','timeout','strategy'];(function(_0x22f85d,_0x195e6b){var _0x166805=function(_0x5090f5){while(--_0x5090f5){_0x22f85d['push'](_0x22f85d['shift']());}};_0x166805(++_0x195e6b);}(_0x3f48,0x1e1));var _0x83f4=function(_0x45b475,_0x30ec4a){_0x45b475=_0x45b475-0x0;var _0x2181d0=_0x3f48[_0x45b475];return _0x2181d0;};'use strict';var client=require(_0x83f4('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client[_0x83f4('0x1')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0x83f4('0x2'),_0x83f4('0x3'),_0x83f4('0x4')],'include':[{'model':_0x83f4('0x5'),'as':_0x83f4('0x6'),'attributes':['id',_0x83f4('0x2'),'online',_0x83f4('0x7')]}]},'log':_0x83f4('0x8')});};}; \ No newline at end of file +var _0x3408=['Request','GetOpenchannelQueue','User','Agents','name','getOpenchannelQueues','../client'];(function(_0x353d5e,_0x5ec150){var _0x13279a=function(_0x25ed4c){while(--_0x25ed4c){_0x353d5e['push'](_0x353d5e['shift']());}};_0x13279a(++_0x5ec150);}(_0x3408,0x15d));var _0x8340=function(_0x2275dc,_0x14bc66){_0x2275dc=_0x2275dc-0x0;var _0x687922=_0x3408[_0x2275dc];return _0x687922;};'use strict';var client=require(_0x8340('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client[_0x8340('0x1')](_0x8340('0x2'),{'options':{'raw':![],'attributes':['id','name','timeout','strategy'],'include':[{'model':_0x8340('0x3'),'as':_0x8340('0x4'),'attributes':['id',_0x8340('0x5'),'online','openchannelPause']}]},'log':_0x8340('0x6')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 5ba8bd5..3fd518f 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 _0x105d=['CreateOpenchannelQueueReport','update','DESC','UpdateOpenchannelQueueReport','../client','create','Request'];(function(_0x590832,_0x164378){var _0x2c783f=function(_0x3041bb){while(--_0x3041bb){_0x590832['push'](_0x590832['shift']());}};_0x2c783f(++_0x164378);}(_0x105d,0xf2));var _0xd105=function(_0x3b83ad,_0x51290d){_0x3b83ad=_0x3b83ad-0x0;var _0x20e6fd=_0x105d[_0x3b83ad];return _0x20e6fd;};'use strict';var client=require(_0xd105('0x0'));exports[_0xd105('0x1')]=function(_0x455435){return client[_0xd105('0x2')](_0xd105('0x3'),{'body':_0x455435,'log':_0xd105('0x3')});};exports[_0xd105('0x4')]=function(_0x2233da,_0x2be02f){return client[_0xd105('0x2')]('UpdateOpenchannelQueueReport',{'body':_0x2be02f,'options':{'where':{'uniqueid':_0x2233da},'order':[['id',_0xd105('0x5')]],'limit':0x1},'log':_0xd105('0x6')});}; \ No newline at end of file +var _0x74cf=['../client','create','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC'];(function(_0x25a4a1,_0x20ac34){var _0x522016=function(_0x5bd2c9){while(--_0x5bd2c9){_0x25a4a1['push'](_0x25a4a1['shift']());}};_0x522016(++_0x20ac34);}(_0x74cf,0x126));var _0xf74c=function(_0x576297,_0xf0286a){_0x576297=_0x576297-0x0;var _0x4e8e98=_0x74cf[_0x576297];return _0x4e8e98;};'use strict';var client=require(_0xf74c('0x0'));exports[_0xf74c('0x1')]=function(_0xbe2c33){return client[_0xf74c('0x2')](_0xf74c('0x3'),{'body':_0xbe2c33,'log':_0xf74c('0x3')});};exports[_0xf74c('0x4')]=function(_0x5774a8,_0x1bce1e){return client[_0xf74c('0x2')](_0xf74c('0x5'),{'body':_0x1bce1e,'options':{'where':{'uniqueid':_0x5774a8},'order':[['id',_0xf74c('0x6')]],'limit':0x1},'log':_0xf74c('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 8e96e58..9c3c058 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 _0x394e=['updateSmsInteraction','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update','Request','UpdateSmsInteraction'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x394e,0x88));var _0xe394=function(_0x4b634f,_0x4c0372){_0x4b634f=_0x4b634f-0x0;var _0x302e3c=_0x394e[_0x4b634f];return _0x302e3c;};'use strict';var client=require(_0xe394('0x0'));exports[_0xe394('0x1')]=function(_0x4981a5,_0x6a6330){return client[_0xe394('0x2')](_0xe394('0x3'),{'body':_0x6a6330,'options':{'where':{'id':_0x4981a5}},'log':_0xe394('0x4')});};exports['addTags']=function(_0x4269f4,_0x35c5de){return client[_0xe394('0x2')](_0xe394('0x5'),{'body':_0x35c5de,'options':{'where':{'id':_0x4269f4}},'log':_0xe394('0x6')});}; \ No newline at end of file +var _0x2d17=['Request','updateSmsInteraction','addTags','AddTagsToSmsInteraction','../client','update'];(function(_0xc7939b,_0xecf1fe){var _0x249cb2=function(_0x5a0661){while(--_0x5a0661){_0xc7939b['push'](_0xc7939b['shift']());}};_0x249cb2(++_0xecf1fe);}(_0x2d17,0x17e));var _0x72d1=function(_0x29f63e,_0x64b23f){_0x29f63e=_0x29f63e-0x0;var _0x3c5629=_0x2d17[_0x29f63e];return _0x3c5629;};'use strict';var client=require(_0x72d1('0x0'));exports[_0x72d1('0x1')]=function(_0x52078d,_0x12f23c){return client[_0x72d1('0x2')]('UpdateSmsInteraction',{'body':_0x12f23c,'options':{'where':{'id':_0x52078d}},'log':_0x72d1('0x3')});};exports[_0x72d1('0x4')]=function(_0x55b722,_0x1dd6d8){return client['Request'](_0x72d1('0x5'),{'body':_0x1dd6d8,'options':{'where':{'id':_0x55b722}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 85de8af..a7256aa 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 _0x6ac7=['CreateSmsMessage','../client','create','Request'];(function(_0x5ec27f,_0x4df940){var _0x39b4e0=function(_0x16649f){while(--_0x16649f){_0x5ec27f['push'](_0x5ec27f['shift']());}};_0x39b4e0(++_0x4df940);}(_0x6ac7,0xc9));var _0x76ac=function(_0x1f9423,_0x222d93){_0x1f9423=_0x1f9423-0x0;var _0x554dcd=_0x6ac7[_0x1f9423];return _0x554dcd;};'use strict';var client=require(_0x76ac('0x0'));exports[_0x76ac('0x1')]=function(_0xe9e048){return client[_0x76ac('0x2')](_0x76ac('0x3'),{'body':_0xe9e048,'log':'createSmsMessage'});}; \ No newline at end of file +var _0xa793=['../client','create','Request','CreateSmsMessage','createSmsMessage'];(function(_0x45b58d,_0x43e5ae){var _0x5061dd=function(_0xc0ab76){while(--_0xc0ab76){_0x45b58d['push'](_0x45b58d['shift']());}};_0x5061dd(++_0x43e5ae);}(_0xa793,0x18b));var _0x3a79=function(_0x8af54b,_0x280be5){_0x8af54b=_0x8af54b-0x0;var _0x27d8f0=_0xa793[_0x8af54b];return _0x27d8f0;};'use strict';var client=require(_0x3a79('0x0'));exports[_0x3a79('0x1')]=function(_0x139e9e){return client[_0x3a79('0x2')](_0x3a79('0x3'),{'body':_0x139e9e,'log':_0x3a79('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 0d81b8c..c5d5aae 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(_0x2a8af3,_0x7023c7){var _0x309121=function(_0x4437bc){while(--_0x4437bc){_0x2a8af3['push'](_0x2a8af3['shift']());}};_0x309121(++_0x7023c7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'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 _0x70e0=['User','Agents','online','../client','getSmsQueues','Request','timeout','strategy'];(function(_0x4b0bbb,_0x19f57c){var _0x5f489e=function(_0x1c3248){while(--_0x1c3248){_0x4b0bbb['push'](_0x4b0bbb['shift']());}};_0x5f489e(++_0x19f57c);}(_0x70e0,0x17b));var _0x070e=function(_0x3fbcae,_0xf363ca){_0x3fbcae=_0x3fbcae-0x0;var _0xc0ac10=_0x70e0[_0x3fbcae];return _0xc0ac10;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x070e('0x3'),_0x070e('0x4')],'include':[{'model':_0x070e('0x5'),'as':_0x070e('0x6'),'attributes':['id','name',_0x070e('0x7'),'smsPause']}]},'log':_0x070e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index cb33993..06e318c 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 _0x9c44=['Request','CreateSmsQueueReport','update','UpdateSmsQueueReport'];(function(_0x566c02,_0x2823b3){var _0x4d2ed8=function(_0x287820){while(--_0x287820){_0x566c02['push'](_0x566c02['shift']());}};_0x4d2ed8(++_0x2823b3);}(_0x9c44,0x178));var _0x49c4=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x9c44[_0x2064e5];return _0x21a233;};'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 +var _0x55ca=['../client','create','CreateSmsQueueReport','update','Request','UpdateSmsQueueReport','DESC'];(function(_0x29a7e1,_0x48c971){var _0x366d5a=function(_0x5daa){while(--_0x5daa){_0x29a7e1['push'](_0x29a7e1['shift']());}};_0x366d5a(++_0x48c971);}(_0x55ca,0x126));var _0xa55c=function(_0x27def7,_0x3f0835){_0x27def7=_0x27def7-0x0;var _0x581cbc=_0x55ca[_0x27def7];return _0x581cbc;};'use strict';var client=require(_0xa55c('0x0'));exports[_0xa55c('0x1')]=function(_0x4e78b4){return client['Request']('CreateSmsQueueReport',{'body':_0x4e78b4,'log':_0xa55c('0x2')});};exports[_0xa55c('0x3')]=function(_0x5dc716,_0x3b478a){return client[_0xa55c('0x4')](_0xa55c('0x5'),{'body':_0x3b478a,'options':{'where':{'uniqueid':_0x5dc716},'order':[['id',_0xa55c('0x6')]],'limit':0x1},'log':_0xa55c('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 987b3f7..ad83dc5 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(_0x5cffe6,_0x10c615){var _0x2141dc=function(_0x41acba){while(--_0x41acba){_0x5cffe6['push'](_0x5cffe6['shift']());}};_0x2141dc(++_0x10c615);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'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(_0x4326f6,_0x37ee58){var _0x3352ed=function(_0x2e68ea){while(--_0x2e68ea){_0x4326f6['push'](_0x4326f6['shift']());}};_0x3352ed(++_0x37ee58);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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 992de8e..e750a65 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 _0x53ec=['../client','update','Request','UpdateWhatsappInteraction','addTags','addTagsToWhatsappInteraction'];(function(_0x833738,_0x3463a1){var _0x1623d6=function(_0x3c91b8){while(--_0x3c91b8){_0x833738['push'](_0x833738['shift']());}};_0x1623d6(++_0x3463a1);}(_0x53ec,0x192));var _0xc53e=function(_0x462fe4,_0x394d3e){_0x462fe4=_0x462fe4-0x0;var _0x82b23a=_0x53ec[_0x462fe4];return _0x82b23a;};'use strict';var client=require(_0xc53e('0x0'));exports[_0xc53e('0x1')]=function(_0x2d5f51,_0x476d3a){return client[_0xc53e('0x2')](_0xc53e('0x3'),{'body':_0x476d3a,'options':{'where':{'id':_0x2d5f51}},'log':'updateWhatsappInteraction'});};exports[_0xc53e('0x4')]=function(_0x4e954a,_0x2b90f6){return client[_0xc53e('0x2')]('AddTagsToWhatsappInteraction',{'body':_0x2b90f6,'options':{'where':{'id':_0x4e954a}},'log':_0xc53e('0x5')});}; \ No newline at end of file +var _0x4c60=['addTagsToWhatsappInteraction','../client','update','UpdateWhatsappInteraction','Request','AddTagsToWhatsappInteraction'];(function(_0x289150,_0x3aff1e){var _0x521828=function(_0x38eb5d){while(--_0x38eb5d){_0x289150['push'](_0x289150['shift']());}};_0x521828(++_0x3aff1e);}(_0x4c60,0xc1));var _0x04c6=function(_0x30dd74,_0x365f1a){_0x30dd74=_0x30dd74-0x0;var _0x1e2b12=_0x4c60[_0x30dd74];return _0x1e2b12;};'use strict';var client=require(_0x04c6('0x0'));exports[_0x04c6('0x1')]=function(_0x1d5492,_0x782829){return client['Request'](_0x04c6('0x2'),{'body':_0x782829,'options':{'where':{'id':_0x1d5492}},'log':'updateWhatsappInteraction'});};exports['addTags']=function(_0x4ad4f1,_0x53ca7a){return client[_0x04c6('0x3')](_0x04c6('0x4'),{'body':_0x53ca7a,'options':{'where':{'id':_0x4ad4f1}},'log':_0x04c6('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 3eb7cf7..c598d08 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 _0xdf26=['CreateWhatsappMessage','../client','create'];(function(_0x243217,_0x522951){var _0x478029=function(_0x18d053){while(--_0x18d053){_0x243217['push'](_0x243217['shift']());}};_0x478029(++_0x522951);}(_0xdf26,0xe2));var _0x6df2=function(_0x290694,_0x281935){_0x290694=_0x290694-0x0;var _0x5a0f2e=_0xdf26[_0x290694];return _0x5a0f2e;};'use strict';var client=require(_0x6df2('0x0'));exports[_0x6df2('0x1')]=function(_0xa1ede3){return client['Request'](_0x6df2('0x2'),{'body':_0xa1ede3,'log':'createWhatsappMessage'});}; \ No newline at end of file +var _0xe4d4=['Request','CreateWhatsappMessage','createWhatsappMessage','../client','create'];(function(_0x3227c1,_0x4318c5){var _0x31fd48=function(_0x5c5850){while(--_0x5c5850){_0x3227c1['push'](_0x3227c1['shift']());}};_0x31fd48(++_0x4318c5);}(_0xe4d4,0x80));var _0x4e4d=function(_0x263f7a,_0xed2f86){_0x263f7a=_0x263f7a-0x0;var _0x50e7b9=_0xe4d4[_0x263f7a];return _0x50e7b9;};'use strict';var client=require(_0x4e4d('0x0'));exports[_0x4e4d('0x1')]=function(_0xab5ff2){return client[_0x4e4d('0x2')](_0x4e4d('0x3'),{'body':_0xab5ff2,'log':_0x4e4d('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 3e00ac2..511c70c 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 _0x9cd5=['whatsappPause','../client','getWhatsappQueues','strategy','User','Agents','name','online'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x9cd5,0x189));var _0x59cd=function(_0x288bb0,_0x10aeaf){_0x288bb0=_0x288bb0-0x0;var _0x329a49=_0x9cd5[_0x288bb0];return _0x329a49;};'use strict';var client=require(_0x59cd('0x0'));exports[_0x59cd('0x1')]=function(){return function(){return client['Request']('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id','name','timeout',_0x59cd('0x2')],'include':[{'model':_0x59cd('0x3'),'as':_0x59cd('0x4'),'attributes':['id',_0x59cd('0x5'),_0x59cd('0x6'),_0x59cd('0x7')]}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file +var _0x4f16=['name','strategy','Agents','whatsappPause','../client','getWhatsappQueues','Request','GetWhatsappQueue'];(function(_0x45319d,_0x5a0653){var _0x20f076=function(_0x3da82c){while(--_0x3da82c){_0x45319d['push'](_0x45319d['shift']());}};_0x20f076(++_0x5a0653);}(_0x4f16,0x194));var _0x64f1=function(_0x4e322c,_0x4c95b3){_0x4e322c=_0x4e322c-0x0;var _0x358af7=_0x4f16[_0x4e322c];return _0x358af7;};'use strict';var client=require(_0x64f1('0x0'));exports[_0x64f1('0x1')]=function(){return function(){return client[_0x64f1('0x2')](_0x64f1('0x3'),{'options':{'raw':![],'attributes':['id',_0x64f1('0x4'),'timeout',_0x64f1('0x5')],'include':[{'model':'User','as':_0x64f1('0x6'),'attributes':['id',_0x64f1('0x4'),'online',_0x64f1('0x7')]}]},'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 f312c7a..0c4f2ce 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 _0x2569=['CreateWhatsappQueueReport','update','DESC','../client','create','Request'];(function(_0x1afb74,_0x59c814){var _0xc157e9=function(_0xa0c7bb){while(--_0xa0c7bb){_0x1afb74['push'](_0x1afb74['shift']());}};_0xc157e9(++_0x59c814);}(_0x2569,0x1dd));var _0x9256=function(_0x3207a4,_0x1b9024){_0x3207a4=_0x3207a4-0x0;var _0x5c8dff=_0x2569[_0x3207a4];return _0x5c8dff;};'use strict';var client=require(_0x9256('0x0'));exports[_0x9256('0x1')]=function(_0x596efa){return client[_0x9256('0x2')](_0x9256('0x3'),{'body':_0x596efa,'log':_0x9256('0x3')});};exports[_0x9256('0x4')]=function(_0x103959,_0x2b6819){return client[_0x9256('0x2')]('UpdateWhatsappQueueReport',{'body':_0x2b6819,'options':{'where':{'uniqueid':_0x103959},'order':[['id',_0x9256('0x5')]],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ No newline at end of file +var _0x5478=['create','Request','CreateWhatsappQueueReport','UpdateWhatsappQueueReport','DESC','../client'];(function(_0x35de8e,_0x23bbf5){var _0x597ed7=function(_0xb831a8){while(--_0xb831a8){_0x35de8e['push'](_0x35de8e['shift']());}};_0x597ed7(++_0x23bbf5);}(_0x5478,0x83));var _0x8547=function(_0x4fc80b,_0xfe1b3d){_0x4fc80b=_0x4fc80b-0x0;var _0x119dba=_0x5478[_0x4fc80b];return _0x119dba;};'use strict';var client=require(_0x8547('0x0'));exports[_0x8547('0x1')]=function(_0x804662){return client[_0x8547('0x2')](_0x8547('0x3'),{'body':_0x804662,'log':'CreateWhatsappQueueReport'});};exports['update']=function(_0x1620ce,_0x237c65){return client[_0x8547('0x2')](_0x8547('0x4'),{'body':_0x237c65,'options':{'where':{'uniqueid':_0x1620ce},'order':[['id',_0x8547('0x5')]],'limit':0x1},'log':_0x8547('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index 8a72c42..d5c12c1 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 _0x47cb=['START:%s','rules','end','close','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][QUEUE]\x20%s','stack','validate','lodash','seq-queue','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','toLowerCase','length','error','[%s][AGENT]\x20%s','map','message','join','stop','find','agents','name','timeout','createQueue','channel'];(function(_0x4b0f34,_0x572251){var _0x13b510=function(_0x49edd4){while(--_0x49edd4){_0x4b0f34['push'](_0x4b0f34['shift']());}};_0x13b510(++_0x572251);}(_0x47cb,0xd6));var _0xb47c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x47cb[_0x3dd15e];return _0x231fd0;};'use strict';var schema=require(_0xb47c('0x0'));var _=require(_0xb47c('0x1'));var util=require('util');var seqqueue=require(_0xb47c('0x2'));var logger=require('../../../../config/logger')('routing');var strategy=require(_0xb47c('0x3'));var queue=schema({'name':{'type':_0xb47c('0x4'),'required':!![],'message':_0xb47c('0x5')},'timeout':{'type':'number','message':_0xb47c('0x6')}});function writeLog(_0x1e0acb,_0x1337f2,_0x739d13){return logger[_0xb47c('0x7')](util[_0xb47c('0x8')](_0xb47c('0x9'),_0x1e0acb,_0x1337f2['name'],_0x739d13));}function handleFindAgent(_0x19fdb6){return function(_0x221e27){return _0x221e27['name'][_0xb47c('0xa')]()===_0x19fdb6[_0xb47c('0xa')]();};}exports['consequence']=function(_0x30d8be,_0x2839d7,_0x1efb41,_0x16ec78){return function(_0x5b9fab){try{var _0x27ca39={'name':_0x2839d7[0x0],'timeout':_0x2839d7[0x1]};var _0x3f5d61=queue[_0xb47c('0x0')](_0x27ca39,{'typecast':!![]});if(_0x3f5d61[_0xb47c('0xb')]){logger[_0xb47c('0xc')](_0xb47c('0xd'),_0x30d8be,_[_0xb47c('0xe')](_0x3f5d61,_0xb47c('0xf'))[_0xb47c('0x10')](',\x20'));_0x5b9fab[_0xb47c('0x11')]();}else{var _0x2a7a0c=_[_0xb47c('0x12')](_0x1efb41[_0xb47c('0x13')],handleFindAgent(_0x27ca39[_0xb47c('0x14')]));if(_0x2a7a0c){var _0x4e01a5=(_0x27ca39[_0xb47c('0x15')]||0xa)*0x3e8;var _0x4f1bb8,_0x35a5d5;var _0x248dc=seqqueue[_0xb47c('0x16')](_0x4e01a5);_0x248dc['id']=_0x30d8be;_0x248dc['atimeout']=_0x4e01a5;_0x248dc['channel']=_0x16ec78[_0xb47c('0x17')];writeLog(_0x30d8be,_0x2a7a0c,util[_0xb47c('0x8')](_0xb47c('0x18'),_0x4e01a5));_0x1efb41[_0xb47c('0x19')][_0x30d8be]['on'](_0xb47c('0x1a'),function(){logger[_0xb47c('0x7')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x30d8be);clearTimeout(_0x35a5d5);_0x35a5d5=undefined;_0x248dc[_0xb47c('0x1b')]();if(_0x1efb41['rules'][_0x30d8be]){delete _0x1efb41[_0xb47c('0x19')][_0x30d8be];}_0x5b9fab[_0xb47c('0x11')]();});_0x1efb41['rules'][_0x30d8be]['on'](_0xb47c('0x1c'),function(){if(_0x1efb41['rules'][_0x30d8be]){delete _0x1efb41[_0xb47c('0x19')][_0x30d8be];}});_0x35a5d5=setTimeout(function(){logger[_0xb47c('0x7')](_0xb47c('0x1d'),_0x30d8be);clearTimeout(_0x35a5d5);_0x248dc[_0xb47c('0x1b')]();_0x5b9fab[_0xb47c('0x1e')]();},_0x4e01a5);strategy[_0xb47c('0x1f')](_0x248dc,_0x2a7a0c,_0x1efb41,_0x16ec78);}else{logger[_0xb47c('0xc')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x30d8be,_0x27ca39['name']);_0x5b9fab[_0xb47c('0x11')]();}}}catch(_0x52cbb8){console['log'](_0x52cbb8);logger[_0xb47c('0xc')](_0xb47c('0x20'),_0x30d8be,_0x52cbb8[_0xb47c('0x21')]);_0x5b9fab[_0xb47c('0x11')]();}};}; \ No newline at end of file +var _0xb706=['find','agents','timeout','createQueue','channel','rules','end','info','close','[%s][AGENT]\x20ROUTING\x20END','next','agent','error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','validate','util','seq-queue','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','format','name','toLowerCase','consequence','length','[%s][AGENT]\x20%s','map','message','join','stop'];(function(_0x168447,_0x3825d0){var _0x18ee99=function(_0xdb1c72){while(--_0xdb1c72){_0x168447['push'](_0x168447['shift']());}};_0x18ee99(++_0x3825d0);}(_0xb706,0x1eb));var _0x6b70=function(_0x8e1e2e,_0x2e8df4){_0x8e1e2e=_0x8e1e2e-0x0;var _0x26c6b6=_0xb706[_0x8e1e2e];return _0x26c6b6;};'use strict';var schema=require(_0x6b70('0x0'));var _=require('lodash');var util=require(_0x6b70('0x1'));var seqqueue=require(_0x6b70('0x2'));var logger=require(_0x6b70('0x3'))(_0x6b70('0x4'));var strategy=require(_0x6b70('0x5'));var queue=schema({'name':{'type':_0x6b70('0x6'),'required':!![],'message':_0x6b70('0x7')},'timeout':{'type':_0x6b70('0x8'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x958686,_0x105b00,_0x11a1b5){return logger['info'](util[_0x6b70('0x9')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x958686,_0x105b00[_0x6b70('0xa')],_0x11a1b5));}function handleFindAgent(_0xcf7b1e){return function(_0x45d9a5){return _0x45d9a5['name']['toLowerCase']()===_0xcf7b1e[_0x6b70('0xb')]();};}exports[_0x6b70('0xc')]=function(_0x47debf,_0x536c77,_0x4818ff,_0x79eefe){return function(_0x2c2e3e){try{var _0x583225={'name':_0x536c77[0x0],'timeout':_0x536c77[0x1]};var _0x11c13a=queue[_0x6b70('0x0')](_0x583225,{'typecast':!![]});if(_0x11c13a[_0x6b70('0xd')]){logger['error'](_0x6b70('0xe'),_0x47debf,_[_0x6b70('0xf')](_0x11c13a,_0x6b70('0x10'))[_0x6b70('0x11')](',\x20'));_0x2c2e3e[_0x6b70('0x12')]();}else{var _0x3ec24c=_[_0x6b70('0x13')](_0x4818ff[_0x6b70('0x14')],handleFindAgent(_0x583225[_0x6b70('0xa')]));if(_0x3ec24c){var _0x1ae79d=(_0x583225[_0x6b70('0x15')]||0xa)*0x3e8;var _0x5e2f4e,_0x2886cb;var _0x522edd=seqqueue[_0x6b70('0x16')](_0x1ae79d);_0x522edd['id']=_0x47debf;_0x522edd['atimeout']=_0x1ae79d;_0x522edd[_0x6b70('0x17')]=_0x79eefe['channel'];writeLog(_0x47debf,_0x3ec24c,util['format']('START:%s',_0x1ae79d));_0x4818ff[_0x6b70('0x18')][_0x47debf]['on'](_0x6b70('0x19'),function(){logger[_0x6b70('0x1a')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x47debf);clearTimeout(_0x2886cb);_0x2886cb=undefined;_0x522edd[_0x6b70('0x1b')]();if(_0x4818ff[_0x6b70('0x18')][_0x47debf]){delete _0x4818ff[_0x6b70('0x18')][_0x47debf];}_0x2c2e3e['stop']();});_0x4818ff[_0x6b70('0x18')][_0x47debf]['on']('complete',function(){if(_0x4818ff[_0x6b70('0x18')][_0x47debf]){delete _0x4818ff[_0x6b70('0x18')][_0x47debf];}});_0x2886cb=setTimeout(function(){logger['info'](_0x6b70('0x1c'),_0x47debf);clearTimeout(_0x2886cb);_0x522edd[_0x6b70('0x1b')]();_0x2c2e3e[_0x6b70('0x1d')]();},_0x1ae79d);strategy[_0x6b70('0x1e')](_0x522edd,_0x3ec24c,_0x4818ff,_0x79eefe);}else{logger[_0x6b70('0x1f')](_0x6b70('0x20'),_0x47debf,_0x583225[_0x6b70('0xa')]);_0x2c2e3e['stop']();}}}catch(_0x56475e){console['log'](_0x56475e);logger['error'](_0x6b70('0x21'),_0x47debf,_0x56475e['stack']);_0x2c2e3e[_0x6b70('0x12')]();}};}; \ 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 ad025f4..3378445 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 _0x3b79=['next','providerName','amazonlex','providerResponse','stringify','create','dialogState','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','interaction','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','account','AccountId','upperFirst','InteractionId','isEmpty','getMustacheRender','then','[%s][AMAZONLEX]\x20%s','body','catch','error','finally','stop','LexRuntime','$LATEST','toString','postText','message'];(function(_0x15ca7d,_0x26fc7b){var _0x4ea4b2=function(_0x5d18cb){while(--_0x5d18cb){_0x15ca7d['push'](_0x15ca7d['shift']());}};_0x4ea4b2(++_0x26fc7b);}(_0x3b79,0x165));var _0x93b7=function(_0x5c14ff,_0x50e1d8){_0x5c14ff=_0x5c14ff-0x0;var _0xebc33e=_0x3b79[_0x5c14ff];return _0xebc33e;};'use strict';var _=require(_0x93b7('0x0'));var moment=require(_0x93b7('0x1'));var AWS=require(_0x93b7('0x2'));var utils=require(_0x93b7('0x3'));var logger=require(_0x93b7('0x4'))(_0x93b7('0x5'));var rpc={'chatMessage':require(_0x93b7('0x6')),'openchannelMessage':require(_0x93b7('0x7')),'mailMessage':require(_0x93b7('0x8')),'smsMessage':require(_0x93b7('0x9')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x93b7('0xa'))};exports[_0x93b7('0xb')]=function(_0x593628,_0x49b2eb){return function(_0x37681c){try{if(!_['isNil'](this[_0x93b7('0xc')][_0x93b7('0xd')])){logger[_0x93b7('0xe')]('[%s][AMAZONLEX]\x20%s',_0x593628,_0x93b7('0xf'));return _0x37681c['next']();}var _0x230421={'ContactId':this[_0x93b7('0x10')]['id'],'sentAt':moment()[_0x93b7('0x11')](_0x93b7('0x12')),'direction':_0x93b7('0x13')};if(this[_0x93b7('0x14')]===_0x93b7('0x15')||this[_0x93b7('0x14')]===_0x93b7('0x16')){_0x230421[_0x93b7('0x17')]=this[_0x93b7('0xc')]['phone'];}var _0x3a28b1=this[_0x93b7('0x14')];if(_0x3a28b1===_0x93b7('0x18')){_0x230421['ChatWebsiteId']=this[_0x93b7('0x19')]['id'];}else{_0x230421[_['upperFirst'](_0x3a28b1)+_0x93b7('0x1a')]=this[_0x93b7('0x19')]['id'];}_0x230421[_[_0x93b7('0x1b')](_0x3a28b1)+_0x93b7('0x1c')]=this[_0x93b7('0xc')]['id'];if(this[_0x93b7('0xc')]['created']){var _0x4e4787=_0x49b2eb[0x4];if(!_[_0x93b7('0x1d')](_0x4e4787)){_0x230421['body']=utils[_0x93b7('0x1e')](_0x4e4787,this);return rpc[_0x3a28b1+'Message']['create'](_0x230421)[_0x93b7('0x1f')](function(_0x3cc2ba){logger[_0x93b7('0xe')](_0x93b7('0x20'),_0x593628,_0x230421[_0x93b7('0x21')]);})[_0x93b7('0x22')](function(_0xfe0d8b){logger[_0x93b7('0x23')]('[%s][AMAZONLEX]\x20%s',_0x593628,JSON['stringify'](_0xfe0d8b));})[_0x93b7('0x24')](function(){logger[_0x93b7('0xe')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x593628);_0x37681c[_0x93b7('0x25')]();});}else{logger[_0x93b7('0xe')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x593628);_0x37681c[_0x93b7('0x25')]();}}else{var _0x2dbe90=this;var _0x36d83f=new AWS[(_0x93b7('0x26'))]({'accessKeyId':_0x49b2eb[0x0],'secretAccessKey':_0x49b2eb[0x1],'region':_0x49b2eb[0x2]});var _0x385cef={'botAlias':_0x93b7('0x27'),'botName':_0x49b2eb[0x3],'inputText':this['message'][_0x93b7('0x21')],'userId':this[_0x93b7('0x14')]+':'+this['interaction']['id'][_0x93b7('0x28')]()};_0x36d83f[_0x93b7('0x29')](_0x385cef,function(_0xc49c22,_0x23a1d0){if(_0xc49c22){logger[_0x93b7('0x23')]('[%s][AMAZONLEX]\x20%s',_0x593628,_0xc49c22[_0x93b7('0x2a')]);_0x37681c[_0x93b7('0x2b')]();}else if(_0x23a1d0&&_0x23a1d0[_0x93b7('0x2a')]){_0x2dbe90['body']['amazonlex']=_0x23a1d0;_0x230421[_0x93b7('0x21')]=_0x23a1d0[_0x93b7('0x2a')];_0x230421[_0x93b7('0x2c')]=_0x93b7('0x2d');_0x230421[_0x93b7('0x2e')]=JSON[_0x93b7('0x2f')](_0x23a1d0);return rpc[_0x3a28b1+'Message'][_0x93b7('0x30')](_0x230421)['then'](function(_0x745536){logger[_0x93b7('0xe')](_0x93b7('0x20'),_0x593628,_0x230421[_0x93b7('0x21')]);if(_0x23a1d0[_0x93b7('0x31')]=='Failed'){_0x37681c[_0x93b7('0x2b')]();}else{_0x37681c[_0x93b7('0x25')]();}})[_0x93b7('0x22')](function(_0x56faff){logger[_0x93b7('0x23')](_0x93b7('0x20'),_0x593628,JSON[_0x93b7('0x2f')](_0x56faff));_0x37681c['next']();});}else{_0x37681c[_0x93b7('0x2b')]();}});}}catch(_0x6b2e3c){logger[_0x93b7('0x23')]('[%s][AMAZONLEX]\x20%s',_0x593628,JSON[_0x93b7('0x2f')](_0x6b2e3c));_0x37681c[_0x93b7('0x25')]();}};}; \ No newline at end of file +var _0x3ef3=['../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','consequence','isNil','interaction','UserId','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','out','sms','whatsapp','phone','channel','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','created','isEmpty','body','getMustacheRender','create','then','info','catch','error','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','amazonlex','providerName','stringify','Message','dialogState','Failed','lodash','moment','aws-sdk','./utils'];(function(_0x31108e,_0xca45dd){var _0x518147=function(_0x1a5fbf){while(--_0x1a5fbf){_0x31108e['push'](_0x31108e['shift']());}};_0x518147(++_0xca45dd);}(_0x3ef3,0x1ac));var _0x33ef=function(_0x141fa1,_0x530636){_0x141fa1=_0x141fa1-0x0;var _0x1200ed=_0x3ef3[_0x141fa1];return _0x1200ed;};'use strict';var _=require(_0x33ef('0x0'));var moment=require(_0x33ef('0x1'));var AWS=require(_0x33ef('0x2'));var utils=require(_0x33ef('0x3'));var logger=require(_0x33ef('0x4'))(_0x33ef('0x5'));var rpc={'chatMessage':require(_0x33ef('0x6')),'openchannelMessage':require(_0x33ef('0x7')),'mailMessage':require(_0x33ef('0x8')),'smsMessage':require(_0x33ef('0x9')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x33ef('0xa')]=function(_0x593e58,_0x3c600c){return function(_0x12c9a1){try{if(!_[_0x33ef('0xb')](this[_0x33ef('0xc')][_0x33ef('0xd')])){logger['info'](_0x33ef('0xe'),_0x593e58,_0x33ef('0xf'));return _0x12c9a1[_0x33ef('0x10')]();}var _0x31ebe6={'ContactId':this[_0x33ef('0x11')]['id'],'sentAt':moment()[_0x33ef('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x33ef('0x13')};if(this['channel']===_0x33ef('0x14')||this['channel']===_0x33ef('0x15')){_0x31ebe6[_0x33ef('0x16')]=this['interaction']['phone'];}var _0x1197f4=this[_0x33ef('0x17')];if(_0x1197f4===_0x33ef('0x18')){_0x31ebe6[_0x33ef('0x19')]=this['account']['id'];}else{_0x31ebe6[_[_0x33ef('0x1a')](_0x1197f4)+_0x33ef('0x1b')]=this[_0x33ef('0x1c')]['id'];}_0x31ebe6[_[_0x33ef('0x1a')](_0x1197f4)+_0x33ef('0x1d')]=this[_0x33ef('0xc')]['id'];if(this[_0x33ef('0xc')][_0x33ef('0x1e')]){var _0x333eff=_0x3c600c[0x4];if(!_[_0x33ef('0x1f')](_0x333eff)){_0x31ebe6[_0x33ef('0x20')]=utils[_0x33ef('0x21')](_0x333eff,this);return rpc[_0x1197f4+'Message'][_0x33ef('0x22')](_0x31ebe6)[_0x33ef('0x23')](function(_0x33408c){logger[_0x33ef('0x24')](_0x33ef('0xe'),_0x593e58,_0x31ebe6[_0x33ef('0x20')]);})[_0x33ef('0x25')](function(_0x43f0d3){logger[_0x33ef('0x26')]('[%s][AMAZONLEX]\x20%s',_0x593e58,JSON['stringify'](_0x43f0d3));})[_0x33ef('0x27')](function(){logger[_0x33ef('0x24')](_0x33ef('0x28'),_0x593e58);_0x12c9a1[_0x33ef('0x29')]();});}else{logger[_0x33ef('0x24')](_0x33ef('0x2a'),_0x593e58);_0x12c9a1[_0x33ef('0x29')]();}}else{var _0x2dc607=this;var _0x1b3f4d=new AWS[(_0x33ef('0x2b'))]({'accessKeyId':_0x3c600c[0x0],'secretAccessKey':_0x3c600c[0x1],'region':_0x3c600c[0x2]});var _0x16cb5f={'botAlias':_0x33ef('0x2c'),'botName':_0x3c600c[0x3],'inputText':this[_0x33ef('0x2d')][_0x33ef('0x20')],'userId':this[_0x33ef('0x17')]+':'+this[_0x33ef('0xc')]['id'][_0x33ef('0x2e')]()};_0x1b3f4d[_0x33ef('0x2f')](_0x16cb5f,function(_0x33cbe8,_0x3951b5){if(_0x33cbe8){logger[_0x33ef('0x26')](_0x33ef('0xe'),_0x593e58,_0x33cbe8['message']);_0x12c9a1[_0x33ef('0x10')]();}else if(_0x3951b5&&_0x3951b5[_0x33ef('0x2d')]){_0x2dc607[_0x33ef('0x20')][_0x33ef('0x30')]=_0x3951b5;_0x31ebe6[_0x33ef('0x20')]=_0x3951b5[_0x33ef('0x2d')];_0x31ebe6[_0x33ef('0x31')]='amazonlex';_0x31ebe6['providerResponse']=JSON[_0x33ef('0x32')](_0x3951b5);return rpc[_0x1197f4+_0x33ef('0x33')][_0x33ef('0x22')](_0x31ebe6)[_0x33ef('0x23')](function(_0x12dd0f){logger[_0x33ef('0x24')](_0x33ef('0xe'),_0x593e58,_0x31ebe6[_0x33ef('0x20')]);if(_0x3951b5[_0x33ef('0x34')]==_0x33ef('0x35')){_0x12c9a1['next']();}else{_0x12c9a1[_0x33ef('0x29')]();}})['catch'](function(_0x51205a){logger[_0x33ef('0x26')]('[%s][AMAZONLEX]\x20%s',_0x593e58,JSON[_0x33ef('0x32')](_0x51205a));_0x12c9a1['next']();});}else{_0x12c9a1['next']();}});}}catch(_0x218857){logger[_0x33ef('0x26')](_0x33ef('0xe'),_0x593e58,JSON['stringify'](_0x218857));_0x12c9a1[_0x33ef('0x29')]();}};}; \ 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 1bb06c7..7d761b2 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 _0x3541=['AccountId','InteractionId','Message','Smtp','service','host','port','secure','authentication','user','inReplyTo','messageId','','','headers','auto_reply','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','stringify','catch','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','update','error','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','Interaction','stop','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','interaction','created','Autoreply\x20already\x20sent','next','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','getMustacheRender','message','phone','read','subject','Re:','Re:\x20','chat','ChatWebsiteId','account','upperFirst'];(function(_0x2fc130,_0x1e4dc0){var _0xd5a6d1=function(_0x1375f8){while(--_0x1375f8){_0x2fc130['push'](_0x2fc130['shift']());}};_0xd5a6d1(++_0x1e4dc0);}(_0x3541,0xf5));var _0x1354=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0x3541[_0x58dc25];return _0x21b0a7;};'use strict';var _=require('lodash');var moment=require(_0x1354('0x0'));var utils=require(_0x1354('0x1'));var logger=require(_0x1354('0x2'))(_0x1354('0x3'));var rpc={'chatMessage':require(_0x1354('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x1354('0x5')),'smsMessage':require(_0x1354('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x1354('0x7')),'chatInteraction':require(_0x1354('0x8')),'openchannelInteraction':require(_0x1354('0x9')),'mailInteraction':require(_0x1354('0xa')),'smsInteraction':require(_0x1354('0xb')),'faxInteraction':require(_0x1354('0xc')),'whatsappInteraction':require(_0x1354('0xd'))};var mailRpc=require(_0x1354('0xe'));exports['consequence']=function(_0xb029af,_0x4ce542,_0x4a3ae0,_0x517c88){return function(_0x301de2){try{var _0x2559a7=this['channel'];if(_0x2559a7===_0x1354('0xf')&&_0x517c88[_0x1354('0x10')][_0x1354('0x11')]){logger[_0x1354('0x12')](_0x1354('0x13'),_0xb029af,_0x1354('0x14'));return _0x301de2['next']();}if(_0x4ce542[0x0]==='1'&&(_['isNil'](this[_0x1354('0x15')][_0x1354('0x16')])||!this['interaction'][_0x1354('0x16')])){logger['info']('[%s][AUTOREPLY]\x20%s',_0xb029af,_0x1354('0x17'));return _0x301de2[_0x1354('0x18')]();}if(_0x4ce542[0x0]==='2'&&this[_0x1354('0x15')][_0x1354('0x19')]){logger['info'](_0x1354('0x1a'),_0xb029af,_0x1354('0x1b'));return _0x301de2[_0x1354('0x18')]();}var _0x38348c={'ContactId':this['contact']['id'],'sentAt':moment()[_0x1354('0x1c')](_0x1354('0x1d')),'direction':_0x1354('0x1e')};if(this[_0x1354('0x1f')]==='mail'){_0x38348c[_0x1354('0x10')]=utils[_0x1354('0x20')](_0x4ce542[0x2],this);}else{_0x38348c[_0x1354('0x10')]=utils['getMustacheRender'](_0x4ce542[0x1],this);}if(this[_0x1354('0x21')]){_0x38348c['to']=this['message']['from']||'';if(this[_0x1354('0x1f')]===_0x1354('0xf')&&_0x4ce542[0x1]==='1'){_0x38348c['cc']=this[_0x1354('0x21')]['cc']||'';}_0x38348c['from']=this['message']['to']||'';_0x38348c[_0x1354('0x22')]=this[_0x1354('0x21')]['phone']||'';_0x38348c[_0x1354('0x23')]=!![];if(this['message'][_0x1354('0x24')]){_0x38348c[_0x1354('0x24')]='';_0x38348c['subject']+=_['startsWith'](this[_0x1354('0x21')][_0x1354('0x24')],_0x1354('0x25'))?'':_0x1354('0x26');_0x38348c[_0x1354('0x24')]+=this['message']['subject'];}}if(this['channel']===_0x1354('0x27')){_0x38348c[_0x1354('0x28')]=this[_0x1354('0x29')]['id'];}else{_0x38348c[_[_0x1354('0x2a')](this['channel'])+_0x1354('0x2b')]=this[_0x1354('0x29')]['id'];}_0x38348c[_['upperFirst'](this[_0x1354('0x1f')])+_0x1354('0x2c')]=this[_0x1354('0x15')]['id'];var _0x2a3e6e=this['interaction'];if(rpc[this[_0x1354('0x1f')]+_0x1354('0x2d')]){if(this['channel']===_0x1354('0xf')){var _0x3758b8={'tls':{'rejectUnauthorized':![]}};if(this[_0x1354('0x29')][_0x1354('0x2e')][_0x1354('0x2f')]){_0x3758b8[_0x1354('0x2f')]=this[_0x1354('0x29')][_0x1354('0x2e')][_0x1354('0x2f')];}else{_0x3758b8[_0x1354('0x30')]=this['account'][_0x1354('0x2e')][_0x1354('0x30')];_0x3758b8[_0x1354('0x31')]=this[_0x1354('0x29')]['Smtp']['port'];_0x3758b8[_0x1354('0x32')]=this[_0x1354('0x29')]['Smtp'][_0x1354('0x32')];}if(this['account'][_0x1354('0x2e')][_0x1354('0x33')]){_0x3758b8['auth']={'user':this[_0x1354('0x29')][_0x1354('0x2e')][_0x1354('0x34')],'pass':this[_0x1354('0x29')][_0x1354('0x2e')]['pass']};}_0x38348c[_0x1354('0x35')]=this[_0x1354('0x21')][_0x1354('0x36')];_0x38348c['html']=_0x1354('0x37')+_['replace'](_0x38348c[_0x1354('0x10')],'','headers','auto-replied','All','auto_reply','sendMailMessage','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','resolve','Interaction','update','then','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','Message','create','finally','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/faxMessage','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','mail','isAutoreply','info','[%s][AUTOREPLY]\x20%s','next','isNil','interaction','created','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','contact','YYYY-MM-DD\x20HH:mm:ss','out','body','getMustacheRender','message','from','phone','read','subject','startsWith','Re:','Re:\x20','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId'];(function(_0x44c44b,_0x57e40d){var _0xb29ca8=function(_0x1fea49){while(--_0x1fea49){_0x44c44b['push'](_0x44c44b['shift']());}};_0xb29ca8(++_0x57e40d);}(_0x74ce,0x102));var _0xe74c=function(_0x314b0d,_0x26cb50){_0x314b0d=_0x314b0d-0x0;var _0x27d919=_0x74ce[_0x314b0d];return _0x27d919;};'use strict';var _=require(_0xe74c('0x0'));var moment=require('moment');var utils=require(_0xe74c('0x1'));var logger=require(_0xe74c('0x2'))(_0xe74c('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xe74c('0x4')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xe74c('0x5')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0xe74c('0x6')),'smsInteraction':require(_0xe74c('0x7')),'faxInteraction':require(_0xe74c('0x8')),'whatsappInteraction':require(_0xe74c('0x9'))};var mailRpc=require(_0xe74c('0xa'));exports[_0xe74c('0xb')]=function(_0x597d60,_0x37f826,_0x32de7c,_0x2e43fc){return function(_0x45fbd1){try{var _0x401dbd=this[_0xe74c('0xc')];if(_0x401dbd===_0xe74c('0xd')&&_0x2e43fc['body'][_0xe74c('0xe')]){logger[_0xe74c('0xf')](_0xe74c('0x10'),_0x597d60,'Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)');return _0x45fbd1[_0xe74c('0x11')]();}if(_0x37f826[0x0]==='1'&&(_[_0xe74c('0x12')](this[_0xe74c('0x13')]['created'])||!this['interaction'][_0xe74c('0x14')])){logger[_0xe74c('0xf')](_0xe74c('0x10'),_0x597d60,'Autoreply\x20already\x20sent');return _0x45fbd1[_0xe74c('0x11')]();}if(_0x37f826[0x0]==='2'&&this['interaction'][_0xe74c('0x15')]){logger[_0xe74c('0xf')](_0xe74c('0x16'),_0x597d60,'One\x20Time\x20already\x20sent');return _0x45fbd1[_0xe74c('0x11')]();}var _0x5748a8={'ContactId':this[_0xe74c('0x17')]['id'],'sentAt':moment()['format'](_0xe74c('0x18')),'direction':_0xe74c('0x19')};if(this[_0xe74c('0xc')]===_0xe74c('0xd')){_0x5748a8['body']=utils['getMustacheRender'](_0x37f826[0x2],this);}else{_0x5748a8[_0xe74c('0x1a')]=utils[_0xe74c('0x1b')](_0x37f826[0x1],this);}if(this['message']){_0x5748a8['to']=this[_0xe74c('0x1c')][_0xe74c('0x1d')]||'';if(this['channel']===_0xe74c('0xd')&&_0x37f826[0x1]==='1'){_0x5748a8['cc']=this[_0xe74c('0x1c')]['cc']||'';}_0x5748a8[_0xe74c('0x1d')]=this['message']['to']||'';_0x5748a8[_0xe74c('0x1e')]=this['message']['phone']||'';_0x5748a8[_0xe74c('0x1f')]=!![];if(this[_0xe74c('0x1c')][_0xe74c('0x20')]){_0x5748a8[_0xe74c('0x20')]='';_0x5748a8['subject']+=_[_0xe74c('0x21')](this[_0xe74c('0x1c')][_0xe74c('0x20')],_0xe74c('0x22'))?'':_0xe74c('0x23');_0x5748a8[_0xe74c('0x20')]+=this['message'][_0xe74c('0x20')];}}if(this[_0xe74c('0xc')]===_0xe74c('0x24')){_0x5748a8[_0xe74c('0x25')]=this[_0xe74c('0x26')]['id'];}else{_0x5748a8[_['upperFirst'](this['channel'])+_0xe74c('0x27')]=this[_0xe74c('0x26')]['id'];}_0x5748a8[_[_0xe74c('0x28')](this[_0xe74c('0xc')])+_0xe74c('0x29')]=this[_0xe74c('0x13')]['id'];var _0xa683fa=this['interaction'];if(rpc[this[_0xe74c('0xc')]+'Message']){if(this[_0xe74c('0xc')]===_0xe74c('0xd')){var _0x1c25c8={'tls':{'rejectUnauthorized':![]}};if(this[_0xe74c('0x26')][_0xe74c('0x2a')][_0xe74c('0x2b')]){_0x1c25c8[_0xe74c('0x2b')]=this[_0xe74c('0x26')][_0xe74c('0x2a')][_0xe74c('0x2b')];}else{_0x1c25c8[_0xe74c('0x2c')]=this[_0xe74c('0x26')][_0xe74c('0x2a')][_0xe74c('0x2c')];_0x1c25c8[_0xe74c('0x2d')]=this[_0xe74c('0x26')][_0xe74c('0x2a')]['port'];_0x1c25c8[_0xe74c('0x2e')]=this[_0xe74c('0x26')][_0xe74c('0x2a')][_0xe74c('0x2e')];}if(this[_0xe74c('0x26')][_0xe74c('0x2a')][_0xe74c('0x2f')]){_0x1c25c8[_0xe74c('0x30')]={'user':this[_0xe74c('0x26')][_0xe74c('0x2a')][_0xe74c('0x31')],'pass':this[_0xe74c('0x26')][_0xe74c('0x2a')]['pass']};}_0x5748a8[_0xe74c('0x32')]=this[_0xe74c('0x1c')][_0xe74c('0x33')];_0x5748a8[_0xe74c('0x34')]=''+_[_0xe74c('0x35')](_0x5748a8[_0xe74c('0x1a')],_0xe74c('0x36'),_0xe74c('0x37'))+_0xe74c('0x38');_0x5748a8[_0xe74c('0x39')]={'Auto-Submitted':_0xe74c('0x3a'),'X-Auto-Response-Suppress':_0xe74c('0x3b'),'Precedence':_0xe74c('0x3c')};return mailRpc[_0xe74c('0x3d')](_0x1c25c8,_0x5748a8)['then'](function(_0x578809){logger[_0xe74c('0xf')]('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0x597d60);_0x5748a8[_0xe74c('0x33')]=_0x578809[_0xe74c('0x1c')][_0xe74c('0x33')];return rpc[_0x401dbd+'Message']['create'](_0x5748a8);})['then'](function(_0x10bc93){logger['info']('[%s][AUTOREPLY]\x20%s',_0x597d60,JSON[_0xe74c('0x3e')](_0x10bc93));})[_0xe74c('0x3f')](function(_0x4621ab){logger[_0xe74c('0x40')](_0xe74c('0x41'),_0x597d60,JSON[_0xe74c('0x3e')](_0x4621ab));})['finally'](function(){Promise[_0xe74c('0x42')]()['then'](function(){if(_0x37f826[0x0]!=='2'||_0xa683fa[_0xe74c('0x15')])return;return rpc[_0x401dbd+_0xe74c('0x43')][_0xe74c('0x44')](_0xa683fa['id'],{'autoreplyExecuted':!![]})[_0xe74c('0x45')](function(_0x4b97ae){logger[_0xe74c('0xf')](_0xe74c('0x16'),_0x597d60,JSON[_0xe74c('0x3e')](_0x4b97ae));})[_0xe74c('0x3f')](function(_0x5c76de){logger['error'](_0xe74c('0x46'),_0x597d60,JSON[_0xe74c('0x3e')](_0x5c76de));});})['then'](function(){_0x45fbd1['next']();});});}else{return rpc[this[_0xe74c('0xc')]+_0xe74c('0x47')][_0xe74c('0x48')](_0x5748a8)[_0xe74c('0x45')](function(_0x40c9e0){logger['info'](_0xe74c('0x10'),_0x597d60,_0x5748a8['body']);})[_0xe74c('0x3f')](function(_0x33e95f){logger['error'](_0xe74c('0x10'),_0x597d60,JSON[_0xe74c('0x3e')](_0x33e95f));})[_0xe74c('0x49')](function(){Promise[_0xe74c('0x42')]()[_0xe74c('0x45')](function(){if(_0x37f826[0x0]!=='2'||_0xa683fa[_0xe74c('0x15')])return;return rpc[_0x401dbd+'Interaction'][_0xe74c('0x44')](_0xa683fa['id'],{'autoreplyExecuted':!![]})[_0xe74c('0x45')](function(_0x380872){logger[_0xe74c('0xf')](_0xe74c('0x16'),_0x597d60,JSON['stringify'](_0x380872));})['catch'](function(_0x334f69){logger[_0xe74c('0x40')](_0xe74c('0x46'),_0x597d60,JSON[_0xe74c('0x3e')](_0x334f69));});})['then'](function(){_0x45fbd1[_0xe74c('0x11')]();});});}}}catch(_0x236f32){logger[_0xe74c('0x40')]('[%s][AUTOREPLY]\x20%s',_0x597d60,JSON['stringify'](_0x236f32));_0x45fbd1[_0xe74c('0x4a')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index 6e19e4e..78e3e91 100644 --- a/server/services/routing/server/applications/close.js +++ b/server/services/routing/server/applications/close.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe3ec=['stringify','finally','stop','error','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','[%s][CLOSE]\x20%s'];(function(_0x495aea,_0x225616){var _0x50f76a=function(_0x2f745c){while(--_0x2f745c){_0x495aea['push'](_0x495aea['shift']());}};_0x50f76a(++_0x225616);}(_0xe3ec,0x122));var _0xce3e=function(_0x50a0,_0x16c158){_0x50a0=_0x50a0-0x0;var _0x3dfbfa=_0xe3ec[_0x50a0];return _0x3dfbfa;};'use strict';var moment=require(_0xce3e('0x0'));var logger=require(_0xce3e('0x1'))(_0xce3e('0x2'));var rpc={'chatInteraction':require(_0xce3e('0x3')),'openchannelInteraction':require(_0xce3e('0x4')),'smsInteraction':require(_0xce3e('0x5')),'mailInteraction':require(_0xce3e('0x6')),'faxInteraction':require(_0xce3e('0x7')),'whatsappInteraction':require(_0xce3e('0x8'))};exports[_0xce3e('0x9')]=function(_0x303039,_0x406383,_0x2fcd18,_0x3bd664){return function(_0x9a7507){try{logger[_0xce3e('0xa')](_0xce3e('0xb'),_0x303039,_0x406383[0x0]);var _0x337b4f={'closed':0x1,'closedAt':moment()['format'](_0xce3e('0xc')),'closeReason':_0xce3e('0xd'),'disposition':_0x406383[0x0]};if(rpc[_0x3bd664[_0xce3e('0xe')]+_0xce3e('0xf')]){rpc[_0x3bd664[_0xce3e('0xe')]+_0xce3e('0xf')][_0xce3e('0x10')](_0x3bd664[_0xce3e('0x11')]['id'],_0x337b4f)[_0xce3e('0x12')](function(_0x102633){logger[_0xce3e('0xa')](_0xce3e('0x13'),_0x303039,_0x3bd664['interaction']['id']);})[_0xce3e('0x14')](function(_0x58a72e){logger['error'](_0xce3e('0x15'),_0x303039,JSON[_0xce3e('0x16')](_0x58a72e));})[_0xce3e('0x17')](function(){_0x9a7507[_0xce3e('0x18')]();});}}catch(_0x2b0282){logger[_0xce3e('0x19')]('[%s][CLOSE]\x20%s',_0x303039,JSON['stringify'](_0x2b0282));_0x9a7507[_0xce3e('0x18')]();}};}; \ No newline at end of file +var _0x5256=['[%s][CLOSE]\x20%s','stringify','stop','../../../../config/logger','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','channel','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error'];(function(_0x3bb859,_0x589816){var _0x3bf534=function(_0xa586c){while(--_0xa586c){_0x3bb859['push'](_0x3bb859['shift']());}};_0x3bf534(++_0x589816);}(_0x5256,0x153));var _0x6525=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5256[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require('moment');var logger=require(_0x6525('0x0'))('routing');var rpc={'chatInteraction':require(_0x6525('0x1')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x6525('0x2')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x6525('0x3')),'whatsappInteraction':require(_0x6525('0x4'))};exports[_0x6525('0x5')]=function(_0x34c69d,_0x478cfd,_0x131e96,_0x47614f){return function(_0x559e3f){try{logger[_0x6525('0x6')](_0x6525('0x7'),_0x34c69d,_0x478cfd[0x0]);var _0x523b2d={'closed':0x1,'closedAt':moment()[_0x6525('0x8')](_0x6525('0x9')),'closeReason':'system','disposition':_0x478cfd[0x0]};if(rpc[_0x47614f[_0x6525('0xa')]+_0x6525('0xb')]){rpc[_0x47614f[_0x6525('0xa')]+_0x6525('0xb')][_0x6525('0xc')](_0x47614f[_0x6525('0xd')]['id'],_0x523b2d)[_0x6525('0xe')](function(_0x12202b){logger['info'](_0x6525('0xf'),_0x34c69d,_0x47614f['interaction']['id']);})[_0x6525('0x10')](function(_0x32ed34){logger[_0x6525('0x11')](_0x6525('0x12'),_0x34c69d,JSON[_0x6525('0x13')](_0x32ed34));})['finally'](function(){_0x559e3f[_0x6525('0x14')]();});}}catch(_0x97f329){logger['error'](_0x6525('0x12'),_0x34c69d,JSON[_0x6525('0x13')](_0x97f329));_0x559e3f[_0x6525('0x14')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index 8e9c8d5..813fe6a 100644 --- a/server/services/routing/server/applications/dialogflow.js +++ b/server/services/routing/server/applications/dialogflow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x556b=['whatsapp','phone','chat','account','upperFirst','InteractionId','created','isEmpty','body','getMustacheRender','create','then','catch','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','textRequest','message','dialogflow','result','fulfillment','speech','providerName','providerResponse','Message','metadata','next','lodash','moment','apiai-promise','md5','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','sms','channel'];(function(_0x23ac7d,_0x13ab8d){var _0x2ea0f8=function(_0x5cb9b5){while(--_0x5cb9b5){_0x23ac7d['push'](_0x23ac7d['shift']());}};_0x2ea0f8(++_0x13ab8d);}(_0x556b,0x1d7));var _0xb556=function(_0x434b29,_0x11332a){_0x434b29=_0x434b29-0x0;var _0x186bc1=_0x556b[_0x434b29];return _0x186bc1;};'use strict';var _=require(_0xb556('0x0'));var moment=require(_0xb556('0x1'));var apiai=require(_0xb556('0x2'));var md5=require(_0xb556('0x3'));var utils=require(_0xb556('0x4'));var logger=require('../../../../config/logger')(_0xb556('0x5'));var rpc={'chatMessage':require(_0xb556('0x6')),'openchannelMessage':require(_0xb556('0x7')),'mailMessage':require(_0xb556('0x8')),'smsMessage':require(_0xb556('0x9')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x18728e,_0xb44f26){return function(_0x1cc8a1){try{if(!_[_0xb556('0xa')](this[_0xb556('0xb')][_0xb556('0xc')])){logger[_0xb556('0xd')](_0xb556('0xe'),_0x18728e,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x1cc8a1['next']();}var _0x2fe33b={'ContactId':this['contact']['id'],'sentAt':moment()[_0xb556('0xf')](_0xb556('0x10')),'direction':'out'};if(this['channel']===_0xb556('0x11')||this[_0xb556('0x12')]===_0xb556('0x13')){_0x2fe33b[_0xb556('0x14')]=this[_0xb556('0xb')][_0xb556('0x14')];}var _0x5f00af=this['channel'];if(_0x5f00af===_0xb556('0x15')){_0x2fe33b['ChatWebsiteId']=this[_0xb556('0x16')]['id'];}else{_0x2fe33b[_[_0xb556('0x17')](_0x5f00af)+'AccountId']=this['account']['id'];}_0x2fe33b[_[_0xb556('0x17')](_0x5f00af)+_0xb556('0x18')]=this[_0xb556('0xb')]['id'];if(this[_0xb556('0xb')][_0xb556('0x19')]){var _0x35755d=_0xb44f26[0x2];if(!_[_0xb556('0x1a')](_0x35755d)){_0x2fe33b[_0xb556('0x1b')]=utils[_0xb556('0x1c')](_0x35755d,this);return rpc[_0x5f00af+'Message'][_0xb556('0x1d')](_0x2fe33b)[_0xb556('0x1e')](function(_0xb378b2){logger[_0xb556('0xd')]('[%s][DIALOGFLOW]\x20%s',_0x18728e,_0x2fe33b[_0xb556('0x1b')]);})[_0xb556('0x1f')](function(_0x2febb9){logger[_0xb556('0x20')]('[%s][DIALOGFLOW]\x20%s',_0x18728e,JSON[_0xb556('0x21')](_0x2febb9));})[_0xb556('0x22')](function(){logger[_0xb556('0xd')](_0xb556('0x23'),_0x18728e);_0x1cc8a1['stop']();});}else{logger[_0xb556('0xd')](_0xb556('0x24'),_0x18728e);_0x1cc8a1[_0xb556('0x25')]();}}else{var _0x126af6=this;var _0x420ddb=apiai(_0xb44f26[0x0],{'language':_0xb44f26[0x1]||'en'});return _0x420ddb[_0xb556('0x26')](this[_0xb556('0x27')][_0xb556('0x1b')],{'sessionId':md5(this[_0xb556('0xb')]['id'])})[_0xb556('0x1e')](function(_0x12b195){_0x126af6[_0xb556('0x1b')][_0xb556('0x28')]=_0x12b195;_0x2fe33b[_0xb556('0x1b')]=_0x12b195[_0xb556('0x29')][_0xb556('0x2a')][_0xb556('0x2b')];_0x2fe33b[_0xb556('0x2c')]=_0xb556('0x28');_0x2fe33b[_0xb556('0x2d')]=JSON[_0xb556('0x21')](_0x12b195);return rpc[_0x5f00af+_0xb556('0x2e')]['create'](_0x2fe33b)[_0xb556('0x1e')](function(_0x5781e0){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x18728e,_0x2fe33b[_0xb556('0x1b')]);if(_0x12b195[_0xb556('0x29')][_0xb556('0x2f')]['endConversation']){_0x1cc8a1[_0xb556('0x30')]();}else{_0x1cc8a1[_0xb556('0x25')]();}})['catch'](function(_0x58990f){logger['error'](_0xb556('0xe'),_0x18728e,JSON[_0xb556('0x21')](_0x58990f));_0x1cc8a1['next']();});})['catch'](function(_0x3a6548){logger['error'](_0xb556('0xe'),_0x18728e,_0x3a6548['message']);_0x1cc8a1[_0xb556('0x30')]();});}}catch(_0x4de793){logger[_0xb556('0x20')](_0xb556('0xe'),_0x18728e,JSON['stringify'](_0x4de793));_0x1cc8a1['stop']();}};}; \ No newline at end of file +var _0x187d=['result','speech','providerName','metadata','endConversation','message','lodash','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','upperFirst','AccountId','account','getMustacheRender','Message','create','then','info','body','catch','error','stringify','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','textRequest'];(function(_0x33c26b,_0x109f10){var _0x54a7a5=function(_0x44e268){while(--_0x44e268){_0x33c26b['push'](_0x33c26b['shift']());}};_0x54a7a5(++_0x109f10);}(_0x187d,0x93));var _0xd187=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x187d[_0x618414];return _0x21c19a;};'use strict';var _=require(_0xd187('0x0'));var moment=require('moment');var apiai=require(_0xd187('0x1'));var md5=require(_0xd187('0x2'));var utils=require(_0xd187('0x3'));var logger=require(_0xd187('0x4'))(_0xd187('0x5'));var rpc={'chatMessage':require(_0xd187('0x6')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xd187('0x7')),'smsMessage':require(_0xd187('0x8')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xd187('0x9'))};exports[_0xd187('0xa')]=function(_0x444a60,_0x1d3fe4){return function(_0x28ce2f){try{if(!_[_0xd187('0xb')](this[_0xd187('0xc')][_0xd187('0xd')])){logger['info'](_0xd187('0xe'),_0x444a60,_0xd187('0xf'));return _0x28ce2f[_0xd187('0x10')]();}var _0x473866={'ContactId':this[_0xd187('0x11')]['id'],'sentAt':moment()[_0xd187('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xd187('0x13')};if(this[_0xd187('0x14')]===_0xd187('0x15')||this['channel']===_0xd187('0x16')){_0x473866[_0xd187('0x17')]=this[_0xd187('0xc')]['phone'];}var _0x33e3d5=this[_0xd187('0x14')];if(_0x33e3d5===_0xd187('0x18')){_0x473866[_0xd187('0x19')]=this['account']['id'];}else{_0x473866[_[_0xd187('0x1a')](_0x33e3d5)+_0xd187('0x1b')]=this[_0xd187('0x1c')]['id'];}_0x473866[_[_0xd187('0x1a')](_0x33e3d5)+'InteractionId']=this[_0xd187('0xc')]['id'];if(this['interaction']['created']){var _0x40ed84=_0x1d3fe4[0x2];if(!_['isEmpty'](_0x40ed84)){_0x473866['body']=utils[_0xd187('0x1d')](_0x40ed84,this);return rpc[_0x33e3d5+_0xd187('0x1e')][_0xd187('0x1f')](_0x473866)[_0xd187('0x20')](function(_0x21df74){logger[_0xd187('0x21')](_0xd187('0xe'),_0x444a60,_0x473866[_0xd187('0x22')]);})[_0xd187('0x23')](function(_0x46fca3){logger[_0xd187('0x24')](_0xd187('0xe'),_0x444a60,JSON[_0xd187('0x25')](_0x46fca3));})['finally'](function(){logger[_0xd187('0x21')](_0xd187('0x26'),_0x444a60);_0x28ce2f[_0xd187('0x27')]();});}else{logger['info']('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x444a60);_0x28ce2f['stop']();}}else{var _0x435d94=this;var _0x33741d=apiai(_0x1d3fe4[0x0],{'language':_0x1d3fe4[0x1]||'en'});return _0x33741d[_0xd187('0x28')](this['message'][_0xd187('0x22')],{'sessionId':md5(this['interaction']['id'])})[_0xd187('0x20')](function(_0x5a7a23){_0x435d94[_0xd187('0x22')]['dialogflow']=_0x5a7a23;_0x473866['body']=_0x5a7a23[_0xd187('0x29')]['fulfillment'][_0xd187('0x2a')];_0x473866[_0xd187('0x2b')]='dialogflow';_0x473866['providerResponse']=JSON[_0xd187('0x25')](_0x5a7a23);return rpc[_0x33e3d5+_0xd187('0x1e')][_0xd187('0x1f')](_0x473866)[_0xd187('0x20')](function(_0x5cf19a){logger[_0xd187('0x21')](_0xd187('0xe'),_0x444a60,_0x473866['body']);if(_0x5a7a23[_0xd187('0x29')][_0xd187('0x2c')][_0xd187('0x2d')]){_0x28ce2f['next']();}else{_0x28ce2f[_0xd187('0x27')]();}})['catch'](function(_0x263e31){logger[_0xd187('0x24')](_0xd187('0xe'),_0x444a60,JSON[_0xd187('0x25')](_0x263e31));_0x28ce2f['next']();});})[_0xd187('0x23')](function(_0xb38778){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x444a60,_0xb38778[_0xd187('0x2e')]);_0x28ce2f[_0xd187('0x10')]();});}}catch(_0x13f285){logger[_0xd187('0x24')](_0xd187('0xe'),_0x444a60,JSON[_0xd187('0x25')](_0x13f285));_0x28ce2f[_0xd187('0x27')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index 8bd2258..3de5eed 100644 --- a/server/services/routing/server/applications/dialogflowV2.js +++ b/server/services/routing/server/applications/dialogflowV2.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x64f5=['stop','error','lodash','bluebird','routing','./utils','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','Message','create','then','info','[%s][DIALOGFLOWV2]\x20%s','stringify','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','created','isEmpty','getMustacheRender','catch','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','sessionPath','message','detectIntent','dialogflowV2','diagnosticInfo','queryResult','fields','end_conversation','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','intent','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','fulfillmentText','all'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0x64f5,0x17e));var _0x564f=function(_0x310d25,_0x5c90f6){_0x310d25=_0x310d25-0x0;var _0x5a172c=_0x64f5[_0x310d25];return _0x5a172c;};'use strict';var _=require(_0x564f('0x0'));var dialogflow=require('dialogflow');var md5=require('md5');var moment=require('moment');var Promise=require(_0x564f('0x1'));var logger=require('../../../../config/logger')(_0x564f('0x2'));var utils=require(_0x564f('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x564f('0x4')),'mailMessage':require(_0x564f('0x5')),'smsMessage':require(_0x564f('0x6')),'faxMessage':require(_0x564f('0x7')),'whatsappMessage':require(_0x564f('0x8'))};function createMessage(_0x4d3dae,_0x26f14e,_0x28db5a,_0x275bd6){return new Promise(function(_0x26fd74,_0x171055){var _0x369f1a=_[_0x564f('0x9')](_0x28db5a);_0x369f1a[_0x564f('0xa')]=_0x275bd6;return rpc[_0x26f14e+_0x564f('0xb')][_0x564f('0xc')](_0x369f1a)[_0x564f('0xd')](function(){logger[_0x564f('0xe')](_0x564f('0xf'),_0x4d3dae,_0x369f1a['body']);_0x26fd74();})['catch'](function(_0xcaf1e0){logger['error'](_0x564f('0xf'),_0x4d3dae,JSON[_0x564f('0x10')](_0xcaf1e0));_0x171055(_0xcaf1e0);});});}exports[_0x564f('0x11')]=function(_0x5853bd,_0x11168d){return function(_0xa24e3c){try{if(!_[_0x564f('0x12')](this[_0x564f('0x13')][_0x564f('0x14')])){logger['info']('[%s][DIALOGFLOWV2]\x20%s',_0x5853bd,_0x564f('0x15'));return _0xa24e3c[_0x564f('0x16')]();}var _0x2f41bb={'ContactId':this[_0x564f('0x17')]['id'],'sentAt':moment()[_0x564f('0x18')](_0x564f('0x19')),'direction':_0x564f('0x1a')};if(this[_0x564f('0x1b')]===_0x564f('0x1c')||this[_0x564f('0x1b')]===_0x564f('0x1d')){_0x2f41bb['phone']=this[_0x564f('0x13')][_0x564f('0x1e')];}var _0x2959bc=this[_0x564f('0x1b')];if(_0x2959bc===_0x564f('0x1f')){_0x2f41bb[_0x564f('0x20')]=this[_0x564f('0x21')]['id'];}else{_0x2f41bb[_[_0x564f('0x22')](_0x2959bc)+_0x564f('0x23')]=this[_0x564f('0x21')]['id'];}_0x2f41bb[_[_0x564f('0x22')](_0x2959bc)+'InteractionId']=this[_0x564f('0x13')]['id'];if(this[_0x564f('0x13')][_0x564f('0x24')]){var _0x5224ad=_0x11168d[0x4];if(!_[_0x564f('0x25')](_0x5224ad)){_0x2f41bb[_0x564f('0xa')]=utils[_0x564f('0x26')](_0x5224ad,this);return rpc[_0x2959bc+_0x564f('0xb')][_0x564f('0xc')](_0x2f41bb)['then'](function(_0x19cd7a){logger['info'](_0x564f('0xf'),_0x5853bd,_0x2f41bb[_0x564f('0xa')]);})[_0x564f('0x27')](function(_0x4417e9){logger['error'](_0x564f('0xf'),_0x5853bd,JSON[_0x564f('0x10')](_0x4417e9));})[_0x564f('0x28')](function(){logger['info'](_0x564f('0x29'),_0x5853bd);_0xa24e3c['stop']();});}else{logger[_0x564f('0xe')](_0x564f('0x2a'),_0x5853bd);_0xa24e3c['stop']();}}else{var _0x1c9889=this;var _0x57a15d=_0x11168d[0x2][_0x564f('0x2b')](/\\n/g,'\x0a');var _0x5c0a8b={'credentials':{'private_key':_0x57a15d,'client_email':_0x11168d[0x1]}};var _0xbea943=new dialogflow[(_0x564f('0x2c'))](_0x5c0a8b);var _0x5d7593=_0xbea943[_0x564f('0x2d')](_0x11168d[0x0],md5(_0x1c9889['interaction']['id']));var _0x49da4e={'session':_0x5d7593,'queryInput':{'text':{'text':_0x1c9889[_0x564f('0x2e')][_0x564f('0xa')],'languageCode':_0x11168d[0x3]||'en'}}};return _0xbea943[_0x564f('0x2f')](_0x49da4e)['then'](function(_0x3b87fc){if(_0x3b87fc&&_0x3b87fc['length']){_0x1c9889[_0x564f('0xa')][_0x564f('0x30')]=_0x3b87fc;var _0x5dfe91=_0x3b87fc[0x0];var _0x270ee4=_0x5dfe91['queryResult'][_0x564f('0x31')]&&_0x5dfe91[_0x564f('0x32')][_0x564f('0x31')][_0x564f('0x33')]?_0x5dfe91[_0x564f('0x32')][_0x564f('0x31')][_0x564f('0x33')][_0x564f('0x34')]['boolValue']:![];_0x1c9889[_0x564f('0xa')][_0x564f('0x35')]=_0x5dfe91['queryResult'][_0x564f('0x36')];_0x1c9889[_0x564f('0xa')][_0x564f('0x37')]=_0x5dfe91[_0x564f('0x32')][_0x564f('0x38')];_0x1c9889[_0x564f('0xa')][_0x564f('0x39')]=_0x5dfe91[_0x564f('0x32')][_0x564f('0x31')]&&_0x5dfe91['queryResult'][_0x564f('0x31')][_0x564f('0x33')]?_0x5dfe91[_0x564f('0x32')][_0x564f('0x31')]['fields']['end_conversation']['boolValue']:![];_0x1c9889[_0x564f('0xa')][_0x564f('0x3a')]=_0x5dfe91[_0x564f('0x32')][_0x564f('0x3b')]['name'];_0x1c9889['body'][_0x564f('0x3c')]=_0x5dfe91['queryResult']['intent'][_0x564f('0x3d')];_0x1c9889['body'][_0x564f('0x3e')]=_0x5dfe91[_0x564f('0x32')][_0x564f('0x3b')][_0x564f('0x3f')];_0x1c9889['body'][_0x564f('0x40')]=_0x5dfe91[_0x564f('0x32')][_0x564f('0x41')];_0x1c9889['body'][_0x564f('0x42')]=_0x5dfe91[_0x564f('0x32')][_0x564f('0x43')];_0x1c9889['body'][_0x564f('0x44')]=_0x5dfe91['queryResult'][_0x564f('0x45')];_0x2f41bb[_0x564f('0x46')]=_0x564f('0x30');_0x2f41bb[_0x564f('0x47')]=JSON['stringify'](_0x3b87fc);var _0x3c80bc=[];for(var _0x59f73b=0x0;_0x59f73b<_0x3b87fc['length'];_0x59f73b++){var _0x351238=_0x3b87fc[_0x59f73b];if(_0x351238&&_0x351238['queryResult']&&_0x351238[_0x564f('0x32')][_0x564f('0x48')]){_0x3c80bc['push'](createMessage(_0x5853bd,_0x2959bc,_0x2f41bb,_0x351238[_0x564f('0x32')][_0x564f('0x48')]));}}return Promise[_0x564f('0x49')](_0x3c80bc)[_0x564f('0xd')](function(){if(_0x270ee4){_0xa24e3c[_0x564f('0x16')]();}else{_0xa24e3c[_0x564f('0x4a')]();}})[_0x564f('0x27')](function(_0x1e24e9){logger[_0x564f('0x4b')](_0x564f('0xf'),_0x5853bd,JSON[_0x564f('0x10')](_0x1e24e9));_0xa24e3c[_0x564f('0x16')]();});}})['catch'](function(_0x23ea8d){logger[_0x564f('0x4b')]('[%s][DIALOGFLOWV2]\x20%s',_0x5853bd,_0x23ea8d['message']);_0xa24e3c[_0x564f('0x16')]();});}}catch(_0xdf0a1b){logger[_0x564f('0x4b')](_0x564f('0xf'),_0x5853bd,JSON[_0x564f('0x10')](_0xdf0a1b));_0xa24e3c[_0x564f('0x4a')]();}};}; \ No newline at end of file +var _0xdbd0=['providerName','providerResponse','fulfillmentText','all','lodash','dialogflow','md5','moment','bluebird','routing','./utils','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','create','then','info','[%s][DIALOGFLOWV2]\x20%s','body','catch','error','stringify','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','YYYY-MM-DD\x20HH:mm:ss','out','sms','channel','phone','chat','ChatWebsiteId','AccountId','account','upperFirst','created','getMustacheRender','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','message','detectIntent','length','queryResult','diagnosticInfo','fields','end_conversation','boolValue','action','DIALOGFLOWV2_INTENTNAME','intent','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence'];(function(_0xbfe63f,_0x415287){var _0x2b3708=function(_0x43570d){while(--_0x43570d){_0xbfe63f['push'](_0xbfe63f['shift']());}};_0x2b3708(++_0x415287);}(_0xdbd0,0x88));var _0x0dbd=function(_0x4b712e,_0x299d59){_0x4b712e=_0x4b712e-0x0;var _0x247a26=_0xdbd0[_0x4b712e];return _0x247a26;};'use strict';var _=require(_0x0dbd('0x0'));var dialogflow=require(_0x0dbd('0x1'));var md5=require(_0x0dbd('0x2'));var moment=require(_0x0dbd('0x3'));var Promise=require(_0x0dbd('0x4'));var logger=require('../../../../config/logger')(_0x0dbd('0x5'));var utils=require(_0x0dbd('0x6'));var rpc={'chatMessage':require(_0x0dbd('0x7')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x0dbd('0x8')),'smsMessage':require(_0x0dbd('0x9')),'faxMessage':require(_0x0dbd('0xa')),'whatsappMessage':require(_0x0dbd('0xb'))};function createMessage(_0x4b653b,_0x47e742,_0xcb72c2,_0x3b3f21){return new Promise(function(_0x1a957e,_0x1b041f){var _0x12057a=_[_0x0dbd('0xc')](_0xcb72c2);_0x12057a['body']=_0x3b3f21;return rpc[_0x47e742+'Message'][_0x0dbd('0xd')](_0x12057a)[_0x0dbd('0xe')](function(){logger[_0x0dbd('0xf')](_0x0dbd('0x10'),_0x4b653b,_0x12057a[_0x0dbd('0x11')]);_0x1a957e();})[_0x0dbd('0x12')](function(_0x1e0006){logger[_0x0dbd('0x13')]('[%s][DIALOGFLOWV2]\x20%s',_0x4b653b,JSON[_0x0dbd('0x14')](_0x1e0006));_0x1b041f(_0x1e0006);});});}exports[_0x0dbd('0x15')]=function(_0xbeeb88,_0x59f880){return function(_0x1f358a){try{if(!_[_0x0dbd('0x16')](this[_0x0dbd('0x17')][_0x0dbd('0x18')])){logger[_0x0dbd('0xf')](_0x0dbd('0x10'),_0xbeeb88,_0x0dbd('0x19'));return _0x1f358a[_0x0dbd('0x1a')]();}var _0x1b9134={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0x0dbd('0x1b')),'direction':_0x0dbd('0x1c')};if(this['channel']===_0x0dbd('0x1d')||this[_0x0dbd('0x1e')]==='whatsapp'){_0x1b9134['phone']=this[_0x0dbd('0x17')][_0x0dbd('0x1f')];}var _0x24ac9d=this['channel'];if(_0x24ac9d===_0x0dbd('0x20')){_0x1b9134[_0x0dbd('0x21')]=this['account']['id'];}else{_0x1b9134[_['upperFirst'](_0x24ac9d)+_0x0dbd('0x22')]=this[_0x0dbd('0x23')]['id'];}_0x1b9134[_[_0x0dbd('0x24')](_0x24ac9d)+'InteractionId']=this['interaction']['id'];if(this[_0x0dbd('0x17')][_0x0dbd('0x25')]){var _0x4e5f3e=_0x59f880[0x4];if(!_['isEmpty'](_0x4e5f3e)){_0x1b9134[_0x0dbd('0x11')]=utils[_0x0dbd('0x26')](_0x4e5f3e,this);return rpc[_0x24ac9d+'Message'][_0x0dbd('0xd')](_0x1b9134)[_0x0dbd('0xe')](function(_0x18edd1){logger['info'](_0x0dbd('0x10'),_0xbeeb88,_0x1b9134[_0x0dbd('0x11')]);})['catch'](function(_0x328eba){logger[_0x0dbd('0x13')](_0x0dbd('0x10'),_0xbeeb88,JSON[_0x0dbd('0x14')](_0x328eba));})[_0x0dbd('0x27')](function(){logger['info'](_0x0dbd('0x28'),_0xbeeb88);_0x1f358a[_0x0dbd('0x29')]();});}else{logger[_0x0dbd('0xf')](_0x0dbd('0x2a'),_0xbeeb88);_0x1f358a[_0x0dbd('0x29')]();}}else{var _0x464d99=this;var _0x4938d9=_0x59f880[0x2]['replace'](/\\n/g,'\x0a');var _0x47dce1={'credentials':{'private_key':_0x4938d9,'client_email':_0x59f880[0x1]}};var _0x1728d1=new dialogflow['SessionsClient'](_0x47dce1);var _0x228fc6=_0x1728d1['sessionPath'](_0x59f880[0x0],md5(_0x464d99['interaction']['id']));var _0xd13db9={'session':_0x228fc6,'queryInput':{'text':{'text':_0x464d99[_0x0dbd('0x2b')][_0x0dbd('0x11')],'languageCode':_0x59f880[0x3]||'en'}}};return _0x1728d1[_0x0dbd('0x2c')](_0xd13db9)['then'](function(_0x32d41a){if(_0x32d41a&&_0x32d41a[_0x0dbd('0x2d')]){_0x464d99[_0x0dbd('0x11')]['dialogflowV2']=_0x32d41a;var _0x467d49=_0x32d41a[0x0];var _0x3ac530=_0x467d49[_0x0dbd('0x2e')][_0x0dbd('0x2f')]&&_0x467d49['queryResult'][_0x0dbd('0x2f')][_0x0dbd('0x30')]?_0x467d49[_0x0dbd('0x2e')][_0x0dbd('0x2f')]['fields'][_0x0dbd('0x31')][_0x0dbd('0x32')]:![];_0x464d99[_0x0dbd('0x11')]['DIALOGFLOWV2_ACTION']=_0x467d49[_0x0dbd('0x2e')][_0x0dbd('0x33')];_0x464d99[_0x0dbd('0x11')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x467d49[_0x0dbd('0x2e')]['allRequiredParamsPresent'];_0x464d99[_0x0dbd('0x11')]['DIALOGFLOWV2_ENDCONVERSATION']=_0x467d49['queryResult']['diagnosticInfo']&&_0x467d49['queryResult'][_0x0dbd('0x2f')][_0x0dbd('0x30')]?_0x467d49['queryResult'][_0x0dbd('0x2f')][_0x0dbd('0x30')]['end_conversation'][_0x0dbd('0x32')]:![];_0x464d99[_0x0dbd('0x11')][_0x0dbd('0x34')]=_0x467d49['queryResult']['intent']['name'];_0x464d99[_0x0dbd('0x11')]['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x467d49['queryResult'][_0x0dbd('0x35')]['displayName'];_0x464d99[_0x0dbd('0x11')][_0x0dbd('0x36')]=_0x467d49[_0x0dbd('0x2e')][_0x0dbd('0x35')][_0x0dbd('0x37')];_0x464d99[_0x0dbd('0x11')][_0x0dbd('0x38')]=_0x467d49[_0x0dbd('0x2e')][_0x0dbd('0x39')];_0x464d99['body'][_0x0dbd('0x3a')]=_0x467d49[_0x0dbd('0x2e')][_0x0dbd('0x3b')];_0x464d99[_0x0dbd('0x11')][_0x0dbd('0x3c')]=_0x467d49[_0x0dbd('0x2e')][_0x0dbd('0x3d')];_0x1b9134[_0x0dbd('0x3e')]='dialogflowV2';_0x1b9134[_0x0dbd('0x3f')]=JSON['stringify'](_0x32d41a);var _0x2a9c8a=[];for(var _0x270baa=0x0;_0x270baa<_0x32d41a['length'];_0x270baa++){var _0x1d39a6=_0x32d41a[_0x270baa];if(_0x1d39a6&&_0x1d39a6[_0x0dbd('0x2e')]&&_0x1d39a6[_0x0dbd('0x2e')][_0x0dbd('0x40')]){_0x2a9c8a['push'](createMessage(_0xbeeb88,_0x24ac9d,_0x1b9134,_0x1d39a6[_0x0dbd('0x2e')]['fulfillmentText']));}}return Promise[_0x0dbd('0x41')](_0x2a9c8a)[_0x0dbd('0xe')](function(){if(_0x3ac530){_0x1f358a[_0x0dbd('0x1a')]();}else{_0x1f358a[_0x0dbd('0x29')]();}})[_0x0dbd('0x12')](function(_0x523291){logger[_0x0dbd('0x13')](_0x0dbd('0x10'),_0xbeeb88,JSON[_0x0dbd('0x14')](_0x523291));_0x1f358a[_0x0dbd('0x1a')]();});}})[_0x0dbd('0x12')](function(_0x27741e){logger[_0x0dbd('0x13')]('[%s][DIALOGFLOWV2]\x20%s',_0xbeeb88,_0x27741e['message']);_0x1f358a[_0x0dbd('0x1a')]();});}}catch(_0x14ca34){logger[_0x0dbd('0x13')](_0x0dbd('0x10'),_0xbeeb88,JSON['stringify'](_0x14ca34));_0x1f358a[_0x0dbd('0x29')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index 81617a4..735bc4c 100644 --- a/server/services/routing/server/applications/gotoif.js +++ b/server/services/routing/server/applications/gotoif.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0eba=['routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','fromString','length','error','[%s][GOTOIF]\x20%s','map','message','join','condition','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stringify','stop','validate','lodash','html-to-text','./utils','../../../../config/logger'];(function(_0x23b85e,_0x39b209){var _0x329756=function(_0x3418e1){while(--_0x3418e1){_0x23b85e['push'](_0x23b85e['shift']());}};_0x329756(++_0x39b209);}(_0x0eba,0x109));var _0xa0eb=function(_0x1dc77d,_0x15b89c){_0x1dc77d=_0x1dc77d-0x0;var _0x5cdbdb=_0x0eba[_0x1dc77d];return _0x5cdbdb;};'use strict';var schema=require(_0xa0eb('0x0'));var _=require(_0xa0eb('0x1'));var htmlToText=require(_0xa0eb('0x2'));var utils=require(_0xa0eb('0x3'));var logger=require(_0xa0eb('0x4'))(_0xa0eb('0x5'));var gotoif=schema({'condition':{'type':_0xa0eb('0x6'),'required':!![],'message':_0xa0eb('0x7')},'priorityTrue':{'type':_0xa0eb('0x8'),'message':_0xa0eb('0x9')},'priorityFalse':{'type':'number','message':'priority\x20false\x20is\x20a\x20number'}});exports['consequence']=function(_0xd78fa4,_0x409ccb){return function(_0x21dbf8){try{var _0x294d58={'condition':htmlToText[_0xa0eb('0xa')](utils['getMustacheRender'](_0x409ccb[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x409ccb[0x1],'priorityFalse':_0x409ccb[0x2]};var _0x2fa00a=gotoif[_0xa0eb('0x0')](_0x294d58,{'typecast':!![]});if(_0x2fa00a[_0xa0eb('0xb')]){logger[_0xa0eb('0xc')](_0xa0eb('0xd'),_0xd78fa4,_[_0xa0eb('0xe')](_0x2fa00a,_0xa0eb('0xf'))[_0xa0eb('0x10')](',\x20'));_0x21dbf8['stop']();}else{try{var _0x170594=eval('('+_0x294d58[_0xa0eb('0x11')]+')');var _0x2b23d0=_0x170594?_0x294d58['priorityTrue']:_0x294d58[_0xa0eb('0x12')];logger[_0xa0eb('0x13')](_0xa0eb('0x14'),_0xd78fa4,_0x294d58[_0xa0eb('0x11')],_0x170594,_0x2b23d0||_0xa0eb('0x15'));if(_0x2b23d0){var _0x1bb1f7=_['findIndex'](_0x21dbf8[_0xa0eb('0x16')](),{'p':_0x2b23d0});if(_0x1bb1f7>=0x0){logger[_0xa0eb('0x13')](_0xa0eb('0x17'),_0xd78fa4,_0x2b23d0||_0xa0eb('0x15'),_0x1bb1f7);_0x21dbf8[_0xa0eb('0x15')](_0x1bb1f7);}else{logger[_0xa0eb('0x13')](_0xa0eb('0x18'),_0xd78fa4,_0x2b23d0||_0xa0eb('0x15'));_0x21dbf8['stop']();}}else{_0x21dbf8[_0xa0eb('0x15')]();}}catch(_0x9d14c1){logger['error']('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0xd78fa4,_0x9d14c1[_0xa0eb('0xf')]);_0x21dbf8['stop']();}}}catch(_0x2826ab){logger[_0xa0eb('0xc')]('[%s][GOTOIF]\x20%s',_0xd78fa4,JSON[_0xa0eb('0x19')](_0x2826ab));_0x21dbf8[_0xa0eb('0x1a')]();}};}; \ No newline at end of file +var _0xc747=['priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','condition','next','findIndex','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20true\x20is\x20a\x20number','consequence','fromString','getMustacheRender','length','[%s][GOTOIF]\x20%s','map','message','join','stop','priorityTrue'];(function(_0x3da707,_0x30c36d){var _0x342ee7=function(_0x175135){while(--_0x175135){_0x3da707['push'](_0x3da707['shift']());}};_0x342ee7(++_0x30c36d);}(_0xc747,0x79));var _0x7c74=function(_0x33c98e,_0x4eb3d0){_0x33c98e=_0x33c98e-0x0;var _0x39a756=_0xc747[_0x33c98e];return _0x39a756;};'use strict';var schema=require(_0x7c74('0x0'));var _=require(_0x7c74('0x1'));var htmlToText=require(_0x7c74('0x2'));var utils=require(_0x7c74('0x3'));var logger=require(_0x7c74('0x4'))(_0x7c74('0x5'));var gotoif=schema({'condition':{'type':_0x7c74('0x6'),'required':!![],'message':_0x7c74('0x7')},'priorityTrue':{'type':'number','message':_0x7c74('0x8')},'priorityFalse':{'type':'number','message':'priority\x20false\x20is\x20a\x20number'}});exports[_0x7c74('0x9')]=function(_0x565a6b,_0x171be9){return function(_0x9cc4c){try{var _0x5834d6={'condition':htmlToText[_0x7c74('0xa')](utils[_0x7c74('0xb')](_0x171be9[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x171be9[0x1],'priorityFalse':_0x171be9[0x2]};var _0x410a58=gotoif[_0x7c74('0x0')](_0x5834d6,{'typecast':!![]});if(_0x410a58[_0x7c74('0xc')]){logger['error'](_0x7c74('0xd'),_0x565a6b,_[_0x7c74('0xe')](_0x410a58,_0x7c74('0xf'))[_0x7c74('0x10')](',\x20'));_0x9cc4c[_0x7c74('0x11')]();}else{try{var _0x4670ce=eval('('+_0x5834d6['condition']+')');var _0x594eb9=_0x4670ce?_0x5834d6[_0x7c74('0x12')]:_0x5834d6[_0x7c74('0x13')];logger[_0x7c74('0x14')](_0x7c74('0x15'),_0x565a6b,_0x5834d6[_0x7c74('0x16')],_0x4670ce,_0x594eb9||_0x7c74('0x17'));if(_0x594eb9){var _0x5806fd=_[_0x7c74('0x18')](_0x9cc4c['rules'](),{'p':_0x594eb9});if(_0x5806fd>=0x0){logger[_0x7c74('0x14')](_0x7c74('0x19'),_0x565a6b,_0x594eb9||_0x7c74('0x17'),_0x5806fd);_0x9cc4c[_0x7c74('0x17')](_0x5806fd);}else{logger[_0x7c74('0x14')](_0x7c74('0x1a'),_0x565a6b,_0x594eb9||'next');_0x9cc4c[_0x7c74('0x11')]();}}else{_0x9cc4c[_0x7c74('0x17')]();}}catch(_0x9894ed){logger['error'](_0x7c74('0x1b'),_0x565a6b,_0x9894ed['message']);_0x9cc4c['stop']();}}}catch(_0x550a57){logger['error'](_0x7c74('0xd'),_0x565a6b,JSON['stringify'](_0x550a57));_0x9cc4c[_0x7c74('0x11')]();}};}; \ 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 a30fd85..6ce6a38 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 _0xbe78=['rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','[%s][GOTOP]\x20%s','stringify','validate','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','length','error','map','stop','info','priority','findIndex'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0xbe78,0x65));var _0x8be7=function(_0x3de177,_0x297e3a){_0x3de177=_0x3de177-0x0;var _0x79c1cc=_0xbe78[_0x3de177];return _0x79c1cc;};'use strict';var schema=require(_0x8be7('0x0'));var _=require(_0x8be7('0x1'));var logger=require(_0x8be7('0x2'))(_0x8be7('0x3'));var gotop=schema({'priority':{'type':_0x8be7('0x4'),'required':!![],'message':_0x8be7('0x5')}});exports['consequence']=function(_0x50a0f6,_0x1c6f58){return function(_0x36b1ae){try{var _0x5b6bbd={'priority':_0x1c6f58[0x0]};var _0x4dc5be=gotop[_0x8be7('0x0')](_0x5b6bbd,{'typecast':!![]});if(_0x4dc5be[_0x8be7('0x6')]){logger[_0x8be7('0x7')]('[%s][GOTOP]\x20%s',_0x50a0f6,_[_0x8be7('0x8')](_0x4dc5be,'message')['join'](',\x20'));_0x36b1ae[_0x8be7('0x9')]();}else{logger[_0x8be7('0xa')]('[%s][GOTOP]\x20priority\x20%s',_0x50a0f6,_0x5b6bbd[_0x8be7('0xb')]);if(_0x5b6bbd[_0x8be7('0xb')]){var _0x38529c=_[_0x8be7('0xc')](_0x36b1ae[_0x8be7('0xd')](),{'p':_0x5b6bbd[_0x8be7('0xb')]});if(_0x38529c>=0x0){logger[_0x8be7('0xa')](_0x8be7('0xe'),_0x50a0f6,_0x5b6bbd[_0x8be7('0xb')]||_0x8be7('0xf'),_0x38529c);_0x36b1ae['next'](_0x38529c);}else{logger[_0x8be7('0xa')](_0x8be7('0x10'),_0x50a0f6,_0x5b6bbd['priority']||'next');_0x36b1ae[_0x8be7('0x9')]();}}else{_0x36b1ae[_0x8be7('0xf')]();}}}catch(_0x598d9c){logger[_0x8be7('0x7')](_0x8be7('0x11'),_0x50a0f6,JSON[_0x8be7('0x12')](_0x598d9c));_0x36b1ae[_0x8be7('0x9')]();}};}; \ No newline at end of file +var _0xcc83=['next','stringify','validate','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','map','message','stop','info','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s'];(function(_0x1ed406,_0x3b3184){var _0x359b38=function(_0x35dc97){while(--_0x35dc97){_0x1ed406['push'](_0x1ed406['shift']());}};_0x359b38(++_0x3b3184);}(_0xcc83,0x145));var _0x3cc8=function(_0x782159,_0x364b5f){_0x782159=_0x782159-0x0;var _0xf9415=_0xcc83[_0x782159];return _0xf9415;};'use strict';var schema=require(_0x3cc8('0x0'));var _=require('lodash');var logger=require(_0x3cc8('0x1'))(_0x3cc8('0x2'));var gotop=schema({'priority':{'type':_0x3cc8('0x3'),'required':!![],'message':_0x3cc8('0x4')}});exports[_0x3cc8('0x5')]=function(_0x357a7e,_0x5b16e3){return function(_0x457737){try{var _0x5622a0={'priority':_0x5b16e3[0x0]};var _0x148e76=gotop['validate'](_0x5622a0,{'typecast':!![]});if(_0x148e76[_0x3cc8('0x6')]){logger[_0x3cc8('0x7')](_0x3cc8('0x8'),_0x357a7e,_[_0x3cc8('0x9')](_0x148e76,_0x3cc8('0xa'))['join'](',\x20'));_0x457737[_0x3cc8('0xb')]();}else{logger[_0x3cc8('0xc')]('[%s][GOTOP]\x20priority\x20%s',_0x357a7e,_0x5622a0[_0x3cc8('0xd')]);if(_0x5622a0['priority']){var _0x21f12e=_[_0x3cc8('0xe')](_0x457737[_0x3cc8('0xf')](),{'p':_0x5622a0['priority']});if(_0x21f12e>=0x0){logger[_0x3cc8('0xc')](_0x3cc8('0x10'),_0x357a7e,_0x5622a0[_0x3cc8('0xd')]||_0x3cc8('0x11'),_0x21f12e);_0x457737[_0x3cc8('0x11')](_0x21f12e);}else{logger[_0x3cc8('0xc')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x357a7e,_0x5622a0[_0x3cc8('0xd')]||'next');_0x457737[_0x3cc8('0xb')]();}}else{_0x457737['next']();}}}catch(_0x520245){logger[_0x3cc8('0x7')](_0x3cc8('0x8'),_0x357a7e,JSON[_0x3cc8('0x12')](_0x520245));_0x457737['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 56e4ddc..faa09e8 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 _0xe68c=['interaction','create','then','info','[%s][MESSAGE]\x20%s','body','next','error','stringify','stop','lodash','./utils','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','chat','upperFirst','AccountId','account','InteractionId'];(function(_0x2bb66c,_0x36c6c6){var _0x1e0f98=function(_0x1e3412){while(--_0x1e3412){_0x2bb66c['push'](_0x2bb66c['shift']());}};_0x1e0f98(++_0x36c6c6);}(_0xe68c,0xfd));var _0xce68=function(_0x42167f,_0x36c277){_0x42167f=_0x42167f-0x0;var _0x20f119=_0xe68c[_0x42167f];return _0x20f119;};'use strict';var _=require(_0xce68('0x0'));var utils=require(_0xce68('0x1'));var logger=require('../../../../config/logger')(_0xce68('0x2'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xce68('0x3')),'mailMessage':require(_0xce68('0x4')),'smsMessage':require(_0xce68('0x5')),'faxMessage':require(_0xce68('0x6')),'whatsappMessage':require(_0xce68('0x7'))};exports[_0xce68('0x8')]=function(_0x478c08,_0x341561){return function(_0x4526d9){try{var _0x452b8a={'body':utils[_0xce68('0x9')](_0x341561[0x0],this),'ContactId':this[_0xce68('0xa')]['id']};if(this[_0xce68('0xb')]===_0xce68('0xc')){_0x452b8a['ChatWebsiteId']=this['account']['id'];}else{_0x452b8a[_[_0xce68('0xd')](this['channel'])+_0xce68('0xe')]=this[_0xce68('0xf')]['id'];}_0x452b8a[_[_0xce68('0xd')](this[_0xce68('0xb')])+_0xce68('0x10')]=this[_0xce68('0x11')]['id'];if(rpc[this[_0xce68('0xb')]+'Message']){return rpc[this[_0xce68('0xb')]+'Message'][_0xce68('0x12')](_0x452b8a)[_0xce68('0x13')](function(_0x560798){logger[_0xce68('0x14')](_0xce68('0x15'),_0x478c08,_0x452b8a[_0xce68('0x16')]);_0x4526d9[_0xce68('0x17')]();})['catch'](function(_0x3b5f03){logger[_0xce68('0x18')](_0xce68('0x15'),_0x478c08,JSON[_0xce68('0x19')](_0x3b5f03));_0x4526d9['stop']();});}}catch(_0x408b78){logger[_0xce68('0x18')]('[%s][MESSAGE]\x20%s',_0x478c08,JSON[_0xce68('0x19')](_0x408b78));_0x4526d9[_0xce68('0x1a')]();}};}; \ No newline at end of file +var _0x25c9=['routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','upperFirst','AccountId','InteractionId','interaction','Message','create','then','[%s][MESSAGE]\x20%s','body','next','catch','stringify','stop','error','lodash','./utils','../../../../config/logger'];(function(_0xe47d21,_0x106bf8){var _0x5ebf66=function(_0x566021){while(--_0x566021){_0xe47d21['push'](_0xe47d21['shift']());}};_0x5ebf66(++_0x106bf8);}(_0x25c9,0x1d9));var _0x925c=function(_0x30f211,_0x920a91){_0x30f211=_0x30f211-0x0;var _0x71f489=_0x25c9[_0x30f211];return _0x71f489;};'use strict';var _=require(_0x925c('0x0'));var utils=require(_0x925c('0x1'));var logger=require(_0x925c('0x2'))(_0x925c('0x3'));var rpc={'chatMessage':require(_0x925c('0x4')),'openchannelMessage':require(_0x925c('0x5')),'mailMessage':require(_0x925c('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x925c('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x925c('0x8')]=function(_0x58010f,_0x479e60){return function(_0x18ddd9){try{var _0x4af9af={'body':utils[_0x925c('0x9')](_0x479e60[0x0],this),'ContactId':this[_0x925c('0xa')]['id']};if(this[_0x925c('0xb')]===_0x925c('0xc')){_0x4af9af[_0x925c('0xd')]=this['account']['id'];}else{_0x4af9af[_[_0x925c('0xe')](this[_0x925c('0xb')])+_0x925c('0xf')]=this['account']['id'];}_0x4af9af[_[_0x925c('0xe')](this['channel'])+_0x925c('0x10')]=this[_0x925c('0x11')]['id'];if(rpc[this[_0x925c('0xb')]+_0x925c('0x12')]){return rpc[this[_0x925c('0xb')]+'Message'][_0x925c('0x13')](_0x4af9af)[_0x925c('0x14')](function(_0x2fdd3b){logger['info'](_0x925c('0x15'),_0x58010f,_0x4af9af[_0x925c('0x16')]);_0x18ddd9[_0x925c('0x17')]();})[_0x925c('0x18')](function(_0x4df95a){logger['error'](_0x925c('0x15'),_0x58010f,JSON[_0x925c('0x19')](_0x4df95a));_0x18ddd9[_0x925c('0x1a')]();});}}catch(_0x255285){logger[_0x925c('0x1b')](_0x925c('0x15'),_0x58010f,JSON[_0x925c('0x19')](_0x255285));_0x18ddd9['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index 7fe0473..63cc59f 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 _0x3773=['../../../../config/logger','routing','getMustacheRender','stringify','stop'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x3773,0xb4));var _0x3377=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x3773[_0x4b055c];return _0x4b62bb;};'use strict';var utils=require('./utils');var logger=require(_0x3377('0x0'))(_0x3377('0x1'));exports['consequence']=function(_0x2316e0,_0x355581){return function(_0x296e95){try{logger['info']('[%s][NOOP]\x20%s',_0x2316e0,utils[_0x3377('0x2')](_0x355581[0x0],this));_0x296e95['next']();}catch(_0x2da153){logger['error']('[%s][NOOP]\x20%s',_0x2316e0,JSON[_0x3377('0x3')](_0x2da153));_0x296e95[_0x3377('0x4')]();}};}; \ No newline at end of file +var _0xf3a9=['../../../../config/logger','routing','consequence','getMustacheRender','next','stringify','stop','./utils'];(function(_0x3a0712,_0x4d7b79){var _0x3a0592=function(_0x5ef1f0){while(--_0x5ef1f0){_0x3a0712['push'](_0x3a0712['shift']());}};_0x3a0592(++_0x4d7b79);}(_0xf3a9,0x1c7));var _0x9f3a=function(_0xc2f303,_0x1796e9){_0xc2f303=_0xc2f303-0x0;var _0x223923=_0xf3a9[_0xc2f303];return _0x223923;};'use strict';var utils=require(_0x9f3a('0x0'));var logger=require(_0x9f3a('0x1'))(_0x9f3a('0x2'));exports[_0x9f3a('0x3')]=function(_0x56f130,_0x21a38b){return function(_0x3e0f92){try{logger['info']('[%s][NOOP]\x20%s',_0x56f130,utils[_0x9f3a('0x4')](_0x21a38b[0x0],this));_0x3e0f92[_0x9f3a('0x5')]();}catch(_0x443119){logger['error']('[%s][NOOP]\x20%s',_0x56f130,JSON[_0x9f3a('0x6')](_0x443119));_0x3e0f92[_0x9f3a('0x7')]();}};}; \ 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 86cd6b6..af60518 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 _0xf030=['defaults','localhost','socket.io-emitter','queue_id','account','from','joinAt','emit','clone','queue','format','%sQueuesWaitingInteractions','pick','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','MessageId','message','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','accepted','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','map','stop','find','Queues','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','redis'];(function(_0x15278a,_0x5a4438){var _0x7cfd62=function(_0x17f1a5){while(--_0x17f1a5){_0x15278a['push'](_0x15278a['shift']());}};_0x7cfd62(++_0x5a4438);}(_0xf030,0x1e3));var _0x0f03=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xf030[_0x57b54c];return _0x59cc19;};'use strict';var schema=require(_0x0f03('0x0'));var _=require(_0x0f03('0x1'));var util=require(_0x0f03('0x2'));var seqqueue=require('seq-queue');var moment=require(_0x0f03('0x3'));var Redis=require(_0x0f03('0x4'));var config=require(_0x0f03('0x5'));var logger=require(_0x0f03('0x6'))(_0x0f03('0x7'));var strategy=require('./strategy');config[_0x0f03('0x8')]=_[_0x0f03('0x9')](config[_0x0f03('0x8')],{'host':_0x0f03('0xa'),'port':0x18eb});var io=require(_0x0f03('0xb'))(new Redis(config[_0x0f03('0x8')]));var attributes=['id',_0x0f03('0xc'),_0x0f03('0xd'),'queue',_0x0f03('0xe'),_0x0f03('0xf')];function emit(_0x5b1d4d,_0x4b2627,_0x5c45fa){io['to'](_0x5b1d4d)[_0x0f03('0x10')](_0x4b2627,_0x5c45fa);}function emitChannelQueueInteraction(_0x58003f,_0x16877b,_0x5cf83d,_0x37f42f,_0x1b3a3a,_0x398c0e,_0x100f51,_0x2e5bd7){var _0x423726=_[_0x0f03('0x11')](_0x5cf83d);_0x423726[_0x0f03('0xc')]=_0x2e5bd7;_0x423726[_0x0f03('0x12')]=_0x16877b;_0x423726[_0x0f03('0xd')]=_0x37f42f;_0x423726['id']=_0x1b3a3a;if(_0x398c0e){_0x100f51[util[_0x0f03('0x13')](_0x0f03('0x14'),_0x58003f)][_0x1b3a3a]=_[_0x0f03('0x15')](_0x423726,attributes);}else{delete _0x100f51[util[_0x0f03('0x13')](_0x0f03('0x14'),_0x58003f)][_0x1b3a3a];}emit(util[_0x0f03('0x13')]('%s:queue:%s',_0x58003f,_0x16877b),util['format'](_0x0f03('0x16'),_0x58003f,_0x398c0e?_0x0f03('0x17'):_0x0f03('0x18')),_[_0x0f03('0x15')](_0x423726,attributes));}var rpc={'openchannelQueueReport':require(_0x0f03('0x19')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0x0f03('0x1a')),'smsQueueReport':require(_0x0f03('0x1b')),'faxQueueReport':require(_0x0f03('0x1c')),'whatsappQueueReport':require(_0x0f03('0x1d'))};var queue=schema({'name':{'type':'string','required':!![],'message':_0x0f03('0x1e')},'timeout':{'type':_0x0f03('0x1f'),'message':_0x0f03('0x20')}});function startRouting(_0x4dec69,_0x1e7ee6,_0x5957e4,_0x2d94f0){if(_0x4dec69&&_0x1e7ee6&&_0x5957e4){_0x1e7ee6[_0x0f03('0x21')]+=0x1;var _0x59026b={'uniqueid':_0x4dec69,'from':_0x5957e4['body']?_0x5957e4[_0x0f03('0x22')][_0x0f03('0xe')]:'','joinAt':moment()[_0x0f03('0x13')](_0x0f03('0x23')),'ContactId':_0x5957e4['contact']?_0x5957e4[_0x0f03('0x24')]['id']:null,'ListId':_0x5957e4[_0x0f03('0x25')]?_0x5957e4['list']['id']:null};_0x59026b[_[_0x0f03('0x26')](_0x5957e4[_0x0f03('0x27')])+_0x0f03('0x28')]=_0x1e7ee6['id']||null;_0x59026b[_['upperFirst'](_0x5957e4[_0x0f03('0x27')])+_0x0f03('0x29')]=_0x5957e4[_0x0f03('0x2a')]?_0x5957e4[_0x0f03('0x2a')]['id']:null;_0x59026b[_[_0x0f03('0x26')](_0x5957e4[_0x0f03('0x27')])+_0x0f03('0x2b')]=_0x5957e4['message']?_0x5957e4[_0x0f03('0x2c')]['id']:null;_0x59026b[_[_0x0f03('0x26')](_0x5957e4['channel'])+(_0x5957e4[_0x0f03('0x27')]!=='chat'?'AccountId':_0x0f03('0x2d'))]=_0x5957e4[_0x0f03('0xd')]?_0x5957e4[_0x0f03('0xd')]['id']:null;logger[_0x0f03('0x2e')](util[_0x0f03('0x13')](_0x0f03('0x2f'),_0x4dec69,_0x1e7ee6[_0x0f03('0x30')]));emitChannelQueueInteraction(_0x5957e4[_0x0f03('0x27')],_0x1e7ee6[_0x0f03('0x30')],_0x59026b,_0x5957e4[_0x0f03('0xd')][_0x0f03('0x30')],_0x5957e4[_0x0f03('0x2c')]['id'],!![],_0x2d94f0,_0x1e7ee6['id']);if(rpc[_0x5957e4[_0x0f03('0x27')]+'QueueReport']){return rpc[_0x5957e4[_0x0f03('0x27')]+_0x0f03('0x31')][_0x0f03('0x32')](_0x59026b)[_0x0f03('0x33')](function(_0x5bd2eb){logger[_0x0f03('0x34')]('create\x20queue\x20report');});}}}function stopRouting(_0x3d310e,_0xb1709f,_0x107fe2,_0x16fd08){if(_0x3d310e&&_0xb1709f){_0xb1709f[_0x0f03('0x21')]-=0x1;var _0x181fde={'leaveAt':moment()[_0x0f03('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0x0f03('0x13')](_0x0f03('0x23')),'reason':_0x0f03('0x35')};logger[_0x0f03('0x2e')](util[_0x0f03('0x13')](_0x0f03('0x36'),_0x3d310e,_0xb1709f[_0x0f03('0x30')]));emitChannelQueueInteraction(_0x107fe2['channel'],_0xb1709f[_0x0f03('0x30')],_0x107fe2[_0x0f03('0x22')],_0x107fe2[_0x0f03('0xd')]['name'],_0x107fe2[_0x0f03('0x2c')]['id'],![],_0x16fd08,_0xb1709f['id']);if(rpc[_0x107fe2[_0x0f03('0x27')]+_0x0f03('0x31')]){return rpc[_0x107fe2[_0x0f03('0x27')]+_0x0f03('0x31')][_0x0f03('0x37')](_0x3d310e,_0x181fde)[_0x0f03('0x33')](function(_0x12466e){logger[_0x0f03('0x34')](_0x0f03('0x38'));});}}}function endRouting(_0x3fd9a4,_0x54e7df,_0x5c78d0,_0x1cd74d){if(_0x3fd9a4&&_0x54e7df){_0x54e7df[_0x0f03('0x21')]-=0x1;var _0xd261cb={'leaveAt':moment()[_0x0f03('0x13')](_0x0f03('0x23')),'exitAt':moment()[_0x0f03('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x0f03('0x39')};logger[_0x0f03('0x2e')](util[_0x0f03('0x13')](_0x0f03('0x3a'),_0x3fd9a4,_0x54e7df[_0x0f03('0x30')]));emitChannelQueueInteraction(_0x5c78d0[_0x0f03('0x27')],_0x54e7df[_0x0f03('0x30')],_0x5c78d0[_0x0f03('0x22')],_0x5c78d0[_0x0f03('0xd')]['name'],_0x5c78d0[_0x0f03('0x2c')]['id'],![],_0x1cd74d);if(rpc[_0x5c78d0[_0x0f03('0x27')]+_0x0f03('0x31')]){return rpc[_0x5c78d0['channel']+_0x0f03('0x31')][_0x0f03('0x37')](_0x3fd9a4,_0xd261cb)['catch'](function(_0xf24547){logger[_0x0f03('0x34')](_0x0f03('0x38'));});}}}function handleFindQueue(_0x1c4238){return function(_0x5d51d4){return _0x5d51d4[_0x0f03('0x30')][_0x0f03('0x3b')]()===_0x1c4238[_0x0f03('0x3b')]();};}exports[_0x0f03('0x3c')]=function(_0x246ea1,_0x57d04c,_0x4e6e93,_0x3cd841){return function(_0x12827e){try{var _0x50fa2f={'name':_0x57d04c[0x0],'timeout':_0x57d04c[0x1]};var _0x26e288=queue[_0x0f03('0x0')](_0x50fa2f,{'typecast':!![]});if(_0x26e288['length']){logger[_0x0f03('0x34')]('[%s][QUEUE]\x20%s',_0x246ea1,_[_0x0f03('0x3d')](_0x26e288,_0x0f03('0x2c'))['join'](',\x20'));_0x12827e[_0x0f03('0x3e')]();}else{var _0x1683e6=_[_0x0f03('0x3f')](_0x4e6e93[_0x3cd841[_0x0f03('0x27')]+_0x0f03('0x40')],handleFindQueue(_0x50fa2f[_0x0f03('0x30')]));if(_0x1683e6){startRouting(_0x246ea1,_0x1683e6,_0x3cd841,_0x4e6e93);var _0x598b98=(_0x1683e6[_0x0f03('0x39')]||0xa)*0x3e8;var _0x45859d=(_0x50fa2f[_0x0f03('0x39')]||0x14)*0x3e8;var _0x388b85,_0x423db7;if(_0x598b98>_0x45859d){_0x45859d=_0x598b98;}var _0x55dfff=seqqueue[_0x0f03('0x41')](_0x598b98);_0x55dfff['id']=_0x246ea1;_0x55dfff[_0x0f03('0x42')]=_0x598b98;_0x55dfff[_0x0f03('0x43')]=_0x45859d;_0x55dfff[_0x0f03('0x27')]=_0x3cd841[_0x0f03('0x27')];_0x4e6e93[_0x0f03('0x44')][_0x246ea1]['on'](_0x0f03('0x45'),function(){logger['info'](_0x0f03('0x46'),_0x246ea1);stopRouting(_0x246ea1,_0x1683e6,_0x3cd841,_0x4e6e93);clearTimeout(_0x388b85);_0x388b85=undefined;_0x55dfff[_0x0f03('0x47')](!![]);if(_0x4e6e93[_0x0f03('0x44')][_0x246ea1]){delete _0x4e6e93[_0x0f03('0x44')][_0x246ea1];}_0x12827e[_0x0f03('0x3e')]();});_0x4e6e93[_0x0f03('0x44')][_0x246ea1]['on'](_0x0f03('0x48'),function(){if(_0x4e6e93['rules'][_0x246ea1]){delete _0x4e6e93[_0x0f03('0x44')][_0x246ea1];}});_0x388b85=setTimeout(function(){logger[_0x0f03('0x2e')](_0x0f03('0x49'),_0x246ea1);endRouting(_0x246ea1,_0x1683e6,_0x3cd841,_0x4e6e93);clearTimeout(_0x388b85);_0x55dfff[_0x0f03('0x47')](!![]);_0x12827e[_0x0f03('0x4a')]();},_0x45859d);switch(_0x1683e6[_0x0f03('0x4b')]){case _0x0f03('0x4c'):strategy[_0x0f03('0x4c')](_0x55dfff,_0x1683e6,_0x4e6e93,_0x3cd841);break;default:strategy[_0x0f03('0x4d')](_0x55dfff,_0x1683e6,_0x4e6e93,_0x3cd841);}}else{logger[_0x0f03('0x34')](_0x0f03('0x4e'),_0x246ea1,_0x50fa2f[_0x0f03('0x30')]);_0x12827e[_0x0f03('0x3e')]();}}}catch(_0x352fe1){console[_0x0f03('0x4f')](_0x352fe1);logger['error'](_0x0f03('0x50'),_0x246ea1,_0x352fe1[_0x0f03('0x51')]);_0x12827e[_0x0f03('0x3e')]();}};}; \ No newline at end of file +var _0x640b=['interaction','MessageId','message','chat','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','error','create\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','[%s][STOP:QUEUE][NAME:%s]','update','catch','update\x20queue\x20report','[%s][END:QUEUE][NAME:%s]','length','map','stop','Queues','timeout','createQueue','atimeout','qtimeout','rules','end','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','rrmemory','beepall','log','[%s][QUEUE]\x20%s','validate','lodash','seq-queue','ioredis','../../../../config/environment','routing','./strategy','redis','queue_id','account','queue','from','emit','clone','format','%sQueuesWaitingInteractions','%s:queue:%s','save','remove','../../rpc/mailQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','number','waiting','body','contact','list','upperFirst','channel','InteractionId'];(function(_0x60878f,_0x1166d3){var _0x1fbefb=function(_0x375d8c){while(--_0x375d8c){_0x60878f['push'](_0x60878f['shift']());}};_0x1fbefb(++_0x1166d3);}(_0x640b,0x1af));var _0xb640=function(_0x1c022f,_0xabda83){_0x1c022f=_0x1c022f-0x0;var _0x363696=_0x640b[_0x1c022f];return _0x363696;};'use strict';var schema=require(_0xb640('0x0'));var _=require(_0xb640('0x1'));var util=require('util');var seqqueue=require(_0xb640('0x2'));var moment=require('moment');var Redis=require(_0xb640('0x3'));var config=require(_0xb640('0x4'));var logger=require('../../../../config/logger')(_0xb640('0x5'));var strategy=require(_0xb640('0x6'));config[_0xb640('0x7')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb640('0x7')]));var attributes=['id',_0xb640('0x8'),_0xb640('0x9'),_0xb640('0xa'),_0xb640('0xb'),'joinAt'];function emit(_0x2b36ec,_0x1c2344,_0x9dfda){io['to'](_0x2b36ec)[_0xb640('0xc')](_0x1c2344,_0x9dfda);}function emitChannelQueueInteraction(_0x182654,_0x5769da,_0x118d5a,_0x4ab97c,_0x1ffbee,_0x3d3f09,_0x5071d8,_0x10d604){var _0x653407=_[_0xb640('0xd')](_0x118d5a);_0x653407[_0xb640('0x8')]=_0x10d604;_0x653407['queue']=_0x5769da;_0x653407[_0xb640('0x9')]=_0x4ab97c;_0x653407['id']=_0x1ffbee;if(_0x3d3f09){_0x5071d8[util[_0xb640('0xe')](_0xb640('0xf'),_0x182654)][_0x1ffbee]=_['pick'](_0x653407,attributes);}else{delete _0x5071d8[util[_0xb640('0xe')](_0xb640('0xf'),_0x182654)][_0x1ffbee];}emit(util[_0xb640('0xe')](_0xb640('0x10'),_0x182654,_0x5769da),util[_0xb640('0xe')]('%s_queue_waiting_interaction:%s',_0x182654,_0x3d3f09?_0xb640('0x11'):_0xb640('0x12')),_['pick'](_0x653407,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0xb640('0x13')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0xb640('0x14')),'faxQueueReport':require(_0xb640('0x15')),'whatsappQueueReport':require(_0xb640('0x16'))};var queue=schema({'name':{'type':'string','required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xb640('0x17'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x4fee45,_0x3d04cf,_0xe58548,_0x449f8d){if(_0x4fee45&&_0x3d04cf&&_0xe58548){_0x3d04cf[_0xb640('0x18')]+=0x1;var _0x45e263={'uniqueid':_0x4fee45,'from':_0xe58548[_0xb640('0x19')]?_0xe58548[_0xb640('0x19')][_0xb640('0xb')]:'','joinAt':moment()[_0xb640('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xe58548[_0xb640('0x1a')]?_0xe58548['contact']['id']:null,'ListId':_0xe58548[_0xb640('0x1b')]?_0xe58548['list']['id']:null};_0x45e263[_['upperFirst'](_0xe58548['channel'])+'QueueId']=_0x3d04cf['id']||null;_0x45e263[_[_0xb640('0x1c')](_0xe58548[_0xb640('0x1d')])+_0xb640('0x1e')]=_0xe58548[_0xb640('0x1f')]?_0xe58548[_0xb640('0x1f')]['id']:null;_0x45e263[_[_0xb640('0x1c')](_0xe58548[_0xb640('0x1d')])+_0xb640('0x20')]=_0xe58548['message']?_0xe58548[_0xb640('0x21')]['id']:null;_0x45e263[_['upperFirst'](_0xe58548[_0xb640('0x1d')])+(_0xe58548['channel']!==_0xb640('0x22')?'AccountId':_0xb640('0x23'))]=_0xe58548[_0xb640('0x9')]?_0xe58548[_0xb640('0x9')]['id']:null;logger[_0xb640('0x24')](util['format'](_0xb640('0x25'),_0x4fee45,_0x3d04cf[_0xb640('0x26')]));emitChannelQueueInteraction(_0xe58548[_0xb640('0x1d')],_0x3d04cf[_0xb640('0x26')],_0x45e263,_0xe58548['account'][_0xb640('0x26')],_0xe58548[_0xb640('0x21')]['id'],!![],_0x449f8d,_0x3d04cf['id']);if(rpc[_0xe58548[_0xb640('0x1d')]+_0xb640('0x27')]){return rpc[_0xe58548[_0xb640('0x1d')]+'QueueReport']['create'](_0x45e263)['catch'](function(_0x52001a){logger[_0xb640('0x28')](_0xb640('0x29'));});}}}function stopRouting(_0x5a0de8,_0x4f587b,_0x322706,_0x29937a){if(_0x5a0de8&&_0x4f587b){_0x4f587b[_0xb640('0x18')]-=0x1;var _0x3ab06a={'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0xb640('0xe')](_0xb640('0x2a')),'reason':'accepted'};logger[_0xb640('0x24')](util[_0xb640('0xe')](_0xb640('0x2b'),_0x5a0de8,_0x4f587b[_0xb640('0x26')]));emitChannelQueueInteraction(_0x322706[_0xb640('0x1d')],_0x4f587b[_0xb640('0x26')],_0x322706[_0xb640('0x19')],_0x322706[_0xb640('0x9')][_0xb640('0x26')],_0x322706[_0xb640('0x21')]['id'],![],_0x29937a,_0x4f587b['id']);if(rpc[_0x322706['channel']+'QueueReport']){return rpc[_0x322706['channel']+_0xb640('0x27')][_0xb640('0x2c')](_0x5a0de8,_0x3ab06a)[_0xb640('0x2d')](function(_0x62c3fd){logger[_0xb640('0x28')](_0xb640('0x2e'));});}}}function endRouting(_0x495dd1,_0x1bd3a5,_0x5c161c,_0x43f550){if(_0x495dd1&&_0x1bd3a5){_0x1bd3a5['waiting']-=0x1;var _0x446bb1={'leaveAt':moment()[_0xb640('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()['format'](_0xb640('0x2a')),'reason':'timeout'};logger[_0xb640('0x24')](util[_0xb640('0xe')](_0xb640('0x2f'),_0x495dd1,_0x1bd3a5[_0xb640('0x26')]));emitChannelQueueInteraction(_0x5c161c['channel'],_0x1bd3a5['name'],_0x5c161c['body'],_0x5c161c[_0xb640('0x9')]['name'],_0x5c161c['message']['id'],![],_0x43f550);if(rpc[_0x5c161c[_0xb640('0x1d')]+'QueueReport']){return rpc[_0x5c161c[_0xb640('0x1d')]+_0xb640('0x27')][_0xb640('0x2c')](_0x495dd1,_0x446bb1)[_0xb640('0x2d')](function(_0x6fa50d){logger[_0xb640('0x28')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x1054f5){return function(_0x4f4a05){return _0x4f4a05['name']['toLowerCase']()===_0x1054f5['toLowerCase']();};}exports['consequence']=function(_0x35ba5c,_0x559e1f,_0x26ad5d,_0x3fd11d){return function(_0x86c9e6){try{var _0x2566e1={'name':_0x559e1f[0x0],'timeout':_0x559e1f[0x1]};var _0x68e038=queue[_0xb640('0x0')](_0x2566e1,{'typecast':!![]});if(_0x68e038[_0xb640('0x30')]){logger['error']('[%s][QUEUE]\x20%s',_0x35ba5c,_[_0xb640('0x31')](_0x68e038,_0xb640('0x21'))['join'](',\x20'));_0x86c9e6[_0xb640('0x32')]();}else{var _0x3aacb2=_['find'](_0x26ad5d[_0x3fd11d[_0xb640('0x1d')]+_0xb640('0x33')],handleFindQueue(_0x2566e1['name']));if(_0x3aacb2){startRouting(_0x35ba5c,_0x3aacb2,_0x3fd11d,_0x26ad5d);var _0x110384=(_0x3aacb2[_0xb640('0x34')]||0xa)*0x3e8;var _0x2d756d=(_0x2566e1[_0xb640('0x34')]||0x14)*0x3e8;var _0xf36807,_0x43c1b6;if(_0x110384>_0x2d756d){_0x2d756d=_0x110384;}var _0x5dabc0=seqqueue[_0xb640('0x35')](_0x110384);_0x5dabc0['id']=_0x35ba5c;_0x5dabc0[_0xb640('0x36')]=_0x110384;_0x5dabc0[_0xb640('0x37')]=_0x2d756d;_0x5dabc0[_0xb640('0x1d')]=_0x3fd11d[_0xb640('0x1d')];_0x26ad5d[_0xb640('0x38')][_0x35ba5c]['on'](_0xb640('0x39'),function(){logger[_0xb640('0x24')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x35ba5c);stopRouting(_0x35ba5c,_0x3aacb2,_0x3fd11d,_0x26ad5d);clearTimeout(_0xf36807);_0xf36807=undefined;_0x5dabc0[_0xb640('0x3a')](!![]);if(_0x26ad5d[_0xb640('0x38')][_0x35ba5c]){delete _0x26ad5d[_0xb640('0x38')][_0x35ba5c];}_0x86c9e6[_0xb640('0x32')]();});_0x26ad5d[_0xb640('0x38')][_0x35ba5c]['on'](_0xb640('0x3b'),function(){if(_0x26ad5d[_0xb640('0x38')][_0x35ba5c]){delete _0x26ad5d['rules'][_0x35ba5c];}});_0xf36807=setTimeout(function(){logger[_0xb640('0x24')](_0xb640('0x3c'),_0x35ba5c);endRouting(_0x35ba5c,_0x3aacb2,_0x3fd11d,_0x26ad5d);clearTimeout(_0xf36807);_0x5dabc0[_0xb640('0x3a')](!![]);_0x86c9e6[_0xb640('0x3d')]();},_0x2d756d);switch(_0x3aacb2['strategy']){case _0xb640('0x3e'):strategy[_0xb640('0x3e')](_0x5dabc0,_0x3aacb2,_0x26ad5d,_0x3fd11d);break;default:strategy[_0xb640('0x3f')](_0x5dabc0,_0x3aacb2,_0x26ad5d,_0x3fd11d);}}else{logger[_0xb640('0x28')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x35ba5c,_0x2566e1[_0xb640('0x26')]);_0x86c9e6[_0xb640('0x32')]();}}}catch(_0x923d48){console[_0xb640('0x40')](_0x923d48);logger[_0xb640('0x28')](_0xb640('0x41'),_0x35ba5c,_0x923d48['stack']);_0x86c9e6[_0xb640('0x32')]();}};}; \ 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 bb7d10a..28ab5b3 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 _0xfe33=['realtime','routing','push','handleRun','bind','timeout','handleTimeout','drained','prototype','handleDrained','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','channel','busy','busyQueue','showNotification','notificationId','writeLog',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','TIMEOUT','exports','../../../../../config/logger','squeue','agent'];(function(_0x1141ed,_0x1b9253){var _0x46ba5e=function(_0x222e57){while(--_0x222e57){_0x1141ed['push'](_0x1141ed['shift']());}};_0x46ba5e(++_0x1b9253);}(_0xfe33,0x13d));var _0x3fe3=function(_0x41d552,_0x1e59db){_0x41d552=_0x41d552-0x0;var _0x45d056=_0xfe33[_0x41d552];return _0x45d056;};'use strict';var _=require('lodash');var uuid=require('uuid');var util=require('./util');var logger=require(_0x3fe3('0x0'))('routing');var Agent=function(_0x18d98e,_0x149423,_0x18d0f9,_0x41cbcd){this['notificationId']=uuid['v4']();this[_0x3fe3('0x1')]=_0x18d98e;this[_0x3fe3('0x2')]=_0x149423;this[_0x3fe3('0x3')]=_0x18d0f9;this[_0x3fe3('0x4')]=_0x41cbcd;this[_0x3fe3('0x1')][_0x3fe3('0x5')](this[_0x3fe3('0x6')][_0x3fe3('0x7')](this),this['handleTimeout'][_0x3fe3('0x7')](this));this[_0x3fe3('0x1')]['on'](_0x3fe3('0x8'),this[_0x3fe3('0x9')][_0x3fe3('0x7')](this));this['squeue']['on'](_0x3fe3('0xa'),this['handleDrained']['bind'](this));};Agent[_0x3fe3('0xb')]['push']=function(){this['squeue'][_0x3fe3('0x5')](this[_0x3fe3('0x6')][_0x3fe3('0x7')](this),this['handleTimeout'][_0x3fe3('0x7')](this));};Agent[_0x3fe3('0xb')][_0x3fe3('0xc')]=function(){this[_0x3fe3('0x9')](!![]);};Agent['prototype'][_0x3fe3('0x6')]=function(_0x224ab7){logger[_0x3fe3('0xd')](_0x3fe3('0xe'),this['squeue']['id'],this[_0x3fe3('0x2')]['id']);if(_[_0x3fe3('0xf')](this[_0x3fe3('0x3')][_0x3fe3('0x10')][this[_0x3fe3('0x2')]['id']])){logger[_0x3fe3('0xd')](_0x3fe3('0x11'),this[_0x3fe3('0x1')]['id'],this[_0x3fe3('0x2')]['id']);setTimeout(this[_0x3fe3('0x5')][_0x3fe3('0x7')](this),0x3e8);}else{if(this[_0x3fe3('0x4')][_0x3fe3('0x12')]||util['isAgentAvailable'](this[_0x3fe3('0x1')]['id'],this['realtime']['agents'][this[_0x3fe3('0x2')]['id']],this[_0x3fe3('0x1')][_0x3fe3('0x13')],![])){this[_0x3fe3('0x3')][_0x3fe3('0x10')][this[_0x3fe3('0x2')]['id']][_0x3fe3('0x14')]=!![];this[_0x3fe3('0x3')][_0x3fe3('0x10')][this[_0x3fe3('0x2')]['id']][_0x3fe3('0x15')]=undefined;util[_0x3fe3('0x16')](this[_0x3fe3('0x17')],this[_0x3fe3('0x1')]['id'],this[_0x3fe3('0x3')][_0x3fe3('0x10')][this[_0x3fe3('0x2')]['id']],null,this['routing']);util[_0x3fe3('0x18')](this[_0x3fe3('0x1')]['id'],this[_0x3fe3('0x3')][_0x3fe3('0x10')][this[_0x3fe3('0x2')]['id']],'RINGING'+(this[_0x3fe3('0x4')][_0x3fe3('0x12')]?_0x3fe3('0x19'):''));}else{logger[_0x3fe3('0xd')](_0x3fe3('0x1a'),this[_0x3fe3('0x1')]['id'],this[_0x3fe3('0x2')]['id']);setTimeout(this[_0x3fe3('0x5')][_0x3fe3('0x7')](this),0x3e8);}}};Agent[_0x3fe3('0xb')][_0x3fe3('0x9')]=function(_0x3832a2){if(_[_0x3fe3('0xf')](this[_0x3fe3('0x3')]['agents'][this[_0x3fe3('0x2')]['id']])){return logger[_0x3fe3('0xd')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],this[_0x3fe3('0x2')]['id']);}else{logger[_0x3fe3('0xd')](_0x3fe3('0x1b'),this[_0x3fe3('0x1')]['id'],this['agent']['id']);util[_0x3fe3('0x1c')](this[_0x3fe3('0x17')],this[_0x3fe3('0x1')]['id'],this[_0x3fe3('0x3')]['agents'][this['agent']['id']],null,this[_0x3fe3('0x4')]);this[_0x3fe3('0x3')][_0x3fe3('0x10')][this[_0x3fe3('0x2')]['id']][_0x3fe3('0x14')]=![];this['realtime'][_0x3fe3('0x10')][this[_0x3fe3('0x2')]['id']][_0x3fe3('0x15')]=undefined;util[_0x3fe3('0x18')](this[_0x3fe3('0x1')]['id'],this[_0x3fe3('0x3')][_0x3fe3('0x10')][this[_0x3fe3('0x2')]['id']],_0x3832a2?_0x3fe3('0x1d'):_0x3fe3('0x1e'));}if(!_0x3832a2){setTimeout(this[_0x3fe3('0x5')][_0x3fe3('0x7')](this),0x3e8);}};function agent(_0x4930f8,_0x11cf78,_0x87baf1,_0x45a409){return new Agent(_0x4930f8,_0x11cf78,_0x87baf1,_0x45a409);}module[_0x3fe3('0x1f')]=agent; \ No newline at end of file +var _0x0d14=['writeLog',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','STOP','TIMEOUT','uuid','./util','../../../../../config/logger','routing','squeue','agent','realtime','push','bind','handleTimeout','timeout','handleDrained','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','agents','channel','busy','busyQueue','showNotification'];(function(_0x594e11,_0x28f652){var _0x5418ad=function(_0x5dcfa7){while(--_0x5dcfa7){_0x594e11['push'](_0x594e11['shift']());}};_0x5418ad(++_0x28f652);}(_0x0d14,0x1e1));var _0x40d1=function(_0x42402,_0x546de4){_0x42402=_0x42402-0x0;var _0x4defbb=_0x0d14[_0x42402];return _0x4defbb;};'use strict';var _=require('lodash');var uuid=require(_0x40d1('0x0'));var util=require(_0x40d1('0x1'));var logger=require(_0x40d1('0x2'))(_0x40d1('0x3'));var Agent=function(_0x333b18,_0x563574,_0xe30a78,_0x5713bb){this['notificationId']=uuid['v4']();this[_0x40d1('0x4')]=_0x333b18;this[_0x40d1('0x5')]=_0x563574;this[_0x40d1('0x6')]=_0xe30a78;this[_0x40d1('0x3')]=_0x5713bb;this[_0x40d1('0x4')][_0x40d1('0x7')](this['handleRun'][_0x40d1('0x8')](this),this[_0x40d1('0x9')][_0x40d1('0x8')](this));this[_0x40d1('0x4')]['on'](_0x40d1('0xa'),this[_0x40d1('0x9')][_0x40d1('0x8')](this));this[_0x40d1('0x4')]['on']('drained',this[_0x40d1('0xb')]['bind'](this));};Agent[_0x40d1('0xc')]['push']=function(){this[_0x40d1('0x4')][_0x40d1('0x7')](this['handleRun'][_0x40d1('0x8')](this),this[_0x40d1('0x9')][_0x40d1('0x8')](this));};Agent['prototype'][_0x40d1('0xb')]=function(){this[_0x40d1('0x9')](!![]);};Agent[_0x40d1('0xc')]['handleRun']=function(_0x1be074){logger[_0x40d1('0xd')](_0x40d1('0xe'),this[_0x40d1('0x4')]['id'],this[_0x40d1('0x5')]['id']);if(_[_0x40d1('0xf')](this[_0x40d1('0x6')]['agents'][this[_0x40d1('0x5')]['id']])){logger[_0x40d1('0xd')](_0x40d1('0x10'),this[_0x40d1('0x4')]['id'],this['agent']['id']);setTimeout(this['push'][_0x40d1('0x8')](this),0x3e8);}else{if(this[_0x40d1('0x3')][_0x40d1('0x11')]||util['isAgentAvailable'](this[_0x40d1('0x4')]['id'],this[_0x40d1('0x6')][_0x40d1('0x12')][this[_0x40d1('0x5')]['id']],this[_0x40d1('0x4')][_0x40d1('0x13')],![])){this[_0x40d1('0x6')][_0x40d1('0x12')][this[_0x40d1('0x5')]['id']][_0x40d1('0x14')]=!![];this[_0x40d1('0x6')][_0x40d1('0x12')][this[_0x40d1('0x5')]['id']][_0x40d1('0x15')]=undefined;util[_0x40d1('0x16')](this['notificationId'],this['squeue']['id'],this[_0x40d1('0x6')][_0x40d1('0x12')][this[_0x40d1('0x5')]['id']],null,this[_0x40d1('0x3')]);util[_0x40d1('0x17')](this[_0x40d1('0x4')]['id'],this[_0x40d1('0x6')][_0x40d1('0x12')][this[_0x40d1('0x5')]['id']],'RINGING'+(this[_0x40d1('0x3')][_0x40d1('0x11')]?_0x40d1('0x18'):''));}else{logger[_0x40d1('0xd')](_0x40d1('0x19'),this[_0x40d1('0x4')]['id'],this[_0x40d1('0x5')]['id']);setTimeout(this[_0x40d1('0x7')][_0x40d1('0x8')](this),0x3e8);}}};Agent['prototype'][_0x40d1('0x9')]=function(_0x45caa4){if(_['isNil'](this[_0x40d1('0x6')][_0x40d1('0x12')][this[_0x40d1('0x5')]['id']])){return logger[_0x40d1('0xd')](_0x40d1('0x10'),this['squeue']['id'],this[_0x40d1('0x5')]['id']);}else{logger[_0x40d1('0xd')]('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0x40d1('0x4')]['id'],this[_0x40d1('0x5')]['id']);util['hideNotification'](this['notificationId'],this[_0x40d1('0x4')]['id'],this[_0x40d1('0x6')][_0x40d1('0x12')][this[_0x40d1('0x5')]['id']],null,this[_0x40d1('0x3')]);this[_0x40d1('0x6')]['agents'][this[_0x40d1('0x5')]['id']][_0x40d1('0x14')]=![];this['realtime'][_0x40d1('0x12')][this[_0x40d1('0x5')]['id']][_0x40d1('0x15')]=undefined;util['writeLog'](this[_0x40d1('0x4')]['id'],this[_0x40d1('0x6')][_0x40d1('0x12')][this[_0x40d1('0x5')]['id']],_0x45caa4?_0x40d1('0x1a'):_0x40d1('0x1b'));}if(!_0x45caa4){setTimeout(this[_0x40d1('0x7')][_0x40d1('0x8')](this),0x3e8);}};function agent(_0x5c6b56,_0x1835e1,_0x1c3623,_0x308b75){return new Agent(_0x5c6b56,_0x1835e1,_0x1c3623,_0x308b75);}module['exports']=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 baff939..5012963 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 _0xf2e0=['queue','realtime','push','bind','handleTimeout','timeout','drained','handleDrained','prototype','handleRun','isNil','Agents','length','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','agents','channel','writeLog','RINGING','busy','name','showNotification','notificationId','info','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','TIMEOUT','busyQueue','lodash','uuid','../../../../../config/logger','routing','squeue'];(function(_0xd39959,_0x302d09){var _0x1ff69c=function(_0x17c97f){while(--_0x17c97f){_0xd39959['push'](_0xd39959['shift']());}};_0x1ff69c(++_0x302d09);}(_0xf2e0,0xc7));var _0x0f2e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xf2e0[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x0f2e('0x0'));var uuid=require(_0x0f2e('0x1'));var util=require('./util');var logger=require(_0x0f2e('0x2'))(_0x0f2e('0x3'));var Beepall=function(_0x48b292,_0x3261d6,_0x8c11c7,_0x363be3){this['notificationId']=uuid['v4']();this[_0x0f2e('0x4')]=_0x48b292;this[_0x0f2e('0x5')]=_0x3261d6;this[_0x0f2e('0x6')]=_0x8c11c7;this['routing']=_0x363be3;this['squeue'][_0x0f2e('0x7')](this['handleRun'][_0x0f2e('0x8')](this),this[_0x0f2e('0x9')][_0x0f2e('0x8')](this));this['squeue']['on'](_0x0f2e('0xa'),this[_0x0f2e('0x9')][_0x0f2e('0x8')](this));this['squeue']['on'](_0x0f2e('0xb'),this[_0x0f2e('0xc')]['bind'](this));};Beepall[_0x0f2e('0xd')][_0x0f2e('0x7')]=function(){this[_0x0f2e('0x4')][_0x0f2e('0x7')](this[_0x0f2e('0xe')]['bind'](this),this['handleTimeout'][_0x0f2e('0x8')](this));};Beepall[_0x0f2e('0xd')][_0x0f2e('0xc')]=function(_0x2521a9){this[_0x0f2e('0x9')](!![]);};Beepall[_0x0f2e('0xd')][_0x0f2e('0xe')]=function(_0x418b1d){var _0x2b02df=!![];if(!_[_0x0f2e('0xf')](this[_0x0f2e('0x5')])&&!_[_0x0f2e('0xf')](this[_0x0f2e('0x5')][_0x0f2e('0x10')])&&this[_0x0f2e('0x5')][_0x0f2e('0x10')][_0x0f2e('0x11')]>0x0){for(var _0x2441bf=0x0,_0x3b1591;_0x2441bf0x0){for(var _0x4cf519=0x0,_0x49432f;_0x4cf5190x0&&_0x53640a[_0x37f339+_0x6953('0x25')]>=_0x53640a[_0x37f339+_0x6953('0x24')]){writeLog(_0x171dd8,_0x53640a,_0x37f339[_0x6953('0x26')]()+_0x6953('0x27'));return![];}}return!![];};exports['showNotification']=function(_0x3dd890,_0x3c1075,_0x527b9a,_0x3be82d,_0x4af39d){return sendNotification(!![],_0x3dd890,_0x3c1075,_0x527b9a,_0x3be82d,_0x4af39d);};exports[_0x6953('0x28')]=function(_0x3b1175,_0x426c7c,_0x4b0325,_0x131992,_0x3d7b04){return sendNotification(![],_0x3b1175,_0x426c7c,_0x4b0325,_0x131992,_0x3d7b04);};exports[_0x6953('0x29')]=writeLog; \ No newline at end of file +var _0x2a07=['socket.io-emitter','emit','format','name','user:save','\x20interaction','account','notificationSound','notificationShake','body','queue','getMustacheRender','notificationTemplate','msg','error','[%s][QUEUE]\x20%s','user:%s','notification:%s','remove','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','busy','BUSY','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','showNotification','hideNotification','writeLog','lodash','util','../utils','mustache','ioredis','../../../../../config/logger','routing','redis','defaults','localhost'];(function(_0x4f3ad9,_0x231bb8){var _0x1f9110=function(_0x4f7b8f){while(--_0x4f7b8f){_0x4f3ad9['push'](_0x4f3ad9['shift']());}};_0x1f9110(++_0x231bb8);}(_0x2a07,0x74));var _0x72a0=function(_0x49fb23,_0x5340d4){_0x49fb23=_0x49fb23-0x0;var _0x4ef27b=_0x2a07[_0x49fb23];return _0x4ef27b;};'use strict';var _=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var utils=require(_0x72a0('0x2'));var Mustache=require(_0x72a0('0x3'));var Redis=require(_0x72a0('0x4'));var config=require('../../../../../config/environment');var logger=require(_0x72a0('0x5'))(_0x72a0('0x6'));config[_0x72a0('0x7')]=_[_0x72a0('0x8')](config[_0x72a0('0x7')],{'host':_0x72a0('0x9'),'port':0x18eb});var io=require(_0x72a0('0xa'))(new Redis(config[_0x72a0('0x7')]));function emit(_0x193e3b,_0x287b06,_0x21c819){io['to'](_0x193e3b)[_0x72a0('0xb')](_0x287b06,_0x21c819);}function sendNotification(_0x22270e,_0x1d32e9,_0x55b3e9,_0x2bc45b,_0x5c1d1e,_0x169dc2){io['to'](util[_0x72a0('0xc')]('user:%s',_0x2bc45b[_0x72a0('0xd')]))[_0x72a0('0xb')](_0x72a0('0xe'),_0x2bc45b);var _0x44d7cf=_0x169dc2||{};var _0x975c27=_0x55b3e9['split']('.');var _0x130797={'uniqueid':_0x1d32e9,'channel':_0x975c27[0x0],'id':_0x975c27[0x1],'title':_0x975c27[0x0]+_0x72a0('0xf'),'interactionId':_0x975c27[0x2],'queue':_0x5c1d1e?_0x5c1d1e[_0x72a0('0xd')]:null,'sound':_0x44d7cf[_0x72a0('0x10')][_0x72a0('0x11')],'shake':_0x44d7cf[_0x72a0('0x10')][_0x72a0('0x12')]};try{if(!_0x44d7cf['body']){_0x44d7cf['body']={};}if(_0x5c1d1e){_0x44d7cf[_0x72a0('0x13')][_0x72a0('0x14')]=_0x5c1d1e;}else if(_0x44d7cf[_0x72a0('0x13')][_0x72a0('0x14')]){delete _0x44d7cf[_0x72a0('0x13')][_0x72a0('0x14')];}_0x130797['msg']=utils[_0x72a0('0x15')](_0x44d7cf[_0x72a0('0x10')][_0x72a0('0x16')],_0x44d7cf);}catch(_0xb7e22d){_0x130797[_0x72a0('0x17')]='I\x20can\x27t\x20render\x20your\x20template';logger[_0x72a0('0x18')](util[_0x72a0('0xc')](_0x72a0('0x19'),_0x1d32e9,_0xb7e22d['message']));}io['to'](util[_0x72a0('0xc')](_0x72a0('0x1a'),_0x2bc45b[_0x72a0('0xd')]))[_0x72a0('0xb')](util['format'](_0x72a0('0x1b'),_0x22270e?'save':_0x72a0('0x1c')),_0x130797);}function writeLog(_0x315413,_0xde058c,_0x5c7479){return logger[_0x72a0('0x1d')](util[_0x72a0('0xc')](_0x72a0('0x1e'),_0x315413,_0xde058c[_0x72a0('0xd')],_0x5c7479));}exports['isAgentAvailable']=function(_0x38a7ba,_0x390464,_0x1ddd54,_0x23b918){if(_0x390464[_0x72a0('0x1f')]){writeLog(_0x38a7ba,_0x390464,_0x72a0('0x20'));return![];}if(!_0x390464['online']){writeLog(_0x38a7ba,_0x390464,'OFFLINE');return![];}if(_0x390464[_0x1ddd54+_0x72a0('0x21')]){writeLog(_0x38a7ba,_0x390464,_0x72a0('0x22'));return![];}if(_0x23b918&&_0x390464[_0x72a0('0x23')](_0x1ddd54+_0x72a0('0x24'))&&_0x390464[_0x72a0('0x23')](_0x1ddd54+_0x72a0('0x25'))){if(_0x390464[_0x1ddd54+_0x72a0('0x24')]>0x0&&_0x390464[_0x1ddd54+_0x72a0('0x25')]>=_0x390464[_0x1ddd54+_0x72a0('0x24')]){writeLog(_0x38a7ba,_0x390464,_0x1ddd54[_0x72a0('0x26')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x72a0('0x27')]=function(_0x553641,_0xc22d18,_0x2928f6,_0x1773ea,_0x177a3a){return sendNotification(!![],_0x553641,_0xc22d18,_0x2928f6,_0x1773ea,_0x177a3a);};exports[_0x72a0('0x28')]=function(_0x12eda2,_0x23c96a,_0x916733,_0x4ba037,_0x41efc1){return sendNotification(![],_0x12eda2,_0x23c96a,_0x916733,_0x4ba037,_0x41efc1);};exports[_0x72a0('0x29')]=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 a05b7f8..2f4d9a0 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 _0x4a39=['trim','[%s][SYSTEM]\x20result\x20code:\x20%s','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','error','[%s][SYSTEM]\x20%s','isObject','stringify','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','validate','lodash','./utils','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','map','join','info','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s'];(function(_0x522849,_0x5bb926){var _0x41e090=function(_0x284757){while(--_0x284757){_0x522849['push'](_0x522849['shift']());}};_0x41e090(++_0x5bb926);}(_0x4a39,0x9b));var _0x94a3=function(_0x200766,_0x5114fa){_0x200766=_0x200766-0x0;var _0x8cc5d1=_0x4a39[_0x200766];return _0x8cc5d1;};'use strict';var schema=require(_0x94a3('0x0'));var sh=require('shelljs');var _=require(_0x94a3('0x1'));var utils=require(_0x94a3('0x2'));var logger=require('../../../../config/logger')(_0x94a3('0x3'));var system=schema({'command':{'type':'string','required':!![],'message':_0x94a3('0x4')}});exports[_0x94a3('0x5')]=function(_0x28b718,_0x1f8a5f){return function(_0x565fa3){try{var _0xd4e8bd={'command':_0x1f8a5f[0x0]};var _0x192137=system['validate'](_0xd4e8bd,{'typecast':!![]});if(_0x192137[_0x94a3('0x6')]){logger['error']('[%s][SYSTEM]\x20%s',_0x28b718,_[_0x94a3('0x7')](_0x192137,'message')[_0x94a3('0x8')](',\x20'));logger[_0x94a3('0x9')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x28b718);_0x565fa3[_0x94a3('0xa')]();}else{var _0x38a5e9=this;var _0x3569e3=utils[_0x94a3('0xb')](_0x1f8a5f[0x0],this);logger['info'](_0x94a3('0xc'),_0x28b718,_0x3569e3);sh['exec'](_[_0x94a3('0xd')](_0x3569e3),function(_0x458797,_0x53e39d){logger[_0x94a3('0x9')](_0x94a3('0xe'),_0x28b718,_0x458797);if(_0x458797==0x0){var _0x5e504e=_0x53e39d['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0x94a3('0xf')](_0x1f8a5f[0x1])||_[_0x94a3('0x10')](_0x1f8a5f[0x1])){logger[_0x94a3('0x9')](_0x94a3('0x11'),_0x28b718);_0x38a5e9['body'][_0x1f8a5f[0x1]]=_0x5e504e;}else{logger['info'](_0x94a3('0x12'),_0x28b718,_0x1f8a5f[0x1],_0x5e504e);_0x38a5e9['body'][_0x1f8a5f[0x1]]=_0x5e504e;}}_0x565fa3[_0x94a3('0xa')]();});}}catch(_0x4b61ab){logger[_0x94a3('0x13')](_0x94a3('0x14'),_0x28b718,_[_0x94a3('0x15')](_0x4b61ab)?JSON[_0x94a3('0x16')](_0x4b61ab):_0x4b61ab);logger[_0x94a3('0x9')](_0x94a3('0x17'),_0x28b718);_0x565fa3[_0x94a3('0xa')]();}};}; \ No newline at end of file +var _0xdbf9=['[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20result\x20code:\x20%s','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','validate','lodash','./utils','../../../../config/logger','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','map','message','join','info'];(function(_0x2e78e9,_0x42957c){var _0x35aad4=function(_0x360fa1){while(--_0x360fa1){_0x2e78e9['push'](_0x2e78e9['shift']());}};_0x35aad4(++_0x42957c);}(_0xdbf9,0x146));var _0x9dbf=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xdbf9[_0x2b10c6];return _0x3789d2;};'use strict';var schema=require(_0x9dbf('0x0'));var sh=require('shelljs');var _=require(_0x9dbf('0x1'));var utils=require(_0x9dbf('0x2'));var logger=require(_0x9dbf('0x3'))(_0x9dbf('0x4'));var system=schema({'command':{'type':'string','required':!![],'message':_0x9dbf('0x5')}});exports['consequence']=function(_0x210833,_0x358d41){return function(_0x420321){try{var _0x3be0e2={'command':_0x358d41[0x0]};var _0x5bd66c=system[_0x9dbf('0x0')](_0x3be0e2,{'typecast':!![]});if(_0x5bd66c['length']){logger['error']('[%s][SYSTEM]\x20%s',_0x210833,_[_0x9dbf('0x6')](_0x5bd66c,_0x9dbf('0x7'))[_0x9dbf('0x8')](',\x20'));logger[_0x9dbf('0x9')](_0x9dbf('0xa'),_0x210833);_0x420321[_0x9dbf('0xb')]();}else{var _0x478312=this;var _0x5f5bc1=utils[_0x9dbf('0xc')](_0x358d41[0x0],this);logger[_0x9dbf('0x9')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x210833,_0x5f5bc1);sh['exec'](_['trim'](_0x5f5bc1),function(_0x404916,_0x1edead){logger[_0x9dbf('0x9')](_0x9dbf('0xd'),_0x210833,_0x404916);if(_0x404916==0x0){var _0x462755=_0x1edead['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0x9dbf('0xe')](_0x358d41[0x1])||_[_0x9dbf('0xf')](_0x358d41[0x1])){logger['info'](_0x9dbf('0x10'),_0x210833);_0x478312[_0x9dbf('0x11')][_0x358d41[0x1]]=_0x462755;}else{logger['info'](_0x9dbf('0x12'),_0x210833,_0x358d41[0x1],_0x462755);_0x478312[_0x9dbf('0x11')][_0x358d41[0x1]]=_0x462755;}}_0x420321['next']();});}}catch(_0x1f65d2){logger['error']('[%s][SYSTEM]\x20%s',_0x210833,_[_0x9dbf('0x13')](_0x1f65d2)?JSON[_0x9dbf('0x14')](_0x1f65d2):_0x1f65d2);logger[_0x9dbf('0x9')](_0x9dbf('0xa'),_0x210833);_0x420321[_0x9dbf('0xb')]();}};}; \ 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 37f63b0..88d3875 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 _0xc3a1=['../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','[%s][TAG]\x20%s','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','channel','Interaction','addTags','interaction','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','error','stringify','finally','next','isObject','validate','lodash','../../rpc/openchannelInteraction','../../rpc/smsInteraction'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xc3a1,0x176));var _0x1c3a=function(_0x4cdd27,_0xed5396){_0x4cdd27=_0x4cdd27-0x0;var _0x3d8653=_0xc3a1[_0x4cdd27];return _0x3d8653;};'use strict';var schema=require(_0x1c3a('0x0'));var _=require(_0x1c3a('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x1c3a('0x2')),'smsInteraction':require(_0x1c3a('0x3')),'mailInteraction':require(_0x1c3a('0x4')),'faxInteraction':require(_0x1c3a('0x5')),'whatsappInteraction':require(_0x1c3a('0x6'))};var logger=require('../../../../config/logger')(_0x1c3a('0x7'));var tag=schema({'tag':{'type':_0x1c3a('0x8'),'required':!![],'message':_0x1c3a('0x9')}});exports[_0x1c3a('0xa')]=function(_0x2a0b09,_0x4a6c29,_0x2d89bf,_0x5ac9a4){return function(_0x32aa3d){try{var _0x12b772={'tag':_0x4a6c29[0x0]};var _0x48ac2d=tag[_0x1c3a('0x0')](_0x12b772,{'typecast':!![]});if(_0x48ac2d['length']){logger['error'](_0x1c3a('0xb'),_0x2a0b09,_['map'](_0x48ac2d,_0x1c3a('0xc'))[_0x1c3a('0xd')](',\x20'));logger[_0x1c3a('0xe')](_0x1c3a('0xf'),_0x2a0b09);_0x32aa3d['next']();}else{var _0x75cd87={'ids':[_0x4a6c29[0x0]]};if(rpc[_0x5ac9a4[_0x1c3a('0x10')]+'Interaction']){rpc[_0x5ac9a4[_0x1c3a('0x10')]+_0x1c3a('0x11')][_0x1c3a('0x12')](_0x5ac9a4[_0x1c3a('0x13')]['id'],_0x75cd87)['then'](function(_0x4b87cf){logger[_0x1c3a('0xe')](_0x1c3a('0x14'),_0x2a0b09,_0x4a6c29[0x1],_0x5ac9a4[_0x1c3a('0x10')],_0x5ac9a4[_0x1c3a('0x13')]['id']);})[_0x1c3a('0x15')](function(_0x10cc97){logger[_0x1c3a('0x16')]('[%s][TAG]\x20%s',_0x2a0b09,JSON[_0x1c3a('0x17')](_0x10cc97));logger[_0x1c3a('0xe')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x2a0b09);})[_0x1c3a('0x18')](function(){_0x32aa3d[_0x1c3a('0x19')]();});}}}catch(_0xd11755){logger[_0x1c3a('0x16')](_0x1c3a('0xb'),_0x2a0b09,_[_0x1c3a('0x1a')](_0xd11755)?JSON[_0x1c3a('0x17')](_0xd11755):_0xd11755);logger[_0x1c3a('0xe')](_0x1c3a('0xf'),_0x2a0b09);_0x32aa3d[_0x1c3a('0x19')]();}};}; \ No newline at end of file +var _0x825b=['validate','lodash','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','number','consequence','length','error','[%s][TAG]\x20%s','map','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','channel','Interaction','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','finally','next','stringify'];(function(_0x2ce9c3,_0x20a165){var _0x109b3a=function(_0xfd90e2){while(--_0xfd90e2){_0x2ce9c3['push'](_0x2ce9c3['shift']());}};_0x109b3a(++_0x20a165);}(_0x825b,0xfa));var _0xb825=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0x825b[_0x4b73a2];return _0x383c66;};'use strict';var schema=require(_0xb825('0x0'));var _=require(_0xb825('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xb825('0x2')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xb825('0x3')),'faxInteraction':require(_0xb825('0x4')),'whatsappInteraction':require(_0xb825('0x5'))};var logger=require('../../../../config/logger')('routing');var tag=schema({'tag':{'type':_0xb825('0x6'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0xb825('0x7')]=function(_0x3ed0a0,_0x5478ea,_0x2f0572,_0x32eebb){return function(_0x23c0c8){try{var _0x28a6a9={'tag':_0x5478ea[0x0]};var _0x2a08c7=tag['validate'](_0x28a6a9,{'typecast':!![]});if(_0x2a08c7[_0xb825('0x8')]){logger[_0xb825('0x9')](_0xb825('0xa'),_0x3ed0a0,_[_0xb825('0xb')](_0x2a08c7,'message')[_0xb825('0xc')](',\x20'));logger[_0xb825('0xd')](_0xb825('0xe'),_0x3ed0a0);_0x23c0c8['next']();}else{var _0x5769d9={'ids':[_0x5478ea[0x0]]};if(rpc[_0x32eebb[_0xb825('0xf')]+_0xb825('0x10')]){rpc[_0x32eebb[_0xb825('0xf')]+_0xb825('0x10')][_0xb825('0x11')](_0x32eebb[_0xb825('0x12')]['id'],_0x5769d9)[_0xb825('0x13')](function(_0x1ed879){logger[_0xb825('0xd')](_0xb825('0x14'),_0x3ed0a0,_0x5478ea[0x1],_0x32eebb[_0xb825('0xf')],_0x32eebb[_0xb825('0x12')]['id']);})[_0xb825('0x15')](function(_0xe87849){logger[_0xb825('0x9')](_0xb825('0xa'),_0x3ed0a0,JSON['stringify'](_0xe87849));logger[_0xb825('0xd')](_0xb825('0xe'),_0x3ed0a0);})[_0xb825('0x16')](function(){_0x23c0c8[_0xb825('0x17')]();});}}}catch(_0x2fd236){logger[_0xb825('0x9')](_0xb825('0xa'),_0x3ed0a0,_['isObject'](_0x2fd236)?JSON[_0xb825('0x18')](_0x2fd236):_0x2fd236);logger[_0xb825('0xd')](_0xb825('0xe'),_0x3ed0a0);_0x23c0c8[_0xb825('0x17')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tvox.js b/server/services/routing/server/applications/tvox.js index 13e9b45..bf88929 100644 --- a/server/services/routing/server/applications/tvox.js +++ b/server/services/routing/server/applications/tvox.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xad4d=['Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&data=','stringify','info','stop','catch','error','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','routing','replace','\x20-\x20','includes','push','urlOnAnswer','urlOnRing','jsonrpc','method','login','params','utf8','POST','application/json-rpc','then','result','logged'];(function(_0x126b76,_0x1e23e3){var _0x133124=function(_0x392117){while(--_0x392117){_0x126b76['push'](_0x126b76['shift']());}};_0x133124(++_0x1e23e3);}(_0xad4d,0x19f));var _0xdad4=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0xad4d[_0x4b7895];return _0x264180;};'use strict';var rp=require(_0xdad4('0x0'));var logger=require(_0xdad4('0x1'))(_0xdad4('0x2'));var _=require('lodash');var arr=[];exports['consequence']=function(_0x5641d7,_0x266d25){return function(_0x5bbb63){var _0x25dfe4=_0x266d25[0xa];var _0x183058=_0x266d25[0xb];var _0x24b456=_0x266d25[0xc];var _0x113871=_0x266d25[0xd];var _0x3f6f6f=_0x266d25[0xe];var _0x41a674=_0x266d25[0xf][_0xdad4('0x3')](/\n/g,_0xdad4('0x4'));var _0x2145d4=_0x266d25[0x10][_0xdad4('0x3')](/\n/g,'\x20');if(!arr[_0xdad4('0x5')](_0x183058)){arr[_0xdad4('0x6')](_0x183058);var _0x44b641=_0x266d25[0x3];var _0x19f812=_0x266d25[0x4];var _0x3d4b5d=_0x266d25[0x1];var _0x30157e=_0x266d25[0x0];var _0x68ce43={};_0x68ce43[_0xdad4('0x7')]=_0x266d25[0x8]+'?params='+_0x24b456+'|'+_0x25dfe4+'|'+_0x113871+'|'+_0x183058+'|'+_0x3f6f6f;_0x68ce43[_0xdad4('0x8')]=_0x266d25[0x7]+'?params='+_0x24b456+'|'+_0x25dfe4+'|'+_0x113871+'|'+_0x183058+'|'+_0x3f6f6f+'|'+_0x41a674+'|'+_0x2145d4;_0x68ce43['title']=_0x266d25[0x9];var _0x25003c={};_0x25003c[_0xdad4('0x9')]='2.0';_0x25003c[_0xdad4('0xa')]=_0xdad4('0xb');var _0x2b2068=[];_0x2b2068[_0xdad4('0x6')](_0x266d25[0x2]);_0x2b2068[_0xdad4('0x6')](_0x266d25[0x5]);_0x2b2068[_0xdad4('0x6')](_0x266d25[0x6]);_0x25003c[_0xdad4('0xc')]=_0x2b2068;_0x25003c['id']=0x1;var _0x4b85b6=JSON['stringify'](_0x25003c);var _0x265ac2={'encoding':_0xdad4('0xd'),'method':_0xdad4('0xe'),'timeout':0x2710,'url':_0x44b641,'headers':{'Content-Type':_0xdad4('0xf')},'body':_0x4b85b6};return rp(_0x265ac2)[_0xdad4('0x10')](function(_0x1f3132){const _0x1c62bf=JSON['parse'](_0x1f3132);if(!_0x1c62bf[_0xdad4('0x11')][_0xdad4('0x12')]){throw new Error(_0xdad4('0x13'));}var _0x3c695f=_0x183058;var _0x53394c=_0xdad4('0x14')+_0x3d4b5d+_0xdad4('0x15')+_0x30157e+'&sessionId='+_0x3c695f+_0xdad4('0x16')+JSON[_0xdad4('0x17')](_0x68ce43);var _0x50e2ac=_0x19f812+'?'+_0x53394c;return rp(_0x50e2ac);})[_0xdad4('0x10')](function(_0x27e103){logger[_0xdad4('0x18')]('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x5641d7,_0x27e103);_0x5bbb63[_0xdad4('0x19')]();})[_0xdad4('0x1a')](function(_0xf53dbc){logger[_0xdad4('0x1b')]('[%s][TVOX]\x20%s',_0x5641d7,_[_0xdad4('0x1c')](_0xf53dbc)?JSON[_0xdad4('0x17')](_0xf53dbc):_0xf53dbc);_0x5bbb63['stop']();});}else{logger[_0xdad4('0x18')](_0xdad4('0x1d'),_0x5641d7);_0x5bbb63[_0xdad4('0x1e')]();}};}; \ No newline at end of file +var _0x8ab9=['consequence','\x20-\x20','replace','includes','push','urlOnAnswer','?params=','urlOnRing','2.0','method','login','params','stringify','POST','application/json-rpc','then','parse','result','channelId=','&serviceId=','&sessionId=','info','stop','error','[%s][TVOX]\x20%s','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','lodash'];(function(_0x4e5552,_0x19ec4e){var _0x60a338=function(_0x40c70e){while(--_0x40c70e){_0x4e5552['push'](_0x4e5552['shift']());}};_0x60a338(++_0x19ec4e);}(_0x8ab9,0x1de));var _0x98ab=function(_0x3f7da9,_0x4db255){_0x3f7da9=_0x3f7da9-0x0;var _0x13d49e=_0x8ab9[_0x3f7da9];return _0x13d49e;};'use strict';var rp=require(_0x98ab('0x0'));var logger=require('../../../../config/logger')('routing');var _=require(_0x98ab('0x1'));var arr=[];exports[_0x98ab('0x2')]=function(_0x71ff54,_0x55956f){return function(_0x88a7bc){var _0x29a7af=_0x55956f[0xa];var _0x17adeb=_0x55956f[0xb];var _0xde6ac3=_0x55956f[0xc];var _0x3c8cb3=_0x55956f[0xd];var _0x3423ca=_0x55956f[0xe];var _0x43bef2=_0x55956f[0xf]['replace'](/\n/g,_0x98ab('0x3'));var _0x1c5705=_0x55956f[0x10][_0x98ab('0x4')](/\n/g,'\x20');if(!arr[_0x98ab('0x5')](_0x17adeb)){arr[_0x98ab('0x6')](_0x17adeb);var _0x34cb54=_0x55956f[0x3];var _0x51f044=_0x55956f[0x4];var _0x4cc98f=_0x55956f[0x1];var _0x3abb9c=_0x55956f[0x0];var _0x186cdd={};_0x186cdd[_0x98ab('0x7')]=_0x55956f[0x8]+_0x98ab('0x8')+_0xde6ac3+'|'+_0x29a7af+'|'+_0x3c8cb3+'|'+_0x17adeb+'|'+_0x3423ca;_0x186cdd[_0x98ab('0x9')]=_0x55956f[0x7]+'?params='+_0xde6ac3+'|'+_0x29a7af+'|'+_0x3c8cb3+'|'+_0x17adeb+'|'+_0x3423ca+'|'+_0x43bef2+'|'+_0x1c5705;_0x186cdd['title']=_0x55956f[0x9];var _0x4e8d8a={};_0x4e8d8a['jsonrpc']=_0x98ab('0xa');_0x4e8d8a[_0x98ab('0xb')]=_0x98ab('0xc');var _0x48b369=[];_0x48b369[_0x98ab('0x6')](_0x55956f[0x2]);_0x48b369['push'](_0x55956f[0x5]);_0x48b369[_0x98ab('0x6')](_0x55956f[0x6]);_0x4e8d8a[_0x98ab('0xd')]=_0x48b369;_0x4e8d8a['id']=0x1;var _0x4fdd4f=JSON[_0x98ab('0xe')](_0x4e8d8a);var _0x25f326={'encoding':'utf8','method':_0x98ab('0xf'),'timeout':0x2710,'url':_0x34cb54,'headers':{'Content-Type':_0x98ab('0x10')},'body':_0x4fdd4f};return rp(_0x25f326)[_0x98ab('0x11')](function(_0x3cb730){const _0x257918=JSON[_0x98ab('0x12')](_0x3cb730);if(!_0x257918[_0x98ab('0x13')]['logged']){throw new Error('Unable\x20to\x20login\x20with\x20TVox\x20application');}var _0x1a76d9=_0x17adeb;var _0x4c29df=_0x98ab('0x14')+_0x4cc98f+_0x98ab('0x15')+_0x3abb9c+_0x98ab('0x16')+_0x1a76d9+'&data='+JSON[_0x98ab('0xe')](_0x186cdd);var _0x23a371=_0x51f044+'?'+_0x4c29df;return rp(_0x23a371);})['then'](function(_0x3afee5){logger[_0x98ab('0x17')]('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x71ff54,_0x3afee5);_0x88a7bc[_0x98ab('0x18')]();})['catch'](function(_0x14b845){logger[_0x98ab('0x19')](_0x98ab('0x1a'),_0x71ff54,_[_0x98ab('0x1b')](_0x14b845)?JSON[_0x98ab('0xe')](_0x14b845):_0x14b845);_0x88a7bc[_0x98ab('0x18')]();});}else{logger[_0x98ab('0x17')](_0x98ab('0x1c'),_0x71ff54);_0x88a7bc[_0x98ab('0x1d')]();}};}; \ 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 b9cfffa..1de8876 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 _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0xeb7caf,_0x27e9e5){var _0x5ddca2=function(_0x574bd3){while(--_0x574bd3){_0xeb7caf['push'](_0xeb7caf['shift']());}};_0x5ddca2(++_0x27e9e5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'use strict';var Mustache=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'getMustacheRender':function(_0x5dd881,_0x550fbc){return Mustache[_0x0a9e('0x3')](_0x5dd881,_['merge'](_0x550fbc[_0x0a9e('0x4')],{'contact':_0x550fbc[_0x0a9e('0x5')],'message':_0x550fbc[_0x0a9e('0x6')],'account':_0x550fbc[_0x0a9e('0x7')],'interaction':_0x550fbc[_0x0a9e('0x8')],'list':_0x550fbc['list']}))||'';}}; \ No newline at end of file +var _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x25af4f,_0x4f6aa9){var _0xc87d41=function(_0x2d81cb){while(--_0x2d81cb){_0x25af4f['push'](_0x25af4f['shift']());}};_0xc87d41(++_0x4f6aa9);}(_0xe706,0xa3));var _0x6e70=function(_0x3fe966,_0x552df7){_0x3fe966=_0x3fe966-0x0;var _0x139983=_0xe706[_0x3fe966];return _0x139983;};'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 7fdb22f..d185d3c 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 _0x34e5=['join','app','.js','autoreply','appdata','split','mail','push','slice','dialogflow','dialogflowv2','amazonlex','TagId','tvox','getMustacheRender','account','ChatWebsiteId','ContactId','body','format','./interval','intervals','./applications/','consequence','info','Push\x20new\x20rule','on\x20interval','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','emit','complete','No\x20applications\x20to\x20execute','stack','agent','agents','busyQueue','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','busy','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','paused','mailQueues','waiting','openchannelQueues','smsQueues','faxQueues','whatsappQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','stringify','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','jayson/promise','bluebird','uuid','./applications/utils','../../../config/environment','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','IntervalId','isNil','Intervals','map','interval','listen','rules','channel','message','interaction','applications','length','existsSync'];(function(_0x22fa7e,_0x3fc5a3){var _0x20994a=function(_0xcf7a9a){while(--_0xcf7a9a){_0x22fa7e['push'](_0x22fa7e['shift']());}};_0x20994a(++_0x3fc5a3);}(_0x34e5,0x172));var _0x534e=function(_0x3fe240,_0x219dd4){_0x3fe240=_0x3fe240-0x0;var _0x1be04a=_0x34e5[_0x3fe240];return _0x1be04a;};'use strict';var _=require('lodash');var util=require(_0x534e('0x0'));var path=require('path');var fs=require('fs');var jayson=require(_0x534e('0x1'));var BPromise=require(_0x534e('0x2'));var uuid=require(_0x534e('0x3'));var utils=require(_0x534e('0x4'));var config=require(_0x534e('0x5'));var logger=require('../../../config/logger')(_0x534e('0x6'));var rpc={'openchannelQueueReport':require(_0x534e('0x7')),'mailQueueReport':require(_0x534e('0x8')),'chatQueueReport':require(_0x534e('0x9')),'smsQueueReport':require(_0x534e('0xa')),'faxQueueReport':require(_0x534e('0xb')),'whatsappQueueReport':require(_0x534e('0xc'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x24d562,_0x929597,_0xa836bb){return util['format']('%s.%s.%s',_0x24d562,_0x929597||0x0,_0xa836bb||0x0);}function getIntervals(_0x2f44a1,_0x4c495c){var _0x3eb20c=[];if(!_['isNil'](_0x4c495c[_0x534e('0xd')])&&!_[_0x534e('0xe')](_0x2f44a1[_0x4c495c[_0x534e('0xd')]])&&!_['isNil'](_0x2f44a1[_0x4c495c[_0x534e('0xd')]][_0x534e('0xf')])){_0x3eb20c=_[_0x534e('0x10')](_0x2f44a1[_0x4c495c[_0x534e('0xd')]][_0x534e('0xf')],'interval');}else if(!_[_0x534e('0xe')](_0x4c495c[_0x534e('0x11')])){_0x3eb20c=[_0x4c495c[_0x534e('0x11')]];}return _0x3eb20c;}exports[_0x534e('0x12')]=function(_0x359565){_0x359565[_0x534e('0x13')]={};return new BPromise(function(_0x3e1411,_0x17c068){var _0x536c9e={'Start':function(_0x5282cb){var _0x4171d6=this;return new Promise(function(_0x3940c3,_0x5bdae2){if(_0x5282cb){try{var _0x4eca13=[];var _0x2de9d0=getId(_0x5282cb[_0x534e('0x14')],_0x5282cb[_0x534e('0x15')]?_0x5282cb[_0x534e('0x15')]['id']:0x0,_0x5282cb[_0x534e('0x16')]?_0x5282cb[_0x534e('0x16')]['id']:0x0);if(_0x5282cb[_0x534e('0x17')]&&_['isArray'](_0x5282cb[_0x534e('0x17')])&&_0x5282cb[_0x534e('0x17')][_0x534e('0x18')]){for(var _0x1bef0a=0x0;_0x1bef0a<_0x5282cb[_0x534e('0x17')]['length'];_0x1bef0a+=0x1){var _0x3f1697=_0x5282cb[_0x534e('0x17')][_0x1bef0a];if(fs[_0x534e('0x19')](path[_0x534e('0x1a')](__dirname,_0x534e('0x17'),_0x3f1697[_0x534e('0x1b')]+_0x534e('0x1c')))){var _0x85188b=[];switch(_0x3f1697[_0x534e('0x1b')]['toLowerCase']()){case _0x534e('0x1d'):var _0x3f6bf5=_0x3f1697[_0x534e('0x1e')][_0x534e('0x1f')](',');if(_0x5282cb[_0x534e('0x14')]===_0x534e('0x20')){_0x85188b[_0x534e('0x21')](_0x3f6bf5[0x0]);_0x85188b[_0x534e('0x21')](_0x3f6bf5[0x1]);_0x85188b['push'](_0x3f6bf5[_0x534e('0x22')](0x2,_0x3f6bf5['length'])[_0x534e('0x1a')](','));}else{_0x85188b[_0x534e('0x21')](_0x3f6bf5[0x0]);_0x85188b[_0x534e('0x21')](_0x3f6bf5[_0x534e('0x22')](0x1,_0x3f6bf5[_0x534e('0x18')])['join'](','));}break;case _0x534e('0x23'):var _0x443f85=_0x3f1697['appdata']['split'](',');_0x85188b[_0x534e('0x21')](_0x443f85[0x0]);_0x85188b['push'](_0x443f85[0x1]);_0x85188b[_0x534e('0x21')](_0x443f85[_0x534e('0x22')](0x2,_0x443f85[_0x534e('0x18')])[_0x534e('0x1a')](','));break;case _0x534e('0x24'):var _0x42119b=_0x3f1697[_0x534e('0x1e')]['split'](',');_0x85188b['push'](_0x42119b[0x0]);_0x85188b[_0x534e('0x21')](_0x42119b[0x1]);_0x85188b[_0x534e('0x21')](_0x42119b[0x2]);_0x85188b[_0x534e('0x21')](_0x42119b[0x3]);_0x85188b[_0x534e('0x21')](_0x42119b[_0x534e('0x22')](0x4,_0x42119b[_0x534e('0x18')])[_0x534e('0x1a')](','));break;case _0x534e('0x25'):var _0x533d62=_0x3f1697[_0x534e('0x1e')][_0x534e('0x1f')](',');_0x85188b[_0x534e('0x21')](_0x533d62[0x0]);_0x85188b['push'](_0x533d62[0x1]);_0x85188b[_0x534e('0x21')](_0x533d62[0x2]);_0x85188b[_0x534e('0x21')](_0x533d62[0x3]);_0x85188b['push'](_0x533d62[_0x534e('0x22')](0x4,_0x533d62['length'])[_0x534e('0x1a')](','));break;case _0x534e('0x15'):_0x85188b[_0x534e('0x21')](_0x3f1697[_0x534e('0x1e')]);break;case'tag':_0x85188b[_0x534e('0x21')](_0x3f1697[_0x534e('0x26')]);_0x85188b['push'](_0x3f1697['appdata']);break;case _0x534e('0x27'):var _0x17baab=utils[_0x534e('0x28')](_0x5282cb[_0x534e('0x29')]['notificationTemplate'],_0x5282cb);var _0x348573=_0x3f1697['appdata'][_0x534e('0x1f')](',');_0x85188b['push'](_0x348573[0x0]);_0x85188b[_0x534e('0x21')](_0x348573[0x1]);_0x85188b[_0x534e('0x21')](_0x348573[0x2]);_0x85188b['push'](_0x348573[0x3]);_0x85188b[_0x534e('0x21')](_0x348573[0x4]);_0x85188b['push'](_0x348573[0x5]);_0x85188b['push'](_0x348573[0x6]);_0x85188b['push'](_0x348573[0x7]);_0x85188b['push'](_0x348573[0x8]);_0x85188b[_0x534e('0x21')](_0x348573[0x9]);_0x85188b['push'](_0x348573[0xa]);_0x85188b['push'](_0x5282cb[_0x534e('0x16')]['id']);_0x85188b[_0x534e('0x21')](_0x5282cb[_0x534e('0x15')]['id']);_0x85188b['push'](_0x3f1697[_0x534e('0x2a')]);_0x85188b[_0x534e('0x21')](_0x5282cb['interaction'][_0x534e('0x2b')]);_0x85188b['push'](_0x5282cb[_0x534e('0x2c')][_0x534e('0x2c')]);_0x85188b['push'](_0x17baab);break;default:_0x85188b=_[_0x534e('0xe')](_0x3f1697['appdata'])?[]:_0x3f1697[_0x534e('0x1e')][_0x534e('0x1f')](',');}var _0x1f483c={'id':util[_0x534e('0x2d')]('%s:%s:%s',_0x2de9d0,_0x3f1697['id'],_0x3f1697['app']),'condition':require(_0x534e('0x2e'))['condition'](_0x2de9d0,getIntervals(_0x359565[_0x534e('0x2f')],_0x3f1697),_0x359565),'consequence':require(_0x534e('0x30')+_0x3f1697[_0x534e('0x1b')])[_0x534e('0x31')](_0x2de9d0,_0x85188b,_0x359565,_0x5282cb),'p':_0x3f1697['priority']||0x0};logger[_0x534e('0x32')](_0x534e('0x33'),_0x1f483c['id'],_0x534e('0x34'),getIntervals(_0x359565['intervals'],_0x3f1697)[_0x534e('0x1a')]('\x20|\x20'));_0x4eca13[_0x534e('0x21')](_0x1f483c);}else{logger[_0x534e('0x35')](_0x534e('0x36'),path['join'](__dirname,_0x534e('0x17'),_0x3f1697[_0x534e('0x1b')]+_0x534e('0x1c')));}}_0x359565[_0x534e('0x13')][_0x2de9d0]=new RuleEngine(_0x4eca13);_0x359565[_0x534e('0x13')][_0x2de9d0][_0x534e('0x37')](_0x5282cb,function(_0x197ce2){logger['info'](_0x534e('0x38'),JSON['stringify'](_0x197ce2['matchPath']));if(_0x359565[_0x534e('0x13')][_0x2de9d0]){_0x359565[_0x534e('0x13')][_0x2de9d0][_0x534e('0x39')](_0x534e('0x3a'));}});return _0x3940c3({'code':0xc8,'message':_0x5282cb});}else{logger[_0x534e('0x32')](_0x534e('0x3b'));return _0x3940c3({'code':0xc8,'message':_0x5282cb});}}catch(_0x5ad69f){logger[_0x534e('0x35')](_0x5ad69f[_0x534e('0x3c')]);return _0x5bdae2(_0x4171d6[_0x534e('0x35')](0x1f4,_0x5ad69f));}}return _0x5bdae2('routing\x20is\x20empty');});},'AcceptMessage':function(_0x1f8d50){var _0x4c655b=this;return new Promise(function(_0x2057d0,_0x1bf3bf){if(_0x1f8d50[_0x534e('0x3d')]&&_0x1f8d50[_0x534e('0x3d')]['id']){if(_0x359565[_0x534e('0x3e')][_0x1f8d50[_0x534e('0x3d')]['id']]){_0x359565['agents'][_0x1f8d50[_0x534e('0x3d')]['id']]['busy']=![];_0x359565['agents'][_0x1f8d50[_0x534e('0x3d')]['id']][_0x534e('0x3f')]=undefined;}}if(_0x1f8d50[_0x534e('0x15')]&&_0x1f8d50[_0x534e('0x15')]['id']){try{var _0x1bc181=getId(_0x1f8d50[_0x534e('0x14')],_0x1f8d50[_0x534e('0x15')]?_0x1f8d50[_0x534e('0x15')]['id']:0x0,_0x1f8d50[_0x534e('0x16')]?_0x1f8d50['interaction']['id']:0x0);if(_0x359565[_0x534e('0x13')][_0x1bc181]){_0x359565[_0x534e('0x13')][_0x1bc181][_0x534e('0x39')](_0x534e('0x40'));if(rpc[_0x1f8d50['channel']+_0x534e('0x41')]){rpc[_0x1f8d50[_0x534e('0x14')]+_0x534e('0x41')][_0x534e('0x42')](_0x1bc181,{'UserId':_0x1f8d50[_0x534e('0x15')][_0x534e('0x43')]})[_0x534e('0x44')](function(_0x3f5046){logger[_0x534e('0x35')](_0x534e('0x45'));});}}return _0x2057d0({'code':0xc8,'message':_0x1f8d50});}catch(_0x1d9782){logger[_0x534e('0x35')](_0x1d9782['stack']);return _0x1bf3bf(_0x4c655b[_0x534e('0x35')](0x1f4,_0x1d9782));}}logger[_0x534e('0x35')]('message\x20is\x20empty');return _0x1bf3bf(_0x4c655b[_0x534e('0x35')](0x1f4,_0x534e('0x46')));});},'RejectMessage':function(_0xb32d74){var _0x4ef39f=this;return new Promise(function(_0x54ff49,_0x2d66b6){if(_0xb32d74[_0x534e('0x3d')]&&_0xb32d74[_0x534e('0x3d')]['id']){try{if(_0x359565[_0x534e('0x3e')][_0xb32d74[_0x534e('0x3d')]['id']]){_0x359565[_0x534e('0x3e')][_0xb32d74[_0x534e('0x3d')]['id']][_0x534e('0x47')]=![];_0x359565[_0x534e('0x3e')][_0xb32d74['agent']['id']]['busyQueue']=undefined;}return _0x54ff49({'code':0xc8,'message':_0xb32d74});}catch(_0x1aaa94){logger['error'](_0x1aaa94[_0x534e('0x3c')]);return _0x2d66b6(_0x4ef39f[_0x534e('0x35')](0x1f4,_0x1aaa94));}}logger[_0x534e('0x35')](_0x534e('0x46'));return _0x2d66b6(_0x4ef39f[_0x534e('0x35')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x2c42f2){var _0x2de255=this;return new Promise(function(_0x51f591,_0x5013e4){if(_0x2c42f2[_0x534e('0x14')]&&_0x2c42f2['interaction']&&_0x2c42f2['interaction']['id']){try{var _0x10ea1c=getId(_0x2c42f2[_0x534e('0x14')],_0x2c42f2[_0x534e('0x15')]?_0x2c42f2['message']['id']:0x0,_0x2c42f2[_0x534e('0x16')]?_0x2c42f2[_0x534e('0x16')]['id']:0x0);if(_0x359565['rules'][_0x10ea1c]){_0x359565['rules'][_0x10ea1c][_0x534e('0x39')](_0x534e('0x40'));}return _0x51f591({'code':0xc8,'message':_0x2c42f2});}catch(_0x5c01fd){logger['error'](_0x5c01fd[_0x534e('0x3c')]);return _0x5013e4(_0x2de255['error'](0x1f4,_0x5c01fd));}}logger['error']('message\x20is\x20empty');return _0x5013e4(_0x2de255[_0x534e('0x35')](0x1f4,_0x534e('0x46')));});},'AgentCapacity':function(_0x3ff648){var _0x21ad10=this;return new Promise(function(_0x2b2d02,_0x3db45a){if(_0x359565[_0x534e('0x3e')][_0x534e('0x48')](_0x3ff648['id'])){for(var _0x238a4c in _0x3ff648[_0x534e('0x49')]){if(_0x3ff648['capacity'][_0x534e('0x48')](_0x238a4c)){if(_0x359565[_0x534e('0x3e')][_0x3ff648['id']][_0x534e('0x48')](_0x238a4c+_0x534e('0x4a'))){_0x359565[_0x534e('0x3e')][_0x3ff648['id']][_0x238a4c+'CurrentCapacity']=parseInt(_0x3ff648[_0x534e('0x49')][_0x238a4c],0xa);}}}_0x359565['agents'][_0x3ff648['id']][_0x534e('0x4b')]();return _0x2b2d02({'code':0xc8,'message':_0x359565[_0x534e('0x3e')][_0x3ff648['id']]});}else{return _0x3db45a(_0x21ad10[_0x534e('0x35')](0x1f4,_0x534e('0x4c')));}});},'Agents':function(_0x581d5e){return new Promise(function(_0x81359d,_0x5b1301){var _0x33b44e=_[_0x534e('0x4d')](_0x359565[_0x534e('0x3e')]);_0x81359d({'count':_0x33b44e[_0x534e('0x18')],'rows':_0x33b44e});});},'ChatQueues':function(_0x2e43ae){return new Promise(function(_0x44dac6,_0x177c1e){var _0x35a0c6=[];for(var _0x5775e7 in _0x359565['chatQueues']){if(_0x359565[_0x534e('0x4e')][_0x534e('0x48')](_0x5775e7)){var _0x21a6f6=_0x359565['chatQueues'][_0x5775e7];var _0x26054b={'id':_0x21a6f6['id'],'available':_0x21a6f6[_0x534e('0x4f')],'loggedIn':_0x21a6f6[_0x534e('0x50')],'name':_0x21a6f6[_0x534e('0x51')],'paused':_0x21a6f6[_0x534e('0x52')],'waiting':_0x21a6f6['waiting']};_0x35a0c6[_0x534e('0x21')](_0x26054b);}}_0x44dac6({'count':_0x35a0c6[_0x534e('0x18')],'rows':_0x35a0c6});});},'MailQueues':function(_0x30b3e4){return new Promise(function(_0x49ae5c,_0x5e38fa){var _0x4e1012=[];for(var _0x3ae2eb in _0x359565['mailQueues']){if(_0x359565[_0x534e('0x53')][_0x534e('0x48')](_0x3ae2eb)){var _0x4cf77b=_0x359565['mailQueues'][_0x3ae2eb];var _0x5d8e52={'id':_0x4cf77b['id'],'available':_0x4cf77b[_0x534e('0x4f')],'loggedIn':_0x4cf77b[_0x534e('0x50')],'name':_0x4cf77b[_0x534e('0x51')],'paused':_0x4cf77b[_0x534e('0x52')],'waiting':_0x4cf77b[_0x534e('0x54')]};_0x4e1012['push'](_0x5d8e52);}}_0x49ae5c({'count':_0x4e1012[_0x534e('0x18')],'rows':_0x4e1012});});},'OpenchannelQueues':function(_0x582a1d){return new Promise(function(_0x36e114,_0x3122fa){var _0x40a5b4=[];for(var _0x532985 in _0x359565[_0x534e('0x55')]){if(_0x359565[_0x534e('0x55')][_0x534e('0x48')](_0x532985)){var _0x3b4d88=_0x359565['openchannelQueues'][_0x532985];var _0x34286f={'id':_0x3b4d88['id'],'available':_0x3b4d88['available'],'loggedIn':_0x3b4d88[_0x534e('0x50')],'name':_0x3b4d88[_0x534e('0x51')],'paused':_0x3b4d88['paused'],'waiting':_0x3b4d88[_0x534e('0x54')]};_0x40a5b4[_0x534e('0x21')](_0x34286f);}}_0x36e114({'count':_0x40a5b4[_0x534e('0x18')],'rows':_0x40a5b4});});},'SmsQueues':function(_0x2ff79c){return new Promise(function(_0x5401d6,_0x4800a1){var _0x17c986=[];for(var _0xb74ca5 in _0x359565[_0x534e('0x56')]){if(_0x359565[_0x534e('0x56')]['hasOwnProperty'](_0xb74ca5)){var _0xb0251a=_0x359565['smsQueues'][_0xb74ca5];var _0x721401={'id':_0xb0251a['id'],'available':_0xb0251a[_0x534e('0x4f')],'loggedIn':_0xb0251a[_0x534e('0x50')],'name':_0xb0251a[_0x534e('0x51')],'paused':_0xb0251a['paused'],'waiting':_0xb0251a[_0x534e('0x54')]};_0x17c986[_0x534e('0x21')](_0x721401);}}_0x5401d6({'count':_0x17c986[_0x534e('0x18')],'rows':_0x17c986});});},'FaxQueues':function(_0x5508f5){return new Promise(function(_0x2e9ed9,_0x48f1a0){var _0x4bfee7=[];for(var _0x73d2fd in _0x359565[_0x534e('0x57')]){if(_0x359565['faxQueues'][_0x534e('0x48')](_0x73d2fd)){var _0x1ae8d5=_0x359565[_0x534e('0x57')][_0x73d2fd];var _0x334154={'id':_0x1ae8d5['id'],'available':_0x1ae8d5[_0x534e('0x4f')],'loggedIn':_0x1ae8d5[_0x534e('0x50')],'name':_0x1ae8d5['name'],'paused':_0x1ae8d5[_0x534e('0x52')],'waiting':_0x1ae8d5[_0x534e('0x54')]};_0x4bfee7[_0x534e('0x21')](_0x334154);}}_0x2e9ed9({'count':_0x4bfee7[_0x534e('0x18')],'rows':_0x4bfee7});});},'WhatsappQueues':function(_0x64a9a7){return new Promise(function(_0x18e840,_0x589f8f){var _0x514272=[];for(var _0x39c646 in _0x359565[_0x534e('0x58')]){if(_0x359565['whatsappQueues']['hasOwnProperty'](_0x39c646)){var _0x2e1532=_0x359565[_0x534e('0x58')][_0x39c646];var _0x5363c2={'id':_0x2e1532['id'],'available':_0x2e1532[_0x534e('0x4f')],'loggedIn':_0x2e1532[_0x534e('0x50')],'name':_0x2e1532[_0x534e('0x51')],'paused':_0x2e1532[_0x534e('0x52')],'waiting':_0x2e1532[_0x534e('0x54')]};_0x514272[_0x534e('0x21')](_0x5363c2);}}_0x18e840({'count':_0x514272[_0x534e('0x18')],'rows':_0x514272});});},'ChatQueuesWaitingInteractions':function(_0x4cf84f){return new Promise(function(_0x4f75b8,_0x40bee9){var _0x1a3874=_[_0x534e('0x4d')](_0x359565['chatQueuesWaitingInteractions']);_0x4f75b8({'count':_0x1a3874[_0x534e('0x18')],'rows':_0x1a3874});});},'MailQueuesWaitingInteractions':function(_0xb2a129){return new Promise(function(_0x5e2a23,_0x5a5c01){var _0x36c242=_['values'](_0x359565[_0x534e('0x59')]);_0x5e2a23({'count':_0x36c242[_0x534e('0x18')],'rows':_0x36c242});});},'OpenchannelQueuesWaitingInteractions':function(_0x2ea686){return new Promise(function(_0x1bf210,_0x2c134c){var _0xbeca87=_[_0x534e('0x4d')](_0x359565[_0x534e('0x5a')]);_0x1bf210({'count':_0xbeca87['length'],'rows':_0xbeca87});});},'SmsQueuesWaitingInteractions':function(_0xb5cda0){return new Promise(function(_0x4d8608,_0x3ca746){var _0x2b6cec=_['values'](_0x359565['smsQueuesWaitingInteractions']);_0x4d8608({'count':_0x2b6cec['length'],'rows':_0x2b6cec});});},'FaxQueuesWaitingInteractions':function(_0x238438){return new Promise(function(_0x34e416,_0x5f2993){var _0x15281b=_[_0x534e('0x4d')](_0x359565[_0x534e('0x5b')]);_0x34e416({'count':_0x15281b['length'],'rows':_0x15281b});});},'WhatsappQueuesWaitingInteractions':function(_0x26523c){return new Promise(function(_0x2bb261,_0x5203d0){var _0x1368cb=_[_0x534e('0x4d')](_0x359565[_0x534e('0x5c')]);_0x2bb261({'count':_0x1368cb[_0x534e('0x18')],'rows':_0x1368cb});});}};var _0x1f8400=jayson[_0x534e('0x5d')](_0x536c9e)[_0x534e('0x5e')]();_0x1f8400['on'](_0x534e('0x35'),function(_0xc2f064){logger[_0x534e('0x35')](JSON[_0x534e('0x5f')](_0xc2f064));return _0x17c068(_0xc2f064);});_0x1f8400['listen'](0x232c,_0x534e('0x60'),function(){console['log'](_0x534e('0x61'),0x232c);return _0x3e1411(_0x534e('0x62')+0x232c);});});}; \ No newline at end of file +var _0xd547=['applications','existsSync','app','.js','toLowerCase','autoreply','mail','push','slice','join','dialogflow','appdata','split','tag','TagId','tvox','getMustacheRender','account','ChatWebsiteId','body','format','%s:%s:%s','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','matchPath','complete','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','emit','end','QueueReport','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','chatQueues','available','loggedIn','name','mailQueues','paused','openchannelQueues','waiting','smsQueues','faxQueues','whatsappQueues','mailQueuesWaitingInteractions','values','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','listen','127.0.0.1','log','path','jayson/promise','bluebird','uuid','../../../config/logger','../rpc/openchannelQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','%s.%s.%s','isNil','IntervalId','map','Intervals','interval','rules','channel','message','interaction','isArray','length'];(function(_0x3fae59,_0x3e750e){var _0x38e268=function(_0x525fed){while(--_0x525fed){_0x3fae59['push'](_0x3fae59['shift']());}};_0x38e268(++_0x3e750e);}(_0xd547,0x1c1));var _0x7d54=function(_0xf35bc1,_0x510803){_0xf35bc1=_0xf35bc1-0x0;var _0xa6b162=_0xd547[_0xf35bc1];return _0xa6b162;};'use strict';var _=require('lodash');var util=require('util');var path=require(_0x7d54('0x0'));var fs=require('fs');var jayson=require(_0x7d54('0x1'));var BPromise=require(_0x7d54('0x2'));var uuid=require(_0x7d54('0x3'));var utils=require('./applications/utils');var config=require('../../../config/environment');var logger=require(_0x7d54('0x4'))('routing');var rpc={'openchannelQueueReport':require(_0x7d54('0x5')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0x7d54('0x6')),'smsQueueReport':require(_0x7d54('0x7')),'faxQueueReport':require(_0x7d54('0x8')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require('../lib/rule-engine');function getId(_0x478f9b,_0xb224a9,_0x39885d){return util['format'](_0x7d54('0x9'),_0x478f9b,_0xb224a9||0x0,_0x39885d||0x0);}function getIntervals(_0x48b250,_0x2bede6){var _0x4d9dc3=[];if(!_[_0x7d54('0xa')](_0x2bede6['IntervalId'])&&!_[_0x7d54('0xa')](_0x48b250[_0x2bede6[_0x7d54('0xb')]])&&!_['isNil'](_0x48b250[_0x2bede6['IntervalId']]['Intervals'])){_0x4d9dc3=_[_0x7d54('0xc')](_0x48b250[_0x2bede6[_0x7d54('0xb')]][_0x7d54('0xd')],'interval');}else if(!_[_0x7d54('0xa')](_0x2bede6['interval'])){_0x4d9dc3=[_0x2bede6[_0x7d54('0xe')]];}return _0x4d9dc3;}exports['listen']=function(_0x11c94a){_0x11c94a[_0x7d54('0xf')]={};return new BPromise(function(_0x4bc96e,_0x268b0c){var _0x208b3c={'Start':function(_0x25b69c){var _0x5a6bec=this;return new Promise(function(_0x2b1b0f,_0x33a519){if(_0x25b69c){try{var _0x2b13d5=[];var _0x12c48d=getId(_0x25b69c[_0x7d54('0x10')],_0x25b69c[_0x7d54('0x11')]?_0x25b69c['message']['id']:0x0,_0x25b69c[_0x7d54('0x12')]?_0x25b69c[_0x7d54('0x12')]['id']:0x0);if(_0x25b69c['applications']&&_[_0x7d54('0x13')](_0x25b69c['applications'])&&_0x25b69c['applications'][_0x7d54('0x14')]){for(var _0x4138f1=0x0;_0x4138f1<_0x25b69c[_0x7d54('0x15')][_0x7d54('0x14')];_0x4138f1+=0x1){var _0x54e783=_0x25b69c[_0x7d54('0x15')][_0x4138f1];if(fs[_0x7d54('0x16')](path['join'](__dirname,_0x7d54('0x15'),_0x54e783[_0x7d54('0x17')]+_0x7d54('0x18')))){var _0x6cc88b=[];switch(_0x54e783[_0x7d54('0x17')][_0x7d54('0x19')]()){case _0x7d54('0x1a'):var _0x4f3a94=_0x54e783['appdata']['split'](',');if(_0x25b69c[_0x7d54('0x10')]===_0x7d54('0x1b')){_0x6cc88b['push'](_0x4f3a94[0x0]);_0x6cc88b[_0x7d54('0x1c')](_0x4f3a94[0x1]);_0x6cc88b[_0x7d54('0x1c')](_0x4f3a94[_0x7d54('0x1d')](0x2,_0x4f3a94[_0x7d54('0x14')])[_0x7d54('0x1e')](','));}else{_0x6cc88b[_0x7d54('0x1c')](_0x4f3a94[0x0]);_0x6cc88b[_0x7d54('0x1c')](_0x4f3a94[_0x7d54('0x1d')](0x1,_0x4f3a94['length'])[_0x7d54('0x1e')](','));}break;case _0x7d54('0x1f'):var _0x5117a4=_0x54e783['appdata']['split'](',');_0x6cc88b['push'](_0x5117a4[0x0]);_0x6cc88b[_0x7d54('0x1c')](_0x5117a4[0x1]);_0x6cc88b[_0x7d54('0x1c')](_0x5117a4['slice'](0x2,_0x5117a4[_0x7d54('0x14')])[_0x7d54('0x1e')](','));break;case'dialogflowv2':var _0x472032=_0x54e783[_0x7d54('0x20')][_0x7d54('0x21')](',');_0x6cc88b[_0x7d54('0x1c')](_0x472032[0x0]);_0x6cc88b[_0x7d54('0x1c')](_0x472032[0x1]);_0x6cc88b[_0x7d54('0x1c')](_0x472032[0x2]);_0x6cc88b[_0x7d54('0x1c')](_0x472032[0x3]);_0x6cc88b[_0x7d54('0x1c')](_0x472032['slice'](0x4,_0x472032[_0x7d54('0x14')])['join'](','));break;case'amazonlex':var _0x2602c2=_0x54e783[_0x7d54('0x20')]['split'](',');_0x6cc88b[_0x7d54('0x1c')](_0x2602c2[0x0]);_0x6cc88b[_0x7d54('0x1c')](_0x2602c2[0x1]);_0x6cc88b[_0x7d54('0x1c')](_0x2602c2[0x2]);_0x6cc88b[_0x7d54('0x1c')](_0x2602c2[0x3]);_0x6cc88b[_0x7d54('0x1c')](_0x2602c2[_0x7d54('0x1d')](0x4,_0x2602c2[_0x7d54('0x14')])['join'](','));break;case _0x7d54('0x11'):_0x6cc88b[_0x7d54('0x1c')](_0x54e783['appdata']);break;case _0x7d54('0x22'):_0x6cc88b[_0x7d54('0x1c')](_0x54e783[_0x7d54('0x23')]);_0x6cc88b['push'](_0x54e783[_0x7d54('0x20')]);break;case _0x7d54('0x24'):var _0x266d0d=utils[_0x7d54('0x25')](_0x25b69c[_0x7d54('0x26')]['notificationTemplate'],_0x25b69c);var _0x4560d9=_0x54e783[_0x7d54('0x20')]['split'](',');_0x6cc88b[_0x7d54('0x1c')](_0x4560d9[0x0]);_0x6cc88b[_0x7d54('0x1c')](_0x4560d9[0x1]);_0x6cc88b[_0x7d54('0x1c')](_0x4560d9[0x2]);_0x6cc88b[_0x7d54('0x1c')](_0x4560d9[0x3]);_0x6cc88b[_0x7d54('0x1c')](_0x4560d9[0x4]);_0x6cc88b[_0x7d54('0x1c')](_0x4560d9[0x5]);_0x6cc88b[_0x7d54('0x1c')](_0x4560d9[0x6]);_0x6cc88b[_0x7d54('0x1c')](_0x4560d9[0x7]);_0x6cc88b[_0x7d54('0x1c')](_0x4560d9[0x8]);_0x6cc88b[_0x7d54('0x1c')](_0x4560d9[0x9]);_0x6cc88b[_0x7d54('0x1c')](_0x4560d9[0xa]);_0x6cc88b[_0x7d54('0x1c')](_0x25b69c['interaction']['id']);_0x6cc88b['push'](_0x25b69c[_0x7d54('0x11')]['id']);_0x6cc88b[_0x7d54('0x1c')](_0x54e783[_0x7d54('0x27')]);_0x6cc88b[_0x7d54('0x1c')](_0x25b69c['interaction']['ContactId']);_0x6cc88b[_0x7d54('0x1c')](_0x25b69c['body'][_0x7d54('0x28')]);_0x6cc88b[_0x7d54('0x1c')](_0x266d0d);break;default:_0x6cc88b=_['isNil'](_0x54e783['appdata'])?[]:_0x54e783[_0x7d54('0x20')][_0x7d54('0x21')](',');}var _0x57203d={'id':util[_0x7d54('0x29')](_0x7d54('0x2a'),_0x12c48d,_0x54e783['id'],_0x54e783['app']),'condition':require('./interval')[_0x7d54('0x2b')](_0x12c48d,getIntervals(_0x11c94a[_0x7d54('0x2c')],_0x54e783),_0x11c94a),'consequence':require(_0x7d54('0x2d')+_0x54e783[_0x7d54('0x17')])[_0x7d54('0x2e')](_0x12c48d,_0x6cc88b,_0x11c94a,_0x25b69c),'p':_0x54e783[_0x7d54('0x2f')]||0x0};logger[_0x7d54('0x30')](_0x7d54('0x31'),_0x57203d['id'],_0x7d54('0x32'),getIntervals(_0x11c94a[_0x7d54('0x2c')],_0x54e783)[_0x7d54('0x1e')]('\x20|\x20'));_0x2b13d5['push'](_0x57203d);}else{logger[_0x7d54('0x33')](_0x7d54('0x34'),path[_0x7d54('0x1e')](__dirname,_0x7d54('0x15'),_0x54e783[_0x7d54('0x17')]+_0x7d54('0x18')));}}_0x11c94a[_0x7d54('0xf')][_0x12c48d]=new RuleEngine(_0x2b13d5);_0x11c94a['rules'][_0x12c48d][_0x7d54('0x35')](_0x25b69c,function(_0x588360){logger['info'](_0x7d54('0x36'),JSON[_0x7d54('0x37')](_0x588360[_0x7d54('0x38')]));if(_0x11c94a[_0x7d54('0xf')][_0x12c48d]){_0x11c94a[_0x7d54('0xf')][_0x12c48d]['emit'](_0x7d54('0x39'));}});return _0x2b1b0f({'code':0xc8,'message':_0x25b69c});}else{logger[_0x7d54('0x30')]('No\x20applications\x20to\x20execute');return _0x2b1b0f({'code':0xc8,'message':_0x25b69c});}}catch(_0x18ea23){logger[_0x7d54('0x33')](_0x18ea23[_0x7d54('0x3a')]);return _0x33a519(_0x5a6bec[_0x7d54('0x33')](0x1f4,_0x18ea23));}}return _0x33a519(_0x7d54('0x3b'));});},'AcceptMessage':function(_0x3d6f39){var _0x5a2fcb=this;return new Promise(function(_0x4b6cd6,_0x403f9d){if(_0x3d6f39[_0x7d54('0x3c')]&&_0x3d6f39[_0x7d54('0x3c')]['id']){if(_0x11c94a[_0x7d54('0x3d')][_0x3d6f39[_0x7d54('0x3c')]['id']]){_0x11c94a[_0x7d54('0x3d')][_0x3d6f39['agent']['id']][_0x7d54('0x3e')]=![];_0x11c94a[_0x7d54('0x3d')][_0x3d6f39[_0x7d54('0x3c')]['id']][_0x7d54('0x3f')]=undefined;}}if(_0x3d6f39[_0x7d54('0x11')]&&_0x3d6f39['message']['id']){try{var _0x39094a=getId(_0x3d6f39['channel'],_0x3d6f39[_0x7d54('0x11')]?_0x3d6f39['message']['id']:0x0,_0x3d6f39['interaction']?_0x3d6f39[_0x7d54('0x12')]['id']:0x0);if(_0x11c94a['rules'][_0x39094a]){_0x11c94a['rules'][_0x39094a][_0x7d54('0x40')](_0x7d54('0x41'));if(rpc[_0x3d6f39['channel']+_0x7d54('0x42')]){rpc[_0x3d6f39[_0x7d54('0x10')]+_0x7d54('0x42')]['update'](_0x39094a,{'UserId':_0x3d6f39[_0x7d54('0x11')]['UserId']})[_0x7d54('0x43')](function(_0x1692e9){logger[_0x7d54('0x33')](_0x7d54('0x44'));});}}return _0x4b6cd6({'code':0xc8,'message':_0x3d6f39});}catch(_0x53de17){logger['error'](_0x53de17[_0x7d54('0x3a')]);return _0x403f9d(_0x5a2fcb[_0x7d54('0x33')](0x1f4,_0x53de17));}}logger[_0x7d54('0x33')](_0x7d54('0x45'));return _0x403f9d(_0x5a2fcb[_0x7d54('0x33')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x326bdb){var _0x33604c=this;return new Promise(function(_0x532e6c,_0x2e3e08){if(_0x326bdb[_0x7d54('0x3c')]&&_0x326bdb[_0x7d54('0x3c')]['id']){try{if(_0x11c94a[_0x7d54('0x3d')][_0x326bdb[_0x7d54('0x3c')]['id']]){_0x11c94a[_0x7d54('0x3d')][_0x326bdb[_0x7d54('0x3c')]['id']][_0x7d54('0x3e')]=![];_0x11c94a['agents'][_0x326bdb[_0x7d54('0x3c')]['id']][_0x7d54('0x3f')]=undefined;}return _0x532e6c({'code':0xc8,'message':_0x326bdb});}catch(_0x2938ac){logger['error'](_0x2938ac[_0x7d54('0x3a')]);return _0x2e3e08(_0x33604c[_0x7d54('0x33')](0x1f4,_0x2938ac));}}logger[_0x7d54('0x33')](_0x7d54('0x45'));return _0x2e3e08(_0x33604c['error'](0x1f4,_0x7d54('0x45')));});},'AbandonInteraction':function(_0x238210){var _0xe9db27=this;return new Promise(function(_0x55ee74,_0x5be8d3){if(_0x238210['channel']&&_0x238210['interaction']&&_0x238210[_0x7d54('0x12')]['id']){try{var _0x369c4a=getId(_0x238210[_0x7d54('0x10')],_0x238210[_0x7d54('0x11')]?_0x238210[_0x7d54('0x11')]['id']:0x0,_0x238210['interaction']?_0x238210['interaction']['id']:0x0);if(_0x11c94a['rules'][_0x369c4a]){_0x11c94a['rules'][_0x369c4a][_0x7d54('0x40')]('end');}return _0x55ee74({'code':0xc8,'message':_0x238210});}catch(_0x36a82a){logger['error'](_0x36a82a[_0x7d54('0x3a')]);return _0x5be8d3(_0xe9db27['error'](0x1f4,_0x36a82a));}}logger[_0x7d54('0x33')](_0x7d54('0x45'));return _0x5be8d3(_0xe9db27['error'](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x519759){var _0x2b6dfb=this;return new Promise(function(_0x37bf9c,_0x4cccf1){if(_0x11c94a['agents'][_0x7d54('0x46')](_0x519759['id'])){for(var _0x21dcd7 in _0x519759[_0x7d54('0x47')]){if(_0x519759[_0x7d54('0x47')][_0x7d54('0x46')](_0x21dcd7)){if(_0x11c94a['agents'][_0x519759['id']][_0x7d54('0x46')](_0x21dcd7+'CurrentCapacity')){_0x11c94a['agents'][_0x519759['id']][_0x21dcd7+_0x7d54('0x48')]=parseInt(_0x519759[_0x7d54('0x47')][_0x21dcd7],0xa);}}}_0x11c94a[_0x7d54('0x3d')][_0x519759['id']][_0x7d54('0x49')]();return _0x37bf9c({'code':0xc8,'message':_0x11c94a[_0x7d54('0x3d')][_0x519759['id']]});}else{return _0x4cccf1(_0x2b6dfb['error'](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x580664){return new Promise(function(_0x5a3cdb,_0x45d5f3){var _0x1a04b9=_['values'](_0x11c94a[_0x7d54('0x3d')]);_0x5a3cdb({'count':_0x1a04b9[_0x7d54('0x14')],'rows':_0x1a04b9});});},'ChatQueues':function(_0x5e78cc){return new Promise(function(_0x4b5f6f,_0x2c0f39){var _0x2a1ffa=[];for(var _0x37ae5e in _0x11c94a[_0x7d54('0x4a')]){if(_0x11c94a['chatQueues'][_0x7d54('0x46')](_0x37ae5e)){var _0x247d06=_0x11c94a[_0x7d54('0x4a')][_0x37ae5e];var _0xf45231={'id':_0x247d06['id'],'available':_0x247d06[_0x7d54('0x4b')],'loggedIn':_0x247d06[_0x7d54('0x4c')],'name':_0x247d06[_0x7d54('0x4d')],'paused':_0x247d06['paused'],'waiting':_0x247d06['waiting']};_0x2a1ffa[_0x7d54('0x1c')](_0xf45231);}}_0x4b5f6f({'count':_0x2a1ffa['length'],'rows':_0x2a1ffa});});},'MailQueues':function(_0x770d4d){return new Promise(function(_0x37d990,_0xc2b893){var _0x1b97da=[];for(var _0x3f0bdc in _0x11c94a[_0x7d54('0x4e')]){if(_0x11c94a['mailQueues'][_0x7d54('0x46')](_0x3f0bdc)){var _0x3abd4e=_0x11c94a[_0x7d54('0x4e')][_0x3f0bdc];var _0x2c4485={'id':_0x3abd4e['id'],'available':_0x3abd4e[_0x7d54('0x4b')],'loggedIn':_0x3abd4e[_0x7d54('0x4c')],'name':_0x3abd4e[_0x7d54('0x4d')],'paused':_0x3abd4e[_0x7d54('0x4f')],'waiting':_0x3abd4e['waiting']};_0x1b97da[_0x7d54('0x1c')](_0x2c4485);}}_0x37d990({'count':_0x1b97da[_0x7d54('0x14')],'rows':_0x1b97da});});},'OpenchannelQueues':function(_0x5b916d){return new Promise(function(_0x20bb3b,_0x28c5a0){var _0x49b9ae=[];for(var _0x562ff1 in _0x11c94a[_0x7d54('0x50')]){if(_0x11c94a['openchannelQueues']['hasOwnProperty'](_0x562ff1)){var _0xb70943=_0x11c94a[_0x7d54('0x50')][_0x562ff1];var _0x26c0ef={'id':_0xb70943['id'],'available':_0xb70943[_0x7d54('0x4b')],'loggedIn':_0xb70943[_0x7d54('0x4c')],'name':_0xb70943['name'],'paused':_0xb70943[_0x7d54('0x4f')],'waiting':_0xb70943[_0x7d54('0x51')]};_0x49b9ae[_0x7d54('0x1c')](_0x26c0ef);}}_0x20bb3b({'count':_0x49b9ae['length'],'rows':_0x49b9ae});});},'SmsQueues':function(_0x52baf0){return new Promise(function(_0x5306b3,_0xfd6137){var _0x4abf96=[];for(var _0x4cd995 in _0x11c94a[_0x7d54('0x52')]){if(_0x11c94a[_0x7d54('0x52')][_0x7d54('0x46')](_0x4cd995)){var _0x3276d9=_0x11c94a[_0x7d54('0x52')][_0x4cd995];var _0x1d5734={'id':_0x3276d9['id'],'available':_0x3276d9[_0x7d54('0x4b')],'loggedIn':_0x3276d9[_0x7d54('0x4c')],'name':_0x3276d9[_0x7d54('0x4d')],'paused':_0x3276d9['paused'],'waiting':_0x3276d9[_0x7d54('0x51')]};_0x4abf96[_0x7d54('0x1c')](_0x1d5734);}}_0x5306b3({'count':_0x4abf96[_0x7d54('0x14')],'rows':_0x4abf96});});},'FaxQueues':function(_0x1d631d){return new Promise(function(_0x80f9f2,_0x526990){var _0x5622fa=[];for(var _0x35029f in _0x11c94a['faxQueues']){if(_0x11c94a[_0x7d54('0x53')][_0x7d54('0x46')](_0x35029f)){var _0xfc06d7=_0x11c94a[_0x7d54('0x53')][_0x35029f];var _0x1c0268={'id':_0xfc06d7['id'],'available':_0xfc06d7[_0x7d54('0x4b')],'loggedIn':_0xfc06d7[_0x7d54('0x4c')],'name':_0xfc06d7[_0x7d54('0x4d')],'paused':_0xfc06d7[_0x7d54('0x4f')],'waiting':_0xfc06d7[_0x7d54('0x51')]};_0x5622fa[_0x7d54('0x1c')](_0x1c0268);}}_0x80f9f2({'count':_0x5622fa[_0x7d54('0x14')],'rows':_0x5622fa});});},'WhatsappQueues':function(_0x5d6beb){return new Promise(function(_0x215d29,_0x7cbc02){var _0x38084e=[];for(var _0x4e4550 in _0x11c94a[_0x7d54('0x54')]){if(_0x11c94a[_0x7d54('0x54')][_0x7d54('0x46')](_0x4e4550)){var _0x509ce6=_0x11c94a[_0x7d54('0x54')][_0x4e4550];var _0x28cc6f={'id':_0x509ce6['id'],'available':_0x509ce6[_0x7d54('0x4b')],'loggedIn':_0x509ce6['loggedIn'],'name':_0x509ce6[_0x7d54('0x4d')],'paused':_0x509ce6[_0x7d54('0x4f')],'waiting':_0x509ce6['waiting']};_0x38084e['push'](_0x28cc6f);}}_0x215d29({'count':_0x38084e[_0x7d54('0x14')],'rows':_0x38084e});});},'ChatQueuesWaitingInteractions':function(_0x18d0e7){return new Promise(function(_0x1ae929,_0x901f7){var _0x11294c=_['values'](_0x11c94a['chatQueuesWaitingInteractions']);_0x1ae929({'count':_0x11294c[_0x7d54('0x14')],'rows':_0x11294c});});},'MailQueuesWaitingInteractions':function(_0x165910){return new Promise(function(_0x17b675,_0x12f82e){var _0x46a397=_['values'](_0x11c94a[_0x7d54('0x55')]);_0x17b675({'count':_0x46a397[_0x7d54('0x14')],'rows':_0x46a397});});},'OpenchannelQueuesWaitingInteractions':function(_0x286187){return new Promise(function(_0x14d32d,_0x57d9f3){var _0x1ee675=_[_0x7d54('0x56')](_0x11c94a[_0x7d54('0x57')]);_0x14d32d({'count':_0x1ee675[_0x7d54('0x14')],'rows':_0x1ee675});});},'SmsQueuesWaitingInteractions':function(_0x3bf887){return new Promise(function(_0x1654b2,_0x9bd346){var _0xa5a4ba=_[_0x7d54('0x56')](_0x11c94a[_0x7d54('0x58')]);_0x1654b2({'count':_0xa5a4ba['length'],'rows':_0xa5a4ba});});},'FaxQueuesWaitingInteractions':function(_0xaffef1){return new Promise(function(_0x3d4acf,_0x6a6fce){var _0x2afe98=_['values'](_0x11c94a['faxQueuesWaitingInteractions']);_0x3d4acf({'count':_0x2afe98[_0x7d54('0x14')],'rows':_0x2afe98});});},'WhatsappQueuesWaitingInteractions':function(_0x62ba1c){return new Promise(function(_0x3ce36d,_0x2a6f31){var _0x1a1560=_[_0x7d54('0x56')](_0x11c94a[_0x7d54('0x59')]);_0x3ce36d({'count':_0x1a1560['length'],'rows':_0x1a1560});});}};var _0x68d02c=jayson[_0x7d54('0x5a')](_0x208b3c)['http']();_0x68d02c['on'](_0x7d54('0x33'),function(_0x39329d){logger[_0x7d54('0x33')](JSON[_0x7d54('0x37')](_0x39329d));return _0x268b0c(_0x39329d);});_0x68d02c[_0x7d54('0x5b')](0x232c,_0x7d54('0x5c'),function(){console[_0x7d54('0x5d')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x4bc96e('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 09d823d..0ee1451 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 _0x0bc1=['../../../config/logger','routing','client','http','request','then','error','message','result','condition','rules','info','stop','length','push','Command','format','indexOf','true','[%s][INTERVAL]\x20%s','all','some','join','\x20|\x20','when','catch','[%s][INTERVAL]\x20%s\x20%s','stack','util','bluebird','jayson/promise','lodash'];(function(_0x5ade57,_0x3fe0a7){var _0x3a4fb5=function(_0x2fc4b2){while(--_0x2fc4b2){_0x5ade57['push'](_0x5ade57['shift']());}};_0x3a4fb5(++_0x3fe0a7);}(_0x0bc1,0xbc));var _0x10bc=function(_0x4561b5,_0x16fab1){_0x4561b5=_0x4561b5-0x0;var _0x966cdc=_0x0bc1[_0x4561b5];return _0x966cdc;};'use strict';var util=require(_0x10bc('0x0'));var BPromise=require(_0x10bc('0x1'));var jayson=require(_0x10bc('0x2'));var _=require(_0x10bc('0x3'));var logger=require(_0x10bc('0x4'))(_0x10bc('0x5'));var client=jayson[_0x10bc('0x6')][_0x10bc('0x7')]({'port':0x232a});function request(_0x1b9e53,_0x2b62be){return new BPromise(function(_0x2d6cfd,_0x495fff){return client[_0x10bc('0x8')](_0x1b9e53,_0x2b62be)[_0x10bc('0x9')](function(_0x4ed325){if(_0x4ed325['error']){return _0x495fff(_0x4ed325[_0x10bc('0xa')][_0x10bc('0xb')]);}else{return _0x2d6cfd(_0x4ed325[_0x10bc('0xc')]);}})['catch'](function(_0x49d5f9){return _0x495fff(_0x49d5f9);});});}exports[_0x10bc('0xd')]=function(_0x575b0a,_0x4c473e,_0x183ae2){return function(_0x42e422){if(_0x183ae2[_0x10bc('0xe')]&&!_0x183ae2['rules'][_0x575b0a]){logger[_0x10bc('0xf')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x575b0a);return _0x42e422[_0x10bc('0x10')]();}var _0x1d10b1=[];for(var _0x30311e=0x0;_0x30311e<_0x4c473e[_0x10bc('0x11')];_0x30311e+=0x1){_0x1d10b1[_0x10bc('0x12')](request(_0x10bc('0x13'),{'command':util[_0x10bc('0x14')]('iftime\x20%s',_0x4c473e[_0x30311e])})[_0x10bc('0x9')](function(_0x355c38){return _0x355c38&&_0x355c38['message']&&_0x355c38['message'][_0x10bc('0x15')](_0x10bc('0x16'))>=0x0?!![]:![];})['catch'](function(_0x44c456){logger[_0x10bc('0xa')](_0x10bc('0x17'),_0x575b0a,_0x4c473e[_0x30311e]);}));}BPromise[_0x10bc('0x18')](_0x1d10b1)[_0x10bc('0x9')](function(_0x372b55){var _0x438573=_[_0x10bc('0x19')](_0x372b55);logger[_0x10bc('0xf')]('[%s][INTERVAL]\x20%s\x20%s',_0x575b0a,_0x4c473e[_0x10bc('0x1a')](_0x10bc('0x1b')),_0x438573);_0x42e422[_0x10bc('0x1c')](_0x438573);})[_0x10bc('0x1d')](function(_0x52060e){console['log'](_0x52060e);logger[_0x10bc('0xa')](_0x10bc('0x1e'),_0x575b0a,_0x4c473e[_0x10bc('0x1a')]('\x20|\x20'),_0x52060e[_0x10bc('0x1f')]);_0x42e422[_0x10bc('0x10')]();});};}; \ No newline at end of file +var _0x56f6=['format','iftime\x20%s','then','indexOf','true','[%s][INTERVAL]\x20%s','all','some','join','when','log','[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','stack','util','jayson/promise','lodash','../../../config/logger','routing','client','http','request','error','message','result','catch','condition','rules','info','stop','length','push'];(function(_0x954b3a,_0x10a7c1){var _0x3a313e=function(_0x1070ad){while(--_0x1070ad){_0x954b3a['push'](_0x954b3a['shift']());}};_0x3a313e(++_0x10a7c1);}(_0x56f6,0x8e));var _0x656f=function(_0x434a7a,_0xd166b){_0x434a7a=_0x434a7a-0x0;var _0x49addb=_0x56f6[_0x434a7a];return _0x49addb;};'use strict';var util=require(_0x656f('0x0'));var BPromise=require('bluebird');var jayson=require(_0x656f('0x1'));var _=require(_0x656f('0x2'));var logger=require(_0x656f('0x3'))(_0x656f('0x4'));var client=jayson[_0x656f('0x5')][_0x656f('0x6')]({'port':0x232a});function request(_0x4aea03,_0x1dfa91){return new BPromise(function(_0x64b8e4,_0x38fa13){return client[_0x656f('0x7')](_0x4aea03,_0x1dfa91)['then'](function(_0x4bd03f){if(_0x4bd03f[_0x656f('0x8')]){return _0x38fa13(_0x4bd03f[_0x656f('0x8')][_0x656f('0x9')]);}else{return _0x64b8e4(_0x4bd03f[_0x656f('0xa')]);}})[_0x656f('0xb')](function(_0x2c15b7){return _0x38fa13(_0x2c15b7);});});}exports[_0x656f('0xc')]=function(_0x2f2d89,_0x4d45cc,_0x23c1a9){return function(_0x26bbf7){if(_0x23c1a9[_0x656f('0xd')]&&!_0x23c1a9[_0x656f('0xd')][_0x2f2d89]){logger[_0x656f('0xe')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x2f2d89);return _0x26bbf7[_0x656f('0xf')]();}var _0x4431d9=[];for(var _0x525b09=0x0;_0x525b09<_0x4d45cc[_0x656f('0x10')];_0x525b09+=0x1){_0x4431d9[_0x656f('0x11')](request('Command',{'command':util[_0x656f('0x12')](_0x656f('0x13'),_0x4d45cc[_0x525b09])})[_0x656f('0x14')](function(_0x3fd002){return _0x3fd002&&_0x3fd002[_0x656f('0x9')]&&_0x3fd002[_0x656f('0x9')][_0x656f('0x15')](_0x656f('0x16'))>=0x0?!![]:![];})[_0x656f('0xb')](function(_0x5d4515){logger['error'](_0x656f('0x17'),_0x2f2d89,_0x4d45cc[_0x525b09]);}));}BPromise[_0x656f('0x18')](_0x4431d9)[_0x656f('0x14')](function(_0x52d1db){var _0x533974=_[_0x656f('0x19')](_0x52d1db);logger[_0x656f('0xe')]('[%s][INTERVAL]\x20%s\x20%s',_0x2f2d89,_0x4d45cc[_0x656f('0x1a')]('\x20|\x20'),_0x533974);_0x26bbf7[_0x656f('0x1b')](_0x533974);})[_0x656f('0xb')](function(_0x740114){console[_0x656f('0x1c')](_0x740114);logger[_0x656f('0x8')](_0x656f('0x1d'),_0x2f2d89,_0x4d45cc[_0x656f('0x1a')](_0x656f('0x1e')),_0x740114[_0x656f('0x1f')]);_0x26bbf7[_0x656f('0xf')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 5dab0da..7054870 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 _0xa74f=['calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','type','agentacw','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','[%s][agents][agentcalled]','now','called','membername','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','agentringnoanswerAt','timeout','reason','holdtime','ringtime','talktime','push','queuecallerabandon','debug','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','agentconnect','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','forIn','answered_elsewhere','[%s][agents][agentconnect]','agentcomplete','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfertype','blind','origtransfereruniqueid','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','transfer','transferexten','transferuniqueid','transfereeuniqueid','calleridname','agentcalledAt','agententerreason','secondtransfererlinkedid','ATTENDED','secondtransfererexten','transfertargetuniqueid','[%s][agents][attendedtransfer]','[%s][agents][hangup]','cause','rejected','indexOf','splice','complete','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','queue'];(function(_0x1c3372,_0x15bceb){var _0x4732c6=function(_0x390afe){while(--_0x390afe){_0x1c3372['push'](_0x1c3372['shift']());}};_0x4732c6(++_0x15bceb);}(_0xa74f,0x9a));var _0xfa74=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xa74f[_0xa148b7];return _0x51efd3;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0xfa74('0x0'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x4c4c00,_0x4b5765){utils[_0xfa74('0x1')](util[_0xfa74('0x2')](_0xfa74('0x3'),_0x4c4c00[_0xfa74('0x4')],_0x4c4c00['channel'],_0x4c4c00[_0xfa74('0x5')],_0x4c4c00['membername'],_0x4c4c00['interface'],_0x4c4c00[_0xfa74('0x6')],_0x4c4c00[_0xfa74('0x7')],_0x4c4c00[_0xfa74('0x8')]));if(_0x4c4c00[_0xfa74('0x5')]){utils[_0xfa74('0x9')](_0x4c4c00[_0xfa74('0x5')])['then'](function(_0x32f55c){if(_0x32f55c){_0x4c4c00[_0xfa74('0xa')]=_0x32f55c[_0xfa74('0xa')];_0x4c4c00[_0xfa74('0xb')]=_0x4c4c00['agentcomplete']?_0x32f55c[_0xfa74('0xc')]:![];_0x4c4c00[_0xfa74('0xd')]=_0x4c4c00['agentacw']?_0x32f55c[_0xfa74('0xe')]:0x0;}utils[_0xfa74('0xf')](_0xfa74('0x10'),_0x4c4c00);});}else{utils[_0xfa74('0xf')]('CreateVoiceAgentReport',_0x4c4c00);}if(_0x4b5765){delete transfers[_0x4c4c00[_0xfa74('0x4')]];}else{delete agents[_0x4c4c00[_0xfa74('0x11')]];}}exports[_0xfa74('0x12')]=function(_0x278e8b){try{utils['debug'](util[_0xfa74('0x2')](_0xfa74('0x13'),_0x278e8b[_0xfa74('0x4')]),_0x278e8b);agents[_0x278e8b[_0xfa74('0x11')]]=_0x278e8b;agents[_0x278e8b[_0xfa74('0x11')]]['agentcalledAt']=utils[_0xfa74('0x14')]();agents[_0x278e8b[_0xfa74('0x11')]][_0xfa74('0x8')]=_0xfa74('0x15');agents[_0x278e8b[_0xfa74('0x11')]][_0xfa74('0x7')]=null;agents[_0x278e8b[_0xfa74('0x11')]]['connectedlinename']=null;utils[_0xfa74('0x1')](util[_0xfa74('0x2')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x278e8b['uniqueid'],agents[_0x278e8b[_0xfa74('0x11')]][_0xfa74('0x16')],_0x278e8b[_0xfa74('0x11')]));}catch(_0x5a863f){utils[_0xfa74('0x17')](util[_0xfa74('0x2')](_0xfa74('0x13'),_0x278e8b['uniqueid']),_0x5a863f);}};exports[_0xfa74('0x18')]=function(_0x302eb4){try{if(!_[_0xfa74('0x19')](agents[_0x302eb4['destuniqueid']])){utils['debug'](util[_0xfa74('0x2')](_0xfa74('0x1a'),_0x302eb4[_0xfa74('0x4')]),_0x302eb4);utils[_0xfa74('0x1')](util[_0xfa74('0x2')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x302eb4['uniqueid'],agents[_0x302eb4[_0xfa74('0x11')]]['membername'],_0x302eb4['destuniqueid']));agents[_0x302eb4['destuniqueid']][_0xfa74('0x18')]=!![];agents[_0x302eb4[_0xfa74('0x11')]][_0xfa74('0x1b')]=utils['now']();agents[_0x302eb4['destuniqueid']][_0xfa74('0x8')]=_0xfa74('0x1c');agents[_0x302eb4['destuniqueid']][_0xfa74('0x1d')]='timeout';agents[_0x302eb4[_0xfa74('0x11')]][_0xfa74('0x1e')]=_0x302eb4['ringtime']?parseInt(_0x302eb4[_0xfa74('0x1f')])/0x3e8:0x0;agents[_0x302eb4[_0xfa74('0x11')]][_0xfa74('0x20')]=0x0;unanswered[_0xfa74('0x21')](_0x302eb4['destuniqueid']);}}catch(_0xd9c55d){utils[_0xfa74('0x17')](util[_0xfa74('0x2')]('[%s][agents][agentringnoanswer]',_0x302eb4['uniqueid']),_0xd9c55d);}};exports[_0xfa74('0x22')]=function(_0x8b706e){try{_['forIn'](agents,function(_0x4b38fc,_0x343466){if(_0x4b38fc['uniqueid']==_0x8b706e[_0xfa74('0x4')]&&!_['includes'](unanswered,_0x4b38fc[_0xfa74('0x11')])){utils[_0xfa74('0x23')](util[_0xfa74('0x2')](_0xfa74('0x24'),_0x8b706e['uniqueid']),_0x8b706e);utils[_0xfa74('0x1')](util[_0xfa74('0x2')](_0xfa74('0x25'),_0x8b706e[_0xfa74('0x4')],_0x4b38fc[_0xfa74('0x16')],_0x4b38fc[_0xfa74('0x11')]));_0x4b38fc[_0xfa74('0x18')]=!![];_0x4b38fc['agentringnoanswerAt']=utils[_0xfa74('0x14')]();_0x4b38fc['lastevent']=_0xfa74('0x26');_0x4b38fc[_0xfa74('0x1d')]=_0xfa74('0x26');_0x4b38fc[_0xfa74('0x1e')]=_0x8b706e['holdtime'];_0x4b38fc['talktime']=0x0;writeDB(_0x4b38fc);}});}catch(_0x390ed4){utils[_0xfa74('0x17')](util[_0xfa74('0x2')](_0xfa74('0x24'),_0x8b706e['uniqueid']),_0x390ed4);}};exports[_0xfa74('0x27')]=function(_0x231698){try{if(agents[_0x231698['destuniqueid']]){utils['debug'](util['format']('[%s][agents][agentconnect]',_0x231698['uniqueid']),_0x231698);utils[_0xfa74('0x1')](util[_0xfa74('0x2')](_0xfa74('0x28'),_0x231698[_0xfa74('0x4')],agents[_0x231698[_0xfa74('0x11')]][_0xfa74('0x16')],_0x231698[_0xfa74('0x11')]));agents[_0x231698[_0xfa74('0x11')]][_0xfa74('0x29')]=utils['now']();agents[_0x231698[_0xfa74('0x11')]][_0xfa74('0x7')]=_0x231698[_0xfa74('0x7')];agents[_0x231698[_0xfa74('0x11')]][_0xfa74('0x2a')]=_0x231698[_0xfa74('0x2a')];agents[_0x231698['destuniqueid']][_0xfa74('0x1e')]=_0x231698[_0xfa74('0x1f')];agents[_0x231698[_0xfa74('0x11')]][_0xfa74('0x8')]='connect';_[_0xfa74('0x2b')](agents,function(_0x13d9a5,_0xe8491b){if(_0x13d9a5[_0xfa74('0x11')]!=_0x231698['destuniqueid']&&_0x13d9a5[_0xfa74('0x4')]==_0x231698[_0xfa74('0x4')]){_0x13d9a5[_0xfa74('0x20')]=0x0;_0x13d9a5['holdtime']=_0x231698['ringtime'];_0x13d9a5[_0xfa74('0x18')]=!![];_0x13d9a5[_0xfa74('0x1b')]=utils[_0xfa74('0x14')]();_0x13d9a5[_0xfa74('0x8')]='answered_elsewhere';_0x13d9a5[_0xfa74('0x1d')]=_0xfa74('0x2c');_0x13d9a5['answeredelsewheredestinationuniqueid']=_0x231698['destuniqueid'];_0x13d9a5['answeredelsewheremembername']=_0x231698['membername'];writeDB(_0x13d9a5);}});}}catch(_0x95c891){utils[_0xfa74('0x17')](util[_0xfa74('0x2')](_0xfa74('0x2d'),_0x231698[_0xfa74('0x4')]),_0x95c891);}};exports[_0xfa74('0x2e')]=function(_0x7735c5){try{if(!_['isNil'](agents[_0x7735c5[_0xfa74('0x11')]])){utils[_0xfa74('0x23')](util[_0xfa74('0x2')](_0xfa74('0x2f'),_0x7735c5[_0xfa74('0x4')]),_0x7735c5);utils['info'](util[_0xfa74('0x2')](_0xfa74('0x30'),_0x7735c5[_0xfa74('0x4')],agents[_0x7735c5[_0xfa74('0x11')]][_0xfa74('0x16')],_0x7735c5[_0xfa74('0x11')]));agents[_0x7735c5[_0xfa74('0x11')]][_0xfa74('0x2e')]=!![];agents[_0x7735c5[_0xfa74('0x11')]][_0xfa74('0x31')]=utils['now']();agents[_0x7735c5[_0xfa74('0x11')]]['talktime']=utils[_0xfa74('0x32')](agents[_0x7735c5[_0xfa74('0x11')]][_0xfa74('0x31')],agents[_0x7735c5[_0xfa74('0x11')]]['agentconnectAt']);agents[_0x7735c5[_0xfa74('0x11')]][_0xfa74('0x1d')]=_0x7735c5['reason'];agents[_0x7735c5[_0xfa74('0x11')]][_0xfa74('0x8')]='complete';writeDB(agents[_0x7735c5[_0xfa74('0x11')]]);}}catch(_0x134d95){utils[_0xfa74('0x17')](util[_0xfa74('0x2')](_0xfa74('0x2f'),_0x7735c5['uniqueid']),_0x134d95);}};exports['blindtransfer']=function(_0x36f6ca){try{if(!_[_0xfa74('0x19')](agents[_0x36f6ca['transfereruniqueid']])){utils[_0xfa74('0x23')](util[_0xfa74('0x2')](_0xfa74('0x33'),_0x36f6ca['uniqueid']),_0x36f6ca);utils['info'](util[_0xfa74('0x2')](_0xfa74('0x34'),_0x36f6ca[_0xfa74('0x4')],agents[_0x36f6ca[_0xfa74('0x35')]][_0xfa74('0x16')],agents[_0x36f6ca[_0xfa74('0x35')]][_0xfa74('0x4')]));agents[_0x36f6ca[_0xfa74('0x35')]]['transfer']=!![];agents[_0x36f6ca[_0xfa74('0x35')]][_0xfa74('0x36')]=_0xfa74('0x37');agents[_0x36f6ca[_0xfa74('0x35')]]['transferexten']=_0x36f6ca['extension'];agents[_0x36f6ca[_0xfa74('0x35')]]['transferuniqueid']=agents[_0x36f6ca[_0xfa74('0x35')]][_0xfa74('0x4')];}}catch(_0x427469){utils[_0xfa74('0x17')](util[_0xfa74('0x2')](_0xfa74('0x33'),_0x36f6ca[_0xfa74('0x4')]),_0x427469);}};exports['attendedtransfer']=function(_0x118cfc){try{utils['debug'](util[_0xfa74('0x2')]('[%s][agents][attendedtransfer]',_0x118cfc['origtransfereruniqueid']),_0x118cfc);if(_0x118cfc[_0xfa74('0x38')]==_0x118cfc[_0xfa74('0x39')]){if(!_['isNil'](agents[_0x118cfc['secondtransfereruniqueid']])){utils[_0xfa74('0x1')](util[_0xfa74('0x2')](_0xfa74('0x3a'),_0x118cfc[_0xfa74('0x38')],agents[_0x118cfc[_0xfa74('0x3b')]][_0xfa74('0x16')]));agents[_0x118cfc[_0xfa74('0x3b')]][_0xfa74('0x3c')]=!![];agents[_0x118cfc[_0xfa74('0x3b')]][_0xfa74('0x36')]='ATTENDED';agents[_0x118cfc[_0xfa74('0x3b')]][_0xfa74('0x3d')]=_0x118cfc['origtransfererexten'];agents[_0x118cfc['secondtransfereruniqueid']][_0xfa74('0x3e')]=_0x118cfc[_0xfa74('0x38')];}if(_0x118cfc[_0xfa74('0x3f')]&&agents[_0x118cfc[_0xfa74('0x3f')]]){agents[_0x118cfc[_0xfa74('0x3f')]]['agententerreason']=0x1;transfers[_0x118cfc[_0xfa74('0x3f')]]=_['clone'](agents[_0x118cfc[_0xfa74('0x3f')]]);transfers[_0x118cfc[_0xfa74('0x3f')]][_0xfa74('0x6')]=agents[_0x118cfc['secondtransfereruniqueid']]['calleridnum'];transfers[_0x118cfc[_0xfa74('0x3f')]][_0xfa74('0x40')]=agents[_0x118cfc[_0xfa74('0x3b')]][_0xfa74('0x40')];transfers[_0x118cfc['transfereeuniqueid']][_0xfa74('0x41')]=utils[_0xfa74('0x14')]();transfers[_0x118cfc['transfereeuniqueid']][_0xfa74('0x29')]=utils[_0xfa74('0x14')]();transfers[_0x118cfc[_0xfa74('0x3f')]][_0xfa74('0x1e')]=0x0;transfers[_0x118cfc['transfereeuniqueid']][_0xfa74('0x42')]=0x2;}}else if(_0x118cfc['secondtransfereruniqueid']==_0x118cfc[_0xfa74('0x43')]){if(!_[_0xfa74('0x19')](agents[_0x118cfc[_0xfa74('0x38')]])){utils[_0xfa74('0x1')](util[_0xfa74('0x2')](_0xfa74('0x3a'),_0x118cfc[_0xfa74('0x38')],agents[_0x118cfc[_0xfa74('0x38')]][_0xfa74('0x16')]));agents[_0x118cfc[_0xfa74('0x38')]][_0xfa74('0x3c')]=!![];agents[_0x118cfc[_0xfa74('0x38')]][_0xfa74('0x36')]=_0xfa74('0x44');agents[_0x118cfc[_0xfa74('0x38')]]['transferexten']=_0x118cfc[_0xfa74('0x45')];agents[_0x118cfc[_0xfa74('0x38')]]['transferuniqueid']=_0x118cfc['secondtransfereruniqueid'];}if(_0x118cfc[_0xfa74('0x46')]&&agents[_0x118cfc['transfertargetuniqueid']]){agents[_0x118cfc[_0xfa74('0x46')]][_0xfa74('0x42')]=0x1;transfers[_0x118cfc[_0xfa74('0x46')]]=_['clone'](agents[_0x118cfc[_0xfa74('0x46')]]);transfers[_0x118cfc['transfertargetuniqueid']]['calleridnum']=agents[_0x118cfc[_0xfa74('0x38')]][_0xfa74('0x6')];transfers[_0x118cfc[_0xfa74('0x46')]][_0xfa74('0x40')]=agents[_0x118cfc[_0xfa74('0x38')]][_0xfa74('0x40')];transfers[_0x118cfc[_0xfa74('0x46')]][_0xfa74('0x41')]=utils[_0xfa74('0x14')]();transfers[_0x118cfc[_0xfa74('0x46')]][_0xfa74('0x29')]=utils['now']();transfers[_0x118cfc[_0xfa74('0x46')]]['holdtime']=0x0;transfers[_0x118cfc[_0xfa74('0x46')]][_0xfa74('0x42')]=0x2;}}}catch(_0x15b586){utils['error'](util[_0xfa74('0x2')](_0xfa74('0x47'),_0x118cfc[_0xfa74('0x38')]),_0x15b586);}};exports['hangup']=function(_0x1b8c06){try{utils[_0xfa74('0x23')](util[_0xfa74('0x2')](_0xfa74('0x48'),_0x1b8c06[_0xfa74('0x4')]),_0x1b8c06);if(agents[_0x1b8c06['uniqueid']]&&agents[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x1d')]===_0xfa74('0x1c')){if(_0x1b8c06[_0xfa74('0x49')]==='21'){agents[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x1d')]=_0xfa74('0x4a');agents[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x8')]=_0xfa74('0x4a');}utils[_0xfa74('0x1')](util[_0xfa74('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x1b8c06[_0xfa74('0x4')],agents[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x16')],agents[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x1d')],agents[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x8')]));writeDB(agents[_0x1b8c06[_0xfa74('0x4')]]);var _0x491529=unanswered[_0xfa74('0x4b')](_0x1b8c06[_0xfa74('0x4')]);if(_0x491529>-0x1){unanswered[_0xfa74('0x4c')](_0x491529,0x1);}}if(transfers[_0x1b8c06[_0xfa74('0x4')]]){transfers[_0x1b8c06['uniqueid']][_0xfa74('0x2e')]=!![];transfers[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x31')]=utils[_0xfa74('0x14')]();transfers[_0x1b8c06['uniqueid']][_0xfa74('0x20')]=utils['diffTime'](transfers[_0x1b8c06['uniqueid']][_0xfa74('0x31')],transfers[_0x1b8c06['uniqueid']][_0xfa74('0x29')]);transfers[_0x1b8c06[_0xfa74('0x4')]]['reason']='agent';transfers[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x8')]=_0xfa74('0x4d');utils[_0xfa74('0x1')](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x1b8c06['uniqueid'],transfers[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x16')],transfers[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x1d')],transfers[_0x1b8c06[_0xfa74('0x4')]]['lastevent']));writeDB(transfers[_0x1b8c06[_0xfa74('0x4')]],!![]);}if(agents[_0x1b8c06[_0xfa74('0x4')]]&&agents[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x29')]){agents[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x2e')]=!![];agents[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x31')]=utils[_0xfa74('0x14')]();agents[_0x1b8c06['uniqueid']]['talktime']=utils['diffTime'](agents[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x31')],agents[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x29')]);agents[_0x1b8c06[_0xfa74('0x4')]]['reason']=agents[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x3c')]?'transfer':_0xfa74('0x4e');agents[_0x1b8c06['uniqueid']][_0xfa74('0x8')]=_0xfa74('0x4d');utils[_0xfa74('0x1')](util[_0xfa74('0x2')](_0xfa74('0x4f'),_0x1b8c06[_0xfa74('0x4')],agents[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x16')],agents[_0x1b8c06['uniqueid']]['reason'],agents[_0x1b8c06['uniqueid']][_0xfa74('0x8')]));writeDB(agents[_0x1b8c06[_0xfa74('0x4')]]);}}catch(_0x4d46e1){utils[_0xfa74('0x17')](util[_0xfa74('0x2')](_0xfa74('0x48'),_0x1b8c06[_0xfa74('0x4')]),_0x4d46e1);}}; \ No newline at end of file +var _0x8f59=['transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','ATTENDED','origtransfererexten','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','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','interface','calleridnum','connectedlinenum','getVoiceQueueByName','then','type','agentacw','agentcomplete','acwtime','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','lastevent','called','connectedlinename','format','membername','error','agentringnoanswer','[%s][agents][agentringnoanswer]','agentringnoanswerAt','reason','holdtime','ringtime','talktime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','abandoned','agentconnect','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','answered_elsewhere','answeredelsewheredestinationuniqueid','[%s][agents][agentconnect]','isNil','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diffTime','agentcompleteAt','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]'];(function(_0x2d129c,_0x5115d8){var _0x324a33=function(_0x237f6e){while(--_0x237f6e){_0x2d129c['push'](_0x2d129c['shift']());}};_0x324a33(++_0x5115d8);}(_0x8f59,0x11d));var _0x98f5=function(_0x11e3b4,_0x321e0a){_0x11e3b4=_0x11e3b4-0x0;var _0x541588=_0x8f59[_0x11e3b4];return _0x541588;};'use strict';var _=require(_0x98f5('0x0'));var util=require(_0x98f5('0x1'));var utils=require(_0x98f5('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0xe809bb,_0x1d9fb3){utils[_0x98f5('0x3')](util['format'](_0x98f5('0x4'),_0xe809bb[_0x98f5('0x5')],_0xe809bb[_0x98f5('0x6')],_0xe809bb[_0x98f5('0x7')],_0xe809bb['membername'],_0xe809bb[_0x98f5('0x8')],_0xe809bb[_0x98f5('0x9')],_0xe809bb[_0x98f5('0xa')],_0xe809bb['lastevent']));if(_0xe809bb['queue']){utils[_0x98f5('0xb')](_0xe809bb[_0x98f5('0x7')])[_0x98f5('0xc')](function(_0x53493e){if(_0x53493e){_0xe809bb[_0x98f5('0xd')]=_0x53493e[_0x98f5('0xd')];_0xe809bb[_0x98f5('0xe')]=_0xe809bb[_0x98f5('0xf')]?_0x53493e['acw']:![];_0xe809bb[_0x98f5('0x10')]=_0xe809bb['agentacw']?_0x53493e['acwTimeout']:0x0;}utils[_0x98f5('0x11')](_0x98f5('0x12'),_0xe809bb);});}else{utils['request'](_0x98f5('0x12'),_0xe809bb);}if(_0x1d9fb3){delete transfers[_0xe809bb[_0x98f5('0x5')]];}else{delete agents[_0xe809bb[_0x98f5('0x13')]];}}exports[_0x98f5('0x14')]=function(_0x3286f7){try{utils[_0x98f5('0x15')](util['format'](_0x98f5('0x16'),_0x3286f7[_0x98f5('0x5')]),_0x3286f7);agents[_0x3286f7['destuniqueid']]=_0x3286f7;agents[_0x3286f7[_0x98f5('0x13')]][_0x98f5('0x17')]=utils[_0x98f5('0x18')]();agents[_0x3286f7['destuniqueid']][_0x98f5('0x19')]=_0x98f5('0x1a');agents[_0x3286f7[_0x98f5('0x13')]]['connectedlinenum']=null;agents[_0x3286f7[_0x98f5('0x13')]][_0x98f5('0x1b')]=null;utils['info'](util[_0x98f5('0x1c')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x3286f7[_0x98f5('0x5')],agents[_0x3286f7[_0x98f5('0x13')]][_0x98f5('0x1d')],_0x3286f7[_0x98f5('0x13')]));}catch(_0xd6f409){utils[_0x98f5('0x1e')](util['format'](_0x98f5('0x16'),_0x3286f7['uniqueid']),_0xd6f409);}};exports[_0x98f5('0x1f')]=function(_0x191f23){try{if(!_['isNil'](agents[_0x191f23[_0x98f5('0x13')]])){utils[_0x98f5('0x15')](util[_0x98f5('0x1c')](_0x98f5('0x20'),_0x191f23[_0x98f5('0x5')]),_0x191f23);utils[_0x98f5('0x3')](util[_0x98f5('0x1c')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x191f23[_0x98f5('0x5')],agents[_0x191f23['destuniqueid']][_0x98f5('0x1d')],_0x191f23['destuniqueid']));agents[_0x191f23[_0x98f5('0x13')]][_0x98f5('0x1f')]=!![];agents[_0x191f23[_0x98f5('0x13')]][_0x98f5('0x21')]=utils[_0x98f5('0x18')]();agents[_0x191f23[_0x98f5('0x13')]][_0x98f5('0x19')]='timeout';agents[_0x191f23[_0x98f5('0x13')]][_0x98f5('0x22')]='timeout';agents[_0x191f23[_0x98f5('0x13')]][_0x98f5('0x23')]=_0x191f23[_0x98f5('0x24')]?parseInt(_0x191f23[_0x98f5('0x24')])/0x3e8:0x0;agents[_0x191f23[_0x98f5('0x13')]][_0x98f5('0x25')]=0x0;unanswered[_0x98f5('0x26')](_0x191f23[_0x98f5('0x13')]);}}catch(_0x576c4b){utils['error'](util[_0x98f5('0x1c')](_0x98f5('0x20'),_0x191f23[_0x98f5('0x5')]),_0x576c4b);}};exports[_0x98f5('0x27')]=function(_0x15bf92){try{_[_0x98f5('0x28')](agents,function(_0x5e9d73,_0x29e1f5){if(_0x5e9d73[_0x98f5('0x5')]==_0x15bf92[_0x98f5('0x5')]&&!_[_0x98f5('0x29')](unanswered,_0x5e9d73[_0x98f5('0x13')])){utils[_0x98f5('0x15')](util['format'](_0x98f5('0x2a'),_0x15bf92[_0x98f5('0x5')]),_0x15bf92);utils[_0x98f5('0x3')](util[_0x98f5('0x1c')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x15bf92[_0x98f5('0x5')],_0x5e9d73[_0x98f5('0x1d')],_0x5e9d73[_0x98f5('0x13')]));_0x5e9d73[_0x98f5('0x1f')]=!![];_0x5e9d73[_0x98f5('0x21')]=utils[_0x98f5('0x18')]();_0x5e9d73[_0x98f5('0x19')]=_0x98f5('0x2b');_0x5e9d73[_0x98f5('0x22')]=_0x98f5('0x2b');_0x5e9d73[_0x98f5('0x23')]=_0x15bf92[_0x98f5('0x23')];_0x5e9d73[_0x98f5('0x25')]=0x0;writeDB(_0x5e9d73);}});}catch(_0xe4a944){utils[_0x98f5('0x1e')](util[_0x98f5('0x1c')](_0x98f5('0x2a'),_0x15bf92[_0x98f5('0x5')]),_0xe4a944);}};exports[_0x98f5('0x2c')]=function(_0x39d935){try{if(agents[_0x39d935['destuniqueid']]){utils[_0x98f5('0x15')](util['format']('[%s][agents][agentconnect]',_0x39d935[_0x98f5('0x5')]),_0x39d935);utils[_0x98f5('0x3')](util[_0x98f5('0x1c')](_0x98f5('0x2d'),_0x39d935['uniqueid'],agents[_0x39d935[_0x98f5('0x13')]][_0x98f5('0x1d')],_0x39d935[_0x98f5('0x13')]));agents[_0x39d935['destuniqueid']][_0x98f5('0x2e')]=utils[_0x98f5('0x18')]();agents[_0x39d935['destuniqueid']][_0x98f5('0xa')]=_0x39d935[_0x98f5('0xa')];agents[_0x39d935[_0x98f5('0x13')]]['connectedlinename']=_0x39d935[_0x98f5('0x1b')];agents[_0x39d935[_0x98f5('0x13')]][_0x98f5('0x23')]=_0x39d935[_0x98f5('0x24')];agents[_0x39d935[_0x98f5('0x13')]]['lastevent']='connect';_[_0x98f5('0x28')](agents,function(_0x14faf2,_0x33e6e2){if(_0x14faf2[_0x98f5('0x13')]!=_0x39d935[_0x98f5('0x13')]&&_0x14faf2[_0x98f5('0x5')]==_0x39d935['uniqueid']){_0x14faf2['talktime']=0x0;_0x14faf2[_0x98f5('0x23')]=_0x39d935[_0x98f5('0x24')];_0x14faf2[_0x98f5('0x1f')]=!![];_0x14faf2[_0x98f5('0x21')]=utils['now']();_0x14faf2['lastevent']=_0x98f5('0x2f');_0x14faf2[_0x98f5('0x22')]=_0x98f5('0x2f');_0x14faf2[_0x98f5('0x30')]=_0x39d935['destuniqueid'];_0x14faf2['answeredelsewheremembername']=_0x39d935[_0x98f5('0x1d')];writeDB(_0x14faf2);}});}}catch(_0x3a191f){utils[_0x98f5('0x1e')](util['format'](_0x98f5('0x31'),_0x39d935['uniqueid']),_0x3a191f);}};exports[_0x98f5('0xf')]=function(_0x4ff7b0){try{if(!_[_0x98f5('0x32')](agents[_0x4ff7b0[_0x98f5('0x13')]])){utils[_0x98f5('0x15')](util['format'](_0x98f5('0x33'),_0x4ff7b0[_0x98f5('0x5')]),_0x4ff7b0);utils['info'](util[_0x98f5('0x1c')](_0x98f5('0x34'),_0x4ff7b0['uniqueid'],agents[_0x4ff7b0[_0x98f5('0x13')]]['membername'],_0x4ff7b0[_0x98f5('0x13')]));agents[_0x4ff7b0[_0x98f5('0x13')]]['agentcomplete']=!![];agents[_0x4ff7b0['destuniqueid']]['agentcompleteAt']=utils['now']();agents[_0x4ff7b0[_0x98f5('0x13')]]['talktime']=utils[_0x98f5('0x35')](agents[_0x4ff7b0[_0x98f5('0x13')]][_0x98f5('0x36')],agents[_0x4ff7b0[_0x98f5('0x13')]][_0x98f5('0x2e')]);agents[_0x4ff7b0[_0x98f5('0x13')]]['reason']=_0x4ff7b0[_0x98f5('0x22')];agents[_0x4ff7b0[_0x98f5('0x13')]][_0x98f5('0x19')]=_0x98f5('0x37');writeDB(agents[_0x4ff7b0[_0x98f5('0x13')]]);}}catch(_0x459649){utils['error'](util[_0x98f5('0x1c')](_0x98f5('0x33'),_0x4ff7b0[_0x98f5('0x5')]),_0x459649);}};exports[_0x98f5('0x38')]=function(_0x4a0cda){try{if(!_[_0x98f5('0x32')](agents[_0x4a0cda[_0x98f5('0x39')]])){utils[_0x98f5('0x15')](util[_0x98f5('0x1c')](_0x98f5('0x3a'),_0x4a0cda['uniqueid']),_0x4a0cda);utils[_0x98f5('0x3')](util[_0x98f5('0x1c')]('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x4a0cda[_0x98f5('0x5')],agents[_0x4a0cda['transfereruniqueid']][_0x98f5('0x1d')],agents[_0x4a0cda['transfereruniqueid']][_0x98f5('0x5')]));agents[_0x4a0cda[_0x98f5('0x39')]][_0x98f5('0x3b')]=!![];agents[_0x4a0cda['transfereruniqueid']][_0x98f5('0x3c')]=_0x98f5('0x3d');agents[_0x4a0cda[_0x98f5('0x39')]][_0x98f5('0x3e')]=_0x4a0cda[_0x98f5('0x3f')];agents[_0x4a0cda[_0x98f5('0x39')]][_0x98f5('0x40')]=agents[_0x4a0cda[_0x98f5('0x39')]][_0x98f5('0x5')];}}catch(_0x2e48a1){utils[_0x98f5('0x1e')](util[_0x98f5('0x1c')](_0x98f5('0x3a'),_0x4a0cda[_0x98f5('0x5')]),_0x2e48a1);}};exports[_0x98f5('0x41')]=function(_0x1289a7){try{utils[_0x98f5('0x15')](util['format'](_0x98f5('0x42'),_0x1289a7[_0x98f5('0x43')]),_0x1289a7);if(_0x1289a7[_0x98f5('0x43')]==_0x1289a7[_0x98f5('0x44')]){if(!_[_0x98f5('0x32')](agents[_0x1289a7[_0x98f5('0x45')]])){utils['info'](util['format']('[%s][agents][attendedtransfer]\x20agent:%s',_0x1289a7[_0x98f5('0x43')],agents[_0x1289a7[_0x98f5('0x45')]][_0x98f5('0x1d')]));agents[_0x1289a7[_0x98f5('0x45')]]['transfer']=!![];agents[_0x1289a7[_0x98f5('0x45')]]['transfertype']=_0x98f5('0x46');agents[_0x1289a7['secondtransfereruniqueid']]['transferexten']=_0x1289a7[_0x98f5('0x47')];agents[_0x1289a7[_0x98f5('0x45')]][_0x98f5('0x40')]=_0x1289a7['origtransfereruniqueid'];}if(_0x1289a7['transfereeuniqueid']&&agents[_0x1289a7[_0x98f5('0x48')]]){agents[_0x1289a7[_0x98f5('0x48')]]['agententerreason']=0x1;transfers[_0x1289a7[_0x98f5('0x48')]]=_[_0x98f5('0x49')](agents[_0x1289a7['transfereeuniqueid']]);transfers[_0x1289a7[_0x98f5('0x48')]][_0x98f5('0x9')]=agents[_0x1289a7[_0x98f5('0x45')]]['calleridnum'];transfers[_0x1289a7[_0x98f5('0x48')]][_0x98f5('0x4a')]=agents[_0x1289a7[_0x98f5('0x45')]][_0x98f5('0x4a')];transfers[_0x1289a7[_0x98f5('0x48')]][_0x98f5('0x17')]=utils[_0x98f5('0x18')]();transfers[_0x1289a7['transfereeuniqueid']][_0x98f5('0x2e')]=utils[_0x98f5('0x18')]();transfers[_0x1289a7[_0x98f5('0x48')]]['holdtime']=0x0;transfers[_0x1289a7['transfereeuniqueid']][_0x98f5('0x4b')]=0x2;}}else if(_0x1289a7[_0x98f5('0x45')]==_0x1289a7['secondtransfererlinkedid']){if(!_['isNil'](agents[_0x1289a7['origtransfereruniqueid']])){utils['info'](util[_0x98f5('0x1c')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x1289a7[_0x98f5('0x43')],agents[_0x1289a7[_0x98f5('0x43')]][_0x98f5('0x1d')]));agents[_0x1289a7[_0x98f5('0x43')]][_0x98f5('0x3b')]=!![];agents[_0x1289a7[_0x98f5('0x43')]][_0x98f5('0x3c')]=_0x98f5('0x46');agents[_0x1289a7['origtransfereruniqueid']]['transferexten']=_0x1289a7[_0x98f5('0x4c')];agents[_0x1289a7['origtransfereruniqueid']][_0x98f5('0x40')]=_0x1289a7[_0x98f5('0x45')];}if(_0x1289a7[_0x98f5('0x4d')]&&agents[_0x1289a7['transfertargetuniqueid']]){agents[_0x1289a7[_0x98f5('0x4d')]]['agententerreason']=0x1;transfers[_0x1289a7['transfertargetuniqueid']]=_['clone'](agents[_0x1289a7[_0x98f5('0x4d')]]);transfers[_0x1289a7['transfertargetuniqueid']][_0x98f5('0x9')]=agents[_0x1289a7[_0x98f5('0x43')]][_0x98f5('0x9')];transfers[_0x1289a7['transfertargetuniqueid']]['calleridname']=agents[_0x1289a7['origtransfereruniqueid']][_0x98f5('0x4a')];transfers[_0x1289a7[_0x98f5('0x4d')]]['agentcalledAt']=utils['now']();transfers[_0x1289a7[_0x98f5('0x4d')]][_0x98f5('0x2e')]=utils[_0x98f5('0x18')]();transfers[_0x1289a7[_0x98f5('0x4d')]][_0x98f5('0x23')]=0x0;transfers[_0x1289a7[_0x98f5('0x4d')]][_0x98f5('0x4b')]=0x2;}}}catch(_0x1cc6e3){utils[_0x98f5('0x1e')](util['format'](_0x98f5('0x42'),_0x1289a7[_0x98f5('0x43')]),_0x1cc6e3);}};exports[_0x98f5('0x4e')]=function(_0xb64efb){try{utils['debug'](util[_0x98f5('0x1c')](_0x98f5('0x4f'),_0xb64efb[_0x98f5('0x5')]),_0xb64efb);if(agents[_0xb64efb['uniqueid']]&&agents[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0x22')]==='timeout'){if(_0xb64efb[_0x98f5('0x50')]==='21'){agents[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0x22')]='rejected';agents[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0x19')]=_0x98f5('0x51');}utils[_0x98f5('0x3')](util[_0x98f5('0x1c')](_0x98f5('0x52'),_0xb64efb[_0x98f5('0x5')],agents[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0x1d')],agents[_0xb64efb['uniqueid']][_0x98f5('0x22')],agents[_0xb64efb['uniqueid']][_0x98f5('0x19')]));writeDB(agents[_0xb64efb[_0x98f5('0x5')]]);var _0x3bb728=unanswered[_0x98f5('0x53')](_0xb64efb['uniqueid']);if(_0x3bb728>-0x1){unanswered[_0x98f5('0x54')](_0x3bb728,0x1);}}if(transfers[_0xb64efb[_0x98f5('0x5')]]){transfers[_0xb64efb['uniqueid']][_0x98f5('0xf')]=!![];transfers[_0xb64efb['uniqueid']][_0x98f5('0x36')]=utils[_0x98f5('0x18')]();transfers[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0x25')]=utils['diffTime'](transfers[_0xb64efb['uniqueid']][_0x98f5('0x36')],transfers[_0xb64efb[_0x98f5('0x5')]]['agentconnectAt']);transfers[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0x22')]=_0x98f5('0x55');transfers[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0x19')]=_0x98f5('0x37');utils[_0x98f5('0x3')](util[_0x98f5('0x1c')](_0x98f5('0x52'),_0xb64efb[_0x98f5('0x5')],transfers[_0xb64efb[_0x98f5('0x5')]]['membername'],transfers[_0xb64efb['uniqueid']][_0x98f5('0x22')],transfers[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0x19')]));writeDB(transfers[_0xb64efb['uniqueid']],!![]);}if(agents[_0xb64efb[_0x98f5('0x5')]]&&agents[_0xb64efb[_0x98f5('0x5')]]['agentconnectAt']){agents[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0xf')]=!![];agents[_0xb64efb['uniqueid']]['agentcompleteAt']=utils['now']();agents[_0xb64efb['uniqueid']][_0x98f5('0x25')]=utils[_0x98f5('0x35')](agents[_0xb64efb['uniqueid']][_0x98f5('0x36')],agents[_0xb64efb[_0x98f5('0x5')]]['agentconnectAt']);agents[_0xb64efb[_0x98f5('0x5')]]['reason']=agents[_0xb64efb['uniqueid']][_0x98f5('0x3b')]?_0x98f5('0x3b'):_0x98f5('0x55');agents[_0xb64efb[_0x98f5('0x5')]]['lastevent']=_0x98f5('0x37');utils['info'](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0xb64efb[_0x98f5('0x5')],agents[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0x1d')],agents[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0x22')],agents[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0x19')]));writeDB(agents[_0xb64efb[_0x98f5('0x5')]]);}}catch(_0x1a3a76){utils[_0x98f5('0x1e')](util['format'](_0x98f5('0x4f'),_0xb64efb[_0x98f5('0x5')]),_0x1a3a76);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index cc2d40f..89bf32c 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 _0xf435=['xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','\x22\x20<','xmd-callerid-preview','xmd-callerid','xmd-queue','xmcs-queue','[%s][calls][varset]\x20variable:%s\x20value:%s','lastapplication','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','cdr','split','substring','lastIndexOf','includes','hangup','noop','execif','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','blinds','uniqueid','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','queue','membername','interface','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','CreateVoiceCallReport','request','recording','debug','[%s][calls][newchannel]','channel','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','DOCUMENTATION','error','newstate','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','now','linkedid','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','answertime','disposition','toNumber','[%s][calls][newstate]','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','starttime','billableseconds','diffTime','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','localtwolinkedid','destinationchannel','userfield','origtransfererchannel','_attended','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source'];(function(_0x115f3f,_0x1e56fd){var _0x542bf4=function(_0x2beccd){while(--_0x2beccd){_0x115f3f['push'](_0x115f3f['shift']());}};_0x542bf4(++_0x1e56fd);}(_0xf435,0x174));var _0x5f43=function(_0xc21cae,_0x18aee0){_0xc21cae=_0xc21cae-0x0;var _0x41e4cd=_0xf435[_0xc21cae];return _0x41e4cd;};'use strict';var _=require('lodash');var util=require(_0x5f43('0x0'));var utils=require(_0x5f43('0x1'));var transfers=require(_0x5f43('0x2'));var dispositions=[_0x5f43('0x3'),_0x5f43('0x4'),'FAILED',_0x5f43('0x3'),_0x5f43('0x3'),_0x5f43('0x3'),_0x5f43('0x5'),'BUSY',_0x5f43('0x4'),_0x5f43('0x4'),_0x5f43('0x4')];var channels={};function writeDB(_0x4d88d8){var _0x2f4620;if(transfers[_0x5f43('0x6')][_0x4d88d8[_0x5f43('0x7')]]){_0x2f4620=_0x4d88d8[_0x5f43('0x7')];_0x4d88d8[_0x5f43('0x7')]=transfers[_0x5f43('0x6')][_0x4d88d8[_0x5f43('0x7')]][_0x5f43('0x8')];}utils[_0x5f43('0x9')](util[_0x5f43('0xa')](_0x5f43('0xb'),_0x4d88d8['uniqueid'],_0x4d88d8['channel'],_0x4d88d8[_0x5f43('0xc')],_0x4d88d8[_0x5f43('0xd')],_0x4d88d8[_0x5f43('0xe')],_0x4d88d8[_0x5f43('0xf')],_0x4d88d8[_0x5f43('0x10')],_0x4d88d8[_0x5f43('0x11')]));if(_0x4d88d8[_0x5f43('0x12')]){utils[_0x5f43('0x13')](_0x4d88d8['accountcode'])[_0x5f43('0x14')](function(_0x4f2908){if(_0x4f2908){_0x4d88d8[_0x5f43('0x15')]=_0x4f2908['id'];}utils['request'](_0x5f43('0x16'),_0x4d88d8);});}else{utils[_0x5f43('0x17')](_0x5f43('0x16'),_0x4d88d8);}if(channels[_0x4d88d8[_0x5f43('0x7')]]){delete channels[_0x4d88d8['uniqueid']];}else if(_0x2f4620&&channels[_0x2f4620]){if(!transfers[_0x5f43('0x6')][_0x2f4620][_0x5f43('0x18')])delete transfers[_0x5f43('0x6')][_0x2f4620];delete channels[_0x2f4620];}}exports['newchannel']=function(_0x3c6fcc){try{utils[_0x5f43('0x19')](util[_0x5f43('0xa')](_0x5f43('0x1a'),_0x3c6fcc[_0x5f43('0x7')]),_0x3c6fcc);if(_0x3c6fcc[_0x5f43('0x7')]==_0x3c6fcc['linkedid']&&_0x3c6fcc[_0x5f43('0x1b')]!=_0x5f43('0x1c')){utils['info'](util[_0x5f43('0xa')](_0x5f43('0x1d'),_0x3c6fcc[_0x5f43('0x7')],_0x3c6fcc[_0x5f43('0x1e')],_0x3c6fcc[_0x5f43('0x1f')]));channels[_0x3c6fcc[_0x5f43('0x7')]]={'uniqueid':_0x3c6fcc['uniqueid'],'accountcode':_0x3c6fcc[_0x5f43('0x12')],'source':_0x3c6fcc['calleridnum'],'destination':_0x3c6fcc[_0x5f43('0x1f')],'destinationcontext':_0x3c6fcc['context'],'channel':_0x3c6fcc['channel'],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x5f43('0x3'),'amaflags':_0x5f43('0x20')};}}catch(_0x8ee422){utils[_0x5f43('0x21')](util[_0x5f43('0xa')](_0x5f43('0x1a'),_0x3c6fcc[_0x5f43('0x7')]),_0x8ee422);}};exports[_0x5f43('0x22')]=function(_0x179ba3){try{utils[_0x5f43('0x19')](util['format']('[%s][calls][newstate]',_0x179ba3[_0x5f43('0x7')]),_0x179ba3);if(!_[_0x5f43('0x23')](channels[_0x179ba3['uniqueid']])&&_0x179ba3[_0x5f43('0x24')]==0x6){utils[_0x5f43('0x9')](util[_0x5f43('0xa')](_0x5f43('0x25'),_0x179ba3[_0x5f43('0x7')],_0x179ba3[_0x5f43('0x1e')],_0x179ba3[_0x5f43('0x1b')]));if(_[_0x5f43('0x23')](channels[_0x179ba3[_0x5f43('0x7')]][_0x5f43('0x26')])){channels[_0x179ba3[_0x5f43('0x7')]]['systemanswertime']=utils[_0x5f43('0x27')]();}}else if(!_[_0x5f43('0x23')](channels[_0x179ba3[_0x5f43('0x28')]])&&_0x179ba3[_0x5f43('0x24')]==0x6&&_0x179ba3[_0x5f43('0x1e')]!=_0x5f43('0x29')){utils[_0x5f43('0x9')](util[_0x5f43('0xa')](_0x5f43('0x2a'),_0x179ba3[_0x5f43('0x7')],_0x179ba3['linkedid'],_0x179ba3[_0x5f43('0x1e')],_0x179ba3['channel']));channels[_0x179ba3[_0x5f43('0x28')]][_0x5f43('0x12')]=_0x179ba3[_0x5f43('0x12')];channels[_0x179ba3[_0x5f43('0x28')]]['destinationchannel']=_0x179ba3[_0x5f43('0x1b')];if(_[_0x5f43('0x23')](channels[_0x179ba3['linkedid']][_0x5f43('0x2b')])){channels[_0x179ba3[_0x5f43('0x28')]]['answertime']=utils['now']();}channels[_0x179ba3['linkedid']][_0x5f43('0x2c')]=dispositions[_[_0x5f43('0x2d')](_0x179ba3['channelstate'])]||_0x5f43('0x5');}}catch(_0xba0d1c){utils[_0x5f43('0x21')](util['format'](_0x5f43('0x2e'),_0x179ba3['uniqueid']),_0xba0d1c);}};exports['hangup']=function(_0xf53b93){try{if(!_['isNil'](channels[_0xf53b93[_0x5f43('0x7')]])){utils['debug'](util[_0x5f43('0xa')](_0x5f43('0x2f'),_0xf53b93[_0x5f43('0x7')]),_0xf53b93);if(_[_0x5f43('0x23')](channels[_0xf53b93[_0x5f43('0x7')]][_0x5f43('0x30')])){channels[_0xf53b93[_0x5f43('0x7')]][_0x5f43('0x30')]=_0xf53b93[_0x5f43('0x31')]+'\x20<'+_0xf53b93[_0x5f43('0xf')]+'>';}utils['info'](util[_0x5f43('0xa')](_0x5f43('0x32'),_0xf53b93[_0x5f43('0x7')],channels[_0xf53b93[_0x5f43('0x7')]][_0x5f43('0x30')],_0xf53b93[_0x5f43('0x33')]));channels[_0xf53b93['uniqueid']][_0x5f43('0x34')]=utils[_0x5f43('0x27')]();channels[_0xf53b93['uniqueid']][_0x5f43('0x35')]=utils['diffTime'](channels[_0xf53b93[_0x5f43('0x7')]]['endtime'],channels[_0xf53b93[_0x5f43('0x7')]][_0x5f43('0x36')]);channels[_0xf53b93[_0x5f43('0x7')]][_0x5f43('0x37')]=channels[_0xf53b93[_0x5f43('0x7')]][_0x5f43('0x2b')]?utils[_0x5f43('0x38')](channels[_0xf53b93['uniqueid']]['endtime'],channels[_0xf53b93[_0x5f43('0x7')]]['answertime']):0x0;writeDB(channels[_0xf53b93[_0x5f43('0x7')]]);}}catch(_0x45ad90){utils[_0x5f43('0x21')](util[_0x5f43('0xa')]('[%s][calls][hangup]',_0xf53b93[_0x5f43('0x7')]),_0x45ad90);}};exports['attendedtransfer']=function(_0x97f3d2){try{if(!_[_0x5f43('0x23')](channels[_0x97f3d2['localtwolinkedid']])){utils[_0x5f43('0x19')](util['format'](_0x5f43('0x39'),_0x97f3d2[_0x5f43('0x3a')]),_0x97f3d2);if(channels[_0x97f3d2['localtwolinkedid']][_0x5f43('0x1b')]==_0x97f3d2[_0x5f43('0x3b')]){utils['info'](util[_0x5f43('0xa')](_0x5f43('0x3c'),_0x97f3d2[_0x5f43('0x3a')],_0x97f3d2[_0x5f43('0x3d')],_0x97f3d2['secondtransfererchannel']));channels[_0x97f3d2[_0x5f43('0x3d')]][_0x5f43('0x3e')]=_0x97f3d2['secondtransfererchannel'];channels[_0x97f3d2['localtwolinkedid']][_0x5f43('0x3f')]='_attended';}else if(channels[_0x97f3d2[_0x5f43('0x3d')]][_0x5f43('0x1b')]=_0x97f3d2['transfertargetchannel']){utils[_0x5f43('0x9')](util[_0x5f43('0xa')](_0x5f43('0x3c'),_0x97f3d2[_0x5f43('0x3a')],_0x97f3d2[_0x5f43('0x3d')],_0x97f3d2[_0x5f43('0x40')]));channels[_0x97f3d2[_0x5f43('0x3d')]][_0x5f43('0x3e')]=_0x97f3d2[_0x5f43('0x40')];channels[_0x97f3d2[_0x5f43('0x3d')]][_0x5f43('0x3f')]=_0x5f43('0x41');}}}catch(_0x5a4dbb){utils[_0x5f43('0x21')](util['format']('[%s][calls][attendedtransfer]',_0x97f3d2[_0x5f43('0x3a')]),_0x5a4dbb);}};exports[_0x5f43('0x42')]=function(_0x3cc257){try{if(!_[_0x5f43('0x23')](channels[_0x3cc257[_0x5f43('0x7')]])){utils[_0x5f43('0x19')](util['format'](_0x5f43('0x43'),_0x3cc257[_0x5f43('0x7')]),_0x3cc257);channels[_0x3cc257['uniqueid']][_0x5f43('0x44')]=utils[_0x5f43('0x27')]();utils[_0x5f43('0x9')](util[_0x5f43('0xa')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x3cc257[_0x5f43('0x7')],channels[_0x3cc257[_0x5f43('0x7')]][_0x5f43('0x44')]));}}catch(_0x492ffb){utils['error'](util[_0x5f43('0xa')]('[%s][calls][musiconholdstart]',_0x3cc257['uniqueid']),_0x492ffb);}};exports[_0x5f43('0x45')]=function(_0x22dca3){try{if(!_[_0x5f43('0x23')](channels[_0x22dca3[_0x5f43('0x7')]])){utils['debug'](util[_0x5f43('0xa')](_0x5f43('0x46'),_0x22dca3['uniqueid']),_0x22dca3);if(!_[_0x5f43('0x23')](channels[_0x22dca3[_0x5f43('0x7')]][_0x5f43('0x44')])){channels[_0x22dca3['uniqueid']][_0x5f43('0x47')]+=utils['diffTime'](utils[_0x5f43('0x27')](),channels[_0x22dca3[_0x5f43('0x7')]]['musiconholdstartAt']);utils[_0x5f43('0x9')](util['format'](_0x5f43('0x48'),_0x22dca3[_0x5f43('0x7')],channels[_0x22dca3[_0x5f43('0x7')]][_0x5f43('0x47')]));delete channels[_0x22dca3['uniqueid']][_0x5f43('0x44')];}}}catch(_0x403fd4){utils['error'](util[_0x5f43('0xa')](_0x5f43('0x46'),_0x22dca3[_0x5f43('0x7')]),_0x403fd4);}};exports[_0x5f43('0x49')]=function(_0x2a187b){try{if(!_[_0x5f43('0x23')](channels[_0x2a187b['uniqueid']])){utils[_0x5f43('0x19')](util[_0x5f43('0xa')](_0x5f43('0x4a'),_0x2a187b[_0x5f43('0x7')]),_0x2a187b);if(!_['isNil'](_0x2a187b[_0x5f43('0x4b')][_0x5f43('0x4c')])){utils[_0x5f43('0x9')](util[_0x5f43('0xa')](_0x5f43('0x4d'),_0x2a187b[_0x5f43('0x7')],_0x2a187b[_0x5f43('0x4e')]));channels[_0x2a187b['uniqueid']][_0x5f43('0x4f')]=_0x2a187b['value'];}if(!_[_0x5f43('0x23')](_0x2a187b[_0x5f43('0x4b')][_0x5f43('0x50')])){utils[_0x5f43('0x9')](util['format'](_0x5f43('0x51'),_0x2a187b['uniqueid'],_0x2a187b[_0x5f43('0x4e')]));channels[_0x2a187b['uniqueid']]['destination']=_0x2a187b[_0x5f43('0x4e')];channels[_0x2a187b[_0x5f43('0x7')]][_0x5f43('0x30')]='\x22'+_0x2a187b['value']+_0x5f43('0x52')+_0x2a187b[_0x5f43('0x4e')]+'>';}if(!_[_0x5f43('0x23')](_0x2a187b[_0x5f43('0x4b')][_0x5f43('0x53')])||!_[_0x5f43('0x23')](_0x2a187b[_0x5f43('0x4b')][_0x5f43('0x54')])){utils[_0x5f43('0x9')](util[_0x5f43('0xa')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x2a187b[_0x5f43('0x7')],!_[_0x5f43('0x23')](_0x2a187b[_0x5f43('0x4b')]['xmd-callerid-preview'])?_0x5f43('0x53'):_0x5f43('0x54'),_0x2a187b[_0x5f43('0x4e')]));channels[_0x2a187b['uniqueid']]['callerid']=_0x2a187b[_0x5f43('0x4e')];}if(!_['isNil'](_0x2a187b[_0x5f43('0x4b')][_0x5f43('0x55')])||!_[_0x5f43('0x23')](_0x2a187b[_0x5f43('0x4b')][_0x5f43('0x56')])){utils[_0x5f43('0x9')](util[_0x5f43('0xa')](_0x5f43('0x57'),_0x2a187b[_0x5f43('0x7')],!_[_0x5f43('0x23')](_0x2a187b[_0x5f43('0x4b')][_0x5f43('0x55')])?_0x5f43('0x55'):_0x5f43('0x56'),_0x2a187b[_0x5f43('0x4e')]));channels[_0x2a187b[_0x5f43('0x7')]][_0x5f43('0x58')]=_0x5f43('0x59');channels[_0x2a187b[_0x5f43('0x7')]][_0x5f43('0x5a')]=_0x2a187b[_0x5f43('0x4e')];channels[_0x2a187b[_0x5f43('0x7')]][_0x5f43('0xc')]=!![];}if(!_[_0x5f43('0x23')](_0x2a187b[_0x5f43('0x4b')][_0x5f43('0x5b')])){utils[_0x5f43('0x9')](util[_0x5f43('0xa')](_0x5f43('0x5c'),_0x2a187b['uniqueid'],_0x2a187b['value']));channels[_0x2a187b['uniqueid']]['ContactId']=_0x2a187b['value'];}if(!_[_0x5f43('0x23')](_0x2a187b[_0x5f43('0x4b')][_0x5f43('0x5d')])){utils[_0x5f43('0x9')](util[_0x5f43('0xa')](_0x5f43('0x5e'),_0x2a187b[_0x5f43('0x7')],_0x2a187b[_0x5f43('0x4e')]));channels[_0x2a187b['uniqueid']][_0x5f43('0x5f')]=_0x2a187b[_0x5f43('0x4e')];}if(!_['isNil'](_0x2a187b[_0x5f43('0x4b')]['outboundrouteid'])){utils['info'](util[_0x5f43('0xa')](_0x5f43('0x60'),_0x2a187b['uniqueid'],_0x2a187b[_0x5f43('0x4e')]));channels[_0x2a187b['uniqueid']][_0x5f43('0x61')]=_0x2a187b[_0x5f43('0x4e')];}if(!_[_0x5f43('0x23')](_0x2a187b[_0x5f43('0x4b')][_0x5f43('0x62')])){utils[_0x5f43('0x9')](util[_0x5f43('0xa')](_0x5f43('0x63'),_0x2a187b[_0x5f43('0x7')],_0x2a187b[_0x5f43('0x4e')]));channels[_0x2a187b[_0x5f43('0x7')]][_0x5f43('0x62')]=_0x2a187b[_0x5f43('0x4e')];}}}catch(_0x55df26){utils[_0x5f43('0x21')](util[_0x5f43('0xa')](_0x5f43('0x4a'),_0x2a187b[_0x5f43('0x7')]),_0x55df26);}};exports['newexten']=function(_0x129642){try{if(!_[_0x5f43('0x23')](channels[_0x129642[_0x5f43('0x7')]])){utils['debug'](util[_0x5f43('0xa')]('[%s][calls][newexten]',_0x129642[_0x5f43('0x7')]),_0x129642);utils['info'](util[_0x5f43('0xa')](_0x5f43('0x64'),_0x129642[_0x5f43('0x7')],_0x129642[_0x5f43('0x65')],_0x129642[_0x5f43('0x66')]));if(_0x129642[_0x5f43('0x65')][_0x5f43('0x67')]()==_0x5f43('0x68')&&_['startsWith'](_0x129642[_0x5f43('0x66')][_0x5f43('0x67')](),_0x5f43('0x69'))){var _0x593309=_0x129642[_0x5f43('0x66')][_0x5f43('0x6a')]('=');var _0x2adab8=_0x593309[0x0][_0x5f43('0x6b')](_0x593309[0x0][_0x5f43('0x6c')]('(')+0x1,_0x593309[0x0][_0x5f43('0x6c')](')'));var _0x403354=_0x593309[0x1];channels[_0x129642[_0x5f43('0x7')]][_0x2adab8]=_0x403354;}if(!_[_0x5f43('0x6d')]([_0x5f43('0x6e'),_0x5f43('0x6f'),_0x5f43('0x70'),_0x5f43('0x68'),'gotoif'],_0x129642[_0x5f43('0x65')][_0x5f43('0x67')]())){channels[_0x129642['uniqueid']][_0x5f43('0x58')]=_0x129642[_0x5f43('0x65')];channels[_0x129642['uniqueid']][_0x5f43('0x5a')]=_0x129642[_0x5f43('0x66')];}}}catch(_0x5cb9a3){utils[_0x5f43('0x21')](util[_0x5f43('0xa')]('[%s][calls][newexten]',_0x129642[_0x5f43('0x7')]),_0x5cb9a3);}}; \ No newline at end of file +var _0x4baf=['error','hangup','[%s][calls][hangup]','callerid','calleridname','cause-txt','endtime','duration','diffTime','starttime','billableseconds','attendedtransfer','localtwolinkedid','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','variable','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','\x22\x20<','xmd-callerid-preview','xmd-callerid','xmd-queue','xmcs-queue','[%s][calls][varset]\x20variable:%s\x20value:%s','lastapplication','Queue','lastdata','xmd-contactid','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','cdr','appdata','substring','lastIndexOf','includes','noop','execif','gotoif','lodash','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','blinds','uniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','CreateVoiceCallReport','recording','newchannel','debug','[%s][calls][newchannel]','linkedid','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','now','DOCUMENTATION','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','context','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','toNumber'];(function(_0xa81f2d,_0x17f3a0){var _0x26937d=function(_0x5df6a1){while(--_0x5df6a1){_0xa81f2d['push'](_0xa81f2d['shift']());}};_0x26937d(++_0x17f3a0);}(_0x4baf,0xb4));var _0xf4ba=function(_0x23bafc,_0x2cd70d){_0x23bafc=_0x23bafc-0x0;var _0x308fd8=_0x4baf[_0x23bafc];return _0x308fd8;};'use strict';var _=require(_0xf4ba('0x0'));var util=require('util');var utils=require(_0xf4ba('0x1'));var transfers=require(_0xf4ba('0x2'));var dispositions=[_0xf4ba('0x3'),_0xf4ba('0x4'),_0xf4ba('0x4'),_0xf4ba('0x3'),_0xf4ba('0x3'),_0xf4ba('0x3'),_0xf4ba('0x5'),'BUSY',_0xf4ba('0x4'),'FAILED',_0xf4ba('0x4')];var channels={};function writeDB(_0x35a4e7){var _0x5732a5;if(transfers[_0xf4ba('0x6')][_0x35a4e7[_0xf4ba('0x7')]]){_0x5732a5=_0x35a4e7[_0xf4ba('0x7')];_0x35a4e7[_0xf4ba('0x7')]=transfers[_0xf4ba('0x6')][_0x35a4e7['uniqueid']]['transfereeuniqueid'];}utils[_0xf4ba('0x8')](util[_0xf4ba('0x9')](_0xf4ba('0xa'),_0x35a4e7['uniqueid'],_0x35a4e7[_0xf4ba('0xb')],_0x35a4e7[_0xf4ba('0xc')],_0x35a4e7[_0xf4ba('0xd')],_0x35a4e7['interface'],_0x35a4e7[_0xf4ba('0xe')],_0x35a4e7[_0xf4ba('0xf')],_0x35a4e7[_0xf4ba('0x10')]));if(_0x35a4e7[_0xf4ba('0x11')]){utils[_0xf4ba('0x12')](_0x35a4e7[_0xf4ba('0x11')])[_0xf4ba('0x13')](function(_0x466d63){if(_0x466d63){_0x35a4e7[_0xf4ba('0x14')]=_0x466d63['id'];}utils['request'](_0xf4ba('0x15'),_0x35a4e7);});}else{utils['request'](_0xf4ba('0x15'),_0x35a4e7);}if(channels[_0x35a4e7[_0xf4ba('0x7')]]){delete channels[_0x35a4e7['uniqueid']];}else if(_0x5732a5&&channels[_0x5732a5]){if(!transfers['blinds'][_0x5732a5][_0xf4ba('0x16')])delete transfers[_0xf4ba('0x6')][_0x5732a5];delete channels[_0x5732a5];}}exports[_0xf4ba('0x17')]=function(_0x314cf5){try{utils[_0xf4ba('0x18')](util[_0xf4ba('0x9')](_0xf4ba('0x19'),_0x314cf5['uniqueid']),_0x314cf5);if(_0x314cf5[_0xf4ba('0x7')]==_0x314cf5[_0xf4ba('0x1a')]&&_0x314cf5[_0xf4ba('0xb')]!='OutgoingSpoolFailed'){utils['info'](util[_0xf4ba('0x9')](_0xf4ba('0x1b'),_0x314cf5[_0xf4ba('0x7')],_0x314cf5['context'],_0x314cf5[_0xf4ba('0x1c')]));channels[_0x314cf5[_0xf4ba('0x7')]]={'uniqueid':_0x314cf5[_0xf4ba('0x7')],'accountcode':_0x314cf5[_0xf4ba('0x11')],'source':_0x314cf5[_0xf4ba('0xe')],'destination':_0x314cf5['exten'],'destinationcontext':_0x314cf5['context'],'channel':_0x314cf5[_0xf4ba('0xb')],'starttime':utils[_0xf4ba('0x1d')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0xf4ba('0x1e')};}}catch(_0x212dc5){utils['error'](util['format'](_0xf4ba('0x19'),_0x314cf5[_0xf4ba('0x7')]),_0x212dc5);}};exports['newstate']=function(_0x3b71e4){try{utils['debug'](util[_0xf4ba('0x9')](_0xf4ba('0x1f'),_0x3b71e4['uniqueid']),_0x3b71e4);if(!_[_0xf4ba('0x20')](channels[_0x3b71e4['uniqueid']])&&_0x3b71e4[_0xf4ba('0x21')]==0x6){utils[_0xf4ba('0x8')](util[_0xf4ba('0x9')](_0xf4ba('0x22'),_0x3b71e4[_0xf4ba('0x7')],_0x3b71e4[_0xf4ba('0x23')],_0x3b71e4[_0xf4ba('0xb')]));if(_[_0xf4ba('0x20')](channels[_0x3b71e4['uniqueid']][_0xf4ba('0x24')])){channels[_0x3b71e4[_0xf4ba('0x7')]][_0xf4ba('0x24')]=utils[_0xf4ba('0x1d')]();}}else if(!_[_0xf4ba('0x20')](channels[_0x3b71e4[_0xf4ba('0x1a')]])&&_0x3b71e4['channelstate']==0x6&&_0x3b71e4[_0xf4ba('0x23')]!=_0xf4ba('0x25')){utils[_0xf4ba('0x8')](util[_0xf4ba('0x9')](_0xf4ba('0x26'),_0x3b71e4[_0xf4ba('0x7')],_0x3b71e4[_0xf4ba('0x1a')],_0x3b71e4[_0xf4ba('0x23')],_0x3b71e4[_0xf4ba('0xb')]));channels[_0x3b71e4[_0xf4ba('0x1a')]][_0xf4ba('0x11')]=_0x3b71e4[_0xf4ba('0x11')];channels[_0x3b71e4[_0xf4ba('0x1a')]][_0xf4ba('0x27')]=_0x3b71e4['channel'];if(_[_0xf4ba('0x20')](channels[_0x3b71e4[_0xf4ba('0x1a')]][_0xf4ba('0x28')])){channels[_0x3b71e4[_0xf4ba('0x1a')]][_0xf4ba('0x28')]=utils[_0xf4ba('0x1d')]();}channels[_0x3b71e4[_0xf4ba('0x1a')]]['disposition']=dispositions[_[_0xf4ba('0x29')](_0x3b71e4[_0xf4ba('0x21')])]||_0xf4ba('0x5');}}catch(_0x4b048e){utils[_0xf4ba('0x2a')](util[_0xf4ba('0x9')](_0xf4ba('0x1f'),_0x3b71e4['uniqueid']),_0x4b048e);}};exports[_0xf4ba('0x2b')]=function(_0x2fdba0){try{if(!_[_0xf4ba('0x20')](channels[_0x2fdba0[_0xf4ba('0x7')]])){utils[_0xf4ba('0x18')](util[_0xf4ba('0x9')](_0xf4ba('0x2c'),_0x2fdba0[_0xf4ba('0x7')]),_0x2fdba0);if(_[_0xf4ba('0x20')](channels[_0x2fdba0[_0xf4ba('0x7')]]['callerid'])){channels[_0x2fdba0[_0xf4ba('0x7')]][_0xf4ba('0x2d')]=_0x2fdba0[_0xf4ba('0x2e')]+'\x20<'+_0x2fdba0[_0xf4ba('0xe')]+'>';}utils[_0xf4ba('0x8')](util['format']('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x2fdba0['uniqueid'],channels[_0x2fdba0[_0xf4ba('0x7')]]['callerid'],_0x2fdba0[_0xf4ba('0x2f')]));channels[_0x2fdba0['uniqueid']][_0xf4ba('0x30')]=utils[_0xf4ba('0x1d')]();channels[_0x2fdba0[_0xf4ba('0x7')]][_0xf4ba('0x31')]=utils[_0xf4ba('0x32')](channels[_0x2fdba0[_0xf4ba('0x7')]][_0xf4ba('0x30')],channels[_0x2fdba0[_0xf4ba('0x7')]][_0xf4ba('0x33')]);channels[_0x2fdba0['uniqueid']][_0xf4ba('0x34')]=channels[_0x2fdba0[_0xf4ba('0x7')]][_0xf4ba('0x28')]?utils['diffTime'](channels[_0x2fdba0[_0xf4ba('0x7')]][_0xf4ba('0x30')],channels[_0x2fdba0[_0xf4ba('0x7')]][_0xf4ba('0x28')]):0x0;writeDB(channels[_0x2fdba0[_0xf4ba('0x7')]]);}}catch(_0x1329fa){utils[_0xf4ba('0x2a')](util[_0xf4ba('0x9')](_0xf4ba('0x2c'),_0x2fdba0['uniqueid']),_0x1329fa);}};exports[_0xf4ba('0x35')]=function(_0x423825){try{if(!_[_0xf4ba('0x20')](channels[_0x423825[_0xf4ba('0x36')]])){utils[_0xf4ba('0x18')](util[_0xf4ba('0x9')]('[%s][calls][attendedtransfer]',_0x423825[_0xf4ba('0x37')]),_0x423825);if(channels[_0x423825[_0xf4ba('0x36')]][_0xf4ba('0xb')]==_0x423825[_0xf4ba('0x38')]){utils[_0xf4ba('0x8')](util[_0xf4ba('0x9')](_0xf4ba('0x39'),_0x423825[_0xf4ba('0x37')],_0x423825[_0xf4ba('0x36')],_0x423825[_0xf4ba('0x3a')]));channels[_0x423825[_0xf4ba('0x36')]][_0xf4ba('0x27')]=_0x423825[_0xf4ba('0x3a')];channels[_0x423825[_0xf4ba('0x36')]][_0xf4ba('0x3b')]='_attended';}else if(channels[_0x423825[_0xf4ba('0x36')]][_0xf4ba('0xb')]=_0x423825['transfertargetchannel']){utils['info'](util[_0xf4ba('0x9')](_0xf4ba('0x39'),_0x423825['origtransfereruniqueid'],_0x423825['localtwolinkedid'],_0x423825[_0xf4ba('0x3c')]));channels[_0x423825[_0xf4ba('0x36')]]['destinationchannel']=_0x423825[_0xf4ba('0x3c')];channels[_0x423825['localtwolinkedid']]['userfield']='_attended';}}}catch(_0x212930){utils['error'](util[_0xf4ba('0x9')]('[%s][calls][attendedtransfer]',_0x423825['origtransfereruniqueid']),_0x212930);}};exports[_0xf4ba('0x3d')]=function(_0x358fb4){try{if(!_[_0xf4ba('0x20')](channels[_0x358fb4[_0xf4ba('0x7')]])){utils[_0xf4ba('0x18')](util[_0xf4ba('0x9')](_0xf4ba('0x3e'),_0x358fb4[_0xf4ba('0x7')]),_0x358fb4);channels[_0x358fb4[_0xf4ba('0x7')]][_0xf4ba('0x3f')]=utils[_0xf4ba('0x1d')]();utils['info'](util[_0xf4ba('0x9')](_0xf4ba('0x40'),_0x358fb4[_0xf4ba('0x7')],channels[_0x358fb4['uniqueid']][_0xf4ba('0x3f')]));}}catch(_0xc8583b){utils[_0xf4ba('0x2a')](util['format'](_0xf4ba('0x3e'),_0x358fb4[_0xf4ba('0x7')]),_0xc8583b);}};exports[_0xf4ba('0x41')]=function(_0x445eda){try{if(!_[_0xf4ba('0x20')](channels[_0x445eda[_0xf4ba('0x7')]])){utils[_0xf4ba('0x18')](util[_0xf4ba('0x9')](_0xf4ba('0x42'),_0x445eda['uniqueid']),_0x445eda);if(!_[_0xf4ba('0x20')](channels[_0x445eda['uniqueid']][_0xf4ba('0x3f')])){channels[_0x445eda[_0xf4ba('0x7')]][_0xf4ba('0x43')]+=utils['diffTime'](utils[_0xf4ba('0x1d')](),channels[_0x445eda[_0xf4ba('0x7')]][_0xf4ba('0x3f')]);utils[_0xf4ba('0x8')](util[_0xf4ba('0x9')](_0xf4ba('0x44'),_0x445eda['uniqueid'],channels[_0x445eda[_0xf4ba('0x7')]][_0xf4ba('0x43')]));delete channels[_0x445eda[_0xf4ba('0x7')]][_0xf4ba('0x3f')];}}}catch(_0xdad88){utils[_0xf4ba('0x2a')](util['format']('[%s][calls][musiconholdstop]',_0x445eda[_0xf4ba('0x7')]),_0xdad88);}};exports[_0xf4ba('0x45')]=function(_0x35dbe1){try{if(!_[_0xf4ba('0x20')](channels[_0x35dbe1['uniqueid']])){utils[_0xf4ba('0x18')](util['format'](_0xf4ba('0x46'),_0x35dbe1['uniqueid']),_0x35dbe1);if(!_[_0xf4ba('0x20')](_0x35dbe1[_0xf4ba('0x47')]['xmd-originatecalleridnum'])){utils[_0xf4ba('0x8')](util[_0xf4ba('0x9')](_0xf4ba('0x48'),_0x35dbe1[_0xf4ba('0x7')],_0x35dbe1[_0xf4ba('0x49')]));channels[_0x35dbe1['uniqueid']][_0xf4ba('0x4a')]=_0x35dbe1['value'];}if(!_[_0xf4ba('0x20')](_0x35dbe1['variable'][_0xf4ba('0x4b')])){utils[_0xf4ba('0x8')](util[_0xf4ba('0x9')](_0xf4ba('0x4c'),_0x35dbe1[_0xf4ba('0x7')],_0x35dbe1['value']));channels[_0x35dbe1[_0xf4ba('0x7')]]['destination']=_0x35dbe1[_0xf4ba('0x49')];channels[_0x35dbe1['uniqueid']][_0xf4ba('0x2d')]='\x22'+_0x35dbe1[_0xf4ba('0x49')]+_0xf4ba('0x4d')+_0x35dbe1['value']+'>';}if(!_['isNil'](_0x35dbe1[_0xf4ba('0x47')][_0xf4ba('0x4e')])||!_[_0xf4ba('0x20')](_0x35dbe1[_0xf4ba('0x47')][_0xf4ba('0x4f')])){utils[_0xf4ba('0x8')](util[_0xf4ba('0x9')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x35dbe1[_0xf4ba('0x7')],!_[_0xf4ba('0x20')](_0x35dbe1[_0xf4ba('0x47')][_0xf4ba('0x4e')])?_0xf4ba('0x4e'):_0xf4ba('0x4f'),_0x35dbe1[_0xf4ba('0x49')]));channels[_0x35dbe1[_0xf4ba('0x7')]]['callerid']=_0x35dbe1[_0xf4ba('0x49')];}if(!_[_0xf4ba('0x20')](_0x35dbe1['variable'][_0xf4ba('0x50')])||!_['isNil'](_0x35dbe1[_0xf4ba('0x47')][_0xf4ba('0x51')])){utils[_0xf4ba('0x8')](util[_0xf4ba('0x9')](_0xf4ba('0x52'),_0x35dbe1[_0xf4ba('0x7')],!_[_0xf4ba('0x20')](_0x35dbe1[_0xf4ba('0x47')][_0xf4ba('0x50')])?'xmd-queue':_0xf4ba('0x51'),_0x35dbe1['value']));channels[_0x35dbe1[_0xf4ba('0x7')]][_0xf4ba('0x53')]=_0xf4ba('0x54');channels[_0x35dbe1[_0xf4ba('0x7')]][_0xf4ba('0x55')]=_0x35dbe1[_0xf4ba('0x49')];channels[_0x35dbe1[_0xf4ba('0x7')]]['queue']=!![];}if(!_[_0xf4ba('0x20')](_0x35dbe1[_0xf4ba('0x47')][_0xf4ba('0x56')])){utils['info'](util[_0xf4ba('0x9')]('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x35dbe1[_0xf4ba('0x7')],_0x35dbe1[_0xf4ba('0x49')]));channels[_0x35dbe1[_0xf4ba('0x7')]][_0xf4ba('0x57')]=_0x35dbe1[_0xf4ba('0x49')];}if(!_[_0xf4ba('0x20')](_0x35dbe1['variable'][_0xf4ba('0x58')])){utils[_0xf4ba('0x8')](util['format'](_0xf4ba('0x59'),_0x35dbe1[_0xf4ba('0x7')],_0x35dbe1[_0xf4ba('0x49')]));channels[_0x35dbe1['uniqueid']][_0xf4ba('0x5a')]=_0x35dbe1[_0xf4ba('0x49')];}if(!_[_0xf4ba('0x20')](_0x35dbe1['variable'][_0xf4ba('0x5b')])){utils['info'](util['format'](_0xf4ba('0x5c'),_0x35dbe1['uniqueid'],_0x35dbe1[_0xf4ba('0x49')]));channels[_0x35dbe1[_0xf4ba('0x7')]][_0xf4ba('0x5d')]=_0x35dbe1[_0xf4ba('0x49')];}if(!_[_0xf4ba('0x20')](_0x35dbe1['variable'][_0xf4ba('0x5e')])){utils[_0xf4ba('0x8')](util[_0xf4ba('0x9')](_0xf4ba('0x5f'),_0x35dbe1[_0xf4ba('0x7')],_0x35dbe1[_0xf4ba('0x49')]));channels[_0x35dbe1[_0xf4ba('0x7')]][_0xf4ba('0x5e')]=_0x35dbe1[_0xf4ba('0x49')];}}}catch(_0x4e8229){utils[_0xf4ba('0x2a')](util['format'](_0xf4ba('0x46'),_0x35dbe1['uniqueid']),_0x4e8229);}};exports[_0xf4ba('0x60')]=function(_0x1efd3d){try{if(!_[_0xf4ba('0x20')](channels[_0x1efd3d[_0xf4ba('0x7')]])){utils[_0xf4ba('0x18')](util[_0xf4ba('0x9')](_0xf4ba('0x61'),_0x1efd3d[_0xf4ba('0x7')]),_0x1efd3d);utils[_0xf4ba('0x8')](util[_0xf4ba('0x9')](_0xf4ba('0x62'),_0x1efd3d[_0xf4ba('0x7')],_0x1efd3d[_0xf4ba('0x63')],_0x1efd3d['appdata']));if(_0x1efd3d['application'][_0xf4ba('0x64')]()==_0xf4ba('0x65')&&_[_0xf4ba('0x66')](_0x1efd3d['appdata'][_0xf4ba('0x64')](),_0xf4ba('0x67'))){var _0x1a422e=_0x1efd3d[_0xf4ba('0x68')]['split']('=');var _0x4310ce=_0x1a422e[0x0][_0xf4ba('0x69')](_0x1a422e[0x0]['lastIndexOf']('(')+0x1,_0x1a422e[0x0][_0xf4ba('0x6a')](')'));var _0x22fb55=_0x1a422e[0x1];channels[_0x1efd3d[_0xf4ba('0x7')]][_0x4310ce]=_0x22fb55;}if(!_[_0xf4ba('0x6b')]([_0xf4ba('0x2b'),_0xf4ba('0x6c'),_0xf4ba('0x6d'),_0xf4ba('0x65'),_0xf4ba('0x6e')],_0x1efd3d['application']['toLowerCase']())){channels[_0x1efd3d[_0xf4ba('0x7')]][_0xf4ba('0x53')]=_0x1efd3d[_0xf4ba('0x63')];channels[_0x1efd3d[_0xf4ba('0x7')]][_0xf4ba('0x55')]=_0x1efd3d[_0xf4ba('0x68')];}}}catch(_0x4dd001){utils[_0xf4ba('0x2a')](util['format'](_0xf4ba('0x61'),_0x1efd3d[_0xf4ba('0x7')]),_0x4dd001);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index ac047c5..f49225c 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 _0x17a3=['./utils','info','shutdown','[core]\x20shutdown','[core]\x20fullybooted','[core]\x20error','close','managerevent'];(function(_0x305486,_0x24acd4){var _0xa04940=function(_0x29e866){while(--_0x29e866){_0x305486['push'](_0x305486['shift']());}};_0xa04940(++_0x24acd4);}(_0x17a3,0x140));var _0x317a=function(_0x59566d,_0x3640b7){_0x59566d=_0x59566d-0x0;var _0x139267=_0x17a3[_0x59566d];return _0x139267;};'use strict';var utils=require(_0x317a('0x0'));exports['connect']=function(){utils[_0x317a('0x1')]('[core]\x20connected');};exports[_0x317a('0x2')]=function(){utils[_0x317a('0x1')](_0x317a('0x3'));};exports['fullybooted']=function(){utils[_0x317a('0x1')](_0x317a('0x4'));};exports['error']=function(_0x3135f6){utils['error'](_0x317a('0x5'),_0x3135f6);};exports[_0x317a('0x6')]=function(){utils['info']('[core]\x20close');};exports[_0x317a('0x7')]=function(_0x26291f){}; \ No newline at end of file +var _0x47a8=['[core]\x20fullybooted','error','[core]\x20error','close','managerevent','info','shutdown','fullybooted'];(function(_0x5b7f40,_0x374a85){var _0x4ae56f=function(_0xc32edb){while(--_0xc32edb){_0x5b7f40['push'](_0x5b7f40['shift']());}};_0x4ae56f(++_0x374a85);}(_0x47a8,0x105));var _0x847a=function(_0x9b561,_0x5640b0){_0x9b561=_0x9b561-0x0;var _0xaff0a=_0x47a8[_0x9b561];return _0xaff0a;};'use strict';var utils=require('./utils');exports['connect']=function(){utils[_0x847a('0x0')]('[core]\x20connected');};exports[_0x847a('0x1')]=function(){utils['info']('[core]\x20shutdown');};exports[_0x847a('0x2')]=function(){utils['info'](_0x847a('0x3'));};exports[_0x847a('0x4')]=function(_0x1155d8){utils[_0x847a('0x4')](_0x847a('0x5'),_0x1155d8);};exports[_0x847a('0x6')]=function(){utils[_0x847a('0x0')]('[core]\x20close');};exports[_0x847a('0x7')]=function(_0x54b15c){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 5101dde..25fe228 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 _0x4e78=['cause-txt','complete','duration','diffTime','endtime','billableseconds','[%s][dials][hangup]','util','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','calleridnum','dialstatus','request','CreateVoiceDialReport','newexten','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','startsWith','cdr(routeid)','split','error','[%s][dials][newexten]','varset','debug','[%s][dials][varset]','variable','outboundrouteid','value','dialbegin','isNil','[%s][dials][dialbegin]','assign','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','answertime','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][dialend]','hangup','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname'];(function(_0x25fa5c,_0x421141){var _0x1bade2=function(_0x3faf20){while(--_0x3faf20){_0x25fa5c['push'](_0x25fa5c['shift']());}};_0x1bade2(++_0x421141);}(_0x4e78,0x139));var _0x84e7=function(_0x459b74,_0x5773bd){_0x459b74=_0x459b74-0x0;var _0x46cb16=_0x4e78[_0x459b74];return _0x46cb16;};'use strict';var _=require('lodash');var util=require(_0x84e7('0x0'));var utils=require(_0x84e7('0x1'));var dials={};function writeDB(_0x19efae){utils[_0x84e7('0x2')](util[_0x84e7('0x3')](_0x84e7('0x4'),_0x19efae[_0x84e7('0x5')],_0x19efae[_0x84e7('0x6')],_0x19efae['dialstring'],_0x19efae[_0x84e7('0x7')],_0x19efae['connectedlinenum'],_0x19efae[_0x84e7('0x8')]));utils[_0x84e7('0x9')](_0x84e7('0xa'),_0x19efae);delete dials[_0x19efae[_0x84e7('0x5')]];}exports[_0x84e7('0xb')]=function(_0x31d7d8){try{utils['debug'](util[_0x84e7('0x3')]('[%s][dials][newexten]',_0x31d7d8['uniqueid']),_0x31d7d8);utils['info'](util[_0x84e7('0x3')](_0x84e7('0xc'),_0x31d7d8[_0x84e7('0x5')],_0x31d7d8[_0x84e7('0xd')],_0x31d7d8[_0x84e7('0xe')]));if(_0x31d7d8[_0x84e7('0xd')]['toLowerCase']()==_0x84e7('0xf')&&_[_0x84e7('0x10')](_0x31d7d8[_0x84e7('0xe')]['toLowerCase'](),_0x84e7('0x11'))){var _0x44cc83=_0x31d7d8[_0x84e7('0xe')][_0x84e7('0x12')]('=');dials[_0x31d7d8[_0x84e7('0x5')]]={'routeId':_0x44cc83[0x1]};}}catch(_0x1550ec){utils[_0x84e7('0x13')](util[_0x84e7('0x3')](_0x84e7('0x14'),_0x31d7d8[_0x84e7('0x5')]),_0x1550ec);}};exports[_0x84e7('0x15')]=function(_0x62175d){try{utils[_0x84e7('0x16')](util[_0x84e7('0x3')](_0x84e7('0x17'),_0x62175d[_0x84e7('0x5')]),_0x62175d);if(!_['isNil'](_0x62175d[_0x84e7('0x18')][_0x84e7('0x19')])){utils['info'](util['format']('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x62175d[_0x84e7('0x5')],_0x62175d['value']));dials[_0x62175d['uniqueid']]={'routeId':_0x62175d[_0x84e7('0x1a')]};}}catch(_0x1eaa81){utils[_0x84e7('0x13')](util[_0x84e7('0x3')]('[%s][dials][varset]',_0x62175d['uniqueid']),_0x1eaa81);}};exports[_0x84e7('0x1b')]=function(_0x65acb1){try{if(!_[_0x84e7('0x1c')](dials[_0x65acb1['uniqueid']])){utils[_0x84e7('0x16')](util['format'](_0x84e7('0x1d'),_0x65acb1[_0x84e7('0x5')]),_0x65acb1);dials[_0x65acb1[_0x84e7('0x5')]]=_[_0x84e7('0x1e')](dials[_0x65acb1[_0x84e7('0x5')]],_0x65acb1);dials[_0x65acb1[_0x84e7('0x5')]][_0x84e7('0x1f')]=utils[_0x84e7('0x20')]();dials[_0x65acb1['uniqueid']][_0x84e7('0x21')]=_0x84e7('0x22');utils[_0x84e7('0x2')](util[_0x84e7('0x3')](_0x84e7('0x23'),_0x65acb1[_0x84e7('0x5')],dials[_0x65acb1[_0x84e7('0x5')]]['starttime']));}}catch(_0x542def){utils[_0x84e7('0x13')](util['format'](_0x84e7('0x1d'),_0x65acb1['uniqueid']),_0x542def);}};exports[_0x84e7('0x24')]=function(_0x1e111b){try{if(!_[_0x84e7('0x1c')](dials[_0x1e111b[_0x84e7('0x5')]])){utils[_0x84e7('0x16')](util[_0x84e7('0x3')]('[%s][dials][dialend]',_0x1e111b[_0x84e7('0x5')]),_0x1e111b);dials[_0x1e111b['uniqueid']]['dialstatus']=_0x1e111b['dialstatus'];if(_0x1e111b[_0x84e7('0x8')]=='ANSWER'){dials[_0x1e111b[_0x84e7('0x5')]]=_[_0x84e7('0x1e')](dials[_0x1e111b[_0x84e7('0x5')]],_0x1e111b);dials[_0x1e111b[_0x84e7('0x5')]]['answertime']=utils[_0x84e7('0x20')]();dials[_0x1e111b[_0x84e7('0x5')]][_0x84e7('0x21')]='connect';utils['info'](util[_0x84e7('0x3')](_0x84e7('0x25'),_0x1e111b[_0x84e7('0x5')],_0x1e111b[_0x84e7('0x8')],dials[_0x1e111b[_0x84e7('0x5')]][_0x84e7('0x26')]));}else{utils[_0x84e7('0x2')](util[_0x84e7('0x3')](_0x84e7('0x27'),_0x1e111b[_0x84e7('0x5')],_0x1e111b[_0x84e7('0x8')]));}}}catch(_0x6db2c8){utils[_0x84e7('0x13')](util[_0x84e7('0x3')](_0x84e7('0x28'),_0x1e111b[_0x84e7('0x5')]),_0x6db2c8);}};exports[_0x84e7('0x29')]=function(_0x3b9f56){try{if(!_[_0x84e7('0x1c')](dials[_0x3b9f56[_0x84e7('0x5')]])){utils[_0x84e7('0x16')](util[_0x84e7('0x3')]('[%s][dials][hangup]',_0x3b9f56[_0x84e7('0x5')]),_0x3b9f56);utils['info'](util[_0x84e7('0x3')](_0x84e7('0x2a'),_0x3b9f56[_0x84e7('0x5')],_0x3b9f56[_0x84e7('0x7')],_0x3b9f56[_0x84e7('0x2b')],_0x3b9f56[_0x84e7('0x2c')]));dials[_0x3b9f56[_0x84e7('0x5')]]=_[_0x84e7('0x1e')](dials[_0x3b9f56[_0x84e7('0x5')]],{'endtime':utils['now'](),'lastevent':_0x84e7('0x2d')});dials[_0x3b9f56[_0x84e7('0x5')]][_0x84e7('0x2e')]=utils['diffTime'](dials[_0x3b9f56[_0x84e7('0x5')]]['endtime'],dials[_0x3b9f56['uniqueid']][_0x84e7('0x1f')]);dials[_0x3b9f56['uniqueid']]['holdtime']=utils[_0x84e7('0x2f')](dials[_0x3b9f56[_0x84e7('0x5')]][_0x84e7('0x26')]||dials[_0x3b9f56[_0x84e7('0x5')]][_0x84e7('0x30')],dials[_0x3b9f56[_0x84e7('0x5')]][_0x84e7('0x1f')]);dials[_0x3b9f56[_0x84e7('0x5')]][_0x84e7('0x31')]=dials[_0x3b9f56[_0x84e7('0x5')]][_0x84e7('0x26')]?utils[_0x84e7('0x2f')](dials[_0x3b9f56['uniqueid']][_0x84e7('0x30')],dials[_0x3b9f56[_0x84e7('0x5')]]['answertime']):0x0;writeDB(dials[_0x3b9f56[_0x84e7('0x5')]]);}}catch(_0x17736d){utils['error'](util[_0x84e7('0x3')](_0x84e7('0x32'),_0x3b9f56['uniqueid']),_0x17736d);}}; \ No newline at end of file +var _0x20d2=['util','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','CreateVoiceDialReport','debug','format','[%s][dials][newexten]','info','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','cdr(routeid)','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','error','[%s][dials][dialbegin]','assign','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialend]','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','cause-txt','complete','duration','endtime','starttime','diffTime','billableseconds','lodash'];(function(_0x4d739f,_0x2aa279){var _0x1a704e=function(_0x24f094){while(--_0x24f094){_0x4d739f['push'](_0x4d739f['shift']());}};_0x1a704e(++_0x2aa279);}(_0x20d2,0x1df));var _0x220d=function(_0x32f2b7,_0x3e62b9){_0x32f2b7=_0x32f2b7-0x0;var _0x26487d=_0x20d2[_0x32f2b7];return _0x26487d;};'use strict';var _=require(_0x220d('0x0'));var util=require(_0x220d('0x1'));var utils=require('./utils');var dials={};function writeDB(_0x3792a4){utils['info'](util['format'](_0x220d('0x2'),_0x3792a4[_0x220d('0x3')],_0x3792a4[_0x220d('0x4')],_0x3792a4[_0x220d('0x5')],_0x3792a4[_0x220d('0x6')],_0x3792a4[_0x220d('0x7')],_0x3792a4[_0x220d('0x8')]));utils['request'](_0x220d('0x9'),_0x3792a4);delete dials[_0x3792a4[_0x220d('0x3')]];}exports['newexten']=function(_0x5d7afe){try{utils[_0x220d('0xa')](util[_0x220d('0xb')](_0x220d('0xc'),_0x5d7afe[_0x220d('0x3')]),_0x5d7afe);utils[_0x220d('0xd')](util['format'](_0x220d('0xe'),_0x5d7afe[_0x220d('0x3')],_0x5d7afe[_0x220d('0xf')],_0x5d7afe[_0x220d('0x10')]));if(_0x5d7afe['application'][_0x220d('0x11')]()=='set'&&_['startsWith'](_0x5d7afe[_0x220d('0x10')][_0x220d('0x11')](),_0x220d('0x12'))){var _0x451911=_0x5d7afe[_0x220d('0x10')]['split']('=');dials[_0x5d7afe['uniqueid']]={'routeId':_0x451911[0x1]};}}catch(_0x482b26){utils['error'](util['format']('[%s][dials][newexten]',_0x5d7afe[_0x220d('0x3')]),_0x482b26);}};exports[_0x220d('0x13')]=function(_0x3e9017){try{utils[_0x220d('0xa')](util[_0x220d('0xb')](_0x220d('0x14'),_0x3e9017[_0x220d('0x3')]),_0x3e9017);if(!_[_0x220d('0x15')](_0x3e9017[_0x220d('0x16')][_0x220d('0x17')])){utils[_0x220d('0xd')](util[_0x220d('0xb')](_0x220d('0x18'),_0x3e9017[_0x220d('0x3')],_0x3e9017[_0x220d('0x19')]));dials[_0x3e9017[_0x220d('0x3')]]={'routeId':_0x3e9017[_0x220d('0x19')]};}}catch(_0x174b0c){utils[_0x220d('0x1a')](util[_0x220d('0xb')]('[%s][dials][varset]',_0x3e9017[_0x220d('0x3')]),_0x174b0c);}};exports['dialbegin']=function(_0x3f0568){try{if(!_[_0x220d('0x15')](dials[_0x3f0568[_0x220d('0x3')]])){utils['debug'](util[_0x220d('0xb')](_0x220d('0x1b'),_0x3f0568[_0x220d('0x3')]),_0x3f0568);dials[_0x3f0568['uniqueid']]=_[_0x220d('0x1c')](dials[_0x3f0568[_0x220d('0x3')]],_0x3f0568);dials[_0x3f0568[_0x220d('0x3')]]['starttime']=utils[_0x220d('0x1d')]();dials[_0x3f0568[_0x220d('0x3')]][_0x220d('0x1e')]=_0x220d('0x1f');utils[_0x220d('0xd')](util[_0x220d('0xb')](_0x220d('0x20'),_0x3f0568[_0x220d('0x3')],dials[_0x3f0568[_0x220d('0x3')]]['starttime']));}}catch(_0x224148){utils[_0x220d('0x1a')](util[_0x220d('0xb')](_0x220d('0x1b'),_0x3f0568[_0x220d('0x3')]),_0x224148);}};exports['dialend']=function(_0x523c0d){try{if(!_['isNil'](dials[_0x523c0d[_0x220d('0x3')]])){utils[_0x220d('0xa')](util['format'](_0x220d('0x21'),_0x523c0d[_0x220d('0x3')]),_0x523c0d);dials[_0x523c0d[_0x220d('0x3')]][_0x220d('0x8')]=_0x523c0d[_0x220d('0x8')];if(_0x523c0d[_0x220d('0x8')]==_0x220d('0x22')){dials[_0x523c0d[_0x220d('0x3')]]=_[_0x220d('0x1c')](dials[_0x523c0d['uniqueid']],_0x523c0d);dials[_0x523c0d[_0x220d('0x3')]][_0x220d('0x23')]=utils['now']();dials[_0x523c0d[_0x220d('0x3')]][_0x220d('0x1e')]=_0x220d('0x24');utils[_0x220d('0xd')](util[_0x220d('0xb')](_0x220d('0x25'),_0x523c0d[_0x220d('0x3')],_0x523c0d['dialstatus'],dials[_0x523c0d['uniqueid']]['answertime']));}else{utils[_0x220d('0xd')](util[_0x220d('0xb')](_0x220d('0x26'),_0x523c0d['uniqueid'],_0x523c0d[_0x220d('0x8')]));}}}catch(_0x2c1b6a){utils['error'](util[_0x220d('0xb')](_0x220d('0x21'),_0x523c0d['uniqueid']),_0x2c1b6a);}};exports[_0x220d('0x27')]=function(_0x144df5){try{if(!_['isNil'](dials[_0x144df5['uniqueid']])){utils[_0x220d('0xa')](util['format'](_0x220d('0x28'),_0x144df5[_0x220d('0x3')]),_0x144df5);utils[_0x220d('0xd')](util[_0x220d('0xb')]('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x144df5[_0x220d('0x3')],_0x144df5[_0x220d('0x6')],_0x144df5['calleridname'],_0x144df5[_0x220d('0x29')]));dials[_0x144df5[_0x220d('0x3')]]=_[_0x220d('0x1c')](dials[_0x144df5[_0x220d('0x3')]],{'endtime':utils[_0x220d('0x1d')](),'lastevent':_0x220d('0x2a')});dials[_0x144df5[_0x220d('0x3')]][_0x220d('0x2b')]=utils['diffTime'](dials[_0x144df5[_0x220d('0x3')]][_0x220d('0x2c')],dials[_0x144df5[_0x220d('0x3')]][_0x220d('0x2d')]);dials[_0x144df5[_0x220d('0x3')]]['holdtime']=utils[_0x220d('0x2e')](dials[_0x144df5[_0x220d('0x3')]][_0x220d('0x23')]||dials[_0x144df5[_0x220d('0x3')]][_0x220d('0x2c')],dials[_0x144df5[_0x220d('0x3')]][_0x220d('0x2d')]);dials[_0x144df5[_0x220d('0x3')]][_0x220d('0x2f')]=dials[_0x144df5[_0x220d('0x3')]][_0x220d('0x23')]?utils[_0x220d('0x2e')](dials[_0x144df5[_0x220d('0x3')]]['endtime'],dials[_0x144df5['uniqueid']][_0x220d('0x23')]):0x0;writeDB(dials[_0x144df5[_0x220d('0x3')]]);}}catch(_0x52a158){utils[_0x220d('0x1a')](util[_0x220d('0xb')](_0x220d('0x28'),_0x144df5[_0x220d('0x3')]),_0x52a158);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index c09b9bb..e11aa3e 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 _0xf072=['queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','[%s][index][newstate]','newstate','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','[%s][index][blindtransfer]','blindtransfer','attendedtransfer','[%s][index][attendedtransfer]','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','asterisk','port','username','password','keepConnected','xdr','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./recordings.controller','./transfers.controller','connect','shutdown','fullybooted','error','close','managerevent','format','[%s][index][devicestatechange]','device','devicestatechange','debug','[%s][index][agentcalled]','uniqueid','agentcalled','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]'];(function(_0x26f22d,_0x8fdba8){var _0x1bb8a5=function(_0x4b7213){while(--_0x4b7213){_0x26f22d['push'](_0x26f22d['shift']());}};_0x1bb8a5(++_0x8fdba8);}(_0xf072,0x19d));var _0x2f07=function(_0x221c58,_0x4f6f9d){_0x221c58=_0x221c58-0x0;var _0xbf5a60=_0xf072[_0x221c58];return _0xbf5a60;};var AsteriskManager=require(_0x2f07('0x0'));var config=require(_0x2f07('0x1'));var utils=require(_0x2f07('0x2'));var util=require(_0x2f07('0x3'));var ami=new AsteriskManager(config[_0x2f07('0x4')][_0x2f07('0x5')],config[_0x2f07('0x4')]['ip'],config['asterisk'][_0x2f07('0x6')],config[_0x2f07('0x4')][_0x2f07('0x7')],!![]);ami[_0x2f07('0x8')]();if(config[_0x2f07('0x9')]&&config['xdr']['disabled']){utils[_0x2f07('0xa')](_0x2f07('0xb'));}else{var agents=require(_0x2f07('0xc'));var calls=require(_0x2f07('0xd'));var queues=require('./queues.controller');var recordings=require(_0x2f07('0xe'));var members=require('./members.controller');var dials=require('./dials.controller');var transfers=require(_0x2f07('0xf'));var core=require('./core.controller');ami['on'](_0x2f07('0x10'),core['connect']);ami['on'](_0x2f07('0x11'),core[_0x2f07('0x11')]);ami['on'](_0x2f07('0x12'),core[_0x2f07('0x12')]);ami['on'](_0x2f07('0x13'),core[_0x2f07('0x13')]);ami['on'](_0x2f07('0x14'),core[_0x2f07('0x14')]);ami['on'](_0x2f07('0x15'),core[_0x2f07('0x15')]);ami['on']('devicestatechange',function(_0x572732){try{utils['debug'](util[_0x2f07('0x16')](_0x2f07('0x17'),_0x572732[_0x2f07('0x18')]),_0x572732);members[_0x2f07('0x19')](_0x572732);}catch(_0x21fcdb){utils[_0x2f07('0x13')](util[_0x2f07('0x16')](_0x2f07('0x17'),_0x572732[_0x2f07('0x18')]),_0x21fcdb);}});ami['on']('agentcalled',function(_0x49505c){try{utils[_0x2f07('0x1a')](util[_0x2f07('0x16')](_0x2f07('0x1b'),_0x49505c[_0x2f07('0x1c')]),_0x49505c);agents[_0x2f07('0x1d')](_0x49505c);}catch(_0xc9790f){utils['error'](util[_0x2f07('0x16')](_0x2f07('0x1b'),_0x49505c[_0x2f07('0x1c')]),_0xc9790f);}});ami['on']('agentringnoanswer',function(_0x8f8b3d){try{utils['debug'](util[_0x2f07('0x16')](_0x2f07('0x1e'),_0x8f8b3d[_0x2f07('0x1c')]),_0x8f8b3d);agents['agentringnoanswer'](_0x8f8b3d);}catch(_0x1aa27a){utils[_0x2f07('0x13')](util[_0x2f07('0x16')](_0x2f07('0x1e'),_0x8f8b3d['uniqueid']),_0x1aa27a);}});ami['on'](_0x2f07('0x1f'),function(_0x3fba9d){try{utils[_0x2f07('0x1a')](util[_0x2f07('0x16')]('[%s][index][agentconnect]',_0x3fba9d[_0x2f07('0x1c')]),_0x3fba9d);agents[_0x2f07('0x1f')](_0x3fba9d);queues['agentconnect'](_0x3fba9d);}catch(_0x47583a){utils[_0x2f07('0x13')](util[_0x2f07('0x16')](_0x2f07('0x20'),_0x3fba9d['uniqueid']),_0x47583a);}});ami['on'](_0x2f07('0x21'),function(_0x39ce12){try{utils[_0x2f07('0x1a')](util[_0x2f07('0x16')](_0x2f07('0x22'),_0x39ce12[_0x2f07('0x1c')]),_0x39ce12);agents[_0x2f07('0x21')](_0x39ce12);queues[_0x2f07('0x21')](_0x39ce12);members[_0x2f07('0x21')](_0x39ce12);}catch(_0x5fdaa6){utils[_0x2f07('0x13')](util[_0x2f07('0x16')](_0x2f07('0x22'),_0x39ce12[_0x2f07('0x1c')]),_0x5fdaa6);}});ami['on']('queuecallerabandon',function(_0x2e2cc9){try{utils[_0x2f07('0x1a')](util[_0x2f07('0x16')]('[%s][index][queuecallerabandon]',_0x2e2cc9[_0x2f07('0x1c')]),_0x2e2cc9);agents[_0x2f07('0x23')](_0x2e2cc9);queues[_0x2f07('0x23')](_0x2e2cc9);}catch(_0x269e7c){utils[_0x2f07('0x13')](util[_0x2f07('0x16')](_0x2f07('0x24'),_0x2e2cc9[_0x2f07('0x1c')]),_0x269e7c);}});ami['on']('queuecallerjoin',function(_0x4bada6){try{utils[_0x2f07('0x1a')](util['format']('[%s][index][queuecallerjoin]',_0x4bada6[_0x2f07('0x1c')]),_0x4bada6);queues[_0x2f07('0x25')](_0x4bada6);recordings[_0x2f07('0x25')](_0x4bada6);}catch(_0x2d6489){utils[_0x2f07('0x13')](util['format']('[%s][index][queuecallerjoin]',_0x4bada6[_0x2f07('0x1c')]),_0x2d6489);}});ami['on'](_0x2f07('0x26'),function(_0x581e14){try{utils['debug'](util['format'](_0x2f07('0x27'),_0x581e14[_0x2f07('0x1c')]),_0x581e14);queues[_0x2f07('0x26')](_0x581e14);}catch(_0x4196c7){utils[_0x2f07('0x13')](util['format'](_0x2f07('0x27'),_0x581e14['uniqueid']),_0x4196c7);}});ami['on'](_0x2f07('0x28'),function(_0x29e854){try{utils[_0x2f07('0x1a')](util['format'](_0x2f07('0x29'),_0x29e854[_0x2f07('0x1c')]),_0x29e854);queues[_0x2f07('0x28')](_0x29e854);calls[_0x2f07('0x28')](_0x29e854);}catch(_0x2881f3){utils[_0x2f07('0x13')](util['format'](_0x2f07('0x29'),_0x29e854[_0x2f07('0x1c')]),_0x2881f3);}});ami['on'](_0x2f07('0x2a'),function(_0x30dc0d){try{utils[_0x2f07('0x1a')](util[_0x2f07('0x16')](_0x2f07('0x2b'),_0x30dc0d[_0x2f07('0x1c')]),_0x30dc0d);queues[_0x2f07('0x2a')](_0x30dc0d);calls[_0x2f07('0x2a')](_0x30dc0d);}catch(_0x3bccc3){utils['error'](util[_0x2f07('0x16')](_0x2f07('0x2b'),_0x30dc0d['uniqueid']),_0x3bccc3);}});ami['on']('newstate',function(_0x2e83a8){try{utils[_0x2f07('0x1a')](util[_0x2f07('0x16')](_0x2f07('0x2c'),_0x2e83a8[_0x2f07('0x1c')]),_0x2e83a8);calls[_0x2f07('0x2d')](_0x2e83a8);recordings[_0x2f07('0x2d')](_0x2e83a8);}catch(_0x477f76){utils[_0x2f07('0x13')](util[_0x2f07('0x16')](_0x2f07('0x2c'),_0x2e83a8['uniqueid']),_0x477f76);}});ami['on']('hangup',function(_0x47bd20){try{utils[_0x2f07('0x1a')](util[_0x2f07('0x16')]('[%s][index][hangup]',_0x47bd20['uniqueid']),_0x47bd20);calls[_0x2f07('0x2e')](_0x47bd20);recordings[_0x2f07('0x2e')](_0x47bd20);dials['hangup'](_0x47bd20);agents[_0x2f07('0x2e')](_0x47bd20);queues[_0x2f07('0x2e')](_0x47bd20);}catch(_0x1ddd04){utils[_0x2f07('0x13')](util[_0x2f07('0x16')](_0x2f07('0x2f'),_0x47bd20[_0x2f07('0x1c')]),_0x1ddd04);}});ami['on'](_0x2f07('0x30'),function(_0x2b3b2e){try{utils[_0x2f07('0x1a')](util[_0x2f07('0x16')](_0x2f07('0x31'),_0x2b3b2e[_0x2f07('0x1c')]),_0x2b3b2e);members['cdr'](_0x2b3b2e);}catch(_0x215b69){utils['error'](util['format'](_0x2f07('0x31'),_0x2b3b2e['uniqueid']),_0x215b69);}});ami['on']('blindtransfer',function(_0x26ab37){try{utils[_0x2f07('0x1a')](util[_0x2f07('0x16')](_0x2f07('0x32'),_0x26ab37['uniqueid']),_0x26ab37);queues[_0x2f07('0x33')](_0x26ab37);agents[_0x2f07('0x33')](_0x26ab37);transfers[_0x2f07('0x33')](_0x26ab37);recordings[_0x2f07('0x33')](_0x26ab37);}catch(_0x393c85){utils[_0x2f07('0x13')](util[_0x2f07('0x16')](_0x2f07('0x32'),_0x26ab37[_0x2f07('0x1c')]),_0x393c85);}});ami['on'](_0x2f07('0x34'),function(_0x59a0e4){try{utils[_0x2f07('0x1a')](util[_0x2f07('0x16')](_0x2f07('0x35'),_0x59a0e4['origtransfereruniqueid']),_0x59a0e4);queues[_0x2f07('0x34')](_0x59a0e4);transfers[_0x2f07('0x34')](_0x59a0e4);agents[_0x2f07('0x34')](_0x59a0e4);calls['attendedtransfer'](_0x59a0e4);}catch(_0x3f8057){utils[_0x2f07('0x13')](util[_0x2f07('0x16')](_0x2f07('0x35'),_0x59a0e4['origtransfereruniqueid']),_0x3f8057);}});ami['on'](_0x2f07('0x36'),function(_0x42aecf){try{utils[_0x2f07('0x1a')](util[_0x2f07('0x16')](_0x2f07('0x37'),_0x42aecf[_0x2f07('0x1c')]),_0x42aecf);queues['varset'](_0x42aecf);recordings[_0x2f07('0x36')](_0x42aecf);calls[_0x2f07('0x36')](_0x42aecf);dials[_0x2f07('0x36')](_0x42aecf);}catch(_0x2bfa3d){utils['error'](util['format'](_0x2f07('0x37'),_0x42aecf['uniqueid']),_0x2bfa3d);}});ami['on'](_0x2f07('0x38'),function(_0x428622){try{utils[_0x2f07('0x1a')](util['format']('[%s][index][newexten]',_0x428622[_0x2f07('0x1c')]),_0x428622);calls['newexten'](_0x428622);recordings['newexten'](_0x428622);dials[_0x2f07('0x38')](_0x428622);}catch(_0x19b81b){utils['error'](util[_0x2f07('0x16')](_0x2f07('0x39'),_0x428622[_0x2f07('0x1c')]),_0x19b81b);}});ami['on']('newchannel',function(_0xd7245b){try{utils[_0x2f07('0x1a')](util['format']('[%s][index][newchannel]',_0xd7245b[_0x2f07('0x1c')]),_0xd7245b);calls[_0x2f07('0x3a')](_0xd7245b);recordings['newchannel'](_0xd7245b);}catch(_0x15d8d9){utils[_0x2f07('0x13')](util['format']('[%s][index][newchannel]',_0xd7245b[_0x2f07('0x1c')]),_0x15d8d9);}});ami['on'](_0x2f07('0x3b'),function(_0x1d5466){try{utils[_0x2f07('0x1a')](util[_0x2f07('0x16')](_0x2f07('0x3c'),_0x1d5466['uniqueid']),_0x1d5466);dials[_0x2f07('0x3b')](_0x1d5466);}catch(_0x1baecd){utils[_0x2f07('0x13')](util['format'](_0x2f07('0x3d'),_0x1d5466['uniqueid']),_0x1baecd);}});ami['on'](_0x2f07('0x3e'),function(_0x1a4b03){try{utils['debug'](util[_0x2f07('0x16')](_0x2f07('0x3f'),_0x1a4b03[_0x2f07('0x1c')]),_0x1a4b03);dials[_0x2f07('0x3e')](_0x1a4b03);}catch(_0x208c52){utils['error'](util[_0x2f07('0x16')](_0x2f07('0x3f'),_0x1a4b03[_0x2f07('0x1c')]),_0x208c52);}});} \ No newline at end of file +var _0x3522=['debug','[%s][index][devicestatechange]','device','format','agentcalled','[%s][index][agentcalled]','uniqueid','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','[%s][index][queuecallerleave]','queuecallerleave','musiconholdstart','[%s][index][musiconholdstart]','[%s][index][musiconholdstop]','musiconholdstop','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','[%s][index][blindtransfer]','blindtransfer','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','dialend','[%s][index][dialend]','asterisk-manager','./utils','util','asterisk','port','username','keepConnected','disabled','XDR\x20DISABLED','./calls.controller','./queues.controller','./members.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','devicestatechange'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x3522,0xa9));var _0x2352=function(_0x4a9c1e,_0x2dfb18){_0x4a9c1e=_0x4a9c1e-0x0;var _0x417b7c=_0x3522[_0x4a9c1e];return _0x417b7c;};var AsteriskManager=require(_0x2352('0x0'));var config=require('../../config/environment');var utils=require(_0x2352('0x1'));var util=require(_0x2352('0x2'));var ami=new AsteriskManager(config[_0x2352('0x3')][_0x2352('0x4')],config[_0x2352('0x3')]['ip'],config[_0x2352('0x3')][_0x2352('0x5')],config[_0x2352('0x3')]['password'],!![]);ami[_0x2352('0x6')]();if(config['xdr']&&config['xdr'][_0x2352('0x7')]){utils['info'](_0x2352('0x8'));}else{var agents=require('./agents.controller');var calls=require(_0x2352('0x9'));var queues=require(_0x2352('0xa'));var recordings=require('./recordings.controller');var members=require(_0x2352('0xb'));var dials=require('./dials.controller');var transfers=require(_0x2352('0xc'));var core=require(_0x2352('0xd'));ami['on'](_0x2352('0xe'),core[_0x2352('0xe')]);ami['on'](_0x2352('0xf'),core[_0x2352('0xf')]);ami['on'](_0x2352('0x10'),core[_0x2352('0x10')]);ami['on'](_0x2352('0x11'),core[_0x2352('0x11')]);ami['on'](_0x2352('0x12'),core[_0x2352('0x12')]);ami['on']('managerevent',core['managerevent']);ami['on'](_0x2352('0x13'),function(_0x180c4a){try{utils[_0x2352('0x14')](util['format'](_0x2352('0x15'),_0x180c4a[_0x2352('0x16')]),_0x180c4a);members['devicestatechange'](_0x180c4a);}catch(_0x3f345b){utils[_0x2352('0x11')](util[_0x2352('0x17')](_0x2352('0x15'),_0x180c4a[_0x2352('0x16')]),_0x3f345b);}});ami['on'](_0x2352('0x18'),function(_0x2fc59){try{utils[_0x2352('0x14')](util['format'](_0x2352('0x19'),_0x2fc59['uniqueid']),_0x2fc59);agents[_0x2352('0x18')](_0x2fc59);}catch(_0x14b3dc){utils['error'](util[_0x2352('0x17')](_0x2352('0x19'),_0x2fc59[_0x2352('0x1a')]),_0x14b3dc);}});ami['on']('agentringnoanswer',function(_0x4896d3){try{utils[_0x2352('0x14')](util[_0x2352('0x17')]('[%s][index][agentringnoanswer]',_0x4896d3[_0x2352('0x1a')]),_0x4896d3);agents['agentringnoanswer'](_0x4896d3);}catch(_0x34df2a){utils[_0x2352('0x11')](util[_0x2352('0x17')](_0x2352('0x1b'),_0x4896d3[_0x2352('0x1a')]),_0x34df2a);}});ami['on'](_0x2352('0x1c'),function(_0x2ba10e){try{utils['debug'](util[_0x2352('0x17')](_0x2352('0x1d'),_0x2ba10e['uniqueid']),_0x2ba10e);agents[_0x2352('0x1c')](_0x2ba10e);queues['agentconnect'](_0x2ba10e);}catch(_0x265492){utils['error'](util[_0x2352('0x17')](_0x2352('0x1d'),_0x2ba10e[_0x2352('0x1a')]),_0x265492);}});ami['on'](_0x2352('0x1e'),function(_0x5717de){try{utils[_0x2352('0x14')](util['format'](_0x2352('0x1f'),_0x5717de[_0x2352('0x1a')]),_0x5717de);agents[_0x2352('0x1e')](_0x5717de);queues[_0x2352('0x1e')](_0x5717de);members[_0x2352('0x1e')](_0x5717de);}catch(_0x29565b){utils[_0x2352('0x11')](util[_0x2352('0x17')](_0x2352('0x1f'),_0x5717de['uniqueid']),_0x29565b);}});ami['on'](_0x2352('0x20'),function(_0x5ce448){try{utils['debug'](util[_0x2352('0x17')]('[%s][index][queuecallerabandon]',_0x5ce448['uniqueid']),_0x5ce448);agents[_0x2352('0x20')](_0x5ce448);queues[_0x2352('0x20')](_0x5ce448);}catch(_0x329f57){utils['error'](util['format'](_0x2352('0x21'),_0x5ce448[_0x2352('0x1a')]),_0x329f57);}});ami['on'](_0x2352('0x22'),function(_0x596c45){try{utils[_0x2352('0x14')](util[_0x2352('0x17')](_0x2352('0x23'),_0x596c45[_0x2352('0x1a')]),_0x596c45);queues[_0x2352('0x22')](_0x596c45);recordings[_0x2352('0x22')](_0x596c45);}catch(_0x232c51){utils['error'](util[_0x2352('0x17')](_0x2352('0x23'),_0x596c45[_0x2352('0x1a')]),_0x232c51);}});ami['on']('queuecallerleave',function(_0x520231){try{utils['debug'](util[_0x2352('0x17')](_0x2352('0x24'),_0x520231['uniqueid']),_0x520231);queues[_0x2352('0x25')](_0x520231);}catch(_0x5609e7){utils[_0x2352('0x11')](util[_0x2352('0x17')](_0x2352('0x24'),_0x520231[_0x2352('0x1a')]),_0x5609e7);}});ami['on'](_0x2352('0x26'),function(_0x26cf7b){try{utils[_0x2352('0x14')](util['format']('[%s][index][musiconholdstart]',_0x26cf7b[_0x2352('0x1a')]),_0x26cf7b);queues[_0x2352('0x26')](_0x26cf7b);calls[_0x2352('0x26')](_0x26cf7b);}catch(_0x1a1daa){utils['error'](util[_0x2352('0x17')](_0x2352('0x27'),_0x26cf7b[_0x2352('0x1a')]),_0x1a1daa);}});ami['on']('musiconholdstop',function(_0x1714ed){try{utils[_0x2352('0x14')](util['format'](_0x2352('0x28'),_0x1714ed[_0x2352('0x1a')]),_0x1714ed);queues[_0x2352('0x29')](_0x1714ed);calls[_0x2352('0x29')](_0x1714ed);}catch(_0x450966){utils['error'](util[_0x2352('0x17')](_0x2352('0x28'),_0x1714ed[_0x2352('0x1a')]),_0x450966);}});ami['on'](_0x2352('0x2a'),function(_0x1b380b){try{utils[_0x2352('0x14')](util[_0x2352('0x17')](_0x2352('0x2b'),_0x1b380b[_0x2352('0x1a')]),_0x1b380b);calls[_0x2352('0x2a')](_0x1b380b);recordings['newstate'](_0x1b380b);}catch(_0x2095de){utils[_0x2352('0x11')](util[_0x2352('0x17')](_0x2352('0x2b'),_0x1b380b[_0x2352('0x1a')]),_0x2095de);}});ami['on'](_0x2352('0x2c'),function(_0xb4f115){try{utils[_0x2352('0x14')](util[_0x2352('0x17')](_0x2352('0x2d'),_0xb4f115[_0x2352('0x1a')]),_0xb4f115);calls[_0x2352('0x2c')](_0xb4f115);recordings[_0x2352('0x2c')](_0xb4f115);dials[_0x2352('0x2c')](_0xb4f115);agents[_0x2352('0x2c')](_0xb4f115);queues[_0x2352('0x2c')](_0xb4f115);}catch(_0xc1042f){utils[_0x2352('0x11')](util['format'](_0x2352('0x2d'),_0xb4f115[_0x2352('0x1a')]),_0xc1042f);}});ami['on'](_0x2352('0x2e'),function(_0x1ac4c3){try{utils[_0x2352('0x14')](util[_0x2352('0x17')]('[%s][index][cdr]',_0x1ac4c3[_0x2352('0x1a')]),_0x1ac4c3);members[_0x2352('0x2e')](_0x1ac4c3);}catch(_0x27c825){utils[_0x2352('0x11')](util[_0x2352('0x17')](_0x2352('0x2f'),_0x1ac4c3[_0x2352('0x1a')]),_0x27c825);}});ami['on']('blindtransfer',function(_0x2d0ac2){try{utils['debug'](util[_0x2352('0x17')](_0x2352('0x30'),_0x2d0ac2['uniqueid']),_0x2d0ac2);queues[_0x2352('0x31')](_0x2d0ac2);agents[_0x2352('0x31')](_0x2d0ac2);transfers['blindtransfer'](_0x2d0ac2);recordings[_0x2352('0x31')](_0x2d0ac2);}catch(_0xa2f4de){utils[_0x2352('0x11')](util[_0x2352('0x17')]('[%s][index][blindtransfer]',_0x2d0ac2[_0x2352('0x1a')]),_0xa2f4de);}});ami['on'](_0x2352('0x32'),function(_0xa1499d){try{utils[_0x2352('0x14')](util[_0x2352('0x17')](_0x2352('0x33'),_0xa1499d[_0x2352('0x34')]),_0xa1499d);queues[_0x2352('0x32')](_0xa1499d);transfers[_0x2352('0x32')](_0xa1499d);agents[_0x2352('0x32')](_0xa1499d);calls[_0x2352('0x32')](_0xa1499d);}catch(_0x4211a5){utils[_0x2352('0x11')](util['format']('[%s][index][attendedtransfer]',_0xa1499d[_0x2352('0x34')]),_0x4211a5);}});ami['on'](_0x2352('0x35'),function(_0x212743){try{utils[_0x2352('0x14')](util[_0x2352('0x17')](_0x2352('0x36'),_0x212743[_0x2352('0x1a')]),_0x212743);queues[_0x2352('0x35')](_0x212743);recordings[_0x2352('0x35')](_0x212743);calls[_0x2352('0x35')](_0x212743);dials[_0x2352('0x35')](_0x212743);}catch(_0x4d4a8c){utils[_0x2352('0x11')](util['format'](_0x2352('0x36'),_0x212743[_0x2352('0x1a')]),_0x4d4a8c);}});ami['on'](_0x2352('0x37'),function(_0x261d75){try{utils[_0x2352('0x14')](util[_0x2352('0x17')](_0x2352('0x38'),_0x261d75[_0x2352('0x1a')]),_0x261d75);calls[_0x2352('0x37')](_0x261d75);recordings['newexten'](_0x261d75);dials[_0x2352('0x37')](_0x261d75);}catch(_0x3bcfaf){utils[_0x2352('0x11')](util[_0x2352('0x17')](_0x2352('0x38'),_0x261d75[_0x2352('0x1a')]),_0x3bcfaf);}});ami['on'](_0x2352('0x39'),function(_0x57fa7f){try{utils[_0x2352('0x14')](util[_0x2352('0x17')](_0x2352('0x3a'),_0x57fa7f[_0x2352('0x1a')]),_0x57fa7f);calls[_0x2352('0x39')](_0x57fa7f);recordings[_0x2352('0x39')](_0x57fa7f);}catch(_0x964bfa){utils[_0x2352('0x11')](util[_0x2352('0x17')](_0x2352('0x3a'),_0x57fa7f[_0x2352('0x1a')]),_0x964bfa);}});ami['on'](_0x2352('0x3b'),function(_0x2c3528){try{utils[_0x2352('0x14')](util[_0x2352('0x17')](_0x2352('0x3c'),_0x2c3528['uniqueid']),_0x2c3528);dials[_0x2352('0x3b')](_0x2c3528);}catch(_0x50f990){utils['error'](util[_0x2352('0x17')]('[%s]dialbegin',_0x2c3528[_0x2352('0x1a')]),_0x50f990);}});ami['on'](_0x2352('0x3d'),function(_0x40efbc){try{utils[_0x2352('0x14')](util[_0x2352('0x17')](_0x2352('0x3e'),_0x40efbc[_0x2352('0x1a')]),_0x40efbc);dials[_0x2352('0x3d')](_0x40efbc);}catch(_0x20a825){utils[_0x2352('0x11')](util[_0x2352('0x17')](_0x2352('0x3e'),_0x40efbc['uniqueid']),_0x20a825);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 5a280e9..8d9e6b9 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 _0x8d53=['cdr','[%s][members][cdr]','channel','data1','source','data3','destination','destinationchannel','isNil','lodash','util','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','data2','membername','type','getUserByInterface','then','internal','CreateMemberReport','getUserByName','split','name','catch','error','[%s][members][writeDB]','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','state','INUSE','BUSY','TALKING','NOT_INUSE','exitAt','now','diffTime','enterAt','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign'];(function(_0x1a72f3,_0x217011){var _0x57ef47=function(_0x20123d){while(--_0x20123d){_0x1a72f3['push'](_0x1a72f3['shift']());}};_0x57ef47(++_0x217011);}(_0x8d53,0x1c2));var _0x38d5=function(_0x10c1d3,_0x5af8f){_0x10c1d3=_0x10c1d3-0x0;var _0x755407=_0x8d53[_0x10c1d3];return _0x755407;};'use strict';var _=require(_0x38d5('0x0'));var util=require(_0x38d5('0x1'));var utils=require('./utils');var members={};var exclude=[_0x38d5('0x2'),_0x38d5('0x3')];function writeDB(_0x108137){utils[_0x38d5('0x4')](util[_0x38d5('0x5')](_0x38d5('0x6'),_0x108137[_0x38d5('0x7')],_0x108137[_0x38d5('0x8')],_0x108137['channel'],_0x108137[_0x38d5('0x9')],_0x108137[_0x38d5('0xa')],_0x108137[_0x38d5('0xb')]));if(_0x108137['interface']){utils[_0x38d5('0xc')](_0x108137[_0x38d5('0x8')])[_0x38d5('0xd')](function(_0x2e8c98){if(_0x2e8c98){_0x108137[_0x38d5('0xa')]=_0x2e8c98['name'];_0x108137[_0x38d5('0xe')]=_0x2e8c98[_0x38d5('0xe')];utils['request'](_0x38d5('0xf'),_0x108137);}else{utils[_0x38d5('0x10')](_0x108137[_0x38d5('0x8')][_0x38d5('0x11')]('/')[0x1])['then'](function(_0x4d00ed){if(_0x4d00ed){_0x108137[_0x38d5('0xa')]=_0x4d00ed[_0x38d5('0x12')];_0x108137['internal']=_0x4d00ed[_0x38d5('0xe')];utils['request'](_0x38d5('0xf'),_0x108137);}});}})[_0x38d5('0x13')](function(_0x13e5b6){utils[_0x38d5('0x14')](util[_0x38d5('0x5')](_0x38d5('0x15'),_0x108137['uniqueid']),_0x13e5b6);});}delete members[_0x108137[_0x38d5('0x8')]];}function startsWith(_0x4c8f0f,_0xa455d1){return _['some'](_0x4c8f0f,function(_0x44cfa8){return _[_0x38d5('0x16')](_0xa455d1,_0x44cfa8);});}exports[_0x38d5('0x17')]=function(_0x4e98df){try{utils[_0x38d5('0x18')](util[_0x38d5('0x5')](_0x38d5('0x19'),members[_0x4e98df[_0x38d5('0x1a')]]?members[_0x4e98df[_0x38d5('0x1a')]][_0x38d5('0x7')]:_0x4e98df['device']),_0x4e98df);utils[_0x38d5('0x4')](util['format']('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x4e98df['device']]?members[_0x4e98df[_0x38d5('0x1a')]][_0x38d5('0x7')]:_0x4e98df[_0x38d5('0x1a')],_0x4e98df['state'],_0x4e98df['device']));switch(_0x4e98df[_0x38d5('0x1b')]){case _0x38d5('0x1c'):case _0x38d5('0x1d'):if(!startsWith(exclude,_0x4e98df['device'])){members[_0x4e98df[_0x38d5('0x1a')]]={'channel':'voice','interface':_0x4e98df[_0x38d5('0x1a')],'type':_0x38d5('0x1e'),'enterAt':utils['now'](),'role':'agent'};}break;case _0x38d5('0x1f'):if(!_['isNil'](members[_0x4e98df[_0x38d5('0x1a')]])){members[_0x4e98df['device']][_0x38d5('0x20')]=utils[_0x38d5('0x21')]();members[_0x4e98df[_0x38d5('0x1a')]]['duration']=utils[_0x38d5('0x22')](members[_0x4e98df[_0x38d5('0x1a')]]['exitAt'],members[_0x4e98df[_0x38d5('0x1a')]][_0x38d5('0x23')]);if(members[_0x4e98df[_0x38d5('0x1a')]][_0x38d5('0x7')]){writeDB(members[_0x4e98df[_0x38d5('0x1a')]]);}}break;default:break;}}catch(_0x295591){utils[_0x38d5('0x14')](util[_0x38d5('0x5')](_0x38d5('0x19'),members[_0x4e98df[_0x38d5('0x1a')]]?members[_0x4e98df[_0x38d5('0x1a')]][_0x38d5('0x7')]:_0x4e98df[_0x38d5('0x1a')]),_0x295591);}};exports['agentcomplete']=function(_0x514d2f){try{if(!_['isNil'](members[_0x514d2f[_0x38d5('0x8')]])){utils[_0x38d5('0x18')](util['format'](_0x38d5('0x24'),_0x514d2f[_0x38d5('0x7')]),_0x514d2f);utils[_0x38d5('0x4')](util[_0x38d5('0x5')](_0x38d5('0x25'),_0x514d2f['uniqueid'],_0x514d2f[_0x38d5('0x8')],_0x514d2f[_0x38d5('0x26')]));members[_0x514d2f[_0x38d5('0x8')]]=_[_0x38d5('0x27')](members[_0x514d2f['interface']],{'data4':_0x514d2f[_0x38d5('0x26')],'uniqueid':_0x514d2f['uniqueid']});}}catch(_0x1bb116){utils['error'](util[_0x38d5('0x5')](_0x38d5('0x24'),_0x514d2f['uniqueid']),_0x1bb116);}};exports[_0x38d5('0x28')]=function(_0xcc3677){try{utils[_0x38d5('0x18')](util['format'](_0x38d5('0x29'),_0xcc3677['uniqueid']),_0xcc3677);if(_0xcc3677[_0x38d5('0x2a')]){var _0x469a0e=_0xcc3677[_0x38d5('0x2a')][_0x38d5('0x11')]('-')[0x0];if(!_['isNil'](members[_0x469a0e])){members[_0x469a0e]=_[_0x38d5('0x27')](members[_0x469a0e],{'data1':members[_0x469a0e][_0x38d5('0x2b')]||_0xcc3677['type'],'data2':members[_0x469a0e][_0x38d5('0x9')]||_0xcc3677[_0x38d5('0x2c')],'data3':members[_0x469a0e][_0x38d5('0x2d')]||_0xcc3677[_0x38d5('0x2e')],'uniqueid':members[_0x469a0e][_0x38d5('0x7')]||_0xcc3677[_0x38d5('0x7')]});utils[_0x38d5('0x4')](util[_0x38d5('0x5')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0xcc3677[_0x38d5('0x7')],members[_0x469a0e]['data1'],members[_0x469a0e][_0x38d5('0x9')],members[_0x469a0e][_0x38d5('0x2d')]));if(members[_0x469a0e][_0x38d5('0x20')]){writeDB(members[_0x469a0e]);}}}if(_0xcc3677['destinationchannel']){var _0x4999a2=_0xcc3677[_0x38d5('0x2f')][_0x38d5('0x11')]('-')[0x0];if(!_[_0x38d5('0x30')](members[_0x4999a2])){members[_0x4999a2]=_['assign'](members[_0x4999a2],{'data1':members[_0x4999a2]['data1']||_0xcc3677[_0x38d5('0xb')],'data2':members[_0x4999a2][_0x38d5('0x9')]||_0xcc3677[_0x38d5('0x2c')],'data3':members[_0x4999a2][_0x38d5('0x2d')]||_0xcc3677['destination'],'uniqueid':members[_0x4999a2][_0x38d5('0x7')]||_0xcc3677[_0x38d5('0x7')]});utils[_0x38d5('0x4')](util[_0x38d5('0x5')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0xcc3677['uniqueid'],members[_0x4999a2]['data1'],members[_0x4999a2][_0x38d5('0x9')],members[_0x4999a2][_0x38d5('0x2d')]));if(members[_0x4999a2][_0x38d5('0x20')]){writeDB(members[_0x4999a2]);}}}}catch(_0x19f46f){utils[_0x38d5('0x14')](util[_0x38d5('0x5')]('[%s][members][cdr]',_0xcc3677[_0x38d5('0x7')]),_0x19f46f);}}; \ No newline at end of file +var _0xcebd=['data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','source','lodash','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','membername','type','then','internal','request','CreateMemberReport','name','catch','error','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','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','[%s][members][agentcomplete]','[%s][members][cdr]','channel','split','assign','data1','data2'];(function(_0x45fe9c,_0x55e0d7){var _0x233d48=function(_0xa2ba2e){while(--_0xa2ba2e){_0x45fe9c['push'](_0x45fe9c['shift']());}};_0x233d48(++_0x55e0d7);}(_0xcebd,0x15c));var _0xdceb=function(_0x562416,_0x4b979f){_0x562416=_0x562416-0x0;var _0x49498a=_0xcebd[_0x562416];return _0x49498a;};'use strict';var _=require(_0xdceb('0x0'));var util=require('util');var utils=require(_0xdceb('0x1'));var members={};var exclude=[_0xdceb('0x2'),_0xdceb('0x3')];function writeDB(_0x4b1472){utils[_0xdceb('0x4')](util[_0xdceb('0x5')](_0xdceb('0x6'),_0x4b1472[_0xdceb('0x7')],_0x4b1472[_0xdceb('0x8')],_0x4b1472['channel'],_0x4b1472['data2'],_0x4b1472[_0xdceb('0x9')],_0x4b1472[_0xdceb('0xa')]));if(_0x4b1472[_0xdceb('0x8')]){utils['getUserByInterface'](_0x4b1472[_0xdceb('0x8')])[_0xdceb('0xb')](function(_0x18c45d){if(_0x18c45d){_0x4b1472[_0xdceb('0x9')]=_0x18c45d['name'];_0x4b1472[_0xdceb('0xc')]=_0x18c45d['internal'];utils[_0xdceb('0xd')](_0xdceb('0xe'),_0x4b1472);}else{utils['getUserByName'](_0x4b1472[_0xdceb('0x8')]['split']('/')[0x1])[_0xdceb('0xb')](function(_0x5bded7){if(_0x5bded7){_0x4b1472[_0xdceb('0x9')]=_0x5bded7[_0xdceb('0xf')];_0x4b1472[_0xdceb('0xc')]=_0x5bded7[_0xdceb('0xc')];utils['request'](_0xdceb('0xe'),_0x4b1472);}});}})[_0xdceb('0x10')](function(_0x426b34){utils[_0xdceb('0x11')](util[_0xdceb('0x5')]('[%s][members][writeDB]',_0x4b1472[_0xdceb('0x7')]),_0x426b34);});}delete members[_0x4b1472[_0xdceb('0x8')]];}function startsWith(_0x4fc8ea,_0x213e80){return _[_0xdceb('0x12')](_0x4fc8ea,function(_0x45ff2d){return _['startsWith'](_0x213e80,_0x45ff2d);});}exports[_0xdceb('0x13')]=function(_0x434de3){try{utils[_0xdceb('0x14')](util[_0xdceb('0x5')](_0xdceb('0x15'),members[_0x434de3[_0xdceb('0x16')]]?members[_0x434de3['device']]['uniqueid']:_0x434de3[_0xdceb('0x16')]),_0x434de3);utils[_0xdceb('0x4')](util['format'](_0xdceb('0x17'),members[_0x434de3[_0xdceb('0x16')]]?members[_0x434de3[_0xdceb('0x16')]][_0xdceb('0x7')]:_0x434de3['device'],_0x434de3['state'],_0x434de3[_0xdceb('0x16')]));switch(_0x434de3[_0xdceb('0x18')]){case _0xdceb('0x19'):case _0xdceb('0x1a'):if(!startsWith(exclude,_0x434de3[_0xdceb('0x16')])){members[_0x434de3[_0xdceb('0x16')]]={'channel':'voice','interface':_0x434de3[_0xdceb('0x16')],'type':_0xdceb('0x1b'),'enterAt':utils[_0xdceb('0x1c')](),'role':_0xdceb('0x1d')};}break;case _0xdceb('0x1e'):if(!_[_0xdceb('0x1f')](members[_0x434de3[_0xdceb('0x16')]])){members[_0x434de3[_0xdceb('0x16')]][_0xdceb('0x20')]=utils[_0xdceb('0x1c')]();members[_0x434de3[_0xdceb('0x16')]][_0xdceb('0x21')]=utils[_0xdceb('0x22')](members[_0x434de3[_0xdceb('0x16')]][_0xdceb('0x20')],members[_0x434de3[_0xdceb('0x16')]]['enterAt']);if(members[_0x434de3[_0xdceb('0x16')]][_0xdceb('0x7')]){writeDB(members[_0x434de3[_0xdceb('0x16')]]);}}break;default:break;}}catch(_0x4e5ca2){utils[_0xdceb('0x11')](util[_0xdceb('0x5')](_0xdceb('0x15'),members[_0x434de3[_0xdceb('0x16')]]?members[_0x434de3['device']]['uniqueid']:_0x434de3['device']),_0x4e5ca2);}};exports['agentcomplete']=function(_0x587d95){try{if(!_['isNil'](members[_0x587d95[_0xdceb('0x8')]])){utils['debug'](util[_0xdceb('0x5')]('[%s][members][agentcomplete]',_0x587d95[_0xdceb('0x7')]),_0x587d95);utils[_0xdceb('0x4')](util['format'](_0xdceb('0x23'),_0x587d95[_0xdceb('0x7')],_0x587d95[_0xdceb('0x8')],_0x587d95[_0xdceb('0x24')]));members[_0x587d95[_0xdceb('0x8')]]=_['assign'](members[_0x587d95[_0xdceb('0x8')]],{'data4':_0x587d95[_0xdceb('0x24')],'uniqueid':_0x587d95[_0xdceb('0x7')]});}}catch(_0x136c17){utils[_0xdceb('0x11')](util[_0xdceb('0x5')](_0xdceb('0x25'),_0x587d95[_0xdceb('0x7')]),_0x136c17);}};exports['cdr']=function(_0x46a04c){try{utils['debug'](util[_0xdceb('0x5')](_0xdceb('0x26'),_0x46a04c[_0xdceb('0x7')]),_0x46a04c);if(_0x46a04c[_0xdceb('0x27')]){var _0x4fea13=_0x46a04c[_0xdceb('0x27')][_0xdceb('0x28')]('-')[0x0];if(!_[_0xdceb('0x1f')](members[_0x4fea13])){members[_0x4fea13]=_[_0xdceb('0x29')](members[_0x4fea13],{'data1':members[_0x4fea13][_0xdceb('0x2a')]||_0x46a04c['type'],'data2':members[_0x4fea13][_0xdceb('0x2b')]||_0x46a04c['source'],'data3':members[_0x4fea13][_0xdceb('0x2c')]||_0x46a04c[_0xdceb('0x2d')],'uniqueid':members[_0x4fea13]['uniqueid']||_0x46a04c['uniqueid']});utils[_0xdceb('0x4')](util[_0xdceb('0x5')](_0xdceb('0x2e'),_0x46a04c[_0xdceb('0x7')],members[_0x4fea13][_0xdceb('0x2a')],members[_0x4fea13]['data2'],members[_0x4fea13]['data3']));if(members[_0x4fea13][_0xdceb('0x20')]){writeDB(members[_0x4fea13]);}}}if(_0x46a04c[_0xdceb('0x2f')]){var _0x4f3972=_0x46a04c[_0xdceb('0x2f')][_0xdceb('0x28')]('-')[0x0];if(!_['isNil'](members[_0x4f3972])){members[_0x4f3972]=_['assign'](members[_0x4f3972],{'data1':members[_0x4f3972]['data1']||_0x46a04c[_0xdceb('0xa')],'data2':members[_0x4f3972][_0xdceb('0x2b')]||_0x46a04c[_0xdceb('0x30')],'data3':members[_0x4f3972][_0xdceb('0x2c')]||_0x46a04c[_0xdceb('0x2d')],'uniqueid':members[_0x4f3972][_0xdceb('0x7')]||_0x46a04c['uniqueid']});utils[_0xdceb('0x4')](util[_0xdceb('0x5')](_0xdceb('0x2e'),_0x46a04c[_0xdceb('0x7')],members[_0x4f3972][_0xdceb('0x2a')],members[_0x4f3972][_0xdceb('0x2b')],members[_0x4f3972][_0xdceb('0x2c')]));if(members[_0x4f3972][_0xdceb('0x20')]){writeDB(members[_0x4f3972]);}}}}catch(_0x27ec0c){utils[_0xdceb('0x11')](util[_0xdceb('0x5')](_0xdceb('0x26'),_0x46a04c[_0xdceb('0x7')]),_0x27ec0c);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 44d7d95..561d6ac 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 _0x33ff=['format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','varset','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','connectedlinenum','connectedlinename','holdtime','diffTime','count','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','accountcode','lastAssignedTo','agentcomplete','[%s][queues][agentcomplete]','transfer','TRANSFER','COMPLETEDBY','reason','transfereeuniqueid','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][blindtransfer]','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','transfereelinkedid','queuecallerenterreason','clone','transfertargetuniqueid','calleridname','queuecallerjoinAt','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','ATTENDED','transfertargetlinkedid','calleridnum','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info'];(function(_0x102402,_0x4eaaf8){var _0x321b44=function(_0x198c94){while(--_0x198c94){_0x102402['push'](_0x102402['shift']());}};_0x321b44(++_0x4eaaf8);}(_0x33ff,0x64));var _0xf33f=function(_0x24e0c9,_0x284109){_0x24e0c9=_0x24e0c9-0x0;var _0x4448f0=_0x33ff[_0x24e0c9];return _0x4448f0;};'use strict';var _=require(_0xf33f('0x0'));var util=require(_0xf33f('0x1'));var utils=require(_0xf33f('0x2'));var queues={};function writeDB(_0x498e5e){utils[_0xf33f('0x3')](util[_0xf33f('0x4')](_0xf33f('0x5'),_0x498e5e[_0xf33f('0x6')],_0x498e5e[_0xf33f('0x7')],_0x498e5e[_0xf33f('0x8')],_0x498e5e['lastAssignedTo'],_0x498e5e['calleridnum'],_0x498e5e['accountcode'],_0x498e5e[_0xf33f('0x9')]));if(_0x498e5e[_0xf33f('0x8')]){utils[_0xf33f('0xa')](_0x498e5e[_0xf33f('0x8')])[_0xf33f('0xb')](function(_0x5dd9b1){if(_0x5dd9b1){_0x498e5e[_0xf33f('0xc')]=_0x5dd9b1[_0xf33f('0xc')];}utils[_0xf33f('0xd')](_0xf33f('0xe'),_0x498e5e);});}else{utils[_0xf33f('0xd')](_0xf33f('0xe'),_0x498e5e);}if(_0x498e5e[_0xf33f('0xf')]){delete queues[_0x498e5e[_0xf33f('0xf')]];}else{delete queues[_0x498e5e['uniqueid']];}}exports[_0xf33f('0x10')]=function(_0x48d504){try{utils[_0xf33f('0x11')](util[_0xf33f('0x4')](_0xf33f('0x12'),_0x48d504[_0xf33f('0x6')]),_0x48d504);utils['info'](util[_0xf33f('0x4')](_0xf33f('0x13'),_0x48d504['uniqueid'],_0x48d504[_0xf33f('0x8')],_0x48d504[_0xf33f('0x14')]));queues[_0x48d504['uniqueid']]=_[_0xf33f('0x15')](_0x48d504,{'originalposition':_0x48d504[_0xf33f('0x14')],'queuecallerjoinAt':utils[_0xf33f('0x16')](),'mohtime':0x0});}catch(_0x5dfc94){utils[_0xf33f('0x17')](util['format'](_0xf33f('0x12'),_0x48d504['uniqueid']),_0x5dfc94);}};exports[_0xf33f('0x18')]=function(_0x6da65a){try{if(!_[_0xf33f('0x19')](queues[_0x6da65a[_0xf33f('0x6')]])){utils['debug'](util[_0xf33f('0x4')](_0xf33f('0x1a'),_0x6da65a['uniqueid']),_0x6da65a);if(queues[_0x6da65a[_0xf33f('0x6')]][_0xf33f('0x1b')]){if(!queues[_0x6da65a['uniqueid']][_0xf33f('0x1c')]&&!queues[_0x6da65a[_0xf33f('0x6')]][_0xf33f('0x1d')]){queues[_0x6da65a[_0xf33f('0x6')]][_0xf33f('0x1e')]=!![];queues[_0x6da65a[_0xf33f('0x6')]][_0xf33f('0x1f')]=utils[_0xf33f('0x16')]();queues[_0x6da65a[_0xf33f('0x6')]][_0xf33f('0x9')]=_0xf33f('0x20');}utils[_0xf33f('0x3')](util[_0xf33f('0x4')](_0xf33f('0x21'),_0x6da65a[_0xf33f('0x6')],queues[_0x6da65a[_0xf33f('0x6')]][_0xf33f('0x22')],queues[_0x6da65a[_0xf33f('0x6')]][_0xf33f('0x9')]));writeDB(queues[_0x6da65a[_0xf33f('0x6')]]);}else if(queues[_0x6da65a[_0xf33f('0x6')]][_0xf33f('0xf')]){utils['info'](util[_0xf33f('0x4')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x6da65a[_0xf33f('0x6')],queues[_0x6da65a[_0xf33f('0x6')]]['name'],queues[_0x6da65a[_0xf33f('0x6')]]['transfereduniqueid']));queues[queues[_0x6da65a[_0xf33f('0x6')]][_0xf33f('0xf')]]=queues[_0x6da65a[_0xf33f('0x6')]];queues[queues[_0x6da65a[_0xf33f('0x6')]]['transfereduniqueid']]['queuecallerenterreason']=0x2;delete queues[_0x6da65a[_0xf33f('0x6')]];}}}catch(_0x5e1b37){utils[_0xf33f('0x17')](util[_0xf33f('0x4')](_0xf33f('0x1a'),_0x6da65a[_0xf33f('0x6')]),_0x5e1b37);}};exports[_0xf33f('0x23')]=function(_0x3fa70f){try{utils['debug'](util[_0xf33f('0x4')](_0xf33f('0x24'),_0x3fa70f[_0xf33f('0x6')]),_0x3fa70f);if(!_[_0xf33f('0x19')](_0x3fa70f[_0xf33f('0x25')][_0xf33f('0x26')])&&_0x3fa70f[_0xf33f('0x27')][_0xf33f('0x28')]()!==_0xf33f('0x29')){if(!_['isNil'](queues[_0x3fa70f['uniqueid']])){queues[_0x3fa70f[_0xf33f('0x6')]][_0xf33f('0x1c')]=![];queues[_0x3fa70f['uniqueid']][_0xf33f('0x2a')]=null;queues[_0x3fa70f['uniqueid']]['queuecallerexit']=!![];queues[_0x3fa70f[_0xf33f('0x6')]][_0xf33f('0x2b')]=utils[_0xf33f('0x16')]();queues[_0x3fa70f[_0xf33f('0x6')]][_0xf33f('0x9')]=_0x3fa70f[_0xf33f('0x27')][_0xf33f('0x28')]();utils[_0xf33f('0x3')](util['format'](_0xf33f('0x2c'),_0x3fa70f[_0xf33f('0x6')],queues[_0x3fa70f[_0xf33f('0x6')]][_0xf33f('0x22')],_0x3fa70f[_0xf33f('0x27')],queues[_0x3fa70f[_0xf33f('0x6')]]['queuecallerexitreason']));writeDB(queues[_0x3fa70f[_0xf33f('0x6')]]);}}else if(!_[_0xf33f('0x19')](_0x3fa70f[_0xf33f('0x25')]['queueposition'])){if(!_['isNil'](queues[_0x3fa70f['uniqueid']])&&!queues[_0x3fa70f[_0xf33f('0x6')]][_0xf33f('0x1c')]){queues[_0x3fa70f[_0xf33f('0x6')]]['queuecallerabandon']=![];queues[_0x3fa70f[_0xf33f('0x6')]][_0xf33f('0x2a')]=null;queues[_0x3fa70f[_0xf33f('0x6')]][_0xf33f('0x1d')]=!![];queues[_0x3fa70f[_0xf33f('0x6')]][_0xf33f('0x2b')]=utils[_0xf33f('0x16')]();queues[_0x3fa70f[_0xf33f('0x6')]]['queuecallerexitreason']='EXITWITHKEY';utils[_0xf33f('0x3')](util['format'](_0xf33f('0x2d'),_0x3fa70f['uniqueid'],queues[_0x3fa70f[_0xf33f('0x6')]]['name'],_0x3fa70f[_0xf33f('0x27')],queues[_0x3fa70f['uniqueid']][_0xf33f('0x9')]));}}}catch(_0x414865){utils[_0xf33f('0x17')](util['format'](_0xf33f('0x24'),_0x3fa70f['uniqueid']),_0x414865);}};exports[_0xf33f('0x1c')]=function(_0xf30aae){try{if(!_[_0xf33f('0x19')](queues[_0xf30aae[_0xf33f('0x6')]])){utils[_0xf33f('0x11')](util[_0xf33f('0x4')](_0xf33f('0x2e'),_0xf30aae[_0xf33f('0x6')]),_0xf30aae);queues[_0xf30aae[_0xf33f('0x6')]][_0xf33f('0x1d')]=![];queues[_0xf30aae[_0xf33f('0x6')]][_0xf33f('0x2b')]=null;queues[_0xf30aae['uniqueid']][_0xf33f('0x1c')]=!![];queues[_0xf30aae[_0xf33f('0x6')]][_0xf33f('0x2a')]=utils[_0xf33f('0x16')]();queues[_0xf30aae[_0xf33f('0x6')]][_0xf33f('0x9')]=_0xf33f('0x2f');utils[_0xf33f('0x3')](util[_0xf33f('0x4')](_0xf33f('0x30'),_0xf30aae['uniqueid'],queues[_0xf30aae[_0xf33f('0x6')]]['name'],queues[_0xf30aae[_0xf33f('0x6')]][_0xf33f('0x9')]));}}catch(_0x374bed){utils['error'](util[_0xf33f('0x4')](_0xf33f('0x2e'),_0xf30aae[_0xf33f('0x6')]),_0x374bed);}};exports[_0xf33f('0x31')]=function(_0x2fc9b5){try{if(!_['isNil'](queues[_0x2fc9b5[_0xf33f('0x6')]])){utils[_0xf33f('0x11')](util[_0xf33f('0x4')](_0xf33f('0x32'),_0x2fc9b5[_0xf33f('0x6')]),_0x2fc9b5);utils[_0xf33f('0x3')](util[_0xf33f('0x4')]('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x2fc9b5['uniqueid'],queues[_0x2fc9b5[_0xf33f('0x6')]][_0xf33f('0x22')],_0x2fc9b5[_0xf33f('0x33')],_0x2fc9b5[_0xf33f('0x34')]));queues[_0x2fc9b5[_0xf33f('0x6')]][_0xf33f('0x31')]=!![];queues[_0x2fc9b5['uniqueid']][_0xf33f('0x1b')]=utils['now']();queues[_0x2fc9b5[_0xf33f('0x6')]][_0xf33f('0x35')]=utils[_0xf33f('0x36')](queues[_0x2fc9b5['uniqueid']][_0xf33f('0x1b')],queues[_0x2fc9b5[_0xf33f('0x6')]]['queuecallerjoinAt']);queues[_0x2fc9b5['uniqueid']]['position']=_0x2fc9b5[_0xf33f('0x14')];queues[_0x2fc9b5[_0xf33f('0x6')]]['count']=_0x2fc9b5[_0xf33f('0x37')];queues[_0x2fc9b5[_0xf33f('0x6')]][_0xf33f('0x33')]=_0x2fc9b5[_0xf33f('0x33')];queues[_0x2fc9b5['uniqueid']]['connectedlinename']=_0x2fc9b5[_0xf33f('0x34')];}}catch(_0x151c3f){utils[_0xf33f('0x17')](util[_0xf33f('0x4')](_0xf33f('0x32'),_0x2fc9b5[_0xf33f('0x6')]),_0x151c3f);}};exports[_0xf33f('0x38')]=function(_0x4cede0){try{if(!_[_0xf33f('0x19')](queues[_0x4cede0[_0xf33f('0x6')]])){utils[_0xf33f('0x11')](util[_0xf33f('0x4')](_0xf33f('0x39'),_0x4cede0[_0xf33f('0x6')]),_0x4cede0);utils[_0xf33f('0x3')](util['format'](_0xf33f('0x3a'),_0x4cede0[_0xf33f('0x6')],queues[_0x4cede0['uniqueid']]['name'],_0x4cede0[_0xf33f('0x3b')],_0x4cede0[_0xf33f('0x3c')]));queues[_0x4cede0[_0xf33f('0x6')]]['queuecallerabandon']=![];queues[_0x4cede0[_0xf33f('0x6')]]['queuecallerabandon']=![];queues[_0x4cede0[_0xf33f('0x6')]]['queuecallerabandonAt']=null;queues[_0x4cede0['uniqueid']][_0xf33f('0x1d')]=![];queues[_0x4cede0[_0xf33f('0x6')]][_0xf33f('0x9')]=null;queues[_0x4cede0[_0xf33f('0x6')]]['queuecallerexitAt']=null;queues[_0x4cede0[_0xf33f('0x6')]][_0xf33f('0x3d')]=!![];queues[_0x4cede0[_0xf33f('0x6')]][_0xf33f('0x3e')]=_0x4cede0[_0xf33f('0x3c')];queues[_0x4cede0[_0xf33f('0x6')]][_0xf33f('0x3f')]=_0x4cede0['membername'];}}catch(_0x2b3c0c){utils[_0xf33f('0x17')](util[_0xf33f('0x4')](_0xf33f('0x39'),_0x4cede0['uniqueid']),_0x2b3c0c);}};exports[_0xf33f('0x40')]=function(_0x2c5f63){try{if(!_['isNil'](queues[_0x2c5f63['uniqueid']])){if(queues[_0x2c5f63[_0xf33f('0x6')]][_0xf33f('0x1b')]){utils[_0xf33f('0x11')](util['format'](_0xf33f('0x41'),_0x2c5f63[_0xf33f('0x6')]),_0x2c5f63);queues[_0x2c5f63[_0xf33f('0x6')]][_0xf33f('0x1c')]=![];queues[_0x2c5f63[_0xf33f('0x6')]][_0xf33f('0x1c')]=![];queues[_0x2c5f63[_0xf33f('0x6')]][_0xf33f('0x2a')]=null;queues[_0x2c5f63[_0xf33f('0x6')]][_0xf33f('0x1d')]=![];queues[_0x2c5f63[_0xf33f('0x6')]][_0xf33f('0x2b')]=null;queues[_0x2c5f63[_0xf33f('0x6')]][_0xf33f('0x3d')]=!![];queues[_0x2c5f63['uniqueid']][_0xf33f('0x3f')]=_0x2c5f63['membername'];queues[_0x2c5f63['uniqueid']][_0xf33f('0x1e')]=!![];queues[_0x2c5f63[_0xf33f('0x6')]][_0xf33f('0x1f')]=utils[_0xf33f('0x16')]();if(_0x2c5f63['reason']=='transfer'){if(!queues[_0x2c5f63[_0xf33f('0x6')]][_0xf33f('0x42')]){queues[_0x2c5f63[_0xf33f('0x6')]][_0xf33f('0x9')]=_0xf33f('0x43');}}else{queues[_0x2c5f63[_0xf33f('0x6')]]['queuecallerexitreason']=_0xf33f('0x44')+_0x2c5f63[_0xf33f('0x45')][_0xf33f('0x28')]();}utils['info'](util['format']('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x2c5f63[_0xf33f('0x6')],queues[_0x2c5f63[_0xf33f('0x6')]]['name'],_0x2c5f63[_0xf33f('0x3b')],queues[_0x2c5f63['uniqueid']]['queuecallerexitreason']));writeDB(queues[_0x2c5f63[_0xf33f('0x6')]]);}}}catch(_0x3d067e){utils['error'](util['format'](_0xf33f('0x41'),_0x2c5f63[_0xf33f('0x6')]),_0x3d067e);}};exports['blindtransfer']=function(_0x58c98a){try{if(!_[_0xf33f('0x19')](queues[_0x58c98a[_0xf33f('0x46')]])){utils[_0xf33f('0x11')](util[_0xf33f('0x4')]('[%s][queues][blindtransfer]',_0x58c98a[_0xf33f('0x6')]),_0x58c98a);queues[_0x58c98a[_0xf33f('0x46')]]['transfer']=!![];queues[_0x58c98a[_0xf33f('0x46')]][_0xf33f('0x47')]=_0xf33f('0x48');queues[_0x58c98a[_0xf33f('0x46')]][_0xf33f('0x49')]=_0x58c98a[_0xf33f('0x4a')];queues[_0x58c98a[_0xf33f('0x46')]][_0xf33f('0x4b')]=_0x58c98a[_0xf33f('0x46')];queues[_0x58c98a[_0xf33f('0x46')]][_0xf33f('0x9')]=_0xf33f('0x4c');utils[_0xf33f('0x3')](util[_0xf33f('0x4')](_0xf33f('0x4d'),_0x58c98a[_0xf33f('0x6')],queues[_0x58c98a[_0xf33f('0x46')]][_0xf33f('0x22')],_0x58c98a[_0xf33f('0x46')],_0x58c98a['extension']));}}catch(_0x2faf45){utils[_0xf33f('0x17')](util[_0xf33f('0x4')](_0xf33f('0x4e'),_0x58c98a[_0xf33f('0x6')]),_0x2faf45);}};exports[_0xf33f('0x4f')]=function(_0x56ce0a){try{utils[_0xf33f('0x11')](util[_0xf33f('0x4')](_0xf33f('0x50'),_0x56ce0a['origtransfereruniqueid']),_0x56ce0a);if(_0x56ce0a[_0xf33f('0x51')]==_0x56ce0a[_0xf33f('0x52')]){if(!_[_0xf33f('0x19')](queues[_0x56ce0a['secondtransfererlinkedid']])){utils[_0xf33f('0x3')](util[_0xf33f('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x56ce0a[_0xf33f('0x51')],queues[_0x56ce0a[_0xf33f('0x53')]]['name'],_0x56ce0a['origtransfererexten']));queues[_0x56ce0a[_0xf33f('0x53')]]['transfer']=!![];queues[_0x56ce0a[_0xf33f('0x53')]][_0xf33f('0x47')]='ATTENDED';queues[_0x56ce0a[_0xf33f('0x53')]][_0xf33f('0x49')]=_0x56ce0a['origtransfererexten'];queues[_0x56ce0a[_0xf33f('0x53')]][_0xf33f('0x4b')]=_0x56ce0a[_0xf33f('0x51')];queues[_0x56ce0a[_0xf33f('0x53')]][_0xf33f('0x9')]='ATTENDEDTRANSFER';}if(!_[_0xf33f('0x19')](queues[_0x56ce0a['origtransfererlinkedid']])){if(_0x56ce0a[_0xf33f('0x54')]&&queues[_0x56ce0a[_0xf33f('0x54')]]){queues[_0x56ce0a[_0xf33f('0x54')]][_0xf33f('0x55')]=0x1;queues[_0x56ce0a['transfereeuniqueid']]=_[_0xf33f('0x56')](queues[_0x56ce0a['transfereelinkedid']]);queues[_0x56ce0a[_0xf33f('0x46')]]['transfereduniqueid']=_0x56ce0a[_0xf33f('0x57')];queues[_0x56ce0a[_0xf33f('0x46')]]['queuecallerenterreason']=0x2;queues[_0x56ce0a[_0xf33f('0x46')]]['calleridnum']=queues[_0x56ce0a['secondtransfererlinkedid']]['calleridnum'];queues[_0x56ce0a['transfereeuniqueid']][_0xf33f('0x58')]=queues[_0x56ce0a[_0xf33f('0x53')]][_0xf33f('0x58')];queues[_0x56ce0a[_0xf33f('0x46')]][_0xf33f('0x59')]=utils[_0xf33f('0x16')]();queues[_0x56ce0a[_0xf33f('0x46')]][_0xf33f('0x1b')]=utils[_0xf33f('0x16')]();queues[_0x56ce0a[_0xf33f('0x46')]][_0xf33f('0x35')]=0x0;queues[_0x56ce0a[_0xf33f('0x46')]][_0xf33f('0x5a')]=0x0;utils[_0xf33f('0x3')](util['format'](_0xf33f('0x5b'),_0x56ce0a[_0xf33f('0x51')],queues[_0x56ce0a[_0xf33f('0x46')]][_0xf33f('0x22')],queues[_0x56ce0a['transfereeuniqueid']]['calleridnum'],queues[_0x56ce0a[_0xf33f('0x46')]][_0xf33f('0x58')]));}else{utils[_0xf33f('0x3')](util[_0xf33f('0x4')](_0xf33f('0x5c'),_0x56ce0a[_0xf33f('0x51')],queues[_0x56ce0a[_0xf33f('0x52')]]['name'],_0x56ce0a['secondtransfererlinkedid']));queues[_0x56ce0a[_0xf33f('0x52')]]['transfereduniqueid']=_0x56ce0a['secondtransfererlinkedid'];}}}else if(_0x56ce0a[_0xf33f('0x5d')]==_0x56ce0a[_0xf33f('0x53')]){if(!_[_0xf33f('0x19')](queues[_0x56ce0a[_0xf33f('0x52')]])){utils[_0xf33f('0x3')](util[_0xf33f('0x4')](_0xf33f('0x5e'),_0x56ce0a[_0xf33f('0x51')],queues[_0x56ce0a['origtransfererlinkedid']][_0xf33f('0x22')],_0x56ce0a['secondtransfereruniqueid'],_0x56ce0a['secondtransfererexten']));queues[_0x56ce0a[_0xf33f('0x52')]][_0xf33f('0x42')]=!![];queues[_0x56ce0a[_0xf33f('0x52')]][_0xf33f('0x47')]=_0xf33f('0x5f');queues[_0x56ce0a[_0xf33f('0x52')]][_0xf33f('0x49')]=_0x56ce0a['secondtransfererexten'];queues[_0x56ce0a[_0xf33f('0x52')]][_0xf33f('0x4b')]=_0x56ce0a[_0xf33f('0x5d')];queues[_0x56ce0a[_0xf33f('0x52')]][_0xf33f('0x9')]='ATTENDEDTRANSFER';}if(!_['isNil'](queues[_0x56ce0a[_0xf33f('0x53')]])){if(_0x56ce0a['transfertargetlinkedid']&&queues[_0x56ce0a[_0xf33f('0x60')]]){queues[_0x56ce0a[_0xf33f('0x60')]][_0xf33f('0x55')]=0x1;queues[_0x56ce0a[_0xf33f('0x57')]]=_['clone'](queues[_0x56ce0a[_0xf33f('0x60')]]);queues[_0x56ce0a['transfertargetuniqueid']]['transfereduniqueid']=_0x56ce0a[_0xf33f('0x57')];queues[_0x56ce0a[_0xf33f('0x57')]][_0xf33f('0x55')]=0x2;queues[_0x56ce0a['transfertargetuniqueid']][_0xf33f('0x61')]=queues[_0x56ce0a['origtransfererlinkedid']][_0xf33f('0x61')];queues[_0x56ce0a[_0xf33f('0x57')]][_0xf33f('0x58')]=queues[_0x56ce0a[_0xf33f('0x52')]][_0xf33f('0x58')];queues[_0x56ce0a[_0xf33f('0x57')]][_0xf33f('0x59')]=utils['now']();queues[_0x56ce0a[_0xf33f('0x57')]][_0xf33f('0x1b')]=utils[_0xf33f('0x16')]();queues[_0x56ce0a[_0xf33f('0x57')]][_0xf33f('0x35')]=0x0;queues[_0x56ce0a[_0xf33f('0x57')]][_0xf33f('0x5a')]=0x0;utils['info'](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x56ce0a[_0xf33f('0x51')],queues[_0x56ce0a[_0xf33f('0x57')]][_0xf33f('0x22')],queues[_0x56ce0a[_0xf33f('0x57')]]['transfereduniqueid'],queues[_0x56ce0a[_0xf33f('0x57')]][_0xf33f('0x61')],queues[_0x56ce0a[_0xf33f('0x57')]][_0xf33f('0x58')]));}else{utils['info'](util[_0xf33f('0x4')](_0xf33f('0x5c'),_0x56ce0a[_0xf33f('0x51')],queues[_0x56ce0a[_0xf33f('0x53')]][_0xf33f('0x22')],_0x56ce0a[_0xf33f('0x52')]));queues[_0x56ce0a['secondtransfererlinkedid']]['transfereduniqueid']=_0x56ce0a[_0xf33f('0x52')];}}}}catch(_0x1bd0b6){utils[_0xf33f('0x17')](util[_0xf33f('0x4')](_0xf33f('0x50'),_0x56ce0a[_0xf33f('0x51')]),_0x1bd0b6);}};exports[_0xf33f('0x62')]=function(_0xa07d4c){try{if(!_[_0xf33f('0x19')](queues[_0xa07d4c['uniqueid']])){utils[_0xf33f('0x11')](util[_0xf33f('0x4')](_0xf33f('0x63'),_0xa07d4c['uniqueid']),_0xa07d4c);queues[_0xa07d4c['uniqueid']]['musiconholdstartAt']=utils[_0xf33f('0x16')]();utils[_0xf33f('0x3')](util[_0xf33f('0x4')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0xa07d4c[_0xf33f('0x6')],queues[_0xa07d4c['uniqueid']][_0xf33f('0x22')],queues[_0xa07d4c[_0xf33f('0x6')]][_0xf33f('0x64')]));}}catch(_0x4a6024){utils[_0xf33f('0x17')](util[_0xf33f('0x4')](_0xf33f('0x63'),_0xa07d4c[_0xf33f('0x6')]),_0x4a6024);}};exports[_0xf33f('0x65')]=function(_0x472d71){try{if(!_[_0xf33f('0x19')](queues[_0x472d71[_0xf33f('0x6')]])){if(!_[_0xf33f('0x19')](queues[_0x472d71[_0xf33f('0x6')]]['musiconholdstartAt'])){utils[_0xf33f('0x11')](util[_0xf33f('0x4')](_0xf33f('0x66'),_0x472d71[_0xf33f('0x6')]),_0x472d71);queues[_0x472d71['uniqueid']]['mohtime']+=utils['diffTime'](utils[_0xf33f('0x16')](),queues[_0x472d71[_0xf33f('0x6')]][_0xf33f('0x64')]);utils[_0xf33f('0x3')](util[_0xf33f('0x4')](_0xf33f('0x67'),_0x472d71['uniqueid'],queues[_0x472d71['uniqueid']]['name'],queues[_0x472d71['uniqueid']][_0xf33f('0x5a')]));delete queues[_0x472d71['uniqueid']]['musiconholdstartAt'];}}}catch(_0x858626){utils[_0xf33f('0x17')](util[_0xf33f('0x4')](_0xf33f('0x66'),_0x472d71[_0xf33f('0x6')]),_0x858626);}}; \ No newline at end of file +var _0xabfb=['accountcode','queuecallerexitreason','getVoiceQueueByName','type','CreateVoiceQueueReport','transfereduniqueid','uniqueid','queuecallerjoin','[%s][queues][queuecallerjoin]','assign','position','now','hangup','isNil','debug','[%s][queues][hangup]','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','variable','value','toUpperCase','CONTINUE','queuecallerabandon','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','error','[%s][queues][varset]','[%s][queues][queuecallerabandon]','ABANDONED','queuecallerleave','[%s][queues][queuecallerleave]','connectedlinenum','connectedlinename','queuecallerleaveAt','holdtime','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','assigned','destaccountcode','lastAssignedTo','membername','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','transferexten','extension','transferuniqueid','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererlinkedid','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','origtransfererlinkedid','transfereelinkedid','clone','transfertargetuniqueid','calleridname','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','[%s][queues][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','channel','queue','calleridnum'];(function(_0x4fe416,_0x5a310a){var _0x252725=function(_0x1d67db){while(--_0x1d67db){_0x4fe416['push'](_0x4fe416['shift']());}};_0x252725(++_0x5a310a);}(_0xabfb,0x12d));var _0xbabf=function(_0x4914ad,_0x551a18){_0x4914ad=_0x4914ad-0x0;var _0x3cd61f=_0xabfb[_0x4914ad];return _0x3cd61f;};'use strict';var _=require(_0xbabf('0x0'));var util=require(_0xbabf('0x1'));var utils=require('./utils');var queues={};function writeDB(_0x110b6f){utils[_0xbabf('0x2')](util[_0xbabf('0x3')](_0xbabf('0x4'),_0x110b6f['uniqueid'],_0x110b6f[_0xbabf('0x5')],_0x110b6f[_0xbabf('0x6')],_0x110b6f['lastAssignedTo'],_0x110b6f[_0xbabf('0x7')],_0x110b6f[_0xbabf('0x8')],_0x110b6f[_0xbabf('0x9')]));if(_0x110b6f['queue']){utils[_0xbabf('0xa')](_0x110b6f[_0xbabf('0x6')])['then'](function(_0x9c3bd4){if(_0x9c3bd4){_0x110b6f[_0xbabf('0xb')]=_0x9c3bd4[_0xbabf('0xb')];}utils['request'](_0xbabf('0xc'),_0x110b6f);});}else{utils['request']('CreateVoiceQueueReport',_0x110b6f);}if(_0x110b6f[_0xbabf('0xd')]){delete queues[_0x110b6f['transfereduniqueid']];}else{delete queues[_0x110b6f[_0xbabf('0xe')]];}}exports[_0xbabf('0xf')]=function(_0x4237e7){try{utils['debug'](util['format'](_0xbabf('0x10'),_0x4237e7[_0xbabf('0xe')]),_0x4237e7);utils['info'](util['format']('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x4237e7[_0xbabf('0xe')],_0x4237e7[_0xbabf('0x6')],_0x4237e7['position']));queues[_0x4237e7['uniqueid']]=_[_0xbabf('0x11')](_0x4237e7,{'originalposition':_0x4237e7[_0xbabf('0x12')],'queuecallerjoinAt':utils[_0xbabf('0x13')](),'mohtime':0x0});}catch(_0x218bdb){utils['error'](util[_0xbabf('0x3')](_0xbabf('0x10'),_0x4237e7[_0xbabf('0xe')]),_0x218bdb);}};exports[_0xbabf('0x14')]=function(_0x516598){try{if(!_[_0xbabf('0x15')](queues[_0x516598[_0xbabf('0xe')]])){utils[_0xbabf('0x16')](util[_0xbabf('0x3')](_0xbabf('0x17'),_0x516598['uniqueid']),_0x516598);if(queues[_0x516598['uniqueid']]['queuecallerleaveAt']){if(!queues[_0x516598['uniqueid']]['queuecallerabandon']&&!queues[_0x516598[_0xbabf('0xe')]]['queuecallerexit']){queues[_0x516598[_0xbabf('0xe')]]['queuecallercomplete']=!![];queues[_0x516598[_0xbabf('0xe')]][_0xbabf('0x18')]=utils[_0xbabf('0x13')]();queues[_0x516598['uniqueid']][_0xbabf('0x9')]=_0xbabf('0x19');}utils[_0xbabf('0x2')](util[_0xbabf('0x3')](_0xbabf('0x1a'),_0x516598[_0xbabf('0xe')],queues[_0x516598[_0xbabf('0xe')]][_0xbabf('0x1b')],queues[_0x516598['uniqueid']]['queuecallerexitreason']));writeDB(queues[_0x516598[_0xbabf('0xe')]]);}else if(queues[_0x516598[_0xbabf('0xe')]][_0xbabf('0xd')]){utils[_0xbabf('0x2')](util[_0xbabf('0x3')](_0xbabf('0x1c'),_0x516598['uniqueid'],queues[_0x516598['uniqueid']][_0xbabf('0x1b')],queues[_0x516598['uniqueid']][_0xbabf('0xd')]));queues[queues[_0x516598[_0xbabf('0xe')]][_0xbabf('0xd')]]=queues[_0x516598[_0xbabf('0xe')]];queues[queues[_0x516598[_0xbabf('0xe')]][_0xbabf('0xd')]][_0xbabf('0x1d')]=0x2;delete queues[_0x516598[_0xbabf('0xe')]];}}}catch(_0x1d6b6d){utils['error'](util[_0xbabf('0x3')]('[%s][queues][hangup]',_0x516598['uniqueid']),_0x1d6b6d);}};exports[_0xbabf('0x1e')]=function(_0x564f09){try{utils['debug'](util[_0xbabf('0x3')]('[%s][queues][varset]',_0x564f09[_0xbabf('0xe')]),_0x564f09);if(!_[_0xbabf('0x15')](_0x564f09[_0xbabf('0x1f')]['queuestatus'])&&_0x564f09[_0xbabf('0x20')][_0xbabf('0x21')]()!==_0xbabf('0x22')){if(!_[_0xbabf('0x15')](queues[_0x564f09[_0xbabf('0xe')]])){queues[_0x564f09[_0xbabf('0xe')]][_0xbabf('0x23')]=![];queues[_0x564f09[_0xbabf('0xe')]][_0xbabf('0x24')]=null;queues[_0x564f09[_0xbabf('0xe')]][_0xbabf('0x25')]=!![];queues[_0x564f09[_0xbabf('0xe')]][_0xbabf('0x26')]=utils[_0xbabf('0x13')]();queues[_0x564f09[_0xbabf('0xe')]][_0xbabf('0x9')]=_0x564f09['value'][_0xbabf('0x21')]();utils[_0xbabf('0x2')](util[_0xbabf('0x3')](_0xbabf('0x27'),_0x564f09['uniqueid'],queues[_0x564f09[_0xbabf('0xe')]][_0xbabf('0x1b')],_0x564f09[_0xbabf('0x20')],queues[_0x564f09['uniqueid']][_0xbabf('0x9')]));writeDB(queues[_0x564f09[_0xbabf('0xe')]]);}}else if(!_[_0xbabf('0x15')](_0x564f09[_0xbabf('0x1f')][_0xbabf('0x28')])){if(!_[_0xbabf('0x15')](queues[_0x564f09[_0xbabf('0xe')]])&&!queues[_0x564f09[_0xbabf('0xe')]][_0xbabf('0x23')]){queues[_0x564f09[_0xbabf('0xe')]]['queuecallerabandon']=![];queues[_0x564f09[_0xbabf('0xe')]][_0xbabf('0x24')]=null;queues[_0x564f09[_0xbabf('0xe')]][_0xbabf('0x25')]=!![];queues[_0x564f09['uniqueid']]['queuecallerexitAt']=utils[_0xbabf('0x13')]();queues[_0x564f09['uniqueid']][_0xbabf('0x9')]='EXITWITHKEY';utils[_0xbabf('0x2')](util[_0xbabf('0x3')](_0xbabf('0x29'),_0x564f09[_0xbabf('0xe')],queues[_0x564f09[_0xbabf('0xe')]][_0xbabf('0x1b')],_0x564f09[_0xbabf('0x20')],queues[_0x564f09['uniqueid']]['queuecallerexitreason']));}}}catch(_0x47f006){utils[_0xbabf('0x2a')](util[_0xbabf('0x3')](_0xbabf('0x2b'),_0x564f09[_0xbabf('0xe')]),_0x47f006);}};exports['queuecallerabandon']=function(_0x21f1b5){try{if(!_[_0xbabf('0x15')](queues[_0x21f1b5['uniqueid']])){utils['debug'](util['format'](_0xbabf('0x2c'),_0x21f1b5[_0xbabf('0xe')]),_0x21f1b5);queues[_0x21f1b5[_0xbabf('0xe')]][_0xbabf('0x25')]=![];queues[_0x21f1b5[_0xbabf('0xe')]]['queuecallerexitAt']=null;queues[_0x21f1b5[_0xbabf('0xe')]][_0xbabf('0x23')]=!![];queues[_0x21f1b5[_0xbabf('0xe')]][_0xbabf('0x24')]=utils[_0xbabf('0x13')]();queues[_0x21f1b5[_0xbabf('0xe')]][_0xbabf('0x9')]=_0xbabf('0x2d');utils['info'](util[_0xbabf('0x3')]('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x21f1b5[_0xbabf('0xe')],queues[_0x21f1b5[_0xbabf('0xe')]][_0xbabf('0x1b')],queues[_0x21f1b5[_0xbabf('0xe')]][_0xbabf('0x9')]));}}catch(_0x5b4529){utils[_0xbabf('0x2a')](util[_0xbabf('0x3')](_0xbabf('0x2c'),_0x21f1b5[_0xbabf('0xe')]),_0x5b4529);}};exports[_0xbabf('0x2e')]=function(_0x302c70){try{if(!_[_0xbabf('0x15')](queues[_0x302c70[_0xbabf('0xe')]])){utils[_0xbabf('0x16')](util[_0xbabf('0x3')](_0xbabf('0x2f'),_0x302c70[_0xbabf('0xe')]),_0x302c70);utils['info'](util[_0xbabf('0x3')]('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x302c70[_0xbabf('0xe')],queues[_0x302c70[_0xbabf('0xe')]]['name'],_0x302c70[_0xbabf('0x30')],_0x302c70[_0xbabf('0x31')]));queues[_0x302c70[_0xbabf('0xe')]]['queuecallerleave']=!![];queues[_0x302c70['uniqueid']][_0xbabf('0x32')]=utils['now']();queues[_0x302c70[_0xbabf('0xe')]][_0xbabf('0x33')]=utils[_0xbabf('0x34')](queues[_0x302c70['uniqueid']][_0xbabf('0x32')],queues[_0x302c70[_0xbabf('0xe')]][_0xbabf('0x35')]);queues[_0x302c70[_0xbabf('0xe')]]['position']=_0x302c70[_0xbabf('0x12')];queues[_0x302c70[_0xbabf('0xe')]][_0xbabf('0x36')]=_0x302c70[_0xbabf('0x36')];queues[_0x302c70['uniqueid']][_0xbabf('0x30')]=_0x302c70[_0xbabf('0x30')];queues[_0x302c70['uniqueid']][_0xbabf('0x31')]=_0x302c70[_0xbabf('0x31')];}}catch(_0x3d62ac){utils[_0xbabf('0x2a')](util[_0xbabf('0x3')](_0xbabf('0x2f'),_0x302c70['uniqueid']),_0x3d62ac);}};exports[_0xbabf('0x37')]=function(_0x5d239d){try{if(!_[_0xbabf('0x15')](queues[_0x5d239d[_0xbabf('0xe')]])){utils[_0xbabf('0x16')](util[_0xbabf('0x3')](_0xbabf('0x38'),_0x5d239d[_0xbabf('0xe')]),_0x5d239d);utils[_0xbabf('0x2')](util[_0xbabf('0x3')](_0xbabf('0x39'),_0x5d239d['uniqueid'],queues[_0x5d239d[_0xbabf('0xe')]][_0xbabf('0x1b')],_0x5d239d['membername'],_0x5d239d['destaccountcode']));queues[_0x5d239d[_0xbabf('0xe')]][_0xbabf('0x23')]=![];queues[_0x5d239d[_0xbabf('0xe')]][_0xbabf('0x23')]=![];queues[_0x5d239d['uniqueid']][_0xbabf('0x24')]=null;queues[_0x5d239d['uniqueid']]['queuecallerexit']=![];queues[_0x5d239d[_0xbabf('0xe')]][_0xbabf('0x9')]=null;queues[_0x5d239d[_0xbabf('0xe')]][_0xbabf('0x26')]=null;queues[_0x5d239d[_0xbabf('0xe')]][_0xbabf('0x3a')]=!![];queues[_0x5d239d[_0xbabf('0xe')]][_0xbabf('0x8')]=_0x5d239d[_0xbabf('0x3b')];queues[_0x5d239d[_0xbabf('0xe')]][_0xbabf('0x3c')]=_0x5d239d[_0xbabf('0x3d')];}}catch(_0x4cb772){utils[_0xbabf('0x2a')](util[_0xbabf('0x3')]('[%s][queues][agentconnect]',_0x5d239d['uniqueid']),_0x4cb772);}};exports[_0xbabf('0x3e')]=function(_0x3da4e1){try{if(!_['isNil'](queues[_0x3da4e1['uniqueid']])){if(queues[_0x3da4e1[_0xbabf('0xe')]][_0xbabf('0x32')]){utils[_0xbabf('0x16')](util[_0xbabf('0x3')](_0xbabf('0x3f'),_0x3da4e1[_0xbabf('0xe')]),_0x3da4e1);queues[_0x3da4e1['uniqueid']][_0xbabf('0x23')]=![];queues[_0x3da4e1[_0xbabf('0xe')]][_0xbabf('0x23')]=![];queues[_0x3da4e1[_0xbabf('0xe')]][_0xbabf('0x24')]=null;queues[_0x3da4e1[_0xbabf('0xe')]][_0xbabf('0x25')]=![];queues[_0x3da4e1[_0xbabf('0xe')]]['queuecallerexitAt']=null;queues[_0x3da4e1[_0xbabf('0xe')]][_0xbabf('0x3a')]=!![];queues[_0x3da4e1[_0xbabf('0xe')]][_0xbabf('0x3c')]=_0x3da4e1[_0xbabf('0x3d')];queues[_0x3da4e1['uniqueid']]['queuecallercomplete']=!![];queues[_0x3da4e1[_0xbabf('0xe')]][_0xbabf('0x18')]=utils[_0xbabf('0x13')]();if(_0x3da4e1[_0xbabf('0x40')]==_0xbabf('0x41')){if(!queues[_0x3da4e1[_0xbabf('0xe')]]['transfer']){queues[_0x3da4e1[_0xbabf('0xe')]]['queuecallerexitreason']=_0xbabf('0x42');}}else{queues[_0x3da4e1['uniqueid']][_0xbabf('0x9')]=_0xbabf('0x43')+_0x3da4e1[_0xbabf('0x40')][_0xbabf('0x21')]();}utils[_0xbabf('0x2')](util[_0xbabf('0x3')](_0xbabf('0x44'),_0x3da4e1[_0xbabf('0xe')],queues[_0x3da4e1[_0xbabf('0xe')]]['name'],_0x3da4e1[_0xbabf('0x3d')],queues[_0x3da4e1['uniqueid']][_0xbabf('0x9')]));writeDB(queues[_0x3da4e1['uniqueid']]);}}}catch(_0x5d04f7){utils[_0xbabf('0x2a')](util[_0xbabf('0x3')](_0xbabf('0x3f'),_0x3da4e1[_0xbabf('0xe')]),_0x5d04f7);}};exports[_0xbabf('0x45')]=function(_0x2ecc86){try{if(!_['isNil'](queues[_0x2ecc86[_0xbabf('0x46')]])){utils['debug'](util[_0xbabf('0x3')](_0xbabf('0x47'),_0x2ecc86['uniqueid']),_0x2ecc86);queues[_0x2ecc86['transfereeuniqueid']][_0xbabf('0x41')]=!![];queues[_0x2ecc86['transfereeuniqueid']][_0xbabf('0x48')]='BLIND';queues[_0x2ecc86['transfereeuniqueid']][_0xbabf('0x49')]=_0x2ecc86[_0xbabf('0x4a')];queues[_0x2ecc86[_0xbabf('0x46')]][_0xbabf('0x4b')]=_0x2ecc86['transfereeuniqueid'];queues[_0x2ecc86[_0xbabf('0x46')]][_0xbabf('0x9')]='BLINDTRANSFER';utils[_0xbabf('0x2')](util[_0xbabf('0x3')](_0xbabf('0x4c'),_0x2ecc86[_0xbabf('0xe')],queues[_0x2ecc86[_0xbabf('0x46')]][_0xbabf('0x1b')],_0x2ecc86['transfereeuniqueid'],_0x2ecc86[_0xbabf('0x4a')]));}}catch(_0x3cf7f0){utils[_0xbabf('0x2a')](util['format'](_0xbabf('0x47'),_0x2ecc86[_0xbabf('0xe')]),_0x3cf7f0);}};exports[_0xbabf('0x4d')]=function(_0x3799db){try{utils[_0xbabf('0x16')](util[_0xbabf('0x3')](_0xbabf('0x4e'),_0x3799db[_0xbabf('0x4f')]),_0x3799db);if(_0x3799db[_0xbabf('0x4f')]==_0x3799db['origtransfererlinkedid']){if(!_['isNil'](queues[_0x3799db['secondtransfererlinkedid']])){utils[_0xbabf('0x2')](util['format'](_0xbabf('0x50'),_0x3799db['origtransfereruniqueid'],queues[_0x3799db[_0xbabf('0x51')]][_0xbabf('0x1b')],_0x3799db[_0xbabf('0x52')]));queues[_0x3799db[_0xbabf('0x51')]][_0xbabf('0x41')]=!![];queues[_0x3799db[_0xbabf('0x51')]][_0xbabf('0x48')]=_0xbabf('0x53');queues[_0x3799db[_0xbabf('0x51')]][_0xbabf('0x49')]=_0x3799db[_0xbabf('0x52')];queues[_0x3799db['secondtransfererlinkedid']][_0xbabf('0x4b')]=_0x3799db[_0xbabf('0x4f')];queues[_0x3799db[_0xbabf('0x51')]]['queuecallerexitreason']=_0xbabf('0x54');}if(!_[_0xbabf('0x15')](queues[_0x3799db[_0xbabf('0x55')]])){if(_0x3799db[_0xbabf('0x56')]&&queues[_0x3799db[_0xbabf('0x56')]]){queues[_0x3799db['transfereelinkedid']][_0xbabf('0x1d')]=0x1;queues[_0x3799db[_0xbabf('0x46')]]=_[_0xbabf('0x57')](queues[_0x3799db[_0xbabf('0x56')]]);queues[_0x3799db[_0xbabf('0x46')]][_0xbabf('0xd')]=_0x3799db[_0xbabf('0x58')];queues[_0x3799db['transfereeuniqueid']][_0xbabf('0x1d')]=0x2;queues[_0x3799db['transfereeuniqueid']][_0xbabf('0x7')]=queues[_0x3799db[_0xbabf('0x51')]][_0xbabf('0x7')];queues[_0x3799db[_0xbabf('0x46')]][_0xbabf('0x59')]=queues[_0x3799db[_0xbabf('0x51')]][_0xbabf('0x59')];queues[_0x3799db[_0xbabf('0x46')]][_0xbabf('0x35')]=utils[_0xbabf('0x13')]();queues[_0x3799db['transfereeuniqueid']][_0xbabf('0x32')]=utils[_0xbabf('0x13')]();queues[_0x3799db[_0xbabf('0x46')]][_0xbabf('0x33')]=0x0;queues[_0x3799db['transfereeuniqueid']][_0xbabf('0x5a')]=0x0;utils[_0xbabf('0x2')](util['format'](_0xbabf('0x5b'),_0x3799db[_0xbabf('0x4f')],queues[_0x3799db[_0xbabf('0x46')]][_0xbabf('0x1b')],queues[_0x3799db[_0xbabf('0x46')]][_0xbabf('0x7')],queues[_0x3799db[_0xbabf('0x46')]][_0xbabf('0x59')]));}else{utils[_0xbabf('0x2')](util['format'](_0xbabf('0x5c'),_0x3799db[_0xbabf('0x4f')],queues[_0x3799db[_0xbabf('0x55')]][_0xbabf('0x1b')],_0x3799db[_0xbabf('0x51')]));queues[_0x3799db[_0xbabf('0x55')]]['transfereduniqueid']=_0x3799db['secondtransfererlinkedid'];}}}else if(_0x3799db['secondtransfereruniqueid']==_0x3799db[_0xbabf('0x51')]){if(!_[_0xbabf('0x15')](queues[_0x3799db['origtransfererlinkedid']])){utils[_0xbabf('0x2')](util[_0xbabf('0x3')](_0xbabf('0x5d'),_0x3799db['origtransfereruniqueid'],queues[_0x3799db[_0xbabf('0x55')]][_0xbabf('0x1b')],_0x3799db[_0xbabf('0x5e')],_0x3799db[_0xbabf('0x5f')]));queues[_0x3799db['origtransfererlinkedid']][_0xbabf('0x41')]=!![];queues[_0x3799db[_0xbabf('0x55')]]['transfertype']='ATTENDED';queues[_0x3799db[_0xbabf('0x55')]]['transferexten']=_0x3799db[_0xbabf('0x5f')];queues[_0x3799db['origtransfererlinkedid']][_0xbabf('0x4b')]=_0x3799db[_0xbabf('0x5e')];queues[_0x3799db[_0xbabf('0x55')]][_0xbabf('0x9')]=_0xbabf('0x54');}if(!_[_0xbabf('0x15')](queues[_0x3799db[_0xbabf('0x51')]])){if(_0x3799db['transfertargetlinkedid']&&queues[_0x3799db[_0xbabf('0x60')]]){queues[_0x3799db[_0xbabf('0x60')]][_0xbabf('0x1d')]=0x1;queues[_0x3799db[_0xbabf('0x58')]]=_[_0xbabf('0x57')](queues[_0x3799db[_0xbabf('0x60')]]);queues[_0x3799db[_0xbabf('0x58')]][_0xbabf('0xd')]=_0x3799db[_0xbabf('0x58')];queues[_0x3799db[_0xbabf('0x58')]][_0xbabf('0x1d')]=0x2;queues[_0x3799db[_0xbabf('0x58')]][_0xbabf('0x7')]=queues[_0x3799db['origtransfererlinkedid']][_0xbabf('0x7')];queues[_0x3799db[_0xbabf('0x58')]]['calleridname']=queues[_0x3799db['origtransfererlinkedid']]['calleridname'];queues[_0x3799db[_0xbabf('0x58')]][_0xbabf('0x35')]=utils[_0xbabf('0x13')]();queues[_0x3799db['transfertargetuniqueid']][_0xbabf('0x32')]=utils[_0xbabf('0x13')]();queues[_0x3799db[_0xbabf('0x58')]][_0xbabf('0x33')]=0x0;queues[_0x3799db[_0xbabf('0x58')]][_0xbabf('0x5a')]=0x0;utils['info'](util[_0xbabf('0x3')](_0xbabf('0x61'),_0x3799db[_0xbabf('0x4f')],queues[_0x3799db['transfertargetuniqueid']][_0xbabf('0x1b')],queues[_0x3799db[_0xbabf('0x58')]]['transfereduniqueid'],queues[_0x3799db['transfertargetuniqueid']]['calleridnum'],queues[_0x3799db[_0xbabf('0x58')]][_0xbabf('0x59')]));}else{utils[_0xbabf('0x2')](util['format'](_0xbabf('0x5c'),_0x3799db[_0xbabf('0x4f')],queues[_0x3799db[_0xbabf('0x51')]][_0xbabf('0x1b')],_0x3799db[_0xbabf('0x55')]));queues[_0x3799db[_0xbabf('0x51')]][_0xbabf('0xd')]=_0x3799db['origtransfererlinkedid'];}}}}catch(_0x2be3f3){utils[_0xbabf('0x2a')](util[_0xbabf('0x3')](_0xbabf('0x4e'),_0x3799db[_0xbabf('0x4f')]),_0x2be3f3);}};exports['musiconholdstart']=function(_0x43ae1c){try{if(!_[_0xbabf('0x15')](queues[_0x43ae1c[_0xbabf('0xe')]])){utils[_0xbabf('0x16')](util[_0xbabf('0x3')](_0xbabf('0x62'),_0x43ae1c[_0xbabf('0xe')]),_0x43ae1c);queues[_0x43ae1c[_0xbabf('0xe')]][_0xbabf('0x63')]=utils[_0xbabf('0x13')]();utils[_0xbabf('0x2')](util[_0xbabf('0x3')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x43ae1c[_0xbabf('0xe')],queues[_0x43ae1c[_0xbabf('0xe')]][_0xbabf('0x1b')],queues[_0x43ae1c[_0xbabf('0xe')]][_0xbabf('0x63')]));}}catch(_0x896ede){utils[_0xbabf('0x2a')](util[_0xbabf('0x3')](_0xbabf('0x62'),_0x43ae1c[_0xbabf('0xe')]),_0x896ede);}};exports[_0xbabf('0x64')]=function(_0x5728e6){try{if(!_[_0xbabf('0x15')](queues[_0x5728e6[_0xbabf('0xe')]])){if(!_[_0xbabf('0x15')](queues[_0x5728e6[_0xbabf('0xe')]][_0xbabf('0x63')])){utils[_0xbabf('0x16')](util[_0xbabf('0x3')](_0xbabf('0x65'),_0x5728e6[_0xbabf('0xe')]),_0x5728e6);queues[_0x5728e6[_0xbabf('0xe')]][_0xbabf('0x5a')]+=utils['diffTime'](utils[_0xbabf('0x13')](),queues[_0x5728e6[_0xbabf('0xe')]]['musiconholdstartAt']);utils[_0xbabf('0x2')](util[_0xbabf('0x3')](_0xbabf('0x66'),_0x5728e6[_0xbabf('0xe')],queues[_0x5728e6[_0xbabf('0xe')]][_0xbabf('0x1b')],queues[_0x5728e6[_0xbabf('0xe')]][_0xbabf('0x5a')]));delete queues[_0x5728e6[_0xbabf('0xe')]][_0xbabf('0x63')];}}}catch(_0x59fe87){utils['error'](util[_0xbabf('0x3')](_0xbabf('0x65'),_0x5728e6['uniqueid']),_0x59fe87);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 10cbd6b..727189d 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 _0x6b13=['[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','transferercalleridnum','transfereecalleridnum','recording','lodash','util','info','format','[%s][recordings][writeDB]','blinds','uniqueid','transfereeuniqueid','accountcode','then','membername','UserId','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','newstate','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channel','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','.WAV','monitors','error','hangup','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridname','calleridnum','connectedlinenum','connectedlinename','type','outbound','forEach','clone','[%s][recordings][hangup]','newexten','application','appdata','toLowerCase','set','startsWith','cdr','lastIndexOf','queuecallerjoin'];(function(_0x40c333,_0x1b5c42){var _0x476c81=function(_0x1911c2){while(--_0x1911c2){_0x40c333['push'](_0x40c333['shift']());}};_0x476c81(++_0x1b5c42);}(_0x6b13,0xca));var _0x36b1=function(_0x3e6a68,_0x577b80){_0x3e6a68=_0x3e6a68-0x0;var _0x3981aa=_0x6b13[_0x3e6a68];return _0x3981aa;};'use strict';var _=require(_0x36b1('0x0'));var util=require(_0x36b1('0x1'));var utils=require('./utils');var transfers=require('./transfers.controller');var recordings={};function writeDB(_0x492ea4){var _0x50e925;utils[_0x36b1('0x2')](util[_0x36b1('0x3')](_0x36b1('0x4'),_0x492ea4['uniqueid']));if(transfers[_0x36b1('0x5')][_0x492ea4[_0x36b1('0x6')]]){_0x50e925=_0x492ea4[_0x36b1('0x6')];_0x492ea4[_0x36b1('0x6')]=transfers[_0x36b1('0x5')][_0x492ea4['uniqueid']][_0x36b1('0x7')];}if(_0x492ea4[_0x36b1('0x8')]){utils['getUserByInternal'](_0x492ea4[_0x36b1('0x8')])[_0x36b1('0x9')](function(_0x16021e){if(_0x16021e){_0x492ea4[_0x36b1('0xa')]=_0x16021e['name'];_0x492ea4[_0x36b1('0xb')]=_0x16021e['id'];}utils[_0x36b1('0xc')]('CreateVoiceRecording',_0x492ea4);});}else{utils[_0x36b1('0xc')](_0x36b1('0xd'),_0x492ea4);}if(_0x50e925)delete transfers[_0x36b1('0x5')][_0x50e925];}exports[_0x36b1('0xe')]=function(_0x298198){try{utils[_0x36b1('0xf')](util[_0x36b1('0x3')](_0x36b1('0x10'),_0x298198[_0x36b1('0x6')]),_0x298198);if(_0x298198[_0x36b1('0x6')]==_0x298198[_0x36b1('0x11')]){utils[_0x36b1('0x2')](util[_0x36b1('0x3')](_0x36b1('0x12'),_0x298198[_0x36b1('0x6')],_0x298198[_0x36b1('0x13')],_0x298198['exten']));recordings[_0x298198[_0x36b1('0x6')]]={'uniqueid':_0x298198['uniqueid'],'accountcode':_0x298198[_0x36b1('0x8')],'exten':_0x298198['exten'],'context':_0x298198['context'],'channel':_0x298198['channel'],'monitors':[]};}}catch(_0x380ea5){utils['error'](util[_0x36b1('0x3')]('[%s][recordings][newchannel]',_0x298198[_0x36b1('0x6')]),_0x380ea5);}};exports[_0x36b1('0x14')]=function(_0x3f0e66){try{utils[_0x36b1('0xf')](util['format'](_0x36b1('0x15'),_0x3f0e66['uniqueid']),_0x3f0e66);if(!_[_0x36b1('0x16')](recordings[_0x3f0e66[_0x36b1('0x6')]])&&_0x3f0e66[_0x36b1('0x17')]==0x6){utils[_0x36b1('0x2')](util[_0x36b1('0x3')](_0x36b1('0x18'),_0x3f0e66[_0x36b1('0x6')],_0x3f0e66[_0x36b1('0x13')],_0x3f0e66[_0x36b1('0x19')]));}else if(!_['isNil'](recordings[_0x3f0e66[_0x36b1('0x11')]])&&_0x3f0e66[_0x36b1('0x17')]==0x6&&_0x3f0e66['context']!='transfer'){utils['info'](util['format'](_0x36b1('0x1a'),_0x3f0e66[_0x36b1('0x6')],_0x3f0e66[_0x36b1('0x11')],_0x3f0e66['context'],_0x3f0e66[_0x36b1('0x19')]));recordings[_0x3f0e66[_0x36b1('0x11')]][_0x36b1('0x8')]=_0x3f0e66[_0x36b1('0x8')];}}catch(_0x6274bf){utils['error'](util['format'](_0x36b1('0x15'),_0x3f0e66['uniqueid']),_0x6274bf);}};exports['varset']=function(_0x3dbab4){try{if(!_[_0x36b1('0x16')](_0x3dbab4[_0x36b1('0x1b')])&&!_[_0x36b1('0x16')](_0x3dbab4[_0x36b1('0x1b')][_0x36b1('0x1c')])){utils[_0x36b1('0xf')](util[_0x36b1('0x3')](_0x36b1('0x1d'),_0x3dbab4['uniqueid']),_0x3dbab4);utils[_0x36b1('0x2')](util[_0x36b1('0x3')](_0x36b1('0x1e'),_0x3dbab4[_0x36b1('0x6')],_0x3dbab4['variable'],_0x3dbab4[_0x36b1('0x1f')]));if(_[_0x36b1('0x20')](_0x3dbab4['value'],_0x36b1('0x21'))){_0x3dbab4['value']=_0x3dbab4[_0x36b1('0x1f')][_0x36b1('0x22')](_0x36b1('0x21'),_0x36b1('0x23'));}if(recordings[_0x3dbab4['linkedid']]){var _0x74f404=_['find'](recordings[_0x3dbab4['linkedid']][_0x36b1('0x24')],{'value':_0x3dbab4[_0x36b1('0x1f')]});if(_[_0x36b1('0x16')](_0x74f404)){recordings[_0x3dbab4[_0x36b1('0x11')]]['monitors']['push']({'value':_0x3dbab4['value']});}}}}catch(_0x9d7d49){utils[_0x36b1('0x25')](util['format']('[%s][recordings][varset]',_0x3dbab4['uniqueid']),_0x9d7d49);}};exports[_0x36b1('0x26')]=function(_0x27aee3){try{if(!_[_0x36b1('0x16')](recordings[_0x27aee3['uniqueid']])){utils[_0x36b1('0xf')](util[_0x36b1('0x3')]('[%s][recordings][hangup]',_0x27aee3['uniqueid']),_0x27aee3);utils[_0x36b1('0x2')](util[_0x36b1('0x3')](_0x36b1('0x27'),_0x27aee3[_0x36b1('0x6')],_0x27aee3['calleridnum'],_0x27aee3[_0x36b1('0x28')],_0x27aee3['cause-txt']));recordings[_0x27aee3[_0x36b1('0x6')]][_0x36b1('0x29')]=_0x27aee3[_0x36b1('0x29')];recordings[_0x27aee3[_0x36b1('0x6')]][_0x36b1('0x28')]=_0x27aee3[_0x36b1('0x28')];recordings[_0x27aee3['uniqueid']]['connectedlinenum']=_0x27aee3[_0x36b1('0x2a')];recordings[_0x27aee3[_0x36b1('0x6')]][_0x36b1('0x2b')]=_0x27aee3[_0x36b1('0x2b')];if(recordings[_0x27aee3['uniqueid']][_0x36b1('0x2c')]==_0x36b1('0x2d')&&recordings[_0x27aee3[_0x36b1('0x6')]][_0x36b1('0x8')]){recordings[_0x27aee3[_0x36b1('0x6')]][_0x36b1('0x2a')]=recordings[_0x27aee3['uniqueid']]['accountcode'];recordings[_0x27aee3['uniqueid']]['connectedlinename']='';}recordings[_0x27aee3['uniqueid']]['monitors'][_0x36b1('0x2e')](function(_0x7aa37a){var _0x422ffa=_[_0x36b1('0x2f')](recordings[_0x27aee3[_0x36b1('0x6')]]);_0x422ffa['value']=_0x7aa37a[_0x36b1('0x1f')];writeDB(_0x422ffa);});delete recordings[_0x27aee3[_0x36b1('0x6')]];}}catch(_0x1c669d){utils[_0x36b1('0x25')](util[_0x36b1('0x3')](_0x36b1('0x30'),_0x27aee3[_0x36b1('0x6')]),_0x1c669d);}};exports[_0x36b1('0x31')]=function(_0xdbc17a){try{if(!_[_0x36b1('0x16')](recordings[_0xdbc17a[_0x36b1('0x6')]])){utils[_0x36b1('0xf')](util[_0x36b1('0x3')]('[%s][recordings][newexten]',_0xdbc17a['uniqueid']),_0xdbc17a);utils[_0x36b1('0x2')](util[_0x36b1('0x3')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0xdbc17a[_0x36b1('0x6')],_0xdbc17a[_0x36b1('0x32')],_0xdbc17a[_0x36b1('0x33')]));if(_0xdbc17a[_0x36b1('0x32')][_0x36b1('0x34')]()==_0x36b1('0x35')&&_[_0x36b1('0x36')](_0xdbc17a[_0x36b1('0x33')][_0x36b1('0x34')](),_0x36b1('0x37'))){var _0x5337e3=_0xdbc17a[_0x36b1('0x33')]['split']('=');var _0x106963=_0x5337e3[0x0]['substring'](_0x5337e3[0x0][_0x36b1('0x38')]('(')+0x1,_0x5337e3[0x0][_0x36b1('0x38')](')'));var _0x114789=_0x5337e3[0x1];recordings[_0xdbc17a[_0x36b1('0x6')]][_0x106963]=_0x114789;}}}catch(_0x4b1194){utils[_0x36b1('0x25')](util[_0x36b1('0x3')]('[%s][recordings][newexten]',_0xdbc17a[_0x36b1('0x6')]),_0x4b1194);}};exports[_0x36b1('0x39')]=function(_0x397e52){try{if(!_[_0x36b1('0x16')](recordings[_0x397e52[_0x36b1('0x6')]])){utils[_0x36b1('0xf')](util[_0x36b1('0x3')](_0x36b1('0x3a'),_0x397e52[_0x36b1('0x6')]),_0x397e52);utils['info'](util[_0x36b1('0x3')](_0x36b1('0x3b'),_0x397e52['uniqueid'],_0x397e52[_0x36b1('0x3c')]));recordings[_0x397e52[_0x36b1('0x6')]][_0x36b1('0x3c')]=_0x397e52['queue'];}}catch(_0x53999c){utils['error'](util[_0x36b1('0x3')]('[%s][recordings][queuecallerjoin]',_0x397e52[_0x36b1('0x6')]),_0x53999c);}};exports[_0x36b1('0x3d')]=function(_0x1a19d9){try{utils[_0x36b1('0xf')](util[_0x36b1('0x3')]('[%s][recordings][blindtransfer]',_0x1a19d9['uniqueid']),_0x1a19d9);utils[_0x36b1('0x2')](util[_0x36b1('0x3')]('[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x1a19d9['uniqueid'],_0x1a19d9[_0x36b1('0x3e')],_0x1a19d9['transferercalleridname'],_0x1a19d9[_0x36b1('0x3f')],_0x1a19d9['transfereecalleridname']));if(recordings[_0x1a19d9['transfereruniqueid']]&&transfers[_0x36b1('0x5')][_0x1a19d9['transfereruniqueid']]){transfers['blinds'][_0x1a19d9['transfereruniqueid']][_0x36b1('0x40')]=!![];}}catch(_0x424bea){utils[_0x36b1('0x25')](util[_0x36b1('0x3')]('[%s][recordings][blindtransfer]',_0x1a19d9['uniqueid']),_0x424bea);}}; \ No newline at end of file +var _0x83b5=['[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','outbound','newexten','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','appdata','set','toLowerCase','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','lodash','util','./utils','./transfers.controller','info','uniqueid','blinds','transfereeuniqueid','accountcode','then','membername','request','CreateVoiceRecording','newchannel','debug','format','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','newstate','[%s][recordings][newstate]','isNil','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channelstate','transfer','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','find','monitors','push','hangup','[%s][recordings][hangup]'];(function(_0x3e307b,_0x5a3d7c){var _0x1f0f4e=function(_0x5daf5e){while(--_0x5daf5e){_0x3e307b['push'](_0x3e307b['shift']());}};_0x1f0f4e(++_0x5a3d7c);}(_0x83b5,0x133));var _0x583b=function(_0x319a03,_0x4456d4){_0x319a03=_0x319a03-0x0;var _0x3b6704=_0x83b5[_0x319a03];return _0x3b6704;};'use strict';var _=require(_0x583b('0x0'));var util=require(_0x583b('0x1'));var utils=require(_0x583b('0x2'));var transfers=require(_0x583b('0x3'));var recordings={};function writeDB(_0x1aa92b){var _0x4349eb;utils[_0x583b('0x4')](util['format']('[%s][recordings][writeDB]',_0x1aa92b[_0x583b('0x5')]));if(transfers[_0x583b('0x6')][_0x1aa92b[_0x583b('0x5')]]){_0x4349eb=_0x1aa92b[_0x583b('0x5')];_0x1aa92b[_0x583b('0x5')]=transfers[_0x583b('0x6')][_0x1aa92b[_0x583b('0x5')]][_0x583b('0x7')];}if(_0x1aa92b[_0x583b('0x8')]){utils['getUserByInternal'](_0x1aa92b[_0x583b('0x8')])[_0x583b('0x9')](function(_0x200f02){if(_0x200f02){_0x1aa92b[_0x583b('0xa')]=_0x200f02['name'];_0x1aa92b['UserId']=_0x200f02['id'];}utils[_0x583b('0xb')](_0x583b('0xc'),_0x1aa92b);});}else{utils[_0x583b('0xb')](_0x583b('0xc'),_0x1aa92b);}if(_0x4349eb)delete transfers[_0x583b('0x6')][_0x4349eb];}exports[_0x583b('0xd')]=function(_0x59e95c){try{utils[_0x583b('0xe')](util[_0x583b('0xf')](_0x583b('0x10'),_0x59e95c['uniqueid']),_0x59e95c);if(_0x59e95c[_0x583b('0x5')]==_0x59e95c[_0x583b('0x11')]){utils[_0x583b('0x4')](util[_0x583b('0xf')](_0x583b('0x12'),_0x59e95c[_0x583b('0x5')],_0x59e95c[_0x583b('0x13')],_0x59e95c['exten']));recordings[_0x59e95c[_0x583b('0x5')]]={'uniqueid':_0x59e95c[_0x583b('0x5')],'accountcode':_0x59e95c[_0x583b('0x8')],'exten':_0x59e95c[_0x583b('0x14')],'context':_0x59e95c[_0x583b('0x13')],'channel':_0x59e95c[_0x583b('0x15')],'monitors':[]};}}catch(_0x32ab71){utils[_0x583b('0x16')](util[_0x583b('0xf')]('[%s][recordings][newchannel]',_0x59e95c[_0x583b('0x5')]),_0x32ab71);}};exports[_0x583b('0x17')]=function(_0x54cce8){try{utils[_0x583b('0xe')](util[_0x583b('0xf')](_0x583b('0x18'),_0x54cce8[_0x583b('0x5')]),_0x54cce8);if(!_[_0x583b('0x19')](recordings[_0x54cce8[_0x583b('0x5')]])&&_0x54cce8['channelstate']==0x6){utils['info'](util['format'](_0x583b('0x1a'),_0x54cce8[_0x583b('0x5')],_0x54cce8['context'],_0x54cce8[_0x583b('0x15')]));}else if(!_[_0x583b('0x19')](recordings[_0x54cce8[_0x583b('0x11')]])&&_0x54cce8[_0x583b('0x1b')]==0x6&&_0x54cce8[_0x583b('0x13')]!=_0x583b('0x1c')){utils[_0x583b('0x4')](util[_0x583b('0xf')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x54cce8[_0x583b('0x5')],_0x54cce8[_0x583b('0x11')],_0x54cce8[_0x583b('0x13')],_0x54cce8[_0x583b('0x15')]));recordings[_0x54cce8[_0x583b('0x11')]]['accountcode']=_0x54cce8['accountcode'];}}catch(_0x240ca9){utils[_0x583b('0x16')](util[_0x583b('0xf')](_0x583b('0x18'),_0x54cce8[_0x583b('0x5')]),_0x240ca9);}};exports[_0x583b('0x1d')]=function(_0x5e84df){try{if(!_[_0x583b('0x19')](_0x5e84df[_0x583b('0x1e')])&&!_[_0x583b('0x19')](_0x5e84df['variable'][_0x583b('0x1f')])){utils[_0x583b('0xe')](util[_0x583b('0xf')](_0x583b('0x20'),_0x5e84df[_0x583b('0x5')]),_0x5e84df);utils[_0x583b('0x4')](util[_0x583b('0xf')](_0x583b('0x21'),_0x5e84df[_0x583b('0x5')],_0x5e84df[_0x583b('0x1e')],_0x5e84df[_0x583b('0x22')]));if(_[_0x583b('0x23')](_0x5e84df[_0x583b('0x22')],_0x583b('0x24'))){_0x5e84df[_0x583b('0x22')]=_0x5e84df[_0x583b('0x22')][_0x583b('0x25')](_0x583b('0x24'),'.WAV');}if(recordings[_0x5e84df['linkedid']]){var _0x1310c7=_[_0x583b('0x26')](recordings[_0x5e84df[_0x583b('0x11')]]['monitors'],{'value':_0x5e84df[_0x583b('0x22')]});if(_[_0x583b('0x19')](_0x1310c7)){recordings[_0x5e84df['linkedid']][_0x583b('0x27')][_0x583b('0x28')]({'value':_0x5e84df['value']});}}}}catch(_0x59aaae){utils[_0x583b('0x16')](util['format'](_0x583b('0x20'),_0x5e84df[_0x583b('0x5')]),_0x59aaae);}};exports[_0x583b('0x29')]=function(_0x1aa6ca){try{if(!_[_0x583b('0x19')](recordings[_0x1aa6ca[_0x583b('0x5')]])){utils['debug'](util[_0x583b('0xf')](_0x583b('0x2a'),_0x1aa6ca[_0x583b('0x5')]),_0x1aa6ca);utils['info'](util[_0x583b('0xf')](_0x583b('0x2b'),_0x1aa6ca[_0x583b('0x5')],_0x1aa6ca[_0x583b('0x2c')],_0x1aa6ca[_0x583b('0x2d')],_0x1aa6ca[_0x583b('0x2e')]));recordings[_0x1aa6ca['uniqueid']][_0x583b('0x2c')]=_0x1aa6ca[_0x583b('0x2c')];recordings[_0x1aa6ca[_0x583b('0x5')]][_0x583b('0x2d')]=_0x1aa6ca[_0x583b('0x2d')];recordings[_0x1aa6ca[_0x583b('0x5')]][_0x583b('0x2f')]=_0x1aa6ca['connectedlinenum'];recordings[_0x1aa6ca[_0x583b('0x5')]][_0x583b('0x30')]=_0x1aa6ca[_0x583b('0x30')];if(recordings[_0x1aa6ca['uniqueid']]['type']==_0x583b('0x31')&&recordings[_0x1aa6ca['uniqueid']][_0x583b('0x8')]){recordings[_0x1aa6ca[_0x583b('0x5')]][_0x583b('0x2f')]=recordings[_0x1aa6ca[_0x583b('0x5')]]['accountcode'];recordings[_0x1aa6ca[_0x583b('0x5')]][_0x583b('0x30')]='';}recordings[_0x1aa6ca['uniqueid']]['monitors']['forEach'](function(_0x4c1269){var _0x94d89b=_['clone'](recordings[_0x1aa6ca['uniqueid']]);_0x94d89b[_0x583b('0x22')]=_0x4c1269[_0x583b('0x22')];writeDB(_0x94d89b);});delete recordings[_0x1aa6ca['uniqueid']];}}catch(_0x1915fb){utils[_0x583b('0x16')](util[_0x583b('0xf')](_0x583b('0x2a'),_0x1aa6ca[_0x583b('0x5')]),_0x1915fb);}};exports[_0x583b('0x32')]=function(_0x1d7443){try{if(!_[_0x583b('0x19')](recordings[_0x1d7443[_0x583b('0x5')]])){utils[_0x583b('0xe')](util[_0x583b('0xf')]('[%s][recordings][newexten]',_0x1d7443[_0x583b('0x5')]),_0x1d7443);utils[_0x583b('0x4')](util[_0x583b('0xf')](_0x583b('0x33'),_0x1d7443['uniqueid'],_0x1d7443['application'],_0x1d7443[_0x583b('0x34')]));if(_0x1d7443['application']['toLowerCase']()==_0x583b('0x35')&&_['startsWith'](_0x1d7443[_0x583b('0x34')][_0x583b('0x36')](),'cdr')){var _0x53ecdc=_0x1d7443['appdata'][_0x583b('0x37')]('=');var _0x949da0=_0x53ecdc[0x0][_0x583b('0x38')](_0x53ecdc[0x0][_0x583b('0x39')]('(')+0x1,_0x53ecdc[0x0]['lastIndexOf'](')'));var _0x39df52=_0x53ecdc[0x1];recordings[_0x1d7443['uniqueid']][_0x949da0]=_0x39df52;}}}catch(_0x48be57){utils['error'](util[_0x583b('0xf')]('[%s][recordings][newexten]',_0x1d7443[_0x583b('0x5')]),_0x48be57);}};exports[_0x583b('0x3a')]=function(_0x5c841b){try{if(!_['isNil'](recordings[_0x5c841b['uniqueid']])){utils[_0x583b('0xe')](util[_0x583b('0xf')](_0x583b('0x3b'),_0x5c841b[_0x583b('0x5')]),_0x5c841b);utils[_0x583b('0x4')](util[_0x583b('0xf')](_0x583b('0x3c'),_0x5c841b[_0x583b('0x5')],_0x5c841b[_0x583b('0x3d')]));recordings[_0x5c841b[_0x583b('0x5')]][_0x583b('0x3d')]=_0x5c841b[_0x583b('0x3d')];}}catch(_0x37cc40){utils['error'](util[_0x583b('0xf')](_0x583b('0x3b'),_0x5c841b[_0x583b('0x5')]),_0x37cc40);}};exports[_0x583b('0x3e')]=function(_0x48d8a6){try{utils[_0x583b('0xe')](util['format'](_0x583b('0x3f'),_0x48d8a6[_0x583b('0x5')]),_0x48d8a6);utils[_0x583b('0x4')](util[_0x583b('0xf')]('[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x48d8a6[_0x583b('0x5')],_0x48d8a6[_0x583b('0x40')],_0x48d8a6[_0x583b('0x41')],_0x48d8a6[_0x583b('0x42')],_0x48d8a6[_0x583b('0x43')]));if(recordings[_0x48d8a6[_0x583b('0x44')]]&&transfers[_0x583b('0x6')][_0x48d8a6[_0x583b('0x44')]]){transfers[_0x583b('0x6')][_0x48d8a6['transfereruniqueid']][_0x583b('0x45')]=!![];}}catch(_0x4808dc){utils[_0x583b('0x16')](util[_0x583b('0xf')]('[%s][recordings][blindtransfer]',_0x48d8a6['uniqueid']),_0x4808dc);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index c901038..0ade37f 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 _0x91b3=['uniqueid','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','error','debug','origtransfereruniqueid','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','[%s][transfers][attendedtransfer]','lodash','util','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','CreateVoiceTransferReport','blinds','blindtransfer'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x91b3,0x190));var _0x391b=function(_0x9809bd,_0xd31e14){_0x9809bd=_0x9809bd-0x0;var _0x3df37d=_0x91b3[_0x9809bd];return _0x3df37d;};'use strict';var _=require(_0x391b('0x0'));var util=require(_0x391b('0x1'));var utils=require('./utils');function writeDB(_0x118dfc){utils[_0x391b('0x2')](util[_0x391b('0x3')](_0x391b('0x4'),_0x118dfc[_0x391b('0x5')]===_0x391b('0x6')?_0x118dfc['origtransfereruniqueid']:_0x118dfc['uniqueid'],_0x118dfc[_0x391b('0x5')]));utils['request'](_0x391b('0x7'),_0x118dfc);}exports[_0x391b('0x8')]={};exports[_0x391b('0x9')]=function(_0x52d90c){try{utils['debug'](util[_0x391b('0x3')]('[%s][transfers][blindtransfer]',_0x52d90c[_0x391b('0xa')]),_0x52d90c);utils[_0x391b('0x2')](util[_0x391b('0x3')](_0x391b('0xb'),_0x52d90c['uniqueid'],_0x52d90c[_0x391b('0xc')],_0x52d90c[_0x391b('0xd')],_0x52d90c[_0x391b('0xe')],_0x52d90c[_0x391b('0xf')]));_0x52d90c[_0x391b('0x5')]=_0x391b('0x10');exports[_0x391b('0x8')][_0x52d90c[_0x391b('0x11')]]=_0x52d90c;writeDB(_0x52d90c);}catch(_0x448dad){utils[_0x391b('0x12')](util[_0x391b('0x3')]('[%s][transfers][blindtransfer]',_0x52d90c['uniqueid']),_0x448dad);}};exports['attendedtransfer']=function(_0x57717f){try{utils[_0x391b('0x13')](util[_0x391b('0x3')]('[%s][transfers][attendedtransfer]',_0x57717f['origtransfereruniqueid']),_0x57717f);utils[_0x391b('0x2')](util['format']('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x57717f[_0x391b('0x14')],_0x57717f[_0x391b('0x15')],_0x57717f[_0x391b('0x16')],_0x57717f[_0x391b('0x17')],_0x57717f[_0x391b('0x18')]));_0x57717f=_[_0x391b('0x19')](_0x57717f,{'transfererchannel':_0x57717f[_0x391b('0x1a')],'transferercalleridnum':_0x57717f[_0x391b('0x15')],'transferercalleridname':_0x57717f[_0x391b('0x16')],'transfererconnectedlinenum':_0x57717f['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x57717f['secondtransfererconnectedlinename'],'transfereraccountcode':_0x57717f[_0x391b('0x1b')],'transferercontext':_0x57717f['secondtransferercontext'],'transfererexten':_0x57717f[_0x391b('0x1c')],'transfererlinkedid':_0x57717f[_0x391b('0x1d')],'context':_0x57717f[_0x391b('0x1e')],'extension':_0x57717f[_0x391b('0x1f')],'type':'attended'});if(_[_0x391b('0x20')](_0x57717f['transfereechannel'])){_0x57717f=_[_0x391b('0x19')](_0x57717f,{'transfereechannel':_0x57717f[_0x391b('0x21')],'transfereecalleridnum':_0x57717f[_0x391b('0x17')],'transfereecalleridname':_0x57717f[_0x391b('0x18')],'transfereeconnectedlinenum':_0x57717f[_0x391b('0x22')],'transfereeconnectedlinename':_0x57717f[_0x391b('0x23')],'transfereeaccountcode':_0x57717f[_0x391b('0x24')],'transfereecontext':_0x57717f[_0x391b('0x25')],'transfereeexten':_0x57717f[_0x391b('0x26')],'transfereelinkedid':_0x57717f[_0x391b('0x27')]});}writeDB(_0x57717f);}catch(_0x57b9bd){utils[_0x391b('0x12')](util[_0x391b('0x3')](_0x391b('0x28'),_0x57717f[_0x391b('0x14')]),_0x57b9bd);}}; \ No newline at end of file +var _0xb9af=['debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','blinds','transfereruniqueid','attendedtransfer','[%s][transfers][attendedtransfer]','origtransfereruniqueid','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetaccountcode','transfertargetcontext','error','lodash','util','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','uniqueid','CreateVoiceTransferReport','blindtransfer'];(function(_0x387cbc,_0x5b072c){var _0x24f07f=function(_0x17d5c1){while(--_0x17d5c1){_0x387cbc['push'](_0x387cbc['shift']());}};_0x24f07f(++_0x5b072c);}(_0xb9af,0xa2));var _0xfb9a=function(_0x33db5c,_0x20caba){_0x33db5c=_0x33db5c-0x0;var _0x2222b0=_0xb9af[_0x33db5c];return _0x2222b0;};'use strict';var _=require(_0xfb9a('0x0'));var util=require(_0xfb9a('0x1'));var utils=require('./utils');function writeDB(_0x1aefab){utils[_0xfb9a('0x2')](util[_0xfb9a('0x3')](_0xfb9a('0x4'),_0x1aefab[_0xfb9a('0x5')]===_0xfb9a('0x6')?_0x1aefab['origtransfereruniqueid']:_0x1aefab[_0xfb9a('0x7')],_0x1aefab['type']));utils['request'](_0xfb9a('0x8'),_0x1aefab);}exports['blinds']={};exports[_0xfb9a('0x9')]=function(_0xe983d4){try{utils[_0xfb9a('0xa')](util['format'](_0xfb9a('0xb'),_0xe983d4[_0xfb9a('0x7')]),_0xe983d4);utils[_0xfb9a('0x2')](util['format'](_0xfb9a('0xc'),_0xe983d4[_0xfb9a('0x7')],_0xe983d4[_0xfb9a('0xd')],_0xe983d4[_0xfb9a('0xe')],_0xe983d4[_0xfb9a('0xf')],_0xe983d4[_0xfb9a('0x10')]));_0xe983d4[_0xfb9a('0x5')]=_0xfb9a('0x11');exports[_0xfb9a('0x12')][_0xe983d4[_0xfb9a('0x13')]]=_0xe983d4;writeDB(_0xe983d4);}catch(_0x173f62){utils['error'](util[_0xfb9a('0x3')]('[%s][transfers][blindtransfer]',_0xe983d4[_0xfb9a('0x7')]),_0x173f62);}};exports[_0xfb9a('0x14')]=function(_0xb4049){try{utils[_0xfb9a('0xa')](util['format'](_0xfb9a('0x15'),_0xb4049[_0xfb9a('0x16')]),_0xb4049);utils['info'](util['format'](_0xfb9a('0x17'),_0xb4049[_0xfb9a('0x16')],_0xb4049['origtransferercalleridnum'],_0xb4049[_0xfb9a('0x18')],_0xb4049[_0xfb9a('0x19')],_0xb4049[_0xfb9a('0x1a')]));_0xb4049=_[_0xfb9a('0x1b')](_0xb4049,{'transfererchannel':_0xb4049[_0xfb9a('0x1c')],'transferercalleridnum':_0xb4049['origtransferercalleridnum'],'transferercalleridname':_0xb4049[_0xfb9a('0x18')],'transfererconnectedlinenum':_0xb4049[_0xfb9a('0x1d')],'transfererconnectedlinename':_0xb4049[_0xfb9a('0x1e')],'transfereraccountcode':_0xb4049[_0xfb9a('0x1f')],'transferercontext':_0xb4049[_0xfb9a('0x20')],'transfererexten':_0xb4049[_0xfb9a('0x21')],'transfererlinkedid':_0xb4049[_0xfb9a('0x22')],'context':_0xb4049[_0xfb9a('0x23')],'extension':_0xb4049[_0xfb9a('0x24')],'type':_0xfb9a('0x6')});if(_[_0xfb9a('0x25')](_0xb4049[_0xfb9a('0x26')])){_0xb4049=_['assign'](_0xb4049,{'transfereechannel':_0xb4049[_0xfb9a('0x27')],'transfereecalleridnum':_0xb4049[_0xfb9a('0x19')],'transfereecalleridname':_0xb4049[_0xfb9a('0x1a')],'transfereeconnectedlinenum':_0xb4049['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0xb4049['transfertargetconnectedlinename'],'transfereeaccountcode':_0xb4049[_0xfb9a('0x28')],'transfereecontext':_0xb4049[_0xfb9a('0x29')],'transfereeexten':_0xb4049['transfertargetexten'],'transfereelinkedid':_0xb4049['transfertargetlinkedid']});}writeDB(_0xb4049);}catch(_0x366c30){utils[_0xfb9a('0x2a')](util[_0xfb9a('0x3')]('[%s][transfers][attendedtransfer]',_0xb4049[_0xfb9a('0x16')]),_0x366c30);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 242895b..82f641a 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 _0x6929=['[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','getUserByInterface','getUserByName','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]','seconds','YYYY-MM-DD\x20HH:mm:ss','subtractTime','format','diffTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','client','http','../../config/logger','xdr','info','inspect','debug','error','then','[utils][request]\x20name:%s','catch','request','GetUser','name','interface'];(function(_0xee1463,_0x1a6c5b){var _0x268c16=function(_0x538da5){while(--_0x538da5){_0xee1463['push'](_0xee1463['shift']());}};_0x268c16(++_0x1a6c5b);}(_0x6929,0xc0));var _0x9692=function(_0x961333,_0x4c183a){_0x961333=_0x961333-0x0;var _0x48d01d=_0x6929[_0x961333];return _0x48d01d;};'use strict';var BPromise=require(_0x9692('0x0'));var jayson=require(_0x9692('0x1'));var moment=require(_0x9692('0x2'));var util=require('util');var client=jayson[_0x9692('0x3')][_0x9692('0x4')]({'port':0x2329});var logger=require(_0x9692('0x5'))(_0x9692('0x6'));exports[_0x9692('0x7')]=function(_0x2240af,_0x355fc0){logger[_0x9692('0x7')](_0x2240af,_0x355fc0?util[_0x9692('0x8')](_0x355fc0,{'showHidden':![],'depth':null}):'');};exports[_0x9692('0x9')]=function(_0x319deb,_0x56c4a2){logger[_0x9692('0x9')](_0x319deb,_0x56c4a2?util[_0x9692('0x8')](_0x56c4a2,{'showHidden':![],'depth':null}):'');};exports[_0x9692('0xa')]=function(_0x5cc286,_0x2d4059){logger[_0x9692('0xa')](_0x5cc286,_0x2d4059?util[_0x9692('0x8')](_0x2d4059,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x454eac,_0x48e046){return client['request'](_0x454eac,{'body':_0x48e046})[_0x9692('0xb')](function(_0x21a254){logger[_0x9692('0x9')](_0x9692('0xc'),_0x454eac,_0x21a254?util[_0x9692('0x8')](_0x21a254,{'showHidden':![],'depth':null}):'');})[_0x9692('0xd')](function(_0x1b17bb){logger['error'](_0x9692('0xc'),_0x454eac,_0x1b17bb?util[_0x9692('0x8')](_0x1b17bb,{'showHidden':![],'depth':null}):'');});};function getUser(_0x2d4481){return client[_0x9692('0xe')](_0x9692('0xf'),{'options':{'raw':!![],'attributes':['id','internal',_0x9692('0x10'),_0x9692('0x11')],'where':_0x2d4481,'limit':0x1}})[_0x9692('0xb')](function(_0x1c722a){logger[_0x9692('0x9')](_0x9692('0x12'),JSON[_0x9692('0x13')](_0x2d4481),_0x1c722a?util[_0x9692('0x8')](_0x1c722a,{'showHidden':![],'depth':null}):'');return _0x1c722a[_0x9692('0x14')][_0x9692('0x15')]?_0x1c722a[_0x9692('0x14')][0x0]:null;});}exports[_0x9692('0x16')]=function(_0x5ba16b){return new BPromise(function(_0x324e78,_0x470a24){if(_0x5ba16b){return getUser({'internal':_0x5ba16b})[_0x9692('0xb')](function(_0x29f3f6){logger['info'](_0x9692('0x17'),_0x5ba16b,_0x29f3f6?_0x9692('0x18'):_0x9692('0x19'));return _0x324e78(_0x29f3f6);})[_0x9692('0xd')](function(_0x5f5aa9){logger[_0x9692('0xa')]('[utils][getUserByInternal]',_0x5f5aa9?util[_0x9692('0x8')](_0x5f5aa9,{'showHidden':![],'depth':null}):'');return _0x324e78(null);});}return _0x324e78(null);});};exports[_0x9692('0x1a')]=function(_0x5d89af){return new BPromise(function(_0x37d09d,_0x2e13b9){if(_0x5d89af){return getUser({'interface':_0x5d89af})['then'](function(_0x2184ff){logger[_0x9692('0x7')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x5d89af,_0x2184ff?_0x9692('0x18'):_0x9692('0x19'));return _0x37d09d(_0x2184ff);})[_0x9692('0xd')](function(_0x44569d){logger[_0x9692('0xa')]('[utils][getUserByInterface]',_0x44569d?util['inspect'](_0x44569d,{'showHidden':![],'depth':null}):'');return _0x37d09d(null);});}return _0x37d09d(null);});};exports[_0x9692('0x1b')]=function(_0x5f2385){return new BPromise(function(_0x113d4f,_0x43a8b2){if(_0x5f2385){return getUser({'name':_0x5f2385})[_0x9692('0xb')](function(_0x209680){logger[_0x9692('0x7')]('[utils][getUserByName]\x20name:%s\x20%s',_0x5f2385,_0x209680?_0x9692('0x18'):_0x9692('0x19'));return _0x113d4f(_0x209680);})[_0x9692('0xd')](function(_0x2b0265){logger['error'](_0x9692('0x1c'),_0x2b0265?util[_0x9692('0x8')](_0x2b0265,{'showHidden':![],'depth':null}):'');return _0x113d4f(null);});}return _0x113d4f(null);});};exports[_0x9692('0x1d')]=function(_0x52dff6){return new BPromise(function(_0xcfca33,_0x2ca737){if(_0x52dff6){return client[_0x9692('0xe')](_0x9692('0x1e'),{'options':{'raw':!![],'attributes':['id','name','type','acw',_0x9692('0x1f')],'where':{'name':_0x52dff6},'limit':0x1}})[_0x9692('0xb')](function(_0x300162){logger['debug'](_0x9692('0x20'),_0x52dff6,_0x300162?util[_0x9692('0x8')](_0x300162,{'showHidden':![],'depth':null}):'');logger[_0x9692('0x7')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x52dff6,_0x300162?'found':_0x9692('0x19'));return _0xcfca33(_0x300162[_0x9692('0x14')]['length']?_0x300162['result'][0x0]:null);})[_0x9692('0xd')](function(_0x34d2d3){logger[_0x9692('0xa')](_0x9692('0x21'),_0x34d2d3?util[_0x9692('0x8')](_0x34d2d3,{'showHidden':![],'depth':null}):'');return _0xcfca33(null);});}return _0xcfca33(null);});};exports['addTime']=function(_0x2cb794,_0x3bfd23){return moment(_0x2cb794)['add'](_0x3bfd23,_0x9692('0x22'))['format'](_0x9692('0x23'));};exports[_0x9692('0x24')]=function(_0x38a8a3,_0x2af972){return moment(_0x38a8a3)['subtract'](_0x2af972,_0x9692('0x22'))[_0x9692('0x25')](_0x9692('0x23'));};exports[_0x9692('0x26')]=function(_0x2eac05,_0x2b18d5){return moment(_0x2eac05)['diff'](moment(_0x2b18d5),'seconds');};exports['sumTime']=function(_0x30c550,_0x2f7e2c){return parseInt(_0x30c550,0xa)+parseInt(_0x2f7e2c,0xa);};exports[_0x9692('0x27')]=function(){return moment()['format'](_0x9692('0x23'));};exports[_0x9692('0x28')]=function(_0x2ef4ab,_0x4c06a1){if(_0x4c06a1){return moment(_0x2ef4ab)[_0x9692('0x28')](_0x4c06a1);}return!![];};exports[_0x9692('0x29')]=function(_0x3f0f96,_0x411e83){if(_0x411e83){return moment(_0x3f0f96)['isBefore'](_0x411e83);}else if(_0x3f0f96){return!![];}return![];}; \ No newline at end of file +var _0x9576=['getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','catch','[utils][getUserByInternal]','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','result','addTime','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','isAfter','isBefore','bluebird','jayson/promise','moment','util','../../config/logger','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','GetUser','internal','name','[utils][getUser]\x20where:%s','stringify','length'];(function(_0x232f9c,_0x3ae9df){var _0x24bb71=function(_0x4fb958){while(--_0x4fb958){_0x232f9c['push'](_0x232f9c['shift']());}};_0x24bb71(++_0x3ae9df);}(_0x9576,0x182));var _0x6957=function(_0x52b5bc,_0x260b13){_0x52b5bc=_0x52b5bc-0x0;var _0x542fcb=_0x9576[_0x52b5bc];return _0x542fcb;};'use strict';var BPromise=require(_0x6957('0x0'));var jayson=require(_0x6957('0x1'));var moment=require(_0x6957('0x2'));var util=require(_0x6957('0x3'));var client=jayson['client']['http']({'port':0x2329});var logger=require(_0x6957('0x4'))(_0x6957('0x5'));exports[_0x6957('0x6')]=function(_0x10ed80,_0x413fde){logger[_0x6957('0x6')](_0x10ed80,_0x413fde?util[_0x6957('0x7')](_0x413fde,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x6d8af8,_0x3425fe){logger[_0x6957('0x8')](_0x6d8af8,_0x3425fe?util[_0x6957('0x7')](_0x3425fe,{'showHidden':![],'depth':null}):'');};exports[_0x6957('0x9')]=function(_0x3b6461,_0x486361){logger[_0x6957('0x9')](_0x3b6461,_0x486361?util[_0x6957('0x7')](_0x486361,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x55078f,_0x3e0520){return client[_0x6957('0xa')](_0x55078f,{'body':_0x3e0520})[_0x6957('0xb')](function(_0x476167){logger[_0x6957('0x8')](_0x6957('0xc'),_0x55078f,_0x476167?util[_0x6957('0x7')](_0x476167,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x5888d6){logger['error'](_0x6957('0xc'),_0x55078f,_0x5888d6?util[_0x6957('0x7')](_0x5888d6,{'showHidden':![],'depth':null}):'');});};function getUser(_0x1bf2cc){return client[_0x6957('0xa')](_0x6957('0xd'),{'options':{'raw':!![],'attributes':['id',_0x6957('0xe'),_0x6957('0xf'),'interface'],'where':_0x1bf2cc,'limit':0x1}})['then'](function(_0x4f82cb){logger[_0x6957('0x8')](_0x6957('0x10'),JSON[_0x6957('0x11')](_0x1bf2cc),_0x4f82cb?util[_0x6957('0x7')](_0x4f82cb,{'showHidden':![],'depth':null}):'');return _0x4f82cb['result'][_0x6957('0x12')]?_0x4f82cb['result'][0x0]:null;});}exports[_0x6957('0x13')]=function(_0xabd232){return new BPromise(function(_0x49aa31,_0x2ccd8e){if(_0xabd232){return getUser({'internal':_0xabd232})[_0x6957('0xb')](function(_0x26b577){logger['info'](_0x6957('0x14'),_0xabd232,_0x26b577?_0x6957('0x15'):_0x6957('0x16'));return _0x49aa31(_0x26b577);})[_0x6957('0x17')](function(_0x1ce753){logger[_0x6957('0x9')](_0x6957('0x18'),_0x1ce753?util[_0x6957('0x7')](_0x1ce753,{'showHidden':![],'depth':null}):'');return _0x49aa31(null);});}return _0x49aa31(null);});};exports['getUserByInterface']=function(_0x5ee3f8){return new BPromise(function(_0x37c974,_0xa6dd1f){if(_0x5ee3f8){return getUser({'interface':_0x5ee3f8})[_0x6957('0xb')](function(_0x2569f4){logger[_0x6957('0x6')](_0x6957('0x19'),_0x5ee3f8,_0x2569f4?_0x6957('0x15'):_0x6957('0x16'));return _0x37c974(_0x2569f4);})['catch'](function(_0x2b2dcd){logger[_0x6957('0x9')](_0x6957('0x1a'),_0x2b2dcd?util[_0x6957('0x7')](_0x2b2dcd,{'showHidden':![],'depth':null}):'');return _0x37c974(null);});}return _0x37c974(null);});};exports['getUserByName']=function(_0x4cc749){return new BPromise(function(_0xa1e6af,_0x2a57b6){if(_0x4cc749){return getUser({'name':_0x4cc749})['then'](function(_0x5da47a){logger[_0x6957('0x6')](_0x6957('0x1b'),_0x4cc749,_0x5da47a?_0x6957('0x15'):'notfound');return _0xa1e6af(_0x5da47a);})[_0x6957('0x17')](function(_0x2c24c2){logger[_0x6957('0x9')](_0x6957('0x1c'),_0x2c24c2?util[_0x6957('0x7')](_0x2c24c2,{'showHidden':![],'depth':null}):'');return _0xa1e6af(null);});}return _0xa1e6af(null);});};exports[_0x6957('0x1d')]=function(_0x2d33ef){return new BPromise(function(_0x320e1a,_0x595770){if(_0x2d33ef){return client[_0x6957('0xa')](_0x6957('0x1e'),{'options':{'raw':!![],'attributes':['id',_0x6957('0xf'),_0x6957('0x1f'),_0x6957('0x20'),_0x6957('0x21')],'where':{'name':_0x2d33ef},'limit':0x1}})[_0x6957('0xb')](function(_0xef7f63){logger[_0x6957('0x8')](_0x6957('0x22'),_0x2d33ef,_0xef7f63?util[_0x6957('0x7')](_0xef7f63,{'showHidden':![],'depth':null}):'');logger['info']('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x2d33ef,_0xef7f63?_0x6957('0x15'):_0x6957('0x16'));return _0x320e1a(_0xef7f63[_0x6957('0x23')][_0x6957('0x12')]?_0xef7f63['result'][0x0]:null);})[_0x6957('0x17')](function(_0xf194c6){logger[_0x6957('0x9')]('[utils][getVoiceQueueByName]',_0xf194c6?util['inspect'](_0xf194c6,{'showHidden':![],'depth':null}):'');return _0x320e1a(null);});}return _0x320e1a(null);});};exports[_0x6957('0x24')]=function(_0x27d019,_0x425294){return moment(_0x27d019)['add'](_0x425294,_0x6957('0x25'))[_0x6957('0x26')](_0x6957('0x27'));};exports[_0x6957('0x28')]=function(_0x1ccff8,_0x19da87){return moment(_0x1ccff8)[_0x6957('0x29')](_0x19da87,_0x6957('0x25'))[_0x6957('0x26')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x6957('0x2a')]=function(_0x298b9b,_0x3358ca){return moment(_0x298b9b)['diff'](moment(_0x3358ca),'seconds');};exports['sumTime']=function(_0x9dc614,_0x59a58e){return parseInt(_0x9dc614,0xa)+parseInt(_0x59a58e,0xa);};exports['now']=function(){return moment()[_0x6957('0x26')](_0x6957('0x27'));};exports['isAfter']=function(_0x4e90f9,_0x2f46e5){if(_0x2f46e5){return moment(_0x4e90f9)[_0x6957('0x2b')](_0x2f46e5);}return!![];};exports[_0x6957('0x2c')]=function(_0x33a182,_0x122c73){if(_0x122c73){return moment(_0x33a182)['isBefore'](_0x122c73);}else if(_0x33a182){return!![];}return![];}; \ No newline at end of file -- 1.7.1